@jbpark/live-editor 4.6.1 → 6.0.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.
Files changed (91) hide show
  1. package/README.ko.md +37 -35
  2. package/README.md +37 -35
  3. package/dist/{boundary-BLB80tyw.js → boundary-CySnDUs2.js} +5 -4
  4. package/dist/boundary-CySnDUs2.js.map +1 -0
  5. package/dist/{compile-Dxas-D05.js → compile-my0AjsCw.js} +8 -7
  6. package/dist/compile-my0AjsCw.js.map +1 -0
  7. package/dist/constants-st9gnJ5g.js +55 -0
  8. package/dist/constants-st9gnJ5g.js.map +1 -0
  9. package/dist/{context-B8MzP7_p.js → context-Bjq0CvBE.js} +3 -3
  10. package/dist/{context-B8MzP7_p.js.map → context-Bjq0CvBE.js.map} +1 -1
  11. package/dist/{core-Bgfek364.js → core-BNVuH8-l.js} +51 -14
  12. package/dist/core-BNVuH8-l.js.map +1 -0
  13. package/dist/{detect-typescript-Dr_oLniM.js → detect-typescript-CMF0FVKD.js} +2 -2
  14. package/dist/{detect-typescript-Dr_oLniM.js.map → detect-typescript-CMF0FVKD.js.map} +1 -1
  15. package/dist/dnd/index.d.ts +3 -2
  16. package/dist/dnd/index.js +3 -2
  17. package/dist/dnd-BvjEDo-x.js +4197 -0
  18. package/dist/dnd-BvjEDo-x.js.map +1 -0
  19. package/dist/document-BQhb7YR8.d.ts +17 -0
  20. package/dist/{document-CHO215iP.js → document-uHqw0mvr.js} +194 -109
  21. package/dist/document-uHqw0mvr.js.map +1 -0
  22. package/dist/edit-options-C_r9aCz4.d.ts +100 -0
  23. package/dist/editor/index.d.ts +1 -1
  24. package/dist/editor/index.js +2 -2
  25. package/dist/{editor-CMElfHer.js → editor-CvnzrM9J.js} +2 -2
  26. package/dist/{editor-CMElfHer.js.map → editor-CvnzrM9J.js.map} +1 -1
  27. package/dist/error/index.d.ts +1 -1
  28. package/dist/error/index.js +2 -2
  29. package/dist/{error-CN_GCnXB.js → error-CFzvnLCf.js} +18 -32
  30. package/dist/error-CFzvnLCf.js.map +1 -0
  31. package/dist/{index-DpDU1IAw.d.ts → index-92L7F440.d.ts} +2 -2
  32. package/dist/{index-DrWtSKXu.d.ts → index-BZpZwrxT.d.ts} +2 -2
  33. package/dist/index-C8h8TcIl.d.ts +15 -0
  34. package/dist/{index-13BDSrQc.d.ts → index-C93npmTU.d.ts} +4 -6
  35. package/dist/{index-DQkL37eL.d.ts → index-CqsS207F.d.ts} +6 -12
  36. package/dist/{index-CiWB0zFb.d.ts → index-DQcdHg_V.d.ts} +18 -136
  37. package/dist/{index-CRwEhJ7w.d.ts → index-DfIvkht8.d.ts} +3 -3
  38. package/dist/index.d.ts +12 -11
  39. package/dist/index.js +6 -6
  40. package/dist/index.js.map +1 -1
  41. package/dist/{messages-IBPs4TkZ.d.ts → messages-BpN3QIhj.d.ts} +8 -2
  42. package/dist/{messages-CSrMI4Rm.js → messages-DrINcRdG.js} +8 -2
  43. package/dist/messages-DrINcRdG.js.map +1 -0
  44. package/dist/preview/index.d.ts +2 -2
  45. package/dist/preview/index.js +2 -3
  46. package/dist/{preview-CtyG5UbH.js → preview-B05MkVIQ.js} +16 -13
  47. package/dist/preview-B05MkVIQ.js.map +1 -0
  48. package/dist/provider/index.d.ts +2 -2
  49. package/dist/provider/index.js +2 -2
  50. package/dist/{sections-jYuqS4KB.js → sections-DhH_aVf5.js} +4 -7
  51. package/dist/sections-DhH_aVf5.js.map +1 -0
  52. package/dist/style.css +809 -4950
  53. package/dist/{validate-DB59Z_Nx.d.ts → types-Czps1Txy.d.ts} +12 -28
  54. package/dist/ui-kit/index.d.ts +22 -0
  55. package/dist/{constants-DU17Tdwo.js → ui-kit/index.js} +147 -54
  56. package/dist/ui-kit/index.js.map +1 -0
  57. package/dist/ui-kit/style.css +5039 -0
  58. package/dist/update-2PJbwoS8.d.ts +68 -0
  59. package/dist/{items-BXXtMUNI.js → update-BuYQJqjq.js} +143 -392
  60. package/dist/update-BuYQJqjq.js.map +1 -0
  61. package/dist/{use-dynamic-tailwind-BP1toJkW.js → use-dynamic-tailwind-B3l1qZRW.js} +318 -287
  62. package/dist/use-dynamic-tailwind-B3l1qZRW.js.map +1 -0
  63. package/dist/use-field-state-iQGW0vc6.js +131 -0
  64. package/dist/use-field-state-iQGW0vc6.js.map +1 -0
  65. package/dist/utils/ast/index.d.ts +47 -4
  66. package/dist/utils/ast/index.js +4 -64
  67. package/dist/utils/ast/index.js.map +1 -1
  68. package/dist/utils/index.d.ts +13 -32
  69. package/dist/utils/index.js +4 -26
  70. package/dist/validate-CZz30Pnb.js +122 -0
  71. package/dist/validate-CZz30Pnb.js.map +1 -0
  72. package/dist/validate-CiA1LF6S.d.ts +33 -0
  73. package/package.json +20 -10
  74. package/dist/boundary-BLB80tyw.js.map +0 -1
  75. package/dist/compile-Dxas-D05.js.map +0 -1
  76. package/dist/constants-DU17Tdwo.js.map +0 -1
  77. package/dist/core-Bgfek364.js.map +0 -1
  78. package/dist/dnd-V8NAxd_R.js +0 -2755
  79. package/dist/dnd-V8NAxd_R.js.map +0 -1
  80. package/dist/document-CHO215iP.js.map +0 -1
  81. package/dist/document-DqRSCtsx.d.ts +0 -1614
  82. package/dist/error-CN_GCnXB.js.map +0 -1
  83. package/dist/index-C_PfR4X9.d.ts +0 -734
  84. package/dist/items-BXXtMUNI.js.map +0 -1
  85. package/dist/messages-CSrMI4Rm.js.map +0 -1
  86. package/dist/preview-CtyG5UbH.js.map +0 -1
  87. package/dist/sections-jYuqS4KB.js.map +0 -1
  88. package/dist/use-dynamic-tailwind-BP1toJkW.js.map +0 -1
  89. package/dist/utils/index.js.map +0 -1
  90. package/dist/validate-iLo8IONY.js +0 -64
  91. package/dist/validate-iLo8IONY.js.map +0 -1
