@jbpark/live-editor 4.5.0 → 4.6.1

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 (75) hide show
  1. package/README.ko.md +4 -1
  2. package/README.md +5 -1
  3. package/dist/{boundary-DnjGgsK6.js → boundary-BLB80tyw.js} +2 -2
  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-DsEXJl4h.js → context-B8MzP7_p.js} +3 -3
  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-DGNp20Nk.js → dnd-V8NAxd_R.js} +435 -413
  19. package/dist/dnd-V8NAxd_R.js.map +1 -0
  20. package/dist/document-CHO215iP.js +33992 -0
  21. package/dist/document-CHO215iP.js.map +1 -0
  22. package/dist/{document-Ct4jW78J.d.ts → document-DqRSCtsx.d.ts} +496 -435
  23. package/dist/editor/index.js +2 -2
  24. package/dist/{editor-DQ8Q--qR.js → editor-CMElfHer.js} +2 -2
  25. package/dist/editor-CMElfHer.js.map +1 -0
  26. package/dist/editor-caches-ClMvdcQF.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-DwqwjJ2C.js → error-CN_GCnXB.js} +3 -3
  30. package/dist/{error-DwqwjJ2C.js.map → error-CN_GCnXB.js.map} +1 -1
  31. package/dist/{index-vtyggWy0.d.ts → index-CRwEhJ7w.d.ts} +2 -2
  32. package/dist/index-C_PfR4X9.d.ts +734 -0
  33. package/dist/{index-P9Aifaui.d.ts → index-CiWB0zFb.d.ts} +72 -70
  34. package/dist/{index-WQgFy510.d.ts → index-DrWtSKXu.d.ts} +2 -2
  35. package/dist/index.d.ts +5 -5
  36. package/dist/index.js +6 -6
  37. package/dist/{items-DdrwGxJw.js → items-BXXtMUNI.js} +307 -390
  38. package/dist/items-BXXtMUNI.js.map +1 -0
  39. package/dist/{messages-CzUPVnzH.js → messages-CSrMI4Rm.js} +2 -1
  40. package/dist/messages-CSrMI4Rm.js.map +1 -0
  41. package/dist/{messages-Cp3g1mn1.d.ts → messages-IBPs4TkZ.d.ts} +2 -1
  42. package/dist/preview/index.js +2 -2
  43. package/dist/{preview-BKFgq_5u.js → preview-CtyG5UbH.js} +4 -4
  44. package/dist/{preview-BKFgq_5u.js.map → preview-CtyG5UbH.js.map} +1 -1
  45. package/dist/provider/index.d.ts +2 -2
  46. package/dist/provider/index.js +2 -2
  47. package/dist/{sections-BRH3KHYc.js → sections-jYuqS4KB.js} +3 -3
  48. package/dist/sections-jYuqS4KB.js.map +1 -0
  49. package/dist/states-Ci1AvoQ9.js.map +1 -1
  50. package/dist/{use-dynamic-tailwind-T9r9ExbR.js → use-dynamic-tailwind-BP1toJkW.js} +59 -39
  51. package/dist/use-dynamic-tailwind-BP1toJkW.js.map +1 -0
  52. package/dist/utils/ast/index.d.ts +2 -2
  53. package/dist/utils/ast/index.js +84 -2
  54. package/dist/utils/ast/index.js.map +1 -1
  55. package/dist/utils/index.d.ts +1 -1
  56. package/dist/utils/index.js +4 -4
  57. package/dist/utils/index.js.map +1 -1
  58. package/dist/utils/tailwind/index.js.map +1 -1
  59. package/dist/validate-iLo8IONY.js.map +1 -1
  60. package/package.json +5 -7
  61. package/dist/boundary-DnjGgsK6.js.map +0 -1
  62. package/dist/compile-DDfk5P25.js.map +0 -1
  63. package/dist/constants-h1JAgOeW.js.map +0 -1
  64. package/dist/context-DsEXJl4h.js.map +0 -1
  65. package/dist/core-CRsAGpei.js.map +0 -1
  66. package/dist/detect-typescript-CCj9ALXc.js.map +0 -1
  67. package/dist/dnd-DGNp20Nk.js.map +0 -1
  68. package/dist/document-DGHTfrda.js +0 -38667
  69. package/dist/document-DGHTfrda.js.map +0 -1
  70. package/dist/editor-DQ8Q--qR.js.map +0 -1
  71. package/dist/index-CHknA6k1.d.ts +0 -221
  72. package/dist/items-DdrwGxJw.js.map +0 -1
  73. package/dist/messages-CzUPVnzH.js.map +0 -1
  74. package/dist/sections-BRH3KHYc.js.map +0 -1
  75. package/dist/use-dynamic-tailwind-T9r9ExbR.js.map +0 -1
