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,5 @@
var convert = require('./convert'),
func = convert('stubArray', require('../stubArray'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1,22 @@
import { DirectusNotification } from "../../../schema/notification.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/delete/notifications.d.ts
/**
* Delete multiple existing notifications.
* @param keys
* @returns
* @throws Will throw if keys is empty
*/
declare const deleteNotifications: <Schema>(keys: DirectusNotification<Schema>["id"][]) => RestCommand<void, Schema>;
/**
* Delete an existing notification.
* @param key
* @returns
* @throws Will throw if key is empty
*/
declare const deleteNotification: <Schema>(key: DirectusNotification<Schema>["id"]) => RestCommand<void, Schema>;
//#endregion
export { deleteNotification, deleteNotifications };
//# sourceMappingURL=notifications.d.ts.map

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 PanelLeftOpen = createLucideIcon("PanelLeftOpen", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M9 3v18", key: "fh3hqa" }],
["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
]);
export { PanelLeftOpen as default };
//# sourceMappingURL=panel-left-open.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"heart-pulse.js","sources":["../../../src/icons/heart-pulse.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name HeartPulse\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTkgMTRjMS40OS0xLjQ2IDMtMy4yMSAzLTUuNUE1LjUgNS41IDAgMCAwIDE2LjUgM2MtMS43NiAwLTMgLjUtNC41IDItMS41LTEuNS0yLjc0LTItNC41LTJBNS41IDUuNSAwIDAgMCAyIDguNWMwIDIuMyAxLjUgNC4wNSAzIDUuNWw3IDdaIiAvPgogIDxwYXRoIGQ9Ik0zLjIyIDEySDkuNWwuNS0xIDIgNC41IDItNyAxLjUgMy41aDUuMjciIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/heart-pulse\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 HeartPulse = createLucideIcon('HeartPulse', [\n [\n 'path',\n {\n d: 'M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z',\n key: 'c3ymky',\n },\n ],\n ['path', { d: 'M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27', key: '1uw2ng' }],\n]);\n\nexport default HeartPulse;\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,CAChD,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;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,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC3E,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,116 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "حرف", verb: "أن يحوي" },
file: { unit: "بايت", verb: "أن يحوي" },
array: { unit: "عنصر", verb: "أن يحوي" },
set: { unit: "عنصر", verb: "أن يحوي" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "number";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "مدخل",
email: "بريد إلكتروني",
url: "رابط",
emoji: "إيموجي",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "تاريخ ووقت بمعيار ISO",
date: "تاريخ بمعيار ISO",
time: "وقت بمعيار ISO",
duration: "مدة بمعيار ISO",
ipv4: "عنوان IPv4",
ipv6: "عنوان IPv6",
cidrv4: "مدى عناوين بصيغة IPv4",
cidrv6: "مدى عناوين بصيغة IPv6",
base64: "نَص بترميز base64-encoded",
base64url: "نَص بترميز base64url-encoded",
json_string: "نَص على هيئة JSON",
e164: "رقم هاتف بمعيار E.164",
jwt: "JWT",
template_literal: "مدخل",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `مدخلات غير مقبولة: يفترض إدخال ${issue.expected}، ولكن تم إدخال ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `مدخلات غير مقبولة: يفترض إدخال ${util.stringifyPrimitive(issue.values[0])}`;
return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return ` أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "عنصر"}`;
return `أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${adj} ${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
}
return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `نَص غير مقبول: يجب أن يبدأ بـ "${issue.prefix}"`;
if (_issue.format === "ends_with")
return `نَص غير مقبول: يجب أن ينتهي بـ "${_issue.suffix}"`;
if (_issue.format === "includes")
return `نَص غير مقبول: يجب أن يتضمَّن "${_issue.includes}"`;
if (_issue.format === "regex")
return `نَص غير مقبول: يجب أن يطابق النمط ${_issue.pattern}`;
return `${Nouns[_issue.format] ?? issue.format} غير مقبول`;
}
case "not_multiple_of":
return `رقم غير مقبول: يجب أن يكون من مضاعفات ${issue.divisor}`;
case "unrecognized_keys":
return `معرف${issue.keys.length > 1 ? "ات" : ""} غريب${issue.keys.length > 1 ? "ة" : ""}: ${util.joinValues(issue.keys, "، ")}`;
case "invalid_key":
return `معرف غير مقبول في ${issue.origin}`;
case "invalid_union":
return "مدخل غير مقبول";
case "invalid_element":
return `مدخل غير مقبول في ${issue.origin}`;
default:
return "مدخل غير مقبول";
}
};
};
export default function () {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/node-postgres/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport type { NodePgDatabase } from './driver.ts';\n\nexport async function migrate<TSchema extends Record<string, unknown>>(\n\tdb: NodePgDatabase<TSchema>,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tawait db.dialect.migrate(migrations, db.session, config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAmC;AAGnC,eAAsB,QACrB,IACA,QACC;AACD,QAAM,iBAAa,oCAAmB,MAAM;AAC5C,QAAM,GAAG,QAAQ,QAAQ,YAAY,GAAG,SAAS,MAAM;AACxD;","names":[]}

View File

@@ -0,0 +1,182 @@
@import '../../scss/styles.scss';
@layer payload-default {
.pill {
--pill-padding-block-start: 0px;
--pill-padding-inline-start: 0px;
--pill-padding-block-end: 0px;
--pill-padding-inline-end: 0px;
font-size: 1rem;
line-height: calc(var(--base) * 1.2);
display: inline-flex;
background: var(--theme-elevation-150);
color: var(--theme-elevation-800);
border-radius: $style-radius-s;
cursor: inherit;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border: 0;
align-items: center;
flex-shrink: 0;
gap: base(0.2);
padding: var(--pill-padding-block-start) var(--pill-padding-inline-end)
var(--pill-padding-block-end) var(--pill-padding-inline-start);
--pill-icon-size: calc(var(--base) * 1.2);
&--rounded {
border-radius: var(--style-radius-l);
font-size: 12px;
}
&:active,
&:focus:not(:focus-visible) {
outline: none;
}
&:focus-visible {
outline: var(--accessibility-outline);
outline-offset: var(--accessibility-outline-offset);
}
&__icon .icon {
flex-shrink: 0;
width: var(--pill-icon-size);
height: var(--pill-icon-size);
}
&__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&--has-action {
cursor: pointer;
text-decoration: none;
}
&--is-dragging {
cursor: grabbing;
}
&--has-icon {
gap: 0;
--pill-padding-inline-start: base(0.4);
--pill-padding-inline-end: base(0.1);
svg {
display: block;
}
}
&--align-icon-left {
flex-direction: row-reverse;
padding-inline-start: base(0.1);
padding-inline-end: base(0.4);
}
&--style-white {
background: var(--theme-elevation-0);
&.pill--has-action {
&:hover,
&:active {
background: var(--theme-elevation-100);
}
}
}
&--style-always-white {
background: var(--theme-elevation-850);
color: var(--theme-elevation-0);
&.pill--has-action {
&:hover,
&:active {
background: var(--theme-elevation-750);
}
}
}
&--style-light {
&.pill--has-action {
&:hover,
&:active {
background: var(--theme-elevation-100);
}
}
}
&--style-light-gray {
background: var(--theme-elevation-100);
color: var(--theme-elevation-800);
}
&--style-warning {
background: var(--theme-warning-150);
color: var(--theme-warning-800);
}
&--style-success {
background: var(--theme-success-150);
color: var(--theme-success-800);
}
&--style-error {
background: var(--theme-error-150);
color: var(--theme-error-800);
}
&--style-dark {
background: var(--theme-elevation-800);
color: var(--theme-elevation-0);
svg {
@include color-svg(var(--theme-elevation-0));
}
&.pill--has-action {
&:hover {
background: var(--theme-elevation-750);
}
&:active {
background: var(--theme-elevation-700);
}
}
}
&--size-medium {
--pill-padding-block-start: calc(var(--base) * 0.2);
--pill-padding-inline-end: calc(var(--base) * 0.6);
--pill-padding-block-end: calc(var(--base) * 0.2);
--pill-padding-inline-start: calc(var(--base) * 0.6);
}
&--size-small {
--pill-icon-size: calc(var(--base) * 0.9);
--pill-padding-block-start: 0;
--pill-padding-inline-end: calc(var(--base) * 0.4);
--pill-padding-inline-start: calc(var(--base) * 0.4);
--pill-padding-block-end: 0;
}
}
html[data-theme='light'] {
.pill {
&--style-always-white {
background: var(--theme-elevation-0);
color: var(--theme-elevation-800);
border: 1px solid var(--theme-elevation-100);
&.pill--has-action {
&:hover,
&:active {
background: var(--theme-elevation-100);
}
}
}
}
}
}

View File

@@ -0,0 +1,76 @@
import { BrowserClientProfilingOptions, BrowserClientReplayOptions, ClientOptions, Event, EventHint, Options as CoreOptions, ParameterizedString, Scope, SeverityLevel } from '@sentry/core';
import { Client } from '@sentry/core';
import { BrowserTransportOptions } from './transports/types';
type BrowserSpecificOptions = BrowserClientReplayOptions & BrowserClientProfilingOptions & {
/** If configured, this URL will be used as base URL for lazy loading integration. */
cdnBaseUrl?: string;
/**
* Important: Only set this option if you know what you are doing!
*
* By default, the SDK will check if `Sentry.init` is called in a browser extension.
* In case it is, it will stop initialization and log a warning
* because browser extensions require a different Sentry initialization process:
* https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/
*
* Setting up the SDK in a browser extension with global error monitoring is not recommended
* and will likely flood you with errors from other web sites or extensions. This can heavily
* impact your quota and cause interference with your and other Sentry SDKs in shared environments.
*
* If this check wrongfully flags your setup as a browser extension, you can set this
* option to `true` to skip the check.
*
* @default false
*/
skipBrowserExtensionCheck?: boolean;
/**
* If you use Spotlight by Sentry during development, use
* this option to forward captured Sentry events to Spotlight.
*
* Either set it to true, or provide a specific Spotlight Sidecar URL.
*
* More details: https://spotlightjs.com/
*
* IMPORTANT: Only set this option to `true` while developing, not in production!
*/
spotlight?: boolean | string;
};
/**
* Configuration options for the Sentry Browser SDK.
* @see @sentry/core Options for more information.
*/
export type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;
/**
* Configuration options for the Sentry Browser SDK Client class
* @see BrowserClient for more information.
*/
export type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;
/**
* The Sentry Browser SDK Client.
*
* @see BrowserOptions for documentation on configuration options.
* @see SentryClient for usage documentation.
*/
export declare class BrowserClient extends Client<BrowserClientOptions> {
/**
* Creates a new Browser SDK instance.
*
* @param options Configuration options for this SDK.
*/
constructor(options: BrowserClientOptions);
/**
* @inheritDoc
*/
eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event>;
/**
* @inheritDoc
*/
eventFromMessage(message: ParameterizedString, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event>;
/**
* @inheritDoc
*/
protected _prepareEvent(event: Event, hint: EventHint, currentScope: Scope, isolationScope: Scope): PromiseLike<Event | null>;
}
/** Exported only for tests. */
export declare function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T;
export {};
//# sourceMappingURL=client.d.ts.map

View File

@@ -0,0 +1,25 @@
<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 Integration for Feedback
This SDK is **considered experimental and in a beta state**. It may experience breaking changes, and may be discontinued
at any time. Please reach out on [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have
any feedback/concerns.
To view Feedback in Sentry, your
[Sentry organization must be an early adopter](https://docs.sentry.io/product/accounts/early-adopter-features/).
## Installation
Please read the [official integration documentation](https://docs.sentry.io/platforms/javascript/user-feedback/) for
installation instructions.
## Configuration
The Feedback integration is highly customizable, please read the
[official integration documentation](https://docs.sentry.io/platforms/javascript/user-feedback/configuration/) for the
most up-to-date configuration options.

View File

@@ -0,0 +1,30 @@
export const operators = {
comparison: [
'greater_than_equal',
'greater_than',
'less_than_equal',
'less_than'
],
contains: [
'in',
'not_in',
'all'
],
equality: [
'equals',
'not_equals'
],
geo: [
'near'
],
geojson: [
'within',
'intersects'
],
partial: [
'like',
'contains'
]
};
//# sourceMappingURL=operators.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/singlestore-proxy/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport { sql } from '~/sql/sql.ts';\nimport type { SingleStoreRemoteDatabase } from './driver.ts';\n\nexport type ProxyMigrator = (migrationQueries: string[]) => Promise<void>;\n\nexport async function migrate<TSchema extends Record<string, unknown>>(\n\tdb: SingleStoreRemoteDatabase<TSchema>,\n\tcallback: ProxyMigrator,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\n\tconst migrationsTable = config.migrationsTable ?? '__drizzle_migrations';\n\tconst migrationTableCreate = sql`\n\t\tcreate table if not exists ${sql.identifier(migrationsTable)} (\n\t\t\tid serial primary key,\n\t\t\thash text not null,\n\t\t\tcreated_at bigint\n\t\t)\n\t`;\n\tawait db.execute(migrationTableCreate);\n\n\tconst dbMigrations = await db.select({\n\t\tid: sql.raw('id'),\n\t\thash: sql.raw('hash'),\n\t\tcreated_at: sql.raw('created_at'),\n\t}).from(sql.identifier(migrationsTable).getSQL()).orderBy(\n\t\tsql.raw('created_at desc'),\n\t).limit(1);\n\n\tconst lastDbMigration = dbMigrations[0];\n\n\tconst queriesToRun: string[] = [];\n\n\tfor (const migration of migrations) {\n\t\tif (\n\t\t\t!lastDbMigration\n\t\t\t|| Number(lastDbMigration.created_at) < migration.folderMillis\n\t\t) {\n\t\t\tqueriesToRun.push(\n\t\t\t\t...migration.sql,\n\t\t\t\t`insert into ${\n\t\t\t\t\tsql.identifier(migrationsTable).value\n\t\t\t\t} (\\`hash\\`, \\`created_at\\`) values('${migration.hash}', '${migration.folderMillis}')`,\n\t\t\t);\n\t\t}\n\t}\n\n\tawait callback(queriesToRun);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAmC;AACnC,iBAAoB;AAKpB,eAAsB,QACrB,IACA,UACA,QACC;AACD,QAAM,iBAAa,oCAAmB,MAAM;AAE5C,QAAM,kBAAkB,OAAO,mBAAmB;AAClD,QAAM,uBAAuB;AAAA,+BACC,eAAI,WAAW,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAM7D,QAAM,GAAG,QAAQ,oBAAoB;AAErC,QAAM,eAAe,MAAM,GAAG,OAAO;AAAA,IACpC,IAAI,eAAI,IAAI,IAAI;AAAA,IAChB,MAAM,eAAI,IAAI,MAAM;AAAA,IACpB,YAAY,eAAI,IAAI,YAAY;AAAA,EACjC,CAAC,EAAE,KAAK,eAAI,WAAW,eAAe,EAAE,OAAO,CAAC,EAAE;AAAA,IACjD,eAAI,IAAI,iBAAiB;AAAA,EAC1B,EAAE,MAAM,CAAC;AAET,QAAM,kBAAkB,aAAa,CAAC;AAEtC,QAAM,eAAyB,CAAC;AAEhC,aAAW,aAAa,YAAY;AACnC,QACC,CAAC,mBACE,OAAO,gBAAgB,UAAU,IAAI,UAAU,cACjD;AACD,mBAAa;AAAA,QACZ,GAAG,UAAU;AAAA,QACb,eACC,eAAI,WAAW,eAAe,EAAE,KACjC,uCAAuC,UAAU,IAAI,OAAO,UAAU,YAAY;AAAA,MACnF;AAAA,IACD;AAAA,EACD;AAEA,QAAM,SAAS,YAAY;AAC5B;","names":[]}

View File

@@ -0,0 +1,41 @@
import type { RedisResponseCustomAttributeFunction } from '@opentelemetry/instrumentation-ioredis';
interface RedisOptions {
/**
* Define cache prefixes for cache keys that should be captured as a cache span.
*
* Setting this to, for example, `['user:']` will capture cache keys that start with `user:`.
*/
cachePrefixes?: string[];
/**
* Maximum length of the cache key added to the span description. If the key exceeds this length, it will be truncated.
*
* Passing `0` will use the full cache key without truncation.
*
* By default, the full cache key is used.
*/
maxCacheKeyLength?: number;
}
export declare let _redisOptions: RedisOptions;
export declare const cacheResponseHook: RedisResponseCustomAttributeFunction;
/** To be able to preload all Redis OTel instrumentations with just one ID ("Redis"), all the instrumentations are generated in this one function */
export declare const instrumentRedis: (() => void) & {
id: string;
};
/**
* Adds Sentry tracing instrumentation for the [redis](https://www.npmjs.com/package/redis) and
* [ioredis](https://www.npmjs.com/package/ioredis) libraries.
*
* For more information, see the [`redisIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/redis/).
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
*
* Sentry.init({
* integrations: [Sentry.redisIntegration()],
* });
* ```
*/
export declare const redisIntegration: (options?: RedisOptions | undefined) => import("@sentry/core").Integration;
export {};
//# sourceMappingURL=redis.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"box.js","sources":["../../../src/icons/box.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Box\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgOGEyIDIgMCAwIDAtMS0xLjczbC03LTRhMiAyIDAgMCAwLTIgMGwtNyA0QTIgMiAwIDAgMCAzIDh2OGEyIDIgMCAwIDAgMSAxLjczbDcgNGEyIDIgMCAwIDAgMiAwbDctNEEyIDIgMCAwIDAgMjEgMTZaIiAvPgogIDxwYXRoIGQ9Im0zLjMgNyA4LjcgNSA4LjctNSIgLz4KICA8cGF0aCBkPSJNMTIgMjJWMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/box\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 Box = createLucideIcon('Box', [\n [\n 'path',\n {\n d: 'M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z',\n key: 'hh9hay',\n },\n ],\n ['path', { d: 'm3.3 7 8.7 5 8.7-5', key: 'g66t2b' }],\n ['path', { d: 'M12 22V12', key: 'd0xqtd' }],\n]);\n\nexport default Box;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAiB,KAAO,CAAA,CAAA,CAAA;AAAA,CAClC,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;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,CAAsB,CAAA,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,CACnD,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;AAC5C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,28 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
class DateObjectSerializer {
/**
* @param {Date} obj date
* @param {ObjectSerializerContext} context context
*/
serialize(obj, context) {
context.write(obj.getTime());
}
/**
* @param {ObjectDeserializerContext} context context
* @returns {Date} date
*/
deserialize(context) {
return new Date(context.read());
}
}
module.exports = DateObjectSerializer;

View File

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

View File

@@ -0,0 +1,499 @@
import { o as YAMLReferenceError, T as Type, g as YAMLSemanticError, _ as _createForOfIteratorHelper, e as _defineProperty, j as _inherits, k as _createSuper, c as _classCallCheck, p as _assertThisInitialized, b as _createClass, a as _typeof, l as _get, m as _getPrototypeOf } from './PlainValue-b8036b75.js';
import { j as resolveString, b as binaryOptions, c as stringifyString, h as resolveSeq, P as Pair, d as YAMLMap, Y as YAMLSeq, t as toJSON, S as Scalar, l as findPair, g as resolveMap, k as stringifyNumber } from './resolveSeq-492ab440.js';
/* global atob, btoa, Buffer */
var binary = {
identify: function identify(value) {
return value instanceof Uint8Array;
},
// Buffer inherits from Uint8Array
default: false,
tag: 'tag:yaml.org,2002:binary',
/**
* Returns a Buffer in node and an Uint8Array in browsers
*
* To use the resulting buffer as an image, you'll want to do something like:
*
* const blob = new Blob([buffer], { type: 'image/jpeg' })
* document.querySelector('#photo').src = URL.createObjectURL(blob)
*/
resolve: function resolve(doc, node) {
var src = resolveString(doc, node);
if (typeof Buffer === 'function') {
return Buffer.from(src, 'base64');
} else if (typeof atob === 'function') {
// On IE 11, atob() can't handle newlines
var str = atob(src.replace(/[\n\r]/g, ''));
var buffer = new Uint8Array(str.length);
for (var i = 0; i < str.length; ++i) {
buffer[i] = str.charCodeAt(i);
}
return buffer;
} else {
var msg = 'This environment does not support reading binary tags; either Buffer or atob is required';
doc.errors.push(new YAMLReferenceError(node, msg));
return null;
}
},
options: binaryOptions,
stringify: function stringify(_ref, ctx, onComment, onChompKeep) {
var comment = _ref.comment,
type = _ref.type,
value = _ref.value;
var src;
if (typeof Buffer === 'function') {
src = value instanceof Buffer ? value.toString('base64') : Buffer.from(value.buffer).toString('base64');
} else if (typeof btoa === 'function') {
var s = '';
for (var i = 0; i < value.length; ++i) {
s += String.fromCharCode(value[i]);
}
src = btoa(s);
} else {
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
}
if (!type) type = binaryOptions.defaultType;
if (type === Type.QUOTE_DOUBLE) {
value = src;
} else {
var lineWidth = binaryOptions.lineWidth;
var n = Math.ceil(src.length / lineWidth);
var lines = new Array(n);
for (var _i = 0, o = 0; _i < n; ++_i, o += lineWidth) {
lines[_i] = src.substr(o, lineWidth);
}
value = lines.join(type === Type.BLOCK_LITERAL ? '\n' : ' ');
}
return stringifyString({
comment: comment,
type: type,
value: value
}, ctx, onComment, onChompKeep);
}
};
function parsePairs(doc, cst) {
var seq = resolveSeq(doc, cst);
for (var i = 0; i < seq.items.length; ++i) {
var item = seq.items[i];
if (item instanceof Pair) continue;else if (item instanceof YAMLMap) {
if (item.items.length > 1) {
var msg = 'Each pair must have its own sequence indicator';
throw new YAMLSemanticError(cst, msg);
}
var pair = item.items[0] || new Pair();
if (item.commentBefore) pair.commentBefore = pair.commentBefore ? "".concat(item.commentBefore, "\n").concat(pair.commentBefore) : item.commentBefore;
if (item.comment) pair.comment = pair.comment ? "".concat(item.comment, "\n").concat(pair.comment) : item.comment;
item = pair;
}
seq.items[i] = item instanceof Pair ? item : new Pair(item);
}
return seq;
}
function createPairs(schema, iterable, ctx) {
var pairs = new YAMLSeq(schema);
pairs.tag = 'tag:yaml.org,2002:pairs';
var _iterator = _createForOfIteratorHelper(iterable),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var it = _step.value;
var key = void 0,
value = void 0;
if (Array.isArray(it)) {
if (it.length === 2) {
key = it[0];
value = it[1];
} else throw new TypeError("Expected [key, value] tuple: ".concat(it));
} else if (it && it instanceof Object) {
var keys = Object.keys(it);
if (keys.length === 1) {
key = keys[0];
value = it[key];
} else throw new TypeError("Expected { key: value } tuple: ".concat(it));
} else {
key = it;
}
var pair = schema.createPair(key, value, ctx);
pairs.items.push(pair);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return pairs;
}
var pairs = {
default: false,
tag: 'tag:yaml.org,2002:pairs',
resolve: parsePairs,
createNode: createPairs
};
var YAMLOMap = /*#__PURE__*/function (_YAMLSeq) {
_inherits(YAMLOMap, _YAMLSeq);
var _super = _createSuper(YAMLOMap);
function YAMLOMap() {
var _this;
_classCallCheck(this, YAMLOMap);
_this = _super.call(this);
_defineProperty(_assertThisInitialized(_this), "add", YAMLMap.prototype.add.bind(_assertThisInitialized(_this)));
_defineProperty(_assertThisInitialized(_this), "delete", YAMLMap.prototype.delete.bind(_assertThisInitialized(_this)));
_defineProperty(_assertThisInitialized(_this), "get", YAMLMap.prototype.get.bind(_assertThisInitialized(_this)));
_defineProperty(_assertThisInitialized(_this), "has", YAMLMap.prototype.has.bind(_assertThisInitialized(_this)));
_defineProperty(_assertThisInitialized(_this), "set", YAMLMap.prototype.set.bind(_assertThisInitialized(_this)));
_this.tag = YAMLOMap.tag;
return _this;
}
_createClass(YAMLOMap, [{
key: "toJSON",
value: function toJSON$1(_, ctx) {
var map = new Map();
if (ctx && ctx.onCreate) ctx.onCreate(map);
var _iterator = _createForOfIteratorHelper(this.items),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var pair = _step.value;
var key = void 0,
value = void 0;
if (pair instanceof Pair) {
key = toJSON(pair.key, '', ctx);
value = toJSON(pair.value, key, ctx);
} else {
key = toJSON(pair, '', ctx);
}
if (map.has(key)) throw new Error('Ordered maps must not include duplicate keys');
map.set(key, value);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return map;
}
}]);
return YAMLOMap;
}(YAMLSeq);
_defineProperty(YAMLOMap, "tag", 'tag:yaml.org,2002:omap');
function parseOMap(doc, cst) {
var pairs = parsePairs(doc, cst);
var seenKeys = [];
var _iterator2 = _createForOfIteratorHelper(pairs.items),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var key = _step2.value.key;
if (key instanceof Scalar) {
if (seenKeys.includes(key.value)) {
var msg = 'Ordered maps must not include duplicate keys';
throw new YAMLSemanticError(cst, msg);
} else {
seenKeys.push(key.value);
}
}
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
return Object.assign(new YAMLOMap(), pairs);
}
function createOMap(schema, iterable, ctx) {
var pairs = createPairs(schema, iterable, ctx);
var omap = new YAMLOMap();
omap.items = pairs.items;
return omap;
}
var omap = {
identify: function identify(value) {
return value instanceof Map;
},
nodeClass: YAMLOMap,
default: false,
tag: 'tag:yaml.org,2002:omap',
resolve: parseOMap,
createNode: createOMap
};
var YAMLSet = /*#__PURE__*/function (_YAMLMap) {
_inherits(YAMLSet, _YAMLMap);
var _super = _createSuper(YAMLSet);
function YAMLSet() {
var _this;
_classCallCheck(this, YAMLSet);
_this = _super.call(this);
_this.tag = YAMLSet.tag;
return _this;
}
_createClass(YAMLSet, [{
key: "add",
value: function add(key) {
var pair = key instanceof Pair ? key : new Pair(key);
var prev = findPair(this.items, pair.key);
if (!prev) this.items.push(pair);
}
}, {
key: "get",
value: function get(key, keepPair) {
var pair = findPair(this.items, key);
return !keepPair && pair instanceof Pair ? pair.key instanceof Scalar ? pair.key.value : pair.key : pair;
}
}, {
key: "set",
value: function set(key, value) {
if (typeof value !== 'boolean') throw new Error("Expected boolean value for set(key, value) in a YAML set, not ".concat(_typeof(value)));
var prev = findPair(this.items, key);
if (prev && !value) {
this.items.splice(this.items.indexOf(prev), 1);
} else if (!prev && value) {
this.items.push(new Pair(key));
}
}
}, {
key: "toJSON",
value: function toJSON(_, ctx) {
return _get(_getPrototypeOf(YAMLSet.prototype), "toJSON", this).call(this, _, ctx, Set);
}
}, {
key: "toString",
value: function toString(ctx, onComment, onChompKeep) {
if (!ctx) return JSON.stringify(this);
if (this.hasAllNullValues()) return _get(_getPrototypeOf(YAMLSet.prototype), "toString", this).call(this, ctx, onComment, onChompKeep);else throw new Error('Set items must all have null values');
}
}]);
return YAMLSet;
}(YAMLMap);
_defineProperty(YAMLSet, "tag", 'tag:yaml.org,2002:set');
function parseSet(doc, cst) {
var map = resolveMap(doc, cst);
if (!map.hasAllNullValues()) throw new YAMLSemanticError(cst, 'Set items must all have null values');
return Object.assign(new YAMLSet(), map);
}
function createSet(schema, iterable, ctx) {
var set = new YAMLSet();
var _iterator = _createForOfIteratorHelper(iterable),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var value = _step.value;
set.items.push(schema.createPair(value, null, ctx));
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return set;
}
var set = {
identify: function identify(value) {
return value instanceof Set;
},
nodeClass: YAMLSet,
default: false,
tag: 'tag:yaml.org,2002:set',
resolve: parseSet,
createNode: createSet
};
var parseSexagesimal = function parseSexagesimal(sign, parts) {
var n = parts.split(':').reduce(function (n, p) {
return n * 60 + Number(p);
}, 0);
return sign === '-' ? -n : n;
}; // hhhh:mm:ss.sss
var stringifySexagesimal = function stringifySexagesimal(_ref) {
var value = _ref.value;
if (isNaN(value) || !isFinite(value)) return stringifyNumber(value);
var sign = '';
if (value < 0) {
sign = '-';
value = Math.abs(value);
}
var parts = [value % 60]; // seconds, including ms
if (value < 60) {
parts.unshift(0); // at least one : is required
} else {
value = Math.round((value - parts[0]) / 60);
parts.unshift(value % 60); // minutes
if (value >= 60) {
value = Math.round((value - parts[0]) / 60);
parts.unshift(value); // hours
}
}
return sign + parts.map(function (n) {
return n < 10 ? '0' + String(n) : String(n);
}).join(':').replace(/000000\d*$/, '') // % 60 may introduce error
;
};
var intTime = {
identify: function identify(value) {
return typeof value === 'number';
},
default: true,
tag: 'tag:yaml.org,2002:int',
format: 'TIME',
test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,
resolve: function resolve(str, sign, parts) {
return parseSexagesimal(sign, parts.replace(/_/g, ''));
},
stringify: stringifySexagesimal
};
var floatTime = {
identify: function identify(value) {
return typeof value === 'number';
},
default: true,
tag: 'tag:yaml.org,2002:float',
format: 'TIME',
test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,
resolve: function resolve(str, sign, parts) {
return parseSexagesimal(sign, parts.replace(/_/g, ''));
},
stringify: stringifySexagesimal
};
var timestamp = {
identify: function identify(value) {
return value instanceof Date;
},
default: true,
tag: 'tag:yaml.org,2002:timestamp',
// If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
// may be omitted altogether, resulting in a date format. In such a case, the time part is
// assumed to be 00:00:00Z (start of day, UTC).
test: RegExp('^(?:' + '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd
'(?:(?:t|T|[ \\t]+)' + // t | T | whitespace
'([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?
'(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30
')?' + ')$'),
resolve: function resolve(str, year, month, day, hour, minute, second, millisec, tz) {
if (millisec) millisec = (millisec + '00').substr(1, 3);
var date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec || 0);
if (tz && tz !== 'Z') {
var d = parseSexagesimal(tz[0], tz.slice(1));
if (Math.abs(d) < 30) d *= 60;
date -= 60000 * d;
}
return new Date(date);
},
stringify: function stringify(_ref2) {
var value = _ref2.value;
return value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '');
}
};
/* global console, process, YAML_SILENCE_DEPRECATION_WARNINGS, YAML_SILENCE_WARNINGS */
function shouldWarn(deprecation) {
var env = typeof process !== 'undefined' && process.env || {};
if (deprecation) {
if (typeof YAML_SILENCE_DEPRECATION_WARNINGS !== 'undefined') return !YAML_SILENCE_DEPRECATION_WARNINGS;
return !env.YAML_SILENCE_DEPRECATION_WARNINGS;
}
if (typeof YAML_SILENCE_WARNINGS !== 'undefined') return !YAML_SILENCE_WARNINGS;
return !env.YAML_SILENCE_WARNINGS;
}
function warn(warning, type) {
if (shouldWarn(false)) {
var emit = typeof process !== 'undefined' && process.emitWarning; // This will throw in Jest if `warning` is an Error instance due to
// https://github.com/facebook/jest/issues/2549
if (emit) emit(warning, type);else {
// eslint-disable-next-line no-console
console.warn(type ? "".concat(type, ": ").concat(warning) : warning);
}
}
}
function warnFileDeprecation(filename) {
if (shouldWarn(true)) {
var path = filename.replace(/.*yaml[/\\]/i, '').replace(/\.js$/, '').replace(/\\/g, '/');
warn("The endpoint 'yaml/".concat(path, "' will be removed in a future release."), 'DeprecationWarning');
}
}
var warned = {};
function warnOptionDeprecation(name, alternative) {
if (!warned[name] && shouldWarn(true)) {
warned[name] = true;
var msg = "The option '".concat(name, "' will be removed in a future release");
msg += alternative ? ", use '".concat(alternative, "' instead.") : '.';
warn(msg, 'DeprecationWarning');
}
}
export { warnOptionDeprecation as a, binary as b, warnFileDeprecation as c, floatTime as f, intTime as i, omap as o, pairs as p, set as s, timestamp as t, warn as w };

View File

@@ -0,0 +1,45 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { Point } from './point';
type ContainsPointReturn = {
result: boolean;
reason: {
isOnTopSide: boolean;
isOnBottomSide: boolean;
isOnLeftSide: boolean;
isOnRightSide: boolean;
};
};
export declare class Rectangle {
private readonly _left;
private readonly _top;
private readonly _right;
private readonly _bottom;
constructor(left: number, top: number, right: number, bottom: number);
get top(): number;
get right(): number;
get bottom(): number;
get left(): number;
get width(): number;
get height(): number;
equals({ top, left, bottom, right }: Rectangle): boolean;
contains({ x, y }: Point): ContainsPointReturn;
contains({ top, left, bottom, right }: Rectangle): boolean;
intersectsWith(rect: Rectangle): boolean;
generateNewRect({ left, top, right, bottom, }: {
left?: number | undefined;
top?: number | undefined;
right?: number | undefined;
bottom?: number | undefined;
}): Rectangle;
static fromLTRB(left: number, top: number, right: number, bottom: number): Rectangle;
static fromLWTH(left: number, width: number, top: number, height: number): Rectangle;
static fromPoints(startPoint: Point, endPoint: Point): Rectangle;
static fromDOM(dom: HTMLElement): Rectangle;
}
export {};

View File

@@ -0,0 +1,20 @@
export * from '@react-email/body';
export * from '@react-email/button';
export * from '@react-email/code-block';
export * from '@react-email/code-inline';
export * from '@react-email/column';
export * from '@react-email/container';
export * from '@react-email/font';
export * from '@react-email/head';
export * from '@react-email/heading';
export * from '@react-email/hr';
export * from '@react-email/html';
export * from '@react-email/img';
export * from '@react-email/link';
export * from '@react-email/markdown';
export * from '@react-email/preview';
export * from '@react-email/render';
export * from '@react-email/row';
export * from '@react-email/section';
export * from '@react-email/tailwind';
export * from '@react-email/text';

View File

@@ -0,0 +1 @@
{"version":3,"file":"square-library.js","sources":["../../../src/icons/square-library.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareLibrary\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik03IDd2MTAiIC8+CiAgPHBhdGggZD0iTTExIDd2MTAiIC8+CiAgPHBhdGggZD0ibTE1IDcgMiAxMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/square-library\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 SquareLibrary = createLucideIcon('SquareLibrary', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M7 7v10', key: 'd5nglc' }],\n ['path', { d: 'M11 7v10', key: 'pptsnr' }],\n ['path', { d: 'm15 7 2 10', key: '1m7qm5' }],\n]);\n\nexport default SquareLibrary;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,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,39 @@
import { Parser } from "../Parser.js";
export class EraParser extends Parser {
priority = 140;
parse(dateString, token, match) {
switch (token) {
// AD, BC
case "G":
case "GG":
case "GGG":
return (
match.era(dateString, { width: "abbreviated" }) ||
match.era(dateString, { width: "narrow" })
);
// A, B
case "GGGGG":
return match.era(dateString, { width: "narrow" });
// Anno Domini, Before Christ
case "GGGG":
default:
return (
match.era(dateString, { width: "wide" }) ||
match.era(dateString, { width: "abbreviated" }) ||
match.era(dateString, { width: "narrow" })
);
}
}
set(date, flags, value) {
flags.era = value;
date.setFullYear(value, 0, 1);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = ["R", "u", "t", "T"];
}

View File

@@ -0,0 +1,11 @@
Copyright (c) Felix Böhm
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,18 @@
import { RestCommand } from "../../types.js";
import { SchemaSnapshotOutput } from "./snapshot.js";
//#region src/rest/commands/schema/diff.d.ts
type SchemaDiffOutput = {
hash: string;
diff: Record<string, any>;
};
/**
* Compare the current instance's schema against the schema snapshot in JSON request body and retrieve the difference. This endpoint is only available to admin users.
* @param snapshot JSON object containing collections, fields, and relations to apply.
* @param force Bypass version and database vendor restrictions.
* @returns Returns the differences between the current instance's schema and the schema passed in the request body.
*/
declare const schemaDiff: <Schema>(snapshot: SchemaSnapshotOutput, force?: boolean) => RestCommand<SchemaDiffOutput, Schema>;
//#endregion
export { SchemaDiffOutput, schemaDiff };
//# sourceMappingURL=diff.d.ts.map

View File

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

View File

@@ -0,0 +1,4 @@
import React from 'react';
import './index.scss';
export declare const PlusIcon: React.FC;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFactoryWithConstraint = void 0;
const createFactoryWithConstraint = () => (value) => value;
exports.createFactoryWithConstraint = createFactoryWithConstraint;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9saWIvZnVuY3Rpb25zL2NyZWF0ZS1mYWN0b3J5LXdpdGgtY29uc3RyYWludC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBTyxNQUFNLDJCQUEyQixHQUN0QyxHQUFlLEVBQUUsQ0FDakIsQ0FBMkIsS0FBWSxFQUFTLEVBQUUsQ0FDaEQsS0FBSyxDQUFDO0FBSEcsUUFBQSwyQkFBMkIsK0JBRzlCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IGNyZWF0ZUZhY3RvcnlXaXRoQ29uc3RyYWludCA9XG4gIDxDb25zdHJhaW50PigpID0+XG4gIDxWYWx1ZSBleHRlbmRzIENvbnN0cmFpbnQ+KHZhbHVlOiBWYWx1ZSk6IFZhbHVlID0+XG4gICAgdmFsdWU7XG4iXX0=

View File

@@ -0,0 +1,29 @@
"use strict";
exports.setHours = setHours;
var _index = require("./toDate.js");
/**
* @name setHours
* @category Hour Helpers
* @summary Set the hours to the given date.
*
* @description
* Set the hours to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param hours - The hours of the new date
*
* @returns The new date with the hours set
*
* @example
* // Set 4 hours to 1 September 2014 11:30:00:
* const result = setHours(new Date(2014, 8, 1, 11, 30), 4)
* //=> Mon Sep 01 2014 04:30:00
*/
function setHours(date, hours) {
const _date = (0, _index.toDate)(date);
_date.setHours(hours);
return _date;
}

View File

@@ -0,0 +1,4 @@
export {
Fragment,
jsxDEV
} from "./emotion-react-jsx-dev-runtime.development.cjs.js";

View File

@@ -0,0 +1,529 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import { formatAdminURL } from 'payload/shared';
import * as qs from 'qs-esm';
import React from 'react';
import { toast } from 'sonner';
import { fieldReducer } from '../../../forms/Form/fieldReducer.js';
import { useEffectEvent } from '../../../hooks/useEffectEvent.js';
import { useConfig } from '../../../providers/Config/index.js';
import { useLocale } from '../../../providers/Locale/index.js';
import { useServerFunctions } from '../../../providers/ServerFunctions/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import { useUploadHandlers } from '../../../providers/UploadHandlers/index.js';
import { hasSavePermission as getHasSavePermission } from '../../../utilities/hasSavePermission.js';
import { LoadingOverlay } from '../../Loading/index.js';
import { useLoadingOverlay } from '../../LoadingOverlay/index.js';
import { useBulkUpload } from '../index.js';
import { createFormData } from './createFormData.js';
import { formsManagementReducer } from './reducer.js';
const Context = /*#__PURE__*/React.createContext({
activeIndex: 0,
addFiles: () => Promise.resolve(),
bulkUpdateForm: () => null,
collectionSlug: '',
docPermissions: undefined,
documentSlots: {},
forms: [],
getFormDataRef: {
current: () => ({})
},
hasPublishPermission: false,
hasSavePermission: false,
hasSubmitted: false,
isInitializing: false,
removeFile: () => {},
saveAllDocs: () => Promise.resolve(),
setActiveIndex: () => 0,
setFormTotalErrorCount: () => {},
totalErrorCount: 0,
updateUploadEdits: () => {}
});
const initialState = {
activeIndex: 0,
forms: [],
totalErrorCount: 0
};
export function FormsManagerProvider({
children
}) {
const {
config
} = useConfig();
const {
routes: {
api
}
} = config;
const {
code
} = useLocale();
const {
i18n,
t
} = useTranslation();
const {
getDocumentSlots,
getFormState
} = useServerFunctions();
const {
getUploadHandler
} = useUploadHandlers();
const [documentSlots, setDocumentSlots] = React.useState({});
const [hasSubmitted, setHasSubmitted] = React.useState(false);
const [docPermissions, setDocPermissions] = React.useState();
const [hasSavePermission, setHasSavePermission] = React.useState(false);
const [hasPublishPermission, setHasPublishPermission] = React.useState(false);
const [hasInitializedState, setHasInitializedState] = React.useState(false);
const [hasInitializedDocPermissions, setHasInitializedDocPermissions] = React.useState(false);
const [isInitializing, setIsInitializing] = React.useState(false);
const [state, dispatch] = React.useReducer(formsManagementReducer, initialState);
const {
activeIndex,
forms,
totalErrorCount
} = state;
const formsRef = React.useRef(forms);
formsRef.current = forms;
const {
toggleLoadingOverlay
} = useLoadingOverlay();
const {
closeModal
} = useModal();
const {
collectionSlug,
drawerSlug,
initialFiles,
initialForms,
onSuccess,
setInitialFiles,
setInitialForms,
setSuccessfullyUploaded
} = useBulkUpload();
const [isUploading, setIsUploading] = React.useState(false);
const [loadingText, setLoadingText] = React.useState('');
const hasInitializedWithFiles = React.useRef(false);
const initialStateRef = React.useRef(null);
const getFormDataRef = React.useRef(() => ({}));
const baseAPIPath = formatAdminURL({
apiRoute: api,
path: ''
});
const actionURL = `${baseAPIPath}/${collectionSlug}`;
const initializeSharedDocPermissions = React.useCallback(async () => {
const params = {
locale: code || undefined
};
const docAccessURL = `/${collectionSlug}/access`;
const res = await fetch(`${baseAPIPath}${docAccessURL}?${qs.stringify(params)}`, {
credentials: 'include',
headers: {
'Accept-Language': i18n.language,
'Content-Type': 'application/json'
},
method: 'post'
});
const json = await res.json();
const publishedAccessJSON = await fetch(`${baseAPIPath}${docAccessURL}?${qs.stringify(params)}`, {
body: JSON.stringify({
_status: 'published'
}),
credentials: 'include',
headers: {
'Accept-Language': i18n.language,
'Content-Type': 'application/json'
},
method: 'POST'
}).then(res_0 => res_0.json());
setDocPermissions(json);
setHasSavePermission(getHasSavePermission({
collectionSlug,
docPermissions: json,
isEditing: false
}));
setHasPublishPermission(publishedAccessJSON?.update);
setHasInitializedDocPermissions(true);
}, [baseAPIPath, code, collectionSlug, i18n.language]);
const initializeSharedFormState = React.useCallback(async abortController => {
if (abortController?.signal) {
abortController.abort('aborting previous fetch for initial form state without files');
}
// FETCH AND SET THE DOCUMENT SLOTS HERE!
const documentSlots_0 = await getDocumentSlots({
collectionSlug
});
setDocumentSlots(documentSlots_0);
try {
const {
state: formStateWithoutFiles
} = await getFormState({
collectionSlug,
docPermissions,
docPreferences: {
fields: {}
},
locale: code,
operation: 'create',
renderAllFields: true,
schemaPath: collectionSlug,
skipValidation: true
});
initialStateRef.current = formStateWithoutFiles;
setHasInitializedState(true);
} catch (_err) {
// swallow error
}
}, [getDocumentSlots, collectionSlug, getFormState, docPermissions, code]);
const setActiveIndex = React.useCallback(index => {
const currentFormsData = getFormDataRef.current();
dispatch({
type: 'REPLACE',
state: {
activeIndex: index,
forms: forms.map((form, i) => {
if (i === activeIndex) {
return {
errorCount: form.errorCount,
formID: form.formID,
formState: currentFormsData,
uploadEdits: form.uploadEdits
};
}
return form;
})
}
});
}, [forms, activeIndex]);
const addFiles = React.useCallback(async files => {
if (forms.length) {
// save the state of the current form before adding new files
dispatch({
type: 'UPDATE_FORM',
errorCount: forms[activeIndex].errorCount,
formState: getFormDataRef.current(),
index: activeIndex
});
}
toggleLoadingOverlay({
isLoading: true,
key: 'addingDocs'
});
if (!hasInitializedState) {
await initializeSharedFormState();
}
dispatch({
type: 'ADD_FORMS',
forms: Array.from(files).map(file => ({
file,
initialState: initialStateRef.current
}))
});
toggleLoadingOverlay({
isLoading: false,
key: 'addingDocs'
});
}, [initializeSharedFormState, hasInitializedState, toggleLoadingOverlay, activeIndex, forms]);
const addFilesEffectEvent = useEffectEvent(addFiles);
const addInitialForms = useEffectEvent(async initialForms_0 => {
toggleLoadingOverlay({
isLoading: true,
key: 'addingDocs'
});
if (!hasInitializedState) {
await initializeSharedFormState();
}
dispatch({
type: 'ADD_FORMS',
forms: initialForms_0.map(form_0 => ({
...form_0,
initialState: form_0?.initialState || initialStateRef.current
}))
});
toggleLoadingOverlay({
isLoading: false,
key: 'addingDocs'
});
});
const removeFile = React.useCallback(index_0 => {
dispatch({
type: 'REMOVE_FORM',
index: index_0
});
}, []);
const setFormTotalErrorCount = React.useCallback(({
errorCount,
index: index_1
}) => {
dispatch({
type: 'UPDATE_ERROR_COUNT',
count: errorCount,
index: index_1
});
}, []);
const saveAllDocs = React.useCallback(async ({
overrides
} = {}) => {
const currentFormsData_0 = getFormDataRef.current();
const currentForms = [...forms];
currentForms[activeIndex] = {
errorCount: currentForms[activeIndex].errorCount,
formID: currentForms[activeIndex].formID,
formState: currentFormsData_0,
uploadEdits: currentForms[activeIndex].uploadEdits
};
const activeFormID = currentForms[activeIndex]?.formID;
const newDocs = [];
setIsUploading(true);
for (let i_0 = 0; i_0 < currentForms.length; i_0++) {
try {
const form_1 = currentForms[i_0];
const fileValue = form_1.formState?.file?.value;
setLoadingText(t('general:uploadingBulk', {
current: i_0 + 1,
total: currentForms.length
}));
const actionURLWithParams = `${actionURL}${qs.stringify({
locale: code,
uploadEdits: form_1?.uploadEdits || undefined
}, {
addQueryPrefix: true
})}`;
const req = await fetch(actionURLWithParams, {
body: await createFormData(form_1.formState, overrides, collectionSlug, getUploadHandler({
collectionSlug
})),
credentials: 'include',
method: 'POST'
});
const json_0 = await req.json();
if (req.status === 201 && json_0?.doc) {
newDocs.push({
collectionSlug,
doc: json_0.doc,
formID: form_1.formID
});
}
// should expose some sort of helper for this
const [fieldErrors, nonFieldErrors] = (json_0?.errors || []).reduce(([fieldErrs, nonFieldErrs], err) => {
const newFieldErrs = [];
const newNonFieldErrs = [];
if (err?.message) {
newNonFieldErrs.push(err);
}
if (Array.isArray(err?.data?.errors)) {
err.data?.errors.forEach(dataError => {
if (dataError?.path) {
newFieldErrs.push(dataError);
} else {
newNonFieldErrs.push(dataError);
}
});
}
return [[...fieldErrs, ...newFieldErrs], [...nonFieldErrs, ...newNonFieldErrs]];
}, [[], []]);
const missingFile = !fileValue && req.status === 400;
const exceedsLimit = fileValue && req.status === 413;
const missingFilename = fileValue && typeof fileValue === 'object' && 'name' in fileValue && (!fileValue.name || fileValue.name === '');
if (missingFile || exceedsLimit || missingFilename) {
currentForms[i_0].formState.file.valid = false;
// neeed to get the field state to extract count since field errors
// are not returned when file is missing or exceeds limit
const {
state: newState
} = await getFormState({
collectionSlug,
docPermissions,
docPreferences: null,
formState: currentForms[i_0].formState,
operation: 'update',
schemaPath: collectionSlug
});
currentForms[i_0] = {
errorCount: Object.values(newState).reduce((acc, value) => value?.valid === false ? acc + 1 : acc, 0),
formID: currentForms[i_0].formID,
formState: newState
};
toast.error(nonFieldErrors[0]?.message);
} else {
currentForms[i_0] = {
errorCount: fieldErrors.length,
formID: currentForms[i_0].formID,
formState: fieldReducer(currentForms[i_0].formState, {
type: 'ADD_SERVER_ERRORS',
errors: fieldErrors
})
};
}
} catch (_) {
// swallow
}
}
setHasSubmitted(true);
setLoadingText('');
setIsUploading(false);
const remainingForms = [];
currentForms.forEach(({
errorCount: errorCount_0
}, i_1) => {
if (errorCount_0) {
remainingForms.push(currentForms[i_1]);
}
});
const successCount = Math.max(0, currentForms.length - remainingForms.length);
const errorCount_1 = currentForms.length - successCount;
if (successCount) {
toast.success(`Successfully saved ${successCount} files`);
setSuccessfullyUploaded(true);
if (typeof onSuccess === 'function') {
onSuccess(newDocs, errorCount_1);
}
}
if (errorCount_1) {
toast.error(`Failed to save ${errorCount_1} files`);
} else {
closeModal(drawerSlug);
}
dispatch({
type: 'REPLACE',
state: {
activeIndex: remainingForms.reduce((acc_0, {
formID
}, i_2) => {
if (formID === activeFormID) {
return i_2;
}
return acc_0;
}, 0),
forms: remainingForms,
totalErrorCount: remainingForms.reduce((acc_1, {
errorCount: errorCount_2
}) => acc_1 + errorCount_2, 0)
}
});
if (remainingForms.length === 0) {
setInitialFiles(undefined);
setInitialForms(undefined);
}
}, [forms, activeIndex, t, actionURL, code, collectionSlug, getUploadHandler, getFormState, docPermissions, setSuccessfullyUploaded, onSuccess, closeModal, drawerSlug, setInitialFiles, setInitialForms]);
const bulkUpdateForm = React.useCallback(async (updatedFields, afterStateUpdate) => {
for (let i_3 = 0; i_3 < forms.length; i_3++) {
Object.entries(updatedFields).forEach(([path, value_0]) => {
if (forms[i_3].formState[path]) {
forms[i_3].formState[path].value = value_0;
dispatch({
type: 'UPDATE_FORM',
errorCount: forms[i_3].errorCount,
formState: forms[i_3].formState,
index: i_3
});
}
});
if (typeof afterStateUpdate === 'function') {
afterStateUpdate();
}
if (hasSubmitted) {
const {
state: state_0
} = await getFormState({
collectionSlug,
docPermissions,
docPreferences: null,
formState: forms[i_3].formState,
operation: 'create',
schemaPath: collectionSlug
});
const newFormErrorCount = Object.values(state_0).reduce((acc_2, value_1) => value_1?.valid === false ? acc_2 + 1 : acc_2, 0);
dispatch({
type: 'UPDATE_FORM',
errorCount: newFormErrorCount,
formState: state_0,
index: i_3
});
}
}
}, [collectionSlug, docPermissions, forms, getFormState, hasSubmitted]);
const updateUploadEdits = React.useCallback(uploadEdits => {
dispatch({
type: 'UPDATE_FORM',
errorCount: forms[activeIndex].errorCount,
formState: forms[activeIndex].formState,
index: activeIndex,
uploadEdits
});
}, [activeIndex, forms]);
const resetUploadEdits = React.useCallback(() => {
dispatch({
type: 'REPLACE',
state: {
forms: forms.map(form_2 => ({
...form_2,
uploadEdits: {}
}))
}
});
}, [forms]);
React.useEffect(() => {
if (!collectionSlug) {
return;
}
if (!hasInitializedState) {
void initializeSharedFormState();
}
if (!hasInitializedDocPermissions) {
void initializeSharedDocPermissions();
}
if (initialFiles || initialForms) {
if (!hasInitializedState || !hasInitializedDocPermissions) {
setIsInitializing(true);
} else {
setIsInitializing(false);
}
}
if (hasInitializedState && (initialForms?.length || initialFiles?.length) && !hasInitializedWithFiles.current) {
if (initialForms?.length) {
void addInitialForms(initialForms);
}
if (initialFiles?.length) {
void addFilesEffectEvent(initialFiles);
}
hasInitializedWithFiles.current = true;
}
return;
}, [initialFiles, initializeSharedFormState, initializeSharedDocPermissions, collectionSlug, hasInitializedState, hasInitializedDocPermissions, initialForms]);
return /*#__PURE__*/_jsxs(Context, {
value: {
activeIndex: state.activeIndex,
addFiles,
bulkUpdateForm,
collectionSlug,
docPermissions,
documentSlots,
forms,
getFormDataRef,
hasPublishPermission,
hasSavePermission,
hasSubmitted,
isInitializing,
removeFile,
resetUploadEdits,
saveAllDocs,
setActiveIndex,
setFormTotalErrorCount,
totalErrorCount,
updateUploadEdits
},
children: [isUploading && /*#__PURE__*/_jsx(LoadingOverlay, {
animationDuration: "250ms",
loadingText: loadingText,
overlayType: "fullscreen",
show: true
}), children]
});
}
export function useFormsManager() {
return React.use(Context);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,26 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { useId } from 'react';
import { useEditDepth } from '../../providers/EditDepth/index.js';
import { formatDrawerSlug } from './index.js';
export const useDrawerSlug = slug => {
const $ = _c(3);
const uuid = useId();
const editDepth = useEditDepth();
const t0 = `${slug}-${uuid}`;
let t1;
if ($[0] !== editDepth || $[1] !== t0) {
t1 = formatDrawerSlug({
slug: t0,
depth: editDepth
});
$[0] = editDepth;
$[1] = t0;
$[2] = t1;
} else {
t1 = $[2];
}
return t1;
};
//# sourceMappingURL=useDrawerSlug.js.map

View File

@@ -0,0 +1,39 @@
import { Context } from '@opentelemetry/api';
import { ReadableSpan } from './export/ReadableSpan';
import { Span } from './Span';
/**
* SpanProcessor is the interface Tracer SDK uses to allow synchronous hooks
* for when a {@link Span} is started or when a {@link Span} is ended.
*/
export interface SpanProcessor {
/**
* Forces to export all finished spans
*/
forceFlush(): Promise<void>;
/**
* Called when a {@link Span} is started, if the `span.isRecording()`
* returns true.
* @param span the Span that just started.
*/
onStart(span: Span, parentContext: Context): void;
/**
* Called when a {@link Span} is ending, if the `span.isRecording()`
* returns true.
* @param span the Span that is ending.
*
* @experimental This method is experimental and may break in minor versions of this package
*/
onEnding?(span: Span): void;
/**
* Called when a {@link ReadableSpan} is ended, if the `span.isRecording()`
* returns true.
* @param span the Span that just ended.
*/
onEnd(span: ReadableSpan): void;
/**
* Shuts down the processor. Called when SDK is shut down. This is an
* opportunity for processor to do any cleanup required.
*/
shutdown(): Promise<void>;
}
//# sourceMappingURL=SpanProcessor.d.ts.map

View File

@@ -0,0 +1,7 @@
{
"name": "dom-helpers/isTransform",
"private": true,
"main": "../cjs/isTransform.js",
"module": "../esm/isTransform.js",
"types": "../esm/isTransform.d.ts"
}

View File

@@ -0,0 +1,24 @@
/**
* @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 FolderKey = createLucideIcon("FolderKey", [
["circle", { cx: "16", cy: "20", r: "2", key: "1vifvg" }],
[
"path",
{
d: "M10 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v2",
key: "3hgo9p"
}
],
["path", { d: "m22 14-4.5 4.5", key: "1ef6z8" }],
["path", { d: "m21 15 1 1", key: "1ejcpy" }]
]);
export { FolderKey as default };
//# sourceMappingURL=folder-key.js.map

View File

@@ -0,0 +1,2 @@
function e(e){return`directus_access.directus_activity.directus_collections.directus_comments.directus_fields.directus_files.directus_folders.directus_migrations.directus_permissions.directus_policies.directus_presets.directus_relations.directus_revisions.directus_roles.directus_sessions.directus_settings.directus_users.directus_dashboards.directus_panels.directus_notifications.directus_shares.directus_flows.directus_operations.directus_translations.directus_versions.directus_extensions.directus_deployments.directus_deployment_projects.directus_deployment_runs`.split(`.`).includes(e)}export{e as isSystemCollection};
//# sourceMappingURL=is-system-collection.js.map

View File

@@ -0,0 +1,49 @@
import { createBlocksMap } from '../../utilities/createBlocksMap.js';
import { createPathMap } from '../../utilities/createRelationshipMap.js';
import { traverseFields } from './traverseFields.js';
// This is the entry point to transform Drizzle output data
// into the shape Payload expects based on field schema
export const transform = ({ adapter, config, data, fields, joinQuery, parentIsLocalized, tableName })=>{
let relationships = {};
let texts = {};
let numbers = {};
if ('_rels' in data) {
relationships = createPathMap(data._rels);
delete data._rels;
}
if ('_texts' in data) {
texts = createPathMap(data._texts);
delete data._texts;
}
if ('_numbers' in data) {
numbers = createPathMap(data._numbers);
delete data._numbers;
}
const blocks = createBlocksMap(data);
const deletions = [];
const result = traverseFields({
adapter,
blocks,
config,
currentTableName: tableName,
dataRef: {
id: data.id
},
deletions,
fieldPrefix: '',
fields,
joinQuery,
numbers,
parentIsLocalized,
path: '',
relationships,
table: data,
tablePath: '',
texts,
topLevelTableName: tableName
});
deletions.forEach((deletion)=>deletion());
return result;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.bundle.tracing.replay.feedback.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.replay.feedback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAI3D,cAAc,qBAAqB,CAAC;AAGpC,OAAO,EAAE,6BAA6B,IAAI,yBAAyB,EAAE,UAAU,IAAI,MAAM,EAAE,CAAC;AAE5F,OAAO,EACL,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,wBAAwB,IAAI,wBAAwB,EAAE,wBAAwB,IAAI,mBAAmB,EAAE,CAAC;AAEjH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC"}

View File

@@ -0,0 +1,14 @@
import type { PaginatedDocs, PayloadRequest, SanitizedCollectionConfig } from 'payload';
/**
* Enriches list view documents with correct draft status display.
* When draft=true is used in the query, Payload returns the latest draft version if it exists.
* This function checks if draft documents also have a published version to determine "changed" status.
*
* Performance: Uses a single query to find all documents with "changed" status instead of N queries.
*/
export declare function enrichDocsWithVersionStatus({ collectionConfig, data, req, }: {
collectionConfig: SanitizedCollectionConfig;
data: PaginatedDocs;
req: PayloadRequest;
}): Promise<PaginatedDocs>;
//# sourceMappingURL=enrichDocsWithVersionStatus.d.ts.map

View File

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

View File

@@ -0,0 +1,133 @@
import _typeof from "./typeof.js";
import checkInRHS from "./checkInRHS.js";
import setFunctionName from "./setFunctionName.js";
import toPropertyKey from "./toPropertyKey.js";
function applyDecs2305(e, t, r, n, o, a) {
function i(e, t, r) {
return function (n, o) {
return r && r(n), e[t].call(n, o);
};
}
function c(e, t) {
for (var r = 0; r < e.length; r++) e[r].call(t);
return t;
}
function s(e, t, r, n) {
if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined"));
return e;
}
function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) {
function m(e) {
if (!h(e)) throw new TypeError("Attempted to access private element on non-instance");
}
var y,
v = t[0],
g = t[3],
b = !u;
if (!b) {
r || Array.isArray(v) || (v = [v]);
var w = {},
S = [],
A = 3 === o ? "get" : 4 === o || d ? "set" : "value";
f ? (p || d ? w = {
get: setFunctionName(function () {
return g(this);
}, n, "get"),
set: function set(e) {
t[4](this, e);
}
} : w[A] = g, p || setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n));
}
for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) {
var D = v[j],
E = r ? v[j - 1] : void 0,
I = {},
O = {
kind: ["field", "accessor", "method", "getter", "setter", "class"][o],
name: n,
metadata: a,
addInitializer: function (e, t) {
if (e.v) throw Error("attempted to call addInitializer after decoration was finished");
s(t, "An initializer", "be", !0), c.push(t);
}.bind(null, I)
};
try {
if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else {
var k, F;
O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) {
return m(e), w.value;
} : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) {
return e[n];
}, (o < 2 || 4 === o) && (F = function F(e, t) {
e[n] = t;
}));
var N = O.access = {
has: f ? h.bind() : function (e) {
return n in e;
}
};
if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? {
get: w.get,
set: w.set
} : w[A], O), d) {
if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
} else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P);
}
} finally {
I.v = !0;
}
}
return (p || d) && u.push(function (e, t) {
for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t);
return t;
}), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P;
}
function u(e, t) {
return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), {
configurable: !0,
enumerable: !0,
value: t
});
}
if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")];
var f = Object.create(null == l ? null : l),
p = function (e, t, r, n) {
var o,
a,
i = [],
s = function s(t) {
return checkInRHS(t) === e;
},
u = new Map();
function l(e) {
e && i.push(c.bind(null, e));
}
for (var f = 0; f < t.length; f++) {
var p = t[f];
if (Array.isArray(p)) {
var d = p[1],
h = p[2],
m = p.length > 3,
y = 16 & d,
v = !!(8 & d),
g = 0 == (d &= 7),
b = h + "/" + v;
if (!g && !m) {
var w = u.get(b);
if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h);
u.set(b, !(d > 2) || d);
}
applyDec(v ? e : e.prototype, p, y, m ? "#" + h : toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r);
}
}
return l(o), l(a), i;
}(e, t, o, f);
return r.length || u(e, f), {
e: p,
get c() {
var t = [];
return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)];
}
};
}
export { applyDecs2305 as default };

