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,8 @@
import { Parser } from "acorn";
interface Options {
source?: boolean;
defer?: boolean;
}
export default function acornImportPhases(options?: Options): (BaseParser: typeof Parser) => typeof Parser;

View File

@@ -0,0 +1,31 @@
import { millisecondsInHour } from "./constants.js";
/**
* @name millisecondsToHours
* @category Conversion Helpers
* @summary Convert milliseconds to hours.
*
* @description
* Convert a number of milliseconds to a full number of hours.
*
* @param milliseconds - The number of milliseconds to be converted
*
* @returns The number of milliseconds converted in hours
*
* @example
* // Convert 7200000 milliseconds to hours:
* const result = millisecondsToHours(7200000)
* //=> 2
*
* @example
* // It uses floor rounding:
* const result = millisecondsToHours(7199999)
* //=> 1
*/
export function millisecondsToHours(milliseconds) {
const hours = milliseconds / millisecondsInHour;
return Math.trunc(hours);
}
// Fallback for modularized imports:
export default millisecondsToHours;

View File

@@ -0,0 +1,31 @@
import validate from './validate.js';
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
var byteToHex = [];
for (var i = 0; i < 256; ++i) {
byteToHex.push((i + 0x100).toString(16).slice(1));
}
export function unsafeStringify(arr, offset = 0) {
// Note: Be careful editing this code! It's been tuned for performance
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
//
// Note to future-self: No, you can't remove the `toLowerCase()` call.
// REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
}
function stringify(arr, offset = 0) {
var uuid = unsafeStringify(arr, offset);
// Consistency check for valid UUID. If this throws, it's likely due to one
// of the following:
// - One or more input array values don't map to a hex octet (leading to
// "undefined" in the uuid)
// - Invalid input values for the RFC `version` or `variant` fields
if (!validate(uuid)) {
throw TypeError('Stringified UUID is invalid');
}
return uuid;
}
export default stringify;

View File

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

View File

@@ -0,0 +1,104 @@
@import '../../../scss/styles.scss';
@layer payload-default {
.auth-fields {
padding: calc(var(--base) * 2);
background: var(--theme-elevation-50);
display: flex;
flex-direction: column;
gap: var(--base);
&__controls {
display: flex;
align-items: center;
gap: calc(var(--base) / 2);
flex-wrap: wrap;
}
&__changing-password {
display: flex;
flex-direction: column;
gap: var(--base);
}
.btn {
margin: 0;
}
&__api-key-label {
position: relative;
}
@include mid-break {
padding: var(--base);
gap: calc(var(--base) / 2);
&__changing-password {
gap: calc(var(--base) / 2);
}
}
.field-type.api-key {
margin-bottom: var(--base);
input {
@include formInput;
width: 100%;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
.api-key {
&__input-wrap {
display: flex;
align-items: center;
}
&__toggle-button-wrap {
display: flex;
align-self: stretch;
}
&__toggle-button {
@include formInput;
background: var(--theme-elevation-100);
border-top-left-radius: 0;
border-bottom-left-radius: 0;
margin: 0 0 0 -1px;
padding: 0 calc(var(--base) / 2);
box-shadow: none;
--btn-icon-size: var(--base);
}
}
}
@keyframes highlight {
0% {
background: var(--theme-success-250);
border: 1px solid var(--theme-success-500);
}
20% {
background: var(--theme-input-bg);
border: 1px solid var(--theme-elevation-250);
color: var(--theme-text);
}
80% {
background: var(--theme-input-bg);
border: 1px solid var(--theme-elevation-250);
color: var(--theme-text);
}
100% {
background: var(--theme-elevation-200);
border: 1px solid transparent;
color: var(--theme-elevation-400);
}
}
.highlight {
animation: highlight 10s;
}
}

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.color = void 0;
exports.color = {
name: "color",
initialValue: 'transparent',
prefix: false,
type: 3 /* TYPE_VALUE */,
format: 'color'
};
//# sourceMappingURL=color.js.map

View File

@@ -0,0 +1,167 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["BC", "AD"],
abbreviated: ["BC", "AD"],
wide: ["기원전", "서기"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1분기", "2분기", "3분기", "4분기"],
};
const monthValues = {
narrow: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
abbreviated: [
"1월",
"2월",
"3월",
"4월",
"5월",
"6월",
"7월",
"8월",
"9월",
"10월",
"11월",
"12월",
],
wide: [
"1월",
"2월",
"3월",
"4월",
"5월",
"6월",
"7월",
"8월",
"9월",
"10월",
"11월",
"12월",
],
};
const dayValues = {
narrow: ["일", "월", "화", "수", "목", "금", "토"],
short: ["일", "월", "화", "수", "목", "금", "토"],
abbreviated: ["일", "월", "화", "수", "목", "금", "토"],
wide: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"],
};
const dayPeriodValues = {
narrow: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
abbreviated: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
wide: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
abbreviated: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
wide: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = String(options?.unit);
switch (unit) {
case "minute":
case "second":
return String(number);
case "date":
return number + "일";
default:
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 @@
{"version":3,"sources":["../src/migrateReset.ts"],"sourcesContent":["import {\n commitTransaction,\n createLocalReq,\n getMigrations,\n initTransaction,\n killTransaction,\n readMigrationFiles,\n} from 'payload'\n\nimport type { DrizzleAdapter } from './types.js'\n\nimport { getTransaction } from './utilities/getTransaction.js'\nimport { migrationTableExists } from './utilities/migrationTableExists.js'\n\n/**\n * Run all migrate down functions\n */\nexport async function migrateReset(this: DrizzleAdapter): Promise<void> {\n const { payload } = this\n const migrationFiles = await readMigrationFiles({ payload })\n\n const { existingMigrations } = await getMigrations({ payload })\n\n if (!existingMigrations?.length) {\n payload.logger.info({ msg: 'No migrations to reset.' })\n return\n }\n\n const req = await createLocalReq({}, payload)\n\n existingMigrations.reverse()\n\n // Rollback all migrations in order\n for (const migration of existingMigrations) {\n const migrationFile = migrationFiles.find((m) => m.name === migration.name)\n try {\n if (!migrationFile) {\n throw new Error(`Migration ${migration.name} not found locally.`)\n }\n\n const start = Date.now()\n payload.logger.info({ msg: `Migrating down: ${migrationFile.name}` })\n await initTransaction(req)\n const db = await getTransaction(this, req)\n await migrationFile.down({ db, payload, req })\n payload.logger.info({\n msg: `Migrated down: ${migrationFile.name} (${Date.now() - start}ms)`,\n })\n\n const tableExists = await migrationTableExists(this, db)\n if (tableExists) {\n await payload.delete({\n id: migration.id,\n collection: 'payload-migrations',\n req,\n })\n }\n\n await commitTransaction(req)\n } catch (err: unknown) {\n let msg = `Error running migration ${migrationFile.name}.`\n\n if (err instanceof Error) {\n msg += ` ${err.message}`\n }\n\n await killTransaction(req)\n payload.logger.error({\n err,\n msg,\n })\n process.exit(1)\n }\n }\n\n // Delete dev migration\n\n const tableExists = await migrationTableExists(this)\n if (tableExists) {\n try {\n await payload.delete({\n collection: 'payload-migrations',\n where: {\n batch: {\n equals: -1,\n },\n },\n })\n } catch (err: unknown) {\n payload.logger.error({ err, msg: 'Error deleting dev migration' })\n }\n }\n}\n"],"names":["commitTransaction","createLocalReq","getMigrations","initTransaction","killTransaction","readMigrationFiles","getTransaction","migrationTableExists","migrateReset","payload","migrationFiles","existingMigrations","length","logger","info","msg","req","reverse","migration","migrationFile","find","m","name","Error","start","Date","now","db","down","tableExists","delete","id","collection","err","message","error","process","exit","where","batch","equals"],"mappings":"AAAA,SACEA,iBAAiB,EACjBC,cAAc,EACdC,aAAa,EACbC,eAAe,EACfC,eAAe,EACfC,kBAAkB,QACb,UAAS;AAIhB,SAASC,cAAc,QAAQ,gCAA+B;AAC9D,SAASC,oBAAoB,QAAQ,sCAAqC;AAE1E;;CAEC,GACD,OAAO,eAAeC;IACpB,MAAM,EAAEC,OAAO,EAAE,GAAG,IAAI;IACxB,MAAMC,iBAAiB,MAAML,mBAAmB;QAAEI;IAAQ;IAE1D,MAAM,EAAEE,kBAAkB,EAAE,GAAG,MAAMT,cAAc;QAAEO;IAAQ;IAE7D,IAAI,CAACE,oBAAoBC,QAAQ;QAC/BH,QAAQI,MAAM,CAACC,IAAI,CAAC;YAAEC,KAAK;QAA0B;QACrD;IACF;IAEA,MAAMC,MAAM,MAAMf,eAAe,CAAC,GAAGQ;IAErCE,mBAAmBM,OAAO;IAE1B,mCAAmC;IACnC,KAAK,MAAMC,aAAaP,mBAAoB;QAC1C,MAAMQ,gBAAgBT,eAAeU,IAAI,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAKJ,UAAUI,IAAI;QAC1E,IAAI;YACF,IAAI,CAACH,eAAe;gBAClB,MAAM,IAAII,MAAM,CAAC,UAAU,EAAEL,UAAUI,IAAI,CAAC,mBAAmB,CAAC;YAClE;YAEA,MAAME,QAAQC,KAAKC,GAAG;YACtBjB,QAAQI,MAAM,CAACC,IAAI,CAAC;gBAAEC,KAAK,CAAC,gBAAgB,EAAEI,cAAcG,IAAI,EAAE;YAAC;YACnE,MAAMnB,gBAAgBa;YACtB,MAAMW,KAAK,MAAMrB,eAAe,IAAI,EAAEU;YACtC,MAAMG,cAAcS,IAAI,CAAC;gBAAED;gBAAIlB;gBAASO;YAAI;YAC5CP,QAAQI,MAAM,CAACC,IAAI,CAAC;gBAClBC,KAAK,CAAC,gBAAgB,EAAEI,cAAcG,IAAI,CAAC,EAAE,EAAEG,KAAKC,GAAG,KAAKF,MAAM,GAAG,CAAC;YACxE;YAEA,MAAMK,cAAc,MAAMtB,qBAAqB,IAAI,EAAEoB;YACrD,IAAIE,aAAa;gBACf,MAAMpB,QAAQqB,MAAM,CAAC;oBACnBC,IAAIb,UAAUa,EAAE;oBAChBC,YAAY;oBACZhB;gBACF;YACF;YAEA,MAAMhB,kBAAkBgB;QAC1B,EAAE,OAAOiB,KAAc;YACrB,IAAIlB,MAAM,CAAC,wBAAwB,EAAEI,cAAcG,IAAI,CAAC,CAAC,CAAC;YAE1D,IAAIW,eAAeV,OAAO;gBACxBR,OAAO,CAAC,CAAC,EAAEkB,IAAIC,OAAO,EAAE;YAC1B;YAEA,MAAM9B,gBAAgBY;YACtBP,QAAQI,MAAM,CAACsB,KAAK,CAAC;gBACnBF;gBACAlB;YACF;YACAqB,QAAQC,IAAI,CAAC;QACf;IACF;IAEA,uBAAuB;IAEvB,MAAMR,cAAc,MAAMtB,qBAAqB,IAAI;IACnD,IAAIsB,aAAa;QACf,IAAI;YACF,MAAMpB,QAAQqB,MAAM,CAAC;gBACnBE,YAAY;gBACZM,OAAO;oBACLC,OAAO;wBACLC,QAAQ,CAAC;oBACX;gBACF;YACF;QACF,EAAE,OAAOP,KAAc;YACrBxB,QAAQI,MAAM,CAACsB,KAAK,CAAC;gBAAEF;gBAAKlB,KAAK;YAA+B;QAClE;IACF;AACF"}

View File

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

View File

@@ -0,0 +1,136 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^(\d+)(ನೇ|ನೆ)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ಕ್ರಿ.ಪೂ|ಕ್ರಿ.ಶ)/i,
abbreviated: /^(ಕ್ರಿ\.?\s?ಪೂ\.?|ಕ್ರಿ\.?\s?ಶ\.?|ಪ್ರ\.?\s?ಶ\.?)/i,
wide: /^(ಕ್ರಿಸ್ತ ಪೂರ್ವ|ಕ್ರಿಸ್ತ ಶಕ|ಪ್ರಸಕ್ತ ಶಕ)/i,
};
const parseEraPatterns = {
any: [/^ಪೂ/i, /^(ಶ|ಪ್ರ)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^ತ್ರೈ[1234]|ತ್ರೈ [1234]| [1234]ತ್ರೈ/i,
wide: /^[1234](ನೇ)? ತ್ರೈಮಾಸಿಕ/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(ಜೂ|ಜು|ಜ|ಫೆ|ಮಾ|ಏ|ಮೇ|ಆ|ಸೆ|ಅ|ನ|ಡಿ)/i,
abbreviated:
/^(ಜನ|ಫೆಬ್ರ|ಮಾರ್ಚ್|ಏಪ್ರಿ|ಮೇ|ಜೂನ್|ಜುಲೈ|ಆಗ|ಸೆಪ್ಟೆಂ|ಅಕ್ಟೋ|ನವೆಂ|ಡಿಸೆಂ)/i,
wide: /^(ಜನವರಿ|ಫೆಬ್ರವರಿ|ಮಾರ್ಚ್|ಏಪ್ರಿಲ್|ಮೇ|ಜೂನ್|ಜುಲೈ|ಆಗಸ್ಟ್|ಸೆಪ್ಟೆಂಬರ್|ಅಕ್ಟೋಬರ್|ನವೆಂಬರ್|ಡಿಸೆಂಬರ್)/i,
};
const parseMonthPatterns = {
narrow: [
/^ಜ$/i,
/^ಫೆ/i,
/^ಮಾ/i,
/^ಏ/i,
/^ಮೇ/i,
/^ಜೂ/i,
/^ಜು$/i,
/^ಆ/i,
/^ಸೆ/i,
/^ಅ/i,
/^ನ/i,
/^ಡಿ/i,
],
any: [
/^ಜನ/i,
/^ಫೆ/i,
/^ಮಾ/i,
/^ಏ/i,
/^ಮೇ/i,
/^ಜೂನ್/i,
/^ಜುಲೈ/i,
/^ಆ/i,
/^ಸೆ/i,
/^ಅ/i,
/^ನ/i,
/^ಡಿ/i,
],
};
const matchDayPatterns = {
narrow: /^(ಭಾ|ಸೋ|ಮ|ಬು|ಗು|ಶು|ಶ)/i,
short: /^(ಭಾನು|ಸೋಮ|ಮಂಗಳ|ಬುಧ|ಗುರು|ಶುಕ್ರ|ಶನಿ)/i,
abbreviated: /^(ಭಾನು|ಸೋಮ|ಮಂಗಳ|ಬುಧ|ಗುರು|ಶುಕ್ರ|ಶನಿ)/i,
wide: /^(ಭಾನುವಾರ|ಸೋಮವಾರ|ಮಂಗಳವಾರ|ಬುಧವಾರ|ಗುರುವಾರ|ಶುಕ್ರವಾರ|ಶನಿವಾರ)/i,
};
const parseDayPatterns = {
narrow: [/^ಭಾ/i, /^ಸೋ/i, /^ಮ/i, /^ಬು/i, /^ಗು/i, /^ಶು/i, /^ಶ/i],
any: [/^ಭಾ/i, /^ಸೋ/i, /^ಮ/i, /^ಬು/i, /^ಗು/i, /^ಶು/i, /^ಶ/i],
};
const matchDayPeriodPatterns = {
narrow: /^(ಪೂ|ಅ|ಮಧ್ಯರಾತ್ರಿ|ಮಧ್ಯಾನ್ಹ|ಬೆಳಗ್ಗೆ|ಸಂಜೆ|ರಾತ್ರಿ)/i,
any: /^(ಪೂರ್ವಾಹ್ನ|ಅಪರಾಹ್ನ|ಮಧ್ಯರಾತ್ರಿ|ಮಧ್ಯಾನ್ಹ|ಬೆಳಗ್ಗೆ|ಸಂಜೆ|ರಾತ್ರಿ)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^ಪೂ/i,
pm: /^ಅ/i,
midnight: /ಮಧ್ಯರಾತ್ರಿ/i,
noon: /ಮಧ್ಯಾನ್ಹ/i,
morning: /ಬೆಳಗ್ಗೆ/i,
afternoon: /ಮಧ್ಯಾನ್ಹ/i,
evening: /ಸಂಜೆ/i,
night: /ರಾತ್ರಿ/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"common.js","sources":["../../../../src/integrations/local-variables/common.ts"],"sourcesContent":["import type { Debugger } from 'node:inspector';\n\nexport type Variables = Record<string, unknown>;\n\nexport type RateLimitIncrement = () => void;\n\n/**\n * The key used to store the local variables on the error object.\n */\nexport const LOCAL_VARIABLES_KEY = '__SENTRY_ERROR_LOCAL_VARIABLES__';\n\n/**\n * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback\n * when a timeout has occurred.\n * @param maxPerSecond Maximum number of calls per second\n * @param enable Callback to enable capture\n * @param disable Callback to disable capture\n * @returns A function to call to increment the rate limiter count\n */\nexport function createRateLimiter(\n maxPerSecond: number,\n enable: () => void,\n disable: (seconds: number) => void,\n): RateLimitIncrement {\n let count = 0;\n let retrySeconds = 5;\n let disabledTimeout = 0;\n\n setInterval(() => {\n if (disabledTimeout === 0) {\n if (count > maxPerSecond) {\n retrySeconds *= 2;\n disable(retrySeconds);\n\n // Cap at one day\n if (retrySeconds > 86400) {\n retrySeconds = 86400;\n }\n disabledTimeout = retrySeconds;\n }\n } else {\n disabledTimeout -= 1;\n\n if (disabledTimeout === 0) {\n enable();\n }\n }\n\n count = 0;\n }, 1_000).unref();\n\n return () => {\n count += 1;\n };\n}\n\n// Add types for the exception event data\nexport type PausedExceptionEvent = Debugger.PausedEventDataType & {\n data: {\n // This contains error.stack\n description: string;\n objectId?: string;\n };\n};\n\n/** Could this be an anonymous function? */\nexport function isAnonymous(name: string | undefined): boolean {\n return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');\n}\n\n/** Do the function names appear to match? */\nexport function functionNamesMatch(a: string | undefined, b: string | undefined): boolean {\n return a === b || `Object.${a}` === b || a === `Object.${b}` || (isAnonymous(a) && isAnonymous(b));\n}\n\nexport interface FrameVariables {\n function: string;\n vars?: Variables;\n}\n\nexport interface LocalVariablesIntegrationOptions {\n /**\n * Capture local variables for both caught and uncaught exceptions\n *\n * - When false, only uncaught exceptions will have local variables\n * - When true, both caught and uncaught exceptions will have local variables.\n *\n * Defaults to `true`.\n *\n * Capturing local variables for all exceptions can be expensive since the debugger pauses for every throw to collect\n * local variables.\n *\n * To reduce the likelihood of this feature impacting app performance or throughput, this feature is rate-limited.\n * Once the rate limit is reached, local variables will only be captured for uncaught exceptions until a timeout has\n * been reached.\n */\n captureAllExceptions?: boolean;\n /**\n * Maximum number of exceptions to capture local variables for per second before rate limiting is triggered.\n */\n maxExceptionsPerSecond?: number;\n /**\n * When true, local variables will be captured for all frames, including those that are not in_app.\n *\n * Defaults to `false`.\n */\n includeOutOfAppFrames?: boolean;\n}\n\nexport interface LocalVariablesWorkerArgs extends LocalVariablesIntegrationOptions {\n /**\n * Whether to enable debug logging.\n */\n debug: boolean;\n /**\n * Base path used to calculate module name.\n *\n * Defaults to `dirname(process.argv[1])` and falls back to `process.cwd()`\n */\n basePath?: string;\n}\n"],"names":[],"mappings":"AAMA;AACA;AACA;AACO,MAAM,mBAAA,GAAsB;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,EAAE,YAAY;AACd,EAAE,MAAM;AACR,EAAE,OAAO;AACT,EAAsB;AACtB,EAAE,IAAI,KAAA,GAAQ,CAAC;AACf,EAAE,IAAI,YAAA,GAAe,CAAC;AACtB,EAAE,IAAI,eAAA,GAAkB,CAAC;;AAEzB,EAAE,WAAW,CAAC,MAAM;AACpB,IAAI,IAAI,eAAA,KAAoB,CAAC,EAAE;AAC/B,MAAM,IAAI,KAAA,GAAQ,YAAY,EAAE;AAChC,QAAQ,YAAA,IAAgB,CAAC;AACzB,QAAQ,OAAO,CAAC,YAAY,CAAC;;AAE7B;AACA,QAAQ,IAAI,YAAA,GAAe,KAAK,EAAE;AAClC,UAAU,YAAA,GAAe,KAAK;AAC9B,QAAQ;AACR,QAAQ,eAAA,GAAkB,YAAY;AACtC,MAAM;AACN,IAAI,OAAO;AACX,MAAM,eAAA,IAAmB,CAAC;;AAE1B,MAAM,IAAI,eAAA,KAAoB,CAAC,EAAE;AACjC,QAAQ,MAAM,EAAE;AAChB,MAAM;AACN,IAAI;;AAEJ,IAAI,KAAA,GAAQ,CAAC;AACb,EAAE,CAAC,EAAE,IAAK,CAAC,CAAC,KAAK,EAAE;;AAEnB,EAAE,OAAO,MAAM;AACf,IAAI,KAAA,IAAS,CAAC;AACd,EAAE,CAAC;AACH;;AAEA;;AASA;AACO,SAAS,WAAW,CAAC,IAAI,EAA+B;AAC/D,EAAE,OAAO,IAAA,KAAS,cAAc,IAAI,CAAC,MAAA,KAAW,CAAA,IAAK,SAAS,GAAA,IAAO,IAAA,KAAS,aAAa,CAAC;AAC5F;;AAEA;AACO,SAAS,kBAAkB,CAAC,CAAC,EAAsB,CAAC,EAA+B;AAC1F,EAAE,OAAO,CAAA,KAAM,CAAA,IAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA,KAAA,CAAA,IAAA,CAAA,KAAA,CAAA,OAAA,EAAA,CAAA,CAAA,CAAA,KAAA,WAAA,CAAA,CAAA,CAAA,IAAA,WAAA,CAAA,CAAA,CAAA,CAAA;AACA;;;;"}

View File

@@ -0,0 +1,34 @@
import { StreamReader, WebStreamReader } from 'peek-readable';
import { ReadStreamTokenizer } from './ReadStreamTokenizer.js';
import { BufferTokenizer } from './BufferTokenizer.js';
export { EndOfStreamError } from 'peek-readable';
export { AbstractTokenizer } from './AbstractTokenizer.js';
/**
* Construct ReadStreamTokenizer from given Stream.
* Will set fileSize, if provided given Stream has set the .path property/
* @param stream - Read from Node.js Stream.Readable
* @param options - Tokenizer options
* @returns ReadStreamTokenizer
*/
export function fromStream(stream, options) {
return new ReadStreamTokenizer(new StreamReader(stream), options);
}
/**
* Construct ReadStreamTokenizer from given ReadableStream (WebStream API).
* Will set fileSize, if provided given Stream has set the .path property/
* @param webStream - Read from Node.js Stream.Readable (must be a byte stream)
* @param options - Tokenizer options
* @returns ReadStreamTokenizer
*/
export function fromWebStream(webStream, options) {
return new ReadStreamTokenizer(new WebStreamReader(webStream), options);
}
/**
* Construct ReadStreamTokenizer from given Buffer.
* @param uint8Array - Uint8Array to tokenize
* @param options - Tokenizer options
* @returns BufferTokenizer
*/
export function fromBuffer(uint8Array, options) {
return new BufferTokenizer(uint8Array, options);
}

View File

@@ -0,0 +1,52 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var wasm_exports = {};
__export(wasm_exports, {
drizzle: () => drizzle
});
module.exports = __toCommonJS(wasm_exports);
var import_client_wasm = require("@libsql/client-wasm");
var import_utils = require("../../utils.cjs");
var import_driver_core = require("../driver-core.cjs");
function drizzle(...params) {
if (typeof params[0] === "string") {
const instance = (0, import_client_wasm.createClient)({
url: params[0]
});
return (0, import_driver_core.construct)(instance, params[1]);
}
if ((0, import_utils.isConfig)(params[0])) {
const { connection, client, ...drizzleConfig } = params[0];
if (client) return (0, import_driver_core.construct)(client, drizzleConfig);
const instance = typeof connection === "string" ? (0, import_client_wasm.createClient)({ url: connection }) : (0, import_client_wasm.createClient)(connection);
return (0, import_driver_core.construct)(instance, drizzleConfig);
}
return (0, import_driver_core.construct)(params[0], params[1]);
}
((drizzle2) => {
function mock(config) {
return (0, import_driver_core.construct)({}, config);
}
drizzle2.mock = mock;
})(drizzle || (drizzle = {}));
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
drizzle
});
//# sourceMappingURL=index.cjs.map

View File

@@ -0,0 +1,236 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const browserUtils = require('@sentry-internal/browser-utils');
const INTEGRATION_NAME = 'GraphQLClient';
const _graphqlClientIntegration = ((options) => {
return {
name: INTEGRATION_NAME,
setup(client) {
_updateSpanWithGraphQLData(client, options);
_updateBreadcrumbWithGraphQLData(client, options);
},
};
}) ;
function _updateSpanWithGraphQLData(client, options) {
client.on('beforeOutgoingRequestSpan', (span, hint) => {
const spanJSON = core.spanToJSON(span);
const spanAttributes = spanJSON.data || {};
const spanOp = spanAttributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP];
const isHttpClientSpan = spanOp === 'http.client';
if (!isHttpClientSpan) {
return;
}
const httpUrl = spanAttributes[core.SEMANTIC_ATTRIBUTE_URL_FULL] || spanAttributes['http.url'];
const httpMethod = spanAttributes[core.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD] || spanAttributes['http.method'];
if (!core.isString(httpUrl) || !core.isString(httpMethod)) {
return;
}
const { endpoints } = options;
const isTracedGraphqlEndpoint = core.stringMatchesSomePattern(httpUrl, endpoints);
const payload = getRequestPayloadXhrOrFetch(hint );
if (isTracedGraphqlEndpoint && payload) {
const graphqlBody = getGraphQLRequestPayload(payload);
if (graphqlBody) {
const operationInfo = _getGraphQLOperation(graphqlBody);
span.updateName(`${httpMethod} ${httpUrl} (${operationInfo})`);
// Handle standard requests - always capture the query document
if (isStandardRequest(graphqlBody)) {
span.setAttribute('graphql.document', graphqlBody.query);
}
// Handle persisted operations - capture hash for debugging
if (isPersistedRequest(graphqlBody)) {
span.setAttribute('graphql.persisted_query.hash.sha256', graphqlBody.extensions.persistedQuery.sha256Hash);
span.setAttribute('graphql.persisted_query.version', graphqlBody.extensions.persistedQuery.version);
}
}
}
});
}
function _updateBreadcrumbWithGraphQLData(client, options) {
client.on('beforeOutgoingRequestBreadcrumb', (breadcrumb, handlerData) => {
const { category, type, data } = breadcrumb;
const isFetch = category === 'fetch';
const isXhr = category === 'xhr';
const isHttpBreadcrumb = type === 'http';
if (isHttpBreadcrumb && (isFetch || isXhr)) {
const httpUrl = data?.url;
const { endpoints } = options;
const isTracedGraphqlEndpoint = core.stringMatchesSomePattern(httpUrl, endpoints);
const payload = getRequestPayloadXhrOrFetch(handlerData );
if (isTracedGraphqlEndpoint && data && payload) {
const graphqlBody = getGraphQLRequestPayload(payload);
if (!data.graphql && graphqlBody) {
const operationInfo = _getGraphQLOperation(graphqlBody);
data['graphql.operation'] = operationInfo;
if (isStandardRequest(graphqlBody)) {
data['graphql.document'] = graphqlBody.query;
}
if (isPersistedRequest(graphqlBody)) {
data['graphql.persisted_query.hash.sha256'] = graphqlBody.extensions.persistedQuery.sha256Hash;
data['graphql.persisted_query.version'] = graphqlBody.extensions.persistedQuery.version;
}
}
}
}
});
}
/**
* @param requestBody - GraphQL request
* @returns A formatted version of the request: 'TYPE NAME' or 'TYPE' or 'persisted NAME'
*/
function _getGraphQLOperation(requestBody) {
// Handle persisted operations
if (isPersistedRequest(requestBody)) {
return `persisted ${requestBody.operationName}`;
}
// Handle standard GraphQL requests
if (isStandardRequest(requestBody)) {
const { query: graphqlQuery, operationName: graphqlOperationName } = requestBody;
const { operationName = graphqlOperationName, operationType } = parseGraphQLQuery(graphqlQuery);
const operationInfo = operationName ? `${operationType} ${operationName}` : `${operationType}`;
return operationInfo;
}
// Fallback for unknown request types
return 'unknown';
}
/**
* Get the request body/payload based on the shape of the hint.
*
* Exported for tests only.
*/
function getRequestPayloadXhrOrFetch(hint) {
const isXhr = 'xhr' in hint;
let body;
if (isXhr) {
const sentryXhrData = hint.xhr[browserUtils.SENTRY_XHR_DATA_KEY];
body = sentryXhrData && browserUtils.getBodyString(sentryXhrData.body)[0];
} else {
const sentryFetchData = browserUtils.getFetchRequestArgBody(hint.input);
body = browserUtils.getBodyString(sentryFetchData)[0];
}
return body;
}
/**
* Extract the name and type of the operation from the GraphQL query.
*
* Exported for tests only.
*/
function parseGraphQLQuery(query) {
const namedQueryRe = /^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/;
const unnamedQueryRe = /^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/;
const namedMatch = query.match(namedQueryRe);
if (namedMatch) {
return {
operationType: namedMatch[1],
operationName: namedMatch[2],
};
}
const unnamedMatch = query.match(unnamedQueryRe);
if (unnamedMatch) {
return {
operationType: unnamedMatch[1],
operationName: undefined,
};
}
return {
operationType: undefined,
operationName: undefined,
};
}
/**
* Helper to safely check if a value is a non-null object
*/
function isObject(value) {
return typeof value === 'object' && value !== null;
}
/**
* Type guard to check if a request is a standard GraphQL request
*/
function isStandardRequest(payload) {
return isObject(payload) && typeof payload.query === 'string';
}
/**
* Type guard to check if a request is a persisted operation request
*/
function isPersistedRequest(payload) {
return (
isObject(payload) &&
typeof payload.operationName === 'string' &&
isObject(payload.extensions) &&
isObject(payload.extensions.persistedQuery) &&
typeof payload.extensions.persistedQuery.sha256Hash === 'string' &&
typeof payload.extensions.persistedQuery.version === 'number'
);
}
/**
* Extract the payload of a request if it's GraphQL.
* Exported for tests only.
* @param payload - A valid JSON string
* @returns A POJO or undefined
*/
function getGraphQLRequestPayload(payload) {
try {
const requestBody = JSON.parse(payload);
// Return any valid GraphQL request (standard, persisted, or APQ retry with both)
if (isStandardRequest(requestBody) || isPersistedRequest(requestBody)) {
return requestBody;
}
// Not a GraphQL request
return undefined;
} catch {
// Invalid JSON
return undefined;
}
}
/**
* This integration ensures that GraphQL requests made in the browser
* have their GraphQL-specific data captured and attached to spans and breadcrumbs.
*/
const graphqlClientIntegration = core.defineIntegration(_graphqlClientIntegration);
exports._getGraphQLOperation = _getGraphQLOperation;
exports.getGraphQLRequestPayload = getGraphQLRequestPayload;
exports.getRequestPayloadXhrOrFetch = getRequestPayloadXhrOrFetch;
exports.graphqlClientIntegration = graphqlClientIntegration;
exports.parseGraphQLQuery = parseGraphQLQuery;
//# sourceMappingURL=graphqlClient.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/elements/DraggableSortable/DraggableSortableItem/types.ts"],"sourcesContent":["import type { UseDraggableArguments } from '@dnd-kit/core'\nimport type { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities'\nimport type React from 'react'\n\nimport type { UseDraggableSortableReturn } from '../useDraggableSortable/types.js'\n\nexport type DragHandleProps = {\n attributes: UseDraggableArguments['attributes']\n listeners: SyntheticListenerMap\n} & UseDraggableArguments\n\nexport type ChildFunction = (args: UseDraggableSortableReturn) => React.ReactNode\n\nexport type Props = {\n children: ChildFunction\n} & UseDraggableArguments\n"],"mappings":"AAaA","ignoreList":[]}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1,23 @@
import type { CollectionSlug, FindOptions } from '../../index.js';
import type { PayloadRequest, PopulateType, SelectType, TransformCollectionWithSelect } from '../../types/index.js';
import type { Collection, DataFromCollectionSlug, RequiredDataFromCollectionSlug, SelectFromCollectionSlug } from '../config/types.js';
export type Arguments<TSlug extends CollectionSlug> = {
autosave?: boolean;
collection: Collection;
data: RequiredDataFromCollectionSlug<TSlug>;
depth?: number;
disableTransaction?: boolean;
disableVerificationEmail?: boolean;
draft?: boolean;
duplicateFromID?: DataFromCollectionSlug<TSlug>['id'];
overrideAccess?: boolean;
overwriteExistingFiles?: boolean;
populate?: PopulateType;
publishAllLocales?: boolean;
publishSpecificLocale?: string;
req: PayloadRequest;
selectedLocales?: string[];
showHiddenFields?: boolean;
} & Pick<FindOptions<TSlug, SelectType>, 'select'>;
export declare const createOperation: <TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(incomingArgs: Arguments<TSlug>) => Promise<TransformCollectionWithSelect<TSlug, TSelect>>;
//# sourceMappingURL=create.d.ts.map