@@ -0,0 +1,100 @@
1
+ import { a as BindingOption, d as BindingType, f as BindingWidget, l as BindingRenderMap, p as DataAttrNode } from "./types-Czps1Txy.js";
2
+ import { r as UpdateFailure } from "./update-2PJbwoS8.js";
3
+ //#region src/components/dnd/panel-binding.d.ts
4
+ interface PanelNodeChange {
5
+ (params: {
6
+ id: string;
7
+ label: string;
8
+ property: string;
9
+ value: unknown;
10
+ }): void;
11
+ }
12
+ interface PanelNodesChange {
13
+ (changes: Parameters<PanelNodeChange>[0][]): void;
14
+ }
15
+ interface PanelBinding {
16
+ id: string;
17
+ label: string;
18
+ property: string;
19
+ type?: BindingType;
20
+ widget?: BindingWidget;
21
+ options?: BindingOption[];
22
+ render?: BindingRenderMap;
23
+ min?: number;
24
+ max?: number;
25
+ pattern?: string;
26
+ patternMessage?: string;
27
+ required?: boolean;
28
+ minLength?: number;
29
+ maxLength?: number;
30
+ step?: number;
31
+ minItems?: number;
32
+ maxItems?: number;
33
+ minDate?: string;
34
+ maxDate?: string;
35
+ protocols?: string[];
36
+ meta?: Record<string, unknown>;
37
+ value: unknown;
38
+ rawValue: string;
39
+ canEditValue?: boolean;
40
+ present?: boolean;
41
+ element?: PanelBindingElement;
42
+ onChange: (value: unknown) => void;
43
+ }
44
+ interface PanelBindingElement {
45
+ tagName: string;
46
+ text: string;
47
+ }
48
+ type PanelBindingData = Omit<PanelBinding, 'onChange'>;
49
+ interface PanelBindingSource {
50
+ id: string;
51
+ tagName: string;
52
+ bindings: PanelBindingData[];
53
+ }
54
+ declare const resolvePanelBindings: (node: DataAttrNode) => PanelBindingSource | null;
55
+ declare const withPanelCommit: (bindings: PanelBindingData[], commit: PanelNodeChange | undefined) => PanelBinding[];
56
+ //#endregion
57
+ //#region src/components/dnd/panel/types.d.ts
58
+ interface FieldProps {
59
+ binding: PanelBinding;
60
+ onNodeChange?: PanelNodeChange;
61
+ }
62
+ //#endregion
63
+ //#region src/components/dnd/edit-options.d.ts
64
+ type DndEditError = {
65
+ type: 'update';
66
+ id: string;
67
+ label: string;
68
+ property: string;
69
+ failure: UpdateFailure | undefined;
70
+ title: string;
71
+ description?: string;
72
+ } | {
73
+ type: 'parse';
74
+ target: 'section' | 'items';
75
+ error?: unknown;
76
+ title: string;
77
+ description?: string;
78
+ } | {
79
+ type: 'parse';
80
+ target: 'document';
81
+ reason: 'parse-error';
82
+ error: unknown;
83
+ title: string;
84
+ description?: string;
85
+ } | {
86
+ type: 'parse';
87
+ target: 'document';
88
+ reason: 'container-not-found';
89
+ containerId: string;
90
+ title: string;
91
+ description?: string;
92
+ } | {
93
+ type: 'items';
94
+ title: string;
95
+ description?: string;
96
+ };
97
+ type DndRenderField = (props: FieldProps, builtin: React.ReactElement) => React.ReactNode | undefined;
98
+ //#endregion
99
+ export { PanelBindingData as a, PanelNodeChange as c, withPanelCommit as d, PanelBinding as i, PanelNodesChange as l, DndRenderField as n, PanelBindingElement as o, FieldProps as r, PanelBindingSource as s, DndEditError as t, resolvePanelBindings as u };
100
+ //# sourceMappingURL=edit-options-C_r9aCz4.d.ts.map
@@ -1,2 +1,2 @@
1
- import { a as Props, i as Core, n as EditorRenderData, r as Props$1, t as Editor } from "../index-13BDSrQc.js";
1
+ import { a as Props, i as Core, n as EditorRenderData, r as Props$1, t as Editor } from "../index-C93npmTU.js";
2
2
  export { Core, type Props as CoreProps, type EditorRenderData, type Props$1 as Props, Editor as default };
@@ -1,3 +1,3 @@
1
- import { t as Core } from "../core-Bgfek364.js";
2
- import { t as Editor } from "../editor-CMElfHer.js";
1
+ import { t as Core } from "../core-BNVuH8-l.js";
2
+ import { t as Editor } from "../editor-CvnzrM9J.js";
3
3
  export { Core, Editor as default };
@@ -1,5 +1,5 @@
1
1
  import { i as usePreview, r as useError } from "./states-Ci1AvoQ9.js";
2
- import { n as useFormatCode, t as Core } from "./core-Bgfek364.js";
2
+ import { n as useFormatCode, t as Core } from "./core-BNVuH8-l.js";
3
3
  import { useCallback, useState } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { useDebouncedCallback } from "@jbpark/use-hooks";
@@ -63,4 +63,4 @@ Editor.Core = Core;
63
63
  //#endregion
64
64
  export { Editor as t };
65
65
 
