@templatical/editor 0.54.0 → 0.54.2
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/{AiAltTextPopover-NMJqQKvD.js → AiAltTextPopover-BBKVJ6HA.js} +1 -1
- package/dist/{AiAltTextReview-Ci4zHwRc.js → AiAltTextReview-BuVbeQh-.js} +1 -1
- package/dist/{AiRewriteMenu-CIHUnPud.js → AiRewriteMenu-ZpYJfm-O.js} +4 -4
- package/dist/{BlockPreviewCanvas-B70RSavL.js → BlockPreviewCanvas-DtOo5y3U.js} +6 -6
- package/dist/{CloudPanels-VpSQiLLL.js → CloudPanels-DQRWMc59.js} +1 -1
- package/dist/{CountdownToolbar-CM4XNEuO.js → CountdownToolbar-DTpMEDyh.js} +4 -4
- package/dist/{IssuesPanel-1wGV0wiy.js → IssuesPanel-BZn7-p9e.js} +1 -1
- package/dist/{LanguageMenu-d2GlX67r.js → LanguageMenu-OOmQWVzO.js} +5 -5
- package/dist/{LogicTagInsertButton-DgTJ6Lvx.js → LogicTagInsertButton-XESwnJia.js} +8 -8
- package/dist/{MergeTagInput-B_51YcQO.js → MergeTagInput-CAsBRoSm.js} +1 -1
- package/dist/{MergeTagModeToggle-D3Q2z317.js → MergeTagModeToggle-bOf27Hg1.js} +1 -1
- package/dist/{MergeTagTextarea-DZz1L9DE.js → MergeTagTextarea-DH_6JFui.js} +2 -2
- package/dist/{ParagraphEditor-CI68PYDL.js → ParagraphEditor-XGUkV5Uw.js} +12 -11
- package/dist/{RestoreVersionDialog-DcuhpOIz.js → RestoreVersionDialog-C72kWccI.js} +1 -1
- package/dist/{RichTextEditorContent-Dstovi0m.js → RichTextEditorContent-BZN8KRvR.js} +2 -2
- package/dist/{SaveBlockDialog-vuwvoi-d.js → SaveBlockDialog-CKOnTMTU.js} +4 -4
- package/dist/{SavedBlocksBrowserModal-DUJm0dOv.js → SavedBlocksBrowserModal-BrlNxqDH.js} +4 -4
- package/dist/{SavedBlocksPanels-BiMXQ5lY.js → SavedBlocksPanels--lPR6gdh.js} +1 -1
- package/dist/{SavedBlocksPickBar-CAstZfG7.js → SavedBlocksPickBar-4ON4_KKl.js} +1 -1
- package/dist/{TemplateSettings-Baar78_s.js → TemplateSettings-BE0jZmRJ.js} +4 -4
- package/dist/{TestEmailModal-Bl_GHdrN.js → TestEmailModal-BKmNGrZN.js} +5 -5
- package/dist/{TestEmailPanel-CpTBF7B5.js → TestEmailPanel-DT1wllX3.js} +1 -1
- package/dist/{TitleEditor-DkbEDAZB.js → TitleEditor-HjVZuUTB.js} +8 -7
- package/dist/{Toolbar-bOZ_eq7X.js → Toolbar-BppchV2k.js} +617 -617
- package/dist/{TplModal-wk2gLa7_.js → TplModal-BFWOoK8l.js} +1 -1
- package/dist/{VersionHistoryPanels-Cq2rFKIX.js → VersionHistoryPanels-D4yNVLvq.js} +1 -1
- package/dist/{WrapperBlock-cWT_nZgQ.js → WrapperBlock-BUzQTZuu.js} +3 -3
- package/dist/{blockTypeIcons-BUyPZ7Su.js → blockTypeIcons-D91v9k0x.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js → AiAltTextPopover-CAI18sdv.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js.map → AiAltTextPopover-CAI18sdv.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js → AiAltTextReview-CWEyMOF-.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js.map → AiAltTextReview-CWEyMOF-.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-C4btyN4W.js → AiRewriteMenu-BEepu1vo.js} +5 -5
- package/dist/cdn/chunks/{AiRewriteMenu-C4btyN4W.js.map → AiRewriteMenu-BEepu1vo.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-CTKmBPsq.js → BlockPreviewCanvas-B6ndvof2.js} +5 -5
- package/dist/cdn/chunks/{BlockPreviewCanvas-CTKmBPsq.js.map → BlockPreviewCanvas-B6ndvof2.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-COU26R83.js → CloudPanels-BGwDb0jB.js} +2 -2
- package/dist/cdn/chunks/{CloudPanels-COU26R83.js.map → CloudPanels-BGwDb0jB.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js → CountdownToolbar-B-0FsTj-.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js.map → CountdownToolbar-B-0FsTj-.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js → IssuesPanel-LyjMBDok.js} +3 -3
- package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js.map → IssuesPanel-LyjMBDok.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-B1Aue_lf.js → LanguageMenu-CGwMCOQ5.js} +4 -4
- package/dist/cdn/chunks/{LanguageMenu-B1Aue_lf.js.map → LanguageMenu-CGwMCOQ5.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js → LogicTagInsertButton-PDKuo2J3.js} +4 -4
- package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js.map → LogicTagInsertButton-PDKuo2J3.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js → MergeTagInput-DoQHBJk2.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js.map → MergeTagInput-DoQHBJk2.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js → MergeTagModeToggle-Ct5IG4VW.js} +2 -2
- package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js.map → MergeTagModeToggle-Ct5IG4VW.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js → MergeTagTextarea-BMsnjphR.js} +3 -3
- package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js.map → MergeTagTextarea-BMsnjphR.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-B2UU1Q5I.js → ParagraphEditor-CVW-kuHW.js} +114 -113
- package/dist/cdn/chunks/ParagraphEditor-CVW-kuHW.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog-C1Y5Ewo_.js → RestoreVersionDialog-7MFZz-Sb.js} +2 -2
- package/dist/cdn/chunks/{RestoreVersionDialog-C1Y5Ewo_.js.map → RestoreVersionDialog-7MFZz-Sb.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js → RichTextEditorContent-CiL-SkZg.js} +3 -3
- package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js.map → RichTextEditorContent-CiL-SkZg.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-B9lwEP_T.js → SaveBlockDialog-CxdekCYy.js} +5 -5
- package/dist/cdn/chunks/{SaveBlockDialog-B9lwEP_T.js.map → SaveBlockDialog-CxdekCYy.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-fAeHUyxb.js → SavedBlocksBrowserModal-D9CAa2U3.js} +4 -4
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-fAeHUyxb.js.map → SavedBlocksBrowserModal-D9CAa2U3.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-DRDTLDyZ.js → SavedBlocksPanels-jfkYWtss.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-DRDTLDyZ.js.map → SavedBlocksPanels-jfkYWtss.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-B6b5z-o3.js → SavedBlocksPickBar-yaCumC4j.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPickBar-B6b5z-o3.js.map → SavedBlocksPickBar-yaCumC4j.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js → TemplateSettings-SaV2UVh_.js} +5 -5
- package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js.map → TemplateSettings-SaV2UVh_.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-DQxnW5Q5.js → TestEmailModal-ByfhP_sm.js} +6 -6
- package/dist/cdn/chunks/{TestEmailModal-DQxnW5Q5.js.map → TestEmailModal-ByfhP_sm.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-BcO_-16H.js → TestEmailPanel-CfzpqpDs.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-BcO_-16H.js.map → TestEmailPanel-CfzpqpDs.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-pmycpmTd.js → TitleEditor-Ceb0YfWv.js} +8 -7
- package/dist/cdn/chunks/TitleEditor-Ceb0YfWv.js.map +1 -0
- package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js → Toolbar-Cv6Rv1S-.js} +9 -9
- package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js.map → Toolbar-Cv6Rv1S-.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-ClSSGX7a.js → TplModal-DGpGdwgf.js} +2 -2
- package/dist/cdn/chunks/{TplModal-ClSSGX7a.js.map → TplModal-DGpGdwgf.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-B8GPBKMq.js → VersionHistoryPanels-BJnHCMAH.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-B8GPBKMq.js.map → VersionHistoryPanels-BJnHCMAH.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-BoUflYwY.js → WrapperBlock-C_uE5rPJ.js} +4 -4
- package/dist/cdn/chunks/{WrapperBlock-BoUflYwY.js.map → WrapperBlock-C_uE5rPJ.js.map} +1 -1
- package/dist/cdn/chunks/{composables-C1KU4ZHw.js → composables-BxikPuC1.js} +449 -443
- package/dist/cdn/chunks/composables-BxikPuC1.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js → createCloudRuntime-D2DUaudp.js} +3 -3
- package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js.map → createCloudRuntime-D2DUaudp.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-DcMKZpzh.js → extensions-DuDWpKo7.js} +4 -4
- package/dist/cdn/chunks/{extensions-DcMKZpzh.js.map → extensions-DuDWpKo7.js.map} +1 -1
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-cC32Ox6A.js → normalizeMergeTagMarkup-Bn_hl4jd.js} +2 -2
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-cC32Ox6A.js.map → normalizeMergeTagMarkup-Bn_hl4jd.js.map} +1 -1
- package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.js → preRenderCustomBlocks-C9oavydG.js} +2 -2
- package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.js.map → preRenderCustomBlocks-C9oavydG.js.map} +1 -1
- package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js → sanitizeHtml-DfXoetOm.js} +2 -2
- package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js.map → sanitizeHtml-DfXoetOm.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-DeCYorUT.js → socialIcons-DPwkrn5v.js} +2 -2
- package/dist/cdn/chunks/{socialIcons-DeCYorUT.js.map → socialIcons-DPwkrn5v.js.map} +1 -1
- package/dist/cdn/chunks/{src-A_cKeTM_.js → src-712f3ofG.js} +2 -2
- package/dist/cdn/chunks/{src-A_cKeTM_.js.map → src-712f3ofG.js.map} +1 -1
- package/dist/cdn/chunks/{src-BWX_xVxO.js → src-B2tQbzf6.js} +152 -146
- package/dist/cdn/chunks/src-B2tQbzf6.js.map +1 -0
- package/dist/cdn/chunks/{src-BQUv2CYU.js → src-ZFw5fg_z.js} +40 -27
- package/dist/cdn/chunks/{src-BQUv2CYU.js.map → src-ZFw5fg_z.js.map} +1 -1
- package/dist/cdn/chunks/{useLocalizedDisplay-aGfnO90D.js → useLocalizedDisplay-DiNjT22M.js} +2 -2
- package/dist/cdn/chunks/{useLocalizedDisplay-aGfnO90D.js.map → useLocalizedDisplay-DiNjT22M.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js → useLogicTag-SvMW4g00.js} +2 -2
- package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js.map → useLogicTag-SvMW4g00.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js → useMergeTag-JLz3Pqcw.js} +2 -2
- package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js.map → useMergeTag-JLz3Pqcw.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js → withCurrentFont-BcoPpkDS.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js.map → withCurrentFont-BcoPpkDS.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +18 -18
- package/dist/{composables-CMIrGXJ1.js → composables-BbPFRlBf.js} +908 -902
- package/dist/{createCloudRuntime-DGV5a5Af.js → createCloudRuntime-Dlrg88gS.js} +2 -2
- package/dist/{dist-Cdkm20M6.js → dist-C34cYI5S.js} +126 -113
- package/dist/{extensions-BJ184osp.js → extensions-xCiyqSg7.js} +16 -16
- package/dist/{normalizeMergeTagMarkup-CUCo7B5X.js → normalizeMergeTagMarkup-C7FGNURu.js} +22 -22
- package/dist/{preRenderCustomBlocks-Bs3N9no-.js → preRenderCustomBlocks-DvbRa3L3.js} +3 -3
- package/dist/{sanitizeHtml-2rjV0r-6.js → sanitizeHtml-D_ab7dD6.js} +5 -5
- package/dist/{socialIcons-TFiOkpoU.js → socialIcons-DhAolBjt.js} +342 -342
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +190 -190
- package/dist/useLocalizedDisplay-C9MBFUr4.js +31 -0
- package/dist/{useLogicTag-BXXXQQmi.js → useLogicTag-BmuakZBd.js} +1 -1
- package/dist/{useMergeTag-C9Okr87y.js → useMergeTag-DC4a8b_v.js} +3 -3
- package/dist/{withCurrentFont-DJiQqZzL.js → withCurrentFont-BSxJai99.js} +1 -1
- package/package.json +7 -7
- package/dist/cdn/chunks/ParagraphEditor-B2UU1Q5I.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-pmycpmTd.js.map +0 -1
- package/dist/cdn/chunks/composables-C1KU4ZHw.js.map +0 -1
- package/dist/cdn/chunks/src-BWX_xVxO.js.map +0 -1
- package/dist/useLocalizedDisplay-DNNwDRxL.js +0 -31
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { B as e, N as t, c as n, et as r } from "./vue.runtime.esm-bundler-BJXc_Mri.js";
|
|
2
|
-
import { _ as i } from "./dist-
|
|
2
|
+
import { _ as i } from "./dist-C34cYI5S.js";
|
|
3
3
|
import { f as a, o } from "./keys-BCqskl51.js";
|
|
4
4
|
import { t as s } from "./logger-BOu7oEtk.js";
|
|
5
|
-
import { t as c } from "./preRenderCustomBlocks-
|
|
5
|
+
import { t as c } from "./preRenderCustomBlocks-DvbRa3L3.js";
|
|
6
6
|
// ../core/dist/cloud/index.js
|
|
7
7
|
function l(e) {
|
|
8
8
|
let t = e instanceof i ? e.statusCode : void 0;
|
|
@@ -579,7 +579,7 @@ function Ne(e, t, n = {}) {
|
|
|
579
579
|
};
|
|
580
580
|
}
|
|
581
581
|
function Pe(e, t, n = []) {
|
|
582
|
-
let r = Object.fromEntries(
|
|
582
|
+
let r = Object.fromEntries(I(e.blocks).flatMap((e) => {
|
|
583
583
|
if (e.type !== "custom") return [];
|
|
584
584
|
let t = x(e, n).filter((t) => typeof v(e, t) == "string");
|
|
585
585
|
return t.length && Be.has(e.id) && O("invalid_operation", 0, Ve), t.length ? [[e.id, t]] : [];
|
|
@@ -610,7 +610,7 @@ function D(e, t, n = {}) {
|
|
|
610
610
|
locks: n.locks ?? [],
|
|
611
611
|
session: n.session ?? null
|
|
612
612
|
};
|
|
613
|
-
t.forEach((t, n) =>
|
|
613
|
+
t.forEach((t, n) => it(e, t, n, r));
|
|
614
614
|
}
|
|
615
615
|
var Le = /* @__PURE__ */ new Set([
|
|
616
616
|
"id",
|
|
@@ -681,25 +681,25 @@ function N(e) {
|
|
|
681
681
|
function Ue(e) {
|
|
682
682
|
return e.flatMap((e) => k(e) ? N(e) : []);
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function We(e, t) {
|
|
685
685
|
return typeof e.blockId != "string" || e.blockId === "" ? O("invalid_operation", t, "blockId must be a block id.") : e.blockId;
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function Ge(e, t) {
|
|
688
688
|
let n = e.parent;
|
|
689
689
|
return n === null ? null : k(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
|
|
690
690
|
sectionId: n.sectionId,
|
|
691
691
|
column: n.column
|
|
692
692
|
} : O("invalid_operation", t, "parent must be null or { \"sectionId\", \"column\" }.");
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function Ke(e, t) {
|
|
695
695
|
let n = e.after;
|
|
696
696
|
return n === null ? null : typeof n == "string" && n !== "" ? n : O("invalid_operation", t, "after must be null or a block id.");
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function P(e, t) {
|
|
699
699
|
let n = e.expect;
|
|
700
700
|
return n == null ? null : k(n) ? n : O("invalid_operation", t, "expect must be an object.");
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function qe(e, t, n) {
|
|
703
703
|
let r = e.set ?? null, i = e.unset ?? [];
|
|
704
704
|
(r === null || k(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || O("invalid_operation", t, "set must be an object and unset a list of keys.");
|
|
705
705
|
let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
|
|
@@ -711,27 +711,27 @@ function Ke(e, t, n) {
|
|
|
711
711
|
unset: i
|
|
712
712
|
};
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function Je(e, t, n) {
|
|
715
715
|
if (k(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || O("invalid_operation", t, "A block needs a non-empty string id and a string type."), !A(e)) return;
|
|
716
716
|
n && O("invalid_operation", t, "Sections can only be placed at the top level.");
|
|
717
717
|
let r = e.children;
|
|
718
718
|
Array.isArray(r) && r.every((e) => Array.isArray(e)) || O("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
|
|
719
|
-
for (let e of r) for (let n of e)
|
|
719
|
+
for (let e of r) for (let n of e) Je(n, t, !0);
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function F(e, t) {
|
|
722
722
|
return e.session === null || t.sessionId !== e.session;
|
|
723
723
|
}
|
|
724
|
-
function
|
|
725
|
-
let r = e.locks.find((n) => t.includes(n.blockId) &&
|
|
724
|
+
function Ye(e, t, n) {
|
|
725
|
+
let r = e.locks.find((n) => t.includes(n.blockId) && F(e, n));
|
|
726
726
|
r && O("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
|
|
727
727
|
}
|
|
728
|
-
function Ye(e, t, n, r) {
|
|
729
|
-
e.locks.find((r) => I(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && O("lock_held", r, `Block "${t}" is being edited in another session.`, t);
|
|
730
|
-
}
|
|
731
728
|
function Xe(e, t, n, r) {
|
|
729
|
+
e.locks.find((r) => F(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && O("lock_held", r, `Block "${t}" is being edited in another session.`, t);
|
|
730
|
+
}
|
|
731
|
+
function Ze(e, t, n, r) {
|
|
732
732
|
for (let [i, a] of Object.entries(t)) a !== void 0 && (m(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || O("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function Qe(e, t, n) {
|
|
735
735
|
if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
|
|
736
736
|
let r = M(e, t.sectionId);
|
|
737
737
|
if (!r) return O("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
|
|
@@ -739,12 +739,12 @@ function Ze(e, t, n) {
|
|
|
739
739
|
let i = r.block.children;
|
|
740
740
|
return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? O("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function $e(e, t, n) {
|
|
743
743
|
if (t === null) return 0;
|
|
744
744
|
let r = e.findIndex((e) => k(e) && e.id === t);
|
|
745
745
|
return r === -1 ? O("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function et(e, t, n, r) {
|
|
748
748
|
let i = Fe(t), a = Array.isArray(e.children) ? e.children : [];
|
|
749
749
|
for (let e = i; e < a.length; e++) {
|
|
750
750
|
let t = a[e];
|
|
@@ -754,7 +754,7 @@ function $e(e, t, n, r) {
|
|
|
754
754
|
for (; o.length < i;) o.push([]);
|
|
755
755
|
e.children = o;
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function tt(e, t, n) {
|
|
758
758
|
for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
|
|
759
759
|
value: p(r),
|
|
760
760
|
writable: !0,
|
|
@@ -763,7 +763,7 @@ function et(e, t, n) {
|
|
|
763
763
|
}) : e[n] = p(r);
|
|
764
764
|
for (let t of n) delete e[t];
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function nt(e) {
|
|
767
767
|
return pe(e).map((t) => {
|
|
768
768
|
let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
|
|
769
769
|
return {
|
|
@@ -772,113 +772,113 @@ function tt(e) {
|
|
|
772
772
|
};
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
|
-
function
|
|
776
|
-
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ?
|
|
775
|
+
function rt(e, t, n) {
|
|
776
|
+
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? nt(n).map(r) : []), a = nt(e).find((e) => !i.has(r(e)));
|
|
777
777
|
a && O("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function it(e, t, n, r) {
|
|
780
780
|
let i = t;
|
|
781
781
|
switch (k(i) && typeof i.op == "string" || O("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
|
|
782
|
-
case "addBlock": return
|
|
783
|
-
case "moveBlock": return
|
|
784
|
-
case "deleteBlock": return
|
|
785
|
-
case "updateBlock": return
|
|
786
|
-
case "updateSettings": return
|
|
787
|
-
case "setContent": return
|
|
788
|
-
case "setDefaultLocale": return
|
|
789
|
-
case "addLocale": return
|
|
790
|
-
case "removeLocale": return
|
|
791
|
-
case "updateBlockLocale": return
|
|
792
|
-
case "updateSettingsLocale": return
|
|
782
|
+
case "addBlock": return at(e, i, n);
|
|
783
|
+
case "moveBlock": return ot(e, i, n, r);
|
|
784
|
+
case "deleteBlock": return st(e, i, n, r);
|
|
785
|
+
case "updateBlock": return ct(e, i, n, r);
|
|
786
|
+
case "updateSettings": return lt(e, i, n);
|
|
787
|
+
case "setContent": return wt(e, i, n, r);
|
|
788
|
+
case "setDefaultLocale": return Tt(e, i, n, r);
|
|
789
|
+
case "addLocale": return ft(e, i, n);
|
|
790
|
+
case "removeLocale": return mt(e, i, n);
|
|
791
|
+
case "updateBlockLocale": return St(e, i, n, r);
|
|
792
|
+
case "updateSettingsLocale": return Ct(e, i, n);
|
|
793
793
|
default: O("invalid_operation", n, `Unknown operation "${i.op}".`);
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
let r =
|
|
798
|
-
|
|
796
|
+
function at(e, t, n) {
|
|
797
|
+
let r = Ge(t, n), i = Ke(t, n), a = t.block;
|
|
798
|
+
Je(a, n, r !== null), rt({
|
|
799
799
|
blocks: [a],
|
|
800
800
|
settings: e.settings
|
|
801
801
|
}, n);
|
|
802
802
|
let o = new Set(Ue(j(e))), s = /* @__PURE__ */ new Set();
|
|
803
803
|
for (let e of N(a)) (o.has(e) || s.has(e)) && O("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
|
|
804
|
-
let c =
|
|
805
|
-
|
|
804
|
+
let c = Qe(e, r, n), l = $e(c, i, n);
|
|
805
|
+
xt(e, a, r, n, !0), c.splice(l, 0, p(a));
|
|
806
806
|
}
|
|
807
|
-
function
|
|
808
|
-
let i =
|
|
807
|
+
function ot(e, t, n, r) {
|
|
808
|
+
let i = We(t, n), a = Ge(t, n), o = Ke(t, n), s = P(t, n), c = M(e, i);
|
|
809
809
|
if (!c) return O("block_missing", n, `No block with id "${i}".`, i);
|
|
810
|
-
if (
|
|
810
|
+
if (Ye(r, N(c.block), n), s) {
|
|
811
811
|
let e = c.index > 0 ? c.list[c.index - 1] : null, t = k(e) ? e.id ?? null : null;
|
|
812
812
|
m(c.parent, s.parent ?? null) && m(t, s.after ?? null) || O("precondition_failed", n, `Block "${i}" has moved since.`, i);
|
|
813
813
|
}
|
|
814
814
|
A(c.block) && a !== null && O("invalid_operation", n, "Sections can only be placed at the top level."), o === i && O("invalid_operation", n, "A block can't be placed after itself.");
|
|
815
|
-
let l =
|
|
816
|
-
|
|
815
|
+
let l = Qe(e, a, n);
|
|
816
|
+
$e(l.filter((e) => e !== c.block), o, n), xt(e, c.block, a, n, !1), c.list.splice(c.index, 1), l.splice($e(l, o, n), 0, c.block);
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
let i =
|
|
818
|
+
function st(e, t, n, r) {
|
|
819
|
+
let i = We(t, n), a = P(t, n), o = M(e, i);
|
|
820
820
|
if (!o) return O("block_missing", n, `No block with id "${i}".`, i);
|
|
821
|
-
|
|
821
|
+
Ye(r, N(o.block), n), a && !m(o.block, a.block ?? null) && O("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
|
|
822
822
|
}
|
|
823
|
-
function
|
|
824
|
-
let i =
|
|
823
|
+
function ct(e, t, n, r) {
|
|
824
|
+
let i = We(t, n), { set: a, unset: o } = qe(t, n, Le), s = P(t, n), c = M(e, i);
|
|
825
825
|
if (!c) return O("block_missing", n, `No block with id "${i}".`, i);
|
|
826
826
|
let l = c.block, u = A(l);
|
|
827
|
-
u && o.includes("columns") && O("invalid_operation", n, "A section's columns can't be unset; set another layout instead."),
|
|
827
|
+
u && o.includes("columns") && O("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), Ye(r, [i], n), s && Ze(l, s, n, i);
|
|
828
828
|
let d = { ...l };
|
|
829
|
-
|
|
829
|
+
tt(d, a, o), rt({
|
|
830
830
|
blocks: [d],
|
|
831
831
|
settings: e.settings
|
|
832
832
|
}, n, {
|
|
833
833
|
blocks: [l],
|
|
834
834
|
settings: e.settings
|
|
835
|
-
}), u && Object.hasOwn(a, "columns") &&
|
|
835
|
+
}), u && Object.hasOwn(a, "columns") && et(l, a.columns, n, i), tt(l, a, o);
|
|
836
836
|
let f = y(l);
|
|
837
837
|
m(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), u && f.type === "section" && !m(l.children, f.children) && (l.children = f.children);
|
|
838
838
|
}
|
|
839
|
-
function
|
|
840
|
-
let { set: r, unset: i } =
|
|
839
|
+
function lt(e, t, n) {
|
|
840
|
+
let { set: r, unset: i } = qe(t, n, Re), a = P(t, n);
|
|
841
841
|
e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && O("invalid_operation", n, "The default locale can't change while language versions exist."), k(e.settings) || (e.settings = {});
|
|
842
842
|
let o = e.settings;
|
|
843
|
-
a &&
|
|
843
|
+
a && Ze(o, a, n), tt(o, r, i);
|
|
844
844
|
let s = Se(e.settings);
|
|
845
845
|
m(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function ut(e, t) {
|
|
848
848
|
let n = e.locale;
|
|
849
849
|
return _e(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || O("invalid_operation", t, "locale must be a language tag."), n;
|
|
850
850
|
}
|
|
851
|
-
function
|
|
852
|
-
let r =
|
|
851
|
+
function dt(e, t, n) {
|
|
852
|
+
let r = ut(t, n);
|
|
853
853
|
return e.settings.locales?.includes(r) || O("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
|
|
854
854
|
}
|
|
855
|
-
function
|
|
856
|
-
let r =
|
|
855
|
+
function ft(e, t, n) {
|
|
856
|
+
let r = ut(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
|
|
857
857
|
(T(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && O("invalid_operation", n, "The locale already exists or its insertion position is invalid."), e.settings.locales || (e.settings.locales = []), e.settings.locales.splice(o, 0, r);
|
|
858
858
|
}
|
|
859
|
-
function
|
|
860
|
-
return e.flatMap((e) => k(e) ? [e, ...A(e) ? He(e).flatMap(
|
|
859
|
+
function I(e) {
|
|
860
|
+
return e.flatMap((e) => k(e) ? [e, ...A(e) ? He(e).flatMap(I) : e.type === "wrapper" && Array.isArray(e.children) ? I(e.children) : []] : []);
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function pt(e, t) {
|
|
863
863
|
let n = e.l10n;
|
|
864
864
|
return k(n) && k(n[t]) ? n[t] : {};
|
|
865
865
|
}
|
|
866
|
-
function
|
|
867
|
-
let r =
|
|
866
|
+
function mt(e, t, n) {
|
|
867
|
+
let r = dt(e, t, n), i = P(t, n);
|
|
868
868
|
i && (!k(i.blocks) || i.settings !== void 0 && !k(i.settings)) && O("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
|
|
869
|
-
let a = e.settings, o =
|
|
869
|
+
let a = e.settings, o = I(j(e)), s = Object.fromEntries(o.flatMap((e) => k(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
|
|
870
870
|
!i || m(s, i.blocks) && m(k(a.l10n) ? a.l10n[r] : void 0, i.settings) || O("precondition_failed", n, `Locale "${r}" has changed since.`);
|
|
871
871
|
for (let e of [...o, a]) k(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
|
|
872
872
|
e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
|
|
873
873
|
}
|
|
874
|
-
function
|
|
874
|
+
function ht(e, t, n) {
|
|
875
875
|
(e.text === void 0 || ((e) => k(e) && Object.values(e).every((e) => k(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || k(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && _(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
|
|
876
876
|
"text",
|
|
877
877
|
"set",
|
|
878
878
|
"unset",
|
|
879
879
|
...n ? [] : ["hidden"]
|
|
880
880
|
].some((t) => e[t] !== void 0) || O("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
|
|
881
|
-
let r =
|
|
881
|
+
let r = P(e, t);
|
|
882
882
|
return r && (r.text !== void 0 && !k(r.text) || r.set !== void 0 && !k(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && O("invalid_operation", t, "The locale layer expect is malformed."), {
|
|
883
883
|
text: e.text ?? {},
|
|
884
884
|
set: e.set ?? {},
|
|
@@ -887,20 +887,20 @@ function mt(e, t, n) {
|
|
|
887
887
|
expect: r
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function gt(e, t, n, r) {
|
|
891
891
|
for (let i of Object.keys(t.text)) _(i) && (r ? h.includes(i) : S(String(e.type), i)) && v(e, i) !== void 0 || O("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
|
|
892
892
|
for (let i of Object.keys(t.set)) {
|
|
893
893
|
let a = i.split("."), o = r ? ze : Le, s = a.length === 1 ? e : v(e, a.slice(0, -1).join("."));
|
|
894
894
|
(!_(i) || o.has(a[0]) || !r && xe(e, i, t.set[i]) || v(e, i) === void 0 && !k(s)) && O("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
|
|
895
895
|
}
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function _t(e, t, n, r) {
|
|
898
898
|
if (t) {
|
|
899
899
|
for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) m(e[i]?.[a] ?? null, o) || O("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
|
|
900
900
|
t.hidden !== void 0 && !m(e.hidden === !0, t.hidden) && O("precondition_failed", n, "The locale's hidden state has changed since.", r);
|
|
901
901
|
}
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function vt(e, t, n) {
|
|
904
904
|
k(e.l10n) || (e.l10n = {});
|
|
905
905
|
let r = e.l10n;
|
|
906
906
|
k(r[t]) || (r[t] = {});
|
|
@@ -910,45 +910,45 @@ function _t(e, t, n) {
|
|
|
910
910
|
for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = p(t), i.text && delete i.text[e];
|
|
911
911
|
n.hidden === !0 ? i.hidden = !0 : n.hidden === !1 && delete i.hidden, i.text && Object.keys(i.text).length === 0 && delete i.text, i.set && Object.keys(i.set).length === 0 && delete i.set, Object.keys(i).length === 0 && delete r[t], Object.keys(r).length === 0 && delete e.l10n;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
return k(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(
|
|
913
|
+
function L(e) {
|
|
914
|
+
return k(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(L) : L(e)) : !1;
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function yt(e) {
|
|
917
917
|
return k(e) && k(e.l10n) && Object.values(e.l10n).some((e) => k(e) && e.hidden === !0);
|
|
918
918
|
}
|
|
919
|
-
function
|
|
920
|
-
return !k(e) || !
|
|
919
|
+
function bt(e) {
|
|
920
|
+
return !k(e) || !L(e) ? !1 : yt(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(bt) : bt(e));
|
|
921
921
|
}
|
|
922
|
-
function
|
|
923
|
-
if (!
|
|
922
|
+
function xt(e, t, n, r, i) {
|
|
923
|
+
if (!L(t)) return;
|
|
924
924
|
let a = n === null ? null : M(e, n.sectionId);
|
|
925
|
-
(a !== null &&
|
|
925
|
+
(a !== null && yt(a.block) || i && bt(t)) && O("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", k(t) && typeof t.id == "string" ? t.id : void 0);
|
|
926
926
|
}
|
|
927
|
-
function
|
|
928
|
-
let i =
|
|
929
|
-
s || O("block_missing", n, `No block with id "${a}".`, a),
|
|
927
|
+
function St(e, t, n, r) {
|
|
928
|
+
let i = dt(e, t, n), a = We(t, n), o = ht(t, n, !1), s = I(j(e)).find((e) => e.id === a);
|
|
929
|
+
s || O("block_missing", n, `No block with id "${a}".`, a), gt(s, o, n, !1), Xe(r, a, i, n), _t(pt(s, i), o.expect, n, a), o.hidden === !0 && L(s) && O("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), vt(s, i, o);
|
|
930
930
|
}
|
|
931
|
-
function
|
|
932
|
-
let r =
|
|
933
|
-
|
|
931
|
+
function Ct(e, t, n) {
|
|
932
|
+
let r = dt(e, t, n), i = ht(t, n, !0), a = e.settings;
|
|
933
|
+
gt(a, i, n, !0), _t(pt(a, r), i.expect, n), vt(a, r, i);
|
|
934
934
|
}
|
|
935
|
-
function
|
|
935
|
+
function wt(e, t, n, r) {
|
|
936
936
|
let i = t.content;
|
|
937
937
|
if (!k(i) || !Array.isArray(i.blocks) || !k(i.settings)) return O("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
|
|
938
|
-
|
|
939
|
-
let a = r.locks.find((e) =>
|
|
938
|
+
rt(i, n, e);
|
|
939
|
+
let a = r.locks.find((e) => F(r, e));
|
|
940
940
|
a && O("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = p(i.blocks), e.settings = p(i.settings);
|
|
941
941
|
}
|
|
942
|
-
function
|
|
943
|
-
let i =
|
|
942
|
+
function Tt(e, t, n, r) {
|
|
943
|
+
let i = ut(t, n);
|
|
944
944
|
e.settings.locales?.includes(i) || O("invalid_operation", n, `"${i}" is not a language version of this template.`);
|
|
945
945
|
let a = Ae(e, i);
|
|
946
946
|
a.length && O("invalid_operation", n, a.length === 1 ? `1 block is hidden in "${i}". Show it before making it the default.` : `${a.length} blocks are hidden in "${i}". Show them before making it the default.`, a[0]);
|
|
947
|
-
let o = r.locks.find((e) =>
|
|
947
|
+
let o = r.locks.find((e) => F(r, e));
|
|
948
948
|
o && O("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
|
|
949
949
|
let s = t.customTextFields;
|
|
950
950
|
if (s !== void 0) {
|
|
951
|
-
let t =
|
|
951
|
+
let t = I(e.blocks);
|
|
952
952
|
(!k(s) || Object.getOwnPropertyNames(s).some((e) => {
|
|
953
953
|
if (Be.has(e)) return !0;
|
|
954
954
|
let n = s[e], r = t.find((t) => t.id === e);
|
|
@@ -958,11 +958,11 @@ function wt(e, t, n, r) {
|
|
|
958
958
|
let c = Ne(e, i, t.customTextFields);
|
|
959
959
|
e.blocks = c.blocks, e.settings = c.settings;
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function Et(e) {
|
|
962
962
|
let t = e.children;
|
|
963
963
|
return e.type === "section" && Array.isArray(t) ? t : [];
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function Dt(e, t, n = null) {
|
|
966
966
|
for (let r = 0; r < e.length; r++) {
|
|
967
967
|
let i = e[r];
|
|
968
968
|
if (i.id === t) return {
|
|
@@ -970,10 +970,10 @@ function Et(e, t, n = null) {
|
|
|
970
970
|
parent: n,
|
|
971
971
|
after: r > 0 ? e[r - 1].id : null
|
|
972
972
|
};
|
|
973
|
-
let a =
|
|
973
|
+
let a = Et(i);
|
|
974
974
|
for (let e = 0; e < a.length; e++) {
|
|
975
975
|
if (!Array.isArray(a[e])) continue;
|
|
976
|
-
let n =
|
|
976
|
+
let n = Dt(a[e], t, {
|
|
977
977
|
sectionId: i.id,
|
|
978
978
|
column: e
|
|
979
979
|
});
|
|
@@ -982,12 +982,12 @@ function Et(e, t, n = null) {
|
|
|
982
982
|
}
|
|
983
983
|
return null;
|
|
984
984
|
}
|
|
985
|
-
function
|
|
986
|
-
let r =
|
|
985
|
+
function Ot(e, t, n) {
|
|
986
|
+
let r = Dt(e.blocks, t);
|
|
987
987
|
if (!r) throw new E("block_missing", n, `No block with id "${t}".`, t);
|
|
988
988
|
return r;
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function kt(e, t, n) {
|
|
991
991
|
let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
|
|
992
992
|
for (let n of o) {
|
|
993
993
|
let o = e[n];
|
|
@@ -1001,7 +1001,7 @@ function Ot(e, t, n) {
|
|
|
1001
1001
|
expect: a
|
|
1002
1002
|
};
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1004
|
+
function R(e, t) {
|
|
1005
1005
|
return e.l10n?.[t] ?? {};
|
|
1006
1006
|
}
|
|
1007
1007
|
function z(e, t, n, r) {
|
|
@@ -1021,7 +1021,7 @@ function At(e) {
|
|
|
1021
1021
|
return n;
|
|
1022
1022
|
}
|
|
1023
1023
|
function B(e) {
|
|
1024
|
-
return e.flatMap((e) => [e, ...e.type === "wrapper" ? B(e.children) :
|
|
1024
|
+
return e.flatMap((e) => [e, ...e.type === "wrapper" ? B(e.children) : Et(e).flatMap(B)]);
|
|
1025
1025
|
}
|
|
1026
1026
|
function jt(e, t) {
|
|
1027
1027
|
let n = p(e);
|
|
@@ -1061,7 +1061,7 @@ function Mt(e, t, n) {
|
|
|
1061
1061
|
expect: { block: p(t.block) }
|
|
1062
1062
|
};
|
|
1063
1063
|
case "deleteBlock": {
|
|
1064
|
-
let r =
|
|
1064
|
+
let r = Ot(e, t.blockId, n);
|
|
1065
1065
|
return {
|
|
1066
1066
|
op: "addBlock",
|
|
1067
1067
|
block: p(r.block),
|
|
@@ -1070,7 +1070,7 @@ function Mt(e, t, n) {
|
|
|
1070
1070
|
};
|
|
1071
1071
|
}
|
|
1072
1072
|
case "moveBlock": {
|
|
1073
|
-
let r =
|
|
1073
|
+
let r = Ot(e, t.blockId, n);
|
|
1074
1074
|
return {
|
|
1075
1075
|
op: "moveBlock",
|
|
1076
1076
|
blockId: t.blockId,
|
|
@@ -1083,7 +1083,7 @@ function Mt(e, t, n) {
|
|
|
1083
1083
|
};
|
|
1084
1084
|
}
|
|
1085
1085
|
case "updateBlock": {
|
|
1086
|
-
let r =
|
|
1086
|
+
let r = Ot(e, t.blockId, n).block, { set: i, unset: a, expect: o } = kt(r, t.set, t.unset);
|
|
1087
1087
|
return [{
|
|
1088
1088
|
op: "updateBlock",
|
|
1089
1089
|
blockId: t.blockId,
|
|
@@ -1093,7 +1093,7 @@ function Mt(e, t, n) {
|
|
|
1093
1093
|
}, ...jt(e, t)];
|
|
1094
1094
|
}
|
|
1095
1095
|
case "updateSettings": {
|
|
1096
|
-
let { set: n, unset: r, expect: i } =
|
|
1096
|
+
let { set: n, unset: r, expect: i } = kt(e.settings, t.set, t.unset);
|
|
1097
1097
|
return [{
|
|
1098
1098
|
op: "updateSettings",
|
|
1099
1099
|
...Object.keys(n).length > 0 ? { set: n } : {},
|
|
@@ -1147,10 +1147,10 @@ function Mt(e, t, n) {
|
|
|
1147
1147
|
op: "updateBlockLocale",
|
|
1148
1148
|
blockId: t.blockId,
|
|
1149
1149
|
locale: t.locale,
|
|
1150
|
-
...z(
|
|
1150
|
+
...z(R(i, t.locale), R(a, t.locale), r, t.hidden !== void 0)
|
|
1151
1151
|
};
|
|
1152
1152
|
}
|
|
1153
|
-
let { hidden: i, ...a } = z(
|
|
1153
|
+
let { hidden: i, ...a } = z(R(e.settings, t.locale), R(n.settings, t.locale), r, !1);
|
|
1154
1154
|
return {
|
|
1155
1155
|
op: "updateSettingsLocale",
|
|
1156
1156
|
locale: t.locale,
|
|
@@ -1339,12 +1339,25 @@ function an(e) {
|
|
|
1339
1339
|
}
|
|
1340
1340
|
var on = 2e4, sn = /* @__PURE__ */ new Set(["\"", "'"]);
|
|
1341
1341
|
function U(e, t) {
|
|
1342
|
-
let n = null;
|
|
1343
|
-
for (let
|
|
1344
|
-
let t = e[
|
|
1342
|
+
let n = null, r = "tag";
|
|
1343
|
+
for (let i = t; i < e.length; i++) {
|
|
1344
|
+
let t = e[i];
|
|
1345
1345
|
if (n !== null) t === n && (n = null);
|
|
1346
|
-
else
|
|
1347
|
-
|
|
1346
|
+
else {
|
|
1347
|
+
if (r === "beforeValue") {
|
|
1348
|
+
if (W(t)) continue;
|
|
1349
|
+
if (sn.has(t)) {
|
|
1350
|
+
n = t, r = "tag";
|
|
1351
|
+
continue;
|
|
1352
|
+
}
|
|
1353
|
+
r = "unquotedValue";
|
|
1354
|
+
}
|
|
1355
|
+
if (r === "unquotedValue") {
|
|
1356
|
+
if (t === ">") return i;
|
|
1357
|
+
W(t) && (r = "tag");
|
|
1358
|
+
} else if (t === "=") r = "beforeValue";
|
|
1359
|
+
else if (t === ">") return i;
|
|
1360
|
+
}
|
|
1348
1361
|
}
|
|
1349
1362
|
return -1;
|
|
1350
1363
|
}
|
|
@@ -2539,4 +2552,4 @@ function Qr(e) {
|
|
|
2539
2552
|
let t = e;
|
|
2540
2553
|
return Array.isArray(t.blocks);
|
|
2541
2554
|
}
|
|
2542
|
-
export { je as $,
|
|
2555
|
+
export { je as $, n as $t, Zn as A, Ae as At, Pn as B, Mr as Bt, Ie as C, It as Ct, Z as D, H as Dt, sr as E, S as Et, tn as F, Se as Ft, Vn as G, Lr as Gt, Pe as H, Xr as Ht, Ln as I, v as It, zn as J, fe as Jt, Gn as K, p as Kt, Hn as L, dn as Lt, Kn as M, Te as Mt, Jn as N, Or as Nt, qr as O, cr as Ot, jn as P, y as Pt, en as Q, Gr as Qt, Fn as R, ne as Rt, An as S, _ as St, or as T, xe as Tt, Yn as U, Vr as Ut, Rn as V, ie as Vt, Bn as W, Oe as Wt, G as X, C as Xt, Xn as Y, de as Yt, m as Z, Ur as Zt, he as _, _e as _t, Ft as a, ar as an, jr as at, on as b, Qr as bt, s as c, Yr as ct, E as d, Ir as dt, r as en, T as et, l as f, Fr as ft, $ as g, Lt as gt, se as h, Nt as ht, e as i, En as in, U as it, In as j, kn as jt, ee as k, ke as kt, vr as l, Br as lt, h as m, oe as mt, f as n, x as nn, hr as nt, Zt as o, Y as ot, pr as p, Wr as pt, Nn as q, ue as qt, i as r, t as rn, Cr as rt, Qt as s, Fe as st, d as t, o as tn, te as tt, _r as u, Hr as ut, c as v, Jr as vt, D as w, V as wt, fr as x, yr as xt, gn as y, zr as yt, Un as z, an as zt };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Ft as e, M as t, Mt as n, O as r, Pt as i, U as a, W as o, Z as s, c, ct as l, d as u, et as d, f, l as p, u as m, y as h } from "./vue.runtime.esm-bundler-BJXc_Mri.js";
|
|
2
2
|
import { a as g, c as _, s as v } from "./runtime-dom.esm-bundler-DlHp8xgy.js";
|
|
3
|
-
import {
|
|
4
|
-
import { a as C, o as w, s as T } from "./LogicTagInsertButton-
|
|
3
|
+
import { ct as y, g as b, lt as x, vt as S } from "./dist-C34cYI5S.js";
|
|
4
|
+
import { a as C, o as w, s as T } from "./LogicTagInsertButton-XESwnJia.js";
|
|
5
5
|
import { t as ee } from "./useI18n-CgtvtF4C.js";
|
|
6
|
-
import { t as E } from "./useMergeTag-
|
|
6
|
+
import { t as E } from "./useMergeTag-DC4a8b_v.js";
|
|
7
7
|
import { H as D, Kn as O, Qn as k, Zn as A, _n as j, m as M, qn as te, s as N, u as ne, v as re } from "./dist-BWflWcpW.js";
|
|
8
8
|
import { n as P, t as ie } from "./dist-fqSers8_.js";
|
|
9
9
|
// src/extensions/FontSize.ts
|
|
@@ -101,7 +101,7 @@ var ae = N.create({
|
|
|
101
101
|
updateAttributes: { type: Function }
|
|
102
102
|
},
|
|
103
103
|
setup(s) {
|
|
104
|
-
let h = s, { syntax: b } = E(), { t: x } = ee(), C = c(() =>
|
|
104
|
+
let h = s, { syntax: b } = E(), { t: x } = ee(), C = c(() => S(h.node.attrs.value, b)), w = c(() => y(h.node.attrs.value, b)), T = d(!1), D = d(""), O = d(null), k = !1;
|
|
105
105
|
function A() {
|
|
106
106
|
D.value = h.node.attrs.value, k = !1, T.value = !0, r(() => {
|
|
107
107
|
O.value?.focus(), O.value?.select();
|
|
@@ -113,7 +113,7 @@ var ae = N.create({
|
|
|
113
113
|
let e = D.value.trim();
|
|
114
114
|
e && e !== h.node.attrs.value && h.updateAttributes({
|
|
115
115
|
value: e,
|
|
116
|
-
keyword:
|
|
116
|
+
keyword: S(e, b) ? y(e, b) : ""
|
|
117
117
|
}), T.value = !1;
|
|
118
118
|
}
|
|
119
119
|
function M(e) {
|
|
@@ -196,7 +196,7 @@ var me = M.create({
|
|
|
196
196
|
inline: !0,
|
|
197
197
|
atom: !0,
|
|
198
198
|
addOptions() {
|
|
199
|
-
return { syntax:
|
|
199
|
+
return { syntax: b.liquid };
|
|
200
200
|
},
|
|
201
201
|
addAttributes() {
|
|
202
202
|
return {
|
|
@@ -216,12 +216,12 @@ var me = M.create({
|
|
|
216
216
|
return [{ tag: "span[data-logic-merge-tag]" }];
|
|
217
217
|
},
|
|
218
218
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
219
|
-
if (!
|
|
219
|
+
if (!S(e.attrs.value, this.options.syntax)) return [
|
|
220
220
|
"span",
|
|
221
221
|
{},
|
|
222
222
|
e.attrs.value
|
|
223
223
|
];
|
|
224
|
-
let n =
|
|
224
|
+
let n = y(e.attrs.value, this.options.syntax);
|
|
225
225
|
return [
|
|
226
226
|
"span",
|
|
227
227
|
j(t, {
|
|
@@ -246,8 +246,8 @@ var me = M.create({
|
|
|
246
246
|
find: e,
|
|
247
247
|
handler: ({ state: e, range: t, match: n }) => {
|
|
248
248
|
let r = n[0];
|
|
249
|
-
if (!
|
|
250
|
-
let i =
|
|
249
|
+
if (!S(r, this.options.syntax)) return;
|
|
250
|
+
let i = y(r, this.options.syntax), a = this.type.create({
|
|
251
251
|
value: r,
|
|
252
252
|
keyword: i
|
|
253
253
|
});
|
|
@@ -261,8 +261,8 @@ var me = M.create({
|
|
|
261
261
|
find: e,
|
|
262
262
|
handler: ({ state: e, range: t, match: n }) => {
|
|
263
263
|
let r = n[0];
|
|
264
|
-
if (!
|
|
265
|
-
let i =
|
|
264
|
+
if (!S(r, this.options.syntax)) return;
|
|
265
|
+
let i = y(r, this.options.syntax), a = this.type.create({
|
|
266
266
|
value: r,
|
|
267
267
|
keyword: i
|
|
268
268
|
});
|
|
@@ -379,7 +379,7 @@ var me = M.create({
|
|
|
379
379
|
addOptions() {
|
|
380
380
|
return {
|
|
381
381
|
mergeTags: () => [],
|
|
382
|
-
syntax:
|
|
382
|
+
syntax: b.liquid
|
|
383
383
|
};
|
|
384
384
|
},
|
|
385
385
|
addAttributes() {
|
|
@@ -400,7 +400,7 @@ var me = M.create({
|
|
|
400
400
|
return [{ tag: "span[data-merge-tag]" }];
|
|
401
401
|
},
|
|
402
402
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
403
|
-
let n =
|
|
403
|
+
let n = x(e.attrs.value, this.options.mergeTags());
|
|
404
404
|
return [
|
|
405
405
|
"span",
|
|
406
406
|
j(t, {
|
|
@@ -433,7 +433,7 @@ var me = M.create({
|
|
|
433
433
|
return [new ne({
|
|
434
434
|
find: e,
|
|
435
435
|
handler: ({ state: e, range: t, match: n }) => {
|
|
436
|
-
let r = n[0], i =
|
|
436
|
+
let r = n[0], i = x(r, this.options.mergeTags()), a = this.type.create({
|
|
437
437
|
label: i,
|
|
438
438
|
value: r
|
|
439
439
|
});
|
|
@@ -446,7 +446,7 @@ var me = M.create({
|
|
|
446
446
|
return [new re({
|
|
447
447
|
find: e,
|
|
448
448
|
handler: ({ state: e, range: t, match: n }) => {
|
|
449
|
-
let r = n[0], i =
|
|
449
|
+
let r = n[0], i = x(r, this.options.mergeTags()), a = this.type.create({
|
|
450
450
|
label: i,
|
|
451
451
|
value: r
|
|
452
452
|
});
|