View File

@@ -0,0 +1,38 @@
{
"name": "ms",
"version": "2.1.3",
"description": "Tiny millisecond conversion utility",
"repository": "vercel/ms",
"main": "./index",
"files": [
"index.js"
],
"scripts": {
"precommit": "lint-staged",
"lint": "eslint lib/* bin/*",
"test": "mocha tests.js"
},
"eslintConfig": {
"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true
}
},
"lint-staged": {
"*.js": [
"npm run lint",
"prettier --single-quote --write",
"git add"
]
},
"license": "MIT",
"devDependencies": {
"eslint": "4.18.2",
"expect.js": "0.3.1",
"husky": "0.14.3",
"lint-staged": "5.0.0",
"mocha": "4.0.1",
"prettier": "2.0.5"
}
}

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sources":["../../src/config/cache-contexts.ts"],"sourcesContent":["import type { ConfigContext } from \"./config-chain.ts\";\nimport type {\n CallerMetadata,\n TargetsListOrObject,\n} from \"./validation/options.ts\";\n\nexport type { ConfigContext as FullConfig };\n\nexport type FullPreset = {\n targets: TargetsListOrObject;\n} & ConfigContext;\nexport type FullPlugin = {\n assumptions: Record<string, boolean>;\n} & FullPreset;\n\n// Context not including filename since it is used in places that cannot\n// process 'ignore'/'only' and other filename-based logic.\nexport type SimpleConfig = {\n envName: string;\n caller: CallerMetadata | undefined;\n};\nexport type SimplePreset = {\n targets: TargetsListOrObject;\n} & SimpleConfig;\nexport type SimplePlugin = {\n assumptions: Record<string, boolean>;\n} & SimplePreset;\n"],"mappings":"","ignoreList":[]}

View File

@@ -0,0 +1,200 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const forEachBail = require("./forEachBail");
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").JsonObject} JsonObject */
/** @typedef {import("./Resolver").JsonValue} JsonValue */
/** @typedef {import("./Resolver").ResolveContext} ResolveContext */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/**
* @typedef {object} DescriptionFileInfo
* @property {JsonObject=} content content
* @property {string} path path
* @property {string} directory directory
*/
/**
* @callback ErrorFirstCallback
* @param {Error | null=} error
* @param {DescriptionFileInfo=} result
*/
/**
* @typedef {object} Result
* @property {string} path path to description file
* @property {string} directory directory of description file
* @property {JsonObject} content content of description file
*/
/**
* @param {string} directory directory
* @returns {string | null} parent directory or null
*/
function cdUp(directory) {
if (directory === "/") return null;
const i = directory.lastIndexOf("/");
const j = directory.lastIndexOf("\\");
const path = i < 0 ? j : j < 0 ? i : i < j ? j : i;
if (path < 0) return null;
return directory.slice(0, path || 1);
}
/**
* @param {Resolver} resolver resolver
* @param {string} directory directory
* @param {string[]} filenames filenames
* @param {DescriptionFileInfo | undefined} oldInfo oldInfo
* @param {ResolveContext} resolveContext resolveContext
* @param {ErrorFirstCallback} callback callback
*/
function loadDescriptionFile(
resolver,
directory,
filenames,
oldInfo,
resolveContext,
callback,
) {
(function findDescriptionFile() {
if (oldInfo && oldInfo.directory === directory) {
// We already have info for this directory and can reuse it
return callback(null, oldInfo);
}
forEachBail(
filenames,
/**
* @param {string} filename filename
* @param {(err?: null | Error, result?: null | Result) => void} callback callback
* @returns {void}
*/
(filename, callback) => {
const descriptionFilePath = resolver.join(directory, filename);
/**
* @param {(null | Error)=} err error
* @param {JsonObject=} resolvedContent content
* @returns {void}
*/
function onJson(err, resolvedContent) {
if (err) {
if (resolveContext.log) {
resolveContext.log(
`${descriptionFilePath} (directory description file): ${err}`,
);
} else {
err.message = `${descriptionFilePath} (directory description file): ${err}`;
}
return callback(err);
}
callback(null, {
content: /** @type {JsonObject} */ (resolvedContent),
directory,
path: descriptionFilePath,
});
}
if (resolver.fileSystem.readJson) {
resolver.fileSystem.readJson(descriptionFilePath, (err, content) => {
if (err) {
if (
typeof (/** @type {NodeJS.ErrnoException} */ (err).code) !==
"undefined"
) {
if (resolveContext.missingDependencies) {
resolveContext.missingDependencies.add(descriptionFilePath);
}
return callback();
}
if (resolveContext.fileDependencies) {
resolveContext.fileDependencies.add(descriptionFilePath);
}
return onJson(err);
}
if (resolveContext.fileDependencies) {
resolveContext.fileDependencies.add(descriptionFilePath);
}
onJson(null, content);
});
} else {
resolver.fileSystem.readFile(descriptionFilePath, (err, content) => {
if (err) {
if (resolveContext.missingDependencies) {
resolveContext.missingDependencies.add(descriptionFilePath);
}
return callback();
}
if (resolveContext.fileDependencies) {
resolveContext.fileDependencies.add(descriptionFilePath);
}
/** @type {JsonObject | undefined} */
let json;
if (content) {
try {
json = JSON.parse(content.toString());
} catch (/** @type {unknown} */ err_) {
return onJson(/** @type {Error} */ (err_));
}
} else {
return onJson(new Error("No content in file"));
}
onJson(null, json);
});
}
},
/**
* @param {(null | Error)=} err error
* @param {(null | Result)=} result result
* @returns {void}
*/
(err, result) => {
if (err) return callback(err);
if (result) return callback(null, result);
const dir = cdUp(directory);
if (!dir) {
return callback();
}
directory = dir;
return findDescriptionFile();
},
);
})();
}
/**
* @param {JsonObject} content content
* @param {string | string[]} field field
* @returns {JsonValue | undefined} field data
*/
function getField(content, field) {
if (!content) return undefined;
if (Array.isArray(field)) {
/** @type {JsonValue} */
let current = content;
for (let j = 0; j < field.length; j++) {
if (current === null || typeof current !== "object") {
current = null;
break;
}
current = /** @type {JsonValue} */ (
/** @type {JsonObject} */
(current)[field[j]]
);
}
return current;
}
return content[field];
}
module.exports.cdUp = cdUp;
module.exports.getField = getField;
module.exports.loadDescriptionFile = loadDescriptionFile;

View File

