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,37 @@
/*
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 AsyncSeriesLoopHookCodeFactory extends HookCodeFactory {
content({ onError, onDone }) {
return this.callTapsLooping({
onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true),
onDone
});
}
}
const factory = new AsyncSeriesLoopHookCodeFactory();
function COMPILE(options) {
factory.setup(this, options);
return factory.create(options);
}
function AsyncSeriesLoopHook(args = [], name = undefined) {
const hook = new Hook(args, name);
hook.constructor = AsyncSeriesLoopHook;
hook.compile = COMPILE;
hook._call = undefined;
hook.call = undefined;
return hook;
}
AsyncSeriesLoopHook.prototype = null;
module.exports = AsyncSeriesLoopHook;

View File

@@ -0,0 +1,33 @@
import type { FormState } from 'payload';
/**
* If true, will accept all values from the server, overriding any current values in local state.
* Can also provide an options object for more granular control.
*/
export type AcceptValues = {
/**
* When `false`, will accept the values from the server _UNLESS_ the value has been modified locally since the request was made.
* This is useful for autosave, for example, where hooks may have modified the field's value on the server while you were still making changes.
* @default undefined
*/
overrideLocalChanges?: boolean;
} | boolean;
type Args = {
acceptValues?: AcceptValues;
currentState?: FormState;
incomingState: FormState;
};
/**
* This function receives form state from the server and intelligently merges it into the client state.
* The server contains extra properties that the client may not have, e.g. custom components and error states.
* We typically do not want to merge properties that rely on user input, however, such as values, unless explicitly requested.
* Doing this would cause the client to lose any local changes to those fields.
*
* Note: Local state is the source of truth, not the new server state that is getting merged in. This is critical for array row
* manipulation specifically, where the user may have added, removed, or reordered rows while a request was pending and is now stale.
*
* This function applies some defaults, as well as cleans up the server response in preparation for the client.
* e.g. it will set `valid` and `passesCondition` to true if undefined, and remove `addedByServer` from the response.
*/
export declare const mergeServerFormState: ({ acceptValues, currentState, incomingState, }: Args) => FormState;
export {};
//# sourceMappingURL=mergeServerFormState.d.ts.map

View File

@@ -0,0 +1,170 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const browser = require('@sentry/browser');
const core = require('@sentry/core');
const React = require('react');
const debugBuild = require('./debug-build.js');
const error = require('./error.js');
const hoistNonReactStatics = require('./hoist-non-react-statics.js');
const UNKNOWN_COMPONENT = 'unknown';
const INITIAL_STATE = {
componentStack: null,
error: null,
eventId: null,
};
/**
* A ErrorBoundary component that logs errors to Sentry.
* NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the
* Sentry React SDK ErrorBoundary caught an error invoking your application code. This
* is expected behavior and NOT indicative of a bug with the Sentry React SDK.
*/
class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = INITIAL_STATE;
this._openFallbackReportDialog = true;
const client = browser.getClient();
if (client && props.showDialog) {
this._openFallbackReportDialog = false;
this._cleanupHook = client.on('afterSendEvent', event => {
if (!event.type && this._lastEventId && event.event_id === this._lastEventId) {
browser.showReportDialog({ ...props.dialogOptions, eventId: this._lastEventId });
}
});
}
}
componentDidCatch(error$1, errorInfo) {
const { componentStack } = errorInfo;
const { beforeCapture, onError, showDialog, dialogOptions } = this.props;
browser.withScope(scope => {
if (beforeCapture) {
beforeCapture(scope, error$1, componentStack);
}
const handled = this.props.handled != null ? this.props.handled : !!this.props.fallback;
const eventId = error.captureReactException(error$1, errorInfo, {
mechanism: { handled, type: 'auto.function.react.error_boundary' },
});
if (onError) {
onError(error$1, componentStack, eventId);
}
if (showDialog) {
this._lastEventId = eventId;
if (this._openFallbackReportDialog) {
browser.showReportDialog({ ...dialogOptions, eventId });
}
}
// componentDidCatch is used over getDerivedStateFromError
// so that componentStack is accessible through state.
this.setState({ error: error$1, componentStack, eventId });
});
}
componentDidMount() {
const { onMount } = this.props;
if (onMount) {
onMount();
}
}
componentWillUnmount() {
const { error, componentStack, eventId } = this.state;
const { onUnmount } = this.props;
if (onUnmount) {
if (this.state === INITIAL_STATE) {
// If the error boundary never encountered an error, call onUnmount with null values
onUnmount(null, null, null);
} else {
// `componentStack` and `eventId` are guaranteed to be non-null here because `onUnmount` is only called
// when the error boundary has already encountered an error.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
onUnmount(error, componentStack, eventId);
}
}
if (this._cleanupHook) {
this._cleanupHook();
this._cleanupHook = undefined;
}
}
resetErrorBoundary() {
const { onReset } = this.props;
const { error, componentStack, eventId } = this.state;
if (onReset) {
// `componentStack` and `eventId` are guaranteed to be non-null here because `onReset` is only called
// when the error boundary has already encountered an error.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
onReset(error, componentStack, eventId);
}
this.setState(INITIAL_STATE);
}
render() {
const { fallback, children } = this.props;
const state = this.state;
// `componentStack` is only null in the initial state, when no error has been captured.
// If an error has been captured, `componentStack` will be a string.
// We cannot check `state.error` because null can be thrown as an error.
if (state.componentStack === null) {
return typeof children === 'function' ? children() : children;
}
const element =
typeof fallback === 'function'
? React.createElement(fallback, {
error: state.error,
componentStack: state.componentStack,
resetError: () => this.resetErrorBoundary(),
eventId: state.eventId,
})
: fallback;
if (React.isValidElement(element)) {
return element;
}
if (fallback) {
debugBuild.DEBUG_BUILD && core.debug.warn('fallback did not produce a valid ReactElement');
}
// Fail gracefully if no fallback provided or is not valid
return null;
}
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function withErrorBoundary(
WrappedComponent,
errorBoundaryOptions,
) {
const componentDisplayName = WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;
const Wrapped = React.memo((props) => (
React.createElement(ErrorBoundary, { ...errorBoundaryOptions,}
, React.createElement(WrappedComponent, { ...props,} )
)
)) ;
Wrapped.displayName = `errorBoundary(${componentDisplayName})`;
// Copy over static methods from Wrapped component to Profiler HOC
// See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over
hoistNonReactStatics.hoistNonReactStatics(Wrapped, WrappedComponent);
return Wrapped;
}
exports.ErrorBoundary = ErrorBoundary;
exports.UNKNOWN_COMPONENT = UNKNOWN_COMPONENT;
exports.withErrorBoundary = withErrorBoundary;
//# sourceMappingURL=errorboundary.js.map

View File

@@ -0,0 +1,9 @@
import { Decimal } from "decimal.js";
import { type RawNumberFormatResult, type UnsignedRoundingModeType } from "../types/number.js";
/**
* https://tc39.es/ecma402/#sec-torawfixed
* @param x a finite non-negative Number or BigInt
* @param minFraction an integer between 0 and 20
* @param maxFraction an integer between 0 and 20
*/
export declare function ToRawFixed(x: Decimal, minFraction: number, maxFraction: number, roundingIncrement: number, unsignedRoundingMode: UnsignedRoundingModeType): RawNumberFormatResult;

View File

@@ -0,0 +1,319 @@
/**
* OpenAI Integration Telemetry Attributes
* Based on OpenTelemetry Semantic Conventions for Generative AI
* @see https://opentelemetry.io/docs/specs/semconv/gen-ai/
*/
// =============================================================================
// OPENTELEMETRY SEMANTIC CONVENTIONS FOR GENAI
// =============================================================================
/**
* The input messages sent to the model
*/
const GEN_AI_PROMPT_ATTRIBUTE = 'gen_ai.prompt';
/**
* The Generative AI system being used
* For OpenAI, this should always be "openai"
*/
const GEN_AI_SYSTEM_ATTRIBUTE = 'gen_ai.system';
/**
* The name of the model as requested
* Examples: "gpt-4", "gpt-3.5-turbo"
*/
const GEN_AI_REQUEST_MODEL_ATTRIBUTE = 'gen_ai.request.model';
/**
* Whether streaming was enabled for the request
*/
const GEN_AI_REQUEST_STREAM_ATTRIBUTE = 'gen_ai.request.stream';
/**
* The temperature setting for the model request
*/
const GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE = 'gen_ai.request.temperature';
/**
* The maximum number of tokens requested
*/
const GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE = 'gen_ai.request.max_tokens';
/**
* The frequency penalty setting for the model request
*/
const GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE = 'gen_ai.request.frequency_penalty';
/**
* The presence penalty setting for the model request
*/
const GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE = 'gen_ai.request.presence_penalty';
/**
* The top_p (nucleus sampling) setting for the model request
*/
const GEN_AI_REQUEST_TOP_P_ATTRIBUTE = 'gen_ai.request.top_p';
/**
* The top_k setting for the model request
*/
const GEN_AI_REQUEST_TOP_K_ATTRIBUTE = 'gen_ai.request.top_k';
/**
* The encoding format for the model request
*/
const GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE = 'gen_ai.request.encoding_format';
/**
* The dimensions for the model request
*/
const GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE = 'gen_ai.request.dimensions';
/**
* Array of reasons why the model stopped generating tokens
*/
const GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE = 'gen_ai.response.finish_reasons';
/**
* The name of the model that generated the response
*/
const GEN_AI_RESPONSE_MODEL_ATTRIBUTE = 'gen_ai.response.model';
/**
* The unique identifier for the response
*/
const GEN_AI_RESPONSE_ID_ATTRIBUTE = 'gen_ai.response.id';
/**
* The reason why the model stopped generating tokens
*/
const GEN_AI_RESPONSE_STOP_REASON_ATTRIBUTE = 'gen_ai.response.stop_reason';
/**
* The number of tokens used in the prompt
*/
const GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE = 'gen_ai.usage.input_tokens';
/**
* The number of tokens used in the response
*/
const GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE = 'gen_ai.usage.output_tokens';
/**
* The total number of tokens used (input + output)
*/
const GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE = 'gen_ai.usage.total_tokens';
/**
* The operation name
*/
const GEN_AI_OPERATION_NAME_ATTRIBUTE = 'gen_ai.operation.name';
/**
* Original length of messages array, used to indicate truncations had occured
*/
const GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE = 'sentry.sdk_meta.gen_ai.input.messages.original_length';
/**
* The prompt messages
* Only recorded when recordInputs is enabled
*/
const GEN_AI_INPUT_MESSAGES_ATTRIBUTE = 'gen_ai.input.messages';
/**
* The system instructions extracted from system messages
* Only recorded when recordInputs is enabled
* According to OpenTelemetry spec: https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/#gen-ai-system-instructions
*/
const GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE = 'gen_ai.system_instructions';
/**
* The response text
* Only recorded when recordOutputs is enabled
*/
const GEN_AI_RESPONSE_TEXT_ATTRIBUTE = 'gen_ai.response.text';
/**
* The available tools from incoming request
* Only recorded when recordInputs is enabled
*/
const GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE = 'gen_ai.request.available_tools';
/**
* Whether the response is a streaming response
*/
const GEN_AI_RESPONSE_STREAMING_ATTRIBUTE = 'gen_ai.response.streaming';
/**
* The tool calls from the response
* Only recorded when recordOutputs is enabled
*/
const GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE = 'gen_ai.response.tool_calls';
/**
* The agent name
*/
const GEN_AI_AGENT_NAME_ATTRIBUTE = 'gen_ai.agent.name';
/**
* The pipeline name
*/
const GEN_AI_PIPELINE_NAME_ATTRIBUTE = 'gen_ai.pipeline.name';
/**
* The conversation ID for linking messages across API calls
* For OpenAI Assistants API: thread_id
* For LangGraph: configurable.thread_id
*/
const GEN_AI_CONVERSATION_ID_ATTRIBUTE = 'gen_ai.conversation.id';
/**
* The number of cache creation input tokens used
*/
const GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_ATTRIBUTE = 'gen_ai.usage.cache_creation_input_tokens';
/**
* The number of cache read input tokens used
*/
const GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_ATTRIBUTE = 'gen_ai.usage.cache_read_input_tokens';
/**
* The number of cache write input tokens used
*/
const GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE = 'gen_ai.usage.input_tokens.cache_write';
/**
* The number of cached input tokens that were used
*/
const GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE = 'gen_ai.usage.input_tokens.cached';
/**
* The span operation name for invoking an agent
*/
const GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE = 'gen_ai.invoke_agent';
/**
* The span operation name for generating text
*/
const GEN_AI_GENERATE_TEXT_DO_GENERATE_OPERATION_ATTRIBUTE = 'gen_ai.generate_text';
/**
* The span operation name for streaming text
*/
const GEN_AI_STREAM_TEXT_DO_STREAM_OPERATION_ATTRIBUTE = 'gen_ai.stream_text';
/**
* The span operation name for generating object
*/
const GEN_AI_GENERATE_OBJECT_DO_GENERATE_OPERATION_ATTRIBUTE = 'gen_ai.generate_object';
/**
* The span operation name for streaming object
*/
const GEN_AI_STREAM_OBJECT_DO_STREAM_OPERATION_ATTRIBUTE = 'gen_ai.stream_object';
/**
* The embeddings input
* Only recorded when recordInputs is enabled
*/
const GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE = 'gen_ai.embeddings.input';
/**
* The span operation name for embedding
*/
const GEN_AI_EMBED_DO_EMBED_OPERATION_ATTRIBUTE = 'gen_ai.embed';
/**
* The span operation name for embedding many
*/
const GEN_AI_EMBED_MANY_DO_EMBED_OPERATION_ATTRIBUTE = 'gen_ai.embed_many';
/**
* The span operation name for reranking
*/
const GEN_AI_RERANK_DO_RERANK_OPERATION_ATTRIBUTE = 'gen_ai.rerank';
/**
* The span operation name for executing a tool
*/
const GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE = 'gen_ai.execute_tool';
/**
* The tool name for tool call spans
*/
const GEN_AI_TOOL_NAME_ATTRIBUTE = 'gen_ai.tool.name';
/**
* The tool call ID
*/
const GEN_AI_TOOL_CALL_ID_ATTRIBUTE = 'gen_ai.tool.call.id';
/**
* The tool type (e.g., 'function')
*/
const GEN_AI_TOOL_TYPE_ATTRIBUTE = 'gen_ai.tool.type';
/**
* The tool input/arguments
*/
const GEN_AI_TOOL_INPUT_ATTRIBUTE = 'gen_ai.tool.input';
/**
* The tool output/result
*/
const GEN_AI_TOOL_OUTPUT_ATTRIBUTE = 'gen_ai.tool.output';
// =============================================================================
// OPENAI-SPECIFIC ATTRIBUTES
// =============================================================================
/**
* The response ID from OpenAI
*/
const OPENAI_RESPONSE_ID_ATTRIBUTE = 'openai.response.id';
/**
* The response model from OpenAI
*/
const OPENAI_RESPONSE_MODEL_ATTRIBUTE = 'openai.response.model';
/**
* The response timestamp from OpenAI (ISO string)
*/
const OPENAI_RESPONSE_TIMESTAMP_ATTRIBUTE = 'openai.response.timestamp';
/**
* The number of completion tokens used
*/
const OPENAI_USAGE_COMPLETION_TOKENS_ATTRIBUTE = 'openai.usage.completion_tokens';
/**
* The number of prompt tokens used
*/
const OPENAI_USAGE_PROMPT_TOKENS_ATTRIBUTE = 'openai.usage.prompt_tokens';
// =============================================================================
// OPENAI OPERATIONS
// =============================================================================
/**
* OpenAI API operations following OpenTelemetry semantic conventions
* @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#llm-request-spans
*/
const OPENAI_OPERATIONS = {
CHAT: 'chat',
EMBEDDINGS: 'embeddings',
} ;
// =============================================================================
// ANTHROPIC AI OPERATIONS
// =============================================================================
/**
* The response timestamp from Anthropic AI (ISO string)
*/
const ANTHROPIC_AI_RESPONSE_TIMESTAMP_ATTRIBUTE = 'anthropic.response.timestamp';
export { ANTHROPIC_AI_RESPONSE_TIMESTAMP_ATTRIBUTE, GEN_AI_AGENT_NAME_ATTRIBUTE, GEN_AI_CONVERSATION_ID_ATTRIBUTE, GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE, GEN_AI_EMBED_DO_EMBED_OPERATION_ATTRIBUTE, GEN_AI_EMBED_MANY_DO_EMBED_OPERATION_ATTRIBUTE, GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE, GEN_AI_GENERATE_OBJECT_DO_GENERATE_OPERATION_ATTRIBUTE, GEN_AI_GENERATE_TEXT_DO_GENERATE_OPERATION_ATTRIBUTE, GEN_AI_INPUT_MESSAGES_ATTRIBUTE, GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE, GEN_AI_OPERATION_NAME_ATTRIBUTE, GEN_AI_PIPELINE_NAME_ATTRIBUTE, GEN_AI_PROMPT_ATTRIBUTE, GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE, GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE, GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE, GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE, GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE, GEN_AI_REQUEST_MODEL_ATTRIBUTE, GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE, GEN_AI_REQUEST_STREAM_ATTRIBUTE, GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE, GEN_AI_REQUEST_TOP_K_ATTRIBUTE, GEN_AI_REQUEST_TOP_P_ATTRIBUTE, GEN_AI_RERANK_DO_RERANK_OPERATION_ATTRIBUTE, GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE, GEN_AI_RESPONSE_ID_ATTRIBUTE, GEN_AI_RESPONSE_MODEL_ATTRIBUTE, GEN_AI_RESPONSE_STOP_REASON_ATTRIBUTE, GEN_AI_RESPONSE_STREAMING_ATTRIBUTE, GEN_AI_RESPONSE_TEXT_ATTRIBUTE, GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, GEN_AI_STREAM_OBJECT_DO_STREAM_OPERATION_ATTRIBUTE, GEN_AI_STREAM_TEXT_DO_STREAM_OPERATION_ATTRIBUTE, GEN_AI_SYSTEM_ATTRIBUTE, GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE, GEN_AI_TOOL_CALL_ID_ATTRIBUTE, GEN_AI_TOOL_INPUT_ATTRIBUTE, GEN_AI_TOOL_NAME_ATTRIBUTE, GEN_AI_TOOL_OUTPUT_ATTRIBUTE, GEN_AI_TOOL_TYPE_ATTRIBUTE, GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_ATTRIBUTE, GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_ATTRIBUTE, GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE, GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE, GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE, GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE, GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE, OPENAI_OPERATIONS, OPENAI_RESPONSE_ID_ATTRIBUTE, OPENAI_RESPONSE_MODEL_ATTRIBUTE, OPENAI_RESPONSE_TIMESTAMP_ATTRIBUTE, OPENAI_USAGE_COMPLETION_TOKENS_ATTRIBUTE, OPENAI_USAGE_PROMPT_TOKENS_ATTRIBUTE };
//# sourceMappingURL=gen-ai-attributes.js.map

View File

@@ -0,0 +1,2 @@
import { GraphQLScalarType } from 'graphql';
export declare const GraphQLVoid: GraphQLScalarType<any, string>;

View File

@@ -0,0 +1,126 @@
import { toDate } from "./toDate.mjs";
/**
* The locale string (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
*/
/**
* The format options (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options)
*/
/**
* The locale options.
*/
/**
* @name intlFormat
* @category Common Helpers
* @summary Format the date with Intl.DateTimeFormat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat).
*
* @description
* Return the formatted date string in the given format.
* The method uses [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) inside.
* formatOptions are the same as [`Intl.DateTimeFormat` options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options)
*
* > ⚠️ Please note that before Node version 13.0.0, only the locale data for en-US is available by default.
*
* @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 format
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 4 October 2019 in middle-endian format:
* const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456))
* //=> 10/4/2019
*/
/**
* @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 format
* @param localeOptions - An object with locale
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 4 October 2019 in Korean.
* // Convert the date with locale's options.
* const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), {
* locale: 'ko-KR',
* })
* //=> 2019. 10. 4.
*/
/**
* @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 format
* @param formatOptions - The format options
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 4 October 2019.
* // Convert the date with format's options.
* const result = intlFormat.default(new Date(2019, 9, 4, 12, 30, 13, 456), {
* year: 'numeric',
* month: 'numeric',
* day: 'numeric',
* hour: 'numeric',
* })
* //=> 10/4/2019, 12 PM
*/
/**
* @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 format
* @param formatOptions - The format options
* @param localeOptions - An object with locale
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 4 October 2019 in German.
* // Convert the date with format's options and locale's options.
* const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), {
* weekday: 'long',
* year: 'numeric',
* month: 'long',
* day: 'numeric',
* }, {
* locale: 'de-DE',
* })
* //=> Freitag, 4. Oktober 2019
*/
export function intlFormat(date, formatOrLocale, localeOptions) {
let formatOptions;
if (isFormatOptions(formatOrLocale)) {
formatOptions = formatOrLocale;
} else {
localeOptions = formatOrLocale;
}
return new Intl.DateTimeFormat(localeOptions?.locale, formatOptions).format(
toDate(date),
);
}
function isFormatOptions(opts) {
return opts !== undefined && !("locale" in opts);
}
// Fallback for modularized imports:
export default intlFormat;

View File

@@ -0,0 +1,33 @@
import type { Breadcrumb, XhrBreadcrumbData } from '@sentry/core';
import type { NetworkMetaWarning, XhrHint } from '@sentry-internal/browser-utils';
import type { ReplayContainer, ReplayNetworkOptions } from '../../types';
/**
* Capture an XHR breadcrumb to a replay.
* This adds additional data (where appropriate).
*/
export declare function captureXhrBreadcrumbToReplay(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>, options: ReplayNetworkOptions & {
replay: ReplayContainer;
}): Promise<void>;
/**
* Enrich a breadcrumb with additional data.
* This has to be sync & mutate the given breadcrumb,
* as the breadcrumb is afterwards consumed by other handlers.
*/
export declare function enrichXhrBreadcrumb(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>): void;
/**
* Get the string representation of the XHR response.
* Based on MDN, these are the possible types of the response:
* string
* ArrayBuffer
* Blob
* Document
* POJO
*
* Exported only for tests.
*/
export declare function _parseXhrResponse(body: XMLHttpRequest['response'], responseType: XMLHttpRequest['responseType']): [string | undefined, NetworkMetaWarning?];
//# sourceMappingURL=xhrUtils.d.ts.map

View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_CONFIG = exports.EndOperation = void 0;
var EndOperation;
(function (EndOperation) {
EndOperation["AutoAck"] = "auto ack";
EndOperation["Ack"] = "ack";
EndOperation["AckAll"] = "ackAll";
EndOperation["Reject"] = "reject";
EndOperation["Nack"] = "nack";
EndOperation["NackAll"] = "nackAll";
EndOperation["ChannelClosed"] = "channel closed";
EndOperation["ChannelError"] = "channel error";
EndOperation["InstrumentationTimeout"] = "instrumentation timeout";
})(EndOperation = exports.EndOperation || (exports.EndOperation = {}));
exports.DEFAULT_CONFIG = {
consumeTimeoutMs: 1000 * 60,
useLinksForConsume: false,
};
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1,3 @@
import type { MigrationConfig } from "../migrator.js";
import type { PlanetScaleDatabase } from "./driver.js";
export declare function migrate<TSchema extends Record<string, unknown>>(db: PlanetScaleDatabase<TSchema>, config: MigrationConfig): Promise<void>;

