@jbpark/live-editor 4.4.0 → 4.6.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 (77) hide show
  1. package/README.ko.md +4 -1
  2. package/README.md +7 -3
  3. package/dist/{boundary-B17cepvm.js → boundary-BLB80tyw.js} +8 -5
  4. package/dist/boundary-BLB80tyw.js.map +1 -0
  5. package/dist/cache-B0-XcIxJ.js.map +1 -1
  6. package/dist/{compile-DDfk5P25.js → compile-Dxas-D05.js} +3 -3
  7. package/dist/compile-Dxas-D05.js.map +1 -0
  8. package/dist/{constants-h1JAgOeW.js → constants-DU17Tdwo.js} +3 -3
  9. package/dist/constants-DU17Tdwo.js.map +1 -0
  10. package/dist/{context-DB5kW3qe.js → context-B8MzP7_p.js} +11 -5
  11. package/dist/context-B8MzP7_p.js.map +1 -0
  12. package/dist/{core-CRsAGpei.js → core-Bgfek364.js} +2 -2
  13. package/dist/core-Bgfek364.js.map +1 -0
  14. package/dist/{detect-typescript-CCj9ALXc.js → detect-typescript-Dr_oLniM.js} +2 -2
  15. package/dist/detect-typescript-Dr_oLniM.js.map +1 -0
  16. package/dist/dnd/index.d.ts +1 -1
  17. package/dist/dnd/index.js +1 -1
  18. package/dist/{dnd-BE5ZizqX.js → dnd-UoJILA75.js} +973 -885
  19. package/dist/dnd-UoJILA75.js.map +1 -0
  20. package/dist/{document-BDn_f08_.js → document-CGbe6bSV.js} +7739 -7736
  21. package/dist/document-CGbe6bSV.js.map +1 -0
  22. package/dist/editor/index.js +2 -2
  23. package/dist/{editor-DQ8Q--qR.js → editor-CMElfHer.js} +2 -2
  24. package/dist/editor-CMElfHer.js.map +1 -0
  25. package/dist/editor-caches-ClMvdcQF.js.map +1 -1
  26. package/dist/error/index.d.ts +1 -1
  27. package/dist/error/index.js +2 -2
  28. package/dist/{error-DWhxQEom.js → error-CN_GCnXB.js} +13 -6
  29. package/dist/error-CN_GCnXB.js.map +1 -0
  30. package/dist/{index-Dgh1JTX3.d.ts → index-C69Lv-jR.d.ts} +72 -69
  31. package/dist/{index-C4SGQ3Ci.d.ts → index-CRwEhJ7w.d.ts} +4 -1
  32. package/dist/{index-f7ijuNTa.d.ts → index-DKYUxi-E.d.ts} +115 -155
  33. package/dist/index-DrWtSKXu.d.ts +11 -0
  34. package/dist/index.d.ts +18 -18
  35. package/dist/index.js +12 -8
  36. package/dist/index.js.map +1 -1
  37. package/dist/{ast-dYb78955.js → items-B6OXxcLG.js} +588 -718
  38. package/dist/items-B6OXxcLG.js.map +1 -0
  39. package/dist/messages-CSrMI4Rm.js +133 -0
  40. package/dist/messages-CSrMI4Rm.js.map +1 -0
  41. package/dist/messages-IBPs4TkZ.d.ts +130 -0
  42. package/dist/preview/index.js +2 -2
  43. package/dist/{preview-BnaCEFsF.js → preview-CtyG5UbH.js} +6 -4
  44. package/dist/preview-CtyG5UbH.js.map +1 -0
  45. package/dist/provider/index.d.ts +3 -8
  46. package/dist/provider/index.js +3 -2
  47. package/dist/{sections-CBVMO8Jl.js → sections-BYWOBISr.js} +9 -4
  48. package/dist/sections-BYWOBISr.js.map +1 -0
  49. package/dist/states-Ci1AvoQ9.js.map +1 -1
  50. package/dist/style.css +505 -21
  51. package/dist/{use-dynamic-tailwind-Bcipc1hL.js → use-dynamic-tailwind-BP1toJkW.js} +66 -40
  52. package/dist/use-dynamic-tailwind-BP1toJkW.js.map +1 -0
  53. package/dist/utils/ast/index.d.ts +3 -2
  54. package/dist/utils/ast/index.js +150 -3
  55. package/dist/utils/ast/index.js.map +1 -0
  56. package/dist/utils/index.d.ts +30 -13
  57. package/dist/utils/index.js +26 -6
  58. package/dist/utils/index.js.map +1 -0
  59. package/dist/utils/tailwind/index.js.map +1 -1
  60. package/dist/validate-DB59Z_Nx.d.ts +100 -0
  61. package/dist/validate-iLo8IONY.js +64 -0
  62. package/dist/validate-iLo8IONY.js.map +1 -0
  63. package/package.json +3 -3
  64. package/dist/ast-dYb78955.js.map +0 -1
  65. package/dist/boundary-B17cepvm.js.map +0 -1
  66. package/dist/compile-DDfk5P25.js.map +0 -1
  67. package/dist/constants-h1JAgOeW.js.map +0 -1
  68. package/dist/context-DB5kW3qe.js.map +0 -1
  69. package/dist/core-CRsAGpei.js.map +0 -1
  70. package/dist/detect-typescript-CCj9ALXc.js.map +0 -1
  71. package/dist/dnd-BE5ZizqX.js.map +0 -1
  72. package/dist/document-BDn_f08_.js.map +0 -1
  73. package/dist/editor-DQ8Q--qR.js.map +0 -1
  74. package/dist/error-DWhxQEom.js.map +0 -1
  75. package/dist/preview-BnaCEFsF.js.map +0 -1
  76. package/dist/sections-CBVMO8Jl.js.map +0 -1
  77. package/dist/use-dynamic-tailwind-Bcipc1hL.js.map +0 -1
