@jbpark/live-editor 1.13.0 → 1.15.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 (48) hide show
  1. package/README.ko.md +15 -16
  2. package/README.md +17 -16
  3. package/dist/context-DrqO0VVu.js +38 -0
  4. package/dist/context-DrqO0VVu.js.map +1 -0
  5. package/dist/core-B7igZRDs.js +11195 -0
  6. package/dist/core-B7igZRDs.js.map +1 -0
  7. package/dist/dnd/index.d.ts +2 -0
  8. package/dist/dnd/index.js +2 -0
  9. package/dist/dnd-BdNgmgYB.js +1717 -0
  10. package/dist/dnd-BdNgmgYB.js.map +1 -0
  11. package/dist/editor/index.d.ts +2 -0
  12. package/dist/editor/index.js +3 -0
  13. package/dist/editor-DmgTeTcG.js +51 -0
  14. package/dist/editor-DmgTeTcG.js.map +1 -0
  15. package/dist/error/index.d.ts +2 -0
  16. package/dist/error/index.js +2 -0
  17. package/dist/error-DRMGumEj.js +168 -0
  18. package/dist/error-DRMGumEj.js.map +1 -0
  19. package/dist/frame-C11nuIBH.js +357 -0
  20. package/dist/frame-C11nuIBH.js.map +1 -0
  21. package/dist/index-BnncHZTt.d.ts +63 -0
  22. package/dist/index-C4TBkJBG.d.ts +37 -0
  23. package/dist/index-CCynrS6c.d.ts +52 -0
  24. package/dist/index-DpDU1IAw.d.ts +23 -0
  25. package/dist/index-lgHdCda5.d.ts +17 -0
  26. package/dist/index.d.ts +13 -185
  27. package/dist/index.js +8 -13599
  28. package/dist/index.js.map +1 -1
  29. package/dist/preview/index.d.ts +2 -0
  30. package/dist/preview/index.js +2 -0
  31. package/dist/preview-DkLLqgKE.js +113 -0
  32. package/dist/preview-DkLLqgKE.js.map +1 -0
  33. package/dist/provider/index.d.ts +8 -0
  34. package/dist/provider/index.js +2 -0
  35. package/dist/states-Ci1AvoQ9.js +18 -0
  36. package/dist/states-Ci1AvoQ9.js.map +1 -0
  37. package/dist/style.css +4231 -619
  38. package/dist/tailwind-CbjdLyVX.js +28 -0
  39. package/dist/tailwind-CbjdLyVX.js.map +1 -0
  40. package/dist/utils/index.d.ts +1 -1
  41. package/dist/utils/index.js +1 -1
  42. package/dist/utils/tailwind/index.d.ts +2 -2
  43. package/dist/utils/tailwind/index.js +2 -2
  44. package/dist/{utils-B11t9ZYd.js → utils-BzfDKU6y.js} +10 -23
  45. package/dist/{utils-B11t9ZYd.js.map → utils-BzfDKU6y.js.map} +1 -1
  46. package/package.json +27 -15
  47. package/dist/tailwind-CzPhj3D9.js +0 -36
  48. package/dist/tailwind-CzPhj3D9.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,201 +1,29 @@
1
1
  import { _ as Section } from "./document-DXOwpvWM.js";
