@humanonlyweb/writer 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +62 -2
- package/dist/components/WriterContent.d.ts +57 -0
- package/dist/components/WriterContent.js +114 -0
- package/dist/components/WriterEditor.js +232 -0
- package/dist/components/WriterEditor.vue.d.ts +70 -0
- package/dist/components/WriterToolbar.js +135 -0
- package/dist/components/WriterToolbar.vue.d.ts +27 -0
- package/dist/config.d.ts +39 -0
- package/dist/config.js +41 -0
- package/dist/docs/README.md +24 -0
- package/dist/docs/blocks.md +64 -0
- package/dist/docs/changelog.md +17 -0
- package/dist/docs/components/content.md +51 -0
- package/dist/docs/components/editor.md +236 -0
- package/dist/docs/components/toolbar.md +146 -0
- package/dist/docs/images.md +80 -0
- package/dist/docs/index.md +86 -0
- package/dist/docs/installation.md +74 -0
- package/dist/docs/limitations.md +11 -0
- package/dist/docs/localisation.md +35 -0
- package/dist/docs/parsing.md +47 -0
- package/dist/docs/security.md +16 -0
- package/dist/docs/storing.md +105 -0
- package/dist/docs/styling.md +47 -0
- package/dist/docs/word-count.md +16 -0
- package/dist/editor/commands.d.ts +1 -0
- package/dist/editor/commands.js +359 -0
- package/dist/editor/images.d.ts +1 -0
- package/dist/editor/images.js +400 -0
- package/dist/editor/live.d.ts +2 -0
- package/dist/editor/live.js +411 -0
- package/dist/editor/setup.d.ts +9 -0
- package/dist/editor/setup.js +485 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +8 -0
- package/dist/load-parser.js +12 -0
- package/dist/nuxt/module.d.ts +35 -0
- package/dist/nuxt/module.js +114 -0
- package/dist/nuxt/runtime/plugin.d.ts +2 -0
- package/dist/nuxt/runtime/plugin.js +25 -0
- package/dist/nuxt/runtime/server/parse.d.ts +12 -0
- package/dist/nuxt/runtime/server/parse.js +15 -0
- package/dist/package.js +3 -0
- package/dist/parse.d.ts +16 -0
- package/dist/parse.js +62 -0
- package/dist/parser-options.d.ts +19 -0
- package/dist/placeholder.js +5 -0
- package/dist/render.d.ts +10 -0
- package/dist/render.js +97 -0
- package/dist/sanitize.d.ts +11 -0
- package/dist/sanitize.js +139 -0
- package/dist/stats.d.ts +8 -0
- package/dist/stats.js +17 -0
- package/dist/styles/core.css +275 -0
- package/dist/translations.d.ts +26 -0
- package/dist/translations.js +47 -0
- package/dist/types.d.ts +9 -0
- package/package.json +101 -4
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { UPLOAD_PLACEHOLDER, isUploadPlaceholder } from "../placeholder.js";
|
|
2
|
+
import { WidgetType } from "@codemirror/view";
|
|
3
|
+
// src/editor/images.ts
|
|
4
|
+
const IMAGE = /^(\s*)!\[((?:\\.|[^\]\\\n])*)\]\(\s*(<[^>\n]*>|[^\s)]*)(?:\s+"((?:\\.|[^"\\\n])*)")?\s*\)(\{[^}\n]*\})?\s*$/;
|
|
5
|
+
const unescape = (text) => text.replace(/\\(.)/g, "$1");
|
|
6
|
+
function parseImageLine(text) {
|
|
7
|
+
const match = IMAGE.exec(text);
|
|
8
|
+
if (!match) return null;
|
|
9
|
+
return {
|
|
10
|
+
indent: match[1] ?? "",
|
|
11
|
+
alt: unescape(match[2] ?? ""),
|
|
12
|
+
url: (match[3] ?? "").replace(/^<(.*)>$/, "$1"),
|
|
13
|
+
title: unescape(match[4] ?? ""),
|
|
14
|
+
attrs: match[5] ?? ""
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function formatImageLine({ indent, alt, url, title, attrs }) {
|
|
18
|
+
const safeAlt = alt.replace(/\n/g, " ").replace(/[\\\]]/g, "\\$&");
|
|
19
|
+
const safeTitle = title.replace(/\n/g, " ").replace(/[\\"]/g, "\\$&");
|
|
20
|
+
return `${indent}]/.test(url) || !url && safeTitle ? `<${url}>` : url}${safeTitle ? ` "${safeTitle}"` : ""})${attrs}`;
|
|
21
|
+
}
|
|
22
|
+
/** Width and height in an attribute block, which reserve the image's space on the page. */
|
|
23
|
+
function imageSize(attrs) {
|
|
24
|
+
const read = (name) => {
|
|
25
|
+
const value = new RegExp(`(?:^|[\\s{])${name}="?(\\d+)"?`).exec(attrs)?.[1];
|
|
26
|
+
return value ? Number(value) : void 0;
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
width: read("width"),
|
|
30
|
+
height: read("height")
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function withSize(attrs, width, height) {
|
|
34
|
+
return `{${[attrs.slice(1, -1).replace(/(?:^|\s)(?:width|height)="?\d+"?/g, "").trim(), `width="${width}" height="${height}"`].filter(Boolean).join(" ")}}`;
|
|
35
|
+
}
|
|
36
|
+
/** Local previews of files still uploading, by their placeholder URL. */
|
|
37
|
+
const previews = /* @__PURE__ */ new Map();
|
|
38
|
+
let uploadCount = 0;
|
|
39
|
+
async function sizeOf(file) {
|
|
40
|
+
try {
|
|
41
|
+
const bitmap = await createImageBitmap(file);
|
|
42
|
+
const size = {
|
|
43
|
+
width: bitmap.width,
|
|
44
|
+
height: bitmap.height
|
|
45
|
+
};
|
|
46
|
+
bitmap.close();
|
|
47
|
+
return size;
|
|
48
|
+
} catch {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Where `token` is in the document, followed by the end of its URL. */
|
|
53
|
+
function find(view, token) {
|
|
54
|
+
const doc = view.state.doc.toString();
|
|
55
|
+
for (let at = doc.indexOf(token); at >= 0; at = doc.indexOf(token, at + 1)) if (/[)\s]/.test(doc[at + token.length] ?? "")) return at;
|
|
56
|
+
return -1;
|
|
57
|
+
}
|
|
58
|
+
/** A placeholder URL, unique across page loads: a leftover one in a saved document never matches. */
|
|
59
|
+
const nextToken = () => `${UPLOAD_PLACEHOLDER}${Date.now().toString(36)}${(++uploadCount).toString(36)}`;
|
|
60
|
+
/**
|
|
61
|
+
* The Markdown a file is while it uploads. An image shows from the local file, at its real
|
|
62
|
+
* size, and keeps the alt text and caption of the image it replaces.
|
|
63
|
+
*/
|
|
64
|
+
async function placeholderLine(file, token, replacing) {
|
|
65
|
+
if (!file.type.startsWith("image/")) return `[${file.name.replace(/[[\]]/g, "")}](${token})`;
|
|
66
|
+
previews.set(token, URL.createObjectURL(file));
|
|
67
|
+
const size = await sizeOf(file);
|
|
68
|
+
return formatImageLine({
|
|
69
|
+
indent: replacing?.indent ?? "",
|
|
70
|
+
alt: replacing?.alt ?? "",
|
|
71
|
+
url: token,
|
|
72
|
+
title: replacing?.title ?? "",
|
|
73
|
+
attrs: size ? withSize(replacing?.attrs || "{}", size.width, size.height) : replacing?.attrs ?? ""
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** Uploads one file and puts its URL in place of `token`, or undoes the placeholder. */
|
|
77
|
+
async function finish(view, file, token, options, previous) {
|
|
78
|
+
let settled = false;
|
|
79
|
+
const settle = () => {
|
|
80
|
+
if (!settled) options.onProgress(-1);
|
|
81
|
+
settled = true;
|
|
82
|
+
};
|
|
83
|
+
try {
|
|
84
|
+
const url = await options.upload(file);
|
|
85
|
+
settle();
|
|
86
|
+
const at = find(view, token);
|
|
87
|
+
if (at >= 0) view.dispatch({
|
|
88
|
+
changes: {
|
|
89
|
+
from: at,
|
|
90
|
+
to: at + token.length,
|
|
91
|
+
insert: url
|
|
92
|
+
},
|
|
93
|
+
userEvent: "input.upload"
|
|
94
|
+
});
|
|
95
|
+
} catch (error) {
|
|
96
|
+
settle();
|
|
97
|
+
const at = find(view, token);
|
|
98
|
+
if (at >= 0) {
|
|
99
|
+
const line = view.state.doc.lineAt(at);
|
|
100
|
+
const now = parseImageLine(line.text);
|
|
101
|
+
const changes = previous && now ? {
|
|
102
|
+
from: line.from,
|
|
103
|
+
to: line.to,
|
|
104
|
+
insert: formatImageLine({
|
|
105
|
+
...now,
|
|
106
|
+
url: previous.url,
|
|
107
|
+
attrs: previous.attrs
|
|
108
|
+
})
|
|
109
|
+
} : {
|
|
110
|
+
from: line.from,
|
|
111
|
+
to: Math.min(line.to + 1, view.state.doc.length)
|
|
112
|
+
};
|
|
113
|
+
view.dispatch({
|
|
114
|
+
changes,
|
|
115
|
+
userEvent: "delete.upload"
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
options.onError(error, file);
|
|
119
|
+
} finally {
|
|
120
|
+
settle();
|
|
121
|
+
const local = previews.get(token);
|
|
122
|
+
previews.delete(token);
|
|
123
|
+
if (local) setTimeout(() => URL.revokeObjectURL(local), 3e4);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/** The newlines to add to `newlines` for a blank line. */
|
|
127
|
+
const gap = (newlines) => "\n".repeat(Math.max(0, 2 - newlines));
|
|
128
|
+
/**
|
|
129
|
+
* Uploads `files`, inserted at `at`, each on its own line, in one edit; or uploads the
|
|
130
|
+
* first into the image line `replace`. Placeholders go in at once and the uploads run
|
|
131
|
+
* side by side.
|
|
132
|
+
*/
|
|
133
|
+
async function uploadFiles(view, files, options, target) {
|
|
134
|
+
const replace = "replace" in target ? target.replace : void 0;
|
|
135
|
+
const uploads = (replace ? files.slice(0, 1) : files).map((file) => ({
|
|
136
|
+
file,
|
|
137
|
+
token: nextToken()
|
|
138
|
+
}));
|
|
139
|
+
if (!uploads.length) return;
|
|
140
|
+
options.onProgress(uploads.length);
|
|
141
|
+
const current = replace ? parseImageLine(view.state.sliceDoc(replace.from, replace.to)) : null;
|
|
142
|
+
const previous = uploads[0]?.file.type.startsWith("image/") ? current : null;
|
|
143
|
+
const lines = await Promise.all(uploads.map(({ file, token }) => placeholderLine(file, token, previous)));
|
|
144
|
+
if (replace) view.dispatch({
|
|
145
|
+
changes: {
|
|
146
|
+
...replace,
|
|
147
|
+
insert: lines[0]
|
|
148
|
+
},
|
|
149
|
+
userEvent: "input.upload"
|
|
150
|
+
});
|
|
151
|
+
else {
|
|
152
|
+
const { state } = view;
|
|
153
|
+
const at = Math.min("at" in target ? target.at : 0, state.doc.length);
|
|
154
|
+
const textBefore = state.sliceDoc(0, at);
|
|
155
|
+
const textAfter = state.sliceDoc(at);
|
|
156
|
+
const before = textBefore.trim() ? gap(/\n*$/.exec(textBefore)?.[0].length ?? 0) : "";
|
|
157
|
+
const after = textAfter.trim() ? gap(/^\n*/.exec(textAfter)?.[0].length ?? 0) : textAfter.startsWith("\n") ? "" : "\n";
|
|
158
|
+
const insert = before + lines.join("\n\n") + after;
|
|
159
|
+
view.dispatch({
|
|
160
|
+
changes: {
|
|
161
|
+
from: at,
|
|
162
|
+
insert
|
|
163
|
+
},
|
|
164
|
+
selection: { anchor: at + insert.length },
|
|
165
|
+
userEvent: "input.upload"
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
await Promise.all(uploads.map(({ file, token }) => finish(view, file, token, options, previous)));
|
|
169
|
+
}
|
|
170
|
+
function element(tag, props = {}, ...children) {
|
|
171
|
+
const { dataPart, ...rest } = props;
|
|
172
|
+
const node = Object.assign(document.createElement(tag), rest);
|
|
173
|
+
if (dataPart) node.dataset.part = dataPart;
|
|
174
|
+
node.append(...children);
|
|
175
|
+
return node;
|
|
176
|
+
}
|
|
177
|
+
function pickFile(onFile) {
|
|
178
|
+
const input = element("input", {
|
|
179
|
+
type: "file",
|
|
180
|
+
accept: "image/*"
|
|
181
|
+
});
|
|
182
|
+
input.addEventListener("change", () => {
|
|
183
|
+
const file = input.files?.[0];
|
|
184
|
+
if (file) onFile(file);
|
|
185
|
+
});
|
|
186
|
+
input.click();
|
|
187
|
+
}
|
|
188
|
+
const parts = /* @__PURE__ */ new WeakMap();
|
|
189
|
+
var ImageCardWidget = class extends WidgetType {
|
|
190
|
+
source;
|
|
191
|
+
selected;
|
|
192
|
+
options;
|
|
193
|
+
constructor(source, selected, options) {
|
|
194
|
+
super();
|
|
195
|
+
this.source = source;
|
|
196
|
+
this.selected = selected;
|
|
197
|
+
this.options = options;
|
|
198
|
+
}
|
|
199
|
+
eq(other) {
|
|
200
|
+
return other.source === this.source && other.selected === this.selected;
|
|
201
|
+
}
|
|
202
|
+
/** The image line this card stands for, wherever it is now. */
|
|
203
|
+
range(view, dom) {
|
|
204
|
+
const line = view.state.doc.lineAt(view.posAtDOM(dom));
|
|
205
|
+
return {
|
|
206
|
+
from: line.from,
|
|
207
|
+
to: line.to
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
edit(view, dom, change) {
|
|
211
|
+
const range = this.range(view, dom);
|
|
212
|
+
const current = parseImageLine(view.state.sliceDoc(range.from, range.to));
|
|
213
|
+
if (!current || view.state.readOnly) return;
|
|
214
|
+
view.dispatch({
|
|
215
|
+
changes: {
|
|
216
|
+
...range,
|
|
217
|
+
insert: formatImageLine({
|
|
218
|
+
...current,
|
|
219
|
+
...change
|
|
220
|
+
})
|
|
221
|
+
},
|
|
222
|
+
userEvent: "input.image"
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/** Back to writing, on the line after the image. */
|
|
226
|
+
leave(view, dom) {
|
|
227
|
+
const { to } = this.range(view, dom);
|
|
228
|
+
if (to === view.state.doc.length && !view.state.readOnly) view.dispatch({
|
|
229
|
+
changes: {
|
|
230
|
+
from: to,
|
|
231
|
+
insert: "\n"
|
|
232
|
+
},
|
|
233
|
+
selection: { anchor: to + 1 }
|
|
234
|
+
});
|
|
235
|
+
else view.dispatch({ selection: { anchor: to + 1 } });
|
|
236
|
+
view.focus();
|
|
237
|
+
}
|
|
238
|
+
toDOM(view) {
|
|
239
|
+
const t = this.options.translations;
|
|
240
|
+
const upload = this.options.uploadInto;
|
|
241
|
+
const image = element("img", { alt: "" });
|
|
242
|
+
const choose = element("button", {
|
|
243
|
+
type: "button",
|
|
244
|
+
textContent: t.imageChoose
|
|
245
|
+
});
|
|
246
|
+
const url = element("input", {
|
|
247
|
+
type: "url",
|
|
248
|
+
placeholder: t.imageUrl
|
|
249
|
+
});
|
|
250
|
+
url.setAttribute("aria-label", t.imageUrl);
|
|
251
|
+
const empty = element("div", { className: "cm-md-image-empty" }, ...upload ? [element("span", { textContent: t.imageDrop }), choose] : [url]);
|
|
252
|
+
const status = element("div", {
|
|
253
|
+
className: "cm-md-image-status",
|
|
254
|
+
textContent: t.imageUploading
|
|
255
|
+
});
|
|
256
|
+
status.setAttribute("role", "status");
|
|
257
|
+
const replace = element("button", {
|
|
258
|
+
type: "button",
|
|
259
|
+
textContent: t.imageReplace
|
|
260
|
+
});
|
|
261
|
+
const remove = element("button", {
|
|
262
|
+
type: "button",
|
|
263
|
+
textContent: t.imageRemove
|
|
264
|
+
});
|
|
265
|
+
const frame = element("div", { className: "cm-md-image-frame" }, image, empty, status, element("div", { className: "cm-md-image-actions" }, ...upload ? [replace] : [], remove));
|
|
266
|
+
const caption = element("input", {
|
|
267
|
+
type: "text",
|
|
268
|
+
placeholder: t.imageCaption,
|
|
269
|
+
className: "cm-md-image-caption"
|
|
270
|
+
});
|
|
271
|
+
caption.setAttribute("aria-label", t.imageCaption);
|
|
272
|
+
const alt = element("input", {
|
|
273
|
+
type: "text",
|
|
274
|
+
placeholder: t.imageAltHint
|
|
275
|
+
});
|
|
276
|
+
const altField = element("label", { className: "cm-md-image-alt" }, element("span", { textContent: t.imageAlt }), alt);
|
|
277
|
+
const root = element("div", {
|
|
278
|
+
className: "cm-md-image",
|
|
279
|
+
dataPart: "writer-image"
|
|
280
|
+
}, element("div", { dataPart: "writer-content" }, element("figure", {}, frame, element("figcaption", {}, caption), altField)));
|
|
281
|
+
caption.addEventListener("input", () => this.edit(view, root, { title: caption.value }));
|
|
282
|
+
alt.addEventListener("input", () => this.edit(view, root, { alt: alt.value }));
|
|
283
|
+
url.addEventListener("change", () => this.edit(view, root, { url: url.value.trim() }));
|
|
284
|
+
for (const input of [
|
|
285
|
+
caption,
|
|
286
|
+
alt,
|
|
287
|
+
url
|
|
288
|
+
]) {
|
|
289
|
+
input.addEventListener("beforeinput", (event) => {
|
|
290
|
+
if (view.state.readOnly) event.preventDefault();
|
|
291
|
+
});
|
|
292
|
+
input.addEventListener("keydown", (event) => {
|
|
293
|
+
if (event.key === "Enter" || event.key === "Escape") {
|
|
294
|
+
event.preventDefault();
|
|
295
|
+
this.leave(view, root);
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
if (upload) {
|
|
300
|
+
const choosePicked = () => {
|
|
301
|
+
if (!view.state.readOnly) pickFile((file) => upload(view, file, this.range(view, root)));
|
|
302
|
+
};
|
|
303
|
+
choose.addEventListener("click", choosePicked);
|
|
304
|
+
replace.addEventListener("click", choosePicked);
|
|
305
|
+
frame.addEventListener("dragover", (event) => {
|
|
306
|
+
if (!event.dataTransfer?.types.includes("Files")) return;
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
frame.dataset.dropping = "";
|
|
309
|
+
});
|
|
310
|
+
frame.addEventListener("dragleave", () => delete frame.dataset.dropping);
|
|
311
|
+
frame.addEventListener("drop", (event) => {
|
|
312
|
+
const file = event.dataTransfer?.files[0];
|
|
313
|
+
delete frame.dataset.dropping;
|
|
314
|
+
if (!file?.type.startsWith("image/")) return;
|
|
315
|
+
event.preventDefault();
|
|
316
|
+
event.stopPropagation();
|
|
317
|
+
if (!view.state.readOnly) upload(view, file, this.range(view, root));
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
remove.addEventListener("click", () => {
|
|
321
|
+
if (view.state.readOnly) return;
|
|
322
|
+
const { from, to } = this.range(view, root);
|
|
323
|
+
view.dispatch({
|
|
324
|
+
changes: {
|
|
325
|
+
from,
|
|
326
|
+
to: Math.min(to + 1, view.state.doc.length)
|
|
327
|
+
},
|
|
328
|
+
selection: { anchor: from },
|
|
329
|
+
userEvent: "delete.image"
|
|
330
|
+
});
|
|
331
|
+
view.focus();
|
|
332
|
+
});
|
|
333
|
+
image.addEventListener("mousedown", (event) => {
|
|
334
|
+
event.preventDefault();
|
|
335
|
+
const { from, to } = this.range(view, root);
|
|
336
|
+
view.dispatch({ selection: {
|
|
337
|
+
anchor: from,
|
|
338
|
+
head: to
|
|
339
|
+
} });
|
|
340
|
+
view.focus();
|
|
341
|
+
});
|
|
342
|
+
parts.set(root, {
|
|
343
|
+
root,
|
|
344
|
+
frame,
|
|
345
|
+
image,
|
|
346
|
+
empty,
|
|
347
|
+
status,
|
|
348
|
+
caption,
|
|
349
|
+
alt
|
|
350
|
+
});
|
|
351
|
+
this.update(root);
|
|
352
|
+
return root;
|
|
353
|
+
}
|
|
354
|
+
updateDOM(dom) {
|
|
355
|
+
if (!parts.has(dom)) return false;
|
|
356
|
+
this.update(dom);
|
|
357
|
+
return true;
|
|
358
|
+
}
|
|
359
|
+
update(dom) {
|
|
360
|
+
const card = parts.get(dom);
|
|
361
|
+
const line = parseImageLine(this.source);
|
|
362
|
+
if (!card || !line) return;
|
|
363
|
+
const { width, height } = imageSize(line.attrs);
|
|
364
|
+
const local = previews.get(line.url);
|
|
365
|
+
const src = local ?? (isUploadPlaceholder(line.url) ? "" : line.url);
|
|
366
|
+
card.root.toggleAttribute("data-selected", this.selected);
|
|
367
|
+
card.frame.toggleAttribute("data-empty", !src);
|
|
368
|
+
card.frame.toggleAttribute("data-uploading", !!local);
|
|
369
|
+
card.frame.style.aspectRatio = width && height ? `${width} / ${height}` : "";
|
|
370
|
+
card.image.hidden = !src;
|
|
371
|
+
if (width && height) {
|
|
372
|
+
card.image.width = width;
|
|
373
|
+
card.image.height = height;
|
|
374
|
+
} else {
|
|
375
|
+
card.image.removeAttribute("width");
|
|
376
|
+
card.image.removeAttribute("height");
|
|
377
|
+
}
|
|
378
|
+
card.image.alt = line.alt;
|
|
379
|
+
if (src && card.wanted !== src) {
|
|
380
|
+
card.wanted = src;
|
|
381
|
+
const next = new Image();
|
|
382
|
+
const show = () => {
|
|
383
|
+
if (card.wanted === src) card.image.setAttribute("src", src);
|
|
384
|
+
};
|
|
385
|
+
next.addEventListener("load", show);
|
|
386
|
+
next.addEventListener("error", show);
|
|
387
|
+
next.src = src;
|
|
388
|
+
if (!card.image.getAttribute("src")) card.image.setAttribute("src", src);
|
|
389
|
+
} else if (!src) {
|
|
390
|
+
card.wanted = void 0;
|
|
391
|
+
card.image.removeAttribute("src");
|
|
392
|
+
}
|
|
393
|
+
if (document.activeElement !== card.caption) card.caption.value = line.title;
|
|
394
|
+
if (document.activeElement !== card.alt) card.alt.value = line.alt;
|
|
395
|
+
}
|
|
396
|
+
ignoreEvent() {
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
export { ImageCardWidget, formatImageLine, imageSize, parseImageLine, uploadFiles };
|