@harnessio/ui 0.5.70 → 0.5.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.d.ts +8 -1
- package/dist/components.js +1 -1
- package/dist/context.d.ts +3 -0
- package/dist/context.js +7 -6
- package/dist/{index-wmoXHrrC.js → index-B2o2Qi6U.js} +3 -3
- package/dist/{index-wmoXHrrC.js.map → index-B2o2Qi6U.js.map} +1 -1
- package/dist/{index-n21j6vWp.js → index-BWZEjaFe.js} +5694 -5641
- package/dist/{index-n21j6vWp.js.map → index-BWZEjaFe.js.map} +1 -1
- package/dist/{index-BvoDfbvj.js → index-BoHdNQzo.js} +37 -32
- package/dist/index-BoHdNQzo.js.map +1 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.js +3 -3
- package/dist/styles.css +1 -1
- package/dist/tailwind.config.js +5 -5
- package/dist/tailwind.config.js.map +1 -1
- package/dist/themes/{dark-high-contrast-deuteranopia.c8c39c54.css → dark-high-contrast-deuteranopia.169ab08b.css} +1 -1
- package/dist/themes/{dark-high-contrast-protanopia.b9bcfd58.css → dark-high-contrast-protanopia.b6664061.css} +1 -1
- package/dist/themes/{dark-high-contrast-tritanopia.67ba5a74.css → dark-high-contrast-tritanopia.0d7a8702.css} +1 -1
- package/dist/themes/{dark-high-contrast.c2d9106b.css → dark-high-contrast.73c0d3a7.css} +1 -1
- package/dist/themes/theme-manifest.js +4 -4
- package/dist/themes/theme-manifest.json +4 -4
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/index-BvoDfbvj.js.map +0 -1
package/dist/components.d.ts
CHANGED
|
@@ -1290,7 +1290,7 @@ declare interface CustomItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
1290
1290
|
children: ReactNode;
|
|
1291
1291
|
}
|
|
1292
1292
|
|
|
1293
|
-
export declare const DataTable: (<TData>({ data, columns, size, variant, paginationProps, getRowClassName, onRowClick, getRowLink, disableHighlightOnHover, className, currentSorting, currentRowSelection, onSortingChange: externalOnSortingChange, enableRowSelection, onRowSelectionChange: externalOnRowSelectionChange, enableExpanding, getRowCanExpand, getRowCanSelect, getIsRowDisabled, initiallyExpandAllRows, currentExpanded, onExpandedChange: externalOnExpandedChange, renderSubComponent, getSubRows, _enableColumnResizing, getRowId, visibleColumns, columnPinning }: DataTableProps<TData>) => JSX_2.Element) & {
|
|
1293
|
+
export declare const DataTable: (<TData>({ data, columns, size, variant, paginationProps, getRowClassName, onRowClick, getRowLink, disableHighlightOnHover, className, currentSorting, currentRowSelection, onSortingChange: externalOnSortingChange, enableRowSelection, onRowSelectionChange: externalOnRowSelectionChange, enableExpanding, getRowCanExpand, getRowCanSelect, getIsRowDisabled, initiallyExpandAllRows, currentExpanded, onExpandedChange: externalOnExpandedChange, renderSubComponent, getSubRows, _enableColumnResizing, getRowId, visibleColumns, columnPinning, manualSorting }: DataTableProps<TData>) => JSX_2.Element) & {
|
|
1294
1294
|
ColumnFilter: FC<DataTableColumnFilterDropdownProps>;
|
|
1295
1295
|
};
|
|
1296
1296
|
|
|
@@ -1312,6 +1312,11 @@ export declare interface DataTableProps<TData> {
|
|
|
1312
1312
|
disableHighlightOnHover?: boolean;
|
|
1313
1313
|
className?: string;
|
|
1314
1314
|
currentSorting?: SortingState;
|
|
1315
|
+
/**
|
|
1316
|
+
* See {@link https://tanstack.com/table/latest/docs/api/features/sorting#manualsorting React Table docs}.
|
|
1317
|
+
* Unless disabled, you must sort the data yourself (such as on the server side).
|
|
1318
|
+
*/
|
|
1319
|
+
manualSorting?: boolean;
|
|
1315
1320
|
currentRowSelection?: RowSelectionState;
|
|
1316
1321
|
columnPinning?: ColumnPinningState;
|
|
1317
1322
|
/**
|
|
@@ -5902,6 +5907,8 @@ export declare interface ThemeDialogProps {
|
|
|
5902
5907
|
showAccentColor?: boolean;
|
|
5903
5908
|
showGrayColor?: boolean;
|
|
5904
5909
|
showAccessibilityThemeOptions?: boolean;
|
|
5910
|
+
/** Contrast levels to omit from the selector. Defaults to hiding deprecated Low/dimmer. */
|
|
5911
|
+
hiddenContrastOptions?: ContrastType[];
|
|
5905
5912
|
/** Optional loading state indicator */
|
|
5906
5913
|
isThemeLoading?: boolean;
|
|
5907
5914
|
}
|
package/dist/components.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as e, B as t, j as o, E as r, k as i, r as n, L as l, S as b, s as p, t as c, c as g } from "./index-Do23wv9r.js";
|
|
2
2
|
import { B as m, x as d, I as S, y as T, r as C, z as I, T as h, v as F, h as y, E as V, F as D, w as P } from "./button-Dngz8cJe.js";
|
|
3
|
-
import { bJ as A, G as B, A as M, t as x, v as w, o as f, p as v, bg as k, I as N, bs as E, ad as W, c8 as R, Y as G, V as H, bm as O, an as _, aP as U, aQ as z, aS as K, aR as j, c2 as X, aa as q, ab as J, b5 as Q, z as Y, q as Z, F as $, am as aa, al as sa, C as ea, Z as ta, ah as oa, bd as ra, g as ia, bp as na, at as la, Q as ba, O as pa, bj as ca, bq as ga, br as ua, aJ as ma, D as da, j as Sa, cd as Ta, bk as Ca, bT as Ia, _ as ha, b4 as Fa, af as ya, f as Va, ai as Da, c9 as Pa, ae as La, aB as Aa, aA as Ba, aC as Ma, az as xa, b3 as wa, bf as fa, a7 as va, bS as ka, a2 as Na, a4 as Ea, a3 as Wa, ak as Ra, bK as Ga, H as Ha, E as Oa, bb as _a, aq as Ua, a9 as za, ca as Ka, X as ja, $ as Xa, bN as qa, bO as Ja, bM as Qa, a0 as Ya, l as Za, L as $a, M as as, ap as ss, cb as es, r as ts, a1 as os, aT as rs, a6 as is, ay as ns, ax as ls, aF as bs, bl as ps, N as cs, aO as gs, n as us, bQ as ms, c7 as ds, P as Ss, R as Ts, b_ as Cs, k as Is, aN as hs, as as Fs, a$ as ys, a_ as Vs, aU as Ds, aZ as Ps, aV as Ls, aW as As, aX as Bs, aY as Ms, ac as xs, b0 as ws, be as fs, b6 as vs, bZ as ks, aL as Ns, aK as Es, c5 as Ws, bW as Rs, B as Gs, bR as Hs, w as Os, c6 as _s, a8 as Us, aM as zs, aw as Ks, b as js, bE as Xs, bx as qs, c3 as Js, aH as Qs, c4 as Ys, y as Zs, bi as $s, S as ae, J as se, K as ee, av as te, bh as oe, c as re, aG as ie, bA as ne, bv as le, d as be, cc as pe, bB as ce, bC as ge, au as ue, a as me, bo as de, T as Se, bc as Te, bP as Ce, a5 as Ie, bH as he, b9 as Fe, b8 as ye, ba as Ve, c1 as De, ar as Pe, b2 as Le, bF as Ae, U as Be, bu as Me, bt as xe, bG as we, bw as fe, m as ve, W as ke, h as Ne, aj as Ee, bX as We, ao as Re, bI as Ge, bV as He, bY as Oe, bL as _e, b$ as Ue, aE as ze, aD as Ke, bU as je, bD as Xe, bz as qe, by as Je, e as Qe, s as Ye, bn as Ze, c0 as $e, ag as at, ce as st, b7 as et, b1 as tt, x as ot, u as rt, aI as it } from "./index-
|
|
3
|
+
import { bJ as A, G as B, A as M, t as x, v as w, o as f, p as v, bg as k, I as N, bs as E, ad as W, c8 as R, Y as G, V as H, bm as O, an as _, aP as U, aQ as z, aS as K, aR as j, c2 as X, aa as q, ab as J, b5 as Q, z as Y, q as Z, F as $, am as aa, al as sa, C as ea, Z as ta, ah as oa, bd as ra, g as ia, bp as na, at as la, Q as ba, O as pa, bj as ca, bq as ga, br as ua, aJ as ma, D as da, j as Sa, cd as Ta, bk as Ca, bT as Ia, _ as ha, b4 as Fa, af as ya, f as Va, ai as Da, c9 as Pa, ae as La, aB as Aa, aA as Ba, aC as Ma, az as xa, b3 as wa, bf as fa, a7 as va, bS as ka, a2 as Na, a4 as Ea, a3 as Wa, ak as Ra, bK as Ga, H as Ha, E as Oa, bb as _a, aq as Ua, a9 as za, ca as Ka, X as ja, $ as Xa, bN as qa, bO as Ja, bM as Qa, a0 as Ya, l as Za, L as $a, M as as, ap as ss, cb as es, r as ts, a1 as os, aT as rs, a6 as is, ay as ns, ax as ls, aF as bs, bl as ps, N as cs, aO as gs, n as us, bQ as ms, c7 as ds, P as Ss, R as Ts, b_ as Cs, k as Is, aN as hs, as as Fs, a$ as ys, a_ as Vs, aU as Ds, aZ as Ps, aV as Ls, aW as As, aX as Bs, aY as Ms, ac as xs, b0 as ws, be as fs, b6 as vs, bZ as ks, aL as Ns, aK as Es, c5 as Ws, bW as Rs, B as Gs, bR as Hs, w as Os, c6 as _s, a8 as Us, aM as zs, aw as Ks, b as js, bE as Xs, bx as qs, c3 as Js, aH as Qs, c4 as Ys, y as Zs, bi as $s, S as ae, J as se, K as ee, av as te, bh as oe, c as re, aG as ie, bA as ne, bv as le, d as be, cc as pe, bB as ce, bC as ge, au as ue, a as me, bo as de, T as Se, bc as Te, bP as Ce, a5 as Ie, bH as he, b9 as Fe, b8 as ye, ba as Ve, c1 as De, ar as Pe, b2 as Le, bF as Ae, U as Be, bu as Me, bt as xe, bG as we, bw as fe, m as ve, W as ke, h as Ne, aj as Ee, bX as We, ao as Re, bI as Ge, bV as He, bY as Oe, bL as _e, b$ as Ue, aE as ze, aD as Ke, bU as je, bD as Xe, bz as qe, by as Je, e as Qe, s as Ye, bn as Ze, c0 as $e, ag as at, ce as st, b7 as et, b1 as tt, x as ot, u as rt, aI as it } from "./index-BWZEjaFe.js";
|
|
4
4
|
import { L as lt, T as bt, b as pt, d as ct, e as gt, f as ut, t as mt } from "./toggle-group-BfbZsR0T.js";
|
|
5
5
|
export {
|
|
6
6
|
A as AccentColor,
|
package/dist/context.d.ts
CHANGED
|
@@ -731,6 +731,9 @@ declare const LinkDefault: ForwardRefExoticComponent<LinkProps & RefAttributes<H
|
|
|
731
731
|
|
|
732
732
|
export { LinkProps }
|
|
733
733
|
|
|
734
|
+
/** Rewrite deprecated dimmer/low contrast themes to standard contrast. */
|
|
735
|
+
export declare function migrateLowContrastTheme(theme?: FullTheme): FullTheme | undefined;
|
|
736
|
+
|
|
734
737
|
export declare enum ModeType {
|
|
735
738
|
Dark = "dark",
|
|
736
739
|
Light = "light",
|
package/dist/context.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { G as a, H as r, u as s, a as t } from "./button-Dngz8cJe.js";
|
|
2
|
-
import { R as
|
|
2
|
+
import { R as m, u as n } from "./use-resize-observer-DNQ1lBLF.js";
|
|
3
3
|
import { e as C, v as x, w as T, f as g, x as l, q as p, d, u as f } from "./index-Do23wv9r.js";
|
|
4
|
-
import { C as v, E as h, a as D,
|
|
4
|
+
import { C as v, E as h, a as D, m as E, u as R, b as y } from "./index-BoHdNQzo.js";
|
|
5
5
|
import { a as M, C as S, M as b, l as k, k as q } from "./types-DuzuERyI.js";
|
|
6
6
|
export {
|
|
7
7
|
M as ColorType,
|
|
@@ -13,19 +13,20 @@ export {
|
|
|
13
13
|
D as ExitConfirmProvider,
|
|
14
14
|
b as ModeType,
|
|
15
15
|
a as PortalProvider,
|
|
16
|
-
|
|
16
|
+
m as RouterContextProvider,
|
|
17
17
|
r as ThemeProvider,
|
|
18
18
|
T as TranslationProvider,
|
|
19
19
|
g as TriggerBase,
|
|
20
20
|
k as defaultTheme,
|
|
21
21
|
l as getT,
|
|
22
22
|
q as getThemeCSSName,
|
|
23
|
-
E as
|
|
23
|
+
E as migrateLowContrastTheme,
|
|
24
|
+
R as useComponents,
|
|
24
25
|
p as useCustomDialogTrigger,
|
|
25
|
-
|
|
26
|
+
y as useExitConfirm,
|
|
26
27
|
s as usePortal,
|
|
27
28
|
d as useRegisterDialog,
|
|
28
|
-
|
|
29
|
+
n as useRouterContext,
|
|
29
30
|
t as useTheme,
|
|
30
31
|
f as useTranslation
|
|
31
32
|
};
|
|
@@ -34,10 +34,10 @@ const d = /^[a-zA-Z_][0-9a-zA-Z_]*$/, p = /^[a-zA-Z_][0-9a-zA-Z_-]*$/, c = [
|
|
|
34
34
|
"account",
|
|
35
35
|
"class",
|
|
36
36
|
"shellScriptProvisioner"
|
|
37
|
-
], ue = (e) => le.string().regex(
|
|
37
|
+
], ue = (e) => le.string().min(1, e != null && e.requiredErrorMsg ? e == null ? void 0 : e.requiredErrorMsg : "Identifier is required").regex(
|
|
38
38
|
e != null && e.allowHyphen ? p : d,
|
|
39
39
|
e != null && e.regexErrorMsg ? e == null ? void 0 : e.regexErrorMsg : "Identifier can only contain alphanumerics, _ and $"
|
|
40
|
-
).
|
|
40
|
+
).refine((a) => !c.includes(a), {
|
|
41
41
|
message: `Identifier must not be one of the following values: ${c.join(", ")}`
|
|
42
42
|
});
|
|
43
43
|
function I(e = "requestAnimationFrame", a) {
|
|
@@ -140,4 +140,4 @@ export {
|
|
|
140
140
|
Ce as i,
|
|
141
141
|
d as r
|
|
142
142
|
};
|
|
143
|
-
//# sourceMappingURL=index-
|
|
143
|
+
//# sourceMappingURL=index-B2o2Qi6U.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-wmoXHrrC.js","sources":["../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constructNow.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/formatDistanceToNow.mjs","../src/utils/schema.ts","../src/utils/task.ts"],"sourcesContent":["import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name constructNow\n * @category Generic Helpers\n * @summary Constructs a new current date using the passed value constructor.\n * @pure false\n *\n * @description\n * The function constructs a new current date using the constructor from\n * the reference date. It helps to build generic functions that accept date\n * extensions and use the current date.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @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).\n *\n * @param date - The reference date to take constructor from\n *\n * @returns Current date initialized using the given date constructor\n *\n * @example\n * import { constructNow, isSameDay } from 'date-fns'\n *\n * function isToday<DateType extends Date>(\n * date: DateType | number | string,\n * ): boolean {\n * // If we were to use `new Date()` directly, the function would behave\n * // differently in different timezones and return false for the same date.\n * return isSameDay(date, constructNow(date));\n * }\n */\nexport function constructNow(date) {\n return constructFrom(date, Date.now());\n}\n\n// Fallback for modularized imports:\nexport default constructNow;\n","import { constructNow } from \"./constructNow.mjs\";\nimport { formatDistance } from \"./formatDistance.mjs\";\n\n/**\n * The {@link formatDistanceToNow} function options.\n */\n\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @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).\n *\n * @param date - The given date\n * @param options - The object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistanceToNow(date, options) {\n return formatDistance(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNow;\n","import { z } from 'zod'\n\n// Assuming these are defined elsewhere by the user\nexport const regexIdentifier = /^[a-zA-Z_][0-9a-zA-Z_]*$/\n\nexport const hyphenRegexIdentifier = /^[a-zA-Z_][0-9a-zA-Z_-]*$/\n\nexport const illegalIdentifiers = [\n 'or',\n 'and',\n 'eq',\n 'ne',\n 'lt',\n 'gt',\n 'le',\n 'ge',\n 'div',\n 'mod',\n 'not',\n 'null',\n 'true',\n 'false',\n 'new',\n 'var',\n 'return',\n 'step',\n 'parallel',\n 'stepGroup',\n 'insert',\n 'org',\n 'account',\n 'class',\n 'shellScriptProvisioner'\n]\n\nexport const identifierSchema = (config?: {\n allowHyphen?: boolean\n regexErrorMsg?: string\n requiredErrorMsg?: string\n}) =>\n z\n .string()\n .regex(\n config?.allowHyphen ? hyphenRegexIdentifier : regexIdentifier,\n config?.regexErrorMsg ? config?.regexErrorMsg : 'Identifier can only contain alphanumerics, _ and $'\n )\n .min(1, config?.requiredErrorMsg ? config?.requiredErrorMsg : 'Identifier is required')\n .refine(val => !illegalIdentifiers.includes(val), {\n message: `Identifier must not be one of the following values: ${illegalIdentifiers.join(', ')}`\n })\n","type Task = () => void\ntype RunnerType = 'requestAnimationFrame' | 'requestIdleCallback' | 'setTimeout'\n\nfunction createTaskPool(type: RunnerType = 'requestAnimationFrame', blockSize: number) {\n const tasks: Array<[Task, number]> = []\n const runner = type === 'requestAnimationFrame' ? requestAnimationFrame : window.requestIdleCallback\n\n let id = 1\n let running = false\n\n const scheduleTask = (task: Task, priority = tasks.length) => {\n id = id + 1 < Number.MAX_SAFE_INTEGER ? id + 1 : 1\n tasks.splice(priority, 0, [task, id])\n run()\n return id\n }\n\n const run = () => {\n if (!running && tasks.length) {\n running = true\n\n const block = tasks.splice(0, blockSize)\n\n const blockTracking = block.map(_ => {\n let resolve: (value: unknown) => void = noop\n new Promise(_resolve => (resolve = _resolve))\n return { resolve }\n })\n\n block.forEach((task, idx) => runner(() => blockTracking[idx].resolve(task[0]?.())))\n\n Promise.all(blockTracking).then(() => {\n running = false\n if (tasks.length) run()\n })\n }\n }\n\n const cancelTask = (taskId: number) => {\n const index = tasks.findIndex(([, _id]) => _id === taskId)\n if (index > -1) tasks.splice(index, 1)\n }\n\n return { scheduleTask, cancelTask }\n}\n\nconst EXECUTION_BLOCK_SIZE = 10\nconst noop = () => 0\n\nexport const createRequestAnimationFrameTaskPool = (blockSize = EXECUTION_BLOCK_SIZE) =>\n createTaskPool('requestAnimationFrame', blockSize)\nexport const createRequestIdleCallbackTaskPool = (blockSize = EXECUTION_BLOCK_SIZE) =>\n createTaskPool('requestIdleCallback', blockSize)\n\n// Polly fill requestIdleCallback/cancelIdleCallback for Safari\nwindow.requestIdleCallback =\n window.requestIdleCallback ||\n function (cb) {\n const start = Date.now()\n return setTimeout(function () {\n cb({\n didTimeout: false,\n timeRemaining: function () {\n return Math.max(0, 50 - (Date.now() - start))\n }\n })\n }, 1)\n }\n\nwindow.cancelIdleCallback =\n window.cancelIdleCallback ||\n function (id) {\n clearTimeout(id)\n }\n"],"names":["constructNow","date","constructFrom","formatDistanceToNow","options","formatDistance","regexIdentifier","hyphenRegexIdentifier","illegalIdentifiers","identifierSchema","config","z","val","createTaskPool","type","blockSize","tasks","runner","id","running","scheduleTask","task","priority","run","block","blockTracking","_","resolve","noop","_resolve","idx","_a","taskId","index","_id","EXECUTION_BLOCK_SIZE","createRequestAnimationFrameTaskPool","createRequestIdleCallbackTaskPool","cb","start"],"mappings":";;;;AAgCO,SAASA,GAAaC,GAAM;AACjC,SAAOC,EAAcD,GAAM,KAAK,IAAG,CAAE;AACvC;ACwDO,SAASE,GAAoBF,GAAMG,GAAS;AACjD,SAAOC,EAAeJ,GAAMD,GAAaC,CAAI,GAAGG,CAAO;AACzD;ACzFO,MAAME,IAAkB,4BAElBC,IAAwB,6BAExBC,IAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEaC,KAAmB,CAACC,MAK/BC,GACG,OACA,EAAA;AAAA,EACCD,KAAA,QAAAA,EAAQ,cAAcH,IAAwBD;AAAA,EAC9CI,KAAA,QAAAA,EAAQ,gBAAgBA,KAAA,gBAAAA,EAAQ,gBAAgB;AAClD,EACC,IAAI,GAAGA,KAAA,QAAAA,EAAQ,mBAAmBA,KAAA,gBAAAA,EAAQ,mBAAmB,wBAAwB,EACrF,OAAO,CAAOE,MAAA,CAAC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,KAAO,MAAM,GAENQ,KAAsC,CAACrB,IAAYoB,MAC9DtB,EAAe,yBAAyBE,CAAS,GACtCsB,KAAoC,CAACtB,IAAYoB,MAC5DtB,EAAe,uBAAuBE,CAAS;AAGjD,OAAO,sBACL,OAAO,uBACP,SAAUuB,GAAI;AACN,QAAAC,IAAQ,KAAK,IAAI;AACvB,SAAO,WAAW,WAAY;AACzB,IAAAD,EAAA;AAAA,MACD,YAAY;AAAA,MACZ,eAAe,WAAY;AACzB,eAAO,KAAK,IAAI,GAAG,MAAM,KAAK,IAAA,IAAQC,EAAM;AAAA,MAAA;AAAA,IAC9C,CACD;AAAA,KACA,CAAC;AACN;AAEF,OAAO,qBACL,OAAO,sBACP,SAAUrB,GAAI;AACZ,eAAaA,CAAE;AACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"index-B2o2Qi6U.js","sources":["../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/constructNow.mjs","../../../node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/formatDistanceToNow.mjs","../src/utils/schema.ts","../src/utils/task.ts"],"sourcesContent":["import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name constructNow\n * @category Generic Helpers\n * @summary Constructs a new current date using the passed value constructor.\n * @pure false\n *\n * @description\n * The function constructs a new current date using the constructor from\n * the reference date. It helps to build generic functions that accept date\n * extensions and use the current date.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @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).\n *\n * @param date - The reference date to take constructor from\n *\n * @returns Current date initialized using the given date constructor\n *\n * @example\n * import { constructNow, isSameDay } from 'date-fns'\n *\n * function isToday<DateType extends Date>(\n * date: DateType | number | string,\n * ): boolean {\n * // If we were to use `new Date()` directly, the function would behave\n * // differently in different timezones and return false for the same date.\n * return isSameDay(date, constructNow(date));\n * }\n */\nexport function constructNow(date) {\n return constructFrom(date, Date.now());\n}\n\n// Fallback for modularized imports:\nexport default constructNow;\n","import { constructNow } from \"./constructNow.mjs\";\nimport { formatDistance } from \"./formatDistance.mjs\";\n\n/**\n * The {@link formatDistanceToNow} function options.\n */\n\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @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).\n *\n * @param date - The given date\n * @param options - The object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistanceToNow(date, options) {\n return formatDistance(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNow;\n","import { z } from 'zod'\n\n// Assuming these are defined elsewhere by the user\nexport const regexIdentifier = /^[a-zA-Z_][0-9a-zA-Z_]*$/\n\nexport const hyphenRegexIdentifier = /^[a-zA-Z_][0-9a-zA-Z_-]*$/\n\nexport const illegalIdentifiers = [\n 'or',\n 'and',\n 'eq',\n 'ne',\n 'lt',\n 'gt',\n 'le',\n 'ge',\n 'div',\n 'mod',\n 'not',\n 'null',\n 'true',\n 'false',\n 'new',\n 'var',\n 'return',\n 'step',\n 'parallel',\n 'stepGroup',\n 'insert',\n 'org',\n 'account',\n 'class',\n 'shellScriptProvisioner'\n]\n\nexport const identifierSchema = (config?: {\n allowHyphen?: boolean\n regexErrorMsg?: string\n requiredErrorMsg?: string\n}) =>\n z\n .string()\n .min(1, config?.requiredErrorMsg ? config?.requiredErrorMsg : 'Identifier is required')\n .regex(\n config?.allowHyphen ? hyphenRegexIdentifier : regexIdentifier,\n config?.regexErrorMsg ? config?.regexErrorMsg : 'Identifier can only contain alphanumerics, _ and $'\n )\n .refine(val => !illegalIdentifiers.includes(val), {\n message: `Identifier must not be one of the following values: ${illegalIdentifiers.join(', ')}`\n })\n","type Task = () => void\ntype RunnerType = 'requestAnimationFrame' | 'requestIdleCallback' | 'setTimeout'\n\nfunction createTaskPool(type: RunnerType = 'requestAnimationFrame', blockSize: number) {\n const tasks: Array<[Task, number]> = []\n const runner = type === 'requestAnimationFrame' ? requestAnimationFrame : window.requestIdleCallback\n\n let id = 1\n let running = false\n\n const scheduleTask = (task: Task, priority = tasks.length) => {\n id = id + 1 < Number.MAX_SAFE_INTEGER ? id + 1 : 1\n tasks.splice(priority, 0, [task, id])\n run()\n return id\n }\n\n const run = () => {\n if (!running && tasks.length) {\n running = true\n\n const block = tasks.splice(0, blockSize)\n\n const blockTracking = block.map(_ => {\n let resolve: (value: unknown) => void = noop\n new Promise(_resolve => (resolve = _resolve))\n return { resolve }\n })\n\n block.forEach((task, idx) => runner(() => blockTracking[idx].resolve(task[0]?.())))\n\n Promise.all(blockTracking).then(() => {\n running = false\n if (tasks.length) run()\n })\n }\n }\n\n const cancelTask = (taskId: number) => {\n const index = tasks.findIndex(([, _id]) => _id === taskId)\n if (index > -1) tasks.splice(index, 1)\n }\n\n return { scheduleTask, cancelTask }\n}\n\nconst EXECUTION_BLOCK_SIZE = 10\nconst noop = () => 0\n\nexport const createRequestAnimationFrameTaskPool = (blockSize = EXECUTION_BLOCK_SIZE) =>\n createTaskPool('requestAnimationFrame', blockSize)\nexport const createRequestIdleCallbackTaskPool = (blockSize = EXECUTION_BLOCK_SIZE) =>\n createTaskPool('requestIdleCallback', blockSize)\n\n// Polly fill requestIdleCallback/cancelIdleCallback for Safari\nwindow.requestIdleCallback =\n window.requestIdleCallback ||\n function (cb) {\n const start = Date.now()\n return setTimeout(function () {\n cb({\n didTimeout: false,\n timeRemaining: function () {\n return Math.max(0, 50 - (Date.now() - start))\n }\n })\n }, 1)\n }\n\nwindow.cancelIdleCallback =\n window.cancelIdleCallback ||\n function (id) {\n clearTimeout(id)\n }\n"],"names":["constructNow","date","constructFrom","formatDistanceToNow","options","formatDistance","regexIdentifier","hyphenRegexIdentifier","illegalIdentifiers","identifierSchema","config","z","val","createTaskPool","type","blockSize","tasks","runner","id","running","scheduleTask","task","priority","run","block","blockTracking","_","resolve","noop","_resolve","idx","_a","taskId","index","_id","EXECUTION_BLOCK_SIZE","createRequestAnimationFrameTaskPool","createRequestIdleCallbackTaskPool","cb","start"],"mappings":";;;;AAgCO,SAASA,GAAaC,GAAM;AACjC,SAAOC,EAAcD,GAAM,KAAK,IAAG,CAAE;AACvC;ACwDO,SAASE,GAAoBF,GAAMG,GAAS;AACjD,SAAOC,EAAeJ,GAAMD,GAAaC,CAAI,GAAGG,CAAO;AACzD;ACzFO,MAAME,IAAkB,4BAElBC,IAAwB,6BAExBC,IAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEaC,KAAmB,CAACC,MAK/BC,GACG,OAAO,EACP,IAAI,GAAGD,KAAA,QAAAA,EAAQ,mBAAmBA,KAAA,gBAAAA,EAAQ,mBAAmB,wBAAwB,EACrF;AAAA,EACCA,KAAA,QAAAA,EAAQ,cAAcH,IAAwB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