2
- import { w as BindingType, x as BindingOption } from "./index-BVjSMVya.js";
3
- import "@jbpark/ui-kit/style.css";
4
- import React$1, { ReactNode } from "react";
5
- import { Extension } from "@uiw/react-codemirror";
6
- //#region src/components/frame/iframe.d.ts
7
- interface Props$8 {
8
- title?: string;
9
- /** 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`). */
10
- sandbox?: string;
11
- style?: React.CSSProperties;
12
- scripts?: string[];
13
- styles?: string[];
14
- stylesheets?: string[];
15
- autoHeight?: boolean;
16
- syncStyle?: boolean;
17
- children: (container: HTMLElement) => ReactNode;
18
- onLoaded?: () => void;
19
- }
20
- //#endregion
21
- //#region src/components/frame/frame.d.ts
22
- interface FrameProps extends Omit<Props$8, 'children'> {
23
- mode?: 'iframe' | 'shadow';
24
- }
25
- //#endregion
26
- //#region src/components/preview/preview.d.ts
27
- interface Props$7 extends React$1.ComponentPropsWithRef<'div'> {
28
- code?: string;
29
- showError?: boolean;
30
- props?: Record<string, unknown>;
31
- container?: HTMLElement | null;
32
- frame?: boolean | FrameProps;
33
- modules?: Record<string, unknown>;
34
- dynamicTailwind?: boolean;
35
- provider?: (children: React$1.ReactNode) => React$1.ReactNode;
36
- }
37
- declare const Preview: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$7) => React$1.JSX.Element;
38
- //#endregion
39
- //#region src/components/error/boundary.d.ts
40
- interface Props$6 {
41
- children: React$1.ReactNode;
42
- fallback?: (message?: string) => React$1.ReactNode;
43
- onError?: (e: Error, info: React$1.ErrorInfo) => void;
44
- resetKeys?: readonly unknown[];
45
- }
46
- interface State {
47
- hasError: boolean;
48
- error?: Error;
49
- }
50
- declare class ErrorBoundary extends React$1.Component<Props$6, State> {
51
- constructor(props: Props$6);
52
- static getDerivedStateFromError(error: Error): State;
53
- componentDidCatch(error: Error, errorInfo: React$1.ErrorInfo): void;
54
- componentDidUpdate(prevProps: Props$6): void;
55
- render(): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | React$1.JSX.Element | null | undefined;
56
- }
57
- //#endregion
58
- //#region src/components/error/error.d.ts
59
- interface Props$5 extends React.ComponentPropsWithRef<'div'> {
60
- message?: string | null;
61
- title?: string;
62
- onReset?: () => void;
63
- }
64
- declare const Error$2: ({ message, title, className, onReset }: Props$5) => import("react").JSX.Element | null;
65
- //#endregion
66
- //#region src/components/error/guard.d.ts
67
- interface Props$4 {
68
- children: React.ReactNode;
69
- onError?: (error: Error) => void;
70
- }
71
- declare const Guard: ({ children, onError }: Props$4) => import("react").JSX.Element;
72
- //#endregion
73
- //#region src/components/error/runtime.d.ts
74
- interface Props$3 extends React.ComponentPropsWithRef<'div'> {
75
- open?: boolean;
76
- reset?: () => void;
77
- }
78
- declare const Runtime: ({ open, reset }: Props$3) => import("react").JSX.Element | null;
79
- //#endregion
80
- //#region src/components/error/index.d.ts
81
- type ErrorComponent = typeof Error$2 & {
82
- Boundary: typeof ErrorBoundary;
83
- Runtime: typeof Runtime;
84
- Guard: typeof Guard;
85
- };
86
- declare const Error$1: ErrorComponent;
87
- //#endregion
88
- //#region src/components/editor/core.d.ts
89
- interface Props$2 {
90
- value: string;
91
- height?: string;
92
- theme?: Extension | 'light' | 'dark' | 'none';
93
- prettierOptions?: Record<string, unknown>;
94
- fragment?: boolean;
95
- raw?: boolean;
96
- className?: string;
97
- onChange?: (value: string) => void;
98
- onSave?: (value: string) => void;
99
- onError?: (error: string | null) => void;
100
- }
101
- declare const Core: ({ value, theme, height, className, prettierOptions, fragment, raw, onChange, onSave: _onSave, onError, ...props }: Props$2) => import("react").JSX.Element;
102
- //#endregion
103
- //#region src/components/editor/editor.d.ts
104
- interface EditorRenderData {
105
- value: string;
106
- onChange: (value: string) => void;
107
- formatCode: (code: string) => Promise<string>;
108
- }
109
- interface Props$1 extends Omit<Props$2, 'onSave' | 'onError'> {
110
- defaultValue?: string;
111
- debounce?: number;
112
- renderEditor?: (data: EditorRenderData) => React.ReactNode;
113
- }
114
- declare const Editor$1: ({ defaultValue, value: _value, debounce, onChange: _onChange, renderEditor, fragment, prettierOptions, ...props }: Props$1) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
115
- //#endregion
116
- //#region src/components/editor/index.d.ts
117
- type EditorComponent = typeof Editor$1 & {
118
- Core: typeof Core;
119
- };
120
- declare const Editor: EditorComponent;
121
- //#endregion
122
- //#region src/components/dnd/draggable.d.ts
123
- interface DraggableItemDragState {
124
- ref: (node: HTMLElement | null) => void;
125
- dragProps: React.HTMLAttributes<HTMLElement>;
126
- isDragging: boolean;
127
- }
128
- interface DraggableItemProps {
129
- item: Section;
130
- children: (drag: DraggableItemDragState) => React.ReactNode;
131
- }
132
- declare const DraggableItem: ({ item, children }: DraggableItemProps) => import("react").ReactNode;
133
- //#endregion
134
- //#region src/components/dnd/dnd.d.ts
135
- interface PaletteRenderData {
136
- items: Section[];
137
- onAdd: (item: Section) => void;
138
- DraggableItem: typeof DraggableItem;
139
- isMobile: boolean;
140
- }
141
- interface PanelRenderData {
142
- item?: Section;
143
- onChange: (next: Partial<Section>) => void;
144
- onDelete: (id: string) => void;
145
- onMoveUp: () => void;
146
- onMoveDown: () => void;
147
- canMoveUp: boolean;
148
- canMoveDown: boolean;
149
- bindings: PanelBinding[];
150
- }
151
- interface PanelBinding {
152
- id: string;
153
- label: string;
154
- property: string;
155
- type?: BindingType;
156
- options?: BindingOption[];
157
- value: string;
158
- onChange: (value: string) => void;
159
- }
160
- interface Props extends Omit<React.ComponentPropsWithRef<'div'>, 'onChange'> {
161
- value?: string;
162
- props?: Record<string, unknown>;
163
- modules?: Record<string, unknown>;
164
- items?: Section[];
165
- frame?: FrameProps;
166
- provider?: (children: React.ReactNode) => React.ReactNode;
167
- onChange?: (value: string) => void;
168
- renderPalette?: (data: PaletteRenderData) => React.ReactNode;
169
- renderPanel?: (data: PanelRenderData) => React.ReactNode;
170
- }
171
- declare const Dnd$1: ({ value: _value, props, modules, onChange: _onChange, className, items, frame, provider, renderPalette, renderPanel, ...restProps }: Props) => import("react").JSX.Element;
172
- //#endregion
173
- //#region src/components/dnd/index.d.ts
174
- type DndComponent = typeof Dnd$1 & {
175
- DraggableItem: typeof DraggableItem;
176
- };
177
- declare const Dnd: DndComponent;
178
- //#endregion
2
+ import { t as FrameProps } from "./index-DpDU1IAw.js";
3
+ import { a as Props, c as DraggableItemProps, i as PanelRenderData, n as PaletteRenderData, r as PanelBinding, t as Dnd } from "./index-BnncHZTt.js";
4
+ import { a as Props$2, n as EditorRenderData, r as Props$1, t as Editor } from "./index-C4TBkJBG.js";
5
+ import { a as Props$5, n as Props$4, o as Props$3, s as ErrorBoundary, t as Error } from "./index-CCynrS6c.js";
6
+ import { n as Props$6, t as Preview } from "./index-lgHdCda5.js";
179
7
  //#region src/index.d.ts
