@getdraft/plugin 1.15.1 → 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,339 +1,297 @@
1
- var O = Object.defineProperty;
2
- var T = (o, t, e) => t in o ? O(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var a = (o, t, e) => T(o, typeof t != "symbol" ? t + "" : t, e);
4
- const b = "http://localhost:5174", D = "https://seplugin.sendsay.ru";
5
- class k extends Error {
6
- constructor(e, i) {
7
- super(i);
8
- a(this, "code");
9
- this.name = "DraftError", this.code = e;
10
- }
11
- }
12
- var H = /* @__PURE__ */ ((o) => (o.Audit = "audit", o.Guide = "guide", o.Style = "style", o.Blocks = "blocks", o))(H || {}), C = /* @__PURE__ */ ((o) => (o.Desktop = "desktop", o.Mobile = "mobile", o))(C || {});
13
- const x = async (o) => {
14
- try {
15
- const t = await fetch(o, { method: "HEAD" });
16
- if (!t.ok)
17
- return null;
18
- const e = t.headers.get("Content-Length");
19
- return e ? parseInt(e, 10) : null;
20
- } catch {
21
- return null;
22
- }
23
- }, P = (o) => new Promise((t, e) => {
24
- const i = new Image();
25
- i.onload = async () => {
26
- const n = await x(o) ?? 0;
27
- t({
28
- originalWidth: i.width,
29
- originalHeight: i.height,
30
- ratio: i.width / i.height,
31
- fileSize: n
32
- });
33
- }, i.onerror = (n) => {
34
- e(n);
35
- }, i.src = o;
36
- }), A = (o, t) => {
37
- if (o.length !== 1)
38
- return o;
39
- if (o.charCodeAt(0) >= 880) {
40
- if (t.indexOf("Key") === 0 && t.length === 4)
41
- return t.charAt(3);
42
- if (t.indexOf("Digit") === 0 && t.length === 6)
43
- return t.charAt(5);
44
- }
45
- return o;
46
- }, z = (o) => {
47
- let t = `${A(o.key, o.code)}`.toLowerCase() || o.key;
48
- const e = navigator.userAgent.includes("Mac OS");
49
- t === "backspace" && e && (t = "delete");
50
- const i = [];
51
- return (e && o.metaKey || !e && o.ctrlKey) && i.push("mod"), o.shiftKey && i.push("shift"), i.length > 0 && (t = `${i.join("-")}-${A(t, o.code)}`), t;
52
- }, U = /* @__PURE__ */ new Set([
53
- "escape",
54
- "mod-c",
55
- "mod-d",
56
- "mod-z",
57
- "mod-y",
58
- "mod-shift-z",
59
- "mod-v",
60
- "delete",
61
- "mod-g",
62
- "mod-p",
63
- "mod-s"
64
- ]), L = "1.15.1", M = {
65
- version: L
66
- }, K = () => {
67
- var r, s;
68
- const o = new RegExp("(^| )seplugin-dev=([^;]+)"), t = document.cookie.match(o), e = (s = t == null ? void 0 : (r = t[2]).toLowerCase) == null ? void 0 : s.call(r);
69
- if (e === "true")
70
- return b;
71
- if (e != null && e.startsWith("https://"))
72
- return e;
73
- const [i, n] = M.version.split(".");
74
- return `${D}/v${i}.${n}`;
75
- }, N = ({ token: o, pluginId: t, apiUrl: e }) => {
76
- if (!o)
77
- throw new Error("No [token] was provided");
78
- if (!t)
79
- throw new Error("No [pluginId] was provided");
80
- if (!e)
81
- throw new Error("No [apiUrl] was provided");
82
- }, W = (o) => {
83
- const t = document.createElement("iframe"), e = new URL(K());
84
- return e.searchParams.set("parentOrigin", o), t.src = e.toString(), t.setAttribute(
85
- "style",
86
- "height:100%;width:100%;min-width:960px;border:0px;"
87
- ), t.setAttribute("allow", "clipboard-read; clipboard-write"), t.setAttribute(
88
- "sandbox",
89
- "allow-scripts allow-same-origin allow-forms allow-popups allow-downloads"
90
- ), t;
91
- }, f = class f {
92
- constructor(t) {
93
- a(this, "iframe", null);
94
- a(this, "hotkeysAttached", !1);
95
- a(this, "iframeOrigin", null);
96
- a(this, "onHostHotkey", (t) => {
97
- var l;
98
- if (!this.captureHotkeysEnabled() || !((l = this.iframe) != null && l.contentWindow))
99
- return;
100
- const e = z(t);
101
- if (!U.has(e))
102
- return;
103
- const i = t.target;
104
- if (i && (i.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(i.tagName)))
105
- return;
106
- t.preventDefault();
107
- const { key: n, ctrlKey: r, metaKey: s, shiftKey: c, altKey: h } = t;
108
- this.postEvent("hostHotkey", {
109
- key: n,
110
- code: t.code,
111
- metaKey: s,
112
- ctrlKey: r,
113
- shiftKey: c,
114
- altKey: h,
115
- keyCode: e
116
- });
117
- });
118
- a(this, "onImageUpload", async ({
119
- id: t,
120
- ...e
121
- }) => {
122
- var i, n;
123
- try {
124
- const r = await ((n = (i = this.config.on).uploadImage) == null ? void 0 : n.call(i, e));
125
- let s = {};
126
- r && (s = await P(r)), this.postEvent("imageUploaded", { id: t, img: { ...s, url: r } });
127
- } catch {
128
- this.postEvent("imageUploaded", { id: t });
129
- }
130
- });
131
- a(this, "onLoadPersonalization", async () => {
132
- try {
133
- if (!this.config.on.loadPersonalization)
134
- throw new Error("No personalization loader provided");
135
- const t = await this.config.on.loadPersonalization();
136
- this.postEvent("loadPersonalization", {
137
- items: t
138
- });
139
- } catch {
140
- this.postEvent("loadPersonalization", {});
141
- }
142
- });
143
- a(this, "onGalleryOpen", async ({ id: t }) => {
144
- var i, n;
145
- const e = async (r) => {
146
- const s = { url: r };
147
- if (r) {
148
- const c = await P(r);
149
- Object.assign(s, c);
150
- }
151
- this.postEvent("imageUploaded", {
152
- id: t,
153
- img: s
154
- });
155
- };
156
- (n = (i = this.config.on).openGallery) == null || n.call(i, e);
157
- });
158
- a(this, "onMessage", (t) => {
159
- var r;
160
- if (t.source !== ((r = this.iframe) == null ? void 0 : r.contentWindow))
161
- return;
162
- const {
163
- data: { source: e, event: i, ...n }
164
- } = t;
165
- e === "DraftPlugin" && (i === "openGallery" ? this.onGalleryOpen(n) : i === "uploadImage" ? this.onImageUpload(n) : i === "loadPersonalization" ? this.onLoadPersonalization() : this.triggerEvent(
166
- this.config.on[i],
167
- n
168
- ));
169
- });
170
- a(this, "destroy", () => {
171
- var t;
172
- (t = this.iframe) == null || t.remove(), this.iframe = null, window.removeEventListener("message", this.onMessage), this.hotkeysAttached && (window.removeEventListener("keydown", this.onHostHotkey), this.hotkeysAttached = !1);
173
- });
174
- this.config = t;
175
- }
176
- captureHotkeysEnabled() {
177
- return this.config.disableHotkeysPassing !== !0;
178
- }
179
- promisedIframeMethod(t) {
180
- let e = null, i = null;
181
- const n = () => {
182
- e && (clearTimeout(e), e = null), i && (window.removeEventListener("message", i, !0), i = null);
183
- }, r = new Promise((s, c) => {
184
- const h = () => {
185
- e && clearTimeout(e), e = setTimeout(() => {
186
- n(), c(
187
- new k("timeout_error", `Action "${t}" timed out`)
188
- );
189
- }, f.HEARTBEAT_TIMEOUT);
190
- };
191
- i = (l) => {
192
- var g;
193
- if (l.source !== ((g = this.iframe) == null ? void 0 : g.contentWindow)) return;
194
- const { data: d } = l;
195
- if (d.source === "DraftPlugin") {
196
- if (d.event === "actionPing" && d.action === t) {
197
- l.stopPropagation(), h();
198
- return;
199
- }
200
- if (d.event === t) {
201
- l.stopPropagation(), n();
202
- const { source: y, event: v, ok: u, code: p, message: m, ...w } = d;
203
- u === !1 ? c(
204
- new k(
205
- p || "unknown_error",
206
- m || "Unknown error"
207
- )
208
- ) : s(w);
209
- }
210
- }
211
- }, window.addEventListener("message", i, !0), h();
212
- });
213
- return this.postEvent(t), r;
214
- }
215
- postEvent(t, e = {}) {
216
- if (this.iframe && this.iframe.contentWindow && this.iframeOrigin)
217
- this.iframe.contentWindow.postMessage(
218
- {
219
- ...e,
220
- event: t,
221
- source: "DraftPlugin"
222
- },
223
- this.iframeOrigin
224
- );
225
- else if (!this.iframeOrigin)
226
- throw new Error("Iframe origin is not initialized");
227
- }
228
- triggerEvent(t, e) {
229
- if (t)
230
- return t(e);
231
- }
232
- start({
233
- template: t,
234
- templateName: e,
235
- uid: i
236
- }) {
237
- const n = document.querySelector(this.config.container);
238
- if (n) {
239
- const r = (s) => {
240
- var l;
241
- const {
242
- data: { source: c, event: h }
243
- } = s;
244
- if (c === "DraftPlugin" && h === "loaded") {
245
- if (s.source !== ((l = this.iframe) == null ? void 0 : l.contentWindow)) return;
246
- this.iframeOrigin = s.origin;
247
- const {
248
- on: d,
249
- container: g,
250
- locale: y,
251
- autosave: v,
252
- token: u,
253
- apiUrl: p,
254
- pluginId: m,
255
- authData: w,
256
- __config: I
257
- } = this.config;
258
- N(this.config), this.iframe && this.iframe.contentWindow && this.postEvent("init", {
259
- container: g,
260
- locale: y,
261
- uid: i,
262
- autosave: v,
263
- token: u,
264
- pluginId: m,
265
- authData: w,
266
- apiUrl: p,
267
- __config: I,
268
- enabledListeners: Object.keys(d),
269
- template: t,
270
- templateName: e
271
- }), window.addEventListener("message", this.onMessage), window.removeEventListener("message", r);
272
- }
273
- };
274
- this.iframe = W(window.location.origin), window.addEventListener("message", r), n.appendChild(this.iframe), this.captureHotkeysEnabled() && !this.hotkeysAttached && (window.addEventListener("keydown", this.onHostHotkey), this.hotkeysAttached = !0);
275
- } else
276
- throw new Error("Specified container not found");
277
- }
278
- changeTemplate(t, e = {}) {
279
- this.postEvent("changeTemplate", { ...e, template: t });
280
- }
281
- toggleGrid(t) {
282
- this.postEvent("toggleGrid", { state: t });
283
- }
284
- togglePreview(t) {
285
- this.postEvent("togglePreview", { state: t });
286
- }
287
- toggleMenu(t = null) {
288
- this.postEvent("toggleMenu", { menu: t });
289
- }
290
- toggleViewMode(t) {
291
- this.postEvent("toggleViewMode", { viewMode: t });
292
- }
293
- undo() {
294
- this.postEvent("undo");
295
- }
296
- redo() {
297
- this.postEvent("redo");
298
- }
299
- save() {
300
- return this.promisedIframeMethod("saveAction");
301
- }
302
- exit() {
303
- return this.promisedIframeMethod("exitAction");
304
- }
305
- exportContent() {
306
- return this.promisedIframeMethod("exportContent");
307
- }
308
- exportAsFile() {
309
- return this.promisedIframeMethod("exportAsFile");
310
- }
311
- };
312
- a(f, "HEARTBEAT_TIMEOUT", 4e3);
313
- let E = f;
314
- const _ = {
315
- container: "#draft-plugin-container",
316
- disableHotkeysPassing: !1,
317
- locale: "ru",
318
- on: {}
319
- };
320
- class S {
321
- constructor() {
322
- a(this, "version", L);
323
- }
324
- create(t) {
325
- return new E({
326
- ..._,
327
- ...t
328
- });
329
- }
330
- }
331
- const G = new S();
332
- window.DraftPlugin = G;
333
- export {
334
- k as DraftError,
335
- H as EditorMenu,
336
- C as ViewMode,
337
- G as default
338
- };
339
- //# sourceMappingURL=index.es.js.map
1
+ //#region src/routes.ts
2
+ var e = "http://localhost:5174", t = "https://seplugin.sendsay.ru", n = /* @__PURE__ */ function(e) {
3
+ return e.Audit = "audit", e.Guide = "guide", e.Style = "style", e.Blocks = "blocks", e;
4
+ }({}), r = /* @__PURE__ */ function(e) {
5
+ return e.Desktop = "desktop", e.Mobile = "mobile", e;
6
+ }({}), i = class extends Error {
7
+ code;
8
+ constructor(e, t) {
9
+ super(t), this.name = "DraftError", this.code = e;
10
+ }
11
+ }, a = async (e) => {
12
+ try {
13
+ let t = await fetch(e, { method: "HEAD" });
14
+ if (!t.ok) return null;
15
+ let n = t.headers.get("Content-Length");
16
+ return n ? parseInt(n, 10) : null;
17
+ } catch {
18
+ return null;
19
+ }
20
+ }, o = (e) => new Promise((t, n) => {
21
+ let r = new Image();
22
+ r.onload = async () => {
23
+ let n = await a(e) ?? 0;
24
+ t({
25
+ originalWidth: r.width,
26
+ originalHeight: r.height,
27
+ ratio: r.width / r.height,
28
+ fileSize: n
29
+ });
30
+ }, r.onerror = (e) => {
31
+ n(e);
32
+ }, r.src = e;
33
+ }), s = (e, t) => {
34
+ if (e.length !== 1) return e;
35
+ if (e.charCodeAt(0) >= 880) {
36
+ if (t.indexOf("Key") === 0 && t.length === 4) return t.charAt(3);
37
+ if (t.indexOf("Digit") === 0 && t.length === 6) return t.charAt(5);
38
+ }
39
+ return e;
40
+ }, c = (e) => {
41
+ let t = `${s(e.key, e.code)}`.toLowerCase() || e.key, n = navigator.userAgent.includes("Mac OS");
42
+ t === "backspace" && n && (t = "delete");
43
+ let r = [];
44
+ return (n && e.metaKey || !n && e.ctrlKey) && r.push("mod"), e.shiftKey && r.push("shift"), r.length > 0 && (t = `${r.join("-")}-${s(t, e.code)}`), t;
45
+ }, l = new Set([
46
+ "escape",
47
+ "mod-c",
48
+ "mod-d",
49
+ "mod-z",
50
+ "mod-y",
51
+ "mod-shift-z",
52
+ "mod-v",
53
+ "delete",
54
+ "mod-g",
55
+ "mod-p",
56
+ "mod-s"
57
+ ]), u = "@getdraft/plugin", d = "1.16.1", f = {
58
+ name: u,
59
+ version: d,
60
+ main: "dist/index.cjs.js",
61
+ module: "dist/index.es.js",
62
+ types: "dist/types/index.d.ts",
63
+ exports: { ".": {
64
+ types: "./dist/types/index.d.ts",
65
+ import: "./dist/index.es.js",
66
+ require: "./dist/index.cjs.js"
67
+ } },
68
+ scripts: {
69
+ prebuild: "rm -rf dist",
70
+ build: "vite build",
71
+ "dev-tsc": "tsc-check",
72
+ eslint: "npx eslint src",
73
+ "eslint:fix": "pnpm eslint --fix",
74
+ prettify: "npx prettier -w ./",
75
+ prepublish: "pnpm build",
76
+ watch: "NODE_ENV=development vite build --watch",
77
+ start: "NODE_ENV=development npx vite"
78
+ },
79
+ dependencies: {},
80
+ devDependencies: {
81
+ "@getdraft/types": "workspace:^",
82
+ "@getdraft/eslint-config-ts": "workspace:^",
83
+ "@getdraft/prettier": "workspace:^",
84
+ "vite-plugin-dts": "4.5.4"
85
+ },
86
+ license: "MIT"
87
+ }, p = () => {
88
+ let n = RegExp("(^| )seplugin-dev=([^;]+)"), r = document.cookie.match(n)?.[2].toLowerCase?.();
89
+ if (r === "true") return e;
90
+ if (r?.startsWith("https://")) return r;
91
+ let [i, a] = f.version.split(".");
92
+ return `${t}/v${i}.${a}`;
93
+ }, m = ({ token: e, pluginId: t, apiUrl: n }) => {
94
+ if (!e) throw Error("No [token] was provided");
95
+ if (!t) throw Error("No [pluginId] was provided");
96
+ if (!n) throw Error("No [apiUrl] was provided");
97
+ }, h = (e) => {
98
+ let t = document.createElement("iframe"), n = new URL(p());
99
+ return n.searchParams.set("parentOrigin", e), t.src = n.toString(), t.setAttribute("style", "height:100%;width:100%;min-width:960px;border:0px;"), t.setAttribute("allow", "clipboard-read; clipboard-write"), t.setAttribute("sandbox", "allow-scripts allow-same-origin allow-forms allow-popups allow-downloads"), t;
100
+ }, g = class e {
101
+ iframe = null;
102
+ hotkeysAttached = !1;
103
+ iframeOrigin = null;
104
+ constructor(e) {
105
+ this.config = e;
106
+ }
107
+ captureHotkeysEnabled() {
108
+ return this.config.disableHotkeysPassing !== !0;
109
+ }
110
+ onHostHotkey = (e) => {
111
+ if (!this.captureHotkeysEnabled() || !this.iframe?.contentWindow) return;
112
+ let t = c(e);
113
+ if (!l.has(t)) return;
114
+ let n = e.target;
115
+ if (n && (n.isContentEditable || [
116
+ "INPUT",
117
+ "TEXTAREA",
118
+ "SELECT"
119
+ ].includes(n.tagName))) return;
120
+ e.preventDefault();
121
+ let { key: r, ctrlKey: i, metaKey: a, shiftKey: o, altKey: s } = e;
122
+ this.postEvent("hostHotkey", {
123
+ key: r,
124
+ code: e.code,
125
+ metaKey: a,
126
+ ctrlKey: i,
127
+ shiftKey: o,
128
+ altKey: s,
129
+ keyCode: t
130
+ });
131
+ };
132
+ static HEARTBEAT_TIMEOUT = 4e3;
133
+ promisedIframeMethod(t) {
134
+ let n = null, r = null, a = () => {
135
+ n &&= (clearTimeout(n), null), r &&= (window.removeEventListener("message", r, !0), null);
136
+ }, o = new Promise((o, s) => {
137
+ let c = () => {
138
+ n && clearTimeout(n), n = setTimeout(() => {
139
+ a(), s(new i("timeout_error", `Action "${t}" timed out`));
140
+ }, e.HEARTBEAT_TIMEOUT);
141
+ };
142
+ r = (e) => {
143
+ if (e.source !== this.iframe?.contentWindow) return;
144
+ let { data: n } = e;
145
+ if (n.source === "DraftPlugin") {
146
+ if (n.event === "actionPing" && n.action === t) {
147
+ e.stopPropagation(), c();
148
+ return;
149
+ }
150
+ if (n.event === t) {
151
+ e.stopPropagation(), a();
152
+ let { source: t, event: r, ok: c, code: l, message: u, ...d } = n;
153
+ c === !1 ? s(new i(l || "unknown_error", u || "Unknown error")) : o(d);
154
+ }
155
+ }
156
+ }, window.addEventListener("message", r, !0), c();
157
+ });
158
+ return this.postEvent(t), o;
159
+ }
160
+ postEvent(e, t = {}) {
161
+ if (this.iframe && this.iframe.contentWindow && this.iframeOrigin) this.iframe.contentWindow.postMessage({
162
+ ...t,
163
+ event: e,
164
+ source: "DraftPlugin"
165
+ }, this.iframeOrigin);
166
+ else if (!this.iframeOrigin) throw Error("Iframe origin is not initialized");
167
+ }
168
+ onImageUpload = async ({ id: e, ...t }) => {
169
+ try {
170
+ let n = await this.config.on.uploadImage?.(t), r = {};
171
+ n && (r = await o(n)), this.postEvent("imageUploaded", {
172
+ id: e,
173
+ img: {
174
+ ...r,
175
+ url: n
176
+ }
177
+ });
178
+ } catch {
179
+ this.postEvent("imageUploaded", { id: e });
180
+ }
181
+ };
182
+ onLoadPersonalization = async () => {
183
+ try {
184
+ if (!this.config.on.loadPersonalization) throw Error("No personalization loader provided");
185
+ let e = await this.config.on.loadPersonalization();
186
+ this.postEvent("loadPersonalization", { items: e });
187
+ } catch {
188
+ this.postEvent("loadPersonalization", {});
189
+ }
190
+ };
191
+ onGalleryOpen = async ({ id: e }) => {
192
+ this.config.on.openGallery?.(async (t) => {
193
+ let n = { url: t };
194
+ if (t) {
195
+ let e = await o(t);
196
+ Object.assign(n, e);
197
+ }
198
+ this.postEvent("imageUploaded", {
199
+ id: e,
200
+ img: n
201
+ });
202
+ });
203
+ };
204
+ triggerEvent(e, t) {
205
+ if (e) return e(t);
206
+ }
207
+ onMessage = (e) => {
208
+ if (e.source !== this.iframe?.contentWindow) return;
209
+ let { data: { source: t, event: n, ...r } } = e;
210
+ t === "DraftPlugin" && (n === "openGallery" ? this.onGalleryOpen(r) : n === "uploadImage" ? this.onImageUpload(r) : n === "loadPersonalization" ? this.onLoadPersonalization() : this.triggerEvent(this.config.on[n], r));
211
+ };
212
+ start({ template: e, templateName: t, uid: n }) {
213
+ let r = document.querySelector(this.config.container);
214
+ if (r) {
215
+ let i = (r) => {
216
+ let { data: { source: a, event: o } } = r;
217
+ if (a === "DraftPlugin" && o === "loaded") {
218
+ if (r.source !== this.iframe?.contentWindow) return;
219
+ this.iframeOrigin = r.origin;
220
+ let { on: a, container: o, locale: s, autosave: c, token: l, apiUrl: u, pluginId: d, authData: f, __config: p } = this.config;
221
+ m(this.config), this.iframe && this.iframe.contentWindow && this.postEvent("init", {
222
+ container: o,
223
+ locale: s,
224
+ uid: n,
225
+ autosave: c,
226
+ token: l,
227
+ pluginId: d,
228
+ authData: f,
229
+ apiUrl: u,
230
+ __config: p,
231
+ enabledListeners: Object.keys(a),
232
+ template: e,
233
+ templateName: t
234
+ }), window.addEventListener("message", this.onMessage), window.removeEventListener("message", i);
235
+ }
236
+ };
237
+ this.iframe = h(window.location.origin), window.addEventListener("message", i), r.appendChild(this.iframe), this.captureHotkeysEnabled() && !this.hotkeysAttached && (window.addEventListener("keydown", this.onHostHotkey), this.hotkeysAttached = !0);
238
+ } else throw Error("Specified container not found");
239
+ }
240
+ destroy = () => {
241
+ this.iframe?.remove(), this.iframe = null, window.removeEventListener("message", this.onMessage), this.hotkeysAttached &&= (window.removeEventListener("keydown", this.onHostHotkey), !1);
242
+ };
243
+ changeTemplate(e, t = {}) {
244
+ this.postEvent("changeTemplate", {
245
+ ...t,
246
+ template: e
247
+ });
248
+ }
249
+ toggleGrid(e) {
250
+ this.postEvent("toggleGrid", { state: e });
251
+ }
252
+ togglePreview(e) {
253
+ this.postEvent("togglePreview", { state: e });
254
+ }
255
+ toggleMenu(e = null) {
256
+ this.postEvent("toggleMenu", { menu: e });
257
+ }
258
+ toggleViewMode(e) {
259
+ this.postEvent("toggleViewMode", { viewMode: e });
260
+ }
261
+ undo() {
262
+ this.postEvent("undo");
263
+ }
264
+ redo() {
265
+ this.postEvent("redo");
266
+ }
267
+ save() {
268
+ return this.promisedIframeMethod("saveAction");
269
+ }
270
+ exit() {
271
+ return this.promisedIframeMethod("exitAction");
272
+ }
273
+ exportContent() {
274
+ return this.promisedIframeMethod("exportContent");
275
+ }
276
+ exportAsFile() {
277
+ return this.promisedIframeMethod("exportAsFile");
278
+ }
279
+ }, _ = {
280
+ container: "#draft-plugin-container",
281
+ disableHotkeysPassing: !1,
282
+ locale: "ru",
283
+ on: {}
284
+ }, v = new class {
285
+ version = d;
286
+ create(e) {
287
+ return new g({
288
+ ..._,
289
+ ...e
290
+ });
291
+ }
292
+ }();
293
+ window.DraftPlugin = v;
294
+ //#endregion
295
+ export { i as DraftError, n as EditorMenu, r as ViewMode, v as default };
296
+
297
+ //# sourceMappingURL=index.es.js.map