@pexelize/react-editor 1.0.5 → 2.0.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.md +574 -64
- package/dist/index.d.ts +201 -215
- package/dist/index.esm.js +111 -304
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +109 -303
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/dist/index.esm.js
CHANGED
|
@@ -1,351 +1,158 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { forwardRef, useRef, useState,
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useRef, useEffect, useState, useCallback, useImperativeHandle } from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
// SDK CDN Configuration
|
|
6
|
-
// ============================================================================
|
|
7
|
-
/**
|
|
8
|
-
* Use Cloudflare CDN for SDK.
|
|
9
|
-
* You can use https://sdk.pexelize.com/latest/pexelize-sdk.min.js directly.
|
|
10
|
-
* No need to add a trailing slash or extra path—just use as shown.
|
|
11
|
-
*/
|
|
12
|
-
const SDK_CDN_URL = 'https://sdk.pexelize.com/latest/pexelize-sdk.min.js';
|
|
13
|
-
// Global SDK reference (loaded from CDN)
|
|
4
|
+
const SDK_CDN_URL = "https://sdk.pexelize.com/latest/pexelize-sdk.min.js";
|
|
14
5
|
let sdkLoadPromise = null;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Check if SDK is available at the global scope
|
|
20
|
-
* UMD build creates window.PexelizeSDK namespace with:
|
|
21
|
-
* - PexelizeSDK: the class constructor
|
|
22
|
-
* - pexelize: the singleton instance
|
|
23
|
-
*/
|
|
24
|
-
function isSDKAvailable() {
|
|
25
|
-
const win = window;
|
|
26
|
-
// Check for UMD namespace (window.PexelizeSDK.pexelize)
|
|
27
|
-
if (win.PexelizeSDK && win.PexelizeSDK.pexelize) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
// Fallback: check for direct pexelize global (legacy)
|
|
31
|
-
if (win.pexelize) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
function loadSDKFromCDN(url) {
|
|
37
|
-
if (sdkLoadPromise && isSDKAvailable()) {
|
|
6
|
+
function loadSDK() {
|
|
7
|
+
if (sdkLoadPromise)
|
|
38
8
|
return sdkLoadPromise;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (isSDKAvailable()) {
|
|
42
|
-
return Promise.resolve();
|
|
9
|
+
if (typeof window !== "undefined" && window.pexelize) {
|
|
10
|
+
return Promise.resolve(window.pexelize);
|
|
43
11
|
}
|
|
44
12
|
sdkLoadPromise = new Promise((resolve, reject) => {
|
|
45
|
-
const script = document.createElement(
|
|
46
|
-
script.src =
|
|
13
|
+
const script = document.createElement("script");
|
|
14
|
+
script.src = SDK_CDN_URL;
|
|
47
15
|
script.async = true;
|
|
48
16
|
script.onload = () => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
console.log('[Pexelize React] SDK loaded from CDN');
|
|
52
|
-
resolve();
|
|
17
|
+
if (window.pexelize) {
|
|
18
|
+
resolve(window.pexelize);
|
|
53
19
|
}
|
|
54
20
|
else {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
console.error('[Pexelize React] window.PexelizeSDK:', window.PexelizeSDK);
|
|
58
|
-
console.error('[Pexelize React] window.pexelize:', window.pexelize);
|
|
59
|
-
reject(new Error('SDK loaded but pexelize global not found. Check CDN URL and SDK build.'));
|
|
21
|
+
sdkLoadPromise = null;
|
|
22
|
+
reject(new Error("Failed to load Pexelize SDK"));
|
|
60
23
|
}
|
|
61
24
|
};
|
|
62
25
|
script.onerror = () => {
|
|
63
26
|
sdkLoadPromise = null;
|
|
64
|
-
reject(new Error(
|
|
27
|
+
reject(new Error("Failed to load Pexelize SDK"));
|
|
65
28
|
};
|
|
66
29
|
document.head.appendChild(script);
|
|
67
30
|
});
|
|
68
31
|
return sdkLoadPromise;
|
|
69
32
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Get SDK singleton instance from global
|
|
72
|
-
* Handles both UMD namespace (window.PexelizeSDK.pexelize) and legacy (window.pexelize)
|
|
73
|
-
*/
|
|
74
|
-
function getSDK() {
|
|
75
|
-
const win = window;
|
|
76
|
-
// UMD namespace: window.PexelizeSDK.pexelize (preferred)
|
|
77
|
-
if (win.PexelizeSDK && win.PexelizeSDK.pexelize) {
|
|
78
|
-
return win.PexelizeSDK.pexelize;
|
|
79
|
-
}
|
|
80
|
-
// Fallback: direct pexelize global (legacy)
|
|
81
|
-
if (win.pexelize) {
|
|
82
|
-
return win.pexelize;
|
|
83
|
-
}
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
// ============================================================================
|
|
87
|
-
// Component
|
|
88
|
-
// ============================================================================
|
|
89
|
-
/**
|
|
90
|
-
* PexelizeEditor React Component
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```tsx
|
|
94
|
-
* import { PexelizeEditor, PexelizeEditorRef } from '@pexelize/react-editor';
|
|
95
|
-
*
|
|
96
|
-
* function MyEditor() {
|
|
97
|
-
* const editorRef = useRef<PexelizeEditorRef>(null);
|
|
98
|
-
*
|
|
99
|
-
* const handleSave = () => {
|
|
100
|
-
* editorRef.current?.saveDesign((design) => {
|
|
101
|
-
* console.log('Design:', design);
|
|
102
|
-
* });
|
|
103
|
-
* };
|
|
104
|
-
*
|
|
105
|
-
* return (
|
|
106
|
-
* <div>
|
|
107
|
-
* <button onClick={handleSave}>Save</button>
|
|
108
|
-
* <PexelizeEditor
|
|
109
|
-
* ref={editorRef}
|
|
110
|
-
* editorMode="email"
|
|
111
|
-
* onReady={() => console.log('Ready!')}
|
|
112
|
-
* onChange={({ design }) => console.log('Changed:', design)}
|
|
113
|
-
* />
|
|
114
|
-
* </div>
|
|
115
|
-
* );
|
|
116
|
-
* }
|
|
117
|
-
* ```
|
|
118
|
-
*/
|
|
119
33
|
const PexelizeEditor = forwardRef((props, ref) => {
|
|
120
|
-
const {
|
|
34
|
+
const { editorId, apiKey, templateId, design, editorMode, contentType, ai, height, options = {}, className, style, minHeight = "600px", onReady, onLoad, onChange, onError, } = props;
|
|
121
35
|
const containerRef = useRef(null);
|
|
122
|
-
const
|
|
36
|
+
const editorInstanceRef = useRef(null);
|
|
123
37
|
const containerId = useRef(`pexelize-editor-${Math.random().toString(36).substr(2, 9)}`);
|
|
124
|
-
const
|
|
125
|
-
const
|
|
126
|
-
const
|
|
127
|
-
|
|
38
|
+
const eventUnsubscribersRef = useRef([]);
|
|
39
|
+
const onReadyRef = useRef(onReady);
|
|
40
|
+
const onLoadRef = useRef(onLoad);
|
|
41
|
+
const onChangeRef = useRef(onChange);
|
|
42
|
+
const onErrorRef = useRef(onError);
|
|
128
43
|
useEffect(() => {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
loadSDKFromCDN(url)
|
|
132
|
-
.then(() => setSdkLoaded(true))
|
|
133
|
-
.catch((err) => setError(err.message));
|
|
134
|
-
}, [props.sdkUrl]);
|
|
135
|
-
// Initialize SDK once loaded
|
|
44
|
+
onReadyRef.current = onReady;
|
|
45
|
+
}, [onReady]);
|
|
136
46
|
useEffect(() => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
47
|
+
onLoadRef.current = onLoad;
|
|
48
|
+
}, [onLoad]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
onChangeRef.current = onChange;
|
|
51
|
+
}, [onChange]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
onErrorRef.current = onError;
|
|
54
|
+
}, [onError]);
|
|
55
|
+
const [isEditorReady, setIsEditorReady] = useState(false);
|
|
56
|
+
const handleReady = useCallback(() => {
|
|
57
|
+
setIsEditorReady(true);
|
|
58
|
+
if (editorInstanceRef.current) {
|
|
59
|
+
onReadyRef.current?.(editorInstanceRef.current);
|
|
143
60
|
}
|
|
144
|
-
|
|
145
|
-
sdkRef.current = pexelize;
|
|
146
|
-
// Initialize
|
|
147
|
-
pexelize.init({
|
|
148
|
-
id: containerId.current,
|
|
149
|
-
editorMode: editorMode || displayMode || 'email',
|
|
150
|
-
...config,
|
|
151
|
-
});
|
|
152
|
-
// Clean up on unmount
|
|
153
|
-
return () => {
|
|
154
|
-
pexelize.destroy();
|
|
155
|
-
sdkRef.current = null;
|
|
156
|
-
setIsEditorReady(false);
|
|
157
|
-
};
|
|
158
|
-
}, [sdkLoaded]);
|
|
159
|
-
// Handle ready event
|
|
61
|
+
}, []);
|
|
160
62
|
useEffect(() => {
|
|
161
|
-
|
|
162
|
-
if (!sdk)
|
|
63
|
+
if (!containerRef.current)
|
|
163
64
|
return;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
65
|
+
let mounted = true;
|
|
66
|
+
const initEditor = async () => {
|
|
67
|
+
try {
|
|
68
|
+
const pexelize = await loadSDK();
|
|
69
|
+
if (!mounted)
|
|
70
|
+
return;
|
|
71
|
+
const editorConfig = contentType === "module"
|
|
72
|
+
? { ...options.editor, contentType, minRows: 1, maxRows: 1 }
|
|
73
|
+
: options.editor;
|
|
74
|
+
const config = {
|
|
75
|
+
containerId: containerId.current,
|
|
76
|
+
editorId,
|
|
77
|
+
apiKey,
|
|
78
|
+
...options,
|
|
79
|
+
...(templateId !== undefined && { templateId }),
|
|
80
|
+
...(design !== undefined && { design }),
|
|
81
|
+
...(editorMode !== undefined && { editorMode }),
|
|
82
|
+
...(ai !== undefined && { ai }),
|
|
83
|
+
...(editorConfig && { editor: editorConfig }),
|
|
84
|
+
};
|
|
85
|
+
pexelize.init(config);
|
|
86
|
+
editorInstanceRef.current = pexelize;
|
|
87
|
+
const unsubscribeReady = pexelize.addEventListener("editor:ready", handleReady);
|
|
88
|
+
eventUnsubscribersRef.current.push(unsubscribeReady);
|
|
89
|
+
const unsubscribeLoad = pexelize.addEventListener("design:loaded", () => onLoadRef.current?.());
|
|
90
|
+
eventUnsubscribersRef.current.push(unsubscribeLoad);
|
|
91
|
+
const unsubscribeChange = pexelize.addEventListener("design:updated", (data) => onChangeRef.current?.(data));
|
|
92
|
+
eventUnsubscribersRef.current.push(unsubscribeChange);
|
|
169
93
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
94
|
+
catch (err) {
|
|
95
|
+
if (!mounted)
|
|
96
|
+
return;
|
|
97
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
98
|
+
onErrorRef.current?.(error);
|
|
173
99
|
}
|
|
174
|
-
// Load initial design if provided
|
|
175
|
-
if (design) {
|
|
176
|
-
sdk.loadDesign(design);
|
|
177
|
-
}
|
|
178
|
-
// Call onReady callback
|
|
179
|
-
onReady?.();
|
|
180
100
|
};
|
|
181
|
-
|
|
182
|
-
return unsubscribe;
|
|
183
|
-
}, [sdkLoaded, design, mergeTags, displayConditions, onReady]);
|
|
184
|
-
// Handle design loaded event
|
|
185
|
-
useEffect(() => {
|
|
186
|
-
const sdk = sdkRef.current;
|
|
187
|
-
if (!sdk || !onLoad)
|
|
188
|
-
return;
|
|
189
|
-
const unsubscribe = sdk.addEventListener('design:loaded', onLoad);
|
|
190
|
-
return unsubscribe;
|
|
191
|
-
}, [sdkLoaded, onLoad]);
|
|
192
|
-
// Handle design updated event
|
|
193
|
-
useEffect(() => {
|
|
194
|
-
const sdk = sdkRef.current;
|
|
195
|
-
if (!sdk || !onChange)
|
|
196
|
-
return;
|
|
197
|
-
const unsubscribe = sdk.addEventListener('design:updated', onChange);
|
|
198
|
-
return unsubscribe;
|
|
199
|
-
}, [sdkLoaded, onChange]);
|
|
200
|
-
// Handle content modified event
|
|
201
|
-
useEffect(() => {
|
|
202
|
-
const sdk = sdkRef.current;
|
|
203
|
-
if (!sdk || !onContentModified)
|
|
204
|
-
return;
|
|
205
|
-
const unsubscribe = sdk.addEventListener('content:modified', onContentModified);
|
|
206
|
-
return unsubscribe;
|
|
207
|
-
}, [sdkLoaded, onContentModified]);
|
|
208
|
-
// Handle element selected event
|
|
209
|
-
useEffect(() => {
|
|
210
|
-
const sdk = sdkRef.current;
|
|
211
|
-
if (!sdk || !onSelect)
|
|
212
|
-
return;
|
|
213
|
-
const unsubscribe = sdk.addEventListener('element:selected', onSelect);
|
|
214
|
-
return unsubscribe;
|
|
215
|
-
}, [sdkLoaded, onSelect]);
|
|
216
|
-
// Handle element deselected event
|
|
217
|
-
useEffect(() => {
|
|
218
|
-
const sdk = sdkRef.current;
|
|
219
|
-
if (!sdk || !onDeselect)
|
|
220
|
-
return;
|
|
221
|
-
const unsubscribe = sdk.addEventListener('element:deselected', onDeselect);
|
|
222
|
-
return unsubscribe;
|
|
223
|
-
}, [sdkLoaded, onDeselect]);
|
|
224
|
-
// Register callbacks
|
|
225
|
-
useEffect(() => {
|
|
226
|
-
const sdk = sdkRef.current;
|
|
227
|
-
if (!sdk)
|
|
228
|
-
return;
|
|
229
|
-
if (onImage) {
|
|
230
|
-
sdk.registerCallback('image', onImage);
|
|
231
|
-
}
|
|
232
|
-
if (onLinkClick) {
|
|
233
|
-
sdk.registerCallback('linkClick', onLinkClick);
|
|
234
|
-
}
|
|
235
|
-
if (onSave) {
|
|
236
|
-
sdk.registerCallback('save', onSave);
|
|
237
|
-
}
|
|
101
|
+
initEditor();
|
|
238
102
|
return () => {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
103
|
+
mounted = false;
|
|
104
|
+
eventUnsubscribersRef.current.forEach((unsub) => {
|
|
105
|
+
try {
|
|
106
|
+
unsub();
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// ignore
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
eventUnsubscribersRef.current = [];
|
|
113
|
+
try {
|
|
114
|
+
editorInstanceRef.current?.destroy();
|
|
243
115
|
}
|
|
116
|
+
catch {
|
|
117
|
+
// ignore
|
|
118
|
+
}
|
|
119
|
+
editorInstanceRef.current = null;
|
|
120
|
+
setIsEditorReady(false);
|
|
244
121
|
};
|
|
245
|
-
}, [
|
|
246
|
-
// Expose SDK methods via ref
|
|
122
|
+
}, [editorId, apiKey, handleReady]);
|
|
247
123
|
useImperativeHandle(ref, () => ({
|
|
248
|
-
|
|
249
|
-
loadBlank: () => sdkRef.current?.loadBlank(),
|
|
250
|
-
saveDesign: (callback) => sdkRef.current?.saveDesign(callback),
|
|
251
|
-
getDesign: () => sdkRef.current?.getDesign(),
|
|
252
|
-
exportHtml: (callback) => sdkRef.current?.exportHtml(callback),
|
|
253
|
-
exportHtmlAsync: () => sdkRef.current?.exportHtmlAsync(),
|
|
254
|
-
save: () => sdkRef.current?.save(),
|
|
255
|
-
undo: () => sdkRef.current?.undo(),
|
|
256
|
-
redo: () => sdkRef.current?.redo(),
|
|
257
|
-
getState: () => sdkRef.current?.getState(),
|
|
124
|
+
editor: editorInstanceRef.current,
|
|
258
125
|
isReady: () => isEditorReady,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
// Compute styles
|
|
126
|
+
}), [isEditorReady]);
|
|
127
|
+
const effectiveHeight = height ?? minHeight;
|
|
262
128
|
const containerStyle = {
|
|
263
|
-
width:
|
|
264
|
-
height: typeof
|
|
129
|
+
width: "100%",
|
|
130
|
+
height: typeof effectiveHeight === "number"
|
|
131
|
+
? `${effectiveHeight}px`
|
|
132
|
+
: effectiveHeight,
|
|
265
133
|
...style,
|
|
266
134
|
};
|
|
267
|
-
|
|
268
|
-
if (error) {
|
|
269
|
-
return (jsx("div", { style: { ...containerStyle, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#fee', color: '#c00' }, children: jsxs("div", { style: { textAlign: 'center' }, children: [jsx("div", { style: { fontSize: '24px', marginBottom: '8px' }, children: "\u26A0\uFE0F" }), jsx("div", { children: "Failed to load Pexelize Editor" }), jsx("div", { style: { fontSize: '12px', marginTop: '4px' }, children: error })] }) }));
|
|
270
|
-
}
|
|
271
|
-
// Show loading state
|
|
272
|
-
if (!sdkLoaded) {
|
|
273
|
-
return (jsx("div", { style: { ...containerStyle, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#f5f5f5' }, children: jsxs("div", { style: { textAlign: 'center' }, children: [jsx("div", { style: { fontSize: '24px', marginBottom: '8px' }, children: "\u23F3" }), jsx("div", { children: "Loading Pexelize Editor..." })] }) }));
|
|
274
|
-
}
|
|
275
|
-
return (jsx("div", { id: containerId.current, ref: containerRef, className: className, style: containerStyle }));
|
|
135
|
+
return (jsx("div", { className: className, style: containerStyle, children: jsx("div", { id: containerId.current, ref: containerRef, style: { width: "100%", height: "100%" } }) }));
|
|
276
136
|
});
|
|
277
|
-
PexelizeEditor.displayName =
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
*
|
|
281
|
-
* @example
|
|
282
|
-
* ```tsx
|
|
283
|
-
* function MyComponent() {
|
|
284
|
-
* const { sdk, isReady, error } = usePexelizeSDK({
|
|
285
|
-
* containerId: 'my-editor',
|
|
286
|
-
* editorMode: 'email',
|
|
287
|
-
* });
|
|
288
|
-
*
|
|
289
|
-
* const handleExport = () => {
|
|
290
|
-
* if (isReady && sdk) {
|
|
291
|
-
* sdk.exportHtml((data) => console.log(data.html));
|
|
292
|
-
* }
|
|
293
|
-
* };
|
|
294
|
-
*
|
|
295
|
-
* return (
|
|
296
|
-
* <div>
|
|
297
|
-
* <div id="my-editor" style={{ height: '600px' }} />
|
|
298
|
-
* <button onClick={handleExport} disabled={!isReady}>Export</button>
|
|
299
|
-
* </div>
|
|
300
|
-
* );
|
|
301
|
-
* }
|
|
302
|
-
* ```
|
|
303
|
-
*/
|
|
304
|
-
function usePexelizeSDK(config) {
|
|
305
|
-
const sdkRef = useRef(null);
|
|
137
|
+
PexelizeEditor.displayName = "PexelizeEditor";
|
|
138
|
+
function usePexelizeEditor() {
|
|
139
|
+
const ref = useRef(null);
|
|
306
140
|
const [isReady, setIsReady] = useState(false);
|
|
307
|
-
const [sdkLoaded, setSdkLoaded] = useState(false);
|
|
308
|
-
const [error, setError] = useState(null);
|
|
309
|
-
// Load SDK from CDN
|
|
310
|
-
useEffect(() => {
|
|
311
|
-
loadSDKFromCDN(SDK_CDN_URL)
|
|
312
|
-
.then(() => setSdkLoaded(true))
|
|
313
|
-
.catch((err) => setError(err.message));
|
|
314
|
-
}, []);
|
|
315
|
-
// Initialize SDK
|
|
316
141
|
useEffect(() => {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
if (!pexelize) {
|
|
321
|
-
setError('Pexelize SDK not found');
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
sdkRef.current = pexelize;
|
|
325
|
-
pexelize.init({
|
|
326
|
-
id: config.containerId,
|
|
327
|
-
editorMode: config.editorMode || config.displayMode || 'email',
|
|
328
|
-
...config,
|
|
329
|
-
});
|
|
330
|
-
const unsubscribe = pexelize.addEventListener('editor:ready', () => {
|
|
331
|
-
setIsReady(true);
|
|
332
|
-
});
|
|
333
|
-
return () => {
|
|
334
|
-
unsubscribe();
|
|
335
|
-
pexelize.destroy();
|
|
336
|
-
sdkRef.current = null;
|
|
337
|
-
setIsReady(false);
|
|
142
|
+
const checkReady = () => {
|
|
143
|
+
const ready = ref.current?.isReady() ?? false;
|
|
144
|
+
setIsReady(ready);
|
|
338
145
|
};
|
|
339
|
-
|
|
146
|
+
checkReady();
|
|
147
|
+
const interval = setInterval(checkReady, 100);
|
|
148
|
+
return () => clearInterval(interval);
|
|
149
|
+
}, []);
|
|
340
150
|
return {
|
|
341
|
-
|
|
151
|
+
ref,
|
|
152
|
+
editor: ref.current?.editor ?? null,
|
|
342
153
|
isReady,
|
|
343
|
-
isLoading: !sdkLoaded && !error,
|
|
344
|
-
error,
|
|
345
154
|
};
|
|
346
155
|
}
|
|
347
|
-
// Export SDK CDN URL for reference
|
|
348
|
-
const PEXELIZE_SDK_CDN = SDK_CDN_URL;
|
|
349
156
|
|
|
350
|
-
export {
|
|
157
|
+
export { PexelizeEditor, PexelizeEditor as default, usePexelizeEditor };
|
|
351
158
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/index.tsx"],"sourcesContent":[null],"names":["_jsx"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;AAwDA,MAAM,WAAW,GAAG,qDAAqD;AAEzE,IAAI,cAAc,GAAgC,IAAI;AAEtD,SAAS,OAAO,GAAA;AACd,IAAA,IAAI,cAAc;AAAE,QAAA,OAAO,cAAc;IACzC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,EAAE;QACpD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;IACzC;IAEA,cAAc,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;QAC/C,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;AAC/C,QAAA,MAAM,CAAC,GAAG,GAAG,WAAW;AACxB,QAAA,MAAM,CAAC,KAAK,GAAG,IAAI;AAEnB,QAAA,MAAM,CAAC,MAAM,GAAG,MAAK;AACnB,YAAA,IAAI,MAAM,CAAC,QAAQ,EAAE;AACnB,gBAAA,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC1B;iBAAO;gBACL,cAAc,GAAG,IAAI;AACrB,gBAAA,MAAM,CAAC,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;YAClD;AACF,QAAA,CAAC;AAED,QAAA,MAAM,CAAC,OAAO,GAAG,MAAK;YACpB,cAAc,GAAG,IAAI;AACrB,YAAA,MAAM,CAAC,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAClD,QAAA,CAAC;AAED,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;AACnC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