fix(products): fix breadcrumbs and product filtering (backport from main)
Some checks failed
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

View File

@@ -0,0 +1,57 @@
{
"name": "@react-email/html",
"version": "0.0.11",
"description": "A React html component to wrap emails",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/resend/react-email.git",
"directory": "packages/html"
},
"keywords": [
"react",
"email"
],
"engines": {
"node": ">=18.0.0"
},
"peerDependencies": {
"react": "^18.0 || ^19.0 || ^19.0.0-rc"
},
"devDependencies": {
"typescript": "5.1.6",
"@react-email/render": "1.0.3",
"tsconfig": "0.0.0",
"eslint-config-custom": "0.0.0"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsup src/index.ts --format esm,cjs --dts --external react",
"clean": "rm -rf dist",
"dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch",
"lint": "eslint .",
"test:watch": "vitest",
"test": "vitest run"
}
}

View File

@@ -0,0 +1,43 @@
@import '../../../scss/styles.scss';
@layer payload-default {
.live-preview-toolbar {
display: flex;
background-color: var(--theme-bg);
color: var(--theme-text);
height: calc(var(--base) * 1.75);
align-items: center;
flex-shrink: 0;
&--static {
position: relative;
width: 100%;
justify-content: center;
border-bottom: 1px solid var(--theme-elevation-100);
}
&--draggable {
@include shadow-lg;
position: absolute;
top: 0;
left: 0;
margin: 0;
border-radius: 4px;
}
&__drag-handle {
background: transparent;
border: 0;
padding: 0;
cursor: grab;
.icon--drag-handle .fill {
fill: var(--theme-elevation-300);
}
&:active {
cursor: grabbing;
}
}
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"metadata.js","names":["generateMetadata","generateUnauthorizedViewMetadata","config","i18n","t","description","keywords","serverURL","title","admin","meta"],"sources":["../../../src/views/Unauthorized/metadata.ts"],"sourcesContent":["import type { GenerateViewMetadata } from '../Root/index.js'\n\nimport { generateMetadata } from '../../utilities/meta.js'\n\nexport const generateUnauthorizedViewMetadata: GenerateViewMetadata = async ({\n config,\n i18n: { t },\n}) =>\n generateMetadata({\n description: t('error:unauthorized'),\n keywords: t('error:unauthorized'),\n serverURL: config.serverURL,\n title: t('error:unauthorized'),\n ...(config.admin.meta || {}),\n })\n"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ;AAEjC,OAAO,MAAMC,gCAAA,GAAyD,MAAAA,CAAO;EAC3EC,MAAM;EACNC,IAAA,EAAM;IAAEC;EAAC;AAAE,CACZ,KACCJ,gBAAA,CAAiB;EACfK,WAAA,EAAaD,CAAA,CAAE;EACfE,QAAA,EAAUF,CAAA,CAAE;EACZG,SAAA,EAAWL,MAAA,CAAOK,SAAS;EAC3BC,KAAA,EAAOJ,CAAA,CAAE;EACT,IAAIF,MAAA,CAAOO,KAAK,CAACC,IAAI,IAAI,CAAC,CAAC;AAC7B","ignoreList":[]}

View File

@@ -0,0 +1,4 @@
import { ContextType } from 'react';
import { PublicContext } from '../store';
export declare function useDndContext(): import("../store").PublicContextDescriptor;
export declare type UseDndContextReturnValue = ContextType<typeof PublicContext>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"navigation-off.js","sources":["../../../src/icons/navigation-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name NavigationOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOC40MyA4LjQzIDMgMTFsOCAyIDIgOCAyLjU3LTUuNDMiIC8+CiAgPHBhdGggZD0iTTE3LjM5IDExLjczIDIyIDJsLTkuNzMgNC42MSIgLz4KICA8bGluZSB4MT0iMiIgeDI9IjIyIiB5MT0iMiIgeTI9IjIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/navigation-off\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 NavigationOff = createLucideIcon('NavigationOff', [\n ['path', { d: 'M8.43 8.43 3 11l8 2 2 8 2.57-5.43', key: '1vdtb7' }],\n ['path', { d: 'M17.39 11.73 22 2l-9.73 4.61', key: 'tya3r6' }],\n ['line', { x1: '2', x2: '22', y1: '2', y2: '22', key: 'a6p6uj' }],\n]);\n\nexport default NavigationOff;\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,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqC,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,CAClE,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,CAC7D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,61 @@
'use strict'
import createDebug from 'debug';
import { readFile } from 'node:fs/promises'
import { create } from '@apm-js-collab/code-transformer'
import parse from 'module-details-from-path'
import { fileURLToPath } from 'node:url'
import getPackageVersion from './lib/get-package-version.js'
const debug = createDebug('@apm-js-collab/tracing-hooks:esm-hook')
let transformers = null
let packages = null
let instrumentator = null
export async function initialize(data = {}) {
const instrumentations = data?.instrumentations || []
instrumentator = create(instrumentations)
packages = new Set(instrumentations.map(i => i.module.name))
transformers = new Map()
}
export async function resolve(specifier, context, nextResolve) {
const url = await nextResolve(specifier, context)
const resolvedModule = parse(url.url)
if (resolvedModule && packages.has(resolvedModule.name)) {
const path = fileURLToPath(resolvedModule.basedir)
const version = getPackageVersion(path)
const transformer = instrumentator.getTransformer(resolvedModule.name, version, resolvedModule.path)
if (transformer) {
transformers.set(url.url, transformer)
}
}
return url
}
export async function load(url, context, nextLoad) {
const result = await nextLoad(url, context)
if (transformers.has(url) === false) {
return result
}
if (result.format === 'commonjs') {
const parsedUrl = new URL(result.responseURL ?? url)
result.source ??= await readFile(parsedUrl)
}
const code = result.source
if (code) {
const transformer = transformers.get(url)
try {
const transformedCode = transformer.transform(code.toString('utf8'), 'unknown')
result.source = transformedCode?.code
result.shortCircuit = true
} catch(err) {
debug('Error transforming module %s: %o', url, err)
} finally {
transformer.free()
}
}
return result
}

View File

@@ -0,0 +1,243 @@
import { status as httpStatus } from 'http-status';
import { executeAccess } from '../../auth/executeAccess.js';
import { combineQueries } from '../../database/combineQueries.js';
import { validateQueryPaths } from '../../database/queryValidation/validateQueryPaths.js';
import { sanitizeWhereQuery } from '../../database/sanitizeWhereQuery.js';
import { APIError } from '../../errors/index.js';
import { deepCopyObjectSimple } from '../../index.js';
import { generateFileData } from '../../uploads/generateFileData.js';
import { unlinkTempFiles } from '../../uploads/unlinkTempFiles.js';
import { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js';
import { commitTransaction } from '../../utilities/commitTransaction.js';
import { hasDraftsEnabled } from '../../utilities/getVersionsConfig.js';
import { initTransaction } from '../../utilities/initTransaction.js';
import { isErrorPublic } from '../../utilities/isErrorPublic.js';
import { killTransaction } from '../../utilities/killTransaction.js';
import { sanitizeSelect } from '../../utilities/sanitizeSelect.js';
import { buildVersionCollectionFields } from '../../versions/buildCollectionFields.js';
import { appendVersionToQueryKey } from '../../versions/drafts/appendVersionToQueryKey.js';
import { getQueryDraftsSort } from '../../versions/drafts/getQueryDraftsSort.js';
import { buildAfterOperation } from './utilities/buildAfterOperation.js';
import { buildBeforeOperation } from './utilities/buildBeforeOperation.js';
import { sanitizeSortQuery } from './utilities/sanitizeSortQuery.js';
import { updateDocument } from './utilities/update.js';
export const updateOperation = async (incomingArgs)=>{
let args = incomingArgs;
if (args.collection.config.disableBulkEdit && !args.overrideAccess) {
throw new APIError(`Collection ${args.collection.config.slug} has disabled bulk edit`, 403);
}
try {
const shouldCommit = !args.disableTransaction && await initTransaction(args.req);
// /////////////////////////////////////
// beforeOperation - Collection
// /////////////////////////////////////
args = await buildBeforeOperation({
args,
collection: args.collection.config,
operation: 'update',
overrideAccess: args.overrideAccess
});
const { autosave = false, collection: { config: collectionConfig }, collection, depth, draft: draftArg = false, limit = 0, overrideAccess, overrideLock, overwriteExistingFiles = false, populate, publishAllLocales, publishSpecificLocale, req: { fallbackLocale, locale, payload: { config }, payload }, req, select: incomingSelect, showHiddenFields, sort: incomingSort, trash = false, unpublishAllLocales, where } = args;
if (!where) {
throw new APIError("Missing 'where' query of documents to update.", httpStatus.BAD_REQUEST);
}
const { data: bulkUpdateData } = args;
const shouldSaveDraft = Boolean(draftArg && hasDraftsEnabled(collectionConfig));
// /////////////////////////////////////
// Access
// /////////////////////////////////////
let accessResult;
if (!overrideAccess) {
accessResult = await executeAccess({
req
}, collectionConfig.access.update);
}
await validateQueryPaths({
collectionConfig,
overrideAccess: overrideAccess,
req,
where
});
// /////////////////////////////////////
// Retrieve documents
// /////////////////////////////////////
let fullWhere = combineQueries(where, accessResult);
const isTrashAttempt = collectionConfig.trash && typeof bulkUpdateData === 'object' && bulkUpdateData !== null && 'deletedAt' in bulkUpdateData && bulkUpdateData.deletedAt != null;
// Enforce delete access if performing a soft-delete (trash)
if (isTrashAttempt && !overrideAccess) {
const deleteAccessResult = await executeAccess({
req
}, collectionConfig.access.delete);
fullWhere = combineQueries(fullWhere, deleteAccessResult);
}
// Exclude trashed documents when trash: false
fullWhere = appendNonTrashedFilter({
enableTrash: collectionConfig.trash,
trash,
where: fullWhere
});
sanitizeWhereQuery({
fields: collectionConfig.flattenedFields,
payload,
where: fullWhere
});
const sort = sanitizeSortQuery({
fields: collection.config.flattenedFields,
sort: incomingSort
});
let docs;
if (hasDraftsEnabled(collectionConfig) && shouldSaveDraft) {
const versionsWhere = appendVersionToQueryKey(fullWhere);
await validateQueryPaths({
collectionConfig: collection.config,
overrideAccess: overrideAccess,
req,
versionFields: buildVersionCollectionFields(payload.config, collection.config, true),
where: appendVersionToQueryKey(where)
});
const query = await payload.db.queryDrafts({
collection: collectionConfig.slug,
limit,
locale: locale,
pagination: false,
req,
sort: getQueryDraftsSort({
collectionConfig,
sort
}),
where: versionsWhere
});
docs = query.docs;
} else {
const query = await payload.db.find({
collection: collectionConfig.slug,
limit,
locale: locale,
pagination: false,
req,
sort,
where: fullWhere
});
docs = query.docs;
}
// /////////////////////////////////////
// Generate data for all files and sizes
// /////////////////////////////////////
const { data, files: filesToUpload } = await generateFileData({
collection,
config,
data: bulkUpdateData,
operation: 'update',
overwriteExistingFiles,
req,
throwOnMissingFile: false
});
const errors = [];
const promises = docs.map(async (docWithLocales)=>{
const { id } = docWithLocales;
try {
// Each document gets its own transaction when singleTransaction is enabled
let docShouldCommit = false;
if (req.payload.db.bulkOperationsSingleTransaction) {
docShouldCommit = await initTransaction(req);
}
const select = sanitizeSelect({
fields: collectionConfig.flattenedFields,
forceSelect: collectionConfig.forceSelect,
select: incomingSelect
});
// ///////////////////////////////////////////////
// Update document, runs all document level hooks
// ///////////////////////////////////////////////
let updatedDoc = await updateDocument({
id,
autosave,
collectionConfig,
config,
data: deepCopyObjectSimple(data),
depth: depth,
docWithLocales,
draftArg,
fallbackLocale: fallbackLocale,
filesToUpload,
locale: locale,
overrideAccess: overrideAccess,
overrideLock: overrideLock,
payload,
populate,
publishAllLocales,
publishSpecificLocale,
req,
select: select,
showHiddenFields: showHiddenFields,
unpublishAllLocales
});
// /////////////////////////////////////
// Add collection property for auth collections
// /////////////////////////////////////
if (collectionConfig.auth) {
updatedDoc = {
...updatedDoc,
collection: collectionConfig.slug
};
}
if (docShouldCommit) {
await commitTransaction(req);
}
return updatedDoc;
} catch (error) {
const isPublic = error instanceof Error ? isErrorPublic(error, config) : false;
if (req.payload.db.bulkOperationsSingleTransaction) {
await killTransaction(req);
}
errors.push({
id,
isPublic,
message: error instanceof Error ? error.message : 'Unknown error'
});
}
return null;
});
await unlinkTempFiles({
collectionConfig,
config,
req
});
// Process sequentially when using single transaction mode to avoid shared state issues
// Process in parallel when using one transaction for better performance
let awaitedDocs;
if (req.payload.db.bulkOperationsSingleTransaction) {
awaitedDocs = [];
for (const promise of promises){
awaitedDocs.push(await promise);
}
} else {
awaitedDocs = await Promise.all(promises);
}
let result = {
docs: awaitedDocs.filter(Boolean),
errors
};
// /////////////////////////////////////
// afterOperation - Collection
// /////////////////////////////////////
result = await buildAfterOperation({
args,
collection: collectionConfig,
operation: 'update',
overrideAccess,
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
result
});
if (shouldCommit) {
await commitTransaction(req);
}
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
return result;
} catch (error) {
await killTransaction(args.req);
throw error;
}
};
//# sourceMappingURL=update.js.map

View File

@@ -0,0 +1,39 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.isReference = factory());
}(this, (function () { 'use strict';
function isReference(node, parent) {
if (node.type === 'MemberExpression') {
return !node.computed && isReference(node.object, node);
}
if (node.type === 'Identifier') {
if (!parent)
return true;
switch (parent.type) {
// disregard `bar` in `foo.bar`
case 'MemberExpression': return parent.computed || node === parent.object;
// disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`
case 'MethodDefinition': return parent.computed;
// disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`
case 'FieldDefinition': return parent.computed || node === parent.value;
// disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
case 'Property': return parent.computed || node === parent.value;
// disregard the `bar` in `export { foo as bar }` or
// the foo in `import { foo as bar }`
case 'ExportSpecifier':
case 'ImportSpecifier': return node === parent.local;
// disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`
case 'LabeledStatement':
case 'BreakStatement':
case 'ContinueStatement': return false;
default: return true;
}
}
return false;
}
return isReference;
})));

View File

@@ -0,0 +1,27 @@
import { nextDay } from "./nextDay.mjs";
/**
* @name nextTuesday
* @category Weekday Helpers
* @summary When is the next Tuesday?
*
* @description
* When is the next Tuesday?
*
* @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 date - The date to start counting from
*
* @returns The next Tuesday
*
* @example
* // When is the next Tuesday after Mar, 22, 2020?
* const result = nextTuesday(new Date(2020, 2, 22))
* //=> Tue Mar 24 2020 00:00:00
*/
export function nextTuesday(date) {
return nextDay(date, 2);
}
// Fallback for modularized imports:
export default nextTuesday;

View File

@@ -0,0 +1 @@
{"version":3,"names":["_AwaitValue","value","wrapped"],"sources":["../../src/helpers/AwaitValue.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n/* @onlyBabel7 */\n\nexport default function _AwaitValue(value) {\n this.wrapped = value;\n}\n"],"mappings":";;;;;;AAGe,SAASA,WAAWA,CAACC,KAAK,EAAE;EACzC,IAAI,CAACC,OAAO,GAAGD,KAAK;AACtB","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"browsersession.d.ts","sourceRoot":"","sources":["../../../../src/integrations/browsersession.ts"],"names":[],"mappings":"AAKA,UAAU,qBAAqB;IAC7B;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC9B;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,qFA+BpC,CAAC"}

View File

@@ -0,0 +1,267 @@
'use strict'
const { isUUID } = require('./utils')
const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu
const supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',
'wss', 'urn', 'urn:uuid'])
/** @typedef {supportedSchemeNames[number]} SchemeName */
/**
* @param {string} name
* @returns {name is SchemeName}
*/
function isValidSchemeName (name) {
return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1
}
/**
* @callback SchemeFn
* @param {import('../types/index').URIComponent} component
* @param {import('../types/index').Options} options
* @returns {import('../types/index').URIComponent}
*/
/**
* @typedef {Object} SchemeHandler
* @property {SchemeName} scheme - The scheme name.
* @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.
* @property {SchemeFn} parse - Function to parse the URI component for this scheme.
* @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.
* @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.
* @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.
* @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.
*/
/**
* @param {import('../types/index').URIComponent} wsComponent
* @returns {boolean}
*/
function wsIsSecure (wsComponent) {
if (wsComponent.secure === true) {
return true
} else if (wsComponent.secure === false) {
return false
} else if (wsComponent.scheme) {
return (
wsComponent.scheme.length === 3 &&
(wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&
(wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&
(wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')
)
} else {
return false
}
}
/** @type {SchemeFn} */
function httpParse (component) {
if (!component.host) {
component.error = component.error || 'HTTP URIs must have a host.'
}
return component
}
/** @type {SchemeFn} */
function httpSerialize (component) {
const secure = String(component.scheme).toLowerCase() === 'https'
// normalize the default port
if (component.port === (secure ? 443 : 80) || component.port === '') {
component.port = undefined
}
// normalize the empty path
if (!component.path) {
component.path = '/'
}
// NOTE: We do not parse query strings for HTTP URIs
// as WWW Form Url Encoded query strings are part of the HTML4+ spec,
// and not the HTTP spec.
return component
}
/** @type {SchemeFn} */
function wsParse (wsComponent) {
// indicate if the secure flag is set
wsComponent.secure = wsIsSecure(wsComponent)
// construct resouce name
wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')
wsComponent.path = undefined
wsComponent.query = undefined
return wsComponent
}
/** @type {SchemeFn} */
function wsSerialize (wsComponent) {
// normalize the default port
if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {
wsComponent.port = undefined
}
// ensure scheme matches secure flag
if (typeof wsComponent.secure === 'boolean') {
wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')
wsComponent.secure = undefined
}
// reconstruct path from resource name
if (wsComponent.resourceName) {
const [path, query] = wsComponent.resourceName.split('?')
wsComponent.path = (path && path !== '/' ? path : undefined)
wsComponent.query = query
wsComponent.resourceName = undefined
}
// forbid fragment component
wsComponent.fragment = undefined
return wsComponent
}
/** @type {SchemeFn} */
function urnParse (urnComponent, options) {
if (!urnComponent.path) {
urnComponent.error = 'URN can not be parsed'
return urnComponent
}
const matches = urnComponent.path.match(URN_REG)
if (matches) {
const scheme = options.scheme || urnComponent.scheme || 'urn'
urnComponent.nid = matches[1].toLowerCase()
urnComponent.nss = matches[2]
const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`
const schemeHandler = getSchemeHandler(urnScheme)
urnComponent.path = undefined
if (schemeHandler) {
urnComponent = schemeHandler.parse(urnComponent, options)
}
} else {
urnComponent.error = urnComponent.error || 'URN can not be parsed.'
}
return urnComponent
}
/** @type {SchemeFn} */
function urnSerialize (urnComponent, options) {
if (urnComponent.nid === undefined) {
throw new Error('URN without nid cannot be serialized')
}
const scheme = options.scheme || urnComponent.scheme || 'urn'
const nid = urnComponent.nid.toLowerCase()
const urnScheme = `${scheme}:${options.nid || nid}`
const schemeHandler = getSchemeHandler(urnScheme)
if (schemeHandler) {
urnComponent = schemeHandler.serialize(urnComponent, options)
}
const uriComponent = urnComponent
const nss = urnComponent.nss
uriComponent.path = `${nid || options.nid}:${nss}`
options.skipEscape = true
return uriComponent
}
/** @type {SchemeFn} */
function urnuuidParse (urnComponent, options) {
const uuidComponent = urnComponent
uuidComponent.uuid = uuidComponent.nss
uuidComponent.nss = undefined
if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {
uuidComponent.error = uuidComponent.error || 'UUID is not valid.'
}
return uuidComponent
}
/** @type {SchemeFn} */
function urnuuidSerialize (uuidComponent) {
const urnComponent = uuidComponent
// normalize UUID
urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()
return urnComponent
}
const http = /** @type {SchemeHandler} */ ({
scheme: 'http',
domainHost: true,
parse: httpParse,
serialize: httpSerialize
})
const https = /** @type {SchemeHandler} */ ({
scheme: 'https',
domainHost: http.domainHost,
parse: httpParse,
serialize: httpSerialize
})
const ws = /** @type {SchemeHandler} */ ({
scheme: 'ws',
domainHost: true,
parse: wsParse,
serialize: wsSerialize
})
const wss = /** @type {SchemeHandler} */ ({
scheme: 'wss',
domainHost: ws.domainHost,
parse: ws.parse,
serialize: ws.serialize
})
const urn = /** @type {SchemeHandler} */ ({
scheme: 'urn',
parse: urnParse,
serialize: urnSerialize,
skipNormalize: true
})
const urnuuid = /** @type {SchemeHandler} */ ({
scheme: 'urn:uuid',
parse: urnuuidParse,
serialize: urnuuidSerialize,
skipNormalize: true
})
const SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({
http,
https,
ws,
wss,
urn,
'urn:uuid': urnuuid
})
Object.setPrototypeOf(SCHEMES, null)
/**
* @param {string|undefined} scheme
* @returns {SchemeHandler|undefined}
*/
function getSchemeHandler (scheme) {
return (
scheme && (
SCHEMES[/** @type {SchemeName} */ (scheme)] ||
SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])
) ||
undefined
}
module.exports = {
wsIsSecure,
SCHEMES,
isValidSchemeName,
getSchemeHandler,
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/types-hoist/feedback/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF;;OAEG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAEpC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,WAAW,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAEzC;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC;IAE1B;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,2BAA2B,EAAE,MAAM,CAAC;IAEpC;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAEzB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpE;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEvC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B"}

View File

@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FileKey2 = createLucideIcon("FileKey2", [
["path", { d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v6", key: "rc0qvx" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["circle", { cx: "4", cy: "16", r: "2", key: "1ehqvc" }],
["path", { d: "m10 10-4.5 4.5", key: "7fwrp6" }],
["path", { d: "m9 11 1 1", key: "wa6s5q" }]
]);
export { FileKey2 as default };
//# sourceMappingURL=file-key-2.js.map

View File

@@ -0,0 +1,2 @@
import { functionsIn } from "../fp";
export = functionsIn;

View File

@@ -0,0 +1,60 @@
"use strict";
exports.parseJSON = parseJSON;
var _index = require("./toDate.cjs");
/**
* The {@link parseJSON} function options.
*/
/**
* Converts a complete ISO date string in UTC time, the typical format for transmitting
* a date in JSON, to a JavaScript `Date` instance.
*
* This is a minimal implementation for converting dates retrieved from a JSON API to
* a `Date` instance which can be used with other functions in the `date-fns` library.
* The following formats are supported:
*
* - `2000-03-15T05:20:10.123Z`: The output of `.toISOString()` and `JSON.stringify(new Date())`
* - `2000-03-15T05:20:10Z`: Without milliseconds
* - `2000-03-15T05:20:10+00:00`: With a zero offset, the default JSON encoded format in some other languages
* - `2000-03-15T05:20:10+05:45`: With a positive or negative offset, the default JSON encoded format in some other languages
* - `2000-03-15T05:20:10+0000`: With a zero offset without a colon
* - `2000-03-15T05:20:10`: Without a trailing 'Z' symbol
* - `2000-03-15T05:20:10.1234567`: Up to 7 digits in milliseconds field. Only first 3 are taken into account since JS does not allow fractional milliseconds
* - `2000-03-15 05:20:10`: With a space instead of a 'T' separator for APIs returning a SQL date without reformatting
*
* For convenience and ease of use these other input types are also supported
* via [toDate](https://date-fns.org/docs/toDate):
*
* - A `Date` instance will be cloned
* - A `number` will be treated as a timestamp
*
* Any other input type or invalid date strings will return an `Invalid Date`.
*
* @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 dateStr - A fully formed ISO8601 date string to convert
* @param options - An object with options
*
* @returns The parsed date in the local time zone
*/
function parseJSON(dateStr, options) {
const parts = dateStr.match(
/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/,
);
if (!parts) return (0, _index.toDate)(NaN, options?.in);
return (0, _index.toDate)(
Date.UTC(
+parts[1],
+parts[2] - 1,
+parts[3],
+parts[4] - (+parts[9] || 0) * (parts[8] == "-" ? -1 : 1),
+parts[5] - (+parts[10] || 0) * (parts[8] == "-" ? -1 : 1),
+parts[6],
+((parts[7] || "0") + "00").substring(0, 3),
),
options?.in,
);
}

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('mergeAll', require('../merge'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1,9 @@
/**
* @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.
*/
export { default } from './arrow-up-a-z.js';
//# sourceMappingURL=arrow-up-az.js.map

View File

@@ -0,0 +1,295 @@
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import { getTranslation } from '@payloadcms/translations';
import { formatAdminURL, transformColumnsToPreferences, transformColumnsToSearchParams } from 'payload/shared';
import React, { Fragment, useCallback, useMemo } from 'react';
import { toast } from 'sonner';
import { PlusIcon } from '../../../icons/Plus/index.js';
import { useConfig } from '../../../providers/Config/index.js';
import { useListQuery } from '../../../providers/ListQuery/context.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import { ConfirmationModal } from '../../ConfirmationModal/index.js';
import { useDocumentDrawer } from '../../DocumentDrawer/index.js';
import { useListDrawer } from '../../ListDrawer/index.js';
import { ListSelectionButton } from '../../ListSelection/index.js';
import { Pill } from '../../Pill/index.js';
import { Translation } from '../../Translation/index.js';
import { QueryPresetToggler } from '../QueryPresetToggler/index.js';
import './index.scss';
const confirmDeletePresetModalSlug = 'confirm-delete-preset';
const queryPresetsSlug = 'payload-query-presets';
const baseClass = 'query-preset-bar';
export const QueryPresetBar = ({
activePreset,
collectionSlug,
queryPresetPermissions
}) => {
const {
modified,
query,
refineListData,
setModified: setQueryModified
} = useListQuery();
const {
i18n,
t
} = useTranslation();
const {
openModal
} = useModal();
const {
config: {
routes: {
api: apiRoute
}
},
getEntityConfig
} = useConfig();
const presetConfig = getEntityConfig({
collectionSlug: queryPresetsSlug
});
const [PresetDocumentDrawer,, {
openDrawer: openDocumentDrawer
}] = useDocumentDrawer({
id: activePreset?.id,
collectionSlug: queryPresetsSlug
});
const [CreateNewPresetDrawer,, {
closeDrawer: closeCreateNewDrawer,
openDrawer: openCreateNewDrawer
}] = useDocumentDrawer({
collectionSlug: queryPresetsSlug
});
const filterOptions = useMemo(() => ({
'payload-query-presets': {
isTemp: {
not_equals: true
},
relatedCollection: {
equals: collectionSlug
}
}
}), [collectionSlug]);
const [ListDrawer,, {
closeDrawer: closeListDrawer,
openDrawer: openListDrawer
}] = useListDrawer({
collectionSlugs: [queryPresetsSlug],
filterOptions,
selectedCollection: queryPresetsSlug
});
const handlePresetChange = useCallback(async preset => {
await refineListData({
columns: preset.columns ? transformColumnsToSearchParams(preset.columns) : undefined,
groupBy: preset.groupBy || '',
preset: preset.id,
where: preset.where
}, false);
}, [refineListData]);
const resetQueryPreset = useCallback(async () => {
await refineListData({
columns: [],
groupBy: '',
preset: '',
where: {}
}, false);
}, [refineListData]);
const handleDeletePreset = useCallback(async () => {
try {
await fetch(formatAdminURL({
apiRoute,
path: `/${queryPresetsSlug}/${activePreset.id}`
}), {
method: 'DELETE'
}).then(async res => {
try {
const json = await res.json();
if (res.status < 400) {
toast.success(t('general:titleDeleted', {
label: getTranslation(presetConfig?.labels?.singular, i18n),
title: activePreset.title
}));
await resetQueryPreset();
} else {
if (json.errors) {
json.errors.forEach(error => toast.error(error.message));
} else {
toast.error(t('error:deletingTitle', {
title: activePreset.title
}));
}
}
} catch (_err) {
toast.error(t('error:deletingTitle', {
title: activePreset.title
}));
}
});
} catch (_err) {
toast.error(t('error:deletingTitle', {
title: activePreset.title
}));
}
}, [apiRoute, activePreset?.id, activePreset?.title, t, presetConfig, i18n, resetQueryPreset]);
const saveCurrentChanges = useCallback(async () => {
try {
await fetch(formatAdminURL({
apiRoute,
path: `/${queryPresetsSlug}/${activePreset.id}`
}), {
body: JSON.stringify({
columns: transformColumnsToPreferences(query.columns),
groupBy: query.groupBy,
where: query.where
}),
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
method: 'PATCH'
}).then(async res => {
try {
const json = await res.json();
if (res.status < 400) {
toast.success(t('general:updatedLabelSuccessfully', {
label: getTranslation(presetConfig?.labels?.singular, i18n)
}));
setQueryModified(false);
} else {
if (json.errors) {
json.errors.forEach(error => toast.error(error.message));
} else {
toast.error(t('error:unknown'));
}
}
} catch (_err) {
toast.error(t('error:unknown'));
}
});
} catch (_err) {
toast.error(t('error:unknown'));
}
}, [apiRoute, activePreset?.id, query.columns, query.groupBy, query.where, t, presetConfig?.labels?.singular, i18n, setQueryModified]);
const hasModifiedPreset = activePreset && modified;
return /*#__PURE__*/_jsxs(Fragment, {
children: [/*#__PURE__*/_jsxs("div", {
className: baseClass,
children: [/*#__PURE__*/_jsxs("div", {
className: `${baseClass}__menu`,
children: [/*#__PURE__*/_jsx(QueryPresetToggler, {
activePreset: activePreset,
openPresetListDrawer: openListDrawer,
resetPreset: resetQueryPreset
}), /*#__PURE__*/_jsx(Pill, {
"aria-label": t('general:newLabel', {
label: presetConfig?.labels?.singular
}),
className: `${baseClass}__create-new-preset`,
icon: /*#__PURE__*/_jsx(PlusIcon, {}),
id: "create-new-preset",
onClick: () => {
openCreateNewDrawer();
},
size: "small"
})]
}), /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__menu-items`,
children: [hasModifiedPreset && /*#__PURE__*/_jsx(ListSelectionButton, {
id: "reset-preset",
onClick: async () => {
await refineListData({
columns: transformColumnsToSearchParams(activePreset.columns),
groupBy: activePreset.groupBy || '',
where: activePreset.where
}, false);
},
type: "button",
children: t('general:reset')
}, "reset"), hasModifiedPreset && queryPresetPermissions.update && /*#__PURE__*/_jsx(ListSelectionButton, {
id: "save-preset",
onClick: async () => {
await saveCurrentChanges();
},
type: "button",
children: activePreset?.isShared ? t('general:updateForEveryone') : t('fields:saveChanges')
}, "save"), activePreset && queryPresetPermissions?.delete && /*#__PURE__*/_jsxs(Fragment, {
children: [/*#__PURE__*/_jsx(ListSelectionButton, {
id: "delete-preset",
onClick: () => openModal(confirmDeletePresetModalSlug),
type: "button",
children: t('general:deleteLabel', {
label: presetConfig?.labels?.singular
})
}), /*#__PURE__*/_jsx(ListSelectionButton, {
id: "edit-preset",
onClick: () => {
openDocumentDrawer();
},
type: "button",
children: t('general:editLabel', {
label: presetConfig?.labels?.singular
})
})]
})]
})]
}), /*#__PURE__*/_jsx(CreateNewPresetDrawer, {
initialData: {
columns: transformColumnsToPreferences(query.columns),
groupBy: query.groupBy,
relatedCollection: collectionSlug,
where: query.where
},
onSave: async ({
doc
}) => {
closeCreateNewDrawer();
await handlePresetChange(doc);
},
redirectAfterCreate: false
}), /*#__PURE__*/_jsx(ConfirmationModal, {
body: /*#__PURE__*/_jsx(Translation, {
elements: {
'1': ({
children
}) => /*#__PURE__*/_jsx("strong", {
children: children
})
},
i18nKey: "general:aboutToDelete",
t: t,
variables: {
label: presetConfig?.labels?.singular,
title: activePreset?.title
}
}),
confirmingLabel: t('general:deleting'),
heading: t('general:confirmDeletion'),
modalSlug: confirmDeletePresetModalSlug,
onConfirm: handleDeletePreset
}), /*#__PURE__*/_jsx(PresetDocumentDrawer, {
onDelete: () => {
// setSelectedPreset(undefined)
},
onDuplicate: async ({
doc
}) => {
await handlePresetChange(doc);
},
onSave: async ({
doc
}) => {
await handlePresetChange(doc);
}
}), /*#__PURE__*/_jsx(ListDrawer, {
allowCreate: false,
disableQueryPresets: true,
onSelect: async ({
doc
}) => {
closeListDrawer();
await handlePresetChange(doc);
}
})]
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/auth/login.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAM7F,KAAK,cAAc,CAAC,KAAK,SAAS,kBAAkB,IAAI;IACtD,UAAU,EAAE,KAAK,CAAA;IACjB,MAAM,EAAE,YAAY,CAAC,eAAe,CAAC,CAAA;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CAAA;AAED,KAAK,iBAAiB,CAAC,KAAK,SAAS,kBAAkB,IAAI;IACzD,UAAU,EAAE,KAAK,CAAA;IACjB,MAAM,EAAE,YAAY,CAAC,eAAe,CAAC,CAAA;IACrC,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AACD,KAAK,SAAS,CAAC,KAAK,SAAS,kBAAkB,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA;AAEnG,wBAAsB,KAAK,CAAC,KAAK,SAAS,kBAAkB,EAAE,EAC5D,UAAU,EACV,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAqDhD"}

