fix(products): fix breadcrumbs and product filtering (backport from main)
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions
@@ -0,0 +1,16 @@
type GeneratedColumn = number;
type SourcesIndex = number;
type SourceLine = number;
type SourceColumn = number;
type NamesIndex = number;
export type SourceMapSegment =
| [GeneratedColumn]
| [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]
| [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];
export const COLUMN = 0;
export const SOURCES_INDEX = 1;
export const SOURCE_LINE = 2;
export const SOURCE_COLUMN = 3;
export const NAMES_INDEX = 4;
@@ -0,0 +1,60 @@
Prism.languages.rescript = {
'comment': {
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
greedy: true
},
'char': { pattern: /'(?:[^\r\n\\]|\\(?:.|\w+))'/, greedy: true },
'string': {
pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
greedy: true
},
'class-name': /\b[A-Z]\w*|@[a-z.]*|#[A-Za-z]\w*|#\d/,
'function': {
pattern: /[a-zA-Z]\w*(?=\()|(\.)[a-z]\w*/,
lookbehind: true,
},
'number': /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
'boolean': /\b(?:false|true)\b/,
'attr-value': /[A-Za-z]\w*(?==)/,
'constant': {
pattern: /(\btype\s+)[a-z]\w*/,
lookbehind: true
},
'tag': {
pattern: /(<)[a-z]\w*|(?:<\/)[a-z]\w*/,
lookbehind: true,
inside: {
'operator': /<|>|\//,
},
},
'keyword': /\b(?:and|as|assert|begin|bool|class|constraint|do|done|downto|else|end|exception|external|float|for|fun|function|if|in|include|inherit|initializer|int|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|string|switch|then|to|try|type|when|while|with)\b/,
'operator': /\.{3}|:[:=]?|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/,
'punctuation': /[(){}[\],;.]/
};
Prism.languages.insertBefore('rescript', 'string', {
'template-string': {
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
greedy: true,
inside: {
'template-punctuation': {
pattern: /^`|`$/,
alias: 'string'
},
'interpolation': {
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
lookbehind: true,
inside: {
'interpolation-punctuation': {
pattern: /^\$\{|\}$/,
alias: 'tag'
},
rest: Prism.languages.rescript
}
},
'string': /[\s\S]+/
}
},
});
Prism.languages.res = Prism.languages.rescript;
@@ -0,0 +1,17 @@
/**
* An interface describing a user of an application or a handled request.
*/
export interface User {
[key: string]: any;
id?: string | number;
ip_address?: string | null;
email?: string;
username?: string;
geo?: GeoLocation;
}
export interface GeoLocation {
country_code?: string;
region?: string;
city?: string;
}
//# sourceMappingURL=user.d.ts.map
@@ -0,0 +1,23 @@
// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell
// License: MIT. (See LICENSE.)
Object.defineProperty(exports, "__esModule", {
value: true
})
// This regex comes from regex.coffee, and is inserted here by generate-index.js
// (run `npm run build`).
exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g
exports.matchToToken = function(match) {
var token = {type: "invalid", value: match[0], closed: undefined}
if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4])
else if (match[ 5]) token.type = "comment"
else if (match[ 6]) token.type = "comment", token.closed = !!match[7]
else if (match[ 8]) token.type = "regex"
else if (match[ 9]) token.type = "number"
else if (match[10]) token.type = "name"
else if (match[11]) token.type = "punctuator"
else if (match[12]) token.type = "whitespace"
return token
}
@@ -0,0 +1 @@
{"version":3,"file":"send-horizontal.js","sources":["../../../src/icons/send-horizontal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SendHorizontal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMy43MTQgMy4wNDhhLjQ5OC40OTggMCAwIDAtLjY4My42MjdsMi44NDMgNy42MjdhMiAyIDAgMCAxIDAgMS4zOTZsLTIuODQyIDcuNjI3YS40OTguNDk4IDAgMCAwIC42ODIuNjI3bDE4LTguNWEuNS41IDAgMCAwIDAtLjkwNHoiIC8+CiAgPHBhdGggZD0iTTYgMTJoMTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/send-horizontal\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SendHorizontal = createLucideIcon('SendHorizontal', [\n [\n 'path',\n {\n d: 'M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z',\n key: '117uat',\n },\n ],\n ['path', { d: 'M6 12h16', key: 's4cdu5' }],\n]);\n\nexport default SendHorizontal;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CACxD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"signal-zero.js","sources":["../../../src/icons/signal-zero.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SignalZero\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAyMGguMDEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/signal-zero\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SignalZero = createLucideIcon('SignalZero', [['path', { d: 'M2 20h.01', key: '4haj6o' }]]);\n\nexport default SignalZero;\n"],"names":[],"mappings":";;;;;;;;;AAaA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,YAAc,CAAA,CAAA,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,EAAE,CAAA,CAAA,CAAG,WAAa,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,493 @@
import { MissingEditorProp } from '../../../errors/index.js';
import { validateBlocksFilterOptions } from '../../../index.js';
import { deepMergeWithSourceArrays } from '../../../utilities/deepMerge.js';
import { getTranslatedLabel } from '../../../utilities/getTranslatedLabel.js';
import { fieldAffectsData, fieldShouldBeLocalized, tabHasName } from '../../config/types.js';
import { getFieldPaths } from '../../getFieldPaths.js';
import { getExistingRowDoc } from './getExistingRowDoc.js';
import { traverseFields } from './traverseFields.js';
function buildFieldLabel(parentLabel, label) {
if (!label) {
return parentLabel;
}
const capitalizedLabel = label.charAt(0).toUpperCase() + label.slice(1);
return parentLabel && capitalizedLabel ? `${parentLabel} > ${capitalizedLabel}` : capitalizedLabel || parentLabel;
}
// This function is responsible for the following actions, in order:
// - Run condition
// - Execute field hooks
// - Validate data
// - Transform data for storage
// - beforeDuplicate hooks (if duplicate)
// - Unflatten locales
export const promise = async ({ id, blockData, collection, context, data, doc, docWithLocales, errors, field, fieldIndex, fieldLabelPath, global, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, siblingFields, skipValidation })=>{
const { indexPath, path, schemaPath } = getFieldPaths({
field,
index: fieldIndex,
parentIndexPath,
parentPath,
parentSchemaPath
});
const { localization } = req.payload.config;
const defaultLocale = localization ? localization?.defaultLocale : 'en';
const operationLocale = req.locale || defaultLocale;
const pathSegments = path ? path.split('.') : [];
const schemaPathSegments = schemaPath ? schemaPath.split('.') : [];
const indexPathSegments = indexPath ? indexPath.split('-').filter(Boolean)?.map(Number) : [];
const passesCondition = field.admin?.condition ? Boolean(field.admin.condition(data, siblingData, {
blockData: blockData,
operation,
path: pathSegments,
user: req.user
})) : true;
let skipValidationFromHere = skipValidation || !passesCondition;
if (fieldAffectsData(field)) {
// skip validation if the field is localized and the incoming data is null
if (fieldShouldBeLocalized({
field,
parentIsLocalized
}) && operationLocale !== defaultLocale) {
if ([
'array',
'blocks'
].includes(field.type) && siblingData[field.name] === null) {
skipValidationFromHere = true;
}
}
// Execute hooks
if ('hooks' in field && field.hooks?.beforeChange) {
for (const hook of field.hooks.beforeChange){
const hookedValue = await hook({
blockData,
collection,
context,
data,
field,
global,
indexPath: indexPathSegments,
operation,
originalDoc: doc,
path: pathSegments,
previousSiblingDoc: siblingDoc,
previousValue: siblingDoc[field.name],
req,
schemaPath: schemaPathSegments,
siblingData,
siblingDocWithLocales,
siblingFields: siblingFields,
value: siblingData[field.name]
});
if (hookedValue !== undefined) {
siblingData[field.name] = hookedValue;
}
}
}
// Validate
if (!skipValidationFromHere && 'validate' in field && field.validate) {
const valueToValidate = siblingData[field.name];
let jsonError;
if (field.type === 'json' && typeof siblingData[field.name] === 'string') {
try {
JSON.parse(siblingData[field.name]);
} catch (e) {
jsonError = e;
}
}
const validateFn = field.validate;
const validationResult = await validateFn(valueToValidate, {
...field,
id,
blockData: blockData,
collectionSlug: collection?.slug,
data: deepMergeWithSourceArrays(doc, data),
event: 'submit',
// @ts-expect-error
jsonError,
operation,
overrideAccess,
path: pathSegments,
preferences: {
fields: {}
},
previousValue: siblingDoc[field.name],
req,
siblingData: deepMergeWithSourceArrays(siblingDoc, siblingData)
});
if (typeof validationResult === 'string') {
let filterOptionsError = false;
if (field.type === 'blocks' && field.filterOptions) {
// Re-run filteroptions. If the validation error is due to filteroptions, we need to add error paths to all the blocks
// that are no longer valid
const validationResult = await validateBlocksFilterOptions({
id,
data,
filterOptions: field.filterOptions,
req,
siblingData,
value: siblingData[field.name]
});
if (validationResult?.invalidBlockSlugs?.length) {
filterOptionsError = true;
let rowIndex = -1;
for (const block of siblingData[field.name]){
rowIndex++;
if (validationResult.invalidBlockSlugs.includes(block.blockType)) {
const blockConfigOrSlug = (field.blockReferences ?? field.blocks).find((blockFromField)=>typeof blockFromField === 'string' ? blockFromField === block.blockType : blockFromField.slug === block.blockType);
const blockConfig = typeof blockConfigOrSlug !== 'string' ? blockConfigOrSlug : req.payload.config?.blocks?.[blockConfigOrSlug];
const blockLabelPath = field?.label === false ? fieldLabelPath : buildFieldLabel(fieldLabelPath, `${getTranslatedLabel(field?.label || field?.name, req.i18n)} > ${req.t('fields:block')} ${rowIndex + 1} (${getTranslatedLabel(blockConfig?.labels?.singular || block.blockType, req.i18n)})`);
errors.push({
label: blockLabelPath,
message: req.t('validation:invalidBlock', {
block: block.blockType
}),
path: `${path}.${rowIndex}.id`
});
}
}
}
}
if (!filterOptionsError) {
// If the error is due to block filterOptions, we want to push the errors for each individual block, not the blocks
// field itself => only push the error if the field is not a block field with validation failure due to filterOptions
const fieldLabel = buildFieldLabel(fieldLabelPath, getTranslatedLabel(field?.label || field?.name, req.i18n));
errors.push({
label: fieldLabel,
message: validationResult,
path
});
}
}
}
// Push merge locale action if applicable
if (localization && fieldShouldBeLocalized({
field,
parentIsLocalized
})) {
mergeLocaleActions.push(()=>{
const localeData = {};
for (const locale of localization.localeCodes){
const fieldValue = locale === req.locale ? siblingData[field.name] : siblingDocWithLocales?.[field.name]?.[locale];
// update locale value if it's not undefined
if (typeof fieldValue !== 'undefined') {
localeData[locale] = fieldValue;
}
}
// If there are locales with data, set the data
if (Object.keys(localeData).length > 0) {
siblingData[field.name] = localeData;
}
});
}
}
switch(field.type){
case 'array':
{
const rows = siblingData[field.name];
if (Array.isArray(rows)) {
const promises = [];
rows.forEach((row, rowIndex)=>{
promises.push(traverseFields({
id,
blockData,
collection,
context,
data,
doc,
docWithLocales,
errors,
fieldLabelPath: field?.label === false ? fieldLabelPath : buildFieldLabel(fieldLabelPath, `${getTranslatedLabel(field?.label || field?.name, req.i18n)} ${rowIndex + 1}`),
fields: field.fields,
global,
mergeLocaleActions,
operation,
overrideAccess,
parentIndexPath: '',
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: path + '.' + rowIndex,
parentSchemaPath: schemaPath,
req,
siblingData: row,
siblingDoc: getExistingRowDoc(row, siblingDoc[field.name]),
siblingDocWithLocales: getExistingRowDoc(row, siblingDocWithLocales?.[field.name]),
skipValidation: skipValidationFromHere
}));
});
await Promise.all(promises);
}
break;
}
case 'blocks':
{
const rows = siblingData[field.name];
if (Array.isArray(rows)) {
const promises = [];
rows.forEach((row, rowIndex)=>{
const rowSiblingDoc = getExistingRowDoc(row, siblingDoc[field.name]);
const rowSiblingDocWithLocales = getExistingRowDoc(row, siblingDocWithLocales ? siblingDocWithLocales[field.name] : {});
const blockTypeToMatch = row.blockType || rowSiblingDoc.blockType;
const block = req.payload.blocks[blockTypeToMatch] ?? (field.blockReferences ?? field.blocks).find((curBlock)=>typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch);
const blockLabelPath = field?.label === false ? fieldLabelPath : buildFieldLabel(fieldLabelPath, `${getTranslatedLabel(field?.label || field?.name, req.i18n)} > ${req.t('fields:block')} ${rowIndex + 1} (${getTranslatedLabel(block?.labels?.singular || blockTypeToMatch, req.i18n)})`);
if (block) {
promises.push(traverseFields({
id,
blockData: row,
collection,
context,
data,
doc,
docWithLocales,
errors,
fieldLabelPath: blockLabelPath,
fields: block.fields,
global,
mergeLocaleActions,
operation,
overrideAccess,
parentIndexPath: '',
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: path + '.' + rowIndex,
parentSchemaPath: schemaPath + '.' + block.slug,
req,
siblingData: row,
siblingDoc: rowSiblingDoc,
siblingDocWithLocales: rowSiblingDocWithLocales,
skipValidation: skipValidationFromHere
}));
}
});
await Promise.all(promises);
}
break;
}
case 'collapsible':
case 'row':
{
await traverseFields({
id,
blockData,
collection,
context,
data,
doc,
docWithLocales,
errors,
fieldLabelPath: field.type === 'row' || field?.label === false ? fieldLabelPath : buildFieldLabel(fieldLabelPath, getTranslatedLabel(field?.label || field?.type, req.i18n)),
fields: field.fields,
global,
mergeLocaleActions,
operation,
overrideAccess,
parentIndexPath: indexPath,
parentIsLocalized,
parentPath,
parentSchemaPath: schemaPath,
req,
siblingData,
siblingDoc,
siblingDocWithLocales: siblingDocWithLocales,
skipValidation: skipValidationFromHere
});
break;
}
case 'group':
{
let groupSiblingData = siblingData;
let groupSiblingDoc = siblingDoc;
let groupSiblingDocWithLocales = siblingDocWithLocales;
const isNamedGroup = fieldAffectsData(field);
if (isNamedGroup) {
if (typeof siblingData[field.name] !== 'object') {
siblingData[field.name] = {};
}
if (typeof siblingDoc[field.name] !== 'object') {
siblingDoc[field.name] = {};
}
if (typeof siblingDocWithLocales[field.name] !== 'object') {
siblingDocWithLocales[field.name] = {};
}
if (typeof siblingData[field.name] !== 'object') {
siblingData[field.name] = {};
}
if (typeof siblingDoc[field.name] !== 'object') {
siblingDoc[field.name] = {};
}
if (typeof siblingDocWithLocales[field.name] !== 'object') {
siblingDocWithLocales[field.name] = {};
}
groupSiblingData = siblingData[field.name];
groupSiblingDoc = siblingDoc[field.name];
groupSiblingDocWithLocales = siblingDocWithLocales[field.name];
}
const fallbackLabel = field?.label || (isNamedGroup ? field.name : field?.type);
await traverseFields({
id,
blockData,
collection,
context,
data,
doc,
docWithLocales,
errors,
fieldLabelPath: field?.label === false ? fieldLabelPath : buildFieldLabel(fieldLabelPath, getTranslatedLabel(fallbackLabel, req.i18n)),
fields: field.fields,
global,
mergeLocaleActions,
operation,
overrideAccess,
parentIndexPath: isNamedGroup ? '' : indexPath,
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: isNamedGroup ? path : parentPath,
parentSchemaPath: schemaPath,
req,
siblingData: groupSiblingData,
siblingDoc: groupSiblingDoc,
siblingDocWithLocales: groupSiblingDocWithLocales,
skipValidation: skipValidationFromHere
});
break;
}
case 'point':
{
// Transform point data for storage
if (Array.isArray(siblingData[field.name]) && siblingData[field.name][0] !== null && siblingData[field.name][1] !== null) {
siblingData[field.name] = {
type: 'Point',
coordinates: [
parseFloat(siblingData[field.name][0]),
parseFloat(siblingData[field.name][1])
]
};
}
break;
}
case 'richText':
{
if (!field?.editor) {
throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor
;
}
if (typeof field?.editor === 'function') {
throw new Error('Attempted to access unsanitized rich text editor.');
}
const editor = field?.editor;
if (editor?.hooks?.beforeChange?.length) {
for (const hook of editor.hooks.beforeChange){
const hookedValue = await hook({
collection,
context,
data,
docWithLocales,
errors,
field,
fieldLabelPath: field?.label === false ? fieldLabelPath : buildFieldLabel(fieldLabelPath, getTranslatedLabel(field?.label || field?.name, req.i18n)),
global,
indexPath: indexPathSegments,
mergeLocaleActions,
operation,
originalDoc: doc,
overrideAccess,
parentIsLocalized,
path: pathSegments,
previousSiblingDoc: siblingDoc,
previousValue: siblingDoc[field.name],
req,
schemaPath: schemaPathSegments,
siblingData,
siblingDocWithLocales,
skipValidation,
value: siblingData[field.name]
});
if (hookedValue !== undefined) {
siblingData[field.name] = hookedValue;
}
}
}
break;
}
case 'tab':
{
let tabSiblingData = siblingData;
let tabSiblingDoc = siblingDoc;
let tabSiblingDocWithLocales = siblingDocWithLocales;
const isNamedTab = tabHasName(field);
if (isNamedTab) {
if (typeof siblingData[field.name] !== 'object') {
siblingData[field.name] = {};
}
if (typeof siblingDoc[field.name] !== 'object') {
siblingDoc[field.name] = {};
}
if (typeof siblingDocWithLocales[field.name] !== 'object') {
siblingDocWithLocales[field.name] = {};
}
tabSiblingData = siblingData[field.name];
tabSiblingDoc = siblingDoc[field.name];
tabSiblingDocWithLocales = siblingDocWithLocales[field.name];
}
await traverseFields({
id,
blockData,
collection,
context,
data,
doc,
docWithLocales,
errors,
fieldLabelPath: field?.label === false ? fieldLabelPath : buildFieldLabel(fieldLabelPath, getTranslatedLabel(field?.label || field.name, req.i18n)),
fields: field.fields,
global,
mergeLocaleActions,
operation,
overrideAccess,
parentIndexPath: isNamedTab ? '' : indexPath,
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: isNamedTab ? path : parentPath,
parentSchemaPath: schemaPath,
req,
siblingData: tabSiblingData,
siblingDoc: tabSiblingDoc,
siblingDocWithLocales: tabSiblingDocWithLocales,
skipValidation: skipValidationFromHere
});
break;
}
case 'tabs':
{
await traverseFields({
id,
blockData,
collection,
context,
data,
doc,
docWithLocales,
errors,
fieldLabelPath: field?.label === false ? fieldLabelPath : buildFieldLabel(fieldLabelPath, getTranslatedLabel(field?.label || '', req.i18n)),
fields: field.tabs.map((tab)=>({
...tab,
type: 'tab'
})),
global,
mergeLocaleActions,
operation,
overrideAccess,
parentIndexPath: indexPath,
parentIsLocalized,
parentPath: path,
parentSchemaPath: schemaPath,
req,
siblingData,
siblingDoc,
siblingDocWithLocales: siblingDocWithLocales,
skipValidation: skipValidationFromHere
});
break;
}
default:
{
break;
}
}
};
//# sourceMappingURL=promise.js.map
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { isSameISOWeekYear as fn } from "../isSameISOWeekYear.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const isSameISOWeekYearWithOptions = convertToFP(fn, 3);
// Fallback for modularized imports:
export default isSameISOWeekYearWithOptions;
@@ -0,0 +1,199 @@
"use strict";
exports.formatDistance = formatDistance;
var _index = require("./_lib/defaultLocale.cjs");
var _index2 = require("./_lib/defaultOptions.cjs");
var _index3 = require("./_lib/getTimezoneOffsetInMilliseconds.cjs");
var _index4 = require("./_lib/normalizeDates.cjs");
var _index5 = require("./compareAsc.cjs");
var _index6 = require("./constants.cjs");
var _index7 = require("./differenceInMonths.cjs");
var _index8 = require("./differenceInSeconds.cjs");
/**
* The {@link formatDistance} function options.
*/
/**
* @name formatDistance
* @category Common Helpers
* @summary Return the distance between the given dates in words.
*
* @description
* Return the distance between the given dates in words.
*
* | Distance between dates | Result |
* |-------------------------------------------------------------------|---------------------|
* | 0 ... 30 secs | less than a minute |
* | 30 secs ... 1 min 30 secs | 1 minute |
* | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |
* | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |
* | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |
* | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |
* | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |
* | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |
* | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |
* | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |
* | 1 yr ... 1 yr 3 months | about 1 year |
* | 1 yr 3 months ... 1 yr 9 month s | over 1 year |
* | 1 yr 9 months ... 2 yrs | almost 2 years |
* | N yrs ... N yrs 3 months | about N years |
* | N yrs 3 months ... N yrs 9 months | over N years |
* | N yrs 9 months ... N+1 yrs | almost N+1 years |
*
* With `options.includeSeconds == true`:
* | Distance between dates | Result |
* |------------------------|----------------------|
* | 0 secs ... 5 secs | less than 5 seconds |
* | 5 secs ... 10 secs | less than 10 seconds |
* | 10 secs ... 20 secs | less than 20 seconds |
* | 20 secs ... 40 secs | half a minute |
* | 40 secs ... 60 secs | less than a minute |
* | 60 secs ... 90 secs | 1 minute |
*
* @param laterDate - The date
* @param earlierDate - The date to compare with
* @param options - An object with options
*
* @returns The distance in words
*
* @throws `date` must not be Invalid Date
* @throws `baseDate` must not be Invalid Date
* @throws `options.locale` must contain `formatDistance` property
*
* @example
* // What is the distance between 2 July 2014 and 1 January 2015?
* const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))
* //=> '6 months'
*
* @example
* // What is the distance between 1 January 2015 00:00:15
* // and 1 January 2015 00:00:00, including seconds?
* const result = formatDistance(
* new Date(2015, 0, 1, 0, 0, 15),
* new Date(2015, 0, 1, 0, 0, 0),
* { includeSeconds: true }
* )
* //=> 'less than 20 seconds'
*
* @example
* // What is the distance from 1 January 2016
* // to 1 January 2015, with a suffix?
* const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {
* addSuffix: true
* })
* //=> 'about 1 year ago'
*
* @example
* // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?
* import { eoLocale } from 'date-fns/locale/eo'
* const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {
* locale: eoLocale
* })
* //=> 'pli ol 1 jaro'
*/
function formatDistance(laterDate, earlierDate, options) {
const defaultOptions = (0, _index2.getDefaultOptions)();
const locale =
options?.locale ?? defaultOptions.locale ?? _index.defaultLocale;
const minutesInAlmostTwoDays = 2520;
const comparison = (0, _index5.compareAsc)(laterDate, earlierDate);
if (isNaN(comparison)) throw new RangeError("Invalid time value");
const localizeOptions = Object.assign({}, options, {
addSuffix: options?.addSuffix,
comparison: comparison,
});
const [laterDate_, earlierDate_] = (0, _index4.normalizeDates)(
options?.in,
...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),
);
const seconds = (0, _index8.differenceInSeconds)(earlierDate_, laterDate_);
const offsetInSeconds =
((0, _index3.getTimezoneOffsetInMilliseconds)(earlierDate_) -
(0, _index3.getTimezoneOffsetInMilliseconds)(laterDate_)) /
1000;
const minutes = Math.round((seconds - offsetInSeconds) / 60);
let months;
// 0 up to 2 mins
if (minutes < 2) {
if (options?.includeSeconds) {
if (seconds < 5) {
return locale.formatDistance("lessThanXSeconds", 5, localizeOptions);
} else if (seconds < 10) {
return locale.formatDistance("lessThanXSeconds", 10, localizeOptions);
} else if (seconds < 20) {
return locale.formatDistance("lessThanXSeconds", 20, localizeOptions);
} else if (seconds < 40) {
return locale.formatDistance("halfAMinute", 0, localizeOptions);
} else if (seconds < 60) {
return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
} else {
return locale.formatDistance("xMinutes", 1, localizeOptions);
}
} else {
if (minutes === 0) {
return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
} else {
return locale.formatDistance("xMinutes", minutes, localizeOptions);
}
}
// 2 mins up to 0.75 hrs
} else if (minutes < 45) {
return locale.formatDistance("xMinutes", minutes, localizeOptions);
// 0.75 hrs up to 1.5 hrs
} else if (minutes < 90) {
return locale.formatDistance("aboutXHours", 1, localizeOptions);
// 1.5 hrs up to 24 hrs
} else if (minutes < _index6.minutesInDay) {
const hours = Math.round(minutes / 60);
return locale.formatDistance("aboutXHours", hours, localizeOptions);
// 1 day up to 1.75 days
} else if (minutes < minutesInAlmostTwoDays) {
return locale.formatDistance("xDays", 1, localizeOptions);
// 1.75 days up to 30 days
} else if (minutes < _index6.minutesInMonth) {
const days = Math.round(minutes / _index6.minutesInDay);
return locale.formatDistance("xDays", days, localizeOptions);
// 1 month up to 2 months
} else if (minutes < _index6.minutesInMonth * 2) {
months = Math.round(minutes / _index6.minutesInMonth);
return locale.formatDistance("aboutXMonths", months, localizeOptions);
}
months = (0, _index7.differenceInMonths)(earlierDate_, laterDate_);
// 2 months up to 12 months
if (months < 12) {
const nearestMonth = Math.round(minutes / _index6.minutesInMonth);
return locale.formatDistance("xMonths", nearestMonth, localizeOptions);
// 1 year up to max Date
} else {
const monthsSinceStartOfYear = months % 12;
const years = Math.trunc(months / 12);
// N years up to 1 years 3 months
if (monthsSinceStartOfYear < 3) {
return locale.formatDistance("aboutXYears", years, localizeOptions);
// N years 3 months up to N years 9 months
} else if (monthsSinceStartOfYear < 9) {
return locale.formatDistance("overXYears", years, localizeOptions);
// N years 9 months up to N year 12 months
} else {
return locale.formatDistance("almostXYears", years + 1, localizeOptions);
}
}
}
@@ -0,0 +1,134 @@
/**
* Remove an element from the dom
*
* @category Manipulation
* @param elem The element to be removed
*/
export function removeElement(elem) {
if (elem.prev)
elem.prev.next = elem.next;
if (elem.next)
elem.next.prev = elem.prev;
if (elem.parent) {
const childs = elem.parent.children;
const childsIndex = childs.lastIndexOf(elem);
if (childsIndex >= 0) {
childs.splice(childsIndex, 1);
}
}
elem.next = null;
elem.prev = null;
elem.parent = null;
}
/**
* Replace an element in the dom
*
* @category Manipulation
* @param elem The element to be replaced
* @param replacement The element to be added
*/
export function replaceElement(elem, replacement) {
const prev = (replacement.prev = elem.prev);
if (prev) {
prev.next = replacement;
}
const next = (replacement.next = elem.next);
if (next) {
next.prev = replacement;
}
const parent = (replacement.parent = elem.parent);
if (parent) {
const childs = parent.children;
childs[childs.lastIndexOf(elem)] = replacement;
elem.parent = null;
}
}
/**
* Append a child to an element.
*
* @category Manipulation
* @param parent The element to append to.
* @param child The element to be added as a child.
*/
export function appendChild(parent, child) {
removeElement(child);
child.next = null;
child.parent = parent;
if (parent.children.push(child) > 1) {
const sibling = parent.children[parent.children.length - 2];
sibling.next = child;
child.prev = sibling;
}
else {
child.prev = null;
}
}
/**
* Append an element after another.
*
* @category Manipulation
* @param elem The element to append after.
* @param next The element be added.
*/
export function append(elem, next) {
removeElement(next);
const { parent } = elem;
const currNext = elem.next;
next.next = currNext;
next.prev = elem;
elem.next = next;
next.parent = parent;
if (currNext) {
currNext.prev = next;
if (parent) {
const childs = parent.children;
childs.splice(childs.lastIndexOf(currNext), 0, next);
}
}
else if (parent) {
parent.children.push(next);
}
}
/**
* Prepend a child to an element.
*
* @category Manipulation
* @param parent The element to prepend before.
* @param child The element to be added as a child.
*/
export function prependChild(parent, child) {
removeElement(child);
child.parent = parent;
child.prev = null;
if (parent.children.unshift(child) !== 1) {
const sibling = parent.children[1];
sibling.prev = child;
child.next = sibling;
}
else {
child.next = null;
}
}
/**
* Prepend an element before another.
*
* @category Manipulation
* @param elem The element to prepend before.
* @param prev The element be added.
*/
export function prepend(elem, prev) {
removeElement(prev);
const { parent } = elem;
if (parent) {
const childs = parent.children;
childs.splice(childs.indexOf(elem), 0, prev);
}
if (elem.prev) {
elem.prev.next = prev;
}
prev.parent = parent;
prev.prev = elem.prev;
prev.next = elem;
elem.prev = prev;
}
//# sourceMappingURL=manipulation.js.map
@@ -0,0 +1,7 @@
export declare const addMillisecondsWithOptions: import("./types.js").FPFn3<
Date,
| import("../addMilliseconds.js").AddMillisecondsOptions<Date>
| undefined,
number,
import("../fp.js").DateArg<Date>
>;
@@ -0,0 +1,20 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const TrainFront = createLucideIcon("TrainFront", [
["path", { d: "M8 3.1V7a4 4 0 0 0 8 0V3.1", key: "1v71zp" }],
["path", { d: "m9 15-1-1", key: "1yrq24" }],
["path", { d: "m15 15 1-1", key: "1t0d6s" }],
["path", { d: "M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z", key: "1p0hjs" }],
["path", { d: "m8 19-2 3", key: "13i0xs" }],
["path", { d: "m16 19 2 3", key: "xo31yx" }]
]);
export { TrainFront as default };
//# sourceMappingURL=train-front.js.map
@@ -0,0 +1,296 @@
// src/parser.ts
import { marked } from "marked";
// src/utils.ts
import { Renderer } from "marked";
// src/styles.ts
var emptyStyle = {};
var baseHeaderStyles = {
fontWeight: "500",
paddingTop: 20
};
var h1 = {
...baseHeaderStyles,
fontSize: "2.5rem"
};
var h2 = {
...baseHeaderStyles,
fontSize: "2rem"
};
var h3 = {
...baseHeaderStyles,
fontSize: "1.75rem"
};
var h4 = {
...baseHeaderStyles,
fontSize: "1.5rem"
};
var h5 = {
...baseHeaderStyles,
fontSize: "1.25rem"
};
var h6 = {
...baseHeaderStyles,
fontSize: "1rem"
};
var bold = {
fontWeight: "bold"
};
var italic = {
fontStyle: "italic"
};
var blockQuote = {
background: "#f9f9f9",
borderLeft: "10px solid #ccc",
margin: "1.5em 10px",
padding: "1em 10px"
};
var codeInline = {
color: "#212529",
fontSize: "87.5%",
display: "inline",
background: " #f8f8f8",
fontFamily: `SFMono-Regular,Menlo,Monaco,Consolas,monospace`
};
var codeBlock = {
...codeInline,
paddingTop: 10,
paddingRight: 10,
paddingLeft: 10,
paddingBottom: 1,
marginBottom: 20,
background: " #f8f8f8"
};
var link = {
color: "#007bff",
textDecoration: "underline",
backgroundColor: "transparent"
};
var styles = {
h1,
h2,
h3,
h4,
h5,
h6,
blockQuote,
bold,
italic,
link,
codeBlock: { ...codeBlock, wordWrap: "break-word" },
codeInline: { ...codeInline, wordWrap: "break-word" },
p: emptyStyle,
li: emptyStyle,
ul: emptyStyle,
ol: emptyStyle,
image: emptyStyle,
br: emptyStyle,
hr: emptyStyle,
table: emptyStyle,
thead: emptyStyle,
tbody: emptyStyle,
th: emptyStyle,
td: emptyStyle,
tr: emptyStyle,
strikethrough: emptyStyle
};
// src/utils.ts
function escapeQuotes(value) {
if (typeof value === "string" && value.includes('"')) {
return value.replace(/"/g, "&#x27;");
}
return value;
}
function camelToKebabCase(str) {
return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
}
function parseCssInJsToInlineCss(cssProperties) {
if (!cssProperties)
return "";
const numericalCssProperties = [
"width",
"height",
"margin",
"marginTop",
"marginRight",
"marginBottom",
"marginLeft",
"padding",
"paddingTop",
"paddingRight",
"paddingBottom",
"paddingLeft",
"borderWidth",
"borderTopWidth",
"borderRightWidth",
"borderBottomWidth",
"borderLeftWidth",
"outlineWidth",
"top",
"right",
"bottom",
"left",
"fontSize",
"lineHeight",
"letterSpacing",
"wordSpacing",
"maxWidth",
"minWidth",
"maxHeight",
"minHeight",
"borderRadius",
"borderTopLeftRadius",
"borderTopRightRadius",
"borderBottomLeftRadius",
"borderBottomRightRadius",
"textIndent",
"gridColumnGap",
"gridRowGap",
"gridGap",
"translateX",
"translateY"
];
return Object.entries(cssProperties).map(([property, value]) => {
if (typeof value === "number" && numericalCssProperties.includes(property)) {
return `${camelToKebabCase(property)}:${value}px`;
} else {
const escapedValue = escapeQuotes(value);
return `${camelToKebabCase(property)}:${escapedValue}`;
}
}).join(";");
}
var initRenderer = ({
customStyles
}) => {
const finalStyles = { ...styles, ...customStyles };
const customRenderer = new Renderer();
customRenderer.blockquote = (quote) => {
return `<blockquote${parseCssInJsToInlineCss(finalStyles.blockQuote) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.blockQuote)}"` : ""}>
${quote}</blockquote>
`;
};
customRenderer.br = () => {
return `<br${parseCssInJsToInlineCss(finalStyles.br) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.br)}"` : ""} />`;
};
customRenderer.code = (code) => {
code = code.replace(/\n$/, "") + "\n";
return `<pre${parseCssInJsToInlineCss(finalStyles.codeBlock) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.codeBlock)}"` : ""}><code>${code}</code></pre>
`;
};
customRenderer.codespan = (text) => {
return `<code${parseCssInJsToInlineCss(finalStyles.codeInline) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.codeInline)}"` : ""}>${text}</code>`;
};
customRenderer.del = (text) => {
return `<del${parseCssInJsToInlineCss(finalStyles.strikethrough) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.strikethrough)}"` : ""}>${text}</del>`;
};
customRenderer.em = (text) => {
return `<em${parseCssInJsToInlineCss(finalStyles.italic) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.italic)}"` : ""}>${text}</em>`;
};
customRenderer.heading = (text, level) => {
return `<h${level}${parseCssInJsToInlineCss(
finalStyles[`h${level}`]
) !== "" ? ` style="${parseCssInJsToInlineCss(
finalStyles[`h${level}`]
)}"` : ""}>${text}</h${level}>`;
};
customRenderer.hr = () => {
return `<hr${parseCssInJsToInlineCss(finalStyles.hr) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.hr)}"` : ""} />
`;
};
customRenderer.image = (href, _, text) => {
return `<img src="${href}" alt="${text}"${parseCssInJsToInlineCss(finalStyles.image) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.image)}"` : ""}>`;
};
customRenderer.link = (href, _, text) => {
return `<a href="${href}" target="_blank"${parseCssInJsToInlineCss(finalStyles.link) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.link)}"` : ""}>${text}</a>`;
};
customRenderer.list = (body, ordered, start) => {
const type = ordered ? "ol" : "ul";
const startatt = ordered && start !== 1 ? ' start="' + start + '"' : "";
const styles2 = parseCssInJsToInlineCss(
finalStyles[ordered ? "ol" : "ul"]
);
return "<" + type + startatt + `${styles2 !== "" ? ` style="${styles2}"` : ""}>
` + body + "</" + type + ">\n";
};
customRenderer.listitem = (text) => {
return `<li${parseCssInJsToInlineCss(finalStyles.li) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.li)}"` : ""}>${text}</li>
`;
};
customRenderer.paragraph = (text) => {
return `<p${parseCssInJsToInlineCss(finalStyles.p) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.p)}"` : ""}>${text}</p>
`;
};
customRenderer.strong = (text) => {
return `<strong${parseCssInJsToInlineCss(finalStyles.bold) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.bold)}"` : ""}>${text}</strong>`;
};
customRenderer.table = (header, body) => {
if (body)
body = `<tbody>${body}</tbody>`;
return `<table${parseCssInJsToInlineCss(finalStyles.table) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.table)}"` : ""}>
<thead${parseCssInJsToInlineCss(finalStyles.thead) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.thead)}"` : ""}>
${header}</thead>
${body}</table>
`;
};
customRenderer.tablecell = (content, flags) => {
const type = flags.header ? "th" : "td";
const tag = flags.align ? `<${type} align="${flags.align}"${parseCssInJsToInlineCss(finalStyles.td) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.td)}"` : ""}>` : `<${type}${parseCssInJsToInlineCss(finalStyles.td) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.td)}"` : ""}>`;
return tag + content + `</${type}>
`;
};
customRenderer.tablerow = (content) => {
return `<tr${parseCssInJsToInlineCss(finalStyles.tr) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.tr)}"` : ""}>
${content}</tr>
`;
};
return customRenderer;
};
// src/parser.ts
var MarkdownParser = class {
renderer;
constructor({ customStyles }) {
this.renderer = initRenderer({ customStyles });
}
parse(markdown) {
return marked.parse(markdown, { renderer: this.renderer });
}
};
// src/parseMarkdownToJSX.ts
var parseMarkdownToJSX = ({
markdown,
customStyles
}) => {
const parser = new MarkdownParser({ customStyles });
return parser.parse(markdown);
};
// src/components/emailMarkdown.tsx
import * as React from "react";
var EmailMarkdown = ({
markdown,
markdownCustomStyles,
markdownContainerStyles
}) => {
const parsedMarkdown = parseMarkdownToJSX({
markdown,
customStyles: markdownCustomStyles
});
return /* @__PURE__ */ React.createElement(
"div",
{
style: markdownContainerStyles,
dangerouslySetInnerHTML: { __html: parsedMarkdown }
}
);
};
export {
EmailMarkdown,
camelToKebabCase,
parseCssInJsToInlineCss,
parseMarkdownToJSX
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,96 @@
var once = require('once');
var noop = function() {};
var qnt = global.Bare ? queueMicrotask : process.nextTick.bind(process);
var isRequest = function(stream) {
return stream.setHeader && typeof stream.abort === 'function';
};
var isChildProcess = function(stream) {
return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
};
var eos = function(stream, opts, callback) {
if (typeof opts === 'function') return eos(stream, null, opts);
if (!opts) opts = {};
callback = once(callback || noop);
var ws = stream._writableState;
var rs = stream._readableState;
var readable = opts.readable || (opts.readable !== false && stream.readable);
var writable = opts.writable || (opts.writable !== false && stream.writable);
var cancelled = false;
var onlegacyfinish = function() {
if (!stream.writable) onfinish();
};
var onfinish = function() {
writable = false;
if (!readable) callback.call(stream);
};
var onend = function() {
readable = false;
if (!writable) callback.call(stream);
};
var onexit = function(exitCode) {
callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
};
var onerror = function(err) {
callback.call(stream, err);
};
var onclose = function() {
qnt(onclosenexttick);
};
var onclosenexttick = function() {
if (cancelled) return;
if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
};
var onrequest = function() {
stream.req.on('finish', onfinish);
};
if (isRequest(stream)) {
stream.on('complete', onfinish);
stream.on('abort', onclose);
if (stream.req) onrequest();
else stream.on('request', onrequest);
} else if (writable && !ws) { // legacy streams
stream.on('end', onlegacyfinish);
stream.on('close', onlegacyfinish);
}
if (isChildProcess(stream)) stream.on('exit', onexit);
stream.on('end', onend);
stream.on('finish', onfinish);
if (opts.error !== false) stream.on('error', onerror);
stream.on('close', onclose);
return function() {
cancelled = true;
stream.removeListener('complete', onfinish);
stream.removeListener('abort', onclose);
stream.removeListener('request', onrequest);
if (stream.req) stream.req.removeListener('finish', onfinish);
stream.removeListener('end', onlegacyfinish);
stream.removeListener('close', onlegacyfinish);
stream.removeListener('finish', onfinish);
stream.removeListener('exit', onexit);
stream.removeListener('end', onend);
stream.removeListener('error', onerror);
stream.removeListener('close', onclose);
};
};
module.exports = eos;
@@ -0,0 +1,20 @@
import { _ as _is_native_reflect_construct } from "./_is_native_reflect_construct.js";
import { _ as _set_prototype_of } from "./_set_prototype_of.js";
function _construct(Parent, args, Class) {
if (_is_native_reflect_construct()) _construct = Reflect.construct;
else {
_construct = function construct(Parent, args, Class) {
var a = [null];
a.push.apply(a, args);
var Constructor = Function.bind.apply(Parent, a);
var instance = new Constructor();
if (Class) _set_prototype_of(instance, Class.prototype);
return instance;
};
}
return _construct.apply(null, arguments);
}
export { _construct as _ };
@@ -0,0 +1,7 @@
Prism.languages.arduino = Prism.languages.extend('cpp', {
'keyword': /\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,
'constant': /\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,
'builtin': /\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/
});
Prism.languages.ino = Prism.languages.arduino;
@@ -0,0 +1,36 @@
export { Source } from './source.mjs';
export { getLocation } from './location.mjs';
export { printLocation, printSourceLocation } from './printLocation.mjs';
export { Kind } from './kinds.mjs';
export { TokenKind } from './tokenKind.mjs';
export { Lexer } from './lexer.mjs';
export {
parse,
parseValue,
parseConstValue,
parseType,
parseSchemaCoordinate,
} from './parser.mjs';
export { print } from './printer.mjs';
export {
visit,
visitInParallel,
getVisitFn,
getEnterLeaveForKind,
BREAK,
} from './visitor.mjs';
export { Location, Token, OperationTypeNode } from './ast.mjs';
export {
isDefinitionNode,
isExecutableDefinitionNode,
isSelectionNode,
isValueNode,
isConstValueNode,
isTypeNode,
isTypeSystemDefinitionNode,
isTypeDefinitionNode,
isTypeSystemExtensionNode,
isTypeExtensionNode,
isSchemaCoordinateNode,
} from './predicates.mjs';
export { DirectiveLocation } from './directiveLocation.mjs';
@@ -0,0 +1 @@
module.exports={C:{"5":0.07509,"78":0.04859,"115":0.00883,"128":0.25619,"145":0.52562,"146":1.09983,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 147 148 149 3.5 3.6"},D:{"63":0.00883,"64":0.12368,"69":0.07509,"80":0.04859,"83":0.0265,"86":0.00883,"89":0.00883,"99":0.00883,"103":0.04859,"105":0.01767,"106":0.04859,"107":0.03534,"108":0.05742,"109":0.29152,"110":0.03975,"111":0.08392,"112":0.04859,"116":0.24294,"117":0.03534,"120":0.06626,"123":0.01767,"124":0.03975,"125":0.29152,"126":0.53887,"128":0.00883,"129":0.00883,"131":0.08392,"132":0.04859,"133":0.10601,"135":0.03975,"136":0.05742,"137":0.01767,"138":0.12368,"139":0.05742,"140":0.27385,"141":0.53446,"142":3.04773,"143":3.5866,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 65 66 67 68 70 71 72 73 74 75 76 77 78 79 81 84 85 87 88 90 91 92 93 94 95 96 97 98 100 101 102 104 113 114 115 118 119 121 122 127 130 134 144 145 146"},F:{"95":0.04859,"115":0.0265,"124":11.32077,"125":2.46469,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"83":0.00883,"134":0.01767,"139":0.04859,"141":0.10601,"142":0.42403,"143":1.26326,_:"12 13 14 15 16 17 18 79 80 81 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 135 136 137 138 140"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 15.6 16.0 16.1 16.2 16.3 16.4 16.5 16.6 17.0 17.2 17.3 17.4 17.5 17.6 18.0 18.1 18.2 18.4 26.0 26.2 26.3","5.1":0.01767,"17.1":0.00883,"18.3":0.00883,"18.5-18.6":0.06626,"26.1":0.6493},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00098,"5.0-5.1":0,"6.0-6.1":0.00196,"7.0-7.1":0.00147,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00392,"10.0-10.2":0.00049,"10.3":0.00686,"11.0-11.2":0.08431,"11.3-11.4":0.00245,"12.0-12.1":0.00196,"12.2-12.5":0.02206,"13.0-13.1":0.00049,"13.2":0.00343,"13.3":0.00098,"13.4-13.7":0.00343,"14.0-14.4":0.00686,"14.5-14.8":0.00735,"15.0-15.1":0.00784,"15.2-15.3":0.00588,"15.4":0.00637,"15.5":0.00686,"15.6-15.8":0.10637,"16.0":0.01225,"16.1":0.02353,"16.2":0.01225,"16.3":0.02206,"16.4":0.00539,"16.5":0.00931,"16.6-16.7":0.13823,"17.0":0.00784,"17.1":0.01274,"17.2":0.00931,"17.3":0.01422,"17.4":0.02402,"17.5":0.04706,"17.6-17.7":0.10882,"18.0":0.02451,"18.1":0.05098,"18.2":0.02696,"18.3":0.08774,"18.4":0.0451,"18.5-18.7":3.23818,"26.0":0.06323,"26.1":0.52597,"26.2":0.1,"26.3":0.00441},P:{"4":0.09386,"24":0.06257,"25":0.03129,"26":0.01043,"27":0.59446,"28":0.14601,"29":1.09506,_:"20 21 22 23 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.02086},I:{"0":0.04459,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00004},A:{"11":0.17668,_:"6 7 8 9 10 5.5"},K:{"0":0.59738,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{"0":0.27915},H:{"0":0},L:{"0":62.51075},R:{_:"0"},M:{"0":0.0335}};
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/resolvers/globals/docAccess.ts"],"sourcesContent":["import type {\n PayloadRequest,\n SanitizedCollectionPermission,\n SanitizedGlobalConfig,\n SanitizedGlobalPermission,\n} from 'payload'\n\nimport { docAccessOperationGlobal, isolateObjectProperty } from 'payload'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver = (\n _: unknown,\n context: {\n req: PayloadRequest\n },\n) => Promise<SanitizedCollectionPermission | SanitizedGlobalPermission>\n\nexport function docAccessResolver(global: SanitizedGlobalConfig): Resolver {\n async function resolver(_, context: Context) {\n return docAccessOperationGlobal({\n globalConfig: global,\n req: isolateObjectProperty(context.req, 'transactionID'),\n })\n }\n\n return resolver\n}\n"],"names":["docAccessOperationGlobal","isolateObjectProperty","docAccessResolver","global","resolver","_","context","globalConfig","req"],"mappings":"AAOA,SAASA,wBAAwB,EAAEC,qBAAqB,QAAQ,UAAS;AAWzE,OAAO,SAASC,kBAAkBC,MAA6B;IAC7D,eAAeC,SAASC,CAAC,EAAEC,OAAgB;QACzC,OAAON,yBAAyB;YAC9BO,cAAcJ;YACdK,KAAKP,sBAAsBK,QAAQE,GAAG,EAAE;QAC1C;IACF;IAEA,OAAOJ;AACT"}
@@ -0,0 +1,17 @@
import type { RequiredDataFromCollectionSlug } from '../collections/config/types.js';
import type { AuthCollection, CollectionSlug, PayloadRequest } from '../index.js';
type ValidateUsernameOrEmailArgs<TSlug extends CollectionSlug> = {
authOptions: AuthCollection['config']['auth'];
collectionSlug: string;
data: RequiredDataFromCollectionSlug<TSlug>;
req: PayloadRequest;
} & ({
operation: 'create';
originalDoc?: never;
} | {
operation: 'update';
originalDoc: RequiredDataFromCollectionSlug<TSlug>;
});
export declare const ensureUsernameOrEmail: <TSlug extends CollectionSlug>({ authOptions: { disableLocalStrategy, loginWithUsername }, collectionSlug, data, operation, originalDoc, req, }: ValidateUsernameOrEmailArgs<TSlug>) => void;
export {};
//# sourceMappingURL=ensureUsernameOrEmail.d.ts.map
@@ -0,0 +1,18 @@
import type { TypedQueryBuilder } from "../query-builders/query-builder.cjs";
import type { AddAliasToSelection } from "../query-builders/select.types.cjs";
import type { ColumnsSelection, SQL } from "../sql/sql.cjs";
import type { Subquery, WithSubquery, WithSubqueryWithoutSelection } from "../subquery.cjs";
import type { QueryBuilder } from "./query-builders/query-builder.cjs";
export type SubqueryWithSelection<TSelection extends ColumnsSelection, TAlias extends string> = Subquery<TAlias, AddAliasToSelection<TSelection, TAlias, 'sqlite'>> & AddAliasToSelection<TSelection, TAlias, 'sqlite'>;
export type WithSubqueryWithSelection<TSelection extends ColumnsSelection, TAlias extends string> = WithSubquery<TAlias, AddAliasToSelection<TSelection, TAlias, 'sqlite'>> & AddAliasToSelection<TSelection, TAlias, 'sqlite'>;
export interface WithBuilder {
<TAlias extends string>(alias: TAlias): {
as: {
<TSelection extends ColumnsSelection>(qb: TypedQueryBuilder<TSelection> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>)): WithSubqueryWithSelection<TSelection, TAlias>;
(qb: TypedQueryBuilder<undefined> | ((qb: QueryBuilder) => TypedQueryBuilder<undefined>)): WithSubqueryWithoutSelection<TAlias>;
};
};
<TAlias extends string, TSelection extends ColumnsSelection>(alias: TAlias, selection: TSelection): {
as: (qb: SQL | ((qb: QueryBuilder) => SQL)) => WithSubqueryWithSelection<TSelection, TAlias>;
};
}
@@ -0,0 +1,28 @@
Prism.languages.j = {
'comment': {
pattern: /\bNB\..*/,
greedy: true
},
'string': {
pattern: /'(?:''|[^'\r\n])*'/,
greedy: true
},
'keyword': /\b(?:(?:CR|LF|adverb|conjunction|def|define|dyad|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/,
'verb': {
// Negative look-ahead prevents bad highlighting
// of ^: ;. =. =: !. !:
pattern: /(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,
alias: 'keyword'
},
'number': /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:ad|ar|[ejpx])_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/,
'adverb': {
pattern: /[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,
alias: 'builtin'
},
'operator': /[=a][.:]|_\./,
'conjunction': {
pattern: /&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,
alias: 'variable'
},
'punctuation': /[()]/
};
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/pg-core/columns/macaddr8.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyPgTable } from '../table.ts';\nimport { PgColumn, PgColumnBuilder } from './common.ts';\n\nexport type PgMacaddr8BuilderInitial<TName extends string> = PgMacaddr8Builder<{\n\tname: TName;\n\tdataType: 'string';\n\tcolumnType: 'PgMacaddr8';\n\tdata: string;\n\tdriverParam: string;\n\tenumValues: undefined;\n}>;\n\nexport class PgMacaddr8Builder<T extends ColumnBuilderBaseConfig<'string', 'PgMacaddr8'>> extends PgColumnBuilder<T> {\n\tstatic override readonly [entityKind]: string = 'PgMacaddr8Builder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'string', 'PgMacaddr8');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyPgTable<{ name: TTableName }>,\n\t): PgMacaddr8<MakeColumnConfig<T, TTableName>> {\n\t\treturn new PgMacaddr8<MakeColumnConfig<T, TTableName>>(table, this.config as ColumnBuilderRuntimeConfig<any, any>);\n\t}\n}\n\nexport class PgMacaddr8<T extends ColumnBaseConfig<'string', 'PgMacaddr8'>> extends PgColumn<T> {\n\tstatic override readonly [entityKind]: string = 'PgMacaddr8';\n\n\tgetSQLType(): string {\n\t\treturn 'macaddr8';\n\t}\n}\n\nexport function macaddr8(): PgMacaddr8BuilderInitial<''>;\nexport function macaddr8<TName extends string>(name: TName): PgMacaddr8BuilderInitial<TName>;\nexport function macaddr8(name?: string) {\n\treturn new PgMacaddr8Builder(name ?? '');\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAE3B,SAAS,UAAU,uBAAuB;AAWnC,MAAM,0BAAqF,gBAAmB;AAAA,EACpH,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB;AAC5B,UAAM,MAAM,UAAU,YAAY;AAAA,EACnC;AAAA;AAAA,EAGS,MACR,OAC8C;AAC9C,WAAO,IAAI,WAA4C,OAAO,KAAK,MAA8C;AAAA,EAClH;AACD;AAEO,MAAM,mBAAuE,SAAY;AAAA,EAC/F,QAA0B,UAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AACD;AAIO,SAAS,SAAS,MAAe;AACvC,SAAO,IAAI,kBAAkB,QAAQ,EAAE;AACxC;","names":[]}
@@ -0,0 +1 @@
{"version":3,"file":"createRelationshipMap.d.ts","sourceRoot":"","sources":["../../src/utilities/createRelationshipMap.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,SAAU,OAAO,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAqBrF,CAAA"}
@@ -0,0 +1,37 @@
import { entityKind } from "../../entity.cjs";
import type { PgDialectConfig } from "../dialect.cjs";
import { PgDialect } from "../dialect.cjs";
import type { SQLWrapper } from "../../sql/sql.cjs";
import { WithSubquery } from "../../subquery.cjs";
import type { PgColumn } from "../columns/index.cjs";
import type { WithBuilder } from "../subquery.cjs";
import { PgSelectBuilder } from "./select.cjs";
import type { SelectedFields } from "./select.types.cjs";
export declare class QueryBuilder {
static readonly [entityKind]: string;
private dialect;
private dialectConfig;
constructor(dialect?: PgDialect | PgDialectConfig);
$with: WithBuilder;
with(...queries: WithSubquery[]): {
select: {
(): PgSelectBuilder<undefined, "qb">;
<TSelection extends SelectedFields>(fields: TSelection): PgSelectBuilder<TSelection, "qb">;
};
selectDistinct: {
(): PgSelectBuilder<undefined, "qb">;
<TSelection extends SelectedFields>(fields: TSelection): PgSelectBuilder<TSelection, "qb">;
};
selectDistinctOn: {
(on: (PgColumn | SQLWrapper)[]): PgSelectBuilder<undefined, "qb">;
<TSelection extends SelectedFields>(on: (PgColumn | SQLWrapper)[], fields: TSelection): PgSelectBuilder<TSelection, "qb">;
};
};
select(): PgSelectBuilder<undefined, 'qb'>;
select<TSelection extends SelectedFields>(fields: TSelection): PgSelectBuilder<TSelection, 'qb'>;
selectDistinct(): PgSelectBuilder<undefined>;
selectDistinct<TSelection extends SelectedFields>(fields: TSelection): PgSelectBuilder<TSelection>;
selectDistinctOn(on: (PgColumn | SQLWrapper)[]): PgSelectBuilder<undefined>;
selectDistinctOn<TSelection extends SelectedFields>(on: (PgColumn | SQLWrapper)[], fields: TSelection): PgSelectBuilder<TSelection>;
private getDialect;
}
@@ -0,0 +1,101 @@
(function (Prism) {
function literal(str) {
return function () { return str; };
}
var keyword = /\b(?:align|allowzero|and|anyframe|anytype|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|nosuspend|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/;
var IDENTIFIER = '\\b(?!' + keyword.source + ')(?!\\d)\\w+\\b';
var ALIGN = /align\s*\((?:[^()]|\([^()]*\))*\)/.source;
var PREFIX_TYPE_OP = /(?:\?|\bpromise->|(?:\[[^[\]]*\]|\*(?!\*)|\*\*)(?:\s*<ALIGN>|\s*const\b|\s*volatile\b|\s*allowzero\b)*)/.source.replace(/<ALIGN>/g, literal(ALIGN));
var SUFFIX_EXPR = /(?:\bpromise\b|(?:\berror\.)?<ID>(?:\.<ID>)*(?!\s+<ID>))/.source.replace(/<ID>/g, literal(IDENTIFIER));
var TYPE = '(?!\\s)(?:!?\\s*(?:' + PREFIX_TYPE_OP + '\\s*)*' + SUFFIX_EXPR + ')+';
/*
* A simplified grammar for Zig compile time type literals:
*
* TypeExpr = ( "!"? PREFIX_TYPE_OP* SUFFIX_EXPR )+
*
* SUFFIX_EXPR = ( \b "promise" \b | ( \b "error" "." )? IDENTIFIER ( "." IDENTIFIER )* (?! \s+ IDENTIFIER ) )
*
* PREFIX_TYPE_OP = "?"
* | \b "promise" "->"
* | ( "[" [^\[\]]* "]" | "*" | "**" ) ( ALIGN | "const" \b | "volatile" \b | "allowzero" \b )*
*
* ALIGN = "align" "(" ( [^()] | "(" [^()]* ")" )* ")"
*
* IDENTIFIER = \b (?! KEYWORD ) [a-zA-Z_] \w* \b
*
*/
Prism.languages.zig = {
'comment': [
{
pattern: /\/\/[/!].*/,
alias: 'doc-comment'
},
/\/{2}.*/
],
'string': [
{
// "string" and c"string"
pattern: /(^|[^\\@])c?"(?:[^"\\\r\n]|\\.)*"/,
lookbehind: true,
greedy: true
},
{
// multiline strings and c-strings
pattern: /([\r\n])([ \t]+c?\\{2}).*(?:(?:\r\n?|\n)\2.*)*/,
lookbehind: true,
greedy: true
}
],
'char': {
// characters 'a', '\n', '\xFF', '\u{10FFFF}'
pattern: /(^|[^\\])'(?:[^'\\\r\n]|[\uD800-\uDFFF]{2}|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/,
lookbehind: true,
greedy: true
},
'builtin': /\B@(?!\d)\w+(?=\s*\()/,
'label': {
pattern: /(\b(?:break|continue)\s*:\s*)\w+\b|\b(?!\d)\w+\b(?=\s*:\s*(?:\{|while\b))/,
lookbehind: true
},
'class-name': [
// const Foo = struct {};
/\b(?!\d)\w+(?=\s*=\s*(?:(?:extern|packed)\s+)?(?:enum|struct|union)\s*[({])/,
{
// const x: i32 = 9;
// var x: Bar;
// fn foo(x: bool, y: f32) void {}
pattern: RegExp(/(:\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?[=;,)])|<TYPE>(?=\s*(?:<ALIGN>\s*)?\{)/.source.replace(/<TYPE>/g, literal(TYPE)).replace(/<ALIGN>/g, literal(ALIGN))),
lookbehind: true,
inside: null // see below
},
{
// extern fn foo(x: f64) f64; (optional alignment)
pattern: RegExp(/(\)\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?;)/.source.replace(/<TYPE>/g, literal(TYPE)).replace(/<ALIGN>/g, literal(ALIGN))),
lookbehind: true,
inside: null // see below
}
],
'builtin-type': {
pattern: /\b(?:anyerror|bool|c_u?(?:int|long|longlong|short)|c_longdouble|c_void|comptime_(?:float|int)|f(?:16|32|64|128)|[iu](?:8|16|32|64|128|size)|noreturn|type|void)\b/,
alias: 'keyword'
},
'keyword': keyword,
'function': /\b(?!\d)\w+(?=\s*\()/,
'number': /\b(?:0b[01]+|0o[0-7]+|0x[a-fA-F\d]+(?:\.[a-fA-F\d]*)?(?:[pP][+-]?[a-fA-F\d]+)?|\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)\b/,
'boolean': /\b(?:false|true)\b/,
'operator': /\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/,
'punctuation': /[.:,;(){}[\]]/
};
Prism.languages.zig['class-name'].forEach(function (obj) {
if (obj.inside === null) {
obj.inside = Prism.languages.zig;
}
});
}(Prism));
@@ -0,0 +1 @@
{"version":3,"file":"select-element-container.js","sourceRoot":"","sources":["../../../../src/dom/elements/select-element-container.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,0DAAsD;AAEtD;IAA4C,0CAAgB;IAExD,gCAAY,OAAgB,EAAE,OAA0B;QAAxD,YACI,kBAAM,OAAO,EAAE,OAAO,CAAC,SAG1B;QAFG,IAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC;QAC3D,KAAI,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;;IACjD,CAAC;IACL,6BAAC;AAAD,CAAC,AAPD,CAA4C,oCAAgB,GAO3D;AAPY,wDAAsB"}
@@ -0,0 +1,9 @@
const types = require('./dist/types')
const util = require('./dist/util')
module.exports = types.Schema
module.exports.nullOptions = types.nullOptions
module.exports.strOptions = types.strOptions
module.exports.stringify = util.stringifyString
require('./dist/legacy-exports').warnFileDeprecation(__filename)
@@ -0,0 +1,2 @@
import{throwIfEmpty as e}from"../../utils/throw-if-empty.js";const t=e=>()=>({path:`/deployments`,params:e??{},method:`GET`}),n=(t,n)=>()=>(e(t,`Provider cannot be empty`),{path:`/deployments/${t}`,params:n??{},method:`GET`}),r=t=>()=>(e(t,`Provider cannot be empty`),{path:`/deployments/${t}/dashboard`,method:`GET`}),i=t=>()=>(e(t,`Provider cannot be empty`),{path:`/deployments/${t}/projects`,method:`GET`}),a=(t,n,r)=>()=>(e(t,`Provider cannot be empty`),e(n,`Project ID cannot be empty`),{path:`/deployments/${t}/projects/${n}`,params:r??{},method:`GET`}),o=(t,n,r)=>()=>(e(t,`Provider cannot be empty`),e(n,`Project ID cannot be empty`),{path:`/deployments/${t}/projects/${n}/runs`,params:r??{},method:`GET`}),s=(t,n,r)=>()=>(e(t,`Provider cannot be empty`),e(n,`Run ID cannot be empty`),{path:`/deployments/${t}/runs/${n}`,params:r??{},method:`GET`});export{n as readDeployment,r as readDeploymentDashboard,a as readDeploymentProject,i as readDeploymentProjects,s as readDeploymentRun,o as readDeploymentRuns,t as readDeployments};
//# sourceMappingURL=deployment.js.map
@@ -0,0 +1,44 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import { SelectField, useTranslation } from '@payloadcms/ui';
import React from 'react';
export const LocaleSelector = t0 => {
const $ = _c(6);
const {
localeOptions,
onChange
} = t0;
const {
t
} = useTranslation();
let t1;
if ($[0] !== localeOptions || $[1] !== onChange || $[2] !== t) {
let t2;
if ($[4] !== onChange) {
t2 = value => onChange(value);
$[4] = onChange;
$[5] = t2;
} else {
t2 = $[5];
}
t1 = _jsx(SelectField, {
field: {
name: "locale",
label: t("general:locale"),
options: localeOptions
},
onChange: t2,
path: "locale"
});
$[0] = localeOptions;
$[1] = onChange;
$[2] = t;
$[3] = t1;
} else {
t1 = $[3];
}
return t1;
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/elements/DocumentDrawer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAChF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,KAAK,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAA;AAE/D,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtC;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAA;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAA;IAC3B;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAA;IACjC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAC3C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;IACtC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;IACtC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;IACzC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAA;CACxC,GAAG,IAAI,CAAC,0BAA0B,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,GACzE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;CAC9B,GAAG,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAE/C,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;IACrB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,YAAY,EAAE,MAAM,IAAI,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,CAC9B,IAAI,EAAE,IAAI,CAAC,mBAAmB,EAAE,gBAAgB,GAAG,IAAI,GAAG,0BAA0B,CAAC,KAClF;IAEH,KAAK,CAAC,EAAE,CACN;QACE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;KAC3B,GAAG,IAAI,CAAC,mBAAmB,EAAE,gBAAgB,GAAG,WAAW,CAAC,CAC9D;IAED,KAAK,CAAC,EAAE,CACN;QACE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;KAC3B,GAAG,IAAI,CAAC,oBAAoB,EAAE,gBAAgB,GAAG,WAAW,CAAC,CAC/D;IAED,wBAAwB;CACzB,CAAA"}
@@ -0,0 +1,37 @@
# Security Policy
## Supported Versions
The most recently published version is the only supported version. We simply do not have the maintainer capacity to support multiple versions.
## Security Releases
The most recently published version is the only supported version. If there's a security issue in that version, then we will fix it by publishing a new version that addresses the vulnerability, but we will not support or update any previous versions.
__Example Scenario__
If we eventually publish 6.0.0 and a security issue is found in 5.1.3, and it's still in 6.0.0, then we will fix it in 6.0.1 or 6.1.0 (or possibly 7.0.0 if it requires breaking backward compatibility for some reason -- this should be rare), but we will not also publish 5.1.4 or 5.2.1 to fix it.
There could also be a scenario where we're in a pre-release on a new major and a security issue is discovered in the current 5.1.3 release. In that case, we would try to fix it in the current non-pre-release, and bring that forward into the pre-release, but that's as far back as we would go (though we don't consider that going back because the latest release isn't a "full" release, it's still in pre-release stage, so we don't expect everyone to want to adopt a pre-release to get security fix).
## Release Cadence
This happens whenever there's something new to publish, regardless of the [Semver](https://semver.org/) bump, though we try to avoid breaking changes (majors) as much as possible. That time may come, however, and the major version change is an indication that there _may_ be a large change/break in functionality. We may also publish a major out of an abundance of caution, even if there are technically no known backward compatibility breaks, if there have been many internal changes.
When planning a major break in functionality for a new major release where we wish to gather feedback from the community prior to officially publishing it, we would leverage the pre-release version indicator by publishing 6.0.0-alpha.1, for example. After gathering some feedback, we may publishing additional pre-release versions, until we would finally officially publish as 6.0.0.
We may not always leverage pre-releases for breaking changes, however. One scenario would be a complex security issue that would force a breaking change, and needs immediate fixing.
## Backwards Compatibility
This is only guaranteed _within_ a major, not from one major to the next. [Semver](https://semver.org/) states that, "the major version is incremented if any backwards _incompatible_ changes are introduced." That is what we respect for this package. Patches are bug fixes that remain backward compatible (to the current major), minors for new features (or significant internal changes) that remain backward-compatible (to the current major), and majors are for breaking changes (from the previous major).
## Reporting Vulnerabilities
If you believe you have found a security vulnerability in this package, please contact one of the maintainers directly and provide them with details, severity, and a reproduction. We would also welcome a suggested fix if you have one.
Any verified and accepted security vulnerabilities will be rewarded with a listing in a special "Hall of Fame" section of our README, similar to our [Contributors](./README.md#contributors) section. We do NOT offer any type of reward whatsoever other than this listing, and we do NOT guarantee that the listing will remain in the repository for any release made after the one which will address the vulnerability.
### Maintainers
- [Stefan Cameron](mailto:stefan@stefcameron.com)
@@ -0,0 +1 @@
{"version":3,"file":"fileFactory.d.ts","sourceRoot":"","sources":["../../../src/uploads/fetchAPI-multipart/fileFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAoC3C,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AACD,KAAK,WAAW,GAAG,CACjB,OAAO,EAAE,kBAAkB,EAC3B,iBAAiB,EAAE,yBAAyB,KACzC,SAAS,CAAA;AACd,eAAO,MAAM,WAAW,EAAE,WA4BzB,CAAA"}
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FlaskRound = createLucideIcon("FlaskRound", [
["path", { d: "M10 2v7.31", key: "5d1hyh" }],
["path", { d: "M14 9.3V1.99", key: "14k4l0" }],
["path", { d: "M8.5 2h7", key: "csnxdl" }],
["path", { d: "M14 9.3a6.5 6.5 0 1 1-4 0", key: "1r8fvy" }],
["path", { d: "M5.52 16h12.96", key: "46hh1i" }]
]);
export { FlaskRound as default };
//# sourceMappingURL=flask-round.js.map
@@ -0,0 +1,3 @@
export { HapiInstrumentation } from './instrumentation';
export { AttributeNames } from './enums/AttributeNames';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
export { replayCanvasIntegration } from './canvas';
export { ReplayCanvasIntegrationOptions } from './canvas';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,56 @@
/**
* Generate secure URL-friendly unique ID. The non-blocking version.
*
* By default, the ID will have 21 symbols to have a collision probability
* similar to UUID v4.
*
* ```js
* import { nanoid } from 'nanoid/async'
* nanoid().then(id => {
* model.id = id
* })
* ```
*
* @param size Size of the ID. The default size is 21.
* @returns A promise with a random string.
*/
export function nanoid(size?: number): Promise<string>
/**
* A low-level function.
* Generate secure unique ID with custom alphabet. The non-blocking version.
*
* Alphabet must contain 256 symbols or less. Otherwise, the generator
* will not be secure.
*
* @param alphabet Alphabet used to generate the ID.
* @param defaultSize Size of the ID. The default size is 21.
* @returns A function that returns a promise with a random string.
*
* ```js
* import { customAlphabet } from 'nanoid/async'
* const nanoid = customAlphabet('0123456789абвгдеё', 5)
* nanoid().then(id => {
* model.id = id //=> "8ё56а"
* })
* ```
*/
export function customAlphabet(
alphabet: string,
defaultSize?: number
): (size?: number) => Promise<string>
/**
* Generate an array of random bytes collected from hardware noise.
*
* ```js
* import { random } from 'nanoid/async'
* random(5).then(bytes => {
* bytes //=> [10, 67, 212, 67, 89]
* })
* ```
*
* @param bytes Size of the array.
* @returns A promise with a random bytes array.
*/
export function random(bytes: number): Promise<Uint8Array>
@@ -0,0 +1,23 @@
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
export const RenderComponent = ({
Component,
Fallback,
props = {}
}) => {
if (Array.isArray(Component)) {
return Component.map((c, index) => /*#__PURE__*/_jsx(RenderComponent, {
Component: c,
props: props
}, index));
}
if (typeof Component === 'function') {
return /*#__PURE__*/_jsx(Component, {
...props
});
}
return Fallback ? /*#__PURE__*/_jsx(Fallback, {
...props
}) : null;
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,22 @@
import { DirectusShare } from "../../../schema/share.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/delete/shares.d.ts
/**
* Delete multiple existing shares.
* @param keys
* @returns
* @throws Will throw if keys is empty
*/
declare const deleteShares: <Schema>(keys: DirectusShare<Schema>["id"][]) => RestCommand<void, Schema>;
/**
* Delete an existing share.
* @param key
* @returns
* @throws Will throw if key is empty
*/
declare const deleteShare: <Schema>(key: DirectusShare<Schema>["id"]) => RestCommand<void, Schema>;
//#endregion
export { deleteShare, deleteShares };
//# sourceMappingURL=shares.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"getCustomViewByKey.js","names":["getCustomViewByKey","config","viewKey","customViewComponent","admin","components","views","view","payloadComponent","Component"],"sources":["../../../src/views/Root/getCustomViewByKey.ts"],"sourcesContent":["import type { AdminViewServerProps, PayloadComponent, SanitizedConfig } from 'payload'\n\nimport type { ViewFromConfig } from './getRouteData.js'\n\nexport const getCustomViewByKey = ({\n config,\n viewKey,\n}: {\n config: SanitizedConfig\n viewKey: string\n}): {\n view: ViewFromConfig\n viewKey: string\n} | null => {\n const customViewComponent = config.admin.components?.views?.[viewKey]\n\n if (!customViewComponent) {\n return null\n }\n\n return {\n view: {\n payloadComponent: customViewComponent.Component as PayloadComponent<AdminViewServerProps>,\n },\n viewKey,\n }\n}\n"],"mappings":"AAIA,OAAO,MAAMA,kBAAA,GAAqBA,CAAC;EACjCC,MAAM;EACNC;AAAO,CAIR;EAIC,MAAMC,mBAAA,GAAsBF,MAAA,CAAOG,KAAK,CAACC,UAAU,EAAEC,KAAA,GAAQJ,OAAA,CAAQ;EAErE,IAAI,CAACC,mBAAA,EAAqB;IACxB,OAAO;EACT;EAEA,OAAO;IACLI,IAAA,EAAM;MACJC,gBAAA,EAAkBL,mBAAA,CAAoBM;IACxC;IACAP;EACF;AACF","ignoreList":[]}
@@ -0,0 +1,14 @@
@import '../../scss/styles';
@layer payload-default {
.icon--externalLink {
height: $baseline;
width: $baseline;
shape-rendering: auto;
.stroke {
fill: none;
stroke: currentColor;
}
}
}
@@ -0,0 +1,3 @@
import type { AuthStrategyFunctionArgs } from './index.js';
export declare const extractJWT: (args: Omit<AuthStrategyFunctionArgs, "strategyName">) => null | string;
//# sourceMappingURL=extractJWT.d.ts.map
@@ -0,0 +1,13 @@
import getWindow from './isWindow';
import offset from './offset';
/**
* Returns the width of a given element.
*
* @param node the element
* @param client whether to use `clientWidth` if possible
*/
export default function getWidth(node, client) {
var win = getWindow(node);
return win ? win.innerWidth : client ? node.clientWidth : offset(node).width;
}
@@ -0,0 +1,36 @@
import { DirectusPermission } from "../../../schema/permission.js";
import { NestedPartial } from "../../../types/utils.js";
import { ApplyQueryFields } from "../../../types/output.js";
import { Query } from "../../../types/query.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/update/permissions.d.ts
type UpdatePermissionOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusPermission<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
/**
* Update multiple existing permissions rules.
* @param keys
* @param item
* @param query
* @returns Returns the permission object for the updated permissions.
* @throws Will throw if keys is empty
*/
declare const updatePermissions: <Schema, const TQuery extends Query<Schema, DirectusPermission<Schema>>>(keys: DirectusPermission<Schema>["id"][], item: NestedPartial<DirectusPermission<Schema>>, query?: TQuery) => RestCommand<UpdatePermissionOutput<Schema, TQuery>[], Schema>;
/**
* Update multiple permissions rules as batch.
* @param items
* @param query
* @returns Returns the permission object for the updated permissions.
*/
declare const updatePermissionsBatch: <Schema, const TQuery extends Query<Schema, DirectusPermission<Schema>>>(items: NestedPartial<DirectusPermission<Schema>>[], query?: TQuery) => RestCommand<UpdatePermissionOutput<Schema, TQuery>[], Schema>;
/**
* Update an existing permissions rule.
* @param key
* @param item
* @param query
* @returns Returns the permission object for the updated permission.
* @throws Will throw if key is empty
*/
declare const updatePermission: <Schema, const TQuery extends Query<Schema, DirectusPermission<Schema>>>(key: DirectusPermission<Schema>["id"], item: NestedPartial<DirectusPermission<Schema>>, query?: TQuery) => RestCommand<UpdatePermissionOutput<Schema, TQuery>, Schema>;
//#endregion
export { UpdatePermissionOutput, updatePermission, updatePermissions, updatePermissionsBatch };
//# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1,162 @@
import Busboy from 'busboy';
import { status as httpStatus } from 'http-status';
import { APIError } from '../../errors/APIError.js';
import { fileFactory } from './fileFactory.js';
import { memHandler, tempFileHandler } from './handlers.js';
import { processNested } from './processNested.js';
import { createUploadTimer } from './uploadTimer.js';
import { buildFields, debugLog, isFunc, parseFileName } from './utilities.js';
const waitFlushProperty = Symbol('wait flush property symbol');
export const processMultipart = async ({ options, request })=>{
let parsingRequest = true;
let shouldAbortProccessing = false;
let fileCount = 0;
let filesCompleted = 0;
let allFilesHaveResolved;
let failedResolvingFiles;
const allFilesComplete = new Promise((res, rej)=>{
allFilesHaveResolved = res;
failedResolvingFiles = rej;
});
const result = {
fields: undefined,
files: undefined
};
const headersObject = {};
request.headers.forEach((value, name)=>{
headersObject[name] = value;
});
const reader = request.body?.getReader();
const busboy = Busboy({
...options,
headers: headersObject
});
function abortAndDestroyFile(file, err) {
file.destroy();
shouldAbortProccessing = true;
failedResolvingFiles(err);
}
// Build multipart req.body fields
busboy.on('field', (field, val)=>{
result.fields = buildFields(result.fields, field, val);
});
// Build req.files fields
busboy.on('file', (field, file, info)=>{
fileCount += 1;
// Parse file name(cutting huge names, decoding, etc..).
const { encoding, filename: name, mimeType: mime } = info;
const filename = parseFileName(options, name);
const inferredMimeType = filename && filename.endsWith('.glb') && 'model/gltf-binary' || filename && filename.endsWith('.gltf') && 'model/gltf+json' || mime;
// Define methods and handlers for upload process.
const { cleanup, complete, dataHandler, getFilePath, getFileSize, getHash, getWritePromise } = options.useTempFiles ? tempFileHandler(options, field, filename) // Upload into temporary file.
: memHandler(options, field, filename) // Upload into RAM.
;
const writePromise = options.useTempFiles ? getWritePromise().catch(()=>{
busboy.end();
cleanup();
}) : getWritePromise();
const uploadTimer = createUploadTimer(options.uploadTimeout, ()=>{
return abortAndDestroyFile(file, new APIError(`Upload timeout for ${field}->${filename}, bytes:${getFileSize()}`));
});
file.on('limit', ()=>{
debugLog(options, `Size limit reached for ${field}->${filename}, bytes:${getFileSize()}`);
uploadTimer.clear();
if (isFunc(options.limitHandler)) {
options.limitHandler({
request,
size: getFileSize()
});
}
// Return error and cleanup files if abortOnLimit set.
if (options.abortOnLimit) {
debugLog(options, `Upload file size limit reached ${field}->${filename}.`);
cleanup();
abortAndDestroyFile(file, new APIError(options.responseOnLimit, httpStatus.REQUEST_ENTITY_TOO_LARGE, {
size: getFileSize()
}));
}
});
file.on('data', (data)=>{
uploadTimer.set();
dataHandler(data);
});
file.on('end', ()=>{
const size = getFileSize();
debugLog(options, `Upload finished ${field}->${filename}, bytes:${size}`);
uploadTimer.clear();
if (!name && size === 0) {
fileCount -= 1;
if (options.useTempFiles) {
cleanup();
debugLog(options, `Removing the empty file ${field}->${filename}`);
}
return debugLog(options, `Don't add file instance if original name and size are empty`);
}
filesCompleted += 1;
result.files = buildFields(result.files, field, fileFactory({
name: filename,
buffer: complete(),
encoding,
hash: getHash(),
mimetype: inferredMimeType,
size,
tempFilePath: getFilePath(),
truncated: Boolean('truncated' in file && file.truncated) || false
}, options));
if (!request[waitFlushProperty]) {
request[waitFlushProperty] = [];
}
request[waitFlushProperty].push(writePromise);
if (filesCompleted === fileCount) {
allFilesHaveResolved();
}
});
file.on('error', (err)=>{
uploadTimer.clear();
debugLog(options, `File Error: ${err.message}`);
cleanup();
failedResolvingFiles(err);
});
// Start upload process.
debugLog(options, `New upload started ${field}->${filename}, bytes:${getFileSize()}`);
uploadTimer.set();
});
busboy.on('finish', async ()=>{
debugLog(options, `Busboy finished parsing request.`);
if (options.parseNested) {
result.fields = processNested(result.fields);
result.files = processNested(result.files);
}
if (request[waitFlushProperty]) {
try {
await Promise.all(request[waitFlushProperty]).then(()=>{
delete request[waitFlushProperty];
});
} catch (err) {
debugLog(options, `Error waiting for file write promises: ${err}`);
}
}
return result;
});
busboy.on('error', (err = new APIError('Busboy error parsing multipart request', httpStatus.BAD_REQUEST))=>{
debugLog(options, `Busboy error`);
throw err;
});
while(parsingRequest){
const { done, value } = await reader.read();
if (done) {
parsingRequest = false;
}
if (value && !shouldAbortProccessing) {
busboy.write(value);
}
}
if (fileCount !== 0) {
await allFilesComplete.catch((e)=>{
throw e;
});
}
return result;
};
//# sourceMappingURL=processMultipart.js.map
@@ -0,0 +1 @@
{"version":3,"file":"migrateReset.d.ts","sourceRoot":"","sources":["../src/migrateReset.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAKhD;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA2EtE"}
@@ -0,0 +1,2 @@
const e=(e,t)=>()=>({path:`/translations`,params:t??{},body:JSON.stringify(e),method:`POST`}),t=(e,t)=>()=>({path:`/translations`,params:t??{},body:JSON.stringify(e),method:`POST`});exports.createTranslation=t,exports.createTranslations=e;
//# sourceMappingURL=translations.cjs.map
@@ -0,0 +1,40 @@
{
"name": "intl-messageformat",
"description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.",
"version": "11.1.2",
"license": "BSD-3-Clause",
"author": "Eric Ferraiuolo <eferraiuolo@gmail.com>",
"type": "module",
"sideEffects": false,
"types": "index.d.ts",
"exports": {
".": "./index.js"
},
"dependencies": {
"tslib": "^2.8.1",
"@formatjs/ecma402-abstract": "3.1.1",
"@formatjs/icu-messageformat-parser": "3.5.1",
"@formatjs/fast-memoize": "3.1.0"
},
"bugs": "https://github.com/formatjs/formatjs/issues",
"contributors": [
"Anthony Pipkin <a.pipkin@yahoo.com>",
"Caridy Patino <caridy@gmail.com>",
"Drew Folta <drew@folta.net>",
"Long Ho <holevietlong@gmail.com>"
],
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",
"homepage": "https://github.com/formatjs/formatjs",
"keywords": [
"globalization",
"i18n",
"icu",
"internationalization",
"intl",
"localization",
"messageformat",
"parser",
"plural"
],
"repository": "git@github.com:formatjs/formatjs.git"
}
@@ -0,0 +1,25 @@
import { getTranslation } from '@payloadcms/translations';
import { generateMetadata } from '../../utilities/meta.js';
export const generateCollectionTrashMetadata = async args => {
const {
collectionConfig,
config,
i18n
} = args;
let title = '';
const description = '';
const keywords = '';
if (collectionConfig) {
title = getTranslation(collectionConfig.labels.plural, i18n);
}
title = `${title ? `${title} ` : title}${i18n.t('general:trash')}`;
return generateMetadata({
...(config.admin.meta || {}),
description,
keywords,
serverURL: config.serverURL,
title,
...(collectionConfig?.admin?.meta || {})
});
};
//# sourceMappingURL=metadata.js.map
@@ -0,0 +1,355 @@
var constants = require('constants')
var origCwd = process.cwd
var cwd = null
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
process.cwd = function() {
if (!cwd)
cwd = origCwd.call(process)
return cwd
}
try {
process.cwd()
} catch (er) {}
// This check is needed until node.js 12 is required
if (typeof process.chdir === 'function') {
var chdir = process.chdir
process.chdir = function (d) {
cwd = null
chdir.call(process, d)
}
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)
}
module.exports = patch
function patch (fs) {
// (re-)implement some things that are known busted or missing.
// lchmod, broken prior to 0.6.2
// back-port the fix here.
if (constants.hasOwnProperty('O_SYMLINK') &&
process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
patchLchmod(fs)
}
// lutimes implementation, or no-op
if (!fs.lutimes) {
patchLutimes(fs)
}
// https://github.com/isaacs/node-graceful-fs/issues/4
// Chown should not fail on einval or eperm if non-root.
// It should not fail on enosys ever, as this just indicates
// that a fs doesn't support the intended operation.
fs.chown = chownFix(fs.chown)
fs.fchown = chownFix(fs.fchown)
fs.lchown = chownFix(fs.lchown)
fs.chmod = chmodFix(fs.chmod)
fs.fchmod = chmodFix(fs.fchmod)
fs.lchmod = chmodFix(fs.lchmod)
fs.chownSync = chownFixSync(fs.chownSync)
fs.fchownSync = chownFixSync(fs.fchownSync)
fs.lchownSync = chownFixSync(fs.lchownSync)
fs.chmodSync = chmodFixSync(fs.chmodSync)
fs.fchmodSync = chmodFixSync(fs.fchmodSync)
fs.lchmodSync = chmodFixSync(fs.lchmodSync)
fs.stat = statFix(fs.stat)
fs.fstat = statFix(fs.fstat)
fs.lstat = statFix(fs.lstat)
fs.statSync = statFixSync(fs.statSync)
fs.fstatSync = statFixSync(fs.fstatSync)
fs.lstatSync = statFixSync(fs.lstatSync)
// if lchmod/lchown do not exist, then make them no-ops
if (fs.chmod && !fs.lchmod) {
fs.lchmod = function (path, mode, cb) {
if (cb) process.nextTick(cb)
}
fs.lchmodSync = function () {}
}
if (fs.chown && !fs.lchown) {
fs.lchown = function (path, uid, gid, cb) {
if (cb) process.nextTick(cb)
}
fs.lchownSync = function () {}
}
// on Windows, A/V software can lock the directory, causing this
// to fail with an EACCES or EPERM if the directory contains newly
// created files. Try again on failure, for up to 60 seconds.
// Set the timeout this long because some Windows Anti-Virus, such as Parity
// bit9, may lock files for up to a minute, causing npm package install
// failures. Also, take care to yield the scheduler. Windows scheduling gives
// CPU to a busy looping process, which can cause the program causing the lock
// contention to be starved of CPU by node, so the contention doesn't resolve.
if (platform === "win32") {
fs.rename = typeof fs.rename !== 'function' ? fs.rename
: (function (fs$rename) {
function rename (from, to, cb) {
var start = Date.now()
var backoff = 0;
fs$rename(from, to, function CB (er) {
if (er
&& (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY")
&& Date.now() - start < 60000) {
setTimeout(function() {
fs.stat(to, function (stater, st) {
if (stater && stater.code === "ENOENT")
fs$rename(from, to, CB);
else
cb(er)
})
}, backoff)
if (backoff < 100)
backoff += 10;
return;
}
if (cb) cb(er)
})
}
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)
return rename
})(fs.rename)
}
// if read() returns EAGAIN, then just try it again.
fs.read = typeof fs.read !== 'function' ? fs.read
: (function (fs$read) {
function read (fd, buffer, offset, length, position, callback_) {
var callback
if (callback_ && typeof callback_ === 'function') {
var eagCounter = 0
callback = function (er, _, __) {
if (er && er.code === 'EAGAIN' && eagCounter < 10) {
eagCounter ++
return fs$read.call(fs, fd, buffer, offset, length, position, callback)
}
callback_.apply(this, arguments)
}
}
return fs$read.call(fs, fd, buffer, offset, length, position, callback)
}
// This ensures `util.promisify` works as it does for native `fs.read`.
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
return read
})(fs.read)
fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync
: (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
var eagCounter = 0
while (true) {
try {
return fs$readSync.call(fs, fd, buffer, offset, length, position)
} catch (er) {
if (er.code === 'EAGAIN' && eagCounter < 10) {
eagCounter ++
continue
}
throw er
}
}
}})(fs.readSync)
function patchLchmod (fs) {
fs.lchmod = function (path, mode, callback) {
fs.open( path
, constants.O_WRONLY | constants.O_SYMLINK
, mode
, function (err, fd) {
if (err) {
if (callback) callback(err)
return
}
// prefer to return the chmod error, if one occurs,
// but still try to close, and report closing errors if they occur.
fs.fchmod(fd, mode, function (err) {
fs.close(fd, function(err2) {
if (callback) callback(err || err2)
})
})
})
}
fs.lchmodSync = function (path, mode) {
var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
// prefer to return the chmod error, if one occurs,
// but still try to close, and report closing errors if they occur.
var threw = true
var ret
try {
ret = fs.fchmodSync(fd, mode)
threw = false
} finally {
if (threw) {
try {
fs.closeSync(fd)
} catch (er) {}
} else {
fs.closeSync(fd)
}
}
return ret
}
}
function patchLutimes (fs) {
if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
fs.lutimes = function (path, at, mt, cb) {
fs.open(path, constants.O_SYMLINK, function (er, fd) {
if (er) {
if (cb) cb(er)
return
}
fs.futimes(fd, at, mt, function (er) {
fs.close(fd, function (er2) {
if (cb) cb(er || er2)
})
})
})
}
fs.lutimesSync = function (path, at, mt) {
var fd = fs.openSync(path, constants.O_SYMLINK)
var ret
var threw = true
try {
ret = fs.futimesSync(fd, at, mt)
threw = false
} finally {
if (threw) {
try {
fs.closeSync(fd)
} catch (er) {}
} else {
fs.closeSync(fd)
}
}
return ret
}
} else if (fs.futimes) {
fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
fs.lutimesSync = function () {}
}
}
function chmodFix (orig) {
if (!orig) return orig
return function (target, mode, cb) {
return orig.call(fs, target, mode, function (er) {
if (chownErOk(er)) er = null
if (cb) cb.apply(this, arguments)
})
}
}
function chmodFixSync (orig) {
if (!orig) return orig
return function (target, mode) {
try {
return orig.call(fs, target, mode)
} catch (er) {
if (!chownErOk(er)) throw er
}
}
}
function chownFix (orig) {
if (!orig) return orig
return function (target, uid, gid, cb) {
return orig.call(fs, target, uid, gid, function (er) {
if (chownErOk(er)) er = null
if (cb) cb.apply(this, arguments)
})
}
}
function chownFixSync (orig) {
if (!orig) return orig
return function (target, uid, gid) {
try {
return orig.call(fs, target, uid, gid)
} catch (er) {
if (!chownErOk(er)) throw er
}
}
}
function statFix (orig) {
if (!orig) return orig
// Older versions of Node erroneously returned signed integers for
// uid + gid.
return function (target, options, cb) {
if (typeof options === 'function') {
cb = options
options = null
}
function callback (er, stats) {
if (stats) {
if (stats.uid < 0) stats.uid += 0x100000000
if (stats.gid < 0) stats.gid += 0x100000000
}
if (cb) cb.apply(this, arguments)
}
return options ? orig.call(fs, target, options, callback)
: orig.call(fs, target, callback)
}
}
function statFixSync (orig) {
if (!orig) return orig
// Older versions of Node erroneously returned signed integers for
// uid + gid.
return function (target, options) {
var stats = options ? orig.call(fs, target, options)
: orig.call(fs, target)
if (stats) {
if (stats.uid < 0) stats.uid += 0x100000000
if (stats.gid < 0) stats.gid += 0x100000000
}
return stats;
}
}
// ENOSYS means that the fs doesn't support the op. Just ignore
// that, because it doesn't matter.
//
// if there's no getuid, or if getuid() is something other
// than 0, and the error is EINVAL or EPERM, then just ignore
// it.
//
// This specific case is a silent failure in cp, install, tar,
// and most other unix tools that manage permissions.
//
// When running as root, or if other types of errors are
// encountered, then it's strict.
function chownErOk (er) {
if (!er)
return true
if (er.code === "ENOSYS")
return true
var nonroot = !process.getuid || process.getuid() !== 0
if (nonroot) {
if (er.code === "EINVAL" || er.code === "EPERM")
return true
}
return false
}
}
@@ -0,0 +1,36 @@
{
"name": "sanitize-filename",
"version": "1.6.3",
"description": "Sanitize a string for use as a filename",
"keywords": [
"file",
"name",
"filename",
"sanitize",
"validate",
"escape"
],
"license": "WTFPL OR ISC",
"author": "Parsha Pourkhomami",
"main": "index.js",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "git@github.com:parshap/node-sanitize-filename.git"
},
"scripts": {
"test": "tape test.js",
"test-browser": "airtap --local --open -- test.js",
"test-browser-sauce": "airtap -- test.js"
},
"dependencies": {
"truncate-utf8-bytes": "^1.0.0"
},
"devDependencies": {
"airtap": "^2.0.3",
"browserify": "^14.0.0",
"concat-stream": "^1.5.1",
"mktemp": "^0.4.0",
"tape": "^4.2.2"
}
}
@@ -0,0 +1,179 @@
import { GLOBAL_OBJ, getOriginalFunction, markFunctionWrapped, addNonEnumerableProperty, withScope, addExceptionTypeValue, addExceptionMechanism, captureException, getLocationHref } from '@sentry/core';
const WINDOW = GLOBAL_OBJ ;
let ignoreOnError = 0;
/**
* @hidden
*/
function shouldIgnoreOnError() {
return ignoreOnError > 0;
}
/**
* @hidden
*/
function ignoreNextOnError() {
// onerror should trigger before setTimeout
ignoreOnError++;
setTimeout(() => {
ignoreOnError--;
});
}
// eslint-disable-next-line @typescript-eslint/ban-types
/**
* Instruments the given function and sends an event to Sentry every time the
* function throws an exception.
*
* @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always
* has a correct `this` context.
* @returns The wrapped function.
* @hidden
*/
function wrap(
fn,
options
= {},
) {
// for future readers what this does is wrap a function and then create
// a bi-directional wrapping between them.
//
// example: wrapped = wrap(original);
// original.__sentry_wrapped__ -> wrapped
// wrapped.__sentry_original__ -> original
function isFunction(fn) {
return typeof fn === 'function';
}
if (!isFunction(fn)) {
return fn;
}
try {
// if we're dealing with a function that was previously wrapped, return
// the original wrapper.
const wrapper = (fn ).__sentry_wrapped__;
if (wrapper) {
if (typeof wrapper === 'function') {
return wrapper;
} else {
// If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means
// that something messed with it. In that case we want to return the originally passed function.
return fn;
}
}
// We don't wanna wrap it twice
if (getOriginalFunction(fn)) {
return fn;
}
} catch {
// Just accessing custom props in some Selenium environments
// can cause a "Permission denied" exception (see raven-js#495).
// Bail on wrapping and return the function as-is (defers to window.onerror).
return fn;
}
// Wrap the function itself
// It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`
const sentryWrapped = function ( ...args) {
try {
// Also wrap arguments that are themselves functions
const wrappedArguments = args.map(arg => wrap(arg, options));
// Attempt to invoke user-land function
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
// means the sentry.javascript SDK caught an error invoking your application code. This
// is expected behavior and NOT indicative of a bug with sentry.javascript.
return fn.apply(this, wrappedArguments);
} catch (ex) {
ignoreNextOnError();
withScope(scope => {
scope.addEventProcessor(event => {
if (options.mechanism) {
addExceptionTypeValue(event, undefined, undefined);
addExceptionMechanism(event, options.mechanism);
}
event.extra = {
...event.extra,
arguments: args,
};
return event;
});
// no need to add a mechanism here, we already add it via an event processor above
captureException(ex);
});
throw ex;
}
} ;
// Wrap the wrapped function in a proxy, to ensure any other properties of the original function remain available
try {
for (const property in fn) {
if (Object.prototype.hasOwnProperty.call(fn, property)) {
sentryWrapped[property ] = fn[property ];
}
}
} catch {
// Accessing some objects may throw
// ref: https://github.com/getsentry/sentry-javascript/issues/1168
}
// Signal that this function has been wrapped/filled already
// for both debugging and to prevent it to being wrapped/filled twice
markFunctionWrapped(sentryWrapped, fn);
addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);
// Restore original function name (not all browsers allow that)
try {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');
if (descriptor.configurable) {
Object.defineProperty(sentryWrapped, 'name', {
get() {
return fn.name;
},
});
}
} catch {
// This may throw if e.g. the descriptor does not exist, or a browser does not allow redefining `name`.
// to save some bytes we simply try-catch this
}
return sentryWrapped;
}
/**
* Get HTTP request data from the current page.
*/
function getHttpRequestData() {
// grab as much info as exists and add it to the event
const url = getLocationHref();
const { referrer } = WINDOW.document || {};
const { userAgent } = WINDOW.navigator || {};
const headers = {
...(referrer && { Referer: referrer }),
...(userAgent && { 'User-Agent': userAgent }),
};
const request = {
url,
headers,
};
return request;
}
export { WINDOW, getHttpRequestData, ignoreNextOnError, shouldIgnoreOnError, wrap };
//# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
{"version":3,"file":"providerSkip.js","sources":["../../../../src/utils/ai/providerSkip.ts"],"sourcesContent":["import { DEBUG_BUILD } from '../../debug-build';\nimport { debug } from '../debug-logger';\n\n/**\n * Registry tracking which AI provider modules should skip instrumentation wrapping.\n *\n * This prevents duplicate spans when a higher-level integration (like LangChain)\n * already instruments AI providers at a higher abstraction level.\n */\nconst SKIPPED_AI_PROVIDERS = new Set<string>();\n\n/**\n * Mark AI provider modules to skip instrumentation wrapping.\n *\n * This prevents duplicate spans when a higher-level integration (like LangChain)\n * already instruments AI providers at a higher abstraction level.\n *\n * @internal\n * @param modules - Array of npm module names to skip (e.g., '@anthropic-ai/sdk', 'openai')\n *\n * @example\n * ```typescript\n * // In LangChain integration\n * _INTERNAL_skipAiProviderWrapping(['@anthropic-ai/sdk', 'openai', '@google/generative-ai']);\n * ```\n */\nexport function _INTERNAL_skipAiProviderWrapping(modules: string[]): void {\n modules.forEach(module => {\n SKIPPED_AI_PROVIDERS.add(module);\n DEBUG_BUILD && debug.log(`AI provider \"${module}\" wrapping will be skipped`);\n });\n}\n\n/**\n * Check if an AI provider module should skip instrumentation wrapping.\n *\n * @internal\n * @param module - The npm module name (e.g., '@anthropic-ai/sdk', 'openai')\n * @returns true if wrapping should be skipped\n *\n * @example\n * ```typescript\n * // In AI provider instrumentation\n * if (_INTERNAL_shouldSkipAiProviderWrapping('@anthropic-ai/sdk')) {\n * return Reflect.construct(Original, args); // Don't instrument\n * }\n * ```\n */\nexport function _INTERNAL_shouldSkipAiProviderWrapping(module: string): boolean {\n return SKIPPED_AI_PROVIDERS.has(module);\n}\n\n/**\n * Clear all AI provider skip registrations.\n *\n * This is automatically called at the start of Sentry.init() to ensure a clean state\n * between different client initializations.\n *\n * @internal\n */\nexport function _INTERNAL_clearAiProviderSkips(): void {\n SKIPPED_AI_PROVIDERS.clear();\n DEBUG_BUILD && debug.log('Cleared AI provider skip registrations');\n}\n"],"names":["DEBUG_BUILD","debug"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,oBAAA,GAAuB,IAAI,GAAG,EAAU;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gCAAgC,CAAC,OAAO,EAAkB;AAC1E,EAAE,OAAO,CAAC,OAAO,CAAC,UAAU;AAC5B,IAAI,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC;AACpC,IAAIA,sBAAA,IAAeC,iBAAK,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAChF,EAAE,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sCAAsC,CAAC,MAAM,EAAmB;AAChF,EAAE,OAAO,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,8BAA8B,GAAS;AACvD,EAAE,oBAAoB,CAAC,KAAK,EAAE;AAC9B,EAAED,0BAAeC,iBAAK,CAAC,GAAG,CAAC,wCAAwC,CAAC;AACpE;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"statsig.d.ts","sourceRoot":"","sources":["../../../../src/integrations/featureFlagShims/statsig.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,sBAAsB,4DAWjC,CAAC"}
@@ -0,0 +1,7 @@
{
"name": "dom-helpers/filterEventHandler",
"private": true,
"main": "../cjs/filterEventHandler.js",
"module": "../esm/filterEventHandler.js",
"types": "../esm/filterEventHandler.d.ts"
}
@@ -0,0 +1,85 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var all_exports = {};
__export(all_exports, {
getSingleStoreColumnBuilders: () => getSingleStoreColumnBuilders
});
module.exports = __toCommonJS(all_exports);
var import_bigint = require("./bigint.cjs");
var import_binary = require("./binary.cjs");
var import_boolean = require("./boolean.cjs");
var import_char = require("./char.cjs");
var import_custom = require("./custom.cjs");
var import_date = require("./date.cjs");
var import_datetime = require("./datetime.cjs");
var import_decimal = require("./decimal.cjs");
var import_double = require("./double.cjs");
var import_enum = require("./enum.cjs");
var import_float = require("./float.cjs");
var import_int = require("./int.cjs");
var import_json = require("./json.cjs");
var import_mediumint = require("./mediumint.cjs");
var import_real = require("./real.cjs");
var import_serial = require("./serial.cjs");
var import_smallint = require("./smallint.cjs");
var import_text = require("./text.cjs");
var import_time = require("./time.cjs");
var import_timestamp = require("./timestamp.cjs");
var import_tinyint = require("./tinyint.cjs");
var import_varbinary = require("./varbinary.cjs");
var import_varchar = require("./varchar.cjs");
var import_vector = require("./vector.cjs");
var import_year = require("./year.cjs");
function getSingleStoreColumnBuilders() {
return {
bigint: import_bigint.bigint,
binary: import_binary.binary,
boolean: import_boolean.boolean,
char: import_char.char,
customType: import_custom.customType,
date: import_date.date,
datetime: import_datetime.datetime,
decimal: import_decimal.decimal,
double: import_double.double,
singlestoreEnum: import_enum.singlestoreEnum,
float: import_float.float,
int: import_int.int,
json: import_json.json,
mediumint: import_mediumint.mediumint,
real: import_real.real,
serial: import_serial.serial,
smallint: import_smallint.smallint,
longtext: import_text.longtext,
mediumtext: import_text.mediumtext,
text: import_text.text,
tinytext: import_text.tinytext,
time: import_time.time,
timestamp: import_timestamp.timestamp,
tinyint: import_tinyint.tinyint,
varbinary: import_varbinary.varbinary,
varchar: import_varchar.varchar,
vector: import_vector.vector,
year: import_year.year
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getSingleStoreColumnBuilders
});
//# sourceMappingURL=all.cjs.map
@@ -0,0 +1,820 @@
import React, { PureComponent, createRef } from 'react'
import { Ords, XYOrds, Crop, PixelCrop, PercentCrop } from './types'
import {
defaultCrop,
clamp,
cls,
areCropsEqual,
convertToPercentCrop,
convertToPixelCrop,
containCrop,
nudgeCrop,
} from './utils'
import './ReactCrop.scss'
interface EVData {
startClientX: number
startClientY: number
startCropX: number
startCropY: number
clientX: number
clientY: number
isResize: boolean
ord?: Ords
}
interface Rectangle {
x: number
y: number
width: number
height: number
}
const DOC_MOVE_OPTS = { capture: true, passive: false }
export interface ReactCropProps {
/** An object of labels to override the built-in English ones */
ariaLabels?: {
cropArea: string
nwDragHandle: string
nDragHandle: string
neDragHandle: string
eDragHandle: string
seDragHandle: string
sDragHandle: string
swDragHandle: string
wDragHandle: string
}
/** The aspect ratio of the crop, e.g. `1` for a square or `16 / 9` for landscape. */
aspect?: number
/** Classes to pass to the `ReactCrop` element. */
className?: string
/** The elements that you want to perform a crop on. For example
* an image or video. */
children?: React.ReactNode
/** Show the crop area as a circle. If your aspect is not 1 (a square) then the circle will be warped into an oval shape. Defaults to false. */
circularCrop?: boolean
/** Since v10 all crop params are required except for aspect. Omit the entire crop object if you don't want a crop. See README on how to create an aspect crop with a % crop. */
crop?: Crop
/** If true then the user cannot resize or draw a new crop. A class of `ReactCrop--disabled` is also added to the container for user styling. */
disabled?: boolean
/** If true then the user cannot create or resize a crop, but can still drag the existing crop around. A class of `ReactCrop--locked` is also added to the container for user styling. */
locked?: boolean
/** If true is passed then selection can't be disabled if the user clicks outside the selection area. */
keepSelection?: boolean
/** A minimum crop width, in pixels. */
minWidth?: number
/** A minimum crop height, in pixels. */
minHeight?: number
/** A maximum crop width, in pixels. */
maxWidth?: number
/** A maximum crop height, in pixels. */
maxHeight?: number
/** A callback which happens for every change of the crop. You should set the crop to state and pass it back into the library via the `crop` prop. */
onChange: (crop: PixelCrop, percentageCrop: PercentCrop) => void
/** A callback which happens after a resize, drag, or nudge. Passes the current crop state object in pixels and percent. */
onComplete?: (crop: PixelCrop, percentageCrop: PercentCrop) => void
/** A callback which happens when a user starts dragging or resizing. It is convenient to manipulate elements outside this component. */
onDragStart?: (e: PointerEvent) => void
/** A callback which happens when a user releases the cursor or touch after dragging or resizing. */
onDragEnd?: (e: PointerEvent) => void
/** Render a custom element in crop selection. */
renderSelectionAddon?: (state: ReactCropState) => React.ReactNode
/** Show rule of thirds lines in the cropped area. Defaults to false. */
ruleOfThirds?: boolean
/** Inline styles object to be passed to the `ReactCrop` element. */
style?: React.CSSProperties
}
export interface ReactCropState {
cropIsActive: boolean
newCropIsBeingDrawn: boolean
}
export class ReactCrop extends PureComponent<ReactCropProps, ReactCropState> {
static xOrds = ['e', 'w']
static yOrds = ['n', 's']
static xyOrds = ['nw', 'ne', 'se', 'sw']
static nudgeStep = 1
static nudgeStepMedium = 10
static nudgeStepLarge = 100
static defaultProps = {
ariaLabels: {
cropArea: 'Use the arrow keys to move the crop selection area',
nwDragHandle: 'Use the arrow keys to move the north west drag handle to change the crop selection area',
nDragHandle: 'Use the up and down arrow keys to move the north drag handle to change the crop selection area',
neDragHandle: 'Use the arrow keys to move the north east drag handle to change the crop selection area',
eDragHandle: 'Use the up and down arrow keys to move the east drag handle to change the crop selection area',
seDragHandle: 'Use the arrow keys to move the south east drag handle to change the crop selection area',
sDragHandle: 'Use the up and down arrow keys to move the south drag handle to change the crop selection area',
swDragHandle: 'Use the arrow keys to move the south west drag handle to change the crop selection area',
wDragHandle: 'Use the up and down arrow keys to move the west drag handle to change the crop selection area',
},
}
get document() {
return document
}
docMoveBound = false
mouseDownOnCrop = false
dragStarted = false
evData: EVData = {
startClientX: 0,
startClientY: 0,
startCropX: 0,
startCropY: 0,
clientX: 0,
clientY: 0,
isResize: true,
}
componentRef = createRef<HTMLDivElement>()
mediaRef = createRef<HTMLDivElement>()
resizeObserver?: ResizeObserver
initChangeCalled = false
state: ReactCropState = {
cropIsActive: false,
newCropIsBeingDrawn: false,
}
// We unfortunately get the bounding box every time as x+y changes
// due to scrolling.
getBox(): Rectangle {
const el = this.mediaRef.current
if (!el) {
return { x: 0, y: 0, width: 0, height: 0 }
}
const { x, y, width, height } = el.getBoundingClientRect()
return { x, y, width, height }
}
componentDidUpdate(prevProps: ReactCropProps) {
const { crop, onComplete } = this.props
// Useful for when programatically setting a new
// crop and wanting to show a preview.
if (onComplete && !prevProps.crop && crop) {
const { width, height } = this.getBox()
if (width && height) {
onComplete(convertToPixelCrop(crop, width, height), convertToPercentCrop(crop, width, height))
}
}
}
componentWillUnmount() {
if (this.resizeObserver) {
this.resizeObserver.disconnect()
}
}
bindDocMove() {
if (this.docMoveBound) {
return
}
this.document.addEventListener('pointermove', this.onDocPointerMove, DOC_MOVE_OPTS)
this.document.addEventListener('pointerup', this.onDocPointerDone, DOC_MOVE_OPTS)
this.document.addEventListener('pointercancel', this.onDocPointerDone, DOC_MOVE_OPTS)
this.docMoveBound = true
}
unbindDocMove() {
if (!this.docMoveBound) {
return
}
this.document.removeEventListener('pointermove', this.onDocPointerMove, DOC_MOVE_OPTS)
this.document.removeEventListener('pointerup', this.onDocPointerDone, DOC_MOVE_OPTS)
this.document.removeEventListener('pointercancel', this.onDocPointerDone, DOC_MOVE_OPTS)
this.docMoveBound = false
}
onCropPointerDown = (e: React.PointerEvent<HTMLDivElement>) => {
const { crop, disabled } = this.props
const box = this.getBox()
if (!crop) {
return
}
const pixelCrop = convertToPixelCrop(crop, box.width, box.height)
if (disabled) {
return
}
if (e.cancelable) e.preventDefault() // Stop drag selection.
// Bind to doc to follow movements outside of element.
this.bindDocMove()
// Focus for detecting keypress.
;(this.componentRef.current as HTMLDivElement).focus({ preventScroll: true })
const ord = (e.target as HTMLElement).dataset.ord as Ords
const isResize = Boolean(ord)
let startClientX = e.clientX
let startClientY = e.clientY
let startCropX = pixelCrop.x
let startCropY = pixelCrop.y
// Set the starting coords to the opposite corner.
if (ord) {
const relativeX = e.clientX - box.x
const relativeY = e.clientY - box.y
let fromCornerX = 0
let fromCornerY = 0
if (ord === 'ne' || ord == 'e') {
fromCornerX = relativeX - (pixelCrop.x + pixelCrop.width)
fromCornerY = relativeY - pixelCrop.y
startCropX = pixelCrop.x
startCropY = pixelCrop.y + pixelCrop.height
} else if (ord === 'se' || ord === 's') {
fromCornerX = relativeX - (pixelCrop.x + pixelCrop.width)
fromCornerY = relativeY - (pixelCrop.y + pixelCrop.height)
startCropX = pixelCrop.x
startCropY = pixelCrop.y
} else if (ord === 'sw' || ord == 'w') {
fromCornerX = relativeX - pixelCrop.x
fromCornerY = relativeY - (pixelCrop.y + pixelCrop.height)
startCropX = pixelCrop.x + pixelCrop.width
startCropY = pixelCrop.y
} else if (ord === 'nw' || ord == 'n') {
fromCornerX = relativeX - pixelCrop.x
fromCornerY = relativeY - pixelCrop.y
startCropX = pixelCrop.x + pixelCrop.width
startCropY = pixelCrop.y + pixelCrop.height
}
startClientX = startCropX + box.x + fromCornerX
startClientY = startCropY + box.y + fromCornerY
}
this.evData = {
startClientX,
startClientY,
startCropX,
startCropY,
clientX: e.clientX,
clientY: e.clientY,
isResize,
ord,
}
this.mouseDownOnCrop = true
this.setState({ cropIsActive: true })
}
onComponentPointerDown = (e: React.PointerEvent<HTMLDivElement>) => {
const { crop, disabled, locked, keepSelection, onChange } = this.props
const box = this.getBox()
if (disabled || locked || (keepSelection && crop)) {
return
}
if (e.cancelable) e.preventDefault() // Stop drag selection.
// Bind to doc to follow movements outside of element.
this.bindDocMove()
// Focus for detecting keypress.
;(this.componentRef.current as HTMLDivElement).focus({ preventScroll: true })
const cropX = e.clientX - box.x
const cropY = e.clientY - box.y
const nextCrop: PixelCrop = {
unit: 'px',
x: cropX,
y: cropY,
width: 0,
height: 0,
}
this.evData = {
startClientX: e.clientX,
startClientY: e.clientY,
startCropX: cropX,
startCropY: cropY,
clientX: e.clientX,
clientY: e.clientY,
isResize: true,
}
this.mouseDownOnCrop = true
onChange(convertToPixelCrop(nextCrop, box.width, box.height), convertToPercentCrop(nextCrop, box.width, box.height))
this.setState({ cropIsActive: true, newCropIsBeingDrawn: true })
}
onDocPointerMove = (e: PointerEvent) => {
const { crop, disabled, onChange, onDragStart } = this.props
const box = this.getBox()
if (disabled || !crop || !this.mouseDownOnCrop) {
return
}
// Stop drag selection.
if (e.cancelable) e.preventDefault()
if (!this.dragStarted) {
this.dragStarted = true
if (onDragStart) {
onDragStart(e)
}
}
// Update pointer position.
const { evData } = this
evData.clientX = e.clientX
evData.clientY = e.clientY
let nextCrop
if (evData.isResize) {
nextCrop = this.resizeCrop()
} else {
nextCrop = this.dragCrop()
}
if (!areCropsEqual(crop, nextCrop)) {
onChange(
convertToPixelCrop(nextCrop, box.width, box.height),
convertToPercentCrop(nextCrop, box.width, box.height)
)
}
}
onComponentKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {
const { crop, disabled, onChange, onComplete } = this.props
if (disabled) {
return
}
const keyCode = e.key
let nudged = false
if (!crop) {
return
}
const box = this.getBox()
const nextCrop = this.makePixelCrop(box)
const ctrlCmdPressed = navigator.platform.match('Mac') ? e.metaKey : e.ctrlKey
const nudgeStep = ctrlCmdPressed
? ReactCrop.nudgeStepLarge
: e.shiftKey
? ReactCrop.nudgeStepMedium
: ReactCrop.nudgeStep
if (keyCode === 'ArrowLeft') {
nextCrop.x -= nudgeStep
nudged = true
} else if (keyCode === 'ArrowRight') {
nextCrop.x += nudgeStep
nudged = true
} else if (keyCode === 'ArrowUp') {
nextCrop.y -= nudgeStep
nudged = true
} else if (keyCode === 'ArrowDown') {
nextCrop.y += nudgeStep
nudged = true
}
if (nudged) {
if (e.cancelable) e.preventDefault() // Stop drag selection.
nextCrop.x = clamp(nextCrop.x, 0, box.width - nextCrop.width)
nextCrop.y = clamp(nextCrop.y, 0, box.height - nextCrop.height)
const pixelCrop = convertToPixelCrop(nextCrop, box.width, box.height)
const percentCrop = convertToPercentCrop(nextCrop, box.width, box.height)
onChange(pixelCrop, percentCrop)
if (onComplete) {
onComplete(pixelCrop, percentCrop)
}
}
}
onHandlerKeyDown = (e: React.KeyboardEvent<HTMLDivElement>, ord: Ords) => {
const {
aspect = 0,
crop,
disabled,
minWidth = 0,
minHeight = 0,
maxWidth,
maxHeight,
onChange,
onComplete,
} = this.props
const box = this.getBox()
if (disabled || !crop) {
return
}
// Keep the event from bubbling up to the container
if (e.key === 'ArrowUp' || e.key === 'ArrowDown' || e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
e.stopPropagation()
e.preventDefault()
} else {
return
}
const ctrlCmdPressed = navigator.platform.match('Mac') ? e.metaKey : e.ctrlKey
const offset = ctrlCmdPressed
? ReactCrop.nudgeStepLarge
: e.shiftKey
? ReactCrop.nudgeStepMedium
: ReactCrop.nudgeStep
const pixelCrop = convertToPixelCrop(crop, box.width, box.height)
const nudgedCrop = nudgeCrop(pixelCrop, e.key, offset, ord)
const containedCrop = containCrop(
nudgedCrop,
aspect,
ord,
box.width,
box.height,
minWidth,
minHeight,
maxWidth,
maxHeight
)
if (!areCropsEqual(crop, containedCrop)) {
const percentCrop = convertToPercentCrop(containedCrop, box.width, box.height)
onChange(containedCrop, percentCrop)
if (onComplete) {
onComplete(containedCrop, percentCrop)
}
}
}
onDocPointerDone = (e: PointerEvent) => {
const { crop, disabled, onComplete, onDragEnd } = this.props
const box = this.getBox()
this.unbindDocMove()
if (disabled || !crop) {
return
}
if (this.mouseDownOnCrop) {
this.mouseDownOnCrop = false
this.dragStarted = false
onDragEnd && onDragEnd(e)
onComplete &&
onComplete(convertToPixelCrop(crop, box.width, box.height), convertToPercentCrop(crop, box.width, box.height))
this.setState({ cropIsActive: false, newCropIsBeingDrawn: false })
}
}
onDragFocus = (e: React.FocusEvent<HTMLDivElement, Element>) => {
// Fixes #491
this.componentRef.current?.scrollTo(0, 0)
}
getCropStyle() {
const { crop } = this.props
if (!crop) {
return undefined
}
return {
top: `${crop.y}${crop.unit}`,
left: `${crop.x}${crop.unit}`,
width: `${crop.width}${crop.unit}`,
height: `${crop.height}${crop.unit}`,
}
}
dragCrop() {
const { evData } = this
const box = this.getBox()
const nextCrop = this.makePixelCrop(box)
const xDiff = evData.clientX - evData.startClientX
const yDiff = evData.clientY - evData.startClientY
nextCrop.x = clamp(evData.startCropX + xDiff, 0, box.width - nextCrop.width)
nextCrop.y = clamp(evData.startCropY + yDiff, 0, box.height - nextCrop.height)
return nextCrop
}
getPointRegion(box: Rectangle, origOrd: Ords | undefined, minWidth: number, minHeight: number): XYOrds {
const { evData } = this
const relativeX = evData.clientX - box.x
const relativeY = evData.clientY - box.y
let topHalf: boolean
if (minHeight && origOrd) {
// Uses orig ord (never flip when minHeight != 0)
topHalf = origOrd === 'nw' || origOrd === 'n' || origOrd === 'ne'
} else {
topHalf = relativeY < evData.startCropY
}
let leftHalf: boolean
if (minWidth && origOrd) {
// Uses orig ord (never flip when minWidth != 0)
leftHalf = origOrd === 'nw' || origOrd === 'w' || origOrd === 'sw'
} else {
leftHalf = relativeX < evData.startCropX
}
if (leftHalf) {
return topHalf ? 'nw' : 'sw'
} else {
return topHalf ? 'ne' : 'se'
}
}
resolveMinDimensions(box: Rectangle, aspect: number, minWidth = 0, minHeight = 0) {
let mw = Math.min(minWidth, box.width)
let mh = Math.min(minHeight, box.height)
if (!aspect || (!mw && !mh)) {
return [mw, mh]
}
if (aspect > 1) {
return mw ? [mw, mw / aspect] : [mh * aspect, mh]
} else {
return mh ? [mh * aspect, mh] : [mw, mw / aspect]
}
}
resizeCrop() {
const { evData } = this
const { aspect = 0, maxWidth, maxHeight } = this.props
const box = this.getBox()
const [minWidth, minHeight] = this.resolveMinDimensions(box, aspect, this.props.minWidth, this.props.minHeight)
let nextCrop = this.makePixelCrop(box)
let area = this.getPointRegion(box, evData.ord, minWidth, minHeight)
const ord = evData.ord || area
let xDiff = evData.clientX - evData.startClientX
let yDiff = evData.clientY - evData.startClientY
// When min dimensions are set, ensure crop isn't dragged when going
// beyond the other side #554
if ((minWidth && ord === 'nw') || ord === 'w' || ord === 'sw') {
xDiff = Math.min(xDiff, -minWidth)
}
if ((minHeight && ord === 'nw') || ord === 'n' || ord === 'ne') {
yDiff = Math.min(yDiff, -minHeight)
}
const tmpCrop: PixelCrop = {
unit: 'px',
x: 0,
y: 0,
width: 0,
height: 0,
}
if (area === 'ne') {
tmpCrop.x = evData.startCropX
tmpCrop.width = xDiff
if (aspect) {
tmpCrop.height = tmpCrop.width / aspect
tmpCrop.y = evData.startCropY - tmpCrop.height
} else {
tmpCrop.height = Math.abs(yDiff)
tmpCrop.y = evData.startCropY - tmpCrop.height
}
} else if (area === 'se') {
tmpCrop.x = evData.startCropX
tmpCrop.y = evData.startCropY
tmpCrop.width = xDiff
if (aspect) {
tmpCrop.height = tmpCrop.width / aspect
} else {
tmpCrop.height = yDiff
}
} else if (area === 'sw') {
tmpCrop.x = evData.startCropX + xDiff
tmpCrop.y = evData.startCropY
tmpCrop.width = Math.abs(xDiff)
if (aspect) {
tmpCrop.height = tmpCrop.width / aspect
} else {
tmpCrop.height = yDiff
}
} else if (area === 'nw') {
tmpCrop.x = evData.startCropX + xDiff
tmpCrop.width = Math.abs(xDiff)
if (aspect) {
tmpCrop.height = tmpCrop.width / aspect
tmpCrop.y = evData.startCropY - tmpCrop.height
} else {
tmpCrop.height = Math.abs(yDiff)
tmpCrop.y = evData.startCropY + yDiff
}
}
const containedCrop = containCrop(
tmpCrop,
aspect,
area,
box.width,
box.height,
minWidth,
minHeight,
maxWidth,
maxHeight
)
// Apply x/y/width/height changes depending on ordinate
// (fixed aspect always applies both).
if (aspect || ReactCrop.xyOrds.indexOf(ord) > -1) {
nextCrop = containedCrop
} else if (ReactCrop.xOrds.indexOf(ord) > -1) {
nextCrop.x = containedCrop.x
nextCrop.width = containedCrop.width
} else if (ReactCrop.yOrds.indexOf(ord) > -1) {
nextCrop.y = containedCrop.y
nextCrop.height = containedCrop.height
}
// When drawing a new crop with min dimensions we allow flipping, but
// ensure we don't flip outside the crop area, just ignore those.
nextCrop.x = clamp(nextCrop.x, 0, box.width - nextCrop.width)
nextCrop.y = clamp(nextCrop.y, 0, box.height - nextCrop.height)
return nextCrop
}
createCropSelection() {
const {
ariaLabels = ReactCrop.defaultProps.ariaLabels,
disabled,
locked,
renderSelectionAddon,
ruleOfThirds,
crop,
} = this.props
const style = this.getCropStyle()
if (!crop) {
return undefined
}
return (
<div
style={style}
className="ReactCrop__crop-selection"
onPointerDown={this.onCropPointerDown}
aria-label={ariaLabels.cropArea}
tabIndex={0}
onKeyDown={this.onComponentKeyDown}
role="group"
>
{!disabled && !locked && (
<div className="ReactCrop__drag-elements" onFocus={this.onDragFocus}>
<div className="ReactCrop__drag-bar ord-n" data-ord="n" />
<div className="ReactCrop__drag-bar ord-e" data-ord="e" />
<div className="ReactCrop__drag-bar ord-s" data-ord="s" />
<div className="ReactCrop__drag-bar ord-w" data-ord="w" />
<div
className="ReactCrop__drag-handle ord-nw"
data-ord="nw"
tabIndex={0}
aria-label={ariaLabels.nwDragHandle}
onKeyDown={e => this.onHandlerKeyDown(e, 'nw')}
role="button"
/>
<div
className="ReactCrop__drag-handle ord-n"
data-ord="n"
tabIndex={0}
aria-label={ariaLabels.nDragHandle}
onKeyDown={e => this.onHandlerKeyDown(e, 'n')}
role="button"
/>
<div
className="ReactCrop__drag-handle ord-ne"
data-ord="ne"
tabIndex={0}
aria-label={ariaLabels.neDragHandle}
onKeyDown={e => this.onHandlerKeyDown(e, 'ne')}
role="button"
/>
<div
className="ReactCrop__drag-handle ord-e"
data-ord="e"
tabIndex={0}
aria-label={ariaLabels.eDragHandle}
onKeyDown={e => this.onHandlerKeyDown(e, 'e')}
role="button"
/>
<div
className="ReactCrop__drag-handle ord-se"
data-ord="se"
tabIndex={0}
aria-label={ariaLabels.seDragHandle}
onKeyDown={e => this.onHandlerKeyDown(e, 'se')}
role="button"
/>
<div
className="ReactCrop__drag-handle ord-s"
data-ord="s"
tabIndex={0}
aria-label={ariaLabels.sDragHandle}
onKeyDown={e => this.onHandlerKeyDown(e, 's')}
role="button"
/>
<div
className="ReactCrop__drag-handle ord-sw"
data-ord="sw"
tabIndex={0}
aria-label={ariaLabels.swDragHandle}
onKeyDown={e => this.onHandlerKeyDown(e, 'sw')}
role="button"
/>
<div
className="ReactCrop__drag-handle ord-w"
data-ord="w"
tabIndex={0}
aria-label={ariaLabels.wDragHandle}
onKeyDown={e => this.onHandlerKeyDown(e, 'w')}
role="button"
/>
</div>
)}
{renderSelectionAddon && (
<div className="ReactCrop__selection-addon" onMouseDown={e => e.stopPropagation()}>
{renderSelectionAddon(this.state)}
</div>
)}
{ruleOfThirds && (
<>
<div className="ReactCrop__rule-of-thirds-hz" />
<div className="ReactCrop__rule-of-thirds-vt" />
</>
)}
</div>
)
}
makePixelCrop(box: Rectangle) {
const crop = { ...defaultCrop, ...(this.props.crop || {}) }
return convertToPixelCrop(crop, box.width, box.height)
}
render() {
const { aspect, children, circularCrop, className, crop, disabled, locked, style, ruleOfThirds } = this.props
const { cropIsActive, newCropIsBeingDrawn } = this.state
const cropSelection = crop ? this.createCropSelection() : null
const componentClasses = cls(
'ReactCrop',
className,
cropIsActive && 'ReactCrop--active',
disabled && 'ReactCrop--disabled',
locked && 'ReactCrop--locked',
newCropIsBeingDrawn && 'ReactCrop--new-crop',
crop && aspect && 'ReactCrop--fixed-aspect',
crop && circularCrop && 'ReactCrop--circular-crop',
crop && ruleOfThirds && 'ReactCrop--rule-of-thirds',
!this.dragStarted && crop && !crop.width && !crop.height && 'ReactCrop--invisible-crop',
circularCrop && 'ReactCrop--no-animate'
)
return (
<div ref={this.componentRef} className={componentClasses} style={style}>
<div ref={this.mediaRef} className="ReactCrop__child-wrapper" onPointerDown={this.onComponentPointerDown}>
{children}
</div>
{cropSelection}
</div>
)
}
}
@@ -0,0 +1,51 @@
import { traverseFields } from './traverseFields.js';
export const transformForWrite = ({ adapter, data, enableAtomicWrites, fields, parentIsLocalized, path = '', tableName })=>{
// Split out the incoming data into rows to insert / delete
const rowToInsert = {
arrays: {},
arraysToPush: {},
blocks: {},
blocksToDelete: new Set(),
locales: {},
numbers: [],
numbersToDelete: [],
relationships: [],
relationshipsToAppend: [],
relationshipsToDelete: [],
row: {},
selects: {},
texts: [],
textsToDelete: []
};
// This function is responsible for building up the
// above rowToInsert
traverseFields({
adapter,
arrays: rowToInsert.arrays,
arraysToPush: rowToInsert.arraysToPush,
baseTableName: tableName,
blocks: rowToInsert.blocks,
blocksToDelete: rowToInsert.blocksToDelete,
columnPrefix: '',
data,
enableAtomicWrites,
fieldPrefix: '',
fields,
locales: rowToInsert.locales,
numbers: rowToInsert.numbers,
numbersToDelete: rowToInsert.numbersToDelete,
parentIsLocalized,
parentTableName: tableName,
path,
relationships: rowToInsert.relationships,
relationshipsToAppend: rowToInsert.relationshipsToAppend,
relationshipsToDelete: rowToInsert.relationshipsToDelete,
row: rowToInsert.row,
selects: rowToInsert.selects,
texts: rowToInsert.texts,
textsToDelete: rowToInsert.textsToDelete
});
return rowToInsert;
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,11 @@
@import '../../../scss/styles.scss';
@layer payload-default {
.popup-list-group-label {
color: var(--theme-elevation-500);
font-weight: 500;
line-height: 1;
margin-top: calc(var(--base) * 0.25);
margin-bottom: calc(var(--base) * 0.5);
}
}
@@ -0,0 +1 @@
{"version":3,"file":"operations.cjs","names":[],"sources":["../../../../src/rest/commands/read/operations.ts"],"sourcesContent":["import type { DirectusOperation } from '../../../schema/operation.js';\nimport type { ApplyQueryFields, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadOperationOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusOperation<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * List all operations that exist in Directus.\n * @param query The query parameters\n * @returns An array of up to limit operation objects. If no items are available, data will be an empty array.\n */\nexport const readOperations =\n\t<Schema, const TQuery extends Query<Schema, DirectusOperation<Schema>>>(\n\t\tquery?: TQuery,\n\t): RestCommand<ReadOperationOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/operations`,\n\t\tparams: query ?? {},\n\t\tmethod: 'GET',\n\t});\n\n/**\n * List all Operations that exist in Directus.\n * @param key The primary key of the dashboard\n * @param query The query parameters\n * @returns Returns a Operation object if a valid primary key was provided.\n * @throws Will throw if key is empty\n */\nexport const readOperation =\n\t<Schema, const TQuery extends Query<Schema, DirectusOperation<Schema>>>(\n\t\tkey: DirectusOperation<Schema>['id'],\n\t\tquery?: TQuery,\n\t): RestCommand<ReadOperationOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/operations/${key}`,\n\t\t\tparams: query ?? {},\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"kDAgBa,EAEX,QAEM,CACN,KAAM,cACN,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR,EASW,GAEX,EACA,SAGA,EAAA,aAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,eAAe,IACrB,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR"}
@@ -0,0 +1,87 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React, { useState } from 'react';
import { FieldLabel } from '../../fields/FieldLabel/index.js';
import { useForm } from '../../forms/Form/context.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { filterOutUploadFields } from '../../utilities/filterOutUploadFields.js';
import { ReactSelect } from '../ReactSelect/index.js';
import { reduceFieldOptions } from './reduceFieldOptions.js';
import './index.scss';
const baseClass = 'field-select';
export const FieldSelect = t0 => {
const $ = _c(14);
const {
fields,
onChange,
permissions
} = t0;
const {
t
} = useTranslation();
const {
dispatchFields,
getFields
} = useForm();
let t1;
if ($[0] !== fields || $[1] !== getFields || $[2] !== permissions) {
t1 = () => reduceFieldOptions({
fields: filterOutUploadFields(fields),
formState: getFields(),
permissions
});
$[0] = fields;
$[1] = getFields;
$[2] = permissions;
$[3] = t1;
} else {
t1 = $[3];
}
const [options] = useState(t1);
let t2;
if ($[4] !== dispatchFields || $[5] !== getFields || $[6] !== onChange || $[7] !== options || $[8] !== t) {
let t3;
if ($[10] !== dispatchFields || $[11] !== getFields || $[12] !== onChange) {
t3 = selected => onChange({
dispatchFields,
formState: getFields(),
selected
});
$[10] = dispatchFields;
$[11] = getFields;
$[12] = onChange;
$[13] = t3;
} else {
t3 = $[13];
}
t2 = _jsxs("div", {
className: baseClass,
children: [_jsx(FieldLabel, {
label: t("fields:selectFieldsToEdit")
}), _jsx(ReactSelect, {
getOptionValue: _temp,
isMulti: true,
onChange: t3,
options
})]
});
$[4] = dispatchFields;
$[5] = getFields;
$[6] = onChange;
$[7] = options;
$[8] = t;
$[9] = t2;
} else {
t2 = $[9];
}
return t2;
};
function _temp(option) {
if (typeof option.value === "object" && "path" in option.value) {
return String(option.value.path);
}
return String(option.value);
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,42 @@
import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../error.js';
const HSL_REGEX = /^hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)$/;
const validate = (value, ast) => {
if (typeof value !== 'string') {
throw createGraphQLError(`Value is not string: ${value}`, ast ? { nodes: ast } : undefined);
}
if (!HSL_REGEX.test(value)) {
throw createGraphQLError(`Value is not a valid HSL color: ${value}`, ast ? { nodes: ast } : undefined);
}
return value;
};
const specifiedByURL = 'https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla()';
export const GraphQLHSLConfig = /*#__PURE__*/ {
name: `HSL`,
description: `A field whose value is a CSS HSL color: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla().`,
serialize(value) {
return validate(value);
},
parseValue(value) {
return validate(value);
},
parseLiteral(ast) {
if (ast.kind !== Kind.STRING) {
throw createGraphQLError(`Can only validate strings as HSL colors but got a: ${ast.kind}`, {
nodes: ast,
});
}
return validate(ast.value, ast);
},
specifiedByURL,
specifiedByUrl: specifiedByURL,
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'HSL',
type: 'string',
pattern: HSL_REGEX.source,
},
},
};
export const GraphQLHSL = /*#__PURE__*/ new GraphQLScalarType(GraphQLHSLConfig);
@@ -0,0 +1,17 @@
var identity = require('./identity'),
overRest = require('./_overRest'),
setToString = require('./_setToString');
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
return setToString(overRest(func, start, identity), func + '');
}
module.exports = baseRest;
@@ -0,0 +1,33 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../ChunkGraph")} ChunkGraph */
class RuntimeIdRuntimeModule extends RuntimeModule {
constructor() {
super("runtimeId");
}
/**
* @returns {string | null} runtime code
*/
generate() {
const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph);
const chunk = /** @type {Chunk} */ (this.chunk);
const runtime = chunk.runtime;
if (typeof runtime !== "string") {
throw new Error("RuntimeIdRuntimeModule must be in a single runtime");
}
const id = chunkGraph.getRuntimeId(runtime);
return `${RuntimeGlobals.runtimeId} = ${JSON.stringify(id)};`;
}
}
module.exports = RuntimeIdRuntimeModule;
@@ -0,0 +1,90 @@
{
"name": "entities",
"version": "4.5.0",
"description": "Encode & decode XML and HTML entities with ease & speed",
"author": "Felix Boehm <me@feedic.com>",
"funding": "https://github.com/fb55/entities?sponsor=1",
"sideEffects": false,
"keywords": [
"entity",
"decoding",
"encoding",
"html",
"xml",
"html entities"
],
"directories": {
"lib": "lib/"
},
"main": "lib/index.js",
"types": "lib/index.d.ts",
"module": "lib/esm/index.js",
"exports": {
".": {
"require": "./lib/index.js",
"import": "./lib/esm/index.js"
},
"./lib/decode.js": {
"require": "./lib/decode.js",
"import": "./lib/esm/decode.js"
},
"./lib/escape.js": {
"require": "./lib/escape.js",
"import": "./lib/esm/escape.js"
}
},
"files": [
"lib/**/*"
],
"engines": {
"node": ">=0.12"
},
"devDependencies": {
"@types/jest": "^28.1.8",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-node": "^11.1.0",
"jest": "^28.1.3",
"prettier": "^2.8.7",
"ts-jest": "^28.0.8",
"typedoc": "^0.24.1",
"typescript": "^5.0.4"
},
"scripts": {
"test": "npm run test:jest && npm run lint",
"test:jest": "jest",
"lint": "npm run lint:es && npm run lint:prettier",
"lint:es": "eslint .",
"lint:prettier": "npm run prettier -- --check",
"format": "npm run format:es && npm run format:prettier",
"format:es": "npm run lint:es -- --fix",
"format:prettier": "npm run prettier -- --write",
"prettier": "prettier '**/*.{ts,md,json,yml}'",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/fb55/entities/$(git rev-parse HEAD)/src/",
"build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
"build:docs": "typedoc --hideGenerator src/index.ts",
"build:trie": "ts-node scripts/write-decode-map.ts",
"build:encode-trie": "ts-node scripts/write-encode-map.ts",
"prepare": "npm run build"
},
"repository": {
"type": "git",
"url": "git://github.com/fb55/entities.git"
},
"license": "BSD-2-Clause",
"jest": {
"preset": "ts-jest",
"coverageProvider": "v8",
"moduleNameMapper": {
"^(.*)\\.js$": "$1"
}
},
"prettier": {
"tabWidth": 4,
"proseWrap": "always"
}
}
@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/asyncContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,eAAe,EACf,cAAc,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,kBAAkB,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,cAAc,EAAE,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC;IAErE;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,cAAc,EAAE,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC;IAE5D;;OAEG;IACH,YAAY,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC;IAEpE;;OAEG;IACH,qBAAqB,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,cAAc,EAAE,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC;IAE/F;;OAEG;IACH,eAAe,EAAE,MAAM,KAAK,CAAC;IAE7B;;OAEG;IACH,iBAAiB,EAAE,MAAM,KAAK,CAAC;IAK/B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,OAAO,SAAS,CAAC;IAE7B,8BAA8B;IAC9B,iBAAiB,CAAC,EAAE,OAAO,iBAAiB,CAAC;IAE7C,mCAAmC;IACnC,eAAe,CAAC,EAAE,OAAO,eAAe,CAAC;IAEzC,qCAAqC;IACrC,aAAa,CAAC,EAAE,OAAO,aAAa,CAAC;IAErC,kEAAkE;IAClE,cAAc,CAAC,EAAE,OAAO,cAAc,CAAC;IAEvC,6FAA6F;IAC7F,eAAe,CAAC,EAAE,OAAO,eAAe,CAAC;IAEzC,mGAAmG;IACnG,YAAY,CAAC,EAAE,OAAO,YAAY,CAAC;IAEnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,aAAa,CAAC;CACtC"}
@@ -0,0 +1,23 @@
import type { ColumnBuilderBaseConfig, HasDefault, IsAutoincrement, IsPrimaryKey, NotNull } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from "./common.cjs";
export type MySqlSerialBuilderInitial<TName extends string> = IsAutoincrement<IsPrimaryKey<NotNull<HasDefault<MySqlSerialBuilder<{
name: TName;
dataType: 'number';
columnType: 'MySqlSerial';
data: number;
driverParam: number;
enumValues: undefined;
}>>>>>;
export declare class MySqlSerialBuilder<T extends ColumnBuilderBaseConfig<'number', 'MySqlSerial'>> extends MySqlColumnBuilderWithAutoIncrement<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class MySqlSerial<T extends ColumnBaseConfig<'number', 'MySqlSerial'>> extends MySqlColumnWithAutoIncrement<T> {
static readonly [entityKind]: string;
getSQLType(): string;
mapFromDriverValue(value: number | string): number;
}
export declare function serial(): MySqlSerialBuilderInitial<''>;
export declare function serial<TName extends string>(name: TName): MySqlSerialBuilderInitial<TName>;
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SquareMinus = createLucideIcon("SquareMinus", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M8 12h8", key: "1wcyev" }]
]);
export { SquareMinus as default };
//# sourceMappingURL=square-minus.js.map
@@ -0,0 +1 @@
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/utilities/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGhD,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,UAAU,EACX,MAAM,uBAAuB,CAAA;AAkB9B,MAAM,MAAM,wBAAwB,CAAC,KAAK,SAAS,cAAc,IAAI;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,WAAW,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAA;IAChD,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,UAAU,GAAG,UAAU,CAAA;IACvC,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,mBAAmB,CAAA;IACnC,aAAa,EAAE,UAAU,EAAE,CAAA;IAC3B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,OAAO,CAAA;IACvB,YAAY,EAAE,OAAO,CAAA;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,EAAE,UAAU,CAAA;IAClB,gBAAgB,EAAE,OAAO,CAAA;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,GACzB,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,uUAuB9C,wBAAwB,CAAC,KAAK,CAAC,KAAG,OAAO,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAyWzF,CAAA"}
@@ -0,0 +1,93 @@
import { withIsolationScope, getCurrentScope, winterCGRequestToRequestData, getActiveSpan, getRootSpan, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_OP, setCapturedScopesOnSpan, startSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, handleCallbackErrors, captureException } from '@sentry/core';
import { addHeadersAsAttributes } from '../common/utils/addHeadersAsAttributes.js';
import { waitUntil, flushSafelyWithTimeout } from '../common/utils/responseEnd.js';
/**
* Wraps a Next.js edge route handler with Sentry error and performance instrumentation.
*/
function wrapApiHandlerWithSentry(
handler,
parameterizedRoute,
) {
return new Proxy(handler, {
apply: async (wrappingTarget, thisArg, args) => {
// TODO: We still should add central isolation scope creation for when our build-time instrumentation does not work anymore with turbopack.
return withIsolationScope(isolationScope => {
const req = args[0];
const currentScope = getCurrentScope();
let headerAttributes = {};
if (req instanceof Request) {
isolationScope.setSDKProcessingMetadata({
normalizedRequest: winterCGRequestToRequestData(req),
});
currentScope.setTransactionName(`${req.method} ${parameterizedRoute}`);
headerAttributes = addHeadersAsAttributes(req.headers);
} else {
currentScope.setTransactionName(`handler (${parameterizedRoute})`);
}
let spanName;
let op = 'http.server';
// If there is an active span, it likely means that the automatic Next.js OTEL instrumentation worked and we can
// rely on that for parameterization.
const activeSpan = getActiveSpan();
if (activeSpan) {
spanName = `handler (${parameterizedRoute})`;
op = undefined;
const rootSpan = getRootSpan(activeSpan);
if (rootSpan) {
rootSpan.updateName(
req instanceof Request ? `${req.method} ${parameterizedRoute}` : `handler ${parameterizedRoute}`,
);
rootSpan.setAttributes({
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.server',
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',
...headerAttributes,
});
setCapturedScopesOnSpan(rootSpan, currentScope, isolationScope);
}
} else if (req instanceof Request) {
spanName = `${req.method} ${parameterizedRoute}`;
} else {
spanName = `handler ${parameterizedRoute}`;
}
return startSpan(
{
name: spanName,
op: op,
attributes: {
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.nextjs.wrap_api_handler',
...headerAttributes,
},
},
() => {
return handleCallbackErrors(
() => wrappingTarget.apply(thisArg, args),
error => {
captureException(error, {
mechanism: {
type: 'auto.function.nextjs.wrap_api_handler',
handled: false,
},
});
},
() => {
waitUntil(flushSafelyWithTimeout());
},
);
},
);
});
},
});
}
export { wrapApiHandlerWithSentry };
//# sourceMappingURL=wrapApiHandlerWithSentry.js.map
@@ -0,0 +1,20 @@
Copyright Mathias Bynens <https://mathiasbynens.be/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,2 @@
import{throwIfEmpty as e}from"../../utils/throw-if-empty.js";const t=(t,n)=>()=>(e(t,`ID cannot be empty`),{path:`/versions/${t}/save`,method:`POST`,body:JSON.stringify(n)}),n=t=>()=>(e(t,`ID cannot be empty`),{path:`/versions/${t}/compare`,method:`GET`}),r=(t,n,r)=>()=>(e(t,`ID cannot be empty`),{path:`/versions/${t}/promote`,method:`POST`,body:JSON.stringify(r?{mainHash:n,fields:r}:{mainHash:n})});export{n as compareContentVersion,r as promoteContentVersion,t as saveToContentVersion};
//# sourceMappingURL=versions.js.map
@@ -0,0 +1,11 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderTable = exports.printTable = exports.Table = void 0;
const console_table_printer_1 = __importDefault(require("./src/console-table-printer"));
exports.Table = console_table_printer_1.default;
const internal_table_printer_1 = require("./src/internalTable/internal-table-printer");
Object.defineProperty(exports, "printTable", { enumerable: true, get: function () { return internal_table_printer_1.printSimpleTable; } });
Object.defineProperty(exports, "renderTable", { enumerable: true, get: function () { return internal_table_printer_1.renderSimpleTable; } });
@@ -0,0 +1,5 @@
import type { FilterOptions, FilterOptionsProps, ResolvedFilterOptions } from 'payload';
export declare const resolveFilterOptions: (filterOptions: FilterOptions, options: {
relationTo: string | string[];
} & Omit<FilterOptionsProps, "relationTo">) => Promise<ResolvedFilterOptions>;
//# sourceMappingURL=resolveFilterOptions.d.ts.map
@@ -0,0 +1,165 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DomHandler = void 0;
var domelementtype_1 = require("domelementtype");
var node_js_1 = require("./node.js");
__exportStar(require("./node.js"), exports);
// Default options
var defaultOpts = {
withStartIndices: false,
withEndIndices: false,
xmlMode: false,
};
var DomHandler = /** @class */ (function () {
/**
* @param callback Called once parsing has completed.
* @param options Settings for the handler.
* @param elementCB Callback whenever a tag is closed.
*/
function DomHandler(callback, options, elementCB) {
/** The elements of the DOM */
this.dom = [];
/** The root element for the DOM */
this.root = new node_js_1.Document(this.dom);
/** Indicated whether parsing has been completed. */
this.done = false;
/** Stack of open tags. */
this.tagStack = [this.root];
/** A data node that is still being written to. */
this.lastNode = null;
/** Reference to the parser instance. Used for location information. */
this.parser = null;
// Make it possible to skip arguments, for backwards-compatibility
if (typeof options === "function") {
elementCB = options;
options = defaultOpts;
}
if (typeof callback === "object") {
options = callback;
callback = undefined;
}
this.callback = callback !== null && callback !== void 0 ? callback : null;
this.options = options !== null && options !== void 0 ? options : defaultOpts;
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
}
DomHandler.prototype.onparserinit = function (parser) {
this.parser = parser;
};
// Resets the handler back to starting state
DomHandler.prototype.onreset = function () {
this.dom = [];
this.root = new node_js_1.Document(this.dom);
this.done = false;
this.tagStack = [this.root];
this.lastNode = null;
this.parser = null;
};
// Signals the handler that parsing is done
DomHandler.prototype.onend = function () {
if (this.done)
return;
this.done = true;
this.parser = null;
this.handleCallback(null);
};
DomHandler.prototype.onerror = function (error) {
this.handleCallback(error);
};
DomHandler.prototype.onclosetag = function () {
this.lastNode = null;
var elem = this.tagStack.pop();
if (this.options.withEndIndices) {
elem.endIndex = this.parser.endIndex;
}
if (this.elementCB)
this.elementCB(elem);
};
DomHandler.prototype.onopentag = function (name, attribs) {
var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : undefined;
var element = new node_js_1.Element(name, attribs, undefined, type);
this.addNode(element);
this.tagStack.push(element);
};
DomHandler.prototype.ontext = function (data) {
var lastNode = this.lastNode;
if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
lastNode.data += data;
if (this.options.withEndIndices) {
lastNode.endIndex = this.parser.endIndex;
}
}
else {
var node = new node_js_1.Text(data);
this.addNode(node);
this.lastNode = node;
}
};
DomHandler.prototype.oncomment = function (data) {
if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
this.lastNode.data += data;
return;
}
var node = new node_js_1.Comment(data);
this.addNode(node);
this.lastNode = node;
};
DomHandler.prototype.oncommentend = function () {
this.lastNode = null;
};
DomHandler.prototype.oncdatastart = function () {
var text = new node_js_1.Text("");
var node = new node_js_1.CDATA([text]);
this.addNode(node);
text.parent = node;
this.lastNode = text;
};
DomHandler.prototype.oncdataend = function () {
this.lastNode = null;
};
DomHandler.prototype.onprocessinginstruction = function (name, data) {
var node = new node_js_1.ProcessingInstruction(name, data);
this.addNode(node);
};
DomHandler.prototype.handleCallback = function (error) {
if (typeof this.callback === "function") {
this.callback(error, this.dom);
}
else if (error) {
throw error;
}
};
DomHandler.prototype.addNode = function (node) {
var parent = this.tagStack[this.tagStack.length - 1];
var previousSibling = parent.children[parent.children.length - 1];
if (this.options.withStartIndices) {
node.startIndex = this.parser.startIndex;
}
if (this.options.withEndIndices) {
node.endIndex = this.parser.endIndex;
}
parent.children.push(node);
if (previousSibling) {
node.prev = previousSibling;
previousSibling.next = node;
}
node.parent = parent;
this.lastNode = null;
};
return DomHandler;
}());
exports.DomHandler = DomHandler;
exports.default = DomHandler;
@@ -0,0 +1,10 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const transform_1 = __importDefault(require("../definitions/transform"));
const transform = (ajv) => ajv.addKeyword((0, transform_1.default)());
exports.default = transform;
module.exports = transform;
//# sourceMappingURL=transform.js.map
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { monthsToYears as fn } from "../monthsToYears.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const monthsToYears = convertToFP(fn, 1);
// Fallback for modularized imports:
export default monthsToYears;
@@ -0,0 +1 @@
{"version":3,"file":"webpack5.mjs","sources":["../../src/webpack5.ts"],"sourcesContent":["import { SentryWebpackPluginOptions, sentryWebpackUnpluginFactory } from \"./webpack4and5\";\n\nconst sentryUnplugin = sentryWebpackUnpluginFactory();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryWebpackPlugin: (options?: SentryWebpackPluginOptions) => any =\n sentryUnplugin.webpack;\n\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n\nexport type { SentryWebpackPluginOptions };\n"],"names":["sentryUnplugin","sentryWebpackUnpluginFactory","sentryWebpackPlugin","webpack"],"mappings":";;;;;;AAEA,IAAMA,cAAc,GAAGC,4BAA4B,EAAE,CAAA;;AAErD;AACaC,IAAAA,mBAAkE,GAC7EF,cAAc,CAACG;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"japanese-yen.js","sources":["../../../src/icons/japanese-yen.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name JapaneseYen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgOS41VjIxbTAtMTEuNUw2IDNtNiA2LjVMMTggMyIgLz4KICA8cGF0aCBkPSJNNiAxNWgxMiIgLz4KICA8cGF0aCBkPSJNNiAxMWgxMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/japanese-yen\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst JapaneseYen = createLucideIcon('JapaneseYen', [\n ['path', { d: 'M12 9.5V21m0-11.5L6 3m6 6.5L18 3', key: '2ej80x' }],\n ['path', { d: 'M6 15h12', key: '1hwgt5' }],\n ['path', { d: 'M6 11h12', key: 'wf4gp6' }],\n]);\n\nexport default JapaneseYen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,22 @@
import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
import { h as hasOwn, E as Emotion, c as createEmotionProps } from '../../dist/emotion-element-f0de968e.browser.esm.js';
import 'react';
import '@emotion/cache';
import '@babel/runtime/helpers/extends';
import '@emotion/weak-memoize';
import '../../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';
import 'hoist-non-react-statics';
import '@emotion/utils';
import '@emotion/serialize';
import '@emotion/use-insertion-effect-with-fallbacks';
var Fragment = ReactJSXRuntimeDev.Fragment;
var jsxDEV = function jsxDEV(type, props, key, isStaticChildren, source, self) {
if (!hasOwn.call(props, 'css')) {
return ReactJSXRuntimeDev.jsxDEV(type, props, key, isStaticChildren, source, self);
}
return ReactJSXRuntimeDev.jsxDEV(Emotion, createEmotionProps(type, props), key, isStaticChildren, source, self);
};
export { Fragment, jsxDEV };
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_async_generator_delegate.cjs",
"module": "../../esm/_async_generator_delegate.js"
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('zipWith', require('../zipWith'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,2 @@
export { rewriteFramesIntegration } from '@sentry/core';
//# sourceMappingURL=index.rewriteframes.d.ts.map
@@ -0,0 +1,20 @@
/**
* Recursively traverse up the tree to check whether the provided child node
* is the parent or a descendant of it.
*
* @param parent - Element to find
* @param child - Element to test against parent
*/
const isNodeOrChild = (parent, child) => {
if (!child) {
return false;
}
else if (parent === child) {
return true;
}
else {
return isNodeOrChild(parent, child.parentElement);
}
};
export { isNodeOrChild };
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Scissors = createLucideIcon("Scissors", [
["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
["path", { d: "M8.12 8.12 12 12", key: "1alkpv" }],
["path", { d: "M20 4 8.12 15.88", key: "xgtan2" }],
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
["path", { d: "M14.8 14.8 20 20", key: "ptml3r" }]
]);
export { Scissors as default };
//# sourceMappingURL=scissors.js.map
@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
/** Types of elements found in htmlparser2's DOM */
var ElementType;
(function (ElementType) {
/** Type for the root element of a document */
ElementType["Root"] = "root";
/** Type for Text */
ElementType["Text"] = "text";
/** Type for <? ... ?> */
ElementType["Directive"] = "directive";
/** Type for <!-- ... --> */
ElementType["Comment"] = "comment";
/** Type for <script> tags */
ElementType["Script"] = "script";
/** Type for <style> tags */
ElementType["Style"] = "style";
/** Type for Any tag */
ElementType["Tag"] = "tag";
/** Type for <![CDATA[ ... ]]> */
ElementType["CDATA"] = "cdata";
/** Type for <!doctype ...> */
ElementType["Doctype"] = "doctype";
})(ElementType = exports.ElementType || (exports.ElementType = {}));
/**
* Tests whether an element is a tag or not.
*
* @param elem Element to test
*/
function isTag(elem) {
return (elem.type === ElementType.Tag ||
elem.type === ElementType.Script ||
elem.type === ElementType.Style);
}
exports.isTag = isTag;
// Exports for backwards compatibility
/** Type for the root element of a document */
exports.Root = ElementType.Root;
/** Type for Text */
exports.Text = ElementType.Text;
/** Type for <? ... ?> */
exports.Directive = ElementType.Directive;
/** Type for <!-- ... --> */
exports.Comment = ElementType.Comment;
/** Type for <script> tags */
exports.Script = ElementType.Script;
/** Type for <style> tags */
exports.Style = ElementType.Style;
/** Type for Any tag */
exports.Tag = ElementType.Tag;
/** Type for <![CDATA[ ... ]]> */
exports.CDATA = ElementType.CDATA;
/** Type for <!doctype ...> */
exports.Doctype = ElementType.Doctype;
@@ -0,0 +1,29 @@
{
"name": "@emotion/hash",
"version": "0.9.2",
"description": "A MurmurHash2 implementation",
"main": "dist/emotion-hash.cjs.js",
"module": "dist/emotion-hash.esm.js",
"types": "dist/emotion-hash.cjs.d.ts",
"license": "MIT",
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/hash",
"files": [
"src",
"dist"
],
"scripts": {
"test:typescript": "dtslint types"
},
"devDependencies": {
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^5.4.5"
},
"exports": {
".": {
"module": "./dist/emotion-hash.esm.js",
"import": "./dist/emotion-hash.cjs.mjs",
"default": "./dist/emotion-hash.cjs.js"
},
"./package.json": "./package.json"
}
}
@@ -0,0 +1,25 @@
import { traverseFields } from './traverseFields.js';
/**
* This function is responsible for running beforeDuplicate hooks
* against a document including all locale data.
* It will run each field's beforeDuplicate hook
* and return the resulting docWithLocales.
*/ export const beforeDuplicate = async ({ id, collection, context, doc, overrideAccess, req })=>{
await traverseFields({
id,
collection,
context,
doc,
fields: collection.fields,
overrideAccess,
parentIndexPath: '',
parentIsLocalized: false,
parentPath: '',
parentSchemaPath: '',
req,
siblingDoc: doc
});
return doc;
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').memoize;

Some files were not shown because too many files have changed in this diff Show More