View File

@@ -0,0 +1,26 @@
/*
* 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.
*/
import { VERSION } from '../../version';
import { ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_LANGUAGE, TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS, ATTR_TELEMETRY_SDK_VERSION, } from '@opentelemetry/semantic-conventions';
import { ATTR_PROCESS_RUNTIME_NAME } from '../../semconv';
/** Constants describing the SDK in use */
export const SDK_INFO = {
[ATTR_TELEMETRY_SDK_NAME]: 'opentelemetry',
[ATTR_PROCESS_RUNTIME_NAME]: 'browser',
[ATTR_TELEMETRY_SDK_LANGUAGE]: TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,
[ATTR_TELEMETRY_SDK_VERSION]: VERSION,
};
//# sourceMappingURL=sdk-info.js.map

View File

@@ -0,0 +1,11 @@
import type { Locale } from "./types.js";
/**
* @category Locales
* @summary French locale (Canada).
* @language French
* @iso-639-2 fra
* @author Jean Dupouy [@izeau](https://github.com/izeau)
* @author François B [@fbonzon](https://github.com/fbonzon)
* @author Gabriele Petrioli [@gpetrioli](https://github.com/gpetrioli)
*/
export declare const frCA: Locale;

View File

@@ -0,0 +1,24 @@
import type { LocalDate } from 'gel';
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { GelColumn } from "./common.cjs";
import { GelLocalDateColumnBaseBuilder } from "./date.common.cjs";
export type GelLocalDateStringBuilderInitial<TName extends string> = GelLocalDateStringBuilder<{
name: TName;
dataType: 'localDate';
columnType: 'GelLocalDateString';
data: LocalDate;
driverParam: LocalDate;
enumValues: undefined;
}>;
export declare class GelLocalDateStringBuilder<T extends ColumnBuilderBaseConfig<'localDate', 'GelLocalDateString'>> extends GelLocalDateColumnBaseBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class GelLocalDateString<T extends ColumnBaseConfig<'localDate', 'GelLocalDateString'>> extends GelColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
}
export declare function localDate(): GelLocalDateStringBuilderInitial<''>;
export declare function localDate<TName extends string>(name: TName): GelLocalDateStringBuilderInitial<TName>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"LoggerProvider.js","sourceRoot":"","sources":["../../../src/types/LoggerProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger } from './Logger';\nimport { LoggerOptions } from './LoggerOptions';\n\n/**\n * A registry for creating named {@link Logger}s.\n */\nexport interface LoggerProvider {\n /**\n * Returns a Logger, creating one if one with the given name, version, and\n * schemaUrl pair is not already created.\n *\n * @param name The name of the logger or instrumentation library.\n * @param version The version of the logger or instrumentation library.\n * @param options The options of the logger or instrumentation library.\n * @returns Logger A Logger with the given name and version\n */\n getLogger(name: string, version?: string, options?: LoggerOptions): Logger;\n}\n"]}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","2":"K D E zC"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"0C VC J bB K D E 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB"},E:{"1":"B C L M G PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D E F A 6C bC 7C 8C 9C AD cC"},F:{"1":"0 1 2 3 4 5 6 7 8 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB JD KD LD MD PC xC ND QC"},G:{"1":"WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"E bC OD yC PD QD RD SD TD UD VD"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"A B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D","2":"J"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:5,C:"CSS font-stretch",D:true};