66
- //# sourceMappingURL=editor-CMElfHer.js.map
66
+ //# sourceMappingURL=editor-CvnzrM9J.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor-CMElfHer.js","names":["Editor","EditorImpl"],"sources":["../src/components/editor/editor.tsx","../src/components/editor/index.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\n\nimport { useDebouncedCallback } from '@jbpark/use-hooks';\n\nimport { useError, usePreview } from '~/components/context/states';\n\nimport Core, { type Props as CoreProps } from './core';\nimport { useFormatCode } from './use-format-code';\n\nexport interface EditorRenderData {\n value: string;\n onChange: (value: string) => void;\n // The same Prettier formatting the built-in editor uses on Cmd+S, for a\n // custom editor's own format-on-save.\n formatCode: (code: string) => Promise<string>;\n}\n\nexport interface Props extends Omit<CoreProps, 'value' | 'onSave' | 'onError'> {\n value?: string;\n defaultValue?: string;\n debounce?: number;\n // Replaces the built-in CodeMirror editor. `Live.Editor` still sends the\n // value to the provider, debounced; only the editing surface changes.\n renderEditor?: (data: EditorRenderData) => React.ReactNode;\n}\n\nconst Editor = ({\n defaultValue,\n value: _value,\n debounce = 1000,\n onChange: _onChange,\n renderEditor,\n fragment,\n prettierOptions,\n ...props\n}: Props) => {\n const { code, setCode } = usePreview();\n const { setError } = useError();\n\n // Controlled, the host owns the document; uncontrolled, the provider does\n // (#341). `draft` shows each keystroke at once, while the provider hears\n // about it after `debounce`.\n const controlled = _value !== undefined;\n const [draft, setDraft] = useState(() => defaultValue ?? code);\n\n // The last code this editor pushed, and the provider code it has already\n // seen. A provider change that isn't this editor's own push came from\n // somewhere else sharing the provider — an uncontrolled DnD, say — and the\n // draft follows it. Adjusted during render so no frame shows the old one.\n const [pushed, setPushed] = useState<string | null>(null);\n const [seenCode, setSeenCode] = useState(code);\n\n if (code !== seenCode) {\n setSeenCode(code);\n\n if (!controlled && code !== pushed) {\n setDraft(code);\n }\n }\n\n const value = controlled ? _value : draft;\n\n const pushCode = useCallback(\n (next: string) => {\n setPushed(next);\n setCode(next);\n },\n [setCode],\n );\n\n const onChange = useCallback(\n (next: string) => {\n if (!controlled) {\n setDraft(next);\n }\n\n _onChange?.(next);\n },\n [_onChange, controlled],\n );\n\n // Formatting on save reaches the provider at once, ahead of the debounce.\n const onSave = useCallback(\n (formattedCode: string) => {\n pushCode(formattedCode);\n },\n [pushCode],\n );\n\n const onError = useCallback(\n (error: string | null) => {\n setError(error);\n },\n [setError],\n );\n\n const formatCode = useFormatCode({ fragment, prettierOptions });\n\n // Pushes `value` to the provider `debounce` ms after it stops changing,\n // and at once on mount. A pending push is never dropped: it runs when the\n // editor unmounts, and when focus leaves it — so clicking into another\n // surface right after typing edits a document that includes the typing.\n const push = useDebouncedCallback(\n () => pushCode(value),\n { delay: debounce, flushOnUnmount: true },\n [value],\n );\n\n // `display: contents` so the wrapper adds a blur listener without adding a\n // box: the editor lays out against this element's parent, as before.\n return (\n <div style={{ display: 'contents' }} onBlur={push.flush}>\n {renderEditor ? (\n renderEditor({ value, onChange, formatCode })\n ) : (\n <Core\n value={value}\n onChange={onChange}\n onSave={onSave}\n onError={onError}\n fragment={fragment}\n prettierOptions={prettierOptions}\n {...props}\n />\n )}\n </div>\n );\n};\n\nexport default Editor;\n","import Core, { type Props as CoreProps } from './core';\nimport EditorImpl, { type EditorRenderData, type Props } from './editor';\n\ntype EditorComponent = typeof EditorImpl & { Core: typeof Core };\n\nconst Editor = EditorImpl as EditorComponent;\n\nEditor.Core = Core;\n\nexport { Core };\nexport type { Props, CoreProps, EditorRenderData };\nexport default Editor;\n"],"mappings":";;;;;;AA0BA,MAAMA,YAAU,EACd,cACA,OAAO,QACP,WAAW,KACX,UAAU,WACV,cACA,UACA,iBACA,GAAG,YACQ;CACX,MAAM,EAAE,MAAM,YAAY,WAAW;CACrC,MAAM,EAAE,aAAa,SAAS;CAK9B,MAAM,aAAa,WAAW,KAAA;CAC9B,MAAM,CAAC,OAAO,YAAY,eAAe,gBAAgB,IAAI;CAM7D,MAAM,CAAC,QAAQ,aAAa,SAAwB,IAAI;CACxD,MAAM,CAAC,UAAU,eAAe,SAAS,IAAI;CAE7C,IAAI,SAAS,UAAU;EACrB,YAAY,IAAI;EAEhB,IAAI,CAAC,cAAc,SAAS,QAC1B,SAAS,IAAI;CAEjB;CAEA,MAAM,QAAQ,aAAa,SAAS;CAEpC,MAAM,WAAW,aACd,SAAiB;EAChB,UAAU,IAAI;EACd,QAAQ,IAAI;CACd,GACA,CAAC,OAAO,CACV;CAEA,MAAM,WAAW,aACd,SAAiB;EAChB,IAAI,CAAC,YACH,SAAS,IAAI;EAGf,YAAY,IAAI;CAClB,GACA,CAAC,WAAW,UAAU,CACxB;CAGA,MAAM,SAAS,aACZ,kBAA0B;EACzB,SAAS,aAAa;CACxB,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,UAAU,aACb,UAAyB;EACxB,SAAS,KAAK;CAChB,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,aAAa,cAAc;EAAE;EAAU;CAAgB,CAAC;CAM9D,MAAM,OAAO,2BACL,SAAS,KAAK,GACpB;EAAE,OAAO;EAAU,gBAAgB;CAAK,GACxC,CAAC,KAAK,CACR;CAIA,OACE,oBAAC,OAAD;EAAK,OAAO,EAAE,SAAS,WAAW;EAAG,QAAQ,KAAK;EAC/C,UAAA,eACC,aAAa;GAAE;GAAO;GAAU;EAAW,CAAC,IAE5C,oBAAC,MAAD;GACS;GACG;GACF;GACC;GACC;GACO;GACjB,GAAI;EACL,CAAA;CAEA,CAAA;AAET;;;AC1HA,MAAM,SAASC;AAEf,OAAO,OAAO"}
1
+ {"version":3,"file":"editor-CvnzrM9J.js","names":["Editor","EditorImpl"],"sources":["../src/components/editor/editor.tsx","../src/components/editor/index.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\n\nimport { useDebouncedCallback } from '@jbpark/use-hooks';\n\nimport { useError, usePreview } from '~/components/context/states';\n\nimport Core, { type Props as CoreProps } from './core';\nimport { useFormatCode } from './use-format-code';\n\nexport interface EditorRenderData {\n value: string;\n onChange: (value: string) => void;\n // The same Prettier formatting the built-in editor uses on Cmd+S, for a\n // custom editor's own format-on-save.\n formatCode: (code: string) => Promise<string>;\n}\n\nexport interface Props extends Omit<CoreProps, 'value' | 'onSave' | 'onError'> {\n value?: string;\n defaultValue?: string;\n debounce?: number;\n // Replaces the built-in CodeMirror editor. `Live.Editor` still sends the\n // value to the provider, debounced; only the editing surface changes.\n renderEditor?: (data: EditorRenderData) => React.ReactNode;\n}\n\nconst Editor = ({\n defaultValue,\n value: _value,\n debounce = 1000,\n onChange: _onChange,\n renderEditor,\n fragment,\n prettierOptions,\n ...props\n}: Props) => {\n const { code, setCode } = usePreview();\n const { setError } = useError();\n\n // Controlled, the host owns the document; uncontrolled, the provider does\n // (#341). `draft` shows each keystroke at once, while the provider hears\n // about it after `debounce`.\n const controlled = _value !== undefined;\n const [draft, setDraft] = useState(() => defaultValue ?? code);\n\n // The last code this editor pushed, and the provider code it has already\n // seen. A provider change that isn't this editor's own push came from\n // somewhere else sharing the provider — an uncontrolled DnD, say — and the\n // draft follows it. Adjusted during render so no frame shows the old one.\n const [pushed, setPushed] = useState<string | null>(null);\n const [seenCode, setSeenCode] = useState(code);\n\n if (code !== seenCode) {\n setSeenCode(code);\n\n if (!controlled && code !== pushed) {\n setDraft(code);\n }\n }\n\n const value = controlled ? _value : draft;\n\n const pushCode = useCallback(\n (next: string) => {\n setPushed(next);\n setCode(next);\n },\n [setCode],\n );\n\n const onChange = useCallback(\n (next: string) => {\n if (!controlled) {\n setDraft(next);\n }\n\n _onChange?.(next);\n },\n [_onChange, controlled],\n );\n\n // Formatting on save reaches the provider at once, ahead of the debounce.\n const onSave = useCallback(\n (formattedCode: string) => {\n pushCode(formattedCode);\n },\n [pushCode],\n );\n\n const onError = useCallback(\n (error: string | null) => {\n setError(error);\n },\n [setError],\n );\n\n const formatCode = useFormatCode({ fragment, prettierOptions });\n\n // Pushes `value` to the provider `debounce` ms after it stops changing,\n // and at once on mount. A pending push is never dropped: it runs when the\n // editor unmounts, and when focus leaves it — so clicking into another\n // surface right after typing edits a document that includes the typing.\n const push = useDebouncedCallback(\n () => pushCode(value),\n { delay: debounce, flushOnUnmount: true },\n [value],\n );\n\n // `display: contents` so the wrapper adds a blur listener without adding a\n // box: the editor lays out against this element's parent, as before.\n return (\n <div style={{ display: 'contents' }} onBlur={push.flush}>\n {renderEditor ? (\n renderEditor({ value, onChange, formatCode })\n ) : (\n <Core\n value={value}\n onChange={onChange}\n onSave={onSave}\n onError={onError}\n fragment={fragment}\n prettierOptions={prettierOptions}\n {...props}\n />\n )}\n </div>\n );\n};\n\nexport default Editor;\n","import Core, { type Props as CoreProps } from './core';\nimport EditorImpl, { type EditorRenderData, type Props } from './editor';\n\ntype EditorComponent = typeof EditorImpl & { Core: typeof Core };\n\nconst Editor = EditorImpl as EditorComponent;\n\nEditor.Core = Core;\n\nexport { Core };\nexport type { Props, CoreProps, EditorRenderData };\nexport default Editor;\n"],"mappings":";;;;;;AA0BA,MAAMA,YAAU,EACd,cACA,OAAO,QACP,WAAW,KACX,UAAU,WACV,cACA,UACA,iBACA,GAAG,YACQ;CACX,MAAM,EAAE,MAAM,YAAY,WAAW;CACrC,MAAM,EAAE,aAAa,SAAS;CAK9B,MAAM,aAAa,WAAW,KAAA;CAC9B,MAAM,CAAC,OAAO,YAAY,eAAe,gBAAgB,IAAI;CAM7D,MAAM,CAAC,QAAQ,aAAa,SAAwB,IAAI;CACxD,MAAM,CAAC,UAAU,eAAe,SAAS,IAAI;CAE7C,IAAI,SAAS,UAAU;EACrB,YAAY,IAAI;EAEhB,IAAI,CAAC,cAAc,SAAS,QAC1B,SAAS,IAAI;CAEjB;CAEA,MAAM,QAAQ,aAAa,SAAS;CAEpC,MAAM,WAAW,aACd,SAAiB;EAChB,UAAU,IAAI;EACd,QAAQ,IAAI;CACd,GACA,CAAC,OAAO,CACV;CAEA,MAAM,WAAW,aACd,SAAiB;EAChB,IAAI,CAAC,YACH,SAAS,IAAI;EAGf,YAAY,IAAI;CAClB,GACA,CAAC,WAAW,UAAU,CACxB;CAGA,MAAM,SAAS,aACZ,kBAA0B;EACzB,SAAS,aAAa;CACxB,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,UAAU,aACb,UAAyB;EACxB,SAAS,KAAK;CAChB,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,aAAa,cAAc;EAAE;EAAU;CAAgB,CAAC;CAM9D,MAAM,OAAO,2BACL,SAAS,KAAK,GACpB;EAAE,OAAO;EAAU,gBAAgB;CAAK,GACxC,CAAC,KAAK,CACR;CAIA,OACE,oBAAC,OAAD;EAAK,OAAO,EAAE,SAAS,WAAW;EAAG,QAAQ,KAAK;EAC/C,UAAA,eACC,aAAa;GAAE;GAAO;GAAU;EAAW,CAAC,IAE5C,oBAAC,MAAD;GACS;GACG;GACF;GACC;GACC;GACO;GACjB,GAAI;EACL,CAAA;CAEA,CAAA;AAET;;;AC1HA,MAAM,SAASC;AAEf,OAAO,OAAO"}
@@ -1,2 +1,2 @@
1
- import { i as Guard, o as Props, r as Runtime, s as ErrorBoundary, t as Error } from "../index-CRwEhJ7w.js";
1
+ import { i as Guard, o as Props, r as Runtime, s as ErrorBoundary, t as Error } from "../index-DfIvkht8.js";
2
2
  export { ErrorBoundary, Guard as ErrorGuard, Runtime as ErrorRuntime, type Props, Error as default };
