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,27 @@
"use strict";
exports.gd = void 0;
var _index = require("./gd/_lib/formatDistance.js");
var _index2 = require("./gd/_lib/formatLong.js");
var _index3 = require("./gd/_lib/formatRelative.js");
var _index4 = require("./gd/_lib/localize.js");
var _index5 = require("./gd/_lib/match.js");
/**
* @category Locales
* @summary Scottish Gaelic.
* @language Scottish Gaelic
* @iso-639-2 gla
* @author Lee Driscoll [@leedriscoll](https://github.com/leedriscoll)
*/
const gd = (exports.gd = {
code: "gd",
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 @@
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,UAAU,aAAa;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAClD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAClD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACnD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CACpD,CAAC;AAGF,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CA2B3D"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","baseClass","SimpleTable","appearance","className","headerCells","headers","tableRows","rows","_jsx","filter","Boolean","join","_jsxs","cellPadding","cellSpacing","TableHead","TableRow","TableBody","children","rest","trim","TableCell","TableHeader","HiddenCell"],"sources":["../../../../src/elements/FolderView/SimpleTable/index.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'simple-table'\n\ntype TableProps = {\n readonly appearance?: 'condensed' | 'default'\n readonly className?: string\n readonly headerCells: React.ReactNode[]\n readonly tableRows: React.ReactNode[]\n}\nexport const SimpleTable = ({\n appearance,\n className,\n headerCells: headers,\n tableRows: rows,\n}: TableProps) => {\n return (\n <div\n className={[className, baseClass, appearance && `${baseClass}--appearance-${appearance}`]\n .filter(Boolean)\n .join(' ')}\n >\n <table cellPadding={0} cellSpacing={0} className={`${baseClass}__table`}>\n <TableHead>\n <TableRow>{headers}</TableRow>\n </TableHead>\n\n <TableBody>{rows}</TableBody>\n </table>\n </div>\n )\n}\n\nexport const TableHead = ({\n children,\n className,\n ...rest\n}: React.HTMLAttributes<HTMLTableSectionElement>) => {\n return (\n <thead className={`${baseClass}__thead ${className || ''}`.trim()} {...rest}>\n {children}\n </thead>\n )\n}\n\nexport const TableBody = ({\n children,\n className,\n ...rest\n}: React.HTMLAttributes<HTMLTableSectionElement>) => {\n return (\n <tbody className={`${baseClass}__tbody ${className || ''}`.trim()} {...rest}>\n {children}\n </tbody>\n )\n}\n\nexport const TableRow = ({\n children,\n className,\n ...rest\n}: React.HTMLAttributes<HTMLTableRowElement>) => {\n return (\n <tr className={`${baseClass}__tr ${className || ''}`.trim()} {...rest}>\n {children}\n </tr>\n )\n}\n\nexport const TableCell = ({\n children,\n className,\n ...rest\n}: React.TdHTMLAttributes<HTMLTableCellElement>) => {\n return (\n <td className={`${baseClass}__td ${className || ''}`.trim()} {...rest}>\n {children}\n </td>\n )\n}\n\nexport const TableHeader = ({\n children,\n className,\n ...rest\n}: React.ThHTMLAttributes<HTMLTableCellElement>) => {\n return (\n <th className={`${baseClass}__th ${className || ''}`.trim()} {...rest}>\n {children}\n </th>\n )\n}\n\nexport const HiddenCell = ({\n children,\n className,\n ...rest\n}: { children?: React.ReactNode } & React.TdHTMLAttributes<HTMLTableCellElement>) => {\n return (\n <td className={`${baseClass}__hidden-cell ${className || ''}`.trim()} {...rest}>\n {children}\n </td>\n )\n}\n"],"mappings":"AAAA;;;AAEA,OAAOA,KAAA,MAAW;AAElB,OAAO;AAEP,MAAMC,SAAA,GAAY;AAQlB,OAAO,MAAMC,WAAA,GAAcA,CAAC;EAC1BC,UAAU;EACVC,SAAS;EACTC,WAAA,EAAaC,OAAO;EACpBC,SAAA,EAAWC;AAAI,CACJ;EACX,oBACEC,IAAA,CAAC;IACCL,SAAA,EAAW,CAACA,SAAA,EAAWH,SAAA,EAAWE,UAAA,IAAc,GAAGF,SAAA,gBAAyBE,UAAA,EAAY,CAAC,CACtFO,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;cAER,aAAAC,KAAA,CAAC;MAAMC,WAAA,EAAa;MAAGC,WAAA,EAAa;MAAGX,SAAA,EAAW,GAAGH,SAAA,SAAkB;8BACrEQ,IAAA,CAACO,SAAA;kBACC,aAAAP,IAAA,CAACQ,QAAA;oBAAUX;;uBAGbG,IAAA,CAACS,SAAA;kBAAWV;;;;AAIpB;AAEA,OAAO,MAAMQ,SAAA,GAAYA,CAAC;EACxBG,QAAQ;EACRf,SAAS;EACT,GAAGgB;AAAA,CAC2C;EAC9C,oBACEX,IAAA,CAAC;IAAML,SAAA,EAAW,GAAGH,SAAA,WAAoBG,SAAA,IAAa,IAAI,CAACiB,IAAI;IAAK,GAAGD,IAAI;cACxED;;AAGP;AAEA,OAAO,MAAMD,SAAA,GAAYA,CAAC;EACxBC,QAAQ;EACRf,SAAS;EACT,GAAGgB;AAAA,CAC2C;EAC9C,oBACEX,IAAA,CAAC;IAAML,SAAA,EAAW,GAAGH,SAAA,WAAoBG,SAAA,IAAa,IAAI,CAACiB,IAAI;IAAK,GAAGD,IAAI;cACxED;;AAGP;AAEA,OAAO,MAAMF,QAAA,GAAWA,CAAC;EACvBE,QAAQ;EACRf,SAAS;EACT,GAAGgB;AAAA,CACuC;EAC1C,oBACEX,IAAA,CAAC;IAAGL,SAAA,EAAW,GAAGH,SAAA,QAAiBG,SAAA,IAAa,IAAI,CAACiB,IAAI;IAAK,GAAGD,IAAI;cAClED;;AAGP;AAEA,OAAO,MAAMG,SAAA,GAAYA,CAAC;EACxBH,QAAQ;EACRf,SAAS;EACT,GAAGgB;AAAA,CAC0C;EAC7C,oBACEX,IAAA,CAAC;IAAGL,SAAA,EAAW,GAAGH,SAAA,QAAiBG,SAAA,IAAa,IAAI,CAACiB,IAAI;IAAK,GAAGD,IAAI;cAClED;;AAGP;AAEA,OAAO,MAAMI,WAAA,GAAcA,CAAC;EAC1BJ,QAAQ;EACRf,SAAS;EACT,GAAGgB;AAAA,CAC0C;EAC7C,oBACEX,IAAA,CAAC;IAAGL,SAAA,EAAW,GAAGH,SAAA,QAAiBG,SAAA,IAAa,IAAI,CAACiB,IAAI;IAAK,GAAGD,IAAI;cAClED;;AAGP;AAEA,OAAO,MAAMK,UAAA,GAAaA,CAAC;EACzBL,QAAQ;EACRf,SAAS;EACT,GAAGgB;AAAA,CAC2E;EAC9E,oBACEX,IAAA,CAAC;IAAGL,SAAA,EAAW,GAAGH,SAAA,iBAA0BG,SAAA,IAAa,IAAI,CAACiB,IAAI;IAAK,GAAGD,IAAI;cAC3ED;;AAGP","ignoreList":[]}

View File

@@ -0,0 +1,300 @@
import { defineIntegration, debug, isPlainObject, getClient, isPrimitive, captureEvent } from '@sentry/core';
import { DEBUG_BUILD } from '../debug-build.js';
import { eventFromUnknownInput } from '../eventbuilder.js';
import { WINDOW } from '../helpers.js';
import { _eventFromRejectionWithPrimitive, _getUnhandledRejectionError } from './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 = 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) {
DEBUG_BUILD && debug.log('Sentry debugId web worker message received', event.data);
WINDOW._sentryDebugIds = {
...event.data._sentryDebugIds,
// debugIds of the main thread have precedence over the worker's in case of a collision.
...WINDOW._sentryDebugIds,
};
}
// Handle module metadata
if (event.data._sentryModuleMetadata) {
DEBUG_BUILD && 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
WINDOW._sentryModuleMetadata = {
...event.data._sentryModuleMetadata,
// Module metadata of the main thread have precedence over the worker's in case of a collision.
...WINDOW._sentryModuleMetadata,
};
}
// Handle WASM images from worker
if (event.data._sentryWasmImages) {
DEBUG_BUILD && debug.log('Sentry WASM images web worker message received', event.data);
const existingImages =
(WINDOW )._sentryWasmImages || [];
const newImages = event.data._sentryWasmImages.filter(
(newImg) =>
isPlainObject(newImg) &&
typeof newImg.code_file === 'string' &&
!existingImages.some(existing => existing.code_file === newImg.code_file),
);
(WINDOW )._sentryWasmImages = [
...existingImages,
...newImages,
];
}
// Handle unhandled rejections forwarded from worker
if (event.data._sentryWorkerError) {
DEBUG_BUILD && debug.log('Sentry worker rejection message received', event.data._sentryWorkerError);
handleForwardedWorkerRejection(event.data._sentryWorkerError);
}
}
});
}
function handleForwardedWorkerRejection(workerError) {
const client = 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 = isPrimitive(error)
? _eventFromRejectionWithPrimitive(error)
: eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);
event.level = 'error';
// Add worker-specific context
if (workerError.filename) {
event.contexts = {
...event.contexts,
worker: {
filename: workerError.filename,
},
};
}
captureEvent(event, {
originalException: error,
mechanism: {
handled: false,
type: 'auto.browser.web_worker.onunhandledrejection',
},
});
DEBUG_BUILD && 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 = _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,
});
DEBUG_BUILD && debug.log('[Sentry Worker] Forwarding unhandled rejection to parent', serializedError);
});
DEBUG_BUILD && debug.log('[Sentry Worker] Registered worker with unhandled rejection handling');
}
function isSentryMessage(eventData) {
if (!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 && !(isPlainObject(eventData._sentryDebugIds) || eventData._sentryDebugIds === undefined)) {
return false;
}
// Validate module metadata if present
if (
hasModuleMetadata &&
!(isPlainObject(eventData._sentryModuleMetadata) || eventData._sentryModuleMetadata === undefined)
) {
return false;
}
// Validate worker error if present
if (hasWorkerError && !isPlainObject(eventData._sentryWorkerError)) {
return false;
}
// Validate WASM images if present
if (
hasWasmImages &&
(!Array.isArray(eventData._sentryWasmImages) ||
!eventData._sentryWasmImages.every(
(img) => isPlainObject(img) && typeof (img ).code_file === 'string',
))
) {
return false;
}
return true;
}
export { INTEGRATION_NAME, registerWebWorker, webWorkerIntegration };
//# sourceMappingURL=webWorker.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_remapping","data","require","mergeSourceMap","inputMap","map","sourceFileName","source","replace","found","result","remapping","rootless","s","ctx","sourceRoot","Object","assign"],"sources":["../../../src/transformation/file/merge-map.ts"],"sourcesContent":["type SourceMap = any;\nimport remapping from \"@jridgewell/remapping\";\n\nexport default function mergeSourceMap(\n inputMap: SourceMap,\n map: SourceMap,\n sourceFileName: string,\n): SourceMap {\n // On win32 machines, the sourceFileName uses backslash paths like\n // `C:\\foo\\bar.js`. But sourcemaps are always posix paths, so we need to\n // normalize to regular slashes before we can merge (else we won't find the\n // source associated with our input map).\n // This mirrors code done while generating the output map at\n // https://github.com/babel/babel/blob/5c2fcadc9ae34fd20dd72b1111d5cf50476d700d/packages/babel-generator/src/source-map.ts#L102\n const source = sourceFileName.replace(/\\\\/g, \"/\");\n\n // Prevent an infinite recursion if one of the input map's sources has the\n // same resolved path as the input map. In the case, it would keep find the\n // input map, then get it's sources which will include a path like the input\n // map, on and on.\n let found = false;\n const result = remapping(rootless(map), (s, ctx) => {\n if (s === source && !found) {\n found = true;\n // We empty the source location, which will prevent the sourcemap from\n // becoming relative to the input's location. Eg, if we're transforming a\n // file 'foo/bar.js', and it is a transformation of a `baz.js` file in the\n // same directory, the expected output is just `baz.js`. Without this step,\n // it would become `foo/baz.js`.\n ctx.source = \"\";\n\n return rootless(inputMap);\n }\n\n return null;\n });\n\n if (typeof inputMap.sourceRoot === \"string\") {\n result.sourceRoot = inputMap.sourceRoot;\n }\n\n // remapping returns a SourceMap class type, but this breaks code downstream in\n // @babel/traverse and @babel/types that relies on data being plain objects.\n // When it encounters the sourcemap type it outputs a \"don't know how to turn\n // this value into a node\" error. As a result, we are converting the merged\n // sourcemap to a plain js object.\n return { ...result };\n}\n\nfunction rootless(map: SourceMap): SourceMap {\n return {\n ...map,\n\n // This is a bit hack. Remapping will create absolute sources in our\n // sourcemap, but we want to maintain sources relative to the sourceRoot.\n // We'll re-add the sourceRoot after remapping.\n sourceRoot: null,\n };\n}\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEe,SAASE,cAAcA,CACpCC,QAAmB,EACnBC,GAAc,EACdC,cAAsB,EACX;EAOX,MAAMC,MAAM,GAAGD,cAAc,CAACE,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAMjD,IAAIC,KAAK,GAAG,KAAK;EACjB,MAAMC,MAAM,GAAGC,WAAQA,CAAC,CAACC,QAAQ,CAACP,GAAG,CAAC,EAAE,CAACQ,CAAC,EAAEC,GAAG,KAAK;IAClD,IAAID,CAAC,KAAKN,MAAM,IAAI,CAACE,KAAK,EAAE;MAC1BA,KAAK,GAAG,IAAI;MAMZK,GAAG,CAACP,MAAM,GAAG,EAAE;MAEf,OAAOK,QAAQ,CAACR,QAAQ,CAAC;IAC3B;IAEA,OAAO,IAAI;EACb,CAAC,CAAC;EAEF,IAAI,OAAOA,QAAQ,CAACW,UAAU,KAAK,QAAQ,EAAE;IAC3CL,MAAM,CAACK,UAAU,GAAGX,QAAQ,CAACW,UAAU;EACzC;EAOA,OAAAC,MAAA,CAAAC,MAAA,KAAYP,MAAM;AACpB;AAEA,SAASE,QAAQA,CAACP,GAAc,EAAa;EAC3C,OAAAW,MAAA,CAAAC,MAAA,KACKZ,GAAG;IAKNU,UAAU,EAAE;EAAI;AAEpB;AAAC","ignoreList":[]}

View File

@@ -0,0 +1,52 @@
import type * as core from "./core.js";
import * as schemas from "./schemas.js";
import { $ZodTuple } from "./schemas.js";
import type * as util from "./util.js";
export interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> {
type: "function";
input: In;
output: Out;
}
export type $ZodFunctionArgs = schemas.$ZodType<unknown[], unknown[]>;
export type $ZodFunctionIn = $ZodFunctionArgs;
export type $ZodFunctionOut = schemas.$ZodType;
export type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.output<Args>) => core.input<Returns>;
export type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.output<Args>) => util.MaybeAsync<core.input<Returns>>;
export type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.input<Args>) => core.output<Returns>;
export type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : core.input<Args>) => util.MaybeAsync<core.output<Returns>>;
export declare class $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> {
def: $ZodFunctionDef<Args, Returns>;
/** @deprecated */
_def: $ZodFunctionDef<Args, Returns>;
_input: $InferInnerFunctionType<Args, Returns>;
_output: $InferOuterFunctionType<Args, Returns>;
constructor(def: $ZodFunctionDef<Args, Returns>);
implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
input<const Items extends util.TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<schemas.$ZodTuple<Items, Rest>, Returns>;
input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
output<NewReturns extends schemas.$ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
}
export interface $ZodFunctionParams<I extends $ZodFunctionIn, O extends schemas.$ZodType> {
input?: I;
output?: O;
}
declare function _function(): $ZodFunction;
declare function _function<const In extends Array<schemas.$ZodType> = Array<schemas.$ZodType>>(params: {
input: In;
}): $ZodFunction<$ZodTuple<In, null>, $ZodFunctionOut>;
declare function _function<const In extends Array<schemas.$ZodType> = Array<schemas.$ZodType>, const Out extends $ZodFunctionOut = $ZodFunctionOut>(params: {
input: In;
output: Out;
}): $ZodFunction<$ZodTuple<In, null>, Out>;
declare function _function<const In extends $ZodFunctionIn = $ZodFunctionIn>(params: {
input: In;
}): $ZodFunction<In, $ZodFunctionOut>;
declare function _function<const Out extends $ZodFunctionOut = $ZodFunctionOut>(params: {
output: Out;
}): $ZodFunction<$ZodFunctionIn, Out>;
declare function _function<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends schemas.$ZodType = schemas.$ZodType>(params?: {
input: In;
output: Out;
}): $ZodFunction<In, Out>;
export { _function as function };

View File

@@ -0,0 +1,111 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.RequireInTheMiddleSingleton = void 0;
const require_in_the_middle_1 = require("require-in-the-middle");
const path = require("path");
const ModuleNameTrie_1 = require("./ModuleNameTrie");
/**
* Whether Mocha is running in this process
* Inspired by https://github.com/AndreasPizsa/detect-mocha
*
* @type {boolean}
*/
const isMocha = [
'afterEach',
'after',
'beforeEach',
'before',
'describe',
'it',
].every(fn => {
// @ts-expect-error TS7053: Element implicitly has an 'any' type
return typeof global[fn] === 'function';
});
/**
* Singleton class for `require-in-the-middle`
* Allows instrumentation plugins to patch modules with only a single `require` patch
* WARNING: Because this class will create its own `require-in-the-middle` (RITM) instance,
* we should minimize the number of new instances of this class.
* Multiple instances of `@opentelemetry/instrumentation` (e.g. multiple versions) in a single process
* will result in multiple instances of RITM, which will have an impact
* on the performance of instrumentation hooks being applied.
*/
class RequireInTheMiddleSingleton {
_moduleNameTrie = new ModuleNameTrie_1.ModuleNameTrie();
static _instance;
constructor() {
this._initialize();
}
_initialize() {
new require_in_the_middle_1.Hook(
// Intercept all `require` calls; we will filter the matching ones below
null, { internals: true }, (exports, name, basedir) => {
// For internal files on Windows, `name` will use backslash as the path separator
const normalizedModuleName = normalizePathSeparators(name);
const matches = this._moduleNameTrie.search(normalizedModuleName, {
maintainInsertionOrder: true,
// For core modules (e.g. `fs`), do not match on sub-paths (e.g. `fs/promises').
// This matches the behavior of `require-in-the-middle`.
// `basedir` is always `undefined` for core modules.
fullOnly: basedir === undefined,
});
for (const { onRequire } of matches) {
exports = onRequire(exports, name, basedir);
}
return exports;
});
}
/**
* Register a hook with `require-in-the-middle`
*
* @param {string} moduleName Module name
* @param {OnRequireFn} onRequire Hook function
* @returns {Hooked} Registered hook
*/
register(moduleName, onRequire) {
const hooked = { moduleName, onRequire };
this._moduleNameTrie.insert(hooked);
return hooked;
}
/**
* Get the `RequireInTheMiddleSingleton` singleton
*
* @returns {RequireInTheMiddleSingleton} Singleton of `RequireInTheMiddleSingleton`
*/
static getInstance() {
// Mocha runs all test suites in the same process
// This prevents test suites from sharing a singleton
if (isMocha)
return new RequireInTheMiddleSingleton();
return (this._instance =
this._instance ?? new RequireInTheMiddleSingleton());
}
}
exports.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton;
/**
* Normalize the path separators to forward slash in a module name or path
*
* @param {string} moduleNameOrPath Module name or path
* @returns {string} Normalized module name or path
*/
function normalizePathSeparators(moduleNameOrPath) {
return path.sep !== ModuleNameTrie_1.ModuleNameSeparator
? moduleNameOrPath.split(path.sep).join(ModuleNameTrie_1.ModuleNameSeparator)
: moduleNameOrPath;
}
//# sourceMappingURL=RequireInTheMiddleSingleton.js.map

