@jbpark/live-editor 0.2.0 → 1.0.3
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 +1 -1
- package/README.md +1 -1
- package/dist/{ast-6PhUZ232.mjs → ast-UXy9dqvD.mjs} +65 -18
- package/dist/ast-UXy9dqvD.mjs.map +1 -0
- package/dist/index.d.mts +84 -77
- package/dist/index.mjs +369 -6751
- package/dist/index.mjs.map +1 -1
- package/dist/utils/ast/index.d.mts +13 -2
- package/dist/utils/ast/index.mjs +2 -2
- package/package.json +4 -2
- package/dist/ast-6PhUZ232.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import React$1, { ReactNode } from "react";
|
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
import { Extension } from "@uiw/react-codemirror";
|
|
6
6
|
|
|
7
|
-
//#region src/components/
|
|
7
|
+
//#region src/components/frame/iframe.d.ts
|
|
8
8
|
interface Props$8 {
|
|
9
9
|
title?: string;
|
|
10
10
|
/** 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`). */
|
|
@@ -19,12 +19,12 @@ interface Props$8 {
|
|
|
19
19
|
onLoaded?: () => void;
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region src/components/
|
|
22
|
+
//#region src/components/frame/frame.d.ts
|
|
23
23
|
interface FrameProps extends Omit<Props$8, 'children'> {
|
|
24
24
|
mode?: 'iframe' | 'shadow';
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
|
-
//#region src/components/
|
|
27
|
+
//#region src/components/preview/preview.d.ts
|
|
28
28
|
interface Props$7 extends React$1.ComponentPropsWithRef<'div'> {
|
|
29
29
|
code?: string;
|
|
30
30
|
showError?: boolean;
|
|
@@ -44,20 +44,8 @@ declare const Preview: ({
|
|
|
44
44
|
...restProps
|
|
45
45
|
}: Props$7) => react_jsx_runtime0.JSX.Element;
|
|
46
46
|
//#endregion
|
|
47
|
-
//#region src/components/
|
|
48
|
-
interface Props$6
|
|
49
|
-
open?: boolean;
|
|
50
|
-
reset?: () => void;
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/components/Error/Guard/index.d.ts
|
|
54
|
-
interface Props$5 {
|
|
55
|
-
children: React.ReactNode;
|
|
56
|
-
onError?: (error: Error) => void;
|
|
57
|
-
}
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region src/components/Error/Boundary/index.d.ts
|
|
60
|
-
interface Props$4 {
|
|
47
|
+
//#region src/components/error/boundary.d.ts
|
|
48
|
+
interface Props$6 {
|
|
61
49
|
children: React$1.ReactNode;
|
|
62
50
|
fallback?: (message?: string) => React$1.ReactNode;
|
|
63
51
|
onError?: (e: Error, info: React$1.ErrorInfo) => void;
|
|
@@ -66,38 +54,55 @@ interface State {
|
|
|
66
54
|
hasError: boolean;
|
|
67
55
|
error?: Error;
|
|
68
56
|
}
|
|
69
|
-
declare class ErrorBoundary extends React$1.Component<Props$
|
|
70
|
-
constructor(props: Props$
|
|
57
|
+
declare class ErrorBoundary extends React$1.Component<Props$6, State> {
|
|
58
|
+
constructor(props: Props$6);
|
|
71
59
|
static getDerivedStateFromError(error: Error): State;
|
|
72
60
|
componentDidCatch(error: Error, errorInfo: React$1.ErrorInfo): void;
|
|
73
61
|
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;
|
|
74
62
|
}
|
|
75
63
|
//#endregion
|
|
76
|
-
//#region src/components/
|
|
77
|
-
interface Props$
|
|
64
|
+
//#region src/components/error/error.d.ts
|
|
65
|
+
interface Props$5 extends React.ComponentPropsWithRef<'div'> {
|
|
78
66
|
message?: string | null;
|
|
79
67
|
title?: string;
|
|
80
68
|
onReset?: () => void;
|
|
81
69
|
}
|
|
82
|
-
declare const Error$
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
declare const Error$2: ({
|
|
71
|
+
message,
|
|
72
|
+
title,
|
|
73
|
+
className,
|
|
74
|
+
onReset
|
|
75
|
+
}: Props$5) => react_jsx_runtime0.JSX.Element | null;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/components/error/guard.d.ts
|
|
78
|
+
interface Props$4 {
|
|
79
|
+
children: React.ReactNode;
|
|
80
|
+
onError?: (error: Error) => void;
|
|
81
|
+
}
|
|
82
|
+
declare const Guard: ({
|
|
83
|
+
children,
|
|
84
|
+
onError
|
|
85
|
+
}: Props$4) => react_jsx_runtime0.JSX.Element;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/components/error/runtime.d.ts
|
|
88
|
+
interface Props$3 extends React.ComponentPropsWithRef<'div'> {
|
|
89
|
+
open?: boolean;
|
|
90
|
+
reset?: () => void;
|
|
91
|
+
}
|
|
92
|
+
declare const Runtime: ({
|
|
93
|
+
open,
|
|
94
|
+
reset
|
|
95
|
+
}: Props$3) => react_jsx_runtime0.JSX.Element | null;
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/components/error/index.d.ts
|
|
98
|
+
type ErrorComponent = typeof Error$2 & {
|
|
89
99
|
Boundary: typeof ErrorBoundary;
|
|
90
|
-
Runtime:
|
|
91
|
-
|
|
92
|
-
reset
|
|
93
|
-
}: Props$6) => react_jsx_runtime0.JSX.Element | null;
|
|
94
|
-
Guard: ({
|
|
95
|
-
children,
|
|
96
|
-
onError
|
|
97
|
-
}: Props$5) => react_jsx_runtime0.JSX.Element;
|
|
100
|
+
Runtime: typeof Runtime;
|
|
101
|
+
Guard: typeof Guard;
|
|
98
102
|
};
|
|
103
|
+
declare const Error$1: ErrorComponent;
|
|
99
104
|
//#endregion
|
|
100
|
-
//#region src/components/
|
|
105
|
+
//#region src/components/editor/core.d.ts
|
|
101
106
|
interface Props$2 {
|
|
102
107
|
value: string;
|
|
103
108
|
height?: string;
|
|
@@ -110,36 +115,40 @@ interface Props$2 {
|
|
|
110
115
|
onSave?: (value: string) => void;
|
|
111
116
|
onError?: (error: string | null) => void;
|
|
112
117
|
}
|
|
118
|
+
declare const Core: ({
|
|
119
|
+
value,
|
|
120
|
+
theme,
|
|
121
|
+
height,
|
|
122
|
+
className,
|
|
123
|
+
prettierOptions,
|
|
124
|
+
fragment,
|
|
125
|
+
raw,
|
|
126
|
+
onChange,
|
|
127
|
+
onSave: _onSave,
|
|
128
|
+
onError,
|
|
129
|
+
...props
|
|
130
|
+
}: Props$2) => react_jsx_runtime0.JSX.Element;
|
|
113
131
|
//#endregion
|
|
114
|
-
//#region src/components/
|
|
132
|
+
//#region src/components/editor/editor.d.ts
|
|
115
133
|
interface Props$1 extends Omit<Props$2, 'onSave' | 'onError'> {
|
|
116
134
|
defaultValue?: string;
|
|
117
135
|
debounce?: number;
|
|
118
136
|
}
|
|
119
|
-
declare const Editor: {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
height,
|
|
131
|
-
className,
|
|
132
|
-
prettierOptions,
|
|
133
|
-
fragment,
|
|
134
|
-
raw,
|
|
135
|
-
onChange,
|
|
136
|
-
onSave: _onSave,
|
|
137
|
-
onError,
|
|
138
|
-
...props
|
|
139
|
-
}: Props$2) => react_jsx_runtime0.JSX.Element;
|
|
137
|
+
declare const Editor$1: ({
|
|
138
|
+
defaultValue,
|
|
139
|
+
value: _value,
|
|
140
|
+
debounce,
|
|
141
|
+
onChange: _onChange,
|
|
142
|
+
...props
|
|
143
|
+
}: Props$1) => react_jsx_runtime0.JSX.Element;
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/components/editor/index.d.ts
|
|
146
|
+
type EditorComponent = typeof Editor$1 & {
|
|
147
|
+
Core: typeof Core;
|
|
140
148
|
};
|
|
149
|
+
declare const Editor: EditorComponent;
|
|
141
150
|
//#endregion
|
|
142
|
-
//#region src/components/
|
|
151
|
+
//#region src/components/dnd/dnd.d.ts
|
|
143
152
|
interface Props extends Omit<React.ComponentPropsWithRef<'div'>, 'onChange'> {
|
|
144
153
|
value?: string;
|
|
145
154
|
props?: Record<string, unknown>;
|
|
@@ -184,31 +193,29 @@ declare const App: {
|
|
|
184
193
|
provider,
|
|
185
194
|
...restProps
|
|
186
195
|
}: Props$7) => react_jsx_runtime0.JSX.Element;
|
|
187
|
-
Error: {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}: Props$3): react_jsx_runtime0.JSX.Element | null;
|
|
196
|
+
Error: (({
|
|
197
|
+
message,
|
|
198
|
+
title,
|
|
199
|
+
className,
|
|
200
|
+
onReset
|
|
201
|
+
}: Props$5) => react_jsx_runtime0.JSX.Element | null) & {
|
|
194
202
|
Boundary: typeof ErrorBoundary;
|
|
195
203
|
Runtime: ({
|
|
196
204
|
open,
|
|
197
205
|
reset
|
|
198
|
-
}: Props$
|
|
206
|
+
}: Props$3) => react_jsx_runtime0.JSX.Element | null;
|
|
199
207
|
Guard: ({
|
|
200
208
|
children,
|
|
201
209
|
onError
|
|
202
|
-
}: Props$
|
|
210
|
+
}: Props$4) => react_jsx_runtime0.JSX.Element;
|
|
203
211
|
};
|
|
204
|
-
Editor: {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}: Props$1): react_jsx_runtime0.JSX.Element;
|
|
212
|
+
Editor: (({
|
|
213
|
+
defaultValue,
|
|
214
|
+
value: _value,
|
|
215
|
+
debounce,
|
|
216
|
+
onChange: _onChange,
|
|
217
|
+
...props
|
|
218
|
+
}: Props$1) => react_jsx_runtime0.JSX.Element) & {
|
|
212
219
|
Core: ({
|
|
213
220
|
value,
|
|
214
221
|
theme,
|