@templatical/editor 0.0.6 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +56 -0
- package/README.md +69 -0
- package/dist/{AiChatSidebar-CNhSl_ty.js → AiChatSidebar-DgAjDWO1.js} +68 -68
- package/dist/{AiFeatureMenu-BFVsjUJY.js → AiFeatureMenu-j6oaiRVi.js} +25 -25
- package/dist/{CloudEditor-Bz5Xkxej.js → CloudEditor-yCOkIkZ-.js} +428 -437
- package/dist/{CollaboratorBar-D2Gu5Xj2.js → CollaboratorBar-CWVdp2Y6.js} +23 -23
- package/dist/CommentsSidebar-CSPHhbQH.js +439 -0
- package/dist/CountdownBlock-DK6P_RaQ.js +92 -0
- package/dist/CountdownToolbar-Dv-Sz4ui.js +210 -0
- package/dist/{DesignReferenceSidebar-u2tKSQK0.js → DesignReferenceSidebar-D7zfvux6.js} +58 -58
- package/dist/LoadingTrack-Cdz2SSq9.js +10 -0
- package/dist/ModuleBrowserModal-BLYuCZht.js +205 -0
- package/dist/ModulePreviewCanvas-CHYqP6K3.js +106 -0
- package/dist/NumberWithSuffix-D-5-AZc3.js +424 -0
- package/dist/{ParagraphEditor-CYrzYJO5.js → ParagraphEditor-DivLBNWv.js} +237 -236
- package/dist/{RichTextEditorContent-BeqlWlWB.js → RichTextEditorContent-G1lXgVJR.js} +42 -42
- package/dist/{SaveModuleDialog-Kde6X13X.js → SaveModuleDialog-DGVfiOmE.js} +29 -29
- package/dist/{SnapshotHistory-B3EfIcLW.js → SnapshotHistory-DM__MqSu.js} +38 -38
- package/dist/{TemplateScoringPanel-D2vCRGgx.js → TemplateScoringPanel-CW13Tlol.js} +80 -80
- package/dist/{TestEmailModal-Egk0DFDf.js → TestEmailModal-B8bYqWCY.js} +28 -28
- package/dist/TitleEditor-4Jrp3C4m.js +167 -0
- package/dist/{TplModal-BCruYWks.js → TplModal-BkoIz0oz.js} +14 -14
- package/dist/{_plugin-vue_export-helper-5TQrnOhO.js → _plugin-vue_export-helper-OO6pH1Dh.js} +11 -11
- package/dist/{blockTypeIcons-rW4BUUNC.js → blockTypeIcons-4AS3CvXn.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-Dcbshcfu.js → AiFeatureMenu-BcHyzTQy.js} +4 -4
- package/dist/cdn/chunks/{AiFeatureMenu-Dcbshcfu.js.map → AiFeatureMenu-BcHyzTQy.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Bca3RyBW.js → CloudEditor-TaEZq-YW.js} +179 -188
- package/dist/cdn/chunks/CloudEditor-TaEZq-YW.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-sToKJfHi.js → CollaboratorBar-DbC5-3If.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-sToKJfHi.js.map → CollaboratorBar-DbC5-3If.js.map} +1 -1
- package/dist/cdn/chunks/CountdownBlock-CfPmCQ7j.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-CfPmCQ7j.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-CB0EVxwN.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-CB0EVxwN.js.map +1 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-BNhwXbWw.js → ModuleBrowserModal-Df2fp9dj.js} +7 -7
- package/dist/cdn/chunks/{ModuleBrowserModal-BNhwXbWw.js.map → ModuleBrowserModal-Df2fp9dj.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DylUylPU.js → ModulePreviewCanvas-Dw1OCpvV.js} +19 -19
- package/dist/cdn/chunks/{ModulePreviewCanvas-DylUylPU.js.map → ModulePreviewCanvas-Dw1OCpvV.js.map} +1 -1
- package/dist/cdn/chunks/NumberWithSuffix-BU6ycXyG.js +425 -0
- package/dist/cdn/chunks/NumberWithSuffix-BU6ycXyG.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-BBw90y_p.js → ParagraphEditor-BMRNg_BX.js} +37 -37
- package/dist/cdn/chunks/{ParagraphEditor-BBw90y_p.js.map → ParagraphEditor-BMRNg_BX.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DvyIO3nR.js → RichTextEditorContent-BKYY1YMZ.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-DvyIO3nR.js.map → RichTextEditorContent-BKYY1YMZ.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DvbSHvhF.js → SaveModuleDialog-D977Tg7t.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-DvbSHvhF.js.map → SaveModuleDialog-D977Tg7t.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-tS3mgoVr.js → TitleEditor-q9IzNy38.js} +11 -11
- package/dist/cdn/chunks/{TitleEditor-tS3mgoVr.js.map → TitleEditor-q9IzNy38.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-DbnbyEQE.js → blockTypeIcons-L0fRc3qs.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-DbnbyEQE.js.map → blockTypeIcons-L0fRc3qs.js.map} +1 -1
- package/dist/cdn/chunks/{de-CgUR_S5I.js → de-3exf7MYE.js} +1 -1
- package/dist/cdn/chunks/{de-CgUR_S5I.js.map → de-3exf7MYE.js.map} +1 -1
- package/dist/cdn/chunks/{de-D8oDPhBD.js → de-C8LxVUsb.js} +1 -1
- package/dist/cdn/chunks/{de-D8oDPhBD.js.map → de-C8LxVUsb.js.map} +1 -1
- package/dist/cdn/chunks/{dist-BUmN5e4r.js → dist-D5g00M8N.js} +6 -2
- package/dist/cdn/chunks/dist-D5g00M8N.js.map +1 -0
- package/dist/cdn/chunks/{draggable-m78lz0gI.js → draggable-Bcb86AsV.js} +5 -5
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
- package/dist/cdn/chunks/{emojiData-CNNgvDqx.js → emojiData-DUHzsh4j.js} +1 -1
- package/dist/cdn/chunks/{emojiData-CNNgvDqx.js.map → emojiData-DUHzsh4j.js.map} +1 -1
- package/dist/cdn/chunks/{en-HseRPPeK.js → en-BoEycuqw.js} +1 -1
- package/dist/cdn/chunks/{en-HseRPPeK.js.map → en-BoEycuqw.js.map} +1 -1
- package/dist/cdn/chunks/{en-BBmfBDqY.js → en-KNPUKxYp.js} +1 -1
- package/dist/cdn/chunks/{en-BBmfBDqY.js.map → en-KNPUKxYp.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-ClpY3m0W.js → extensions-BZ1POyiv.js} +11 -11
- package/dist/cdn/chunks/{extensions-ClpY3m0W.js.map → extensions-BZ1POyiv.js.map} +1 -1
- package/dist/cdn/chunks/{features-B5dGxWLi.js → features-Ccqmm6-M.js} +549 -627
- package/dist/cdn/chunks/features-Ccqmm6-M.js.map +1 -0
- package/dist/cdn/chunks/{icons-hflTyPmb.js → icons-x53__2GC.js} +8 -8
- package/dist/cdn/chunks/icons-x53__2GC.js.map +1 -0
- package/dist/cdn/chunks/{liquid.browser-BxyRVCKv.js → liquid.browser-CEMn-ZqL.js} +2 -2
- package/dist/cdn/chunks/liquid.browser-CEMn-ZqL.js.map +1 -0
- package/dist/cdn/chunks/{media-library-Dgy-V-JA.js → media-library-DUoQk-w7.js} +97 -97
- package/dist/cdn/chunks/media-library-DUoQk-w7.js.map +1 -0
- package/dist/cdn/chunks/{pusher-D-m2WSdL.js → pusher-DwSQn6BA.js} +2 -2
- package/dist/cdn/chunks/pusher-DwSQn6BA.js.map +1 -0
- package/dist/cdn/chunks/{src-TDwMmqm0.js → src-DskCIAr8.js} +8 -8
- package/dist/cdn/chunks/{src-TDwMmqm0.js.map → src-DskCIAr8.js.map} +1 -1
- package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js → styleConstants-DP1VOca8.js} +1 -1
- package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js.map → styleConstants-DP1VOca8.js.map} +1 -1
- package/dist/cdn/chunks/{styles-hCOCOR6K.js → styles-BIlpNe52.js} +622 -1238
- package/dist/cdn/chunks/styles-BIlpNe52.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C28NLMX8.js → tiptap-hPC_BgDO.js} +850 -826
- package/dist/cdn/chunks/tiptap-hPC_BgDO.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +92 -97
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-B5S-C0bz.js → check-Bff5NzCh.js} +1 -1
- package/dist/{chevron-down-CjsV1T0W.js → chevron-down-Bbv4SJwx.js} +1 -1
- package/dist/{circle-alert-CVTmJHKW.js → circle-alert-Dpr8MgkR.js} +1 -1
- package/dist/{clock-CAjdSHBy.js → clock-raVPKfl4.js} +1 -1
- package/dist/{dist-DJrDTuRr.js → dist-BHgEdO-M.js} +1001 -983
- package/dist/dist-BibwE8Y0.js +5 -0
- package/dist/{dist-DPM-DFvh.js → dist-BnlZ_HwX.js} +340 -340
- package/dist/{dist-BTtKPcd2.js → dist-C9yhcxsf.js} +2 -2
- package/dist/{dist-COguaIvm.js → dist-CGffNO8z.js} +2 -2
- package/dist/dist-CfGpCUSx.js +5 -0
- package/dist/{dist-COOFiBFV.js → dist-Chd-H2S3.js} +5 -5
- package/dist/{dist-DfqLGwSF.js → dist-Cq0OFLMj.js} +2 -2
- package/dist/{dist-B4LTlrAn.js → dist-D42og5Sc.js} +191 -185
- package/dist/{dist-CBr-qhie.js → dist-Owxo48fF.js} +2 -2
- package/dist/{dist-Crqkuf-w.js → dist-UZ8UzVZ-.js} +15 -15
- package/dist/dist-n0PkFNGl.js +314 -0
- package/dist/{dist-DHYuVJ_7.js → dist-skgH9dyo.js} +2 -2
- package/dist/{extensions-C6xp_B7K.js → extensions-DQKaICBH.js} +81 -81
- package/dist/{image-up-vZa1Txr-.js → image-up-B1AEiHCh.js} +1 -1
- package/dist/index.d.ts +17 -6
- package/dist/{keys-C0MQRs8d.js → keys-CIw9mUI2.js} +1 -1
- package/dist/{liquid.browser-C02owkex.js → liquid.browser-Bm53dnK1.js} +1 -1
- package/dist/{loader-circle-DilFjHSk.js → loader-circle-BYeKJ3to.js} +1 -1
- package/dist/{message-circle-Dpcnc2oa.js → message-circle-PhNlI7e7.js} +1 -1
- package/dist/{refresh-cw-4r7rkHHX.js → refresh-cw-DhDYRBDd.js} +1 -1
- package/dist/{rolldown-runtime-gEudmnaM.js → rolldown-runtime-BZGGJVDF.js} +2 -5
- package/dist/{scan-line-684IxPQ0.js → scan-line-Bw8bauvt.js} +1 -1
- package/dist/{send-ChDw64yL.js → send-CJPSzbLO.js} +1 -1
- package/dist/{shield-check-9dhLdyST.js → shield-check-DdEvVYMH.js} +1 -1
- package/dist/{sparkles-Co9fkDcv.js → sparkles-DT_27AYs.js} +1 -1
- package/dist/style.css +2 -0
- package/dist/{styleConstants-RV3eYwkD.js → styleConstants-Dqz9z3aa.js} +6 -45
- package/dist/styles-tcwlvlEB.js +2942 -0
- package/dist/templatical-editor.js +114 -119
- package/dist/text-align-start-4Hx15GUf.js +43 -0
- package/dist/{trash-2-CZkMtjeC.js → trash-2-BY-xp5hg.js} +1 -1
- package/dist/{triangle-alert-Dvt51agD.js → triangle-alert-DG72vdb2.js} +1 -1
- package/dist/useEditorCore-DMH2QpUL.js +8946 -0
- package/dist/{useI18n-D6m7ZUgY.js → useI18n-B8CN2iWs.js} +4 -4
- package/dist/{useMergeTag-CSXcnFBc.js → useMergeTag-Dz_Dx2Jz.js} +3 -3
- package/dist/vue.runtime.esm-bundler-DryoQb-v.js +5775 -0
- package/dist/{x-CU2XZOkQ.js → x-D-7GkO6Z.js} +1 -1
- package/package.json +31 -15
- package/dist/CommentsSidebar-CTeEAZTj.js +0 -439
- package/dist/LoadingTrack--aUassFH.js +0 -10
- package/dist/ModuleBrowserModal-DNxODPlX.js +0 -205
- package/dist/ModulePreviewCanvas-DnGe1Y-2.js +0 -106
- package/dist/TitleEditor-DwUpo4gF.js +0 -167
- package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js.map +0 -1
- package/dist/cdn/chunks/dist-BUmN5e4r.js.map +0 -1
- package/dist/cdn/chunks/draggable-m78lz0gI.js.map +0 -1
- package/dist/cdn/chunks/features-B5dGxWLi.js.map +0 -1
- package/dist/cdn/chunks/icons-hflTyPmb.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-BxyRVCKv.js.map +0 -1
- package/dist/cdn/chunks/media-library-Dgy-V-JA.js.map +0 -1
- package/dist/cdn/chunks/pusher-D-m2WSdL.js.map +0 -1
- package/dist/cdn/chunks/styles-hCOCOR6K.js.map +0 -1
- package/dist/cdn/chunks/tiptap-C28NLMX8.js.map +0 -1
- package/dist/dist-Ac4o1O4a.js +0 -314
- package/dist/dist-DEJZ9iAU.js +0 -5
- package/dist/dist-DmVOCJjI.js +0 -5
- package/dist/styles-nvxFh6L6.js +0 -3557
- package/dist/templatical-editor.css +0 -2
- package/dist/templatical-editor.umd.cjs +0 -178
- package/dist/useEditorCore-ColJh1ST.js +0 -5695
- /package/dist/cdn/chunks/{_rolldown_dynamic_import_helper-DMEI4TQ3.js → _rolldown_dynamic_import_helper-BRcA6nWq.js} +0 -0
- /package/dist/{de-Dh8ON-dm.js → de-CN0xu_Tp.js} +0 -0
- /package/dist/{emojiData-Qc8mH_zW.js → emojiData-CwKEDxVf.js} +0 -0
- /package/dist/{en-C7IShRSD.js → en-DXvHkaUF.js} +0 -0
- /package/dist/{formatRelativeTime-D8f6NR7i.js → formatRelativeTime-BSpx5DHC.js} +0 -0
- /package/dist/{readableTextColor-B809bF5J.js → readableTextColor-CYCxm1jQ.js} +0 -0
- /package/dist/{timeouts-CmBrLeZA.js → timeouts-BSGxjuUF.js} +0 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { H as e, L as t, M as n, Ot as r, P as i, S as a, V as ee, Y as o, _ as s, b as c, d as l, g as te, h as u, m as d, o as ne, p as f, s as re, tt as p, u as m, wt as ie, x as ae, z as oe } from "./vue.runtime.esm-bundler-DryoQb-v.js";
|
|
2
|
+
import { T as h, b as se, f as ce } from "./keys-CIw9mUI2.js";
|
|
3
|
+
import { t as le } from "./useI18n-B8CN2iWs.js";
|
|
4
|
+
import "./useEditorCore-DMH2QpUL.js";
|
|
5
|
+
import { n as g } from "./_plugin-vue_export-helper-OO6pH1Dh.js";
|
|
6
|
+
import { n as _, t as v } from "./blockTypeIcons-4AS3CvXn.js";
|
|
7
|
+
import { t as ue } from "./trash-2-BY-xp5hg.js";
|
|
8
|
+
import { t as de } from "./x-D-7GkO6Z.js";
|
|
9
|
+
import { t as fe } from "./TplModal-BkoIz0oz.js";
|
|
10
|
+
var pe = g("search", [["path", {
|
|
11
|
+
d: "m21 21-4.34-4.34",
|
|
12
|
+
key: "14j7rj"
|
|
13
|
+
}], ["circle", {
|
|
14
|
+
cx: "11",
|
|
15
|
+
cy: "11",
|
|
16
|
+
r: "8",
|
|
17
|
+
key: "4ej97u"
|
|
18
|
+
}]]), me = {
|
|
19
|
+
role: "dialog",
|
|
20
|
+
"aria-modal": "true",
|
|
21
|
+
"aria-labelledby": "tpl-module-browser-title",
|
|
22
|
+
class: "tpl-scale-in tpl:mx-4 tpl:flex tpl:w-full tpl:max-w-[1000px] tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]",
|
|
23
|
+
style: {
|
|
24
|
+
"background-color": "var(--tpl-bg-elevated)",
|
|
25
|
+
"box-shadow": "var(--tpl-shadow-xl)",
|
|
26
|
+
"max-height": "90vh"
|
|
27
|
+
}
|
|
28
|
+
}, he = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]" }, y = {
|
|
29
|
+
id: "tpl-module-browser-title",
|
|
30
|
+
class: "tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
31
|
+
}, b = ["aria-label"], x = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, S = { class: "tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden" }, C = { class: "tpl:px-4 tpl:pt-4 tpl:pb-3" }, w = { class: "tpl:relative" }, T = ["placeholder"], E = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4" }, D = {
|
|
32
|
+
key: 0,
|
|
33
|
+
class: "tpl:flex tpl:flex-col tpl:gap-1"
|
|
34
|
+
}, O = ["aria-pressed", "onClick"], k = { class: "tpl:flex tpl:items-center tpl:gap-2" }, A = { class: "tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, j = { class: "tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]" }, M = { class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1" }, N = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]"
|
|
37
|
+
}, P = ["aria-label", "onClick"], F = [
|
|
38
|
+
"aria-label",
|
|
39
|
+
"title",
|
|
40
|
+
"onClick"
|
|
41
|
+
], I = {
|
|
42
|
+
key: 1,
|
|
43
|
+
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"
|
|
44
|
+
}, L = { class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, R = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]" }, ge = {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
|
|
47
|
+
}, _e = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, ve = {
|
|
48
|
+
key: 1,
|
|
49
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"
|
|
50
|
+
}, ye = { class: "tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, be = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]" }, xe = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Se = { class: "tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, Ce = ["value"], we = { class: "tpl:flex tpl:gap-2" }, Te = ["disabled"], z = /* @__PURE__ */ a({
|
|
51
|
+
__name: "ModuleBrowserModal",
|
|
52
|
+
props: { visible: { type: Boolean } },
|
|
53
|
+
emits: ["close", "insert"],
|
|
54
|
+
setup(a, { emit: g }) {
|
|
55
|
+
let z = a, B = g, Ee = ae(() => import("./ModulePreviewCanvas-CHYqP6K3.js")), { t: V } = le(), H = h(se, "ModuleBrowserModal"), U = h(ce, "ModuleBrowserModal"), W = o(""), G = o(null), K = o(null), q = o("end"), J = f(() => {
|
|
56
|
+
let e = H.modules.value;
|
|
57
|
+
if (!W.value) return e;
|
|
58
|
+
let t = W.value.toLowerCase();
|
|
59
|
+
return e.filter((e) => e.name.toLowerCase().includes(t));
|
|
60
|
+
}), Y = f(() => G.value ? H.modules.value.find((e) => e.id === G.value) ?? null : null), De = f(() => {
|
|
61
|
+
let e = [{
|
|
62
|
+
value: "beginning",
|
|
63
|
+
label: V.modules.insertAtBeginning
|
|
64
|
+
}], t = U.content.value.blocks;
|
|
65
|
+
for (let n = 0; n < t.length; n++) {
|
|
66
|
+
let r = t[n], i = r.type, a = V.blocks[i] ?? r.type;
|
|
67
|
+
e.push({
|
|
68
|
+
value: r.id,
|
|
69
|
+
label: V.modules.insertAfterBlock.replace("{block}", `${a} ${n + 1}`)
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return e.push({
|
|
73
|
+
value: "end",
|
|
74
|
+
label: V.modules.insertAtEnd
|
|
75
|
+
}), e;
|
|
76
|
+
}), X = f(() => {
|
|
77
|
+
if (q.value === "end") return;
|
|
78
|
+
if (q.value === "beginning") return 0;
|
|
79
|
+
let e = U.content.value.blocks.findIndex((e) => e.id === q.value);
|
|
80
|
+
if (e !== -1) return e + 1;
|
|
81
|
+
});
|
|
82
|
+
oe(() => z.visible, (e) => {
|
|
83
|
+
if (e) {
|
|
84
|
+
W.value = "", G.value = null, K.value = null;
|
|
85
|
+
let e = U.state.selectedBlockId;
|
|
86
|
+
e ? q.value = U.content.value.blocks.findIndex((t) => t.id === e) === -1 ? "end" : e : q.value = "end";
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
function Oe(e) {
|
|
90
|
+
let t = [], n = /* @__PURE__ */ new Set();
|
|
91
|
+
for (let r of e.content) if (!n.has(r.type) && v[r.type] && (n.add(r.type), t.push({
|
|
92
|
+
type: r.type,
|
|
93
|
+
icon: v[r.type]
|
|
94
|
+
})), t.length >= 5) break;
|
|
95
|
+
return t;
|
|
96
|
+
}
|
|
97
|
+
function Z(e) {
|
|
98
|
+
let t = new Set(e.content.map((e) => e.type));
|
|
99
|
+
return Math.max(0, t.size - 5);
|
|
100
|
+
}
|
|
101
|
+
async function ke(e) {
|
|
102
|
+
try {
|
|
103
|
+
await H.deleteModule(e), G.value === e && (G.value = null);
|
|
104
|
+
} finally {
|
|
105
|
+
K.value = null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function Q() {
|
|
109
|
+
Y.value && B("insert", Y.value, X.value);
|
|
110
|
+
}
|
|
111
|
+
function $() {
|
|
112
|
+
B("close");
|
|
113
|
+
}
|
|
114
|
+
function Ae(e) {
|
|
115
|
+
e.key === "Escape" && $(), e.key === "Enter" && Y.value && (e.preventDefault(), Q());
|
|
116
|
+
}
|
|
117
|
+
return (o, f) => (n(), u(fe, {
|
|
118
|
+
visible: a.visible,
|
|
119
|
+
onClose: $,
|
|
120
|
+
onKeydown: Ae
|
|
121
|
+
}, {
|
|
122
|
+
default: ee(() => [d("div", me, [
|
|
123
|
+
d("div", he, [d("h3", y, r(p(V).modules.browse), 1), d("button", {
|
|
124
|
+
"aria-label": p(V).modules.close,
|
|
125
|
+
class: "tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-1 tpl:transition-colors tpl:duration-100 tpl:text-[var(--tpl-text-dim)]",
|
|
126
|
+
onClick: $
|
|
127
|
+
}, [c(p(de), {
|
|
128
|
+
size: 16,
|
|
129
|
+
"stroke-width": 2
|
|
130
|
+
})], 8, b)]),
|
|
131
|
+
d("div", x, [d("div", S, [d("div", C, [d("div", w, [c(p(pe), {
|
|
132
|
+
size: 14,
|
|
133
|
+
"stroke-width": 2,
|
|
134
|
+
class: "tpl:pointer-events-none tpl:absolute tpl:left-3 tpl:top-1/2 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]"
|
|
135
|
+
}), e(d("input", {
|
|
136
|
+
"onUpdate:modelValue": f[0] ||= (e) => W.value = e,
|
|
137
|
+
type: "text",
|
|
138
|
+
placeholder: p(V).modules.search,
|
|
139
|
+
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:pl-9 tpl:pr-3 tpl:text-sm tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
|
|
140
|
+
}, null, 8, T), [[re, W.value]])])]), d("div", E, [J.value.length > 0 ? (n(), s("div", D, [(n(!0), s(l, null, i(J.value, (e) => (n(), s("button", {
|
|
141
|
+
key: e.id,
|
|
142
|
+
type: "button",
|
|
143
|
+
"aria-pressed": G.value === e.id,
|
|
144
|
+
class: "tpl:group/card tpl:w-full tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:bg-transparent tpl:px-3 tpl:py-2 tpl:text-left tpl:transition-all tpl:duration-[120ms]",
|
|
145
|
+
style: ie({
|
|
146
|
+
borderColor: G.value === e.id ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
147
|
+
backgroundColor: G.value === e.id ? "var(--tpl-primary-light)" : "transparent"
|
|
148
|
+
}),
|
|
149
|
+
onClick: (t) => G.value = e.id
|
|
150
|
+
}, [d("div", k, [d("span", A, r(e.name), 1), d("span", j, r(p(V).modules.blockCount.replace("{count}", String(e.content.length))), 1)]), d("div", M, [
|
|
151
|
+
(n(!0), s(l, null, i(Oe(e), (e) => (n(), u(t(e.icon), {
|
|
152
|
+
key: e.type,
|
|
153
|
+
size: 14,
|
|
154
|
+
"stroke-width": 1.5,
|
|
155
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
156
|
+
}))), 128)),
|
|
157
|
+
Z(e) > 0 ? (n(), s("span", N, " +" + r(Z(e)), 1)) : te("", !0),
|
|
158
|
+
K.value === e.id ? (n(), s("button", {
|
|
159
|
+
key: 1,
|
|
160
|
+
"aria-label": p(V).modules.deleteConfirm,
|
|
161
|
+
class: "tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:duration-100 tpl:border-[var(--tpl-danger)] tpl:text-[var(--tpl-danger)]",
|
|
162
|
+
style: { "background-color": "transparent" },
|
|
163
|
+
onClick: m((t) => ke(e.id), ["stop"])
|
|
164
|
+
}, r(p(V).modules.deleteConfirm), 9, P)) : (n(), s("button", {
|
|
165
|
+
key: 2,
|
|
166
|
+
class: "tpl-module-delete-btn tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:duration-100 tpl:text-[var(--tpl-text-dim)]",
|
|
167
|
+
"aria-label": p(V).modules.delete,
|
|
168
|
+
title: p(V).modules.delete,
|
|
169
|
+
onClick: m((t) => K.value = e.id, ["stop"])
|
|
170
|
+
}, [c(p(ue), {
|
|
171
|
+
size: 12,
|
|
172
|
+
"stroke-width": 1.5
|
|
173
|
+
})], 8, F))
|
|
174
|
+
])], 12, O))), 128))])) : (n(), s("div", I, [c(p(_), {
|
|
175
|
+
size: 32,
|
|
176
|
+
"stroke-width": 1,
|
|
177
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
178
|
+
}), d("p", L, r(W.value ? p(V).modules.noModules : p(V).modules.noModulesHint), 1)]))])]), d("div", R, [Y.value ? (n(), s("div", ge, [d("div", _e, [c(p(Ee), { blocks: Y.value.content }, null, 8, ["blocks"])])])) : (n(), s("div", ve, [c(p(_), {
|
|
179
|
+
size: 32,
|
|
180
|
+
"stroke-width": 1,
|
|
181
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
182
|
+
}), d("p", ye, r(p(V).modules.selectToPreview), 1)]))])]),
|
|
183
|
+
d("div", be, [d("div", xe, [d("label", Se, r(p(V).modules.insertPosition), 1), e(d("select", {
|
|
184
|
+
"onUpdate:modelValue": f[1] ||= (e) => q.value = e,
|
|
185
|
+
class: "tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
|
|
186
|
+
}, [(n(!0), s(l, null, i(De.value, (e) => (n(), s("option", {
|
|
187
|
+
key: e.value,
|
|
188
|
+
value: e.value
|
|
189
|
+
}, r(e.label), 9, Ce))), 128))], 512), [[ne, q.value]])]), d("div", we, [d("button", {
|
|
190
|
+
type: "button",
|
|
191
|
+
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]",
|
|
192
|
+
onClick: $
|
|
193
|
+
}, r(p(V).modules.close), 1), d("button", {
|
|
194
|
+
type: "button",
|
|
195
|
+
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
196
|
+
disabled: !Y.value,
|
|
197
|
+
onClick: Q
|
|
198
|
+
}, r(p(V).modules.insert), 9, Te)])])
|
|
199
|
+
])]),
|
|
200
|
+
_: 1
|
|
201
|
+
}, 8, ["visible"]));
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
//#endregion
|
|
205
|
+
export { z as default };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { E as e, I as t, L as n, M as r, P as i, S as a, _ as o, d as s, h as c, m as l, p as u, tt as d, wt as f } from "./vue.runtime.esm-bundler-DryoQb-v.js";
|
|
2
|
+
import { o as p } from "./keys-CIw9mUI2.js";
|
|
3
|
+
import { N as m, _ as h, a as g, f as _, g as v, h as y, i as b, m as x, n as S, p as C, r as w, u as T, v as E, y as D } from "./useEditorCore-DMH2QpUL.js";
|
|
4
|
+
//#region src/components/blocks/PreviewSectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var O = { class: "tpl:w-full" }, k = { class: "tpl:flex tpl:gap-0" }, A = /* @__PURE__ */ a({
|
|
6
|
+
name: "PreviewSectionBlock",
|
|
7
|
+
__name: "PreviewSectionBlock",
|
|
8
|
+
props: {
|
|
9
|
+
block: {},
|
|
10
|
+
viewport: {}
|
|
11
|
+
},
|
|
12
|
+
setup(a) {
|
|
13
|
+
let A = {
|
|
14
|
+
title: T,
|
|
15
|
+
paragraph: x,
|
|
16
|
+
image: v,
|
|
17
|
+
video: S,
|
|
18
|
+
button: m,
|
|
19
|
+
divider: E,
|
|
20
|
+
social: g,
|
|
21
|
+
menu: y,
|
|
22
|
+
table: w,
|
|
23
|
+
spacer: b,
|
|
24
|
+
html: h,
|
|
25
|
+
custom: D
|
|
26
|
+
}, j = a, M = e(p, null), N = u(() => {
|
|
27
|
+
switch (j.block.columns) {
|
|
28
|
+
case "2": return ["50%", "50%"];
|
|
29
|
+
case "3": return [
|
|
30
|
+
"33.33%",
|
|
31
|
+
"33.33%",
|
|
32
|
+
"33.33%"
|
|
33
|
+
];
|
|
34
|
+
case "1-2": return ["33.33%", "66.67%"];
|
|
35
|
+
case "2-1": return ["66.67%", "33.33%"];
|
|
36
|
+
default: return ["100%"];
|
|
37
|
+
}
|
|
38
|
+
}), P = u(() => {
|
|
39
|
+
let e = N.value.length, t = [...j.block.children];
|
|
40
|
+
for (; t.length < e;) t.push([]);
|
|
41
|
+
return t.slice(0, e);
|
|
42
|
+
});
|
|
43
|
+
function F(e) {
|
|
44
|
+
return P.value[e] || [];
|
|
45
|
+
}
|
|
46
|
+
function I(e) {
|
|
47
|
+
return C(e, M, A);
|
|
48
|
+
}
|
|
49
|
+
return (e, a) => {
|
|
50
|
+
let u = t("PreviewSectionBlock", !0);
|
|
51
|
+
return r(), o("div", O, [l("div", k, [(r(!0), o(s, null, i(P.value, (e, t) => (r(), o("div", {
|
|
52
|
+
key: t,
|
|
53
|
+
style: f({ width: N.value[t] })
|
|
54
|
+
}, [(r(!0), o(s, null, i(F(t), (e) => (r(), o("div", {
|
|
55
|
+
key: e.id,
|
|
56
|
+
style: f(d(_)(e))
|
|
57
|
+
}, [e.type === "section" ? (r(), c(u, {
|
|
58
|
+
key: 0,
|
|
59
|
+
block: e,
|
|
60
|
+
viewport: "desktop"
|
|
61
|
+
}, null, 8, ["block"])) : (r(), c(n(I(e)), {
|
|
62
|
+
key: 1,
|
|
63
|
+
block: e,
|
|
64
|
+
viewport: "desktop"
|
|
65
|
+
}, null, 8, ["block"]))], 4))), 128))], 4))), 128))])]);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}), j = {
|
|
69
|
+
class: "tpl:pointer-events-none tpl:mx-auto tpl:w-[600px] tpl:select-none tpl:rounded-lg",
|
|
70
|
+
style: {
|
|
71
|
+
"background-color": "var(--tpl-canvas-bg)",
|
|
72
|
+
"box-shadow": "var(--tpl-shadow-sm)"
|
|
73
|
+
}
|
|
74
|
+
}, M = /* @__PURE__ */ a({
|
|
75
|
+
__name: "ModulePreviewCanvas",
|
|
76
|
+
props: { blocks: {} },
|
|
77
|
+
setup(t) {
|
|
78
|
+
let a = e(p), l = {
|
|
79
|
+
section: A,
|
|
80
|
+
title: T,
|
|
81
|
+
paragraph: x,
|
|
82
|
+
image: v,
|
|
83
|
+
video: S,
|
|
84
|
+
button: m,
|
|
85
|
+
divider: E,
|
|
86
|
+
social: g,
|
|
87
|
+
menu: y,
|
|
88
|
+
table: w,
|
|
89
|
+
spacer: b,
|
|
90
|
+
html: h,
|
|
91
|
+
custom: D
|
|
92
|
+
};
|
|
93
|
+
function u(e) {
|
|
94
|
+
return C(e, a, l);
|
|
95
|
+
}
|
|
96
|
+
return (e, a) => (r(), o("div", j, [(r(!0), o(s, null, i(t.blocks, (e) => (r(), o("div", {
|
|
97
|
+
key: e.id,
|
|
98
|
+
style: f(d(_)(e))
|
|
99
|
+
}, [(r(), c(n(u(e)), {
|
|
100
|
+
block: e,
|
|
101
|
+
viewport: "desktop"
|
|
102
|
+
}, null, 8, ["block"]))], 4))), 128))]));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
//#endregion
|
|
106
|
+
export { M as default };
|