View File

@@ -0,0 +1,40 @@
{
"name": "pluralize",
"version": "8.0.0",
"description": "Pluralize and singularize any word",
"main": "pluralize.js",
"files": [
"pluralize.js"
],
"scripts": {
"lint": "semistandard",
"test-spec": "mocha -R spec --bail",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec --bail",
"test": "npm run lint && npm run test-cov"
},
"repository": "https://github.com/blakeembrey/pluralize.git",
"keywords": [
"plural",
"plurals",
"pluralize",
"singular",
"singularize",
"inflection"
],
"author": {
"name": "Blake Embrey",
"email": "hello@blakeembrey.com",
"url": "http://blakeembrey.me"
},
"license": "MIT",
"readmeFilename": "Readme.md",
"engines": {
"node": ">=4"
},
"devDependencies": {
"chai": "^4.0.0",
"istanbul": "^0.4.5",
"mocha": "^5.0.0",
"semistandard": "^12.0.0"
}
}

View File

@@ -0,0 +1,5 @@
/**
* Decide if the currently running process is part of the build phase or happening at runtime.
*/
export declare function isBuild(): boolean;
//# sourceMappingURL=isBuild.d.ts.map

View File

@@ -0,0 +1,21 @@
var Hash = require('./_Hash'),
ListCache = require('./_ListCache'),
Map = require('./_Map');
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
module.exports = mapCacheClear;

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../src/index.client.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"split-square-horizontal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

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

View File

@@ -0,0 +1,99 @@
{
"name": "@floating-ui/react",
"version": "0.27.18",
"description": "Floating UI for React",
"publishConfig": {
"access": "public"
},
"main": "./dist/floating-ui.react.umd.js",
"module": "./dist/floating-ui.react.esm.js",
"unpkg": "./dist/floating-ui.react.umd.min.js",
"types": "./dist/floating-ui.react.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/floating-ui.react.d.mts",
"default": "./dist/floating-ui.react.mjs"
},
"types": "./dist/floating-ui.react.d.ts",
"module": "./dist/floating-ui.react.esm.js",
"default": "./dist/floating-ui.react.umd.js"
},
"./utils": {
"import": {
"types": "./dist/floating-ui.react.utils.d.mts",
"default": "./dist/floating-ui.react.utils.mjs"
},
"types": "./dist/floating-ui.react.utils.d.ts",
"module": "./dist/floating-ui.react.utils.esm.js",
"default": "./dist/floating-ui.react.utils.umd.js"
}
},
"sideEffects": false,
"files": [
"dist",
"utils"
],
"author": "atomiks",
"license": "MIT",
"bugs": "https://github.com/floating-ui/floating-ui",
"repository": {
"type": "git",
"url": "https://github.com/floating-ui/floating-ui.git",
"directory": "packages/react"
},
"homepage": "https://floating-ui.com/docs/react",
"keywords": [
"tooltip",
"popover",
"dropdown",
"menu",
"popup",
"positioning",
"react",
"react-dom"
],
"peerDependencies": {
"react": ">=17.0.0",
"react-dom": ">=17.0.0"
},
"dependencies": {
"tabbable": "^6.0.0",
"@floating-ui/react-dom": "^2.1.7",
"@floating-ui/utils": "^0.2.10"
},
"devDependencies": {
"@babel/preset-react": "^7.23.3",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-icons": "^1.3.0",
"@testing-library/jest-dom": "^6.2.0",
"@testing-library/react": "^16.2.0",
"@testing-library/user-event": "^14.6.1",
"@types/react": "^18.3.19",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
"clsx": "^1.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-responsive": "^9.0.2",
"react-router-dom": "^6.21.1",
"resize-observer-polyfill": "^1.5.1",
"use-isomorphic-layout-effect": "^1.2.1",
"vitest-browser-react": "^0.1.1",
"config": "0.0.0"
},
"scripts": {
"lint": "eslint .",
"format": "prettier --write .",
"clean": "rimraf dist out-tsc utils",
"test": "vitest run",
"test:watch": "vitest watch",
"test:browser": "TEST_ENV=browser vitest --browser",
"build": "rollup -c",
"build:api": "build-api --tsc tsconfig.lib.json --aec api-extractor.json --aec api-extractor.utils.json",
"dev": "vite",
"publint": "publint",
"typecheck": "tsc -b"
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"getFieldPermissions.d.ts","sourceRoot":"","sources":["../../src/utilities/getFieldPermissions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0EAM7B;IACD,QAAQ,CAAC,qBAAqB,CAAC,EAAE,4BAA4B,CAAA;IAC7D,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,CAAA;IACnC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,EAAE,yBAAyB,GAAG,0BAA0B,CAAA;CAC7E,KAAG;IACF,SAAS,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,WAAW,EAAE,yBAAyB,GAAG,0BAA0B,CAAA;IACnE,IAAI,EAAE,OAAO,CAAA;CA6Dd,CAAA"}

View File

@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Tags = createLucideIcon("Tags", [
["path", { d: "m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19", key: "1cbfv1" }],
[
"path",
{
d: "M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",
key: "135mg7"
}
],
["circle", { cx: "6.5", cy: "9.5", r: ".5", fill: "currentColor", key: "5pm5xn" }]
]);
export { Tags as default };
//# sourceMappingURL=tags.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../src/integrations/console.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM9D,UAAU,yBAAyB;IACjC,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AAUD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,wFAe7B,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CA2B/E"}

View File

@@ -0,0 +1,53 @@
'use strict';
// do not edit .js files directly - edit src/index.jst
module.exports = function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
if (a.constructor !== b.constructor) return false;
var length, i, keys;
if (Array.isArray(a)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (!equal(a[i], b[i])) return false;
return true;
}
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) return false;
for (i = length; i-- !== 0;)
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = length; i-- !== 0;) {
var key = keys[i];
if (key === '_owner' && a.$$typeof) {
// React-specific: avoid traversing React elements' _owner.
// _owner contains circular references
// and is not needed when comparing the actual elements (and not their owners)
continue;
}
if (!equal(a[key], b[key])) return false;
}
return true;
}
// true if both NaN, false otherwise
return a!==a && b!==b;
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/TableColumns/RenderDefaultCell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAExD,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,cAAc,CAAA;AAMrB,eAAO,MAAM,YAAY,QAAO,yBAAyB,GAAG,IAAmC,CAAA;AAE/F,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IACvC,WAAW,EAAE,yBAAyB,CAAA;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CA4BA,CAAA"}

View File

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

View File

@@ -0,0 +1,358 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const semanticAttributes = require('../../semanticAttributes.js');
const spanUtils = require('../../utils/spanUtils.js');
const genAiAttributes = require('../ai/gen-ai-attributes.js');
const constants = require('./constants.js');
const utils = require('./utils.js');
const vercelAiAttributes = require('./vercel-ai-attributes.js');
function addOriginToSpan(span, origin) {
span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, origin);
}
/**
* Maps Vercel AI SDK operation names to OpenTelemetry semantic convention values
* @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#llm-request-spans
*/
function mapVercelAiOperationName(operationName) {
// Top-level pipeline operations map to invoke_agent
if (constants.INVOKE_AGENT_OPS.has(operationName)) {
return 'invoke_agent';
}
// .do* operations are the actual LLM calls
if (constants.GENERATE_CONTENT_OPS.has(operationName)) {
return 'generate_content';
}
if (constants.EMBEDDINGS_OPS.has(operationName)) {
return 'embeddings';
}
if (constants.RERANK_OPS.has(operationName)) {
return 'rerank';
}
if (operationName === 'ai.toolCall') {
return 'execute_tool';
}
// Return the original value for unknown operations
return operationName;
}
/**
* Post-process spans emitted by the Vercel AI SDK.
* This is supposed to be used in `client.on('spanStart', ...)
*/
function onVercelAiSpanStart(span) {
const { data: attributes, description: name } = spanUtils.spanToJSON(span);
if (!name) {
return;
}
// Tool call spans
// https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans
if (attributes[vercelAiAttributes.AI_TOOL_CALL_NAME_ATTRIBUTE] && attributes[vercelAiAttributes.AI_TOOL_CALL_ID_ATTRIBUTE] && name === 'ai.toolCall') {
processToolCallSpan(span, attributes);
return;
}
// V6+ Check if this is a Vercel AI span by checking if the operation ID attribute is present.
// V5+ Check if this is a Vercel AI span by name pattern.
if (!attributes[vercelAiAttributes.AI_OPERATION_ID_ATTRIBUTE] && !name.startsWith('ai.')) {
return;
}
processGenerateSpan(span, name, attributes);
}
function vercelAiEventProcessor(event) {
if (event.type === 'transaction' && event.spans) {
// Map to accumulate token data by parent span ID
const tokenAccumulator = new Map();
// First pass: process all spans and accumulate token data
for (const span of event.spans) {
processEndedVercelAiSpan(span);
// Accumulate token data for parent spans
utils.accumulateTokensForParent(span, tokenAccumulator);
}
// Second pass: apply accumulated token data to parent spans
for (const span of event.spans) {
if (span.op !== 'gen_ai.invoke_agent') {
continue;
}
utils.applyAccumulatedTokens(span, tokenAccumulator);
}
// Also apply to root when it is the invoke_agent pipeline
const trace = event.contexts?.trace;
if (trace && trace.op === 'gen_ai.invoke_agent') {
utils.applyAccumulatedTokens(trace, tokenAccumulator);
}
}
return event;
}
/**
* Post-process spans emitted by the Vercel AI SDK.
*/
function processEndedVercelAiSpan(span) {
const { data: attributes, origin } = span;
if (origin !== 'auto.vercelai.otel') {
return;
}
renameAttributeKey(attributes, vercelAiAttributes.AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE, genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE);
renameAttributeKey(attributes, vercelAiAttributes.AI_USAGE_PROMPT_TOKENS_ATTRIBUTE, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE);
renameAttributeKey(attributes, vercelAiAttributes.AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE);
// Parent spans (ai.streamText, ai.streamObject, etc.) use inputTokens/outputTokens instead of promptTokens/completionTokens
renameAttributeKey(attributes, 'ai.usage.inputTokens', genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE);
renameAttributeKey(attributes, 'ai.usage.outputTokens', genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE);
// AI SDK uses avgOutputTokensPerSecond, map to our expected attribute name
renameAttributeKey(attributes, 'ai.response.avgOutputTokensPerSecond', 'ai.response.avgCompletionTokensPerSecond');
// Input tokens is the sum of prompt tokens and cached input tokens
if (
typeof attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] === 'number' &&
typeof attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE] === 'number'
) {
attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] =
attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] + attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE];
}
if (
typeof attributes[genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE] === 'number' &&
typeof attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] === 'number'
) {
attributes[genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE] =
attributes[genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE] + attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE];
}
// Convert the available tools array to a JSON string
if (attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE] && Array.isArray(attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE])) {
attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE] = utils.convertAvailableToolsToJsonString(
attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE] ,
);
}
// Rename AI SDK attributes to standardized gen_ai attributes
// Map operation.name to OpenTelemetry semantic convention values
if (attributes[vercelAiAttributes.OPERATION_NAME_ATTRIBUTE]) {
const operationName = mapVercelAiOperationName(attributes[vercelAiAttributes.OPERATION_NAME_ATTRIBUTE] );
attributes[genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE] = operationName;
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete attributes[vercelAiAttributes.OPERATION_NAME_ATTRIBUTE];
}
renameAttributeKey(attributes, vercelAiAttributes.AI_PROMPT_MESSAGES_ATTRIBUTE, genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE);
renameAttributeKey(attributes, vercelAiAttributes.AI_RESPONSE_TEXT_ATTRIBUTE, 'gen_ai.response.text');
renameAttributeKey(attributes, vercelAiAttributes.AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, 'gen_ai.response.tool_calls');
renameAttributeKey(attributes, vercelAiAttributes.AI_RESPONSE_OBJECT_ATTRIBUTE, 'gen_ai.response.object');
renameAttributeKey(attributes, vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE, 'gen_ai.request.available_tools');
renameAttributeKey(attributes, vercelAiAttributes.AI_TOOL_CALL_ARGS_ATTRIBUTE, genAiAttributes.GEN_AI_TOOL_INPUT_ATTRIBUTE);
renameAttributeKey(attributes, vercelAiAttributes.AI_TOOL_CALL_RESULT_ATTRIBUTE, genAiAttributes.GEN_AI_TOOL_OUTPUT_ATTRIBUTE);
renameAttributeKey(attributes, vercelAiAttributes.AI_SCHEMA_ATTRIBUTE, 'gen_ai.request.schema');
renameAttributeKey(attributes, vercelAiAttributes.AI_MODEL_ID_ATTRIBUTE, genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE);
addProviderMetadataToAttributes(attributes);
// Change attributes namespaced with `ai.X` to `vercel.ai.X`
for (const key of Object.keys(attributes)) {
if (key.startsWith('ai.')) {
renameAttributeKey(attributes, key, `vercel.${key}`);
}
}
}
/**
* Renames an attribute key in the provided attributes object if the old key exists.
* This function safely handles null and undefined values.
*/
function renameAttributeKey(attributes, oldKey, newKey) {
if (attributes[oldKey] != null) {
attributes[newKey] = attributes[oldKey];
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete attributes[oldKey];
}
}
function processToolCallSpan(span, attributes) {
addOriginToSpan(span, 'auto.vercelai.otel');
span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'gen_ai.execute_tool');
span.setAttribute(genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE, 'execute_tool');
renameAttributeKey(attributes, vercelAiAttributes.AI_TOOL_CALL_NAME_ATTRIBUTE, genAiAttributes.GEN_AI_TOOL_NAME_ATTRIBUTE);
renameAttributeKey(attributes, vercelAiAttributes.AI_TOOL_CALL_ID_ATTRIBUTE, genAiAttributes.GEN_AI_TOOL_CALL_ID_ATTRIBUTE);
// Store the span in our global map using the tool call ID
// This allows us to capture tool errors and link them to the correct span
const toolCallId = attributes[genAiAttributes.GEN_AI_TOOL_CALL_ID_ATTRIBUTE];
if (typeof toolCallId === 'string') {
constants.toolCallSpanMap.set(toolCallId, span);
}
// https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/#gen-ai-tool-type
if (!attributes[genAiAttributes.GEN_AI_TOOL_TYPE_ATTRIBUTE]) {
span.setAttribute(genAiAttributes.GEN_AI_TOOL_TYPE_ATTRIBUTE, 'function');
}
const toolName = attributes[genAiAttributes.GEN_AI_TOOL_NAME_ATTRIBUTE];
if (toolName) {
span.updateName(`execute_tool ${toolName}`);
}
}
function processGenerateSpan(span, name, attributes) {
addOriginToSpan(span, 'auto.vercelai.otel');
const nameWthoutAi = name.replace('ai.', '');
span.setAttribute('ai.pipeline.name', nameWthoutAi);
span.updateName(nameWthoutAi);
// If a telemetry name is set and the span represents a pipeline, use it as the operation name.
// This name can be set at the request level by adding `experimental_telemetry.functionId`.
const functionId = attributes[vercelAiAttributes.AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE];
if (functionId && typeof functionId === 'string') {
span.updateName(`${nameWthoutAi} ${functionId}`);
span.setAttribute('gen_ai.function_id', functionId);
}
utils.requestMessagesFromPrompt(span, attributes);
if (attributes[vercelAiAttributes.AI_MODEL_ID_ATTRIBUTE] && !attributes[genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]) {
span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE, attributes[vercelAiAttributes.AI_MODEL_ID_ATTRIBUTE]);
}
span.setAttribute('ai.streaming', name.includes('stream'));
// Set the op based on the span name
const op = utils.getSpanOpFromName(name);
if (op) {
span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP, op);
}
// Update span names for .do* spans to include the model ID (only if model ID exists)
const modelId = attributes[vercelAiAttributes.AI_MODEL_ID_ATTRIBUTE];
if (modelId) {
switch (name) {
case 'ai.generateText.doGenerate':
span.updateName(`generate_text ${modelId}`);
break;
case 'ai.streamText.doStream':
span.updateName(`stream_text ${modelId}`);
break;
case 'ai.generateObject.doGenerate':
span.updateName(`generate_object ${modelId}`);
break;
case 'ai.streamObject.doStream':
span.updateName(`stream_object ${modelId}`);
break;
case 'ai.embed.doEmbed':
span.updateName(`embed ${modelId}`);
break;
case 'ai.embedMany.doEmbed':
span.updateName(`embed_many ${modelId}`);
break;
case 'ai.rerank.doRerank':
span.updateName(`rerank ${modelId}`);
break;
}
}
}
/**
* Add event processors to the given client to process Vercel AI spans.
*/
function addVercelAiProcessors(client) {
client.on('spanStart', onVercelAiSpanStart);
// Note: We cannot do this on `spanEnd`, because the span cannot be mutated anymore at this point
client.addEventProcessor(Object.assign(vercelAiEventProcessor, { id: 'VercelAiEventProcessor' }));
}
function addProviderMetadataToAttributes(attributes) {
const providerMetadata = attributes[vercelAiAttributes.AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE] ;
if (providerMetadata) {
try {
const providerMetadataObject = JSON.parse(providerMetadata) ;
// Handle OpenAI metadata (v5 uses 'openai', v6 Azure Responses API uses 'azure')
const openaiMetadata =
providerMetadataObject.openai ?? providerMetadataObject.azure;
if (openaiMetadata) {
setAttributeIfDefined(
attributes,
genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE,
openaiMetadata.cachedPromptTokens,
);
setAttributeIfDefined(attributes, 'gen_ai.usage.output_tokens.reasoning', openaiMetadata.reasoningTokens);
setAttributeIfDefined(
attributes,
'gen_ai.usage.output_tokens.prediction_accepted',
openaiMetadata.acceptedPredictionTokens,
);
setAttributeIfDefined(
attributes,
'gen_ai.usage.output_tokens.prediction_rejected',
openaiMetadata.rejectedPredictionTokens,
);
setAttributeIfDefined(attributes, 'gen_ai.conversation.id', openaiMetadata.responseId);
}
if (providerMetadataObject.anthropic) {
const cachedInputTokens =
providerMetadataObject.anthropic.usage?.cache_read_input_tokens ??
providerMetadataObject.anthropic.cacheReadInputTokens;
setAttributeIfDefined(attributes, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE, cachedInputTokens);
const cacheWriteInputTokens =
providerMetadataObject.anthropic.usage?.cache_creation_input_tokens ??
providerMetadataObject.anthropic.cacheCreationInputTokens;
setAttributeIfDefined(attributes, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE, cacheWriteInputTokens);
}
if (providerMetadataObject.bedrock?.usage) {
setAttributeIfDefined(
attributes,
genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE,
providerMetadataObject.bedrock.usage.cacheReadInputTokens,
);
setAttributeIfDefined(
attributes,
genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE,
providerMetadataObject.bedrock.usage.cacheWriteInputTokens,
);
}
if (providerMetadataObject.deepseek) {
setAttributeIfDefined(
attributes,
genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE,
providerMetadataObject.deepseek.promptCacheHitTokens,
);
setAttributeIfDefined(
attributes,
'gen_ai.usage.input_tokens.cache_miss',
providerMetadataObject.deepseek.promptCacheMissTokens,
);
}
} catch {
// Ignore
}
}
}
/**
* Sets an attribute only if the value is not null or undefined.
*/
function setAttributeIfDefined(attributes, key, value) {
if (value != null) {
attributes[key] = value;
}
}
exports.addVercelAiProcessors = addVercelAiProcessors;
//# sourceMappingURL=index.js.map

View File

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

View File

@@ -0,0 +1,504 @@
(() => {
var _window$dateFns;function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/fr/_lib/formatDistance.js
var formatDistanceLocale = {
lessThanXSeconds: {
one: "moins d\u2019une seconde",
other: "moins de {{count}} secondes"
},
xSeconds: {
one: "1 seconde",
other: "{{count}} secondes"
},
halfAMinute: "30 secondes",
lessThanXMinutes: {
one: "moins d\u2019une minute",
other: "moins de {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "environ 1 heure",
other: "environ {{count}} heures"
},
xHours: {
one: "1 heure",
other: "{{count}} heures"
},
xDays: {
one: "1 jour",
other: "{{count}} jours"
},
aboutXWeeks: {
one: "environ 1 semaine",
other: "environ {{count}} semaines"
},
xWeeks: {
one: "1 semaine",
other: "{{count}} semaines"
},
aboutXMonths: {
one: "environ 1 mois",
other: "environ {{count}} mois"
},
xMonths: {
one: "1 mois",
other: "{{count}} mois"
},
aboutXYears: {
one: "environ 1 an",
other: "environ {{count}} ans"
},
xYears: {
one: "1 an",
other: "{{count}} ans"
},
overXYears: {
one: "plus d\u2019un an",
other: "plus de {{count}} ans"
},
almostXYears: {
one: "presqu\u2019un an",
other: "presque {{count}} ans"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var form = formatDistanceLocale[token];
if (typeof form === "string") {
result = form;
} else if (count === 1) {
result = form.one;
} else {
result = form.other.replace("{{count}}", String(count));
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "dans " + result;
} else {
return "il y a " + result;
}
}
return result;
};
// lib/locale/_lib/buildLocalizeFn.js
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/fr/_lib/localize.js
var eraValues = {
narrow: ["av. J.-C", "ap. J.-C"],
abbreviated: ["av. J.-C", "ap. J.-C"],
wide: ["avant J\xE9sus-Christ", "apr\xE8s J\xE9sus-Christ"]
};
var quarterValues = {
narrow: ["T1", "T2", "T3", "T4"],
abbreviated: ["1er trim.", "2\xE8me trim.", "3\xE8me trim.", "4\xE8me trim."],
wide: ["1er trimestre", "2\xE8me trimestre", "3\xE8me trimestre", "4\xE8me trimestre"]
};
var monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"janv.",
"f\xE9vr.",
"mars",
"avr.",
"mai",
"juin",
"juil.",
"ao\xFBt",
"sept.",
"oct.",
"nov.",
"d\xE9c."],
wide: [
"janvier",
"f\xE9vrier",
"mars",
"avril",
"mai",
"juin",
"juillet",
"ao\xFBt",
"septembre",
"octobre",
"novembre",
"d\xE9cembre"]
};
var dayValues = {
narrow: ["D", "L", "M", "M", "J", "V", "S"],
short: ["di", "lu", "ma", "me", "je", "ve", "sa"],
abbreviated: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
wide: [
"dimanche",
"lundi",
"mardi",
"mercredi",
"jeudi",
"vendredi",
"samedi"]
};
var dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "minuit",
noon: "midi",
morning: "mat.",
afternoon: "ap.m.",
evening: "soir",
night: "mat."
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "minuit",
noon: "midi",
morning: "matin",
afternoon: "apr\xE8s-midi",
evening: "soir",
night: "matin"
},
wide: {
am: "AM",
pm: "PM",
midnight: "minuit",
noon: "midi",
morning: "du matin",
afternoon: "de l\u2019apr\xE8s-midi",
evening: "du soir",
night: "du matin"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, options) {
var number = Number(dirtyNumber);
var unit = options === null || options === void 0 ? void 0 : options.unit;
if (number === 0)
return "0";
var feminineUnits = ["year", "week", "hour", "minute", "second"];
var suffix;
if (number === 1) {
suffix = unit && feminineUnits.includes(unit) ? "\xE8re" : "er";
} else {
suffix = "\xE8me";
}
return number + suffix;
};
var LONG_MONTHS_TOKENS = ["MMM", "MMMM"];
var localize = {
preprocessor: function preprocessor(date, parts) {
if (date.getDate() === 1)
return parts;
var hasLongMonthToken = parts.some(function (part) {return part.isToken && LONG_MONTHS_TOKENS.includes(part.value);});
if (!hasLongMonthToken)
return parts;
return parts.map(function (part) {return part.isToken && part.value === "do" ? { isToken: true, value: "d" } : part;});
},
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
}
function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
}
// lib/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/fr/_lib/match.js
var matchOrdinalNumberPattern = /^(\d+)(ième|ère|ème|er|e)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
};
var parseEraPatterns = {
any: [/^av/i, /^ap/i]
};
var matchQuarterPatterns = {
narrow: /^T?[1234]/i,
abbreviated: /^[1234](er|ème|e)? trim\.?/i,
wide: /^[1234](er|ème|e)? trimestre/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
};
var parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^av/i,
/^ma/i,
/^juin/i,
/^juil/i,
/^ao/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i]
};
var matchDayPatterns = {
narrow: /^[lmjvsd]/i,
short: /^(di|lu|ma|me|je|ve|sa)/i,
abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i
};
var parseDayPatterns = {
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i]
};
var matchDayPeriodPatterns = {
narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
};
var parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^min/i,
noon: /^mid/i,
morning: /mat/i,
afternoon: /ap/i,
evening: /soir/i,
night: /nuit/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/fr-CH/_lib/formatLong.js
var dateFormats = {
full: "EEEE d MMMM y",
long: "d MMMM y",
medium: "d MMM y",
short: "dd.MM.y"
};
var timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm"
};
var dateTimeFormats = {
full: "{{date}} '\xE0' {{time}}",
long: "{{date}} '\xE0' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/fr-CH/_lib/formatRelative.js
var formatRelativeLocale = {
lastWeek: "eeee 'la semaine derni\xE8re \xE0' p",
yesterday: "'hier \xE0' p",
today: "'aujourd\u2019hui \xE0' p",
tomorrow: "'demain \xE0' p'",
nextWeek: "eeee 'la semaine prochaine \xE0' p",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/fr-CH.js
var frCH = {
code: "fr-CH",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/fr-CH/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
frCH: frCH }) });
//# debugId=713A37F6FCF0734A64756E2164756E21
//# sourceMappingURL=cdn.js.map
})();