View File

@@ -0,0 +1,20 @@
import { Name } from "./codegen";
declare const names: {
data: Name;
valCxt: Name;
instancePath: Name;
parentData: Name;
parentDataProperty: Name;
rootData: Name;
dynamicAnchors: Name;
vErrors: Name;
errors: Name;
this: Name;
self: Name;
scope: Name;
json: Name;
jsonPos: Name;
jsonLen: Name;
jsonPart: Name;
};
export default names;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/FolderView/SortByPill/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,cAAc,CAAA;AAmCrB,wBAAgB,UAAU,sBAgFzB"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"users.js","sources":["../../../src/icons/users.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Users\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgMjF2LTJhNCA0IDAgMCAwLTQtNEg2YTQgNCAwIDAgMC00IDR2MiIgLz4KICA8Y2lyY2xlIGN4PSI5IiBjeT0iNyIgcj0iNCIgLz4KICA8cGF0aCBkPSJNMjIgMjF2LTJhNCA0IDAgMCAwLTMtMy44NyIgLz4KICA8cGF0aCBkPSJNMTYgMy4xM2E0IDQgMCAwIDEgMCA3Ljc1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/users\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 Users = createLucideIcon('Users', [\n ['path', { d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2', key: '1yyitq' }],\n ['circle', { cx: '9', cy: '7', r: '4', key: 'nufk8' }],\n ['path', { d: 'M22 21v-2a4 4 0 0 0-3-3.87', key: 'kshegd' }],\n ['path', { d: 'M16 3.13a4 4 0 0 1 0 7.75', key: '1da9ce' }],\n]);\n\nexport default Users;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1E,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAS,CAAA,CAAA;AAAA,CAAA,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC3D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC5D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"power.js","sources":["../../../src/icons/power.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Power\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMnYxMCIgLz4KICA8cGF0aCBkPSJNMTguNCA2LjZhOSA5IDAgMSAxLTEyLjc3LjA0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/power\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 Power = createLucideIcon('Power', [\n ['path', { d: 'M12 2v10', key: 'mnfbl' }],\n ['path', { d: 'M18.4 6.6a9 9 0 1 1-12.77.04', key: 'obofu9' }],\n]);\n\nexport default Power;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,SAAS,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;AAC/D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,11 @@
@layer payload-default {
.field-diff-label {
margin-bottom: calc(var(--base) * 0.35);
font-weight: 600;
display: flex;
flex-direction: row;
height: 100%;
align-items: center;
line-height: normal;
}
}

View File

@@ -0,0 +1,43 @@
var escapeHtmlChar = require('./_escapeHtmlChar'),
toString = require('./toString');
/** Used to match HTML entities and HTML characters. */
var reUnescapedHtml = /[&<>"']/g,
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
/**
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
* corresponding HTML entities.
*
* **Note:** No other characters are escaped. To escape additional
* characters use a third-party library like [_he_](https://mths.be/he).
*
* Though the ">" character is escaped for symmetry, characters like
* ">" and "/" don't need escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value. See
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details.
*
* When working with HTML you should always
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
* XSS vectors.
*
* @static
* @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escape('fred, barney, & pebbles');
* // => 'fred, barney, &amp; pebbles'
*/
function escape(string) {
string = toString(string);
return (string && reHasUnescapedHtml.test(string))
? string.replace(reUnescapedHtml, escapeHtmlChar)
: string;
}
module.exports = escape;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/errors/InvalidFieldJoin.ts"],"sourcesContent":["import type { JoinField } from '../fields/config/types.js'\n\nimport { APIError } from './APIError.js'\n\nexport class InvalidFieldJoin extends APIError {\n constructor(field: JoinField) {\n super(\n `Invalid join field ${field.name}. The config does not have a field '${field.on}' in collection '${field.collection}'.`,\n )\n }\n}\n"],"names":["APIError","InvalidFieldJoin","field","name","on","collection"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,gBAAe;AAExC,OAAO,MAAMC,yBAAyBD;IACpC,YAAYE,KAAgB,CAAE;QAC5B,KAAK,CACH,CAAC,mBAAmB,EAAEA,MAAMC,IAAI,CAAC,oCAAoC,EAAED,MAAME,EAAE,CAAC,iBAAiB,EAAEF,MAAMG,UAAU,CAAC,EAAE,CAAC;IAE3H;AACF"}

View File

@@ -0,0 +1,22 @@
/**
* @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 Crown = createLucideIcon("Crown", [
[
"path",
{
d: "M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",
key: "1vdc57"
}
],
["path", { d: "M5 21h14", key: "11awu3" }]
]);
export { Crown as default };
//# sourceMappingURL=crown.js.map

View File

@@ -0,0 +1,164 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["v.Chr.", "n.Chr."],
abbreviated: ["v.Chr.", "n.Chr."],
wide: ["viru Christus", "no Christus"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1. Quartal", "2. Quartal", "3. Quartal", "4. Quartal"],
};
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mäe",
"Abr",
"Mee",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dez",
],
wide: [
"Januar",
"Februar",
"Mäerz",
"Abrëll",
"Mee",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"Dezember",
],
};
const dayValues = {
narrow: ["S", "M", "D", "M", "D", "F", "S"],
short: ["So", "Mé", "Dë", "Më", "Do", "Fr", "Sa"],
abbreviated: ["So.", "Mé.", "Dë.", "Më.", "Do.", "Fr.", "Sa."],
wide: [
"Sonndeg",
"Méindeg",
"Dënschdeg",
"Mëttwoch",
"Donneschdeg",
"Freideg",
"Samschdeg",
],
};
const dayPeriodValues = {
narrow: {
am: "mo.",
pm: "nomë.",
midnight: "Mëtternuecht",
noon: "Mëtteg",
morning: "Moien",
afternoon: "Nomëtteg",
evening: "Owend",
night: "Nuecht",
},
abbreviated: {
am: "moies",
pm: "nomëttes",
midnight: "Mëtternuecht",
noon: "Mëtteg",
morning: "Moien",
afternoon: "Nomëtteg",
evening: "Owend",
night: "Nuecht",
},
wide: {
am: "moies",
pm: "nomëttes",
midnight: "Mëtternuecht",
noon: "Mëtteg",
morning: "Moien",
afternoon: "Nomëtteg",
evening: "Owend",
night: "Nuecht",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "mo.",
pm: "nom.",
midnight: "Mëtternuecht",
noon: "mëttes",
morning: "moies",
afternoon: "nomëttes",
evening: "owes",
night: "nuets",
},
abbreviated: {
am: "moies",
pm: "nomëttes",
midnight: "Mëtternuecht",
noon: "mëttes",
morning: "moies",
afternoon: "nomëttes",
evening: "owes",
night: "nuets",
},
wide: {
am: "moies",
pm: "nomëttes",
midnight: "Mëtternuecht",
noon: "mëttes",
morning: "moies",
afternoon: "nomëttes",
evening: "owes",
night: "nuets",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + ".";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DEPRECATED_ALIASES = void 0;
const DEPRECATED_ALIASES = exports.DEPRECATED_ALIASES = {
ModuleDeclaration: "ImportOrExportDeclaration"
};
//# sourceMappingURL=deprecated-aliases.js.map

View File

@@ -0,0 +1,7 @@
import React from 'react';
import './index.scss';
export declare const EyeIcon: React.FC<{
active?: boolean;
className?: string;
}>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,11 @@
import React from 'react';
import './index.scss';
export type PerPageProps = {
readonly defaultLimit?: number;
readonly handleChange?: (limit: number) => void;
readonly limit: number;
readonly limits: number[];
readonly resetPage?: boolean;
};
export declare const PerPage: React.FC<PerPageProps>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"K D E F A zC"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C 5C","2":"0C VC 4C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC"},E:{"1":"J bB K D E F A B C L M G 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"6C bC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C JD KD LD MD PC xC ND QC"},G:{"1":"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 TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC"},H:{"2":"mD"},I:{"1":"VC J I nD oD pD qD yC rD sD"},J:{"1":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"B","2":"A"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:7,C:"CSS pointer-events (for HTML)",D:true};

View File

@@ -0,0 +1,23 @@
/*
* 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.
*/
export var TraceFlags;
(function (TraceFlags) {
/** Represents no flag set. */
TraceFlags[TraceFlags["NONE"] = 0] = "NONE";
/** Bit to represent whether trace is sampled in trace flags. */
TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED";
})(TraceFlags || (TraceFlags = {}));
//# sourceMappingURL=trace_flags.js.map

View File

@@ -0,0 +1,128 @@
import {Value} from './index';
/**
* Sass's [color type](https://sass-lang.com/documentation/values/colors).
*
* No matter what representation was originally used to create this color, all
* of its channels are accessible.
*
* @category Custom Function
*/
export class SassColor extends Value {
/**
* Creates an RGB color.
*
* **Only** `undefined` should be passed to indicate a missing `alpha`. If
* `null` is passed instead, it will be treated as a [missing component] in
* future versions of Dart Sass. See [breaking changes] for details.
*
* [missing component]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#missing_color_components
* [breaking changes]: /documentation/breaking-changes/null-alpha
*
* @throws `Error` if `red`, `green`, and `blue` aren't between `0` and
* `255`, or if `alpha` isn't between `0` and `1`.
*/
constructor(options: {
red: number;
green: number;
blue: number;
alpha?: number;
});
/**
* Creates an HSL color.
*
* **Only** `undefined` should be passed to indicate a missing `alpha`. If
* `null` is passed instead, it will be treated as a [missing component] in
* future versions of Dart Sass. See [breaking changes] for details.
*
* [missing component]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#missing_color_components
* [breaking changes]: /documentation/breaking-changes/null-alpha
*
* @throws `Error` if `saturation` or `lightness` aren't between `0` and
* `100`, or if `alpha` isn't between `0` and `1`.
*/
constructor(options: {
hue: number;
saturation: number;
lightness: number;
alpha?: number;
});
/**
* Creates an HWB color.
*
* **Only** `undefined` should be passed to indicate a missing `alpha`. If
* `null` is passed instead, it will be treated as a [missing component] in
* future versions of Dart Sass. See [breaking changes] for details.
*
* [missing component]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#missing_color_components
* [breaking changes]: /documentation/breaking-changes/null-alpha
*
* @throws `Error` if `whiteness` or `blackness` aren't between `0` and `100`,
* or if `alpha` isn't between `0` and `1`.
*/
constructor(options: {
hue: number;
whiteness: number;
blackness: number;
alpha?: number;
});
/** This color's red channel, between `0` and `255`. */
get red(): number;
/** This color's green channel, between `0` and `255`. */
get green(): number;
/** This color's blue channel, between `0` and `255`. */
get blue(): number;
/** This color's hue, between `0` and `360`. */
get hue(): number;
/** This color's saturation, between `0` and `100`. */
get saturation(): number;
/** This color's lightness, between `0` and `100`. */
get lightness(): number;
/** This color's whiteness, between `0` and `100`. */
get whiteness(): number;
/** This color's blackness, between `0` and `100`. */
get blackness(): number;
/** This color's alpha channel, between `0` and `1`. */
get alpha(): number;
/**
* Changes one or more of this color's RGB channels and returns the result.
*/
change(options: {
red?: number;
green?: number;
blue?: number;
alpha?: number;
}): SassColor;
/**
* Changes one or more of this color's HSL channels and returns the result.
*/
change(options: {
hue?: number;
saturation?: number;
lightness?: number;
alpha?: number;
}): SassColor;
/**
* Changes one or more of this color's HWB channels and returns the result.
*/
change(options: {
hue?: number;
whiteness?: number;
blackness?: number;
alpha?: number;
}): SassColor;
}

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').unmemoize;

View File

@@ -0,0 +1,51 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const browser = require('@sentry/browser');
const sdk = require('./sdk.js');
const error = require('./error.js');
const profiler = require('./profiler.js');
const errorboundary = require('./errorboundary.js');
const redux = require('./redux.js');
const reactrouterv3 = require('./reactrouterv3.js');
const tanstackrouter = require('./tanstackrouter.js');
const reactrouter = require('./reactrouter.js');
const reactrouterv6 = require('./reactrouterv6.js');
const reactrouterv7 = require('./reactrouterv7.js');
exports.init = sdk.init;
exports.captureReactException = error.captureReactException;
exports.reactErrorHandler = error.reactErrorHandler;
exports.Profiler = profiler.Profiler;
exports.useProfiler = profiler.useProfiler;
exports.withProfiler = profiler.withProfiler;
exports.ErrorBoundary = errorboundary.ErrorBoundary;
exports.withErrorBoundary = errorboundary.withErrorBoundary;
exports.createReduxEnhancer = redux.createReduxEnhancer;
exports.reactRouterV3BrowserTracingIntegration = reactrouterv3.reactRouterV3BrowserTracingIntegration;
exports.tanstackRouterBrowserTracingIntegration = tanstackrouter.tanstackRouterBrowserTracingIntegration;
exports.reactRouterV4BrowserTracingIntegration = reactrouter.reactRouterV4BrowserTracingIntegration;
exports.reactRouterV5BrowserTracingIntegration = reactrouter.reactRouterV5BrowserTracingIntegration;
exports.withSentryRouting = reactrouter.withSentryRouting;
exports.reactRouterV6BrowserTracingIntegration = reactrouterv6.reactRouterV6BrowserTracingIntegration;
exports.withSentryReactRouterV6Routing = reactrouterv6.withSentryReactRouterV6Routing;
exports.wrapCreateBrowserRouterV6 = reactrouterv6.wrapCreateBrowserRouterV6;
exports.wrapCreateMemoryRouterV6 = reactrouterv6.wrapCreateMemoryRouterV6;
exports.wrapUseRoutesV6 = reactrouterv6.wrapUseRoutesV6;
exports.reactRouterV7BrowserTracingIntegration = reactrouterv7.reactRouterV7BrowserTracingIntegration;
exports.withSentryReactRouterV7Routing = reactrouterv7.withSentryReactRouterV7Routing;
exports.wrapCreateBrowserRouterV7 = reactrouterv7.wrapCreateBrowserRouterV7;
exports.wrapCreateMemoryRouterV7 = reactrouterv7.wrapCreateMemoryRouterV7;
exports.wrapUseRoutesV7 = reactrouterv7.wrapUseRoutesV7;
Object.prototype.hasOwnProperty.call(browser, '__proto__') &&
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
Object.defineProperty(exports, '__proto__', {
enumerable: true,
value: browser['__proto__']
});
Object.keys(browser).forEach(k => {
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = browser[k];
});
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.prefixLinearGradient = void 0;
var parser_1 = require("../../syntax/parser");
var angle_1 = require("../angle");
var gradient_1 = require("./gradient");
var prefixLinearGradient = function (context, tokens) {
var angle = angle_1.deg(180);
var stops = [];
parser_1.parseFunctionArgs(tokens).forEach(function (arg, i) {
if (i === 0) {
var firstToken = arg[0];
if (firstToken.type === 20 /* IDENT_TOKEN */ &&
['top', 'left', 'right', 'bottom'].indexOf(firstToken.value) !== -1) {
angle = angle_1.parseNamedSide(arg);
return;
}
else if (angle_1.isAngle(firstToken)) {
angle = (angle_1.angle.parse(context, firstToken) + angle_1.deg(270)) % angle_1.deg(360);
return;
}
}
var colorStop = gradient_1.parseColorStop(context, arg);
stops.push(colorStop);
});
return {
angle: angle,
stops: stops,
type: 1 /* LINEAR_GRADIENT */
};
};
exports.prefixLinearGradient = prefixLinearGradient;
//# sourceMappingURL=-prefix-linear-gradient.js.map

View File

@@ -0,0 +1,11 @@
import React from 'react';
import { RelationshipInput } from './Input.js';
import './index.scss';
export { RelationshipInput };
export declare const RelationshipField: React.FC<{
readonly path: string;
readonly validate?: import("payload").RelationshipFieldValidation;
} & {
readonly field: (Omit<import("payload").PolymorphicRelationshipFieldClient, "type"> & Partial<Pick<import("payload").PolymorphicRelationshipFieldClient, "type">>) | (Omit<import("payload").SingleRelationshipFieldClient, "type"> & Partial<Pick<import("payload").SingleRelationshipFieldClient, "type">>);
} & Omit<import("payload").ClientComponentProps, "customComponents" | "field">>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,20 @@
import { Integration } from '@sentry/core';
import { NodeOptions } from '../types';
import { NodeClient } from './client';
/**
* Get default integrations for the Node-Core SDK.
*/
export declare function getDefaultIntegrations(): Integration[];
/**
* Initialize Sentry for Node.
*/
export declare function init(options?: NodeOptions | undefined): NodeClient | undefined;
/**
* Initialize Sentry for Node, without any integrations added by default.
*/
export declare function initWithoutDefaultIntegrations(options?: NodeOptions | undefined): NodeClient;
/**
* Validate that your OpenTelemetry setup is correct.
*/
export declare function validateOpenTelemetrySetup(): void;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,39 @@
{
"name": "path-key",
"version": "3.1.1",
"description": "Get the PATH environment variable key cross-platform",
"license": "MIT",
"repository": "sindresorhus/path-key",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"path",
"key",
"environment",
"env",
"variable",
"var",
"get",
"cross-platform",
"windows"
],
"devDependencies": {
"@types/node": "^11.13.0",
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

View File

@@ -0,0 +1,3 @@
export * from "./declarations/src/index";
export { default } from "./declarations/src/index";
//# sourceMappingURL=emotion-hash.cjs.d.ts.map

View File

@@ -0,0 +1,172 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseStackingContexts = exports.ElementPaint = exports.StackingContext = void 0;
var bitwise_1 = require("../core/bitwise");
var bound_curves_1 = require("./bound-curves");
var effects_1 = require("./effects");
var path_1 = require("./path");
var ol_element_container_1 = require("../dom/elements/ol-element-container");
var li_element_container_1 = require("../dom/elements/li-element-container");
var counter_1 = require("../css/types/functions/counter");
var StackingContext = /** @class */ (function () {
function StackingContext(container) {
this.element = container;
this.inlineLevel = [];
this.nonInlineLevel = [];
this.negativeZIndex = [];
this.zeroOrAutoZIndexOrTransformedOrOpacity = [];
this.positiveZIndex = [];
this.nonPositionedFloats = [];
this.nonPositionedInlineLevel = [];
}
return StackingContext;
}());
exports.StackingContext = StackingContext;
var ElementPaint = /** @class */ (function () {
function ElementPaint(container, parent) {
this.container = container;
this.parent = parent;
this.effects = [];
this.curves = new bound_curves_1.BoundCurves(this.container);
if (this.container.styles.opacity < 1) {
this.effects.push(new effects_1.OpacityEffect(this.container.styles.opacity));
}
if (this.container.styles.transform !== null) {
var offsetX = this.container.bounds.left + this.container.styles.transformOrigin[0].number;
var offsetY = this.container.bounds.top + this.container.styles.transformOrigin[1].number;
var matrix = this.container.styles.transform;
this.effects.push(new effects_1.TransformEffect(offsetX, offsetY, matrix));
}
if (this.container.styles.overflowX !== 0 /* VISIBLE */) {
var borderBox = bound_curves_1.calculateBorderBoxPath(this.curves);
var paddingBox = bound_curves_1.calculatePaddingBoxPath(this.curves);
if (path_1.equalPath(borderBox, paddingBox)) {
this.effects.push(new effects_1.ClipEffect(borderBox, 2 /* BACKGROUND_BORDERS */ | 4 /* CONTENT */));
}
else {
this.effects.push(new effects_1.ClipEffect(borderBox, 2 /* BACKGROUND_BORDERS */));
this.effects.push(new effects_1.ClipEffect(paddingBox, 4 /* CONTENT */));
}
}
}
ElementPaint.prototype.getEffects = function (target) {
var inFlow = [2 /* ABSOLUTE */, 3 /* FIXED */].indexOf(this.container.styles.position) === -1;
var parent = this.parent;
var effects = this.effects.slice(0);
while (parent) {
var croplessEffects = parent.effects.filter(function (effect) { return !effects_1.isClipEffect(effect); });
if (inFlow || parent.container.styles.position !== 0 /* STATIC */ || !parent.parent) {
effects.unshift.apply(effects, croplessEffects);
inFlow = [2 /* ABSOLUTE */, 3 /* FIXED */].indexOf(parent.container.styles.position) === -1;
if (parent.container.styles.overflowX !== 0 /* VISIBLE */) {
var borderBox = bound_curves_1.calculateBorderBoxPath(parent.curves);
var paddingBox = bound_curves_1.calculatePaddingBoxPath(parent.curves);
if (!path_1.equalPath(borderBox, paddingBox)) {
effects.unshift(new effects_1.ClipEffect(paddingBox, 2 /* BACKGROUND_BORDERS */ | 4 /* CONTENT */));
}
}
}
else {
effects.unshift.apply(effects, croplessEffects);
}
parent = parent.parent;
}
return effects.filter(function (effect) { return bitwise_1.contains(effect.target, target); });
};
return ElementPaint;
}());
exports.ElementPaint = ElementPaint;
var parseStackTree = function (parent, stackingContext, realStackingContext, listItems) {
parent.container.elements.forEach(function (child) {
var treatAsRealStackingContext = bitwise_1.contains(child.flags, 4 /* CREATES_REAL_STACKING_CONTEXT */);
var createsStackingContext = bitwise_1.contains(child.flags, 2 /* CREATES_STACKING_CONTEXT */);
var paintContainer = new ElementPaint(child, parent);
if (bitwise_1.contains(child.styles.display, 2048 /* LIST_ITEM */)) {
listItems.push(paintContainer);
}
var listOwnerItems = bitwise_1.contains(child.flags, 8 /* IS_LIST_OWNER */) ? [] : listItems;
if (treatAsRealStackingContext || createsStackingContext) {
var parentStack = treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext;
var stack = new StackingContext(paintContainer);
if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) {
var order_1 = child.styles.zIndex.order;
if (order_1 < 0) {
var index_1 = 0;
parentStack.negativeZIndex.some(function (current, i) {
if (order_1 > current.element.container.styles.zIndex.order) {
index_1 = i;
return false;
}
else if (index_1 > 0) {
return true;
}
return false;
});
parentStack.negativeZIndex.splice(index_1, 0, stack);
}
else if (order_1 > 0) {
var index_2 = 0;
parentStack.positiveZIndex.some(function (current, i) {
if (order_1 >= current.element.container.styles.zIndex.order) {
index_2 = i + 1;
return false;
}
else if (index_2 > 0) {
return true;
}
return false;
});
parentStack.positiveZIndex.splice(index_2, 0, stack);
}
else {
parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack);
}
}
else {
if (child.styles.isFloating()) {
parentStack.nonPositionedFloats.push(stack);
}
else {
parentStack.nonPositionedInlineLevel.push(stack);
}
}
parseStackTree(paintContainer, stack, treatAsRealStackingContext ? stack : realStackingContext, listOwnerItems);
}
else {
if (child.styles.isInlineLevel()) {
stackingContext.inlineLevel.push(paintContainer);
}
else {
stackingContext.nonInlineLevel.push(paintContainer);
}
parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems);
}
if (bitwise_1.contains(child.flags, 8 /* IS_LIST_OWNER */)) {
processListItems(child, listOwnerItems);
}
});
};
var processListItems = function (owner, elements) {
var numbering = owner instanceof ol_element_container_1.OLElementContainer ? owner.start : 1;
var reversed = owner instanceof ol_element_container_1.OLElementContainer ? owner.reversed : false;
for (var i = 0; i < elements.length; i++) {
var item = elements[i];
if (item.container instanceof li_element_container_1.LIElementContainer &&
typeof item.container.value === 'number' &&
item.container.value !== 0) {
numbering = item.container.value;
}
item.listValue = counter_1.createCounterText(numbering, item.container.styles.listStyleType, true);
numbering += reversed ? -1 : 1;
}
};
var parseStackingContexts = function (container) {
var paintContainer = new ElementPaint(container, null);
var root = new StackingContext(paintContainer);
var listItems = [];
parseStackTree(paintContainer, root, root, listItems);
processListItems(paintContainer.container, listItems);
return root;
};
exports.parseStackingContexts = parseStackingContexts;
//# sourceMappingURL=stacking-context.js.map

View File

@@ -0,0 +1,90 @@
'use strict';
var path = require('path');
var fs = require('fs');
var acorn = require('./acorn.js');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var acorn__namespace = /*#__PURE__*/_interopNamespaceDefault(acorn);
var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false;
var options = {};
function help(status) {
var print = (status === 0) ? console.log : console.error;
print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]");
print(" [--tokenize] [--locations] [--allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [<infile>...]");
process.exit(status);
}
for (var i = 2; i < process.argv.length; ++i) {
var arg = process.argv[i];
if (arg[0] !== "-" || arg === "-") { inputFilePaths.push(arg); }
else if (arg === "--") {
inputFilePaths.push.apply(inputFilePaths, process.argv.slice(i + 1));
forceFileName = true;
break
} else if (arg === "--locations") { options.locations = true; }
else if (arg === "--allow-hash-bang") { options.allowHashBang = true; }
else if (arg === "--allow-await-outside-function") { options.allowAwaitOutsideFunction = true; }
else if (arg === "--silent") { silent = true; }
else if (arg === "--compact") { compact = true; }
else if (arg === "--help") { help(0); }
else if (arg === "--tokenize") { tokenize = true; }
else if (arg === "--module") { options.sourceType = "module"; }
else {
var match = arg.match(/^--ecma(\d+)$/);
if (match)
{ options.ecmaVersion = +match[1]; }
else
{ help(1); }
}
}
function run(codeList) {
var result = [], fileIdx = 0;
try {
codeList.forEach(function (code, idx) {
fileIdx = idx;
if (!tokenize) {
result = acorn__namespace.parse(code, options);
options.program = result;
} else {
var tokenizer = acorn__namespace.tokenizer(code, options), token;
do {
token = tokenizer.getToken();
result.push(token);
} while (token.type !== acorn__namespace.tokTypes.eof)
}
});
} catch (e) {
console.error(fileMode ? e.message.replace(/\(\d+:\d+\)$/, function (m) { return m.slice(0, 1) + inputFilePaths[fileIdx] + " " + m.slice(1); }) : e.message);
process.exit(1);
}
if (!silent) { console.log(JSON.stringify(result, function (_, value) { return typeof value === "bigint" ? null : value; }, compact ? null : 2)); }
}
if (fileMode = inputFilePaths.length && (forceFileName || !inputFilePaths.includes("-") || inputFilePaths.length !== 1)) {
run(inputFilePaths.map(function (path) { return fs.readFileSync(path, "utf8"); }));
} else {
var code = "";
process.stdin.resume();
process.stdin.on("data", function (chunk) { return code += chunk; });
process.stdin.on("end", function () { return run([code]); });
}

View File

@@ -0,0 +1 @@
!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e=/(?:^|\s)command-line(?:\s|$)/,t="command-line-prompt",n="".startsWith?function(e,t){return e.startsWith(t)}:function(e,t){return 0===e.indexOf(t)},a="".endsWith?function(e,t){return e.endsWith(t)}:function(e,t){var n=e.length;return e.substring(n-t.length,n)===t};Prism.hooks.add("before-highlight",(function(i){var o=r(i);if(!o.complete&&i.code){var s=i.element.parentElement;if(s&&/pre/i.test(s.nodeName)&&(e.test(s.className)||e.test(i.element.className))){var l=i.element.querySelector("."+t);l&&l.remove();var m=i.code.split("\n");o.numberOfLines=m.length;var u=o.outputLines=[],c=s.getAttribute("data-output"),d=s.getAttribute("data-filter-output");if(null!==c)c.split(",").forEach((function(e){var t=e.split("-"),n=parseInt(t[0],10),a=2===t.length?parseInt(t[1],10):n;if(!isNaN(n)&&!isNaN(a)){n<1&&(n=1),a>m.length&&(a=m.length),a--;for(var r=--n;r<=a;r++)u[r]=m[r],m[r]=""}}));else if(d)for(var p=0;p<m.length;p++)n(m[p],d)&&(u[p]=m[p].slice(d.length),m[p]="");for(var f=o.continuationLineIndicies=new Set,h=s.getAttribute("data-continuation-str"),v=s.getAttribute("data-filter-continuation"),g=0;g<m.length;g++){var b=m[g];b&&(h&&a(b,h)&&f.add(g+1),g>0&&v&&n(b,v)&&(m[g]=b.slice(v.length),f.add(g)))}i.code=m.join("\n")}else o.complete=!0}else o.complete=!0})),Prism.hooks.add("before-insert",(function(e){var t=r(e);if(!t.complete){for(var n=e.highlightedCode.split("\n"),a=t.outputLines||[],i=0,o=n.length;i<o;i++)a.hasOwnProperty(i)?n[i]='<span class="token output">'+Prism.util.encode(a[i])+"</span>":n[i]='<span class="token command">'+n[i]+"</span>";e.highlightedCode=n.join("\n")}})),Prism.hooks.add("complete",(function(n){if(function(e){return"command-line"in(e.vars=e.vars||{})}(n)){var a=r(n);if(!a.complete){var i=n.element.parentElement;e.test(n.element.className)&&(n.element.className=n.element.className.replace(e," ")),e.test(i.className)||(i.className+=" command-line");var o,s="",l=a.numberOfLines||0,m=b("data-prompt","");o=""!==m?'<span data-prompt="'+m+'"></span>':'<span data-user="'+b("data-user","user")+'" data-host="'+b("data-host","localhost")+'"></span>';for(var u=a.continuationLineIndicies||new Set,c='<span data-continuation-prompt="'+b("data-continuation-prompt",">")+'"></span>',d=0;d<l;d++)u.has(d)?s+=c:s+=o;var p=document.createElement("span");p.className=t,p.innerHTML=s;for(var f=a.outputLines||[],h=0,v=f.length;h<v;h++)if(f.hasOwnProperty(h)){var g=p.children[h];g.removeAttribute("data-user"),g.removeAttribute("data-host"),g.removeAttribute("data-prompt")}n.element.insertBefore(p,n.element.firstChild),a.complete=!0}}function b(e,t){return(i.getAttribute(e)||t).replace(/"/g,"&quot")}}))}function r(e){var t=e.vars=e.vars||{};return t["command-line"]=t["command-line"]||{}}}();

View File

@@ -0,0 +1,257 @@
import { defineIntegration, fill, getFunctionName, getOriginalFunction } from '@sentry/core';
import { WINDOW, wrap } from '../helpers.js';
const DEFAULT_EVENT_TARGET = [
'EventTarget',
'Window',
'Node',
'ApplicationCache',
'AudioTrackList',
'BroadcastChannel',
'ChannelMergerNode',
'CryptoOperation',
'EventSource',
'FileReader',
'HTMLUnknownElement',
'IDBDatabase',
'IDBRequest',
'IDBTransaction',
'KeyOperation',
'MediaController',
'MessagePort',
'ModalWindow',
'Notification',
'SVGElementInstance',
'Screen',
'SharedWorker',
'TextTrack',
'TextTrackCue',
'TextTrackList',
'WebSocket',
'WebSocketWorker',
'Worker',
'XMLHttpRequest',
'XMLHttpRequestEventTarget',
'XMLHttpRequestUpload',
];
const INTEGRATION_NAME = 'BrowserApiErrors';
const _browserApiErrorsIntegration = ((options = {}) => {
const _options = {
XMLHttpRequest: true,
eventTarget: true,
requestAnimationFrame: true,
setInterval: true,
setTimeout: true,
unregisterOriginalCallbacks: false,
...options,
};
return {
name: INTEGRATION_NAME,
// TODO: This currently only works for the first client this is setup
// We may want to adjust this to check for client etc.
setupOnce() {
if (_options.setTimeout) {
fill(WINDOW, 'setTimeout', _wrapTimeFunction);
}
if (_options.setInterval) {
fill(WINDOW, 'setInterval', _wrapTimeFunction);
}
if (_options.requestAnimationFrame) {
fill(WINDOW, 'requestAnimationFrame', _wrapRAF);
}
if (_options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {
fill(XMLHttpRequest.prototype, 'send', _wrapXHR);
}
const eventTargetOption = _options.eventTarget;
if (eventTargetOption) {
const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;
eventTarget.forEach(target => _wrapEventTarget(target, _options));
}
},
};
}) ;
/**
* Wrap timer functions and event targets to catch errors and provide better meta data.
*/
const browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration);
function _wrapTimeFunction(original) {
return function ( ...args) {
const originalCallback = args[0];
args[0] = wrap(originalCallback, {
mechanism: {
handled: false,
type: `auto.browser.browserapierrors.${getFunctionName(original)}`,
},
});
return original.apply(this, args);
};
}
function _wrapRAF(original) {
return function ( callback) {
return original.apply(this, [
wrap(callback, {
mechanism: {
data: {
handler: getFunctionName(original),
},
handled: false,
type: 'auto.browser.browserapierrors.requestAnimationFrame',
},
}),
]);
};
}
function _wrapXHR(originalSend) {
return function ( ...args) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const xhr = this;
const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];
xmlHttpRequestProps.forEach(prop => {
if (prop in xhr && typeof xhr[prop] === 'function') {
fill(xhr, prop, function (original) {
const wrapOptions = {
mechanism: {
data: {
handler: getFunctionName(original),
},
handled: false,
type: `auto.browser.browserapierrors.xhr.${prop}`,
},
};
// If Instrument integration has been called before BrowserApiErrors, get the name of original function
const originalFunction = getOriginalFunction(original);
if (originalFunction) {
wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);
}
// Otherwise wrap directly
return wrap(original, wrapOptions);
});
}
});
return originalSend.apply(this, args);
};
}
function _wrapEventTarget(target, integrationOptions) {
const globalObject = WINDOW ;
const proto = globalObject[target]?.prototype;
// eslint-disable-next-line no-prototype-builtins
if (!proto?.hasOwnProperty?.('addEventListener')) {
return;
}
fill(proto, 'addEventListener', function (original)
{
return function ( eventName, fn, options) {
try {
if (isEventListenerObject(fn)) {
// ESlint disable explanation:
// First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would
// introduce a bug here, because bind returns a new function that doesn't have our
// flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.
// Without those flags, every call to addEventListener wraps the function again, causing a memory leak.
// eslint-disable-next-line @typescript-eslint/unbound-method
fn.handleEvent = wrap(fn.handleEvent, {
mechanism: {
data: {
handler: getFunctionName(fn),
target,
},
handled: false,
type: 'auto.browser.browserapierrors.handleEvent',
},
});
}
} catch {
// can sometimes get 'Permission denied to access property "handle Event'
}
if (integrationOptions.unregisterOriginalCallbacks) {
unregisterOriginalCallback(this, eventName, fn);
}
return original.apply(this, [
eventName,
wrap(fn, {
mechanism: {
data: {
handler: getFunctionName(fn),
target,
},
handled: false,
type: 'auto.browser.browserapierrors.addEventListener',
},
}),
options,
]);
};
});
fill(proto, 'removeEventListener', function (originalRemoveEventListener)
{
return function ( eventName, fn, options) {
/**
* There are 2 possible scenarios here:
*
* 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified
* method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function
* as a pass-through, and call original `removeEventListener` with it.
*
* 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using
* our wrapped version of `addEventListener`, which internally calls `wrap` helper.
* This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it,
* in order for us to make a distinction between wrapped/non-wrapped functions possible.
* If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.
*
* When someone adds a handler prior to initialization, and then do it again, but after,
* then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible
* to get rid of the initial handler and it'd stick there forever.
*/
try {
const originalEventHandler = (fn ).__sentry_wrapped__;
if (originalEventHandler) {
originalRemoveEventListener.call(this, eventName, originalEventHandler, options);
}
} catch {
// ignore, accessing __sentry_wrapped__ will throw in some Selenium environments
}
return originalRemoveEventListener.call(this, eventName, fn, options);
};
});
}
function isEventListenerObject(obj) {
return typeof (obj ).handleEvent === 'function';
}
function unregisterOriginalCallback(target, eventName, fn) {
if (
target &&
typeof target === 'object' &&
'removeEventListener' in target &&
typeof target.removeEventListener === 'function'
) {
target.removeEventListener(eventName, fn);
}
}
export { browserApiErrorsIntegration };
//# sourceMappingURL=browserapierrors.js.map

View File

@@ -0,0 +1,71 @@
'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 './index.scss';
import { Link } from '../../elements/Link/index.js';
import { useConfig } from '../../providers/Config/index.js';
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
import { formatAdminURL } from '../../utilities/formatAdminURL.js';
import { sanitizeID } from '../../utilities/sanitizeID.js';
import { useDrawerDepth } from '../Drawer/index.js';
const baseClass = 'id-label';
export const IDLabel = t0 => {
const $ = _c(9);
const {
id,
className,
prefix: t1
} = t0;
const prefix = t1 === undefined ? "ID:" : t1;
const {
config: t2
} = useConfig();
const {
routes: t3
} = t2;
const {
admin: adminRoute
} = t3;
const {
collectionSlug,
globalSlug
} = useDocumentInfo();
const drawerDepth = useDrawerDepth();
const t4 = `/${collectionSlug ? `collections/${collectionSlug}` : `globals/${globalSlug}`}/${id}`;
let t5;
if ($[0] !== adminRoute || $[1] !== className || $[2] !== drawerDepth || $[3] !== id || $[4] !== prefix || $[5] !== t4) {
const docPath = formatAdminURL({
adminRoute,
path: t4
});
let t6;
if ($[7] !== className) {
t6 = [baseClass, className].filter(Boolean);
$[7] = className;
$[8] = t6;
} else {
t6 = $[8];
}
t5 = _jsxs("div", {
className: t6.join(" "),
title: id,
children: [prefix, "\xA0", drawerDepth > 1 ? _jsx(Link, {
href: docPath,
children: sanitizeID(id)
}) : sanitizeID(id)]
});
$[0] = adminRoute;
$[1] = className;
$[2] = drawerDepth;
$[3] = id;
$[4] = prefix;
$[5] = t4;
$[6] = t5;
} else {
t5 = $[6];
}
return t5;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withPayload.spec.js","names":["describe","expect","it","withPayload","originalBasePath","process","env","NEXT_BASE_PATH","mockNextConfig","basePath","toBe","undefined"],"sources":["../../src/withPayload/withPayload.spec.ts"],"sourcesContent":["import { describe, expect, it } from 'vitest'\n\nimport { withPayload } from './withPayload.js'\n\ndescribe('withPayload', () => {\n it('should set process.env.NEXT_BASE_PATH when nextConfig.basePath is provided', () => {\n const originalBasePath = process.env.NEXT_BASE_PATH\n delete process.env.NEXT_BASE_PATH\n\n try {\n const mockNextConfig = {\n basePath: '/test/basepath',\n }\n\n withPayload(mockNextConfig)\n\n // Verify it set the env var so formatAdminURL can read it\n expect(process.env.NEXT_BASE_PATH).toBe('/test/basepath')\n } finally {\n // Restore original value\n if (originalBasePath === undefined) {\n delete process.env.NEXT_BASE_PATH\n } else {\n process.env.NEXT_BASE_PATH = originalBasePath\n }\n }\n })\n\n it('should not modify process.env.NEXT_BASE_PATH when basePath is not provided', () => {\n const originalBasePath = process.env.NEXT_BASE_PATH\n\n try {\n const mockNextConfig = {}\n\n withPayload(mockNextConfig)\n\n // Verify it didn't set the env var\n expect(process.env.NEXT_BASE_PATH).toBe(originalBasePath)\n } finally {\n // Restore original value\n if (originalBasePath === undefined) {\n delete process.env.NEXT_BASE_PATH\n } else {\n process.env.NEXT_BASE_PATH = originalBasePath\n }\n }\n })\n})\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ;AAErC,SAASC,WAAW,QAAQ;AAE5BH,QAAA,CAAS,eAAe;EACtBE,EAAA,CAAG,8EAA8E;IAC/E,MAAME,gBAAA,GAAmBC,OAAA,CAAQC,GAAG,CAACC,cAAc;IACnD,OAAOF,OAAA,CAAQC,GAAG,CAACC,cAAc;IAEjC,IAAI;MACF,MAAMC,cAAA,GAAiB;QACrBC,QAAA,EAAU;MACZ;MAEAN,WAAA,CAAYK,cAAA;MAEZ;MACAP,MAAA,CAAOI,OAAA,CAAQC,GAAG,CAACC,cAAc,EAAEG,IAAI,CAAC;IAC1C,UAAU;MACR;MACA,IAAIN,gBAAA,KAAqBO,SAAA,EAAW;QAClC,OAAON,OAAA,CAAQC,GAAG,CAACC,cAAc;MACnC,OAAO;QACLF,OAAA,CAAQC,GAAG,CAACC,cAAc,GAAGH,gBAAA;MAC/B;IACF;EACF;EAEAF,EAAA,CAAG,8EAA8E;IAC/E,MAAME,gBAAA,GAAmBC,OAAA,CAAQC,GAAG,CAACC,cAAc;IAEnD,IAAI;MACF,MAAMC,cAAA,GAAiB,CAAC;MAExBL,WAAA,CAAYK,cAAA;MAEZ;MACAP,MAAA,CAAOI,OAAA,CAAQC,GAAG,CAACC,cAAc,EAAEG,IAAI,CAACN,gBAAA;IAC1C,UAAU;MACR;MACA,IAAIA,gBAAA,KAAqBO,SAAA,EAAW;QAClC,OAAON,OAAA,CAAQC,GAAG,CAACC,cAAc;MACnC,OAAO;QACLF,OAAA,CAAQC,GAAG,CAACC,cAAc,GAAGH,gBAAA;MAC/B;IACF;EACF;AACF","ignoreList":[]}

View File

@@ -0,0 +1 @@
Prism.languages.editorconfig={comment:/[;#].*/,section:{pattern:/(^[ \t]*)\[.+\]/m,lookbehind:!0,alias:"selector",inside:{regex:/\\\\[\[\]{},!?.*]/,operator:/[!?]|\.\.|\*{1,2}/,punctuation:/[\[\]{},]/}},key:{pattern:/(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/=.*/,alias:"attr-value",inside:{punctuation:/^=/}}};

View File

@@ -0,0 +1,484 @@
import { invariant } from 'motion-utils';
import { setDragLock } from 'motion-dom';
import { PanSession } from '../pan/PanSession.mjs';
import { isRefObject } from '../../utils/is-ref-object.mjs';
import { addPointerEvent } from '../../events/add-pointer-event.mjs';
import { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';
import { createBox } from '../../projection/geometry/models.mjs';
import { eachAxis } from '../../projection/utils/each-axis.mjs';
import { measurePageBox } from '../../projection/utils/measure.mjs';
import { extractEventInfo } from '../../events/event-info.mjs';
import { convertBoxToBoundingBox, convertBoundingBoxToBox } from '../../projection/geometry/conversion.mjs';
import { addDomEvent } from '../../events/add-dom-event.mjs';
import { calcLength } from '../../projection/geometry/delta-calc.mjs';
import { mixNumber } from '../../utils/mix/number.mjs';
import { percent } from '../../value/types/numbers/units.mjs';
import { animateMotionValue } from '../../animation/interfaces/motion-value.mjs';
import { getContextWindow } from '../../utils/get-context-window.mjs';
import { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';
import { frame } from '../../frameloop/frame.mjs';
const elementDragControls = new WeakMap();
/**
*
*/
// let latestPointerEvent: PointerEvent
class VisualElementDragControls {
constructor(visualElement) {
this.openDragLock = null;
this.isDragging = false;
this.currentDirection = null;
this.originPoint = { x: 0, y: 0 };
/**
* The permitted boundaries of travel, in pixels.
*/
this.constraints = false;
this.hasMutatedConstraints = false;
/**
* The per-axis resolved elastic values.
*/
this.elastic = createBox();
this.visualElement = visualElement;
}
start(originEvent, { snapToCursor = false } = {}) {
/**
* Don't start dragging if this component is exiting
*/
const { presenceContext } = this.visualElement;
if (presenceContext && presenceContext.isPresent === false)
return;
const onSessionStart = (event) => {
const { dragSnapToOrigin } = this.getProps();
// Stop or pause any animations on both axis values immediately. This allows the user to throw and catch
// the component.
dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();
if (snapToCursor) {
this.snapToCursor(extractEventInfo(event).point);
}
};
const onStart = (event, info) => {
// Attempt to grab the global drag gesture lock - maybe make this part of PanSession
const { drag, dragPropagation, onDragStart } = this.getProps();
if (drag && !dragPropagation) {
if (this.openDragLock)
this.openDragLock();
this.openDragLock = setDragLock(drag);
// If we don 't have the lock, don't start dragging
if (!this.openDragLock)
return;
}
this.isDragging = true;
this.currentDirection = null;
this.resolveConstraints();
if (this.visualElement.projection) {
this.visualElement.projection.isAnimationBlocked = true;
this.visualElement.projection.target = undefined;
}
/**
* Record gesture origin
*/
eachAxis((axis) => {
let current = this.getAxisMotionValue(axis).get() || 0;
/**
* If the MotionValue is a percentage value convert to px
*/
if (percent.test(current)) {
const { projection } = this.visualElement;
if (projection && projection.layout) {
const measuredAxis = projection.layout.layoutBox[axis];
if (measuredAxis) {
const length = calcLength(measuredAxis);
current = length * (parseFloat(current) / 100);
}
}
}
this.originPoint[axis] = current;
});
// Fire onDragStart event
if (onDragStart) {
frame.postRender(() => onDragStart(event, info));
}
addValueToWillChange(this.visualElement, "transform");
const { animationState } = this.visualElement;
animationState && animationState.setActive("whileDrag", true);
};
const onMove = (event, info) => {
// latestPointerEvent = event
const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();
// If we didn't successfully receive the gesture lock, early return.
if (!dragPropagation && !this.openDragLock)
return;
const { offset } = info;
// Attempt to detect drag direction if directionLock is true
if (dragDirectionLock && this.currentDirection === null) {
this.currentDirection = getCurrentDirection(offset);
// If we've successfully set a direction, notify listener
if (this.currentDirection !== null) {
onDirectionLock && onDirectionLock(this.currentDirection);
}
return;
}
// Update each point with the latest position
this.updateAxis("x", info.point, offset);
this.updateAxis("y", info.point, offset);
/**
* Ideally we would leave the renderer to fire naturally at the end of
* this frame but if the element is about to change layout as the result
* of a re-render we want to ensure the browser can read the latest
* bounding box to ensure the pointer and element don't fall out of sync.
*/
this.visualElement.render();
/**
* This must fire after the render call as it might trigger a state
* change which itself might trigger a layout update.
*/
onDrag && onDrag(event, info);
};
const onSessionEnd = (event, info) => this.stop(event, info);
const resumeAnimation = () => eachAxis((axis) => {
var _a;
return this.getAnimationState(axis) === "paused" &&
((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play());
});
const { dragSnapToOrigin } = this.getProps();
this.panSession = new PanSession(originEvent, {
onSessionStart,
onStart,
onMove,
onSessionEnd,
resumeAnimation,
}, {
transformPagePoint: this.visualElement.getTransformPagePoint(),
dragSnapToOrigin,
contextWindow: getContextWindow(this.visualElement),
});
}
stop(event, info) {
const isDragging = this.isDragging;
this.cancel();
if (!isDragging)
return;
const { velocity } = info;
this.startAnimation(velocity);
const { onDragEnd } = this.getProps();
if (onDragEnd) {
frame.postRender(() => onDragEnd(event, info));
}
}
cancel() {
this.isDragging = false;
const { projection, animationState } = this.visualElement;
if (projection) {
projection.isAnimationBlocked = false;
}
this.panSession && this.panSession.end();
this.panSession = undefined;
const { dragPropagation } = this.getProps();
if (!dragPropagation && this.openDragLock) {
this.openDragLock();
this.openDragLock = null;
}
animationState && animationState.setActive("whileDrag", false);
}
updateAxis(axis, _point, offset) {
const { drag } = this.getProps();
// If we're not dragging this axis, do an early return.
if (!offset || !shouldDrag(axis, drag, this.currentDirection))
return;
const axisValue = this.getAxisMotionValue(axis);
let next = this.originPoint[axis] + offset[axis];
// Apply constraints
if (this.constraints && this.constraints[axis]) {
next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);
}
axisValue.set(next);
}
resolveConstraints() {
var _a;
const { dragConstraints, dragElastic } = this.getProps();
const layout = this.visualElement.projection &&
!this.visualElement.projection.layout
? this.visualElement.projection.measure(false)
: (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout;
const prevConstraints = this.constraints;
if (dragConstraints && isRefObject(dragConstraints)) {
if (!this.constraints) {
this.constraints = this.resolveRefConstraints();
}
}
else {
if (dragConstraints && layout) {
this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);
}
else {
this.constraints = false;
}
}
this.elastic = resolveDragElastic(dragElastic);
/**
* If we're outputting to external MotionValues, we want to rebase the measured constraints
* from viewport-relative to component-relative.
*/
if (prevConstraints !== this.constraints &&
layout &&
this.constraints &&
!this.hasMutatedConstraints) {
eachAxis((axis) => {
if (this.constraints !== false &&
this.getAxisMotionValue(axis)) {
this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);
}
});
}
}
resolveRefConstraints() {
const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();
if (!constraints || !isRefObject(constraints))
return false;
const constraintsElement = constraints.current;
invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
const { projection } = this.visualElement;
// TODO
if (!projection || !projection.layout)
return false;
const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());
let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);
/**
* If there's an onMeasureDragConstraints listener we call it and
* if different constraints are returned, set constraints to that
*/
if (onMeasureDragConstraints) {
const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));
this.hasMutatedConstraints = !!userConstraints;
if (userConstraints) {
measuredConstraints = convertBoundingBoxToBox(userConstraints);
}
}
return measuredConstraints;
}
startAnimation(velocity) {
const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();
const constraints = this.constraints || {};
const momentumAnimations = eachAxis((axis) => {
if (!shouldDrag(axis, drag, this.currentDirection)) {
return;
}
let transition = (constraints && constraints[axis]) || {};
if (dragSnapToOrigin)
transition = { min: 0, max: 0 };
/**
* Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame
* of spring animations so we should look into adding a disable spring option to `inertia`.
* We could do something here where we affect the `bounceStiffness` and `bounceDamping`
* using the value of `dragElastic`.
*/
const bounceStiffness = dragElastic ? 200 : 1000000;
const bounceDamping = dragElastic ? 40 : 10000000;
const inertia = {
type: "inertia",
velocity: dragMomentum ? velocity[axis] : 0,
bounceStiffness,
bounceDamping,
timeConstant: 750,
restDelta: 1,
restSpeed: 10,
...dragTransition,
...transition,
};
// If we're not animating on an externally-provided `MotionValue` we can use the
// component's animation controls which will handle interactions with whileHover (etc),
// otherwise we just have to animate the `MotionValue` itself.
return this.startAxisValueAnimation(axis, inertia);
});
// Run all animations and then resolve the new drag constraints.
return Promise.all(momentumAnimations).then(onDragTransitionEnd);
}
startAxisValueAnimation(axis, transition) {
const axisValue = this.getAxisMotionValue(axis);
addValueToWillChange(this.visualElement, axis);
return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));
}
stopAnimation() {
eachAxis((axis) => this.getAxisMotionValue(axis).stop());
}
pauseAnimation() {
eachAxis((axis) => { var _a; return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); });
}
getAnimationState(axis) {
var _a;
return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state;
}
/**
* Drag works differently depending on which props are provided.
*
* - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
* - Otherwise, we apply the delta to the x/y motion values.
*/
getAxisMotionValue(axis) {
const dragKey = `_drag${axis.toUpperCase()}`;
const props = this.visualElement.getProps();
const externalMotionValue = props[dragKey];
return externalMotionValue
? externalMotionValue
: this.visualElement.getValue(axis, (props.initial
? props.initial[axis]
: undefined) || 0);
}
snapToCursor(point) {
eachAxis((axis) => {
const { drag } = this.getProps();
// If we're not dragging this axis, do an early return.
if (!shouldDrag(axis, drag, this.currentDirection))
return;
const { projection } = this.visualElement;
const axisValue = this.getAxisMotionValue(axis);
if (projection && projection.layout) {
const { min, max } = projection.layout.layoutBox[axis];
axisValue.set(point[axis] - mixNumber(min, max, 0.5));
}
});
}
/**
* When the viewport resizes we want to check if the measured constraints
* have changed and, if so, reposition the element within those new constraints
* relative to where it was before the resize.
*/
scalePositionWithinConstraints() {
if (!this.visualElement.current)
return;
const { drag, dragConstraints } = this.getProps();
const { projection } = this.visualElement;
if (!isRefObject(dragConstraints) || !projection || !this.constraints)
return;
/**
* Stop current animations as there can be visual glitching if we try to do
* this mid-animation
*/
this.stopAnimation();
/**
* Record the relative position of the dragged element relative to the
* constraints box and save as a progress value.
*/
const boxProgress = { x: 0, y: 0 };
eachAxis((axis) => {
const axisValue = this.getAxisMotionValue(axis);
if (axisValue && this.constraints !== false) {
const latest = axisValue.get();
boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);
}
});
/**
* Update the layout of this element and resolve the latest drag constraints
*/
const { transformTemplate } = this.visualElement.getProps();
this.visualElement.current.style.transform = transformTemplate
? transformTemplate({}, "")
: "none";
projection.root && projection.root.updateScroll();
projection.updateLayout();
this.resolveConstraints();
/**
* For each axis, calculate the current progress of the layout axis
* within the new constraints.
*/
eachAxis((axis) => {
if (!shouldDrag(axis, drag, null))
return;
/**
* Calculate a new transform based on the previous box progress
*/
const axisValue = this.getAxisMotionValue(axis);
const { min, max } = this.constraints[axis];
axisValue.set(mixNumber(min, max, boxProgress[axis]));
});
}
addListeners() {
if (!this.visualElement.current)
return;
elementDragControls.set(this.visualElement, this);
const element = this.visualElement.current;
/**
* Attach a pointerdown event listener on this DOM element to initiate drag tracking.
*/
const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => {
const { drag, dragListener = true } = this.getProps();
drag && dragListener && this.start(event);
});
const measureDragConstraints = () => {
const { dragConstraints } = this.getProps();
if (isRefObject(dragConstraints) && dragConstraints.current) {
this.constraints = this.resolveRefConstraints();
}
};
const { projection } = this.visualElement;
const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints);
if (projection && !projection.layout) {
projection.root && projection.root.updateScroll();
projection.updateLayout();
}
frame.read(measureDragConstraints);
/**
* Attach a window resize listener to scale the draggable target within its defined
* constraints as the window resizes.
*/
const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints());
/**
* If the element's layout changes, calculate the delta and apply that to
* the drag gesture's origin point.
*/
const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => {
if (this.isDragging && hasLayoutChanged) {
eachAxis((axis) => {
const motionValue = this.getAxisMotionValue(axis);
if (!motionValue)
return;
this.originPoint[axis] += delta[axis].translate;
motionValue.set(motionValue.get() + delta[axis].translate);
});
this.visualElement.render();
}
}));
return () => {
stopResizeListener();
stopPointerListener();
stopMeasureLayoutListener();
stopLayoutUpdateListener && stopLayoutUpdateListener();
};
}
getProps() {
const props = this.visualElement.getProps();
const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;
return {
...props,
drag,
dragDirectionLock,
dragPropagation,
dragConstraints,
dragElastic,
dragMomentum,
};
}
}
function shouldDrag(direction, drag, currentDirection) {
return ((drag === true || drag === direction) &&
(currentDirection === null || currentDirection === direction));
}
/**
* Based on an x/y offset determine the current drag direction. If both axis' offsets are lower
* than the provided threshold, return `null`.
*
* @param offset - The x/y offset from origin.
* @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.
*/
function getCurrentDirection(offset, lockThreshold = 10) {
let direction = null;
if (Math.abs(offset.y) > lockThreshold) {
direction = "y";
}
else if (Math.abs(offset.x) > lockThreshold) {
direction = "x";
}
return direction;
}
export { VisualElementDragControls, elementDragControls };