@@ -0,0 +1 @@
Prism.languages.javastacktrace={summary:{pattern:/^([\t ]*)(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m,lookbehind:!0,inside:{keyword:{pattern:/^([\t ]*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,lookbehind:!0},string:{pattern:/^(\s*)"[^"]*"/,lookbehind:!0},exceptions:{pattern:/^(:?\s*)[\w$.]+(?=:|$)/,lookbehind:!0,inside:{"class-name":/[\w$]+$/,namespace:/\b[a-z]\w*\b/,punctuation:/\./}},message:{pattern:/(:\s*)\S.*/,lookbehind:!0,alias:"string"},punctuation:/:/}},"stack-frame":{pattern:/^([\t ]*)at (?:[\w$./]|@[\w$.+-]*\/)+(?:<init>)?\([^()]*\)/m,lookbehind:!0,inside:{keyword:{pattern:/^(\s*)at(?= )/,lookbehind:!0},source:[{pattern:/(\()\w+\.\w+:\d+(?=\))/,lookbehind:!0,inside:{file:/^\w+\.\w+/,punctuation:/:/,"line-number":{pattern:/\b\d+\b/,alias:"number"}}},{pattern:/(\()[^()]*(?=\))/,lookbehind:!0,inside:{keyword:/^(?:Native Method|Unknown Source)$/}}],"class-name":/[\w$]+(?=\.(?:<init>|[\w$]+)\()/,function:/(?:<init>|[\w$]+)(?=\()/,"class-loader":{pattern:/(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/,lookbehind:!0,alias:"namespace",inside:{punctuation:/\./}},module:{pattern:/([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/,lookbehind:!0,inside:{version:{pattern:/(@)[\s\S]+/,lookbehind:!0,alias:"number"},punctuation:/[@.]/}},namespace:{pattern:/(?:\b[a-z]\w*\.)+/,inside:{punctuation:/\./}},punctuation:/[()/.]/}},more:{pattern:/^([\t ]*)\.{3} \d+ [a-z]+(?: [a-z]+)*/m,lookbehind:!0,inside:{punctuation:/\.{3}/,number:/\d+/,keyword:/\b[a-z]+(?: [a-z]+)*\b/}}};

View File

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

View File

@@ -0,0 +1,56 @@
import { progress } from 'motion-utils';
import { velocityPerSecond } from '../../../utils/velocity-per-second.mjs';
/**
* A time in milliseconds, beyond which we consider the scroll velocity to be 0.
*/
const maxElapsed = 50;
const createAxisInfo = () => ({
current: 0,
offset: [],
progress: 0,
scrollLength: 0,
targetOffset: 0,
targetLength: 0,
containerLength: 0,
velocity: 0,
});
const createScrollInfo = () => ({
time: 0,
x: createAxisInfo(),
y: createAxisInfo(),
});
const keys = {
x: {
length: "Width",
position: "Left",
},
y: {
length: "Height",
position: "Top",
},
};
function updateAxisInfo(element, axisName, info, time) {
const axis = info[axisName];
const { length, position } = keys[axisName];
const prev = axis.current;
const prevTime = info.time;
axis.current = element[`scroll${position}`];
axis.scrollLength = element[`scroll${length}`] - element[`client${length}`];
axis.offset.length = 0;
axis.offset[0] = 0;
axis.offset[1] = axis.scrollLength;
axis.progress = progress(0, axis.scrollLength, axis.current);
const elapsed = time - prevTime;
axis.velocity =
elapsed > maxElapsed
? 0
: velocityPerSecond(axis.current - prev, elapsed);
}
function updateScrollInfo(element, info, time) {
updateAxisInfo(element, "x", info, time);
updateAxisInfo(element, "y", info, time);
info.time = time;
}
export { createScrollInfo, updateScrollInfo };

View File

@@ -0,0 +1,74 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const ono_1 = require("@jsdevtools/ono");
const url = __importStar(require("../util/url.js"));
const errors_js_1 = require("../util/errors.js");
exports.default = {
/**
* The order that this resolver will run, in relation to other resolvers.
*/
order: 100,
/**
* Determines whether this resolver can read a given file reference.
* Resolvers that return true will be tried, in order, until one successfully resolves the file.
* Resolvers that return false will not be given a chance to resolve the file.
*/
canRead(file) {
return url.isFileSystemPath(file.url);
},
/**
* Reads the given file and returns its raw contents as a Buffer.
*/
async read(file) {
let path;
try {
path = url.toFileSystemPath(file.url);
}
catch (err) {
throw new errors_js_1.ResolverError(ono_1.ono.uri(err, `Malformed URI: ${file.url}`), file.url);
}
try {
return await fs_1.default.promises.readFile(path);
}
catch (err) {
throw new errors_js_1.ResolverError((0, ono_1.ono)(err, `Error opening file "${path}"`), path);
}
},
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/collections/config/sanitizeCompoundIndexes.ts"],"sourcesContent":["import type { FlattenedField } from '../../fields/config/types.js'\nimport type { CompoundIndex, SanitizedCompoundIndex } from './types.js'\n\nimport { InvalidConfiguration } from '../../errors/InvalidConfiguration.js'\nimport { getFieldByPath } from '../../utilities/getFieldByPath.js'\n\nexport const sanitizeCompoundIndexes = ({\n fields,\n indexes,\n}: {\n fields: FlattenedField[]\n indexes: CompoundIndex[]\n}): SanitizedCompoundIndex[] => {\n const sanitizedCompoundIndexes: SanitizedCompoundIndex[] = []\n\n for (const index of indexes) {\n const sanitized: SanitizedCompoundIndex = { fields: [], unique: index.unique ?? false }\n for (const path of index.fields) {\n const result = getFieldByPath({ fields, path })\n\n if (!result) {\n throw new InvalidConfiguration(`Field ${path} was not found`)\n }\n\n const { field, localizedPath, pathHasLocalized } = result\n\n if (['array', 'blocks', 'group', 'tab'].includes(field.type)) {\n throw new InvalidConfiguration(\n `Compound index on ${field.type} cannot be set. Path: ${localizedPath}`,\n )\n }\n\n sanitized.fields.push({ field, localizedPath, path, pathHasLocalized })\n }\n\n sanitizedCompoundIndexes.push(sanitized)\n }\n\n return sanitizedCompoundIndexes\n}\n"],"names":["InvalidConfiguration","getFieldByPath","sanitizeCompoundIndexes","fields","indexes","sanitizedCompoundIndexes","index","sanitized","unique","path","result","field","localizedPath","pathHasLocalized","includes","type","push"],"mappings":"AAGA,SAASA,oBAAoB,QAAQ,uCAAsC;AAC3E,SAASC,cAAc,QAAQ,oCAAmC;AAElE,OAAO,MAAMC,0BAA0B,CAAC,EACtCC,MAAM,EACNC,OAAO,EAIR;IACC,MAAMC,2BAAqD,EAAE;IAE7D,KAAK,MAAMC,SAASF,QAAS;QAC3B,MAAMG,YAAoC;YAAEJ,QAAQ,EAAE;YAAEK,QAAQF,MAAME,MAAM,IAAI;QAAM;QACtF,KAAK,MAAMC,QAAQH,MAAMH,MAAM,CAAE;YAC/B,MAAMO,SAAST,eAAe;gBAAEE;gBAAQM;YAAK;YAE7C,IAAI,CAACC,QAAQ;gBACX,MAAM,IAAIV,qBAAqB,CAAC,MAAM,EAAES,KAAK,cAAc,CAAC;YAC9D;YAEA,MAAM,EAAEE,KAAK,EAAEC,aAAa,EAAEC,gBAAgB,EAAE,GAAGH;YAEnD,IAAI;gBAAC;gBAAS;gBAAU;gBAAS;aAAM,CAACI,QAAQ,CAACH,MAAMI,IAAI,GAAG;gBAC5D,MAAM,IAAIf,qBACR,CAAC,kBAAkB,EAAEW,MAAMI,IAAI,CAAC,sBAAsB,EAAEH,eAAe;YAE3E;YAEAL,UAAUJ,MAAM,CAACa,IAAI,CAAC;gBAAEL;gBAAOC;gBAAeH;gBAAMI;YAAiB;QACvE;QAEAR,yBAAyBW,IAAI,CAACT;IAChC;IAEA,OAAOF;AACT,EAAC"}

View File

@@ -0,0 +1,155 @@
import ObjectIdImport from 'bson-objectid';
import { JobCancelledError, TaskError } from '../../../errors/index.js';
import { getCurrentDate } from '../../../utilities/getCurrentDate.js';
import { getTaskHandlerFromConfig } from './importHandlerPath.js';
const ObjectId = 'default' in ObjectIdImport ? ObjectIdImport.default : ObjectIdImport;
export const getRunTaskFunction = (job, workflowConfig, req, isInline, updateJob, parent)=>{
const jobConfig = req.payload.config.jobs;
const runTask = (taskSlug)=>async (taskID, { input, retries, // Only available for inline tasks:
task })=>{
const executedAt = getCurrentDate();
let taskConfig;
if (!isInline) {
taskConfig = jobConfig.tasks?.length && jobConfig.tasks.find((t)=>t.slug === taskSlug);
if (!taskConfig) {
throw new Error(`Task ${taskSlug} not found in workflow ${job.workflowSlug}`);
}
}
const retriesConfigFromPropsNormalized = retries == undefined || retries == null ? {} : typeof retries === 'number' ? {
attempts: retries
} : retries;
const retriesConfigFromTaskConfigNormalized = taskConfig ? typeof taskConfig.retries === 'number' ? {
attempts: taskConfig.retries
} : taskConfig.retries : {};
const finalRetriesConfig = {
...retriesConfigFromTaskConfigNormalized,
...retriesConfigFromPropsNormalized
};
const taskStatus = job?.taskStatus?.[taskSlug] ? job.taskStatus[taskSlug][taskID] : null;
// Handle restoration of task if it succeeded in a previous run
if (taskStatus && taskStatus.complete === true) {
let shouldRestore = true;
if (finalRetriesConfig?.shouldRestore === false) {
shouldRestore = false;
} else if (typeof finalRetriesConfig?.shouldRestore === 'function') {
shouldRestore = await finalRetriesConfig.shouldRestore({
input,
job,
req,
taskStatus
});
}
if (shouldRestore) {
return taskStatus.output;
}
}
const runner = isInline ? task : await getTaskHandlerFromConfig(taskConfig);
if (!runner || typeof runner !== 'function') {
throw new TaskError({
executedAt,
input,
job,
message: isInline ? `Inline task with ID ${taskID} does not have a valid handler.` : `Task with slug ${taskSlug} in workflow ${job.workflowSlug} does not have a valid handler.`,
parent,
retriesConfig: finalRetriesConfig,
taskConfig,
taskID,
taskSlug,
taskStatus,
workflowConfig
});
}
let taskHandlerResult;
let output = {};
try {
taskHandlerResult = await runner({
inlineTask: getRunTaskFunction(job, workflowConfig, req, true, updateJob, {
taskID,
taskSlug
}),
input,
job: job,
req,
tasks: getRunTaskFunction(job, workflowConfig, req, false, updateJob, {
taskID,
taskSlug
})
});
} catch (err) {
if (err instanceof JobCancelledError) {
// Re-throw JobCancelledError to be handled by the top-level error handler
throw err;
}
throw new TaskError({
executedAt,
input: input,
job,
message: err.message || 'Task handler threw an error',
output,
parent,
retriesConfig: finalRetriesConfig,
taskConfig,
taskID,
taskSlug,
taskStatus,
workflowConfig
});
}
if (taskHandlerResult.state === 'failed') {
throw new TaskError({
executedAt,
input: input,
job,
message: taskHandlerResult.errorMessage ?? 'Task handler returned a failed state',
output,
parent,
retriesConfig: finalRetriesConfig,
taskConfig,
taskID,
taskSlug,
taskStatus,
workflowConfig
});
} else {
output = taskHandlerResult.output;
}
if (taskConfig?.onSuccess) {
await taskConfig.onSuccess({
input,
job,
req,
taskStatus
});
}
const newLogItem = {
id: new ObjectId().toHexString(),
completedAt: getCurrentDate().toISOString(),
executedAt: executedAt.toISOString(),
input,
output,
parent: jobConfig.addParentToTaskLog ? parent : undefined,
state: 'succeeded',
taskID,
taskSlug
};
await updateJob({
log: {
$push: newLogItem
},
// Set to null to skip main row update on postgres. 2 => 1 db round trips
updatedAt: null
});
return output;
};
if (isInline) {
return runTask('inline');
} else {
const tasks = {};
for (const task of jobConfig.tasks ?? []){
tasks[task.slug] = runTask(task.slug);
}
return tasks;
}
};
//# sourceMappingURL=getRunTaskFunction.js.map

View File

@@ -0,0 +1,27 @@
extends: eslint:recommended
env:
node: true
browser: true
rules:
block-scoped-var: 2
complexity: [2, 15]
curly: [2, multi-or-nest, consistent]
dot-location: [2, property]
dot-notation: 2
indent: [2, 2, SwitchCase: 1]
linebreak-style: [2, unix]
new-cap: 2
no-console: [2, allow: [warn, error]]
no-else-return: 2
no-eq-null: 2
no-fallthrough: 2
no-invalid-this: 2
no-return-assign: 2
no-shadow: 1
no-trailing-spaces: 2
no-use-before-define: [2, nofunc]
quotes: [2, single, avoid-escape]
semi: [2, always]
strict: [2, global]
valid-jsdoc: [2, requireReturn: false]
no-control-regex: 0

View File

@@ -0,0 +1,84 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var casing_exports = {};
__export(casing_exports, {
CasingCache: () => CasingCache,
toCamelCase: () => toCamelCase,
toSnakeCase: () => toSnakeCase
});
module.exports = __toCommonJS(casing_exports);
var import_entity = require("./entity.cjs");
var import_table = require("./table.cjs");
function toSnakeCase(input) {
const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
return words.map((word) => word.toLowerCase()).join("_");
}
function toCamelCase(input) {
const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
return words.reduce((acc, word, i) => {
const formattedWord = i === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`;
return acc + formattedWord;
}, "");
}
function noopCase(input) {
return input;
}
class CasingCache {
static [import_entity.entityKind] = "CasingCache";
/** @internal */
cache = {};
cachedTables = {};
convert;
constructor(casing) {
this.convert = casing === "snake_case" ? toSnakeCase : casing === "camelCase" ? toCamelCase : noopCase;
}
getColumnCasing(column) {
if (!column.keyAsName) return column.name;
const schema = column.table[import_table.Table.Symbol.Schema] ?? "public";
const tableName = column.table[import_table.Table.Symbol.OriginalName];
const key = `${schema}.${tableName}.${column.name}`;
if (!this.cache[key]) {
this.cacheTable(column.table);
}
return this.cache[key];
}
cacheTable(table) {
const schema = table[import_table.Table.Symbol.Schema] ?? "public";
const tableName = table[import_table.Table.Symbol.OriginalName];
const tableKey = `${schema}.${tableName}`;
if (!this.cachedTables[tableKey]) {
for (const column of Object.values(table[import_table.Table.Symbol.Columns])) {
const columnKey = `${tableKey}.${column.name}`;
this.cache[columnKey] = this.convert(column.name);
}
this.cachedTables[tableKey] = true;
}
}
clearCache() {
this.cache = {};
this.cachedTables = {};
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CasingCache,
toCamelCase,
toSnakeCase
});
//# sourceMappingURL=casing.cjs.map

View File

@@ -0,0 +1,40 @@
import { RestCommand } from "../../types.cjs";
//#region src/rest/commands/utils/deployment.d.ts
interface TriggerDeploymentResult {
id: string;
external_id: string;
project: string;
target: string;
status: 'building' | 'ready' | 'error' | 'canceled';
url?: string;
date_created: string;
}
interface TriggerDeploymentOptions {
preview?: boolean;
clear_cache?: boolean;
}
/**
* Trigger a new deployment for a project.
*
* @param provider The provider type (e.g. 'vercel')
* @param projectId The project ID to deploy
* @param options Deployment options (preview, clear_cache)
*
* @returns The deployment trigger result with deployment ID and status.
* @throws Will throw if provider or projectId is empty
*/
declare const triggerDeployment: <Schema>(provider: string, projectId: string, options?: TriggerDeploymentOptions) => RestCommand<TriggerDeploymentResult, Schema>;
/**
* Cancel a deployment run.
*
* @param provider The provider type (e.g. 'vercel')
* @param runId The run ID to cancel
*
* @returns The updated run object.
* @throws Will throw if provider or runId is empty
*/
declare const cancelDeployment: <Schema>(provider: string, runId: string) => RestCommand<TriggerDeploymentResult, Schema>;
//#endregion
export { TriggerDeploymentOptions, TriggerDeploymentResult, cancelDeployment, triggerDeployment };
//# sourceMappingURL=deployment.d.cts.map

View File

@@ -0,0 +1 @@
{"39":"0.20","40":"0.21","41":"0.21","42":"0.25","43":"0.27","44":"0.30","45":"0.31","47":"0.36","49":"0.37","50":"1.1","51":"1.2","52":"1.3","53":"1.4","54":"1.4","56":"1.6","58":"1.7","59":"1.8","61":"2.0","66":"3.0","69":"4.0","72":"5.0","73":"5.0","76":"6.0","78":"7.0","79":"8.0","80":"8.0","82":"9.0","83":"9.0","84":"10.0","85":"10.0","86":"11.0","87":"11.0","89":"12.0","90":"13.0","91":"13.0","92":"14.0","93":"14.0","94":"15.0","95":"16.0","96":"16.0","98":"17.0","99":"18.0","100":"18.0","102":"19.0","103":"20.0","104":"20.0","105":"21.0","106":"21.0","107":"22.0","108":"22.0","110":"23.0","111":"24.0","112":"24.0","114":"25.0","116":"26.0","118":"27.0","119":"28.0","120":"28.0","121":"29.0","122":"29.0","123":"30.0","124":"30.0","125":"31.0","126":"31.0","127":"32.0","128":"32.0","129":"33.0","130":"33.0","131":"34.0","132":"34.0","133":"35.0","134":"35.0","135":"36.0","136":"36.0","137":"37.0","138":"37.0","139":"38.0","140":"38.0","141":"39.0","142":"39.0","143":"40.0","144":"40.0","146":"41.0"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"featureFlagsIntegration.d.ts","sourceRoot":"","sources":["../../../../src/integrations/featureFlags/featureFlagsIntegration.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAOrF,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,uBAAuB,EAa9B,aAAa,CAAC,uBAAuB,CAAC,CAAC"}

View File

@@ -0,0 +1 @@
import{cache as o}from"react";const n=o((function(){return{locale:void 0}}));function t(){return n().locale}function c(o){n().locale=o}export{t as getCachedRequestLocale,c as setCachedRequestLocale};

View File

@@ -0,0 +1,18 @@
import { GraphQLEnumType } from 'graphql';
import { formatName } from '../utilities/formatName.js';
export const buildFallbackLocaleInputType = (localization)=>{
return new GraphQLEnumType({
name: 'FallbackLocaleInputType',
values: [
...localization.localeCodes,
'none'
].reduce((values, locale)=>({
...values,
[formatName(locale)]: {
value: locale
}
}), {})
});
};
//# sourceMappingURL=buildFallbackLocaleInputType.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/pg-core/columns/double-precision.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyPgTable } from '~/pg-core/table.ts';\nimport { PgColumn, PgColumnBuilder } from './common.ts';\n\nexport type PgDoublePrecisionBuilderInitial<TName extends string> = PgDoublePrecisionBuilder<{\n\tname: TName;\n\tdataType: 'number';\n\tcolumnType: 'PgDoublePrecision';\n\tdata: number;\n\tdriverParam: string | number;\n\tenumValues: undefined;\n}>;\n\nexport class PgDoublePrecisionBuilder<T extends ColumnBuilderBaseConfig<'number', 'PgDoublePrecision'>>\n\textends PgColumnBuilder<T>\n{\n\tstatic override readonly [entityKind]: string = 'PgDoublePrecisionBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'number', 'PgDoublePrecision');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyPgTable<{ name: TTableName }>,\n\t): PgDoublePrecision<MakeColumnConfig<T, TTableName>> {\n\t\treturn new PgDoublePrecision<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class PgDoublePrecision<T extends ColumnBaseConfig<'number', 'PgDoublePrecision'>> extends PgColumn<T> {\n\tstatic override readonly [entityKind]: string = 'PgDoublePrecision';\n\n\tgetSQLType(): string {\n\t\treturn 'double precision';\n\t}\n\n\toverride mapFromDriverValue(value: string | number): number {\n\t\tif (typeof value === 'string') {\n\t\t\treturn Number.parseFloat(value);\n\t\t}\n\t\treturn value;\n\t}\n}\n\nexport function doublePrecision(): PgDoublePrecisionBuilderInitial<''>;\nexport function doublePrecision<TName extends string>(name: TName): PgDoublePrecisionBuilderInitial<TName>;\nexport function doublePrecision(name?: string) {\n\treturn new PgDoublePrecisionBuilder(name ?? '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAE3B,oBAA0C;AAWnC,MAAM,iCACJ,8BACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB;AAC5B,UAAM,MAAM,UAAU,mBAAmB;AAAA,EAC1C;AAAA;AAAA,EAGS,MACR,OACqD;AACrD,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,0BAAqF,uBAAY;AAAA,EAC7G,QAA0B,wBAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AAAA,EAES,mBAAmB,OAAgC;AAC3D,QAAI,OAAO,UAAU,UAAU;AAC9B,aAAO,OAAO,WAAW,KAAK;AAAA,IAC/B;AACA,WAAO;AAAA,EACR;AACD;AAIO,SAAS,gBAAgB,MAAe;AAC9C,SAAO,IAAI,yBAAyB,QAAQ,EAAE;AAC/C;","names":[]}

View File

@@ -0,0 +1,75 @@
{
"name": "resolve",
"description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
"version": "1.22.11",
"repository": {
"type": "git",
"url": "ssh://github.com/browserify/resolve.git"
},
"bin": {
"resolve": "./bin/resolve"
},
"main": "index.js",
"keywords": [
"resolve",
"require",
"node",
"module"
],
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated && cp node_modules/is-core-module/core.json ./lib/ ||:",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
"lint": "eslint --ext=js,mjs --no-eslintrc -c .eslintrc . 'bin/**'",
"pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async",
"tests-only": "tape test/*.js",
"pretest": "npm run lint",
"test": "npm run --silent tests-only",
"posttest": "npm run test:multirepo && npx npm@'>= 10.2' audit --production",
"test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test"
},
"devDependencies": {
"@ljharb/eslint-config": "^21.2.0",
"array.prototype.map": "^1.0.8",
"copy-dir": "^1.3.0",
"eclint": "^2.8.1",
"eslint": "=8.8.0",
"in-publish": "^2.0.1",
"mkdirp": "^0.5.5",
"mv": "^2.1.1",
"npmignore": "^0.3.1",
"object-keys": "^1.1.1",
"rimraf": "^2.7.1",
"safe-publish-latest": "^2.0.0",
"semver": "^6.3.1",
"tap": "0.4.13",
"tape": "^5.9.0",
"tmp": "^0.0.31"
},
"license": "MIT",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"dependencies": {
"is-core-module": "^2.16.1",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
},
"publishConfig": {
"ignore": [
".github/workflows",
"appveyor.yml",
"test/resolver/malformed_package_json",
"test/list-exports"
]
},
"engines": {
"node": ">= 0.4"
}
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/durable-sqlite/driver.ts"],"sourcesContent":["/// <reference types=\"@cloudflare/workers-types\" />\nimport { entityKind } from '~/entity.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport {\n\tcreateTableRelationsHelpers,\n\textractTablesRelationalConfig,\n\ttype ExtractTablesWithRelations,\n\ttype RelationalSchemaConfig,\n\ttype TablesRelationalConfig,\n} from '~/relations.ts';\nimport { BaseSQLiteDatabase } from '~/sqlite-core/db.ts';\nimport { SQLiteSyncDialect } from '~/sqlite-core/dialect.ts';\nimport type { DrizzleConfig } from '~/utils.ts';\nimport { SQLiteDOSession } from './session.ts';\n\nexport class DrizzleSqliteDODatabase<\n\tTSchema extends Record<string, unknown> = Record<string, never>,\n> extends BaseSQLiteDatabase<'sync', SqlStorageCursor<Record<string, SqlStorageValue>>, TSchema> {\n\tstatic override readonly [entityKind]: string = 'DrizzleSqliteDODatabase';\n\n\t/** @internal */\n\tdeclare readonly session: SQLiteDOSession<TSchema, ExtractTablesWithRelations<TSchema>>;\n}\n\nexport function drizzle<\n\tTSchema extends Record<string, unknown> = Record<string, never>,\n\tTClient extends DurableObjectStorage = DurableObjectStorage,\n>(\n\tclient: TClient,\n\tconfig: DrizzleConfig<TSchema> = {},\n): DrizzleSqliteDODatabase<TSchema> & {\n\t$client: TClient;\n} {\n\tconst dialect = new SQLiteSyncDialect({ casing: config.casing });\n\tlet logger;\n\tif (config.logger === true) {\n\t\tlogger = new DefaultLogger();\n\t} else if (config.logger !== false) {\n\t\tlogger = config.logger;\n\t}\n\n\tlet schema: RelationalSchemaConfig<TablesRelationalConfig> | undefined;\n\tif (config.schema) {\n\t\tconst tablesConfig = extractTablesRelationalConfig(\n\t\t\tconfig.schema,\n\t\t\tcreateTableRelationsHelpers,\n\t\t);\n\t\tschema = {\n\t\t\tfullSchema: config.schema,\n\t\t\tschema: tablesConfig.tables,\n\t\t\ttableNamesMap: tablesConfig.tableNamesMap,\n\t\t};\n\t}\n\n\tconst session = new SQLiteDOSession(client as DurableObjectStorage, dialect, schema, { logger });\n\tconst db = new DrizzleSqliteDODatabase('sync', dialect, session, schema) as DrizzleSqliteDODatabase<TSchema>;\n\t(<any> db).$client = client;\n\n\treturn db as any;\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B;AAAA,EACC;AAAA,EACA;AAAA,OAIM;AACP,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAElC,SAAS,uBAAuB;AAEzB,MAAM,gCAEH,mBAAuF;AAAA,EAChG,QAA0B,UAAU,IAAY;AAIjD;AAEO,SAAS,QAIf,QACA,SAAiC,CAAC,GAGjC;AACD,QAAM,UAAU,IAAI,kBAAkB,EAAE,QAAQ,OAAO,OAAO,CAAC;AAC/D,MAAI;AACJ,MAAI,OAAO,WAAW,MAAM;AAC3B,aAAS,IAAI,cAAc;AAAA,EAC5B,WAAW,OAAO,WAAW,OAAO;AACnC,aAAS,OAAO;AAAA,EACjB;AAEA,MAAI;AACJ,MAAI,OAAO,QAAQ;AAClB,UAAM,eAAe;AAAA,MACpB,OAAO;AAAA,MACP;AAAA,IACD;AACA,aAAS;AAAA,MACR,YAAY,OAAO;AAAA,MACnB,QAAQ,aAAa;AAAA,MACrB,eAAe,aAAa;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,UAAU,IAAI,gBAAgB,QAAgC,SAAS,QAAQ,EAAE,OAAO,CAAC;AAC/F,QAAM,KAAK,IAAI,wBAAwB,QAAQ,SAAS,SAAS,MAAM;AACvE,EAAO,GAAI,UAAU;AAErB,SAAO;AACR;","names":[]}

View File

@@ -0,0 +1,28 @@
import { addMonths } from "./addMonths.mjs";
/**
* @name addYears
* @category Year Helpers
* @summary Add the specified number of years to the given date.
*
* @description
* Add the specified number of years to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param amount - The amount of years to be added.
*
* @returns The new date with the years added
*
* @example
* // Add 5 years to 1 September 2014:
* const result = addYears(new Date(2014, 8, 1), 5)
* //=> Sun Sep 01 2019 00:00:00
*/
export function addYears(date, amount) {
return addMonths(date, amount * 12);
}
// Fallback for modularized imports:
export default addYears;

View File

@@ -0,0 +1,6 @@
function _tagged_template_literal(strings, raw) {
if (!raw) raw = strings.slice(0);
return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } }));
}
export { _tagged_template_literal as _ };

View File

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

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 BookUp2 = createLucideIcon("BookUp2", [
["path", { d: "M12 13V7", key: "h0r20n" }],
["path", { d: "M18 2h1a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20", key: "161d7n" }],
["path", { d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2", key: "1lorq7" }],
["path", { d: "m9 10 3-3 3 3", key: "11gsxs" }],
["path", { d: "m9 5 3-3 3 3", key: "l8vdw6" }]
]);
export { BookUp2 as default };
//# sourceMappingURL=book-up-2.js.map

View File

@@ -0,0 +1 @@
module.exports={C:{"5":0.06167,"140":0.06167,"144":0.01028,"145":0.26723,"146":0.12334,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 141 142 143 147 148 149 3.5 3.6"},D:{"69":0.04625,"98":0.01542,"103":0.15931,"107":0.01028,"109":0.1182,"111":0.10278,"112":0.17473,"114":0.01028,"116":0.01542,"117":0.01028,"120":0.01028,"123":0.01028,"125":0.71432,"126":0.06167,"127":0.28265,"131":0.04111,"132":0.05653,"133":0.0257,"135":0.04111,"136":0.01028,"137":0.01028,"138":0.12334,"139":0.08736,"140":0.13361,"141":3.82342,"142":6.40319,"143":11.07455,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 99 100 101 102 104 105 106 108 110 113 115 118 119 121 122 124 128 129 130 134 144 145 146"},F:{"123":0.01028,"124":0.71432,"125":0.14389,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"131":0.01028,"132":0.01028,"140":0.04625,"141":0.08736,"142":1.98879,"143":3.95189,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 133 134 135 136 137 138 139"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 15.2-15.3 15.4 15.5 16.0 17.0 18.0","14.1":0.0257,"15.1":0.01028,"15.6":1.80893,"16.1":0.1182,"16.2":0.04111,"16.3":0.01028,"16.4":0.05653,"16.5":0.07195,"16.6":1.28989,"17.1":1.0535,"17.2":0.0257,"17.3":0.32376,"17.4":0.1182,"17.5":0.13361,"17.6":2.93951,"18.1":0.06167,"18.2":0.04625,"18.3":0.03083,"18.4":0.04111,"18.5-18.6":0.26723,"26.0":0.0925,"26.1":1.28989,"26.2":0.1182,"26.3":0.01028},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0054,"5.0-5.1":0,"6.0-6.1":0.01081,"7.0-7.1":0.0081,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.02161,"10.0-10.2":0.0027,"10.3":0.03782,"11.0-11.2":0.46462,"11.3-11.4":0.01351,"12.0-12.1":0.01081,"12.2-12.5":0.12156,"13.0-13.1":0.0027,"13.2":0.01891,"13.3":0.0054,"13.4-13.7":0.01891,"14.0-14.4":0.03782,"14.5-14.8":0.04052,"15.0-15.1":0.04322,"15.2-15.3":0.03242,"15.4":0.03512,"15.5":0.03782,"15.6-15.8":0.58617,"16.0":0.06753,"16.1":0.12966,"16.2":0.06753,"16.3":0.12156,"16.4":0.02971,"16.5":0.05132,"16.6-16.7":0.76175,"17.0":0.04322,"17.1":0.07023,"17.2":0.05132,"17.3":0.07834,"17.4":0.13236,"17.5":0.25932,"17.6-17.7":0.59968,"18.0":0.13506,"18.1":0.28093,"18.2":0.14857,"18.3":0.48353,"18.4":0.24852,"18.5-18.7":17.84451,"26.0":0.34846,"26.1":2.89845,"26.2":0.55106,"26.3":0.02431},P:{"4":0.10607,"24":0.01061,"25":0.66825,"26":0.03182,"27":0.02121,"28":0.24397,"29":2.32297,_:"20 21 22 23 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.03182},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":0.01458,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":24.23528},R:{_:"0"},M:{"0":0.01458}};

View File

@@ -0,0 +1,33 @@
https://github.com/vallezw/sonner/assets/50796600/59b95cb7-9068-4f3e-8469-0b35d9de5cf0
[Sonner](https://sonner.emilkowal.ski/) is an opinionated toast component for React. You can read more about why and how it was built [here](https://emilkowal.ski/ui/building-a-toast-component).
## Usage
To start using the library, install it in your project:
```bash
npm install sonner
```
Add `<Toaster />` to your app, it will be the place where all your toasts will be rendered.
After that you can use `toast()` from anywhere in your app.
```jsx
import { Toaster, toast } from 'sonner';
// ...
function App() {
return (
<div>
<Toaster />
<button onClick={() => toast('My first toast')}>Give me a toast</button>
</div>
);
}
```
## Documentation
Find the full API reference in the [documentation](https://sonner.emilkowal.ski/getting-started).

View File

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

View File

@@ -0,0 +1,147 @@
import * as React from 'react'
import isDevelopment from '#is-development'
import { withEmotionCache } from './context'
import { Theme, ThemeContext } from './theming'
import { insertStyles } from '@emotion/utils'
import { Options as SheetOptions, StyleSheet } from '@emotion/sheet'
import isBrowser from '#is-browser'
import { useInsertionEffectWithLayoutFallback } from '@emotion/use-insertion-effect-with-fallbacks'
import { Interpolation, serializeStyles } from '@emotion/serialize'
export interface GlobalProps {
styles: Interpolation<Theme>
}
let warnedAboutCssPropForGlobal = false
// maintain place over rerenders.
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
// initial client-side render from SSR, use place of hydrating tag
export let Global = /* #__PURE__ */ withEmotionCache<GlobalProps>(
(props, cache) => {
if (
isDevelopment &&
!warnedAboutCssPropForGlobal && // check for className as well since the user is
// probably using the custom createElement which
// means it will be turned into a className prop
// I don't really want to add it to the type since it shouldn't be used
(('className' in props && props.className) ||
('css' in props && props.css))
) {
console.error(
"It looks like you're using the css prop on Global, did you mean to use the styles prop instead?"
)
warnedAboutCssPropForGlobal = true
}
let styles = props.styles
let serialized = serializeStyles(
[styles],
undefined,
React.useContext(ThemeContext)
)
if (!isBrowser) {
let serializedNames = serialized.name
let serializedStyles = serialized.styles
let next = serialized.next
while (next !== undefined) {
serializedNames += ' ' + next.name
serializedStyles += next.styles
next = next.next
}
let shouldCache = cache.compat === true
let rules = cache.insert(
``,
{ name: serializedNames, styles: serializedStyles },
cache.sheet,
shouldCache
)
if (shouldCache) {
return null
}
return (
<style
{...{
[`data-emotion`]: `${cache.key}-global ${serializedNames}`,
dangerouslySetInnerHTML: { __html: rules! },
nonce: cache.sheet.nonce
}}
/>
)
}
// yes, i know these hooks are used conditionally
// but it is based on a constant that will never change at runtime
// it's effectively like having two implementations and switching them out
// so it's not actually breaking anything
let sheetRef = React.useRef<
[sheet: StyleSheet, isRehydrating: boolean] | undefined
>()
useInsertionEffectWithLayoutFallback(() => {
const key = `${cache.key}-global`
// use case of https://github.com/emotion-js/emotion/issues/2675
let sheet = new (cache.sheet.constructor as {
new (options: SheetOptions): StyleSheet
})({
key,
nonce: cache.sheet.nonce,
container: cache.sheet.container,
speedy: cache.sheet.isSpeedy
})
let rehydrating = false
let node: HTMLStyleElement | null = document.querySelector(
`style[data-emotion="${key} ${serialized.name}"]`
)
if (cache.sheet.tags.length) {
sheet.before = cache.sheet.tags[0]
}
if (node !== null) {
rehydrating = true
// clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
node.setAttribute('data-emotion', key)
sheet.hydrate([node])
}
sheetRef.current = [sheet, rehydrating]
return () => {
sheet.flush()
}
}, [cache])
useInsertionEffectWithLayoutFallback(() => {
let sheetRefCurrent = sheetRef.current!
let [sheet, rehydrating] = sheetRefCurrent
if (rehydrating) {
sheetRefCurrent[1] = false
return
}
if (serialized.next !== undefined) {
// insert keyframes
insertStyles(cache, serialized.next, true)
}
if (sheet.tags.length) {
// if this doesn't exist then it will be null so the style element will be appended
let element = sheet.tags[sheet.tags.length - 1].nextElementSibling
sheet.before = element
sheet.flush()
}
cache.insert(``, serialized, sheet, false)
}, [cache, serialized.name])
return null
}
)
if (isDevelopment) {
Global.displayName = 'EmotionGlobal'
}

View File

@@ -0,0 +1,72 @@
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
// src/code-inline.tsx
import * as React from "react";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
var CodeInline = React.forwardRef(
(_a, ref) => {
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx("style", { children: `
meta ~ .cino {
display: none !important;
opacity: 0 !important;
}
meta ~ .cio {
display: block !important;
}
` }),
/* @__PURE__ */ jsx(
"code",
__spreadProps(__spreadValues({}, props), {
className: `${props.className ? props.className : ""} cino`,
children
})
),
/* @__PURE__ */ jsx(
"span",
__spreadProps(__spreadValues({}, props), {
className: `${props.className ? props.className : ""} cio`,
ref,
style: __spreadValues({ display: "none" }, props.style),
children
})
)
] });
}
);
CodeInline.displayName = "CodeInline";
export {
CodeInline
};

View File

@@ -0,0 +1,33 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ModuleDependency = require("../dependencies/ModuleDependency");
const makeSerializable = require("../util/makeSerializable");
class ProvideForSharedDependency extends ModuleDependency {
/**
* @param {string} request request string
*/
constructor(request) {
super(request);
}
get type() {
return "provide module for shared";
}
get category() {
return "esm";
}
}
makeSerializable(
ProvideForSharedDependency,
"webpack/lib/sharing/ProvideForSharedDependency"
);
module.exports = ProvideForSharedDependency;

View File

@@ -0,0 +1,2 @@
export declare function useDebounce<T = unknown>(value: T, delay: number): T;
//# sourceMappingURL=useDebounce.d.ts.map

View File

@@ -0,0 +1,117 @@
import { buildVersionCollectionFields, buildVersionCompoundIndexes, buildVersionGlobalFields } from 'payload';
import { hasDraftsEnabled } from 'payload/shared';
import toSnakeCase from 'to-snake-case';
import { createTableName } from '../createTableName.js';
import { buildIndexName } from '../utilities/buildIndexName.js';
import { buildTable } from './build.js';
/**
* Builds abstract Payload SQL schema
*/ export const buildRawSchema = ({ adapter, setColumnID })=>{
adapter.indexes = new Set();
adapter.foreignKeys = new Set();
adapter.payload.config.collections.forEach((collection)=>{
createTableName({
adapter,
config: collection
});
if (collection.versions) {
createTableName({
adapter,
config: collection,
versions: true,
versionsCustomName: true
});
}
});
adapter.payload.config.collections.forEach((collection)=>{
const tableName = adapter.tableNameMap.get(toSnakeCase(collection.slug));
const config = adapter.payload.config;
const baseIndexes = {};
if (collection.upload.filenameCompoundIndex) {
const indexName = buildIndexName({
name: `${tableName}_filename_compound`,
adapter
});
baseIndexes.filename_compound_index = {
name: indexName,
on: collection.upload.filenameCompoundIndex.map((f)=>f),
unique: true
};
}
buildTable({
adapter,
baseIndexes,
blocksTableNameMap: {},
compoundIndexes: collection.sanitizedIndexes,
disableNotNull: !!collection?.versions?.drafts,
disableUnique: false,
fields: collection.flattenedFields,
parentIsLocalized: false,
setColumnID,
tableName,
timestamps: collection.timestamps,
versions: false
});
if (collection.versions) {
const versionsTableName = adapter.tableNameMap.get(`_${toSnakeCase(collection.slug)}${adapter.versionsSuffix}`);
const versionFields = buildVersionCollectionFields(config, collection, true);
buildTable({
adapter,
blocksTableNameMap: {},
compoundIndexes: buildVersionCompoundIndexes({
indexes: collection.sanitizedIndexes
}),
disableNotNull: !!collection.versions?.drafts,
disableUnique: true,
fields: versionFields,
parentIsLocalized: false,
setColumnID,
tableName: versionsTableName,
timestamps: true,
versions: true
});
}
});
adapter.payload.config.globals.forEach((global)=>{
const tableName = createTableName({
adapter,
config: global
});
buildTable({
adapter,
blocksTableNameMap: {},
disableNotNull: hasDraftsEnabled(global),
disableUnique: false,
fields: global.flattenedFields,
parentIsLocalized: false,
setColumnID,
tableName,
timestamps: false,
versions: false
});
if (global.versions) {
const versionsTableName = createTableName({
adapter,
config: global,
versions: true,
versionsCustomName: true
});
const config = adapter.payload.config;
const versionFields = buildVersionGlobalFields(config, global, true);
buildTable({
adapter,
blocksTableNameMap: {},
disableNotNull: !!global.versions?.drafts,
disableUnique: true,
fields: versionFields,
parentIsLocalized: false,
setColumnID,
tableName: versionsTableName,
timestamps: true,
versions: true
});
}
});
};
//# sourceMappingURL=buildRawSchema.js.map

View File

@@ -0,0 +1,4 @@
export declare const isLeapYear: import("./types.js").FPFn1<
boolean,
string | number | Date
>;

View File

@@ -0,0 +1,141 @@
@import '../../scss/styles.scss';
@layer payload-default {
.file-field {
position: relative;
margin-bottom: var(--base);
background: var(--theme-elevation-50);
border-radius: var(--style-radius-s);
&__upload {
display: flex;
}
.tooltip.error-message {
z-index: 3;
bottom: calc(100% - #{calc(var(--base) * 0.5)});
}
&__file-selected {
display: flex;
}
&__thumbnail-wrap {
position: relative;
width: 150px;
.thumbnail {
position: relative;
width: 100%;
height: 100%;
object-fit: contain;
border-radius: var(--style-radius-s) 0 0 var(--style-radius-s);
}
}
&__remove {
margin: calc($baseline * 1.5) $baseline $baseline 0;
place-self: flex-start;
}
&__file-adjustments,
&__remote-file-wrap {
padding: $baseline;
width: 100%;
display: flex;
flex-direction: column;
gap: calc(var(--base) / 2);
}
&__filename,
&__remote-file {
@include formInput;
background-color: var(--theme-bg);
}
&__upload-actions,
&__add-file-wrap {
display: flex;
gap: calc(var(--base) / 2);
flex-wrap: wrap;
}
&__upload-actions {
margin-top: calc(var(--base) * 0.5);
}
&__previewDrawer {
& h2 {
margin: 0 var(--base) 0 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: calc(100% - calc(var(--base) * 2));
}
}
.dropzone {
background-color: transparent;
padding-block: calc(var(--base) * 2.25);
}
&__dropzoneContent {
display: flex;
flex-wrap: wrap;
gap: calc(var(--base) * 0.4);
justify-content: space-between;
width: 100%;
}
&__dropzoneButtons {
display: flex;
gap: calc(var(--base) * 0.5);
align-items: center;
}
&__orText {
color: var(--theme-elevation-500);
text-transform: lowercase;
}
&__dragAndDropText {
flex-shrink: 0;
margin: 0;
text-transform: lowercase;
align-self: center;
color: var(--theme-elevation-500);
}
@include small-break {
&__upload {
flex-wrap: wrap;
justify-content: space-between;
}
&__remove {
margin: $baseline;
order: 2;
}
&__file-adjustments {
order: 3;
border-top: 2px solid var(--theme-elevation-0);
padding: calc($baseline * 0.5);
gap: 0;
}
&__thumbnail-wrap {
order: 1;
width: 50%;
.thumbnail {
width: 100%;
}
}
&__edit {
display: none;
}
}
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"getDocumentViewInfo.d.ts","sourceRoot":"","sources":["../../../src/views/Root/getDocumentViewInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAE9D,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG;IACvD,mBAAmB,CAAC,EAAE,oBAAoB,CAAA;IAC1C,QAAQ,EAAE,SAAS,CAAA;CACpB,CA4BA"}

View File

@@ -0,0 +1,53 @@
# webpack
## Removing unused languages from dynamic import
If a locale is imported dynamically, then all locales from date-fns are loaded by webpack into a bundle (~160kb) or split across the chunks. This prolongs the build process and increases the amount of space taken. However, it is possible to use webpack to trim down languages using [ContextReplacementPlugin].
Let's assume that we have a single point in which supported locales are present:
`config.js`:
```js
// `see date-fns/src/locale` for available locales
export const supportedLocales = ["en-US", "de", "pl", "it"];
```
We could also have a function that formats the date:
```js
const getLocale = (locale) => import(`date-fns-locale/locale/${locale}.js`); // or require() if using CommonJS
const formatDate = (date, formatStyle, locale) => {
return format(date, formatStyle, {
locale: getLocale(locale).default,
});
};
```
In order to exclude unused languages we can use webpacks [ContextReplacementPlugin].
`webpack.config.js`:
```js
import webpack from "webpack";
import { supportedLocales } from "./config.js";
export default config = {
resolve: {
alias: {
"date-fns-locale": path.dirname(require.resolve("date-fns/package.json")),
},
},
plugins: [
new webpack.ContextReplacementPlugin(
/date-fns[/\\]locale/,
new RegExp(`(${locales.join("|")})\.js$`),
),
],
};
```
This results in a language bundle of ~23kb .
[contextreplacementplugin]: https://webpack.js.org/plugins/context-replacement-plugin/

View File

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

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 Castle = createLucideIcon("Castle", [
["path", { d: "M22 20v-9H2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2Z", key: "109fe4" }],
["path", { d: "M18 11V4H6v7", key: "mon5oj" }],
["path", { d: "M15 22v-4a3 3 0 0 0-3-3a3 3 0 0 0-3 3v4", key: "1k4jtn" }],
["path", { d: "M22 11V9", key: "3zbp94" }],
["path", { d: "M2 11V9", key: "1x5rnq" }],
["path", { d: "M6 4V2", key: "1rsq15" }],
["path", { d: "M18 4V2", key: "1jsdo1" }],
["path", { d: "M10 4V2", key: "75d9ly" }],
["path", { d: "M14 4V2", key: "8nj3z6" }]
]);
export { Castle as default };
//# sourceMappingURL=castle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"versions.js","names":[],"sources":["../../../../src/rest/commands/delete/versions.ts"],"sourcesContent":["import type { DirectusVersion } from '../../../schema/version.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing Content Versions.\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deleteContentVersions =\n\t<Schema>(keys: DirectusVersion<Schema>['id'][]): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/versions`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing Content Version.\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deleteContentVersion =\n\t<Schema>(key: DirectusVersion<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(key, 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/versions/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"6DAUA,MAAa,EACH,QAER,EAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,YACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAa,EAAK,sBAAsB,CAEjC,CACN,KAAM,aAAa,IACnB,OAAQ,SACR"}

View File

@@ -0,0 +1,21 @@
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;

View File

@@ -0,0 +1,3 @@
export { metadata, RootLayout } from '../layouts/Root/index.js';
export { handleServerFunctions } from '../utilities/handleServerFunctions.js';
//# sourceMappingURL=layouts.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/generateImportMap/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAO9E,KAAK,gBAAgB,GAAG,MAAM,CAAA;AAC9B,KAAK,eAAe,GAAG,MAAM,CAAA;AAC7B,KAAK,UAAU,GAAG,MAAM,CAAA;AACxB,KAAK,cAAc,GAAG,MAAM,CAAA;AAE5B;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,CAAA;CACzC,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,CAAC,UAAU,EAAE,gBAAgB,GAAG;QAC9B,IAAI,EAAE,UAAU,CAAA;QAChB,SAAS,EAAE,eAAe,CAAA;KAC3B,CAAA;CACF,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,IAAI,EAAE,cAAc,GAAG,GAAG,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,KAAK,IAAI,CAAA;AAE/F,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,OAAO,CAAA,CAAC;;;OAGb;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,GAAG,EAAE,OAAO,CAAA;CACb,GACA,OAAO,CAAC,IAAI,CAAC,CA8Ef;AAED,wBAAsB,cAAc,CAAC,EACnC,YAAY,EACZ,KAAK,EACL,SAAS,EACT,iBAAiB,EACjB,GAAG,GACJ,EAAE;IACD,YAAY,EAAE,iBAAiB,CAAA;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB,iBAAiB,EAAE,MAAM,CAAA;IACzB,GAAG,CAAC,EAAE,OAAO,CAAA;CACd,iBAmCA"}

View File

@@ -0,0 +1,42 @@
import { JobCancelledError } from '../../../errors/index.js';
import { updateJob } from '../../../utilities/updateJob.js';
/**
* Helper for updating a job that does the following, additionally to updating the job:
* - Merges incoming data from the updated job into the original job object
* - Handles job cancellation by throwing a `JobCancelledError` if the job was cancelled.
*/ export function getUpdateJobFunction(job, req) {
return async (jobData)=>{
const updatedJob = await updateJob({
id: job.id,
data: jobData,
depth: req.payload.config.jobs.depth,
disableTransaction: true,
req
});
if (!updatedJob) {
return job;
}
// Update job object like this to modify the original object - that way, incoming changes (e.g. taskStatus field that will be re-generated through the hook) will be reflected in the calling function
for(const key in updatedJob){
if (key === 'log') {
// Add all new log entries to the original job.log object. Do not delete any existing log entries.
// Do not update existing log entries, as existing log entries should be immutable.
for (const logEntry of updatedJob?.log ?? []){
if (!job.log || !job.log.some((entry)=>entry.id === logEntry.id)) {
;
(job.log ??= []).push(logEntry);
}
}
} else {
;
job[key] = updatedJob[key];
}
}
if (updatedJob?.error?.cancelled) {
throw new JobCancelledError(`Job ${job.id} was cancelled`);
}
return updatedJob;
};
}
//# sourceMappingURL=getUpdateJobFunction.js.map

View File

@@ -0,0 +1,43 @@
import type { Context, TextMapGetter, TextMapSetter } from '@opentelemetry/api';
import { W3CBaggagePropagator } from '@opentelemetry/core';
import type { Client, continueTrace, DynamicSamplingContext, Scope } from '@sentry/core';
/**
* Injects and extracts `sentry-trace` and `baggage` headers from carriers.
*/
export declare class SentryPropagator extends W3CBaggagePropagator {
/** A map of URLs that have already been checked for if they match tracePropagationTargets. */
private _urlMatchesTargetsMap;
constructor();
/**
* @inheritDoc
*/
inject(context: Context, carrier: unknown, setter: TextMapSetter): void;
/**
* @inheritDoc
*/
extract(context: Context, carrier: unknown, getter: TextMapGetter): Context;
/**
* @inheritDoc
*/
fields(): string[];
}
export { shouldPropagateTraceForUrl } from '@sentry/core';
/**
* Get propagation injection data for the given context.
* The additional options can be passed to override the scope and client that is otherwise derived from the context.
*/
export declare function getInjectionData(context: Context, options?: {
scope?: Scope;
client?: Client;
}): {
dynamicSamplingContext: Partial<DynamicSamplingContext> | undefined;
traceId: string | undefined;
spanId: string | undefined;
sampled: boolean | undefined;
};
/**
* Takes trace strings and propagates them as a remote active span.
* This should be used in addition to `continueTrace` in OTEL-powered environments.
*/
export declare function continueTraceAsRemoteSpan<T>(ctx: Context, options: Parameters<typeof continueTrace>[0], callback: () => T): T;
//# sourceMappingURL=propagator.d.ts.map

View File

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

View File

@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const MessageSquareHeart = createLucideIcon("MessageSquareHeart", [
["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }],
[
"path",
{
d: "M14.8 7.5a1.84 1.84 0 0 0-2.6 0l-.2.3-.3-.3a1.84 1.84 0 1 0-2.4 2.8L12 13l2.7-2.7c.9-.9.8-2.1.1-2.8",
key: "1blaws"
}
]
]);
export { MessageSquareHeart as default };
//# sourceMappingURL=message-square-heart.js.map

View File

@@ -0,0 +1,3 @@
export { b as binary, f as floatTime, i as intTime, o as omap, p as pairs, s as set, t as timestamp, c as warnFileDeprecation } from './warnings-df54cb69.js';
import './PlainValue-b8036b75.js';
import './resolveSeq-492ab440.js';

View File

@@ -0,0 +1 @@
{"version":3,"file":"arrow-down-up.js","sources":["../../../src/icons/arrow-down-up.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowDownUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMyAxNiA0IDQgNC00IiAvPgogIDxwYXRoIGQ9Ik03IDIwVjQiIC8+CiAgPHBhdGggZD0ibTIxIDgtNC00LTQgNCIgLz4KICA8cGF0aCBkPSJNMTcgNHYxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-down-up\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 ArrowDownUp = createLucideIcon('ArrowDownUp', [\n ['path', { d: 'm3 16 4 4 4-4', key: '1co6wj' }],\n ['path', { d: 'M7 20V4', key: '1yoxec' }],\n ['path', { d: 'm21 8-4-4-4 4', key: '1c9v7m' }],\n ['path', { d: 'M17 4v16', key: '7dpous' }],\n]);\n\nexport default ArrowDownUp;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,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,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,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,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,70 @@
var fs = require('fs');
var path = require('path');
var test = require('tape');
var resolve = require('../');
test('$NODE_PATH', function (t) {
t.plan(8);
var isDir = function (dir, cb) {
if (dir === '/node_path' || dir === 'node_path/x') {
return cb(null, true);
}
fs.stat(dir, function (err, stat) {
if (!err) {
return cb(null, stat.isDirectory());
}
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
return cb(err);
});
};
resolve('aaa', {
paths: [
path.join(__dirname, '/node_path/x'),
path.join(__dirname, '/node_path/y')
],
basedir: __dirname,
isDirectory: isDir
}, function (err, res) {
t.error(err);
t.equal(res, path.join(__dirname, '/node_path/x/aaa/index.js'), 'aaa resolves');
});
resolve('bbb', {
paths: [
path.join(__dirname, '/node_path/x'),
path.join(__dirname, '/node_path/y')
],
basedir: __dirname,
isDirectory: isDir
}, function (err, res) {
t.error(err);
t.equal(res, path.join(__dirname, '/node_path/y/bbb/index.js'), 'bbb resolves');
});
resolve('ccc', {
paths: [
path.join(__dirname, '/node_path/x'),
path.join(__dirname, '/node_path/y')
],
basedir: __dirname,
isDirectory: isDir
}, function (err, res) {
t.error(err);
t.equal(res, path.join(__dirname, '/node_path/x/ccc/index.js'), 'ccc resolves');
});
// ensure that relative paths still resolve against the regular `node_modules` correctly
resolve('tap', {
paths: [
'node_path'
],
basedir: path.join(__dirname, 'node_path/x'),
isDirectory: isDir
}, function (err, res) {
var root = require('tap/package.json').main; // eslint-disable-line global-require
t.error(err);
t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root), 'tap resolves');
});
});

View File

@@ -0,0 +1,20 @@
import { isPromise } from './isPromise.mjs';
/**
* Similar to Array.prototype.reduce(), however the reducing callback may return
* a Promise, in which case reduction will continue after each promise resolves.
*
* If the callback does not return a Promise, then this function will also not
* return a Promise.
*/
export function promiseReduce(values, callbackFn, initialValue) {
let accumulator = initialValue;
for (const value of values) {
accumulator = isPromise(accumulator)
? accumulator.then((resolved) => callbackFn(resolved, value))
: callbackFn(accumulator, value);
}
return accumulator;
}

View File

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

View File

@@ -0,0 +1,14 @@
import type { Args as _Args, GeneratedDatabaseSchema as _GeneratedDatabaseSchema, PostgresAdapter as _PostgresAdapter } from '../types.js';
/**
* @deprecated - import from `@payloadcms/db-postgres` instead
*/
export type Args = _Args;
/**
* @deprecated - import from `@payloadcms/db-postgres` instead
*/
export type GeneratedDatabaseSchema = _GeneratedDatabaseSchema;
/**
* @deprecated - import from `@payloadcms/db-postgres` instead
*/
export type PostgresAdapter = _PostgresAdapter;
//# sourceMappingURL=types-deprecated.d.ts.map

View File

@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SpellCheck2 = createLucideIcon("SpellCheck2", [
["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
["path", { d: "M8 12h8", key: "1wcyev" }],
[
"path",
{
d: "M4 21c1.1 0 1.1-1 2.3-1s1.1 1 2.3 1c1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1",
key: "8mdmtu"
}
]
]);
export { SpellCheck2 as default };
//# sourceMappingURL=spell-check-2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":";;;AAoCa,QAAA,aAAa,GAAmB;IAC3C,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,CAAC;CACV,CAAA;AAEY,QAAA,YAAY,GAAmB;IAC1C,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,CAAC;CACV,CAAA;AAEY,QAAA,aAAa,GAAmB;IAC3C,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,CAAC;CACV,CAAA;AAEY,QAAA,MAAM,GAAmB;IACpC,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,CAAC;CACV,CAAA;AAEY,QAAA,eAAe,GAAmB;IAC7C,IAAI,EAAE,iBAAiB;IACvB,MAAM,EAAE,CAAC;CACV,CAAA;AAEY,QAAA,gBAAgB,GAAmB;IAC9C,IAAI,EAAE,kBAAkB;IACxB,MAAM,EAAE,CAAC;CACV,CAAA;AAEY,QAAA,UAAU,GAAmB;IACxC,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,CAAC;CACV,CAAA;AAEY,QAAA,QAAQ,GAAmB;IACtC,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,CAAC;CACV,CAAA;AAsBD,MAAa,aAAc,SAAQ,KAAK;IAiBtC,YACE,OAAe,EACC,MAAc,EACd,IAAiB;QAEjC,KAAK,CAAC,OAAO,CAAC,CAAA;QAHE,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAa;IAGnC,CAAC;CACF;AAxBD,sCAwBC;AAED,MAAa,eAAe;IAE1B,YACkB,MAAc,EACd,KAAa;QADb,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAQ;QAHf,SAAI,GAAG,UAAU,CAAA;IAI9B,CAAC;CACL;AAND,0CAMC;AAED,MAAa,YAAY;IAEvB,YACkB,MAAc,EACd,IAAiB,EACjB,MAAe,EAC/B,WAAmB;QAHH,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAa;QACjB,WAAM,GAAN,MAAM,CAAS;QAG/B,IAAI,CAAC,WAAW,GAAG,IAAI,KAAK,CAAC,WAAW,CAAC,CAAA;IAC3C,CAAC;CACF;AAVD,oCAUC;AAED,MAAa,KAAK;IAChB,YACkB,IAAY,EACZ,OAAe,EACf,QAAgB,EAChB,UAAkB,EAClB,YAAoB,EACpB,gBAAwB,EACxB,MAAY;QANZ,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,qBAAgB,GAAhB,gBAAgB,CAAQ;QACxB,WAAM,GAAN,MAAM,CAAM;IAC3B,CAAC;CACL;AAVD,sBAUC;AAED,MAAa,qBAAqB;IAGhC,YACkB,MAAc,EACd,UAAkB;QADlB,WAAM,GAAN,MAAM,CAAQ;QACd,eAAU,GAAV,UAAU,CAAQ;QAJpB,SAAI,GAAgB,gBAAgB,CAAA;QAMlD,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAC1C,CAAC;CACF;AATD,sDASC;AAED,MAAa,2BAA2B;IAGtC,YACkB,MAAc,EACd,cAAsB;QADtB,WAAM,GAAN,MAAM,CAAQ;QACd,mBAAc,GAAd,cAAc,CAAQ;QAJxB,SAAI,GAAgB,sBAAsB,CAAA;QAMxD,IAAI,CAAC,WAAW,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IACnD,CAAC;CACF;AATD,kEASC;AAED,MAAa,sBAAsB;IAEjC,YACkB,MAAc,EACd,aAAqB,EACrB,cAAsB;QAFtB,WAAM,GAAN,MAAM,CAAQ;QACd,kBAAa,GAAb,aAAa,CAAQ;QACrB,mBAAc,GAAd,cAAc,CAAQ;QAJxB,SAAI,GAAgB,iBAAiB,CAAA;IAKlD,CAAC;CACL;AAPD,wDAOC;AAED,MAAa,yBAAyB;IAEpC,YACkB,MAAc,EACd,IAAY;QADZ,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QAHd,SAAI,GAAgB,2BAA2B,CAAA;IAI5D,CAAC;CACL;AAND,8DAMC;AAED,MAAa,qBAAqB;IAEhC,YACkB,MAAc,EACd,SAAiB,EACjB,SAAiB;QAFjB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAQ;QACjB,cAAS,GAAT,SAAS,CAAQ;QAJnB,SAAI,GAAgB,gBAAgB,CAAA;IAKjD,CAAC;CACL;AAPD,sDAOC;AAED,MAAa,2BAA2B;IAEtC,YACkB,MAAc,EACd,SAAiB,EACjB,OAAe,EACf,OAAe;QAHf,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAQ;QALjB,SAAI,GAAgB,cAAc,CAAA;IAM/C,CAAC;CACL;AARD,kEAQC;AAED,MAAa,oBAAoB;IAE/B,YACkB,MAAc,EACd,MAAc;QADd,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;QAHhB,SAAI,GAAgB,eAAe,CAAA;IAIhD,CAAC;CACL;AAND,oDAMC;AAED,MAAa,sBAAsB;IAEjC,YACkB,MAAc,EACd,IAAY;QADZ,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QAHd,SAAI,GAAgB,iBAAiB,CAAA;IAIlD,CAAC;CACL;AAND,wDAMC;AAED,MAAa,cAAc;IAGzB,YACS,MAAc,EACd,MAAa;QADb,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAO;QAHN,SAAI,GAAgB,SAAS,CAAA;QAK3C,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAA;IACjC,CAAC;CACF;AATD,wCASC;AAED,MAAa,aAAa;IACxB,YACkB,MAAc,EACd,OAA2B;QAD3B,WAAM,GAAN,MAAM,CAAQ;QACd,YAAO,GAAP,OAAO,CAAoB;QAE7B,SAAI,GAAG,QAAQ,CAAA;IAD5B,CAAC;CAkBL;AAtBD,sCAsBC"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/sqlite-core/checks.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport type { SQL } from '~/sql/sql.ts';\nimport type { SQLiteTable } from './table.ts';\n\nexport class CheckBuilder {\n\tstatic readonly [entityKind]: string = 'SQLiteCheckBuilder';\n\n\tprotected brand!: 'SQLiteConstraintBuilder';\n\n\tconstructor(public name: string, public value: SQL) {}\n\n\tbuild(table: SQLiteTable): Check {\n\t\treturn new Check(table, this);\n\t}\n}\n\nexport class Check {\n\tstatic readonly [entityKind]: string = 'SQLiteCheck';\n\n\tdeclare _: {\n\t\tbrand: 'SQLiteCheck';\n\t};\n\n\treadonly name: string;\n\treadonly value: SQL;\n\n\tconstructor(public table: SQLiteTable, builder: CheckBuilder) {\n\t\tthis.name = builder.name;\n\t\tthis.value = builder.value;\n\t}\n}\n\nexport function check(name: string, value: SQL): CheckBuilder {\n\treturn new CheckBuilder(name, value);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAIpB,MAAM,aAAa;AAAA,EAKzB,YAAmB,MAAqB,OAAY;AAAjC;AAAqB;AAAA,EAAa;AAAA,EAJrD,QAAiB,wBAAU,IAAY;AAAA,EAE7B;AAAA,EAIV,MAAM,OAA2B;AAChC,WAAO,IAAI,MAAM,OAAO,IAAI;AAAA,EAC7B;AACD;AAEO,MAAM,MAAM;AAAA,EAUlB,YAAmB,OAAoB,SAAuB;AAA3C;AAClB,SAAK,OAAO,QAAQ;AACpB,SAAK,QAAQ,QAAQ;AAAA,EACtB;AAAA,EAZA,QAAiB,wBAAU,IAAY;AAAA,EAM9B;AAAA,EACA;AAMV;AAEO,SAAS,MAAM,MAAc,OAA0B;AAC7D,SAAO,IAAI,aAAa,MAAM,KAAK;AACpC;","names":[]}

View File

@@ -0,0 +1,4 @@
import type { Plugin } from "ajv";
import type { DefinitionOptions } from "../definitions/_types";
declare const deepProperties: Plugin<DefinitionOptions>;
export default deepProperties;

View File

@@ -0,0 +1,6 @@
export declare const differenceInMinutesWithOptions: import("./types.js").FPFn3<
number,
import("../differenceInMinutes.js").DifferenceInMinutesOptions | undefined,
string | number | Date,
string | number | Date
>;

View File

@@ -0,0 +1,33 @@
'use strict'
const { test } = require('node:test')
const { createWarning } = require('..')
const { withResolvers } = require('./promise')
test('emit should emit a given code only once', t => {
t.plan(4)
const { promise, resolve } = withResolvers()
process.on('warning', onWarning)
function onWarning (warning) {
t.assert.deepStrictEqual(warning.name, 'TestDeprecation')
t.assert.deepStrictEqual(warning.code, 'CODE')
t.assert.deepStrictEqual(warning.message, 'Hello world')
t.assert.ok(warn.emitted)
}
const warn = createWarning({
name: 'TestDeprecation',
code: 'CODE',
message: 'Hello world'
})
warn()
warn()
setImmediate(() => {
process.removeListener('warning', onWarning)
resolve()
})
return promise
})

View File

@@ -0,0 +1,853 @@
import { inspect } from '../../jsutils/inspect.mjs';
import { GraphQLError } from '../../error/GraphQLError.mjs';
import { Kind } from '../../language/kinds.mjs';
import { print } from '../../language/printer.mjs';
import {
getNamedType,
isInterfaceType,
isLeafType,
isListType,
isNonNullType,
isObjectType,
} from '../../type/definition.mjs';
import { sortValueNode } from '../../utilities/sortValueNode.mjs';
import { typeFromAST } from '../../utilities/typeFromAST.mjs';
function reasonMessage(reason) {
if (Array.isArray(reason)) {
return reason
.map(
([responseName, subReason]) =>
`subfields "${responseName}" conflict because ` +
reasonMessage(subReason),
)
.join(' and ');
}
return reason;
}
/**
* Overlapping fields can be merged
*
* A selection set is only valid if all fields (including spreading any
* fragments) either correspond to distinct response names or can be merged
* without ambiguity.
*
* See https://spec.graphql.org/draft/#sec-Field-Selection-Merging
*/
export function OverlappingFieldsCanBeMergedRule(context) {
// A memoization for when fields and a fragment or two fragments are compared
// "between" each other for conflicts. Comparisons made be made many times,
// so memoizing this can dramatically improve the performance of this validator.
const comparedFieldsAndFragmentPairs = new OrderedPairSet();
const comparedFragmentPairs = new PairSet(); // A cache for the "field map" and list of fragment names found in any given
// selection set. Selection sets may be asked for this information multiple
// times, so this improves the performance of this validator.
const cachedFieldsAndFragmentNames = new Map();
return {
SelectionSet(selectionSet) {
const conflicts = findConflictsWithinSelectionSet(
context,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
context.getParentType(),
selectionSet,
);
for (const [[responseName, reason], fields1, fields2] of conflicts) {
const reasonMsg = reasonMessage(reason);
context.reportError(
new GraphQLError(
`Fields "${responseName}" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`,
{
nodes: fields1.concat(fields2),
},
),
);
}
},
};
}
/**
* Algorithm:
*
* Conflicts occur when two fields exist in a query which will produce the same
* response name, but represent differing values, thus creating a conflict.
* The algorithm below finds all conflicts via making a series of comparisons
* between fields. In order to compare as few fields as possible, this makes
* a series of comparisons "within" sets of fields and "between" sets of fields.
*
* Given any selection set, a collection produces both a set of fields by
* also including all inline fragments, as well as a list of fragments
* referenced by fragment spreads.
*
* A) Each selection set represented in the document first compares "within" its
* collected set of fields, finding any conflicts between every pair of
* overlapping fields.
* Note: This is the *only time* that a the fields "within" a set are compared
* to each other. After this only fields "between" sets are compared.
*
* B) Also, if any fragment is referenced in a selection set, then a
* comparison is made "between" the original set of fields and the
* referenced fragment.
*
* C) Also, if multiple fragments are referenced, then comparisons
* are made "between" each referenced fragment.
*
* D) When comparing "between" a set of fields and a referenced fragment, first
* a comparison is made between each field in the original set of fields and
* each field in the the referenced set of fields.
*
* E) Also, if any fragment is referenced in the referenced selection set,
* then a comparison is made "between" the original set of fields and the
* referenced fragment (recursively referring to step D).
*
* F) When comparing "between" two fragments, first a comparison is made between
* each field in the first referenced set of fields and each field in the the
* second referenced set of fields.
*
* G) Also, any fragments referenced by the first must be compared to the
* second, and any fragments referenced by the second must be compared to the
* first (recursively referring to step F).
*
* H) When comparing two fields, if both have selection sets, then a comparison
* is made "between" both selection sets, first comparing the set of fields in
* the first selection set with the set of fields in the second.
*
* I) Also, if any fragment is referenced in either selection set, then a
* comparison is made "between" the other set of fields and the
* referenced fragment.
*
* J) Also, if two fragments are referenced in both selection sets, then a
* comparison is made "between" the two fragments.
*
*/
// Find all conflicts found "within" a selection set, including those found
// via spreading in fragments. Called when visiting each SelectionSet in the
// GraphQL Document.
function findConflictsWithinSelectionSet(
context,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
parentType,
selectionSet,
) {
const conflicts = [];
const [fieldMap, fragmentNames] = getFieldsAndFragmentNames(
context,
cachedFieldsAndFragmentNames,
parentType,
selectionSet,
); // (A) Find find all conflicts "within" the fields of this selection set.
// Note: this is the *only place* `collectConflictsWithin` is called.
collectConflictsWithin(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
fieldMap,
);
if (fragmentNames.length !== 0) {
// (B) Then collect conflicts between these fields and those represented by
// each spread fragment name found.
for (let i = 0; i < fragmentNames.length; i++) {
collectConflictsBetweenFieldsAndFragment(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
false,
fieldMap,
fragmentNames[i],
); // (C) Then compare this fragment with all other fragments found in this
// selection set to collect conflicts between fragments spread together.
// This compares each item in the list of fragment names to every other
// item in that same list (except for itself).
for (let j = i + 1; j < fragmentNames.length; j++) {
collectConflictsBetweenFragments(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
false,
fragmentNames[i],
fragmentNames[j],
);
}
}
}
return conflicts;
} // Collect all conflicts found between a set of fields and a fragment reference
// including via spreading in any nested fragments.
function collectConflictsBetweenFieldsAndFragment(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
fieldMap,
fragmentName,
) {
// Memoize so the fields and fragments are not compared for conflicts more
// than once.
if (
comparedFieldsAndFragmentPairs.has(
fieldMap,
fragmentName,
areMutuallyExclusive,
)
) {
return;
}
comparedFieldsAndFragmentPairs.add(
fieldMap,
fragmentName,
areMutuallyExclusive,
);
const fragment = context.getFragment(fragmentName);
if (!fragment) {
return;
}
const [fieldMap2, referencedFragmentNames] =
getReferencedFieldsAndFragmentNames(
context,
cachedFieldsAndFragmentNames,
fragment,
); // Do not compare a fragment's fieldMap to itself.
if (fieldMap === fieldMap2) {
return;
} // (D) First collect any conflicts between the provided collection of fields
// and the collection of fields represented by the given fragment.
collectConflictsBetween(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
fieldMap,
fieldMap2,
); // (E) Then collect any conflicts between the provided collection of fields
// and any fragment names found in the given fragment.
for (const referencedFragmentName of referencedFragmentNames) {
collectConflictsBetweenFieldsAndFragment(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
fieldMap,
referencedFragmentName,
);
}
} // Collect all conflicts found between two fragments, including via spreading in
// any nested fragments.
function collectConflictsBetweenFragments(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
fragmentName1,
fragmentName2,
) {
// No need to compare a fragment to itself.
if (fragmentName1 === fragmentName2) {
return;
} // Memoize so two fragments are not compared for conflicts more than once.
if (
comparedFragmentPairs.has(
fragmentName1,
fragmentName2,
areMutuallyExclusive,
)
) {
return;
}
comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive);
const fragment1 = context.getFragment(fragmentName1);
const fragment2 = context.getFragment(fragmentName2);
if (!fragment1 || !fragment2) {
return;
}
const [fieldMap1, referencedFragmentNames1] =
getReferencedFieldsAndFragmentNames(
context,
cachedFieldsAndFragmentNames,
fragment1,
);
const [fieldMap2, referencedFragmentNames2] =
getReferencedFieldsAndFragmentNames(
context,
cachedFieldsAndFragmentNames,
fragment2,
); // (F) First, collect all conflicts between these two collections of fields
// (not including any nested fragments).
collectConflictsBetween(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
fieldMap1,
fieldMap2,
); // (G) Then collect conflicts between the first fragment and any nested
// fragments spread in the second fragment.
for (const referencedFragmentName2 of referencedFragmentNames2) {
collectConflictsBetweenFragments(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
fragmentName1,
referencedFragmentName2,
);
} // (G) Then collect conflicts between the second fragment and any nested
// fragments spread in the first fragment.
for (const referencedFragmentName1 of referencedFragmentNames1) {
collectConflictsBetweenFragments(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
referencedFragmentName1,
fragmentName2,
);
}
} // Find all conflicts found between two selection sets, including those found
// via spreading in fragments. Called when determining if conflicts exist
// between the sub-fields of two overlapping fields.
function findConflictsBetweenSubSelectionSets(
context,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
parentType1,
selectionSet1,
parentType2,
selectionSet2,
) {
const conflicts = [];
const [fieldMap1, fragmentNames1] = getFieldsAndFragmentNames(
context,
cachedFieldsAndFragmentNames,
parentType1,
selectionSet1,
);
const [fieldMap2, fragmentNames2] = getFieldsAndFragmentNames(
context,
cachedFieldsAndFragmentNames,
parentType2,
selectionSet2,
); // (H) First, collect all conflicts between these two collections of field.
collectConflictsBetween(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
fieldMap1,
fieldMap2,
); // (I) Then collect conflicts between the first collection of fields and
// those referenced by each fragment name associated with the second.
for (const fragmentName2 of fragmentNames2) {
collectConflictsBetweenFieldsAndFragment(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
fieldMap1,
fragmentName2,
);
} // (I) Then collect conflicts between the second collection of fields and
// those referenced by each fragment name associated with the first.
for (const fragmentName1 of fragmentNames1) {
collectConflictsBetweenFieldsAndFragment(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
fieldMap2,
fragmentName1,
);
} // (J) Also collect conflicts between any fragment names by the first and
// fragment names by the second. This compares each item in the first set of
// names to each item in the second set of names.
for (const fragmentName1 of fragmentNames1) {
for (const fragmentName2 of fragmentNames2) {
collectConflictsBetweenFragments(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
fragmentName1,
fragmentName2,
);
}
}
return conflicts;
} // Collect all Conflicts "within" one collection of fields.
function collectConflictsWithin(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
fieldMap,
) {
// A field map is a keyed collection, where each key represents a response
// name and the value at that key is a list of all fields which provide that
// response name. For every response name, if there are multiple fields, they
// must be compared to find a potential conflict.
for (const [responseName, fields] of Object.entries(fieldMap)) {
// This compares every field in the list to every other field in this list
// (except to itself). If the list only has one item, nothing needs to
// be compared.
if (fields.length > 1) {
for (let i = 0; i < fields.length; i++) {
for (let j = i + 1; j < fields.length; j++) {
const conflict = findConflict(
context,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
false, // within one collection is never mutually exclusive
responseName,
fields[i],
fields[j],
);
if (conflict) {
conflicts.push(conflict);
}
}
}
}
}
} // Collect all Conflicts between two collections of fields. This is similar to,
// but different from the `collectConflictsWithin` function above. This check
// assumes that `collectConflictsWithin` has already been called on each
// provided collection of fields. This is true because this validator traverses
// each individual selection set.
function collectConflictsBetween(
context,
conflicts,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
parentFieldsAreMutuallyExclusive,
fieldMap1,
fieldMap2,
) {
// A field map is a keyed collection, where each key represents a response
// name and the value at that key is a list of all fields which provide that
// response name. For any response name which appears in both provided field
// maps, each field from the first field map must be compared to every field
// in the second field map to find potential conflicts.
for (const [responseName, fields1] of Object.entries(fieldMap1)) {
const fields2 = fieldMap2[responseName];
if (fields2) {
for (const field1 of fields1) {
for (const field2 of fields2) {
const conflict = findConflict(
context,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
parentFieldsAreMutuallyExclusive,
responseName,
field1,
field2,
);
if (conflict) {
conflicts.push(conflict);
}
}
}
}
}
} // Determines if there is a conflict between two particular fields, including
// comparing their sub-fields.
function findConflict(
context,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
parentFieldsAreMutuallyExclusive,
responseName,
field1,
field2,
) {
const [parentType1, node1, def1] = field1;
const [parentType2, node2, def2] = field2; // If it is known that two fields could not possibly apply at the same
// time, due to the parent types, then it is safe to permit them to diverge
// in aliased field or arguments used as they will not present any ambiguity
// by differing.
// It is known that two parent types could never overlap if they are
// different Object types. Interface or Union types might overlap - if not
// in the current state of the schema, then perhaps in some future version,
// thus may not safely diverge.
const areMutuallyExclusive =
parentFieldsAreMutuallyExclusive ||
(parentType1 !== parentType2 &&
isObjectType(parentType1) &&
isObjectType(parentType2));
if (!areMutuallyExclusive) {
// Two aliases must refer to the same field.
const name1 = node1.name.value;
const name2 = node2.name.value;
if (name1 !== name2) {
return [
[responseName, `"${name1}" and "${name2}" are different fields`],
[node1],
[node2],
];
} // Two field calls must have the same arguments.
if (!sameArguments(node1, node2)) {
return [
[responseName, 'they have differing arguments'],
[node1],
[node2],
];
}
} // The return type for each field.
const type1 = def1 === null || def1 === void 0 ? void 0 : def1.type;
const type2 = def2 === null || def2 === void 0 ? void 0 : def2.type;
if (type1 && type2 && doTypesConflict(type1, type2)) {
return [
[
responseName,
`they return conflicting types "${inspect(type1)}" and "${inspect(
type2,
)}"`,
],
[node1],
[node2],
];
} // Collect and compare sub-fields. Use the same "visited fragment names" list
// for both collections so fields in a fragment reference are never
// compared to themselves.
const selectionSet1 = node1.selectionSet;
const selectionSet2 = node2.selectionSet;
if (selectionSet1 && selectionSet2) {
const conflicts = findConflictsBetweenSubSelectionSets(
context,
cachedFieldsAndFragmentNames,
comparedFieldsAndFragmentPairs,
comparedFragmentPairs,
areMutuallyExclusive,
getNamedType(type1),
selectionSet1,
getNamedType(type2),
selectionSet2,
);
return subfieldConflicts(conflicts, responseName, node1, node2);
}
}
function sameArguments(node1, node2) {
const args1 = node1.arguments;
const args2 = node2.arguments;
if (args1 === undefined || args1.length === 0) {
return args2 === undefined || args2.length === 0;
}
if (args2 === undefined || args2.length === 0) {
return false;
}
/* c8 ignore next */
if (args1.length !== args2.length) {
/* c8 ignore next */
return false;
/* c8 ignore next */
}
const values2 = new Map(args2.map(({ name, value }) => [name.value, value]));
return args1.every((arg1) => {
const value1 = arg1.value;
const value2 = values2.get(arg1.name.value);
if (value2 === undefined) {
return false;
}
return stringifyValue(value1) === stringifyValue(value2);
});
}
function stringifyValue(value) {
return print(sortValueNode(value));
} // Two types conflict if both types could not apply to a value simultaneously.
// Composite types are ignored as their individual field types will be compared
// later recursively. However List and Non-Null types must match.
function doTypesConflict(type1, type2) {
if (isListType(type1)) {
return isListType(type2)
? doTypesConflict(type1.ofType, type2.ofType)
: true;
}
if (isListType(type2)) {
return true;
}
if (isNonNullType(type1)) {
return isNonNullType(type2)
? doTypesConflict(type1.ofType, type2.ofType)
: true;
}
if (isNonNullType(type2)) {
return true;
}
if (isLeafType(type1) || isLeafType(type2)) {
return type1 !== type2;
}
return false;
} // Given a selection set, return the collection of fields (a mapping of response
// name to field nodes and definitions) as well as a list of fragment names
// referenced via fragment spreads.
function getFieldsAndFragmentNames(
context,
cachedFieldsAndFragmentNames,
parentType,
selectionSet,
) {
const cached = cachedFieldsAndFragmentNames.get(selectionSet);
if (cached) {
return cached;
}
const nodeAndDefs = Object.create(null);
const fragmentNames = Object.create(null);
_collectFieldsAndFragmentNames(
context,
parentType,
selectionSet,
nodeAndDefs,
fragmentNames,
);
const result = [nodeAndDefs, Object.keys(fragmentNames)];
cachedFieldsAndFragmentNames.set(selectionSet, result);
return result;
} // Given a reference to a fragment, return the represented collection of fields
// as well as a list of nested fragment names referenced via fragment spreads.
function getReferencedFieldsAndFragmentNames(
context,
cachedFieldsAndFragmentNames,
fragment,
) {
// Short-circuit building a type from the node if possible.
const cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet);
if (cached) {
return cached;
}
const fragmentType = typeFromAST(context.getSchema(), fragment.typeCondition);
return getFieldsAndFragmentNames(
context,
cachedFieldsAndFragmentNames,
fragmentType,
fragment.selectionSet,
);
}
function _collectFieldsAndFragmentNames(
context,
parentType,
selectionSet,
nodeAndDefs,
fragmentNames,
) {
for (const selection of selectionSet.selections) {
switch (selection.kind) {
case Kind.FIELD: {
const fieldName = selection.name.value;
let fieldDef;
if (isObjectType(parentType) || isInterfaceType(parentType)) {
fieldDef = parentType.getFields()[fieldName];
}
const responseName = selection.alias
? selection.alias.value
: fieldName;
if (!nodeAndDefs[responseName]) {
nodeAndDefs[responseName] = [];
}
nodeAndDefs[responseName].push([parentType, selection, fieldDef]);
break;
}
case Kind.FRAGMENT_SPREAD:
fragmentNames[selection.name.value] = true;
break;
case Kind.INLINE_FRAGMENT: {
const typeCondition = selection.typeCondition;
const inlineFragmentType = typeCondition
? typeFromAST(context.getSchema(), typeCondition)
: parentType;
_collectFieldsAndFragmentNames(
context,
inlineFragmentType,
selection.selectionSet,
nodeAndDefs,
fragmentNames,
);
break;
}
}
}
} // Given a series of Conflicts which occurred between two sub-fields, generate
// a single Conflict.
function subfieldConflicts(conflicts, responseName, node1, node2) {
if (conflicts.length > 0) {
return [
[responseName, conflicts.map(([reason]) => reason)],
[node1, ...conflicts.map(([, fields1]) => fields1).flat()],
[node2, ...conflicts.map(([, , fields2]) => fields2).flat()],
];
}
}
/**
* A way to keep track of pairs of things where the ordering of the pair
* matters.
*
* Provides a third argument for has/set to allow flagging the pair as
* weakly or strongly present within the collection.
*/
class OrderedPairSet {
constructor() {
this._data = new Map();
}
has(a, b, weaklyPresent) {
var _this$_data$get;
const result =
(_this$_data$get = this._data.get(a)) === null ||
_this$_data$get === void 0
? void 0
: _this$_data$get.get(b);
if (result === undefined) {
return false;
}
return weaklyPresent ? true : weaklyPresent === result;
}
add(a, b, weaklyPresent) {
const map = this._data.get(a);
if (map === undefined) {
this._data.set(a, new Map([[b, weaklyPresent]]));
} else {
map.set(b, weaklyPresent);
}
}
}
/**
* A way to keep track of pairs of similar things when the ordering of the pair
* does not matter.
*/
class PairSet {
constructor() {
this._orderedPairSet = new OrderedPairSet();
}
has(a, b, weaklyPresent) {
return a < b
? this._orderedPairSet.has(a, b, weaklyPresent)
: this._orderedPairSet.has(b, a, weaklyPresent);
}
add(a, b, weaklyPresent) {
if (a < b) {
this._orderedPairSet.add(a, b, weaklyPresent);
} else {
this._orderedPairSet.add(b, a, weaklyPresent);
}
}
}

View File

@@ -0,0 +1,3 @@
export * from "../../dist/declarations/src/_isolated-hnrs";
export { default } from "../../dist/declarations/src/_isolated-hnrs";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vdGlvbi1yZWFjdC1faXNvbGF0ZWQtaG5ycy5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2Rpc3QvZGVjbGFyYXRpb25zL3NyYy9faXNvbGF0ZWQtaG5ycy5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=

View File

@@ -0,0 +1,42 @@
"use strict";
exports.__esModule = true;
exports.default = text;
var regExpNbspEntity = /&nbsp;/gi;
var regExpNbspHex = /\xA0/g;
var regExpSpaces = /\s+([^\s])/gm;
/**
* Collects the text content of a given element.
*
* @param node the element
* @param trim whether to remove trailing whitespace chars
* @param singleSpaces whether to convert multiple whitespace chars into a single space character
*/
function text(node, trim, singleSpaces) {
if (trim === void 0) {
trim = true;
}
if (singleSpaces === void 0) {
singleSpaces = true;
}
var elementText = '';
if (node) {
elementText = (node.textContent || '').replace(regExpNbspEntity, ' ').replace(regExpNbspHex, ' ');
if (trim) {
elementText = elementText.trim();
}
if (singleSpaces) {
elementText = elementText.replace(regExpSpaces, ' $1');
}
}
return elementText;
}
module.exports = exports["default"];

View File

@@ -0,0 +1,40 @@
import {StringType} from 'token-types';
export function stringToBytes(string) {
return [...string].map(character => character.charCodeAt(0)); // eslint-disable-line unicorn/prefer-code-point
}
/**
Checks whether the TAR checksum is valid.
@param {Uint8Array} arrayBuffer - The TAR header `[offset ... offset + 512]`.
@param {number} offset - TAR header offset.
@returns {boolean} `true` if the TAR checksum is valid, otherwise `false`.
*/
export function tarHeaderChecksumMatches(arrayBuffer, offset = 0) {
const readSum = Number.parseInt(new StringType(6).get(arrayBuffer, 148).replace(/\0.*$/, '').trim(), 8); // Read sum in header
if (Number.isNaN(readSum)) {
return false;
}
let sum = 8 * 0x20; // Initialize signed bit sum
for (let index = offset; index < offset + 148; index++) {
sum += arrayBuffer[index];
}
for (let index = offset + 156; index < offset + 512; index++) {
sum += arrayBuffer[index];
}
return readSum === sum;
}
/**
ID3 UINT32 sync-safe tokenizer token.
28 bits (representing up to 256MB) integer, the msb is 0 to avoid "false syncsignals".
*/
export const uint32SyncSafeToken = {
get: (buffer, offset) => (buffer[offset + 3] & 0x7F) | ((buffer[offset + 2]) << 7) | ((buffer[offset + 1]) << 14) | ((buffer[offset]) << 21),
len: 4,
};

View File

@@ -0,0 +1,29 @@
var basePullAll = require('./_basePullAll');
/**
* This method is like `_.pull` except that it accepts an array of values to remove.
*
* **Note:** Unlike `_.difference`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* _.pullAll(array, ['a', 'c']);
* console.log(array);
* // => ['b', 'b']
*/
function pullAll(array, values) {
return (array && array.length && values && values.length)
? basePullAll(array, values)
: array;
}
module.exports = pullAll;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/utilities/telemetry/events/serverInit.ts"],"sourcesContent":["import type { Payload } from '../../../index.js'\n\nimport { sendEvent } from '../index.js'\n\nexport type ServerInitEvent = {\n type: 'server-init'\n}\n\nexport const serverInit = (payload: Payload): void => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n sendEvent({\n event: {\n type: 'server-init',\n },\n payload,\n })\n}\n"],"names":["sendEvent","serverInit","payload","event","type"],"mappings":"AAEA,SAASA,SAAS,QAAQ,cAAa;AAMvC,OAAO,MAAMC,aAAa,CAACC;IACzB,mEAAmE;IACnEF,UAAU;QACRG,OAAO;YACLC,MAAM;QACR;QACAF;IACF;AACF,EAAC"}

View File

@@ -0,0 +1,609 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import { formatAdminURL } from 'payload/shared';
import * as qs from 'qs-esm';
import React, { useCallback, useEffect, useMemo } from 'react';
import { useBulkUpload } from '../../elements/BulkUpload/index.js';
import { Button } from '../../elements/Button/index.js';
import { useDocumentDrawer } from '../../elements/DocumentDrawer/index.js';
import { Dropzone } from '../../elements/Dropzone/index.js';
import { useListDrawer } from '../../elements/ListDrawer/index.js';
import { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js';
import { ShimmerEffect } from '../../elements/ShimmerEffect/index.js';
import { FieldDescription } from '../../fields/FieldDescription/index.js';
import { FieldError } from '../../fields/FieldError/index.js';
import { FieldLabel } from '../../fields/FieldLabel/index.js';
import { useAuth } from '../../providers/Auth/index.js';
import { useLocale } from '../../providers/Locale/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { normalizeRelationshipValue } from '../../utilities/normalizeRelationshipValue.js';
import { fieldBaseClass } from '../shared/index.js';
import { UploadComponentHasMany } from './HasMany/index.js';
import './index.scss';
import { UploadComponentHasOne } from './HasOne/index.js';
export const baseClass = 'upload';
export function UploadInput(props) {
const {
AfterInput,
allowCreate,
api,
BeforeInput,
className,
Description,
description,
displayPreview,
Error,
filterOptions: filterOptionsFromProps,
hasMany,
isSortable,
Label,
label,
localized,
maxRows,
onChange: onChangeFromProps,
path,
readOnly,
relationTo,
required,
serverURL,
showError,
style,
value
} = props;
const [populatedDocs, setPopulatedDocs] = React.useState();
const [activeRelationTo] = React.useState(Array.isArray(relationTo) ? relationTo[0] : relationTo);
const {
openModal
} = useModal();
const {
drawerSlug,
setCollectionSlug,
setInitialFiles,
setMaxFiles,
setOnSuccess,
setSelectableCollections
} = useBulkUpload();
const {
permissions
} = useAuth();
const {
code
} = useLocale();
const {
i18n,
t
} = useTranslation();
// This will be used by the bulk upload to allow you to select only collections you have create permissions for
const collectionSlugsWithCreatePermission = useMemo(() => {
if (Array.isArray(relationTo)) {
return relationTo.filter(relation => permissions?.collections && permissions.collections?.[relation]?.create);
}
return [];
}, [relationTo, permissions]);
const filterOptions = useMemo(() => {
const isPoly = Array.isArray(relationTo);
if (!value) {
return filterOptionsFromProps;
}
// Group existing IDs by relation
const existingIdsByRelation = {};
const values = Array.isArray(value) ? value : [value];
for (const val of values) {
if (isPoly && typeof val === 'object' && 'relationTo' in val) {
// Poly upload - group by relationTo
if (!existingIdsByRelation[val.relationTo]) {
existingIdsByRelation[val.relationTo] = [];
}
existingIdsByRelation[val.relationTo].push(val.value);
} else if (!isPoly) {
// Non-poly upload - all IDs belong to the single collection
const collection = relationTo;
if (!existingIdsByRelation[collection]) {
existingIdsByRelation[collection] = [];
}
const id = typeof val === 'object' && 'value' in val ? val.value : val;
if (typeof id === 'string' || typeof id === 'number') {
existingIdsByRelation[collection].push(id);
}
}
}
// Build filter options for each collection
const newFilterOptions = {
...filterOptionsFromProps
};
const relations = isPoly ? relationTo : [relationTo];
relations.forEach(relation_0 => {
const existingIds = existingIdsByRelation[relation_0] || [];
newFilterOptions[relation_0] = {
...(filterOptionsFromProps?.[relation_0] || {}),
id: {
...(filterOptionsFromProps?.[relation_0]?.id || {}),
not_in: (filterOptionsFromProps?.[relation_0]?.id?.not_in || []).concat(existingIds)
}
};
});
return newFilterOptions;
}, [value, filterOptionsFromProps, relationTo]);
const [ListDrawer,, {
closeDrawer: closeListDrawer,
openDrawer: openListDrawer
}] = useListDrawer({
collectionSlugs: typeof relationTo === 'string' ? [relationTo] : relationTo,
filterOptions
});
const [CreateDocDrawer,, {
closeDrawer: closeCreateDocDrawer,
openDrawer: openCreateDocDrawer
}] = useDocumentDrawer({
collectionSlug: activeRelationTo
});
/**
* Track the last loaded value to prevent unnecessary reloads
*/
const loadedValueRef = React.useRef(null);
const canCreate = useMemo(() => {
if (!allowCreate) {
return false;
}
if (typeof activeRelationTo === 'string') {
if (permissions?.collections && permissions.collections?.[activeRelationTo]?.create) {
return true;
}
}
return false;
}, [activeRelationTo, permissions, allowCreate]);
const onChange = React.useCallback(newValue => {
if (typeof onChangeFromProps === 'function') {
onChangeFromProps(newValue);
}
}, [onChangeFromProps]);
const populateDocs = React.useCallback(async items => {
if (!items?.length) {
return [];
}
// 1. Group IDs by collection
const grouped = {};
items.forEach(({
relationTo: relationTo_0,
value: value_0
}) => {
if (!grouped[relationTo_0]) {
grouped[relationTo_0] = [];
}
// Ensure we extract the actual ID value, not an object
let idValue = value_0;
if (value_0 && typeof value_0 === 'object' && 'value' in value_0) {
idValue = value_0.value;
}
grouped[relationTo_0].push(idValue);
});
// 2. Fetch per collection
const fetches = Object.entries(grouped).map(async ([collection_0, ids]) => {
const query = {
depth: 0,
draft: true,
limit: ids.length,
locale: code,
where: {
and: [{
id: {
in: ids
}
}]
}
};
const response = await fetch(formatAdminURL({
apiRoute: api,
path: `/${collection_0}`
}), {
body: qs.stringify(query),
credentials: 'include',
headers: {
'Accept-Language': i18n.language,
'Content-Type': 'application/x-www-form-urlencoded',
'X-Payload-HTTP-Method-Override': 'GET'
},
method: 'POST'
});
let docs = [];
if (response.ok) {
const data = await response.json();
docs = data.docs;
}
// Map docs by ID for fast lookup
const docsById = docs.reduce((acc, doc) => {
acc[doc.id] = doc;
return acc;
}, {});
return {
collection: collection_0,
docsById
};
});
const results = await Promise.all(fetches);
// 3. Build lookup
const lookup = {};
results.forEach(({
collection: collection_1,
docsById: docsById_0
}) => {
lookup[collection_1] = docsById_0;
});
// 4. Reconstruct in input order, add placeholders if missing
const sortedDocs = items.map(({
relationTo: relationTo_1,
value: value_1
}) => {
const doc_0 = lookup[relationTo_1]?.[value_1] || {
id: value_1,
filename: `${t('general:untitled')} - ID: ${value_1}`,
isPlaceholder: true
};
return {
relationTo: relationTo_1,
value: doc_0
};
});
return sortedDocs;
}, [api, code, i18n.language, t]);
const normalizeValue = useCallback(value_2 => normalizeRelationshipValue(value_2, relationTo), [relationTo]);
const onUploadSuccess = useCallback(uploadedForms => {
const isPoly_0 = Array.isArray(relationTo);
if (hasMany) {
const newValues = uploadedForms.map(form => isPoly_0 ? {
relationTo: form.collectionSlug,
value: form.doc.id
} : form.doc.id);
// Normalize existing values before merging
const normalizedExisting = Array.isArray(value) ? value.map(normalizeValue) : [];
const mergedValue = [...normalizedExisting, ...newValues];
onChange(mergedValue);
setPopulatedDocs(currentDocs => [...(currentDocs || []), ...uploadedForms.map(form_0 => ({
relationTo: form_0.collectionSlug,
value: form_0.doc
}))]);
} else {
const firstDoc = uploadedForms[0];
const newValue_0 = isPoly_0 ? {
relationTo: firstDoc.collectionSlug,
value: firstDoc.doc.id
} : firstDoc.doc.id;
onChange(newValue_0);
setPopulatedDocs([{
relationTo: firstDoc.collectionSlug,
value: firstDoc.doc
}]);
}
}, [value, onChange, hasMany, relationTo, normalizeValue]);
const onLocalFileSelection = React.useCallback(fileList => {
let fileListToUse = fileList;
if (!hasMany && fileList && fileList.length > 1) {
const dataTransfer = new DataTransfer();
dataTransfer.items.add(fileList[0]);
fileListToUse = dataTransfer.files;
}
if (fileListToUse) {
setInitialFiles(fileListToUse);
}
// Use activeRelationTo for poly uploads, or relationTo as string for single collection
const collectionToUse = Array.isArray(relationTo) ? activeRelationTo : relationTo;
setCollectionSlug(collectionToUse);
if (Array.isArray(collectionSlugsWithCreatePermission)) {
setSelectableCollections(collectionSlugsWithCreatePermission);
}
if (typeof maxRows === 'number') {
setMaxFiles(maxRows);
}
openModal(drawerSlug);
}, [hasMany, relationTo, activeRelationTo, setCollectionSlug, collectionSlugsWithCreatePermission, maxRows, openModal, drawerSlug, setInitialFiles, setSelectableCollections, setMaxFiles]);
// only hasMany can bulk select
const onListBulkSelect = React.useCallback(async docs_0 => {
const isPoly_1 = Array.isArray(relationTo);
const selectedDocIDs = [];
for (const [id_0, isSelected] of docs_0) {
if (isSelected) {
selectedDocIDs.push(id_0);
}
}
const itemsToLoad = selectedDocIDs.map(id_1 => ({
relationTo: activeRelationTo,
value: id_1
}));
const loadedDocs = await populateDocs(itemsToLoad);
if (loadedDocs) {
setPopulatedDocs(currentDocs_0 => [...(currentDocs_0 || []), ...loadedDocs]);
}
const newValues_0 = selectedDocIDs.map(id_2 => isPoly_1 ? {
relationTo: activeRelationTo,
value: id_2
} : id_2);
// Normalize existing values before merging
const normalizedExisting_0 = Array.isArray(value) ? value.map(normalizeValue) : [];
onChange([...normalizedExisting_0, ...newValues_0]);
closeListDrawer();
}, [activeRelationTo, closeListDrawer, onChange, populateDocs, value, relationTo, normalizeValue]);
const onDocCreate = React.useCallback(data_0 => {
const isPoly_2 = Array.isArray(relationTo);
if (data_0.doc) {
setPopulatedDocs(currentDocs_1 => [...(currentDocs_1 || []), {
relationTo: activeRelationTo,
value: data_0.doc
}]);
const newValue_1 = isPoly_2 ? {
relationTo: activeRelationTo,
value: data_0.doc.id
} : data_0.doc.id;
onChange(newValue_1);
}
closeCreateDocDrawer();
}, [closeCreateDocDrawer, activeRelationTo, onChange, relationTo]);
const onListSelect = useCallback(async ({
collectionSlug,
doc: doc_1
}) => {
const isPoly_3 = Array.isArray(relationTo);
const loadedDocs_0 = await populateDocs([{
relationTo: collectionSlug,
value: doc_1.id
}]);
const selectedDoc = loadedDocs_0?.[0] || null;
setPopulatedDocs(currentDocs_2 => {
if (selectedDoc) {
if (hasMany) {
return [...(currentDocs_2 || []), selectedDoc];
}
return [selectedDoc];
}
return currentDocs_2;
});
if (hasMany) {
const newValue_2 = isPoly_3 ? {
relationTo: collectionSlug,
value: doc_1.id
} : doc_1.id;
// Normalize existing values before merging
const normalizedExisting_1 = Array.isArray(value) ? value.map(normalizeValue) : [];
const valueToUse = [...normalizedExisting_1, newValue_2];
onChange(valueToUse);
} else {
const valueToUse_0 = isPoly_3 ? {
relationTo: collectionSlug,
value: doc_1.id
} : doc_1.id;
onChange(valueToUse_0);
}
closeListDrawer();
}, [closeListDrawer, hasMany, populateDocs, onChange, value, relationTo, normalizeValue]);
const reloadDoc = React.useCallback(async (docID, collectionSlug_0) => {
const docs_1 = await populateDocs([{
relationTo: collectionSlug_0,
value: docID
}]);
if (docs_1[0]) {
let updatedDocsToPropogate = [];
setPopulatedDocs(currentDocs_3 => {
const existingDocIndex = currentDocs_3?.findIndex(doc_2 => {
const hasExisting = doc_2.value?.id === docs_1[0].value.id || doc_2.value?.isPlaceholder;
return hasExisting && doc_2.relationTo === collectionSlug_0;
});
if (existingDocIndex > -1) {
const updatedDocs = [...currentDocs_3];
updatedDocs[existingDocIndex] = docs_1[0];
updatedDocsToPropogate = updatedDocs;
return updatedDocs;
}
return currentDocs_3;
});
if (updatedDocsToPropogate.length && hasMany) {
onChange(updatedDocsToPropogate.map(doc_3 => doc_3.value?.id));
}
}
}, [populateDocs, onChange, hasMany]);
// only hasMany can reorder
const onReorder = React.useCallback(newValue_3 => {
const isPoly_4 = Array.isArray(relationTo);
const newValueToSave = newValue_3.map(({
relationTo: rel,
value: value_3
}) => isPoly_4 ? {
relationTo: rel,
value: value_3.id
} : value_3.id);
onChange(newValueToSave);
setPopulatedDocs(newValue_3);
}, [onChange, relationTo]);
const onRemove = React.useCallback(newValue_4 => {
const isPoly_5 = Array.isArray(relationTo);
if (!newValue_4 || newValue_4.length === 0) {
onChange(hasMany ? [] : null);
setPopulatedDocs(hasMany ? [] : null);
return;
}
const newValueToSave_0 = newValue_4.map(({
relationTo: rel_0,
value: value_4
}) => isPoly_5 ? {
relationTo: rel_0,
value: value_4.id
} : value_4.id);
onChange(hasMany ? newValueToSave_0 : newValueToSave_0[0]);
setPopulatedDocs(newValue_4);
}, [onChange, hasMany, relationTo]);
useEffect(() => {
async function loadInitialDocs() {
if (value) {
let itemsToLoad_0 = [];
if (Array.isArray(relationTo) && (typeof value === 'object' && 'relationTo' in value || Array.isArray(value) && value.length > 0 && typeof value[0] === 'object' && 'relationTo' in value[0])) {
// For poly uploads, value should already be in the format { relationTo, value }
const values_0 = Array.isArray(value) ? value : [value];
itemsToLoad_0 = values_0.filter(v => typeof v === 'object' && 'relationTo' in v).map(v_0 => {
// Ensure the value property is a simple ID, not nested
let idValue_0 = v_0.value;
while (idValue_0 && typeof idValue_0 === 'object' && idValue_0 !== null && 'value' in idValue_0) {
idValue_0 = idValue_0.value;
}
return {
relationTo: v_0.relationTo,
value: idValue_0
};
});
} else {
// This check is here to satisfy TypeScript that relationTo is a string
if (!Array.isArray(relationTo)) {
// For single collection uploads, we need to wrap the IDs
const ids_0 = Array.isArray(value) ? value : [value];
itemsToLoad_0 = ids_0.map(id_3 => {
// Extract the actual ID, handling nested objects
let idValue_1 = id_3;
while (idValue_1 && typeof idValue_1 === 'object' && idValue_1 !== null && 'value' in idValue_1) {
idValue_1 = idValue_1.value;
}
return {
relationTo,
value: idValue_1
};
});
}
}
if (itemsToLoad_0.length > 0) {
const loadedDocs_1 = await populateDocs(itemsToLoad_0);
if (loadedDocs_1) {
setPopulatedDocs(loadedDocs_1);
loadedValueRef.current = value;
}
}
} else {
// Clear populated docs when value is cleared
setPopulatedDocs([]);
loadedValueRef.current = null;
}
}
// Only load if value has changed from what we last loaded
const valueChanged = loadedValueRef.current !== value;
if (valueChanged) {
void loadInitialDocs();
}
}, [populateDocs, value, relationTo]);
useEffect(() => {
setOnSuccess(onUploadSuccess);
}, [value, path, onUploadSuccess, setOnSuccess]);
const showDropzone = !value || hasMany && Array.isArray(value) && (typeof maxRows !== 'number' || value.length < maxRows) || !hasMany && populatedDocs?.[0] && typeof populatedDocs[0].value === 'undefined';
return /*#__PURE__*/_jsxs("div", {
className: [fieldBaseClass, baseClass, className, showError && 'error', readOnly && 'read-only'].filter(Boolean).join(' '),
id: `field-${path?.replace(/\./g, '__')}`,
style: style,
children: [/*#__PURE__*/_jsx(RenderCustomComponent, {
CustomComponent: Label,
Fallback: /*#__PURE__*/_jsx(FieldLabel, {
label: label,
localized: localized,
path: path,
required: required
})
}), /*#__PURE__*/_jsx("div", {
className: `${baseClass}__wrap`,
children: /*#__PURE__*/_jsx(RenderCustomComponent, {
CustomComponent: Error,
Fallback: /*#__PURE__*/_jsx(FieldError, {
path: path,
showError: showError
})
})
}), BeforeInput, /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__dropzoneAndUpload`,
children: [hasMany && Array.isArray(value) && value.length > 0 ? /*#__PURE__*/_jsx(_Fragment, {
children: populatedDocs && populatedDocs?.length > 0 ? /*#__PURE__*/_jsx(UploadComponentHasMany, {
displayPreview: displayPreview,
fileDocs: populatedDocs,
isSortable: isSortable && !readOnly,
onRemove: onRemove,
onReorder: onReorder,
readonly: readOnly,
reloadDoc: reloadDoc,
serverURL: serverURL,
showCollectionSlug: Array.isArray(relationTo)
}) : /*#__PURE__*/_jsx("div", {
className: `${baseClass}__loadingRows`,
children: value.map(id_4 => /*#__PURE__*/_jsx(ShimmerEffect, {
height: "40px"
}, typeof id_4 === 'object' ? id_4.value : id_4))
})
}) : null, !hasMany && value ? /*#__PURE__*/_jsx(_Fragment, {
children: populatedDocs && populatedDocs?.length > 0 && populatedDocs[0].value ? /*#__PURE__*/_jsx(UploadComponentHasOne, {
displayPreview: displayPreview,
fileDoc: populatedDocs[0],
onRemove: onRemove,
readonly: readOnly,
reloadDoc: reloadDoc,
serverURL: serverURL,
showCollectionSlug: Array.isArray(relationTo)
}) : populatedDocs && value && !populatedDocs?.[0]?.value ? /*#__PURE__*/_jsxs(_Fragment, {
children: [t('general:untitled'), " - ID: ", value]
}) : /*#__PURE__*/_jsx(ShimmerEffect, {
height: "62px"
})
}) : null, showDropzone ? /*#__PURE__*/_jsx(Dropzone, {
disabled: readOnly || !canCreate,
multipleFiles: hasMany,
onChange: onLocalFileSelection,
children: /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__dropzoneContent`,
children: [/*#__PURE__*/_jsxs("div", {
className: `${baseClass}__dropzoneContent__buttons`,
children: [canCreate && /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsx(Button, {
buttonStyle: "pill",
className: `${baseClass}__createNewToggler`,
disabled: readOnly || !canCreate,
onClick: () => {
if (!readOnly) {
if (hasMany) {
onLocalFileSelection();
} else {
openCreateDocDrawer();
}
}
},
size: "small",
children: t('general:createNew')
}), /*#__PURE__*/_jsx("span", {
className: `${baseClass}__dropzoneContent__orText`,
children: t('general:or')
})]
}), /*#__PURE__*/_jsx(Button, {
buttonStyle: "pill",
className: `${baseClass}__listToggler`,
disabled: readOnly,
onClick: openListDrawer,
size: "small",
children: t('fields:chooseFromExisting')
}), /*#__PURE__*/_jsx(CreateDocDrawer, {
onSave: onDocCreate
}), /*#__PURE__*/_jsx(ListDrawer, {
allowCreate: canCreate,
enableRowSelections: hasMany,
onBulkSelect: onListBulkSelect,
onSelect: onListSelect
})]
}), canCreate && !readOnly && /*#__PURE__*/_jsxs("p", {
className: `${baseClass}__dragAndDropText`,
children: [t('general:or'), " ", t('upload:dragAndDrop')]
})]
})
}) : /*#__PURE__*/_jsx(_Fragment, {
children: !readOnly && !populatedDocs && (!value || typeof maxRows !== 'number' || Array.isArray(value) && value.length < maxRows) ? /*#__PURE__*/_jsx(ShimmerEffect, {
height: "40px"
}) : null
})]
}), AfterInput, /*#__PURE__*/_jsx(RenderCustomComponent, {
CustomComponent: Description,
Fallback: /*#__PURE__*/_jsx(FieldDescription, {
description: description,
path: path
})
})]
});
}
//# sourceMappingURL=Input.js.map