View File

@@ -0,0 +1,10 @@
"use strict";
exports.isLastDayOfMonth = void 0;
var _index = require("../isLastDayOfMonth.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isLastDayOfMonth = (exports.isLastDayOfMonth = (0, _index2.convertToFP)(
_index.isLastDayOfMonth,
1,
));

View File

@@ -0,0 +1 @@
{"version":3,"file":"debounce.js","sources":["../../../src/utils/debounce.ts"],"sourcesContent":["type DebouncedCallback = {\n (): void | unknown;\n flush: () => void | unknown;\n cancel: () => void;\n};\ntype CallbackFunction = () => unknown;\ntype DebounceOptions = {\n /** The max. time in ms to wait for the callback to be invoked. */\n maxWait?: number;\n /** This can be overwritten to use a different setTimeout implementation, e.g. to avoid triggering change detection in Angular */\n setTimeoutImpl?: typeof setTimeout;\n};\n\n/**\n * Heavily simplified debounce function based on lodash.debounce.\n *\n * This function takes a callback function (@param fun) and delays its invocation\n * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,\n * which ensures that the callback is invoked at least once after the specified max. wait time.\n *\n * @param func the function whose invocation is to be debounced\n * @param wait the minimum time until the function is invoked after it was called once\n * @param options the options object, which can contain the `maxWait` property\n *\n * @returns the debounced version of the function, which needs to be called at least once to start the\n * debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc\n * was already invoked in the meantime, return @param func's return value.\n * The debounced function has two additional properties:\n * - `flush`: Invokes the debounced function immediately and returns its return value\n * - `cancel`: Cancels the debouncing process and resets the debouncing timer\n */\nexport function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback {\n let callbackReturnValue: unknown;\n\n let timerId: ReturnType<typeof setTimeout> | undefined;\n let maxTimerId: ReturnType<typeof setTimeout> | undefined;\n\n const maxWait = options?.maxWait ? Math.max(options.maxWait, wait) : 0;\n const setTimeoutImpl = options?.setTimeoutImpl || setTimeout;\n\n function invokeFunc(): unknown {\n cancelTimers();\n callbackReturnValue = func();\n return callbackReturnValue;\n }\n\n function cancelTimers(): void {\n timerId !== undefined && clearTimeout(timerId);\n maxTimerId !== undefined && clearTimeout(maxTimerId);\n timerId = maxTimerId = undefined;\n }\n\n function flush(): unknown {\n if (timerId !== undefined || maxTimerId !== undefined) {\n return invokeFunc();\n }\n return callbackReturnValue;\n }\n\n function debounced(): unknown {\n if (timerId) {\n clearTimeout(timerId);\n }\n timerId = setTimeoutImpl(invokeFunc, wait);\n\n if (maxWait && maxTimerId === undefined) {\n maxTimerId = setTimeoutImpl(invokeFunc, maxWait);\n }\n\n return callbackReturnValue;\n }\n\n debounced.cancel = cancelTimers;\n debounced.flush = flush;\n return debounced;\n}\n"],"names":[],"mappings":";;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,IAAI,EAAoB,IAAI,EAAU,OAAO,EAAuC;AAC7G,EAAE,IAAI,mBAAmB;;AAEzB,EAAE,IAAI,OAAO;AACb,EAAE,IAAI,UAAU;;AAEhB,EAAE,MAAM,OAAA,GAAU,OAAO,EAAE,OAAA,GAAU,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAA,GAAI,CAAC;AACxE,EAAE,MAAM,cAAA,GAAiB,OAAO,EAAE,cAAA,IAAkB,UAAU;;AAE9D,EAAE,SAAS,UAAU,GAAY;AACjC,IAAI,YAAY,EAAE;AAClB,IAAI,mBAAA,GAAsB,IAAI,EAAE;AAChC,IAAI,OAAO,mBAAmB;AAC9B,EAAE;;AAEF,EAAE,SAAS,YAAY,GAAS;AAChC,IAAI,YAAY,SAAA,IAAa,YAAY,CAAC,OAAO,CAAC;AAClD,IAAI,eAAe,SAAA,IAAa,YAAY,CAAC,UAAU,CAAC;AACxD,IAAI,OAAA,GAAU,UAAA,GAAa,SAAS;AACpC,EAAE;;AAEF,EAAE,SAAS,KAAK,GAAY;AAC5B,IAAI,IAAI,OAAA,KAAY,aAAa,UAAA,KAAe,SAAS,EAAE;AAC3D,MAAM,OAAO,UAAU,EAAE;AACzB,IAAI;AACJ,IAAI,OAAO,mBAAmB;AAC9B,EAAE;;AAEF,EAAE,SAAS,SAAS,GAAY;AAChC,IAAI,IAAI,OAAO,EAAE;AACjB,MAAM,YAAY,CAAC,OAAO,CAAC;AAC3B,IAAI;AACJ,IAAI,UAAU,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC;;AAE9C,IAAI,IAAI,OAAA,IAAW,UAAA,KAAe,SAAS,EAAE;AAC7C,MAAM,aAAa,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC;AACtD,IAAI;;AAEJ,IAAI,OAAO,mBAAmB;AAC9B,EAAE;;AAEF,EAAE,SAAS,CAAC,MAAA,GAAS,YAAY;AACjC,EAAE,SAAS,CAAC,KAAA,GAAQ,KAAK;AACzB,EAAE,OAAO,SAAS;AAClB;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","lazy","Suspense","ShimmerEffect","LazyEditor","CodeEditor","props","_jsx","fallback"],"sources":["../../../src/elements/CodeEditor/index.tsx"],"sourcesContent":["'use client'\nimport React, { lazy, Suspense } from 'react'\n\nimport type { Props } from './types.js'\n\nimport { ShimmerEffect } from '../ShimmerEffect/index.js'\n\nconst LazyEditor = lazy(() => import('./CodeEditor.js'))\n\nexport type { Props }\n\nexport const CodeEditor: React.FC<Props> = (props) => {\n return (\n <Suspense fallback={<ShimmerEffect />}>\n <LazyEditor {...props} />\n </Suspense>\n )\n}\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,IAASC,IAAI,EAAEC,QAAQ,QAAQ;AAItC,SAASC,aAAa,QAAQ;AAE9B,MAAMC,UAAA,gBAAaH,IAAA,CAAK,MAAM,MAAM,CAAC;AAIrC,OAAO,MAAMI,UAAA,GAA+BC,KAAA;EAC1C,oBACEC,IAAA,CAACL,QAAA;IAASM,QAAA,eAAUD,IAAA,CAACJ,aAAA;cACnB,aAAAI,IAAA,CAACH,UAAA;MAAY,GAAGE;;;AAGtB","ignoreList":[]}

View File

@@ -0,0 +1,22 @@
/**
* Default maximum size in bytes for GenAI messages.
* Messages exceeding this limit will be truncated.
*/
export declare const DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT = 20000;
/**
* Truncate GenAI messages using the default byte limit.
*
* Convenience wrapper around `truncateMessagesByBytes` with the default limit.
*
* @param messages - Array of messages to truncate
* @returns Truncated array of messages
*/
export declare function truncateGenAiMessages(messages: unknown[]): unknown[];
/**
* Truncate GenAI string input using the default byte limit.
*
* @param input - The string to truncate
* @returns Truncated string
*/
export declare function truncateGenAiStringInput(input: string): string;
//# sourceMappingURL=messageTruncation.d.ts.map

View File

@@ -0,0 +1,37 @@
import type { PrismaClient } from '@prisma/client/extension';
import { entityKind } from "../../entity.cjs";
import { type Logger } from "../../logger.cjs";
import type { Query } from "../../sql/sql.cjs";
import type { PreparedQueryConfig as PreparedQueryConfigBase, SelectedFieldsOrdered, SQLiteAsyncDialect, SQLiteExecuteMethod, SQLiteTransaction, SQLiteTransactionConfig } from "../../sqlite-core/index.cjs";
import { SQLitePreparedQuery, SQLiteSession } from "../../sqlite-core/index.cjs";
type PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;
export declare class PrismaSQLitePreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<{
type: 'async';
run: [];
all: T['all'];
get: T['get'];
values: never;
execute: T['execute'];
}> {
private readonly prisma;
private readonly logger;
static readonly [entityKind]: string;
constructor(prisma: PrismaClient, query: Query, logger: Logger, executeMethod: SQLiteExecuteMethod);
all(placeholderValues?: Record<string, unknown>): Promise<T['all']>;
run(placeholderValues?: Record<string, unknown> | undefined): Promise<[]>;
get(placeholderValues?: Record<string, unknown> | undefined): Promise<T['get']>;
values(_placeholderValues?: Record<string, unknown> | undefined): Promise<never>;
isResponseInArrayMode(): boolean;
}
export interface PrismaSQLiteSessionOptions {
logger?: Logger;
}
export declare class PrismaSQLiteSession extends SQLiteSession<'async', unknown, Record<string, never>, Record<string, never>> {
private readonly prisma;
static readonly [entityKind]: string;
private readonly logger;
constructor(prisma: PrismaClient, dialect: SQLiteAsyncDialect, options: PrismaSQLiteSessionOptions);
prepareQuery<T extends Omit<PreparedQueryConfig, 'run'>>(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod): PrismaSQLitePreparedQuery<T>;
transaction<T>(_transaction: (tx: SQLiteTransaction<'async', unknown, Record<string, never>, Record<string, never>>) => Promise<T>, _config?: SQLiteTransactionConfig): Promise<T>;
}
export {};

View File

