ckeditor5-livewire 1.1.2 → 1.2.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/bundler/vite-ckeditor5-externalize.ts +60 -0
- package/dist/bundler/vite-ckeditor5-externalize.cjs +2 -0
- package/dist/bundler/vite-ckeditor5-externalize.cjs.map +1 -0
- package/dist/bundler/vite-ckeditor5-externalize.d.ts +3 -0
- package/dist/bundler/vite-ckeditor5-externalize.d.ts.map +1 -0
- package/dist/bundler/vite-ckeditor5-externalize.mjs +38 -0
- package/dist/bundler/vite-ckeditor5-externalize.mjs.map +1 -0
- package/dist/hooks/context/context.d.ts.map +1 -1
- package/dist/hooks/context/contexts-registry.d.ts.map +1 -1
- package/dist/hooks/context/index.d.ts.map +1 -1
- package/dist/hooks/context/typings.d.ts.map +1 -1
- package/dist/hooks/editable.d.ts.map +1 -1
- package/dist/hooks/editor/custom-editor-plugins.d.ts.map +1 -1
- package/dist/hooks/editor/editor.d.ts.map +1 -1
- package/dist/hooks/editor/editors-registry.d.ts.map +1 -1
- package/dist/hooks/editor/index.d.ts.map +1 -1
- package/dist/hooks/editor/plugins/index.d.ts.map +1 -1
- package/dist/hooks/editor/plugins/livewire-sync.d.ts.map +1 -1
- package/dist/hooks/editor/plugins/sync-editor-with-input.d.ts.map +1 -1
- package/dist/hooks/editor/typings.d.ts.map +1 -1
- package/dist/hooks/editor/utils/create-editor-in-context.d.ts.map +1 -1
- package/dist/hooks/editor/utils/get-editor-roots-values.d.ts.map +1 -1
- package/dist/hooks/editor/utils/index.d.ts.map +1 -1
- package/dist/hooks/editor/utils/is-single-editing-like-editor.d.ts.map +1 -1
- package/dist/hooks/editor/utils/is-wire-model-connected.d.ts.map +1 -1
- package/dist/hooks/editor/utils/load-editor-constructor.d.ts.map +1 -1
- package/dist/hooks/editor/utils/load-editor-plugins.d.ts.map +1 -1
- package/dist/hooks/editor/utils/load-editor-translations.d.ts.map +1 -1
- package/dist/hooks/editor/utils/normalize-custom-translations.d.ts.map +1 -1
- package/dist/hooks/editor/utils/query-editor-editables.d.ts.map +1 -1
- package/dist/hooks/editor/utils/resolve-editor-config-elements-references.d.ts.map +1 -1
- package/dist/hooks/editor/utils/set-editor-editable-height.d.ts.map +1 -1
- package/dist/hooks/editor/utils/wrap-with-watchdog.d.ts.map +1 -1
- package/dist/hooks/hook.d.ts.map +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/ui-part.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +88 -88
- package/dist/index.mjs.map +1 -1
- package/dist/shared/async-registry.d.ts.map +1 -1
- package/dist/shared/camel-case.d.ts.map +1 -1
- package/dist/shared/debounce.d.ts.map +1 -1
- package/dist/shared/deep-camel-case-keys.d.ts.map +1 -1
- package/dist/shared/filter-object-values.d.ts.map +1 -1
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/is-empty-object.d.ts.map +1 -1
- package/dist/shared/is-plain-object.d.ts.map +1 -1
- package/dist/shared/map-object-values.d.ts.map +1 -1
- package/dist/shared/once.d.ts.map +1 -1
- package/dist/shared/shallow-equal.d.ts.map +1 -1
- package/dist/shared/timeout.d.ts.map +1 -1
- package/dist/shared/uid.d.ts.map +1 -1
- package/dist/shared/wait-for.d.ts.map +1 -1
- package/dist/types/can-be-promise.type.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/required-by.type.d.ts.map +1 -1
- package/package.json +7 -1
- package/src/hooks/editor/editor.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class v {
|
|
2
2
|
constructor(t) {
|
|
3
3
|
this.livewireComponent = t;
|
|
4
4
|
}
|
|
@@ -33,17 +33,17 @@ class C {
|
|
|
33
33
|
}
|
|
34
34
|
function _(i, t) {
|
|
35
35
|
const e = /* @__PURE__ */ new Map();
|
|
36
|
-
window.Livewire?.hook("component.init", async ({ component: r, cleanup:
|
|
36
|
+
window.Livewire?.hook("component.init", async ({ component: r, cleanup: n }) => {
|
|
37
37
|
if (r.name !== i)
|
|
38
38
|
return;
|
|
39
|
-
const
|
|
40
|
-
e.set(r.id,
|
|
41
|
-
|
|
42
|
-
}), await
|
|
43
|
-
}), window.Livewire?.hook("commit", async ({ component: r, succeed:
|
|
44
|
-
r.name === i &&
|
|
45
|
-
const
|
|
46
|
-
|
|
39
|
+
const a = new t(r);
|
|
40
|
+
e.set(r.id, a), n(async () => {
|
|
41
|
+
a.state = "destroying", await a.destroyed(), a.state = "destroyed", e.delete(r.id);
|
|
42
|
+
}), await a.mounted(), a.state = "mounted";
|
|
43
|
+
}), window.Livewire?.hook("commit", async ({ component: r, succeed: n }) => {
|
|
44
|
+
r.name === i && n(() => {
|
|
45
|
+
const a = e.get(r.id);
|
|
46
|
+
a?.state === "mounted" && a?.afterCommitSynced?.();
|
|
47
47
|
});
|
|
48
48
|
});
|
|
49
49
|
}
|
|
@@ -74,8 +74,8 @@ class H {
|
|
|
74
74
|
* @returns A promise that resolves with the result of the function.
|
|
75
75
|
*/
|
|
76
76
|
execute(t, e, r) {
|
|
77
|
-
const
|
|
78
|
-
return
|
|
77
|
+
const n = this.items.get(t), a = this.initializationErrors.get(t);
|
|
78
|
+
return a ? (r?.(a), Promise.reject(a)) : n ? Promise.resolve(e(n)) : new Promise((s, o) => {
|
|
79
79
|
const c = this.getPendingCallbacks(t);
|
|
80
80
|
c.success.push(async (u) => {
|
|
81
81
|
s(await e(u));
|
|
@@ -93,7 +93,7 @@ class H {
|
|
|
93
93
|
throw new Error(`Item with ID "${t}" is already registered.`);
|
|
94
94
|
this.resetErrors(t), this.items.set(t, e);
|
|
95
95
|
const r = this.pendingCallbacks.get(t);
|
|
96
|
-
r && (r.success.forEach((
|
|
96
|
+
r && (r.success.forEach((n) => n(e)), this.pendingCallbacks.delete(t)), this.registerAsDefault(t, e), this.notifyWatchers();
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* Registers an error for an item.
|
|
@@ -104,7 +104,7 @@ class H {
|
|
|
104
104
|
error(t, e) {
|
|
105
105
|
this.items.delete(t), this.initializationErrors.set(t, e);
|
|
106
106
|
const r = this.pendingCallbacks.get(t);
|
|
107
|
-
r && (r.error.forEach((
|
|
107
|
+
r && (r.error.forEach((n) => n(e)), this.pendingCallbacks.delete(t)), this.initializationErrors.size === 1 && !this.items.size && this.error(null, e), this.notifyWatchers();
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Resets errors for an item.
|
|
@@ -221,15 +221,15 @@ function O(i, t) {
|
|
|
221
221
|
}, i);
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const e = Object.entries(i).filter(([r,
|
|
224
|
+
function K(i, t) {
|
|
225
|
+
const e = Object.entries(i).filter(([r, n]) => t(n, r));
|
|
226
226
|
return Object.fromEntries(e);
|
|
227
227
|
}
|
|
228
228
|
function j(i) {
|
|
229
229
|
return Object.keys(i).length === 0 && i.constructor === Object;
|
|
230
230
|
}
|
|
231
231
|
function S(i, t) {
|
|
232
|
-
const e = Object.entries(i).map(([r,
|
|
232
|
+
const e = Object.entries(i).map(([r, n]) => [r, t(n, r)]);
|
|
233
233
|
return Object.fromEntries(e);
|
|
234
234
|
}
|
|
235
235
|
function P(i, t) {
|
|
@@ -238,29 +238,29 @@ function P(i, t) {
|
|
|
238
238
|
const e = Object.keys(i), r = Object.keys(t);
|
|
239
239
|
if (e.length !== r.length)
|
|
240
240
|
return !1;
|
|
241
|
-
for (const
|
|
242
|
-
if (i[
|
|
241
|
+
for (const n of e)
|
|
242
|
+
if (i[n] !== t[n] || !Object.prototype.hasOwnProperty.call(t, n))
|
|
243
243
|
return !1;
|
|
244
244
|
return !0;
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function G() {
|
|
247
247
|
return Math.random().toString(36).substring(2);
|
|
248
248
|
}
|
|
249
249
|
function Y(i, {
|
|
250
250
|
timeOutAfter: t = 500,
|
|
251
251
|
retryAfter: e = 100
|
|
252
252
|
} = {}) {
|
|
253
|
-
return new Promise((r,
|
|
254
|
-
const
|
|
253
|
+
return new Promise((r, n) => {
|
|
254
|
+
const a = Date.now();
|
|
255
255
|
let s = null;
|
|
256
256
|
const o = setTimeout(() => {
|
|
257
|
-
|
|
257
|
+
n(s ?? new Error("Timeout"));
|
|
258
258
|
}, t), c = async () => {
|
|
259
259
|
try {
|
|
260
260
|
const u = await i();
|
|
261
261
|
clearTimeout(o), r(u);
|
|
262
262
|
} catch (u) {
|
|
263
|
-
s = u, Date.now() -
|
|
263
|
+
s = u, Date.now() - a > t ? n(u) : setTimeout(c, e);
|
|
264
264
|
}
|
|
265
265
|
};
|
|
266
266
|
c();
|
|
@@ -268,24 +268,24 @@ function Y(i, {
|
|
|
268
268
|
}
|
|
269
269
|
const I = Symbol.for("context-editor-watchdog");
|
|
270
270
|
async function X({ element: i, context: t, creator: e, config: r }) {
|
|
271
|
-
const
|
|
271
|
+
const n = G();
|
|
272
272
|
await t.add({
|
|
273
273
|
creator: (c, u) => e.create(c, u),
|
|
274
|
-
id:
|
|
274
|
+
id: n,
|
|
275
275
|
sourceElementOrData: i,
|
|
276
276
|
type: "editor",
|
|
277
277
|
config: r
|
|
278
278
|
});
|
|
279
|
-
const
|
|
279
|
+
const a = t.getItem(n), s = {
|
|
280
280
|
state: "available",
|
|
281
|
-
editorContextId:
|
|
281
|
+
editorContextId: n,
|
|
282
282
|
context: t
|
|
283
283
|
};
|
|
284
|
-
|
|
284
|
+
a[I] = s;
|
|
285
285
|
const o = t.destroy.bind(t);
|
|
286
286
|
return t.destroy = async () => (s.state = "unavailable", o()), {
|
|
287
287
|
...s,
|
|
288
|
-
editor:
|
|
288
|
+
editor: a
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
291
|
function J(i) {
|
|
@@ -294,7 +294,7 @@ function J(i) {
|
|
|
294
294
|
function Q(i) {
|
|
295
295
|
return i.model.document.getRootNames().reduce((e, r) => (e[r] = i.getData({ rootName: r }), e), /* @__PURE__ */ Object.create({}));
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function C(i) {
|
|
298
298
|
return ["inline", "classic", "balloon", "decoupled"].includes(i);
|
|
299
299
|
}
|
|
300
300
|
function Z(i) {
|
|
@@ -382,11 +382,11 @@ class $ {
|
|
|
382
382
|
async function F(i) {
|
|
383
383
|
const t = await import("ckeditor5");
|
|
384
384
|
let e = null;
|
|
385
|
-
const r = i.map(async (
|
|
386
|
-
const
|
|
387
|
-
if (
|
|
388
|
-
return
|
|
389
|
-
const { [
|
|
385
|
+
const r = i.map(async (n) => {
|
|
386
|
+
const a = await $.the.get(n);
|
|
387
|
+
if (a)
|
|
388
|
+
return a;
|
|
389
|
+
const { [n]: s } = t;
|
|
390
390
|
if (s)
|
|
391
391
|
return s;
|
|
392
392
|
if (!e)
|
|
@@ -395,10 +395,10 @@ async function F(i) {
|
|
|
395
395
|
} catch (c) {
|
|
396
396
|
console.error(`Failed to load premium package: ${c}`);
|
|
397
397
|
}
|
|
398
|
-
const { [
|
|
398
|
+
const { [n]: o } = e || {};
|
|
399
399
|
if (o)
|
|
400
400
|
return o;
|
|
401
|
-
throw new Error(`Plugin "${
|
|
401
|
+
throw new Error(`Plugin "${n}" not found in base or premium packages.`);
|
|
402
402
|
});
|
|
403
403
|
return {
|
|
404
404
|
loadedPlugins: await Promise.all(r),
|
|
@@ -412,8 +412,8 @@ async function V(i, t) {
|
|
|
412
412
|
W("ckeditor5", e),
|
|
413
413
|
/* v8 ignore next */
|
|
414
414
|
t && W("ckeditor5-premium-features", e)
|
|
415
|
-
].filter((
|
|
416
|
-
).then((
|
|
415
|
+
].filter((n) => !!n)
|
|
416
|
+
).then((n) => n.flat());
|
|
417
417
|
}
|
|
418
418
|
async function W(i, t) {
|
|
419
419
|
return await Promise.all(
|
|
@@ -742,21 +742,21 @@ function T(i, t) {
|
|
|
742
742
|
const { element: r } = N(i);
|
|
743
743
|
return r;
|
|
744
744
|
}
|
|
745
|
-
if (
|
|
745
|
+
if (C(t))
|
|
746
746
|
return document.getElementById(`${i}_editor`);
|
|
747
747
|
const e = M(i);
|
|
748
748
|
return S(e, ({ element: r }) => r);
|
|
749
749
|
}
|
|
750
750
|
function A(i, t) {
|
|
751
751
|
if (t === "decoupled") {
|
|
752
|
-
const { content:
|
|
753
|
-
if (typeof
|
|
752
|
+
const { content: n } = N(i);
|
|
753
|
+
if (typeof n == "string")
|
|
754
754
|
return {
|
|
755
|
-
main:
|
|
755
|
+
main: n
|
|
756
756
|
};
|
|
757
757
|
}
|
|
758
|
-
const e = M(i), r = S(e, ({ content:
|
|
759
|
-
return
|
|
758
|
+
const e = M(i), r = S(e, ({ content: n }) => n);
|
|
759
|
+
return K(r, (n) => typeof n == "string");
|
|
760
760
|
}
|
|
761
761
|
function N(i) {
|
|
762
762
|
const t = M(i).main;
|
|
@@ -775,8 +775,8 @@ function x(i) {
|
|
|
775
775
|
return r || console.warn(`Element not found for selector: ${t.$element}`), r || null;
|
|
776
776
|
}
|
|
777
777
|
const e = /* @__PURE__ */ Object.create(null);
|
|
778
|
-
for (const [r,
|
|
779
|
-
e[r] = x(
|
|
778
|
+
for (const [r, n] of Object.entries(i))
|
|
779
|
+
e[r] = x(n);
|
|
780
780
|
return e;
|
|
781
781
|
}
|
|
782
782
|
function rt(i, t) {
|
|
@@ -789,8 +789,8 @@ const D = Symbol.for("elixir-editor-watchdog");
|
|
|
789
789
|
async function it(i) {
|
|
790
790
|
const { EditorWatchdog: t } = await import("ckeditor5"), e = new t(i);
|
|
791
791
|
return e.setCreator(async (...r) => {
|
|
792
|
-
const
|
|
793
|
-
return
|
|
792
|
+
const n = await i.create(...r);
|
|
793
|
+
return n[D] = e, n;
|
|
794
794
|
}), {
|
|
795
795
|
watchdog: e,
|
|
796
796
|
Constructor: {
|
|
@@ -798,13 +798,13 @@ async function it(i) {
|
|
|
798
798
|
}
|
|
799
799
|
};
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function nt(i) {
|
|
802
802
|
return D in i ? i[D] : null;
|
|
803
803
|
}
|
|
804
804
|
class y extends H {
|
|
805
805
|
static the = new y();
|
|
806
806
|
}
|
|
807
|
-
class
|
|
807
|
+
class at extends v {
|
|
808
808
|
/**
|
|
809
809
|
* The promise that resolves to the context instance.
|
|
810
810
|
*/
|
|
@@ -813,14 +813,14 @@ class nt extends C {
|
|
|
813
813
|
* Mounts the context component.
|
|
814
814
|
*/
|
|
815
815
|
async mounted() {
|
|
816
|
-
const { contextId: t, language: e, context: r } = this.canonical, { customTranslations:
|
|
816
|
+
const { contextId: t, language: e, context: r } = this.canonical, { customTranslations: n, watchdogConfig: a, config: { plugins: s, ...o } } = r, { loadedPlugins: c, hasPremium: u } = await F(s ?? []), h = [
|
|
817
817
|
...await V(e, u),
|
|
818
|
-
q(
|
|
818
|
+
q(n || {})
|
|
819
819
|
].filter((d) => !j(d));
|
|
820
820
|
this.contextPromise = (async () => {
|
|
821
821
|
const { ContextWatchdog: d, Context: g } = await import("ckeditor5"), p = new d(g, {
|
|
822
822
|
crashNumberLimit: 10,
|
|
823
|
-
...
|
|
823
|
+
...a
|
|
824
824
|
});
|
|
825
825
|
return await p.create({
|
|
826
826
|
...o,
|
|
@@ -852,7 +852,7 @@ class nt extends C {
|
|
|
852
852
|
class w extends H {
|
|
853
853
|
static the = new w();
|
|
854
854
|
}
|
|
855
|
-
class st extends
|
|
855
|
+
class st extends v {
|
|
856
856
|
/**
|
|
857
857
|
* The promise that resolves when the editable is mounted.
|
|
858
858
|
*/
|
|
@@ -861,7 +861,7 @@ class st extends C {
|
|
|
861
861
|
* Mounts the editable component.
|
|
862
862
|
*/
|
|
863
863
|
mounted() {
|
|
864
|
-
const { editorId: t, rootName: e, content: r, saveDebounceMs:
|
|
864
|
+
const { editorId: t, rootName: e, content: r, saveDebounceMs: n } = this.canonical, a = this.element.querySelector("input");
|
|
865
865
|
this.editorPromise = w.the.execute(t, (s) => {
|
|
866
866
|
const { ui: o, editing: c, model: u } = s;
|
|
867
867
|
if (u.document.getRoot(e)) {
|
|
@@ -883,9 +883,9 @@ class st extends C {
|
|
|
883
883
|
o.addEditable(h), c.view.forceRender();
|
|
884
884
|
const f = () => {
|
|
885
885
|
const d = s.getData({ rootName: e });
|
|
886
|
-
|
|
886
|
+
a && (a.value = d), this.$wire.set("content", d);
|
|
887
887
|
};
|
|
888
|
-
return s.model.document.on("change:data", O(
|
|
888
|
+
return s.model.document.on("change:data", O(n, f)), f(), s;
|
|
889
889
|
});
|
|
890
890
|
}
|
|
891
891
|
/**
|
|
@@ -932,50 +932,50 @@ async function ot({
|
|
|
932
932
|
* Setups the content sync from Livewire to the editor.
|
|
933
933
|
*/
|
|
934
934
|
setupContentServerSync() {
|
|
935
|
-
const { editor:
|
|
935
|
+
const { editor: n } = this, { model: a, ui: { focusTracker: s } } = n;
|
|
936
936
|
let o = null;
|
|
937
|
-
|
|
937
|
+
n.on("afterCommitSynced", () => {
|
|
938
938
|
const { content: c } = t.canonical, u = this.getEditorRootsValues();
|
|
939
939
|
if (Z(t.element)) {
|
|
940
940
|
if (s.isFocused) {
|
|
941
941
|
P(c, u) || (o = c);
|
|
942
942
|
return;
|
|
943
943
|
}
|
|
944
|
-
P(c, u) ||
|
|
944
|
+
P(c, u) || n.setData(c);
|
|
945
945
|
}
|
|
946
946
|
}), Livewire.on("set-editor-content", ({ editorId: c, content: u }) => {
|
|
947
947
|
if (c !== t.canonical.editorId)
|
|
948
948
|
return;
|
|
949
949
|
const l = this.getEditorRootsValues();
|
|
950
|
-
P(l, u) ||
|
|
951
|
-
}),
|
|
950
|
+
P(l, u) || n.setData(u);
|
|
951
|
+
}), a.document.on("change:data", () => {
|
|
952
952
|
o = null;
|
|
953
953
|
}), s.on("change:isFocused", () => {
|
|
954
|
-
!s.isFocused && o !== null && (
|
|
954
|
+
!s.isFocused && o !== null && (n.setData(o), o = null);
|
|
955
955
|
});
|
|
956
956
|
}
|
|
957
957
|
/**
|
|
958
958
|
* Setups the content push event for the editor.
|
|
959
959
|
*/
|
|
960
960
|
setupTypingContentPush() {
|
|
961
|
-
const { model:
|
|
961
|
+
const { model: n } = this.editor, { $wire: a } = t, s = () => {
|
|
962
962
|
const o = this.getEditorRootsValues();
|
|
963
|
-
P(o, t.canonical.content) || (
|
|
963
|
+
P(o, t.canonical.content) || (a.set("content", o), a.dispatch("editor-content-changed", {
|
|
964
964
|
editorId: t.canonical.editorId,
|
|
965
965
|
content: o
|
|
966
966
|
}));
|
|
967
967
|
};
|
|
968
|
-
|
|
968
|
+
n.document.on("change:data", O(i, s)), this.editor.once("ready", s);
|
|
969
969
|
}
|
|
970
970
|
/**
|
|
971
971
|
* Setups the event push for the editor.
|
|
972
972
|
*/
|
|
973
973
|
setupFocusableEventPush() {
|
|
974
|
-
const { ui:
|
|
974
|
+
const { ui: n } = this.editor, { $wire: a } = t, s = () => {
|
|
975
975
|
const o = this.getEditorRootsValues();
|
|
976
|
-
|
|
976
|
+
a.set("focused", n.focusTracker.isFocused), P(o, t.canonical.content) || a.set("content", o);
|
|
977
977
|
};
|
|
978
|
-
|
|
978
|
+
n.focusTracker.on("change:isFocused", s);
|
|
979
979
|
}
|
|
980
980
|
/**
|
|
981
981
|
* Gets the current values of all editor roots.
|
|
@@ -1006,8 +1006,8 @@ async function ct(i) {
|
|
|
1006
1006
|
* Initializes the plugin.
|
|
1007
1007
|
*/
|
|
1008
1008
|
afterInit() {
|
|
1009
|
-
const { editor: r } = this,
|
|
1010
|
-
this.input = document.getElementById(`${
|
|
1009
|
+
const { editor: r } = this, a = r.sourceElement.id.replace(/_editor$/, "");
|
|
1010
|
+
this.input = document.getElementById(`${a}_input`), this.input && (r.model.document.on("change:data", O(i, () => this.sync())), r.once("ready", this.sync), this.form = this.input.closest("form"), this.form?.addEventListener("submit", this.sync));
|
|
1011
1011
|
}
|
|
1012
1012
|
/**
|
|
1013
1013
|
* Synchronizes the editor's content with the input field.
|
|
@@ -1024,7 +1024,7 @@ async function ct(i) {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
};
|
|
1026
1026
|
}
|
|
1027
|
-
class ut extends
|
|
1027
|
+
class ut extends v {
|
|
1028
1028
|
/**
|
|
1029
1029
|
* The promise that resolves to the editor instance.
|
|
1030
1030
|
*/
|
|
@@ -1042,7 +1042,7 @@ class ut extends C {
|
|
|
1042
1042
|
w.the.hasItem(t) && w.the.unregister(t);
|
|
1043
1043
|
}));
|
|
1044
1044
|
} catch (e) {
|
|
1045
|
-
this.editorPromise = null, w.the.error(t, e);
|
|
1045
|
+
console.error(`Error initializing CKEditor5 instance with ID "${t}":`, e), this.editorPromise = null, w.the.error(t, e);
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
1048
|
/**
|
|
@@ -1055,7 +1055,7 @@ class ut extends C {
|
|
|
1055
1055
|
const t = await this.editorPromise;
|
|
1056
1056
|
if (!t)
|
|
1057
1057
|
return;
|
|
1058
|
-
const e = J(t), r =
|
|
1058
|
+
const e = J(t), r = nt(t);
|
|
1059
1059
|
e ? e.state !== "unavailable" && await e.context.remove(e.editorContextId) : r ? await r.destroy() : await t.destroy();
|
|
1060
1060
|
} finally {
|
|
1061
1061
|
this.editorPromise = null;
|
|
@@ -1075,8 +1075,8 @@ class ut extends C {
|
|
|
1075
1075
|
preset: t,
|
|
1076
1076
|
editorId: e,
|
|
1077
1077
|
contextId: r,
|
|
1078
|
-
editableHeight:
|
|
1079
|
-
saveDebounceMs:
|
|
1078
|
+
editableHeight: n,
|
|
1079
|
+
saveDebounceMs: a,
|
|
1080
1080
|
language: s,
|
|
1081
1081
|
watchdog: o,
|
|
1082
1082
|
content: c
|
|
@@ -1099,12 +1099,12 @@ class ut extends C {
|
|
|
1099
1099
|
E.push(
|
|
1100
1100
|
await ot(
|
|
1101
1101
|
{
|
|
1102
|
-
saveDebounceMs:
|
|
1102
|
+
saveDebounceMs: a,
|
|
1103
1103
|
component: this
|
|
1104
1104
|
}
|
|
1105
1105
|
)
|
|
1106
|
-
),
|
|
1107
|
-
await ct(
|
|
1106
|
+
), C(l) && E.push(
|
|
1107
|
+
await ct(a)
|
|
1108
1108
|
);
|
|
1109
1109
|
const z = [
|
|
1110
1110
|
...await V(s, U),
|
|
@@ -1114,7 +1114,7 @@ class ut extends C {
|
|
|
1114
1114
|
...c,
|
|
1115
1115
|
...A(e, l)
|
|
1116
1116
|
};
|
|
1117
|
-
|
|
1117
|
+
C(l) && (b = b.main || "");
|
|
1118
1118
|
const R = await (async () => {
|
|
1119
1119
|
let m = T(e, l);
|
|
1120
1120
|
if (mt(m, l)) {
|
|
@@ -1141,7 +1141,7 @@ class ut extends C {
|
|
|
1141
1141
|
config: k
|
|
1142
1142
|
})).editor;
|
|
1143
1143
|
})();
|
|
1144
|
-
return
|
|
1144
|
+
return C(l) && n && rt(R, n), R;
|
|
1145
1145
|
}
|
|
1146
1146
|
}
|
|
1147
1147
|
function B(i, t) {
|
|
@@ -1156,7 +1156,7 @@ async function lt(i, t, e) {
|
|
|
1156
1156
|
`It looks like not all required root elements are present yet.
|
|
1157
1157
|
* If you want to wait for them, ensure they are registered before editor initialization.
|
|
1158
1158
|
* If you want lazy initialize roots, consider removing root values from the \`initialData\` config and assign initial data in editable components.
|
|
1159
|
-
Missing roots: ${e.filter((
|
|
1159
|
+
Missing roots: ${e.filter((n) => !r[n]).join(", ")}.`
|
|
1160
1160
|
);
|
|
1161
1161
|
return !0;
|
|
1162
1162
|
},
|
|
@@ -1164,9 +1164,9 @@ Missing roots: ${e.filter((a) => !r[a]).join(", ")}.`
|
|
|
1164
1164
|
), T(i, t);
|
|
1165
1165
|
}
|
|
1166
1166
|
function mt(i, t) {
|
|
1167
|
-
return !
|
|
1167
|
+
return !C(t) && typeof i == "object" && !(i instanceof HTMLElement);
|
|
1168
1168
|
}
|
|
1169
|
-
class dt extends
|
|
1169
|
+
class dt extends v {
|
|
1170
1170
|
/**
|
|
1171
1171
|
* The promise that resolves when the UI part is mounted.
|
|
1172
1172
|
*/
|
|
@@ -1177,7 +1177,7 @@ class dt extends C {
|
|
|
1177
1177
|
async mounted() {
|
|
1178
1178
|
const { editorId: t, name: e } = this.canonical;
|
|
1179
1179
|
this.mountedPromise = w.the.execute(t, (r) => {
|
|
1180
|
-
const { ui:
|
|
1180
|
+
const { ui: n } = r, a = wt(e), s = n.view[a];
|
|
1181
1181
|
if (!s) {
|
|
1182
1182
|
console.error(`Unknown UI part name: "${e}". Supported names are "toolbar" and "menubar".`);
|
|
1183
1183
|
return;
|
|
@@ -1204,7 +1204,7 @@ function wt(i) {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
const pt = {
|
|
1206
1206
|
ckeditor5: ut,
|
|
1207
|
-
"ckeditor5-context":
|
|
1207
|
+
"ckeditor5-context": at,
|
|
1208
1208
|
"ckeditor5-ui-part": dt,
|
|
1209
1209
|
"ckeditor5-editable": st
|
|
1210
1210
|
};
|