View File

@@ -0,0 +1,873 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { SyncWaterfallHook } = require("tapable");
const {
JAVASCRIPT_MODULE_TYPE_AUTO,
JAVASCRIPT_MODULE_TYPE_DYNAMIC,
JAVASCRIPT_MODULE_TYPE_ESM
} = require("./ModuleTypeConstants");
const RuntimeGlobals = require("./RuntimeGlobals");
const WebpackError = require("./WebpackError");
const ConstDependency = require("./dependencies/ConstDependency");
const BasicEvaluatedExpression = require("./javascript/BasicEvaluatedExpression");
const { VariableInfo } = require("./javascript/JavascriptParser");
const {
evaluateToString,
toConstantDependency
} = require("./javascript/JavascriptParserHelpers");
const createHash = require("./util/createHash");
/** @typedef {import("estree").Expression} Expression */
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./Module").BuildInfo} BuildInfo */
/** @typedef {import("./Module").ValueCacheVersion} ValueCacheVersion */
/** @typedef {import("./Module").ValueCacheVersions} ValueCacheVersions */
/** @typedef {import("./NormalModule")} NormalModule */
/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */
/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */
/** @typedef {import("./javascript/JavascriptParser").DestructuringAssignmentProperties} DestructuringAssignmentProperties */
/** @typedef {import("./javascript/JavascriptParser").Range} Range */
/** @typedef {import("./logging/Logger").Logger} Logger */
/** @typedef {import("./Compilation")} Compilation */
/** @typedef {null | undefined | RegExp | EXPECTED_FUNCTION | string | number | boolean | bigint | undefined} CodeValuePrimitive */
/** @typedef {RecursiveArrayOrRecord<CodeValuePrimitive | RuntimeValue>} CodeValue */
/**
* @typedef {object} RuntimeValueOptions
* @property {string[]=} fileDependencies
* @property {string[]=} contextDependencies
* @property {string[]=} missingDependencies
* @property {string[]=} buildDependencies
* @property {string | (() => string)=} version
*/
/** @typedef {(value: { module: NormalModule, key: string, readonly version: ValueCacheVersion }) => CodeValuePrimitive} GeneratorFn */
class RuntimeValue {
/**
* @param {GeneratorFn} fn generator function
* @param {true | string[] | RuntimeValueOptions=} options options
*/
constructor(fn, options) {
this.fn = fn;
if (Array.isArray(options)) {
options = {
fileDependencies: options
};
}
this.options = options || {};
}
get fileDependencies() {
return this.options === true ? true : this.options.fileDependencies;
}
/**
* @param {JavascriptParser} parser the parser
* @param {ValueCacheVersions} valueCacheVersions valueCacheVersions
* @param {string} key the defined key
* @returns {CodeValuePrimitive} code
*/
exec(parser, valueCacheVersions, key) {
const buildInfo = /** @type {BuildInfo} */ (parser.state.module.buildInfo);
if (this.options === true) {
buildInfo.cacheable = false;
} else {
if (this.options.fileDependencies) {
for (const dep of this.options.fileDependencies) {
/** @type {NonNullable<BuildInfo["fileDependencies"]>} */
(buildInfo.fileDependencies).add(dep);
}
}
if (this.options.contextDependencies) {
for (const dep of this.options.contextDependencies) {
/** @type {NonNullable<BuildInfo["contextDependencies"]>} */
(buildInfo.contextDependencies).add(dep);
}
}
if (this.options.missingDependencies) {
for (const dep of this.options.missingDependencies) {
/** @type {NonNullable<BuildInfo["missingDependencies"]>} */
(buildInfo.missingDependencies).add(dep);
}
}
if (this.options.buildDependencies) {
for (const dep of this.options.buildDependencies) {
/** @type {NonNullable<BuildInfo["buildDependencies"]>} */
(buildInfo.buildDependencies).add(dep);
}
}
}
return this.fn({
module: parser.state.module,
key,
get version() {
return /** @type {ValueCacheVersion} */ (
valueCacheVersions.get(VALUE_DEP_PREFIX + key)
);
}
});
}
getCacheVersion() {
return this.options === true
? undefined
: (typeof this.options.version === "function"
? this.options.version()
: this.options.version) || "unset";
}
}
/**
* @param {DestructuringAssignmentProperties | undefined} properties properties
* @returns {Set<string> | undefined} used keys
*/
function getObjKeys(properties) {
if (!properties) return;
return new Set([...properties].map((p) => p.id));
}
/** @typedef {Set<string> | null} ObjKeys */
/** @typedef {boolean | undefined | null} AsiSafe */
/**
* @param {EXPECTED_ANY[] | { [k: string]: EXPECTED_ANY }} obj obj
* @param {JavascriptParser} parser Parser
* @param {ValueCacheVersions} valueCacheVersions valueCacheVersions
* @param {string} key the defined key
* @param {RuntimeTemplate} runtimeTemplate the runtime template
* @param {Logger} logger the logger object
* @param {AsiSafe=} asiSafe asi safe (undefined: unknown, null: unneeded)
* @param {ObjKeys=} objKeys used keys
* @returns {string} code converted to string that evaluates
*/
const stringifyObj = (
obj,
parser,
valueCacheVersions,
key,
runtimeTemplate,
logger,
asiSafe,
objKeys
) => {
/** @type {string} */
let code;
const arr = Array.isArray(obj);
if (arr) {
code = `[${obj
.map((code) =>
toCode(
code,
parser,
valueCacheVersions,
key,
runtimeTemplate,
logger,
null
)
)
.join(",")}]`;
} else {
let keys = Object.keys(obj);
if (objKeys) {
keys = objKeys.size === 0 ? [] : keys.filter((k) => objKeys.has(k));
}
code = `{${keys
.map((key) => {
const code = obj[key];
return `${key === "__proto__" ? '["__proto__"]' : JSON.stringify(key)}:${toCode(
code,
parser,
valueCacheVersions,
key,
runtimeTemplate,
logger,
null
)}`;
})
.join(",")}}`;
}
switch (asiSafe) {
case null:
return code;
case true:
return arr ? code : `(${code})`;
case false:
return arr ? `;${code}` : `;(${code})`;
default:
return `/*#__PURE__*/Object(${code})`;
}
};
/**
* Convert code to a string that evaluates
* @param {CodeValue} code Code to evaluate
* @param {JavascriptParser} parser Parser
* @param {ValueCacheVersions} valueCacheVersions valueCacheVersions
* @param {string} key the defined key
* @param {RuntimeTemplate} runtimeTemplate the runtime template
* @param {Logger} logger the logger object
* @param {boolean | undefined | null=} asiSafe asi safe (undefined: unknown, null: unneeded)
* @param {ObjKeys=} objKeys used keys
* @returns {string} code converted to string that evaluates
*/
const toCode = (
code,
parser,
valueCacheVersions,
key,
runtimeTemplate,
logger,
asiSafe,
objKeys
) => {
const transformToCode = () => {
if (code === null) {
return "null";
}
if (code === undefined) {
return "undefined";
}
if (Object.is(code, -0)) {
return "-0";
}
if (code instanceof RuntimeValue) {
return toCode(
code.exec(parser, valueCacheVersions, key),
parser,
valueCacheVersions,
key,
runtimeTemplate,
logger,
asiSafe
);
}
if (code instanceof RegExp && code.toString) {
return code.toString();
}
if (typeof code === "function" && code.toString) {
return `(${code.toString()})`;
}
if (typeof code === "object") {
return stringifyObj(
code,
parser,
valueCacheVersions,
key,
runtimeTemplate,
logger,
asiSafe,
objKeys
);
}
if (typeof code === "bigint") {
return runtimeTemplate.supportsBigIntLiteral()
? `${code}n`
: `BigInt("${code}")`;
}
return `${code}`;
};
const strCode = transformToCode();
logger.debug(`Replaced "${key}" with "${strCode}"`);
return strCode;
};
/**
* @param {CodeValue} code code
* @returns {string | undefined} result
*/
const toCacheVersion = (code) => {
if (code === null) {
return "null";
}
if (code === undefined) {
return "undefined";
}
if (Object.is(code, -0)) {
return "-0";
}
if (code instanceof RuntimeValue) {
return code.getCacheVersion();
}
if (code instanceof RegExp && code.toString) {
return code.toString();
}
if (typeof code === "function" && code.toString) {
return `(${code.toString()})`;
}
if (typeof code === "object") {
const items = Object.keys(code).map((key) => ({
key,
value: toCacheVersion(
/** @type {Record<string, EXPECTED_ANY>} */
(code)[key]
)
}));
if (items.some(({ value }) => value === undefined)) return;
return `{${items.map(({ key, value }) => `${key}: ${value}`).join(", ")}}`;
}
if (typeof code === "bigint") {
return `${code}n`;
}
return `${code}`;
};
const PLUGIN_NAME = "DefinePlugin";
const VALUE_DEP_PREFIX = `webpack/${PLUGIN_NAME} `;
const VALUE_DEP_MAIN = `webpack/${PLUGIN_NAME}_hash`;
const TYPEOF_OPERATOR_REGEXP = /^typeof\s+/;
const WEBPACK_REQUIRE_FUNCTION_REGEXP = new RegExp(
`${RuntimeGlobals.require}\\s*(!?\\.)`
);
const WEBPACK_REQUIRE_IDENTIFIER_REGEXP = new RegExp(RuntimeGlobals.require);
/**
* @typedef {object} DefinePluginHooks
* @property {SyncWaterfallHook<[Record<string, CodeValue>]>} definitions
*/
/** @type {WeakMap<Compilation, DefinePluginHooks>} */
const compilationHooksMap = new WeakMap();
class DefinePlugin {
/**
* @param {Compilation} compilation the compilation
* @returns {DefinePluginHooks} the attached hooks
*/
static getCompilationHooks(compilation) {
let hooks = compilationHooksMap.get(compilation);
if (hooks === undefined) {
hooks = {
definitions: new SyncWaterfallHook(["definitions"])
};
compilationHooksMap.set(compilation, hooks);
}
return hooks;
}
/**
* Create a new define plugin
* @param {Record<string, CodeValue>} definitions A map of global object definitions
*/
constructor(definitions) {
this.definitions = definitions;
}
/**
* @param {GeneratorFn} fn generator function
* @param {true | string[] | RuntimeValueOptions=} options options
* @returns {RuntimeValue} runtime value
*/
static runtimeValue(fn, options) {
return new RuntimeValue(fn, options);
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
const definitions = this.definitions;
const hooks = DefinePlugin.getCompilationHooks(compilation);
hooks.definitions.tap(PLUGIN_NAME, (previousDefinitions) => ({
...previousDefinitions,
...definitions
}));
/**
* @type {Map<string, Set<string>>}
*/
const finalByNestedKey = new Map();
/**
* @type {Map<string, Set<string>>}
*/
const nestedByFinalKey = new Map();
const logger = compilation.getLogger("webpack.DefinePlugin");
compilation.dependencyTemplates.set(
ConstDependency,
new ConstDependency.Template()
);
const { runtimeTemplate } = compilation;
const mainHash = createHash(compilation.outputOptions.hashFunction);
mainHash.update(
/** @type {string} */
(compilation.valueCacheVersions.get(VALUE_DEP_MAIN)) || ""
);
/**
* Handler
* @param {JavascriptParser} parser Parser
* @returns {void}
*/
const handler = (parser) => {
/** @type {Set<string>} */
const hooked = new Set();
const mainValue =
/** @type {ValueCacheVersion} */
(compilation.valueCacheVersions.get(VALUE_DEP_MAIN));
parser.hooks.program.tap(PLUGIN_NAME, () => {
const buildInfo = /** @type {BuildInfo} */ (
parser.state.module.buildInfo
);
if (!buildInfo.valueDependencies) {
buildInfo.valueDependencies = new Map();
}
buildInfo.valueDependencies.set(VALUE_DEP_MAIN, mainValue);
});
/**
* @param {string} key key
*/
const addValueDependency = (key) => {
const buildInfo =
/** @type {BuildInfo} */
(parser.state.module.buildInfo);
/** @type {NonNullable<BuildInfo["valueDependencies"]>} */
(buildInfo.valueDependencies).set(
VALUE_DEP_PREFIX + key,
/** @type {ValueCacheVersion} */
(compilation.valueCacheVersions.get(VALUE_DEP_PREFIX + key))
);
};
/**
* @template T
* @param {string} key key
* @param {(expression: Expression) => T} fn fn
* @returns {(expression: Expression) => T} result
*/
const withValueDependency =
(key, fn) =>
(...args) => {
addValueDependency(key);
return fn(...args);
};
/**
* Walk definitions
* @param {Record<string, CodeValue>} definitions Definitions map
* @param {string} prefix Prefix string
* @returns {void}
*/
const walkDefinitions = (definitions, prefix) => {
for (const key of Object.keys(definitions)) {
const code = definitions[key];
if (
code &&
typeof code === "object" &&
!(code instanceof RuntimeValue) &&
!(code instanceof RegExp)
) {
walkDefinitions(
/** @type {Record<string, CodeValue>} */ (code),
`${prefix + key}.`
);
applyObjectDefine(prefix + key, code);
continue;
}
applyDefineKey(prefix, key);
applyDefine(prefix + key, code);
}
};
/**
* Apply define key
* @param {string} prefix Prefix
* @param {string} key Key
* @returns {void}
*/
const applyDefineKey = (prefix, key) => {
const splittedKey = key.split(".");
const firstKey = splittedKey[0];
for (const [i, _] of splittedKey.slice(1).entries()) {
const fullKey = prefix + splittedKey.slice(0, i + 1).join(".");
parser.hooks.canRename.for(fullKey).tap(PLUGIN_NAME, () => {
addValueDependency(key);
if (
parser.scope.definitions.get(firstKey) instanceof VariableInfo
) {
return false;
}
return true;
});
}
if (prefix === "") {
const final = splittedKey[splittedKey.length - 1];
const nestedSet = nestedByFinalKey.get(final);
if (!nestedSet || nestedSet.size <= 0) return;
for (const nested of /** @type {Set<string>} */ (nestedSet)) {
if (nested && !hooked.has(nested)) {
// only detect the same nested key once
hooked.add(nested);
parser.hooks.collectDestructuringAssignmentProperties.tap(
PLUGIN_NAME,
(expr) => {
const nameInfo = parser.getNameForExpression(expr);
if (nameInfo && nameInfo.name === nested) return true;
}
);
parser.hooks.expression.for(nested).tap(
{
name: PLUGIN_NAME,
// why 100? Ensures it runs after object define
stage: 100
},
(expr) => {
const destructed =
parser.destructuringAssignmentPropertiesFor(expr);
if (destructed === undefined) {
return;
}
/** @type {Record<string, CodeValue>} */
const obj = Object.create(null);
const finalSet = finalByNestedKey.get(nested);
for (const { id } of destructed) {
const fullKey = `${nested}.${id}`;
if (
!finalSet ||
!finalSet.has(id) ||
!definitions[fullKey]
) {
return;
}
obj[id] = definitions[fullKey];
}
let strCode = stringifyObj(
obj,
parser,
compilation.valueCacheVersions,
key,
runtimeTemplate,
logger,
!parser.isAsiPosition(
/** @type {Range} */ (expr.range)[0]
),
getObjKeys(destructed)
);
if (parser.scope.inShorthand) {
strCode = `${parser.scope.inShorthand}:${strCode}`;
}
return toConstantDependency(parser, strCode)(expr);
}
);
}
}
}
};
/**
* Apply Code
* @param {string} key Key
* @param {CodeValue} code Code
* @returns {void}
*/
const applyDefine = (key, code) => {
const originalKey = key;
const isTypeof = TYPEOF_OPERATOR_REGEXP.test(key);
if (isTypeof) key = key.replace(TYPEOF_OPERATOR_REGEXP, "");
let recurse = false;
let recurseTypeof = false;
if (!isTypeof) {
parser.hooks.canRename.for(key).tap(PLUGIN_NAME, () => {
addValueDependency(originalKey);
return true;
});
parser.hooks.evaluateIdentifier
.for(key)
.tap(PLUGIN_NAME, (expr) => {
/**
* this is needed in case there is a recursion in the DefinePlugin
* to prevent an endless recursion
* e.g.: new DefinePlugin({
* "a": "b",
* "b": "a"
* });
*/
if (recurse) return;
addValueDependency(originalKey);
recurse = true;
const res = parser.evaluate(
toCode(
code,
parser,
compilation.valueCacheVersions,
key,
runtimeTemplate,
logger,
null
)
);
recurse = false;
res.setRange(/** @type {Range} */ (expr.range));
return res;
});
parser.hooks.expression.for(key).tap(PLUGIN_NAME, (expr) => {
addValueDependency(originalKey);
let strCode = toCode(
code,
parser,
compilation.valueCacheVersions,
originalKey,
runtimeTemplate,
logger,
!parser.isAsiPosition(/** @type {Range} */ (expr.range)[0]),
null
);
if (parser.scope.inShorthand) {
strCode = `${parser.scope.inShorthand}:${strCode}`;
}
if (WEBPACK_REQUIRE_FUNCTION_REGEXP.test(strCode)) {
return toConstantDependency(parser, strCode, [
RuntimeGlobals.require
])(expr);
} else if (WEBPACK_REQUIRE_IDENTIFIER_REGEXP.test(strCode)) {
return toConstantDependency(parser, strCode, [
RuntimeGlobals.requireScope
])(expr);
}
return toConstantDependency(parser, strCode)(expr);
});
}
parser.hooks.evaluateTypeof.for(key).tap(PLUGIN_NAME, (expr) => {
/**
* this is needed in case there is a recursion in the DefinePlugin
* to prevent an endless recursion
* e.g.: new DefinePlugin({
* "typeof a": "typeof b",
* "typeof b": "typeof a"
* });
*/
if (recurseTypeof) return;
recurseTypeof = true;
addValueDependency(originalKey);
const codeCode = toCode(
code,
parser,
compilation.valueCacheVersions,
originalKey,
runtimeTemplate,
logger,
null
);
const typeofCode = isTypeof ? codeCode : `typeof (${codeCode})`;
const res = parser.evaluate(typeofCode);
recurseTypeof = false;
res.setRange(/** @type {Range} */ (expr.range));
return res;
});
parser.hooks.typeof.for(key).tap(PLUGIN_NAME, (expr) => {
addValueDependency(originalKey);
const codeCode = toCode(
code,
parser,
compilation.valueCacheVersions,
originalKey,
runtimeTemplate,
logger,
null
);
const typeofCode = isTypeof ? codeCode : `typeof (${codeCode})`;
const res = parser.evaluate(typeofCode);
if (!res.isString()) return;
return toConstantDependency(
parser,
JSON.stringify(res.string)
).bind(parser)(expr);
});
};
/**
* Apply Object
* @param {string} key Key
* @param {object} obj Object
* @returns {void}
*/
const applyObjectDefine = (key, obj) => {
parser.hooks.canRename.for(key).tap(PLUGIN_NAME, () => {
addValueDependency(key);
return true;
});
parser.hooks.evaluateIdentifier
.for(key)
.tap(PLUGIN_NAME, (expr) => {
addValueDependency(key);
return new BasicEvaluatedExpression()
.setTruthy()
.setSideEffects(false)
.setRange(/** @type {Range} */ (expr.range));
});
parser.hooks.evaluateTypeof
.for(key)
.tap(
PLUGIN_NAME,
withValueDependency(key, evaluateToString("object"))
);
parser.hooks.collectDestructuringAssignmentProperties.tap(
PLUGIN_NAME,
(expr) => {
const nameInfo = parser.getNameForExpression(expr);
if (nameInfo && nameInfo.name === key) return true;
}
);
parser.hooks.expression.for(key).tap(PLUGIN_NAME, (expr) => {
addValueDependency(key);
let strCode = stringifyObj(
obj,
parser,
compilation.valueCacheVersions,
key,
runtimeTemplate,
logger,
!parser.isAsiPosition(/** @type {Range} */ (expr.range)[0]),
getObjKeys(parser.destructuringAssignmentPropertiesFor(expr))
);
if (parser.scope.inShorthand) {
strCode = `${parser.scope.inShorthand}:${strCode}`;
}
if (WEBPACK_REQUIRE_FUNCTION_REGEXP.test(strCode)) {
return toConstantDependency(parser, strCode, [
RuntimeGlobals.require
])(expr);
} else if (WEBPACK_REQUIRE_IDENTIFIER_REGEXP.test(strCode)) {
return toConstantDependency(parser, strCode, [
RuntimeGlobals.requireScope
])(expr);
}
return toConstantDependency(parser, strCode)(expr);
});
parser.hooks.typeof
.for(key)
.tap(
PLUGIN_NAME,
withValueDependency(
key,
toConstantDependency(parser, JSON.stringify("object"))
)
);
};
walkDefinitions(definitions, "");
};
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_AUTO)
.tap(PLUGIN_NAME, handler);
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_DYNAMIC)
.tap(PLUGIN_NAME, handler);
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_ESM)
.tap(PLUGIN_NAME, handler);
/**
* Walk definitions
* @param {Record<string, CodeValue>} definitions Definitions map
* @param {string} prefix Prefix string
* @returns {void}
*/
const walkDefinitionsForValues = (definitions, prefix) => {
for (const key of Object.keys(definitions)) {
const code = definitions[key];
const version = /** @type {string} */ (toCacheVersion(code));
const name = VALUE_DEP_PREFIX + prefix + key;
mainHash.update(`|${prefix}${key}`);
const oldVersion = compilation.valueCacheVersions.get(name);
if (oldVersion === undefined) {
compilation.valueCacheVersions.set(name, version);
} else if (oldVersion !== version) {
const warning = new WebpackError(
`${PLUGIN_NAME}\nConflicting values for '${prefix + key}'`
);
warning.details = `'${oldVersion}' !== '${version}'`;
warning.hideStack = true;
compilation.warnings.push(warning);
}
if (
code &&
typeof code === "object" &&
!(code instanceof RuntimeValue) &&
!(code instanceof RegExp)
) {
walkDefinitionsForValues(
/** @type {Record<string, CodeValue>} */ (code),
`${prefix + key}.`
);
}
}
};
/**
* @param {Record<string, CodeValue>} definitions Definitions map
* @returns {void}
*/
const walkDefinitionsForKeys = (definitions) => {
/**
* @param {Map<string, Set<string>>} map Map
* @param {string} key key
* @param {string} value v
* @returns {void}
*/
const addToMap = (map, key, value) => {
if (map.has(key)) {
/** @type {Set<string>} */
(map.get(key)).add(value);
} else {
map.set(key, new Set([value]));
}
};
for (const key of Object.keys(definitions)) {
const code = definitions[key];
if (
!code ||
typeof code === "object" ||
TYPEOF_OPERATOR_REGEXP.test(key)
) {
continue;
}
const idx = key.lastIndexOf(".");
if (idx <= 0 || idx >= key.length - 1) {
continue;
}
const nested = key.slice(0, idx);
const final = key.slice(idx + 1);
addToMap(finalByNestedKey, nested, final);
addToMap(nestedByFinalKey, final, nested);
}
};
walkDefinitionsForKeys(definitions);
walkDefinitionsForValues(definitions, "");
compilation.valueCacheVersions.set(
VALUE_DEP_MAIN,
mainHash.digest("hex").slice(0, 8)
);
}
);
}
}
module.exports = DefinePlugin;

