@topol.io/editor-react 0.0.4 → 0.1.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
CHANGED
|
@@ -2,48 +2,48 @@
|
|
|
2
2
|
<img src="https://storage.googleapis.com/topolio17326/plugin-assets/6320/17326/topol-with-bg.png" alt="Tailwind CSS" width="400" height="120">
|
|
3
3
|
</a>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
7
|
Easy and quick! Drag and drop HTML editor and builder for beautiful responsive email templates.
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
# Documentation
|
|
11
10
|
|
|
12
11
|
## Installation
|
|
12
|
+
|
|
13
13
|
Install Editor from NPM using:
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
16
|
npm install @topol.io/editor-react
|
|
17
17
|
|
|
18
|
-
//or
|
|
18
|
+
//or
|
|
19
19
|
|
|
20
20
|
yarn add @topol.io/editor-react
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Use in Component
|
|
24
|
+
|
|
24
25
|
In your React component import and add the simplest options.
|
|
25
26
|
|
|
26
|
-
For more options see the docs for [TopolOptions configuration](https://topol.io/
|
|
27
|
+
For more options see the docs for [TopolOptions configuration](https://docs.topol.io/reference/topol-options.html)
|
|
27
28
|
|
|
28
29
|
```js
|
|
29
30
|
import TopolEditor from '@topol.io/editor-react';
|
|
30
31
|
|
|
31
32
|
const customOptions = {
|
|
32
33
|
authorize: {
|
|
33
|
-
apiKey:
|
|
34
|
-
userId:
|
|
35
|
-
},
|
|
34
|
+
apiKey: 'YOUR_API_TOKEN',
|
|
35
|
+
userId: 'some-user-id',
|
|
36
|
+
},
|
|
36
37
|
};
|
|
37
|
-
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
```jsx
|
|
41
41
|
<TopolEditor options={customOptions}></TopolEditor>
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
45
44
|
## Call Topol Plugin actions
|
|
46
|
-
|
|
45
|
+
|
|
46
|
+
To call actions to the editor import:
|
|
47
47
|
|
|
48
48
|
```js
|
|
49
49
|
import { TopolPlugin } from '@topol.io/editor-react';
|
|
@@ -53,20 +53,27 @@ TopolPlugin.save();
|
|
|
53
53
|
|
|
54
54
|
### List of all available TopolPlugin actions:
|
|
55
55
|
|
|
56
|
-
| Action
|
|
57
|
-
|
|
|
58
|
-
| `TopolPlugin.save()`
|
|
59
|
-
| `TopolPlugin.load(template`)
|
|
60
|
-
| `TopolPlugin.togglePreview()`
|
|
61
|
-
| `TopolPlugin.togglePreviewSize()`
|
|
62
|
-
| `TopolPlugin.undo()`
|
|
63
|
-
| `TopolPlugin.redo()`
|
|
64
|
-
| `TopolPlugin.setSavedBlocks(savedblock: ISavedBlock[])`
|
|
65
|
-
| `TopolPlugin.createNotification(notification: INotification)`
|
|
66
|
-
| `TopolPlugin.changeEmailToMobile()`
|
|
67
|
-
| `TopolPlugin.changeEmailToDesktop()`
|
|
68
|
-
| `TopolPlugin.toggleBlocksAndStructuresVisibility()`
|
|
69
|
-
| `TopolPlugin.destroy()`
|
|
56
|
+
| Action | Description |
|
|
57
|
+
| --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
58
|
+
| `TopolPlugin.save()` | Saves the content of the editor [more info](https://docs.topol.io/guide/how-to-use-custom-topbar.html#save-and-saveandclose) |
|
|
59
|
+
| `TopolPlugin.load(template`) | Loads the provided template [more info](https://docs.topol.io/guide/how-to-load-and-save-template.html#loading-template) |
|
|
60
|
+
| `TopolPlugin.togglePreview()` | Toggles editor preview [more info](https://docs.topol.io/guide/how-to-use-custom-topbar.html#changing-preview-mode) |
|
|
61
|
+
| `TopolPlugin.togglePreviewSize()` | Toggles editor preview size [more info](https://docs.topol.io/guide/how-to-use-custom-topbar.html#changing-preview-mode) |
|
|
62
|
+
| `TopolPlugin.undo()` | Undo change in editor [more info](https://docs.topol.io/guide/how-to-use-custom-topbar.html#undo-and-redo) |
|
|
63
|
+
| `TopolPlugin.redo()` | Redo change in editor [more info](https://docs.topol.io/guide/how-to-use-custom-topbar.html#undo-and-redo) |
|
|
64
|
+
| `TopolPlugin.setSavedBlocks(savedblock: ISavedBlock[])` | Sets the saved blocks [more info](https://docs.topol.io/guide/saved-blocks.html) |
|
|
65
|
+
| `TopolPlugin.createNotification(notification: INotification)` | Creates editor's notification [more info](https://docs.topol.io/guide/custom-notifications.html) |
|
|
66
|
+
| `TopolPlugin.changeEmailToMobile()` | Change email to mobile view [more info](https://docs.topol.io/guide/mobile-first.html#mobile-first-email-template) |
|
|
67
|
+
| `TopolPlugin.changeEmailToDesktop()` | Change email to desktop view [more info](https://docs.topol.io/guide/mobile-first.html#mobile-first-email-template) |
|
|
68
|
+
| `TopolPlugin.toggleBlocksAndStructuresVisibility()` | Toggle hidden structures visibility for blocks and structures [more info](https://docs.topol.io/guide/mobile-first.html#mobile-first-email-template) |
|
|
69
|
+
| `TopolPlugin.destroy()` | Destroys the editor initialization |
|
|
70
|
+
| `TopolPlugin.chooseFile()` | Chooses the file if image block is active [more info](https://docs.topol.io/guide/custom-filemanager.html#choosefile) |
|
|
71
|
+
| `TopolPlugin.openPremadeTemplatesSelection()` | Opens the premade templates modal pick [more info](https://docs.topol.io/guide/premade-templates-in-editor.html) |
|
|
72
|
+
| `TopolPlugin.refreshComments(key: string)` | Refreshes the conversation [more info](https://docs.topol.io/guide/comments.html#refreshcomments) |
|
|
73
|
+
| `TopolPlugin.setActiveMembers(activeMemers: string[])` | Sets the active members |
|
|
74
|
+
| `TopolPlugin.setTemplateName(name: string)` | Sets the name of template [more info](https://docs.topol.io/guide/rename-template.html) |
|
|
75
|
+
| `TopolPlugin.updateApiAuthorizationHeader(newHeader: string \| Record<string, string>)` | Refreshes the authorization tokens [more info](https://docs.topol.io/guide/security.html#refresh-token) |
|
|
76
|
+
| `TopolPlugin.updateCustomBlockContent(content: string)` | Refreshes the authorization tokens [more info](https://docs.topol.io/guide/custom-block.html#inserting-custom-html-in-custom-dialog-component) |
|
|
70
77
|
|
|
71
78
|
<br>
|
|
72
79
|
|
|
@@ -75,26 +82,35 @@ TopolPlugin.save();
|
|
|
75
82
|
The callbacks from editor are received as component events.
|
|
76
83
|
|
|
77
84
|
```tsx
|
|
78
|
-
<TopolEditor
|
|
85
|
+
<TopolEditor
|
|
86
|
+
options={customOptions}
|
|
87
|
+
onSave={handleOnSave}
|
|
88
|
+
></TopolEditor>
|
|
79
89
|
```
|
|
80
90
|
|
|
81
91
|
### List of all editor events
|
|
82
92
|
|
|
83
|
-
| Event
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
| `
|
|
96
|
-
|
|
|
97
|
-
|
|
|
93
|
+
| Event | Description |
|
|
94
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| `@onSave` | Returns object which contains html and json of the template [more info](https://docs.topol.io/guide/callbacks.html#on-save) |
|
|
96
|
+
| `@onSaveAndClose` | Returns object which contains html and json of the template [more info](https://docs.topol.io/guide/callbacks.html#on-save-and-close) |
|
|
97
|
+
| `@onTestSend` | Returns object which contains email, html and json of the template [more info](https://docs.topol.io/guide/callbacks.html#on-test-email-send) |
|
|
98
|
+
| `@onOpenFileManager` | When user clicks file manager open [more info](https://docs.topol.io/guide/custom-filemanager.html#onopenfilemanager) |
|
|
99
|
+
| `@onLoaded` | After editor template is loaded using `TopolPlugin.load()` [more info](https://docs.topol.io/guide/callbacks.html#on-loaded) |
|
|
100
|
+
| `@onInit` | When editor inits [more info](https://docs.topol.io/guide/callbacks.html#on-init) |
|
|
101
|
+
| `@onBlockSave` | When user saves block in editor, returns object of type ISavedBlock [more info](https://docs.topol.io/guide/callbacks.html#on-block-save) |
|
|
102
|
+
| `@onBlockRemove` | When user removes saved block, returns id of saved block to be removed [more info](https://docs.topol.io/guide/callbacks.html#on-block-remove) |
|
|
103
|
+
| `@onBlockEdit` | When user edits saved block, returns id of saved block to be updated [more info](https://docs.topol.io/guide/callbacks.html#on-block-edit) |
|
|
104
|
+
| `@onUndoChange` | When user clicks undo button, retunrs number of steps user undone [more info](https://docs.topol.io/guide/callbacks.html#on-undo-change) |
|
|
105
|
+
| `@onRedoChange` | When user clicks redo button, retunrs number of steps user redone [more info](https://docs.topol.io/guide/callbacks.html#on-redo-change) |
|
|
106
|
+
| `@onPreview` | When user switches to preview [more info](https://docs.topol.io/guide/callbacks.html#on-preview) |
|
|
107
|
+
| `@onAlert` | When alert appears in editor [more info](https://docs.topol.io/guide/callbacks.html#on-alert) |
|
|
108
|
+
| `@onClose` | When close is click inside WindowBar [more info](https://docs.topol.io/guide/top-bar.html#window-bar) |
|
|
109
|
+
| `@onEdittedWithoutSaveChanged` | When user is about to leave an editor with unsaved changes [more info](https://docs.topol.io/guide/disable-before-leaving-modal.html#before-exit-modal-when-user-has-unsaved-changes) |
|
|
110
|
+
| `@onOpenCustomBlockDialog` | When user clicks on the open dialog in custom block [more info](https://docs.topol.io/guide/custom-block.html#inserting-custom-html-in-custom-dialog-component) |
|
|
111
|
+
| `@onTemplateRename` | When user clicks on the pencil icon next to the template name [more info](https://docs.topol.io/guide/rename-template.html#rename-template) |
|
|
112
|
+
| `@updateTestingEmailAddresses` | When user edits the email list in preview [more info](https://docs.topol.io/guide/sending-a-test-email.html#managing-saving-emails-yourself) |
|
|
113
|
+
| `@onError` | When an error that cannot be handled happened in the editor [more info](https://docs.topol.io/guide/callbacks.html#onerror) |
|
|
98
114
|
|
|
99
115
|
<br>
|
|
100
116
|
|
|
@@ -103,5 +119,9 @@ The callbacks from editor are received as component events.
|
|
|
103
119
|
Topol Editor provides full TypeScript integration and exports all necessary types.
|
|
104
120
|
|
|
105
121
|
```tsx
|
|
106
|
-
import {
|
|
122
|
+
import {
|
|
123
|
+
ITopolOptions,
|
|
124
|
+
INotification,
|
|
125
|
+
ISavedBlock,
|
|
126
|
+
} from '@topol.io/editor-react';
|
|
107
127
|
```
|
|
@@ -12,26 +12,26 @@ 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
|
|
15
|
+
var n = Oe, u = Symbol.for("react.element"), g = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), b = 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"), w = 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;
|
|
19
19
|
var r = Q && e[Q] || e[ke];
|
|
20
20
|
return typeof r == "function" ? r : null;
|
|
21
21
|
}
|
|
22
|
-
var O =
|
|
23
|
-
function
|
|
22
|
+
var O = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
23
|
+
function m(e) {
|
|
24
24
|
{
|
|
25
|
-
for (var r = arguments.length,
|
|
26
|
-
|
|
27
|
-
je("error", e,
|
|
25
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
|
|
26
|
+
t[o - 1] = arguments[o];
|
|
27
|
+
je("error", e, t);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function je(e, r,
|
|
30
|
+
function je(e, r, t) {
|
|
31
31
|
{
|
|
32
32
|
var o = O.ReactDebugCurrentFrame, s = o.getStackAddendum();
|
|
33
|
-
s !== "" && (r += "%s",
|
|
34
|
-
var c =
|
|
33
|
+
s !== "" && (r += "%s", t = t.concat([s]));
|
|
34
|
+
var c = t.map(function(l) {
|
|
35
35
|
return String(l);
|
|
36
36
|
});
|
|
37
37
|
c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
|
|
@@ -40,18 +40,18 @@ 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 === b || Be || e === f || e === C || e === E || Ie || e === B || Ae || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === w || 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.
|
|
47
47
|
e.$$typeof === ee || e.getModuleId !== void 0));
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function We(e, r, t) {
|
|
50
50
|
var o = e.displayName;
|
|
51
51
|
if (o)
|
|
52
52
|
return o;
|
|
53
53
|
var s = r.displayName || r.name || "";
|
|
54
|
-
return s !== "" ?
|
|
54
|
+
return s !== "" ? t + "(" + s + ")" : t;
|
|
55
55
|
}
|
|
56
56
|
function re(e) {
|
|
57
57
|
return e.displayName || "Context";
|
|
@@ -59,7 +59,7 @@ function fr() {
|
|
|
59
59
|
function T(e) {
|
|
60
60
|
if (e == null)
|
|
61
61
|
return null;
|
|
62
|
-
if (typeof e.tag == "number" &&
|
|
62
|
+
if (typeof e.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
63
63
|
return e.displayName || e.name || null;
|
|
64
64
|
if (typeof e == "string")
|
|
65
65
|
return e;
|
|
@@ -68,7 +68,7 @@ function fr() {
|
|
|
68
68
|
return "Fragment";
|
|
69
69
|
case g:
|
|
70
70
|
return "Portal";
|
|
71
|
-
case
|
|
71
|
+
case b:
|
|
72
72
|
return "Profiler";
|
|
73
73
|
case f:
|
|
74
74
|
return "StrictMode";
|
|
@@ -83,11 +83,11 @@ function fr() {
|
|
|
83
83
|
var r = e;
|
|
84
84
|
return re(r) + ".Consumer";
|
|
85
85
|
case j:
|
|
86
|
-
var
|
|
87
|
-
return re(
|
|
86
|
+
var t = e;
|
|
87
|
+
return re(t._context) + ".Provider";
|
|
88
88
|
case h:
|
|
89
|
-
return
|
|
90
|
-
case
|
|
89
|
+
return We(e, e.render, "ForwardRef");
|
|
90
|
+
case w:
|
|
91
91
|
var o = e.displayName || null;
|
|
92
92
|
return o !== null ? o : T(e.type) || "Memo";
|
|
93
93
|
case P: {
|
|
@@ -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, ne, te, oe, ae, ie, le, ue;
|
|
105
105
|
function se() {
|
|
106
106
|
}
|
|
107
107
|
se.__reactDisabledLog = !0;
|
|
108
|
-
function
|
|
108
|
+
function Le() {
|
|
109
109
|
{
|
|
110
110
|
if (A === 0) {
|
|
111
|
-
|
|
111
|
+
ne = console.log, te = 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,
|
|
@@ -128,7 +128,7 @@ function fr() {
|
|
|
128
128
|
A++;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function $e() {
|
|
132
132
|
{
|
|
133
133
|
if (A--, A === 0) {
|
|
134
134
|
var e = {
|
|
@@ -138,10 +138,10 @@ function fr() {
|
|
|
138
138
|
};
|
|
139
139
|
Object.defineProperties(console, {
|
|
140
140
|
log: S({}, e, {
|
|
141
|
-
value:
|
|
141
|
+
value: ne
|
|
142
142
|
}),
|
|
143
143
|
info: S({}, e, {
|
|
144
|
-
value:
|
|
144
|
+
value: te
|
|
145
145
|
}),
|
|
146
146
|
warn: S({}, e, {
|
|
147
147
|
value: oe
|
|
@@ -160,11 +160,11 @@ function fr() {
|
|
|
160
160
|
})
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
A < 0 &&
|
|
163
|
+
A < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
var
|
|
167
|
-
function M(e, r,
|
|
166
|
+
var Y = O.ReactCurrentDispatcher, U;
|
|
167
|
+
function M(e, r, t) {
|
|
168
168
|
{
|
|
169
169
|
if (U === void 0)
|
|
170
170
|
try {
|
|
@@ -177,25 +177,25 @@ function fr() {
|
|
|
177
177
|
` + U + e;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
var V = !1,
|
|
180
|
+
var V = !1, W;
|
|
181
181
|
{
|
|
182
|
-
var
|
|
183
|
-
|
|
182
|
+
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
|
|
183
|
+
W = new Ne();
|
|
184
184
|
}
|
|
185
185
|
function ce(e, r) {
|
|
186
186
|
if (!e || V)
|
|
187
187
|
return "";
|
|
188
188
|
{
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
return
|
|
189
|
+
var t = W.get(e);
|
|
190
|
+
if (t !== void 0)
|
|
191
|
+
return t;
|
|
192
192
|
}
|
|
193
193
|
var o;
|
|
194
194
|
V = !0;
|
|
195
195
|
var s = Error.prepareStackTrace;
|
|
196
196
|
Error.prepareStackTrace = void 0;
|
|
197
197
|
var c;
|
|
198
|
-
c =
|
|
198
|
+
c = Y.current, Y.current = null, Le();
|
|
199
199
|
try {
|
|
200
200
|
if (r) {
|
|
201
201
|
var l = function() {
|
|
@@ -208,59 +208,59 @@ function fr() {
|
|
|
208
208
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
209
209
|
try {
|
|
210
210
|
Reflect.construct(l, []);
|
|
211
|
-
} catch (
|
|
212
|
-
o =
|
|
211
|
+
} catch (R) {
|
|
212
|
+
o = R;
|
|
213
213
|
}
|
|
214
214
|
Reflect.construct(e, [], l);
|
|
215
215
|
} else {
|
|
216
216
|
try {
|
|
217
217
|
l.call();
|
|
218
|
-
} catch (
|
|
219
|
-
o =
|
|
218
|
+
} catch (R) {
|
|
219
|
+
o = R;
|
|
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 (R) {
|
|
227
|
+
o = R;
|
|
228
228
|
}
|
|
229
229
|
e();
|
|
230
230
|
}
|
|
231
|
-
} catch (
|
|
232
|
-
if (
|
|
233
|
-
for (var i =
|
|
234
|
-
`),
|
|
235
|
-
`), d = i.length - 1, v =
|
|
231
|
+
} catch (R) {
|
|
232
|
+
if (R && o && typeof R.stack == "string") {
|
|
233
|
+
for (var i = R.stack.split(`
|
|
234
|
+
`), p = o.stack.split(`
|
|
235
|
+
`), d = i.length - 1, v = p.length - 1; d >= 1 && v >= 0 && i[d] !== p[v]; )
|
|
236
236
|
v--;
|
|
237
237
|
for (; d >= 1 && v >= 0; d--, v--)
|
|
238
|
-
if (i[d] !==
|
|
238
|
+
if (i[d] !== p[v]) {
|
|
239
239
|
if (d !== 1 || v !== 1)
|
|
240
240
|
do
|
|
241
|
-
if (d--, v--, v < 0 || i[d] !==
|
|
242
|
-
var
|
|
241
|
+
if (d--, v--, v < 0 || i[d] !== p[v]) {
|
|
242
|
+
var y = `
|
|
243
243
|
` + i[d].replace(" at new ", " at ");
|
|
244
|
-
return e.displayName &&
|
|
244
|
+
return e.displayName && y.includes("<anonymous>") && (y = y.replace("<anonymous>", e.displayName)), typeof e == "function" && W.set(e, y), y;
|
|
245
245
|
}
|
|
246
246
|
while (d >= 1 && v >= 0);
|
|
247
247
|
break;
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
} finally {
|
|
251
|
-
V = !1,
|
|
251
|
+
V = !1, Y.current = c, $e(), Error.prepareStackTrace = s;
|
|
252
252
|
}
|
|
253
|
-
var x = e ? e.displayName || e.name : "",
|
|
254
|
-
return typeof e == "function" &&
|
|
253
|
+
var x = e ? e.displayName || e.name : "", Re = x ? M(x) : "";
|
|
254
|
+
return typeof e == "function" && W.set(e, Re), Re;
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function Ye(e, r, t) {
|
|
257
257
|
return ce(e, !1);
|
|
258
258
|
}
|
|
259
259
|
function Ue(e) {
|
|
260
260
|
var r = e.prototype;
|
|
261
261
|
return !!(r && r.isReactComponent);
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function L(e, r, t) {
|
|
264
264
|
if (e == null)
|
|
265
265
|
return "";
|
|
266
266
|
if (typeof e == "function")
|
|
@@ -276,43 +276,43 @@ function fr() {
|
|
|
276
276
|
if (typeof e == "object")
|
|
277
277
|
switch (e.$$typeof) {
|
|
278
278
|
case h:
|
|
279
|
-
return
|
|
280
|
-
case
|
|
281
|
-
return
|
|
279
|
+
return Ye(e.render);
|
|
280
|
+
case w:
|
|
281
|
+
return L(e.type, r, t);
|
|
282
282
|
case P: {
|
|
283
283
|
var o = e, s = o._payload, c = o._init;
|
|
284
284
|
try {
|
|
285
|
-
return
|
|
285
|
+
return L(c(s), r, t);
|
|
286
286
|
} catch {
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
return "";
|
|
291
291
|
}
|
|
292
|
-
var
|
|
293
|
-
function
|
|
292
|
+
var $ = Object.prototype.hasOwnProperty, fe = {}, de = O.ReactDebugCurrentFrame;
|
|
293
|
+
function N(e) {
|
|
294
294
|
if (e) {
|
|
295
|
-
var r = e._owner,
|
|
296
|
-
de.setExtraStackFrame(
|
|
295
|
+
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
|
|
296
|
+
de.setExtraStackFrame(t);
|
|
297
297
|
} else
|
|
298
298
|
de.setExtraStackFrame(null);
|
|
299
299
|
}
|
|
300
|
-
function Ve(e, r,
|
|
300
|
+
function Ve(e, r, t, o, s) {
|
|
301
301
|
{
|
|
302
|
-
var c = Function.call.bind(
|
|
302
|
+
var c = Function.call.bind($);
|
|
303
303
|
for (var l in e)
|
|
304
304
|
if (c(e, l)) {
|
|
305
305
|
var i = void 0;
|
|
306
306
|
try {
|
|
307
307
|
if (typeof e[l] != "function") {
|
|
308
|
-
var
|
|
309
|
-
throw
|
|
308
|
+
var p = Error((o || "React class") + ": " + t + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
309
|
+
throw p.name = "Invariant Violation", p;
|
|
310
310
|
}
|
|
311
|
-
i = e[l](r, l, o,
|
|
311
|
+
i = e[l](r, l, o, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
312
312
|
} catch (d) {
|
|
313
313
|
i = d;
|
|
314
314
|
}
|
|
315
|
-
i && !(i instanceof Error) && (
|
|
315
|
+
i && !(i instanceof Error) && (N(s), m("%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", t, l, typeof i), N(null)), i instanceof Error && !(i.message in fe) && (fe[i.message] = !0, N(s), m("Failed %s type: %s", t, i.message), N(null));
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
@@ -322,11 +322,11 @@ function fr() {
|
|
|
322
322
|
}
|
|
323
323
|
function qe(e) {
|
|
324
324
|
{
|
|
325
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag,
|
|
326
|
-
return
|
|
325
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
326
|
+
return t;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function He(e) {
|
|
330
330
|
try {
|
|
331
331
|
return ve(e), !1;
|
|
332
332
|
} catch {
|
|
@@ -337,18 +337,18 @@ function fr() {
|
|
|
337
337
|
return "" + e;
|
|
338
338
|
}
|
|
339
339
|
function ge(e) {
|
|
340
|
-
if (
|
|
341
|
-
return
|
|
340
|
+
if (He(e))
|
|
341
|
+
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), ve(e);
|
|
342
342
|
}
|
|
343
|
-
var D = O.ReactCurrentOwner,
|
|
343
|
+
var D = O.ReactCurrentOwner, Je = {
|
|
344
344
|
key: !0,
|
|
345
345
|
ref: !0,
|
|
346
346
|
__self: !0,
|
|
347
347
|
__source: !0
|
|
348
|
-
}, he,
|
|
348
|
+
}, he, me, q;
|
|
349
349
|
q = {};
|
|
350
|
-
function
|
|
351
|
-
if (
|
|
350
|
+
function Ge(e) {
|
|
351
|
+
if ($.call(e, "ref")) {
|
|
352
352
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
353
353
|
if (r && r.isReactWarning)
|
|
354
354
|
return !1;
|
|
@@ -356,7 +356,7 @@ function fr() {
|
|
|
356
356
|
return e.ref !== void 0;
|
|
357
357
|
}
|
|
358
358
|
function Ke(e) {
|
|
359
|
-
if (
|
|
359
|
+
if ($.call(e, "key")) {
|
|
360
360
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
361
361
|
if (r && r.isReactWarning)
|
|
362
362
|
return !1;
|
|
@@ -365,40 +365,40 @@ 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
|
|
369
|
-
q[
|
|
368
|
+
var t = T(D.current.type);
|
|
369
|
+
q[t] || (m('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[t] = !0);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
function Ze(e, r) {
|
|
373
373
|
{
|
|
374
|
-
var
|
|
375
|
-
he || (he = !0,
|
|
374
|
+
var t = function() {
|
|
375
|
+
he || (he = !0, m("%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));
|
|
376
376
|
};
|
|
377
|
-
|
|
378
|
-
get:
|
|
377
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
378
|
+
get: t,
|
|
379
379
|
configurable: !0
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
function Qe(e, r) {
|
|
384
384
|
{
|
|
385
|
-
var
|
|
386
|
-
|
|
385
|
+
var t = function() {
|
|
386
|
+
me || (me = !0, m("%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));
|
|
387
387
|
};
|
|
388
|
-
|
|
389
|
-
get:
|
|
388
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
389
|
+
get: t,
|
|
390
390
|
configurable: !0
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
var er = function(e, r,
|
|
394
|
+
var er = function(e, r, t, o, s, c, l) {
|
|
395
395
|
var i = {
|
|
396
396
|
// This tag allows us to uniquely identify this as a React Element
|
|
397
397
|
$$typeof: u,
|
|
398
398
|
// Built-in properties that belong on the element
|
|
399
399
|
type: e,
|
|
400
400
|
key: r,
|
|
401
|
-
ref:
|
|
401
|
+
ref: t,
|
|
402
402
|
props: l,
|
|
403
403
|
// Record the component responsible for creating this element.
|
|
404
404
|
_owner: c
|
|
@@ -420,41 +420,41 @@ function fr() {
|
|
|
420
420
|
value: s
|
|
421
421
|
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
422
422
|
};
|
|
423
|
-
function rr(e, r,
|
|
423
|
+
function rr(e, r, t, o, s) {
|
|
424
424
|
{
|
|
425
|
-
var c, l = {}, i = null,
|
|
426
|
-
|
|
425
|
+
var c, l = {}, i = null, p = null;
|
|
426
|
+
t !== void 0 && (ge(t), i = "" + t), Ke(r) && (ge(r.key), i = "" + r.key), Ge(r) && (p = r.ref, Xe(r, s));
|
|
427
427
|
for (c in r)
|
|
428
|
-
|
|
428
|
+
$.call(r, c) && !Je.hasOwnProperty(c) && (l[c] = r[c]);
|
|
429
429
|
if (e && e.defaultProps) {
|
|
430
430
|
var d = e.defaultProps;
|
|
431
431
|
for (c in d)
|
|
432
432
|
l[c] === void 0 && (l[c] = d[c]);
|
|
433
433
|
}
|
|
434
|
-
if (i ||
|
|
434
|
+
if (i || p) {
|
|
435
435
|
var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
436
|
-
i && Ze(l, v),
|
|
436
|
+
i && Ze(l, v), p && Qe(l, v);
|
|
437
437
|
}
|
|
438
|
-
return er(e, i,
|
|
438
|
+
return er(e, i, p, s, o, D.current, l);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
var
|
|
441
|
+
var H = O.ReactCurrentOwner, pe = O.ReactDebugCurrentFrame;
|
|
442
442
|
function k(e) {
|
|
443
443
|
if (e) {
|
|
444
|
-
var r = e._owner,
|
|
445
|
-
|
|
444
|
+
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
|
|
445
|
+
pe.setExtraStackFrame(t);
|
|
446
446
|
} else
|
|
447
|
-
|
|
447
|
+
pe.setExtraStackFrame(null);
|
|
448
448
|
}
|
|
449
|
-
var
|
|
450
|
-
|
|
451
|
-
function
|
|
449
|
+
var J;
|
|
450
|
+
J = !1;
|
|
451
|
+
function G(e) {
|
|
452
452
|
return typeof e == "object" && e !== null && e.$$typeof === u;
|
|
453
453
|
}
|
|
454
454
|
function Ee() {
|
|
455
455
|
{
|
|
456
|
-
if (
|
|
457
|
-
var e = T(
|
|
456
|
+
if (H.current) {
|
|
457
|
+
var e = T(H.current.type);
|
|
458
458
|
if (e)
|
|
459
459
|
return `
|
|
460
460
|
|
|
@@ -463,59 +463,59 @@ Check the render method of \`` + e + "`.";
|
|
|
463
463
|
return "";
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function nr(e) {
|
|
467
467
|
{
|
|
468
468
|
if (e !== void 0) {
|
|
469
|
-
var r = e.fileName.replace(/^.*[\\\/]/, ""),
|
|
469
|
+
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
|
|
470
470
|
return `
|
|
471
471
|
|
|
472
|
-
Check your code at ` + r + ":" +
|
|
472
|
+
Check your code at ` + r + ":" + t + ".";
|
|
473
473
|
}
|
|
474
474
|
return "";
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
var
|
|
478
|
-
function
|
|
477
|
+
var ye = {};
|
|
478
|
+
function tr(e) {
|
|
479
479
|
{
|
|
480
480
|
var r = Ee();
|
|
481
481
|
if (!r) {
|
|
482
|
-
var
|
|
483
|
-
|
|
482
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
483
|
+
t && (r = `
|
|
484
484
|
|
|
485
|
-
Check the top-level render call using <` +
|
|
485
|
+
Check the top-level render call using <` + t + ">.");
|
|
486
486
|
}
|
|
487
487
|
return r;
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function be(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
|
|
496
|
-
if (
|
|
495
|
+
var t = tr(r);
|
|
496
|
+
if (ye[t])
|
|
497
497
|
return;
|
|
498
|
-
|
|
498
|
+
ye[t] = !0;
|
|
499
499
|
var o = "";
|
|
500
|
-
e && e._owner && e._owner !==
|
|
500
|
+
e && e._owner && e._owner !== H.current && (o = " It was passed a child from " + T(e._owner.type) + "."), k(e), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, o), k(null);
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function we(e, r) {
|
|
504
504
|
{
|
|
505
505
|
if (typeof e != "object")
|
|
506
506
|
return;
|
|
507
507
|
if (z(e))
|
|
508
|
-
for (var
|
|
509
|
-
var o = e[
|
|
510
|
-
|
|
508
|
+
for (var t = 0; t < e.length; t++) {
|
|
509
|
+
var o = e[t];
|
|
510
|
+
G(o) && be(o, r);
|
|
511
511
|
}
|
|
512
|
-
else if (
|
|
512
|
+
else if (G(e))
|
|
513
513
|
e._store && (e._store.validated = !0);
|
|
514
514
|
else if (e) {
|
|
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
|
-
|
|
518
|
+
G(l.value) && be(l.value, r);
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
}
|
|
@@ -524,73 +524,73 @@ Check the top-level render call using <` + n + ">.");
|
|
|
524
524
|
var r = e.type;
|
|
525
525
|
if (r == null || typeof r == "string")
|
|
526
526
|
return;
|
|
527
|
-
var
|
|
527
|
+
var t;
|
|
528
528
|
if (typeof r == "function")
|
|
529
|
-
|
|
529
|
+
t = r.propTypes;
|
|
530
530
|
else if (typeof r == "object" && (r.$$typeof === h || // Note: Memo only checks outer props here.
|
|
531
531
|
// Inner props are checked in the reconciler.
|
|
532
|
-
r.$$typeof ===
|
|
533
|
-
|
|
532
|
+
r.$$typeof === w))
|
|
533
|
+
t = r.propTypes;
|
|
534
534
|
else
|
|
535
535
|
return;
|
|
536
|
-
if (
|
|
536
|
+
if (t) {
|
|
537
537
|
var o = T(r);
|
|
538
|
-
Ve(
|
|
539
|
-
} else if (r.PropTypes !== void 0 && !
|
|
540
|
-
|
|
538
|
+
Ve(t, e.props, "prop", o, e);
|
|
539
|
+
} else if (r.PropTypes !== void 0 && !J) {
|
|
540
|
+
J = !0;
|
|
541
541
|
var s = T(r);
|
|
542
|
-
|
|
542
|
+
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
543
543
|
}
|
|
544
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
544
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
function ar(e) {
|
|
548
548
|
{
|
|
549
|
-
for (var r = Object.keys(e.props),
|
|
550
|
-
var o = r[
|
|
549
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
550
|
+
var o = r[t];
|
|
551
551
|
if (o !== "children" && o !== "key") {
|
|
552
|
-
k(e),
|
|
552
|
+
k(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), k(null);
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
|
-
e.ref !== null && (k(e),
|
|
556
|
+
e.ref !== null && (k(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function Te(e, r,
|
|
559
|
+
function Te(e, r, t, 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
|
|
566
|
-
|
|
565
|
+
var p = nr(s);
|
|
566
|
+
p ? i += p : i += Ee();
|
|
567
567
|
var 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,
|
|
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, m("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
|
-
var v = rr(e, r,
|
|
570
|
+
var v = rr(e, r, t, s, c);
|
|
571
571
|
if (v == null)
|
|
572
572
|
return v;
|
|
573
573
|
if (l) {
|
|
574
|
-
var
|
|
575
|
-
if (
|
|
574
|
+
var y = r.children;
|
|
575
|
+
if (y !== void 0)
|
|
576
576
|
if (o)
|
|
577
|
-
if (z(
|
|
578
|
-
for (var x = 0; x <
|
|
579
|
-
|
|
580
|
-
Object.freeze && Object.freeze(
|
|
577
|
+
if (z(y)) {
|
|
578
|
+
for (var x = 0; x < y.length; x++)
|
|
579
|
+
we(y[x], e);
|
|
580
|
+
Object.freeze && Object.freeze(y);
|
|
581
581
|
} else
|
|
582
|
-
|
|
582
|
+
m("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
|
-
|
|
584
|
+
we(y, e);
|
|
585
585
|
}
|
|
586
586
|
return e === a ? ar(v) : or(v), v;
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
function ir(e, r,
|
|
590
|
-
return Te(e, r,
|
|
589
|
+
function ir(e, r, t) {
|
|
590
|
+
return Te(e, r, t, !0);
|
|
591
591
|
}
|
|
592
|
-
function lr(e, r,
|
|
593
|
-
return Te(e, r,
|
|
592
|
+
function lr(e, r, t) {
|
|
593
|
+
return Te(e, r, t, !1);
|
|
594
594
|
}
|
|
595
595
|
var ur = lr, sr = ir;
|
|
596
596
|
F.Fragment = a, F.jsx = ur, F.jsxs = sr;
|
|
@@ -611,70 +611,70 @@ function dr() {
|
|
|
611
611
|
if (Pe)
|
|
612
612
|
return I;
|
|
613
613
|
Pe = 1;
|
|
614
|
-
var
|
|
614
|
+
var n = Oe, u = Symbol.for("react.element"), g = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, f = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, b = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
615
615
|
function j(_, h, C) {
|
|
616
|
-
var E,
|
|
616
|
+
var E, w = {}, 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
618
|
for (E in h)
|
|
619
|
-
a.call(h, E) && !
|
|
619
|
+
a.call(h, E) && !b.hasOwnProperty(E) && (w[E] = h[E]);
|
|
620
620
|
if (_ && _.defaultProps)
|
|
621
621
|
for (E in h = _.defaultProps, h)
|
|
622
|
-
|
|
623
|
-
return { $$typeof: u, type: _, key: P, ref: B, props:
|
|
622
|
+
w[E] === void 0 && (w[E] = h[E]);
|
|
623
|
+
return { $$typeof: u, type: _, key: P, ref: B, props: w, _owner: f.current };
|
|
624
624
|
}
|
|
625
625
|
return I.Fragment = g, I.jsx = j, I.jsxs = j, I;
|
|
626
626
|
}
|
|
627
627
|
process.env.NODE_ENV === "production" ? Z.exports = dr() : Z.exports = fr();
|
|
628
628
|
var vr = Z.exports;
|
|
629
|
-
function gr(
|
|
630
|
-
return
|
|
629
|
+
function gr(n) {
|
|
630
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
631
631
|
}
|
|
632
|
-
var hr = function(
|
|
632
|
+
var hr = function(n, 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
|
-
}, f.type = u.type || "text/javascript", f.charset = u.charset || "utf8", f.async = "async" in u ? !!u.async : !0, f.src =
|
|
636
|
-
var
|
|
637
|
-
|
|
635
|
+
}, f.type = u.type || "text/javascript", f.charset = u.charset || "utf8", f.async = "async" in u ? !!u.async : !0, f.src = n, u.attrs && mr(f, u.attrs), u.text && (f.text = "" + u.text);
|
|
636
|
+
var b = "onload" in f ? Se : pr;
|
|
637
|
+
b(f, g), f.onload || Se(f, g), a.appendChild(f);
|
|
638
638
|
};
|
|
639
|
-
function
|
|
639
|
+
function mr(n, u) {
|
|
640
640
|
for (var g in u)
|
|
641
|
-
|
|
641
|
+
n.setAttribute(g, u[g]);
|
|
642
642
|
}
|
|
643
|
-
function Se(
|
|
644
|
-
|
|
645
|
-
this.onerror = this.onload = null, u(null,
|
|
646
|
-
},
|
|
647
|
-
this.onerror = this.onload = null, u(new Error("Failed to load " + this.src),
|
|
643
|
+
function Se(n, u) {
|
|
644
|
+
n.onload = function() {
|
|
645
|
+
this.onerror = this.onload = null, u(null, n);
|
|
646
|
+
}, n.onerror = function() {
|
|
647
|
+
this.onerror = this.onload = null, u(new Error("Failed to load " + this.src), n);
|
|
648
648
|
};
|
|
649
649
|
}
|
|
650
|
-
function
|
|
651
|
-
|
|
652
|
-
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, u(null,
|
|
650
|
+
function pr(n, u) {
|
|
651
|
+
n.onreadystatechange = function() {
|
|
652
|
+
this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, u(null, n));
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
|
-
const Er = /* @__PURE__ */ gr(hr),
|
|
656
|
-
function Tr(
|
|
657
|
-
switch (
|
|
655
|
+
const Er = /* @__PURE__ */ gr(hr), yr = "https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js", br = "https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js", wr = "https://d5aoblv5p04cg.cloudfront.net/staging/loader/build.js";
|
|
656
|
+
function Tr(n = "production") {
|
|
657
|
+
switch (n) {
|
|
658
658
|
case "dev":
|
|
659
|
-
return
|
|
659
|
+
return br;
|
|
660
660
|
case "staging":
|
|
661
|
-
return
|
|
661
|
+
return wr;
|
|
662
662
|
default:
|
|
663
|
-
return
|
|
663
|
+
return yr;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
const Ce = {
|
|
667
|
-
init: (
|
|
667
|
+
init: (n, u) => new Promise((g, a) => {
|
|
668
668
|
const f = Tr(u == null ? void 0 : u.stage);
|
|
669
|
-
Er(f, (
|
|
670
|
-
|
|
669
|
+
Er(f, (b) => {
|
|
670
|
+
b !== null && a(b), window.TopolPlugin.init(n), g(!0);
|
|
671
671
|
});
|
|
672
672
|
}),
|
|
673
673
|
save: () => {
|
|
674
674
|
window.TopolPlugin.save();
|
|
675
675
|
},
|
|
676
|
-
load: (
|
|
677
|
-
window.TopolPlugin.load(
|
|
676
|
+
load: (n) => {
|
|
677
|
+
window.TopolPlugin.load(n);
|
|
678
678
|
},
|
|
679
679
|
togglePreview: () => {
|
|
680
680
|
window.TopolPlugin.togglePreview();
|
|
@@ -682,8 +682,8 @@ const Ce = {
|
|
|
682
682
|
togglePreviewSize: () => {
|
|
683
683
|
window.TopolPlugin.togglePreviewSize();
|
|
684
684
|
},
|
|
685
|
-
chooseFile: (
|
|
686
|
-
window.TopolPlugin.chooseFile(
|
|
685
|
+
chooseFile: (n) => {
|
|
686
|
+
window.TopolPlugin.chooseFile(n);
|
|
687
687
|
},
|
|
688
688
|
undo: () => {
|
|
689
689
|
window.TopolPlugin.undo();
|
|
@@ -691,11 +691,20 @@ const Ce = {
|
|
|
691
691
|
redo: () => {
|
|
692
692
|
window.TopolPlugin.redo();
|
|
693
693
|
},
|
|
694
|
-
|
|
695
|
-
window.TopolPlugin.
|
|
694
|
+
destroy: () => {
|
|
695
|
+
window.TopolPlugin.destroy();
|
|
696
|
+
},
|
|
697
|
+
setSavedBlocks: (n) => {
|
|
698
|
+
window.TopolPlugin.setSavedBlocks(n);
|
|
699
|
+
},
|
|
700
|
+
setPreviewHTML: (n) => {
|
|
701
|
+
window.TopolPlugin.setPreviewHTML(n);
|
|
702
|
+
},
|
|
703
|
+
createNotification: (n) => {
|
|
704
|
+
window.TopolPlugin.createNotification(n);
|
|
696
705
|
},
|
|
697
|
-
|
|
698
|
-
window.TopolPlugin.
|
|
706
|
+
setActiveMembers: (n) => {
|
|
707
|
+
window.TopolPlugin.setActiveMembers(n);
|
|
699
708
|
},
|
|
700
709
|
changeEmailToMobile: () => {
|
|
701
710
|
window.TopolPlugin.changeEmailToMobile();
|
|
@@ -706,78 +715,93 @@ const Ce = {
|
|
|
706
715
|
toggleBlocksAndStructuresVisibility: () => {
|
|
707
716
|
window.TopolPlugin.toggleBlocksAndStructuresVisibility();
|
|
708
717
|
},
|
|
709
|
-
|
|
710
|
-
window.TopolPlugin.
|
|
718
|
+
updateCustomBlockContent: (n) => {
|
|
719
|
+
window.TopolPlugin.updateCustomBlockContent(n);
|
|
720
|
+
},
|
|
721
|
+
refreshComments: (n) => {
|
|
722
|
+
window.TopolPlugin.refreshComments(n);
|
|
723
|
+
},
|
|
724
|
+
refreshSyncedRows: () => {
|
|
725
|
+
window.TopolPlugin.refreshSyncedRows();
|
|
711
726
|
},
|
|
712
|
-
|
|
713
|
-
window.TopolPlugin.
|
|
727
|
+
openPremadeTemplatesSelection: () => {
|
|
728
|
+
window.TopolPlugin.openPremadeTemplatesSelection();
|
|
714
729
|
},
|
|
715
|
-
|
|
716
|
-
window.TopolPlugin.
|
|
730
|
+
updateApiAuthorizationHeader: (n) => {
|
|
731
|
+
window.TopolPlugin.updateApiAuthorizationHeader(n);
|
|
717
732
|
},
|
|
718
|
-
|
|
719
|
-
window.TopolPlugin.
|
|
733
|
+
setTemplateName: (n) => {
|
|
734
|
+
window.TopolPlugin.setTemplateName(n);
|
|
720
735
|
}
|
|
721
|
-
},
|
|
736
|
+
}, Rr = "editor";
|
|
722
737
|
let K = !1, X = !1;
|
|
723
|
-
function Pr(
|
|
738
|
+
function Pr(n) {
|
|
724
739
|
const u = () => {
|
|
725
740
|
const g = {
|
|
726
741
|
onSave(a, f) {
|
|
727
|
-
|
|
742
|
+
n.onSave !== void 0 && n.onSave(a, f);
|
|
728
743
|
},
|
|
729
744
|
onSaveAndClose(a, f) {
|
|
730
|
-
|
|
745
|
+
n.onSaveAndClose !== void 0 && n.onSaveAndClose(a, f);
|
|
731
746
|
},
|
|
732
|
-
onTestSend(a, f,
|
|
733
|
-
|
|
747
|
+
onTestSend(a, f, b) {
|
|
748
|
+
n.onTestSend !== void 0 && n.onTestSend(a, f, b);
|
|
734
749
|
},
|
|
735
750
|
onOpenFileManager() {
|
|
736
|
-
|
|
751
|
+
n.onOpenFileManager !== void 0 && n.onOpenFileManager();
|
|
737
752
|
},
|
|
738
753
|
onLoaded() {
|
|
739
|
-
|
|
754
|
+
n.onLoaded !== void 0 && n.onLoaded();
|
|
740
755
|
},
|
|
741
756
|
onBlockSave(a) {
|
|
742
|
-
|
|
757
|
+
n.onBlockSave !== void 0 && n.onBlockSave(a);
|
|
743
758
|
},
|
|
744
759
|
onBlockRemove(a) {
|
|
745
|
-
|
|
760
|
+
n.onBlockRemove !== void 0 && n.onBlockRemove(a);
|
|
746
761
|
},
|
|
747
762
|
onBlockEdit(a) {
|
|
748
|
-
|
|
763
|
+
n.onBlockEdit !== void 0 && n.onBlockEdit(a);
|
|
749
764
|
},
|
|
750
765
|
onInit() {
|
|
751
|
-
|
|
766
|
+
n.onInit !== void 0 && n.onInit(), K = !1, X = !0;
|
|
752
767
|
},
|
|
753
768
|
onUndoChange(a) {
|
|
754
|
-
|
|
769
|
+
n.onUndoChange !== void 0 && n.onUndoChange(a);
|
|
755
770
|
},
|
|
756
771
|
onRedoChange(a) {
|
|
757
|
-
|
|
772
|
+
n.onRedoChange !== void 0 && n.onRedoChange(a);
|
|
758
773
|
},
|
|
759
774
|
onPreview(a) {
|
|
760
|
-
|
|
775
|
+
n.onPreview !== void 0 && n.onPreview(a);
|
|
761
776
|
},
|
|
762
777
|
onAlert(a) {
|
|
763
|
-
|
|
778
|
+
n.onAlert !== void 0 && n.onAlert(a);
|
|
779
|
+
},
|
|
780
|
+
onClose() {
|
|
781
|
+
n.onClose !== void 0 && n.onClose();
|
|
782
|
+
},
|
|
783
|
+
onEdittedWithoutSaveChanged(a) {
|
|
784
|
+
n.onEdittedWithoutSaveChanged !== void 0 && n.onEdittedWithoutSaveChanged(a);
|
|
764
785
|
},
|
|
765
786
|
onOpenCustomBlockDialog(a) {
|
|
766
|
-
|
|
787
|
+
n.onOpenCustomBlockDialog !== void 0 && n.onOpenCustomBlockDialog(a);
|
|
767
788
|
},
|
|
768
789
|
onTemplateRename(a) {
|
|
769
|
-
|
|
790
|
+
n.onTemplateRename !== void 0 && n.onTemplateRename(a);
|
|
770
791
|
},
|
|
771
792
|
updateTestingEmailAddresses(a) {
|
|
772
|
-
|
|
793
|
+
n.updateTestingEmailAddresses !== void 0 && n.updateTestingEmailAddresses(a);
|
|
794
|
+
},
|
|
795
|
+
onError(a, f) {
|
|
796
|
+
n.onError !== void 0 && n.onError(a, f);
|
|
773
797
|
}
|
|
774
798
|
};
|
|
775
|
-
return { id: "#" +
|
|
799
|
+
return { id: "#" + Rr, ...n.options, callbacks: { ...g } };
|
|
776
800
|
};
|
|
777
801
|
return cr(() => (K || (async () => {
|
|
778
802
|
K = !0;
|
|
779
803
|
const a = u();
|
|
780
|
-
await Ce.init(a, { stage:
|
|
804
|
+
await Ce.init(a, { stage: n.stage || "production" });
|
|
781
805
|
})(), () => {
|
|
782
806
|
X && (Ce.destroy(), X = !1);
|
|
783
807
|
}), []), /* @__PURE__ */ vr.jsx(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],P):(_=typeof globalThis<"u"?globalThis:_||self,P(_["topol-editor-react"]={},_.React))})(this,function(_,P){"use strict";var $={exports:{}},D={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -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
|
|
10
|
-
`+
|
|
11
|
-
`),
|
|
12
|
-
`),d=i.length-1,v=
|
|
13
|
-
`+i[d].replace(" at new "," at ");return e.displayName&&
|
|
9
|
+
*/var ne;function je(){return ne||(ne=1,process.env.NODE_ENV!=="production"&&function(){var n=P,u=Symbol.for("react.element"),g=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),b=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"),E=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),W=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=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function m(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];He("error",e,t)}}function He(e,r,t){{var o=j.ReactDebugCurrentFrame,s=o.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var c=t.map(function(l){return String(l)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var Je=!1,qe=!1,Ge=!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===b||Xe||e===f||e===k||e===E||Ke||e===W||Je||qe||Ge||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===T||e.$$typeof===I||e.$$typeof===S||e.$$typeof===h||e.$$typeof===ie||e.getModuleId!==void 0))}function Qe(e,r,t){var o=e.displayName;if(o)return o;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function le(e){return e.displayName||"Context"}function w(e){if(e==null)return null;if(typeof e.tag=="number"&&m("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 b:return"Profiler";case f:return"StrictMode";case k:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case S:var r=e;return le(r)+".Consumer";case I:var t=e;return le(t._context)+".Provider";case h:return Qe(e,e.render,"ForwardRef");case T:var o=e.displayName||null;return o!==null?o:w(e.type)||"Memo";case C:{var s=e,c=s._payload,l=s._init;try{return w(l(c))}catch{return null}}}return null}var O=Object.assign,M=0,ue,se,ce,fe,de,ve,ge;function he(){}he.__reactDisabledLog=!0;function er(){{if(M===0){ue=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:ue}),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&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=j.ReactCurrentDispatcher,G;function L(e,r,t){{if(G===void 0)try{throw Error()}catch(s){var o=s.stack.trim().match(/\n( *(at )?)/);G=o&&o[1]||""}return`
|
|
10
|
+
`+G+e}}var K=!1,N;{var nr=typeof WeakMap=="function"?WeakMap:Map;N=new nr}function me(e,r){if(!e||K)return"";{var t=N.get(e);if(t!==void 0)return t}var o;K=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=q.current,q.current=null,er();try{if(r){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(R){o=R}Reflect.construct(e,[],l)}else{try{l.call()}catch(R){o=R}e.call(l.prototype)}}else{try{throw Error()}catch(R){o=R}e()}}catch(R){if(R&&o&&typeof R.stack=="string"){for(var i=R.stack.split(`
|
|
11
|
+
`),p=o.stack.split(`
|
|
12
|
+
`),d=i.length-1,v=p.length-1;d>=1&&v>=0&&i[d]!==p[v];)v--;for(;d>=1&&v>=0;d--,v--)if(i[d]!==p[v]){if(d!==1||v!==1)do if(d--,v--,v<0||i[d]!==p[v]){var y=`
|
|
13
|
+
`+i[d].replace(" at new "," at ");return e.displayName&&y.includes("<anonymous>")&&(y=y.replace("<anonymous>",e.displayName)),typeof e=="function"&&N.set(e,y),y}while(d>=1&&v>=0);break}}}finally{K=!1,q.current=c,rr(),Error.prepareStackTrace=s}var A=e?e.displayName||e.name:"",ke=A?L(A):"";return typeof e=="function"&&N.set(e,ke),ke}function tr(e,r,t){return me(e,!1)}function or(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Y(e,r,t){if(e==null)return"";if(typeof e=="function")return me(e,or(e));if(typeof e=="string")return L(e);switch(e){case k:return L("Suspense");case E:return L("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case h:return tr(e.render);case T:return Y(e.type,r,t);case C:{var o=e,s=o._payload,c=o._init;try{return Y(c(s),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,pe={},Ee=j.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}function ar(e,r,t,o,s){{var c=Function.call.bind(U);for(var l in e)if(c(e,l)){var i=void 0;try{if(typeof e[l]!="function"){var p=Error((o||"React class")+": "+t+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}i=e[l](r,l,o,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(d){i=d}i&&!(i instanceof Error)&&(V(s),m("%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",t,l,typeof i),V(null)),i instanceof Error&&!(i.message in pe)&&(pe[i.message]=!0,V(s),m("Failed %s type: %s",t,i.message),V(null))}}}var ir=Array.isArray;function X(e){return ir(e)}function lr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ur(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function be(e){if(ur(e))return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",lr(e)),ye(e)}var B=j.ReactCurrentOwner,sr={key:!0,ref:!0,__self:!0,__source:!0},Te,we,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 t=w(B.current.type);Z[t]||(m('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',w(B.current.type),e.ref),Z[t]=!0)}}function vr(e,r){{var t=function(){Te||(Te=!0,m("%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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function gr(e,r){{var t=function(){we||(we=!0,m("%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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var hr=function(e,r,t,o,s,c,l){var i={$$typeof:u,type:e,key:r,ref:t,props:l,_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 mr(e,r,t,o,s){{var c,l={},i=null,p=null;t!==void 0&&(be(t),i=""+t),fr(r)&&(be(r.key),i=""+r.key),cr(r)&&(p=r.ref,dr(r,s));for(c in r)U.call(r,c)&&!sr.hasOwnProperty(c)&&(l[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)l[c]===void 0&&(l[c]=d[c])}if(i||p){var v=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&vr(l,v),p&&gr(l,v)}return hr(e,i,p,s,o,B.current,l)}}var Q=j.ReactCurrentOwner,Re=j.ReactDebugCurrentFrame;function x(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}var ee;ee=!1;function re(e){return typeof e=="object"&&e!==null&&e.$$typeof===u}function _e(){{if(Q.current){var e=w(Q.current.type);if(e)return`
|
|
14
14
|
|
|
15
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
15
|
+
Check the render method of \``+e+"`."}return""}}function pr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
16
16
|
|
|
17
|
-
Check your code at `+r+":"+
|
|
17
|
+
Check your code at `+r+":"+t+"."}return""}}var Pe={};function Er(e){{var r=_e();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+
|
|
19
|
+
Check the top-level render call using <`+t+">.")}return r}}function Se(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Er(r);if(Pe[t])return;Pe[t]=!0;var o="";e&&e._owner&&e._owner!==Q.current&&(o=" It was passed a child from "+w(e._owner.type)+"."),x(e),m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,o),x(null)}}function Ce(e,r){{if(typeof e!="object")return;if(X(e))for(var t=0;t<e.length;t++){var o=e[t];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),l;!(l=c.next()).done;)re(l.value)&&Se(l.value,r)}}}function yr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===h||r.$$typeof===T))t=r.propTypes;else return;if(t){var o=w(r);ar(t,e.props,"prop",o,e)}else if(r.PropTypes!==void 0&&!ee){ee=!0;var s=w(r);m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function br(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var o=r[t];if(o!=="children"&&o!=="key"){x(e),m("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),m("Invalid attribute `ref` supplied to `React.Fragment`."),x(null))}}function Oe(e,r,t,o,s,c){{var l=Ze(e);if(!l){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 p=pr(s);p?i+=p:i+=_e();var d;e===null?d="null":X(e)?d="array":e!==void 0&&e.$$typeof===u?(d="<"+(w(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,m("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=mr(e,r,t,s,c);if(v==null)return v;if(l){var y=r.children;if(y!==void 0)if(o)if(X(y)){for(var A=0;A<y.length;A++)Ce(y[A],e);Object.freeze&&Object.freeze(y)}else m("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(y,e)}return e===a?br(v):yr(v),v}}function Tr(e,r,t){return Oe(e,r,t,!0)}function wr(e,r,t){return Oe(e,r,t,!1)}var Rr=wr,_r=Tr;D.Fragment=a,D.jsx=Rr,D.jsxs=_r}()),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 <`+n+">.")}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
|
|
27
|
+
*/var te;function xe(){if(te)return F;te=1;var n=P,u=Symbol.for("react.element"),g=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,f=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,b={key:!0,ref:!0,__self:!0,__source:!0};function I(S,h,k){var E,T={},C=null,W=null;k!==void 0&&(C=""+k),h.key!==void 0&&(C=""+h.key),h.ref!==void 0&&(W=h.ref);for(E in h)a.call(h,E)&&!b.hasOwnProperty(E)&&(T[E]=h[E]);if(S&&S.defaultProps)for(E in h=S.defaultProps,h)T[E]===void 0&&(T[E]=h[E]);return{$$typeof:u,type:S,key:C,ref:W,props:T,_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(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Fe=function(n,u,g){var a=document.head||document.getElementsByTagName("head")[0],f=document.createElement("script");typeof u=="function"&&(g=u,u={}),u=u||{},g=g||function(){},f.type=u.type||"text/javascript",f.charset=u.charset||"utf8",f.async="async"in u?!!u.async:!0,f.src=n,u.attrs&&Ie(f,u.attrs),u.text&&(f.text=""+u.text);var b="onload"in f?oe:Me;b(f,g),f.onload||oe(f,g),a.appendChild(f)};function Ie(n,u){for(var g in u)n.setAttribute(g,u[g])}function oe(n,u){n.onload=function(){this.onerror=this.onload=null,u(null,n)},n.onerror=function(){this.onerror=this.onload=null,u(new Error("Failed to load "+this.src),n)}}function Me(n,u){n.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,u(null,n))}}const Be=De(Fe),We="https://d5aoblv5p04cg.cloudfront.net/editor-3/loader/build.js",Le="https://d5aoblv5p04cg.cloudfront.net/develop/loader/build.js",Ne="https://d5aoblv5p04cg.cloudfront.net/staging/loader/build.js";function Ye(n="production"){switch(n){case"dev":return Le;case"staging":return Ne;default:return We}}const z={init:(n,u)=>new Promise((g,a)=>{const f=Ye(u==null?void 0:u.stage);Be(f,b=>{b!==null&&a(b),window.TopolPlugin.init(n),g(!0)})}),save:()=>{window.TopolPlugin.save()},load:n=>{window.TopolPlugin.load(n)},togglePreview:()=>{window.TopolPlugin.togglePreview()},togglePreviewSize:()=>{window.TopolPlugin.togglePreviewSize()},chooseFile:n=>{window.TopolPlugin.chooseFile(n)},undo:()=>{window.TopolPlugin.undo()},redo:()=>{window.TopolPlugin.redo()},destroy:()=>{window.TopolPlugin.destroy()},setSavedBlocks:n=>{window.TopolPlugin.setSavedBlocks(n)},setPreviewHTML:n=>{window.TopolPlugin.setPreviewHTML(n)},createNotification:n=>{window.TopolPlugin.createNotification(n)},setActiveMembers:n=>{window.TopolPlugin.setActiveMembers(n)},changeEmailToMobile:()=>{window.TopolPlugin.changeEmailToMobile()},changeEmailToDesktop:()=>{window.TopolPlugin.changeEmailToDesktop()},toggleBlocksAndStructuresVisibility:()=>{window.TopolPlugin.toggleBlocksAndStructuresVisibility()},updateCustomBlockContent:n=>{window.TopolPlugin.updateCustomBlockContent(n)},refreshComments:n=>{window.TopolPlugin.refreshComments(n)},refreshSyncedRows:()=>{window.TopolPlugin.refreshSyncedRows()},openPremadeTemplatesSelection:()=>{window.TopolPlugin.openPremadeTemplatesSelection()},updateApiAuthorizationHeader:n=>{window.TopolPlugin.updateApiAuthorizationHeader(n)},setTemplateName:n=>{window.TopolPlugin.setTemplateName(n)}},Ue="editor";let H=!1,J=!1;function Ve(n){const u=()=>{const g={onSave(a,f){n.onSave!==void 0&&n.onSave(a,f)},onSaveAndClose(a,f){n.onSaveAndClose!==void 0&&n.onSaveAndClose(a,f)},onTestSend(a,f,b){n.onTestSend!==void 0&&n.onTestSend(a,f,b)},onOpenFileManager(){n.onOpenFileManager!==void 0&&n.onOpenFileManager()},onLoaded(){n.onLoaded!==void 0&&n.onLoaded()},onBlockSave(a){n.onBlockSave!==void 0&&n.onBlockSave(a)},onBlockRemove(a){n.onBlockRemove!==void 0&&n.onBlockRemove(a)},onBlockEdit(a){n.onBlockEdit!==void 0&&n.onBlockEdit(a)},onInit(){n.onInit!==void 0&&n.onInit(),H=!1,J=!0},onUndoChange(a){n.onUndoChange!==void 0&&n.onUndoChange(a)},onRedoChange(a){n.onRedoChange!==void 0&&n.onRedoChange(a)},onPreview(a){n.onPreview!==void 0&&n.onPreview(a)},onAlert(a){n.onAlert!==void 0&&n.onAlert(a)},onClose(){n.onClose!==void 0&&n.onClose()},onEdittedWithoutSaveChanged(a){n.onEdittedWithoutSaveChanged!==void 0&&n.onEdittedWithoutSaveChanged(a)},onOpenCustomBlockDialog(a){n.onOpenCustomBlockDialog!==void 0&&n.onOpenCustomBlockDialog(a)},onTemplateRename(a){n.onTemplateRename!==void 0&&n.onTemplateRename(a)},updateTestingEmailAddresses(a){n.updateTestingEmailAddresses!==void 0&&n.updateTestingEmailAddresses(a)},onError(a,f){n.onError!==void 0&&n.onError(a,f)}};return{id:"#"+Ue,...n.options,callbacks:{...g}}};return P.useEffect(()=>(H||(async()=>{H=!0;const a=u();await z.init(a,{stage:n.stage||"production"})})(),()=>{J&&(z.destroy(),J=!1)}),[]),Ae.jsx("div",{id:"editor",style:{position:"absolute",height:"100vh",width:"100%"}})}_.TopolPlugin=z,_.default=Ve,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -16,9 +16,12 @@ type TopolEditorProps = {
|
|
|
16
16
|
onRedoChange?(count: number): void;
|
|
17
17
|
onPreview?(html: unknown): void;
|
|
18
18
|
onAlert?(notification: INotification): void;
|
|
19
|
+
onClose?(): void;
|
|
20
|
+
onEdittedWithoutSaveChanged?(hasUnsavedChanges: boolean): void;
|
|
19
21
|
onOpenCustomBlockDialog?(blockContent: unknown): void;
|
|
20
22
|
onTemplateRename?(title: string): void;
|
|
21
23
|
updateTestingEmailAddresses?(emails: string[]): void;
|
|
24
|
+
onError?(type: string, message: string): void;
|
|
22
25
|
};
|
|
23
26
|
export default function TopolEditor(props: TopolEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
24
27
|
export type { IReactTopolOptions, INotification, ISavedBlock };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ITopolOptions } from '@topol.io/editor';
|
|
2
|
-
export type IReactTopolOptions = Omit<ITopolOptions, 'id'>;
|
|
2
|
+
export type IReactTopolOptions = Omit<ITopolOptions, 'id' | 'callbacks'>;
|
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.1.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.0
|
|
33
|
+
"@topol.io/editor": "0.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^20.7.0",
|