@reforma/components 0.3.2 → 0.4.0
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/Composer/parts.d.ts +1 -1
- package/dist/Composer/parts.d.ts.map +1 -1
- package/dist/Composer/parts.js +102 -98
- package/dist/Composer/parts.js.map +1 -1
- package/dist/Composer/reforma/Composer.module.css +1 -1
- package/dist/Composer/reforma/Composer.module.css.js +24 -22
- package/dist/Composer/reforma/Composer.module.css.js.map +1 -1
- package/dist/Composer/types.d.ts +1 -1
- package/dist/Composer/types.d.ts.map +1 -1
- package/dist/Modal/Modal.d.ts +2 -2
- package/dist/Modal/Modal.d.ts.map +1 -1
- package/dist/Modal/Modal.js +6 -3
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/SettingsLayout/SettingsLayout.d.ts +1 -0
- package/dist/SettingsLayout/SettingsLayout.d.ts.map +1 -1
- package/dist/SettingsLayout/SettingsLayout.js +332 -292
- package/dist/SettingsLayout/SettingsLayout.js.map +1 -1
- package/dist/SettingsLayout/SettingsLayout.module.css +1 -1
- package/dist/SettingsLayout/SettingsLayout.module.css.js +20 -18
- package/dist/SettingsLayout/SettingsLayout.module.css.js.map +1 -1
- package/dist/chat/Attachment/Attachment.d.ts.map +1 -1
- package/dist/chat/Attachment/Attachment.js +14 -16
- package/dist/chat/Attachment/Attachment.js.map +1 -1
- package/dist/chat/Attachment/Attachment.module.css +1 -1
- package/dist/chat/Message/turn/MessageAssistantBody.d.ts.map +1 -1
- package/dist/chat/Message/turn/MessageAssistantBody.js +53 -40
- package/dist/chat/Message/turn/MessageAssistantBody.js.map +1 -1
- package/dist/chat/Tool/Tool.d.ts.map +1 -1
- package/dist/chat/Tool/Tool.js +77 -75
- package/dist/chat/Tool/Tool.js.map +1 -1
- package/dist/chat/Tool/agent/AgentTool.d.ts.map +1 -1
- package/dist/chat/Tool/agent/AgentTool.js +18 -17
- package/dist/chat/Tool/agent/AgentTool.js.map +1 -1
- package/dist/chat/Tool/check-page/CheckPageTool.d.ts +4 -0
- package/dist/chat/Tool/check-page/CheckPageTool.d.ts.map +1 -0
- package/dist/chat/Tool/check-page/CheckPageTool.js +75 -0
- package/dist/chat/Tool/check-page/CheckPageTool.js.map +1 -0
- package/dist/chat/Tool/check-page/index.d.ts +2 -0
- package/dist/chat/Tool/check-page/index.d.ts.map +1 -0
- package/dist/chat/Tool/check-page/index.js +5 -0
- package/dist/chat/Tool/check-page/index.js.map +1 -0
- package/dist/index.js +156 -155
- package/dist/modals/ConfirmModal.d.ts +2 -0
- package/dist/modals/ConfirmModal.d.ts.map +1 -1
- package/dist/modals/ConfirmModal.js +88 -60
- package/dist/modals/ConfirmModal.js.map +1 -1
- package/dist/modals/index.d.ts +1 -1
- package/dist/modals/index.d.ts.map +1 -1
- package/dist/modals/index.js +2 -1
- package/package.json +5 -13
- package/dist/node_modules/clsx/dist/clsx.js +0 -18
- package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
- package/dist/node_modules/react-aria/dist/private/interactions/useFocusable.js +0 -17
- package/dist/node_modules/react-aria/dist/private/interactions/useFocusable.js.map +0 -1
- package/dist/node_modules/react-aria/dist/private/utils/useObjectRef.js +0 -34
- package/dist/node_modules/react-aria/dist/private/utils/useObjectRef.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.js +0 -38
- package/dist/node_modules/zod/v4/classic/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.js +0 -21
- package/dist/node_modules/zod/v4/classic/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -822
- package/dist/node_modules/zod/v4/classic/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/api.js +0 -561
- package/dist/node_modules/zod/v4/core/api.js.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.js +0 -262
- package/dist/node_modules/zod/v4/core/checks.js.map +0 -1
- package/dist/node_modules/zod/v4/core/core.js +0 -97
- package/dist/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.js +0 -35
- package/dist/node_modules/zod/v4/core/doc.js.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.js +0 -79
- package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -308
- package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/memoizer.js +0 -203
- package/dist/node_modules/zod/v4/core/memoizer.js.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.js +0 -113
- package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.js +0 -59
- package/dist/node_modules/zod/v4/core/regexes.js.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.js +0 -41
- package/dist/node_modules/zod/v4/core/registries.js.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.js +0 -1104
- package/dist/node_modules/zod/v4/core/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -380
- package/dist/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
- package/dist/node_modules/zod/v4/core/util.js +0 -465
- package/dist/node_modules/zod/v4/core/util.js.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.js +0 -9
- package/dist/node_modules/zod/v4/core/versions.js.map +0 -1
- package/dist/node_modules/zod/v4/locales/en.js +0 -97
- package/dist/node_modules/zod/v4/locales/en.js.map +0 -1
|
@@ -1,108 +1,136 @@
|
|
|
1
1
|
import { useState as y } from "react";
|
|
2
|
-
import { Box as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { useModalContext as
|
|
5
|
-
import
|
|
6
|
-
import { Show as
|
|
7
|
-
import { Text as
|
|
8
|
-
import { toast as
|
|
9
|
-
import { jsxs as
|
|
10
|
-
const
|
|
2
|
+
import { Box as d } from "../Box/Box.js";
|
|
3
|
+
import { Button as h } from "../Button/Button.js";
|
|
4
|
+
import { useModalContext as C } from "../Modal/hooks/useModalProvider.js";
|
|
5
|
+
import v from "../Modal/Modal.js";
|
|
6
|
+
import { Show as E } from "../Show/Show.js";
|
|
7
|
+
import { Text as g } from "../Text/Text.js";
|
|
8
|
+
import { toast as M } from "../Toast/Toast.js";
|
|
9
|
+
import { jsxs as f, jsx as t } from "react/jsx-runtime";
|
|
10
|
+
const w = 101100, P = {
|
|
11
11
|
shadow: !0,
|
|
12
12
|
width: 380,
|
|
13
13
|
clickOut: !0,
|
|
14
14
|
closeOnEscape: !0,
|
|
15
15
|
closeButton: !1,
|
|
16
|
-
zIndex:
|
|
16
|
+
zIndex: w
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
let l = null;
|
|
19
|
+
function N() {
|
|
20
|
+
if (l)
|
|
21
|
+
return l;
|
|
22
|
+
const e = new Promise((n) => {
|
|
23
|
+
let c = !1;
|
|
24
|
+
const o = (i) => {
|
|
25
|
+
c || (c = !0, n(i));
|
|
26
|
+
};
|
|
27
|
+
b({
|
|
28
|
+
title: "Unsaved changes",
|
|
29
|
+
message: "Discard them, or go back and save",
|
|
30
|
+
confirmLabel: "Discard changes",
|
|
31
|
+
cancelLabel: "Go back",
|
|
32
|
+
destructive: !0,
|
|
33
|
+
onConfirm: () => {
|
|
34
|
+
o(!0);
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
onCancel: () => o(!1),
|
|
38
|
+
onClose: () => o(!1)
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
return l = e, e.finally(() => {
|
|
42
|
+
l = null;
|
|
43
|
+
}), e;
|
|
44
|
+
}
|
|
45
|
+
function b(e, n) {
|
|
46
|
+
return v.create({
|
|
47
|
+
...P,
|
|
48
|
+
...n,
|
|
49
|
+
component: /* @__PURE__ */ t(L, {
|
|
50
|
+
...e
|
|
24
51
|
})
|
|
25
52
|
});
|
|
26
53
|
}
|
|
27
|
-
function
|
|
28
|
-
title:
|
|
29
|
-
message:
|
|
30
|
-
confirmLabel:
|
|
31
|
-
cancelLabel:
|
|
32
|
-
showCancel:
|
|
33
|
-
destructive:
|
|
34
|
-
onConfirm:
|
|
54
|
+
function L({
|
|
55
|
+
title: e,
|
|
56
|
+
message: n,
|
|
57
|
+
confirmLabel: c = "Confirm",
|
|
58
|
+
cancelLabel: o = "Cancel",
|
|
59
|
+
showCancel: i = !0,
|
|
60
|
+
destructive: O,
|
|
61
|
+
onConfirm: D
|
|
35
62
|
}) {
|
|
36
63
|
const {
|
|
37
|
-
modal:
|
|
38
|
-
} =
|
|
39
|
-
if (
|
|
64
|
+
modal: a
|
|
65
|
+
} = C(), [s, u] = y(!1), m = async () => {
|
|
66
|
+
if (s)
|
|
40
67
|
return;
|
|
41
|
-
|
|
68
|
+
u(!0);
|
|
42
69
|
const {
|
|
43
70
|
clickOut: r,
|
|
44
71
|
closeOnEscape: x
|
|
45
|
-
} =
|
|
46
|
-
|
|
72
|
+
} = a.currentOptions;
|
|
73
|
+
a.updateOptions({
|
|
47
74
|
clickOut: !1,
|
|
48
75
|
closeOnEscape: !1
|
|
49
76
|
});
|
|
50
77
|
try {
|
|
51
|
-
await
|
|
52
|
-
} catch (
|
|
53
|
-
|
|
78
|
+
await D(), a.cancel();
|
|
79
|
+
} catch (p) {
|
|
80
|
+
u(!1), a.updateOptions({
|
|
54
81
|
clickOut: r,
|
|
55
82
|
closeOnEscape: x
|
|
56
|
-
}),
|
|
57
|
-
message:
|
|
83
|
+
}), M.error({
|
|
84
|
+
message: p instanceof Error ? p.message : "Something went wrong. Please try again."
|
|
58
85
|
});
|
|
59
86
|
}
|
|
60
87
|
};
|
|
61
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ f(d, {
|
|
62
89
|
gap: "xl",
|
|
63
90
|
padding: "xxl",
|
|
64
91
|
onKeyDown: (r) => {
|
|
65
|
-
r.key !== "Enter" || r.defaultPrevented ||
|
|
92
|
+
r.key !== "Enter" || r.defaultPrevented || s || r.target instanceof HTMLButtonElement || r.target instanceof HTMLAnchorElement || (r.preventDefault(), m());
|
|
66
93
|
},
|
|
67
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ f(d, {
|
|
68
95
|
gap: "md",
|
|
69
|
-
children: [/* @__PURE__ */ t(
|
|
96
|
+
children: [/* @__PURE__ */ t(g, {
|
|
70
97
|
variant: "heading-3",
|
|
71
|
-
children:
|
|
72
|
-
}), typeof
|
|
98
|
+
children: e
|
|
99
|
+
}), typeof n == "string" ? /* @__PURE__ */ t(g, {
|
|
73
100
|
variant: "md",
|
|
74
101
|
color: "secondary",
|
|
75
|
-
children:
|
|
76
|
-
}) :
|
|
77
|
-
}), /* @__PURE__ */
|
|
102
|
+
children: n
|
|
103
|
+
}) : n]
|
|
104
|
+
}), /* @__PURE__ */ f(d, {
|
|
78
105
|
direction: "row",
|
|
79
106
|
gap: "md",
|
|
80
107
|
fullWidth: !0,
|
|
81
|
-
justify:
|
|
82
|
-
equalWidth:
|
|
83
|
-
children: [/* @__PURE__ */ t(
|
|
84
|
-
when:
|
|
85
|
-
children: /* @__PURE__ */ t(
|
|
108
|
+
justify: i ? void 0 : "end",
|
|
109
|
+
equalWidth: i || void 0,
|
|
110
|
+
children: [/* @__PURE__ */ t(E, {
|
|
111
|
+
when: i,
|
|
112
|
+
children: /* @__PURE__ */ t(h, {
|
|
86
113
|
variant: "bordered",
|
|
87
|
-
isDisabled:
|
|
88
|
-
onPress: () =>
|
|
89
|
-
children:
|
|
114
|
+
isDisabled: s,
|
|
115
|
+
onPress: () => a.cancel(),
|
|
116
|
+
children: o
|
|
90
117
|
})
|
|
91
|
-
}), /* @__PURE__ */ t(
|
|
118
|
+
}), /* @__PURE__ */ t(h, {
|
|
92
119
|
autoFocus: !0,
|
|
93
|
-
color:
|
|
94
|
-
isPending:
|
|
95
|
-
isDisabled:
|
|
120
|
+
color: O ? "danger" : "primary",
|
|
121
|
+
isPending: s,
|
|
122
|
+
isDisabled: s,
|
|
96
123
|
onPress: () => {
|
|
97
|
-
|
|
124
|
+
m();
|
|
98
125
|
},
|
|
99
|
-
children:
|
|
126
|
+
children: c
|
|
100
127
|
})]
|
|
101
128
|
})]
|
|
102
129
|
});
|
|
103
130
|
}
|
|
104
131
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
L as ConfirmModalContent,
|
|
133
|
+
N as confirmDiscardChanges,
|
|
134
|
+
b as openConfirmModal
|
|
107
135
|
};
|
|
108
136
|
//# sourceMappingURL=ConfirmModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmModal.js","sources":["../../src/modals/ConfirmModal.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { Modal, useModalContext } from '../Modal';\nimport { Show } from '../Show';\nimport { Text } from '../Text';\nimport { toast } from '../Toast';\n\nimport type { ReactNode } from 'react';\nimport type { ModalOptionsRaw } from '../Modal/typings';\n\nexport type OpenConfirmModalOptions = {\n title: string;\n message: ReactNode;\n confirmLabel?: string;\n cancelLabel?: string;\n /** Omit Cancel. The confirm button is the only action. */\n showCancel?: boolean;\n destructive?: boolean;\n onConfirm: () => void | Promise<void>;\n};\n\n/** Keep in sync with `--z-confirm` in `@reforma/styles`. */\nconst CONFIRM_MODAL_Z_INDEX = 101100;\n\nconst DEFAULT_MODAL_OPTIONS: ModalOptionsRaw = {\n shadow: true,\n width: 380,\n clickOut: true,\n closeOnEscape: true,\n closeButton: false,\n zIndex: CONFIRM_MODAL_Z_INDEX,\n};\n\nexport function openConfirmModal(\n options: OpenConfirmModalOptions,\n modalOptions?: ModalOptionsRaw\n) {\n return Modal.create({\n ...DEFAULT_MODAL_OPTIONS,\n ...modalOptions,\n component: <ConfirmModalContent { ...options } />,\n });\n}\n\nexport function ConfirmModalContent({\n title,\n message,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n showCancel = true,\n destructive,\n onConfirm,\n}: OpenConfirmModalOptions) {\n const { modal } = useModalContext();\n const [isPending, setIsPending] = useState(false);\n\n const handleConfirm = async() => {\n if (isPending) {\n return;\n }\n\n setIsPending(true);\n const { clickOut, closeOnEscape } = modal.currentOptions;\n modal.updateOptions({ clickOut: false, closeOnEscape: false });\n\n try {\n await onConfirm();\n modal.cancel();\n }\n catch(error) {\n setIsPending(false);\n modal.updateOptions({ clickOut, closeOnEscape });\n toast.error({\n message: error instanceof Error ? error.message : 'Something went wrong. Please try again.',\n });\n }\n };\n\n return (\n <Box\n gap=\"xl\"\n padding=\"xxl\"\n onKeyDown={ (event) => {\n if (event.key !== 'Enter' || event.defaultPrevented || isPending) {\n return;\n }\n\n // Overlay / non-button focus: Enter confirms. Focused Cancel still cancels via its own activation.\n if (event.target instanceof HTMLButtonElement || event.target instanceof HTMLAnchorElement) {\n return;\n }\n\n event.preventDefault();\n void handleConfirm();\n } }\n >\n <Box gap=\"md\">\n <Text variant=\"heading-3\">{title}</Text>\n {typeof message === 'string'\n ? (\n <Text variant=\"md\" color=\"secondary\">\n {message}\n </Text>\n )\n : message}\n </Box>\n\n <Box\n direction=\"row\"\n gap=\"md\"\n fullWidth\n justify={ showCancel ? undefined : 'end' }\n equalWidth={ showCancel || undefined }\n >\n <Show when={ showCancel }>\n <Button\n variant=\"bordered\"\n isDisabled={ isPending }\n onPress={ () => modal.cancel() }\n >\n {cancelLabel}\n </Button>\n </Show>\n\n <Button\n autoFocus\n color={ destructive ? 'danger' : 'primary' }\n isPending={ isPending }\n isDisabled={ isPending }\n onPress={ () => void handleConfirm() }\n >\n {confirmLabel}\n </Button>\n </Box>\n </Box>\n );\n}\n"],"names":["CONFIRM_MODAL_Z_INDEX","DEFAULT_MODAL_OPTIONS","openConfirmModal","options","modalOptions","Modal","ConfirmModalContent","title","message","confirmLabel","cancelLabel","showCancel","destructive","onConfirm","modal","useModalContext","isPending","setIsPending","useState","handleConfirm","clickOut","closeOnEscape","error","toast","Box","event","_jsxs","_jsx","Text","Show","Button"],"mappings":";;;;;;;;;AASA,MAAMA,IAAwB,QACxBC,IAAwB;AAAA,EAC5B,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,eAAe;AAAA,EACf,aAAa;AAAA,EACb,QAAQD;AACV;AACO,
|
|
1
|
+
{"version":3,"file":"ConfirmModal.js","sources":["../../src/modals/ConfirmModal.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { Modal, useModalContext } from '../Modal';\nimport { Show } from '../Show';\nimport { Text } from '../Text';\nimport { toast } from '../Toast';\n\nimport type { ReactNode } from 'react';\nimport type { ModalOptionsRaw } from '../Modal/typings';\n\nexport type OpenConfirmModalOptions = {\n title: string;\n message: ReactNode;\n confirmLabel?: string;\n cancelLabel?: string;\n /** Omit Cancel. The confirm button is the only action. */\n showCancel?: boolean;\n destructive?: boolean;\n onConfirm: () => void | Promise<void>;\n};\n\n/** Keep in sync with `--z-confirm` in `@reforma/styles`. */\nconst CONFIRM_MODAL_Z_INDEX = 101100;\n\nconst DEFAULT_MODAL_OPTIONS: ModalOptionsRaw = {\n shadow: true,\n width: 380,\n clickOut: true,\n closeOnEscape: true,\n closeButton: false,\n zIndex: CONFIRM_MODAL_Z_INDEX,\n};\n\nlet pendingDiscard: Promise<boolean> | null = null;\n\n/** Discard dialog for a dirty form. Resolves true only when the person discards. */\nexport function confirmDiscardChanges(): Promise<boolean> {\n if (pendingDiscard) {\n return pendingDiscard;\n }\n\n const dialog = new Promise<boolean>((resolve) => {\n let settled = false;\n\n const finish = (discard: boolean) => {\n if (settled) {\n return;\n }\n\n settled = true;\n resolve(discard);\n };\n\n openConfirmModal({\n title: 'Unsaved changes',\n message: 'Discard them, or go back and save',\n confirmLabel: 'Discard changes',\n cancelLabel: 'Go back',\n destructive: true,\n onConfirm: () => {\n finish(true);\n },\n }, {\n onCancel: () => finish(false),\n onClose: () => finish(false),\n });\n });\n\n pendingDiscard = dialog;\n void dialog.finally(() => {\n pendingDiscard = null;\n });\n\n return dialog;\n}\n\nexport function openConfirmModal(\n options: OpenConfirmModalOptions,\n modalOptions?: ModalOptionsRaw\n) {\n return Modal.create({\n ...DEFAULT_MODAL_OPTIONS,\n ...modalOptions,\n component: <ConfirmModalContent { ...options } />,\n });\n}\n\nexport function ConfirmModalContent({\n title,\n message,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n showCancel = true,\n destructive,\n onConfirm,\n}: OpenConfirmModalOptions) {\n const { modal } = useModalContext();\n const [isPending, setIsPending] = useState(false);\n\n const handleConfirm = async() => {\n if (isPending) {\n return;\n }\n\n setIsPending(true);\n const { clickOut, closeOnEscape } = modal.currentOptions;\n modal.updateOptions({ clickOut: false, closeOnEscape: false });\n\n try {\n await onConfirm();\n modal.cancel();\n }\n catch(error) {\n setIsPending(false);\n modal.updateOptions({ clickOut, closeOnEscape });\n toast.error({\n message: error instanceof Error ? error.message : 'Something went wrong. Please try again.',\n });\n }\n };\n\n return (\n <Box\n gap=\"xl\"\n padding=\"xxl\"\n onKeyDown={ (event) => {\n if (event.key !== 'Enter' || event.defaultPrevented || isPending) {\n return;\n }\n\n // Overlay / non-button focus: Enter confirms. Focused Cancel still cancels via its own activation.\n if (event.target instanceof HTMLButtonElement || event.target instanceof HTMLAnchorElement) {\n return;\n }\n\n event.preventDefault();\n void handleConfirm();\n } }\n >\n <Box gap=\"md\">\n <Text variant=\"heading-3\">{title}</Text>\n {typeof message === 'string'\n ? (\n <Text variant=\"md\" color=\"secondary\">\n {message}\n </Text>\n )\n : message}\n </Box>\n\n <Box\n direction=\"row\"\n gap=\"md\"\n fullWidth\n justify={ showCancel ? undefined : 'end' }\n equalWidth={ showCancel || undefined }\n >\n <Show when={ showCancel }>\n <Button\n variant=\"bordered\"\n isDisabled={ isPending }\n onPress={ () => modal.cancel() }\n >\n {cancelLabel}\n </Button>\n </Show>\n\n <Button\n autoFocus\n color={ destructive ? 'danger' : 'primary' }\n isPending={ isPending }\n isDisabled={ isPending }\n onPress={ () => void handleConfirm() }\n >\n {confirmLabel}\n </Button>\n </Box>\n </Box>\n );\n}\n"],"names":["CONFIRM_MODAL_Z_INDEX","DEFAULT_MODAL_OPTIONS","pendingDiscard","confirmDiscardChanges","dialog","resolve","settled","finish","discard","openConfirmModal","options","modalOptions","Modal","ConfirmModalContent","title","message","confirmLabel","cancelLabel","showCancel","destructive","onConfirm","modal","useModalContext","isPending","setIsPending","useState","handleConfirm","clickOut","closeOnEscape","error","toast","Box","event","_jsxs","_jsx","Text","Show","Button"],"mappings":"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"}
|
package/dist/modals/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ConfirmModalContent, openConfirmModal, type OpenConfirmModalOptions } from './ConfirmModal';
|
|
1
|
+
export { confirmDiscardChanges, ConfirmModalContent, openConfirmModal, type OpenConfirmModalOptions } from './ConfirmModal';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modals/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modals/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/modals/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ConfirmModalContent as r, openConfirmModal as e } from "./ConfirmModal.js";
|
|
1
|
+
import { ConfirmModalContent as r, confirmDiscardChanges as a, openConfirmModal as e } from "./ConfirmModal.js";
|
|
2
2
|
export {
|
|
3
3
|
r as ConfirmModalContent,
|
|
4
|
+
a as confirmDiscardChanges,
|
|
4
5
|
e as openConfirmModal
|
|
5
6
|
};
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@reforma/components",
|
|
3
3
|
"description": "A components library for Reforma",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.4.0",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"author": "Reforma, Inc. <dev@reforma.ai>",
|
|
8
8
|
"repository": {
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"@openuidev/react-lang": "^1.0.1",
|
|
70
70
|
"@react-aria/dnd": "^3.11.6",
|
|
71
71
|
"@react-stately/utils": "^3.11.0",
|
|
72
|
-
"@reforma/constants": "
|
|
73
|
-
"@reforma/icons": "
|
|
74
|
-
"@reforma/lib": "
|
|
75
|
-
"@reforma/types": "
|
|
72
|
+
"@reforma/constants": "1.0.1",
|
|
73
|
+
"@reforma/icons": "0.1.0",
|
|
74
|
+
"@reforma/lib": "0.1.6",
|
|
75
|
+
"@reforma/types": "1.3.0",
|
|
76
76
|
"@shikijs/transformers": "^4.0.2",
|
|
77
77
|
"@streamdown/cjk": "1.0.3",
|
|
78
78
|
"@streamdown/code": "1.1.1",
|
|
@@ -114,14 +114,6 @@
|
|
|
114
114
|
"streamdown": "2.5.0",
|
|
115
115
|
"zod": "^4.4.3"
|
|
116
116
|
},
|
|
117
|
-
"devDependencies": {
|
|
118
|
-
"@babel/preset-react": "^7.26.3",
|
|
119
|
-
"@reforma/styles": "workspace:*",
|
|
120
|
-
"@vitejs/plugin-react-swc": "^3.7.0",
|
|
121
|
-
"vite": "^7.0.0",
|
|
122
|
-
"vite-plugin-babel": "^1.3.0",
|
|
123
|
-
"vite-plugin-dts": "4.5.4"
|
|
124
|
-
},
|
|
125
117
|
"peerDependencies": {
|
|
126
118
|
"react": "^19.2.8",
|
|
127
119
|
"react-dom": "^19.2.8"
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
function a(r) {
|
|
2
|
-
var n, f, t = "";
|
|
3
|
-
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
-
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
5
|
-
var o = r.length;
|
|
6
|
-
for (n = 0; n < o; n++) r[n] && (f = a(r[n])) && (t && (t += " "), t += f);
|
|
7
|
-
} else for (f in r) r[f] && (t && (t += " "), t += f);
|
|
8
|
-
return t;
|
|
9
|
-
}
|
|
10
|
-
function i() {
|
|
11
|
-
for (var r, n, f = 0, t = "", o = arguments.length; f < o; f++) (r = arguments[f]) && (n = a(r)) && (t && (t += " "), t += n);
|
|
12
|
-
return t;
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
i as clsx,
|
|
16
|
-
i as default
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=clsx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clsx.js","sources":["../../../../../../node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"names":["r","e","t","n","clsx"],"mappings":"AAAA,SAASA,EAAEC,GAAE;AAAC,MAAIC,GAAE,GAAEC,IAAE;AAAG,MAAa,OAAOF,KAAjB,YAA8B,OAAOA,KAAjB,SAAmB,CAAAE,KAAGF;AAAA,WAAoB,OAAOA,KAAjB,SAAmB,KAAG,MAAM,QAAQA,CAAC,GAAE;AAAC,QAAI,IAAEA,EAAE;AAAO,SAAIC,IAAE,GAAEA,IAAE,GAAEA,IAAI,CAAAD,EAAEC,CAAC,MAAI,IAAEF,EAAEC,EAAEC,CAAC,CAAC,OAAKC,MAAIA,KAAG,MAAKA,KAAG;AAAA,EAAE,MAAM,MAAI,KAAKF,EAAE,CAAAA,EAAE,CAAC,MAAIE,MAAIA,KAAG,MAAKA,KAAG;AAAG,SAAOA;AAAC;AAAQ,SAASC,IAAM;AAAC,WAAQH,GAAEC,GAAE,IAAE,GAAEC,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAACF,IAAE,UAAU,CAAC,OAAKC,IAAEF,EAAEC,CAAC,OAAKE,MAAIA,KAAG,MAAKA,KAAGD;AAAG,SAAOC;AAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useObjectRef as f } from "../utils/useObjectRef.js";
|
|
2
|
-
import e from "react";
|
|
3
|
-
let l = /* @__PURE__ */ e.createContext(null);
|
|
4
|
-
const s = /* @__PURE__ */ e.forwardRef(function(r, t) {
|
|
5
|
-
let { children: o, ...a } = r, c = f(t), d = {
|
|
6
|
-
...a,
|
|
7
|
-
ref: c
|
|
8
|
-
};
|
|
9
|
-
return /* @__PURE__ */ e.createElement(l.Provider, {
|
|
10
|
-
value: d
|
|
11
|
-
}, o);
|
|
12
|
-
});
|
|
13
|
-
export {
|
|
14
|
-
l as FocusableContext,
|
|
15
|
-
s as FocusableProvider
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=useFocusable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusable.js","sources":["../../../../../../../../node_modules/react-aria/dist/private/interactions/useFocusable.mjs"],"sourcesContent":["import {focusSafely as $f192c2f16961cbe0$export$80f3e147d781571c} from \"./focusSafely.mjs\";\nimport {getOwnerWindow as $d447af545b77c9f1$export$f21a1ffae260145a} from \"../utils/domHelpers.mjs\";\nimport {isFocusable as $3b8b240c1bf84ab9$export$4c063cf1350e6fed} from \"../utils/isFocusable.mjs\";\nimport {mergeProps as $bbaa08b3cd72f041$export$9d1611c77c2fe928} from \"../utils/mergeProps.mjs\";\nimport {mergeRefs as $4064df0d6f9620e1$export$c9058316764c140e} from \"../utils/mergeRefs.mjs\";\nimport {useFocus as $1e74c67db218ce67$export$f8168d8dd8fd66e6} from \"./useFocus.mjs\";\nimport {useKeyboard as $8296dad1a4c5e0dc$export$8f71654801c2f7cd} from \"./useKeyboard.mjs\";\nimport {useObjectRef as $03e8ab2d84d7657a$export$4338b53315abf666} from \"../utils/useObjectRef.mjs\";\nimport {useSyncRef as $b7115c395c64f7b5$export$4debdb1a3f0fa79e} from \"../utils/useSyncRef.mjs\";\nimport $fKWKs$react, {useContext as $fKWKs$useContext, useRef as $fKWKs$useRef, useEffect as $fKWKs$useEffect, forwardRef as $fKWKs$forwardRef} from \"react\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\n\n\n\n\nlet $d1116acdf220c2da$export$f9762fab77588ecb = /*#__PURE__*/ (0, $fKWKs$react).createContext(null);\nfunction $d1116acdf220c2da$var$useFocusableContext(ref) {\n let context = (0, $fKWKs$useContext)($d1116acdf220c2da$export$f9762fab77588ecb) || {};\n (0, $b7115c395c64f7b5$export$4debdb1a3f0fa79e)(context, ref);\n // eslint-disable-next-line\n let { ref: _, ...otherProps } = context;\n return otherProps;\n}\nconst $d1116acdf220c2da$export$13f3202a3e5ddd5 = /*#__PURE__*/ (0, $fKWKs$react).forwardRef(function FocusableProvider(props, ref) {\n let { children: children, ...otherProps } = props;\n let objRef = (0, $03e8ab2d84d7657a$export$4338b53315abf666)(ref);\n let context = {\n ...otherProps,\n ref: objRef\n };\n return /*#__PURE__*/ (0, $fKWKs$react).createElement($d1116acdf220c2da$export$f9762fab77588ecb.Provider, {\n value: context\n }, children);\n});\nfunction $d1116acdf220c2da$export$4c014de7c8940b4c(props, domRef) {\n let { focusProps: focusProps } = (0, $1e74c67db218ce67$export$f8168d8dd8fd66e6)(props);\n let { keyboardProps: keyboardProps } = (0, $8296dad1a4c5e0dc$export$8f71654801c2f7cd)(props);\n let interactions = (0, $bbaa08b3cd72f041$export$9d1611c77c2fe928)(focusProps, keyboardProps);\n let domProps = $d1116acdf220c2da$var$useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = (0, $fKWKs$useRef)(props.autoFocus);\n (0, $fKWKs$useEffect)(()=>{\n if (autoFocusRef.current && domRef.current) (0, $f192c2f16961cbe0$export$80f3e147d781571c)(domRef.current);\n autoFocusRef.current = false;\n }, [\n domRef\n ]);\n // Always set a tabIndex so that Safari allows focusing native buttons and inputs.\n let tabIndex = props.excludeFromTabOrder ? -1 : 0;\n if (props.isDisabled) tabIndex = undefined;\n return {\n focusableProps: (0, $bbaa08b3cd72f041$export$9d1611c77c2fe928)({\n ...interactions,\n tabIndex: tabIndex\n }, interactionProps)\n };\n}\nconst $d1116acdf220c2da$export$35a3bebf7ef2d934 = /*#__PURE__*/ (0, $fKWKs$forwardRef)(({ children: children, ...props }, ref)=>{\n ref = (0, $03e8ab2d84d7657a$export$4338b53315abf666)(ref);\n let { focusableProps: focusableProps } = $d1116acdf220c2da$export$4c014de7c8940b4c(props, ref);\n let child = (0, $fKWKs$react).Children.only(children);\n (0, $fKWKs$useEffect)(()=>{\n if (process.env.NODE_ENV === 'production') return;\n let el = ref.current;\n if (!el || !(el instanceof (0, $d447af545b77c9f1$export$f21a1ffae260145a)(el).Element)) {\n console.error('<Focusable> child must forward its ref to a DOM element.');\n return;\n }\n if (!props.isDisabled && !(0, $3b8b240c1bf84ab9$export$4c063cf1350e6fed)(el, {\n skipVisibilityCheck: true\n })) {\n console.warn('<Focusable> child must be focusable. Please ensure the tabIndex prop is passed through.');\n return;\n }\n if (el.localName !== 'button' && el.localName !== 'input' && el.localName !== 'select' && el.localName !== 'textarea' && el.localName !== 'a' && el.localName !== 'area' && el.localName !== 'summary' && el.localName !== 'img' && el.localName !== 'svg') {\n let role = el.getAttribute('role');\n if (!role) console.warn('<Focusable> child must have an interactive ARIA role.');\n else if (// https://w3c.github.io/aria/#widget_roles\n role !== 'application' && role !== 'button' && role !== 'checkbox' && role !== 'combobox' && role !== 'gridcell' && role !== 'link' && role !== 'menuitem' && role !== 'menuitemcheckbox' && role !== 'menuitemradio' && role !== 'option' && role !== 'radio' && role !== 'searchbox' && role !== 'separator' && role !== 'slider' && role !== 'spinbutton' && role !== 'switch' && role !== 'tab' && role !== 'tabpanel' && role !== 'textbox' && role !== 'treeitem' && // aria-describedby is also announced on these roles\n role !== 'img' && role !== 'meter' && role !== 'progressbar') console.warn(`<Focusable> child must have an interactive ARIA role. Got \"${role}\".`);\n }\n }, [\n ref,\n props.isDisabled\n ]);\n // @ts-ignore\n let childRef = parseInt((0, $fKWKs$react).version, 10) < 19 ? child.ref : child.props.ref;\n return /*#__PURE__*/ (0, $fKWKs$react).cloneElement(child, {\n ...(0, $bbaa08b3cd72f041$export$9d1611c77c2fe928)(focusableProps, child.props),\n // @ts-ignore\n // oxlint-disable-next-line react/react-compiler\n ref: (0, $4064df0d6f9620e1$export$c9058316764c140e)(childRef, ref)\n });\n});\n\n\nexport {$d1116acdf220c2da$export$f9762fab77588ecb as FocusableContext, $d1116acdf220c2da$export$13f3202a3e5ddd5 as FocusableProvider, $d1116acdf220c2da$export$4c014de7c8940b4c as useFocusable, $d1116acdf220c2da$export$35a3bebf7ef2d934 as Focusable};\n//# sourceMappingURL=useFocusable.mjs.map\n"],"names":["$d1116acdf220c2da$export$f9762fab77588ecb","$fKWKs$react","$d1116acdf220c2da$export$13f3202a3e5ddd5","props","ref","children","otherProps","objRef","$03e8ab2d84d7657a$export$4338b53315abf666","context"],"mappings":";;AA+BG,IAACA,IAA8DC,gBAAAA,EAAc,cAAc,IAAI;AAQ7F,MAACC,IAA6DD,gBAAAA,EAAc,WAAW,SAA2BE,GAAOC,GAAK;AAC/H,MAAI,EAAE,UAAUC,GAAU,GAAGC,EAAU,IAAKH,GACxCI,IAAaC,EAA2CJ,CAAG,GAC3DK,IAAU;AAAA,IACV,GAAGH;AAAA,IACH,KAAKC;AAAA,EACb;AACI,SAAyBN,gBAAAA,EAAc,cAAcD,EAA0C,UAAU;AAAA,IACrG,OAAOS;AAAA,EACf,GAAOJ,CAAQ;AACf,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { useRef as o, useCallback as l, useMemo as s } from "react";
|
|
2
|
-
function a(e) {
|
|
3
|
-
const t = o(null), r = o(void 0), u = l((n) => {
|
|
4
|
-
if (typeof e == "function") {
|
|
5
|
-
const c = e, f = c(n);
|
|
6
|
-
return () => {
|
|
7
|
-
typeof f == "function" ? f() : c(null);
|
|
8
|
-
};
|
|
9
|
-
} else if (e)
|
|
10
|
-
return e.current = n, () => {
|
|
11
|
-
e.current = null;
|
|
12
|
-
};
|
|
13
|
-
}, [
|
|
14
|
-
e
|
|
15
|
-
]);
|
|
16
|
-
return s(
|
|
17
|
-
() => ({
|
|
18
|
-
get current() {
|
|
19
|
-
return t.current;
|
|
20
|
-
},
|
|
21
|
-
set current(n) {
|
|
22
|
-
t.current = n, r.current && (r.current(), r.current = void 0), n != null && (r.current = u(n));
|
|
23
|
-
}
|
|
24
|
-
}),
|
|
25
|
-
// oxlint-disable-next-line react/react-compiler
|
|
26
|
-
[
|
|
27
|
-
u
|
|
28
|
-
]
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
a as useObjectRef
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=useObjectRef.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useObjectRef.js","sources":["../../../../../../../../node_modules/react-aria/dist/private/utils/useObjectRef.mjs"],"sourcesContent":["import {useRef as $i6EpZ$useRef, useCallback as $i6EpZ$useCallback, useMemo as $i6EpZ$useMemo} from \"react\";\n\n/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \nfunction $03e8ab2d84d7657a$export$4338b53315abf666(ref) {\n const objRef = (0, $i6EpZ$useRef)(null);\n const cleanupRef = (0, $i6EpZ$useRef)(undefined);\n const refEffect = (0, $i6EpZ$useCallback)((instance)=>{\n if (typeof ref === 'function') {\n const refCallback = ref;\n const refCleanup = refCallback(instance);\n return ()=>{\n if (typeof refCleanup === 'function') refCleanup();\n else refCallback(null);\n };\n } else if (ref) {\n // oxlint-disable-next-line react/react-compiler\n ref.current = instance;\n return ()=>{\n ref.current = null;\n };\n }\n }, [\n ref\n ]);\n return (0, $i6EpZ$useMemo)(()=>({\n get current () {\n return objRef.current;\n },\n set current (value){\n objRef.current = value;\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = undefined;\n }\n if (value != null) cleanupRef.current = refEffect(value);\n }\n }), // oxlint-disable-next-line react/react-compiler\n [\n refEffect\n ]);\n}\n\n\nexport {$03e8ab2d84d7657a$export$4338b53315abf666 as useObjectRef};\n//# sourceMappingURL=useObjectRef.mjs.map\n"],"names":["$03e8ab2d84d7657a$export$4338b53315abf666","ref","objRef","$i6EpZ$useRef","cleanupRef","refEffect","$i6EpZ$useCallback","instance","refCallback","refCleanup","$i6EpZ$useMemo","value"],"mappings":";AAaA,SAASA,EAA0CC,GAAK;AACpD,QAAMC,IAAaC,EAAe,IAAI,GAChCC,IAAiBD,EAAe,MAAS,GACzCE,IAAgBC,EAAoB,CAACC,MAAW;AAClD,QAAI,OAAON,KAAQ,YAAY;AAC3B,YAAMO,IAAcP,GACdQ,IAAaD,EAAYD,CAAQ;AACvC,aAAO,MAAI;AACP,QAAI,OAAOE,KAAe,aAAYA,EAAU,IAC3CD,EAAY,IAAI;AAAA,MACzB;AAAA,IACJ,WAAWP;AAEP,aAAAA,EAAI,UAAUM,GACP,MAAI;AACP,QAAAN,EAAI,UAAU;AAAA,MAClB;AAAA,EAER,GAAG;AAAA,IACCA;AAAA,EACR,CAAK;AACD,SAAWS;AAAAA,IAAgB,OAAK;AAAA,MACxB,IAAI,UAAW;AACX,eAAOR,EAAO;AAAA,MAClB;AAAA,MACA,IAAI,QAASS,GAAM;AACf,QAAAT,EAAO,UAAUS,GACbP,EAAW,YACXA,EAAW,QAAO,GAClBA,EAAW,UAAU,SAErBO,KAAS,SAAMP,EAAW,UAAUC,EAAUM,CAAK;AAAA,MAC3D;AAAA,IACZ;AAAA;AAAA,IACI;AAAA,MACIN;AAAA,IACR;AAAA,EAAK;AACL;","x_google_ignoreList":[0]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsonStringifyReplacer as n } from "../core/util.js";
|
|
2
|
-
import { $ZodError as u, formatError as f, flattenError as c } from "../core/errors.js";
|
|
3
|
-
import { $constructor as d } from "../core/core.js";
|
|
4
|
-
const a = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
5
|
-
function i(o, s, e) {
|
|
6
|
-
Object.defineProperty(o, s, {
|
|
7
|
-
configurable: !0,
|
|
8
|
-
enumerable: !1,
|
|
9
|
-
get() {
|
|
10
|
-
const r = e(this);
|
|
11
|
-
return Object.defineProperty(this, s, { value: r, configurable: !0, writable: !0 }), r;
|
|
12
|
-
},
|
|
13
|
-
set(r) {
|
|
14
|
-
Object.defineProperty(this, s, { value: r, configurable: !0, writable: !0 });
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
const p = (o, s) => {
|
|
19
|
-
u.init(o, s), o.name = "ZodError";
|
|
20
|
-
const e = Object.getPrototypeOf(o);
|
|
21
|
-
a.has(e) || (a.add(e), i(e, "format", (r) => (t) => f(r, t)), i(e, "flatten", (r) => (t) => c(r, t)), i(e, "addIssue", (r) => (t) => {
|
|
22
|
-
r.issues.push(t), r.message = JSON.stringify(r.issues, n, 2);
|
|
23
|
-
}), i(e, "addIssues", (r) => (t) => {
|
|
24
|
-
r.issues.push(...t), r.message = JSON.stringify(r.issues, n, 2);
|
|
25
|
-
}), Object.defineProperty(e, "isEmpty", {
|
|
26
|
-
configurable: !0,
|
|
27
|
-
enumerable: !1,
|
|
28
|
-
get() {
|
|
29
|
-
return this.issues.length === 0;
|
|
30
|
-
}
|
|
31
|
-
}));
|
|
32
|
-
}, g = /* @__PURE__ */ d("ZodError", p, void 0, {
|
|
33
|
-
Parent: Error
|
|
34
|
-
});
|
|
35
|
-
export {
|
|
36
|
-
g as ZodRealError
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sources":["../../../../../../../node_modules/zod/v4/classic/errors.js"],"sourcesContent":["import * as core from \"../core/index.js\";\nimport { $ZodError } from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\n/* Prototypes that already carry the lazy helper methods. Seeded with the\n * intrinsics so that `init` on a foreign object — it accepts any object —\n * can never install an accessor onto a prototype we do not own. */\nconst _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);\n/* Helper methods live as non-enumerable lazy getters on the shared\n * prototype instead of own properties on every instance. On first\n * access the getter allocates the per-instance closure and caches it\n * as a non-enumerable own property, so detached usage still works and\n * the allocation only happens for methods actually touched. */\nfunction _lazyMethod(proto, key, make) {\n Object.defineProperty(proto, key, {\n configurable: true,\n enumerable: false,\n get() {\n const value = make(this);\n Object.defineProperty(this, key, { value, configurable: true, writable: true });\n return value;\n },\n set(value) {\n Object.defineProperty(this, key, { value, configurable: true, writable: true });\n },\n });\n}\nconst initializer = (inst, issues) => {\n $ZodError.init(inst, issues);\n inst.name = \"ZodError\";\n const proto = Object.getPrototypeOf(inst);\n if (_installedErrorProtos.has(proto))\n return;\n _installedErrorProtos.add(proto);\n _lazyMethod(proto, \"format\", (self) => (mapper) => core.formatError(self, mapper));\n _lazyMethod(proto, \"flatten\", (self) => (mapper) => core.flattenError(self, mapper));\n _lazyMethod(proto, \"addIssue\", (self) => (issue) => {\n self.issues.push(issue);\n self.message = JSON.stringify(self.issues, util.jsonStringifyReplacer, 2);\n });\n _lazyMethod(proto, \"addIssues\", (self) => (issues) => {\n self.issues.push(...issues);\n self.message = JSON.stringify(self.issues, util.jsonStringifyReplacer, 2);\n });\n Object.defineProperty(proto, \"isEmpty\", {\n configurable: true,\n enumerable: false,\n get() {\n return this.issues.length === 0;\n },\n });\n};\nexport const ZodError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer);\nexport const ZodRealError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer, undefined, {\n Parent: Error,\n});\n// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */\n// export type ErrorMapCtx = core.$ZodErrorMapCtx;\n"],"names":["_installedErrorProtos","_lazyMethod","proto","key","make","value","initializer","inst","issues","$ZodError","self","mapper","core.formatError","core.flattenError","issue","util.jsonStringifyReplacer","ZodRealError","core.$constructor"],"mappings":";;;AAMA,MAAMA,IAAwC,oBAAI,QAAQ,CAAC,OAAO,WAAW,MAAM,SAAS,CAAC;AAM7F,SAASC,EAAYC,GAAOC,GAAKC,GAAM;AACnC,SAAO,eAAeF,GAAOC,GAAK;AAAA,IAC9B,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,MAAM;AACF,YAAME,IAAQD,EAAK,IAAI;AACvB,oBAAO,eAAe,MAAMD,GAAK,EAAE,OAAAE,GAAO,cAAc,IAAM,UAAU,IAAM,GACvEA;AAAA,IACX;AAAA,IACA,IAAIA,GAAO;AACP,aAAO,eAAe,MAAMF,GAAK,EAAE,OAAAE,GAAO,cAAc,IAAM,UAAU,IAAM;AAAA,IAClF;AAAA,EACR,CAAK;AACL;AACA,MAAMC,IAAc,CAACC,GAAMC,MAAW;AAClC,EAAAC,EAAU,KAAKF,GAAMC,CAAM,GAC3BD,EAAK,OAAO;AACZ,QAAML,IAAQ,OAAO,eAAeK,CAAI;AACxC,EAAIP,EAAsB,IAAIE,CAAK,MAEnCF,EAAsB,IAAIE,CAAK,GAC/BD,EAAYC,GAAO,UAAU,CAACQ,MAAS,CAACC,MAAWC,EAAiBF,GAAMC,CAAM,CAAC,GACjFV,EAAYC,GAAO,WAAW,CAACQ,MAAS,CAACC,MAAWE,EAAkBH,GAAMC,CAAM,CAAC,GACnFV,EAAYC,GAAO,YAAY,CAACQ,MAAS,CAACI,MAAU;AAChD,IAAAJ,EAAK,OAAO,KAAKI,CAAK,GACtBJ,EAAK,UAAU,KAAK,UAAUA,EAAK,QAAQK,GAA4B,CAAC;AAAA,EAC5E,CAAC,GACDd,EAAYC,GAAO,aAAa,CAACQ,MAAS,CAACF,MAAW;AAClD,IAAAE,EAAK,OAAO,KAAK,GAAGF,CAAM,GAC1BE,EAAK,UAAU,KAAK,UAAUA,EAAK,QAAQK,GAA4B,CAAC;AAAA,EAC5E,CAAC,GACD,OAAO,eAAeb,GAAO,WAAW;AAAA,IACpC,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,MAAM;AACF,aAAO,KAAK,OAAO,WAAW;AAAA,IAClC;AAAA,EACR,CAAK;AACL,GAEac,IAA6BC,gBAAAA,EAAkB,YAAYX,GAAa,QAAW;AAAA,EAC5F,QAAQ;AACZ,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ZodRealError as e } from "./errors.js";
|
|
2
|
-
import { _safeDecodeAsync as s, _safeEncodeAsync as c, _safeDecode as o, _safeEncode as n, _decodeAsync as a, _encodeAsync as d, _decode as r, _encode as t, _safeParseAsync as f, _safeParse as y, _parseAsync as A, _parse as _ } from "../core/parse.js";
|
|
3
|
-
import { validate as q, validateAsync as u } from "../core/parse.js";
|
|
4
|
-
const E = /* @__PURE__ */ _(e), i = /* @__PURE__ */ A(e), D = /* @__PURE__ */ y(e), P = /* @__PURE__ */ f(e), l = /* @__PURE__ */ t(e), v = /* @__PURE__ */ r(e), x = /* @__PURE__ */ d(e), R = /* @__PURE__ */ a(e), Z = /* @__PURE__ */ n(e), b = /* @__PURE__ */ o(e), g = /* @__PURE__ */ c(e), h = /* @__PURE__ */ s(e);
|
|
5
|
-
export {
|
|
6
|
-
v as decode,
|
|
7
|
-
R as decodeAsync,
|
|
8
|
-
l as encode,
|
|
9
|
-
x as encodeAsync,
|
|
10
|
-
E as parse,
|
|
11
|
-
i as parseAsync,
|
|
12
|
-
b as safeDecode,
|
|
13
|
-
h as safeDecodeAsync,
|
|
14
|
-
Z as safeEncode,
|
|
15
|
-
g as safeEncodeAsync,
|
|
16
|
-
D as safeParse,
|
|
17
|
-
P as safeParseAsync,
|
|
18
|
-
q as validate,
|
|
19
|
-
u as validateAsync
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=parse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sources":["../../../../../../../node_modules/zod/v4/classic/parse.js"],"sourcesContent":["import * as core from \"../core/index.js\";\nimport { ZodRealError } from \"./errors.js\";\nexport const parse = /* @__PURE__ */ core._parse(ZodRealError);\nexport const parseAsync = /* @__PURE__ */ core._parseAsync(ZodRealError);\nexport const safeParse = /* @__PURE__ */ core._safeParse(ZodRealError);\nexport const safeParseAsync = /* @__PURE__ */ core._safeParseAsync(ZodRealError);\nexport { validate, validateAsync } from \"../core/index.js\";\n// Codec functions\nexport const encode = /* @__PURE__ */ core._encode(ZodRealError);\nexport const decode = /* @__PURE__ */ core._decode(ZodRealError);\nexport const encodeAsync = /* @__PURE__ */ core._encodeAsync(ZodRealError);\nexport const decodeAsync = /* @__PURE__ */ core._decodeAsync(ZodRealError);\nexport const safeEncode = /* @__PURE__ */ core._safeEncode(ZodRealError);\nexport const safeDecode = /* @__PURE__ */ core._safeDecode(ZodRealError);\nexport const safeEncodeAsync = /* @__PURE__ */ core._safeEncodeAsync(ZodRealError);\nexport const safeDecodeAsync = /* @__PURE__ */ core._safeDecodeAsync(ZodRealError);\n"],"names":["parse","core._parse","ZodRealError","parseAsync","core._parseAsync","safeParse","core._safeParse","safeParseAsync","core._safeParseAsync","encode","core._encode","decode","core._decode","encodeAsync","core._encodeAsync","decodeAsync","core._decodeAsync","safeEncode","core._safeEncode","safeDecode","core._safeDecode","safeEncodeAsync","core._safeEncodeAsync","safeDecodeAsync","core._safeDecodeAsync"],"mappings":";;;AAEY,MAACA,IAAwBC,gBAAAA,EAAYC,CAAY,GAChDC,IAA6BC,gBAAAA,EAAiBF,CAAY,GAC1DG,IAA4BC,gBAAAA,EAAgBJ,CAAY,GACxDK,IAAiCC,gBAAAA,EAAqBN,CAAY,GAGlEO,IAAyBC,gBAAAA,EAAaR,CAAY,GAClDS,IAAyBC,gBAAAA,EAAaV,CAAY,GAClDW,IAA8BC,gBAAAA,EAAkBZ,CAAY,GAC5Da,IAA8BC,gBAAAA,EAAkBd,CAAY,GAC5De,IAA6BC,gBAAAA,EAAiBhB,CAAY,GAC1DiB,IAA6BC,gBAAAA,EAAiBlB,CAAY,GAC1DmB,IAAkCC,gBAAAA,EAAsBpB,CAAY,GACpEqB,IAAkCC,gBAAAA,EAAsBtB,CAAY;","x_google_ignoreList":[0]}
|