View File

@@ -0,0 +1,68 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0;
exports.globStreamSync = globStreamSync;
exports.globStream = globStream;
exports.globSync = globSync;
exports.globIterateSync = globIterateSync;
exports.globIterate = globIterate;
const minimatch_1 = require("minimatch");
const glob_js_1 = require("./glob.js");
const has_magic_js_1 = require("./has-magic.js");
var minimatch_2 = require("minimatch");
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } });
Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } });
var glob_js_2 = require("./glob.js");
Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } });
var has_magic_js_2 = require("./has-magic.js");
Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } });
var ignore_js_1 = require("./ignore.js");
Object.defineProperty(exports, "Ignore", { enumerable: true, get: function () { return ignore_js_1.Ignore; } });
function globStreamSync(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).streamSync();
}
function globStream(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).stream();
}
function globSync(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).walkSync();
}
async function glob_(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).walk();
}
function globIterateSync(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).iterateSync();
}
function globIterate(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).iterate();
}
// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
exports.streamSync = globStreamSync;
exports.stream = Object.assign(globStream, { sync: globStreamSync });
exports.iterateSync = globIterateSync;
exports.iterate = Object.assign(globIterate, {
sync: globIterateSync,
});
exports.sync = Object.assign(globSync, {
stream: globStreamSync,
iterate: globIterateSync,
});
exports.glob = Object.assign(glob_, {
glob: glob_,
globSync,
sync: exports.sync,
globStream,
stream: exports.stream,
globStreamSync,
streamSync: exports.streamSync,
globIterate,
iterate: exports.iterate,
globIterateSync,
iterateSync: exports.iterateSync,
Glob: glob_js_1.Glob,
hasMagic: has_magic_js_1.hasMagic,
escape: minimatch_1.escape,
unescape: minimatch_1.unescape,
});
exports.glob.glob = exports.glob;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,9 @@
interface Opts {
delimiter?: string;
object?: any;
overwrite?: boolean;
recursive?: boolean;
}
export declare const unflatten: (target: any, opts?: Opts) => any;
export {};
//# sourceMappingURL=unflatten.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/restoreVersion.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAChG,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAoBlD,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAA;AAEnD,eAAO,MAAM,uBAAuB,GAClC,KAAK,SAAS,UAAU,GAAG,UAAU,kCAE/B,SAAS,KACd,OAAO,CAAC,KAAK,CA+Uf,CAAA"}