@@ -1,95 +1,47 @@
1
+ import { b as ExtractedNodeValue$1, c as BindingItem, d as BindingOptions, f as BindingRegistry, g as BindingType, l as BindingKeyMap, m as BindingRenderMap, v as DataAttrNode, x as NodeValueType$1, y as EditableNodeValueType$1 } from "./validate-DB59Z_Nx.js";
1
2
  import { C as ObjectExpression, S as Node, b as Expression, x as File, y as ArrayExpression } from "./document-Ct4jW78J.js";
2
- //#region src/utils/ast/types.d.ts
3
- interface Attribute {
4
- name: string;
5
- value: string | null;
6
- isStringLiteral?: boolean;
7
- }
8
- interface DataAttrNode {
9
- id?: string;
10
- tagName: string;
11
- attributes: Attribute[];
12
- dataAttributes: Attribute[];
13
- textContent: string;
14
- rawChildren?: string;
15
- source?: string;
16
- loc?: {
17
- start: {
18
- line: number;
19
- column: number;
20
- };
21
- end: {
22
- line: number;
23
- column: number;
24
- };
25
- };
26
- children?: DataAttrNode[];
27
- isFragment?: boolean;
28
- bindings?: BindingItem[];
29
- }
30
- interface BindingOption {
31
- label: string;
32
- value: string;
33
- }
34
- declare const BINDING_TYPES: readonly ["array", "object", "string", "number", "boolean", "color", "jsx", "richtext", "date", "url"];
35
- type BindingType = (typeof BINDING_TYPES)[number];
36
- interface BindingWidget {
37
- type: string;
38
- step?: number;
39
- unit?: string;
40
- [key: string]: unknown;
41
- }
42
- interface BindingFieldSpec {
43
- type?: BindingType;
44
- widget?: BindingWidget;
45
- options?: BindingOption[];
46
- render?: BindingRenderMap;
47
- min?: number;
48
- max?: number;
49
- pattern?: string;
50
- required?: boolean;
51
- meta?: Record<string, unknown>;
52
- }
53
- interface BindingRenderLeaf extends BindingFieldSpec {
54
- label?: string;
55
- property?: string;
56
- }
57
- interface BindingRenderMap {
58
- [key: string]: BindingRenderLeaf | BindingRenderMap;
59
- }
60
- interface BindingItem extends BindingFieldSpec {
61
- label: string;
62
- property: string;
3
+ //#region node_modules/.pnpm/@babel+parser@7.29.9/node_modules/@babel/parser/typings/babel-parser.d.ts
4
+ declare class Position {
5
+ line: number;
6
+ column: number;
7
+ index: number;
8
+ constructor(line: number, col: number, index: number);
63
9
  }
64
- type BindingComponentName = `${string}.${string}` | Capitalize<string>;
65
- type BindingRegistry = Partial<Record<BindingComponentName, BindingItem[]>>;
66
- type BindingKeyMap = Record<string, BindingItem[]>;
67
- interface BindingOptions {
68
- bindings?: BindingRegistry;
69
- bindingKeys?: BindingKeyMap;
10
+ type SyntaxPlugin = "flow" | "typescript" | "jsx" | "functionBind" | "pipelineOperator" | "placeholders";
11
+ type ParseErrorCode = "BABEL_PARSER_SYNTAX_ERROR" | "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";
12
+ interface ParseErrorSpecification<ErrorDetails> {
13
+ code: ParseErrorCode;
14
+ reasonCode: string;
15
+ syntaxPlugin?: SyntaxPlugin;
16
+ missingPlugin?: string | string[];
17
+ loc: Position;
18
+ details: ErrorDetails;
19
+ pos: number;
70
20
  }
71
- type NodeValueType = 'boolean' | 'number' | 'string' | 'null' | 'array' | 'object' | 'unknown';
72
- type EditableNodeValueType = 'boolean' | 'number' | 'string' | 'null';
73
- interface ExtractedNodeValue {
74
- type: NodeValueType;
75
- value: string | number | boolean | null;
21
+ type ParseError$1<ErrorDetails> = SyntaxError & ParseErrorSpecification<ErrorDetails>;
22
+ type ParseError = ParseError$1<object>;
23
+ type ParseResult<Result extends File | Expression = File> = Result & {
24
+ comments: File["comments"];
25
+ errors: null | ParseError[];
26
+ tokens?: File["tokens"];
27
+ };
28
+ //#endregion
29
+ //#region src/utils/ast/extract.d.ts
30
+ declare function extract(raw: string, options?: BindingOptions): DataAttrNode[];
31
+ declare function clearExtractCache$1(): void;
32
+ //#endregion
33
+ //#region src/utils/ast/items.d.ts
34
+ type ItemKind$1 = 'object' | 'primitive';
35
+ interface ArrayItem$1 {
36
+ index: number;
37
+ kind: ItemKind$1;
38
+ node: Expression;
76
39
  }
77
40
  //#endregion
78
41
  //#region src/utils/ast/binding.d.ts
79
- declare const isComponentTagName: (tagName: string) => boolean;
80
- declare const getRegistryBindings: (registry: BindingRegistry | undefined, tagName: string) => BindingItem[] | undefined;
81
- declare const getKeyBindings: (bindingKeys: BindingKeyMap | undefined, key: string) => BindingItem[] | undefined;
82
- declare const resolveBindings: (own: BindingItem[] | undefined, key: string | null | undefined, tagName: string, options?: BindingOptions) => BindingItem[];
83
- declare const parseBinding: (bindingValue: string | null) => BindingItem[];
84
- declare const parseBindingExpression: (expression: ArrayExpression) => BindingItem[];
85
- declare const getCurrentValue: (node: DataAttrNode, property: string) => string;
86
- declare const getStructuredValue: (node: DataAttrNode, property: string, type?: BindingType) => unknown;
87
- declare const readNodeBindings: (node: DataAttrNode) => BindingItem[];
88
42
  declare const findEditableChildren: (node: DataAttrNode) => DataAttrNode[];
89
43
  //#endregion
90
- //#region src/utils/ast/value.d.ts
91
- declare const canLosslesslyEvaluateSource: (source: string) => boolean;
92
- declare const parseValue: (value: unknown) => unknown;
44
+ //#region src/utils/ast/editable-value.d.ts
93
45
  type EditablePathSegment = string | number;
94
46
  type EditablePrimitive = string | number | boolean;
95
47
  interface EditableValueEntry {
@@ -98,39 +50,9 @@ interface EditableValueEntry {
98
50
  }
99
51
  declare const flattenEditableValue: (value: string) => EditableValueEntry[] | null;
100
52
  declare const setEditableValue: (value: string, path: EditablePathSegment[], next: EditablePrimitive) => string;
101
- declare const extractNodeValue: (node: Node) => ExtractedNodeValue;
102
- declare const createNodeFromValue: (type: NodeValueType, value: unknown) => Expression | null;
103
- declare const parseArrayExpression: (value: string) => ArrayExpression | null;
104
- declare const extractObjectProperties: (element: ObjectExpression) => Record<string, ExtractedNodeValue & {
105
- astNode: Node;
106
- }>;
107
- declare const arrayExpressionToCode: (elements: ObjectExpression[]) => string;
108
- //#endregion
109
- //#region src/utils/ast/helpers.d.ts
110
- declare const generateCode: (node: Node) => string;
111
53
  //#endregion
112
- //#region src/utils/ast/items.d.ts
113
- type ItemKind = 'object' | 'primitive';
114
- interface ArrayItem {
115
- index: number;
116
- kind: ItemKind;
117
- node: Expression;
118
- }
119
- declare const parseItems: (code: string) => ArrayItem[] | null;
120
- declare const updateArrayItemProperty: (code: string, index: number, key: string, value: unknown, render?: BindingRenderMap) => string | null;
121
- declare const updateArrayItemValue: (code: string, index: number, value: unknown) => string | null;
122
- declare const moveArrayItem: (code: string, from: number, to: number) => string | null;
123
- declare const moveArrayItems: (code: string, indices: Set<number>, direction: "up" | "down") => {
124
- code: string;
125
- indices: Set<number>;
126
- } | null;
127
- declare const removeArrayItems: (code: string, indices: Set<number>, kind?: ItemKind) => string | null;
128
- declare const duplicateArrayItems: (code: string, indices: Set<number>, generateId?: () => string) => string | null;
129
- declare const appendArrayItem: (code: string, kind: ItemKind, generateId?: () => string) => string | null;
130
- //#endregion
131
- //#region src/utils/ast/extract.d.ts
132
- declare function extract(raw: string, options?: BindingOptions): DataAttrNode[];
133
- declare function clearExtractCache(): void;
54
+ //#region src/utils/ast/value.d.ts
55
+ declare const parseValue: (value: unknown) => unknown;
134
56
  //#endregion
135
57
  //#region src/utils/ast/update.d.ts
136
58
  type UpdateFailure = {
@@ -162,6 +84,10 @@ type UpdateFailure = {
162
84
  reason: 'attribute-not-found';
163
85
  dataId: string;
164
86
  property: string;
87
+ } | {
88
+ reason: 'self-closing';
89
+ dataId: string;
90
+ property: string;
165
91
  } | {
166
92
  reason: 'unsupported-syntax';
167
93
  dataId: string;
@@ -222,46 +148,80 @@ interface ChildrenEdit {
222
148
  }
223
149
  declare const getChildrenSignatures: (nodes: DataAttrNode[]) => string[];
224
150
  //#endregion
225
- //#region src/utils/ast/array-source.d.ts
151
+ //#region src/utils/ast/index.d.ts
152
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
153
+ declare const appendArrayItem: (code: string, kind: ItemKind$1, generateId?: () => string) => string | null;
154
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
155
+ declare const duplicateArrayItems: (code: string, indices: Set<number>, generateId?: () => string) => string | null;
156
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
157
+ declare const moveArrayItem: (code: string, from: number, to: number) => string | null;
158
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
159
+ declare const moveArrayItems: (code: string, indices: Set<number>, direction: "up" | "down") => {
160
+ code: string;
161
+ indices: Set<number>;
162
+ } | null;
163
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
164
+ declare const parseItems: (code: string) => ArrayItem$1[] | null;
165
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
166
+ declare const removeArrayItems: (code: string, indices: Set<number>, kind?: ItemKind$1) => string | null;
167
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
168
+ declare const updateArrayItemProperty: (code: string, index: number, key: string, value: unknown, render?: BindingRenderMap) => string | null;
169
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
170
+ declare const updateArrayItemValue: (code: string, index: number, value: unknown) => string | null;
171
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
172
+ declare const parseArrayExpression: (value: string) => ArrayExpression | null;
173
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
174
+ declare const arrayExpressionToCode: (elements: ObjectExpression[]) => string;
175
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
226
176
  declare const canStructurallyEditArray: (source: string) => boolean;
227
- //#endregion
228
- //#region node_modules/.pnpm/@babel+parser@7.29.8/node_modules/@babel/parser/typings/babel-parser.d.ts
229
- declare class Position {
230
- line: number;
231
- column: number;
232
- index: number;
233
- constructor(line: number, col: number, index: number);
234
- }
235
- type SyntaxPlugin = "flow" | "typescript" | "jsx" | "functionBind" | "pipelineOperator" | "placeholders";
236
- type ParseErrorCode = "BABEL_PARSER_SYNTAX_ERROR" | "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";
237
- interface ParseErrorSpecification<ErrorDetails> {
238
- code: ParseErrorCode;
239
- reasonCode: string;
240
- syntaxPlugin?: SyntaxPlugin;
241
- missingPlugin?: string | string[];
242
- loc: Position;
243
- details: ErrorDetails;
244
- pos: number;
245
- }
246
- type ParseError$1<ErrorDetails> = SyntaxError & ParseErrorSpecification<ErrorDetails>;
247
- type ParseError = ParseError$1<object>;
248
- type ParseResult<Result extends File | Expression = File> = Result & {
249
- comments: File["comments"];
250
- errors: null | ParseError[];
251
- tokens?: File["tokens"];
252
- };
253
- //#endregion
254
- //#region src/utils/ast/tree.d.ts
255
- declare const replaceIds: (code: string, generateId?: () => string) => string;
177
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
178
+ type ArrayItem = ArrayItem$1;
179
+ /** @deprecated Internal. Use `useDndItems` from `./dnd`. Removed in the next major. */
180
+ type ItemKind = ItemKind$1;
181
+ /** @deprecated Internal. Read values through `extract` or `PanelBinding.value`. Removed in the next major. */
182
+ declare const extractNodeValue: (node: Node) => ExtractedNodeValue$1;
183
+ /** @deprecated Internal. Read values through `extract` or `PanelBinding.value`. Removed in the next major. */
184
+ declare const extractObjectProperties: (element: ObjectExpression) => Record<string, ExtractedNodeValue$1 & {
185
+ astNode: Node;
186
+ }>;
187
+ /** @deprecated Internal. Write values through `update` or `PanelBinding.onChange`. Removed in the next major. */
188
+ declare const createNodeFromValue: (type: NodeValueType$1, value: unknown) => Expression | null;
189
+ /** @deprecated Internal. Check `PanelBinding.canEditValue` instead. Removed in the next major. */
190
+ declare const canLosslesslyEvaluateSource: (source: string) => boolean;
191
+ /** @deprecated Internal. Read values through `extract` or `PanelBinding.value`. Removed in the next major. */
192
+ declare const getCurrentValue: (node: DataAttrNode, property: string) => string;
193
+ /** @deprecated Internal. Read values through `extract` or `PanelBinding.value`. Removed in the next major. */
194
+ declare const getStructuredValue: (node: DataAttrNode, property: string, type?: BindingType) => unknown;
195
+ /** @deprecated Internal. Removed in the next major. */
196
+ type ExtractedNodeValue = ExtractedNodeValue$1;
197
+ /** @deprecated Internal. Removed in the next major. */
198
+ type NodeValueType = NodeValueType$1;
199
+ /** @deprecated Internal. Removed in the next major. */
200
+ type EditableNodeValueType = EditableNodeValueType$1;
201
+ /** @deprecated Internal. Read bindings through `extract` or `useDndPanel().bindings`. Removed in the next major. */
202
+ declare const parseBinding: (bindingValue: string | null) => BindingItem[];
203
+ /** @deprecated Internal. Read bindings through `extract` or `useDndPanel().bindings`. Removed in the next major. */
204
+ declare const parseBindingExpression: (expression: ArrayExpression) => BindingItem[];
205
+ /** @deprecated Internal. Read bindings through `extract` or `useDndPanel().bindings`. Removed in the next major. */
206
+ declare const readNodeBindings: (node: DataAttrNode) => BindingItem[];
207
+ /** @deprecated Internal. Read bindings through `extract` or `useDndPanel().bindings`. Removed in the next major. */
208
+ declare const resolveBindings: (own: BindingItem[] | undefined, key: string | null | undefined, tagName: string, options?: BindingOptions) => BindingItem[];
209
+ /** @deprecated Internal. Read bindings through `extract` or `useDndPanel().bindings`. Removed in the next major. */
210
+ declare const getKeyBindings: (bindingKeys: BindingKeyMap | undefined, key: string) => BindingItem[] | undefined;
211
+ /** @deprecated Internal. Read bindings through `extract` or `useDndPanel().bindings`. Removed in the next major. */
212
+ declare const getRegistryBindings: (registry: BindingRegistry | undefined, tagName: string) => BindingItem[] | undefined;
213
+ /** @deprecated Internal. Removed in the next major. */
214
+ declare const isComponentTagName: (tagName: string) => boolean;
215
+ /** @deprecated Internal. Removed in the next major. */
256
216
  declare const fillIds: (code: string, generateId?: () => string) => string;
217
+ /** @deprecated Internal. Removed in the next major. */
218
+ declare const replaceIds: (code: string, generateId?: () => string) => string;
219
+ /** @deprecated Internal. Removed in the next major. */
257
220
  declare const clone: (element: Node, generateId?: () => string) => ParseResult<Expression>;
221
+ /** @deprecated Internal. Removed in the next major. */
222
+ declare const generateCode: (node: Node) => string;
223
+ /** @deprecated Internal. Use `clearEditorCaches` from `./utils`. Removed in the next major. */
224
+ declare const clearExtractCache: typeof clearExtractCache$1;
258
225
  //#endregion
259
- //#region src/utils/ast/validate.d.ts
260
- interface ValidationResult {
261
- valid: boolean;
262
- message?: string;
263
- }
264
- declare const validateBindingValue: (binding: BindingItem, value: unknown) => ValidationResult;
265
- //#endregion
266
- export { BindingFieldSpec as $, EditablePathSegment as A, parseValue as B, moveArrayItem as C, updateArrayItemProperty as D, removeArrayItems as E, createNodeFromValue as F, getRegistryBindings as G, findEditableChildren as H, extractNodeValue as I, parseBinding as J, getStructuredValue as K, extractObjectProperties as L, EditableValueEntry as M, arrayExpressionToCode as N, updateArrayItemValue as O, canLosslesslyEvaluateSource as P, BindingComponentName as Q, flattenEditableValue as R, duplicateArrayItems as S, parseItems as T, getCurrentValue as U, setEditableValue as V, getKeyBindings as W, readNodeBindings as X, parseBindingExpression as Y, resolveBindings as Z, clearExtractCache as _, replaceIds as a, BindingRenderLeaf as at, ItemKind as b, ChildrenEdit as c, BindingWidget as ct, UpdateEntry as d, ExtractedNodeValue as dt, BindingItem as et, UpdateFailure as f, NodeValueType as ft, updateAll as g, update as h, fillIds as i, BindingRegistry as it, EditablePrimitive as j, generateCode as k, getChildrenSignatures as l, DataAttrNode as lt, bulkUpdate as m, validateBindingValue as n, BindingOption as nt, canStructurallyEditArray as o, BindingRenderMap as ot, UpdateResult as p, isComponentTagName as q, clone as r, BindingOptions as rt, ChildrenAction as s, BindingType as st, ValidationResult as t, BindingKeyMap as tt, UpdateAllResult as u, EditableNodeValueType as ut, extract as v, moveArrayItems as w, appendArrayItem as x, ArrayItem as y, parseArrayExpression as z };
267
- //# sourceMappingURL=index-f7ijuNTa.d.ts.map
226
+ export { removeArrayItems as A, UpdateFailure as B, moveArrayItem as C, parseBindingExpression as D, parseBinding as E, ChildrenAction as F, parseValue as G, bulkUpdate as H, ChildrenEdit as I, EditableValueEntry as J, EditablePathSegment as K, getChildrenSignatures as L, resolveBindings as M, updateArrayItemProperty as N, parseItems as O, updateArrayItemValue as P, extract as Q, UpdateAllResult as R, isComponentTagName as S, parseArrayExpression as T, update as U, UpdateResult as V, updateAll as W, setEditableValue as X, flattenEditableValue as Y, findEditableChildren as Z, generateCode as _, NodeValueType as a, getRegistryBindings as b, canLosslesslyEvaluateSource as c, clone as d, createNodeFromValue as f, fillIds as g, extractObjectProperties as h, ItemKind as i, replaceIds as j, readNodeBindings as k, canStructurallyEditArray as l, extractNodeValue as m, EditableNodeValueType as n, appendArrayItem as o, duplicateArrayItems as p, EditablePrimitive as q, ExtractedNodeValue as r, arrayExpressionToCode as s, ArrayItem as t, clearExtractCache as u, getCurrentValue as v, moveArrayItems as w, getStructuredValue as x, getKeyBindings as y, UpdateEntry as z };
227
+ //# sourceMappingURL=index-DKYUxi-E.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { n as LiveMessagesInput } from "./messages-IBPs4TkZ.js";
2
+ import React from "react";
3
+ //#region src/components/context/context.d.ts
4
+ interface Props {
5
+ children?: React.ReactNode;
6
+ messages?: LiveMessagesInput;
7
+ }
8
+ declare const ContextProvider: ({ children, messages }: Props) => React.JSX.Element;
9
+ //#endregion
10
+ export { Props as n, ContextProvider as t };
11
+ //# sourceMappingURL=index-DrWtSKXu.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,26 +1,26 @@
1
- import { it as BindingRegistry, rt as BindingOptions, tt as BindingKeyMap } from "./index-f7ijuNTa.js";
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";
2
4
  import { v as Section } from "./document-Ct4jW78J.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-C69Lv-jR.js";
3
6
  import { t as FrameProps } from "./index-DpDU1IAw.js";
4
- import { $ as DndInspector, B as DndPalette, D as DndLayout, F as Palette, G as PanelBinding, H as Props, I as Panel, P as Layout, S as DndItemsOptions, U as DndRenderSectionFallback, V as DndPanel, W as DndSectionFallbackArgs, X as PanelNodesChange, Y as PanelNodeChange, at as FieldProps, et as DndNodePick, g as DndItems, i as ItemsEditor, j as Canvas, l as ItemsEditorOptions, nt as DndEditError, o as ItemsEditorItem, r as Dnd, rt as DndRenderField, y as DndItemsItem, z as DraggableItemProps } from "./index-Dgh1JTX3.js";
5
- import { a as Props$2, n as EditorRenderData, r as Props$1, t as Editor } from "./index-13BDSrQc.js";
6
- import { a as Props$5, n as Props$4, o as Props$3, s as ErrorBoundary, t as Error } from "./index-C4SGQ3Ci.js";
7
- import { n as Preview, r as Props$6 } from "./index-DQkL37eL.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";
8
10
  //#region src/index.d.ts
9
11
  declare const App: {
10
- ({ children }: {
11
- children?: React.ReactNode;
12
- }): import("react").JSX.Element;
13
- Preview: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$6) => import("react").JSX.Element;
14
- Renderer: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$6) => import("react").JSX.Element;
15
- Error: (({ message, title, className, onReset }: Props$3) => import("react").JSX.Element | null) & {
12
+ ({ children, messages }: Props): import("react").JSX.Element;
13
+ Preview: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$7) => import("react").JSX.Element;
14
+ 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
16
  Boundary: typeof ErrorBoundary;
17
- Runtime: ({ open, reset }: Props$4) => import("react").JSX.Element | null;
18
- Guard: ({ children, onError }: Props$5) => import("react").JSX.Element;
17
+ Runtime: ({ open, reset }: Props$5) => import("react").JSX.Element | null;
18
+ Guard: ({ children, onError }: Props$6) => import("react").JSX.Element;
19
19
  };
20
- Editor: (({ defaultValue, value: _value, debounce, onChange: _onChange, renderEditor, fragment, prettierOptions, ...props }: Props$1) => import("react").JSX.Element) & {
21
- Core: ({ value, theme, height, className, prettierOptions, fragment, raw, onChange, onSave, onError, ...props }: Props$2) => import("react").JSX.Element;
20
+ Editor: (({ defaultValue, value: _value, debounce, onChange: _onChange, renderEditor, fragment, prettierOptions, ...props }: Props$2) => import("react").JSX.Element) & {
21
+ Core: ({ value, theme, height, className, prettierOptions, fragment, raw, onChange, onSave, onError, ...props }: Props$3) => import("react").JSX.Element;
22
22
  };
23
- Dnd: (({ value: _value, props, modules: _modules, onChange: _onChange, className, items, frame, dynamicTailwind, provider, renderField, onEditError, renderSectionFallback, shouldForceSectionFallback, onBeforeDelete, sectionNameFallback, containerId, bindings: bindingRegistry, bindingKeys, onNodePick, children, ...restProps }: Props) => import("react").JSX.Element) & {
23
+ Dnd: (({ value: _value, props, modules: _modules, onChange: _onChange, className, items, frame, dynamicTailwind, provider, renderField, onEditError, renderSectionFallback, shouldForceSectionFallback, onBeforeDelete, sectionNameFallback, containerId, bindings: bindingRegistry, bindingKeys, onNodePick, children, ...restProps }: Props$1) => import("react").JSX.Element) & {
24
24
  DraggableItem: ({ item, children }: DraggableItemProps) => import("react").ReactNode;
25
25
  Field: (props: FieldProps) => import("react").JSX.Element;
26
26
  Palette: typeof Palette;
@@ -29,7 +29,7 @@ declare const App: {
29
29
  Layout: typeof Layout;
30
30
  };
31
31
  };
32
- declare const LiveRenderer: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$6) => import("react").JSX.Element;
32
+ declare const LiveRenderer: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$7) => import("react").JSX.Element;
33
33
  //#endregion
34
- export { type BindingKeyMap, type BindingOptions, type BindingRegistry, 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, Preview as LivePreview, App as LiveProvider, App as default, LiveRenderer, type PanelBinding, type PanelNodeChange, type PanelNodesChange, type Section };
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
35
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,12 +1,16 @@
1
- import { t as ContextProvider } from "./context-DB5kW3qe.js";
2
- import { t as Dnd } from "./dnd-BE5ZizqX.js";
3
- import { t as Editor } from "./editor-DQ8Q--qR.js";
4
- import { t as Error } from "./error-DWhxQEom.js";
5
- import { t as Preview } from "./preview-BnaCEFsF.js";
1
+ import { i as useLiveMessages, n as defaultMessages } from "./messages-CSrMI4Rm.js";
2
+ import { t as ContextProvider } from "./context-B8MzP7_p.js";
3
+ import { t as Dnd } from "./dnd-UoJILA75.js";
4
+ import { t as Editor } from "./editor-CMElfHer.js";
5
+ import { t as Error } from "./error-CN_GCnXB.js";
6
+ import { t as Preview } from "./preview-CtyG5UbH.js";
6
7
  import { jsx } from "react/jsx-runtime";
7
8
  //#region src/index.tsx
8
- const App = ({ children }) => {
9
- return /* @__PURE__ */ jsx(ContextProvider, { children });
9
+ const App = ({ children, messages }) => {
10
+ return /* @__PURE__ */ jsx(ContextProvider, {
11
+ messages,
12
+ children
13
+ });
10
14
  };
11
15
  const LiveRenderer = Preview;
12
16
  App.Preview = Preview;
@@ -15,6 +19,6 @@ App.Error = Error;
15
19
  App.Editor = Editor;
16
20
  App.Dnd = Dnd;
17
21
  //#endregion
18
- export { Dnd as LiveDnd, Editor as LiveEditor, Error as LiveError, Preview as LivePreview, App as LiveProvider, App as default, LiveRenderer };
22
+ export { Dnd as LiveDnd, Editor as LiveEditor, Error as LiveError, Preview as LivePreview, App as LiveProvider, App as default, LiveRenderer, defaultMessages, useLiveMessages };
19
23
 
20
24
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Context","LivePreview","LiveError","LiveEditor","LiveDnd"],"sources":["../src/index.tsx"],"sourcesContent":["import './index.css';\n\nimport Context from './components/context';\nimport LiveDnd, {\n type DndEditError,\n type DndInspector,\n type DndItems,\n type DndItemsItem,\n type DndItemsOptions,\n type DndLayout,\n type DndNodePick,\n type DndPalette,\n type DndPanel,\n type DndRenderField,\n type DndRenderSectionFallback,\n type DndSectionFallbackArgs,\n type FieldProps,\n type ItemsEditor,\n type ItemsEditorItem,\n type ItemsEditorOptions,\n type PanelBinding,\n type PanelNodeChange,\n type PanelNodesChange,\n} from './components/dnd';\nimport LiveEditor, { type EditorRenderData } from './components/editor';\nimport LiveError from './components/error';\nimport { type FrameProps } from './components/frame';\nimport LivePreview from './components/preview';\nimport type { Section } from './types';\nimport type {\n BindingKeyMap,\n BindingOptions,\n BindingRegistry,\n} from './utils/ast';\n\nconst App = ({ children }: { children?: React.ReactNode }) => {\n return <Context>{children}</Context>;\n};\n\nconst LiveRenderer = LivePreview;\n\nexport {\n LivePreview,\n LiveError,\n LiveEditor,\n LiveDnd,\n LiveRenderer,\n App as LiveProvider,\n //\n};\n\nexport type {\n DndEditError,\n DndRenderField,\n DndRenderSectionFallback,\n DndSectionFallbackArgs,\n DndPalette,\n DndPanel,\n DndLayout,\n DndInspector,\n DndNodePick,\n PanelBinding,\n PanelNodeChange,\n PanelNodesChange,\n FieldProps,\n DndItems,\n DndItemsItem,\n DndItemsOptions,\n // Deprecated aliases of the three above, kept until the next major.\n ItemsEditor,\n ItemsEditorItem,\n ItemsEditorOptions,\n EditorRenderData,\n FrameProps,\n Section,\n BindingRegistry,\n BindingKeyMap,\n BindingOptions,\n};\n\nApp.Preview = LivePreview;\nApp.Renderer = LiveRenderer;\nApp.Error = LiveError;\nApp.Editor = LiveEditor;\nApp.Dnd = LiveDnd;\n\nexport default App;\n"],"mappings":";;;;;;;AAmCA,MAAM,OAAO,EAAE,eAA+C;CAC5D,OAAO,oBAACA,iBAAD,EAAU,SAAkB,CAAA;AACrC;AAEA,MAAM,eAAeC;AAyCrB,IAAI,UAAUA;AACd,IAAI,WAAW;AACf,IAAI,QAAQC;AACZ,IAAI,SAASC;AACb,IAAI,MAAMC"}
1
+ {"version":3,"file":"index.js","names":["Context","LivePreview","LiveError","LiveEditor","LiveDnd"],"sources":["../src/index.tsx"],"sourcesContent":["import './index.css';\n\nimport Context, {\n type Props as ContextProps,\n type LiveMessages,\n type LiveMessagesInput,\n} from './components/context';\nimport LiveDnd, {\n type DndEditError,\n type DndInspector,\n type DndItems,\n type DndItemsItem,\n type DndItemsOptions,\n type DndLayout,\n type DndNodePick,\n type DndPalette,\n type DndPanel,\n type DndRenderField,\n type DndRenderSectionFallback,\n type DndSectionFallbackArgs,\n type FieldProps,\n type ItemsEditor,\n type ItemsEditorItem,\n type ItemsEditorOptions,\n type PanelBinding,\n type PanelNodeChange,\n type PanelNodesChange,\n} from './components/dnd';\nimport LiveEditor, { type EditorRenderData } from './components/editor';\nimport LiveError from './components/error';\nimport { type FrameProps } from './components/frame';\nimport LivePreview from './components/preview';\nimport type { Section } from './types';\nimport type {\n BindingKeyMap,\n BindingOptions,\n BindingRegistry,\n BindingSchema,\n} from './utils/ast/types';\n\nconst App = ({ children, messages }: ContextProps) => {\n return <Context messages={messages}>{children}</Context>;\n};\n\nconst LiveRenderer = LivePreview;\n\n// The editor's text, for a host that translates it (#524). This is the\n// package entry, which Fast Refresh never reloads.\n// eslint-disable-next-line react-refresh/only-export-components\nexport { defaultMessages, useLiveMessages } from './components/context';\n\nexport {\n LivePreview,\n LiveError,\n LiveEditor,\n LiveDnd,\n LiveRenderer,\n App as LiveProvider,\n //\n};\n\nexport type {\n DndEditError,\n DndRenderField,\n DndRenderSectionFallback,\n DndSectionFallbackArgs,\n DndPalette,\n DndPanel,\n DndLayout,\n DndInspector,\n DndNodePick,\n PanelBinding,\n PanelNodeChange,\n PanelNodesChange,\n FieldProps,\n DndItems,\n DndItemsItem,\n DndItemsOptions,\n // Deprecated aliases of the three above, kept until the next major.\n ItemsEditor,\n ItemsEditorItem,\n ItemsEditorOptions,\n EditorRenderData,\n FrameProps,\n Section,\n BindingRegistry,\n BindingKeyMap,\n BindingOptions,\n BindingSchema,\n LiveMessages,\n LiveMessagesInput,\n};\n\nApp.Preview = LivePreview;\nApp.Renderer = LiveRenderer;\nApp.Error = LiveError;\nApp.Editor = LiveEditor;\nApp.Dnd = LiveDnd;\n\nexport default App;\n"],"mappings":";;;;;;;;AAwCA,MAAM,OAAO,EAAE,UAAU,eAA6B;CACpD,OAAO,oBAACA,iBAAD;EAAmB;EAAW;CAAkB,CAAA;AACzD;AAEA,MAAM,eAAeC;AAiDrB,IAAI,UAAUA;AACd,IAAI,WAAW;AACf,IAAI,QAAQC;AACZ,IAAI,SAASC;AACb,IAAI,MAAMC"}