@jbpark/live-editor 1.8.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +12 -9
- package/README.md +12 -9
- package/dist/index.d.mts +61 -6
- package/dist/index.mjs +196 -149
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/README.ko.md
CHANGED
|
@@ -12,16 +12,19 @@ live-editor/
|
|
|
12
12
|
│ ├─ components/
|
|
13
13
|
│ │ ├─ Context/ # 전역 상태 관리
|
|
14
14
|
│ │ ├─ Dnd/ # 드래그 앤 드롭 시스템 및 편집 패널
|
|
15
|
-
│ │ ├─ Editor/
|
|
16
|
-
│ │ ├─ Error/
|
|
17
|
-
│ │
|
|
15
|
+
│ │ ├─ Editor/ # 코드 에디터
|
|
16
|
+
│ │ ├─ Error/ # 에러 바운더리
|
|
17
|
+
│ │ ├─ Frame/ # iframe/shadow DOM 프리뷰 격리
|
|
18
|
+
│ │ └─ Preview/ # 격리된 프리뷰 런타임
|
|
18
19
|
│ ├─ pages/
|
|
19
|
-
│ │ ├─
|
|
20
|
-
│ │
|
|
21
|
-
│ ├─
|
|
22
|
-
│
|
|
23
|
-
│ ├─
|
|
24
|
-
│
|
|
20
|
+
│ │ ├─ Docs/ # 문서 형태 데모 사이트 (개요 + 기능별 페이지)
|
|
21
|
+
│ │ ├─ Editor/ # 전체 에디터 앱 (에디터 + DnD 전환)
|
|
22
|
+
│ │ ├─ Playground/ # 데이터 바인딩 설정 테스트 페이지
|
|
23
|
+
│ │ └─ Preview/ # 전체화면 프리뷰 페이지
|
|
24
|
+
│ ├─ utils/ast/ # AST 조작 및 코드 생성
|
|
25
|
+
│ ├─ constants/ # 상수 및 설정
|
|
26
|
+
│ ├─ types/ # TypeScript 타입 정의
|
|
27
|
+
│ └─ main.tsx # 앱 진입점 + 라우팅
|
|
25
28
|
└─ package.json
|
|
26
29
|
```
|
|
27
30
|
|
package/README.md
CHANGED
|
@@ -12,16 +12,19 @@ live-editor/
|
|
|
12
12
|
│ ├─ components/
|
|
13
13
|
│ │ ├─ Context/ # Global state management
|
|
14
14
|
│ │ ├─ Dnd/ # Drag-and-drop system with editing panels
|
|
15
|
-
│ │ ├─ Editor/
|
|
16
|
-
│ │ ├─ Error/
|
|
17
|
-
│ │
|
|
15
|
+
│ │ ├─ Editor/ # Code editor
|
|
16
|
+
│ │ ├─ Error/ # Error boundary
|
|
17
|
+
│ │ ├─ Frame/ # iframe/shadow-DOM preview isolation
|
|
18
|
+
│ │ └─ Preview/ # Isolated preview runtime
|
|
18
19
|
│ ├─ pages/
|
|
19
|
-
│ │ ├─
|
|
20
|
-
│ │
|
|
21
|
-
│ ├─
|
|
22
|
-
│
|
|
23
|
-
│ ├─
|
|
24
|
-
│
|
|
20
|
+
│ │ ├─ Docs/ # Docs-style demo site (overview + feature pages)
|
|
21
|
+
│ │ ├─ Editor/ # Full editor app (editor + DnD toggle)
|
|
22
|
+
│ │ ├─ Playground/ # Data-binding config test page
|
|
23
|
+
│ │ └─ Preview/ # Full-screen preview page
|
|
24
|
+
│ ├─ utils/ast/ # AST manipulation & code generation
|
|
25
|
+
│ ├─ constants/ # Constants and configurations
|
|
26
|
+
│ ├─ types/ # TypeScript type definitions
|
|
27
|
+
│ └─ main.tsx # App entry + routing
|
|
25
28
|
└─ package.json
|
|
26
29
|
```
|
|
27
30
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { n as Section } from "./index-DdSjzvA3.mjs";
|
|
2
2
|
import "@jbpark/ui-kit/style.css";
|
|
3
|
+
import * as react from "react";
|
|
3
4
|
import React$1, { ReactNode } from "react";
|
|
4
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
6
|
import { Extension } from "@uiw/react-codemirror";
|
|
@@ -60,7 +61,7 @@ declare class ErrorBoundary extends React$1.Component<Props$6, State> {
|
|
|
60
61
|
static getDerivedStateFromError(error: Error): State;
|
|
61
62
|
componentDidCatch(error: Error, errorInfo: React$1.ErrorInfo): void;
|
|
62
63
|
componentDidUpdate(prevProps: Props$6): void;
|
|
63
|
-
render(): string | number | bigint | boolean |
|
|
64
|
+
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_jsx_runtime0.JSX.Element | null | undefined;
|
|
64
65
|
}
|
|
65
66
|
//#endregion
|
|
66
67
|
//#region src/components/error/error.d.ts
|
|
@@ -132,17 +133,26 @@ declare const Core: ({
|
|
|
132
133
|
}: Props$2) => react_jsx_runtime0.JSX.Element;
|
|
133
134
|
//#endregion
|
|
134
135
|
//#region src/components/editor/editor.d.ts
|
|
136
|
+
interface EditorRenderData {
|
|
137
|
+
value: string;
|
|
138
|
+
onChange: (value: string) => void;
|
|
139
|
+
formatCode: (code: string) => Promise<string>;
|
|
140
|
+
}
|
|
135
141
|
interface Props$1 extends Omit<Props$2, 'onSave' | 'onError'> {
|
|
136
142
|
defaultValue?: string;
|
|
137
143
|
debounce?: number;
|
|
144
|
+
renderEditor?: (data: EditorRenderData) => React.ReactNode;
|
|
138
145
|
}
|
|
139
146
|
declare const Editor$1: ({
|
|
140
147
|
defaultValue,
|
|
141
148
|
value: _value,
|
|
142
149
|
debounce,
|
|
143
150
|
onChange: _onChange,
|
|
151
|
+
renderEditor,
|
|
152
|
+
fragment,
|
|
153
|
+
prettierOptions,
|
|
144
154
|
...props
|
|
145
|
-
}: Props$1) => react_jsx_runtime0.JSX.Element;
|
|
155
|
+
}: Props$1) => string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
|
|
146
156
|
//#endregion
|
|
147
157
|
//#region src/components/editor/index.d.ts
|
|
148
158
|
type EditorComponent = typeof Editor$1 & {
|
|
@@ -150,7 +160,32 @@ type EditorComponent = typeof Editor$1 & {
|
|
|
150
160
|
};
|
|
151
161
|
declare const Editor: EditorComponent;
|
|
152
162
|
//#endregion
|
|
163
|
+
//#region src/components/dnd/draggable.d.ts
|
|
164
|
+
interface DraggableItemDragState {
|
|
165
|
+
ref: (node: HTMLElement | null) => void;
|
|
166
|
+
dragProps: React.HTMLAttributes<HTMLElement>;
|
|
167
|
+
isDragging: boolean;
|
|
168
|
+
}
|
|
169
|
+
interface DraggableItemProps {
|
|
170
|
+
item: Section;
|
|
171
|
+
children: (drag: DraggableItemDragState) => React.ReactNode;
|
|
172
|
+
}
|
|
173
|
+
declare const DraggableItem: ({
|
|
174
|
+
item,
|
|
175
|
+
children
|
|
176
|
+
}: DraggableItemProps) => react.ReactNode;
|
|
177
|
+
//#endregion
|
|
153
178
|
//#region src/components/dnd/dnd.d.ts
|
|
179
|
+
interface PaletteRenderData {
|
|
180
|
+
items: Section[];
|
|
181
|
+
onAdd: (item: Section) => void;
|
|
182
|
+
DraggableItem: typeof DraggableItem;
|
|
183
|
+
}
|
|
184
|
+
interface PanelRenderData {
|
|
185
|
+
item?: Section;
|
|
186
|
+
onChange: (next: Partial<Section>) => void;
|
|
187
|
+
onDelete: (id: string) => void;
|
|
188
|
+
}
|
|
154
189
|
interface Props extends Omit<React.ComponentPropsWithRef<'div'>, 'onChange'> {
|
|
155
190
|
value?: string;
|
|
156
191
|
props?: Record<string, unknown>;
|
|
@@ -159,8 +194,10 @@ interface Props extends Omit<React.ComponentPropsWithRef<'div'>, 'onChange'> {
|
|
|
159
194
|
frame?: FrameProps;
|
|
160
195
|
provider?: (children: React.ReactNode) => React.ReactNode;
|
|
161
196
|
onChange?: (value: string) => void;
|
|
197
|
+
renderPalette?: (data: PaletteRenderData) => React.ReactNode;
|
|
198
|
+
renderPanel?: (data: PanelRenderData) => React.ReactNode;
|
|
162
199
|
}
|
|
163
|
-
declare const Dnd: ({
|
|
200
|
+
declare const Dnd$1: ({
|
|
164
201
|
value: _value,
|
|
165
202
|
props,
|
|
166
203
|
modules,
|
|
@@ -169,9 +206,17 @@ declare const Dnd: ({
|
|
|
169
206
|
items,
|
|
170
207
|
frame,
|
|
171
208
|
provider,
|
|
209
|
+
renderPalette,
|
|
210
|
+
renderPanel,
|
|
172
211
|
...restProps
|
|
173
212
|
}: Props) => react_jsx_runtime0.JSX.Element;
|
|
174
213
|
//#endregion
|
|
214
|
+
//#region src/components/dnd/index.d.ts
|
|
215
|
+
type DndComponent = typeof Dnd$1 & {
|
|
216
|
+
DraggableItem: typeof DraggableItem;
|
|
217
|
+
};
|
|
218
|
+
declare const Dnd: DndComponent;
|
|
219
|
+
//#endregion
|
|
175
220
|
//#region src/index.d.ts
|
|
176
221
|
declare const App: {
|
|
177
222
|
({
|
|
@@ -216,8 +261,11 @@ declare const App: {
|
|
|
216
261
|
value: _value,
|
|
217
262
|
debounce,
|
|
218
263
|
onChange: _onChange,
|
|
264
|
+
renderEditor,
|
|
265
|
+
fragment,
|
|
266
|
+
prettierOptions,
|
|
219
267
|
...props
|
|
220
|
-
}: Props$1) => react_jsx_runtime0.JSX.Element) & {
|
|
268
|
+
}: Props$1) => string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined) & {
|
|
221
269
|
Core: ({
|
|
222
270
|
value,
|
|
223
271
|
theme,
|
|
@@ -232,7 +280,7 @@ declare const App: {
|
|
|
232
280
|
...props
|
|
233
281
|
}: Props$2) => react_jsx_runtime0.JSX.Element;
|
|
234
282
|
};
|
|
235
|
-
Dnd: ({
|
|
283
|
+
Dnd: (({
|
|
236
284
|
value: _value,
|
|
237
285
|
props,
|
|
238
286
|
modules,
|
|
@@ -241,8 +289,15 @@ declare const App: {
|
|
|
241
289
|
items,
|
|
242
290
|
frame,
|
|
243
291
|
provider,
|
|
292
|
+
renderPalette,
|
|
293
|
+
renderPanel,
|
|
244
294
|
...restProps
|
|
245
|
-
}: Props) => react_jsx_runtime0.JSX.Element
|
|
295
|
+
}: Props) => react_jsx_runtime0.JSX.Element) & {
|
|
296
|
+
DraggableItem: ({
|
|
297
|
+
item,
|
|
298
|
+
children
|
|
299
|
+
}: DraggableItemProps) => react.ReactNode;
|
|
300
|
+
};
|
|
246
301
|
};
|
|
247
302
|
declare const LiveRenderer: ({
|
|
248
303
|
code,
|