@grapesjs/studio-sdk-plugins 1.0.17 → 1.0.18
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/LICENSE.md +1 -0
- package/dist/flexComponent/index.cjs.js +1 -1
- package/dist/flexComponent/index.es.js +1 -1
- package/dist/flexComponent/index.umd.js +1 -1
- package/dist/index.cjs.js +142 -39
- package/dist/index.es.js +4224 -4117
- package/dist/index.umd.js +145 -42
- package/dist/rteTinyMce/index.cjs.js +104 -1
- package/dist/rteTinyMce/index.es.js +262 -155
- package/dist/rteTinyMce/index.umd.js +104 -1
- package/dist/rteTinyMce/styles.d.ts +1 -0
- package/dist/rteTinyMce/typesSchema.d.ts +5 -0
- package/dist/utils.d.ts +5 -0
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
var p = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(p || {}), y = /* @__PURE__ */ ((t) => (t.toastAdd = "studio:toastAdd", t.dialogOpen = "studio:dialogOpen", t.dialogClose = "studio:dialogClose", t.sidebarLeftSet = "studio:sidebarLeft:set", t.sidebarLeftGet = "studio:sidebarLeft:get", t.sidebarLeftToggle = "studio:sidebarLeft:toggle", t.sidebarRightSet = "studio:sidebarRight:set", t.sidebarRightGet = "studio:sidebarRight:get", t.sidebarRightToggle = "studio:sidebarRight:toggle", t.sidebarTopSet = "studio:sidebarTop:set", t.sidebarTopGet = "studio:sidebarTop:get", t.sidebarTopToggle = "studio:sidebarTop:toggle", t.sidebarBottomSet = "studio:sidebarBottom:set", t.sidebarBottomGet = "studio:sidebarBottom:get", t.sidebarBottomToggle = "studio:sidebarBottom:toggle", t.symbolAdd = "studio:symbolAdd", t.symbolDetach = "studio:symbolDetach", t.symbolOverride = "studio:symbolOverride", t.symbolPropagateStyles = "studio:propagateStyles", t.getPagesConfig = "studio:getPagesConfig", t.setPagesConfig = "studio:setPagesConfig", t.getPageSettings = "studio:getPageSettings", t.setPageSettings = "studio:setPageSettings", t.projectFiles = "studio:projectFiles", t.canvasReload = "studio:canvasReload", t.getBlocksPanel = "studio:getBlocksPanel", t.setBlocksPanel = "studio:setBlocksPanel", t.getStateContextMenu = "studio:getStateContextMenu", t.setStateContextMenu = "studio:setStateContextMenu", t.contextMenuComponent = "studio:contextMenuComponent", t.layoutAdd = "studio:layoutAdd", t.layoutRemove = "studio:layoutRemove", t.layoutToggle = "studio:layoutToggle", t.layoutUpdate = "studio:layoutUpdate", t.layoutGet = "studio:layoutGet", t.layoutConfigGet = "studio:layoutConfigGet", t.layoutConfigSet = "studio:layoutConfigSet", t.getStateTheme = "studio:getStateTheme", t.setStateTheme = "studio:setStateTheme", t.assetProviderGet = "studio:assetProviderGet", t.assetProviderAdd = "studio:assetProviderAdd", t.assetProviderRemove = "studio:assetProviderRemove", t.fontGet = "studio:fontGet", t.fontAdd = "studio:fontAdd", t.fontRemove = "studio:fontRemove", t))(y || {}), A = /* @__PURE__ */ ((t) => (t.dark = "dark", t.light = "light", t.auto = "auto", t))(A || {});
|
|
2
|
+
const D = "app.grapesjs.com", O = "app-stage.grapesjs.com", R = [
|
|
2
3
|
D,
|
|
3
4
|
O,
|
|
4
5
|
"localhost",
|
|
@@ -9,144 +10,249 @@ const D = "app.grapesjs.com", O = "app-stage.grapesjs.com", k = [
|
|
|
9
10
|
// For stackblitz.com demos
|
|
10
11
|
"-sandpack.codesandbox.io"
|
|
11
12
|
// For Sandpack demos
|
|
12
|
-
],
|
|
13
|
-
const
|
|
14
|
-
return !!
|
|
13
|
+
], M = "license:check:start", B = "license:check:end", C = () => typeof window < "u", G = ({ isDev: t, isStage: n }) => `${t ? "" : `https://${n ? O : D}`}/api`, N = () => {
|
|
14
|
+
const t = C() && window.location.hostname;
|
|
15
|
+
return !!t && (R.includes(t) || R.some((n) => t.endsWith(n)));
|
|
15
16
|
};
|
|
16
17
|
async function U({
|
|
17
|
-
path:
|
|
18
|
-
baseApiUrl:
|
|
18
|
+
path: t,
|
|
19
|
+
baseApiUrl: n,
|
|
19
20
|
method: o = "GET",
|
|
20
|
-
headers:
|
|
21
|
-
params:
|
|
22
|
-
body:
|
|
21
|
+
headers: r = {},
|
|
22
|
+
params: a,
|
|
23
|
+
body: l
|
|
23
24
|
}) {
|
|
24
|
-
const
|
|
25
|
+
const c = `${n || G({ isDev: !1, isStage: !1 })}${t}`, i = {
|
|
25
26
|
method: o,
|
|
26
27
|
headers: {
|
|
27
28
|
"Content-Type": "application/json",
|
|
28
|
-
...
|
|
29
|
+
...r
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
34
|
-
throw new Error(`HTTP error! status: ${
|
|
35
|
-
return
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[h.enterprise]: 30
|
|
32
|
+
l && (i.body = JSON.stringify(l));
|
|
33
|
+
const u = a ? new URLSearchParams(a).toString() : "", e = u ? `?${u}` : "", s = await fetch(`${c}${e}`, i);
|
|
34
|
+
if (!s.ok)
|
|
35
|
+
throw new Error(`HTTP error! status: ${s.status}`);
|
|
36
|
+
return s.json();
|
|
37
|
+
}
|
|
38
|
+
const _ = {
|
|
39
|
+
[p.free]: 0,
|
|
40
|
+
[p.startup]: 10,
|
|
41
|
+
[p.business]: 20,
|
|
42
|
+
[p.enterprise]: 30
|
|
43
43
|
};
|
|
44
|
-
function W(
|
|
45
|
-
const
|
|
46
|
-
return
|
|
47
|
-
}
|
|
48
|
-
const
|
|
49
|
-
async function
|
|
50
|
-
editor:
|
|
51
|
-
plan:
|
|
44
|
+
function W(t) {
|
|
45
|
+
const n = t;
|
|
46
|
+
return n.init = (o) => (r) => t(r, o), n;
|
|
47
|
+
}
|
|
48
|
+
const j = (t) => /* @__PURE__ */ W(t);
|
|
49
|
+
async function $({
|
|
50
|
+
editor: t,
|
|
51
|
+
plan: n,
|
|
52
52
|
pluginName: o,
|
|
53
|
-
licenseKey:
|
|
54
|
-
cleanup:
|
|
53
|
+
licenseKey: r,
|
|
54
|
+
cleanup: a
|
|
55
55
|
}) {
|
|
56
|
-
let
|
|
57
|
-
const
|
|
58
|
-
console.warn("Cleanup plugin:", o, "Reason:",
|
|
59
|
-
},
|
|
60
|
-
var
|
|
61
|
-
const { error:
|
|
62
|
-
if (!(
|
|
63
|
-
|
|
64
|
-
else if (
|
|
65
|
-
const
|
|
66
|
-
|
|
56
|
+
let l = "", g = !1;
|
|
57
|
+
const c = N(), i = (e) => {
|
|
58
|
+
console.warn("Cleanup plugin:", o, "Reason:", e), a();
|
|
59
|
+
}, u = (e = {}) => {
|
|
60
|
+
var v;
|
|
61
|
+
const { error: s, sdkLicense: d } = e, b = (v = e.plan) == null ? void 0 : v.category;
|
|
62
|
+
if (!(d || e.license) || s)
|
|
63
|
+
i(s || "Invalid license");
|
|
64
|
+
else if (b) {
|
|
65
|
+
const k = _[n], x = _[b];
|
|
66
|
+
k > x && i({ pluginRequiredPlan: n, licensePlan: b });
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}),
|
|
72
|
-
|
|
69
|
+
t.on(M, (e) => {
|
|
70
|
+
l = e == null ? void 0 : e.baseApiUrl, g = !0;
|
|
71
|
+
}), t.on(B, (e) => {
|
|
72
|
+
u(e);
|
|
73
73
|
}), setTimeout(async () => {
|
|
74
|
-
if (!
|
|
75
|
-
if (
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
|
|
74
|
+
if (!g) {
|
|
75
|
+
if (c) return;
|
|
76
|
+
if (r) {
|
|
77
|
+
const e = await F({ licenseKey: r, pluginName: o, baseApiUrl: l });
|
|
78
|
+
e && u(e);
|
|
79
79
|
} else
|
|
80
|
-
|
|
80
|
+
i("The `licenseKey` option not provided");
|
|
81
81
|
}
|
|
82
82
|
}, 2e3);
|
|
83
83
|
}
|
|
84
|
-
async function
|
|
85
|
-
const { licenseKey:
|
|
84
|
+
async function F(t) {
|
|
85
|
+
const { licenseKey: n, pluginName: o, baseApiUrl: r } = t;
|
|
86
86
|
try {
|
|
87
87
|
return (await U({
|
|
88
|
-
baseApiUrl:
|
|
89
|
-
path: `/sdk/${
|
|
88
|
+
baseApiUrl: r,
|
|
89
|
+
path: `/sdk/${n || "na"}`,
|
|
90
90
|
method: "POST",
|
|
91
91
|
params: {
|
|
92
92
|
d: window.location.hostname,
|
|
93
93
|
pn: o
|
|
94
94
|
}
|
|
95
95
|
})).result || {};
|
|
96
|
-
} catch (
|
|
97
|
-
return console.error("Error during SDK license check:",
|
|
96
|
+
} catch (a) {
|
|
97
|
+
return console.error("Error during SDK license check:", a), !1;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
const K = (t, n, o) => {
|
|
101
|
+
const { doc: r = document } = o, a = o.target || r.head, l = a.querySelector(`style[${t}]`) || r.createElement("style");
|
|
102
|
+
l.setAttribute(t, "true"), l.innerHTML = n, !a.contains(l) && a.appendChild(l);
|
|
103
|
+
}, q = (t) => t.dispatchEvent(new CustomEvent("input"));
|
|
104
|
+
function H(t, n) {
|
|
105
|
+
if (!n) return () => {
|
|
103
106
|
};
|
|
104
|
-
const o =
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
if (
|
|
110
|
-
const
|
|
111
|
-
|
|
107
|
+
const o = t.Components.events, r = (e) => t.getSelectedAll().includes(e), a = (e) => e.isInstanceOf("text") && !e.isChildOf("text"), l = (e) => e.isChildOf("text"), g = (e) => t.getEditing() === e, c = (e, s = {}) => {
|
|
108
|
+
e.trigger("focus", s.event);
|
|
109
|
+
}, i = (e, s) => {
|
|
110
|
+
r(e) && a(e) && !g(e) && c(e, s);
|
|
111
|
+
}, u = (e, s) => {
|
|
112
|
+
if (r(e) && !a(e) && l(e)) {
|
|
113
|
+
const d = e.parents().find((b) => b.isInstanceOf("text"));
|
|
114
|
+
d && (c(d, s), setTimeout(() => t.select(d), 0));
|
|
112
115
|
}
|
|
113
116
|
};
|
|
114
|
-
return
|
|
115
|
-
|
|
117
|
+
return t.on(o.select, i), t.on(o.selectBefore, u), () => {
|
|
118
|
+
t.off(o.select, i), t.off(o.selectBefore, u);
|
|
116
119
|
};
|
|
117
120
|
}
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
121
|
+
const z = `
|
|
122
|
+
.tox .tox-toolbar,
|
|
123
|
+
.tox .tox-toolbar__overflow,
|
|
124
|
+
.tox .tox-toolbar__primary,
|
|
125
|
+
.tox .tox-menu,
|
|
126
|
+
.tox .tox-dialog,
|
|
127
|
+
.tox .tox-toolbar-overlord,
|
|
128
|
+
.tox .tox-dialog__header,
|
|
129
|
+
.tox .tox-dialog__footer {
|
|
130
|
+
background-color: var(--gs-theme-cl-glb-bg3);
|
|
131
|
+
color: var(--gs-theme-cl-glb-txt);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.tox .tox-collection__item,
|
|
135
|
+
.tox .tox-label,
|
|
136
|
+
.tox .tox-toolbar-label {
|
|
137
|
+
color: var(--gs-theme-cl-glb-txt);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.tox.tox-tinymce-inline .tox-editor-header {
|
|
141
|
+
border-color: var(--gs-theme-cl-glb-br);
|
|
142
|
+
background-color: var(--gs-theme-cl-glb-bg3);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.tox .tox-button {
|
|
146
|
+
background-color: var(--gs-theme-cl-prm-bg1);
|
|
147
|
+
border-color: var(--gs-theme-cl-prm-bg1);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.tox .tox-button:hover:not(:disabled) {
|
|
151
|
+
background-color: var(--gs-theme-cl-prm-bgh);
|
|
152
|
+
border-color: var(--gs-theme-cl-prm-bgh);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.tox .tox-button--secondary {
|
|
156
|
+
background-color: var(--gs-theme-cl-glb-bg2);
|
|
157
|
+
border-color: var(--gs-theme-cl-glb-br);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.tox .tox-button--secondary:hover:not(:disabled) {
|
|
161
|
+
background-color: var(--gs-theme-cl-glb-bgh);
|
|
162
|
+
border-color: var(--gs-theme-cl-glb-bgh);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.tox .tox-tbtn {
|
|
166
|
+
color: currentColor;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.tox .tox-listboxfield .tox-listbox--select,
|
|
170
|
+
.tox .tox-textarea,
|
|
171
|
+
.tox .tox-tbtn--bespoke,
|
|
172
|
+
.tox .tox-textarea-wrap .tox-textarea:focus,
|
|
173
|
+
.tox .tox-textfield,
|
|
174
|
+
.tox .tox-toolbar-textfield {
|
|
175
|
+
background-color: var(--gs-theme-cl-glb-bgh);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.tox .tox-custom-editor:focus-within,
|
|
179
|
+
.tox .tox-listboxfield .tox-listbox--select:focus,
|
|
180
|
+
.tox .tox-textarea-wrap:focus-within,
|
|
181
|
+
.tox .tox-textarea:focus,
|
|
182
|
+
.tox .tox-textfield:focus {
|
|
183
|
+
background-color: var(--gs-theme-cl-glb-bgh);
|
|
184
|
+
border-color: var(--gs-theme-cl-prm-bg1);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.tox .tox-tbtn:hover,
|
|
188
|
+
.tox .tox-tbtn--enabled,
|
|
189
|
+
.tox .tox-tbtn--enabled:hover,
|
|
190
|
+
.tox .tox-tbtn:active,
|
|
191
|
+
.tox .tox-tbtn:focus,
|
|
192
|
+
.tox .tox-swatches__picker-btn:hover,
|
|
193
|
+
.tox .tox-collection--list .tox-collection__item--enabled,
|
|
194
|
+
.tox .tox-collection--toolbar .tox-collection__item--enabled,
|
|
195
|
+
.tox .tox-split-button:focus {
|
|
196
|
+
background-color: var(--gs-theme-cl-prm-bg1);
|
|
197
|
+
color: var(--gs-theme-cl-prm-txt);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.tox .tox-collection--list .tox-collection__item--active,
|
|
201
|
+
.tox .tox-collection--toolbar .tox-collection__item--active {
|
|
202
|
+
background-color: var(--gs-theme-cl-prm-bgh);
|
|
203
|
+
color: var(--gs-theme-cl-prm-txt) !important;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.tox .tox-split-button:hover {
|
|
207
|
+
box-shadow: 0 0 0 1px var(--gs-theme-cl-glb-bgh) inset;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.tox .tox-dialog__body-nav-item--active {
|
|
211
|
+
color: var(--gs-theme-cl-prm-bg1);
|
|
212
|
+
border-color: var(--gs-theme-cl-prm-bg1);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.tox .tox-tbtn svg,
|
|
216
|
+
.tox .tox-tbtn:hover svg {
|
|
217
|
+
fill: currentColor;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.tox .tox-insert-table-picker .tox-insert-table-picker__selected {
|
|
221
|
+
background-color: var(--gs-theme-cl-prm-bg1);
|
|
222
|
+
border-color: var(--gs-theme-cl-prm-bg3);
|
|
223
|
+
opacity: 0.75;
|
|
224
|
+
}`, T = /* @__PURE__ */ new WeakMap(), S = (t, n) => {
|
|
225
|
+
T.set(t, n);
|
|
226
|
+
}, V = (t) => {
|
|
227
|
+
T.delete(t);
|
|
228
|
+
}, w = (t) => T.get(t), m = (t) => {
|
|
229
|
+
const n = t.target, o = n.closest(".tox"), r = n.matches(".ephox-snooker-resizer-bar");
|
|
230
|
+
(o || r) && t.stopPropagation();
|
|
231
|
+
}, P = (t) => {
|
|
232
|
+
t.stopPropagation(), t.preventDefault();
|
|
233
|
+
}, J = (t, n) => {
|
|
234
|
+
const o = t.getDoc(), r = t.getWin();
|
|
235
|
+
if (n != null && n.event) {
|
|
236
|
+
const { event: a } = n, { clientX: l, clientY: g } = a;
|
|
237
|
+
let c;
|
|
132
238
|
if (o.caretRangeFromPoint)
|
|
133
|
-
|
|
239
|
+
c = o.caretRangeFromPoint(l, g);
|
|
134
240
|
else if (o.caretPositionFromPoint) {
|
|
135
|
-
const
|
|
136
|
-
|
|
241
|
+
const i = o.caretPositionFromPoint(l, g);
|
|
242
|
+
c = o.createRange(), c == null || c.setStart(i.offsetNode, i.offset);
|
|
137
243
|
}
|
|
138
|
-
if (
|
|
139
|
-
const
|
|
140
|
-
|
|
244
|
+
if (c) {
|
|
245
|
+
const i = r.getSelection();
|
|
246
|
+
i == null || i.removeAllRanges(), i == null || i.addRange(c), t.selection.setRng(c);
|
|
141
247
|
}
|
|
142
248
|
} else
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
var
|
|
146
|
-
const { el:
|
|
147
|
-
target:
|
|
249
|
+
t.execCommand("SelectAll");
|
|
250
|
+
}, X = (t) => {
|
|
251
|
+
var u, e;
|
|
252
|
+
const { el: n, editor: o, componentView: r } = t, a = o.runCommand(y.getStateTheme), l = r.model, g = {
|
|
253
|
+
target: n,
|
|
148
254
|
inline: !0,
|
|
149
|
-
skin: (
|
|
255
|
+
skin: (a == null ? void 0 : a.theme) === A.dark ? "oxide-dark" : "oxide",
|
|
150
256
|
menubar: !1,
|
|
151
257
|
image_advtab: !0,
|
|
152
258
|
paste_data_images: !0,
|
|
@@ -160,85 +266,86 @@ const E = /* @__PURE__ */ new WeakMap(), q = (e, s) => {
|
|
|
160
266
|
plugins: "advlist autolink lists link image media table",
|
|
161
267
|
toolbar_mode: "sliding",
|
|
162
268
|
toolbar: "bold italic underline strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify link image | fontfamily fontsize bullist numlist outdent indent table"
|
|
163
|
-
},
|
|
269
|
+
}, c = ((e = (u = t.pluginOpts) == null ? void 0 : u.loadConfig) == null ? void 0 : e.call(u, { config: g, editor: o, componentView: r, component: l })) || {};
|
|
164
270
|
return {
|
|
165
|
-
...
|
|
166
|
-
...
|
|
271
|
+
...g,
|
|
272
|
+
...c
|
|
167
273
|
};
|
|
168
|
-
},
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
171
|
-
const
|
|
172
|
-
|
|
274
|
+
}, L = (t, n = document) => new Promise((o, r) => {
|
|
275
|
+
const a = Array.isArray(t) ? [...t] : [t], { head: l } = n, g = (c) => {
|
|
276
|
+
if (c.length) {
|
|
277
|
+
const i = n.createElement("script");
|
|
278
|
+
i.src = c.shift(), i.onload = g.bind(null, c), i.onerror = r, l.appendChild(i);
|
|
173
279
|
} else
|
|
174
280
|
o();
|
|
175
281
|
};
|
|
176
|
-
|
|
177
|
-
}),
|
|
282
|
+
g(a);
|
|
283
|
+
}), Y = "rteTinyMce", Q = function(t, n = {}) {
|
|
178
284
|
const o = {
|
|
179
285
|
cdnScript: "https://cdn.jsdelivr.net/npm/tinymce@6.8.5/tinymce.min.js",
|
|
180
|
-
...
|
|
181
|
-
}, { cdnScript:
|
|
182
|
-
const
|
|
183
|
-
if (!
|
|
184
|
-
console.warn("Missing required data", { win:
|
|
286
|
+
...n
|
|
287
|
+
}, { cdnScript: r } = o, a = t.Canvas.events, l = !o.skipCustomTheme, g = "gs-plg-tinymce-studio-theme", c = async (e, s) => {
|
|
288
|
+
const d = e.ownerDocument, b = d.defaultView, f = s == null ? void 0 : s.view;
|
|
289
|
+
if (!b || !f) {
|
|
290
|
+
console.warn("Missing required data", { win: b, componentView: f });
|
|
185
291
|
return;
|
|
186
292
|
}
|
|
187
|
-
const
|
|
188
|
-
el:
|
|
189
|
-
editor:
|
|
190
|
-
componentView:
|
|
293
|
+
const v = X({
|
|
294
|
+
el: e,
|
|
295
|
+
editor: t,
|
|
296
|
+
componentView: f,
|
|
191
297
|
pluginOpts: o
|
|
192
|
-
}),
|
|
193
|
-
if (!
|
|
194
|
-
const
|
|
195
|
-
...
|
|
298
|
+
}), x = (await b.tinymce.init(v))[0];
|
|
299
|
+
if (!x) return;
|
|
300
|
+
const I = (await window.tinymce.init({
|
|
301
|
+
...v,
|
|
196
302
|
target: document.createElement("div")
|
|
197
303
|
}))[0];
|
|
198
|
-
return
|
|
199
|
-
var
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
304
|
+
return x.ui.show(), d.body.addEventListener("mousedown", m), document.body.addEventListener("mousedown", m), x.on("Change", () => q(e)), x.on("blur", () => x.ui.show()), x.on("OpenWindow", function() {
|
|
305
|
+
var E;
|
|
306
|
+
const h = (E = d.querySelector(".tox-dialog")) == null ? void 0 : E.closest(".tox");
|
|
307
|
+
h && (h == null ? void 0 : h.ownerDocument) !== document && (document.body.appendChild(h), x.once("CloseWindow", () => {
|
|
308
|
+
h && h.ownerDocument === document && d.body.appendChild(h);
|
|
203
309
|
}));
|
|
204
|
-
}),
|
|
205
|
-
},
|
|
206
|
-
|
|
310
|
+
}), e.addEventListener("dragstart", P, { capture: !0 }), t.runCommand(y.setStateContextMenu, { enabled: !1 }), J(x, s), { rteEditor: x, rteEditorShallow: I };
|
|
311
|
+
}, i = (e, s) => {
|
|
312
|
+
e.ownerDocument.body.removeEventListener("mousedown", m), document.body.removeEventListener("mousedown", m), e.removeEventListener("dragstart", P, { capture: !0 }), t.runCommand(y.setStateContextMenu, { enabled: !0 }), s.rteEditor.destroy(), s.rteEditorShallow.destroy();
|
|
207
313
|
};
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
314
|
+
t.on(a.frameLoad, async ({ window: e }) => {
|
|
315
|
+
const s = e.document;
|
|
316
|
+
L(r, s);
|
|
317
|
+
}), t.onReady(() => {
|
|
318
|
+
L(r, document), l && K(g, z, { target: document.body });
|
|
319
|
+
}), t.setCustomRte({
|
|
213
320
|
parseContent: !0,
|
|
214
321
|
// @ts-expect-error - Type 'CustomRteOptions' is missing the following properties from type 'CustomRteOptions': editor, component, el
|
|
215
|
-
async enable(
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
218
|
-
const
|
|
219
|
-
return
|
|
322
|
+
async enable(e, s, d) {
|
|
323
|
+
const b = w(e);
|
|
324
|
+
if (b) return b.rteEditor;
|
|
325
|
+
const f = await c(e, d);
|
|
326
|
+
return f && S(e, f), f == null ? void 0 : f.rteEditor;
|
|
220
327
|
},
|
|
221
|
-
disable(
|
|
222
|
-
const
|
|
223
|
-
|
|
328
|
+
disable(e) {
|
|
329
|
+
const s = w(e);
|
|
330
|
+
s && (V(e), i(e, s));
|
|
224
331
|
},
|
|
225
|
-
getContent(
|
|
226
|
-
var
|
|
227
|
-
const
|
|
228
|
-
return
|
|
332
|
+
getContent(e) {
|
|
333
|
+
var d, b;
|
|
334
|
+
const s = w(e);
|
|
335
|
+
return s ? (b = (d = s.rteEditor).getContent) == null ? void 0 : b.call(d) : e.innerHTML;
|
|
229
336
|
}
|
|
230
337
|
});
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
editor:
|
|
338
|
+
const u = H(t, o.enableOnClick);
|
|
339
|
+
$({
|
|
340
|
+
editor: t,
|
|
234
341
|
licenseKey: o.licenseKey,
|
|
235
|
-
plan:
|
|
236
|
-
pluginName:
|
|
342
|
+
plan: p.startup,
|
|
343
|
+
pluginName: Y,
|
|
237
344
|
cleanup: () => {
|
|
238
|
-
|
|
345
|
+
t.RichTextEditor.customRte = void 0, u();
|
|
239
346
|
}
|
|
240
347
|
});
|
|
241
|
-
},
|
|
348
|
+
}, ot = j(Q);
|
|
242
349
|
export {
|
|
243
|
-
|
|
350
|
+
ot as default
|
|
244
351
|
};
|