View File

@@ -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.
*
*/
import * as modDev from './LexicalSelectionAlwaysOnDisplay.dev.mjs';
import * as modProd from './LexicalSelectionAlwaysOnDisplay.prod.mjs';
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
export const SelectionAlwaysOnDisplay = mod.SelectionAlwaysOnDisplay;

View File

@@ -0,0 +1,146 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)\./i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(pr\.n\.e\.|AD)/i,
abbreviated: /^(pr\.\s?Kr\.|po\.\s?Kr\.)/i,
wide: /^(Prije Krista|prije nove ere|Poslije Krista|nova era)/i,
};
const parseEraPatterns = {
any: [/^pr/i, /^(po|nova)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]\.\s?kv\.?/i,
wide: /^[1234]\. kvartal/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(10|11|12|[123456789])\./i,
abbreviated: /^(sij|velj|(ožu|ozu)|tra|svi|lip|srp|kol|ruj|lis|stu|pro)/i,
wide: /^((siječanj|siječnja|sijecanj|sijecnja)|(veljača|veljače|veljaca|veljace)|(ožujak|ožujka|ozujak|ozujka)|(travanj|travnja)|(svibanj|svibnja)|(lipanj|lipnja)|(srpanj|srpnja)|(kolovoz|kolovoza)|(rujan|rujna)|(listopad|listopada)|(studeni|studenog)|(prosinac|prosinca))/i,
};
const parseMonthPatterns = {
narrow: [
/1/i,
/2/i,
/3/i,
/4/i,
/5/i,
/6/i,
/7/i,
/8/i,
/9/i,
/10/i,
/11/i,
/12/i,
],
abbreviated: [
/^sij/i,
/^velj/i,
/^(ožu|ozu)/i,
/^tra/i,
/^svi/i,
/^lip/i,
/^srp/i,
/^kol/i,
/^ruj/i,
/^lis/i,
/^stu/i,
/^pro/i,
],
wide: [
/^sij/i,
/^velj/i,
/^(ožu|ozu)/i,
/^tra/i,
/^svi/i,
/^lip/i,
/^srp/i,
/^kol/i,
/^ruj/i,
/^lis/i,
/^stu/i,
/^pro/i,
],
};
const matchDayPatterns = {
narrow: /^[npusčc]/i,
short: /^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,
abbreviated: /^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,
wide: /^(nedjelja|ponedjeljak|utorak|srijeda|(četvrtak|cetvrtak)|petak|subota)/i,
};
const parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
};
const matchDayPeriodPatterns = {
any: /^(am|pm|ponoc|ponoć|(po)?podne|navecer|navečer|noću|poslije podne|ujutro)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^pono/i,
noon: /^pod/i,
morning: /jutro/i,
afternoon: /(poslije\s|po)+podne/i,
evening: /(navece|naveče)/i,
night: /(nocu|noću)/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "wide",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1,12 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const ATTR_NEXT_SPAN_TYPE = 'next.span_type';
const ATTR_NEXT_SPAN_NAME = 'next.span_name';
const ATTR_NEXT_ROUTE = 'next.route';
const ATTR_NEXT_SEGMENT = 'next.segment';
exports.ATTR_NEXT_ROUTE = ATTR_NEXT_ROUTE;
exports.ATTR_NEXT_SEGMENT = ATTR_NEXT_SEGMENT;
exports.ATTR_NEXT_SPAN_NAME = ATTR_NEXT_SPAN_NAME;
exports.ATTR_NEXT_SPAN_TYPE = ATTR_NEXT_SPAN_TYPE;
//# sourceMappingURL=nextSpanAttributes.js.map

View File

@@ -0,0 +1,5 @@
/**
* Returns true if the value acts like a Promise, i.e. has a "then" function,
* otherwise returns false.
*/
export declare function isPromise(value: any): value is Promise<unknown>;

View File

@@ -0,0 +1 @@
export { _ as default } from "../esm/_iterable_to_array_limit_loose.js";

View File

@@ -0,0 +1,6 @@
export declare const previousMondayWithOptions: import("./types.js").FPFn2<
Date,
| import("../previousMonday.js").PreviousMondayOptions<Date>
| undefined,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,180 @@
/**
* 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 LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
var useLexicalEditable = require('@lexical/react/useLexicalEditable');
var text = require('@lexical/text');
var utils = require('@lexical/utils');
var react = require('react');
var reactDom = require('react-dom');
var jsxRuntime = require('react/jsx-runtime');
var dragon = require('@lexical/dragon');
var richText = require('@lexical/rich-text');
/**
* 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.
*
*/
// This workaround is no longer necessary in React 19,
// but we currently support React >=17.x
// https://github.com/facebook/react/pull/26395
const useLayoutEffectImpl = CAN_USE_DOM ? react.useLayoutEffect : react.useEffect;
/**
* 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 canShowPlaceholderFromCurrentEditorState(editor) {
const currentCanShowPlaceholder = editor.getEditorState().read(text.$canShowPlaceholderCurry(editor.isComposing()));
return currentCanShowPlaceholder;
}
function useCanShowPlaceholder(editor) {
const [canShowPlaceholder, setCanShowPlaceholder] = react.useState(() => canShowPlaceholderFromCurrentEditorState(editor));
useLayoutEffectImpl(() => {
function resetCanShowPlaceholder() {
const currentCanShowPlaceholder = canShowPlaceholderFromCurrentEditorState(editor);
setCanShowPlaceholder(currentCanShowPlaceholder);
}
resetCanShowPlaceholder();
return utils.mergeRegister(editor.registerUpdateListener(() => {
resetCanShowPlaceholder();
}), editor.registerEditableListener(() => {
resetCanShowPlaceholder();
}));
}, [editor]);
return canShowPlaceholder;
}
/**
* 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 useDecorators(editor, ErrorBoundary) {
const [decorators, setDecorators] = react.useState(() => editor.getDecorators());
// Subscribe to changes
useLayoutEffectImpl(() => {
return editor.registerDecoratorListener(nextDecorators => {
reactDom.flushSync(() => {
setDecorators(nextDecorators);
});
});
}, [editor]);
react.useEffect(() => {
// If the content editable mounts before the subscription is added, then
// nothing will be rendered on initial pass. We can get around that by
// ensuring that we set the value.
setDecorators(editor.getDecorators());
}, [editor]);
// Return decorators defined as React Portals
return react.useMemo(() => {
const decoratedPortals = [];
const decoratorKeys = Object.keys(decorators);
for (let i = 0; i < decoratorKeys.length; i++) {
const nodeKey = decoratorKeys[i];
const reactDecorator = /*#__PURE__*/jsxRuntime.jsx(ErrorBoundary, {
onError: e => editor._onError(e),
children: /*#__PURE__*/jsxRuntime.jsx(react.Suspense, {
fallback: null,
children: decorators[nodeKey]
})
});
const element = editor.getElementByKey(nodeKey);
if (element !== null) {
decoratedPortals.push(/*#__PURE__*/reactDom.createPortal(reactDecorator, element, nodeKey));
}
}
return decoratedPortals;
}, [ErrorBoundary, decorators, editor]);
}
/**
* 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 useRichTextSetup(editor) {
useLayoutEffectImpl(() => {
return utils.mergeRegister(richText.registerRichText(editor), dragon.registerDragonSupport(editor));
// We only do this for init
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [editor]);
}
/**
* 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 RichTextPlugin({
contentEditable,
// TODO Remove. This property is now part of ContentEditable
placeholder = null,
ErrorBoundary
}) {
const [editor] = LexicalComposerContext.useLexicalComposerContext();
const decorators = useDecorators(editor, ErrorBoundary);
useRichTextSetup(editor);
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
children: [contentEditable, /*#__PURE__*/jsxRuntime.jsx(Placeholder, {
content: placeholder
}), decorators]
});
}
// TODO remove
function Placeholder({
content
}) {
const [editor] = LexicalComposerContext.useLexicalComposerContext();
const showPlaceholder = useCanShowPlaceholder(editor);
const editable = useLexicalEditable.useLexicalEditable();
if (!showPlaceholder) {
return null;
}
if (typeof content === 'function') {
return content(editable);
} else {
return content;
}
}
exports.RichTextPlugin = RichTextPlugin;

View File