View File

@@ -0,0 +1,704 @@
// Generated by dts-bundle-generator v9.5.1
export type MarkedToken = (Tokens.Space | Tokens.Code | Tokens.Heading | Tokens.Table | Tokens.Hr | Tokens.Blockquote | Tokens.List | Tokens.ListItem | Tokens.Paragraph | Tokens.HTML | Tokens.Text | Tokens.Def | Tokens.Escape | Tokens.Tag | Tokens.Image | Tokens.Link | Tokens.Strong | Tokens.Em | Tokens.Codespan | Tokens.Br | Tokens.Del);
export type Token = (MarkedToken | Tokens.Generic);
export declare namespace Tokens {
interface Space {
type: "space";
raw: string;
}
interface Code {
type: "code";
raw: string;
codeBlockStyle?: "indented" | undefined;
lang?: string | undefined;
text: string;
escaped?: boolean;
}
interface Heading {
type: "heading";
raw: string;
depth: number;
text: string;
tokens: Token[];
}
interface Table {
type: "table";
raw: string;
align: Array<"center" | "left" | "right" | null>;
header: TableCell[];
rows: TableCell[][];
}
interface TableRow {
text: string;
}
interface TableCell {
text: string;
tokens: Token[];
header: boolean;
align: "center" | "left" | "right" | null;
}
interface Hr {
type: "hr";
raw: string;
}
interface Blockquote {
type: "blockquote";
raw: string;
text: string;
tokens: Token[];
}
interface List {
type: "list";
raw: string;
ordered: boolean;
start: number | "";
loose: boolean;
items: ListItem[];
}
interface ListItem {
type: "list_item";
raw: string;
task: boolean;
checked?: boolean | undefined;
loose: boolean;
text: string;
tokens: Token[];
}
interface Checkbox {
checked: boolean;
}
interface Paragraph {
type: "paragraph";
raw: string;
pre?: boolean | undefined;
text: string;
tokens: Token[];
}
interface HTML {
type: "html";
raw: string;
pre: boolean;
text: string;
block: boolean;
}
interface Text {
type: "text";
raw: string;
text: string;
tokens?: Token[];
}
interface Def {
type: "def";
raw: string;
tag: string;
href: string;
title: string;
}
interface Escape {
type: "escape";
raw: string;
text: string;
}
interface Tag {
type: "text" | "html";
raw: string;
inLink: boolean;
inRawBlock: boolean;
text: string;
block: boolean;
}
interface Link {
type: "link";
raw: string;
href: string;
title?: string | null;
text: string;
tokens: Token[];
}
interface Image {
type: "image";
raw: string;
href: string;
title: string | null;
text: string;
}
interface Strong {
type: "strong";
raw: string;
text: string;
tokens: Token[];
}
interface Em {
type: "em";
raw: string;
text: string;
tokens: Token[];
}
interface Codespan {
type: "codespan";
raw: string;
text: string;
}
interface Br {
type: "br";
raw: string;
}
interface Del {
type: "del";
raw: string;
text: string;
tokens: Token[];
}
interface Generic {
[index: string]: any;
type: string;
raw: string;
tokens?: Token[] | undefined;
}
}
export type Links = Record<string, Pick<Tokens.Link | Tokens.Image, "href" | "title">>;
export type TokensList = Token[] & {
links: Links;
};
/**
* Renderer
*/
declare class _Renderer {
options: MarkedOptions;
parser: _Parser;
constructor(options?: MarkedOptions);
space(token: Tokens.Space): string;
code({ text, lang, escaped }: Tokens.Code): string;
blockquote({ tokens }: Tokens.Blockquote): string;
html({ text }: Tokens.HTML | Tokens.Tag): string;
heading({ tokens, depth }: Tokens.Heading): string;
hr(token: Tokens.Hr): string;
list(token: Tokens.List): string;
listitem(item: Tokens.ListItem): string;
checkbox({ checked }: Tokens.Checkbox): string;
paragraph({ tokens }: Tokens.Paragraph): string;
table(token: Tokens.Table): string;
tablerow({ text }: Tokens.TableRow): string;
tablecell(token: Tokens.TableCell): string;
/**
* span level renderer
*/
strong({ tokens }: Tokens.Strong): string;
em({ tokens }: Tokens.Em): string;
codespan({ text }: Tokens.Codespan): string;
br(token: Tokens.Br): string;
del({ tokens }: Tokens.Del): string;
link({ href, title, tokens }: Tokens.Link): string;
image({ href, title, text }: Tokens.Image): string;
text(token: Tokens.Text | Tokens.Escape | Tokens.Tag): string;
}
/**
* TextRenderer
* returns only the textual part of the token
*/
declare class _TextRenderer {
strong({ text }: Tokens.Strong): string;
em({ text }: Tokens.Em): string;
codespan({ text }: Tokens.Codespan): string;
del({ text }: Tokens.Del): string;
html({ text }: Tokens.HTML | Tokens.Tag): string;
text({ text }: Tokens.Text | Tokens.Escape | Tokens.Tag): string;
link({ text }: Tokens.Link): string;
image({ text }: Tokens.Image): string;
br(): string;
}
/**
* Parsing & Compiling
*/
declare class _Parser {
options: MarkedOptions;
renderer: _Renderer;
textRenderer: _TextRenderer;
constructor(options?: MarkedOptions);
/**
* Static Parse Method
*/
static parse(tokens: Token[], options?: MarkedOptions): string;
/**
* Static Parse Inline Method
*/
static parseInline(tokens: Token[], options?: MarkedOptions): string;
/**
* Parse Loop
*/
parse(tokens: Token[], top?: boolean): string;
/**
* Parse Inline Tokens
*/
parseInline(tokens: Token[], renderer?: _Renderer | _TextRenderer): string;
}
declare const blockNormal: {
blockquote: RegExp;
code: RegExp;
def: RegExp;
fences: RegExp;
heading: RegExp;
hr: RegExp;
html: RegExp;
lheading: RegExp;
list: RegExp;
newline: RegExp;
paragraph: RegExp;
table: RegExp;
text: RegExp;
};
export type BlockKeys = keyof typeof blockNormal;
declare const inlineNormal: {
_backpedal: RegExp;
anyPunctuation: RegExp;
autolink: RegExp;
blockSkip: RegExp;
br: RegExp;
code: RegExp;
del: RegExp;
emStrongLDelim: RegExp;
emStrongRDelimAst: RegExp;
emStrongRDelimUnd: RegExp;
escape: RegExp;
link: RegExp;
nolink: RegExp;
punctuation: RegExp;
reflink: RegExp;
reflinkSearch: RegExp;
tag: RegExp;
text: RegExp;
url: RegExp;
};
export type InlineKeys = keyof typeof inlineNormal;
/**
* exports
*/
export declare const block: {
normal: {
blockquote: RegExp;
code: RegExp;
def: RegExp;
fences: RegExp;
heading: RegExp;
hr: RegExp;
html: RegExp;
lheading: RegExp;
list: RegExp;
newline: RegExp;
paragraph: RegExp;
table: RegExp;
text: RegExp;
};
gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
};
export declare const inline: {
normal: {
_backpedal: RegExp;
anyPunctuation: RegExp;
autolink: RegExp;
blockSkip: RegExp;
br: RegExp;
code: RegExp;
del: RegExp;
emStrongLDelim: RegExp;
emStrongRDelimAst: RegExp;
emStrongRDelimUnd: RegExp;
escape: RegExp;
link: RegExp;
nolink: RegExp;
punctuation: RegExp;
reflink: RegExp;
reflinkSearch: RegExp;
tag: RegExp;
text: RegExp;
url: RegExp;
};
gfm: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
breaks: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
pedantic: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
};
export interface Rules {
block: Record<BlockKeys, RegExp>;
inline: Record<InlineKeys, RegExp>;
}
/**
* Tokenizer
*/
declare class _Tokenizer {
options: MarkedOptions;
rules: Rules;
lexer: _Lexer;
constructor(options?: MarkedOptions);
space(src: string): Tokens.Space | undefined;
code(src: string): Tokens.Code | undefined;
fences(src: string): Tokens.Code | undefined;
heading(src: string): Tokens.Heading | undefined;
hr(src: string): Tokens.Hr | undefined;
blockquote(src: string): Tokens.Blockquote | undefined;
list(src: string): Tokens.List | undefined;
html(src: string): Tokens.HTML | undefined;
def(src: string): Tokens.Def | undefined;
table(src: string): Tokens.Table | undefined;
lheading(src: string): Tokens.Heading | undefined;
paragraph(src: string): Tokens.Paragraph | undefined;
text(src: string): Tokens.Text | undefined;
escape(src: string): Tokens.Escape | undefined;
tag(src: string): Tokens.Tag | undefined;
link(src: string): Tokens.Link | Tokens.Image | undefined;
reflink(src: string, links: Links): Tokens.Link | Tokens.Image | Tokens.Text | undefined;
emStrong(src: string, maskedSrc: string, prevChar?: string): Tokens.Em | Tokens.Strong | undefined;
codespan(src: string): Tokens.Codespan | undefined;
br(src: string): Tokens.Br | undefined;
del(src: string): Tokens.Del | undefined;
autolink(src: string): Tokens.Link | undefined;
url(src: string): Tokens.Link | undefined;
inlineText(src: string): Tokens.Text | undefined;
}
declare class _Hooks {
options: MarkedOptions;
constructor(options?: MarkedOptions);
static passThroughHooks: Set<string>;
/**
* Process markdown before marked
*/
preprocess(markdown: string): string;
/**
* Process HTML after marked is finished
*/
postprocess(html: string): string;
/**
* Process all tokens before walk tokens
*/
processAllTokens(tokens: Token[] | TokensList): Token[] | TokensList;
}
export interface TokenizerThis {
lexer: _Lexer;
}
export type TokenizerExtensionFunction = (this: TokenizerThis, src: string, tokens: Token[] | TokensList) => Tokens.Generic | undefined;
export type TokenizerStartFunction = (this: TokenizerThis, src: string) => number | void;
export interface TokenizerExtension {
name: string;
level: "block" | "inline";
start?: TokenizerStartFunction | undefined;
tokenizer: TokenizerExtensionFunction;
childTokens?: string[] | undefined;
}
export interface RendererThis {
parser: _Parser;
}
export type RendererExtensionFunction = (this: RendererThis, token: Tokens.Generic) => string | false | undefined;
export interface RendererExtension {
name: string;
renderer: RendererExtensionFunction;
}
export type TokenizerAndRendererExtension = TokenizerExtension | RendererExtension | (TokenizerExtension & RendererExtension);
export type HooksApi = Omit<_Hooks, "constructor" | "options">;
export type HooksObject = {
[K in keyof HooksApi]?: (this: _Hooks, ...args: Parameters<HooksApi[K]>) => ReturnType<HooksApi[K]> | Promise<ReturnType<HooksApi[K]>>;
};
export type RendererApi = Omit<_Renderer, "constructor" | "options" | "parser">;
export type RendererObject = {
[K in keyof RendererApi]?: (this: _Renderer, ...args: Parameters<RendererApi[K]>) => ReturnType<RendererApi[K]> | false;
};
export type TokenizerApi = Omit<_Tokenizer, "constructor" | "options" | "rules" | "lexer">;
export type TokenizerObject = {
[K in keyof TokenizerApi]?: (this: _Tokenizer, ...args: Parameters<TokenizerApi[K]>) => ReturnType<TokenizerApi[K]> | false;
};
export interface MarkedExtension {
/**
* True will tell marked to await any walkTokens functions before parsing the tokens and returning an HTML string.
*/
async?: boolean;
/**
* Enable GFM line breaks. This option requires the gfm option to be true.
*/
breaks?: boolean | undefined;
/**
* Add tokenizers and renderers to marked
*/
extensions?: TokenizerAndRendererExtension[] | undefined | null;
/**
* Enable GitHub flavored markdown.
*/
gfm?: boolean | undefined;
/**
* Hooks are methods that hook into some part of marked.
* preprocess is called to process markdown before sending it to marked.
* processAllTokens is called with the TokensList before walkTokens.
* postprocess is called to process html after marked has finished parsing.
*/
hooks?: HooksObject | undefined | null;
/**
* Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
*/
pedantic?: boolean | undefined;
/**
* Type: object Default: new Renderer()
*
* An object containing functions to render tokens to HTML.
*/
renderer?: RendererObject | undefined | null;
/**
* Shows an HTML error message when rendering fails.
*/
silent?: boolean | undefined;
/**
* The tokenizer defines how to turn markdown text into tokens.
*/
tokenizer?: TokenizerObject | undefined | null;
/**
* The walkTokens function gets called with every token.
* Child tokens are called before moving on to sibling tokens.
* Each token is passed by reference so updates are persisted when passed to the parser.
* The return value of the function is ignored.
*/
walkTokens?: ((token: Token) => void | Promise<void>) | undefined | null;
}
export interface MarkedOptions extends Omit<MarkedExtension, "hooks" | "renderer" | "tokenizer" | "extensions" | "walkTokens"> {
/**
* Hooks are methods that hook into some part of marked.
*/
hooks?: _Hooks | undefined | null;
/**
* Type: object Default: new Renderer()
*
* An object containing functions to render tokens to HTML.
*/
renderer?: _Renderer | undefined | null;
/**
* The tokenizer defines how to turn markdown text into tokens.
*/
tokenizer?: _Tokenizer | undefined | null;
/**
* Custom extensions
*/
extensions?: null | {
renderers: {
[name: string]: RendererExtensionFunction;
};
childTokens: {
[name: string]: string[];
};
inline?: TokenizerExtensionFunction[];
block?: TokenizerExtensionFunction[];
startInline?: TokenizerStartFunction[];
startBlock?: TokenizerStartFunction[];
};
/**
* walkTokens function returns array of values for Promise.all
*/
walkTokens?: null | ((token: Token) => void | Promise<void> | (void | Promise<void>)[]);
}
/**
* Block Lexer
*/
declare class _Lexer {
tokens: TokensList;
options: MarkedOptions;
state: {
inLink: boolean;
inRawBlock: boolean;
top: boolean;
};
private tokenizer;
private inlineQueue;
constructor(options?: MarkedOptions);
/**
* Expose Rules
*/
static get rules(): {
block: {
normal: {
blockquote: RegExp;
code: RegExp;
def: RegExp;
fences: RegExp;
heading: RegExp;
hr: RegExp;
html: RegExp;
lheading: RegExp;
list: RegExp;
newline: RegExp;
paragraph: RegExp;
table: RegExp;
text: RegExp;
};
gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
};
inline: {
normal: {
_backpedal: RegExp;
anyPunctuation: RegExp;
autolink: RegExp;
blockSkip: RegExp;
br: RegExp;
code: RegExp;
del: RegExp;
emStrongLDelim: RegExp;
emStrongRDelimAst: RegExp;
emStrongRDelimUnd: RegExp;
escape: RegExp;
link: RegExp;
nolink: RegExp;
punctuation: RegExp;
reflink: RegExp;
reflinkSearch: RegExp;
tag: RegExp;
text: RegExp;
url: RegExp;
};
gfm: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
breaks: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
pedantic: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
};
};
/**
* Static Lex Method
*/
static lex(src: string, options?: MarkedOptions): TokensList;
/**
* Static Lex Inline Method
*/
static lexInline(src: string, options?: MarkedOptions): Token[];
/**
* Preprocessing
*/
lex(src: string): TokensList;
/**
* Lexing
*/
blockTokens(src: string, tokens?: Token[], lastParagraphClipped?: boolean): Token[];
blockTokens(src: string, tokens?: TokensList, lastParagraphClipped?: boolean): TokensList;
inline(src: string, tokens?: Token[]): Token[];
/**
* Lexing/Compiling
*/
inlineTokens(src: string, tokens?: Token[]): Token[];
}
/**
* Gets the original marked default options.
*/
declare function _getDefaults(): MarkedOptions;
declare let _defaults: MarkedOptions;
export type MaybePromise = void | Promise<void>;
export declare class Marked {
defaults: MarkedOptions;
options: (opt: MarkedOptions) => this;
parse: {
(src: string, options: MarkedOptions & {
async: true;
}): Promise<string>;
(src: string, options: MarkedOptions & {
async: false;
}): string;
(src: string, options?: MarkedOptions | undefined | null): string | Promise<string>;
};
parseInline: {
(src: string, options: MarkedOptions & {
async: true;
}): Promise<string>;
(src: string, options: MarkedOptions & {
async: false;
}): string;
(src: string, options?: MarkedOptions | undefined | null): string | Promise<string>;
};
Parser: typeof _Parser;
Renderer: typeof _Renderer;
TextRenderer: typeof _TextRenderer;
Lexer: typeof _Lexer;
Tokenizer: typeof _Tokenizer;
Hooks: typeof _Hooks;
constructor(...args: MarkedExtension[]);
/**
* Run callback for every token
*/
walkTokens(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]): MaybePromise[];
use(...args: MarkedExtension[]): this;
setOptions(opt: MarkedOptions): this;
lexer(src: string, options?: MarkedOptions): TokensList;
parser(tokens: Token[], options?: MarkedOptions): string;
private parseMarkdown;
private onError;
}
/**
* Compiles markdown to HTML asynchronously.
*
* @param src String of markdown source to be compiled
* @param options Hash of options, having async: true
* @return Promise of string of compiled HTML
*/
export declare function marked(src: string, options: MarkedOptions & {
async: true;
}): Promise<string>;
/**
* Compiles markdown to HTML.
*
* @param src String of markdown source to be compiled
* @param options Optional hash of options
* @return String of compiled HTML. Will be a Promise of string if async is set to true by any extensions.
*/
export declare function marked(src: string, options: MarkedOptions & {
async: false;
}): string;
export declare function marked(src: string, options: MarkedOptions & {
async: true;
}): Promise<string>;
export declare function marked(src: string, options?: MarkedOptions | undefined | null): string | Promise<string>;
export declare namespace marked {
var options: (options: MarkedOptions) => typeof marked;
var setOptions: (options: MarkedOptions) => typeof marked;
var getDefaults: typeof _getDefaults;
var defaults: MarkedOptions;
var use: (...args: MarkedExtension[]) => typeof marked;
var walkTokens: (tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) => MaybePromise[];
var parseInline: {
(src: string, options: MarkedOptions & {
async: true;
}): Promise<string>;
(src: string, options: MarkedOptions & {
async: false;
}): string;
(src: string, options?: MarkedOptions | undefined | null): string | Promise<string>;
};
var Parser: typeof _Parser;
var parser: typeof _Parser.parse;
var Renderer: typeof _Renderer;
var TextRenderer: typeof _TextRenderer;
var Lexer: typeof _Lexer;
var lexer: typeof _Lexer.lex;
var Tokenizer: typeof _Tokenizer;
var Hooks: typeof _Hooks;
var parse: typeof marked;
}
export declare const options: (options: MarkedOptions) => typeof marked;
export declare const setOptions: (options: MarkedOptions) => typeof marked;
export declare const use: (...args: MarkedExtension[]) => typeof marked;
export declare const walkTokens: (tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) => MaybePromise[];
export declare const parseInline: {
(src: string, options: MarkedOptions & {
async: true;
}): Promise<string>;
(src: string, options: MarkedOptions & {
async: false;
}): string;
(src: string, options?: MarkedOptions | undefined | null): string | Promise<string>;
};
export declare const parse: typeof marked;
export declare const parser: typeof _Parser.parse;
export declare const lexer: typeof _Lexer.lex;
export {
_Hooks as Hooks,
_Lexer as Lexer,
_Parser as Parser,
_Renderer as Renderer,
_TextRenderer as TextRenderer,
_Tokenizer as Tokenizer,
_defaults as defaults,
_getDefaults as getDefaults,
};
export {};