@@ -0,0 +1,44 @@
Prism.languages.erlang = {
'comment': /%.+/,
'string': {
pattern: /"(?:\\.|[^\\"\r\n])*"/,
greedy: true
},
'quoted-function': {
pattern: /'(?:\\.|[^\\'\r\n])+'(?=\()/,
alias: 'function'
},
'quoted-atom': {
pattern: /'(?:\\.|[^\\'\r\n])+'/,
alias: 'atom'
},
'boolean': /\b(?:false|true)\b/,
'keyword': /\b(?:after|begin|case|catch|end|fun|if|of|receive|try|when)\b/,
'number': [
/\$\\?./,
/\b\d+#[a-z0-9]+/i,
/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i
],
'function': /\b[a-z][\w@]*(?=\()/,
'variable': {
// Look-behind is used to prevent wrong highlighting of atoms containing "@"
pattern: /(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,
lookbehind: true
},
'operator': [
/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/,
{
// We don't want to match <<
pattern: /(^|[^<])<(?!<)/,
lookbehind: true
},
{
// We don't want to match >>
pattern: /(^|[^>])>(?!>)/,
lookbehind: true
}
],
'atom': /\b[a-z][\w@]*/,
'punctuation': /[()[\]{}:;,.#|]|<<|>>/
};

View File

@@ -0,0 +1,49 @@
"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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var expressions_exports = {};
__export(expressions_exports, {
concat: () => concat,
substring: () => substring
});
module.exports = __toCommonJS(expressions_exports);
var import_expressions = require("../sql/expressions/index.cjs");
var import_sql = require("../sql/sql.cjs");
__reExport(expressions_exports, require("../sql/expressions/index.cjs"), module.exports);
function concat(column, value) {
return import_sql.sql`${column} || ${(0, import_expressions.bindIfParam)(value, column)}`;
}
function substring(column, { from, for: _for }) {
const chunks = [import_sql.sql`substring(`, column];
if (from !== void 0) {
chunks.push(import_sql.sql` from `, (0, import_expressions.bindIfParam)(from, column));
}
if (_for !== void 0) {
chunks.push(import_sql.sql` for `, (0, import_expressions.bindIfParam)(_for, column));
}
chunks.push(import_sql.sql`)`);
return import_sql.sql.join(chunks);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
concat,
substring,
...require("../sql/expressions/index.cjs")
});
//# sourceMappingURL=expressions.cjs.map

View File

@@ -0,0 +1,7 @@
import React from 'react';
import './index.scss';
export declare const Hamburger: React.FC<{
readonly closeIcon?: 'collapse' | 'x';
readonly isActive?: boolean;
}>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,63 @@
Prism.languages.hcl = {
'comment': /(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/,
'heredoc': {
pattern: /<<-?(\w+\b)[\s\S]*?^[ \t]*\1/m,
greedy: true,
alias: 'string'
},
'keyword': [
{
pattern: /(?:data|resource)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i,
inside: {
'type': {
pattern: /(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,
lookbehind: true,
alias: 'variable'
}
}
},
{
pattern: /(?:backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?=\{)/i,
inside: {
'type': {
pattern: /(backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i,
lookbehind: true,
alias: 'variable'
}
}
},
/[\w-]+(?=\s+\{)/
],
'property': [
/[-\w\.]+(?=\s*=(?!=))/,
/"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/,
],
'string': {
pattern: /"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+(?!\$)|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/,
greedy: true,
inside: {
'interpolation': {
pattern: /(^|[^$])\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\}/,
lookbehind: true,
inside: {
'type': {
pattern: /(\b(?:count|data|local|module|path|self|terraform|var)\b\.)[\w\*]+/i,
lookbehind: true,
alias: 'variable'
},
'keyword': /\b(?:count|data|local|module|path|self|terraform|var)\b/i,
'function': /\w+(?=\()/,
'string': {
pattern: /"(?:\\[\s\S]|[^\\"])*"/,
greedy: true,
},
'number': /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,
'punctuation': /[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/,
}
},
}
},
'number': /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,
'boolean': /\b(?:false|true)\b/i,
'punctuation': /[=\[\]{}]/,
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"badge-pound-sterling.js","sources":["../../../src/icons/badge-pound-sterling.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BadgePoundSterling\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMy44NSA4LjYyYTQgNCAwIDAgMSA0Ljc4LTQuNzcgNCA0IDAgMCAxIDYuNzQgMCA0IDQgMCAwIDEgNC43OCA0Ljc4IDQgNCAwIDAgMSAwIDYuNzQgNCA0IDAgMCAxLTQuNzcgNC43OCA0IDQgMCAwIDEtNi43NSAwIDQgNCAwIDAgMS00Ljc4LTQuNzcgNCA0IDAgMCAxIDAtNi43NloiIC8+CiAgPHBhdGggZD0iTTggMTJoNCIgLz4KICA8cGF0aCBkPSJNMTAgMTZWOS41YTIuNSAyLjUgMCAwIDEgNSAwIiAvPgogIDxwYXRoIGQ9Ik04IDE2aDciIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/badge-pound-sterling\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 BadgePoundSterling = createLucideIcon('BadgePoundSterling', [\n [\n 'path',\n {\n d: 'M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z',\n key: '3c2336',\n },\n ],\n ['path', { d: 'M8 12h4', key: 'qz6y1c' }],\n ['path', { d: 'M10 16V9.5a2.5 2.5 0 0 1 5 0', key: '3mlbjk' }],\n ['path', { d: 'M8 16h7', key: 'sbedsn' }],\n]);\n\nexport default BadgePoundSterling;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,iBAAiB,oBAAsB,CAAA,CAAA,CAAA;AAAA,CAChE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,68 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const debugBuild = require('./debug-build.js');
const helpers = require('./helpers.js');
/**
* Present the user with a report dialog.
*
* @param options Everything is optional, we try to fetch all info need from the current scope.
*/
function showReportDialog(options = {}) {
const optionalDocument = helpers.WINDOW.document ;
const injectionPoint = optionalDocument?.head || optionalDocument?.body;
// doesn't work without a document (React Native)
if (!injectionPoint) {
debugBuild.DEBUG_BUILD && core.debug.error('[showReportDialog] Global document not defined');
return;
}
const scope = core.getCurrentScope();
const client = core.getClient();
const dsn = client?.getDsn();
if (!dsn) {
debugBuild.DEBUG_BUILD && core.debug.error('[showReportDialog] DSN not configured');
return;
}
const mergedOptions = {
...options,
user: {
...scope.getUser(),
...options.user,
},
eventId: options.eventId || core.lastEventId(),
};
const script = helpers.WINDOW.document.createElement('script');
script.async = true;
script.crossOrigin = 'anonymous';
script.src = core.getReportDialogEndpoint(dsn, mergedOptions);
const { onLoad, onClose } = mergedOptions;
if (onLoad) {
script.onload = onLoad;
}
if (onClose) {
const reportDialogClosedMessageHandler = (event) => {
if (event.data === '__sentry_reportdialog_closed__') {
try {
onClose();
} finally {
helpers.WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);
}
}
};
helpers.WINDOW.addEventListener('message', reportDialogClosedMessageHandler);
}
injectionPoint.appendChild(script);
}
exports.showReportDialog = showReportDialog;
//# sourceMappingURL=report-dialog.js.map

View File

@@ -0,0 +1,6 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function n(t,{instancePath:s="",parentData:e,parentDataProperty:l,rootData:a=t}={}){let o=null,r=0;const u=r;let i=!1;const p=r;if(r===p)if(Array.isArray(t)){const n=t.length;for(let s=0;s<n;s++){let n=t[s];const e=r,l=r;let a=!1,u=null;const i=r,p=r;let f=!1;const h=r;if(!(n instanceof RegExp)){const n={params:{}};null===o?o=[n]:o.push(n),r++}var c=h===r;if(f=f||c,!f){const t=r;if(r===t)if("string"==typeof n){if(n.length<1){const n={params:{}};null===o?o=[n]:o.push(n),r++}}else{const n={params:{type:"string"}};null===o?o=[n]:o.push(n),r++}if(c=t===r,f=f||c,!f){const t=r;if(!(n instanceof Function)){const n={params:{}};null===o?o=[n]:o.push(n),r++}c=t===r,f=f||c}}if(f)r=p,null!==o&&(p?o.length=p:o=null);else{const n={params:{}};null===o?o=[n]:o.push(n),r++}if(i===r&&(a=!0,u=0),a)r=l,null!==o&&(l?o.length=l:o=null);else{const n={params:{passingSchemas:u}};null===o?o=[n]:o.push(n),r++}if(e!==r)break}}else{const n={params:{type:"array"}};null===o?o=[n]:o.push(n),r++}var f=p===r;if(i=i||f,!i){const n=r,s=r;let e=!1;const l=r;if(!(t instanceof RegExp)){const n={params:{}};null===o?o=[n]:o.push(n),r++}var h=l===r;if(e=e||h,!e){const n=r;if(r===n)if("string"==typeof t){if(t.length<1){const n={params:{}};null===o?o=[n]:o.push(n),r++}}else{const n={params:{type:"string"}};null===o?o=[n]:o.push(n),r++}if(h=n===r,e=e||h,!e){const n=r;if(!(t instanceof Function)){const n={params:{}};null===o?o=[n]:o.push(n),r++}h=n===r,e=e||h}}if(e)r=s,null!==o&&(s?o.length=s:o=null);else{const n={params:{}};null===o?o=[n]:o.push(n),r++}f=n===r,i=i||f}if(!i){const t={params:{}};return null===o?o=[t]:o.push(t),r++,n.errors=o,!1}return r=u,null!==o&&(u?o.length=u:o=null),n.errors=o,0===r}function t(s,{instancePath:e="",parentData:l,parentDataProperty:a,rootData:o=s}={}){let r=null,u=0;const i=u;let p=!1;const c=u;if(u===c)if("string"==typeof s){if(s.length<1){const n={params:{}};null===r?r=[n]:r.push(n),u++}}else{const n={params:{type:"string"}};null===r?r=[n]:r.push(n),u++}var f=c===u;if(p=p||f,!p){const t=u;if(u===t)if(s&&"object"==typeof s&&!Array.isArray(s)){let t;if(void 0===s.banner&&(t="banner")){const n={params:{missingProperty:t}};null===r?r=[n]:r.push(n),u++}else{const t=u;for(const n in s)if("banner"!==n&&"entryOnly"!==n&&"exclude"!==n&&"footer"!==n&&"include"!==n&&"raw"!==n&&"stage"!==n&&"test"!==n){const t={params:{additionalProperty:n}};null===r?r=[t]:r.push(t),u++;break}if(t===u){if(void 0!==s.banner){let n=s.banner;const t=u,e=u;let l=!1;const a=u;if("string"!=typeof n){const n={params:{type:"string"}};null===r?r=[n]:r.push(n),u++}var h=a===u;if(l=l||h,!l){const t=u;if(!(n instanceof Function)){const n={params:{}};null===r?r=[n]:r.push(n),u++}h=t===u,l=l||h}if(l)u=e,null!==r&&(e?r.length=e:r=null);else{const n={params:{}};null===r?r=[n]:r.push(n),u++}var m=t===u}else m=!0;if(m){if(void 0!==s.entryOnly){const n=u;if("boolean"!=typeof s.entryOnly){const n={params:{type:"boolean"}};null===r?r=[n]:r.push(n),u++}m=n===u}else m=!0;if(m){if(void 0!==s.exclude){const t=u,l=u;let a=!1,i=null;const p=u;if(n(s.exclude,{instancePath:e+"/exclude",parentData:s,parentDataProperty:"exclude",rootData:o})||(r=null===r?n.errors:r.concat(n.errors),u=r.length),p===u&&(a=!0,i=0),a)u=l,null!==r&&(l?r.length=l:r=null);else{const n={params:{passingSchemas:i}};null===r?r=[n]:r.push(n),u++}m=t===u}else m=!0;if(m){if(void 0!==s.footer){const n=u;if("boolean"!=typeof s.footer){const n={params:{type:"boolean"}};null===r?r=[n]:r.push(n),u++}m=n===u}else m=!0;if(m){if(void 0!==s.include){const t=u,l=u;let a=!1,i=null;const p=u;if(n(s.include,{instancePath:e+"/include",parentData:s,parentDataProperty:"include",rootData:o})||(r=null===r?n.errors:r.concat(n.errors),u=r.length),p===u&&(a=!0,i=0),a)u=l,null!==r&&(l?r.length=l:r=null);else{const n={params:{passingSchemas:i}};null===r?r=[n]:r.push(n),u++}m=t===u}else m=!0;if(m){if(void 0!==s.raw){const n=u;if("boolean"!=typeof s.raw){const n={params:{type:"boolean"}};null===r?r=[n]:r.push(n),u++}m=n===u}else m=!0;if(m){if(void 0!==s.stage){const n=u;if("number"!=typeof s.stage){const n={params:{type:"number"}};null===r?r=[n]:r.push(n),u++}m=n===u}else m=!0;if(m)if(void 0!==s.test){const t=u,l=u;let a=!1,i=null;const p=u;if(n(s.test,{instancePath:e+"/test",parentData:s,parentDataProperty:"test",rootData:o})||(r=null===r?n.errors:r.concat(n.errors),u=r.length),p===u&&(a=!0,i=0),a)u=l,null!==r&&(l?r.length=l:r=null);else{const n={params:{passingSchemas:i}};null===r?r=[n]:r.push(n),u++}m=t===u}else m=!0}}}}}}}}}else{const n={params:{type:"object"}};null===r?r=[n]:r.push(n),u++}if(f=t===u,p=p||f,!p){const n=u;if(!(s instanceof Function)){const n={params:{}};null===r?r=[n]:r.push(n),u++}f=n===u,p=p||f}}if(!p){const n={params:{}};return null===r?r=[n]:r.push(n),u++,t.errors=r,!1}return u=i,null!==r&&(i?r.length=i:r=null),t.errors=r,0===u}module.exports=t,module.exports.default=t;

View File

@@ -0,0 +1,3 @@
import type { DependencyList } from 'react';
export declare function useDebouncedEffect(effect: () => void, deps: DependencyList, delay: number): void;
//# sourceMappingURL=useDebouncedEffect.d.ts.map

View File

@@ -0,0 +1,25 @@
MIT License
Portions Copyright (c) 2012-2019 werk85 <malte@werk85.de>
Portions Copyright (c) 2020-2022 KillyMXI <killy@mxii.eu.org>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,41 @@
import type { Data, DocumentSlots, FormState, SanitizedDocumentPermissions, UploadEdits } from 'payload';
import React from 'react';
import type { State } from './reducer.js';
type FormsManagerContext = {
readonly activeIndex: State['activeIndex'];
readonly addFiles: (filelist: FileList) => Promise<void>;
readonly bulkUpdateForm: (updatedFields: Record<string, unknown>, afterStateUpdate?: () => void) => Promise<void>;
readonly collectionSlug: string;
readonly docPermissions?: SanitizedDocumentPermissions;
readonly documentSlots: DocumentSlots;
readonly forms: State['forms'];
getFormDataRef: React.RefObject<() => Data>;
readonly hasPublishPermission: boolean;
readonly hasSavePermission: boolean;
readonly hasSubmitted: boolean;
readonly isInitializing: boolean;
readonly removeFile: (index: number) => void;
readonly resetUploadEdits?: () => void;
readonly saveAllDocs: ({ overrides }?: {
overrides?: Record<string, unknown>;
}) => Promise<void>;
readonly setActiveIndex: (index: number) => void;
readonly setFormTotalErrorCount: ({ errorCount, index, }: {
errorCount: number;
index: number;
}) => void;
readonly totalErrorCount?: number;
readonly updateUploadEdits: (args: UploadEdits) => void;
};
export type InitialForms = Array<{
file: File;
formID?: string;
initialState?: FormState | null;
}>;
type FormsManagerProps = {
readonly children: React.ReactNode;
};
export declare function FormsManagerProvider({ children }: FormsManagerProps): React.JSX.Element;
export declare function useFormsManager(): FormsManagerContext;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,68 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { Button } from '../../Button/index.js';
import { Thumbnail } from '../../Thumbnail/index.js';
import { UploadActions } from '../../Upload/index.js';
import { FileMeta } from '../FileMeta/index.js';
import './index.scss';
const baseClass = 'file-details';
export const StaticFileDetails = props => {
const {
customUploadActions,
doc,
enableAdjustments,
handleRemove,
hasImageSizes,
hideRemoveFile,
imageCacheTag,
uploadConfig
} = props;
const {
filename,
filesize,
height,
mimeType,
thumbnailURL,
url,
width
} = doc;
const previewAllowed = uploadConfig.displayPreview ?? true;
return /*#__PURE__*/_jsx("div", {
className: baseClass,
children: /*#__PURE__*/_jsxs("header", {
children: [previewAllowed && /*#__PURE__*/_jsx(Thumbnail, {
// size="small"
className: `${baseClass}__thumbnail`,
doc: doc,
fileSrc: thumbnailURL || url,
imageCacheTag: imageCacheTag,
uploadConfig: uploadConfig
}), /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__main-detail`,
children: [/*#__PURE__*/_jsx(FileMeta, {
filename: filename,
filesize: filesize,
height: height,
mimeType: mimeType,
url: url,
width: width
}), (enableAdjustments || hasImageSizes && doc.filename || customUploadActions) && /*#__PURE__*/_jsx(UploadActions, {
customActions: customUploadActions,
enableAdjustments: Boolean(enableAdjustments),
enablePreviewSizes: hasImageSizes && doc.filename,
mimeType: mimeType
})]
}), !hideRemoveFile && handleRemove && /*#__PURE__*/_jsx(Button, {
buttonStyle: "icon-label",
className: `${baseClass}__remove`,
icon: "x",
iconStyle: "with-border",
onClick: handleRemove,
round: true
})]
})
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,15 @@
import type { Payload, RequestContext, TypedLocale, TypedUser } from '../index.js';
import type { PayloadRequest } from '../types/index.js';
export type CreateLocalReqOptions = {
context?: RequestContext;
depth?: number;
fallbackLocale?: false | TypedLocale;
locale?: string;
req?: Partial<PayloadRequest>;
urlSuffix?: string;
user?: TypedUser;
};
type CreateLocalReq = (options: CreateLocalReqOptions, payload: Payload) => Promise<PayloadRequest>;
export declare const createLocalReq: CreateLocalReq;
export {};
//# sourceMappingURL=createLocalReq.d.ts.map

View File

@@ -0,0 +1,42 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { EditIcon } from '../../../../icons/Edit/index.js';
import { useCellProps } from '../../../../providers/TableColumns/RenderDefaultCell/index.js';
import { DefaultCell } from '../../../Table/DefaultCell/index.js';
import './index.scss';
export const DrawerLink = t0 => {
const $ = _c(3);
const {
onDrawerOpen
} = t0;
const cellProps = useCellProps();
let t1;
if ($[0] !== cellProps || $[1] !== onDrawerOpen) {
t1 = _jsxs("div", {
className: "drawer-link",
children: [_jsx(DefaultCell, {
...cellProps,
className: "drawer-link__cell",
link: false,
onClick: null
}), _jsx("button", {
className: "drawer-link__doc-drawer-toggler",
onClick: () => {
onDrawerOpen(cellProps.rowData.id, cellProps.collectionSlug);
},
type: "button",
children: _jsx(EditIcon, {})
})]
});
$[0] = cellProps;
$[1] = onDrawerOpen;
$[2] = t1;
} else {
t1 = $[2];
}
return t1;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,167 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("http").RequestListener} RequestListener */
/** @typedef {import("http").ServerOptions} HttpServerOptions */
/** @typedef {import("http").Server} HttpServer */
/** @typedef {import("https").ServerOptions} HttpsServerOptions */
/** @typedef {import("https").Server} HttpsServer */
/** @typedef {import("net").AddressInfo} AddressInfo */
/** @typedef {import("./LazyCompilationPlugin").BackendHandler} BackendHandler */
/** @typedef {import("../../declarations/WebpackOptions").LazyCompilationDefaultBackendOptions} LazyCompilationDefaultBackendOptions */
/** @typedef {HttpServer | HttpsServer} Server */
/** @typedef {(server: Server) => void} Listen */
/** @typedef {() => Server} CreateServerFunction */
/**
* @param {Omit<LazyCompilationDefaultBackendOptions, "client"> & { client: NonNullable<LazyCompilationDefaultBackendOptions["client"]> }} options additional options for the backend
* @returns {BackendHandler} backend
*/
module.exports = (options) => (compiler, callback) => {
const logger = compiler.getInfrastructureLogger("LazyCompilationBackend");
/** @type {Map<string, number>} */
const activeModules = new Map();
const prefix = "/lazy-compilation-using-";
const isHttps =
options.protocol === "https" ||
(typeof options.server === "object" &&
("key" in options.server || "pfx" in options.server));
/** @type {CreateServerFunction} */
const createServer =
typeof options.server === "function"
? options.server
: (() => {
const http = isHttps ? require("https") : require("http");
return /** @type {(this: import("http") | import("https"), options: HttpServerOptions | HttpsServerOptions) => Server} */ (
http.createServer
).bind(
http,
/** @type {HttpServerOptions | HttpsServerOptions} */
(options.server)
);
})();
/** @type {Listen} */
const listen =
typeof options.listen === "function"
? options.listen
: (server) => {
let listen = options.listen;
if (typeof listen === "object" && !("port" in listen)) {
listen = { ...listen, port: undefined };
}
server.listen(listen);
};
const protocol = options.protocol || (isHttps ? "https" : "http");
/** @type {RequestListener} */
const requestListener = (req, res) => {
if (req.url === undefined) return;
const keys = req.url.slice(prefix.length).split("@");
req.socket.on("close", () => {
setTimeout(() => {
for (const key of keys) {
const oldValue = activeModules.get(key) || 0;
activeModules.set(key, oldValue - 1);
if (oldValue === 1) {
logger.log(
`${key} is no longer in use. Next compilation will skip this module.`
);
}
}
}, 120000);
});
req.socket.setNoDelay(true);
res.writeHead(200, {
"content-type": "text/event-stream",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "*",
"Access-Control-Allow-Headers": "*"
});
res.write("\n");
let moduleActivated = false;
for (const key of keys) {
const oldValue = activeModules.get(key) || 0;
activeModules.set(key, oldValue + 1);
if (oldValue === 0) {
logger.log(`${key} is now in use and will be compiled.`);
moduleActivated = true;
}
}
if (moduleActivated && compiler.watching) compiler.watching.invalidate();
};
const server = createServer();
server.on("request", requestListener);
let isClosing = false;
/** @type {Set<import("net").Socket>} */
const sockets = new Set();
server.on("connection", (socket) => {
sockets.add(socket);
socket.on("close", () => {
sockets.delete(socket);
});
if (isClosing) socket.destroy();
});
server.on("clientError", (e) => {
if (e.message !== "Server is disposing") logger.warn(e);
});
server.on(
"listening",
/**
* @param {Error} err error
* @returns {void}
*/
(err) => {
if (err) return callback(err);
const _addr = server.address();
if (typeof _addr === "string") {
throw new Error("addr must not be a string");
}
const addr = /** @type {AddressInfo} */ (_addr);
const urlBase =
addr.address === "::" || addr.address === "0.0.0.0"
? `${protocol}://localhost:${addr.port}`
: addr.family === "IPv6"
? `${protocol}://[${addr.address}]:${addr.port}`
: `${protocol}://${addr.address}:${addr.port}`;
logger.log(
`Server-Sent-Events server for lazy compilation open at ${urlBase}.`
);
callback(null, {
dispose(callback) {
isClosing = true;
// Removing the listener is a workaround for a memory leak in node.js
server.off("request", requestListener);
server.close((err) => {
callback(err);
});
for (const socket of sockets) {
socket.destroy(new Error("Server is disposing"));
}
},
module(originalModule) {
const key = `${encodeURIComponent(
originalModule.identifier().replace(/\\/g, "/").replace(/@/g, "_")
).replace(/%(2F|3A|24|26|2B|2C|3B|3D)/g, decodeURIComponent)}`;
const active = /** @type {number} */ (activeModules.get(key)) > 0;
return {
client: `${options.client}?${encodeURIComponent(urlBase + prefix)}`,
data: key,
active
};
}
});
}
);
listen(server);
};

View File

@@ -0,0 +1,97 @@
/**
* License for programmatically and manually incorporated
* documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
*
* Copyright Node.js contributors. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
// NOTE: These definitions support Node.js and TypeScript 4.9 through 5.6.
// Reference required TypeScript libs:
/// <reference lib="es2020" />
// TypeScript backwards-compatibility definitions:
/// <reference path="../compatibility/index.d.ts" />
// Definitions specific to TypeScript 4.9 through 5.6:
/// <reference path="./globals.typedarray.d.ts" />
/// <reference path="./buffer.buffer.d.ts" />
// Definitions for Node.js modules that are not specific to any version of TypeScript:
/// <reference path="../globals.d.ts" />
/// <reference path="../web-globals/abortcontroller.d.ts" />
/// <reference path="../web-globals/domexception.d.ts" />
/// <reference path="../web-globals/events.d.ts" />
/// <reference path="../web-globals/fetch.d.ts" />
/// <reference path="../web-globals/navigator.d.ts" />
/// <reference path="../web-globals/storage.d.ts" />
/// <reference path="../assert.d.ts" />
/// <reference path="../assert/strict.d.ts" />
/// <reference path="../async_hooks.d.ts" />
/// <reference path="../buffer.d.ts" />
/// <reference path="../child_process.d.ts" />
/// <reference path="../cluster.d.ts" />
/// <reference path="../console.d.ts" />
/// <reference path="../constants.d.ts" />
/// <reference path="../crypto.d.ts" />
/// <reference path="../dgram.d.ts" />
/// <reference path="../diagnostics_channel.d.ts" />
/// <reference path="../dns.d.ts" />
/// <reference path="../dns/promises.d.ts" />
/// <reference path="../domain.d.ts" />
/// <reference path="../events.d.ts" />
/// <reference path="../fs.d.ts" />
/// <reference path="../fs/promises.d.ts" />
/// <reference path="../http.d.ts" />
/// <reference path="../http2.d.ts" />
/// <reference path="../https.d.ts" />
/// <reference path="../inspector.d.ts" />
/// <reference path="../inspector.generated.d.ts" />
/// <reference path="../module.d.ts" />
/// <reference path="../net.d.ts" />
/// <reference path="../os.d.ts" />
/// <reference path="../path.d.ts" />
/// <reference path="../perf_hooks.d.ts" />
/// <reference path="../process.d.ts" />
/// <reference path="../punycode.d.ts" />
/// <reference path="../querystring.d.ts" />
/// <reference path="../readline.d.ts" />
/// <reference path="../readline/promises.d.ts" />
/// <reference path="../repl.d.ts" />
/// <reference path="../sea.d.ts" />
/// <reference path="../sqlite.d.ts" />
/// <reference path="../stream.d.ts" />
/// <reference path="../stream/promises.d.ts" />
/// <reference path="../stream/consumers.d.ts" />
/// <reference path="../stream/web.d.ts" />
/// <reference path="../string_decoder.d.ts" />
/// <reference path="../test.d.ts" />
/// <reference path="../timers.d.ts" />
/// <reference path="../timers/promises.d.ts" />
/// <reference path="../tls.d.ts" />
/// <reference path="../trace_events.d.ts" />
/// <reference path="../tty.d.ts" />
/// <reference path="../url.d.ts" />
/// <reference path="../util.d.ts" />
/// <reference path="../v8.d.ts" />
/// <reference path="../vm.d.ts" />
/// <reference path="../wasi.d.ts" />
/// <reference path="../worker_threads.d.ts" />
/// <reference path="../zlib.d.ts" />

View File

@@ -0,0 +1,26 @@
"use strict";
exports.nextSaturday = nextSaturday;
var _index = require("./nextDay.js");
/**
* @name nextSaturday
* @category Weekday Helpers
* @summary When is the next Saturday?
*
* @description
* When is the next Saturday?
*
* @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 Saturday
*
* @example
* // When is the next Saturday after Mar, 22, 2020?
* const result = nextSaturday(new Date(2020, 2, 22))
* //=> Sat Mar 28 2020 00:00:00
*/
function nextSaturday(date) {
return (0, _index.nextDay)(date, 6);
}

View File

@@ -0,0 +1,4 @@
import type { JSONFieldClientComponent } from 'payload';
import './index.scss';
export declare const QueryPresetsWhereField: JSONFieldClientComponent;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/views/Edit/Auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAExD,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAA;IACjD,oBAAoB,CAAC,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAAA;IAChF,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAA;IACzE,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC9B,QAAQ,EAAE,OAAO,CAAA;IACjB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,uBAAuB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;IACpD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA"}

View File

@@ -0,0 +1,166 @@
import { jsx as _jsx } from "react/jsx-runtime";
import { MissingEditorProp } from 'payload';
import { formatAdminURL } from 'payload/shared';
import { RenderCustomComponent } from '../../../elements/RenderCustomComponent/index.js';
import { RenderServerComponent } from '../../../elements/RenderServerComponent/index.js';
import { DefaultCell, RenderDefaultCell } from '../../../exports/client/index.js';
import { hasOptionLabelJSXElement } from '../../../utilities/hasOptionLabelJSXElement.js';
import { findValueFromPath } from './findValueFromPath.js';
export function renderCell({
clientField,
collectionSlug,
columnIndex,
customCellProps,
doc,
enableRowSelections,
i18n,
isLinkedColumn,
payload,
req,
rowIndex,
serverField,
viewType
}) {
const baseCellClientProps = {
cellData: undefined,
collectionSlug,
customCellProps,
field: clientField,
rowData: undefined,
viewType
};
const accessor = ('accessor' in clientField ? clientField.accessor : undefined) ?? ('name' in clientField ? clientField.name : undefined);
// Check if there's a custom formatDocURL function for this linked column
let shouldLink = isLinkedColumn;
let customLinkURL;
if (isLinkedColumn && req) {
const collectionConfig = payload.collections[collectionSlug]?.config;
const formatDocURL = collectionConfig?.admin?.formatDocURL;
if (typeof formatDocURL === 'function') {
// Generate the default URL that would normally be used
const adminRoute = req.payload.config.routes?.admin || '/admin';
const defaultURL = formatAdminURL({
adminRoute,
path: `/collections/${collectionSlug}${viewType === 'trash' ? '/trash' : ''}/${encodeURIComponent(String(doc.id))}`
});
const customURL = formatDocURL({
collectionSlug,
defaultURL,
doc,
req,
viewType
});
if (customURL === null) {
// formatDocURL returned null = disable linking entirely
shouldLink = false;
} else if (typeof customURL === 'string') {
// formatDocURL returned a string = use custom URL
shouldLink = true;
customLinkURL = customURL;
} else {
// formatDocURL returned unexpected type = disable linking for safety
shouldLink = false;
}
}
}
// For _status field, use _displayStatus if available (for showing "changed" status in list view)
const cellData = 'name' in clientField && accessor === '_status' && '_displayStatus' in doc ? doc._displayStatus : 'name' in clientField ? findValueFromPath(doc, accessor) : undefined;
// For _status field, add 'changed' option for display purposes
// The 'changed' status is computed at runtime
let enrichedClientField = clientField;
if ('name' in clientField && accessor === '_status' && clientField.type === 'select') {
const hasChangedOption = clientField.options?.some(opt => (typeof opt === 'object' ? opt.value : opt) === 'changed');
if (!hasChangedOption) {
enrichedClientField = {
...clientField,
options: [...(clientField.options || []), {
label: i18n.t('version:draftHasPublishedVersion'),
value: 'changed'
}]
};
}
}
const cellClientProps = {
...baseCellClientProps,
cellData,
field: enrichedClientField,
link: shouldLink,
linkURL: customLinkURL,
rowData: doc
};
const cellServerProps = {
cellData: cellClientProps.cellData,
className: baseCellClientProps.className,
collectionConfig: payload.collections[collectionSlug].config,
collectionSlug,
columnIndex,
customCellProps: baseCellClientProps.customCellProps,
field: serverField,
i18n,
link: shouldLink,
linkURL: customLinkURL,
onClick: baseCellClientProps.onClick,
payload,
rowData: doc
};
let CustomCell = null;
if (serverField?.type === 'richText') {
if (!serverField?.editor) {
throw new MissingEditorProp(serverField) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor
;
}
if (typeof serverField?.editor === 'function') {
throw new Error('Attempted to access unsanitized rich text editor.');
}
if (!serverField.admin) {
serverField.admin = {};
}
if (!serverField.admin.components) {
serverField.admin.components = {};
}
CustomCell = RenderServerComponent({
clientProps: cellClientProps,
Component: serverField.editor.CellComponent,
importMap: payload.importMap,
serverProps: cellServerProps
});
} else {
const CustomCellComponent = serverField?.admin?.components?.Cell;
if (CustomCellComponent) {
CustomCell = RenderServerComponent({
clientProps: cellClientProps,
Component: CustomCellComponent,
importMap: payload.importMap,
serverProps: cellServerProps
});
} else if (cellClientProps.cellData && cellClientProps.field && hasOptionLabelJSXElement(cellClientProps)) {
CustomCell = RenderServerComponent({
clientProps: cellClientProps,
Component: DefaultCell,
importMap: payload.importMap
});
} else {
const CustomCellComponent = serverField?.admin?.components?.Cell;
if (CustomCellComponent) {
CustomCell = RenderServerComponent({
clientProps: cellClientProps,
Component: CustomCellComponent,
importMap: payload.importMap,
serverProps: cellServerProps
});
} else {
CustomCell = undefined;
}
}
}
return /*#__PURE__*/_jsx(RenderCustomComponent, {
CustomComponent: CustomCell,
Fallback: /*#__PURE__*/_jsx(RenderDefaultCell, {
clientProps: cellClientProps,
columnIndex: columnIndex,
enableRowSelections: enableRowSelections,
isLinkedColumn: isLinkedColumn
})
}, `${rowIndex}-${columnIndex}`);
}
//# sourceMappingURL=renderCell.js.map

View File

@@ -0,0 +1,236 @@
#include <memory>
#include <poll.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "InotifyBackend.hh"
#define INOTIFY_MASK \
IN_ATTRIB | IN_CREATE | IN_DELETE | \
IN_DELETE_SELF | IN_MODIFY | IN_MOVE_SELF | IN_MOVED_FROM | \
IN_MOVED_TO | IN_DONT_FOLLOW | IN_ONLYDIR | IN_EXCL_UNLINK
#define BUFFER_SIZE 8192
#define CONVERT_TIME(ts) ((uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec)
void InotifyBackend::start() {
// Create a pipe that we will write to when we want to end the thread.
int err = pipe2(mPipe, O_CLOEXEC | O_NONBLOCK);
if (err == -1) {
throw std::runtime_error(std::string("Unable to open pipe: ") + strerror(errno));
}
// Init inotify file descriptor.
mInotify = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
if (mInotify == -1) {
throw std::runtime_error(std::string("Unable to initialize inotify: ") + strerror(errno));
}
pollfd pollfds[2];
pollfds[0].fd = mPipe[0];
pollfds[0].events = POLLIN;
pollfds[0].revents = 0;
pollfds[1].fd = mInotify;
pollfds[1].events = POLLIN;
pollfds[1].revents = 0;
notifyStarted();
// Loop until we get an event from the pipe.
while (true) {
int result = poll(pollfds, 2, 500);
if (result < 0) {
throw std::runtime_error(std::string("Unable to poll: ") + strerror(errno));
}
if (pollfds[0].revents) {
break;
}
if (pollfds[1].revents) {
handleEvents();
}
}
close(mPipe[0]);
close(mPipe[1]);
close(mInotify);
mEndedSignal.notify();
}
InotifyBackend::~InotifyBackend() {
write(mPipe[1], "X", 1);
mEndedSignal.wait();
}
// This function is called by Backend::watch which takes a lock on mMutex
void InotifyBackend::subscribe(WatcherRef watcher) {
// Build a full directory tree recursively, and watch each directory.
std::shared_ptr<DirTree> tree = getTree(watcher);
for (auto it = tree->entries.begin(); it != tree->entries.end(); it++) {
if (it->second.isDir) {
bool success = watchDir(watcher, it->second.path, tree);
if (!success) {
throw WatcherError(std::string("inotify_add_watch on '") + it->second.path + std::string("' failed: ") + strerror(errno), watcher);
}
}
}
}
bool InotifyBackend::watchDir(WatcherRef watcher, std::string path, std::shared_ptr<DirTree> tree) {
int wd = inotify_add_watch(mInotify, path.c_str(), INOTIFY_MASK);
if (wd == -1) {
return false;
}
std::shared_ptr<InotifySubscription> sub = std::make_shared<InotifySubscription>();
sub->tree = tree;
sub->path = path;
sub->watcher = watcher;
mSubscriptions.emplace(wd, sub);
return true;
}
void InotifyBackend::handleEvents() {
char buf[BUFFER_SIZE] __attribute__ ((aligned(__alignof__(struct inotify_event))));;
struct inotify_event *event;
// Track all of the watchers that are touched so we can notify them at the end of the events.
std::unordered_set<WatcherRef> watchers;
while (true) {
int n = read(mInotify, &buf, BUFFER_SIZE);
if (n < 0) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
break;
}
throw std::runtime_error(std::string("Error reading from inotify: ") + strerror(errno));
}
if (n == 0) {
break;
}
for (char *ptr = buf; ptr < buf + n; ptr += sizeof(*event) + event->len) {
event = (struct inotify_event *)ptr;
if ((event->mask & IN_Q_OVERFLOW) == IN_Q_OVERFLOW) {
// overflow
continue;
}
handleEvent(event, watchers);
}
}
for (auto it = watchers.begin(); it != watchers.end(); it++) {
(*it)->notify();
}
}
void InotifyBackend::handleEvent(struct inotify_event *event, std::unordered_set<WatcherRef> &watchers) {
std::unique_lock<std::mutex> lock(mMutex);
// Find the subscriptions for this watch descriptor
auto range = mSubscriptions.equal_range(event->wd);
std::unordered_set<std::shared_ptr<InotifySubscription>> set;
for (auto it = range.first; it != range.second; it++) {
set.insert(it->second);
}
for (auto it = set.begin(); it != set.end(); it++) {
if (handleSubscription(event, *it)) {
watchers.insert((*it)->watcher);
}
}
}
bool InotifyBackend::handleSubscription(struct inotify_event *event, std::shared_ptr<InotifySubscription> sub) {
// Build full path and check if its in our ignore list.
std::shared_ptr<Watcher> watcher = sub->watcher;
std::string path = std::string(sub->path);
bool isDir = event->mask & IN_ISDIR;
if (event->len > 0) {
path += "/" + std::string(event->name);
}
if (watcher->isIgnored(path)) {
return false;
}
// If this is a create, check if it's a directory and start watching if it is.
// In any case, keep the directory tree up to date.
if (event->mask & (IN_CREATE | IN_MOVED_TO)) {
watcher->mEvents.create(path);
struct stat st;
// Use lstat to avoid resolving symbolic links that we cannot watch anyway
// https://github.com/parcel-bundler/watcher/issues/76
if (lstat(path.c_str(), &st) != 0) {
return false;
}
DirEntry *entry = sub->tree->add(path, CONVERT_TIME(st.st_mtim), S_ISDIR(st.st_mode));
if (entry->isDir) {
bool success = watchDir(watcher, path, sub->tree);
if (!success) {
sub->tree->remove(path);
return false;
}
}
} else if (event->mask & (IN_MODIFY | IN_ATTRIB)) {
watcher->mEvents.update(path);
struct stat st;
if (stat(path.c_str(), &st) != 0) {
return false;
}
sub->tree->update(path, CONVERT_TIME(st.st_mtim));
} else if (event->mask & (IN_DELETE | IN_DELETE_SELF | IN_MOVED_FROM | IN_MOVE_SELF)) {
bool isSelfEvent = (event->mask & (IN_DELETE_SELF | IN_MOVE_SELF));
// Ignore delete/move self events unless this is the recursive watch root
if (isSelfEvent && path != watcher->mDir) {
return false;
}
// If the entry being deleted/moved is a directory, remove it from the list of subscriptions
// XXX: self events don't have the IN_ISDIR mask
if (isSelfEvent || isDir) {
for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) {
if (it->second->path == path) {
it = mSubscriptions.erase(it);
} else {
++it;
}
}
}
watcher->mEvents.remove(path);
sub->tree->remove(path);
}
return true;
}
// This function is called by Backend::unwatch which takes a lock on mMutex
void InotifyBackend::unsubscribe(WatcherRef watcher) {
// Find any subscriptions pointing to this watcher, and remove them.
for (auto it = mSubscriptions.begin(); it != mSubscriptions.end();) {
if (it->second->watcher.get() == watcher.get()) {
if (mSubscriptions.count(it->first) == 1) {
int err = inotify_rm_watch(mInotify, it->first);
if (err == -1) {
throw WatcherError(std::string("Unable to remove watcher: ") + strerror(errno), watcher);
}
}
it = mSubscriptions.erase(it);
} else {
it++;
}
}
}

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 FerrisWheel = createLucideIcon("FerrisWheel", [
["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }],
["path", { d: "M12 2v4", key: "3427ic" }],
["path", { d: "m6.8 15-3.5 2", key: "hjy98k" }],
["path", { d: "m20.7 7-3.5 2", key: "f08gto" }],
["path", { d: "M6.8 9 3.3 7", key: "1aevh4" }],
["path", { d: "m20.7 17-3.5-2", key: "1liqo3" }],
["path", { d: "m9 22 3-8 3 8", key: "wees03" }],
["path", { d: "M8 22h8", key: "rmew8v" }],
["path", { d: "M18 18.7a9 9 0 1 0-12 0", key: "dhzg4g" }]
]);
export { FerrisWheel as default };
//# sourceMappingURL=ferris-wheel.js.map

View File

@@ -0,0 +1,13 @@
export declare type SourceLocation = {
line: number;
column: number;
};
export declare class LinesAndColumns {
private string;
private offsets;
constructor(string: string);
locationForIndex(index: number): SourceLocation | null;
indexForLocation(location: SourceLocation): number | null;
private lengthOfLine;
}
export default LinesAndColumns;

View File

@@ -0,0 +1 @@
{"version":3,"file":"house-plug.js","sources":["../../../src/icons/house-plug.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name HousePlug\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMTJWOC45NjQiIC8+CiAgPHBhdGggZD0iTTE0IDEyVjguOTY0IiAvPgogIDxwYXRoIGQ9Ik0xNSAxMmExIDEgMCAwIDEgMSAxdjJhMiAyIDAgMCAxLTIgMmgtNGEyIDIgMCAwIDEtMi0ydi0yYTEgMSAwIDAgMSAxLTF6IiAvPgogIDxwYXRoIGQ9Ik04LjUgMjFINWEyIDIgMCAwIDEtMi0ydi05YTIgMiAwIDAgMSAuNzA5LTEuNTI4bDctNS45OTlhMiAyIDAgMCAxIDIuNTgyIDBsNyA1Ljk5OUEyIDIgMCAwIDEgMjEgMTB2OWEyIDIgMCAwIDEtMiAyaC01YTIgMiAwIDAgMS0yLTJ2LTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/house-plug\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 HousePlug = createLucideIcon('HousePlug', [\n ['path', { d: 'M10 12V8.964', key: '1vll13' }],\n ['path', { d: 'M14 12V8.964', key: '1x3qvg' }],\n [\n 'path',\n { d: 'M15 12a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-2a1 1 0 0 1 1-1z', key: 'ppykja' },\n ],\n [\n 'path',\n {\n d: 'M8.5 21H5a2 2 0 0 1-2-2v-9a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2v-2',\n key: '1gvg2z',\n },\n ],\n]);\n\nexport default HousePlug;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC7C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2E,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAChG,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,3 @@
import type { DrizzleSQLiteSnapshotJSON } from 'drizzle-kit/api';
export declare const defaultDrizzleSnapshot: DrizzleSQLiteSnapshotJSON;
//# sourceMappingURL=defaultSnapshot.d.ts.map

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { subISOWeekYears as fn } from "../subISOWeekYears.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const subISOWeekYears = convertToFP(fn, 2);
// Fallback for modularized imports:
export default subISOWeekYears;

View File

@@ -0,0 +1 @@
{"version":3,"file":"generate-uid.cjs","names":[],"sources":["../../../src/realtime/utils/generate-uid.ts"],"sourcesContent":["/**\n * Fallback generator function to get increment id's for subscriptions\n */\nexport function* generateUid(): Generator<string, string, unknown> {\n\tlet uid = 1;\n\n\twhile (true) {\n\t\tyield String(uid);\n\t\tuid++;\n\t}\n}\n"],"mappings":"AAGA,SAAiB,GAAkD,CAClE,IAAI,EAAM,EAEV,OACC,MAAM,OAAO,EAAI,CACjB"}

View File

@@ -0,0 +1,62 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import { type Equal } from "../../utils.js";
import { PgColumn, PgColumnBuilder } from "./common.js";
export type PgPointTupleBuilderInitial<TName extends string> = PgPointTupleBuilder<{
name: TName;
dataType: 'array';
columnType: 'PgPointTuple';
data: [number, number];
driverParam: number | string;
enumValues: undefined;
}>;
export declare class PgPointTupleBuilder<T extends ColumnBuilderBaseConfig<'array', 'PgPointTuple'>> extends PgColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: string);
}
export declare class PgPointTuple<T extends ColumnBaseConfig<'array', 'PgPointTuple'>> extends PgColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
mapFromDriverValue(value: string | {
x: number;
y: number;
}): [number, number];
mapToDriverValue(value: [number, number]): string;
}
export type PgPointObjectBuilderInitial<TName extends string> = PgPointObjectBuilder<{
name: TName;
dataType: 'json';
columnType: 'PgPointObject';
data: {
x: number;
y: number;
};
driverParam: string;
enumValues: undefined;
}>;
export declare class PgPointObjectBuilder<T extends ColumnBuilderBaseConfig<'json', 'PgPointObject'>> extends PgColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: string);
}
export declare class PgPointObject<T extends ColumnBaseConfig<'json', 'PgPointObject'>> extends PgColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
mapFromDriverValue(value: string | {
x: number;
y: number;
}): {
x: number;
y: number;
};
mapToDriverValue(value: {
x: number;
y: number;
}): string;
}
export interface PgPointConfig<T extends 'tuple' | 'xy' = 'tuple' | 'xy'> {
mode?: T;
}
export declare function point(): PgPointTupleBuilderInitial<''>;
export declare function point<TMode extends PgPointConfig['mode'] & {}>(config?: PgPointConfig<TMode>): Equal<TMode, 'xy'> extends true ? PgPointObjectBuilderInitial<''> : PgPointTupleBuilderInitial<''>;
export declare function point<TName extends string, TMode extends PgPointConfig['mode'] & {}>(name: TName, config?: PgPointConfig<TMode>): Equal<TMode, 'xy'> extends true ? PgPointObjectBuilderInitial<TName> : PgPointTupleBuilderInitial<TName>;

View File

@@ -0,0 +1,37 @@
var baseForRight = require('./_baseForRight'),
castFunction = require('./_castFunction'),
keysIn = require('./keysIn');
/**
* This method is like `_.forIn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forIn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forInRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
*/
function forInRight(object, iteratee) {
return object == null
? object
: baseForRight(object, castFunction(iteratee), keysIn);
}
module.exports = forInRight;

View File

@@ -0,0 +1,9 @@
import type { ComponentProps } from 'react';
import type { Locale } from 'use-intl';
import { IntlProvider } from 'use-intl/react';
type Props = Omit<ComponentProps<typeof IntlProvider>, 'locale'> & {
/** This is automatically received when being rendered from a Server Component. In all other cases, e.g. when rendered from a Client Component, a unit test or with the Pages Router, you can pass this prop explicitly. */
locale?: Locale;
};
export default function NextIntlClientProvider({ locale, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
export {};

View File

@@ -0,0 +1 @@
{"version":3,"file":"columns-4.js","sources":["../../../src/icons/columns-4.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Columns4\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik03LjUgM3YxOCIgLz4KICA8cGF0aCBkPSJNMTIgM3YxOCIgLz4KICA8cGF0aCBkPSJNMTYuNSAzdjE4IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/columns-4\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 Columns4 = createLucideIcon('Columns4', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M7.5 3v18', key: 'w0wo6v' }],\n ['path', { d: 'M12 3v18', key: '108xh3' }],\n ['path', { d: 'M16.5 3v18', key: '10tjh1' }],\n]);\n\nexport default Columns4;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,53 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://json-schema.org/draft/2019-09/meta/applicator",
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/applicator": true
},
"$recursiveAnchor": true,
"title": "Applicator vocabulary meta-schema",
"type": ["object", "boolean"],
"properties": {
"additionalItems": {"$recursiveRef": "#"},
"unevaluatedItems": {"$recursiveRef": "#"},
"items": {
"anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}]
},
"contains": {"$recursiveRef": "#"},
"additionalProperties": {"$recursiveRef": "#"},
"unevaluatedProperties": {"$recursiveRef": "#"},
"properties": {
"type": "object",
"additionalProperties": {"$recursiveRef": "#"},
"default": {}
},
"patternProperties": {
"type": "object",
"additionalProperties": {"$recursiveRef": "#"},
"propertyNames": {"format": "regex"},
"default": {}
},
"dependentSchemas": {
"type": "object",
"additionalProperties": {
"$recursiveRef": "#"
}
},
"propertyNames": {"$recursiveRef": "#"},
"if": {"$recursiveRef": "#"},
"then": {"$recursiveRef": "#"},
"else": {"$recursiveRef": "#"},
"allOf": {"$ref": "#/$defs/schemaArray"},
"anyOf": {"$ref": "#/$defs/schemaArray"},
"oneOf": {"$ref": "#/$defs/schemaArray"},
"not": {"$recursiveRef": "#"}
},
"$defs": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": {"$recursiveRef": "#"}
}
}
}

View File

@@ -0,0 +1,44 @@
<div align="center">
<img src="./misc/readme/logo-github-sq-dark.svg#gh-dark-mode-only" />
<img src="./misc/readme/logo-github-sq-light.svg#gh-light-mode-only" />
</div>
<br/>
<div align="center">
<h3>Headless ORM for NodeJS, TypeScript and JavaScript 🚀</h3>
<a href="https://orm.drizzle.team">Website</a> •
<a href="https://orm.drizzle.team/docs/overview">Documentation</a> •
<a href="https://x.com/drizzleorm">Twitter</a> •
<a href="https://driz.link/discord">Discord</a>
</div>
<br/>
<br/>
### What's Drizzle?
Drizzle is a modern TypeScript ORM developers [wanna use in their next project](https://stateofdb.com/tools/drizzle).
It is [lightweight](https://bundlephobia.com/package/drizzle-orm) at only ~7.4kb minified+gzipped, and it's tree shakeable with exactly 0 dependencies.
**Drizzle supports every PostgreSQL, MySQL and SQLite database**, including serverless ones like [Turso](https://orm.drizzle.team/docs/get-started-sqlite#turso), [Neon](https://orm.drizzle.team/docs/get-started-postgresql#neon), [Xata](https://orm.drizzle.team/docs/connect-xata), [PlanetScale](https://orm.drizzle.team/docs/get-started-mysql#planetscale), [Cloudflare D1](https://orm.drizzle.team/docs/get-started-sqlite#cloudflare-d1), [FlyIO LiteFS](https://fly.io/docs/litefs/), [Vercel Postgres](https://orm.drizzle.team/docs/get-started-postgresql#vercel-postgres), [Supabase](https://orm.drizzle.team/docs/get-started-postgresql#supabase) and [AWS Data API](https://orm.drizzle.team/docs/get-started-postgresql#aws-data-api). No bells and whistles, no Rust binaries, no serverless adapters, everything just works out of the box.
**Drizzle is serverless-ready by design**. It works in every major JavaScript runtime like NodeJS, Bun, Deno, Cloudflare Workers, Supabase functions, any Edge runtime, and even in browsers.
With Drizzle you can be [**fast out of the box**](https://orm.drizzle.team/benchmarks) and save time and costs while never introducing any data proxies into your infrastructure.
While you can use Drizzle as a JavaScript library, it shines with TypeScript. It lets you [**declare SQL schemas**](https://orm.drizzle.team/docs/sql-schema-declaration) and build both [**relational**](https://orm.drizzle.team/docs/rqb) and [**SQL-like queries**](https://orm.drizzle.team/docs/select), while keeping the balance between type-safety and extensibility for toolmakers to build on top.
### Ecosystem
While Drizzle ORM remains a thin typed layer on top of SQL, we made a set of tools for people to have best possible developer experience.
Drizzle comes with a powerful [**Drizzle Kit**](https://orm.drizzle.team/kit-docs/overview) CLI companion for you to have hassle-free migrations. It can generate SQL migration files for you or apply schema changes directly to the database.
We also have [**Drizzle Studio**](https://orm.drizzle.team/drizzle-studio/overview) for you to effortlessly browse and manipulate data in your database of choice.
### Documentation
Check out the full documentation on [the website](https://orm.drizzle.team/docs/overview).
### Our sponsors ❤️
<p align="center">
<a href="https://drizzle.team" target="_blank">
<img src='https://api.drizzle.team/v2/sponsors/svg'/>
</a>
</p>

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/versions/drafts/appendVersionToQueryKey.ts"],"sourcesContent":["import type { Where } from '../../types/index.js'\n\nexport const appendVersionToQueryKey = (query: Where = {}): Where => {\n return Object.entries(query).reduce((res, [key, val]) => {\n if (['AND', 'and', 'OR', 'or'].includes(key) && Array.isArray(val)) {\n return {\n ...res,\n [key.toLowerCase()]: val.map((subQuery) => appendVersionToQueryKey(subQuery)),\n }\n }\n\n if (key !== 'id') {\n return {\n ...res,\n [`version.${key}`]: val,\n }\n }\n\n return {\n ...res,\n parent: val,\n }\n }, {})\n}\n"],"names":["appendVersionToQueryKey","query","Object","entries","reduce","res","key","val","includes","Array","isArray","toLowerCase","map","subQuery","parent"],"mappings":"AAEA,OAAO,MAAMA,0BAA0B,CAACC,QAAe,CAAC,CAAC;IACvD,OAAOC,OAAOC,OAAO,CAACF,OAAOG,MAAM,CAAC,CAACC,KAAK,CAACC,KAAKC,IAAI;QAClD,IAAI;YAAC;YAAO;YAAO;YAAM;SAAK,CAACC,QAAQ,CAACF,QAAQG,MAAMC,OAAO,CAACH,MAAM;YAClE,OAAO;gBACL,GAAGF,GAAG;gBACN,CAACC,IAAIK,WAAW,GAAG,EAAEJ,IAAIK,GAAG,CAAC,CAACC,WAAab,wBAAwBa;YACrE;QACF;QAEA,IAAIP,QAAQ,MAAM;YAChB,OAAO;gBACL,GAAGD,GAAG;gBACN,CAAC,CAAC,QAAQ,EAAEC,KAAK,CAAC,EAAEC;YACtB;QACF;QAEA,OAAO;YACL,GAAGF,GAAG;YACNS,QAAQP;QACV;IACF,GAAG,CAAC;AACN,EAAC"}

View File

@@ -0,0 +1,17 @@
/**
* @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 RotateCcwSquare = createLucideIcon("RotateCcwSquare", [
["path", { d: "M20 9V7a2 2 0 0 0-2-2h-6", key: "19z8uc" }],
["path", { d: "m15 2-3 3 3 3", key: "177bxs" }],
["path", { d: "M20 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2", key: "d36hnl" }]
]);
export { RotateCcwSquare as default };
//# sourceMappingURL=rotate-ccw-square.js.map

View File

@@ -0,0 +1,14 @@
'use strict';
const strip = require('./strip');
/**
* @param {string} msg
* @param {number} perLine
*/
module.exports = function (msg, perLine) {
let lines = String(strip(msg) || '').split(/\r?\n/);
if (!perLine) return lines.length;
return lines.map(l => Math.ceil(l.length / perLine)).reduce((a, b) => a + b);
};

View File

@@ -0,0 +1,15 @@
Prism.languages.processing = Prism.languages.extend('clike', {
'keyword': /\b(?:break|case|catch|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,
// Spaces are allowed between function name and parenthesis
'function': /\b\w+(?=\s*\()/,
'operator': /<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/
});
Prism.languages.insertBefore('processing', 'number', {
// Special case: XML is a type
'constant': /\b(?!XML\b)[A-Z][A-Z\d_]+\b/,
'type': {
pattern: /\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/,
alias: 'class-name'
}
});

View File

@@ -0,0 +1,10 @@
"use strict";
exports.isWeekend = void 0;
var _index = require("../isWeekend.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isWeekend = (exports.isWeekend = (0, _index2.convertToFP)(
_index.isWeekend,
1,
));

View File

@@ -0,0 +1,37 @@
"use strict";
exports.startOfMonth = startOfMonth;
var _index = require("./toDate.cjs");
/**
* The {@link startOfMonth} function options.
*/
/**
* @name startOfMonth
* @category Month Helpers
* @summary Return the start of a month for the given date.
*
* @description
* Return the start of a month for the given date. The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
* Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
* or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The start of a month
*
* @example
* // The start of a month for 2 September 2014 11:55:00:
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfMonth(date, options) {
const _date = (0, _index.toDate)(date, options?.in);
_date.setDate(1);
_date.setHours(0, 0, 0, 0);
return _date;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../../../../../src/integrations/tracing/fastify/v3/constants.ts"],"sourcesContent":["// Vendored from https://github.com/open-telemetry/opentelemetry-js-contrib/blob/407f61591ba69a39a6908264379d4d98a48dbec4/plugins/node/opentelemetry-instrumentation-fastify/src/constants.ts\n/*\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 spanRequestSymbol = Symbol('opentelemetry.instrumentation.fastify.request_active_span');\n\n// The instrumentation creates a span for invocations of lifecycle hook handlers\n// that take `(request, reply, ...[, done])` arguments. Currently this is all\n// lifecycle hooks except `onRequestAbort`.\n// https://fastify.dev/docs/latest/Reference/Hooks\nexport const hooksNamesToWrap = new Set([\n 'onTimeout',\n 'onRequest',\n 'preParsing',\n 'preValidation',\n 'preSerialization',\n 'preHandler',\n 'onSend',\n 'onResponse',\n 'onError',\n]);\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;MAEa,iBAAA,GAAoB,MAAM,CAAC,2DAA2D;;;;"}

View File

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

View File

@@ -0,0 +1,6 @@
{
"private": true,
"types": "../dist/m.d.ts",
"main": "../dist/cjs/m.js",
"module": "../dist/es/m.mjs"
}

View File

@@ -0,0 +1,27 @@
var createCompounder = require('./_createCompounder');
/**
* Converts `string`, as space separated words, to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.upperCase('--foo-bar');
* // => 'FOO BAR'
*
* _.upperCase('fooBar');
* // => 'FOO BAR'
*
* _.upperCase('__foo_bar__');
* // => 'FOO BAR'
*/
var upperCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toUpperCase();
});
module.exports = upperCase;

View File

@@ -0,0 +1,6 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";module.exports=t,module.exports.default=t;const e={type:"object",additionalProperties:!1,properties:{activeModules:{type:"boolean"},dependencies:{type:"boolean"},dependenciesCount:{type:"number"},entries:{type:"boolean"},handler:{oneOf:[{$ref:"#/definitions/HandlerFunction"}]},modules:{type:"boolean"},modulesCount:{type:"number"},percentBy:{enum:["entries","modules","dependencies",null]},profile:{enum:[!0,!1,null]}}},r=Object.prototype.hasOwnProperty;function n(t,{instancePath:o="",parentData:s,parentDataProperty:a,rootData:l=t}={}){let i=null,p=0;if(0===p){if(!t||"object"!=typeof t||Array.isArray(t))return n.errors=[{params:{type:"object"}}],!1;{const o=p;for(const o in t)if(!r.call(e.properties,o))return n.errors=[{params:{additionalProperty:o}}],!1;if(o===p){if(void 0!==t.activeModules){const e=p;if("boolean"!=typeof t.activeModules)return n.errors=[{params:{type:"boolean"}}],!1;var u=e===p}else u=!0;if(u){if(void 0!==t.dependencies){const e=p;if("boolean"!=typeof t.dependencies)return n.errors=[{params:{type:"boolean"}}],!1;u=e===p}else u=!0;if(u){if(void 0!==t.dependenciesCount){const e=p;if("number"!=typeof t.dependenciesCount)return n.errors=[{params:{type:"number"}}],!1;u=e===p}else u=!0;if(u){if(void 0!==t.entries){const e=p;if("boolean"!=typeof t.entries)return n.errors=[{params:{type:"boolean"}}],!1;u=e===p}else u=!0;if(u){if(void 0!==t.handler){const e=p,r=p;let o=!1,s=null;const a=p;if(!(t.handler instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),p++}if(a===p&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===i?i=[e]:i.push(e),p++,n.errors=i,!1}p=r,null!==i&&(r?i.length=r:i=null),u=e===p}else u=!0;if(u){if(void 0!==t.modules){const e=p;if("boolean"!=typeof t.modules)return n.errors=[{params:{type:"boolean"}}],!1;u=e===p}else u=!0;if(u){if(void 0!==t.modulesCount){const e=p;if("number"!=typeof t.modulesCount)return n.errors=[{params:{type:"number"}}],!1;u=e===p}else u=!0;if(u){if(void 0!==t.percentBy){let e=t.percentBy;const r=p;if("entries"!==e&&"modules"!==e&&"dependencies"!==e&&null!==e)return n.errors=[{params:{}}],!1;u=r===p}else u=!0;if(u)if(void 0!==t.profile){let e=t.profile;const r=p;if(!0!==e&&!1!==e&&null!==e)return n.errors=[{params:{}}],!1;u=r===p}else u=!0}}}}}}}}}}return n.errors=i,0===p}function t(e,{instancePath:r="",parentData:o,parentDataProperty:s,rootData:a=e}={}){let l=null,i=0;const p=i;let u=!1;const c=i;n(e,{instancePath:r,parentData:o,parentDataProperty:s,rootData:a})||(l=null===l?n.errors:l.concat(n.errors),i=l.length);var f=c===i;if(u=u||f,!u){const r=i;if(!(e instanceof Function)){const e={params:{}};null===l?l=[e]:l.push(e),i++}f=r===i,u=u||f}if(!u){const e={params:{}};return null===l?l=[e]:l.push(e),i++,t.errors=l,!1}return i=p,null!==l&&(p?l.length=p:l=null),t.errors=l,0===i}

View File

@@ -0,0 +1 @@
{"version":3,"file":"refresh-ccw.js","sources":["../../../src/icons/refresh-ccw.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name RefreshCcw\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTJhOSA5IDAgMCAwLTktOSA5Ljc1IDkuNzUgMCAwIDAtNi43NCAyLjc0TDMgOCIgLz4KICA8cGF0aCBkPSJNMyAzdjVoNSIgLz4KICA8cGF0aCBkPSJNMyAxMmE5IDkgMCAwIDAgOSA5IDkuNzUgOS43NSAwIDAgMCA2Ljc0LTIuNzRMMjEgMTYiIC8+CiAgPHBhdGggZD0iTTE2IDE2aDV2NSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/refresh-ccw\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 RefreshCcw = createLucideIcon('RefreshCcw', [\n ['path', { d: 'M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8', key: '14sxne' }],\n ['path', { d: 'M3 3v5h5', key: '1xhq8a' }],\n ['path', { d: 'M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16', key: '1hlbsb' }],\n ['path', { d: 'M16 16h5v5', key: 'ccwih5' }],\n]);\n\nexport default RefreshCcw;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACnF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAuD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACpF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,10 @@
/**
* 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 mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalDraggableBlockPlugin.dev.mjs') : import('./LexicalDraggableBlockPlugin.prod.mjs'));
export const DraggableBlockPlugin_EXPERIMENTAL = mod.DraggableBlockPlugin_EXPERIMENTAL;

View File

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

View File

@@ -0,0 +1,431 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { DndContext, DragOverlay, useDraggable, useDroppable } from '@dnd-kit/core';
import { snapCenterToCursor } from '@dnd-kit/modifiers';
import { ChevronIcon, Popup, PopupList, useTranslation, XIcon } from '@payloadcms/ui';
import React, { useMemo, useState } from 'react';
/**
* Custom modifier that only applies snapCenterToCursor for pointer events.
* During keyboard navigation, we handle positioning ourselves via the coordinate getter.
*/
const snapCenterToCursorOnlyForPointer = args => {
const {
activatorEvent
} = args;
// Only apply snap for pointer events (mouse/touch), not keyboard
// Check activatorEvent.type since KeyboardEvent may not exist on server
if (activatorEvent && 'key' in activatorEvent) {
return args.transform;
}
return snapCenterToCursor(args);
};
import { DashboardStepNav } from './DashboardStepNav.js';
import { useDashboardLayout } from './useDashboardLayout.js';
import { closestInXAxis } from './utils/collisionDetection.js';
import { useDashboardSensors } from './utils/sensors.js';
/* eslint-disable perfectionist/sort-objects */
const WIDTH_TO_PERCENTAGE = {
'x-small': 25,
small: 1 / 3 * 100,
medium: 50,
large: 2 / 3 * 100,
'x-large': 75,
full: 100
};
export function ModularDashboardClient(t0) {
const $ = _c(21);
const {
clientLayout: initialLayout,
widgets
} = t0;
const {
t
} = useTranslation();
const {
addWidget,
cancel,
cancelModal,
currentLayout,
deleteWidget,
isEditing,
moveWidget,
resetLayout,
resizeWidget,
saveLayout,
setIsEditing
} = useDashboardLayout(initialLayout);
const [activeDragId, setActiveDragId] = useState(null);
const sensors = useDashboardSensors();
let t1;
if ($[0] !== activeDragId || $[1] !== addWidget || $[2] !== cancel || $[3] !== cancelModal || $[4] !== currentLayout || $[5] !== deleteWidget || $[6] !== isEditing || $[7] !== moveWidget || $[8] !== resetLayout || $[9] !== resizeWidget || $[10] !== saveLayout || $[11] !== sensors || $[12] !== setIsEditing || $[13] !== t || $[14] !== widgets) {
let t2;
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
t2 = () => {
setActiveDragId(null);
};
$[16] = t2;
} else {
t2 = $[16];
}
let t3;
if ($[17] !== currentLayout || $[18] !== moveWidget) {
t3 = event => {
if (!event.over) {
setActiveDragId(null);
return;
}
const droppableId = event.over.id;
const i = droppableId.lastIndexOf("-");
const slug = droppableId.slice(0, i);
const position = droppableId.slice(i + 1);
if (slug === event.active.id) {
return;
}
const moveFromIndex = currentLayout?.findIndex(widget => widget.item.id === event.active.id);
let moveToIndex = currentLayout?.findIndex(widget_0 => widget_0.item.id === slug);
if (moveFromIndex < moveToIndex) {
moveToIndex--;
}
if (position === "after") {
moveToIndex++;
}
moveWidget({
moveFromIndex,
moveToIndex
});
setActiveDragId(null);
};
$[17] = currentLayout;
$[18] = moveWidget;
$[19] = t3;
} else {
t3 = $[19];
}
let t4;
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
t4 = event_0 => {
setActiveDragId(event_0.active.id);
};
$[20] = t4;
} else {
t4 = $[20];
}
t1 = _jsxs("div", {
children: [_jsx(DndContext, {
autoScroll: {
enabled: true,
threshold: {
x: 0,
y: 0.2
}
},
collisionDetection: closestInXAxis,
id: "dashboard-dnd-context",
onDragCancel: t2,
onDragEnd: t3,
onDragStart: t4,
sensors,
children: _jsxs("div", {
className: `modular-dashboard ${isEditing ? "editing" : ""}`,
style: {
display: "flex",
flexWrap: "wrap"
},
children: [currentLayout?.length === 0 && _jsx("div", {
className: "modular-dashboard__empty",
children: _jsx("p", {
children: "There are no widgets on your dashboard. You can add them from the \"Dashboard\" menu located in the top bar."
})
}), currentLayout?.map((widget_1, _index) => _jsx(React.Fragment, {
children: _jsx(DraggableItem, {
disabled: !isEditing,
id: widget_1.item.id,
style: {
width: `${WIDTH_TO_PERCENTAGE[widget_1.item.width]}%`,
padding: "6px"
},
width: widget_1.item.width,
children: _jsxs("div", {
className: `widget-wrapper ${isEditing ? "widget-wrapper--editing" : ""}`,
children: [_jsx("div", {
"aria-hidden": isEditing,
className: "widget-content",
inert: isEditing,
children: widget_1.component
}), isEditing && _jsxs("div", {
className: "widget-wrapper__controls",
onPointerDown: _temp,
children: [_jsx(WidgetWidthDropdown, {
currentWidth: widget_1.item.width,
maxWidth: widget_1.item.maxWidth,
minWidth: widget_1.item.minWidth,
onResize: width => resizeWidget(widget_1.item.id, width)
}), _jsxs("button", {
className: "widget-wrapper__delete-btn",
onClick: () => deleteWidget(widget_1.item.id),
type: "button",
children: [_jsx("span", {
className: "sr-only",
children: t("dashboard:deleteWidget", {
id: widget_1.item.id
})
}), _jsx(XIcon, {})]
})]
})]
})
})
}, widget_1.item.id)), _jsx(DragOverlay, {
className: "drag-overlay",
dropAnimation: {
duration: 100
},
modifiers: [snapCenterToCursorOnlyForPointer],
children: activeDragId ? (() => {
const draggedWidget = currentLayout?.find(widget_2 => widget_2.item.id === activeDragId);
return draggedWidget ? _jsx("div", {
style: {
transform: "scale(0.25)"
},
children: _jsx("div", {
className: `widget-wrapper ${isEditing ? "widget-wrapper--editing" : ""}`,
children: _jsx("div", {
className: "widget-content",
children: draggedWidget.component
})
})
}) : null;
})() : null
})]
})
}), _jsx(DashboardStepNav, {
addWidget,
cancel,
isEditing,
resetLayout,
saveLayout,
setIsEditing,
widgets
}), cancelModal]
});
$[0] = activeDragId;
$[1] = addWidget;
$[2] = cancel;
$[3] = cancelModal;
$[4] = currentLayout;
$[5] = deleteWidget;
$[6] = isEditing;
$[7] = moveWidget;
$[8] = resetLayout;
$[9] = resizeWidget;
$[10] = saveLayout;
$[11] = sensors;
$[12] = setIsEditing;
$[13] = t;
$[14] = widgets;
$[15] = t1;
} else {
t1 = $[15];
}
return t1;
}
function _temp(e) {
return e.stopPropagation();
}
function WidgetWidthDropdown({
currentWidth,
maxWidth,
minWidth,
onResize
}) {
// Filter options based on minWidth and maxWidth
const validOptions = useMemo(() => {
const minPercentage = WIDTH_TO_PERCENTAGE[minWidth];
const maxPercentage = WIDTH_TO_PERCENTAGE[maxWidth];
return Object.entries(WIDTH_TO_PERCENTAGE).map(([key, value]) => ({
width: key,
percentage: value
})).filter(option => option.percentage >= minPercentage && option.percentage <= maxPercentage);
}, [minWidth, maxWidth]);
const isDisabled = validOptions.length <= 1;
return /*#__PURE__*/_jsx(Popup, {
button: /*#__PURE__*/_jsxs("button", {
className: "widget-wrapper__size-btn",
disabled: isDisabled,
onPointerDown: e => e.stopPropagation(),
type: "button",
children: [/*#__PURE__*/_jsx("span", {
className: "widget-wrapper__size-btn-text",
children: currentWidth
}), /*#__PURE__*/_jsx(ChevronIcon, {
className: "widget-wrapper__size-btn-icon"
})]
}),
buttonType: "custom",
disabled: isDisabled,
render: ({
close
}) => /*#__PURE__*/_jsx(PopupList.ButtonGroup, {
children: validOptions.map(option_0 => {
const isSelected = option_0.width === currentWidth;
return /*#__PURE__*/_jsxs(PopupList.Button, {
active: isSelected,
onClick: () => {
onResize(option_0.width);
close();
},
children: [/*#__PURE__*/_jsx("span", {
className: "widget-wrapper__size-btn-label",
children: option_0.width
}), /*#__PURE__*/_jsxs("span", {
className: "widget-wrapper__size-btn-percentage",
children: [option_0.percentage.toFixed(0), "%"]
})]
}, option_0.width);
})
}),
size: "small",
verticalAlign: "bottom"
});
}
function DraggableItem(props) {
const $ = _c(13);
let t0;
if ($[0] !== props.disabled || $[1] !== props.id) {
t0 = {
id: props.id,
disabled: props.disabled
};
$[0] = props.disabled;
$[1] = props.id;
$[2] = t0;
} else {
t0 = $[2];
}
const {
attributes,
isDragging,
listeners,
setNodeRef
} = useDraggable(t0);
const t1 = isDragging ? 0.3 : 1;
let t2;
if ($[3] !== attributes || $[4] !== listeners || $[5] !== props.children || $[6] !== props.disabled || $[7] !== props.id || $[8] !== props.style || $[9] !== props.width || $[10] !== setNodeRef || $[11] !== t1) {
const mergedStyles = {
...props.style,
opacity: t1,
position: "relative"
};
const draggableProps = props.disabled ? {} : {
...listeners,
...attributes
};
t2 = _jsxs("div", {
className: "widget",
"data-slug": props.id,
"data-width": props.width,
style: mergedStyles,
children: [_jsx(DroppableItem, {
id: props.id,
position: "before"
}), _jsx("div", {
className: "draggable",
id: props.id,
ref: setNodeRef,
...draggableProps,
style: {
width: "100%",
height: "100%"
},
children: props.children
}), _jsx(DroppableItem, {
id: props.id,
position: "after"
})]
});
$[3] = attributes;
$[4] = listeners;
$[5] = props.children;
$[6] = props.disabled;
$[7] = props.id;
$[8] = props.style;
$[9] = props.width;
$[10] = setNodeRef;
$[11] = t1;
$[12] = t2;
} else {
t2 = $[12];
}
return t2;
}
function DroppableItem(t0) {
const $ = _c(11);
const {
id,
position
} = t0;
const t1 = `${id}-${position}`;
let t2;
if ($[0] !== position) {
t2 = {
position
};
$[0] = position;
$[1] = t2;
} else {
t2 = $[1];
}
let t3;
if ($[2] !== t1 || $[3] !== t2) {
t3 = {
id: t1,
data: t2
};
$[2] = t1;
$[3] = t2;
$[4] = t3;
} else {
t3 = $[4];
}
const {
setNodeRef,
isOver
} = useDroppable(t3);
const t4 = `${id}-${position}`;
const t5 = position === "before" ? -2 : "auto";
const t6 = position === "after" ? -2 : "auto";
const t7 = isOver ? "var(--theme-success-400)" : "transparent";
let t8;
if ($[5] !== setNodeRef || $[6] !== t4 || $[7] !== t5 || $[8] !== t6 || $[9] !== t7) {
t8 = _jsx("div", {
className: "droppable-widget",
"data-testid": t4,
ref: setNodeRef,
style: {
position: "absolute",
left: t5,
right: t6,
top: 0,
bottom: 0,
borderRadius: "1000px",
width: "4px",
backgroundColor: t7,
marginBottom: "10px",
marginTop: "10px",
pointerEvents: "none",
zIndex: 1000
}
});
$[5] = setNodeRef;
$[6] = t4;
$[7] = t5;
$[8] = t6;
$[9] = t7;
$[10] = t8;
} else {
t8 = $[10];
}
return t8;
}
//# sourceMappingURL=index.client.js.map

View File

@@ -0,0 +1,7 @@
"use strict";
exports.getTime = void 0;
var _index = require("../getTime.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const getTime = (exports.getTime = (0, _index2.convertToFP)(_index.getTime, 1));

View File

@@ -0,0 +1,83 @@
"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 refresh_materialized_view_exports = {};
__export(refresh_materialized_view_exports, {
PgRefreshMaterializedView: () => PgRefreshMaterializedView
});
module.exports = __toCommonJS(refresh_materialized_view_exports);
var import_entity = require("../../entity.cjs");
var import_query_promise = require("../../query-promise.cjs");
var import_tracing = require("../../tracing.cjs");
class PgRefreshMaterializedView extends import_query_promise.QueryPromise {
constructor(view, session, dialect) {
super();
this.session = session;
this.dialect = dialect;
this.config = { view };
}
static [import_entity.entityKind] = "PgRefreshMaterializedView";
config;
concurrently() {
if (this.config.withNoData !== void 0) {
throw new Error("Cannot use concurrently and withNoData together");
}
this.config.concurrently = true;
return this;
}
withNoData() {
if (this.config.concurrently !== void 0) {
throw new Error("Cannot use concurrently and withNoData together");
}
this.config.withNoData = true;
return this;
}
/** @internal */
getSQL() {
return this.dialect.buildRefreshMaterializedViewQuery(this.config);
}
toSQL() {
const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());
return rest;
}
/** @internal */
_prepare(name) {
return import_tracing.tracer.startActiveSpan("drizzle.prepareQuery", () => {
return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), void 0, name, true);
});
}
prepare(name) {
return this._prepare(name);
}
authToken;
/** @internal */
setToken(token) {
this.authToken = token;
return this;
}
execute = (placeholderValues) => {
return import_tracing.tracer.startActiveSpan("drizzle.operation", () => {
return this._prepare().execute(placeholderValues, this.authToken);
});
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PgRefreshMaterializedView
});
//# sourceMappingURL=refresh-materialized-view.cjs.map

View File

@@ -0,0 +1,91 @@
'use strict'
// just pre-load all the stuff that index.js lazily exports
const internalRe = require('./internal/re')
const constants = require('./internal/constants')
const SemVer = require('./classes/semver')
const identifiers = require('./internal/identifiers')
const parse = require('./functions/parse')
const valid = require('./functions/valid')
const clean = require('./functions/clean')
const inc = require('./functions/inc')
const diff = require('./functions/diff')
const major = require('./functions/major')
const minor = require('./functions/minor')
const patch = require('./functions/patch')
const prerelease = require('./functions/prerelease')
const compare = require('./functions/compare')
const rcompare = require('./functions/rcompare')
const compareLoose = require('./functions/compare-loose')
const compareBuild = require('./functions/compare-build')
const sort = require('./functions/sort')
const rsort = require('./functions/rsort')
const gt = require('./functions/gt')
const lt = require('./functions/lt')
const eq = require('./functions/eq')
const neq = require('./functions/neq')
const gte = require('./functions/gte')
const lte = require('./functions/lte')
const cmp = require('./functions/cmp')
const coerce = require('./functions/coerce')
const Comparator = require('./classes/comparator')
const Range = require('./classes/range')
const satisfies = require('./functions/satisfies')
const toComparators = require('./ranges/to-comparators')
const maxSatisfying = require('./ranges/max-satisfying')
const minSatisfying = require('./ranges/min-satisfying')
const minVersion = require('./ranges/min-version')
const validRange = require('./ranges/valid')
const outside = require('./ranges/outside')
const gtr = require('./ranges/gtr')
const ltr = require('./ranges/ltr')
const intersects = require('./ranges/intersects')
const simplifyRange = require('./ranges/simplify')
const subset = require('./ranges/subset')
module.exports = {
parse,
valid,
clean,
inc,
diff,
major,
minor,
patch,
prerelease,
compare,
rcompare,
compareLoose,
compareBuild,
sort,
rsort,
gt,
lt,
eq,
neq,
gte,
lte,
cmp,
coerce,
Comparator,
Range,
satisfies,
toComparators,
maxSatisfying,
minSatisfying,
minVersion,
validRange,
outside,
gtr,
ltr,
intersects,
simplifyRange,
subset,
SemVer,
re: internalRe.re,
src: internalRe.src,
tokens: internalRe.t,
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
RELEASE_TYPES: constants.RELEASE_TYPES,
compareIdentifiers: identifiers.compareIdentifiers,
rcompareIdentifiers: identifiers.rcompareIdentifiers,
}

View File

@@ -0,0 +1,42 @@
@import '../../scss/styles.scss';
@layer payload-default {
.thumbnail-card {
@include btn-reset;
@include shadow-m;
width: 100%;
background: var(--theme-input-bg);
border: 1px solid var(--theme-border-color);
border-radius: var(--style-radius-m);
transition: border 100ms cubic-bezier(0, 0.2, 0.2, 1);
padding: base(0.5);
&__label {
padding: base(0.75) base(0.5) base(0.25) base(0.5);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 600;
}
&--has-on-click {
cursor: pointer;
&:hover,
&:focus,
&:active {
border: 1px solid var(--theme-elevation-350);
}
}
&--align-label-center {
text-align: center;
}
&__thumbnail {
display: flex;
align-items: center;
justify-content: center;
}
}
}

View File

@@ -0,0 +1,5 @@
var assertClassBrand = require("./assertClassBrand.js");
function _classPrivateMethodGet(s, a, r) {
return assertClassBrand(a, s), r;
}
module.exports = _classPrivateMethodGet, module.exports.__esModule = true, module.exports["default"] = module.exports;

View File

@@ -0,0 +1,20 @@
import { InstrumentationConfig, InstrumentationModuleDefinition } from '@opentelemetry/instrumentation';
import { InstrumentationBase } from '@opentelemetry/instrumentation';
import { GoogleGenAIOptions } from '@sentry/core';
type GoogleGenAIInstrumentationOptions = GoogleGenAIOptions & InstrumentationConfig;
/**
* Sentry Google GenAI instrumentation using OpenTelemetry.
*/
export declare class SentryGoogleGenAiInstrumentation extends InstrumentationBase<GoogleGenAIInstrumentationOptions> {
constructor(config?: GoogleGenAIInstrumentationOptions);
/**
* Initializes the instrumentation by defining the modules to be patched.
*/
init(): InstrumentationModuleDefinition;
/**
* Core patch logic applying instrumentation to the Google GenAI client constructor.
*/
private _patch;
}
export {};
//# sourceMappingURL=instrumentation.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 ServerOff = createLucideIcon("ServerOff", [
["path", { d: "M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5", key: "bt2siv" }],
["path", { d: "M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z", key: "1hjrv1" }],
["path", { d: "M22 17v-1a2 2 0 0 0-2-2h-1", key: "1iynyr" }],
["path", { d: "M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z", key: "161ggg" }],
["path", { d: "M6 18h.01", key: "uhywen" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }]
]);
export { ServerOff as default };
//# sourceMappingURL=server-off.js.map

View File

@@ -0,0 +1,2 @@
export { instrumentLangGraph } from '@sentry/core';
//# sourceMappingURL=index.instrumentlanggraph.d.ts.map

View File

@@ -0,0 +1,13 @@
/* eslint-disable no-eval */
eval(`
const pino = require('../../../')
const logger = pino(
pino.transport({
target: 'pino/file'
})
)
logger.info('done!')
`)

View File

@@ -0,0 +1,113 @@
#include "Debounce.hh"
#ifdef __wasm32__
extern "C" void on_timeout(void *ctx) {
Debounce *debounce = (Debounce *)ctx;
debounce->notify();
}
#endif
std::shared_ptr<Debounce> Debounce::getShared() {
static std::weak_ptr<Debounce> sharedInstance;
std::shared_ptr<Debounce> shared = sharedInstance.lock();
if (!shared) {
shared = std::make_shared<Debounce>();
sharedInstance = shared;
}
return shared;
}
Debounce::Debounce() {
mRunning = true;
#ifndef __wasm32__
mThread = std::thread([this] () {
loop();
});
#endif
}
Debounce::~Debounce() {
mRunning = false;
#ifndef __wasm32__
mWaitSignal.notify();
mThread.join();
#endif
}
void Debounce::add(void *key, std::function<void()> cb) {
std::unique_lock<std::mutex> lock(mMutex);
mCallbacks.emplace(key, cb);
}
void Debounce::remove(void *key) {
std::unique_lock<std::mutex> lock(mMutex);
mCallbacks.erase(key);
}
void Debounce::trigger() {
std::unique_lock<std::mutex> lock(mMutex);
#ifdef __wasm32__
notifyIfReady();
#else
mWaitSignal.notify();
#endif
}
#ifndef __wasm32__
void Debounce::loop() {
while (mRunning) {
mWaitSignal.wait();
if (!mRunning) {
break;
}
notifyIfReady();
}
}
#endif
void Debounce::notifyIfReady() {
if (!mRunning) {
return;
}
// If we haven't seen an event in more than the maximum wait time, notify callbacks immediately
// to ensure that we don't wait forever. Otherwise, wait for the minimum wait time and batch
// subsequent fast changes. This also means the first file change in a batch is notified immediately,
// separately from the rest of the batch. This seems like an acceptable tradeoff if the common case
// is that only a single file was updated at a time.
auto time = std::chrono::steady_clock::now();
if ((time - mLastTime) > std::chrono::milliseconds(MAX_WAIT_TIME)) {
mLastTime = time;
notify();
} else {
wait();
}
}
void Debounce::wait() {
#ifdef __wasm32__
clear_timeout(mTimeout);
mTimeout = set_timeout(MIN_WAIT_TIME, this);
#else
auto status = mWaitSignal.waitFor(std::chrono::milliseconds(MIN_WAIT_TIME));
if (mRunning && (status == std::cv_status::timeout)) {
notify();
}
#endif
}
void Debounce::notify() {
std::unique_lock<std::mutex> lock(mMutex);
mLastTime = std::chrono::steady_clock::now();
for (auto it = mCallbacks.begin(); it != mCallbacks.end(); it++) {
auto cb = it->second;
cb();
}
#ifndef __wasm32__
mWaitSignal.reset();
#endif
}

View File

@@ -0,0 +1,8 @@
import _typeof from "./typeof.js";
import assertThisInitialized from "./assertThisInitialized.js";
function _possibleConstructorReturn(t, e) {
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
return assertThisInitialized(t);
}
export { _possibleConstructorReturn as default };

View File

@@ -0,0 +1,22 @@
import { type Client, type Config } from '@libsql/client/node';
import { type DrizzleConfig } from "../../utils.cjs";
import { type LibSQLDatabase } from "../driver-core.cjs";
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>, TClient extends Client = Client>(...params: [
TClient | string
] | [
TClient | string,
DrizzleConfig<TSchema>
] | [
(DrizzleConfig<TSchema> & ({
connection: string | Config;
} | {
client: TClient;
}))
]): LibSQLDatabase<TSchema> & {
$client: TClient;
};
export declare namespace drizzle {
function mock<TSchema extends Record<string, unknown> = Record<string, never>>(config?: DrizzleConfig<TSchema>): LibSQLDatabase<TSchema> & {
$client: '$client is not available on drizzle.mock()';
};
}

View File

@@ -0,0 +1,11 @@
/**
* 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'
const useLexicalIsTextContentEmpty = process.env.NODE_ENV !== 'production' ? require('./useLexicalIsTextContentEmpty.dev.js') : require('./useLexicalIsTextContentEmpty.prod.js');
module.exports = useLexicalIsTextContentEmpty;

View File

@@ -0,0 +1,34 @@
var baseUnset = require('./_baseUnset');
/**
* Removes the property at `path` of `object`.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 7 } }] };
* _.unset(object, 'a[0].b.c');
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*
* _.unset(object, ['a', '0', 'b', 'c']);
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*/
function unset(object, path) {
return object == null ? true : baseUnset(object, path);
}
module.exports = unset;

View File

@@ -0,0 +1,9 @@
import type { JSX } from 'react';
import type { I18n, I18nClient, TFunction } from '../types.js';
type LabelType = (() => JSX.Element) | ((args: {
i18n: I18nClient;
t: TFunction;
}) => string) | JSX.Element | Record<string, string> | string;
export declare const getTranslation: <T extends LabelType>(label: T, i18n: Pick<I18n<any, any>, "fallbackLanguage" | "language" | "t">) => T extends JSX.Element ? JSX.Element : string;
export {};
//# sourceMappingURL=getTranslation.d.ts.map

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { eachHourOfInterval as fn } from "../eachHourOfInterval.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const eachHourOfIntervalWithOptions = convertToFP(fn, 2);
// Fallback for modularized imports:
export default eachHourOfIntervalWithOptions;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"2":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z 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","578":"a b c d e f g h i j k l m n o p q r s"},C:{"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 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 4C 5C","2370":"0 1 2 3 4 5 6 7 8 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"},D:{"2":"0 1 2 3 4 5 6 7 8 9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z 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","194":"a b c d e f g h i j k l m n o p q r s","6210":"ZC aC OC"},E:{"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 SC fC gC hC iC jC FD","3076":"TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC f g h i j k l m n o p q r s t u v w x y z JD KD LD MD PC xC ND QC","194":"MC NC Q H R YC S T U V W X Y Z a b c d e"},G:{"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 SC fC gC hC iC jC jD","3076":"TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC"},H:{"2":"mD"},I:{"2":"VC J I nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"2":"A B C H PC xC QC"},L:{"2":"I"},M:{"2":"OC"},N:{"2":"A B"},O:{"2":"RC"},P:{"2":"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:{"2":"4D"},R:{"2":"5D"},S:{"2":"6D 7D"}},B:6,C:"JPEG XL image format",D:true};

View File

@@ -0,0 +1,95 @@
<p align="center">
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
</a>
</p>
# Sentry Babel Component Annotate Plugin
[![npm version](https://img.shields.io/npm/v/@sentry/babel-plugin-component-annotate.svg)](https://www.npmjs.com/package/@sentry/babel-plugin-component-annotate)
[![npm dm](https://img.shields.io/npm/dm/@sentry/babel-plugin-component-annotate.svg)](https://www.npmjs.com/package/@sentry/babel-plugin-component-annotate)
[![npm dt](https://img.shields.io/npm/dt/@sentry/babel-plugin-component-annotate.svg)](https://www.npmjs.com/package/@babel-plugin-component-annotate)
A Babel plugin that automatically annotates your output DOM with their respective frontend component names.
This will unlock the capability to search for Replays in Sentry by component name, as well as see component names in breadcrumbs and performance monitoring.
Please note that your Sentry JavaScript SDK version must be at least `7.91.0` to take advantage of these features.
Currently, this plugin only works with React, and will exclusively parse `.jsx` and `.tsx` files.
### Note
This plugin comes included in Sentry's bundler plugins, alongside many other features to improve your Sentry workflow.
It can be downloaded individually, but it is recommended that you install the bundler plugins for your respective bundler, and enable this feature through the config object.
Check out the supported bundler plugin packages for installation instructions:
- [Rollup](https://www.npmjs.com/package/@sentry/rollup-plugin)
- [Vite](https://www.npmjs.com/package/@sentry/vite-plugin)
- [Webpack](https://www.npmjs.com/package/@sentry/webpack-plugin)
- esbuild: Not currently supported
## Installation
Using npm:
```bash
npm install @sentry/babel-plugin-component-annotate --save-dev
```
Using yarn:
```bash
yarn add @sentry/babel-plugin-component-annotate --dev
```
Using pnpm:
```bash
pnpm add @sentry/babel-plugin-component-annotate --save-dev
```
## Options
### `ignoredComponents`
Type: `string[]`
A list of strings representing the names of components to ignore. The plugin will not apply `data-sentry` annotations on the DOM element for these components.
## Example
```js
// babel.config.js
{
// ... other config above ...
plugins: [
// Put this plugin before any other plugins you have that transform JSX code
// The options are set by providing an object as the second element in the array, but not required
['@sentry/babel-plugin-component-annotate', {ignoredComponents: ['Foo', 'Bar']}]
],
}
```
Or alternatively, configure the plugin by directly importing it:
```js
// babel.config.js
import componentNameAnnotatePlugin from '@sentry/babel-plugin-component-annotate';
{
// ... other config above ...
plugins: [
// Put this plugin before any other plugins you have that transform JSX code
[componentNameAnnotatePlugin]
],
}
```
## More information
- [Sentry Documentation](https://docs.sentry.io/quickstart/)
- [Sentry Discord](https://discord.gg/Ww9hbqr)
- [Sentry Stackoverflow](http://stackoverflow.com/questions/tagged/sentry)

View File

@@ -0,0 +1,25 @@
var baseFlatten = require('./_baseFlatten');
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Recursively flattens `array`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flattenDeep([1, [2, [3, [4]], 5]]);
* // => [1, 2, 3, 4, 5]
*/
function flattenDeep(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, INFINITY) : [];
}
module.exports = flattenDeep;

View File

@@ -0,0 +1,951 @@
/*!
* focus-trap 7.5.4
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tabbable')) :
typeof define === 'function' && define.amd ? define(['exports', 'tabbable'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () {
var current = global.focusTrap;
var exports = global.focusTrap = {};
factory(exports, global.tabbable);
exports.noConflict = function () { global.focusTrap = current; return exports; };
})());
})(this, (function (exports, tabbable) { 'use strict';
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 _objectSpread2(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 _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
var activeFocusTraps = {
activateTrap: function activateTrap(trapStack, trap) {
if (trapStack.length > 0) {
var activeTrap = trapStack[trapStack.length - 1];
if (activeTrap !== trap) {
activeTrap.pause();
}
}
var trapIndex = trapStack.indexOf(trap);
if (trapIndex === -1) {
trapStack.push(trap);
} else {
// move this existing trap to the front of the queue
trapStack.splice(trapIndex, 1);
trapStack.push(trap);
}
},
deactivateTrap: function deactivateTrap(trapStack, trap) {
var trapIndex = trapStack.indexOf(trap);
if (trapIndex !== -1) {
trapStack.splice(trapIndex, 1);
}
if (trapStack.length > 0) {
trapStack[trapStack.length - 1].unpause();
}
}
};
var isSelectableInput = function isSelectableInput(node) {
return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
};
var isEscapeEvent = function isEscapeEvent(e) {
return (e === null || e === void 0 ? void 0 : e.key) === 'Escape' || (e === null || e === void 0 ? void 0 : e.key) === 'Esc' || (e === null || e === void 0 ? void 0 : e.keyCode) === 27;
};
var isTabEvent = function isTabEvent(e) {
return (e === null || e === void 0 ? void 0 : e.key) === 'Tab' || (e === null || e === void 0 ? void 0 : e.keyCode) === 9;
};
// checks for TAB by default
var isKeyForward = function isKeyForward(e) {
return isTabEvent(e) && !e.shiftKey;
};
// checks for SHIFT+TAB by default
var isKeyBackward = function isKeyBackward(e) {
return isTabEvent(e) && e.shiftKey;
};
var delay = function delay(fn) {
return setTimeout(fn, 0);
};
// Array.find/findIndex() are not supported on IE; this replicates enough
// of Array.findIndex() for our needs
var findIndex = function findIndex(arr, fn) {
var idx = -1;
arr.every(function (value, i) {
if (fn(value)) {
idx = i;
return false; // break
}
return true; // next
});
return idx;
};
/**
* Get an option's value when it could be a plain value, or a handler that provides
* the value.
* @param {*} value Option's value to check.
* @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
* @returns {*} The `value`, or the handler's returned value.
*/
var valueOrHandler = function valueOrHandler(value) {
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
params[_key - 1] = arguments[_key];
}
return typeof value === 'function' ? value.apply(void 0, params) : value;
};
var getActualTarget = function getActualTarget(event) {
// NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
// shadow host. However, event.target.composedPath() will be an array of
// nodes "clicked" from inner-most (the actual element inside the shadow) to
// outer-most (the host HTML document). If we have access to composedPath(),
// then use its first element; otherwise, fall back to event.target (and
// this only works for an _open_ shadow DOM; otherwise,
// composedPath()[0] === event.target always).
return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
};
// NOTE: this must be _outside_ `createFocusTrap()` to make sure all traps in this
// current instance use the same stack if `userOptions.trapStack` isn't specified
var internalTrapStack = [];
var createFocusTrap = function createFocusTrap(elements, userOptions) {
// SSR: a live trap shouldn't be created in this type of environment so this
// should be safe code to execute if the `document` option isn't specified
var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
var trapStack = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.trapStack) || internalTrapStack;
var config = _objectSpread2({
returnFocusOnDeactivate: true,
escapeDeactivates: true,
delayInitialFocus: true,
isKeyForward: isKeyForward,
isKeyBackward: isKeyBackward
}, userOptions);
var state = {
// containers given to createFocusTrap()
// @type {Array<HTMLElement>}
containers: [],
// list of objects identifying tabbable nodes in `containers` in the trap
// NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
// is active, but the trap should never get to a state where there isn't at least one group
// with at least one tabbable node in it (that would lead to an error condition that would
// result in an error being thrown)
// @type {Array<{
// container: HTMLElement,
// tabbableNodes: Array<HTMLElement>, // empty if none
// focusableNodes: Array<HTMLElement>, // empty if none
// posTabIndexesFound: boolean,
// firstTabbableNode: HTMLElement|undefined,
// lastTabbableNode: HTMLElement|undefined,
// firstDomTabbableNode: HTMLElement|undefined,
// lastDomTabbableNode: HTMLElement|undefined,
// nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
// }>}
containerGroups: [],
// same order/length as `containers` list
// references to objects in `containerGroups`, but only those that actually have
// tabbable nodes in them
// NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
// the same length
tabbableGroups: [],
nodeFocusedBeforeActivation: null,
mostRecentlyFocusedNode: null,
active: false,
paused: false,
// timer ID for when delayInitialFocus is true and initial focus in this trap
// has been delayed during activation
delayInitialFocusTimer: undefined,
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
recentNavEvent: undefined
};
var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
/**
* Gets a configuration option value.
* @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,
* value will be taken from this object. Otherwise, value will be taken from base configuration.
* @param {string} optionName Name of the option whose value is sought.
* @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
* IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
*/
var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
};
/**
* Finds the index of the container that contains the element.
* @param {HTMLElement} element
* @param {Event} [event] If available, and `element` isn't directly found in any container,
* the event's composed path is used to see if includes any known trap containers in the
* case where the element is inside a Shadow DOM.
* @returns {number} Index of the container in either `state.containers` or
* `state.containerGroups` (the order/length of these lists are the same); -1
* if the element isn't found.
*/
var findContainerIndex = function findContainerIndex(element, event) {
var composedPath = typeof (event === null || event === void 0 ? void 0 : event.composedPath) === 'function' ? event.composedPath() : undefined;
// NOTE: search `containerGroups` because it's possible a group contains no tabbable
// nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
// and we still need to find the element in there
return state.containerGroups.findIndex(function (_ref) {
var container = _ref.container,
tabbableNodes = _ref.tabbableNodes;
return container.contains(element) || ( // fall back to explicit tabbable search which will take into consideration any
// web components if the `tabbableOptions.getShadowRoot` option was used for
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
// look inside web components even if open)
composedPath === null || composedPath === void 0 ? void 0 : composedPath.includes(container)) || tabbableNodes.find(function (node) {
return node === element;
});
});
};
/**
* Gets the node for the given option, which is expected to be an option that
* can be either a DOM node, a string that is a selector to get a node, `false`
* (if a node is explicitly NOT given), or a function that returns any of these
* values.
* @param {string} optionName
* @returns {undefined | false | HTMLElement | SVGElement} Returns
* `undefined` if the option is not specified; `false` if the option
* resolved to `false` (node explicitly not given); otherwise, the resolved
* DOM node.
* @throws {Error} If the option is set, not `false`, and is not, or does not
* resolve to a node.
*/
var getNodeForOption = function getNodeForOption(optionName) {
var optionValue = config[optionName];
if (typeof optionValue === 'function') {
for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
params[_key2 - 1] = arguments[_key2];
}
optionValue = optionValue.apply(void 0, params);
}
if (optionValue === true) {
optionValue = undefined; // use default value
}
if (!optionValue) {
if (optionValue === undefined || optionValue === false) {
return optionValue;
}
// else, empty string (invalid), null (invalid), 0 (invalid)
throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
}
var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
if (typeof optionValue === 'string') {
node = doc.querySelector(optionValue); // resolve to node, or null if fails
if (!node) {
throw new Error("`".concat(optionName, "` as selector refers to no known node"));
}
}
return node;
};
var getInitialFocusNode = function getInitialFocusNode() {
var node = getNodeForOption('initialFocus');
// false explicitly indicates we want no initialFocus at all
if (node === false) {
return false;
}
if (node === undefined || !tabbable.isFocusable(node, config.tabbableOptions)) {
// option not specified nor focusable: use fallback options
if (findContainerIndex(doc.activeElement) >= 0) {
node = doc.activeElement;
} else {
var firstTabbableGroup = state.tabbableGroups[0];
var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
// NOTE: `fallbackFocus` option function cannot return `false` (not supported)
node = firstTabbableNode || getNodeForOption('fallbackFocus');
}
}
if (!node) {
throw new Error('Your focus-trap needs to have at least one focusable element');
}
return node;
};
var updateTabbableNodes = function updateTabbableNodes() {
state.containerGroups = state.containers.map(function (container) {
var tabbableNodes = tabbable.tabbable(container, config.tabbableOptions);
// NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
// are a superset of tabbable nodes since nodes with negative `tabindex` attributes
// are focusable but not tabbable
var focusableNodes = tabbable.focusable(container, config.tabbableOptions);
var firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : undefined;
var lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : undefined;
var firstDomTabbableNode = focusableNodes.find(function (node) {
return tabbable.isTabbable(node);
});
var lastDomTabbableNode = focusableNodes.slice().reverse().find(function (node) {
return tabbable.isTabbable(node);
});
var posTabIndexesFound = !!tabbableNodes.find(function (node) {
return tabbable.getTabIndex(node) > 0;
});
return {
container: container,
tabbableNodes: tabbableNodes,
focusableNodes: focusableNodes,
/** True if at least one node with positive `tabindex` was found in this container. */
posTabIndexesFound: posTabIndexesFound,
/** First tabbable node in container, __tabindex__ order; `undefined` if none. */
firstTabbableNode: firstTabbableNode,
/** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
lastTabbableNode: lastTabbableNode,
// NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
// would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
// because that API doesn't work with Shadow DOM as well as it should (@see
// https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
// to address an edge case related to positive tabindex support, this seems like a much easier,
// "close enough most of the time" alternative for positive tabindexes which should generally
// be avoided anyway...
/** First tabbable node in container, __DOM__ order; `undefined` if none. */
firstDomTabbableNode: firstDomTabbableNode,
/** Last tabbable node in container, __DOM__ order; `undefined` if none. */
lastDomTabbableNode: lastDomTabbableNode,
/**
* Finds the __tabbable__ node that follows the given node in the specified direction,
* in this container, if any.
* @param {HTMLElement} node
* @param {boolean} [forward] True if going in forward tab order; false if going
* in reverse.
* @returns {HTMLElement|undefined} The next tabbable node, if any.
*/
nextTabbableNode: function nextTabbableNode(node) {
var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var nodeIdx = tabbableNodes.indexOf(node);
if (nodeIdx < 0) {
// either not tabbable nor focusable, or was focused but not tabbable (negative tabindex):
// since `node` should at least have been focusable, we assume that's the case and mimic
// what browsers do, which is set focus to the next node in __document position order__,
// regardless of positive tabindexes, if any -- and for reasons explained in the NOTE
// above related to `firstDomTabbable` and `lastDomTabbable` properties, we fall back to
// basic DOM order
if (forward) {
return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find(function (el) {
return tabbable.isTabbable(el);
});
}
return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find(function (el) {
return tabbable.isTabbable(el);
});
}
return tabbableNodes[nodeIdx + (forward ? 1 : -1)];
}
};
});
state.tabbableGroups = state.containerGroups.filter(function (group) {
return group.tabbableNodes.length > 0;
});
// throw if no groups have tabbable nodes and we don't have a fallback focus node either
if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
) {
throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
}
// NOTE: Positive tabindexes are only properly supported in single-container traps because
// doing it across multiple containers where tabindexes could be all over the place
// would require Tabbable to support multiple containers, would require additional
// specialized Shadow DOM support, and would require Tabbable's multi-container support
// to look at those containers in document position order rather than user-provided
// order (as they are treated in Focus-trap, for legacy reasons). See discussion on
// https://github.com/focus-trap/focus-trap/issues/375 for more details.
if (state.containerGroups.find(function (g) {
return g.posTabIndexesFound;
}) && state.containerGroups.length > 1) {
throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
}
};
/**
* Gets the current activeElement. If it's a web-component and has open shadow-root
* it will recursively search inside shadow roots for the "true" activeElement.
*
* @param {Document | ShadowRoot} el
*
* @returns {HTMLElement} The element that currently has the focus
**/
var getActiveElement = function getActiveElement(el) {
var activeElement = el.activeElement;
if (!activeElement) {
return;
}
if (activeElement.shadowRoot && activeElement.shadowRoot.activeElement !== null) {
return getActiveElement(activeElement.shadowRoot);
}
return activeElement;
};
var tryFocus = function tryFocus(node) {
if (node === false) {
return;
}
if (node === getActiveElement(document)) {
return;
}
if (!node || !node.focus) {
tryFocus(getInitialFocusNode());
return;
}
node.focus({
preventScroll: !!config.preventScroll
});
// NOTE: focus() API does not trigger focusIn event so set MRU node manually
state.mostRecentlyFocusedNode = node;
if (isSelectableInput(node)) {
node.select();
}
};
var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
var node = getNodeForOption('setReturnFocus', previousActiveElement);
return node ? node : node === false ? false : previousActiveElement;
};
/**
* Finds the next node (in either direction) where focus should move according to a
* keyboard focus-in event.
* @param {Object} params
* @param {Node} [params.target] Known target __from which__ to navigate, if any.
* @param {KeyboardEvent|FocusEvent} [params.event] Event to use if `target` isn't known (event
* will be used to determine the `target`). Ignored if `target` is specified.
* @param {boolean} [params.isBackward] True if focus should move backward.
* @returns {Node|undefined} The next node, or `undefined` if a next node couldn't be
* determined given the current state of the trap.
*/
var findNextNavNode = function findNextNavNode(_ref2) {
var target = _ref2.target,
event = _ref2.event,
_ref2$isBackward = _ref2.isBackward,
isBackward = _ref2$isBackward === void 0 ? false : _ref2$isBackward;
target = target || getActualTarget(event);
updateTabbableNodes();
var destinationNode = null;
if (state.tabbableGroups.length > 0) {
// make sure the target is actually contained in a group
// NOTE: the target may also be the container itself if it's focusable
// with tabIndex='-1' and was given initial focus
var containerIndex = findContainerIndex(target, event);
var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
if (containerIndex < 0) {
// target not found in any group: quite possible focus has escaped the trap,
// so bring it back into...
if (isBackward) {
// ...the last node in the last group
destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
} else {
// ...the first node in the first group
destinationNode = state.tabbableGroups[0].firstTabbableNode;
}
} else if (isBackward) {
// REVERSE
// is the target the first tabbable node in a group?
var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
var firstTabbableNode = _ref3.firstTabbableNode;
return target === firstTabbableNode;
});
if (startOfGroupIndex < 0 && (containerGroup.container === target || tabbable.isFocusable(target, config.tabbableOptions) && !tabbable.isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
// an exception case where the target is either the container itself, or
// a non-tabbable node that was given focus (i.e. tabindex is negative
// and user clicked on it or node was programmatically given focus)
// and is not followed by any other tabbable node, in which
// case, we should handle shift+tab as if focus were on the container's
// first tabbable node, and go to the last tabbable node of the LAST group
startOfGroupIndex = containerIndex;
}
if (startOfGroupIndex >= 0) {
// YES: then shift+tab should go to the last tabbable node in the
// previous group (and wrap around to the last tabbable node of
// the LAST group if it's the first tabbable node of the FIRST group)
var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
var destinationGroup = state.tabbableGroups[destinationGroupIndex];
destinationNode = tabbable.getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode;
} else if (!isTabEvent(event)) {
// user must have customized the nav keys so we have to move focus manually _within_
// the active group: do this based on the order determined by tabbable()
destinationNode = containerGroup.nextTabbableNode(target, false);
}
} else {
// FORWARD
// is the target the last tabbable node in a group?
var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref4) {
var lastTabbableNode = _ref4.lastTabbableNode;
return target === lastTabbableNode;
});
if (lastOfGroupIndex < 0 && (containerGroup.container === target || tabbable.isFocusable(target, config.tabbableOptions) && !tabbable.isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
// an exception case where the target is the container itself, or
// a non-tabbable node that was given focus (i.e. tabindex is negative
// and user clicked on it or node was programmatically given focus)
// and is not followed by any other tabbable node, in which
// case, we should handle tab as if focus were on the container's
// last tabbable node, and go to the first tabbable node of the FIRST group
lastOfGroupIndex = containerIndex;
}
if (lastOfGroupIndex >= 0) {
// YES: then tab should go to the first tabbable node in the next
// group (and wrap around to the first tabbable node of the FIRST
// group if it's the last tabbable node of the LAST group)
var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
destinationNode = tabbable.getTabIndex(target) >= 0 ? _destinationGroup.firstTabbableNode : _destinationGroup.firstDomTabbableNode;
} else if (!isTabEvent(event)) {
// user must have customized the nav keys so we have to move focus manually _within_
// the active group: do this based on the order determined by tabbable()
destinationNode = containerGroup.nextTabbableNode(target);
}
}
} else {
// no groups available
// NOTE: the fallbackFocus option does not support returning false to opt-out
destinationNode = getNodeForOption('fallbackFocus');
}
return destinationNode;
};
// This needs to be done on mousedown and touchstart instead of click
// so that it precedes the focus event.
var checkPointerDown = function checkPointerDown(e) {
var target = getActualTarget(e);
if (findContainerIndex(target, e) >= 0) {
// allow the click since it ocurred inside the trap
return;
}
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
// immediately deactivate the trap
trap.deactivate({
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
// which will result in the outside click setting focus to the node
// that was clicked (and if not focusable, to "nothing"); by setting
// `returnFocus: true`, we'll attempt to re-focus the node originally-focused
// on activation (or the configured `setReturnFocus` node), whether the
// outside click was on a focusable node or not
returnFocus: config.returnFocusOnDeactivate
});
return;
}
// This is needed for mobile devices.
// (If we'll only let `click` events through,
// then on mobile they will be blocked anyways if `touchstart` is blocked.)
if (valueOrHandler(config.allowOutsideClick, e)) {
// allow the click outside the trap to take place
return;
}
// otherwise, prevent the click
e.preventDefault();
};
// In case focus escapes the trap for some strange reason, pull it back in.
// NOTE: the focusIn event is NOT cancelable, so if focus escapes, it may cause unexpected
// scrolling if the node that got focused was out of view; there's nothing we can do to
// prevent that from happening by the time we discover that focus escaped
var checkFocusIn = function checkFocusIn(event) {
var target = getActualTarget(event);
var targetContained = findContainerIndex(target, event) >= 0;
// In Firefox when you Tab out of an iframe the Document is briefly focused.
if (targetContained || target instanceof Document) {
if (targetContained) {
state.mostRecentlyFocusedNode = target;
}
} else {
// escaped! pull it back in to where it just left
event.stopImmediatePropagation();
// focus will escape if the MRU node had a positive tab index and user tried to nav forward;
// it will also escape if the MRU node had a 0 tab index and user tried to nav backward
// toward a node with a positive tab index
var nextNode; // next node to focus, if we find one
var navAcrossContainers = true;
if (state.mostRecentlyFocusedNode) {
if (tabbable.getTabIndex(state.mostRecentlyFocusedNode) > 0) {
// MRU container index must be >=0 otherwise we wouldn't have it as an MRU node...
var mruContainerIdx = findContainerIndex(state.mostRecentlyFocusedNode);
// there MAY not be any tabbable nodes in the container if there are at least 2 containers
// and the MRU node is focusable but not tabbable (focus-trap requires at least 1 container
// with at least one tabbable node in order to function, so this could be the other container
// with nothing tabbable in it)
var tabbableNodes = state.containerGroups[mruContainerIdx].tabbableNodes;
if (tabbableNodes.length > 0) {
// MRU tab index MAY not be found if the MRU node is focusable but not tabbable
var mruTabIdx = tabbableNodes.findIndex(function (node) {
return node === state.mostRecentlyFocusedNode;
});
if (mruTabIdx >= 0) {
if (config.isKeyForward(state.recentNavEvent)) {
if (mruTabIdx + 1 < tabbableNodes.length) {
nextNode = tabbableNodes[mruTabIdx + 1];
navAcrossContainers = false;
}
// else, don't wrap within the container as focus should move to next/previous
// container
} else {
if (mruTabIdx - 1 >= 0) {
nextNode = tabbableNodes[mruTabIdx - 1];
navAcrossContainers = false;
}
// else, don't wrap within the container as focus should move to next/previous
// container
}
// else, don't find in container order without considering direction too
}
}
// else, no tabbable nodes in that container (which means we must have at least one other
// container with at least one tabbable node in it, otherwise focus-trap would've thrown
// an error the last time updateTabbableNodes() was run): find next node among all known
// containers
} else {
// check to see if there's at least one tabbable node with a positive tab index inside
// the trap because focus seems to escape when navigating backward from a tabbable node
// with tabindex=0 when this is the case (instead of wrapping to the tabbable node with
// the greatest positive tab index like it should)
if (!state.containerGroups.some(function (g) {
return g.tabbableNodes.some(function (n) {
return tabbable.getTabIndex(n) > 0;
});
})) {
// no containers with tabbable nodes with positive tab indexes which means the focus
// escaped for some other reason and we should just execute the fallback to the
// MRU node or initial focus node, if any
navAcrossContainers = false;
}
}
} else {
// no MRU node means we're likely in some initial condition when the trap has just
// been activated and initial focus hasn't been given yet, in which case we should
// fall through to trying to focus the initial focus node, which is what should
// happen below at this point in the logic
navAcrossContainers = false;
}
if (navAcrossContainers) {
nextNode = findNextNavNode({
// move FROM the MRU node, not event-related node (which will be the node that is
// outside the trap causing the focus escape we're trying to fix)
target: state.mostRecentlyFocusedNode,
isBackward: config.isKeyBackward(state.recentNavEvent)
});
}
if (nextNode) {
tryFocus(nextNode);
} else {
tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
}
}
state.recentNavEvent = undefined; // clear
};
// Hijack key nav events on the first and last focusable nodes of the trap,
// in order to prevent focus from escaping. If it escapes for even a
// moment it can end up scrolling the page and causing confusion so we
// kind of need to capture the action at the keydown phase.
var checkKeyNav = function checkKeyNav(event) {
var isBackward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
state.recentNavEvent = event;
var destinationNode = findNextNavNode({
event: event,
isBackward: isBackward
});
if (destinationNode) {
if (isTabEvent(event)) {
// since tab natively moves focus, we wouldn't have a destination node unless we
// were on the edge of a container and had to move to the next/previous edge, in
// which case we want to prevent default to keep the browser from moving focus
// to where it normally would
event.preventDefault();
}
tryFocus(destinationNode);
}
// else, let the browser take care of [shift+]tab and move the focus
};
var checkKey = function checkKey(event) {
if (isEscapeEvent(event) && valueOrHandler(config.escapeDeactivates, event) !== false) {
event.preventDefault();
trap.deactivate();
return;
}
if (config.isKeyForward(event) || config.isKeyBackward(event)) {
checkKeyNav(event, config.isKeyBackward(event));
}
};
var checkClick = function checkClick(e) {
var target = getActualTarget(e);
if (findContainerIndex(target, e) >= 0) {
return;
}
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
return;
}
if (valueOrHandler(config.allowOutsideClick, e)) {
return;
}
e.preventDefault();
e.stopImmediatePropagation();
};
//
// EVENT LISTENERS
//
var addListeners = function addListeners() {
if (!state.active) {
return;
}
// There can be only one listening focus trap at a time
activeFocusTraps.activateTrap(trapStack, trap);
// Delay ensures that the focused element doesn't capture the event
// that caused the focus trap activation.
state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function () {
tryFocus(getInitialFocusNode());
}) : tryFocus(getInitialFocusNode());
doc.addEventListener('focusin', checkFocusIn, true);
doc.addEventListener('mousedown', checkPointerDown, {
capture: true,
passive: false
});
doc.addEventListener('touchstart', checkPointerDown, {
capture: true,
passive: false
});
doc.addEventListener('click', checkClick, {
capture: true,
passive: false
});
doc.addEventListener('keydown', checkKey, {
capture: true,
passive: false
});
return trap;
};
var removeListeners = function removeListeners() {
if (!state.active) {
return;
}
doc.removeEventListener('focusin', checkFocusIn, true);
doc.removeEventListener('mousedown', checkPointerDown, true);
doc.removeEventListener('touchstart', checkPointerDown, true);
doc.removeEventListener('click', checkClick, true);
doc.removeEventListener('keydown', checkKey, true);
return trap;
};
//
// MUTATION OBSERVER
//
var checkDomRemoval = function checkDomRemoval(mutations) {
var isFocusedNodeRemoved = mutations.some(function (mutation) {
var removedNodes = Array.from(mutation.removedNodes);
return removedNodes.some(function (node) {
return node === state.mostRecentlyFocusedNode;
});
});
// If the currently focused is removed then browsers will move focus to the
// <body> element. If this happens, try to move focus back into the trap.
if (isFocusedNodeRemoved) {
tryFocus(getInitialFocusNode());
}
};
// Use MutationObserver - if supported - to detect if focused node is removed
// from the DOM.
var mutationObserver = typeof window !== 'undefined' && 'MutationObserver' in window ? new MutationObserver(checkDomRemoval) : undefined;
var updateObservedNodes = function updateObservedNodes() {
if (!mutationObserver) {
return;
}
mutationObserver.disconnect();
if (state.active && !state.paused) {
state.containers.map(function (container) {
mutationObserver.observe(container, {
subtree: true,
childList: true
});
});
}
};
//
// TRAP DEFINITION
//
trap = {
get active() {
return state.active;
},
get paused() {
return state.paused;
},
activate: function activate(activateOptions) {
if (state.active) {
return this;
}
var onActivate = getOption(activateOptions, 'onActivate');
var onPostActivate = getOption(activateOptions, 'onPostActivate');
var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
if (!checkCanFocusTrap) {
updateTabbableNodes();
}
state.active = true;
state.paused = false;
state.nodeFocusedBeforeActivation = doc.activeElement;
onActivate === null || onActivate === void 0 || onActivate();
var finishActivation = function finishActivation() {
if (checkCanFocusTrap) {
updateTabbableNodes();
}
addListeners();
updateObservedNodes();
onPostActivate === null || onPostActivate === void 0 || onPostActivate();
};
if (checkCanFocusTrap) {
checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
return this;
}
finishActivation();
return this;
},
deactivate: function deactivate(deactivateOptions) {
if (!state.active) {
return this;
}
var options = _objectSpread2({
onDeactivate: config.onDeactivate,
onPostDeactivate: config.onPostDeactivate,
checkCanReturnFocus: config.checkCanReturnFocus
}, deactivateOptions);
clearTimeout(state.delayInitialFocusTimer); // noop if undefined
state.delayInitialFocusTimer = undefined;
removeListeners();
state.active = false;
state.paused = false;
updateObservedNodes();
activeFocusTraps.deactivateTrap(trapStack, trap);
var onDeactivate = getOption(options, 'onDeactivate');
var onPostDeactivate = getOption(options, 'onPostDeactivate');
var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
onDeactivate === null || onDeactivate === void 0 || onDeactivate();
var finishDeactivation = function finishDeactivation() {
delay(function () {
if (returnFocus) {
tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
}
onPostDeactivate === null || onPostDeactivate === void 0 || onPostDeactivate();
});
};
if (returnFocus && checkCanReturnFocus) {
checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
return this;
}
finishDeactivation();
return this;
},
pause: function pause(pauseOptions) {
if (state.paused || !state.active) {
return this;
}
var onPause = getOption(pauseOptions, 'onPause');
var onPostPause = getOption(pauseOptions, 'onPostPause');
state.paused = true;
onPause === null || onPause === void 0 || onPause();
removeListeners();
updateObservedNodes();
onPostPause === null || onPostPause === void 0 || onPostPause();
return this;
},
unpause: function unpause(unpauseOptions) {
if (!state.paused || !state.active) {
return this;
}
var onUnpause = getOption(unpauseOptions, 'onUnpause');
var onPostUnpause = getOption(unpauseOptions, 'onPostUnpause');
state.paused = false;
onUnpause === null || onUnpause === void 0 || onUnpause();
updateTabbableNodes();
addListeners();
updateObservedNodes();
onPostUnpause === null || onPostUnpause === void 0 || onPostUnpause();
return this;
},
updateContainerElements: function updateContainerElements(containerElements) {
var elementsAsArray = [].concat(containerElements).filter(Boolean);
state.containers = elementsAsArray.map(function (element) {
return typeof element === 'string' ? doc.querySelector(element) : element;
});
if (state.active) {
updateTabbableNodes();
}
updateObservedNodes();
return this;
}
};
// initialize container elements
trap.updateContainerElements(elements);
return trap;
};
exports.createFocusTrap = createFocusTrap;
Object.defineProperty(exports, '__esModule', { value: true });
}));
//# sourceMappingURL=focus-trap.umd.js.map

View File

@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { secondsToMilliseconds as fn } from "../secondsToMilliseconds.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const secondsToMilliseconds = convertToFP(fn, 1);
// Fallback for modularized imports:
export default secondsToMilliseconds;

View File

@@ -0,0 +1,39 @@
"use strict";
exports.eachWeekendOfMonth = eachWeekendOfMonth;
var _index = require("./eachWeekendOfInterval.js");
var _index2 = require("./endOfMonth.js");
var _index3 = require("./startOfMonth.js");
/**
* @name eachWeekendOfMonth
* @category Month Helpers
* @summary List all the Saturdays and Sundays in the given month.
*
* @description
* Get all the Saturdays and Sundays in the given month.
*
* @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 given month
*
* @returns An array containing all the Saturdays and Sundays
*
* @example
* // Lists all Saturdays and Sundays in the given month
* const result = eachWeekendOfMonth(new Date(2022, 1, 1))
* //=> [
* // Sat Feb 05 2022 00:00:00,
* // Sun Feb 06 2022 00:00:00,
* // Sat Feb 12 2022 00:00:00,
* // Sun Feb 13 2022 00:00:00,
* // Sat Feb 19 2022 00:00:00,
* // Sun Feb 20 2022 00:00:00,
* // Sat Feb 26 2022 00:00:00,
* // Sun Feb 27 2022 00:00:00
* // ]
*/
function eachWeekendOfMonth(date) {
const start = (0, _index3.startOfMonth)(date);
const end = (0, _index2.endOfMonth)(date);
return (0, _index.eachWeekendOfInterval)({ start, end });
}

View File

@@ -0,0 +1,42 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = offset;
var _contains = _interopRequireDefault(require("./contains"));
var _ownerDocument = _interopRequireDefault(require("./ownerDocument"));
var _scrollLeft = _interopRequireDefault(require("./scrollLeft"));
var _scrollTop = _interopRequireDefault(require("./scrollTop"));
/**
* Returns the offset of a given element, including top and left positions, width and height.
*
* @param node the element
*/
function offset(node) {
var doc = (0, _ownerDocument.default)(node);
var box = {
top: 0,
left: 0,
height: 0,
width: 0
};
var docElem = doc && doc.documentElement; // Make sure it's not a disconnected DOM node
if (!docElem || !(0, _contains.default)(docElem, node)) return box;
if (node.getBoundingClientRect !== undefined) box = node.getBoundingClientRect();
box = {
top: box.top + (0, _scrollTop.default)(docElem) - (docElem.clientTop || 0),
left: box.left + (0, _scrollLeft.default)(docElem) - (docElem.clientLeft || 0),
width: box.width,
height: box.height
};
return box;
}
module.exports = exports["default"];

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/globals/endpoints/restoreVersion.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { restoreVersionOperationGlobal, sanitizePopulateParam } from '../../index.js'\nimport { getRequestGlobal } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { isNumber } from '../../utilities/isNumber.js'\n\nexport const restoreVersionHandler: PayloadHandler = async (req) => {\n const globalConfig = getRequestGlobal(req)\n const { searchParams } = req\n const depth = searchParams.get('depth')\n const draft = searchParams.get('draft')\n\n const doc = await restoreVersionOperationGlobal({\n id: req.routeParams!.id as string,\n depth: isNumber(depth) ? Number(depth) : undefined,\n draft: draft === 'true' ? true : undefined,\n globalConfig,\n populate: sanitizePopulateParam(req.query.populate),\n req,\n })\n\n return Response.json(\n {\n doc,\n message: req.t('version:restoredSuccessfully'),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["status","httpStatus","restoreVersionOperationGlobal","sanitizePopulateParam","getRequestGlobal","headersWithCors","isNumber","restoreVersionHandler","req","globalConfig","searchParams","depth","get","draft","doc","id","routeParams","Number","undefined","populate","query","Response","json","message","t","headers","Headers","OK"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAIlD,SAASC,6BAA6B,EAAEC,qBAAqB,QAAQ,iBAAgB;AACrF,SAASC,gBAAgB,QAAQ,sCAAqC;AACtE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,QAAQ,QAAQ,8BAA6B;AAEtD,OAAO,MAAMC,wBAAwC,OAAOC;IAC1D,MAAMC,eAAeL,iBAAiBI;IACtC,MAAM,EAAEE,YAAY,EAAE,GAAGF;IACzB,MAAMG,QAAQD,aAAaE,GAAG,CAAC;IAC/B,MAAMC,QAAQH,aAAaE,GAAG,CAAC;IAE/B,MAAME,MAAM,MAAMZ,8BAA8B;QAC9Ca,IAAIP,IAAIQ,WAAW,CAAED,EAAE;QACvBJ,OAAOL,SAASK,SAASM,OAAON,SAASO;QACzCL,OAAOA,UAAU,SAAS,OAAOK;QACjCT;QACAU,UAAUhB,sBAAsBK,IAAIY,KAAK,CAACD,QAAQ;QAClDX;IACF;IAEA,OAAOa,SAASC,IAAI,CAClB;QACER;QACAS,SAASf,IAAIgB,CAAC,CAAC;IACjB,GACA;QACEC,SAASpB,gBAAgB;YACvBoB,SAAS,IAAIC;YACblB;QACF;QACAR,QAAQC,WAAW0B,EAAE;IACvB;AAEJ,EAAC"}

View File

@@ -0,0 +1,31 @@
import { getEasingForSegment } from '../../../easing/utils/get-easing-for-segment.mjs';
import { removeItem } from '../../../utils/array.mjs';
import { mixNumber } from '../../../utils/mix/number.mjs';
function eraseKeyframes(sequence, startTime, endTime) {
for (let i = 0; i < sequence.length; i++) {
const keyframe = sequence[i];
if (keyframe.at > startTime && keyframe.at < endTime) {
removeItem(sequence, keyframe);
// If we remove this item we have to push the pointer back one
i--;
}
}
}
function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {
/**
* Erase every existing value between currentTime and targetTime,
* this will essentially splice this timeline into any currently
* defined ones.
*/
eraseKeyframes(sequence, startTime, endTime);
for (let i = 0; i < keyframes.length; i++) {
sequence.push({
value: keyframes[i],
at: mixNumber(startTime, endTime, offset[i]),
easing: getEasingForSegment(easing, i),
});
}
}
export { addKeyframes, eraseKeyframes };

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