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,60 @@
'use strict';
// lib/types/utils.ts
new TextDecoder();
var getView = (input, offset) => new DataView(input.buffer, input.byteOffset + offset);
var readUInt16LE = (input, offset = 0) => getView(input, offset).getUint16(0, true);
// lib/types/ico.ts
var TYPE_ICON = 1;
var SIZE_HEADER = 2 + 2 + 2;
var SIZE_IMAGE_ENTRY = 1 + 1 + 1 + 1 + 2 + 2 + 4 + 4;
function getSizeFromOffset(input, offset) {
const value = input[offset];
return value === 0 ? 256 : value;
}
function getImageSize(input, imageIndex) {
const offset = SIZE_HEADER + imageIndex * SIZE_IMAGE_ENTRY;
return {
height: getSizeFromOffset(input, offset + 1),
width: getSizeFromOffset(input, offset)
};
}
var ICO = {
validate(input) {
const reserved = readUInt16LE(input, 0);
const imageCount = readUInt16LE(input, 4);
if (reserved !== 0 || imageCount === 0) return false;
const imageType = readUInt16LE(input, 2);
return imageType === TYPE_ICON;
},
calculate(input) {
const nbImages = readUInt16LE(input, 4);
const imageSize = getImageSize(input, 0);
if (nbImages === 1) return imageSize;
const images = [];
for (let imageIndex = 0; imageIndex < nbImages; imageIndex += 1) {
images.push(getImageSize(input, imageIndex));
}
return {
width: imageSize.width,
height: imageSize.height,
images
};
}
};
// lib/types/cur.ts
var TYPE_CURSOR = 2;
var CUR = {
validate(input) {
const reserved = readUInt16LE(input, 0);
const imageCount = readUInt16LE(input, 4);
if (reserved !== 0 || imageCount === 0) return false;
const imageType = readUInt16LE(input, 2);
return imageType === TYPE_CURSOR;
},
calculate: (input) => ICO.calculate(input)
};
exports.CUR = CUR;
@@ -0,0 +1,57 @@
'use strict'
const t = require('tap')
const { join } = require('node:path')
const { fork } = require('node:child_process')
const { once } = require('./helper')
const pino = require('..')
if (process.platform === 'win32') {
t.skip('skipping on windows')
process.exit(0)
}
if (process.env.CITGM) {
// This looks like a some form of limitations of the CITGM test runner
// or the HW/SW we run it on. This file can hang on Node.js v18.x.
// The failure does not reproduce locally or on our CI.
// Skipping it is the only way to keep pino in CITGM.
// https://github.com/nodejs/citgm/pull/1002#issuecomment-1751942988
t.skip('Skipping on Node.js core CITGM because it hangs on v18.x')
process.exit(0)
}
function test (file) {
file = join('fixtures', 'broken-pipe', file)
t.test(file, { parallel: true }, async ({ equal }) => {
const child = fork(join(__dirname, file), { silent: true })
child.stdout.destroy()
child.stderr.pipe(process.stdout)
const res = await once(child, 'close')
equal(res, 0) // process exits successfully
})
}
t.jobs = 42
test('basic.js')
test('destination.js')
test('syncfalse.js')
t.test('let error pass through', ({ equal, plan }) => {
plan(3)
const stream = pino.destination({ sync: true })
// side effect of the pino constructor is that it will set an
// event handler for error
pino(stream)
process.nextTick(() => stream.emit('error', new Error('kaboom')))
process.nextTick(() => stream.emit('error', new Error('kaboom')))
stream.on('error', (err) => {
equal(err.message, 'kaboom')
})
})
@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').mapSeries;
@@ -0,0 +1,3 @@
import type { UpdateMany } from 'payload';
export declare const updateMany: UpdateMany;
//# sourceMappingURL=updateMany.d.ts.map
@@ -0,0 +1,3 @@
export declare const PACKAGE_VERSION = "0.20.0";
export declare const PACKAGE_NAME = "@opentelemetry/instrumentation-kafkajs";
//# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,519 @@
import { inspect } from '../jsutils/inspect.mjs';
import { invariant } from '../jsutils/invariant.mjs';
import { keyMap } from '../jsutils/keyMap.mjs';
import { print } from '../language/printer.mjs';
import {
isEnumType,
isInputObjectType,
isInterfaceType,
isListType,
isNamedType,
isNonNullType,
isObjectType,
isRequiredArgument,
isRequiredInputField,
isScalarType,
isUnionType,
} from '../type/definition.mjs';
import { isSpecifiedScalarType } from '../type/scalars.mjs';
import { astFromValue } from './astFromValue.mjs';
import { sortValueNode } from './sortValueNode.mjs';
var BreakingChangeType;
(function (BreakingChangeType) {
BreakingChangeType['TYPE_REMOVED'] = 'TYPE_REMOVED';
BreakingChangeType['TYPE_CHANGED_KIND'] = 'TYPE_CHANGED_KIND';
BreakingChangeType['TYPE_REMOVED_FROM_UNION'] = 'TYPE_REMOVED_FROM_UNION';
BreakingChangeType['VALUE_REMOVED_FROM_ENUM'] = 'VALUE_REMOVED_FROM_ENUM';
BreakingChangeType['REQUIRED_INPUT_FIELD_ADDED'] =
'REQUIRED_INPUT_FIELD_ADDED';
BreakingChangeType['IMPLEMENTED_INTERFACE_REMOVED'] =
'IMPLEMENTED_INTERFACE_REMOVED';
BreakingChangeType['FIELD_REMOVED'] = 'FIELD_REMOVED';
BreakingChangeType['FIELD_CHANGED_KIND'] = 'FIELD_CHANGED_KIND';
BreakingChangeType['REQUIRED_ARG_ADDED'] = 'REQUIRED_ARG_ADDED';
BreakingChangeType['ARG_REMOVED'] = 'ARG_REMOVED';
BreakingChangeType['ARG_CHANGED_KIND'] = 'ARG_CHANGED_KIND';
BreakingChangeType['DIRECTIVE_REMOVED'] = 'DIRECTIVE_REMOVED';
BreakingChangeType['DIRECTIVE_ARG_REMOVED'] = 'DIRECTIVE_ARG_REMOVED';
BreakingChangeType['REQUIRED_DIRECTIVE_ARG_ADDED'] =
'REQUIRED_DIRECTIVE_ARG_ADDED';
BreakingChangeType['DIRECTIVE_REPEATABLE_REMOVED'] =
'DIRECTIVE_REPEATABLE_REMOVED';
BreakingChangeType['DIRECTIVE_LOCATION_REMOVED'] =
'DIRECTIVE_LOCATION_REMOVED';
})(BreakingChangeType || (BreakingChangeType = {}));
export { BreakingChangeType };
var DangerousChangeType;
(function (DangerousChangeType) {
DangerousChangeType['VALUE_ADDED_TO_ENUM'] = 'VALUE_ADDED_TO_ENUM';
DangerousChangeType['TYPE_ADDED_TO_UNION'] = 'TYPE_ADDED_TO_UNION';
DangerousChangeType['OPTIONAL_INPUT_FIELD_ADDED'] =
'OPTIONAL_INPUT_FIELD_ADDED';
DangerousChangeType['OPTIONAL_ARG_ADDED'] = 'OPTIONAL_ARG_ADDED';
DangerousChangeType['IMPLEMENTED_INTERFACE_ADDED'] =
'IMPLEMENTED_INTERFACE_ADDED';
DangerousChangeType['ARG_DEFAULT_VALUE_CHANGE'] = 'ARG_DEFAULT_VALUE_CHANGE';
})(DangerousChangeType || (DangerousChangeType = {}));
export { DangerousChangeType };
/**
* Given two schemas, returns an Array containing descriptions of all the types
* of breaking changes covered by the other functions down below.
*/
export function findBreakingChanges(oldSchema, newSchema) {
// @ts-expect-error
return findSchemaChanges(oldSchema, newSchema).filter(
(change) => change.type in BreakingChangeType,
);
}
/**
* Given two schemas, returns an Array containing descriptions of all the types
* of potentially dangerous changes covered by the other functions down below.
*/
export function findDangerousChanges(oldSchema, newSchema) {
// @ts-expect-error
return findSchemaChanges(oldSchema, newSchema).filter(
(change) => change.type in DangerousChangeType,
);
}
function findSchemaChanges(oldSchema, newSchema) {
return [
...findTypeChanges(oldSchema, newSchema),
...findDirectiveChanges(oldSchema, newSchema),
];
}
function findDirectiveChanges(oldSchema, newSchema) {
const schemaChanges = [];
const directivesDiff = diff(
oldSchema.getDirectives(),
newSchema.getDirectives(),
);
for (const oldDirective of directivesDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.DIRECTIVE_REMOVED,
description: `${oldDirective.name} was removed.`,
});
}
for (const [oldDirective, newDirective] of directivesDiff.persisted) {
const argsDiff = diff(oldDirective.args, newDirective.args);
for (const newArg of argsDiff.added) {
if (isRequiredArgument(newArg)) {
schemaChanges.push({
type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED,
description: `A required arg ${newArg.name} on directive ${oldDirective.name} was added.`,
});
}
}
for (const oldArg of argsDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.DIRECTIVE_ARG_REMOVED,
description: `${oldArg.name} was removed from ${oldDirective.name}.`,
});
}
if (oldDirective.isRepeatable && !newDirective.isRepeatable) {
schemaChanges.push({
type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED,
description: `Repeatable flag was removed from ${oldDirective.name}.`,
});
}
for (const location of oldDirective.locations) {
if (!newDirective.locations.includes(location)) {
schemaChanges.push({
type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED,
description: `${location} was removed from ${oldDirective.name}.`,
});
}
}
}
return schemaChanges;
}
function findTypeChanges(oldSchema, newSchema) {
const schemaChanges = [];
const typesDiff = diff(
Object.values(oldSchema.getTypeMap()),
Object.values(newSchema.getTypeMap()),
);
for (const oldType of typesDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.TYPE_REMOVED,
description: isSpecifiedScalarType(oldType)
? `Standard scalar ${oldType.name} was removed because it is not referenced anymore.`
: `${oldType.name} was removed.`,
});
}
for (const [oldType, newType] of typesDiff.persisted) {
if (isEnumType(oldType) && isEnumType(newType)) {
schemaChanges.push(...findEnumTypeChanges(oldType, newType));
} else if (isUnionType(oldType) && isUnionType(newType)) {
schemaChanges.push(...findUnionTypeChanges(oldType, newType));
} else if (isInputObjectType(oldType) && isInputObjectType(newType)) {
schemaChanges.push(...findInputObjectTypeChanges(oldType, newType));
} else if (isObjectType(oldType) && isObjectType(newType)) {
schemaChanges.push(
...findFieldChanges(oldType, newType),
...findImplementedInterfacesChanges(oldType, newType),
);
} else if (isInterfaceType(oldType) && isInterfaceType(newType)) {
schemaChanges.push(
...findFieldChanges(oldType, newType),
...findImplementedInterfacesChanges(oldType, newType),
);
} else if (oldType.constructor !== newType.constructor) {
schemaChanges.push({
type: BreakingChangeType.TYPE_CHANGED_KIND,
description:
`${oldType.name} changed from ` +
`${typeKindName(oldType)} to ${typeKindName(newType)}.`,
});
}
}
return schemaChanges;
}
function findInputObjectTypeChanges(oldType, newType) {
const schemaChanges = [];
const fieldsDiff = diff(
Object.values(oldType.getFields()),
Object.values(newType.getFields()),
);
for (const newField of fieldsDiff.added) {
if (isRequiredInputField(newField)) {
schemaChanges.push({
type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED,
description: `A required field ${newField.name} on input type ${oldType.name} was added.`,
});
} else {
schemaChanges.push({
type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED,
description: `An optional field ${newField.name} on input type ${oldType.name} was added.`,
});
}
}
for (const oldField of fieldsDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.FIELD_REMOVED,
description: `${oldType.name}.${oldField.name} was removed.`,
});
}
for (const [oldField, newField] of fieldsDiff.persisted) {
const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(
oldField.type,
newField.type,
);
if (!isSafe) {
schemaChanges.push({
type: BreakingChangeType.FIELD_CHANGED_KIND,
description:
`${oldType.name}.${oldField.name} changed type from ` +
`${String(oldField.type)} to ${String(newField.type)}.`,
});
}
}
return schemaChanges;
}
function findUnionTypeChanges(oldType, newType) {
const schemaChanges = [];
const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes());
for (const newPossibleType of possibleTypesDiff.added) {
schemaChanges.push({
type: DangerousChangeType.TYPE_ADDED_TO_UNION,
description: `${newPossibleType.name} was added to union type ${oldType.name}.`,
});
}
for (const oldPossibleType of possibleTypesDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,
description: `${oldPossibleType.name} was removed from union type ${oldType.name}.`,
});
}
return schemaChanges;
}
function findEnumTypeChanges(oldType, newType) {
const schemaChanges = [];
const valuesDiff = diff(oldType.getValues(), newType.getValues());
for (const newValue of valuesDiff.added) {
schemaChanges.push({
type: DangerousChangeType.VALUE_ADDED_TO_ENUM,
description: `${newValue.name} was added to enum type ${oldType.name}.`,
});
}
for (const oldValue of valuesDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,
description: `${oldValue.name} was removed from enum type ${oldType.name}.`,
});
}
return schemaChanges;
}
function findImplementedInterfacesChanges(oldType, newType) {
const schemaChanges = [];
const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces());
for (const newInterface of interfacesDiff.added) {
schemaChanges.push({
type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED,
description: `${newInterface.name} added to interfaces implemented by ${oldType.name}.`,
});
}
for (const oldInterface of interfacesDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED,
description: `${oldType.name} no longer implements interface ${oldInterface.name}.`,
});
}
return schemaChanges;
}
function findFieldChanges(oldType, newType) {
const schemaChanges = [];
const fieldsDiff = diff(
Object.values(oldType.getFields()),
Object.values(newType.getFields()),
);
for (const oldField of fieldsDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.FIELD_REMOVED,
description: `${oldType.name}.${oldField.name} was removed.`,
});
}
for (const [oldField, newField] of fieldsDiff.persisted) {
schemaChanges.push(...findArgChanges(oldType, oldField, newField));
const isSafe = isChangeSafeForObjectOrInterfaceField(
oldField.type,
newField.type,
);
if (!isSafe) {
schemaChanges.push({
type: BreakingChangeType.FIELD_CHANGED_KIND,
description:
`${oldType.name}.${oldField.name} changed type from ` +
`${String(oldField.type)} to ${String(newField.type)}.`,
});
}
}
return schemaChanges;
}
function findArgChanges(oldType, oldField, newField) {
const schemaChanges = [];
const argsDiff = diff(oldField.args, newField.args);
for (const oldArg of argsDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.ARG_REMOVED,
description: `${oldType.name}.${oldField.name} arg ${oldArg.name} was removed.`,
});
}
for (const [oldArg, newArg] of argsDiff.persisted) {
const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(
oldArg.type,
newArg.type,
);
if (!isSafe) {
schemaChanges.push({
type: BreakingChangeType.ARG_CHANGED_KIND,
description:
`${oldType.name}.${oldField.name} arg ${oldArg.name} has changed type from ` +
`${String(oldArg.type)} to ${String(newArg.type)}.`,
});
} else if (oldArg.defaultValue !== undefined) {
if (newArg.defaultValue === undefined) {
schemaChanges.push({
type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,
description: `${oldType.name}.${oldField.name} arg ${oldArg.name} defaultValue was removed.`,
});
} else {
// Since we looking only for client's observable changes we should
// compare default values in the same representation as they are
// represented inside introspection.
const oldValueStr = stringifyValue(oldArg.defaultValue, oldArg.type);
const newValueStr = stringifyValue(newArg.defaultValue, newArg.type);
if (oldValueStr !== newValueStr) {
schemaChanges.push({
type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,
description: `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed defaultValue from ${oldValueStr} to ${newValueStr}.`,
});
}
}
}
}
for (const newArg of argsDiff.added) {
if (isRequiredArgument(newArg)) {
schemaChanges.push({
type: BreakingChangeType.REQUIRED_ARG_ADDED,
description: `A required arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.`,
});
} else {
schemaChanges.push({
type: DangerousChangeType.OPTIONAL_ARG_ADDED,
description: `An optional arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.`,
});
}
}
return schemaChanges;
}
function isChangeSafeForObjectOrInterfaceField(oldType, newType) {
if (isListType(oldType)) {
return (
// if they're both lists, make sure the underlying types are compatible
(isListType(newType) &&
isChangeSafeForObjectOrInterfaceField(
oldType.ofType,
newType.ofType,
)) || // moving from nullable to non-null of the same underlying type is safe
(isNonNullType(newType) &&
isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))
);
}
if (isNonNullType(oldType)) {
// if they're both non-null, make sure the underlying types are compatible
return (
isNonNullType(newType) &&
isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType)
);
}
return (
// if they're both named types, see if their names are equivalent
(isNamedType(newType) && oldType.name === newType.name) || // moving from nullable to non-null of the same underlying type is safe
(isNonNullType(newType) &&
isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))
);
}
function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) {
if (isListType(oldType)) {
// if they're both lists, make sure the underlying types are compatible
return (
isListType(newType) &&
isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType)
);
}
if (isNonNullType(oldType)) {
return (
// if they're both non-null, make sure the underlying types are
// compatible
(isNonNullType(newType) &&
isChangeSafeForInputObjectFieldOrFieldArg(
oldType.ofType,
newType.ofType,
)) || // moving from non-null to nullable of the same underlying type is safe
(!isNonNullType(newType) &&
isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType))
);
} // if they're both named types, see if their names are equivalent
return isNamedType(newType) && oldType.name === newType.name;
}
function typeKindName(type) {
if (isScalarType(type)) {
return 'a Scalar type';
}
if (isObjectType(type)) {
return 'an Object type';
}
if (isInterfaceType(type)) {
return 'an Interface type';
}
if (isUnionType(type)) {
return 'a Union type';
}
if (isEnumType(type)) {
return 'an Enum type';
}
if (isInputObjectType(type)) {
return 'an Input type';
}
/* c8 ignore next 3 */
// Not reachable, all possible types have been considered.
false || invariant(false, 'Unexpected type: ' + inspect(type));
}
function stringifyValue(value, type) {
const ast = astFromValue(value, type);
ast != null || invariant(false);
return print(sortValueNode(ast));
}
function diff(oldArray, newArray) {
const added = [];
const removed = [];
const persisted = [];
const oldMap = keyMap(oldArray, ({ name }) => name);
const newMap = keyMap(newArray, ({ name }) => name);
for (const oldItem of oldArray) {
const newItem = newMap[oldItem.name];
if (newItem === undefined) {
removed.push(oldItem);
} else {
persisted.push([oldItem, newItem]);
}
}
for (const newItem of newArray) {
if (oldMap[newItem.name] === undefined) {
added.push(newItem);
}
}
return {
added,
persisted,
removed,
};
}
@@ -0,0 +1,2 @@
import { sortedLastIndexOf } from "../fp";
export = sortedLastIndexOf;
@@ -0,0 +1 @@
{"version":3,"file":"hr.d.ts","sourceRoot":"","sources":["../../src/languages/hr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtE,eAAO,MAAM,cAAc,EAAE,yBA2nB5B,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,QAGhB,CAAA"}
@@ -0,0 +1,23 @@
/**
* @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 Delete = createLucideIcon("Delete", [
[
"path",
{
d: "M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",
key: "1yo7s0"
}
],
["path", { d: "m12 9 6 6", key: "anjzzh" }],
["path", { d: "m18 9-6 6", key: "1fp51s" }]
]);
export { Delete as default };
//# sourceMappingURL=delete.js.map
@@ -0,0 +1,12 @@
import { ResourceDetectionConfig } from '../../../config';
import { DetectedResource, ResourceDetector } from '../../../types';
/**
* HostDetector detects the resources related to the host current process is
* running on. Currently only non-cloud-based attributes are included.
*/
declare class HostDetector implements ResourceDetector {
detect(_config?: ResourceDetectionConfig): DetectedResource;
}
export declare const hostDetector: HostDetector;
export {};
//# sourceMappingURL=HostDetector.d.ts.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/collections/endpoints/duplicate.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\nimport { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { getRequestCollectionWithID } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { parseParams } from '../../utilities/parseParams/index.js'\nimport { duplicateOperation } from '../operations/duplicate.js'\n\nexport const duplicateHandler: PayloadHandler = async (req) => {\n const { id, collection } = getRequestCollectionWithID(req)\n\n const { depth, draft, populate, select, selectedLocales } = parseParams(req.query)\n\n const doc = await duplicateOperation({\n id,\n collection,\n data: req.data,\n depth,\n draft,\n populate,\n req,\n select,\n selectedLocales,\n })\n\n const message = req.t('general:successfullyDuplicated', {\n label: getTranslation(collection.config.labels.singular, req.i18n),\n })\n\n return Response.json(\n {\n doc,\n message,\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["getTranslation","status","httpStatus","getRequestCollectionWithID","headersWithCors","parseParams","duplicateOperation","duplicateHandler","req","id","collection","depth","draft","populate","select","selectedLocales","query","doc","data","message","t","label","config","labels","singular","i18n","Response","json","headers","Headers","OK"],"mappings":"AAAA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,SAASC,UAAUC,UAAU,QAAQ,cAAa;AAIlD,SAASC,0BAA0B,QAAQ,sCAAqC;AAChF,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,WAAW,QAAQ,uCAAsC;AAClE,SAASC,kBAAkB,QAAQ,6BAA4B;AAE/D,OAAO,MAAMC,mBAAmC,OAAOC;IACrD,MAAM,EAAEC,EAAE,EAAEC,UAAU,EAAE,GAAGP,2BAA2BK;IAEtD,MAAM,EAAEG,KAAK,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,eAAe,EAAE,GAAGV,YAAYG,IAAIQ,KAAK;IAEjF,MAAMC,MAAM,MAAMX,mBAAmB;QACnCG;QACAC;QACAQ,MAAMV,IAAIU,IAAI;QACdP;QACAC;QACAC;QACAL;QACAM;QACAC;IACF;IAEA,MAAMI,UAAUX,IAAIY,CAAC,CAAC,kCAAkC;QACtDC,OAAOrB,eAAeU,WAAWY,MAAM,CAACC,MAAM,CAACC,QAAQ,EAAEhB,IAAIiB,IAAI;IACnE;IAEA,OAAOC,SAASC,IAAI,CAClB;QACEV;QACAE;IACF,GACA;QACES,SAASxB,gBAAgB;YACvBwB,SAAS,IAAIC;YACbrB;QACF;QACAP,QAAQC,WAAW4B,EAAE;IACvB;AAEJ,EAAC"}
@@ -0,0 +1,27 @@
import type { IntegrationFn } from '../../types-hoist/integration';
interface GrowthBookLike {
isOn(this: GrowthBookLike, featureKey: string, ...rest: unknown[]): boolean;
getFeatureValue(this: GrowthBookLike, featureKey: string, defaultValue: unknown, ...rest: unknown[]): unknown;
}
export type GrowthBookClassLike = new (...args: unknown[]) => GrowthBookLike;
/**
* Sentry integration for capturing feature flag evaluations from GrowthBook.
*
* Only boolean results are captured at this time.
*
* @example
* ```typescript
* import { GrowthBook } from '@growthbook/growthbook';
* import * as Sentry from '@sentry/browser'; // or '@sentry/node'
*
* Sentry.init({
* dsn: 'your-dsn',
* integrations: [
* Sentry.growthbookIntegration({ growthbookClass: GrowthBook })
* ]
* });
* ```
*/
export declare const growthbookIntegration: IntegrationFn;
export {};
//# sourceMappingURL=growthbook.d.ts.map
@@ -0,0 +1,232 @@
# HTTP Status codes for Node.js
Utility to interact with HTTP status codes.
## Migration to v2.x
Version 2 is a migration of the library to ESM modules and TypeScript. The API remains the same. The build system generates both ESM and CommonJS exports.
For ESM users, the import remains the same.
```js
import status from "http-status";
// Or
import { status } from "http-status";
```
For CommonJs users, update the `require` statement.
```js
const { status } = require("http-status");
// Or
const { default: status } = require("http-status");
```
## Usage
Once you import or require this module, you may call it with either an HTTP code or a status name. With an HTTP code, you will get the status name while with a status name you will get an HTTP code or some complementary information.
For example, `status[418]` return `IM_A_TEAPOT` while `status.IM_A_TEAPOT` return `"I'm a teapot"` and `status.IM_A_TEAPOT_CODE` returns `418`.
The package is written in TypeScript and built for CommonJS and ESM.
## HTTP Status codes
HTTP code names, information, and classes are respectively accessible with the property `{code}_NAME`, `{code}_MESSAGE` and `{code}_CLASS`. This includes all statuses in the [IANA HTTP Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml), with the only addition being `418 I'm a teapot`.
## Extra codes
Extra status code are also made available that are not defined in the IANA registry, but used by popular softwares. They are grouped by category. Specific properties are exported by `http-status` under the property `extra` followed by the category name. Also, extra codes are merge with regular status codes and made available as modules available inside `http-status/lib/{category}`.
Available categories are:
<dl>
<dt><code>unofficial</code></dt>
<dd>This represent a list of codes which are not specified by any standard.</dd>
<dt><code>iis</code></dt>
<dd>Microsoft's Internet Information Services (IIS) web server expands the 4xx error class to signal errors with the client's request.</dd>
<dt><code>nginx</code></dt>
<dd>The NGINX web server software expands the 4xx error class to signal issues with the client's request.</dd>
<dt><code>cloudflare</code></dt>
<dd>Cloudflare's reverse proxy service expands the 5xx error class to signal issues with the origin server.</dd>
</dl>
They are accessible throught the `status.extra[category]` property. It is also possible to import one of the category with `import status from "http-status/<category>" or `const status = require("http-status/<category>")`. In the later case, all the categories properties are merge with the common HTTP statuses.
## HTTP Status code classes
In addition to HTTP status codes, this module also contains status code classes under the `classes` property. Similar to HTTP codes, you can access class names and messages with the property `{class}_NAME` and `{class}_MESSAGE`.
## API organization
The API is structured as follows:
```
100
100_NAME
100_MESSAGE
100_CLASS
CONTINUE
101
101_NAME
101_MESSAGE
101_CLASS
SWITCHING_PROTOCOLS
…
classes.
├── 1xx
├── 1xx_NAME
├── 1xx_MESSAGE
├── INFORMATIONAL
├── 2xx
├── 2xx_NAME
├── 2xx_MESSAGE
├── SUCCESSFUL
├── …
extra.
├── unofficial.
│ ├── 103
│ ├── 103_NAME
│ ├── 103_MESSAGE
│ ├── 103_CLASS
│ ├── CHECKPOINT
│ ├── …
├── iis.
│ ├── 440
│ ├── 440_NAME
│ ├── 440_MESSAGE
│ ├── 440_CLASS
│ ├── LOGIN_TIME_OUT
│ ├── …
├── nginx.
│ ├── 444
│ ├── 444_NAME
│ ├── 444_MESSAGE
│ ├── 444_CLASS
│ ├── NO_RESPONSE
│ ├── …
├── cloudflare.
│ ├── 520
│ ├── 520_NAME
│ ├── 520_MESSAGE
│ ├── 520_CLASS
│ ├── UNKNOWN_ERROR
│ ├── …
```
For additional information, please refer to [original code](./src/index.litcoffee).
## Example API usage
The [api example](./samples/api.js) illustrate how to access status names by code and number and how to extra various associated informations.
```javascript
import status from "http-status";
console.info(status.INTERNAL_SERVER_ERROR);
// Output: 500
console.info(status[500]);
console.info(status[status.INTERNAL_SERVER_ERROR]);
// Both output: "Internal Server Error"
console.info(status["500_NAME"]);
console.info(status[`${status.INTERNAL_SERVER_ERROR}_NAME`]);
// Both output: "INTERNAL_SERVER_ERROR"
console.info(status["500_MESSAGE"]);
console.info(status[`${status.INTERNAL_SERVER_ERROR}_MESSAGE`]);
// Both output: "A generic error message, given when an unexpected condition was encountered and no more specific message is suitable."
console.info(status["500_CLASS"]);
console.info(status[`${status.INTERNAL_SERVER_ERROR}_CLASS`]);
// Both output: "5xx"
```
## Example using `classes`
```javascript
import status from "http-status";
const responseCode = status.INTERNAL_SERVER_ERROR;
switch (status[`${responseCode}_CLASS`]) {
case status.classes.INFORMATIONAL:
// The responseCode is 1xx
break;
case status.classes.SUCCESSFUL:
// The responseCode is 2xx
break;
case status.classes.REDIRECTION:
// The responseCode is 3xx
break;
case status.classes.CLIENT_ERROR:
// The responseCode is 4xx
break;
case status.classes.SERVER_ERROR:
// The responseCode is 5xx
break;
default:
// Unknown
break;
}
```
## Example using the `extra` property
```javascript
// Accessing property from the NGINX category
import status from "http-status";
console.info(status.extra.nginx.NO_RESPONSE);
// Accessing default HTTP status merged with NGINX status
import status from "http-status/lib/nginx";
console.info(status.IM_A_TEAPOT);
console.info(status.NO_RESPONSE);
```
## Example integrating Express
The [express example](./samples/express.js) integrate the library with a real wold usage.
```javascript
import express from "express";
import redis from "redis";
import status from "http-status";
// New Express HTTP server
const app = express.createServer();
// Regster a route
app.get("/", (req, res) => {
const client = redis.createClient();
client.ping((err, msg) => {
if (err) {
return res.send(status.INTERNAL_SERVER_ERROR);
}
res.send(msg, status.OK);
});
});
// Start the HTTP server
app.listen(3000);
```
## Contributors
- David Worms: <https://github.com/wdavidw>
- Daniel Gasienica: <https://github.com/gasi>
- Rodrigo: <rfsbraz@gmail.com>
- Paul Vollmer: <paul.vollmer@fh-potsdam.de>
- James Barcellano: <https://github.com/ckeboss>
The project is sponsored by [Adaltas](https://www.adaltas.com) based in Paris, France. Adaltas offers support and consulting on distributed systems, big data and open source.
## Developers
To automatically generate a new version:
```bash
npm run release
```
Package publication is handled by the CI/CD with GitHub action.
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","16":"zC","132":"K D E"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","132":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB"},E:{"1":"D E F A B C L M G 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","16":"6C","132":"J bB K bC 7C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","16":"F JD","132":"B C G N KD LD MD PC xC ND QC"},G:{"1":"E OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","16":"bC"},H:{"2":"mD"},I:{"1":"I rD sD","16":"nD oD","132":"VC J pD qD yC"},J:{"132":"D A"},K:{"1":"H","132":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"A B"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:2,C:"letter-spacing CSS property",D:true};
@@ -0,0 +1,18 @@
var getTag = require('./_getTag'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var mapTag = '[object Map]';
/**
* The base implementation of `_.isMap` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
*/
function baseIsMap(value) {
return isObjectLike(value) && getTag(value) == mapTag;
}
module.exports = baseIsMap;
@@ -0,0 +1,26 @@
import { type MessageFormatElement, parse, type ParserOptions } from "@formatjs/icu-messageformat-parser";
import { type Formats, type Formatters, type FormatXMLElementFn, type MessageFormatPart, type PrimitiveType } from "./formatters.js";
export interface Options extends Omit<ParserOptions, "locale"> {
formatters?: Formatters;
}
export declare class IntlMessageFormat {
private readonly ast;
private readonly locales;
private readonly resolvedLocale?;
private readonly formatters;
private readonly formats;
private readonly message;
private readonly formatterCache;
constructor(message: string | MessageFormatElement[], locales?: string | string[], overrideFormats?: Partial<Formats>, opts?: Options);
format: <T = void>(values?: Record<string, PrimitiveType | T | FormatXMLElementFn<T>>) => string | T | (string | T)[];
formatToParts: <T>(values?: Record<string, PrimitiveType | T | FormatXMLElementFn<T>>) => MessageFormatPart<T>[];
resolvedOptions: () => {
locale: string;
};
getAst: () => MessageFormatElement[];
private static memoizedDefaultLocale;
static get defaultLocale(): string;
static resolveLocale: (locales: string | string[]) => Intl.Locale | undefined;
static __parse: typeof parse | undefined;
static formats: Formats;
}
@@ -0,0 +1 @@
Prism.languages.reason=Prism.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),Prism.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete Prism.languages.reason.function;
@@ -0,0 +1,87 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Hub", {
enumerable: true,
get: function () {
return _hub.default;
}
});
Object.defineProperty(exports, "NodePath", {
enumerable: true,
get: function () {
return _index.default;
}
});
Object.defineProperty(exports, "Scope", {
enumerable: true,
get: function () {
return _index2.default;
}
});
exports.visitors = exports.default = void 0;
require("./path/context.js");
var visitors = require("./visitors.js");
exports.visitors = visitors;
var _t = require("@babel/types");
var cache = require("./cache.js");
var _traverseNode = require("./traverse-node.js");
var _index = require("./path/index.js");
var _index2 = require("./scope/index.js");
var _hub = require("./hub.js");
const {
VISITOR_KEYS,
removeProperties,
traverseFast
} = _t;
function traverse(parent, opts = {}, scope, state, parentPath, visitSelf) {
if (!parent) return;
if (!opts.noScope && !scope) {
if (parent.type !== "Program" && parent.type !== "File") {
throw new Error("You must pass a scope and parentPath unless traversing a Program/File. " + `Instead of that you tried to traverse a ${parent.type} node without ` + "passing scope and parentPath.");
}
}
if (!parentPath && visitSelf) {
throw new Error("visitSelf can only be used when providing a NodePath.");
}
if (!VISITOR_KEYS[parent.type]) {
return;
}
visitors.explode(opts);
(0, _traverseNode.traverseNode)(parent, opts, scope, state, parentPath, undefined, visitSelf);
}
var _default = exports.default = traverse;
traverse.visitors = visitors;
traverse.verify = visitors.verify;
traverse.explode = visitors.explode;
traverse.cheap = function (node, enter) {
traverseFast(node, enter);
return;
};
traverse.node = function (node, opts, scope, state, path, skipKeys) {
(0, _traverseNode.traverseNode)(node, opts, scope, state, path, skipKeys);
};
traverse.clearNode = function (node, opts) {
removeProperties(node, opts);
};
traverse.removeProperties = function (tree, opts) {
traverseFast(tree, traverse.clearNode, opts);
return tree;
};
traverse.hasType = function (tree, type, denylistTypes) {
if (denylistTypes != null && denylistTypes.includes(tree.type)) return false;
if (tree.type === type) return true;
return traverseFast(tree, function (node) {
if (denylistTypes != null && denylistTypes.includes(node.type)) {
return traverseFast.skip;
}
if (node.type === type) {
return traverseFast.stop;
}
});
};
traverse.cache = cache;
//# sourceMappingURL=index.js.map
@@ -0,0 +1,17 @@
import type {Vocabulary} from "../types"
import coreVocabulary from "./core"
import validationVocabulary from "./validation"
import getApplicatorVocabulary from "./applicator"
import formatVocabulary from "./format"
import {metadataVocabulary, contentVocabulary} from "./metadata"
const draft7Vocabularies: Vocabulary[] = [
coreVocabulary,
validationVocabulary,
getApplicatorVocabulary(),
formatVocabulary,
metadataVocabulary,
contentVocabulary,
]
export default draft7Vocabularies
@@ -0,0 +1,12 @@
import { Parser } from "../Parser.js";
import type { ParseFlags, ParseResult } from "../types.js";
export declare class ISOTimezoneParser extends Parser<number> {
priority: number;
parse(dateString: string, token: string): ParseResult<number>;
set<DateType extends Date>(
date: DateType,
flags: ParseFlags,
value: number,
): DateType;
incompatibleTokens: string[];
}
@@ -0,0 +1 @@
{"version":3,"file":"slugify.js","names":["flattenAllFields","getFieldByPath","UnauthorizedError","slugify","defaultSlugify","slugifyHandler","args","collectionSlug","data","globalSlug","path","req","valueToSlugify","user","docConfig","payload","collections","config","globals","find","g","slug","Error","field","fields","customSlugify","custom","undefined","result"],"sources":["../../src/utilities/slugify.ts"],"sourcesContent":["import type { Slugify } from 'payload/shared'\n\nimport {\n flattenAllFields,\n getFieldByPath,\n type ServerFunction,\n type SlugifyServerFunctionArgs,\n UnauthorizedError,\n} from 'payload'\nimport { slugify as defaultSlugify } from 'payload/shared'\n\n/**\n * This server function is directly related to the {@link https://payloadcms.com/docs/fields/text#slug-field | Slug Field}.\n * This is a server function that is used to invoke the user's custom slugify function from the client.\n * This pattern is required, as there is no other way for us to pass their function across the client-server boundary.\n * - Not through props\n * - Not from a server function defined within a server component (see below)\n * When a server function contains non-serializable data within its closure, it gets passed through the boundary (and breaks).\n * The only way to pass server functions to the client (that contain non-serializable data) is if it is globally defined.\n * But we also cannot define this function alongside the server component, as we will not have access to their custom slugify function.\n * See `ServerFunctionsProvider` for more details.\n */\nexport const slugifyHandler: ServerFunction<\n SlugifyServerFunctionArgs,\n Promise<ReturnType<Slugify>>\n> = async (args) => {\n const { collectionSlug, data, globalSlug, path, req, valueToSlugify } = args\n\n if (!req.user) {\n throw new UnauthorizedError()\n }\n\n const docConfig = collectionSlug\n ? req.payload.collections[collectionSlug]?.config\n : globalSlug\n ? req.payload.config.globals.find((g) => g.slug === globalSlug)\n : null\n\n if (!docConfig) {\n throw new Error()\n }\n\n const { field } = getFieldByPath({\n config: req.payload.config,\n fields: flattenAllFields({ fields: docConfig.fields }),\n path,\n })\n\n const customSlugify = (\n typeof field?.custom?.slugify === 'function' ? field.custom.slugify : undefined\n ) as Slugify\n\n const result = customSlugify\n ? await customSlugify({ data, req, valueToSlugify })\n : defaultSlugify(valueToSlugify)\n\n return result\n}\n"],"mappings":"AAEA,SACEA,gBAAgB,EAChBC,cAAc,EAGdC,iBAAiB,QACZ;AACP,SAASC,OAAA,IAAWC,cAAc,QAAQ;AAE1C;;;;;;;;;;;AAWA,OAAO,MAAMC,cAAA,GAGT,MAAOC,IAAA;EACT,MAAM;IAAEC,cAAc;IAAEC,IAAI;IAAEC,UAAU;IAAEC,IAAI;IAAEC,GAAG;IAAEC;EAAc,CAAE,GAAGN,IAAA;EAExE,IAAI,CAACK,GAAA,CAAIE,IAAI,EAAE;IACb,MAAM,IAAIX,iBAAA;EACZ;EAEA,MAAMY,SAAA,GAAYP,cAAA,GACdI,GAAA,CAAII,OAAO,CAACC,WAAW,CAACT,cAAA,CAAe,EAAEU,MAAA,GACzCR,UAAA,GACEE,GAAA,CAAII,OAAO,CAACE,MAAM,CAACC,OAAO,CAACC,IAAI,CAAEC,CAAA,IAAMA,CAAA,CAAEC,IAAI,KAAKZ,UAAA,IAClD;EAEN,IAAI,CAACK,SAAA,EAAW;IACd,MAAM,IAAIQ,KAAA;EACZ;EAEA,MAAM;IAAEC;EAAK,CAAE,GAAGtB,cAAA,CAAe;IAC/BgB,MAAA,EAAQN,GAAA,CAAII,OAAO,CAACE,MAAM;IAC1BO,MAAA,EAAQxB,gBAAA,CAAiB;MAAEwB,MAAA,EAAQV,SAAA,CAAUU;IAAO;IACpDd;EACF;EAEA,MAAMe,aAAA,GACJ,OAAOF,KAAA,EAAOG,MAAA,EAAQvB,OAAA,KAAY,aAAaoB,KAAA,CAAMG,MAAM,CAACvB,OAAO,GAAGwB,SAAA;EAGxE,MAAMC,MAAA,GAASH,aAAA,GACX,MAAMA,aAAA,CAAc;IAAEjB,IAAA;IAAMG,GAAA;IAAKC;EAAe,KAChDR,cAAA,CAAeQ,cAAA;EAEnB,OAAOgB,MAAA;AACT","ignoreList":[]}
@@ -0,0 +1,8 @@
"use strict";
exports.isSameWeekWithOptions = void 0;
var _index = require("../isSameWeek.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isSameWeekWithOptions = (exports.isSameWeekWithOptions = (0,
_index2.convertToFP)(_index.isSameWeek, 3));
@@ -0,0 +1,288 @@
{
"name": "rollup",
"version": "4.58.0",
"description": "Next-generation ES module bundler",
"main": "dist/rollup.js",
"module": "dist/es/rollup.js",
"types": "dist/rollup.d.ts",
"bin": {
"rollup": "dist/bin/rollup"
},
"napi": {
"binaryName": "rollup",
"packageName": "@rollup/rollup",
"targets": [
"aarch64-apple-darwin",
"aarch64-linux-android",
"aarch64-pc-windows-msvc",
"aarch64-unknown-freebsd",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"armv7-linux-androideabi",
"armv7-unknown-linux-gnueabihf",
"armv7-unknown-linux-musleabihf",
"i686-pc-windows-msvc",
"loongarch64-unknown-linux-gnu",
"loongarch64-unknown-linux-musl",
"riscv64gc-unknown-linux-gnu",
"riscv64gc-unknown-linux-musl",
"powerpc64le-unknown-linux-gnu",
"powerpc64le-unknown-linux-musl",
"s390x-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-pc-windows-gnu",
"x86_64-pc-windows-msvc",
"x86_64-unknown-freebsd",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"x86_64-unknown-openbsd",
"aarch64-unknown-linux-ohos"
]
},
"scripts": {
"build": "concurrently -c green,blue \"npm run build:wasm\" \"npm:build:ast-converters\" && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native",
"build:quick": "concurrently -c green,blue 'npm:build:napi' 'npm:build:cjs' && npm run build:copy-native",
"build:napi": "napi build --cwd rust/bindings_napi --platform --dts ../../native.d.ts --no-js --output-dir ../.. --package-json-path ../../package.json",
"build:wasm": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
"build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore",
"update:napi": "npm run build:napi && npm run build:copy-native",
"build:js": "rollup --config rollup.config.ts --configPlugin typescript --forceExit",
"build:js:node": "rollup --config rollup.config.ts --configPlugin typescript --configIsBuildNode --forceExit",
"build:prepare": "concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js:node\" && npm run build:copy-native",
"update:js": "npm run build:js && npm run build:copy-native",
"build:copy-native": "shx mkdir -p dist && shx cp rollup.*.node dist/",
"dev": "concurrently -kc green,blue 'nodemon --watch rust -e rs --exec \"npm run build:wasm\"' 'vitepress dev docs'",
"build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit",
"build:bootstrap": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --forceExit && shx rm -rf dist-build",
"build:bootstrap:cjs": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit && shx rm -rf dist-build",
"build:docs": "vitepress build docs",
"build:ast-converters": "node scripts/generate-ast-converters.js",
"preview:docs": "vitepress preview docs",
"ci:artifacts": "napi artifacts",
"ci:lint": "concurrently -c red,yellow,green,blue 'npm:lint:js:nofix' 'npm:lint:native-js' 'npm:lint:markdown:nofix' 'npm:lint:rust:nofix'",
"ci:test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan 'npm:test:only' 'npm:test:typescript' 'npm:test:leak' 'npm:test:browser'",
"ci:coverage": "NODE_OPTIONS=--no-experimental-require-module nyc --reporter lcovonly mocha",
"lint": "concurrently -c red,yellow,green,blue 'npm:lint:js' 'npm:lint:native-js' 'npm:lint:markdown' 'npm:lint:rust'",
"lint:js": "eslint . --fix --cache --concurrency auto",
"lint:js:nofix": "eslint . --cache --concurrency auto",
"lint:native-js": "node scripts/lint-native-js.js",
"lint:markdown": "prettier --write \"**/*.md\"",
"lint:markdown:nofix": "prettier --check \"**/*.md\"",
"lint:rust": "cd rust && cargo fmt && cargo clippy --fix --allow-dirty",
"lint:rust:nofix": "cd rust && cargo fmt --check && cargo clippy",
"perf": "npm run build:bootstrap:cjs && node --expose-gc scripts/perf-report/index.js",
"prepare": "husky && npm run prepare:patch && node scripts/check-release.js || npm run build:prepare",
"prepare:patch": "patch-package",
"prepublishOnly": "node scripts/check-release.js && node scripts/prepublish.js",
"postpublish": "node scripts/postpublish.js",
"prepublish:napi": "napi prepublish --no-gh-release",
"release": "node scripts/prepare-release.js",
"release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published",
"check-audit": "check-audit",
"resolve-audit": "resolve-audit",
"test": "npm run build && npm run test:all",
"test:update-snapshots": "node scripts/update-snapshots.js",
"test:cjs": "npm run build:cjs && npm run test:only",
"test:quick": "mocha -b test/test.js",
"test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:package' 'npm:test:options'",
"test:coverage": "npm run build:cjs && shx rm -rf coverage/* && nyc --reporter html mocha test/test.js",
"test:coverage:browser": "npm run build && shx rm -rf coverage/* && nyc mocha test/browser/index.js",
"test:leak": "npm install --no-save weak-napi && node --expose-gc test/leak/index.js",
"test:package": "node scripts/test-package.js",
"test:options": "node scripts/test-options.js",
"test:only": "mocha test/test.js",
"test:typescript": "shx rm -rf test/typescript/dist && shx cp -r dist test/typescript/ && tsc --noEmit -p test/typescript && tsc --noEmit -p . && tsc --noEmit -p scripts && vue-tsc --noEmit -p docs",
"test:browser": "mocha test/browser/index.js",
"watch": "rollup --config rollup.config.ts --configPlugin typescript --watch"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rollup/rollup.git"
},
"keywords": [
"modules",
"bundler",
"bundling",
"es6",
"optimizer"
],
"author": "Rich Harris",
"license": "MIT",
"bugs": {
"url": "https://github.com/rollup/rollup/issues"
},
"homepage": "https://rollupjs.org/",
"optionalDependencies": {
"fsevents": "~2.3.2",
"@rollup/rollup-darwin-arm64": "4.58.0",
"@rollup/rollup-android-arm64": "4.58.0",
"@rollup/rollup-win32-arm64-msvc": "4.58.0",
"@rollup/rollup-freebsd-arm64": "4.58.0",
"@rollup/rollup-linux-arm64-gnu": "4.58.0",
"@rollup/rollup-linux-arm64-musl": "4.58.0",
"@rollup/rollup-android-arm-eabi": "4.58.0",
"@rollup/rollup-linux-arm-gnueabihf": "4.58.0",
"@rollup/rollup-linux-arm-musleabihf": "4.58.0",
"@rollup/rollup-win32-ia32-msvc": "4.58.0",
"@rollup/rollup-linux-loong64-gnu": "4.58.0",
"@rollup/rollup-linux-loong64-musl": "4.58.0",
"@rollup/rollup-linux-riscv64-gnu": "4.58.0",
"@rollup/rollup-linux-riscv64-musl": "4.58.0",
"@rollup/rollup-linux-ppc64-gnu": "4.58.0",
"@rollup/rollup-linux-ppc64-musl": "4.58.0",
"@rollup/rollup-linux-s390x-gnu": "4.58.0",
"@rollup/rollup-darwin-x64": "4.58.0",
"@rollup/rollup-win32-x64-gnu": "4.58.0",
"@rollup/rollup-win32-x64-msvc": "4.58.0",
"@rollup/rollup-freebsd-x64": "4.58.0",
"@rollup/rollup-linux-x64-gnu": "4.58.0",
"@rollup/rollup-linux-x64-musl": "4.58.0",
"@rollup/rollup-openbsd-x64": "4.58.0",
"@rollup/rollup-openharmony-arm64": "4.58.0"
},
"dependencies": {
"@types/estree": "1.0.8"
},
"devDependenciesComments": {
"core-js": "We only update manually as every update requires a snapshot update"
},
"devDependencies": {
"@codemirror/commands": "^6.10.2",
"@codemirror/lang-javascript": "^6.2.4",
"@codemirror/language": "^6.12.1",
"@codemirror/search": "^6.6.0",
"@codemirror/state": "^6.5.4",
"@codemirror/view": "^6.39.14",
"@eslint/js": "^10.0.1",
"@inquirer/prompts": "^7.10.1",
"@jridgewell/sourcemap-codec": "^1.5.5",
"@mermaid-js/mermaid-cli": "^11.12.0",
"@napi-rs/cli": "3.4.1",
"@rollup/plugin-alias": "^6.0.0",
"@rollup/plugin-buble": "^1.0.3",
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-replace": "^6.0.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.3.0",
"@rollup/pluginutils": "^5.3.0",
"@shikijs/vitepress-twoslash": "^3.22.0",
"@types/mocha": "^10.0.10",
"@types/node": "^20.19.33",
"@types/picomatch": "^4.0.2",
"@types/semver": "^7.7.1",
"@types/yargs-parser": "^21.0.3",
"@vue/language-server": "^3.2.4",
"acorn": "^8.15.0",
"acorn-import-assertions": "^1.9.0",
"acorn-jsx": "^5.3.2",
"buble": "^0.20.0",
"builtin-modules": "^5.0.0",
"chokidar": "^3.6.0",
"concurrently": "^9.2.1",
"core-js": "3.38.1",
"cross-env": "^10.1.0",
"date-time": "^4.0.0",
"es5-shim": "^4.6.7",
"es6-shim": "^0.35.8",
"eslint": "^10.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-unicorn": "^63.0.0",
"eslint-plugin-vue": "^10.8.0",
"fixturify": "^3.0.0",
"flru": "^1.0.2",
"fs-extra": "^11.3.3",
"github-api": "^3.4.0",
"globals": "^17.3.0",
"husky": "^9.1.7",
"is-reference": "^3.0.3",
"lint-staged": "^16.2.7",
"locate-character": "^3.0.0",
"magic-string": "^0.30.21",
"memfs": "^4.56.10",
"mocha": "11.3.0",
"nodemon": "^3.1.11",
"npm-audit-resolver": "^3.0.0-RC.0",
"nyc": "^17.1.0",
"patch-package": "^8.0.1",
"picocolors": "^1.1.1",
"picomatch": "^4.0.3",
"pinia": "^3.0.4",
"prettier": "^3.8.1",
"prettier-plugin-organize-imports": "^4.3.0",
"pretty-bytes": "^7.1.0",
"pretty-ms": "^9.3.0",
"requirejs": "^2.3.8",
"rollup": "^4.57.1",
"rollup-plugin-license": "^3.7.0",
"semver": "^7.7.4",
"shx": "^0.4.0",
"signal-exit": "^4.1.0",
"source-map": "^0.7.6",
"source-map-support": "^0.5.21",
"systemjs": "^6.15.1",
"terser": "^5.46.0",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
"typescript-eslint": "^8.56.0",
"vite": "^7.3.1",
"vitepress": "^1.6.4",
"vue": "^3.5.28",
"vue-eslint-parser": "^10.4.0",
"vue-tsc": "^3.2.4",
"wasm-pack": "^0.14.0",
"yargs-parser": "^21.1.1"
},
"overrides": {
"axios": "^1.13.5",
"esbuild": ">0.24.2",
"lodash-es": ">4.17.22",
"path-scurry": {
"lru-cache": "^11.2.6"
},
"readable-stream": "npm:@built-in/readable-stream@1",
"semver": "^7.7.4",
"tar": ">7.5.6",
"vite": "$vite"
},
"comments": {
"vue-tsc": "This is necessary so that prettier-plugin-organize-imports works correctly in Vue templatges"
},
"files": [
"dist/*.node",
"dist/**/*.js",
"dist/*.d.ts",
"dist/bin/rollup",
"dist/es/package.json"
],
"engines": {
"node": ">=18.0.0",
"npm": ">=8.0.0"
},
"exports": {
".": {
"types": "./dist/rollup.d.ts",
"import": "./dist/es/rollup.js",
"require": "./dist/rollup.js"
},
"./loadConfigFile": {
"types": "./dist/loadConfigFile.d.ts",
"require": "./dist/loadConfigFile.js",
"default": "./dist/loadConfigFile.js"
},
"./getLogFilter": {
"types": "./dist/getLogFilter.d.ts",
"import": "./dist/es/getLogFilter.js",
"require": "./dist/getLogFilter.js"
},
"./parseAst": {
"types": "./dist/parseAst.d.ts",
"import": "./dist/es/parseAst.js",
"require": "./dist/parseAst.js"
},
"./dist/*": "./dist/*",
"./package.json": "./package.json"
}
}
@@ -0,0 +1,99 @@
{
"author": "Isaac Z. Schlueter <i@izs.me> (https://blog.izs.me/)",
"publishConfig": {
"tag": "legacy-v10"
},
"name": "glob",
"description": "the most correct and second fastest glob implementation in JavaScript",
"version": "10.5.0",
"type": "module",
"tshy": {
"main": true,
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"bin": "./dist/esm/bin.mjs",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-glob.git"
},
"files": [
"dist"
],
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"prepare": "tshy",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "tap",
"snap": "tap",
"format": "prettier --write . --log-level warn",
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
"prepublish": "npm run benchclean",
"profclean": "rm -f v8.log profile.txt",
"test-regen": "npm run profclean && TEST_REGEN=1 node --no-warnings --loader ts-node/esm test/00-setup.ts",
"prebench": "npm run prepare",
"bench": "bash benchmark.sh",
"preprof": "npm run prepare",
"prof": "bash prof.sh",
"benchclean": "node benchclean.cjs"
},
"prettier": {
"experimentalTernaries": true,
"semi": false,
"printWidth": 75,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
},
"dependencies": {
"foreground-child": "^3.1.0",
"jackspeak": "^3.1.2",
"minimatch": "^9.0.4",
"minipass": "^7.1.2",
"package-json-from-dist": "^1.0.0",
"path-scurry": "^1.11.1"
},
"devDependencies": {
"@types/node": "^20.11.30",
"memfs": "^3.4.13",
"mkdirp": "^3.0.1",
"prettier": "^3.2.5",
"rimraf": "^5.0.7",
"sync-content": "^1.0.2",
"tap": "^19.0.0",
"tshy": "^1.14.0",
"typedoc": "^0.25.12"
},
"tap": {
"before": "test/00-setup.ts"
},
"license": "ISC",
"funding": {
"url": "https://github.com/sponsors/isaacs"
},
"module": "./dist/esm/index.js"
}
@@ -0,0 +1,3 @@
import type { PayloadHandler } from '../../config/types.js';
export declare const restoreVersionHandler: PayloadHandler;
//# sourceMappingURL=restoreVersion.d.ts.map
@@ -0,0 +1,3 @@
export {
serializeStyles
} from "./emotion-serialize.development.cjs.js";
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/singlestore-core/columns/year.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnySingleStoreTable } from '~/singlestore-core/table.ts';\nimport { SingleStoreColumn, SingleStoreColumnBuilder } from './common.ts';\n\nexport type SingleStoreYearBuilderInitial<TName extends string> = SingleStoreYearBuilder<{\n\tname: TName;\n\tdataType: 'number';\n\tcolumnType: 'SingleStoreYear';\n\tdata: number;\n\tdriverParam: number;\n\tenumValues: undefined;\n\tgenerated: undefined;\n}>;\n\nexport class SingleStoreYearBuilder<T extends ColumnBuilderBaseConfig<'number', 'SingleStoreYear'>>\n\textends SingleStoreColumnBuilder<T>\n{\n\tstatic override readonly [entityKind]: string = 'SingleStoreYearBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'number', 'SingleStoreYear');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnySingleStoreTable<{ name: TTableName }>,\n\t): SingleStoreYear<MakeColumnConfig<T, TTableName>> {\n\t\treturn new SingleStoreYear<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class SingleStoreYear<\n\tT extends ColumnBaseConfig<'number', 'SingleStoreYear'>,\n> extends SingleStoreColumn<T> {\n\tstatic override readonly [entityKind]: string = 'SingleStoreYear';\n\n\tgetSQLType(): string {\n\t\treturn `year`;\n\t}\n}\n\nexport function year(): SingleStoreYearBuilderInitial<''>;\nexport function year<TName extends string>(name: TName): SingleStoreYearBuilderInitial<TName>;\nexport function year(name?: string) {\n\treturn new SingleStoreYearBuilder(name ?? '');\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAE3B,SAAS,mBAAmB,gCAAgC;AAYrD,MAAM,+BACJ,yBACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB;AAC5B,UAAM,MAAM,UAAU,iBAAiB;AAAA,EACxC;AAAA;AAAA,EAGS,MACR,OACmD;AACnD,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,wBAEH,kBAAqB;AAAA,EAC9B,QAA0B,UAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AACD;AAIO,SAAS,KAAK,MAAe;AACnC,SAAO,IAAI,uBAAuB,QAAQ,EAAE;AAC7C;","names":[]}
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["getTranslation","React","useTranslation","DatePickerField","baseClass","DateFilter","t0","disabled","field","t1","onChange","value","admin","date","i18n","t","_jsx","className","children","placeholder","readOnly"],"sources":["../../../../../src/elements/WhereBuilder/Condition/Date/index.tsx"],"sourcesContent":["'use client'\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport type { DateFilterProps as Props } from './types.js'\n\nimport { useTranslation } from '../../../../providers/Translation/index.js'\nimport { DatePickerField } from '../../../DatePicker/index.js'\n\nconst baseClass = 'condition-value-date'\n\nexport const DateFilter: React.FC<Props> = ({ disabled, field: { admin }, onChange, value }) => {\n const { date } = admin || {}\n const { i18n, t } = useTranslation()\n\n return (\n <div className={baseClass}>\n <DatePickerField\n {...date}\n onChange={onChange}\n placeholder={getTranslation(admin.placeholder, i18n) || t('general:enterAValue')}\n readOnly={disabled}\n value={value as Date}\n />\n </div>\n )\n}\n"],"mappings":"AAAA;;;AACA,SAASA,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAIlB,SAASC,cAAc,QAAQ;AAC/B,SAASC,eAAe,QAAQ;AAEhC,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,UAAA,GAA8BC,EAAA;EAAC;IAAAC,QAAA;IAAAC,KAAA,EAAAC,EAAA;IAAAC,QAAA;IAAAC;EAAA,IAAAL,EAA+C;EAA5B;IAAAM;EAAA,IAAAH,EAAS;EACtE;IAAAI;EAAA,IAAiBD,KAAA,MAAU;EAC3B;IAAAE,IAAA;IAAAC;EAAA,IAAoBb,cAAA;EAAA,OAGlBc,IAAA,CAAC;IAAAC,SAAA,EAAAb,SAAA;IAAAc,QAAA,EACCF,IAAA,CAAAb,eAAA;MAAA,GACMU,IAAI;MAAAH,QAAA;MAAAS,WAAA,EAEKnB,cAAA,CAAeY,KAAA,CAAAO,WAAA,EAAmBL,IAAA,KAASC,CAAA,CAAE;MAAAK,QAAA,EAChDb,QAAA;MAAAI;IAAA,C;;CAKlB","ignoreList":[]}
@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../../../src/integrations/http/constants.ts"],"sourcesContent":["export const INSTRUMENTATION_NAME = '@sentry/instrumentation-http';\n\n/** We only want to capture request bodies up to 1mb. */\nexport const MAX_BODY_BYTE_LENGTH = 1024 * 1024;\n"],"names":[],"mappings":"AAAO,MAAM,oBAAA,GAAuB;;AAEpC;AACO,MAAM,oBAAA,GAAuB,IAAA,GAAO;;;;"}
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/formatName.spec.ts"],"sourcesContent":["import { describe, it, expect } from 'vitest'\nimport { formatName } from './formatName'\n\ndescribe('formatName', () => {\n it.each`\n char | expected\n ${'á'} | ${'a'}\n ${'è'} | ${'e'}\n ${'í'} | ${'i'}\n ${'ó'} | ${'o'}\n ${'ú'} | ${'u'}\n ${'ñ'} | ${'n'}\n ${'ü'} | ${'u'}\n `('should convert accented character: $char', ({ char, expected }) => {\n expect(formatName(char)).toEqual(expected)\n })\n\n describe('UTC offset handling', () => {\n it.each`\n offset | expected\n ${'+00:00'} | ${'_TZOFFSET_PLUS_00_00'}\n ${'+05:30'} | ${'_TZOFFSET_PLUS_05_30'}\n ${'+05:45'} | ${'_TZOFFSET_PLUS_05_45'}\n ${'+08:00'} | ${'_TZOFFSET_PLUS_08_00'}\n ${'+12:00'} | ${'_TZOFFSET_PLUS_12_00'}\n ${'+14:00'} | ${'_TZOFFSET_PLUS_14_00'}\n ${'-00:00'} | ${'_TZOFFSET_MINUS_00_00'}\n ${'-03:30'} | ${'_TZOFFSET_MINUS_03_30'}\n ${'-05:00'} | ${'_TZOFFSET_MINUS_05_00'}\n ${'-08:00'} | ${'_TZOFFSET_MINUS_08_00'}\n ${'-12:00'} | ${'_TZOFFSET_MINUS_12_00'}\n `('should convert UTC offset $offset to $expected', ({ offset, expected }) => {\n expect(formatName(offset)).toEqual(expected)\n })\n\n it('should not collide between positive and negative offsets', () => {\n const plusFive = formatName('+05:00')\n const minusFive = formatName('-05:00')\n expect(plusFive).not.toEqual(minusFive)\n expect(plusFive).toEqual('_TZOFFSET_PLUS_05_00')\n expect(minusFive).toEqual('_TZOFFSET_MINUS_05_00')\n })\n\n it('should not treat IANA timezone names as offsets', () => {\n // These should use standard formatting, not UTC offset formatting\n expect(formatName('America/New_York')).toEqual('America_New_York')\n expect(formatName('Europe/London')).toEqual('Europe_London')\n expect(formatName('Asia/Tokyo')).toEqual('Asia_Tokyo')\n })\n\n it('should not treat partial offset patterns as offsets', () => {\n // These don't match the strict ±HH:mm pattern, so they use standard formatting\n expect(formatName('+5')).toEqual('_5')\n expect(formatName('+05')).toEqual('_05')\n expect(formatName('+0530')).toEqual('_0530')\n // 05:30 without sign is not a UTC offset, starts with number so gets _ prefix\n expect(formatName('05:30')).toEqual('_05:30')\n })\n })\n})\n"],"names":["describe","it","expect","formatName","each","char","expected","toEqual","offset","plusFive","minusFive","not"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ,SAAQ;AAC7C,SAASC,UAAU,QAAQ,eAAc;AAEzCH,SAAS,cAAc;IACrBC,GAAGG,IAAI,CAAC;;IAEN,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;EACjB,CAAC,CAAC,4CAA4C,CAAC,EAAEC,IAAI,EAAEC,QAAQ,EAAE;QAC/DJ,OAAOC,WAAWE,OAAOE,OAAO,CAACD;IACnC;IAEAN,SAAS,uBAAuB;QAC9BC,GAAGG,IAAI,CAAC;;MAEN,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,wBAAwB;MACxC,EAAE,SAAS,GAAG,EAAE,wBAAwB;MACxC,EAAE,SAAS,GAAG,EAAE,wBAAwB;MACxC,EAAE,SAAS,GAAG,EAAE,wBAAwB;MACxC,EAAE,SAAS,GAAG,EAAE,wBAAwB;IAC1C,CAAC,CAAC,kDAAkD,CAAC,EAAEI,MAAM,EAAEF,QAAQ,EAAE;YACvEJ,OAAOC,WAAWK,SAASD,OAAO,CAACD;QACrC;QAEAL,GAAG,4DAA4D;YAC7D,MAAMQ,WAAWN,WAAW;YAC5B,MAAMO,YAAYP,WAAW;YAC7BD,OAAOO,UAAUE,GAAG,CAACJ,OAAO,CAACG;YAC7BR,OAAOO,UAAUF,OAAO,CAAC;YACzBL,OAAOQ,WAAWH,OAAO,CAAC;QAC5B;QAEAN,GAAG,mDAAmD;YACpD,kEAAkE;YAClEC,OAAOC,WAAW,qBAAqBI,OAAO,CAAC;YAC/CL,OAAOC,WAAW,kBAAkBI,OAAO,CAAC;YAC5CL,OAAOC,WAAW,eAAeI,OAAO,CAAC;QAC3C;QAEAN,GAAG,uDAAuD;YACxD,+EAA+E;YAC/EC,OAAOC,WAAW,OAAOI,OAAO,CAAC;YACjCL,OAAOC,WAAW,QAAQI,OAAO,CAAC;YAClCL,OAAOC,WAAW,UAAUI,OAAO,CAAC;YACpC,8EAA8E;YAC9EL,OAAOC,WAAW,UAAUI,OAAO,CAAC;QACtC;IACF;AACF"}
@@ -0,0 +1 @@
{"version":3,"file":"square-equal.js","sources":["../../../src/icons/square-equal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareEqual\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik03IDEwaDEwIiAvPgogIDxwYXRoIGQ9Ik03IDE0aDEwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/square-equal\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 SquareEqual = createLucideIcon('SquareEqual', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M7 10h10', key: '1101jm' }],\n ['path', { d: 'M7 14h10', key: '1mhdw3' }],\n]);\n\nexport default SquareEqual;\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,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,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 @@
{"version":3,"file":"openapi.js","names":[],"sources":["../../../../src/rest/commands/server/openapi.ts"],"sourcesContent":["import type { RestCommand } from '../../types.js';\n\n// TODO can we type this?\nexport type OpenApiSpecOutput = Record<string, any>;\n\n/**\n * Retrieve the OpenAPI spec for the current project.\n * @returns Object conforming to the OpenAPI Specification\n */\nexport const readOpenApiSpec =\n\t<Schema>(): RestCommand<OpenApiSpecOutput, Schema> =>\n\t() => ({\n\t\tmethod: 'GET',\n\t\tpath: '/server/specs/oas',\n\t});\n"],"mappings":"AASA,MAAa,WAEL,CACN,OAAQ,MACR,KAAM,oBACN"}
@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
"use strict";var t=require("@lexical/text"),e=require("react");const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;exports.useLexicalIsTextContentEmpty=function(n,i){const[r,s]=e.useState(n.getEditorState().read(t.$isRootTextContentEmptyCurry(n.isComposing(),i)));return o((()=>n.registerUpdateListener((({editorState:e})=>{const o=n.isComposing(),r=e.read(t.$isRootTextContentEmptyCurry(o,i));s(r)}))),[n,i]),r};
@@ -0,0 +1 @@
!function(e){var a=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",a),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var t=e.languages.tsx.tag;t.pattern=RegExp("(^|[^\\w$]|(?=</))(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(Prism);
@@ -0,0 +1,151 @@
import type { GetColumnData } from "../../column.js";
import { entityKind } from "../../entity.js";
import type { SelectResultFields } from "../../query-builders/select.types.js";
import { QueryPromise } from "../../query-promise.js";
import type { RunnableQuery } from "../../runnable-query.js";
import type { Placeholder, Query, SQL, SQLWrapper } from "../../sql/sql.js";
import type { SQLiteDialect } from "../dialect.js";
import type { SQLitePreparedQuery, SQLiteSession } from "../session.js";
import { SQLiteTable } from "../table.js";
import { Subquery } from "../../subquery.js";
import { type DrizzleTypeError, type UpdateSet, type ValueOrArray } from "../../utils.js";
import type { SQLiteColumn } from "../columns/common.js";
import { SQLiteViewBase } from "../view-base.js";
import type { SelectedFields, SelectedFieldsOrdered, SQLiteSelectJoinConfig } from "./select.types.js";
export interface SQLiteUpdateConfig {
where?: SQL | undefined;
limit?: number | Placeholder;
orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[];
set: UpdateSet;
table: SQLiteTable;
from?: SQLiteTable | Subquery | SQLiteViewBase | SQL;
joins: SQLiteSelectJoinConfig[];
returning?: SelectedFieldsOrdered;
withList?: Subquery[];
}
export type SQLiteUpdateSetSource<TTable extends SQLiteTable> = {
[Key in keyof TTable['$inferInsert']]?: GetColumnData<TTable['_']['columns'][Key], 'query'> | SQL | SQLiteColumn | undefined;
} & {};
export declare class SQLiteUpdateBuilder<TTable extends SQLiteTable, TResultType extends 'sync' | 'async', TRunResult> {
protected table: TTable;
protected session: SQLiteSession<any, any, any, any>;
protected dialect: SQLiteDialect;
private withList?;
static readonly [entityKind]: string;
readonly _: {
readonly table: TTable;
};
constructor(table: TTable, session: SQLiteSession<any, any, any, any>, dialect: SQLiteDialect, withList?: Subquery[] | undefined);
set(values: SQLiteUpdateSetSource<TTable>): SQLiteUpdateWithout<SQLiteUpdateBase<TTable, TResultType, TRunResult>, false, 'leftJoin' | 'rightJoin' | 'innerJoin' | 'fullJoin'>;
}
export type SQLiteUpdateWithout<T extends AnySQLiteUpdate, TDynamic extends boolean, K extends keyof T & string> = TDynamic extends true ? T : Omit<SQLiteUpdateBase<T['_']['table'], T['_']['resultType'], T['_']['runResult'], T['_']['from'], T['_']['returning'], TDynamic, T['_']['excludedMethods'] | K>, T['_']['excludedMethods'] | K>;
export type SQLiteUpdateWithJoins<T extends AnySQLiteUpdate, TDynamic extends boolean, TFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL> = TDynamic extends true ? T : Omit<SQLiteUpdateBase<T['_']['table'], T['_']['resultType'], T['_']['runResult'], TFrom, T['_']['returning'], TDynamic, Exclude<T['_']['excludedMethods'] | 'from', 'leftJoin' | 'rightJoin' | 'innerJoin' | 'fullJoin'>>, Exclude<T['_']['excludedMethods'] | 'from', 'leftJoin' | 'rightJoin' | 'innerJoin' | 'fullJoin'>>;
export type SQLiteUpdateReturningAll<T extends AnySQLiteUpdate, TDynamic extends boolean> = SQLiteUpdateWithout<SQLiteUpdateBase<T['_']['table'], T['_']['resultType'], T['_']['runResult'], T['_']['from'], T['_']['table']['$inferSelect'], TDynamic, T['_']['excludedMethods']>, TDynamic, 'returning'>;
export type SQLiteUpdateReturning<T extends AnySQLiteUpdate, TDynamic extends boolean, TSelectedFields extends SelectedFields> = SQLiteUpdateWithout<SQLiteUpdateBase<T['_']['table'], T['_']['resultType'], T['_']['runResult'], T['_']['from'], SelectResultFields<TSelectedFields>, TDynamic, T['_']['excludedMethods']>, TDynamic, 'returning'>;
export type SQLiteUpdateExecute<T extends AnySQLiteUpdate> = T['_']['returning'] extends undefined ? T['_']['runResult'] : T['_']['returning'][];
export type SQLiteUpdatePrepare<T extends AnySQLiteUpdate> = SQLitePreparedQuery<{
type: T['_']['resultType'];
run: T['_']['runResult'];
all: T['_']['returning'] extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'> : T['_']['returning'][];
get: T['_']['returning'] extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'> : T['_']['returning'];
values: T['_']['returning'] extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'> : any[][];
execute: SQLiteUpdateExecute<T>;
}>;
export type SQLiteUpdateJoinFn<T extends AnySQLiteUpdate> = <TJoinedTable extends SQLiteTable | Subquery | SQLiteViewBase | SQL>(table: TJoinedTable, on: ((updateTable: T['_']['table']['_']['columns'], from: T['_']['from'] extends SQLiteTable ? T['_']['from']['_']['columns'] : T['_']['from'] extends Subquery | SQLiteViewBase ? T['_']['from']['_']['selectedFields'] : never) => SQL | undefined) | SQL | undefined) => T;
export type SQLiteUpdateDynamic<T extends AnySQLiteUpdate> = SQLiteUpdate<T['_']['table'], T['_']['resultType'], T['_']['runResult'], T['_']['returning']>;
export type SQLiteUpdate<TTable extends SQLiteTable = SQLiteTable, TResultType extends 'sync' | 'async' = 'sync' | 'async', TRunResult = any, TFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined, TReturning extends Record<string, unknown> | undefined = Record<string, unknown> | undefined> = SQLiteUpdateBase<TTable, TResultType, TRunResult, TFrom, TReturning, true, never>;
export type AnySQLiteUpdate = SQLiteUpdateBase<any, any, any, any, any, any, any>;
export interface SQLiteUpdateBase<TTable extends SQLiteTable = SQLiteTable, TResultType extends 'sync' | 'async' = 'sync' | 'async', TRunResult = unknown, TFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined, TReturning = undefined, TDynamic extends boolean = false, TExcludedMethods extends string = never> extends SQLWrapper, QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> {
readonly _: {
readonly dialect: 'sqlite';
readonly table: TTable;
readonly resultType: TResultType;
readonly runResult: TRunResult;
readonly from: TFrom;
readonly returning: TReturning;
readonly dynamic: TDynamic;
readonly excludedMethods: TExcludedMethods;
readonly result: TReturning extends undefined ? TRunResult : TReturning[];
};
}
export declare class SQLiteUpdateBase<TTable extends SQLiteTable = SQLiteTable, TResultType extends 'sync' | 'async' = 'sync' | 'async', TRunResult = unknown, TFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined, TReturning = undefined, TDynamic extends boolean = false, TExcludedMethods extends string = never> extends QueryPromise<TReturning extends undefined ? TRunResult : TReturning[]> implements RunnableQuery<TReturning extends undefined ? TRunResult : TReturning[], 'sqlite'>, SQLWrapper {
private session;
private dialect;
static readonly [entityKind]: string;
constructor(table: TTable, set: UpdateSet, session: SQLiteSession<any, any, any, any>, dialect: SQLiteDialect, withList?: Subquery[]);
from<TFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL>(source: TFrom): SQLiteUpdateWithJoins<this, TDynamic, TFrom>;
private createJoin;
leftJoin: SQLiteUpdateJoinFn<this>;
rightJoin: SQLiteUpdateJoinFn<this>;
innerJoin: SQLiteUpdateJoinFn<this>;
fullJoin: SQLiteUpdateJoinFn<this>;
/**
* Adds a 'where' clause to the query.
*
* Calling this method will update only those rows that fulfill a specified condition.
*
* See docs: {@link https://orm.drizzle.team/docs/update}
*
* @param where the 'where' clause.
*
* @example
* You can use conditional operators and `sql function` to filter the rows to be updated.
*
* ```ts
* // Update all cars with green color
* db.update(cars).set({ color: 'red' })
* .where(eq(cars.color, 'green'));
* // or
* db.update(cars).set({ color: 'red' })
* .where(sql`${cars.color} = 'green'`)
* ```
*
* You can logically combine conditional operators with `and()` and `or()` operators:
*
* ```ts
* // Update all BMW cars with a green color
* db.update(cars).set({ color: 'red' })
* .where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));
*
* // Update all cars with the green or blue color
* db.update(cars).set({ color: 'red' })
* .where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));
* ```
*/
where(where: SQL | undefined): SQLiteUpdateWithout<this, TDynamic, 'where'>;
orderBy(builder: (updateTable: TTable) => ValueOrArray<SQLiteColumn | SQL | SQL.Aliased>): SQLiteUpdateWithout<this, TDynamic, 'orderBy'>;
orderBy(...columns: (SQLiteColumn | SQL | SQL.Aliased)[]): SQLiteUpdateWithout<this, TDynamic, 'orderBy'>;
limit(limit: number | Placeholder): SQLiteUpdateWithout<this, TDynamic, 'limit'>;
/**
* Adds a `returning` clause to the query.
*
* Calling this method will return the specified fields of the updated rows. If no fields are specified, all fields will be returned.
*
* See docs: {@link https://orm.drizzle.team/docs/update#update-with-returning}
*
* @example
* ```ts
* // Update all cars with the green color and return all fields
* const updatedCars: Car[] = await db.update(cars)
* .set({ color: 'red' })
* .where(eq(cars.color, 'green'))
* .returning();
*
* // Update all cars with the green color and return only their id and brand fields
* const updatedCarsIdsAndBrands: { id: number, brand: string }[] = await db.update(cars)
* .set({ color: 'red' })
* .where(eq(cars.color, 'green'))
* .returning({ id: cars.id, brand: cars.brand });
* ```
*/
returning(): SQLiteUpdateReturningAll<this, TDynamic>;
returning<TSelectedFields extends SelectedFields>(fields: TSelectedFields): SQLiteUpdateReturning<this, TDynamic, TSelectedFields>;
toSQL(): Query;
prepare(): SQLiteUpdatePrepare<this>;
run: ReturnType<this['prepare']>['run'];
all: ReturnType<this['prepare']>['all'];
get: ReturnType<this['prepare']>['get'];
values: ReturnType<this['prepare']>['values'];
execute(): Promise<SQLiteUpdateExecute<this>>;
$dynamic(): SQLiteUpdateDynamic<this>;
}
@@ -0,0 +1,2 @@
export { default as withPayload } from "./withPayload/withPayload.js";
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,121 @@
# @emotion/sheet
> A StyleSheet for css-in-js libraries
```bash
yarn add @emotion/sheet
```
```jsx
import { StyleSheet } from '@emotion/sheet'
const sheet = new StyleSheet({ key: '', container: document.head })
sheet.insert('html { color: hotpink; }')
```
> **Note:**
> This is not useful for server-side rendering, you should implement SSR seperately
## StyleSheet
### Options
```ts
type Options = {
nonce?: string
key: string
container: Node
speedy?: boolean
prepend?: boolean
}
```
#### nonce
A nonce that will be set on each style tag that the sheet inserts for [Content Security Policies](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
#### container
A DOM Node that the sheet will insert all of it's style tags into, this is useful for inserting styles into iframes.
#### key
This will be set as the value of the `data-emotion` attribute on the style tags that get inserted. This is useful to identify different sheets.
#### speedy
This defines how rules are inserted. If it is true, rules will be inserted with [`insertRule`](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/insertRule) which is very fast but doesn't allow rules to be edited in DevTools. If it is false, rules will be inserted by appending text nodes to style elements which is much slower than insertRule but allows rules to be edited in DevTools. By default, speedy is enabled in production and disabled in development.
#### prepend
**Deprecated:** Please use `insertionPoint` option instead.
This defines where rules are inserted into the `container`. By default they are appended but this can be changed by using `prepend: true` option.
#### insertionPoint
This defines specific dom node after which the rules are inserted into the `container`. You can use a `meta` tag to specify the specific location:
```jsx
const head = document.querySelector('head')
// <meta name="emotion-insertion-point" content="">
const emotionInsertionPoint = document.createElement('meta')
emotionInsertionPoint.setAttribute('name', 'emotion-insertion-point')
emotionInsertionPoint.setAttribute('content', '')
head.appendChild(emotionInsertionPoint)
// the emotion sheets should be inserted right after the meta tag
const cache = createCache({
key: 'my-app',
insertionPoint: emotionInsertionPoint
})
function App() {
return (
<CacheProvider value={cache}>
<Main />
</CacheProvider>
)
}
```
### Methods
#### insert
This method inserts a single rule into the document. It **must** be a single rule otherwise an error will be thrown in speedy mode which is enabled by default in production.
#### flush
This method will remove all style tags that were inserted into the document.
#### hydrate
This method moves given style elements into sheet's container and put them into internal tags collection. It's can be used for SSRed styles.
### Example with all options
```jsx
import { StyleSheet } from '@emotion/sheet'
const container = document.createElement('div')
document.head.appendChild(container)
const sheet = new StyleSheet({
nonce: 'some-nonce',
key: 'some-key',
container
})
sheet.insert('html { color: hotpink; }')
sheet.flush()
```
# Thanks
This StyleSheet is based on [glamor's StyleSheet](https://github.com/threepointone/glamor) written by [Sunil Pai](https://github.com/threepointone). ❤️
@@ -0,0 +1,827 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { $insertDataTransferForRichText, copyToClipboard } from '@lexical/clipboard';
import { $isParentRTL, $shouldOverrideDefaultCharacterSelection, $moveCharacter } from '@lexical/selection';
import { addClassNamesToElement, isHTMLElement, objectKlassEquals, mergeRegister, $findMatchingParent, $getNearestBlockElementAncestorOrThrow } from '@lexical/utils';
import { createCommand, ElementNode, $createParagraphNode, $applyNodeReplacement, setNodeIndentFromDOM, CLICK_COMMAND, $getSelection, $isNodeSelection, COMMAND_PRIORITY_EDITOR, DELETE_CHARACTER_COMMAND, $isRangeSelection, DELETE_WORD_COMMAND, DELETE_LINE_COMMAND, CONTROLLED_TEXT_INSERTION_COMMAND, REMOVE_TEXT_COMMAND, FORMAT_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, $isElementNode, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, INSERT_TAB_COMMAND, $insertNodes, $createTabNode, INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND, KEY_ARROW_UP_COMMAND, $getAdjacentNode, $isDecoratorNode, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, DROP_COMMAND, $getNearestNodeFromDOMNode, $createRangeSelection, $isTextNode, $normalizeSelection__EXPERIMENTAL, $setSelection, DRAGSTART_COMMAND, DRAGOVER_COMMAND, SELECT_ALL_COMMAND, $selectAll, COPY_COMMAND, CUT_COMMAND, PASTE_COMMAND, isDOMNode, isSelectionCapturedInDecoratorInput, KEY_SPACE_COMMAND, KEY_TAB_COMMAND, PASTE_TAG, $getRoot, $isRootNode } from 'lexical';
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
function caretFromPoint(x, y) {
if (typeof document.caretRangeFromPoint !== 'undefined') {
const range = document.caretRangeFromPoint(x, y);
if (range === null) {
return null;
}
return {
node: range.startContainer,
offset: range.startOffset
};
// @ts-ignore
} else if (document.caretPositionFromPoint !== 'undefined') {
// @ts-ignore FF - no types
const range = document.caretPositionFromPoint(x, y);
if (range === null) {
return null;
}
return {
node: range.offsetNode,
offset: range.offset
};
} else {
// Gracefully handle IE
return null;
}
}
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
const documentMode = CAN_USE_DOM && 'documentMode' in document ? document.documentMode : null;
const CAN_USE_BEFORE_INPUT = CAN_USE_DOM && 'InputEvent' in window && !documentMode ? 'getTargetRanges' in new window.InputEvent('input') : false;
const IS_SAFARI = CAN_USE_DOM && /Version\/[\d.]+.*Safari/.test(navigator.userAgent);
const IS_IOS = CAN_USE_DOM && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
// Keep these in case we need to use them in the future.
// export const IS_WINDOWS: boolean = CAN_USE_DOM && /Win/.test(navigator.platform);
const IS_CHROME = CAN_USE_DOM && /^(?=.*Chrome).*/i.test(navigator.userAgent);
const IS_APPLE_WEBKIT = CAN_USE_DOM && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !IS_CHROME;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
const DRAG_DROP_PASTE = createCommand('DRAG_DROP_PASTE_FILE');
/** @noInheritDoc */
class QuoteNode extends ElementNode {
static getType() {
return 'quote';
}
static clone(node) {
return new QuoteNode(node.__key);
}
// View
createDOM(config) {
const element = document.createElement('blockquote');
addClassNamesToElement(element, config.theme.quote);
return element;
}
updateDOM(prevNode, dom) {
return false;
}
static importDOM() {
return {
blockquote: node => ({
conversion: $convertBlockquoteElement,
priority: 0
})
};
}
exportDOM(editor) {
const {
element
} = super.exportDOM(editor);
if (isHTMLElement(element)) {
if (this.isEmpty()) {
element.append(document.createElement('br'));
}
const formatType = this.getFormatType();
if (formatType) {
element.style.textAlign = formatType;
}
const direction = this.getDirection();
if (direction) {
element.dir = direction;
}
}
return {
element
};
}
static importJSON(serializedNode) {
return $createQuoteNode().updateFromJSON(serializedNode);
}
// Mutation
insertNewAfter(_, restoreSelection) {
const newBlock = $createParagraphNode();
const direction = this.getDirection();
newBlock.setDirection(direction);
this.insertAfter(newBlock, restoreSelection);
return newBlock;
}
collapseAtStart() {
const paragraph = $createParagraphNode();
const children = this.getChildren();
children.forEach(child => paragraph.append(child));
this.replace(paragraph);
return true;
}
canMergeWhenEmpty() {
return true;
}
}
function $createQuoteNode() {
return $applyNodeReplacement(new QuoteNode());
}
function $isQuoteNode(node) {
return node instanceof QuoteNode;
}
/** @noInheritDoc */
class HeadingNode extends ElementNode {
/** @internal */
static getType() {
return 'heading';
}
static clone(node) {
return new HeadingNode(node.__tag, node.__key);
}
constructor(tag, key) {
super(key);
this.__tag = tag;
}
getTag() {
return this.__tag;
}
setTag(tag) {
const self = this.getWritable();
this.__tag = tag;
return self;
}
// View
createDOM(config) {
const tag = this.__tag;
const element = document.createElement(tag);
const theme = config.theme;
const classNames = theme.heading;
if (classNames !== undefined) {
const className = classNames[tag];
addClassNamesToElement(element, className);
}
return element;
}
updateDOM(prevNode, dom, config) {
return prevNode.__tag !== this.__tag;
}
static importDOM() {
return {
h1: node => ({
conversion: $convertHeadingElement,
priority: 0
}),
h2: node => ({
conversion: $convertHeadingElement,
priority: 0
}),
h3: node => ({
conversion: $convertHeadingElement,
priority: 0
}),
h4: node => ({
conversion: $convertHeadingElement,
priority: 0
}),
h5: node => ({
conversion: $convertHeadingElement,
priority: 0
}),
h6: node => ({
conversion: $convertHeadingElement,
priority: 0
}),
p: node => {
// domNode is a <p> since we matched it by nodeName
const paragraph = node;
const firstChild = paragraph.firstChild;
if (firstChild !== null && isGoogleDocsTitle(firstChild)) {
return {
conversion: () => ({
node: null
}),
priority: 3
};
}
return null;
},
span: node => {
if (isGoogleDocsTitle(node)) {
return {
conversion: domNode => {
return {
node: $createHeadingNode('h1')
};
},
priority: 3
};
}
return null;
}
};
}
exportDOM(editor) {
const {
element
} = super.exportDOM(editor);
if (isHTMLElement(element)) {
if (this.isEmpty()) {
element.append(document.createElement('br'));
}
const formatType = this.getFormatType();
if (formatType) {
element.style.textAlign = formatType;
}
const direction = this.getDirection();
if (direction) {
element.dir = direction;
}
}
return {
element
};
}
static importJSON(serializedNode) {
return $createHeadingNode(serializedNode.tag).updateFromJSON(serializedNode);
}
updateFromJSON(serializedNode) {
return super.updateFromJSON(serializedNode).setTag(serializedNode.tag);
}
exportJSON() {
return {
...super.exportJSON(),
tag: this.getTag()
};
}
// Mutation
insertNewAfter(selection, restoreSelection = true) {
const anchorOffet = selection ? selection.anchor.offset : 0;
const lastDesc = this.getLastDescendant();
const isAtEnd = !lastDesc || selection && selection.anchor.key === lastDesc.getKey() && anchorOffet === lastDesc.getTextContentSize();
const newElement = isAtEnd || !selection ? $createParagraphNode() : $createHeadingNode(this.getTag());
const direction = this.getDirection();
newElement.setDirection(direction);
this.insertAfter(newElement, restoreSelection);
if (anchorOffet === 0 && !this.isEmpty() && selection) {
const paragraph = $createParagraphNode();
paragraph.select();
this.replace(paragraph, true);
}
return newElement;
}
collapseAtStart() {
const newElement = !this.isEmpty() ? $createHeadingNode(this.getTag()) : $createParagraphNode();
const children = this.getChildren();
children.forEach(child => newElement.append(child));
this.replace(newElement);
return true;
}
extractWithChild() {
return true;
}
}
function isGoogleDocsTitle(domNode) {
if (domNode.nodeName.toLowerCase() === 'span') {
return domNode.style.fontSize === '26pt';
}
return false;
}
function $convertHeadingElement(element) {
const nodeName = element.nodeName.toLowerCase();
let node = null;
if (nodeName === 'h1' || nodeName === 'h2' || nodeName === 'h3' || nodeName === 'h4' || nodeName === 'h5' || nodeName === 'h6') {
node = $createHeadingNode(nodeName);
if (element.style !== null) {
setNodeIndentFromDOM(element, node);
node.setFormat(element.style.textAlign);
}
}
return {
node
};
}
function $convertBlockquoteElement(element) {
const node = $createQuoteNode();
if (element.style !== null) {
node.setFormat(element.style.textAlign);
setNodeIndentFromDOM(element, node);
}
return {
node
};
}
function $createHeadingNode(headingTag = 'h1') {
return $applyNodeReplacement(new HeadingNode(headingTag));
}
function $isHeadingNode(node) {
return node instanceof HeadingNode;
}
function onPasteForRichText(event, editor) {
event.preventDefault();
editor.update(() => {
const selection = $getSelection();
const clipboardData = objectKlassEquals(event, InputEvent) || objectKlassEquals(event, KeyboardEvent) ? null : event.clipboardData;
if (clipboardData != null && selection !== null) {
$insertDataTransferForRichText(clipboardData, selection, editor);
}
}, {
tag: PASTE_TAG
});
}
async function onCutForRichText(event, editor) {
await copyToClipboard(editor, objectKlassEquals(event, ClipboardEvent) ? event : null);
editor.update(() => {
const selection = $getSelection();
if ($isRangeSelection(selection)) {
selection.removeText();
} else if ($isNodeSelection(selection)) {
selection.getNodes().forEach(node => node.remove());
}
});
}
// Clipboard may contain files that we aren't allowed to read. While the event is arguably useless,
// in certain occasions, we want to know whether it was a file transfer, as opposed to text. We
// control this with the first boolean flag.
function eventFiles(event) {
let dataTransfer = null;
if (objectKlassEquals(event, DragEvent)) {
dataTransfer = event.dataTransfer;
} else if (objectKlassEquals(event, ClipboardEvent)) {
dataTransfer = event.clipboardData;
}
if (dataTransfer === null) {
return [false, [], false];
}
const types = dataTransfer.types;
const hasFiles = types.includes('Files');
const hasContent = types.includes('text/html') || types.includes('text/plain');
return [hasFiles, Array.from(dataTransfer.files), hasContent];
}
function $handleIndentAndOutdent(indentOrOutdent) {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
const alreadyHandled = new Set();
const nodes = selection.getNodes();
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
const key = node.getKey();
if (alreadyHandled.has(key)) {
continue;
}
const parentBlock = $findMatchingParent(node, parentNode => $isElementNode(parentNode) && !parentNode.isInline());
if (parentBlock === null) {
continue;
}
const parentKey = parentBlock.getKey();
if (parentBlock.canIndent() && !alreadyHandled.has(parentKey)) {
alreadyHandled.add(parentKey);
indentOrOutdent(parentBlock);
}
}
return alreadyHandled.size > 0;
}
function $isTargetWithinDecorator(target) {
const node = $getNearestNodeFromDOMNode(target);
return $isDecoratorNode(node);
}
function $isSelectionAtEndOfRoot(selection) {
const focus = selection.focus;
return focus.key === 'root' && focus.offset === $getRoot().getChildrenSize();
}
function $isSelectionCollapsedAtFrontOfIndentedBlock(selection) {
if (!selection.isCollapsed()) {
return false;
}
const {
anchor
} = selection;
if (anchor.offset !== 0) {
return false;
}
const anchorNode = anchor.getNode();
if ($isRootNode(anchorNode)) {
return false;
}
const element = $getNearestBlockElementAncestorOrThrow(anchorNode);
return element.getIndent() > 0 && (element.is(anchorNode) || anchorNode.is(element.getFirstDescendant()));
}
/**
* Resets the capitalization of the selection to default.
* Called when the user presses space, tab, or enter key.
* @param selection The selection to reset the capitalization of.
*/
function $resetCapitalization(selection) {
for (const format of ['lowercase', 'uppercase', 'capitalize']) {
if (selection.hasFormat(format)) {
selection.toggleFormat(format);
}
}
}
function registerRichText(editor) {
const removeListener = mergeRegister(editor.registerCommand(CLICK_COMMAND, payload => {
const selection = $getSelection();
if ($isNodeSelection(selection)) {
selection.clear();
return true;
}
return false;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DELETE_CHARACTER_COMMAND, isBackward => {
const selection = $getSelection();
if ($isRangeSelection(selection)) {
selection.deleteCharacter(isBackward);
return true;
} else if ($isNodeSelection(selection)) {
selection.deleteNodes();
return true;
}
return false;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DELETE_WORD_COMMAND, isBackward => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
selection.deleteWord(isBackward);
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DELETE_LINE_COMMAND, isBackward => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
selection.deleteLine(isBackward);
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(CONTROLLED_TEXT_INSERTION_COMMAND, eventOrText => {
const selection = $getSelection();
if (typeof eventOrText === 'string') {
if (selection !== null) {
selection.insertText(eventOrText);
}
} else {
if (selection === null) {
return false;
}
const dataTransfer = eventOrText.dataTransfer;
if (dataTransfer != null) {
$insertDataTransferForRichText(dataTransfer, selection, editor);
} else if ($isRangeSelection(selection)) {
const data = eventOrText.data;
if (data) {
selection.insertText(data);
}
return true;
}
}
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(REMOVE_TEXT_COMMAND, () => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
selection.removeText();
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(FORMAT_TEXT_COMMAND, format => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
selection.formatText(format);
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(FORMAT_ELEMENT_COMMAND, format => {
const selection = $getSelection();
if (!$isRangeSelection(selection) && !$isNodeSelection(selection)) {
return false;
}
const nodes = selection.getNodes();
for (const node of nodes) {
const element = $findMatchingParent(node, parentNode => $isElementNode(parentNode) && !parentNode.isInline());
if (element !== null) {
element.setFormat(format);
}
}
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INSERT_LINE_BREAK_COMMAND, selectStart => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
selection.insertLineBreak(selectStart);
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INSERT_PARAGRAPH_COMMAND, () => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
selection.insertParagraph();
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INSERT_TAB_COMMAND, () => {
$insertNodes([$createTabNode()]);
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INDENT_CONTENT_COMMAND, () => {
return $handleIndentAndOutdent(block => {
const indent = block.getIndent();
block.setIndent(indent + 1);
});
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(OUTDENT_CONTENT_COMMAND, () => {
return $handleIndentAndOutdent(block => {
const indent = block.getIndent();
if (indent > 0) {
block.setIndent(Math.max(0, indent - 1));
}
});
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ARROW_UP_COMMAND, event => {
const selection = $getSelection();
if ($isNodeSelection(selection)) {
// If selection is on a node, let's try and move selection
// back to being a range selection.
const nodes = selection.getNodes();
if (nodes.length > 0) {
nodes[0].selectPrevious();
return true;
}
} else if ($isRangeSelection(selection)) {
const possibleNode = $getAdjacentNode(selection.focus, true);
if (!event.shiftKey && $isDecoratorNode(possibleNode) && !possibleNode.isIsolated() && !possibleNode.isInline()) {
possibleNode.selectPrevious();
event.preventDefault();
return true;
}
}
return false;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ARROW_DOWN_COMMAND, event => {
const selection = $getSelection();
if ($isNodeSelection(selection)) {
// If selection is on a node, let's try and move selection
// back to being a range selection.
const nodes = selection.getNodes();
if (nodes.length > 0) {
nodes[0].selectNext(0, 0);
return true;
}
} else if ($isRangeSelection(selection)) {
if ($isSelectionAtEndOfRoot(selection)) {
event.preventDefault();
return true;
}
const possibleNode = $getAdjacentNode(selection.focus, false);
if (!event.shiftKey && $isDecoratorNode(possibleNode) && !possibleNode.isIsolated() && !possibleNode.isInline()) {
possibleNode.selectNext();
event.preventDefault();
return true;
}
}
return false;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ARROW_LEFT_COMMAND, event => {
const selection = $getSelection();
if ($isNodeSelection(selection)) {
// If selection is on a node, let's try and move selection
// back to being a range selection.
const nodes = selection.getNodes();
if (nodes.length > 0) {
event.preventDefault();
if ($isParentRTL(nodes[0])) {
nodes[0].selectNext(0, 0);
} else {
nodes[0].selectPrevious();
}
return true;
}
}
if (!$isRangeSelection(selection)) {
return false;
}
if ($shouldOverrideDefaultCharacterSelection(selection, true)) {
const isHoldingShift = event.shiftKey;
event.preventDefault();
$moveCharacter(selection, isHoldingShift, true);
return true;
}
return false;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ARROW_RIGHT_COMMAND, event => {
const selection = $getSelection();
if ($isNodeSelection(selection)) {
// If selection is on a node, let's try and move selection
// back to being a range selection.
const nodes = selection.getNodes();
if (nodes.length > 0) {
event.preventDefault();
if ($isParentRTL(nodes[0])) {
nodes[0].selectPrevious();
} else {
nodes[0].selectNext(0, 0);
}
return true;
}
}
if (!$isRangeSelection(selection)) {
return false;
}
const isHoldingShift = event.shiftKey;
if ($shouldOverrideDefaultCharacterSelection(selection, false)) {
event.preventDefault();
$moveCharacter(selection, isHoldingShift, false);
return true;
}
return false;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_BACKSPACE_COMMAND, event => {
if ($isTargetWithinDecorator(event.target)) {
return false;
}
const selection = $getSelection();
if ($isRangeSelection(selection)) {
if ($isSelectionCollapsedAtFrontOfIndentedBlock(selection)) {
event.preventDefault();
return editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);
}
// Exception handling for iOS native behavior instead of Lexical's behavior when using Korean on iOS devices.
// more details - https://github.com/facebook/lexical/issues/5841
if (IS_IOS && navigator.language === 'ko-KR') {
return false;
}
} else if (!$isNodeSelection(selection)) {
return false;
}
event.preventDefault();
return editor.dispatchCommand(DELETE_CHARACTER_COMMAND, true);
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_DELETE_COMMAND, event => {
if ($isTargetWithinDecorator(event.target)) {
return false;
}
const selection = $getSelection();
if (!($isRangeSelection(selection) || $isNodeSelection(selection))) {
return false;
}
event.preventDefault();
return editor.dispatchCommand(DELETE_CHARACTER_COMMAND, false);
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ENTER_COMMAND, event => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
$resetCapitalization(selection);
if (event !== null) {
// If we have beforeinput, then we can avoid blocking
// the default behavior. This ensures that the iOS can
// intercept that we're actually inserting a paragraph,
// and autocomplete, autocapitalize etc work as intended.
// This can also cause a strange performance issue in
// Safari, where there is a noticeable pause due to
// preventing the key down of enter.
if ((IS_IOS || IS_SAFARI || IS_APPLE_WEBKIT) && CAN_USE_BEFORE_INPUT) {
return false;
}
event.preventDefault();
if (event.shiftKey) {
return editor.dispatchCommand(INSERT_LINE_BREAK_COMMAND, false);
}
}
return editor.dispatchCommand(INSERT_PARAGRAPH_COMMAND, undefined);
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ESCAPE_COMMAND, () => {
const selection = $getSelection();
if (!$isRangeSelection(selection)) {
return false;
}
editor.blur();
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DROP_COMMAND, event => {
const [, files] = eventFiles(event);
if (files.length > 0) {
const x = event.clientX;
const y = event.clientY;
const eventRange = caretFromPoint(x, y);
if (eventRange !== null) {
const {
offset: domOffset,
node: domNode
} = eventRange;
const node = $getNearestNodeFromDOMNode(domNode);
if (node !== null) {
const selection = $createRangeSelection();
if ($isTextNode(node)) {
selection.anchor.set(node.getKey(), domOffset, 'text');
selection.focus.set(node.getKey(), domOffset, 'text');
} else {
const parentKey = node.getParentOrThrow().getKey();
const offset = node.getIndexWithinParent() + 1;
selection.anchor.set(parentKey, offset, 'element');
selection.focus.set(parentKey, offset, 'element');
}
const normalizedSelection = $normalizeSelection__EXPERIMENTAL(selection);
$setSelection(normalizedSelection);
}
editor.dispatchCommand(DRAG_DROP_PASTE, files);
}
event.preventDefault();
return true;
}
const selection = $getSelection();
if ($isRangeSelection(selection)) {
return true;
}
return false;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DRAGSTART_COMMAND, event => {
const [isFileTransfer] = eventFiles(event);
const selection = $getSelection();
if (isFileTransfer && !$isRangeSelection(selection)) {
return false;
}
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DRAGOVER_COMMAND, event => {
const [isFileTransfer] = eventFiles(event);
const selection = $getSelection();
if (isFileTransfer && !$isRangeSelection(selection)) {
return false;
}
const x = event.clientX;
const y = event.clientY;
const eventRange = caretFromPoint(x, y);
if (eventRange !== null) {
const node = $getNearestNodeFromDOMNode(eventRange.node);
if ($isDecoratorNode(node)) {
// Show browser caret as the user is dragging the media across the screen. Won't work
// for DecoratorNode nor it's relevant.
event.preventDefault();
}
}
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(SELECT_ALL_COMMAND, () => {
$selectAll();
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(COPY_COMMAND, event => {
copyToClipboard(editor, objectKlassEquals(event, ClipboardEvent) ? event : null);
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(CUT_COMMAND, event => {
onCutForRichText(event, editor);
return true;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(PASTE_COMMAND, event => {
const [, files, hasTextContent] = eventFiles(event);
if (files.length > 0 && !hasTextContent) {
editor.dispatchCommand(DRAG_DROP_PASTE, files);
return true;
}
// if inputs then paste within the input ignore creating a new node on paste event
if (isDOMNode(event.target) && isSelectionCapturedInDecoratorInput(event.target)) {
return false;
}
const selection = $getSelection();
if (selection !== null) {
onPasteForRichText(event, editor);
return true;
}
return false;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_SPACE_COMMAND, _ => {
const selection = $getSelection();
if ($isRangeSelection(selection)) {
$resetCapitalization(selection);
}
return false;
}, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_TAB_COMMAND, _ => {
const selection = $getSelection();
if ($isRangeSelection(selection)) {
$resetCapitalization(selection);
}
return false;
}, COMMAND_PRIORITY_EDITOR));
return removeListener;
}
export { $createHeadingNode, $createQuoteNode, $isHeadingNode, $isQuoteNode, DRAG_DROP_PASTE, HeadingNode, QuoteNode, eventFiles, registerRichText };
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/getDataByPath.ts"],"sourcesContent":["import type { FormState } from '../admin/types.js'\n\nimport { unflatten } from './unflatten.js'\n\nexport const getDataByPath = <T = unknown>(fields: FormState, path: string): T => {\n const pathPrefixToRemove = path.substring(0, path.lastIndexOf('.') + 1)\n const name = path.split('.').pop()\n\n const data: Record<string, any> = {}\n Object.keys(fields).forEach((key) => {\n if (!fields[key]?.disableFormData && (key.indexOf(`${path}.`) === 0 || key === path)) {\n data[key.replace(pathPrefixToRemove, '')] = fields[key]?.value\n\n if (fields[key]?.rows && fields[key].rows.length === 0) {\n data[key.replace(pathPrefixToRemove, '')] = []\n }\n }\n })\n\n const unflattenedData = unflatten(data)\n\n return unflattenedData?.[name!]\n}\n"],"names":["unflatten","getDataByPath","fields","path","pathPrefixToRemove","substring","lastIndexOf","name","split","pop","data","Object","keys","forEach","key","disableFormData","indexOf","replace","value","rows","length","unflattenedData"],"mappings":"AAEA,SAASA,SAAS,QAAQ,iBAAgB;AAE1C,OAAO,MAAMC,gBAAgB,CAAcC,QAAmBC;IAC5D,MAAMC,qBAAqBD,KAAKE,SAAS,CAAC,GAAGF,KAAKG,WAAW,CAAC,OAAO;IACrE,MAAMC,OAAOJ,KAAKK,KAAK,CAAC,KAAKC,GAAG;IAEhC,MAAMC,OAA4B,CAAC;IACnCC,OAAOC,IAAI,CAACV,QAAQW,OAAO,CAAC,CAACC;QAC3B,IAAI,CAACZ,MAAM,CAACY,IAAI,EAAEC,mBAAoBD,CAAAA,IAAIE,OAAO,CAAC,GAAGb,KAAK,CAAC,CAAC,MAAM,KAAKW,QAAQX,IAAG,GAAI;YACpFO,IAAI,CAACI,IAAIG,OAAO,CAACb,oBAAoB,IAAI,GAAGF,MAAM,CAACY,IAAI,EAAEI;YAEzD,IAAIhB,MAAM,CAACY,IAAI,EAAEK,QAAQjB,MAAM,CAACY,IAAI,CAACK,IAAI,CAACC,MAAM,KAAK,GAAG;gBACtDV,IAAI,CAACI,IAAIG,OAAO,CAACb,oBAAoB,IAAI,GAAG,EAAE;YAChD;QACF;IACF;IAEA,MAAMiB,kBAAkBrB,UAAUU;IAElC,OAAOW,iBAAiB,CAACd,KAAM;AACjC,EAAC"}
@@ -0,0 +1,27 @@
const formatRelativeLocale = {
lastWeek: (date) => {
const day = date.getDay();
let result = "'läschte";
if (day === 2 || day === 4) {
// Eifeler Regel: Add an n before the consonant d; Here "Dënschdeg" "and Donneschde".
result += "n";
}
result += "' eeee 'um' p";
return result;
},
yesterday: "'gëschter um' p",
today: "'haut um' p",
tomorrow: "'moien um' p",
nextWeek: "eeee 'um' p",
other: "P",
};
export const formatRelative = (token, date, _baseDate, _options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date);
}
return format;
};
@@ -0,0 +1 @@
{"version":3,"names":["_core","require","_normalizeAndLoadMetadata","toGetWrapperPayload","lazy","source","metadata","isSideEffectImport","reexportAll","includes","Array","isArray","Error","wrapReference","ref","payload","t","callExpression"],"sources":["../src/lazy-modules.ts"],"sourcesContent":["// TODO: Move `lazy` implementation logic into the CommonJS plugin, since other\n// modules systems do not support `lazy`.\n\nimport { types as t } from \"@babel/core\";\nimport {\n type SourceModuleMetadata,\n isSideEffectImport,\n} from \"./normalize-and-load-metadata.ts\";\n\nexport type Lazy = boolean | string[] | ((source: string) => boolean);\n\nexport function toGetWrapperPayload(lazy: Lazy) {\n return (source: string, metadata: SourceModuleMetadata): null | \"lazy\" => {\n if (lazy === false) return null;\n if (isSideEffectImport(metadata) || metadata.reexportAll) return null;\n if (lazy === true) {\n // 'true' means that local relative files are eagerly loaded and\n // dependency modules are loaded lazily.\n return source.includes(\".\") ? null : \"lazy\";\n }\n if (Array.isArray(lazy)) {\n return !lazy.includes(source) ? null : \"lazy\";\n }\n if (typeof lazy === \"function\") {\n return lazy(source) ? \"lazy\" : null;\n }\n throw new Error(`.lazy must be a boolean, string array, or function`);\n };\n}\n\nexport function wrapReference(\n ref: t.Identifier,\n payload: unknown,\n): t.Expression | null {\n if (payload === \"lazy\") return t.callExpression(ref, []);\n return null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AAOO,SAASE,mBAAmBA,CAACC,IAAU,EAAE;EAC9C,OAAO,CAACC,MAAc,EAAEC,QAA8B,KAAoB;IACxE,IAAIF,IAAI,KAAK,KAAK,EAAE,OAAO,IAAI;IAC/B,IAAI,IAAAG,4CAAkB,EAACD,QAAQ,CAAC,IAAIA,QAAQ,CAACE,WAAW,EAAE,OAAO,IAAI;IACrE,IAAIJ,IAAI,KAAK,IAAI,EAAE;MAGjB,OAAOC,MAAM,CAACI,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,MAAM;IAC7C;IACA,IAAIC,KAAK,CAACC,OAAO,CAACP,IAAI,CAAC,EAAE;MACvB,OAAO,CAACA,IAAI,CAACK,QAAQ,CAACJ,MAAM,CAAC,GAAG,IAAI,GAAG,MAAM;IAC/C;IACA,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;MAC9B,OAAOA,IAAI,CAACC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;IACrC;IACA,MAAM,IAAIO,KAAK,CAAC,oDAAoD,CAAC;EACvE,CAAC;AACH;AAEO,SAASC,aAAaA,CAC3BC,GAAiB,EACjBC,OAAgB,EACK;EACrB,IAAIA,OAAO,KAAK,MAAM,EAAE,OAAOC,WAAC,CAACC,cAAc,CAACH,GAAG,EAAE,EAAE,CAAC;EACxD,OAAO,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,5 @@
import { Parser } from "../index.js";
export declare const parsers: {
yaml: Parser;
};
@@ -0,0 +1,14 @@
import { DirectusFile } from "../../../schema/file.js";
import { Query } from "../../../types/query.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/utils/export.d.ts
type FileFormat = 'csv' | 'csv_utf8' | 'json' | 'xml' | 'yaml';
/**
* Export a larger data set to a file in the File Library
* @returns Nothing
*/
declare const utilsExport: <Schema, TQuery extends Query<Schema, Schema[Collection]>, Collection extends keyof Schema>(collection: Collection, format: FileFormat, query: TQuery, file: Partial<DirectusFile<Schema>>) => RestCommand<void, Schema>;
//#endregion
export { FileFormat, utilsExport };
//# sourceMappingURL=export.d.ts.map
@@ -0,0 +1,213 @@
'use strict'
const assert = require('node:assert')
const { AsyncResource } = require('node:async_hooks')
const { Readable } = require('./readable')
const { InvalidArgumentError, RequestAbortedError } = require('../core/errors')
const util = require('../core/util')
function noop () {}
class RequestHandler extends AsyncResource {
constructor (opts, callback) {
if (!opts || typeof opts !== 'object') {
throw new InvalidArgumentError('invalid opts')
}
const { signal, method, opaque, body, onInfo, responseHeaders, highWaterMark } = opts
try {
if (typeof callback !== 'function') {
throw new InvalidArgumentError('invalid callback')
}
if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
throw new InvalidArgumentError('invalid highWaterMark')
}
if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
}
if (method === 'CONNECT') {
throw new InvalidArgumentError('invalid method')
}
if (onInfo && typeof onInfo !== 'function') {
throw new InvalidArgumentError('invalid onInfo callback')
}
super('UNDICI_REQUEST')
} catch (err) {
if (util.isStream(body)) {
util.destroy(body.on('error', noop), err)
}
throw err
}
this.method = method
this.responseHeaders = responseHeaders || null
this.opaque = opaque || null
this.callback = callback
this.res = null
this.abort = null
this.body = body
this.trailers = {}
this.context = null
this.onInfo = onInfo || null
this.highWaterMark = highWaterMark
this.reason = null
this.removeAbortListener = null
if (signal?.aborted) {
this.reason = signal.reason ?? new RequestAbortedError()
} else if (signal) {
this.removeAbortListener = util.addAbortListener(signal, () => {
this.reason = signal.reason ?? new RequestAbortedError()
if (this.res) {
util.destroy(this.res.on('error', noop), this.reason)
} else if (this.abort) {
this.abort(this.reason)
}
})
}
}
onConnect (abort, context) {
if (this.reason) {
abort(this.reason)
return
}
assert(this.callback)
this.abort = abort
this.context = context
}
onHeaders (statusCode, rawHeaders, resume, statusMessage) {
const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
if (statusCode < 200) {
if (this.onInfo) {
this.onInfo({ statusCode, headers })
}
return
}
const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
const contentType = parsedHeaders['content-type']
const contentLength = parsedHeaders['content-length']
const res = new Readable({
resume,
abort,
contentType,
contentLength: this.method !== 'HEAD' && contentLength
? Number(contentLength)
: null,
highWaterMark
})
if (this.removeAbortListener) {
res.on('close', this.removeAbortListener)
this.removeAbortListener = null
}
this.callback = null
this.res = res
if (callback !== null) {
try {
this.runInAsyncScope(callback, null, null, {
statusCode,
headers,
trailers: this.trailers,
opaque,
body: res,
context
})
} catch (err) {
// If the callback throws synchronously, we need to handle it
// Remove reference to res to allow res being garbage collected
this.res = null
// Destroy the response stream
util.destroy(res.on('error', noop), err)
// Use queueMicrotask to re-throw the error so it reaches uncaughtException
queueMicrotask(() => {
throw err
})
}
}
}
onData (chunk) {
return this.res.push(chunk)
}
onComplete (trailers) {
util.parseHeaders(trailers, this.trailers)
this.res.push(null)
}
onError (err) {
const { res, callback, body, opaque } = this
if (callback) {
// TODO: Does this need queueMicrotask?
this.callback = null
queueMicrotask(() => {
this.runInAsyncScope(callback, null, err, { opaque })
})
}
if (res) {
this.res = null
// Ensure all queued handlers are invoked before destroying res.
queueMicrotask(() => {
util.destroy(res.on('error', noop), err)
})
}
if (body) {
this.body = null
if (util.isStream(body)) {
body.on('error', noop)
util.destroy(body, err)
}
}
if (this.removeAbortListener) {
this.removeAbortListener()
this.removeAbortListener = null
}
}
}
function request (opts, callback) {
if (callback === undefined) {
return new Promise((resolve, reject) => {
request.call(this, opts, (err, data) => {
return err ? reject(err) : resolve(data)
})
})
}
try {
const handler = new RequestHandler(opts, callback)
this.dispatch(opts, handler)
} catch (err) {
if (typeof callback !== 'function') {
throw err
}
const opaque = opts?.opaque
queueMicrotask(() => callback(err, { opaque }))
}
}
module.exports = request
module.exports.RequestHandler = RequestHandler
@@ -0,0 +1,20 @@
export const defaultDrizzleSnapshot = {
id: '00000000-0000-0000-0000-000000000000',
_meta: {
columns: {},
schemas: {},
tables: {}
},
dialect: 'postgresql',
enums: {},
policies: {},
prevId: '00000000-0000-0000-0000-00000000000',
roles: {},
schemas: {},
sequences: {},
tables: {},
version: '7',
views: {}
};
//# sourceMappingURL=defaultSnapshot.js.map
@@ -0,0 +1,29 @@
import { type Options, type PostgresType, type Sql } from 'postgres';
import { entityKind } from "../entity.cjs";
import { PgDatabase } from "../pg-core/db.cjs";
import { type DrizzleConfig } from "../utils.cjs";
import type { PostgresJsQueryResultHKT } from "./session.cjs";
export declare class PostgresJsDatabase<TSchema extends Record<string, unknown> = Record<string, never>> extends PgDatabase<PostgresJsQueryResultHKT, TSchema> {
static readonly [entityKind]: string;
}
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>, TClient extends Sql = Sql>(...params: [
TClient | string
] | [
TClient | string,
DrizzleConfig<TSchema>
] | [
(DrizzleConfig<TSchema> & ({
connection: string | ({
url?: string;
} & Options<Record<string, PostgresType>>);
} | {
client: TClient;
}))
]): PostgresJsDatabase<TSchema> & {
$client: TClient;
};
export declare namespace drizzle {
function mock<TSchema extends Record<string, unknown> = Record<string, never>>(config?: DrizzleConfig<TSchema>): PostgresJsDatabase<TSchema> & {
$client: '$client is not available on drizzle.mock()';
};
}
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/schema/operators.ts"],"sourcesContent":["export const operators = {\n comparison: ['greater_than_equal', 'greater_than', 'less_than_equal', 'less_than'],\n contains: ['in', 'not_in', 'all'],\n equality: ['equals', 'not_equals'],\n geo: ['near'],\n geojson: ['within', 'intersects'],\n partial: ['like', 'contains'],\n}\n"],"names":["operators","comparison","contains","equality","geo","geojson","partial"],"mappings":"AAAA,OAAO,MAAMA,YAAY;IACvBC,YAAY;QAAC;QAAsB;QAAgB;QAAmB;KAAY;IAClFC,UAAU;QAAC;QAAM;QAAU;KAAM;IACjCC,UAAU;QAAC;QAAU;KAAa;IAClCC,KAAK;QAAC;KAAO;IACbC,SAAS;QAAC;QAAU;KAAa;IACjCC,SAAS;QAAC;QAAQ;KAAW;AAC/B,EAAC"}
@@ -0,0 +1,142 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeElement = removeElement;
exports.replaceElement = replaceElement;
exports.appendChild = appendChild;
exports.append = append;
exports.prependChild = prependChild;
exports.prepend = prepend;
/**
* Remove an element from the dom
*
* @category Manipulation
* @param elem The element to be removed
*/
function removeElement(elem) {
if (elem.prev)
elem.prev.next = elem.next;
if (elem.next)
elem.next.prev = elem.prev;
if (elem.parent) {
var childs = elem.parent.children;
var 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
*/
function replaceElement(elem, replacement) {
var prev = (replacement.prev = elem.prev);
if (prev) {
prev.next = replacement;
}
var next = (replacement.next = elem.next);
if (next) {
next.prev = replacement;
}
var parent = (replacement.parent = elem.parent);
if (parent) {
var 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.
*/
function appendChild(parent, child) {
removeElement(child);
child.next = null;
child.parent = parent;
if (parent.children.push(child) > 1) {
var 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.
*/
function append(elem, next) {
removeElement(next);
var parent = elem.parent;
var currNext = elem.next;
next.next = currNext;
next.prev = elem;
elem.next = next;
next.parent = parent;
if (currNext) {
currNext.prev = next;
if (parent) {
var 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.
*/
function prependChild(parent, child) {
removeElement(child);
child.parent = parent;
child.prev = null;
if (parent.children.unshift(child) !== 1) {
var 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.
*/
function prepend(elem, prev) {
removeElement(prev);
var parent = elem.parent;
if (parent) {
var 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,57 @@
declare namespace list {
type List = {
/**
* Safely splits comma-separated values (such as those for `transition-*`
* and `background` properties).
*
* ```js
* Once (root, { list }) {
* list.comma('black, linear-gradient(white, black)')
* //=> ['black', 'linear-gradient(white, black)']
* }
* ```
*
* @param str Comma-separated values.
* @return Split values.
*/
comma(str: string): string[]
default: List
/**
* Safely splits space-separated values (such as those for `background`,
* `border-radius`, and other shorthand properties).
*
* ```js
* Once (root, { list }) {
* list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
* }
* ```
*
* @param str Space-separated values.
* @return Split values.
*/
space(str: string): string[]
/**
* Safely splits values.
*
* ```js
* Once (root, { list }) {
* list.split('1px calc(10% + 1px)', [' ', '\n', '\t']) //=> ['1px', 'calc(10% + 1px)']
* }
* ```
*
* @param string separated values.
* @param separators array of separators.
* @param last boolean indicator.
* @return Split values.
*/
split(string: string, separators: string[], last: boolean): string[]
}
}
// eslint-disable-next-line @typescript-eslint/no-redeclare
declare const list: list.List
export = list
@@ -0,0 +1 @@
{"version":3,"names":["_gensync","data","require","_index","_index2","_normalizeOpts","_rewriteStackTrace","parseRunner","gensync","parse","code","opts","config","loadConfig","parser","passes","normalizeOptions","exports","callback","undefined","beginHiddenCallStack","sync","errback","parseSync","args","parseAsync","async"],"sources":["../src/parse.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\n\nimport loadConfig, { type InputOptions } from \"./config/index.ts\";\nimport parser, { type ParseResult } from \"./parser/index.ts\";\nimport normalizeOptions from \"./transformation/normalize-opts.ts\";\n\nimport { beginHiddenCallStack } from \"./errors/rewrite-stack-trace.ts\";\n\ntype FileParseCallback = {\n (err: Error, ast: null): void;\n (err: null, ast: ParseResult | null): void;\n};\n\ntype Parse = {\n (code: string, callback: FileParseCallback): void;\n (\n code: string,\n opts: InputOptions | undefined | null,\n callback: FileParseCallback,\n ): void;\n (code: string, opts?: InputOptions | null): ParseResult | null;\n};\n\nconst parseRunner = gensync(function* parse(\n code: string,\n opts: InputOptions | undefined | null,\n): Handler<ParseResult | null> {\n const config = yield* loadConfig(opts);\n\n if (config === null) {\n return null;\n }\n\n return yield* parser(config.passes, normalizeOptions(config), code);\n});\n\nexport const parse: Parse = function parse(\n code,\n opts?,\n callback?: FileParseCallback,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined as InputOptions;\n }\n\n if (callback === undefined) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'parse' function expects a callback. If you need to call it synchronously, please use 'parseSync'.\",\n );\n } else {\n // console.warn(\n // \"Starting from Babel 8.0.0, the 'parse' function will expect a callback. If you need to call it synchronously, please use 'parseSync'.\",\n // );\n return beginHiddenCallStack(parseRunner.sync)(code, opts);\n }\n }\n\n beginHiddenCallStack(parseRunner.errback)(code, opts, callback);\n};\n\nexport function parseSync(...args: Parameters<typeof parseRunner.sync>) {\n return beginHiddenCallStack(parseRunner.sync)(...args);\n}\nexport function parseAsync(...args: Parameters<typeof parseRunner.async>) {\n return beginHiddenCallStack(parseRunner.async)(...args);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,kBAAA,GAAAJ,OAAA;AAiBA,MAAMK,WAAW,GAAGC,SAAMA,CAAC,CAAC,UAAUC,KAAKA,CACzCC,IAAY,EACZC,IAAqC,EACR;EAC7B,MAAMC,MAAM,GAAG,OAAO,IAAAC,cAAU,EAACF,IAAI,CAAC;EAEtC,IAAIC,MAAM,KAAK,IAAI,EAAE;IACnB,OAAO,IAAI;EACb;EAEA,OAAO,OAAO,IAAAE,eAAM,EAACF,MAAM,CAACG,MAAM,EAAE,IAAAC,sBAAgB,EAACJ,MAAM,CAAC,EAAEF,IAAI,CAAC;AACrE,CAAC,CAAC;AAEK,MAAMD,KAAY,GAAAQ,OAAA,CAAAR,KAAA,GAAG,SAASA,KAAKA,CACxCC,IAAI,EACJC,IAAK,EACLO,QAA4B,EAC5B;EACA,IAAI,OAAOP,IAAI,KAAK,UAAU,EAAE;IAC9BO,QAAQ,GAAGP,IAAI;IACfA,IAAI,GAAGQ,SAAyB;EAClC;EAEA,IAAID,QAAQ,KAAKC,SAAS,EAAE;IASxB,OAAO,IAAAC,uCAAoB,EAACb,WAAW,CAACc,IAAI,CAAC,CAACX,IAAI,EAAEC,IAAI,CAAC;EAE7D;EAEA,IAAAS,uCAAoB,EAACb,WAAW,CAACe,OAAO,CAAC,CAACZ,IAAI,EAAEC,IAAI,EAAEO,QAAQ,CAAC;AACjE,CAAC;AAEM,SAASK,SAASA,CAAC,GAAGC,IAAyC,EAAE;EACtE,OAAO,IAAAJ,uCAAoB,EAACb,WAAW,CAACc,IAAI,CAAC,CAAC,GAAGG,IAAI,CAAC;AACxD;AACO,SAASC,UAAUA,CAAC,GAAGD,IAA0C,EAAE;EACxE,OAAO,IAAAJ,uCAAoB,EAACb,WAAW,CAACmB,KAAK,CAAC,CAAC,GAAGF,IAAI,CAAC;AACzD;AAAC","ignoreList":[]}
@@ -0,0 +1 @@
{"version":3,"file":"flows.js","names":[],"sources":["../../../../src/rest/commands/read/flows.ts"],"sourcesContent":["import type { DirectusFlow } from '../../../schema/flow.js';\nimport type { ApplyQueryFields, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadFlowOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusFlow<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * List all flows that exist in Directus.\n * @param query The query parameters\n * @returns An array of up to limit flow objects. If no items are available, data will be an empty array.\n */\nexport const readFlows =\n\t<Schema, const TQuery extends Query<Schema, DirectusFlow<Schema>>>(\n\t\tquery?: TQuery,\n\t): RestCommand<ReadFlowOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/flows`,\n\t\tparams: query ?? {},\n\t\tmethod: 'GET',\n\t});\n\n/**\n * List an existing flow by primary key.\n * @param key The primary key of the dashboard\n * @param query The query parameters\n * @returns Returns the requested flow object.\n * @throws Will throw if key is empty\n */\nexport const readFlow =\n\t<Schema, const TQuery extends Query<Schema, DirectusFlow<Schema>>>(\n\t\tkey: DirectusFlow<Schema>['id'],\n\t\tquery?: TQuery,\n\t): RestCommand<ReadFlowOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/flows/${key}`,\n\t\t\tparams: query ?? {},\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"6DAgBA,MAAa,EAEX,QAEM,CACN,KAAM,SACN,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR,EASW,GAEX,EACA,SAGA,EAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,UAAU,IAChB,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR"}
@@ -0,0 +1,157 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^(\d+)/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(tcn|scn)/i,
abbreviated: /^(trước CN|sau CN)/i,
wide: /^(trước Công Nguyên|sau Công Nguyên)/i,
};
const parseEraPatterns = {
any: [/^t/i, /^s/i],
};
const matchQuarterPatterns = {
narrow: /^([1234]|i{1,3}v?)/i,
abbreviated: /^q([1234]|i{1,3}v?)/i,
wide: /^quý ([1234]|i{1,3}v?)/i,
};
const parseQuarterPatterns = {
any: [/(1|i)$/i, /(2|ii)$/i, /(3|iii)$/i, /(4|iv)$/i],
};
const matchMonthPatterns = {
// month number may contain leading 0, 'thg' prefix may have space, underscore or empty before number
// note the order of '1' since it is a sub-string of '10', so must be lower priority
narrow: /^(0?[2-9]|10|11|12|0?1)/i,
// note the order of 'thg 1' since it is sub-string of 'thg 10', so must be lower priority
abbreviated: /^thg[ _]?(0?[1-9](?!\d)|10|11|12)/i,
// note the order of 'Mười' since it is sub-string of Mười Một, so must be lower priority
wide: /^tháng ?(Một|Hai|Ba|Tư|Năm|Sáu|Bảy|Tám|Chín|Mười|Mười ?Một|Mười ?Hai|0?[1-9](?!\d)|10|11|12)/i,
};
const parseMonthPatterns = {
narrow: [
/0?1$/i,
/0?2/i,
/3/,
/4/,
/5/,
/6/,
/7/,
/8/,
/9/,
/10/,
/11/,
/12/,
],
abbreviated: [
/^thg[ _]?0?1(?!\d)/i,
/^thg[ _]?0?2/i,
/^thg[ _]?0?3/i,
/^thg[ _]?0?4/i,
/^thg[ _]?0?5/i,
/^thg[ _]?0?6/i,
/^thg[ _]?0?7/i,
/^thg[ _]?0?8/i,
/^thg[ _]?0?9/i,
/^thg[ _]?10/i,
/^thg[ _]?11/i,
/^thg[ _]?12/i,
],
wide: [
/^tháng ?(Một|0?1(?!\d))/i,
/^tháng ?(Hai|0?2)/i,
/^tháng ?(Ba|0?3)/i,
/^tháng ?(Tư|0?4)/i,
/^tháng ?(Năm|0?5)/i,
/^tháng ?(Sáu|0?6)/i,
/^tháng ?(Bảy|0?7)/i,
/^tháng ?(Tám|0?8)/i,
/^tháng ?(Chín|0?9)/i,
/^tháng ?(Mười|10)/i,
/^tháng ?(Mười ?Một|11)/i,
/^tháng ?(Mười ?Hai|12)/i,
],
};
const matchDayPatterns = {
narrow: /^(CN|T2|T3|T4|T5|T6|T7)/i,
short: /^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,
abbreviated: /^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,
wide: /^(Chủ ?Nhật|Chúa ?Nhật|thứ ?Hai|thứ ?Ba|thứ ?Tư|thứ ?Năm|thứ ?Sáu|thứ ?Bảy)/i,
};
const parseDayPatterns = {
narrow: [/CN/i, /2/i, /3/i, /4/i, /5/i, /6/i, /7/i],
short: [/CN/i, /2/i, /3/i, /4/i, /5/i, /6/i, /7/i],
abbreviated: [/CN/i, /2/i, /3/i, /4/i, /5/i, /6/i, /7/i],
wide: [/(Chủ|Chúa) ?Nhật/i, /Hai/i, /Ba/i, /Tư/i, /Năm/i, /Sáu/i, /Bảy/i],
};
const matchDayPeriodPatterns = {
narrow: /^(a|p|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,
abbreviated: /^(am|pm|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,
wide: /^(ch[^i]*|sa|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^(a|sa)/i,
pm: /^(p|ch[^i]*)/i,
midnight: /nửa đêm/i,
noon: /trưa/i,
morning: /sáng/i,
afternoon: /chiều/i,
evening: /tối/i,
night: /^đêm/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "wide",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "wide",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});
@@ -0,0 +1,118 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^(\d+)(-ლი|-ე)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ჩვ?\.წ)/i,
abbreviated: /^(ჩვ?\.წ)/i,
wide: /^(ჩვენს წელთაღრიცხვამდე|ქრისტეშობამდე|ჩვენი წელთაღრიცხვით|ქრისტეშობიდან)/i,
};
const parseEraPatterns = {
any: [
/^(ჩვენს წელთაღრიცხვამდე|ქრისტეშობამდე)/i,
/^(ჩვენი წელთაღრიცხვით|ქრისტეშობიდან)/i,
],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]-(ლი|ე)? კვ/i,
wide: /^[1234]-(ლი|ე)? კვარტალი/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
any: /^(ია|თე|მა|აპ|მს|ვნ|ვლ|აგ|სე|ოქ|ნო|დე)/i,
};
const parseMonthPatterns = {
any: [
/^ია/i,
/^თ/i,
/^მარ/i,
/^აპ/i,
/^მაი/i,
/^ი?ვნ/i,
/^ი?ვლ/i,
/^აგ/i,
/^ს/i,
/^ო/i,
/^ნ/i,
/^დ/i,
],
};
const matchDayPatterns = {
narrow: /^(კვ|ორ|სა|ოთ|ხუ|პა|შა)/i,
short: /^(კვი|ორშ|სამ|ოთხ|ხუთ|პარ|შაბ)/i,
wide: /^(კვირა|ორშაბათი|სამშაბათი|ოთხშაბათი|ხუთშაბათი|პარასკევი|შაბათი)/i,
};
const parseDayPatterns = {
any: [/^კვ/i, /^ორ/i, /^სა/i, /^ოთ/i, /^ხუ/i, /^პა/i, /^შა/i],
};
const matchDayPeriodPatterns = {
any: /^([ap]\.?\s?m\.?|შუაღ|დილ)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^შუაღ/i,
noon: /^შუადღ/i,
morning: /^დილ/i,
afternoon: /ნაშუადღევს/i,
evening: /საღამო/i,
night: /ღამ/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "any",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});
@@ -0,0 +1,35 @@
"use strict";
exports.subISOWeekYears = subISOWeekYears;
var _index = require("./addISOWeekYears.cjs");
/**
* The {@link subISOWeekYears} function options.
*/
/**
* @name subISOWeekYears
* @category ISO Week-Numbering Year Helpers
* @summary Subtract the specified number of ISO week-numbering years from the given date.
*
* @description
* Subtract the specified number of ISO week-numbering years from the given date.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of ISO week-numbering years to be subtracted.
* @param options - The options
*
* @returns The new date with the ISO week-numbering years subtracted
*
* @example
* // Subtract 5 ISO week-numbering years from 1 September 2014:
* const result = subISOWeekYears(new Date(2014, 8, 1), 5)
* //=> Mon Aug 31 2009 00:00:00
*/
function subISOWeekYears(date, amount, options) {
return (0, _index.addISOWeekYears)(date, -amount, options);
}
@@ -0,0 +1,11 @@
import * as React from 'react';
var syncFallback = function syncFallback(create) {
return create();
};
var useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;
var useInsertionEffectAlwaysWithSyncFallback = syncFallback ;
var useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;
export { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/gel-core/columns/localdate.ts"],"sourcesContent":["import type { LocalDate } from 'gel';\nimport type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyGelTable } from '~/gel-core/table.ts';\nimport { GelColumn } from './common.ts';\nimport { GelLocalDateColumnBaseBuilder } from './date.common.ts';\n\nexport type GelLocalDateStringBuilderInitial<TName extends string> = GelLocalDateStringBuilder<{\n\tname: TName;\n\tdataType: 'localDate';\n\tcolumnType: 'GelLocalDateString';\n\tdata: LocalDate;\n\tdriverParam: LocalDate;\n\tenumValues: undefined;\n}>;\n\nexport class GelLocalDateStringBuilder<T extends ColumnBuilderBaseConfig<'localDate', 'GelLocalDateString'>>\n\textends GelLocalDateColumnBaseBuilder<T>\n{\n\tstatic override readonly [entityKind]: string = 'GelLocalDateStringBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'localDate', 'GelLocalDateString');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyGelTable<{ name: TTableName }>,\n\t): GelLocalDateString<MakeColumnConfig<T, TTableName>> {\n\t\treturn new GelLocalDateString<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class GelLocalDateString<T extends ColumnBaseConfig<'localDate', 'GelLocalDateString'>> extends GelColumn<T> {\n\tstatic override readonly [entityKind]: string = 'GelLocalDateString';\n\n\tgetSQLType(): string {\n\t\treturn 'cal::local_date';\n\t}\n}\n\nexport function localDate(): GelLocalDateStringBuilderInitial<''>;\nexport function localDate<TName extends string>(name: TName): GelLocalDateStringBuilderInitial<TName>;\nexport function localDate(name?: string) {\n\treturn new GelLocalDateStringBuilder(name ?? '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2B;AAE3B,oBAA0B;AAC1B,yBAA8C;AAWvC,MAAM,kCACJ,iDACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB;AAC5B,UAAM,MAAM,aAAa,oBAAoB;AAAA,EAC9C;AAAA;AAAA,EAGS,MACR,OACsD;AACtD,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,2BAA0F,wBAAa;AAAA,EACnH,QAA0B,wBAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AACD;AAIO,SAAS,UAAU,MAAe;AACxC,SAAO,IAAI,0BAA0B,QAAQ,EAAE;AAChD;","names":[]}
@@ -0,0 +1,6 @@
import * as re2 from "re2";
type Re2 = typeof re2 & {
code: string;
};
declare const _default: Re2;
export default _default;
@@ -0,0 +1,11 @@
#ifndef WIN_UTILS_H
#define WIN_UTILS_H
#include <string>
#include <windows.h>
std::wstring utf8ToUtf16(std::string input);
std::string utf16ToUtf8(const WCHAR *input, DWORD length);
std::string normalizePath(std::string path);
#endif
@@ -0,0 +1 @@
{"version":3,"file":"unlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,18 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=trace_state.js.map
@@ -0,0 +1 @@
{"version":3,"file":"unfold-horizontal.js","sources":["../../../src/icons/unfold-horizontal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name UnfoldHorizontal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgMTJoNiIgLz4KICA8cGF0aCBkPSJNOCAxMkgyIiAvPgogIDxwYXRoIGQ9Ik0xMiAydjIiIC8+CiAgPHBhdGggZD0iTTEyIDh2MiIgLz4KICA8cGF0aCBkPSJNMTIgMTR2MiIgLz4KICA8cGF0aCBkPSJNMTIgMjB2MiIgLz4KICA8cGF0aCBkPSJtMTkgMTUgMy0zLTMtMyIgLz4KICA8cGF0aCBkPSJtNSA5LTMgMyAzIDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/unfold-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 UnfoldHorizontal = createLucideIcon('UnfoldHorizontal', [\n ['path', { d: 'M16 12h6', key: '15xry1' }],\n ['path', { d: 'M8 12H2', key: '1jqql6' }],\n ['path', { d: 'M12 2v2', key: 'tus03m' }],\n ['path', { d: 'M12 8v2', key: '1woqiv' }],\n ['path', { d: 'M12 14v2', key: '8jcxud' }],\n ['path', { d: 'M12 20v2', key: '1lh1kg' }],\n ['path', { d: 'm19 15 3-3-3-3', key: 'wjy7rq' }],\n ['path', { d: 'm5 9-3 3 3 3', key: 'j64kie' }],\n]);\n\nexport default UnfoldHorizontal;\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,CAAA,CAAA,CAAmB,iBAAiB,kBAAoB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5D,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,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,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,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,CAC/C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"trophy.js","sources":["../../../src/icons/trophy.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Trophy\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiA5SDQuNWEyLjUgMi41IDAgMCAxIDAtNUg2IiAvPgogIDxwYXRoIGQ9Ik0xOCA5aDEuNWEyLjUgMi41IDAgMCAwIDAtNUgxOCIgLz4KICA8cGF0aCBkPSJNNCAyMmgxNiIgLz4KICA8cGF0aCBkPSJNMTAgMTQuNjZWMTdjMCAuNTUtLjQ3Ljk4LS45NyAxLjIxQzcuODUgMTguNzUgNyAyMC4yNCA3IDIyIiAvPgogIDxwYXRoIGQ9Ik0xNCAxNC42NlYxN2MwIC41NS40Ny45OC45NyAxLjIxQzE2LjE1IDE4Ljc1IDE3IDIwLjI0IDE3IDIyIiAvPgogIDxwYXRoIGQ9Ik0xOCAySDZ2N2E2IDYgMCAwIDAgMTIgMFYyWiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/trophy\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 Trophy = createLucideIcon('Trophy', [\n ['path', { d: 'M6 9H4.5a2.5 2.5 0 0 1 0-5H6', key: '17hqa7' }],\n ['path', { d: 'M18 9h1.5a2.5 2.5 0 0 0 0-5H18', key: 'lmptdp' }],\n ['path', { d: 'M4 22h16', key: '57wxv0' }],\n ['path', { d: 'M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22', key: '1nw9bq' }],\n ['path', { d: 'M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22', key: '1np0yb' }],\n ['path', { d: 'M18 2H6v7a6 6 0 0 0 12 0V2Z', key: 'u46fv3' }],\n]);\n\nexport default Trophy;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,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,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,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,CAC/D,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,CAA8D,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,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+D,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,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,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;AAC9D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,7 @@
export declare class LayoutShiftManager {
_onAfterProcessingUnexpectedShift?: (entry: LayoutShift) => void;
_sessionValue: number;
_sessionEntries: LayoutShift[];
_processEntry(entry: LayoutShift): void;
}
//# sourceMappingURL=LayoutShiftManager.d.ts.map
@@ -0,0 +1,62 @@
# @emotion/cache
### createCache
`createCache` allows for low level customization of how styles get inserted by emotion. It's intended to be used with the [`<CacheProvider/>`](https://emotion.sh/docs/cache-provider) component to override the default cache, which is created with sensible defaults for most applications.
```javascript
import createCache from '@emotion/cache'
export const myCache = createCache({
key: 'my-prefix-key',
stylisPlugins: [
/* your plugins here */
]
})
```
### Primary use cases
- Using emotion in embedded contexts such as an `<iframe/>`
- Setting a [nonce](#nonce-string) on any `<style/>` tag emotion creates for security purposes
- Using emotion with a developer defined `<style/>` tag
- Using emotion with custom Stylis plugins
## Options
### `nonce`
`string`
A nonce that will be set on each style tag that emotion inserts for [Content Security Policies](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
### `stylisPlugins`
`Array<Function>`
A Stylis plugins that will be run by Stylis during preprocessing. [Read the Stylis docs to find out more](https://github.com/thysultan/stylis.js#middleware). This can be used for many purposes such as RTL.
> Note:
>
> Prefixer is just a plugin which happens to be put in default `stylisPlugins`. If you plan to use custom `stylisPlugins` and you want to have your styles prefixed automatically you must include prefixer in your custom `stylisPlugins`. You can import `prefixer` from the `stylis` module to do that (`import { prefixer } from 'stylis'`);
### `key`
`string (Pattern: [^a-z-])`
The prefix before class names. It will also be set as the value of the `data-emotion` attribute on the style tags that emotion inserts and it's used in the attribute name that marks style elements in `renderStylesToString` and `renderStylesToNodeStream`. This is **required if using multiple emotion caches in the same app**.
### `container`
`Node`
A DOM node that emotion will insert all of its style tags into. This is useful for inserting styles into iframes or windows.
### `prepend`
`boolean`
A boolean representing whether to prepend rather than append style tags into the specified container DOM node.
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"0C VC J bB K D E 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC"},E:{"1":"K D E F A B C L M G 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","16":"J bB 6C bC 7C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KD LD MD PC xC ND QC","16":"F JD"},G:{"1":"E RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"bC OD","16":"yC PD QD"},H:{"2":"mD"},I:{"1":"I qD yC rD sD","2":"VC J nD oD pD"},J:{"1":"A","2":"D"},K:{"1":"A B C H PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"B","2":"A"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:7,C:"Document.execCommand()",D:true};
@@ -0,0 +1,182 @@
'use strict'
const bench = require('fastbench')
const pino = require('../../')
const fs = require('node:fs')
const dest = fs.createWriteStream('/dev/null')
const plog = pino(dest)
delete require.cache[require.resolve('../../')]
const plogDest = require('../../')(pino.destination('/dev/null'))
delete require.cache[require.resolve('../../')]
const plogAsync = require('../../')(pino.destination({ dest: '/dev/null', sync: false }))
const plogChild = plog.child({ a: 'property' })
const plogDestChild = plogDest.child({ a: 'property' })
const plogAsyncChild = plogAsync.child({ a: 'property' })
const plogChildChild = plog.child({ a: 'property' }).child({ sub: 'child' })
const plogDestChildChild = plogDest.child({ a: 'property' }).child({ sub: 'child' })
const plogAsyncChildChild = plogAsync.child({ a: 'property' }).child({ sub: 'child' })
const max = 10
const run = bench([
function benchPino (cb) {
for (var i = 0; i < max; i++) {
plog.info('hello world')
}
setImmediate(cb)
},
function benchPinoDest (cb) {
for (var i = 0; i < max; i++) {
plogDest.info('hello world')
}
setImmediate(cb)
},
function benchPinoExtreme (cb) {
for (var i = 0; i < max; i++) {
plogAsync.info('hello world')
}
setImmediate(cb)
},
function benchPinoObj (cb) {
for (var i = 0; i < max; i++) {
plog.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoDestObj (cb) {
for (var i = 0; i < max; i++) {
plogDest.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoAsyncObj (cb) {
for (var i = 0; i < max; i++) {
plogAsync.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChild (cb) {
for (var i = 0; i < max; i++) {
plogChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoDestChild (cb) {
for (var i = 0; i < max; i++) {
plogDestChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoAsyncChild (cb) {
for (var i = 0; i < max; i++) {
plogAsyncChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChildChild (cb) {
for (var i = 0; i < max; i++) {
plogChildChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoDestChildChild (cb) {
for (var i = 0; i < max; i++) {
plogDestChildChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoAsyncChildChild (cb) {
for (var i = 0; i < max; i++) {
plogAsyncChildChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChildCreation (cb) {
const child = plog.child({ a: 'property' })
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoDestChildCreation (cb) {
const child = plogDest.child({ a: 'property' })
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoMulti (cb) {
for (var i = 0; i < max; i++) {
plog.info('hello', 'world')
}
setImmediate(cb)
},
function benchPinoDestMulti (cb) {
for (var i = 0; i < max; i++) {
plogDest.info('hello', 'world')
}
setImmediate(cb)
},
function benchPinoAsyncMulti (cb) {
for (var i = 0; i < max; i++) {
plogAsync.info('hello', 'world')
}
setImmediate(cb)
},
function benchPinoInterpolate (cb) {
for (var i = 0; i < max; i++) {
plog.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchPinoDestInterpolate (cb) {
for (var i = 0; i < max; i++) {
plogDest.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchPinoDestInterpolate (cb) {
for (var i = 0; i < max; i++) {
plogDest.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchPinoInterpolateAll (cb) {
for (var i = 0; i < max; i++) {
plog.info('hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchPinoDestInterpolateAll (cb) {
for (var i = 0; i < max; i++) {
plogDest.info('hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchPinoAsyncInterpolateAll (cb) {
for (var i = 0; i < max; i++) {
plogAsync.info('hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchPinoInterpolateExtra (cb) {
for (var i = 0; i < max; i++) {
plog.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
},
function benchPinoDestInterpolateExtra (cb) {
for (var i = 0; i < max; i++) {
plogDest.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
},
function benchPinoAsyncInterpolateExtra (cb) {
for (var i = 0; i < max; i++) {
plogAsync.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
}
], 10000)
run(run)
@@ -0,0 +1 @@
{"version":3,"file":"dashboards.js","names":[],"sources":["../../../../src/rest/commands/create/dashboards.ts"],"sourcesContent":["import type { DirectusDashboard } from '../../../schema/dashboard.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\n\nexport type CreateDashboardOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusDashboard<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Create multiple new dashboards.\n *\n * @param items The items to create\n * @param query Optional return data query\n *\n * @returns Returns the dashboard object for the created dashboards.\n */\nexport const createDashboards =\n\t<Schema, const TQuery extends Query<Schema, DirectusDashboard<Schema>>>(\n\t\titems: NestedPartial<DirectusDashboard<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<CreateDashboardOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/dashboards`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'POST',\n\t});\n\n/**\n * Create a new dashboard.\n *\n * @param item The dashboard to create\n * @param query Optional return data query\n *\n * @returns Returns the dashboard object for the created dashboard.\n */\nexport const createDashboard =\n\t<Schema, const TQuery extends Query<Schema, DirectusDashboard<Schema>>>(\n\t\titem: NestedPartial<DirectusDashboard<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<CreateDashboardOutput<Schema, TQuery>, Schema> =>\n\t() => ({\n\t\tpath: `/dashboards`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(item),\n\t\tmethod: 'POST',\n\t});\n"],"mappings":"AAkBA,MAAa,GAEX,EACA,SAEM,CACN,KAAM,cACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,OACR,EAUW,GAEX,EACA,SAEM,CACN,KAAM,cACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,OACR"}
@@ -0,0 +1,27 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
*/
"use strict";
const ModuleFactory = require("../ModuleFactory");
const FallbackModule = require("./FallbackModule");
/** @typedef {import("../ModuleFactory").ModuleFactoryCallback} ModuleFactoryCallback */
/** @typedef {import("../ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
/** @typedef {import("./FallbackDependency")} FallbackDependency */
module.exports = class FallbackModuleFactory extends ModuleFactory {
/**
* @param {ModuleFactoryCreateData} data data object
* @param {ModuleFactoryCallback} callback callback
* @returns {void}
*/
create({ dependencies: [dependency] }, callback) {
const dep = /** @type {FallbackDependency} */ (dependency);
callback(null, {
module: new FallbackModule(dep.requests)
});
}
};
@@ -0,0 +1,19 @@
import { AuthenticationData, LDAPLoginPayload, LocalLoginPayload, LoginOptions } from "../../../auth/types.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/auth/login.d.ts
/**
* Authenticate as a user.
*
* @param email Email address of the user.
* @param password Password of the user.
* @param options Optional login settings.
*
* @returns Authentication data.
*/
declare function login<Schema>(payload: LocalLoginPayload, options?: LoginOptions): RestCommand<AuthenticationData, Schema>;
declare function login<Schema>(payload: LDAPLoginPayload, options?: LoginOptions): RestCommand<AuthenticationData, Schema>;
//#endregion
export { login };
//# sourceMappingURL=login.d.ts.map
@@ -0,0 +1,461 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
import { Buffer } from "buffer";
declare interface BufferEntry {
map?: null | RawSourceMap;
bufferedMap?: null | BufferedMap;
}
declare interface BufferedMap {
/**
* version
*/
version: number;
/**
* sources
*/
sources: string[];
/**
* name
*/
names: string[];
/**
* source root
*/
sourceRoot?: string;
/**
* sources content
*/
sourcesContent?: ("" | Buffer)[];
/**
* mappings
*/
mappings?: Buffer;
/**
* file
*/
file: string;
}
declare interface CachedData {
/**
* source
*/
source?: boolean;
/**
* buffer
*/
buffer: Buffer;
/**
* size
*/
size?: number;
/**
* maps
*/
maps: Map<string, BufferEntry>;
/**
* hash
*/
hash?: (string | Buffer)[];
}
declare class CachedSource extends Source {
constructor(source: Source | (() => Source), cachedData?: CachedData);
getCachedData(): CachedData;
originalLazy(): Source | (() => Source);
original(): Source;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
declare class CompatSource extends Source {
constructor(sourceLike: SourceLike);
static from(sourceLike: SourceLike): Source;
}
declare class ConcatSource extends Source {
constructor(...args: ConcatSourceChild[]);
getChildren(): Source[];
add(item: ConcatSourceChild): void;
addAllSkipOptimizing(items: ConcatSourceChild[]): void;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
type ConcatSourceChild = string | Source | SourceLike;
declare interface GeneratedSourceInfo {
/**
* generated line
*/
generatedLine?: number;
/**
* generated column
*/
generatedColumn?: number;
/**
* source
*/
source?: string;
}
declare interface HashLike {
/**
* make hash update
*/
update: (data: string | Buffer, inputEncoding?: string) => HashLike;
/**
* get hash digest
*/
digest: (encoding?: string) => string | Buffer;
}
declare interface MapOptions {
/**
* need columns?
*/
columns?: boolean;
/**
* is module
*/
module?: boolean;
}
declare class OriginalSource extends Source {
constructor(value: string | Buffer, name: string);
getName(): string;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
_onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
declare class PrefixSource extends Source {
constructor(prefix: string, source: string | Source | Buffer);
getPrefix(): string;
original(): Source;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
declare class RawSource extends Source {
constructor(value: string | Buffer, convertToString?: boolean);
isBuffer(): boolean;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
declare interface RawSourceMap {
/**
* version
*/
version: number;
/**
* sources
*/
sources: string[];
/**
* names
*/
names: string[];
/**
* source root
*/
sourceRoot?: string;
/**
* sources content
*/
sourcesContent?: string[];
/**
* mappings
*/
mappings: string;
/**
* file
*/
file: string;
/**
* debug id
*/
debugId?: string;
/**
* ignore list
*/
ignoreList?: number[];
}
declare class ReplaceSource extends Source {
constructor(source: Source, name?: string);
getName(): undefined | string;
getReplacements(): Replacement[];
replace(start: number, end: number, newValue: string, name?: string): void;
insert(pos: number, newValue: string, name?: string): void;
original(): Source;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
static Replacement: typeof Replacement;
}
declare class Replacement {
constructor(start: number, end: number, content: string, name?: string);
start: number;
end: number;
content: string;
name?: string;
index?: number;
}
declare class SizeOnlySource extends Source {
constructor(size: number);
}
declare class Source {
constructor();
source(): SourceValue;
buffer(): Buffer;
size(): number;
map(options?: MapOptions): null | RawSourceMap;
sourceAndMap(options?: MapOptions): SourceAndMap;
updateHash(hash: HashLike): void;
}
declare interface SourceAndMap {
/**
* source
*/
source: SourceValue;
/**
* map
*/
map: null | RawSourceMap;
}
declare interface SourceLike {
/**
* source
*/
source: () => SourceValue;
/**
* buffer
*/
buffer?: () => Buffer;
/**
* size
*/
size?: () => number;
/**
* map
*/
map?: (options?: MapOptions) => null | RawSourceMap;
/**
* source and map
*/
sourceAndMap?: (options?: MapOptions) => SourceAndMap;
/**
* hash updater
*/
updateHash?: (hash: HashLike) => void;
}
declare class SourceMapSource extends Source {
constructor(
value: string | Buffer,
name: string,
sourceMap?: string | RawSourceMap | Buffer,
originalSource?: string | Buffer,
innerSourceMap?: null | string | RawSourceMap | Buffer,
removeOriginalSource?: boolean,
);
getArgsAsBuffers(): [
Buffer,
string,
Buffer,
undefined | Buffer,
undefined | Buffer,
undefined | boolean,
];
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
type SourceValue = string | Buffer;
declare interface StreamChunksOptions {
source?: boolean;
finalSource?: boolean;
columns?: boolean;
}
declare namespace exports {
export namespace util {
export namespace stringBufferUtils {
export let disableDualStringBufferCaching: () => void;
export let enableDualStringBufferCaching: () => void;
export let enterStringInterningRange: () => void;
export let exitStringInterningRange: () => void;
export let internString: (str: string) => string;
export let isDualStringBufferCachingEnabled: () => boolean;
}
}
export type OnChunk = (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void;
export type OnName = (nameIndex: number, name: string) => void;
export type OnSource = (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void;
export {
Source,
RawSource,
OriginalSource,
SourceMapSource,
CachedSource,
ConcatSource,
ReplaceSource,
PrefixSource,
SizeOnlySource,
CompatSource,
CachedData,
SourceLike,
ConcatSourceChild,
Replacement,
HashLike,
MapOptions,
RawSourceMap,
SourceAndMap,
SourceValue,
GeneratedSourceInfo,
StreamChunksOptions,
};
}
export = exports;
@@ -0,0 +1,34 @@
{
"title": "IgnorePluginOptions",
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"contextRegExp": {
"description": "A RegExp to test the context (directory) against.",
"instanceof": "RegExp",
"tsType": "RegExp"
},
"resourceRegExp": {
"description": "A RegExp to test the request against.",
"instanceof": "RegExp",
"tsType": "RegExp"
}
},
"required": ["resourceRegExp"]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"checkResource": {
"description": "A filter function for resource and context.",
"instanceof": "Function",
"tsType": "(import(\"../../lib/IgnorePlugin\").CheckResourceFn)"
}
},
"required": ["checkResource"]
}
]
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('dropWhile', require('../dropWhile'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,3 @@
{
"$ref": "../../WebpackOptions.json#/definitions/CssGeneratorOptions"
}
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/gel-core/columns/decimal.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyGelTable } from '~/gel-core/table.ts';\nimport { GelColumn, GelColumnBuilder } from './common.ts';\n\nexport type GelDecimalBuilderInitial<TName extends string> = GelDecimalBuilder<{\n\tname: TName;\n\tdataType: 'string';\n\tcolumnType: 'GelDecimal';\n\tdata: string;\n\tdriverParam: string;\n\tenumValues: undefined;\n}>;\n\nexport class GelDecimalBuilder<T extends ColumnBuilderBaseConfig<'string', 'GelDecimal'>> extends GelColumnBuilder<\n\tT\n> {\n\tstatic override readonly [entityKind]: string = 'GelDecimalBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'string', 'GelDecimal');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyGelTable<{ name: TTableName }>,\n\t): GelDecimal<MakeColumnConfig<T, TTableName>> {\n\t\treturn new GelDecimal<MakeColumnConfig<T, TTableName>>(table, this.config as ColumnBuilderRuntimeConfig<any, any>);\n\t}\n}\n\nexport class GelDecimal<T extends ColumnBaseConfig<'string', 'GelDecimal'>> extends GelColumn<T> {\n\tstatic override readonly [entityKind]: string = 'GelDecimal';\n\n\tconstructor(table: AnyGelTable<{ name: T['tableName'] }>, config: GelDecimalBuilder<T>['config']) {\n\t\tsuper(table, config);\n\t}\n\n\tgetSQLType(): string {\n\t\treturn 'numeric';\n\t}\n}\n\nexport function decimal(): GelDecimalBuilderInitial<''>;\nexport function decimal<TName extends string>(name: TName): GelDecimalBuilderInitial<TName>;\nexport function decimal(name?: string) {\n\treturn new GelDecimalBuilder(name ?? '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAE3B,oBAA4C;AAWrC,MAAM,0BAAqF,+BAEhG;AAAA,EACD,QAA0B,wBAAU,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,wBAAa;AAAA,EAChG,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,OAA8C,QAAwC;AACjG,UAAM,OAAO,MAAM;AAAA,EACpB;AAAA,EAEA,aAAqB;AACpB,WAAO;AAAA,EACR;AACD;AAIO,SAAS,QAAQ,MAAe;AACtC,SAAO,IAAI,kBAAkB,QAAQ,EAAE;AACxC;","names":[]}
@@ -0,0 +1 @@
export { _ as default } from "../esm/_ts_rewrite_relative_import_extension.js";
@@ -0,0 +1 @@
{"version":3,"file":"logout.js","names":["cookies","getCookies","headers","nextHeaders","createLocalReq","getPayload","logoutOperation","getExistingAuthToken","logout","allSessions","config","payload","cron","authResult","auth","user","message","success","req","collection","collections","logoutResult","existingCookie","cookiePrefix","delete","name"],"sources":["../../src/auth/logout.ts"],"sourcesContent":["'use server'\n\nimport type { MaybePromise, SanitizedConfig } from 'payload'\n\nimport { cookies as getCookies, headers as nextHeaders } from 'next/headers.js'\nimport { createLocalReq, getPayload, logoutOperation } from 'payload'\n\nimport { getExistingAuthToken } from '../utilities/getExistingAuthToken.js'\n\nexport async function logout({\n allSessions = false,\n config,\n}: {\n allSessions?: boolean\n config: MaybePromise<SanitizedConfig>\n}) {\n const payload = await getPayload({ config, cron: true })\n const headers = await nextHeaders()\n const authResult = await payload.auth({ headers })\n\n if (!authResult.user) {\n return { message: 'User already logged out', success: true }\n }\n\n const { user } = authResult\n const req = await createLocalReq({ user }, payload)\n const collection = payload.collections[user.collection]\n\n const logoutResult = await logoutOperation({\n allSessions,\n collection,\n req,\n })\n\n if (!logoutResult) {\n return { message: 'Logout failed', success: false }\n }\n\n const existingCookie = await getExistingAuthToken(payload.config.cookiePrefix)\n if (existingCookie) {\n const cookies = await getCookies()\n cookies.delete(existingCookie.name)\n }\n\n return { message: 'User logged out successfully', success: true }\n}\n"],"mappings":"AAAA;;AAIA,SAASA,OAAA,IAAWC,UAAU,EAAEC,OAAA,IAAWC,WAAW,QAAQ;AAC9D,SAASC,cAAc,EAAEC,UAAU,EAAEC,eAAe,QAAQ;AAE5D,SAASC,oBAAoB,QAAQ;AAErC,OAAO,eAAeC,OAAO;EAC3BC,WAAA,GAAc,KAAK;EACnBC;AAAM,CAIP;EACC,MAAMC,OAAA,GAAU,MAAMN,UAAA,CAAW;IAAEK,MAAA;IAAQE,IAAA,EAAM;EAAK;EACtD,MAAMV,OAAA,GAAU,MAAMC,WAAA;EACtB,MAAMU,UAAA,GAAa,MAAMF,OAAA,CAAQG,IAAI,CAAC;IAAEZ;EAAQ;EAEhD,IAAI,CAACW,UAAA,CAAWE,IAAI,EAAE;IACpB,OAAO;MAAEC,OAAA,EAAS;MAA2BC,OAAA,EAAS;IAAK;EAC7D;EAEA,MAAM;IAAEF;EAAI,CAAE,GAAGF,UAAA;EACjB,MAAMK,GAAA,GAAM,MAAMd,cAAA,CAAe;IAAEW;EAAK,GAAGJ,OAAA;EAC3C,MAAMQ,UAAA,GAAaR,OAAA,CAAQS,WAAW,CAACL,IAAA,CAAKI,UAAU,CAAC;EAEvD,MAAME,YAAA,GAAe,MAAMf,eAAA,CAAgB;IACzCG,WAAA;IACAU,UAAA;IACAD;EACF;EAEA,IAAI,CAACG,YAAA,EAAc;IACjB,OAAO;MAAEL,OAAA,EAAS;MAAiBC,OAAA,EAAS;IAAM;EACpD;EAEA,MAAMK,cAAA,GAAiB,MAAMf,oBAAA,CAAqBI,OAAA,CAAQD,MAAM,CAACa,YAAY;EAC7E,IAAID,cAAA,EAAgB;IAClB,MAAMtB,OAAA,GAAU,MAAMC,UAAA;IACtBD,OAAA,CAAQwB,MAAM,CAACF,cAAA,CAAeG,IAAI;EACpC;EAEA,OAAO;IAAET,OAAA,EAAS;IAAgCC,OAAA,EAAS;EAAK;AAClE","ignoreList":[]}
@@ -0,0 +1,21 @@
var baseWrapperValue = require('./_baseWrapperValue');
/**
* Executes the chain sequence to resolve the unwrapped value.
*
* @name value
* @memberOf _
* @since 0.1.0
* @alias toJSON, valueOf
* @category Seq
* @returns {*} Returns the resolved unwrapped value.
* @example
*
* _([1, 2, 3]).value();
* // => [1, 2, 3]
*/
function wrapperValue() {
return baseWrapperValue(this.__wrapped__, this.__actions__);
}
module.exports = wrapperValue;
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/pg-core/columns/smallint.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 '~/pg-core/table.ts';\nimport { PgColumn } from './common.ts';\nimport { PgIntColumnBaseBuilder } from './int.common.ts';\n\nexport type PgSmallIntBuilderInitial<TName extends string> = PgSmallIntBuilder<{\n\tname: TName;\n\tdataType: 'number';\n\tcolumnType: 'PgSmallInt';\n\tdata: number;\n\tdriverParam: number | string;\n\tenumValues: undefined;\n}>;\n\nexport class PgSmallIntBuilder<T extends ColumnBuilderBaseConfig<'number', 'PgSmallInt'>>\n\textends PgIntColumnBaseBuilder<T>\n{\n\tstatic override readonly [entityKind]: string = 'PgSmallIntBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'number', 'PgSmallInt');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyPgTable<{ name: TTableName }>,\n\t): PgSmallInt<MakeColumnConfig<T, TTableName>> {\n\t\treturn new PgSmallInt<MakeColumnConfig<T, TTableName>>(table, this.config as ColumnBuilderRuntimeConfig<any, any>);\n\t}\n}\n\nexport class PgSmallInt<T extends ColumnBaseConfig<'number', 'PgSmallInt'>> extends PgColumn<T> {\n\tstatic override readonly [entityKind]: string = 'PgSmallInt';\n\n\tgetSQLType(): string {\n\t\treturn 'smallint';\n\t}\n\n\toverride mapFromDriverValue = (value: number | string): number => {\n\t\tif (typeof value === 'string') {\n\t\t\treturn Number(value);\n\t\t}\n\t\treturn value;\n\t};\n}\n\nexport function smallint(): PgSmallIntBuilderInitial<''>;\nexport function smallint<TName extends string>(name: TName): PgSmallIntBuilderInitial<TName>;\nexport function smallint(name?: string) {\n\treturn new PgSmallIntBuilder(name ?? '');\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB;AACzB,SAAS,8BAA8B;AAWhC,MAAM,0BACJ,uBACT;AAAA,EACC,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;AAAA,EAES,qBAAqB,CAAC,UAAmC;AACjE,QAAI,OAAO,UAAU,UAAU;AAC9B,aAAO,OAAO,KAAK;AAAA,IACpB;AACA,WAAO;AAAA,EACR;AACD;AAIO,SAAS,SAAS,MAAe;AACvC,SAAO,IAAI,kBAAkB,QAAQ,EAAE;AACxC;","names":[]}
@@ -0,0 +1,17 @@
import { clamp } from '../../../utils/clamp.mjs';
const number = {
test: (v) => typeof v === "number",
parse: parseFloat,
transform: (v) => v,
};
const alpha = {
...number,
transform: (v) => clamp(0, 1, v),
};
const scale = {
...number,
default: 1,
};
export { alpha, number, scale };
@@ -0,0 +1 @@
{"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { Client } from './client';\nimport { getCurrentScope } from './currentScopes';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { ClientOptions } from './types-hoist/options';\nimport { consoleSandbox, debug } from './utils/debug-logger';\n\n/** A class object that can instantiate Client objects. */\nexport type ClientClass<F extends Client, O extends ClientOptions> = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind<F extends Client, O extends ClientOptions>(\n clientClass: ClientClass<F, O>,\n options: O,\n): Client {\n if (options.debug === true) {\n if (DEBUG_BUILD) {\n debug.enable();\n } else {\n // use `console.warn` rather than `debug.warn` since by non-debug bundles have all `debug.x` statements stripped\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n });\n }\n }\n const scope = getCurrentScope();\n scope.update(options.initialScope);\n\n const client = new clientClass(options);\n setCurrentClient(client);\n client.init();\n return client;\n}\n\n/**\n * Make the given client the current client.\n */\nexport function setCurrentClient(client: Client): void {\n getCurrentScope().setClient(client);\n}\n"],"names":["DEBUG_BUILD","debug","consoleSandbox","getCurrentScope"],"mappings":";;;;;;AAMA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW;AAC3B,EAAE,WAAW;AACb,EAAE,OAAO;AACT,EAAU;AACV,EAAE,IAAI,OAAO,CAAC,KAAA,KAAU,IAAI,EAAE;AAC9B,IAAI,IAAIA,sBAAW,EAAE;AACrB,MAAMC,iBAAK,CAAC,MAAM,EAAE;AACpB,IAAI,OAAO;AACX;AACA,MAAMC,0BAAc,CAAC,MAAM;AAC3B;AACA,QAAQ,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC;AACpG,MAAM,CAAC,CAAC;AACR,IAAI;AACJ,EAAE;AACF,EAAE,MAAM,KAAA,GAAQC,6BAAe,EAAE;AACjC,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC;;AAEpC,EAAE,MAAM,MAAA,GAAS,IAAI,WAAW,CAAC,OAAO,CAAC;AACzC,EAAE,gBAAgB,CAAC,MAAM,CAAC;AAC1B,EAAE,MAAM,CAAC,IAAI,EAAE;AACf,EAAE,OAAO,MAAM;AACf;;AAEA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,MAAM,EAAgB;AACvD,EAAEA,6BAAe,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;AACrC;;;;;"}
@@ -0,0 +1,124 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "Zeichen", verb: "zu haben" },
file: { unit: "Bytes", verb: "zu haben" },
array: { unit: "Elemente", verb: "zu haben" },
set: { unit: "Elemente", verb: "zu haben" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const parsedType = (data: any): string => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "Zahl";
}
case "object": {
if (Array.isArray(data)) {
return "Array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "Eingabe",
email: "E-Mail-Adresse",
url: "URL",
emoji: "Emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO-Datum und -Uhrzeit",
date: "ISO-Datum",
time: "ISO-Uhrzeit",
duration: "ISO-Dauer",
ipv4: "IPv4-Adresse",
ipv6: "IPv6-Adresse",
cidrv4: "IPv4-Bereich",
cidrv6: "IPv6-Bereich",
base64: "Base64-codierter String",
base64url: "Base64-URL-codierter String",
json_string: "JSON-String",
e164: "E.164-Nummer",
jwt: "JWT",
template_literal: "Eingabe",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Ungültige Eingabe: erwartet ${issue.expected}, erhalten ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1) return `Ungültige Eingabe: erwartet ${util.stringifyPrimitive(issue.values[0])}`;
return `Ungültige Option: erwartet eine von ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`;
return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ist`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} hat`;
}
return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ist`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `Ungültiger String: muss mit "${_issue.prefix}" beginnen`;
if (_issue.format === "ends_with") return `Ungültiger String: muss mit "${_issue.suffix}" enden`;
if (_issue.format === "includes") return `Ungültiger String: muss "${_issue.includes}" enthalten`;
if (_issue.format === "regex") return `Ungültiger String: muss dem Muster ${_issue.pattern} entsprechen`;
return `Ungültig: ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Ungültige Zahl: muss ein Vielfaches von ${issue.divisor} sein`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Unbekannte Schlüssel" : "Unbekannter Schlüssel"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Ungültiger Schlüssel in ${issue.origin}`;
case "invalid_union":
return "Ungültige Eingabe";
case "invalid_element":
return `Ungültiger Wert in ${issue.origin}`;
default:
return `Ungültige Eingabe`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -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 Link = createLucideIcon("Link", [
["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
]);
export { Link as default };
//# sourceMappingURL=link.js.map
@@ -0,0 +1,119 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "1秒未満",
other: "{{count}}秒未満",
oneWithSuffix: "約1秒",
otherWithSuffix: "約{{count}}秒",
},
xSeconds: {
one: "1秒",
other: "{{count}}秒",
},
halfAMinute: "30秒",
lessThanXMinutes: {
one: "1分未満",
other: "{{count}}分未満",
oneWithSuffix: "約1分",
otherWithSuffix: "約{{count}}分",
},
xMinutes: {
one: "1分",
other: "{{count}}分",
},
aboutXHours: {
one: "約1時間",
other: "約{{count}}時間",
},
xHours: {
one: "1時間",
other: "{{count}}時間",
},
xDays: {
one: "1日",
other: "{{count}}日",
},
aboutXWeeks: {
one: "約1週間",
other: "約{{count}}週間",
},
xWeeks: {
one: "1週間",
other: "{{count}}週間",
},
aboutXMonths: {
one: "約1か月",
other: "約{{count}}か月",
},
xMonths: {
one: "1か月",
other: "{{count}}か月",
},
aboutXYears: {
one: "約1年",
other: "約{{count}}年",
},
xYears: {
one: "1年",
other: "{{count}}年",
},
overXYears: {
one: "1年以上",
other: "{{count}}年以上",
},
almostXYears: {
one: "1年近く",
other: "{{count}}年近く",
},
};
const formatDistance = (token, count, options) => {
options = options || {};
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
if (options.addSuffix && tokenValue.oneWithSuffix) {
result = tokenValue.oneWithSuffix;
} else {
result = tokenValue.one;
}
} else {
if (options.addSuffix && tokenValue.otherWithSuffix) {
result = tokenValue.otherWithSuffix.replace("{{count}}", String(count));
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
}
if (options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return result + "後";
} else {
return result + "前";
}
}
return result;
};
exports.formatDistance = formatDistance;
@@ -0,0 +1,283 @@
import { expect, test } from "vitest";
import * as z from "zod/v4";
test("string length", async () => {
try {
await z.string().length(4).parseAsync("asd");
} catch (err) {
// ("String must contain exactly 4 character(s)");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"exact": true,
"inclusive": true,
"message": "Too small: expected string to have >=4 characters",
"minimum": 4,
"origin": "string",
"path": [],
},
]
`);
}
try {
await z.string().length(4).parseAsync("asdaa");
} catch (err) {
// ("String must contain exactly 4 character(s)");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"exact": true,
"inclusive": true,
"maximum": 4,
"message": "Too big: expected string to have <=4 characters",
"origin": "string",
"path": [],
},
]
`);
}
});
test("string min/max", async () => {
try {
await z.string().min(4).parseAsync("asd");
} catch (err) {
// ("String must contain at least 4 character(s)");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": true,
"message": "Too small: expected string to have >=4 characters",
"minimum": 4,
"origin": "string",
"path": [],
},
]
`);
}
});
test("string max", async () => {
try {
await z.string().max(4).parseAsync("aasdfsdfsd");
} catch (err) {
// ("String must contain at most 4 character(s)");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": true,
"maximum": 4,
"message": "Too big: expected string to have <=4 characters",
"origin": "string",
"path": [],
},
]
`);
}
});
test("number min", async () => {
try {
await z.number().min(3).parseAsync(2);
} catch (err) {
// ("Number must be greater than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": true,
"message": "Too small: expected number to be >=3",
"minimum": 3,
"origin": "number",
"path": [],
},
]
`);
}
});
test("number gte", async () => {
try {
await z.number().gte(3).parseAsync(2);
} catch (err) {
// ("Number must be greater than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": true,
"message": "Too small: expected number to be >=3",
"minimum": 3,
"origin": "number",
"path": [],
},
]
`);
}
});
test("number gt", async () => {
try {
await z.number().gt(3).parseAsync(3);
} catch (err) {
// ("Number must be greater than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": false,
"message": "Too small: expected number to be >3",
"minimum": 3,
"origin": "number",
"path": [],
},
]
`);
}
});
test("number max", async () => {
try {
await z.number().max(3).parseAsync(4);
} catch (err) {
// ("Number must be less than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": true,
"maximum": 3,
"message": "Too big: expected number to be <=3",
"origin": "number",
"path": [],
},
]
`);
}
});
test("number lte", async () => {
try {
await z.number().lte(3).parseAsync(4);
} catch (err) {
// ("Number must be less than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": true,
"maximum": 3,
"message": "Too big: expected number to be <=3",
"origin": "number",
"path": [],
},
]
`);
}
});
test("number lt", async () => {
try {
await z.number().lt(3).parseAsync(3);
} catch (err) {
// ("Number must be less than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": false,
"maximum": 3,
"message": "Too big: expected number to be <3",
"origin": "number",
"path": [],
},
]
`);
}
});
test("number nonnegative", async () => {
try {
await z.number().nonnegative().parseAsync(-1);
} catch (err) {
// ("Number must be greater than or equal to 0");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": true,
"message": "Too small: expected number to be >=0",
"minimum": 0,
"origin": "number",
"path": [],
},
]
`);
}
});
test("number nonpositive", async () => {
try {
await z.number().nonpositive().parseAsync(1);
} catch (err) {
// ("Number must be less than or equal to 0");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": true,
"maximum": 0,
"message": "Too big: expected number to be <=0",
"origin": "number",
"path": [],
},
]
`);
}
});
test("number negative", async () => {
try {
await z.number().negative().parseAsync(1);
} catch (err) {
// ("Number must be less than 0");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": false,
"maximum": 0,
"message": "Too big: expected number to be <0",
"origin": "number",
"path": [],
},
]
`);
}
});
test("number positive", async () => {
try {
await z.number().positive().parseAsync(-1);
} catch (err) {
// ("Number must be greater than 0");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": false,
"message": "Too small: expected number to be >0",
"minimum": 0,
"origin": "number",
"path": [],
},
]
`);
}
});
@@ -0,0 +1,11 @@
import type { Client, ReplayEvent, Scope } from '@sentry/core';
/**
* Prepare a replay event & enrich it with the SDK metadata.
*/
export declare function prepareReplayEvent({ client, scope, replayId: event_id, event, }: {
client: Client;
scope: Scope;
replayId: string;
event: ReplayEvent;
}): Promise<ReplayEvent | null>;
//# sourceMappingURL=prepareReplayEvent.d.ts.map
@@ -0,0 +1,526 @@
"use strict";
Object.defineProperty(exports, "longFormatters", {
enumerable: true,
get: function () {
return _index5.longFormatters;
},
});
exports.parse = parse;
Object.defineProperty(exports, "parsers", {
enumerable: true,
get: function () {
return _index7.parsers;
},
});
var _index = require("./constructFrom.js");
var _index2 = require("./getDefaultOptions.js");
var _index3 = require("./_lib/defaultLocale.js");
var _index4 = require("./toDate.js");
var _index5 = require("./_lib/format/longFormatters.js");
var _index6 = require("./_lib/protectedTokens.js");
var _index7 = require("./parse/_lib/parsers.js");
var _Setter = require("./parse/_lib/Setter.js");
// Rexports of internal for libraries to use.
// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
/**
* The {@link parse} function options.
*/
// This RegExp consists of three parts separated by `|`:
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
// (one of the certain letters followed by `o`)
// - (\w)\1* matches any sequences of the same letter
// - '' matches two quote characters in a row
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
// except a single quote symbol, which ends the sequence.
// Two quote characters do not end the sequence.
// If there is no matching single quote
// then the sequence will continue until the end of the string.
// - . matches any single character unmatched by previous parts of the RegExps
const formattingTokensRegExp =
/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
// This RegExp catches symbols escaped by quotes, and also
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
const escapedStringRegExp = /^'([^]*?)'?$/;
const doubleQuoteRegExp = /''/g;
const notWhitespaceRegExp = /\S/;
const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
/**
* @name parse
* @category Common Helpers
* @summary Parse the date.
*
* @description
* Return the date parsed from string using the given format string.
*
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* The characters in the format string wrapped between two single quotes characters (') are escaped.
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
*
* Format of the format string is based on Unicode Technical Standard #35:
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
* with a few additions (see note 5 below the table).
*
* Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
* and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
*
* ```javascript
* parse('23 AM', 'HH a', new Date())
* //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
* ```
*
* See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
*
* Accepted format string patterns:
* | Unit |Prior| Pattern | Result examples | Notes |
* |---------------------------------|-----|---------|-----------------------------------|-------|
* | Era | 140 | G..GGG | AD, BC | |
* | | | GGGG | Anno Domini, Before Christ | 2 |
* | | | GGGGG | A, B | |
* | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
* | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
* | | | yy | 44, 01, 00, 17 | 4 |
* | | | yyy | 044, 001, 123, 999 | 4 |
* | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
* | | | yyyyy | ... | 2,4 |
* | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
* | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
* | | | YY | 44, 01, 00, 17 | 4,6 |
* | | | YYY | 044, 001, 123, 999 | 4 |
* | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
* | | | YYYYY | ... | 2,4 |
* | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
* | | | RR | -43, 01, 00, 17 | 4,5 |
* | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
* | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
* | | | RRRRR | ... | 2,4,5 |
* | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
* | | | uu | -43, 01, 99, -99 | 4 |
* | | | uuu | -043, 001, 123, 999, -999 | 4 |
* | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
* | | | uuuuu | ... | 2,4 |
* | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
* | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
* | | | QQ | 01, 02, 03, 04 | |
* | | | QQQ | Q1, Q2, Q3, Q4 | |
* | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
* | | | QQQQQ | 1, 2, 3, 4 | 4 |
* | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
* | | | qo | 1st, 2nd, 3rd, 4th | 5 |
* | | | qq | 01, 02, 03, 04 | |
* | | | qqq | Q1, Q2, Q3, Q4 | |
* | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
* | | | qqqqq | 1, 2, 3, 4 | 3 |
* | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
* | | | Mo | 1st, 2nd, ..., 12th | 5 |
* | | | MM | 01, 02, ..., 12 | |
* | | | MMM | Jan, Feb, ..., Dec | |
* | | | MMMM | January, February, ..., December | 2 |
* | | | MMMMM | J, F, ..., D | |
* | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
* | | | Lo | 1st, 2nd, ..., 12th | 5 |
* | | | LL | 01, 02, ..., 12 | |
* | | | LLL | Jan, Feb, ..., Dec | |
* | | | LLLL | January, February, ..., December | 2 |
* | | | LLLLL | J, F, ..., D | |
* | Local week of year | 100 | w | 1, 2, ..., 53 | |
* | | | wo | 1st, 2nd, ..., 53th | 5 |
* | | | ww | 01, 02, ..., 53 | |
* | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
* | | | Io | 1st, 2nd, ..., 53th | 5 |
* | | | II | 01, 02, ..., 53 | 5 |
* | Day of month | 90 | d | 1, 2, ..., 31 | |
* | | | do | 1st, 2nd, ..., 31st | 5 |
* | | | dd | 01, 02, ..., 31 | |
* | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
* | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
* | | | DD | 01, 02, ..., 365, 366 | 7 |
* | | | DDD | 001, 002, ..., 365, 366 | |
* | | | DDDD | ... | 2 |
* | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |
* | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
* | | | EEEEE | M, T, W, T, F, S, S | |
* | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
* | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
* | | | io | 1st, 2nd, ..., 7th | 5 |
* | | | ii | 01, 02, ..., 07 | 5 |
* | | | iii | Mon, Tue, Wed, ..., Sun | 5 |
* | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
* | | | iiiii | M, T, W, T, F, S, S | 5 |
* | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
* | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
* | | | eo | 2nd, 3rd, ..., 1st | 5 |
* | | | ee | 02, 03, ..., 01 | |
* | | | eee | Mon, Tue, Wed, ..., Sun | |
* | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
* | | | eeeee | M, T, W, T, F, S, S | |
* | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
* | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
* | | | co | 2nd, 3rd, ..., 1st | 5 |
* | | | cc | 02, 03, ..., 01 | |
* | | | ccc | Mon, Tue, Wed, ..., Sun | |
* | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
* | | | ccccc | M, T, W, T, F, S, S | |
* | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
* | AM, PM | 80 | a..aaa | AM, PM | |
* | | | aaaa | a.m., p.m. | 2 |
* | | | aaaaa | a, p | |
* | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
* | | | bbbb | a.m., p.m., noon, midnight | 2 |
* | | | bbbbb | a, p, n, mi | |
* | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
* | | | BBBB | at night, in the morning, ... | 2 |
* | | | BBBBB | at night, in the morning, ... | |
* | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
* | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
* | | | hh | 01, 02, ..., 11, 12 | |
* | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
* | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
* | | | HH | 00, 01, 02, ..., 23 | |
* | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
* | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
* | | | KK | 01, 02, ..., 11, 00 | |
* | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
* | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
* | | | kk | 24, 01, 02, ..., 23 | |
* | Minute | 60 | m | 0, 1, ..., 59 | |
* | | | mo | 0th, 1st, ..., 59th | 5 |
* | | | mm | 00, 01, ..., 59 | |
* | Second | 50 | s | 0, 1, ..., 59 | |
* | | | so | 0th, 1st, ..., 59th | 5 |
* | | | ss | 00, 01, ..., 59 | |
* | Seconds timestamp | 40 | t | 512969520 | |
* | | | tt | ... | 2 |
* | Fraction of second | 30 | S | 0, 1, ..., 9 | |
* | | | SS | 00, 01, ..., 99 | |
* | | | SSS | 000, 001, ..., 999 | |
* | | | SSSS | ... | 2 |
* | Milliseconds timestamp | 20 | T | 512969520900 | |
* | | | TT | ... | 2 |
* | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
* | | | XX | -0800, +0530, Z | |
* | | | XXX | -08:00, +05:30, Z | |
* | | | XXXX | -0800, +0530, Z, +123456 | 2 |
* | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
* | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
* | | | xx | -0800, +0530, +0000 | |
* | | | xxx | -08:00, +05:30, +00:00 | 2 |
* | | | xxxx | -0800, +0530, +0000, +123456 | |
* | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
* | Long localized date | NA | P | 05/29/1453 | 5,8 |
* | | | PP | May 29, 1453 | |
* | | | PPP | May 29th, 1453 | |
* | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
* | Long localized time | NA | p | 12:00 AM | 5,8 |
* | | | pp | 12:00:00 AM | |
* | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
* | | | PPpp | May 29, 1453, 12:00:00 AM | |
* | | | PPPpp | May 29th, 1453 at ... | |
* | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
* Notes:
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
* are the same as "stand-alone" units, but are different in some languages.
* "Formatting" units are declined according to the rules of the language
* in the context of a date. "Stand-alone" units are always nominative singular.
* In `format` function, they will produce different result:
*
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
*
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
*
* `parse` will try to match both formatting and stand-alone units interchangably.
*
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
* the single quote characters (see below).
* If the sequence is longer than listed in table:
* - for numerical units (`yyyyyyyy`) `parse` will try to match a number
* as wide as the sequence
* - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
* These variations are marked with "2" in the last column of the table.
*
* 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
* These tokens represent the shortest form of the quarter.
*
* 4. The main difference between `y` and `u` patterns are B.C. years:
*
* | Year | `y` | `u` |
* |------|-----|-----|
* | AC 1 | 1 | 1 |
* | BC 1 | 1 | 0 |
* | BC 2 | 2 | -1 |
*
* Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
*
* `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
*
* `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
*
* while `uu` will just assign the year as is:
*
* `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
*
* `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
*
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
* except local week-numbering years are dependent on `options.weekStartsOn`
* and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)
* and [setWeekYear](https://date-fns.org/docs/setWeekYear)).
*
* 5. These patterns are not in the Unicode Technical Standard #35:
* - `i`: ISO day of week
* - `I`: ISO week of year
* - `R`: ISO week-numbering year
* - `o`: ordinal number modifier
* - `P`: long localized date
* - `p`: long localized time
*
* 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
* on the given locale.
*
* using `en-US` locale: `P` => `MM/dd/yyyy`
* using `en-US` locale: `p` => `hh:mm a`
* using `pt-BR` locale: `P` => `dd/MM/yyyy`
* using `pt-BR` locale: `p` => `HH:mm`
*
* Values will be assigned to the date in the descending order of its unit's priority.
* Units of an equal priority overwrite each other in the order of appearance.
*
* If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
* the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.
*
* `referenceDate` must be passed for correct work of the function.
* If you're not sure which `referenceDate` to supply, create a new instance of Date:
* `parse('02/11/2014', 'MM/dd/yyyy', new Date())`
* In this case parsing will be done in the context of the current date.
* If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,
* then `Invalid Date` will be returned.
*
* The result may vary by locale.
*
* If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
*
* If parsing failed, `Invalid Date` will be returned.
* Invalid Date is a Date, whose time value is NaN.
* Time value of Date: http://es5.github.io/#x15.9.1.1
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param dateStr - The string to parse
* @param formatStr - The string of tokens
* @param referenceDate - defines values missing from the parsed dateString
* @param options - An object with options.
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* @returns The parsed date
*
* @throws `options.locale` must contain `match` property
* @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws format string contains an unescaped latin alphabet character
*
* @example
* // Parse 11 February 2014 from middle-endian format:
* var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
* //=> Tue Feb 11 2014 00:00:00
*
* @example
* // Parse 28th of February in Esperanto locale in the context of 2010 year:
* import eo from 'date-fns/locale/eo'
* var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
* locale: eo
* })
* //=> Sun Feb 28 2010 00:00:00
*/
function parse(dateStr, formatStr, referenceDate, options) {
const defaultOptions = (0, _index2.getDefaultOptions)();
const locale =
options?.locale ?? defaultOptions.locale ?? _index3.defaultLocale;
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
if (formatStr === "") {
if (dateStr === "") {
return (0, _index4.toDate)(referenceDate);
} else {
return (0, _index.constructFrom)(referenceDate, NaN);
}
}
const subFnOptions = {
firstWeekContainsDate,
weekStartsOn,
locale,
};
// If timezone isn't specified, it will be set to the system timezone
const setters = [new _Setter.DateToSystemTimezoneSetter()];
const tokens = formatStr
.match(longFormattingTokensRegExp)
.map((substring) => {
const firstCharacter = substring[0];
if (firstCharacter in _index5.longFormatters) {
const longFormatter = _index5.longFormatters[firstCharacter];
return longFormatter(substring, locale.formatLong);
}
return substring;
})
.join("")
.match(formattingTokensRegExp);
const usedTokens = [];
for (let token of tokens) {
if (
!options?.useAdditionalWeekYearTokens &&
(0, _index6.isProtectedWeekYearToken)(token)
) {
(0, _index6.warnOrThrowProtectedError)(token, formatStr, dateStr);
}
if (
!options?.useAdditionalDayOfYearTokens &&
(0, _index6.isProtectedDayOfYearToken)(token)
) {
(0, _index6.warnOrThrowProtectedError)(token, formatStr, dateStr);
}
const firstCharacter = token[0];
const parser = _index7.parsers[firstCharacter];
if (parser) {
const { incompatibleTokens } = parser;
if (Array.isArray(incompatibleTokens)) {
const incompatibleToken = usedTokens.find(
(usedToken) =>
incompatibleTokens.includes(usedToken.token) ||
usedToken.token === firstCharacter,
);
if (incompatibleToken) {
throw new RangeError(
`The format string mustn't contain \`${incompatibleToken.fullToken}\` and \`${token}\` at the same time`,
);
}
} else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) {
throw new RangeError(
`The format string mustn't contain \`${token}\` and any other token at the same time`,
);
}
usedTokens.push({ token: firstCharacter, fullToken: token });
const parseResult = parser.run(
dateStr,
token,
locale.match,
subFnOptions,
);
if (!parseResult) {
return (0, _index.constructFrom)(referenceDate, NaN);
}
setters.push(parseResult.setter);
dateStr = parseResult.rest;
} else {
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
throw new RangeError(
"Format string contains an unescaped latin alphabet character `" +
firstCharacter +
"`",
);
}
// Replace two single quote characters with one single quote character
if (token === "''") {
token = "'";
} else if (firstCharacter === "'") {
token = cleanEscapedString(token);
}
// Cut token from string, or, if string doesn't match the token, return Invalid Date
if (dateStr.indexOf(token) === 0) {
dateStr = dateStr.slice(token.length);
} else {
return (0, _index.constructFrom)(referenceDate, NaN);
}
}
}
// Check if the remaining input contains something other than whitespace
if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) {
return (0, _index.constructFrom)(referenceDate, NaN);
}
const uniquePrioritySetters = setters
.map((setter) => setter.priority)
.sort((a, b) => b - a)
.filter((priority, index, array) => array.indexOf(priority) === index)
.map((priority) =>
setters
.filter((setter) => setter.priority === priority)
.sort((a, b) => b.subPriority - a.subPriority),
)
.map((setterArray) => setterArray[0]);
let date = (0, _index4.toDate)(referenceDate);
if (isNaN(date.getTime())) {
return (0, _index.constructFrom)(referenceDate, NaN);
}
const flags = {};
for (const setter of uniquePrioritySetters) {
if (!setter.validate(date, subFnOptions)) {
return (0, _index.constructFrom)(referenceDate, NaN);
}
const result = setter.set(date, flags, subFnOptions);
// Result is tuple (date, flags)
if (Array.isArray(result)) {
date = result[0];
Object.assign(flags, result[1]);
// Result is date
} else {
date = result;
}
}
return (0, _index.constructFrom)(referenceDate, date);
}
function cleanEscapedString(input) {
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
}
@@ -0,0 +1,32 @@
# module-details-from-path
Resolve npm package details, like name and base path, given an absolute path to a file inside a package.
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)
## Installation
```
npm install module-details-from-path --save
```
## Usage
```js
const assert = require('assert')
const parse = require('module-details-from-path')
const path = '/Users/watson/code/node_modules/blackjack/node_modules/picture-tube/bin/tube.js'
assert.deepStrictEqual(parse(path), {
name: 'picture-tube',
basedir: '/Users/watson/code/node_modules/blackjack/node_modules/picture-tube',
path: 'bin/tube.js'
})
```
Returns `undefined` if module details cannot be found.
## License
MIT
@@ -0,0 +1,346 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports._getKey = _getKey;
exports._getPattern = _getPattern;
exports.get = get;
exports.getAllNextSiblings = getAllNextSiblings;
exports.getAllPrevSiblings = getAllPrevSiblings;
exports.getAssignmentIdentifiers = getAssignmentIdentifiers;
exports.getBindingIdentifierPaths = getBindingIdentifierPaths;
exports.getBindingIdentifiers = getBindingIdentifiers;
exports.getCompletionRecords = getCompletionRecords;
exports.getNextSibling = getNextSibling;
exports.getOpposite = getOpposite;
exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths;
exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers;
exports.getPrevSibling = getPrevSibling;
exports.getSibling = getSibling;
var _index = require("./index.js");
var _t = require("@babel/types");
const {
getAssignmentIdentifiers: _getAssignmentIdentifiers,
getBindingIdentifiers: _getBindingIdentifiers,
getOuterBindingIdentifiers: _getOuterBindingIdentifiers,
numericLiteral,
unaryExpression
} = _t;
const NORMAL_COMPLETION = 0;
const BREAK_COMPLETION = 1;
function NormalCompletion(path) {
return {
type: NORMAL_COMPLETION,
path
};
}
function BreakCompletion(path) {
return {
type: BREAK_COMPLETION,
path
};
}
function getOpposite() {
if (this.key === "left") {
return this.getSibling("right");
} else if (this.key === "right") {
return this.getSibling("left");
}
return null;
}
function addCompletionRecords(path, records, context) {
if (path) {
records.push(..._getCompletionRecords(path, context));
}
return records;
}
function completionRecordForSwitch(cases, records, context) {
let lastNormalCompletions = [];
for (let i = 0; i < cases.length; i++) {
const casePath = cases[i];
const caseCompletions = _getCompletionRecords(casePath, context);
const normalCompletions = [];
const breakCompletions = [];
for (const c of caseCompletions) {
if (c.type === NORMAL_COMPLETION) {
normalCompletions.push(c);
}
if (c.type === BREAK_COMPLETION) {
breakCompletions.push(c);
}
}
if (normalCompletions.length) {
lastNormalCompletions = normalCompletions;
}
records.push(...breakCompletions);
}
records.push(...lastNormalCompletions);
return records;
}
function normalCompletionToBreak(completions) {
completions.forEach(c => {
c.type = BREAK_COMPLETION;
});
}
function replaceBreakStatementInBreakCompletion(completions, reachable) {
completions.forEach(c => {
if (c.path.isBreakStatement({
label: null
})) {
if (reachable) {
c.path.replaceWith(unaryExpression("void", numericLiteral(0)));
} else {
c.path.remove();
}
}
});
}
function getStatementListCompletion(paths, context) {
const completions = [];
if (context.canHaveBreak) {
let lastNormalCompletions = [];
for (let i = 0; i < paths.length; i++) {
const path = paths[i];
const newContext = Object.assign({}, context, {
inCaseClause: false
});
if (path.isBlockStatement() && (context.inCaseClause || context.shouldPopulateBreak)) {
newContext.shouldPopulateBreak = true;
} else {
newContext.shouldPopulateBreak = false;
}
const statementCompletions = _getCompletionRecords(path, newContext);
if (statementCompletions.length > 0 && statementCompletions.every(c => c.type === BREAK_COMPLETION)) {
if (lastNormalCompletions.length > 0 && statementCompletions.every(c => c.path.isBreakStatement({
label: null
}))) {
normalCompletionToBreak(lastNormalCompletions);
completions.push(...lastNormalCompletions);
if (lastNormalCompletions.some(c => c.path.isDeclaration())) {
completions.push(...statementCompletions);
if (!context.shouldPreserveBreak) {
replaceBreakStatementInBreakCompletion(statementCompletions, true);
}
}
if (!context.shouldPreserveBreak) {
replaceBreakStatementInBreakCompletion(statementCompletions, false);
}
} else {
completions.push(...statementCompletions);
if (!context.shouldPopulateBreak && !context.shouldPreserveBreak) {
replaceBreakStatementInBreakCompletion(statementCompletions, true);
}
}
break;
}
if (i === paths.length - 1) {
completions.push(...statementCompletions);
} else {
lastNormalCompletions = [];
for (let i = 0; i < statementCompletions.length; i++) {
const c = statementCompletions[i];
if (c.type === BREAK_COMPLETION) {
completions.push(c);
}
if (c.type === NORMAL_COMPLETION) {
lastNormalCompletions.push(c);
}
}
}
}
} else if (paths.length) {
for (let i = paths.length - 1; i >= 0; i--) {
const pathCompletions = _getCompletionRecords(paths[i], context);
if (pathCompletions.length > 1 || pathCompletions.length === 1 && !pathCompletions[0].path.isVariableDeclaration() && !pathCompletions[0].path.isEmptyStatement()) {
completions.push(...pathCompletions);
break;
}
}
}
return completions;
}
function _getCompletionRecords(path, context) {
let records = [];
if (path.isIfStatement()) {
records = addCompletionRecords(path.get("consequent"), records, context);
records = addCompletionRecords(path.get("alternate"), records, context);
} else if (path.isDoExpression() || path.isFor() || path.isWhile() || path.isLabeledStatement()) {
return addCompletionRecords(path.get("body"), records, context);
} else if (path.isProgram() || path.isBlockStatement()) {
return getStatementListCompletion(path.get("body"), context);
} else if (path.isFunction()) {
return _getCompletionRecords(path.get("body"), context);
} else if (path.isTryStatement()) {
records = addCompletionRecords(path.get("block"), records, context);
records = addCompletionRecords(path.get("handler"), records, context);
} else if (path.isCatchClause()) {
return addCompletionRecords(path.get("body"), records, context);
} else if (path.isSwitchStatement()) {
return completionRecordForSwitch(path.get("cases"), records, context);
} else if (path.isSwitchCase()) {
return getStatementListCompletion(path.get("consequent"), {
canHaveBreak: true,
shouldPopulateBreak: false,
inCaseClause: true,
shouldPreserveBreak: context.shouldPreserveBreak
});
} else if (path.isBreakStatement()) {
records.push(BreakCompletion(path));
} else {
records.push(NormalCompletion(path));
}
return records;
}
function getCompletionRecords(shouldPreserveBreak = false) {
const records = _getCompletionRecords(this, {
canHaveBreak: false,
shouldPopulateBreak: false,
inCaseClause: false,
shouldPreserveBreak
});
return records.map(r => r.path);
}
function getSibling(key) {
return _index.default.get({
parentPath: this.parentPath,
parent: this.parent,
container: this.container,
listKey: this.listKey,
key: key
}).setContext(this.context);
}
function getPrevSibling() {
return this.getSibling(this.key - 1);
}
function getNextSibling() {
return this.getSibling(this.key + 1);
}
function getAllNextSiblings() {
let _key = this.key;
let sibling = this.getSibling(++_key);
const siblings = [];
while (sibling.node) {
siblings.push(sibling);
sibling = this.getSibling(++_key);
}
return siblings;
}
function getAllPrevSiblings() {
let _key = this.key;
let sibling = this.getSibling(--_key);
const siblings = [];
while (sibling.node) {
siblings.push(sibling);
sibling = this.getSibling(--_key);
}
return siblings;
}
function get(key, context = true) {
if (context === true) context = this.context;
const parts = key.split(".");
if (parts.length === 1) {
return _getKey.call(this, key, context);
} else {
return _getPattern.call(this, parts, context);
}
}
function _getKey(key, context) {
const node = this.node;
const container = node[key];
if (Array.isArray(container)) {
return container.map((_, i) => {
return _index.default.get({
listKey: key,
parentPath: this,
parent: node,
container: container,
key: i
}).setContext(context);
});
} else {
return _index.default.get({
parentPath: this,
parent: node,
container: node,
key: key
}).setContext(context);
}
}
function _getPattern(parts, context) {
let path = this;
for (const part of parts) {
if (part === ".") {
path = path.parentPath;
} else {
if (Array.isArray(path)) {
path = path[part];
} else {
path = path.get(part, context);
}
}
}
return path;
}
function getAssignmentIdentifiers() {
return _getAssignmentIdentifiers(this.node);
}
function getBindingIdentifiers(duplicates) {
return _getBindingIdentifiers(this.node, duplicates);
}
function getOuterBindingIdentifiers(duplicates) {
return _getOuterBindingIdentifiers(this.node, duplicates);
}
function getBindingIdentifierPaths(duplicates = false, outerOnly = false) {
const path = this;
const search = [path];
const ids = Object.create(null);
while (search.length) {
const id = search.shift();
if (!id) continue;
if (!id.node) continue;
const keys = _getBindingIdentifiers.keys[id.node.type];
if (id.isIdentifier()) {
if (duplicates) {
const _ids = ids[id.node.name] = ids[id.node.name] || [];
_ids.push(id);
} else {
ids[id.node.name] = id;
}
continue;
}
if (id.isExportDeclaration()) {
const declaration = id.get("declaration");
if (declaration.isDeclaration()) {
search.push(declaration);
}
continue;
}
if (outerOnly) {
if (id.isFunctionDeclaration()) {
search.push(id.get("id"));
continue;
}
if (id.isFunctionExpression()) {
continue;
}
}
if (keys) {
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const child = id.get(key);
if (Array.isArray(child)) {
search.push(...child);
} else if (child.node) {
search.push(child);
}
}
}
}
return ids;
}
function getOuterBindingIdentifierPaths(duplicates = false) {
return this.getBindingIdentifierPaths(duplicates, true);
}
//# sourceMappingURL=family.js.map
@@ -0,0 +1,42 @@
import { constructFrom } from "./constructFrom.js";
import { toDate } from "./toDate.js";
/**
* The {@link addDays} function options.
*/
/**
* @name addDays
* @category Day Helpers
* @summary Add the specified number of days to the given date.
*
* @description
* Add the specified number of days to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of days to be added.
* @param options - An object with options
*
* @returns The new date with the days added
*
* @example
* // Add 10 days to 1 September 2014:
* const result = addDays(new Date(2014, 8, 1), 10)
* //=> Thu Sep 11 2014 00:00:00
*/
export function addDays(date, amount, options) {
const _date = toDate(date, options?.in);
if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
// If 0 days, no-op to avoid changing times in the hour before end of DST
if (!amount) return _date;
_date.setDate(_date.getDate() + amount);
return _date;
}
// Fallback for modularized imports:
export default addDays;
@@ -0,0 +1 @@
{"version":3,"file":"rocking-chair.js","sources":["../../../src/icons/rocking-chair.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name RockingChair\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIzLjUgMiA2LjUgMTIuNSAxOCAxMi41IiAvPgogIDxsaW5lIHgxPSI5LjUiIHgyPSI1LjUiIHkxPSIxMi41IiB5Mj0iMjAiIC8+CiAgPGxpbmUgeDE9IjE1IiB4Mj0iMTguNSIgeTE9IjEyLjUiIHkyPSIyMCIgLz4KICA8cGF0aCBkPSJNMi43NSAxOGExMyAxMyAwIDAgMCAxOC41IDAiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/rocking-chair\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 RockingChair = createLucideIcon('RockingChair', [\n ['polyline', { points: '3.5 2 6.5 12.5 18 12.5', key: 'y3iy52' }],\n ['line', { x1: '9.5', x2: '5.5', y1: '12.5', y2: '20', key: '19vg5i' }],\n ['line', { x1: '15', x2: '18.5', y1: '12.5', y2: '20', key: '1inpmv' }],\n ['path', { d: 'M2.75 18a13 13 0 0 0 18.5 0', key: '1nquas' }],\n]);\n\nexport default RockingChair;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAA0B,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,CAChE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACtE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACtE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,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;AAC9D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { subISOWeekYears as fn } from "../subISOWeekYears.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const subISOWeekYears = convertToFP(fn, 2);
// Fallback for modularized imports:
export default subISOWeekYears;
@@ -0,0 +1,25 @@
@import '../../scss/styles';
@layer payload-default {
.icon--chevron {
height: var(--base);
width: var(--base);
.stroke {
fill: none;
stroke: currentColor;
stroke-width: $style-stroke-width-s;
vector-effect: non-scaling-stroke;
}
&.icon--size-large {
height: var(--base);
width: var(--base);
}
&.icon--size-small {
height: 12px;
width: 12px;
}
}
}
@@ -0,0 +1,4 @@
import type { DefaultTranslationsObject, Language } from '../types.js';
export declare const frTranslations: DefaultTranslationsObject;
export declare const fr: Language;
//# sourceMappingURL=fr.d.ts.map
@@ -0,0 +1,12 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/
import type {LexicalEditor} from 'lexical';
declare export function useLexicalEditable(): boolean;
@@ -0,0 +1,29 @@
/**
* This is a cross-entity way to count the number of versions for any given document.
* It will work for both collections and globals.
* @returns number of versions
*/ export const countVersions = async (args)=>{
const { collectionSlug, globalSlug, parentID, req } = args;
let countFn;
const where = {
parent: {
equals: parentID
}
};
if (collectionSlug) {
countFn = ()=>req.payload.countVersions({
collection: collectionSlug,
where
});
}
if (globalSlug) {
countFn = ()=>req.payload.countGlobalVersions({
global: globalSlug,
where
});
}
const res = countFn ? await countFn()?.then((res)=>res.totalDocs || 0) || 0 : 0;
return res;
};
//# sourceMappingURL=countVersions.js.map
@@ -0,0 +1,37 @@
# is-reference changelog
## 1.2.1
* Relax version range for `@types/estree`
## 1.2.0
* Handle class fields ([#](https://github.com/Rich-Harris/is-reference/pull/8))
## 1.1.4
* Disregarded imported specifiers if they differ from local specifiers
## 1.1.3
* Handle expressions without a Program
## 1.1.2
* Ignore labels in break/continue statements ([#4](https://github.com/Rich-Harris/is-reference/pull/4))
## 1.1.1
* Prevent false positives with labeled statements
## 1.1.0
* Rewrite in TypeScript, add declarations
## 1.0.1
* Ensure `isReference` returns a boolean
## 1.0.0
* First release
@@ -0,0 +1,38 @@
import { Tracer } from '@opentelemetry/api';
import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';
import { DynamicSamplingContext, Scope, TraceContext } from '@sentry/core';
import { ServerRuntimeClient } from '@sentry/core';
import { AsyncLocalStorageLookup } from '@sentry/opentelemetry';
import { NodeClientOptions } from '../types';
/** A client for using Sentry with Node & OpenTelemetry. */
export declare class NodeClient extends ServerRuntimeClient<NodeClientOptions> {
traceProvider: BasicTracerProvider | undefined;
asyncLocalStorageLookup: AsyncLocalStorageLookup | undefined;
private _tracer;
private _clientReportInterval;
private _clientReportOnExitFlushListener;
private _logOnExitFlushListener;
constructor(options: NodeClientOptions);
/*Get the OTEL tracer. */
readonly tracer: Tracer;
/** @inheritDoc */
flush(timeout?: number): PromiseLike<boolean>;
/** @inheritDoc */
close(timeout?: number | undefined): PromiseLike<boolean>;
/**
* Will start tracking client reports for this client.
*
* NOTICE: This method will create an interval that is periodically called and attach a `process.on('beforeExit')`
* hook. To clean up these resources, call `.close()` when you no longer intend to use the client. Not doing so will
* result in a memory leak.
*/
startClientReportTracking(): void;
/** @inheritDoc */
protected _setupIntegrations(): void;
/** Custom implementation for OTEL, so we can handle scope-span linking. */
protected _getTraceInfoFromScope(scope: Scope | undefined): [
/*dynamicSamplingContext*/ Partial<DynamicSamplingContext> | undefined,
/*traceContext*/ TraceContext | undefined
];
}
//# sourceMappingURL=client.d.ts.map

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