text
stringlengths
9
39.2M
dir
stringlengths
26
295
lang
stringclasses
185 values
created_date
timestamp[us]
updated_date
timestamp[us]
repo_name
stringlengths
1
97
repo_full_name
stringlengths
7
106
star
int64
1k
183k
len_tokens
int64
1
13.8M
```xml import { IUserDocument } from "@erxes/api-utils/src/types"; import { sendCoreMessage } from "./messageBroker"; import * as dayjs from "dayjs"; import { IModels, generateModels } from "./connectionResolver"; const MMSTOMINS = 60000; const MMSTOHRS = MMSTOMINS * 60; const INBOX_TAG_TYPE = "inbox:conversation"; const NOW = new Date(); const MONTH_NAMES = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; const reportTemplates = [ { serviceType: "inbox", title: "Inbox chart", serviceName: "inbox", description: "Chat conversation charts", charts: [ "averageFirstResponseTime", "averageCloseTime", "closedConversationsCountByRep", "conversationsCountByTag", "conversationsCountBySource", "conversationsCountByRep", "conversationsCountByStatus", "conversationsCount" ], img: "path_to_url" } ]; const DIMENSION_OPTIONS = [ { label: "Team members", value: "teamMember" }, { label: "Departments", value: "department" }, { label: "Branches", value: "branch" }, { label: "Source/Channel", value: "source" }, { label: "Brands", value: "brand" }, { label: "Tags", value: "tag" }, { label: "Labels", value: "label" }, { label: "Frequency (day, week, month)", value: "frequency" }, { label: "Status", value: "status" } ]; const checkFilterParam = (param: any) => { return param && param.length; }; const getDates = (startDate: Date, endDate: Date) => { const result: { start: Date; end: Date; label: string }[] = []; let currentDate = new Date(startDate); // Loop through each day between start and end dates while (dayjs(currentDate) <= dayjs(endDate)) { // Calculate the start date of the current day (00:00:00) let startOfDay = new Date(currentDate); startOfDay.setHours(0, 0, 0, 0); // Calculate the end date of the current day (23:59:59) let endOfDay = new Date(currentDate); endOfDay.setHours(23, 59, 59, 999); // Add the start and end dates of the current day to the result array result.push({ start: startOfDay, end: endOfDay, label: dayjs(startOfDay).format("M/D dd") }); // Move to the next day currentDate.setDate(currentDate.getDate() + 1); } return result; }; const getMonths = (startDate: Date, endDate: Date) => { // Initialize an array to store the results const result: { start: Date; end: Date; label: string }[] = []; // Clone the start date to avoid modifying the original date let currentDate = new Date(startDate); // Loop through each month between start and end dates while (dayjs(currentDate) <= dayjs(endDate)) { // Get the year and month of the current date const year = currentDate.getFullYear(); const month = currentDate.getMonth(); // Calculate the start date of the current month const startOfMonth = new Date(year, month, 1); // Calculate the end date of the current month const endOfMonth = new Date(year, month + 1, 0); // Add the start and end dates of the current month to the result array result.push({ start: startOfMonth, end: endOfMonth, label: MONTH_NAMES[startOfMonth.getMonth()] }); // Move to the next month currentDate.setMonth(month + 1); } return result; }; const getWeeks = (startDate: Date, endDate: Date) => { // Initialize an array to store the results const result: { start: Date; end: Date; label: string }[] = []; // Clone the start date to avoid modifying the original date let currentDate = new Date(startDate); let weekIndex = 1; // Move to the first day of the week (Sunday) currentDate.setDate(currentDate.getDate() - currentDate.getDay()); // Loop through each week between start and end dates while (dayjs(currentDate) <= dayjs(endDate)) { // Calculate the start date of the current week const startOfWeek = new Date(currentDate); // Calculate the end date of the current week (Saturday) const endOfWeek = new Date(currentDate); endOfWeek.setDate(endOfWeek.getDate() + 6); const dateFormat = "M/D"; const label = `Week ${weekIndex} ${dayjs(startOfWeek).format( dateFormat )} - ${dayjs(endOfWeek).format(dateFormat)}`; // Add the start and end dates of the current week to the result array result.push({ start: startOfWeek, end: endOfWeek, label }); // Move to the next week currentDate.setDate(currentDate.getDate() + 7); weekIndex++; } return result; }; // integrationTypess // XOS messenger // email // Call // CallPro // FB post // FB messenger // SMS // All const DATERANGE_TYPES = [ { label: "All time", value: "all" }, { label: "Today", value: "today" }, { label: "Yesterday", value: "yesterday" }, { label: "This Week", value: "thisWeek" }, { label: "Last Week", value: "lastWeek" }, { label: "This Month", value: "thisMonth" }, { label: "Last Month", value: "lastMonth" }, { label: "This Year", value: "thisYear" }, { label: "Last Year", value: "lastYear" }, { label: "Custom Date", value: "customDate" } ]; const CUSTOM_DATE_FREQUENCY_TYPES = [ { label: "By week", value: "byWeek" }, { label: "By month", value: "byMonth" }, { label: "By date", value: "byDate" } ]; const INTEGRATION_TYPES = [ { label: "XOS Messenger", value: "messenger" }, { label: "Email", value: "email" }, { label: "Call", value: "calls" }, { label: "Callpro", value: "callpro" }, { label: "SMS", value: "sms" }, { label: "Facebook Messenger", value: "facebook-messenger" }, { label: "Facebook Post", value: "facebook-post" }, { label: "All", value: "all" } ]; const STATUS_TYPES = [ { label: "All", value: "all" }, { label: "Closed / Resolved", value: "closed" }, { label: "Open", value: "open" }, { label: "Unassigned", value: "unassigned" } ]; const calculateAverage = (arr: number[]) => { if (!arr || !arr.length) { return 0; // Handle division by zero for an empty array } const sum = arr.reduce((acc, curr) => acc + curr, 0); return (sum / arr.length).toFixed(); }; const returnDateRange = (dateRange: string, startDate: Date, endDate: Date) => { const startOfToday = new Date(NOW.setHours(0, 0, 0, 0)); const endOfToday = new Date(NOW.setHours(23, 59, 59, 999)); const startOfYesterday = new Date( dayjs(NOW).add(-1, "day").toDate().setHours(0, 0, 0, 0) ); let $gte; let $lte; switch (dateRange) { case "today": $gte = startOfToday; $lte = endOfToday; break; case "yesterday": $gte = startOfYesterday; $lte = startOfToday; case "thisWeek": $gte = dayjs(NOW).startOf("week").toDate(); $lte = dayjs(NOW).endOf("week").toDate(); break; case "lastWeek": $gte = dayjs(NOW).add(-1, "week").startOf("week").toDate(); $lte = dayjs(NOW).add(-1, "week").endOf("week").toDate(); break; case "lastMonth": $gte = dayjs(NOW).add(-1, "month").startOf("month").toDate(); $lte = dayjs(NOW).add(-1, "month").endOf("month").toDate(); break; case "thisMonth": $gte = dayjs(NOW).startOf("month").toDate(); $lte = dayjs(NOW).endOf("month").toDate(); break; case "thisYear": $gte = dayjs(NOW).startOf("year").toDate(); $lte = dayjs(NOW).endOf("year").toDate(); break; case "lastYear": $gte = dayjs(NOW).add(-1, "year").startOf("year").toDate(); $lte = dayjs(NOW).add(-1, "year").endOf("year").toDate(); break; case "customDate": $gte = new Date(startDate); $lte = new Date(endDate); break; // all default: break; } if ($gte && $lte) { return { $gte, $lte }; } return {}; }; const returnDateRanges = ( dateRange: string, $gte: Date, $lte: Date, customDateFrequencyType?: string ) => { let dateRanges; if (dateRange.toLowerCase().includes("week")) { dateRanges = getDates($gte, $lte); } if (dateRange.toLowerCase().includes("month")) { dateRanges = getWeeks($gte, $lte); } if (dateRange.toLowerCase().includes("year")) { dateRanges = getMonths($gte, $lte); } if (dateRange === "customDate") { if (customDateFrequencyType) { switch (customDateFrequencyType) { case "byMonth": dateRanges = getMonths($gte, $lte); return dateRanges; case "byWeek": dateRanges = getWeeks($gte, $lte); return dateRanges; } } // by date dateRanges = getDates($gte, $lte); } return dateRanges; }; const chartTemplates = [ { templateType: "averageFirstResponseTime", serviceType: "inbox", name: "Average first response time by rep in hours", chartTypes: [ "bar", "line", "pie", "doughnut", "radar", "polarArea", "table" ], getChartResult: async ( models: IModels, filter: any, dimension: any, subdomain: string ) => { const matchfilter = { "conversationMessages.internal": false, "conversationMessages.content": { $ne: "" } }; const { startDate, endDate, tagIds } = filter; const { departmentIds, branchIds, userIds } = filter; let departmentUsers; let filterUserIds: any = []; if (checkFilterParam(departmentIds)) { const findDepartmentUsers = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { departmentIds: { $in: filter.departmentIds }, isActive: true } }, isRPC: true, defaultValue: [] }); departmentUsers = findDepartmentUsers; filterUserIds = findDepartmentUsers.map(user => user._id); } if (checkFilterParam(branchIds)) { const findBranchUsers = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { branchIds: { $in: filter.branchIds }, isActive: true } }, isRPC: true, defaultValue: [] }); filterUserIds.push(...findBranchUsers.map(user => user._id)); } if (checkFilterParam(userIds)) { filterUserIds = filter.userIds; } // filter by source if (filter.integrationTypes && !filter.integrationTypes.includes("all")) { const { integrationTypes } = filter; const integrations: any = await models.Integrations.find({ kind: { $in: integrationTypes } }); const integrationIds = integrations.map(i => i._id); matchfilter["integrationId"] = { $in: integrationIds }; } // filter by date if (filter.dateRange) { const dateFilter = returnDateRange( filter.dateRange, startDate, endDate ); if (Object.keys(dateFilter).length) { matchfilter["createdAt"] = dateFilter; } } if (checkFilterParam(tagIds)) { matchfilter["conversationMessages.tagIds"] = { $in: tagIds }; } matchfilter["conversationMessages.userId"] = filterUserIds.length ? { $exists: true, $in: filterUserIds } : { $exists: true }; const conversations = await models.Conversations.aggregate([ { $lookup: { from: "conversation_messages", let: { id: "$_id", customerFirstMessagedAt: "$createdAt" }, pipeline: [ { $match: { $expr: { $eq: ["$conversationId", "$$id"] } } } ], as: "conversationMessages" } }, { $project: { _id: 1, createdAt: 1, conversationMessages: 1, integrationId: 1, closedAt: 1, closedUserId: 1, firstRespondedDate: 1, firstRespondedUserId: 1, tagIds: 1 } }, { $match: { conversationMessages: { $not: { $size: 0 } } // Filter out documents with empty 'conversationMessages' array } }, { $unwind: "$conversationMessages" }, { $sort: { "conversationMessages.createdAt": 1 } }, { $match: matchfilter }, { $group: { _id: "$_id", conversationMessages: { $push: "$conversationMessages" }, customerMessagedAt: { $first: "$createdAt" }, integrationId: { $first: "$integrationId" }, closedAt: { $first: "$closedAt" }, closedUserId: { $first: "$closedUserId" }, firstRespondedDate: { $first: "$firstRespondedDate" }, firstResponedUserId: { $first: "$firstResponedUserId" } } } ]); type UserWithFirstRespondTime = { [userId: string]: number[]; }; const usersWithRespondTime: UserWithFirstRespondTime = {}; if (conversations) { for (const convo of conversations) { const { conversationMessages, firstRespondedDate, firstResponedUserId, customerMessagedAt } = convo; if (firstRespondedDate && firstResponedUserId) { const respondTime = (new Date(firstRespondedDate).getTime() - new Date(customerMessagedAt).getTime()) / MMSTOHRS; if (firstResponedUserId in usersWithRespondTime) { usersWithRespondTime[firstResponedUserId] = [ ...usersWithRespondTime[firstResponedUserId], respondTime ]; } else { usersWithRespondTime[firstResponedUserId] = [respondTime]; } continue; } if (conversationMessages.length) { const getFirstRespond = conversationMessages[0]; const { userId } = getFirstRespond; const respondTime = (new Date(getFirstRespond.createdAt).getTime() - new Date(customerMessagedAt).getTime()) / MMSTOHRS; if (userId in usersWithRespondTime) { usersWithRespondTime[userId] = [ ...usersWithRespondTime[userId], respondTime ]; } else { usersWithRespondTime[userId] = [respondTime]; } } } } const getTotalRespondedUsers: IUserDocument[] = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { _id: { $in: Object.keys(usersWithRespondTime) }, isActive: true } }, isRPC: true, defaultValue: [] }); const usersMap = {}; for (const user of getTotalRespondedUsers) { usersMap[user._id] = { fullName: user.details?.fullName || `${user.details?.firstName || ""} ${user.details?.lastName || ""}`, avgRespondtime: calculateAverage(usersWithRespondTime[user._id]) }; } const data = Object.values(usersMap).map((t: any) => t.avgRespondtime); const labels = Object.values(usersMap).map((t: any) => t.fullName); const title = "Average first response time in hours"; const datasets = { title, data, labels }; return datasets; }, filterTypes: [ { fieldName: "userIds", fieldType: "select", multi: true, fieldQuery: "users", fieldLabel: "Select users" }, { fieldName: "departmentIds", fieldType: "select", multi: true, fieldQuery: "departments", fieldLabel: "Select departments" }, { fieldName: "branchIds", fieldType: "select", multi: true, fieldQuery: "branches", fieldLabel: "Select branches" }, { fieldName: "integrationTypes", fieldType: "select", fieldQuery: "integrations", multi: true, fieldOptions: INTEGRATION_TYPES, fieldLabel: "Select source" }, { fieldName: "tagIds", fieldType: "select", fieldQuery: "tags", fieldValueVariable: "_id", fieldLabelVariable: "name", fieldQueryVariables: `{"type": "${INBOX_TAG_TYPE}", "perPage": 1000}`, multi: true, fieldLabel: "Select tags" }, { fieldName: "dateRange", fieldType: "select", multi: true, fieldQuery: "date", fieldOptions: DATERANGE_TYPES, fieldLabel: "Select date range", fieldDefaultValue: "all" } ] }, { templateType: "averageCloseTime", serviceType: "inbox", name: "Average chat close time by rep in hours", chartTypes: [ "bar", "line", "pie", "doughnut", "radar", "polarArea", "table" ], getChartResult: async ( models: IModels, filter: any, dimension: any, subdomain: string ) => { const matchfilter = { status: /closed/gi, closedAt: { $exists: true } }; const { departmentIds, branchIds, userIds, tagIds, brandIds } = filter; let departmentUsers; let filterUserIds: any = []; const integrationsDict = {}; if (checkFilterParam(departmentIds)) { const findDepartmentUsers = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { departmentIds: { $in: filter.departmentIds }, isActive: true } }, isRPC: true, defaultValue: [] }); departmentUsers = findDepartmentUsers; filterUserIds = findDepartmentUsers.map(user => user._id); } if (checkFilterParam(branchIds)) { const findBranchUsers = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { branchIds: { $in: filter.branchIds }, isActive: true } }, isRPC: true, defaultValue: [] }); filterUserIds.push(...findBranchUsers.map(user => user._id)); } if (checkFilterParam(userIds)) { filterUserIds = filter.userIds; } // filter by tags if (checkFilterParam(tagIds)) { matchfilter["conversationMessages.tagIds"] = { $in: tagIds }; } // filter by source if (filter.integrationTypes && !filter.integrationTypes.includes("all")) { const { integrationTypes } = filter; const integrations: any = await models.Integrations.find({ kind: { $in: integrationTypes } }); const integrationIds = integrations.map(i => i._id); matchfilter["integrationId"] = { $in: integrationIds }; } // filter by date if (filter.dateRange) { const { startDate, endDate, dateRange } = filter; let dateFilter = {}; dateFilter = returnDateRange(dateRange, startDate, endDate); if (Object.keys(dateFilter).length) { matchfilter["createdAt"] = dateFilter; } } matchfilter["closedUserId"] = filterUserIds.length ? { $exists: true, $in: filterUserIds } : { $exists: true }; const usersWithClosedTime = await models.Conversations.aggregate([ { $match: matchfilter }, { $project: { closeTimeDifference: { $subtract: ["$closedAt", "$createdAt"] }, closedUserId: "$closedUserId" } }, { $group: { _id: "$closedUserId", avgCloseTimeDifference: { $avg: "$closeTimeDifference" } } } ]); const usersWithClosedTimeMap = {}; const getUserIds: string[] = []; if (usersWithClosedTime) { for (const user of usersWithClosedTime) { getUserIds.push(user._id); usersWithClosedTimeMap[user._id] = ( user.avgCloseTimeDifference / MMSTOHRS ).toFixed(); } } const getTotalClosedUsers: IUserDocument[] = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { _id: { $in: getUserIds }, isActive: true } }, isRPC: true, defaultValue: [] }); const usersMap = {}; for (const user of getTotalClosedUsers) { usersMap[user._id] = { fullName: user.details?.fullName || `${user.details?.firstName || ""} ${user.details?.lastName || ""}`, avgCloseTime: usersWithClosedTimeMap[user._id] }; } const data = Object.values(usersMap).map((t: any) => t.avgCloseTime); const labels = Object.values(usersMap).map((t: any) => t.fullName); const title = "Average conversation close time in hours"; const datasets = { title, data, labels }; return datasets; }, filterTypes: [ { fieldName: "userIds", fieldType: "select", multi: true, fieldQuery: "users", fieldLabel: "Select users" }, { fieldName: "departmentIds", fieldType: "select", multi: true, fieldQuery: "departments", fieldLabel: "Select departments" }, { fieldName: "branchIds", fieldType: "select", multi: true, fieldQuery: "branches", fieldLabel: "Select branches" }, { fieldName: "integrationTypes", fieldType: "select", fieldQuery: "integrations", multi: true, fieldOptions: INTEGRATION_TYPES, fieldLabel: "Select source" }, { fieldName: "tagIds", fieldType: "select", fieldQuery: "tags", fieldValueVariable: "_id", fieldLabelVariable: "name", fieldQueryVariables: `{"type": "${INBOX_TAG_TYPE}", "perPage": 1000}`, multi: true, fieldLabel: "Select tags" }, { fieldName: "dateRange", fieldType: "select", multi: true, fieldQuery: "date", fieldOptions: DATERANGE_TYPES, fieldLabel: "Select date range", fieldDefaultValue: "all" } ] }, { templateType: "closedConversationsCountByRep", serviceType: "inbox", name: "Total closed conversations count by rep", chartTypes: [ "bar", "line", "pie", "doughnut", "radar", "polarArea", "table" ], getChartResult: async ( models: IModels, filter: any, dimension: any, subdomain: string ) => { const data: number[] = []; const labels: string[] = []; const matchfilter = {}; const filterStatus = filter.status; let title = `Total closed conversations count by rep`; const { departmentIds, branchIds, userIds, brandIds, dateRange, integrationTypes, tagIds } = filter; let filterUserIds: any = []; const integrationsDict = {}; if (checkFilterParam(departmentIds)) { const findDepartmentUsers = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { departmentIds: { $in: filter.departmentIds }, isActive: true } }, isRPC: true, defaultValue: [] }); filterUserIds = findDepartmentUsers.map(user => user._id); } if (checkFilterParam(branchIds)) { const findBranchUsers = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { branchIds: { $in: filter.branchIds }, isActive: true } }, isRPC: true, defaultValue: [] }); filterUserIds.push(...findBranchUsers.map(user => user._id)); } if (checkFilterParam(tagIds)) { matchfilter["tagIds"] = { $in: tagIds }; } // if team members selected, go by team members if (checkFilterParam(userIds)) { filterUserIds = userIds; } if (dateRange) { const { startDate, endDate } = filter; const dateFilter = returnDateRange(dateRange, startDate, endDate); if (Object.keys(dateFilter).length) { matchfilter["createdAt"] = dateFilter; } } // filter by status if (filterStatus && filterStatus !== "all") { if (filterStatus === "unassigned") { matchfilter["assignedUserId"] = null; } else { //open or closed matchfilter["status"] = filterStatus; } } const integrationFindQuery = {}; // filter integrations by brands if (checkFilterParam(brandIds)) { integrationFindQuery["brandId"] = { $in: filter.brandIds }; const integrations: any = await models.Integrations.find(integrationFindQuery); const integrationIds = integrations.map(i => i._id); matchfilter["integrationId"] = { $in: integrationIds }; } // filter by source if (integrationTypes && !integrationTypes.includes("all")) { const { integrationTypes } = filter; integrationFindQuery["kind"] = { $in: integrationTypes }; const integrations: any = await models.Integrations.find(integrationFindQuery); const integrationIds: string[] = []; for (const integration of integrations) { integrationsDict[integration._id] = integration.kind; integrationIds.push(integration._id); } matchfilter["integrationId"] = { $in: integrationIds }; } let userIdGroup; matchfilter["closedUserId"] = filter && (filter.userIds || filter.departmentIds || filter.branchIds) ? { $exists: true, $in: filterUserIds } : { $exists: true }; userIdGroup = { $group: { _id: "$closedUserId", conversationsCount: { $sum: 1 } } }; const usersWithConvosCount = await models.Conversations.aggregate([ { $match: matchfilter }, userIdGroup ]); const getUserIds: string[] = usersWithConvosCount?.map(r => r._id) || []; const getTotalUsers: IUserDocument[] = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { _id: { $in: getUserIds }, isActive: true } }, isRPC: true, defaultValue: [] }); const usersMap = {}; for (const user of getTotalUsers) { usersMap[user._id] = { fullName: user.details?.fullName || `${user.details?.firstName || ""} ${user.details?.lastName || ""}`, departmentIds: user.departmentIds, branchIds: user.branchIds }; } // team members if (usersWithConvosCount) { for (const user of usersWithConvosCount) { if (!usersMap[user._id]) { continue; } data.push(user.conversationsCount); labels.push(usersMap[user._id].fullName); } } const datasets = { title, data, labels }; return datasets; }, filterTypes: [ { fieldName: "userIds", fieldType: "select", multi: true, fieldQuery: "users", fieldLabel: "Select users" }, { fieldName: "departmentIds", fieldType: "select", multi: true, fieldQuery: "departments", fieldLabel: "Select departments" }, { fieldName: "branchIds", fieldType: "select", multi: true, fieldQuery: "branches", fieldLabel: "Select branches" }, { fieldName: "integrationTypes", fieldType: "select", multi: true, fieldQuery: "integrations", fieldOptions: INTEGRATION_TYPES, fieldLabel: "Select source" }, { fieldName: "brandIds", fieldType: "select", fieldQuery: "allBrands", fieldValueVariable: "_id", fieldLabelVariable: "name", multi: true, fieldLabel: "Select brands" }, { fieldName: "tagIds", fieldType: "select", fieldQuery: "tags", fieldValueVariable: "_id", fieldLabelVariable: "name", fieldQueryVariables: `{"type": "${INBOX_TAG_TYPE}", "perPage": 1000}`, multi: true, fieldLabel: "Select tags" }, { fieldName: "dateRange", fieldType: "select", multi: true, fieldQuery: "date", fieldOptions: DATERANGE_TYPES, fieldLabel: "Select date range", fieldDefaultValue: "all" } ] }, { templateType: "conversationsCountByTag", serviceType: "inbox", name: "Total conversations count by tag", chartTypes: [ "bar", "line", "pie", "doughnut", "radar", "polarArea", "table" ], getChartResult: async ( models: IModels, filter: any, dimension: any, subdomain: string ) => { const data: number[] = []; const labels: string[] = []; const matchfilter = {}; const { dateRange, tagIds } = filter; let groupByQuery; if (checkFilterParam(tagIds)) { matchfilter["tagIds"] = { $in: tagIds }; } if (dateRange) { const { startDate, endDate } = filter; const dateFilter = returnDateRange(dateRange, startDate, endDate); if (Object.keys(dateFilter).length) { matchfilter["createdAt"] = dateFilter; } } const query = checkFilterParam(tagIds) ? { _id: { $in: tagIds } } : {}; const tags = await sendCoreMessage({ subdomain, action: "tagFind", data: { ...query }, isRPC: true, defaultValue: [] }); const tagsMap: { [key: string]: string } = {}; for (const tag of tags) { tagsMap[tag._id] = tag.name; } groupByQuery = { $group: { _id: "$tagIds", conversationsCount: { $sum: 1 } } }; const convosCountByTag = await models.Conversations.aggregate([ { $match: { ...matchfilter, integrationId: { $exists: true } } }, { $unwind: "$tagIds" }, groupByQuery ]); if (convosCountByTag) { for (const convo of convosCountByTag) { data.push(convo.conversationsCount); labels.push(tagsMap[convo._id]); } } const title = "Total conversations count by tag"; return { title, labels, data }; }, filterTypes: [ { fieldName: "tagIds", fieldType: "select", fieldQuery: "tags", fieldValueVariable: "_id", fieldLabelVariable: "name", fieldQueryVariables: `{"type": "${INBOX_TAG_TYPE}", "perPage": 1000}`, multi: true, fieldLabel: "Select tags" }, { fieldName: "dateRange", fieldType: "select", multi: true, fieldQuery: "date", fieldOptions: DATERANGE_TYPES, fieldLabel: "Select date range", fieldDefaultValue: "all" } ] }, { templateType: "conversationsCountBySource", serviceType: "inbox", name: "Total conversations count by source", chartTypes: [ "bar", "line", "pie", "doughnut", "radar", "polarArea", "table" ], getChartResult: async ( models: IModels, filter: any, dimension: any, subdomain: string ) => { const data: number[] = []; const labels: string[] = []; const matchfilter = {}; const { dateRange, status } = filter; const groupByQuery = { $group: { _id: "$integrationId", conversationsCount: { $sum: 1 } } }; const integrationFindQuery = {}; const integrationsDict = {}; const sourcesDict = {}; if (dateRange) { const { startDate, endDate } = filter; const dateFilter = returnDateRange(dateRange, startDate, endDate); if (Object.keys(dateFilter).length) { matchfilter["createdAt"] = dateFilter; } } // filter by status if (status && status !== "all") { if (status === "unassigned") { matchfilter["assignedUserId"] = null; } else { //open or closed matchfilter["status"] = status; } } const convosCountBySource = await models.Conversations.aggregate([ { $match: { ...matchfilter, integrationId: { $exists: true } } }, groupByQuery ]); const integrations = await models.Integrations.find({}); if (integrations) { for (const i of integrations) { integrationsDict[i._id] = i.kind; } } if (convosCountBySource) { for (const convo of convosCountBySource) { const integrationId = convo._id; if (!integrationsDict[integrationId]) { continue; } const integrationKind = integrationsDict[integrationId]; if (!sourcesDict[integrationKind]) { sourcesDict[integrationKind] = convo.conversationsCount; continue; } //increment const getOldCount = sourcesDict[integrationKind]; const increment = getOldCount + convo.conversationsCount; sourcesDict[integrationKind] = increment; } for (const source of Object.keys(sourcesDict)) { labels.push(source); data.push(sourcesDict[source]); } } const title = "Conversations count by source"; return { title, labels, data }; }, filterTypes: [ { fieldName: "status", fieldType: "select", multi: false, fieldOptions: STATUS_TYPES, fieldDefaultValue: "all", fieldLabel: "Select conversation status" }, { fieldName: "dateRange", fieldType: "select", multi: true, fieldQuery: "date", fieldOptions: DATERANGE_TYPES, fieldLabel: "Select date range", fieldDefaultValue: "all" } ] }, { templateType: "conversationsCountByRep", serviceType: "inbox", name: "Total conversations count by rep", chartTypes: [ "bar", "line", "pie", "doughnut", "radar", "polarArea", "table" ], getChartResult: async ( models: IModels, filter: any, dimension: any, subdomain: string ) => { const data: number[] = []; const labels: string[] = []; const matchfilter = {}; const { departmentIds, branchIds, userIds, brandIds, dateRange, tagIds } = filter; let groupByQuery; let userIdGroup; let departmentUsers; let filterUserIds: any = []; const integrationsDict = {}; const integrationFindQuery = {}; const filterStatus = filter.status; const title = "Total conversations count by rep"; if (checkFilterParam(departmentIds)) { const findDepartmentUsers = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { departmentIds: { $in: filter.departmentIds }, isActive: true } }, isRPC: true, defaultValue: [] }); departmentUsers = findDepartmentUsers; filterUserIds = findDepartmentUsers.map(user => user._id); } if (checkFilterParam(branchIds)) { const findBranchUsers = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { branchIds: { $in: filter.branchIds }, isActive: true } }, isRPC: true, defaultValue: [] }); filterUserIds.push(...findBranchUsers.map(user => user._id)); } if (checkFilterParam(tagIds)) { matchfilter["tagIds"] = { $in: tagIds }; } // if team members selected, go by team members if (checkFilterParam(userIds)) { filterUserIds = userIds; } if (dateRange) { const { startDate, endDate } = filter; const dateFilter = returnDateRange(dateRange, startDate, endDate); if (Object.keys(dateFilter).length) { matchfilter["createdAt"] = dateFilter; } } if (checkFilterParam(tagIds)) { matchfilter["tagIds"] = { $in: tagIds }; } if (dateRange) { const { startDate, endDate } = filter; const dateFilter = returnDateRange(dateRange, startDate, endDate); if (Object.keys(dateFilter).length) { matchfilter["createdAt"] = dateFilter; } } // filter integrations by brands if (checkFilterParam(brandIds)) { integrationFindQuery["brandId"] = { $in: filter.brandIds }; const integrations: any = await models.Integrations.find(integrationFindQuery); const integrationIds = integrations.map(i => i._id); matchfilter["integrationId"] = { $in: integrationIds }; } // filter by source if (filter.integrationTypes && !filter.integrationTypes.includes("all")) { const { integrationTypes } = filter; integrationFindQuery["kind"] = { $in: integrationTypes }; const integrations: any = await models.Integrations.find(integrationFindQuery); const integrationIds: string[] = []; for (const integration of integrations) { integrationsDict[integration._id] = integration.kind; integrationIds.push(integration._id); } matchfilter["integrationId"] = { $in: integrationIds }; } if (filterStatus === "open" || filterStatus === "all") { matchfilter["assignedUserId"] = filter && ((userIds && userIds.length) || (departmentIds && departmentIds.length) || (branchIds && branchIds.length)) ? { $exists: true, $in: filterUserIds } : { $exists: true, $ne: null }; userIdGroup = { $group: { _id: "$assignedUserId", conversationsCount: { $sum: 1 } } }; } if (filterStatus === "closed") { matchfilter["closedUserId"] = filter && (filter.userIds || filter.departmentIds || filter.branchIds) ? { $exists: true, $in: filterUserIds } : { $exists: true }; userIdGroup = { $group: { _id: "$closedUserId", conversationsCount: { $sum: 1 } } }; } if (filterStatus === "unassigned") { const totalUnassignedConvosCount = (await models.Conversations.countDocuments(matchfilter)) || 0; data.push(totalUnassignedConvosCount); labels.push("Total unassigned conversations"); return { title, data, labels }; } const usersWithConvosCount = await models.Conversations.aggregate([ { $match: matchfilter }, userIdGroup ]); const getUserIds: string[] = usersWithConvosCount?.map(r => r._id) || []; const getTotalUsers: IUserDocument[] = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { _id: { $in: getUserIds }, isActive: true } }, isRPC: true, defaultValue: [] }); const usersMap = {}; for (const user of getTotalUsers) { usersMap[user._id] = { fullName: user.details?.fullName || `${user.details?.firstName || ""} ${user.details?.lastName || ""}`, departmentIds: user.departmentIds, branchIds: user.branchIds }; } if (usersWithConvosCount) { for (const user of usersWithConvosCount) { if (!usersMap[user._id]) { continue; } data.push(user.conversationsCount); labels.push(usersMap[user._id].fullName); } } return { title, labels, data }; }, filterTypes: [ { fieldName: "status", fieldType: "select", multi: false, fieldOptions: STATUS_TYPES, fieldDefaultValue: "all", fieldLabel: "Select conversation status" }, { fieldName: "userIds", fieldType: "select", multi: true, fieldQuery: "users", fieldLabel: "Select users" }, { fieldName: "departmentIds", fieldType: "select", multi: true, fieldQuery: "departments", fieldLabel: "Select departments" }, { fieldName: "branchIds", fieldType: "select", multi: true, fieldQuery: "branches", fieldLabel: "Select branches" }, { fieldName: "integrationTypes", fieldType: "select", multi: true, fieldQuery: "integrations", fieldOptions: INTEGRATION_TYPES, fieldLabel: "Select source" }, { fieldName: "brandIds", fieldType: "select", fieldQuery: "allBrands", fieldValueVariable: "_id", fieldLabelVariable: "name", multi: true, fieldLabel: "Select brands" }, { fieldName: "tagIds", fieldType: "select", fieldQuery: "tags", fieldValueVariable: "_id", fieldLabelVariable: "name", fieldQueryVariables: `{"type": "${INBOX_TAG_TYPE}", "perPage": 1000}`, multi: true, fieldLabel: "Select tags" }, { fieldName: "dateRange", fieldType: "select", multi: true, fieldQuery: "date", fieldOptions: DATERANGE_TYPES, fieldLabel: "Select date range", fieldDefaultValue: "all" } ] }, { templateType: "conversationsCountByStatus", serviceType: "inbox", name: "Total conversations count by status", chartTypes: [ "bar", "line", "pie", "doughnut", "radar", "polarArea", "table" ], getChartResult: async ( models: IModels, filter: any, dimension: any, subdomain: string ) => { const data: number[] = []; const labels: string[] = []; const matchfilter = {}; const { dateRange, tagIds } = filter; let groupByQuery; const integrationsDict = {}; const integrationFindQuery = {}; const title = "Conversations count by status"; if (dateRange) { const { startDate, endDate } = filter; const dateFilter = returnDateRange(dateRange, startDate, endDate); if (Object.keys(dateFilter).length) { matchfilter["createdAt"] = dateFilter; } } // filter by tags if (checkFilterParam(tagIds)) { matchfilter["tagIds"] = { $in: tagIds }; } // filter by source if (filter.integrationTypes && !filter.integrationTypes.includes("all")) { const { integrationTypes } = filter; integrationFindQuery["kind"] = { $in: integrationTypes }; const integrations: any = await models.Integrations.find(integrationFindQuery); const integrationIds: string[] = []; for (const integration of integrations) { integrationsDict[integration._id] = integration.kind; integrationIds.push(integration._id); } matchfilter["integrationId"] = { $in: integrationIds }; } groupByQuery = { $group: { _id: "$status", conversationsCount: { $sum: 1 } } }; const convosCountByStatus = await models.Conversations.aggregate([ { $match: matchfilter }, groupByQuery ]); if (convosCountByStatus) { for (const convo of convosCountByStatus) { data.push(convo.conversationsCount); labels.push(convo._id); } } return { title, data, labels }; }, filterTypes: [ { fieldName: "integrationTypes", fieldType: "select", multi: true, fieldQuery: "integrations", fieldOptions: INTEGRATION_TYPES, fieldLabel: "Select source" }, { fieldName: "tagIds", fieldType: "select", fieldQuery: "tags", fieldValueVariable: "_id", fieldLabelVariable: "name", fieldQueryVariables: `{"type": "${INBOX_TAG_TYPE}", "perPage": 1000}`, multi: true, fieldLabel: "Select tags" }, { fieldName: "dateRange", fieldType: "select", multi: true, fieldQuery: "date", fieldOptions: DATERANGE_TYPES, fieldLabel: "Select date range", fieldDefaultValue: "all" } ] }, { templateType: "conversationsCount", serviceType: "inbox", name: "Conversations count", chartTypes: [ "bar", "line", "pie", "doughnut", "radar", "polarArea", "table" ], getChartResult: async ( models: IModels, filter: any, dimension: any, subdomain: string ) => { const data: number[] = []; const labels: string[] = []; const matchfilter = {}; const filterStatus = filter.status; let title = `${filterStatus} conversations' count`; const { departmentIds, branchIds, userIds, brandIds, dateRange, integrationTypes, tagIds } = filter; const dimensionX = dimension.x; let departmentUsers; let filterUserIds: any = []; const integrationsDict = {}; let totalIntegrations; if (checkFilterParam(departmentIds)) { const findDepartmentUsers = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { departmentIds: { $in: filter.departmentIds }, isActive: true } }, isRPC: true, defaultValue: [] }); departmentUsers = findDepartmentUsers; filterUserIds = findDepartmentUsers.map(user => user._id); } if (checkFilterParam(branchIds)) { const findBranchUsers = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { branchIds: { $in: filter.branchIds }, isActive: true } }, isRPC: true, defaultValue: [] }); filterUserIds.push(...findBranchUsers.map(user => user._id)); } if (checkFilterParam(tagIds)) { matchfilter["tagIds"] = { $in: tagIds }; } // if team members selected, go by team members if (checkFilterParam(userIds)) { filterUserIds = userIds; } if (dateRange) { const { startDate, endDate } = filter; const dateFilter = returnDateRange(dateRange, startDate, endDate); if (Object.keys(dateFilter).length) { matchfilter["createdAt"] = dateFilter; } } // filter by status if (filterStatus && filterStatus !== "all") { if (filterStatus === "unassigned") { matchfilter["assignedUserId"] = null; } else { //open or closed matchfilter["status"] = filterStatus; } } const integrationFindQuery = {}; // filter integrations by brands if (brandIds && brandIds.length) { integrationFindQuery["brandId"] = { $in: filter.brandIds }; const integrations: any = await models.Integrations.find(integrationFindQuery); const integrationIds = integrations.map(i => i._id); matchfilter["integrationId"] = { $in: integrationIds }; } // filter by source if (filter.integrationTypes && !filter.integrationTypes.includes("all")) { const { integrationTypes } = filter; integrationFindQuery["kind"] = { $in: integrationTypes }; const integrations: any = await models.Integrations.find(integrationFindQuery); totalIntegrations = integrations; const integrationIds: string[] = []; for (const integration of integrations) { integrationsDict[integration._id] = integration.kind; integrationIds.push(integration._id); } matchfilter["integrationId"] = { $in: integrationIds }; } let userIdGroup; let groupByQuery; if (filterStatus === "open" || filterStatus === "all") { matchfilter["assignedUserId"] = filter && ((userIds && userIds.length) || (departmentIds && departmentIds.length) || (branchIds && branchIds.length)) ? { $exists: true, $in: filterUserIds } : { $exists: true, $ne: null }; userIdGroup = { $group: { _id: "$assignedUserId", conversationsCount: { $sum: 1 } } }; } if (filterStatus === "closed") { matchfilter["closedUserId"] = filter && (filter.userIds || filter.departmentIds || filter.branchIds) ? { $exists: true, $in: filterUserIds } : { $exists: true }; userIdGroup = { $group: { _id: "$closedUserId", conversationsCount: { $sum: 1 } } }; } if (filterStatus === "unassigned") { const totalUnassignedConvosCount = (await models.Conversations.countDocuments(matchfilter)) || 0; data.push(totalUnassignedConvosCount); labels.push("Total unassigned conversations"); return { title, data, labels }; } // add dimensions if (dimensionX === "status") { groupByQuery = { $group: { _id: "$status", conversationsCount: { $sum: 1 } } }; const convosCountByStatus = await models.Conversations.aggregate([ { $match: matchfilter }, groupByQuery ]); if (convosCountByStatus) { for (const convo of convosCountByStatus) { data.push(convo.conversationsCount); labels.push(convo._id); } } title = "Conversations count by status"; const datasets = { title, data, labels }; return datasets; } const usersWithConvosCount = await models.Conversations.aggregate([ { $match: matchfilter }, userIdGroup ]); const getUserIds: string[] = usersWithConvosCount?.map(r => r._id) || []; const getTotalUsers: IUserDocument[] = await sendCoreMessage({ subdomain, action: "users.find", data: { query: { _id: { $in: getUserIds }, isActive: true } }, isRPC: true, defaultValue: [] }); const usersMap = {}; for (const user of getTotalUsers) { usersMap[user._id] = { fullName: user.details?.fullName || `${user.details?.firstName || ""} ${user.details?.lastName || ""}`, departmentIds: user.departmentIds, branchIds: user.branchIds }; } // department if (dimensionX === "department") { const departmentsDict = {}; const departmentsQuery = departmentIds && departmentIds.length ? { query: { _id: { $in: departmentIds } } } : {}; const departments = await sendCoreMessage({ subdomain, action: "departments.find", data: departmentsQuery, isRPC: true, defaultValue: [] }); for (const department of departments) { departmentsDict[department._id] = { title: department.title, conversationsCount: 0 }; } if (usersWithConvosCount) { for (const user of usersWithConvosCount) { if (!usersMap[user._id] || !usersMap[user._id].departmentIds) { continue; } for (const departmentId of usersMap[user._id].departmentIds) { if (!departmentsDict[departmentId]) { continue; } const getOldConvosCount = departmentsDict[departmentId].conversationsCount; const incrementCount = getOldConvosCount + user.conversationsCount; departmentsDict[departmentId] = { conversationsCount: incrementCount, title: departmentsDict[departmentId].title }; } } title = "Conversations count by departments"; for (const deptId of Object.keys(departmentsDict)) { labels.push(departmentsDict[deptId].title); data.push(departmentsDict[deptId].conversationsCount); } } return { title, labels, data }; } // branch if (dimensionX === "branch") { const branchesDict = {}; const branchesQuery = branchIds && branchIds.length ? { query: { _id: { $in: branchIds } } } : {}; const branches = await sendCoreMessage({ subdomain, action: "branches.find", data: branchesQuery, isRPC: true, defaultValue: [] }); for (const branch of branches) { branchesDict[branch._id] = { title: branch.title, conversationsCount: 0 }; } if (usersWithConvosCount) { for (const user of usersWithConvosCount) { if (!usersMap[user._id] || !usersMap[user._id].branchIds) { continue; } for (const branchId of usersMap[user._id].branchIds) { if (!branchesDict[branchId]) { continue; } const getOldConvosCount = branchesDict[branchId].conversationsCount; const incrementCount = getOldConvosCount + user.conversationsCount; branchesDict[branchId] = { conversationsCount: incrementCount, title: branchesDict[branchId].title }; } } title = "Conversations count by departments"; for (const branchId of Object.keys(branchesDict)) { labels.push(branchesDict[branchId].title); data.push(branchesDict[branchId].conversationsCount); } } return { title, labels, data }; } //source if (dimensionX === "source") { const sourcesDict = {}; groupByQuery = { $group: { _id: "$integrationId", conversationsCount: { $sum: 1 } } }; const convosCountBySource = await models.Conversations.aggregate([ { $match: { ...matchfilter, integrationId: { $exists: true } } }, groupByQuery ]); const integrations = await models.Integrations.find({}); if (integrations) { for (const i of integrations) { integrationsDict[i._id] = i.kind; } } if (convosCountBySource) { for (const convo of convosCountBySource) { const integrationId = convo._id; if (!integrationsDict[integrationId]) { continue; } const integrationKind = integrationsDict[integrationId]; if (!sourcesDict[integrationKind]) { sourcesDict[integrationKind] = convo.conversationsCount; continue; } //increment const getOldCount = sourcesDict[integrationKind]; const increment = getOldCount + convo.conversationsCount; sourcesDict[integrationKind] = increment; } for (const source of Object.keys(sourcesDict)) { labels.push(source); data.push(sourcesDict[source]); } } const title = "Conversations count by source"; return { title, labels, data }; } //brand if (dimensionX === "brand") { const query = brandIds && brandIds.length ? { _id: { $in: brandIds } } : {}; const brandsMap: { [brandId: string]: string } = {}; const brands = await sendCoreMessage({ subdomain, action: "brands.find", data: { query }, isRPC: true, defaultValue: [] }); groupByQuery = { $group: { _id: "$integrationId", conversationsCount: { $sum: 1 } } }; for (const brand of brands) { brandsMap[brand._id] = brand.name; } const convosCountBySource = await models.Conversations.aggregate([ { $match: { ...matchfilter, integrationId: { $exists: true } } }, groupByQuery ]); if (convosCountBySource && convosCountBySource.length) { const integrationsCountMap = {}; const brandsCountMap = {}; const integrationsMap = {}; for (const convo of convosCountBySource) { integrationsCountMap[convo._id] = convo.conversationsCount; } const ingegrations = (await models.Integrations.find({ _id: { $in: convosCountBySource.map(c => c._id) } })) || []; for (const integration of ingegrations) { if (integration.brandId) { const { brandId } = integration; if (brandsCountMap[brandId]) { const getOldConvosCount = brandsCountMap[brandId]; brandsCountMap[brandId] = getOldConvosCount + integrationsCountMap[integration._id]; } brandsCountMap[brandId] = integrationsCountMap[integration._id] || 0; } } for (const brandId of Object.keys(brandsCountMap)) { labels.push(brandsMap[brandId]); data.push(brandsCountMap[brandId]); } const title = "Conversations count by brand"; return { title, labels, data }; } } //tag if (dimensionX === "tag") { const query = checkFilterParam(tagIds) ? { _id: { $in: tagIds } } : {}; const tags = await sendCoreMessage({ subdomain, action: "tagFind", data: { ...query }, isRPC: true, defaultValue: [] }); const tagsMap: { [key: string]: string } = {}; for (const tag of tags) { tagsMap[tag._id] = tag.name; } groupByQuery = { $group: { _id: "$tagIds", conversationsCount: { $sum: 1 } } }; const convosCountByTag = await models.Conversations.aggregate([ { $match: { ...matchfilter, integrationId: { $exists: true } } }, { $unwind: "$tagIds" }, groupByQuery ]); if (convosCountByTag) { for (const convo of convosCountByTag) { data.push(convo.conversationsCount); labels.push(tagsMap[convo._id]); } } const title = "Conversations count by tag"; return { title, labels, data }; } // frequency if (dimensionX === "frequency") { const convosCountByDateRange = (await models.Conversations.find(matchfilter)) || []; if (dateRange) { if (dateRange === "today" || dateRange === "yesterday") { labels.push(dateRange); data.push(convosCountByDateRange.length); } const getDateRange = returnDateRange( dateRange, filter.startDate, filter.endDate ); const { $gte, $lte } = getDateRange; const dateRanges = returnDateRanges( dateRange, $gte, $lte, filter.customDateFrequencyType ); const convosCountByGivenDateRanges = await models.Conversations.aggregate([ // Match documents within the specified date ranges { $match: { createdAt: { $gte, $lte } } }, // Project additional fields or reshape documents if needed // { // $project: { // // Projected fields // } // }, // Group documents by date range { $group: { _id: { $switch: { branches: dateRanges.map((range, index) => { return { case: { $and: [ { $gte: ["$createdAt", range.start] }, { $lte: ["$createdAt", range.end] } ] }, then: range.start }; }), default: -1 } }, count: { $sum: 1 } // Calculate document count in each group // Additional aggregations if needed } } ]); const getCountsArray = convosCountByGivenDateRanges?.map(c => c.count) || []; data.push(...getCountsArray); labels.push(...dateRanges.map(m => m.label)); const title = `Conversations count of ${dateRange}`; return { title, labels, data }; } } // team members if (usersWithConvosCount) { for (const user of usersWithConvosCount) { if (!usersMap[user._id]) { continue; } data.push(user.conversationsCount); labels.push(usersMap[user._id].fullName); } } const datasets = { title, data, labels }; return datasets; }, filterTypes: [ { fieldName: "customDateFrequencyType", fieldType: "select", logics: [ { logicFieldName: "dateRange", logicFieldValue: "customDate" } ], multi: true, fieldQuery: "date", fieldOptions: CUSTOM_DATE_FREQUENCY_TYPES, fieldLabel: "Select frequency type" }, { fieldName: "status", fieldType: "select", multi: false, fieldOptions: STATUS_TYPES, fieldDefaultValue: "all", fieldLabel: "Select conversation status" }, { fieldName: "userIds", fieldType: "select", multi: true, fieldQuery: "users", fieldLabel: "Select users" }, { fieldName: "departmentIds", fieldType: "select", multi: true, fieldQuery: "departments", fieldLabel: "Select departments" }, { fieldName: "branchIds", fieldType: "select", multi: true, fieldQuery: "branches", fieldLabel: "Select branches" }, { fieldName: "integrationTypes", fieldType: "select", multi: true, fieldQuery: "integrations", fieldOptions: INTEGRATION_TYPES, fieldLabel: "Select source" }, { fieldName: "brandIds", fieldType: "select", fieldQuery: "allBrands", fieldValueVariable: "_id", fieldLabelVariable: "name", multi: true, fieldLabel: "Select brands" }, { fieldName: "tagIds", fieldType: "select", fieldQuery: "tags", fieldValueVariable: "_id", fieldLabelVariable: "name", fieldQueryVariables: `{"type": "${INBOX_TAG_TYPE}", "perPage": 1000}`, multi: true, fieldLabel: "Select tags" }, { fieldName: "dateRange", fieldType: "select", multi: true, fieldQuery: "date", fieldOptions: DATERANGE_TYPES, fieldLabel: "Select date range", fieldDefaultValue: "all" } ], dimensions: DIMENSION_OPTIONS } ]; const getChartResult = async ({ subdomain, data }) => { const models = await generateModels(subdomain); const { templateType, filter, dimension } = data; const template = chartTemplates.find(t => t.templateType === templateType) || ({} as any); return template.getChartResult(models, filter, dimension, subdomain); }; export default { chartTemplates, reportTemplates, getChartResult }; ```
/content/code_sandbox/packages/plugin-inbox-api/src/reports.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
15,037
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>com.apple.security.cs.allow-jit</key> <true/> <key>com.apple.security.cs.allow-unsigned-executable-memory</key> <true/> </dict> </plist> ```
/content/code_sandbox/build/entitlements.mac.plist
xml
2016-08-09T15:21:57
2024-08-14T13:08:02
devdocs-desktop
egoist/devdocs-desktop
3,139
95
```xml import { G2Spec } from '../../../src'; export function aaplAreaLineSmoothSample(): G2Spec { return { type: 'view', data: { type: 'fetch', value: 'data/aapl.csv', }, children: [ { type: 'line', encode: { x: 'date', y: 'close', shape: 'smooth', }, style: { lineWidth: 4, }, transform: [ { type: 'sample', thresholds: 100, strategy: 'lttb', }, ], }, { type: 'area', encode: { x: 'date', y: 'close', shape: 'smooth', }, style: { fillOpacity: 0.5, }, transform: [ { type: 'sample', thresholds: 100, strategy: 'lttb', }, ], }, ], }; } ```
/content/code_sandbox/__tests__/plots/static/aapl-area-line-smooth-sample.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
216
```xml import React from 'react'; import { StyleSheet, ViewStyle, ActivityIndicatorProps, ActivityIndicator, StyleProp, View, } from 'react-native'; import { defaultTheme, RneFunctionComponent } from '../helpers'; export interface DialogLoadingProps { /** Add additional styling for loading component. */ loadingStyle?: StyleProp<ViewStyle>; /** Add additional props for ActivityIndicator component */ loadingProps?: ActivityIndicatorProps; } /** `DialogLoader` allows adding loader to the Dialog. Loader is simply ActivityIndicator. */ export const DialogLoading: RneFunctionComponent<DialogLoadingProps> = ({ loadingStyle, loadingProps, theme = defaultTheme, }) => { return ( <View style={styles.loadingView}> <ActivityIndicator style={StyleSheet.flatten([styles.loading, loadingStyle])} color={loadingProps?.color ?? theme?.colors?.primary} size={loadingProps?.size ?? 'large'} testID="Dialog__Loading" {...loadingProps} /> </View> ); }; DialogLoading.defaultProps = { loadingProps: { size: 'large' }, }; const styles = StyleSheet.create({ loading: { marginVertical: 20, }, loadingView: { flexDirection: 'row', justifyContent: 'center', alignItems: 'center', }, }); DialogLoading.displayName = 'Dialog.Loading'; ```
/content/code_sandbox/packages/base/src/Dialog/Dialog.Loading.tsx
xml
2016-09-08T14:21:41
2024-08-16T10:11:29
react-native-elements
react-native-elements/react-native-elements
24,875
295
```xml import type { ReactNode } from 'react'; import { createContext, useContext, useEffect, useMemo, useState } from 'react'; import { FeatureCode, useSpotlightOnFeature, useSpotlightShow } from '@proton/components'; import type { DriveFolder } from '../hooks/drive/useActiveShare'; import { useLinksListing } from '../store/_links'; import { useDefaultShare } from '../store/_shares'; import { sendErrorReport } from '../utils/errorHandling'; const SEARCH_DISCOVERY_FILES_THRESHOLD = 5; type SpotlightContextFunctions = { searchSpotlight: { isOpen: boolean; onDisplayed: () => void; close: () => void; }; }; interface Props { children?: ReactNode; } const SpotlightContext = createContext<SpotlightContextFunctions | null>(null); const useSearchSpotlight = () => { const [rootFolder, setRootFolder] = useState<DriveFolder>(); const { getDefaultShare } = useDefaultShare(); const { getCachedChildrenCount } = useLinksListing(); useEffect(() => { getDefaultShare() .then(({ shareId, rootLinkId }) => { setRootFolder({ shareId, linkId: rootLinkId }); }) .catch(sendErrorReport); }, []); const storedItemsCount = useMemo(() => { if (!rootFolder?.linkId || !rootFolder?.shareId) { return 0; } return getCachedChildrenCount(rootFolder.shareId, rootFolder.linkId); }, [rootFolder, getCachedChildrenCount]); const enoughItemsStored = storedItemsCount > SEARCH_DISCOVERY_FILES_THRESHOLD; const { show: showSpotlight, onDisplayed, onClose, } = useSpotlightOnFeature(FeatureCode.DriveSearchSpotlight, enoughItemsStored); const shouldShowSpotlight = useSpotlightShow(showSpotlight); return { isOpen: shouldShowSpotlight, onDisplayed, close: onClose, }; }; export const SpotlightProvider = ({ children }: Props) => { const searchSpotlight = useSearchSpotlight(); const value = { searchSpotlight, }; return <SpotlightContext.Provider value={value}>{children}</SpotlightContext.Provider>; }; export function useSpotlight() { const state = useContext(SpotlightContext); if (!state) { throw new Error('Trying to use uninitialized SearchLibraryProvider'); } return state; } ```
/content/code_sandbox/applications/drive/src/app/components/useSpotlight.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
516
```xml import { reactWrapper } from '../helpers/react-wrapper'; import { MenuDivider as MenuDividerComponent, MenuItem as MenuItemComponent, MenuLabel as MenuLabelComponent, MenuList as MenuListComponent, } from './index'; export const MenuDivider = reactWrapper(MenuDividerComponent, { tagName: 'menu-divider' }); export const MenuItem = reactWrapper(MenuItemComponent, { tagName: 'menu-item' }); export const MenuLabel = reactWrapper(MenuLabelComponent, { tagName: 'menu-label' }); export const MenuList = reactWrapper(MenuListComponent, { tagName: 'menu-list' }); ```
/content/code_sandbox/src/webviews/apps/shared/components/menu/react.tsx
xml
2016-08-08T14:50:30
2024-08-15T21:25:09
vscode-gitlens
gitkraken/vscode-gitlens
8,889
121
```xml <?xml version="1.0" encoding="UTF-8"?> <!-- You may freely edit this file. See harness/README in the NetBeans platform --> <!-- for some information on what you could do (e.g. targets to override). --> <!-- If you delete this file and reopen the project it will be recreated. --> <project name="jsyntaxpane.lib" default="netbeans" basedir="."> <description>Builds, tests, and runs the project jsyntaxpane.lib.</description> <import file="nbproject/build-impl.xml"/> </project> ```
/content/code_sandbox/plugins/jsyntaxpane-lib/build.xml
xml
2016-09-12T14:44:30
2024-08-16T14:41:50
visualvm
oracle/visualvm
2,821
120
```xml import type { FC } from 'react'; import React from 'react'; enum DefaultEnum { TopLeft, TopRight, TopCenter, } enum NumericEnum { TopLeft = 0, TopRight, TopCenter, } enum StringEnum { TopLeft = 'top-left', TopRight = 'top-right', TopCenter = 'top-center', } interface Props { defaultEnum: DefaultEnum; numericEnum: NumericEnum; stringEnum: StringEnum; } export const Component: FC<Props> = (props: Props) => <>JSON.stringify(props)</>; ```
/content/code_sandbox/code/core/src/docs-tools/argTypes/convert/__testfixtures__/typescript/enums.tsx
xml
2016-03-18T04:23:44
2024-08-16T19:22:08
storybook
storybookjs/storybook
83,755
127
```xml <annotation> <folder>toy_images</folder> <filename>toy34.jpg</filename> <path>/home/animesh/Documents/grocery_detection/toy_exptt/toy_images/toy34.jpg</path> <source> <database>Unknown</database> </source> <size> <width>500</width> <height>300</height> <depth>3</depth> </size> <segmented>0</segmented> <object> <name>toy</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>192</xmin> <ymin>50</ymin> <xmax>319</xmax> <ymax>181</ymax> </bndbox> </object> </annotation> ```
/content/code_sandbox/Custom_Mask_RCNN/annotations/xmls/toy34.xml
xml
2016-08-17T18:29:12
2024-08-12T19:24:24
Deep-Learning
priya-dwivedi/Deep-Learning
3,346
210
```xml /** * The current version of Ethers. */ export declare const version: string; //# sourceMappingURL=_version.d.ts.map ```
/content/code_sandbox/lib.commonjs/_version.d.ts
xml
2016-07-16T04:35:37
2024-08-16T13:37:46
ethers.js
ethers-io/ethers.js
7,843
26
```xml import { Event } from 'vscode'; import { IDisposable } from '../../common/types'; import { Disposables } from '../../common/utils/resourceLifecycle'; import { IPythonEnvsWatcher, PythonEnvsChangedEvent, PythonEnvsWatcher } from './watcher'; /** * A wrapper around a set of watchers, exposing them as a single watcher. * * If any of the wrapped watchers emits an event then this wrapper * emits that event. */ export class PythonEnvsWatchers implements IPythonEnvsWatcher, IDisposable { public readonly onChanged: Event<PythonEnvsChangedEvent>; private readonly watcher = new PythonEnvsWatcher(); private readonly disposables = new Disposables(); constructor(watchers: ReadonlyArray<IPythonEnvsWatcher>) { this.onChanged = this.watcher.onChanged; watchers.forEach((w) => { const disposable = w.onChanged((e) => this.watcher.fire(e)); this.disposables.push(disposable); }); } public async dispose(): Promise<void> { await this.disposables.dispose(); } } ```
/content/code_sandbox/src/client/pythonEnvironments/base/watchers.ts
xml
2016-01-19T10:50:01
2024-08-12T21:05:24
pythonVSCode
DonJayamanne/pythonVSCode
2,078
227
```xml import { ExpoConfig } from '@expo/config-types'; import { JSONObject } from '@expo/json-file'; import chalk from 'chalk'; import { boolish } from 'getenv'; import { ExportedConfig, ExportedConfigWithProps, Mod, ModPlatform } from '../Plugin.types'; import { PluginError } from '../utils/errors'; const EXPO_DEBUG = boolish('EXPO_DEBUG', false); export type BaseModOptions = { /** Officially supports `'ios' | 'android'` (`ModPlatform`). Arbitrary strings are supported for adding out-of-tree platforms. */ platform: ModPlatform & string; mod: string; isProvider?: boolean; skipEmptyMod?: boolean; saveToInternal?: boolean; /** * If the mod supports introspection, and avoids making any filesystem modifications during compilation. * By enabling, this mod, and all of its descendants will be run in introspection mode. * This should only be used for static files like JSON or XML, and not for application files that require regexes, * or complex static files that require other files to be generated like Xcode `.pbxproj`. */ isIntrospective?: boolean; }; /** * Plugin to intercept execution of a given `mod` with the given `action`. * If an action was already set on the given `config` config for `mod`, then it * will be provided to the `action` as `nextMod` when it's evaluated, otherwise * `nextMod` will be an identity function. * * @param config exported config * @param platform platform to target (ios or android) * @param mod name of the platform function to intercept * @param skipEmptyMod should skip running the action if there is no existing mod to intercept * @param saveToInternal should save the results to `_internal.modResults`, only enable this when the results are pure JSON. * @param isProvider should provide data up to the other mods. * @param action method to run on the mod when the config is compiled */ export function withBaseMod<T>( config: ExportedConfig, { platform, mod, action, skipEmptyMod, isProvider, isIntrospective, saveToInternal, }: BaseModOptions & { action: Mod<T> } ): ExportedConfig { if (!config.mods) { config.mods = {}; } if (!config.mods[platform]) { config.mods[platform] = {}; } let interceptedMod: Mod<T> = (config.mods[platform] as Record<string, any>)[mod]; // No existing mod to intercept if (!interceptedMod) { if (skipEmptyMod) { // Skip running the action return config; } // Use a noop mod and continue const noopMod: Mod<T> = (config) => config; interceptedMod = noopMod; } // Create a stack trace for debugging ahead of time let debugTrace: string = ''; // Use the possibly user defined value. Otherwise fallback to the env variable. // We support the env variable because user mods won't have _internal defined in time. const isDebug = config._internal?.isDebug ?? EXPO_DEBUG; if (isDebug) { // Get a stack trace via the Error API const stack = new Error().stack; // Format the stack trace to create the debug log debugTrace = getDebugPluginStackFromStackTrace(stack); const modStack = chalk.bold(`${platform}.${mod}`); debugTrace = `${modStack}: ${debugTrace}`; } // Prevent adding multiple providers to a mod. // Base mods that provide files ignore any incoming modResults and therefore shouldn't have provider mods as parents. if (interceptedMod.isProvider) { if (isProvider) { throw new PluginError( `Cannot set provider mod for "${platform}.${mod}" because another is already being used.`, 'CONFLICTING_PROVIDER' ); } else { throw new PluginError( `Cannot add mod to "${platform}.${mod}" because the provider has already been added. Provider must be the last mod added.`, 'INVALID_MOD_ORDER' ); } } async function interceptingMod({ modRequest, ...config }: ExportedConfigWithProps<T>) { if (isDebug) { // In debug mod, log the plugin stack in the order which they were invoked console.log(debugTrace); } const results = await action({ ...config, modRequest: { ...modRequest, nextMod: interceptedMod }, }); if (saveToInternal) { saveToInternalObject(results, platform, mod, results.modResults as unknown as JSONObject); } return results; } // Ensure this base mod is registered as the provider. interceptingMod.isProvider = isProvider; if (isIntrospective) { // Register the mode as idempotent so introspection doesn't remove it. interceptingMod.isIntrospective = isIntrospective; } (config.mods[platform] as any)[mod] = interceptingMod; return config; } function saveToInternalObject( config: Pick<ExpoConfig, '_internal'>, platformName: ModPlatform, modName: string, results: JSONObject ) { if (!config._internal) config._internal = {}; if (!config._internal.modResults) config._internal.modResults = {}; if (!config._internal.modResults[platformName]) config._internal.modResults[platformName] = {}; config._internal.modResults[platformName][modName] = results; } function getDebugPluginStackFromStackTrace(stacktrace?: string): string { if (!stacktrace) { return ''; } const treeStackLines: string[] = []; for (const line of stacktrace.split('\n')) { const [first, second] = line.trim().split(' '); if (first === 'at') { treeStackLines.push(second); } } const plugins = treeStackLines .map((first) => { // Match the first part of the stack trace against the plugin naming convention // "with" followed by a capital letter. return ( first?.match(/^(\bwith[A-Z].*?\b)/)?.[1]?.trim() ?? first?.match(/\.(\bwith[A-Z].*?\b)/)?.[1]?.trim() ?? null ); }) .filter(Boolean) .filter((plugin) => { // redundant as all debug logs are captured in withBaseMod return !['withMod', 'withBaseMod', 'withExtendedMod'].includes(plugin!); }); const commonPlugins = ['withPlugins', 'withRunOnce', 'withStaticPlugin']; return ( (plugins as string[]) .reverse() .map((pluginName, index) => { // Base mods indicate a logical section. if (pluginName.includes('BaseMod')) { pluginName = chalk.bold(pluginName); } // highlight dangerous mods if (pluginName.toLowerCase().includes('dangerous')) { pluginName = chalk.red(pluginName); } if (index === 0) { return chalk.blue(pluginName); } else if (commonPlugins.includes(pluginName)) { // Common mod names often clutter up the logs, dim them out return chalk.dim(pluginName); } return pluginName; }) // Join the results: // withAndroidExpoPlugins withPlugins withIcons withDangerousMod withMod .join(' ') ); } /** * Plugin to extend a mod function in the plugins config. * * @param config exported config * @param platform platform to target (ios or android) * @param mod name of the platform function to extend * @param action method to run on the mod when the config is compiled */ export function withMod<T>( config: ExportedConfig, { platform, mod, action, }: { platform: ModPlatform; mod: string; action: Mod<T>; } ): ExportedConfig { return withBaseMod(config, { platform, mod, isProvider: false, async action({ modRequest: { nextMod, ...modRequest }, modResults, ...config }) { const results = await action({ modRequest, modResults: modResults as T, ...config }); return nextMod!(results as any); }, }); } ```
/content/code_sandbox/packages/@expo/config-plugins/src/plugins/withMod.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
1,836
```xml import * as Accordion from '@radix-ui/react-accordion'; import { useTranslation } from 'react-i18next'; import { HiChevronRight } from 'react-icons/hi2'; const orderings = [ { groupKey: 'theMap', entryOrder: [ 'mapColors', 'mapArrows', 'mapNuclearColors', 'mapColorBlind', 'mapSolarWindButtons', ], }, { groupKey: 'mapAreas', entryOrder: ['noData', 'whySmallAreas', 'divideExistingArea'], }, { groupKey: 'methodology', entryOrder: [ 'carbonIntensity', 'methodology', 'regionalEmissionFactors', 'renewableLowCarbonDifference', 'importsAndExports', 'guaranteesOfOrigin', 'otherSources', 'homeSolarPanel', 'emissionsPerCapita', ], }, { groupKey: 'data', entryOrder: ['dataOrigins', 'dataDownload', 'dataIntegration'], }, { groupKey: 'aboutUs', entryOrder: ['whoAreYou', 'feedback', 'contribute', 'workTogether', 'disclaimer'], }, ]; function FAQContent() { const { t } = useTranslation(); return ( <Accordion.Root type="multiple" className="space-y-4 pr-2"> {orderings.map(({ groupKey, entryOrder }) => ( <div key={`group-${groupKey}`} className="space-y-2"> <h3 className="font-bold">{t(`${groupKey}.groupName`)}</h3> {entryOrder.map((entryKey, index) => ( <Accordion.Item value={`${groupKey}-item-${index + 1}`} key={`header-${index}`} className="overflow-hidden" > <Accordion.Header className="w-full"> <Accordion.Trigger className="group flex items-center space-x-2 text-left hover:text-gray-600 dark:hover:text-gray-400"> <HiChevronRight className="flex-none duration-300 group-radix-state-open:rotate-90" />{' '} <span>{t(`${groupKey}.${entryKey}-question`)}</span> </Accordion.Trigger> </Accordion.Header> <Accordion.Content className="ml-2 border-l border-gray-300 pl-4 radix-state-closed:animate-slide-up radix-state-open:animate-slide-down"> <div className="text-md prose prose-sm leading-5 dark:prose-invert prose-a:text-sky-600 prose-a:no-underline hover:prose-a:underline dark:prose-a:invert md:max-w-none" dangerouslySetInnerHTML={{ __html: t(`${groupKey}.${entryKey}-answer`), }} /> </Accordion.Content> </Accordion.Item> ))} </div> ))} </Accordion.Root> ); } export default FAQContent; ```
/content/code_sandbox/web/src/features/panels/faq/FAQContent.tsx
xml
2016-05-21T16:36:17
2024-08-16T17:56:07
electricitymaps-contrib
electricitymaps/electricitymaps-contrib
3,437
637
```xml /* * Wire * * This program is free software: you can redistribute it and/or modify * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * along with this program. If not, see path_to_url * */ import type {DomainData} from '@wireapp/api-client/lib/account/DomainData'; import type {LoginData, RegisterData} from '@wireapp/api-client/lib/auth/'; import {VerificationActionType} from '@wireapp/api-client/lib/auth/VerificationActionType'; import {ClientType} from '@wireapp/api-client/lib/client/'; import {BackendError, BackendErrorLabel, SyntheticErrorLabel} from '@wireapp/api-client/lib/http'; import {OAuthBody} from '@wireapp/api-client/lib/oauth/OAuthBody'; import {OAuthClient} from '@wireapp/api-client/lib/oauth/OAuthClient'; import type {TeamData} from '@wireapp/api-client/lib/team/'; import {LowDiskSpaceError} from '@wireapp/store-engine/lib/engine/error'; import {StatusCodes as HTTP_STATUS, StatusCodes} from 'http-status-codes'; import {isAxiosError, isBackendError} from 'Util/TypePredicateUtil'; import {AuthActionCreator} from './creator/'; import {LabeledError} from './LabeledError'; import {LocalStorageAction, LocalStorageKey} from './LocalStorageAction'; import {currentCurrency, currentLanguage} from '../../localeConfig'; import type {Api, RootState, ThunkAction, ThunkDispatch} from '../reducer'; import type {LoginDataState, RegistrationDataState} from '../reducer/authReducer'; type LoginLifecycleFunction = (dispatch: ThunkDispatch, getState: () => RootState, global: Api) => Promise<void>; const isSystemKeychainAccessError = (error: any): error is Error => { return error instanceof Error && error.message.includes('cryption is not available'); }; export class AuthAction { doLogin = (loginData: LoginData, getEntropy?: () => Promise<Uint8Array>): ThunkAction => { const onBeforeLogin: LoginLifecycleFunction = async (dispatch, getState, {actions: {authAction}}) => dispatch(authAction.doSilentLogout()); return this.doLoginPlain(loginData, onBeforeLogin, undefined, getEntropy); }; doLoginAndJoin = ( loginData: LoginData, key: string, code: string, uri?: string, getEntropy?: () => Promise<Uint8Array>, password?: string, ): ThunkAction => { const onBeforeLogin: LoginLifecycleFunction = async (dispatch, getState, {actions: {authAction}}) => dispatch(authAction.doSilentLogout()); const onAfterLogin: LoginLifecycleFunction = async ( dispatch, getState, {actions: {localStorageAction, conversationAction}}, ) => { const conversation = await dispatch(conversationAction.doJoinConversationByCode(key, code, uri, password)); const domain = conversation?.qualified_conversation?.domain; return ( conversation && (await dispatch( localStorageAction.setLocalStorage(LocalStorageKey.AUTH.LOGIN_CONVERSATION_KEY, { conversation: conversation.conversation, domain, }), )) ); }; return this.doLoginPlain(loginData, onBeforeLogin, onAfterLogin, getEntropy); }; doLoginPlain = ( loginData: LoginData, onBeforeLogin: LoginLifecycleFunction = async () => {}, onAfterLogin: LoginLifecycleFunction = async () => {}, getEntropy?: () => Promise<Uint8Array>, ): ThunkAction => { return async (dispatch, getState, global) => { const { core, actions: {clientAction, selfAction, localStorageAction}, } = global; dispatch(AuthActionCreator.startLogin()); try { await onBeforeLogin(dispatch, getState, global); await core.login(loginData); await this.persistClientData(loginData.clientType, dispatch, localStorageAction); await dispatch(selfAction.fetchSelf()); let entropyData: Uint8Array | undefined = undefined; if (getEntropy) { const existingClient = await core.service!.client.loadClient(); entropyData = existingClient ? undefined : await getEntropy(); } await onAfterLogin(dispatch, getState, global); await dispatch( clientAction.doInitializeClient( loginData.clientType, loginData.password ? String(loginData.password) : undefined, loginData.verificationCode, entropyData, ), ); dispatch(AuthActionCreator.successfulLogin()); } catch (error) { if (error.label === BackendErrorLabel.TOO_MANY_CLIENTS) { dispatch(AuthActionCreator.successfulLogin()); } else { if (error instanceof LowDiskSpaceError) { error = new LabeledError(LabeledError.GENERAL_ERRORS.LOW_DISK_SPACE, error); } if (isSystemKeychainAccessError(error)) { error = new LabeledError(LabeledError.GENERAL_ERRORS.SYSTEM_KEYCHAIN_ACCESS, error); } dispatch(AuthActionCreator.failedLogin(error)); } throw error; } }; }; doPostOAuthCode = (oauthBody: OAuthBody): ThunkAction<Promise<string>> => { return async (dispatch, getState, {apiClient}) => { dispatch(AuthActionCreator.startSendOAuthCode()); try { const url = await apiClient.api.oauth.postOAuthCode(oauthBody); dispatch(AuthActionCreator.successfulSendOAuthCode()); return url; } catch (error) { dispatch(AuthActionCreator.failedSendOAuthCode(error)); throw error; } }; }; doSendTwoFactorLoginCode = (email: string): ThunkAction => { return async (dispatch, getState, {apiClient}) => { dispatch(AuthActionCreator.startSendTwoFactorCode()); try { await apiClient.api.user.postVerificationCode(email, VerificationActionType.LOGIN); dispatch(AuthActionCreator.successfulSendTwoFactorCode()); } catch (error) { /** The BE can respond quite restrictively to the send code request. * We don't want to block the user from logging in if they have already received a code in the last few minutes. * Any other error should still be thrown. */ if (isAxiosError(error) && error.response?.status === StatusCodes.TOO_MANY_REQUESTS) { dispatch(AuthActionCreator.successfulSendTwoFactorCode()); return; } /** * The BE will respond with a 400 if a user tries to use a handle instead of an email. */ if (isBackendError(error) && error.label === BackendErrorLabel.BAD_REQUEST) { error = new BackendError(error.message, SyntheticErrorLabel.EMAIL_REQUIRED, StatusCodes.BAD_REQUEST); } dispatch(AuthActionCreator.failedSendTwoFactorCode(error)); throw error; } }; }; doFinalizeSSOLogin = ({clientType}: {clientType: ClientType}): ThunkAction => { return async (dispatch, getState, {getConfig, core, actions: {clientAction, selfAction, localStorageAction}}) => { dispatch(AuthActionCreator.startLogin()); try { await core.init(clientType); await this.persistClientData(clientType, dispatch, localStorageAction); await dispatch(selfAction.fetchSelf()); await dispatch(clientAction.doInitializeClient(clientType)); dispatch(AuthActionCreator.successfulLogin()); } catch (error) { if (isBackendError(error) && error.label === BackendErrorLabel.TOO_MANY_CLIENTS) { dispatch(AuthActionCreator.successfulLogin()); } else { dispatch(AuthActionCreator.failedLogin(error)); } throw error; } }; }; doGetTeamData = (teamId: string): ThunkAction<Promise<TeamData>> => { return async (dispatch, getState, {apiClient}) => { dispatch(AuthActionCreator.startFetchTeam()); try { const teamData = await apiClient.api.teams.team.getTeam(teamId); dispatch(AuthActionCreator.successfulFetchTeam(teamData)); return teamData; } catch (error) { dispatch(AuthActionCreator.failedFetchTeam(error)); throw error; } }; }; doGetOAuthApplication = (applicationId: string): ThunkAction<Promise<OAuthClient>> => { return async (dispatch, getState, {apiClient}) => { dispatch(AuthActionCreator.startFetchOAuth()); try { const application = await apiClient.api.oauth.getClient(applicationId); dispatch(AuthActionCreator.successfulFetchOAuth(application)); return application; } catch (error) { dispatch(AuthActionCreator.failedFetchOAuth(error)); throw error; } }; }; validateSSOCode = (code: string): ThunkAction => { return async (dispatch, getState, {apiClient}) => { const mapError = (error: any) => { const statusCode = error?.response?.status; if (statusCode === HTTP_STATUS.NOT_FOUND) { return new BackendError('', BackendErrorLabel.NOT_FOUND, HTTP_STATUS.NOT_FOUND); } if (statusCode >= HTTP_STATUS.INTERNAL_SERVER_ERROR) { return new BackendError('', BackendErrorLabel.SERVER_ERROR, HTTP_STATUS.INTERNAL_SERVER_ERROR); } return new BackendError('', SyntheticErrorLabel.SSO_GENERIC_ERROR, HTTP_STATUS.INTERNAL_SERVER_ERROR); }; try { return await apiClient.api.auth.headInitiateLogin(code); } catch (error) { const mappedError = mapError(error); dispatch(AuthActionCreator.failedLogin(mappedError)); throw mappedError; } }; }; private persistClientData = ( clientType: ClientType, dispatch: ThunkDispatch, localStorageAction: LocalStorageAction, ): Promise<void> => { if (clientType === ClientType.NONE) { return Promise.resolve(); } const persist = clientType === ClientType.PERMANENT; return dispatch(localStorageAction.setLocalStorage(LocalStorageKey.AUTH.PERSIST, persist)); }; pushAccountRegistrationData = (registration: Partial<RegistrationDataState>): ThunkAction => { return async dispatch => { dispatch(AuthActionCreator.pushAccountRegistrationData(registration)); }; }; pushLoginData = (loginData: Partial<LoginDataState>): ThunkAction => { return async dispatch => { dispatch(AuthActionCreator.pushLoginData(loginData)); }; }; pushEntropyData = (entropy: Uint8Array): ThunkAction => { return async dispatch => { dispatch(AuthActionCreator.pushEntropyData(entropy)); }; }; doRegisterTeam = (registration: RegisterData): ThunkAction => { return async (dispatch, getState, {getConfig, core, actions: {clientAction, selfAction, localStorageAction}}) => { const clientType = ClientType.PERMANENT; registration.locale = currentLanguage(); registration.name = registration.name.trim(); registration.email = registration.email.trim(); registration.team.icon = 'default'; registration.team.currency = currentCurrency(); registration.team.name = registration.team.name.trim(); dispatch(AuthActionCreator.startRegisterTeam()); try { await dispatch(this.doSilentLogout()); await core.register(registration, clientType); await this.persistClientData(clientType, dispatch, localStorageAction); await dispatch(selfAction.fetchSelf()); await dispatch(clientAction.doInitializeClient(clientType)); dispatch(AuthActionCreator.successfulRegisterTeam(registration)); } catch (error) { dispatch(AuthActionCreator.failedRegisterTeam(error)); throw error; } }; }; doRegisterPersonal = (registration: RegisterData, entropyData: Uint8Array): ThunkAction => { return async ( dispatch, getState, {getConfig, core, actions: {authAction, clientAction, selfAction, localStorageAction}}, ) => { const clientType = ClientType.PERMANENT; registration.locale = currentLanguage(); registration.name = registration.name.trim(); registration.email = registration.email.trim(); dispatch(AuthActionCreator.startRegisterPersonal()); try { await dispatch(authAction.doSilentLogout()); await core.register(registration, clientType); await this.persistClientData(clientType, dispatch, localStorageAction); await dispatch(selfAction.fetchSelf()); await dispatch(clientAction.doInitializeClient(clientType, undefined, undefined, entropyData)); dispatch(AuthActionCreator.successfulRegisterPersonal(registration)); } catch (error) { dispatch(AuthActionCreator.failedRegisterPersonal(error)); throw error; } }; }; doRegisterWireless = ( registrationData: RegisterData, options = {shouldInitializeClient: true}, entropyData?: Uint8Array, ): ThunkAction => { return async ( dispatch, getState, {getConfig, core, actions: {authAction, clientAction, selfAction, localStorageAction}}, ) => { const clientType = options.shouldInitializeClient ? ClientType.TEMPORARY : ClientType.NONE; registrationData.locale = currentLanguage(); registrationData.name = registrationData.name.trim(); dispatch(AuthActionCreator.startRegisterWireless()); try { await dispatch(authAction.doSilentLogout()); await core.register(registrationData, clientType); await this.persistClientData(clientType, dispatch, localStorageAction); await dispatch(selfAction.fetchSelf()); await (clientType !== ClientType.NONE && dispatch(clientAction.doInitializeClient(clientType, undefined, undefined, entropyData))); dispatch(AuthActionCreator.successfulRegisterWireless(registrationData)); } catch (error) { dispatch(AuthActionCreator.failedRegisterWireless(error)); throw error; } }; }; doInit = (options = {isImmediateLogin: false, shouldValidateLocalClient: false}): ThunkAction => { return async (dispatch, getState, {core, actions: {authAction, selfAction, localStorageAction}}) => { dispatch(AuthActionCreator.startRefresh()); try { if (options.isImmediateLogin) { await dispatch(localStorageAction.setLocalStorage(LocalStorageKey.AUTH.PERSIST, true)); } const persist = await dispatch(localStorageAction.getLocalStorage(LocalStorageKey.AUTH.PERSIST)); if (persist === undefined) { throw new Error(`Could not find value for '${LocalStorageKey.AUTH.PERSIST}'`); } const clientType = persist ? ClientType.PERMANENT : ClientType.TEMPORARY; await core.init(clientType); await this.persistClientData(clientType, dispatch, localStorageAction); await dispatch(selfAction.fetchSelf()); dispatch(AuthActionCreator.successfulRefresh()); } catch (error) { const doLogout = options.shouldValidateLocalClient ? dispatch(authAction.doLogout()) : Promise.resolve(); const deleteClientType = options.isImmediateLogin ? dispatch(localStorageAction.deleteLocalStorage(LocalStorageKey.AUTH.PERSIST)) : Promise.resolve(); await Promise.all([doLogout, deleteClientType]); dispatch(AuthActionCreator.failedRefresh(error)); } }; }; doGetDomainInfo = (domain: string): ThunkAction<Promise<DomainData>> => { return async (dispatch, getState, {apiClient}) => { return apiClient.api.account.getDomain(domain); }; }; doGetSSOSettings = (): ThunkAction<Promise<void>> => { return async (dispatch, getState, {apiClient}) => { dispatch(AuthActionCreator.startGetSSOSettings()); try { const ssoSettings = await apiClient.api.account.getSSOSettings(); dispatch(AuthActionCreator.successfulGetSSOSettings(ssoSettings)); } catch (error) { dispatch(AuthActionCreator.failedGetSSOSettings(error)); } }; }; doLogout = (): ThunkAction => { return async (dispatch, getState, {getConfig, core, actions: {localStorageAction}}) => { try { await core.logout(); dispatch(AuthActionCreator.successfulLogout()); } catch (error) { dispatch(AuthActionCreator.failedLogout(error)); } }; }; doSilentLogout = (): ThunkAction => { return async (dispatch, getState, {getConfig, core, actions: {localStorageAction}}) => { try { await core.logout(); dispatch(AuthActionCreator.successfulSilentLogout()); } catch (error) { dispatch(AuthActionCreator.failedLogout(error)); } }; }; enterPersonalCreationFlow = (): ThunkAction => { return async dispatch => { dispatch(AuthActionCreator.enterPersonalCreationFlow()); }; }; enterTeamCreationFlow = (): ThunkAction => { return async dispatch => { dispatch(AuthActionCreator.enterTeamCreationFlow()); }; }; enterGenericInviteCreationFlow = (): ThunkAction => { return async dispatch => { dispatch(AuthActionCreator.enterGenericInviteCreationFlow()); }; }; resetAuthError = (): ThunkAction => { return async dispatch => { dispatch(AuthActionCreator.resetError()); }; }; } export const authAction = new AuthAction(); ```
/content/code_sandbox/src/script/auth/module/action/AuthAction.ts
xml
2016-07-21T15:34:05
2024-08-16T11:40:13
wire-webapp
wireapp/wire-webapp
1,125
3,637
```xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="path_to_url" package="com.journaldev.internalstorage" > <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> ```
/content/code_sandbox/Android/InternalStorage/app/src/main/AndroidManifest.xml
xml
2016-05-02T05:43:21
2024-08-16T06:51:39
journaldev
WebJournal/journaldev
1,314
144
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>Vendor</key> <string>Conexant</string> <key>CodecID</key> <integer>20757</integer> <key>CodecName</key> <string>CX20757</string> <key>Author</key> <string>Vandroiy</string> <key>Files</key> <dict> <key>Layouts</key> <array> <dict> <key>Comment</key> <string>Mirone Laptop Patch</string> <key>Id</key> <integer>3</integer> <key>Path</key> <string>layout3.xml.zlib</string> </dict> </array> <key>Platforms</key> <array> <dict> <key>Comment</key> <string>Mirone Laptop Patch</string> <key>Id</key> <integer>3</integer> <key>Path</key> <string>PlatformsM.xml.zlib</string> </dict> </array> </dict> <key>Patches</key> <array> <dict> <key>Count</key> <integer>1</integer> <key>Find</key> <data>QcYGAEmLvCQ=</data> <key>MaxKernel</key> <integer>13</integer> <key>MinKernel</key> <integer>13</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>QcYGAUmLvCQ=</data> </dict> <dict> <key>Count</key> <integer>1</integer> <key>Find</key> <data>QcYGAEiLu2g=</data> <key>MinKernel</key> <integer>14</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>QcYGAUiLu2g=</data> </dict> <dict> <key>Count</key> <integer>1</integer> <key>Find</key> <data>QcaGQwEAAAA=</data> <key>MinKernel</key> <integer>13</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>QcaGQwEAAAE=</data> </dict> <dict> <key>Count</key> <integer>2</integer> <key>Find</key> <data>gxnUEQ==</data> <key>MinKernel</key> <integer>15</integer> <key>MaxKernel</key> <integer>15</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>AAAAAA==</data> </dict> <dict> <key>Count</key> <integer>2</integer> <key>Find</key> <data>hBnUEQ==</data> <key>MinKernel</key> <integer>13</integer> <key>MaxKernel</key> <integer>15</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>FVHxFA==</data> </dict> <dict> <key>Count</key> <integer>2</integer> <key>Find</key> <data>ixnUEQ==</data> <key>MinKernel</key> <integer>16</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>FVHxFA==</data> </dict> <dict> <key>Count</key> <integer>2</integer> <key>Find</key> <data>ihnUEQ==</data> <key>MinKernel</key> <integer>16</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>AAAAAA==</data> </dict> </array> </dict> </plist> ```
/content/code_sandbox/Clover-Configs/XiaoMi/13.3-without-fingerprint/CLOVER/kexts/Other/AppleALC.kext/Contents/Resources/CX20757/Info.plist
xml
2016-11-05T04:22:54
2024-08-12T19:25:53
Hackintosh-Installer-University
huangyz0918/Hackintosh-Installer-University
3,937
1,155
```xml <!-- Description: entry category scheme --> <feed xmlns="path_to_url"> <entry> <category scheme="path_to_url" /> </entry> </feed> ```
/content/code_sandbox/testdata/parser/atom/atom10_feed_entry_category_scheme.xml
xml
2016-01-23T02:44:34
2024-08-16T15:16:03
gofeed
mmcdole/gofeed
2,547
39
```xml <clickhouse> <macros incl="macros" optional="true" replace="replace"/> <storage_configuration> <disks> <disk_s3> <type>s3</type> <endpoint>path_to_url{endpoint_substitution}/</endpoint> <access_key_id>minio</access_key_id> <secret_access_key>minio123</secret_access_key> </disk_s3> <disk_hdfs> <type>hdfs</type> <endpoint>hdfs://hdfs1:9000/{hdfs_endpoint_substitution}/</endpoint> <!-- FIXME: chicken and egg problem with current cluster.py --> <skip_access_check>true</skip_access_check> </disk_hdfs> <disk_encrypted> <type>encrypted</type> <disk>disk_s3</disk> <key>1234567812345678</key> </disk_encrypted> </disks> </storage_configuration> </clickhouse> ```
/content/code_sandbox/tests/integration/test_endpoint_macro_substitution/configs/storage.xml
xml
2016-06-02T08:28:18
2024-08-16T18:39:33
ClickHouse
ClickHouse/ClickHouse
36,234
217
```xml <resources> <string name="app_name">UsingMPChartsLib</string> <string name="action_settings">Settings</string> </resources> ```
/content/code_sandbox/UsingMPChartsLib/app/src/main/res/values/strings.xml
xml
2016-02-25T11:06:48
2024-08-07T21:41:59
android-examples
nisrulz/android-examples
1,747
34
```xml import React from 'react'; import { render, screen } from '@testing-library/react'; import { Highlight } from './Highlight'; jest.mock('highlight.js', () => ({ highlightElement: jest.fn(), })); describe('Highlight::', () => { it('renders children correctly', () => { render( <Highlight language="sql"> <span>Test children</span> </Highlight>, ); expect(screen.getByTestId('highlight-code').textContent).toEqual('Test children'); }); it('renders correct language', () => { render( <Highlight language="sql"> <span>Test children</span> </Highlight>, ); expect(screen.getByTestId('highlight-code').className).toEqual('language-sql'); }); }); ```
/content/code_sandbox/pmm-app/src/shared/components/Hightlight/Highlight.test.tsx
xml
2016-01-22T07:14:23
2024-08-13T13:01:59
grafana-dashboards
percona/grafana-dashboards
2,661
160
```xml /// /// /// /// path_to_url /// /// Unless required by applicable law or agreed to in writing, software /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// import { AttributeScope } from '@shared/models/telemetry/telemetry.models'; import { widgetType } from '@shared/models/widget.models'; export enum GetValueAction { DO_NOTHING = 'DO_NOTHING', EXECUTE_RPC = 'EXECUTE_RPC', GET_ATTRIBUTE = 'GET_ATTRIBUTE', GET_TIME_SERIES = 'GET_TIME_SERIES', GET_DASHBOARD_STATE = 'GET_DASHBOARD_STATE' } export const getValueActions = Object.keys(GetValueAction) as GetValueAction[]; export const getValueActionsByWidgetType = (type: widgetType): GetValueAction[] => { if (type !== widgetType.rpc) { return getValueActions.filter(action => action !== GetValueAction.EXECUTE_RPC); } else { return getValueActions; } }; export const getValueActionTranslations = new Map<GetValueAction, string>( [ [GetValueAction.DO_NOTHING, 'widgets.value-action.do-nothing'], [GetValueAction.EXECUTE_RPC, 'widgets.value-action.execute-rpc'], [GetValueAction.GET_ATTRIBUTE, 'widgets.value-action.get-attribute'], [GetValueAction.GET_TIME_SERIES, 'widgets.value-action.get-time-series'], [GetValueAction.GET_DASHBOARD_STATE, 'widgets.value-action.get-dashboard-state'] ] ); export interface RpcSettings { method: string; requestTimeout: number; requestPersistent: boolean; persistentPollingInterval: number; } export interface TelemetryValueSettings { key: string; } export interface GetAttributeValueSettings extends TelemetryValueSettings { scope: AttributeScope | null; } export interface SetAttributeValueSettings extends TelemetryValueSettings { scope: AttributeScope.SERVER_SCOPE | AttributeScope.SHARED_SCOPE; } export enum DataToValueType { NONE = 'NONE', FUNCTION = 'FUNCTION' } export interface DataToValueSettings { type: DataToValueType; dataToValueFunction: string; compareToValue?: any; } export interface ValueActionSettings { actionLabel?: string; } export interface GetValueSettings<V> extends ValueActionSettings { action: GetValueAction; defaultValue: V; executeRpc?: RpcSettings; getAttribute: GetAttributeValueSettings; getTimeSeries: TelemetryValueSettings; dataToValue: DataToValueSettings; } export enum SetValueAction { EXECUTE_RPC = 'EXECUTE_RPC', SET_ATTRIBUTE = 'SET_ATTRIBUTE', ADD_TIME_SERIES = 'ADD_TIME_SERIES' } export const setValueActions = Object.keys(SetValueAction) as SetValueAction[]; export const setValueActionsByWidgetType = (type: widgetType): SetValueAction[] => { if (type !== widgetType.rpc) { return setValueActions.filter(action => action !== SetValueAction.EXECUTE_RPC); } else { return setValueActions; } }; export const setValueActionTranslations = new Map<SetValueAction, string>( [ [SetValueAction.EXECUTE_RPC, 'widgets.value-action.execute-rpc'], [SetValueAction.SET_ATTRIBUTE, 'widgets.value-action.set-attribute'], [SetValueAction.ADD_TIME_SERIES, 'widgets.value-action.add-time-series'] ] ); export enum ValueToDataType { VALUE = 'VALUE', CONSTANT = 'CONSTANT', FUNCTION = 'FUNCTION', NONE = 'NONE' } export interface ValueToDataSettings { type: ValueToDataType; constantValue: any; valueToDataFunction: string; } export interface SetValueSettings extends ValueActionSettings { action: SetValueAction; executeRpc: RpcSettings; setAttribute: SetAttributeValueSettings; putTimeSeries: TelemetryValueSettings; valueToData: ValueToDataSettings; } ```
/content/code_sandbox/ui-ngx/src/app/shared/models/action-widget-settings.models.ts
xml
2016-12-01T09:33:30
2024-08-16T19:58:25
thingsboard
thingsboard/thingsboard
16,820
796
```xml import { Button, Divider, List } from '@mui/material'; import { useState, Fragment } from 'react'; import { COMPANY_CREATED, CONTACT_CREATED, CONTACT_NOTE_CREATED, DEAL_CREATED, DEAL_NOTE_CREATED, } from '../consts'; import { Activity } from '../types'; import { ActivityLogCompanyCreated } from './ActivityLogCompanyCreated'; import { ActivityLogContactCreated } from './ActivityLogContactCreated'; import { ActivityLogContactNoteCreated } from './ActivityLogContactNoteCreated'; import { ActivityLogDealCreated } from './ActivityLogDealCreated'; import { ActivityLogDealNoteCreated } from './ActivityLogDealNoteCreated'; type ActivityLogIteratorProps = { activities: Activity[]; pageSize: number; }; export function ActivityLogIterator({ activities, pageSize, }: ActivityLogIteratorProps) { const [activitiesDisplayed, setActivityDisplayed] = useState(pageSize); const filteredActivities = activities.slice(0, activitiesDisplayed); return ( <List sx={{ '& .MuiListItem-root': { marginTop: 0, marginBottom: 1, }, '& .MuiListItem-root:not(:first-of-type)': { marginTop: 1, }, }} > {filteredActivities.map((activity, index) => ( <Fragment key={index}> <ActivityItem key={activity.id} activity={activity} /> <Divider /> </Fragment> ))} {activitiesDisplayed < activities.length && ( <Button onClick={() => setActivityDisplayed( activitiesDisplayed => activitiesDisplayed + pageSize ) } fullWidth > Load more activity </Button> )} </List> ); } function ActivityItem({ activity }: { activity: Activity }) { if (activity.type === COMPANY_CREATED) { return <ActivityLogCompanyCreated activity={activity} />; } if (activity.type === CONTACT_CREATED) { return <ActivityLogContactCreated activity={activity} />; } if (activity.type === CONTACT_NOTE_CREATED) { return <ActivityLogContactNoteCreated activity={activity} />; } if (activity.type === DEAL_CREATED) { return <ActivityLogDealCreated activity={activity} />; } if (activity.type === DEAL_NOTE_CREATED) { return <ActivityLogDealNoteCreated activity={activity} />; } return null; } ```
/content/code_sandbox/examples/crm/src/activity/ActivityLogIterator.tsx
xml
2016-07-13T07:58:54
2024-08-16T18:32:27
react-admin
marmelab/react-admin
24,624
501
```xml import { SyncFrequencyGuardInterface } from './SyncFrequencyGuardInterface' export class SyncFrequencyGuard implements SyncFrequencyGuardInterface { private callsPerMinuteMap: Map<string, number> constructor(private syncCallsThresholdPerMinute: number) { this.callsPerMinuteMap = new Map<string, number>() } isSyncCallsThresholdReachedThisMinute(): boolean { const stringDateToTheMinute = this.getCallsPerMinuteKey() const persistedCallsCount = this.callsPerMinuteMap.get(stringDateToTheMinute) || 0 return persistedCallsCount >= this.syncCallsThresholdPerMinute } incrementCallsPerMinute(): void { const stringDateToTheMinute = this.getCallsPerMinuteKey() const persistedCallsCount = this.callsPerMinuteMap.get(stringDateToTheMinute) const newMinuteStarted = persistedCallsCount === undefined if (newMinuteStarted) { this.clear() this.callsPerMinuteMap.set(stringDateToTheMinute, 1) } else { this.callsPerMinuteMap.set(stringDateToTheMinute, persistedCallsCount + 1) } } clear(): void { this.callsPerMinuteMap.clear() } private getCallsPerMinuteKey(): string { const now = new Date() return `${now.getFullYear()}-${now.getMonth()}-${now.getDate()}T${now.getHours()}:${now.getMinutes()}` } } ```
/content/code_sandbox/packages/snjs/lib/Services/Sync/SyncFrequencyGuard.ts
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
296
```xml import { ForwardedBaseModOptions } from './createBaseMod'; import { ExportedConfig, ModPlatform } from '../Plugin.types'; export declare function withDefaultBaseMods(config: ExportedConfig, props?: ForwardedBaseModOptions): ExportedConfig; /** * Get a prebuild config that safely evaluates mods without persisting any changes to the file system. * Currently this only supports infoPlist, entitlements, androidManifest, strings, gradleProperties, and expoPlist mods. * This plugin should be evaluated directly: */ export declare function withIntrospectionBaseMods(config: ExportedConfig, props?: ForwardedBaseModOptions): ExportedConfig; /** * * @param projectRoot * @param config */ export declare function compileModsAsync(config: ExportedConfig, props: { projectRoot: string; platforms?: ModPlatform[]; introspect?: boolean; assertMissingModProviders?: boolean; ignoreExistingNativeFiles?: boolean; }): Promise<ExportedConfig>; export declare function sortMods(commands: [string, any][], precedences: Record<string, number>): [string, any][]; /** * A generic plugin compiler. * * @param config */ export declare function evalModsAsync(config: ExportedConfig, { projectRoot, introspect, platforms, assertMissingModProviders, ignoreExistingNativeFiles, }: { projectRoot: string; introspect?: boolean; platforms?: ModPlatform[]; /** * Throw errors when mods are missing providers. * @default true */ assertMissingModProviders?: boolean; /** Ignore any existing native files, only use the generated prebuild results. */ ignoreExistingNativeFiles?: boolean; }): Promise<ExportedConfig>; ```
/content/code_sandbox/packages/@expo/config-plugins/build/plugins/mod-compiler.d.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
360
```xml /* * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import zeros = require( '@stdlib/ndarray/zeros' ); import assign = require( './index' ); // TESTS // // The function returns `undefined`... { const x = zeros( [ 2, 2 ] ); const y = zeros( [ 2, 2 ] ); const arrays = [ x, y ]; assign( arrays ); // $ExpectType void } // The compiler throws an error if the function is provided a first argument which is not an array-like object containing ndarray-like objects... { assign( '5' ); // $ExpectError assign( 5 ); // $ExpectError assign( true ); // $ExpectError assign( false ); // $ExpectError assign( null ); // $ExpectError assign( undefined ); // $ExpectError assign( {} ); // $ExpectError assign( [ 1 ] ); // $ExpectError assign( ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { const x = zeros( [ 2, 2 ] ); const y = zeros( [ 2, 2 ] ); const arrays = [ x, y ]; assign(); // $ExpectError assign( arrays, 10 ); // $ExpectError } ```
/content/code_sandbox/lib/node_modules/@stdlib/ndarray/base/assign/docs/types/test.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
337
```xml import _ from 'underscore'; import { DOMUtils } from 'mailspring-exports'; import UnifiedDOMParser from './unified-dom-parser'; export default class RealDOMParser extends UnifiedDOMParser { *_pruningDOMWalker({ node, pruneFn, filterFn }) { if (filterFn(node)) { yield node; } if (node && !pruneFn(node) && node.childNodes.length > 0) { for (let i = 0; i < node.childNodes.length; i++) { yield* this._pruningDOMWalker({ node: node.childNodes[i], pruneFn, filterFn }); } } return; } getWalker(dom: any): Iterable<HTMLElement> { const filterFn = node => { return node.nodeType === Node.TEXT_NODE; }; const pruneFn = node => { return node.nodeName === 'STYLE'; }; return this._pruningDOMWalker({ node: dom, pruneFn, filterFn }); } isTextNode(node: any) { return node.nodeType === Node.TEXT_NODE; } textNodeLength(textNode: any) { return (textNode.data || '').length; } textNodeContents(textNode: any) { return textNode.data; } looksLikeBlockElement(node: any) { return DOMUtils.looksLikeBlockElement(node); } getRawFullString(fullString: any) { return _.pluck(fullString, 'data').join(''); } removeMatchesAndNormalize(element: any) { const matches = element.querySelectorAll('search-match'); if (matches.length === 0) { return null; } for (let i = 0; i < matches.length; i++) { const match = matches[i]; DOMUtils.unwrapNode(match); } element.normalize(); return element; } createTextNode({ rawText }: any) { return document.createTextNode(rawText); } createMatchNode({ matchText, regionId, isCurrentMatch, renderIndex }: any) { const text = document.createTextNode(matchText); const newNode = document.createElement('search-match'); const className = isCurrentMatch ? 'current-match' : ''; newNode.setAttribute('data-region-id', regionId); newNode.setAttribute('data-render-index', renderIndex); newNode.setAttribute('class', className); newNode.appendChild(text); return newNode; } textNodeKey(textElement: any) { return textElement; } highlightSearch(element: any, matchNodeMap: any) { const walker = this.getWalker(element); // We have to expand the whole generator because we're mutating in // place const textNodes = [...walker]; for (const textNode of textNodes) { if (matchNodeMap.has(textNode)) { const { originalTextNode, newTextNodes } = matchNodeMap.get(textNode); const frag = document.createDocumentFragment(); for (const newNode of newTextNodes) { frag.appendChild(newNode); } textNode.parentNode.replaceChild(frag, originalTextNode); } } } } ```
/content/code_sandbox/app/src/searchable-components/real-dom-parser.ts
xml
2016-10-13T06:45:50
2024-08-16T18:14:37
Mailspring
Foundry376/Mailspring
15,331
662
```xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.2</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.didispace</groupId> <artifactId>chapter3-12</artifactId> <version>0.0.1-SNAPSHOT</version> <description>JTA</description> <properties> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jta-atomikos</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> ```
/content/code_sandbox/2.x/chapter3-12/pom.xml
xml
2016-08-21T03:39:06
2024-08-16T17:54:09
SpringBoot-Learning
dyc87112/SpringBoot-Learning
15,676
485
```xml import React, { FunctionComponent } from "react"; import styles from "./Navigation.css"; interface NavigationProps { children?: React.ReactNode; } const Navigation: FunctionComponent<NavigationProps> = ({ children }) => ( <nav className={styles.root}> <ul className={styles.ul}>{children}</ul> </nav> ); export default Navigation; ```
/content/code_sandbox/client/src/core/client/admin/routes/Configure/Navigation.tsx
xml
2016-10-31T16:14:05
2024-08-06T16:15:57
talk
coralproject/talk
1,881
74
```xml import { STATUSES, DEFAULT_SEX_CHOICES } from "@erxes/api-utils/src/constants"; import { companySchema } from "../../../db/models/definitions/companies"; import { customerSchema, locationSchema, visitorContactSchema } from "../../../db/models/definitions/customers"; export const MODULE_NAMES = { COMPANY: "company", CUSTOMER: "customer" }; export const COC_LEAD_STATUS_TYPES = [ "", "new", "open", "inProgress", "openDeal", "unqualified", "attemptedToContact", "connected", "badTiming" ]; export const COC_LIFECYCLE_STATE_TYPES = [ "", "subscriber", "lead", "marketingQualifiedLead", "salesQualifiedLead", "opportunity", "customer", "evangelist", "other" ]; export const IMPORT_EXPORT_TYPES = [ { text: "Customers", contentType: "customer", icon: "users-alt" }, { text: "Leads", contentType: "lead", icon: "file-alt" }, { text: "Companies", contentType: "company", icon: "building" } ]; export const CUSTOMER_BASIC_INFOS = [ "state", "firstName", "lastName", "middleName", "primaryEmail", "emails", "primaryPhone", "phones", "ownerId", "position", "department", "leadStatus", "status", "hasAuthority", "description", "isSubscribed", "integrationId", "code", "mergedIds" ]; export const COMPANY_BASIC_INFOS = [ "primaryName", "names", "size", "industry", "website", "plan", "primaryEmail", "primaryPhone", "businessType", "description", "isSubscribed", "parentCompanyId" ]; export const LOG_MAPPINGS = [ { name: MODULE_NAMES.COMPANY, schemas: [companySchema] }, { name: MODULE_NAMES.CUSTOMER, schemas: [customerSchema, locationSchema, visitorContactSchema] } ]; export const EMAIL_VALIDATION_STATUSES = { VALID: "valid", INVALID: "invalid", ACCEPT_ALL_UNVERIFIABLE: "accept_all_unverifiable", UNVERIFIABLE: "unverifiable", UNKNOWN: "unknown", DISPOSABLE: "disposable", CATCH_ALL: "catchall", BAD_SYNTAX: "badsyntax" }; export const AWS_EMAIL_STATUSES = { SEND: "send", DELIVERY: "delivery", OPEN: "open", CLICK: "click", COMPLAINT: "complaint", BOUNCE: "bounce", RENDERING_FAILURE: "renderingfailure", REJECT: "reject" }; export const CUSTOMER_BASIC_INFO = { avatar: "Avatar", firstName: "First Name", lastName: "Last Name", middleName: "Middle Name", primaryEmail: "Primary E-mail", primaryPhone: "Primary Phone", position: "Position", department: "Department", owner: "Owner", pronoun: "Pronoun", birthDate: "Birthday", hasAuthority: "Has Authority", description: "Description", isSubscribed: "Subscribed", code: "Code", score: "Score", ALL: [ { field: "avatar", label: "Avatar", canHide: false }, { field: "firstName", label: "First Name", canHide: false }, { field: "lastName", label: "Last Name", canHide: false }, { field: "middleName", label: "Middle Name", canHide: false }, { field: "primaryEmail", label: "Primary E-mail", validation: "email", canHide: false }, { field: "primaryPhone", label: "Primary Phone", validation: "phone", canHide: false }, { field: "position", label: "Position", canHide: true }, { field: "department", label: "Department", canHide: true }, { field: "hasAuthority", label: "Has Authority", canHide: true }, { field: "description", label: "Description", canHide: true }, { field: "isSubscribed", label: "Subscribed", canHide: true }, { field: "owner", label: "Owner", canHide: true }, { field: "pronoun", label: "Pronoun", canHide: true }, { field: "birthDate", label: "Birthday", canHide: true }, { field: "code", label: "Code", canHide: true }, { field: "score", label: "Score", canHide: true } ] }; export const COMPANY_INFO = { avatar: "Logo", code: "Code", primaryName: "Primary Name", size: "Size", industry: "Industries", plan: "Plan", primaryEmail: "Primary Email", primaryPhone: "Primary Phone", businessType: "Business Type", description: "Description", isSubscribed: "Subscribed", location: "Headquarters Country", score: "Score", ALL: [ { field: "avatar", label: "Logo", canHide: false }, { field: "primaryName", label: "Primary Name", canHide: false }, { field: "primaryEmail", label: "Primary E-mail", validation: "email", canHide: false }, { field: "primaryPhone", label: "Primary Phone", validation: "phone", canHide: false }, { field: "size", label: "Size" }, { field: "industry", label: "Industries" }, { field: "plan", label: "Plan" }, { field: "owner", label: "Owner", canHide: true }, { field: "businessType", label: "Business Type", canHide: true }, { field: "code", label: "Code", canHide: true }, { field: "description", label: "Description", canHide: true }, { field: "isSubscribed", label: "Subscribed", canHide: true }, { field: "location", label: "Headquarters Country", canHide: true }, { field: "score", label: "Score", canHide: true } ] }; export const DEVICE_PROPERTIES_INFO = { location: "Location", browser: "Browser", platform: "Platform", ipAddress: "IP Address", hostName: "Hostname", language: "Language", agent: "User Agent", ALL: [ { field: "location", label: "Location" }, { field: "browser", label: "Browser" }, { field: "platform", label: "Platform" }, { field: "ipAddress", label: "IP Address" }, { field: "hostName", label: "Hostname" }, { field: "language", label: "Language" }, { field: "agent", label: "User Agent" } ] }; export const NOTIFICATION_MODULES = [ { name: "customers", description: "Customers", icon: "user", types: [ { name: "customerMention", text: "Mention on customer note" } ] }, { name: "companies", description: "Companies", icon: "building", types: [ { name: "companyMention", text: "Mention on company note" } ] } ]; export const ACTIVITY_CONTENT_TYPES = { CUSTOMER: "customer", COMPANY: "company", ALL: ["customer", "company"] }; export { STATUSES, DEFAULT_SEX_CHOICES }; export const COMPANY_SELECT_OPTIONS = { BUSINESS_TYPES: [ { label: "Competitor", value: "Competitor" }, { label: "Customer", value: "Customer" }, { label: "Investor", value: "Investor" }, { label: "Partner", value: "Partner" }, { label: "Press", value: "Press" }, { label: "Prospect", value: "Prospect" }, { label: "Reseller", value: "Reseller" }, { label: "Other", value: "Other" }, { label: "Unknown", value: "" } ], STATUSES, DO_NOT_DISTURB: [ { label: "Yes", value: "Yes" }, { label: "No", value: "No" }, { label: "Unknown", value: "" } ] }; export const CUSTOMER_SELECT_OPTIONS = { SEX: [ ...DEFAULT_SEX_CHOICES, { label: "co/co", value: 10 }, { label: "en/en", value: 11 }, { label: "ey/em", value: 12 }, { label: "he/him", value: 13 }, { label: "he/them", value: 14 }, { label: "she/her", value: 15 }, { label: "she/them", value: 16 }, { label: "they/them", value: 17 }, { label: "xie/hir", value: 18 }, { label: "yo/yo", value: 19 }, { label: "ze/zir", value: 20 }, { label: "ve/vis", value: 21 }, { label: "xe/xem", value: 22 } ], EMAIL_VALIDATION_STATUSES: [ { label: "Valid", value: "valid" }, { label: "Invalid", value: "invalid" }, { label: "Accept all unverifiable", value: "accept_all_unverifiable" }, { label: "Unverifiable", value: "unverifiable" }, { label: "Unknown", value: "unknown" }, { label: "Disposable", value: "disposable" }, { label: "Catch all", value: "catchall" }, { label: "Bad syntax", value: "badsyntax" } ], PHONE_VALIDATION_STATUSES: [ { label: "Valid", value: "valid" }, { label: "Invalid", value: "invalid" }, { label: "Unknown", value: "unknown" }, { label: "Can receive sms", value: "receives_sms" }, { label: "Unverifiable", value: "unverifiable" } ], LEAD_STATUS_TYPES: [ { label: "New", value: "new" }, { label: "Contacted", value: "attemptedToContact" }, { label: "Working", value: "inProgress" }, { label: "Bad Timing", value: "badTiming" }, { label: "Unqualified", value: "unqualified" }, { label: "Unknown", value: "" } ], STATUSES, DO_NOT_DISTURB: [ { label: "Yes", value: "Yes" }, { label: "No", value: "No" }, { label: "Unknown", value: "" } ], HAS_AUTHORITY: [ { label: "Yes", value: "Yes" }, { label: "No", value: "No" }, { label: "Unknown", value: "" } ], STATE: [ { label: "Visitor", value: "visitor" }, { label: "Lead", value: "lead" }, { label: "Customer", value: "customer" } ] }; export const TAG_TYPES = { CUSTOMER: "core:customer", COMPANY: "core:company" }; ```
/content/code_sandbox/packages/core/src/data/modules/coc/constants.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
2,606
```xml import styled from '@emotion/styled'; import { Typography } from '@mui/material'; import List from '@mui/material/List'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { TemplateUIOptions } from '@verdaccio/types'; import { Theme } from '../../Theme'; import { PackageMetaInterface } from '../../types/packageMeta'; import { SettingsMenu } from '../SettingsMenu'; import InstallListItem, { DependencyManager } from './InstallListItem'; const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({ fontWeight: props.theme?.fontWeight.bold, textTransform: 'capitalize', })); const Wrapper = styled('div')({ display: 'flex', alignItems: 'center', justifyContent: 'space-between', }); export type Props = { packageMeta: PackageMetaInterface; packageName: string; configOptions: TemplateUIOptions; }; const Install: React.FC<Props> = ({ packageMeta, packageName, configOptions }) => { const { t } = useTranslation(); if (!packageMeta || !packageName) { return null; } const hasNpm = configOptions?.pkgManagers?.includes('npm'); const hasYarn = configOptions?.pkgManagers?.includes('yarn'); const hasPnpm = configOptions?.pkgManagers?.includes('pnpm') ?? true; const hasPkgManagers = hasNpm || hasPnpm || hasYarn; return hasPkgManagers ? ( <> <List data-testid={'installList'} subheader={ <Wrapper> <StyledText variant={'subtitle1'}>{t('sidebar.installation.title')}</StyledText> <SettingsMenu packageName={packageName} /> </Wrapper> } > {hasNpm && ( <InstallListItem dependencyManager={DependencyManager.NPM} packageName={packageName} packageVersion={packageMeta.latest.version} /> )} {hasYarn && ( <InstallListItem dependencyManager={DependencyManager.YARN} packageName={packageName} packageVersion={packageMeta.latest.version} /> )} {hasPnpm && ( <InstallListItem dependencyManager={DependencyManager.PNPM} packageName={packageName} packageVersion={packageMeta.latest.version} /> )} </List> </> ) : null; }; export default Install; ```
/content/code_sandbox/packages/ui-components/src/components/Install/Install.tsx
xml
2016-04-15T16:21:12
2024-08-16T09:38:01
verdaccio
verdaccio/verdaccio
16,189
513
```xml describe('Search', () => { beforeEach(() => { cy.visit('/'); cy.get('.card-body'); cy.get('.col-sm-12').contains('Login'); /* ==== Generated with Cypress Studio ==== */ cy.get('#username').type('admin'); cy.get('#password').clear(); cy.get('#password').type('admin'); cy.intercept({ method: 'Get', url: '/pgapi/gallery/content/', }).as('getContent'); cy.get('.col-sm-12 > .btn').click(); }); it('Search builder should propagate to search bar', () => { cy.get('.mb-0 > :nth-child(1) > .nav-link').contains('Gallery'); cy.get('app-gallery-search .search-text').type('a and b', {force: true}); cy.get('app-gallery-search ng-icon[name="ionChevronDownOutline"]').click(); cy.get('app-gallery-search-query-builder app-gallery-search-field-base input.search-text').should('have.value', 'a and b'); cy.get('app-gallery-search-query-entry .btn-danger').last().click(); cy.get('app-gallery-search-query-builder app-gallery-search-field-base input.search-text').should('have.value', 'a'); cy.get('modal-container .btn-close').click(); cy.get('app-gallery-search .search-text').should('have.value', 'a'); }); }); ```
/content/code_sandbox/test/cypress/e2e/search.cy.ts
xml
2016-03-12T11:46:41
2024-08-16T19:56:44
pigallery2
bpatrik/pigallery2
1,727
299
```xml // ag-grid-ng2 v6.2.0 /** * This file is generated by the Angular 2 template compiler. * Do not edit. */ import * as import0 from '@angular/core/src/linker/ng_module_factory'; import * as import1 from './aggrid.module'; export declare const AgGridModuleNgFactory: import0.NgModuleFactory<import1.AgGridModule>; ```
/content/code_sandbox/services/dashboard/assets-dev/js/vendor/ag-grid-ng2/lib/aggrid.module.ngfactory.d.ts
xml
2016-06-21T19:39:58
2024-08-12T19:23:26
mylg
mehrdadrad/mylg
2,691
82
```xml import { createHooks } from '@proton/redux-utilities'; import { domainsThunk, selectDomains } from './index'; const hooks = createHooks(domainsThunk, selectDomains); export const useCustomDomains = hooks.useValue; export const useGetCustomDomains = hooks.useGet; ```
/content/code_sandbox/packages/account/domains/hooks.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
60
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>ACPI</key> <dict> <key>DSDT</key> <dict> <key>Debug</key> <false/> <key>DropOEM_DSM</key> <false/> <key>Name</key> <string>DSDT.aml</string> <key>ReuseFFFF</key> <false/> </dict> <key>SSDT</key> <dict> <key>DropOem</key> <false/> <key>Generate</key> <false/> </dict> </dict> <key>Boot</key> <dict> <key>Arguments</key> <string>-v dart=0 npci=0x3000 nv_disable=1</string> <key>Debug</key> <false/> <key>DefaultVolume</key> <string>macOS System</string> <key>Legacy</key> <string>PBR</string> <key>Secure</key> <false/> <key>Timeout</key> <integer>0</integer> <key>XMPDetection</key> <false/> </dict> <key>CPU</key> <dict> <key>UseARTFrequency</key> <false/> </dict> <key>Devices</key> <dict> <key>Audio</key> <dict> <key>Inject</key> <string>3</string> </dict> <key>FakeID</key> <dict> <key>IntelGFX</key> <string>0x04128086</string> </dict> <key>USB</key> <dict> <key>FixOwnership</key> <true/> <key>Inject</key> <false/> </dict> </dict> <key>DisableDrivers</key> <array> <string>Nothing</string> </array> <key>GUI</key> <dict> <key>Hide</key> <array> <string>\EFI\BOOT\BOOTX64.EFI</string> <string>Windows</string> </array> <key>Language</key> <string>zh_CN:0</string> <key>Mouse</key> <dict> <key>DoubleClick</key> <integer>500</integer> <key>Enabled</key> <true/> <key>Mirror</key> <false/> <key>Speed</key> <integer>8</integer> </dict> <key>Scan</key> <dict> <key>Entries</key> <true/> <key>Legacy</key> <false/> <key>Linux</key> <true/> <key>Tool</key> <true/> </dict> <key>ScreenResolution</key> <string>1920x1080</string> <key>Theme</key> <string>imac.hk</string> </dict> <key>Graphics</key> <dict> <key>EDID</key> <dict> <key>Custom</key> <data> </data> <key>Inject</key> <false/> </dict> <key>Inject</key> <dict> <key>ATI</key> <false/> <key>Intel</key> <true/> <key>NVidia</key> <false/> </dict> <key>NvidiaSingle</key> <false/> <key>ig-platform-id</key> <string>0x0a260006</string> </dict> <key>KernelAndKextPatches</key> <dict> <key>AppleRTC</key> <true/> <key>AsusAICPUPM</key> <false/> <key>Debug</key> <false/> <key>DellSMBIOSPatch</key> <false/> <key>ForceKextsToLoad</key> <array> <string>\System\Library\Extensions\IONetworkingFamily.kext</string> </array> <key>KernelCpu</key> <false/> <key>KernelHaswellE</key> <false/> <key>KernelLapic</key> <true/> <key>KernelPm</key> <true/> <key>KextsToPatch</key> <array> <dict> <key>Comment</key> <string>injector</string> <key>Disabled</key> <false/> <key>Find</key> <data> AIN9lBAPg1o= </data> <key>Name</key> <string>AppleUSBXHCIPCI</string> <key>Replace</key> <data> AIN9lB8Pg1o= </data> </dict> <dict> <key>Comment</key> <string>TRIM</string> <key>Disabled</key> <false/> <key>Find</key> <data> QVBQTEUgU1NEAA== </data> <key>Name</key> <string>IOAHCIBlockStorage</string> <key>Replace</key> <data> AAAAAAAAAAAAAA== </data> </dict> <dict> <key>Comment</key> <string>Second stage patch</string> <key>Disabled</key> <false/> <key>Find</key> <data> AQAAdSU= </data> <key>Name</key> <string>IOGraphicsFamily</string> <key>Replace</key> <data> AQAA6yU= </data> </dict> <dict> <key>Comment</key> <string>0x0a260006 9MB cursor bytes patch</string> <key>Disabled</key> <false/> <key>Find</key> <data> BgAmCgEDAwMAAAACAAAwAQAAYAA= </data> <key>Name</key> <string>AppleIntelFramebufferAzul</string> <key>Replace</key> <data> BgAmCgEDAwMAAAACAAAwAQAAkAA= </data> </dict> <dict> <key>Comment</key> <string>Isolate IntelAccelerator HD4600 10.12.x</string> <key>Disabled</key> <false/> <key>Find</key> <data> SImLqAAAAA== </data> <key>Name</key> <string>AppleIntelFramebufferAzul</string> <key>Replace</key> <data> kJCQkJCQkA== </data> </dict> </array> </dict> <key>RtVariables</key> <dict> <key>BooterConfig</key> <string>0x28</string> <key>CsrActiveConfig</key> <string>0x67</string> </dict> <key>SMBIOS</key> <dict> <key>BiosReleaseDate</key> <string>10/18/13</string> <key>BiosVendor</key> <string>Apple Inc.</string> <key>BiosVersion</key> <string>MBP112.88Z.0138.B02.1310181745</string> <key>Board-ID</key> <string>Mac-3CBD00234E554E41</string> <key>BoardManufacturer</key> <string>Apple Inc.</string> <key>BoardType</key> <integer>10</integer> <key>ChassisAssetTag</key> <string>MacBook-Aluminum</string> <key>ChassisManufacturer</key> <string>Apple Inc.</string> <key>ChassisType</key> <string>08</string> <key>Family</key> <string>MacBook Pro</string> <key>Manufacturer</key> <string>Apple Inc.</string> <key>Mobile</key> <true/> <key>ProductName</key> <string>MacBookPro11,2</string> <key>SerialNumber</key> <string>C02N2MUZFD56</string> <key>Trust</key> <false/> <key>Version</key> <string>1.0</string> </dict> <key>SystemParameters</key> <dict> <key>InjectKexts</key> <string>Yes</string> <key>InjectSystemID</key> <true/> </dict> </dict> </plist> ```
/content/code_sandbox/Res/ Lenove-B50-intelHD4600-success/config-backup.plist
xml
2016-11-05T04:22:54
2024-08-12T19:25:53
Hackintosh-Installer-University
huangyz0918/Hackintosh-Installer-University
3,937
2,301
```xml import { memoizeFunction } from '../../../Utilities'; import { mergeStyleSets, focusClear, HighContrastSelector } from '../../../Styling'; import type { IStyle } from '../../../Styling'; export interface IPositioningContainerStyles { /** * Style for the root element in the default enabled/unchecked state. */ root?: IStyle; } export interface IPositioningContainerNames { /** * Root html container for this component. */ root: string; container: string; main: string; overFlowYHidden: string; beak?: string; beakCurtain?: string; } export const getClassNames = memoizeFunction((): IPositioningContainerNames => { return mergeStyleSets({ root: [ { position: 'absolute', boxSizing: 'border-box', border: '1px solid ${}', selectors: { [HighContrastSelector]: { border: '1px solid WindowText', }, }, }, focusClear(), ], container: { position: 'relative', }, main: { backgroundColor: '#ffffff', overflowX: 'hidden', overflowY: 'hidden', position: 'relative', }, overFlowYHidden: { overflowY: 'hidden', }, }); }); ```
/content/code_sandbox/packages/react/src/components/Coachmark/PositioningContainer/PositioningContainer.styles.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
285
```xml export interface DomApi { getBodyElement(): Element; createElement(tag: string, isSvg?: boolean): Element; createText(text: string): Text; createComment(text: string): Comment; getAttr(node: HTMLElement, name: string): string | void; setAttr(node: HTMLElement, name: string, value: string): void; removeAttr(node: HTMLElement, name: string): void; setStyle(style: CSSStyleDeclaration, name: string, value: string | number | void): void; removeStyle(style: CSSStyleDeclaration, name: string): void; before(parentNode: Node, node: Node, beforeNode: Node): void; append(parentNode: Node, node: Node): void; replace(parentNode: Node, node: Node, oldNode: Node): void; remove(parentNode: Node, node: Node): void; parent(node: Node): Node | void; next(node: Node): Node | void; find(selector: string): Element | void; tag(node: Node): string | void; getNodeText(node: Node): string | void; setNodeText(node: Node, text: string): void; getElementText(node: Node): string | void; setElementText(node: Node, text: string): void; getHtml(node: Element): string | void; setHtml(node: Element, html: string): void; addClass(node: HTMLElement, className: string): void; removeClass(node: HTMLElement, className: string): void; on(node: HTMLElement | Window | Document, type: string, listener: Listener): void; off(node: HTMLElement | Window | Document, type: string, listener: Function): void; addSpecialEvent(type: string, hooks: SpecialEventHooks): void; } export interface ArrayApi { each<T>(array: T[], callback: (item: T, index: number) => boolean | void, reversed?: boolean): void; push<T>(array: T[], target: T | T[]): void; unshift<T>(array: T[], target: T | T[]): void; indexOf<T>(array: T[], target: T, strict?: boolean): number; last<T>(array: T[]): T | void; pop<T>(array: T[]): T | void; remove<T>(array: T[], target: T, strict?: boolean): number; has<T>(array: T[], target: T, strict?: boolean): boolean; toArray<T>(array: T[] | ArrayLike<T>): T[]; toObject(array: any[], key?: string | null, value?: any): object; join(array: string[], separator: string): string; falsy(array: any): boolean; } export interface IsApi { func(value: any): boolean; array(value: any): boolean; object(value: any): boolean; string(value: any): boolean; number(value: any): boolean; boolean(value: any): boolean; numeric(value: any): boolean; } export interface LoggerApi { DEBUG: number; INFO: number; WARN: number; ERROR: number; FATAL: number; debug(msg: string, tag?: string): void; info(msg: string, tag?: string): void; warn(msg: string, tag?: string): void; error(msg: string, tag?: string): void; fatal(msg: string, tag?: string): void; } export interface ObjectApi { keys(object: Data): string[]; each(object: Data, callback: (value: any, key: string) => boolean | void): void; extend(original: Data, object: Data): Data; merge(object1: Data | void, object2: Data | void): Data | void; copy(object: any, deep?: boolean): any; get(object: any, keypath: string): ValueHolder | undefined; set(object: Data, keypath: string, value: any, autofill?: boolean): void; has(object: Data, key: string | number): boolean; falsy(object: any): boolean; } export interface StringApi { camelize(str: string): string; hyphenate(str: string): string; capitalize(str: string): string; trim(str: any): string; slice(str: string, start: number, end?: number): string; indexOf(str: string, part: string, start?: number): number; lastIndexOf(str: string, part: string, end?: number): number; startsWith(str: string, part: string): boolean; endsWith(str: string, part: string): boolean; charAt(str: string, index?: number): string; codeAt(str: string, index?: number): number; upper(str: string): string; lower(str: string): string; has(str: string, part: string): boolean; falsy(str: any): boolean; } declare const HOOK_BEFORE_CREATE = "beforeCreate"; declare const HOOK_AFTER_CREATE = "afterCreate"; declare const HOOK_BEFORE_RENDER = "beforeRender"; declare const HOOK_AFTER_RENDER = "afterRender"; declare const HOOK_BEFORE_MOUNT = "beforeMount"; declare const HOOK_AFTER_MOUNT = "afterMount"; declare const HOOK_BEFORE_UPDATE = "beforeUpdate"; declare const HOOK_AFTER_UPDATE = "afterUpdate"; declare const HOOK_BEFORE_DESTROY = "beforeDestroy"; declare const HOOK_AFTER_DESTROY = "afterDestroy"; declare const HOOK_BEFORE_PROPS_UPDATE = "beforePropsUpdate"; export interface ComputedOptions { get: ComputedGetter; set?: ComputedSetter; cache?: boolean; sync?: boolean; deps?: string[]; input?: any[]; output?: ComputedOutput; } export interface WatcherOptions { watcher: Watcher; immediate?: boolean; sync?: boolean; once?: boolean; } export interface ThisWatcherOptions<This = any> { watcher: ThisWatcher<This>; immediate?: boolean; sync?: boolean; once?: boolean; } export interface ListenerOptions { listener: Listener; ns: string; } export interface ThisListenerOptions<This = any> { listener: ThisListener<This>; ns: string; } export interface TypeListenerOptions { type: string; listener: Listener; ns: string; } export interface ThisTypeListenerOptions<This = any> { type: string; listener: ThisListener<This>; ns: string; } export interface EmitterEvent { type: string; ns?: string; } export interface EmitterFilter { type?: string; ns?: string; listener?: Function; } export interface EmitterOptions { ns?: string; num?: number; max?: number; count?: number; ctx?: any; listener: Function; } export declare type DataGenerator<T> = (options: ComponentOptions<T>) => Data; export declare type Accessors<T, V> = { [K in keyof T]: V; }; export declare type ComponentOptionsHook = () => void; export interface ComponentOptions<Computed = any, Watchers = any, Events = any, Methods = any> { name?: string; propTypes?: Record<string, PropRule>; el?: string | Node; data?: Data | DataGenerator<YoxInterface>; template?: string | Function; model?: string; props?: Data; root?: YoxInterface; parent?: YoxInterface; context?: YoxInterface; replace?: true; vnode?: VNode; slots?: Slots; computed?: Accessors<Computed, ComputedGetter | ComputedOptions>; watchers?: Accessors<Watchers, Watcher | WatcherOptions>; events?: Accessors<Events, Listener | ListenerOptions> | TypeListenerOptions[]; methods?: Methods; transitions?: Record<string, TransitionHooks>; components?: Record<string, ComponentOptions>; directives?: Record<string, DirectiveFunction>; filters?: Record<string, Filter>; extensions?: Data; [HOOK_BEFORE_CREATE]?: (options: ComponentOptions) => void; [HOOK_AFTER_CREATE]?: ComponentOptionsHook; [HOOK_BEFORE_RENDER]?: (props: Data) => void; [HOOK_AFTER_RENDER]?: ComponentOptionsHook; [HOOK_BEFORE_MOUNT]?: ComponentOptionsHook; [HOOK_AFTER_MOUNT]?: ComponentOptionsHook; [HOOK_BEFORE_UPDATE]?: ComponentOptionsHook; [HOOK_AFTER_UPDATE]?: ComponentOptionsHook; [HOOK_BEFORE_DESTROY]?: ComponentOptionsHook; [HOOK_AFTER_DESTROY]?: ComponentOptionsHook; [HOOK_BEFORE_PROPS_UPDATE]?: (props: Data) => void; } /** * Yox */ export interface CustomEventInterface { type: string; phase: number; ns?: string; target?: YoxInterface; originalEvent?: CustomEventInterface | Event; isPrevented?: true; isStoped?: true; /** * */ preventDefault(): this; /** * */ stopPropagation(): this; prevent(): this; stop(): this; } /** * Yox */ export interface YoxInterface { $options: ComponentOptions; $el?: HTMLElement; $vnode?: VNode; $model?: string; $root?: YoxInterface; $parent?: YoxInterface; $context?: YoxInterface; $children?: YoxInterface[]; $refs?: Record<string, YoxInterface | HTMLElement>; get(keypath: string, defaultValue?: any): any; set(keypath: string | Data, value?: any): void; on(type: string | Record<string, ThisListener<this> | ThisListenerOptions> | ThisTypeListenerOptions[], listener?: ThisListener<this> | ThisListenerOptions): this; once(type: string | Record<string, ThisListener<this> | ThisListenerOptions> | ThisTypeListenerOptions[], listener?: ThisListener<this> | ThisListenerOptions): this; off(type?: string, listener?: ThisListener<this> | ThisListenerOptions): this; fire(type: string | EmitterEvent | CustomEventInterface, data?: Data | boolean, downward?: boolean): boolean; watch(keypath: string | Record<string, ThisWatcher<this> | ThisWatcherOptions<this>>, watcher?: ThisWatcher<this> | ThisWatcherOptions<this>, immediate?: boolean): this; unwatch(keypath?: string, watcher?: ThisWatcher<this>): this; loadComponent(name: string, callback: ComponentCallback): void; createComponent(options: ComponentOptions, vnode: VNode): YoxInterface; directive(name: string | Record<string, DirectiveFunction>, directive?: DirectiveFunction): DirectiveFunction | void; transition(name: string | Record<string, TransitionHooks>, transition?: TransitionHooks): TransitionHooks | void; component(name: string | Record<string, Component>, component?: Component): Component | void; filter(name: string | Record<string, Filter>, filter?: Filter): Filter | void; checkProp(key: string, value: any): void; forceUpdate(props?: Data): void; destroy(): void; nextTick(task: ThisTask<this>): void; toggle(keypath: string): boolean; increase(keypath: string, step?: number, max?: number): number | void; decrease(keypath: string, step?: number, min?: number): number | void; insert(keypath: string, item: any, index: number | boolean): true | void; append(keypath: string, item: any): true | void; prepend(keypath: string, item: any): true | void; removeAt(keypath: string, index: number): true | void; remove(keypath: string, item: any): true | void; copy<T>(data: T, deep?: boolean): T; } export declare type EventArgs = (event: CustomEventInterface, data?: Data) => any[]; export interface EventRuntime { execute: EventArgs; } export interface Directive { name: string; ns: string; readonly modifier: string | void; readonly value: any; readonly create: DirectiveFunction; } export interface EventValue { key: string; name: string; value: string; runtime: EventRuntime | void; readonly ns: string | void; readonly isNative?: boolean; readonly listener: Listener; } export interface ModelValue { keypath: string; value: any; } export declare type Slots = Record<string, (parent: YoxInterface) => VNode[] | void>; export interface VNodeOperator { create(api: DomApi, vnode: VNode): void; update(api: DomApi, vnode: VNode, oldVNode: VNode): void; destroy(api: DomApi, vnode: VNode): void; insert(api: DomApi, parentNode: Node, vnode: VNode, before?: VNode): void; remove(api: DomApi, vnode: VNode): void; enter(vnode: VNode): void; leave(vnode: VNode, done: Function): void; } export interface VNode { type: number; data?: Data; node?: Node; parentNode?: Node; target?: Node; shadow?: VNode; parent?: YoxInterface; component?: YoxInterface; readonly context: YoxInterface; readonly operator: VNodeOperator; readonly tag?: string; readonly isSvg?: boolean; readonly isStatic?: boolean; readonly isPure?: boolean; readonly slots?: Slots; readonly props?: Data; readonly nativeAttrs?: Record<string, string>; readonly nativeStyles?: Data; readonly directives?: Record<string, Directive>; readonly events?: Record<string, EventValue>; readonly lazy?: Record<string, LazyValue>; readonly transition?: TransitionHooks; readonly model?: ModelValue; readonly to?: string; readonly ref?: string; readonly key?: string; readonly text?: string; readonly html?: string; readonly children?: VNode[]; } export interface DirectiveHooks { afterMount?: (directive: Directive, vnode: VNode) => void; beforeUpdate?: (directive: Directive, vnode: VNode) => void; afterUpdate?: (directive: Directive, vnode: VNode) => void; beforeDestroy?: (directive: Directive, vnode: VNode) => void; } export interface SpecialEventHooks { on: (node: HTMLElement | Window | Document, listener: NativeListener) => void; off: (node: HTMLElement | Window | Document, listener: NativeListener) => void; } export interface TransitionHooks { enter?: (node: HTMLElement) => void; leave?: (node: HTMLElement, done: () => void) => void; } export declare type Data = Record<string, any>; export declare type LazyValue = number | true; export declare type PropTypeFunction = (key: string, value: any, componentName: string | void) => void; export declare type PropValueFunction = () => any; export declare type ComponentCallback = (options: ComponentOptions) => void; export declare type ComponentLoader = (callback: ComponentCallback) => Promise<ComponentOptions> | void; export declare type Component = ComponentOptions | ComponentLoader; export declare type DirectiveFunction = (node: HTMLElement | YoxInterface, directive: Directive, vnode: VNode) => DirectiveHooks | undefined; export declare type FilterFunction = (this: any, ...args: any) => string | number | boolean; export declare type Filter = FilterFunction | Record<string, FilterFunction>; export declare type ThisTask<This> = (this: This) => void; export declare type ThisWatcher<This> = (this: This, newValue: any, oldValue: any, keypath: string) => void; export declare type Watcher = (newValue: any, oldValue: any, keypath: string) => void; export declare type ThisListener<This> = (this: This, event: CustomEventInterface, data?: Data) => false | void; export declare type Listener = (event: CustomEventInterface, data?: Data, isNative?: boolean) => false | void; export declare type NativeListener = (event: CustomEventInterface | Event) => false | void; export declare type ComputedGetter = (...params: any) => any; export declare type ComputedSetter = (value: any) => void; export declare type ComputedOutput = (value: any) => any; export declare type ValueHolder = { keypath?: string; value: any; }; export declare type PropRule = { type: string | string[] | PropTypeFunction; value?: any | PropValueFunction; required?: boolean; }; declare class Emitter { /** * */ ns: boolean; /** * */ listeners: Record<string, EmitterOptions[]>; constructor(ns?: boolean); /** * * * @param type * @param args * @param filter */ fire(type: string | EmitterEvent, args: any[] | void, filter?: (event: EmitterEvent, args: any[] | void, options: EmitterOptions) => boolean | void): boolean; /** * * * @param type * @param listener */ on(type: string, listener: Function | EmitterOptions): void; /** * * * @param type * @param listener */ off(type?: string, listener?: Function | EmitterFilter): void; /** * * * @param type * @param listener */ has(type: string, listener?: Function | EmitterFilter): boolean; /** * * * @param type */ toEvent(type: string): EmitterEvent; toFilter(type: string, listener?: Function | EmitterFilter): EmitterFilter; } declare class CustomEvent implements CustomEventInterface { static PHASE_CURRENT: number; static PHASE_UPWARD: number; static PHASE_DOWNWARD: number; static is(event: any): boolean; type: string; phase: number; ns?: string; target?: YoxInterface; originalEvent?: CustomEventInterface | Event; isPrevented?: true; isStoped?: true; /** * * * */ constructor(type: string, originalEvent?: CustomEventInterface | Event); /** * */ preventDefault(): this; /** * */ stopPropagation(): this; prevent(): this; stop(): this; } export declare type NextTaskHooks = { beforeTask?: Function; afterTask?: Function; }; declare class NextTask { /** * */ static shared(): NextTask; /** * */ private tasks; private hooks; constructor(hooks?: NextTaskHooks); /** * */ append(func: Function, context?: any): void; /** * */ prepend(func: Function, context?: any): void; /** * */ clear(): void; /** * */ run(): void; } declare class Deps { map: Record<number, Record<string, Observer>>; list: [ Observer, string ][]; constructor(); add(observer: Observer, dep: string): void; watch(watcher: WatcherOptions): void; unwatch(watcher: Watcher): void; } declare class Computed { static current?: Computed; keypath: string; value: any; status: number; cache: boolean; input: any[] | void; output: ComputedOutput | void; setter: ComputedSetter | void; getter: ComputedGetter; staticDeps: Deps | void; dynamicDeps: Deps | void; watcherOptions: WatcherOptions; onChange: (keypath: string, newValue: any, oldValue: any) => void; constructor(keypath: string, cache: boolean, sync: boolean, input: any[] | void, output: ComputedOutput | void, getter: ComputedGetter, setter: ComputedSetter | void, onChange: (keypath: string, newValue: any, oldValue: any) => void); /** * */ get(): any; set(value: any): void; refresh(): void; addStaticDeps(observer: Observer, deps: string[]): void; addDynamicDep(observer: Observer, dep: string): void; } declare class Observer { id: number; data: Data; context: any; nextTask: NextTask; syncEmitter: Emitter; asyncEmitter: Emitter; asyncOldValues: Record<string, any>; asyncKeypaths: Record<string, Record<string, boolean>>; onComputedChange: (keypath: string, newValue: any, oldValue: any) => void; pending?: boolean; constructor(data?: Data, context?: any, nextTask?: NextTask); /** * * * @param keypath * @param defaultValue * @param depIgnore * @return */ get(keypath: string, defaultValue?: any, depIgnore?: boolean): any; /** * * * @param keypath * @param value */ set(keypath: string | Data, value?: any): void; /** * diff syncEmitter asyncEmitter * * @param keypath * @param newValue * @param oldValue */ diff(keypath: string, newValue: any, oldValue: any): void; /** * diff */ private diffAsync; /** * * * @param keypath * @param options */ addComputed(keypath: string, options: ComputedGetter | ComputedOptions): Computed | void; /** * * * @param keypath */ removeComputed(keypath: string): void; /** * * * @param keypath * @param watcher * @param immediate */ watch(keypath: string | Record<string, Watcher | WatcherOptions>, watcher?: Watcher | WatcherOptions, immediate?: boolean): void; /** * * * @param keypath * @param watcher */ unwatch(keypath?: string, watcher?: Watcher): void; /** * keypath * * keypath * * @param keypath * @return */ toggle(keypath: string): boolean; /** * keypath * * * * @param keypath 0 * @param step 1 * @param max */ increase(keypath: string, step?: number, max?: number): number | void; /** * keypath * * * * @param keypath 0 * @param step 1 * @param min */ decrease(keypath: string, step?: number, min?: number): number | void; /** * * * @param keypath * @param item * @param index */ insert(keypath: string, item: any, index: number | boolean): true | void; /** * * * @param keypath * @param item */ append(keypath: string, item: any): true | void; /** * * * @param keypath * @param item */ prepend(keypath: string, item: any): true | void; /** * * * @param keypath * @param index */ removeAt(keypath: string, index: number): true | void; /** * * * @param keypath * @param item */ remove(keypath: string, item: any): true | void; /** * * * @param data * @param deep */ copy<T>(data: T, deep?: boolean): T; /** * */ destroy(): void; } declare class LifeCycle { private $emitter; constructor(); fire(component: YoxInterface, type: string, data?: Data): void; on(type: string, listener: Function): this; off(type: string, listener: Function): this; } export default class Yox implements YoxInterface { $options: ComponentOptions; $observer: Observer; $emitter: Emitter; $el?: HTMLElement; $template?: Function; $refs?: Record<string, YoxInterface | HTMLElement>; $model?: string; $root?: YoxInterface; $parent?: YoxInterface; $context?: YoxInterface; $children?: YoxInterface[]; $vnode: VNode | undefined; private $nextTask; private $directives?; private $components?; private $transitions?; private $filters?; /** * core */ static version: string | undefined; /** * */ static is: IsApi; static dom: DomApi; static array: ArrayApi; static object: ObjectApi; static string: StringApi; static logger: LoggerApi; static Event: typeof CustomEvent; static Emitter: typeof Emitter; static lifeCycle: LifeCycle; /** * */ static config: Record<string, any>; /** * */ static define<Computed, Watchers, Events, Methods>(options: ComponentOptions<Computed, Watchers, Events, Methods> & ThisType<Methods & YoxInterface>): ComponentOptions<Computed, Watchers, Events, Methods> & ThisType<Methods & YoxInterface>; /** * * * install */ static use(plugin: { install(Y: typeof Yox): void; }): void; /** * nextTick */ static nextTick(task: Function, context?: any): void; /** * */ static compile(template: string | Function, stringify?: boolean): string | Function; /** * */ static directive(name: string | Record<string, DirectiveFunction>, directive?: DirectiveFunction): DirectiveFunction | void; /** * */ static transition(name: string | Record<string, TransitionHooks>, transition?: TransitionHooks): TransitionHooks | void; /** * */ static component(name: string | Record<string, Component>, component?: Component): Component | void; /** * */ static filter(name: string | Record<string, Filter>, filter?: Filter): Filter | void; /** * */ static method(name: string | Record<string, Function>, method?: Function): Function | void; constructor(options?: ComponentOptions); /** * */ get(keypath: string, defaultValue?: any): any; /** * */ set(keypath: string | Data, value?: any): void; /** * */ on(type: string | Record<string, ThisListener<this> | ThisListenerOptions> | ThisTypeListenerOptions[], listener?: ThisListener<this> | ThisListenerOptions): this; /** * */ once(type: string | Record<string, ThisListener<this> | ThisListenerOptions> | ThisTypeListenerOptions[], listener?: ThisListener<this> | ThisListenerOptions): this; /** * */ off(type?: string, listener?: ThisListener<this> | ThisListenerOptions): this; /** * */ fire(type: string | EmitterEvent | CustomEvent, data?: Data | boolean, downward?: boolean): boolean; /** * */ watch(keypath: string | Record<string, ThisWatcher<this> | ThisWatcherOptions<this>>, watcher?: ThisWatcher<this> | ThisWatcherOptions<this>, immediate?: boolean): this; /** * */ unwatch(keypath?: string, watcher?: ThisWatcher<this>): this; /** * callback * * @param name * @param callback */ loadComponent(name: string, callback: ComponentCallback): void; /** * * * @param options * @param vnode */ createComponent(options: ComponentOptions, vnode: VNode): YoxInterface; /** * */ directive(name: string | Record<string, DirectiveFunction>, directive?: DirectiveFunction): DirectiveFunction | void; /** * */ transition(name: string | Record<string, TransitionHooks>, transition?: TransitionHooks): TransitionHooks | void; /** * */ component(name: string | Record<string, Component>, component?: Component): Component | void; /** * */ filter(name: string | Record<string, Filter>, filter?: Filter): Filter | void; /** * * */ forceUpdate(props?: Data): void; /** * virtual dom */ render(): VNode | undefined; /** * virtual dom * * @param vnode * @param oldVNode */ update(vnode: VNode, oldVNode: VNode): void; /** * * * @param props */ checkProp(key: string, value: any): void; /** * */ destroy(): void; /** * nextTick */ nextTick(task: ThisTask<this>): void; /** * keypath * * keypath */ toggle(keypath: string): boolean; /** * keypath * * * * @param keypath 0 * @param step 1 * @param max */ increase(keypath: string, step?: number, max?: number): number | void; /** * keypath * * * * @param keypath 0 * @param step 1 * @param min */ decrease(keypath: string, step?: number, min?: number): number | void; /** * * * @param keypath * @param item * @param index */ insert(keypath: string, item: any, index: number | boolean): true | void; /** * * * @param keypath * @param item */ append(keypath: string, item: any): true | void; /** * * * @param keypath * @param item */ prepend(keypath: string, item: any): true | void; /** * * * @param keypath * @param index */ removeAt(keypath: string, index: number): true | void; /** * * * @param keypath * @param item */ remove(keypath: string, item: any): true | void; /** * * * @param data * @param deep */ copy<T>(data: T, deep?: boolean): T; } export {}; ```
/content/code_sandbox/dist/yox.d.ts
xml
2016-11-09T11:46:20
2024-08-15T04:41:25
yox
yoxjs/yox
1,084
6,575
```xml export const ensureEnv = (name: string) => { const val = process.env[name] if (!val) { throw new Error(`Missing ${name} environment variable`) } return val } ```
/content/code_sandbox/integrations/webchat/local/env.ts
xml
2016-11-16T21:57:59
2024-08-16T18:45:35
botpress
botpress/botpress
12,401
46
```xml import { EventEmitter, Type } from '@angular/core'; import { Routes } from '@angular/router'; import { Subject } from 'rxjs'; import { eLayoutType } from '../enums/common'; import { Environment } from './environment'; export namespace ABP { export interface Root { environment: Partial<Environment>; registerLocaleFn: (locale: string) => Promise<any>; skipGetAppConfiguration?: boolean; skipInitAuthService?: boolean; sendNullsAsQueryParam?: boolean; tenantKey?: string; localizations?: Localization[]; othersGroup?: string; dynamicLayouts?: Map<string, string>; disableProjectNameInTitle?: boolean; } export interface Child { localizations?: Localization[]; } export interface Localization { culture: string; resources: LocalizationResource[]; } export interface LocalizationResource { resourceName: string; texts: Record<string, string>; } export interface HasPolicy { requiredPolicy?: string; } export interface Test extends Partial<Root> { baseHref?: string; listQueryDebounceTime?: number; routes?: Routes; } export type PagedResponse<T> = { totalCount: number; } & PagedItemsResponse<T>; export interface PagedItemsResponse<T> { items: T[]; } export interface PageQueryParams { filter?: string; sorting?: string; skipCount?: number; maxResultCount?: number; } export interface Lookup { id: string; displayName: string; } export interface Nav { name: string; parentName?: string; requiredPolicy?: string; order?: number; invisible?: boolean; } export interface Route extends Nav { path?: string; layout?: eLayoutType; iconClass?: string; group?: string; breadcrumbText?: string; } export interface Tab extends Nav { component: Type<any>; } export interface BasicItem { id: string; name: string; } export interface Option<T> { key: Extract<keyof T, string>; value: T[Extract<keyof T, string>]; } export interface Dictionary<T = any> { [key: string]: T; } export type ExtractFromOutput<T extends EventEmitter<any> | Subject<any>> = T extends EventEmitter<infer X> ? X : T extends Subject<infer Y> ? Y : never; } ```
/content/code_sandbox/npm/ng-packs/packages/core/src/lib/models/common.ts
xml
2016-12-03T22:56:24
2024-08-16T16:24:05
abp
abpframework/abp
12,657
528
```xml <?xml version="1.0" encoding="UTF-8" ?> <!-- path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <!DOCTYPE configuration> <configuration scan="true" scanPeriod="10 seconds"> <appender name="fileLogAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>/var/log/tb-http-transport/${TB_SERVICE_ID}/tb-http-transport.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <fileNamePattern>/var/log/tb-http-transport/${TB_SERVICE_ID}/tb-http-transport.%d{yyyy-MM-dd}.%i.log</fileNamePattern> <maxFileSize>100MB</maxFileSize> <maxHistory>30</maxHistory> <totalSizeCap>3GB</totalSizeCap> </rollingPolicy> <encoder> <pattern>%d{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> <logger name="org.thingsboard.server" level="INFO" /> <logger name="com.microsoft.azure.servicebus.primitives.CoreMessageReceiver" level="OFF" /> <logger name="org.apache.kafka.common.utils.AppInfoParser" level="WARN"/> <logger name="org.apache.kafka.clients" level="WARN"/> <logger name="org.thingsboard.server.transport.http" level="TRACE"/> <root level="INFO"> <appender-ref ref="fileLogAppender"/> <appender-ref ref="STDOUT"/> </root> </configuration> ```
/content/code_sandbox/msa/black-box-tests/src/test/resources/tb-transports/http/conf/logback.xml
xml
2016-12-01T09:33:30
2024-08-16T19:58:25
thingsboard
thingsboard/thingsboard
16,820
441
```xml import { h } from 'preact'; export interface IFrameProps { // The url to embed. url: string; // When closed. onClose: () => void; } export const IFrame = (props: IFrameProps) => { const { url, onClose } = props; return ( <div class='squidex-iframe'> <button class='squidex-iframe-close' onClick={onClose}> <svg version='1.1' xmlns='path_to_url width='18' height='18' viewBox='0 0 24 24'> <path d='M18.984 6.422l-5.578 5.578 5.578 5.578-1.406 1.406-5.578-5.578-5.578 5.578-1.406-1.406 5.578-5.578-5.578-5.578 1.406-1.406 5.578 5.578 5.578-5.578z'></path> </svg> </button> <iframe src={url} frameBorder={0}></iframe> </div> ); }; ```
/content/code_sandbox/sdk/src/components/iframe.tsx
xml
2016-08-29T05:53:40
2024-08-16T17:39:38
squidex
Squidex/squidex
2,222
263
```xml import { createSelector, createSlice, PayloadAction } from '@reduxjs/toolkit'; import { ExtendedAsset, IProvidersMappings, LSKeys } from '@types'; import { getAppState } from './selectors'; export const initialState = {} as Record<string, IProvidersMappings>; const sliceName = LSKeys.TRACKED_ASSETS; /** * Store assets not present in accounts assets but needed for rates fetching */ const slice = createSlice({ name: sliceName, initialState, reducers: { trackAsset(state, action: PayloadAction<ExtendedAsset>) { return { ...state, [action.payload.uuid]: { ...action.payload.mappings } }; } } }); export const { trackAsset } = slice.actions; export default slice; /** * Selectors */ export const getTrackedAssets = createSelector([getAppState], (s) => s[slice.name]); ```
/content/code_sandbox/src/services/Store/store/trackedAssets.slice.ts
xml
2016-12-04T01:35:27
2024-08-14T21:41:58
MyCrypto
MyCryptoHQ/MyCrypto
1,347
182
```xml <?xml version="1.0" encoding="utf-8"?> <!-- path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <resources> <color name="x_recycler_color_text_gray">#FF777777</color> <color name="x_recycler_color_loading_color1">#55777777</color> <color name="x_recycler_color_loading_color2">#B1777777</color> <color name="x_recycler_color_loading_color3">#FF777777</color> </resources> ```
/content/code_sandbox/x/src/main/res/values/colors.xml
xml
2016-08-03T15:43:34
2024-08-14T01:11:22
SwipeRecyclerView
yanzhenjie/SwipeRecyclerView
5,605
133
```xml <vector android:height="128dp" android:viewportHeight="33.86667" android:viewportWidth="33.86667" android:width="128dp" xmlns:android="path_to_url"> <path android:fillColor="#ffdd55" android:pathData="m31.5956,25.397c-4.6752,8.0947 -15.0298,10.8681 -23.1275,6.1947 -8.0977,-4.6735 -10.8722,-15.0242 -6.197,-23.1189 4.6752,-8.0947 15.0298,-10.8681 23.1275,-6.1947 8.0977,4.6735 10.8722,15.0242 6.197,23.1189" android:strokeWidth="0.05289798"/> <path android:fillColor="#999" android:pathData="m25.3966,2.2878c-2.6723,-1.5423 -5.5901,-2.2687 -8.4688,-2.2653l-14.6587,25.3801c1.4364,2.4938 3.5247,4.6565 6.197,6.1988 2.6675,1.5395 5.5797,2.2661 8.4533,2.2654l14.6664,-25.3935c-1.4362,-2.4881 -3.5217,-4.6459 -6.1892,-6.1854z" android:strokeWidth="0.05289798"/> <path android:pathData="M9.6499,6.35L24.2168,6.35A2.2415,2.2415 0,0 1,26.4583 8.5915L26.4583,25.2751A2.2415,2.2415 0,0 1,24.2168 27.5167L9.6499,27.5167A2.2415,2.2415 0,0 1,7.4083 25.2751L7.4083,8.5915A2.2415,2.2415 0,0 1,9.6499 6.35z" android:strokeAlpha="0.2" android:strokeColor="#000" android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="2.11666656"/> <path android:fillColor="#fff" android:pathData="M9.1389,28.3147l1.8328,1.0578l-1.5872,2.7481l-1.8328,-1.0578z"/> <path android:fillAlpha="0.2" android:fillColor="#000" android:pathData="m17.9896,33.8586c0.8904,-0.047 1.7767,-0.1841 2.6454,-0.3689l12.4654,-21.5417c-0.2742,-0.8446 -0.4508,-1.5088 -1.0902,-2.38 0,0 -14.0206,24.3285 -14.0206,24.2905z" android:strokeWidth="0.05289798"/> <path android:fillColor="#fff" android:pathData="M23.424,3.5814l1.8328,1.0578l-2.6454,4.5802l-1.8328,-1.0578z"/> <path android:fillColor="#fff" android:pathData="M31.6018,8.4621 L16.9421,33.844c0.8583,-0.0009 1.7129,-0.0661 2.5567,-0.1955L32.7107,10.7732c-0.3097,-0.7952 -0.6805,-1.5676 -1.1089,-2.3111z" android:strokeWidth="0.05289798"/> <path android:fillColor="#fff" android:pathData="m16.9396,0c-0.8583,0.0009 -1.7129,0.0661 -2.5567,0.1955L1.1709,23.0708c0.3097,0.7952 0.6805,1.5676 1.1089,2.3111z" android:strokeWidth="0.05289798"/> <path android:fillColor="#495aad" android:pathData="M9.6499,5.2917L24.2168,5.2917A2.2415,2.2415 0,0 1,26.4583 7.5332L26.4583,24.2168A2.2415,2.2415 0,0 1,24.2168 26.4583L9.6499,26.4583A2.2415,2.2415 0,0 1,7.4083 24.2168L7.4083,7.5332A2.2415,2.2415 0,0 1,9.6499 5.2917z" android:strokeAlpha="0.98994976" android:strokeColor="#fff" android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="2.11666656"/> <path android:pathData="m14.1952,21.1667 l0,-10.5833h3.175c0,0 3.175,0 3.175,3.175 -0,3.175 -3.175,3.175 -3.175,3.175h-3.175" android:strokeColor="#fff" android:strokeLineCap="square" android:strokeLineJoin="miter" android:strokeWidth="2.11666656"/> </vector> ```
/content/code_sandbox/app/src/main/res/drawable/ic_quest_parking_lane.xml
xml
2016-07-02T10:44:04
2024-08-16T18:55:54
StreetComplete
streetcomplete/StreetComplete
3,781
1,429
```xml export interface ArgumentOutOfRangeError extends Error { } export interface ArgumentOutOfRangeErrorCtor { new (): ArgumentOutOfRangeError; } /** * An error thrown when an element was queried at a certain index of an * Observable, but no such index or position exists in that sequence. * * @see {@link elementAt} * @see {@link take} * @see {@link takeLast} * * @class ArgumentOutOfRangeError */ export declare const ArgumentOutOfRangeError: ArgumentOutOfRangeErrorCtor; ```
/content/code_sandbox/deps/node-10.15.3/tools/node_modules/eslint/node_modules/rxjs/internal/util/ArgumentOutOfRangeError.d.ts
xml
2016-09-05T10:18:44
2024-08-11T13:21:40
LiquidCore
LiquidPlayer/LiquidCore
1,010
103
```xml /// /// /// /// path_to_url /// /// Unless required by applicable law or agreed to in writing, software /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { PageComponent } from '@shared/components/page.component'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { CustomActionDescriptor } from '@shared/models/widget.models'; import { Ace } from 'ace-builds'; import { CancelAnimationFrame, RafService } from '@core/services/raf.service'; import { ResizeObserver } from '@juggle/resize-observer'; import { CustomPrettyActionEditorCompleter } from '@home/components/widget/lib/settings/common/action/custom-action.models'; import { Observable } from 'rxjs/internal/Observable'; import { forkJoin, from } from 'rxjs'; import { map, tap } from 'rxjs/operators'; import { getAce } from '@shared/models/ace/ace.models'; import { beautifyCss, beautifyHtml } from '@shared/models/beautify.models'; @Component({ selector: 'tb-custom-action-pretty-resources-tabs', templateUrl: './custom-action-pretty-resources-tabs.component.html', styleUrls: ['./custom-action-pretty-resources-tabs.component.scss'], encapsulation: ViewEncapsulation.None }) export class CustomActionPrettyResourcesTabsComponent extends PageComponent implements OnInit, OnChanges, OnDestroy { @Input() action: CustomActionDescriptor; @Input() hasCustomFunction: boolean; @Output() actionUpdated: EventEmitter<CustomActionDescriptor> = new EventEmitter<CustomActionDescriptor>(); @ViewChild('htmlInput', {static: true}) htmlInputElmRef: ElementRef; @ViewChild('cssInput', {static: true}) cssInputElmRef: ElementRef; htmlFullscreen = false; cssFullscreen = false; aceEditors: Ace.Editor[] = []; editorsResizeCafs: {[editorId: string]: CancelAnimationFrame} = {}; aceResize$: ResizeObserver; htmlEditor: Ace.Editor; cssEditor: Ace.Editor; setValuesPending = false; customPrettyActionEditorCompleter = CustomPrettyActionEditorCompleter; constructor(protected store: Store<AppState>, private translate: TranslateService, private raf: RafService) { super(store); } ngOnInit(): void { this.initAceEditors().subscribe(() => { if (this.setValuesPending) { this.setAceEditorValues(); this.setValuesPending = false; } }); } ngOnDestroy(): void { this.aceEditors.forEach(editor => editor.destroy()); this.aceResize$.disconnect(); } ngOnChanges(changes: SimpleChanges): void { for (const propName of Object.keys(changes)) { if (propName === 'action') { if (this.aceEditors.length === 2) { this.setAceEditorValues(); } else { this.setValuesPending = true; } } } } public notifyActionUpdated() { this.actionUpdated.emit(this.validate() ? this.action : null); } private validate(): boolean { if (this.action.customResources) { for (const resource of this.action.customResources) { if (!resource.url) { return false; } } } return true; } public addResource() { if (!this.action.customResources) { this.action.customResources = []; } this.action.customResources.push({url: ''}); this.notifyActionUpdated(); } public removeResource(index: number) { if (index > -1) { if (this.action.customResources.splice(index, 1).length > 0) { this.notifyActionUpdated(); } } } public beautifyCss(): void { beautifyCss(this.action.customCss, {indent_size: 4}).subscribe( (res) => { if (this.action.customCss !== res) { this.action.customCss = res; this.cssEditor.setValue(this.action.customCss ? this.action.customCss : '', -1); this.notifyActionUpdated(); } } ); } public beautifyHtml(): void { beautifyHtml(this.action.customHtml, {indent_size: 4, wrap_line_length: 60}).subscribe( (res) => { if (this.action.customHtml !== res) { this.action.customHtml = res; this.htmlEditor.setValue(this.action.customHtml ? this.action.customHtml : '', -1); this.notifyActionUpdated(); } } ); } private initAceEditors(): Observable<any> { this.aceResize$ = new ResizeObserver((entries) => { entries.forEach((entry) => { const editor = this.aceEditors.find(aceEditor => aceEditor.container === entry.target); this.onAceEditorResize(editor); }); }); const editorsObservables: Observable<any>[] = []; editorsObservables.push(this.createAceEditor(this.htmlInputElmRef, 'html').pipe( tap((editor) => { this.htmlEditor = editor; this.htmlEditor.on('input', () => { const editorValue = this.htmlEditor.getValue(); if (this.action.customHtml !== editorValue) { this.action.customHtml = editorValue; this.notifyActionUpdated(); } }); }) )); editorsObservables.push(this.createAceEditor(this.cssInputElmRef, 'css').pipe( tap((editor) => { this.cssEditor = editor; this.cssEditor.on('input', () => { const editorValue = this.cssEditor.getValue(); if (this.action.customCss !== editorValue) { this.action.customCss = editorValue; this.notifyActionUpdated(); } }); }) )); return forkJoin(editorsObservables); } private createAceEditor(editorElementRef: ElementRef, mode: string): Observable<Ace.Editor> { const editorElement = editorElementRef.nativeElement; let editorOptions: Partial<Ace.EditorOptions> = { mode: `ace/mode/${mode}`, showGutter: true, showPrintMargin: true }; const advancedOptions = { enableSnippets: true, enableBasicAutocompletion: true, enableLiveAutocompletion: true }; editorOptions = {...editorOptions, ...advancedOptions}; return getAce().pipe( map((ace) => { const aceEditor = ace.edit(editorElement, editorOptions); aceEditor.session.setUseWrapMode(true); this.aceEditors.push(aceEditor); this.aceResize$.observe(editorElement); return aceEditor; }) ); } private setAceEditorValues() { this.htmlEditor.setValue(this.action.customHtml ? this.action.customHtml : '', -1); this.cssEditor.setValue(this.action.customCss ? this.action.customCss : '', -1); } private onAceEditorResize(aceEditor: Ace.Editor) { if (this.editorsResizeCafs[aceEditor.id]) { this.editorsResizeCafs[aceEditor.id](); delete this.editorsResizeCafs[aceEditor.id]; } this.editorsResizeCafs[aceEditor.id] = this.raf.raf(() => { aceEditor.resize(); aceEditor.renderer.updateFull(); }); } } ```
/content/code_sandbox/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/custom-action-pretty-resources-tabs.component.ts
xml
2016-12-01T09:33:30
2024-08-16T19:58:25
thingsboard
thingsboard/thingsboard
16,820
1,613
```xml export * from './inputotp'; export * from './inputotp.interface'; ```
/content/code_sandbox/src/app/components/inputotp/public_api.ts
xml
2016-01-16T09:23:28
2024-08-16T19:58:20
primeng
primefaces/primeng
9,969
16
```xml import { G2Spec } from '../../../src'; export function alphabetIntervalAxis(): G2Spec { return { type: 'view', children: [ { type: 'interval', transform: [{ type: 'sortX', by: 'y', reverse: true }], data: { type: 'fetch', value: 'data/alphabet.csv', }, encode: { x: 'letter', y: 'frequency', color: 'steelblue', }, axis: { y: { tickCount: 10 }, x: false }, }, { type: 'axisX', title: 'Letter', labelFontSize: 20 }, { type: 'axisY', labelFormatter: '.0%', title: 'Frequency', scale: { y: { nice: true } }, }, { type: 'axisY', position: 'right', scale: { y: { type: 'linear', independent: true, domain: [0, 10], range: [1, 0], }, }, grid: false, }, ], }; } ```
/content/code_sandbox/__tests__/plots/static/alphabet-interval-axis.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
249
```xml import { ActivityMiddleware } from 'botframework-webchat-api'; import React from 'react'; import CarouselLayout from '../../Activity/CarouselLayout'; import StackedLayout from '../../Activity/StackedLayout'; export default function createCoreMiddleware(): ActivityMiddleware[] { return [ () => next => (...args) => { const [{ activity }] = args; // TODO: [P4] Can we simplify these if-statement to something more readable? const { type } = activity; if (type === 'typing') { if ( !( 'text' in activity && typeof activity.text === 'string' && activity.channelData.streamType !== 'informative' ) ) { // If it is an informative message, hide it until we have a design for informative message. return false; } // Should show if this is useActiveTyping()[0][*].firstActivity, and render it with the content of lastActivity. return function renderStackedLayout(renderAttachment, props) { typeof props === 'undefined' && console.warn( 'botframework-webchat: One or more arguments were missing after passing through the activity middleware. Please check your custom activity middleware to make sure it passes all arguments.' ); return ( <StackedLayout activity={{ ...activity, type: 'message' } as any} renderAttachment={renderAttachment} {...props} /> ); }; } // Filter out activities that should not be visible if (type === 'conversationUpdate' || type === 'event' || type === 'invoke') { return false; } else if (type === 'message') { const { attachments, channelData, text } = activity; if ( // Do not show postback channelData?.postBack || // Do not show messageBack if displayText is undefined (channelData?.messageBack && !channelData.messageBack.displayText) || // Do not show empty bubbles (no text and attachments, and not "typing") !(text || attachments?.length) ) { return false; } } if (type === 'message' || type === 'typing') { if ( type === 'message' && (activity.attachments?.length || 0) > 1 && activity.attachmentLayout === 'carousel' ) { // The following line is not a React functional component, it's a render function called by useCreateActivityRenderer() hook. // The function signature need to be compatible with older version of activity middleware, which was: // // renderActivity( // renderAttachment: ({ activity, attachment }) => React.Element // ) => React.Element return function renderCarouselLayout(renderAttachment, props) { typeof props === 'undefined' && console.warn( 'botframework-webchat: One or more arguments were missing after passing through the activity middleware. Please check your custom activity middleware to make sure it passes all arguments.' ); return <CarouselLayout activity={activity} renderAttachment={renderAttachment} {...props} />; }; } // The following line is not a React functional component, it's a render function called by useCreateActivityRenderer() hook. return function renderStackedLayout(renderAttachment, props) { typeof props === 'undefined' && console.warn( 'botframework-webchat: One or more arguments were missing after passing through the activity middleware. Please check your custom activity middleware to make sure it passes all arguments.' ); return <StackedLayout activity={activity} renderAttachment={renderAttachment} {...props} />; }; } return next(...args); } ]; } ```
/content/code_sandbox/packages/component/src/Middleware/Activity/createCoreMiddleware.tsx
xml
2016-07-07T23:16:57
2024-08-16T00:12:37
BotFramework-WebChat
microsoft/BotFramework-WebChat
1,567
786
```xml import React, { PureComponent } from "react"; type Props = {}; export class Home extends PureComponent<Props> { render() { return "Home"; } } ```
/content/code_sandbox/test/cli/__fixtures__/babel/ts/src/something/home.ts
xml
2016-11-20T20:05:37
2024-08-16T08:58:52
dependency-cruiser
sverweij/dependency-cruiser
5,116
35
```xml import { assert } from 'chai'; import { NO_ADDITIONAL_NODES_PRESET } from '../../../../../src/options/presets/NoCustomNodes'; import { getStringArrayRegExp } from '../../../../helpers/get-string-array-regexp'; import { readFileAsString } from '../../../../helpers/readFileAsString'; import { stubNodeTransformers } from '../../../../helpers/stubNodeTransformers'; import { JavaScriptObfuscator } from '../../../../../src/JavaScriptObfuscatorFacade'; import { ObjectPatternPropertiesTransformer } from '../../../../../src/node-transformers/converting-transformers/ObjectPatternPropertiesTransformer'; describe('VariablePreserveTransformer', () => { describe('Variant #1: string array storage name conflicts with identifier name', () => { describe('Variant #1: `renameGlobals` option is disabled', () => { const stringArrayStorageNameRegExp: RegExp = getStringArrayRegExp(['abc'], { kind: 'const', name: 'b' }); const identifierNameRegExp: RegExp = /const a *= *c\(0x0\);/; let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/string-array-storage-identifier-name-1.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: 'mangled', stringArray: true, stringArrayThreshold: 1 } ).getObfuscatedCode(); }); it('should generate non-preserved name for string array storage', () => { assert.match(obfuscatedCode, stringArrayStorageNameRegExp); }); it('should keep the original name for global identifier', () => { assert.match(obfuscatedCode, identifierNameRegExp); }); }); describe('Variant #2: `renameGlobals` option is enabled', () => { const stringArrayStorageNameRegExp: RegExp = getStringArrayRegExp(['abc'], { kind: 'const', name: 'b' }); const identifierNameRegExp: RegExp = /const d *= *c\(0x0\);/; let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/string-array-storage-identifier-name-1.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: 'mangled', renameGlobals: true, stringArray: true, stringArrayThreshold: 1 } ).getObfuscatedCode(); }); it('should generate non-preserved name for string array storage', () => { assert.match(obfuscatedCode, stringArrayStorageNameRegExp); }); it('should rename global identifier', () => { assert.match(obfuscatedCode, identifierNameRegExp); }); }); }); describe('Variant #2: `transformObjectKeys` identifier name conflicts with identifier name', () => { describe('Variant #1: `renameGlobals` option is disabled', () => { const transformObjectKeysNameRegExp: RegExp = /const b *= *{};/; const identifierNameRegExp: RegExp = /const a *= *b;/; let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/transform-object-keys-identifier-name-1.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: 'mangled', transformObjectKeys: true } ).getObfuscatedCode(); }); it('should generate non-preserved name for `transformObjectKeys` identifier', () => { assert.match(obfuscatedCode, transformObjectKeysNameRegExp); }); it('should keep the original name for global identifier', () => { assert.match(obfuscatedCode, identifierNameRegExp); }); }); describe('Variant #2: `renameGlobals` option is enabled', () => { const transformObjectKeysNameRegExp: RegExp = /const c *= *{};/; const identifierNameRegExp: RegExp = /const d *= *c;/; let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/transform-object-keys-identifier-name-1.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: 'mangled', renameGlobals: true, transformObjectKeys: true } ).getObfuscatedCode(); }); it('should generate non-preserved name for `transformObjectKeys` identifier', () => { assert.match(obfuscatedCode, transformObjectKeysNameRegExp); }); it('should keep the original name for global identifier', () => { assert.match(obfuscatedCode, identifierNameRegExp); }); }); }); describe('Variant #3: ignored node identifier name conflict with identifier name', () => { describe('Variant #1: global scope', () => { const functionExpressionIdentifierName: RegExp = /const c *= *function *\(\) *{};/; const functionDeclarationIdentifierName: RegExp = /function a *\(\) *{}/; let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/ignored-node-identifier-name-1.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: 'mangled', renameGlobals: true } ).getObfuscatedCode(); }); it('should generate non-preserved name for global identifier', () => { assert.match(obfuscatedCode, functionExpressionIdentifierName); }); it('should keep the original name for ignored identifier', () => { assert.match(obfuscatedCode, functionDeclarationIdentifierName); }); }); }); describe('Variant #4: destructed object property identifier name conflict with identifier name', () => { stubNodeTransformers([ObjectPatternPropertiesTransformer]); describe('Variant #1: `renameGlobals` option is disabled', () => { const variableDeclarationIdentifierName: RegExp = /var b *= *0x1;/; const destructedObjectPropertyIdentifierName: RegExp = /const { *a *} *= *{ *'a' *: *0x2 *};/; let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/destructed-object-property-identifier-name-1.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: 'mangled', renameGlobals: false } ).getObfuscatedCode(); }); it('should generate non-preserved name for variable name', () => { assert.match(obfuscatedCode, variableDeclarationIdentifierName); }); it('should keep the original name for destructed object property identifier', () => { assert.match(obfuscatedCode, destructedObjectPropertyIdentifierName); }); }); describe('Variant #2: `renameGlobals` option is enabled', () => { const variableDeclarationIdentifierName: RegExp = /var b *= *0x1;/; const functionDeclarationIdentifierName: RegExp = /function c *\(\) *{/; const destructedObjectPropertyIdentifierName: RegExp = /const { *a *} *= *{ *'a' *: *0x2 *};/; let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/destructed-object-property-identifier-name-2.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: 'mangled', renameGlobals: true } ).getObfuscatedCode(); }); it('should generate non-preserved name for variable declaration', () => { assert.match(obfuscatedCode, variableDeclarationIdentifierName); }); it('should generate non-preserved name for function declaration', () => { assert.match(obfuscatedCode, functionDeclarationIdentifierName); }); it('should keep the original name for destructed object property identifier', () => { assert.match(obfuscatedCode, destructedObjectPropertyIdentifierName); }); }); describe('Variant #3: function destructed object property', () => { const variableDeclarationIdentifierName: RegExp = /var b *= *0x1;/; const destructedObjectPropertyIdentifierName: RegExp = /return *\({ *a *}\) *=> *{/; const consoleLogIdentifierNames: RegExp = /console\['log']\(b, *a\);/; let obfuscatedCode: string; before(() => { const code: string = readFileAsString(__dirname + '/fixtures/destructed-object-property-identifier-name-3.js'); obfuscatedCode = JavaScriptObfuscator.obfuscate( code, { ...NO_ADDITIONAL_NODES_PRESET, identifierNamesGenerator: 'mangled', renameGlobals: false } ).getObfuscatedCode(); }); it('should generate non-preserved name for variable declaration', () => { assert.match(obfuscatedCode, variableDeclarationIdentifierName); }); it('should keep the original name for destructed object property identifier', () => { assert.match(obfuscatedCode, destructedObjectPropertyIdentifierName); }); it('should generate valid identifier names for console.log call', () => { assert.match(obfuscatedCode, consoleLogIdentifierNames); }); }); }); }); ```
/content/code_sandbox/test/functional-tests/node-transformers/preparing-transformers/variable-preserve-transformer/VariablePreserveTransformer.spec.ts
xml
2016-05-09T08:16:53
2024-08-16T19:43:07
javascript-obfuscator
javascript-obfuscator/javascript-obfuscator
13,358
2,085
```xml import {createApp} from 'vue'; export async function initRepoContributors() { const el = document.querySelector('#repo-contributors-chart'); if (!el) return; const {default: RepoContributors} = await import(/* webpackChunkName: "contributors-graph" */'../components/RepoContributors.vue'); try { const View = createApp(RepoContributors, { repoLink: el.getAttribute('data-repo-link'), locale: { filterLabel: el.getAttribute('data-locale-filter-label'), contributionType: { commits: el.getAttribute('data-locale-contribution-type-commits'), additions: el.getAttribute('data-locale-contribution-type-additions'), deletions: el.getAttribute('data-locale-contribution-type-deletions'), }, loadingTitle: el.getAttribute('data-locale-loading-title'), loadingTitleFailed: el.getAttribute('data-locale-loading-title-failed'), loadingInfo: el.getAttribute('data-locale-loading-info'), }, }); View.mount(el); } catch (err) { console.error('RepoContributors failed to load', err); el.textContent = el.getAttribute('data-locale-component-failed-to-load'); } } ```
/content/code_sandbox/web_src/js/features/contributors.ts
xml
2016-11-01T02:13:26
2024-08-16T19:51:49
gitea
go-gitea/gitea
43,694
257
```xml import { toString as dateToString } from "./Date.js"; import { compare as numericCompare, isNumeric, multiply, Numeric, toExponential, toFixed, toHex, toPrecision } from "./Numeric.js"; import { escape } from "./RegExp.js"; import { toString } from "./Types.js"; const fsFormatRegExp = /(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g; const interpolateRegExp = /(?:(^|[^%])%([0+\- ]*)(\d+)?(?:\.(\d+))?(\w))?%P\(\)/g; const formatRegExp = /\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g; function isLessThan(x: Numeric, y: number) { return numericCompare(x, y) < 0; } const enum StringComparison { CurrentCulture = 0, CurrentCultureIgnoreCase = 1, InvariantCulture = 2, InvariantCultureIgnoreCase = 3, Ordinal = 4, OrdinalIgnoreCase = 5, } function cmp(x: string, y: string, ic: boolean | StringComparison) { function isIgnoreCase(i: boolean | StringComparison) { return i === true || i === StringComparison.CurrentCultureIgnoreCase || i === StringComparison.InvariantCultureIgnoreCase || i === StringComparison.OrdinalIgnoreCase; } function isOrdinal(i: boolean | StringComparison) { return i === StringComparison.Ordinal || i === StringComparison.OrdinalIgnoreCase; } if (x == null) { return y == null ? 0 : -1; } if (y == null) { return 1; } // everything is bigger than null if (isOrdinal(ic)) { if (isIgnoreCase(ic)) { x = x.toLowerCase(); y = y.toLowerCase(); } return (x === y) ? 0 : (x < y ? -1 : 1); } else { if (isIgnoreCase(ic)) { x = x.toLocaleLowerCase(); y = y.toLocaleLowerCase(); } return x.localeCompare(y); } } export function compare(...args: any[]): number { switch (args.length) { case 2: return cmp(args[0], args[1], false); case 3: return cmp(args[0], args[1], args[2]); case 4: return cmp(args[0], args[1], args[2] === true); case 5: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), false); case 6: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5]); case 7: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5] === true); default: throw new Error("String.compare: Unsupported number of parameters"); } } export function compareOrdinal(x: string, y: string) { return cmp(x, y, StringComparison.Ordinal); } export function compareTo(x: string, y: string) { return cmp(x, y, StringComparison.CurrentCulture); } export function startsWith(str: string, pattern: string, ic: number) { if (str.length >= pattern.length) { return cmp(str.substr(0, pattern.length), pattern, ic) === 0; } return false; } export function indexOfAny(str: string, anyOf: string[], ...args: number[]) { if (str == null || str === "") { return -1; } const startIndex = (args.length > 0) ? args[0] : 0; if (startIndex < 0) { throw new Error("Start index cannot be negative"); } const length = (args.length > 1) ? args[1] : str.length - startIndex; if (length < 0) { throw new Error("Length cannot be negative"); } if (startIndex + length > str.length) { throw new Error("Invalid startIndex and length"); } const endIndex = startIndex + length const anyOfAsStr = "".concat.apply("", anyOf); for (let i=startIndex; i<endIndex; i++) { if (anyOfAsStr.indexOf(str[i]) > -1) { return i; } } return -1; } export type IPrintfFormatContinuation = (f: (x: string) => any) => any; export interface IPrintfFormat { input: string; cont: IPrintfFormatContinuation; } export function printf(input: string): IPrintfFormat { return { input, cont: fsFormat(input) as IPrintfFormatContinuation, }; } export function interpolate(str: string, values: any[]): string { let valIdx = 0; let strIdx = 0; let result = ""; interpolateRegExp.lastIndex = 0; let match = interpolateRegExp.exec(str); while (match) { // The first group corresponds to the no-escape char (^|[^%]), the actual pattern starts in the next char // Note: we don't use negative lookbehind because some browsers don't support it yet const matchIndex = match.index + (match[1] || "").length; result += str.substring(strIdx, matchIndex).replace(/%%/g, "%"); const [, , flags, padLength, precision, format] = match; // Save interpolateRegExp.lastIndex before running formatReplacement because the values // may also involve interpolation and make use of interpolateRegExp (see #3078) strIdx = interpolateRegExp.lastIndex; result += formatReplacement(values[valIdx++], flags, padLength, precision, format); // Move interpolateRegExp.lastIndex one char behind to make sure we match the no-escape char next time interpolateRegExp.lastIndex = strIdx - 1; match = interpolateRegExp.exec(str); } result += str.substring(strIdx).replace(/%%/g, "%"); return result; } function continuePrint(cont: (x: string) => any, arg: IPrintfFormat | string) { return typeof arg === "string" ? cont(arg) : arg.cont(cont); } export function toConsole(arg: IPrintfFormat | string) { // Don't remove the lambda here, see #1357 return continuePrint((x: string) => console.log(x), arg); } export function toConsoleError(arg: IPrintfFormat | string) { return continuePrint((x: string) => console.error(x), arg); } export function toText(arg: IPrintfFormat | string) { return continuePrint((x: string) => x, arg); } export function toFail(arg: IPrintfFormat | string) { return continuePrint((x: string) => { throw new Error(x); }, arg); } function formatReplacement(rep: any, flags: any, padLength: any, precision: any, format: any) { let sign = ""; flags = flags || ""; format = format || ""; if (isNumeric(rep)) { if (format.toLowerCase() !== "x") { if (isLessThan(rep, 0)) { rep = multiply(rep, -1); sign = "-"; } else { if (flags.indexOf(" ") >= 0) { sign = " "; } else if (flags.indexOf("+") >= 0) { sign = "+"; } } } precision = precision == null ? null : parseInt(precision, 10); switch (format) { case "f": case "F": precision = precision != null ? precision : 6; rep = toFixed(rep, precision); break; case "g": case "G": rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep); break; case "e": case "E": rep = precision != null ? toExponential(rep, precision) : toExponential(rep); break; case "x": rep = toHex(rep); break; case "X": rep = toHex(rep).toUpperCase(); break; default: // AOid rep = String(rep); break; } } else if (rep instanceof Date) { rep = dateToString(rep); } else { rep = toString(rep); } padLength = typeof padLength === "number" ? padLength : parseInt(padLength, 10); if (!isNaN(padLength)) { const zeroFlag = flags.indexOf("0") >= 0; // Use '0' for left padding const minusFlag = flags.indexOf("-") >= 0; // Right padding const ch = minusFlag || !zeroFlag ? " " : "0"; if (ch === "0") { rep = pad(rep, padLength - sign.length, ch, minusFlag); rep = sign + rep; } else { rep = pad(sign + rep, padLength, ch, minusFlag); } } else { rep = sign + rep; } return rep; } function createPrinter(cont: (...args: any[]) => any, _strParts: string[], _matches: RegExpExecArray[], _result = "", padArg = -1) { return (...args: any[]) => { // Make copies of the values passed by reference because the function can be used multiple times let result = _result; const strParts = _strParts.slice(); const matches = _matches.slice(); for (const arg of args) { const [, , flags, _padLength, precision, format] = matches[0]; let padLength: any = _padLength; if (padArg >= 0) { padLength = padArg; padArg = -1; } else if (padLength === "*") { if (arg < 0) { throw new Error("Non-negative number required"); } padArg = arg; continue; } result += strParts[0]; result += formatReplacement(arg, flags, padLength, precision, format); strParts.splice(0, 1); matches.splice(0, 1); } if (matches.length === 0) { result += strParts[0]; return cont(result); } else { return createPrinter(cont, strParts, matches, result, padArg); } }; } export function fsFormat(str: string) { return (cont: (...args: any[]) => any) => { fsFormatRegExp.lastIndex = 0; const strParts: string[] = []; const matches: RegExpExecArray[] = []; let strIdx = 0; let match = fsFormatRegExp.exec(str); while (match) { // The first group corresponds to the no-escape char (^|[^%]), the actual pattern starts in the next char // Note: we don't use negative lookbehind because some browsers don't support it yet const matchIndex = match.index + (match[1] || "").length; strParts.push(str.substring(strIdx, matchIndex).replace(/%%/g, "%")); matches.push(match) strIdx = fsFormatRegExp.lastIndex; // Likewise we need to move fsFormatRegExp.lastIndex one char behind to make sure we match the no-escape char next time fsFormatRegExp.lastIndex -= 1; match = fsFormatRegExp.exec(str); } if (strParts.length === 0) { return cont(str.replace(/%%/g, "%")); } else { strParts.push(str.substring(strIdx).replace(/%%/g, "%")) return createPrinter(cont, strParts, matches); } }; } export function format(str: string | object, ...args: any[]) { let str2: string; if (typeof str === "object") { // Called with culture info str2 = String(args[0]); args.shift(); } else { str2 = str; } return str2.replace(formatRegExp, (_, idx: number, padLength, format, precision, pattern) => { if (idx < 0 || idx >= args.length) { throw new Error("Index must be greater or equal to zero and less than the arguments' length.") } let rep = args[idx]; if (isNumeric(rep)) { precision = precision == null ? null : parseInt(precision, 10); switch (format) { case "f": case "F": precision = precision != null ? precision : 2; rep = toFixed(rep, precision); break; case "g": case "G": rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep); break; case "e": case "E": rep = precision != null ? toExponential(rep, precision) : toExponential(rep); break; case "p": case "P": precision = precision != null ? precision : 2; rep = toFixed(multiply(rep, 100), precision) + " %"; break; case "d": case "D": rep = precision != null ? padLeft(String(rep), precision, "0") : String(rep); break; case "x": case "X": rep = precision != null ? padLeft(toHex(rep), precision, "0") : toHex(rep); if (format === "X") { rep = rep.toUpperCase(); } break; default: if (pattern) { let sign = ""; rep = (pattern as string).replace(/([0#,]+)(\.[0#]+)?/, (_, intPart: string, decimalPart: string) => { if (isLessThan(rep, 0)) { rep = multiply(rep, -1); sign = "-"; } decimalPart = decimalPart == null ? "" : decimalPart.substring(1); rep = toFixed(rep, Math.max(decimalPart.length, 0)); let [repInt, repDecimal] = (rep as string).split("."); repDecimal ||= ""; const leftZeroes = intPart.replace(/,/g, "").replace(/^#+/, "").length; repInt = padLeft(repInt, leftZeroes, "0"); const rightZeros = decimalPart.replace(/#+$/, "").length; if (rightZeros > repDecimal.length) { repDecimal = padRight(repDecimal, rightZeros, "0"); } else if (rightZeros < repDecimal.length) { repDecimal = repDecimal.substring(0, rightZeros) + repDecimal.substring(rightZeros).replace(/0+$/, ""); } // Thousands separator if (intPart.indexOf(",") > 0) { const i = repInt.length % 3; const thousandGroups = Math.floor(repInt.length / 3); let thousands = i > 0 ? repInt.substr(0, i) + (thousandGroups > 0 ? "," : "") : ""; for (let j = 0; j < thousandGroups; j++) { thousands += repInt.substr(i + j * 3, 3) + (j < thousandGroups - 1 ? "," : ""); } repInt = thousands; } return repDecimal.length > 0 ? repInt + "." + repDecimal : repInt; }); rep = sign + rep; } } } else if (rep instanceof Date) { rep = dateToString(rep, pattern || format); } else { rep = toString(rep) } padLength = parseInt((padLength || " ").substring(1), 10); if (!isNaN(padLength)) { rep = pad(String(rep), Math.abs(padLength), " ", padLength < 0); } return rep; }); } export function endsWith(str: string, search: string) { const idx = str.lastIndexOf(search); return idx >= 0 && idx === str.length - search.length; } export function initialize(n: number, f: (i: number) => string) { if (n < 0) { throw new Error("String length must be non-negative"); } const xs = new Array(n); for (let i = 0; i < n; i++) { xs[i] = f(i); } return xs.join(""); } export function insert(str: string, startIndex: number, value: string) { if (startIndex < 0 || startIndex > str.length) { throw new Error("startIndex is negative or greater than the length of this instance."); } return str.substring(0, startIndex) + value + str.substring(startIndex); } export function isNullOrEmpty(str: string | any) { return typeof str !== "string" || str.length === 0; } export function isNullOrWhiteSpace(str: string | any) { return typeof str !== "string" || /^\s*$/.test(str); } export function concat(...xs: any[]): string { return xs.map((x) => String(x)).join(""); } export function join<T>(delimiter: string, xs: Iterable<T>): string { if (Array.isArray(xs)) { return xs.join(delimiter); } else { return Array.from(xs).join(delimiter); } } export function joinWithIndices(delimiter: string, xs: string[], startIndex: number, count: number) { const endIndexPlusOne = startIndex + count; if (endIndexPlusOne > xs.length) { throw new Error("Index and count must refer to a location within the buffer."); } return xs.slice(startIndex, endIndexPlusOne).join(delimiter); } function notSupported(name: string): never { throw new Error("The environment doesn't support '" + name + "', please use a polyfill."); } export function toBase64String(inArray: ArrayLike<number>) { let str = ""; for (let i = 0; i < inArray.length; i++) { str += String.fromCharCode(inArray[i]); } return typeof btoa === "function" ? btoa(str) : notSupported("btoa"); } export function fromBase64String(b64Encoded: string): number[] { const binary = typeof atob === "function" ? atob(b64Encoded) : notSupported("atob"); const bytes = new Uint8Array(binary.length); for (let i = 0; i < binary.length; i++) { bytes[i] = binary.charCodeAt(i); } return bytes as any as number[]; } function pad(str: string, len: number, ch?: string, isRight?: boolean) { ch = ch || " "; len = len - str.length; for (let i = 0; i < len; i++) { str = isRight ? str + ch : ch + str; } return str; } export function padLeft(str: string, len: number, ch?: string) { return pad(str, len, ch); } export function padRight(str: string, len: number, ch?: string) { return pad(str, len, ch, true); } export function remove(str: string, startIndex: number, count?: number) { if (startIndex >= str.length) { throw new Error("startIndex must be less than length of string"); } if (typeof count === "number" && (startIndex + count) > str.length) { throw new Error("Index and count must refer to a location within the string."); } return str.slice(0, startIndex) + (typeof count === "number" ? str.substr(startIndex + count) : ""); } export function replace(str: string, search: string, replace: string) { return str.replace(new RegExp(escape(search), "g"), replace); } export function replicate(n: number, x: string) { return initialize(n, () => x); } export function getCharAtIndex(input: string, index: number) { if (index < 0 || index >= input.length) { throw new Error("Index was outside the bounds of the array."); } return input[index]; } export function split(str: string, splitters: string[], count?: number, options?: number) { count = typeof count === "number" ? count : undefined; options = typeof options === "number" ? options : 0; if (count && count < 0) { throw new Error("Count cannot be less than zero"); } if (count === 0) { return []; } const removeEmpty = (options & 1) === 1; const trim = (options & 2) === 2; splitters = splitters || []; splitters = splitters.filter(x => x).map(escape); splitters = splitters.length > 0 ? splitters : ["\\s"]; const splits: string[] = []; const reg = new RegExp(splitters.join("|"), "g"); let findSplits = true; let i = 0; do { const match = reg.exec(str); if (match === null) { const candidate = trim ? str.substring(i).trim() : str.substring(i); if (!removeEmpty || candidate.length > 0) { splits.push(candidate); } findSplits = false; } else { const candidate = trim ? str.substring(i, match.index).trim() : str.substring(i, match.index); if (!removeEmpty || candidate.length > 0) { if (count != null && splits.length + 1 === count) { splits.push(trim ? str.substring(i).trim() : str.substring(i)); findSplits = false; } else { splits.push(candidate); } } i = reg.lastIndex; } } while (findSplits) return splits; } export function trim(str: string, ...chars: string[]) { if (chars.length === 0) { return str.trim(); } const pattern = "[" + escape(chars.join("")) + "]+"; return str.replace(new RegExp("^" + pattern), "").replace(new RegExp(pattern + "$"), ""); } export function trimStart(str: string, ...chars: string[]) { return chars.length === 0 ? (str as any).trimStart() : str.replace(new RegExp("^[" + escape(chars.join("")) + "]+"), ""); } export function trimEnd(str: string, ...chars: string[]) { return chars.length === 0 ? (str as any).trimEnd() : str.replace(new RegExp("[" + escape(chars.join("")) + "]+$"), ""); } export function filter(pred: (char: string) => boolean, x: string) { return x.split("").filter((c) => pred(c)).join(""); } export function substring(str: string, startIndex: number, length?: number) { if ((startIndex + (length || 0) > str.length)) { throw new Error("Invalid startIndex and/or length"); } return length != null ? str.substr(startIndex, length) : str.substr(startIndex); } export function toCharArray2(str: string, startIndex: number, length: number) { return substring(str, startIndex, length).split("") } interface FormattableString { strs: TemplateStringsArray, args: any[], fmts?: string[] } export function fmt(strs: TemplateStringsArray, ...args: any[]): FormattableString { return ({ strs, args }); } export function fmtWith(fmts: string[]) { return (strs: TemplateStringsArray, ...args: any[]) => ({ strs, args, fmts } as FormattableString); } export function getFormat(s: FormattableString) { return s.fmts ? s.strs.reduce((acc, newPart, index) => acc + `{${String(index - 1) + s.fmts![index - 1]}}` + newPart) : s.strs.reduce((acc, newPart, index) => acc + `{${index - 1}}` + newPart); } ```
/content/code_sandbox/src/fable-library-ts/String.ts
xml
2016-01-11T10:10:13
2024-08-15T11:42:55
Fable
fable-compiler/Fable
2,874
5,253
```xml import { c } from 'ttag'; import type { ModalOwnProps } from '@proton/components/components'; import { Prompt, Tooltip } from '@proton/components/components'; import { SUBSCRIPTION_STEPS, useSubscriptionModal } from '@proton/components/containers'; import { useUser } from '@proton/components/hooks'; import { PLANS } from '@proton/shared/lib/constants'; import upgradeWalletSrc from '@proton/styles/assets/img/wallet/wallet-bitcoin.jpg'; import { Button } from '../../atoms'; import type { SubTheme } from '../../utils'; export interface WalletUpgradeModalOwnProps { title?: string; theme?: SubTheme; content: string; } type Props = WalletUpgradeModalOwnProps & ModalOwnProps; export const WalletUpgradeModal = ({ title, content, theme, ...modalProps }: Props) => { const [openSubscriptionModal] = useSubscriptionModal(); const [user] = useUser(); return ( <Prompt {...modalProps} className={theme} buttons={[ <Tooltip title={!user.canPay && c('Wallet upgrade').t`Contact your administrator to upgrade`}> <Button fullWidth size="large" shape="solid" color="norm" disabled={!user.canPay} onClick={() => { openSubscriptionModal({ step: SUBSCRIPTION_STEPS.CHECKOUT, disablePlanSelection: true, plan: PLANS.VISIONARY, onSubscribed: () => { modalProps.onClose?.(); }, metrics: { source: 'upsells', }, }); }} > {c('Action').t`Upgrade now`} </Button> </Tooltip>, <Button fullWidth size="large" shape="solid" color="weak" onClick={modalProps.onClose}>{c('Action') .t`Close`}</Button>, ]} > <div className="flex flex-column items-center text-center"> <img src={upgradeWalletSrc} alt="" className="w-custom h-custom" style={{ '--w-custom': '15rem', '--h-custom': '10.438rem' }} /> <h1 className="my-4 text-semibold text-3xl"> {title ?? c('Wallet Upgrade').t`Upgrade to support financial freedom`} </h1> <p className="mt-0 text-center">{content}</p> </div> </Prompt> ); }; ```
/content/code_sandbox/applications/wallet/src/app/components/WalletUpgradeModal/index.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
525
```xml import { array, object, SchemaOf, string, number } from 'yup'; import { parseIsoDate } from '@/portainer/filters/filters'; import { EdgeGroup } from '@/react/edge/edge-groups/types'; import { EdgeUpdateSchedule, ScheduleType } from '../types'; import { nameValidation } from './NameField'; import { typeValidation } from './ScheduleTypeSelector'; import { FormValues } from './types'; export function validation( schedules: EdgeUpdateSchedule[], edgeGroups: Array<EdgeGroup> | undefined, currentId?: EdgeUpdateSchedule['id'] ): SchemaOf<FormValues> { return object({ groupIds: array() .of(number().default(0)) .min(1, 'At least one group is required') .test( 'At least one group must have endpoints', (groupIds) => !!( groupIds && edgeGroups && groupIds?.flatMap( (id) => edgeGroups?.find((group) => group.Id === id)?.Endpoints ).length > 0 ) ), name: nameValidation(schedules, currentId), type: typeValidation(), scheduledTime: string() .default('') .test('valid', (value) => !value || parseIsoDate(value) !== null), version: string() .default('') .when('type', { is: ScheduleType.Update, // update type then: (schema) => schema.required('Version is required'), // rollback otherwise: (schema) => schema.required('No rollback options available'), }), registryId: number().default(0), }); } ```
/content/code_sandbox/app/react/portainer/environments/update-schedules/common/validation.ts
xml
2016-05-19T20:15:28
2024-08-16T19:15:14
portainer
portainer/portainer
30,083
356
```xml <dict> <key>LayoutID</key> <integer>1</integer> <key>PathMapRef</key> <array> <dict> <key>CodecID</key> <array> <integer>283906408</integer> </array> <key>Headphone</key> <dict/> <key>Inputs</key> <array> <string>Mic</string> <string>LineIn</string> </array> <key>IntSpeaker</key> <dict/> <key>LineIn</key> <dict> <key>MuteGPIO</key> <integer>1342242841</integer> </dict> <key>LineOut</key> <dict/> <key>Mic</key> <dict> <key>MuteGPIO</key> <integer>1342242840</integer> <key>SignalProcessing</key> <dict> <key>SoftwareDSP</key> <dict> <key>DspFunction0</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>0</integer> <key>DspFuncName</key> <string>DspNoiseReduction</string> <key>DspFuncProcessingIndex</key> <integer>0</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>0</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>-1111411312</integer> </dict> <key>PatchbayInfo</key> <dict/> </dict> <key>DspFunction1</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>1</integer> <key>DspFuncName</key> <string>DspEqualization32</string> <key>DspFuncProcessingIndex</key> <integer>1</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>Filter</key> <array> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1120723891</integer> <key>7</key> <integer>1060439283</integer> <key>8</key> <integer>0</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>1</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1133968303</integer> <key>7</key> <integer>1084477243</integer> <key>8</key> <integer>-1080988787</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>2</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1150664980</integer> <key>7</key> <integer>1098102506</integer> <key>8</key> <integer>-1073195820</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>3</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1148869092</integer> <key>7</key> <integer>1091475860</integer> <key>8</key> <integer>-1076223660</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>4</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1142287878</integer> <key>7</key> <integer>1085842969</integer> <key>8</key> <integer>-1079797505</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>5</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1171916736</integer> <key>7</key> <integer>1096762195</integer> <key>8</key> <integer>-1082229705</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>6</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>6</integer> <key>6</key> <integer>1184316119</integer> <key>7</key> <integer>1109056511</integer> <key>8</key> <integer>-1045200702</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>7</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1139168842</integer> <key>7</key> <integer>1089375144</integer> <key>8</key> <integer>-1082229705</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1169906445</integer> <key>7</key> <integer>1092320018</integer> <key>8</key> <integer>-1086994832</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>9</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1174300519</integer> <key>7</key> <integer>1100485297</integer> <key>8</key> <integer>-1084612268</integer> </dict> <dict> <key>2</key> <integer>0</integer> <key>3</key> <integer>10</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1153948405</integer> <key>7</key> <integer>1086231536</integer> <key>8</key> <integer>-1079797505</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>0</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>1</integer> <key>6</key> <integer>1120723891</integer> <key>7</key> <integer>1060439283</integer> <key>8</key> <integer>0</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>1</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1133968303</integer> <key>7</key> <integer>1084477243</integer> <key>8</key> <integer>-1080988787</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>2</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1150664980</integer> <key>7</key> <integer>1098102506</integer> <key>8</key> <integer>-1073195820</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>3</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1148869092</integer> <key>7</key> <integer>1091475860</integer> <key>8</key> <integer>-1076223660</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>4</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1142287878</integer> <key>7</key> <integer>1085842969</integer> <key>8</key> <integer>-1079797505</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>5</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1171916736</integer> <key>7</key> <integer>1096762195</integer> <key>8</key> <integer>-1082229705</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>6</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>6</integer> <key>6</key> <integer>1184316119</integer> <key>7</key> <integer>1109056511</integer> <key>8</key> <integer>-1045200702</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>7</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1139168842</integer> <key>7</key> <integer>1089375144</integer> <key>8</key> <integer>-1082229705</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>8</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1169906445</integer> <key>7</key> <integer>1092320018</integer> <key>8</key> <integer>-1086994832</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>9</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1174300519</integer> <key>7</key> <integer>1100485297</integer> <key>8</key> <integer>-1084612268</integer> </dict> <dict> <key>2</key> <integer>1</integer> <key>3</key> <integer>10</integer> <key>4</key> <integer>0</integer> <key>5</key> <integer>4</integer> <key>6</key> <integer>1153948405</integer> <key>7</key> <integer>1086231536</integer> <key>8</key> <integer>-1079797505</integer> </dict> </array> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>0</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> <key>DspFunction2</key> <dict> <key>FunctionInfo</key> <dict> <key>DspFuncInstance</key> <integer>2</integer> <key>DspFuncName</key> <string>DspGainStage</string> <key>DspFuncProcessingIndex</key> <integer>2</integer> </dict> <key>ParameterInfo</key> <dict> <key>1</key> <integer>0</integer> <key>2</key> <integer>1065353216</integer> <key>3</key> <integer>1065353216</integer> </dict> <key>PatchbayInfo</key> <dict> <key>InputPort0</key> <dict> <key>PortInstance</key> <integer>0</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>0</integer> </dict> <key>InputPort1</key> <dict> <key>PortInstance</key> <integer>1</integer> <key>PortWidth</key> <integer>1</integer> <key>SourceFuncInstance</key> <integer>1</integer> <key>SourcePortIndex</key> <integer>1</integer> </dict> </dict> </dict> </dict> </dict> </dict> <key>Outputs</key> <array> <string>Headphone</string> <string>IntSpeaker</string> <string>LineOut</string> <string>SPDIFOut</string> </array> <key>PathMapID</key> <integer>100</integer> <key>SPDIFOut</key> <dict/> </dict> </array> </dict> ```
/content/code_sandbox/Resources/ALCS1220A/layout1.xml
xml
2016-03-07T20:45:58
2024-08-14T08:57:03
AppleALC
acidanthera/AppleALC
3,420
4,562
```xml import PlaygroundTemplate from './Playground'; import SheetControlsPortal from './SheetControlsPortal'; import SheetDescriptionPortal from './SheetDescriptionPortal'; import SheetNavigatorPortal from './SheetNavigatorPortal'; import SheetRouteContainer from './SheetRouteContainer'; import SheetStack from './SheetStack'; const PlaygroundScreen = SheetStack.Screen; export { SheetControlsPortal as PlaygroundControls, SheetDescriptionPortal as PlaygroundDescription, SheetNavigatorPortal as PlaygroundNavigator, SheetRouteContainer as PlaygroundRouteContainer, PlaygroundScreen }; export default PlaygroundTemplate; ```
/content/code_sandbox/apps/discovery/src/components/templates/PlaygroundTemplate/index.tsx
xml
2016-11-29T10:50:53
2024-08-08T06:53:22
react-native-render-html
meliorence/react-native-render-html
3,445
110
```xml import chalk from 'chalk'; import terminalLink from 'terminal-link'; /** * Prints a link for given URL, using text if provided, otherwise text is just the URL. * Format links as dim (unless disabled) and with an underline. * * @example path_to_url */ export function link( url: string, { text = url, dim = true }: { text?: string; dim?: boolean } = {} ): string { let output: string; // Links can be disabled via env variables path_to_url if (terminalLink.isSupported) { output = terminalLink(text, url); } else { output = `${text === url ? '' : text + ': '}${chalk.underline(url)}`; } return dim ? chalk.dim(output) : output; } /** * Provide a consistent "Learn more" link experience. * Format links as dim (unless disabled) with an underline. * * @example [Learn more](path_to_url * @example Learn more: path_to_url */ export function learnMore( url: string, { learnMoreMessage: maybeLearnMoreMessage, dim = true, }: { learnMoreMessage?: string; dim?: boolean } = {} ): string { return link(url, { text: maybeLearnMoreMessage ?? 'Learn more', dim }); } ```
/content/code_sandbox/packages/@expo/cli/src/utils/link.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
281
```xml <?xml version='1.0' encoding='UTF-8'?> <definitions xmlns="path_to_url" xmlns:xsi="path_to_url" xmlns:xsd="path_to_url" xmlns:activiti="path_to_url" xmlns:bpmndi="path_to_url" xmlns:omgdc="path_to_url" xmlns:omgdi="path_to_url" typeLanguage="path_to_url" expressionLanguage="path_to_url" targetNamespace="path_to_url" xmlns:modeler="path_to_url" modeler:version="1.0en" modeler:exportDateTime="20141210124445777" modeler:modelId="924474" modeler:modelVersion="1" modeler:modelLastUpdated="1418215482206"> <process id="variablesFetchingTestProcess" name="VariablesTest" isExecutable="true"> <startEvent id="startEvent1"/> <userTask id="sid-05767243-5EFD-496E-882E-14B47D3274B3" name="Task A"/> <sequenceFlow id="sid-15D04314-3280-4CAF-8A23-0415598CF5B0" sourceRef="startEvent1" targetRef="sid-05767243-5EFD-496E-882E-14B47D3274B3"/> <sequenceFlow id="sid-90E99CC2-B930-48F4-AE60-425DD6A4C657" sourceRef="sid-05767243-5EFD-496E-882E-14B47D3274B3" targetRef="sid-6EDB2B4B-48CB-4018-BFDB-A751B0B1950F"/> <parallelGateway id="sid-6EDB2B4B-48CB-4018-BFDB-A751B0B1950F"/> <userTask id="sid-157D27B4-4E96-47AB-A1BA-ADB350659DDB" name="Task B"/> <sequenceFlow id="sid-2514CA53-0998-4C08-880D-14FCCE4B59E1" sourceRef="sid-6EDB2B4B-48CB-4018-BFDB-A751B0B1950F" targetRef="sid-157D27B4-4E96-47AB-A1BA-ADB350659DDB"/> <sequenceFlow id="sid-EA019938-D594-4400-B498-A143E3546C6A" sourceRef="sid-6EDB2B4B-48CB-4018-BFDB-A751B0B1950F" targetRef="sid-92FDA83E-7CB0-4538-B26B-71D470395CA5"/> <userTask id="sid-92FDA83E-7CB0-4538-B26B-71D470395CA5" name="Task C"/> <userTask id="sid-A5706B24-A6CA-4131-94BD-659FC3028482" name="Task D"/> <sequenceFlow id="sid-9CFBE731-A527-49EF-919F-9FC2B497EC63" sourceRef="sid-6EDB2B4B-48CB-4018-BFDB-A751B0B1950F" targetRef="sid-A5706B24-A6CA-4131-94BD-659FC3028482"/> <parallelGateway id="sid-D5DF4CD1-DBBC-46DA-92EE-669BCC00CFB5"/> <sequenceFlow id="sid-9EB6750A-F86E-4451-AED9-5EFCCA5A899A" sourceRef="sid-92FDA83E-7CB0-4538-B26B-71D470395CA5" targetRef="sid-D5DF4CD1-DBBC-46DA-92EE-669BCC00CFB5"/> <sequenceFlow id="sid-1ADF62AD-B29D-45AF-8920-A9B43714C041" sourceRef="sid-A5706B24-A6CA-4131-94BD-659FC3028482" targetRef="sid-D5DF4CD1-DBBC-46DA-92EE-669BCC00CFB5"/> <userTask id="sid-8E05A38C-6F00-4BEC-BE68-F38A72A1AFBD" name="Task E"/> <sequenceFlow id="sid-469049E9-EFE8-4903-B80D-A38F3DDFA531" sourceRef="sid-D5DF4CD1-DBBC-46DA-92EE-669BCC00CFB5" targetRef="sid-8E05A38C-6F00-4BEC-BE68-F38A72A1AFBD"/> <endEvent id="sid-0DCD8F1E-37C8-4F8D-AF19-B705CF07103F"/> <sequenceFlow id="sid-A6AC0534-5433-40EF-ACCC-C47C48E8286C" sourceRef="sid-8E05A38C-6F00-4BEC-BE68-F38A72A1AFBD" targetRef="sid-0DCD8F1E-37C8-4F8D-AF19-B705CF07103F"/> <sequenceFlow id="sid-20096242-1571-4D68-9FFC-8C6B0A07000B" sourceRef="sid-157D27B4-4E96-47AB-A1BA-ADB350659DDB" targetRef="sid-8AA6253E-EF3E-4F7F-A120-1EDCD83E2EB3"/> <serviceTask id="sid-8AA6253E-EF3E-4F7F-A120-1EDCD83E2EB3" name="service task 1" activiti:class="org.flowable.engine.test.api.variables.VariablesTest$TestJavaDelegate1" /> <sequenceFlow id="sid-550458E7-E271-47D2-9B3E-D21A6CE1704A" sourceRef="sid-8AA6253E-EF3E-4F7F-A120-1EDCD83E2EB3" targetRef="sid-6A4C5B66-2BD8-4D65-B074-8510193AD98D"/> <serviceTask id="sid-6A4C5B66-2BD8-4D65-B074-8510193AD98D" name="service task 2" activiti:class="org.flowable.engine.test.api.variables.VariablesTest$TestJavaDelegate2" /> <userTask id="sid-90AAEC84-20C3-407E-8B4D-8FCFC252054F" name="service task 3" activiti:class="org.flowable.engine.test.api.variables.VariablesTest$TestJavaDelegate3" /> <sequenceFlow id="sid-AA39E536-60F4-4A64-BE77-EE632A328ED2" sourceRef="sid-6A4C5B66-2BD8-4D65-B074-8510193AD98D" targetRef="sid-90AAEC84-20C3-407E-8B4D-8FCFC252054F"/> <sequenceFlow id="sid-19C0E404-8A1C-4806-A37A-320F4404EBF0" sourceRef="sid-90AAEC84-20C3-407E-8B4D-8FCFC252054F" targetRef="sid-D5DF4CD1-DBBC-46DA-92EE-669BCC00CFB5"/> </process> <bpmndi:BPMNDiagram id="BPMNDiagram_variablesTest"> <bpmndi:BPMNPlane bpmnElement="variablesTest" id="BPMNPlane_variablesTest"> <bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1"> <omgdc:Bounds height="30.0" width="30.0" x="90.0" y="300.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-05767243-5EFD-496E-882E-14B47D3274B3" id="BPMNShape_sid-05767243-5EFD-496E-882E-14B47D3274B3"> <omgdc:Bounds height="80.0" width="100.0" x="165.0" y="275.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-6EDB2B4B-48CB-4018-BFDB-A751B0B1950F" id="BPMNShape_sid-6EDB2B4B-48CB-4018-BFDB-A751B0B1950F"> <omgdc:Bounds height="40.0" width="40.0" x="310.0" y="295.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-157D27B4-4E96-47AB-A1BA-ADB350659DDB" id="BPMNShape_sid-157D27B4-4E96-47AB-A1BA-ADB350659DDB"> <omgdc:Bounds height="80.0" width="100.0" x="395.0" y="165.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-92FDA83E-7CB0-4538-B26B-71D470395CA5" id="BPMNShape_sid-92FDA83E-7CB0-4538-B26B-71D470395CA5"> <omgdc:Bounds height="80.0" width="100.0" x="395.0" y="275.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-A5706B24-A6CA-4131-94BD-659FC3028482" id="BPMNShape_sid-A5706B24-A6CA-4131-94BD-659FC3028482"> <omgdc:Bounds height="80.0" width="100.0" x="395.0" y="390.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-D5DF4CD1-DBBC-46DA-92EE-669BCC00CFB5" id="BPMNShape_sid-D5DF4CD1-DBBC-46DA-92EE-669BCC00CFB5"> <omgdc:Bounds height="40.0" width="40.0" x="711.0" y="295.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-8E05A38C-6F00-4BEC-BE68-F38A72A1AFBD" id="BPMNShape_sid-8E05A38C-6F00-4BEC-BE68-F38A72A1AFBD"> <omgdc:Bounds height="80.0" width="100.0" x="796.0" y="275.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-0DCD8F1E-37C8-4F8D-AF19-B705CF07103F" id="BPMNShape_sid-0DCD8F1E-37C8-4F8D-AF19-B705CF07103F"> <omgdc:Bounds height="28.0" width="28.0" x="941.0" y="301.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-8AA6253E-EF3E-4F7F-A120-1EDCD83E2EB3" id="BPMNShape_sid-8AA6253E-EF3E-4F7F-A120-1EDCD83E2EB3"> <omgdc:Bounds height="80.0" width="100.0" x="395.0" y="30.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-6A4C5B66-2BD8-4D65-B074-8510193AD98D" id="BPMNShape_sid-6A4C5B66-2BD8-4D65-B074-8510193AD98D"> <omgdc:Bounds height="80.0" width="100.0" x="540.0" y="30.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-90AAEC84-20C3-407E-8B4D-8FCFC252054F" id="BPMNShape_sid-90AAEC84-20C3-407E-8B4D-8FCFC252054F"> <omgdc:Bounds height="80.0" width="100.0" x="681.0" y="30.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNEdge bpmnElement="sid-20096242-1571-4D68-9FFC-8C6B0A07000B" id="BPMNEdge_sid-20096242-1571-4D68-9FFC-8C6B0A07000B"> <omgdi:waypoint x="445.0" y="165.0"/> <omgdi:waypoint x="445.0" y="110.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-19C0E404-8A1C-4806-A37A-320F4404EBF0" id="BPMNEdge_sid-19C0E404-8A1C-4806-A37A-320F4404EBF0"> <omgdi:waypoint x="731.0" y="110.0"/> <omgdi:waypoint x="731.0" y="295.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-9CFBE731-A527-49EF-919F-9FC2B497EC63" id="BPMNEdge_sid-9CFBE731-A527-49EF-919F-9FC2B497EC63"> <omgdi:waypoint x="330.5" y="334.5"/> <omgdi:waypoint x="330.5" y="430.0"/> <omgdi:waypoint x="395.0" y="430.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-A6AC0534-5433-40EF-ACCC-C47C48E8286C" id="BPMNEdge_sid-A6AC0534-5433-40EF-ACCC-C47C48E8286C"> <omgdi:waypoint x="896.0" y="315.0"/> <omgdi:waypoint x="941.0" y="315.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-2514CA53-0998-4C08-880D-14FCCE4B59E1" id="BPMNEdge_sid-2514CA53-0998-4C08-880D-14FCCE4B59E1"> <omgdi:waypoint x="330.5" y="295.5"/> <omgdi:waypoint x="330.5" y="205.0"/> <omgdi:waypoint x="395.0" y="205.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-469049E9-EFE8-4903-B80D-A38F3DDFA531" id="BPMNEdge_sid-469049E9-EFE8-4903-B80D-A38F3DDFA531"> <omgdi:waypoint x="750.5833333333334" y="315.4166666666667"/> <omgdi:waypoint x="796.0" y="315.2183406113537"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-90E99CC2-B930-48F4-AE60-425DD6A4C657" id="BPMNEdge_sid-90E99CC2-B930-48F4-AE60-425DD6A4C657"> <omgdi:waypoint x="265.0" y="315.2164502164502"/> <omgdi:waypoint x="310.4130434782609" y="315.4130434782609"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-AA39E536-60F4-4A64-BE77-EE632A328ED2" id="BPMNEdge_sid-AA39E536-60F4-4A64-BE77-EE632A328ED2"> <omgdi:waypoint x="640.0" y="70.0"/> <omgdi:waypoint x="681.0" y="70.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-EA019938-D594-4400-B498-A143E3546C6A" id="BPMNEdge_sid-EA019938-D594-4400-B498-A143E3546C6A"> <omgdi:waypoint x="349.5833333333333" y="315.4166666666667"/> <omgdi:waypoint x="395.0" y="315.2183406113537"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-9EB6750A-F86E-4451-AED9-5EFCCA5A899A" id="BPMNEdge_sid-9EB6750A-F86E-4451-AED9-5EFCCA5A899A"> <omgdi:waypoint x="495.0" y="315.0"/> <omgdi:waypoint x="711.0" y="315.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-550458E7-E271-47D2-9B3E-D21A6CE1704A" id="BPMNEdge_sid-550458E7-E271-47D2-9B3E-D21A6CE1704A"> <omgdi:waypoint x="495.0" y="70.0"/> <omgdi:waypoint x="540.0" y="70.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-1ADF62AD-B29D-45AF-8920-A9B43714C041" id="BPMNEdge_sid-1ADF62AD-B29D-45AF-8920-A9B43714C041"> <omgdi:waypoint x="495.0" y="430.0"/> <omgdi:waypoint x="731.0" y="430.0"/> <omgdi:waypoint x="731.0" y="335.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-15D04314-3280-4CAF-8A23-0415598CF5B0" id="BPMNEdge_sid-15D04314-3280-4CAF-8A23-0415598CF5B0"> <omgdi:waypoint x="120.0" y="315.0"/> <omgdi:waypoint x="165.0" y="315.0"/> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </definitions> ```
/content/code_sandbox/modules/flowable-engine/src/test/resources/org/flowable/engine/test/api/variables/VariablesTest.testGetVariableAllVariableFetchingDefault.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
4,824
```xml import { AsyncIterableX } from '../../asynciterable/asynciterablex.js'; import { takeWhile } from '../../asynciterable/operators/takewhile.js'; /** * @ignore */ export function takeWhileProto<T, S extends T>( this: AsyncIterableX<T>, predicate: (value: T, index: number, signal?: AbortSignal) => value is S ): AsyncIterableX<S>; export function takeWhileProto<T>( this: AsyncIterableX<T>, predicate: (value: T, index: number, signal?: AbortSignal) => boolean | Promise<boolean> ): AsyncIterableX<T>; export function takeWhileProto<T>( this: AsyncIterableX<T>, predicate: (value: T, index: number, signal?: AbortSignal) => boolean | Promise<boolean> ): AsyncIterableX<T> { return takeWhile<T>(predicate)(this); } AsyncIterableX.prototype.takeWhile = takeWhileProto; declare module '../../asynciterable/asynciterablex' { interface AsyncIterableX<T> { takeWhile: typeof takeWhileProto; } } ```
/content/code_sandbox/src/add/asynciterable-operators/takewhile.ts
xml
2016-02-22T20:04:19
2024-08-09T18:46:41
IxJS
ReactiveX/IxJS
1,319
234
```xml <Project xmlns="path_to_url"> <ItemGroup Condition="'$(CUSTOM_DOTNET_VERSION)' != ''"> <FrameworkReference Update="Microsoft.NETCore.App" RuntimeFrameworkVersion="$(CUSTOM_DOTNET_VERSION)" /> <KnownFrameworkReference Update="Microsoft.NETCore.App" TargetingPackVersion="$(CUSTOM_DOTNET_VERSION)" /> <KnownFrameworkReference Update="Microsoft.NETCore.App" RuntimeFrameworkVersion="$(CUSTOM_DOTNET_VERSION)" /> <FrameworkReference Update="Microsoft.NETCore.App.Mono" RuntimeFrameworkVersion="$(CUSTOM_DOTNET_VERSION)" /> <KnownFrameworkReference Update="Microsoft.NETCore.App.Mono" TargetingPackVersion="$(CUSTOM_DOTNET_VERSION)" /> <KnownFrameworkReference Update="Microsoft.NETCore.App.Mono" RuntimeFrameworkVersion="$(CUSTOM_DOTNET_VERSION)" /> </ItemGroup> <Target Name="UpdateKnownRuntimePackWithCustomRuntime" Condition="'$(TRACKING_DOTNET_RUNTIME_SEPARATELY)' != ''" BeforeTargets="ProcessFrameworkReferences"> <ItemGroup> <KnownFrameworkReference Update="Microsoft.NETCore.App" Condition="'%(TargetFramework)' == 'net$(BundledNETCoreAppTargetFrameworkVersion)'"> <RuntimeFrameworkVersion>$(MicrosoftNETCoreAppRefPackageVersion)</RuntimeFrameworkVersion> </KnownFrameworkReference> <KnownRuntimePack Update="Microsoft.NETCore.App" Condition="'%(TargetFramework)' == 'net$(BundledNETCoreAppTargetFrameworkVersion)'"> <LatestRuntimeFrameworkVersion>$(MicrosoftNETCoreAppRefPackageVersion)</LatestRuntimeFrameworkVersion> </KnownRuntimePack> </ItemGroup> </Target> </Project> ```
/content/code_sandbox/tests/Directory.Build.targets
xml
2016-04-20T18:24:26
2024-08-16T13:29:19
xamarin-macios
xamarin/xamarin-macios
2,436
356
```xml import * as path from 'path'; import * as fs from 'fs'; export const dirTempPath = path.resolve(__dirname, 'temp'); if (!fs.existsSync(dirTempPath)) { fs.mkdirSync(dirTempPath, { recursive: true }); } export const supergraphConfigPath = path.resolve( dirTempPath, 'supergraph.yaml' ); export const supergraphPath = path.resolve(dirTempPath, 'supergraph.graphql'); export const routerConfigPath = path.resolve(dirTempPath, 'router.yaml'); export const routerPath = path.resolve(dirTempPath, 'router'); ```
/content/code_sandbox/packages/gateway/src/apollo-router/paths.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
124
```xml <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Zj5-Ar-m1A"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> <!--Custom variables--> <scene sceneID="AbJ-n4-Qbr"> <objects> <tableViewController title="Custom variables" id="Zj5-Ar-m1A" customClass="DBCustomVariablesTableViewController" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="U5p-XF-Egb"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <connections> <outlet property="dataSource" destination="Zj5-Ar-m1A" id="Up4-tT-34e"/> <outlet property="delegate" destination="Zj5-Ar-m1A" id="nvv-dh-q9F"/> </connections> </tableView> <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/> </tableViewController> <placeholder placeholderIdentifier="IBFirstResponder" id="S3Q-F3-wH3" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="186" y="109"/> </scene> </scenes> </document> ```
/content/code_sandbox/DBDebugToolkit/Resources/DBCustomVariablesTableViewController.storyboard
xml
2016-11-19T13:18:25
2024-08-11T21:26:13
DBDebugToolkit
dbukowski/DBDebugToolkit
1,262
537
```xml import '../asynciterablehelpers.js'; import { of, range, sequenceEqual } from 'ix/asynciterable/index.js'; import { concatAll, map, tap } from 'ix/asynciterable/operators/index.js'; test('AsyncIterable#concat concatAll behavior', async () => { const res = of(of(1, 2, 3), of(4, 5)).pipe(concatAll()); expect(await sequenceEqual(res, of(1, 2, 3, 4, 5))).toBeTruthy(); }); test('AsyncIterable#concat concatAll order of effects', async () => { let i = 0; const xss = range(0, 3).pipe( map((x) => range(0, x + 1)), tap({ next: async () => ++i }) ); const res = xss.pipe( concatAll(), map((x) => i + ' - ' + x) ); expect( await sequenceEqual(res, of('1 - 0', '2 - 0', '2 - 1', '3 - 0', '3 - 1', '3 - 2')) ).toBeTruthy(); }); ```
/content/code_sandbox/spec/asynciterable-operators/concatall-spec.ts
xml
2016-02-22T20:04:19
2024-08-09T18:46:41
IxJS
ReactiveX/IxJS
1,319
258
```xml <?xml version="1.0" encoding="utf-8"?> <resources> <color name="abc_input_method_navigation_guard">@android:color/black</color> <color name="abc_search_url_text_normal">#ff7fa87f</color> <color name="abc_search_url_text_pressed">@android:color/black</color> <color name="abc_search_url_text_selected">@android:color/black</color> <color name="accent_material_dark">@color/material_deep_teal_200</color> <color name="accent_material_light">@color/material_deep_teal_500</color> <color name="actionsheet_blue">#ff037bff</color> <color name="actionsheet_gray">#ff8f8f8f</color> <color name="actionsheet_red">#fffd4a2e</color> <color name="activity_base_color">#ffff4c34</color> <color name="activity_new_base_color">#fff5f5f5</color> <color name="ads_bg">#80000000</color> <color name="alertdialog_line">#ffc6c6c6</color> <color name="aquamarine">#ff7fffd4</color> <color name="assist_blue">#ff35aaf6</color> <color name="assist_blue_pressed">#ff1388d3</color> <color name="assist_green">#ff24cb7a</color> <color name="background_floating_material_dark">@color/material_grey_800</color> <color name="background_floating_material_light">@android:color/white</color> <color name="background_material_dark">@color/material_grey_850</color> <color name="background_material_light">@color/material_grey_50</color> <color name="background_tab_pressed">#6633b5e5</color> <color name="bg_02">#ffffffff</color> <color name="bg_black_gift_trans_000000">#2e000000</color> <color name="bg_blue_gift_1314">#fffe4080</color> <color name="bg_blue_gift_3344">#ffff0031</color> <color name="bg_blue_gift_520">#fffb4aab</color> <color name="bg_blue_gift_66">#ff35aaf6</color> <color name="bg_blue_gift_default">#ff34373b</color> <color name="bg_blue_gift_shadow_3335aaf6">#3335aaf6</color> <color name="bg_blue_gift_trans_35aaf6">#ff35aaf6</color> <color name="bg_blue_gift_trans_f0aaf6">#d035aaf6</color> <color name="bg_blue_gift_trans_shadow">#2835aaf6</color> <color name="bg_layout">#fff6fcff</color> <color name="bg_white_gift_shadow_33ffffff">#33ffffff</color> <color name="bg_white_gift_trans_ffffff">#d0ffffff</color> <color name="bisque">#ffffe4c4</color> <color name="black">#ff000000</color> <color name="black_10">#19000000</color> <color name="black_100">#ff000000</color> <color name="black_20">#32000000</color> <color name="black_30">#4b000000</color> <color name="black_40">#65000000</color> <color name="black_50">#80000000</color> <color name="black_60">#99000000</color> <color name="black_70">#b3000000</color> <color name="black_80">#cc000000</color> <color name="black_90">#e6000000</color> <color name="black_95">#f2000000</color> <color name="black_line">#ffe3e1e1</color> <color name="black_txt">#ff333333</color> <color name="blue">#ff0000ff</color> <color name="blue_1c71d2">#ff1c71d2</color> <color name="blue_2f84e3">#ff2f84e3</color> <color name="blue_d5ebff">#ffd5ebff</color> <color name="blue_new">#ff000000</color> <color name="blue_word">#ff0099ff</color> <color name="blueviolet">#ff8a2be2</color> <color name="bright_foreground_disabled_material_dark">#80ffffff</color> <color name="bright_foreground_disabled_material_light">#80000000</color> <color name="bright_foreground_inverse_material_dark">@color/bright_foreground_material_light</color> <color name="bright_foreground_inverse_material_light">@color/bright_foreground_material_dark</color> <color name="bright_foreground_material_dark">@android:color/white</color> <color name="bright_foreground_material_light">@android:color/black</color> <color name="brown">#ffa52a2a</color> <color name="btn_press_color">#66000000</color> <color name="btn_unpress_color">#22000000</color> <color name="button_material_dark">#ff5a595b</color> <color name="button_material_light">#ffd6d7d7</color> <color name="cardview_dark_background">#ff202020</color> <color name="cardview_light_background">#fffafafa</color> <color name="cardview_shadow_end_color">#03000000</color> <color name="cardview_shadow_start_color">#37000000</color> <color name="chirty_title">#ff5c5e61</color> <color name="circle_image_border_color">#19000000</color> <color name="clear">#00000000</color> <color name="colorAccent">#ffff4c34</color> <color name="colorPrimary">#ffff4c34</color> <color name="colorPrimaryDark">#ffff4c34</color> <color name="crimson">#ffdc143c</color> <color name="cyan">#ff00ffff</color> <color name="darkblue">#ff00008b</color> <color name="darkgreen">#ff006400</color> <color name="darkgrey">#ffa9a9a9</color> <color name="darkorchid">#ff9932cc</color> <color name="darkred">#ff8b0000</color> <color name="deepblue_word">#ff0092e4</color> <color name="deeppink">#ffff6767</color> <color name="default_circle_indicator_fill_color">#ff1ea098</color> <color name="default_circle_indicator_fill_color1">@color/black</color> <color name="default_circle_indicator_page_color">#00000000</color> <color name="default_circle_indicator_page_color1">#00000000</color> <color name="default_circle_indicator_stroke_color">#ff1ea098</color> <color name="default_circle_indicator_stroke_color1">#ffdddddd</color> <color name="default_line_indicator_selected_color">#ff33b5e5</color> <color name="default_line_indicator_unselected_color">#ffbbbbbb</color> <color name="default_title_indicator_footer_color">#ff33b5e5</color> <color name="default_title_indicator_selected_color">#ffffffff</color> <color name="default_title_indicator_text_color">#bbffffff</color> <color name="default_underline_indicator_selected_color">#ff33b5e5</color> <color name="design_fab_shadow_end_color">@android:color/transparent</color> <color name="design_fab_shadow_mid_color">#14000000</color> <color name="design_fab_shadow_start_color">#44000000</color> <color name="design_fab_stroke_end_inner_color">#0a000000</color> <color name="design_fab_stroke_end_outer_color">#0f000000</color> <color name="design_fab_stroke_top_inner_color">#1affffff</color> <color name="design_fab_stroke_top_outer_color">#2effffff</color> <color name="design_snackbar_background_color">#ff323232</color> <color name="design_textinput_error_color">#ffdd2c00</color> <color name="dialog_bg">#ffe74c3c</color> <color name="dim_foreground_disabled_material_dark">#80bebebe</color> <color name="dim_foreground_disabled_material_light">#80323232</color> <color name="dim_foreground_material_dark">#ffbebebe</color> <color name="dim_foreground_material_light">#ff323232</color> <color name="divider_color">#ffededed</color> <color name="divider_high">#ffe6edf0</color> <color name="divider_low">#fff5f8fa</color> <color name="findback_bg_color">#ffeeeeee</color> <color name="findback_text_color">#ff333333</color> <color name="finish_color">#ffff4c34</color> <color name="font_black1">#ff34373b</color> <color name="font_black2">#8f34373b</color> <color name="font_black3">#4c34373b</color> <color name="font_black4">#7f34373b</color> <color name="foreground_material_dark">@android:color/white</color> <color name="foreground_material_light">@android:color/black</color> <color name="forestgreen">#ff228b22</color> <color name="fuchsia">#ffff00ff</color> <color name="get_reward">#ffffc9c2</color> <color name="gift_blue_35aaf6">#ff35aaf6</color> <color name="gift_orange_text">#ffff5253</color> <color name="gift_trans_white_50">#8fffffff</color> <color name="gift_trans_white_70">#afffffff</color> <color name="gift_white_35aaf6">#ffffffff</color> <color name="gold">#ffffd700</color> <color name="goldenrod">#ffdaa520</color> <color name="gray">#ff808080</color> <color name="gray_ddd">#ffdddddd</color> <color name="grays">#ff8a8a8a</color> <color name="green">#ff59bbff</color> <color name="green_word">#ff18cf18</color> <color name="green_word_009900">#ff009900</color> <color name="green_word_02dc8c">#ff02dc8c</color> <color name="grey">#ff808080</color> <color name="grey_a4a4a4">#ff666666</color> <color name="grey_txt">#ff999999</color> <color name="grey_word">#ffcccccc</color> <color name="grif_pop">#cc000000</color> <color name="grif_pop_back">#7f000000</color> <color name="grif_pop_item">#ff333333</color> <color name="grif_pop_tx">#ffcccccc</color> <color name="headColor">#ff1ea098</color> <color name="highlighted_text_material_dark">#6680cbc4</color> <color name="highlighted_text_material_light">#66009688</color> <color name="hint_foreground_material_dark">@color/bright_foreground_disabled_material_dark</color> <color name="hint_foreground_material_light">@color/bright_foreground_disabled_material_light</color> <color name="holo_gray">#ffececec</color> <color name="home_rad_txt_blue">#ff359bff</color> <color name="home_rad_txt_gray">#ff666666</color> <color name="host_bg">#33000000</color> <color name="host_nick_bg">#ff0099ff</color> <color name="hot_word">#ffececec</color> <color name="ios_bg">#ffeeeeee</color> <color name="ios_detailstxt">#ff8e8e93</color> <color name="ios_line">#ffc8c7cc</color> <color name="ios_titletxt">#ff000000</color> <color name="item_bg">#fff3f4f9</color> <color name="item_selbg">#fff4f5f5</color> <color name="item_select_color">#ffff4c34</color> <color name="item_unselect_color">#7fff4c34</color> <color name="like_white">#fff9f9f9</color> <color name="line_color">#ffe6edf0</color> <color name="live_contribute_selected">#ff999999</color> <color name="live_name_selected">#ffff4c34</color> <color name="live_pop_back">#ff111111</color> <color name="live_selected">#fffb5459</color> <color name="live_title_bg">#e6000000</color> <color name="login_bg_color">#fff5f5f5</color> <color name="login_edt_hint_color">#ffcccccc</color> <color name="login_edt_line_color">#ffebebeb</color> <color name="login_forget_pw_color">#ff666666</color> <color name="login_input_background">#ffebf2f5</color> <color name="login_line">#ffe7eef1</color> <color name="login_new_bg">#fff6fcff</color> <color name="login_title_color">#ffffffff</color> <color name="main_back">#fff6fcff</color> <color name="main_base_back">#ffffffff</color> <color name="main_cell_bg">#ffa6d5fa</color> <color name="main_danmu_float_text">#ff5c5e61</color> <color name="main_danmu_text">#ff797c80</color> <color name="main_gift_num">#ff4d4f50</color> <color name="main_gift_tab_num">#ffced2d9</color> <color name="main_loading_back">#1a35aaf6</color> <color name="main_mine_back1">#05ffffff</color> <color name="main_mine_back2">#07ffffff</color> <color name="main_mine_back_end">#fffa3d3d</color> <color name="main_mine_back_start">#ffff5a5b</color> <color name="main_mine_progress_alpha20">#33ffadad</color> <color name="main_mine_progress_tx_alpha50">#7fffffff</color> <color name="main_mine_siwtch_back">#fff5f5f5</color> <color name="main_rec_num_tx">#c8ffffff</color> <color name="main_rec_spot">#32ffffff</color> <color name="main_rec_tx">#80ffffff</color> <color name="main_red">#ffff5253</color> <color name="main_red_alpha50">#7fff5253</color> <color name="main_red_pressed">#fff12c2d</color> <color name="main_tab_color">#ffff5a3b</color> <color name="material_blue_grey_800">#ff37474f</color> <color name="material_blue_grey_900">#ff263238</color> <color name="material_blue_grey_950">#ff21272b</color> <color name="material_deep_teal_200">#ff80cbc4</color> <color name="material_deep_teal_500">#ff009688</color> <color name="material_grey_100">#fff5f5f5</color> <color name="material_grey_300">#ffe0e0e0</color> <color name="material_grey_50">#fffafafa</color> <color name="material_grey_600">#ff757575</color> <color name="material_grey_800">#ff424242</color> <color name="material_grey_850">#ff303030</color> <color name="material_grey_900">#ff212121</color> <color name="mediumorchid">#ffba55d3</color> <color name="mediumseagreen">#ff3cb371</color> <color name="msg_color">#ffffffff</color> <color name="notification_colot">#ff999999</color> <color name="num">#ff080704</color> <color name="orange">#ffcc9900</color> <color name="orangebg_pres">#88ed7a37</color> <color name="orangepress">#ffed7a37</color> <color name="orangered">#ffff4500</color> <color name="paleturquoise">#ffafeeee</color> <color name="pink">#ffffc0cb</color> <color name="price">#ffef6f00</color> <color name="primary_dark_material_dark">@android:color/black</color> <color name="primary_dark_material_light">@color/material_grey_600</color> <color name="primary_material_dark">@color/material_grey_900</color> <color name="primary_material_light">@color/material_grey_100</color> <color name="primary_text_default_material_dark">#ffffffff</color> <color name="primary_text_default_material_light">#de000000</color> <color name="primary_text_disabled_material_dark">#4dffffff</color> <color name="primary_text_disabled_material_light">#39000000</color> <color name="recomend_item_line">#ffe6edf0</color> <color name="red">#ffff0000</color> <color name="red_packets_num_color">#ff8c3023</color> <color name="red_word">#ffff3300</color> <color name="red_word_fb223c">#fffb223c</color> <color name="ripple_material_dark">#33ffffff</color> <color name="ripple_material_light">#1f000000</color> <color name="room_man_bg">#ffff4c34</color> <color name="royalblue">#ff4169e1</color> <color name="secondary_text_default_material_dark">#b3ffffff</color> <color name="secondary_text_default_material_light">#8a000000</color> <color name="secondary_text_disabled_material_dark">#36ffffff</color> <color name="secondary_text_disabled_material_light">#24000000</color> <color name="send_tip_color">#ff999999</color> <color name="shareboard_alpha">#99111111</color> <color name="sienna">#ffa0522d</color> <color name="silver">#ffc0c0c0</color> <color name="skyblue">#ff87ceeb</color> <color name="super_bg">#ff00db4d</color> <color name="switch_thumb_disabled_material_dark">#ff616161</color> <color name="switch_thumb_disabled_material_light">#ffbdbdbd</color> <color name="switch_thumb_normal_material_dark">#ffbdbdbd</color> <color name="switch_thumb_normal_material_light">#fff1f1f1</color> <color name="system_tips_bg">#60000000</color> <color name="task_status_get">#ffff5a3b</color> <color name="tb_munion_item_force">#ffe3e3e3</color> <color name="text_01">#ff34373b</color> <color name="text_02">#8034373b</color> <color name="text_03">#4c34373b</color> <color name="text_color">#ffffffff</color> <color name="textview_title_default">#ff999999</color> <color name="textview_title_selected">#ffff4c34</color> <color name="title_divider">#ffdedede</color> <color name="titlebgcolor">#ffff6767</color> <color name="trans">#00000000</color> <color name="transparent">#00000000</color> <color name="txt_black">#ff333333</color> <color name="txt_grey">#ff999999</color> <color name="unclickable_color">#ffffb4ae</color> <color name="unfinish_color">#ff0099ff</color> <color name="updata_dialog_top_bg">#ffffeded</color> <color name="user_id">#ff0099ff</color> <color name="violet">#ffee82ee</color> <color name="vpi__background_holo_dark">#ff000000</color> <color name="vpi__background_holo_light">#fff3f3f3</color> <color name="vpi__bright_foreground_disabled_holo_dark">#ff4c4c4c</color> <color name="vpi__bright_foreground_disabled_holo_light">#ffb2b2b2</color> <color name="vpi__bright_foreground_holo_dark">@color/vpi__background_holo_light</color> <color name="vpi__bright_foreground_holo_light">@color/vpi__background_holo_dark</color> <color name="vpi__bright_foreground_inverse_holo_dark">@color/vpi__bright_foreground_holo_light</color> <color name="vpi__bright_foreground_inverse_holo_light">@color/vpi__bright_foreground_holo_dark</color> <color name="white">#ffffffff</color> <color name="white_10">#19ffffff</color> <color name="white_100">#ffffffff</color> <color name="white_20">#32ffffff</color> <color name="white_30">#4bffffff</color> <color name="white_40">#65ffffff</color> <color name="white_50">#80ffffff</color> <color name="white_60">#99ffffff</color> <color name="white_70">#b3ffffff</color> <color name="white_80">#ccffffff</color> <color name="white_90">#e6ffffff</color> <color name="yellow">#ffffff00</color> </resources> ```
/content/code_sandbox/app/src/main/res/values/colorstv.xml
xml
2016-11-21T02:35:32
2024-07-16T14:34:43
likequanmintv
chenchengyin/likequanmintv
1,050
5,117
```xml const importHistoryGetColumns = ` query importHistoryGetColumns($attachmentName: String) { importHistoryGetColumns(attachmentName: $attachmentName) } `; const importHistoryGetDuplicatedHeaders = ` query importHistoryGetDuplicatedHeaders($attachmentNames: [String]) { importHistoryGetDuplicatedHeaders(attachmentNames: $attachmentNames) } `; const importHistories = ` query importHistories($type: String, $perPage: Int, $page: Int) { importHistories(type: $type, perPage: $perPage, page: $page) { list { _id success failed total updated name contentTypes date status percentage attachments removed user { _id details { fullName } } error } count } } `; export default { importHistories, importHistoryGetColumns, importHistoryGetDuplicatedHeaders }; ```
/content/code_sandbox/packages/core-ui/src/modules/settings/importExport/import/graphql/queries.ts
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
222
```xml // path_to_url import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; class MathSubScriptHideAttributes extends XmlAttributeComponent<{ readonly hide: number }> { protected readonly xmlKeys = { hide: "m:val" }; } export class MathSubScriptHide extends XmlComponent { public constructor() { super("m:subHide"); this.root.push(new MathSubScriptHideAttributes({ hide: 1 })); } } ```
/content/code_sandbox/src/file/paragraph/math/n-ary/math-sub-script-hide.ts
xml
2016-03-26T23:43:56
2024-08-16T13:02:47
docx
dolanmiu/docx
4,139
96
```xml import { Entity, ManyToMany, PrimaryGeneratedColumn } from "../../../../src" import { Product } from "./product" @Entity({ name: "category" }) export class Category { @PrimaryGeneratedColumn() id: string @ManyToMany(() => Product, (product) => product.categories) products: Product[] } ```
/content/code_sandbox/test/github-issues/3443/entity/category.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
68
```xml #!/usr/bin/env node import { bold, cyan, green, red, yellow } from '../lib/picocolors' import { Telemetry } from '../telemetry/storage' export type NextTelemetryOptions = { enable?: boolean disable?: boolean } const telemetry = new Telemetry({ distDir: process.cwd() }) let isEnabled = telemetry.isEnabled const nextTelemetry = (options: NextTelemetryOptions, arg: string) => { if (options.enable || arg === 'enable') { telemetry.setEnabled(true) isEnabled = true console.log(cyan('Success!')) } else if (options.disable || arg === 'disable') { const path = telemetry.setEnabled(false) if (isEnabled) { console.log( cyan(`Your preference has been saved${path ? ` to ${path}` : ''}.`) ) } else { console.log(yellow(`Next.js' telemetry collection is already disabled.`)) } isEnabled = false } else { console.log(bold('Next.js Telemetry')) } console.log( `\nStatus: ${isEnabled ? bold(green('Enabled')) : bold(red('Disabled'))}` ) if (isEnabled) { console.log( '\nNext.js telemetry is completely anonymous. Thank you for participating!' ) } else { console.log( `\nYou have opted-out of Next.js' anonymous telemetry program.\nNo data will be collected from your machine.` ) } console.log(`\nLearn more: ${cyan('path_to_url}`) } export { nextTelemetry } ```
/content/code_sandbox/packages/next/src/cli/next-telemetry.ts
xml
2016-10-05T23:32:51
2024-08-16T19:44:30
next.js
vercel/next.js
124,056
341
```xml import { Component } from "@angular/core"; import { PremiumComponent as BasePremiumComponent } from "@bitwarden/angular/vault/components/premium.component"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service"; import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; import { DialogService } from "@bitwarden/components"; @Component({ selector: "app-premium", templateUrl: "premium.component.html", }) export class PremiumComponent extends BasePremiumComponent { constructor( i18nService: I18nService, platformUtilsService: PlatformUtilsService, apiService: ApiService, configService: ConfigService, logService: LogService, stateService: StateService, dialogService: DialogService, environmentService: EnvironmentService, billingAccountProfileStateService: BillingAccountProfileStateService, ) { super( i18nService, platformUtilsService, apiService, configService, logService, dialogService, environmentService, billingAccountProfileStateService, ); } } ```
/content/code_sandbox/apps/desktop/src/vault/app/accounts/premium.component.ts
xml
2016-03-09T23:14:01
2024-08-16T15:07:51
clients
bitwarden/clients
8,877
356
```xml #! /usr/bin/env -S node --no-warnings --loader ts-node/esm/transpile-only // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // // path_to_url // // Unless required by applicable law or agreed to in writing, // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // specific language governing permissions and limitations import * as fs from 'node:fs'; import * as Path from 'node:path'; import commandLineArgs from 'command-line-args'; import { finished as eos } from 'node:stream/promises'; // @ts-ignore import { parse as bignumJSONParse } from 'json-bignum'; import { RecordBatchReader, RecordBatchFileWriter, RecordBatchStreamWriter } from '../index.ts'; const argv = commandLineArgs(cliOpts(), { partial: true }); const jsonPaths = [...(argv.json || [])]; const arrowPaths = [...(argv.arrow || [])]; (async () => { if (jsonPaths.length === 0 || arrowPaths.length === 0 || (jsonPaths.length !== arrowPaths.length)) { return print_usage(); } await Promise.all(jsonPaths.map(async (path, i) => { const RecordBatchWriter = argv.format !== 'stream' ? RecordBatchFileWriter : RecordBatchStreamWriter; const reader = RecordBatchReader.from(bignumJSONParse( await fs.promises.readFile(Path.resolve(path), 'utf8'))); const jsonToArrow = reader .pipe(RecordBatchWriter.throughNode()) .pipe(fs.createWriteStream(arrowPaths[i])); await eos(jsonToArrow); })); return; })() .then((x) => x ?? 0, (e) => { e && process.stderr.write(`${e}`); return process.exitCode || 1; }).then((code = 0) => process.exit(code)); function cliOpts() { return [ { type: String, name: 'format', alias: 'f', multiple: false, defaultValue: 'file', description: 'The Arrow format to write, either "file" or "stream"' }, { type: String, name: 'arrow', alias: 'a', multiple: true, defaultValue: [], description: 'The Arrow file[s] to write' }, { type: String, name: 'json', alias: 'j', multiple: true, defaultValue: [], description: 'The JSON file[s] to read' } ]; } function print_usage() { console.log(require('command-line-usage')([ { header: 'json-to-arrow', content: 'Script for converting a JSON Arrow file to a binary Arrow file' }, { header: 'Synopsis', content: [ '$ json-to-arrow.ts -j in.json -a out.arrow -f stream' ] }, { header: 'Options', optionList: [ ...cliOpts(), { name: 'help', description: 'Print this usage guide.' } ] }, ])); return 1; } ```
/content/code_sandbox/js/bin/json-to-arrow.ts
xml
2016-02-17T08:00:23
2024-08-16T19:00:48
arrow
apache/arrow
14,094
686
```xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.4.0-M1</version> <relativePath /> <!-- lookup parent from repository --> </parent> <groupId>oz.native.sample</groupId> <artifactId>function-sample-aws-serverless-web-native</artifactId> <version>0.0.1-SNAPSHOT</version><!-- @releaser:version-check-off --> <name>function-sample-aws-serverless-web-native</name> <description>Sample of AWS with Spring Native</description> <properties> <java.version>21</java.version> <spring-cloud.version>2024.0.0-SNAPSHOT</spring-cloud.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.amazonaws.serverless</groupId> <artifactId>aws-serverless-java-container-springboot3</artifactId> <version>2.0.0-SNAPSHOT</version><!-- @releaser:version-check-off --> </dependency> <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-lambda-java-events</artifactId> <version>3.9.0</version> </dependency> <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-lambda-java-core</artifactId> <version>1.1.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <profiles> <profile> <id>native</id> <build> <plugins> <plugin> <groupId>org.graalvm.buildtools</groupId> <artifactId>native-maven-plugin</artifactId> <configuration> <buildArgs> <buildArg>--enable-url-protocols=http --enable-preview</buildArg> </buildArgs> </configuration> <executions> <execution> <goals> <goal>build</goal> </goals> <phase>package</phase> </execution> <execution> <id>test</id> <goals> <goal>test</goal> </goals> <phase>test</phase> </execution> </executions> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <id>native-zip</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <inherited>false</inherited> </execution> </executions> <configuration> <descriptors> <descriptor>src/assembly/native.xml</descriptor> </descriptors> </configuration> </plugin> </plugins> </build> </profile> </profiles> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <jvmArguments>-agentlib:native-image-agent=config-merge-dir=src/main/resources/META-INF/native-image/ --enable-preview </jvmArguments> <compilerArguments>--enable-preview </compilerArguments> </configuration> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <id>java-zip</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <inherited>false</inherited> </execution> </executions> <configuration> <descriptors> <descriptor>src/assembly/java.xml</descriptor> </descriptors> </configuration> </plugin> </plugins> </build> </project> ```
/content/code_sandbox/spring-cloud-function-samples/function-sample-aws-serverless-web-native/pom.xml
xml
2016-09-22T02:34:34
2024-08-16T08:19:07
spring-cloud-function
spring-cloud/spring-cloud-function
1,032
1,224
```xml /* * Wire * * This program is free software: you can redistribute it and/or modify * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * along with this program. If not, see path_to_url * */ /** * Return link to Google Maps. * * @param latitude Latitude of location * @param longitude Longitude of location * @param name Name of location * @param zoom Map zoom level * @returns URL to location in Google Maps */ export function getMapsUrl(latitude: number, longitude: number, name: string, zoom: string): string { const baseUrl = 'path_to_url const nameParam = name ? `place/${name}/` : ''; const locationParam = `@${latitude},${longitude}`; const zoomParam = zoom ? `,${zoom}z` : ''; return `${baseUrl}${nameParam}${locationParam}${zoomParam}`; } ```
/content/code_sandbox/src/script/util/LocationUtil.ts
xml
2016-07-21T15:34:05
2024-08-16T11:40:13
wire-webapp
wireapp/wire-webapp
1,125
229
```xml import type yargs from '@bpinternal/yargs-extra' // eslint-disable-next-line no-duplicate-imports import type { YargsConfig, YargsSchema } from '@bpinternal/yargs-extra' export type CommandPositionalOption = yargs.PositionalOptions & { positional: true; idx: number } export type CommandNamedOption = YargsSchema[string] & { positional?: false } export type CommandOption = CommandPositionalOption | CommandNamedOption export type CommandSchema = Record<string, CommandOption> export type CommandArgv<C extends CommandDefinition = CommandDefinition> = YargsConfig<C['schema']> & { /** * Ignored: fixes weird typing issue */ _?: string } export type CommandDefinition<S extends CommandSchema = CommandSchema> = { schema: S description?: string alias?: string } export type CommandImplementation<C extends CommandDefinition = CommandDefinition> = ( argv: CommandArgv<C> ) => Promise<{ exitCode: number }> export type CommandLeaf<C extends CommandDefinition = CommandDefinition> = C & { handler: CommandImplementation<C> } ```
/content/code_sandbox/packages/cli/src/typings.ts
xml
2016-11-16T21:57:59
2024-08-16T18:45:35
botpress
botpress/botpress
12,401
236
```xml import MaskedPattern, { MaskedPatternState, type MaskedPatternOptions } from './pattern'; import { AppendFlags } from './base'; import IMask from '../core/holder'; import ChangeDetails from '../core/change-details'; import { DIRECTION } from '../core/utils'; import { TailDetails } from '../core/tail-details'; import ContinuousTailDetails from '../core/continuous-tail-details'; export type MaskedEnumOptions = Omit<MaskedPatternOptions, 'mask'> & Pick<MaskedEnum, 'enum'> & Partial<Pick<MaskedEnum, 'matchValue'>>; export type MaskedEnumPatternOptions = MaskedPatternOptions & Partial<Pick<MaskedEnum, 'enum' | 'matchValue'>>; /** Pattern which validates enum values */ export default class MaskedEnum extends MaskedPattern { declare enum: Array<string>; /** Match enum value */ declare matchValue: (enumStr: string, inputStr: string, matchFrom: number) => boolean; static DEFAULTS: typeof MaskedPattern.DEFAULTS & Pick<MaskedEnum, 'matchValue'> = { ...MaskedPattern.DEFAULTS, matchValue: (estr, istr, matchFrom) => estr.indexOf(istr, matchFrom) === matchFrom, }; constructor (opts?: MaskedEnumOptions) { super({ ...MaskedEnum.DEFAULTS, ...opts, } as MaskedPatternOptions); // mask will be created in _update } override updateOptions (opts: Partial<MaskedEnumOptions>) { super.updateOptions(opts); } override _update (opts: Partial<MaskedEnumOptions>) { const { enum: enum_, ...eopts }: MaskedEnumPatternOptions = opts; if (enum_) { const lengths = enum_.map(e => e.length); const requiredLength = Math.min(...lengths); const optionalLength = Math.max(...lengths) - requiredLength; eopts.mask = '*'.repeat(requiredLength); if (optionalLength) eopts.mask += '[' + '*'.repeat(optionalLength) + ']'; this.enum = enum_; } super._update(eopts); } override _appendCharRaw (ch: string, flags: AppendFlags<MaskedPatternState>={}): ChangeDetails { const matchFrom = Math.min(this.nearestInputPos(0, DIRECTION.FORCE_RIGHT), this.value.length); const matches = this.enum.filter(e => this.matchValue(e, this.unmaskedValue + ch, matchFrom)); if (matches.length) { if (matches.length === 1) { this._forEachBlocksInRange(0, this.value.length, (b, bi) => { const mch = matches[0][bi]; if (bi >= this.value.length || mch === b.value) return; b.reset(); b._appendChar(mch, flags); }); } const d = super._appendCharRaw(matches[0][this.value.length], flags); if (matches.length === 1) { matches[0].slice(this.unmaskedValue.length).split('').forEach(mch => d.aggregate(super._appendCharRaw(mch))); } return d; } return new ChangeDetails({ skip: !this.isComplete }); } override extractTail (fromPos: number=0, toPos: number=this.displayValue.length): TailDetails { // just drop tail return new ContinuousTailDetails('', fromPos); } override remove (fromPos: number=0, toPos: number=this.displayValue.length): ChangeDetails { if (fromPos === toPos) return new ChangeDetails(); const matchFrom = Math.min(super.nearestInputPos(0, DIRECTION.FORCE_RIGHT), this.value.length); let pos: number; for (pos = fromPos; pos >= 0; --pos) { const matches = this.enum.filter(e => this.matchValue(e, this.value.slice(matchFrom, pos), matchFrom)); if (matches.length > 1) break; } const details = super.remove(pos, toPos); details.tailShift += pos - fromPos; return details; } override get isComplete (): boolean { return this.enum.indexOf(this.value) >= 0; } } IMask.MaskedEnum = MaskedEnum; ```
/content/code_sandbox/packages/imask/src/masked/enum.ts
xml
2016-11-10T13:04:29
2024-08-16T15:16:18
imaskjs
uNmAnNeR/imaskjs
4,881
936
```xml import React, { Ref } from 'react'; import { HTMLFieldProps, connectField, filterDOMProps } from 'uniforms'; export type TextFieldProps = HTMLFieldProps< string, HTMLDivElement, { inputRef?: Ref<HTMLInputElement> } >; function Text({ autoComplete, disabled, id, inputRef, label, name, onChange, placeholder, readOnly, type, value, ...props }: TextFieldProps) { return ( <div {...filterDOMProps(props)}> {label && <label htmlFor={id}>{label}</label>} <input autoComplete={autoComplete} disabled={disabled} id={id} name={name} onChange={event => onChange(event.target.value === '' ? undefined : event.target.value) } placeholder={placeholder} readOnly={readOnly} ref={inputRef} type={type} value={value ?? ''} /> </div> ); } Text.defaultProps = { type: 'text' }; export default connectField<TextFieldProps>(Text, { kind: 'leaf' }); ```
/content/code_sandbox/packages/uniforms-unstyled/src/TextField.tsx
xml
2016-05-10T13:08:50
2024-08-13T11:27:18
uniforms
vazco/uniforms
1,934
237
```xml /// <reference types="../../../../types/cypress" /> import { VBtn } from '../VBtn' // Utilities import { createRouter, createWebHistory } from 'vue-router' import { generate, gridOn } from '@/../cypress/templates' const anchor = { href: '#my-anchor', hash: 'my-anchor', } // TODO: generate these from types const colors = ['success', 'info', 'warning', 'error', 'invalid'] const sizes = ['x-small', 'small', 'default', 'large', 'x-large'] as const const densities = ['default', 'comfortable', 'compact'] as const const variants = ['elevated', 'flat', 'tonal', 'outlined', 'text', 'plain'] as const const props = { color: colors, // variant: variants, // disabled: false, // loading: false, } const stories = { 'Default button': <VBtn>Basic button</VBtn>, 'Small success button': <VBtn color="success" size="small">Completed!</VBtn>, 'Large, plain button w/ error': <VBtn color="error" variant="plain" size="large">Whoops</VBtn>, Loading: ( <div style={{ display: 'flex', gap: '1.2rem' }}> <VBtn>{{ loader: () => <span>Loading...</span>, default: () => 'Default Content' }}</VBtn> <VBtn loading>{{ loader: () => <span>Loading...</span>, default: () => 'Default Content' }}</VBtn> <VBtn loading>{{ loader: () => <span>Loading...</span> }}</VBtn> <VBtn loading>Default Content</VBtn> </div> ), Icon: <VBtn icon="$vuetify" color="pink"></VBtn>, 'Density + size': gridOn(densities, sizes, (density, size) => <VBtn size={ size } density={ density }>{ size }</VBtn> ), Variants: gridOn(['no color', 'primary'], variants, (color, variant) => <VBtn color={ color } variant={ variant }>{ variant }</VBtn> ), 'Disabled variants': gridOn(['no color', 'primary'], variants, (color, variant) => <VBtn disabled color={ color } variant={ variant }>{ variant }</VBtn> ), Stacked: gridOn([undefined], variants, (_, variant) => <VBtn stacked prependIcon="$vuetify" variant={ variant }>{ variant }</VBtn> ), } // Actual tests describe('VBtn', () => { describe('color', () => { it('supports default color props', () => { cy.mount(() => ( <> { colors.map(color => ( <VBtn color={ color } class="text-capitalize"> { color } button </VBtn> ))} </> )) .get('button') .should('have.length', colors.length) .then(subjects => { Array.from(subjects).forEach((subject, idx) => { expect(subject).to.contain(colors[idx]) }) }) }) }) describe('icons', () => { it('adds the icon class when true', () => { cy.mount(<VBtn icon></VBtn>) .get('button') .should('have.class', 'v-btn--icon') }) it('renders an icon inside', () => { // TODO: Render VIcon instead of emoji cy.mount(<VBtn icon><span style="font-size: 1.5rem;"></span></VBtn>) .get('button') .should('have.text', '') }) }) describe('plain', () => { it('should have the plain class when variant is plain', () => { cy.mount(<VBtn variant="plain">Plain</VBtn>) .get('button') .should('have.class', 'v-btn--variant-plain') }) }) describe('tag', () => { it('renders the proper tag instead of a button', () => { cy.mount(<VBtn tag="custom-tag">Click me</VBtn>) .get('button') .should('not.exist') .get('custom-tag') .should('have.text', 'Click me') }) }) describe('elevation', () => { it('should have the correct elevation', () => { cy.mount(<VBtn elevation={ 24 } />) .get('button') .should('have.class', 'elevation-24') }) }) describe('events', () => { it('emits native click events', () => { const click = cy.stub().as('click') cy.mount(<VBtn onClick={ click }>Click me</VBtn>) .get('button') .click() cy.get('@click') .should('have.been.called', 1) cy.setProps({ href: undefined, to: '#my-anchor' }) cy.get('@click') .should('have.been.called', 2) }) // Pending test, is "toggle" even going to be emitted anymore? it.skip('emits toggle when used within a button group', () => { // const register = jest.fn() // const unregister = jest.fn() // const toggle = jest.fn() // const wrapper = mountFunction({ // provide: { // btnToggle: { register, unregister }, // }, // methods: { toggle }, // }) // wrapper.trigger('click') // expect(toggle).toHaveBeenCalled() }) }) // These tests were copied over from the previous Jest tests, // but they are breaking because the features have not been implemented describe.skip('disabled', () => { // The actual behavior here is working, but the color class name isn't being removed // We can _technically_ test that the background is NOT the color's background, // but it's a bit brittle and I think it'll be better to check against the class name it('should not add color classes if disabled', () => { cy.mount(<VBtn color="success" disabled></VBtn>) .get('button') .should('have.class', 'bg-success') .get('button') .should('have.class', 'v-btn--disabled') .should('not.have.class', 'bg-success') }) }) describe.skip('activeClass', () => { it('should use custom active-class', () => { cy.mount(<VBtn activeClass="my-active-class">Active Class</VBtn>) .get('.my-active-class') .should('exist') }) }) // v-btn--tile isn't implemented at all describe.skip('tile', () => { it('applies the tile class when true', () => { cy.mount(<VBtn tile />) .get('button') .should('contain.class', 'v-btn--tile') }) it('does not apply the tile class when false', () => { cy.mount(<VBtn tile={ false } />) .get('button') .should('not.contain.class', 'v-btn--tile') }) }) describe('href', () => { it('should render an <a> tag when using href prop', () => { cy.mount(<VBtn href={ anchor.href }>Click me</VBtn>) .get('.v-btn') .click() cy.get('a') .should('contain.text', 'Click me') .should('have.focus') cy.hash() .should('contain', anchor.hash) }) it('should change route when using to prop', () => { const router = createRouter({ history: createWebHistory(), routes: [ { path: '/', component: { template: 'Home' }, }, { path: '/about', component: { template: 'About' }, }, ], }) cy.mount(<VBtn to="/about">Click me</VBtn>, { global: { plugins: [router] } }) .get('.v-btn') .click() cy.get('a') .should('contain.text', 'Click me') .should('have.focus') cy.url() .should('contain', '/about') }) }) describe('value', () => { it('should pass string values', () => { const stringValue = 'Foobar' cy.mount(<VBtn value={ stringValue }></VBtn>) .get('button') .should('have.value', stringValue) }) it('should stringify object', () => { const objectValue = { value: {} } cy.mount(<VBtn value={ objectValue }></VBtn>) .get('button') .should('have.value', JSON.stringify(objectValue, null, 0)) }) it('should stringify number', () => { const numberValue = 15 cy.mount(<VBtn value={ numberValue }></VBtn>) .get('button') .should('have.value', JSON.stringify(numberValue, null, 0)) }) it('should stringify array', () => { const arrayValue = ['foo', 'bar'] cy.mount(<VBtn value={ arrayValue }></VBtn>) .get('button') .should('have.value', JSON.stringify(arrayValue, null, 0)) }) it('should not generate a fallback value when not provided', () => { cy.mount(<VBtn></VBtn>) .get('button') .should('not.have.value') }) }) describe('Reactivity', () => { // tile is not implemented. it.skip('tile', () => { cy.mount(<VBtn tile>My button</VBtn>) .get('button') .should('contain.class', 'v-btn--tile') cy.setProps({ tile: false }) cy.get('button') .should('not.contain.class', 'v-btn--tile') }) it('disabled', () => { cy.mount(<VBtn color="success" disabled></VBtn>) .get('button') .should('have.class', 'v-btn--disabled') cy.setProps({ disabled: false }) cy.get('button') .should('not.have.class', 'v-btn--disabled') }) it('activeClass', () => { cy.mount(<VBtn activeClass="my-active-class">Active Class</VBtn>) .setProps({ activeClass: 'different-class' }) cy.get('.different-class') .should('not.exist') }) it('plain', () => { cy.mount(<VBtn variant="plain">Plain</VBtn>) .get('button') .should('have.class', 'v-btn--variant-plain') cy.setProps({ variant: 'default' }) cy.get('button') .should('not.have.class', 'v-btn--variant-plain') }) }) describe('Showcase', () => { generate({ stories, props, component: VBtn }) }) }) ```
/content/code_sandbox/packages/vuetify/src/components/VBtn/__tests__/VBtn.spec.cy.tsx
xml
2016-09-12T00:39:35
2024-08-16T20:06:39
vuetify
vuetifyjs/vuetify
39,539
2,438
```xml <?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11198.2" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="QKJ-E5-Qhp"> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> <!--Persitent Container View Controller--> <scene sceneID="hUm-eP-0kL"> <objects> <tableViewController id="QKJ-E5-Qhp" customClass="PersitentContainerViewController" customModule="iOS_10_Sampler" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="l3s-Lo-5q4"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <prototypes> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="cell" textLabel="mb5-U3-X3y" detailTextLabel="rUx-BA-8Ho" style="IBUITableViewCellStyleSubtitle" id="Sdp-Jl-uoR"> <rect key="frame" x="0.0" y="92" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Sdp-Jl-uoR" id="R7O-cs-bXg"> <frame key="frameInset" width="375" height="43"/> <autoresizingMask key="autoresizingMask"/> <subviews> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="mb5-U3-X3y"> <frame key="frameInset" minX="15" minY="4" width="34" height="21"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="rUx-BA-8Ho"> <frame key="frameInset" minX="15" minY="25" width="44" height="15"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="12"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> </subviews> </tableViewCellContentView> </tableViewCell> </prototypes> <connections> <outlet property="dataSource" destination="QKJ-E5-Qhp" id="txv-pc-zuf"/> <outlet property="delegate" destination="QKJ-E5-Qhp" id="vKO-nv-rj8"/> </connections> </tableView> <toolbarItems/> <navigationItem key="navigationItem" id="HXR-aL-vIK"> <barButtonItem key="rightBarButtonItem" systemItem="add" id="ahJ-7v-mJT"> <connections> <action selector="add:" destination="QKJ-E5-Qhp" id="Ztj-em-BDq"/> </connections> </barButtonItem> </navigationItem> <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/> </tableViewController> <placeholder placeholderIdentifier="IBFirstResponder" id="nSU-pq-Iu4" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="820" y="172.26386806596702"/> </scene> </scenes> </document> ```
/content/code_sandbox/iOS-10-Sampler/Samples/PersistentContainer.storyboard
xml
2016-09-03T03:24:29
2024-08-07T10:13:05
iOS-10-Sampler
shu223/iOS-10-Sampler
3,313
1,116
```xml export * from "./document-background"; ```
/content/code_sandbox/src/file/document/document-background/index.ts
xml
2016-03-26T23:43:56
2024-08-16T13:02:47
docx
dolanmiu/docx
4,139
8
```xml <?xml version="1.0" encoding="UTF-8"?> <spirit:component xmlns:xilinx="path_to_url" xmlns:spirit="path_to_url" xmlns:xsi="path_to_url"> <spirit:vendor>xilinx.com</spirit:vendor> <spirit:library>user</spirit:library> <spirit:name>audio_codec_ctrl</spirit:name> <spirit:version>1.0</spirit:version> <spirit:busInterfaces> <spirit:busInterface> <spirit:name>S_AXI</spirit:name> <spirit:busType spirit:vendor="xilinx.com" spirit:library="interface" spirit:name="aximm" spirit:version="1.0"/> <spirit:abstractionType spirit:vendor="xilinx.com" spirit:library="interface" spirit:name="aximm_rtl" spirit:version="1.0"/> <spirit:slave> <spirit:memoryMapRef spirit:memoryMapRef="S_AXI"/> </spirit:slave> <spirit:portMaps> <spirit:portMap> <spirit:logicalPort> <spirit:name>AWADDR</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_AWADDR</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>AWVALID</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_AWVALID</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>AWREADY</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_AWREADY</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>WDATA</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_WDATA</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>WSTRB</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_WSTRB</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>WVALID</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_WVALID</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>WREADY</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_WREADY</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>BRESP</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_BRESP</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>BVALID</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_BVALID</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>BREADY</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_BREADY</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>ARADDR</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_ARADDR</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>ARVALID</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_ARVALID</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>ARREADY</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_ARREADY</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>RDATA</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_RDATA</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>RRESP</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_RRESP</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>RVALID</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_RVALID</spirit:name> </spirit:physicalPort> </spirit:portMap> <spirit:portMap> <spirit:logicalPort> <spirit:name>RREADY</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_RREADY</spirit:name> </spirit:physicalPort> </spirit:portMap> </spirit:portMaps> </spirit:busInterface> <spirit:busInterface> <spirit:name>S_AXI_ARESETN</spirit:name> <spirit:busType spirit:vendor="xilinx.com" spirit:library="signal" spirit:name="reset" spirit:version="1.0"/> <spirit:abstractionType spirit:vendor="xilinx.com" spirit:library="signal" spirit:name="reset_rtl" spirit:version="1.0"/> <spirit:slave/> <spirit:portMaps> <spirit:portMap> <spirit:logicalPort> <spirit:name>RST</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_ARESETN</spirit:name> </spirit:physicalPort> </spirit:portMap> </spirit:portMaps> <spirit:parameters> <spirit:parameter> <spirit:name>POLARITY</spirit:name> <spirit:value spirit:id="BUSIFPARAM_VALUE.S_AXI_ARESETN.POLARITY" spirit:choiceRef="choice_list_9d8b0d81">ACTIVE_LOW</spirit:value> </spirit:parameter> </spirit:parameters> </spirit:busInterface> <spirit:busInterface> <spirit:name>S_AXI_ACLK</spirit:name> <spirit:busType spirit:vendor="xilinx.com" spirit:library="signal" spirit:name="clock" spirit:version="1.0"/> <spirit:abstractionType spirit:vendor="xilinx.com" spirit:library="signal" spirit:name="clock_rtl" spirit:version="1.0"/> <spirit:slave/> <spirit:portMaps> <spirit:portMap> <spirit:logicalPort> <spirit:name>CLK</spirit:name> </spirit:logicalPort> <spirit:physicalPort> <spirit:name>S_AXI_ACLK</spirit:name> </spirit:physicalPort> </spirit:portMap> </spirit:portMaps> <spirit:parameters> <spirit:parameter> <spirit:name>ASSOCIATED_BUSIF</spirit:name> <spirit:value spirit:id="BUSIFPARAM_VALUE.S_AXI_ACLK.ASSOCIATED_BUSIF">S_AXI</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>ASSOCIATED_RESET</spirit:name> <spirit:value spirit:id="BUSIFPARAM_VALUE.S_AXI_ACLK.ASSOCIATED_RESET">S_AXI_ARESETN</spirit:value> </spirit:parameter> </spirit:parameters> </spirit:busInterface> </spirit:busInterfaces> <spirit:memoryMaps> <spirit:memoryMap> <spirit:name>S_AXI</spirit:name> <spirit:addressBlock> <spirit:name>reg0</spirit:name> <spirit:baseAddress spirit:format="bitString" spirit:resolve="user" spirit:bitStringLength="32">0</spirit:baseAddress> <spirit:range spirit:format="long" spirit:resolve="generated">65536</spirit:range> <spirit:width spirit:format="long">32</spirit:width> <spirit:usage>register</spirit:usage> </spirit:addressBlock> </spirit:memoryMap> </spirit:memoryMaps> <spirit:model> <spirit:views> <spirit:view> <spirit:name>xilinx_anylanguagesynthesis</spirit:name> <spirit:displayName>Synthesis</spirit:displayName> <spirit:envIdentifier>:vivado.xilinx.com:synthesis</spirit:envIdentifier> <spirit:language>VHDL</spirit:language> <spirit:modelName>i2s_ctrl</spirit:modelName> <spirit:fileSetRef> <spirit:localName>xilinx_anylanguagesynthesis_view_fileset</spirit:localName> </spirit:fileSetRef> <spirit:parameters> <spirit:parameter> <spirit:name>viewChecksum</spirit:name> <spirit:value>540670c0</spirit:value> </spirit:parameter> </spirit:parameters> </spirit:view> <spirit:view> <spirit:name>xilinx_anylanguagebehavioralsimulation</spirit:name> <spirit:displayName>Simulation</spirit:displayName> <spirit:envIdentifier>:vivado.xilinx.com:simulation</spirit:envIdentifier> <spirit:language>VHDL</spirit:language> <spirit:modelName>i2s_ctrl</spirit:modelName> <spirit:fileSetRef> <spirit:localName>xilinx_anylanguagebehavioralsimulation_view_fileset</spirit:localName> </spirit:fileSetRef> <spirit:parameters> <spirit:parameter> <spirit:name>viewChecksum</spirit:name> <spirit:value>540670c0</spirit:value> </spirit:parameter> </spirit:parameters> </spirit:view> <spirit:view> <spirit:name>xilinx_xpgui</spirit:name> <spirit:displayName>UI Layout</spirit:displayName> <spirit:envIdentifier>:vivado.xilinx.com:xgui.ui</spirit:envIdentifier> <spirit:fileSetRef> <spirit:localName>xilinx_xpgui_view_fileset</spirit:localName> </spirit:fileSetRef> <spirit:parameters> <spirit:parameter> <spirit:name>viewChecksum</spirit:name> <spirit:value>87b87994</spirit:value> </spirit:parameter> </spirit:parameters> </spirit:view> </spirit:views> <spirit:ports> <spirit:port> <spirit:name>bclk</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>STD_LOGIC</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>lrclk</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>STD_LOGIC</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>sdata_i</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>STD_LOGIC</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>sdata_o</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>STD_LOGIC</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>codec_address</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:vector> <spirit:left spirit:format="long">1</spirit:left> <spirit:right spirit:format="long">0</spirit:right> </spirit:vector> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic_vector</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> <spirit:driver> <spirit:defaultValue spirit:format="long">3</spirit:defaultValue> </spirit:driver> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_aclk</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_aresetn</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_awaddr</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:vector> <spirit:left spirit:format="long" spirit:resolve="dependent" spirit:dependency="(spirit:decode(id(&apos;MODELPARAM_VALUE.C_S_AXI_ADDR_WIDTH&apos;)) - 1)">31</spirit:left> <spirit:right spirit:format="long">0</spirit:right> </spirit:vector> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic_vector</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> <spirit:driver> <spirit:defaultValue spirit:format="long">0</spirit:defaultValue> </spirit:driver> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_awvalid</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> <spirit:driver> <spirit:defaultValue spirit:format="long">0</spirit:defaultValue> </spirit:driver> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_wdata</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:vector> <spirit:left spirit:format="long" spirit:resolve="dependent" spirit:dependency="(spirit:decode(id(&apos;MODELPARAM_VALUE.C_S_AXI_DATA_WIDTH&apos;)) - 1)">31</spirit:left> <spirit:right spirit:format="long">0</spirit:right> </spirit:vector> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic_vector</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> <spirit:driver> <spirit:defaultValue spirit:format="long">0</spirit:defaultValue> </spirit:driver> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_wstrb</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:vector> <spirit:left spirit:format="long" spirit:resolve="dependent" spirit:dependency="((spirit:decode(id(&apos;MODELPARAM_VALUE.C_S_AXI_DATA_WIDTH&apos;)) / 8) - 1)">3</spirit:left> <spirit:right spirit:format="long">0</spirit:right> </spirit:vector> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic_vector</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> <spirit:driver> <spirit:defaultValue spirit:format="long">1</spirit:defaultValue> </spirit:driver> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_wvalid</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> <spirit:driver> <spirit:defaultValue spirit:format="long">0</spirit:defaultValue> </spirit:driver> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_bready</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> <spirit:driver> <spirit:defaultValue spirit:format="long">0</spirit:defaultValue> </spirit:driver> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_araddr</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:vector> <spirit:left spirit:format="long" spirit:resolve="dependent" spirit:dependency="(spirit:decode(id(&apos;MODELPARAM_VALUE.C_S_AXI_ADDR_WIDTH&apos;)) - 1)">31</spirit:left> <spirit:right spirit:format="long">0</spirit:right> </spirit:vector> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic_vector</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> <spirit:driver> <spirit:defaultValue spirit:format="long">0</spirit:defaultValue> </spirit:driver> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_arvalid</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> <spirit:driver> <spirit:defaultValue spirit:format="long">0</spirit:defaultValue> </spirit:driver> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_rready</spirit:name> <spirit:wire> <spirit:direction>in</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> <spirit:driver> <spirit:defaultValue spirit:format="long">0</spirit:defaultValue> </spirit:driver> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_arready</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_rdata</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:vector> <spirit:left spirit:format="long" spirit:resolve="dependent" spirit:dependency="(spirit:decode(id(&apos;MODELPARAM_VALUE.C_S_AXI_DATA_WIDTH&apos;)) - 1)">31</spirit:left> <spirit:right spirit:format="long">0</spirit:right> </spirit:vector> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic_vector</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_rresp</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:vector> <spirit:left spirit:format="long">1</spirit:left> <spirit:right spirit:format="long">0</spirit:right> </spirit:vector> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic_vector</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_rvalid</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_wready</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_bresp</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:vector> <spirit:left spirit:format="long">1</spirit:left> <spirit:right spirit:format="long">0</spirit:right> </spirit:vector> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic_vector</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_bvalid</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> <spirit:port> <spirit:name>s_axi_awready</spirit:name> <spirit:wire> <spirit:direction>out</spirit:direction> <spirit:wireTypeDefs> <spirit:wireTypeDef> <spirit:typeName>std_logic</spirit:typeName> <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef> <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef> </spirit:wireTypeDef> </spirit:wireTypeDefs> </spirit:wire> </spirit:port> </spirit:ports> <spirit:modelParameters> <spirit:modelParameter xsi:type="spirit:nameValueTypeType" spirit:dataType="integer"> <spirit:name>C_S_AXI_DATA_WIDTH</spirit:name> <spirit:displayName>C S Axi Data Width</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_S_AXI_DATA_WIDTH">32</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="integer"> <spirit:name>C_S_AXI_ADDR_WIDTH</spirit:name> <spirit:displayName>C S Axi Addr Width</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_S_AXI_ADDR_WIDTH">32</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="std_logic_vector"> <spirit:name>C_S_AXI_MIN_SIZE</spirit:name> <spirit:displayName>C S Axi Min Size</spirit:displayName> <spirit:value spirit:format="bitString" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_S_AXI_MIN_SIZE" spirit:bitStringLength="32">0x000001FF</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="integer"> <spirit:name>C_USE_WSTRB</spirit:name> <spirit:displayName>C Use Wstrb</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_USE_WSTRB">0</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="integer"> <spirit:name>C_DPHASE_TIMEOUT</spirit:name> <spirit:displayName>C Dphase Timeout</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_DPHASE_TIMEOUT">8</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="std_logic_vector"> <spirit:name>C_BASEADDR</spirit:name> <spirit:displayName>C Baseaddr</spirit:displayName> <spirit:value spirit:format="bitString" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_BASEADDR" spirit:bitStringLength="32">0xFFFFFFFF</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="std_logic_vector"> <spirit:name>C_HIGHADDR</spirit:name> <spirit:displayName>C Highaddr</spirit:displayName> <spirit:value spirit:format="bitString" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_HIGHADDR" spirit:bitStringLength="32">0x00000000</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="string"> <spirit:name>C_FAMILY</spirit:name> <spirit:value spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_FAMILY">virtex6</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="integer"> <spirit:name>C_NUM_REG</spirit:name> <spirit:displayName>C Num Reg</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_NUM_REG">1</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="integer"> <spirit:name>C_NUM_MEM</spirit:name> <spirit:displayName>C Num Mem</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_NUM_MEM">1</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="integer"> <spirit:name>C_SLV_AWIDTH</spirit:name> <spirit:displayName>C Slv Awidth</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_SLV_AWIDTH">32</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="integer"> <spirit:name>C_SLV_DWIDTH</spirit:name> <spirit:displayName>C Slv Dwidth</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_SLV_DWIDTH">32</spirit:value> </spirit:modelParameter> <spirit:modelParameter spirit:dataType="std_logic_vector"> <spirit:name>C_CODEC_ADDRESS</spirit:name> <spirit:displayName>C Codec Address</spirit:displayName> <spirit:value spirit:format="bitString" spirit:resolve="generated" spirit:id="MODELPARAM_VALUE.C_CODEC_ADDRESS" spirit:bitStringLength="2">&quot;11&quot;</spirit:value> </spirit:modelParameter> </spirit:modelParameters> </spirit:model> <spirit:choices> <spirit:choice> <spirit:name>choice_list_9d8b0d81</spirit:name> <spirit:enumeration>ACTIVE_HIGH</spirit:enumeration> <spirit:enumeration>ACTIVE_LOW</spirit:enumeration> </spirit:choice> <spirit:choice> <spirit:name>choice_list_cdd3a8e6</spirit:name> <spirit:enumeration>&quot;00&quot;</spirit:enumeration> <spirit:enumeration>&quot;01&quot;</spirit:enumeration> <spirit:enumeration>&quot;10&quot;</spirit:enumeration> <spirit:enumeration>&quot;11&quot;</spirit:enumeration> </spirit:choice> </spirit:choices> <spirit:fileSets> <spirit:fileSet> <spirit:name>xilinx_anylanguagesynthesis_view_fileset</spirit:name> <spirit:file> <spirit:name>src/family_support.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/common_types.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/pselect_f.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/address_decoder.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/slave_attachment.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/axi_lite_ipif.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/user_logic.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/iis_deser.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/iis_ser.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/i2s_ctrl.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> <spirit:userFileType>CHECKSUM_d986a1de</spirit:userFileType> </spirit:file> </spirit:fileSet> <spirit:fileSet> <spirit:name>xilinx_anylanguagebehavioralsimulation_view_fileset</spirit:name> <spirit:file> <spirit:name>src/family_support.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/common_types.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/pselect_f.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/address_decoder.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/slave_attachment.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/axi_lite_ipif.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/user_logic.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/iis_deser.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/iis_ser.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> <spirit:file> <spirit:name>src/i2s_ctrl.vhd</spirit:name> <spirit:fileType>vhdlSource</spirit:fileType> </spirit:file> </spirit:fileSet> <spirit:fileSet> <spirit:name>xilinx_xpgui_view_fileset</spirit:name> <spirit:file> <spirit:name>xgui/audio_codec_ctrl_v1_0.tcl</spirit:name> <spirit:fileType>tclSource</spirit:fileType> <spirit:userFileType>CHECKSUM_87b87994</spirit:userFileType> <spirit:userFileType>XGUI_VERSION_2</spirit:userFileType> </spirit:file> </spirit:fileSet> </spirit:fileSets> <spirit:description>Audio CODEC controller using Analog Devices CODEC</spirit:description> <spirit:parameters> <spirit:parameter> <spirit:name>C_S_AXI_DATA_WIDTH</spirit:name> <spirit:displayName>C S Axi Data Width</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="user" spirit:id="PARAM_VALUE.C_S_AXI_DATA_WIDTH">32</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_S_AXI_ADDR_WIDTH</spirit:name> <spirit:displayName>C S Axi Addr Width</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="user" spirit:id="PARAM_VALUE.C_S_AXI_ADDR_WIDTH">32</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_S_AXI_MIN_SIZE</spirit:name> <spirit:displayName>C S Axi Min Size</spirit:displayName> <spirit:value spirit:format="bitString" spirit:resolve="user" spirit:id="PARAM_VALUE.C_S_AXI_MIN_SIZE" spirit:bitStringLength="32">0x000001FF</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_USE_WSTRB</spirit:name> <spirit:displayName>C Use Wstrb</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="user" spirit:id="PARAM_VALUE.C_USE_WSTRB">0</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_DPHASE_TIMEOUT</spirit:name> <spirit:displayName>C Dphase Timeout</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="user" spirit:id="PARAM_VALUE.C_DPHASE_TIMEOUT">8</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_BASEADDR</spirit:name> <spirit:displayName>C Baseaddr</spirit:displayName> <spirit:value spirit:format="bitString" spirit:resolve="user" spirit:id="PARAM_VALUE.C_BASEADDR" spirit:bitStringLength="32">0xFFFFFFFF</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_HIGHADDR</spirit:name> <spirit:displayName>C Highaddr</spirit:displayName> <spirit:value spirit:format="bitString" spirit:resolve="user" spirit:id="PARAM_VALUE.C_HIGHADDR" spirit:bitStringLength="32">0x00000000</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_NUM_REG</spirit:name> <spirit:displayName>C Num Reg</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="user" spirit:id="PARAM_VALUE.C_NUM_REG">1</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_NUM_MEM</spirit:name> <spirit:displayName>C Num Mem</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="user" spirit:id="PARAM_VALUE.C_NUM_MEM">1</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_SLV_AWIDTH</spirit:name> <spirit:displayName>C Slv Awidth</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="user" spirit:id="PARAM_VALUE.C_SLV_AWIDTH">32</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_SLV_DWIDTH</spirit:name> <spirit:displayName>C Slv Dwidth</spirit:displayName> <spirit:value spirit:format="long" spirit:resolve="user" spirit:id="PARAM_VALUE.C_SLV_DWIDTH">32</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>Component_Name</spirit:name> <spirit:value spirit:resolve="user" spirit:id="PARAM_VALUE.Component_Name" spirit:order="1">i2s_ctrl_v1_0</spirit:value> </spirit:parameter> <spirit:parameter> <spirit:name>C_CODEC_ADDRESS</spirit:name> <spirit:displayName>Codec Address (addr1, addr0)</spirit:displayName> <spirit:value spirit:format="bitString" spirit:resolve="user" spirit:id="PARAM_VALUE.C_CODEC_ADDRESS" spirit:choiceRef="choice_list_cdd3a8e6" spirit:bitStringLength="2">&quot;11&quot;</spirit:value> </spirit:parameter> </spirit:parameters> <spirit:vendorExtensions> <xilinx:coreExtensions> <xilinx:supportedFamilies> <xilinx:family xilinx:lifeCycle="Production">virtex7</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">qvirtex7</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">kintex7</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">kintex7l</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">qkintex7</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">qkintex7l</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">artix7</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">artix7l</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">aartix7</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">qartix7</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">zynq</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">qzynq</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">azynq</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">spartan7</xilinx:family> <xilinx:family xilinx:lifeCycle="Production">zynquplus</xilinx:family> </xilinx:supportedFamilies> <xilinx:taxonomies> <xilinx:taxonomy>/UserIP</xilinx:taxonomy> </xilinx:taxonomies> <xilinx:displayName>audio_codec_controller</xilinx:displayName> <xilinx:definitionSource>package_project</xilinx:definitionSource> <xilinx:coreRevision>4</xilinx:coreRevision> <xilinx:upgrades> <xilinx:canUpgradeFrom>xilinx.com:user:i2s_ctrl:1.0</xilinx:canUpgradeFrom> </xilinx:upgrades> <xilinx:coreCreationDateTime>2018-01-20T03:18:42Z</xilinx:coreCreationDateTime> <xilinx:tags> <xilinx:tag xilinx:name="nopcore"/> <xilinx:tag xilinx:name="xilinx.com:user:i2s_ctrl:1.0_ARCHIVE_LOCATION">c:/xup/PYNQ_2_1_dev/audio_codec_ctrl_v1.0</xilinx:tag> <xilinx:tag xilinx:name="xilinx.com:user:audio_codec_ctrl:1.0_ARCHIVE_LOCATION">c:/xup/PYNQ_2_1_2017_4/ip_update/audio_codec_ctrl_v1.0</xilinx:tag> </xilinx:tags> </xilinx:coreExtensions> <xilinx:packagingInfo> <xilinx:xilinxVersion>2017.4</xilinx:xilinxVersion> <xilinx:checksum xilinx:scope="busInterfaces" xilinx:value="da618e65"/> <xilinx:checksum xilinx:scope="memoryMaps" xilinx:value="0673395c"/> <xilinx:checksum xilinx:scope="fileGroups" xilinx:value="9c4791cc"/> <xilinx:checksum xilinx:scope="ports" xilinx:value="2301b29b"/> <xilinx:checksum xilinx:scope="hdlParameters" xilinx:value="40610036"/> <xilinx:checksum xilinx:scope="parameters" xilinx:value="554382bc"/> </xilinx:packagingInfo> </spirit:vendorExtensions> </spirit:component> ```
/content/code_sandbox/boards/ip/audio_codec_ctrl_v1.0/component.xml
xml
2016-01-20T01:16:27
2024-08-16T18:54:03
PYNQ
Xilinx/PYNQ
1,931
10,616
```xml <?xml version="1.0" encoding="utf-8"?> <!-- mingkuang 2018-04-21 VC-LTL helper for Visual Studio.props --> <Project ToolsVersion="4.0" xmlns="path_to_url" InitialTargets="VC_LTL_PlatformPrepareForBuild_ltlvcrtWinXp"> <PropertyGroup> <!--XP--> <SupportWinXP>true</SupportWinXP> </PropertyGroup> <ImportGroup Label="PropertySheets"> <Import Project="$(MSBuildThisFileDirectory)ltlvcrt.props" Condition="Exists('$(MSBuildThisFileDirectory)ltlvcrt.props')"/> </ImportGroup> <Target Name="VC_LTL_PlatformPrepareForBuild_ltlvcrtWinXp"> <Warning Code="LTL2100" Text="VC-LTL helper for Visual Studio.props"/> </Target> </Project> ```
/content/code_sandbox/ltlvcrtWinXp.props
xml
2016-06-14T03:01:16
2024-08-12T19:23:19
VC-LTL
Chuyu-Team/VC-LTL
1,052
196
```xml <RelativeLayout xmlns:android="path_to_url" xmlns:tools="path_to_url" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"> <LinearLayout android:orientation="vertical" android:padding="10dip" android:id="@+id/linear_layout" android:layout_width="fill_parent" android:layout_height="wrap_content"> <!-- Text Label --> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:text="Category:" android:layout_marginBottom="5dp" /> <!-- Spinner Element --> <Spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/spinner_title" /> </LinearLayout> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="NEXT" android:id="@+id/button" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="137dp" /> </RelativeLayout> ```
/content/code_sandbox/Android/Spinners/app/src/main/res/layout/activity_main.xml
xml
2016-05-02T05:43:21
2024-08-16T06:51:39
journaldev
WebJournal/journaldev
1,314
316
```xml /* * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import isOdd = require( './index' ); // TESTS // // The function returns a boolean... { isOdd( 2 ); // $ExpectType boolean isOdd( 3 ); // $ExpectType boolean } // The compiler throws an error if the function is provided a value other than a number... { isOdd( true ); // $ExpectError isOdd( false ); // $ExpectError isOdd( null ); // $ExpectError isOdd( undefined ); // $ExpectError isOdd( [] ); // $ExpectError isOdd( {} ); // $ExpectError isOdd( ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { isOdd(); // $ExpectError isOdd( undefined, 123 ); // $ExpectError } ```
/content/code_sandbox/lib/node_modules/@stdlib/math/base/assert/is-odd/docs/types/test.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
234
```xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <epp xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xmlns:host="urn:ietf:params:xml:ns:host-1.0" xmlns:launch="urn:ietf:params:xml:ns:launch-1.0" xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0" xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" xmlns:fee12="urn:ietf:params:xml:ns:fee-0.12" xmlns:fee11="urn:ietf:params:xml:ns:fee-0.11" xmlns:mark="urn:ietf:params:xml:ns:mark-1.0" xmlns:fee="urn:ietf:params:xml:ns:fee-0.6"> <response> <result code="1500"> <msg>Command completed successfully; ending session</msg> </result> <trID> <clTRID>proxy-logout</clTRID> <svTRID>inlxipwsQKaXS3VmbKOmBA==-c</svTRID> </trID> </response> </epp> ```
/content/code_sandbox/proxy/src/test/resources/google/registry/proxy/logout_response.xml
xml
2016-02-29T20:16:48
2024-08-15T19:49:29
nomulus
google/nomulus
1,685
320
```xml /* * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ // TypeScript Version: 4.1 /// <reference types="@stdlib/types"/> import { Iterator as Iter, IterableIterator } from '@stdlib/types/iter'; // Define a union type representing both iterable and non-iterable iterators: type Iterator = Iter | IterableIterator; /** * Callback invoked with the skipped value. * * @param value - iterated value */ type Callback = ( value?: any ) => any; /** * Returns an iterator which skips the last value of a provided iterator. * * ## Notes * * - If an environment supports `Symbol.iterator` **and** a provided iterator is iterable, the returned iterator is iterable. * * @param iterator - input iterator * @param clbk - callback to invoke with the skipped value * @param thisArg - callback execution context * @returns iterator * * @example * var array2iterator = require( '@stdlib/array/to-iterator' ); * * var iter = iterPop( array2iterator( [ 1, 2 ] ) ); * * var v = iter.next().value; * // returns 1 * * var bool = iter.next().done; * // returns true */ declare function iterPop( iterator: Iterator, clbk?: Callback, thisArg?: any ): Iterator; // EXPORTS // export = iterPop; ```
/content/code_sandbox/lib/node_modules/@stdlib/iter/pop/docs/types/index.d.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
326
```xml <Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> <PropertyGroup Label="Configuration"> <SignAssembly>True</SignAssembly> <DelaySign>False</DelaySign> <DocumentationFile>$(TargetDir)bin\$(Configuration)\$(TargetFramework)\itext.bouncy-castle-fips-adapter.xml</DocumentationFile> <WarningLevel>0</WarningLevel> </PropertyGroup> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> </PropertyGroup> <PropertyGroup> <OutputType>library</OutputType> </PropertyGroup> <PropertyGroup> <AssemblyOriginatorKeyFile>itext.snk</AssemblyOriginatorKeyFile> </PropertyGroup> <PropertyGroup> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> <AssemblyName>itext.bouncy-castle-fips-adapter</AssemblyName> <RootNamespace /> </PropertyGroup> <PropertyGroup> <NoWarn>1701;1702;1591;1570;1572;1573;1574;1580;1584;1658</NoWarn> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\itext.commons\itext.commons.csproj" /> </ItemGroup> <ItemGroup> <Reference Include="bc-fips-1.0.2"> <HintPath>lib\bc-fips\bc-fips-1.0.2.dll</HintPath> </Reference> <Reference Include="bcpkix-fips-1.0.2"> <HintPath>lib\bc-fips\bcpkix-fips-1.0.2.dll</HintPath> </Reference> </ItemGroup> </Project> ```
/content/code_sandbox/itext/itext.bouncy-castle-fips-adapter/itext.bouncy-castle-fips-adapter.csproj
xml
2016-06-16T14:34:03
2024-08-14T11:37:28
itext-dotnet
itext/itext-dotnet
1,630
392
```xml /** * ChangeOperatorTutorial.tsx * * Tutorial that exercises the change operator */ import * as React from "react" import { ITutorial, ITutorialMetadata, ITutorialStage } from "./../ITutorial" import * as Notes from "./../Notes" import * as Stages from "./../Stages" const Line1 = "The change operator can be used for quikcly fixing typos" const Line1Marker = "The change operator can be used for ".length const Line1Pending = "The change operator can be used for fixing typos" const Line1Fixed = "The change operator can be used for quickly fixing typos" const Line2 = "Learning Vim can be tedious and repetitive" const Line2Fix1 = "Learning Vim can be fun and repetitive" const Line2Fix2 = "Learning Vim can be fun and exciting" export class ChangeOperatorTutorial implements ITutorial { private _stages: ITutorialStage[] constructor() { this._stages = [ new Stages.SetBufferStage([Line1]), new Stages.MoveToGoalStage("Move to the goal marker", 0, Line1Marker), new Stages.WaitForStateStage("Fix the typo by hitting 'cw'", [Line1Pending]), new Stages.WaitForStateStage("Enter the word 'quickly'", [Line1Fixed]), new Stages.WaitForModeStage("Exit Insert mode by hitting <esc>", "normal"), new Stages.SetBufferStage([Line1Fixed, Line2]), new Stages.MoveToGoalStage("Move to the goal marker", 1, Line2.indexOf("tedious")), new Stages.WaitForStateStage("Change 'tedious' to 'fun'", [Line1Fixed, Line2Fix1]), new Stages.WaitForModeStage("Exit Insert mode by hitting <esc>", "normal"), new Stages.MoveToGoalStage( "Move to the goal marker", 1, Line2Fix1.indexOf("repetitive"), ), new Stages.WaitForStateStage("Change 'repetitive' to 'exciting'", [ Line1Fixed, Line2Fix2, ]), new Stages.WaitForModeStage("Exit Insert mode by hitting <esc>", "normal"), ] } public get metadata(): ITutorialMetadata { return { id: "oni.tutorials.change_operator", name: "Change Operator: c", description: "Now that you know about operators and motions pairing like a noun and a verb, we can start learning more operators. The `c` operator allows you to _change_ text. It deletes the selected text and immediately enters Insert mode so you can enter new text. The text to be changed is defined by any motion just like the delete operator. It might not seem very impressive right now but `c` will become more useful as you learn more motions.", level: 210, } } public get stages(): ITutorialStage[] { return this._stages } public get notes(): JSX.Element[] { return [ <Notes.HJKLKeys />, <Notes.ChangeOperatorKey />, <Notes.ChangeWordKey />, <Notes.EscKey />, ] } } ```
/content/code_sandbox/browser/src/Services/Learning/Tutorial/Tutorials/ChangeOperatorTutorial.tsx
xml
2016-11-16T14:42:55
2024-08-14T11:48:05
oni
onivim/oni
11,355
686
```xml export * from './arrayUtils'; export * from './convertQuery'; export * from './defaultValidator'; export * from './filterFieldsByComparator'; export * from './formatQuery'; export * from './generateAccessibleDescription'; export * from './generateID'; export * from './getCompatContextProvider'; export * from './getValidationClassNames'; export * from './getValueSourcesUtil'; export * from './isRuleGroup'; export * from './isRuleOrGroupValid'; export * from './mergeClassnames'; export * from './mergeTranslations'; export * from './misc'; export * from './objectUtils'; export * from './optGroupUtils'; export * from './parseNumber'; export * from './pathUtils'; export * from './prepareQueryObjects'; export * from './queryTools'; export * from './regenerateIDs'; export * from './toFullOption'; export * from './toOptions'; export * from './transformQuery'; export * from './uniq'; // Don't export clsx. It should be imported from the official clsx // package if used outside the context of this package. // export * from './clsx'; // To reduce bundle size, these are only available as // separate exports as of v7. // export * from './parseCEL'; // export * from './parseJSONata'; // export * from './parseJsonLogic'; // export * from './parseMongoDB'; // export * from './parseSpEL'; // export * from './parseSQL'; ```
/content/code_sandbox/packages/react-querybuilder/src/utils/index.ts
xml
2016-06-17T22:03:19
2024-08-16T10:28:42
react-querybuilder
react-querybuilder/react-querybuilder
1,131
306
```xml import styled from 'styled-components'; export const Container = styled.div` display: flex; flex-direction: column; flex-grow: 1; `; export const Label = styled.div` font-size: 13px; color: #666; margin-bottom: 5px; white-space: nowrap; `; export const HeaderContainer = styled.div` display: flex; flex-direction: column; justify-content: space-between; `; export const BodyContainer = styled.div` display: flex; flex-direction: column; flex-basis: 0; `; export const DataContainer = styled.div` margin-top: 10px; flex-basis: 0; `; ```
/content/code_sandbox/src/plugins/main-tool-editor-event-trigger/index.style.ts
xml
2016-09-20T11:57:51
2024-07-23T03:40:11
gaea-editor
ascoders/gaea-editor
1,339
150
```xml <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="path_to_url" xmlns:app="path_to_url"> <SwitchPreferenceCompat android:key="@string/pref_key_posix_disk_io" android:title="@string/pref_posix_disk_io_title" android:summary="@string/pref_posix_disk_io_summary" app:singleLineTitle="false" android:persistent="false" /> <Preference android:key="@string/pref_key_save_torrents_in" android:title="@string/pref_save_torrents_in_title" app:singleLineTitle="false" android:persistent="false" /> <PreferenceCategory android:title="@string/pref_watch_dir_title"> <SwitchPreferenceCompat android:key="@string/pref_key_watch_dir" android:title="@string/pref_watch_dir_title" android:summary="@string/pref_watch_dir_summary" app:singleLineTitle="false" android:persistent="false" /> <Preference android:key="@string/pref_key_dir_to_watch" android:title="@string/pref_dir_to_watch_title" app:singleLineTitle="false" android:persistent="false" /> <SwitchPreferenceCompat android:key="@string/pref_key_watch_dir_delete_file" android:title="@string/pref_watch_dir_delete_file_title" app:singleLineTitle="false" android:persistent="false" /> </PreferenceCategory> <PreferenceCategory android:title="@string/pref_move_after_download_title"> <SwitchPreferenceCompat android:key="@string/pref_key_move_after_download" android:title="@string/pref_move_after_download_title" app:singleLineTitle="false" android:persistent="false" /> <Preference android:key="@string/pref_key_move_after_download_in" android:title="@string/pref_move_after_download_in_title" android:dependency="@string/pref_key_move_after_download" app:singleLineTitle="false" android:persistent="false" /> </PreferenceCategory> <PreferenceCategory android:title="@string/pref_save_torrent_files_title"> <SwitchPreferenceCompat android:key="@string/pref_key_save_torrent_files" android:title="@string/pref_save_torrent_files_title" android:summary="@string/pref_save_torrent_files_summary" app:singleLineTitle="false" android:persistent="false" /> <Preference android:key="@string/pref_key_save_torrent_files_in" android:title="@string/pref_save_torrent_files_in_title" android:dependency="@string/pref_key_save_torrent_files" app:singleLineTitle="false" android:persistent="false" /> </PreferenceCategory> </PreferenceScreen> ```
/content/code_sandbox/app/src/main/res/xml/pref_storage.xml
xml
2016-10-18T15:38:44
2024-08-16T19:19:31
libretorrent
proninyaroslav/libretorrent
1,973
601
```xml // See LICENSE.txt for license information. import React from 'react'; import {StyleSheet, View} from 'react-native'; import {General} from '@constants'; import DirectMessage from './direct_message'; import GroupMessage from './group_message'; import PublicPrivate from './public_private'; type Props = { channelId: string; displayName?: string; type?: ChannelType; } const styles = StyleSheet.create({ container: { marginBottom: 16, marginTop: 24, }, }); const Title = ({channelId, displayName, type}: Props) => { let component; switch (type) { case General.DM_CHANNEL: component = ( <DirectMessage channelId={channelId} displayName={displayName} /> ); break; case General.GM_CHANNEL: component = ( <GroupMessage channelId={channelId} displayName={displayName} /> ); break; default: component = ( <PublicPrivate channelId={channelId} displayName={displayName} /> ); break; } return ( <View style={styles.container}> {component} </View> ); }; export default Title; ```
/content/code_sandbox/app/screens/channel_info/title/title.tsx
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
255
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>UIViewControllerBasedStatusBarAppearance</key> <false/> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleDisplayName</key> <string></string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleLocalizations</key> <array> <string>en</string> <string>zh_CN</string> </array> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string>com.michaelhuyp.Wuxianda</string> </array> </dict> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string>wb1576468831</string> </array> </dict> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string>wx583a9239406dfa5f</string> </array> </dict> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string>QQ41E43A0A</string> </array> </dict> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string>tencent1105476106</string> </array> </dict> </array> <key>CFBundleVersion</key> <string>1</string> <key>LSApplicationCategoryType</key> <string>ijkplayer</string> <key>LSApplicationQueriesSchemes</key> <array> <string>wechat</string> <string>weixin</string> <string>sinaweibohd</string> <string>sinaweibo</string> <string>sinaweibosso</string> <string>weibosdk</string> <string>weibosdk2.5</string> <string>mqqapi</string> <string>mqq</string> <string>mqqOpensdkSSoLogin</string> <string>mqqconnect</string> <string>mqqopensdkdataline</string> <string>mqqopensdkgrouptribeshare</string> <string>mqqopensdkfriend</string> <string>mqqopensdkapi</string> <string>mqqopensdkapiV2</string> <string>mqqopensdkapiV3</string> <string>mqzoneopensdk</string> <string>wtloginmqq</string> <string>wtloginmqq2</string> <string>mqqwpa</string> <string>mqzone</string> <string>mqzonev2</string> <string>mqzoneshare</string> <string>wtloginqzone</string> <string>mqzonewx</string> <string>mqzoneopensdkapiV2</string> <string>mqzoneopensdkapi19</string> <string>mqzoneopensdkapi</string> <string>mqqbrowser</string> <string>mttbrowser</string> <string>alipay</string> <string>alipayshare</string> <string>renrenios</string> <string>renrenapi</string> <string>renren</string> <string>renreniphone</string> <string>laiwangsso</string> <string>yixin</string> <string>yixinopenapi</string> <string>instagram</string> <string>whatsapp</string> <string>line</string> <string>fbapi</string> <string>fb-messenger-api</string> <string>fbauth2</string> <string>fbshareextension</string> </array> <key>LSRequiresIPhoneOS</key> <true/> <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSExceptionDomains</key> <dict> <key>akamaihd.net</key> <dict> <key>NSExceptionRequiresForwardSecrecy</key> <false/> <key>NSIncludesSubdomains</key> <true/> </dict> <key>facebook.com</key> <dict> <key>NSExceptionRequiresForwardSecrecy</key> <false/> <key>NSIncludesSubdomains</key> <true/> </dict> <key>fbcdn.net</key> <dict> <key>NSExceptionRequiresForwardSecrecy</key> <false/> <key>NSIncludesSubdomains</key> <true/> </dict> <key>log.umsns.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSTemporaryExceptionMinimumTLSVersion</key> <string>TLSv1.1</string> </dict> <key>qq.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>renren.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>sina.cn</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>sina.com.cn</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>sinaimg.cn</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>sinajs.cn</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>sns.whalecloud.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSTemporaryExceptionMinimumTLSVersion</key> <string>TLSv1.1</string> </dict> <key>twitter.com</key> <dict> <key>NSExceptionRequiresForwardSecrecy</key> <false/> <key>NSIncludesSubdomains</key> <true/> </dict> <key>weibo.cn</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>weibo.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> </dict> </dict> <key>NSLocationAlwaysUsageDescription</key> <string></string> <key>UIBackgroundModes</key> <array> <string>audio</string> <string>location</string> </array> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> </array> <key>UIRequiresPersistentWiFi</key> <true/> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> </dict> </plist> ```
/content/code_sandbox/Wuxianda/Info.plist
xml
2016-07-21T14:47:27
2024-08-15T07:32:25
Bilibili_Wuxianda
MichaelHuyp/Bilibili_Wuxianda
2,685
2,453
```xml import * as React from 'react'; import { SpeedDial } from '@rneui/base'; import Playground from '../../src/components/Playground'; import { useView, PropTypes } from 'react-view'; const SpeedDialPlayground = () => { const params = useView({ componentName: 'SpeedDial', props: { children: { value: ` <SpeedDial.Action icon={{ name: 'add', color: '#fff' }} title="Add" onPress={() => console.log('Add Something')} /> <SpeedDial.Action icon={{ name: 'delete', color: '#fff' }} title="Delete" onPress={() => console.log('Delete Something')} />`, }, isOpen: { type: PropTypes.Boolean, value: true, }, openIcon: { type: PropTypes.Object, value: `{ name: 'close', color: '#fff' }`, }, onOpen: { type: PropTypes.Function, value: `() => console.log("onOpen()")`, }, onClose: { type: PropTypes.Function, value: `() => console.log("onClose()")`, }, transitionDuration: { type: PropTypes.Number, value: 150, }, icon: { type: PropTypes.Object, value: `{ name: 'edit', color: '#fff' }`, }, }, scope: { SpeedDial, }, imports: { '@rneui/base': { named: ['SpeedDial'], }, }, }); return ( <React.Fragment> <Playground params={params} containerStyle={{ height: '200px' }} /> </React.Fragment> ); }; export default SpeedDialPlayground; ```
/content/code_sandbox/website/playground/SpeedDial/speeddial.playground.tsx
xml
2016-09-08T14:21:41
2024-08-16T10:11:29
react-native-elements
react-native-elements/react-native-elements
24,875
386
```xml /** @jsx jsx */ import { Editor } from 'slate' import { jsx } from '../../../..' export const input = ( <editor> <block> one<inline>two</inline>three </block> <block> four<inline>five</inline>six </block> </editor> ) export const test = editor => { return Array.from( Editor.positions(editor, { at: [], unit: 'character', reverse: true }) ) } export const output = [ { path: [1, 2], offset: 3 }, { path: [1, 2], offset: 2 }, { path: [1, 2], offset: 1 }, { path: [1, 2], offset: 0 }, { path: [1, 1, 0], offset: 3 }, { path: [1, 1, 0], offset: 2 }, { path: [1, 1, 0], offset: 1 }, { path: [1, 1, 0], offset: 0 }, { path: [1, 0], offset: 3 }, { path: [1, 0], offset: 2 }, { path: [1, 0], offset: 1 }, { path: [1, 0], offset: 0 }, { path: [0, 2], offset: 5 }, { path: [0, 2], offset: 4 }, { path: [0, 2], offset: 3 }, { path: [0, 2], offset: 2 }, { path: [0, 2], offset: 1 }, { path: [0, 2], offset: 0 }, { path: [0, 1, 0], offset: 2 }, { path: [0, 1, 0], offset: 1 }, { path: [0, 1, 0], offset: 0 }, { path: [0, 0], offset: 2 }, { path: [0, 0], offset: 1 }, { path: [0, 0], offset: 0 }, ] ```
/content/code_sandbox/packages/slate/test/interfaces/Editor/positions/all/unit-character-reverse.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
495
```xml import { NetworkId } from '@types'; export const ETHERSCAN_DEFAULT_URL = 'path_to_url export type ETHERSCAN_API_INVALID_KEY_MESSAGE = 'OK-Missing/Invalid API Key, rate limit of 1/sec applied'; export const ETHERSCAN_API_MAX_LIMIT_REACHED_TEXT = 'Max rate limit reached, please use API Key for higher rate limit'; export type ETHERSCAN_API_MAX_LIMIT_REACHED = 'Max rate limit reached, please use API Key for higher rate limit'; type ApiURLS = Partial< { [key in NetworkId]: string; } >; export const ETHERSCAN_API_URLS: ApiURLS = { Ethereum: 'path_to_url Ropsten: 'path_to_url Kovan: 'path_to_url Rinkeby: 'path_to_url Goerli: 'path_to_url }; ```
/content/code_sandbox/src/services/ApiService/Etherscan/constants.ts
xml
2016-12-04T01:35:27
2024-08-14T21:41:58
MyCrypto
MyCryptoHQ/MyCrypto
1,347
186
```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleIconFile</key> <string></string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>${PRODUCT_NAME}</string> <key>CFBundlePackageType</key> <string>BNDL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1</string> <key>CFPlugInDynamicRegisterFunction</key> <string></string> <key>CFPlugInDynamicRegistration</key> <string>NO</string> <key>CFPlugInFactories</key> <dict> <key>00000000-0000-0000-0000-000000000000</key> <string>MyFactoryFunction</string> </dict> <key>CFPlugInTypes</key> <dict> <key>00000000-0000-0000-0000-000000000000</key> <array> <string>00000000-0000-0000-0000-000000000000</string> </array> </dict> <key>CFPlugInUnloadFunction</key> <string></string> </dict> </plist> ```
/content/code_sandbox/MathFontBundle/MathFontBundle-Info.plist
xml
2016-05-11T22:22:36
2024-08-15T14:16:57
iosMath
kostub/iosMath
1,356
409
```xml export const input = { title: 'arrayMaxMinItems', type: 'object', properties: { array: { type: 'object', properties: { withMinItems: { type: 'array', items: { type: 'string', }, minItems: 3, }, withMaxItems: { type: 'array', items: { type: 'string', }, maxItems: 3, }, withMinMaxItems: { type: 'array', items: { type: 'string', }, minItems: 3, maxItems: 8, }, withMaxItems0: { type: 'array', items: { type: 'string', }, maxItems: 0, }, withMinItems0: { type: 'array', items: { type: 'string', }, minItems: 0, }, withMinMaxItems0: { type: 'array', items: { type: 'string', }, minItems: 0, maxItems: 0, }, }, additionalProperties: false, }, untyped: { type: 'object', properties: { withMinItems: { type: 'array', minItems: 3, }, withMaxItems: { type: 'array', maxItems: 3, }, withMinMaxItems: { type: 'array', minItems: 3, maxItems: 8, }, withMaxItems0: { type: 'array', maxItems: 0, }, withMinItems0: { type: 'array', minItems: 0, }, withMinMaxItems0: { type: 'array', minItems: 0, maxItems: 0, }, }, additionalProperties: false, }, tuple: { type: 'object', properties: { withMinItemsLessThanItemLength: { type: 'array', items: [{enum: [1]}, {enum: [2]}, {enum: [3]}, {enum: [4]}, {enum: [5]}, {enum: [6]}], minItems: 2, }, withMinItemsGreaterThanItemLength: { type: 'array', items: [{enum: [1]}, {enum: [2]}, {enum: [3]}, {enum: [4]}, {enum: [5]}, {enum: [6]}], minItems: 8, }, withMaxItemsLessThanItemLength: { type: 'array', items: [{enum: [1]}, {enum: [2]}, {enum: [3]}, {enum: [4]}, {enum: [5]}, {enum: [6]}], maxItems: 2, }, withMaxItemsGreaterThanItemLength: { type: 'array', items: [{enum: [1]}, {enum: [2]}, {enum: [3]}, {enum: [4]}, {enum: [5]}, {enum: [6]}], maxItems: 8, }, your_sha256_hash: { type: 'array', items: [{enum: [1]}, {enum: [2]}, {enum: [3]}, {enum: [4]}, {enum: [5]}, {enum: [6]}], minItems: 4, maxItems: 8, }, withMinItemsLessThanItemLength_and_MaxItemsLessThanItemLength: { type: 'array', items: [{enum: [1]}, {enum: [2]}, {enum: [3]}, {enum: [4]}, {enum: [5]}, {enum: [6]}], minItems: 2, maxItems: 4, }, your_sha256_hashgth: { type: 'array', items: [{enum: [1]}, {enum: [2]}, {enum: [3]}, {enum: [4]}, {enum: [5]}, {enum: [6]}], minItems: 8, maxItems: 10, }, withMaxItems0: { type: 'array', items: [{enum: [1]}, {enum: [2]}, {enum: [3]}, {enum: [4]}, {enum: [5]}, {enum: [6]}], maxItems: 0, }, withMinItems0: { type: 'array', items: [{enum: [1]}, {enum: [2]}, {enum: [3]}, {enum: [4]}, {enum: [5]}, {enum: [6]}], minItems: 0, }, withMinMaxItems0: { type: 'array', items: [{enum: [1]}, {enum: [2]}, {enum: [3]}, {enum: [4]}, {enum: [5]}, {enum: [6]}], minItems: 0, maxItems: 0, }, }, additionalProperties: false, }, }, additionalProperties: false, } export const options = { ignoreMinAndMaxItems: true, } ```
/content/code_sandbox/test/e2e/options.arrayIgnoreMaxMinItems.ts
xml
2016-03-22T03:56:58
2024-08-12T18:37:05
json-schema-to-typescript
bcherny/json-schema-to-typescript
2,877
1,149
```xml import * as React from 'react'; import createSvgIcon from '../utils/createSvgIcon'; const GoogleDriveLogoIcon = createSvgIcon({ svg: ({ classes }) => ( <svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg} focusable="false"> <path d="M1995 1261h-646L699 128h646l650 1133zm-1186 93h1239l-323 566H487l322-566zM619 270l323 566-619 1084L0 1354 619 270z" /> </svg> ), displayName: 'GoogleDriveLogoIcon', }); export default GoogleDriveLogoIcon; ```
/content/code_sandbox/packages/react-icons-mdl2/src/components/GoogleDriveLogoIcon.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
162
```xml import { Logger } from "@Core/Logger"; import { SearchResultItemAction } from "@common/Core"; import { WorkflowAction } from "@common/Extensions/Workflow"; import { describe, expect, it, vi } from "vitest"; import { WorkflowActionArgumentEncoder } from "./Utility"; import { WorkflowActionHandler } from "./WorkflowActionHandler"; import { WorkflowHandler } from "./WorkflowHandler"; describe(WorkflowHandler, () => { describe(WorkflowHandler.prototype.id, () => it("should be 'Workflow'", () => expect(new WorkflowHandler(null, {}).id).toBe("Workflow")), ); describe(WorkflowHandler.prototype.invokeAction, () => { it("should invoke all supported workflow action handlers and log errors", async () => { const errorMock = vi.fn(); const logger = <Logger>{ error: (m) => errorMock(m) }; const handler1 = <WorkflowActionHandler>{ invokeWorkflowAction: vi.fn().mockResolvedValue(null) }; const handler2 = <WorkflowActionHandler>{ invokeWorkflowAction: vi.fn().mockRejectedValue("error") }; const handler4 = <WorkflowActionHandler>{ invokeWorkflowAction: vi.fn() }; const workflowHandler = new WorkflowHandler(logger, { handler1, handler2, handler4 }); const workflowAction1 = <WorkflowAction<unknown>>{ args: { arg1: "value1" }, handlerId: "handler1" }; const workflowAction2 = <WorkflowAction<unknown>>{ args: { arg2: "value2" }, handlerId: "handler2" }; const workflowAction3 = <WorkflowAction<unknown>>{ args: { arg3: "value3" }, handlerId: "handler3" }; await workflowHandler.invokeAction(<SearchResultItemAction>{ argument: WorkflowActionArgumentEncoder.encodeArgument([ workflowAction1, workflowAction2, workflowAction3, ]), }); expect(handler1.invokeWorkflowAction).toHaveBeenCalledWith(workflowAction1); expect(handler2.invokeWorkflowAction).toHaveBeenCalledWith(workflowAction2); expect(handler4.invokeWorkflowAction).not.toHaveBeenCalled(); expect(errorMock).toHaveBeenCalledOnce(); expect(errorMock).toHaveBeenCalledWith("Unable to invoke workflow action. Reason: error"); }); }); }); ```
/content/code_sandbox/src/main/Extensions/Workflow/WorkflowHandler.test.ts
xml
2016-10-11T04:59:52
2024-08-16T11:53:31
ueli
oliverschwendener/ueli
3,543
475
```xml import * as fs from 'fs-extra'; import * as path from 'path'; import { WorkspaceFolder } from 'vscode'; import { Commands } from '../../../common/constants'; import { Common } from '../../../common/utils/localize'; import { executeCommand } from '../../../common/vscodeApis/commandApis'; import { showErrorMessage } from '../../../common/vscodeApis/windowApis'; import { isWindows } from '../../../common/platform/platformService'; export async function showErrorMessageWithLogs(message: string): Promise<void> { const result = await showErrorMessage(message, Common.openOutputPanel, Common.selectPythonInterpreter); if (result === Common.openOutputPanel) { await executeCommand(Commands.ViewOutput); } else if (result === Common.selectPythonInterpreter) { await executeCommand(Commands.Set_Interpreter); } } export function getVenvPath(workspaceFolder: WorkspaceFolder): string { return path.join(workspaceFolder.uri.fsPath, '.venv'); } export async function hasVenv(workspaceFolder: WorkspaceFolder): Promise<boolean> { return fs.pathExists(path.join(getVenvPath(workspaceFolder), 'pyvenv.cfg')); } export function getVenvExecutable(workspaceFolder: WorkspaceFolder): string { if (isWindows()) { return path.join(getVenvPath(workspaceFolder), 'Scripts', 'python.exe'); } return path.join(getVenvPath(workspaceFolder), 'bin', 'python'); } export function getPrefixCondaEnvPath(workspaceFolder: WorkspaceFolder): string { return path.join(workspaceFolder.uri.fsPath, '.conda'); } export async function hasPrefixCondaEnv(workspaceFolder: WorkspaceFolder): Promise<boolean> { return fs.pathExists(getPrefixCondaEnvPath(workspaceFolder)); } ```
/content/code_sandbox/src/client/pythonEnvironments/creation/common/commonUtils.ts
xml
2016-01-19T10:50:01
2024-08-12T21:05:24
pythonVSCode
DonJayamanne/pythonVSCode
2,078
358
```xml /* * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import zeros = require( '@stdlib/ndarray/zeros' ); import nditerColumns = require( './index' ); // TESTS // // The function returns an iterator... { nditerColumns( zeros( [ 2, 2 ] ) ); // $ExpectType Iterator<typedndarray<number>> nditerColumns( zeros( [ 2, 2 ] ), {} ); // $ExpectType Iterator<typedndarray<number>> } // The compiler throws an error if the function is provided a first argument which is not an ndarray... { nditerColumns( 123 ); // $ExpectError nditerColumns( true ); // $ExpectError nditerColumns( false ); // $ExpectError nditerColumns( null ); // $ExpectError nditerColumns( undefined ); // $ExpectError nditerColumns( {} ); // $ExpectError nditerColumns( [] ); // $ExpectError nditerColumns( ( x: number ): number => x ); // $ExpectError nditerColumns( 123, {} ); // $ExpectError nditerColumns( true, {} ); // $ExpectError nditerColumns( false, {} ); // $ExpectError nditerColumns( null, {} ); // $ExpectError nditerColumns( undefined, {} ); // $ExpectError nditerColumns( {}, {} ); // $ExpectError nditerColumns( [], {} ); // $ExpectError nditerColumns( ( x: number ): number => x, {} ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not an object... { nditerColumns( zeros( [ 2, 2 ] ), 'abc' ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), 123 ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), true ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), false ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), null ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), [] ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided a `readonly` option which is not a boolean... { nditerColumns( zeros( [ 2, 2 ] ), { 'readonly': 'abc' } ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), { 'readonly': 123 } ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), { 'readonly': null } ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), { 'readonly': [] } ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), { 'readonly': {} } ); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), { 'readonly': ( x: number ): number => x } ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { nditerColumns(); // $ExpectError nditerColumns( zeros( [ 2, 2 ] ), {}, {} ); // $ExpectError } ```
/content/code_sandbox/lib/node_modules/@stdlib/ndarray/iter/columns/docs/types/test.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
823