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 @@
{"version":3,"file":"getVisibleEntities.js","names":["isHidden","hidden","user","getVisibleEntities","req","collections","payload","config","map","slug","admin","filter","Boolean","globals"],"sources":["../../src/utilities/getVisibleEntities.ts"],"sourcesContent":["import type { PayloadRequest, VisibleEntities } from 'payload'\n\ntype Hidden = ((args: { user: unknown }) => boolean) | boolean\n\nfunction isHidden(hidden: Hidden | undefined, user: unknown): boolean {\n if (typeof hidden === 'function') {\n try {\n return hidden({ user })\n } catch {\n return true\n }\n }\n return !!hidden\n}\n\nexport function getVisibleEntities({ req }: { req: PayloadRequest }): VisibleEntities {\n return {\n collections: req.payload.config.collections\n .map(({ slug, admin: { hidden } }) => (!isHidden(hidden, req.user) ? slug : null))\n .filter(Boolean),\n globals: req.payload.config.globals\n .map(({ slug, admin: { hidden } }) => (!isHidden(hidden, req.user) ? slug : null))\n .filter(Boolean),\n }\n}\n"],"mappings":"AAIA,SAASA,SAASC,MAA0B,EAAEC,IAAa;EACzD,IAAI,OAAOD,MAAA,KAAW,YAAY;IAChC,IAAI;MACF,OAAOA,MAAA,CAAO;QAAEC;MAAK;IACvB,EAAE,MAAM;MACN,OAAO;IACT;EACF;EACA,OAAO,CAAC,CAACD,MAAA;AACX;AAEA,OAAO,SAASE,mBAAmB;EAAEC;AAAG,CAA2B;EACjE,OAAO;IACLC,WAAA,EAAaD,GAAA,CAAIE,OAAO,CAACC,MAAM,CAACF,WAAW,CACxCG,GAAG,CAAC,CAAC;MAAEC,IAAI;MAAEC,KAAA,EAAO;QAAET;MAAM;IAAE,CAAE,KAAM,CAACD,QAAA,CAASC,MAAA,EAAQG,GAAA,CAAIF,IAAI,IAAIO,IAAA,GAAO,MAC3EE,MAAM,CAACC,OAAA;IACVC,OAAA,EAAST,GAAA,CAAIE,OAAO,CAACC,MAAM,CAACM,OAAO,CAChCL,GAAG,CAAC,CAAC;MAAEC,IAAI;MAAEC,KAAA,EAAO;QAAET;MAAM;IAAE,CAAE,KAAM,CAACD,QAAA,CAASC,MAAA,EAAQG,GAAA,CAAIF,IAAI,IAAIO,IAAA,GAAO,MAC3EE,MAAM,CAACC,OAAA;EACZ;AACF","ignoreList":[]}

View File

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

View File

