@topol.io/editor-react 0.2.0 → 0.3.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/dist/topol-editor-react.es.js +189 -150
- package/dist/topol-editor-react.umd.js +9 -9
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import xe, { useEffect as Oe } from "react";
|
|
2
|
+
var _ = { exports: {} }, k = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -9,14 +9,14 @@ var A = { exports: {} }, P = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
12
|
+
var ge;
|
|
13
|
+
function je() {
|
|
14
|
+
if (ge) return k;
|
|
15
|
+
ge = 1;
|
|
16
16
|
var o = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
|
|
17
17
|
function c(r, i, f) {
|
|
18
|
-
var
|
|
19
|
-
if (f !== void 0 && (
|
|
18
|
+
var v = null;
|
|
19
|
+
if (f !== void 0 && (v = "" + f), i.key !== void 0 && (v = "" + i.key), "key" in i) {
|
|
20
20
|
f = {};
|
|
21
21
|
for (var y in i)
|
|
22
22
|
y !== "key" && (f[y] = i[y]);
|
|
@@ -24,14 +24,14 @@ function Oe() {
|
|
|
24
24
|
return i = f.ref, {
|
|
25
25
|
$$typeof: o,
|
|
26
26
|
type: r,
|
|
27
|
-
key:
|
|
27
|
+
key: v,
|
|
28
28
|
ref: i !== void 0 ? i : null,
|
|
29
29
|
props: f
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return k.Fragment = l, k.jsx = c, k.jsxs = c, k;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var A = {};
|
|
35
35
|
/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.development.js
|
|
@@ -42,21 +42,21 @@ var R = {};
|
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
44
|
var ve;
|
|
45
|
-
function
|
|
45
|
+
function Ne() {
|
|
46
46
|
return ve || (ve = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
47
|
function o(e) {
|
|
48
48
|
if (e == null) return null;
|
|
49
49
|
if (typeof e == "function")
|
|
50
|
-
return e.$$typeof ===
|
|
50
|
+
return e.$$typeof === Re ? null : e.displayName || e.name || null;
|
|
51
51
|
if (typeof e == "string") return e;
|
|
52
52
|
switch (e) {
|
|
53
53
|
case N:
|
|
54
54
|
return "Fragment";
|
|
55
|
-
case
|
|
55
|
+
case ke:
|
|
56
56
|
return "Portal";
|
|
57
|
-
case
|
|
57
|
+
case Z:
|
|
58
58
|
return "Profiler";
|
|
59
|
-
case
|
|
59
|
+
case X:
|
|
60
60
|
return "StrictMode";
|
|
61
61
|
case B:
|
|
62
62
|
return "Suspense";
|
|
@@ -67,9 +67,9 @@ function je() {
|
|
|
67
67
|
switch (typeof e.tag == "number" && console.error(
|
|
68
68
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
69
|
), e.$$typeof) {
|
|
70
|
-
case
|
|
70
|
+
case K:
|
|
71
71
|
return (e.displayName || "Context") + ".Provider";
|
|
72
|
-
case
|
|
72
|
+
case Q:
|
|
73
73
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
74
74
|
case M:
|
|
75
75
|
var t = e.render;
|
|
@@ -108,8 +108,8 @@ function je() {
|
|
|
108
108
|
function r() {
|
|
109
109
|
}
|
|
110
110
|
function i() {
|
|
111
|
-
if (
|
|
112
|
-
|
|
111
|
+
if (P === 0) {
|
|
112
|
+
oe = console.log, te = console.info, ne = console.warn, re = console.error, ae = console.group, ie = console.groupCollapsed, le = console.groupEnd;
|
|
113
113
|
var e = {
|
|
114
114
|
configurable: !0,
|
|
115
115
|
enumerable: !0,
|
|
@@ -126,42 +126,42 @@ function je() {
|
|
|
126
126
|
groupEnd: e
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
|
|
129
|
+
P++;
|
|
130
130
|
}
|
|
131
131
|
function f() {
|
|
132
|
-
if (
|
|
132
|
+
if (P--, P === 0) {
|
|
133
133
|
var e = { configurable: !0, enumerable: !0, writable: !0 };
|
|
134
134
|
Object.defineProperties(console, {
|
|
135
|
-
log: b({}, e, { value:
|
|
136
|
-
info: b({}, e, { value:
|
|
137
|
-
warn: b({}, e, { value:
|
|
138
|
-
error: b({}, e, { value:
|
|
139
|
-
group: b({}, e, { value:
|
|
140
|
-
groupCollapsed: b({}, e, { value:
|
|
141
|
-
groupEnd: b({}, e, { value:
|
|
135
|
+
log: b({}, e, { value: oe }),
|
|
136
|
+
info: b({}, e, { value: te }),
|
|
137
|
+
warn: b({}, e, { value: ne }),
|
|
138
|
+
error: b({}, e, { value: re }),
|
|
139
|
+
group: b({}, e, { value: ae }),
|
|
140
|
+
groupCollapsed: b({}, e, { value: ie }),
|
|
141
|
+
groupEnd: b({}, e, { value: le })
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
0 >
|
|
144
|
+
0 > P && console.error(
|
|
145
145
|
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
if (
|
|
148
|
+
function v(e) {
|
|
149
|
+
if (U === void 0)
|
|
150
150
|
try {
|
|
151
151
|
throw Error();
|
|
152
152
|
} catch (n) {
|
|
153
153
|
var t = n.stack.trim().match(/\n( *(at )?)/);
|
|
154
|
-
|
|
154
|
+
U = t && t[1] || "", ue = -1 < n.stack.indexOf(`
|
|
155
155
|
at`) ? " (<anonymous>)" : -1 < n.stack.indexOf("@") ? "@unknown:0:0" : "";
|
|
156
156
|
}
|
|
157
157
|
return `
|
|
158
|
-
` +
|
|
158
|
+
` + U + e + ue;
|
|
159
159
|
}
|
|
160
160
|
function y(e, t) {
|
|
161
|
-
if (!e ||
|
|
162
|
-
var n =
|
|
161
|
+
if (!e || z) return "";
|
|
162
|
+
var n = H.get(e);
|
|
163
163
|
if (n !== void 0) return n;
|
|
164
|
-
|
|
164
|
+
z = !0, n = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
|
|
165
165
|
var u = null;
|
|
166
166
|
u = T.H, T.H = null, i();
|
|
167
167
|
try {
|
|
@@ -169,40 +169,40 @@ function je() {
|
|
|
169
169
|
DetermineComponentFrameRoot: function() {
|
|
170
170
|
try {
|
|
171
171
|
if (t) {
|
|
172
|
-
var
|
|
172
|
+
var E = function() {
|
|
173
173
|
throw Error();
|
|
174
174
|
};
|
|
175
|
-
if (Object.defineProperty(
|
|
175
|
+
if (Object.defineProperty(E.prototype, "props", {
|
|
176
176
|
set: function() {
|
|
177
177
|
throw Error();
|
|
178
178
|
}
|
|
179
179
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
180
180
|
try {
|
|
181
|
-
Reflect.construct(
|
|
182
|
-
} catch (
|
|
183
|
-
var
|
|
181
|
+
Reflect.construct(E, []);
|
|
182
|
+
} catch (w) {
|
|
183
|
+
var R = w;
|
|
184
184
|
}
|
|
185
|
-
Reflect.construct(e, [],
|
|
185
|
+
Reflect.construct(e, [], E);
|
|
186
186
|
} else {
|
|
187
187
|
try {
|
|
188
|
-
|
|
189
|
-
} catch (
|
|
190
|
-
|
|
188
|
+
E.call();
|
|
189
|
+
} catch (w) {
|
|
190
|
+
R = w;
|
|
191
191
|
}
|
|
192
|
-
e.call(
|
|
192
|
+
e.call(E.prototype);
|
|
193
193
|
}
|
|
194
194
|
} else {
|
|
195
195
|
try {
|
|
196
196
|
throw Error();
|
|
197
|
-
} catch (
|
|
198
|
-
|
|
197
|
+
} catch (w) {
|
|
198
|
+
R = w;
|
|
199
199
|
}
|
|
200
|
-
(
|
|
200
|
+
(E = e()) && typeof E.catch == "function" && E.catch(function() {
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
} catch (
|
|
204
|
-
if (
|
|
205
|
-
return [
|
|
203
|
+
} catch (w) {
|
|
204
|
+
if (w && R && typeof w.stack == "string")
|
|
205
|
+
return [w.stack, R.stack];
|
|
206
206
|
}
|
|
207
207
|
return [null, null];
|
|
208
208
|
}
|
|
@@ -217,12 +217,12 @@ function je() {
|
|
|
217
217
|
"name",
|
|
218
218
|
{ value: "DetermineComponentFrameRoot" }
|
|
219
219
|
);
|
|
220
|
-
var a = d.DetermineComponentFrameRoot(),
|
|
221
|
-
if (
|
|
222
|
-
var
|
|
220
|
+
var a = d.DetermineComponentFrameRoot(), m = a[0], C = a[1];
|
|
221
|
+
if (m && C) {
|
|
222
|
+
var g = m.split(`
|
|
223
223
|
`), h = C.split(`
|
|
224
224
|
`);
|
|
225
|
-
for (a = s = 0; s <
|
|
225
|
+
for (a = s = 0; s < g.length && !g[s].includes(
|
|
226
226
|
"DetermineComponentFrameRoot"
|
|
227
227
|
); )
|
|
228
228
|
s++;
|
|
@@ -230,31 +230,31 @@ function je() {
|
|
|
230
230
|
"DetermineComponentFrameRoot"
|
|
231
231
|
); )
|
|
232
232
|
a++;
|
|
233
|
-
if (s ===
|
|
234
|
-
for (s =
|
|
233
|
+
if (s === g.length || a === h.length)
|
|
234
|
+
for (s = g.length - 1, a = h.length - 1; 1 <= s && 0 <= a && g[s] !== h[a]; )
|
|
235
235
|
a--;
|
|
236
236
|
for (; 1 <= s && 0 <= a; s--, a--)
|
|
237
|
-
if (
|
|
237
|
+
if (g[s] !== h[a]) {
|
|
238
238
|
if (s !== 1 || a !== 1)
|
|
239
239
|
do
|
|
240
|
-
if (s--, a--, 0 > a ||
|
|
241
|
-
var
|
|
242
|
-
` +
|
|
240
|
+
if (s--, a--, 0 > a || g[s] !== h[a]) {
|
|
241
|
+
var S = `
|
|
242
|
+
` + g[s].replace(
|
|
243
243
|
" at new ",
|
|
244
244
|
" at "
|
|
245
245
|
);
|
|
246
|
-
return e.displayName &&
|
|
246
|
+
return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && H.set(e, S), S;
|
|
247
247
|
}
|
|
248
248
|
while (1 <= s && 0 <= a);
|
|
249
249
|
break;
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
} finally {
|
|
253
|
-
|
|
253
|
+
z = !1, T.H = u, f(), Error.prepareStackTrace = n;
|
|
254
254
|
}
|
|
255
|
-
return
|
|
255
|
+
return g = (g = e ? e.displayName || e.name : "") ? v(g) : "", typeof e == "function" && H.set(e, g), g;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function p(e) {
|
|
258
258
|
if (e == null) return "";
|
|
259
259
|
if (typeof e == "function") {
|
|
260
260
|
var t = e.prototype;
|
|
@@ -263,42 +263,42 @@ function je() {
|
|
|
263
263
|
!(!t || !t.isReactComponent)
|
|
264
264
|
);
|
|
265
265
|
}
|
|
266
|
-
if (typeof e == "string") return
|
|
266
|
+
if (typeof e == "string") return v(e);
|
|
267
267
|
switch (e) {
|
|
268
268
|
case B:
|
|
269
|
-
return
|
|
269
|
+
return v("Suspense");
|
|
270
270
|
case Y:
|
|
271
|
-
return
|
|
271
|
+
return v("SuspenseList");
|
|
272
272
|
}
|
|
273
273
|
if (typeof e == "object")
|
|
274
274
|
switch (e.$$typeof) {
|
|
275
275
|
case M:
|
|
276
276
|
return e = y(e.render, !1), e;
|
|
277
277
|
case W:
|
|
278
|
-
return
|
|
278
|
+
return p(e.type);
|
|
279
279
|
case $:
|
|
280
280
|
t = e._payload, e = e._init;
|
|
281
281
|
try {
|
|
282
|
-
return
|
|
282
|
+
return p(e(t));
|
|
283
283
|
} catch {
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
return "";
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function x() {
|
|
289
289
|
var e = T.A;
|
|
290
290
|
return e === null ? null : e.getOwner();
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
if (
|
|
292
|
+
function be(e) {
|
|
293
|
+
if (ee.call(e, "key")) {
|
|
294
294
|
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
295
295
|
if (t && t.isReactWarning) return !1;
|
|
296
296
|
}
|
|
297
297
|
return e.key !== void 0;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function he(e, t) {
|
|
300
300
|
function n() {
|
|
301
|
-
|
|
301
|
+
se || (se = !0, console.error(
|
|
302
302
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
303
303
|
t
|
|
304
304
|
));
|
|
@@ -308,22 +308,22 @@ function je() {
|
|
|
308
308
|
configurable: !0
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function ye() {
|
|
312
312
|
var e = o(this.type);
|
|
313
|
-
return
|
|
313
|
+
return ce[e] || (ce[e] = !0, console.error(
|
|
314
314
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
315
315
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function Ce(e, t, n, u, d, s) {
|
|
318
318
|
return n = s.ref, e = {
|
|
319
|
-
$$typeof:
|
|
319
|
+
$$typeof: j,
|
|
320
320
|
type: e,
|
|
321
321
|
key: t,
|
|
322
322
|
props: s,
|
|
323
323
|
_owner: d
|
|
324
324
|
}, (n !== void 0 ? n : null) !== null ? Object.defineProperty(e, "ref", {
|
|
325
325
|
enumerable: !1,
|
|
326
|
-
get:
|
|
326
|
+
get: ye
|
|
327
327
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
328
328
|
configurable: !1,
|
|
329
329
|
enumerable: !1,
|
|
@@ -336,32 +336,32 @@ function je() {
|
|
|
336
336
|
value: null
|
|
337
337
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
if (typeof e == "string" || typeof e == "function" || e === N || e ===
|
|
339
|
+
function I(e, t, n, u, d, s) {
|
|
340
|
+
if (typeof e == "string" || typeof e == "function" || e === N || e === Z || e === X || e === B || e === Y || e === Ae || typeof e == "object" && e !== null && (e.$$typeof === $ || e.$$typeof === W || e.$$typeof === K || e.$$typeof === Q || e.$$typeof === M || e.$$typeof === _e || e.getModuleId !== void 0)) {
|
|
341
341
|
var a = t.children;
|
|
342
342
|
if (a !== void 0)
|
|
343
343
|
if (u)
|
|
344
|
-
if (
|
|
344
|
+
if (L(a)) {
|
|
345
345
|
for (u = 0; u < a.length; u++)
|
|
346
|
-
|
|
346
|
+
J(a[u], e);
|
|
347
347
|
Object.freeze && Object.freeze(a);
|
|
348
348
|
} else
|
|
349
349
|
console.error(
|
|
350
350
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
351
351
|
);
|
|
352
|
-
else
|
|
352
|
+
else J(a, e);
|
|
353
353
|
} else
|
|
354
|
-
a = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? u = "null" :
|
|
354
|
+
a = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? u = "null" : L(e) ? u = "array" : e !== void 0 && e.$$typeof === j ? (u = "<" + (o(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : u = typeof e, console.error(
|
|
355
355
|
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
|
356
356
|
u,
|
|
357
357
|
a
|
|
358
358
|
);
|
|
359
|
-
if (
|
|
359
|
+
if (ee.call(t, "key")) {
|
|
360
360
|
a = o(e);
|
|
361
|
-
var
|
|
362
|
-
return
|
|
361
|
+
var m = Object.keys(t).filter(function(g) {
|
|
362
|
+
return g !== "key";
|
|
363
363
|
});
|
|
364
|
-
u = 0 <
|
|
364
|
+
u = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", fe[a + u] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
365
365
|
`A props object containing a "key" prop is being spread into JSX:
|
|
366
366
|
let props = %s;
|
|
367
367
|
<%s {...props} />
|
|
@@ -370,45 +370,45 @@ React keys must be passed directly to JSX without using spread:
|
|
|
370
370
|
<%s key={someKey} {...props} />`,
|
|
371
371
|
u,
|
|
372
372
|
a,
|
|
373
|
-
|
|
373
|
+
m,
|
|
374
374
|
a
|
|
375
|
-
),
|
|
375
|
+
), fe[a + u] = !0);
|
|
376
376
|
}
|
|
377
|
-
if (a = null, n !== void 0 && (c(n), a = "" + n),
|
|
377
|
+
if (a = null, n !== void 0 && (c(n), a = "" + n), be(t) && (c(t.key), a = "" + t.key), "key" in t) {
|
|
378
378
|
n = {};
|
|
379
379
|
for (var C in t)
|
|
380
380
|
C !== "key" && (n[C] = t[C]);
|
|
381
381
|
} else n = t;
|
|
382
|
-
return a &&
|
|
382
|
+
return a && he(
|
|
383
383
|
n,
|
|
384
384
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
385
|
-
),
|
|
385
|
+
), Ce(e, a, s, d, x(), n);
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
if (typeof e == "object" && e && e.$$typeof !==
|
|
389
|
-
if (
|
|
387
|
+
function J(e, t) {
|
|
388
|
+
if (typeof e == "object" && e && e.$$typeof !== pe) {
|
|
389
|
+
if (L(e))
|
|
390
390
|
for (var n = 0; n < e.length; n++) {
|
|
391
391
|
var u = e[n];
|
|
392
|
-
|
|
392
|
+
O(u) && G(u, t);
|
|
393
393
|
}
|
|
394
|
-
else if (
|
|
394
|
+
else if (O(e))
|
|
395
395
|
e._store && (e._store.validated = 1);
|
|
396
|
-
else if (e === null || typeof e != "object" ? n = null : (n =
|
|
396
|
+
else if (e === null || typeof e != "object" ? n = null : (n = D && e[D] || e["@@iterator"], n = typeof n == "function" ? n : null), typeof n == "function" && n !== e.entries && (n = n.call(e), n !== e))
|
|
397
397
|
for (; !(e = n.next()).done; )
|
|
398
|
-
|
|
398
|
+
O(e.value) && G(e.value, t);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
401
|
+
function O(e) {
|
|
402
|
+
return typeof e == "object" && e !== null && e.$$typeof === j;
|
|
403
403
|
}
|
|
404
404
|
function G(e, t) {
|
|
405
|
-
if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, t =
|
|
406
|
-
|
|
405
|
+
if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, t = Pe(t), !de[t])) {
|
|
406
|
+
de[t] = !0;
|
|
407
407
|
var n = "";
|
|
408
|
-
e && e._owner != null && e._owner !==
|
|
408
|
+
e && e._owner != null && e._owner !== x() && (n = null, typeof e._owner.tag == "number" ? n = o(e._owner.type) : typeof e._owner.name == "string" && (n = e._owner.name), n = " It was passed a child from " + n + ".");
|
|
409
409
|
var u = T.getCurrentStack;
|
|
410
410
|
T.getCurrentStack = function() {
|
|
411
|
-
var d =
|
|
411
|
+
var d = p(e.type);
|
|
412
412
|
return u && (d += u() || ""), d;
|
|
413
413
|
}, console.error(
|
|
414
414
|
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
@@ -417,71 +417,89 @@ React keys must be passed directly to JSX without using spread:
|
|
|
417
417
|
), T.getCurrentStack = u;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
var t = "", n =
|
|
420
|
+
function Pe(e) {
|
|
421
|
+
var t = "", n = x();
|
|
422
422
|
return n && (n = o(n.type)) && (t = `
|
|
423
423
|
|
|
424
424
|
Check the render method of \`` + n + "`."), t || (e = o(e)) && (t = `
|
|
425
425
|
|
|
426
426
|
Check the top-level render call using <` + e + ">."), t;
|
|
427
427
|
}
|
|
428
|
-
var
|
|
428
|
+
var Se = xe, j = Symbol.for("react.transitional.element"), ke = Symbol.for("react.portal"), N = Symbol.for("react.fragment"), X = Symbol.for("react.strict_mode"), Z = Symbol.for("react.profiler"), Q = Symbol.for("react.consumer"), K = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), B = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), W = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), Ae = Symbol.for("react.offscreen"), D = Symbol.iterator, Re = Symbol.for("react.client.reference"), T = Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ee = Object.prototype.hasOwnProperty, b = Object.assign, _e = Symbol.for("react.client.reference"), L = Array.isArray, P = 0, oe, te, ne, re, ae, ie, le;
|
|
429
429
|
r.__reactDisabledLog = !0;
|
|
430
|
-
var
|
|
431
|
-
|
|
432
|
-
return
|
|
433
|
-
},
|
|
434
|
-
return
|
|
430
|
+
var U, ue, z = !1, H = new (typeof WeakMap == "function" ? WeakMap : Map)(), pe = Symbol.for("react.client.reference"), se, ce = {}, fe = {}, de = {};
|
|
431
|
+
A.Fragment = N, A.jsx = function(e, t, n, u, d) {
|
|
432
|
+
return I(e, t, n, !1, u, d);
|
|
433
|
+
}, A.jsxs = function(e, t, n, u, d) {
|
|
434
|
+
return I(e, t, n, !0, u, d);
|
|
435
435
|
};
|
|
436
|
-
}()),
|
|
436
|
+
}()), A;
|
|
437
437
|
}
|
|
438
|
-
var
|
|
439
|
-
function
|
|
440
|
-
return
|
|
438
|
+
var me;
|
|
439
|
+
function Me() {
|
|
440
|
+
return me || (me = 1, process.env.NODE_ENV === "production" ? _.exports = je() : _.exports = Ne()), _.exports;
|
|
441
441
|
}
|
|
442
|
-
var
|
|
443
|
-
function
|
|
442
|
+
var Be = Me();
|
|
443
|
+
function Ye(o) {
|
|
444
444
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
445
445
|
}
|
|
446
|
-
var
|
|
446
|
+
var We = function(o, l, c) {
|
|
447
447
|
var r = document.head || document.getElementsByTagName("head")[0], i = document.createElement("script");
|
|
448
448
|
typeof l == "function" && (c = l, l = {}), l = l || {}, c = c || function() {
|
|
449
|
-
}, i.type = l.type || "text/javascript", i.charset = l.charset || "utf8", i.async = "async" in l ? !!l.async : !0, i.src = o, l.attrs &&
|
|
450
|
-
var f = "onload" in i ?
|
|
451
|
-
f(i, c), i.onload ||
|
|
449
|
+
}, i.type = l.type || "text/javascript", i.charset = l.charset || "utf8", i.async = "async" in l ? !!l.async : !0, i.src = o, l.attrs && $e(i, l.attrs), l.text && (i.text = "" + l.text);
|
|
450
|
+
var f = "onload" in i ? we : Le;
|
|
451
|
+
f(i, c), i.onload || we(i, c), r.appendChild(i);
|
|
452
452
|
};
|
|
453
|
-
function
|
|
453
|
+
function $e(o, l) {
|
|
454
454
|
for (var c in l)
|
|
455
455
|
o.setAttribute(c, l[c]);
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function we(o, l) {
|
|
458
458
|
o.onload = function() {
|
|
459
459
|
this.onerror = this.onload = null, l(null, o);
|
|
460
460
|
}, o.onerror = function() {
|
|
461
461
|
this.onerror = this.onload = null, l(new Error("Failed to load " + this.src), o);
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function Le(o, l) {
|
|
465
465
|
o.onreadystatechange = function() {
|
|
466
466
|
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, l(null, o));
|
|
467
467
|
};
|
|
468
468
|
}
|
|
469
|
-
const
|
|
470
|
-
function
|
|
469
|
+
const Te = /* @__PURE__ */ Ye(We), F = "https://v3.email-assets.topol.io/loader/build.js", Ue = "https://v3.develop.email-assets.topol.io/loader/build.js", ze = "https://v3.develop.email-assets.topol.io/loader/build.js";
|
|
470
|
+
function He(o = "production") {
|
|
471
471
|
switch (o) {
|
|
472
472
|
case "dev":
|
|
473
|
-
return
|
|
473
|
+
return Ue;
|
|
474
474
|
case "staging":
|
|
475
|
-
return
|
|
475
|
+
return ze;
|
|
476
|
+
case "production":
|
|
477
|
+
return F;
|
|
476
478
|
default:
|
|
477
|
-
return
|
|
479
|
+
return `https://d10h8ga60f7b91.cloudfront.net/preview-app-${o}/loader/build.js`;
|
|
478
480
|
}
|
|
479
481
|
}
|
|
480
|
-
|
|
482
|
+
async function Ve(o) {
|
|
483
|
+
return new Promise((l, c) => {
|
|
484
|
+
Te(F, (r) => {
|
|
485
|
+
r !== null && c(r), window.TopolPlugin.init(o), l(!0);
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
const Ee = {
|
|
481
490
|
init: (o, l) => new Promise((c, r) => {
|
|
482
|
-
const i =
|
|
483
|
-
|
|
484
|
-
f !== null
|
|
491
|
+
const i = He(l == null ? void 0 : l.stage);
|
|
492
|
+
Te(i, async (f) => {
|
|
493
|
+
if (f !== null) {
|
|
494
|
+
if (i !== F)
|
|
495
|
+
try {
|
|
496
|
+
return await Ve(o), c(!0);
|
|
497
|
+
} catch (v) {
|
|
498
|
+
r(v);
|
|
499
|
+
}
|
|
500
|
+
r(f);
|
|
501
|
+
}
|
|
502
|
+
window.TopolPlugin.init(o), c(!0);
|
|
485
503
|
});
|
|
486
504
|
}),
|
|
487
505
|
save: () => {
|
|
@@ -546,10 +564,31 @@ const me = {
|
|
|
546
564
|
},
|
|
547
565
|
setTemplateName: (o) => {
|
|
548
566
|
window.TopolPlugin.setTemplateName(o);
|
|
567
|
+
},
|
|
568
|
+
toggleChatAI: () => {
|
|
569
|
+
window.TopolPlugin.toggleChatAI();
|
|
570
|
+
},
|
|
571
|
+
toggleAutosaves: () => {
|
|
572
|
+
window.TopolPlugin.toggleAutosaves();
|
|
573
|
+
},
|
|
574
|
+
toggleComments: () => {
|
|
575
|
+
window.TopolPlugin.toggleComments();
|
|
576
|
+
},
|
|
577
|
+
createLanguage: (o) => {
|
|
578
|
+
window.TopolPlugin.createLanguage(o);
|
|
579
|
+
},
|
|
580
|
+
setPrimaryLanguage: (o) => {
|
|
581
|
+
window.TopolPlugin.setPrimaryLanguage(o);
|
|
582
|
+
},
|
|
583
|
+
deleteLanguage: (o) => {
|
|
584
|
+
window.TopolPlugin.deleteLanguage(o);
|
|
585
|
+
},
|
|
586
|
+
selectLanguage: (o) => {
|
|
587
|
+
window.TopolPlugin.selectLanguage(o);
|
|
549
588
|
}
|
|
550
589
|
}, qe = "editor";
|
|
551
|
-
let
|
|
552
|
-
function
|
|
590
|
+
let V = !1, q = !1;
|
|
591
|
+
function Ie(o) {
|
|
553
592
|
const l = () => {
|
|
554
593
|
const c = {
|
|
555
594
|
onSave(r, i) {
|
|
@@ -577,7 +616,7 @@ function Je(o) {
|
|
|
577
616
|
o.onBlockEdit !== void 0 && o.onBlockEdit(r);
|
|
578
617
|
},
|
|
579
618
|
onInit() {
|
|
580
|
-
o.onInit !== void 0 && o.onInit(),
|
|
619
|
+
o.onInit !== void 0 && o.onInit(), V = !1, q = !0;
|
|
581
620
|
},
|
|
582
621
|
onUndoChange(r) {
|
|
583
622
|
o.onUndoChange !== void 0 && o.onUndoChange(r);
|
|
@@ -612,13 +651,13 @@ function Je(o) {
|
|
|
612
651
|
};
|
|
613
652
|
return { id: "#" + qe, ...o.options, callbacks: { ...c } };
|
|
614
653
|
};
|
|
615
|
-
return
|
|
616
|
-
|
|
654
|
+
return Oe(() => (V || (async () => {
|
|
655
|
+
V = !0;
|
|
617
656
|
const r = l();
|
|
618
|
-
await
|
|
657
|
+
await Ee.init(r, { stage: o.stage || "production" });
|
|
619
658
|
})(), () => {
|
|
620
|
-
|
|
621
|
-
}), []), /* @__PURE__ */
|
|
659
|
+
q && (Ee.destroy(), q = !1);
|
|
660
|
+
}), []), /* @__PURE__ */ Be.jsx(
|
|
622
661
|
"div",
|
|
623
662
|
{
|
|
624
663
|
id: "editor",
|
|
@@ -627,6 +666,6 @@ function Je(o) {
|
|
|
627
666
|
);
|
|
628
667
|
}
|
|
629
668
|
export {
|
|
630
|
-
|
|
631
|
-
|
|
669
|
+
Ee as TopolPlugin,
|
|
670
|
+
Ie as default
|
|
632
671
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(E,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],P):(E=typeof globalThis<"u"?globalThis:E||self,P(E["topol-editor-react"]={},E.React))})(this,function(E,P){"use strict";var A={exports:{}},k={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var X;function ye(){if(X)return k;X=1;var o=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function c(r,i,f){var v=null;if(f!==void 0&&(v=""+f),i.key!==void 0&&(v=""+i.key),"key"in i){f={};for(var C in i)C!=="key"&&(f[C]=i[C])}else f=i;return i=f.ref,{$$typeof:o,type:r,key:v,ref:i!==void 0?i:null,props:f}}return k.Fragment=l,k.jsx=c,k.jsxs=c,k}var R={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Z;function Pe(){return Z||(Z=1,process.env.NODE_ENV!=="production"&&function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ve?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case U:return"Fragment";case $e:return"Portal";case re:return"Profiler";case ne:return"StrictMode";case $:return"Suspense";case H:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case ie:return(e.displayName||"Context")+".Provider";case ae:return(e._context.displayName||"Context")+".Consumer";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:o(e.type)||"Memo";case F:t=e._payload,e=e._init;try{return o(e(t))}catch{}}return null}function l(e){return""+e}function c(e){try{l(e);var t=!1}catch{t=!0}if(t){t=console;var n=t.error,u=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),l(e)}}function r(){}function i(){if(_===0){se=console.log,ce=console.info,fe=console.warn,de=console.error,ge=console.group,ve=console.groupCollapsed,me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:r,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}_++}function f(){if(_--,_===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:h({},e,{value:se}),info:h({},e,{value:ce}),warn:h({},e,{value:fe}),error:h({},e,{value:de}),group:h({},e,{value:ge}),groupCollapsed:h({},e,{value:ve}),groupEnd:h({},e,{value:me})})}0>_&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function v(e){if(J===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);J=t&&t[1]||"",we=-1<n.stack.indexOf(`
|
|
18
18
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+
|
|
20
|
-
`),y=
|
|
21
|
-
`);for(a=s=0;s<
|
|
22
|
-
`+
|
|
19
|
+
`+J+e+we}function C(e,t){if(!e||q)return"";var n=G.get(e);if(n!==void 0)return n;q=!0,n=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var u=null;u=b.H,b.H=null,i();try{var d={DetermineComponentFrameRoot:function(){try{if(t){var T=function(){throw Error()};if(Object.defineProperty(T.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(T,[])}catch(w){var x=w}Reflect.construct(e,[],T)}else{try{T.call()}catch(w){x=w}e.call(T.prototype)}}else{try{throw Error()}catch(w){x=w}(T=e())&&typeof T.catch=="function"&&T.catch(function(){})}}catch(w){if(w&&x&&typeof w.stack=="string")return[w.stack,x.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=d.DetermineComponentFrameRoot(),m=a[0],S=a[1];if(m&&S){var g=m.split(`
|
|
20
|
+
`),y=S.split(`
|
|
21
|
+
`);for(a=s=0;s<g.length&&!g[s].includes("DetermineComponentFrameRoot");)s++;for(;a<y.length&&!y[a].includes("DetermineComponentFrameRoot");)a++;if(s===g.length||a===y.length)for(s=g.length-1,a=y.length-1;1<=s&&0<=a&&g[s]!==y[a];)a--;for(;1<=s&&0<=a;s--,a--)if(g[s]!==y[a]){if(s!==1||a!==1)do if(s--,a--,0>a||g[s]!==y[a]){var p=`
|
|
22
|
+
`+g[s].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),typeof e=="function"&&G.set(e,p),p}while(1<=s&&0<=a);break}}}finally{q=!1,b.H=u,f(),Error.prepareStackTrace=n}return g=(g=e?e.displayName||e.name:"")?v(g):"",typeof e=="function"&&G.set(e,g),g}function B(e){if(e==null)return"";if(typeof e=="function"){var t=e.prototype;return C(e,!(!t||!t.isReactComponent))}if(typeof e=="string")return v(e);switch(e){case $:return v("Suspense");case H:return v("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case z:return e=C(e.render,!1),e;case V:return B(e.type);case F:t=e._payload,e=e._init;try{return B(e(t))}catch{}}return""}function Y(){var e=b.A;return e===null?null:e.getOwner()}function Be(e){if(ue.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Ye(e,t){function n(){Ee||(Ee=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function We(){var e=o(this.type);return Te[e]||(Te[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function Le(e,t,n,u,d,s){return n=s.ref,e={$$typeof:L,type:e,key:t,props:s,_owner:d},(n!==void 0?n:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:We}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function ee(e,t,n,u,d,s){if(typeof e=="string"||typeof e=="function"||e===U||e===re||e===ne||e===$||e===H||e===He||typeof e=="object"&&e!==null&&(e.$$typeof===F||e.$$typeof===V||e.$$typeof===ie||e.$$typeof===ae||e.$$typeof===z||e.$$typeof===Fe||e.getModuleId!==void 0)){var a=t.children;if(a!==void 0)if(u)if(I(a)){for(u=0;u<a.length;u++)oe(a[u],e);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else oe(a,e)}else a="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?u="null":I(e)?u="array":e!==void 0&&e.$$typeof===L?(u="<"+(o(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a);if(ue.call(t,"key")){a=o(e);var m=Object.keys(t).filter(function(g){return g!=="key"});u=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",be[a+u]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
23
|
let props = %s;
|
|
24
24
|
<%s {...props} />
|
|
25
25
|
React keys must be passed directly to JSX without using spread:
|
|
26
26
|
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,u,a,
|
|
27
|
+
<%s key={someKey} {...props} />`,u,a,m,a),be[a+u]=!0)}if(a=null,n!==void 0&&(c(n),a=""+n),Be(t)&&(c(t.key),a=""+t.key),"key"in t){n={};for(var S in t)S!=="key"&&(n[S]=t[S])}else n=t;return a&&Ye(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),Le(e,a,s,d,Y(),n)}function oe(e,t){if(typeof e=="object"&&e&&e.$$typeof!==Ie){if(I(e))for(var n=0;n<e.length;n++){var u=e[n];W(u)&&te(u,t)}else if(W(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?n=null:(n=le&&e[le]||e["@@iterator"],n=typeof n=="function"?n:null),typeof n=="function"&&n!==e.entries&&(n=n.call(e),n!==e))for(;!(e=n.next()).done;)W(e.value)&&te(e.value,t)}}function W(e){return typeof e=="object"&&e!==null&&e.$$typeof===L}function te(e,t){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,t=Ue(t),!he[t])){he[t]=!0;var n="";e&&e._owner!=null&&e._owner!==Y()&&(n=null,typeof e._owner.tag=="number"?n=o(e._owner.type):typeof e._owner.name=="string"&&(n=e._owner.name),n=" It was passed a child from "+n+".");var u=b.getCurrentStack;b.getCurrentStack=function(){var d=B(e.type);return u&&(d+=u()||""),d},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',t,n),b.getCurrentStack=u}}function Ue(e){var t="",n=Y();return n&&(n=o(n.type))&&(t=`
|
|
28
28
|
|
|
29
29
|
Check the render method of \``+n+"`."),t||(e=o(e))&&(t=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+e+">."),t}var ze=
|
|
31
|
+
Check the top-level render call using <`+e+">."),t}var ze=P,L=Symbol.for("react.transitional.element"),$e=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),ae=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),He=Symbol.for("react.offscreen"),le=Symbol.iterator,Ve=Symbol.for("react.client.reference"),b=ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=Object.prototype.hasOwnProperty,h=Object.assign,Fe=Symbol.for("react.client.reference"),I=Array.isArray,_=0,se,ce,fe,de,ge,ve,me;r.__reactDisabledLog=!0;var J,we,q=!1,G=new(typeof WeakMap=="function"?WeakMap:Map),Ie=Symbol.for("react.client.reference"),Ee,Te={},be={},he={};R.Fragment=U,R.jsx=function(e,t,n,u,d){return ee(e,t,n,!1,u,d)},R.jsxs=function(e,t,n,u,d){return ee(e,t,n,!0,u,d)}}()),R}var Q;function Ce(){return Q||(Q=1,process.env.NODE_ENV==="production"?A.exports=ye():A.exports=Pe()),A.exports}var Se=Ce();function ke(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Re=function(o,l,c){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof l=="function"&&(c=l,l={}),l=l||{},c=c||function(){},i.type=l.type||"text/javascript",i.charset=l.charset||"utf8",i.async="async"in l?!!l.async:!0,i.src=o,l.attrs&&_e(i,l.attrs),l.text&&(i.text=""+l.text);var f="onload"in i?K:pe;f(i,c),i.onload||K(i,c),r.appendChild(i)};function _e(o,l){for(var c in l)o.setAttribute(c,l[c])}function K(o,l){o.onload=function(){this.onerror=this.onload=null,l(null,o)},o.onerror=function(){this.onerror=this.onload=null,l(new Error("Failed to load "+this.src),o)}}function pe(o,l){o.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,l(null,o))}}const D=ke(Re),j="https://v3.email-assets.topol.io/loader/build.js",Ae="https://v3.develop.email-assets.topol.io/loader/build.js",xe="https://v3.develop.email-assets.topol.io/loader/build.js";function je(o="production"){switch(o){case"dev":return Ae;case"staging":return xe;case"production":return j;default:return`https://d10h8ga60f7b91.cloudfront.net/preview-app-${o}/loader/build.js`}}async function Oe(o){return new Promise((l,c)=>{D(j,r=>{r!==null&&c(r),window.TopolPlugin.init(o),l(!0)})})}const O={init:(o,l)=>new Promise((c,r)=>{const i=je(l==null?void 0:l.stage);D(i,async f=>{if(f!==null){if(i!==j)try{return await Oe(o),c(!0)}catch(v){r(v)}r(f)}window.TopolPlugin.init(o),c(!0)})}),save:()=>{window.TopolPlugin.save()},load:o=>{window.TopolPlugin.load(o)},togglePreview:()=>{window.TopolPlugin.togglePreview()},togglePreviewSize:()=>{window.TopolPlugin.togglePreviewSize()},chooseFile:o=>{window.TopolPlugin.chooseFile(o)},undo:()=>{window.TopolPlugin.undo()},redo:()=>{window.TopolPlugin.redo()},destroy:()=>{window.TopolPlugin.destroy()},setSavedBlocks:o=>{window.TopolPlugin.setSavedBlocks(o)},setPreviewHTML:o=>{window.TopolPlugin.setPreviewHTML(o)},createNotification:o=>{window.TopolPlugin.createNotification(o)},setActiveMembers:o=>{window.TopolPlugin.setActiveMembers(o)},changeEmailToMobile:()=>{window.TopolPlugin.changeEmailToMobile()},changeEmailToDesktop:()=>{window.TopolPlugin.changeEmailToDesktop()},toggleBlocksAndStructuresVisibility:()=>{window.TopolPlugin.toggleBlocksAndStructuresVisibility()},updateCustomBlockContent:o=>{window.TopolPlugin.updateCustomBlockContent(o)},refreshComments:o=>{window.TopolPlugin.refreshComments(o)},refreshSyncedRows:()=>{window.TopolPlugin.refreshSyncedRows()},openPremadeTemplatesSelection:()=>{window.TopolPlugin.openPremadeTemplatesSelection()},updateApiAuthorizationHeader:o=>{window.TopolPlugin.updateApiAuthorizationHeader(o)},setTemplateName:o=>{window.TopolPlugin.setTemplateName(o)},toggleChatAI:()=>{window.TopolPlugin.toggleChatAI()},toggleAutosaves:()=>{window.TopolPlugin.toggleAutosaves()},toggleComments:()=>{window.TopolPlugin.toggleComments()},createLanguage:o=>{window.TopolPlugin.createLanguage(o)},setPrimaryLanguage:o=>{window.TopolPlugin.setPrimaryLanguage(o)},deleteLanguage:o=>{window.TopolPlugin.deleteLanguage(o)},selectLanguage:o=>{window.TopolPlugin.selectLanguage(o)}},Ne="editor";let N=!1,M=!1;function Me(o){const l=()=>{const c={onSave(r,i){o.onSave!==void 0&&o.onSave(r,i)},onSaveAndClose(r,i){o.onSaveAndClose!==void 0&&o.onSaveAndClose(r,i)},onTestSend(r,i,f){o.onTestSend!==void 0&&o.onTestSend(r,i,f)},onOpenFileManager(){o.onOpenFileManager!==void 0&&o.onOpenFileManager()},onLoaded(){o.onLoaded!==void 0&&o.onLoaded()},onBlockSave(r){o.onBlockSave!==void 0&&o.onBlockSave(r)},onBlockRemove(r){o.onBlockRemove!==void 0&&o.onBlockRemove(r)},onBlockEdit(r){o.onBlockEdit!==void 0&&o.onBlockEdit(r)},onInit(){o.onInit!==void 0&&o.onInit(),N=!1,M=!0},onUndoChange(r){o.onUndoChange!==void 0&&o.onUndoChange(r)},onRedoChange(r){o.onRedoChange!==void 0&&o.onRedoChange(r)},onPreview(r){o.onPreview!==void 0&&o.onPreview(r)},onAlert(r){o.onAlert!==void 0&&o.onAlert(r)},onClose(){o.onClose!==void 0&&o.onClose()},onEdittedWithoutSaveChanged(r){o.onEdittedWithoutSaveChanged!==void 0&&o.onEdittedWithoutSaveChanged(r)},onOpenCustomBlockDialog(r){o.onOpenCustomBlockDialog!==void 0&&o.onOpenCustomBlockDialog(r)},onTemplateRename(r){o.onTemplateRename!==void 0&&o.onTemplateRename(r)},updateTestingEmailAddresses(r){o.updateTestingEmailAddresses!==void 0&&o.updateTestingEmailAddresses(r)},onError(r,i){o.onError!==void 0&&o.onError(r,i)}};return{id:"#"+Ne,...o.options,callbacks:{...c}}};return P.useEffect(()=>(N||(async()=>{N=!0;const r=l();await O.init(r,{stage:o.stage||"production"})})(),()=>{M&&(O.destroy(),M=!1)}),[]),Se.jsx("div",{id:"editor",style:{position:"absolute",height:"100vh",width:"100%"}})}E.TopolPlugin=O,E.default=Me,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"email-react",
|
|
12
12
|
"email templates"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.3.0",
|
|
15
15
|
"author": "Topol.io",
|
|
16
16
|
"homepage": "https://topol.io",
|
|
17
17
|
"license": "Apache-2.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@topol.io/editor": "0.
|
|
33
|
+
"@topol.io/editor": "0.3.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^20.7.0",
|