@@ -1,8 +1,61 @@
1
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-Ct4jW78J.js";
3
- import { B as UpdateFailure } from "./index-CHknA6k1.js";
2
+ import { v as Section } from "./document-DqRSCtsx.js";
3
+ import { B as UpdateFailure } from "./index-C_PfR4X9.js";
4
4
  import { t as FrameProps } from "./index-DpDU1IAw.js";
5
5
  import { useMultiSelect } from "@jbpark/use-hooks";
6
+ //#region src/components/dnd/canvas/section-fallback-context.d.ts
7
+ interface DndSectionFallbackArgs {
8
+ section: Section;
9
+ reason: 'compile' | 'runtime' | 'forced';
10
+ message?: string;
11
+ }
12
+ type DndRenderSectionFallback = (args: DndSectionFallbackArgs) => React.ReactNode | undefined;
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
6
59
  //#region src/components/dnd/panel/field.d.ts
7
60
  interface FieldProps {
8
61
  binding: PanelBinding;
@@ -61,60 +114,7 @@ interface DndInspector {
61
114
  }
62
115
  declare const useDndInspector: () => DndInspector;
63
116
  //#endregion
64
- //#region src/components/dnd/panel-binding.d.ts
65
- interface PanelNodeChange {
66
- (params: {
67
- id: string;
68
- label: string;
69
- property: string;
70
- value: unknown;
71
- }): void;
72
- }
73
- interface PanelNodesChange {
74
- (changes: Parameters<PanelNodeChange>[0][]): void;
75
- }
76
- interface PanelBinding {
77
- id: string;
78
- label: string;
79
- property: string;
80
- type?: BindingType;
81
- widget?: BindingWidget;
82
- options?: BindingOption[];
83
- render?: BindingRenderMap;
84
- min?: number;
85
- max?: number;
86
- pattern?: string;
87
- required?: boolean;
88
- meta?: Record<string, unknown>;
89
- value: unknown;
90
- rawValue: string;
91
- canEditValue?: boolean;
92
- present?: boolean;
93
- element?: PanelBindingElement;
94
- onChange: (value: unknown) => void;
95
- }
96
- interface PanelBindingElement {
97
- tagName: string;
98
- text: string;
99
- }
100
- type PanelBindingData = Omit<PanelBinding, 'onChange'>;
101
- interface PanelBindingSource {
102
- id: string;
103
- tagName: string;
104
- bindings: PanelBindingData[];
105
- }
106
- declare const resolvePanelBindings: (node: DataAttrNode) => PanelBindingSource | null;
107
- declare const withPanelCommit: (bindings: PanelBindingData[], commit: PanelNodeChange | undefined) => PanelBinding[];
108
- //#endregion
109
- //#region src/components/dnd/section-fallback-context.d.ts
110
- interface DndSectionFallbackArgs {
111
- section: Section;
112
- reason: 'compile' | 'runtime' | 'forced';
113
- message?: string;
114
- }
115
- type DndRenderSectionFallback = (args: DndSectionFallbackArgs) => React.ReactNode | undefined;
116
- //#endregion
117
- //#region src/components/dnd/dnd.d.ts
117
+ //#region src/components/dnd/types.d.ts
118
118
  interface DndPalette {
119
119
  items: Section[];
120
120
  onAdd: (item: Section) => void;
@@ -154,19 +154,9 @@ interface Props extends Omit<React.ComponentPropsWithRef<'div'>, 'onChange'> {
154
154
  onNodePick?: (pick: DndNodePick) => void;
155
155
  children?: React.ReactNode;
156
156
  }
157
- declare const Dnd$1: ({ 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;
158
157
  //#endregion
159
- //#region src/components/dnd/draggable.d.ts
160
- interface DraggableItemDragState {
161
- ref: (node: HTMLElement | null) => void;
162
- dragProps: React.HTMLAttributes<HTMLElement>;
163
- isDragging: boolean;
164
- }
165
- interface DraggableItemProps {
166
- item: Section;
167
- children: (drag: DraggableItemDragState) => React.ReactNode;
168
- }
169
- declare const DraggableItem: ({ item, children }: DraggableItemProps) => import("react").ReactNode;
158
+ //#region src/components/dnd/dnd.d.ts
159
+ declare const Dnd$1: ({ 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;
170
160
  //#endregion
171
161
  //#region src/components/dnd/layout.d.ts
172
162
  type DndRegionProps = Omit<React.ComponentPropsWithRef<'div'>, 'children'>;
@@ -192,6 +182,18 @@ declare const useDndPalette: () => DndPalette;
192
182
  declare const useDndPanel: () => DndPanel;
193
183
  declare const useDndLayout: () => DndLayout;
194
184
  //#endregion
185
+ //#region src/components/dnd/palette/draggable.d.ts
186
+ interface DraggableItemDragState {
187
+ ref: (node: HTMLElement | null) => void;
188
+ dragProps: React.HTMLAttributes<HTMLElement>;
189
+ isDragging: boolean;
190
+ }
191
+ interface DraggableItemProps {
192
+ item: Section;
193
+ children: (drag: DraggableItemDragState) => React.ReactNode;
194
+ }
195
+ declare const DraggableItem: ({ item, children }: DraggableItemProps) => import("react").ReactNode;
196
+ //#endregion
195
197
  //#region src/components/dnd/panel/use-dnd-children.d.ts
196
198
  interface DndChildrenOptions {
197
199
  onChange?: (value: string) => void;
@@ -319,5 +321,5 @@ type ChildrenEditor = DndChildren;
319
321
  /** @deprecated Renamed to `DndChildrenOptions`. */
320
322
  type ChildrenEditorOptions = DndChildrenOptions;
321
323
  //#endregion
322
- export { DndInspector as $, useDndPanel as A, DndPalette as B, useDndItems as C, DndLayout as D, useDndChildren as E, Palette as F, PanelBinding as G, Props as H, Panel as I, PanelBindingSource as J, PanelBindingData as K, DraggableItem as L, DndLayoutProps as M, DndRegionProps as N, useDndLayout as O, Layout as P, withPanelCommit as Q, DraggableItemDragState as R, DndItemsOptions as S, DndChildrenOptions as T, DndRenderSectionFallback as U, DndPanel as V, DndSectionFallbackArgs as W, PanelNodesChange as X, PanelNodeChange as Y, resolvePanelBindings as Z, DndItemsActions as _, ItemsEditorActions as a, FieldProps as at, DndItemsNestedElement as b, ItemsEditorNestedGroup as c, useItemsEditor as d, DndNodePick as et, FieldKind as f, DndItems as g, isStructuralFieldKind as h, ItemsEditor as i, Field as it, Canvas as j, useDndPalette as k, ItemsEditorOptions as l, getFieldKind as m, ChildrenEditorOptions as n, DndEditError as nt, ItemsEditorItem as o, FieldKindBinding as p, PanelBindingElement as q, Dnd as r, DndRenderField as rt, ItemsEditorNestedElement as s, ChildrenEditor as t, useDndInspector as tt, useChildrenEditor as u, DndItemsExpansion as v, DndChildren as w, DndItemsNestedGroup as x, DndItemsItem as y, DraggableItemProps as z };
323
- //# sourceMappingURL=index-P9Aifaui.d.ts.map
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
@@ -1,4 +1,4 @@
1
- import { n as LiveMessagesInput } from "./messages-Cp3g1mn1.js";
1
+ import { n as LiveMessagesInput } from "./messages-IBPs4TkZ.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-WQgFy510.d.ts.map
11
+ //# sourceMappingURL=index-DrWtSKXu.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
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-Cp3g1mn1.js";
3
- import { n as Props } from "./index-WQgFy510.js";
4
- import { v as Section } from "./document-Ct4jW78J.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";
5
6
  import { t as FrameProps } from "./index-DpDU1IAw.js";
6
- import { $ as DndInspector, B as DndPalette, D as DndLayout, F as Palette, G as PanelBinding, H as Props$1, 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-P9Aifaui.js";
7
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-vtyggWy0.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
9
  import { n as Preview, r as Props$7 } from "./index-DQkL37eL.js";
10
10
  //#region src/index.d.ts
11
11
  declare const App: {
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { i as useLiveMessages, n as defaultMessages } from "./messages-CzUPVnzH.js";
2
- import { t as ContextProvider } from "./context-DsEXJl4h.js";
3
- import { t as Dnd } from "./dnd-DGNp20Nk.js";
4
- import { t as Editor } from "./editor-DQ8Q--qR.js";
5
- import { t as Error } from "./error-DwqwjJ2C.js";
6
- import { t as Preview } from "./preview-BKFgq_5u.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-V8NAxd_R.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";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  //#region src/index.tsx
9
9
  const App = ({ children, messages }) => {