@jackuait/blok 0.4.1-beta.17 → 0.4.1-beta.19
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/blok.mjs +2 -2
- package/dist/chunks/{blok-BmQiBq7w.mjs → blok-zaWxnlMM.mjs} +680 -526
- package/dist/chunks/{i18next-loader-CtUJZQir.mjs → i18next-loader-CI8T9PDi.mjs} +1 -1
- package/dist/chunks/{index-CvHTp5IA.mjs → index-D9haze7z.mjs} +1 -1
- package/dist/chunks/{inline-tool-convert-f0-Y0Vcm.mjs → inline-tool-convert-CoQJYHI_.mjs} +1 -1
- package/dist/full.mjs +2 -2
- package/dist/tools.mjs +2 -2
- package/package.json +1 -1
- package/src/components/block/index.ts +15 -0
- package/src/components/modules/api/blocks.ts +27 -0
- package/src/components/modules/blockManager.ts +4 -0
- package/src/components/modules/history/index.ts +7 -0
- package/src/components/modules/history/smart-grouping.ts +98 -0
- package/src/components/modules/history/types.ts +56 -0
- package/src/components/modules/history.ts +145 -6
- package/src/components/modules/paste.ts +47 -7
- package/src/components/modules/renderer.ts +3 -1
- package/types/api/blocks.d.ts +15 -0
- package/types/data-formats/output-data.d.ts +7 -0
|
@@ -2,14 +2,14 @@ var Ko = Object.defineProperty, Wo = Object.defineProperties;
|
|
|
2
2
|
var $o = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var At = Object.getOwnPropertySymbols;
|
|
4
4
|
var Fe = Object.prototype.hasOwnProperty, _e = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var He = (a, t, e) => t in a ? Ko(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e,
|
|
5
|
+
var He = (a, t, e) => t in a ? Ko(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, y = (a, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
7
|
Fe.call(t, e) && He(a, e, t[e]);
|
|
8
8
|
if (At)
|
|
9
9
|
for (var e of At(t))
|
|
10
10
|
_e.call(t, e) && He(a, e, t[e]);
|
|
11
11
|
return a;
|
|
12
|
-
},
|
|
12
|
+
}, P = (a, t) => Wo(a, $o(t));
|
|
13
13
|
var jt = (a, t) => {
|
|
14
14
|
var e = {};
|
|
15
15
|
for (var o in a)
|
|
@@ -19,12 +19,12 @@ var jt = (a, t) => {
|
|
|
19
19
|
t.indexOf(o) < 0 && _e.call(a, o) && (e[o] = a[o]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
22
|
-
import { i as N, g as jo, a as g, b as ve, c as E, l as I, S as
|
|
23
|
-
function
|
|
22
|
+
import { i as N, g as jo, a as g, b as ve, c as E, l as I, S as w, d as Yo, e as Vo, D as m, t as S, f as Y, h as ko, P as O, j as Ht, k as X, m as A, n as Bt, o as ht, p as bo, q as nt, T as Yt, r as Ft, s as v, I as Xo, u as qo, v as ct, w as oe, x as Go, y as Zo, z as Jo, A as vo, B as Qo, C as Bo, E as yo, F as tn, G as ze, H as en, J as on, K as nn, L as Be, M as Ue, N as sn, O as Ke, Q as We, R as rn, U as an, V as ln, W as cn, X as dn, Y as ne, Z as _t, _ as hn, $ as un, a0 as pn, a1 as $e, a2 as fn, a3 as gn, a4 as mn, a5 as kn, a6 as bn, a7 as vn, a8 as Bn } from "./inline-tool-convert-CoQJYHI_.mjs";
|
|
23
|
+
function yn(a) {
|
|
24
24
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
25
25
|
}
|
|
26
26
|
var Vt, je;
|
|
27
|
-
function
|
|
27
|
+
function wn() {
|
|
28
28
|
if (je) return Vt;
|
|
29
29
|
je = 1;
|
|
30
30
|
function a() {
|
|
@@ -37,7 +37,7 @@ function yn() {
|
|
|
37
37
|
__esModule: !0
|
|
38
38
|
}), Vt;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
wn();
|
|
41
41
|
typeof Element != "undefined" && typeof Element.prototype.scrollIntoViewIfNeeded == "undefined" && (Element.prototype.scrollIntoViewIfNeeded = function(a) {
|
|
42
42
|
const t = a != null ? a : !0, e = this.parentElement;
|
|
43
43
|
if (!e)
|
|
@@ -45,7 +45,7 @@ typeof Element != "undefined" && typeof Element.prototype.scrollIntoViewIfNeeded
|
|
|
45
45
|
const o = window.getComputedStyle(e, null), n = parseInt(o.getPropertyValue("border-top-width")), s = parseInt(o.getPropertyValue("border-left-width")), i = this.offsetTop - e.offsetTop < e.scrollTop, r = this.offsetTop - e.offsetTop + this.clientHeight - n > e.scrollTop + e.clientHeight, l = this.offsetLeft - e.offsetLeft < e.scrollLeft, c = this.offsetLeft - e.offsetLeft + this.clientWidth - s > e.scrollLeft + e.clientWidth, d = i && !r;
|
|
46
46
|
(i || r) && t && (e.scrollTop = this.offsetTop - e.offsetTop - e.clientHeight / 2 - n + this.clientHeight / 2), (l || c) && t && (e.scrollLeft = this.offsetLeft - e.offsetLeft - e.clientWidth / 2 - s + this.clientWidth / 2), (i || r || l || c) && !t && this.scrollIntoView(d);
|
|
47
47
|
});
|
|
48
|
-
const xn = globalThis.setTimeout.bind(globalThis), Tn = globalThis.clearTimeout.bind(globalThis), zt = /* @__PURE__ */ new Map(),
|
|
48
|
+
const xn = globalThis.setTimeout.bind(globalThis), Tn = globalThis.clearTimeout.bind(globalThis), zt = /* @__PURE__ */ new Map(), Cn = (a) => {
|
|
49
49
|
const t = Number(a);
|
|
50
50
|
return Number.isFinite(t) && t > 0 ? t : Date.now();
|
|
51
51
|
};
|
|
@@ -58,16 +58,16 @@ typeof window != "undefined" && typeof window.requestIdleCallback == "undefined"
|
|
|
58
58
|
return Math.max(0, 50 - (Date.now() - t));
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
}, 1), n =
|
|
61
|
+
}, 1), n = Cn(o);
|
|
62
62
|
return e.value = n, zt.set(n, o), n;
|
|
63
63
|
});
|
|
64
64
|
typeof window != "undefined" && typeof window.cancelIdleCallback == "undefined" && (window.cancelIdleCallback = function(a) {
|
|
65
65
|
const t = zt.get(a);
|
|
66
66
|
t !== void 0 && (zt.delete(a), Tn(t)), globalThis.clearTimeout(a);
|
|
67
67
|
});
|
|
68
|
-
class
|
|
68
|
+
class kt extends Error {
|
|
69
69
|
}
|
|
70
|
-
class
|
|
70
|
+
class St {
|
|
71
71
|
constructor() {
|
|
72
72
|
this.subscribers = {};
|
|
73
73
|
}
|
|
@@ -125,7 +125,7 @@ class Ct {
|
|
|
125
125
|
this.subscribers = {};
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const Sn = function(t) {
|
|
129
129
|
return Object.setPrototypeOf(this, {
|
|
130
130
|
/**
|
|
131
131
|
* Block id
|
|
@@ -243,7 +243,7 @@ const Cn = function(t) {
|
|
|
243
243
|
configurable: !0
|
|
244
244
|
}
|
|
245
245
|
}), this;
|
|
246
|
-
},
|
|
246
|
+
}, W = Sn;
|
|
247
247
|
class It {
|
|
248
248
|
constructor() {
|
|
249
249
|
this.allListeners = [];
|
|
@@ -462,9 +462,9 @@ class T {
|
|
|
462
462
|
const In = (a, t) => {
|
|
463
463
|
const { type: e, target: o, addedNodes: n, removedNodes: s } = a;
|
|
464
464
|
return a.type === "attributes" && a.attributeName === "data-blok-empty" ? !1 : t.contains(o) ? !0 : e !== "childList" ? !1 : Array.from(n).some((l) => l === t) ? !0 : Array.from(s).some((l) => l === t);
|
|
465
|
-
}, se = "redactor dom changed",
|
|
466
|
-
var
|
|
467
|
-
const U = class U extends
|
|
465
|
+
}, se = "redactor dom changed", yt = "block changed", wo = "fake cursor is about to be toggled", xo = "fake cursor have been set", wt = "blok mobile layout toggled", ie = "block-settings-opened", re = "block-settings-closed", En = "history:state-changed";
|
|
466
|
+
var V = /* @__PURE__ */ ((a) => (a.RENDERED = "rendered", a.MOVED = "moved", a.UPDATED = "updated", a.REMOVED = "removed", a.ON_PASTE = "onPaste", a))(V || {});
|
|
467
|
+
const U = class U extends St {
|
|
468
468
|
/**
|
|
469
469
|
* @param options - block constructor options
|
|
470
470
|
* @param [options.id] - block's id. Will be generated if omitted.
|
|
@@ -474,6 +474,7 @@ const U = class U extends Ct {
|
|
|
474
474
|
* @param options.readOnly - Read-Only flag
|
|
475
475
|
* @param [options.parentId] - parent block id for hierarchical structure
|
|
476
476
|
* @param [options.contentIds] - array of child block ids
|
|
477
|
+
* @param [options.slot] - slot index within parent container
|
|
477
478
|
* @param [eventBus] - Blok common event bus. Allows to subscribe on some Blok events. Could be omitted when "virtual" Block is created. See BlocksAPI@composeBlockData.
|
|
478
479
|
*/
|
|
479
480
|
constructor({
|
|
@@ -483,35 +484,36 @@ const U = class U extends Ct {
|
|
|
483
484
|
readOnly: n,
|
|
484
485
|
tunesData: s,
|
|
485
486
|
parentId: i,
|
|
486
|
-
contentIds: r
|
|
487
|
-
|
|
487
|
+
contentIds: r,
|
|
488
|
+
slot: l
|
|
489
|
+
}, c) {
|
|
488
490
|
super(), this.cachedInputs = [], this.lastSavedTunes = {}, this.toolRenderedElement = null, this.contentElement = null, this.tunesInstances = /* @__PURE__ */ new Map(), this.defaultTunesInstances = /* @__PURE__ */ new Map(), this.readyResolver = null, this.unavailableTunesData = {}, this.inputIndex = 0, this.blokEventBus = null, this.draggableCleanup = null, this.redactorDomChangedCallback = () => {
|
|
489
491
|
}, this.handleFocus = () => {
|
|
490
492
|
this.dropInputsCache(), this.updateCurrentInput();
|
|
491
|
-
}, this.didMutated = (
|
|
492
|
-
const
|
|
493
|
-
!
|
|
494
|
-
const { addedNodes:
|
|
493
|
+
}, this.didMutated = (h = void 0) => {
|
|
494
|
+
const u = h === void 0, f = h instanceof InputEvent;
|
|
495
|
+
!u && !f && this.detectToolRootChange(h), (u || f ? !0 : !(h.length > 0 && h.every((b) => {
|
|
496
|
+
const { addedNodes: B, removedNodes: x, target: C } = b;
|
|
495
497
|
return [
|
|
496
|
-
...Array.from(k),
|
|
497
498
|
...Array.from(B),
|
|
498
|
-
x
|
|
499
|
+
...Array.from(x),
|
|
500
|
+
C
|
|
499
501
|
].every((M) => {
|
|
500
|
-
var
|
|
501
|
-
const
|
|
502
|
-
return
|
|
502
|
+
var G;
|
|
503
|
+
const D = g.isElement(M) ? M : (G = M.parentElement) != null ? G : null;
|
|
504
|
+
return D === null ? !1 : D.closest('[data-blok-mutation-free="true"]') !== null;
|
|
503
505
|
});
|
|
504
506
|
}))) && (this.dropInputsCache(), this.updateCurrentInput(), this.toggleInputsEmptyMark(), this.call(
|
|
505
507
|
"updated"
|
|
506
508
|
/* UPDATED */
|
|
507
509
|
), this.emit("didMutated", this));
|
|
508
|
-
}, this.ready = new Promise((
|
|
509
|
-
this.readyResolver =
|
|
510
|
-
}), this.name = o.name, this.id = t, this.parentId = i != null ? i : null, this.contentIds = r != null ? r : [], this.settings = o.settings, this.config = this.settings, this.blokEventBus =
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
510
|
+
}, this.ready = new Promise((h) => {
|
|
511
|
+
this.readyResolver = h;
|
|
512
|
+
}), this.name = o.name, this.id = t, this.parentId = i != null ? i : null, this.contentIds = r != null ? r : [], this.slot = l != null ? l : null, this.settings = o.settings, this.config = this.settings, this.blokEventBus = c || null, this.blockAPI = new W(this), this.lastSavedData = e != null ? e : {}, this.lastSavedTunes = s != null ? s : {}, this.tool = o, this.toolInstance = o.create(e, this.blockAPI, n), this.tunes = o.tunes, this.composeTunes(s);
|
|
513
|
+
const d = this.compose();
|
|
514
|
+
if (d == null)
|
|
513
515
|
throw new Error(`Tool "${this.name}" did not return a block holder element during render()`);
|
|
514
|
-
this.holder =
|
|
516
|
+
this.holder = d, window.requestIdleCallback(() => {
|
|
515
517
|
this.watchBlockMutations(), this.addInputEvents(), this.toggleInputsEmptyMark();
|
|
516
518
|
});
|
|
517
519
|
}
|
|
@@ -577,7 +579,7 @@ const U = class U extends Ct {
|
|
|
577
579
|
const t = await this.extractToolData();
|
|
578
580
|
if (t === void 0)
|
|
579
581
|
return;
|
|
580
|
-
const e =
|
|
582
|
+
const e = y({}, this.unavailableTunesData);
|
|
581
583
|
[
|
|
582
584
|
...this.tunesInstances.entries(),
|
|
583
585
|
...this.defaultTunesInstances.entries()
|
|
@@ -590,7 +592,7 @@ const U = class U extends Ct {
|
|
|
590
592
|
}
|
|
591
593
|
});
|
|
592
594
|
const o = window.performance.now();
|
|
593
|
-
this.lastSavedData = t, this.lastSavedTunes =
|
|
595
|
+
this.lastSavedData = t, this.lastSavedTunes = y({}, e);
|
|
594
596
|
const n = window.performance.now();
|
|
595
597
|
return {
|
|
596
598
|
id: this.id,
|
|
@@ -608,7 +610,7 @@ const U = class U extends Ct {
|
|
|
608
610
|
const t = await this.toolInstance.save(this.pluginsContent);
|
|
609
611
|
if (!this.isEmpty || t === void 0 || t === null || typeof t != "object")
|
|
610
612
|
return t;
|
|
611
|
-
const e =
|
|
613
|
+
const e = y({}, t), o = (n) => {
|
|
612
614
|
const s = e[n];
|
|
613
615
|
if (typeof s != "string")
|
|
614
616
|
return;
|
|
@@ -672,7 +674,7 @@ const U = class U extends Ct {
|
|
|
672
674
|
*/
|
|
673
675
|
updateCurrentInput() {
|
|
674
676
|
var s;
|
|
675
|
-
const t =
|
|
677
|
+
const t = w.anchorNode, e = document.activeElement, o = (i) => {
|
|
676
678
|
if (!i)
|
|
677
679
|
return;
|
|
678
680
|
const r = i instanceof HTMLElement ? i : i.parentElement;
|
|
@@ -887,10 +889,10 @@ const U = class U extends Ct {
|
|
|
887
889
|
var n, s;
|
|
888
890
|
if (t ? this.holder.setAttribute(m.selected, "true") : this.holder.removeAttribute(m.selected), this.contentElement) {
|
|
889
891
|
const i = this.stretched ? U.styles.contentStretched : "";
|
|
890
|
-
this.contentElement.className = t ?
|
|
892
|
+
this.contentElement.className = t ? S(U.styles.content, U.styles.contentSelected) : S(U.styles.content, i);
|
|
891
893
|
}
|
|
892
|
-
const e = t === !0 &&
|
|
893
|
-
!e && !o || ((n = this.blokEventBus) == null || n.emit(
|
|
894
|
+
const e = t === !0 && w.isRangeInsideContainer(this.holder), o = t === !1 && w.isFakeCursorInsideContainer(this.holder);
|
|
895
|
+
!e && !o || ((n = this.blokEventBus) == null || n.emit(wo, { state: t }), e && w.addFakeCursor(), o && w.removeFakeCursor(this.holder), (s = this.blokEventBus) == null || s.emit(xo, { state: t }));
|
|
894
896
|
}
|
|
895
897
|
/**
|
|
896
898
|
* Returns True if it is Selected
|
|
@@ -904,7 +906,7 @@ const U = class U extends Ct {
|
|
|
904
906
|
* @param {boolean} state - 'true' to enable, 'false' to disable stretched state
|
|
905
907
|
*/
|
|
906
908
|
setStretchState(t) {
|
|
907
|
-
t ? this.holder.setAttribute(m.stretched, "true") : this.holder.removeAttribute(m.stretched), this.contentElement && !this.selected && (this.contentElement.className = t ?
|
|
909
|
+
t ? this.holder.setAttribute(m.stretched, "true") : this.holder.removeAttribute(m.stretched), this.contentElement && !this.selected && (this.contentElement.className = t ? S(U.styles.content, U.styles.contentStretched) : U.styles.content);
|
|
908
910
|
}
|
|
909
911
|
/**
|
|
910
912
|
* Backward-compatible setter for stretched state
|
|
@@ -1039,7 +1041,7 @@ const U = class U extends Ct {
|
|
|
1039
1041
|
* especially when mutation observers haven't been set up yet.
|
|
1040
1042
|
*/
|
|
1041
1043
|
refreshToolRootElement() {
|
|
1042
|
-
const t = this.holder.querySelector(
|
|
1044
|
+
const t = this.holder.querySelector(Y(m.elementContent));
|
|
1043
1045
|
if (!t)
|
|
1044
1046
|
return;
|
|
1045
1047
|
const e = t.firstElementChild;
|
|
@@ -1069,7 +1071,7 @@ const U = class U extends Ct {
|
|
|
1069
1071
|
* Mark inputs with 'data-blok-empty' attribute with the empty state
|
|
1070
1072
|
*/
|
|
1071
1073
|
toggleInputsEmptyMark() {
|
|
1072
|
-
this.inputs.forEach(
|
|
1074
|
+
this.inputs.forEach(ko);
|
|
1073
1075
|
}
|
|
1074
1076
|
};
|
|
1075
1077
|
U.styles = {
|
|
@@ -1090,7 +1092,7 @@ class An extends T {
|
|
|
1090
1092
|
needToFocus: s,
|
|
1091
1093
|
replace: i
|
|
1092
1094
|
});
|
|
1093
|
-
return new
|
|
1095
|
+
return new W(c);
|
|
1094
1096
|
}, this.composeBlockData = async (t) => {
|
|
1095
1097
|
const e = this.Blok.Tools.blockTools.get(t);
|
|
1096
1098
|
if (e === void 0)
|
|
@@ -1107,7 +1109,7 @@ class An extends T {
|
|
|
1107
1109
|
if (s === void 0)
|
|
1108
1110
|
throw new Error(`Block with id "${t}" not found`);
|
|
1109
1111
|
const i = await n.update(s, e, o);
|
|
1110
|
-
return new
|
|
1112
|
+
return new W(i);
|
|
1111
1113
|
}, this.convert = async (t, e, o) => {
|
|
1112
1114
|
var h, u;
|
|
1113
1115
|
const { BlockManager: n, Tools: s } = this.Blok, i = n.getBlockById(t);
|
|
@@ -1119,7 +1121,7 @@ class An extends T {
|
|
|
1119
1121
|
const c = ((h = r == null ? void 0 : r.conversionConfig) == null ? void 0 : h.export) !== void 0, d = ((u = l.conversionConfig) == null ? void 0 : u.import) !== void 0;
|
|
1120
1122
|
if (c && d) {
|
|
1121
1123
|
const f = await n.convert(i, e, o);
|
|
1122
|
-
return new
|
|
1124
|
+
return new W(f);
|
|
1123
1125
|
} else {
|
|
1124
1126
|
const f = [
|
|
1125
1127
|
c ? !1 : Ht(i.name),
|
|
@@ -1134,7 +1136,7 @@ class An extends T {
|
|
|
1134
1136
|
tool: s || this.config.defaultBlock,
|
|
1135
1137
|
data: i
|
|
1136
1138
|
}));
|
|
1137
|
-
return this.Blok.BlockManager.insertMany(o, e), o.map((n) => new
|
|
1139
|
+
return this.Blok.BlockManager.insertMany(o, e), o.map((n) => new W(n));
|
|
1138
1140
|
};
|
|
1139
1141
|
}
|
|
1140
1142
|
/**
|
|
@@ -1154,6 +1156,8 @@ class An extends T {
|
|
|
1154
1156
|
getBlockIndex: (t) => this.getBlockIndex(t),
|
|
1155
1157
|
getBlocksCount: () => this.getBlocksCount(),
|
|
1156
1158
|
getBlockByElement: (t) => this.getBlockByElement(t),
|
|
1159
|
+
getChildren: (t) => this.getChildren(t),
|
|
1160
|
+
getChildrenInSlot: (t, e) => this.getChildrenInSlot(t, e),
|
|
1157
1161
|
insert: this.insert,
|
|
1158
1162
|
insertMany: this.insertMany,
|
|
1159
1163
|
update: this.update,
|
|
@@ -1183,7 +1187,7 @@ class An extends T {
|
|
|
1183
1187
|
getBlockIndex(t) {
|
|
1184
1188
|
const e = this.Blok.BlockManager.getBlockById(t);
|
|
1185
1189
|
if (!e) {
|
|
1186
|
-
|
|
1190
|
+
X("There is no block with id `" + t + "`", "warn");
|
|
1187
1191
|
return;
|
|
1188
1192
|
}
|
|
1189
1193
|
return this.Blok.BlockManager.getBlockIndex(e);
|
|
@@ -1195,10 +1199,10 @@ class An extends T {
|
|
|
1195
1199
|
getBlockByIndex(t) {
|
|
1196
1200
|
const e = this.Blok.BlockManager.getBlockByIndex(t);
|
|
1197
1201
|
if (e === void 0) {
|
|
1198
|
-
|
|
1202
|
+
X("There is no block at index `" + t + "`", "warn");
|
|
1199
1203
|
return;
|
|
1200
1204
|
}
|
|
1201
|
-
return new
|
|
1205
|
+
return new W(e);
|
|
1202
1206
|
}
|
|
1203
1207
|
/**
|
|
1204
1208
|
* Returns BlockAPI object by Block id
|
|
@@ -1206,7 +1210,7 @@ class An extends T {
|
|
|
1206
1210
|
*/
|
|
1207
1211
|
getById(t) {
|
|
1208
1212
|
const e = this.Blok.BlockManager.getBlockById(t);
|
|
1209
|
-
return e === void 0 ? (
|
|
1213
|
+
return e === void 0 ? (X("There is no block with id `" + t + "`", "warn"), null) : new W(e);
|
|
1210
1214
|
}
|
|
1211
1215
|
/**
|
|
1212
1216
|
* Get Block API object by any child html element
|
|
@@ -1215,10 +1219,29 @@ class An extends T {
|
|
|
1215
1219
|
getBlockByElement(t) {
|
|
1216
1220
|
const e = this.Blok.BlockManager.getBlock(t);
|
|
1217
1221
|
if (e === void 0) {
|
|
1218
|
-
|
|
1222
|
+
X("There is no block corresponding to element `" + t + "`", "warn");
|
|
1219
1223
|
return;
|
|
1220
1224
|
}
|
|
1221
|
-
return new
|
|
1225
|
+
return new W(e);
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Returns all child blocks of a parent container block
|
|
1229
|
+
* @param parentId - id of the parent block
|
|
1230
|
+
*/
|
|
1231
|
+
getChildren(t) {
|
|
1232
|
+
return this.Blok.BlockManager.blocks.filter(
|
|
1233
|
+
(o) => o.parentId === t
|
|
1234
|
+
).map((o) => new W(o));
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Returns child blocks of a parent container block in a specific slot
|
|
1238
|
+
* @param parentId - id of the parent block
|
|
1239
|
+
* @param slot - slot index (e.g., column index for columns block)
|
|
1240
|
+
*/
|
|
1241
|
+
getChildrenInSlot(t, e) {
|
|
1242
|
+
return this.Blok.BlockManager.blocks.filter(
|
|
1243
|
+
(n) => n.parentId === t && n.slot === e
|
|
1244
|
+
).map((n) => new W(n));
|
|
1222
1245
|
}
|
|
1223
1246
|
/**
|
|
1224
1247
|
* Move block from one index to another
|
|
@@ -1235,13 +1258,13 @@ class An extends T {
|
|
|
1235
1258
|
async delete(t = this.Blok.BlockManager.currentBlockIndex) {
|
|
1236
1259
|
const e = this.Blok.BlockManager.getBlockByIndex(t);
|
|
1237
1260
|
if (e === void 0) {
|
|
1238
|
-
|
|
1261
|
+
X(`There is no block at index \`${t}\``, "warn");
|
|
1239
1262
|
return;
|
|
1240
1263
|
}
|
|
1241
1264
|
try {
|
|
1242
1265
|
await this.Blok.BlockManager.removeBlock(e);
|
|
1243
1266
|
} catch (o) {
|
|
1244
|
-
|
|
1267
|
+
X(o, "warn");
|
|
1245
1268
|
return;
|
|
1246
1269
|
}
|
|
1247
1270
|
this.Blok.BlockManager.blocks.length === 0 && this.Blok.BlockManager.insert(), this.Blok.BlockManager.currentBlock && this.Blok.Caret.setToBlock(this.Blok.BlockManager.currentBlock, this.Blok.Caret.positions.END), this.Blok.Toolbar.close();
|
|
@@ -1471,7 +1494,7 @@ class Hn {
|
|
|
1471
1494
|
* @returns {Promise<NotifierModule>} loaded notifier module
|
|
1472
1495
|
*/
|
|
1473
1496
|
loadNotifierModule() {
|
|
1474
|
-
return this.notifierModule !== null ? Promise.resolve(this.notifierModule) : (this.loadingPromise === null && (this.loadingPromise = import("./index-
|
|
1497
|
+
return this.notifierModule !== null ? Promise.resolve(this.notifierModule) : (this.loadingPromise === null && (this.loadingPromise = import("./index-D9haze7z.mjs").then((t) => {
|
|
1475
1498
|
const e = t;
|
|
1476
1499
|
if (!this.isNotifierModule(e))
|
|
1477
1500
|
throw new Error('notifier module does not expose a "show" method.');
|
|
@@ -1562,10 +1585,10 @@ function Un() {
|
|
|
1562
1585
|
a.exports = o();
|
|
1563
1586
|
})(zn, function() {
|
|
1564
1587
|
function e(h) {
|
|
1565
|
-
var u = h.tags, f = Object.keys(u), p = f.map(function(
|
|
1566
|
-
return typeof u[
|
|
1567
|
-
}).every(function(
|
|
1568
|
-
return
|
|
1588
|
+
var u = h.tags, f = Object.keys(u), p = f.map(function(k) {
|
|
1589
|
+
return typeof u[k];
|
|
1590
|
+
}).every(function(k) {
|
|
1591
|
+
return k === "object" || k === "boolean" || k === "function";
|
|
1569
1592
|
});
|
|
1570
1593
|
if (!p)
|
|
1571
1594
|
throw new Error("The configuration was invalid");
|
|
@@ -1596,10 +1619,10 @@ function Un() {
|
|
|
1596
1619
|
u.removeChild(p), this._sanitize(h, u);
|
|
1597
1620
|
break;
|
|
1598
1621
|
}
|
|
1599
|
-
var
|
|
1600
|
-
|
|
1601
|
-
var B = !!u.parentNode, x = n(u) && n(p) && B,
|
|
1602
|
-
if (
|
|
1622
|
+
var k = i(p), b;
|
|
1623
|
+
k && (b = Array.prototype.some.call(p.childNodes, n));
|
|
1624
|
+
var B = !!u.parentNode, x = n(u) && n(p) && B, C = p.nodeName.toLowerCase(), R = l(this.config, C, p), M = k && b;
|
|
1625
|
+
if (M || c(p, R) || !this.config.keepNestedBlockElements && x) {
|
|
1603
1626
|
if (!(p.nodeName === "SCRIPT" || p.nodeName === "STYLE"))
|
|
1604
1627
|
for (; p.childNodes.length > 0; )
|
|
1605
1628
|
u.insertBefore(p.childNodes[0], p);
|
|
@@ -1607,8 +1630,8 @@ function Un() {
|
|
|
1607
1630
|
break;
|
|
1608
1631
|
}
|
|
1609
1632
|
for (var D = 0; D < p.attributes.length; D += 1) {
|
|
1610
|
-
var
|
|
1611
|
-
d(
|
|
1633
|
+
var G = p.attributes[D];
|
|
1634
|
+
d(G, R, p) && (p.removeAttribute(G.name), D = D - 1);
|
|
1612
1635
|
}
|
|
1613
1636
|
this._sanitize(h, p);
|
|
1614
1637
|
} while (p = f.nextSibling());
|
|
@@ -1636,23 +1659,23 @@ function Un() {
|
|
|
1636
1659
|
})(Ot)), Ot.exports;
|
|
1637
1660
|
}
|
|
1638
1661
|
var Kn = Un();
|
|
1639
|
-
const Wn = /* @__PURE__ */
|
|
1662
|
+
const Wn = /* @__PURE__ */ yn(Kn), $n = /^\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)/i, jn = /\s*(?:href|src)\s*=\s*(?:"\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^"]*"|'\s*(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^']*|(?:javascript\s*:|data\s*:\s*text\s*\/\s*html)[^ \t\r\n>]*)/gi, ye = (a, t, e = {}) => a.map((o) => {
|
|
1640
1663
|
const n = E(t) ? t(o.tool) : t, s = n != null ? n : {};
|
|
1641
|
-
return A(s) && N(s) && N(e) ? o :
|
|
1642
|
-
data:
|
|
1664
|
+
return A(s) && N(s) && N(e) ? o : P(y({}, o), {
|
|
1665
|
+
data: we(o.data, s, e)
|
|
1643
1666
|
});
|
|
1644
1667
|
}), Z = (a, t = {}) => {
|
|
1645
1668
|
const e = {
|
|
1646
1669
|
tags: t
|
|
1647
1670
|
};
|
|
1648
1671
|
return new Wn(e).clean(a);
|
|
1649
|
-
},
|
|
1672
|
+
}, we = (a, t, e) => Array.isArray(a) ? Yn(a, t, e) : A(a) ? Vn(a, t, e) : ht(a) ? Xn(a, t, e) : a, Yn = (a, t, e) => a.map((o) => we(o, t, e)), Vn = (a, t, e) => {
|
|
1650
1673
|
const o = {}, n = a;
|
|
1651
1674
|
for (const s in a) {
|
|
1652
1675
|
if (!Object.prototype.hasOwnProperty.call(a, s))
|
|
1653
1676
|
continue;
|
|
1654
1677
|
const i = n[s], r = A(t) ? t : void 0, l = r == null ? void 0 : r[s], c = l !== void 0 && qn(l) ? l : t;
|
|
1655
|
-
o[s] =
|
|
1678
|
+
o[s] = we(i, c, e);
|
|
1656
1679
|
}
|
|
1657
1680
|
return o;
|
|
1658
1681
|
}, Xn = (a, t, e) => {
|
|
@@ -1666,7 +1689,7 @@ const Wn = /* @__PURE__ */ wn(Kn), $n = /^\s*(?:javascript\s*:|data\s*:\s*text\s
|
|
|
1666
1689
|
return Xt(Xe(n, e));
|
|
1667
1690
|
}
|
|
1668
1691
|
return Xt(a);
|
|
1669
|
-
}, qn = (a) => A(a) ||
|
|
1692
|
+
}, qn = (a) => A(a) || bo(a) || E(a), Gn = (a) => a ? $n.test(a) : !1, Xt = (a) => {
|
|
1670
1693
|
if (!a || a.indexOf("<") === -1)
|
|
1671
1694
|
return a;
|
|
1672
1695
|
if (typeof document != "undefined") {
|
|
@@ -1674,7 +1697,7 @@ const Wn = /* @__PURE__ */ wn(Kn), $n = /^\s*(?:javascript\s*:|data\s*:\s*text\s
|
|
|
1674
1697
|
return t.innerHTML = a, t.content.querySelectorAll("[href],[src]").forEach((o) => {
|
|
1675
1698
|
["href", "src"].forEach((n) => {
|
|
1676
1699
|
const s = o.getAttribute(n);
|
|
1677
|
-
|
|
1700
|
+
Gn(s) && o.removeAttribute(n);
|
|
1678
1701
|
});
|
|
1679
1702
|
}), t.innerHTML;
|
|
1680
1703
|
}
|
|
@@ -1689,9 +1712,9 @@ const Wn = /* @__PURE__ */ wn(Kn), $n = /^\s*(?:javascript\s*:|data\s*:\s*text\s
|
|
|
1689
1712
|
}, Ve = (a) => function(e) {
|
|
1690
1713
|
const o = a.call(this, e);
|
|
1691
1714
|
return o == null ? {} : o;
|
|
1692
|
-
},
|
|
1715
|
+
}, Zn = /* @__PURE__ */ new Set(["class", "id", "title", "role", "dir", "lang"]), Jn = (a) => {
|
|
1693
1716
|
const t = a.toLowerCase();
|
|
1694
|
-
return t.startsWith("data-") || t.startsWith("aria-") ||
|
|
1717
|
+
return t.startsWith("data-") || t.startsWith("aria-") || Zn.has(t);
|
|
1695
1718
|
}, Qn = (a) => {
|
|
1696
1719
|
const t = {};
|
|
1697
1720
|
return Array.from(a.attributes).forEach((e) => {
|
|
@@ -1765,7 +1788,7 @@ const Wn = /* @__PURE__ */ wn(Kn), $n = /^\s*(?:javascript\s*:|data\s*:\s*text\s
|
|
|
1765
1788
|
return o.innerHTML = a, e.forEach(([n, s]) => {
|
|
1766
1789
|
o.content.querySelectorAll(n).forEach((r) => {
|
|
1767
1790
|
const l = s(r);
|
|
1768
|
-
if (!(
|
|
1791
|
+
if (!(bo(l) || E(l) || l == null))
|
|
1769
1792
|
for (const [c, d] of Object.entries(l)) {
|
|
1770
1793
|
if (d === !1) {
|
|
1771
1794
|
r.removeAttribute(c);
|
|
@@ -1814,7 +1837,7 @@ class ns extends T {
|
|
|
1814
1837
|
var s, i;
|
|
1815
1838
|
const t = "Blok's content can not be saved in read-only mode";
|
|
1816
1839
|
if (this.Blok.ReadOnly.isEnabled)
|
|
1817
|
-
throw
|
|
1840
|
+
throw X(t, "warn"), new Error(t);
|
|
1818
1841
|
const e = await this.Blok.Saver.save();
|
|
1819
1842
|
if (e !== void 0)
|
|
1820
1843
|
return e;
|
|
@@ -1827,7 +1850,7 @@ class ns extends T {
|
|
|
1827
1850
|
}
|
|
1828
1851
|
class ss extends T {
|
|
1829
1852
|
constructor() {
|
|
1830
|
-
super(...arguments), this.selectionUtils = new
|
|
1853
|
+
super(...arguments), this.selectionUtils = new w();
|
|
1831
1854
|
}
|
|
1832
1855
|
/**
|
|
1833
1856
|
* Available methods
|
|
@@ -1951,7 +1974,7 @@ class as extends T {
|
|
|
1951
1974
|
*/
|
|
1952
1975
|
toggleBlockSettings(t) {
|
|
1953
1976
|
if (this.Blok.BlockManager.currentBlockIndex === -1) {
|
|
1954
|
-
|
|
1977
|
+
X("Could't toggle the Toolbar because there is no block selected ", "warn");
|
|
1955
1978
|
return;
|
|
1956
1979
|
}
|
|
1957
1980
|
(t != null ? t : !this.Blok.BlockSettings.opened) ? (this.Blok.Toolbar.moveAndOpen(), this.Blok.BlockSettings.open()) : this.Blok.BlockSettings.close();
|
|
@@ -1962,13 +1985,13 @@ class as extends T {
|
|
|
1962
1985
|
*/
|
|
1963
1986
|
toggleToolbox(t) {
|
|
1964
1987
|
if (this.Blok.BlockManager.currentBlockIndex === -1) {
|
|
1965
|
-
|
|
1988
|
+
X("Could't toggle the Toolbox because there is no block selected ", "warn");
|
|
1966
1989
|
return;
|
|
1967
1990
|
}
|
|
1968
1991
|
(t != null ? t : !this.Blok.Toolbar.toolbox.opened) ? (this.Blok.Toolbar.moveAndOpen(), this.Blok.Toolbar.toolbox.open()) : this.Blok.Toolbar.toolbox.close();
|
|
1969
1992
|
}
|
|
1970
1993
|
}
|
|
1971
|
-
const qt = 10, ls = "tooltip", cs = "aria-hidden", ds = "false", hs = "true", us = "visibility", ps = "visible", fs = "hidden",
|
|
1994
|
+
const qt = 10, ls = "tooltip", cs = "aria-hidden", ds = "false", hs = "true", us = "visibility", ps = "visible", fs = "hidden", et = class et {
|
|
1972
1995
|
/**
|
|
1973
1996
|
* Module constructor
|
|
1974
1997
|
*/
|
|
@@ -2014,7 +2037,7 @@ const qt = 10, ls = "tooltip", cs = "aria-hidden", ds = "false", hs = "true", us
|
|
|
2014
2037
|
* Get singleton instance
|
|
2015
2038
|
*/
|
|
2016
2039
|
static getInstance() {
|
|
2017
|
-
return
|
|
2040
|
+
return et.instance || (et.instance = new et()), et.instance;
|
|
2018
2041
|
}
|
|
2019
2042
|
/**
|
|
2020
2043
|
* Show Tooltip near passed element with specified HTML content
|
|
@@ -2106,7 +2129,7 @@ const qt = 10, ls = "tooltip", cs = "aria-hidden", ds = "false", hs = "true", us
|
|
|
2106
2129
|
*/
|
|
2107
2130
|
destroy() {
|
|
2108
2131
|
var t;
|
|
2109
|
-
(t = this.ariaObserver) == null || t.disconnect(), this.ariaObserver = null, this.nodes.wrapper && this.nodes.wrapper.remove(), window.removeEventListener("scroll", this.handleWindowScroll),
|
|
2132
|
+
(t = this.ariaObserver) == null || t.disconnect(), this.ariaObserver = null, this.nodes.wrapper && this.nodes.wrapper.remove(), window.removeEventListener("scroll", this.handleWindowScroll), et.instance = null;
|
|
2110
2133
|
}
|
|
2111
2134
|
/**
|
|
2112
2135
|
* Module Preparation method
|
|
@@ -2230,8 +2253,8 @@ const qt = 10, ls = "tooltip", cs = "aria-hidden", ds = "false", hs = "true", us
|
|
|
2230
2253
|
Array.isArray(e) ? e.forEach((o) => t.appendChild(o)) : t.appendChild(e);
|
|
2231
2254
|
}
|
|
2232
2255
|
};
|
|
2233
|
-
|
|
2234
|
-
let ae =
|
|
2256
|
+
et.instance = null;
|
|
2257
|
+
let ae = et;
|
|
2235
2258
|
const $t = () => ae.getInstance(), gs = (a, t, e) => {
|
|
2236
2259
|
$t().show(a, t, e != null ? e : {});
|
|
2237
2260
|
}, Tt = () => {
|
|
@@ -2241,7 +2264,7 @@ const $t = () => ae.getInstance(), gs = (a, t, e) => {
|
|
|
2241
2264
|
}, ms = () => {
|
|
2242
2265
|
$t().destroy();
|
|
2243
2266
|
};
|
|
2244
|
-
class
|
|
2267
|
+
class ks extends T {
|
|
2245
2268
|
/**
|
|
2246
2269
|
* @class
|
|
2247
2270
|
* @param moduleConfiguration - Module Configuration
|
|
@@ -2289,7 +2312,7 @@ class bs extends T {
|
|
|
2289
2312
|
Ut(t, e, o);
|
|
2290
2313
|
}
|
|
2291
2314
|
}
|
|
2292
|
-
class
|
|
2315
|
+
class bs extends T {
|
|
2293
2316
|
/**
|
|
2294
2317
|
* Available methods / getters
|
|
2295
2318
|
*/
|
|
@@ -2450,7 +2473,7 @@ const it = class it {
|
|
|
2450
2473
|
*/
|
|
2451
2474
|
(this.items.length + o - 1) % this.items.length
|
|
2452
2475
|
);
|
|
2453
|
-
return g.canSetCaret(this.items[n]) && Ft(() =>
|
|
2476
|
+
return g.canSetCaret(this.items[n]) && Ft(() => w.setCursor(this.items[n]), 50)(), this.items[n].classList.add(this.focusedCssClass), this.items[n].setAttribute("data-blok-focused", "true"), n;
|
|
2454
2477
|
}
|
|
2455
2478
|
};
|
|
2456
2479
|
it.directions = {
|
|
@@ -2458,7 +2481,7 @@ it.directions = {
|
|
|
2458
2481
|
LEFT: "left"
|
|
2459
2482
|
};
|
|
2460
2483
|
let st = it;
|
|
2461
|
-
class
|
|
2484
|
+
class Q {
|
|
2462
2485
|
/**
|
|
2463
2486
|
* @param options - different constructing settings
|
|
2464
2487
|
*/
|
|
@@ -2471,7 +2494,7 @@ class J {
|
|
|
2471
2494
|
return;
|
|
2472
2495
|
const i = this.getKeyCode(n), r = i === v.LEFT || i === v.RIGHT || i === v.UP || i === v.DOWN;
|
|
2473
2496
|
if (!(n.shiftKey && r || !this.isEventReadyForHandling(n)) && !(i === v.ENTER && !((c = this.iterator) != null && c.currentItem)))
|
|
2474
|
-
switch (n.stopPropagation(), n.stopImmediatePropagation(), i !== null &&
|
|
2497
|
+
switch (n.stopPropagation(), n.stopImmediatePropagation(), i !== null && Q.usedKeys.includes(i) && n.preventDefault(), i) {
|
|
2475
2498
|
case v.TAB:
|
|
2476
2499
|
this.handleTabPress(n);
|
|
2477
2500
|
break;
|
|
@@ -2491,7 +2514,7 @@ class J {
|
|
|
2491
2514
|
this.handleEnterPress(n);
|
|
2492
2515
|
break;
|
|
2493
2516
|
}
|
|
2494
|
-
}, this.iterator = new st(t.items || [], (e = t.focusedItemClass) != null ? e : ""), this.activateCallback = t.activateCallback, this.allowedKeys = t.allowedKeys ||
|
|
2517
|
+
}, this.iterator = new st(t.items || [], (e = t.focusedItemClass) != null ? e : ""), this.activateCallback = t.activateCallback, this.allowedKeys = t.allowedKeys || Q.usedKeys, this.handleContentEditableTargets = (o = t.handleContentEditableTargets) != null ? o : !1, this.onArrowLeftCallback = t.onArrowLeft;
|
|
2495
2518
|
}
|
|
2496
2519
|
/**
|
|
2497
2520
|
* True if flipper is currently activated
|
|
@@ -2729,7 +2752,7 @@ class Bs {
|
|
|
2729
2752
|
return this.nodes.root;
|
|
2730
2753
|
}
|
|
2731
2754
|
}
|
|
2732
|
-
class
|
|
2755
|
+
class Ce {
|
|
2733
2756
|
/**
|
|
2734
2757
|
* Constructs the instance
|
|
2735
2758
|
* @param params - instance parameters
|
|
@@ -2873,18 +2896,18 @@ const lt = {
|
|
|
2873
2896
|
* Used alongside data-blok-focused attribute.
|
|
2874
2897
|
*/
|
|
2875
2898
|
focused: "is-focused"
|
|
2876
|
-
},
|
|
2899
|
+
}, ys = {
|
|
2877
2900
|
/**
|
|
2878
2901
|
* Item in inline context - more compact styling
|
|
2879
2902
|
*/
|
|
2880
2903
|
item: "rounded p-1"
|
|
2881
|
-
},
|
|
2904
|
+
}, ws = {
|
|
2882
2905
|
/**
|
|
2883
2906
|
* Nested item - back to desktop popover styling
|
|
2884
2907
|
*/
|
|
2885
2908
|
item: "rounded-md p-[3px] mobile:p-1"
|
|
2886
2909
|
};
|
|
2887
|
-
class
|
|
2910
|
+
class J extends Ce {
|
|
2888
2911
|
/**
|
|
2889
2912
|
* Constructs popover item instance
|
|
2890
2913
|
* @param params - popover item construction params
|
|
@@ -3001,7 +3024,7 @@ class G extends Se {
|
|
|
3001
3024
|
const o = (i = e == null ? void 0 : e.wrapperTag) != null ? i : "div", n = document.createElement(o);
|
|
3002
3025
|
return o === "button" && n.setAttribute("type", "button"), n.className = this.getContainerClass(), n.setAttribute(m.popoverItem, ""), n.setAttribute("data-blok-testid", "popover-item"), t.name && n.setAttribute("data-blok-item-name", t.name), t.dataset && Object.entries(t.dataset).forEach(([d, h]) => {
|
|
3003
3026
|
n.setAttribute(`data-${d}`, h);
|
|
3004
|
-
}), t.isDisabled && n.setAttribute(m.disabled, "true"), this.isActive && n.setAttribute(m.popoverItemActive, "true"), this.hasChildren && n.setAttribute(m.hasChildren, "true"), this.createContentElements(n, t, e), t.hint !== void 0 && ((r = e == null ? void 0 : e.hint) == null ? void 0 : r.enabled) !== !1 && t.hint !== void 0 && this.addHint(n,
|
|
3027
|
+
}), t.isDisabled && n.setAttribute(m.disabled, "true"), this.isActive && n.setAttribute(m.popoverItemActive, "true"), this.hasChildren && n.setAttribute(m.hasChildren, "true"), this.createContentElements(n, t, e), t.hint !== void 0 && ((r = e == null ? void 0 : e.hint) == null ? void 0 : r.enabled) !== !1 && t.hint !== void 0 && this.addHint(n, P(y({}, t.hint), {
|
|
3005
3028
|
position: ((l = e == null ? void 0 : e.hint) == null ? void 0 : l.position) || "right",
|
|
3006
3029
|
alignment: ((c = e == null ? void 0 : e.hint) == null ? void 0 : c.alignment) || "center"
|
|
3007
3030
|
})), n;
|
|
@@ -3038,10 +3061,10 @@ class G extends Se {
|
|
|
3038
3061
|
getContainerClass() {
|
|
3039
3062
|
var o, n, s, i;
|
|
3040
3063
|
const t = (n = (o = this.renderParams) == null ? void 0 : o.isInline) != null ? n : !1, e = (i = (s = this.renderParams) == null ? void 0 : s.isNestedInline) != null ? i : !1;
|
|
3041
|
-
return
|
|
3064
|
+
return S(
|
|
3042
3065
|
lt.item,
|
|
3043
|
-
t &&
|
|
3044
|
-
e &&
|
|
3066
|
+
t && ys.item,
|
|
3067
|
+
e && ws.item,
|
|
3045
3068
|
this.params.isDisabled && lt.itemDisabled
|
|
3046
3069
|
);
|
|
3047
3070
|
}
|
|
@@ -3049,7 +3072,7 @@ class G extends Se {
|
|
|
3049
3072
|
* Gets the icon class based on context
|
|
3050
3073
|
*/
|
|
3051
3074
|
getIconClass(t, e, o, n) {
|
|
3052
|
-
return
|
|
3075
|
+
return S(
|
|
3053
3076
|
lt.icon,
|
|
3054
3077
|
e && "w-auto h-auto [&_svg]:w-icon [&_svg]:h-icon mobile:[&_svg]:w-icon-mobile mobile:[&_svg]:h-icon-mobile",
|
|
3055
3078
|
o && "w-toolbox-btn h-toolbox-btn",
|
|
@@ -3063,7 +3086,7 @@ class G extends Se {
|
|
|
3063
3086
|
* Gets the chevron class based on context
|
|
3064
3087
|
*/
|
|
3065
3088
|
getChevronClass(t) {
|
|
3066
|
-
return
|
|
3089
|
+
return S(
|
|
3067
3090
|
lt.icon,
|
|
3068
3091
|
t && "rotate-90"
|
|
3069
3092
|
);
|
|
@@ -3106,7 +3129,7 @@ class G extends Se {
|
|
|
3106
3129
|
enableConfirmationMode(t) {
|
|
3107
3130
|
if (this.nodes.root === null)
|
|
3108
3131
|
return;
|
|
3109
|
-
const e =
|
|
3132
|
+
const e = P(y(y({}, this.params), t), {
|
|
3110
3133
|
confirmation: "confirmation" in t ? t.confirmation : void 0
|
|
3111
3134
|
});
|
|
3112
3135
|
this.setConfirmation(e), this.confirmationState = t, this.enableSpecialHoverAndFocusBehavior();
|
|
@@ -3247,7 +3270,7 @@ const ot = {
|
|
|
3247
3270
|
nestedContainer: "py-1 px-[3px]",
|
|
3248
3271
|
nestedLine: "w-full h-px"
|
|
3249
3272
|
};
|
|
3250
|
-
class To extends
|
|
3273
|
+
class To extends Ce {
|
|
3251
3274
|
/**
|
|
3252
3275
|
* Constructs the instance
|
|
3253
3276
|
* @param renderParams - optional render params for styling context
|
|
@@ -3277,13 +3300,13 @@ class To extends Se {
|
|
|
3277
3300
|
*/
|
|
3278
3301
|
getContainerClass(t) {
|
|
3279
3302
|
const e = ot.container;
|
|
3280
|
-
return this.isNestedInline ?
|
|
3303
|
+
return this.isNestedInline ? S(e, Mt.nestedContainer, t && ot.containerHidden) : this.isInline ? S(e, Mt.container, t && ot.containerHidden) : S(e, t && ot.containerHidden);
|
|
3281
3304
|
}
|
|
3282
3305
|
/**
|
|
3283
3306
|
* Build line class based on context
|
|
3284
3307
|
*/
|
|
3285
3308
|
getLineClass() {
|
|
3286
|
-
return this.isNestedInline ?
|
|
3309
|
+
return this.isNestedInline ? S(ot.line, Mt.nestedLine) : this.isInline ? S(ot.line, Mt.line) : ot.line;
|
|
3287
3310
|
}
|
|
3288
3311
|
/**
|
|
3289
3312
|
* Creates the root container element
|
|
@@ -3295,14 +3318,14 @@ class To extends Se {
|
|
|
3295
3318
|
return e.className = this.getLineClass(), e.setAttribute(m.popoverItemSeparatorLine, ""), t.appendChild(e), this.nodes.line = e, t;
|
|
3296
3319
|
}
|
|
3297
3320
|
}
|
|
3298
|
-
var
|
|
3299
|
-
const
|
|
3321
|
+
var q = /* @__PURE__ */ ((a) => (a.Closed = "closed", a.ClosedOnActivate = "closed-on-activate", a))(q || {});
|
|
3322
|
+
const Gt = {
|
|
3300
3323
|
root: "",
|
|
3301
3324
|
rootHidden: "hidden"
|
|
3302
3325
|
}, qe = {
|
|
3303
3326
|
root: "flex items-center"
|
|
3304
3327
|
};
|
|
3305
|
-
class
|
|
3328
|
+
class Ct extends Ce {
|
|
3306
3329
|
/**
|
|
3307
3330
|
* Constructs the instance
|
|
3308
3331
|
* @param params – instance parameters
|
|
@@ -3341,10 +3364,10 @@ class St extends Se {
|
|
|
3341
3364
|
* Updates the root element's class list based on current state
|
|
3342
3365
|
*/
|
|
3343
3366
|
updateRootClasses() {
|
|
3344
|
-
this.nodes.root && (this.nodes.root.className =
|
|
3345
|
-
|
|
3367
|
+
this.nodes.root && (this.nodes.root.className = S(
|
|
3368
|
+
Gt.root,
|
|
3346
3369
|
this.isInline && qe.root,
|
|
3347
|
-
this.isHidden &&
|
|
3370
|
+
this.isHidden && Gt.rootHidden
|
|
3348
3371
|
));
|
|
3349
3372
|
}
|
|
3350
3373
|
/**
|
|
@@ -3355,10 +3378,10 @@ class St extends Se {
|
|
|
3355
3378
|
createRootElement(t, e) {
|
|
3356
3379
|
var n, s, i;
|
|
3357
3380
|
const o = document.createElement("div");
|
|
3358
|
-
return o.className =
|
|
3359
|
-
|
|
3381
|
+
return o.className = S(
|
|
3382
|
+
Gt.root,
|
|
3360
3383
|
this.isInline && qe.root
|
|
3361
|
-
), o.setAttribute(m.popoverItemHtml, ""), o.setAttribute("data-blok-testid", "popover-item-html"), t.name && o.setAttribute("data-blok-item-name", t.name), o.appendChild(t.element), t.hint !== void 0 && ((n = e == null ? void 0 : e.hint) == null ? void 0 : n.enabled) !== !1 && this.addHint(o,
|
|
3384
|
+
), o.setAttribute(m.popoverItemHtml, ""), o.setAttribute("data-blok-testid", "popover-item-html"), t.name && o.setAttribute("data-blok-item-name", t.name), o.appendChild(t.element), t.hint !== void 0 && ((n = e == null ? void 0 : e.hint) == null ? void 0 : n.enabled) !== !1 && this.addHint(o, P(y({}, t.hint), {
|
|
3362
3385
|
position: ((s = e == null ? void 0 : e.hint) == null ? void 0 : s.position) || "right",
|
|
3363
3386
|
alignment: ((i = e == null ? void 0 : e.hint) == null ? void 0 : i.alignment) || "center"
|
|
3364
3387
|
})), o;
|
|
@@ -3381,8 +3404,8 @@ const L = {
|
|
|
3381
3404
|
// Container for inline popover
|
|
3382
3405
|
popoverContainer: "flex-row top-0 min-w-max w-max p-1 mobile:absolute"
|
|
3383
3406
|
}, xs = (a) => `level-${a}`;
|
|
3384
|
-
var
|
|
3385
|
-
class
|
|
3407
|
+
var $ = /* @__PURE__ */ ((a) => (a.NestingLevel = "--nesting-level", a.PopoverHeight = "--popover-height", a.InlinePopoverWidth = "--inline-popover-width", a.PopoverTop = "--popover-top", a.PopoverLeft = "--popover-left", a.TriggerItemLeft = "--trigger-item-left", a.TriggerItemTop = "--trigger-item-top", a))($ || {});
|
|
3408
|
+
class Co extends St {
|
|
3386
3409
|
/**
|
|
3387
3410
|
* Constructs the instance
|
|
3388
3411
|
* @param params - popover construction params
|
|
@@ -3393,13 +3416,13 @@ class So extends Ct {
|
|
|
3393
3416
|
super(), this.params = t, this.itemsRenderParams = e, this.listeners = new It(), this.messages = {
|
|
3394
3417
|
nothingFound: "Nothing found",
|
|
3395
3418
|
search: "Search"
|
|
3396
|
-
}, this.items = this.buildItems(t.items), t.messages && (this.messages =
|
|
3419
|
+
}, this.items = this.buildItems(t.items), t.messages && (this.messages = y(y({}, this.messages), t.messages)), this.nodes = this.createPopoverDOM(), this.appendItemElements(), this.nodes.popoverContainer && this.listeners.on(this.nodes.popoverContainer, "click", (o) => this.handleClick(o));
|
|
3397
3420
|
}
|
|
3398
3421
|
/**
|
|
3399
3422
|
* List of default popover items that are searchable and may have confirmation state
|
|
3400
3423
|
*/
|
|
3401
3424
|
get itemsDefault() {
|
|
3402
|
-
return this.items.filter((t) => t instanceof
|
|
3425
|
+
return this.items.filter((t) => t instanceof J);
|
|
3403
3426
|
}
|
|
3404
3427
|
/**
|
|
3405
3428
|
* Returns HTML element corresponding to the popover
|
|
@@ -3424,7 +3447,7 @@ class So extends Ct {
|
|
|
3424
3447
|
* Closes popover
|
|
3425
3448
|
*/
|
|
3426
3449
|
hide() {
|
|
3427
|
-
this.nodes.popover.removeAttribute(m.popoverOpened), this.nodes.popover.removeAttribute(m.popoverOpenTop), this.nodes.popover.removeAttribute(m.popoverOpenLeft), this.nodes.popoverContainer.classList.remove(...L.popoverContainerOpened.split(" ")), this.itemsDefault.forEach((t) => t.reset()), this.search !== void 0 && this.search.clear(), this.emit(
|
|
3450
|
+
this.nodes.popover.removeAttribute(m.popoverOpened), this.nodes.popover.removeAttribute(m.popoverOpenTop), this.nodes.popover.removeAttribute(m.popoverOpenLeft), this.nodes.popoverContainer.classList.remove(...L.popoverContainerOpened.split(" ")), this.itemsDefault.forEach((t) => t.reset()), this.search !== void 0 && this.search.clear(), this.emit(q.Closed);
|
|
3428
3451
|
}
|
|
3429
3452
|
/**
|
|
3430
3453
|
* Clears memory
|
|
@@ -3458,9 +3481,9 @@ class So extends Ct {
|
|
|
3458
3481
|
case O.Separator:
|
|
3459
3482
|
return new To(this.itemsRenderParams[O.Separator]);
|
|
3460
3483
|
case O.Html:
|
|
3461
|
-
return new
|
|
3484
|
+
return new Ct(e, this.itemsRenderParams[O.Html]);
|
|
3462
3485
|
default:
|
|
3463
|
-
return new
|
|
3486
|
+
return new J(e, this.itemsRenderParams[O.Default]);
|
|
3464
3487
|
}
|
|
3465
3488
|
});
|
|
3466
3489
|
}
|
|
@@ -3469,7 +3492,7 @@ class So extends Ct {
|
|
|
3469
3492
|
* @param event - event to retrieve popover item from
|
|
3470
3493
|
*/
|
|
3471
3494
|
getTargetItem(t) {
|
|
3472
|
-
return this.items.filter((e) => e instanceof
|
|
3495
|
+
return this.items.filter((e) => e instanceof J || e instanceof Ct).find((e) => {
|
|
3473
3496
|
const o = e.getElement();
|
|
3474
3497
|
return o === null ? !1 : t.composedPath().includes(o);
|
|
3475
3498
|
});
|
|
@@ -3479,12 +3502,12 @@ class So extends Ct {
|
|
|
3479
3502
|
* @param item - item to handle click of
|
|
3480
3503
|
*/
|
|
3481
3504
|
handleItemClick(t) {
|
|
3482
|
-
if (!(t instanceof
|
|
3505
|
+
if (!(t instanceof J && t.isDisabled)) {
|
|
3483
3506
|
if (t.hasChildren) {
|
|
3484
3507
|
this.showNestedItems(t), this.callHandleClickIfPresent(t);
|
|
3485
3508
|
return;
|
|
3486
3509
|
}
|
|
3487
|
-
this.itemsDefault.filter((e) => e !== t).forEach((e) => e.reset()), this.callHandleClickIfPresent(t), this.toggleItemActivenessIfNeeded(t), this.refreshItemActiveState(t), t.closeOnActivate === !0 && (this.hide(), this.emit(
|
|
3510
|
+
this.itemsDefault.filter((e) => e !== t).forEach((e) => e.reset()), this.callHandleClickIfPresent(t), this.toggleItemActivenessIfNeeded(t), this.refreshItemActiveState(t), t.closeOnActivate === !0 && (this.hide(), this.emit(q.ClosedOnActivate));
|
|
3488
3511
|
}
|
|
3489
3512
|
}
|
|
3490
3513
|
/**
|
|
@@ -3503,7 +3526,7 @@ class So extends Ct {
|
|
|
3503
3526
|
* @param clickedItem - popover item that was clicked
|
|
3504
3527
|
*/
|
|
3505
3528
|
toggleItemActivenessIfNeeded(t) {
|
|
3506
|
-
if (!(t instanceof
|
|
3529
|
+
if (!(t instanceof J) || (t.toggle === !0 && t.toggleActive(), typeof t.toggle != "string"))
|
|
3507
3530
|
return;
|
|
3508
3531
|
const e = this.itemsDefault.filter((o) => o.toggle === t.toggle);
|
|
3509
3532
|
if (e.length === 1) {
|
|
@@ -3520,7 +3543,7 @@ class So extends Ct {
|
|
|
3520
3543
|
* @param item - popover item to refresh
|
|
3521
3544
|
*/
|
|
3522
3545
|
refreshItemActiveState(t) {
|
|
3523
|
-
t instanceof
|
|
3546
|
+
t instanceof J && t.toggle === void 0 && t.toggleActive(t.isActive);
|
|
3524
3547
|
}
|
|
3525
3548
|
/**
|
|
3526
3549
|
* Executes handleClick if it is present on item.
|
|
@@ -3568,7 +3591,7 @@ class So extends Ct {
|
|
|
3568
3591
|
const e = document.createElement("div");
|
|
3569
3592
|
e.className = L.popoverContainer, e.setAttribute(m.popoverContainer, ""), e.setAttribute("data-blok-testid", "popover-container");
|
|
3570
3593
|
const o = document.createElement("div");
|
|
3571
|
-
o.className =
|
|
3594
|
+
o.className = S(
|
|
3572
3595
|
"cursor-default text-sm leading-5 font-medium whitespace-nowrap overflow-hidden text-ellipsis text-gray-text p-[3px]",
|
|
3573
3596
|
"hidden"
|
|
3574
3597
|
), o.setAttribute("data-blok-testid", "popover-nothing-found"), o.textContent = (i = this.messages.nothingFound) != null ? i : "Nothing found";
|
|
@@ -3591,18 +3614,18 @@ class So extends Ct {
|
|
|
3591
3614
|
});
|
|
3592
3615
|
}
|
|
3593
3616
|
}
|
|
3594
|
-
const
|
|
3617
|
+
const So = (a, t) => {
|
|
3595
3618
|
var i, r, l, c, d;
|
|
3596
3619
|
const e = t.toLowerCase(), o = (r = (i = a.title) == null ? void 0 : i.toLowerCase()) != null ? r : "", n = (c = (l = a.englishTitle) == null ? void 0 : l.toLowerCase()) != null ? c : "", s = (d = a.searchTerms) != null ? d : [];
|
|
3597
3620
|
return o.includes(e) || n.includes(e) || s.some((h) => h.toLowerCase().includes(e));
|
|
3598
3621
|
};
|
|
3599
|
-
var
|
|
3600
|
-
const
|
|
3622
|
+
var Se = /* @__PURE__ */ ((a) => (a.Search = "search", a))(Se || {});
|
|
3623
|
+
const Zt = {
|
|
3601
3624
|
wrapper: "bg-[#F8F8F8] border border-[rgba(226,226,229,0.20)] rounded p-0.5 grid grid-cols-[auto_auto_1fr] grid-rows-[auto]",
|
|
3602
3625
|
icon: "w-toolbox-btn h-toolbox-btn flex items-center justify-center mr-2 [&_svg]:w-icon [&_svg]:h-icon [&_svg]:text-gray-text",
|
|
3603
3626
|
input: "text-sm outline-none font-medium font-inherit border-0 bg-transparent m-0 p-0 leading-[22px] min-w-[calc(100%-theme('spacing.6')-10px)] placeholder:text-gray-text placeholder:font-medium"
|
|
3604
3627
|
};
|
|
3605
|
-
class Ts extends
|
|
3628
|
+
class Ts extends St {
|
|
3606
3629
|
/**
|
|
3607
3630
|
* @param options - available config
|
|
3608
3631
|
* @param options.items - searchable items list
|
|
@@ -3611,11 +3634,11 @@ class Ts extends Ct {
|
|
|
3611
3634
|
constructor({ items: t, placeholder: e }) {
|
|
3612
3635
|
super(), this.searchQuery = "", this.handleValueChange = () => {
|
|
3613
3636
|
this.applySearch(this.input.value);
|
|
3614
|
-
}, this.listeners = new It(), this.items = t, this.wrapper = g.make("div",
|
|
3615
|
-
const o = g.make("div",
|
|
3637
|
+
}, this.listeners = new It(), this.items = t, this.wrapper = g.make("div", Zt.wrapper), this.wrapper.setAttribute("data-blok-testid", "popover-search-field");
|
|
3638
|
+
const o = g.make("div", Zt.icon, {
|
|
3616
3639
|
innerHTML: qo
|
|
3617
3640
|
});
|
|
3618
|
-
this.input = g.make("input",
|
|
3641
|
+
this.input = g.make("input", Zt.input, {
|
|
3619
3642
|
type: "search",
|
|
3620
3643
|
placeholder: e,
|
|
3621
3644
|
/**
|
|
@@ -3651,7 +3674,7 @@ class Ts extends Ct {
|
|
|
3651
3674
|
* @param query - search query to apply
|
|
3652
3675
|
*/
|
|
3653
3676
|
applySearch(t) {
|
|
3654
|
-
this.searchQuery !== t && (this.searchQuery = t, this.emit(
|
|
3677
|
+
this.searchQuery !== t && (this.searchQuery = t, this.emit(Se.Search, {
|
|
3655
3678
|
query: t,
|
|
3656
3679
|
items: this.foundItems
|
|
3657
3680
|
}));
|
|
@@ -3695,10 +3718,10 @@ class Ts extends Ct {
|
|
|
3695
3718
|
* @param item - item to be checked
|
|
3696
3719
|
*/
|
|
3697
3720
|
checkItem(t) {
|
|
3698
|
-
return
|
|
3721
|
+
return So(t, this.searchQuery);
|
|
3699
3722
|
}
|
|
3700
3723
|
}
|
|
3701
|
-
class ft extends
|
|
3724
|
+
class ft extends Co {
|
|
3702
3725
|
/**
|
|
3703
3726
|
* Construct the instance
|
|
3704
3727
|
* @param params - popover params
|
|
@@ -3717,12 +3740,12 @@ class ft extends So {
|
|
|
3717
3740
|
var c;
|
|
3718
3741
|
const s = n.query === "", i = n.items.length === 0, r = n.items;
|
|
3719
3742
|
this.items.forEach((d) => {
|
|
3720
|
-
const h = d instanceof
|
|
3743
|
+
const h = d instanceof J, u = d instanceof To || d instanceof Ct, f = h ? !r.includes(d) : u && (i || !s);
|
|
3721
3744
|
d.toggleHidden(f);
|
|
3722
3745
|
}), this.toggleNothingFoundMessage(i);
|
|
3723
3746
|
const l = s ? this.flippableElements : n.items.map((d) => d.getElement());
|
|
3724
3747
|
(c = this.flipper) != null && c.isActivated && (this.flipper.deactivate(), this.flipper.activate(l), l.length > 0 && this.flipper.focusItem(0, { skipNextTab: !0 }));
|
|
3725
|
-
}, t.trigger && (this.trigger = t.trigger), t.nestingLevel !== void 0 && (this.nestingLevel = t.nestingLevel), this.nestingLevel > 0 && this.nodes.popover.setAttribute(m.nested, "true"), t.scopeElement !== void 0 && (this.scopeElement = t.scopeElement), this.nodes.popoverContainer !== null && this.listeners.on(this.nodes.popoverContainer, "mouseover", (n) => this.handleHover(n)), t.searchable && this.addSearch(), t.flippable !== !1 && (t.flipper !== void 0 ? (t.flipper.deactivate(), t.flipper.removeOnFlip(this.onFlip), this.flipper = t.flipper) : this.flipper = new
|
|
3748
|
+
}, t.trigger && (this.trigger = t.trigger), t.nestingLevel !== void 0 && (this.nestingLevel = t.nestingLevel), this.nestingLevel > 0 && this.nodes.popover.setAttribute(m.nested, "true"), t.scopeElement !== void 0 && (this.scopeElement = t.scopeElement), this.nodes.popoverContainer !== null && this.listeners.on(this.nodes.popoverContainer, "mouseover", (n) => this.handleHover(n)), t.searchable && this.addSearch(), t.flippable !== !1 && (t.flipper !== void 0 ? (t.flipper.deactivate(), t.flipper.removeOnFlip(this.onFlip), this.flipper = t.flipper) : this.flipper = new Q({
|
|
3726
3749
|
items: this.flippableElements,
|
|
3727
3750
|
focusedItemClass: lt.focused,
|
|
3728
3751
|
allowedKeys: [
|
|
@@ -3763,9 +3786,9 @@ class ft extends So {
|
|
|
3763
3786
|
const t = this.getMountElement();
|
|
3764
3787
|
if (this.trigger && t && document.body.appendChild(t), this.trigger) {
|
|
3765
3788
|
const { top: o, left: n } = this.calculatePosition();
|
|
3766
|
-
this.nodes.popover.style.position = "absolute", this.nodes.popover.style.top = `${o}px`, this.nodes.popover.style.left = `${n}px`, this.nodes.popover.style.setProperty(
|
|
3789
|
+
this.nodes.popover.style.position = "absolute", this.nodes.popover.style.top = `${o}px`, this.nodes.popover.style.left = `${n}px`, this.nodes.popover.style.setProperty($.PopoverTop, "0px"), this.nodes.popover.style.setProperty($.PopoverLeft, "0px");
|
|
3767
3790
|
}
|
|
3768
|
-
this.nodes.popover.style.setProperty(
|
|
3791
|
+
this.nodes.popover.style.setProperty($.PopoverHeight, this.size.height + "px"), !this.trigger && !this.shouldOpenBottom && (this.setOpenTop(!0), this.nodes.popover.style.setProperty($.PopoverTop, "calc(-1 * (0.5rem + var(--popover-height)))")), !this.trigger && !this.shouldOpenRight && (this.setOpenLeft(!0), this.nodes.popover.style.setProperty($.PopoverLeft, "calc(-1 * var(--width) + 100%)")), super.show(), (e = this.flipper) == null || e.activate(this.flippableElements), requestAnimationFrame(() => {
|
|
3769
3792
|
this.focusInitialElement();
|
|
3770
3793
|
});
|
|
3771
3794
|
}
|
|
@@ -3835,7 +3858,7 @@ class ft extends So {
|
|
|
3835
3858
|
setTriggerItemPosition(t, e) {
|
|
3836
3859
|
var r;
|
|
3837
3860
|
const o = e.getElement(), n = (o ? o.offsetTop : 0) - this.scrollTop, s = this.offsetTop + n;
|
|
3838
|
-
((r = t.querySelector(`[${m.popover}]`)) != null ? r : t).style.setProperty(
|
|
3861
|
+
((r = t.querySelector(`[${m.popover}]`)) != null ? r : t).style.setProperty($.TriggerItemTop, s + "px");
|
|
3839
3862
|
}
|
|
3840
3863
|
/**
|
|
3841
3864
|
* Destroys existing nested popover
|
|
@@ -3845,7 +3868,7 @@ class ft extends So {
|
|
|
3845
3868
|
if (this.nestedPopover === void 0 || this.nestedPopover === null)
|
|
3846
3869
|
return;
|
|
3847
3870
|
const t = (e = this.nestedPopoverTriggerItem) == null ? void 0 : e.getElement();
|
|
3848
|
-
this.nestedPopover.off(
|
|
3871
|
+
this.nestedPopover.off(q.ClosedOnActivate, this.hide), this.nestedPopover.hide(), this.nestedPopover.destroy(), this.nestedPopover.getElement().remove(), this.nestedPopover = null, (o = this.flipper) == null || o.activate(this.flippableElements), this.focusAfterNestedPopoverClose(t), (n = this.nestedPopoverTriggerItem) == null || n.onChildrenClose(), this.nestedPopoverTriggerItem = null;
|
|
3849
3872
|
}
|
|
3850
3873
|
/**
|
|
3851
3874
|
* Focuses the appropriate item after nested popover closes.
|
|
@@ -3880,9 +3903,9 @@ class ft extends So {
|
|
|
3880
3903
|
messages: this.messages,
|
|
3881
3904
|
onNavigateBack: this.destroyNestedPopoverIfExists.bind(this),
|
|
3882
3905
|
width: t.childrenWidth
|
|
3883
|
-
}), t.onChildrenOpen(), this.nestedPopover.on(
|
|
3906
|
+
}), t.onChildrenOpen(), this.nestedPopover.on(q.ClosedOnActivate, this.hide);
|
|
3884
3907
|
const e = this.nestedPopover.getMountElement(), o = this.nestedPopover.getElement();
|
|
3885
|
-
return this.nodes.popover.appendChild(e), this.setTriggerItemPosition(e, t), o.style.setProperty(
|
|
3908
|
+
return this.nodes.popover.appendChild(e), this.setTriggerItemPosition(e, t), o.style.setProperty($.NestingLevel, this.nestedPopover.nestingLevel.toString()), this.applyNestedPopoverPositioning(e), this.nestedPopover.show(), (n = this.flipper) == null || n.deactivate(), this.nestedPopover;
|
|
3886
3909
|
}
|
|
3887
3910
|
/**
|
|
3888
3911
|
* Applies positioning styles to nested popover container.
|
|
@@ -3897,7 +3920,7 @@ class ft extends So {
|
|
|
3897
3920
|
const o = (r = t.querySelector(`[${m.popover}]`)) != null ? r : t, n = this.nodes.popover.hasAttribute(m.popoverOpenTop), s = this.nodes.popover.hasAttribute(m.popoverOpenLeft);
|
|
3898
3921
|
e.style.position = "absolute";
|
|
3899
3922
|
const i = this.params.width === "auto" ? `${this.nodes.popoverContainer.offsetWidth}px` : "var(--width)";
|
|
3900
|
-
s ? o.style.setProperty(
|
|
3923
|
+
s ? o.style.setProperty($.PopoverLeft, `calc(-1 * (var(--nesting-level) + 1) * ${i} + 100%)`) : o.style.setProperty($.PopoverLeft, `calc(var(--nesting-level) * (${i} - var(--nested-popover-overlap)))`), n ? e.style.top = "calc(var(--trigger-item-top) - var(--popover-height) + var(--item-height) + 0.5rem + var(--nested-popover-overlap))" : e.style.top = "calc(var(--trigger-item-top) - var(--nested-popover-overlap))";
|
|
3901
3924
|
}
|
|
3902
3925
|
/**
|
|
3903
3926
|
* Checks if popover should be opened bottom.
|
|
@@ -3950,11 +3973,11 @@ class ft extends So {
|
|
|
3950
3973
|
* @returns array of HTML elements for keyboard navigation
|
|
3951
3974
|
*/
|
|
3952
3975
|
getFlippableElementsForItem(t) {
|
|
3953
|
-
if (t instanceof
|
|
3976
|
+
if (t instanceof Ct) {
|
|
3954
3977
|
const o = t.getElement();
|
|
3955
3978
|
return o ? [o] : [];
|
|
3956
3979
|
}
|
|
3957
|
-
if (!(t instanceof
|
|
3980
|
+
if (!(t instanceof J))
|
|
3958
3981
|
return [];
|
|
3959
3982
|
if (t.isDisabled)
|
|
3960
3983
|
return [];
|
|
@@ -3968,7 +3991,7 @@ class ft extends So {
|
|
|
3968
3991
|
this.search = new Ts({
|
|
3969
3992
|
items: this.itemsDefault,
|
|
3970
3993
|
placeholder: this.messages.search
|
|
3971
|
-
}), this.search.on(
|
|
3994
|
+
}), this.search.on(Se.Search, this.onSearch);
|
|
3972
3995
|
const t = this.search.getElement();
|
|
3973
3996
|
t.classList.add("mb-1.5"), this.nodes.popoverContainer.insertBefore(t, this.nodes.popoverContainer.firstChild);
|
|
3974
3997
|
}
|
|
@@ -3978,22 +4001,22 @@ class ft extends So {
|
|
|
3978
4001
|
* @param query - search query text
|
|
3979
4002
|
*/
|
|
3980
4003
|
filterItems(t) {
|
|
3981
|
-
const e = this.itemsDefault.filter((o) =>
|
|
4004
|
+
const e = this.itemsDefault.filter((o) => So(o, t));
|
|
3982
4005
|
this.onSearch({
|
|
3983
4006
|
query: t,
|
|
3984
4007
|
items: e
|
|
3985
4008
|
});
|
|
3986
4009
|
}
|
|
3987
4010
|
}
|
|
3988
|
-
const
|
|
3989
|
-
class
|
|
4011
|
+
const Cs = "38px", Ss = "46px";
|
|
4012
|
+
class Ge extends ft {
|
|
3990
4013
|
/**
|
|
3991
4014
|
* Constructs the instance
|
|
3992
4015
|
* @param params - instance parameters
|
|
3993
4016
|
*/
|
|
3994
4017
|
constructor(t) {
|
|
3995
4018
|
var n;
|
|
3996
|
-
const e = !ct(), o = new
|
|
4019
|
+
const e = !ct(), o = new Q({
|
|
3997
4020
|
focusedItemClass: lt.focused,
|
|
3998
4021
|
allowedKeys: [
|
|
3999
4022
|
v.TAB,
|
|
@@ -4003,7 +4026,7 @@ class Ze extends ft {
|
|
|
4003
4026
|
]
|
|
4004
4027
|
});
|
|
4005
4028
|
super(
|
|
4006
|
-
|
|
4029
|
+
P(y({}, t), {
|
|
4007
4030
|
flipper: o
|
|
4008
4031
|
}),
|
|
4009
4032
|
{
|
|
@@ -4041,15 +4064,15 @@ class Ze extends ft {
|
|
|
4041
4064
|
}
|
|
4042
4065
|
), this.hide = () => {
|
|
4043
4066
|
var s;
|
|
4044
|
-
this.setOpenTop(!1), this.setOpenLeft(!1), this.itemsDefault.forEach((i) => i.reset()), this.search !== void 0 && this.search.clear(), this.destroyNestedPopoverIfExists(), (s = this.flipper) == null || s.deactivate(), this.nodes.popover.className =
|
|
4067
|
+
this.setOpenTop(!1), this.setOpenLeft(!1), this.itemsDefault.forEach((i) => i.reset()), this.search !== void 0 && this.search.clear(), this.destroyNestedPopoverIfExists(), (s = this.flipper) == null || s.deactivate(), this.nodes.popover.className = S(ut.popover), this.nodes.popoverContainer && (this.nodes.popoverContainer.className = S(
|
|
4045
4068
|
L.popoverContainer,
|
|
4046
4069
|
ut.popoverContainer
|
|
4047
|
-
), this.nodes.popoverContainer.style.height = ""), this.emit(
|
|
4048
|
-
}, this.nodes.popover.className =
|
|
4070
|
+
), this.nodes.popoverContainer.style.height = ""), this.emit(q.Closed);
|
|
4071
|
+
}, this.nodes.popover.className = S(ut.popover), this.nodes.popoverContainer && (this.nodes.popoverContainer.className = S(
|
|
4049
4072
|
L.popoverContainer,
|
|
4050
4073
|
ut.popoverContainer
|
|
4051
|
-
)), this.nodes.items && (this.nodes.items.className =
|
|
4052
|
-
!(s instanceof
|
|
4074
|
+
)), this.nodes.items && (this.nodes.items.className = S(L.items, "flex")), this.nodes.popover.style.setProperty("--height", Cs), this.nodes.popover.style.setProperty("--height-mobile", Ss), this.nodes.popover.setAttribute(m.popoverInline, ""), (n = this.flipper) == null || n.setHandleContentEditableTargets(!0), this.items.forEach((s) => {
|
|
4075
|
+
!(s instanceof J) && !(s instanceof Ct) || s.hasChildren && s.isChildrenOpen && this.showNestedItems(s);
|
|
4053
4076
|
});
|
|
4054
4077
|
}
|
|
4055
4078
|
/**
|
|
@@ -4075,8 +4098,8 @@ class Ze extends ft {
|
|
|
4075
4098
|
*/
|
|
4076
4099
|
show() {
|
|
4077
4100
|
var e;
|
|
4078
|
-
if (super.show(), this.nodes.popover.className =
|
|
4079
|
-
this.nodes.popoverContainer.className =
|
|
4101
|
+
if (super.show(), this.nodes.popover.className = S(ut.popover, "inline-block"), this.nodes.popoverContainer) {
|
|
4102
|
+
this.nodes.popoverContainer.className = S(
|
|
4080
4103
|
L.popoverContainer,
|
|
4081
4104
|
L.popoverContainerOpened,
|
|
4082
4105
|
ut.popoverContainer,
|
|
@@ -4088,7 +4111,7 @@ class Ze extends ft {
|
|
|
4088
4111
|
const t = this.nestingLevel === 0 ? (e = this.nodes.popoverContainer) == null ? void 0 : e.getBoundingClientRect() : void 0;
|
|
4089
4112
|
if (t !== void 0) {
|
|
4090
4113
|
const o = `${t.width}px`, n = `${t.height}px`;
|
|
4091
|
-
this.nodes.popover.style.setProperty(
|
|
4114
|
+
this.nodes.popover.style.setProperty($.InlinePopoverWidth, o), this.nodes.popover.style.width = o, this.nodes.popover.style.height = n;
|
|
4092
4115
|
}
|
|
4093
4116
|
requestAnimationFrame(() => {
|
|
4094
4117
|
var o, n;
|
|
@@ -4110,7 +4133,7 @@ class Ze extends ft {
|
|
|
4110
4133
|
setTriggerItemPosition(t, e) {
|
|
4111
4134
|
const o = e.getElement(), n = o ? o.offsetLeft : 0, s = this.offsetLeft + n;
|
|
4112
4135
|
t.style.setProperty(
|
|
4113
|
-
|
|
4136
|
+
$.TriggerItemLeft,
|
|
4114
4137
|
s + "px"
|
|
4115
4138
|
);
|
|
4116
4139
|
}
|
|
@@ -4136,13 +4159,13 @@ class Ze extends ft {
|
|
|
4136
4159
|
const e = super.showNestedPopoverForItem(t), o = e.getElement();
|
|
4137
4160
|
(i = e.flipper) == null || i.setHandleContentEditableTargets(!0);
|
|
4138
4161
|
const n = o.querySelector(`[${m.popoverContainer}]`);
|
|
4139
|
-
n && (n.className =
|
|
4162
|
+
n && (n.className = S(
|
|
4140
4163
|
n.className,
|
|
4141
4164
|
"h-fit p-1.5 flex-col"
|
|
4142
4165
|
));
|
|
4143
4166
|
const s = o.querySelector(`[${m.popoverItems}]`);
|
|
4144
|
-
if (s && (s.className =
|
|
4145
|
-
n.className =
|
|
4167
|
+
if (s && (s.className = S(s.className, "block w-full")), o.setAttribute(m.nestedLevel, xs(e.nestingLevel)), e.nestingLevel === 1 && n) {
|
|
4168
|
+
n.className = S(n.className, "left-0");
|
|
4146
4169
|
const r = ct() ? "calc(var(--height-mobile) + 3px)" : "calc(var(--height) + 3px)";
|
|
4147
4170
|
n.style.top = r;
|
|
4148
4171
|
}
|
|
@@ -4231,7 +4254,7 @@ class Is {
|
|
|
4231
4254
|
"data-blok-testid": "popover-header-text",
|
|
4232
4255
|
[m.popoverHeaderText]: ""
|
|
4233
4256
|
})
|
|
4234
|
-
}, this.nodes.backButton.innerHTML =
|
|
4257
|
+
}, this.nodes.backButton.innerHTML = Go, this.nodes.root.appendChild(this.nodes.backButton), this.listeners.on(this.nodes.backButton, "click", this.onBackButtonClick), this.nodes.text.innerText = this.text, this.nodes.root.appendChild(this.nodes.text);
|
|
4235
4258
|
}
|
|
4236
4259
|
/**
|
|
4237
4260
|
* Returns popover header root html element
|
|
@@ -4283,7 +4306,7 @@ class Es {
|
|
|
4283
4306
|
this.pop();
|
|
4284
4307
|
}
|
|
4285
4308
|
}
|
|
4286
|
-
class Io extends
|
|
4309
|
+
class Io extends Co {
|
|
4287
4310
|
/**
|
|
4288
4311
|
* Construct the instance
|
|
4289
4312
|
* @param params - popover params
|
|
@@ -4306,7 +4329,7 @@ class Io extends So {
|
|
|
4306
4329
|
"data-blok-testid": "popover-overlay"
|
|
4307
4330
|
}), this.nodes.popover.insertBefore(this.nodes.overlay, this.nodes.popover.firstChild), this.listeners.on(this.nodes.overlay, "click", () => {
|
|
4308
4331
|
this.hide();
|
|
4309
|
-
}), this.history.push({ items: t.items }), this.nodes.popoverContainer.style.setProperty("--offset", "5px"), this.nodes.popoverContainer.className =
|
|
4332
|
+
}), this.history.push({ items: t.items }), this.nodes.popoverContainer.style.setProperty("--offset", "5px"), this.nodes.popoverContainer.className = S(
|
|
4310
4333
|
L.popoverContainer,
|
|
4311
4334
|
L.popoverContainerMobile
|
|
4312
4335
|
);
|
|
@@ -4315,7 +4338,7 @@ class Io extends So {
|
|
|
4315
4338
|
* Open popover
|
|
4316
4339
|
*/
|
|
4317
4340
|
show() {
|
|
4318
|
-
this.nodes.overlay.removeAttribute(m.overlayHidden), this.nodes.overlay.className =
|
|
4341
|
+
this.nodes.overlay.removeAttribute(m.overlayHidden), this.nodes.overlay.className = S(L.popoverOverlay, "fixed inset-0 block visible z-[3] opacity-50 transition-opacity duration-[120ms] ease-in will-change-[opacity]"), super.show(), this.nodes.popoverContainer.className = S(
|
|
4319
4342
|
L.popoverContainer,
|
|
4320
4343
|
L.popoverContainerMobile,
|
|
4321
4344
|
L.popoverContainerOpened,
|
|
@@ -4326,7 +4349,7 @@ class Io extends So {
|
|
|
4326
4349
|
* Closes popover
|
|
4327
4350
|
*/
|
|
4328
4351
|
hide() {
|
|
4329
|
-
this.isHidden || (super.hide(), this.nodes.overlay.setAttribute(m.overlayHidden, ""), this.nodes.overlay.className = L.popoverOverlay, this.nodes.popoverContainer.className =
|
|
4352
|
+
this.isHidden || (super.hide(), this.nodes.overlay.setAttribute(m.overlayHidden, ""), this.nodes.overlay.className = L.popoverOverlay, this.nodes.popoverContainer.className = S(
|
|
4330
4353
|
L.popoverContainer,
|
|
4331
4354
|
L.popoverContainerMobile
|
|
4332
4355
|
), this.scrollLocker.unlock(), this.history.reset(), this.isHidden = !0);
|
|
@@ -4375,7 +4398,7 @@ class Io extends So {
|
|
|
4375
4398
|
}
|
|
4376
4399
|
class As extends T {
|
|
4377
4400
|
constructor() {
|
|
4378
|
-
super(...arguments), this.opened = !1, this.selection = new
|
|
4401
|
+
super(...arguments), this.opened = !1, this.selection = new w(), this.popover = null, this.flipperInstance = new Q({
|
|
4379
4402
|
focusedItemClass: lt.focused,
|
|
4380
4403
|
allowedKeys: [
|
|
4381
4404
|
v.TAB,
|
|
@@ -4386,7 +4409,7 @@ class As extends T {
|
|
|
4386
4409
|
v.LEFT
|
|
4387
4410
|
]
|
|
4388
4411
|
}), this.flipperKeydownHandler = null, this.flipperKeydownSource = null, this.close = () => {
|
|
4389
|
-
this.opened && (this.opened = !1,
|
|
4412
|
+
this.opened && (this.opened = !1, w.isAtBlok || this.selection.restore(), this.selection.clearSaved(), this.detachFlipperKeydownListener(), this.clearBlockSelectionOnClose(), this.eventsDispatcher.emit(this.events.closed), this.popover && (this.popover.off(q.Closed, this.onPopoverClose), this.popover.destroy(), this.popover.getElement().remove(), this.popover = null));
|
|
4390
4413
|
}, this.onPopoverClose = () => {
|
|
4391
4414
|
this.close();
|
|
4392
4415
|
};
|
|
@@ -4422,13 +4445,13 @@ class As extends T {
|
|
|
4422
4445
|
* - Default Settings [Move, Remove, etc]
|
|
4423
4446
|
*/
|
|
4424
4447
|
make() {
|
|
4425
|
-
this.nodes.wrapper = g.make("div"), this.nodes.wrapper.setAttribute("data-blok-testid", "block-tunes-wrapper"), this.eventsDispatcher.on(
|
|
4448
|
+
this.nodes.wrapper = g.make("div"), this.nodes.wrapper.setAttribute("data-blok-testid", "block-tunes-wrapper"), this.eventsDispatcher.on(wt, this.close);
|
|
4426
4449
|
}
|
|
4427
4450
|
/**
|
|
4428
4451
|
* Destroys module
|
|
4429
4452
|
*/
|
|
4430
4453
|
destroy() {
|
|
4431
|
-
this.detachFlipperKeydownListener(), this.removeAllNodes(), this.listeners.destroy(), this.eventsDispatcher.off(
|
|
4454
|
+
this.detachFlipperKeydownListener(), this.removeAllNodes(), this.listeners.destroy(), this.eventsDispatcher.off(wt, this.close);
|
|
4432
4455
|
}
|
|
4433
4456
|
/**
|
|
4434
4457
|
* Open Block Settings pane
|
|
@@ -4451,7 +4474,7 @@ class As extends T {
|
|
|
4451
4474
|
search: this.Blok.I18n.t("popover.search")
|
|
4452
4475
|
}
|
|
4453
4476
|
};
|
|
4454
|
-
l === ft && (c.flipper = this.flipperInstance), this.popover = new l(c), this.popover.getElement().setAttribute("data-blok-testid", "block-tunes-popover"), this.popover.on(
|
|
4477
|
+
l === ft && (c.flipper = this.flipperInstance), this.popover = new l(c), this.popover.getElement().setAttribute("data-blok-testid", "block-tunes-popover"), this.popover.on(q.Closed, this.onPopoverClose), this.opened = !0, this.eventsDispatcher.emit(this.events.opened), this.popover.show(), this.attachFlipperKeydownListener(s);
|
|
4455
4478
|
}
|
|
4456
4479
|
/**
|
|
4457
4480
|
* Returns root block settings element
|
|
@@ -4479,8 +4502,8 @@ class As extends T {
|
|
|
4479
4502
|
!i && o !== void 0 && o.length > 0 && (n.push(...o), n.push({
|
|
4480
4503
|
type: O.Separator
|
|
4481
4504
|
}));
|
|
4482
|
-
const r = Array.from(this.Blok.Tools.blockTools.values()), c = (i ? await
|
|
4483
|
-
s.map((d) => new
|
|
4505
|
+
const r = Array.from(this.Blok.Tools.blockTools.values()), c = (i ? await Zo(
|
|
4506
|
+
s.map((d) => new W(d)),
|
|
4484
4507
|
r
|
|
4485
4508
|
) : await Jo(t, r)).reduce((d, h) => (h.toolbox === void 0 || h.toolbox.forEach((u) => {
|
|
4486
4509
|
var f;
|
|
@@ -4490,14 +4513,14 @@ class As extends T {
|
|
|
4490
4513
|
name: (f = u.name) != null ? f : h.name,
|
|
4491
4514
|
closeOnActivate: !0,
|
|
4492
4515
|
onActivate: async () => {
|
|
4493
|
-
const { Caret: p, Toolbar:
|
|
4516
|
+
const { Caret: p, Toolbar: k } = this.Blok, b = await this.convertBlock(
|
|
4494
4517
|
t,
|
|
4495
4518
|
s,
|
|
4496
4519
|
i,
|
|
4497
4520
|
h,
|
|
4498
4521
|
u.data
|
|
4499
4522
|
);
|
|
4500
|
-
|
|
4523
|
+
k.close(), b && p.setToBlock(b, p.positions.END);
|
|
4501
4524
|
}
|
|
4502
4525
|
});
|
|
4503
4526
|
}), d), []);
|
|
@@ -4599,11 +4622,11 @@ line2` };
|
|
|
4599
4622
|
async convertBlocksToSingleMergedBlock(t, e, o) {
|
|
4600
4623
|
var f, p;
|
|
4601
4624
|
const { BlockManager: n } = this.Blok, s = [];
|
|
4602
|
-
for (const
|
|
4625
|
+
for (const k of t)
|
|
4603
4626
|
try {
|
|
4604
|
-
const
|
|
4605
|
-
s.push(
|
|
4606
|
-
} catch (
|
|
4627
|
+
const b = await k.exportDataAsString();
|
|
4628
|
+
s.push(b);
|
|
4629
|
+
} catch (b) {
|
|
4607
4630
|
}
|
|
4608
4631
|
if (s.length === 0)
|
|
4609
4632
|
return null;
|
|
@@ -4612,8 +4635,8 @@ line2` };
|
|
|
4612
4635
|
if (!l)
|
|
4613
4636
|
return null;
|
|
4614
4637
|
const c = typeof ((f = l.conversionConfig) == null ? void 0 : f.import) == "function" ? l.conversionConfig.import(r, l.settings) : { [(p = l.conversionConfig) == null ? void 0 : p.import]: r }, d = o ? Object.assign(c, o) : c, h = n.replace(i, e, d), u = t.slice(1);
|
|
4615
|
-
for (const
|
|
4616
|
-
await n.removeBlock(
|
|
4638
|
+
for (const k of u)
|
|
4639
|
+
await n.removeBlock(k, !1);
|
|
4617
4640
|
return h;
|
|
4618
4641
|
}
|
|
4619
4642
|
/**
|
|
@@ -4687,10 +4710,10 @@ line2` };
|
|
|
4687
4710
|
const c = n.getBlockIndex(t);
|
|
4688
4711
|
await n.removeBlock(t, !1);
|
|
4689
4712
|
const d = i.map((u, f) => {
|
|
4690
|
-
const p = typeof l == "function" ? l(u, r == null ? void 0 : r.settings) : { [l]: u },
|
|
4713
|
+
const p = typeof l == "function" ? l(u, r == null ? void 0 : r.settings) : { [l]: u }, k = o ? Object.assign(p, o) : p;
|
|
4691
4714
|
return n.insert({
|
|
4692
4715
|
tool: e,
|
|
4693
|
-
data:
|
|
4716
|
+
data: k,
|
|
4694
4717
|
index: c + f,
|
|
4695
4718
|
needToFocus: !1
|
|
4696
4719
|
});
|
|
@@ -4715,7 +4738,7 @@ line2` };
|
|
|
4715
4738
|
this.flipperKeydownSource !== null && this.flipperKeydownHandler !== null && this.flipperKeydownSource.removeEventListener("keydown", this.flipperKeydownHandler, !0), this.flipperInstance.setHandleContentEditableTargets(!1), this.flipperKeydownSource = null, this.flipperKeydownHandler = null;
|
|
4716
4739
|
}
|
|
4717
4740
|
}
|
|
4718
|
-
const
|
|
4741
|
+
const Ze = {
|
|
4719
4742
|
SHIFT: ["SHIFT"],
|
|
4720
4743
|
CMD: ["CMD", "CONTROL", "COMMAND", "WINDOWS", "CTRL"],
|
|
4721
4744
|
ALT: ["ALT", "OPTION"]
|
|
@@ -4766,8 +4789,8 @@ const Ge = {
|
|
|
4766
4789
|
INSERT: "Insert",
|
|
4767
4790
|
DELETE: "Delete",
|
|
4768
4791
|
".": "Period"
|
|
4769
|
-
}, Ds = (a) => Object.keys(
|
|
4770
|
-
(e) =>
|
|
4792
|
+
}, Ds = (a) => Object.keys(Ze).find(
|
|
4793
|
+
(e) => Ze[e].includes(a)
|
|
4771
4794
|
);
|
|
4772
4795
|
class Ls {
|
|
4773
4796
|
/**
|
|
@@ -4887,7 +4910,7 @@ class Os {
|
|
|
4887
4910
|
}
|
|
4888
4911
|
const z = new Os();
|
|
4889
4912
|
var Nt = /* @__PURE__ */ ((a) => (a.Opened = "toolbox-opened", a.Closed = "toolbox-closed", a.BlockAdded = "toolbox-block-added", a))(Nt || {});
|
|
4890
|
-
class Ns extends
|
|
4913
|
+
class Ns extends St {
|
|
4891
4914
|
/**
|
|
4892
4915
|
* Toolbox constructor
|
|
4893
4916
|
* @param options - available parameters
|
|
@@ -4917,7 +4940,7 @@ class Ns extends Ct {
|
|
|
4917
4940
|
(c = this.popover) == null || c.filterItems(l);
|
|
4918
4941
|
}, this.api = t, this.tools = e, this.i18nLabels = o, this.i18n = n, this.triggerElement = s, this.enableShortcuts(), this.nodes = {
|
|
4919
4942
|
toolbox: g.make("div")
|
|
4920
|
-
}, this.nodes.toolbox.setAttribute("data-blok-testid", "toolbox"), this.initPopover(), this.api.events.on(
|
|
4943
|
+
}, this.nodes.toolbox.setAttribute("data-blok-testid", "toolbox"), this.initPopover(), this.api.events.on(wt, this.handleMobileLayoutToggle);
|
|
4921
4944
|
}
|
|
4922
4945
|
/**
|
|
4923
4946
|
* Returns True if Toolbox is Empty and nothing to show
|
|
@@ -4961,7 +4984,7 @@ class Ns extends Ct {
|
|
|
4961
4984
|
*/
|
|
4962
4985
|
destroy() {
|
|
4963
4986
|
var t;
|
|
4964
|
-
super.destroy(), this.nodes && this.nodes.toolbox && this.nodes.toolbox.remove(), this.removeAllShortcuts(), (t = this.popover) == null || t.off(
|
|
4987
|
+
super.destroy(), this.nodes && this.nodes.toolbox && this.nodes.toolbox.remove(), this.removeAllShortcuts(), (t = this.popover) == null || t.off(q.Closed, this.onPopoverClose), this.listeners.destroy(), this.api.events.off(wt, this.handleMobileLayoutToggle);
|
|
4965
4988
|
}
|
|
4966
4989
|
/**
|
|
4967
4990
|
* Toolbox Tool's button click handler
|
|
@@ -5014,13 +5037,13 @@ class Ns extends Ct {
|
|
|
5014
5037
|
},
|
|
5015
5038
|
items: this.toolboxItemsToBeDisplayed,
|
|
5016
5039
|
handleContentEditableNavigation: !0
|
|
5017
|
-
}), this.popover.on(
|
|
5040
|
+
}), this.popover.on(q.Closed, this.onPopoverClose), this.popover.getElement().setAttribute("data-blok-testid", "toolbox-popover");
|
|
5018
5041
|
}
|
|
5019
5042
|
/**
|
|
5020
5043
|
* Destroys popover instance and removes it from DOM
|
|
5021
5044
|
*/
|
|
5022
5045
|
destroyPopover() {
|
|
5023
|
-
this.popover !== null && (this.popover.hide(), this.popover.off(
|
|
5046
|
+
this.popover !== null && (this.popover.hide(), this.popover.off(q.Closed, this.onPopoverClose), this.popover.destroy(), this.popover = null), this.nodes.toolbox !== null && (this.nodes.toolbox.innerHTML = "");
|
|
5024
5047
|
}
|
|
5025
5048
|
/**
|
|
5026
5049
|
* Returns list of tools that enables the Toolbox (by specifying the 'toolbox' getter)
|
|
@@ -5040,16 +5063,16 @@ class Ns extends Ct {
|
|
|
5040
5063
|
if (this._toolboxItemsToBeDisplayed)
|
|
5041
5064
|
return this._toolboxItemsToBeDisplayed;
|
|
5042
5065
|
const t = (o, n, s = !0) => {
|
|
5043
|
-
var f, p,
|
|
5044
|
-
const i = o.titleKey, r = i ? `toolNames.${i}` : void 0, l = r ? this.api.i18n.getEnglishTranslation(r) : o.title, c = (f = o.searchTerms) != null ? f : [], d = (p = n.searchTerms) != null ? p : [], h = [.../* @__PURE__ */ new Set([...c, ...d])], u = (
|
|
5066
|
+
var f, p, k, b;
|
|
5067
|
+
const i = o.titleKey, r = i ? `toolNames.${i}` : void 0, l = r ? this.api.i18n.getEnglishTranslation(r) : o.title, c = (f = o.searchTerms) != null ? f : [], d = (p = n.searchTerms) != null ? p : [], h = [.../* @__PURE__ */ new Set([...c, ...d])], u = (k = o.shortcut) != null ? k : s ? n.shortcut : void 0;
|
|
5045
5068
|
return {
|
|
5046
5069
|
icon: o.icon,
|
|
5047
5070
|
title: vo(this.i18n, o, Ht(n.name)),
|
|
5048
|
-
name: (
|
|
5071
|
+
name: (b = o.name) != null ? b : n.name,
|
|
5049
5072
|
onActivate: () => {
|
|
5050
5073
|
this.toolButtonActivated(n.name, o.data);
|
|
5051
5074
|
},
|
|
5052
|
-
secondaryLabel: u ?
|
|
5075
|
+
secondaryLabel: u ? yo(u) : "",
|
|
5053
5076
|
englishTitle: l,
|
|
5054
5077
|
searchTerms: h
|
|
5055
5078
|
};
|
|
@@ -5520,7 +5543,7 @@ class Rs extends T {
|
|
|
5520
5543
|
plusButtonClicked(t = !1) {
|
|
5521
5544
|
var f, p;
|
|
5522
5545
|
const { BlockManager: e, BlockSettings: o, BlockSelection: n, Caret: s } = this.Blok;
|
|
5523
|
-
if (o.opened && o.close(), n.anyBlockSelected && n.clearSelection(), (f =
|
|
5546
|
+
if (o.opened && o.close(), n.anyBlockSelected && n.clearSelection(), (f = w.get()) == null || f.removeAllRanges(), this.toolbox.opened) {
|
|
5524
5547
|
this.toolbox.close();
|
|
5525
5548
|
return;
|
|
5526
5549
|
}
|
|
@@ -5559,13 +5582,13 @@ class Rs extends T {
|
|
|
5559
5582
|
return;
|
|
5560
5583
|
}
|
|
5561
5584
|
i || this.moveAndOpen(o, n);
|
|
5562
|
-
}), this.eventsDispatcher.on(ie, this.onBlockSettingsOpen), this.eventsDispatcher.on(re, this.onBlockSettingsClose), this.eventsDispatcher.on(
|
|
5585
|
+
}), this.eventsDispatcher.on(ie, this.onBlockSettingsOpen), this.eventsDispatcher.on(re, this.onBlockSettingsClose), this.eventsDispatcher.on(yt, this.onBlockChanged);
|
|
5563
5586
|
}
|
|
5564
5587
|
/**
|
|
5565
5588
|
* Disable bindings
|
|
5566
5589
|
*/
|
|
5567
5590
|
disableModuleBindings() {
|
|
5568
|
-
this.readOnlyMutableListeners.clearAll(), this.eventsDispatcher.off(ie, this.onBlockSettingsOpen), this.eventsDispatcher.off(re, this.onBlockSettingsClose), this.eventsDispatcher.off(
|
|
5591
|
+
this.readOnlyMutableListeners.clearAll(), this.eventsDispatcher.off(ie, this.onBlockSettingsOpen), this.eventsDispatcher.off(re, this.onBlockSettingsClose), this.eventsDispatcher.off(yt, this.onBlockChanged);
|
|
5569
5592
|
}
|
|
5570
5593
|
/**
|
|
5571
5594
|
* Calculates the Y position for the toolbar, centered on the first line of the block
|
|
@@ -5712,7 +5735,7 @@ class Ie {
|
|
|
5712
5735
|
const t = (n = this.config.config) != null ? n : {}, e = {};
|
|
5713
5736
|
for (const s of Object.keys(this.config))
|
|
5714
5737
|
Ps.has(s) || (e[s] = this.config[s]);
|
|
5715
|
-
const o =
|
|
5738
|
+
const o = y(y({}, t), e);
|
|
5716
5739
|
return this.isDefault && !("placeholder" in o) && this.defaultPlaceholder && (o.placeholder = this.defaultPlaceholder), o;
|
|
5717
5740
|
}
|
|
5718
5741
|
/**
|
|
@@ -5778,8 +5801,8 @@ class Hs extends T {
|
|
|
5778
5801
|
config: t,
|
|
5779
5802
|
eventsDispatcher: e
|
|
5780
5803
|
}), this.opened = !1, this.popover = null, this.openingPromise = null, this.toolbarVerticalMargin = ct() ? 20 : 6, this.initialized = !1, this.initializationScheduled = !1, this.tools = /* @__PURE__ */ new Map(), this.registeredShortcuts = /* @__PURE__ */ new Map(), this.shortcutsRegistered = !1, this.shortcutRegistrationScheduled = !1, this.listeners.on(window, "keydown", (o) => {
|
|
5781
|
-
var
|
|
5782
|
-
const n = o, s = n.key === "ArrowDown" || n.key === "ArrowUp", i = n.key === "ArrowLeft" || n.key === "ArrowRight", r = s && !n.shiftKey && this.opened, l = this.popover, c = (
|
|
5804
|
+
var k, b, B, x, C;
|
|
5805
|
+
const n = o, s = n.key === "ArrowDown" || n.key === "ArrowUp", i = n.key === "ArrowLeft" || n.key === "ArrowRight", r = s && !n.shiftKey && this.opened, l = this.popover, c = (b = (k = l == null ? void 0 : l.flipper) == null ? void 0 : k.hasFocus()) != null ? b : !1, d = (B = this.popover) == null ? void 0 : B.nestedPopover, h = d != null, u = (C = (x = d == null ? void 0 : d.flipper) == null ? void 0 : x.hasFocus()) != null ? C : !1;
|
|
5783
5806
|
if (r && !(c || h || u)) {
|
|
5784
5807
|
this.close();
|
|
5785
5808
|
return;
|
|
@@ -5896,7 +5919,7 @@ class Hs extends T {
|
|
|
5896
5919
|
if (!this.opened)
|
|
5897
5920
|
return;
|
|
5898
5921
|
this.tools = /* @__PURE__ */ new Map(), this.opened = !1, this.openingPromise = null, this.popover && ((n = (o = this.popover).hide) == null || n.call(o), (i = (s = this.popover).destroy) == null || i.call(s), this.popover = null), this.nodes.wrapper && (this.nodes.wrapper.innerHTML = "");
|
|
5899
|
-
const t =
|
|
5922
|
+
const t = Ge.mock, e = (l = (r = t == null ? void 0 : t.results) == null ? void 0 : r.at(-1)) == null ? void 0 : l.value;
|
|
5900
5923
|
e && ((c = e.hide) == null || c.call(e), (d = e.destroy) == null || d.call(e));
|
|
5901
5924
|
}
|
|
5902
5925
|
/**
|
|
@@ -5917,7 +5940,7 @@ class Hs extends T {
|
|
|
5917
5940
|
* Making DOM - creates wrapper element for the inline toolbar
|
|
5918
5941
|
*/
|
|
5919
5942
|
make() {
|
|
5920
|
-
this.nodes.wrapper = g.make("div",
|
|
5943
|
+
this.nodes.wrapper = g.make("div", S(
|
|
5921
5944
|
"absolute top-0 left-0 z-[3] opacity-100 visible",
|
|
5922
5945
|
"transition-opacity duration-[250ms] ease-out",
|
|
5923
5946
|
"will-change-[opacity,left,top]",
|
|
@@ -5928,12 +5951,12 @@ class Hs extends T {
|
|
|
5928
5951
|
* Shows Inline Toolbar
|
|
5929
5952
|
*/
|
|
5930
5953
|
async open() {
|
|
5931
|
-
var i, r, l, c, d, h, u, f, p,
|
|
5954
|
+
var i, r, l, c, d, h, u, f, p, k, b, B, x, C, R, M, D, G, Ne, Re, Pe;
|
|
5932
5955
|
if (this.opened || (this.initialize(), this.opened = !0, this.popover && ((r = (i = this.popover).hide) == null || r.call(i), (c = (l = this.popover).destroy) == null || c.call(l), this.popover = null), this.createToolsInstances(), !this.nodes.wrapper))
|
|
5933
5956
|
return;
|
|
5934
5957
|
this.nodes.wrapper.innerHTML = "";
|
|
5935
5958
|
const t = await this.buildPopoverItems(), e = (p = (f = (u = (h = (d = this.Blok.API) == null ? void 0 : d.methods) == null ? void 0 : h.ui) == null ? void 0 : u.nodes) == null ? void 0 : f.redactor) != null ? p : this.Blok.UI.nodes.redactor;
|
|
5936
|
-
this.popover = new
|
|
5959
|
+
this.popover = new Ge({
|
|
5937
5960
|
items: t,
|
|
5938
5961
|
scopeElement: e,
|
|
5939
5962
|
messages: {
|
|
@@ -5941,7 +5964,7 @@ class Hs extends T {
|
|
|
5941
5964
|
search: this.Blok.I18n.t("popover.search")
|
|
5942
5965
|
}
|
|
5943
5966
|
});
|
|
5944
|
-
const o = (
|
|
5967
|
+
const o = (C = (b = (k = this.popover).getMountElement) == null ? void 0 : b.call(k)) != null ? C : (x = (B = this.popover).getElement) == null ? void 0 : x.call(B), n = (M = (R = this.popover).getElement) == null ? void 0 : M.call(R), s = (Ne = (G = (D = this.popover.size) == null ? void 0 : D.width) != null ? G : n == null ? void 0 : n.getBoundingClientRect().width) != null ? Ne : 0;
|
|
5945
5968
|
this.applyPosition(s), o && this.nodes.wrapper && this.nodes.wrapper.appendChild(o), (Pe = (Re = this.popover).show) == null || Pe.call(Re);
|
|
5946
5969
|
}
|
|
5947
5970
|
/**
|
|
@@ -5950,7 +5973,7 @@ class Hs extends T {
|
|
|
5950
5973
|
async buildPopoverItems() {
|
|
5951
5974
|
const t = [], e = Array.from(this.tools.entries());
|
|
5952
5975
|
for (const [o, [n, s]] of e.entries()) {
|
|
5953
|
-
const i = await s.render(), r = this.getToolShortcut(n.name), l = r !== void 0 ?
|
|
5976
|
+
const i = await s.render(), r = this.getToolShortcut(n.name), l = r !== void 0 ? yo(r) : void 0, c = nn(this.Blok.I18n, n.titleKey, n.title || Ht(n.name)), d = Array.isArray(i) ? i : [i], h = o === 0;
|
|
5954
5977
|
for (const u of d) {
|
|
5955
5978
|
const f = this.processPopoverItem(u, n.name, c, l, h);
|
|
5956
5979
|
t.push(...f);
|
|
@@ -5972,14 +5995,14 @@ class Hs extends T {
|
|
|
5972
5995
|
if (t instanceof HTMLElement)
|
|
5973
5996
|
return i;
|
|
5974
5997
|
if (t.type === O.Html)
|
|
5975
|
-
return i.push(
|
|
5998
|
+
return i.push(P(y(y({}, r), t), {
|
|
5976
5999
|
type: O.Html
|
|
5977
6000
|
})), i;
|
|
5978
6001
|
if (t.type === O.Separator)
|
|
5979
6002
|
return i.push({
|
|
5980
6003
|
type: O.Separator
|
|
5981
6004
|
}), i;
|
|
5982
|
-
const l =
|
|
6005
|
+
const l = P(y(y({}, r), t), {
|
|
5983
6006
|
type: O.Default
|
|
5984
6007
|
});
|
|
5985
6008
|
return i.push(l), "children" in l && s && i.push({
|
|
@@ -5992,7 +6015,7 @@ class Hs extends T {
|
|
|
5992
6015
|
applyPosition(t) {
|
|
5993
6016
|
if (!this.nodes.wrapper)
|
|
5994
6017
|
return;
|
|
5995
|
-
const e = this.Blok.UI.nodes.wrapper.getBoundingClientRect(), o = this.Blok.UI.contentRect, n =
|
|
6018
|
+
const e = this.Blok.UI.nodes.wrapper.getBoundingClientRect(), o = this.Blok.UI.contentRect, n = w.rect, s = {
|
|
5996
6019
|
x: n.x - e.x,
|
|
5997
6020
|
y: n.y + n.height - e.top + this.toolbarVerticalMargin
|
|
5998
6021
|
};
|
|
@@ -6002,7 +6025,7 @@ class Hs extends T {
|
|
|
6002
6025
|
* Need to show Inline Toolbar or not
|
|
6003
6026
|
*/
|
|
6004
6027
|
allowedToShow() {
|
|
6005
|
-
const t = ["IMG", "INPUT"], e = this.resolveSelection(), o =
|
|
6028
|
+
const t = ["IMG", "INPUT"], e = this.resolveSelection(), o = w.text;
|
|
6006
6029
|
if (!e || !e.anchorNode || e.isCollapsed || o.length < 1)
|
|
6007
6030
|
return !1;
|
|
6008
6031
|
const n = g.isElement(e.anchorNode) ? e.anchorNode : e.anchorNode.parentElement;
|
|
@@ -6015,7 +6038,7 @@ class Hs extends T {
|
|
|
6015
6038
|
if (n.closest(d) !== null)
|
|
6016
6039
|
return !0;
|
|
6017
6040
|
const u = r.holder;
|
|
6018
|
-
return u && (u.matches(d) ? u : u.closest(d)) ? !0 : this.Blok.ReadOnly.isEnabled ?
|
|
6041
|
+
return u && (u.matches(d) ? u : u.closest(d)) ? !0 : this.Blok.ReadOnly.isEnabled ? w.isSelectionAtBlok(e) : !1;
|
|
6019
6042
|
}
|
|
6020
6043
|
/**
|
|
6021
6044
|
* Working with Tools
|
|
@@ -6132,11 +6155,11 @@ class Hs extends T {
|
|
|
6132
6155
|
* Resolves the current selection, handling test mocks
|
|
6133
6156
|
*/
|
|
6134
6157
|
resolveSelection() {
|
|
6135
|
-
const t =
|
|
6158
|
+
const t = w.selection;
|
|
6136
6159
|
if (t !== void 0)
|
|
6137
6160
|
return t;
|
|
6138
|
-
const e =
|
|
6139
|
-
return e !== void 0 ? e :
|
|
6161
|
+
const e = w.instance;
|
|
6162
|
+
return e !== void 0 ? e : w.get();
|
|
6140
6163
|
}
|
|
6141
6164
|
}
|
|
6142
6165
|
const Et = {
|
|
@@ -6374,7 +6397,7 @@ class Ws {
|
|
|
6374
6397
|
* Add custom dictionary overrides
|
|
6375
6398
|
*/
|
|
6376
6399
|
setDictionary(t) {
|
|
6377
|
-
this.overrides =
|
|
6400
|
+
this.overrides = y(y({}, this.overrides), t);
|
|
6378
6401
|
}
|
|
6379
6402
|
/**
|
|
6380
6403
|
* Get the current locale
|
|
@@ -6389,7 +6412,7 @@ class Ws {
|
|
|
6389
6412
|
return "ltr";
|
|
6390
6413
|
}
|
|
6391
6414
|
}
|
|
6392
|
-
const
|
|
6415
|
+
const Wi = Et;
|
|
6393
6416
|
class $s extends T {
|
|
6394
6417
|
/**
|
|
6395
6418
|
* Constructor - creates lightweight i18n instance
|
|
@@ -6511,7 +6534,7 @@ class $s extends T {
|
|
|
6511
6534
|
async ensureI18nextLoaded(t, e) {
|
|
6512
6535
|
if (this.i18nextWrapper !== null)
|
|
6513
6536
|
return;
|
|
6514
|
-
const { loadI18next: o } = await import("./i18next-loader-
|
|
6537
|
+
const { loadI18next: o } = await import("./i18next-loader-CI8T9PDi.mjs");
|
|
6515
6538
|
this.i18nextWrapper = await o(t, e);
|
|
6516
6539
|
}
|
|
6517
6540
|
/**
|
|
@@ -6637,15 +6660,15 @@ const js = (a) => {
|
|
|
6637
6660
|
const d = document.createRange();
|
|
6638
6661
|
try {
|
|
6639
6662
|
d.setStart(t, e), d.setEnd(i, 0);
|
|
6640
|
-
} catch (
|
|
6663
|
+
} catch (k) {
|
|
6641
6664
|
return null;
|
|
6642
6665
|
}
|
|
6643
6666
|
const h = d.cloneContents(), u = document.createElement("div");
|
|
6644
6667
|
u.appendChild(h);
|
|
6645
|
-
const f = Array.from(u.querySelectorAll("*")).some((
|
|
6668
|
+
const f = Array.from(u.querySelectorAll("*")).some((k) => {
|
|
6646
6669
|
var B;
|
|
6647
|
-
const
|
|
6648
|
-
return
|
|
6670
|
+
const b = (B = k.textContent) != null ? B : "";
|
|
6671
|
+
return b.length === 0 || Be(b);
|
|
6649
6672
|
}), p = ue.has(i);
|
|
6650
6673
|
if (!(!f && !p))
|
|
6651
6674
|
return p && ue.delete(i), {
|
|
@@ -6681,7 +6704,7 @@ const js = (a) => {
|
|
|
6681
6704
|
return !1;
|
|
6682
6705
|
const n = window.getSelection(), s = (i = n == null ? void 0 : n.focusNode) != null ? i : null;
|
|
6683
6706
|
return s !== null && s !== a && !(s.nodeType === Node.TEXT_NODE && s.parentNode === a) ? !1 : No(a, e, o, "left");
|
|
6684
|
-
},
|
|
6707
|
+
}, bt = (a) => {
|
|
6685
6708
|
const t = g.getDeepestNode(a, !0);
|
|
6686
6709
|
if (t === null)
|
|
6687
6710
|
return !0;
|
|
@@ -6756,24 +6779,24 @@ const js = (a) => {
|
|
|
6756
6779
|
var h, u, f, p;
|
|
6757
6780
|
if (g.isNativeInput(a)) {
|
|
6758
6781
|
a.focus();
|
|
6759
|
-
const
|
|
6760
|
-
a.setSelectionRange(
|
|
6782
|
+
const k = t ? 0 : a.value.length;
|
|
6783
|
+
a.setSelectionRange(k, k);
|
|
6761
6784
|
return;
|
|
6762
6785
|
}
|
|
6763
6786
|
a.focus();
|
|
6764
6787
|
const e = document.createRange(), o = window.getSelection();
|
|
6765
6788
|
if (!o)
|
|
6766
6789
|
return;
|
|
6767
|
-
const n = (
|
|
6790
|
+
const n = (k, b = !1) => {
|
|
6768
6791
|
const B = document.createTextNode("");
|
|
6769
|
-
|
|
6770
|
-
}, s = (
|
|
6771
|
-
if (
|
|
6792
|
+
b ? k.insertBefore(B, k.firstChild) : k.appendChild(B), e.setStart(B, 0), e.setEnd(B, 0);
|
|
6793
|
+
}, s = (k, b) => {
|
|
6794
|
+
if (k === null)
|
|
6772
6795
|
return null;
|
|
6773
|
-
if (
|
|
6774
|
-
return
|
|
6775
|
-
const B =
|
|
6776
|
-
return s(B,
|
|
6796
|
+
if (k.nodeType === Node.TEXT_NODE)
|
|
6797
|
+
return k;
|
|
6798
|
+
const B = b ? k.firstChild : k.lastChild;
|
|
6799
|
+
return s(B, b);
|
|
6777
6800
|
}, i = a.childNodes, r = t ? (h = i[0]) != null ? h : null : (u = i[i.length - 1]) != null ? u : null, l = s(r, t);
|
|
6778
6801
|
if (r === null) {
|
|
6779
6802
|
n(a), o.removeAllRanges(), o.addRange(e);
|
|
@@ -6831,12 +6854,12 @@ const js = (a) => {
|
|
|
6831
6854
|
Qt(a, o, e);
|
|
6832
6855
|
return;
|
|
6833
6856
|
}
|
|
6834
|
-
const s =
|
|
6857
|
+
const s = Gs(a, n, e);
|
|
6835
6858
|
if (s === null) {
|
|
6836
6859
|
Qt(a, o, e);
|
|
6837
6860
|
return;
|
|
6838
6861
|
}
|
|
6839
|
-
const i =
|
|
6862
|
+
const i = Zs(t, s);
|
|
6840
6863
|
if (i && a.contains(i.node)) {
|
|
6841
6864
|
const r = document.createRange();
|
|
6842
6865
|
try {
|
|
@@ -6860,7 +6883,7 @@ const js = (a) => {
|
|
|
6860
6883
|
} catch (r) {
|
|
6861
6884
|
Po(a, e);
|
|
6862
6885
|
}
|
|
6863
|
-
},
|
|
6886
|
+
}, Gs = (a, t, e) => {
|
|
6864
6887
|
const o = document.createRange();
|
|
6865
6888
|
try {
|
|
6866
6889
|
if (e)
|
|
@@ -6878,7 +6901,7 @@ const js = (a) => {
|
|
|
6878
6901
|
} catch (n) {
|
|
6879
6902
|
return null;
|
|
6880
6903
|
}
|
|
6881
|
-
},
|
|
6904
|
+
}, Zs = (a, t) => {
|
|
6882
6905
|
const e = document.caretPositionFromPoint(a, t);
|
|
6883
6906
|
return e === null ? null : {
|
|
6884
6907
|
node: e.offsetNode,
|
|
@@ -6941,7 +6964,7 @@ const js = (a) => {
|
|
|
6941
6964
|
const i = o.getBlockByIndex(s);
|
|
6942
6965
|
if (!i)
|
|
6943
6966
|
continue;
|
|
6944
|
-
const r = await i.save(), l = await o.update(i,
|
|
6967
|
+
const r = await i.save(), l = await o.update(i, P(y({}, r), {
|
|
6945
6968
|
depth: Math.max(0, this.getListBlockDepth(i) + t)
|
|
6946
6969
|
}));
|
|
6947
6970
|
l.selected = !0;
|
|
@@ -7011,7 +7034,7 @@ const js = (a) => {
|
|
|
7011
7034
|
const { BlockSelection: e, BlockManager: o, Caret: n, BlockSettings: s } = this.Blok;
|
|
7012
7035
|
if (s.contains(t.target))
|
|
7013
7036
|
return !1;
|
|
7014
|
-
const i = t.key === "Backspace" || t.key === "Delete", r =
|
|
7037
|
+
const i = t.key === "Backspace" || t.key === "Delete", r = w.isSelectionExists, l = w.isCollapsed === !0;
|
|
7015
7038
|
if (!(i && e.anyBlockSelected && (!r || l)))
|
|
7016
7039
|
return !1;
|
|
7017
7040
|
const d = o.removeSelectedBlocks();
|
|
@@ -7096,34 +7119,34 @@ const js = (a) => {
|
|
|
7096
7119
|
return;
|
|
7097
7120
|
const i = s.textContent || "", r = o.holder.getAttribute("data-blok-depth"), l = r ? parseInt(r, 10) : 0, c = F.CHECKLIST_PATTERN.exec(i);
|
|
7098
7121
|
if (c) {
|
|
7099
|
-
const
|
|
7100
|
-
text:
|
|
7122
|
+
const C = ((x = c[1]) == null ? void 0 : x.toLowerCase()) === "x", R = c[1] !== void 0 ? 4 : 3, M = this.extractRemainingHtml(s, R), D = this.getCaretOffset(s) - R, G = t.replace(o, "list", y({
|
|
7123
|
+
text: M,
|
|
7101
7124
|
style: "checklist",
|
|
7102
|
-
checked:
|
|
7125
|
+
checked: C
|
|
7103
7126
|
}, l > 0 ? { depth: l } : {}));
|
|
7104
|
-
this.setCaretAfterConversion(
|
|
7127
|
+
this.setCaretAfterConversion(G, D);
|
|
7105
7128
|
return;
|
|
7106
7129
|
}
|
|
7107
7130
|
if (F.UNORDERED_LIST_PATTERN.exec(i)) {
|
|
7108
|
-
const
|
|
7109
|
-
text:
|
|
7131
|
+
const R = this.extractRemainingHtml(s, 2), M = this.getCaretOffset(s) - 2, D = t.replace(o, "list", y({
|
|
7132
|
+
text: R,
|
|
7110
7133
|
style: "unordered",
|
|
7111
7134
|
checked: !1
|
|
7112
7135
|
}, l > 0 ? { depth: l } : {}));
|
|
7113
|
-
this.setCaretAfterConversion(D,
|
|
7136
|
+
this.setCaretAfterConversion(D, M);
|
|
7114
7137
|
return;
|
|
7115
7138
|
}
|
|
7116
7139
|
const h = F.ORDERED_LIST_PATTERN.exec(i);
|
|
7117
7140
|
if (!h)
|
|
7118
7141
|
return;
|
|
7119
|
-
const u = parseInt(h[1], 10), f = h[1].length + 2, p = this.extractRemainingHtml(s, f),
|
|
7142
|
+
const u = parseInt(h[1], 10), f = h[1].length + 2, p = this.extractRemainingHtml(s, f), k = this.getCaretOffset(s) - f, b = {
|
|
7120
7143
|
text: p,
|
|
7121
7144
|
style: "ordered",
|
|
7122
7145
|
checked: !1
|
|
7123
7146
|
};
|
|
7124
|
-
u !== 1 && (
|
|
7125
|
-
const B = t.replace(o, "list",
|
|
7126
|
-
this.setCaretAfterConversion(B,
|
|
7147
|
+
u !== 1 && (b.start = u), l > 0 && (b.depth = l);
|
|
7148
|
+
const B = t.replace(o, "list", b);
|
|
7149
|
+
this.setCaretAfterConversion(B, k);
|
|
7127
7150
|
}
|
|
7128
7151
|
/**
|
|
7129
7152
|
* Check if current block matches a header shortcut pattern and convert it.
|
|
@@ -7275,7 +7298,7 @@ const js = (a) => {
|
|
|
7275
7298
|
const { BlockManager: e, UI: o } = this.Blok, n = e.currentBlock;
|
|
7276
7299
|
if (n === void 0 || n.tool.isLineBreaksEnabled || o.someToolbarOpened && o.someFlipperButtonFocused || t.shiftKey && !oe)
|
|
7277
7300
|
return;
|
|
7278
|
-
const s = n.currentInput !== void 0 && Pt(n.currentInput) && !n.hasMedia ? (this.Blok.BlockManager.insertDefaultBlockAtIndex(this.Blok.BlockManager.currentBlockIndex), n) : n.currentInput &&
|
|
7301
|
+
const s = n.currentInput !== void 0 && Pt(n.currentInput) && !n.hasMedia ? (this.Blok.BlockManager.insertDefaultBlockAtIndex(this.Blok.BlockManager.currentBlockIndex), n) : n.currentInput && bt(n.currentInput) ? this.Blok.BlockManager.insertDefaultBlockAtIndex(this.Blok.BlockManager.currentBlockIndex + 1) : this.Blok.BlockManager.split();
|
|
7279
7302
|
this.Blok.Caret.setToBlock(s), this.Blok.Toolbar.moveAndOpen(s), t.preventDefault();
|
|
7280
7303
|
}
|
|
7281
7304
|
/**
|
|
@@ -7284,7 +7307,7 @@ const js = (a) => {
|
|
|
7284
7307
|
*/
|
|
7285
7308
|
backspace(t) {
|
|
7286
7309
|
const { BlockManager: e, Caret: o } = this.Blok, { currentBlock: n, previousBlock: s } = e;
|
|
7287
|
-
if (n === void 0 || !
|
|
7310
|
+
if (n === void 0 || !w.isCollapsed || !n.currentInput || !Pt(n.currentInput))
|
|
7288
7311
|
return;
|
|
7289
7312
|
if (t.preventDefault(), this.Blok.Toolbar.close(), !(n.currentInput === n.firstInput)) {
|
|
7290
7313
|
o.navigatePrevious();
|
|
@@ -7312,7 +7335,7 @@ const js = (a) => {
|
|
|
7312
7335
|
*/
|
|
7313
7336
|
delete(t) {
|
|
7314
7337
|
const { BlockManager: e, Caret: o } = this.Blok, { currentBlock: n, nextBlock: s } = e;
|
|
7315
|
-
if (n === void 0 || !
|
|
7338
|
+
if (n === void 0 || !w.isCollapsed || !n.currentInput || !bt(n.currentInput))
|
|
7316
7339
|
return;
|
|
7317
7340
|
if (t.preventDefault(), this.Blok.Toolbar.close(), !(n.currentInput === n.lastInput)) {
|
|
7318
7341
|
o.navigateNext();
|
|
@@ -7351,18 +7374,18 @@ const js = (a) => {
|
|
|
7351
7374
|
const e = this.getKeyCode(t);
|
|
7352
7375
|
if (e === null || ro(t, "down"))
|
|
7353
7376
|
return;
|
|
7354
|
-
const o =
|
|
7377
|
+
const o = Q.usedKeys.includes(e) && (!t.shiftKey || e === v.TAB);
|
|
7355
7378
|
if (this.Blok.UI.someToolbarOpened && o)
|
|
7356
7379
|
return;
|
|
7357
7380
|
t.shiftKey || (this.Blok.Toolbar.close(), this.Blok.InlineToolbar.close());
|
|
7358
|
-
const n =
|
|
7381
|
+
const n = w.get();
|
|
7359
7382
|
n != null && n.anchorNode && !this.Blok.BlockSelection.anyBlockSelected && this.Blok.BlockManager.setCurrentBlockByChildNode(n.anchorNode);
|
|
7360
7383
|
const { currentBlock: s } = this.Blok.BlockManager, i = t.target, r = document.activeElement instanceof HTMLElement ? document.activeElement : null, l = [
|
|
7361
|
-
s == null ? void 0 : s.inputs.find((
|
|
7362
|
-
s == null ? void 0 : s.inputs.find((
|
|
7384
|
+
s == null ? void 0 : s.inputs.find((C) => i !== null && C.contains(i)),
|
|
7385
|
+
s == null ? void 0 : s.inputs.find((C) => r !== null && C.contains(r)),
|
|
7363
7386
|
i == null ? void 0 : i.closest(Dt),
|
|
7364
7387
|
r == null ? void 0 : r.closest(Dt)
|
|
7365
|
-
], c = (x = s == null ? void 0 : s.currentInput) != null ? x : l.find((
|
|
7388
|
+
], c = (x = s == null ? void 0 : s.currentInput) != null ? x : l.find((C) => C instanceof HTMLElement), h = (c !== void 0 ? bt(c) : void 0) || this.Blok.BlockSelection.anyBlockSelected, u = t.shiftKey && e === v.DOWN;
|
|
7366
7389
|
if (u && h) {
|
|
7367
7390
|
this.Blok.CrossBlockSelection.toggleBlockSelectedState();
|
|
7368
7391
|
return;
|
|
@@ -7370,11 +7393,11 @@ const js = (a) => {
|
|
|
7370
7393
|
u && this.Blok.InlineToolbar.tryToShow();
|
|
7371
7394
|
const p = e === v.RIGHT && !t.shiftKey && !this.isRtl && c instanceof HTMLElement ? js(c) : null;
|
|
7372
7395
|
if (p !== null) {
|
|
7373
|
-
|
|
7396
|
+
w.setCursor(p.node, p.offset), t.preventDefault();
|
|
7374
7397
|
return;
|
|
7375
7398
|
}
|
|
7376
|
-
const
|
|
7377
|
-
if (
|
|
7399
|
+
const k = e === v.DOWN, b = e === v.RIGHT && !this.isRtl;
|
|
7400
|
+
if (k ? this.Blok.Caret.navigateVerticalNext() : b ? this.Blok.Caret.navigateNext() : !1) {
|
|
7378
7401
|
t.preventDefault();
|
|
7379
7402
|
return;
|
|
7380
7403
|
}
|
|
@@ -7387,9 +7410,9 @@ const js = (a) => {
|
|
|
7387
7410
|
* @param {KeyboardEvent} event - keyboard event
|
|
7388
7411
|
*/
|
|
7389
7412
|
arrowLeftAndUp(t) {
|
|
7390
|
-
var
|
|
7413
|
+
var b;
|
|
7391
7414
|
const e = this.Blok.UI.someToolbarOpened, o = this.getKeyCode(t);
|
|
7392
|
-
if (o === null || ro(t, "up") || e &&
|
|
7415
|
+
if (o === null || ro(t, "up") || e && Q.usedKeys.includes(o) && (!t.shiftKey || o === v.TAB))
|
|
7393
7416
|
return;
|
|
7394
7417
|
e && this.Blok.UI.closeAllToolbars(), t.shiftKey || (this.Blok.Toolbar.close(), this.Blok.InlineToolbar.close());
|
|
7395
7418
|
const n = window.getSelection();
|
|
@@ -7399,7 +7422,7 @@ const js = (a) => {
|
|
|
7399
7422
|
s == null ? void 0 : s.inputs.find((B) => r !== null && B.contains(r)),
|
|
7400
7423
|
i == null ? void 0 : i.closest(Dt),
|
|
7401
7424
|
r == null ? void 0 : r.closest(Dt)
|
|
7402
|
-
], c = (
|
|
7425
|
+
], c = (b = s == null ? void 0 : s.currentInput) != null ? b : l.find((B) => B instanceof HTMLElement), h = (c !== void 0 ? Pt(c) : void 0) || this.Blok.BlockSelection.anyBlockSelected, u = t.shiftKey && o === v.UP;
|
|
7403
7426
|
if (u && h) {
|
|
7404
7427
|
this.Blok.CrossBlockSelection.toggleBlockSelectedState(!1);
|
|
7405
7428
|
return;
|
|
@@ -7530,7 +7553,7 @@ class te {
|
|
|
7530
7553
|
fromIndex: e,
|
|
7531
7554
|
toIndex: t
|
|
7532
7555
|
});
|
|
7533
|
-
n.call(
|
|
7556
|
+
n.call(V.MOVED, s);
|
|
7534
7557
|
}
|
|
7535
7558
|
/**
|
|
7536
7559
|
* Insert new Block at passed index
|
|
@@ -7546,7 +7569,7 @@ class te {
|
|
|
7546
7569
|
const n = t > this.length ? this.length : t;
|
|
7547
7570
|
if (o) {
|
|
7548
7571
|
const r = this.blocks[n];
|
|
7549
|
-
r.call(
|
|
7572
|
+
r.call(V.REMOVED), r.destroy(), r.holder.remove();
|
|
7550
7573
|
}
|
|
7551
7574
|
const s = o ? 1 : 0;
|
|
7552
7575
|
if (this.blocks.splice(n, s, e), n > 0) {
|
|
@@ -7570,7 +7593,7 @@ class te {
|
|
|
7570
7593
|
if (this.blocks[t] === void 0)
|
|
7571
7594
|
throw Error("Incorrect index");
|
|
7572
7595
|
const o = this.blocks[t];
|
|
7573
|
-
o.holder.replaceWith(e.holder), o.call(
|
|
7596
|
+
o.holder.replaceWith(e.holder), o.call(V.REMOVED), this.blocks[t] = e, e.call(V.RENDERED);
|
|
7574
7597
|
}
|
|
7575
7598
|
/**
|
|
7576
7599
|
* Inserts several blocks at once
|
|
@@ -7582,14 +7605,14 @@ class te {
|
|
|
7582
7605
|
for (const n of t)
|
|
7583
7606
|
o.appendChild(n.holder);
|
|
7584
7607
|
if (!this.length) {
|
|
7585
|
-
this.blocks.push(...t), this.workingArea.appendChild(o), t.forEach((n) => n.call(
|
|
7608
|
+
this.blocks.push(...t), this.workingArea.appendChild(o), t.forEach((n) => n.call(V.RENDERED));
|
|
7586
7609
|
return;
|
|
7587
7610
|
}
|
|
7588
7611
|
if (e > 0) {
|
|
7589
7612
|
const n = Math.min(e - 1, this.length - 1);
|
|
7590
7613
|
this.blocks[n].holder.after(o);
|
|
7591
7614
|
}
|
|
7592
|
-
e === 0 && this.workingArea.prepend(o), this.blocks.splice(e, 0, ...t), t.forEach((n) => n.call(
|
|
7615
|
+
e === 0 && this.workingArea.prepend(o), this.blocks.splice(e, 0, ...t), t.forEach((n) => n.call(V.RENDERED));
|
|
7593
7616
|
}
|
|
7594
7617
|
/**
|
|
7595
7618
|
* Remove block
|
|
@@ -7597,13 +7620,13 @@ class te {
|
|
|
7597
7620
|
*/
|
|
7598
7621
|
remove(t) {
|
|
7599
7622
|
const e = isNaN(t) ? this.length - 1 : t, o = this.blocks[e];
|
|
7600
|
-
o.call(
|
|
7623
|
+
o.call(V.REMOVED), o.destroy(), o.holder.remove(), this.blocks.splice(e, 1);
|
|
7601
7624
|
}
|
|
7602
7625
|
/**
|
|
7603
7626
|
* Remove all blocks
|
|
7604
7627
|
*/
|
|
7605
7628
|
removeAll() {
|
|
7606
|
-
this.workingArea.innerHTML = "", this.blocks.forEach((t) => t.call(
|
|
7629
|
+
this.workingArea.innerHTML = "", this.blocks.forEach((t) => t.call(V.REMOVED)), this.blocks.length = 0;
|
|
7607
7630
|
}
|
|
7608
7631
|
/**
|
|
7609
7632
|
* Insert Block after passed target
|
|
@@ -7638,7 +7661,7 @@ class te {
|
|
|
7638
7661
|
* @param {Block} target — Block related to position
|
|
7639
7662
|
*/
|
|
7640
7663
|
insertToDOM(t, e, o) {
|
|
7641
|
-
e && o !== void 0 ? o.holder.insertAdjacentElement(e, t.holder) : this.workingArea.appendChild(t.holder), t.call(
|
|
7664
|
+
e && o !== void 0 ? o.holder.insertAdjacentElement(e, t.holder) : this.workingArea.appendChild(t.holder), t.call(V.RENDERED);
|
|
7642
7665
|
}
|
|
7643
7666
|
/**
|
|
7644
7667
|
* Composes Block event with passed type and details
|
|
@@ -7740,7 +7763,7 @@ const co = "blok-announcer", ei = [
|
|
|
7740
7763
|
};
|
|
7741
7764
|
K.instance = null, K.referenceCount = 0;
|
|
7742
7765
|
let gt = K;
|
|
7743
|
-
const
|
|
7766
|
+
const j = (a, t) => {
|
|
7744
7767
|
gt.getInstance().announce(a, t);
|
|
7745
7768
|
}, oi = () => {
|
|
7746
7769
|
gt.addReference(), gt.getInstance();
|
|
@@ -7883,6 +7906,7 @@ class si extends T {
|
|
|
7883
7906
|
* @param {BlockToolData} [options.data] - constructor params
|
|
7884
7907
|
* @param {string} [options.parentId] - parent block id for hierarchical structure
|
|
7885
7908
|
* @param {string[]} [options.contentIds] - array of child block ids
|
|
7909
|
+
* @param {number} [options.slot] - slot index within parent container
|
|
7886
7910
|
* @returns {Block}
|
|
7887
7911
|
*/
|
|
7888
7912
|
composeBlock({
|
|
@@ -7891,24 +7915,26 @@ class si extends T {
|
|
|
7891
7915
|
id: o = void 0,
|
|
7892
7916
|
tunes: n = {},
|
|
7893
7917
|
parentId: s,
|
|
7894
|
-
contentIds: i
|
|
7918
|
+
contentIds: i,
|
|
7919
|
+
slot: r
|
|
7895
7920
|
}) {
|
|
7896
|
-
const
|
|
7897
|
-
if (
|
|
7921
|
+
const l = this.Blok.ReadOnly.isEnabled, c = this.Blok.Tools.blockTools.get(t);
|
|
7922
|
+
if (c === void 0)
|
|
7898
7923
|
throw new Error(`Could not compose Block. Tool «${t}» not found.`);
|
|
7899
|
-
const
|
|
7924
|
+
const d = new xt({
|
|
7900
7925
|
id: o,
|
|
7901
7926
|
data: e,
|
|
7902
|
-
tool:
|
|
7927
|
+
tool: c,
|
|
7903
7928
|
api: this.Blok.API,
|
|
7904
|
-
readOnly:
|
|
7929
|
+
readOnly: l,
|
|
7905
7930
|
tunesData: n,
|
|
7906
7931
|
parentId: s,
|
|
7907
|
-
contentIds: i
|
|
7932
|
+
contentIds: i,
|
|
7933
|
+
slot: r
|
|
7908
7934
|
}, this.eventsDispatcher);
|
|
7909
|
-
return
|
|
7910
|
-
this.bindBlockEvents(
|
|
7911
|
-
}, { timeout: 2e3 }),
|
|
7935
|
+
return l || window.requestIdleCallback(() => {
|
|
7936
|
+
this.bindBlockEvents(d);
|
|
7937
|
+
}, { timeout: 2e3 }), d;
|
|
7912
7938
|
}
|
|
7913
7939
|
/**
|
|
7914
7940
|
* Insert new block into _blocks
|
|
@@ -8019,7 +8045,7 @@ class si extends T {
|
|
|
8019
8045
|
replace: o
|
|
8020
8046
|
});
|
|
8021
8047
|
try {
|
|
8022
|
-
await n.ready, n.call(
|
|
8048
|
+
await n.ready, n.call(V.ON_PASTE, e), n.refreshToolRootElement();
|
|
8023
8049
|
} catch (s) {
|
|
8024
8050
|
I(`${t}: onPaste callback call is failed`, "error", s);
|
|
8025
8051
|
}
|
|
@@ -8066,7 +8092,7 @@ class si extends T {
|
|
|
8066
8092
|
return;
|
|
8067
8093
|
}
|
|
8068
8094
|
if (n && s !== void 0) {
|
|
8069
|
-
const [r] =
|
|
8095
|
+
const [r] = ye(
|
|
8070
8096
|
[{
|
|
8071
8097
|
data: s,
|
|
8072
8098
|
tool: e.name
|
|
@@ -8206,7 +8232,7 @@ class si extends T {
|
|
|
8206
8232
|
const e = g.isElement(t) ? t : t.parentNode;
|
|
8207
8233
|
if (!e)
|
|
8208
8234
|
return;
|
|
8209
|
-
const o = this.blocksStore.nodes, n = e.closest(
|
|
8235
|
+
const o = this.blocksStore.nodes, n = e.closest(Y(m.element));
|
|
8210
8236
|
if (!n)
|
|
8211
8237
|
return;
|
|
8212
8238
|
const s = o.indexOf(n);
|
|
@@ -8223,10 +8249,10 @@ class si extends T {
|
|
|
8223
8249
|
const e = g.isElement(t) ? t : t.parentNode;
|
|
8224
8250
|
if (!e)
|
|
8225
8251
|
return;
|
|
8226
|
-
const o = e.closest(
|
|
8252
|
+
const o = e.closest(Y(m.element));
|
|
8227
8253
|
if (!o)
|
|
8228
8254
|
return;
|
|
8229
|
-
const n = o.closest(
|
|
8255
|
+
const n = o.closest(Y(m.editor));
|
|
8230
8256
|
if (!(n == null ? void 0 : n.isEqualNode(this.Blok.UI.nodes.wrapper)) || !(o instanceof HTMLElement))
|
|
8231
8257
|
return;
|
|
8232
8258
|
this.currentBlockIndex = this.blocksStore.nodes.indexOf(o);
|
|
@@ -8244,7 +8270,7 @@ class si extends T {
|
|
|
8244
8270
|
const e = g.isElement(t) ? t : t.parentNode;
|
|
8245
8271
|
if (!e)
|
|
8246
8272
|
return;
|
|
8247
|
-
const o = e.closest(
|
|
8273
|
+
const o = e.closest(Y(m.element));
|
|
8248
8274
|
if (o)
|
|
8249
8275
|
return this.blocks.find((n) => n.holder === o);
|
|
8250
8276
|
}
|
|
@@ -8321,7 +8347,7 @@ class si extends T {
|
|
|
8321
8347
|
moveCurrentBlockUp() {
|
|
8322
8348
|
const t = this.currentBlockIndex;
|
|
8323
8349
|
if (t <= 0) {
|
|
8324
|
-
|
|
8350
|
+
j(
|
|
8325
8351
|
this.Blok.I18n.t("a11y.atTop"),
|
|
8326
8352
|
{ politeness: "polite" }
|
|
8327
8353
|
);
|
|
@@ -8332,7 +8358,7 @@ class si extends T {
|
|
|
8332
8358
|
position: e,
|
|
8333
8359
|
total: o
|
|
8334
8360
|
});
|
|
8335
|
-
|
|
8361
|
+
j(n, { politeness: "assertive" });
|
|
8336
8362
|
}
|
|
8337
8363
|
/**
|
|
8338
8364
|
* Moves the current block down by one position
|
|
@@ -8341,7 +8367,7 @@ class si extends T {
|
|
|
8341
8367
|
moveCurrentBlockDown() {
|
|
8342
8368
|
const t = this.currentBlockIndex;
|
|
8343
8369
|
if (t < 0 || t >= this.blocksStore.length - 1) {
|
|
8344
|
-
|
|
8370
|
+
j(
|
|
8345
8371
|
this.Blok.I18n.t("a11y.atBottom"),
|
|
8346
8372
|
{ politeness: "polite" }
|
|
8347
8373
|
);
|
|
@@ -8352,7 +8378,7 @@ class si extends T {
|
|
|
8352
8378
|
position: e,
|
|
8353
8379
|
total: o
|
|
8354
8380
|
});
|
|
8355
|
-
|
|
8381
|
+
j(n, { politeness: "assertive" });
|
|
8356
8382
|
}
|
|
8357
8383
|
/**
|
|
8358
8384
|
* Refocuses the current block at the end position
|
|
@@ -8455,10 +8481,10 @@ class si extends T {
|
|
|
8455
8481
|
* @param detailData - additional data to pass with change event
|
|
8456
8482
|
*/
|
|
8457
8483
|
blockDidMutated(t, e, o) {
|
|
8458
|
-
const n =
|
|
8459
|
-
target: new
|
|
8484
|
+
const n = y({
|
|
8485
|
+
target: new W(e)
|
|
8460
8486
|
}, o), s = new CustomEvent(t, {
|
|
8461
|
-
detail:
|
|
8487
|
+
detail: y({}, n)
|
|
8462
8488
|
});
|
|
8463
8489
|
return Object.prototype.propertyIsEnumerable.call(s, "type") || Object.defineProperty(s, "type", {
|
|
8464
8490
|
value: t,
|
|
@@ -8468,14 +8494,14 @@ class si extends T {
|
|
|
8468
8494
|
value: n,
|
|
8469
8495
|
enumerable: !0,
|
|
8470
8496
|
configurable: !0
|
|
8471
|
-
}), this.eventsDispatcher.emit(
|
|
8497
|
+
}), this.eventsDispatcher.emit(yt, {
|
|
8472
8498
|
event: s
|
|
8473
8499
|
}), e;
|
|
8474
8500
|
}
|
|
8475
8501
|
}
|
|
8476
8502
|
class ii extends T {
|
|
8477
8503
|
constructor() {
|
|
8478
|
-
super(...arguments), this.anyBlockSelectedCache = null, this._navigationModeEnabled = !1, this.navigationFocusIndex = -1, this.needToSelectAll = !1, this.nativeInputSelected = !1, this.readyToBlockSelection = !1, this.selection = new
|
|
8504
|
+
super(...arguments), this.anyBlockSelectedCache = null, this._navigationModeEnabled = !1, this.navigationFocusIndex = -1, this.needToSelectAll = !1, this.nativeInputSelected = !1, this.readyToBlockSelection = !1, this.selection = new w();
|
|
8479
8505
|
}
|
|
8480
8506
|
/**
|
|
8481
8507
|
* Sanitizer Config
|
|
@@ -8562,7 +8588,7 @@ class ii extends T {
|
|
|
8562
8588
|
* to select all and copy them
|
|
8563
8589
|
*/
|
|
8564
8590
|
prepare() {
|
|
8565
|
-
this.selection = new
|
|
8591
|
+
this.selection = new w(), z.add({
|
|
8566
8592
|
name: "CMD+A",
|
|
8567
8593
|
handler: (t) => {
|
|
8568
8594
|
const { BlockManager: e, ReadOnly: o } = this.Blok;
|
|
@@ -8582,7 +8608,7 @@ class ii extends T {
|
|
|
8582
8608
|
* - Unselect all Blocks
|
|
8583
8609
|
*/
|
|
8584
8610
|
toggleReadOnly() {
|
|
8585
|
-
const t =
|
|
8611
|
+
const t = w.get();
|
|
8586
8612
|
t == null || t.removeAllRanges(), this.allBlocksSelected = !1;
|
|
8587
8613
|
}
|
|
8588
8614
|
/**
|
|
@@ -8602,7 +8628,7 @@ class ii extends T {
|
|
|
8602
8628
|
const { RectangleSelection: o } = this.Blok;
|
|
8603
8629
|
this.needToSelectAll = !1, this.nativeInputSelected = !1, this.readyToBlockSelection = !1, this._navigationModeEnabled && this.disableNavigationMode();
|
|
8604
8630
|
const n = t && t instanceof KeyboardEvent, s = t, i = n && s.key && s.key.length === 1;
|
|
8605
|
-
this.anyBlockSelected && n && i && !
|
|
8631
|
+
this.anyBlockSelected && n && i && !w.isSelectionExists && this.replaceSelectedBlocksWithPrintableKey(t), this.Blok.CrossBlockSelection.clear(t), e && this.selection.restore(), o.isRectActivated() && this.Blok.RectangleSelection.clearSelection(), this.anyBlockSelected && (this.allBlocksSelected = !1);
|
|
8606
8632
|
}
|
|
8607
8633
|
/**
|
|
8608
8634
|
* Reduce each Block and copy its content
|
|
@@ -8651,7 +8677,7 @@ class ii extends T {
|
|
|
8651
8677
|
*/
|
|
8652
8678
|
selectBlock(t) {
|
|
8653
8679
|
this.selection.save();
|
|
8654
|
-
const e =
|
|
8680
|
+
const e = w.get();
|
|
8655
8681
|
e == null || e.removeAllRanges();
|
|
8656
8682
|
const o = t;
|
|
8657
8683
|
o.selected = !0, this.clearCache(), this.Blok.InlineToolbar.close();
|
|
@@ -8726,7 +8752,7 @@ class ii extends T {
|
|
|
8726
8752
|
return;
|
|
8727
8753
|
const n = this.navigationFocusedBlock;
|
|
8728
8754
|
n && n.holder.removeAttribute("data-blok-navigation-focused"), this.navigationFocusIndex = t, o.holder.setAttribute("data-blok-navigation-focused", "true");
|
|
8729
|
-
const s =
|
|
8755
|
+
const s = w.get();
|
|
8730
8756
|
s == null || s.removeAllRanges(), document.activeElement instanceof HTMLElement && document.activeElement.blur(), o.holder.scrollIntoView({
|
|
8731
8757
|
behavior: "smooth",
|
|
8732
8758
|
block: "nearest"
|
|
@@ -8773,7 +8799,7 @@ class ii extends T {
|
|
|
8773
8799
|
*/
|
|
8774
8800
|
selectAllBlocks() {
|
|
8775
8801
|
this.selection.save();
|
|
8776
|
-
const t =
|
|
8802
|
+
const t = w.get();
|
|
8777
8803
|
t == null || t.removeAllRanges(), this.allBlocksSelected = !0, this.Blok.InlineToolbar.close();
|
|
8778
8804
|
}
|
|
8779
8805
|
/**
|
|
@@ -9006,7 +9032,7 @@ class Me extends T {
|
|
|
9006
9032
|
* @param {number} offset - offset
|
|
9007
9033
|
*/
|
|
9008
9034
|
set(t, e = 0) {
|
|
9009
|
-
const { top: n, bottom: s } =
|
|
9035
|
+
const { top: n, bottom: s } = w.setCursor(t, e), { innerHeight: i } = window;
|
|
9010
9036
|
if (n < 0) {
|
|
9011
9037
|
window.scrollBy(0, n - 30);
|
|
9012
9038
|
return;
|
|
@@ -9032,7 +9058,7 @@ class Me extends T {
|
|
|
9032
9058
|
*/
|
|
9033
9059
|
extractFragmentFromCaretPosition() {
|
|
9034
9060
|
var i;
|
|
9035
|
-
const t =
|
|
9061
|
+
const t = w.get();
|
|
9036
9062
|
if (!t || !t.rangeCount)
|
|
9037
9063
|
return;
|
|
9038
9064
|
const e = t.getRangeAt(0), o = this.Blok.BlockManager.currentBlock;
|
|
@@ -9058,7 +9084,7 @@ class Me extends T {
|
|
|
9058
9084
|
const { BlockManager: e } = this.Blok, { currentBlock: o, nextBlock: n } = e;
|
|
9059
9085
|
if (o === void 0)
|
|
9060
9086
|
return !1;
|
|
9061
|
-
const { nextInput: s, currentInput: i } = o, r = i !== void 0 ?
|
|
9087
|
+
const { nextInput: s, currentInput: i } = o, r = i !== void 0 ? bt(i) : void 0, l = t || r || !o.focusable;
|
|
9062
9088
|
if (s && l)
|
|
9063
9089
|
return this.setToInput(s, this.positions.START), !0;
|
|
9064
9090
|
const d = n !== null ? n : o.tool.isDefault || !l ? null : e.insertAtEnd();
|
|
@@ -9112,7 +9138,7 @@ class Me extends T {
|
|
|
9112
9138
|
return this.setToInputAtXPosition(r, i, !0), !0;
|
|
9113
9139
|
if (o !== null)
|
|
9114
9140
|
return this.setToBlockAtXPosition(o, i, !0), !0;
|
|
9115
|
-
const l = n !== void 0 ?
|
|
9141
|
+
const l = n !== void 0 ? bt(n) : !0;
|
|
9116
9142
|
if (!e.tool.isDefault && l) {
|
|
9117
9143
|
const c = t.insertAtEnd();
|
|
9118
9144
|
return this.setToBlock(c, this.positions.START), !0;
|
|
@@ -9155,7 +9181,7 @@ class Me extends T {
|
|
|
9155
9181
|
const e = t.querySelector('[data-blok-testid="shadow-caret"]');
|
|
9156
9182
|
if (!e)
|
|
9157
9183
|
return;
|
|
9158
|
-
new
|
|
9184
|
+
new w().expandToTag(e);
|
|
9159
9185
|
const n = document.createRange();
|
|
9160
9186
|
n.selectNode(e), n.extractContents();
|
|
9161
9187
|
}
|
|
@@ -9164,7 +9190,7 @@ class Me extends T {
|
|
|
9164
9190
|
* @param {string} content - content to insert
|
|
9165
9191
|
*/
|
|
9166
9192
|
insertContentAtCaretPosition(t) {
|
|
9167
|
-
const e = document.createDocumentFragment(), o = document.createElement("div"), n =
|
|
9193
|
+
const e = document.createDocumentFragment(), o = document.createElement("div"), n = w.get(), s = w.range;
|
|
9168
9194
|
if (!n || !s)
|
|
9169
9195
|
return;
|
|
9170
9196
|
o.innerHTML = t, Array.from(o.childNodes).forEach((c) => e.appendChild(c)), e.childNodes.length === 0 && e.appendChild(new Text());
|
|
@@ -9186,7 +9212,7 @@ class li extends T {
|
|
|
9186
9212
|
const i = o.getBlockByChildNode(e.relatedTarget) || this.lastSelectedBlock, r = o.getBlockByChildNode(e.target);
|
|
9187
9213
|
if (!(!i || !r) && r !== i) {
|
|
9188
9214
|
if (this.firstSelectedBlock && i === this.firstSelectedBlock) {
|
|
9189
|
-
(l =
|
|
9215
|
+
(l = w.get()) == null || l.removeAllRanges(), i.selected = !0, r.selected = !0, n.clearCache();
|
|
9190
9216
|
return;
|
|
9191
9217
|
}
|
|
9192
9218
|
if (this.firstSelectedBlock && r === this.firstSelectedBlock) {
|
|
@@ -9231,7 +9257,7 @@ class li extends T {
|
|
|
9231
9257
|
toggleBlockSelectedState(t = !0) {
|
|
9232
9258
|
var r;
|
|
9233
9259
|
const { BlockManager: e, BlockSelection: o } = this.Blok, n = e.currentBlock;
|
|
9234
|
-
if (!this.lastSelectedBlock && !n || (!this.lastSelectedBlock && n && (this.lastSelectedBlock = this.firstSelectedBlock = n), this.firstSelectedBlock === this.lastSelectedBlock && this.firstSelectedBlock && (this.firstSelectedBlock.selected = !0, o.clearCache(), (r =
|
|
9260
|
+
if (!this.lastSelectedBlock && !n || (!this.lastSelectedBlock && n && (this.lastSelectedBlock = this.firstSelectedBlock = n), this.firstSelectedBlock === this.lastSelectedBlock && this.firstSelectedBlock && (this.firstSelectedBlock.selected = !0, o.clearCache(), (r = w.get()) == null || r.removeAllRanges(), this.Blok.Toolbar.close()), !this.lastSelectedBlock))
|
|
9235
9261
|
return;
|
|
9236
9262
|
const s = e.blocks.indexOf(this.lastSelectedBlock) + (t ? 1 : -1), i = e.blocks[s];
|
|
9237
9263
|
i && (this.lastSelectedBlock.selected !== i.selected ? (i.selected = !0, o.clearCache(), this.Blok.Toolbar.close()) : (this.lastSelectedBlock.selected = !1, o.clearCache(), this.Blok.Toolbar.close()), this.lastSelectedBlock = i, this.Blok.InlineToolbar.close(), i.holder.scrollIntoView({
|
|
@@ -9272,7 +9298,7 @@ class li extends T {
|
|
|
9272
9298
|
*/
|
|
9273
9299
|
enableCrossBlockSelection(t) {
|
|
9274
9300
|
const { UI: e } = this.Blok;
|
|
9275
|
-
e.nodes.redactor && (
|
|
9301
|
+
e.nodes.redactor && (w.isCollapsed || this.Blok.BlockSelection.clearSelection(t), e.nodes.redactor.contains(t.target) ? this.watchSelection(t) : this.Blok.BlockSelection.clearSelection(t));
|
|
9276
9302
|
}
|
|
9277
9303
|
/**
|
|
9278
9304
|
* Change blocks selection state between passed two blocks.
|
|
@@ -9291,7 +9317,7 @@ class li extends T {
|
|
|
9291
9317
|
const Lt = {
|
|
9292
9318
|
base: "fixed pointer-events-none z-[10000] opacity-80 transition-none",
|
|
9293
9319
|
content: "relative mx-auto max-w-content"
|
|
9294
|
-
},
|
|
9320
|
+
}, tt = {
|
|
9295
9321
|
/** Offset from cursor to preview element */
|
|
9296
9322
|
previewOffsetX: 10,
|
|
9297
9323
|
previewOffsetY: 0,
|
|
@@ -9383,9 +9409,9 @@ class ci extends T {
|
|
|
9383
9409
|
*/
|
|
9384
9410
|
createPreview(t, e) {
|
|
9385
9411
|
const o = g.make("div", Lt.base), n = t.cloneNode(!0);
|
|
9386
|
-
n.className =
|
|
9412
|
+
n.className = S(Lt.content, e ? "max-w-none" : "");
|
|
9387
9413
|
const s = n.firstElementChild;
|
|
9388
|
-
return s && (s.className =
|
|
9414
|
+
return s && (s.className = S(s.className, "!m-0")), o.appendChild(n), o;
|
|
9389
9415
|
}
|
|
9390
9416
|
/**
|
|
9391
9417
|
* Creates a stacked preview element for multiple blocks
|
|
@@ -9419,9 +9445,9 @@ class ci extends T {
|
|
|
9419
9445
|
if (!d.element)
|
|
9420
9446
|
return;
|
|
9421
9447
|
const h = d.element.cloneNode(!0);
|
|
9422
|
-
h.className =
|
|
9448
|
+
h.className = S(Lt.content, l.stretched ? "max-w-none" : "");
|
|
9423
9449
|
const u = h.firstElementChild;
|
|
9424
|
-
u && (u.className =
|
|
9450
|
+
u && (u.className = S(u.className, "!m-0")), h.style.position = "absolute", h.style.top = `${n[c]}px`, h.style.left = "0", h.style.zIndex = `${t.length - c}`, e.appendChild(h);
|
|
9425
9451
|
}), e.style.width = `${s}px`, e.style.height = `${r}px`, e;
|
|
9426
9452
|
}
|
|
9427
9453
|
/**
|
|
@@ -9432,7 +9458,7 @@ class ci extends T {
|
|
|
9432
9458
|
if (!this.dragState)
|
|
9433
9459
|
return;
|
|
9434
9460
|
const { startX: e, startY: o, isDragging: n, previewElement: s } = this.dragState, i = t.clientX - e, r = t.clientY - o, l = Math.sqrt(i * i + r * r);
|
|
9435
|
-
!n && l >=
|
|
9461
|
+
!n && l >= tt.dragThreshold && this.startDrag(), s.style.left = `${t.clientX + tt.previewOffsetX}px`, s.style.top = `${t.clientY + tt.previewOffsetY}px`, this.updateDropTarget(t.clientX, t.clientY), this.handleAutoScroll(t.clientY);
|
|
9436
9462
|
}
|
|
9437
9463
|
/**
|
|
9438
9464
|
* Starts the actual drag operation
|
|
@@ -9452,9 +9478,9 @@ class ci extends T {
|
|
|
9452
9478
|
const t = this.dragState.sourceBlocks.length;
|
|
9453
9479
|
if (t > 1) {
|
|
9454
9480
|
const e = this.Blok.I18n.t("a11y.dragStartedMultiple", { count: t });
|
|
9455
|
-
|
|
9481
|
+
j(e, { politeness: "assertive" });
|
|
9456
9482
|
} else
|
|
9457
|
-
|
|
9483
|
+
j(
|
|
9458
9484
|
this.Blok.I18n.t("a11y.dragStarted"),
|
|
9459
9485
|
{ politeness: "assertive" }
|
|
9460
9486
|
);
|
|
@@ -9519,8 +9545,8 @@ class ci extends T {
|
|
|
9519
9545
|
position: n + 1,
|
|
9520
9546
|
total: s
|
|
9521
9547
|
});
|
|
9522
|
-
|
|
9523
|
-
},
|
|
9548
|
+
j(i, { politeness: "polite" });
|
|
9549
|
+
}, tt.announcementThrottleMs)));
|
|
9524
9550
|
}
|
|
9525
9551
|
/**
|
|
9526
9552
|
* Finds the scrollable ancestor of an element
|
|
@@ -9544,13 +9570,13 @@ class ci extends T {
|
|
|
9544
9570
|
if (!this.dragState)
|
|
9545
9571
|
return;
|
|
9546
9572
|
this.dragState.autoScrollInterval !== null && (cancelAnimationFrame(this.dragState.autoScrollInterval), this.dragState.autoScrollInterval = null);
|
|
9547
|
-
const e = window.innerHeight, o = t <
|
|
9573
|
+
const e = window.innerHeight, o = t < tt.autoScrollZone, n = t > e - tt.autoScrollZone;
|
|
9548
9574
|
if (!o && !n)
|
|
9549
9575
|
return;
|
|
9550
9576
|
const { scrollContainer: s } = this.dragState, i = () => {
|
|
9551
9577
|
if (!this.dragState || !this.dragState.isDragging)
|
|
9552
9578
|
return;
|
|
9553
|
-
const l = (o ? -1 : 1) *
|
|
9579
|
+
const l = (o ? -1 : 1) * tt.autoScrollSpeed;
|
|
9554
9580
|
s ? s.scrollTop += l : window.scrollBy(0, l), this.dragState.autoScrollInterval = requestAnimationFrame(i);
|
|
9555
9581
|
};
|
|
9556
9582
|
this.dragState.autoScrollInterval = requestAnimationFrame(i);
|
|
@@ -9660,13 +9686,13 @@ class ci extends T {
|
|
|
9660
9686
|
count: n,
|
|
9661
9687
|
position: o + 1
|
|
9662
9688
|
});
|
|
9663
|
-
|
|
9689
|
+
j(s, { politeness: "assertive" });
|
|
9664
9690
|
} else {
|
|
9665
9691
|
const s = this.Blok.BlockManager.blocks.length, i = this.Blok.I18n.t("a11y.blockDuplicated", {
|
|
9666
9692
|
position: o + 1,
|
|
9667
9693
|
total: s
|
|
9668
9694
|
});
|
|
9669
|
-
|
|
9695
|
+
j(i, { politeness: "assertive" });
|
|
9670
9696
|
}
|
|
9671
9697
|
}
|
|
9672
9698
|
/**
|
|
@@ -9682,13 +9708,13 @@ class ci extends T {
|
|
|
9682
9708
|
count: e.length,
|
|
9683
9709
|
position: n + 1
|
|
9684
9710
|
});
|
|
9685
|
-
|
|
9711
|
+
j(i, { politeness: "assertive" });
|
|
9686
9712
|
} else {
|
|
9687
9713
|
const i = this.Blok.I18n.t("a11y.blockMoved", {
|
|
9688
9714
|
position: n + 1,
|
|
9689
9715
|
total: s
|
|
9690
9716
|
});
|
|
9691
|
-
|
|
9717
|
+
j(i, { politeness: "assertive" });
|
|
9692
9718
|
}
|
|
9693
9719
|
}
|
|
9694
9720
|
/**
|
|
@@ -9750,7 +9776,7 @@ class ci extends T {
|
|
|
9750
9776
|
cleanup(t = !1) {
|
|
9751
9777
|
if (!this.dragState)
|
|
9752
9778
|
return;
|
|
9753
|
-
t && this.dragState.isDragging &&
|
|
9779
|
+
t && this.dragState.isDragging && j(
|
|
9754
9780
|
this.Blok.I18n.t("a11y.dropCancelled"),
|
|
9755
9781
|
{ politeness: "polite" }
|
|
9756
9782
|
), this.dragState.autoScrollInterval !== null && cancelAnimationFrame(this.dragState.autoScrollInterval), this.dragState.announcementTimeoutId !== null && clearTimeout(this.dragState.announcementTimeoutId), this.dragState.targetBlock && (this.dragState.targetBlock.holder.removeAttribute("data-drop-indicator"), this.dragState.targetBlock.holder.style.removeProperty("--drop-indicator-depth")), this.dragState.previewElement.parentNode && this.dragState.previewElement.remove();
|
|
@@ -9818,7 +9844,7 @@ class ci extends T {
|
|
|
9818
9844
|
* @returns Object with block and holder, or nulls if no valid target found
|
|
9819
9845
|
*/
|
|
9820
9846
|
findDropTargetBlock(t, e, o) {
|
|
9821
|
-
const n = t.closest(
|
|
9847
|
+
const n = t.closest(Y(m.element));
|
|
9822
9848
|
if (n)
|
|
9823
9849
|
return { block: this.Blok.BlockManager.blocks.find((r) => r.holder === n), holder: n };
|
|
9824
9850
|
const s = this.findBlockInLeftDropZone(e, o);
|
|
@@ -9834,7 +9860,7 @@ class ci extends T {
|
|
|
9834
9860
|
findBlockInLeftDropZone(t, e) {
|
|
9835
9861
|
var i;
|
|
9836
9862
|
const s = this.Blok.UI.contentRect.left - t;
|
|
9837
|
-
if (s < 0 || s >
|
|
9863
|
+
if (s < 0 || s > tt.leftDropZone)
|
|
9838
9864
|
return null;
|
|
9839
9865
|
for (const r of this.Blok.BlockManager.blocks) {
|
|
9840
9866
|
if ((i = this.dragState) != null && i.sourceBlocks.includes(r))
|
|
@@ -9865,9 +9891,9 @@ class di extends T {
|
|
|
9865
9891
|
eventsDispatcher: e
|
|
9866
9892
|
}), this.disabled = !1, this.batchingTimeout = null, this.batchingOnChangeQueue = /* @__PURE__ */ new Map(), this.batchTime = an, this.mutationObserver = new MutationObserver((o) => {
|
|
9867
9893
|
this.redactorChanged(o);
|
|
9868
|
-
}), this.eventsDispatcher.on(
|
|
9894
|
+
}), this.eventsDispatcher.on(yt, (o) => {
|
|
9869
9895
|
this.particularBlockChanged(o.event);
|
|
9870
|
-
}), this.eventsDispatcher.on(
|
|
9896
|
+
}), this.eventsDispatcher.on(wo, () => {
|
|
9871
9897
|
this.disable();
|
|
9872
9898
|
}), this.eventsDispatcher.on(xo, () => {
|
|
9873
9899
|
this.enable();
|
|
@@ -10022,18 +10048,14 @@ const uo = /* @__PURE__ */ new Set([
|
|
|
10022
10048
|
return;
|
|
10023
10049
|
}
|
|
10024
10050
|
const n = t.getData(this.MIME_TYPE), s = t.getData("text/plain"), r = t.getData("text/html");
|
|
10025
|
-
if (n)
|
|
10026
|
-
|
|
10027
|
-
this.insertBlokData(JSON.parse(n));
|
|
10028
|
-
return;
|
|
10029
|
-
} catch (p) {
|
|
10030
|
-
}
|
|
10051
|
+
if (n && await this.handleBlokDataPaste(n, s))
|
|
10052
|
+
return;
|
|
10031
10053
|
const l = Object.fromEntries(
|
|
10032
10054
|
Object.keys(this.toolsTags).map((p) => {
|
|
10033
|
-
var
|
|
10055
|
+
var k;
|
|
10034
10056
|
return [
|
|
10035
10057
|
p.toLowerCase(),
|
|
10036
|
-
(
|
|
10058
|
+
(k = this.toolsTags[p].sanitizationConfig) != null ? k : {}
|
|
10037
10059
|
];
|
|
10038
10060
|
})
|
|
10039
10061
|
), c = e.getAllInlineToolsSanitizeConfig(), d = Te(
|
|
@@ -10044,6 +10066,31 @@ const uo = /* @__PURE__ */ new Set([
|
|
|
10044
10066
|
), h = Z(r, d), u = g.isHTMLString(h);
|
|
10045
10067
|
!h.trim() || h.trim() === s || !u ? await this.processText(s) : await this.processText(h, !0);
|
|
10046
10068
|
}
|
|
10069
|
+
/**
|
|
10070
|
+
* Handles pasting of Blok JSON data, with pattern matching priority.
|
|
10071
|
+
* For plain text that might match a pattern (like URLs), tries pattern matching first.
|
|
10072
|
+
* This handles the case where text is cut and pasted within the same editor -
|
|
10073
|
+
* we want pattern matching to still work for things like embed URLs.
|
|
10074
|
+
* @param blokData - serialized Blok JSON data
|
|
10075
|
+
* @param plainData - plain text content from clipboard
|
|
10076
|
+
* @returns true if paste was handled, false otherwise
|
|
10077
|
+
*/
|
|
10078
|
+
async handleBlokDataPaste(t, e) {
|
|
10079
|
+
try {
|
|
10080
|
+
const o = JSON.parse(t), s = e && this.toolsPatterns.length > 0 ? await this.processPattern(e) : void 0;
|
|
10081
|
+
return s ? (await this.insertPatternMatch(s), !0) : (this.insertBlokData(o), !0);
|
|
10082
|
+
} catch (o) {
|
|
10083
|
+
return !1;
|
|
10084
|
+
}
|
|
10085
|
+
}
|
|
10086
|
+
/**
|
|
10087
|
+
* Inserts a matched pattern as a new block
|
|
10088
|
+
* @param patternResult - the matched pattern with tool and event
|
|
10089
|
+
*/
|
|
10090
|
+
async insertPatternMatch(t) {
|
|
10091
|
+
const { BlockManager: e, Caret: o } = this.Blok, n = e.currentBlock && e.currentBlock.tool.isDefault && e.currentBlock.isEmpty, s = await e.paste(t.tool, t.event, n);
|
|
10092
|
+
o.setToBlock(s, o.positions.END);
|
|
10093
|
+
}
|
|
10047
10094
|
/**
|
|
10048
10095
|
* Process pasted text and divide them into Blocks
|
|
10049
10096
|
* @param {string} data - text to process. Can be HTML or plain.
|
|
@@ -10183,8 +10230,8 @@ const uo = /* @__PURE__ */ new Set([
|
|
|
10183
10230
|
async processFile(t) {
|
|
10184
10231
|
const e = cn(t), o = Object.entries(this.toolsFiles).find(([i, { mimeTypes: r, extensions: l }]) => {
|
|
10185
10232
|
const [c, d] = t.type.split("/"), h = l.find((f) => f.toLowerCase() === e.toLowerCase()), u = r.find((f) => {
|
|
10186
|
-
const [p,
|
|
10187
|
-
return p === c && (
|
|
10233
|
+
const [p, k] = f.split("/");
|
|
10234
|
+
return p === c && (k === d || k === "*");
|
|
10188
10235
|
});
|
|
10189
10236
|
return h !== void 0 || u !== void 0;
|
|
10190
10237
|
});
|
|
@@ -10206,7 +10253,7 @@ const uo = /* @__PURE__ */ new Set([
|
|
|
10206
10253
|
processHTML(t) {
|
|
10207
10254
|
const { Tools: e } = this.Blok, o = g.make("DIV");
|
|
10208
10255
|
return o.innerHTML = t, this.getNodes(o).map((s) => {
|
|
10209
|
-
var
|
|
10256
|
+
var b;
|
|
10210
10257
|
const i = (() => {
|
|
10211
10258
|
var B;
|
|
10212
10259
|
switch (s.nodeType) {
|
|
@@ -10219,10 +10266,10 @@ const uo = /* @__PURE__ */ new Set([
|
|
|
10219
10266
|
};
|
|
10220
10267
|
}
|
|
10221
10268
|
case Node.ELEMENT_NODE: {
|
|
10222
|
-
const x = s,
|
|
10269
|
+
const x = s, C = this.toolsTags[x.tagName];
|
|
10223
10270
|
return {
|
|
10224
10271
|
content: x,
|
|
10225
|
-
tool: (B =
|
|
10272
|
+
tool: (B = C == null ? void 0 : C.tool) != null ? B : e.defaultTool,
|
|
10226
10273
|
isBlock: !0
|
|
10227
10274
|
};
|
|
10228
10275
|
}
|
|
@@ -10232,30 +10279,30 @@ const uo = /* @__PURE__ */ new Set([
|
|
|
10232
10279
|
})();
|
|
10233
10280
|
if (!i)
|
|
10234
10281
|
return null;
|
|
10235
|
-
const { content: r, tool: l, isBlock: c } = i, h = (l.pasteConfig === !1 ? [] : ((
|
|
10236
|
-
const
|
|
10237
|
-
return
|
|
10238
|
-
const D = A(x) ? x[
|
|
10239
|
-
M
|
|
10240
|
-
}),
|
|
10282
|
+
const { content: r, tool: l, isBlock: c } = i, h = (l.pasteConfig === !1 ? [] : ((b = l.pasteConfig) == null ? void 0 : b.tags) || []).reduce((B, x) => {
|
|
10283
|
+
const C = this.collectTagNames(x), R = y({}, B);
|
|
10284
|
+
return C.forEach((M) => {
|
|
10285
|
+
const D = A(x) ? x[M] : null;
|
|
10286
|
+
R[M.toLowerCase()] = D != null ? D : {};
|
|
10287
|
+
}), R;
|
|
10241
10288
|
}, {}), u = this.getStructuralTagsSanitizeConfig(r), f = Object.assign({}, u, h, l.baseSanitizeConfig), p = (() => {
|
|
10242
10289
|
if (r.tagName.toLowerCase() !== "table")
|
|
10243
10290
|
return r.innerHTML = Z(r.innerHTML, f), r;
|
|
10244
|
-
const B = Z(r.outerHTML, f),
|
|
10291
|
+
const B = Z(r.outerHTML, f), C = g.make("div", void 0, {
|
|
10245
10292
|
innerHTML: B
|
|
10246
10293
|
}).firstChild;
|
|
10247
|
-
return !
|
|
10294
|
+
return !C || !(C instanceof HTMLElement) ? null : C;
|
|
10248
10295
|
})();
|
|
10249
10296
|
if (!p)
|
|
10250
10297
|
return null;
|
|
10251
|
-
const
|
|
10298
|
+
const k = this.composePasteEvent("tag", {
|
|
10252
10299
|
data: p
|
|
10253
10300
|
});
|
|
10254
10301
|
return {
|
|
10255
10302
|
content: p,
|
|
10256
10303
|
isBlock: c,
|
|
10257
10304
|
tool: l.name,
|
|
10258
|
-
event:
|
|
10305
|
+
event: k
|
|
10259
10306
|
};
|
|
10260
10307
|
}).filter((s) => {
|
|
10261
10308
|
if (!s)
|
|
@@ -10364,7 +10411,7 @@ const uo = /* @__PURE__ */ new Set([
|
|
|
10364
10411
|
*/
|
|
10365
10412
|
insertBlokData(t) {
|
|
10366
10413
|
const { BlockManager: e, Caret: o, Tools: n } = this.Blok;
|
|
10367
|
-
|
|
10414
|
+
ye(
|
|
10368
10415
|
t,
|
|
10369
10416
|
(i) => {
|
|
10370
10417
|
var r, l;
|
|
@@ -10388,11 +10435,11 @@ const uo = /* @__PURE__ */ new Set([
|
|
|
10388
10435
|
* @param {Node} destNode - destination node
|
|
10389
10436
|
*/
|
|
10390
10437
|
processElementNode(t, e, o) {
|
|
10391
|
-
var p,
|
|
10392
|
-
const n = Object.keys(this.toolsTags), s = t, i = this.toolsTags[s.tagName], r = i == null ? void 0 : i.tool, l = (
|
|
10393
|
-
({ tagName:
|
|
10438
|
+
var p, k;
|
|
10439
|
+
const n = Object.keys(this.toolsTags), s = t, i = this.toolsTags[s.tagName], r = i == null ? void 0 : i.tool, l = (k = this.tagsByTool[(p = r == null ? void 0 : r.name) != null ? p : ""]) != null ? k : [], c = n.includes(s.tagName), d = g.blockElements.includes(s.tagName.toLowerCase()), h = uo.has(s.tagName.toLowerCase()), u = Array.from(s.children).some(
|
|
10440
|
+
({ tagName: b }) => n.includes(b) && !l.includes(b)
|
|
10394
10441
|
), f = Array.from(s.children).some(
|
|
10395
|
-
({ tagName:
|
|
10442
|
+
({ tagName: b }) => g.blockElements.includes(b.toLowerCase())
|
|
10396
10443
|
);
|
|
10397
10444
|
if (!d && !c && !u)
|
|
10398
10445
|
return o.appendChild(s), [...e, o];
|
|
@@ -10485,7 +10532,7 @@ class hi extends T {
|
|
|
10485
10532
|
* Throws an error about tools which don't support read-only mode
|
|
10486
10533
|
*/
|
|
10487
10534
|
throwCriticalError() {
|
|
10488
|
-
throw new
|
|
10535
|
+
throw new kt(
|
|
10489
10536
|
`To enable read-only mode all connected tools should support it. Tools ${this.toolsDontSupportReadOnly.join(", ")} don't support read-only mode.`
|
|
10490
10537
|
);
|
|
10491
10538
|
}
|
|
@@ -10529,12 +10576,12 @@ class ui extends T {
|
|
|
10529
10576
|
if (!(l >= i.top && l <= i.bottom))
|
|
10530
10577
|
return;
|
|
10531
10578
|
const d = this.getScrollLeft(), h = document.elementFromPoint(t - d, l);
|
|
10532
|
-
!h || (!h.closest(
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10579
|
+
!h || (!h.closest(Y(m.toolbar)) && !o && (this.Blok.BlockSelection.allBlocksSelected = !1, this.clearSelection(), this.stackOfSelected = []), [
|
|
10580
|
+
Y(m.elementContent),
|
|
10581
|
+
Y(m.toolbar),
|
|
10582
|
+
Y(m.popover),
|
|
10536
10583
|
dn
|
|
10537
|
-
].some((
|
|
10584
|
+
].some((k) => !!h.closest(k))) || (this.Blok.Toolbar.close(), this.mousedown = !0, this.startX = t, this.startY = e);
|
|
10538
10585
|
}
|
|
10539
10586
|
/**
|
|
10540
10587
|
* Clear all params to end selection
|
|
@@ -10628,7 +10675,7 @@ class ui extends T {
|
|
|
10628
10675
|
* @returns {Record<string, Element>}
|
|
10629
10676
|
*/
|
|
10630
10677
|
genHTML() {
|
|
10631
|
-
const { UI: t } = this.Blok, e = t.nodes.holder.querySelector(
|
|
10678
|
+
const { UI: t } = this.Blok, e = t.nodes.holder.querySelector(Y(m.editor)), o = g.make("div", [
|
|
10632
10679
|
"fixed",
|
|
10633
10680
|
"inset-0",
|
|
10634
10681
|
"z-overlay",
|
|
@@ -10685,7 +10732,7 @@ class ui extends T {
|
|
|
10685
10732
|
if (this.updateRectangleSize(), this.Blok.Toolbar.close(), o === void 0)
|
|
10686
10733
|
return;
|
|
10687
10734
|
this.trySelectNextBlock(o), this.inverseSelection();
|
|
10688
|
-
const s =
|
|
10735
|
+
const s = w.get();
|
|
10689
10736
|
s && s.removeAllRanges();
|
|
10690
10737
|
}
|
|
10691
10738
|
/**
|
|
@@ -10730,7 +10777,7 @@ class ui extends T {
|
|
|
10730
10777
|
*/
|
|
10731
10778
|
genInfoForMouseSelection() {
|
|
10732
10779
|
var p;
|
|
10733
|
-
const e = document.body.offsetWidth / 2, o = this.getScrollTop(), n = this.mouseY - o, s = document.elementFromPoint(e, n), i = (p = this.Blok.BlockManager.lastBlock) == null ? void 0 : p.holder, r = i == null ? void 0 : i.querySelector(
|
|
10780
|
+
const e = document.body.offsetWidth / 2, o = this.getScrollTop(), n = this.mouseY - o, s = document.elementFromPoint(e, n), i = (p = this.Blok.BlockManager.lastBlock) == null ? void 0 : p.holder, r = i == null ? void 0 : i.querySelector(Y(m.elementContent)), c = (r ? Number.parseInt(window.getComputedStyle(r).width, 10) : 0) / 2, d = e - c, h = e + c;
|
|
10734
10781
|
if (!s)
|
|
10735
10782
|
return {
|
|
10736
10783
|
index: void 0,
|
|
@@ -10739,7 +10786,7 @@ class ui extends T {
|
|
|
10739
10786
|
};
|
|
10740
10787
|
const u = this.Blok.BlockManager.getBlockByChildNode(s);
|
|
10741
10788
|
return {
|
|
10742
|
-
index: u !== void 0 ? this.Blok.BlockManager.blocks.findIndex((
|
|
10789
|
+
index: u !== void 0 ? this.Blok.BlockManager.blocks.findIndex((k) => k.holder === u.holder) : void 0,
|
|
10743
10790
|
leftPos: d,
|
|
10744
10791
|
rightPos: h
|
|
10745
10792
|
};
|
|
@@ -10776,15 +10823,15 @@ class ui extends T {
|
|
|
10776
10823
|
const s = this.stackOfSelected[e - 2], i = s !== void 0 && o !== void 0 ? o - s > 0 : !1, r = e <= 1, l = o !== void 0 && t > o && i, c = o !== void 0 && t < o && e > 1 && !i, h = !(l || c || r);
|
|
10777
10824
|
if (!h && (o === void 0 || t > o)) {
|
|
10778
10825
|
const p = o !== void 0 ? o + 1 : t;
|
|
10779
|
-
Array.from({ length: t - p + 1 }, (
|
|
10780
|
-
this.addBlockInSelection(
|
|
10826
|
+
Array.from({ length: t - p + 1 }, (k, b) => p + b).forEach((k) => {
|
|
10827
|
+
this.addBlockInSelection(k);
|
|
10781
10828
|
});
|
|
10782
10829
|
return;
|
|
10783
10830
|
}
|
|
10784
10831
|
if (!h && o !== void 0 && t < o) {
|
|
10785
10832
|
Array.from(
|
|
10786
10833
|
{ length: o - t },
|
|
10787
|
-
(p,
|
|
10834
|
+
(p, k) => o - 1 - k
|
|
10788
10835
|
).forEach((p) => {
|
|
10789
10836
|
this.addBlockInSelection(p);
|
|
10790
10837
|
});
|
|
@@ -10807,15 +10854,15 @@ const pi = (a) => typeof a == "object" && "text" in a && !("content" in a), _o =
|
|
|
10807
10854
|
}), De = (a) => {
|
|
10808
10855
|
var t;
|
|
10809
10856
|
return a.type === "list" && Array.isArray((t = a.data) == null ? void 0 : t.items);
|
|
10810
|
-
}, gi = (a) => De(a) ? fi(a.data.items) : !1, mi = (a) => a.parent !== void 0 || a.content !== void 0 && a.content.length > 0,
|
|
10857
|
+
}, gi = (a) => De(a) ? fi(a.data.items) : !1, mi = (a) => a.parent !== void 0 || a.content !== void 0 && a.content.length > 0, ki = (a) => a.some(mi) ? { format: "hierarchical", hasHierarchy: !0 } : a.some(De) ? { format: "legacy", hasHierarchy: a.some(gi) } : { format: "flat", hasHierarchy: !1 }, zo = (a, t, e, o, n, s, i) => {
|
|
10811
10858
|
const r = [];
|
|
10812
10859
|
return a.forEach((l, c) => {
|
|
10813
10860
|
const d = _o(l), h = ve();
|
|
10814
10861
|
r.push(h);
|
|
10815
|
-
const u = o === "ordered" && e === 0 && c === 0 && n !== void 0 && n !== 1, f = d.items && d.items.length > 0, p =
|
|
10862
|
+
const u = o === "ordered" && e === 0 && c === 0 && n !== void 0 && n !== 1, f = d.items && d.items.length > 0, p = y(y({
|
|
10816
10863
|
id: h,
|
|
10817
10864
|
type: "list",
|
|
10818
|
-
data:
|
|
10865
|
+
data: y(y({
|
|
10819
10866
|
text: d.content,
|
|
10820
10867
|
checked: d.checked,
|
|
10821
10868
|
style: o
|
|
@@ -10823,10 +10870,10 @@ const pi = (a) => typeof a == "object" && "text" in a && !("content" in a), _o =
|
|
|
10823
10870
|
}, s !== void 0 ? { tunes: s } : {}), t !== void 0 ? { parent: t } : {});
|
|
10824
10871
|
if (i.push(p), !f)
|
|
10825
10872
|
return;
|
|
10826
|
-
const
|
|
10827
|
-
|
|
10873
|
+
const k = zo(d.items, h, e + 1, o, void 0, s, i);
|
|
10874
|
+
k.length > 0 && (p.content = k);
|
|
10828
10875
|
}), r;
|
|
10829
|
-
},
|
|
10876
|
+
}, bi = (a, t) => {
|
|
10830
10877
|
const e = [], o = a.style, n = a.start;
|
|
10831
10878
|
return zo(a.items, void 0, 0, o, n, t, e), e;
|
|
10832
10879
|
}, vi = (a) => {
|
|
@@ -10834,10 +10881,10 @@ const pi = (a) => typeof a == "object" && "text" in a && !("content" in a), _o =
|
|
|
10834
10881
|
const t = [];
|
|
10835
10882
|
for (const o of a)
|
|
10836
10883
|
if (De(o)) {
|
|
10837
|
-
const n = o.data, s =
|
|
10884
|
+
const n = o.data, s = bi(n, o.tunes);
|
|
10838
10885
|
t.push(...s);
|
|
10839
10886
|
} else
|
|
10840
|
-
t.push(
|
|
10887
|
+
t.push(P(y({}, o), {
|
|
10841
10888
|
id: (e = o.id) != null ? e : ve()
|
|
10842
10889
|
}));
|
|
10843
10890
|
return t;
|
|
@@ -10846,7 +10893,7 @@ const pi = (a) => typeof a == "object" && "text" in a && !("content" in a), _o =
|
|
|
10846
10893
|
}, po = (a) => {
|
|
10847
10894
|
const n = a, { parent: t, content: e } = n;
|
|
10848
10895
|
return jt(n, ["parent", "content"]);
|
|
10849
|
-
},
|
|
10896
|
+
}, yi = (a, t, e) => {
|
|
10850
10897
|
const o = [];
|
|
10851
10898
|
for (const n of a) {
|
|
10852
10899
|
const s = t.get(n);
|
|
@@ -10864,14 +10911,14 @@ const pi = (a) => typeof a == "object" && "text" in a && !("content" in a), _o =
|
|
|
10864
10911
|
content: ((r = a.data) == null ? void 0 : r.text) || "",
|
|
10865
10912
|
checked: (l = a.data) == null ? void 0 : l.checked
|
|
10866
10913
|
};
|
|
10867
|
-
return a.content && a.content.length > 0 && (n.items =
|
|
10868
|
-
},
|
|
10914
|
+
return a.content && a.content.length > 0 && (n.items = yi(a.content, t, e)), n.items !== void 0 && n.items.length === 0 && delete n.items, o.push(n), o;
|
|
10915
|
+
}, wi = (a, t, e) => {
|
|
10869
10916
|
var r, l;
|
|
10870
10917
|
const o = Uo(a, t, e), n = ((r = a.data) == null ? void 0 : r.style) || "unordered", s = (l = a.data) == null ? void 0 : l.start;
|
|
10871
|
-
return
|
|
10918
|
+
return y({
|
|
10872
10919
|
id: a.id,
|
|
10873
10920
|
type: "list",
|
|
10874
|
-
data:
|
|
10921
|
+
data: y({
|
|
10875
10922
|
style: n,
|
|
10876
10923
|
items: o
|
|
10877
10924
|
}, n === "ordered" && s !== void 0 && s !== 1 ? { start: s } : {})
|
|
@@ -10891,14 +10938,14 @@ const pi = (a) => typeof a == "object" && "text" in a && !("content" in a), _o =
|
|
|
10891
10938
|
continue;
|
|
10892
10939
|
const r = fo(s), l = r && !s.parent, c = !r;
|
|
10893
10940
|
if (l) {
|
|
10894
|
-
const d =
|
|
10941
|
+
const d = wi(s, t, n);
|
|
10895
10942
|
o.push(d);
|
|
10896
10943
|
}
|
|
10897
10944
|
c && (o.push(po(s)), Bi(s.id, n));
|
|
10898
10945
|
}
|
|
10899
10946
|
return o;
|
|
10900
|
-
}, Ti = (a, t) => t === "legacy" ? a !== "legacy" : !1,
|
|
10901
|
-
class
|
|
10947
|
+
}, Ti = (a, t) => t === "legacy" ? a !== "legacy" : !1, Ci = (a, t) => a === "legacy" || a === "auto" && t === "legacy";
|
|
10948
|
+
class Si extends T {
|
|
10902
10949
|
constructor() {
|
|
10903
10950
|
super(...arguments), this.detectedInputFormat = "flat";
|
|
10904
10951
|
}
|
|
@@ -10918,39 +10965,41 @@ class Ci extends T {
|
|
|
10918
10965
|
if (t.length === 0)
|
|
10919
10966
|
n.insert();
|
|
10920
10967
|
else {
|
|
10921
|
-
const s = this.config.dataModel || "auto", i =
|
|
10968
|
+
const s = this.config.dataModel || "auto", i = ki(t);
|
|
10922
10969
|
this.detectedInputFormat = i.format;
|
|
10923
10970
|
const l = (Ti(s, i.format) ? vi(t) : t).map((c) => {
|
|
10924
|
-
const { tunes: d, id: h, parent: u, content: f } = c,
|
|
10925
|
-
tool:
|
|
10971
|
+
const { tunes: d, id: h, parent: u, content: f, slot: p } = c, k = c.type, b = o.available.has(k) ? {
|
|
10972
|
+
tool: k,
|
|
10926
10973
|
data: c.data
|
|
10927
|
-
} : (
|
|
10974
|
+
} : (X(`Tool «${k}» is not found. Check 'tools' property at the Blok config.`, "warn"), {
|
|
10928
10975
|
tool: o.stubTool,
|
|
10929
|
-
data: this.composeStubDataForTool(
|
|
10976
|
+
data: this.composeStubDataForTool(k, c.data, h)
|
|
10930
10977
|
});
|
|
10931
|
-
return ((
|
|
10978
|
+
return ((x, C) => {
|
|
10932
10979
|
try {
|
|
10933
10980
|
return n.composeBlock({
|
|
10934
10981
|
id: h,
|
|
10935
|
-
tool:
|
|
10936
|
-
data:
|
|
10982
|
+
tool: x,
|
|
10983
|
+
data: C,
|
|
10937
10984
|
tunes: d,
|
|
10938
10985
|
parentId: u,
|
|
10939
|
-
contentIds: f
|
|
10986
|
+
contentIds: f,
|
|
10987
|
+
slot: p
|
|
10940
10988
|
});
|
|
10941
|
-
} catch (
|
|
10942
|
-
I(`Block «${
|
|
10943
|
-
data:
|
|
10944
|
-
error:
|
|
10989
|
+
} catch (R) {
|
|
10990
|
+
I(`Block «${x}» skipped because of plugins error`, "error", {
|
|
10991
|
+
data: C,
|
|
10992
|
+
error: R
|
|
10945
10993
|
});
|
|
10946
|
-
const M = this.composeStubDataForTool(
|
|
10994
|
+
const M = this.composeStubDataForTool(x, C, h);
|
|
10947
10995
|
return n.composeBlock({
|
|
10948
10996
|
id: h,
|
|
10949
10997
|
tool: o.stubTool,
|
|
10950
10998
|
data: M,
|
|
10951
10999
|
tunes: d,
|
|
10952
11000
|
parentId: u,
|
|
10953
|
-
contentIds: f
|
|
11001
|
+
contentIds: f,
|
|
11002
|
+
slot: p
|
|
10954
11003
|
});
|
|
10955
11004
|
}
|
|
10956
11005
|
})(b.tool, b.data);
|
|
@@ -11013,7 +11062,7 @@ class Ii extends T {
|
|
|
11013
11062
|
} catch (s) {
|
|
11014
11063
|
this.lastSaveError = s;
|
|
11015
11064
|
const i = s instanceof Error ? s : new Error(String(s));
|
|
11016
|
-
|
|
11065
|
+
X("Saving failed due to the Error %o", "error", i);
|
|
11017
11066
|
return;
|
|
11018
11067
|
}
|
|
11019
11068
|
}
|
|
@@ -11030,7 +11079,7 @@ class Ii extends T {
|
|
|
11030
11079
|
isValid: !1
|
|
11031
11080
|
};
|
|
11032
11081
|
const s = await t.validate(n.data);
|
|
11033
|
-
return
|
|
11082
|
+
return P(y({}, n), {
|
|
11034
11083
|
isValid: s,
|
|
11035
11084
|
parentId: t.parentId,
|
|
11036
11085
|
contentIds: t.contentIds
|
|
@@ -11044,7 +11093,7 @@ class Ii extends T {
|
|
|
11044
11093
|
makeOutput(t) {
|
|
11045
11094
|
var i, r, l;
|
|
11046
11095
|
const e = [];
|
|
11047
|
-
t.forEach(({ id: c, tool: d, data: h, tunes: u, isValid: f, parentId: p, contentIds:
|
|
11096
|
+
t.forEach(({ id: c, tool: d, data: h, tunes: u, isValid: f, parentId: p, contentIds: k }) => {
|
|
11048
11097
|
if (!f) {
|
|
11049
11098
|
I(`Block «${d}» skipped because saved data is invalid`);
|
|
11050
11099
|
return;
|
|
@@ -11061,20 +11110,20 @@ class Ii extends T {
|
|
|
11061
11110
|
I("Stub block data is malformed and was skipped");
|
|
11062
11111
|
return;
|
|
11063
11112
|
}
|
|
11064
|
-
const
|
|
11113
|
+
const b = u === void 0 || N(u), B = p != null, x = k !== void 0 && k.length > 0, C = y(y(y({
|
|
11065
11114
|
id: c,
|
|
11066
11115
|
type: d,
|
|
11067
11116
|
data: h
|
|
11068
|
-
}, !
|
|
11117
|
+
}, !b && {
|
|
11069
11118
|
tunes: u
|
|
11070
11119
|
}), B && {
|
|
11071
11120
|
parent: p
|
|
11072
11121
|
}), x && {
|
|
11073
|
-
content:
|
|
11122
|
+
content: k
|
|
11074
11123
|
});
|
|
11075
|
-
e.push(
|
|
11124
|
+
e.push(C);
|
|
11076
11125
|
});
|
|
11077
|
-
const o = this.config.dataModel || "auto", n = (l = (r = (i = this.Blok.Renderer) == null ? void 0 : i.getDetectedInputFormat) == null ? void 0 : r.call(i)) != null ? l : "flat", s =
|
|
11126
|
+
const o = this.config.dataModel || "auto", n = (l = (r = (i = this.Blok.Renderer) == null ? void 0 : i.getDetectedInputFormat) == null ? void 0 : r.call(i)) != null ? l : "flat", s = Ci(o, n) ? xi(e) : e;
|
|
11078
11127
|
return {
|
|
11079
11128
|
time: +/* @__PURE__ */ new Date(),
|
|
11080
11129
|
blocks: s,
|
|
@@ -11096,14 +11145,14 @@ class Ii extends T {
|
|
|
11096
11145
|
});
|
|
11097
11146
|
}), n.length === 0)
|
|
11098
11147
|
return t;
|
|
11099
|
-
const s =
|
|
11148
|
+
const s = ye(
|
|
11100
11149
|
n.map(({ data: r }) => r),
|
|
11101
11150
|
e,
|
|
11102
11151
|
o
|
|
11103
|
-
), i = t.map((r) =>
|
|
11152
|
+
), i = t.map((r) => y({}, r));
|
|
11104
11153
|
return n.forEach(({ index: r }, l) => {
|
|
11105
11154
|
const c = s[l];
|
|
11106
|
-
i[r] =
|
|
11155
|
+
i[r] = P(y({}, i[r]), {
|
|
11107
11156
|
data: c.data
|
|
11108
11157
|
});
|
|
11109
11158
|
}), i;
|
|
@@ -11140,7 +11189,7 @@ class Ii extends T {
|
|
|
11140
11189
|
if (N(e))
|
|
11141
11190
|
return;
|
|
11142
11191
|
const o = t.preservedTunes;
|
|
11143
|
-
return
|
|
11192
|
+
return P(y({
|
|
11144
11193
|
id: t.id,
|
|
11145
11194
|
tool: t.name,
|
|
11146
11195
|
data: e
|
|
@@ -11298,7 +11347,7 @@ class Mi extends Ie {
|
|
|
11298
11347
|
* @param readOnly - True if Blok is in read-only mode
|
|
11299
11348
|
*/
|
|
11300
11349
|
create(t, e, o) {
|
|
11301
|
-
const n = this.toolbox, s = n !== void 0 ?
|
|
11350
|
+
const n = this.toolbox, s = n !== void 0 ? P(y({}, this.settings), { _toolboxEntries: n }) : this.settings;
|
|
11302
11351
|
return new this.constructable({
|
|
11303
11352
|
data: t,
|
|
11304
11353
|
block: e,
|
|
@@ -11349,9 +11398,9 @@ class Mi extends Ie {
|
|
|
11349
11398
|
mergeToolboxSettings(t, e) {
|
|
11350
11399
|
return e == null ? Array.isArray(t) ? t : [t] : !Array.isArray(e) && Array.isArray(t) ? [e] : Array.isArray(e) ? Array.isArray(t) ? e.map((o, n) => {
|
|
11351
11400
|
const s = t[n];
|
|
11352
|
-
return s ?
|
|
11401
|
+
return s ? y(y({}, s), o) : o;
|
|
11353
11402
|
}) : e : [
|
|
11354
|
-
|
|
11403
|
+
y(y({}, t), e)
|
|
11355
11404
|
];
|
|
11356
11405
|
}
|
|
11357
11406
|
/**
|
|
@@ -11498,7 +11547,7 @@ class Di {
|
|
|
11498
11547
|
},
|
|
11499
11548
|
getEnglishTranslation: (s) => e.i18n.getEnglishTranslation(s)
|
|
11500
11549
|
};
|
|
11501
|
-
return
|
|
11550
|
+
return P(y({}, e), {
|
|
11502
11551
|
i18n: n
|
|
11503
11552
|
});
|
|
11504
11553
|
}
|
|
@@ -11752,7 +11801,7 @@ const ee = (a) => {
|
|
|
11752
11801
|
const e = (n = t.config) != null ? n : {}, o = {};
|
|
11753
11802
|
for (const s of Object.keys(t))
|
|
11754
11803
|
Wt.BLOK_SETTINGS_KEYS.has(s) || (o[s] = t[s]);
|
|
11755
|
-
return
|
|
11804
|
+
return y(y({}, e), o);
|
|
11756
11805
|
}
|
|
11757
11806
|
/**
|
|
11758
11807
|
* Assign enabled Inline Tools and Block Tunes for Block Tool
|
|
@@ -11821,7 +11870,7 @@ const ee = (a) => {
|
|
|
11821
11870
|
continue;
|
|
11822
11871
|
const n = t[o], s = E(n), r = E(n.class);
|
|
11823
11872
|
if (!s && !r)
|
|
11824
|
-
throw new
|
|
11873
|
+
throw new kt(
|
|
11825
11874
|
`Tool «${o}» must be a constructor function or an object with function in the «class» property`
|
|
11826
11875
|
);
|
|
11827
11876
|
}
|
|
@@ -11905,7 +11954,7 @@ Wt.BLOK_SETTINGS_KEYS = /* @__PURE__ */ new Set([
|
|
|
11905
11954
|
"config",
|
|
11906
11955
|
"isInternal"
|
|
11907
11956
|
]);
|
|
11908
|
-
let
|
|
11957
|
+
let ke = Wt;
|
|
11909
11958
|
const Li = `*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:PT Mono,Menlo,Monaco,Consolas,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:651px){.\\!container{max-width:651px!important}.container{max-width:651px}}@media(min-width:768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.blok-block{padding:3px 2px}.blok-block::-webkit-input-placeholder{line-height:1.5!important}.blok-inline-tool-button{display:flex;height:100%;width:1.75rem;cursor:pointer;align-items:center;justify-content:center;border-radius:.25rem;border-width:0px;background-color:transparent;padding:0;line-height:1.5;--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.blok-inline-tool-button--active{background-color:#388ae51a;--tw-text-opacity: 1;color:rgb(56 138 229 / var(--tw-text-opacity, 1))}.blok-input{width:100%;border-radius:3px;border-width:1px;--tw-border-opacity: 1;border-color:rgb(239 240 241 / var(--tw-border-opacity, 1));padding:.625rem .75rem;--tw-shadow: inset 0 1px 2px 0 rgba(35, 44, 72, .06);--tw-shadow-colored: inset 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}.blok-input[data-blok-placeholder]:before{pointer-events:none;position:static!important;display:inline-block;width:0px;content:var(--tw-content);white-space:nowrap}.blok-loader{position:relative;border-width:1px;--tw-border-opacity: 1;border-color:rgb(239 240 241 / var(--tw-border-opacity, 1))}.blok-loader:before{position:absolute;left:50%;top:50%;margin-left:-11px;margin-top:-11px;height:18px;content:var(--tw-content);width:18px}@keyframes rotation{0%{content:var(--tw-content);transform:rotate(0)}to{content:var(--tw-content);transform:rotate(360deg)}}.blok-loader:before{animation:rotation 1.2s infinite linear;border-radius:9999px;border-width:2px;border-color:rgb(239 240 241 / var(--tw-border-opacity, 1));--tw-border-opacity: 1;border-left-color:rgb(56 138 229 / var(--tw-border-opacity, 1));--tw-content: "";content:var(--tw-content)}.blok-button{cursor:pointer;border-radius:3px;border-width:1px;--tw-border-opacity: 1;border-color:rgb(239 240 241 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:13px;text-align:center;font-size:14.9px;--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1));--tw-shadow: 0 2px 2px 0 rgba(18, 30, 57, .04);--tw-shadow-colored: 0 2px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.blok-button:hover{--tw-bg-opacity: 1;background-color:rgb(251 252 254 / var(--tw-bg-opacity, 1));--tw-shadow: 0 1px 3px 0 rgba(18, 30, 57, .08);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.blok-button svg{margin-right:.2em;margin-top:-.125rem;height:1.25rem}.blok-settings-button{margin:0;display:inline-flex;min-height:26px;min-width:26px;cursor:pointer;align-items:center;justify-content:center;border-radius:3px;border-width:0px;background-color:transparent;vertical-align:bottom;color:inherit;outline:2px solid transparent;outline-offset:2px}@media(max-width:650px){.blok-settings-button{height:36px;width:36px;border-radius:.5rem}}@media(hover:hover){.blok-settings-button:hover{--tw-bg-opacity: 1;background-color:rgb(239 242 245 / var(--tw-bg-opacity, 1))}}.blok-settings-button svg{height:auto;width:auto}@media(max-width:650px){.blok-settings-button svg{height:28px;width:28px}}.blok-settings-button--active{--tw-text-opacity: 1;color:rgb(56 138 229 / var(--tw-text-opacity, 1))}.blok-settings-button--focused{background-color:#22baff14;--tw-shadow: inset 0 0 0 1px rgba(7, 161, 227, .08);--tw-shadow-colored: inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@keyframes buttonClicked{0%{transform:scale3d(.95,.95,.95)}60%{transform:scale3d(1.02,1.02,1.02)}80%,to{transform:scaleZ(1)}}.blok-settings-button--focused-animated{animation:buttonClicked .75s cubic-bezier(.215,.61,.355,1) forwards}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-\\[auto_var\\(--offset\\)_calc\\(var\\(--offset\\)\\+env\\(safe-area-inset-bottom\\)\\)_var\\(--offset\\)\\]{inset:auto var(--offset) calc(var(--offset) + env(safe-area-inset-bottom)) var(--offset)}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-0{left:0}.left-5{left:1.25rem}.left-\\[var\\(--popover-left\\)\\]{left:var(--popover-left)}.left-auto{left:auto}.right-0{right:0}.right-\\[15px\\]{right:15px}.right-full{right:100%}.top-0{top:0}.top-\\[7px\\]{top:7px}.top-\\[var\\(--popover-top\\)\\]{top:var(--popover-top)}.top-auto{top:auto}.z-0{z-index:0}.z-\\[10000\\]{z-index:10000}.z-\\[1\\]{z-index:1}.z-\\[2\\]{z-index:2}.z-\\[3\\]{z-index:3}.z-\\[4\\]{z-index:4}.z-overlay{z-index:999}.\\!m-0{margin:0!important}.-m-px{margin:-1px}.m-0{margin:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2\\.5{margin-top:.625rem;margin-bottom:.625rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-\\[-0\\.5em\\]{margin-top:-.5em;margin-bottom:-.5em}.\\!mr-0{margin-right:0!important}.\\!mr-2{margin-right:.5rem!important}.mb-1{margin-bottom:.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-\\[30px\\]{margin-bottom:30px}.mb-px{margin-bottom:1px}.ml-3\\.5{margin-left:.875rem}.mr-2{margin-right:.5rem}.mr-auto{margin-right:auto}.mt-1{margin-top:.25rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\\[15px\\]{margin-top:15px}.mt-\\[2px\\]{margin-top:2px}.mt-\\[3px\\]{margin-top:3px}.mt-\\[5px\\]{margin-top:5px}.box-border{box-sizing:border-box}.\\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.\\!hidden{display:none!important}.hidden{display:none}.h-2\\.5{height:.625rem}.h-4{height:1rem}.h-9{height:2.25rem}.h-\\[26px\\]{height:26px}.h-\\[50px\\]{height:50px}.h-auto{height:auto}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-toolbox-btn{height:26px}.max-h-0{max-height:0px}.max-h-\\[var\\(--max-height\\)\\]{max-height:var(--max-height)}.max-h-none{max-height:none}.w-2\\.5{width:.625rem}.w-4{width:1rem}.w-6{width:1.5rem}.w-9{width:2.25rem}.w-\\[230px\\]{width:230px}.w-\\[26px\\]{width:26px}.w-\\[var\\(--width\\)\\]{width:var(--width)}.w-auto{width:auto}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.w-toolbox-btn{width:26px}.min-w-0{min-width:0px}.min-w-\\[calc\\(100\\%-theme\\(\\'spacing\\.6\\'\\)-10px\\)\\]{min-width:calc(100% - 1.5rem - 10px)}.min-w-\\[calc\\(100\\%-var\\(--offset\\)\\*2\\)\\]{min-width:calc(100% - var(--offset) * 2)}.min-w-\\[var\\(--width\\)\\]{min-width:var(--width)}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-\\[130px\\]{max-width:130px}.max-w-content{max-width:650px}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-\\[5px\\]{--tw-translate-x: -5px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-\\[5px\\]{--tw-translate-y: -5px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[5px\\]{--tw-translate-x: 5px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[5px\\]{--tw-translate-y: 5px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-none{transform:none}@keyframes panelShowingMobile{0%{opacity:0;transform:translateY(14px) scale(.98)}70%{opacity:1;transform:translateY(-4px)}to{transform:translateY(0)}}.animate-\\[panelShowingMobile_250ms_ease\\]{animation:panelShowingMobile .25s ease}@keyframes panelShowing{0%{opacity:0;transform:translateY(-8px) scale(.9)}70%{opacity:1;transform:translateY(2px)}to{transform:translateY(0)}}.animate-\\[panelShowing_100ms_ease\\]{animation:panelShowing .1s ease}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .3s ease forwards}.animate-none{animation:none}@keyframes notifyBounceIn{0%{opacity:0;transform:scale(.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(.9)}to{transform:scale(1)}}.animate-notify-bounce-in{animation:notifyBounceIn .6s 1}@keyframes wobble{0%{transform:translateZ(0)}15%{transform:translate3d(-9%,0,0)}30%{transform:translate3d(9%,0,0)}45%{transform:translate3d(-4%,0,0)}60%{transform:translate3d(4%,0,0)}75%{transform:translate3d(-1%,0,0)}to{transform:translateZ(0)}}.animate-wobble{animation:wobble .4s}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-\\[auto_auto_1fr\\]{grid-template-columns:auto auto 1fr}.grid-rows-\\[auto\\]{grid-template-rows:auto}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[5px\\]{border-radius:5px}.rounded-\\[7px\\]{border-radius:7px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-\\[\\#e8e8eb\\]{--tw-border-opacity: 1;border-color:rgb(232 232 235 / var(--tw-border-opacity, 1))}.border-\\[rgba\\(226\\,226\\,229\\,0\\.2\\)\\],.border-\\[rgba\\(226\\,226\\,229\\,0\\.20\\)\\]{border-color:#e2e2e533}.border-line-gray,.border-popover-border{--tw-border-opacity: 1;border-color:rgb(239 240 241 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.\\!bg-\\[\\#fafffe\\]{--tw-bg-opacity: 1 !important;background-color:rgb(250 255 254 / var(--tw-bg-opacity, 1))!important}.\\!bg-\\[\\#fffbfb\\]{--tw-bg-opacity: 1 !important;background-color:rgb(255 251 251 / var(--tw-bg-opacity, 1))!important}.\\!bg-item-confirm-bg{--tw-bg-opacity: 1 !important;background-color:rgb(226 74 74 / var(--tw-bg-opacity, 1))!important}.\\!bg-item-focus-bg{background-color:#22baff14!important}.bg-\\[\\#34c992\\]{--tw-bg-opacity: 1;background-color:rgb(52 201 146 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F8F8F8\\]{--tw-bg-opacity: 1;background-color:rgb(248 248 248 / var(--tw-bg-opacity, 1))}.bg-\\[\\#eff1f4\\]{--tw-bg-opacity: 1;background-color:rgb(239 241 244 / var(--tw-bg-opacity, 1))}.bg-\\[\\#f2f5f7\\]{--tw-bg-opacity: 1;background-color:rgb(242 245 247 / var(--tw-bg-opacity, 1))}.bg-\\[\\#f7f7f7\\]{--tw-bg-opacity: 1;background-color:rgb(247 247 247 / var(--tw-bg-opacity, 1))}.bg-bg-light{--tw-bg-opacity: 1;background-color:rgb(239 242 245 / var(--tw-bg-opacity, 1))}.bg-dark{--tw-bg-opacity: 1;background-color:rgb(29 32 43 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-item-hover-bg{--tw-bg-opacity: 1;background-color:rgb(248 248 248 / var(--tw-bg-opacity, 1))}.bg-popover-bg{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-popover-border{--tw-bg-opacity: 1;background-color:rgb(239 240 241 / var(--tw-bg-opacity, 1))}.bg-selection{--tw-bg-opacity: 1;background-color:rgb(225 242 255 / var(--tw-bg-opacity, 1))}.bg-selection-highlight{background-color:#2eaadc33}.bg-tooltip-bg{--tw-bg-opacity: 1;background-color:rgb(29 32 43 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[3px\\]{padding:3px}.p-\\[5px\\]{padding:5px}.p-\\[var\\(--item-padding\\)\\]{padding:var(--item-padding)}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-\\[18px\\]{padding-left:18px;padding-right:18px}.px-\\[2px\\]{padding-left:2px;padding-right:2px}.px-\\[30px\\]{padding-left:30px;padding-right:30px}.px-\\[3px\\]{padding-left:3px;padding-right:3px}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-\\[0\\.5em\\]{padding-top:.5em;padding-bottom:.5em}.py-\\[13px\\]{padding-top:13px;padding-bottom:13px}.py-\\[3px\\]{padding-top:3px;padding-bottom:3px}.py-\\[5px\\]{padding-top:5px;padding-bottom:5px}.pl-0\\.5{padding-left:.125rem}.pr-1\\.5{padding-right:.375rem}.pr-\\[5px\\]{padding-right:5px}.text-center{text-align:center}.text-right{text-align:right}.text-start{text-align:start}.font-\\[-apple-system\\,BlinkMacSystemFont\\,\\"Segoe_UI\\"\\,\\"Roboto\\"\\,\\"Oxygen\\"\\,\\"Ubuntu\\"\\,\\"Cantarell\\"\\,\\"Fira_Sans\\"\\,\\"Droid_Sans\\"\\,\\"Helvetica_Neue\\"\\,sans-serif\\]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.font-\\[inherit\\]{font-family:inherit}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\\[13px\\]{font-size:13px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.capitalize{text-transform:capitalize}.italic{font-style:italic}.\\!leading-\\[1\\.3\\]{line-height:1.3!important}.leading-5{line-height:1.25rem}.leading-\\[1\\.4em\\]{line-height:1.4em}.leading-\\[1\\.6em\\]{line-height:1.6em}.leading-\\[1em\\]{line-height:1em}.leading-\\[22px\\]{line-height:22px}.leading-\\[50px\\]{line-height:50px}.leading-relaxed{line-height:1.625}.tracking-\\[0\\.02em\\]{letter-spacing:.02em}.tracking-\\[0\\.25px\\]{letter-spacing:.25px}.\\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity, 1))!important}.text-\\[\\#656b7c\\]{--tw-text-opacity: 1;color:rgb(101 107 124 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-dark{--tw-text-opacity: 1;color:rgb(29 32 43 / var(--tw-text-opacity, 1))}.text-gray-text{--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.text-inherit{color:inherit}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-text-primary{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-text-secondary{--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.text-tooltip-font{--tw-text-opacity: 1;color:rgb(205 209 224 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.accent-current{accent-color:currentColor}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-55{opacity:.55}.opacity-60{opacity:.6}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_11px_17px_0_rgba\\(23\\,32\\,61\\,0\\.13\\)\\]{--tw-shadow: 0 11px 17px 0 rgba(23,32,61,.13);--tw-shadow-colored: 0 11px 17px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_1px_1px_0_rgba\\(18\\,49\\,35\\,0\\.05\\)\\]{--tw-shadow: 0 1px 1px 0 rgba(18,49,35,.05);--tw-shadow-colored: 0 1px 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_2px_1px_0_rgba\\(16\\,19\\,29\\,0\\)\\]{--tw-shadow: 0 2px 1px 0 rgba(16,19,29,0);--tw-shadow-colored: 0 2px 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_3px_15px_-3px_theme\\(colors\\.popover-shadow\\)\\]{--tw-shadow: 0 3px 15px -3px rgba(13, 20, 33, .1);--tw-shadow-colored: 0 3px 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-tooltip{--tw-shadow: 0 8px 12px 0 rgba(29, 32, 43, .17), 0 4px 5px -3px rgba(5, 6, 12, .49);--tw-shadow-colored: 0 8px 12px 0 var(--tw-shadow-color), 0 4px 5px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-none{transition-property:none}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-\\[120ms\\]{transition-duration:.12s}.duration-\\[250ms\\]{transition-duration:.25s}.duration-\\[50ms\\,70ms\\]{transition-duration:50ms,70ms}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.will-change-\\[opacity\\,left\\,top\\]{will-change:opacity,left,top}.will-change-\\[opacity\\,top\\,left\\]{will-change:opacity,top,left}.will-change-\\[opacity\\,top\\]{will-change:opacity,top}.will-change-\\[opacity\\]{will-change:opacity}.\\[clip\\:rect\\(0\\,0\\,0\\,0\\)\\]{clip:rect(0,0,0,0)}.\\[direction\\:rtl\\]{direction:rtl}[data-blok-navigation-focused=true]{margin-left:auto;margin-right:auto;width:650px;max-width:100%;border-radius:.375rem;background-color:#22baff14}@media(hover:hover){[data-blok-item-name=delete]:hover{--tw-text-opacity: 1;color:rgb(226 74 74 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}}[data-drop-indicator]{position:relative}[data-drop-indicator]:before{pointer-events:none;position:absolute;z-index:10;height:.375rem;width:100%;max-width:650px;border-radius:.125rem;--tw-bg-opacity: 1;background-color:rgb(212 227 252 / var(--tw-bg-opacity, 1));--tw-content: "";content:var(--tw-content);left:50%;margin-left:calc(var(--drop-indicator-depth, 0) * 12px);max-width:calc(650px - var(--drop-indicator-depth, 0) * 24px)}[data-drop-indicator=bottom]:before{bottom:0;transform:translate(-50%) translateY(50%)}[data-drop-indicator=top]:before{top:0;transform:translate(-50%) translateY(-50%)}[data-blok-dragging-multi=true] [data-blok-selected=true]{opacity:.4;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}[data-blok-selected=true] [data-blok-element-content]:has([data-list-style]){background-color:transparent}[data-blok-selected=true] [data-list-style] [role=listitem]{border-radius:4px;--tw-bg-opacity: 1;background-color:rgb(225 242 255 / var(--tw-bg-opacity, 1))}[data-blok-selected=true] [data-list-style] [role=listitem] [contenteditable]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.placeholder\\:font-medium::-moz-placeholder{font-weight:500}.placeholder\\:font-medium::placeholder{font-weight:500}.placeholder\\:text-\\[\\#656b7c\\]::-moz-placeholder{--tw-text-opacity: 1;color:rgb(101 107 124 / var(--tw-text-opacity, 1))}.placeholder\\:text-\\[\\#656b7c\\]::placeholder{--tw-text-opacity: 1;color:rgb(101 107 124 / var(--tw-text-opacity, 1))}.placeholder\\:text-gray-text::-moz-placeholder{--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.placeholder\\:text-gray-text::placeholder{--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:inset-0:before{content:var(--tw-content);inset:0}.before\\:left-0:before{content:var(--tw-content);left:0}.before\\:left-\\[9px\\]:before{content:var(--tw-content);left:9px}.before\\:top-0:before{content:var(--tw-content);top:0}.before\\:top-\\[5px\\]:before{content:var(--tw-content);top:5px}.before\\:-z-10:before{content:var(--tw-content);z-index:-10}.before\\:m-\\[3px\\]:before{content:var(--tw-content);margin:3px}.before\\:block:before{content:var(--tw-content);display:block}.before\\:h-3:before{content:var(--tw-content);height:.75rem}.before\\:h-\\[calc\\(100\\%-6px\\)\\]:before{content:var(--tw-content);height:calc(100% - 6px)}.before\\:w-0\\.5:before{content:var(--tw-content);width:.125rem}.before\\:w-\\[3px\\]:before{content:var(--tw-content);width:3px}.before\\:rotate-\\[-45deg\\]:before{content:var(--tw-content);--tw-rotate: -45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.before\\:rounded-\\[5px\\]:before{content:var(--tw-content);border-radius:5px}.before\\:rounded-lg:before{content:var(--tw-content);border-radius:.5rem}.before\\:\\!bg-\\[\\#41ffb1\\]:before{content:var(--tw-content);--tw-bg-opacity: 1 !important;background-color:rgb(65 255 177 / var(--tw-bg-opacity, 1))!important}.before\\:\\!bg-\\[\\#fb5d5d\\]:before{content:var(--tw-content);--tw-bg-opacity: 1 !important;background-color:rgb(251 93 93 / var(--tw-bg-opacity, 1))!important}.before\\:bg-\\[\\#575d67\\]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(87 93 103 / var(--tw-bg-opacity, 1))}.before\\:bg-tooltip-bg:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(29 32 43 / var(--tw-bg-opacity, 1))}.before\\:bg-transparent:before{content:var(--tw-content);background-color:transparent}.before\\:content-\\[\\"\\"\\]:before{--tw-content: "";content:var(--tw-content)}.before\\:content-\\[\\\\\\'\\\\\\'\\]:before{--tw-content: \\'\\';content:var(--tw-content)}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:left-\\[9px\\]:after{content:var(--tw-content);left:9px}.after\\:top-\\[5px\\]:after{content:var(--tw-content);top:5px}.after\\:mx-3:after{content:var(--tw-content);margin-left:.75rem;margin-right:.75rem}.after\\:h-3:after{content:var(--tw-content);height:.75rem}.after\\:w-0\\.5:after{content:var(--tw-content);width:.125rem}.after\\:rotate-45:after{content:var(--tw-content);--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\\:bg-\\[\\#575d67\\]:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(87 93 103 / var(--tw-bg-opacity, 1))}.after\\:text-\\[\\#ddd\\]:after{content:var(--tw-content);--tw-text-opacity: 1;color:rgb(221 221 221 / var(--tw-text-opacity, 1))}.after\\:content-\\[\\"\\"\\]:after{--tw-content: "";content:var(--tw-content)}.after\\:content-\\[\\'\\|\\'\\]:after{--tw-content: "|";content:var(--tw-content)}.first\\:mt-0:first-child{margin-top:0}.last\\:ml-2\\.5:last-child{margin-left:.625rem}.empty\\:before\\:pointer-events-none:empty:before{content:var(--tw-content);pointer-events:none}.empty\\:before\\:cursor-text:empty:before{content:var(--tw-content);cursor:text}.empty\\:before\\:text-gray-text:empty:before{content:var(--tw-content);--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.empty\\:before\\:content-\\[attr\\(data-blok-placeholder\\)\\]:empty:before{--tw-content: attr(data-blok-placeholder);content:var(--tw-content)}.empty\\:before\\:content-\\[attr\\(data-blok-placeholder-active\\)\\]:empty:before{--tw-content: attr(data-blok-placeholder-active);content:var(--tw-content)}.empty\\:before\\:content-\\[attr\\(data-placeholder\\)\\]:empty:before{--tw-content: attr(data-placeholder);content:var(--tw-content)}.hover\\:bg-\\[\\#2db583\\]:hover{--tw-bg-opacity: 1;background-color:rgb(45 181 131 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#e0e4eb\\]:hover{--tw-bg-opacity: 1;background-color:rgb(224 228 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#e9ecee\\]:hover{--tw-bg-opacity: 1;background-color:rgb(233 236 238 / var(--tw-bg-opacity, 1))}.hover\\:opacity-100:hover{opacity:1}.focus\\:placeholder\\:text-\\[rgba\\(101\\,107\\,124\\,0\\.3\\)\\]:focus::-moz-placeholder{color:#656b7c4d}.focus\\:placeholder\\:text-\\[rgba\\(101\\,107\\,124\\,0\\.3\\)\\]:focus::placeholder{color:#656b7c4d}.empty\\:focus\\:before\\:pointer-events-none:focus:empty:before{content:var(--tw-content);pointer-events:none}.empty\\:focus\\:before\\:cursor-text:focus:empty:before{content:var(--tw-content);cursor:text}.empty\\:focus\\:before\\:text-gray-text:focus:empty:before{content:var(--tw-content);--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.empty\\:focus\\:before\\:content-\\[attr\\(data-blok-placeholder-active\\)\\]:focus:empty:before{--tw-content: attr(data-blok-placeholder-active);content:var(--tw-content)}.active\\:cursor-grabbing:active{cursor:grabbing}.group[data-blok-dragging=true] .group-data-\\[blok-dragging\\=true\\]\\:pointer-events-none{pointer-events:none}.group[data-blok-rtl=true] .group-data-\\[blok-rtl\\=true\\]\\:left-\\[calc\\(-1\\*theme\\(width\\.toolbox-btn\\)\\)\\]{left:-26px}.group[data-blok-rtl=true] .group-data-\\[blok-rtl\\=true\\]\\:left-auto{left:auto}.group[data-blok-rtl=true] .group-data-\\[blok-rtl\\=true\\]\\:right-\\[calc\\(-1\\*theme\\(width\\.toolbox-btn\\)\\)\\]{right:-26px}.group[data-blok-rtl=true] .group-data-\\[blok-rtl\\=true\\]\\:right-auto{right:auto}.group[data-blok-dragging=true] .group-data-\\[blok-dragging\\=true\\]\\:cursor-grabbing{cursor:grabbing}.group[data-blok-block-settings-opened=true] .group-data-\\[blok-block-settings-opened\\=true\\]\\:bg-bg-light,.group[data-blok-toolbox-opened=true] .group-data-\\[blok-toolbox-opened\\=true\\]\\:bg-bg-light{--tw-bg-opacity: 1;background-color:rgb(239 242 245 / var(--tw-bg-opacity, 1))}@media(max-width:650px){.mobile\\:absolute{position:absolute}.mobile\\:right-auto{right:auto}.mobile\\:z-\\[2\\]{z-index:2}.mobile\\:hidden{display:none}.mobile\\:h-toolbox-btn-mobile{height:36px}.mobile\\:w-toolbox-btn-mobile{width:36px}.mobile\\:rounded-\\[6px\\]{border-radius:6px}.mobile\\:border{border-width:1px}.mobile\\:border-\\[\\#e8e8eb\\]{--tw-border-opacity: 1;border-color:rgb(232 232 235 / var(--tw-border-opacity, 1))}.mobile\\:bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.mobile\\:p-1{padding:.25rem}.mobile\\:text-\\[15px\\]{font-size:15px}.mobile\\:font-medium{font-weight:500}.mobile\\:shadow-overlay-pane{--tw-shadow: 0 3px 15px -3px rgba(13, 20, 33, .13);--tw-shadow-colored: 0 3px 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-blok-rtl=true] .mobile\\:group-data-\\[blok-rtl\\=true\\]\\:ml-0{margin-left:0}.group[data-blok-rtl=true] .mobile\\:group-data-\\[blok-rtl\\=true\\]\\:mr-auto{margin-right:auto}.group[data-blok-rtl=true] .mobile\\:group-data-\\[blok-rtl\\=true\\]\\:pl-\\[10px\\]{padding-left:10px}.group[data-blok-rtl=true] .mobile\\:group-data-\\[blok-rtl\\=true\\]\\:pr-0{padding-right:0}}@media(min-width:651px){.not-mobile\\:w-6{width:1.5rem}.group[data-blok-narrow=true][data-blok-rtl=true] .not-mobile\\:group-data-\\[blok-narrow\\=true\\]\\:group-data-\\[blok-rtl\\=true\\]\\:left-0{left:0}.group[data-blok-narrow=true][data-blok-rtl=true] .not-mobile\\:group-data-\\[blok-narrow\\=true\\]\\:group-data-\\[blok-rtl\\=true\\]\\:left-\\[-5px\\]{left:-5px}.group[data-blok-narrow=true][data-blok-rtl=true] .not-mobile\\:group-data-\\[blok-narrow\\=true\\]\\:group-data-\\[blok-rtl\\=true\\]\\:left-\\[calc\\(-1\\*theme\\(spacing\\.narrow-mode-right-padding\\)-5px\\)\\]{left:-55px}.group[data-blok-narrow=true][data-blok-rtl=true] .not-mobile\\:group-data-\\[blok-narrow\\=true\\]\\:group-data-\\[blok-rtl\\=true\\]\\:right-\\[5px\\]{right:5px}.group[data-blok-narrow=true][data-blok-rtl=true] .not-mobile\\:group-data-\\[blok-narrow\\=true\\]\\:group-data-\\[blok-rtl\\=true\\]\\:right-auto{right:auto}.group[data-blok-narrow=true] .not-mobile\\:group-data-\\[blok-narrow\\=true\\]\\:left-\\[5px\\]{left:5px}.group[data-blok-narrow=true] .not-mobile\\:group-data-\\[blok-narrow\\=true\\]\\:right-\\[calc\\(-1\\*theme\\(spacing\\.narrow-mode-right-padding\\)-5px\\)\\]{right:-55px}.group[data-blok-narrow=true][data-blok-rtl=true] .not-mobile\\:group-data-\\[blok-narrow\\=true\\]\\:group-data-\\[blok-rtl\\=true\\]\\:ml-\\[theme\\(spacing\\.narrow-mode-right-padding\\)\\]{margin-left:50px}.group[data-blok-narrow=true][data-blok-rtl=true] .not-mobile\\:group-data-\\[blok-narrow\\=true\\]\\:group-data-\\[blok-rtl\\=true\\]\\:mr-0{margin-right:0}.group[data-blok-narrow=true] .not-mobile\\:group-data-\\[blok-narrow\\=true\\]\\:mr-\\[theme\\(spacing\\.narrow-mode-right-padding\\)\\]{margin-right:50px}}@media(hover:hover){.can-hover\\:hover\\:cursor-grab:hover{cursor:grab}.can-hover\\:hover\\:cursor-pointer:hover{cursor:pointer}.can-hover\\:hover\\:bg-bg-light:hover{--tw-bg-opacity: 1;background-color:rgb(239 242 245 / var(--tw-bg-opacity, 1))}.can-hover\\:hover\\:bg-item-hover-bg:hover{--tw-bg-opacity: 1;background-color:rgb(248 248 248 / var(--tw-bg-opacity, 1))}.group[data-blok-block-settings-opened=true] .group-data-\\[blok-block-settings-opened\\=true\\]\\:can-hover\\:hover\\:cursor-pointer:hover,.group[data-blok-toolbox-opened=true] .group-data-\\[blok-toolbox-opened\\=true\\]\\:can-hover\\:hover\\:cursor-pointer:hover{cursor:pointer}}.\\[\\&\\>p\\:first-of-type\\]\\:mt-0>p:first-of-type{margin-top:0}.\\[\\&\\>p\\:last-of-type\\]\\:mb-0>p:last-of-type{margin-bottom:0}.\\[\\&\\[data-blok-dragging\\=true\\]\\]\\:cursor-grabbing[data-blok-dragging=true]{cursor:grabbing}.\\[\\&\\[data-blok-empty\\=true\\]\\]\\:before\\:pointer-events-none[data-blok-empty=true]:before{content:var(--tw-content);pointer-events:none}.\\[\\&\\[data-blok-empty\\=true\\]\\]\\:before\\:cursor-text[data-blok-empty=true]:before{content:var(--tw-content);cursor:text}.\\[\\&\\[data-blok-empty\\=true\\]\\]\\:before\\:text-gray-text[data-blok-empty=true]:before{content:var(--tw-content);--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.\\[\\&\\[data-blok-empty\\=true\\]\\]\\:before\\:content-\\[attr\\(data-blok-placeholder\\)\\][data-blok-empty=true]:before{--tw-content: attr(data-blok-placeholder);content:var(--tw-content)}.\\[\\&\\[data-blok-empty\\=true\\]\\]\\:before\\:content-\\[attr\\(data-placeholder\\)\\][data-blok-empty=true]:before{--tw-content: attr(data-placeholder);content:var(--tw-content)}.\\[\\&\\[data-blok-focused\\=\\"true\\"\\]\\]\\:bg-item-focus-bg[data-blok-focused=true]{background-color:#22baff14}.\\[\\&\\[data-blok-force-hover\\]\\]\\:cursor-pointer[data-blok-force-hover]{cursor:pointer}.\\[\\&\\[data-blok-force-hover\\]\\]\\:bg-item-hover-bg[data-blok-force-hover]{--tw-bg-opacity: 1;background-color:rgb(248 248 248 / var(--tw-bg-opacity, 1))}.\\[\\&\\[data-blok-popover-item-active\\]\\]\\:bg-icon-active-bg[data-blok-popover-item-active]{background-color:#388ae51a}.\\[\\&\\[data-blok-popover-item-active\\]\\]\\:text-icon-active-text[data-blok-popover-item-active]{--tw-text-opacity: 1;color:rgb(56 138 229 / var(--tw-text-opacity, 1))}.\\[\\&\\[data-blok-popover-item-no-hover\\]\\]\\:cursor-default[data-blok-popover-item-no-hover]{cursor:default}.\\[\\&\\[data-blok-popover-item-no-hover\\]\\]\\:hover\\:bg-transparent:hover[data-blok-popover-item-no-hover]{background-color:transparent}.\\[\\&\\[data-blok-toolbox-opened\\=true\\]_\\[contentEditable\\=true\\]\\[data-blok-placeholder\\]\\:focus\\]\\:before\\:\\!opacity-0[data-blok-toolbox-opened=true] [contentEditable=true][data-blok-placeholder]:focus:before{content:var(--tw-content);opacity:0!important}.\\[\\&\\[data-empty\\=true\\]\\:focus\\]\\:before\\:pointer-events-none[data-empty=true]:focus:before{content:var(--tw-content);pointer-events:none}.\\[\\&\\[data-empty\\=true\\]\\:focus\\]\\:before\\:cursor-text[data-empty=true]:focus:before{content:var(--tw-content);cursor:text}.\\[\\&\\[data-empty\\=true\\]\\:focus\\]\\:before\\:text-gray-text[data-empty=true]:focus:before{content:var(--tw-content);--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.\\[\\&\\[data-empty\\=true\\]\\:focus\\]\\:before\\:content-\\[attr\\(data-blok-placeholder-active\\)\\][data-empty=true]:focus:before{--tw-content: attr(data-blok-placeholder-active);content:var(--tw-content)}.\\[\\&\\[data-empty\\=true\\]\\]\\:before\\:pointer-events-none[data-empty=true]:before{content:var(--tw-content);pointer-events:none}.\\[\\&\\[data-empty\\=true\\]\\]\\:before\\:cursor-text[data-empty=true]:before{content:var(--tw-content);cursor:text}.\\[\\&\\[data-empty\\=true\\]\\]\\:before\\:text-gray-text[data-empty=true]:before{content:var(--tw-content);--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}.\\[\\&\\[data-empty\\=true\\]\\]\\:before\\:content-\\[attr\\(data-blok-placeholder-active\\)\\][data-empty=true]:before{--tw-content: attr(data-blok-placeholder-active);content:var(--tw-content)}.\\[\\&_\\:\\:selection\\]\\:bg-selection-inline ::-moz-selection{--tw-bg-opacity: 1;background-color:rgb(212 236 255 / var(--tw-bg-opacity, 1))}.\\[\\&_\\:\\:selection\\]\\:bg-selection-inline ::selection{--tw-bg-opacity: 1;background-color:rgb(212 236 255 / var(--tw-bg-opacity, 1))}.\\[\\&_\\[contenteditable\\]\\:empty\\]\\:after\\:content-\\[\\"\\\\\\\\feff_\\"\\] [contenteditable]:empty:after{--tw-content: "\\\\feff ";content:var(--tw-content)}.\\[\\&_\\[contenteditable\\]\\]\\:select-none [contenteditable]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.\\[\\&_\\[data-blok-tool\\=stub\\]\\]\\:opacity-55 [data-blok-tool=stub]{opacity:.55}.\\[\\&_\\[hidden\\]\\]\\:\\!hidden [hidden]{display:none!important}.\\[\\&_a\\]\\:cursor-pointer a{cursor:pointer}.\\[\\&_a\\]\\:text-link a{--tw-text-opacity: 1;color:rgb(56 138 229 / var(--tw-text-opacity, 1))}.\\[\\&_a\\]\\:underline a{text-decoration-line:underline}.\\[\\&_b\\]\\:font-bold b{font-weight:700}.\\[\\&_div\\]\\:\\!m-0 div{margin:0!important}.\\[\\&_div\\]\\:\\!p-0 div{padding:0!important}.\\[\\&_i\\]\\:italic i{font-style:italic}.\\[\\&_img\\]\\:opacity-55 img{opacity:.55}.\\[\\&_p\\]\\:\\!m-0 p{margin:0!important}.\\[\\&_p\\]\\:\\!p-0 p{padding:0!important}.\\[\\&_path\\]\\:stroke-current path{stroke:currentColor}.\\[\\&_svg\\]\\:block svg{display:block}.\\[\\&_svg\\]\\:size-icon svg{width:20px;height:20px}.\\[\\&_svg\\]\\:h-6 svg{height:1.5rem}.\\[\\&_svg\\]\\:h-7 svg{height:1.75rem}.\\[\\&_svg\\]\\:h-icon svg{height:20px}.\\[\\&_svg\\]\\:max-h-full svg{max-height:100%}.\\[\\&_svg\\]\\:w-6 svg{width:1.5rem}.\\[\\&_svg\\]\\:w-7 svg{width:1.75rem}.\\[\\&_svg\\]\\:w-icon svg{width:20px}.\\[\\&_svg\\]\\:text-gray-text svg{--tw-text-opacity: 1;color:rgb(112 118 132 / var(--tw-text-opacity, 1))}@media(max-width:650px){.mobile\\:\\[\\&_svg\\]\\:h-icon-mobile svg{height:28px}.mobile\\:\\[\\&_svg\\]\\:w-icon-mobile svg{width:28px}}`, go = 100;
|
|
11910
11959
|
class Oi extends T {
|
|
11911
11960
|
constructor() {
|
|
@@ -11913,7 +11962,7 @@ class Oi extends T {
|
|
|
11913
11962
|
this.windowResize();
|
|
11914
11963
|
}, 200), this.selectionChangeDebounced = $e(() => {
|
|
11915
11964
|
this.selectionChanged();
|
|
11916
|
-
},
|
|
11965
|
+
}, bn), this.documentTouchedListener = (t) => {
|
|
11917
11966
|
this.documentTouched(t);
|
|
11918
11967
|
};
|
|
11919
11968
|
}
|
|
@@ -11981,7 +12030,7 @@ class Oi extends T {
|
|
|
11981
12030
|
* Check for some Flipper-buttons is under focus
|
|
11982
12031
|
*/
|
|
11983
12032
|
get someFlipperButtonFocused() {
|
|
11984
|
-
return this.Blok.Toolbar.toolbox.hasFocus() ? !0 : Object.entries(this.Blok).filter(([t, e]) => e.flipper instanceof
|
|
12033
|
+
return this.Blok.Toolbar.toolbox.hasFocus() ? !0 : Object.entries(this.Blok).filter(([t, e]) => e.flipper instanceof Q).some(([t, e]) => e.flipper.hasFocus());
|
|
11985
12034
|
}
|
|
11986
12035
|
/**
|
|
11987
12036
|
* Clean blok`s UI
|
|
@@ -12000,8 +12049,8 @@ class Oi extends T {
|
|
|
12000
12049
|
* Check for mobile mode and save the result
|
|
12001
12050
|
*/
|
|
12002
12051
|
setIsMobile() {
|
|
12003
|
-
const t = window.innerWidth <
|
|
12004
|
-
t !== this.isMobile && this.eventsDispatcher.emit(
|
|
12052
|
+
const t = window.innerWidth < kn;
|
|
12053
|
+
t !== this.isMobile && this.eventsDispatcher.emit(wt, {
|
|
12005
12054
|
isEnabled: this.isMobile
|
|
12006
12055
|
}), this.isMobile = t;
|
|
12007
12056
|
}
|
|
@@ -12199,7 +12248,7 @@ class Oi extends T {
|
|
|
12199
12248
|
backspacePressed(t) {
|
|
12200
12249
|
if (this.Blok.BlockSettings.contains(t.target))
|
|
12201
12250
|
return;
|
|
12202
|
-
const { BlockManager: e, BlockSelection: o, Caret: n } = this.Blok, s =
|
|
12251
|
+
const { BlockManager: e, BlockSelection: o, Caret: n } = this.Blok, s = w.isSelectionExists, i = w.isCollapsed;
|
|
12203
12252
|
if (!(o.anyBlockSelected && (!s || i === !0 || this.Blok.CrossBlockSelection.isCrossBlockSelectionStarted)))
|
|
12204
12253
|
return;
|
|
12205
12254
|
const l = e.removeSelectedBlocks();
|
|
@@ -12258,7 +12307,7 @@ class Oi extends T {
|
|
|
12258
12307
|
n.keydown(t);
|
|
12259
12308
|
return;
|
|
12260
12309
|
}
|
|
12261
|
-
const s = e.currentBlockIndex >= 0, i =
|
|
12310
|
+
const s = e.currentBlockIndex >= 0, i = w.isSelectionExists, r = w.isCollapsed;
|
|
12262
12311
|
if (o.anyBlockSelected && (!i || r === !0)) {
|
|
12263
12312
|
o.clearSelection(t), t.preventDefault(), t.stopImmediatePropagation(), t.stopPropagation();
|
|
12264
12313
|
return;
|
|
@@ -12274,15 +12323,15 @@ class Oi extends T {
|
|
|
12274
12323
|
* @param {MouseEvent} event - Click event
|
|
12275
12324
|
*/
|
|
12276
12325
|
documentClicked(t) {
|
|
12277
|
-
var p,
|
|
12326
|
+
var p, k;
|
|
12278
12327
|
if (!t.isTrusted)
|
|
12279
12328
|
return;
|
|
12280
|
-
const e = t.target, o = this.nodes.holder.contains(e) ||
|
|
12329
|
+
const e = t.target, o = this.nodes.holder.contains(e) || w.isAtBlok, n = this.nodes.redactor.contains(e), s = this.Blok.Toolbar.contains(e), i = this.Blok.InlineToolbar.containsNode(e), r = o || s, l = this.Blok.BlockSettings.contains(e), c = (p = this.Blok.Toolbar.nodes.settingsToggler) == null ? void 0 : p.contains(e), d = (k = this.Blok.Toolbar.nodes.plusButton) == null ? void 0 : k.contains(e), h = l || c || d;
|
|
12281
12330
|
(!r || !n && !s) && !h && (this.Blok.BlockManager.unsetCurrentBlock(), this.Blok.Toolbar.close());
|
|
12282
12331
|
const f = this.Blok.BlockSettings.opened && !h;
|
|
12283
12332
|
if (f && this.Blok.BlockSettings.close(), f && n) {
|
|
12284
|
-
const
|
|
12285
|
-
this.Blok.Toolbar.moveAndOpen(
|
|
12333
|
+
const b = this.Blok.BlockManager.getBlockByChildNode(e);
|
|
12334
|
+
this.Blok.Toolbar.moveAndOpen(b);
|
|
12286
12335
|
}
|
|
12287
12336
|
h || this.Blok.BlockSelection.clearSelection(t), this.Blok.InlineToolbar.opened && !i && this.Blok.InlineToolbar.close();
|
|
12288
12337
|
}
|
|
@@ -12326,7 +12375,7 @@ class Oi extends T {
|
|
|
12326
12375
|
* - otherwise, add a new empty Block and set a Caret to that
|
|
12327
12376
|
*/
|
|
12328
12377
|
redactorClicked(t) {
|
|
12329
|
-
if (!
|
|
12378
|
+
if (!w.isCollapsed)
|
|
12330
12379
|
return;
|
|
12331
12380
|
const e = t.target, o = t.metaKey || t.ctrlKey;
|
|
12332
12381
|
if (!(g.isAnchor(e) && o)) {
|
|
@@ -12367,10 +12416,10 @@ class Oi extends T {
|
|
|
12367
12416
|
*/
|
|
12368
12417
|
selectionChanged() {
|
|
12369
12418
|
var u, f, p;
|
|
12370
|
-
const { CrossBlockSelection: t, BlockSelection: e } = this.Blok, o =
|
|
12371
|
-
if (t.isCrossBlockSelectionStarted && e.anyBlockSelected && ((u =
|
|
12419
|
+
const { CrossBlockSelection: t, BlockSelection: e } = this.Blok, o = w.anchorElement;
|
|
12420
|
+
if (t.isCrossBlockSelectionStarted && e.anyBlockSelected && ((u = w.get()) == null || u.removeAllRanges()), document.querySelector('[data-blok-fake-background="true"]') !== null && ((p = (f = this.Blok) == null ? void 0 : f.InlineToolbar) != null && p.opened) || (!o && !w.range && this.Blok.InlineToolbar.close(), !o))
|
|
12372
12421
|
return;
|
|
12373
|
-
const s = o.closest('[data-blok-testid="block-content"]'), i = s === null || s.closest('[data-blok-testid="blok-editor"]') !== this.nodes.wrapper, r = o.getAttribute("data-blok-inline-toolbar") === "true", l = i && !this.Blok.InlineToolbar.containsNode(o), c =
|
|
12422
|
+
const s = o.closest('[data-blok-testid="block-content"]'), i = s === null || s.closest('[data-blok-testid="blok-editor"]') !== this.nodes.wrapper, r = o.getAttribute("data-blok-inline-toolbar") === "true", l = i && !this.Blok.InlineToolbar.containsNode(o), c = w.get(), d = !c || c.isCollapsed || w.text.length === 0, h = this.Blok.InlineToolbar.hasFlipperFocus;
|
|
12374
12423
|
if (d && this.Blok.InlineToolbar.opened && !h) {
|
|
12375
12424
|
this.Blok.InlineToolbar.close();
|
|
12376
12425
|
return;
|
|
@@ -12387,28 +12436,80 @@ class Oi extends T {
|
|
|
12387
12436
|
enableInputsEmptyMark() {
|
|
12388
12437
|
const t = (e) => {
|
|
12389
12438
|
const o = e.target;
|
|
12390
|
-
|
|
12439
|
+
ko(o);
|
|
12391
12440
|
};
|
|
12392
12441
|
this.readOnlyMutableListeners.on(this.nodes.wrapper, "input", t), this.readOnlyMutableListeners.on(this.nodes.wrapper, "focusin", t), this.readOnlyMutableListeners.on(this.nodes.wrapper, "focusout", t);
|
|
12393
12442
|
}
|
|
12394
12443
|
}
|
|
12395
|
-
const Ni =
|
|
12444
|
+
const Ni = [
|
|
12445
|
+
"format",
|
|
12446
|
+
"structural",
|
|
12447
|
+
"paste",
|
|
12448
|
+
"cut"
|
|
12449
|
+
];
|
|
12450
|
+
class Ri {
|
|
12451
|
+
/**
|
|
12452
|
+
* Determines if a checkpoint should be created before recording this mutation
|
|
12453
|
+
* @param metadata - mutation metadata with action type info
|
|
12454
|
+
* @param blockId - ID of the block being mutated
|
|
12455
|
+
* @returns true if a checkpoint should be created
|
|
12456
|
+
*/
|
|
12457
|
+
shouldCreateCheckpoint(t, e) {
|
|
12458
|
+
var n;
|
|
12459
|
+
const o = (n = t.actionType) != null ? n : "insert";
|
|
12460
|
+
return this.currentContext ? this.currentContext.blockId !== e || this.currentContext.type !== o : !1;
|
|
12461
|
+
}
|
|
12462
|
+
/**
|
|
12463
|
+
* Checks if this action type should trigger an immediate checkpoint
|
|
12464
|
+
* @param actionType - the action type to check
|
|
12465
|
+
* @returns true if this action should create an immediate checkpoint
|
|
12466
|
+
*/
|
|
12467
|
+
isImmediateCheckpoint(t) {
|
|
12468
|
+
return Ni.includes(t);
|
|
12469
|
+
}
|
|
12470
|
+
/**
|
|
12471
|
+
* Updates the current action context
|
|
12472
|
+
* @param actionType - the new action type
|
|
12473
|
+
* @param blockId - the block being edited
|
|
12474
|
+
*/
|
|
12475
|
+
updateContext(t, e) {
|
|
12476
|
+
this.currentContext = {
|
|
12477
|
+
type: t,
|
|
12478
|
+
blockId: e,
|
|
12479
|
+
timestamp: Date.now()
|
|
12480
|
+
};
|
|
12481
|
+
}
|
|
12482
|
+
/**
|
|
12483
|
+
* Gets the current action context
|
|
12484
|
+
* @returns the current context or undefined
|
|
12485
|
+
*/
|
|
12486
|
+
getCurrentContext() {
|
|
12487
|
+
return this.currentContext;
|
|
12488
|
+
}
|
|
12489
|
+
/**
|
|
12490
|
+
* Clears the current action context
|
|
12491
|
+
*/
|
|
12492
|
+
clearContext() {
|
|
12493
|
+
this.currentContext = void 0;
|
|
12494
|
+
}
|
|
12495
|
+
}
|
|
12496
|
+
const Pi = 30, Hi = 200, Fi = 100, rt = class rt extends T {
|
|
12396
12497
|
constructor() {
|
|
12397
|
-
super(...arguments), this.undoStack = [], this.redoStack = [], this.registeredShortcuts = [], this.debounceTimeout = null, this.isPerformingUndoRedo = !1, this.initialStateCaptured = !1;
|
|
12498
|
+
super(...arguments), this.undoStack = [], this.redoStack = [], this.registeredShortcuts = [], this.debounceTimeout = null, this.isPerformingUndoRedo = !1, this.initialStateCaptured = !1, this.smartGrouping = new Ri(), this.currentActionType = "insert", this.keydownHandler = null;
|
|
12398
12499
|
}
|
|
12399
12500
|
/**
|
|
12400
12501
|
* Maximum number of entries in history stack
|
|
12401
12502
|
*/
|
|
12402
12503
|
get maxHistoryLength() {
|
|
12403
12504
|
var t;
|
|
12404
|
-
return (t = this.config.maxHistoryLength) != null ? t :
|
|
12505
|
+
return (t = this.config.maxHistoryLength) != null ? t : Pi;
|
|
12405
12506
|
}
|
|
12406
12507
|
/**
|
|
12407
12508
|
* Debounce time for batching changes
|
|
12408
12509
|
*/
|
|
12409
12510
|
get debounceTime() {
|
|
12410
12511
|
var t;
|
|
12411
|
-
return (t = this.config.historyDebounceTime) != null ? t :
|
|
12512
|
+
return (t = this.config.historyDebounceTime) != null ? t : Hi;
|
|
12412
12513
|
}
|
|
12413
12514
|
/**
|
|
12414
12515
|
* Whether to use document-level shortcuts for undo/redo
|
|
@@ -12422,7 +12523,7 @@ const Ni = 30, Ri = 200, Pi = 100, rt = class rt extends T {
|
|
|
12422
12523
|
* Sets up event listeners and keyboard shortcuts
|
|
12423
12524
|
*/
|
|
12424
12525
|
async prepare() {
|
|
12425
|
-
this.setupEventListeners(), this.setupKeyboardShortcuts();
|
|
12526
|
+
this.setupEventListeners(), this.setupKeyboardShortcuts(), this.setupActionTypeTracking();
|
|
12426
12527
|
}
|
|
12427
12528
|
/**
|
|
12428
12529
|
* Captures the initial document state
|
|
@@ -12505,13 +12606,13 @@ const Ni = 30, Ri = 200, Pi = 100, rt = class rt extends T {
|
|
|
12505
12606
|
* Clears history stacks
|
|
12506
12607
|
*/
|
|
12507
12608
|
clear() {
|
|
12508
|
-
this.clearDebounce(), this.undoStack = [], this.redoStack = [], this.initialStateCaptured = !1, this.emitStateChanged();
|
|
12609
|
+
this.clearDebounce(), this.undoStack = [], this.redoStack = [], this.initialStateCaptured = !1, this.smartGrouping.clearContext(), this.emitStateChanged();
|
|
12509
12610
|
}
|
|
12510
12611
|
/**
|
|
12511
12612
|
* Sets up listeners for block mutation events
|
|
12512
12613
|
*/
|
|
12513
12614
|
setupEventListeners() {
|
|
12514
|
-
this.eventsDispatcher.on(
|
|
12615
|
+
this.eventsDispatcher.on(yt, (t) => {
|
|
12515
12616
|
this.handleBlockMutation(t.event);
|
|
12516
12617
|
});
|
|
12517
12618
|
}
|
|
@@ -12566,40 +12667,74 @@ const Ni = 30, Ri = 200, Pi = 100, rt = class rt extends T {
|
|
|
12566
12667
|
const e = (n = (o = this.Blok.UI) == null ? void 0 : o.nodes) == null ? void 0 : n.wrapper;
|
|
12567
12668
|
return e != null && e.contains(t) ? !1 : !!(t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t.isContentEditable);
|
|
12568
12669
|
}
|
|
12670
|
+
/**
|
|
12671
|
+
* Sets up keydown tracking for action type detection
|
|
12672
|
+
*/
|
|
12673
|
+
setupActionTypeTracking() {
|
|
12674
|
+
setTimeout(() => {
|
|
12675
|
+
var e, o;
|
|
12676
|
+
const t = (o = (e = this.Blok.UI) == null ? void 0 : e.nodes) == null ? void 0 : o.redactor;
|
|
12677
|
+
t && (this.keydownHandler = (n) => {
|
|
12678
|
+
if (n.key === "Backspace") {
|
|
12679
|
+
this.currentActionType = "delete-back";
|
|
12680
|
+
return;
|
|
12681
|
+
}
|
|
12682
|
+
if (n.key === "Delete") {
|
|
12683
|
+
this.currentActionType = "delete-fwd";
|
|
12684
|
+
return;
|
|
12685
|
+
}
|
|
12686
|
+
n.key.length === 1 && !n.ctrlKey && !n.metaKey && (this.currentActionType = "insert");
|
|
12687
|
+
}, t.addEventListener("keydown", this.keydownHandler));
|
|
12688
|
+
}, 0);
|
|
12689
|
+
}
|
|
12569
12690
|
/**
|
|
12570
12691
|
* Handles block mutation events
|
|
12571
|
-
*
|
|
12692
|
+
* Uses smart grouping to create checkpoints when action type changes
|
|
12572
12693
|
*/
|
|
12573
12694
|
handleBlockMutation(t) {
|
|
12574
|
-
if (rt.activeInstance = this,
|
|
12575
|
-
|
|
12576
|
-
|
|
12577
|
-
|
|
12578
|
-
|
|
12579
|
-
this.clearDebounce(), this.debounceTimeout = setTimeout(() => {
|
|
12580
|
-
this.recordState();
|
|
12581
|
-
}, this.debounceTime);
|
|
12695
|
+
if (rt.activeInstance = this, this.isPerformingUndoRedo)
|
|
12696
|
+
return;
|
|
12697
|
+
if (!this.initialStateCaptured) {
|
|
12698
|
+
this.captureInitialState();
|
|
12699
|
+
return;
|
|
12582
12700
|
}
|
|
12701
|
+
const e = t.detail.target.id, o = this.smartGrouping.shouldCreateCheckpoint(
|
|
12702
|
+
{ actionType: this.currentActionType },
|
|
12703
|
+
e
|
|
12704
|
+
), n = this.smartGrouping.isImmediateCheckpoint(this.currentActionType);
|
|
12705
|
+
o || n ? (this.clearDebounce(), this.recordState().then(() => {
|
|
12706
|
+
this.smartGrouping.updateContext(this.currentActionType, e), this.startDebounce();
|
|
12707
|
+
})) : (this.smartGrouping.updateContext(this.currentActionType, e), this.clearDebounce(), this.startDebounce());
|
|
12708
|
+
}
|
|
12709
|
+
/**
|
|
12710
|
+
* Starts the debounce timer for recording state
|
|
12711
|
+
*/
|
|
12712
|
+
startDebounce() {
|
|
12713
|
+
this.debounceTimeout = setTimeout(() => {
|
|
12714
|
+
this.recordState();
|
|
12715
|
+
}, this.debounceTime);
|
|
12583
12716
|
}
|
|
12584
12717
|
/**
|
|
12585
12718
|
* Records the current state to history
|
|
12586
12719
|
*/
|
|
12587
12720
|
async recordState() {
|
|
12588
|
-
var
|
|
12721
|
+
var s, i;
|
|
12589
12722
|
if (this.isPerformingUndoRedo)
|
|
12590
12723
|
return;
|
|
12591
|
-
((
|
|
12724
|
+
((s = document.activeElement) == null ? void 0 : s.hasAttribute("data-blok-testid")) && ((i = document.activeElement) == null ? void 0 : i.getAttribute("data-blok-testid")) === "inline-tool-input" || this.Blok.SelectionAPI.methods.clearFakeBackground();
|
|
12592
12725
|
const e = await this.getCurrentState();
|
|
12593
12726
|
if (!e)
|
|
12594
12727
|
return;
|
|
12595
|
-
const o = this.getCaretPosition();
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
this.undoStack.
|
|
12602
|
-
|
|
12728
|
+
const o = this.getCaretPosition(), n = this.undoStack[this.undoStack.length - 1];
|
|
12729
|
+
if (!(n && this.areStatesEqual(n.state, e))) {
|
|
12730
|
+
for (this.redoStack = [], this.undoStack.push({
|
|
12731
|
+
state: e,
|
|
12732
|
+
timestamp: Date.now(),
|
|
12733
|
+
caretPosition: o
|
|
12734
|
+
}); this.undoStack.length > this.maxHistoryLength; )
|
|
12735
|
+
this.undoStack.shift();
|
|
12736
|
+
this.emitStateChanged();
|
|
12737
|
+
}
|
|
12603
12738
|
}
|
|
12604
12739
|
/**
|
|
12605
12740
|
* Gets current document state without sanitization
|
|
@@ -12616,7 +12751,7 @@ const Ni = 30, Ri = 200, Pi = 100, rt = class rt extends T {
|
|
|
12616
12751
|
};
|
|
12617
12752
|
const o = e.map(async (i) => {
|
|
12618
12753
|
const r = await i.save();
|
|
12619
|
-
return !r || r.data === void 0 || !await i.validate(r.data) ? null :
|
|
12754
|
+
return !r || r.data === void 0 || !await i.validate(r.data) ? null : y({
|
|
12620
12755
|
id: r.id,
|
|
12621
12756
|
type: r.tool,
|
|
12622
12757
|
data: r.data
|
|
@@ -12631,6 +12766,22 @@ const Ni = 30, Ri = 200, Pi = 100, rt = class rt extends T {
|
|
|
12631
12766
|
return null;
|
|
12632
12767
|
}
|
|
12633
12768
|
}
|
|
12769
|
+
/**
|
|
12770
|
+
* Compares two states for equality (ignoring timestamps)
|
|
12771
|
+
* @param a - first state
|
|
12772
|
+
* @param b - second state
|
|
12773
|
+
* @returns true if the block content is identical
|
|
12774
|
+
*/
|
|
12775
|
+
areStatesEqual(t, e) {
|
|
12776
|
+
return t.blocks.length !== e.blocks.length ? !1 : t.blocks.every((o, n) => {
|
|
12777
|
+
var l, c;
|
|
12778
|
+
const s = e.blocks[n];
|
|
12779
|
+
if (o.id !== s.id || o.type !== s.type || JSON.stringify(o.data) !== JSON.stringify(s.data))
|
|
12780
|
+
return !1;
|
|
12781
|
+
const i = JSON.stringify((l = o.tunes) != null ? l : {}), r = JSON.stringify((c = s.tunes) != null ? c : {});
|
|
12782
|
+
return i === r;
|
|
12783
|
+
});
|
|
12784
|
+
}
|
|
12634
12785
|
/**
|
|
12635
12786
|
* Restores document to a given state using smart diffing
|
|
12636
12787
|
* Only updates blocks that have changed to preserve DOM state
|
|
@@ -12665,12 +12816,12 @@ const Ni = 30, Ri = 200, Pi = 100, rt = class rt extends T {
|
|
|
12665
12816
|
for (const f of n)
|
|
12666
12817
|
r.has(f.id) || l.push(f);
|
|
12667
12818
|
const c = [];
|
|
12668
|
-
for (const [f, { data: p, index:
|
|
12669
|
-
i.has(f) || c.push({ data: p, index:
|
|
12819
|
+
for (const [f, { data: p, index: k }] of r)
|
|
12820
|
+
i.has(f) || c.push({ data: p, index: k });
|
|
12670
12821
|
const d = [];
|
|
12671
|
-
for (const [f, { data: p, index:
|
|
12672
|
-
const
|
|
12673
|
-
|
|
12822
|
+
for (const [f, { data: p, index: k }] of r) {
|
|
12823
|
+
const b = i.get(f);
|
|
12824
|
+
b && d.push({ block: b.block, data: p, targetIndex: k });
|
|
12674
12825
|
}
|
|
12675
12826
|
const h = l.length + c.length;
|
|
12676
12827
|
if (h > n.length / 2 || h > 5 || n.length === 0) {
|
|
@@ -12680,8 +12831,8 @@ const Ni = 30, Ri = 200, Pi = 100, rt = class rt extends T {
|
|
|
12680
12831
|
for (const f of l)
|
|
12681
12832
|
await e.removeBlock(f);
|
|
12682
12833
|
for (const { block: f, data: p } of d) {
|
|
12683
|
-
const
|
|
12684
|
-
if (!(JSON.stringify(
|
|
12834
|
+
const k = await f.data;
|
|
12835
|
+
if (!(JSON.stringify(k) !== JSON.stringify(p.data)))
|
|
12685
12836
|
continue;
|
|
12686
12837
|
await f.setData(p.data) || await e.update(f, p.data, p.tunes);
|
|
12687
12838
|
}
|
|
@@ -12718,7 +12869,7 @@ const Ni = 30, Ri = 200, Pi = 100, rt = class rt extends T {
|
|
|
12718
12869
|
* This helps ignore late-firing events after state restore
|
|
12719
12870
|
*/
|
|
12720
12871
|
cooldown() {
|
|
12721
|
-
return new Promise((t) => setTimeout(t,
|
|
12872
|
+
return new Promise((t) => setTimeout(t, Fi));
|
|
12722
12873
|
}
|
|
12723
12874
|
/**
|
|
12724
12875
|
* Captures current caret position for later restoration
|
|
@@ -12913,15 +13064,18 @@ const Ni = 30, Ri = 200, Pi = 100, rt = class rt extends T {
|
|
|
12913
13064
|
* Removes shortcuts and clears state
|
|
12914
13065
|
*/
|
|
12915
13066
|
destroy() {
|
|
13067
|
+
var e, o;
|
|
12916
13068
|
this.clearDebounce();
|
|
12917
|
-
for (const { name:
|
|
12918
|
-
z.remove(
|
|
12919
|
-
this.registeredShortcuts = []
|
|
13069
|
+
for (const { name: n, element: s } of this.registeredShortcuts)
|
|
13070
|
+
z.remove(s, n);
|
|
13071
|
+
this.registeredShortcuts = [];
|
|
13072
|
+
const t = (o = (e = this.Blok.UI) == null ? void 0 : e.nodes) == null ? void 0 : o.redactor;
|
|
13073
|
+
this.keydownHandler && t && t.removeEventListener("keydown", this.keydownHandler), this.keydownHandler = null, rt.activeInstance === this && (rt.activeInstance = null), this.undoStack = [], this.redoStack = [], this.initialStateCaptured = !1, this.smartGrouping.clearContext();
|
|
12920
13074
|
}
|
|
12921
13075
|
};
|
|
12922
13076
|
rt.activeInstance = null;
|
|
12923
|
-
let
|
|
12924
|
-
const
|
|
13077
|
+
let be = rt;
|
|
13078
|
+
const _i = {
|
|
12925
13079
|
// API Modules
|
|
12926
13080
|
BlocksAPI: An,
|
|
12927
13081
|
CaretAPI: Dn,
|
|
@@ -12938,8 +13092,8 @@ const Hi = {
|
|
|
12938
13092
|
ToolsAPI: is,
|
|
12939
13093
|
StylesAPI: rs,
|
|
12940
13094
|
ToolbarAPI: as,
|
|
12941
|
-
TooltipAPI:
|
|
12942
|
-
UiAPI:
|
|
13095
|
+
TooltipAPI: ks,
|
|
13096
|
+
UiAPI: bs,
|
|
12943
13097
|
HistoryAPI: vs,
|
|
12944
13098
|
// Toolbar Modules
|
|
12945
13099
|
BlockSettings: As,
|
|
@@ -12957,18 +13111,18 @@ const Hi = {
|
|
|
12957
13111
|
Paste: fe,
|
|
12958
13112
|
ReadOnly: hi,
|
|
12959
13113
|
RectangleSelection: ui,
|
|
12960
|
-
Renderer:
|
|
13114
|
+
Renderer: Si,
|
|
12961
13115
|
Saver: Ii,
|
|
12962
|
-
Tools:
|
|
13116
|
+
Tools: ke,
|
|
12963
13117
|
UI: Oi,
|
|
12964
|
-
History:
|
|
13118
|
+
History: be
|
|
12965
13119
|
};
|
|
12966
|
-
class
|
|
13120
|
+
class zi {
|
|
12967
13121
|
/**
|
|
12968
13122
|
* @param {BlokConfig} config - user configuration
|
|
12969
13123
|
*/
|
|
12970
13124
|
constructor(t) {
|
|
12971
|
-
this.moduleInstances = {}, this.eventsDispatcher = new
|
|
13125
|
+
this.moduleInstances = {}, this.eventsDispatcher = new St(), this.config = {}, this.isReady = new Promise((e, o) => {
|
|
12972
13126
|
Promise.resolve().then(async () => {
|
|
12973
13127
|
this.configuration = t, this.validate(), this.init(), await this.start(), await this.render();
|
|
12974
13128
|
const { BlockManager: n, Caret: s, UI: i, ModificationsObserver: r, History: l } = this.moduleInstances;
|
|
@@ -12984,7 +13138,7 @@ class Fi {
|
|
|
12984
13138
|
*/
|
|
12985
13139
|
set configuration(t) {
|
|
12986
13140
|
var l, c, d, h;
|
|
12987
|
-
A(t) ? this.config =
|
|
13141
|
+
A(t) ? this.config = y({}, t) : this.config = {
|
|
12988
13142
|
holder: t
|
|
12989
13143
|
}, this.config.holder == null && (this.config.holder = "blok"), this.config.logLevel == null && (this.config.logLevel = vn.VERBOSE), Bn(this.config.logLevel), this.config.defaultBlock = (l = this.config.defaultBlock) != null ? l : "paragraph";
|
|
12990
13144
|
const e = this.config.tools, o = this.config.defaultBlock, n = e != null && Object.prototype.hasOwnProperty.call(e, o != null ? o : ""), s = (c = this.config.data) == null ? void 0 : c.blocks, i = Array.isArray(s) && s.length > 0;
|
|
@@ -12993,7 +13147,7 @@ class Fi {
|
|
|
12993
13147
|
`Default block "${o}" is not configured. Falling back to "paragraph" tool.`,
|
|
12994
13148
|
"warn"
|
|
12995
13149
|
), this.config.defaultBlock = "paragraph";
|
|
12996
|
-
const u = this.config.tools, f =
|
|
13150
|
+
const u = this.config.tools, f = y({}, u != null ? u : {}), p = f.paragraph;
|
|
12997
13151
|
f.paragraph = this.createParagraphToolConfig(p), this.config.tools = f;
|
|
12998
13152
|
}
|
|
12999
13153
|
this.config.minHeight = this.config.minHeight !== void 0 ? this.config.minHeight : 300;
|
|
@@ -13053,7 +13207,7 @@ class Fi {
|
|
|
13053
13207
|
try {
|
|
13054
13208
|
await this.moduleInstances[o].prepare();
|
|
13055
13209
|
} catch (n) {
|
|
13056
|
-
if (n instanceof
|
|
13210
|
+
if (n instanceof kt)
|
|
13057
13211
|
throw new Error(n.message);
|
|
13058
13212
|
I(`Module ${o} was skipped because of %o`, "warn", n);
|
|
13059
13213
|
}
|
|
@@ -13067,16 +13221,16 @@ class Fi {
|
|
|
13067
13221
|
render() {
|
|
13068
13222
|
const t = this.moduleInstances.Renderer;
|
|
13069
13223
|
if (!t)
|
|
13070
|
-
throw new
|
|
13224
|
+
throw new kt("Renderer module is not initialized");
|
|
13071
13225
|
if (!this.config.data)
|
|
13072
|
-
throw new
|
|
13226
|
+
throw new kt("Blok data is not initialized");
|
|
13073
13227
|
return t.render(this.config.data.blocks);
|
|
13074
13228
|
}
|
|
13075
13229
|
/**
|
|
13076
13230
|
* Make modules instances and save it to the @property this.moduleInstances
|
|
13077
13231
|
*/
|
|
13078
13232
|
constructModules() {
|
|
13079
|
-
Object.entries(
|
|
13233
|
+
Object.entries(_i).forEach(([t, e]) => {
|
|
13080
13234
|
try {
|
|
13081
13235
|
this.moduleInstances[t] = new e({
|
|
13082
13236
|
config: this.configuration,
|
|
@@ -13117,8 +13271,8 @@ class Fi {
|
|
|
13117
13271
|
};
|
|
13118
13272
|
if (A(t)) {
|
|
13119
13273
|
const e = t, o = e.config;
|
|
13120
|
-
return
|
|
13121
|
-
config:
|
|
13274
|
+
return P(y({}, e), {
|
|
13275
|
+
config: P(y({}, A(o) ? o : {}), {
|
|
13122
13276
|
preserveBlank: !0
|
|
13123
13277
|
})
|
|
13124
13278
|
});
|
|
@@ -13140,7 +13294,7 @@ class Fi {
|
|
|
13140
13294
|
return e;
|
|
13141
13295
|
}
|
|
13142
13296
|
}
|
|
13143
|
-
const
|
|
13297
|
+
const $i = _t(), vt = class vt {
|
|
13144
13298
|
/** Blok version */
|
|
13145
13299
|
static get version() {
|
|
13146
13300
|
return _t();
|
|
@@ -13149,9 +13303,9 @@ const Ki = _t(), vt = class vt {
|
|
|
13149
13303
|
* @param {BlokConfig|string|undefined} [configuration] - user configuration
|
|
13150
13304
|
*/
|
|
13151
13305
|
constructor(t) {
|
|
13152
|
-
this.initialConfiguration = A(t) ?
|
|
13306
|
+
this.initialConfiguration = A(t) ? y({}, t) : t;
|
|
13153
13307
|
const e = A(t) && E(t.onReady) ? t.onReady : () => {
|
|
13154
|
-
}, o = new
|
|
13308
|
+
}, o = new zi(t);
|
|
13155
13309
|
this.destroy = () => {
|
|
13156
13310
|
}, this.isReady = o.isReady.then(() => {
|
|
13157
13311
|
this.exportAPI(o), e();
|
|
@@ -13162,30 +13316,30 @@ const Ki = _t(), vt = class vt {
|
|
|
13162
13316
|
* @param {Core} blok — Blok's instance
|
|
13163
13317
|
*/
|
|
13164
13318
|
exportAPI(t) {
|
|
13165
|
-
var p,
|
|
13319
|
+
var p, k;
|
|
13166
13320
|
const e = ["configuration"], o = () => {
|
|
13167
|
-
Object.values(t.moduleInstances).forEach((
|
|
13168
|
-
if (
|
|
13321
|
+
Object.values(t.moduleInstances).forEach((b) => {
|
|
13322
|
+
if (b == null)
|
|
13169
13323
|
return;
|
|
13170
|
-
E(
|
|
13171
|
-
const B =
|
|
13324
|
+
E(b.destroy) && b.destroy();
|
|
13325
|
+
const B = b.listeners;
|
|
13172
13326
|
B && E(B.removeAll) && B.removeAll();
|
|
13173
13327
|
}), ms();
|
|
13174
|
-
for (const
|
|
13175
|
-
Object.prototype.hasOwnProperty.call(this,
|
|
13328
|
+
for (const b in this)
|
|
13329
|
+
Object.prototype.hasOwnProperty.call(this, b) && delete this[b];
|
|
13176
13330
|
Object.setPrototypeOf(this, null);
|
|
13177
13331
|
};
|
|
13178
|
-
e.forEach((
|
|
13179
|
-
if (
|
|
13180
|
-
this[
|
|
13332
|
+
e.forEach((b) => {
|
|
13333
|
+
if (b !== "configuration") {
|
|
13334
|
+
this[b] = t[b];
|
|
13181
13335
|
return;
|
|
13182
13336
|
}
|
|
13183
13337
|
const B = t.configuration, x = A(this.initialConfiguration) ? this.initialConfiguration : B != null ? B : this.initialConfiguration;
|
|
13184
|
-
x !== void 0 && (this[
|
|
13338
|
+
x !== void 0 && (this[b] = x);
|
|
13185
13339
|
}), this.destroy = o;
|
|
13186
|
-
const n = t.moduleInstances.API.methods, s = (
|
|
13340
|
+
const n = t.moduleInstances.API.methods, s = (k = (p = t.moduleInstances.EventsAPI) == null ? void 0 : p.methods) != null ? k : n.events;
|
|
13187
13341
|
if (s !== void 0) {
|
|
13188
|
-
const
|
|
13342
|
+
const b = (B) => {
|
|
13189
13343
|
Object.prototype.hasOwnProperty.call(B, "eventsDispatcher") || Object.defineProperty(B, "eventsDispatcher", {
|
|
13190
13344
|
value: s,
|
|
13191
13345
|
configurable: !0,
|
|
@@ -13193,16 +13347,16 @@ const Ki = _t(), vt = class vt {
|
|
|
13193
13347
|
writable: !1
|
|
13194
13348
|
});
|
|
13195
13349
|
};
|
|
13196
|
-
|
|
13350
|
+
b(n), b(this);
|
|
13197
13351
|
}
|
|
13198
13352
|
Object.getPrototypeOf(n) !== vt.prototype && Object.setPrototypeOf(n, vt.prototype), Object.setPrototypeOf(this, n);
|
|
13199
|
-
const i = /* @__PURE__ */ Object.create(null), r = t.moduleInstances, l = r, c = (
|
|
13200
|
-
Object.keys(l).forEach((
|
|
13201
|
-
const B = c(
|
|
13353
|
+
const i = /* @__PURE__ */ Object.create(null), r = t.moduleInstances, l = r, c = (b) => /^[A-Z]+$/.test(b) ? b.toLowerCase() : b.charAt(0).toLowerCase() + b.slice(1);
|
|
13354
|
+
Object.keys(l).forEach((b) => {
|
|
13355
|
+
const B = c(b);
|
|
13202
13356
|
Object.defineProperty(i, B, {
|
|
13203
13357
|
configurable: !0,
|
|
13204
13358
|
enumerable: !0,
|
|
13205
|
-
get: () => l[
|
|
13359
|
+
get: () => l[b]
|
|
13206
13360
|
});
|
|
13207
13361
|
});
|
|
13208
13362
|
const d = r.Toolbar, h = r.BlockSettings;
|
|
@@ -13229,10 +13383,10 @@ const Ki = _t(), vt = class vt {
|
|
|
13229
13383
|
saver: {
|
|
13230
13384
|
save: "save"
|
|
13231
13385
|
}
|
|
13232
|
-
}).forEach(([
|
|
13233
|
-
Object.entries(B).forEach(([x,
|
|
13234
|
-
const
|
|
13235
|
-
this[
|
|
13386
|
+
}).forEach(([b, B]) => {
|
|
13387
|
+
Object.entries(B).forEach(([x, C]) => {
|
|
13388
|
+
const R = b, M = t.moduleInstances.API.methods[R];
|
|
13389
|
+
this[C] = M[x];
|
|
13236
13390
|
});
|
|
13237
13391
|
});
|
|
13238
13392
|
}
|
|
@@ -13241,6 +13395,6 @@ vt.DATA_ATTR = m;
|
|
|
13241
13395
|
let mo = vt;
|
|
13242
13396
|
export {
|
|
13243
13397
|
mo as B,
|
|
13244
|
-
|
|
13245
|
-
|
|
13398
|
+
Wi as e,
|
|
13399
|
+
$i as v
|
|
13246
13400
|
};
|