View File

@@ -0,0 +1 @@
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,YAAY,GAAG,oCAAoC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const PACKAGE_VERSION = '0.59.0';\nexport const PACKAGE_NAME = '@opentelemetry/instrumentation-koa';\n"]}

View File

@@ -0,0 +1,11 @@
import type { Locale } from "./types.js";
/**
* @category Locales
* @summary Croatian locale.
* @language Croatian
* @iso-639-2 hrv
* @author Matija Marohnić [@silvenon](https://github.com/silvenon)
* @author Manico [@manico](https://github.com/manico)
* @author Ivan Jeržabek [@jerzabek](https://github.com/jerzabek)
*/
export declare const hr: Locale;

View File

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

View File

@@ -0,0 +1,2 @@
const e=require(`../../utils/throw-if-empty.cjs`),t=e=>()=>({path:`/notifications`,params:e??{},method:`GET`}),n=(t,n)=>()=>(e.throwIfEmpty(String(t),`Key cannot be empty`),{path:`/notifications/${t}`,params:n??{},method:`GET`});exports.readNotification=n,exports.readNotifications=t;
//# sourceMappingURL=notifications.cjs.map

View File

@@ -0,0 +1,31 @@
"use strict";
exports.zhCN = void 0;
var _index = require("./zh-CN/_lib/formatDistance.js");
var _index2 = require("./zh-CN/_lib/formatLong.js");
var _index3 = require("./zh-CN/_lib/formatRelative.js");
var _index4 = require("./zh-CN/_lib/localize.js");
var _index5 = require("./zh-CN/_lib/match.js");
/**
* @category Locales
* @summary Chinese Simplified locale.
* @language Chinese Simplified
* @iso-639-2 zho
* @author Changyu Geng [@KingMario](https://github.com/KingMario)
* @author Song Shuoyun [@fnlctrl](https://github.com/fnlctrl)
* @author sabrinaM [@sabrinamiao](https://github.com/sabrinamiao)
* @author Carney Wu [@cubicwork](https://github.com/cubicwork)
* @author Terrence Lam [@skyuplam](https://github.com/skyuplam)
*/
const zhCN = (exports.zhCN = {
code: "zh-CN",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});