@@ -1,3 +1,3 @@
1
- import { t as ErrorBoundary } from "../boundary-BLB80tyw.js";
2
- import { n as Runtime, r as Guard, t as Error } from "../error-CN_GCnXB.js";
1
+ import { t as ErrorBoundary } from "../boundary-CySnDUs2.js";
2
+ import { n as Runtime, r as Guard, t as Error } from "../error-CFzvnLCf.js";
3
3
  export { ErrorBoundary, Guard as ErrorGuard, Runtime as ErrorRuntime, Error as default };
@@ -1,19 +1,15 @@
1
- import { i as useLiveMessages } from "./messages-CSrMI4Rm.js";
1
+ import { i as useLiveMessages } from "./messages-DrINcRdG.js";
2
2
  import { r as useError } from "./states-Ci1AvoQ9.js";
3
- import { n as Error$1, t as ErrorBoundary } from "./boundary-BLB80tyw.js";
3
+ import { n as Error$1, t as ErrorBoundary } from "./boundary-CySnDUs2.js";
4
4
  import { useEffect, useRef, useState } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
- import { useEventListener } from "@jbpark/use-hooks";
6
+ import { useEventListener, useLatest } from "@jbpark/use-hooks";
7
7
  //#region src/components/error/guard.tsx
8
8
  const Guard = ({ children, onError }) => {
9
9
  const [error, setError] = useState(null);
10
10
  const messages = useLiveMessages();
11
- const containerRef = useRef(null);
12
11
  const errorHandled = useRef(false);
13
- const messagesRef = useRef(messages);
14
- useEffect(() => {
15
- messagesRef.current = messages;
16
- });
12
+ const messagesRef = useLatest(messages);
17
13
  useEventListener("error", (event) => {
18
14
  if (errorHandled.current) return;
19
15
  errorHandled.current = true;
@@ -26,37 +22,27 @@ const Guard = ({ children, onError }) => {
26
22
  errorHandled.current = false;
27
23
  }, 100);
28
24
  }, { capture: true });
29
- useEffect(() => {
30
- if (!containerRef.current) return;
31
- const handleUnhandledRejection = (event) => {
32
- if (errorHandled.current) return;
33
- errorHandled.current = true;
34
- const errorMessage = event.reason?.message || messagesRef.current.errors.unhandledRejection;
35
- event.preventDefault();
36
- setError(errorMessage);
37
- onError?.(event.reason || new window.Error(errorMessage));
38
- setTimeout(() => {
39
- errorHandled.current = false;
40
- }, 100);
41
- };
42
- window.addEventListener("unhandledrejection", handleUnhandledRejection, true);
43
- return () => {
44
- window.removeEventListener("unhandledrejection", handleUnhandledRejection, true);
45
- };
46
- }, [onError]);
25
+ useEventListener("unhandledrejection", (event) => {
26
+ if (errorHandled.current) return;
27
+ errorHandled.current = true;
28
+ const errorMessage = event.reason?.message || messagesRef.current.errors.unhandledRejection;
29
+ event.preventDefault();
30
+ setError(errorMessage);
31
+ onError?.(event.reason || new window.Error(errorMessage));
32
+ setTimeout(() => {
33
+ errorHandled.current = false;
34
+ }, 100);
35
+ }, { capture: true });
47
36
  if (error) return /* @__PURE__ */ jsx(Error$1, {
48
37
  title: messages.errors.runtime,
49
38
  message: error,
50
- className: "m-4",
39
+ style: { margin: 16 },
51
40
  onReset: () => {
52
41
  setError(null);
53
42
  errorHandled.current = false;
54
43
  }
55
44
  });
56
- return /* @__PURE__ */ jsx("div", {
57
- ref: containerRef,
58
- children
59
- });
45
+ return /* @__PURE__ */ jsx("div", { children });
60
46
  };
61
47
  //#endregion
62
48
  //#region src/components/error/runtime.tsx
@@ -86,4 +72,4 @@ Error.Guard = Guard;
86
72
  //#endregion
87
73
  export { Runtime as n, Guard as r, Error as t };
88
74
 