View File

@@ -0,0 +1,6 @@
export declare const isMatchWithOptions: import("./types.js").FPFn3<
boolean,
import("../isMatch.js").IsMatchOptions | undefined,
string,
string
>;

View File

@@ -0,0 +1,148 @@
# @dnd-kit/utilities
## 3.2.2
### Patch Changes
- [#1239](https://github.com/clauderic/dnd-kit/pull/1239) [`f342d5e`](https://github.com/clauderic/dnd-kit/commit/f342d5efd98507f173b6a170b35bee1545d40311) Thanks [@petdud](https://github.com/petdud)! - Fix: getOwnerDocument should get correct document for SVG Elements
## 3.2.1
### Patch Changes
- [#948](https://github.com/clauderic/dnd-kit/pull/948) [`da7c60d`](https://github.com/clauderic/dnd-kit/commit/da7c60dcbb76d89cf1fcb421e69a4abcea2eeebe) Thanks [@Ayc0](https://github.com/Ayc0)! - Upgrade to TypeScript to 4.8
## 3.2.0
### Minor Changes
- [#748](https://github.com/clauderic/dnd-kit/pull/748) [`59ca82b`](https://github.com/clauderic/dnd-kit/commit/59ca82b9f228f34c7731ece87aef5d9633608b57) Thanks [@clauderic](https://github.com/clauderic)! - Introduced the `findFirstFocusableNode` utility function that returns the first focusable node within a given HTMLElement, or the element itself if it is focusable.
- [#733](https://github.com/clauderic/dnd-kit/pull/733) [`035021a`](https://github.com/clauderic/dnd-kit/commit/035021aac51161e2bf9715f087a6dd1b46647bfc) Thanks [@clauderic](https://github.com/clauderic)! - Introduced the `useEvent` hook based on [implementation breakdown in the RFC](https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md#internal-implementation). In the future, this hook will be used as a polyfill if the native React hook is unavailble.
## 3.1.0
### Minor Changes
- [#518](https://github.com/clauderic/dnd-kit/pull/518) [`6310227`](https://github.com/clauderic/dnd-kit/commit/63102272d0d63dae349e2e9f638277e16a7d5970) Thanks [@clauderic](https://github.com/clauderic)! - Major internal refactor of measuring and collision detection.
### Summary of changes
Previously, all collision detection algorithms were relative to the top and left points of the document. While this approach worked in most situations, it broke down in a number of different use-cases, such as fixed position droppable containers and trying to drag between containers that had different scroll positions.
This new approach changes the frame of comparison to be relative to the viewport. This is a major breaking change, and will need to be released under a new major version bump.
### Breaking changes:
- By default, `@dnd-kit` now ignores only the transforms applied to the draggable / droppable node itself, but considers all the transforms applied to its ancestors. This should provide the right balance of flexibility for most consumers.
- Transforms applied to the droppable and draggable nodes are ignored by default, because the recommended approach for moving items on the screen is to use the transform property, which can interfere with the calculation of collisions.
- Consumers can choose an alternate approach that does consider transforms for specific use-cases if needed by configuring the measuring prop of <DndContext>. Refer to the <Switch> example.
- Reduced the number of concepts related to measuring from `ViewRect`, `LayoutRect` to just a single concept of `ClientRect`.
- The `ClientRect` interface no longer holds the `offsetTop` and `offsetLeft` properties. For most use-cases, you can replace `offsetTop` with `top` and `offsetLeft` with `left`.
- Replaced the following exports from the `@dnd-kit/core` package with `getClientRect`:
- `getBoundingClientRect`
- `getViewRect`
- `getLayoutRect`
- `getViewportLayoutRect`
- Removed `translatedRect` from the `SensorContext` interface. Replace usage with `collisionRect`.
- Removed `activeNodeClientRect` on the `DndContext` interface. Replace with `activeNodeRect`.
- [`528c67e`](https://github.com/clauderic/dnd-kit/commit/528c67e4c617dfc0ce5221496aa8b222ffc82ddb) Thanks [@clauderic](https://github.com/clauderic)! - Introduced the `useLatestValue` hook, which returns a ref that holds the latest value of a given argument. Optionally, the second argument can be used to customize the dependencies passed to the effect.
### Patch Changes
- [#561](https://github.com/clauderic/dnd-kit/pull/561) [`02edd26`](https://github.com/clauderic/dnd-kit/commit/02edd2691b24bb49f2e7c9f9a3f282031bf658b7) Thanks [@clauderic](https://github.com/clauderic)! - - The `useNodeRef` hook's `onChange` argument now receives both the current node and the previous node that were attached to the ref.
- The `onChange` argument is only called if the previous node differs from the current node
## 3.0.2
### Patch Changes
- [#532](https://github.com/clauderic/dnd-kit/pull/532) [`dfa8d69`](https://github.com/clauderic/dnd-kit/commit/dfa8d69d98e8f271b29fa516cc13b8cd0c01d371) Thanks [@Nauss](https://github.com/Nauss)! - fix: `isWindow` has been updated to support checking wether an element is a window object in Electron applications.
## 3.0.1
### Patch Changes
- [#509](https://github.com/clauderic/dnd-kit/pull/509) [`1c6369e`](https://github.com/clauderic/dnd-kit/commit/1c6369e24ff338760adfb806c3017c72f3194726) Thanks [@clauderic](https://github.com/clauderic)! - Helpers have been updated to support rendering in foreign `window` contexts (via `ReactDOM.render` or `ReactDOM.createPortal`).
For example, checking if an element is an instance of an `HTMLElement` is normally done like so:
```ts
if (element instanceof HTMLElement)
```
However, when rendering in a different window, this can return false even if the element is indeed an HTMLElement, because this code is equivalent to:
```ts
if (element instanceof window.HTMLElement)
```
And in this case, the `window` of the `element` is different from the main execution context `window`, because we are rendering via a portal into another window.
This can be solved by finding the local window of the element:
```ts
const elementWindow = element.ownerDocument.defaultView;
if (element instanceof elementWindow.HTMLElement)
```
## 3.0.0
### Major Changes
- [#373](https://github.com/clauderic/dnd-kit/pull/373) [`1f5ca27`](https://github.com/clauderic/dnd-kit/commit/1f5ca27b17879861c2c545160c2046a747544846) Thanks [@clauderic](https://github.com/clauderic)! - Added react to peerDependencies of @dnd-kit/utilities
### Minor Changes
- [#334](https://github.com/clauderic/dnd-kit/pull/334) [`13be602`](https://github.com/clauderic/dnd-kit/commit/13be602229c6d5723b3ae98bca7b8f45f0773366) Thanks [@trentmwillis](https://github.com/trentmwillis)! - Move `Coordinates` interface along with `getEventCoordinates`, `isMouseEvent` and `isTouchEvent` helpers to @dnd-kit/utilities
### Patch Changes
- [#437](https://github.com/clauderic/dnd-kit/pull/437) [`0e628bc`](https://github.com/clauderic/dnd-kit/commit/0e628bce53fb1a7223cdedd203cb07b6e62e5ec1) Thanks [@chestozo](https://github.com/chestozo)! - Added PointerEvent support to the `getEventCoordinates` method. This fixes testing the PointerSensor with Cypress (#436)
## 2.0.0
### Major Changes
- [`a9d92cf`](https://github.com/clauderic/dnd-kit/commit/a9d92cf1fa35dd957e6c5915a13dfd2af134c103) [#174](https://github.com/clauderic/dnd-kit/pull/174) Thanks [@clauderic](https://github.com/clauderic)! - Distributed assets now only target modern browsers. [Browserlist](https://github.com/browserslist/browserslist) config:
```
defaults
last 2 version
not IE 11
not dead
```
If you need to support older browsers, include the appropriate polyfills in your project's build process.
## 1.0.3
### Patch Changes
- [`6a5c8a1`](https://github.com/clauderic/dnd-kit/commit/6a5c8a13bf19742efa65b20f16666f00ffaae1b1) [#154](https://github.com/clauderic/dnd-kit/pull/154) Thanks [@clauderic](https://github.com/clauderic)! - Update implementation of FirstArgument
## 1.0.2
### Patch Changes
- [`423610c`](https://github.com/clauderic/dnd-kit/commit/423610ca48c5e5ca95545fdb5c5cfcfbd3d233ba) [#56](https://github.com/clauderic/dnd-kit/pull/56) Thanks [@clauderic](https://github.com/clauderic)! - Add MIT license to package.json and distributed files
## 1.0.1
### Patch Changes
- [`0b343c7`](https://github.com/clauderic/dnd-kit/commit/0b343c7e88a68351f8a39f643e9f26b8e046ef48) [#52](https://github.com/clauderic/dnd-kit/pull/52) Thanks [@clauderic](https://github.com/clauderic)! - Add repository entry to package.json files
## 1.0.0
### Major Changes
- [`2912350`](https://github.com/clauderic/dnd-kit/commit/2912350c5008c2b0edda3bae30b5075a852dea63) Thanks [@clauderic](https://github.com/clauderic)! - Initial public release.
## 0.1.0
### Minor Changes
- [`7bd4568`](https://github.com/clauderic/dnd-kit/commit/7bd4568e9f339552fd73a9a4c888460b11195a5e) [#30](https://github.com/clauderic/dnd-kit/pull/30) - Initial beta release, authored by [@clauderic](https://github.com/clauderic).

View File

@@ -0,0 +1 @@
{"version":3,"file":"getVersionLabel.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/VersionPillLabel/getVersionLabel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,KAAK,IAAI,GAAG;IACV,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,yBAAyB,CAAC,EAAE;QAC1B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;QACnB,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,SAAS,EAAE,MAAM,CAAA;QACjB,OAAO,EAAE;YACP,SAAS,EAAE,MAAM,CAAA;SAClB,CAAA;KACF,CAAA;IACD,kBAAkB,CAAC,EAAE;QACnB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;QACnB,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,CAAC,EAAE,SAAS,CAAA;IACZ,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;QACnB,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,OAAO,EAAE;YAAE,OAAO,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAA;KAChE,CAAA;CACF,CAAA;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,yBAAyB,EACzB,kBAAkB,EAClB,CAAC,EACD,OAAO,GACR,EAAE,IAAI,GAAG;IACR,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,cAAc,GAAG,oBAAoB,GAAG,OAAO,GAAG,qBAAqB,GAAG,WAAW,CAAA;IAC3F,SAAS,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;CACnD,CA6CA"}

View File

@@ -0,0 +1,5 @@
export * as Ast from './Ast';
export * as Types from './Types';
export * as Treeify from './TreeifyBuilder';
export * from './DecisionTree';
export * from './Picker';

View File

@@ -0,0 +1,27 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link getDate} function options.
*/
export interface GetDateOptions extends ContextOptions<Date> {}
/**
* @name getDate
* @category Day Helpers
* @summary Get the day of the month of the given date.
*
* @description
* Get the day of the month of the given date.
*
* @param date - The given date
* @param options - An object with options.
*
* @returns The day of month
*
* @example
* // Which day of the month is 29 February 2012?
* const result = getDate(new Date(2012, 1, 29))
* //=> 29
*/
export declare function getDate(
date: DateArg<Date> & {},
options?: GetDateOptions | undefined,
): number;

View File

@@ -0,0 +1,136 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /\d+/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(нтө|нт)/i,
abbreviated: /^(нтө|нт)/i,
wide: /^(нийтийн тооллын өмнө|нийтийн тооллын)/i,
};
const parseEraPatterns = {
any: [/^(нтө|нийтийн тооллын өмнө)/i, /^(нт|нийтийн тооллын)/i],
};
const matchQuarterPatterns = {
narrow: /^(iv|iii|ii|i)/i,
abbreviated: /^(iv|iii|ii|i) улирал/i,
wide: /^[1-4]-р улирал/i,
};
const parseQuarterPatterns = {
any: [/^(i(\s|$)|1)/i, /^(ii(\s|$)|2)/i, /^(iii(\s|$)|3)/i, /^(iv(\s|$)|4)/i],
};
const matchMonthPatterns = {
narrow: /^(xii|xi|x|ix|viii|vii|vi|v|iv|iii|ii|i)/i,
abbreviated:
/^(1-р сар|2-р сар|3-р сар|4-р сар|5-р сар|6-р сар|7-р сар|8-р сар|9-р сар|10-р сар|11-р сар|12-р сар)/i,
wide: /^(нэгдүгээр сар|хоёрдугаар сар|гуравдугаар сар|дөрөвдүгээр сар|тавдугаар сар|зургаадугаар сар|долоодугаар сар|наймдугаар сар|есдүгээр сар|аравдугаар сар|арван нэгдүгээр сар|арван хоёрдугаар сар)/i,
};
const parseMonthPatterns = {
narrow: [
/^i$/i,
/^ii$/i,
/^iii$/i,
/^iv$/i,
/^v$/i,
/^vi$/i,
/^vii$/i,
/^viii$/i,
/^ix$/i,
/^x$/i,
/^xi$/i,
/^xii$/i,
],
any: [
/^(1|нэгдүгээр)/i,
/^(2|хоёрдугаар)/i,
/^(3|гуравдугаар)/i,
/^(4|дөрөвдүгээр)/i,
/^(5|тавдугаар)/i,
/^(6|зургаадугаар)/i,
/^(7|долоодугаар)/i,
/^(8|наймдугаар)/i,
/^(9|есдүгээр)/i,
/^(10|аравдугаар)/i,
/^(11|арван нэгдүгээр)/i,
/^(12|арван хоёрдугаар)/i,
],
};
const matchDayPatterns = {
narrow: /^[ндмлпбб]/i,
short: /^(ня|да|мя|лх|пү|ба|бя)/i,
abbreviated: /^(ням|дав|мяг|лха|пүр|баа|бям)/i,
wide: /^(ням|даваа|мягмар|лхагва|пүрэв|баасан|бямба)/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^д/i, /^м/i, /^л/i, /^п/i, /^б/i, /^б/i],
any: [/^ня/i, /^да/i, /^мя/i, /^лх/i, /^пү/i, /^ба/i, /^бя/i],
};
const matchDayPeriodPatterns = {
narrow: /^(ү\.ө\.|ү\.х\.|шөнө дунд|үд дунд|өглөө|өдөр|орой|шөнө)/i,
any: /^(ү\.ө\.|ү\.х\.|шөнө дунд|үд дунд|өглөө|өдөр|орой|шөнө)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^ү\.ө\./i,
pm: /^ү\.х\./i,
midnight: /^шөнө дунд/i,
noon: /^үд дунд/i,
morning: /өглөө/i,
afternoon: /өдөр/i,
evening: /орой/i,
night: /шөнө/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1,363 @@
// @ts-no-check
/**
* THIS FILE IS BASED ON:
* https://github.com/rocicorp/fractional-indexing/blob/main/src/index.js
*
* MODIFIED FOR PAYLOAD CMS:
* - Changed the integer part encoding to use only digits for "small" keys and
* only lowercase letters for "large" keys, ensuring consistent ordering
* across databases with different collations.
*
* - Original algorithm used A-Z (uppercase) for "smaller" integers and a-z (lowercase)
* for "larger" integers, relying on ASCII ordering where 'Z' < 'a'.
*
* - Some databases (e.g., PostgreSQL with default collation) use case-insensitive
* comparison, treating 'Z' as 'z', which breaks the ordering.
*
* - New encoding:
* - Uses digits '0'-'9' for "small" integers (10 values, lengths 11 down to 2)
* - Uses lowercase 'a'-'z' for "large" integers (26 values, lengths 2 up to 27)
* - Digits ALWAYS sort before letters in both ASCII and case-insensitive orderings.
*
* - Ordering: '0...' < '1...' < ... < '9..' < 'a.' < 'b..' < ... < 'z...'
*
* BACKWARD COMPATIBILITY:
* - Existing keys starting with lowercase 'a'-'z' remain valid and work correctly.
* - Keys starting with uppercase 'A'-'Z' (from the old algorithm) will still be
* parsed for backward compatibility, but they may sort incorrectly in
* case-insensitive databases. Consider running a migration to convert them.
*/ // License: CC0 (no rights reserved).
// This is based on https://observablehq.com/@dgreensp/implementing-fractional-indexing
export const BASE_36_DIGITS = '0123456789abcdefghijklmnopqrstuvwxyz';
// `a` may be empty string, `b` is null or non-empty string.
// `a < b` lexicographically if `b` is non-null.
// no trailing zeros allowed.
// digits is a string such as '0123456789' for base 10. Digits must be in
// ascending character code order!
/**
* @param {string} a
* @param {string | null | undefined} b
* @param {string} digits
* @returns {string}
*/ function midpoint(a, b, digits) {
const zero = digits[0];
if (b != null && a >= b) {
throw new Error(a + ' >= ' + b);
}
if (a.slice(-1) === zero || b && b.slice(-1) === zero) {
throw new Error('trailing zero');
}
if (b) {
// remove longest common prefix. pad `a` with 0s as we
// go. note that we don't need to pad `b`, because it can't
// end before `a` while traversing the common prefix.
let n = 0;
while((a[n] || zero) === b[n]){
n++;
}
if (n > 0) {
return b.slice(0, n) + midpoint(a.slice(n), b.slice(n), digits);
}
}
// first digits (or lack of digit) are different
const digitA = a ? digits.indexOf(a[0]) : 0;
const digitB = b != null ? digits.indexOf(b[0]) : digits.length;
if (digitB - digitA > 1) {
const midDigit = Math.round(0.5 * (digitA + digitB));
return digits[midDigit];
} else {
// first digits are consecutive
if (b && b.length > 1) {
return b.slice(0, 1);
} else {
// `b` is null or has length 1 (a single digit).
// the first digit of `a` is the previous digit to `b`,
// or 9 if `b` is null.
// given, for example, midpoint('49', '5'), return
// '4' + midpoint('9', null), which will become
// '4' + '9' + midpoint('', null), which is '495'
return digits[digitA] + midpoint(a.slice(1), null, digits);
}
}
}
/**
* @param {string} int
* @return {void}
*/ function validateInteger(int) {
if (int.length !== getIntegerLength(int[0])) {
throw new Error('invalid integer part of order key: ' + int);
}
}
/**
* Returns the length of the integer part based on the head character.
*
* New encoding (case-insensitive safe):
* - SMALL range (digits): '0' = 11 chars, '1' = 10 chars, ..., '9' = 2 chars
* - LARGE range (lowercase): 'a' = 2 chars, 'b' = 3 chars, ..., 'z' = 27 chars
*
* Legacy encoding (for backward compatibility with existing keys):
* - 'A'-'Z' uppercase: 'A' = 27 chars, 'B' = 26 chars, ..., 'Z' = 2 chars
*
* @param {string} head
* @return {number}
*/ function getIntegerLength(head) {
if (head >= '0' && head <= '9') {
return 11 - (head.charCodeAt(0) - '0'.charCodeAt(0));
} else if (head >= 'a' && head <= 'z') {
return head.charCodeAt(0) - 'a'.charCodeAt(0) + 2;
} else if (head >= 'A' && head <= 'Z') {
// Legacy encoding
return 'Z'.charCodeAt(0) - head.charCodeAt(0) + 2;
} else {
throw new Error('invalid order key head: ' + head);
}
}
/**
* @param {string} key
* @return {string}
*/ function getIntegerPart(key) {
const integerPartLength = getIntegerLength(key[0]);
if (integerPartLength > key.length) {
throw new Error('invalid order key: ' + key);
}
return key.slice(0, integerPartLength);
}
/**
* Smallest possible key (for validation)
* '0' + 10 zeros = smallest valid key in new format
*/ const SMALLEST_KEY = '0' + BASE_36_DIGITS[0].repeat(10);
/**
* @param {string} key
* @param {string} digits
* @return {void}
*/ function validateOrderKey(key, digits) {
if (key === SMALLEST_KEY) {
throw new Error('invalid order key: ' + key);
}
// Legacy check for old format
if (key === 'A' + digits[0].repeat(26)) {
throw new Error('invalid order key: ' + key);
}
// getIntegerPart will throw if the first character is bad,
// or the key is too short. we'd call it to check these things
// even if we didn't need the result
const i = getIntegerPart(key);
const f = key.slice(i.length);
if (f.slice(-1) === digits[0]) {
throw new Error('invalid order key: ' + key);
}
}
// note that this may return null, as there is a largest integer
/**
* @param {string} x
* @param {string} digits
* @return {string | null}
*/ function incrementInteger(x, digits) {
validateInteger(x);
const [head, ...digs] = x.split('');
let carry = true;
for(let i = digs.length - 1; carry && i >= 0; i--){
const d = digits.indexOf(digs[i]) + 1;
if (d === digits.length) {
digs[i] = digits[0];
} else {
digs[i] = digits[d];
carry = false;
}
}
if (carry) {
if (head === '9') {
return 'a' + digits[0];
}
// Handle legacy uppercase transition
if (head === 'Z') {
return 'a' + digits[0];
}
if (head === 'z') {
return null;
}
let h;
if (head >= '0' && head <= '8') {
h = String.fromCharCode(head.charCodeAt(0) + 1);
digs.pop();
} else if (head >= 'a' && head <= 'y') {
h = String.fromCharCode(head.charCodeAt(0) + 1);
digs.push(digits[0]);
} else if (head >= 'A' && head <= 'Y') {
// Legacy uppercase
h = String.fromCharCode(head.charCodeAt(0) + 1);
digs.pop();
} else {
throw new Error('invalid head: ' + head);
}
return h + digs.join('');
} else {
return head + digs.join('');
}
}
// note that this may return null, as there is a smallest integer
/**
* @param {string} x
* @param {string} digits
* @return {string | null}
*/ function decrementInteger(x, digits) {
validateInteger(x);
const [head, ...digs] = x.split('');
let borrow = true;
for(let i = digs.length - 1; borrow && i >= 0; i--){
const d = digits.indexOf(digs[i]) - 1;
if (d === -1) {
digs[i] = digits.slice(-1);
} else {
digs[i] = digits[d];
borrow = false;
}
}
if (borrow) {
if (head === 'a') {
return '9' + digits.slice(-1);
}
if (head === '0') {
return null;
}
let h;
if (head >= '1' && head <= '9') {
h = String.fromCharCode(head.charCodeAt(0) - 1);
digs.push(digits.slice(-1));
} else if (head >= 'b' && head <= 'z') {
h = String.fromCharCode(head.charCodeAt(0) - 1);
digs.pop();
} else if (head >= 'B' && head <= 'Z') {
// Legacy uppercase
h = String.fromCharCode(head.charCodeAt(0) - 1);
digs.push(digits.slice(-1));
} else if (head === 'A') {
// Legacy uppercase
return null;
} else {
throw new Error('invalid head: ' + head);
}
return h + digs.join('');
} else {
return head + digs.join('');
}
}
// `a` is an order key or null (START).
// `b` is an order key or null (END).
// `a < b` lexicographically if both are non-null.
// digits is a string such as '0123456789' for base 10. Digits must be in
// ascending character code order!
/**
* @param {string | null | undefined} a
* @param {string | null | undefined} b
* @param {string=} digits
* @return {string}
*/ export function generateKeyBetween(a, b, digits = BASE_36_DIGITS) {
if (a != null) {
validateOrderKey(a, digits);
}
if (b != null) {
validateOrderKey(b, digits);
}
if (a != null && b != null && a >= b) {
throw new Error(a + ' >= ' + b);
}
if (a == null) {
if (b == null) {
return 'a' + digits[0];
}
const ib = getIntegerPart(b);
const fb = b.slice(ib.length);
if (ib === SMALLEST_KEY) {
return ib + midpoint('', fb, digits);
}
// Legacy check
if (ib === 'A' + digits[0].repeat(26)) {
return ib + midpoint('', fb, digits);
}
if (ib < b) {
return ib;
}
const res = decrementInteger(ib, digits);
if (res == null) {
throw new Error('cannot decrement any more');
}
return res;
}
if (b == null) {
const ia = getIntegerPart(a);
const fa = a.slice(ia.length);
const i = incrementInteger(ia, digits);
return i == null ? ia + midpoint(fa, null, digits) : i;
}
const ia = getIntegerPart(a);
const fa = a.slice(ia.length);
const ib = getIntegerPart(b);
const fb = b.slice(ib.length);
if (ia === ib) {
return ia + midpoint(fa, fb, digits);
}
const i = incrementInteger(ia, digits);
if (i == null) {
throw new Error('cannot increment any more');
}
if (i < b) {
return i;
}
return ia + midpoint(fa, null, digits);
}
/**
* same preconditions as generateKeysBetween.
* n >= 0.
* Returns an array of n distinct keys in sorted order.
* If a and b are both null, returns [a0, a1, ...]
* If one or the other is null, returns consecutive "integer"
* keys. Otherwise, returns relatively short keys between
* a and b.
* @param {string | null | undefined} a
* @param {string | null | undefined} b
* @param {number} n
* @param {string} digits
* @return {string[]}
*/ export function generateNKeysBetween(a, b, n, digits = BASE_36_DIGITS) {
if (n === 0) {
return [];
}
if (n === 1) {
return [
generateKeyBetween(a, b, digits)
];
}
if (b == null) {
let c = generateKeyBetween(a, b, digits);
const result = [
c
];
for(let i = 0; i < n - 1; i++){
c = generateKeyBetween(c, b, digits);
result.push(c);
}
return result;
}
if (a == null) {
let c = generateKeyBetween(a, b, digits);
const result = [
c
];
for(let i = 0; i < n - 1; i++){
c = generateKeyBetween(a, c, digits);
result.push(c);
}
result.reverse();
return result;
}
const mid = Math.floor(n / 2);
const c = generateKeyBetween(a, b, digits);
return [
...generateNKeysBetween(a, c, mid, digits),
c,
...generateNKeysBetween(c, b, n - mid - 1, digits)
];
}
//# sourceMappingURL=fractional-indexing.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"input-element-container.js","sourceRoot":"","sources":["../../../../src/dom/replaced-elements/input-element-container.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,0DAAsD;AAMtD,kDAA+C;AAG/C,IAAM,sBAAsB,GAA0B;IAClD;QACI,IAAI,0BAA2B;QAC/B,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,CAAC;KACZ;CACJ,CAAC;AAEF,IAAM,mBAAmB,GAA0B;IAC/C;QACI,IAAI,2BAA4B;QAChC,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,EAAE;KACb;CACJ,CAAC;AAEF,IAAM,mBAAmB,GAAG,UAAC,MAAc;IACvC,IAAI,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE;QAC9B,OAAO,IAAI,eAAM,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;KACjH;SAAM,IAAI,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE;QACrC,OAAO,IAAI,eAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;KAC/G;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,IAAM,aAAa,GAAG,UAAC,IAAsB;IACzC,IAAM,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,gBAAQ,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IAEpG,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/D,CAAC,CAAC;AAEW,QAAA,QAAQ,GAAG,UAAU,CAAC;AACtB,QAAA,KAAK,GAAG,OAAO,CAAC;AAChB,QAAA,QAAQ,GAAG,UAAU,CAAC;AACtB,QAAA,WAAW,GAAG,UAAU,CAAC;AAEtC;IAA2C,yCAAgB;IAKvD,+BAAY,OAAgB,EAAE,KAAuB;QAArD,YACI,kBAAM,OAAO,EAAE,KAAK,CAAC,SA2CxB;QA1CG,KAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACrC,KAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,KAAI,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAElC,IAAI,KAAI,CAAC,IAAI,KAAK,gBAAQ,IAAI,KAAI,CAAC,IAAI,KAAK,aAAK,EAAE;YAC/C,KAAI,CAAC,MAAM,CAAC,eAAe,GAAG,UAAU,CAAC;YACzC,KAAI,CAAC,MAAM,CAAC,cAAc;gBACtB,KAAI,CAAC,MAAM,CAAC,gBAAgB;oBAC5B,KAAI,CAAC,MAAM,CAAC,iBAAiB;wBAC7B,KAAI,CAAC,MAAM,CAAC,eAAe;4BACvB,UAAU,CAAC;YACnB,KAAI,CAAC,MAAM,CAAC,cAAc;gBACtB,KAAI,CAAC,MAAM,CAAC,gBAAgB;oBAC5B,KAAI,CAAC,MAAM,CAAC,iBAAiB;wBAC7B,KAAI,CAAC,MAAM,CAAC,eAAe;4BACvB,CAAC,CAAC;YACV,KAAI,CAAC,MAAM,CAAC,cAAc;gBACtB,KAAI,CAAC,MAAM,CAAC,gBAAgB;oBAC5B,KAAI,CAAC,MAAM,CAAC,iBAAiB;wBAC7B,KAAI,CAAC,MAAM,CAAC,eAAe;yCACL,CAAC;YAC3B,KAAI,CAAC,MAAM,CAAC,cAAc,GAAG,oBAA4B,CAAC;YAC1D,KAAI,CAAC,MAAM,CAAC,gBAAgB,GAAG,oBAA8B,CAAC;YAC9D,KAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,KAAI,CAAC,MAAM,CAAC,CAAC;SAClD;QAED,QAAQ,KAAI,CAAC,IAAI,EAAE;YACf,KAAK,gBAAQ;gBACT,KAAI,CAAC,MAAM,CAAC,oBAAoB;oBAC5B,KAAI,CAAC,MAAM,CAAC,mBAAmB;wBAC/B,KAAI,CAAC,MAAM,CAAC,uBAAuB;4BACnC,KAAI,CAAC,MAAM,CAAC,sBAAsB;gCAC9B,sBAAsB,CAAC;gBAC/B,MAAM;YACV,KAAK,aAAK;gBACN,KAAI,CAAC,MAAM,CAAC,oBAAoB;oBAC5B,KAAI,CAAC,MAAM,CAAC,mBAAmB;wBAC/B,KAAI,CAAC,MAAM,CAAC,uBAAuB;4BACnC,KAAI,CAAC,MAAM,CAAC,sBAAsB;gCAC9B,mBAAmB,CAAC;gBAC5B,MAAM;SACb;;IACL,CAAC;IACL,4BAAC;AAAD,CAAC,AAlDD,CAA2C,oCAAgB,GAkD1D;AAlDY,sDAAqB"}

View File

@@ -0,0 +1,24 @@
var arrayReduce = require('./_arrayReduce'),
deburr = require('./deburr'),
words = require('./words');
/** Used to compose unicode capture groups. */
var rsApos = "['\u2019]";
/** Used to match apostrophes. */
var reApos = RegExp(rsApos, 'g');
/**
* Creates a function like `_.camelCase`.
*
* @private
* @param {Function} callback The function to combine each word.
* @returns {Function} Returns the new compounder function.
*/
function createCompounder(callback) {
return function(string) {
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
};
}
module.exports = createCompounder;

View File

@@ -0,0 +1,15 @@
import type { I18n } from '@payloadcms/translations';
import type { ClientConfig, ClientField, ClientFieldSchemaMap, FieldSchemaMap, Payload, TabAsFieldClient } from 'payload';
type Args = {
clientSchemaMap: ClientFieldSchemaMap;
config: ClientConfig;
fields: (ClientField | TabAsFieldClient)[];
i18n: I18n<any, any>;
parentIndexPath: string;
parentSchemaPath: string;
payload: Payload;
schemaMap: FieldSchemaMap;
};
export declare const traverseFields: ({ clientSchemaMap, config, fields, i18n, parentIndexPath, parentSchemaPath, payload, schemaMap, }: Args) => void;
export {};
//# sourceMappingURL=traverseFields.d.ts.map

View File

@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './square-parking-off.js';
//# sourceMappingURL=parking-square-off.js.map

View File

@@ -0,0 +1,24 @@
import { sendEvent } from '../index.js';
import { oneWayHash } from '../oneWayHash.js';
export const adminInit = ({ headers, payload, user })=>{
const host = headers.get('host');
let domainID;
let userID;
if (host) {
domainID = oneWayHash(host, payload.secret);
}
if (user?.id) {
userID = oneWayHash(String(user.id), payload.secret);
}
// eslint-disable-next-line @typescript-eslint/no-floating-promises
sendEvent({
event: {
type: 'admin-init',
domainID: domainID,
userID: userID
},
payload
});
};
//# sourceMappingURL=adminInit.js.map

View File

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

View File

@@ -0,0 +1,31 @@
"use strict";
exports.startOfToday = startOfToday;
var _index = require("./startOfDay.cjs");
/**
* The {@link startOfToday} function options.
*/
/**
* @name startOfToday
* @category Day Helpers
* @summary Return the start of today.
* @pure false
*
* @description
* Return the start of today.
*
* @typeParam ContextDate - The `Date` type of the context function.
*
* @param options - An object with options
*
* @returns The start of today
*
* @example
* // If today is 6 October 2014:
* const result = startOfToday()
* //=> Mon Oct 6 2014 00:00:00
*/
function startOfToday(options) {
return (0, _index.startOfDay)(Date.now(), options);
}

View File

@@ -0,0 +1,11 @@
import { Parser, Printer } from "../index.js";
export declare const parsers: {
markdown: Parser;
mdx: Parser;
remark: Parser;
};
export declare const printers: {
mdast: Printer;
};

View File

@@ -0,0 +1,39 @@
'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import { AnimateHeight } from '@payloadcms/ui';
import { PillSelector } from '@payloadcms/ui';
import React from 'react';
const baseClass = 'select-version-locales';
export const SelectLocales = ({
locales,
localeSelectorOpen,
onChange
}) => {
return /*#__PURE__*/_jsx(AnimateHeight, {
className: baseClass,
height: localeSelectorOpen ? 'auto' : 0,
id: `${baseClass}-locales`,
children: /*#__PURE__*/_jsx(PillSelector, {
onClick: ({
pill
}) => {
const newLocales = locales.map(locale => {
if (locale.name === pill.name) {
return {
...locale,
selected: !pill.selected
};
} else {
return locale;
}
});
onChange({
locales: newLocales
});
},
pills: locales
})
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,333 @@
// @ts-check
/** @typedef { import('estree').BaseNode} BaseNode */
/** @typedef {{
skip: () => void;
remove: () => void;
replace: (node: BaseNode) => void;
}} WalkerContext */
class WalkerBase {
constructor() {
/** @type {boolean} */
this.should_skip = false;
/** @type {boolean} */
this.should_remove = false;
/** @type {BaseNode | null} */
this.replacement = null;
/** @type {WalkerContext} */
this.context = {
skip: () => (this.should_skip = true),
remove: () => (this.should_remove = true),
replace: (node) => (this.replacement = node)
};
}
/**
*
* @param {any} parent
* @param {string} prop
* @param {number} index
* @param {BaseNode} node
*/
replace(parent, prop, index, node) {
if (parent) {
if (index !== null) {
parent[prop][index] = node;
} else {
parent[prop] = node;
}
}
}
/**
*
* @param {any} parent
* @param {string} prop
* @param {number} index
*/
remove(parent, prop, index) {
if (parent) {
if (index !== null) {
parent[prop].splice(index, 1);
} else {
delete parent[prop];
}
}
}
}
// @ts-check
/** @typedef { import('estree').BaseNode} BaseNode */
/** @typedef { import('./walker.js').WalkerContext} WalkerContext */
/** @typedef {(
* this: WalkerContext,
* node: BaseNode,
* parent: BaseNode,
* key: string,
* index: number
* ) => void} SyncHandler */
class SyncWalker extends WalkerBase {
/**
*
* @param {SyncHandler} enter
* @param {SyncHandler} leave
*/
constructor(enter, leave) {
super();
/** @type {SyncHandler} */
this.enter = enter;
/** @type {SyncHandler} */
this.leave = leave;
}
/**
*
* @param {BaseNode} node
* @param {BaseNode} parent
* @param {string} [prop]
* @param {number} [index]
* @returns {BaseNode}
*/
visit(node, parent, prop, index) {
if (node) {
if (this.enter) {
const _should_skip = this.should_skip;
const _should_remove = this.should_remove;
const _replacement = this.replacement;
this.should_skip = false;
this.should_remove = false;
this.replacement = null;
this.enter.call(this.context, node, parent, prop, index);
if (this.replacement) {
node = this.replacement;
this.replace(parent, prop, index, node);
}
if (this.should_remove) {
this.remove(parent, prop, index);
}
const skipped = this.should_skip;
const removed = this.should_remove;
this.should_skip = _should_skip;
this.should_remove = _should_remove;
this.replacement = _replacement;
if (skipped) return node;
if (removed) return null;
}
for (const key in node) {
const value = node[key];
if (typeof value !== "object") {
continue;
} else if (Array.isArray(value)) {
for (let i = 0; i < value.length; i += 1) {
if (value[i] !== null && typeof value[i].type === 'string') {
if (!this.visit(value[i], node, key, i)) {
// removed
i--;
}
}
}
} else if (value !== null && typeof value.type === "string") {
this.visit(value, node, key, null);
}
}
if (this.leave) {
const _replacement = this.replacement;
const _should_remove = this.should_remove;
this.replacement = null;
this.should_remove = false;
this.leave.call(this.context, node, parent, prop, index);
if (this.replacement) {
node = this.replacement;
this.replace(parent, prop, index, node);
}
if (this.should_remove) {
this.remove(parent, prop, index);
}
const removed = this.should_remove;
this.replacement = _replacement;
this.should_remove = _should_remove;
if (removed) return null;
}
}
return node;
}
}
// @ts-check
/** @typedef { import('estree').BaseNode} BaseNode */
/** @typedef { import('./walker').WalkerContext} WalkerContext */
/** @typedef {(
* this: WalkerContext,
* node: BaseNode,
* parent: BaseNode,
* key: string,
* index: number
* ) => Promise<void>} AsyncHandler */
class AsyncWalker extends WalkerBase {
/**
*
* @param {AsyncHandler} enter
* @param {AsyncHandler} leave
*/
constructor(enter, leave) {
super();
/** @type {AsyncHandler} */
this.enter = enter;
/** @type {AsyncHandler} */
this.leave = leave;
}
/**
*
* @param {BaseNode} node
* @param {BaseNode} parent
* @param {string} [prop]
* @param {number} [index]
* @returns {Promise<BaseNode>}
*/
async visit(node, parent, prop, index) {
if (node) {
if (this.enter) {
const _should_skip = this.should_skip;
const _should_remove = this.should_remove;
const _replacement = this.replacement;
this.should_skip = false;
this.should_remove = false;
this.replacement = null;
await this.enter.call(this.context, node, parent, prop, index);
if (this.replacement) {
node = this.replacement;
this.replace(parent, prop, index, node);
}
if (this.should_remove) {
this.remove(parent, prop, index);
}
const skipped = this.should_skip;
const removed = this.should_remove;
this.should_skip = _should_skip;
this.should_remove = _should_remove;
this.replacement = _replacement;
if (skipped) return node;
if (removed) return null;
}
for (const key in node) {
const value = node[key];
if (typeof value !== "object") {
continue;
} else if (Array.isArray(value)) {
for (let i = 0; i < value.length; i += 1) {
if (value[i] !== null && typeof value[i].type === 'string') {
if (!(await this.visit(value[i], node, key, i))) {
// removed
i--;
}
}
}
} else if (value !== null && typeof value.type === "string") {
await this.visit(value, node, key, null);
}
}
if (this.leave) {
const _replacement = this.replacement;
const _should_remove = this.should_remove;
this.replacement = null;
this.should_remove = false;
await this.leave.call(this.context, node, parent, prop, index);
if (this.replacement) {
node = this.replacement;
this.replace(parent, prop, index, node);
}
if (this.should_remove) {
this.remove(parent, prop, index);
}
const removed = this.should_remove;
this.replacement = _replacement;
this.should_remove = _should_remove;
if (removed) return null;
}
}
return node;
}
}
// @ts-check
/** @typedef { import('estree').BaseNode} BaseNode */
/** @typedef { import('./sync.js').SyncHandler} SyncHandler */
/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */
/**
*
* @param {BaseNode} ast
* @param {{
* enter?: SyncHandler
* leave?: SyncHandler
* }} walker
* @returns {BaseNode}
*/
function walk(ast, { enter, leave }) {
const instance = new SyncWalker(enter, leave);
return instance.visit(ast, null);
}
/**
*
* @param {BaseNode} ast
* @param {{
* enter?: AsyncHandler
* leave?: AsyncHandler
* }} walker
* @returns {Promise<BaseNode>}
*/
async function asyncWalk(ast, { enter, leave }) {
const instance = new AsyncWalker(enter, leave);
return await instance.visit(ast, null);
}
export { asyncWalk, walk };

View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.js";
const dateFormats = {
full: "EEEE، do MMMM y",
long: "do MMMM y",
medium: "dd/MMM/y",
short: "d/MM/y",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} 'الساعة' {{time}}",
long: "{{date}} 'الساعة' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

View File

@@ -0,0 +1,35 @@
import { addDays } from "./addDays.mjs";
import { getISODay } from "./getISODay.mjs";
import { toDate } from "./toDate.mjs";
/**
* @name setISODay
* @category Weekday Helpers
* @summary Set the day of the ISO week to the given date.
*
* @description
* Set the day of the ISO week to the given date.
* ISO week starts with Monday.
* 7 is the index of Sunday, 1 is the index of Monday etc.
*
* @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 day - The day of the ISO week of the new date
*
* @returns The new date with the day of the ISO week set
*
* @example
* // Set Sunday to 1 September 2014:
* const result = setISODay(new Date(2014, 8, 1), 7)
* //=> Sun Sep 07 2014 00:00:00
*/
export function setISODay(date, day) {
const _date = toDate(date);
const currentDay = getISODay(_date);
const diff = day - currentDay;
return addDays(_date, diff);
}
// Fallback for modularized imports:
export default setISODay;

View File

@@ -0,0 +1,3 @@
export { ActiveDraggableContext, DndContext } from './DndContext';
export type { CancelDrop, Props as DndContextProps } from './DndContext';
export type { DraggableMeasuring, MeasuringConfiguration } from './types';

View File

@@ -0,0 +1,6 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function t(r,{instancePath:a="",parentData:n,parentDataProperty:o,rootData:e=r}={}){let s=null,i=0;if(0===i){if(!r||"object"!=typeof r||Array.isArray(r))return t.errors=[{params:{type:"object"}}],!1;{const a=i;for(const a in r)if("dataUrlCondition"!==a)return t.errors=[{params:{additionalProperty:a}}],!1;if(a===i&&void 0!==r.dataUrlCondition){let a=r.dataUrlCondition;const n=i;let o=!1;const e=i;if(i==i)if(a&&"object"==typeof a&&!Array.isArray(a)){const t=i;for(const t in a)if("maxSize"!==t){const r={params:{additionalProperty:t}};null===s?s=[r]:s.push(r),i++;break}if(t===i&&void 0!==a.maxSize&&"number"!=typeof a.maxSize){const t={params:{type:"number"}};null===s?s=[t]:s.push(t),i++}}else{const t={params:{type:"object"}};null===s?s=[t]:s.push(t),i++}var l=e===i;if(o=o||l,!o){const t=i;if(!(a instanceof Function)){const t={params:{}};null===s?s=[t]:s.push(t),i++}l=t===i,o=o||l}if(!o){const r={params:{}};return null===s?s=[r]:s.push(r),i++,t.errors=s,!1}i=n,null!==s&&(n?s.length=n:s=null)}}}return t.errors=s,0===i}function r(a,{instancePath:n="",parentData:o,parentDataProperty:e,rootData:s=a}={}){let i=null,l=0;return t(a,{instancePath:n,parentData:o,parentDataProperty:e,rootData:s})||(i=null===i?t.errors:i.concat(t.errors),l=i.length),r.errors=i,0===l}module.exports=r,module.exports.default=r;

View File

@@ -0,0 +1,70 @@
{
"name": "supports-preserve-symlinks-flag",
"version": "1.0.0",
"description": "Determine if the current node version supports the `--preserve-symlinks` flag.",
"main": "./index.js",
"browser": "./browser.js",
"exports": {
".": [
{
"browser": "./browser.js",
"default": "./index.js"
},
"./index.js"
],
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"lint": "eslint --ext=js,mjs .",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "aud --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/inspect-js/node-supports-preserve-symlinks-flag.git"
},
"keywords": [
"node",
"flag",
"symlink",
"symlinks",
"preserve-symlinks"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/inspect-js/node-supports-preserve-symlinks-flag/issues"
},
"homepage": "https://github.com/inspect-js/node-supports-preserve-symlinks-flag#readme",
"devDependencies": {
"@ljharb/eslint-config": "^20.1.0",
"aud": "^1.1.5",
"auto-changelog": "^2.3.0",
"eslint": "^8.6.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"semver": "^6.3.0",
"tape": "^5.4.0"
},
"engines": {
"node": ">= 0.4"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
}
}

View File

@@ -0,0 +1,136 @@
# @parcel/watcher
A native C++ Node module for querying and subscribing to filesystem events. Used by [Parcel 2](https://github.com/parcel-bundler/parcel).
## Features
- **Watch** - subscribe to realtime recursive directory change notifications when files or directories are created, updated, or deleted.
- **Query** - performantly query for historical change events in a directory, even when your program is not running.
- **Native** - implemented in C++ for performance and low-level integration with the operating system.
- **Cross platform** - includes backends for macOS, Linux, Windows, FreeBSD, and Watchman.
- **Performant** - events are throttled in C++ so the JavaScript thread is not overwhelmed during large filesystem changes (e.g. `git checkout` or `npm install`).
- **Scalable** - tens of thousands of files can be watched or queried at once with good performance.
## Example
```javascript
const watcher = require('@parcel/watcher');
const path = require('path');
// Subscribe to events
let subscription = await watcher.subscribe(process.cwd(), (err, events) => {
console.log(events);
});
// later on...
await subscription.unsubscribe();
// Get events since some saved snapshot in the past
let snapshotPath = path.join(process.cwd(), 'snapshot.txt');
let events = await watcher.getEventsSince(process.cwd(), snapshotPath);
// Save a snapshot for later
await watcher.writeSnapshot(process.cwd(), snapshotPath);
```
## Watching
`@parcel/watcher` supports subscribing to realtime notifications of changes in a directory. It works recursively, so changes in sub-directories will also be emitted.
Events are throttled and coalesced for performance during large changes like `git checkout` or `npm install`, and a single notification will be emitted with all of the events at the end.
Only one notification will be emitted per file. For example, if a file was both created and updated since the last event, you'll get only a `create` event. If a file is both created and deleted, you will not be notifed of that file. Renames cause two events: a `delete` for the old name, and a `create` for the new name.
```javascript
let subscription = await watcher.subscribe(process.cwd(), (err, events) => {
console.log(events);
});
```
Events have two properties:
- `type` - the event type: `create`, `update`, or `delete`.
- `path` - the absolute path to the file or directory.
To unsubscribe from change notifications, call the `unsubscribe` method on the returned subscription object.
```javascript
await subscription.unsubscribe();
```
`@parcel/watcher` has the following watcher backends, listed in priority order:
- [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) on macOS
- [Watchman](https://facebook.github.io/watchman/) if installed
- [inotify](http://man7.org/linux/man-pages/man7/inotify.7.html) on Linux
- [ReadDirectoryChangesW](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365465%28v%3Dvs.85%29.aspx) on Windows
- [kqueue](https://man.freebsd.org/cgi/man.cgi?kqueue) on FreeBSD, or as an alternative to FSEvents on macOS
You can specify the exact backend you wish to use by passing the `backend` option. If that backend is not available on the current platform, the default backend will be used instead. See below for the list of backend names that can be passed to the options.
## Querying
`@parcel/watcher` also supports querying for historical changes made in a directory, even when your program is not running. This makes it easy to invalidate a cache and re-build only the files that have changed, for example. It can be **significantly** faster than traversing the entire filesystem to determine what files changed, depending on the platform.
In order to query for historical changes, you first need a previous snapshot to compare to. This can be saved to a file with the `writeSnapshot` function, e.g. just before your program exits.
```javascript
await watcher.writeSnapshot(dirPath, snapshotPath);
```
When your program starts up, you can query for changes that have occurred since that snapshot using the `getEventsSince` function.
```javascript
let events = await watcher.getEventsSince(dirPath, snapshotPath);
```
The events returned are exactly the same as the events that would be passed to the `subscribe` callback (see above).
`@parcel/watcher` has the following watcher backends, listed in priority order:
- [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) on macOS
- [Watchman](https://facebook.github.io/watchman/) if installed
- [fts](http://man7.org/linux/man-pages/man3/fts.3.html) (brute force) on Linux and FreeBSD
- [FindFirstFile](https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea) (brute force) on Windows
The FSEvents (macOS) and Watchman backends are significantly more performant than the brute force backends used by default on Linux and Windows, for example returning results in miliseconds instead of seconds for large directory trees. This is because a background daemon monitoring filesystem changes on those platforms allows us to query cached data rather than traversing the filesystem manually (brute force).
macOS has good performance with FSEvents by default. For the best performance on other platforms, install [Watchman](https://facebook.github.io/watchman/) and it will be used by `@parcel/watcher` automatically.
You can specify the exact backend you wish to use by passing the `backend` option. If that backend is not available on the current platform, the default backend will be used instead. See below for the list of backend names that can be passed to the options.
## Options
All of the APIs in `@parcel/watcher` support the following options, which are passed as an object as the last function argument.
- `ignore` - an array of paths or glob patterns to ignore. uses [`is-glob`](https://github.com/micromatch/is-glob) to distinguish paths from globs. glob patterns are parsed with [`picomatch`](https://github.com/micromatch/picomatch) (see [features](https://github.com/micromatch/picomatch#globbing-features)).
- paths can be relative or absolute and can either be files or directories. No events will be emitted about these files or directories or their children.
- glob patterns match on relative paths from the root that is watched. No events will be emitted for matching paths.
- `backend` - the name of an explicitly chosen backend to use. Allowed options are `"fs-events"`, `"watchman"`, `"inotify"`, `"kqueue"`, `"windows"`, or `"brute-force"` (only for querying). If the specified backend is not available on the current platform, the default backend will be used instead.
## WASM
The `@parcel/watcher-wasm` package can be used in place of `@parcel/watcher` on unsupported platforms. It relies on the Node `fs` module, so in non-Node environments such as browsers, an `fs` polyfill will be needed.
**Note**: the WASM implementation is significantly less efficient than the native implementations because it must crawl the file system to watch each directory individually. Use the native `@parcel/watcher` package wherever possible.
```js
import {subscribe} from '@parcel/watcher-wasm';
// Use the module as documented above.
subscribe(/* ... */);
```
## Who is using this?
- [Parcel 2](https://parceljs.org/)
- [VSCode](https://code.visualstudio.com/updates/v1_62#_file-watching-changes)
- [Tailwind CSS Intellisense](https://github.com/tailwindlabs/tailwindcss-intellisense)
- [Gatsby Cloud](https://twitter.com/chatsidhartha/status/1435647412828196867)
- [Nx](https://nx.dev)
- [Nuxt](https://nuxt.com)
- [Meteor](https://github.com/meteor/meteor)
## License
MIT

View File

@@ -0,0 +1,51 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import type { NonArray, Writable } from "../../utils.cjs";
import { MySqlColumn, MySqlColumnBuilder } from "./common.cjs";
export type MySqlEnumColumnBuilderInitial<TName extends string, TEnum extends string[]> = MySqlEnumColumnBuilder<{
name: TName;
dataType: 'string';
columnType: 'MySqlEnumColumn';
data: TEnum[number];
driverParam: string;
enumValues: TEnum;
}>;
export declare class MySqlEnumColumnBuilder<T extends ColumnBuilderBaseConfig<'string', 'MySqlEnumColumn'>> extends MySqlColumnBuilder<T, {
enumValues: T['enumValues'];
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], values: T['enumValues']);
}
export declare class MySqlEnumColumn<T extends ColumnBaseConfig<'string', 'MySqlEnumColumn'>> extends MySqlColumn<T, {
enumValues: T['enumValues'];
}> {
static readonly [entityKind]: string;
readonly enumValues: T["enumValues"];
getSQLType(): string;
}
export type MySqlEnumObjectColumnBuilderInitial<TName extends string, TEnum extends object> = MySqlEnumObjectColumnBuilder<{
name: TName;
dataType: 'string';
columnType: 'MySqlEnumObjectColumn';
data: TEnum[keyof TEnum];
driverParam: string;
enumValues: string[];
}>;
export declare class MySqlEnumObjectColumnBuilder<T extends ColumnBuilderBaseConfig<'string', 'MySqlEnumObjectColumn'>> extends MySqlColumnBuilder<T, {
enumValues: T['enumValues'];
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], values: T['enumValues']);
}
export declare class MySqlEnumObjectColumn<T extends ColumnBaseConfig<'string', 'MySqlEnumObjectColumn'>> extends MySqlColumn<T, {
enumValues: T['enumValues'];
}> {
static readonly [entityKind]: string;
readonly enumValues: T["enumValues"];
getSQLType(): string;
}
export declare function mysqlEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T | Writable<T>): MySqlEnumColumnBuilderInitial<'', Writable<T>>;
export declare function mysqlEnum<TName extends string, U extends string, T extends Readonly<[U, ...U[]]>>(name: TName, values: T | Writable<T>): MySqlEnumColumnBuilderInitial<TName, Writable<T>>;
export declare function mysqlEnum<E extends Record<string, string>>(enumObj: NonArray<E>): MySqlEnumObjectColumnBuilderInitial<'', E>;
export declare function mysqlEnum<TName extends string, E extends Record<string, string>>(name: TName, values: NonArray<E>): MySqlEnumObjectColumnBuilderInitial<TName, E>;

View File

@@ -0,0 +1,25 @@
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import './index.scss';
const baseClass = 'gear';
export const GearIcon = ({
ariaLabel,
className
}) => /*#__PURE__*/_jsx("div", {
"aria-label": ariaLabel,
className: [className, baseClass].filter(Boolean).join(' '),
children: /*#__PURE__*/_jsx("svg", {
className: "icon icon--gear",
fill: "none",
height: "20",
viewBox: "0 0 20 20",
width: "20",
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/_jsx("path", {
d: "M9.33337 8.84671L6.66671 4.22671M9.33337 11.1534L6.66671 15.7734M10 16.6667V15.3334M10 15.3334C12.9456 15.3334 15.3334 12.9456 15.3334 10C15.3334 7.05452 12.9456 4.66671 10 4.66671M10 15.3334C7.05452 15.3334 4.66671 12.9456 4.66671 10M10 3.33337V4.66671M10 4.66671C7.05452 4.66671 4.66671 7.05452 4.66671 10M11.3334 10H16.6667M11.3334 10C11.3334 10.7364 10.7364 11.3334 10 11.3334C9.26366 11.3334 8.66671 10.7364 8.66671 10C8.66671 9.26366 9.26366 8.66671 10 8.66671C10.7364 8.66671 11.3334 9.26366 11.3334 10ZM13.3334 15.7734L12.6667 14.62M13.3334 4.22671L12.6667 5.38004M3.33337 10H4.66671M15.7734 13.3334L14.62 12.6667M15.7734 6.66671L14.62 7.33337M4.22671 13.3334L5.38004 12.6667M4.22671 6.66671L5.38004 7.33337",
strokeLinecap: "round",
strokeLinejoin: "round"
})
})
});
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Gamepad = createLucideIcon("Gamepad", [
["line", { x1: "6", x2: "10", y1: "12", y2: "12", key: "161bw2" }],
["line", { x1: "8", x2: "8", y1: "10", y2: "14", key: "1i6ji0" }],
["line", { x1: "15", x2: "15.01", y1: "13", y2: "13", key: "dqpgro" }],
["line", { x1: "18", x2: "18.01", y1: "11", y2: "11", key: "meh2c" }],
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }]
]);
export { Gamepad as default };
//# sourceMappingURL=gamepad.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getMachineId-win.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-win.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,mCAAmC;AACnC,2CAAwC;AACxC,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,GACR,4EAA4E,CAAC;IAC/E,IAAI,OAAO,GAAG,6BAA6B,CAAC;IAC5C,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,wBAAwB,IAAI,OAAO,CAAC,GAAG,EAAE;QACtE,OAAO,GAAG,kCAAkC,GAAG,OAAO,CAAC;KACxD;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACxB;KACF;IAAC,OAAO,CAAC,EAAE;QACV,UAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,oCAmBC","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 * as process from 'process';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const args =\n 'QUERY HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography /v MachineGuid';\n let command = '%windir%\\\\System32\\\\REG.exe';\n if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) {\n command = '%windir%\\\\sysnative\\\\cmd.exe /c ' + command;\n }\n\n try {\n const result = await execAsync(`${command} ${args}`);\n const parts = result.stdout.split('REG_SZ');\n if (parts.length === 2) {\n return parts[1].trim();\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]}

View File

@@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var op_sqlite_exports = {};
module.exports = __toCommonJS(op_sqlite_exports);
__reExport(op_sqlite_exports, require("./driver.cjs"), module.exports);
__reExport(op_sqlite_exports, require("./session.cjs"), module.exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
...require("./driver.cjs"),
...require("./session.cjs")
});
//# sourceMappingURL=index.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messageTruncation.d.ts","sourceRoot":"","sources":["../../../../src/tracing/ai/messageTruncation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kCAAkC,QAAQ,CAAC;AAgaxD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE9D"}

View File

@@ -0,0 +1,77 @@
var OverloadYield = require("./OverloadYield.js");
var regenerator = require("./regenerator.js");
var regeneratorAsync = require("./regeneratorAsync.js");
var regeneratorAsyncGen = require("./regeneratorAsyncGen.js");
var regeneratorAsyncIterator = require("./regeneratorAsyncIterator.js");
var regeneratorKeys = require("./regeneratorKeys.js");
var regeneratorValues = require("./regeneratorValues.js");
function _regeneratorRuntime() {
"use strict";
var r = regenerator(),
e = r.m(_regeneratorRuntime),
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
function n(r) {
var e = "function" == typeof r && r.constructor;
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
}
var o = {
"throw": 1,
"return": 2,
"break": 3,
"continue": 3
};
function a(r) {
var e, t;
return function (n) {
e || (e = {
stop: function stop() {
return t(n.a, 2);
},
"catch": function _catch() {
return n.v;
},
abrupt: function abrupt(r, e) {
return t(n.a, o[r], e);
},
delegateYield: function delegateYield(r, o, a) {
return e.resultName = o, t(n.d, regeneratorValues(r), a);
},
finish: function finish(r) {
return t(n.f, r);
}
}, t = function t(r, _t, o) {
n.p = e.prev, n.n = e.next;
try {
return r(_t, o);
} finally {
e.next = n.n;
}
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
try {
return r.call(this, e);
} finally {
n.p = e.prev, n.n = e.next;
}
};
}
return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
return {
wrap: function wrap(e, t, n, o) {
return r.w(a(e), t, n, o && o.reverse());
},
isGeneratorFunction: n,
mark: r.m,
awrap: function awrap(r, e) {
return new OverloadYield(r, e);
},
AsyncIterator: regeneratorAsyncIterator,
async: function async(r, e, t, o, u) {
return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
},
keys: regeneratorKeys,
values: regeneratorValues
};
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
}
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;

View File

@@ -0,0 +1 @@
{"version":3,"file":"DrawerContent.d.ts","sourceRoot":"","sources":["../../../src/elements/EditMany/DrawerContent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,KAAK,EAAE,MAAM,SAAS,CAAA;AAYhD,OAAO,KAAoD,MAAM,OAAO,CAAA;AAIxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAiBvE,OAAO,cAAc,CAAA;AACrB,OAAO,qCAAqC,CAAA;AAC5C,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AA+E1D,KAAK,0BAA0B,GAAG;IAChC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,cAAc,EAAE,WAAW,EAAE,CAAA;IAC7B;;OAEG;IACH,iBAAiB,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,IAAI,CAAA;IAClD,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,aAAa,CAAA;AAEjB,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAiRtE,CAAA"}

View File

@@ -0,0 +1,179 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["e.m.a", "m.a.j"],
abbreviated: ["e.m.a", "m.a.j"],
wide: ["enne meie ajaarvamist", "meie ajaarvamise järgi"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["K1", "K2", "K3", "K4"],
wide: ["1. kvartal", "2. kvartal", "3. kvartal", "4. kvartal"],
};
const monthValues = {
narrow: ["J", "V", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"jaan",
"veebr",
"märts",
"apr",
"mai",
"juuni",
"juuli",
"aug",
"sept",
"okt",
"nov",
"dets",
],
wide: [
"jaanuar",
"veebruar",
"märts",
"aprill",
"mai",
"juuni",
"juuli",
"august",
"september",
"oktoober",
"november",
"detsember",
],
};
const dayValues = {
narrow: ["P", "E", "T", "K", "N", "R", "L"],
short: ["P", "E", "T", "K", "N", "R", "L"],
abbreviated: [
"pühap.",
"esmasp.",
"teisip.",
"kolmap.",
"neljap.",
"reede.",
"laup.",
],
wide: [
"pühapäev",
"esmaspäev",
"teisipäev",
"kolmapäev",
"neljapäev",
"reede",
"laupäev",
],
};
const dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "kesköö",
noon: "keskpäev",
morning: "hommik",
afternoon: "pärastlõuna",
evening: "õhtu",
night: "öö",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "kesköö",
noon: "keskpäev",
morning: "hommik",
afternoon: "pärastlõuna",
evening: "õhtu",
night: "öö",
},
wide: {
am: "AM",
pm: "PM",
midnight: "kesköö",
noon: "keskpäev",
morning: "hommik",
afternoon: "pärastlõuna",
evening: "õhtu",
night: "öö",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "keskööl",
noon: "keskpäeval",
morning: "hommikul",
afternoon: "pärastlõunal",
evening: "õhtul",
night: "öösel",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "keskööl",
noon: "keskpäeval",
morning: "hommikul",
afternoon: "pärastlõunal",
evening: "õhtul",
night: "öösel",
},
wide: {
am: "AM",
pm: "PM",
midnight: "keskööl",
noon: "keskpäeval",
morning: "hommikul",
afternoon: "pärastlõunal",
evening: "õhtul",
night: "öösel",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + ".";
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
formattingValues: monthValues,
defaultFormattingWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
formattingValues: dayValues,
defaultFormattingWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","CopyIcon","_jsx","className","viewBox","xmlns","d","strokeLinecap"],"sources":["../../../src/icons/Copy/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport './index.scss'\n\nexport const CopyIcon: React.FC = () => (\n // <svg className=\"icon icon--copy\" viewBox=\"0 0 25 25\" xmlns=\"http://www.w3.org/2000/svg\">\n // <rect className=\"stroke\" height=\"8\" width=\"8\" x=\"6.5\" y=\"10\" />\n // <path className=\"stroke\" d=\"M10 9.98438V6.5H18V14.5H14\" />\n // </svg>\n <svg className=\"icon icon--copy\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n className=\"stroke\"\n d=\"M4.66666 12.6667C3.93333 12.6667 3.33333 12.0667 3.33333 11.3333V4.66668C3.33333 3.93334 3.93333 3.33334 4.66666 3.33334H11.3333C12.0667 3.33334 12.6667 3.93334 12.6667 4.66668M8.66666 7.33334H15.3333C16.0697 7.33334 16.6667 7.9303 16.6667 8.66668V15.3333C16.6667 16.0697 16.0697 16.6667 15.3333 16.6667H8.66666C7.93028 16.6667 7.33333 16.0697 7.33333 15.3333V8.66668C7.33333 7.9303 7.93028 7.33334 8.66666 7.33334Z\"\n strokeLinecap=\"square\"\n />\n </svg>\n)\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AAElB,OAAO;AAEP,OAAO,MAAMC,QAAA,GAAqBA,CAAA;AAChC;AACA;AACA;AACA;;AACAC,IAAA,CAAC;EAAIC,SAAA,EAAU;EAAkBC,OAAA,EAAQ;EAAYC,KAAA,EAAM;YACzD,aAAAH,IAAA,CAAC;IACCC,SAAA,EAAU;IACVG,CAAA,EAAE;IACFC,aAAA,EAAc","ignoreList":[]}

View File

@@ -0,0 +1,10 @@
import type { Collection, CollectionSlug, DataFromCollectionSlug, PayloadRequest, RequiredDataFromCollectionSlug } from 'payload';
export type Resolver<TSlug extends CollectionSlug> = (_: unknown, args: {
data: RequiredDataFromCollectionSlug<TSlug>;
draft: boolean;
locale?: string;
}, context: {
req: PayloadRequest;
}) => Promise<DataFromCollectionSlug<TSlug>>;
export declare function createResolver<TSlug extends CollectionSlug>(collection: Collection): Resolver<TSlug>;
//# sourceMappingURL=create.d.ts.map

View File

@@ -0,0 +1,6 @@
import type { CollectionConfig } from '../../index.js';
/**
* Validate useAsTitle for collections.
*/
export declare const validateUseAsTitle: (config: CollectionConfig) => void;
//# sourceMappingURL=useAsTitle.d.ts.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB 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 4C 5C","578":"KC LC MC NC Q H R YC"},D:{"1":"0 1 2 3 4 5 6 7 8 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 vB wB xB yB zB 0B 1B 2B 3B 4B 5B","257":"EC FC","450":"WC 6B XC 7B 8B 9B AC BC CC DC"},E:{"1":"L M G 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 B C 6C bC 7C 8C 9C AD cC PC"},F:{"1":"0 1 2 3 4 5 6 7 8 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 iB jB kB lB mB nB oB pB qB rB sB JD KD LD MD PC xC ND QC","257":"3B 4B","450":"tB uB vB wB xB yB zB 0B 1B 2B"},G:{"1":"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 WD XD YD ZD"},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:{"2":"A B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB cC yD zD 0D 1D 2D SC TC UC 3D","2":"J tD uD vD wD xD"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"7D","2":"6D"}},B:5,C:"CSS Conical Gradients",D:true};

View File

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

View File

@@ -0,0 +1,3 @@
export { fr } from '@payloadcms/translations/languages/fr';
//# sourceMappingURL=fr.js.map

View File

@@ -0,0 +1,27 @@
var ListCache = require('./_ListCache'),
stackClear = require('./_stackClear'),
stackDelete = require('./_stackDelete'),
stackGet = require('./_stackGet'),
stackHas = require('./_stackHas'),
stackSet = require('./_stackSet');
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;

View File

@@ -0,0 +1,36 @@
import { DirectusPreset } from "../../../schema/preset.cjs";
import { NestedPartial } from "../../../types/utils.cjs";
import { ApplyQueryFields } from "../../../types/output.cjs";
import { Query } from "../../../types/query.cjs";
import { RestCommand } from "../../types.cjs";
//#region src/rest/commands/update/presets.d.ts
type UpdatePresetOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusPreset<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
/**
* Update multiple existing presets.
* @param keys
* @param item
* @param query
* @returns Returns the preset objects for the updated presets.
* @throws Will throw if keys is empty
*/
declare const updatePresets: <Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(keys: DirectusPreset<Schema>["id"][], item: NestedPartial<DirectusPreset<Schema>>, query?: TQuery) => RestCommand<UpdatePresetOutput<Schema, TQuery>[], Schema>;
/**
* Update multiple presets as batch.
* @param items
* @param query
* @returns Returns the preset objects for the updated presets.
*/
declare const updatePresetsBatch: <Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(items: NestedPartial<DirectusPreset<Schema>>[], query?: TQuery) => RestCommand<UpdatePresetOutput<Schema, TQuery>[], Schema>;
/**
* Update an existing preset.
* @param key
* @param item
* @param query
* @returns Returns the preset object for the updated preset.
* @throws Will throw if key is empty
*/
declare const updatePreset: <Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(key: DirectusPreset<Schema>["id"], item: NestedPartial<DirectusPreset<Schema>>, query?: TQuery) => RestCommand<UpdatePresetOutput<Schema, TQuery>, Schema>;
//#endregion
export { UpdatePresetOutput, updatePreset, updatePresets, updatePresetsBatch };
//# sourceMappingURL=presets.d.cts.map

View File

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

View File

@@ -0,0 +1,35 @@
@import '../../scss/styles.scss';
@layer payload-default {
.array-actions {
&__button {
@extend %btn-reset;
cursor: pointer;
border-radius: 100px;
&:hover {
background: var(--theme-elevation-0);
}
}
&__actions {
list-style: none;
margin: 0;
padding: 0;
}
&__action {
display: flex;
gap: calc(var(--base) / 2);
align-items: center;
svg {
position: relative;
.stroke {
stroke-width: 1px;
}
}
}
}
}

View File

@@ -0,0 +1,213 @@
import type { AcceptedLanguages, I18nClient } from '@payloadcms/translations';
import type React from 'react';
import type { ImportMap } from '../bin/generateImportMap/index.js';
import type { TypeWithID } from '../collections/config/types.js';
import type { SanitizedConfig } from '../config/types.js';
import type { Block, ClientBlock, ClientField, Field, FieldTypes, Tab } from '../fields/config/types.js';
import type { JsonObject } from '../types/index.js';
import type { ClientTab } from './fields/Tabs.js';
import type { BuildFormStateArgs, Data, FieldState, FieldStateWithoutComponents, FilterOptionsResult, FormState, FormStateWithoutComponents, Row } from './forms/Form.js';
export type {
/**
* @deprecated
* The `CustomPreviewButton` type is deprecated and will be removed in the next major version.
* This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.
*/
CustomComponent as CustomPreviewButton,
/**
* @deprecated
* The `CustomPublishButton` type is deprecated and will be removed in the next major version.
* This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.
*/
CustomComponent as CustomPublishButton,
/**
* @deprecated
* The `CustomSaveButton` type is deprecated and will be removed in the next major version.
* This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.
*/
CustomComponent as CustomSaveButton,
/**
* @deprecated
* The `CustomSaveDraftButton` type is deprecated and will be removed in the next major version.
* This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.
*/
CustomComponent as CustomSaveDraftButton, } from '../config/types.js';
export type { DefaultCellComponentProps, DefaultServerCellComponentProps } from './elements/Cell.js';
export type { ConditionalDateProps } from './elements/DatePicker.js';
export type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js';
export type { EditMenuItemsClientProps, EditMenuItemsServerProps, EditMenuItemsServerPropsOnly, } from './elements/EditMenuItems.js';
export type { NavGroupPreferences, NavPreferences } from './elements/Nav.js';
export type { PreviewButtonClientProps, PreviewButtonServerProps, PreviewButtonServerPropsOnly, } from './elements/PreviewButton.js';
export type { PublishButtonClientProps, PublishButtonServerProps, PublishButtonServerPropsOnly, } from './elements/PublishButton.js';
export type { SaveButtonClientProps, SaveButtonServerProps, SaveButtonServerPropsOnly, } from './elements/SaveButton.js';
export type { SaveDraftButtonClientProps, SaveDraftButtonServerProps, SaveDraftButtonServerPropsOnly, } from './elements/SaveDraftButton.js';
export type { CustomStatus } from './elements/Status.js';
export type { Column } from './elements/Table.js';
export type { UnpublishButtonClientProps, UnpublishButtonServerProps, UnpublishButtonServerPropsOnly, } from './elements/UnpublishButton.js';
export type { CustomUpload } from './elements/Upload.js';
export type { WithServerSidePropsComponent, WithServerSidePropsComponentProps, } from './elements/WithServerSideProps.js';
export type { ArrayFieldClientComponent, ArrayFieldClientProps, ArrayFieldDescriptionClientComponent, ArrayFieldDescriptionServerComponent, ArrayFieldDiffClientComponent, ArrayFieldDiffServerComponent, ArrayFieldErrorClientComponent, ArrayFieldErrorServerComponent, ArrayFieldLabelClientComponent, ArrayFieldLabelServerComponent, ArrayFieldServerComponent, ArrayFieldServerProps, } from './fields/Array.js';
export type { BlockRowLabelClientComponent, BlockRowLabelServerComponent, BlocksFieldClientComponent, BlocksFieldClientProps, BlocksFieldDescriptionClientComponent, BlocksFieldDescriptionServerComponent, BlocksFieldDiffClientComponent, BlocksFieldDiffServerComponent, BlocksFieldErrorClientComponent, BlocksFieldErrorServerComponent, BlocksFieldLabelClientComponent, BlocksFieldLabelServerComponent, BlocksFieldServerComponent, BlocksFieldServerProps, } from './fields/Blocks.js';
export type { CheckboxFieldClientComponent, CheckboxFieldClientProps, CheckboxFieldDescriptionClientComponent, CheckboxFieldDescriptionServerComponent, CheckboxFieldDiffClientComponent, CheckboxFieldDiffServerComponent, CheckboxFieldErrorClientComponent, CheckboxFieldErrorServerComponent, CheckboxFieldLabelClientComponent, CheckboxFieldLabelServerComponent, CheckboxFieldServerComponent, CheckboxFieldServerProps, } from './fields/Checkbox.js';
export type { CodeFieldClientComponent, CodeFieldClientProps, CodeFieldDescriptionClientComponent, CodeFieldDescriptionServerComponent, CodeFieldDiffClientComponent, CodeFieldDiffServerComponent, CodeFieldErrorClientComponent, CodeFieldErrorServerComponent, CodeFieldLabelClientComponent, CodeFieldLabelServerComponent, CodeFieldServerComponent, CodeFieldServerProps, } from './fields/Code.js';
export type { CollapsibleFieldClientComponent, CollapsibleFieldClientProps, CollapsibleFieldDescriptionClientComponent, CollapsibleFieldDescriptionServerComponent, CollapsibleFieldDiffClientComponent, CollapsibleFieldDiffServerComponent, CollapsibleFieldErrorClientComponent, CollapsibleFieldErrorServerComponent, CollapsibleFieldLabelClientComponent, CollapsibleFieldLabelServerComponent, CollapsibleFieldServerComponent, CollapsibleFieldServerProps, } from './fields/Collapsible.js';
export type { DateFieldClientComponent, DateFieldClientProps, DateFieldDescriptionClientComponent, DateFieldDescriptionServerComponent, DateFieldDiffClientComponent, DateFieldDiffServerComponent, DateFieldErrorClientComponent, DateFieldErrorServerComponent, DateFieldLabelClientComponent, DateFieldLabelServerComponent, DateFieldServerComponent, DateFieldServerProps, } from './fields/Date.js';
export type { EmailFieldClientComponent, EmailFieldClientProps, EmailFieldDescriptionClientComponent, EmailFieldDescriptionServerComponent, EmailFieldDiffClientComponent, EmailFieldDiffServerComponent, EmailFieldErrorClientComponent, EmailFieldErrorServerComponent, EmailFieldLabelClientComponent, EmailFieldLabelServerComponent, EmailFieldServerComponent, EmailFieldServerProps, } from './fields/Email.js';
export type { GroupFieldClientComponent, GroupFieldClientProps, GroupFieldDescriptionClientComponent, GroupFieldDescriptionServerComponent, GroupFieldDiffClientComponent, GroupFieldDiffServerComponent, GroupFieldErrorClientComponent, GroupFieldErrorServerComponent, GroupFieldLabelClientComponent, GroupFieldLabelServerComponent, GroupFieldServerComponent, GroupFieldServerProps, } from './fields/Group.js';
export type { HiddenFieldProps } from './fields/Hidden.js';
export type { JoinFieldClientComponent, JoinFieldClientProps, JoinFieldDescriptionClientComponent, JoinFieldDescriptionServerComponent, JoinFieldDiffClientComponent, JoinFieldDiffServerComponent, JoinFieldErrorClientComponent, JoinFieldErrorServerComponent, JoinFieldLabelClientComponent, JoinFieldLabelServerComponent, JoinFieldServerComponent, JoinFieldServerProps, } from './fields/Join.js';
export type { JSONFieldClientComponent, JSONFieldClientProps, JSONFieldDescriptionClientComponent, JSONFieldDescriptionServerComponent, JSONFieldDiffClientComponent, JSONFieldDiffServerComponent, JSONFieldErrorClientComponent, JSONFieldErrorServerComponent, JSONFieldLabelClientComponent, JSONFieldLabelServerComponent, JSONFieldServerComponent, JSONFieldServerProps, } from './fields/JSON.js';
export type { NumberFieldClientComponent, NumberFieldClientProps, NumberFieldDescriptionClientComponent, NumberFieldDescriptionServerComponent, NumberFieldDiffClientComponent, NumberFieldDiffServerComponent, NumberFieldErrorClientComponent, NumberFieldErrorServerComponent, NumberFieldLabelClientComponent, NumberFieldLabelServerComponent, NumberFieldServerComponent, NumberFieldServerProps, } from './fields/Number.js';
export type { PointFieldClientComponent, PointFieldClientProps, PointFieldDescriptionClientComponent, PointFieldDescriptionServerComponent, PointFieldDiffClientComponent, PointFieldDiffServerComponent, PointFieldErrorClientComponent, PointFieldErrorServerComponent, PointFieldLabelClientComponent, PointFieldLabelServerComponent, PointFieldServerComponent, PointFieldServerProps, } from './fields/Point.js';
export type { RadioFieldClientComponent, RadioFieldClientProps, RadioFieldDescriptionClientComponent, RadioFieldDescriptionServerComponent, RadioFieldDiffClientComponent, RadioFieldDiffServerComponent, RadioFieldErrorClientComponent, RadioFieldErrorServerComponent, RadioFieldLabelClientComponent, RadioFieldLabelServerComponent, RadioFieldServerComponent, RadioFieldServerProps, } from './fields/Radio.js';
export type { RelationshipFieldClientComponent, RelationshipFieldClientProps, RelationshipFieldDescriptionClientComponent, RelationshipFieldDescriptionServerComponent, RelationshipFieldDiffClientComponent, RelationshipFieldDiffServerComponent, RelationshipFieldErrorClientComponent, RelationshipFieldErrorServerComponent, RelationshipFieldLabelClientComponent, RelationshipFieldLabelServerComponent, RelationshipFieldServerComponent, RelationshipFieldServerProps, } from './fields/Relationship.js';
export type { RichTextFieldClientComponent, RichTextFieldClientProps, RichTextFieldDescriptionClientComponent, RichTextFieldDescriptionServerComponent, RichTextFieldDiffClientComponent, RichTextFieldDiffServerComponent, RichTextFieldErrorClientComponent, RichTextFieldErrorServerComponent, RichTextFieldLabelClientComponent, RichTextFieldLabelServerComponent, RichTextFieldServerComponent, RichTextFieldServerProps, } from './fields/RichText.js';
export type { RowFieldClientComponent, RowFieldClientProps, RowFieldDescriptionClientComponent, RowFieldDescriptionServerComponent, RowFieldDiffClientComponent, RowFieldDiffServerComponent, RowFieldErrorClientComponent, RowFieldErrorServerComponent, RowFieldLabelClientComponent, RowFieldLabelServerComponent, RowFieldServerComponent, RowFieldServerProps, } from './fields/Row.js';
export type { SelectFieldClientComponent, SelectFieldClientProps, SelectFieldDescriptionClientComponent, SelectFieldDescriptionServerComponent, SelectFieldDiffClientComponent, SelectFieldDiffServerComponent, SelectFieldErrorClientComponent, SelectFieldErrorServerComponent, SelectFieldLabelClientComponent, SelectFieldLabelServerComponent, SelectFieldServerComponent, SelectFieldServerProps, } from './fields/Select.js';
export type { ClientTab, TabsFieldClientComponent, TabsFieldClientProps, TabsFieldDescriptionClientComponent, TabsFieldDescriptionServerComponent, TabsFieldDiffClientComponent, TabsFieldDiffServerComponent, TabsFieldErrorClientComponent, TabsFieldErrorServerComponent, TabsFieldLabelClientComponent, TabsFieldLabelServerComponent, TabsFieldServerComponent, TabsFieldServerProps, } from './fields/Tabs.js';
export type { TextFieldClientComponent, TextFieldClientProps, TextFieldDescriptionClientComponent, TextFieldDescriptionServerComponent, TextFieldDiffClientComponent, TextFieldDiffServerComponent, TextFieldErrorClientComponent, TextFieldErrorServerComponent, TextFieldLabelClientComponent, TextFieldLabelServerComponent, TextFieldServerComponent, TextFieldServerProps, } from './fields/Text.js';
export type { TextareaFieldClientComponent, TextareaFieldClientProps, TextareaFieldDescriptionClientComponent, TextareaFieldDescriptionServerComponent, TextareaFieldDiffClientComponent, TextareaFieldDiffServerComponent, TextareaFieldErrorClientComponent, TextareaFieldErrorServerComponent, TextareaFieldLabelClientComponent, TextareaFieldLabelServerComponent, TextareaFieldServerComponent, TextareaFieldServerProps, } from './fields/Textarea.js';
export type { UIFieldClientComponent, UIFieldClientProps, UIFieldDiffClientComponent, UIFieldDiffServerComponent, UIFieldServerComponent, UIFieldServerProps, } from './fields/UI.js';
export type { UploadFieldClientComponent, UploadFieldClientProps, UploadFieldDescriptionClientComponent, UploadFieldDescriptionServerComponent, UploadFieldDiffClientComponent, UploadFieldDiffServerComponent, UploadFieldErrorClientComponent, UploadFieldErrorServerComponent, UploadFieldLabelClientComponent, UploadFieldLabelServerComponent, UploadFieldServerComponent, UploadFieldServerProps, } from './fields/Upload.js';
export type { Description, DescriptionFunction, FieldDescriptionClientComponent, FieldDescriptionClientProps, FieldDescriptionServerComponent, FieldDescriptionServerProps, GenericDescriptionProps, StaticDescription, } from './forms/Description.js';
export type { BaseVersionField, DiffMethod, FieldDiffClientComponent, FieldDiffClientProps, FieldDiffServerComponent, FieldDiffServerProps, VersionField, VersionTab, } from './forms/Diff.js';
export type { BuildFormStateArgs, Data, FieldState as FormField, FieldStateWithoutComponents as FormFieldWithoutComponents, FilterOptionsResult, FormState, FormStateWithoutComponents, Row, };
export type { FieldErrorClientComponent, FieldErrorClientProps, FieldErrorServerComponent, FieldErrorServerProps, GenericErrorProps, } from './forms/Error.js';
export type { ClientComponentProps, ClientFieldBase, ClientFieldWithOptionalType, FieldClientComponent, FieldPaths, FieldServerComponent, ServerComponentProps, ServerFieldBase, } from './forms/Field.js';
export type { FieldLabelClientComponent, FieldLabelClientProps, FieldLabelServerComponent, FieldLabelServerProps, GenericLabelProps, SanitizedLabelProps, } from './forms/Label.js';
export type { RowLabel, RowLabelComponent } from './forms/RowLabel.js';
export type MappedServerComponent<TComponentClientProps extends JsonObject = JsonObject> = {
Component?: React.ComponentType<TComponentClientProps>;
props?: Partial<any>;
RenderedComponent: React.ReactNode;
type: 'server';
};
export type MappedClientComponent<TComponentClientProps extends JsonObject = JsonObject> = {
Component?: React.ComponentType<TComponentClientProps>;
props?: Partial<TComponentClientProps>;
RenderedComponent?: React.ReactNode;
type: 'client';
};
export type MappedEmptyComponent = {
type: 'empty';
};
export declare enum Action {
RenderConfig = "render-config"
}
export type RenderEntityConfigArgs = {
collectionSlug?: string;
data?: Data;
globalSlug?: string;
};
export type RenderRootConfigArgs = {};
export type RenderFieldConfigArgs = {
collectionSlug?: string;
formState?: FormState;
globalSlug?: string;
schemaPath: string;
};
export type RenderConfigArgs = {
action: Action.RenderConfig;
config: Promise<SanitizedConfig> | SanitizedConfig;
i18n: I18nClient;
importMap: ImportMap;
languageCode: AcceptedLanguages;
serverProps?: any;
} & (RenderEntityConfigArgs | RenderFieldConfigArgs | RenderRootConfigArgs);
export type PayloadServerAction = (args: {
[key: string]: any;
action: Action;
i18n: I18nClient;
} | RenderConfigArgs) => Promise<string>;
export type RenderedField = {
Field: React.ReactNode;
indexPath?: string;
initialSchemaPath?: string;
/**
* @deprecated
* This is a legacy property that will be removed in v4.
* Please use `fieldIsSidebar(field)` from `payload` instead.
* Or check `field.admin.position === 'sidebar'` directly.
*/
isSidebar: boolean;
path: string;
schemaPath: string;
type: FieldTypes;
};
export type FieldRow = {
RowLabel?: React.ReactNode;
};
export type DocumentSlots = {
BeforeDocumentControls?: React.ReactNode;
Description?: React.ReactNode;
EditMenuItems?: React.ReactNode;
LivePreview?: React.ReactNode;
PreviewButton?: React.ReactNode;
PublishButton?: React.ReactNode;
SaveButton?: React.ReactNode;
SaveDraftButton?: React.ReactNode;
Status?: React.ReactNode;
UnpublishButton?: React.ReactNode;
Upload?: React.ReactNode;
UploadControls?: React.ReactNode;
};
export type { BuildCollectionFolderViewResult, BuildTableStateArgs, DefaultServerFunctionArgs, GetFolderResultsComponentAndDataArgs, InitReqResult, ListQuery, ServerFunction, ServerFunctionArgs, ServerFunctionClient, ServerFunctionClientArgs, ServerFunctionConfig, ServerFunctionHandler, SlugifyServerFunctionArgs, } from './functions/index.js';
export type { LanguageOptions } from './LanguageOptions.js';
export type { RichTextAdapter, RichTextAdapterProvider, RichTextHooks } from './RichText.js';
export { type WidgetServerProps } from './views/dashboard.js';
export type { BeforeDocumentControlsClientProps, BeforeDocumentControlsServerProps, BeforeDocumentControlsServerPropsOnly, DocumentSubViewTypes, DocumentTabClientProps,
/**
* @deprecated
* The `DocumentTabComponent` type is deprecated and will be removed in the next major version.
* Use `DocumentTabServerProps`or `DocumentTabClientProps` instead.
*/
DocumentTabComponent, DocumentTabCondition, DocumentTabConfig,
/**
* @deprecated
* The `DocumentTabProps` type is deprecated and will be removed in the next major version.
* Use `DocumentTabServerProps` instead.
*/
DocumentTabServerProps as DocumentTabProps, DocumentTabServerProps, DocumentTabServerPropsOnly,
/**
* @deprecated
* The `ClientSideEditViewProps` type is deprecated and will be removed in the next major version.
* Use `DocumentViewClientProps` instead.
*/
DocumentViewClientProps as ClientSideEditViewProps, DocumentViewClientProps,
/**
* @deprecated
* The `ServerSideEditViewProps` is deprecated and will be removed in the next major version.
* Use `DocumentViewServerProps` instead.
*/
DocumentViewServerProps as ServerSideEditViewProps, DocumentViewServerProps, DocumentViewServerPropsOnly, EditViewProps, RenderDocumentVersionsProperties, } from './views/document.js';
export type { AfterFolderListClientProps, AfterFolderListServerProps, AfterFolderListServerPropsOnly, AfterFolderListTableClientProps, AfterFolderListTableServerProps, AfterFolderListTableServerPropsOnly, BeforeFolderListClientProps, BeforeFolderListServerProps, BeforeFolderListServerPropsOnly, BeforeFolderListTableClientProps, BeforeFolderListTableServerProps, BeforeFolderListTableServerPropsOnly, FolderListViewClientProps, FolderListViewServerProps, FolderListViewServerPropsOnly, FolderListViewSlots, FolderListViewSlotSharedClientProps, } from './views/folderList.js';
export type { AdminViewClientProps,
/**
* @deprecated
* The `AdminViewComponent` type is deprecated and will be removed in the next major version.
* Type your component props directly instead.
*/
AdminViewComponent, AdminViewConfig,
/**
* @deprecated
* The `AdminViewProps` type is deprecated and will be removed in the next major version.
* Use `AdminViewServerProps` instead.
*/
AdminViewServerProps as AdminViewProps, AdminViewServerProps, AdminViewServerPropsOnly, InitPageResult, ServerPropsFromView, ViewDescriptionClientProps, ViewDescriptionServerProps, ViewDescriptionServerPropsOnly, ViewTypes, VisibleEntities, } from './views/index.js';
export type { AfterListClientProps, AfterListServerProps, AfterListServerPropsOnly, AfterListTableClientProps, AfterListTableServerProps, AfterListTableServerPropsOnly, BeforeListClientProps, BeforeListServerProps, BeforeListServerPropsOnly, BeforeListTableClientProps, BeforeListTableServerProps, BeforeListTableServerPropsOnly, ListViewClientProps, ListViewServerProps, ListViewServerPropsOnly, ListViewSlots, ListViewSlotSharedClientProps, } from './views/list.js';
type SchemaPath = {} & string;
export type FieldSchemaMap = Map<SchemaPath, {
fields: Field[];
} | Block | Field | Tab>;
export type ClientFieldSchemaMap = Map<SchemaPath, {
fields: ClientField[];
} | ClientBlock | ClientField | ClientTab>;
export type DocumentEvent = {
doc?: TypeWithID;
drawerSlug?: string;
entitySlug: string;
id?: number | string;
operation: 'create' | 'update';
updatedAt: string;
};
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,24 @@
import type { StaticLabel } from '../../config/types.js';
import type { Field } from '../../fields/config/types.js';
import type { ClientFieldWithOptionalType, ServerComponentProps } from './Field.js';
export type GenericLabelProps = {
readonly as?: 'h3' | 'label' | 'span';
readonly hideLocale?: boolean;
readonly htmlFor?: string;
readonly label?: StaticLabel;
readonly localized?: boolean;
readonly path?: string;
readonly required?: boolean;
readonly unstyled?: boolean;
};
export type FieldLabelClientProps<TFieldClient extends Partial<ClientFieldWithOptionalType> = Partial<ClientFieldWithOptionalType>> = {
field?: TFieldClient;
} & GenericLabelProps;
export type FieldLabelServerProps<TFieldServer extends Field, TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = {
clientField: TFieldClient;
readonly field: TFieldServer;
} & GenericLabelProps & ServerComponentProps;
export type SanitizedLabelProps<TFieldClient extends ClientFieldWithOptionalType> = Omit<FieldLabelClientProps<TFieldClient>, 'label' | 'required'>;
export type FieldLabelClientComponent<TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = React.ComponentType<FieldLabelClientProps<TFieldClient>>;
export type FieldLabelServerComponent<TFieldServer extends Field = Field, TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = React.ComponentType<FieldLabelServerProps<TFieldServer, TFieldClient>>;
//# sourceMappingURL=Label.d.ts.map

View File

@@ -0,0 +1,30 @@
"use strict";
exports.secondsToHours = secondsToHours;
var _index = require("./constants.cjs");
/**
* @name secondsToHours
* @category Conversion Helpers
* @summary Convert seconds to hours.
*
* @description
* Convert a number of seconds to a full number of hours.
*
* @param seconds - The number of seconds to be converted
*
* @returns The number of seconds converted in hours
*
* @example
* // Convert 7200 seconds into hours
* const result = secondsToHours(7200)
* //=> 2
*
* @example
* // It uses floor rounding:
* const result = secondsToHours(7199)
* //=> 1
*/
function secondsToHours(seconds) {
const hours = seconds / _index.secondsInHour;
return Math.trunc(hours);
}

View File

@@ -0,0 +1,166 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["Q", "W"],
abbreviated: ["QK", "WK"],
wide: ["qabel Kristu", "wara Kristu"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["K1", "K2", "K3", "K4"],
wide: ["1. kwart", "2. kwart", "3. kwart", "4. kwart"],
};
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "Ġ", "L", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Fra",
"Mar",
"Apr",
"Mej",
"Ġun",
"Lul",
"Aww",
"Set",
"Ott",
"Nov",
"Diċ",
],
wide: [
"Jannar",
"Frar",
"Marzu",
"April",
"Mejju",
"Ġunju",
"Lulju",
"Awwissu",
"Settembru",
"Ottubru",
"Novembru",
"Diċembru",
],
};
const dayValues = {
narrow: ["Ħ", "T", "T", "E", "Ħ", "Ġ", "S"],
short: ["Ħa", "Tn", "Tl", "Er", "Ħa", "Ġi", "Si"],
abbreviated: ["Ħad", "Tne", "Tli", "Erb", "Ħam", "Ġim", "Sib"],
wide: [
"Il-Ħadd",
"It-Tnejn",
"It-Tlieta",
"L-Erbgħa",
"Il-Ħamis",
"Il-Ġimgħa",
"Is-Sibt",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "nofsillejl",
noon: "nofsinhar",
morning: "għodwa",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "lejl",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "nofsillejl",
noon: "nofsinhar",
morning: "għodwa",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "lejl",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "nofsillejl",
noon: "nofsinhar",
morning: "għodwa",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "lejl",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "f'nofsillejl",
noon: "f'nofsinhar",
morning: "filgħodu",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "billejl",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "f'nofsillejl",
noon: "f'nofsinhar",
morning: "filgħodu",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "billejl",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "f'nofsillejl",
noon: "f'nofsinhar",
morning: "filgħodu",
afternoon: "wara nofsinhar",
evening: "filgħaxija",
night: "billejl",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + "º";
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,79 @@
{
"name": "@sentry/babel-plugin-component-annotate",
"version": "4.9.1",
"description": "A Babel plugin that annotates frontend components with additional data to enrich the experience in Sentry",
"repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git",
"homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/babel-plugin-component-annotate",
"author": "Sentry",
"license": "MIT",
"keywords": [
"Sentry",
"React",
"bundler",
"plugin",
"babel",
"component",
"annotate"
],
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
"exports": {
".": {
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
}
},
"main": "dist/cjs/index.js",
"module": "dist/esm/index.mjs",
"types": "dist/types/index.d.ts",
"scripts": {
"build": "premove ./out && run-p build:rollup build:types",
"build:watch": "run-p build:rollup:watch build:types:watch",
"build:rollup": "rollup --config rollup.config.js",
"build:rollup:watch": "rollup --config rollup.config.js --watch --no-watch.clearScreen",
"build:types": "tsc --project types.tsconfig.json",
"build:types:watch": "tsc --project types.tsconfig.json --watch --preserveWatchOutput",
"build:npm": "npm pack",
"check:types": "run-p check:types:src check:types:test",
"check:types:src": "tsc --project ./src/tsconfig.json --noEmit",
"check:types:test": "tsc --project ./test/tsconfig.json --noEmit",
"clean": "run-s clean:build",
"clean:all": "run-p clean clean:deps",
"clean:build": "premove ./dist *.tgz",
"clean:deps": "premove node_modules",
"test": "jest",
"lint": "eslint ./src ./test"
},
"devDependencies": {
"@babel/core": "7.18.5",
"@babel/preset-env": "7.18.2",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "7.17.12",
"@rollup/plugin-babel": "5.3.1",
"@rollup/plugin-node-resolve": "13.3.0",
"@sentry-internal/eslint-config": "4.9.1",
"@sentry-internal/sentry-bundler-plugin-tsconfig": "4.9.1",
"@swc/core": "^1.2.205",
"@swc/jest": "^0.2.21",
"@types/jest": "^28.1.3",
"@types/node": "^18.6.3",
"@types/uuid": "^9.0.1",
"eslint": "^8.18.0",
"jest": "^28.1.1",
"premove": "^4.0.0",
"rollup": "2.75.7",
"ts-node": "^10.9.1",
"typescript": "^4.7.4"
},
"volta": {
"extends": "../../package.json"
},
"engines": {
"node": ">= 14"
}
}

View File

@@ -0,0 +1,333 @@
'use strict'
const path = require('path')
const Module = require('module')
const debug = require('debug')('require-in-the-middle')
const moduleDetailsFromPath = require('module-details-from-path')
// Using the default export is discouraged, but kept for backward compatibility.
// Use this instead:
// const { Hook } = require('require-in-the-middle')
module.exports = Hook
module.exports.Hook = Hook
let builtinModules // Set<string>
/**
* Is the given module a "core" module?
* https://nodejs.org/api/modules.html#core-modules
*
* @type {(moduleName: string) => boolean}
*/
let isCore
if (Module.isBuiltin) { // Added in node v18.6.0, v16.17.0
isCore = Module.isBuiltin
} else if (Module.builtinModules) { // Added in node v9.3.0, v8.10.0, v6.13.0
isCore = moduleName => {
if (moduleName.startsWith('node:')) {
return true
}
if (builtinModules === undefined) {
builtinModules = new Set(Module.builtinModules)
}
return builtinModules.has(moduleName)
}
} else {
throw new Error('\'require-in-the-middle\' requires Node.js >=v9.3.0 or >=v8.10.0')
}
// 'foo/bar.js' or 'foo/bar/index.js' => 'foo/bar'
const normalize = /([/\\]index)?(\.js)?$/
// Cache `onrequire`-patched exports for modules.
//
// Exports for built-in (a.k.a. "core") modules are stored in an internal Map.
//
// Exports for non-core modules are stored on a private field on the `Module`
// object in `require.cache`. This allows users to delete from `require.cache`
// to trigger a re-load (and re-run of the hook's `onrequire`) of a module the
// next time it is required.
// https://nodejs.org/docs/latest/api/all.html#all_modules_requirecache
//
// In some special cases -- e.g. some other `require()` hook swapping out
// `Module._cache` like `@babel/register` -- a non-core module won't be in
// `require.cache`. In that case this falls back to caching on the internal Map.
class ExportsCache {
constructor () {
this._localCache = new Map() // <module filename or id> -> <exports>
this._kRitmExports = Symbol('RitmExports')
}
has (filename, isBuiltin) {
if (this._localCache.has(filename)) {
return true
} else if (!isBuiltin) {
const mod = require.cache[filename]
return !!(mod && this._kRitmExports in mod)
} else {
return false
}
}
get (filename, isBuiltin) {
const cachedExports = this._localCache.get(filename)
if (cachedExports !== undefined) {
return cachedExports
} else if (!isBuiltin) {
const mod = require.cache[filename]
return (mod && mod[this._kRitmExports])
}
}
set (filename, exports, isBuiltin) {
if (isBuiltin) {
this._localCache.set(filename, exports)
} else if (filename in require.cache) {
require.cache[filename][this._kRitmExports] = exports
} else {
debug('non-core module is unexpectedly not in require.cache: "%s"', filename)
this._localCache.set(filename, exports)
}
}
}
function Hook (modules, options, onrequire) {
if ((this instanceof Hook) === false) return new Hook(modules, options, onrequire)
if (typeof modules === 'function') {
onrequire = modules
modules = null
options = null
} else if (typeof options === 'function') {
onrequire = options
options = null
}
if (typeof Module._resolveFilename !== 'function') {
console.error('Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!', typeof Module._resolveFilename)
console.error('Please report this error as an issue related to Node.js %s at https://github.com/nodejs/require-in-the-middle/issues', process.version)
return
}
this._cache = new ExportsCache()
this._unhooked = false
this._origRequire = Module.prototype.require
const self = this
const patching = new Set()
const internals = options ? options.internals === true : false
const hasWhitelist = Array.isArray(modules)
debug('registering require hook')
this._require = Module.prototype.require = function (id) {
if (self._unhooked === true) {
// if the patched require function could not be removed because
// someone else patched it after it was patched here, we just
// abort and pass the request onwards to the original require
debug('ignoring require call - module is soft-unhooked')
return self._origRequire.apply(this, arguments)
}
return patchedRequire.call(this, arguments, false)
}
if (typeof process.getBuiltinModule === 'function') {
this._origGetBuiltinModule = process.getBuiltinModule
this._getBuiltinModule = process.getBuiltinModule = function (id) {
if (self._unhooked === true) {
// if the patched process.getBuiltinModule function could not be removed because
// someone else patched it after it was patched here, we just abort and pass the
// request onwards to the original process.getBuiltinModule
debug('ignoring process.getBuiltinModule call - module is soft-unhooked')
return self._origGetBuiltinModule.apply(this, arguments)
}
return patchedRequire.call(this, arguments, true)
}
}
// Preserve the original require/process.getBuiltinModule arguments in `args`
function patchedRequire (args, coreOnly) {
const id = args[0]
const core = isCore(id)
let filename // the string used for caching
if (core) {
filename = id
// If this is a builtin module that can be identified both as 'foo' and
// 'node:foo', then prefer 'foo' as the caching key.
if (id.startsWith('node:')) {
const idWithoutPrefix = id.slice(5)
if (isCore(idWithoutPrefix)) {
filename = idWithoutPrefix
}
}
} else if (coreOnly) {
// `coreOnly` is `true` if this was a call to `process.getBuiltinModule`, in which case
// we don't want to return anything if the requested `id` isn't a core module. Falling
// back to default behaviour, which at the time of this wrting is simply returning `undefined`
debug('call to process.getBuiltinModule with unknown built-in id')
return self._origGetBuiltinModule.apply(this, args)
} else {
try {
filename = Module._resolveFilename(id, this)
} catch (resolveErr) {
// If someone *else* monkey-patches before this monkey-patch, then that
// code might expect `require(someId)` to get through so it can be
// handled, even if `someId` cannot be resolved to a filename. In this
// case, instead of throwing we defer to the underlying `require`.
//
// For example the Azure Functions Node.js worker module does this,
// where `@azure/functions-core` resolves to an internal object.
// https://github.com/Azure/azure-functions-nodejs-worker/blob/v3.5.2/src/setupCoreModule.ts#L46-L54
debug('Module._resolveFilename("%s") threw %j, calling original Module.require', id, resolveErr.message)
return self._origRequire.apply(this, args)
}
}
let moduleName, basedir
debug('processing %s module require(\'%s\'): %s', core === true ? 'core' : 'non-core', id, filename)
// return known patched modules immediately
if (self._cache.has(filename, core) === true) {
debug('returning already patched cached module: %s', filename)
return self._cache.get(filename, core)
}
// Check if this module has a patcher in-progress already.
// Otherwise, mark this module as patching in-progress.
const isPatching = patching.has(filename)
if (isPatching === false) {
patching.add(filename)
}
const exports = coreOnly
? self._origGetBuiltinModule.apply(this, args)
: self._origRequire.apply(this, args)
// If it's already patched, just return it as-is.
if (isPatching === true) {
debug('module is in the process of being patched already - ignoring: %s', filename)
return exports
}
// The module has already been loaded,
// so the patching mark can be cleaned up.
patching.delete(filename)
if (core === true) {
if (hasWhitelist === true && modules.includes(filename) === false) {
debug('ignoring core module not on whitelist: %s', filename)
return exports // abort if module name isn't on whitelist
}
moduleName = filename
} else if (hasWhitelist === true && modules.includes(filename)) {
// whitelist includes the absolute path to the file including extension
const parsedPath = path.parse(filename)
moduleName = parsedPath.name
basedir = parsedPath.dir
} else {
const stat = moduleDetailsFromPath(filename)
if (stat === undefined) {
debug('could not parse filename: %s', filename)
return exports // abort if filename could not be parsed
}
moduleName = stat.name
basedir = stat.basedir
// Ex: require('foo/lib/../bar.js')
// moduleName = 'foo'
// fullModuleName = 'foo/bar'
const fullModuleName = resolveModuleName(stat)
debug('resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)', moduleName, id, fullModuleName, basedir)
let matchFound = false
if (hasWhitelist) {
if (!id.startsWith('.') && modules.includes(id)) {
// Not starting with '.' means `id` is identifying a module path,
// as opposed to a local file path. (Note: I'm not sure about
// absolute paths, but those are handled above.)
// If this `id` is in `modules`, then this could be a match to an
// package "exports" entry point that wouldn't otherwise match below.
moduleName = id
matchFound = true
}
// abort if module name isn't on whitelist
if (!modules.includes(moduleName) && !modules.includes(fullModuleName)) {
return exports
}
if (modules.includes(fullModuleName) && fullModuleName !== moduleName) {
// if we get to this point, it means that we're requiring a whitelisted sub-module
moduleName = fullModuleName
matchFound = true
}
}
if (!matchFound) {
// figure out if this is the main module file, or a file inside the module
let res
try {
res = require.resolve(moduleName, { paths: [basedir] })
} catch (e) {
debug('could not resolve module: %s', moduleName)
self._cache.set(filename, exports, core)
return exports // abort if module could not be resolved (e.g. no main in package.json and no index.js file)
}
if (res !== filename) {
// this is a module-internal file
if (internals === true) {
// use the module-relative path to the file, prefixed by original module name
moduleName = moduleName + path.sep + path.relative(basedir, filename)
debug('preparing to process require of internal file: %s', moduleName)
} else {
debug('ignoring require of non-main module file: %s', res)
self._cache.set(filename, exports, core)
return exports // abort if not main module file
}
}
}
}
// ensure that the cache entry is assigned a value before calling
// onrequire, in case calling onrequire requires the same module.
self._cache.set(filename, exports, core)
debug('calling require hook: %s', moduleName)
const patchedExports = onrequire(exports, moduleName, basedir)
self._cache.set(filename, patchedExports, core)
debug('returning module: %s', moduleName)
return patchedExports
}
}
Hook.prototype.unhook = function () {
this._unhooked = true
if (this._require === Module.prototype.require) {
Module.prototype.require = this._origRequire
debug('require unhook successful')
} else {
debug('require unhook unsuccessful')
}
if (process.getBuiltinModule !== undefined) {
if (this._getBuiltinModule === process.getBuiltinModule) {
process.getBuiltinModule = this._origGetBuiltinModule
debug('process.getBuiltinModule unhook successful')
} else {
debug('process.getBuiltinModule unhook unsuccessful')
}
}
}
function resolveModuleName (stat) {
const normalizedPath = path.sep !== '/' ? stat.path.split(path.sep).join('/') : stat.path
return path.posix.join(stat.name, normalizedPath).replace(normalize, '')
}

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 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","2":"0C VC 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 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","132":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB"},E:{"1":"F A B C L M G 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","4":"bC","132":"J bB K D E 7C 8C 9C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC 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 JD KD LD MD PC xC ND QC"},G:{"1":"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","132":"E bC OD yC PD QD RD SD"},H:{"1":"mD"},I:{"1":"I rD sD","2":"nD oD pD","132":"VC J qD yC"},J:{"1":"D A"},K:{"1":"A B C H PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"A B"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:1,C:"SVG in HTML img element",D:true};

View File

@@ -0,0 +1,51 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const JavascriptModulesPlugin = require("./javascript/JavascriptModulesPlugin");
/** @typedef {import("../declarations/plugins/SourceMapDevToolPlugin").SourceMapDevToolPluginOptions} SourceMapDevToolPluginOptions */
/** @typedef {import("./Compilation")} Compilation */
const PLUGIN_NAME = "SourceMapDevToolModuleOptionsPlugin";
class SourceMapDevToolModuleOptionsPlugin {
/**
* @param {SourceMapDevToolPluginOptions=} options options
*/
constructor(options = {}) {
this.options = options;
}
/**
* @param {Compilation} compilation the compiler instance
* @returns {void}
*/
apply(compilation) {
const options = this.options;
if (options.module !== false) {
compilation.hooks.buildModule.tap(PLUGIN_NAME, (module) => {
module.useSourceMap = true;
});
compilation.hooks.runtimeModule.tap(PLUGIN_NAME, (module) => {
module.useSourceMap = true;
});
} else {
compilation.hooks.buildModule.tap(PLUGIN_NAME, (module) => {
module.useSimpleSourceMap = true;
});
compilation.hooks.runtimeModule.tap(PLUGIN_NAME, (module) => {
module.useSimpleSourceMap = true;
});
}
JavascriptModulesPlugin.getCompilationHooks(compilation).useSourceMap.tap(
PLUGIN_NAME,
() => true
);
}
}
module.exports = SourceMapDevToolModuleOptionsPlugin;

View File

@@ -0,0 +1 @@
{"version":3,"file":"handleAuthRedirect.js","names":["formatAdminURL","qs","handleAuthRedirect","config","route","searchParams","user","admin","routes","login","loginRouteFromConfig","unauthorized","unauthorizedRoute","adminRoute","redirect","redirectRoute","Object","keys","length","stringify","addQueryPrefix","redirectTo","path","parsedLoginRouteSearchParams","parse","split","searchParamsWithRedirect"],"sources":["../../src/utilities/handleAuthRedirect.ts"],"sourcesContent":["import type { TypedUser } from 'payload'\n\nimport { formatAdminURL } from 'payload/shared'\nimport * as qs from 'qs-esm'\n\ntype Args = {\n config\n route: string\n searchParams: { [key: string]: string | string[] }\n user?: TypedUser\n}\n\nexport const handleAuthRedirect = ({ config, route, searchParams, user }: Args): string => {\n const {\n admin: {\n routes: { login: loginRouteFromConfig, unauthorized: unauthorizedRoute },\n },\n routes: { admin: adminRoute },\n } = config\n\n if (searchParams && 'redirect' in searchParams) {\n delete searchParams.redirect\n }\n\n const redirectRoute =\n (route !== adminRoute ? route : '') +\n (Object.keys(searchParams ?? {}).length > 0\n ? `${qs.stringify(searchParams, { addQueryPrefix: true })}`\n : '')\n\n const redirectTo = formatAdminURL({\n adminRoute,\n path: user ? unauthorizedRoute : loginRouteFromConfig,\n })\n\n const parsedLoginRouteSearchParams = qs.parse(redirectTo.split('?')[1] ?? '')\n\n const searchParamsWithRedirect = `${qs.stringify(\n {\n ...parsedLoginRouteSearchParams,\n ...(redirectRoute ? { redirect: redirectRoute } : {}),\n },\n { addQueryPrefix: true },\n )}`\n\n return `${redirectTo.split('?', 1)[0]}${searchParamsWithRedirect}`\n}\n"],"mappings":"AAEA,SAASA,cAAc,QAAQ;AAC/B,YAAYC,EAAA,MAAQ;AASpB,OAAO,MAAMC,kBAAA,GAAqBA,CAAC;EAAEC,MAAM;EAAEC,KAAK;EAAEC,YAAY;EAAEC;AAAI,CAAQ;EAC5E,MAAM;IACJC,KAAA,EAAO;MACLC,MAAA,EAAQ;QAAEC,KAAA,EAAOC,oBAAoB;QAAEC,YAAA,EAAcC;MAAiB;IAAE,CACzE;IACDJ,MAAA,EAAQ;MAAED,KAAA,EAAOM;IAAU;EAAE,CAC9B,GAAGV,MAAA;EAEJ,IAAIE,YAAA,IAAgB,cAAcA,YAAA,EAAc;IAC9C,OAAOA,YAAA,CAAaS,QAAQ;EAC9B;EAEA,MAAMC,aAAA,GACJ,CAACX,KAAA,KAAUS,UAAA,GAAaT,KAAA,GAAQ,EAAC,KAChCY,MAAA,CAAOC,IAAI,CAACZ,YAAA,IAAgB,CAAC,GAAGa,MAAM,GAAG,IACtC,GAAGjB,EAAA,CAAGkB,SAAS,CAACd,YAAA,EAAc;IAAEe,cAAA,EAAgB;EAAK,IAAI,GACzD,EAAC;EAEP,MAAMC,UAAA,GAAarB,cAAA,CAAe;IAChCa,UAAA;IACAS,IAAA,EAAMhB,IAAA,GAAOM,iBAAA,GAAoBF;EACnC;EAEA,MAAMa,4BAAA,GAA+BtB,EAAA,CAAGuB,KAAK,CAACH,UAAA,CAAWI,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI;EAE1E,MAAMC,wBAAA,GAA2B,GAAGzB,EAAA,CAAGkB,SAAS,CAC9C;IACE,GAAGI,4BAA4B;IAC/B,IAAIR,aAAA,GAAgB;MAAED,QAAA,EAAUC;IAAc,IAAI,CAAC,CAAC;EACtD,GACA;IAAEK,cAAA,EAAgB;EAAK,IACtB;EAEH,OAAO,GAAGC,UAAA,CAAWI,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,GAAGC,wBAAA,EAA0B;AACpE","ignoreList":[]}

View File

@@ -0,0 +1,20 @@
export const jobStatsGlobalSlug = 'payload-jobs-stats';
/**
* Global config for job statistics.
*/ export const getJobStatsGlobal = (config)=>{
return {
slug: jobStatsGlobalSlug,
admin: {
group: 'System',
hidden: true
},
fields: [
{
name: 'stats',
type: 'json'
}
]
};
};
//# sourceMappingURL=global.js.map

View File

@@ -0,0 +1,596 @@
'use strict';
function parseContentType(str) {
if (str.length === 0)
return;
const params = Object.create(null);
let i = 0;
// Parse type
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (TOKEN[code] !== 1) {
if (code !== 47/* '/' */ || i === 0)
return;
break;
}
}
// Check for type without subtype
if (i === str.length)
return;
const type = str.slice(0, i).toLowerCase();
// Parse subtype
const subtypeStart = ++i;
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (TOKEN[code] !== 1) {
// Make sure we have a subtype
if (i === subtypeStart)
return;
if (parseContentTypeParams(str, i, params) === undefined)
return;
break;
}
}
// Make sure we have a subtype
if (i === subtypeStart)
return;
const subtype = str.slice(subtypeStart, i).toLowerCase();
return { type, subtype, params };
}
function parseContentTypeParams(str, i, params) {
while (i < str.length) {
// Consume whitespace
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (code !== 32/* ' ' */ && code !== 9/* '\t' */)
break;
}
// Ended on whitespace
if (i === str.length)
break;
// Check for malformed parameter
if (str.charCodeAt(i++) !== 59/* ';' */)
return;
// Consume whitespace
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (code !== 32/* ' ' */ && code !== 9/* '\t' */)
break;
}
// Ended on whitespace (malformed)
if (i === str.length)
return;
let name;
const nameStart = i;
// Parse parameter name
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (TOKEN[code] !== 1) {
if (code !== 61/* '=' */)
return;
break;
}
}
// No value (malformed)
if (i === str.length)
return;
name = str.slice(nameStart, i);
++i; // Skip over '='
// No value (malformed)
if (i === str.length)
return;
let value = '';
let valueStart;
if (str.charCodeAt(i) === 34/* '"' */) {
valueStart = ++i;
let escaping = false;
// Parse quoted value
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (code === 92/* '\\' */) {
if (escaping) {
valueStart = i;
escaping = false;
} else {
value += str.slice(valueStart, i);
escaping = true;
}
continue;
}
if (code === 34/* '"' */) {
if (escaping) {
valueStart = i;
escaping = false;
continue;
}
value += str.slice(valueStart, i);
break;
}
if (escaping) {
valueStart = i - 1;
escaping = false;
}
// Invalid unescaped quoted character (malformed)
if (QDTEXT[code] !== 1)
return;
}
// No end quote (malformed)
if (i === str.length)
return;
++i; // Skip over double quote
} else {
valueStart = i;
// Parse unquoted value
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (TOKEN[code] !== 1) {
// No value (malformed)
if (i === valueStart)
return;
break;
}
}
value = str.slice(valueStart, i);
}
name = name.toLowerCase();
if (params[name] === undefined)
params[name] = value;
}
return params;
}
function parseDisposition(str, defDecoder) {
if (str.length === 0)
return;
const params = Object.create(null);
let i = 0;
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (TOKEN[code] !== 1) {
if (parseDispositionParams(str, i, params, defDecoder) === undefined)
return;
break;
}
}
const type = str.slice(0, i).toLowerCase();
return { type, params };
}
function parseDispositionParams(str, i, params, defDecoder) {
while (i < str.length) {
// Consume whitespace
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (code !== 32/* ' ' */ && code !== 9/* '\t' */)
break;
}
// Ended on whitespace
if (i === str.length)
break;
// Check for malformed parameter
if (str.charCodeAt(i++) !== 59/* ';' */)
return;
// Consume whitespace
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (code !== 32/* ' ' */ && code !== 9/* '\t' */)
break;
}
// Ended on whitespace (malformed)
if (i === str.length)
return;
let name;
const nameStart = i;
// Parse parameter name
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (TOKEN[code] !== 1) {
if (code === 61/* '=' */)
break;
return;
}
}
// No value (malformed)
if (i === str.length)
return;
let value = '';
let valueStart;
let charset;
//~ let lang;
name = str.slice(nameStart, i);
if (name.charCodeAt(name.length - 1) === 42/* '*' */) {
// Extended value
const charsetStart = ++i;
// Parse charset name
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (CHARSET[code] !== 1) {
if (code !== 39/* '\'' */)
return;
break;
}
}
// Incomplete charset (malformed)
if (i === str.length)
return;
charset = str.slice(charsetStart, i);
++i; // Skip over the '\''
//~ const langStart = ++i;
// Parse language name
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (code === 39/* '\'' */)
break;
}
// Incomplete language (malformed)
if (i === str.length)
return;
//~ lang = str.slice(langStart, i);
++i; // Skip over the '\''
// No value (malformed)
if (i === str.length)
return;
valueStart = i;
let encode = 0;
// Parse value
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (EXTENDED_VALUE[code] !== 1) {
if (code === 37/* '%' */) {
let hexUpper;
let hexLower;
if (i + 2 < str.length
&& (hexUpper = HEX_VALUES[str.charCodeAt(i + 1)]) !== -1
&& (hexLower = HEX_VALUES[str.charCodeAt(i + 2)]) !== -1) {
const byteVal = (hexUpper << 4) + hexLower;
value += str.slice(valueStart, i);
value += String.fromCharCode(byteVal);
i += 2;
valueStart = i + 1;
if (byteVal >= 128)
encode = 2;
else if (encode === 0)
encode = 1;
continue;
}
// '%' disallowed in non-percent encoded contexts (malformed)
return;
}
break;
}
}
value += str.slice(valueStart, i);
value = convertToUTF8(value, charset, encode);
if (value === undefined)
return;
} else {
// Non-extended value
++i; // Skip over '='
// No value (malformed)
if (i === str.length)
return;
if (str.charCodeAt(i) === 34/* '"' */) {
valueStart = ++i;
let escaping = false;
// Parse quoted value
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (code === 92/* '\\' */) {
if (escaping) {
valueStart = i;
escaping = false;
} else {
value += str.slice(valueStart, i);
escaping = true;
}
continue;
}
if (code === 34/* '"' */) {
if (escaping) {
valueStart = i;
escaping = false;
continue;
}
value += str.slice(valueStart, i);
break;
}
if (escaping) {
valueStart = i - 1;
escaping = false;
}
// Invalid unescaped quoted character (malformed)
if (QDTEXT[code] !== 1)
return;
}
// No end quote (malformed)
if (i === str.length)
return;
++i; // Skip over double quote
} else {
valueStart = i;
// Parse unquoted value
for (; i < str.length; ++i) {
const code = str.charCodeAt(i);
if (TOKEN[code] !== 1) {
// No value (malformed)
if (i === valueStart)
return;
break;
}
}
value = str.slice(valueStart, i);
}
value = defDecoder(value, 2);
if (value === undefined)
return;
}
name = name.toLowerCase();
if (params[name] === undefined)
params[name] = value;
}
return params;
}
function getDecoder(charset) {
let lc;
while (true) {
switch (charset) {
case 'utf-8':
case 'utf8':
return decoders.utf8;
case 'latin1':
case 'ascii': // TODO: Make these a separate, strict decoder?
case 'us-ascii':
case 'iso-8859-1':
case 'iso8859-1':
case 'iso88591':
case 'iso_8859-1':
case 'windows-1252':
case 'iso_8859-1:1987':
case 'cp1252':
case 'x-cp1252':
return decoders.latin1;
case 'utf16le':
case 'utf-16le':
case 'ucs2':
case 'ucs-2':
return decoders.utf16le;
case 'base64':
return decoders.base64;
default:
if (lc === undefined) {
lc = true;
charset = charset.toLowerCase();
continue;
}
return decoders.other.bind(charset);
}
}
}
const decoders = {
utf8: (data, hint) => {
if (data.length === 0)
return '';
if (typeof data === 'string') {
// If `data` never had any percent-encoded bytes or never had any that
// were outside of the ASCII range, then we can safely just return the
// input since UTF-8 is ASCII compatible
if (hint < 2)
return data;
data = Buffer.from(data, 'latin1');
}
return data.utf8Slice(0, data.length);
},
latin1: (data, hint) => {
if (data.length === 0)
return '';
if (typeof data === 'string')
return data;
return data.latin1Slice(0, data.length);
},
utf16le: (data, hint) => {
if (data.length === 0)
return '';
if (typeof data === 'string')
data = Buffer.from(data, 'latin1');
return data.ucs2Slice(0, data.length);
},
base64: (data, hint) => {
if (data.length === 0)
return '';
if (typeof data === 'string')
data = Buffer.from(data, 'latin1');
return data.base64Slice(0, data.length);
},
other: (data, hint) => {
if (data.length === 0)
return '';
if (typeof data === 'string')
data = Buffer.from(data, 'latin1');
try {
const decoder = new TextDecoder(this);
return decoder.decode(data);
} catch {}
},
};
function convertToUTF8(data, charset, hint) {
const decode = getDecoder(charset);
if (decode)
return decode(data, hint);
}
function basename(path) {
if (typeof path !== 'string')
return '';
for (let i = path.length - 1; i >= 0; --i) {
switch (path.charCodeAt(i)) {
case 0x2F: // '/'
case 0x5C: // '\'
path = path.slice(i + 1);
return (path === '..' || path === '.' ? '' : path);
}
}
return (path === '..' || path === '.' ? '' : path);
}
const TOKEN = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
];
const QDTEXT = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
];
const CHARSET = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
];
const EXTENDED_VALUE = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
];
/* eslint-disable no-multi-spaces */
const HEX_VALUES = [
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
-1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
];
/* eslint-enable no-multi-spaces */
module.exports = {
basename,
convertToUTF8,
getDecoder,
parseContentType,
parseDisposition,
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/bin/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAczD,eAAO,MAAM,iBAAiB,UAQ7B,CAAA;AAID,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,eAAe,CAAA;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,OAAO,yCAAgD,IAAI,KAAG,OAAO,CAAC,IAAI,CAkGtF,CAAA"}

View File

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

View File

@@ -0,0 +1,30 @@
import { parseParams } from './parseParams.js';
export function buildAndOrConditions({ adapter, aliasTable, context, fields, joins, locale, parentIsLocalized, selectFields, selectLocale, tableName, where }) {
const completedConditions = [];
// Loop over all AND / OR operations and add them to the AND / OR query param
// Operations should come through as an array
for (const condition of where){
// If the operation is properly formatted as an object
if (typeof condition === 'object') {
const result = parseParams({
adapter,
aliasTable,
context,
fields,
joins,
locale,
parentIsLocalized,
selectFields,
selectLocale,
tableName,
where: condition
});
if (result && Object.keys(result).length > 0) {
completedConditions.push(result);
}
}
}
return completedConditions;
}
//# sourceMappingURL=buildAndOrConditions.js.map

View File

@@ -0,0 +1,9 @@
let defaultOptions = {};
export function getDefaultOptions() {
return defaultOptions;
}
export function setDefaultOptions(newOptions) {
defaultOptions = newOptions;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"context.js","names":["createContext","use","ListQueryContext","useListQuery","ListQueryModifiedContext","useListQueryModified"],"sources":["../../../src/providers/ListQuery/context.ts"],"sourcesContent":["import { createContext, use } from 'react'\n\nimport type { IListQueryContext } from './types.js'\n\nexport const ListQueryContext = createContext({} as IListQueryContext)\n\nexport const useListQuery = (): IListQueryContext => use(ListQueryContext)\n\nexport const ListQueryModifiedContext = createContext(false)\n\nexport const useListQueryModified = (): boolean => use(ListQueryModifiedContext)\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,GAAG,QAAQ;AAInC,OAAO,MAAMC,gBAAA,GAAmBF,aAAA,CAAc,CAAC;AAE/C,OAAO,MAAMG,YAAA,GAAeA,CAAA,KAAyBF,GAAA,CAAIC,gBAAA;AAEzD,OAAO,MAAME,wBAAA,GAA2BJ,aAAA,CAAc;AAEtD,OAAO,MAAMK,oBAAA,GAAuBA,CAAA,KAAeJ,GAAA,CAAIG,wBAAA","ignoreList":[]}

View File

@@ -0,0 +1,111 @@
import * as os from 'node:os';
import { ServerRuntimeClient, applySdkMetadata, debug, _INTERNAL_flushLogsBuffer } from '@sentry/core';
import { threadId, isMainThread } from 'worker_threads';
import { DEBUG_BUILD } from '../debug-build.js';
const DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS = 60000; // 60s was chosen arbitrarily
/** A lightweight client for using Sentry with Node without OpenTelemetry. */
class LightNodeClient extends ServerRuntimeClient {
constructor(options) {
const serverName =
options.includeServerName === false
? undefined
: options.serverName || global.process.env.SENTRY_NAME || os.hostname();
const clientOptions = {
...options,
platform: 'node',
runtime: { name: 'node', version: global.process.version },
serverName,
};
applySdkMetadata(clientOptions, 'node-light', ['node-core']);
debug.log(`Initializing Sentry: process: ${process.pid}, thread: ${isMainThread ? 'main' : `worker-${threadId}`}.`);
super(clientOptions);
if (this.getOptions().enableLogs) {
this._logOnExitFlushListener = () => {
_INTERNAL_flushLogsBuffer(this);
};
if (serverName) {
this.on('beforeCaptureLog', log => {
log.attributes = {
...log.attributes,
'server.address': serverName,
};
});
}
process.on('beforeExit', this._logOnExitFlushListener);
}
}
/** @inheritDoc */
// @ts-expect-error - PromiseLike is a subset of Promise
async flush(timeout) {
if (this.getOptions().sendClientReports) {
this._flushOutcomes();
}
return super.flush(timeout);
}
/** @inheritDoc */
// @ts-expect-error - PromiseLike is a subset of Promise
async close(timeout) {
if (this._clientReportInterval) {
clearInterval(this._clientReportInterval);
}
if (this._clientReportOnExitFlushListener) {
process.off('beforeExit', this._clientReportOnExitFlushListener);
}
if (this._logOnExitFlushListener) {
process.off('beforeExit', this._logOnExitFlushListener);
}
return super.close(timeout);
}
/**
* Will start tracking client reports for this client.
*
* NOTICE: This method will create an interval that is periodically called and attach a `process.on('beforeExit')`
* hook. To clean up these resources, call `.close()` when you no longer intend to use the client. Not doing so will
* result in a memory leak.
*/
// The reason client reports need to be manually activated with this method instead of just enabling them in a
// constructor, is that if users periodically and unboundedly create new clients, we will create more and more
// intervals and beforeExit listeners, thus leaking memory. In these situations, users are required to call
// `client.close()` in order to dispose of the acquired resources.
// We assume that calling this method in Sentry.init() is a sensible default, because calling Sentry.init() over and
// over again would also result in memory leaks.
// Note: We have experimented with using `FinalizationRegisty` to clear the interval when the client is garbage
// collected, but it did not work, because the cleanup function never got called.
startClientReportTracking() {
const clientOptions = this.getOptions();
if (clientOptions.sendClientReports) {
this._clientReportOnExitFlushListener = () => {
this._flushOutcomes();
};
this._clientReportInterval = setInterval(() => {
DEBUG_BUILD && debug.log('Flushing client reports based on interval.');
this._flushOutcomes();
}, clientOptions.clientReportFlushInterval ?? DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS)
// Unref is critical for not preventing the process from exiting because the interval is active.
.unref();
process.on('beforeExit', this._clientReportOnExitFlushListener);
}
}
}
export { LightNodeClient };
//# sourceMappingURL=client.js.map

View File

@@ -0,0 +1,8 @@
function clamp(left, x, right) {
return Math.max(left, Math.min(x, right));
}
function escapeWhitespace(str) {
return str.replace(/(\t)|(\r)|(\n)/g, (m, t, r) => t ? '\\t' : r ? '\\r' : '\\n');
}
export { clamp, escapeWhitespace };

View File

@@ -0,0 +1,59 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLLongitude = void 0;
// Inspired by Geolib: https://github.com/manuelbieh/geolib
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
const utilities_js_1 = require("./utilities.js");
// Minimum longitude
const MIN_LON = -180.0;
// Maximum longitude
const MAX_LON = 180.0;
// See https://en.wikipedia.org/wiki/Decimal_degrees#Precision
const MAX_PRECISION = 8;
const validate = (value, ast) => {
// Check if value is a string or a number
if ((typeof value !== 'string' && typeof value !== 'number') ||
value === null ||
typeof value === 'undefined' ||
Number.isNaN(value)) {
throw (0, error_js_1.createGraphQLError)(`Value is neither a number nor a string: ${value}`, ast ? { nodes: ast } : undefined);
}
if ((0, utilities_js_1.isDecimal)(value)) {
const decimalValue = typeof value === 'string' ? Number.parseFloat(value) : value;
if (decimalValue < MIN_LON || decimalValue > MAX_LON) {
throw (0, error_js_1.createGraphQLError)(`Value must be between ${MIN_LON} and ${MAX_LON}: ${value}`, ast ? { nodes: ast } : undefined);
}
return Number.parseFloat(decimalValue.toFixed(MAX_PRECISION));
}
if ((0, utilities_js_1.isSexagesimal)(value)) {
return validate((0, utilities_js_1.sexagesimalToDecimal)(value));
}
throw (0, error_js_1.createGraphQLError)(`Value is not a valid longitude: ${value}`, ast ? { nodes: ast } : undefined);
};
exports.GraphQLLongitude = new graphql_1.GraphQLScalarType({
name: `Longitude`,
description: `A field whose value is a valid decimal degrees longitude number (53.471): https://en.wikipedia.org/wiki/Longitude`,
serialize(value) {
return validate(value);
},
parseValue(value) {
return validate(value);
},
parseLiteral(ast) {
if (ast.kind !== graphql_1.Kind.FLOAT && ast.kind !== graphql_1.Kind.STRING) {
throw (0, error_js_1.createGraphQLError)(`Can only validate floats or strings as longitude but got a: ${ast.kind}`, {
nodes: [ast],
});
}
return validate(ast.value, ast);
},
extensions: {
codegenScalarType: 'string | number',
jsonSchema: {
type: 'number',
minimum: MIN_LON,
maximum: MAX_LON,
},
},
});

View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.cjs");
const dateFormats = {
full: "EEEE d MMMM y",
long: "d MMMM y",
medium: "d MMM y",
short: "dd/MM/y",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'à' {{time}}",
long: "{{date}} 'à' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});

View File

@@ -0,0 +1,168 @@
[![NPM](https://img.shields.io/npm/v/react-select.svg)](https://www.npmjs.com/package/react-select)
[![CircleCI](https://circleci.com/gh/JedWatson/react-select/tree/master.svg?style=shield)](https://circleci.com/gh/JedWatson/react-select/tree/master)
[![Coverage Status](https://coveralls.io/repos/JedWatson/react-select/badge.svg?branch=master&service=github)](https://coveralls.io/github/JedWatson/react-select?branch=master)
[![Supported by Thinkmill](https://thinkmill.github.io/badge/heart.svg)](http://thinkmill.com.au/?utm_source=github&utm_medium=badge&utm_campaign=react-select)
# React-Select
The Select control for [React](https://reactjs.com). Initially built for use in [KeystoneJS](http://www.keystonejs.com).
See [react-select.com](https://www.react-select.com) for live demos and comprehensive docs.
React Select is funded by [Thinkmill](https://www.thinkmill.com.au) and [Atlassian](https://atlaskit.atlassian.com). It represents a whole new approach to developing powerful React.js components that _just work_ out of the box, while being extremely customisable.
For the story behind this component, watch Jed's talk at React Conf 2019 - [building React Select](https://youtu.be/yS0jUnmBujE)
Features include:
- Flexible approach to data, with customisable functions
- Extensible styling API with [emotion](https://emotion.sh)
- Component Injection API for complete control over the UI behaviour
- Controllable state props and modular architecture
- Long-requested features like option groups, portal support, animation, and more
## Using an older version?
- [v3, v4, and v5 upgrade guide](https://react-select.com/upgrade)
- [v2 upgrade guide](https://react-select.com/upgrade-to-v2)
- React Select v1 documentation and examples are available at [v1.react-select.com](https://v1.react-select.com)
# Installation and usage
The easiest way to use react-select is to install it from npm and build it into your app with Webpack.
```
yarn add react-select
```
Then use it in your app:
#### With React Component
```js
import React from 'react';
import Select from 'react-select';
const options = [
{ value: 'chocolate', label: 'Chocolate' },
{ value: 'strawberry', label: 'Strawberry' },
{ value: 'vanilla', label: 'Vanilla' },
];
class App extends React.Component {
state = {
selectedOption: null,
};
handleChange = (selectedOption) => {
this.setState({ selectedOption }, () =>
console.log(`Option selected:`, this.state.selectedOption)
);
};
render() {
const { selectedOption } = this.state;
return (
<Select
value={selectedOption}
onChange={this.handleChange}
options={options}
/>
);
}
}
```
#### With React Hooks
```js
import React, { useState } from 'react';
import Select from 'react-select';
const options = [
{ value: 'chocolate', label: 'Chocolate' },
{ value: 'strawberry', label: 'Strawberry' },
{ value: 'vanilla', label: 'Vanilla' },
];
export default function App() {
const [selectedOption, setSelectedOption] = useState(null);
return (
<div className="App">
<Select
defaultValue={selectedOption}
onChange={setSelectedOption}
options={options}
/>
</div>
);
}
```
## Props
Common props you may want to specify include:
- `autoFocus` - focus the control when it mounts
- `className` - apply a className to the control
- `classNamePrefix` - apply classNames to inner elements with the given prefix
- `isDisabled` - disable the control
- `isMulti` - allow the user to select multiple values
- `isSearchable` - allow the user to search for matching options
- `name` - generate an HTML input with this name, containing the current value
- `onChange` - subscribe to change events
- `options` - specify the options the user can select from
- `placeholder` - change the text displayed when no option is selected
- `noOptionsMessage` - ({ inputValue: string }) => string | null - Text to display when there are no options
- `value` - control the current value
See the [props documentation](https://www.react-select.com/props) for complete documentation on the props react-select supports.
## Controllable Props
You can control the following props by providing values for them. If you don't, react-select will manage them for you.
- `value` / `onChange` - specify the current value of the control
- `menuIsOpen` / `onMenuOpen` / `onMenuClose` - control whether the menu is open
- `inputValue` / `onInputChange` - control the value of the search input (changing this will update the available options)
If you don't provide these props, you can set the initial value of the state they control:
- `defaultValue` - set the initial value of the control
- `defaultMenuIsOpen` - set the initial open value of the menu
- `defaultInputValue` - set the initial value of the search input
## Methods
React-select exposes two public methods:
- `focus()` - focus the control programmatically
- `blur()` - blur the control programmatically
## Customisation
Check the docs for more information on:
- [Customising the styles](https://www.react-select.com/styles)
- [Using custom components](https://www.react-select.com/components)
- [Using the built-in animated components](https://www.react-select.com/home#animated-components)
- [Creating an async select](https://www.react-select.com/async)
- [Allowing users to create new options](https://www.react-select.com/creatable)
- [Advanced use-cases](https://www.react-select.com/advanced)
- [TypeScript guide](https://www.react-select.com/typescript)
## TypeScript
The v5 release represents a rewrite from JavaScript to TypeScript. The types for v4 and earlier releases are available at [@types](https://www.npmjs.com/package/@types/react-select). See the [TypeScript guide](https://www.react-select.com/typescript) for how to use the types starting with v5.
# Thanks
Thank you to everyone who has contributed to this project. It's been a wild ride.
If you like React Select, you should [follow me on twitter](https://twitter.com/jedwatson)!
Shout out to [Joss Mackison](https://github.com/jossmac), [Charles Lee](https://github.com/gwyneplaine), [Ben Conolly](https://github.com/Noviny), [Tom Walker](https://github.com/bladey), [Nathan Bierema](https://github.com/Methuselah96), [Eric Bonow](https://github.com/ebonow), [Emma Hamilton](https://github.com/emmatown), [Dave Brotherstone](https://github.com/bruderstein), [Brian Vaughn](https://github.com/bvaughn), and the [Atlassian Design System](https://atlassian.design) team who along with many other contributors have made this possible ❤️
## License
MIT Licensed. Copyright (c) Jed Watson 2022.

View File

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

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