View File

@@ -0,0 +1,40 @@
(function (Prism) {
/**
* If the given language is present, it will insert the given doc comment grammar token into it.
*
* @param {string} lang
* @param {any} docComment
*/
function insertDocComment(lang, docComment) {
if (Prism.languages[lang]) {
Prism.languages.insertBefore(lang, 'comment', {
'doc-comment': docComment
});
}
}
var tag = Prism.languages.markup.tag;
var slashDocComment = {
pattern: /\/\/\/.*/,
greedy: true,
alias: 'comment',
inside: {
'tag': tag
}
};
var tickDocComment = {
pattern: /'''.*/,
greedy: true,
alias: 'comment',
inside: {
'tag': tag
}
};
insertDocComment('csharp', slashDocComment);
insertDocComment('fsharp', slashDocComment);
insertDocComment('vbnet', tickDocComment);
}(Prism));

View File

@@ -0,0 +1,118 @@
import type { WithCacheConfig } from "../../cache/core/types.cjs";
import { entityKind } from "../../entity.cjs";
import type { MySqlDialect } from "../dialect.cjs";
import type { AnyMySqlQueryResultHKT, MySqlPreparedQueryConfig, MySqlQueryResultHKT, MySqlQueryResultKind, MySqlSession, PreparedQueryHKTBase, PreparedQueryKind } from "../session.cjs";
import type { MySqlTable } from "../table.cjs";
import type { TypedQueryBuilder } from "../../query-builders/query-builder.cjs";
import { QueryPromise } from "../../query-promise.cjs";
import type { RunnableQuery } from "../../runnable-query.cjs";
import type { Placeholder, Query, SQLWrapper } from "../../sql/sql.cjs";
import { Param, SQL } from "../../sql/sql.cjs";
import type { InferModelFromColumns } from "../../table.cjs";
import type { AnyMySqlColumn } from "../columns/common.cjs";
import { QueryBuilder } from "./query-builder.cjs";
import type { SelectedFieldsOrdered } from "./select.types.cjs";
import type { MySqlUpdateSetSource } from "./update.cjs";
export interface MySqlInsertConfig<TTable extends MySqlTable = MySqlTable> {
table: TTable;
values: Record<string, Param | SQL>[] | MySqlInsertSelectQueryBuilder<TTable> | SQL;
ignore: boolean;
onConflict?: SQL;
returning?: SelectedFieldsOrdered;
select?: boolean;
}
export type AnyMySqlInsertConfig = MySqlInsertConfig<MySqlTable>;
export type MySqlInsertValue<TTable extends MySqlTable> = {
[Key in keyof TTable['$inferInsert']]: TTable['$inferInsert'][Key] | SQL | Placeholder;
} & {};
export type MySqlInsertSelectQueryBuilder<TTable extends MySqlTable> = TypedQueryBuilder<{
[K in keyof TTable['$inferInsert']]: AnyMySqlColumn | SQL | SQL.Aliased | TTable['$inferInsert'][K];
}>;
export declare class MySqlInsertBuilder<TTable extends MySqlTable, TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase> {
private table;
private session;
private dialect;
static readonly [entityKind]: string;
private shouldIgnore;
constructor(table: TTable, session: MySqlSession, dialect: MySqlDialect);
ignore(): this;
values(value: MySqlInsertValue<TTable>): MySqlInsertBase<TTable, TQueryResult, TPreparedQueryHKT>;
values(values: MySqlInsertValue<TTable>[]): MySqlInsertBase<TTable, TQueryResult, TPreparedQueryHKT>;
select(selectQuery: (qb: QueryBuilder) => MySqlInsertSelectQueryBuilder<TTable>): MySqlInsertBase<TTable, TQueryResult, TPreparedQueryHKT>;
select(selectQuery: (qb: QueryBuilder) => SQL): MySqlInsertBase<TTable, TQueryResult, TPreparedQueryHKT>;
select(selectQuery: SQL): MySqlInsertBase<TTable, TQueryResult, TPreparedQueryHKT>;
select(selectQuery: MySqlInsertSelectQueryBuilder<TTable>): MySqlInsertBase<TTable, TQueryResult, TPreparedQueryHKT>;
}
export type MySqlInsertWithout<T extends AnyMySqlInsert, TDynamic extends boolean, K extends keyof T & string> = TDynamic extends true ? T : Omit<MySqlInsertBase<T['_']['table'], T['_']['queryResult'], T['_']['preparedQueryHKT'], T['_']['returning'], TDynamic, T['_']['excludedMethods'] | '$returning'>, T['_']['excludedMethods'] | K>;
export type MySqlInsertDynamic<T extends AnyMySqlInsert> = MySqlInsert<T['_']['table'], T['_']['queryResult'], T['_']['preparedQueryHKT'], T['_']['returning']>;
export type MySqlInsertPrepare<T extends AnyMySqlInsert, TReturning extends Record<string, unknown> | undefined = undefined> = PreparedQueryKind<T['_']['preparedQueryHKT'], MySqlPreparedQueryConfig & {
execute: TReturning extends undefined ? MySqlQueryResultKind<T['_']['queryResult'], never> : TReturning[];
iterator: never;
}, true>;
export type MySqlInsertOnDuplicateKeyUpdateConfig<T extends AnyMySqlInsert> = {
set: MySqlUpdateSetSource<T['_']['table']>;
};
export type MySqlInsert<TTable extends MySqlTable = MySqlTable, TQueryResult extends MySqlQueryResultHKT = AnyMySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase = PreparedQueryHKTBase, TReturning extends Record<string, unknown> | undefined = Record<string, unknown> | undefined> = MySqlInsertBase<TTable, TQueryResult, TPreparedQueryHKT, TReturning, true, never>;
export type MySqlInsertReturning<T extends AnyMySqlInsert, TDynamic extends boolean> = MySqlInsertBase<T['_']['table'], T['_']['queryResult'], T['_']['preparedQueryHKT'], InferModelFromColumns<GetPrimarySerialOrDefaultKeys<T['_']['table']['_']['columns']>>, TDynamic, T['_']['excludedMethods'] | '$returning'>;
export type AnyMySqlInsert = MySqlInsertBase<any, any, any, any, any, any>;
export interface MySqlInsertBase<TTable extends MySqlTable, TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TReturning extends Record<string, unknown> | undefined = undefined, TDynamic extends boolean = false, TExcludedMethods extends string = never> extends QueryPromise<TReturning extends undefined ? MySqlQueryResultKind<TQueryResult, never> : TReturning[]>, RunnableQuery<TReturning extends undefined ? MySqlQueryResultKind<TQueryResult, never> : TReturning[], 'mysql'>, SQLWrapper {
readonly _: {
readonly dialect: 'mysql';
readonly table: TTable;
readonly queryResult: TQueryResult;
readonly preparedQueryHKT: TPreparedQueryHKT;
readonly dynamic: TDynamic;
readonly excludedMethods: TExcludedMethods;
readonly returning: TReturning;
readonly result: TReturning extends undefined ? MySqlQueryResultKind<TQueryResult, never> : TReturning[];
};
}
export type PrimaryKeyKeys<T extends Record<string, AnyMySqlColumn>> = {
[K in keyof T]: T[K]['_']['isPrimaryKey'] extends true ? T[K]['_']['isAutoincrement'] extends true ? K : T[K]['_']['hasRuntimeDefault'] extends true ? T[K]['_']['isPrimaryKey'] extends true ? K : never : never : T[K]['_']['hasRuntimeDefault'] extends true ? T[K]['_']['isPrimaryKey'] extends true ? K : never : never;
}[keyof T];
export type GetPrimarySerialOrDefaultKeys<T extends Record<string, AnyMySqlColumn>> = {
[K in PrimaryKeyKeys<T>]: T[K];
};
export declare class MySqlInsertBase<TTable extends MySqlTable, TQueryResult extends MySqlQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TReturning extends Record<string, unknown> | undefined = undefined, TDynamic extends boolean = false, TExcludedMethods extends string = never> extends QueryPromise<TReturning extends undefined ? MySqlQueryResultKind<TQueryResult, never> : TReturning[]> implements RunnableQuery<TReturning extends undefined ? MySqlQueryResultKind<TQueryResult, never> : TReturning[], 'mysql'>, SQLWrapper {
private session;
private dialect;
static readonly [entityKind]: string;
protected $table: TTable;
private config;
protected cacheConfig?: WithCacheConfig;
constructor(table: TTable, values: MySqlInsertConfig['values'], ignore: boolean, session: MySqlSession, dialect: MySqlDialect, select?: boolean);
/**
* Adds an `on duplicate key update` clause to the query.
*
* Calling this method will update the row if any unique index conflicts. MySQL will automatically determine the conflict target based on the primary key and unique indexes.
*
* See docs: {@link https://orm.drizzle.team/docs/insert#on-duplicate-key-update}
*
* @param config The `set` clause
*
* @example
* ```ts
* await db.insert(cars)
* .values({ id: 1, brand: 'BMW'})
* .onDuplicateKeyUpdate({ set: { brand: 'Porsche' }});
* ```
*
* While MySQL does not directly support doing nothing on conflict, you can perform a no-op by setting any column's value to itself and achieve the same effect:
*
* ```ts
* import { sql } from 'drizzle-orm';
*
* await db.insert(cars)
* .values({ id: 1, brand: 'BMW' })
* .onDuplicateKeyUpdate({ set: { id: sql`id` } });
* ```
*/
onDuplicateKeyUpdate(config: MySqlInsertOnDuplicateKeyUpdateConfig<this>): MySqlInsertWithout<this, TDynamic, 'onDuplicateKeyUpdate'>;
$returningId(): MySqlInsertWithout<MySqlInsertReturning<this, TDynamic>, TDynamic, '$returningId'>;
toSQL(): Query;
prepare(): MySqlInsertPrepare<this, TReturning>;
execute: ReturnType<this['prepare']>['execute'];
private createIterator;
iterator: ReturnType<this["prepare"]>["iterator"];
$dynamic(): MySqlInsertDynamic<this>;
}

View File

@@ -0,0 +1,46 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Hook = require("./Hook");
const HookCodeFactory = require("./HookCodeFactory");
class SyncHookCodeFactory extends HookCodeFactory {
content({ onError, onDone, rethrowIfPossible }) {
return this.callTapsSeries({
onError: (i, err) => onError(err),
onDone,
rethrowIfPossible
});
}
}
const factory = new SyncHookCodeFactory();
const TAP_ASYNC = () => {
throw new Error("tapAsync is not supported on a SyncHook");
};
const TAP_PROMISE = () => {
throw new Error("tapPromise is not supported on a SyncHook");
};
function COMPILE(options) {
factory.setup(this, options);
return factory.create(options);
}
function SyncHook(args = [], name = undefined) {
const hook = new Hook(args, name);
hook.constructor = SyncHook;
hook.tapAsync = TAP_ASYNC;
hook.tapPromise = TAP_PROMISE;
hook.compile = COMPILE;
return hook;
}
SyncHook.prototype = null;
module.exports = SyncHook;

View File

@@ -0,0 +1,72 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const EntryDependency = require("./dependencies/EntryDependency");
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./Entrypoint").EntryOptions} EntryOptions */
const PLUGIN_NAME = "EntryPlugin";
class EntryPlugin {
/**
* An entry plugin which will handle creation of the EntryDependency
* @param {string} context context path
* @param {string} entry entry path
* @param {EntryOptions | string=} options entry options (passing a string is deprecated)
*/
constructor(context, entry, options) {
this.context = context;
this.entry = entry;
this.options = options || "";
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
compilation.dependencyFactories.set(
EntryDependency,
normalModuleFactory
);
}
);
const { entry, options, context } = this;
const dep = EntryPlugin.createDependency(entry, options);
compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation, callback) => {
compilation.addEntry(context, dep, options, (err) => {
callback(err);
});
});
}
/**
* @param {string} entry entry request
* @param {EntryOptions | string} options entry options (passing string is deprecated)
* @returns {EntryDependency} the dependency
*/
static createDependency(entry, options) {
const dep = new EntryDependency(entry);
// TODO webpack 6 remove string option
dep.loc = {
name:
typeof options === "object"
? /** @type {string} */ (options.name)
: options
};
return dep;
}
}
module.exports = EntryPlugin;

View File

@@ -0,0 +1,40 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
var lexical = require('lexical');
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/**
* Generates a headless editor that allows lexical to be used without the need for a DOM, eg in Node.js.
* Throws an error when unsupported methods are used.
* @param editorConfig - The optional lexical editor configuration.
* @returns - The configured headless editor.
*/
function createHeadlessEditor(editorConfig) {
const editor = lexical.createEditor(editorConfig);
editor._headless = true;
const unsupportedMethods = ['registerDecoratorListener', 'registerRootListener', 'registerMutationListener', 'getRootElement', 'setRootElement', 'getElementByKey', 'focus', 'blur'];
unsupportedMethods.forEach(method => {
editor[method] = () => {
throw new Error(`${method} is not supported in headless mode`);
};
});
return editor;
}
exports.createHeadlessEditor = createHeadlessEditor;

View File

@@ -0,0 +1,89 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
Hr: () => Hr
});
module.exports = __toCommonJS(src_exports);
// src/hr.tsx
var React = __toESM(require("react"));
var import_jsx_runtime = require("react/jsx-runtime");
var Hr = React.forwardRef(
(_a, ref) => {
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"hr",
__spreadProps(__spreadValues({}, props), {
ref,
style: __spreadValues({
width: "100%",
border: "none",
borderTop: "1px solid #eaeaea"
}, style)
})
);
}
);
Hr.displayName = "Hr";
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Hr
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","React","useState","CopyIcon","useTranslation","Tooltip","baseClass","CopyToClipboard","t0","$","defaultMessage","successMessage","value","copied","setCopied","hovered","setHovered","t","t1","navigator","clipboard","writeText","t2","t3","Symbol","for","t4","_jsxs","className","onClick","onMouseEnter","onMouseLeave","type","children","_jsx","delay","undefined","show"],"sources":["../../../src/elements/CopyToClipboard/index.tsx"],"sourcesContent":["'use client'\nimport React, { useState } from 'react'\n\nimport { CopyIcon } from '../../icons/Copy/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { Tooltip } from '../Tooltip/index.js'\nimport './index.scss'\n\nconst baseClass = 'copy-to-clipboard'\n\nexport type Props = {\n defaultMessage?: string\n successMessage?: string\n value?: string\n}\n\nexport const CopyToClipboard: React.FC<Props> = ({ defaultMessage, successMessage, value }) => {\n const [copied, setCopied] = useState(false)\n const [hovered, setHovered] = useState(false)\n const { t } = useTranslation()\n\n if (value) {\n return (\n <button\n className={baseClass}\n onClick={async () => {\n await navigator.clipboard.writeText(value)\n setCopied(true)\n }}\n onMouseEnter={() => {\n setHovered(true)\n setCopied(false)\n }}\n onMouseLeave={() => {\n setHovered(false)\n setCopied(false)\n }}\n type=\"button\"\n >\n <CopyIcon />\n <Tooltip delay={copied ? 0 : undefined} show={hovered || copied}>\n {copied && (successMessage ?? t('general:copied'))}\n {!copied && (defaultMessage ?? t('general:copy'))}\n </Tooltip>\n </button>\n )\n }\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,IAASC,QAAQ,QAAQ;AAEhC,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,SAASC,OAAO,QAAQ;AACxB,OAAO;AAEP,MAAMC,SAAA,GAAY;AAQlB,OAAO,MAAMC,eAAA,GAAmCC,EAAA;EAAA,MAAAC,CAAA,GAAAT,EAAA;EAAC;IAAAU,cAAA;IAAAC,cAAA;IAAAC;EAAA,IAAAJ,EAAyC;EACxF,OAAAK,MAAA,EAAAC,SAAA,IAA4BZ,QAAA,MAAS;EACrC,OAAAa,OAAA,EAAAC,UAAA,IAA8Bd,QAAA,MAAS;EACvC;IAAAe;EAAA,IAAcb,cAAA;EAAA,IAEVQ,KAAA;IAAA,IAAAM,EAAA;IAAA,IAAAT,CAAA,QAAAG,KAAA;MAIWM,EAAA,SAAAA,CAAA;QAAA,MACDC,SAAA,CAAAC,SAAA,CAAAC,SAAA,CAA8BT,KAAA;QACpCE,SAAA,KAAU;MAAA;MACZL,CAAA,MAAAG,KAAA;MAAAH,CAAA,MAAAS,EAAA;IAAA;MAAAA,EAAA,GAAAT,CAAA;IAAA;IAAA,IAAAa,EAAA;IAAA,IAAAC,EAAA;IAAA,IAAAd,CAAA,QAAAe,MAAA,CAAAC,GAAA;MACcH,EAAA,GAAAA,CAAA;QACZN,UAAA,KAAW;QACXF,SAAA,MAAU;MAAA;MAEES,EAAA,GAAAA,CAAA;QACZP,UAAA,MAAW;QACXF,SAAA,MAAU;MAAA;MACZL,CAAA,MAAAa,EAAA;MAAAb,CAAA,MAAAc,EAAA;IAAA;MAAAD,EAAA,GAAAb,CAAA;MAAAc,EAAA,GAAAd,CAAA;IAAA;IAAA,IAAAiB,EAAA;IAAA,IAAAjB,CAAA,QAAAI,MAAA,IAAAJ,CAAA,QAAAC,cAAA,IAAAD,CAAA,QAAAM,OAAA,IAAAN,CAAA,QAAAE,cAAA,IAAAF,CAAA,QAAAQ,CAAA,IAAAR,CAAA,QAAAS,EAAA;MAbFQ,EAAA,GAAAC,KAAA,CAAC;QAAAC,SAAA,EAAAtB,SAAA;QAAAuB,OAAA,EAEUX,EAGT;QAAAY,YAAA,EACcR,EAGd;QAAAS,YAAA,EACcR,EAGd;QAAAS,IAAA,EACK;QAAAC,QAAA,GAELC,IAAA,CAAA/B,QAAA,IAAC,GACDwB,KAAA,CAAAtB,OAAA;UAAA8B,KAAA,EAAgBtB,MAAA,OAAAuB,SAAa;UAAAC,IAAA,EAAiBtB,OAAA,IAAWF,MAAA;UAAAoB,QAAA,GACtDpB,MAAA,KAAWF,cAAA,IAAkBM,CAAA,CAAE,iBAAgB,GAC/C,CAACJ,MAAA,KAAWH,cAAA,IAAkBO,CAAA,CAAE,eAAc;QAAA,C;;;;;;;;;;;;WAnBnDS,E;;;CA0BN","ignoreList":[]}

View File

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

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