@@ -0,0 +1,9 @@
import { entityKind } from "../entity.js";
import type { ColumnsSelection } from "../sql/sql.js";
import { View } from "../sql/sql.js";
export declare abstract class SingleStoreViewBase<TName extends string = string, TExisting extends boolean = boolean, TSelectedFields extends ColumnsSelection = ColumnsSelection> extends View<TName, TExisting, TSelectedFields> {
static readonly [entityKind]: string;
readonly _: View<TName, TExisting, TSelectedFields>['_'] & {
readonly viewBrand: 'SingleStoreViewBase';
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"rows-3.js","sources":["../../../src/icons/rows-3.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Rows3\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0yMSA5SDMiIC8+CiAgPHBhdGggZD0iTTIxIDE1SDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/rows-3\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 Rows3 = createLucideIcon('Rows3', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M21 9H3', key: '1338ky' }],\n ['path', { d: 'M21 15H3', key: '9uk58r' }],\n]);\n\nexport default Rows3;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,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,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;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,5 @@
import { IImage } from './interface.js';
declare const PNM: IImage;
export { PNM };

View File

@@ -0,0 +1,2 @@
export { my } from '@payloadcms/translations/languages/my';
//# sourceMappingURL=my.d.ts.map

View File

@@ -0,0 +1,29 @@
import { type Database, type Options, type RunResult } from 'better-sqlite3';
import { entityKind } from "../entity.cjs";
import { BaseSQLiteDatabase } from "../sqlite-core/db.cjs";
import { type DrizzleConfig } from "../utils.cjs";
export type DrizzleBetterSQLite3DatabaseConfig = ({
source?: string | Buffer;
} & Options) | string | undefined;
export declare class BetterSQLite3Database<TSchema extends Record<string, unknown> = Record<string, never>> extends BaseSQLiteDatabase<'sync', RunResult, TSchema> {
static readonly [entityKind]: string;
}
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>>(...params: [] | [
Database | string
] | [
Database | string,
DrizzleConfig<TSchema>
] | [
(DrizzleConfig<TSchema> & ({
connection?: DrizzleBetterSQLite3DatabaseConfig;
} | {
client: Database;
}))
]): BetterSQLite3Database<TSchema> & {
$client: Database;
};
export declare namespace drizzle {
function mock<TSchema extends Record<string, unknown> = Record<string, never>>(config?: DrizzleConfig<TSchema>): BetterSQLite3Database<TSchema> & {
$client: '$client is not available on drizzle.mock()';
};
}

View File

@@ -0,0 +1,59 @@
import { millisecondsInWeek } from "./constants.mjs";
import { startOfWeek } from "./startOfWeek.mjs";
import { getTimezoneOffsetInMilliseconds } from "./_lib/getTimezoneOffsetInMilliseconds.mjs";
/**
* The {@link differenceInCalendarWeeks} function options.
*/
/**
* @name differenceInCalendarWeeks
* @category Week Helpers
* @summary Get the number of calendar weeks between the given dates.
*
* @description
* Get the number of calendar weeks between the given dates.
*
* @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 dateLeft - The later date
* @param dateRight - The earlier date
* @param options - An object with options.
*
* @returns The number of calendar weeks
*
* @example
* // How many calendar weeks are between 5 July 2014 and 20 July 2014?
* const result = differenceInCalendarWeeks(
* new Date(2014, 6, 20),
* new Date(2014, 6, 5)
* )
* //=> 3
*
* @example
* // If the week starts on Monday,
* // how many calendar weeks are between 5 July 2014 and 20 July 2014?
* const result = differenceInCalendarWeeks(
* new Date(2014, 6, 20),
* new Date(2014, 6, 5),
* { weekStartsOn: 1 }
* )
* //=> 2
*/
export function differenceInCalendarWeeks(dateLeft, dateRight, options) {
const startOfWeekLeft = startOfWeek(dateLeft, options);
const startOfWeekRight = startOfWeek(dateRight, options);
const timestampLeft =
+startOfWeekLeft - getTimezoneOffsetInMilliseconds(startOfWeekLeft);
const timestampRight =
+startOfWeekRight - getTimezoneOffsetInMilliseconds(startOfWeekRight);
// Round the number of days to the nearest integer because the number of
// milliseconds in a days is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round((timestampLeft - timestampRight) / millisecondsInWeek);
}
// Fallback for modularized imports:
export default differenceInCalendarWeeks;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../../src/integrations/local-variables/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { NODE_VERSION } from '../../nodeVersion';\nimport type { LocalVariablesIntegrationOptions } from './common';\nimport { localVariablesAsyncIntegration } from './local-variables-async';\nimport { localVariablesSyncIntegration } from './local-variables-sync';\n\nexport const localVariablesIntegration = (options: LocalVariablesIntegrationOptions = {}): Integration => {\n return NODE_VERSION.major < 19 ? localVariablesSyncIntegration(options) : localVariablesAsyncIntegration(options);\n};\n"],"names":[],"mappings":";;;;AAMO,MAAM,4BAA4B,CAAC,OAAO,GAAqC,EAAE,KAAkB;AAC1G,EAAE,OAAO,YAAY,CAAC,KAAA,GAAQ,EAAA,GAAK,6BAA6B,CAAC,OAAO,CAAA,GAAI,8BAA8B,CAAC,OAAO,CAAC;AACnH;;;;"}

View File

@@ -0,0 +1,28 @@
import { formatDistance } from "./sr-Latn/_lib/formatDistance.mjs";
import { formatLong } from "./sr-Latn/_lib/formatLong.mjs";
import { formatRelative } from "./sr-Latn/_lib/formatRelative.mjs";
import { localize } from "./sr-Latn/_lib/localize.mjs";
import { match } from "./sr-Latn/_lib/match.mjs";
/**
* @category Locales
* @summary Serbian latin locale.
* @language Serbian
* @iso-639-2 srp
* @author Igor Radivojević [@rogyvoje](https://github.com/rogyvoje)
*/
export const srLatn = {
code: "sr-Latn",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default srLatn;

View File

@@ -0,0 +1,634 @@
node-fetch
==========
[![npm version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![coverage status][codecov-image]][codecov-url]
[![install size][install-size-image]][install-size-url]
[![Discord][discord-image]][discord-url]
A light-weight module that brings `window.fetch` to Node.js
(We are looking for [v2 maintainers and collaborators](https://github.com/bitinn/node-fetch/issues/567))
[![Backers][opencollective-image]][opencollective-url]
<!-- TOC -->
- [Motivation](#motivation)
- [Features](#features)
- [Difference from client-side fetch](#difference-from-client-side-fetch)
- [Installation](#installation)
- [Loading and configuring the module](#loading-and-configuring-the-module)
- [Common Usage](#common-usage)
- [Plain text or HTML](#plain-text-or-html)
- [JSON](#json)
- [Simple Post](#simple-post)
- [Post with JSON](#post-with-json)
- [Post with form parameters](#post-with-form-parameters)
- [Handling exceptions](#handling-exceptions)
- [Handling client and server errors](#handling-client-and-server-errors)
- [Advanced Usage](#advanced-usage)
- [Streams](#streams)
- [Buffer](#buffer)
- [Accessing Headers and other Meta data](#accessing-headers-and-other-meta-data)
- [Extract Set-Cookie Header](#extract-set-cookie-header)
- [Post data using a file stream](#post-data-using-a-file-stream)
- [Post with form-data (detect multipart)](#post-with-form-data-detect-multipart)
- [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal)
- [API](#api)
- [fetch(url[, options])](#fetchurl-options)
- [Options](#options)
- [Class: Request](#class-request)
- [Class: Response](#class-response)
- [Class: Headers](#class-headers)
- [Interface: Body](#interface-body)
- [Class: FetchError](#class-fetcherror)
- [License](#license)
- [Acknowledgement](#acknowledgement)
<!-- /TOC -->
## Motivation
Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence, `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime.
See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) or Leonardo Quixada's [cross-fetch](https://github.com/lquixada/cross-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side).
## Features
- Stay consistent with `window.fetch` API.
- Make conscious trade-off when following [WHATWG fetch spec][whatwg-fetch] and [stream spec](https://streams.spec.whatwg.org/) implementation details, document known differences.
- Use native promise but allow substituting it with [insert your favorite promise library].
- Use native Node streams for body on both request and response.
- Decode content encoding (gzip/deflate) properly and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically.
- Useful extensions such as timeout, redirect limit, response size limit, [explicit errors](ERROR-HANDLING.md) for troubleshooting.
## Difference from client-side fetch
- See [Known Differences](LIMITS.md) for details.
- If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue.
- Pull requests are welcomed too!
## Installation
Current stable release (`2.x`)
```sh
$ npm install node-fetch
```
## Loading and configuring the module
We suggest you load the module via `require` until the stabilization of ES modules in node:
```js
const fetch = require('node-fetch');
```
If you are using a Promise library other than native, set it through `fetch.Promise`:
```js
const Bluebird = require('bluebird');
fetch.Promise = Bluebird;
```
## Common Usage
NOTE: The documentation below is up-to-date with `2.x` releases; see the [`1.x` readme](https://github.com/bitinn/node-fetch/blob/1.x/README.md), [changelog](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) and [2.x upgrade guide](UPGRADE-GUIDE.md) for the differences.
#### Plain text or HTML
```js
fetch('https://github.com/')
.then(res => res.text())
.then(body => console.log(body));
```
#### JSON
```js
fetch('https://api.github.com/users/github')
.then(res => res.json())
.then(json => console.log(json));
```
#### Simple Post
```js
fetch('https://httpbin.org/post', { method: 'POST', body: 'a=1' })
.then(res => res.json()) // expecting a json response
.then(json => console.log(json));
```
#### Post with JSON
```js
const body = { a: 1 };
fetch('https://httpbin.org/post', {
method: 'post',
body: JSON.stringify(body),
headers: { 'Content-Type': 'application/json' },
})
.then(res => res.json())
.then(json => console.log(json));
```
#### Post with form parameters
`URLSearchParams` is available in Node.js as of v7.5.0. See [official documentation](https://nodejs.org/api/url.html#url_class_urlsearchparams) for more usage methods.
NOTE: The `Content-Type` header is only set automatically to `x-www-form-urlencoded` when an instance of `URLSearchParams` is given as such:
```js
const { URLSearchParams } = require('url');
const params = new URLSearchParams();
params.append('a', 1);
fetch('https://httpbin.org/post', { method: 'POST', body: params })
.then(res => res.json())
.then(json => console.log(json));
```
#### Handling exceptions
NOTE: 3xx-5xx responses are *NOT* exceptions and should be handled in `then()`; see the next section for more information.
Adding a catch to the fetch promise chain will catch *all* exceptions, such as errors originating from node core libraries, network errors and operational errors, which are instances of FetchError. See the [error handling document](ERROR-HANDLING.md) for more details.
```js
fetch('https://domain.invalid/')
.catch(err => console.error(err));
```
#### Handling client and server errors
It is common to create a helper function to check that the response contains no client (4xx) or server (5xx) error responses:
```js
function checkStatus(res) {
if (res.ok) { // res.status >= 200 && res.status < 300
return res;
} else {
throw MyCustomError(res.statusText);
}
}
fetch('https://httpbin.org/status/400')
.then(checkStatus)
.then(res => console.log('will not get here...'))
```
## Advanced Usage
#### Streams
The "Node.js way" is to use streams when possible:
```js
fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
.then(res => {
const dest = fs.createWriteStream('./octocat.png');
res.body.pipe(dest);
});
```
In Node.js 14 you can also use async iterators to read `body`; however, be careful to catch
errors -- the longer a response runs, the more likely it is to encounter an error.
```js
const fetch = require('node-fetch');
const response = await fetch('https://httpbin.org/stream/3');
try {
for await (const chunk of response.body) {
console.dir(JSON.parse(chunk.toString()));
}
} catch (err) {
console.error(err.stack);
}
```
In Node.js 12 you can also use async iterators to read `body`; however, async iterators with streams
did not mature until Node.js 14, so you need to do some extra work to ensure you handle errors
directly from the stream and wait on it response to fully close.
```js
const fetch = require('node-fetch');
const read = async body => {
let error;
body.on('error', err => {
error = err;
});
for await (const chunk of body) {
console.dir(JSON.parse(chunk.toString()));
}
return new Promise((resolve, reject) => {
body.on('close', () => {
error ? reject(error) : resolve();
});
});
};
try {
const response = await fetch('https://httpbin.org/stream/3');
await read(response.body);
} catch (err) {
console.error(err.stack);
}
```
#### Buffer
If you prefer to cache binary data in full, use buffer(). (NOTE: `buffer()` is a `node-fetch`-only API)
```js
const fileType = require('file-type');
fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
.then(res => res.buffer())
.then(buffer => fileType(buffer))
.then(type => { /* ... */ });
```
#### Accessing Headers and other Meta data
```js
fetch('https://github.com/')
.then(res => {
console.log(res.ok);
console.log(res.status);
console.log(res.statusText);
console.log(res.headers.raw());
console.log(res.headers.get('content-type'));
});
```
#### Extract Set-Cookie Header
Unlike browsers, you can access raw `Set-Cookie` headers manually using `Headers.raw()`. This is a `node-fetch` only API.
```js
fetch(url).then(res => {
// returns an array of values, instead of a string of comma-separated values
console.log(res.headers.raw()['set-cookie']);
});
```
#### Post data using a file stream
```js
const { createReadStream } = require('fs');
const stream = createReadStream('input.txt');
fetch('https://httpbin.org/post', { method: 'POST', body: stream })
.then(res => res.json())
.then(json => console.log(json));
```
#### Post with form-data (detect multipart)
```js
const FormData = require('form-data');
const form = new FormData();
form.append('a', 1);
fetch('https://httpbin.org/post', { method: 'POST', body: form })
.then(res => res.json())
.then(json => console.log(json));
// OR, using custom headers
// NOTE: getHeaders() is non-standard API
const form = new FormData();
form.append('a', 1);
const options = {
method: 'POST',
body: form,
headers: form.getHeaders()
}
fetch('https://httpbin.org/post', options)
.then(res => res.json())
.then(json => console.log(json));
```
#### Request cancellation with AbortSignal
> NOTE: You may cancel streamed requests only on Node >= v8.0.0
You may cancel requests with `AbortController`. A suggested implementation is [`abort-controller`](https://www.npmjs.com/package/abort-controller).
An example of timing out a request after 150ms could be achieved as the following:
```js
import AbortController from 'abort-controller';
const controller = new AbortController();
const timeout = setTimeout(
() => { controller.abort(); },
150,
);
fetch(url, { signal: controller.signal })
.then(res => res.json())
.then(
data => {
useData(data)
},
err => {
if (err.name === 'AbortError') {
// request was aborted
}
},
)
.finally(() => {
clearTimeout(timeout);
});
```
See [test cases](https://github.com/bitinn/node-fetch/blob/master/test/test.js) for more examples.
## API
### fetch(url[, options])
- `url` A string representing the URL for fetching
- `options` [Options](#fetch-options) for the HTTP(S) request
- Returns: <code>Promise&lt;[Response](#class-response)&gt;</code>
Perform an HTTP(S) fetch.
`url` should be an absolute url, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected `Promise`.
<a id="fetch-options"></a>
### Options
The default values are shown after each option key.
```js
{
// These properties are part of the Fetch Standard
method: 'GET',
headers: {}, // request headers. format is the identical to that accepted by the Headers constructor (see below)
body: null, // request body. can be null, a string, a Buffer, a Blob, or a Node.js Readable stream
redirect: 'follow', // set to `manual` to extract redirect headers, `error` to reject redirect
signal: null, // pass an instance of AbortSignal to optionally abort requests
// The following properties are node-fetch extensions
follow: 20, // maximum redirect count. 0 to not follow redirect
timeout: 0, // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies). Signal is recommended instead.
compress: true, // support gzip/deflate content encoding. false to disable
size: 0, // maximum response body size in bytes. 0 to disable
agent: null // http(s).Agent instance or function that returns an instance (see below)
}
```
##### Default Headers
If no values are set, the following request headers will be sent automatically:
Header | Value
------------------- | --------------------------------------------------------
`Accept-Encoding` | `gzip,deflate` _(when `options.compress === true`)_
`Accept` | `*/*`
`Content-Length` | _(automatically calculated, if possible)_
`Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_
`User-Agent` | `node-fetch/1.0 (+https://github.com/bitinn/node-fetch)`
Note: when `body` is a `Stream`, `Content-Length` is not set automatically.
##### Custom Agent
The `agent` option allows you to specify networking related options which are out of the scope of Fetch, including and not limited to the following:
- Support self-signed certificate
- Use only IPv4 or IPv6
- Custom DNS Lookup
See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for more information.
If no agent is specified, the default agent provided by Node.js is used. Note that [this changed in Node.js 19](https://github.com/nodejs/node/blob/4267b92604ad78584244488e7f7508a690cb80d0/lib/_http_agent.js#L564) to have `keepalive` true by default. If you wish to enable `keepalive` in an earlier version of Node.js, you can override the agent as per the following code sample.
In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol.
```js
const httpAgent = new http.Agent({
keepAlive: true
});
const httpsAgent = new https.Agent({
keepAlive: true
});
const options = {
agent: function (_parsedURL) {
if (_parsedURL.protocol == 'http:') {
return httpAgent;
} else {
return httpsAgent;
}
}
}
```
<a id="class-request"></a>
### Class: Request
An HTTP(S) request containing information about URL, method, headers, and the body. This class implements the [Body](#iface-body) interface.
Due to the nature of Node.js, the following properties are not implemented at this moment:
- `type`
- `destination`
- `referrer`
- `referrerPolicy`
- `mode`
- `credentials`
- `cache`
- `integrity`
- `keepalive`
The following node-fetch extension properties are provided:
- `follow`
- `compress`
- `counter`
- `agent`
See [options](#fetch-options) for exact meaning of these extensions.
#### new Request(input[, options])
<small>*(spec-compliant)*</small>
- `input` A string representing a URL, or another `Request` (which will be cloned)
- `options` [Options][#fetch-options] for the HTTP(S) request
Constructs a new `Request` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request).
In most cases, directly `fetch(url, options)` is simpler than creating a `Request` object.
<a id="class-response"></a>
### Class: Response
An HTTP(S) response. This class implements the [Body](#iface-body) interface.
The following properties are not implemented in node-fetch at this moment:
- `Response.error()`
- `Response.redirect()`
- `type`
- `trailer`
#### new Response([body[, options]])
<small>*(spec-compliant)*</small>
- `body` A `String` or [`Readable` stream][node-readable]
- `options` A [`ResponseInit`][response-init] options dictionary
Constructs a new `Response` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response).
Because Node.js does not implement service workers (for which this class was designed), one rarely has to construct a `Response` directly.
#### response.ok
<small>*(spec-compliant)*</small>
Convenience property representing if the request ended normally. Will evaluate to true if the response status was greater than or equal to 200 but smaller than 300.
#### response.redirected
<small>*(spec-compliant)*</small>
Convenience property representing if the request has been redirected at least once. Will evaluate to true if the internal redirect counter is greater than 0.
<a id="class-headers"></a>
### Class: Headers
This class allows manipulating and iterating over a set of HTTP headers. All methods specified in the [Fetch Standard][whatwg-fetch] are implemented.
#### new Headers([init])
<small>*(spec-compliant)*</small>
- `init` Optional argument to pre-fill the `Headers` object
Construct a new `Headers` object. `init` can be either `null`, a `Headers` object, an key-value map object or any iterable object.
```js
// Example adapted from https://fetch.spec.whatwg.org/#example-headers-class
const meta = {
'Content-Type': 'text/xml',
'Breaking-Bad': '<3'
};
const headers = new Headers(meta);
// The above is equivalent to
const meta = [
[ 'Content-Type', 'text/xml' ],
[ 'Breaking-Bad', '<3' ]
];
const headers = new Headers(meta);
// You can in fact use any iterable objects, like a Map or even another Headers
const meta = new Map();
meta.set('Content-Type', 'text/xml');
meta.set('Breaking-Bad', '<3');
const headers = new Headers(meta);
const copyOfHeaders = new Headers(headers);
```
<a id="iface-body"></a>
### Interface: Body
`Body` is an abstract interface with methods that are applicable to both `Request` and `Response` classes.
The following methods are not yet implemented in node-fetch at this moment:
- `formData()`
#### body.body
<small>*(deviation from spec)*</small>
* Node.js [`Readable` stream][node-readable]
Data are encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable].
#### body.bodyUsed
<small>*(spec-compliant)*</small>
* `Boolean`
A boolean property for if this body has been consumed. Per the specs, a consumed body cannot be used again.
#### body.arrayBuffer()
#### body.blob()
#### body.json()
#### body.text()
<small>*(spec-compliant)*</small>
* Returns: <code>Promise</code>
Consume the body and return a promise that will resolve to one of these formats.
#### body.buffer()
<small>*(node-fetch extension)*</small>
* Returns: <code>Promise&lt;Buffer&gt;</code>
Consume the body and return a promise that will resolve to a Buffer.
#### body.textConverted()
<small>*(node-fetch extension)*</small>
* Returns: <code>Promise&lt;String&gt;</code>
Identical to `body.text()`, except instead of always converting to UTF-8, encoding sniffing will be performed and text converted to UTF-8 if possible.
(This API requires an optional dependency of the npm package [encoding](https://www.npmjs.com/package/encoding), which you need to install manually. `webpack` users may see [a warning message](https://github.com/bitinn/node-fetch/issues/412#issuecomment-379007792) due to this optional dependency.)
<a id="class-fetcherror"></a>
### Class: FetchError
<small>*(node-fetch extension)*</small>
An operational error in the fetching process. See [ERROR-HANDLING.md][] for more info.
<a id="class-aborterror"></a>
### Class: AbortError
<small>*(node-fetch extension)*</small>
An Error thrown when the request is aborted in response to an `AbortSignal`'s `abort` event. It has a `name` property of `AbortError`. See [ERROR-HANDLING.MD][] for more info.
## Acknowledgement
Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation reference.
`node-fetch` v1 was maintained by [@bitinn](https://github.com/bitinn); v2 was maintained by [@TimothyGu](https://github.com/timothygu), [@bitinn](https://github.com/bitinn) and [@jimmywarting](https://github.com/jimmywarting); v2 readme is written by [@jkantr](https://github.com/jkantr).
## License
MIT
[npm-image]: https://flat.badgen.net/npm/v/node-fetch
[npm-url]: https://www.npmjs.com/package/node-fetch
[travis-image]: https://flat.badgen.net/travis/bitinn/node-fetch
[travis-url]: https://travis-ci.org/bitinn/node-fetch
[codecov-image]: https://flat.badgen.net/codecov/c/github/bitinn/node-fetch/master
[codecov-url]: https://codecov.io/gh/bitinn/node-fetch
[install-size-image]: https://flat.badgen.net/packagephobia/install/node-fetch
[install-size-url]: https://packagephobia.now.sh/result?p=node-fetch
[discord-image]: https://img.shields.io/discord/619915844268326952?color=%237289DA&label=Discord&style=flat-square
[discord-url]: https://discord.gg/Zxbndcm
[opencollective-image]: https://opencollective.com/node-fetch/backers.svg
[opencollective-url]: https://opencollective.com/node-fetch
[whatwg-fetch]: https://fetch.spec.whatwg.org/
[response-init]: https://fetch.spec.whatwg.org/#responseinit
[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams
[mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers
[LIMITS.md]: https://github.com/bitinn/node-fetch/blob/master/LIMITS.md
[ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md
[UPGRADE-GUIDE.md]: https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md

View File

@@ -0,0 +1,121 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["пр.н.е.", "н.е."],
abbreviated: ["пред н. е.", "н. е."],
wide: ["пред нашата ера", "нашата ера"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-ви кв.", "2-ри кв.", "3-ти кв.", "4-ти кв."],
wide: ["1-ви квартал", "2-ри квартал", "3-ти квартал", "4-ти квартал"],
};
const monthValues = {
abbreviated: [
"јан",
"фев",
"мар",
"апр",
"мај",
"јун",
"јул",
"авг",
"септ",
"окт",
"ноем",
"дек",
],
wide: [
"јануари",
"февруари",
"март",
"април",
"мај",
"јуни",
"јули",
"август",
"септември",
"октомври",
"ноември",
"декември",
],
};
const dayValues = {
narrow: ["Н", "П", "В", "С", "Ч", "П", "С"],
short: ["не", "по", "вт", "ср", "че", "пе", "са"],
abbreviated: ["нед", "пон", "вто", "сре", "чет", "пет", "саб"],
wide: [
"недела",
"понеделник",
"вторник",
"среда",
"четврток",
"петок",
"сабота",
],
};
const dayPeriodValues = {
wide: {
am: "претпладне",
pm: "попладне",
midnight: "полноќ",
noon: "напладне",
morning: "наутро",
afternoon: "попладне",
evening: "навечер",
night: "ноќе",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
const rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "-ви";
case 2:
return number + "-ри";
case 7:
case 8:
return number + "-ми";
}
}
return number + "-ти";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
}),
};

View File

@@ -0,0 +1,218 @@
'use strict'
const os = require('node:os')
const { test } = require('tap')
const { sink, once } = require('./helper')
const pino = require('../')
const { pid } = process
const hostname = os.hostname()
const level = 50
const name = 'error'
test('mixin object is included', async ({ ok, same }) => {
let n = 0
const stream = sink()
const instance = pino({
mixin () {
return { hello: ++n }
}
}, stream)
instance.level = name
instance[name]('test')
const result = await once(stream, 'data')
ok(new Date(result.time) <= new Date(), 'time is greater than Date.now()')
delete result.time
same(result, {
pid,
hostname,
level,
msg: 'test',
hello: 1
})
})
test('mixin object is new every time', async ({ plan, ok, same }) => {
plan(6)
let n = 0
const stream = sink()
const instance = pino({
mixin () {
return { hello: n }
}
}, stream)
instance.level = name
while (++n < 4) {
const msg = `test #${n}`
stream.pause()
instance[name](msg)
stream.resume()
const result = await once(stream, 'data')
ok(new Date(result.time) <= new Date(), 'time is greater than Date.now()')
delete result.time
same(result, {
pid,
hostname,
level,
msg,
hello: n
})
}
})
test('mixin object is not called if below log level', async ({ ok }) => {
const stream = sink()
const instance = pino({
mixin () {
ok(false, 'should not call mixin function')
}
}, stream)
instance.level = 'error'
instance.info('test')
})
test('mixin object + logged object', async ({ ok, same }) => {
const stream = sink()
const instance = pino({
mixin () {
return { foo: 1, bar: 2 }
}
}, stream)
instance.level = name
instance[name]({ bar: 3, baz: 4 })
const result = await once(stream, 'data')
ok(new Date(result.time) <= new Date(), 'time is greater than Date.now()')
delete result.time
same(result, {
pid,
hostname,
level,
foo: 1,
bar: 3,
baz: 4
})
})
test('mixin not a function', async ({ throws }) => {
const stream = sink()
throws(function () {
pino({ mixin: 'not a function' }, stream)
})
})
test('mixin can use context', async ({ ok, same }) => {
const stream = sink()
const instance = pino({
mixin (context) {
ok(context !== null, 'context should be defined')
ok(context !== undefined, 'context should be defined')
same(context, {
message: '123',
stack: 'stack'
})
return Object.assign({
error: context.message,
stack: context.stack
})
}
}, stream)
instance.level = name
instance[name]({
message: '123',
stack: 'stack'
}, 'test')
})
test('mixin works without context', async ({ ok, same }) => {
const stream = sink()
const instance = pino({
mixin (context) {
ok(context !== null, 'context is still defined w/o passing mergeObject')
ok(context !== undefined, 'context is still defined w/o passing mergeObject')
same(context, {})
return {
something: true
}
}
}, stream)
instance.level = name
instance[name]('test')
})
test('mixin can use level number', async ({ ok, same }) => {
const stream = sink()
const instance = pino({
mixin (context, num) {
ok(num !== null, 'level should be defined')
ok(num !== undefined, 'level should be defined')
same(num, level)
return Object.assign({
error: context.message,
stack: context.stack
})
}
}, stream)
instance.level = name
instance[name]({
message: '123',
stack: 'stack'
}, 'test')
})
test('mixin receives logger as third parameter', async ({ ok, same }) => {
const stream = sink()
const instance = pino({
mixin (context, num, logger) {
ok(logger !== null, 'logger should be defined')
ok(logger !== undefined, 'logger should be defined')
same(logger, instance)
return { ...context, num }
}
}, stream)
instance.level = name
instance[name]({
message: '123'
}, 'test')
})
test('mixin receives child logger', async ({ ok, same }) => {
const stream = sink()
let child = null
const instance = pino({
mixin (context, num, logger) {
ok(logger !== null, 'logger should be defined')
ok(logger !== undefined, 'logger should be defined')
same(logger.expected, child.expected)
return { ...context, num }
}
}, stream)
instance.level = name
instance.expected = false
child = instance.child({})
child.expected = true
child[name]({
message: '123'
}, 'test')
})
test('mixin receives logger even if child exists', async ({ ok, same }) => {
const stream = sink()
let child = null
const instance = pino({
mixin (context, num, logger) {
ok(logger !== null, 'logger should be defined')
ok(logger !== undefined, 'logger should be defined')
same(logger.expected, instance.expected)
return { ...context, num }
}
}, stream)
instance.level = name
instance.expected = false
child = instance.child({})
child.expected = true
instance[name]({
message: '123'
}, 'test')
})

View File

@@ -0,0 +1,7 @@
var getNative = require('./_getNative'),
root = require('./_root');
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;

View File

@@ -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 Webhook = createLucideIcon("Webhook", [
[
"path",
{
d: "M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",
key: "q3hayz"
}
],
["path", { d: "m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06", key: "1go1hn" }],
["path", { d: "m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8", key: "qlwsc0" }]
]);
export { Webhook as default };
//# sourceMappingURL=webhook.js.map

View File

@@ -0,0 +1,140 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
var _index3 = require("./localize.js");
const matchOrdinalNumberPattern = /^[०१२३४५६७८९]+/i;
const parseOrdinalNumberPattern = /^[०१२३४५६७८९]+/i;
const matchEraPatterns = {
narrow: /^(ईसा-पूर्व|ईस्वी)/i,
abbreviated: /^(ईसा\.?\s?पूर्व\.?|ईसा\.?)/i,
wide: /^(ईसा-पूर्व|ईसवी पूर्व|ईसवी सन|ईसवी)/i,
};
const parseEraPatterns = {
any: [/^b/i, /^(a|c)/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 = {
// eslint-disable-next-line no-misleading-character-class
narrow: /^[जफ़माअप्मईजूनजुअगसिअक्तनदि]/i,
abbreviated: /^(जन|फ़र|मार्च|अप्|मई|जून|जुल|अग|सित|अक्तू|नव|दिस)/i,
wide: /^(जनवरी|फ़रवरी|मार्च|अप्रैल|मई|जून|जुलाई|अगस्त|सितंबर|अक्तूबर|नवंबर|दिसंबर)/i,
};
const parseMonthPatterns = {
narrow: [
/^ज/i,
/^फ़/i,
/^मा/i,
/^अप्/i,
/^मई/i,
/^जू/i,
/^जु/i,
/^अग/i,
/^सि/i,
/^अक्तू/i,
/^न/i,
/^दि/i,
],
any: [
/^जन/i,
/^फ़/i,
/^मा/i,
/^अप्/i,
/^मई/i,
/^जू/i,
/^जु/i,
/^अग/i,
/^सि/i,
/^अक्तू/i,
/^नव/i,
/^दिस/i,
],
};
const matchDayPatterns = {
// eslint-disable-next-line no-misleading-character-class
narrow: /^[रविसोममंगलबुधगुरुशुक्रशनि]/i,
short: /^(रवि|सोम|मंगल|बुध|गुरु|शुक्र|शनि)/i,
abbreviated: /^(रवि|सोम|मंगल|बुध|गुरु|शुक्र|शनि)/i,
wide: /^(रविवार|सोमवार|मंगलवार|बुधवार|गुरुवार|शुक्रवार|शनिवार)/i,
};
const parseDayPatterns = {
narrow: [/^रवि/i, /^सोम/i, /^मंगल/i, /^बुध/i, /^गुरु/i, /^शुक्र/i, /^शनि/i],
any: [/^रवि/i, /^सोम/i, /^मंगल/i, /^बुध/i, /^गुरु/i, /^शुक्र/i, /^शनि/i],
};
const matchDayPeriodPatterns = {
narrow: /^(पू|अ|म|द.\?|सु|दो|शा|रा)/i,
any: /^(पूर्वाह्न|अपराह्न|म|द.\?|सु|दो|शा|रा)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^पूर्वाह्न/i,
pm: /^अपराह्न/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: _index3.localeToNumber,
}),
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: "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",
}),
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"limitItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitItems.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,QAAQ,CAAA;IAC5D,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAC/D,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/FolderView/DragOverlaySelection/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAMtD,OAAO,cAAc,CAAA;AAIrB,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B,CAAA;AACD,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,cAAc,+BAmC3E;AAED,eAAO,MAAM,mBAAmB,EAAE,QAmBjC,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"createBreadcrumb.d.ts","sourceRoot":"","sources":["../../../../src/util/createBreadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC,GAChH,qBAAqB,CAMvB"}

View File

@@ -0,0 +1,24 @@
import { DirectusFolder } from "../../../schema/folder.js";
import { ApplyQueryFields } from "../../../types/output.js";
import { Query } from "../../../types/query.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/read/folders.d.ts
type ReadFolderOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusFolder<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
/**
* List all folders that exist in Directus.
* @param query The query parameters
* @returns An array of up to limit folder objects. If no items are available, data will be an empty array.
*/
declare const readFolders: <Schema, const TQuery extends Query<Schema, DirectusFolder<Schema>>>(query?: TQuery) => RestCommand<ReadFolderOutput<Schema, TQuery>[], Schema>;
/**
* List an existing folder by primary key.
* @param key The primary key of the dashboard
* @param query The query parameters
* @returns Returns a folder object if a valid primary key was provided.
* @throws Will throw if key is empty
*/
declare const readFolder: <Schema, const TQuery extends Query<Schema, DirectusFolder<Schema>>>(key: DirectusFolder<Schema>["id"], query?: TQuery) => RestCommand<ReadFolderOutput<Schema, TQuery>, Schema>;
//#endregion
export { ReadFolderOutput, readFolder, readFolders };
//# sourceMappingURL=folders.d.ts.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 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","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 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":"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 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 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","2":"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"},E:{"1":"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","2":"J bB K D E F A B C L M G 6C bC 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED"},F:{"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 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","2":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB JD KD LD MD PC xC ND QC"},G:{"1":"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":"E bC 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"},H:{"2":"mD"},I:{"2":"VC J I nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"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:5,C:"Permissions API",D:true};

View File

@@ -0,0 +1,7 @@
import React from 'react';
export declare const EditDepthContext: React.Context<number>;
export declare const EditDepthProvider: React.FC<{
children: React.ReactNode;
}>;
export declare const useEditDepth: () => number;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,602 @@
export const daTranslations = {
authentication: {
account: 'Konto',
accountOfCurrentUser: 'Den nuværende brugers konto',
accountVerified: 'Konto verifieret.',
alreadyActivated: 'Allerede aktiveret',
alreadyLoggedIn: 'Allerede logget ind',
apiKey: 'API nøgle',
authenticated: 'Godkendt',
backToLogin: 'Tilbage til login',
beginCreateFirstUser: 'For at starte, opret en bruger.',
changePassword: 'Skift adgangskode',
checkYourEmailForPasswordReset: 'Hvis e-mailadressen er forbundet med en konto, vil du kort tid modtage instruktioner til at nulstille din adgangskode. Tjek venligst din spam- eller junkmail-mappe, hvis du ikke ser e-mailen i din indbakke.',
confirmGeneration: 'Bekræft generering',
confirmPassword: 'Bekræft adgangskode',
createFirstUser: 'Opret bruger',
emailNotValid: 'Ugyldig email',
emailOrUsername: 'Email eller brugernavn',
emailSent: 'Email sendt',
emailVerified: 'Email verificeret.',
enableAPIKey: 'Aktiver API nøgle',
failedToUnlock: 'Kunne ikke låse op',
forceUnlock: 'Tving oplåsning',
forgotPassword: 'Glemt adgangskode',
forgotPasswordEmailInstructions: 'Indtast email nedenunder. Du vil modtage en email med instruktioner i hvordan du nulstiller din adgangskode.',
forgotPasswordQuestion: 'Glemt adgangskode?',
forgotPasswordUsernameInstructions: 'Indtast brugernavn nedenunder. Instruktioner i hvordan du nulstiller din adgangskode vil blive sendt til den email der er tilknyttet brugeren.',
generate: 'Generer',
generateNewAPIKey: 'Generer ny API nøgle.',
generatingNewAPIKeyWillInvalidate: 'Generering af en ny API nøgle vil <1>ugyldiggøre</1> den tidligere nøgle. Vil du forsætte?',
lockUntil: 'Lås indtil',
logBackIn: 'Log på igen',
loggedIn: 'For at logge på med en anden bruger, skal du først <0>logge ud</0>.',
loggedInChangePassword: 'For at ændre din adgangskode, gå til <0>konto</0> og ændr den der.',
loggedOutInactivity: 'Du er blevet logget ud grundet inaktivitet.',
loggedOutSuccessfully: 'Du er logget ud.',
loggingOut: 'Logger ud...',
login: 'Login',
loginAttempts: 'Login forsøg',
loginUser: 'Login bruger',
loginWithAnotherUser: 'For at logge på med en anden bruger, skal du først <0>logge ud</0>.',
logOut: 'Log ud',
logout: 'Log ud',
logoutSuccessful: 'Log ud succesfuldt.',
logoutUser: 'Log ud bruger',
newAccountCreated: 'En ny bruger er blevet oprettet. <a href="{{serverURL}}">{{serverURL}}</a> Klik på linket eller kopier URL for at verificere din email: <a href="{{verificationURL}}">{{verificationURL}}</a><br> Efter verificeringen af din email, kan du logge ind.',
newAPIKeyGenerated: 'Ny API nøgle genereret.',
newPassword: 'Ny adgangskode',
passed: 'Godkendt',
passwordResetSuccessfully: 'Adgangskode nulstillet.',
resetPassword: 'Nulstil adgangskode',
resetPasswordExpiration: 'Nulstil udløbsdato for adgangskoden',
resetPasswordToken: 'Nulstil adgangskode token',
resetYourPassword: 'Nulstil din adgangskode',
stayLoggedIn: 'Forbliv logget ind',
successfullyRegisteredFirstUser: 'Bruger registreret.',
successfullyUnlocked: 'Låst op',
tokenRefreshSuccessful: 'Tokenopdatering blev gennemført med succes.',
unableToVerify: 'Kan ikke verificere',
username: 'Brugernavn',
usernameNotValid: 'Brugernavnet er ugyldigt.',
verified: 'Bekræftet',
verifiedSuccessfully: 'Bekræftet succesfuldt',
verify: 'Bekræft',
verifyUser: 'Bekræft bruger',
verifyYourEmail: 'Bekræft din email',
youAreInactive: 'Du har ikke været aktiv i et stykke tid og vil snart blive logget automatisk ud. Vil du forblive logget ind?',
youAreReceivingResetPassword: 'Du modtager dette, fordi du eller en anden har anmodet om at nulstille adgangskoden til din konto. Klik venligst på følgende link, eller indsæt det i din browser for at fuldføre processen:',
youDidNotRequestPassword: 'Hvis du ikke har anmodet om dette, skal du blot ignorere denne e-mail, og din adgangskode vil forblive uændret'
},
dashboard: {
addWidget: 'Tilføj Widget',
deleteWidget: 'Slet widget {{id}}',
searchWidgets: 'Søg widgets...'
},
error: {
accountAlreadyActivated: 'Denne konto er allerede blevet aktiveret.',
autosaving: 'Der opstod et problem under autosaving af dette dokument.',
correctInvalidFields: 'Venligst korriger ugyldige felter.',
deletingFile: 'Der opstod en fejl under sletning af filen.',
deletingTitle: 'Der opstod en fejl under sletningen {{title}}. Tjek din forbindelse eller prøv igen.',
documentNotFound: 'Dokumentet med ID {{id}} kunne ikke findes. Det kan være slettet eller har aldrig eksisteret, eller du har muligvis ikke adgang til det.',
emailOrPasswordIncorrect: 'Email eller adgangskode er forkert.',
followingFieldsInvalid_one: 'Feltet er ugyldigt:',
followingFieldsInvalid_other: 'Felterne er ugyldige:',
incorrectCollection: 'Forkert samling',
insufficientClipboardPermissions: 'Adgang til udklipsholder nægtet. Kontroller dine udklipsholderrettigheder.',
invalidClipboardData: 'Ugyldige data i udklipsholderen.',
invalidFileType: 'Ugyldig filtype',
invalidFileTypeValue: 'Ugyldig filtype: {{value}}',
invalidRequestArgs: 'Ugyldige argumenter i anmodningen: {{args}}',
loadingDocument: 'Der opstod et problem med at loade dokumentet med ID {{id}}.',
localesNotSaved_one: 'Følgende lokalitet kunne ikke gemmes:',
localesNotSaved_other: 'Følgende lokaliteter kunne ikke gemmes:',
logoutFailed: 'Log ud mislykket.',
missingEmail: 'Mangler email.',
missingIDOfDocument: 'Mangler ID af dokument til opdatering.',
missingIDOfVersion: 'ID for version mangler.',
missingRequiredData: 'Mangler påkrævet data.',
noFilesUploaded: 'Ingen filer blev uploadet.',
noMatchedField: 'Ingen matchende felt fundet for "{{label}}"',
notAllowedToAccessPage: 'Du har ikke adgang til denne side.',
notAllowedToPerformAction: 'Du har ikke adgang til denne handling.',
notFound: 'Den anmodede ressource blev ikke fundet.',
noUser: 'Ingen bruger',
previewing: 'Der opstod et problem med at vise dokumentet.',
problemUploadingFile: 'Der opstod et problem under uploadingen af filen.',
restoringTitle: 'Der opstod en fejl under genoprettelsen af {{title}}. Kontroller venligst din forbindelse og prøv igen.',
revertingDocument: 'Der var et problem med at gendanne dette dokument.',
tokenInvalidOrExpired: 'Token er enten ugyldig eller udløbet.',
tokenNotProvided: 'Token ikke angivet.',
unableToCopy: 'Kan ikke kopiere.',
unableToDeleteCount: 'Kunne ikke slette {{count}} mangler {{total}} {{label}}.',
unableToReindexCollection: 'Fejl ved genindeksering af samling {{collection}}. Operationen blev afbrudt.',
unableToUpdateCount: 'Kunne ikke slette {{count}} mangler {{total}} {{label}}.',
unauthorized: 'Uautoriseret, log in for at gennemføre handlingen.',
unauthorizedAdmin: 'Uautoriseret, denne bruger har ikke adgang til adminpanelet.',
unknown: 'En ukendt fejl er opstået.',
unPublishingDocument: 'Der opstod et problem med at ophæve udgivelsen af dette dokument.',
unspecific: 'En fejl er opstået.',
unverifiedEmail: 'Bekræft venligst din e-mail, før du logger ind.',
userEmailAlreadyRegistered: 'Email allerede registreret.',
userLocked: 'Denne bruger er låst på grund af for mange fejlede loginforsøg',
usernameAlreadyRegistered: 'Brugernavn allerede registeret.',
usernameOrPasswordIncorrect: 'Bruger navn eller adgangskode er forkert.',
valueMustBeUnique: 'Værdien skal være unik',
verificationTokenInvalid: 'Verifikationstoken er ugyldigt.'
},
fields: {
addLabel: 'Tilføj {{label}}',
addLink: 'Tilføj Link',
addNew: 'Tilføj ny',
addNewLabel: 'Tilføj ny {{label}}',
addRelationship: 'Tilføj forhold',
addUpload: 'Tilføj upload',
block: 'Blok',
blocks: 'blokke',
blockType: 'Blok type',
chooseBetweenCustomTextOrDocument: 'Vælg mellem at indtaste en brugerdefineret tekst-URL eller linke til et andet dokument.',
chooseDocumentToLink: 'Vælg et dokument at linke til',
chooseFromExisting: 'Vælg fra eksiterende',
chooseLabel: 'Vælg {{label}}',
collapseAll: 'Skjul alt"',
customURL: 'Brugerdefineret URL',
editLabelData: 'Rediger {{label}} data',
editLink: 'Rediger link',
editRelationship: 'Rediger forhold',
enterURL: 'Indtast URL',
internalLink: 'Intern link',
itemsAndMore: '{{items}} og {{count}} mere',
labelRelationship: '{{label}} forhold',
latitude: 'breddegrad',
linkedTo: 'Linket til <0>{{label}}</0>',
linkType: 'Link type',
longitude: 'Længdegrad',
newLabel: 'Ny {{label}}',
openInNewTab: 'Åben i ny fane',
passwordsDoNotMatch: 'Adgangskoder matcher ikke.',
relatedDocument: 'Relateret dokument',
relationTo: 'Relateret til',
removeRelationship: 'Fjern forhold',
removeUpload: 'Fjern upload',
saveChanges: 'Gem ændringer',
searchForBlock: 'Søg efter blok',
searchForLanguage: 'Søg efter et sprog',
selectExistingLabel: 'Vælg eksisterende {{label}}',
selectFieldsToEdit: 'Vælg felter at redigere',
showAll: 'Vis alle',
swapRelationship: 'Byt forhold',
swapUpload: 'Byt upload',
textToDisplay: 'Tekst der skal vises',
toggleBlock: 'Skift blok',
uploadNewLabel: 'Upload ny {{label}}'
},
folder: {
browseByFolder: 'Gennemse efter Mappe',
byFolder: 'Ved Mappe',
deleteFolder: 'Slet mappe',
folderName: 'Mappenavn',
folders: 'Mapper',
folderTypeDescription: 'Vælg hvilken type samling af dokumenter der bør være tilladt i denne mappe.',
itemHasBeenMoved: '{{title}} er blevet flyttet til {{folderName}}',
itemHasBeenMovedToRoot: '{{title}} er blevet flyttet til rodmappen',
itemsMovedToFolder: '{{title}} flyttet til {{folderName}}',
itemsMovedToRoot: '{{title}} flyttet til rod-mappen',
moveFolder: 'Flyt Mappe',
moveItemsToFolderConfirmation: 'Du er ved at flytte <1>{{count}} {{label}}</1> til <2>{{toFolder}}</2>. Er du sikker?',
moveItemsToRootConfirmation: 'Du er ved at flytte <1>{{count}} {{label}}</1> til rodmappen. Er du sikker?',
moveItemToFolderConfirmation: 'Du er ved at flytte <1>{{title}}</1> til <2>{{toFolder}}</2>. Er du sikker?',
moveItemToRootConfirmation: 'Du er ved at flytte <1>{{title}}</1> til rodmappen. Er du sikker?',
movingFromFolder: 'Flytter {{title}} fra {{fromFolder}}',
newFolder: 'Ny Mappe',
noFolder: 'Ingen Mappe',
renameFolder: 'Omdøb mappe',
searchByNameInFolder: 'Søg efter Navn i {{folderName}}',
selectFolderForItem: 'Vælg mappe til {{title}}'
},
general: {
name: 'Navn',
aboutToDelete: 'Du er ved at slette {{label}} <1>{{title}}</1>. Er du sikker?',
aboutToDeleteCount_many: 'Du er ved at slette {{count}} {{label}}',
aboutToDeleteCount_one: 'Du er ved at slette {{count}} {{label}}',
aboutToDeleteCount_other: 'Du er ved at slette {{count}} {{label}}',
aboutToPermanentlyDelete: 'Du er ved at slette {{label}} <1>{{title}}</1> permanent. Er du sikker?',
aboutToPermanentlyDeleteTrash: 'Du er ved at slette <0>{{count}}</0> <1>{{label}}</1> permanent fra papirkurven. Er du sikker?',
aboutToRestore: 'Du er ved at gendanne {{label}} <1>{{title}}</1>. Er du sikker?',
aboutToRestoreAsDraft: 'Du er ved at gendanne {{label}} <1>{{title}}</1> som et udkast. Er du sikker?',
aboutToRestoreAsDraftCount: 'Du er ved at gendanne {{count}} {{label}} som udkast',
aboutToRestoreCount: 'Du er ved at gendanne {{count}} {{label}}',
aboutToTrash: 'Du er ved at flytte {{label}} <1>{{title}}</1> til skraldespanden. Er du sikker?',
aboutToTrashCount: 'Du er ved at flytte {{count}} {{label}} til skraldespanden',
addBelow: 'Tilføj under',
addFilter: 'Tilføj filter',
adminTheme: 'Admin tema',
all: 'Alle',
allCollections: 'Alle samlinger',
allLocales: 'Alle lokaliteter',
and: 'Og',
anotherUser: 'En anden bruger',
anotherUserTakenOver: 'En anden bruger har overtaget denne ressource.',
applyChanges: 'Tilføj ændringer',
ascending: 'Stigende',
automatic: 'Automatisk',
backToDashboard: 'Tilbage til dashboard',
cancel: 'Anuller',
changesNotSaved: 'Dine ændringer er ikke blevet gemt. Hvis du forlader siden, vil din ændringer gå tabt.',
clear: 'Klar',
clearAll: 'Ryd alt',
close: 'Luk',
collapse: 'Skjul',
collections: 'Samlinger',
columns: 'Kolonner',
columnToSort: 'Kolonne at sortere',
confirm: 'Bekræft',
confirmCopy: 'Bekræft kopi',
confirmDeletion: 'Bekræft sletning',
confirmDuplication: 'Bekræft duplikering',
confirmMove: 'Bekræft flytning',
confirmReindex: 'Genindeksér alle {{collections}}?',
confirmReindexAll: 'Genindeksér alle samlinger?',
confirmReindexDescription: 'Dette vil fjerne eksisterende indekser og genindeksere dokumenter i {{collections}}-samlingerne.',
confirmReindexDescriptionAll: 'Dette vil fjerne eksisterende indekser og genindeksere dokumenter i alle samlinger.',
confirmRestoration: 'Bekræft gendannelse',
copied: 'Kopieret',
copy: 'Kopier',
copyField: 'Kopiér felt',
copying: 'Kopiering',
copyRow: 'Kopiér række',
copyWarning: 'Du er lige ved at overskrive {{to}} med {{from}} for {{label}} {{title}}. Er du sikker?',
create: 'Opret',
created: 'Oprettet',
createdAt: 'Oprettet til',
createNew: 'Opret ny',
createNewLabel: 'Opret ny {{label}}',
creating: 'Opretter',
creatingNewLabel: 'Opretter ny {{label}}',
currentlyEditing: 'Du redigerer i øjeblikket',
custom: 'Tilpasset',
dark: 'Mørk',
dashboard: 'Dashboard',
delete: 'Slet',
deleted: 'Slettet',
deletedAt: 'Slettet Ved',
deletedCountSuccessfully: 'Slettet {{count}} {{label}}.',
deletedSuccessfully: 'Slettet.',
deleteLabel: 'Slet {{label}}',
deletePermanently: 'Spring affald over og slet permanent',
deleting: 'Sletter...',
depth: 'Dybde',
descending: 'Faldende',
deselectAllRows: 'Fjern markering af alle rækker',
document: 'Dokument',
documentIsTrashed: 'Denne {{label}} er smidt væk og er kun til læsning.',
documentLocked: 'Dette dokument er låst',
documents: 'Dokumenter',
duplicate: 'Duplikér',
duplicateWithoutSaving: 'Dupliker uden at gemme ændringer',
edit: 'Redigere',
editAll: 'Rediger alle',
editedSince: 'Dette dokument er blevet redigeret siden du startede',
editing: 'Rediger',
editingLabel_many: 'Rediger {{count}} {{label}}',
editingLabel_one: 'Rediger {{count}} {{label}}',
editingLabel_other: 'Rediger {{count}} {{label}}',
editingTakenOver: 'En anden bruger har overtaget redigeringen af dette dokument',
editLabel: 'Redigere {{label}}',
email: 'Email',
emailAddress: 'e-mailadresse',
emptyTrash: 'Tøm skraldespanden',
emptyTrashLabel: 'Tøm {{label}} skraldespanden',
enterAValue: 'Indtast en værdi',
error: 'Fejl',
errors: 'Fejl',
exitLivePreview: 'Afslut Live Preview',
export: 'Eksport',
fallbackToDefaultLocale: 'Tilbagefald til standardlokalitet',
false: 'Falsk',
filter: 'Filter',
filters: 'Filtre',
filterWhere: 'Filter {{label}} hvor',
globals: 'Globale',
goBack: 'Gå tilbage',
groupByLabel: 'Gruppér efter {{label}}',
import: 'Import',
isEditing: 'redigerer',
item: 'Vare',
items: 'elementer',
language: 'Sprog',
lastModified: 'Sidst ændret',
layout: 'Layout',
leaveAnyway: 'Forlad alligevel',
leaveWithoutSaving: 'Forlad uden at gemme',
light: 'Lys',
livePreview: 'Live-forhåndsvisning',
loading: 'Loader',
locale: 'Lokalitet',
locales: 'Lokaliteter',
lock: 'Lås',
menu: 'Menu',
moreOptions: 'Flere muligheder',
move: 'Flyt',
moveConfirm: 'Du er ved at flytte {{count}} {{label}} til <1>{{destination}}</1>. Er du sikker?',
moveCount: 'Flyt {{count}} {{label}}',
moveDown: 'Ryk ned',
moveUp: 'Ryk op',
moving: 'Flytter',
movingCount: 'Flytter {{count}} {{label}}',
newLabel: 'Ny {{label}}',
newPassword: 'Ny adgangskode',
next: 'Næste',
no: 'Nej',
noDateSelected: 'Ingen dato valgt',
noFiltersSet: 'Ingen filtre angivet',
noLabel: '<Ingen {{label}}>',
none: 'Ingen',
noOptions: 'Ingen muligheder',
noResults: 'No {{label}} fundet. Enten findes der endnu ingen {{label}}, eller også matcher ingen af de filtre angivet ovenfor.',
noResultsDescription: 'Enten findes der ingen, eller ingen matcher de filtre, du har angivet ovenfor.',
noResultsFound: 'Ingen resultater.',
notFound: 'Ikke fundet',
nothingFound: 'Intet fundet',
noTrashResults: 'Ingen {{label}} i papirkurven.',
noUpcomingEventsScheduled: 'Ingen kommende begivenheder planlagt.',
noValue: 'Ingen værdi',
of: 'Af',
only: 'kun',
open: 'Åben',
or: 'Eller',
order: 'Rækkefølge',
overwriteExistingData: 'Overskriv eksisterende feltdata',
pageNotFound: 'Siden blev ikke fundet',
password: 'Adgangskode',
pasteField: 'Indsæt felt',
pasteRow: 'Indsæt række',
payloadSettings: 'Payload-indstillinger',
permanentlyDelete: 'Permanent Sletning',
permanentlyDeletedCountSuccessfully: 'Permanent slettet {{count}} {{label}} succesfuldt.',
perPage: 'Per side: {{limit}}',
previous: 'Tidligere',
reindex: 'Genindekser',
reindexingAll: 'Genindekserer alle {{collections}}.',
remove: 'Fjern',
rename: 'Omdøb',
reset: 'Nulstil',
resetPreferences: 'Nulstil præferencer',
resetPreferencesDescription: 'Dette vil nulstille alle dine præferencer til standardindstillingerne.',
resettingPreferences: 'Nulstiller præferencer.',
restore: 'Gendan',
restoreAsPublished: 'Gendan som udgivet version',
restoredCountSuccessfully: 'Gendannede {{count}} {{label}} succesfuldt.',
restoring: 'Respekter betydningen af den originale tekst inden for konteksten Payload. Her er en liste over almindelige Payload-udtryk, der bærer meget specifikke betydninger:\n - Samling: En samling er en gruppe af dokumenter, der deler en fælles struktur og formål. Samlinger anvendes til at organisere og administrere indhold i Payload.\n - Felt: Et felt er et specifikt stykke data i et dokument i en samling. Felter definerer struktur og type af data, der kan gemmes i et dokument.\n - Dokument: Et dokument er en individuel post inden for',
row: 'Række',
rows: 'Rækker',
save: 'Gem',
saveChanges: 'Gem ændringer',
saving: 'Gemmer...',
schedulePublishFor: 'Planlæg offentliggørelse for {{title}}',
searchBy: 'Søg efter {{label}}',
select: 'Vælg',
selectAll: 'Vælg alle {{count}} {{label}}',
selectAllRows: 'Vælg alle rækker',
selectedCount: '{{count}} {{label}} valgt',
selectLabel: 'Vælg {{label}}',
selectValue: 'Vælg en værdi',
showAllLabel: 'Vis alle {{label}}',
sorryNotFound: 'Beklager—der er intet, der svarer til din handling.',
sort: 'Sorter',
sortByLabelDirection: 'Sorter efter {{label}} {{direction}}',
stayOnThisPage: 'Forbliv på siden',
submissionSuccessful: 'Indsendt.',
submit: 'Send',
submitting: 'Sender...',
success: 'Succes',
successfullyCreated: '{{label}} oprettet.',
successfullyDuplicated: '{{label}} duplikeret.',
successfullyReindexed: '{{count}} ud af {{total}} dokumenter fra {{collections}} blev succesfuldt genindekseret, og {{skips}} kladder blev sprunget over.',
takeOver: 'Overtag',
thisLanguage: 'Dansk',
time: 'Tid',
timezone: 'Tidszone',
titleDeleted: '{{label}} "{{title}}" slettet.',
titleRestored: '{{label}} "{{title}}" succesfuldt genoprettet.',
titleTrashed: '{{label}} "{{title}}" flyttet til papirkurven.',
trash: 'Affald',
trashedCountSuccessfully: '{{count}} {{label}} flyttet til papirkurven.',
true: 'Sandt',
unauthorized: 'Uautoriseret',
unlock: 'Oplås',
unsavedChanges: 'Du har ikke gemte ændringer. Gem eller kassér før fortsættelse.',
unsavedChangesDuplicate: 'Du har ikke-gemte ændringer. Vil du fortsætte med at duplikere?',
untitled: 'Uden titel',
upcomingEvents: 'Kommende Begivenheder',
updatedAt: 'Opdateret ved',
updatedCountSuccessfully: 'Opdateret {{count}} {{label}} successfully.',
updatedLabelSuccessfully: 'Opdaterede {{label}} med succes.',
updatedSuccessfully: 'Opdateret.',
updateForEveryone: 'Opdatering for alle',
updating: 'Opdaterer',
uploading: 'Uploader',
uploadingBulk: 'Uploader {{current}} af {{total}}',
user: 'Bruger',
username: 'Brugernavn',
users: 'Brugere',
value: 'Værdi',
viewing: 'Visning',
viewReadOnly: 'Vis kun-læsning',
welcome: 'Velkommen',
yes: 'Ja'
},
localization: {
cannotCopySameLocale: 'Kan ikke kopiere til den samme lokalitet',
copyFrom: 'Kopier fra',
copyFromTo: 'Kopierer fra {{from}} til {{to}}',
copyTo: 'Kopier til',
copyToLocale: 'Kopier til lokal',
localeToPublish: 'Offentliggør på lokalitet',
selectedLocales: 'Valgte sprogområder',
selectLocaleToCopy: 'Vælg lokalitet til kopiering',
selectLocaleToDuplicate: 'Vælg lokaliteter til at duplikere'
},
operators: {
contains: 'Indeholder',
equals: 'Lig med',
exists: 'Eksisterer',
intersects: 'Intersekterer',
isGreaterThan: 'Er større end',
isGreaterThanOrEqualTo: 'Er større end eller lig med',
isIn: 'Er i',
isLessThan: 'Er mindre end',
isLessThanOrEqualTo: 'Er mindre end eller lig med',
isLike: 'Ligner',
isNotEqualTo: 'Er ikke lig med',
isNotIn: 'Er ikke i',
isNotLike: 'er ikke som',
near: 'Tæt på',
within: 'Inden for'
},
upload: {
addFile: 'Tilføj fil',
addFiles: 'Tilføj Filer',
bulkUpload: 'Masseupload',
crop: 'Beskær',
cropToolDescription: 'Træk i hjørnerne af det valgte område, tegn et nyt område eller juster værdierne nedenfor.',
download: 'Download',
dragAndDrop: 'Træk og slip en fil',
dragAndDropHere: 'Eller træk og slip en fil her',
editImage: 'Rediger billede',
fileName: 'Filnavn',
fileSize: 'Filstørrelse',
filesToUpload: 'Filer til upload',
fileToUpload: 'Fil til upload',
focalPoint: 'Fokuspunkt',
focalPointDescription: 'Træk fokuspunktet direkte på forhåndsvisningen eller juster værdierne nedenfor.',
height: 'Højde',
lessInfo: 'Mindre info',
moreInfo: 'Mere info',
noFile: 'Ingen fil',
pasteURL: 'Indsæt URL',
previewSizes: 'Forhåndsvisningsstørrelser',
selectCollectionToBrowse: 'Vælg en samling for at browse',
selectFile: 'Vælg en fil',
setCropArea: 'Indstil beskæringsområde',
setFocalPoint: 'Indstil fokuspunkt',
sizes: 'Størrelse',
sizesFor: 'Størrelse for {{label}}',
width: 'Bredde'
},
validation: {
emailAddress: 'Indtast venligst en gyldig e-mailadresse.',
enterNumber: 'Indtast venligst et gyldigt nummer.',
fieldHasNo: 'Dette felt har ingen {{label}}',
greaterThanMax: '{{value}} er større end det maksimalt tilladte {{label}} of {{max}}.',
invalidBlock: 'Blokken "{{block}}" er ikke tilladt.',
invalidBlocks: 'Dette felt indeholder blokke, der ikke længere er tilladte: {{blocks}}.',
invalidInput: 'Dette felt har et ugyldigt indtastning.',
invalidSelection: 'Dette felt har en ugyldig valg.',
invalidSelections: 'Dette felt har følgende ugyldige valg:',
latitudeOutOfBounds: 'Breddegrad skal være mellem -90 og 90.',
lessThanMin: '{{value}} er mindre end den minimum tilladte {{label}} of {{min}}.',
limitReached: 'Grænse nået, kun {{max}} elementer kan tilføjes.',
longerThanMin: 'Denne værdi skal være længere end den minimale længde på {{minLength}} tegn.',
longitudeOutOfBounds: 'Længdegrad skal være mellem -180 og 180.',
notValidDate: '"{{value}}" er ikke en gyldig dato.',
required: 'Dette felt er påkrævet.',
requiresAtLeast: 'Dette felt kræver mindst {{count}} {{label}}.',
requiresNoMoreThan: 'Dette felt kræver maks {{count}} {{label}}.',
requiresTwoNumbers: 'Dette felt kræver to numre.',
shorterThanMax: 'Denne værdi skal være kortere end den maksimale længde af {{maxLength}} tegn.',
timezoneRequired: 'En tidszone er nødvendig.',
trueOrFalse: 'Denne værdi kan kun være lig med sandt eller falsk.',
username: 'Indtast et brugernavn. Kan indeholde bogstaver, tal, bindestreger, punktum og underscores.',
validUploadID: 'Dette felt er ikke en gyldig upload-ID.'
},
version: {
type: 'Type',
aboutToPublishSelection: 'Du er ved at offentliggøre alt {{label}} i denne sektion. Er du sikker?',
aboutToRestore: 'Du er ved at gendanne dette {{label}} dokument til den tilstand, det var i den {{versionDate}}.',
aboutToRestoreGlobal: 'Du er ved at gendanne den globale {{label}} til den tilstand, den var i den {{versionDate}}.',
aboutToRevertToPublished: 'Du er ved at tilbagerulle dette dokuments ændringer til dets offentliggjorte tilstand. Er du sikker?',
aboutToUnpublish: 'Du er ved at afpublicere dette dokument. Er du sikker?',
aboutToUnpublishIn: 'Du er ved at afpublicere dette dokument i {{locale}}. Er du sikker?',
aboutToUnpublishSelection: 'Du er ved at afpublicere alt {{label}} i denne sektion. Er du sikker?',
autosave: 'Autosave',
autosavedSuccessfully: 'Autosaved gennemført.',
autosavedVersion: 'Autosaved version',
changed: 'Ændret',
changedFieldsCount_one: '{{count}} ændret felt',
changedFieldsCount_other: '{{count}} ændrede felter',
compareVersion: 'Sammenlign version med:',
compareVersions: 'Sammenlign versioner',
comparingAgainst: 'Sammenligner med',
confirmPublish: 'Bekræft offentliggørelse',
confirmRevertToSaved: 'Bekræft tilbagerulning til gemt',
confirmUnpublish: 'Bekræft afpublicering',
confirmVersionRestoration: 'Bekræft versionens gendannelse',
currentDocumentStatus: 'Nuværende {{docStatus}} dokument',
currentDraft: 'Nuværende kladde',
currentlyPublished: 'Aktuelt Offentliggjort',
currentlyViewing: 'Aktuelt visning',
currentPublishedVersion: 'Nuværende offentliggjort version',
draft: 'Kladde',
draftHasPublishedVersion: 'Udkast (har offentliggjort version)',
draftSavedSuccessfully: 'Kladde gemt.',
lastSavedAgo: 'Sidst gemt {{distance}}',
modifiedOnly: 'Kun ændret',
moreVersions: 'Flere versioner...',
noFurtherVersionsFound: 'Ingen yderligere versioner fundet',
noLabelGroup: 'Unavngivet Gruppe',
noRowsFound: 'Ingen {{label}} fundet',
noRowsSelected: 'Ingen {{label}} valgt',
preview: 'Forhåndsvisning',
previouslyDraft: 'Tidligere et udkast',
previouslyPublished: 'Tidligere offentliggjort',
previousVersion: 'Tidligere version',
problemRestoringVersion: 'Der opstod et problem med at gendanne denne version',
publish: 'Offentliggør',
publishAllLocales: 'Udgiv alle lokalindstillinger',
publishChanges: 'Offentliggør ændringer',
published: 'Offentliggjort',
publishIn: 'Offentliggør i',
publishing: 'Offentliggør',
restoreAsDraft: 'Gendan som kladde',
restoredSuccessfully: 'Gendannet.',
restoreThisVersion: 'Gendan denne version',
restoring: 'Gendanner...',
reverting: 'Tilbageruller...',
revertToPublished: 'Tilbagerul til offentliggjort',
revertUnsuccessful: 'Gendan mislykkedes. Ingen tidligere offentliggjort version fundet.',
saveDraft: 'Gem kladde',
scheduledSuccessfully: 'Planlagt med succes.',
schedulePublish: 'Planlæg offentliggørelse',
selectLocales: 'Vælg lokaliteter, der skal vises',
selectVersionToCompare: 'Vælg en version til sammenligning',
showingVersionsFor: 'Viser versioner for:',
showLocales: 'Vis lokaliteter:',
specificVersion: 'Specifik Version',
status: 'Status',
unpublish: 'Afpublicer',
unpublished: 'Upubliceret',
unpublishedSuccessfully: 'Upubliceret med succes.',
unpublishIn: 'Fjern offentliggørelse i {{locale}}',
unpublishing: 'Afpublicerer...',
version: 'Version',
versionAgo: '{{distance}} siden',
versionCount_many: '{{count}} versioner fundet',
versionCount_none: 'Ingen versioner fundet',
versionCount_one: '{{count}} version fundet',
versionCount_other: '{{count}} version fundet',
versionID: 'Versions-ID',
versions: 'Versioner',
viewingVersion: 'Se versionen for {{entityLabel}} {{documentTitle}}',
viewingVersionGlobal: 'Se version for det globale {{entityLabel}}',
viewingVersions: 'Se versioner for {{entityLabel}} {{documentTitle}}',
viewingVersionsGlobal: 'Se versioner for det global {{entityLabel}}'
}
};
export const da = {
dateFNSKey: 'da',
translations: daTranslations
};
//# sourceMappingURL=da.js.map

View File

@@ -0,0 +1,5 @@
import React from 'react';
import type { Props } from './types.js';
export type { Props };
export declare const CodeEditor: React.FC<Props>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,3 @@
import type { NextConfig } from 'next';
import type { PluginConfig } from './types.js';
export default function getNextConfig(pluginConfig: PluginConfig, nextConfig?: NextConfig): NextConfig & Partial<NextConfig>;

View File

@@ -0,0 +1,99 @@
# Class: BalancedPool
Extends: `undici.Dispatcher`
A pool of [Pool](/docs/docs/api/Pool.md) instances connected to multiple upstreams.
Requests are not guaranteed to be dispatched in order of invocation.
## `new BalancedPool(upstreams [, options])`
Arguments:
* **upstreams** `URL | string | string[]` - It should only include the **protocol, hostname, and port**.
* **options** `BalancedPoolOptions` (optional)
### Parameter: `BalancedPoolOptions`
Extends: [`PoolOptions`](/docs/docs/api/Pool.md#parameter-pooloptions)
* **factory** `(origin: URL, opts: Object) => Dispatcher` - Default: `(origin, opts) => new Pool(origin, opts)`
The `PoolOptions` are passed to each of the `Pool` instances being created.
## Instance Properties
### `BalancedPool.upstreams`
Returns an array of upstreams that were previously added.
### `BalancedPool.closed`
Implements [Client.closed](/docs/docs/api/Client.md#clientclosed)
### `BalancedPool.destroyed`
Implements [Client.destroyed](/docs/docs/api/Client.md#clientdestroyed)
### `Pool.stats`
Returns [`PoolStats`](/docs/docs/api/PoolStats.md) instance for this pool.
## Instance Methods
### `BalancedPool.addUpstream(upstream)`
Add an upstream.
Arguments:
* **upstream** `string` - It should only include the **protocol, hostname, and port**.
### `BalancedPool.removeUpstream(upstream)`
Removes an upstream that was previously added.
### `BalancedPool.close([callback])`
Implements [`Dispatcher.close([callback])`](/docs/docs/api/Dispatcher.md#dispatcherclosecallback-promise).
### `BalancedPool.destroy([error, callback])`
Implements [`Dispatcher.destroy([error, callback])`](/docs/docs/api/Dispatcher.md#dispatcherdestroyerror-callback-promise).
### `BalancedPool.connect(options[, callback])`
See [`Dispatcher.connect(options[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherconnectoptions-callback).
### `BalancedPool.dispatch(options, handlers)`
Implements [`Dispatcher.dispatch(options, handlers)`](/docs/docs/api/Dispatcher.md#dispatcherdispatchoptions-handler).
### `BalancedPool.pipeline(options, handler)`
See [`Dispatcher.pipeline(options, handler)`](/docs/docs/api/Dispatcher.md#dispatcherpipelineoptions-handler).
### `BalancedPool.request(options[, callback])`
See [`Dispatcher.request(options [, callback])`](/docs/docs/api/Dispatcher.md#dispatcherrequestoptions-callback).
### `BalancedPool.stream(options, factory[, callback])`
See [`Dispatcher.stream(options, factory[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherstreamoptions-factory-callback).
### `BalancedPool.upgrade(options[, callback])`
See [`Dispatcher.upgrade(options[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherupgradeoptions-callback).
## Instance Events
### Event: `'connect'`
See [Dispatcher Event: `'connect'`](/docs/docs/api/Dispatcher.md#event-connect).
### Event: `'disconnect'`
See [Dispatcher Event: `'disconnect'`](/docs/docs/api/Dispatcher.md#event-disconnect).
### Event: `'drain'`
See [Dispatcher Event: `'drain'`](/docs/docs/api/Dispatcher.md#event-drain).

View File

@@ -0,0 +1,170 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["ق", "ب"],
abbreviated: ["ق.م.", "ب.م."],
wide: ["قبل از میلاد", "بعد از میلاد"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["سم1", "سم2", "سم3", "سم4"],
wide: ["سه‌ماهه 1", "سه‌ماهه 2", "سه‌ماهه 3", "سه‌ماهه 4"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["ژ", "ف", "م", "آ", "م", "ج", "ج", "آ", "س", "ا", "ن", "د"],
abbreviated: [
"ژانـ",
"فور",
"مارس",
"آپر",
"می",
"جون",
"جولـ",
"آگو",
"سپتـ",
"اکتـ",
"نوامـ",
"دسامـ",
],
wide: [
"ژانویه",
"فوریه",
"مارس",
"آپریل",
"می",
"جون",
"جولای",
"آگوست",
"سپتامبر",
"اکتبر",
"نوامبر",
"دسامبر",
],
};
const dayValues = {
narrow: ["ی", "د", "س", "چ", "پ", "ج", "ش"],
short: ["1ش", "2ش", "3ش", "4ش", "5ش", "ج", "ش"],
abbreviated: [
"یکشنبه",
"دوشنبه",
"سه‌شنبه",
"چهارشنبه",
"پنجشنبه",
"جمعه",
"شنبه",
],
wide: ["یکشنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"],
};
const dayPeriodValues = {
narrow: {
am: "ق",
pm: "ب",
midnight: "ن",
noon: "ظ",
morning: "ص",
afternoon: "ب.ظ.",
evening: "ع",
night: "ش",
},
abbreviated: {
am: "ق.ظ.",
pm: "ب.ظ.",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
wide: {
am: "قبل‌ازظهر",
pm: "بعدازظهر",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ق",
pm: "ب",
midnight: "ن",
noon: "ظ",
morning: "ص",
afternoon: "ب.ظ.",
evening: "ع",
night: "ش",
},
abbreviated: {
am: "ق.ظ.",
pm: "ب.ظ.",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
wide: {
am: "قبل‌ازظهر",
pm: "بعدازظهر",
midnight: "نیمه‌شب",
noon: "ظهر",
morning: "صبح",
afternoon: "بعدازظهر",
evening: "عصر",
night: "شب",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
return String(dirtyNumber);
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,30 @@
import { formatDistance } from "./hu/_lib/formatDistance.js";
import { formatLong } from "./hu/_lib/formatLong.js";
import { formatRelative } from "./hu/_lib/formatRelative.js";
import { localize } from "./hu/_lib/localize.js";
import { match } from "./hu/_lib/match.js";
/**
* @category Locales
* @summary Hungarian locale.
* @language Hungarian
* @iso-639-2 hun
* @author Pavlo Shpak [@pshpak](https://github.com/pshpak)
* @author Eduardo Pardo [@eduardopsll](https://github.com/eduardopsll)
* @author Zoltan Szepesi [@twodcube](https://github.com/twodcube)
*/
export const hu = {
code: "hu",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default hu;

View File

@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Share2 = createLucideIcon("Share2", [
["circle", { cx: "18", cy: "5", r: "3", key: "gq8acd" }],
["circle", { cx: "6", cy: "12", r: "3", key: "w7nqdw" }],
["circle", { cx: "18", cy: "19", r: "3", key: "1xt0gg" }],
["line", { x1: "8.59", x2: "15.42", y1: "13.51", y2: "17.49", key: "47mynk" }],
["line", { x1: "15.41", x2: "8.59", y1: "6.51", y2: "10.49", key: "1n3mei" }]
]);
export { Share2 as default };
//# sourceMappingURL=share-2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/mysql-core/primary-keys.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport type { AnyMySqlColumn, MySqlColumn } from './columns/index.ts';\nimport { MySqlTable } from './table.ts';\n\nexport function primaryKey<\n\tTTableName extends string,\n\tTColumn extends AnyMySqlColumn<{ tableName: TTableName }>,\n\tTColumns extends AnyMySqlColumn<{ tableName: TTableName }>[],\n>(config: { name?: string; columns: [TColumn, ...TColumns] }): PrimaryKeyBuilder;\n/**\n * @deprecated: Please use primaryKey({ columns: [] }) instead of this function\n * @param columns\n */\nexport function primaryKey<\n\tTTableName extends string,\n\tTColumns extends AnyMySqlColumn<{ tableName: TTableName }>[],\n>(...columns: TColumns): PrimaryKeyBuilder;\nexport function primaryKey(...config: any) {\n\tif (config[0].columns) {\n\t\treturn new PrimaryKeyBuilder(config[0].columns, config[0].name);\n\t}\n\treturn new PrimaryKeyBuilder(config);\n}\n\nexport class PrimaryKeyBuilder {\n\tstatic readonly [entityKind]: string = 'MySqlPrimaryKeyBuilder';\n\n\t/** @internal */\n\tcolumns: MySqlColumn[];\n\n\t/** @internal */\n\tname?: string;\n\n\tconstructor(\n\t\tcolumns: MySqlColumn[],\n\t\tname?: string,\n\t) {\n\t\tthis.columns = columns;\n\t\tthis.name = name;\n\t}\n\n\t/** @internal */\n\tbuild(table: MySqlTable): PrimaryKey {\n\t\treturn new PrimaryKey(table, this.columns, this.name);\n\t}\n}\n\nexport class PrimaryKey {\n\tstatic readonly [entityKind]: string = 'MySqlPrimaryKey';\n\n\treadonly columns: MySqlColumn[];\n\treadonly name?: string;\n\n\tconstructor(readonly table: MySqlTable, columns: MySqlColumn[], name?: string) {\n\t\tthis.columns = columns;\n\t\tthis.name = name;\n\t}\n\n\tgetName(): string {\n\t\treturn this.name\n\t\t\t?? `${this.table[MySqlTable.Symbol.Name]}_${this.columns.map((column) => column.name).join('_')}_pk`;\n\t}\n}\n"],"mappings":"AAAA,SAAS,kBAAkB;AAE3B,SAAS,kBAAkB;AAepB,SAAS,cAAc,QAAa;AAC1C,MAAI,OAAO,CAAC,EAAE,SAAS;AACtB,WAAO,IAAI,kBAAkB,OAAO,CAAC,EAAE,SAAS,OAAO,CAAC,EAAE,IAAI;AAAA,EAC/D;AACA,SAAO,IAAI,kBAAkB,MAAM;AACpC;AAEO,MAAM,kBAAkB;AAAA,EAC9B,QAAiB,UAAU,IAAY;AAAA;AAAA,EAGvC;AAAA;AAAA,EAGA;AAAA,EAEA,YACC,SACA,MACC;AACD,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACb;AAAA;AAAA,EAGA,MAAM,OAA+B;AACpC,WAAO,IAAI,WAAW,OAAO,KAAK,SAAS,KAAK,IAAI;AAAA,EACrD;AACD;AAEO,MAAM,WAAW;AAAA,EAMvB,YAAqB,OAAmB,SAAwB,MAAe;AAA1D;AACpB,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACb;AAAA,EARA,QAAiB,UAAU,IAAY;AAAA,EAE9B;AAAA,EACA;AAAA,EAOT,UAAkB;AACjB,WAAO,KAAK,QACR,GAAG,KAAK,MAAM,WAAW,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,WAAW,OAAO,IAAI,EAAE,KAAK,GAAG,CAAC;AAAA,EACjG;AACD;","names":[]}

View File

@@ -0,0 +1,84 @@
import { describe, it, expect } from 'vitest';
import { getSafeRedirect } from './getSafeRedirect';
const fallback = '/admin' // default fallback if the input is unsafe or invalid
;
describe('getSafeRedirect', ()=>{
// Valid - safe redirect paths
it.each([
[
'/dashboard'
],
[
'/admin/settings'
],
[
'/projects?id=123'
],
[
'/hello-world'
]
])('should allow safe relative path: %s', (input)=>{
// If the input is a clean relative path, it should be returned as-is
expect(getSafeRedirect({
redirectTo: input,
fallbackTo: fallback
})).toBe(input);
});
// Invalid types or empty inputs
it.each([
'',
null,
undefined,
123,
{},
[]
])('should fallback on invalid or non-string input: %s', (input)=>{
// If the input is not a valid string, it should return the fallback
expect(getSafeRedirect({
redirectTo: input,
fallbackTo: fallback
})).toBe(fallback);
});
// Unsafe redirect patterns
it.each([
'//example.com',
'/javascript:alert(1)',
'/JavaScript:alert(1)',
'/http://unknown.com',
'/https://unknown.com',
'/%2Funknown.com',
'/\\/unknown.com',
'/\\\\unknown.com',
'/\\unknown.com',
'%2F%2Funknown.com',
'%2Fjavascript:alert(1)'
])('should block unsafe redirect: %s', (input)=>{
// All of these should return the fallback because theyre unsafe
expect(getSafeRedirect({
redirectTo: input,
fallbackTo: fallback
})).toBe(fallback);
});
// Input with extra spaces should still be properly handled
it('should trim whitespace before evaluating', ()=>{
// A valid path with surrounding spaces should still be accepted
expect(getSafeRedirect({
redirectTo: ' /dashboard ',
fallbackTo: fallback
})).toBe('/dashboard');
// An unsafe path with spaces should still be rejected
expect(getSafeRedirect({
redirectTo: ' //example.com ',
fallbackTo: fallback
})).toBe(fallback);
});
// If decoding the input fails (e.g., invalid percent encoding), it should not crash
it('should return fallback on invalid encoding', ()=>{
expect(getSafeRedirect({
redirectTo: '%E0%A4%A',
fallbackTo: fallback
})).toBe(fallback);
});
});
//# sourceMappingURL=getSafeRedirect.spec.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/TimezonePicker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGvC,OAAO,cAAc,CAAA;AAKrB,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA+C1C,CAAA"}

View File

@@ -0,0 +1,35 @@
'use strict'
const { test } = require('tap')
const fs = require('fs')
const SonicBoom = require('../')
const { file } = require('./helper')
const MAX_WRITE = 16 * 1024
test('drain deadlock', (t) => {
t.plan(4)
const dest = file()
const stream = new SonicBoom({ dest, sync: false, minLength: 9999 })
t.ok(stream.write(Buffer.alloc(1500).fill('x').toString()))
t.ok(stream.write(Buffer.alloc(1500).fill('x').toString()))
t.ok(!stream.write(Buffer.alloc(MAX_WRITE).fill('x').toString()))
stream.on('drain', () => {
t.pass()
})
})
test('should throw if minLength >= maxWrite', (t) => {
t.plan(1)
t.throws(() => {
const dest = file()
const fd = fs.openSync(dest, 'w')
SonicBoom({
fd,
minLength: MAX_WRITE
})
})
})

View File

@@ -0,0 +1,26 @@
import React from 'react';
import './index.scss';
export type SelectablePill = {
key?: string;
Label?: React.ReactNode;
name: string;
selected: boolean;
};
export type Props = {
draggable?: {
onDragEnd: (args: {
moveFromIndex: number;
moveToIndex: number;
}) => void;
};
onClick?: (args: {
pill: SelectablePill;
}) => Promise<void> | void;
pills: SelectablePill[];
};
/**
* Displays a wrappable list of pills that can be selected or deselected.
* If `draggable` is true, the pills can be reordered by dragging.
*/
export declare const PillSelector: React.FC<Props>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,282 @@
import type { GraphQLNonNull, GraphQLObjectType } from 'graphql';
import type { DeepRequired, IsAny } from 'ts-essentials';
import type { CustomPreviewButton, CustomSaveButton, CustomSaveDraftButton, CustomStatus, PublishButtonClientProps, PublishButtonServerProps, UnpublishButtonClientProps, UnpublishButtonServerProps } from '../../admin/types.js';
import type { Access, CustomComponent, EditConfig, Endpoint, EntityDescription, EntityDescriptionComponent, GeneratePreviewURL, LabelFunction, LivePreviewConfig, MetaConfig, PayloadComponent, StaticLabel } from '../../config/types.js';
import type { DBIdentifierName } from '../../database/types.js';
import type { Field, FlattenedField } from '../../fields/config/types.js';
import type { GeneratedTypes, GlobalAdminCustom, GlobalCustom, GlobalSlug, RequestContext, TypedGlobal, TypedGlobalSelect } from '../../index.js';
import type { PayloadRequest, SelectIncludeType, Where } from '../../types/index.js';
import type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js';
export type DataFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobal[TSlug];
export type SelectFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobalSelect[TSlug];
/**
* Global slugs that do not have drafts enabled.
* Detects globals without drafts by checking for the absence of the `_status` field.
*/
export type GlobalsWithoutDrafts = {
[TSlug in GlobalSlug]: DataFromGlobalSlug<TSlug> extends {
_status?: any;
} ? never : TSlug;
}[GlobalSlug];
/**
* Conditionally allows or forbids the `draft` property based on global configuration.
* When `strictDraftTypes` is enabled, the `draft` property is forbidden on globals without drafts.
*/
export type DraftFlagFromGlobalSlug<TSlug extends GlobalSlug> = GeneratedTypes extends {
strictDraftTypes: true;
} ? TSlug extends GlobalsWithoutDrafts ? {
/**
* The `draft` property is not allowed because this global does not have `versions.drafts` enabled.
*/
draft?: never;
} : {
/**
* Whether the global should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)
*/
draft?: boolean;
} : {
/**
* Whether the global should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)
*/
draft?: boolean;
};
export type BeforeValidateHook = (args: {
context: RequestContext;
data?: any;
/** The global which this hook is being run on */
global: SanitizedGlobalConfig;
originalDoc?: any;
/**
* Whether access control is being overridden for this operation
*/
overrideAccess?: boolean;
req: PayloadRequest;
}) => any;
export type BeforeChangeHook = (args: {
context: RequestContext;
data: any;
/** The global which this hook is being run on */
global: SanitizedGlobalConfig;
originalDoc?: any;
/**
* Whether access control is being overridden for this operation
*/
overrideAccess?: boolean;
req: PayloadRequest;
}) => any;
export type AfterChangeHook = (args: {
context: RequestContext;
data: any;
doc: any;
/** The global which this hook is being run on */
global: SanitizedGlobalConfig;
/**
* Whether access control is being overridden for this operation
*/
overrideAccess?: boolean;
previousDoc: any;
req: PayloadRequest;
}) => any;
export type BeforeReadHook = (args: {
context: RequestContext;
doc: any;
/** The global which this hook is being run on */
global: SanitizedGlobalConfig;
/**
* Whether access control is being overridden for this operation
*/
overrideAccess?: boolean;
req: PayloadRequest;
}) => any;
export type AfterReadHook = (args: {
context: RequestContext;
doc: any;
findMany?: boolean;
/** The global which this hook is being run on */
global: SanitizedGlobalConfig;
/**
* Whether access control is being overridden for this operation
*/
overrideAccess?: boolean;
query?: Where;
req: PayloadRequest;
}) => any;
export type HookOperationType = 'countVersions' | 'read' | 'restoreVersion' | 'update';
export type BeforeOperationHook = (args: {
args?: any;
context: RequestContext;
/**
* The Global which this hook is being run on
* */
global: SanitizedGlobalConfig;
/**
* Hook operation being performed
*/
operation: HookOperationType;
/**
* Whether access control is being overridden for this operation
*/
overrideAccess?: boolean;
req: PayloadRequest;
}) => any;
export type GlobalAdminOptions = {
/**
* Custom admin components
*/
components?: {
elements?: {
/**
* Inject custom components before the document controls
*/
beforeDocumentControls?: CustomComponent[];
Description?: EntityDescriptionComponent;
/**
* Replaces the "Preview" button
*/
PreviewButton?: CustomPreviewButton;
/**
* Replaces the "Publish" button
* + drafts must be enabled
*/
PublishButton?: PayloadComponent<PublishButtonServerProps, PublishButtonClientProps>;
/**
* Replaces the "Save" button
* + drafts must be disabled
*/
SaveButton?: CustomSaveButton;
/**
* Replaces the "Save Draft" button
* + drafts must be enabled
* + autosave must be disabled
*/
SaveDraftButton?: CustomSaveDraftButton;
/**
* Replaces the "Status" section
*/
Status?: CustomStatus;
/**
* Replaces the "Unpublish" button
* + drafts must be enabled
*/
UnpublishButton?: PayloadComponent<UnpublishButtonServerProps, UnpublishButtonClientProps>;
};
views?: {
/**
* Set to a React component to replace the entire Edit View, including all nested routes.
* Set to an object to replace or modify individual nested routes, or to add new ones.
*/
edit?: EditConfig;
};
};
/** Extension point to add your custom data. Available in server and client. */
custom?: GlobalAdminCustom;
/**
* Custom description for collection
*/
description?: EntityDescription;
/**
* Specify a navigational group for globals in the admin sidebar.
* - Provide a string to place the entity in a custom group.
* - Provide a record to define localized group names.
* - Set to `false` to exclude the entity from the sidebar / dashboard without disabling its routes.
*/
group?: false | Record<string, string> | string;
/**
* Exclude the global from the admin nav and routes
*/
hidden?: ((args: {
user: PayloadRequest['user'];
}) => boolean) | boolean;
/**
* Hide the API URL within the Edit View
*/
hideAPIURL?: boolean;
/**
* Live preview options
*/
livePreview?: LivePreviewConfig;
meta?: MetaConfig;
/**
* Function to generate custom preview URL
*/
preview?: GeneratePreviewURL;
};
export type GlobalConfig<TSlug extends GlobalSlug = any> = {
/**
* Do not set this property manually. This is set to true during sanitization, to avoid
* sanitizing the same global multiple times.
*/
_sanitized?: boolean;
access?: {
read?: Access;
readVersions?: Access;
update?: Access;
};
admin?: GlobalAdminOptions;
/** Extension point to add your custom data. Server only. */
custom?: GlobalCustom;
/**
* Customize the SQL table name
*/
dbName?: DBIdentifierName;
endpoints?: false | Omit<Endpoint, 'root'>[];
fields: Field[];
/**
* Specify which fields should be selected always, regardless of the `select` query which can be useful that the field exists for access control / hooks
*/
forceSelect?: IsAny<SelectFromGlobalSlug<TSlug>> extends true ? SelectIncludeType : SelectFromGlobalSlug<TSlug>;
graphQL?: {
disableMutations?: true;
disableQueries?: true;
name?: string;
} | false;
hooks?: {
afterChange?: AfterChangeHook[];
afterRead?: AfterReadHook[];
beforeChange?: BeforeChangeHook[];
beforeOperation?: BeforeOperationHook[];
beforeRead?: BeforeReadHook[];
beforeValidate?: BeforeValidateHook[];
};
label?: LabelFunction | StaticLabel;
/**
* Enables / Disables the ability to lock documents while editing
* @default true
*/
lockDocuments?: {
duration: number;
} | false;
slug: string;
/**
* Options used in typescript generation
*/
typescript?: {
/**
* Typescript generation name given to the interface type
*/
interface?: string;
};
versions?: boolean | IncomingGlobalVersions;
};
export interface SanitizedGlobalConfig extends Omit<DeepRequired<GlobalConfig>, 'endpoints' | 'fields' | 'slug' | 'versions'> {
endpoints: Endpoint[] | false;
fields: Field[];
/**
* Fields in the database schema structure
* Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded
*/
flattenedFields: FlattenedField[];
slug: GlobalSlug;
versions?: SanitizedGlobalVersions;
}
export type Globals = {
config: SanitizedGlobalConfig[];
graphQL?: {
[slug: string]: {
mutationInputType: GraphQLNonNull<any>;
type: GraphQLObjectType;
versionType?: GraphQLObjectType;
};
} | false;
};
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"findByID.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/findByID.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC9B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,UAAU,EAEV,wBAAwB,EAEzB,MAAM,oBAAoB,CAAA;AAO3B,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAYrF,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAC,GACnD,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAA;AAEjD,eAAO,MAAM,iBAAiB,GAC5B,KAAK,SAAS,cAAc,EAC5B,cAAc,SAAS,OAAO,EAC9B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,gBAEjC,YAAY,KACzB,OAAO,CAAC,kBAAkB,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,CAsS3F,CAAA"}

View File

@@ -0,0 +1,10 @@
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
export { _typeof as default };

View File

@@ -0,0 +1,115 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "simvol", verb: "olmalıdır" },
file: { unit: "bayt", verb: "olmalıdır" },
array: { unit: "element", verb: "olmalıdır" },
set: { unit: "element", verb: "olmalıdır" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "number";
}
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 = {
regex: "input",
email: "email address",
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 datetime",
date: "ISO date",
time: "ISO time",
duration: "ISO duration",
ipv4: "IPv4 address",
ipv6: "IPv6 address",
cidrv4: "IPv4 range",
cidrv6: "IPv6 range",
base64: "base64-encoded string",
base64url: "base64url-encoded string",
json_string: "JSON string",
e164: "E.164 number",
jwt: "JWT",
template_literal: "input",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Yanlış dəyər: gözlənilən ${issue.expected}, daxil olan ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Yanlış dəyər: gözlənilən ${util.stringifyPrimitive(issue.values[0])}`;
return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Çox böyük: gözlənilən ${issue.origin ?? "dəyər"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
return `Çox böyük: gözlənilən ${issue.origin ?? "dəyər"} ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing)
return `Çox kiçik: gözlənilən ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
return `Çox kiçik: gözlənilən ${issue.origin} ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Yanlış mətn: "${_issue.prefix}" ilə başlamalıdır`;
if (_issue.format === "ends_with")
return `Yanlış mətn: "${_issue.suffix}" ilə bitməlidir`;
if (_issue.format === "includes")
return `Yanlış mətn: "${_issue.includes}" daxil olmalıdır`;
if (_issue.format === "regex")
return `Yanlış mətn: ${_issue.pattern} şablonuna uyğun olmalıdır`;
return `Yanlış ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Yanlış ədəd: ${issue.divisor} ilə bölünə bilən olmalıdır`;
case "unrecognized_keys":
return `Tanınmayan açar${issue.keys.length > 1 ? "lar" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} daxilində yanlış açar`;
case "invalid_union":
return "Yanlış dəyər";
case "invalid_element":
return `${issue.origin} daxilində yanlış dəyər`;
default:
return `Yanlış dəyər`;
}
};
};
export default function () {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1,263 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReaddirpStream = exports.EntryTypes = void 0;
exports.readdirp = readdirp;
exports.readdirpPromise = readdirpPromise;
const promises_1 = require("node:fs/promises");
const node_stream_1 = require("node:stream");
const node_path_1 = require("node:path");
exports.EntryTypes = {
FILE_TYPE: 'files',
DIR_TYPE: 'directories',
FILE_DIR_TYPE: 'files_directories',
EVERYTHING_TYPE: 'all',
};
const defaultOptions = {
root: '.',
fileFilter: (_entryInfo) => true,
directoryFilter: (_entryInfo) => true,
type: exports.EntryTypes.FILE_TYPE,
lstat: false,
depth: 2147483648,
alwaysStat: false,
highWaterMark: 4096,
};
Object.freeze(defaultOptions);
const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR';
const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]);
const ALL_TYPES = [
exports.EntryTypes.DIR_TYPE,
exports.EntryTypes.EVERYTHING_TYPE,
exports.EntryTypes.FILE_DIR_TYPE,
exports.EntryTypes.FILE_TYPE,
];
const DIR_TYPES = new Set([
exports.EntryTypes.DIR_TYPE,
exports.EntryTypes.EVERYTHING_TYPE,
exports.EntryTypes.FILE_DIR_TYPE,
]);
const FILE_TYPES = new Set([
exports.EntryTypes.EVERYTHING_TYPE,
exports.EntryTypes.FILE_DIR_TYPE,
exports.EntryTypes.FILE_TYPE,
]);
const isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
const wantBigintFsStats = process.platform === 'win32';
const emptyFn = (_entryInfo) => true;
const normalizeFilter = (filter) => {
if (filter === undefined)
return emptyFn;
if (typeof filter === 'function')
return filter;
if (typeof filter === 'string') {
const fl = filter.trim();
return (entry) => entry.basename === fl;
}
if (Array.isArray(filter)) {
const trItems = filter.map((item) => item.trim());
return (entry) => trItems.some((f) => entry.basename === f);
}
return emptyFn;
};
/** Readable readdir stream, emitting new files as they're being listed. */
class ReaddirpStream extends node_stream_1.Readable {
constructor(options = {}) {
super({
objectMode: true,
autoDestroy: true,
highWaterMark: options.highWaterMark,
});
const opts = { ...defaultOptions, ...options };
const { root, type } = opts;
this._fileFilter = normalizeFilter(opts.fileFilter);
this._directoryFilter = normalizeFilter(opts.directoryFilter);
const statMethod = opts.lstat ? promises_1.lstat : promises_1.stat;
// Use bigint stats if it's windows and stat() supports options (node 10+).
if (wantBigintFsStats) {
this._stat = (path) => statMethod(path, { bigint: true });
}
else {
this._stat = statMethod;
}
this._maxDepth = opts.depth ?? defaultOptions.depth;
this._wantsDir = type ? DIR_TYPES.has(type) : false;
this._wantsFile = type ? FILE_TYPES.has(type) : false;
this._wantsEverything = type === exports.EntryTypes.EVERYTHING_TYPE;
this._root = (0, node_path_1.resolve)(root);
this._isDirent = !opts.alwaysStat;
this._statsProp = this._isDirent ? 'dirent' : 'stats';
this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent };
// Launch stream with one parent, the root dir.
this.parents = [this._exploreDir(root, 1)];
this.reading = false;
this.parent = undefined;
}
async _read(batch) {
if (this.reading)
return;
this.reading = true;
try {
while (!this.destroyed && batch > 0) {
const par = this.parent;
const fil = par && par.files;
if (fil && fil.length > 0) {
const { path, depth } = par;
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));
const awaited = await Promise.all(slice);
for (const entry of awaited) {
if (!entry)
continue;
if (this.destroyed)
return;
const entryType = await this._getEntryType(entry);
if (entryType === 'directory' && this._directoryFilter(entry)) {
if (depth <= this._maxDepth) {
this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
}
if (this._wantsDir) {
this.push(entry);
batch--;
}
}
else if ((entryType === 'file' || this._includeAsFile(entry)) &&
this._fileFilter(entry)) {
if (this._wantsFile) {
this.push(entry);
batch--;
}
}
}
}
else {
const parent = this.parents.pop();
if (!parent) {
this.push(null);
break;
}
this.parent = await parent;
if (this.destroyed)
return;
}
}
}
catch (error) {
this.destroy(error);
}
finally {
this.reading = false;
}
}
async _exploreDir(path, depth) {
let files;
try {
files = await (0, promises_1.readdir)(path, this._rdOptions);
}
catch (error) {
this._onError(error);
}
return { files, depth, path };
}
async _formatEntry(dirent, path) {
let entry;
const basename = this._isDirent ? dirent.name : dirent;
try {
const fullPath = (0, node_path_1.resolve)((0, node_path_1.join)(path, basename));
entry = { path: (0, node_path_1.relative)(this._root, fullPath), fullPath, basename };
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
}
catch (err) {
this._onError(err);
return;
}
return entry;
}
_onError(err) {
if (isNormalFlowError(err) && !this.destroyed) {
this.emit('warn', err);
}
else {
this.destroy(err);
}
}
async _getEntryType(entry) {
// entry may be undefined, because a warning or an error were emitted
// and the statsProp is undefined
if (!entry && this._statsProp in entry) {
return '';
}
const stats = entry[this._statsProp];
if (stats.isFile())
return 'file';
if (stats.isDirectory())
return 'directory';
if (stats && stats.isSymbolicLink()) {
const full = entry.fullPath;
try {
const entryRealPath = await (0, promises_1.realpath)(full);
const entryRealPathStats = await (0, promises_1.lstat)(entryRealPath);
if (entryRealPathStats.isFile()) {
return 'file';
}
if (entryRealPathStats.isDirectory()) {
const len = entryRealPath.length;
if (full.startsWith(entryRealPath) && full.substr(len, 1) === node_path_1.sep) {
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
// @ts-ignore
recursiveError.code = RECURSIVE_ERROR_CODE;
return this._onError(recursiveError);
}
return 'directory';
}
}
catch (error) {
this._onError(error);
return '';
}
}
}
_includeAsFile(entry) {
const stats = entry && entry[this._statsProp];
return stats && this._wantsEverything && !stats.isDirectory();
}
}
exports.ReaddirpStream = ReaddirpStream;
/**
* Streaming version: Reads all files and directories in given root recursively.
* Consumes ~constant small amount of RAM.
* @param root Root directory
* @param options Options to specify root (start directory), filters and recursion depth
*/
function readdirp(root, options = {}) {
// @ts-ignore
let type = options.entryType || options.type;
if (type === 'both')
type = exports.EntryTypes.FILE_DIR_TYPE; // backwards-compatibility
if (type)
options.type = type;
if (!root) {
throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)');
}
else if (typeof root !== 'string') {
throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)');
}
else if (type && !ALL_TYPES.includes(type)) {
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`);
}
options.root = root;
return new ReaddirpStream(options);
}
/**
* Promise version: Reads all files and directories in given root recursively.
* Compared to streaming version, will consume a lot of RAM e.g. when 1 million files are listed.
* @returns array of paths and their entry infos
*/
function readdirpPromise(root, options = {}) {
return new Promise((resolve, reject) => {
const files = [];
readdirp(root, options)
.on('data', (entry) => files.push(entry))
.on('end', () => resolve(files))
.on('error', (error) => reject(error));
});
}
exports.default = readdirp;

View File

@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findPackageData = findPackageData;
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
var _utils = require("./utils.js");
var _configError = require("../../errors/config-error.js");
const PACKAGE_FILENAME = "package.json";
const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => {
let options;
try {
options = JSON.parse(content);
} catch (err) {
throw new _configError.default(`Error while parsing JSON - ${err.message}`, filepath);
}
if (!options) throw new Error(`${filepath}: No config detected`);
if (typeof options !== "object") {
throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
}
if (Array.isArray(options)) {
throw new _configError.default(`Expected config object but found array`, filepath);
}
return {
filepath,
dirname: _path().dirname(filepath),
options
};
});
function* findPackageData(filepath) {
let pkg = null;
const directories = [];
let isPackage = true;
let dirname = _path().dirname(filepath);
while (!pkg && _path().basename(dirname) !== "node_modules") {
directories.push(dirname);
pkg = yield* readConfigPackage(_path().join(dirname, PACKAGE_FILENAME));
const nextLoc = _path().dirname(dirname);
if (dirname === nextLoc) {
isPackage = false;
break;
}
dirname = nextLoc;
}
return {
filepath,
directories,
pkg,
isPackage
};
}
0 && 0;
//# sourceMappingURL=package.js.map

View File

@@ -0,0 +1,47 @@
import type { ReplayRecordingData } from '@sentry/core';
import type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
/**
* This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.
* This can happen e.g. if the worker cannot be loaded.
* Exported only for testing.
*/
export declare class EventBufferProxy implements EventBuffer {
private _fallback;
private _compression;
private _used;
private _ensureWorkerIsLoadedPromise;
constructor(worker: Worker);
/** @inheritdoc */
get waitForCheckout(): boolean;
/** @inheritdoc */
get type(): EventBufferType;
/** @inheritDoc */
get hasEvents(): boolean;
/** @inheritdoc */
get hasCheckout(): boolean;
/** @inheritdoc */
set hasCheckout(value: boolean);
/** @inheritdoc */
set waitForCheckout(value: boolean);
/** @inheritDoc */
destroy(): void;
/** @inheritdoc */
clear(): void;
/** @inheritdoc */
getEarliestTimestamp(): number | null;
/**
* Add an event to the event buffer.
*
* Returns true if event was successfully added.
*/
addEvent(event: RecordingEvent): Promise<AddEventResult>;
/** @inheritDoc */
finish(): Promise<ReplayRecordingData>;
/** Ensure the worker has loaded. */
ensureWorkerIsLoaded(): Promise<void>;
/** Actually check if the worker has been loaded. */
private _ensureWorkerIsLoaded;
/** Switch the used buffer to the compression worker. */
private _switchToCompressionWorker;
}
//# sourceMappingURL=EventBufferProxy.d.ts.map

View File

@@ -0,0 +1,20 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Angry = createLucideIcon("Angry", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["path", { d: "M16 16s-1.5-2-4-2-4 2-4 2", key: "epbg0q" }],
["path", { d: "M7.5 8 10 9", key: "olxxln" }],
["path", { d: "m14 9 2.5-1", key: "1j6cij" }],
["path", { d: "M9 10h.01", key: "qbtxuw" }],
["path", { d: "M15 10h.01", key: "1qmjsl" }]
]);
export { Angry as default };
//# sourceMappingURL=angry.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"signals.js","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAqB,EAAE,CAAA;AAC3C,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;AAE3C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,OAAO,CAAC,IAAI,CACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ;IACR,yDAAyD;IACzD,UAAU;IACV,YAAY;KACb,CAAA;CACF;AAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;CACxD","sourcesContent":["/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals: NodeJS.Signals[] = []\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM')\n\nif (process.platform !== 'win32') {\n signals.push(\n 'SIGALRM',\n 'SIGABRT',\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT')\n}\n"]}

View File

@@ -0,0 +1,559 @@
(() => {
var _window$dateFns;function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/ar/_lib/formatDistance.js
var formatDistanceLocale = {
lessThanXSeconds: {
one: "\u0623\u0642\u0644 \u0645\u0646 \u062B\u0627\u0646\u064A\u0629",
two: "\u0623\u0642\u0644 \u0645\u0646 \u062B\u0627\u0646\u064A\u062A\u064A\u0646",
threeToTen: "\u0623\u0642\u0644 \u0645\u0646 {{count}} \u062B\u0648\u0627\u0646\u064A",
other: "\u0623\u0642\u0644 \u0645\u0646 {{count}} \u062B\u0627\u0646\u064A\u0629"
},
xSeconds: {
one: "\u062B\u0627\u0646\u064A\u0629 \u0648\u0627\u062D\u062F\u0629",
two: "\u062B\u0627\u0646\u064A\u062A\u0627\u0646",
threeToTen: "{{count}} \u062B\u0648\u0627\u0646\u064A",
other: "{{count}} \u062B\u0627\u0646\u064A\u0629"
},
halfAMinute: "\u0646\u0635\u0641 \u062F\u0642\u064A\u0642\u0629",
lessThanXMinutes: {
one: "\u0623\u0642\u0644 \u0645\u0646 \u062F\u0642\u064A\u0642\u0629",
two: "\u0623\u0642\u0644 \u0645\u0646 \u062F\u0642\u064A\u0642\u062A\u064A\u0646",
threeToTen: "\u0623\u0642\u0644 \u0645\u0646 {{count}} \u062F\u0642\u0627\u0626\u0642",
other: "\u0623\u0642\u0644 \u0645\u0646 {{count}} \u062F\u0642\u064A\u0642\u0629"
},
xMinutes: {
one: "\u062F\u0642\u064A\u0642\u0629 \u0648\u0627\u062D\u062F\u0629",
two: "\u062F\u0642\u064A\u0642\u062A\u0627\u0646",
threeToTen: "{{count}} \u062F\u0642\u0627\u0626\u0642",
other: "{{count}} \u062F\u0642\u064A\u0642\u0629"
},
aboutXHours: {
one: "\u0633\u0627\u0639\u0629 \u0648\u0627\u062D\u062F\u0629 \u062A\u0642\u0631\u064A\u0628\u0627\u064B",
two: "\u0633\u0627\u0639\u062A\u064A\u0646 \u062A\u0642\u0631\u064A\u0628\u0627",
threeToTen: "{{count}} \u0633\u0627\u0639\u0627\u062A \u062A\u0642\u0631\u064A\u0628\u0627\u064B",
other: "{{count}} \u0633\u0627\u0639\u0629 \u062A\u0642\u0631\u064A\u0628\u0627\u064B"
},
xHours: {
one: "\u0633\u0627\u0639\u0629 \u0648\u0627\u062D\u062F\u0629",
two: "\u0633\u0627\u0639\u062A\u0627\u0646",
threeToTen: "{{count}} \u0633\u0627\u0639\u0627\u062A",
other: "{{count}} \u0633\u0627\u0639\u0629"
},
xDays: {
one: "\u064A\u0648\u0645 \u0648\u0627\u062D\u062F",
two: "\u064A\u0648\u0645\u0627\u0646",
threeToTen: "{{count}} \u0623\u064A\u0627\u0645",
other: "{{count}} \u064A\u0648\u0645"
},
aboutXWeeks: {
one: "\u0623\u0633\u0628\u0648\u0639 \u0648\u0627\u062D\u062F \u062A\u0642\u0631\u064A\u0628\u0627",
two: "\u0623\u0633\u0628\u0648\u0639\u064A\u0646 \u062A\u0642\u0631\u064A\u0628\u0627",
threeToTen: "{{count}} \u0623\u0633\u0627\u0628\u064A\u0639 \u062A\u0642\u0631\u064A\u0628\u0627",
other: "{{count}} \u0623\u0633\u0628\u0648\u0639\u0627 \u062A\u0642\u0631\u064A\u0628\u0627"
},
xWeeks: {
one: "\u0623\u0633\u0628\u0648\u0639 \u0648\u0627\u062D\u062F",
two: "\u0623\u0633\u0628\u0648\u0639\u0627\u0646",
threeToTen: "{{count}} \u0623\u0633\u0627\u0628\u064A\u0639",
other: "{{count}} \u0623\u0633\u0628\u0648\u0639\u0627"
},
aboutXMonths: {
one: "\u0634\u0647\u0631 \u0648\u0627\u062D\u062F \u062A\u0642\u0631\u064A\u0628\u0627\u064B",
two: "\u0634\u0647\u0631\u064A\u0646 \u062A\u0642\u0631\u064A\u0628\u0627",
threeToTen: "{{count}} \u0623\u0634\u0647\u0631 \u062A\u0642\u0631\u064A\u0628\u0627",
other: "{{count}} \u0634\u0647\u0631\u0627 \u062A\u0642\u0631\u064A\u0628\u0627\u064B"
},
xMonths: {
one: "\u0634\u0647\u0631 \u0648\u0627\u062D\u062F",
two: "\u0634\u0647\u0631\u0627\u0646",
threeToTen: "{{count}} \u0623\u0634\u0647\u0631",
other: "{{count}} \u0634\u0647\u0631\u0627"
},
aboutXYears: {
one: "\u0633\u0646\u0629 \u0648\u0627\u062D\u062F\u0629 \u062A\u0642\u0631\u064A\u0628\u0627\u064B",
two: "\u0633\u0646\u062A\u064A\u0646 \u062A\u0642\u0631\u064A\u0628\u0627",
threeToTen: "{{count}} \u0633\u0646\u0648\u0627\u062A \u062A\u0642\u0631\u064A\u0628\u0627\u064B",
other: "{{count}} \u0633\u0646\u0629 \u062A\u0642\u0631\u064A\u0628\u0627\u064B"
},
xYears: {
one: "\u0633\u0646\u0629 \u0648\u0627\u062D\u062F",
two: "\u0633\u0646\u062A\u0627\u0646",
threeToTen: "{{count}} \u0633\u0646\u0648\u0627\u062A",
other: "{{count}} \u0633\u0646\u0629"
},
overXYears: {
one: "\u0623\u0643\u062B\u0631 \u0645\u0646 \u0633\u0646\u0629",
two: "\u0623\u0643\u062B\u0631 \u0645\u0646 \u0633\u0646\u062A\u064A\u0646",
threeToTen: "\u0623\u0643\u062B\u0631 \u0645\u0646 {{count}} \u0633\u0646\u0648\u0627\u062A",
other: "\u0623\u0643\u062B\u0631 \u0645\u0646 {{count}} \u0633\u0646\u0629"
},
almostXYears: {
one: "\u0645\u0627 \u064A\u0642\u0627\u0631\u0628 \u0633\u0646\u0629 \u0648\u0627\u062D\u062F\u0629",
two: "\u0645\u0627 \u064A\u0642\u0627\u0631\u0628 \u0633\u0646\u062A\u064A\u0646",
threeToTen: "\u0645\u0627 \u064A\u0642\u0627\u0631\u0628 {{count}} \u0633\u0646\u0648\u0627\u062A",
other: "\u0645\u0627 \u064A\u0642\u0627\u0631\u0628 {{count}} \u0633\u0646\u0629"
}
};
var formatDistance = function formatDistance(token, count, options) {
var usageGroup = formatDistanceLocale[token];
var result;
if (typeof usageGroup === "string") {
result = usageGroup;
} else if (count === 1) {
result = usageGroup.one;
} else if (count === 2) {
result = usageGroup.two;
} else if (count <= 10) {
result = usageGroup.threeToTen.replace("{{count}}", String(count));
} else {
result = usageGroup.other.replace("{{count}}", String(count));
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "\u062E\u0644\u0627\u0644 " + result;
} else {
return "\u0645\u0646\u0630 " + result;
}
}
return result;
};
// lib/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/ar/_lib/formatLong.js
var dateFormats = {
full: "EEEE\u060C do MMMM y",
long: "do MMMM y",
medium: "d MMM y",
short: "dd/MM/yyyy"
};
var timeFormats = {
full: "HH:mm:ss",
long: "HH:mm:ss",
medium: "HH:mm:ss",
short: "HH:mm"
};
var dateTimeFormats = {
full: "{{date}} '\u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629' {{time}}",
long: "{{date}} '\u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/ar/_lib/formatRelative.js
var formatRelativeLocale = {
lastWeek: "eeee '\u0627\u0644\u0645\u0627\u0636\u064A \u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629' p",
yesterday: "'\u0627\u0644\u0623\u0645\u0633 \u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629' p",
today: "'\u0627\u0644\u064A\u0648\u0645 \u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629' p",
tomorrow: "'\u063A\u062F\u0627 \u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629' p",
nextWeek: "eeee '\u0627\u0644\u0642\u0627\u062F\u0645 \u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629' p",
other: "P"
};
var formatRelative = function formatRelative(token) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildLocalizeFn.js
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/ar/_lib/localize.js
var eraValues = {
narrow: ["\u0642", "\u0628"],
abbreviated: ["\u0642.\u0645.", "\u0628.\u0645."],
wide: ["\u0642\u0628\u0644 \u0627\u0644\u0645\u064A\u0644\u0627\u062F", "\u0628\u0639\u062F \u0627\u0644\u0645\u064A\u0644\u0627\u062F"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["\u06311", "\u06312", "\u06313", "\u06314"],
wide: ["\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u0623\u0648\u0644", "\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u062B\u0627\u0646\u064A", "\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u062B\u0627\u0644\u062B", "\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u0631\u0627\u0628\u0639"]
};
var monthValues = {
narrow: ["\u064A", "\u0641", "\u0645", "\u0623", "\u0645", "\u064A", "\u064A", "\u0623", "\u0633", "\u0623", "\u0646", "\u062F"],
abbreviated: [
"\u064A\u0646\u0627\u064A\u0631",
"\u0641\u0628\u0631\u0627\u064A\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064A\u0644",
"\u0645\u0627\u064A\u0648",
"\u064A\u0648\u0646\u064A\u0648",
"\u064A\u0648\u0644\u064A\u0648",
"\u0623\u063A\u0633\u0637\u0633",
"\u0633\u0628\u062A\u0645\u0628\u0631",
"\u0623\u0643\u062A\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062F\u064A\u0633\u0645\u0628\u0631"],
wide: [
"\u064A\u0646\u0627\u064A\u0631",
"\u0641\u0628\u0631\u0627\u064A\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064A\u0644",
"\u0645\u0627\u064A\u0648",
"\u064A\u0648\u0646\u064A\u0648",
"\u064A\u0648\u0644\u064A\u0648",
"\u0623\u063A\u0633\u0637\u0633",
"\u0633\u0628\u062A\u0645\u0628\u0631",
"\u0623\u0643\u062A\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062F\u064A\u0633\u0645\u0628\u0631"]
};
var dayValues = {
narrow: ["\u062D", "\u0646", "\u062B", "\u0631", "\u062E", "\u062C", "\u0633"],
short: ["\u0623\u062D\u062F", "\u0627\u062B\u0646\u064A\u0646", "\u062B\u0644\u0627\u062B\u0627\u0621", "\u0623\u0631\u0628\u0639\u0627\u0621", "\u062E\u0645\u064A\u0633", "\u062C\u0645\u0639\u0629", "\u0633\u0628\u062A"],
abbreviated: ["\u0623\u062D\u062F", "\u0627\u062B\u0646\u064A\u0646", "\u062B\u0644\u0627\u062B\u0627\u0621", "\u0623\u0631\u0628\u0639\u0627\u0621", "\u062E\u0645\u064A\u0633", "\u062C\u0645\u0639\u0629", "\u0633\u0628\u062A"],
wide: [
"\u0627\u0644\u0623\u062D\u062F",
"\u0627\u0644\u0627\u062B\u0646\u064A\u0646",
"\u0627\u0644\u062B\u0644\u0627\u062B\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062E\u0645\u064A\u0633",
"\u0627\u0644\u062C\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062A"]
};
var dayPeriodValues = {
narrow: {
am: "\u0635",
pm: "\u0645",
morning: "\u0627\u0644\u0635\u0628\u0627\u062D",
noon: "\u0627\u0644\u0638\u0647\u0631",
afternoon: "\u0628\u0639\u062F \u0627\u0644\u0638\u0647\u0631",
evening: "\u0627\u0644\u0645\u0633\u0627\u0621",
night: "\u0627\u0644\u0644\u064A\u0644",
midnight: "\u0645\u0646\u062A\u0635\u0641 \u0627\u0644\u0644\u064A\u0644"
},
abbreviated: {
am: "\u0635",
pm: "\u0645",
morning: "\u0627\u0644\u0635\u0628\u0627\u062D",
noon: "\u0627\u0644\u0638\u0647\u0631",
afternoon: "\u0628\u0639\u062F \u0627\u0644\u0638\u0647\u0631",
evening: "\u0627\u0644\u0645\u0633\u0627\u0621",
night: "\u0627\u0644\u0644\u064A\u0644",
midnight: "\u0645\u0646\u062A\u0635\u0641 \u0627\u0644\u0644\u064A\u0644"
},
wide: {
am: "\u0635",
pm: "\u0645",
morning: "\u0627\u0644\u0635\u0628\u0627\u062D",
noon: "\u0627\u0644\u0638\u0647\u0631",
afternoon: "\u0628\u0639\u062F \u0627\u0644\u0638\u0647\u0631",
evening: "\u0627\u0644\u0645\u0633\u0627\u0621",
night: "\u0627\u0644\u0644\u064A\u0644",
midnight: "\u0645\u0646\u062A\u0635\u0641 \u0627\u0644\u0644\u064A\u0644"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "\u0635",
pm: "\u0645",
morning: "\u0641\u064A \u0627\u0644\u0635\u0628\u0627\u062D",
noon: "\u0627\u0644\u0638\u0647\u0631",
afternoon: "\u0628\u0639\u062F \u0627\u0644\u0638\u0647\u0631",
evening: "\u0641\u064A \u0627\u0644\u0645\u0633\u0627\u0621",
night: "\u0641\u064A \u0627\u0644\u0644\u064A\u0644",
midnight: "\u0645\u0646\u062A\u0635\u0641 \u0627\u0644\u0644\u064A\u0644"
},
abbreviated: {
am: "\u0635",
pm: "\u0645",
morning: "\u0641\u064A \u0627\u0644\u0635\u0628\u0627\u062D",
noon: "\u0627\u0644\u0638\u0647\u0631",
afternoon: "\u0628\u0639\u062F \u0627\u0644\u0638\u0647\u0631",
evening: "\u0641\u064A \u0627\u0644\u0645\u0633\u0627\u0621",
night: "\u0641\u064A \u0627\u0644\u0644\u064A\u0644",
midnight: "\u0645\u0646\u062A\u0635\u0641 \u0627\u0644\u0644\u064A\u0644"
},
wide: {
am: "\u0635",
pm: "\u0645",
morning: "\u0641\u064A \u0627\u0644\u0635\u0628\u0627\u062D",
noon: "\u0627\u0644\u0638\u0647\u0631",
afternoon: "\u0628\u0639\u062F \u0627\u0644\u0638\u0647\u0631",
evening: "\u0641\u064A \u0627\u0644\u0645\u0633\u0627\u0621",
night: "\u0641\u064A \u0627\u0644\u0644\u064A\u0644",
midnight: "\u0645\u0646\u062A\u0635\u0641 \u0627\u0644\u0644\u064A\u0644"
}
};
var ordinalNumber = function ordinalNumber(num) {return String(num);};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
}
function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
}
// lib/locale/ar/_lib/match.js
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /[قب]/,
abbreviated: /[قب]\.م\./,
wide: /(قبل|بعد) الميلاد/
};
var parseEraPatterns = {
any: [/قبل/, /بعد/]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /ر[1234]/,
wide: /الربع (الأول|الثاني|الثالث|الرابع)/
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[أيفمسند]/,
abbreviated: /^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/,
wide: /^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/
};
var parseMonthPatterns = {
narrow: [
/^ي/i,
/^ف/i,
/^م/i,
/^أ/i,
/^م/i,
/^ي/i,
/^ي/i,
/^أ/i,
/^س/i,
/^أ/i,
/^ن/i,
/^د/i],
any: [
/^يناير/i,
/^فبراير/i,
/^مارس/i,
/^أبريل/i,
/^مايو/i,
/^يونيو/i,
/^يوليو/i,
/^أغسطس/i,
/^سبتمبر/i,
/^أكتوبر/i,
/^نوفمبر/i,
/^ديسمبر/i]
};
var matchDayPatterns = {
narrow: /^[حنثرخجس]/i,
short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
abbreviated: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i
};
var parseDayPatterns = {
narrow: [/^ح/i, /^ن/i, /^ث/i, /^ر/i, /^خ/i, /^ج/i, /^س/i],
wide: [
/^الأحد/i,
/^الاثنين/i,
/^الثلاثاء/i,
/^الأربعاء/i,
/^الخميس/i,
/^الجمعة/i,
/^السبت/i],
any: [/^أح/i, /^اث/i, /^ث/i, /^أر/i, /^خ/i, /^ج/i, /^س/i]
};
var matchDayPeriodPatterns = {
narrow: /^(ص|م|منتصف الليل|الظهر|بعد الظهر|في الصباح|في المساء|في الليل)/,
any: /^(ص|م|منتصف الليل|الظهر|بعد الظهر|في الصباح|في المساء|في الليل)/
};
var parseDayPeriodPatterns = {
any: {
am: /^ص/,
pm: /^م/,
midnight: /منتصف الليل/,
noon: /الظهر/,
afternoon: /بعد الظهر/,
morning: /في الصباح/,
evening: /في المساء/,
night: /في الليل/
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/ar.js
var ar = {
code: "ar",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 6,
firstWeekContainsDate: 1
}
};
// lib/locale/ar/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
ar: ar }) });
//# debugId=DFF1C908F857B89F64756E2164756E21
//# sourceMappingURL=cdn.js.map
})();

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/baggage/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAC9C,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAChD,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,wDAAwD;AACxD,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AACxC,yDAAyD;AACzD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAChD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gCAAgC,GAAG,IAAI,CAAC;AACrD,mEAAmE;AACnE,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const BAGGAGE_KEY_PAIR_SEPARATOR = '=';\nexport const BAGGAGE_PROPERTIES_SEPARATOR = ';';\nexport const BAGGAGE_ITEMS_SEPARATOR = ',';\n\n// Name of the http header used to propagate the baggage\nexport const BAGGAGE_HEADER = 'baggage';\n// Maximum number of name-value pairs allowed by w3c spec\nexport const BAGGAGE_MAX_NAME_VALUE_PAIRS = 180;\n// Maximum number of bytes per a single name-value pair allowed by w3c spec\nexport const BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096;\n// Maximum total length of all name-value pairs allowed by w3c spec\nexport const BAGGAGE_MAX_TOTAL_LENGTH = 8192;\n"]}

View File

@@ -0,0 +1,23 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.cjs";
export type SingleStoreYearBuilderInitial<TName extends string> = SingleStoreYearBuilder<{
name: TName;
dataType: 'number';
columnType: 'SingleStoreYear';
data: number;
driverParam: number;
enumValues: undefined;
generated: undefined;
}>;
export declare class SingleStoreYearBuilder<T extends ColumnBuilderBaseConfig<'number', 'SingleStoreYear'>> extends SingleStoreColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class SingleStoreYear<T extends ColumnBaseConfig<'number', 'SingleStoreYear'>> extends SingleStoreColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
}
export declare function year(): SingleStoreYearBuilderInitial<''>;
export declare function year<TName extends string>(name: TName): SingleStoreYearBuilderInitial<TName>;

View File

@@ -0,0 +1,88 @@
"use strict";
exports.formatDistanceToNowStrict = formatDistanceToNowStrict;
var _index = require("./constructNow.cjs");
var _index2 = require("./formatDistanceStrict.cjs");
/**
* The {@link formatDistanceToNowStrict} function options.
*/
/**
* @name formatDistanceToNowStrict
* @category Common Helpers
* @summary Return the distance between the given date and now in words.
* @pure false
*
* @description
* Return the distance between the given dates in words, using strict units.
* This is like `formatDistance`, but does not use helpers like 'almost', 'over',
* 'less than' and the like.
*
* | Distance between dates | Result |
* |------------------------|---------------------|
* | 0 ... 59 secs | [0..59] seconds |
* | 1 ... 59 mins | [1..59] minutes |
* | 1 ... 23 hrs | [1..23] hours |
* | 1 ... 29 days | [1..29] days |
* | 1 ... 11 months | [1..11] months |
* | 1 ... N years | [1..N] years |
*
* @param date - The given date
* @param options - An object with options.
*
* @returns The distance in words
*
* @throws `date` must not be Invalid Date
* @throws `options.locale` must contain `formatDistance` property
*
* @example
* // If today is 1 January 2015, what is the distance to 2 July 2014?
* const result = formatDistanceToNowStrict(
* new Date(2014, 6, 2)
* )
* //=> '6 months'
*
* @example
* // If now is 1 January 2015 00:00:00,
* // what is the distance to 1 January 2015 00:00:15, including seconds?
* const result = formatDistanceToNowStrict(
* new Date(2015, 0, 1, 0, 0, 15)
* )
* //=> '15 seconds'
*
* @example
* // If today is 1 January 2015,
* // what is the distance to 1 January 2016, with a suffix?
* const result = formatDistanceToNowStrict(
* new Date(2016, 0, 1),
* {addSuffix: true}
* )
* //=> 'in 1 year'
*
* @example
* // If today is 28 January 2015,
* // what is the distance to 1 January 2015, in months, rounded up??
* const result = formatDistanceToNowStrict(new Date(2015, 0, 1), {
* unit: 'month',
* roundingMethod: 'ceil'
* })
* //=> '1 month'
*
* @example
* // If today is 1 January 2015,
* // what is the distance to 1 January 2016 in Esperanto?
* const eoLocale = require('date-fns/locale/eo')
* const result = formatDistanceToNowStrict(
* new Date(2016, 0, 1),
* {locale: eoLocale}
* )
* //=> '1 jaro'
*/
function formatDistanceToNowStrict(date, options) {
return (0, _index2.formatDistanceStrict)(
date,
(0, _index.constructNow)(date),
options,
);
}

View File

@@ -0,0 +1,19 @@
Prism.languages.actionscript = Prism.languages.extend('javascript', {
'keyword': /\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,
'operator': /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/
});
Prism.languages.actionscript['class-name'].alias = 'function';
// doesn't work with AS because AS is too complex
delete Prism.languages.actionscript['parameter'];
delete Prism.languages.actionscript['literal-property'];
if (Prism.languages.markup) {
Prism.languages.insertBefore('actionscript', 'string', {
'xml': {
pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,
lookbehind: true,
inside: Prism.languages.markup
}
});
}

View File

@@ -0,0 +1,103 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.attributeNames = exports.elementNames = void 0;
exports.elementNames = new Map([
"altGlyph",
"altGlyphDef",
"altGlyphItem",
"animateColor",
"animateMotion",
"animateTransform",
"clipPath",
"feBlend",
"feColorMatrix",
"feComponentTransfer",
"feComposite",
"feConvolveMatrix",
"feDiffuseLighting",
"feDisplacementMap",
"feDistantLight",
"feDropShadow",
"feFlood",
"feFuncA",
"feFuncB",
"feFuncG",
"feFuncR",
"feGaussianBlur",
"feImage",
"feMerge",
"feMergeNode",
"feMorphology",
"feOffset",
"fePointLight",
"feSpecularLighting",
"feSpotLight",
"feTile",
"feTurbulence",
"foreignObject",
"glyphRef",
"linearGradient",
"radialGradient",
"textPath",
].map(function (val) { return [val.toLowerCase(), val]; }));
exports.attributeNames = new Map([
"definitionURL",
"attributeName",
"attributeType",
"baseFrequency",
"baseProfile",
"calcMode",
"clipPathUnits",
"diffuseConstant",
"edgeMode",
"filterUnits",
"glyphRef",
"gradientTransform",
"gradientUnits",
"kernelMatrix",
"kernelUnitLength",
"keyPoints",
"keySplines",
"keyTimes",
"lengthAdjust",
"limitingConeAngle",
"markerHeight",
"markerUnits",
"markerWidth",
"maskContentUnits",
"maskUnits",
"numOctaves",
"pathLength",
"patternContentUnits",
"patternTransform",
"patternUnits",
"pointsAtX",
"pointsAtY",
"pointsAtZ",
"preserveAlpha",
"preserveAspectRatio",
"primitiveUnits",
"refX",
"refY",
"repeatCount",
"repeatDur",
"requiredExtensions",
"requiredFeatures",
"specularConstant",
"specularExponent",
"spreadMethod",
"startOffset",
"stdDeviation",
"stitchTiles",
"surfaceScale",
"systemLanguage",
"tableValues",
"targetX",
"targetY",
"textLength",
"viewBox",
"viewTarget",
"xChannelSelector",
"yChannelSelector",
"zoomAndPan",
].map(function (val) { return [val.toLowerCase(), val]; }));

View File

@@ -0,0 +1,76 @@
const setConnectionStringDatabase = ({ connectionString, database })=>{
const connectionURL = new URL(connectionString);
const newConnectionURL = new URL(connectionURL);
newConnectionURL.pathname = `/${database}`;
return newConnectionURL.toString();
};
export const createDatabase = async function(args = {}) {
// POSTGRES_URL - default Vercel env
const connectionString = this.poolOptions?.connectionString ?? process.env.POSTGRES_URL ?? process.env.DATABASE_URL;
let managementClientConfig = {};
let dbName = args.name;
const schemaName = this.schemaName || 'public';
if (connectionString) {
if (!dbName) {
dbName = new URL(connectionString).pathname.slice(1);
}
managementClientConfig.connectionString = setConnectionStringDatabase({
connectionString,
database: 'postgres'
});
} else {
if (!dbName) {
dbName = this.poolOptions.database;
}
managementClientConfig = {
...this.poolOptions,
database: 'postgres'
};
}
// import pg only when createDatabase is used
const pg = await import('pg').then((mod)=>mod.default);
const managementClient = new pg.Client(managementClientConfig);
try {
await managementClient.connect();
await managementClient.query(`CREATE DATABASE "${dbName}"`);
this.payload.logger.info(`Created database "${dbName}"`);
if (schemaName !== 'public') {
let createdDatabaseConfig = {};
if (connectionString) {
createdDatabaseConfig.connectionString = setConnectionStringDatabase({
connectionString,
database: dbName
});
} else {
createdDatabaseConfig = {
...this.poolOptions,
database: dbName
};
}
const createdDatabaseClient = new pg.Client(createdDatabaseConfig);
try {
await createdDatabaseClient.connect();
await createdDatabaseClient.query(`CREATE SCHEMA ${schemaName}`);
this.payload.logger.info(`Created schema "${dbName}.${schemaName}"`);
} catch (err) {
this.payload.logger.error({
err,
msg: `Error: failed to create schema "${dbName}.${schemaName}". Details: ${err.message}`
});
} finally{
await createdDatabaseClient.end();
}
}
return true;
} catch (err) {
this.payload.logger.error({
err,
msg: `Error: failed to create database ${dbName}. Details: ${err.message}`
});
return false;
} finally{
await managementClient.end();
}
};
//# sourceMappingURL=createDatabase.js.map

View File

@@ -0,0 +1,20 @@
import { type AnyPgColumn, type PgPolicyToOption } from "../pg-core/index.cjs";
import { PgRole } from "../pg-core/roles.cjs";
import { type SQL } from "../sql/sql.cjs";
/**
* Generates a set of PostgreSQL row-level security (RLS) policies for CRUD operations based on the provided options.
*
* @param options - An object containing the policy configuration.
* @param options.role - The PostgreSQL role(s) to apply the policy to. Can be a single `PgRole` instance or an array of `PgRole` instances or role names.
* @param options.read - The SQL expression or boolean value that defines the read policy. Set to `true` to allow all reads, `false` to deny all reads, or provide a custom SQL expression. Set to `null` to prevent the policy from being generated.
* @param options.modify - The SQL expression or boolean value that defines the modify (insert, update, delete) policies. Set to `true` to allow all modifications, `false` to deny all modifications, or provide a custom SQL expression. Set to `null` to prevent policies from being generated.
* @returns An array of PostgreSQL policy definitions, one for each CRUD operation.
*/
export declare const crudPolicy: (options: {
role: PgPolicyToOption;
read: SQL | boolean | null;
modify: SQL | boolean | null;
}) => (import("../pg-core/index.ts").PgPolicy | undefined)[];
export declare const authenticatedRole: PgRole;
export declare const anonymousRole: PgRole;
export declare const authUid: (userIdColumn: AnyPgColumn) => SQL<unknown>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"panels.cjs","names":[],"sources":["../../../../src/rest/commands/read/panels.ts"],"sourcesContent":["import type { DirectusPanel } from '../../../schema/panel.js';\nimport type { ApplyQueryFields, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadPanelOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusPanel<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * List all Panels that exist in Directus.\n * @param query The query parameters\n * @returns An array of up to limit panel objects. If no items are available, data will be an empty array.\n */\nexport const readPanels =\n\t<Schema, const TQuery extends Query<Schema, DirectusPanel<Schema>>>(\n\t\tquery?: TQuery,\n\t): RestCommand<ReadPanelOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/panels`,\n\t\tparams: query ?? {},\n\t\tmethod: 'GET',\n\t});\n\n/**\n * List an existing panel by primary key.\n * @param key The primary key of the dashboard\n * @param query The query parameters\n * @returns Returns the requested panel object.\n * @throws Will throw if key is empty\n */\nexport const readPanel =\n\t<Schema, const TQuery extends Query<Schema, DirectusPanel<Schema>>>(\n\t\tkey: DirectusPanel<Schema>['id'],\n\t\tquery?: TQuery,\n\t): RestCommand<ReadPanelOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/panels/${key}`,\n\t\t\tparams: query ?? {},\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"kDAgBa,EAEX,QAEM,CACN,KAAM,UACN,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR,EASW,GAEX,EACA,SAGA,EAAA,aAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,WAAW,IACjB,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","useSelection","useTranslation","Pill","SelectMany","props","onClick","count","selected","t","_jsxs","pillStyle","size"],"sources":["../../../src/elements/SelectMany/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useSelection } from '../../providers/Selection/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { Pill } from '../Pill/index.js'\n\nexport const SelectMany: React.FC<{\n onClick?: (ids: ReturnType<typeof useSelection>['selected']) => void\n}> = (props) => {\n const { onClick } = props\n\n const { count, selected } = useSelection()\n const { t } = useTranslation()\n\n if (!selected || !count) {\n return null\n }\n\n return (\n <Pill\n onClick={() => {\n if (typeof onClick === 'function') {\n onClick(selected)\n }\n }}\n pillStyle=\"white\"\n size=\"small\"\n >\n {t('general:select')} {count}\n </Pill>\n )\n}\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AAElB,SAASC,YAAY,QAAQ;AAC7B,SAASC,cAAc,QAAQ;AAC/B,SAASC,IAAI,QAAQ;AAErB,OAAO,MAAMC,UAAA,GAEPC,KAAA;EACJ,MAAM;IAAEC;EAAO,CAAE,GAAGD,KAAA;EAEpB,MAAM;IAAEE,KAAK;IAAEC;EAAQ,CAAE,GAAGP,YAAA;EAC5B,MAAM;IAAEQ;EAAC,CAAE,GAAGP,cAAA;EAEd,IAAI,CAACM,QAAA,IAAY,CAACD,KAAA,EAAO;IACvB,OAAO;EACT;EAEA,oBACEG,KAAA,CAACP,IAAA;IACCG,OAAA,EAASA,CAAA;MACP,IAAI,OAAOA,OAAA,KAAY,YAAY;QACjCA,OAAA,CAAQE,QAAA;MACV;IACF;IACAG,SAAA,EAAU;IACVC,IAAA,EAAK;eAEJH,CAAA,CAAE,mBAAkB,KAAEF,KAAA;;AAG7B","ignoreList":[]}

View File

@@ -0,0 +1,5 @@
{
"main": "dist/react-select-animated.cjs.js",
"module": "dist/react-select-animated.esm.js",
"types": "dist/react-select-animated.cjs.d.ts"
}

View File

@@ -0,0 +1,58 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var policies_exports = {};
__export(policies_exports, {
PgPolicy: () => PgPolicy,
pgPolicy: () => pgPolicy
});
module.exports = __toCommonJS(policies_exports);
var import_entity = require("../entity.cjs");
class PgPolicy {
constructor(name, config) {
this.name = name;
if (config) {
this.as = config.as;
this.for = config.for;
this.to = config.to;
this.using = config.using;
this.withCheck = config.withCheck;
}
}
static [import_entity.entityKind] = "PgPolicy";
as;
for;
to;
using;
withCheck;
/** @internal */
_linkedTable;
link(table) {
this._linkedTable = table;
return this;
}
}
function pgPolicy(name, config) {
return new PgPolicy(name, config);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PgPolicy,
pgPolicy
});
//# sourceMappingURL=policies.cjs.map

View File

@@ -0,0 +1,21 @@
const GOOGLE_GENAI_INTEGRATION_NAME = 'Google_GenAI';
// https://ai.google.dev/api/rest/v1/models/generateContent
// https://ai.google.dev/api/rest/v1/chats/sendMessage
// https://googleapis.github.io/js-genai/release_docs/classes/models.Models.html#generatecontentstream
// https://googleapis.github.io/js-genai/release_docs/classes/chats.Chat.html#sendmessagestream
const GOOGLE_GENAI_INSTRUMENTED_METHODS = [
'models.generateContent',
'models.generateContentStream',
'chats.create',
'sendMessage',
'sendMessageStream',
] ;
// Constants for internal use
const GOOGLE_GENAI_SYSTEM_NAME = 'google_genai';
const CHATS_CREATE_METHOD = 'chats.create';
const CHAT_PATH = 'chat';
export { CHATS_CREATE_METHOD, CHAT_PATH, GOOGLE_GENAI_INSTRUMENTED_METHODS, GOOGLE_GENAI_INTEGRATION_NAME, GOOGLE_GENAI_SYSTEM_NAME };
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1,172 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["ម.គស", "គស"],
abbreviated: ["មុនគ.ស", "គ.ស"],
wide: ["មុនគ្រិស្តសករាជ", "នៃគ្រិស្តសករាជ"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["ត្រីមាសទី 1", "ត្រីមាសទី 2", "ត្រីមាសទី 3", "ត្រីមាសទី 4"],
};
const monthValues = {
narrow: [
"ម.ក",
"ក.ម",
"មិ",
"ម.ស",
"ឧ.ស",
"ម.ថ",
"ក.ដ",
"សី",
"កញ",
"តុ",
"វិ",
"ធ",
],
abbreviated: [
"មករា",
"កុម្ភៈ",
"មីនា",
"មេសា",
"ឧសភា",
"មិថុនា",
"កក្កដា",
"សីហា",
"កញ្ញា",
"តុលា",
"វិច្ឆិកា",
"ធ្នូ",
],
wide: [
"មករា",
"កុម្ភៈ",
"មីនា",
"មេសា",
"ឧសភា",
"មិថុនា",
"កក្កដា",
"សីហា",
"កញ្ញា",
"តុលា",
"វិច្ឆិកា",
"ធ្នូ",
],
};
const dayValues = {
narrow: ["អា", "ច", "អ", "ព", "ព្រ", "សុ", "ស"],
short: ["អា", "ច", "អ", "ព", "ព្រ", "សុ", "ស"],
abbreviated: ["អា", "ច", "អ", "ព", "ព្រ", "សុ", "ស"],
wide: ["អាទិត្យ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រហស្បតិ៍", "សុក្រ", "សៅរ៍"],
};
const dayPeriodValues = {
narrow: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
abbreviated: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
wide: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
abbreviated: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
wide: {
am: "ព្រឹក",
pm: "ល្ងាច",
midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
noon: "ពេលថ្ងៃត្រង់",
morning: "ពេលព្រឹក",
afternoon: "ពេលរសៀល",
evening: "ពេលល្ងាច",
night: "ពេលយប់",
},
};
const ordinalNumber = (dirtyNumber, _) => {
const number = Number(dirtyNumber);
return number.toString();
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,69 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ExternalsPlugin = require("../ExternalsPlugin");
/** @typedef {import("../Compiler")} Compiler */
class ElectronTargetPlugin {
/**
* @param {"main" | "preload" | "renderer"=} context in main, preload or renderer context?
*/
constructor(context) {
this._context = context;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
new ExternalsPlugin("node-commonjs", [
"clipboard",
"crash-reporter",
"electron",
"ipc",
"native-image",
"original-fs",
"screen",
"shell"
]).apply(compiler);
switch (this._context) {
case "main":
new ExternalsPlugin("node-commonjs", [
"app",
"auto-updater",
"browser-window",
"content-tracing",
"dialog",
"global-shortcut",
"ipc-main",
"menu",
"menu-item",
"power-monitor",
"power-save-blocker",
"protocol",
"session",
"tray",
"web-contents"
]).apply(compiler);
break;
case "preload":
case "renderer":
new ExternalsPlugin("node-commonjs", [
"desktop-capturer",
"ipc-renderer",
"remote",
"web-frame"
]).apply(compiler);
break;
}
}
}
module.exports = ElectronTargetPlugin;

View File

@@ -0,0 +1,113 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
Heading: () => Heading
});
module.exports = __toCommonJS(src_exports);
// src/heading.tsx
var React = __toESM(require("react"));
// src/utils/spaces.ts
var withMargin = (props) => {
const nonEmptyStyles = [
withSpace(props.m, ["margin"]),
withSpace(props.mx, ["marginLeft", "marginRight"]),
withSpace(props.my, ["marginTop", "marginBottom"]),
withSpace(props.mt, ["marginTop"]),
withSpace(props.mr, ["marginRight"]),
withSpace(props.mb, ["marginBottom"]),
withSpace(props.ml, ["marginLeft"])
].filter((s) => Object.keys(s).length);
const mergedStyles = nonEmptyStyles.reduce((acc, style) => {
return __spreadValues(__spreadValues({}, acc), style);
}, {});
return mergedStyles;
};
var withSpace = (value, properties) => {
return properties.reduce((styles, property) => {
if (!isNaN(parseFloat(value))) {
return __spreadProps(__spreadValues({}, styles), { [property]: `${value}px` });
}
return styles;
}, {});
};
// src/heading.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var Heading = React.forwardRef(
(_a, ref) => {
var _b = _a, { as: Tag = "h1", children, style, m, mx, my, mt, mr, mb, ml } = _b, props = __objRest(_b, ["as", "children", "style", "m", "mx", "my", "mt", "mr", "mb", "ml"]);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
Tag,
__spreadProps(__spreadValues({}, props), {
ref,
style: __spreadValues(__spreadValues({}, withMargin({ m, mx, my, mt, mr, mb, ml })), style),
children
})
);
}
);
Heading.displayName = "Heading";
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Heading
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"bin.d.mts","sourceRoot":"","sources":["../../src/bin.mts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,5 @@
function convertOffsetToTimes(offset, duration) {
return offset.map((o) => o * duration);
}
export { convertOffsetToTimes };

View File

@@ -0,0 +1,46 @@
Prism.languages.tcl = {
'comment': {
pattern: /(^|[^\\])#.*/,
lookbehind: true
},
'string': {
pattern: /"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"/,
greedy: true
},
'variable': [
{
pattern: /(\$)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/,
lookbehind: true
},
{
pattern: /(\$)\{[^}]+\}/,
lookbehind: true
},
{
pattern: /(^[\t ]*set[ \t]+)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/m,
lookbehind: true
}
],
'function': {
pattern: /(^[\t ]*proc[ \t]+)\S+/m,
lookbehind: true
},
'builtin': [
{
pattern: /(^[\t ]*)(?:break|class|continue|error|eval|exit|for|foreach|if|proc|return|switch|while)\b/m,
lookbehind: true
},
/\b(?:else|elseif)\b/
],
'scope': {
pattern: /(^[\t ]*)(?:global|upvar|variable)\b/m,
lookbehind: true,
alias: 'constant'
},
'keyword': {
pattern: /(^[\t ]*|\[)(?:Safe_Base|Tcl|after|append|apply|array|auto_(?:execok|import|load|mkindex|qualify|reset)|automkindex_old|bgerror|binary|catch|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|expr|fblocked|fconfigure|fcopy|file(?:event|name)?|flush|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|math(?:func|op)|memory|msgcat|namespace|open|package|parray|pid|pkg_mkIndex|platform|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|rename|scan|seek|set|socket|source|split|string|subst|tcl(?:_endOfWord|_findLibrary|startOf(?:Next|Previous)Word|test|vars|wordBreak(?:After|Before))|tell|time|tm|trace|unknown|unload|unset|update|uplevel|vwait)\b/m,
lookbehind: true
},
'operator': /!=?|\*\*?|==|&&?|\|\|?|<[=<]?|>[=>]?|[-+~\/%?^]|\b(?:eq|in|ne|ni)\b/,
'punctuation': /[{}()\[\]]/
};

View File

@@ -0,0 +1,304 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const debugBuild = require('../debug-build.js');
const eventbuilder = require('../eventbuilder.js');
const helpers = require('../helpers.js');
const globalhandlers = require('./globalhandlers.js');
const INTEGRATION_NAME = 'WebWorker';
/**
* Use this integration to set up Sentry with web workers.
*
* IMPORTANT: This integration must be added **before** you start listening to
* any messages from the worker. Otherwise, your message handlers will receive
* messages from the Sentry SDK which you need to ignore.
*
* This integration only has an effect, if you call `Sentry.registerWebWorker(self)`
* from within the worker(s) you're adding to the integration.
*
* Given that you want to initialize the SDK as early as possible, you most likely
* want to add this integration **after** initializing the SDK:
*
* @example:
* ```ts filename={main.js}
* import * as Sentry from '@sentry/<your-sdk>';
*
* // some time earlier:
* Sentry.init(...)
*
* // 1. Initialize the worker
* const worker = new Worker(new URL('./worker.ts', import.meta.url));
*
* // 2. Add the integration
* const webWorkerIntegration = Sentry.webWorkerIntegration({ worker });
* Sentry.addIntegration(webWorkerIntegration);
*
* // 3. Register message listeners on the worker
* worker.addEventListener('message', event => {
* // ...
* });
* ```
*
* If you initialize multiple workers at the same time, you can also pass an array of workers
* to the integration:
*
* ```ts filename={main.js}
* const webWorkerIntegration = Sentry.webWorkerIntegration({ worker: [worker1, worker2] });
* Sentry.addIntegration(webWorkerIntegration);
* ```
*
* If you have any additional workers that you initialize at a later point,
* you can add them to the integration as follows:
*
* ```ts filename={main.js}
* const webWorkerIntegration = Sentry.webWorkerIntegration({ worker: worker1 });
* Sentry.addIntegration(webWorkerIntegration);
*
* // sometime later:
* webWorkerIntegration.addWorker(worker2);
* ```
*
* Of course, you can also directly add the integration in Sentry.init:
* ```ts filename={main.js}
* import * as Sentry from '@sentry/<your-sdk>';
*
* // 1. Initialize the worker
* const worker = new Worker(new URL('./worker.ts', import.meta.url));
*
* // 2. Initialize the SDK
* Sentry.init({
* integrations: [Sentry.webWorkerIntegration({ worker })]
* });
*
* // 3. Register message listeners on the worker
* worker.addEventListener('message', event => {
* // ...
* });
* ```
*
* @param options {WebWorkerIntegrationOptions} Integration options:
* - `worker`: The worker instance.
*/
const webWorkerIntegration = core.defineIntegration(({ worker }) => ({
name: INTEGRATION_NAME,
setupOnce: () => {
(Array.isArray(worker) ? worker : [worker]).forEach(w => listenForSentryMessages(w));
},
addWorker: (worker) => listenForSentryMessages(worker),
})) ;
function listenForSentryMessages(worker) {
worker.addEventListener('message', event => {
if (isSentryMessage(event.data)) {
event.stopImmediatePropagation(); // other listeners should not receive this message
// Handle debug IDs
if (event.data._sentryDebugIds) {
debugBuild.DEBUG_BUILD && core.debug.log('Sentry debugId web worker message received', event.data);
helpers.WINDOW._sentryDebugIds = {
...event.data._sentryDebugIds,
// debugIds of the main thread have precedence over the worker's in case of a collision.
...helpers.WINDOW._sentryDebugIds,
};
}
// Handle module metadata
if (event.data._sentryModuleMetadata) {
debugBuild.DEBUG_BUILD && core.debug.log('Sentry module metadata web worker message received', event.data);
// Merge worker's raw metadata into the global object
// It will be parsed lazily when needed by getMetadataForUrl
helpers.WINDOW._sentryModuleMetadata = {
...event.data._sentryModuleMetadata,
// Module metadata of the main thread have precedence over the worker's in case of a collision.
...helpers.WINDOW._sentryModuleMetadata,
};
}
// Handle WASM images from worker
if (event.data._sentryWasmImages) {
debugBuild.DEBUG_BUILD && core.debug.log('Sentry WASM images web worker message received', event.data);
const existingImages =
(helpers.WINDOW )._sentryWasmImages || [];
const newImages = event.data._sentryWasmImages.filter(
(newImg) =>
core.isPlainObject(newImg) &&
typeof newImg.code_file === 'string' &&
!existingImages.some(existing => existing.code_file === newImg.code_file),
);
(helpers.WINDOW )._sentryWasmImages = [
...existingImages,
...newImages,
];
}
// Handle unhandled rejections forwarded from worker
if (event.data._sentryWorkerError) {
debugBuild.DEBUG_BUILD && core.debug.log('Sentry worker rejection message received', event.data._sentryWorkerError);
handleForwardedWorkerRejection(event.data._sentryWorkerError);
}
}
});
}
function handleForwardedWorkerRejection(workerError) {
const client = core.getClient();
if (!client) {
return;
}
const stackParser = client.getOptions().stackParser;
const attachStacktrace = client.getOptions().attachStacktrace;
const error = workerError.reason;
// Follow same pattern as globalHandlers for unhandledrejection
// Handle both primitives and errors the same way
const event = core.isPrimitive(error)
? globalhandlers._eventFromRejectionWithPrimitive(error)
: eventbuilder.eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);
event.level = 'error';
// Add worker-specific context
if (workerError.filename) {
event.contexts = {
...event.contexts,
worker: {
filename: workerError.filename,
},
};
}
core.captureEvent(event, {
originalException: error,
mechanism: {
handled: false,
type: 'auto.browser.web_worker.onunhandledrejection',
},
});
debugBuild.DEBUG_BUILD && core.debug.log('Captured worker unhandled rejection', error);
}
/**
* Minimal interface for DedicatedWorkerGlobalScope, only requiring the postMessage method.
* (which is the only thing we need from the worker's global object)
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope
*
* We can't use the actual type because it breaks everyone who doesn't have {"lib": ["WebWorker"]}
* but uses {"skipLibCheck": true} in their tsconfig.json.
*/
/**
* Use this function to register the worker with the Sentry SDK.
*
* This function will:
* - Send debug IDs to the parent thread
* - Send module metadata to the parent thread (for thirdPartyErrorFilterIntegration)
* - Set up a handler for unhandled rejections in the worker
* - Forward unhandled rejections to the parent thread for capture
*
* Note: Synchronous errors in workers are already captured by globalHandlers.
* This only handles unhandled promise rejections which don't bubble to the parent.
*
* @example
* ```ts filename={worker.js}
* import * as Sentry from '@sentry/<your-sdk>';
*
* // Do this as early as possible in your worker.
* Sentry.registerWebWorker({ self });
*
* // continue setting up your worker
* self.postMessage(...)
* ```
* @param options {RegisterWebWorkerOptions} Integration options:
* - `self`: The worker instance you're calling this function from (self).
*/
function registerWebWorker({ self }) {
// Send debug IDs and raw module metadata to parent thread
// The metadata will be parsed lazily on the main thread when needed
self.postMessage({
_sentryMessage: true,
_sentryDebugIds: self._sentryDebugIds ?? undefined,
_sentryModuleMetadata: self._sentryModuleMetadata ?? undefined,
});
// Set up unhandledrejection handler inside the worker
// Following the same pattern as globalHandlers
// unhandled rejections don't bubble to the parent thread, so we need to handle them here
self.addEventListener('unhandledrejection', (event) => {
const reason = globalhandlers._getUnhandledRejectionError(event);
// Forward the raw reason to parent thread
// The parent will handle primitives vs errors the same way globalHandlers does
const serializedError = {
reason: reason,
filename: self.location?.href,
};
// Forward to parent thread
self.postMessage({
_sentryMessage: true,
_sentryWorkerError: serializedError,
});
debugBuild.DEBUG_BUILD && core.debug.log('[Sentry Worker] Forwarding unhandled rejection to parent', serializedError);
});
debugBuild.DEBUG_BUILD && core.debug.log('[Sentry Worker] Registered worker with unhandled rejection handling');
}
function isSentryMessage(eventData) {
if (!core.isPlainObject(eventData) || eventData._sentryMessage !== true) {
return false;
}
// Must have at least one of: debug IDs, module metadata, worker error, or WASM images
const hasDebugIds = '_sentryDebugIds' in eventData;
const hasModuleMetadata = '_sentryModuleMetadata' in eventData;
const hasWorkerError = '_sentryWorkerError' in eventData;
const hasWasmImages = '_sentryWasmImages' in eventData;
if (!hasDebugIds && !hasModuleMetadata && !hasWorkerError && !hasWasmImages) {
return false;
}
// Validate debug IDs if present
if (hasDebugIds && !(core.isPlainObject(eventData._sentryDebugIds) || eventData._sentryDebugIds === undefined)) {
return false;
}
// Validate module metadata if present
if (
hasModuleMetadata &&
!(core.isPlainObject(eventData._sentryModuleMetadata) || eventData._sentryModuleMetadata === undefined)
) {
return false;
}
// Validate worker error if present
if (hasWorkerError && !core.isPlainObject(eventData._sentryWorkerError)) {
return false;
}
// Validate WASM images if present
if (
hasWasmImages &&
(!Array.isArray(eventData._sentryWasmImages) ||
!eventData._sentryWasmImages.every(
(img) => core.isPlainObject(img) && typeof (img ).code_file === 'string',
))
) {
return false;
}
return true;
}
exports.INTEGRATION_NAME = INTEGRATION_NAME;
exports.registerWebWorker = registerWebWorker;
exports.webWorkerIntegration = webWorkerIntegration;
//# sourceMappingURL=webWorker.js.map

View File

@@ -0,0 +1,27 @@
"use strict";
exports.zhHK = void 0;
var _index = require("./zh-HK/_lib/formatDistance.js");
var _index2 = require("./zh-HK/_lib/formatLong.js");
var _index3 = require("./zh-HK/_lib/formatRelative.js");
var _index4 = require("./zh-HK/_lib/localize.js");
var _index5 = require("./zh-HK/_lib/match.js");
/**
* @category Locales
* @summary Chinese Traditional locale.
* @language Chinese Traditional
* @iso-639-2 zho
* @author Gary Ip [@gaplo](https://github.com/gaplo)
*/
const zhHK = (exports.zhHK = {
code: "zh-HK",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
});

View File

@@ -0,0 +1,5 @@
var id = 0;
function _classPrivateFieldKey(e) {
return "__private_" + id++ + "_" + e;
}
module.exports = _classPrivateFieldKey, module.exports.__esModule = true, module.exports["default"] = module.exports;

View File

@@ -0,0 +1,289 @@
/**
* 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 type { EditorConfig, KlassConstructor, LexicalEditor, Spread } from '../LexicalEditor';
import type { DOMConversionMap, DOMExportOutput, LexicalUpdateJSON, NodeKey, SerializedLexicalNode } from '../LexicalNode';
import type { BaseSelection, RangeSelection } from '../LexicalSelection';
import type { ElementNode } from './LexicalElementNode';
import { LexicalNode } from '../LexicalNode';
export type SerializedTextNode = Spread<{
detail: number;
format: number;
mode: TextModeType;
style: string;
text: string;
}, SerializedLexicalNode>;
export type TextDetailType = 'directionless' | 'unmergable';
export type TextFormatType = 'bold' | 'underline' | 'strikethrough' | 'italic' | 'highlight' | 'code' | 'subscript' | 'superscript' | 'lowercase' | 'uppercase' | 'capitalize';
export type TextModeType = 'normal' | 'token' | 'segmented';
export type TextMark = {
end: null | number;
id: string;
start: null | number;
};
export type TextMarks = Array<TextMark>;
export interface TextNode {
getTopLevelElement(): ElementNode | null;
getTopLevelElementOrThrow(): ElementNode;
}
/** @noInheritDoc */
export declare class TextNode extends LexicalNode {
['constructor']: KlassConstructor<typeof TextNode>;
__text: string;
/** @internal */
__format: number;
/** @internal */
__style: string;
/** @internal */
__mode: 0 | 1 | 2 | 3;
/** @internal */
__detail: number;
static getType(): string;
static clone(node: TextNode): TextNode;
afterCloneFrom(prevNode: this): void;
constructor(text?: string, key?: NodeKey);
/**
* Returns a 32-bit integer that represents the TextFormatTypes currently applied to the
* TextNode. You probably don't want to use this method directly - consider using TextNode.hasFormat instead.
*
* @returns a number representing the format of the text node.
*/
getFormat(): number;
/**
* Returns a 32-bit integer that represents the TextDetailTypes currently applied to the
* TextNode. You probably don't want to use this method directly - consider using TextNode.isDirectionless
* or TextNode.isUnmergeable instead.
*
* @returns a number representing the detail of the text node.
*/
getDetail(): number;
/**
* Returns the mode (TextModeType) of the TextNode, which may be "normal", "token", or "segmented"
*
* @returns TextModeType.
*/
getMode(): TextModeType;
/**
* Returns the styles currently applied to the node. This is analogous to CSSText in the DOM.
*
* @returns CSSText-like string of styles applied to the underlying DOM node.
*/
getStyle(): string;
/**
* Returns whether or not the node is in "token" mode. TextNodes in token mode can be navigated through character-by-character
* with a RangeSelection, but are deleted as a single entity (not individually by character).
*
* @returns true if the node is in token mode, false otherwise.
*/
isToken(): boolean;
/**
*
* @returns true if Lexical detects that an IME or other 3rd-party script is attempting to
* mutate the TextNode, false otherwise.
*/
isComposing(): boolean;
/**
* Returns whether or not the node is in "segmented" mode. TextNodes in segmented mode can be navigated through character-by-character
* with a RangeSelection, but are deleted in space-delimited "segments".
*
* @returns true if the node is in segmented mode, false otherwise.
*/
isSegmented(): boolean;
/**
* Returns whether or not the node is "directionless". Directionless nodes don't respect changes between RTL and LTR modes.
*
* @returns true if the node is directionless, false otherwise.
*/
isDirectionless(): boolean;
/**
* Returns whether or not the node is unmergeable. In some scenarios, Lexical tries to merge
* adjacent TextNodes into a single TextNode. If a TextNode is unmergeable, this won't happen.
*
* @returns true if the node is unmergeable, false otherwise.
*/
isUnmergeable(): boolean;
/**
* Returns whether or not the node has the provided format applied. Use this with the human-readable TextFormatType
* string values to get the format of a TextNode.
*
* @param type - the TextFormatType to check for.
*
* @returns true if the node has the provided format, false otherwise.
*/
hasFormat(type: TextFormatType): boolean;
/**
* Returns whether or not the node is simple text. Simple text is defined as a TextNode that has the string type "text"
* (i.e., not a subclass) and has no mode applied to it (i.e., not segmented or token).
*
* @returns true if the node is simple text, false otherwise.
*/
isSimpleText(): boolean;
/**
* Returns the text content of the node as a string.
*
* @returns a string representing the text content of the node.
*/
getTextContent(): string;
/**
* Returns the format flags applied to the node as a 32-bit integer.
*
* @returns a number representing the TextFormatTypes applied to the node.
*/
getFormatFlags(type: TextFormatType, alignWithFormat: null | number): number;
/**
*
* @returns true if the text node supports font styling, false otherwise.
*/
canHaveFormat(): boolean;
/**
* @returns true if the text node is inline, false otherwise.
*/
isInline(): true;
createDOM(config: EditorConfig, editor?: LexicalEditor): HTMLElement;
updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean;
static importDOM(): DOMConversionMap | null;
static importJSON(serializedNode: SerializedTextNode): TextNode;
updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedTextNode>): this;
exportDOM(editor: LexicalEditor): DOMExportOutput;
exportJSON(): SerializedTextNode;
selectionTransform(prevSelection: null | BaseSelection, nextSelection: RangeSelection): void;
/**
* Sets the node format to the provided TextFormatType or 32-bit integer. Note that the TextFormatType
* version of the argument can only specify one format and doing so will remove all other formats that
* may be applied to the node. For toggling behavior, consider using {@link TextNode.toggleFormat}
*
* @param format - TextFormatType or 32-bit integer representing the node format.
*
* @returns this TextNode.
* // TODO 0.12 This should just be a `string`.
*/
setFormat(format: TextFormatType | number): this;
/**
* Sets the node detail to the provided TextDetailType or 32-bit integer. Note that the TextDetailType
* version of the argument can only specify one detail value and doing so will remove all other detail values that
* may be applied to the node. For toggling behavior, consider using {@link TextNode.toggleDirectionless}
* or {@link TextNode.toggleUnmergeable}
*
* @param detail - TextDetailType or 32-bit integer representing the node detail.
*
* @returns this TextNode.
* // TODO 0.12 This should just be a `string`.
*/
setDetail(detail: TextDetailType | number): this;
/**
* Sets the node style to the provided CSSText-like string. Set this property as you
* would an HTMLElement style attribute to apply inline styles to the underlying DOM Element.
*
* @param style - CSSText to be applied to the underlying HTMLElement.
*
* @returns this TextNode.
*/
setStyle(style: string): this;
/**
* Applies the provided format to this TextNode if it's not present. Removes it if it's present.
* The subscript and superscript formats are mutually exclusive.
* Prefer using this method to turn specific formats on and off.
*
* @param type - TextFormatType to toggle.
*
* @returns this TextNode.
*/
toggleFormat(type: TextFormatType): this;
/**
* Toggles the directionless detail value of the node. Prefer using this method over setDetail.
*
* @returns this TextNode.
*/
toggleDirectionless(): this;
/**
* Toggles the unmergeable detail value of the node. Prefer using this method over setDetail.
*
* @returns this TextNode.
*/
toggleUnmergeable(): this;
/**
* Sets the mode of the node.
*
* @returns this TextNode.
*/
setMode(type: TextModeType): this;
/**
* Sets the text content of the node.
*
* @param text - the string to set as the text value of the node.
*
* @returns this TextNode.
*/
setTextContent(text: string): this;
/**
* Sets the current Lexical selection to be a RangeSelection with anchor and focus on this TextNode at the provided offsets.
*
* @param _anchorOffset - the offset at which the Selection anchor will be placed.
* @param _focusOffset - the offset at which the Selection focus will be placed.
*
* @returns the new RangeSelection.
*/
select(_anchorOffset?: number, _focusOffset?: number): RangeSelection;
selectStart(): RangeSelection;
selectEnd(): RangeSelection;
/**
* Inserts the provided text into this TextNode at the provided offset, deleting the number of characters
* specified. Can optionally calculate a new selection after the operation is complete.
*
* @param offset - the offset at which the splice operation should begin.
* @param delCount - the number of characters to delete, starting from the offset.
* @param newText - the text to insert into the TextNode at the offset.
* @param moveSelection - optional, whether or not to move selection to the end of the inserted substring.
*
* @returns this TextNode.
*/
spliceText(offset: number, delCount: number, newText: string, moveSelection?: boolean): TextNode;
/**
* This method is meant to be overridden by TextNode subclasses to control the behavior of those nodes
* when a user event would cause text to be inserted before them in the editor. If true, Lexical will attempt
* to insert text into this node. If false, it will insert the text in a new sibling node.
*
* @returns true if text can be inserted before the node, false otherwise.
*/
canInsertTextBefore(): boolean;
/**
* This method is meant to be overridden by TextNode subclasses to control the behavior of those nodes
* when a user event would cause text to be inserted after them in the editor. If true, Lexical will attempt
* to insert text into this node. If false, it will insert the text in a new sibling node.
*
* @returns true if text can be inserted after the node, false otherwise.
*/
canInsertTextAfter(): boolean;
/**
* Splits this TextNode at the provided character offsets, forming new TextNodes from the substrings
* formed by the split, and inserting those new TextNodes into the editor, replacing the one that was split.
*
* @param splitOffsets - rest param of the text content character offsets at which this node should be split.
*
* @returns an Array containing the newly-created TextNodes.
*/
splitText(...splitOffsets: Array<number>): Array<TextNode>;
/**
* Merges the target TextNode into this TextNode, removing the target node.
*
* @param target - the TextNode to merge into this one.
*
* @returns this TextNode.
*/
mergeWithSibling(target: TextNode): TextNode;
/**
* This method is meant to be overridden by TextNode subclasses to control the behavior of those nodes
* when used with the registerLexicalTextEntity function. If you're using registerLexicalTextEntity, the
* node class that you create and replace matched text with should return true from this method.
*
* @returns true if the node is to be treated as a "text entity", false otherwise.
*/
isTextEntity(): boolean;
}
export declare function findParentPreDOMNode(node: Node): Node | null;
export declare function $createTextNode(text?: string): TextNode;
export declare function $isTextNode(node: LexicalNode | null | undefined): node is TextNode;

View File

@@ -0,0 +1,18 @@
/**
* @name hoursToSeconds
* @category Conversion Helpers
* @summary Convert hours to seconds.
*
* @description
* Convert a number of hours to a full number of seconds.
*
* @param hours - The number of hours to be converted
*
* @returns The number of hours converted in seconds
*
* @example
* // Convert 2 hours to seconds:
* const result = hoursToSeconds(2)
* //=> 7200
*/
export declare function hoursToSeconds(hours: number): number;

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