@@ -0,0 +1,15 @@
# Installation
> `npm install --save @types/pg`
# Summary
This package contains type definitions for pg (https://github.com/brianc/node-postgres).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pg.
### Additional Details
* Last updated: Mon, 27 Oct 2025 23:32:24 GMT
* Dependencies: [@types/node](https://npmjs.com/package/@types/node), [pg-protocol](https://npmjs.com/package/pg-protocol), [pg-types](https://npmjs.com/package/pg-types)
# Credits
These definitions were written by [Phips Peter](https://github.com/pspeter3).

View File

@@ -0,0 +1,171 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.PossibleTypeExtensionsRule = PossibleTypeExtensionsRule;
var _didYouMean = require('../../jsutils/didYouMean.js');
var _inspect = require('../../jsutils/inspect.js');
var _invariant = require('../../jsutils/invariant.js');
var _suggestionList = require('../../jsutils/suggestionList.js');
var _GraphQLError = require('../../error/GraphQLError.js');
var _kinds = require('../../language/kinds.js');
var _predicates = require('../../language/predicates.js');
var _definition = require('../../type/definition.js');
/**
* Possible type extension
*
* A type extension is only valid if the type is defined and has the same kind.
*/
function PossibleTypeExtensionsRule(context) {
const schema = context.getSchema();
const definedTypes = Object.create(null);
for (const def of context.getDocument().definitions) {
if ((0, _predicates.isTypeDefinitionNode)(def)) {
definedTypes[def.name.value] = def;
}
}
return {
ScalarTypeExtension: checkExtension,
ObjectTypeExtension: checkExtension,
InterfaceTypeExtension: checkExtension,
UnionTypeExtension: checkExtension,
EnumTypeExtension: checkExtension,
InputObjectTypeExtension: checkExtension,
};
function checkExtension(node) {
const typeName = node.name.value;
const defNode = definedTypes[typeName];
const existingType =
schema === null || schema === void 0 ? void 0 : schema.getType(typeName);
let expectedKind;
if (defNode) {
expectedKind = defKindToExtKind[defNode.kind];
} else if (existingType) {
expectedKind = typeToExtKind(existingType);
}
if (expectedKind) {
if (expectedKind !== node.kind) {
const kindStr = extensionKindToTypeName(node.kind);
context.reportError(
new _GraphQLError.GraphQLError(
`Cannot extend non-${kindStr} type "${typeName}".`,
{
nodes: defNode ? [defNode, node] : node,
},
),
);
}
} else {
const allTypeNames = Object.keys({
...definedTypes,
...(schema === null || schema === void 0
? void 0
: schema.getTypeMap()),
});
const suggestedTypes = (0, _suggestionList.suggestionList)(
typeName,
allTypeNames,
);
context.reportError(
new _GraphQLError.GraphQLError(
`Cannot extend type "${typeName}" because it is not defined.` +
(0, _didYouMean.didYouMean)(suggestedTypes),
{
nodes: node.name,
},
),
);
}
}
}
const defKindToExtKind = {
[_kinds.Kind.SCALAR_TYPE_DEFINITION]: _kinds.Kind.SCALAR_TYPE_EXTENSION,
[_kinds.Kind.OBJECT_TYPE_DEFINITION]: _kinds.Kind.OBJECT_TYPE_EXTENSION,
[_kinds.Kind.INTERFACE_TYPE_DEFINITION]: _kinds.Kind.INTERFACE_TYPE_EXTENSION,
[_kinds.Kind.UNION_TYPE_DEFINITION]: _kinds.Kind.UNION_TYPE_EXTENSION,
[_kinds.Kind.ENUM_TYPE_DEFINITION]: _kinds.Kind.ENUM_TYPE_EXTENSION,
[_kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION]:
_kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION,
};
function typeToExtKind(type) {
if ((0, _definition.isScalarType)(type)) {
return _kinds.Kind.SCALAR_TYPE_EXTENSION;
}
if ((0, _definition.isObjectType)(type)) {
return _kinds.Kind.OBJECT_TYPE_EXTENSION;
}
if ((0, _definition.isInterfaceType)(type)) {
return _kinds.Kind.INTERFACE_TYPE_EXTENSION;
}
if ((0, _definition.isUnionType)(type)) {
return _kinds.Kind.UNION_TYPE_EXTENSION;
}
if ((0, _definition.isEnumType)(type)) {
return _kinds.Kind.ENUM_TYPE_EXTENSION;
}
if ((0, _definition.isInputObjectType)(type)) {
return _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION;
}
/* c8 ignore next 3 */
// Not reachable. All possible types have been considered
false ||
(0, _invariant.invariant)(
false,
'Unexpected type: ' + (0, _inspect.inspect)(type),
);
}
function extensionKindToTypeName(kind) {
switch (kind) {
case _kinds.Kind.SCALAR_TYPE_EXTENSION:
return 'scalar';
case _kinds.Kind.OBJECT_TYPE_EXTENSION:
return 'object';
case _kinds.Kind.INTERFACE_TYPE_EXTENSION:
return 'interface';
case _kinds.Kind.UNION_TYPE_EXTENSION:
return 'union';
case _kinds.Kind.ENUM_TYPE_EXTENSION:
return 'enum';
case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION:
return 'input object';
// Not reachable. All possible types have been considered
/* c8 ignore next */
default:
false ||
(0, _invariant.invariant)(
false,
'Unexpected kind: ' + (0, _inspect.inspect)(kind),
);
}
}

View File

@@ -0,0 +1,776 @@
import { getDayOfYear } from "../../getDayOfYear.js";
import { getISOWeek } from "../../getISOWeek.js";
import { getISOWeekYear } from "../../getISOWeekYear.js";
import { getWeek } from "../../getWeek.js";
import { getWeekYear } from "../../getWeekYear.js";
import { addLeadingZeros } from "../addLeadingZeros.js";
import { lightFormatters } from "./lightFormatters.js";
const dayPeriodEnum = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
};
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | Milliseconds in day |
* | b | AM, PM, noon, midnight | B | Flexible day period |
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
* | d | Day of month | D | Day of year |
* | e | Local day of week | E | Day of week |
* | f | | F* | Day of week in month |
* | g* | Modified Julian day | G | Era |
* | h | Hour [1-12] | H | Hour [0-23] |
* | i! | ISO day of week | I! | ISO week of year |
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
* | k | Hour [1-24] | K | Hour [0-11] |
* | l* | (deprecated) | L | Stand-alone month |
* | m | Minute | M | Month |
* | n | | N | |
* | o! | Ordinal number modifier | O | Timezone (GMT) |
* | p! | Long localized time | P! | Long localized date |
* | q | Stand-alone quarter | Q | Quarter |
* | r* | Related Gregorian year | R! | ISO week-numbering year |
* | s | Second | S | Fraction of second |
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
* | u | Extended year | U* | Cyclic year |
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
* | w | Local week of year | W* | Week of month |
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
* | y | Year (abs) | Y | Local week-numbering year |
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*
* Letters marked by ! are non-standard, but implemented by date-fns:
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
* i.e. 7 for Sunday, 1 for Monday, etc.
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
* `R` is supposed to be used in conjunction with `I` and `i`
* for universal ISO week-numbering date, whereas
* `Y` is supposed to be used in conjunction with `w` and `e`
* for week-numbering date specific to the locale.
* - `P` is long localized date format
* - `p` is long localized time format
*/
export const formatters = {
// Era
G: function (date, token, localize) {
const era = date.getFullYear() > 0 ? 1 : 0;
switch (token) {
// AD, BC
case "G":
case "GG":
case "GGG":
return localize.era(era, { width: "abbreviated" });
// A, B
case "GGGGG":
return localize.era(era, { width: "narrow" });
// Anno Domini, Before Christ
case "GGGG":
default:
return localize.era(era, { width: "wide" });
}
},
// Year
y: function (date, token, localize) {
// Ordinal number
if (token === "yo") {
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return localize.ordinalNumber(year, { unit: "year" });
}
return lightFormatters.y(date, token);
},
// Local week-numbering year
Y: function (date, token, localize, options) {
const signedWeekYear = getWeekYear(date, options);
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
// Two digit year
if (token === "YY") {
const twoDigitYear = weekYear % 100;
return addLeadingZeros(twoDigitYear, 2);
}
// Ordinal number
if (token === "Yo") {
return localize.ordinalNumber(weekYear, { unit: "year" });
}
// Padding
return addLeadingZeros(weekYear, token.length);
},
// ISO week-numbering year
R: function (date, token) {
const isoWeekYear = getISOWeekYear(date);
// Padding
return addLeadingZeros(isoWeekYear, token.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function (date, token) {
const year = date.getFullYear();
return addLeadingZeros(year, token.length);
},
// Quarter
Q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "Q":
return String(quarter);
// 01, 02, 03, 04
case "QQ":
return addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "Qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "QQQ":
return localize.quarter(quarter, {
width: "abbreviated",
context: "formatting",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "QQQQQ":
return localize.quarter(quarter, {
width: "narrow",
context: "formatting",
});
// 1st quarter, 2nd quarter, ...
case "QQQQ":
default:
return localize.quarter(quarter, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone quarter
q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "q":
return String(quarter);
// 01, 02, 03, 04
case "qq":
return addLeadingZeros(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "qqq":
return localize.quarter(quarter, {
width: "abbreviated",
context: "standalone",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "qqqqq":
return localize.quarter(quarter, {
width: "narrow",
context: "standalone",
});
// 1st quarter, 2nd quarter, ...
case "qqqq":
default:
return localize.quarter(quarter, {
width: "wide",
context: "standalone",
});
}
},
// Month
M: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
case "M":
case "MM":
return lightFormatters.M(date, token);
// 1st, 2nd, ..., 12th
case "Mo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "MMM":
return localize.month(month, {
width: "abbreviated",
context: "formatting",
});
// J, F, ..., D
case "MMMMM":
return localize.month(month, {
width: "narrow",
context: "formatting",
});
// January, February, ..., December
case "MMMM":
default:
return localize.month(month, { width: "wide", context: "formatting" });
}
},
// Stand-alone month
L: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
// 1, 2, ..., 12
case "L":
return String(month + 1);
// 01, 02, ..., 12
case "LL":
return addLeadingZeros(month + 1, 2);
// 1st, 2nd, ..., 12th
case "Lo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "LLL":
return localize.month(month, {
width: "abbreviated",
context: "standalone",
});
// J, F, ..., D
case "LLLLL":
return localize.month(month, {
width: "narrow",
context: "standalone",
});
// January, February, ..., December
case "LLLL":
default:
return localize.month(month, { width: "wide", context: "standalone" });
}
},
// Local week of year
w: function (date, token, localize, options) {
const week = getWeek(date, options);
if (token === "wo") {
return localize.ordinalNumber(week, { unit: "week" });
}
return addLeadingZeros(week, token.length);
},
// ISO week of year
I: function (date, token, localize) {
const isoWeek = getISOWeek(date);
if (token === "Io") {
return localize.ordinalNumber(isoWeek, { unit: "week" });
}
return addLeadingZeros(isoWeek, token.length);
},
// Day of the month
d: function (date, token, localize) {
if (token === "do") {
return localize.ordinalNumber(date.getDate(), { unit: "date" });
}
return lightFormatters.d(date, token);
},
// Day of year
D: function (date, token, localize) {
const dayOfYear = getDayOfYear(date);
if (token === "Do") {
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
}
return addLeadingZeros(dayOfYear, token.length);
},
// Day of week
E: function (date, token, localize) {
const dayOfWeek = date.getDay();
switch (token) {
// Tue
case "E":
case "EE":
case "EEE":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "EEEEE":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "EEEEEE":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "EEEE":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Local day of week
e: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (Nth day of week with current locale or weekStartsOn)
case "e":
return String(localDayOfWeek);
// Padded numerical value
case "ee":
return addLeadingZeros(localDayOfWeek, 2);
// 1st, 2nd, ..., 7th
case "eo":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "eee":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "eeeee":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "eeeeee":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "eeee":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone local day of week
c: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (same as in `e`)
case "c":
return String(localDayOfWeek);
// Padded numerical value
case "cc":
return addLeadingZeros(localDayOfWeek, token.length);
// 1st, 2nd, ..., 7th
case "co":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "ccc":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "standalone",
});
// T
case "ccccc":
return localize.day(dayOfWeek, {
width: "narrow",
context: "standalone",
});
// Tu
case "cccccc":
return localize.day(dayOfWeek, {
width: "short",
context: "standalone",
});
// Tuesday
case "cccc":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "standalone",
});
}
},
// ISO day of week
i: function (date, token, localize) {
const dayOfWeek = date.getDay();
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
switch (token) {
// 2
case "i":
return String(isoDayOfWeek);
// 02
case "ii":
return addLeadingZeros(isoDayOfWeek, token.length);
// 2nd
case "io":
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
// Tue
case "iii":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "iiiii":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "iiiiii":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "iiii":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// AM or PM
a: function (date, token, localize) {
const hours = date.getHours();
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "aaa":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "aaaaa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "aaaa":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// AM, PM, midnight, noon
b: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours === 12) {
dayPeriodEnumValue = dayPeriodEnum.noon;
} else if (hours === 0) {
dayPeriodEnumValue = dayPeriodEnum.midnight;
} else {
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
}
switch (token) {
case "b":
case "bb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "bbb":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "bbbbb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "bbbb":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours >= 17) {
dayPeriodEnumValue = dayPeriodEnum.evening;
} else if (hours >= 12) {
dayPeriodEnumValue = dayPeriodEnum.afternoon;
} else if (hours >= 4) {
dayPeriodEnumValue = dayPeriodEnum.morning;
} else {
dayPeriodEnumValue = dayPeriodEnum.night;
}
switch (token) {
case "B":
case "BB":
case "BBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "BBBBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "BBBB":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// Hour [1-12]
h: function (date, token, localize) {
if (token === "ho") {
let hours = date.getHours() % 12;
if (hours === 0) hours = 12;
return localize.ordinalNumber(hours, { unit: "hour" });
}
return lightFormatters.h(date, token);
},
// Hour [0-23]
H: function (date, token, localize) {
if (token === "Ho") {
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
}
return lightFormatters.H(date, token);
},
// Hour [0-11]
K: function (date, token, localize) {
const hours = date.getHours() % 12;
if (token === "Ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return addLeadingZeros(hours, token.length);
},
// Hour [1-24]
k: function (date, token, localize) {
let hours = date.getHours();
if (hours === 0) hours = 24;
if (token === "ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return addLeadingZeros(hours, token.length);
},
// Minute
m: function (date, token, localize) {
if (token === "mo") {
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
}
return lightFormatters.m(date, token);
},
// Second
s: function (date, token, localize) {
if (token === "so") {
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
}
return lightFormatters.s(date, token);
},
// Fraction of second
S: function (date, token) {
return lightFormatters.S(date, token);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
if (timezoneOffset === 0) {
return "Z";
}
switch (token) {
// Hours and optional minutes
case "X":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case "XXXX":
case "XX": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case "XXXXX":
case "XXX": // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Hours and optional minutes
case "x":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case "xxxx":
case "xx": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case "xxxxx":
case "xxx": // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ":");
}
},
// Timezone (GMT)
O: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "O":
case "OO":
case "OOO":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
// Long
case "OOOO":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
// Timezone (specific non-location)
z: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "z":
case "zz":
case "zzz":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
// Long
case "zzzz":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
// Seconds timestamp
t: function (date, token, _localize) {
const timestamp = Math.trunc(+date / 1000);
return addLeadingZeros(timestamp, token.length);
},
// Milliseconds timestamp
T: function (date, token, _localize) {
return addLeadingZeros(+date, token.length);
},
};
function formatTimezoneShort(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = Math.trunc(absOffset / 60);
const minutes = absOffset % 60;
if (minutes === 0) {
return sign + String(hours);
}
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
}
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
if (offset % 60 === 0) {
const sign = offset > 0 ? "-" : "+";
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
}
return formatTimezone(offset, delimiter);
}
function formatTimezone(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
const minutes = addLeadingZeros(absOffset % 60, 2);
return sign + hours + delimiter + minutes;
}

View File

@@ -0,0 +1,15 @@
import type { CollectionSlug } from 'payload';
import React from 'react';
export declare function ListCreateNewDocInFolderButton({ buttonLabel, buttonSize, buttonStyle, collectionSlugs, folderAssignedCollections, onCreateSuccess, slugPrefix, }: {
buttonLabel: string;
buttonSize?: 'large' | 'medium' | 'small' | 'xsmall';
buttonStyle?: 'error' | 'icon-label' | 'none' | 'pill' | 'primary' | 'secondary' | 'subtle' | 'tab' | 'transparent';
collectionSlugs: CollectionSlug[];
folderAssignedCollections: CollectionSlug[];
onCreateSuccess: (args: {
collectionSlug: CollectionSlug;
doc: Record<string, unknown>;
}) => Promise<void> | void;
slugPrefix: string;
}): React.JSX.Element;
//# sourceMappingURL=ListCreateNewDocInFolderButton.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["export const DEFAULT_ENVIRONMENT = 'production';\nexport const DEV_ENVIRONMENT = 'development';\n"],"names":[],"mappings":"AAAO,MAAM,mBAAA,GAAsB;AAC5B,MAAM,eAAA,GAAkB;;;;"}

View File

@@ -0,0 +1,103 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import { getTranslation } from '@payloadcms/translations';
import { setsAreEqual } from 'payload/shared';
import React, { useCallback, useMemo, useState } from 'react';
import { CheckboxInput } from '../../../fields/Checkbox/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import { DrawerHeader } from '../../BulkUpload/Header/index.js';
import { Button } from '../../Button/index.js';
import { Drawer } from '../../Drawer/index.js';
import './index.scss';
const getLocaleOptions = ({
i18n,
localization
}) => {
return localization.locales.map(locale => ({
label: getTranslation(locale.label, i18n),
value: locale.code
}));
};
const baseClass = 'select-locales-drawer';
export const SelectLocalesDrawer = ({
slug,
localization,
onConfirm
}) => {
const {
i18n,
t
} = useTranslation();
const {
toggleModal
} = useModal();
const [selectedLocales, setSelectedLocales] = useState([]);
const localeOptions = useMemo(() => getLocaleOptions({
i18n,
localization
}), [localization, i18n]);
const allLocales = useMemo(() => localeOptions.map(locale => locale.value), [localeOptions]);
const allLocalesSelected = useMemo(() => setsAreEqual(new Set(selectedLocales), new Set(allLocales)), [selectedLocales, allLocales]);
const handleSelectAll = useCallback(() => {
setSelectedLocales(allLocalesSelected ? [] : [...allLocales]);
}, [allLocalesSelected, allLocales]);
const handleToggleLocale = useCallback(localeValue => {
setSelectedLocales(prev => prev.includes(localeValue) ? prev.filter(l => l !== localeValue) : [...prev, localeValue]);
}, []);
const handleConfirm = useCallback(async () => {
await onConfirm({
selectedLocales
});
toggleModal(slug);
}, [onConfirm, selectedLocales, slug, toggleModal]);
return /*#__PURE__*/_jsxs(Drawer, {
className: baseClass,
gutter: false,
Header: /*#__PURE__*/_jsx(DrawerHeader, {
onClose: () => {
toggleModal(slug);
},
title: `${t('general:duplicate')} ${t('localization:selectedLocales')}`
}),
slug: slug,
children: [/*#__PURE__*/_jsxs("div", {
className: `${baseClass}__sub-header`,
children: [/*#__PURE__*/_jsx("span", {
children: t('localization:selectLocaleToDuplicate')
}), /*#__PURE__*/_jsx(Button, {
buttonStyle: "primary",
disabled: selectedLocales.length === 0,
iconPosition: "left",
id: "#action-duplicate-confirm",
onClick: handleConfirm,
size: "medium",
children: t('general:duplicate')
})]
}), /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__content`,
children: [/*#__PURE__*/_jsx("div", {
className: `${baseClass}__item`,
children: /*#__PURE__*/_jsx(CheckboxInput, {
checked: allLocalesSelected,
id: "select-locale-all",
label: t('general:selectAll', {
count: allLocales.length,
label: t('general:locales')
}),
onToggle: handleSelectAll
})
}), localeOptions.map(locale_0 => /*#__PURE__*/_jsx("div", {
className: `${baseClass}__item`,
children: /*#__PURE__*/_jsx(CheckboxInput, {
checked: selectedLocales.includes(locale_0.value),
id: `select-locale-${locale_0.value}`,
label: locale_0.label,
onToggle: () => handleToggleLocale(locale_0.value)
})
}, locale_0.value))]
})]
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,2 @@
export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
export type Scalars = Primitive | Primitive[];

View File

@@ -0,0 +1,25 @@
import Pool from './pool'
import MockAgent from './mock-agent'
import { Interceptable, MockInterceptor } from './mock-interceptor'
import Dispatcher from './dispatcher'
export default MockPool
/** MockPool extends the Pool API and allows one to mock requests. */
declare class MockPool extends Pool implements Interceptable {
constructor(origin: string, options: MockPool.Options);
/** Intercepts any matching requests that use the same origin as this mock pool. */
intercept(options: MockInterceptor.Options): MockInterceptor;
/** Dispatches a mocked request. */
dispatch(options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandlers): boolean;
/** Closes the mock pool and gracefully waits for enqueued requests to complete. */
close(): Promise<void>;
}
declare namespace MockPool {
/** MockPool options. */
export interface Options extends Pool.Options {
/** The agent to associate this MockPool with. */
agent: MockAgent;
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/transform/read/traverseFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAKzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AAQnE,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,OAAO,EAAE,cAAc,CAAA;IACvB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAA;IACjB;;OAEG;IACH,MAAM,EAAE,eAAe,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAA;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAClD,iBAAiB,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IACxD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAChD,iBAAiB,EAAE,MAAM,CAAA;IACzB;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AAID,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,6NAmB7D,kBAAkB,KAAG,CAwnBvB,CAAA"}

View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const errors_js_1 = require("../util/errors.js");
const iv_js_1 = require("./iv.js");
const checkIvLength = (enc, iv) => {
if (iv.length << 3 !== (0, iv_js_1.bitLength)(enc)) {
throw new errors_js_1.JWEInvalid('Invalid Initialization Vector length');
}
};
exports.default = checkIvLength;

View File

@@ -0,0 +1,22 @@
import { type Client, type Config } from '@libsql/client/node';
import { type DrizzleConfig } from "../../utils.js";
import { type LibSQLDatabase } from "../driver-core.js";
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,193 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import { getTranslation } from '@payloadcms/translations';
import { unflatten } from 'payload/shared';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Button } from '../../../elements/Button/index.js';
import { Form } from '../../../forms/Form/index.js';
import { FieldPathContext } from '../../../forms/RenderFields/context.js';
import { RenderField } from '../../../forms/RenderFields/RenderField.js';
import { XIcon } from '../../../icons/X/index.js';
import { useAuth } from '../../../providers/Auth/index.js';
import { useServerFunctions } from '../../../providers/ServerFunctions/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import { abortAndIgnore, handleAbortRef } from '../../../utilities/abortAndIgnore.js';
import { FieldSelect } from '../../FieldSelect/index.js';
import { useFormsManager } from '../FormsManager/index.js';
import { baseClass } from './index.js';
import './index.scss';
import '../../../forms/RenderFields/index.scss';
export const EditManyBulkUploadsDrawerContent = props => {
const {
collection: {
fields,
labels: {
plural,
singular
}
} = {},
collection,
drawerSlug,
forms
} = props;
const [isInitializing, setIsInitializing] = useState(false);
const {
permissions
} = useAuth();
const {
i18n,
t
} = useTranslation();
const {
closeModal
} = useModal();
const {
bulkUpdateForm
} = useFormsManager();
const {
getFormState
} = useServerFunctions();
const abortFormStateRef = React.useRef(null);
const [selectedFields, setSelectedFields] = useState([]);
const collectionPermissions = permissions?.collections?.[collection.slug];
const select = useMemo(() => {
return unflatten(selectedFields.reduce((acc, option) => {
acc[option.value.path] = true;
return acc;
}, {}));
}, [selectedFields]);
const onChange = useCallback(async ({
formState: prevFormState,
submitted
}) => {
const controller = handleAbortRef(abortFormStateRef);
const {
state
} = await getFormState({
collectionSlug: collection.slug,
docPermissions: collectionPermissions,
docPreferences: null,
formState: prevFormState,
operation: 'update',
schemaPath: collection.slug,
select,
signal: controller.signal,
skipValidation: !submitted
});
abortFormStateRef.current = null;
return state;
}, [getFormState, collection, collectionPermissions, select]);
useEffect(() => {
const abortFormState = abortFormStateRef.current;
return () => {
abortAndIgnore(abortFormState);
};
}, []);
const handleSubmit = useCallback(formState => {
const pairedData = selectedFields.reduce((acc_0, option_0) => {
if (formState[option_0.value.path]) {
acc_0[option_0.value.path] = formState[option_0.value.path].value;
}
return acc_0;
}, {});
void bulkUpdateForm(pairedData, () => closeModal(drawerSlug));
}, [closeModal, drawerSlug, bulkUpdateForm, selectedFields]);
const onFieldSelect = useCallback(async ({
dispatchFields,
formState: formState_0,
selected
}) => {
setIsInitializing(true);
setSelectedFields(selected || []);
const {
state: state_0
} = await getFormState({
collectionSlug: collection.slug,
docPermissions: collectionPermissions,
docPreferences: null,
formState: formState_0,
operation: 'update',
schemaPath: collection.slug,
select: unflatten(selected.reduce((acc_1, option_1) => {
acc_1[option_1.value.path] = true;
return acc_1;
}, {})),
skipValidation: true
});
dispatchFields({
type: 'UPDATE_MANY',
formState: state_0
});
setIsInitializing(false);
}, [getFormState, collection, collectionPermissions]);
return /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__main`,
children: [/*#__PURE__*/_jsxs("div", {
className: `${baseClass}__header`,
children: [/*#__PURE__*/_jsx("h2", {
className: `${baseClass}__header__title`,
children: t('general:editingLabel', {
count: forms.length,
label: getTranslation(forms.length > 1 ? plural : singular, i18n)
})
}), /*#__PURE__*/_jsx("button", {
"aria-label": t('general:close'),
className: `${baseClass}__header__close`,
id: `close-drawer__${drawerSlug}`,
onClick: () => closeModal(drawerSlug),
type: "button",
children: /*#__PURE__*/_jsx(XIcon, {})
})]
}), /*#__PURE__*/_jsxs(Form, {
className: `${baseClass}__form`,
isInitializing: isInitializing,
onChange: [onChange],
onSubmit: handleSubmit,
children: [/*#__PURE__*/_jsx(FieldSelect, {
fields: fields,
onChange: onFieldSelect,
permissions: collectionPermissions.fields
}), selectedFields.length === 0 ? null : /*#__PURE__*/_jsx("div", {
className: "render-fields",
children: /*#__PURE__*/_jsx(FieldPathContext, {
value: undefined,
children: selectedFields.map((option_2, i) => {
const {
value: {
field,
fieldPermissions,
path
}
} = option_2;
return /*#__PURE__*/_jsx(RenderField, {
clientFieldConfig: field,
indexPath: "",
parentPath: "",
parentSchemaPath: "",
path: path,
permissions: fieldPermissions
}, `${path}-${i}`);
})
})
}), /*#__PURE__*/_jsx("div", {
className: `${baseClass}__sidebar-wrap`,
children: /*#__PURE__*/_jsx("div", {
className: `${baseClass}__sidebar`,
children: /*#__PURE__*/_jsx("div", {
className: `${baseClass}__sidebar-sticky-wrap`,
children: /*#__PURE__*/_jsx("div", {
className: `${baseClass}__document-actions`,
children: /*#__PURE__*/_jsx(Button, {
type: "submit",
children: t('general:applyChanges')
})
})
})
})
})]
})]
});
};
//# sourceMappingURL=DrawerContent.js.map

View File

@@ -0,0 +1,77 @@
"use strict";
exports.set = set;
var _index = require("./constructFrom.js");
var _index2 = require("./setMonth.js");
var _index3 = require("./toDate.js");
/**
* @name set
* @category Common Helpers
* @summary Set date values to a given date.
*
* @description
* Set date values to a given date.
*
* Sets time values to date from object `values`.
* A value is not set if it is undefined or null or doesn't exist in `values`.
*
* Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
* to use native `Date#setX` methods. If you use this function, you may not want to include the
* other `setX` functions that date-fns provides if you are concerned about the bundle size.
*
* @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 values - The date values to be set
*
* @returns The new date with options set
*
* @example
* // Transform 1 September 2014 into 20 October 2015 in a single line:
* const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
* //=> Tue Oct 20 2015 00:00:00
*
* @example
* // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
* const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
* //=> Mon Sep 01 2014 12:23:45
*/
function set(date, values) {
let _date = (0, _index3.toDate)(date);
// Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
if (isNaN(+_date)) {
return (0, _index.constructFrom)(date, NaN);
}
if (values.year != null) {
_date.setFullYear(values.year);
}
if (values.month != null) {
_date = (0, _index2.setMonth)(_date, values.month);
}
if (values.date != null) {
_date.setDate(values.date);
}
if (values.hours != null) {
_date.setHours(values.hours);
}
if (values.minutes != null) {
_date.setMinutes(values.minutes);
}
if (values.seconds != null) {
_date.setSeconds(values.seconds);
}
if (values.milliseconds != null) {
_date.setMilliseconds(values.milliseconds);
}
return _date;
}

View File

@@ -0,0 +1,39 @@
var baseFlatten = require('./_baseFlatten'),
baseIteratee = require('./_baseIteratee'),
baseRest = require('./_baseRest'),
baseUniq = require('./_baseUniq'),
isArrayLikeObject = require('./isArrayLikeObject'),
last = require('./last');
/**
* This method is like `_.union` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by
* which uniqueness is computed. Result values are chosen from the first
* array in which the value occurs. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.unionBy([2.1], [1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // The `_.property` iteratee shorthand.
* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
var unionBy = baseRest(function(arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2));
});
module.exports = unionBy;

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"goal.js","sources":["../../../src/icons/goal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Goal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTNWMmw4IDQtOCA0IiAvPgogIDxwYXRoIGQ9Ik0yMC41NjEgMTAuMjIyYTkgOSAwIDEgMS0xMi41NS01LjI5IiAvPgogIDxwYXRoIGQ9Ik04LjAwMiA5Ljk5N2E1IDUgMCAxIDAgOC45IDIuMDIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/goal\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Goal = createLucideIcon('Goal', [\n ['path', { d: 'M12 13V2l8 4-8 4', key: '5wlwwj' }],\n ['path', { d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,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,100 @@
import { Context, Exception, HrTime, Link, Span as APISpan, Attributes, AttributeValue, SpanContext, SpanKind, SpanStatus, TimeInput } from '@opentelemetry/api';
import { InstrumentationScope } from '@opentelemetry/core';
import { Resource } from '@opentelemetry/resources';
import { ReadableSpan } from './export/ReadableSpan';
import { SpanProcessor } from './SpanProcessor';
import { TimedEvent } from './TimedEvent';
import { SpanLimits } from './types';
/**
* This type provides the properties of @link{ReadableSpan} at the same time
* of the Span API
*/
export type Span = APISpan & ReadableSpan;
interface SpanOptions {
resource: Resource;
scope: InstrumentationScope;
context: Context;
spanContext: SpanContext;
name: string;
kind: SpanKind;
parentSpanContext?: SpanContext;
links?: Link[];
startTime?: TimeInput;
attributes?: Attributes;
spanLimits: SpanLimits;
spanProcessor: SpanProcessor;
}
/**
* This class represents a span.
*/
export declare class SpanImpl implements Span {
private readonly _spanContext;
readonly kind: SpanKind;
readonly parentSpanContext?: SpanContext;
readonly attributes: Attributes;
readonly links: Link[];
readonly events: TimedEvent[];
readonly startTime: HrTime;
readonly resource: Resource;
readonly instrumentationScope: InstrumentationScope;
private _droppedAttributesCount;
private _droppedEventsCount;
private _droppedLinksCount;
private _attributesCount;
name: string;
status: SpanStatus;
endTime: HrTime;
private _ended;
private _duration;
private readonly _spanProcessor;
private readonly _spanLimits;
private readonly _attributeValueLengthLimit;
private readonly _performanceStartTime;
private readonly _performanceOffset;
private readonly _startTimeProvided;
/**
* Constructs a new SpanImpl instance.
*/
constructor(opts: SpanOptions);
spanContext(): SpanContext;
setAttribute(key: string, value?: AttributeValue): this;
setAttributes(attributes: Attributes): this;
/**
*
* @param name Span Name
* @param [attributesOrStartTime] Span attributes or start time
* if type is {@type TimeInput} and 3rd param is undefined
* @param [timeStamp] Specified time stamp for the event
*/
addEvent(name: string, attributesOrStartTime?: Attributes | TimeInput, timeStamp?: TimeInput): this;
addLink(link: Link): this;
addLinks(links: Link[]): this;
setStatus(status: SpanStatus): this;
updateName(name: string): this;
end(endTime?: TimeInput): void;
private _getTime;
isRecording(): boolean;
recordException(exception: Exception, time?: TimeInput): void;
get duration(): HrTime;
get ended(): boolean;
get droppedAttributesCount(): number;
get droppedEventsCount(): number;
get droppedLinksCount(): number;
private _isSpanEnded;
private _truncateToLimitUtil;
/**
* If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then
* return string with truncated to {@code attributeValueLengthLimit} characters
*
* If the given attribute value is array of strings then
* return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters
*
* Otherwise return same Attribute {@code value}
*
* @param value Attribute value
* @returns truncated attribute value if required, otherwise same value
*/
private _truncateToSize;
}
export {};
//# sourceMappingURL=Span.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"commitTransaction.d.ts","sourceRoot":"","sources":["../../src/utilities/commitTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,GACpD,OAAO,CAAC,IAAI,CAAC,CAKf"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/fields/Relationship/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,MAAM,GAAG;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EA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,CAAC,EAAE,IAAI,GAAG,iBAAiB,EAAE,CAAA;IAClD,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAA;IACvD,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,iBAAiB,EAAE,CAAA;CAC5C,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/fields/hooks/beforeChange/traverseFields.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { ValidationFieldError } from '../../../errors/index.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { RequestContext } from '../../../index.js'\nimport type { JsonObject, Operation, PayloadRequest } from '../../../types/index.js'\nimport type { Field, TabAsField } from '../../config/types.js'\n\nimport { promise } from './promise.js'\n\ntype Args = {\n /**\n * Data of the nearest parent block. If no parent block exists, this will be the `undefined`\n */\n blockData?: JsonObject\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n data: JsonObject\n /**\n * The original data (not modified by any hooks)\n */\n doc: JsonObject\n /**\n * The original data with locales (not modified by any hooks)\n */\n docWithLocales: JsonObject\n errors: ValidationFieldError[]\n /**\n * Built up labels of parent fields\n *\n * @example \"Group Field > Tab Field > Text Field\"\n */\n fieldLabelPath: string\n fields: (Field | TabAsField)[]\n global: null | SanitizedGlobalConfig\n id?: number | string\n mergeLocaleActions: (() => Promise<void> | void)[]\n operation: Operation\n overrideAccess: boolean\n parentIndexPath: string\n /**\n * @todo make required in v4.0\n */\n parentIsLocalized?: boolean\n parentPath: string\n parentSchemaPath: string\n req: PayloadRequest\n siblingData: JsonObject\n /**\n * The original siblingData (not modified by any hooks)\n */\n siblingDoc: JsonObject\n /**\n * The original siblingData with locales (not modified by any hooks)\n */\n siblingDocWithLocales: JsonObject\n skipValidation?: boolean\n}\n\n/**\n * This function is responsible for the following actions, in order:\n * - Run condition\n * - Execute field hooks\n * - Validate data\n * - Transform data for storage\n * - Unflatten locales. The input `data` is the normal document for one locale. The output result will become the document with locales.\n */\nexport const traverseFields = async ({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath,\n fields,\n global,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales,\n skipValidation,\n}: Args): Promise<void> => {\n const promises: Promise<void>[] = []\n\n fields.forEach((field, fieldIndex) => {\n promises.push(\n promise({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n field,\n fieldIndex,\n fieldLabelPath,\n global,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized: parentIsLocalized!,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales,\n siblingFields: fields,\n skipValidation: skipValidation!,\n }),\n )\n })\n\n await Promise.all(promises)\n}\n"],"names":["promise","traverseFields","id","blockData","collection","context","data","doc","docWithLocales","errors","fieldLabelPath","fields","global","mergeLocaleActions","operation","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","req","siblingData","siblingDoc","siblingDocWithLocales","skipValidation","promises","forEach","field","fieldIndex","push","siblingFields","Promise","all"],"mappings":"AAOA,SAASA,OAAO,QAAQ,eAAc;AAmDtC;;;;;;;CAOC,GACD,OAAO,MAAMC,iBAAiB,OAAO,EACnCC,EAAE,EACFC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,IAAI,EACJC,GAAG,EACHC,cAAc,EACdC,MAAM,EACNC,cAAc,EACdC,MAAM,EACNC,MAAM,EACNC,kBAAkB,EAClBC,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,UAAU,EACVC,gBAAgB,EAChBC,GAAG,EACHC,WAAW,EACXC,UAAU,EACVC,qBAAqB,EACrBC,cAAc,EACT;IACL,MAAMC,WAA4B,EAAE;IAEpCd,OAAOe,OAAO,CAAC,CAACC,OAAOC;QACrBH,SAASI,IAAI,CACX7B,QAAQ;YACNE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAkB;YACAC;YACAlB;YACAE;YACAC;YACAC;YACAC;YACAC;YACAC,mBAAmBA;YACnBC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAO,eAAenB;YACfa,gBAAgBA;QAClB;IAEJ;IAEA,MAAMO,QAAQC,GAAG,CAACP;AACpB,EAAC"}

View File

@@ -0,0 +1,107 @@
import { type Cache } from "../cache/core/cache.cjs";
import type { WithCacheConfig } from "../cache/core/types.cjs";
import { entityKind } from "../entity.cjs";
import { QueryPromise } from "../query-promise.cjs";
import type { TablesRelationalConfig } from "../relations.cjs";
import type { PreparedQuery } from "../session.cjs";
import type { Query, SQL } from "../sql/sql.cjs";
import type { SQLiteAsyncDialect, SQLiteSyncDialect } from "./dialect.cjs";
import { BaseSQLiteDatabase } from "./db.cjs";
import type { SQLiteRaw } from "./query-builders/raw.cjs";
import type { SelectedFieldsOrdered } from "./query-builders/select.types.cjs";
export interface PreparedQueryConfig {
type: 'sync' | 'async';
run: unknown;
all: unknown;
get: unknown;
values: unknown;
execute: unknown;
}
export declare class ExecuteResultSync<T> extends QueryPromise<T> {
private resultCb;
static readonly [entityKind]: string;
constructor(resultCb: () => T);
execute(): Promise<T>;
sync(): T;
}
export type ExecuteResult<TType extends 'sync' | 'async', TResult> = TType extends 'async' ? Promise<TResult> : ExecuteResultSync<TResult>;
export declare abstract class SQLitePreparedQuery<T extends PreparedQueryConfig> implements PreparedQuery {
private mode;
private executeMethod;
protected query: Query;
private cache?;
private queryMetadata?;
private cacheConfig?;
static readonly [entityKind]: string;
constructor(mode: 'sync' | 'async', executeMethod: SQLiteExecuteMethod, query: Query, cache?: Cache | undefined, queryMetadata?: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
} | undefined, cacheConfig?: WithCacheConfig | undefined);
getQuery(): Query;
abstract run(placeholderValues?: Record<string, unknown>): Result<T['type'], T['run']>;
mapRunResult(result: unknown, _isFromBatch?: boolean): unknown;
abstract all(placeholderValues?: Record<string, unknown>): Result<T['type'], T['all']>;
mapAllResult(_result: unknown, _isFromBatch?: boolean): unknown;
abstract get(placeholderValues?: Record<string, unknown>): Result<T['type'], T['get']>;
mapGetResult(_result: unknown, _isFromBatch?: boolean): unknown;
abstract values(placeholderValues?: Record<string, unknown>): Result<T['type'], T['values']>;
execute(placeholderValues?: Record<string, unknown>): ExecuteResult<T['type'], T['execute']>;
mapResult(response: unknown, isFromBatch?: boolean): unknown;
}
export interface SQLiteTransactionConfig {
behavior?: 'deferred' | 'immediate' | 'exclusive';
}
export type SQLiteExecuteMethod = 'run' | 'all' | 'get';
export declare abstract class SQLiteSession<TResultKind extends 'sync' | 'async', TRunResult, TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> {
static readonly [entityKind]: string;
constructor(
/** @internal */
dialect: {
sync: SQLiteSyncDialect;
async: SQLiteAsyncDialect;
}[TResultKind]);
abstract prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown, queryMetadata?: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
}, cacheConfig?: WithCacheConfig): SQLitePreparedQuery<PreparedQueryConfig & {
type: TResultKind;
}>;
prepareOneTimeQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown, queryMetadata?: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
}, cacheConfig?: WithCacheConfig): SQLitePreparedQuery<PreparedQueryConfig & {
type: TResultKind;
}>;
abstract transaction<T>(transaction: (tx: SQLiteTransaction<TResultKind, TRunResult, TFullSchema, TSchema>) => Result<TResultKind, T>, config?: SQLiteTransactionConfig): Result<TResultKind, T>;
run(query: SQL): Result<TResultKind, TRunResult>;
all<T = unknown>(query: SQL): Result<TResultKind, T[]>;
get<T = unknown>(query: SQL): Result<TResultKind, T>;
values<T extends any[] = unknown[]>(query: SQL): Result<TResultKind, T[]>;
count(sql: SQL): Promise<number>;
}
export type Result<TKind extends 'sync' | 'async', TResult> = {
sync: TResult;
async: Promise<TResult>;
}[TKind];
export type DBResult<TKind extends 'sync' | 'async', TResult> = {
sync: TResult;
async: SQLiteRaw<TResult>;
}[TKind];
export declare abstract class SQLiteTransaction<TResultType extends 'sync' | 'async', TRunResult, TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends BaseSQLiteDatabase<TResultType, TRunResult, TFullSchema, TSchema> {
protected schema: {
fullSchema: Record<string, unknown>;
schema: TSchema;
tableNamesMap: Record<string, string>;
} | undefined;
protected readonly nestedIndex: number;
static readonly [entityKind]: string;
constructor(resultType: TResultType, dialect: {
sync: SQLiteSyncDialect;
async: SQLiteAsyncDialect;
}[TResultType], session: SQLiteSession<TResultType, TRunResult, TFullSchema, TSchema>, schema: {
fullSchema: Record<string, unknown>;
schema: TSchema;
tableNamesMap: Record<string, string>;
} | undefined, nestedIndex?: number);
rollback(): never;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../src/index.types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,KAAK,SAAS,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,KAAK,KAAK,OAAO,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,KAAK,SAAS,MAAM,UAAU,CAAC;AAE3C,cAAc,UAAU,CAAC;AACzB,cAAc,UAA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License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BatchSpanProcessorBase } from '../../../export/BatchSpanProcessorBase';
import { globalErrorHandler } from '@opentelemetry/core';
export class BatchSpanProcessor extends BatchSpanProcessorBase {
_visibilityChangeListener;
_pageHideListener;
constructor(_exporter, config) {
super(_exporter, config);
this.onInit(config);
}
onInit(config) {
if (config?.disableAutoFlushOnDocumentHide !== true &&
typeof document !== 'undefined') {
this._visibilityChangeListener = () => {
if (document.visibilityState === 'hidden') {
this.forceFlush().catch(error => {
globalErrorHandler(error);
});
}
};
this._pageHideListener = () => {
this.forceFlush().catch(error => {
globalErrorHandler(error);
});
};
document.addEventListener('visibilitychange', this._visibilityChangeListener);
// use 'pagehide' event as a fallback for Safari; see https://bugs.webkit.org/show_bug.cgi?id=116769
document.addEventListener('pagehide', this._pageHideListener);
}
}
onShutdown() {
if (typeof document !== 'undefined') {
if (this._visibilityChangeListener) {
document.removeEventListener('visibilitychange', this._visibilityChangeListener);
}
if (this._pageHideListener) {
document.removeEventListener('pagehide', this._pageHideListener);
}
}
}
}
//# sourceMappingURL=BatchSpanProcessor.js.map