View File

@@ -0,0 +1,117 @@
/*
Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function () {
'use strict';
var estraverse = require('estraverse');
function isNode(node) {
if (node == null) {
return false;
}
return typeof node === 'object' && typeof node.type === 'string';
}
function isProperty(nodeType, key) {
return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties';
}
function Visitor(visitor, options) {
options = options || {};
this.__visitor = visitor || this;
this.__childVisitorKeys = options.childVisitorKeys
? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys)
: estraverse.VisitorKeys;
if (options.fallback === 'iteration') {
this.__fallback = Object.keys;
} else if (typeof options.fallback === 'function') {
this.__fallback = options.fallback;
}
}
/* Default method for visiting children.
* When you need to call default visiting operation inside custom visiting
* operation, you can use it with `this.visitChildren(node)`.
*/
Visitor.prototype.visitChildren = function (node) {
var type, children, i, iz, j, jz, child;
if (node == null) {
return;
}
type = node.type || estraverse.Syntax.Property;
children = this.__childVisitorKeys[type];
if (!children) {
if (this.__fallback) {
children = this.__fallback(node);
} else {
throw new Error('Unknown node type ' + type + '.');
}
}
for (i = 0, iz = children.length; i < iz; ++i) {
child = node[children[i]];
if (child) {
if (Array.isArray(child)) {
for (j = 0, jz = child.length; j < jz; ++j) {
if (child[j]) {
if (isNode(child[j]) || isProperty(type, children[i])) {
this.visit(child[j]);
}
}
}
} else if (isNode(child)) {
this.visit(child);
}
}
}
};
/* Dispatching node. */
Visitor.prototype.visit = function (node) {
var type;
if (node == null) {
return;
}
type = node.type || estraverse.Syntax.Property;
if (this.__visitor[type]) {
this.__visitor[type].call(this, node);
return;
}
this.visitChildren(node);
};
exports.version = require('./package.json').version;
exports.Visitor = Visitor;
exports.visit = function (node, visitor, options) {
var v = new Visitor(visitor, options);
v.visit(node);
};
}());
/* vim: set sw=4 ts=4 et tw=80 : */

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/duplicateDocument/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAE/E,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAanE,KAAK,wBAAwB,GAAG;IAC9B,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAA;AACD,eAAO,MAAM,wBAAwB,8EAOlC,wBAAwB,KAAG,OAAO,CAAC;IACpC,iBAAiB,EAAE,UAAU,CAAA;IAC7B,4BAA4B,EAAE,UAAU,CAAA;CACzC,CA8EA,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","MoveFolderIcon","_jsxs","className","fill","height","viewBox","width","xmlns","_jsx","filter","d","stroke","strokeLinecap","strokeLinejoin","colorInterpolationFilters","filterUnits","id","x","y","in","in2","mode","result"],"sources":["../../../src/icons/MoveFolder/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport './index.scss'\n\nexport function MoveFolderIcon() {\n return (\n <svg\n className=\"icon icon--move-folder\"\n fill=\"none\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g filter=\"url(#filter0_d_278_1086)\">\n <path\n d=\"M5.33334 10V7.33334C5.33334 6.97971 5.47382 6.64058 5.72387 6.39053C5.97392 6.14048 6.31305 6 6.66668 6H9.26668C9.48967 5.99782 9.70965 6.0516 9.90648 6.15642C10.1033 6.26124 10.2707 6.41375 10.3933 6.6L10.9333 7.4C11.0547 7.58436 11.22 7.73568 11.4143 7.84041C11.6087 7.94513 11.8259 7.99997 12.0467 8H17.3333C17.687 8 18.0261 8.14048 18.2762 8.39053C18.5262 8.64058 18.6667 8.97971 18.6667 9.33334V16C18.6667 16.3536 18.5262 16.6928 18.2762 16.9428C18.0261 17.1929 17.687 17.3333 17.3333 17.3333H6.66668C6.31305 17.3333 5.97392 17.1929 5.72387 16.9428C5.47382 16.6928 5.33334 16.3536 5.33334 16V15.3333M5.33334 12.6667H12M12 12.6667L10 14.6667M12 12.6667L10 10.6667\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n <defs>\n <filter\n colorInterpolationFilters=\"sRGB\"\n filterUnits=\"userSpaceOnUse\"\n height=\"26\"\n id=\"filter0_d_278_1086\"\n width=\"26\"\n x=\"-1\"\n y=\"-1\"\n >\n <feBlend\n in=\"SourceGraphic\"\n in2=\"effect1_dropShadow_278_1086\"\n mode=\"normal\"\n result=\"shape\"\n />\n </filter>\n </defs>\n </svg>\n )\n}\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AAElB,OAAO;AAEP,OAAO,SAASC,eAAA;EACd,oBACEC,KAAA,CAAC;IACCC,SAAA,EAAU;IACVC,IAAA,EAAK;IACLC,MAAA,EAAO;IACPC,OAAA,EAAQ;IACRC,KAAA,EAAM;IACNC,KAAA,EAAM;4BAENC,IAAA,CAAC;MAAEC,MAAA,EAAO;gBACR,aAAAD,IAAA,CAAC;QACCE,CAAA,EAAE;QACFC,MAAA,EAAO;QACPC,aAAA,EAAc;QACdC,cAAA,EAAe;;qBAGnBL,IAAA,CAAC;gBACC,aAAAA,IAAA,CAAC;QACCM,yBAAA,EAA0B;QAC1BC,WAAA,EAAY;QACZX,MAAA,EAAO;QACPY,EAAA,EAAG;QACHV,KAAA,EAAM;QACNW,CAAA,EAAE;QACFC,CAAA,EAAE;kBAEF,aAAAV,IAAA,CAAC;UACCW,EAAA,EAAG;UACHC,GAAA,EAAI;UACJC,IAAA,EAAK;UACLC,MAAA,EAAO;;;;;AAMnB","ignoreList":[]}

View File

@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
"use strict";var e=require("@lexical/link"),t=require("@lexical/react/LexicalComposerContext"),n=require("@lexical/utils"),r=require("lexical"),l=require("react");exports.ClickableLinkPlugin=function({newTab:i=!0,disabled:o=!1}){const[u]=t.useLexicalComposerContext();return l.useEffect((()=>{const t=t=>{const l=t.target;if(!r.isDOMNode(l))return;const s=r.getNearestEditorFromDOMNode(l);if(null===s)return;let a=null,c=null;if(s.update((()=>{const t=r.$getNearestNodeFromDOMNode(l);if(null!==t){const i=n.$findMatchingParent(t,r.$isElementNode);if(!o)if(e.$isLinkNode(i))a=i.sanitizeUrl(i.getURL()),c=i.getTarget();else{const e=function(e,t){let n=e;for(;null!=n;){if(t(n))return n;n=n.parentNode}return null}(l,n.isHTMLAnchorElement);null!==e&&(a=e.href,c=e.target)}}})),null===a||""===a)return;const d=u.getEditorState().read(r.$getSelection);if(r.$isRangeSelection(d)&&!d.isCollapsed())return void t.preventDefault();const f="auxclick"===t.type&&1===t.button;window.open(a,i||f||t.metaKey||t.ctrlKey||"_blank"===c?"_blank":"_self"),t.preventDefault()},l=e=>{1===e.button&&t(e)};return u.registerRootListener(((e,n)=>{null!==n&&(n.removeEventListener("click",t),n.removeEventListener("mouseup",l)),null!==e&&(e.addEventListener("click",t),e.addEventListener("mouseup",l))}))}),[u,i,o]),null};

View File

@@ -0,0 +1,532 @@
function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}(function (_window$dateFns) {var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/ka/_lib/formatDistance.mjs
var formatDistanceLocale = {
lessThanXSeconds: {
past: "{{count}} \u10EC\u10D0\u10DB\u10D6\u10D4 \u10DC\u10D0\u10D9\u10DA\u10D4\u10D1\u10D8 \u10EE\u10DC\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "{{count}} \u10EC\u10D0\u10DB\u10D6\u10D4 \u10DC\u10D0\u10D9\u10DA\u10D4\u10D1\u10D8",
future: "{{count}} \u10EC\u10D0\u10DB\u10D6\u10D4 \u10DC\u10D0\u10D9\u10DA\u10D4\u10D1\u10E8\u10D8"
},
xSeconds: {
past: "{{count}} \u10EC\u10D0\u10DB\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "{{count}} \u10EC\u10D0\u10DB\u10D8",
future: "{{count}} \u10EC\u10D0\u10DB\u10E8\u10D8"
},
halfAMinute: {
past: "\u10DC\u10D0\u10EE\u10D4\u10D5\u10D0\u10E0\u10D8 \u10EC\u10E3\u10D7\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "\u10DC\u10D0\u10EE\u10D4\u10D5\u10D0\u10E0\u10D8 \u10EC\u10E3\u10D7\u10D8",
future: "\u10DC\u10D0\u10EE\u10D4\u10D5\u10D0\u10E0\u10D8 \u10EC\u10E3\u10D7\u10E8\u10D8"
},
lessThanXMinutes: {
past: "{{count}} \u10EC\u10E3\u10D7\u10D6\u10D4 \u10DC\u10D0\u10D9\u10DA\u10D4\u10D1\u10D8 \u10EE\u10DC\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "{{count}} \u10EC\u10E3\u10D7\u10D6\u10D4 \u10DC\u10D0\u10D9\u10DA\u10D4\u10D1\u10D8",
future: "{{count}} \u10EC\u10E3\u10D7\u10D6\u10D4 \u10DC\u10D0\u10D9\u10DA\u10D4\u10D1\u10E8\u10D8"
},
xMinutes: {
past: "{{count}} \u10EC\u10E3\u10D7\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "{{count}} \u10EC\u10E3\u10D7\u10D8",
future: "{{count}} \u10EC\u10E3\u10D7\u10E8\u10D8"
},
aboutXHours: {
past: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10E1\u10D0\u10D0\u10D7\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10E1\u10D0\u10D0\u10D7\u10D8",
future: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10E1\u10D0\u10D0\u10D7\u10E8\u10D8"
},
xHours: {
past: "{{count}} \u10E1\u10D0\u10D0\u10D7\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "{{count}} \u10E1\u10D0\u10D0\u10D7\u10D8",
future: "{{count}} \u10E1\u10D0\u10D0\u10D7\u10E8\u10D8"
},
xDays: {
past: "{{count}} \u10D3\u10E6\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "{{count}} \u10D3\u10E6\u10D4",
future: "{{count}} \u10D3\u10E6\u10D4\u10E8\u10D8"
},
aboutXWeeks: {
past: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10D9\u10D5\u10D8\u10E0\u10D0\u10E1 \u10EC\u10D8\u10DC",
present: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10D9\u10D5\u10D8\u10E0\u10D0",
future: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10D9\u10D5\u10D8\u10E0\u10D0\u10E8\u10D8"
},
xWeeks: {
past: "{{count}} \u10D9\u10D5\u10D8\u10E0\u10D0\u10E1 \u10D9\u10D5\u10D8\u10E0\u10D0",
present: "{{count}} \u10D9\u10D5\u10D8\u10E0\u10D0",
future: "{{count}} \u10D9\u10D5\u10D8\u10E0\u10D0\u10E8\u10D8"
},
aboutXMonths: {
past: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10D7\u10D5\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10D7\u10D5\u10D4",
future: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10D7\u10D5\u10D4\u10E8\u10D8"
},
xMonths: {
past: "{{count}} \u10D7\u10D5\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "{{count}} \u10D7\u10D5\u10D4",
future: "{{count}} \u10D7\u10D5\u10D4\u10E8\u10D8"
},
aboutXYears: {
past: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10EC\u10DA\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10EC\u10D4\u10DA\u10D8",
future: "\u10D3\u10D0\u10D0\u10EE\u10DA\u10DD\u10D4\u10D1\u10D8\u10D7 {{count}} \u10EC\u10D4\u10DA\u10E8\u10D8"
},
xYears: {
past: "{{count}} \u10EC\u10DA\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "{{count}} \u10EC\u10D4\u10DA\u10D8",
future: "{{count}} \u10EC\u10D4\u10DA\u10E8\u10D8"
},
overXYears: {
past: "{{count}} \u10EC\u10D4\u10DA\u10D6\u10D4 \u10DB\u10D4\u10E2\u10D8 \u10EE\u10DC\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "{{count}} \u10EC\u10D4\u10DA\u10D6\u10D4 \u10DB\u10D4\u10E2\u10D8",
future: "{{count}} \u10EC\u10D4\u10DA\u10D6\u10D4 \u10DB\u10D4\u10E2\u10D8 \u10EE\u10DC\u10D8\u10E1 \u10E8\u10D4\u10DB\u10D3\u10D4\u10D2"
},
almostXYears: {
past: "\u10D7\u10D8\u10D7\u10E5\u10DB\u10D8\u10E1 {{count}} \u10EC\u10DA\u10D8\u10E1 \u10EC\u10D8\u10DC",
present: "\u10D7\u10D8\u10D7\u10E5\u10DB\u10D8\u10E1 {{count}} \u10EC\u10D4\u10DA\u10D8",
future: "\u10D7\u10D8\u10D7\u10E5\u10DB\u10D8\u10E1 {{count}} \u10EC\u10D4\u10DA\u10E8\u10D8"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (options !== null && options !== void 0 && options.addSuffix && options.comparison && options.comparison > 0) {
result = tokenValue.future.replace("{{count}}", String(count));
} else if (options !== null && options !== void 0 && options.addSuffix) {
result = tokenValue.past.replace("{{count}}", String(count));
} else {
result = tokenValue.present.replace("{{count}}", String(count));
}
return result;
};
// lib/locale/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/ka/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE, do MMMM, y",
long: "do, MMMM, y",
medium: "d, MMM, y",
short: "dd/MM/yyyy"
};
var timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
};
var dateTimeFormats = {
full: "{{date}} {{time}}'-\u10D6\u10D4'",
long: "{{date}} {{time}}'-\u10D6\u10D4'",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/ka/_lib/formatRelative.mjs
var formatRelativeLocale = {
lastWeek: "'\u10EC\u10D8\u10DC\u10D0' eeee p'-\u10D6\u10D4'",
yesterday: "'\u10D2\u10E3\u10E8\u10D8\u10DC' p'-\u10D6\u10D4'",
today: "'\u10D3\u10E6\u10D4\u10E1' p'-\u10D6\u10D4'",
tomorrow: "'\u10EE\u10D5\u10D0\u10DA' p'-\u10D6\u10D4'",
nextWeek: "'\u10E8\u10D4\u10DB\u10D3\u10D4\u10D2\u10D8' eeee p'-\u10D6\u10D4'",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildLocalizeFn.mjs
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/ka/_lib/localize.mjs
var eraValues = {
narrow: ["\u10E9.\u10EC-\u10DB\u10D3\u10D4", "\u10E9.\u10EC"],
abbreviated: ["\u10E9\u10D5.\u10EC-\u10DB\u10D3\u10D4", "\u10E9\u10D5.\u10EC"],
wide: ["\u10E9\u10D5\u10D4\u10DC\u10E1 \u10EC\u10D4\u10DA\u10D7\u10D0\u10E6\u10E0\u10D8\u10EA\u10EE\u10D5\u10D0\u10DB\u10D3\u10D4", "\u10E9\u10D5\u10D4\u10DC\u10D8 \u10EC\u10D4\u10DA\u10D7\u10D0\u10E6\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8\u10D7"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-\u10DA\u10D8 \u10D9\u10D5", "2-\u10D4 \u10D9\u10D5", "3-\u10D4 \u10D9\u10D5", "4-\u10D4 \u10D9\u10D5"],
wide: ["1-\u10DA\u10D8 \u10D9\u10D5\u10D0\u10E0\u10E2\u10D0\u10DA\u10D8", "2-\u10D4 \u10D9\u10D5\u10D0\u10E0\u10E2\u10D0\u10DA\u10D8", "3-\u10D4 \u10D9\u10D5\u10D0\u10E0\u10E2\u10D0\u10DA\u10D8", "4-\u10D4 \u10D9\u10D5\u10D0\u10E0\u10E2\u10D0\u10DA\u10D8"]
};
var monthValues = {
narrow: [
"\u10D8\u10D0",
"\u10D7\u10D4",
"\u10DB\u10D0",
"\u10D0\u10DE",
"\u10DB\u10E1",
"\u10D5\u10DC",
"\u10D5\u10DA",
"\u10D0\u10D2",
"\u10E1\u10D4",
"\u10DD\u10E5",
"\u10DC\u10DD",
"\u10D3\u10D4"],
abbreviated: [
"\u10D8\u10D0\u10DC",
"\u10D7\u10D4\u10D1",
"\u10DB\u10D0\u10E0",
"\u10D0\u10DE\u10E0",
"\u10DB\u10D0\u10D8",
"\u10D8\u10D5\u10DC",
"\u10D8\u10D5\u10DA",
"\u10D0\u10D2\u10D5",
"\u10E1\u10D4\u10E5",
"\u10DD\u10E5\u10E2",
"\u10DC\u10DD\u10D4",
"\u10D3\u10D4\u10D9"],
wide: [
"\u10D8\u10D0\u10DC\u10D5\u10D0\u10E0\u10D8",
"\u10D7\u10D4\u10D1\u10D4\u10E0\u10D5\u10D0\u10DA\u10D8",
"\u10DB\u10D0\u10E0\u10E2\u10D8",
"\u10D0\u10DE\u10E0\u10D8\u10DA\u10D8",
"\u10DB\u10D0\u10D8\u10E1\u10D8",
"\u10D8\u10D5\u10DC\u10D8\u10E1\u10D8",
"\u10D8\u10D5\u10DA\u10D8\u10E1\u10D8",
"\u10D0\u10D2\u10D5\u10D8\u10E1\u10E2\u10DD",
"\u10E1\u10D4\u10E5\u10E2\u10D4\u10DB\u10D1\u10D4\u10E0\u10D8",
"\u10DD\u10E5\u10E2\u10DD\u10DB\u10D1\u10D4\u10E0\u10D8",
"\u10DC\u10DD\u10D4\u10DB\u10D1\u10D4\u10E0\u10D8",
"\u10D3\u10D4\u10D9\u10D4\u10DB\u10D1\u10D4\u10E0\u10D8"]
};
var dayValues = {
narrow: ["\u10D9\u10D5", "\u10DD\u10E0", "\u10E1\u10D0", "\u10DD\u10D7", "\u10EE\u10E3", "\u10DE\u10D0", "\u10E8\u10D0"],
short: ["\u10D9\u10D5\u10D8", "\u10DD\u10E0\u10E8", "\u10E1\u10D0\u10DB", "\u10DD\u10D7\u10EE", "\u10EE\u10E3\u10D7", "\u10DE\u10D0\u10E0", "\u10E8\u10D0\u10D1"],
abbreviated: ["\u10D9\u10D5\u10D8", "\u10DD\u10E0\u10E8", "\u10E1\u10D0\u10DB", "\u10DD\u10D7\u10EE", "\u10EE\u10E3\u10D7", "\u10DE\u10D0\u10E0", "\u10E8\u10D0\u10D1"],
wide: [
"\u10D9\u10D5\u10D8\u10E0\u10D0",
"\u10DD\u10E0\u10E8\u10D0\u10D1\u10D0\u10D7\u10D8",
"\u10E1\u10D0\u10DB\u10E8\u10D0\u10D1\u10D0\u10D7\u10D8",
"\u10DD\u10D7\u10EE\u10E8\u10D0\u10D1\u10D0\u10D7\u10D8",
"\u10EE\u10E3\u10D7\u10E8\u10D0\u10D1\u10D0\u10D7\u10D8",
"\u10DE\u10D0\u10E0\u10D0\u10E1\u10D9\u10D4\u10D5\u10D8",
"\u10E8\u10D0\u10D1\u10D0\u10D7\u10D8"]
};
var dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "\u10E8\u10E3\u10D0\u10E6\u10D0\u10DB\u10D4",
noon: "\u10E8\u10E3\u10D0\u10D3\u10E6\u10D4",
morning: "\u10D3\u10D8\u10DA\u10D0",
afternoon: "\u10E1\u10D0\u10E6\u10D0\u10DB\u10DD",
evening: "\u10E1\u10D0\u10E6\u10D0\u10DB\u10DD",
night: "\u10E6\u10D0\u10DB\u10D4"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "\u10E8\u10E3\u10D0\u10E6\u10D0\u10DB\u10D4",
noon: "\u10E8\u10E3\u10D0\u10D3\u10E6\u10D4",
morning: "\u10D3\u10D8\u10DA\u10D0",
afternoon: "\u10E1\u10D0\u10E6\u10D0\u10DB\u10DD",
evening: "\u10E1\u10D0\u10E6\u10D0\u10DB\u10DD",
night: "\u10E6\u10D0\u10DB\u10D4"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "\u10E8\u10E3\u10D0\u10E6\u10D0\u10DB\u10D4",
noon: "\u10E8\u10E3\u10D0\u10D3\u10E6\u10D4",
morning: "\u10D3\u10D8\u10DA\u10D0",
afternoon: "\u10E1\u10D0\u10E6\u10D0\u10DB\u10DD",
evening: "\u10E1\u10D0\u10E6\u10D0\u10DB\u10DD",
night: "\u10E6\u10D0\u10DB\u10D4"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "\u10E8\u10E3\u10D0\u10E6\u10D0\u10DB\u10D8\u10D7",
noon: "\u10E8\u10E3\u10D0\u10D3\u10E6\u10D8\u10E1\u10D0\u10E1",
morning: "\u10D3\u10D8\u10DA\u10D8\u10D7",
afternoon: "\u10DC\u10D0\u10E8\u10E3\u10D0\u10D3\u10E6\u10D4\u10D5\u10E1",
evening: "\u10E1\u10D0\u10E6\u10D0\u10DB\u10DD\u10E1",
night: "\u10E6\u10D0\u10DB\u10D8\u10D7"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "\u10E8\u10E3\u10D0\u10E6\u10D0\u10DB\u10D8\u10D7",
noon: "\u10E8\u10E3\u10D0\u10D3\u10E6\u10D8\u10E1\u10D0\u10E1",
morning: "\u10D3\u10D8\u10DA\u10D8\u10D7",
afternoon: "\u10DC\u10D0\u10E8\u10E3\u10D0\u10D3\u10E6\u10D4\u10D5\u10E1",
evening: "\u10E1\u10D0\u10E6\u10D0\u10DB\u10DD\u10E1",
night: "\u10E6\u10D0\u10DB\u10D8\u10D7"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "\u10E8\u10E3\u10D0\u10E6\u10D0\u10DB\u10D8\u10D7",
noon: "\u10E8\u10E3\u10D0\u10D3\u10E6\u10D8\u10E1\u10D0\u10E1",
morning: "\u10D3\u10D8\u10DA\u10D8\u10D7",
afternoon: "\u10DC\u10D0\u10E8\u10E3\u10D0\u10D3\u10E6\u10D4\u10D5\u10E1",
evening: "\u10E1\u10D0\u10E6\u10D0\u10DB\u10DD\u10E1",
night: "\u10E6\u10D0\u10DB\u10D8\u10D7"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber) {
var number = Number(dirtyNumber);
if (number === 1) {
return number + "-\u10DA\u10D8";
}
return number + "-\u10D4";
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.mjs
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
var findKey = function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
};
var findIndex = function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
};
// lib/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/ka/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)(-ლი|-ე)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(ჩვ?\.წ)/i,
abbreviated: /^(ჩვ?\.წ)/i,
wide: /^(ჩვენს წელთაღრიცხვამდე|ქრისტეშობამდე|ჩვენი წელთაღრიცხვით|ქრისტეშობიდან)/i
};
var parseEraPatterns = {
any: [
/^(ჩვენს წელთაღრიცხვამდე|ქრისტეშობამდე)/i,
/^(ჩვენი წელთაღრიცხვით|ქრისტეშობიდან)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]-(ლი|ე)? კვ/i,
wide: /^[1234]-(ლი|ე)? კვარტალი/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
any: /^(ია|თე|მა|აპ|მს|ვნ|ვლ|აგ|სე|ოქ|ნო|დე)/i
};
var parseMonthPatterns = {
any: [
/^ია/i,
/^თ/i,
/^მარ/i,
/^აპ/i,
/^მაი/i,
/^ი?ვნ/i,
/^ი?ვლ/i,
/^აგ/i,
/^ს/i,
/^ო/i,
/^ნ/i,
/^დ/i]
};
var matchDayPatterns = {
narrow: /^(კვ|ორ|სა|ოთ|ხუ|პა|შა)/i,
short: /^(კვი|ორშ|სამ|ოთხ|ხუთ|პარ|შაბ)/i,
wide: /^(კვირა|ორშაბათი|სამშაბათი|ოთხშაბათი|ხუთშაბათი|პარასკევი|შაბათი)/i
};
var parseDayPatterns = {
any: [/^კვ/i, /^ორ/i, /^სა/i, /^ოთ/i, /^ხუ/i, /^პა/i, /^შა/i]
};
var matchDayPeriodPatterns = {
any: /^([ap]\.?\s?m\.?|შუაღ|დილ)/i
};
var parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^შუაღ/i,
noon: /^შუადღ/i,
morning: /^დილ/i,
afternoon: /ნაშუადღევს/i,
evening: /საღამო/i,
night: /ღამ/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "any",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/ka.mjs
var ka = {
code: "ka",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 1
}
};
// lib/locale/ka/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
ka: ka }) });
//# debugId=E3964349FFF3A5FE64756e2164756e21
})();
//# sourceMappingURL=cdn.js.map

