@goodfellow-cms/admin 0.7.0 → 0.9.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.
@@ -0,0 +1,526 @@
1
+ import { MAX_UPLOAD_BYTES, MEDIA_DIR, addressPatternFor, checkEntrySlug, checkPageAddress, cleanEntryValues, codeFileChanges, collectionFileChange, collectionFileChange as collectionFileChange$1, customCssFileChange, deleteCollectionChanges, deleteSyncedBlockChanges, duplicatePageData, entryFileChange, entryFileChange as entryFileChange$1, entryLanguage, entryPathIn, entryTitle, extensionOf, fileName as fileName$1, itemLinkRemovalChanges, layoutFileChange, linkedItems, markdownToHtml, mediaFileChange, mediaKind, mediaKind as mediaKind$1, menusFileChange, moveEntryChanges, movePageChanges, newCollectionSettings, newPageData, pageFileChange, pageTitle as pageTitle$1, redirectsFileChange, relinkSite, relinkedChanges, siteSettingsFileChange, slugify, storedCss, storedData, storedEntryFields, storedMediaUrl, syncedBlockFileChange, trimChars, uniqueName, updateSettingsFileChange, uploadName, withoutMediaDetails } from "@goodfellow-cms/core";
2
+ import TurndownService from "turndown";
3
+ import { gfm } from "turndown-plugin-gfm";
4
+ //#region src/markdown-text.ts
5
+ let service;
6
+ /** Converts the formatted editor's HTML to Markdown, in the style most Markdown is written in. */
7
+ function htmlToMarkdown(html) {
8
+ if (!service) {
9
+ service = new TurndownService({
10
+ headingStyle: "atx",
11
+ bulletListMarker: "-",
12
+ codeBlockStyle: "fenced",
13
+ emDelimiter: "*",
14
+ strongDelimiter: "**",
15
+ hr: "---"
16
+ });
17
+ service.use(gfm);
18
+ service.addRule("underline", {
19
+ filter: ["u"],
20
+ replacement: (content) => content
21
+ });
22
+ service.addRule("strikethrough", {
23
+ filter: ["del", "s"],
24
+ replacement: (content) => `~~${content}~~`
25
+ });
26
+ service.addRule("listItem", {
27
+ filter: "li",
28
+ replacement(content, node) {
29
+ const parent = node.parentNode;
30
+ let marker = "- ";
31
+ if (parent?.nodeName === "OL") marker = `${Number(parent.getAttribute("start") ?? "1") + Array.prototype.indexOf.call(parent.children, node)}. `;
32
+ const indent = " ".repeat(marker.length);
33
+ const text = content.replace(/^\n+/, "").replace(/\n+$/, "").replace(/\n/g, `\n${indent}`);
34
+ return `${marker}${text}${node.nextSibling ? "\n" : ""}`;
35
+ }
36
+ });
37
+ }
38
+ return service.turndown(html).replace(/[ \t]+$/gm, "").trim();
39
+ }
40
+ /** The HTML the formatted editor starts from for some Markdown. */
41
+ function formattedHtml(markdown) {
42
+ return markdownToHtml(markdown);
43
+ }
44
+ /**
45
+ * The Markdown to save after the formatted editor changed `html`. If the text
46
+ * is the same as `original`'s, only written differently (the formatted editor
47
+ * tidies what it loads), `original` is kept, so the file isn't rewritten.
48
+ */
49
+ function editedMarkdown(original, html) {
50
+ const edited = htmlToMarkdown(html);
51
+ return edited === htmlToMarkdown(formattedHtml(original)) ? original : edited;
52
+ }
53
+ //#endregion
54
+ //#region src/changes.ts
55
+ /**
56
+ * The file changes the admin panel saves. Most are built by core's helpers,
57
+ * which the Claude connector shares; converting a collection's items between
58
+ * Markdown and formatted text needs the browser's HTML handling, so it's here.
59
+ */
60
+ /**
61
+ * A stored value as it fits its collection's field now, or `undefined` if it
62
+ * doesn't: the field must exist, and a choice must still be offered. Tags
63
+ * keep the ones that still are.
64
+ */
65
+ function keptValue(fields, name, value) {
66
+ const field = fields.get(name);
67
+ if (!field) return void 0;
68
+ const offered = (choice) => field.options?.some((option) => option.value === choice) === true;
69
+ if (field.type === "select") return offered(value) ? value : void 0;
70
+ if (field.type === "tags" && Array.isArray(value)) {
71
+ const tags = value.filter(offered);
72
+ if (tags.length === value.length) return value;
73
+ return tags.length > 0 ? tags : void 0;
74
+ }
75
+ if (field.type === "item") {
76
+ const names = linkedItems(field, value);
77
+ if (field.multiple) return Array.isArray(value) ? value : names.length > 0 ? names : void 0;
78
+ return typeof value === "string" ? value : names[0];
79
+ }
80
+ if (field.type === "group" && Array.isArray(value)) {
81
+ const rows = cleanEntryValues([field], { [name]: value })[name];
82
+ return JSON.stringify(rows) === JSON.stringify(value) ? value : rows;
83
+ }
84
+ return value;
85
+ }
86
+ /** Where each item's page goes when its collection's address patterns change, in each of the site's languages. */
87
+ function movedEntryPages(site, collection, settings) {
88
+ if (!collection.settings.path || !settings.path) return [];
89
+ return collection.entries.flatMap((entry) => {
90
+ const to = entryPathIn(site, settings, entry.slug, entryLanguage(site, entry));
91
+ return entry.path && to && to !== entry.path ? [{
92
+ from: entry.path,
93
+ to
94
+ }] : [];
95
+ });
96
+ }
97
+ /**
98
+ * Saves a collection's new settings. Values of fields that were removed, and
99
+ * choices that are no longer offered, are removed from every entry in the
100
+ * same save, so a field added later with the same name starts empty. Given
101
+ * the `site`, a new address pattern points every link to an item's page at
102
+ * its new address, in the same save.
103
+ */
104
+ function collectionSettingsChanges(collection, settings, site) {
105
+ const relinked = site ? relinkSite({
106
+ ...site.content,
107
+ collections: site.content.collections.map((candidate) => candidate.id === collection.id ? {
108
+ ...collection,
109
+ settings: {
110
+ ...collection.settings,
111
+ template: settings.template
112
+ }
113
+ } : candidate)
114
+ }, movedEntryPages(site.content.settings, collection, settings), site.blocks) : void 0;
115
+ const current = relinked?.content.collections.find((candidate) => candidate.id === collection.id) ?? collection;
116
+ const relinkedFiles = new Set(relinked?.files);
117
+ const fields = new Map(settings.fields.map((field) => [field.name, field]));
118
+ const changes = [collectionFileChange(collection.id, {
119
+ ...settings,
120
+ template: current.settings.template
121
+ })];
122
+ const before = collection.settings.markdown?.body;
123
+ const after = settings.markdown?.body;
124
+ const reformat = before !== after;
125
+ for (const entry of current.entries) {
126
+ const values = Object.entries(entry.content.fields);
127
+ const remaining = values.flatMap(([name, value]) => {
128
+ const kept = keptValue(fields, name, value);
129
+ return kept === void 0 ? [] : [[name, kept]];
130
+ });
131
+ if (!(remaining.length !== values.length || remaining.some(([name, value]) => value !== entry.content.fields[name])) && !reformat && !relinkedFiles.has(entry.file)) continue;
132
+ const kept = Object.fromEntries(remaining);
133
+ if (reformat) {
134
+ if (before !== void 0 && typeof kept[before] === "string") kept[before] = formattedHtml(kept[before]);
135
+ if (after !== void 0 && typeof kept[after] === "string") kept[after] = htmlToMarkdown(kept[after]);
136
+ }
137
+ const change = entryFileChange({
138
+ id: collection.id,
139
+ settings
140
+ }, entry.slug, kept, entry.content);
141
+ if (change.path !== entry.file) changes.push({
142
+ path: entry.file,
143
+ delete: true
144
+ });
145
+ changes.push(change);
146
+ }
147
+ if (relinked) changes.push(...relinkedChanges(relinked, [collection.file, ...collection.entries.map((entry) => entry.file)]));
148
+ return changes;
149
+ }
150
+ //#endregion
151
+ //#region src/media.ts
152
+ /** Files in `public/media/` are served from `/media/` on the site. */
153
+ const MEDIA_URL_PREFIX = "/media/";
154
+ /** `public/media/photo.jpg` → `/media/photo.jpg`. */
155
+ function mediaUrl(path) {
156
+ return `${MEDIA_URL_PREFIX}${path.slice(MEDIA_DIR.length + 1)}`;
157
+ }
158
+ /** `/media/photo.jpg` → `public/media/photo.jpg`, or `undefined` for addresses outside the media folder. */
159
+ function mediaPath(url) {
160
+ if (!url.startsWith("/media/")) return void 0;
161
+ let rest;
162
+ try {
163
+ rest = decodeURIComponent(url.slice(7).split(/[?#]/)[0] ?? "");
164
+ } catch {
165
+ return;
166
+ }
167
+ if (!rest || rest.split(/[/\\]/).some((part) => part === "" || part === "." || part === "..")) return void 0;
168
+ return `${MEDIA_DIR}/${rest}`;
169
+ }
170
+ /** A file size in words: `2.4 MB`. */
171
+ function formatSize(bytes) {
172
+ if (bytes < 1024) return `${bytes} B`;
173
+ if (bytes < 1048576) return `${Math.round(bytes / 1024)} KB`;
174
+ return `${(bytes / 1048576).toFixed(1)} MB`;
175
+ }
176
+ /** Where a media file is used, by name, so editors know what deleting or replacing it affects. */
177
+ function mediaUsage(content, url, names) {
178
+ const escaped = url.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
179
+ const address = new RegExp(`(?<![\\w.~%/:-])${escaped}(?![\\w~%-]|[./][\\w])`);
180
+ const uses = (value) => value !== void 0 && address.test(JSON.stringify(value));
181
+ const used = [];
182
+ const add = (name, value) => {
183
+ if (name && !used.includes(name) && uses(value)) used.push(name);
184
+ };
185
+ add(names.settings, content.settings);
186
+ add(names.menus, [content.menus, content.languageMenus]);
187
+ add(names.header, [content.header, Object.values(content.languageLayouts ?? {}).map((layout) => layout.header)]);
188
+ add(names.footer, [content.footer, Object.values(content.languageLayouts ?? {}).map((layout) => layout.footer)]);
189
+ for (const page of content.pages) if (uses(page.content)) used.push(pageTitle$1(page));
190
+ for (const collection of content.collections) {
191
+ if (uses(collection.settings)) used.push(collection.settings.name);
192
+ for (const entry of collection.entries) if (uses(entry.content)) used.push(entryTitle(entry));
193
+ }
194
+ add(names.css, content.customCss);
195
+ add(names.code, content.code);
196
+ add(names.redirects, content.redirects);
197
+ return used;
198
+ }
199
+ /** The addresses of the site's uploaded images, such as `/media/photo.jpg`. */
200
+ function siteImages(media) {
201
+ return media.filter((path) => mediaKind(path) === "image").map(mediaUrl);
202
+ }
203
+ /**
204
+ * Every media file the site has, as `public/media/…` paths: those in the
205
+ * site's own files and those a plugin keeps outside them
206
+ * (`content/media-storage.json`), which content refers to the same way.
207
+ */
208
+ function allMedia(content, media) {
209
+ const stored = Object.keys(content.mediaStorage?.files ?? {}).flatMap((url) => mediaPath(url) ?? []);
210
+ return [.../* @__PURE__ */ new Set([...media, ...stored])];
211
+ }
212
+ /** Whether a plugin keeps a media file outside the site's own files. */
213
+ function isStoredMedia(content, url) {
214
+ return Object.hasOwn(content.mediaStorage?.files ?? {}, url);
215
+ }
216
+ //#endregion
217
+ //#region src/frame/channel.ts
218
+ /**
219
+ * Requests and events between the admin panel and a frame running the site's
220
+ * code, over one `MessagePort`. The admin panel's side treats everything a
221
+ * frame sends as untrusted: the site's blocks run there, and could send anything.
222
+ */
223
+ /** The message the admin panel's page sends a frame once it has loaded, with the port to talk on. */
224
+ const CONNECT_MESSAGE = "goodfellow:connect";
225
+ /** A request the other side refused or couldn't answer. */
226
+ var ChannelError = class extends Error {
227
+ name = "ChannelError";
228
+ };
229
+ function isMessage(data) {
230
+ if (typeof data !== "object" || data === null) return false;
231
+ const type = data.type;
232
+ return type === "request" || type === "response" || type === "event";
233
+ }
234
+ /** What an error says, as text: errors can't cross the port as they are. */
235
+ function errorText(error) {
236
+ return error instanceof Error ? error.message : String(error);
237
+ }
238
+ function createChannel(port, handlers = {}) {
239
+ const own = { ...handlers };
240
+ const pending = /* @__PURE__ */ new Map();
241
+ const listeners = /* @__PURE__ */ new Map();
242
+ let next = 1;
243
+ let closed = false;
244
+ port.onmessage = async (event) => {
245
+ const message = event.data;
246
+ if (!isMessage(message)) return;
247
+ if (message.type === "response") {
248
+ const waiting = pending.get(message.id);
249
+ if (!waiting) return;
250
+ pending.delete(message.id);
251
+ if (message.ok) waiting.resolve(message.result);
252
+ else waiting.reject(new ChannelError(message.error));
253
+ return;
254
+ }
255
+ if (message.type === "event") {
256
+ for (const listener of listeners.get(message.name) ?? []) listener(message.payload);
257
+ return;
258
+ }
259
+ const handler = typeof message.method === "string" ? Object.hasOwn(own, message.method) && own[message.method] : void 0;
260
+ if (!handler) {
261
+ port.postMessage({
262
+ type: "response",
263
+ id: message.id,
264
+ ok: false,
265
+ error: `No such request: ${message.method}`
266
+ });
267
+ return;
268
+ }
269
+ try {
270
+ const result = await handler(message.params);
271
+ if (!closed) port.postMessage({
272
+ type: "response",
273
+ id: message.id,
274
+ ok: true,
275
+ result
276
+ });
277
+ } catch (error) {
278
+ if (!closed) port.postMessage({
279
+ type: "response",
280
+ id: message.id,
281
+ ok: false,
282
+ error: errorText(error)
283
+ });
284
+ }
285
+ };
286
+ return {
287
+ call(method, params, transfer = []) {
288
+ if (closed) return Promise.reject(new ChannelError("The frame has closed."));
289
+ const id = next++;
290
+ return new Promise((resolve, reject) => {
291
+ pending.set(id, {
292
+ resolve,
293
+ reject
294
+ });
295
+ port.postMessage({
296
+ type: "request",
297
+ id,
298
+ method,
299
+ params
300
+ }, transfer);
301
+ });
302
+ },
303
+ emit(name, payload) {
304
+ if (!closed) port.postMessage({
305
+ type: "event",
306
+ name,
307
+ payload
308
+ });
309
+ },
310
+ on(name, listener) {
311
+ const set = listeners.get(name) ?? /* @__PURE__ */ new Set();
312
+ listeners.set(name, set);
313
+ set.add(listener);
314
+ return () => set.delete(listener);
315
+ },
316
+ handle(method, handler) {
317
+ own[method] = handler;
318
+ return () => {
319
+ if (own[method] === handler) delete own[method];
320
+ };
321
+ },
322
+ close() {
323
+ closed = true;
324
+ port.close();
325
+ for (const waiting of pending.values()) waiting.reject(new ChannelError("The frame has closed."));
326
+ pending.clear();
327
+ }
328
+ };
329
+ }
330
+ //#endregion
331
+ //#region src/media-previews.ts
332
+ const TYPES = {
333
+ jpg: "image/jpeg",
334
+ jpeg: "image/jpeg",
335
+ png: "image/png",
336
+ gif: "image/gif",
337
+ webp: "image/webp",
338
+ avif: "image/avif",
339
+ svg: "image/svg+xml",
340
+ ico: "image/x-icon",
341
+ pdf: "application/pdf",
342
+ mp3: "audio/mpeg",
343
+ m4a: "audio/mp4",
344
+ mp4: "video/mp4",
345
+ webm: "video/webm",
346
+ vtt: "text/vtt"
347
+ };
348
+ /** The type to show a file as, from its name. Needed so browsers display SVGs from memory. */
349
+ function mediaType(name) {
350
+ return TYPES[extensionOf(name)] ?? "application/octet-stream";
351
+ }
352
+ function createMediaPreviews(store, siteUrl, storage = () => void 0) {
353
+ const local = /* @__PURE__ */ new Map();
354
+ const remembered = /* @__PURE__ */ new Map();
355
+ const listeners = /* @__PURE__ */ new Set();
356
+ const loading = /* @__PURE__ */ new Map();
357
+ const base = trimChars(siteUrl, "/", { start: false });
358
+ const remember = (url, bytes) => {
359
+ const previous = local.get(url);
360
+ if (previous) URL.revokeObjectURL(previous);
361
+ remembered.set(url, bytes);
362
+ for (const listener of listeners) listener(url, bytes);
363
+ local.set(url, URL.createObjectURL(new Blob([new Uint8Array(bytes)], { type: mediaType(url) })));
364
+ };
365
+ return {
366
+ resolve(url) {
367
+ if (!url.startsWith("/media/")) return url;
368
+ const end = url.search(/[?#]/);
369
+ const stored = local.has(url) ? void 0 : storedMediaUrl(storage(), end < 0 ? url : url.slice(0, end));
370
+ return stored ? `${stored}${end < 0 ? "" : url.slice(end)}` : local.get(url) ?? `${base}${url}`;
371
+ },
372
+ remember,
373
+ onRemember(listener) {
374
+ for (const [url, bytes] of remembered) listener(url, bytes);
375
+ listeners.add(listener);
376
+ return () => listeners.delete(listener);
377
+ },
378
+ async bytes(url) {
379
+ const known = remembered.get(url);
380
+ if (known) return known;
381
+ const path = mediaPath(url);
382
+ return path ? await store.readBytes(path).catch(() => void 0) : void 0;
383
+ },
384
+ load(url) {
385
+ const known = local.get(url);
386
+ if (known) return Promise.resolve(known);
387
+ const path = mediaPath(url);
388
+ if (!path) return Promise.resolve(void 0);
389
+ let pending = loading.get(url);
390
+ if (!pending) {
391
+ pending = store.readBytes(path).then((bytes) => {
392
+ if (!bytes) return void 0;
393
+ remember(url, bytes);
394
+ return local.get(url);
395
+ }).catch(() => void 0);
396
+ loading.set(url, pending);
397
+ }
398
+ return pending;
399
+ }
400
+ };
401
+ }
402
+ const URL_ATTRIBUTES = [
403
+ "src",
404
+ "href",
405
+ "poster"
406
+ ];
407
+ const MEDIA_IN_STYLE = /url\((['"]?)(\/media\/[^'")]+)\1\)/g;
408
+ /**
409
+ * Keeps media in a preview document showing: rewrites `/media/…` addresses in
410
+ * images, links and inline styles as the preview changes, and if an image
411
+ * still doesn't load, reads it from the repository instead. Elements inside
412
+ * `keep` (a selector) are left as they are, such as text edited in place,
413
+ * whose HTML is read back into content.
414
+ */
415
+ function showMediaInPreview(doc, previews, { keep } = {}) {
416
+ const fix = (element) => {
417
+ if (keep && element.closest(keep)) return;
418
+ for (const attribute of URL_ATTRIBUTES) {
419
+ const value = element.getAttribute(attribute);
420
+ if (!value?.startsWith("/media/")) continue;
421
+ const resolved = previews.resolve(value);
422
+ if (resolved !== value) {
423
+ element.setAttribute(`data-gf-${attribute}`, value);
424
+ element.setAttribute(attribute, resolved);
425
+ }
426
+ }
427
+ const style = element.getAttribute("style");
428
+ if (style?.includes("/media/")) {
429
+ const resolved = style.replace(MEDIA_IN_STYLE, (_match, quote, url) => `url(${quote}${previews.resolve(url)}${quote})`);
430
+ if (resolved !== style) element.setAttribute("style", resolved);
431
+ }
432
+ };
433
+ const fixTree = (root) => {
434
+ fix(root);
435
+ for (const element of root.querySelectorAll("[src], [href], [poster], [style]")) fix(element);
436
+ };
437
+ const observer = new MutationObserver((records) => {
438
+ for (const record of records) {
439
+ if (record.type === "attributes" && record.target.nodeType === 1) fix(record.target);
440
+ for (const node of record.addedNodes) if (node.nodeType === 1) fixTree(node);
441
+ }
442
+ });
443
+ observer.observe(doc.documentElement, {
444
+ subtree: true,
445
+ childList: true,
446
+ attributes: true,
447
+ attributeFilter: [...URL_ATTRIBUTES, "style"]
448
+ });
449
+ fixTree(doc.documentElement);
450
+ const onError = (event) => {
451
+ const image = event.target;
452
+ if (image?.tagName !== "IMG") return;
453
+ const original = image.getAttribute("data-gf-src") ?? image.getAttribute("src") ?? "";
454
+ if (!original.startsWith("/media/") || image.hasAttribute("data-gf-loaded")) return;
455
+ if (keep && image.closest(keep)) return;
456
+ image.setAttribute("data-gf-loaded", "");
457
+ previews.load(original).then((url) => {
458
+ if (url) {
459
+ image.setAttribute("data-gf-src", original);
460
+ image.setAttribute("src", url);
461
+ }
462
+ });
463
+ };
464
+ doc.addEventListener("error", onError, true);
465
+ return () => {
466
+ observer.disconnect();
467
+ doc.removeEventListener("error", onError, true);
468
+ };
469
+ }
470
+ //#endregion
471
+ //#region src/frame/plugin-protocol.ts
472
+ /** A plugin's frame sends this to the admin panel's page once it's listening, and the page answers with a port. */
473
+ const PLUGIN_READY_MESSAGE = "goodfellow:plugin-ready";
474
+ //#endregion
475
+ //#region src/custom-font-faces.ts
476
+ const added = /* @__PURE__ */ new WeakMap();
477
+ function faceKey(family, file) {
478
+ return [
479
+ family,
480
+ file.src,
481
+ file.weight,
482
+ file.weightTo ?? "",
483
+ file.style ?? "normal"
484
+ ].join("|");
485
+ }
486
+ /**
487
+ * Adds the site's own fonts to a document from their bytes, and takes away
488
+ * those no longer among them. A file that can't be read or isn't a font is
489
+ * left out, so text shows in the fallback fonts, as it would on the site.
490
+ */
491
+ function installCustomFonts(doc, fonts, read) {
492
+ const FontFaceClass = doc.defaultView?.FontFace;
493
+ if (!FontFaceClass || !doc.fonts) return;
494
+ let faces = added.get(doc);
495
+ if (!faces) {
496
+ faces = /* @__PURE__ */ new Map();
497
+ added.set(doc, faces);
498
+ }
499
+ const wanted = /* @__PURE__ */ new Set();
500
+ for (const font of fonts) for (const file of font.files) {
501
+ const key = faceKey(font.family, file);
502
+ wanted.add(key);
503
+ if (faces.has(key)) continue;
504
+ const placeholder = { loading: true };
505
+ faces.set(key, placeholder);
506
+ read(file.src).then(async (bytes) => {
507
+ if (!bytes || faces?.get(key) !== placeholder) return;
508
+ const face = new FontFaceClass(font.family, bytes.slice().buffer, {
509
+ weight: file.weightTo ? `${file.weight} ${file.weightTo}` : String(file.weight),
510
+ style: file.style ?? "normal",
511
+ display: "swap"
512
+ });
513
+ await face.load();
514
+ if (faces?.get(key) !== placeholder) return;
515
+ faces.set(key, face);
516
+ doc.fonts.add(face);
517
+ }).catch(() => {});
518
+ }
519
+ for (const [key, face] of faces) {
520
+ if (wanted.has(key)) continue;
521
+ if (!("loading" in face)) doc.fonts.delete(face);
522
+ faces.delete(key);
523
+ }
524
+ }
525
+ //#endregion
526
+ export { formattedHtml as $, duplicatePageData as A, pageFileChange as B, checkPageAddress as C, customCssFileChange as D, collectionSettingsChanges as E, menusFileChange as F, storedCss as G, redirectsFileChange as H, moveEntryChanges as I, syncedBlockFileChange as J, storedData as K, movePageChanges as L, itemLinkRemovalChanges as M, layoutFileChange as N, deleteCollectionChanges as O, mediaFileChange as P, editedMarkdown as Q, newCollectionSettings as R, checkEntrySlug as S, collectionFileChange$1 as T, siteSettingsFileChange as U, pageTitle$1 as V, slugify as W, updateSettingsFileChange as X, uniqueName as Y, withoutMediaDetails as Z, mediaUrl as _, showMediaInPreview as a, uploadName as b, MAX_UPLOAD_BYTES as c, extensionOf as d, fileName$1 as f, mediaPath as g, mediaKind$1 as h, mediaType as i, entryFileChange$1 as j, deleteSyncedBlockChanges as k, MEDIA_URL_PREFIX as l, isStoredMedia as m, PLUGIN_READY_MESSAGE as n, CONNECT_MESSAGE as o, formatSize as p, storedEntryFields as q, createMediaPreviews as r, createChannel as s, installCustomFonts as t, allMedia as u, mediaUsage as v, codeFileChanges as w, addressPatternFor as x, siteImages as y, newPageData as z };