View File

@@ -0,0 +1,209 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { dequal } from 'dequal/lite';
import { formatAdminURL, getAutosaveInterval, hasDraftValidationEnabled, reduceFieldsToValues } from 'payload/shared';
import * as qs from 'qs-esm';
import React, { useDeferredValue, useEffect, useRef, useState } from 'react';
import { useAllFormFields, useForm, useFormModified, useFormSubmitted } from '../../forms/Form/context.js';
import { useDebounce } from '../../hooks/useDebounce.js';
import { useEffectEvent } from '../../hooks/useEffectEvent.js';
import { useQueue } from '../../hooks/useQueue.js';
import { useConfig } from '../../providers/Config/index.js';
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
import { useLocale } from '../../providers/Locale/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { formatTimeToNow } from '../../utilities/formatDocTitle/formatDateTitle.js';
import { reduceFieldsToValuesWithValidation } from '../../utilities/reduceFieldsToValuesWithValidation.js';
import { LeaveWithoutSaving } from '../LeaveWithoutSaving/index.js';
import './index.scss';
const baseClass = 'autosave';
// The minimum time the saving state should be shown
const minimumAnimationTime = 1000;
export const Autosave = ({
id,
collection,
global: globalDoc
}) => {
const {
config: {
routes: {
api
}
}
} = useConfig();
const {
docConfig,
lastUpdateTime,
mostRecentVersionIsAutosaved,
setMostRecentVersionIsAutosaved,
setUnpublishedVersionCount
} = useDocumentInfo();
const {
isValid,
setBackgroundProcessing,
submit
} = useForm();
const [formState] = useAllFormFields();
const modified = useFormModified();
const submitted = useFormSubmitted();
const {
code: locale
} = useLocale();
const {
i18n,
t
} = useTranslation();
const interval = getAutosaveInterval(docConfig);
const validateOnDraft = hasDraftValidationEnabled(docConfig);
const [_saving, setSaving] = useState(false);
const saving = useDeferredValue(_saving);
const debouncedFormState = useDebounce(formState, interval);
const {
queueTask
} = useQueue();
const autosaveTimeoutRef = useRef(null);
const handleAutosave = useEffectEvent(() => {
autosaveTimeoutRef.current = undefined;
// We need to log the time in order to figure out if we need to trigger the state off later
let startTimestamp = undefined;
let endTimestamp = undefined;
const hideIndicator = () => {
// If request was faster than minimum animation time, animate the difference
if (endTimestamp - startTimestamp < minimumAnimationTime) {
autosaveTimeoutRef.current = setTimeout(() => {
setSaving(false);
}, minimumAnimationTime - (endTimestamp - startTimestamp));
} else {
stopAutoSaveIndicator();
}
};
queueTask(async () => {
if (modified) {
startTimestamp = new Date().getTime();
setSaving(true);
let url;
let method;
let entitySlug;
const params = qs.stringify({
autosave: true,
depth: 0,
draft: true,
'fallback-locale': 'null',
locale
}, {
addQueryPrefix: true
});
if (collection && id) {
entitySlug = collection.slug;
url = formatAdminURL({
apiRoute: api,
path: `/${entitySlug}/${id}${params}`
});
method = 'PATCH';
}
if (globalDoc) {
entitySlug = globalDoc.slug;
url = formatAdminURL({
apiRoute: api,
path: `/globals/${entitySlug}${params}`
});
method = 'POST';
}
const {
valid
} = reduceFieldsToValuesWithValidation(formState, true);
const skipSubmission = submitted && !valid && validateOnDraft;
if (!skipSubmission && modified && url) {
const result = await submit({
acceptValues: {
overrideLocalChanges: false
},
action: url,
context: {
getDocPermissions: false,
incrementVersionCount: !mostRecentVersionIsAutosaved
},
disableFormWhileProcessing: false,
disableSuccessStatus: true,
method,
overrides: {
_status: 'draft'
},
skipValidation: !validateOnDraft
});
if (result && result?.res?.ok && !mostRecentVersionIsAutosaved) {
setMostRecentVersionIsAutosaved(true);
setUnpublishedVersionCount(prev => prev + 1);
}
const newDate = new Date();
// We need to log the time in order to figure out if we need to trigger the state off later
endTimestamp = newDate.getTime();
hideIndicator();
}
}
}, {
afterProcess: () => {
setBackgroundProcessing(false);
},
beforeProcess: () => {
setBackgroundProcessing(true);
}
});
});
const didMount = useRef(false);
const previousDebouncedData = useRef(reduceFieldsToValues(debouncedFormState));
// When debounced fields change, autosave
useEffect(() => {
/**
* Ensure autosave doesn't run on mount
*/
if (!didMount.current) {
didMount.current = true;
return;
}
/**
* Ensure autosave only runs if the form data changes, not every time the entire form state changes
* Remove `updatedAt` from comparison as it changes on every autosave interval.
*/
const {
updatedAt: _,
...formData
} = reduceFieldsToValues(debouncedFormState);
const {
updatedAt: __,
...prevFormData
} = previousDebouncedData.current;
if (dequal(formData, prevFormData)) {
return;
}
previousDebouncedData.current = formData;
handleAutosave();
}, [debouncedFormState]);
/**
* If component unmounts, clear the autosave timeout
*/
useEffect(() => {
return () => {
stopAutoSaveIndicator();
};
}, []);
const stopAutoSaveIndicator = useEffectEvent(() => {
if (autosaveTimeoutRef.current) {
clearTimeout(autosaveTimeoutRef.current);
}
setSaving(false);
});
return /*#__PURE__*/_jsxs("div", {
className: baseClass,
children: [validateOnDraft && !isValid && /*#__PURE__*/_jsx(LeaveWithoutSaving, {}), saving && t('general:saving'), !saving && Boolean(lastUpdateTime) && /*#__PURE__*/_jsx(React.Fragment, {
children: t('version:lastSavedAgo', {
distance: formatTimeToNow({
date: lastUpdateTime,
i18n
})
})
})]
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,38 @@
{
"name": "@types/pg",
"version": "8.15.6",
"description": "TypeScript definitions for pg",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pg",
"license": "MIT",
"contributors": [
{
"name": "Phips Peter",
"githubUsername": "pspeter3",
"url": "https://github.com/pspeter3"
}
],
"main": "",
"types": "index.d.ts",
"exports": {
".": {
"import": "./index.d.mts",
"require": "./index.d.ts"
},
"./lib/*": "./lib/*.d.ts",
"./package.json": "./package.json"
},
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/pg"
},
"scripts": {},
"dependencies": {
"@types/node": "*",
"pg-protocol": "*",
"pg-types": "^2.2.0"
},
"peerDependencies": {},
"typesPublisherContentHash": "bfe58cd33772b929b21b29a9496746a24084358ddea01e505b949995ff72d44e",
"typeScriptVersion": "5.2"
}

View File

@@ -0,0 +1,4 @@
function _await_value(value) {
this.wrapped = value;
}
export { _await_value as _ };

View File

@@ -0,0 +1 @@
{"version":3,"file":"panel-right-close.js","sources":["../../../src/icons/panel-right-close.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PanelRightClose\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0xNSAzdjE4IiAvPgogIDxwYXRoIGQ9Im04IDkgMyAzLTMgMyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/panel-right-close\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst PanelRightClose = createLucideIcon('PanelRightClose', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M15 3v18', key: '14nvp0' }],\n ['path', { d: 'm8 9 3 3-3 3', key: '12hl5m' }],\n]);\n\nexport default PanelRightClose;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,iBAAiB,iBAAmB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,257 @@
import type { Cache } from "../cache/core/cache.js";
import { entityKind } from "../entity.js";
import type { ExtractTablesWithRelations, RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js";
import { type SQL, type SQLWrapper } from "../sql/sql.js";
import type { SQLiteAsyncDialect, SQLiteSyncDialect } from "./dialect.js";
import { SQLiteDeleteBase, SQLiteInsertBuilder, SQLiteSelectBuilder, SQLiteUpdateBuilder } from "./query-builders/index.js";
import type { DBResult, Result, SQLiteSession, SQLiteTransaction, SQLiteTransactionConfig } from "./session.js";
import type { SQLiteTable } from "./table.js";
import { WithSubquery } from "../subquery.js";
import type { DrizzleTypeError } from "../utils.js";
import { SQLiteCountBuilder } from "./query-builders/count.js";
import { RelationalQueryBuilder } from "./query-builders/query.js";
import type { SelectedFields } from "./query-builders/select.types.js";
import type { WithBuilder } from "./subquery.js";
import type { SQLiteViewBase } from "./view-base.js";
export declare class BaseSQLiteDatabase<TResultKind extends 'sync' | 'async', TRunResult, TFullSchema extends Record<string, unknown> = Record<string, never>, TSchema extends TablesRelationalConfig = ExtractTablesWithRelations<TFullSchema>> {
private resultKind;
static readonly [entityKind]: string;
readonly _: {
readonly schema: TSchema | undefined;
readonly fullSchema: TFullSchema;
readonly tableNamesMap: Record<string, string>;
};
query: TFullSchema extends Record<string, never> ? DrizzleTypeError<'Seems like the schema generic is missing - did you forget to add it to your DB type?'> : {
[K in keyof TSchema]: RelationalQueryBuilder<TResultKind, TFullSchema, TSchema, TSchema[K]>;
};
constructor(resultKind: TResultKind,
/** @internal */
dialect: {
sync: SQLiteSyncDialect;
async: SQLiteAsyncDialect;
}[TResultKind],
/** @internal */
session: SQLiteSession<TResultKind, TRunResult, TFullSchema, TSchema>, schema: RelationalSchemaConfig<TSchema> | undefined);
/**
* Creates a subquery that defines a temporary named result set as a CTE.
*
* It is useful for breaking down complex queries into simpler parts and for reusing the result set in subsequent parts of the query.
*
* See docs: {@link https://orm.drizzle.team/docs/select#with-clause}
*
* @param alias The alias for the subquery.
*
* Failure to provide an alias will result in a DrizzleTypeError, preventing the subquery from being referenced in other queries.
*
* @example
*
* ```ts
* // Create a subquery with alias 'sq' and use it in the select query
* const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));
*
* const result = await db.with(sq).select().from(sq);
* ```
*
* To select arbitrary SQL values as fields in a CTE and reference them in other CTEs or in the main query, you need to add aliases to them:
*
* ```ts
* // Select an arbitrary SQL value as a field in a CTE and reference it in the main query
* const sq = db.$with('sq').as(db.select({
* name: sql<string>`upper(${users.name})`.as('name'),
* })
* .from(users));
*
* const result = await db.with(sq).select({ name: sq.name }).from(sq);
* ```
*/
$with: WithBuilder;
$count(source: SQLiteTable | SQLiteViewBase | SQL | SQLWrapper, filters?: SQL<unknown>): SQLiteCountBuilder<SQLiteSession<TResultKind, TRunResult, TFullSchema, TSchema>>;
/**
* Incorporates a previously defined CTE (using `$with`) into the main query.
*
* This method allows the main query to reference a temporary named result set.
*
* See docs: {@link https://orm.drizzle.team/docs/select#with-clause}
*
* @param queries The CTEs to incorporate into the main query.
*
* @example
*
* ```ts
* // Define a subquery 'sq' as a CTE using $with
* const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));
*
* // Incorporate the CTE 'sq' into the main query and select from it
* const result = await db.with(sq).select().from(sq);
* ```
*/
with(...queries: WithSubquery[]): {
select: {
(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
<TSelection extends SelectedFields>(fields: TSelection): SQLiteSelectBuilder<TSelection, TResultKind, TRunResult>;
};
selectDistinct: {
(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
<TSelection extends SelectedFields>(fields: TSelection): SQLiteSelectBuilder<TSelection, TResultKind, TRunResult>;
};
update: <TTable extends SQLiteTable>(table: TTable) => SQLiteUpdateBuilder<TTable, TResultKind, TRunResult>;
insert: <TTable extends SQLiteTable>(into: TTable) => SQLiteInsertBuilder<TTable, TResultKind, TRunResult>;
delete: <TTable extends SQLiteTable>(from: TTable) => SQLiteDeleteBase<TTable, TResultKind, TRunResult>;
};
/**
* Creates a select query.
*
* Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.
*
* Use `.from()` method to specify which table to select from.
*
* See docs: {@link https://orm.drizzle.team/docs/select}
*
* @param fields The selection object.
*
* @example
*
* ```ts
* // Select all columns and all rows from the 'cars' table
* const allCars: Car[] = await db.select().from(cars);
*
* // Select specific columns and all rows from the 'cars' table
* const carsIdsAndBrands: { id: number; brand: string }[] = await db.select({
* id: cars.id,
* brand: cars.brand
* })
* .from(cars);
* ```
*
* Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:
*
* ```ts
* // Select specific columns along with expression and all rows from the 'cars' table
* const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = await db.select({
* id: cars.id,
* lowerBrand: sql<string>`lower(${cars.brand})`,
* })
* .from(cars);
* ```
*/
select(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
select<TSelection extends SelectedFields>(fields: TSelection): SQLiteSelectBuilder<TSelection, TResultKind, TRunResult>;
/**
* Adds `distinct` expression to the select query.
*
* Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.
*
* Use `.from()` method to specify which table to select from.
*
* See docs: {@link https://orm.drizzle.team/docs/select#distinct}
*
* @param fields The selection object.
*
* @example
*
* ```ts
* // Select all unique rows from the 'cars' table
* await db.selectDistinct()
* .from(cars)
* .orderBy(cars.id, cars.brand, cars.color);
*
* // Select all unique brands from the 'cars' table
* await db.selectDistinct({ brand: cars.brand })
* .from(cars)
* .orderBy(cars.brand);
* ```
*/
selectDistinct(): SQLiteSelectBuilder<undefined, TResultKind, TRunResult>;
selectDistinct<TSelection extends SelectedFields>(fields: TSelection): SQLiteSelectBuilder<TSelection, TResultKind, TRunResult>;
/**
* Creates an update query.
*
* Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.
*
* Use `.set()` method to specify which values to update.
*
* See docs: {@link https://orm.drizzle.team/docs/update}
*
* @param table The table to update.
*
* @example
*
* ```ts
* // Update all rows in the 'cars' table
* await db.update(cars).set({ color: 'red' });
*
* // Update rows with filters and conditions
* await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));
*
* // Update with returning clause
* const updatedCar: Car[] = await db.update(cars)
* .set({ color: 'red' })
* .where(eq(cars.id, 1))
* .returning();
* ```
*/
update<TTable extends SQLiteTable>(table: TTable): SQLiteUpdateBuilder<TTable, TResultKind, TRunResult>;
$cache: {
invalidate: Cache['onMutate'];
};
/**
* Creates an insert query.
*
* Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.
*
* See docs: {@link https://orm.drizzle.team/docs/insert}
*
* @param table The table to insert into.
*
* @example
*
* ```ts
* // Insert one row
* await db.insert(cars).values({ brand: 'BMW' });
*
* // Insert multiple rows
* await db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);
*
* // Insert with returning clause
* const insertedCar: Car[] = await db.insert(cars)
* .values({ brand: 'BMW' })
* .returning();
* ```
*/
insert<TTable extends SQLiteTable>(into: TTable): SQLiteInsertBuilder<TTable, TResultKind, TRunResult>;
/**
* Creates a delete query.
*
* Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.
*
* See docs: {@link https://orm.drizzle.team/docs/delete}
*
* @param table The table to delete from.
*
* @example
*
* ```ts
* // Delete all rows in the 'cars' table
* await db.delete(cars);
*
* // Delete rows with filters and conditions
* await db.delete(cars).where(eq(cars.color, 'green'));
*
* // Delete with returning clause
* const deletedCar: Car[] = await db.delete(cars)
* .where(eq(cars.id, 1))
* .returning();
* ```
*/
delete<TTable extends SQLiteTable>(from: TTable): SQLiteDeleteBase<TTable, TResultKind, TRunResult>;
run(query: SQLWrapper | string): DBResult<TResultKind, TRunResult>;
all<T = unknown>(query: SQLWrapper | string): DBResult<TResultKind, T[]>;
get<T = unknown>(query: SQLWrapper | string): DBResult<TResultKind, T>;
values<T extends unknown[] = unknown[]>(query: SQLWrapper | string): DBResult<TResultKind, T[]>;
transaction<T>(transaction: (tx: SQLiteTransaction<TResultKind, TRunResult, TFullSchema, TSchema>) => Result<TResultKind, T>, config?: SQLiteTransactionConfig): Result<TResultKind, T>;
}
export type SQLiteWithReplicas<Q> = Q & {
$primary: Q;
$replicas: Q[];
};
export declare const withReplicas: <TResultKind extends "sync" | "async", TRunResult, TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig, Q extends BaseSQLiteDatabase<TResultKind, TRunResult, TFullSchema, TSchema extends Record<string, unknown> ? ExtractTablesWithRelations<TFullSchema> : TSchema>>(primary: Q, replicas: [Q, ...Q[]], getReplica?: (replicas: Q[]) => Q) => SQLiteWithReplicas<Q>;

View File

@@ -0,0 +1 @@
Prism.languages.cilkcpp=Prism.languages.insertBefore("cpp","function",{"parallel-keyword":{pattern:/\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/,alias:"keyword"}}),Prism.languages["cilk-cpp"]=Prism.languages.cilkcpp,Prism.languages.cilk=Prism.languages.cilkcpp;

View File

@@ -0,0 +1 @@
{"version":3,"names":["_nonIterableRest","TypeError"],"sources":["../../src/helpers/nonIterableRest.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _nonIterableRest() {\n throw new TypeError(\n \"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\",\n );\n}\n"],"mappings":";;;;;;AAEe,SAASA,gBAAgBA,CAAA,EAAG;EACzC,MAAM,IAAIC,SAAS,CACjB,2IACF,CAAC;AACH","ignoreList":[]}

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const AlignVerticalJustifyStart = createLucideIcon("AlignVerticalJustifyStart", [
["rect", { width: "14", height: "6", x: "5", y: "16", rx: "2", key: "1i8z2d" }],
["rect", { width: "10", height: "6", x: "7", y: "6", rx: "2", key: "13squh" }],
["path", { d: "M2 2h20", key: "1ennik" }]
]);
export { AlignVerticalJustifyStart as default };
//# sourceMappingURL=align-vertical-justify-start.js.map

View File

@@ -0,0 +1,55 @@
{
"name": "xtend",
"version": "4.0.2",
"description": "extend like a boss",
"keywords": [
"extend",
"merge",
"options",
"opts",
"object",
"array"
],
"author": "Raynos <raynos2@gmail.com>",
"repository": "git://github.com/Raynos/xtend.git",
"main": "immutable",
"scripts": {
"test": "node test"
},
"dependencies": {},
"devDependencies": {
"tape": "~1.1.0"
},
"homepage": "https://github.com/Raynos/xtend",
"contributors": [
{
"name": "Jake Verbaten"
},
{
"name": "Matt Esch"
}
],
"bugs": {
"url": "https://github.com/Raynos/xtend/issues",
"email": "raynos2@gmail.com"
},
"license": "MIT",
"testling": {
"files": "test.js",
"browsers": [
"ie/7..latest",
"firefox/16..latest",
"firefox/nightly",
"chrome/22..latest",
"chrome/canary",
"opera/12..latest",
"opera/next",
"safari/5.1..latest",
"ipad/6.0..latest",
"iphone/6.0..latest"
]
},
"engines": {
"node": ">=0.4"
}
}

View File

@@ -0,0 +1,3 @@
import type { GenerateViewMetadata } from '../Root/index.js';
export declare const generateLoginViewMetadata: GenerateViewMetadata;
//# sourceMappingURL=metadata.d.ts.map

View File

@@ -0,0 +1,160 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["Î", "D"],
abbreviated: ["Î.d.C.", "D.C."],
wide: ["Înainte de Cristos", "După Cristos"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["T1", "T2", "T3", "T4"],
wide: [
"primul trimestru",
"al doilea trimestru",
"al treilea trimestru",
"al patrulea trimestru",
],
};
const monthValues = {
narrow: ["I", "F", "M", "A", "M", "I", "I", "A", "S", "O", "N", "D"],
abbreviated: [
"ian",
"feb",
"mar",
"apr",
"mai",
"iun",
"iul",
"aug",
"sep",
"oct",
"noi",
"dec",
],
wide: [
"ianuarie",
"februarie",
"martie",
"aprilie",
"mai",
"iunie",
"iulie",
"august",
"septembrie",
"octombrie",
"noiembrie",
"decembrie",
],
};
const dayValues = {
narrow: ["d", "l", "m", "m", "j", "v", "s"],
short: ["du", "lu", "ma", "mi", "jo", "vi", "sâ"],
abbreviated: ["dum", "lun", "mar", "mie", "joi", "vin", "sâm"],
wide: ["duminică", "luni", "marți", "miercuri", "joi", "vineri", "sâmbătă"],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mn",
noon: "ami",
morning: "dim",
afternoon: "da",
evening: "s",
night: "n",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "miezul nopții",
noon: "amiază",
morning: "dimineață",
afternoon: "după-amiază",
evening: "seară",
night: "noapte",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "miezul nopții",
noon: "amiază",
morning: "dimineață",
afternoon: "după-amiază",
evening: "seară",
night: "noapte",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mn",
noon: "amiază",
morning: "dimineață",
afternoon: "după-amiază",
evening: "seară",
night: "noapte",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "miezul nopții",
noon: "amiază",
morning: "dimineață",
afternoon: "după-amiază",
evening: "seară",
night: "noapte",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "miezul nopții",
noon: "amiază",
morning: "dimineață",
afternoon: "după-amiază",
evening: "seară",
night: "noapte",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
return String(dirtyNumber);
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,732 @@
import * as core from "../core/index.js";
import { util } from "../core/index.js";
import * as parse from "./parse.js";
export const ZodMiniType = /*@__PURE__*/ core.$constructor("ZodMiniType", (inst, def) => {
if (!inst._zod)
throw new Error("Uninitialized schema in ZodMiniType.");
core.$ZodType.init(inst, def);
inst.def = def;
inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
inst.check = (...checks) => {
return inst.clone({
...def,
checks: [
...(def.checks ?? []),
...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
],
}
// { parent: true }
);
};
inst.clone = (_def, params) => core.clone(inst, _def, params);
inst.brand = () => inst;
inst.register = ((reg, meta) => {
reg.add(inst, meta);
return inst;
});
});
export const ZodMiniString = /*@__PURE__*/ core.$constructor("ZodMiniString", (inst, def) => {
core.$ZodString.init(inst, def);
ZodMiniType.init(inst, def);
});
export function string(params) {
return core._string(ZodMiniString, params);
}
export const ZodMiniStringFormat = /*@__PURE__*/ core.$constructor("ZodMiniStringFormat", (inst, def) => {
core.$ZodStringFormat.init(inst, def);
ZodMiniString.init(inst, def);
});
export const ZodMiniEmail = /*@__PURE__*/ core.$constructor("ZodMiniEmail", (inst, def) => {
core.$ZodEmail.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function email(params) {
return core._email(ZodMiniEmail, params);
}
export const ZodMiniGUID = /*@__PURE__*/ core.$constructor("ZodMiniGUID", (inst, def) => {
core.$ZodGUID.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function guid(params) {
return core._guid(ZodMiniGUID, params);
}
export const ZodMiniUUID = /*@__PURE__*/ core.$constructor("ZodMiniUUID", (inst, def) => {
core.$ZodUUID.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function uuid(params) {
return core._uuid(ZodMiniUUID, params);
}
export function uuidv4(params) {
return core._uuidv4(ZodMiniUUID, params);
}
// ZodMiniUUIDv6
export function uuidv6(params) {
return core._uuidv6(ZodMiniUUID, params);
}
// ZodMiniUUIDv7
export function uuidv7(params) {
return core._uuidv7(ZodMiniUUID, params);
}
export const ZodMiniURL = /*@__PURE__*/ core.$constructor("ZodMiniURL", (inst, def) => {
core.$ZodURL.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function url(params) {
return core._url(ZodMiniURL, params);
}
export const ZodMiniEmoji = /*@__PURE__*/ core.$constructor("ZodMiniEmoji", (inst, def) => {
core.$ZodEmoji.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function emoji(params) {
return core._emoji(ZodMiniEmoji, params);
}
export const ZodMiniNanoID = /*@__PURE__*/ core.$constructor("ZodMiniNanoID", (inst, def) => {
core.$ZodNanoID.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function nanoid(params) {
return core._nanoid(ZodMiniNanoID, params);
}
export const ZodMiniCUID = /*@__PURE__*/ core.$constructor("ZodMiniCUID", (inst, def) => {
core.$ZodCUID.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function cuid(params) {
return core._cuid(ZodMiniCUID, params);
}
export const ZodMiniCUID2 = /*@__PURE__*/ core.$constructor("ZodMiniCUID2", (inst, def) => {
core.$ZodCUID2.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function cuid2(params) {
return core._cuid2(ZodMiniCUID2, params);
}
export const ZodMiniULID = /*@__PURE__*/ core.$constructor("ZodMiniULID", (inst, def) => {
core.$ZodULID.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function ulid(params) {
return core._ulid(ZodMiniULID, params);
}
export const ZodMiniXID = /*@__PURE__*/ core.$constructor("ZodMiniXID", (inst, def) => {
core.$ZodXID.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function xid(params) {
return core._xid(ZodMiniXID, params);
}
export const ZodMiniKSUID = /*@__PURE__*/ core.$constructor("ZodMiniKSUID", (inst, def) => {
core.$ZodKSUID.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function ksuid(params) {
return core._ksuid(ZodMiniKSUID, params);
}
export const ZodMiniIPv4 = /*@__PURE__*/ core.$constructor("ZodMiniIPv4", (inst, def) => {
core.$ZodIPv4.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function ipv4(params) {
return core._ipv4(ZodMiniIPv4, params);
}
export const ZodMiniIPv6 = /*@__PURE__*/ core.$constructor("ZodMiniIPv6", (inst, def) => {
core.$ZodIPv6.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function ipv6(params) {
return core._ipv6(ZodMiniIPv6, params);
}
export const ZodMiniCIDRv4 = /*@__PURE__*/ core.$constructor("ZodMiniCIDRv4", (inst, def) => {
core.$ZodCIDRv4.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function cidrv4(params) {
return core._cidrv4(ZodMiniCIDRv4, params);
}
export const ZodMiniCIDRv6 = /*@__PURE__*/ core.$constructor("ZodMiniCIDRv6", (inst, def) => {
core.$ZodCIDRv6.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function cidrv6(params) {
return core._cidrv6(ZodMiniCIDRv6, params);
}
export const ZodMiniBase64 = /*@__PURE__*/ core.$constructor("ZodMiniBase64", (inst, def) => {
core.$ZodBase64.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function base64(params) {
return core._base64(ZodMiniBase64, params);
}
export const ZodMiniBase64URL = /*@__PURE__*/ core.$constructor("ZodMiniBase64URL", (inst, def) => {
core.$ZodBase64URL.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function base64url(params) {
return core._base64url(ZodMiniBase64URL, params);
}
export const ZodMiniE164 = /*@__PURE__*/ core.$constructor("ZodMiniE164", (inst, def) => {
core.$ZodE164.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function e164(params) {
return core._e164(ZodMiniE164, params);
}
export const ZodMiniJWT = /*@__PURE__*/ core.$constructor("ZodMiniJWT", (inst, def) => {
core.$ZodJWT.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function jwt(params) {
return core._jwt(ZodMiniJWT, params);
}
export const ZodMiniCustomStringFormat = /*@__PURE__*/ core.$constructor("ZodMiniCustomStringFormat", (inst, def) => {
core.$ZodCustomStringFormat.init(inst, def);
ZodMiniStringFormat.init(inst, def);
});
export function stringFormat(format, fnOrRegex, _params = {}) {
return core._stringFormat(ZodMiniCustomStringFormat, format, fnOrRegex, _params);
}
export const ZodMiniNumber = /*@__PURE__*/ core.$constructor("ZodMiniNumber", (inst, def) => {
core.$ZodNumber.init(inst, def);
ZodMiniType.init(inst, def);
});
export function number(params) {
return core._number(ZodMiniNumber, params);
}
export const ZodMiniNumberFormat = /*@__PURE__*/ core.$constructor("ZodMiniNumberFormat", (inst, def) => {
core.$ZodNumberFormat.init(inst, def);
ZodMiniNumber.init(inst, def);
});
// int
export function int(params) {
return core._int(ZodMiniNumberFormat, params);
}
// float32
export function float32(params) {
return core._float32(ZodMiniNumberFormat, params);
}
// float64
export function float64(params) {
return core._float64(ZodMiniNumberFormat, params);
}
// int32
export function int32(params) {
return core._int32(ZodMiniNumberFormat, params);
}
// uint32
export function uint32(params) {
return core._uint32(ZodMiniNumberFormat, params);
}
export const ZodMiniBoolean = /*@__PURE__*/ core.$constructor("ZodMiniBoolean", (inst, def) => {
core.$ZodBoolean.init(inst, def);
ZodMiniType.init(inst, def);
});
export function boolean(params) {
return core._boolean(ZodMiniBoolean, params);
}
export const ZodMiniBigInt = /*@__PURE__*/ core.$constructor("ZodMiniBigInt", (inst, def) => {
core.$ZodBigInt.init(inst, def);
ZodMiniType.init(inst, def);
});
export function bigint(params) {
return core._bigint(ZodMiniBigInt, params);
}
export const ZodMiniBigIntFormat = /*@__PURE__*/ core.$constructor("ZodMiniBigIntFormat", (inst, def) => {
core.$ZodBigIntFormat.init(inst, def);
ZodMiniBigInt.init(inst, def);
});
// int64
export function int64(params) {
return core._int64(ZodMiniBigIntFormat, params);
}
// uint64
export function uint64(params) {
return core._uint64(ZodMiniBigIntFormat, params);
}
export const ZodMiniSymbol = /*@__PURE__*/ core.$constructor("ZodMiniSymbol", (inst, def) => {
core.$ZodSymbol.init(inst, def);
ZodMiniType.init(inst, def);
});
export function symbol(params) {
return core._symbol(ZodMiniSymbol, params);
}
export const ZodMiniUndefined = /*@__PURE__*/ core.$constructor("ZodMiniUndefined", (inst, def) => {
core.$ZodUndefined.init(inst, def);
ZodMiniType.init(inst, def);
});
function _undefined(params) {
return core._undefined(ZodMiniUndefined, params);
}
export { _undefined as undefined };
export const ZodMiniNull = /*@__PURE__*/ core.$constructor("ZodMiniNull", (inst, def) => {
core.$ZodNull.init(inst, def);
ZodMiniType.init(inst, def);
});
function _null(params) {
return core._null(ZodMiniNull, params);
}
export { _null as null };
export const ZodMiniAny = /*@__PURE__*/ core.$constructor("ZodMiniAny", (inst, def) => {
core.$ZodAny.init(inst, def);
ZodMiniType.init(inst, def);
});
export function any() {
return core._any(ZodMiniAny);
}
export const ZodMiniUnknown = /*@__PURE__*/ core.$constructor("ZodMiniUnknown", (inst, def) => {
core.$ZodUnknown.init(inst, def);
ZodMiniType.init(inst, def);
});
export function unknown() {
return core._unknown(ZodMiniUnknown);
}
export const ZodMiniNever = /*@__PURE__*/ core.$constructor("ZodMiniNever", (inst, def) => {
core.$ZodNever.init(inst, def);
ZodMiniType.init(inst, def);
});
export function never(params) {
return core._never(ZodMiniNever, params);
}
export const ZodMiniVoid = /*@__PURE__*/ core.$constructor("ZodMiniVoid", (inst, def) => {
core.$ZodVoid.init(inst, def);
ZodMiniType.init(inst, def);
});
function _void(params) {
return core._void(ZodMiniVoid, params);
}
export { _void as void };
export const ZodMiniDate = /*@__PURE__*/ core.$constructor("ZodMiniDate", (inst, def) => {
core.$ZodDate.init(inst, def);
ZodMiniType.init(inst, def);
});
export function date(params) {
return core._date(ZodMiniDate, params);
}
export const ZodMiniArray = /*@__PURE__*/ core.$constructor("ZodMiniArray", (inst, def) => {
core.$ZodArray.init(inst, def);
ZodMiniType.init(inst, def);
});
export function array(element, params) {
return new ZodMiniArray({
type: "array",
element: element,
...util.normalizeParams(params),
});
}
// .keyof
export function keyof(schema) {
const shape = schema._zod.def.shape;
return literal(Object.keys(shape));
}
export const ZodMiniObject = /*@__PURE__*/ core.$constructor("ZodMiniObject", (inst, def) => {
core.$ZodObject.init(inst, def);
ZodMiniType.init(inst, def);
util.defineLazy(inst, "shape", () => def.shape);
});
export function object(shape, params) {
const def = {
type: "object",
get shape() {
util.assignProp(this, "shape", { ...shape });
return this.shape;
},
...util.normalizeParams(params),
};
return new ZodMiniObject(def);
}
// strictObject
export function strictObject(shape, params) {
return new ZodMiniObject({
type: "object",
// shape: shape as core.$ZodLooseShape,
get shape() {
util.assignProp(this, "shape", { ...shape });
return this.shape;
},
catchall: never(),
...util.normalizeParams(params),
});
}
// looseObject
export function looseObject(shape, params) {
return new ZodMiniObject({
type: "object",
// shape: shape as core.$ZodLooseShape,
get shape() {
util.assignProp(this, "shape", { ...shape });
return this.shape;
},
// get optional() {
// return util.optionalKeys(shape);
// },
catchall: unknown(),
...util.normalizeParams(params),
});
}
// object methods
export function extend(schema, shape) {
return util.extend(schema, shape);
}
export function merge(schema, shape) {
return util.extend(schema, shape);
}
export function pick(schema, mask) {
return util.pick(schema, mask);
}
// .omit
export function omit(schema, mask) {
return util.omit(schema, mask);
}
export function partial(schema, mask) {
return util.partial(ZodMiniOptional, schema, mask);
}
export function required(schema, mask) {
return util.required(ZodMiniNonOptional, schema, mask);
}
export function catchall(inst, catchall) {
return inst.clone({ ...inst._zod.def, catchall: catchall });
}
export const ZodMiniUnion = /*@__PURE__*/ core.$constructor("ZodMiniUnion", (inst, def) => {
core.$ZodUnion.init(inst, def);
ZodMiniType.init(inst, def);
});
export function union(options, params) {
return new ZodMiniUnion({
type: "union",
options: options,
...util.normalizeParams(params),
});
}
export const ZodMiniDiscriminatedUnion = /*@__PURE__*/ core.$constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
core.$ZodDiscriminatedUnion.init(inst, def);
ZodMiniType.init(inst, def);
});
export function discriminatedUnion(discriminator, options, params) {
return new ZodMiniDiscriminatedUnion({
type: "union",
options,
discriminator,
...util.normalizeParams(params),
});
}
export const ZodMiniIntersection = /*@__PURE__*/ core.$constructor("ZodMiniIntersection", (inst, def) => {
core.$ZodIntersection.init(inst, def);
ZodMiniType.init(inst, def);
});
export function intersection(left, right) {
return new ZodMiniIntersection({
type: "intersection",
left: left,
right: right,
});
}
export const ZodMiniTuple = /*@__PURE__*/ core.$constructor("ZodMiniTuple", (inst, def) => {
core.$ZodTuple.init(inst, def);
ZodMiniType.init(inst, def);
});
export function tuple(items, _paramsOrRest, _params) {
const hasRest = _paramsOrRest instanceof core.$ZodType;
const params = hasRest ? _params : _paramsOrRest;
const rest = hasRest ? _paramsOrRest : null;
return new ZodMiniTuple({
type: "tuple",
items: items,
rest,
...util.normalizeParams(params),
});
}
export const ZodMiniRecord = /*@__PURE__*/ core.$constructor("ZodMiniRecord", (inst, def) => {
core.$ZodRecord.init(inst, def);
ZodMiniType.init(inst, def);
});
export function record(keyType, valueType, params) {
return new ZodMiniRecord({
type: "record",
keyType,
valueType: valueType,
...util.normalizeParams(params),
});
}
export function partialRecord(keyType, valueType, params) {
return new ZodMiniRecord({
type: "record",
keyType: union([keyType, never()]),
valueType: valueType,
...util.normalizeParams(params),
});
}
export const ZodMiniMap = /*@__PURE__*/ core.$constructor("ZodMiniMap", (inst, def) => {
core.$ZodMap.init(inst, def);
ZodMiniType.init(inst, def);
});
export function map(keyType, valueType, params) {
return new ZodMiniMap({
type: "map",
keyType: keyType,
valueType: valueType,
...util.normalizeParams(params),
});
}
export const ZodMiniSet = /*@__PURE__*/ core.$constructor("ZodMiniSet", (inst, def) => {
core.$ZodSet.init(inst, def);
ZodMiniType.init(inst, def);
});
export function set(valueType, params) {
return new ZodMiniSet({
type: "set",
valueType: valueType,
...util.normalizeParams(params),
});
}
export const ZodMiniEnum = /*@__PURE__*/ core.$constructor("ZodMiniEnum", (inst, def) => {
core.$ZodEnum.init(inst, def);
ZodMiniType.init(inst, def);
});
function _enum(values, params) {
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
return new ZodMiniEnum({
type: "enum",
entries,
...util.normalizeParams(params),
});
}
export { _enum as enum };
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
*
* ```ts
* enum Colors { red, green, blue }
* z.enum(Colors);
* ```
*/
export function nativeEnum(entries, params) {
return new ZodMiniEnum({
type: "enum",
entries,
...util.normalizeParams(params),
});
}
export const ZodMiniLiteral = /*@__PURE__*/ core.$constructor("ZodMiniLiteral", (inst, def) => {
core.$ZodLiteral.init(inst, def);
ZodMiniType.init(inst, def);
});
export function literal(value, params) {
return new ZodMiniLiteral({
type: "literal",
values: Array.isArray(value) ? value : [value],
...util.normalizeParams(params),
});
}
export const ZodMiniFile = /*@__PURE__*/ core.$constructor("ZodMiniFile", (inst, def) => {
core.$ZodFile.init(inst, def);
ZodMiniType.init(inst, def);
});
export function file(params) {
return core._file(ZodMiniFile, params);
}
export const ZodMiniTransform = /*@__PURE__*/ core.$constructor("ZodMiniTransform", (inst, def) => {
core.$ZodTransform.init(inst, def);
ZodMiniType.init(inst, def);
});
export function transform(fn) {
return new ZodMiniTransform({
type: "transform",
transform: fn,
});
}
export const ZodMiniOptional = /*@__PURE__*/ core.$constructor("ZodMiniOptional", (inst, def) => {
core.$ZodOptional.init(inst, def);
ZodMiniType.init(inst, def);
});
export function optional(innerType) {
return new ZodMiniOptional({
type: "optional",
innerType: innerType,
});
}
export const ZodMiniNullable = /*@__PURE__*/ core.$constructor("ZodMiniNullable", (inst, def) => {
core.$ZodNullable.init(inst, def);
ZodMiniType.init(inst, def);
});
export function nullable(innerType) {
return new ZodMiniNullable({
type: "nullable",
innerType: innerType,
});
}
// nullish
export function nullish(innerType) {
return optional(nullable(innerType));
}
export const ZodMiniDefault = /*@__PURE__*/ core.$constructor("ZodMiniDefault", (inst, def) => {
core.$ZodDefault.init(inst, def);
ZodMiniType.init(inst, def);
});
export function _default(innerType, defaultValue) {
return new ZodMiniDefault({
type: "default",
innerType: innerType,
get defaultValue() {
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
},
});
}
export const ZodMiniPrefault = /*@__PURE__*/ core.$constructor("ZodMiniPrefault", (inst, def) => {
core.$ZodPrefault.init(inst, def);
ZodMiniType.init(inst, def);
});
export function prefault(innerType, defaultValue) {
return new ZodMiniPrefault({
type: "prefault",
innerType: innerType,
get defaultValue() {
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
},
});
}
export const ZodMiniNonOptional = /*@__PURE__*/ core.$constructor("ZodMiniNonOptional", (inst, def) => {
core.$ZodNonOptional.init(inst, def);
ZodMiniType.init(inst, def);
});
export function nonoptional(innerType, params) {
return new ZodMiniNonOptional({
type: "nonoptional",
innerType: innerType,
...util.normalizeParams(params),
});
}
export const ZodMiniSuccess = /*@__PURE__*/ core.$constructor("ZodMiniSuccess", (inst, def) => {
core.$ZodSuccess.init(inst, def);
ZodMiniType.init(inst, def);
});
export function success(innerType) {
return new ZodMiniSuccess({
type: "success",
innerType: innerType,
});
}
export const ZodMiniCatch = /*@__PURE__*/ core.$constructor("ZodMiniCatch", (inst, def) => {
core.$ZodCatch.init(inst, def);
ZodMiniType.init(inst, def);
});
function _catch(innerType, catchValue) {
return new ZodMiniCatch({
type: "catch",
innerType: innerType,
catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue),
});
}
export { _catch as catch };
export const ZodMiniNaN = /*@__PURE__*/ core.$constructor("ZodMiniNaN", (inst, def) => {
core.$ZodNaN.init(inst, def);
ZodMiniType.init(inst, def);
});
export function nan(params) {
return core._nan(ZodMiniNaN, params);
}
export const ZodMiniPipe = /*@__PURE__*/ core.$constructor("ZodMiniPipe", (inst, def) => {
core.$ZodPipe.init(inst, def);
ZodMiniType.init(inst, def);
});
export function pipe(in_, out) {
return new ZodMiniPipe({
type: "pipe",
in: in_,
out: out,
});
}
export const ZodMiniReadonly = /*@__PURE__*/ core.$constructor("ZodMiniReadonly", (inst, def) => {
core.$ZodReadonly.init(inst, def);
ZodMiniType.init(inst, def);
});
export function readonly(innerType) {
return new ZodMiniReadonly({
type: "readonly",
innerType: innerType,
});
}
export const ZodMiniTemplateLiteral = /*@__PURE__*/ core.$constructor("ZodMiniTemplateLiteral", (inst, def) => {
core.$ZodTemplateLiteral.init(inst, def);
ZodMiniType.init(inst, def);
});
export function templateLiteral(parts, params) {
return new ZodMiniTemplateLiteral({
type: "template_literal",
parts,
...util.normalizeParams(params),
});
}
export const ZodMiniLazy = /*@__PURE__*/ core.$constructor("ZodMiniLazy", (inst, def) => {
core.$ZodLazy.init(inst, def);
ZodMiniType.init(inst, def);
});
// export function lazy<T extends object>(getter: () => T): T {
// return util.createTransparentProxy<T>(getter);
// }
function _lazy(getter) {
return new ZodMiniLazy({
type: "lazy",
getter: getter,
});
}
export { _lazy as lazy };
export const ZodMiniPromise = /*@__PURE__*/ core.$constructor("ZodMiniPromise", (inst, def) => {
core.$ZodPromise.init(inst, def);
ZodMiniType.init(inst, def);
});
export function promise(innerType) {
return new ZodMiniPromise({
type: "promise",
innerType: innerType,
});
}
export const ZodMiniCustom = /*@__PURE__*/ core.$constructor("ZodMiniCustom", (inst, def) => {
core.$ZodCustom.init(inst, def);
ZodMiniType.init(inst, def);
});
// custom checks
export function check(fn, params) {
const ch = new core.$ZodCheck({
check: "custom",
...util.normalizeParams(params),
});
ch._zod.check = fn;
return ch;
}
// ZodCustom
// custom schema
export function custom(fn, _params) {
return core._custom(ZodMiniCustom, fn ?? (() => true), _params);
}
// refine
export function refine(fn, _params = {}) {
return core._refine(ZodMiniCustom, fn, _params);
}
// instanceof
class Class {
constructor(..._args) { }
}
function _instanceof(cls, params = {
error: `Input not instance of ${cls.name}`,
}) {
const inst = custom((data) => data instanceof cls, params);
inst._zod.bag.Class = cls;
return inst;
}
export { _instanceof as instanceof };
// stringbool
export const stringbool = (...args) => core._stringbool({
Pipe: ZodMiniPipe,
Boolean: ZodMiniBoolean,
String: ZodMiniString,
Transform: ZodMiniTransform,
}, ...args);
export function json() {
const jsonSchema = _lazy(() => {
return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
});
return jsonSchema;
}

View File

@@ -0,0 +1,125 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "אותיות", verb: "לכלול" },
file: { unit: "בייטים", verb: "לכלול" },
array: { unit: "פריטים", verb: "לכלול" },
set: { unit: "פריטים", verb: "לכלול" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const parsedType = (data: any): string => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "number";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "קלט",
email: "כתובת אימייל",
url: "כתובת רשת",
emoji: "אימוג'י",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "תאריך וזמן ISO",
date: "תאריך ISO",
time: "זמן ISO",
duration: "משך זמן ISO",
ipv4: "כתובת IPv4",
ipv6: "כתובת IPv6",
cidrv4: "טווח IPv4",
cidrv6: "טווח IPv6",
base64: "מחרוזת בבסיס 64",
base64url: "מחרוזת בבסיס 64 לכתובות רשת",
json_string: "מחרוזת JSON",
e164: "מספר E.164",
jwt: "JWT",
template_literal: "קלט",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `קלט לא תקין: צריך ${issue.expected}, התקבל ${parsedType(issue.input)}`;
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1) return `קלט לא תקין: צריך ${util.stringifyPrimitive(issue.values[0])}`;
return `קלט לא תקין: צריך אחת מהאפשרויות ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `גדול מדי: ${issue.origin ?? "value"} צריך להיות ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
return `גדול מדי: ${issue.origin ?? "value"} צריך להיות ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `קטן מדי: ${issue.origin} צריך להיות ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `קטן מדי: ${issue.origin} צריך להיות ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `מחרוזת לא תקינה: חייבת להתחיל ב"${_issue.prefix}"`;
if (_issue.format === "ends_with") return `מחרוזת לא תקינה: חייבת להסתיים ב "${_issue.suffix}"`;
if (_issue.format === "includes") return `מחרוזת לא תקינה: חייבת לכלול "${_issue.includes}"`;
if (_issue.format === "regex") return `מחרוזת לא תקינה: חייבת להתאים לתבנית ${_issue.pattern}`;
return `${Nouns[_issue.format] ?? issue.format} לא תקין`;
}
case "not_multiple_of":
return `מספר לא תקין: חייב להיות מכפלה של ${issue.divisor}`;
case "unrecognized_keys":
return `מפתח${issue.keys.length > 1 ? "ות" : ""} לא מזוה${issue.keys.length > 1 ? "ים" : "ה"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `מפתח לא תקין ב${issue.origin}`;
case "invalid_union":
return "קלט לא תקין";
case "invalid_element":
return `ערך לא תקין ב${issue.origin}`;
default:
return `קלט לא תקין`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"nextSpanAttributes.js","sources":["../../../src/common/nextSpanAttributes.ts"],"sourcesContent":["export const ATTR_NEXT_SPAN_TYPE = 'next.span_type';\nexport const ATTR_NEXT_SPAN_NAME = 'next.span_name';\nexport const ATTR_NEXT_ROUTE = 'next.route';\nexport const ATTR_NEXT_SPAN_DESCRIPTION = 'next.span_description';\nexport const ATTR_NEXT_SEGMENT = 'next.segment';\n"],"names":[],"mappings":";;AAAO,MAAM,mBAAA,GAAsB;AAC5B,MAAM,mBAAA,GAAsB;AAC5B,MAAM,eAAA,GAAkB;AAExB,MAAM,iBAAA,GAAoB;;;;;;;"}

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) GraphQL Contributors
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 @@
{"version":3,"file":"baby.js","sources":["../../../src/icons/baby.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Baby\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOSAxMmguMDEiIC8+CiAgPHBhdGggZD0iTTE1IDEyaC4wMSIgLz4KICA8cGF0aCBkPSJNMTAgMTZjLjUuMyAxLjIuNSAyIC41czEuNS0uMiAyLS41IiAvPgogIDxwYXRoIGQ9Ik0xOSA2LjNhOSA5IDAgMCAxIDEuOCAzLjkgMiAyIDAgMCAxIDAgMy42IDkgOSAwIDAgMS0xNy42IDAgMiAyIDAgMCAxIDAtMy42QTkgOSAwIDAgMSAxMiAzYzIgMCAzLjUgMS4xIDMuNSAyLjVzLS45IDIuNS0yIDIuNWMtLjggMC0xLjUtLjQtMS41LTEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/baby\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Baby = createLucideIcon('Baby', [\n ['path', { d: 'M9 12h.01', key: '157uk2' }],\n ['path', { d: 'M15 12h.01', key: '1k8ypt' }],\n ['path', { d: 'M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5', key: '1u7htd' }],\n [\n 'path',\n {\n d: 'M19 6.3a9 9 0 0 1 1.8 3.9 2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1',\n key: '5yv0yz',\n },\n ],\n]);\n\nexport default Baby;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CAAA,CACpC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,U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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,9 @@
{
"rules": {
"array-bracket-newline": 0,
"array-element-newline": 0,
"max-statements-per-line": [2, { "max": 2 }],
"no-invalid-this": 0,
"no-magic-numbers": 0,
}
}

View File

@@ -0,0 +1,179 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import { fieldAffectsData, fieldIsID } from 'payload/shared';
import React from 'react'; // TODO: abstract this out to support all routers
import { useConfig } from '../../../providers/Config/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import { formatAdminURL } from '../../../utilities/formatAdminURL.js';
import { getDisplayedFieldValue } from '../../../utilities/getDisplayedFieldValue.js';
import { isValidReactElement } from '../../../utilities/isValidReactElement.js';
import { Link } from '../../Link/index.js';
import { CodeCell } from './fields/Code/index.js';
import { cellComponents } from './fields/index.js';
export const DefaultCell = props => {
const $ = _c(16);
const {
cellData,
className: classNameFromProps,
collectionSlug,
field,
field: t0,
link,
linkURL,
onClick: onClickFromProps,
rowData,
viewType
} = props;
const {
admin
} = t0;
const {
i18n
} = useTranslation();
const {
config: t1,
getEntityConfig
} = useConfig();
const {
routes: t2
} = t1;
const {
admin: adminRoute
} = t2;
let t3;
let t4;
if ($[0] !== admin || $[1] !== adminRoute || $[2] !== cellData || $[3] !== classNameFromProps || $[4] !== collectionSlug || $[5] !== field || $[6] !== getEntityConfig || $[7] !== i18n || $[8] !== link || $[9] !== linkURL || $[10] !== onClickFromProps || $[11] !== props || $[12] !== rowData || $[13] !== viewType) {
t4 = Symbol.for("react.early_return_sentinel");
bb0: {
const collectionConfig = getEntityConfig({
collectionSlug
});
const classNameFromConfigContext = admin && "className" in admin ? admin.className : undefined;
const className = classNameFromProps || (field.admin && "className" in field.admin ? field.admin.className : null) || classNameFromConfigContext;
const onClick = onClickFromProps;
let WrapElement = "span";
const wrapElementProps = {
className
};
if (link) {
wrapElementProps.prefetch = false;
WrapElement = Link;
if (linkURL) {
wrapElementProps.href = linkURL;
} else {
wrapElementProps.href = collectionConfig?.slug ? formatAdminURL({
adminRoute,
path: `/collections/${collectionConfig?.slug}${viewType === "trash" ? "/trash" : ""}/${encodeURIComponent(rowData.id)}`
}) : "";
}
}
if (typeof onClick === "function") {
WrapElement = "button";
wrapElementProps.type = "button";
wrapElementProps.onClick = () => {
onClick({
cellData,
collectionSlug: collectionConfig?.slug,
rowData
});
};
}
if (fieldIsID(field)) {
t4 = _jsx(WrapElement, {
...wrapElementProps,
children: _jsx(CodeCell, {
cellData: `ID: ${cellData}`,
collectionConfig,
collectionSlug,
field: {
...field,
type: "code"
},
nowrap: true,
rowData
})
});
break bb0;
}
const displayedValue = getDisplayedFieldValue(cellData, field, i18n);
const DefaultCellComponent = typeof cellData !== "undefined" && cellComponents[field.type];
let CellComponent = null;
if (isValidReactElement(displayedValue)) {
CellComponent = displayedValue;
} else {
if (DefaultCellComponent) {
CellComponent = _jsx(DefaultCellComponent, {
cellData,
rowData,
...props
});
} else {
if (!DefaultCellComponent) {
if (collectionConfig?.upload && fieldAffectsData(field) && field.name === "filename" && field.type === "text") {
const FileCellComponent = cellComponents.File;
CellComponent = _jsx(FileCellComponent, {
cellData,
rowData,
...props,
collectionConfig,
field
});
} else {
t4 = _jsxs(WrapElement, {
...wrapElementProps,
children: [(displayedValue === "" || typeof displayedValue === "undefined" || displayedValue === null) && i18n.t("general:noLabel", {
label: getTranslation(("label" in field ? field.label : null) || "data", i18n)
}), typeof displayedValue === "string" && displayedValue, typeof displayedValue === "number" && displayedValue, typeof displayedValue === "object" && displayedValue !== null && JSON.stringify(displayedValue)]
});
break bb0;
}
}
}
}
if ((field.type === "select" || field.type === "radio") && field.options.length && cellData) {
const classes = Array.isArray(cellData) ? cellData.map(_temp).join(" ") : `selected--${cellData}`;
const className_0 = [wrapElementProps.className, classes].filter(Boolean).join(" ");
t4 = _jsx(WrapElement, {
...wrapElementProps,
className: className_0,
children: CellComponent
});
break bb0;
}
t3 = _jsx(WrapElement, {
...wrapElementProps,
children: CellComponent
});
}
$[0] = admin;
$[1] = adminRoute;
$[2] = cellData;
$[3] = classNameFromProps;
$[4] = collectionSlug;
$[5] = field;
$[6] = getEntityConfig;
$[7] = i18n;
$[8] = link;
$[9] = linkURL;
$[10] = onClickFromProps;
$[11] = props;
$[12] = rowData;
$[13] = viewType;
$[14] = t3;
$[15] = t4;
} else {
t3 = $[14];
t4 = $[15];
}
if (t4 !== Symbol.for("react.early_return_sentinel")) {
return t4;
}
return t3;
};
function _temp(value) {
return `selected--${value}`;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,96 @@
{
"name": "json-schema-to-typescript",
"version": "15.0.3",
"description": "compile json schema to typescript typings",
"main": "dist/src/index.js",
"bin": {
"json2ts": "dist/src/cli.js"
},
"typings": "dist/src/index.d.ts",
"engines": {
"node": ">=16.0.0"
},
"scripts": {
"build": "npm run lint && npm run clean && npm run build:browser && npm run build:server",
"build:browser": "browserify src/index.ts -s jstt -p tsify > dist/bundle.js",
"build:server": "tsc -d",
"clean": "shx rm -rf dist && mkdir dist",
"format": "prettier \"{src,test}/*.ts\" --write",
"format-check": "prettier \"{src,test}/*.ts\" --check",
"lint": "eslint src/*.ts test/*.ts",
"tdd": "concurrently -r -p '' -k 'npm run watch' 'npm run watch:test'",
"test": "npm run pre-test && ava --timeout=300s --verbose",
"stresstest": "seq 1 10 | xargs -I{} npm test",
"prepublishOnly": "npm test",
"pre-test": "npm run clean && npm run format-check && npm run build:server",
"watch": "tsc -w",
"watch:test": "ava -w"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bcherny/json-schema-to-typescript.git"
},
"keywords": [
"json",
"schema",
"typescript",
"compile",
"transpile",
"api",
"interface",
"typing",
"share"
],
"author": "Boris Cherny <boris@borischerny.com> (https://borischerny.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/bcherny/json-schema-to-typescript/issues"
},
"homepage": "https://github.com/bcherny/json-schema-to-typescript#readme",
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^11.5.5",
"@types/json-schema": "^7.0.15",
"@types/lodash": "^4.17.7",
"is-glob": "^4.0.3",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"minimist": "^1.2.8",
"prettier": "^3.2.5",
"tinyglobby": "^0.2.9"
},
"devDependencies": {
"@types/cli-color": "^2.0.6",
"@types/is-glob": "^4.0.4",
"@types/js-yaml": "^4.0.9",
"@types/minimist": "^1.2.5",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"ava": "^6.1.2",
"browserify": "^17.0.0",
"browserify-shim": "^3.8.16",
"cli-color": "^2.0.4",
"concurrently": "^8.2.2",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"rimraf": "^5.0.5",
"shx": "^0.3.4",
"tsify": "^5.0.4",
"typescript": "^5.4.5"
},
"ava": {
"files": [
"./dist/test/test.js"
],
"snapshotDir": "./test/__snapshots__"
},
"browserify": {
"transform": [
"browserify-shim"
]
},
"browserify-shim": {
"prettier": "global:prettier"
}
}

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 Milestone = createLucideIcon("Milestone", [
["path", { d: "M12 13v8", key: "1l5pq0" }],
["path", { d: "M12 3v3", key: "1n5kay" }],
[
"path",
{
d: "M4 6a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h13a2 2 0 0 0 1.152-.365l3.424-2.317a1 1 0 0 0 0-1.635l-3.424-2.318A2 2 0 0 0 17 6z",
key: "1btarq"
}
]
]);
export { Milestone as default };
//# sourceMappingURL=milestone.js.map

View File

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

View File

@@ -0,0 +1,10 @@
@import '../../scss/styles';
@layer payload-default {
.icon--x {
.stroke {
stroke: currentColor;
stroke-width: $style-stroke-width-s;
}
}
}

View File

@@ -0,0 +1 @@
import n from"path";function e(e){return n.posix.normalize(e.split(n.win32.sep).join(n.posix.sep))}function t(n,e,t){const o=e.split(".");let r=n;for(let n=0;n<o.length-1;n++){const e=o[n];e in r&&"object"==typeof r[e]&&null!==r[e]||(r[e]={}),r=r[e]}r[o[o.length-1]]=t}function o(n){return n.toSorted(((n,e)=>{const t=n.references?.[0],o=e.references?.[0];return t&&o?i(t,o):0}))}function r(n,e){return n.localeCompare(e,"en")}function i(n,e){const t=r(n.path,e.path);return 0!==t?t:(n.line??0)-(e.line??0)}function c(){return process.cwd()}export{i as compareReferences,c as getDefaultProjectRoot,o as getSortedMessages,r as localeCompare,e as normalizePathToPosix,t as setNestedProperty};

View File

@@ -0,0 +1,63 @@
# Time Zones
## Table of Contents
- [Overview](#overview)
- [`date-fns-tz`](#date-fns-tz)
## Overview
Working with UTC or ISO date strings is easy, and so is working with JS dates when all times
are displayed in a user's local time in the browser. The difficulty comes when working with another
time zone's local time, other than the current system's, like showing the local time of an event in LA
at 8pm PST on a Node server in Europe or a user's machine set to EST.
In this case there are two relevant pieces of information:
- a fixed moment in time in the form of a timestamp, UTC or ISO date string, and
- the time zone descriptor, usually an offset or IANA time zone name (e.g. `America/Los_Angeles`).
Libraries like Moment and Luxon, which provide their own date time classes, manage these timestamp and time
zone values internally. Since `date-fns` always returns a plain JS Date, which implicitly has the current
system's time zone, helper functions are needed for handling common time zone related use cases.
## [`date-fns-tz`](https://www.npmjs.com/package/date-fns-tz)
Dependency free IANA time zone support is implemented via the
[Intl API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) to keep
actual time zone data out of code bundles. Modern browsers all support the
[necessary features](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat#Browser_compatibility),
and for those that don't a [polyfill](https://github.com/yahoo/date-time-format-timezone) can be used.
Functions are provided for converting to and from a Date instance which will have the internal UTC time
adjusted so it prints to the correct time value in the associated time zone, regardless of the current
system time zone. The `date-fns` `format` function is extended with support for the `z...zzzz` tokens to
format long and short time zone names.
Compatible with `date-fns` version 2
License: MIT
### Synopsis
```js
const { zonedTimeToUtc, utcToZonedTime, format } = require("date-fns-tz");
// Set the date to "2018-09-01T16:01:36.386Z"
const utcDate = zonedTimeToUtc("2018-09-01 18:01:36.386", "Europe/Berlin");
// Obtain a Date instance that will render the equivalent Berlin time for the UTC date
const date = new Date("2018-09-01T16:01:36.386Z");
const timeZone = "Europe/Berlin";
const zonedDate = utcToZonedTime(date, timeZone);
// zonedDate could be used to initialize a date picker or display the formatted local date/time
// Set the output to "1.9.2018 18:01:36.386 GMT+02:00 (CEST)"
const pattern = "d.M.yyyy HH:mm:ss.SSS 'GMT' XXX (z)";
const output = format(zonedDate, pattern, { timeZone: "Europe/Berlin" });
```
### Links
- [API / Usage Scenarios](https://github.com/marnusw/date-fns-tz#time-zone-helpers)

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/postgres/countDistinct.ts"],"sourcesContent":["import type { PgTableWithColumns } from 'drizzle-orm/pg-core'\n\nimport { count, sql } from 'drizzle-orm'\n\nimport type { BasePostgresAdapter, CountDistinct } from './types.js'\n\nexport const countDistinct: CountDistinct = async function countDistinct(\n this: BasePostgresAdapter,\n { column, db, joins, tableName, where },\n) {\n // When we don't have any joins - use a simple COUNT(*) query.\n if (joins.length === 0) {\n const countResult = await db\n .select({\n count: column ? count(sql`DISTINCT ${column}`) : count(),\n })\n .from(this.tables[tableName])\n .where(where)\n\n return Number(countResult?.[0]?.count ?? 0)\n }\n\n let query = db\n .select({\n count: sql`COUNT(1) OVER()`,\n })\n .from(this.tables[tableName])\n .where(where)\n .groupBy(column || this.tables[tableName].id)\n .limit(1)\n .$dynamic()\n\n joins.forEach(({ type, condition, table }) => {\n query = query[type ?? 'leftJoin'](table as PgTableWithColumns<any>, condition)\n })\n\n // When we have any joins, we need to count each individual ID only once.\n // COUNT(*) doesn't work for this well in this case, as it also counts joined tables.\n // SELECT (COUNT DISTINCT id) has a very slow performance on large tables.\n // Instead, COUNT (GROUP BY id) can be used which is still slower than COUNT(*) but acceptable.\n const countResult = await query\n\n return Number(countResult?.[0]?.count ?? 0)\n}\n"],"names":["count","sql","countDistinct","column","db","joins","tableName","where","length","countResult","select","from","tables","Number","query","groupBy","id","limit","$dynamic","forEach","type","condition","table"],"mappings":"AAEA,SAASA,KAAK,EAAEC,GAAG,QAAQ,cAAa;AAIxC,OAAO,MAAMC,gBAA+B,eAAeA,cAEzD,EAAEC,MAAM,EAAEC,EAAE,EAAEC,KAAK,EAAEC,SAAS,EAAEC,KAAK,EAAE;IAEvC,8DAA8D;IAC9D,IAAIF,MAAMG,MAAM,KAAK,GAAG;QACtB,MAAMC,cAAc,MAAML,GACvBM,MAAM,CAAC;YACNV,OAAOG,SAASH,MAAMC,GAAG,CAAC,SAAS,EAAEE,OAAO,CAAC,IAAIH;QACnD,GACCW,IAAI,CAAC,IAAI,CAACC,MAAM,CAACN,UAAU,EAC3BC,KAAK,CAACA;QAET,OAAOM,OAAOJ,aAAa,CAAC,EAAE,EAAET,SAAS;IAC3C;IAEA,IAAIc,QAAQV,GACTM,MAAM,CAAC;QACNV,OAAOC,GAAG,CAAC,eAAe,CAAC;IAC7B,GACCU,IAAI,CAAC,IAAI,CAACC,MAAM,CAACN,UAAU,EAC3BC,KAAK,CAACA,OACNQ,OAAO,CAACZ,UAAU,IAAI,CAACS,MAAM,CAACN,UAAU,CAACU,EAAE,EAC3CC,KAAK,CAAC,GACNC,QAAQ;IAEXb,MAAMc,OAAO,CAAC,CAAC,EAAEC,IAAI,EAAEC,SAAS,EAAEC,KAAK,EAAE;QACvCR,QAAQA,KAAK,CAACM,QAAQ,WAAW,CAACE,OAAkCD;IACtE;IAEA,yEAAyE;IACzE,qFAAqF;IACrF,0EAA0E;IAC1E,+FAA+F;IAC/F,MAAMZ,cAAc,MAAMK;IAE1B,OAAOD,OAAOJ,aAAa,CAAC,EAAE,EAAET,SAAS;AAC3C,EAAC"}

View File

@@ -0,0 +1,120 @@
(function (Prism) {
var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;
var selectorInside;
Prism.languages.css.selector = {
pattern: Prism.languages.css.selector.pattern,
lookbehind: true,
inside: selectorInside = {
'pseudo-element': /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
'pseudo-class': /:[-\w]+/,
'class': /\.[-\w]+/,
'id': /#[-\w]+/,
'attribute': {
pattern: RegExp('\\[(?:[^[\\]"\']|' + string.source + ')*\\]'),
greedy: true,
inside: {
'punctuation': /^\[|\]$/,
'case-sensitivity': {
pattern: /(\s)[si]$/i,
lookbehind: true,
alias: 'keyword'
},
'namespace': {
pattern: /^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,
lookbehind: true,
inside: {
'punctuation': /\|$/
}
},
'attr-name': {
pattern: /^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,
lookbehind: true
},
'attr-value': [
string,
{
pattern: /(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,
lookbehind: true
}
],
'operator': /[|~*^$]?=/
}
},
'n-th': [
{
pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,
lookbehind: true,
inside: {
'number': /[\dn]+/,
'operator': /[+-]/
}
},
{
pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i,
lookbehind: true
}
],
'combinator': />|\+|~|\|\|/,
// the `tag` token has been existed and removed.
// because we can't find a perfect tokenize to match it.
// if you want to add it, please read https://github.com/PrismJS/prism/pull/2373 first.
'punctuation': /[(),]/,
}
};
Prism.languages.css['atrule'].inside['selector-function-argument'].inside = selectorInside;
Prism.languages.insertBefore('css', 'property', {
'variable': {
pattern: /(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,
lookbehind: true
}
});
var unit = {
pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/,
lookbehind: true
};
// 123 -123 .123 -.123 12.3 -12.3
var number = {
pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,
lookbehind: true
};
Prism.languages.insertBefore('css', 'function', {
'operator': {
pattern: /(\s)[+\-*\/](?=\s)/,
lookbehind: true
},
// CAREFUL!
// Previewers and Inline color use hexcode and color.
'hexcode': {
pattern: /\B#[\da-f]{3,8}\b/i,
alias: 'color'
},
'color': [
{
pattern: /(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,
lookbehind: true
},
{
pattern: /\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,
inside: {
'unit': unit,
'number': number,
'function': /[\w-]+(?=\()/,
'punctuation': /[(),]/
}
}
],
// it's important that there is no boundary assertion after the hex digits
'entity': /\\[\da-f]{1,8}/i,
'unit': unit,
'number': number
});
}(Prism));

View File

@@ -0,0 +1,18 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// this is autogenerated file, see scripts/version-update.js
export const VERSION = '1.9.0';
//# sourceMappingURL=version.js.map

View File

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

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 FileDigit = createLucideIcon("FileDigit", [
["path", { d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4", key: "1pf5j1" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["rect", { width: "4", height: "6", x: "2", y: "12", rx: "2", key: "jm304g" }],
["path", { d: "M10 12h2v6", key: "12zw74" }],
["path", { d: "M10 18h4", key: "1ulq68" }]
]);
export { FileDigit as default };
//# sourceMappingURL=file-digit.js.map

View File

@@ -0,0 +1,430 @@
"use strict";
exports.__esModule = true;
exports.default = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _addClass2 = _interopRequireDefault(require("dom-helpers/addClass"));
var _removeClass = _interopRequireDefault(require("dom-helpers/removeClass"));
var _react = _interopRequireDefault(require("react"));
var _Transition = _interopRequireDefault(require("./Transition"));
var _PropTypes = require("./utils/PropTypes");
var _reflow = require("./utils/reflow");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
var _addClass = function addClass(node, classes) {
return node && classes && classes.split(' ').forEach(function (c) {
return (0, _addClass2.default)(node, c);
});
};
var removeClass = function removeClass(node, classes) {
return node && classes && classes.split(' ').forEach(function (c) {
return (0, _removeClass.default)(node, c);
});
};
/**
* A transition component inspired by the excellent
* [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
* use it if you're using CSS transitions or animations. It's built upon the
* [`Transition`](https://reactcommunity.org/react-transition-group/transition)
* component, so it inherits all of its props.
*
* `CSSTransition` applies a pair of class names during the `appear`, `enter`,
* and `exit` states of the transition. The first class is applied and then a
* second `*-active` class in order to activate the CSS transition. After the
* transition, matching `*-done` class names are applied to persist the
* transition state.
*
* ```jsx
* function App() {
* const [inProp, setInProp] = useState(false);
* return (
* <div>
* <CSSTransition in={inProp} timeout={200} classNames="my-node">
* <div>
* {"I'll receive my-node-* classes"}
* </div>
* </CSSTransition>
* <button type="button" onClick={() => setInProp(true)}>
* Click to Enter
* </button>
* </div>
* );
* }
* ```
*
* When the `in` prop is set to `true`, the child component will first receive
* the class `example-enter`, then the `example-enter-active` will be added in
* the next tick. `CSSTransition` [forces a
* reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
* between before adding the `example-enter-active`. This is an important trick
* because it allows us to transition between `example-enter` and
* `example-enter-active` even though they were added immediately one after
* another. Most notably, this is what makes it possible for us to animate
* _appearance_.
*
* ```css
* .my-node-enter {
* opacity: 0;
* }
* .my-node-enter-active {
* opacity: 1;
* transition: opacity 200ms;
* }
* .my-node-exit {
* opacity: 1;
* }
* .my-node-exit-active {
* opacity: 0;
* transition: opacity 200ms;
* }
* ```
*
* `*-active` classes represent which styles you want to animate **to**, so it's
* important to add `transition` declaration only to them, otherwise transitions
* might not behave as intended! This might not be obvious when the transitions
* are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
* the example above (minus `transition`), but it becomes apparent in more
* complex transitions.
*
* **Note**: If you're using the
* [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
* prop, make sure to define styles for `.appear-*` classes as well.
*/
var CSSTransition = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(CSSTransition, _React$Component);
function CSSTransition() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.appliedClasses = {
appear: {},
enter: {},
exit: {}
};
_this.onEnter = function (maybeNode, maybeAppearing) {
var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
node = _this$resolveArgument[0],
appearing = _this$resolveArgument[1];
_this.removeClasses(node, 'exit');
_this.addClass(node, appearing ? 'appear' : 'enter', 'base');
if (_this.props.onEnter) {
_this.props.onEnter(maybeNode, maybeAppearing);
}
};
_this.onEntering = function (maybeNode, maybeAppearing) {
var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
node = _this$resolveArgument2[0],
appearing = _this$resolveArgument2[1];
var type = appearing ? 'appear' : 'enter';
_this.addClass(node, type, 'active');
if (_this.props.onEntering) {
_this.props.onEntering(maybeNode, maybeAppearing);
}
};
_this.onEntered = function (maybeNode, maybeAppearing) {
var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
node = _this$resolveArgument3[0],
appearing = _this$resolveArgument3[1];
var type = appearing ? 'appear' : 'enter';
_this.removeClasses(node, type);
_this.addClass(node, type, 'done');
if (_this.props.onEntered) {
_this.props.onEntered(maybeNode, maybeAppearing);
}
};
_this.onExit = function (maybeNode) {
var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
node = _this$resolveArgument4[0];
_this.removeClasses(node, 'appear');
_this.removeClasses(node, 'enter');
_this.addClass(node, 'exit', 'base');
if (_this.props.onExit) {
_this.props.onExit(maybeNode);
}
};
_this.onExiting = function (maybeNode) {
var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
node = _this$resolveArgument5[0];
_this.addClass(node, 'exit', 'active');
if (_this.props.onExiting) {
_this.props.onExiting(maybeNode);
}
};
_this.onExited = function (maybeNode) {
var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
node = _this$resolveArgument6[0];
_this.removeClasses(node, 'exit');
_this.addClass(node, 'exit', 'done');
if (_this.props.onExited) {
_this.props.onExited(maybeNode);
}
};
_this.resolveArguments = function (maybeNode, maybeAppearing) {
return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
: [maybeNode, maybeAppearing];
};
_this.getClassNames = function (type) {
var classNames = _this.props.classNames;
var isStringClassNames = typeof classNames === 'string';
var prefix = isStringClassNames && classNames ? classNames + "-" : '';
var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
return {
baseClassName: baseClassName,
activeClassName: activeClassName,
doneClassName: doneClassName
};
};
return _this;
}
var _proto = CSSTransition.prototype;
_proto.addClass = function addClass(node, type, phase) {
var className = this.getClassNames(type)[phase + "ClassName"];
var _this$getClassNames = this.getClassNames('enter'),
doneClassName = _this$getClassNames.doneClassName;
if (type === 'appear' && phase === 'done' && doneClassName) {
className += " " + doneClassName;
} // This is to force a repaint,
// which is necessary in order to transition styles when adding a class name.
if (phase === 'active') {
if (node) (0, _reflow.forceReflow)(node);
}
if (className) {
this.appliedClasses[type][phase] = className;
_addClass(node, className);
}
};
_proto.removeClasses = function removeClasses(node, type) {
var _this$appliedClasses$ = this.appliedClasses[type],
baseClassName = _this$appliedClasses$.base,
activeClassName = _this$appliedClasses$.active,
doneClassName = _this$appliedClasses$.done;
this.appliedClasses[type] = {};
if (baseClassName) {
removeClass(node, baseClassName);
}
if (activeClassName) {
removeClass(node, activeClassName);
}
if (doneClassName) {
removeClass(node, doneClassName);
}
};
_proto.render = function render() {
var _this$props = this.props,
_ = _this$props.classNames,
props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
return /*#__PURE__*/_react.default.createElement(_Transition.default, _extends({}, props, {
onEnter: this.onEnter,
onEntered: this.onEntered,
onEntering: this.onEntering,
onExit: this.onExit,
onExiting: this.onExiting,
onExited: this.onExited
}));
};
return CSSTransition;
}(_react.default.Component);
CSSTransition.defaultProps = {
classNames: ''
};
CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, _Transition.default.propTypes, {
/**
* The animation classNames applied to the component as it appears, enters,
* exits or has finished the transition. A single name can be provided, which
* will be suffixed for each stage, e.g. `classNames="fade"` applies:
*
* - `fade-appear`, `fade-appear-active`, `fade-appear-done`
* - `fade-enter`, `fade-enter-active`, `fade-enter-done`
* - `fade-exit`, `fade-exit-active`, `fade-exit-done`
*
* A few details to note about how these classes are applied:
*
* 1. They are _joined_ with the ones that are already defined on the child
* component, so if you want to add some base styles, you can use
* `className` without worrying that it will be overridden.
*
* 2. If the transition component mounts with `in={false}`, no classes are
* applied yet. You might be expecting `*-exit-done`, but if you think
* about it, a component cannot finish exiting if it hasn't entered yet.
*
* 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
* allows you to define different behavior for when appearing is done and
* when regular entering is done, using selectors like
* `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
* an epic entrance animation when element first appears in the DOM using
* [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
* simply use `fade-enter-done` for defining both cases.
*
* Each individual classNames can also be specified independently like:
*
* ```js
* classNames={{
* appear: 'my-appear',
* appearActive: 'my-active-appear',
* appearDone: 'my-done-appear',
* enter: 'my-enter',
* enterActive: 'my-active-enter',
* enterDone: 'my-done-enter',
* exit: 'my-exit',
* exitActive: 'my-active-exit',
* exitDone: 'my-done-exit',
* }}
* ```
*
* If you want to set these classes using CSS Modules:
*
* ```js
* import styles from './styles.css';
* ```
*
* you might want to use camelCase in your CSS file, that way could simply
* spread them instead of listing them one by one:
*
* ```js
* classNames={{ ...styles }}
* ```
*
* @type {string | {
* appear?: string,
* appearActive?: string,
* appearDone?: string,
* enter?: string,
* enterActive?: string,
* enterDone?: string,
* exit?: string,
* exitActive?: string,
* exitDone?: string,
* }}
*/
classNames: _PropTypes.classNamesShape,
/**
* A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
* applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEnter: _propTypes.default.func,
/**
* A `<Transition>` callback fired immediately after the 'enter-active' or
* 'appear-active' class is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEntering: _propTypes.default.func,
/**
* A `<Transition>` callback fired immediately after the 'enter' or
* 'appear' classes are **removed** and the `done` class is added to the DOM node.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
*
* @type Function(node: HtmlElement, isAppearing: bool)
*/
onEntered: _propTypes.default.func,
/**
* A `<Transition>` callback fired immediately after the 'exit' class is
* applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement)
*/
onExit: _propTypes.default.func,
/**
* A `<Transition>` callback fired immediately after the 'exit-active' is applied.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement)
*/
onExiting: _propTypes.default.func,
/**
* A `<Transition>` callback fired immediately after the 'exit' classes
* are **removed** and the `exit-done` class is added to the DOM node.
*
* **Note**: when `nodeRef` prop is passed, `node` is not passed
*
* @type Function(node: HtmlElement)
*/
onExited: _propTypes.default.func
}) : {};
var _default = CSSTransition;
exports.default = _default;
module.exports = exports.default;

View File

@@ -0,0 +1,23 @@
interface PerformanceEntryMap {
event: PerformanceEventTiming[];
'first-input': PerformanceEventTiming[];
'layout-shift': LayoutShift[];
'largest-contentful-paint': LargestContentfulPaint[];
'long-animation-frame': PerformanceLongAnimationFrameTiming[];
paint: PerformancePaintTiming[];
navigation: PerformanceNavigationTiming[];
resource: PerformanceResourceTiming[];
longtask: PerformanceEntry[];
element: PerformanceEntry[];
}
/**
* Takes a performance entry type and a callback function, and creates a
* `PerformanceObserver` instance that will observe the specified entry type
* with buffering enabled and call the callback _for each entry_.
*
* This function also feature-detects entry support and wraps the logic in a
* try/catch to avoid errors in unsupporting browsers.
*/
export declare const observe: <K extends keyof PerformanceEntryMap>(type: K, callback: (entries: PerformanceEntryMap[K]) => void, opts?: PerformanceObserverInit) => PerformanceObserver | undefined;
export {};
//# sourceMappingURL=observe.d.ts.map

View File

@@ -0,0 +1,26 @@
export * from "./bigint.js";
export * from "./binary.js";
export * from "./boolean.js";
export * from "./char.js";
export * from "./common.js";
export * from "./custom.js";
export * from "./date.js";
export * from "./datetime.js";
export * from "./decimal.js";
export * from "./double.js";
export * from "./enum.js";
export * from "./float.js";
export * from "./int.js";
export * from "./json.js";
export * from "./mediumint.js";
export * from "./real.js";
export * from "./serial.js";
export * from "./smallint.js";
export * from "./text.js";
export * from "./time.js";
export * from "./timestamp.js";
export * from "./tinyint.js";
export * from "./varbinary.js";
export * from "./varchar.js";
export * from "./year.js";
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,11 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict'
const LexicalTypeaheadMenuPlugin = process.env.NODE_ENV !== 'production' ? require('./LexicalTypeaheadMenuPlugin.dev.js') : require('./LexicalTypeaheadMenuPlugin.prod.js');
module.exports = LexicalTypeaheadMenuPlugin;

View File

@@ -0,0 +1,21 @@
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;

View File

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

View File

@@ -0,0 +1,196 @@
import { jsx as _jsx } from "react/jsx-runtime";
import React, { createContext, useCallback } from 'react';
export const ServerFunctionsContext = /*#__PURE__*/createContext(undefined);
export const useServerFunctions = () => {
const context = React.use(ServerFunctionsContext);
if (context === undefined) {
throw new Error('useServerFunctions must be used within a ServerFunctionsProvider');
}
return context;
};
export const ServerFunctionsProvider = ({
children,
serverFunction
}) => {
if (!serverFunction) {
throw new Error('ServerFunctionsProvider requires a serverFunction prop');
}
const getDocumentSlots = useCallback(async args => await serverFunction({
name: 'render-document-slots',
args
}), [serverFunction]);
const schedulePublish = useCallback(async args => {
const {
signal: remoteSignal,
...rest
} = args;
try {
if (!remoteSignal?.aborted) {
const result = await serverFunction({
name: 'schedule-publish',
args: {
...rest
}
});
if (!remoteSignal?.aborted) {
return result;
}
}
} catch (_err) {
console.error(_err); // eslint-disable-line no-console
}
let error = `Error scheduling ${rest.type}`;
if (rest.doc) {
error += ` for document with ID ${rest.doc.value} in collection ${rest.doc.relationTo}`;
}
return {
error
};
}, [serverFunction]);
const getFormState = useCallback(async args => {
const {
signal: remoteSignal,
...rest
} = args || {};
try {
if (!remoteSignal?.aborted) {
const result = await serverFunction({
name: 'form-state',
args: {
fallbackLocale: false,
...rest
}
});
// TODO: infer this type when `strictNullChecks` is enabled
if (!remoteSignal?.aborted) {
return result;
}
}
} catch (_err) {
console.error(_err); // eslint-disable-line no-console
}
return {
state: null
};
}, [serverFunction]);
const getTableState = useCallback(async args => {
const {
signal: remoteSignal,
...rest
} = args || {};
try {
if (!remoteSignal?.aborted) {
const result = await serverFunction({
name: 'table-state',
args: {
fallbackLocale: false,
...rest
}
});
// TODO: infer this type when `strictNullChecks` is enabled
if (!remoteSignal?.aborted) {
return result;
}
}
} catch (_err) {
console.error(_err); // eslint-disable-line no-console
}
// return { state: args.formState }
}, [serverFunction]);
const renderDocument = useCallback(async args => {
const {
signal: remoteSignal,
...rest
} = args || {};
try {
const result = await serverFunction({
name: 'render-document',
args: {
fallbackLocale: false,
...rest
}
});
// TODO: infer this type when `strictNullChecks` is enabled
return result;
} catch (_err) {
console.error(_err); // eslint-disable-line no-console
}
}, [serverFunction]);
const copyDataFromLocale = useCallback(async args => {
const {
signal: remoteSignal,
...rest
} = args || {};
const result = await serverFunction({
name: 'copy-data-from-locale',
args: rest
});
if (!remoteSignal?.aborted) {
return {
data: result
};
}
}, [serverFunction]);
const getFolderResultsComponentAndData = useCallback(async args => {
const {
signal: remoteSignal,
...rest
} = args || {};
try {
const result = await serverFunction({
name: 'get-folder-results-component-and-data',
args: rest
});
if (!remoteSignal?.aborted) {
return result;
}
} catch (_err) {
console.error(_err); // eslint-disable-line no-console
}
}, [serverFunction]);
const _internal_renderField = useCallback(async args => {
try {
const result = await serverFunction({
name: 'render-field',
args
});
return result;
} catch (_err) {
console.error(_err); // eslint-disable-line no-console
}
}, [serverFunction]);
const slugify = useCallback(async args => {
const {
signal: remoteSignal,
...rest
} = args || {};
try {
const result = await serverFunction({
name: 'slugify',
args: {
...rest
}
});
// TODO: infer this type when `strictNullChecks` is enabled
return result;
} catch (_err) {
console.error(_err); // eslint-disable-line no-console
}
}, [serverFunction]);
return /*#__PURE__*/_jsx(ServerFunctionsContext, {
value: {
_internal_renderField,
copyDataFromLocale,
getDocumentSlots,
getFolderResultsComponentAndData,
getFormState,
getTableState,
renderDocument,
schedulePublish,
serverFunction,
slugify
},
children: children
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,24 @@
"use strict";
exports.weeksToDays = weeksToDays;
var _index = require("./constants.js");
/**
* @name weeksToDays
* @category Conversion Helpers
* @summary Convert weeks to days.
*
* @description
* Convert a number of weeks to a full number of days.
*
* @param weeks - The number of weeks to be converted
*
* @returns The number of weeks converted in days
*
* @example
* // Convert 2 weeks into days
* const result = weeksToDays(2)
* //=> 14
*/
function weeksToDays(weeks) {
return Math.trunc(weeks * _index.daysInWeek);
}

View File

@@ -0,0 +1,24 @@
import { status as httpStatus } from 'http-status';
import { getRequestCollectionWithID } from '../../utilities/getRequestEntity.js';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { docAccessOperation } from '../operations/docAccess.js';
export const docAccessHandler = async (req)=>{
const { id, collection } = getRequestCollectionWithID(req, {
optionalID: true
});
const result = await docAccessOperation({
id,
collection,
data: req.data,
req
});
return Response.json(result, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: httpStatus.OK
});
};
//# sourceMappingURL=docAccess.js.map

View File

@@ -0,0 +1,28 @@
"use strict";
exports.mk = void 0;
var _index = require("./mk/_lib/formatDistance.cjs");
var _index2 = require("./mk/_lib/formatLong.cjs");
var _index3 = require("./mk/_lib/formatRelative.cjs");
var _index4 = require("./mk/_lib/localize.cjs");
var _index5 = require("./mk/_lib/match.cjs");
/**
* @category Locales
* @summary Macedonian locale.
* @language Macedonian
* @iso-639-2 mkd
* @author Petar Vlahu [@vlahupetar](https://github.com/vlahupetar)
* @author Altrim Beqiri [@altrim](https://github.com/altrim)
*/
const mk = (exports.mk = {
code: "mk",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"zC","4":"A B","8":"K D E F"},B:{"1":"0 1 2 3 4 5 6 7 8 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","4":"C L M G"},C:{"4":"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","8":"0C VC 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 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","4":"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"},E:{"4":"J bB K D E F A B C L M G 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","8":"6C bC"},F:{"1":"0 1 2 3 4 5 6 7 8 F B C 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","4":"9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB"},G:{"2":"bC","4":"E OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC","4":"rD sD"},J:{"2":"D","4":"A"},K:{"1":"A B C H PC xC QC"},L:{"1":"I"},M:{"4":"OC"},N:{"4":"A B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB wD xD cC yD zD 0D 1D 2D SC TC UC 3D","4":"J tD uD vD"},Q:{"1":"4D"},R:{"1":"5D"},S:{"4":"6D 7D"}},B:1,C:"HTML5 form features",D:false};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/versions/buildCollectionFields.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type { Field, FlattenedField } from '../fields/config/types.js'\n\nimport { hasAutosaveEnabled, hasDraftsEnabled } from '../utilities/getVersionsConfig.js'\nimport { versionSnapshotField } from './baseFields.js'\n\nexport const buildVersionCollectionFields = <T extends boolean = false>(\n config: SanitizedConfig,\n collection: SanitizedCollectionConfig,\n flatten?: T,\n): true extends T ? FlattenedField[] : Field[] => {\n const fields: FlattenedField[] = [\n {\n name: 'parent',\n type: 'relationship',\n index: true,\n relationTo: collection.slug,\n },\n {\n name: 'version',\n type: 'group',\n fields: collection.fields.filter((field) => !('name' in field) || field.name !== 'id'),\n ...(flatten && {\n flattenedFields: collection.flattenedFields.filter((each) => each.name !== 'id'),\n })!,\n },\n {\n name: 'createdAt',\n type: 'date',\n admin: {\n disabled: true,\n },\n index: true,\n },\n {\n name: 'updatedAt',\n type: 'date',\n admin: {\n disabled: true,\n },\n index: true,\n },\n ]\n\n if (hasDraftsEnabled(collection)) {\n if (config.localization) {\n fields.push(versionSnapshotField)\n\n fields.push({\n name: 'publishedLocale',\n type: 'select',\n admin: {\n disableBulkEdit: true,\n disabled: true,\n },\n index: true,\n options: config.localization.locales.map((locale) => {\n if (typeof locale === 'string') {\n return locale\n }\n\n return locale.code\n }),\n })\n }\n\n fields.push({\n name: 'latest',\n type: 'checkbox',\n admin: {\n disabled: true,\n },\n index: true,\n })\n\n if (hasAutosaveEnabled(collection)) {\n fields.push({\n name: 'autosave',\n type: 'checkbox',\n index: true,\n })\n }\n }\n\n return fields as true extends T ? FlattenedField[] : Field[]\n}\n"],"names":["hasAutosaveEnabled","hasDraftsEnabled","versionSnapshotField","buildVersionCollectionFields","config","collection","flatten","fields","name","type","index","relationTo","slug","filter","field","flattenedFields","each","admin","disabled","localization","push","disableBulkEdit","options","locales","map","locale","code"],"mappings":"AAIA,SAASA,kBAAkB,EAAEC,gBAAgB,QAAQ,oCAAmC;AACxF,SAASC,oBAAoB,QAAQ,kBAAiB;AAEtD,OAAO,MAAMC,+BAA+B,CAC1CC,QACAC,YACAC;IAEA,MAAMC,SAA2B;QAC/B;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO;YACPC,YAAYN,WAAWO,IAAI;QAC7B;QACA;YACEJ,MAAM;YACNC,MAAM;YACNF,QAAQF,WAAWE,MAAM,CAACM,MAAM,CAAC,CAACC,QAAU,CAAE,CAAA,UAAUA,KAAI,KAAMA,MAAMN,IAAI,KAAK;YACjF,GAAIF,WAAW;gBACbS,iBAAiBV,WAAWU,eAAe,CAACF,MAAM,CAAC,CAACG,OAASA,KAAKR,IAAI,KAAK;YAC7E,CAAC;QACH;QACA;YACEA,MAAM;YACNC,MAAM;YACNQ,OAAO;gBACLC,UAAU;YACZ;YACAR,OAAO;QACT;QACA;YACEF,MAAM;YACNC,MAAM;YACNQ,OAAO;gBACLC,UAAU;YACZ;YACAR,OAAO;QACT;KACD;IAED,IAAIT,iBAAiBI,aAAa;QAChC,IAAID,OAAOe,YAAY,EAAE;YACvBZ,OAAOa,IAAI,CAAClB;YAEZK,OAAOa,IAAI,CAAC;gBACVZ,MAAM;gBACNC,MAAM;gBACNQ,OAAO;oBACLI,iBAAiB;oBACjBH,UAAU;gBACZ;gBACAR,OAAO;gBACPY,SAASlB,OAAOe,YAAY,CAACI,OAAO,CAACC,GAAG,CAAC,CAACC;oBACxC,IAAI,OAAOA,WAAW,UAAU;wBAC9B,OAAOA;oBACT;oBAEA,OAAOA,OAAOC,IAAI;gBACpB;YACF;QACF;QAEAnB,OAAOa,IAAI,CAAC;YACVZ,MAAM;YACNC,MAAM;YACNQ,OAAO;gBACLC,UAAU;YACZ;YACAR,OAAO;QACT;QAEA,IAAIV,mBAAmBK,aAAa;YAClCE,OAAOa,IAAI,CAAC;gBACVZ,MAAM;gBACNC,MAAM;gBACNC,OAAO;YACT;QACF;IACF;IAEA,OAAOH;AACT,EAAC"}

View File

@@ -0,0 +1,18 @@
import type { ClientCollectionConfig, Where } from 'payload';
import React from 'react';
export type UnpublishManyProps = {
collection: ClientCollectionConfig;
};
export declare const UnpublishMany: React.FC<UnpublishManyProps>;
export declare const UnpublishMany_v4: React.FC<{
count: number;
ids: (number | string)[];
/**
* When multiple UnpublishMany components are rendered on the page, this will differentiate them.
*/
modalPrefix?: string;
onSuccess?: () => void;
selectAll: boolean;
where?: Where;
} & UnpublishManyProps>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLNonNegativeFloat = exports.GraphQLNonNegativeFloatConfig = void 0;
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
const utilities_js_1 = require("./utilities.js");
exports.GraphQLNonNegativeFloatConfig = {
name: 'NonNegativeFloat',
description: 'Floats that will have a value of 0 or more.',
serialize(value) {
return (0, utilities_js_1.processValue)(value, 'NonNegativeFloat');
},
parseValue(value) {
return (0, utilities_js_1.processValue)(value, 'NonNegativeFloat');
},
parseLiteral(ast) {
if (ast.kind !== graphql_1.Kind.FLOAT && ast.kind !== graphql_1.Kind.INT) {
throw (0, error_js_1.createGraphQLError)(`Can only validate floating point numbers as non-negative floating point numbers but got a: ${ast.kind}`, { nodes: ast });
}
return (0, utilities_js_1.processValue)(ast.value, 'NonNegativeFloat');
},
extensions: {
codegenScalarType: 'number',
jsonSchema: {
title: 'NonNegativeFloat',
type: 'number',
minimum: 0,
},
},
};
exports.GraphQLNonNegativeFloat = new graphql_1.GraphQLScalarType(exports.GraphQLNonNegativeFloatConfig);

View File

@@ -0,0 +1,57 @@
var createWrap = require('./_createWrap');
/** Used to compose bitmasks for function metadata. */
var WRAP_CURRY_FLAG = 8;
/**
* Creates a function that accepts arguments of `func` and either invokes
* `func` returning its result, if at least `arity` number of arguments have
* been provided, or returns a function that accepts the remaining `func`
* arguments, and so on. The arity of `func` may be specified if `func.length`
* is not sufficient.
*
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curry(abc);
*
* curried(1)(2)(3);
* // => [1, 2, 3]
*
* curried(1, 2)(3);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(1)(_, 3)(2);
* // => [1, 2, 3]
*/
function curry(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curry.placeholder;
return result;
}
// Assign default placeholders.
curry.placeholder = {};
module.exports = curry;

View File

@@ -0,0 +1 @@
{"version":3,"file":"loaders.d.ts","sourceRoot":"","sources":["../src/loaders.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA0CtC,QAAA,MAAM,OAAO,EAAE,WAA4C,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,CAAC"}

View File

@@ -0,0 +1,28 @@
function _iterableToArrayLimit(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e,
n,
i,
u,
a = [],
f = !0,
o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
export { _iterableToArrayLimit as default };

View File

@@ -0,0 +1 @@
{"version":3,"file":"ArrayRow.d.ts","sourceRoot":"","sources":["../../../src/fields/Array/ArrayRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,WAAW,EACX,GAAG,EACH,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAGhB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gEAAgE,CAAA;AAWhH,OAAO,cAAc,CAAA;AAIrB,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC3D,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzC,QAAQ,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACjD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,CAAA;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC9C,QAAQ,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,yBAAyB,CAAA;IAC/C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;IACjB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CAClE,GAAG,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC,GAC3C,0BAA0B,CAAA;AAE5B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAiI5C,CAAA"}

View File

@@ -0,0 +1,130 @@
import { getClientConfig } from '@payloadcms/ui/utilities/getClientConfig';
import { canAccessAdmin, isEntityHidden, UnauthorizedError } from 'payload';
import { applyLocaleFiltering } from 'payload/shared';
import { renderListView } from './index.js';
export const renderListHandler = async args => {
const {
collectionSlug,
cookies,
disableActions,
disableBulkDelete,
disableBulkEdit,
disableQueryPresets,
drawerSlug,
enableRowSelections,
locale,
overrideEntityVisibility,
permissions,
query,
redirectAfterDelete,
redirectAfterDuplicate,
req,
req: {
i18n,
payload,
payload: {
config
},
user
}
} = args;
if (!req.user) {
throw new UnauthorizedError();
}
await canAccessAdmin({
req
});
const clientConfig = getClientConfig({
config,
i18n,
importMap: payload.importMap,
user
});
await applyLocaleFiltering({
clientConfig,
config,
req
});
const preferencesKey = `collection-${collectionSlug}`;
const preferences = await payload.find({
collection: 'payload-preferences',
depth: 0,
limit: 1,
where: {
and: [{
key: {
equals: preferencesKey
}
}, {
'user.relationTo': {
equals: user.collection
}
}, {
'user.value': {
equals: user.id
}
}]
}
}).then(res => res.docs[0]?.value);
const visibleEntities = {
collections: payload.config.collections.map(({
slug,
admin: {
hidden
}
}) => !isEntityHidden({
hidden,
user
}) ? slug : null).filter(Boolean),
globals: payload.config.globals.map(({
slug,
admin: {
hidden
}
}) => !isEntityHidden({
hidden,
user
}) ? slug : null).filter(Boolean)
};
const {
List
} = await renderListView({
clientConfig,
disableActions,
disableBulkDelete,
disableBulkEdit,
disableQueryPresets,
drawerSlug,
enableRowSelections,
i18n,
importMap: payload.importMap,
initPageResult: {
collectionConfig: payload?.collections?.[collectionSlug]?.config,
cookies,
globalConfig: payload.config.globals.find(global => global.slug === collectionSlug),
languageOptions: undefined,
locale,
permissions,
req,
translations: undefined,
visibleEntities
},
locale,
overrideEntityVisibility,
params: {
segments: ['collections', collectionSlug]
},
payload,
permissions,
query,
redirectAfterDelete,
redirectAfterDuplicate,
searchParams: {},
viewType: 'list'
});
return {
List,
preferences
};
};
//# sourceMappingURL=handleServerFunction.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"profiling.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/profiling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,MAAM;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AM,CAAC;SACf,EAAE,CAAC;KACL,CACF,CAAC;CACH;AAED,MAAM,WAAW,YAAa,SAAQ,WAAW,CAAC,0BAA0B,CAAC;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}

View File

@@ -0,0 +1,19 @@
import type { FlattenedField, Payload, PayloadRequest } from 'payload';
import type { BasePostgresAdapter, PostgresDB } from '../../types.js';
import type { PathsToQuery } from './types.js';
type Args = {
adapter: BasePostgresAdapter;
collectionSlug?: string;
db: PostgresDB;
debug: boolean;
fields: FlattenedField[];
globalSlug?: string;
isVersions: boolean;
pathsToQuery: PathsToQuery;
payload: Payload;
req?: Partial<PayloadRequest>;
tableName: string;
};
export declare const migrateRelationships: ({ adapter, collectionSlug, db, debug, fields, globalSlug, isVersions, pathsToQuery, payload, req, tableName, }: Args) => Promise<void>;
export {};
//# sourceMappingURL=migrateRelationships.d.ts.map

View File

@@ -0,0 +1,77 @@
{
"name": "normalize-path",
"description": "Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled.",
"version": "3.0.0",
"homepage": "https://github.com/jonschlinkert/normalize-path",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"Blaine Bublitz (https://twitter.com/BlaineBublitz)",
"Jon Schlinkert (http://twitter.com/jonschlinkert)"
],
"repository": "jonschlinkert/normalize-path",
"bugs": {
"url": "https://github.com/jonschlinkert/normalize-path/issues"
},
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"devDependencies": {
"gulp-format-md": "^1.0.0",
"minimist": "^1.2.0",
"mocha": "^3.5.3"
},
"keywords": [
"absolute",
"backslash",
"delimiter",
"file",
"file-path",
"filepath",
"fix",
"forward",
"fp",
"fs",
"normalize",
"path",
"relative",
"separator",
"slash",
"slashes",
"trailing",
"unix",
"urix"
],
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {
"description": "Other useful path-related libraries:",
"list": [
"contains-path",
"is-absolute",
"is-relative",
"parse-filepath",
"path-ends-with",
"path-ends-with",
"unixify"
]
},
"lint": {
"reflinks": true
}
}
}

View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE, MMMM do, yyyy",
long: "MMMM do, yyyy",
medium: "MMM d, yyyy",
short: "yyyy-MM-dd",
};
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}} 'at' {{time}}",
long: "{{date}} 'at' {{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,8 @@
"use strict";
exports.formatRelativeWithOptions = void 0;
var _index = require("../formatRelative.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const formatRelativeWithOptions = (exports.formatRelativeWithOptions = (0,
_index2.convertToFP)(_index.formatRelative, 3));

View File

@@ -0,0 +1,278 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as path from 'path';
import { types as utilTypes } from 'util';
import { satisfies } from '../../semver';
import { wrap, unwrap } from '../../shimmer';
import { InstrumentationAbstract } from '../../instrumentation';
import { RequireInTheMiddleSingleton, } from './RequireInTheMiddleSingleton';
import { Hook as HookImport } from 'import-in-the-middle';
import { diag } from '@opentelemetry/api';
import { Hook as HookRequire } from 'require-in-the-middle';
import { readFileSync } from 'fs';
import { isWrapped } from '../../utils';
/**
* Base abstract class for instrumenting node plugins
*/
export class InstrumentationBase extends InstrumentationAbstract {
_modules;
_hooks = [];
_requireInTheMiddleSingleton = RequireInTheMiddleSingleton.getInstance();
_enabled = false;
constructor(instrumentationName, instrumentationVersion, config) {
super(instrumentationName, instrumentationVersion, config);
let modules = this.init();
if (modules && !Array.isArray(modules)) {
modules = [modules];
}
this._modules = modules || [];
if (this._config.enabled) {
this.enable();
}
}
_wrap = (moduleExports, name, wrapper) => {
if (isWrapped(moduleExports[name])) {
this._unwrap(moduleExports, name);
}
if (!utilTypes.isProxy(moduleExports)) {
return wrap(moduleExports, name, wrapper);
}
else {
const wrapped = wrap(Object.assign({}, moduleExports), name, wrapper);
Object.defineProperty(moduleExports, name, {
value: wrapped,
});
return wrapped;
}
};
_unwrap = (moduleExports, name) => {
if (!utilTypes.isProxy(moduleExports)) {
return unwrap(moduleExports, name);
}
else {
return Object.defineProperty(moduleExports, name, {
value: moduleExports[name],
});
}
};
_massWrap = (moduleExportsArray, names, wrapper) => {
if (!moduleExportsArray) {
diag.error('must provide one or more modules to patch');
return;
}
else if (!Array.isArray(moduleExportsArray)) {
moduleExportsArray = [moduleExportsArray];
}
if (!(names && Array.isArray(names))) {
diag.error('must provide one or more functions to wrap on modules');
return;
}
moduleExportsArray.forEach(moduleExports => {
names.forEach(name => {
this._wrap(moduleExports, name, wrapper);
});
});
};
_massUnwrap = (moduleExportsArray, names) => {
if (!moduleExportsArray) {
diag.error('must provide one or more modules to patch');
return;
}
else if (!Array.isArray(moduleExportsArray)) {
moduleExportsArray = [moduleExportsArray];
}
if (!(names && Array.isArray(names))) {
diag.error('must provide one or more functions to wrap on modules');
return;
}
moduleExportsArray.forEach(moduleExports => {
names.forEach(name => {
this._unwrap(moduleExports, name);
});
});
};
_warnOnPreloadedModules() {
this._modules.forEach((module) => {
const { name } = module;
try {
const resolvedModule = require.resolve(name);
if (require.cache[resolvedModule]) {
// Module is already cached, which means the instrumentation hook might not work
this._diag.warn(`Module ${name} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${name}`);
}
}
catch {
// Module isn't available, we can simply skip
}
});
}
_extractPackageVersion(baseDir) {
try {
const json = readFileSync(path.join(baseDir, 'package.json'), {
encoding: 'utf8',
});
const version = JSON.parse(json).version;
return typeof version === 'string' ? version : undefined;
}
catch {
diag.warn('Failed extracting version', baseDir);
}
return undefined;
}
_onRequire(module, exports, name, baseDir) {
if (!baseDir) {
if (typeof module.patch === 'function') {
module.moduleExports = exports;
if (this._enabled) {
this._diag.debug('Applying instrumentation patch for nodejs core module on require hook', {
module: module.name,
});
return module.patch(exports);
}
}
return exports;
}
const version = this._extractPackageVersion(baseDir);
module.moduleVersion = version;
if (module.name === name) {
// main module
if (isSupported(module.supportedVersions, version, module.includePrerelease)) {
if (typeof module.patch === 'function') {
module.moduleExports = exports;
if (this._enabled) {
this._diag.debug('Applying instrumentation patch for module on require hook', {
module: module.name,
version: module.moduleVersion,
baseDir,
});
return module.patch(exports, module.moduleVersion);
}
}
}
return exports;
}
// internal file
const files = module.files ?? [];
const normalizedName = path.normalize(name);
const supportedFileInstrumentations = files
.filter(f => f.name === normalizedName)
.filter(f => isSupported(f.supportedVersions, version, module.includePrerelease));
return supportedFileInstrumentations.reduce((patchedExports, file) => {
file.moduleExports = patchedExports;
if (this._enabled) {
this._diag.debug('Applying instrumentation patch for nodejs module file on require hook', {
module: module.name,
version: module.moduleVersion,
fileName: file.name,
baseDir,
});
// patch signature is not typed, so we cast it assuming it's correct
return file.patch(patchedExports, module.moduleVersion);
}
return patchedExports;
}, exports);
}
enable() {
if (this._enabled) {
return;
}
this._enabled = true;
// already hooked, just call patch again
if (this._hooks.length > 0) {
for (const module of this._modules) {
if (typeof module.patch === 'function' && module.moduleExports) {
this._diag.debug('Applying instrumentation patch for nodejs module on instrumentation enabled', {
module: module.name,
version: module.moduleVersion,
});
module.patch(module.moduleExports, module.moduleVersion);
}
for (const file of module.files) {
if (file.moduleExports) {
this._diag.debug('Applying instrumentation patch for nodejs module file on instrumentation enabled', {
module: module.name,
version: module.moduleVersion,
fileName: file.name,
});
file.patch(file.moduleExports, module.moduleVersion);
}
}
}
return;
}
this._warnOnPreloadedModules();
for (const module of this._modules) {
const hookFn = (exports, name, baseDir) => {
if (!baseDir && path.isAbsolute(name)) {
const parsedPath = path.parse(name);
name = parsedPath.name;
baseDir = parsedPath.dir;
}
return this._onRequire(module, exports, name, baseDir);
};
const onRequire = (exports, name, baseDir) => {
return this._onRequire(module, exports, name, baseDir);
};
// `RequireInTheMiddleSingleton` does not support absolute paths.
// For an absolute paths, we must create a separate instance of the
// require-in-the-middle `Hook`.
const hook = path.isAbsolute(module.name)
? new HookRequire([module.name], { internals: true }, onRequire)
: this._requireInTheMiddleSingleton.register(module.name, onRequire);
this._hooks.push(hook);
const esmHook = new HookImport([module.name], { internals: false }, hookFn);
this._hooks.push(esmHook);
}
}
disable() {
if (!this._enabled) {
return;
}
this._enabled = false;
for (const module of this._modules) {
if (typeof module.unpatch === 'function' && module.moduleExports) {
this._diag.debug('Removing instrumentation patch for nodejs module on instrumentation disabled', {
module: module.name,
version: module.moduleVersion,
});
module.unpatch(module.moduleExports, module.moduleVersion);
}
for (const file of module.files) {
if (file.moduleExports) {
this._diag.debug('Removing instrumentation patch for nodejs module file on instrumentation disabled', {
module: module.name,
version: module.moduleVersion,
fileName: file.name,
});
file.unpatch(file.moduleExports, module.moduleVersion);
}
}
}
}
isEnabled() {
return this._enabled;
}
}
function isSupported(supportedVersions, version, includePrerelease) {
if (typeof version === 'undefined') {
// If we don't have the version, accept the wildcard case only
return supportedVersions.includes('*');
}
return supportedVersions.some(supportedVersion => {
return satisfies(version, supportedVersion, { includePrerelease });
});
}
//# sourceMappingURL=instrumentation.js.map

View File

@@ -0,0 +1,64 @@
import { useState, useLayoutEffect } from 'react';
import { useConstant } from '../../utils/use-constant.mjs';
import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';
import { createBox } from '../../projection/geometry/models.mjs';
import { VisualElement } from '../../render/VisualElement.mjs';
import { animateVisualElement } from '../interfaces/visual-element.mjs';
const createObject = () => ({});
class StateVisualElement extends VisualElement {
constructor() {
super(...arguments);
this.measureInstanceViewportBox = createBox;
}
build() { }
resetTransform() { }
restoreTransform() { }
removeValueFromRenderState() { }
renderInstance() { }
scrapeMotionValuesFromProps() {
return createObject();
}
getBaseTargetFromProps() {
return undefined;
}
readValueFromInstance(_state, key, options) {
return options.initialState[key] || 0;
}
sortInstanceNodePosition() {
return 0;
}
}
const useVisualState = makeUseVisualState({
scrapeMotionValuesFromProps: createObject,
createRenderState: createObject,
});
/**
* This is not an officially supported API and may be removed
* on any version.
*/
function useAnimatedState(initialState) {
const [animationState, setAnimationState] = useState(initialState);
const visualState = useVisualState({}, false);
const element = useConstant(() => {
return new StateVisualElement({
props: {
onUpdate: (v) => {
setAnimationState({ ...v });
},
},
visualState,
presenceContext: null,
}, { initialState });
});
useLayoutEffect(() => {
element.mount({});
return () => element.unmount();
}, [element]);
const startAnimation = useConstant(() => (animationDefinition) => {
return animateVisualElement(element, animationDefinition);
});
return [animationState, startAnimation];
}
export { useAnimatedState };

View File

@@ -0,0 +1 @@
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAErE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE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AAG,uBAAuB,CAAA"}

View File

@@ -0,0 +1,38 @@
import { defaultUpdateJobs } from './defaultUpdateJobs.js';
import { createMigration } from './migrations/createMigration.js';
import { migrate } from './migrations/migrate.js';
import { migrateDown } from './migrations/migrateDown.js';
import { migrateRefresh } from './migrations/migrateRefresh.js';
import { migrateReset } from './migrations/migrateReset.js';
import { migrateStatus } from './migrations/migrateStatus.js';
const beginTransaction = ()=>Promise.resolve(null);
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
const rollbackTransaction = ()=>Promise.resolve(null);
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
const commitTransaction = ()=>Promise.resolve(null);
export function createDatabaseAdapter(args) {
return {
// Default 'null' transaction functions
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
beginTransaction,
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
commitTransaction,
createMigration,
migrate,
migrateDown,
migrateFresh: ()=>Promise.resolve(null),
migrateRefresh,
migrateReset,
migrateStatus,
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
rollbackTransaction,
updateJobs: defaultUpdateJobs,
...args,
// Ensure migrationDir is set
migrationDir: args.migrationDir || 'migrations',
// Set default for bulkOperationsSingleTransaction if not provided
bulkOperationsSingleTransaction: args.bulkOperationsSingleTransaction ?? false
};
}
//# sourceMappingURL=createDatabaseAdapter.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"shrink.js","sources":["../../../src/icons/shrink.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Shrink\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTUgMTUgNiA2bS02LTZ2NC44bTAtNC44aDQuOCIgLz4KICA8cGF0aCBkPSJNOSAxOS44VjE1bTAgMEg0LjJNOSAxNWwtNiA2IiAvPgogIDxwYXRoIGQ9Ik0xNSA0LjJWOW0wIDBoNC44TTE1IDlsNi02IiAvPgogIDxwYXRoIGQ9Ik05IDQuMlY5bTAgMEg0LjJNOSA5IDMgMyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/shrink\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Shrink = createLucideIcon('Shrink', [\n ['path', { d: 'm15 15 6 6m-6-6v4.8m0-4.8h4.8', key: '17vawe' }],\n ['path', { d: 'M9 19.8V15m0 0H4.2M9 15l-6 6', key: 'chjx8e' }],\n ['path', { d: 'M15 4.2V9m0 0h4.8M15 9l6-6', key: 'lav6yq' }],\n ['path', { d: 'M9 4.2V9m0 0H4.2M9 9 3 3', key: '1pxi2q' }],\n]);\n\nexport default Shrink;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,27 @@
import { secondsInHour } from "./constants.mjs";
/**
* @name hoursToSeconds
* @category Conversion Helpers
* @summary Convert hours to seconds.
*
* @description
* Convert a number of hours to a full number of seconds.
*
* @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 hours - The number of hours to be converted
*
* @returns The number of hours converted in seconds
*
* @example
* // Convert 2 hours to seconds:
* const result = hoursToSeconds(2)
* //=> 7200
*/
export function hoursToSeconds(hours) {
return Math.trunc(hours * secondsInHour);
}
// Fallback for modularized imports:
export default hoursToSeconds;

View File

@@ -0,0 +1,10 @@
@import '../../scss/styles.scss';
@layer payload-default {
.icon--menu {
.stroke {
stroke-width: $style-stroke-width-s;
stroke: currentColor;
}
}
}

View File

@@ -0,0 +1,171 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
// Reference: https://www.unicode.org/cldr/charts/32/summary/kn.html
const eraValues = {
narrow: ["ಕ್ರಿ.ಪೂ", "ಕ್ರಿ.ಶ"],
abbreviated: ["ಕ್ರಿ.ಪೂ", "ಕ್ರಿ.ಶ"], // CLDR #1618, #1620
wide: ["ಕ್ರಿಸ್ತ ಪೂರ್ವ", "ಕ್ರಿಸ್ತ ಶಕ"], // CLDR #1614, #1616
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["ತ್ರೈ 1", "ತ್ರೈ 2", "ತ್ರೈ 3", "ತ್ರೈ 4"], // CLDR #1630 - #1638
wide: ["1ನೇ ತ್ರೈಮಾಸಿಕ", "2ನೇ ತ್ರೈಮಾಸಿಕ", "3ನೇ ತ್ರೈಮಾಸಿಕ", "4ನೇ ತ್ರೈಮಾಸಿಕ"],
// CLDR #1622 - #1629
};
// CLDR #1646 - #1717
const monthValues = {
narrow: ["ಜ", "ಫೆ", "ಮಾ", "ಏ", "ಮೇ", "ಜೂ", "ಜು", "ಆ", "ಸೆ", "ಅ", "ನ", "ಡಿ"],
abbreviated: [
"ಜನ",
"ಫೆಬ್ರ",
"ಮಾರ್ಚ್",
"ಏಪ್ರಿ",
"ಮೇ",
"ಜೂನ್",
"ಜುಲೈ",
"ಆಗ",
"ಸೆಪ್ಟೆಂ",
"ಅಕ್ಟೋ",
"ನವೆಂ",
"ಡಿಸೆಂ",
],
wide: [
"ಜನವರಿ",
"ಫೆಬ್ರವರಿ",
"ಮಾರ್ಚ್",
"ಏಪ್ರಿಲ್",
"ಮೇ",
"ಜೂನ್",
"ಜುಲೈ",
"ಆಗಸ್ಟ್",
"ಸೆಪ್ಟೆಂಬರ್",
"ಅಕ್ಟೋಬರ್",
"ನವೆಂಬರ್",
"ಡಿಸೆಂಬರ್",
],
};
// CLDR #1718 - #1773
const dayValues = {
narrow: ["ಭಾ", "ಸೋ", "ಮಂ", "ಬು", "ಗು", "ಶು", "ಶ"],
short: ["ಭಾನು", "ಸೋಮ", "ಮಂಗಳ", "ಬುಧ", "ಗುರು", "ಶುಕ್ರ", "ಶನಿ"],
abbreviated: ["ಭಾನು", "ಸೋಮ", "ಮಂಗಳ", "ಬುಧ", "ಗುರು", "ಶುಕ್ರ", "ಶನಿ"],
wide: [
"ಭಾನುವಾರ",
"ಸೋಮವಾರ",
"ಮಂಗಳವಾರ",
"ಬುಧವಾರ",
"ಗುರುವಾರ",
"ಶುಕ್ರವಾರ",
"ಶನಿವಾರ",
],
};
// CLDR #1774 - #1815
const dayPeriodValues = {
narrow: {
am: "ಪೂರ್ವಾಹ್ನ",
pm: "ಅಪರಾಹ್ನ",
midnight: "ಮಧ್ಯರಾತ್ರಿ",
noon: "ಮಧ್ಯಾಹ್ನ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾಹ್ನ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
abbreviated: {
am: "ಪೂರ್ವಾಹ್ನ",
pm: "ಅಪರಾಹ್ನ",
midnight: "ಮಧ್ಯರಾತ್ರಿ",
noon: "ಮಧ್ಯಾನ್ಹ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾನ್ಹ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
wide: {
am: "ಪೂರ್ವಾಹ್ನ",
pm: "ಅಪರಾಹ್ನ",
midnight: "ಮಧ್ಯರಾತ್ರಿ",
noon: "ಮಧ್ಯಾನ್ಹ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾನ್ಹ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ಪೂ",
pm: "ಅ",
midnight: "ಮಧ್ಯರಾತ್ರಿ",
noon: "ಮಧ್ಯಾನ್ಹ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾನ್ಹ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
abbreviated: {
am: "ಪೂರ್ವಾಹ್ನ",
pm: "ಅಪರಾಹ್ನ",
midnight: "ಮಧ್ಯ ರಾತ್ರಿ",
noon: "ಮಧ್ಯಾನ್ಹ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾನ್ಹ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
wide: {
am: "ಪೂರ್ವಾಹ್ನ",
pm: "ಅಪರಾಹ್ನ",
midnight: "ಮಧ್ಯ ರಾತ್ರಿ",
noon: "ಮಧ್ಯಾನ್ಹ",
morning: "ಬೆಳಗ್ಗೆ",
afternoon: "ಮಧ್ಯಾನ್ಹ",
evening: "ಸಂಜೆ",
night: "ರಾತ್ರಿ",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + "ನೇ";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

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

View File

@@ -0,0 +1,35 @@
import { toDate } from "./toDate.mjs";
/**
* @name lastDayOfDecade
* @category Decade Helpers
* @summary Return the last day of a decade for the given date.
*
* @description
* Return the last day of a decade for the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The last day of a decade
*
* @example
* // The last day of a decade for 21 December 2012 21:12:00:
* const result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00))
* //=> Wed Dec 31 2019 00:00:00
*/
export function lastDayOfDecade(date) {
// TODO: Switch to more technical definition in of decades that start with 1
// end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking
// change, so it can only be done in 4.0.
const _date = toDate(date);
const year = _date.getFullYear();
const decade = 9 + Math.floor(year / 10) * 10;
_date.setFullYear(decade + 1, 0, 0);
_date.setHours(0, 0, 0, 0);
return _date;
}
// Fallback for modularized imports:
export default lastDayOfDecade;

View File

@@ -0,0 +1,5 @@
export interface MultiErrorReply extends Error {
replies: unknown[];
errorIndexes: Array<number>;
}
//# sourceMappingURL=internal-types.d.ts.map

View File

@@ -0,0 +1,26 @@
/**
* @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 NotebookPen = createLucideIcon("NotebookPen", [
["path", { d: "M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4", key: "re6nr2" }],
["path", { d: "M2 6h4", key: "aawbzj" }],
["path", { d: "M2 10h4", key: "l0bgd4" }],
["path", { d: "M2 14h4", key: "1gsvsf" }],
["path", { d: "M2 18h4", key: "1bu2t1" }],
[
"path",
{
d: "M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",
key: "pqwjuv"
}
]
]);
export { NotebookPen as default };
//# sourceMappingURL=notebook-pen.js.map

View File

@@ -0,0 +1,126 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const url = require('../../utils/url.js');
const attributes = require('./attributes.js');
const methodConfig = require('./methodConfig.js');
/**
* Core attribute extraction and building functions for MCP server instrumentation
*/
/**
* Formats logging data for span attributes
* @internal
*/
function formatLoggingData(data) {
return typeof data === 'string' ? data : JSON.stringify(data);
}
/**
* Extracts additional attributes for specific notification types
* @param method - Notification method name
* @param params - Notification parameters
* @param recordInputs - Whether to include actual content or just metadata
* @returns Method-specific attributes for span instrumentation
*/
function getNotificationAttributes(
method,
params,
recordInputs,
) {
const attributes$1 = {};
switch (method) {
case 'notifications/cancelled':
if (params?.requestId) {
attributes$1['mcp.cancelled.request_id'] = String(params.requestId);
}
if (params?.reason) {
attributes$1['mcp.cancelled.reason'] = String(params.reason);
}
break;
case 'notifications/message':
if (params?.level) {
attributes$1[attributes.MCP_LOGGING_LEVEL_ATTRIBUTE] = String(params.level);
}
if (params?.logger) {
attributes$1[attributes.MCP_LOGGING_LOGGER_ATTRIBUTE] = String(params.logger);
}
if (params?.data !== undefined) {
attributes$1[attributes.MCP_LOGGING_DATA_TYPE_ATTRIBUTE] = typeof params.data;
if (recordInputs) {
attributes$1[attributes.MCP_LOGGING_MESSAGE_ATTRIBUTE] = formatLoggingData(params.data);
}
}
break;
case 'notifications/progress':
if (params?.progressToken) {
attributes$1['mcp.progress.token'] = String(params.progressToken);
}
if (typeof params?.progress === 'number') {
attributes$1['mcp.progress.current'] = params.progress;
}
if (typeof params?.total === 'number') {
attributes$1['mcp.progress.total'] = params.total;
if (typeof params?.progress === 'number') {
attributes$1['mcp.progress.percentage'] = (params.progress / params.total) * 100;
}
}
if (params?.message) {
attributes$1['mcp.progress.message'] = String(params.message);
}
break;
case 'notifications/resources/updated':
if (params?.uri) {
attributes$1[attributes.MCP_RESOURCE_URI_ATTRIBUTE] = String(params.uri);
const urlObject = url.parseStringToURLObject(String(params.uri));
if (urlObject && !url.isURLObjectRelative(urlObject)) {
attributes$1['mcp.resource.protocol'] = urlObject.protocol.replace(':', '');
}
}
break;
case 'notifications/initialized':
attributes$1['mcp.lifecycle.phase'] = 'initialization_complete';
attributes$1['mcp.protocol.ready'] = 1;
break;
}
return attributes$1;
}
/**
* Build type-specific attributes based on message type
* @param type - Span type (request or notification)
* @param message - JSON-RPC message
* @param params - Optional parameters for attribute extraction
* @param recordInputs - Whether to capture input arguments in spans
* @returns Type-specific attributes for span instrumentation
*/
function buildTypeSpecificAttributes(
type,
message,
params,
recordInputs,
) {
if (type === 'request') {
const request = message ;
const targetInfo = methodConfig.extractTargetInfo(request.method, params || {});
return {
...(request.id !== undefined && { [attributes.MCP_REQUEST_ID_ATTRIBUTE]: String(request.id) }),
...targetInfo.attributes,
...(recordInputs ? methodConfig.getRequestArguments(request.method, params || {}) : {}),
};
}
return getNotificationAttributes(message.method, params || {}, recordInputs);
}
exports.buildTypeSpecificAttributes = buildTypeSpecificAttributes;
exports.getNotificationAttributes = getNotificationAttributes;
//# sourceMappingURL=attributeExtraction.js.map

View File

@@ -0,0 +1,89 @@
import { MongoDBInstrumentation } from '@opentelemetry/instrumentation-mongodb';
import { defineIntegration } from '@sentry/core';
import { generateInstrumentOnce, addOriginToSpan } from '@sentry/node-core';
const INTEGRATION_NAME = 'Mongo';
const instrumentMongo = generateInstrumentOnce(
INTEGRATION_NAME,
() =>
new MongoDBInstrumentation({
dbStatementSerializer: _defaultDbStatementSerializer,
responseHook(span) {
addOriginToSpan(span, 'auto.db.otel.mongo');
},
}),
);
/**
* Replaces values in document with '?', hiding PII and helping grouping.
*/
function _defaultDbStatementSerializer(commandObj) {
const resultObj = _scrubStatement(commandObj);
return JSON.stringify(resultObj);
}
function _scrubStatement(value) {
if (Array.isArray(value)) {
return value.map(element => _scrubStatement(element));
}
if (isCommandObj(value)) {
const initial = {};
return Object.entries(value)
.map(([key, element]) => [key, _scrubStatement(element)])
.reduce((prev, current) => {
if (isCommandEntry(current)) {
prev[current[0]] = current[1];
}
return prev;
}, initial);
}
// A value like string or number, possible contains PII, scrub it
return '?';
}
function isCommandObj(value) {
return typeof value === 'object' && value !== null && !isBuffer(value);
}
function isBuffer(value) {
let isBuffer = false;
if (typeof Buffer !== 'undefined') {
isBuffer = Buffer.isBuffer(value);
}
return isBuffer;
}
function isCommandEntry(value) {
return Array.isArray(value);
}
const _mongoIntegration = (() => {
return {
name: INTEGRATION_NAME,
setupOnce() {
instrumentMongo();
},
};
}) ;
/**
* Adds Sentry tracing instrumentation for the [mongodb](https://www.npmjs.com/package/mongodb) library.
*
* For more information, see the [`mongoIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongo/).
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
*
* Sentry.init({
* integrations: [Sentry.mongoIntegration()],
* });
* ```
*/
const mongoIntegration = defineIntegration(_mongoIntegration);
export { _defaultDbStatementSerializer, instrumentMongo, mongoIntegration };
//# sourceMappingURL=mongo.js.map

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