180
8
  declare const App: {
181
9
  ({ children }: {
182
10
  children?: React.ReactNode;
183
11
  }): import("react").JSX.Element;
184
- Preview: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$7) => import("react").JSX.Element;
185
- Renderer: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$7) => import("react").JSX.Element;
186
- Error: (({ message, title, className, onReset }: Props$5) => import("react").JSX.Element | null) & {
12
+ Preview: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$6) => import("react").JSX.Element;
13
+ Renderer: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$6) => import("react").JSX.Element;
14
+ Error: (({ message, title, className, onReset }: Props$3) => import("react").JSX.Element | null) & {
187
15
  Boundary: typeof ErrorBoundary;
188
- Runtime: ({ open, reset }: Props$3) => import("react").JSX.Element | null;
189
- Guard: ({ children, onError }: Props$4) => import("react").JSX.Element;
16
+ Runtime: ({ open, reset }: Props$4) => import("react").JSX.Element | null;
17
+ Guard: ({ children, onError }: Props$5) => import("react").JSX.Element;
190
18
  };
191
19
  Editor: (({ defaultValue, value: _value, debounce, onChange: _onChange, renderEditor, fragment, prettierOptions, ...props }: Props$1) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined) & {
192
20
  Core: ({ value, theme, height, className, prettierOptions, fragment, raw, onChange, onSave: _onSave, onError, ...props }: Props$2) => import("react").JSX.Element;
193
21
  };
194
- Dnd: (({ value: _value, props, modules, onChange: _onChange, className, items, frame, provider, renderPalette, renderPanel, ...restProps }: Props) => import("react").JSX.Element) & {
22
+ Dnd: (({ value: _value, props, modules, onChange: _onChange, className, items, frame, dynamicTailwind, provider, renderPalette, renderPanel, ...restProps }: Props) => import("react").JSX.Element) & {
195
23
  DraggableItem: ({ item, children }: DraggableItemProps) => import("react").ReactNode;
196
24
  };
197
25
  };
198
- declare const LiveRenderer: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$7) => import("react").JSX.Element;
26
+ declare const LiveRenderer: ({ code, props, modules, dynamicTailwind, provider, ...restProps }: Props$6) => import("react").JSX.Element;
199
27
  //#endregion
200
- export { Dnd as LiveDnd, Editor as LiveEditor, Error$1 as LiveError, Preview as LivePreview, App as LiveProvider, App as default, LiveRenderer };
28
+ export { type EditorRenderData, type FrameProps, Dnd as LiveDnd, Editor as LiveEditor, Error as LiveError, Preview as LivePreview, App as LiveProvider, App as default, LiveRenderer, type PaletteRenderData, type PanelBinding, type PanelRenderData, type Section };
201
29
  //# sourceMappingURL=index.d.ts.map