@getdraft/plugin 1.13.0 → 1.15.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/.eslintrc +2 -2
- package/README.md +5 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +231 -205
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +2 -0
- package/dist/index.iife.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/plugin.d.ts +5 -2
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/types.d.ts +21 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/index.ts +3 -0
- package/src/plugin.ts +89 -34
- package/src/types.ts +29 -0
- package/vite.config.ts +2 -2
- package/.turbo/turbo-build.log +0 -22
- package/.turbo/turbo-eslint.log +0 -4
package/dist/index.es.js
CHANGED
|
@@ -1,46 +1,55 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (
|
|
4
|
-
const
|
|
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) => {
|
|
5
14
|
try {
|
|
6
|
-
const
|
|
7
|
-
if (!
|
|
15
|
+
const t = await fetch(o, { method: "HEAD" });
|
|
16
|
+
if (!t.ok)
|
|
8
17
|
return null;
|
|
9
|
-
const
|
|
10
|
-
return
|
|
18
|
+
const e = t.headers.get("Content-Length");
|
|
19
|
+
return e ? parseInt(e, 10) : null;
|
|
11
20
|
} catch {
|
|
12
21
|
return null;
|
|
13
22
|
}
|
|
14
|
-
},
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
originalWidth:
|
|
20
|
-
originalHeight:
|
|
21
|
-
ratio:
|
|
22
|
-
fileSize:
|
|
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
|
|
23
32
|
});
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
}),
|
|
28
|
-
if (
|
|
29
|
-
return
|
|
30
|
-
if (
|
|
31
|
-
if (
|
|
32
|
-
return
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
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);
|
|
35
44
|
}
|
|
36
|
-
return
|
|
37
|
-
},
|
|
38
|
-
let
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
return (
|
|
43
|
-
},
|
|
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([
|
|
44
53
|
"escape",
|
|
45
54
|
"mod-c",
|
|
46
55
|
"mod-d",
|
|
@@ -52,225 +61,234 @@ const P = "http://localhost:5174", h = "https://seplugin.sendsay.ru", b = async
|
|
|
52
61
|
"mod-g",
|
|
53
62
|
"mod-p",
|
|
54
63
|
"mod-s"
|
|
55
|
-
]),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
rollup: "4.22.4",
|
|
69
|
-
terser: "5.31.3",
|
|
70
|
-
"rollup-plugin-dts": "6.1.1",
|
|
71
|
-
"@letty/eslint-config-ts": "workspace:^",
|
|
72
|
-
"@letty/prettier": "workspace:^"
|
|
73
|
-
}, T = "MIT", K = {
|
|
74
|
-
name: x,
|
|
75
|
-
version: A,
|
|
76
|
-
main: D,
|
|
77
|
-
module: C,
|
|
78
|
-
types: H,
|
|
79
|
-
scripts: O,
|
|
80
|
-
dependencies: N,
|
|
81
|
-
devDependencies: z,
|
|
82
|
-
license: T
|
|
83
|
-
}, M = () => {
|
|
84
|
-
var s, r;
|
|
85
|
-
const n = new RegExp("(^| )seplugin-dev=([^;]+)"), e = document.cookie.match(n), t = (r = e == null ? void 0 : (s = e[2]).toLowerCase) == null ? void 0 : r.call(s);
|
|
86
|
-
if (t === "true")
|
|
87
|
-
return P;
|
|
88
|
-
if (t === "stage" || t != null && t.includes("https://") || window.location.pathname.includes("netlify"))
|
|
89
|
-
return t != null && t.includes("https://") ? t : `${h}/stage`;
|
|
90
|
-
const [o, i] = K.version.split(".");
|
|
91
|
-
return `${h}/v${o}.${i}`;
|
|
92
|
-
}, U = ({ token: n, pluginId: e, apiUrl: t }) => {
|
|
93
|
-
if (!n)
|
|
64
|
+
]), L = "1.15.0", 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)
|
|
94
77
|
throw new Error("No [token] was provided");
|
|
95
|
-
if (!e)
|
|
96
|
-
throw new Error("No [pluginId] was provided");
|
|
97
78
|
if (!t)
|
|
79
|
+
throw new Error("No [pluginId] was provided");
|
|
80
|
+
if (!e)
|
|
98
81
|
throw new Error("No [apiUrl] was provided");
|
|
99
|
-
},
|
|
100
|
-
const
|
|
101
|
-
return
|
|
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(
|
|
102
85
|
"style",
|
|
103
|
-
"height:100%;width:100%;min-width:960px;border:0px"
|
|
104
|
-
),
|
|
86
|
+
"height:100%;width:100%;min-width:960px;border:0px;"
|
|
87
|
+
), t.setAttribute("allow", "clipboard-read; clipboard-write"), t.setAttribute(
|
|
105
88
|
"sandbox",
|
|
106
|
-
"allow-scripts allow-same-origin allow-forms allow-popups"
|
|
107
|
-
),
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
constructor(e) {
|
|
89
|
+
"allow-scripts allow-same-origin allow-forms allow-popups allow-downloads"
|
|
90
|
+
), t;
|
|
91
|
+
}, f = class f {
|
|
92
|
+
constructor(t) {
|
|
111
93
|
a(this, "iframe", null);
|
|
112
94
|
a(this, "hotkeysAttached", !1);
|
|
113
|
-
a(this, "
|
|
114
|
-
|
|
115
|
-
|
|
95
|
+
a(this, "iframeOrigin", null);
|
|
96
|
+
a(this, "onHostHotkey", (t) => {
|
|
97
|
+
var l;
|
|
98
|
+
if (!this.captureHotkeysEnabled() || !((l = this.iframe) != null && l.contentWindow))
|
|
116
99
|
return;
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
100
|
+
const e = z(t);
|
|
101
|
+
if (!U.has(e))
|
|
119
102
|
return;
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
103
|
+
const i = t.target;
|
|
104
|
+
if (i && (i.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(i.tagName)))
|
|
122
105
|
return;
|
|
123
|
-
|
|
124
|
-
const { key:
|
|
106
|
+
t.preventDefault();
|
|
107
|
+
const { key: n, ctrlKey: r, metaKey: s, shiftKey: c, altKey: h } = t;
|
|
125
108
|
this.postEvent("hostHotkey", {
|
|
126
|
-
key:
|
|
127
|
-
code:
|
|
128
|
-
metaKey:
|
|
129
|
-
ctrlKey:
|
|
130
|
-
shiftKey:
|
|
131
|
-
altKey:
|
|
132
|
-
keyCode:
|
|
109
|
+
key: n,
|
|
110
|
+
code: t.code,
|
|
111
|
+
metaKey: s,
|
|
112
|
+
ctrlKey: r,
|
|
113
|
+
shiftKey: c,
|
|
114
|
+
altKey: h,
|
|
115
|
+
keyCode: e
|
|
133
116
|
});
|
|
134
117
|
});
|
|
135
118
|
a(this, "onImageUpload", async ({
|
|
136
|
-
id:
|
|
137
|
-
...
|
|
119
|
+
id: t,
|
|
120
|
+
...e
|
|
138
121
|
}) => {
|
|
139
|
-
var
|
|
122
|
+
var i, n;
|
|
140
123
|
try {
|
|
141
|
-
const
|
|
142
|
-
let
|
|
143
|
-
|
|
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 } });
|
|
144
127
|
} catch {
|
|
145
|
-
this.postEvent("imageUploaded", { id:
|
|
128
|
+
this.postEvent("imageUploaded", { id: t });
|
|
146
129
|
}
|
|
147
130
|
});
|
|
148
131
|
a(this, "onLoadPersonalization", async () => {
|
|
149
132
|
try {
|
|
150
133
|
if (!this.config.on.loadPersonalization)
|
|
151
134
|
throw new Error("No personalization loader provided");
|
|
152
|
-
const
|
|
135
|
+
const t = await this.config.on.loadPersonalization();
|
|
153
136
|
this.postEvent("loadPersonalization", {
|
|
154
|
-
items:
|
|
137
|
+
items: t
|
|
155
138
|
});
|
|
156
139
|
} catch {
|
|
157
140
|
this.postEvent("loadPersonalization", {});
|
|
158
141
|
}
|
|
159
142
|
});
|
|
160
|
-
a(this, "onGalleryOpen", async ({ id:
|
|
161
|
-
var
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
Object.assign(
|
|
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);
|
|
167
150
|
}
|
|
168
151
|
this.postEvent("imageUploaded", {
|
|
169
|
-
id:
|
|
170
|
-
img:
|
|
152
|
+
id: t,
|
|
153
|
+
img: s
|
|
171
154
|
});
|
|
172
155
|
};
|
|
173
|
-
(
|
|
156
|
+
(n = (i = this.config.on).openGallery) == null || n.call(i, e);
|
|
174
157
|
});
|
|
175
|
-
a(this, "onMessage", (
|
|
158
|
+
a(this, "onMessage", (t) => {
|
|
159
|
+
var r;
|
|
160
|
+
if (t.source !== ((r = this.iframe) == null ? void 0 : r.contentWindow))
|
|
161
|
+
return;
|
|
176
162
|
const {
|
|
177
|
-
data: { source:
|
|
178
|
-
} =
|
|
179
|
-
|
|
180
|
-
this.config.on[
|
|
181
|
-
|
|
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
|
|
182
168
|
));
|
|
183
169
|
});
|
|
184
170
|
a(this, "destroy", () => {
|
|
185
|
-
var
|
|
186
|
-
(
|
|
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);
|
|
187
173
|
});
|
|
188
|
-
this.config =
|
|
174
|
+
this.config = t;
|
|
189
175
|
}
|
|
190
176
|
captureHotkeysEnabled() {
|
|
191
177
|
return this.config.disableHotkeysPassing !== !0;
|
|
192
178
|
}
|
|
193
|
-
promisedIframeMethod(
|
|
194
|
-
let
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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);
|
|
201
190
|
};
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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();
|
|
205
212
|
});
|
|
206
|
-
return this.postEvent(
|
|
213
|
+
return this.postEvent(t), r;
|
|
207
214
|
}
|
|
208
|
-
postEvent(
|
|
209
|
-
this.iframe && this.iframe.contentWindow && this.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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");
|
|
217
227
|
}
|
|
218
|
-
triggerEvent(
|
|
219
|
-
if (
|
|
220
|
-
return e
|
|
228
|
+
triggerEvent(t, e) {
|
|
229
|
+
if (t)
|
|
230
|
+
return t(e);
|
|
221
231
|
}
|
|
222
232
|
start({
|
|
223
|
-
template:
|
|
224
|
-
templateName:
|
|
225
|
-
uid:
|
|
233
|
+
template: t,
|
|
234
|
+
templateName: e,
|
|
235
|
+
uid: i
|
|
226
236
|
}) {
|
|
227
|
-
const
|
|
228
|
-
if (
|
|
229
|
-
const
|
|
230
|
-
|
|
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;
|
|
231
247
|
const {
|
|
232
248
|
on: d,
|
|
233
|
-
container:
|
|
234
|
-
locale:
|
|
235
|
-
autosave:
|
|
236
|
-
token:
|
|
237
|
-
apiUrl:
|
|
238
|
-
pluginId:
|
|
239
|
-
|
|
249
|
+
container: g,
|
|
250
|
+
locale: y,
|
|
251
|
+
autosave: v,
|
|
252
|
+
token: u,
|
|
253
|
+
apiUrl: p,
|
|
254
|
+
pluginId: m,
|
|
255
|
+
authData: w,
|
|
256
|
+
__config: I
|
|
240
257
|
} = this.config;
|
|
241
|
-
|
|
242
|
-
container:
|
|
243
|
-
locale:
|
|
244
|
-
uid:
|
|
245
|
-
autosave:
|
|
246
|
-
token:
|
|
247
|
-
pluginId:
|
|
248
|
-
|
|
249
|
-
|
|
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,
|
|
250
268
|
enabledListeners: Object.keys(d),
|
|
251
|
-
template:
|
|
252
|
-
templateName:
|
|
253
|
-
}), window.addEventListener("message", this.onMessage), window.removeEventListener("message",
|
|
269
|
+
template: t,
|
|
270
|
+
templateName: e
|
|
271
|
+
}), window.addEventListener("message", this.onMessage), window.removeEventListener("message", r);
|
|
254
272
|
}
|
|
255
273
|
};
|
|
256
|
-
this.iframe =
|
|
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);
|
|
257
275
|
} else
|
|
258
276
|
throw new Error("Specified container not found");
|
|
259
277
|
}
|
|
260
|
-
changeTemplate(
|
|
261
|
-
this.postEvent("changeTemplate", { ...
|
|
278
|
+
changeTemplate(t, e = {}) {
|
|
279
|
+
this.postEvent("changeTemplate", { ...e, template: t });
|
|
262
280
|
}
|
|
263
|
-
toggleGrid(
|
|
264
|
-
this.postEvent("toggleGrid", { state:
|
|
281
|
+
toggleGrid(t) {
|
|
282
|
+
this.postEvent("toggleGrid", { state: t });
|
|
265
283
|
}
|
|
266
|
-
togglePreview(
|
|
267
|
-
this.postEvent("togglePreview", { state:
|
|
284
|
+
togglePreview(t) {
|
|
285
|
+
this.postEvent("togglePreview", { state: t });
|
|
268
286
|
}
|
|
269
|
-
toggleMenu(
|
|
270
|
-
this.postEvent("toggleMenu", { menu:
|
|
287
|
+
toggleMenu(t = null) {
|
|
288
|
+
this.postEvent("toggleMenu", { menu: t });
|
|
271
289
|
}
|
|
272
|
-
toggleViewMode(
|
|
273
|
-
this.postEvent("toggleViewMode", { viewMode:
|
|
290
|
+
toggleViewMode(t) {
|
|
291
|
+
this.postEvent("toggleViewMode", { viewMode: t });
|
|
274
292
|
}
|
|
275
293
|
undo() {
|
|
276
294
|
this.postEvent("undo");
|
|
@@ -287,27 +305,35 @@ class G {
|
|
|
287
305
|
exportContent() {
|
|
288
306
|
return this.promisedIframeMethod("exportContent");
|
|
289
307
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
308
|
+
exportAsFile() {
|
|
309
|
+
return this.promisedIframeMethod("exportAsFile");
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
a(f, "HEARTBEAT_TIMEOUT", 4e3);
|
|
313
|
+
let E = f;
|
|
314
|
+
const _ = {
|
|
293
315
|
container: "#draft-plugin-container",
|
|
294
316
|
disableHotkeysPassing: !1,
|
|
295
317
|
locale: "ru",
|
|
296
318
|
on: {}
|
|
297
319
|
};
|
|
298
|
-
class
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
320
|
+
class S {
|
|
321
|
+
constructor() {
|
|
322
|
+
a(this, "version", L);
|
|
323
|
+
}
|
|
324
|
+
create(t) {
|
|
325
|
+
return new E({
|
|
326
|
+
..._,
|
|
327
|
+
...t
|
|
303
328
|
});
|
|
304
329
|
}
|
|
305
330
|
}
|
|
306
|
-
const
|
|
307
|
-
window.DraftPlugin =
|
|
331
|
+
const G = new S();
|
|
332
|
+
window.DraftPlugin = G;
|
|
308
333
|
export {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
334
|
+
k as DraftError,
|
|
335
|
+
H as EditorMenu,
|
|
336
|
+
C as ViewMode,
|
|
337
|
+
G as default
|
|
312
338
|
};
|
|
313
339
|
//# sourceMappingURL=index.es.js.map
|