View File

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

View File

@@ -0,0 +1,78 @@
Prism.languages.haxe = Prism.languages.extend('clike', {
'string': {
// Strings can be multi-line
pattern: /"(?:[^"\\]|\\[\s\S])*"/,
greedy: true
},
'class-name': [
{
pattern: /(\b(?:abstract|class|enum|extends|implements|interface|new|typedef)\s+)[A-Z_]\w*/,
lookbehind: true,
},
// based on naming convention
/\b[A-Z]\w*/
],
// The final look-ahead prevents highlighting of keywords if expressions such as "haxe.macro.Expr"
'keyword': /\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|final|for|from|function|if|implements|import|in|inline|interface|macro|new|null|operator|overload|override|package|private|public|return|static|super|switch|throw|to|try|typedef|untyped|using|var|while)(?!\.)\b/,
'function': {
pattern: /\b[a-z_]\w*(?=\s*(?:<[^<>]*>\s*)?\()/i,
greedy: true
},
'operator': /\.{3}|\+\+|--|&&|\|\||->|=>|(?:<<?|>{1,3}|[-+*/%!=&|^])=?|[?:~]/
});
Prism.languages.insertBefore('haxe', 'string', {
'string-interpolation': {
pattern: /'(?:[^'\\]|\\[\s\S])*'/,
greedy: true,
inside: {
'interpolation': {
pattern: /(^|[^\\])\$(?:\w+|\{[^{}]+\})/,
lookbehind: true,
inside: {
'interpolation-punctuation': {
pattern: /^\$\{?|\}$/,
alias: 'punctuation'
},
'expression': {
pattern: /[\s\S]+/,
inside: Prism.languages.haxe
},
}
},
'string': /[\s\S]+/
}
}
});
Prism.languages.insertBefore('haxe', 'class-name', {
'regex': {
pattern: /~\/(?:[^\/\\\r\n]|\\.)+\/[a-z]*/,
greedy: true,
inside: {
'regex-flags': /\b[a-z]+$/,
'regex-source': {
pattern: /^(~\/)[\s\S]+(?=\/$)/,
lookbehind: true,
alias: 'language-regex',
inside: Prism.languages.regex
},
'regex-delimiter': /^~\/|\/$/,
}
}
});
Prism.languages.insertBefore('haxe', 'keyword', {
'preprocessor': {
pattern: /#(?:else|elseif|end|if)\b.*/,
alias: 'property'
},
'metadata': {
pattern: /@:?[\w.]+/,
alias: 'symbol'
},
'reification': {
pattern: /\$(?:\w+|(?=\{))/,
alias: 'important'
}
});

View File

@@ -0,0 +1,303 @@
import {
AST_Array,
AST_Atom,
AST_Await,
AST_BigInt,
AST_Binary,
AST_Block,
AST_Call,
AST_Catch,
AST_Chain,
AST_Class,
AST_ClassProperty,
AST_ClassPrivateProperty,
AST_ConciseMethod,
AST_Conditional,
AST_Debugger,
AST_DefinitionsLike,
AST_Destructuring,
AST_Directive,
AST_Do,
AST_Dot,
AST_DotHash,
AST_EmptyStatement,
AST_Expansion,
AST_Export,
AST_Finally,
AST_For,
AST_ForIn,
AST_ForOf,
AST_If,
AST_Import,
AST_ImportMeta,
AST_Jump,
AST_LabeledStatement,
AST_Lambda,
AST_LoopControl,
AST_NameMapping,
AST_NewTarget,
AST_Node,
AST_Number,
AST_Object,
AST_ObjectGetter,
AST_ObjectKeyVal,
AST_ObjectProperty,
AST_ObjectSetter,
AST_PrefixedTemplateString,
AST_PrivateIn,
AST_PrivateMethod,
AST_PropAccess,
AST_RegExp,
AST_Sequence,
AST_SimpleStatement,
AST_String,
AST_Super,
AST_Switch,
AST_SwitchBranch,
AST_Symbol,
AST_TemplateSegment,
AST_TemplateString,
AST_This,
AST_Toplevel,
AST_Try,
AST_Unary,
AST_VarDefLike,
AST_While,
AST_With,
AST_Yield
} from "./ast.js";
const shallow_cmp = (node1, node2) => {
return (
node1 === null && node2 === null
|| node1.TYPE === node2.TYPE && node1.shallow_cmp(node2)
);
};
export const equivalent_to = (tree1, tree2) => {
if (!shallow_cmp(tree1, tree2)) return false;
const walk_1_state = [tree1];
const walk_2_state = [tree2];
const walk_1_push = walk_1_state.push.bind(walk_1_state);
const walk_2_push = walk_2_state.push.bind(walk_2_state);
while (walk_1_state.length && walk_2_state.length) {
const node_1 = walk_1_state.pop();
const node_2 = walk_2_state.pop();
if (!shallow_cmp(node_1, node_2)) return false;
node_1._children_backwards(walk_1_push);
node_2._children_backwards(walk_2_push);
if (walk_1_state.length !== walk_2_state.length) {
// Different number of children
return false;
}
}
return walk_1_state.length == 0 && walk_2_state.length == 0;
};
const pass_through = () => true;
AST_Node.prototype.shallow_cmp = function () {
throw new Error("did not find a shallow_cmp function for " + this.constructor.name);
};
AST_Debugger.prototype.shallow_cmp = pass_through;
AST_Directive.prototype.shallow_cmp = function(other) {
return this.value === other.value;
};
AST_SimpleStatement.prototype.shallow_cmp = pass_through;
AST_Block.prototype.shallow_cmp = pass_through;
AST_EmptyStatement.prototype.shallow_cmp = pass_through;
AST_LabeledStatement.prototype.shallow_cmp = function(other) {
return this.label.name === other.label.name;
};
AST_Do.prototype.shallow_cmp = pass_through;
AST_While.prototype.shallow_cmp = pass_through;
AST_For.prototype.shallow_cmp = function(other) {
return (this.init == null ? other.init == null : this.init === other.init) && (this.condition == null ? other.condition == null : this.condition === other.condition) && (this.step == null ? other.step == null : this.step === other.step);
};
AST_ForIn.prototype.shallow_cmp = pass_through;
AST_ForOf.prototype.shallow_cmp = pass_through;
AST_With.prototype.shallow_cmp = pass_through;
AST_Toplevel.prototype.shallow_cmp = pass_through;
AST_Expansion.prototype.shallow_cmp = pass_through;
AST_Lambda.prototype.shallow_cmp = function(other) {
return this.is_generator === other.is_generator && this.async === other.async;
};
AST_Destructuring.prototype.shallow_cmp = function(other) {
return this.is_array === other.is_array;
};
AST_PrefixedTemplateString.prototype.shallow_cmp = pass_through;
AST_TemplateString.prototype.shallow_cmp = pass_through;
AST_TemplateSegment.prototype.shallow_cmp = function(other) {
return this.value === other.value;
};
AST_Jump.prototype.shallow_cmp = pass_through;
AST_LoopControl.prototype.shallow_cmp = pass_through;
AST_Await.prototype.shallow_cmp = pass_through;
AST_Yield.prototype.shallow_cmp = function(other) {
return this.is_star === other.is_star;
};
AST_If.prototype.shallow_cmp = function(other) {
return this.alternative == null ? other.alternative == null : this.alternative === other.alternative;
};
AST_Switch.prototype.shallow_cmp = pass_through;
AST_SwitchBranch.prototype.shallow_cmp = pass_through;
AST_Try.prototype.shallow_cmp = function(other) {
return (this.body === other.body) && (this.bcatch == null ? other.bcatch == null : this.bcatch === other.bcatch) && (this.bfinally == null ? other.bfinally == null : this.bfinally === other.bfinally);
};
AST_Catch.prototype.shallow_cmp = function(other) {
return this.argname == null ? other.argname == null : this.argname === other.argname;
};
AST_Finally.prototype.shallow_cmp = pass_through;
AST_DefinitionsLike.prototype.shallow_cmp = pass_through;
AST_VarDefLike.prototype.shallow_cmp = function(other) {
return this.value == null ? other.value == null : this.value === other.value;
};
AST_NameMapping.prototype.shallow_cmp = pass_through;
AST_Import.prototype.shallow_cmp = function(other) {
return (this.imported_name == null ? other.imported_name == null : this.imported_name === other.imported_name) && (this.imported_names == null ? other.imported_names == null : this.imported_names === other.imported_names) && (this.attributes == null ? other.attributes == null : this.attributes === other.attributes);
};
AST_ImportMeta.prototype.shallow_cmp = pass_through;
AST_Export.prototype.shallow_cmp = function(other) {
return (this.exported_definition == null ? other.exported_definition == null : this.exported_definition === other.exported_definition) && (this.exported_value == null ? other.exported_value == null : this.exported_value === other.exported_value) && (this.exported_names == null ? other.exported_names == null : this.exported_names === other.exported_names) && (this.attributes == null ? other.attributes == null : this.attributes === other.attributes) && this.module_name === other.module_name && this.is_default === other.is_default;
};
AST_Call.prototype.shallow_cmp = pass_through;
AST_Sequence.prototype.shallow_cmp = pass_through;
AST_PropAccess.prototype.shallow_cmp = pass_through;
AST_Chain.prototype.shallow_cmp = pass_through;
AST_Dot.prototype.shallow_cmp = function(other) {
return this.property === other.property;
};
AST_DotHash.prototype.shallow_cmp = function(other) {
return this.property === other.property;
};
AST_Unary.prototype.shallow_cmp = function(other) {
return this.operator === other.operator;
};
AST_Binary.prototype.shallow_cmp = function(other) {
return this.operator === other.operator;
};
AST_PrivateIn.prototype.shallow_cmp = pass_through;
AST_Conditional.prototype.shallow_cmp = pass_through;
AST_Array.prototype.shallow_cmp = pass_through;
AST_Object.prototype.shallow_cmp = pass_through;
AST_ObjectProperty.prototype.shallow_cmp = pass_through;
AST_ObjectKeyVal.prototype.shallow_cmp = function(other) {
return this.key === other.key && this.quote === other.quote;
};
AST_ObjectSetter.prototype.shallow_cmp = function(other) {
return this.static === other.static;
};
AST_ObjectGetter.prototype.shallow_cmp = function(other) {
return this.static === other.static;
};
AST_ConciseMethod.prototype.shallow_cmp = function(other) {
return this.static === other.static;
};
AST_PrivateMethod.prototype.shallow_cmp = function(other) {
return this.static === other.static;
};
AST_Class.prototype.shallow_cmp = function(other) {
return (this.name == null ? other.name == null : this.name === other.name) && (this.extends == null ? other.extends == null : this.extends === other.extends);
};
AST_ClassProperty.prototype.shallow_cmp = function(other) {
return this.static === other.static
&& (typeof this.key === "string"
? this.key === other.key
: true /* AST_Node handled elsewhere */);
};
AST_ClassPrivateProperty.prototype.shallow_cmp = function(other) {
return this.static === other.static;
};
AST_Symbol.prototype.shallow_cmp = function(other) {
return this.name === other.name;
};
AST_NewTarget.prototype.shallow_cmp = pass_through;
AST_This.prototype.shallow_cmp = pass_through;
AST_Super.prototype.shallow_cmp = pass_through;
AST_String.prototype.shallow_cmp = function(other) {
return this.value === other.value;
};
AST_Number.prototype.shallow_cmp = function(other) {
return this.value === other.value;
};
AST_BigInt.prototype.shallow_cmp = function(other) {
return this.value === other.value;
};
AST_RegExp.prototype.shallow_cmp = function (other) {
return (
this.value.flags === other.value.flags
&& this.value.source === other.value.source
);
};
AST_Atom.prototype.shallow_cmp = pass_through;

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _setPrototypeOf;
function _setPrototypeOf(o, p) {
exports.default = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
//# sourceMappingURL=setPrototypeOf.js.map

View File

@@ -0,0 +1,25 @@
import { daysInWeek } from "./constants.mjs";
/**
* @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
*/
export function weeksToDays(weeks) {
return Math.trunc(weeks * daysInWeek);
}
// Fallback for modularized imports:
export default weeksToDays;

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