@topol.io/editor-react 0.0.3 → 0.0.4
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.
|
@@ -12,7 +12,7 @@ var Z = { exports: {} }, F = {};
|
|
|
12
12
|
var _e;
|
|
13
13
|
function fr() {
|
|
14
14
|
return _e || (_e = 1, process.env.NODE_ENV !== "production" && function() {
|
|
15
|
-
var t = Oe, u = Symbol.for("react.element"), g = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"),
|
|
15
|
+
var t = Oe, u = Symbol.for("react.element"), g = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), _ = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), B = Symbol.for("react.offscreen"), Q = Symbol.iterator, ke = "@@iterator";
|
|
16
16
|
function xe(e) {
|
|
17
17
|
if (e === null || typeof e != "object")
|
|
18
18
|
return null;
|
|
@@ -40,7 +40,7 @@ function fr() {
|
|
|
40
40
|
var Ae = !1, De = !1, Fe = !1, Ie = !1, Be = !1, ee;
|
|
41
41
|
ee = Symbol.for("react.module.reference");
|
|
42
42
|
function Me(e) {
|
|
43
|
-
return !!(typeof e == "string" || typeof e == "function" || e === a || e ===
|
|
43
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === y || Be || e === f || e === C || e === E || Ie || e === B || Ae || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === R || e.$$typeof === j || e.$$typeof === _ || e.$$typeof === h || // This needs to include all possible module reference object
|
|
44
44
|
// types supported by any Flight configuration anywhere since
|
|
45
45
|
// we don't know which Flight build this will end up being used
|
|
46
46
|
// with.
|
|
@@ -56,7 +56,7 @@ function fr() {
|
|
|
56
56
|
function re(e) {
|
|
57
57
|
return e.displayName || "Context";
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function T(e) {
|
|
60
60
|
if (e == null)
|
|
61
61
|
return null;
|
|
62
62
|
if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -68,13 +68,13 @@ function fr() {
|
|
|
68
68
|
return "Fragment";
|
|
69
69
|
case g:
|
|
70
70
|
return "Portal";
|
|
71
|
-
case
|
|
71
|
+
case y:
|
|
72
72
|
return "Profiler";
|
|
73
73
|
case f:
|
|
74
74
|
return "StrictMode";
|
|
75
75
|
case C:
|
|
76
76
|
return "Suspense";
|
|
77
|
-
case
|
|
77
|
+
case E:
|
|
78
78
|
return "SuspenseList";
|
|
79
79
|
}
|
|
80
80
|
if (typeof e == "object")
|
|
@@ -89,11 +89,11 @@ function fr() {
|
|
|
89
89
|
return Le(e, e.render, "ForwardRef");
|
|
90
90
|
case R:
|
|
91
91
|
var o = e.displayName || null;
|
|
92
|
-
return o !== null ? o :
|
|
92
|
+
return o !== null ? o : T(e.type) || "Memo";
|
|
93
93
|
case P: {
|
|
94
94
|
var s = e, c = s._payload, l = s._init;
|
|
95
95
|
try {
|
|
96
|
-
return
|
|
96
|
+
return T(l(c));
|
|
97
97
|
} catch {
|
|
98
98
|
return null;
|
|
99
99
|
}
|
|
@@ -101,14 +101,14 @@ function fr() {
|
|
|
101
101
|
}
|
|
102
102
|
return null;
|
|
103
103
|
}
|
|
104
|
-
var S = Object.assign, A = 0,
|
|
104
|
+
var S = Object.assign, A = 0, te, ne, oe, ae, ie, le, ue;
|
|
105
105
|
function se() {
|
|
106
106
|
}
|
|
107
107
|
se.__reactDisabledLog = !0;
|
|
108
108
|
function $e() {
|
|
109
109
|
{
|
|
110
110
|
if (A === 0) {
|
|
111
|
-
|
|
111
|
+
te = console.log, ne = console.info, oe = console.warn, ae = console.error, ie = console.group, le = console.groupCollapsed, ue = console.groupEnd;
|
|
112
112
|
var e = {
|
|
113
113
|
configurable: !0,
|
|
114
114
|
enumerable: !0,
|
|
@@ -138,10 +138,10 @@ function fr() {
|
|
|
138
138
|
};
|
|
139
139
|
Object.defineProperties(console, {
|
|
140
140
|
log: S({}, e, {
|
|
141
|
-
value:
|
|
141
|
+
value: te
|
|
142
142
|
}),
|
|
143
143
|
info: S({}, e, {
|
|
144
|
-
value:
|
|
144
|
+
value: ne
|
|
145
145
|
}),
|
|
146
146
|
warn: S({}, e, {
|
|
147
147
|
value: oe
|
|
@@ -208,29 +208,29 @@ function fr() {
|
|
|
208
208
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
209
209
|
try {
|
|
210
210
|
Reflect.construct(l, []);
|
|
211
|
-
} catch (
|
|
212
|
-
o =
|
|
211
|
+
} catch (w) {
|
|
212
|
+
o = w;
|
|
213
213
|
}
|
|
214
214
|
Reflect.construct(e, [], l);
|
|
215
215
|
} else {
|
|
216
216
|
try {
|
|
217
217
|
l.call();
|
|
218
|
-
} catch (
|
|
219
|
-
o =
|
|
218
|
+
} catch (w) {
|
|
219
|
+
o = w;
|
|
220
220
|
}
|
|
221
221
|
e.call(l.prototype);
|
|
222
222
|
}
|
|
223
223
|
} else {
|
|
224
224
|
try {
|
|
225
225
|
throw Error();
|
|
226
|
-
} catch (
|
|
227
|
-
o =
|
|
226
|
+
} catch (w) {
|
|
227
|
+
o = w;
|
|
228
228
|
}
|
|
229
229
|
e();
|
|
230
230
|
}
|
|
231
|
-
} catch (
|
|
232
|
-
if (
|
|
233
|
-
for (var i =
|
|
231
|
+
} catch (w) {
|
|
232
|
+
if (w && o && typeof w.stack == "string") {
|
|
233
|
+
for (var i = w.stack.split(`
|
|
234
234
|
`), m = o.stack.split(`
|
|
235
235
|
`), d = i.length - 1, v = m.length - 1; d >= 1 && v >= 0 && i[d] !== m[v]; )
|
|
236
236
|
v--;
|
|
@@ -239,9 +239,9 @@ function fr() {
|
|
|
239
239
|
if (d !== 1 || v !== 1)
|
|
240
240
|
do
|
|
241
241
|
if (d--, v--, v < 0 || i[d] !== m[v]) {
|
|
242
|
-
var
|
|
242
|
+
var b = `
|
|
243
243
|
` + i[d].replace(" at new ", " at ");
|
|
244
|
-
return e.displayName &&
|
|
244
|
+
return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, b), b;
|
|
245
245
|
}
|
|
246
246
|
while (d >= 1 && v >= 0);
|
|
247
247
|
break;
|
|
@@ -250,8 +250,8 @@ function fr() {
|
|
|
250
250
|
} finally {
|
|
251
251
|
V = !1, N.current = c, We(), Error.prepareStackTrace = s;
|
|
252
252
|
}
|
|
253
|
-
var x = e ? e.displayName || e.name : "",
|
|
254
|
-
return typeof e == "function" && L.set(e,
|
|
253
|
+
var x = e ? e.displayName || e.name : "", we = x ? M(x) : "";
|
|
254
|
+
return typeof e == "function" && L.set(e, we), we;
|
|
255
255
|
}
|
|
256
256
|
function Ne(e, r, n) {
|
|
257
257
|
return ce(e, !1);
|
|
@@ -270,7 +270,7 @@ function fr() {
|
|
|
270
270
|
switch (e) {
|
|
271
271
|
case C:
|
|
272
272
|
return M("Suspense");
|
|
273
|
-
case
|
|
273
|
+
case E:
|
|
274
274
|
return M("SuspenseList");
|
|
275
275
|
}
|
|
276
276
|
if (typeof e == "object")
|
|
@@ -365,8 +365,8 @@ function fr() {
|
|
|
365
365
|
}
|
|
366
366
|
function Xe(e, r) {
|
|
367
367
|
if (typeof e.ref == "string" && D.current && r && D.current.stateNode !== r) {
|
|
368
|
-
var n =
|
|
369
|
-
q[n] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',
|
|
368
|
+
var n = T(D.current.type);
|
|
369
|
+
q[n] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', T(D.current.type), e.ref), q[n] = !0);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
function Ze(e, r) {
|
|
@@ -451,10 +451,10 @@ function fr() {
|
|
|
451
451
|
function H(e) {
|
|
452
452
|
return typeof e == "object" && e !== null && e.$$typeof === u;
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Ee() {
|
|
455
455
|
{
|
|
456
456
|
if (J.current) {
|
|
457
|
-
var e =
|
|
457
|
+
var e = T(J.current.type);
|
|
458
458
|
if (e)
|
|
459
459
|
return `
|
|
460
460
|
|
|
@@ -463,7 +463,7 @@ Check the render method of \`` + e + "`.";
|
|
|
463
463
|
return "";
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function tr(e) {
|
|
467
467
|
{
|
|
468
468
|
if (e !== void 0) {
|
|
469
469
|
var r = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
|
|
@@ -474,10 +474,10 @@ Check your code at ` + r + ":" + n + ".";
|
|
|
474
474
|
return "";
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
var
|
|
478
|
-
function
|
|
477
|
+
var be = {};
|
|
478
|
+
function nr(e) {
|
|
479
479
|
{
|
|
480
|
-
var r =
|
|
480
|
+
var r = Ee();
|
|
481
481
|
if (!r) {
|
|
482
482
|
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
483
483
|
n && (r = `
|
|
@@ -487,17 +487,17 @@ Check the top-level render call using <` + n + ">.");
|
|
|
487
487
|
return r;
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function ye(e, r) {
|
|
491
491
|
{
|
|
492
492
|
if (!e._store || e._store.validated || e.key != null)
|
|
493
493
|
return;
|
|
494
494
|
e._store.validated = !0;
|
|
495
|
-
var n =
|
|
496
|
-
if (
|
|
495
|
+
var n = nr(r);
|
|
496
|
+
if (be[n])
|
|
497
497
|
return;
|
|
498
|
-
|
|
498
|
+
be[n] = !0;
|
|
499
499
|
var o = "";
|
|
500
|
-
e && e._owner && e._owner !== J.current && (o = " It was passed a child from " +
|
|
500
|
+
e && e._owner && e._owner !== J.current && (o = " It was passed a child from " + T(e._owner.type) + "."), k(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, o), k(null);
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
function Re(e, r) {
|
|
@@ -507,7 +507,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
507
507
|
if (z(e))
|
|
508
508
|
for (var n = 0; n < e.length; n++) {
|
|
509
509
|
var o = e[n];
|
|
510
|
-
H(o) &&
|
|
510
|
+
H(o) && ye(o, r);
|
|
511
511
|
}
|
|
512
512
|
else if (H(e))
|
|
513
513
|
e._store && (e._store.validated = !0);
|
|
@@ -515,7 +515,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
515
515
|
var s = xe(e);
|
|
516
516
|
if (typeof s == "function" && s !== e.entries)
|
|
517
517
|
for (var c = s.call(e), l; !(l = c.next()).done; )
|
|
518
|
-
H(l.value) &&
|
|
518
|
+
H(l.value) && ye(l.value, r);
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
}
|
|
@@ -534,11 +534,11 @@ Check the top-level render call using <` + n + ">.");
|
|
|
534
534
|
else
|
|
535
535
|
return;
|
|
536
536
|
if (n) {
|
|
537
|
-
var o =
|
|
537
|
+
var o = T(r);
|
|
538
538
|
Ve(n, e.props, "prop", o, e);
|
|
539
539
|
} else if (r.PropTypes !== void 0 && !G) {
|
|
540
540
|
G = !0;
|
|
541
|
-
var s =
|
|
541
|
+
var s = T(r);
|
|
542
542
|
p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
543
543
|
}
|
|
544
544
|
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
@@ -556,41 +556,41 @@ Check the top-level render call using <` + n + ">.");
|
|
|
556
556
|
e.ref !== null && (k(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Te(e, r, n, o, s, c) {
|
|
560
560
|
{
|
|
561
561
|
var l = Me(e);
|
|
562
562
|
if (!l) {
|
|
563
563
|
var i = "";
|
|
564
564
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
565
|
-
var m =
|
|
566
|
-
m ? i += m : i +=
|
|
565
|
+
var m = tr(s);
|
|
566
|
+
m ? i += m : i += Ee();
|
|
567
567
|
var d;
|
|
568
|
-
e === null ? d = "null" : z(e) ? d = "array" : e !== void 0 && e.$$typeof === u ? (d = "<" + (
|
|
568
|
+
e === null ? d = "null" : z(e) ? d = "array" : e !== void 0 && e.$$typeof === u ? (d = "<" + (T(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, i);
|
|
569
569
|
}
|
|
570
570
|
var v = rr(e, r, n, s, c);
|
|
571
571
|
if (v == null)
|
|
572
572
|
return v;
|
|
573
573
|
if (l) {
|
|
574
|
-
var
|
|
575
|
-
if (
|
|
574
|
+
var b = r.children;
|
|
575
|
+
if (b !== void 0)
|
|
576
576
|
if (o)
|
|
577
|
-
if (z(
|
|
578
|
-
for (var x = 0; x <
|
|
579
|
-
Re(
|
|
580
|
-
Object.freeze && Object.freeze(
|
|
577
|
+
if (z(b)) {
|
|
578
|
+
for (var x = 0; x < b.length; x++)
|
|
579
|
+
Re(b[x], e);
|
|
580
|
+
Object.freeze && Object.freeze(b);
|
|
581
581
|
} else
|
|
582
582
|
p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
583
583
|
else
|
|
584
|
-
Re(
|
|
584
|
+
Re(b, e);
|
|
585
585
|
}
|
|
586
586
|
return e === a ? ar(v) : or(v), v;
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
function ir(e, r, n) {
|
|
590
|
-
return
|
|
590
|
+
return Te(e, r, n, !0);
|
|
591
591
|
}
|
|
592
592
|
function lr(e, r, n) {
|
|
593
|
-
return
|
|
593
|
+
return Te(e, r, n, !1);
|
|
594
594
|
}
|
|
595
595
|
var ur = lr, sr = ir;
|
|
596
596
|
F.Fragment = a, F.jsx = ur, F.jsxs = sr;
|
|
@@ -611,15 +611,15 @@ function dr() {
|
|
|
611
611
|
if (Pe)
|
|
612
612
|
return I;
|
|
613
613
|
Pe = 1;
|
|
614
|
-
var t = Oe, u = Symbol.for("react.element"), g = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, f = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
|
614
|
+
var t = Oe, u = Symbol.for("react.element"), g = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, f = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
615
615
|
function j(_, h, C) {
|
|
616
|
-
var
|
|
616
|
+
var E, R = {}, P = null, B = null;
|
|
617
617
|
C !== void 0 && (P = "" + C), h.key !== void 0 && (P = "" + h.key), h.ref !== void 0 && (B = h.ref);
|
|
618
|
-
for (
|
|
619
|
-
a.call(h,
|
|
618
|
+
for (E in h)
|
|
619
|
+
a.call(h, E) && !y.hasOwnProperty(E) && (R[E] = h[E]);
|
|
620
620
|
if (_ && _.defaultProps)
|
|
621
|
-
for (
|
|
622
|
-
R[
|
|
621
|
+
for (E in h = _.defaultProps, h)
|
|
622
|
+
R[E] === void 0 && (R[E] = h[E]);
|
|
623
623
|
return { $$typeof: u, type: _, key: P, ref: B, props: R, _owner: f.current };
|
|
624
624
|
}
|
|
625
625
|
return I.Fragment = g, I.jsx = j, I.jsxs = j, I;
|
|
@@ -633,8 +633,8 @@ var hr = function(t, u, g) {
|
|
|
633
633
|
var a = document.head || document.getElementsByTagName("head")[0], f = document.createElement("script");
|
|
634
634
|
typeof u == "function" && (g = u, u = {}), u = u || {}, g = g || function() {
|
|
635
635
|
}, f.type = u.type || "text/javascript", f.charset = u.charset || "utf8", f.async = "async" in u ? !!u.async : !0, f.src = t, u.attrs && pr(f, u.attrs), u.text && (f.text = "" + u.text);
|
|
636
|
-
var
|
|
637
|
-
|
|
636
|
+
var y = "onload" in f ? Se : mr;
|
|
637
|
+
y(f, g), f.onload || Se(f, g), a.appendChild(f);
|
|
638
638
|
};
|
|
639
639
|
function pr(t, u) {
|
|
640
640
|
for (var g in u)
|
|
@@ -652,22 +652,22 @@ function mr(t, u) {
|
|
|
652
652
|
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, u(null, t));
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
|
-
const
|
|
656
|
-
function
|
|
655
|
+
const Er = /* @__PURE__ */ gr(hr), br = "https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js", yr = "https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js", Rr = "https://d5aoblv5p04cg.cloudfront.net/staging/loader/build.js";
|
|
656
|
+
function Tr(t = "production") {
|
|
657
657
|
switch (t) {
|
|
658
658
|
case "dev":
|
|
659
|
-
return
|
|
659
|
+
return yr;
|
|
660
660
|
case "staging":
|
|
661
661
|
return Rr;
|
|
662
662
|
default:
|
|
663
|
-
return
|
|
663
|
+
return br;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
const Ce = {
|
|
667
667
|
init: (t, u) => new Promise((g, a) => {
|
|
668
|
-
const f =
|
|
669
|
-
|
|
670
|
-
|
|
668
|
+
const f = Tr(u == null ? void 0 : u.stage);
|
|
669
|
+
Er(f, (y) => {
|
|
670
|
+
y !== null && a(y), window.TopolPlugin.init(t), g(!0);
|
|
671
671
|
});
|
|
672
672
|
}),
|
|
673
673
|
save: () => {
|
|
@@ -718,7 +718,7 @@ const Ce = {
|
|
|
718
718
|
updateCustomBlockContent: (t) => {
|
|
719
719
|
window.TopolPlugin.updateCustomBlockContent(t);
|
|
720
720
|
}
|
|
721
|
-
},
|
|
721
|
+
}, wr = "editor";
|
|
722
722
|
let K = !1, X = !1;
|
|
723
723
|
function Pr(t) {
|
|
724
724
|
const u = () => {
|
|
@@ -729,8 +729,8 @@ function Pr(t) {
|
|
|
729
729
|
onSaveAndClose(a, f) {
|
|
730
730
|
t.onSaveAndClose !== void 0 && t.onSaveAndClose(a, f);
|
|
731
731
|
},
|
|
732
|
-
onTestSend(a, f,
|
|
733
|
-
t.onTestSend !== void 0 && t.onTestSend(a, f,
|
|
732
|
+
onTestSend(a, f, y) {
|
|
733
|
+
t.onTestSend !== void 0 && t.onTestSend(a, f, y);
|
|
734
734
|
},
|
|
735
735
|
onOpenFileManager() {
|
|
736
736
|
t.onOpenFileManager !== void 0 && t.onOpenFileManager();
|
|
@@ -767,9 +767,12 @@ function Pr(t) {
|
|
|
767
767
|
},
|
|
768
768
|
onTemplateRename(a) {
|
|
769
769
|
t.onTemplateRename !== void 0 && t.onTemplateRename(a);
|
|
770
|
+
},
|
|
771
|
+
updateTestingEmailAddresses(a) {
|
|
772
|
+
t.updateTestingEmailAddresses !== void 0 && t.updateTestingEmailAddresses(a);
|
|
770
773
|
}
|
|
771
774
|
};
|
|
772
|
-
return { id: "#" +
|
|
775
|
+
return { id: "#" + wr, ...t.options, callbacks: { ...g } };
|
|
773
776
|
};
|
|
774
777
|
return cr(() => (K || (async () => {
|
|
775
778
|
K = !0;
|
|
@@ -6,17 +6,17 @@
|
|
|
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 te;function je(){return te||(te=1,process.env.NODE_ENV!=="production"&&function(){var
|
|
10
|
-
`+H+e}}var K=!1,Y;{var tr=typeof WeakMap=="function"?WeakMap:Map;Y=new tr}function pe(e,r){if(!e||K)return"";{var
|
|
9
|
+
*/var te;function je(){return te||(te=1,process.env.NODE_ENV!=="production"&&function(){var t=P,l=Symbol.for("react.element"),g=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),S=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),ae=Symbol.iterator,$e="@@iterator";function ze(e){if(e===null||typeof e!="object")return null;var r=ae&&e[ae]||e[$e];return typeof r=="function"?r:null}var j=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];Je("error",e,n)}}function Je(e,r,n){{var o=j.ReactDebugCurrentFrame,s=o.getStackAddendum();s!==""&&(r+="%s",n=n.concat([s]));var c=n.map(function(u){return String(u)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var qe=!1,Ge=!1,He=!1,Ke=!1,Xe=!1,ie;ie=Symbol.for("react.module.reference");function Ze(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===E||Xe||e===f||e===k||e===y||Ke||e===L||qe||Ge||He||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===R||e.$$typeof===I||e.$$typeof===S||e.$$typeof===h||e.$$typeof===ie||e.getModuleId!==void 0))}function Qe(e,r,n){var o=e.displayName;if(o)return o;var s=r.displayName||r.name||"";return s!==""?n+"("+s+")":n}function ue(e){return e.displayName||"Context"}function T(e){if(e==null)return null;if(typeof e.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case g:return"Portal";case E:return"Profiler";case f:return"StrictMode";case k:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case S:var r=e;return ue(r)+".Consumer";case I:var n=e;return ue(n._context)+".Provider";case h:return Qe(e,e.render,"ForwardRef");case R:var o=e.displayName||null;return o!==null?o:T(e.type)||"Memo";case C:{var s=e,c=s._payload,u=s._init;try{return T(u(c))}catch{return null}}}return null}var O=Object.assign,M=0,le,se,ce,fe,de,ve,ge;function he(){}he.__reactDisabledLog=!0;function er(){{if(M===0){le=console.log,se=console.info,ce=console.warn,fe=console.error,de=console.group,ve=console.groupCollapsed,ge=console.groupEnd;var e={configurable:!0,enumerable:!0,value:he,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function rr(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:O({},e,{value:le}),info:O({},e,{value:se}),warn:O({},e,{value:ce}),error:O({},e,{value:fe}),group:O({},e,{value:de}),groupCollapsed:O({},e,{value:ve}),groupEnd:O({},e,{value:ge})})}M<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=j.ReactCurrentDispatcher,H;function W(e,r,n){{if(H===void 0)try{throw Error()}catch(s){var o=s.stack.trim().match(/\n( *(at )?)/);H=o&&o[1]||""}return`
|
|
10
|
+
`+H+e}}var K=!1,Y;{var tr=typeof WeakMap=="function"?WeakMap:Map;Y=new tr}function pe(e,r){if(!e||K)return"";{var n=Y.get(e);if(n!==void 0)return n}var o;K=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=G.current,G.current=null,er();try{if(r){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(_){o=_}Reflect.construct(e,[],u)}else{try{u.call()}catch(_){o=_}e.call(u.prototype)}}else{try{throw Error()}catch(_){o=_}e()}}catch(_){if(_&&o&&typeof _.stack=="string"){for(var i=_.stack.split(`
|
|
11
11
|
`),m=o.stack.split(`
|
|
12
12
|
`),d=i.length-1,v=m.length-1;d>=1&&v>=0&&i[d]!==m[v];)v--;for(;d>=1&&v>=0;d--,v--)if(i[d]!==m[v]){if(d!==1||v!==1)do if(d--,v--,v<0||i[d]!==m[v]){var b=`
|
|
13
|
-
`+i[d].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),typeof e=="function"&&Y.set(e,b),b}while(d>=1&&v>=0);break}}}finally{K=!1,G.current=c,rr(),Error.prepareStackTrace=s}var A=e?e.displayName||e.name:"",ke=A?W(A):"";return typeof e=="function"&&Y.set(e,ke),ke}function nr(e,r,
|
|
13
|
+
`+i[d].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),typeof e=="function"&&Y.set(e,b),b}while(d>=1&&v>=0);break}}}finally{K=!1,G.current=c,rr(),Error.prepareStackTrace=s}var A=e?e.displayName||e.name:"",ke=A?W(A):"";return typeof e=="function"&&Y.set(e,ke),ke}function nr(e,r,n){return pe(e,!1)}function or(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,n){if(e==null)return"";if(typeof e=="function")return pe(e,or(e));if(typeof e=="string")return W(e);switch(e){case k:return W("Suspense");case y:return W("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case h:return nr(e.render);case R:return N(e.type,r,n);case C:{var o=e,s=o._payload,c=o._init;try{return N(c(s),r,n)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,me={},ye=j.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,n=N(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(n)}else ye.setExtraStackFrame(null)}function ar(e,r,n,o,s){{var c=Function.call.bind(U);for(var u in e)if(c(e,u)){var i=void 0;try{if(typeof e[u]!="function"){var m=Error((o||"React class")+": "+n+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}i=e[u](r,u,o,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(d){i=d}i&&!(i instanceof Error)&&(V(s),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",n,u,typeof i),V(null)),i instanceof Error&&!(i.message in me)&&(me[i.message]=!0,V(s),p("Failed %s type: %s",n,i.message),V(null))}}}var ir=Array.isArray;function X(e){return ir(e)}function ur(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function lr(e){try{return be(e),!1}catch{return!0}}function be(e){return""+e}function Ee(e){if(lr(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ur(e)),be(e)}var B=j.ReactCurrentOwner,sr={key:!0,ref:!0,__self:!0,__source:!0},Re,Te,Z;Z={};function cr(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function fr(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function dr(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var n=T(B.current.type);Z[n]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',T(B.current.type),e.ref),Z[n]=!0)}}function vr(e,r){{var n=function(){Re||(Re=!0,p("%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://reactjs.org/link/special-props)",r))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function gr(e,r){{var n=function(){Te||(Te=!0,p("%s: `ref` 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://reactjs.org/link/special-props)",r))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var hr=function(e,r,n,o,s,c,u){var i={$$typeof:l,type:e,key:r,ref:n,props:u,_owner:c};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function pr(e,r,n,o,s){{var c,u={},i=null,m=null;n!==void 0&&(Ee(n),i=""+n),fr(r)&&(Ee(r.key),i=""+r.key),cr(r)&&(m=r.ref,dr(r,s));for(c in r)U.call(r,c)&&!sr.hasOwnProperty(c)&&(u[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)u[c]===void 0&&(u[c]=d[c])}if(i||m){var v=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&vr(u,v),m&&gr(u,v)}return hr(e,i,m,s,o,B.current,u)}}var Q=j.ReactCurrentOwner,_e=j.ReactDebugCurrentFrame;function x(e){if(e){var r=e._owner,n=N(e.type,e._source,r?r.type:null);_e.setExtraStackFrame(n)}else _e.setExtraStackFrame(null)}var ee;ee=!1;function re(e){return typeof e=="object"&&e!==null&&e.$$typeof===l}function we(){{if(Q.current){var e=T(Q.current.type);if(e)return`
|
|
14
14
|
|
|
15
|
-
Check the render method of \``+e+"`."}return""}}function mr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),
|
|
15
|
+
Check the render method of \``+e+"`."}return""}}function mr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),n=e.lineNumber;return`
|
|
16
16
|
|
|
17
|
-
Check your code at `+r+":"+
|
|
17
|
+
Check your code at `+r+":"+n+"."}return""}}var Pe={};function yr(e){{var r=we();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+
|
|
19
|
+
Check the top-level render call using <`+n+">.")}return r}}function Se(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=yr(r);if(Pe[n])return;Pe[n]=!0;var o="";e&&e._owner&&e._owner!==Q.current&&(o=" It was passed a child from "+T(e._owner.type)+"."),x(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,o),x(null)}}function Ce(e,r){{if(typeof e!="object")return;if(X(e))for(var n=0;n<e.length;n++){var o=e[n];re(o)&&Se(o,r)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var s=ze(e);if(typeof s=="function"&&s!==e.entries)for(var c=s.call(e),u;!(u=c.next()).done;)re(u.value)&&Se(u.value,r)}}}function br(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===h||r.$$typeof===R))n=r.propTypes;else return;if(n){var o=T(r);ar(n,e.props,"prop",o,e)}else if(r.PropTypes!==void 0&&!ee){ee=!0;var s=T(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Er(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var o=r[n];if(o!=="children"&&o!=="key"){x(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),x(null);break}}e.ref!==null&&(x(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),x(null))}}function Oe(e,r,n,o,s,c){{var u=Ze(e);if(!u){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var m=mr(s);m?i+=m:i+=we();var d;e===null?d="null":X(e)?d="array":e!==void 0&&e.$$typeof===l?(d="<"+(T(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,i)}var v=pr(e,r,n,s,c);if(v==null)return v;if(u){var b=r.children;if(b!==void 0)if(o)if(X(b)){for(var A=0;A<b.length;A++)Ce(b[A],e);Object.freeze&&Object.freeze(b)}else p("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 Ce(b,e)}return e===a?Er(v):br(v),v}}function Rr(e,r,n){return Oe(e,r,n,!0)}function Tr(e,r,n){return Oe(e,r,n,!1)}var _r=Tr,wr=Rr;D.Fragment=a,D.jsx=_r,D.jsxs=wr}()),D}var F={};/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-jsx-runtime.production.min.js
|
|
22
22
|
*
|
|
@@ -24,4 +24,4 @@ Check the top-level render call using <`+t+">.")}return r}}function Se(e,r){{if(
|
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var ne;function xe(){if(ne)return F;ne=1;var
|
|
27
|
+
*/var ne;function xe(){if(ne)return F;ne=1;var t=P,l=Symbol.for("react.element"),g=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,f=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,E={key:!0,ref:!0,__self:!0,__source:!0};function I(S,h,k){var y,R={},C=null,L=null;k!==void 0&&(C=""+k),h.key!==void 0&&(C=""+h.key),h.ref!==void 0&&(L=h.ref);for(y in h)a.call(h,y)&&!E.hasOwnProperty(y)&&(R[y]=h[y]);if(S&&S.defaultProps)for(y in h=S.defaultProps,h)R[y]===void 0&&(R[y]=h[y]);return{$$typeof:l,type:S,key:C,ref:L,props:R,_owner:f.current}}return F.Fragment=g,F.jsx=I,F.jsxs=I,F}process.env.NODE_ENV==="production"?$.exports=xe():$.exports=je();var Ae=$.exports;function De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fe=function(t,l,g){var a=document.head||document.getElementsByTagName("head")[0],f=document.createElement("script");typeof l=="function"&&(g=l,l={}),l=l||{},g=g||function(){},f.type=l.type||"text/javascript",f.charset=l.charset||"utf8",f.async="async"in l?!!l.async:!0,f.src=t,l.attrs&&Ie(f,l.attrs),l.text&&(f.text=""+l.text);var E="onload"in f?oe:Me;E(f,g),f.onload||oe(f,g),a.appendChild(f)};function Ie(t,l){for(var g in l)t.setAttribute(g,l[g])}function oe(t,l){t.onload=function(){this.onerror=this.onload=null,l(null,t)},t.onerror=function(){this.onerror=this.onload=null,l(new Error("Failed to load "+this.src),t)}}function Me(t,l){t.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,l(null,t))}}const Be=De(Fe),Le="https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js",We="https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js",Ye="https://d5aoblv5p04cg.cloudfront.net/staging/loader/build.js";function Ne(t="production"){switch(t){case"dev":return We;case"staging":return Ye;default:return Le}}const z={init:(t,l)=>new Promise((g,a)=>{const f=Ne(l==null?void 0:l.stage);Be(f,E=>{E!==null&&a(E),window.TopolPlugin.init(t),g(!0)})}),save:()=>{window.TopolPlugin.save()},load:t=>{window.TopolPlugin.load(t)},togglePreview:()=>{window.TopolPlugin.togglePreview()},togglePreviewSize:()=>{window.TopolPlugin.togglePreviewSize()},chooseFile:t=>{window.TopolPlugin.chooseFile(t)},undo:()=>{window.TopolPlugin.undo()},redo:()=>{window.TopolPlugin.redo()},setSavedBlocks:t=>{window.TopolPlugin.setSavedBlocks(t)},createNotification:t=>{window.TopolPlugin.createNotification(t)},changeEmailToMobile:()=>{window.TopolPlugin.changeEmailToMobile()},changeEmailToDesktop:()=>{window.TopolPlugin.changeEmailToDesktop()},toggleBlocksAndStructuresVisibility:()=>{window.TopolPlugin.toggleBlocksAndStructuresVisibility()},destroy:()=>{window.TopolPlugin.destroy()},setPreviewHTML:t=>{window.TopolPlugin.setPreviewHTML(t)},setActiveMembers:t=>{window.TopolPlugin.setActiveMembers(t)},updateCustomBlockContent:t=>{window.TopolPlugin.updateCustomBlockContent(t)}},Ue="editor";let J=!1,q=!1;function Ve(t){const l=()=>{const g={onSave(a,f){t.onSave!==void 0&&t.onSave(a,f)},onSaveAndClose(a,f){t.onSaveAndClose!==void 0&&t.onSaveAndClose(a,f)},onTestSend(a,f,E){t.onTestSend!==void 0&&t.onTestSend(a,f,E)},onOpenFileManager(){t.onOpenFileManager!==void 0&&t.onOpenFileManager()},onLoaded(){t.onLoaded!==void 0&&t.onLoaded()},onBlockSave(a){t.onBlockSave!==void 0&&t.onBlockSave(a)},onBlockRemove(a){t.onBlockRemove!==void 0&&t.onBlockRemove(a)},onBlockEdit(a){t.onBlockEdit!==void 0&&t.onBlockEdit(a)},onInit(){t.onInit!==void 0&&t.onInit(),J=!1,q=!0},onUndoChange(a){t.onUndoChange!==void 0&&t.onUndoChange(a)},onRedoChange(a){t.onRedoChange!==void 0&&t.onRedoChange(a)},onPreview(a){t.onPreview!==void 0&&t.onPreview(a)},onAlert(a){t.onAlert!==void 0&&t.onAlert(a)},onOpenCustomBlockDialog(a){t.onOpenCustomBlockDialog!==void 0&&t.onOpenCustomBlockDialog(a)},onTemplateRename(a){t.onTemplateRename!==void 0&&t.onTemplateRename(a)},updateTestingEmailAddresses(a){t.updateTestingEmailAddresses!==void 0&&t.updateTestingEmailAddresses(a)}};return{id:"#"+Ue,...t.options,callbacks:{...g}}};return P.useEffect(()=>(J||(async()=>{J=!0;const a=l();await z.init(a,{stage:t.stage||"production"})})(),()=>{q&&(z.destroy(),q=!1)}),[]),Ae.jsx("div",{id:"editor",style:{position:"absolute",height:"100vh",width:"100%"}})}w.TopolPlugin=z,w.default=Ve,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -18,6 +18,7 @@ type TopolEditorProps = {
|
|
|
18
18
|
onAlert?(notification: INotification): void;
|
|
19
19
|
onOpenCustomBlockDialog?(blockContent: unknown): void;
|
|
20
20
|
onTemplateRename?(title: string): void;
|
|
21
|
+
updateTestingEmailAddresses?(emails: string[]): void;
|
|
21
22
|
};
|
|
22
23
|
export default function TopolEditor(props: TopolEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
export type { IReactTopolOptions, INotification, ISavedBlock };
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"email-react",
|
|
12
12
|
"email templates"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.
|
|
14
|
+
"version": "0.0.4",
|
|
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.0.
|
|
33
|
+
"@topol.io/editor": "0.0.4"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^20.7.0",
|