89
- //# sourceMappingURL=error-CN_GCnXB.js.map
75
+ //# sourceMappingURL=error-CFzvnLCf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-CFzvnLCf.js","names":["ErrorComponent","Error","ErrorImpl","ErrorRuntime","ErrorGuard"],"sources":["../src/components/error/guard.tsx","../src/components/error/runtime.tsx","../src/components/error/index.ts"],"sourcesContent":["import { useRef, useState } from 'react';\n\nimport { useEventListener, useLatest } from '@jbpark/use-hooks';\n\nimport { useLiveMessages } from '~/components/context/messages';\n\nimport ErrorComponent from './error';\n\n// Exported although no file imports it: the declaration of `App` in\n// `src/index.tsx` names it, and TypeScript can't name a type from another\n// module unless it is exported (TS4023).\nexport interface Props {\n children: React.ReactNode;\n onError?: (error: Error) => void;\n}\n\nconst Guard = ({ children, onError }: Props) => {\n const [error, setError] = useState<string | null>(null);\n const messages = useLiveMessages();\n\n const errorHandled = useRef(false);\n // Read by the listeners, so new messages don't subscribe them again.\n const messagesRef = useLatest(messages);\n\n useEventListener(\n 'error',\n event => {\n if (errorHandled.current) {\n return;\n }\n\n errorHandled.current = true;\n\n const errorMessage =\n event.error?.message ||\n event.message ||\n messagesRef.current.errors.unknown;\n\n console.error('⚡ [Guard] Event handler error:', errorMessage);\n\n event.preventDefault();\n\n setError(errorMessage);\n onError?.(event.error || new window.Error(errorMessage));\n\n setTimeout(() => {\n errorHandled.current = false;\n }, 100);\n },\n { capture: true },\n );\n\n useEventListener(\n 'unhandledrejection',\n event => {\n if (errorHandled.current) {\n return;\n }\n\n errorHandled.current = true;\n\n const errorMessage =\n event.reason?.message || messagesRef.current.errors.unhandledRejection;\n\n event.preventDefault();\n setError(errorMessage);\n onError?.(event.reason || new window.Error(errorMessage));\n\n setTimeout(() => {\n errorHandled.current = false;\n }, 100);\n },\n { capture: true },\n );\n\n if (error) {\n return (\n <ErrorComponent\n title={messages.errors.runtime}\n message={error}\n style={{ margin: 16 }}\n onReset={() => {\n setError(null);\n errorHandled.current = false;\n }}\n />\n );\n }\n\n return <div>{children}</div>;\n};\n\nexport default Guard;\n","import { useEffect } from 'react';\n\nimport { useEventListener } from '@jbpark/use-hooks';\n\nimport { useLiveMessages } from '~/components/context/messages';\nimport { useError } from '~/components/context/states';\n\nimport Error from './error';\n\n// Exported although no file imports it: the declaration of `App` in\n// `src/index.tsx` names it, and TypeScript can't name a type from another\n// module unless it is exported (TS4023).\nexport interface Props extends React.ComponentPropsWithRef<'div'> {\n open?: boolean;\n reset?: () => void;\n}\n\nconst Runtime = ({ open = true, reset }: Props) => {\n const { error: message, setError } = useError();\n const messages = useLiveMessages();\n\n useEventListener('error', e => {\n setError(e.message);\n e.preventDefault();\n });\n\n useEffect(() => {\n return () => setError(null);\n }, [setError]);\n\n if (!open) {\n return null;\n }\n\n return (\n <Error message={message} onReset={reset} title={messages.errors.runtime} />\n );\n};\n\nexport default Runtime;\n","import ErrorBoundary from './boundary';\nimport ErrorImpl, { type Props } from './error';\nimport ErrorGuard from './guard';\nimport ErrorRuntime from './runtime';\n\ntype ErrorComponent = typeof ErrorImpl & {\n Boundary: typeof ErrorBoundary;\n Runtime: typeof ErrorRuntime;\n Guard: typeof ErrorGuard;\n};\n\nconst Error = ErrorImpl as ErrorComponent;\n\nError.Boundary = ErrorBoundary;\nError.Runtime = ErrorRuntime;\nError.Guard = ErrorGuard;\n\nexport { ErrorBoundary, ErrorRuntime, ErrorGuard };\nexport type { Props };\nexport default Error;\n"],"mappings":";;;;;;;AAgBA,MAAM,SAAS,EAAE,UAAU,cAAqB;CAC9C,MAAM,CAAC,OAAO,YAAY,SAAwB,IAAI;CACtD,MAAM,WAAW,gBAAgB;CAEjC,MAAM,eAAe,OAAO,KAAK;CAEjC,MAAM,cAAc,UAAU,QAAQ;CAEtC,iBACE,UACA,UAAS;EACP,IAAI,aAAa,SACf;EAGF,aAAa,UAAU;EAEvB,MAAM,eACJ,MAAM,OAAO,WACb,MAAM,WACN,YAAY,QAAQ,OAAO;EAE7B,QAAQ,MAAM,kCAAkC,YAAY;EAE5D,MAAM,eAAe;EAErB,SAAS,YAAY;EACrB,UAAU,MAAM,SAAS,IAAI,OAAO,MAAM,YAAY,CAAC;EAEvD,iBAAiB;GACf,aAAa,UAAU;EACzB,GAAG,GAAG;CACR,GACA,EAAE,SAAS,KAAK,CAClB;CAEA,iBACE,uBACA,UAAS;EACP,IAAI,aAAa,SACf;EAGF,aAAa,UAAU;EAEvB,MAAM,eACJ,MAAM,QAAQ,WAAW,YAAY,QAAQ,OAAO;EAEtD,MAAM,eAAe;EACrB,SAAS,YAAY;EACrB,UAAU,MAAM,UAAU,IAAI,OAAO,MAAM,YAAY,CAAC;EAExD,iBAAiB;GACf,aAAa,UAAU;EACzB,GAAG,GAAG;CACR,GACA,EAAE,SAAS,KAAK,CAClB;CAEA,IAAI,OACF,OACE,oBAACA,SAAD;EACE,OAAO,SAAS,OAAO;EACvB,SAAS;EACT,OAAO,EAAE,QAAQ,GAAG;EACpB,eAAe;GACb,SAAS,IAAI;GACb,aAAa,UAAU;EACzB;CACD,CAAA;CAIL,OAAO,oBAAC,OAAD,EAAM,SAAc,CAAA;AAC7B;;;ACzEA,MAAM,WAAW,EAAE,OAAO,MAAM,YAAmB;CACjD,MAAM,EAAE,OAAO,SAAS,aAAa,SAAS;CAC9C,MAAM,WAAW,gBAAgB;CAEjC,iBAAiB,UAAS,MAAK;EAC7B,SAAS,EAAE,OAAO;EAClB,EAAE,eAAe;CACnB,CAAC;CAED,gBAAgB;EACd,aAAa,SAAS,IAAI;CAC5B,GAAG,CAAC,QAAQ,CAAC;CAEb,IAAI,CAAC,MACH,OAAO;CAGT,OACE,oBAACC,SAAD;EAAgB;EAAS,SAAS;EAAO,OAAO,SAAS,OAAO;CAAU,CAAA;AAE9E;;;AC1BA,MAAM,QAAQC;AAEd,MAAM,WAAW;AACjB,MAAM,UAAUC;AAChB,MAAM,QAAQC"}
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- //#region src/components/frame/iframe.d.ts
2
+ //#region src/components/frame/iframe/iframe.d.ts
3
3
  interface Props {
4
4
  title?: string;
5
5
  /** Forwarded to the iframe's `sandbox` attribute for DOM/CSS isolation only — not a security boundary, since preview code executes in the host window's realm (see `compileModule` in `~/utils`). */
@@ -20,4 +20,4 @@ interface FrameProps extends Omit<Props, 'children'> {
20
20
  }
21
21
  //#endregion
22
22
  export { FrameProps as t };
23
- //# sourceMappingURL=index-DpDU1IAw.d.ts.map
23
+ //# sourceMappingURL=index-92L7F440.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as LiveMessagesInput } from "./messages-IBPs4TkZ.js";
1
+ import { n as LiveMessagesInput } from "./messages-BpN3QIhj.js";
2
2
  import React from "react";
3
3
  //#region src/components/context/context.d.ts
4
4
  interface Props {
@@ -8,4 +8,4 @@ interface Props {
8
8
  declare const ContextProvider: ({ children, messages }: Props) => React.JSX.Element;
9
9
  //#endregion
10
10
  export { Props as n, ContextProvider as t };
11
- //# sourceMappingURL=index-DrWtSKXu.d.ts.map
11
+ //# sourceMappingURL=index-BZpZwrxT.d.ts.map
@@ -0,0 +1,15 @@
1
+ //#region src/types/index.d.ts
2
+ interface Module {
3
+ exports: {
4
+ default?: React.ComponentType<Record<string, unknown>>;
5
+ };
6
+ error?: string;
7
+ }
8
+ interface Section {
9
+ id: string;
10
+ name: string;
11
+ code: string;
12
+ }
13
+ //#endregion
14
+ export { Section as n, Module as t };
15
+ //# sourceMappingURL=index-C8h8TcIl.d.ts.map
@@ -1,6 +1,4 @@
1
- import { ComponentProps } from "react";
2
- import CodeEditor from "@jbpark/ui-kit/CodeEditor";
3
- import { Extension } from "@uiw/react-codemirror";
1
+ import { Extension, ReactCodeMirrorProps } from "@uiw/react-codemirror";
4
2
  //#region src/components/editor/core.d.ts
5
3
  interface Props$1 {
6
4
  value: string;
@@ -13,8 +11,8 @@ interface Props$1 {
13
11
  onChange?: (value: string) => void;
14
12
  onSave?: (value: string) => void;
15
13
  onError?: (error: string | null) => void;
16
- onCreateEditor?: ComponentProps<typeof CodeEditor>['onCreateEditor'];
17
- onUpdate?: ComponentProps<typeof CodeEditor>['onUpdate'];
14
+ onCreateEditor?: ReactCodeMirrorProps['onCreateEditor'];
15
+ onUpdate?: ReactCodeMirrorProps['onUpdate'];
18
16
  }
19
17
  declare const Core: ({ value, theme, height, className, prettierOptions, fragment, raw, onChange, onSave, onError, ...props }: Props$1) => import("react").JSX.Element;
20
18
  //#endregion
@@ -39,4 +37,4 @@ type EditorComponent = typeof Editor$1 & {
39
37
  declare const Editor: EditorComponent;
40
38
  //#endregion
41
39
  export { Props$1 as a, Core as i, EditorRenderData as n, Props as r, Editor as t };
42
- //# sourceMappingURL=index-13BDSrQc.d.ts.map
40
+ //# sourceMappingURL=index-C93npmTU.d.ts.map
@@ -1,8 +1,6 @@
1
- import { t as FrameProps } from "./index-DpDU1IAw.js";
1
+ import { t as FrameProps } from "./index-92L7F440.js";
2
2
  import React from "react";
3
- import * as ui from "@jbpark/ui-kit";
4
- import * as utils from "@jbpark/ui-kit/utils";
5
- //#region src/components/preview/preview.d.ts
3
+ //#region src/components/preview/types.d.ts
6
4
  interface Props extends React.ComponentPropsWithRef<'div'> {
7
5
  code?: string;
8
6
  showError?: boolean;
@@ -13,13 +11,9 @@ interface Props extends React.ComponentPropsWithRef<'div'> {
13
11
  dynamicTailwind?: boolean;
14
12
  provider?: (children: React.ReactNode) => React.ReactNode;
15
13
  }
16
- declare const Preview: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props) => React.JSX.Element;
17
14
  //#endregion
18
- //#region src/components/preview/base-modules.d.ts
19
- declare const baseModules: {
20
- 'ui-kit': typeof ui;
21
- 'ui-kit/utils': typeof utils;
22
- };
15
+ //#region src/components/preview/preview.d.ts
16
+ declare const Preview: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props) => import("react").JSX.Element;
23
17
  //#endregion
24
- export { Preview as n, Props as r, baseModules as t };
25
- //# sourceMappingURL=index-DQkL37eL.d.ts.map
18
+ export { Props as n, Preview as t };
19
+ //# sourceMappingURL=index-CqsS207F.d.ts.map
@@ -1,7 +1,7 @@
1
- import { _ as BindingWidget, d as BindingOptions, f as BindingRegistry, g as BindingType, l as BindingKeyMap, m as BindingRenderMap, u as BindingOption, v as DataAttrNode } from "./validate-DB59Z_Nx.js";
2
- import { v as Section } from "./document-DqRSCtsx.js";
3
- import { B as UpdateFailure } from "./index-C_PfR4X9.js";
4
- import { t as FrameProps } from "./index-DpDU1IAw.js";
1
+ import { i as BindingKeyMap, l as BindingRenderMap, o as BindingOptions, p as DataAttrNode, s as BindingRegistry } from "./types-Czps1Txy.js";
2
+ import { n as Section } from "./index-C8h8TcIl.js";
3
+ import { t as FrameProps } from "./index-92L7F440.js";
4
+ import { c as PanelNodeChange, i as PanelBinding, l as PanelNodesChange, n as DndRenderField, r as FieldProps, t as DndEditError } from "./edit-options-C_r9aCz4.js";
5
5
  import { useMultiSelect } from "@jbpark/use-hooks";
6
6
  //#region src/components/dnd/canvas/section-fallback-context.d.ts
7
7
  interface DndSectionFallbackArgs {
@@ -11,94 +11,6 @@ interface DndSectionFallbackArgs {
11
11
  }
12
12
  type DndRenderSectionFallback = (args: DndSectionFallbackArgs) => React.ReactNode | undefined;
13
13
  //#endregion
14
- //#region src/components/dnd/panel-binding.d.ts
15
- interface PanelNodeChange {
16
- (params: {
17
- id: string;
18
- label: string;
19
- property: string;
20
- value: unknown;
21
- }): void;
22
- }
23
- interface PanelNodesChange {
24
- (changes: Parameters<PanelNodeChange>[0][]): void;
25
- }
26
- interface PanelBinding {
27
- id: string;
28
- label: string;
29
- property: string;
30
- type?: BindingType;
31
- widget?: BindingWidget;
32
- options?: BindingOption[];
33
- render?: BindingRenderMap;
34
- min?: number;
35
- max?: number;
36
- pattern?: string;
37
- required?: boolean;
38
- meta?: Record<string, unknown>;
39
- value: unknown;
40
- rawValue: string;
41
- canEditValue?: boolean;
42
- present?: boolean;
43
- element?: PanelBindingElement;
44
- onChange: (value: unknown) => void;
45
- }
46
- interface PanelBindingElement {
47
- tagName: string;
48
- text: string;
49
- }
50
- type PanelBindingData = Omit<PanelBinding, 'onChange'>;
51
- interface PanelBindingSource {
52
- id: string;
53
- tagName: string;
54
- bindings: PanelBindingData[];
55
- }
56
- declare const resolvePanelBindings: (node: DataAttrNode) => PanelBindingSource | null;
57
- declare const withPanelCommit: (bindings: PanelBindingData[], commit: PanelNodeChange | undefined) => PanelBinding[];
58
- //#endregion
59
- //#region src/components/dnd/panel/field.d.ts
60
- interface FieldProps {
61
- binding: PanelBinding;
62
- onNodeChange?: PanelNodeChange;
63
- }
64
- declare const Field: (props: FieldProps) => import("react").JSX.Element;
65
- //#endregion
66
- //#region src/components/dnd/edit-options.d.ts
67
- type DndEditError = {
68
- type: 'update';
69
- id: string;
70
- label: string;
71
- property: string;
72
- failure: UpdateFailure | undefined;
73
- title: string;
74
- description?: string;
75
- } | {
76
- type: 'parse';
77
- target: 'section' | 'items';
78
- error?: unknown;
79
- title: string;
80
- description?: string;
81
- } | {
82
- type: 'parse';
83
- target: 'document';
84
- reason: 'parse-error';
85
- error: unknown;
86
- title: string;
87
- description?: string;
88
- } | {
89
- type: 'parse';
90
- target: 'document';
91
- reason: 'container-not-found';
92
- containerId: string;
93
- title: string;
94
- description?: string;
95
- } | {
96
- type: 'items';
97
- title: string;
98
- description?: string;
99
- };
100
- type DndRenderField = (props: FieldProps, builtin: React.ReactElement) => React.ReactNode | undefined;
101
- //#endregion
102
14
  //#region src/components/dnd/inspector.d.ts
103
15
  interface DndNodePick {
104
16
  id: string;
@@ -194,7 +106,7 @@ interface DraggableItemProps {
194
106
  }
195
107
  declare const DraggableItem: ({ item, children }: DraggableItemProps) => import("react").ReactNode;
196
108
  //#endregion
197
- //#region src/components/dnd/panel/use-dnd-children.d.ts
109
+ //#region src/components/dnd/panel/children/use-dnd-children.d.ts
198
110
  interface DndChildrenOptions {
199
111
  onChange?: (value: string) => void;
200
112
  }
@@ -218,7 +130,10 @@ declare const useDndChildren: (items: DataAttrNode[], { onChange }?: DndChildren
218
130
  };
219
131
  type DndChildren = ReturnType<typeof useDndChildren>;
220
132
  //#endregion
221
- //#region src/components/dnd/panel/use-dnd-items.d.ts
133
+ //#region src/components/dnd/panel/field.d.ts
134
+ declare const Field: (props: FieldProps) => import("react").JSX.Element;
135
+ //#endregion
136
+ //#region src/components/dnd/panel/items/use-dnd-items.d.ts
222
137
  interface DndItemsNestedElement {
223
138
  id: string;
224
139
  tagName: string;
@@ -258,17 +173,21 @@ interface DndItems {
258
173
  expansion: DndItemsExpansion;
259
174
  actions: DndItemsActions;
260
175
  canEditStructure: boolean;
176
+ canAddItems: (count?: number) => boolean;
177
+ canRemoveItems: (count?: number) => boolean;
261
178
  parseError: boolean;
262
179
  }
263
180
  interface DndItemsOptions {
264
181
  render?: BindingRenderMap;
265
182
  onChange?: (value: string) => void;
266
183
  onNodeChange?: PanelNodeChange;
184
+ minItems?: number;
185
+ maxItems?: number;
267
186
  }
268
- declare const useDndItems: (value: string, { render, onChange, onNodeChange }?: DndItemsOptions) => DndItems;
187
+ declare const useDndItems: (value: string, { render, onChange, onNodeChange, minItems, maxItems }?: DndItemsOptions) => DndItems;
269
188
  //#endregion
270
- //#region src/components/dnd/panel/field-kind.d.ts
271
- type FieldKind = 'readonly' | 'items' | 'children' | 'richtext' | 'jsx' | 'html' | 'object' | 'boolean' | 'select' | 'color' | 'date' | 'url' | 'number' | 'text';
189
+ //#region src/components/dnd/panel/fields/field-kind.d.ts
190
+ type FieldKind = 'readonly' | 'items' | 'children' | 'richtext' | 'jsx' | 'html' | 'object' | 'boolean' | 'select' | 'color' | 'date' | 'time' | 'datetime' | 'url' | 'email' | 'tel' | 'number' | 'text';
272
191
  type FieldKindBinding = Pick<PanelBinding, 'property' | 'type' | 'value' | 'options' | 'canEditValue'>;
273
192
  declare const getFieldKind: (binding: FieldKindBinding) => FieldKind;
274
193
  declare const isStructuralFieldKind: (kind: FieldKind) => kind is "items" | "children";
@@ -283,43 +202,6 @@ type DndComponent = typeof Dnd$1 & {
283
202
  Layout: typeof Layout;
284
203
  };
285
204
  declare const Dnd: DndComponent;
286
- /** @deprecated Renamed to `useDndItems`. */
287
- declare const useItemsEditor: (value: string, { render, onChange, onNodeChange }?: DndItemsOptions) => DndItems;
288
- /** @deprecated Renamed to `useDndChildren`. */
289
- declare const useChildrenEditor: (items: DataAttrNode[], { onChange }?: DndChildrenOptions) => {
290
- items: DataAttrNode[];
291
- selection: {
292
- readonly selected: Set<number>;
293
- readonly isSelected: (index: number) => boolean;
294
- readonly toggle: (index: number, shiftKey?: boolean) => void;
295
- readonly clear: () => void;
296
- readonly replace: (indices: Set<number>) => void;
297
- };
298
- actions: {
299
- move: (from: number, to: number) => void;
300
- remove: (index: number) => void;
301
- add: () => void;
302
- duplicateSelected: () => void;
303
- moveSelected: (direction: "up" | "down") => void;
304
- removeSelected: () => void;
305
- };
306
- };
307
- /** @deprecated Renamed to `DndItems`. */
308
- type ItemsEditor = DndItems;
309
- /** @deprecated Renamed to `DndItemsActions`. */
310
- type ItemsEditorActions = DndItemsActions;
311
- /** @deprecated Renamed to `DndItemsItem`. */
312
- type ItemsEditorItem = DndItemsItem;
313
- /** @deprecated Renamed to `DndItemsNestedElement`. */
314
- type ItemsEditorNestedElement = DndItemsNestedElement;
315
- /** @deprecated Renamed to `DndItemsNestedGroup`. */
316
- type ItemsEditorNestedGroup = DndItemsNestedGroup;
317
- /** @deprecated Renamed to `DndItemsOptions`. */
318
- type ItemsEditorOptions = DndItemsOptions;
319
- /** @deprecated Renamed to `DndChildren`. */
320
- type ChildrenEditor = DndChildren;
321
- /** @deprecated Renamed to `DndChildrenOptions`. */
322
- type ChildrenEditorOptions = DndChildrenOptions;
323
205
  //#endregion
324
- export { PanelBindingSource as $, DndLayout as A, DndPalette as B, useDndItems as C, DraggableItem as D, useDndChildren as E, DndLayoutProps as F, useDndInspector as G, Props as H, DndRegionProps as I, Field as J, DndEditError as K, Layout as L, useDndPalette as M, useDndPanel as N, DraggableItemDragState as O, Canvas as P, PanelBindingElement as Q, Palette as R, DndItemsOptions as S, DndChildrenOptions as T, DndInspector as U, DndPanel as V, DndNodePick as W, PanelBinding as X, FieldProps as Y, PanelBindingData as Z, DndItemsActions as _, ItemsEditorActions as a, DndSectionFallbackArgs as at, DndItemsNestedElement as b, ItemsEditorNestedGroup as c, useItemsEditor as d, PanelNodeChange as et, FieldKind as f, DndItems as g, isStructuralFieldKind as h, ItemsEditor as i, DndRenderSectionFallback as it, useDndLayout as j, DraggableItemProps as k, ItemsEditorOptions as l, getFieldKind as m, ChildrenEditorOptions as n, resolvePanelBindings as nt, ItemsEditorItem as o, FieldKindBinding as p, DndRenderField as q, Dnd as r, withPanelCommit as rt, ItemsEditorNestedElement as s, ChildrenEditor as t, PanelNodesChange as tt, useChildrenEditor as u, DndItemsExpansion as v, DndChildren as w, DndItemsNestedGroup as x, DndItemsItem as y, Panel as z };
325
- //# sourceMappingURL=index-CiWB0zFb.d.ts.map
206
+ export { Panel as A, useDndPalette as C, DndRegionProps as D, DndLayoutProps as E, DndNodePick as F, useDndInspector as I, DndRenderSectionFallback as L, DndPanel as M, Props as N, Layout as O, DndInspector as P, DndSectionFallbackArgs as R, useDndLayout as S, Canvas as T, useDndChildren as _, isStructuralFieldKind as a, DraggableItemProps as b, DndItemsExpansion as c, DndItemsNestedGroup as d, DndItemsOptions as f, DndChildrenOptions as g, DndChildren as h, getFieldKind as i, DndPalette as j, Palette as k, DndItemsItem as l, Field as m, FieldKind as n, DndItems as o, useDndItems as p, FieldKindBinding as r, DndItemsActions as s, Dnd as t, DndItemsNestedElement as u, DraggableItem as v, useDndPanel as w, DndLayout as x, DraggableItemDragState as y };
207
+ //# sourceMappingURL=index-DQcdHg_V.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as LiveMessages } from "./messages-IBPs4TkZ.js";
1
+ import { t as LiveMessages } from "./messages-BpN3QIhj.js";
2
2
  import React$1 from "react";
3
3
  //#region src/components/error/boundary.d.ts
4
4
  interface Props$3 {
@@ -29,7 +29,7 @@ interface Props$2 extends React.ComponentPropsWithRef<'div'> {
29
29
  title?: string;
30
30
  onReset?: () => void;
31
31
  }
32
- declare const Error$2: ({ message, title, className, onReset }: Props$2) => import("react").JSX.Element | null;
32
+ declare const Error$2: ({ message, title, className, style, onReset }: Props$2) => import("react").JSX.Element | null;
33
33
  //#endregion
34
34
  //#region src/components/error/guard.d.ts
35
35
  interface Props$1 {
@@ -54,4 +54,4 @@ type ErrorComponent = typeof Error$2 & {
54
54
  declare const Error$1: ErrorComponent;
55
55
  //#endregion
56
56
  export { Props$1 as a, Guard as i, Props as n, Props$2 as o, Runtime as r, ErrorBoundary as s, Error$1 as t };
57
- //# sourceMappingURL=index-CRwEhJ7w.d.ts.map
57
+ //# sourceMappingURL=index-DfIvkht8.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,18 +1,19 @@
1
- import { d as BindingOptions, f as BindingRegistry, h as BindingSchema, l as BindingKeyMap } from "./validate-DB59Z_Nx.js";
2
- import { i as useLiveMessages, n as LiveMessagesInput, r as defaultMessages, t as LiveMessages } from "./messages-IBPs4TkZ.js";
3
- import { n as Props } from "./index-DrWtSKXu.js";
4
- import { v as Section } from "./document-DqRSCtsx.js";
5
- import { A as DndLayout, B as DndPalette, H as Props$1, K as DndEditError, L as Layout, P as Canvas, R as Palette, S as DndItemsOptions, U as DndInspector, V as DndPanel, W as DndNodePick, X as PanelBinding, Y as FieldProps, at as DndSectionFallbackArgs, et as PanelNodeChange, g as DndItems, i as ItemsEditor, it as DndRenderSectionFallback, k as DraggableItemProps, l as ItemsEditorOptions, o as ItemsEditorItem, q as DndRenderField, r as Dnd, tt as PanelNodesChange, y as DndItemsItem, z as Panel } from "./index-CiWB0zFb.js";
6
- import { t as FrameProps } from "./index-DpDU1IAw.js";
7
- import { a as Props$3, n as EditorRenderData, r as Props$2, t as Editor } from "./index-13BDSrQc.js";
8
- import { a as Props$6, n as Props$5, o as Props$4, s as ErrorBoundary, t as Error } from "./index-CRwEhJ7w.js";
9
- import { n as Preview, r as Props$7 } from "./index-DQkL37eL.js";
1
+ import { i as BindingKeyMap, o as BindingOptions, s as BindingRegistry, u as BindingSchema } from "./types-Czps1Txy.js";
2
+ import { i as useLiveMessages, n as LiveMessagesInput, r as defaultMessages, t as LiveMessages } from "./messages-BpN3QIhj.js";
3
+ import { n as Props } from "./index-BZpZwrxT.js";
4
+ import { n as Section } from "./index-C8h8TcIl.js";
5
+ import { A as Panel, F as DndNodePick, L as DndRenderSectionFallback, M as DndPanel, N as Props$1, O as Layout, P as DndInspector, R as DndSectionFallbackArgs, T as Canvas, b as DraggableItemProps, f as DndItemsOptions, j as DndPalette, k as Palette, l as DndItemsItem, o as DndItems, t as Dnd, x as DndLayout } from "./index-DQcdHg_V.js";
6
+ import { t as FrameProps } from "./index-92L7F440.js";
7
+ import { c as PanelNodeChange, i as PanelBinding, l as PanelNodesChange, n as DndRenderField, r as FieldProps, t as DndEditError } from "./edit-options-C_r9aCz4.js";
8
+ import { a as Props$3, n as EditorRenderData, r as Props$2, t as Editor } from "./index-C93npmTU.js";
9
+ import { a as Props$6, n as Props$5, o as Props$4, s as ErrorBoundary, t as Error } from "./index-DfIvkht8.js";
10
+ import { n as Props$7, t as Preview } from "./index-CqsS207F.js";
10
11
  //#region src/index.d.ts
11
12
  declare const App: {
12
13
  ({ children, messages }: Props): import("react").JSX.Element;
13
14
  Preview: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$7) => import("react").JSX.Element;
14
15
  Renderer: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$7) => import("react").JSX.Element;
15
- Error: (({ message, title, className, onReset }: Props$4) => import("react").JSX.Element | null) & {
16
+ Error: (({ message, title, className, style, onReset }: Props$4) => import("react").JSX.Element | null) & {
16
17
  Boundary: typeof ErrorBoundary;
17
18
  Runtime: ({ open, reset }: Props$5) => import("react").JSX.Element | null;
18
19
  Guard: ({ children, onError }: Props$6) => import("react").JSX.Element;
@@ -31,5 +32,5 @@ declare const App: {
31
32
  };
32
33
  declare const LiveRenderer: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$7) => import("react").JSX.Element;
33
34
  //#endregion
34
- export { type BindingKeyMap, type BindingOptions, type BindingRegistry, type BindingSchema, type DndEditError, type DndInspector, type DndItems, type DndItemsItem, type DndItemsOptions, type DndLayout, type DndNodePick, type DndPalette, type DndPanel, type DndRenderField, type DndRenderSectionFallback, type DndSectionFallbackArgs, type EditorRenderData, type FieldProps, type FrameProps, type ItemsEditor, type ItemsEditorItem, type ItemsEditorOptions, Dnd as LiveDnd, Editor as LiveEditor, Error as LiveError, type LiveMessages, type LiveMessagesInput, Preview as LivePreview, App as LiveProvider, App as default, LiveRenderer, type PanelBinding, type PanelNodeChange, type PanelNodesChange, type Section, defaultMessages, useLiveMessages };
35
+ export { type BindingKeyMap, type BindingOptions, type BindingRegistry, type BindingSchema, type DndEditError, type DndInspector, type DndItems, type DndItemsItem, type DndItemsOptions, type DndLayout, type DndNodePick, type DndPalette, type DndPanel, type DndRenderField, type DndRenderSectionFallback, type DndSectionFallbackArgs, type EditorRenderData, type FieldProps, type FrameProps, Dnd as LiveDnd, Editor as LiveEditor, Error as LiveError, type LiveMessages, type LiveMessagesInput, Preview as LivePreview, App as LiveProvider, App as default, LiveRenderer, type PanelBinding, type PanelNodeChange, type PanelNodesChange, type Section, defaultMessages, useLiveMessages };
35
36
  //# sourceMappingURL=index.d.ts.map