@templatical/editor 0.0.5 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +56 -0
- package/README.md +69 -0
- package/dist/{AiChatSidebar-DwME3f-a.js → AiChatSidebar-DSbBLDkW.js} +9 -9
- package/dist/{AiFeatureMenu-DJvWL1GZ.js → AiFeatureMenu-d04gmgud.js} +5 -5
- package/dist/{CloudEditor-Fe0ssRgi.js → CloudEditor-CjO4tzbV.js} +218 -227
- package/dist/{CollaboratorBar-DTT0EkZn.js → CollaboratorBar-DYBSTuMW.js} +3 -3
- package/dist/{CommentsSidebar-DrJhQRXK.js → CommentsSidebar-CQvUh5xt.js} +9 -9
- package/dist/CountdownBlock-D3olfssJ.js +92 -0
- package/dist/CountdownToolbar-ClpBwFoX.js +210 -0
- package/dist/{DesignReferenceSidebar-DdOht5zn.js → DesignReferenceSidebar-BOfeETis.js} +5 -5
- package/dist/{LoadingTrack-vK8W2PJf.js → LoadingTrack-CdqDYVR-.js} +1 -1
- package/dist/{ModuleBrowserModal-CiV_jOEM.js → ModuleBrowserModal-DKSSQonv.js} +7 -7
- package/dist/{ModulePreviewCanvas-Bmy6Y1WE.js → ModulePreviewCanvas-CoLNuu1o.js} +32 -32
- package/dist/NumberWithSuffix-_0l3Q4jq.js +424 -0
- package/dist/{ParagraphEditor-CoQ3NlS7.js → ParagraphEditor-C9R2ou7x.js} +57 -56
- package/dist/{RichTextEditorContent-CHJlh7HJ.js → RichTextEditorContent-BcY3Rcp4.js} +2 -2
- package/dist/{SaveModuleDialog-CD2ZYq1o.js → SaveModuleDialog-DmFe4VUc.js} +3 -3
- package/dist/{SnapshotHistory-DltsKvhP.js → SnapshotHistory-CAhikAOr.js} +7 -7
- package/dist/{TemplateScoringPanel-DmnmUE3y.js → TemplateScoringPanel-b5DnyIll.js} +10 -10
- package/dist/{TestEmailModal-Dl633j9o.js → TestEmailModal-BmDIzGYz.js} +3 -3
- package/dist/{TitleEditor-C7fds2Nc.js → TitleEditor-DtRYx-LS.js} +11 -11
- package/dist/{TplModal-C5_CF-qn.js → TplModal-BLbMDMd6.js} +4 -4
- package/dist/{_plugin-vue_export-helper-B1-bu7yR.js → _plugin-vue_export-helper-BHUPLLh1.js} +2 -2
- package/dist/{blockTypeIcons-BrKZB10B.js → blockTypeIcons-CEU2dMe1.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-C5UQmEgV.js → AiFeatureMenu-DWMSYD2J.js} +4 -4
- package/dist/cdn/chunks/{AiFeatureMenu-C5UQmEgV.js.map → AiFeatureMenu-DWMSYD2J.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-DeTolKnf.js → CloudEditor-HrfSfr3G.js} +179 -188
- package/dist/cdn/chunks/CloudEditor-HrfSfr3G.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-DO1nxSrr.js → CollaboratorBar-Cfok52TZ.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-DO1nxSrr.js.map → CollaboratorBar-Cfok52TZ.js.map} +1 -1
- package/dist/cdn/chunks/CountdownBlock-CkV21NEM.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-CkV21NEM.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-CEmbR7kt.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-CEmbR7kt.js.map +1 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-ChBr3aXj.js → ModuleBrowserModal-sASaPRot.js} +7 -7
- package/dist/cdn/chunks/{ModuleBrowserModal-ChBr3aXj.js.map → ModuleBrowserModal-sASaPRot.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DkSvri9H.js → ModulePreviewCanvas-D8zsajMf.js} +19 -19
- package/dist/cdn/chunks/{ModulePreviewCanvas-DkSvri9H.js.map → ModulePreviewCanvas-D8zsajMf.js.map} +1 -1
- package/dist/cdn/chunks/NumberWithSuffix-k5Te7Tuw.js +425 -0
- package/dist/cdn/chunks/NumberWithSuffix-k5Te7Tuw.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-DU3oUKA7.js → ParagraphEditor-C1vQWGzW.js} +37 -37
- package/dist/cdn/chunks/ParagraphEditor-C1vQWGzW.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-BrsW1p9s.js → RichTextEditorContent-CT8dBB0R.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-BrsW1p9s.js.map → RichTextEditorContent-CT8dBB0R.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-CjqKkTEc.js → SaveModuleDialog-BkwKrB0N.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-CjqKkTEc.js.map → SaveModuleDialog-BkwKrB0N.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-C8FYbadT.js → TitleEditor-BXqt42Px.js} +11 -11
- package/dist/cdn/chunks/{TitleEditor-C8FYbadT.js.map → TitleEditor-BXqt42Px.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-5QwYklNq.js → blockTypeIcons-BS6pWyGO.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-5QwYklNq.js.map → blockTypeIcons-BS6pWyGO.js.map} +1 -1
- package/dist/cdn/chunks/{de-BvYD17KT.js → de-3exf7MYE.js} +1 -1
- package/dist/cdn/chunks/{de-BvYD17KT.js.map → de-3exf7MYE.js.map} +1 -1
- package/dist/cdn/chunks/{de-BB3dgVOc.js → de-C8LxVUsb.js} +1 -1
- package/dist/cdn/chunks/de-C8LxVUsb.js.map +1 -0
- package/dist/cdn/chunks/{dist-KYv9v_1z2.js → dist-BpOx-ugr.js} +10 -3
- package/dist/cdn/chunks/dist-BpOx-ugr.js.map +1 -0
- package/dist/cdn/chunks/{draggable-BQNU47zu.js → draggable-Bcb86AsV.js} +1591 -1563
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
- package/dist/cdn/chunks/{emojiData-BVEJHcNH.js → emojiData-DUHzsh4j.js} +1 -1
- package/dist/cdn/chunks/{emojiData-BVEJHcNH.js.map → emojiData-DUHzsh4j.js.map} +1 -1
- package/dist/cdn/chunks/{en-DeDcpnoS.js → en-BoEycuqw.js} +1 -1
- package/dist/cdn/chunks/en-BoEycuqw.js.map +1 -0
- package/dist/cdn/chunks/{en-CpotcOPr.js → en-KNPUKxYp.js} +1 -1
- package/dist/cdn/chunks/{en-CpotcOPr.js.map → en-KNPUKxYp.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-Bj7USRLr.js → extensions-DBxH6pz0.js} +21 -21
- package/dist/cdn/chunks/{extensions-Bj7USRLr.js.map → extensions-DBxH6pz0.js.map} +1 -1
- package/dist/cdn/chunks/{features-Ds0XUfte.js → features-C3n7AeUc.js} +1338 -1422
- package/dist/cdn/chunks/features-C3n7AeUc.js.map +1 -0
- package/dist/cdn/chunks/{icons-fWsuSvgd.js → icons-Hmpb0_8s.js} +2 -2
- package/dist/cdn/chunks/icons-Hmpb0_8s.js.map +1 -0
- package/dist/cdn/chunks/{liquid.browser-C1VIYISn.js → liquid.browser-CEMn-ZqL.js} +24 -17
- package/dist/cdn/chunks/liquid.browser-CEMn-ZqL.js.map +1 -0
- package/dist/cdn/chunks/{media-library-BGQm_OyC.js → media-library-C1wCpRY1.js} +114 -110
- package/dist/cdn/chunks/media-library-C1wCpRY1.js.map +1 -0
- package/dist/cdn/chunks/{pusher-DJPhQnE8.js → pusher-DwSQn6BA.js} +11 -8
- package/dist/cdn/chunks/pusher-DwSQn6BA.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -1
- package/dist/cdn/chunks/{rolldown-runtime-DPITmOBR.js → rolldown-runtime-BNuo_Jkg.js} +1 -1
- package/dist/cdn/chunks/{src-3i8rPuqd.js → src-BUszJqfd.js} +8 -8
- package/dist/cdn/chunks/{src-3i8rPuqd.js.map → src-BUszJqfd.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-Dgijy53u.js → styles-U2VFFgxC.js} +623 -1239
- package/dist/cdn/chunks/styles-U2VFFgxC.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-BhxaWR8R.js → tiptap-w5IqC8oW.js} +1610 -1364
- package/dist/cdn/chunks/tiptap-w5IqC8oW.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-B7kDuZmP.js → check-BDE2uFIC.js} +1 -1
- package/dist/{chevron-down-DJLW2Q9Z.js → chevron-down-BL1DcOiT.js} +1 -1
- package/dist/{circle-alert-E2vYPs5r.js → circle-alert-1tetIFJU.js} +1 -1
- package/dist/{clock-lWIIQA3C.js → clock-CNc3isoG.js} +1 -1
- package/dist/{dist-DysAFIPy.js → dist-7SaUYnxo.js} +385 -357
- package/dist/{dist-DmOE-Ubp.js → dist-BKZ5gvJf.js} +5 -5
- package/dist/{dist-CG-vEqSU.js → dist-CLg2qE0p.js} +2 -2
- package/dist/dist-CdzaZZSx.js +5 -0
- package/dist/dist-Cl9giA3B.js +5 -0
- package/dist/{dist-C_ymrGFi.js → dist-CpHKN3mI.js} +541 -508
- package/dist/{dist-4LiM9FDd.js → dist-DMuaebdo.js} +2 -2
- package/dist/{dist-ChAGLpWo.js → dist-DW_4_uv3.js} +2 -2
- package/dist/{dist-C1BIRHCQ.js → dist-DYG6FL7b.js} +2 -2
- package/dist/{dist-DrvKRSU6.js → dist-DbFMBx8E.js} +2 -2
- package/dist/{dist-D_HQYSY-.js → dist-Dn9cOicG.js} +2 -2
- package/dist/{dist-Ci5lFuUy.js → dist-ENKQZrNg.js} +138 -132
- package/dist/{dist-Bu7veieH.js → dist-fEtcLxee.js} +15 -15
- package/dist/{extensions-DWx_jj8v.js → extensions-Y880c0sP.js} +3 -3
- package/dist/{image-up-X4xIq4ea.js → image-up-4ZmaHFga.js} +1 -1
- package/dist/index.d.ts +234 -0
- package/dist/{liquid.browser-BemTg3sZ.js → liquid.browser-DZ62L7up.js} +20 -15
- package/dist/{loader-circle-BTQQxC3l.js → loader-circle-C7YEH4do.js} +1 -1
- package/dist/{message-circle-Blgm6V_h.js → message-circle-B_lxRh4z.js} +1 -1
- package/dist/{refresh-cw-Bb4PEeW1.js → refresh-cw-DmZNoimV.js} +1 -1
- package/dist/rolldown-runtime-gEudmnaM.js +23 -0
- package/dist/{scan-line-7lZPfOdm.js → scan-line-Cc9KlXo5.js} +1 -1
- package/dist/{send-C0ltAQrv.js → send-CMwNWTPX.js} +1 -1
- package/dist/{shield-check-f-qv4RKs.js → shield-check-DZFf4LTh.js} +1 -1
- package/dist/{sparkles-KhBCGlqB.js → sparkles-D80W88H8.js} +1 -1
- package/dist/{styleConstants-Cxw88naD.js → styleConstants-Codo7aUT.js} +6 -45
- package/dist/styles-unyYKihg.js +2942 -0
- package/dist/templatical-editor.css +1 -1
- package/dist/templatical-editor.js +85 -90
- package/dist/text-align-start-Cje6pwo4.js +43 -0
- package/dist/{trash-2-OwjZ-guZ.js → trash-2-BWvxOB4Q.js} +1 -1
- package/dist/{triangle-alert-DOSRIUYZ.js → triangle-alert-C6y94qVX.js} +1 -1
- package/dist/{useEditorCore-DUGD6pq_.js → useEditorCore-CQwWl2js.js} +1143 -1247
- package/dist/{x-CGlq2XQe.js → x-IyhJ6V90.js} +1 -1
- package/package.json +70 -52
- package/dist/cdn/chunks/AiChatSidebar-X_Bv3Qys.js +0 -2
- package/dist/cdn/chunks/CloudEditor-DeTolKnf.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-4MTw_hue.js +0 -2
- package/dist/cdn/chunks/DesignReferenceSidebar-Bswh4Yx4.js +0 -2
- package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js.map +0 -1
- package/dist/cdn/chunks/SnapshotHistory-KME4xmn_.js +0 -2
- package/dist/cdn/chunks/TemplateScoringPanel-DgB3xDN6.js +0 -2
- package/dist/cdn/chunks/TestEmailModal-DdpvRbYf.js +0 -2
- package/dist/cdn/chunks/de-BB3dgVOc.js.map +0 -1
- package/dist/cdn/chunks/dist-BF5c3Dr-.js +0 -2
- package/dist/cdn/chunks/dist-BGzvIxcJ.js +0 -2
- package/dist/cdn/chunks/dist-CFemF8rI.js +0 -2
- package/dist/cdn/chunks/dist-Co6uFhFK.js +0 -2
- package/dist/cdn/chunks/dist-DCikBY9K.js +0 -2
- package/dist/cdn/chunks/dist-DUILafAC.js +0 -2
- package/dist/cdn/chunks/dist-DghiKH0A.js +0 -2
- package/dist/cdn/chunks/dist-Dw8ckvfK.js +0 -2
- package/dist/cdn/chunks/dist-H07p0KAw.js +0 -2
- package/dist/cdn/chunks/dist-KYv9v_1z2.js.map +0 -1
- package/dist/cdn/chunks/dist-MjnKIc0W.js +0 -2
- package/dist/cdn/chunks/dist-odp0vGRv.js +0 -2
- package/dist/cdn/chunks/draggable-BQNU47zu.js.map +0 -1
- package/dist/cdn/chunks/en-DeDcpnoS.js.map +0 -1
- package/dist/cdn/chunks/features-Ds0XUfte.js.map +0 -1
- package/dist/cdn/chunks/icons-fWsuSvgd.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +0 -1
- package/dist/cdn/chunks/media-library-BGQm_OyC.js.map +0 -1
- package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +0 -1
- package/dist/cdn/chunks/styles-Dgijy53u.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BhxaWR8R.js.map +0 -1
- package/dist/dist-DkypH7qG.js +0 -5
- package/dist/dist-Dxnd0GRf.js +0 -5
- package/dist/styles-fdXNRqI3.js +0 -3556
- package/dist/templatical-editor.umd.cjs +0 -179
- /package/dist/cdn/chunks/{_rolldown_dynamic_import_helper-DMEI4TQ3.js → _rolldown_dynamic_import_helper-BRcA6nWq.js} +0 -0
- /package/dist/{de-D7TLGIPA.js → de-DCRASLfd.js} +0 -0
- /package/dist/{emojiData-BfWQS72m.js → emojiData-CyACq8qV.js} +0 -0
- /package/dist/{en-DvtiEMwP.js → en-BC0igPeg.js} +0 -0
- /package/dist/{formatRelativeTime-DX3FgqN9.js → formatRelativeTime-mRxw8HK8.js} +0 -0
- /package/dist/{readableTextColor-LDlmVEUv.js → readableTextColor-B809bF5J.js} +0 -0
- /package/dist/{useMergeTag-BZ3X0bNr.js → useMergeTag-CSXcnFBc.js} +0 -0
|
@@ -0,0 +1,2942 @@
|
|
|
1
|
+
import { o as e } from "./rolldown-runtime-gEudmnaM.js";
|
|
2
|
+
import { s as t } from "./dist-CLg2qE0p.js";
|
|
3
|
+
import { T as n, _ as r, a as i, d as a, f as o, l as s, n as c, o as l, p as u, s as d, u as f, v as p } from "./keys-C0MQRs8d.js";
|
|
4
|
+
import { t as m } from "./useI18n-D6m7ZUgY.js";
|
|
5
|
+
import { A as h, F as g, M as _, N as v, T as y, _ as ee, a as b, c as x, d as te, g as ne, h as re, i as ie, j as ae, k as oe, l as se, m as ce, n as le, o as ue, p as de, r as fe, s as S, u as pe, v as me, y as he } from "./useEditorCore-CQwWl2js.js";
|
|
6
|
+
import { n as C, t as w } from "./_plugin-vue_export-helper-BHUPLLh1.js";
|
|
7
|
+
import { t as ge } from "./chevron-down-BL1DcOiT.js";
|
|
8
|
+
import { t as _e } from "./circle-alert-1tetIFJU.js";
|
|
9
|
+
import { n as ve, r as ye, t as be } from "./blockTypeIcons-CEU2dMe1.js";
|
|
10
|
+
import { n as xe, r as Se, t as Ce } from "./refresh-cw-DmZNoimV.js";
|
|
11
|
+
import { t as we } from "./image-up-4ZmaHFga.js";
|
|
12
|
+
import { t as Te } from "./scan-line-Cc9KlXo5.js";
|
|
13
|
+
import { t as Ee } from "./sparkles-D80W88H8.js";
|
|
14
|
+
import { n as De, r as Oe, t as ke } from "./text-align-start-Cje6pwo4.js";
|
|
15
|
+
import { t as Ae } from "./trash-2-BWvxOB4Q.js";
|
|
16
|
+
import { t as je } from "./x-IyhJ6V90.js";
|
|
17
|
+
import { t as Me } from "./useMergeTag-CSXcnFBc.js";
|
|
18
|
+
import { t as Ne } from "./readableTextColor-B809bF5J.js";
|
|
19
|
+
import { t as Pe } from "./CountdownBlock-D3olfssJ.js";
|
|
20
|
+
import { _ as Fe, c as Ie, f as T, g as Le, h as E, l as Re, m as D, p as O, t as ze } from "./styleConstants-Codo7aUT.js";
|
|
21
|
+
import { i as k, n as A, r as j, t as Be } from "./NumberWithSuffix-_0l3Q4jq.js";
|
|
22
|
+
import { Fragment as M, Transition as Ve, computed as N, createBlock as P, createCommentVNode as F, createElementBlock as I, createElementVNode as L, createTextVNode as R, createVNode as z, defineAsyncComponent as He, defineComponent as B, inject as V, nextTick as Ue, normalizeClass as H, normalizeStyle as U, openBlock as W, reactive as We, ref as G, renderList as K, renderSlot as Ge, resolveDynamicComponent as Ke, toDisplayString as q, unref as J, vModelText as qe, vShow as Je, watch as Ye, withCtx as Y, withDirectives as Xe, withKeys as Ze, withModifiers as Qe } from "vue";
|
|
23
|
+
import { useDataSourceFetch as $e } from "@templatical/core";
|
|
24
|
+
import { SYNTAX_PRESETS as et, containsMergeTag as tt, createBlock as nt, createCustomBlock as rt, generateId as it, getLogicMergeTagKeyword as at, isCustomBlock as ot, isLogicMergeTagValue as st } from "@templatical/types";
|
|
25
|
+
var ct = C("circle", [["circle", {
|
|
26
|
+
cx: "12",
|
|
27
|
+
cy: "12",
|
|
28
|
+
r: "10",
|
|
29
|
+
key: "1mglay"
|
|
30
|
+
}]]), lt = C("layout-template", [
|
|
31
|
+
["rect", {
|
|
32
|
+
width: "18",
|
|
33
|
+
height: "7",
|
|
34
|
+
x: "3",
|
|
35
|
+
y: "3",
|
|
36
|
+
rx: "1",
|
|
37
|
+
key: "f1a2em"
|
|
38
|
+
}],
|
|
39
|
+
["rect", {
|
|
40
|
+
width: "9",
|
|
41
|
+
height: "7",
|
|
42
|
+
x: "3",
|
|
43
|
+
y: "14",
|
|
44
|
+
rx: "1",
|
|
45
|
+
key: "jqznyg"
|
|
46
|
+
}],
|
|
47
|
+
["rect", {
|
|
48
|
+
width: "5",
|
|
49
|
+
height: "7",
|
|
50
|
+
x: "16",
|
|
51
|
+
y: "14",
|
|
52
|
+
rx: "1",
|
|
53
|
+
key: "q5h2i8"
|
|
54
|
+
}]
|
|
55
|
+
]), ut = C("lock-open", [["rect", {
|
|
56
|
+
width: "18",
|
|
57
|
+
height: "11",
|
|
58
|
+
x: "3",
|
|
59
|
+
y: "11",
|
|
60
|
+
rx: "2",
|
|
61
|
+
ry: "2",
|
|
62
|
+
key: "1w4ew1"
|
|
63
|
+
}], ["path", {
|
|
64
|
+
d: "M7 11V7a5 5 0 0 1 9.9-1",
|
|
65
|
+
key: "1mm8w8"
|
|
66
|
+
}]]), dt = C("lock", [["rect", {
|
|
67
|
+
width: "18",
|
|
68
|
+
height: "11",
|
|
69
|
+
x: "3",
|
|
70
|
+
y: "11",
|
|
71
|
+
rx: "2",
|
|
72
|
+
ry: "2",
|
|
73
|
+
key: "1w4ew1"
|
|
74
|
+
}], ["path", {
|
|
75
|
+
d: "M7 11V7a5 5 0 0 1 10 0v4",
|
|
76
|
+
key: "fwvmzm"
|
|
77
|
+
}]]), ft = C("monitor", [
|
|
78
|
+
["rect", {
|
|
79
|
+
width: "20",
|
|
80
|
+
height: "14",
|
|
81
|
+
x: "2",
|
|
82
|
+
y: "3",
|
|
83
|
+
rx: "2",
|
|
84
|
+
key: "48i651"
|
|
85
|
+
}],
|
|
86
|
+
["line", {
|
|
87
|
+
x1: "8",
|
|
88
|
+
x2: "16",
|
|
89
|
+
y1: "21",
|
|
90
|
+
y2: "21",
|
|
91
|
+
key: "1svkeh"
|
|
92
|
+
}],
|
|
93
|
+
["line", {
|
|
94
|
+
x1: "12",
|
|
95
|
+
x2: "12",
|
|
96
|
+
y1: "17",
|
|
97
|
+
y2: "21",
|
|
98
|
+
key: "vw1qmm"
|
|
99
|
+
}]
|
|
100
|
+
]), pt = C("moon", [["path", {
|
|
101
|
+
d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",
|
|
102
|
+
key: "kfwtm"
|
|
103
|
+
}]]), mt = C("panel-top", [["rect", {
|
|
104
|
+
width: "18",
|
|
105
|
+
height: "18",
|
|
106
|
+
x: "3",
|
|
107
|
+
y: "3",
|
|
108
|
+
rx: "2",
|
|
109
|
+
key: "afitv7"
|
|
110
|
+
}], ["path", {
|
|
111
|
+
d: "M3 9h18",
|
|
112
|
+
key: "1pudct"
|
|
113
|
+
}]]), X = C("plus", [["path", {
|
|
114
|
+
d: "M5 12h14",
|
|
115
|
+
key: "1ays0h"
|
|
116
|
+
}], ["path", {
|
|
117
|
+
d: "M12 5v14",
|
|
118
|
+
key: "s699le"
|
|
119
|
+
}]]), ht = C("rotate-ccw", [["path", {
|
|
120
|
+
d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
|
|
121
|
+
key: "1357e3"
|
|
122
|
+
}], ["path", {
|
|
123
|
+
d: "M3 3v5h5",
|
|
124
|
+
key: "1xhq8a"
|
|
125
|
+
}]]), gt = C("settings", [["path", {
|
|
126
|
+
d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
|
|
127
|
+
key: "1i5ecw"
|
|
128
|
+
}], ["circle", {
|
|
129
|
+
cx: "12",
|
|
130
|
+
cy: "12",
|
|
131
|
+
r: "3",
|
|
132
|
+
key: "1v7zrd"
|
|
133
|
+
}]]), _t = C("smartphone", [["rect", {
|
|
134
|
+
width: "14",
|
|
135
|
+
height: "20",
|
|
136
|
+
x: "5",
|
|
137
|
+
y: "2",
|
|
138
|
+
rx: "2",
|
|
139
|
+
ry: "2",
|
|
140
|
+
key: "1yt0o3"
|
|
141
|
+
}], ["path", {
|
|
142
|
+
d: "M12 18h.01",
|
|
143
|
+
key: "mhygvu"
|
|
144
|
+
}]]), vt = C("square-plus", [
|
|
145
|
+
["rect", {
|
|
146
|
+
width: "18",
|
|
147
|
+
height: "18",
|
|
148
|
+
x: "3",
|
|
149
|
+
y: "3",
|
|
150
|
+
rx: "2",
|
|
151
|
+
key: "afitv7"
|
|
152
|
+
}],
|
|
153
|
+
["path", {
|
|
154
|
+
d: "M8 12h8",
|
|
155
|
+
key: "1wcyev"
|
|
156
|
+
}],
|
|
157
|
+
["path", {
|
|
158
|
+
d: "M12 8v8",
|
|
159
|
+
key: "napkw2"
|
|
160
|
+
}]
|
|
161
|
+
]), yt = C("square", [["rect", {
|
|
162
|
+
width: "18",
|
|
163
|
+
height: "18",
|
|
164
|
+
x: "3",
|
|
165
|
+
y: "3",
|
|
166
|
+
rx: "2",
|
|
167
|
+
key: "afitv7"
|
|
168
|
+
}]]), bt = C("sun", [
|
|
169
|
+
["circle", {
|
|
170
|
+
cx: "12",
|
|
171
|
+
cy: "12",
|
|
172
|
+
r: "4",
|
|
173
|
+
key: "4exip2"
|
|
174
|
+
}],
|
|
175
|
+
["path", {
|
|
176
|
+
d: "M12 2v2",
|
|
177
|
+
key: "tus03m"
|
|
178
|
+
}],
|
|
179
|
+
["path", {
|
|
180
|
+
d: "M12 20v2",
|
|
181
|
+
key: "1lh1kg"
|
|
182
|
+
}],
|
|
183
|
+
["path", {
|
|
184
|
+
d: "m4.93 4.93 1.41 1.41",
|
|
185
|
+
key: "149t6j"
|
|
186
|
+
}],
|
|
187
|
+
["path", {
|
|
188
|
+
d: "m17.66 17.66 1.41 1.41",
|
|
189
|
+
key: "ptbguv"
|
|
190
|
+
}],
|
|
191
|
+
["path", {
|
|
192
|
+
d: "M2 12h2",
|
|
193
|
+
key: "1t8f8n"
|
|
194
|
+
}],
|
|
195
|
+
["path", {
|
|
196
|
+
d: "M20 12h2",
|
|
197
|
+
key: "1q8mjw"
|
|
198
|
+
}],
|
|
199
|
+
["path", {
|
|
200
|
+
d: "m6.34 17.66-1.41 1.41",
|
|
201
|
+
key: "1m8zz5"
|
|
202
|
+
}],
|
|
203
|
+
["path", {
|
|
204
|
+
d: "m19.07 4.93-1.41 1.41",
|
|
205
|
+
key: "1shlcs"
|
|
206
|
+
}]
|
|
207
|
+
]), xt = C("tablet", [["rect", {
|
|
208
|
+
width: "16",
|
|
209
|
+
height: "20",
|
|
210
|
+
x: "4",
|
|
211
|
+
y: "2",
|
|
212
|
+
rx: "2",
|
|
213
|
+
ry: "2",
|
|
214
|
+
key: "76otgf"
|
|
215
|
+
}], ["line", {
|
|
216
|
+
x1: "12",
|
|
217
|
+
x2: "12.01",
|
|
218
|
+
y1: "18",
|
|
219
|
+
y2: "18",
|
|
220
|
+
key: "1dp563"
|
|
221
|
+
}]]), St = /* @__PURE__ */ e(se(), 1), Ct = ["aria-label"], wt = { class: "tpl:relative" }, Tt = {
|
|
222
|
+
class: "tpl:inline-flex tpl:size-3 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[8px] tpl:font-bold",
|
|
223
|
+
style: { "background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 30%,\n transparent\n )" }
|
|
224
|
+
}, Et = {
|
|
225
|
+
key: 0,
|
|
226
|
+
class: "tpl-canvas-empty tpl:m-6 tpl:flex tpl:min-h-[400px] tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-xl tpl:border-2 tpl:border-dashed tpl:px-10 tpl:py-12 tpl:text-center tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg-elevated)] tpl:font-[var(--tpl-font-family)]"
|
|
227
|
+
}, Dt = { class: "tpl-canvas-empty-icon tpl:mb-4 tpl:text-[var(--tpl-primary)]" }, Ot = { class: "tpl-canvas-empty-title tpl:m-0 tpl:mb-2 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-primary)]" }, kt = { class: "tpl-canvas-empty-text tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-dim)]" }, At = {
|
|
228
|
+
key: 0,
|
|
229
|
+
class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
230
|
+
}, jt = {
|
|
231
|
+
key: 1,
|
|
232
|
+
class: "tpl:m-0 tpl:mt-4 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
233
|
+
}, Mt = /* @__PURE__ */ w(/* @__PURE__ */ B({
|
|
234
|
+
__name: "Canvas",
|
|
235
|
+
props: {
|
|
236
|
+
viewport: {},
|
|
237
|
+
content: {},
|
|
238
|
+
selectedBlockId: {},
|
|
239
|
+
darkMode: { type: Boolean },
|
|
240
|
+
previewMode: { type: Boolean },
|
|
241
|
+
lockedBlocks: {}
|
|
242
|
+
},
|
|
243
|
+
emits: [
|
|
244
|
+
"select-block",
|
|
245
|
+
"open-ai-chat",
|
|
246
|
+
"open-design-reference"
|
|
247
|
+
],
|
|
248
|
+
setup(e, { emit: t }) {
|
|
249
|
+
let r = {
|
|
250
|
+
section: x,
|
|
251
|
+
title: pe,
|
|
252
|
+
paragraph: ce,
|
|
253
|
+
image: ne,
|
|
254
|
+
button: v,
|
|
255
|
+
divider: me,
|
|
256
|
+
spacer: ie,
|
|
257
|
+
html: ee,
|
|
258
|
+
social: b,
|
|
259
|
+
menu: re,
|
|
260
|
+
table: fe,
|
|
261
|
+
video: le,
|
|
262
|
+
countdown: Pe,
|
|
263
|
+
custom: he
|
|
264
|
+
}, i = e, a = t, { t: c } = m(), u = n(o, "Canvas"), f = V(s, null), p = V(l, null), h = V(d, {}), g = N(() => (h.plan?.hasFeature("ai_generation") ?? !1) && (h.ai?.isFeatureEnabled("chat") ?? !1)), _ = N(() => (h.plan?.hasFeature("ai_generation") ?? !1) && (h.ai?.isFeatureEnabled("designToTemplate") ?? !1)), y = N({
|
|
265
|
+
get: () => i.content.blocks,
|
|
266
|
+
set: (e) => {
|
|
267
|
+
u.setContent({
|
|
268
|
+
...i.content,
|
|
269
|
+
blocks: e
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}), ae = N(() => {
|
|
273
|
+
switch (i.viewport) {
|
|
274
|
+
case "mobile": return 375;
|
|
275
|
+
case "tablet": return 768;
|
|
276
|
+
default: return i.content.settings.width;
|
|
277
|
+
}
|
|
278
|
+
}), oe = N(() => ({
|
|
279
|
+
backgroundColor: i.content.settings.backgroundColor,
|
|
280
|
+
fontFamily: i.content.settings.fontFamily
|
|
281
|
+
}));
|
|
282
|
+
function se(e) {
|
|
283
|
+
i.previewMode || e.target === e.currentTarget && a("select-block", null);
|
|
284
|
+
}
|
|
285
|
+
function ue(e) {
|
|
286
|
+
return de(e, p, r);
|
|
287
|
+
}
|
|
288
|
+
function S(e) {
|
|
289
|
+
return i.lockedBlocks?.get(e) ?? null;
|
|
290
|
+
}
|
|
291
|
+
function C(e, t) {
|
|
292
|
+
e.type === "custom" && u.updateBlock(e.id, {
|
|
293
|
+
fieldValues: t.fieldValues,
|
|
294
|
+
dataSourceFetched: t.dataSourceFetched
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
return (t, n) => (W(), I("div", {
|
|
298
|
+
"data-testid": "canvas-wrapper",
|
|
299
|
+
role: "region",
|
|
300
|
+
"aria-label": J(c).landmarks.canvas,
|
|
301
|
+
class: "tpl-canvas-wrapper tpl:rounded-lg",
|
|
302
|
+
style: U({
|
|
303
|
+
width: `${ae.value}px`,
|
|
304
|
+
backgroundColor: e.content.settings.backgroundColor,
|
|
305
|
+
boxShadow: e.darkMode ? "none" : "var(--tpl-shadow-xl)",
|
|
306
|
+
filter: e.darkMode ? "invert(1) hue-rotate(180deg)" : "none",
|
|
307
|
+
transition: "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 300ms ease"
|
|
308
|
+
})
|
|
309
|
+
}, [L("div", {
|
|
310
|
+
class: H(["tpl-canvas tpl:rounded-lg", {
|
|
311
|
+
"tpl-canvas--dark-mode": e.darkMode,
|
|
312
|
+
"tpl-preview-mode": e.previewMode
|
|
313
|
+
}]),
|
|
314
|
+
style: U(oe.value),
|
|
315
|
+
onClick: se
|
|
316
|
+
}, [z(J(St.default), {
|
|
317
|
+
modelValue: y.value,
|
|
318
|
+
"onUpdate:modelValue": n[2] ||= (e) => y.value = e,
|
|
319
|
+
group: "blocks",
|
|
320
|
+
"item-key": "id",
|
|
321
|
+
animation: 150,
|
|
322
|
+
"ghost-class": "tpl-ghost",
|
|
323
|
+
"drag-class": "tpl-dragging",
|
|
324
|
+
handle: ".tpl-block-btn",
|
|
325
|
+
"invert-swap": !0,
|
|
326
|
+
"inverted-swap-threshold": .65,
|
|
327
|
+
disabled: e.previewMode,
|
|
328
|
+
class: "tpl-canvas-blocks"
|
|
329
|
+
}, {
|
|
330
|
+
item: Y(({ element: t }) => [Xe(L("div", null, [L("div", wt, [S(t.id) ? (W(), I("div", {
|
|
331
|
+
key: 0,
|
|
332
|
+
class: "tpl-collab-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
|
|
333
|
+
style: U({
|
|
334
|
+
outline: `2px solid ${S(t.id).color}`,
|
|
335
|
+
outlineOffset: "-1px"
|
|
336
|
+
})
|
|
337
|
+
}, [L("span", {
|
|
338
|
+
class: "tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:flex tpl:-translate-x-1/2 tpl:-translate-y-full tpl:items-center tpl:gap-1 tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:whitespace-nowrap",
|
|
339
|
+
style: U({
|
|
340
|
+
backgroundColor: S(t.id).color,
|
|
341
|
+
color: J(Ne)(S(t.id).color)
|
|
342
|
+
})
|
|
343
|
+
}, [L("span", Tt, q(S(t.id).name.charAt(0)), 1), R(" " + q(S(t.id).name), 1)], 4)], 4)) : F("", !0), z(te, {
|
|
344
|
+
block: t,
|
|
345
|
+
"is-selected": !e.previewMode && e.selectedBlockId === t.id && !S(t.id),
|
|
346
|
+
viewport: e.viewport,
|
|
347
|
+
"preview-mode": e.previewMode,
|
|
348
|
+
onSelect: (n) => e.previewMode || S(t.id) ? void 0 : a("select-block", t.id)
|
|
349
|
+
}, {
|
|
350
|
+
default: Y(() => [(W(), P(Ke(ue(t)), {
|
|
351
|
+
block: t,
|
|
352
|
+
viewport: e.viewport,
|
|
353
|
+
onFetchData: (e) => C(t, e),
|
|
354
|
+
onUpdate: (e) => J(u).updateBlock(t.id, e)
|
|
355
|
+
}, null, 40, [
|
|
356
|
+
"block",
|
|
357
|
+
"viewport",
|
|
358
|
+
"onFetchData",
|
|
359
|
+
"onUpdate"
|
|
360
|
+
]))]),
|
|
361
|
+
_: 2
|
|
362
|
+
}, 1032, [
|
|
363
|
+
"block",
|
|
364
|
+
"is-selected",
|
|
365
|
+
"viewport",
|
|
366
|
+
"preview-mode",
|
|
367
|
+
"onSelect"
|
|
368
|
+
])])], 512), [[Je, !J(f)?.isHidden(t.id)]])]),
|
|
369
|
+
footer: Y(() => [y.value.length === 0 && !e.previewMode ? (W(), I("div", Et, [
|
|
370
|
+
L("div", Dt, [z(J(vt), {
|
|
371
|
+
size: 48,
|
|
372
|
+
"stroke-width": 1
|
|
373
|
+
})]),
|
|
374
|
+
L("p", Ot, q(J(c).canvas.noBlocks), 1),
|
|
375
|
+
L("p", kt, q(J(c).canvas.dragHint), 1),
|
|
376
|
+
g.value ? (W(), I("p", At, [
|
|
377
|
+
R(q(J(c).canvas.aiHintChat) + " ", 1),
|
|
378
|
+
L("button", {
|
|
379
|
+
class: "tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
|
|
380
|
+
onClick: n[0] ||= (e) => a("open-ai-chat")
|
|
381
|
+
}, [z(J(Ee), {
|
|
382
|
+
size: 14,
|
|
383
|
+
"stroke-width": 2
|
|
384
|
+
}), R(" " + q(J(c).aiMenu.aiAssistant), 1)]),
|
|
385
|
+
R(" " + q(J(c).canvas.aiHintChatSuffix), 1)
|
|
386
|
+
])) : F("", !0),
|
|
387
|
+
_.value ? (W(), I("p", jt, [
|
|
388
|
+
R(q(J(c).canvas.aiHintDesign) + " ", 1),
|
|
389
|
+
L("button", {
|
|
390
|
+
class: "tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
|
|
391
|
+
onClick: n[1] ||= (e) => a("open-design-reference")
|
|
392
|
+
}, [z(J(we), {
|
|
393
|
+
size: 14,
|
|
394
|
+
"stroke-width": 2
|
|
395
|
+
}), R(" " + q(J(c).aiMenu.designToTemplate), 1)]),
|
|
396
|
+
R(" " + q(J(c).canvas.aiHintDesignSuffix), 1)
|
|
397
|
+
])) : F("", !0)
|
|
398
|
+
])) : F("", !0)]),
|
|
399
|
+
_: 1
|
|
400
|
+
}, 8, ["modelValue", "disabled"])], 6)], 12, Ct));
|
|
401
|
+
}
|
|
402
|
+
}), [["__scopeId", "data-v-43f4b3a0"]]), Nt = ["aria-label"], Pt = {
|
|
403
|
+
key: 0,
|
|
404
|
+
class: "tpl:border-b tpl:px-1 tpl:pb-1 tpl:border-[var(--tpl-border)]"
|
|
405
|
+
}, Ft = ["aria-label"], It = {
|
|
406
|
+
key: 0,
|
|
407
|
+
class: "tpl:flex-1 tpl:truncate tpl:text-sm tpl:font-medium"
|
|
408
|
+
}, Lt = {
|
|
409
|
+
key: 1,
|
|
410
|
+
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)]"
|
|
411
|
+
}, Rt = [
|
|
412
|
+
"data-palette-type",
|
|
413
|
+
"aria-label",
|
|
414
|
+
"onClick",
|
|
415
|
+
"onKeydown"
|
|
416
|
+
], zt = { class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:scale-105" }, Bt = {
|
|
417
|
+
key: 0,
|
|
418
|
+
class: "tpl:truncate tpl:text-sm tpl:font-medium"
|
|
419
|
+
}, Vt = /* @__PURE__ */ B({
|
|
420
|
+
__name: "Sidebar",
|
|
421
|
+
setup(e) {
|
|
422
|
+
let { t, format: n } = m(), r = V(f, []), a = V(i, void 0), s = V(o, null), c = V(d, {}), l = N(() => (c.savedModules?.moduleCount.value ?? 0) > 0), u = G(!1), p = [
|
|
423
|
+
"section",
|
|
424
|
+
"image",
|
|
425
|
+
"title",
|
|
426
|
+
"paragraph",
|
|
427
|
+
"button",
|
|
428
|
+
"divider",
|
|
429
|
+
"video",
|
|
430
|
+
"social",
|
|
431
|
+
"menu",
|
|
432
|
+
"table",
|
|
433
|
+
"spacer",
|
|
434
|
+
"html"
|
|
435
|
+
], h = N(() => {
|
|
436
|
+
let e = p.map((e) => ({
|
|
437
|
+
type: e,
|
|
438
|
+
label: g(e, t)
|
|
439
|
+
}));
|
|
440
|
+
return c.plan && e.splice(-1, 0, {
|
|
441
|
+
type: "countdown",
|
|
442
|
+
label: g("countdown", t)
|
|
443
|
+
}), e;
|
|
444
|
+
}), _ = N(() => r.map((e) => ({
|
|
445
|
+
type: `custom:${e.type}`,
|
|
446
|
+
label: e.name,
|
|
447
|
+
isCustom: !0,
|
|
448
|
+
icon: e.icon
|
|
449
|
+
}))), v = N(() => [...h.value, ..._.value]);
|
|
450
|
+
function ee(e) {
|
|
451
|
+
if (e.isCustom) {
|
|
452
|
+
let t = e.type.replace("custom:", ""), n = r.find((e) => e.type === t);
|
|
453
|
+
if (n) return rt(n);
|
|
454
|
+
}
|
|
455
|
+
return nt(e.type, a);
|
|
456
|
+
}
|
|
457
|
+
function b(e) {
|
|
458
|
+
if (!s) return;
|
|
459
|
+
let t = ee(e);
|
|
460
|
+
s.addBlock(t), s.selectBlock(t.id);
|
|
461
|
+
}
|
|
462
|
+
function x(e, t) {
|
|
463
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), b(t));
|
|
464
|
+
}
|
|
465
|
+
return (e, r) => (W(), I("aside", {
|
|
466
|
+
"aria-label": J(t).sidebarNav.palette,
|
|
467
|
+
class: "tpl-sidebar-rail tpl:absolute tpl:top-14 tpl:bottom-0 tpl:left-0 tpl:z-40 tpl:overflow-hidden",
|
|
468
|
+
style: U({
|
|
469
|
+
width: u.value ? "200px" : "48px",
|
|
470
|
+
backgroundColor: "var(--tpl-bg-elevated)",
|
|
471
|
+
borderRight: "1px solid var(--tpl-border)",
|
|
472
|
+
boxShadow: u.value ? "var(--tpl-shadow-lg)" : "none",
|
|
473
|
+
transition: "width 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
474
|
+
}),
|
|
475
|
+
onMouseenter: r[1] ||= (e) => u.value = !0,
|
|
476
|
+
onMouseleave: r[2] ||= (e) => u.value = !1,
|
|
477
|
+
onFocusin: r[3] ||= (e) => u.value = !0,
|
|
478
|
+
onFocusout: r[4] ||= (e) => u.value = !1
|
|
479
|
+
}, [l.value ? (W(), I("div", Pt, [L("button", {
|
|
480
|
+
type: "button",
|
|
481
|
+
"aria-label": J(t).sidebarNav.browseModules,
|
|
482
|
+
class: "tpl:flex tpl:h-10 tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)]",
|
|
483
|
+
style: U({ justifyContent: u.value ? "flex-start" : "center" }),
|
|
484
|
+
onClick: r[0] ||= (e) => J(c).savedModules?.openBrowser()
|
|
485
|
+
}, [
|
|
486
|
+
z(J(ve), {
|
|
487
|
+
size: 20,
|
|
488
|
+
"stroke-width": 1.5,
|
|
489
|
+
class: "tpl:shrink-0"
|
|
490
|
+
}),
|
|
491
|
+
u.value ? (W(), I("span", It, q(J(t).modules.title), 1)) : F("", !0),
|
|
492
|
+
u.value ? (W(), I("span", Lt, q(J(c).savedModules?.moduleCount.value ?? 0), 1)) : F("", !0)
|
|
493
|
+
], 12, Ft)])) : F("", !0), z(J(St.default), {
|
|
494
|
+
list: v.value,
|
|
495
|
+
group: {
|
|
496
|
+
name: "blocks",
|
|
497
|
+
pull: "clone",
|
|
498
|
+
put: !1
|
|
499
|
+
},
|
|
500
|
+
clone: ee,
|
|
501
|
+
sort: !1,
|
|
502
|
+
"item-key": "type",
|
|
503
|
+
animation: 150,
|
|
504
|
+
"ghost-class": "tpl-ghost",
|
|
505
|
+
class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:p-1"
|
|
506
|
+
}, {
|
|
507
|
+
item: Y(({ element: e }) => [L("button", {
|
|
508
|
+
type: "button",
|
|
509
|
+
"data-palette-type": e.type,
|
|
510
|
+
"aria-label": J(n)(J(t).sidebarNav.insertBlock, { block: e.label }),
|
|
511
|
+
class: "tpl:flex tpl:h-10 tpl:w-full tpl:cursor-grab tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] active:tpl:cursor-grabbing",
|
|
512
|
+
style: U({ justifyContent: u.value ? "flex-start" : "center" }),
|
|
513
|
+
onClick: (t) => b(e),
|
|
514
|
+
onKeydown: (t) => x(t, e)
|
|
515
|
+
}, [L("div", zt, [J(be)[e.type] ? (W(), P(Ke(J(be)[e.type]), {
|
|
516
|
+
key: 0,
|
|
517
|
+
size: 20,
|
|
518
|
+
"stroke-width": 1.5
|
|
519
|
+
})) : e.isCustom ? (W(), P(y, {
|
|
520
|
+
key: 1,
|
|
521
|
+
icon: e.icon,
|
|
522
|
+
size: 20
|
|
523
|
+
}, null, 8, ["icon"])) : F("", !0)]), u.value ? (W(), I("span", Bt, q(e.label), 1)) : F("", !0)], 44, Rt)]),
|
|
524
|
+
_: 1
|
|
525
|
+
}, 8, ["list"])], 44, Nt));
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/composables/useMergeTagField.ts
|
|
530
|
+
function Ht(e) {
|
|
531
|
+
let { modelValue: t, emit: n, elementRef: r } = e, { isEnabled: i, isRequesting: a, isMergeTagValue: o, getMergeTagLabel: s, requestMergeTag: c, syntax: l } = Me(), u = G(!1), d = !1, f = N(() => {
|
|
532
|
+
let e = t();
|
|
533
|
+
if (!e) return [];
|
|
534
|
+
let n = [], r = `(${l.value.source}|${l.logic.source})`, i = new RegExp(r, "g"), a = 0, c;
|
|
535
|
+
for (; (c = i.exec(e)) !== null;) {
|
|
536
|
+
c.index > a && n.push({
|
|
537
|
+
type: "text",
|
|
538
|
+
value: e.slice(a, c.index)
|
|
539
|
+
});
|
|
540
|
+
let t = c[0];
|
|
541
|
+
o(t) ? n.push({
|
|
542
|
+
type: "mergeTag",
|
|
543
|
+
value: t,
|
|
544
|
+
label: s(t)
|
|
545
|
+
}) : st(t, l) ? n.push({
|
|
546
|
+
type: "logicMergeTag",
|
|
547
|
+
value: t,
|
|
548
|
+
keyword: at(t, l)
|
|
549
|
+
}) : n.push({
|
|
550
|
+
type: "text",
|
|
551
|
+
value: t
|
|
552
|
+
}), a = c.index + t.length;
|
|
553
|
+
}
|
|
554
|
+
return a < e.length && n.push({
|
|
555
|
+
type: "text",
|
|
556
|
+
value: e.slice(a)
|
|
557
|
+
}), n;
|
|
558
|
+
}), p = N(() => f.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
|
|
559
|
+
function m() {
|
|
560
|
+
u.value = !0, Ue(() => {
|
|
561
|
+
r.value?.focus();
|
|
562
|
+
let e = t()?.length || 0;
|
|
563
|
+
r.value?.setSelectionRange(e, e);
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
function h() {
|
|
567
|
+
d || (u.value = !1);
|
|
568
|
+
}
|
|
569
|
+
function g(e) {
|
|
570
|
+
n(e.target.value);
|
|
571
|
+
}
|
|
572
|
+
function _() {
|
|
573
|
+
n("");
|
|
574
|
+
}
|
|
575
|
+
async function v() {
|
|
576
|
+
let e = u.value && r.value ? r.value.selectionStart ?? t().length : t().length;
|
|
577
|
+
d = !0;
|
|
578
|
+
let i = await c();
|
|
579
|
+
if (d = !1, i) {
|
|
580
|
+
let a = t().slice(0, e), o = t().slice(e);
|
|
581
|
+
n(a + i.value + o), u.value = !0, Ue(() => {
|
|
582
|
+
let t = e + i.value.length;
|
|
583
|
+
r.value?.focus(), r.value?.setSelectionRange(t, t);
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
return {
|
|
588
|
+
segments: f,
|
|
589
|
+
hasMergeTags: p,
|
|
590
|
+
mergeTagEnabled: i,
|
|
591
|
+
isRequestingMergeTag: a,
|
|
592
|
+
isEditing: u,
|
|
593
|
+
startEditing: m,
|
|
594
|
+
stopEditing: h,
|
|
595
|
+
handleInput: g,
|
|
596
|
+
clearValue: _,
|
|
597
|
+
insertMergeTag: v
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
//#endregion
|
|
601
|
+
//#region src/components/MergeTagSegments.vue?vue&type=script&setup=true&lang.ts
|
|
602
|
+
var Ut = ["aria-label", "onKeydown"], Wt = ["data-tooltip"], Gt = ["data-tooltip"], Kt = {
|
|
603
|
+
key: 2,
|
|
604
|
+
class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
|
|
605
|
+
}, qt = ["aria-label", "title"], Jt = /* @__PURE__ */ B({
|
|
606
|
+
__name: "MergeTagSegments",
|
|
607
|
+
props: {
|
|
608
|
+
segments: {},
|
|
609
|
+
displayClass: {},
|
|
610
|
+
pulse: { type: Boolean }
|
|
611
|
+
},
|
|
612
|
+
emits: ["edit", "clear"],
|
|
613
|
+
setup(e, { emit: t }) {
|
|
614
|
+
let n = t, { t: r } = m();
|
|
615
|
+
function i() {
|
|
616
|
+
n("edit");
|
|
617
|
+
}
|
|
618
|
+
return (t, a) => (W(), I("div", {
|
|
619
|
+
role: "button",
|
|
620
|
+
tabindex: "0",
|
|
621
|
+
"aria-label": J(r).mergeTag.clickToEdit,
|
|
622
|
+
class: H([e.displayClass, { "tpl-pulse-fill": e.pulse }]),
|
|
623
|
+
onClick: i,
|
|
624
|
+
onKeydown: [Ze(i, ["enter"]), Ze(Qe(i, ["prevent"]), ["space"])]
|
|
625
|
+
}, [(W(!0), I(M, null, K(e.segments, (e, t) => (W(), I(M, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" ? (W(), I("span", {
|
|
626
|
+
key: 0,
|
|
627
|
+
class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium",
|
|
628
|
+
"data-tooltip": e.value,
|
|
629
|
+
style: {
|
|
630
|
+
"background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
|
|
631
|
+
color: "var(--tpl-primary)"
|
|
632
|
+
}
|
|
633
|
+
}, q(e.label), 9, Wt)) : e.type === "logicMergeTag" ? (W(), I("span", {
|
|
634
|
+
key: 1,
|
|
635
|
+
class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase",
|
|
636
|
+
"data-tooltip": e.value,
|
|
637
|
+
style: {
|
|
638
|
+
"background-color": "transparent",
|
|
639
|
+
border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
|
|
640
|
+
color: "var(--tpl-primary)"
|
|
641
|
+
}
|
|
642
|
+
}, q(e.keyword), 9, Gt)) : (W(), I("span", Kt, q(e.value), 1))], 64))), 128)), L("button", {
|
|
643
|
+
type: "button",
|
|
644
|
+
class: "tpl:ml-auto tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all hover:tpl:text-[var(--tpl-danger)] hover:tpl:opacity-100",
|
|
645
|
+
"aria-label": J(r).mergeTag.remove,
|
|
646
|
+
title: J(r).mergeTag.remove,
|
|
647
|
+
onClick: a[0] ||= Qe((e) => n("clear"), ["stop"])
|
|
648
|
+
}, [z(J(je), {
|
|
649
|
+
size: 12,
|
|
650
|
+
"stroke-width": 2.5
|
|
651
|
+
})], 8, qt)], 42, Ut));
|
|
652
|
+
}
|
|
653
|
+
}), Yt = [
|
|
654
|
+
"aria-label",
|
|
655
|
+
"title",
|
|
656
|
+
"disabled"
|
|
657
|
+
], Xt = "tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] hover:tpl:border-[var(--tpl-primary)]", Zt = /* @__PURE__ */ B({
|
|
658
|
+
__name: "MergeTagInsertButton",
|
|
659
|
+
props: { disabled: { type: Boolean } },
|
|
660
|
+
emits: ["insert"],
|
|
661
|
+
setup(e) {
|
|
662
|
+
let { t } = m();
|
|
663
|
+
return (n, r) => (W(), I("button", {
|
|
664
|
+
type: "button",
|
|
665
|
+
class: H([Xt, "tpl:mt-1.5"]),
|
|
666
|
+
"aria-label": J(t).mergeTag.insert,
|
|
667
|
+
title: J(t).mergeTag.insert,
|
|
668
|
+
disabled: e.disabled,
|
|
669
|
+
onClick: r[0] ||= (e) => n.$emit("insert")
|
|
670
|
+
}, [z(J(Te), {
|
|
671
|
+
size: 12,
|
|
672
|
+
"stroke-width": 2
|
|
673
|
+
}), R(" " + q(J(t).mergeTag.insert), 1)], 10, Yt));
|
|
674
|
+
}
|
|
675
|
+
}), Qt = { key: 0 }, $t = { key: 1 }, en = [
|
|
676
|
+
"value",
|
|
677
|
+
"placeholder",
|
|
678
|
+
"rows"
|
|
679
|
+
], tn = "tpl:w-full tpl:resize-y tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)]", nn = "tpl:flex tpl:w-full tpl:min-h-[5rem] tpl:cursor-pointer tpl:items-start tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", rn = /* @__PURE__ */ B({
|
|
680
|
+
__name: "MergeTagTextarea",
|
|
681
|
+
props: {
|
|
682
|
+
modelValue: {},
|
|
683
|
+
placeholder: { default: "" },
|
|
684
|
+
rows: { default: 3 }
|
|
685
|
+
},
|
|
686
|
+
emits: ["update:modelValue"],
|
|
687
|
+
setup(e, { emit: t }) {
|
|
688
|
+
let n = e, r = t, i = G(null), { segments: a, hasMergeTags: o, mergeTagEnabled: s, isRequestingMergeTag: c, isEditing: l, startEditing: u, stopEditing: d, handleInput: f, clearValue: p, insertMergeTag: m } = Ht({
|
|
689
|
+
modelValue: () => n.modelValue,
|
|
690
|
+
emit: (e) => r("update:modelValue", e),
|
|
691
|
+
elementRef: i
|
|
692
|
+
});
|
|
693
|
+
return (t, n) => J(o) && !J(l) ? (W(), I("div", Qt, [z(Jt, {
|
|
694
|
+
segments: J(a),
|
|
695
|
+
"display-class": nn,
|
|
696
|
+
onEdit: J(u),
|
|
697
|
+
onClear: J(p)
|
|
698
|
+
}, null, 8, [
|
|
699
|
+
"segments",
|
|
700
|
+
"onEdit",
|
|
701
|
+
"onClear"
|
|
702
|
+
]), J(s) ? (W(), P(Zt, {
|
|
703
|
+
key: 0,
|
|
704
|
+
disabled: J(c),
|
|
705
|
+
onInsert: J(m)
|
|
706
|
+
}, null, 8, ["disabled", "onInsert"])) : F("", !0)])) : (W(), I("div", $t, [L("textarea", {
|
|
707
|
+
ref_key: "textareaRef",
|
|
708
|
+
ref: i,
|
|
709
|
+
class: H(tn),
|
|
710
|
+
value: e.modelValue,
|
|
711
|
+
placeholder: e.placeholder,
|
|
712
|
+
rows: e.rows,
|
|
713
|
+
onInput: n[0] ||= (...e) => J(f) && J(f)(...e),
|
|
714
|
+
onBlur: n[1] ||= (...e) => J(d) && J(d)(...e),
|
|
715
|
+
onKeydown: n[2] ||= Ze((...e) => J(d) && J(d)(...e), ["escape"])
|
|
716
|
+
}, null, 40, en), J(s) ? (W(), P(Zt, {
|
|
717
|
+
key: 0,
|
|
718
|
+
disabled: J(c),
|
|
719
|
+
onInsert: J(m)
|
|
720
|
+
}, null, 8, ["disabled", "onInsert"])) : F("", !0)]));
|
|
721
|
+
}
|
|
722
|
+
}), an = { class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]" }, on = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:gap-3 tpl:overflow-y-auto tpl:p-4" }, sn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, cn = { class: "tpl:mb-3.5" }, ln = { class: "tpl:grid tpl:grid-cols-4 tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-hover)]" }, un = ["onClick"], dn = { class: "tpl:flex tpl:items-stretch" }, fn = ["value"], pn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, mn = { class: "tpl:mb-3.5" }, hn = ["value"], gn = ["value"], _n = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, vn = { class: "tpl:mt-1 tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, yn = { class: "tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, bn = { class: "tpl:shrink-0 tpl:text-xs tpl:tabular-nums tpl:text-[var(--tpl-text-dim)]" }, xn = { class: "tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3" }, Sn = { class: "tpl:mb-2.5 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text-muted)]" }, Cn = { class: "tpl:m-0 tpl:pl-[18px] tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, wn = { class: "tpl:mb-1 tpl:last:mb-0" }, Tn = { class: "tpl:mb-1 tpl:last:mb-0" }, En = { class: "tpl:mb-1 tpl:last:mb-0" }, Dn = 150, On = /* @__PURE__ */ B({
|
|
723
|
+
__name: "TemplateSettings",
|
|
724
|
+
props: { settings: {} },
|
|
725
|
+
emits: ["update"],
|
|
726
|
+
setup(e, { emit: t }) {
|
|
727
|
+
let r = e, i = t, { t: a } = m(), o = n(u, "TemplateSettings"), s = N(() => o.fonts.value), c = N(() => s.value.some((e) => e.value === r.settings.fontFamily) ? r.settings.fontFamily : o.defaultFont.value), l = [
|
|
728
|
+
{
|
|
729
|
+
value: 480,
|
|
730
|
+
label: "480px"
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
value: 600,
|
|
734
|
+
label: "600px"
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
value: 700,
|
|
738
|
+
label: "700px"
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
value: 800,
|
|
742
|
+
label: "800px"
|
|
743
|
+
}
|
|
744
|
+
];
|
|
745
|
+
return (t, n) => (W(), I("aside", an, [L("div", on, [
|
|
746
|
+
L("div", { class: H(J(Re)) }, [
|
|
747
|
+
L("div", sn, [z(J(yt), {
|
|
748
|
+
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
749
|
+
size: 14,
|
|
750
|
+
"stroke-width": 2
|
|
751
|
+
}), L("span", null, q(J(a).templateSettings.layout), 1)]),
|
|
752
|
+
L("div", cn, [L("label", { class: H(J(E)) }, q(J(a).templateSettings.widthPreset), 3), L("div", ln, [(W(), I(M, null, K(l, (t) => L("button", {
|
|
753
|
+
key: t.value,
|
|
754
|
+
class: "tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
755
|
+
style: U({
|
|
756
|
+
backgroundColor: e.settings.width === t.value ? "var(--tpl-bg)" : "transparent",
|
|
757
|
+
color: e.settings.width === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
758
|
+
boxShadow: e.settings.width === t.value ? "var(--tpl-shadow)" : "none"
|
|
759
|
+
}),
|
|
760
|
+
onClick: (e) => i("update", { width: t.value })
|
|
761
|
+
}, q(t.label), 13, un)), 64))])]),
|
|
762
|
+
L("div", null, [L("label", { class: H(J(E)) }, q(J(a).templateSettings.customWidth), 3), L("div", dn, [L("input", {
|
|
763
|
+
type: "number",
|
|
764
|
+
class: H(J(O)),
|
|
765
|
+
value: e.settings.width,
|
|
766
|
+
min: "300",
|
|
767
|
+
max: "900",
|
|
768
|
+
onInput: n[0] ||= (e) => i("update", { width: Number(e.target.value) })
|
|
769
|
+
}, null, 42, fn), L("span", { class: H(J(D)) }, "px", 2)])])
|
|
770
|
+
], 2),
|
|
771
|
+
L("div", { class: H(J(Re)) }, [
|
|
772
|
+
L("div", pn, [z(J(ct), {
|
|
773
|
+
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
774
|
+
size: 14,
|
|
775
|
+
"stroke-width": 2
|
|
776
|
+
}), L("span", null, q(J(a).templateSettings.appearance), 1)]),
|
|
777
|
+
L("div", mn, [L("label", { class: H(J(E)) }, q(J(a).templateSettings.backgroundColor), 3), z(k, {
|
|
778
|
+
"model-value": e.settings.backgroundColor,
|
|
779
|
+
placeholder: J(ze),
|
|
780
|
+
"onUpdate:modelValue": n[1] ||= (e) => i("update", { backgroundColor: e })
|
|
781
|
+
}, null, 8, ["model-value", "placeholder"])]),
|
|
782
|
+
L("div", null, [L("label", { class: H(J(E)) }, q(J(a).templateSettings.fontFamily), 3), L("select", {
|
|
783
|
+
class: H(J(T)),
|
|
784
|
+
value: c.value,
|
|
785
|
+
onChange: n[2] ||= (e) => i("update", { fontFamily: e.target.value })
|
|
786
|
+
}, [(W(!0), I(M, null, K(s.value, (e) => (W(), I("option", {
|
|
787
|
+
key: e.value,
|
|
788
|
+
value: e.value
|
|
789
|
+
}, q(e.label), 9, gn))), 128))], 42, hn)])
|
|
790
|
+
], 2),
|
|
791
|
+
L("div", { class: H(J(Re)) }, [L("div", _n, [z(J(Se), {
|
|
792
|
+
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
793
|
+
size: 14,
|
|
794
|
+
"stroke-width": 2
|
|
795
|
+
}), L("span", null, q(J(a).templateSettings.preheaderText), 1)]), L("div", null, [z(rn, {
|
|
796
|
+
"model-value": e.settings.preheaderText ?? "",
|
|
797
|
+
placeholder: J(a).templateSettings.preheaderTextPlaceholder,
|
|
798
|
+
rows: 2,
|
|
799
|
+
"onUpdate:modelValue": n[3] ||= (e) => i("update", { preheaderText: e.replace(/[\r\n]/g, " ") || void 0 })
|
|
800
|
+
}, null, 8, ["model-value", "placeholder"]), L("div", vn, [L("span", yn, q(J(a).templateSettings.preheaderTextHint), 1), L("span", bn, q((e.settings.preheaderText ?? "").length) + "/" + q(Dn), 1)])])], 2),
|
|
801
|
+
L("div", xn, [L("div", Sn, [z(J(xe), {
|
|
802
|
+
size: 14,
|
|
803
|
+
"stroke-width": 2
|
|
804
|
+
}), L("span", null, q(J(a).templateSettings.tips), 1)]), L("ul", Cn, [
|
|
805
|
+
L("li", wn, q(J(a).templateSettings.tip1), 1),
|
|
806
|
+
L("li", Tn, q(J(a).templateSettings.tip2), 1),
|
|
807
|
+
L("li", En, q(J(a).templateSettings.tip3), 1)
|
|
808
|
+
])])
|
|
809
|
+
])]));
|
|
810
|
+
}
|
|
811
|
+
}), kn = { key: 0 }, An = { key: 1 }, jn = [
|
|
812
|
+
"type",
|
|
813
|
+
"value",
|
|
814
|
+
"placeholder"
|
|
815
|
+
], Mn = "tpl:flex tpl:w-full tpl:min-h-10 tpl:cursor-pointer tpl:items-center tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3.5 tpl:py-1.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", Z = /* @__PURE__ */ w(/* @__PURE__ */ B({
|
|
816
|
+
__name: "MergeTagInput",
|
|
817
|
+
props: {
|
|
818
|
+
modelValue: {},
|
|
819
|
+
type: { default: "text" },
|
|
820
|
+
placeholder: { default: "" },
|
|
821
|
+
pulse: {
|
|
822
|
+
type: Boolean,
|
|
823
|
+
default: !1
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
emits: ["update:modelValue"],
|
|
827
|
+
setup(e, { emit: t }) {
|
|
828
|
+
let n = e, r = t, i = G(null), { segments: a, hasMergeTags: o, mergeTagEnabled: s, isRequestingMergeTag: c, isEditing: l, startEditing: u, stopEditing: d, handleInput: f, clearValue: p, insertMergeTag: m } = Ht({
|
|
829
|
+
modelValue: () => n.modelValue,
|
|
830
|
+
emit: (e) => r("update:modelValue", e),
|
|
831
|
+
elementRef: i
|
|
832
|
+
});
|
|
833
|
+
return (t, n) => J(o) && !J(l) ? (W(), I("div", kn, [z(Jt, {
|
|
834
|
+
segments: J(a),
|
|
835
|
+
"display-class": Mn,
|
|
836
|
+
pulse: e.pulse,
|
|
837
|
+
onEdit: J(u),
|
|
838
|
+
onClear: J(p)
|
|
839
|
+
}, null, 8, [
|
|
840
|
+
"segments",
|
|
841
|
+
"pulse",
|
|
842
|
+
"onEdit",
|
|
843
|
+
"onClear"
|
|
844
|
+
]), J(s) ? (W(), P(Zt, {
|
|
845
|
+
key: 0,
|
|
846
|
+
disabled: J(c),
|
|
847
|
+
onInsert: J(m)
|
|
848
|
+
}, null, 8, ["disabled", "onInsert"])) : F("", !0)])) : (W(), I("div", An, [L("input", {
|
|
849
|
+
ref_key: "inputRef",
|
|
850
|
+
ref: i,
|
|
851
|
+
type: e.type,
|
|
852
|
+
class: H([J(T), { "tpl-pulse-fill": e.pulse }]),
|
|
853
|
+
value: e.modelValue,
|
|
854
|
+
placeholder: e.placeholder,
|
|
855
|
+
onInput: n[0] ||= (...e) => J(f) && J(f)(...e),
|
|
856
|
+
onBlur: n[1] ||= (...e) => J(d) && J(d)(...e),
|
|
857
|
+
onKeydown: n[2] ||= Ze((...e) => J(d) && J(d)(...e), ["escape"])
|
|
858
|
+
}, null, 42, jn), J(s) ? (W(), P(Zt, {
|
|
859
|
+
key: 0,
|
|
860
|
+
disabled: J(c),
|
|
861
|
+
onInsert: J(m)
|
|
862
|
+
}, null, 8, ["disabled", "onInsert"])) : F("", !0)]));
|
|
863
|
+
}
|
|
864
|
+
}), [["__scopeId", "data-v-b982cc87"]]), Nn = { class: "tpl:mb-3.5" }, Pn = ["value"], Fn = { value: "" }, In = ["value"], Ln = { class: "tpl:mb-3.5" }, Rn = { class: "tpl:mb-3.5" }, zn = {
|
|
865
|
+
key: 0,
|
|
866
|
+
class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
|
|
867
|
+
}, Bn = ["checked"], Vn = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, Hn = { class: "tpl:mb-3.5" }, Un = { class: "tpl:mb-3.5" }, Wn = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, Gn = { class: "tpl:mb-3.5" }, Kn = { class: "tpl:flex tpl:items-stretch" }, qn = ["value"], Jn = { class: "tpl:mb-3.5" }, Yn = { class: "tpl:flex tpl:items-stretch" }, Xn = ["value"], Zn = /* @__PURE__ */ B({
|
|
868
|
+
__name: "ButtonToolbar",
|
|
869
|
+
props: {
|
|
870
|
+
block: {},
|
|
871
|
+
fontFamilies: {}
|
|
872
|
+
},
|
|
873
|
+
emits: ["update"],
|
|
874
|
+
setup(e, { emit: t }) {
|
|
875
|
+
let n = t, { t: r } = m();
|
|
876
|
+
function i(e, t) {
|
|
877
|
+
n("update", { [e]: t });
|
|
878
|
+
}
|
|
879
|
+
return (t, n) => (W(), I(M, null, [
|
|
880
|
+
L("div", Nn, [L("label", { class: H(J(E)) }, q(J(r).button.fontFamily), 3), L("select", {
|
|
881
|
+
class: H(J(T)),
|
|
882
|
+
value: e.block.fontFamily || "",
|
|
883
|
+
onChange: n[0] ||= (e) => i("fontFamily", e.target.value || void 0)
|
|
884
|
+
}, [L("option", Fn, q(J(r).button.inheritFont), 1), (W(!0), I(M, null, K(e.fontFamilies, (e) => (W(), I("option", {
|
|
885
|
+
key: e.value,
|
|
886
|
+
value: e.value
|
|
887
|
+
}, q(e.label), 9, In))), 128))], 42, Pn)]),
|
|
888
|
+
L("div", Ln, [L("label", { class: H(J(E)) }, q(J(r).button.text), 3), z(Z, {
|
|
889
|
+
"model-value": e.block.text,
|
|
890
|
+
type: "text",
|
|
891
|
+
"onUpdate:modelValue": n[1] ||= (e) => i("text", e)
|
|
892
|
+
}, null, 8, ["model-value"])]),
|
|
893
|
+
L("div", Rn, [
|
|
894
|
+
L("label", { class: H(J(E)) }, q(J(r).button.url), 3),
|
|
895
|
+
z(Z, {
|
|
896
|
+
"model-value": e.block.url,
|
|
897
|
+
type: "url",
|
|
898
|
+
placeholder: J(r).button.urlPlaceholder,
|
|
899
|
+
"onUpdate:modelValue": n[2] ||= (e) => i("url", e)
|
|
900
|
+
}, null, 8, ["model-value", "placeholder"]),
|
|
901
|
+
e.block.url ? (W(), I("label", zn, [L("input", {
|
|
902
|
+
type: "checkbox",
|
|
903
|
+
class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
|
|
904
|
+
checked: e.block.openInNewTab ?? !1,
|
|
905
|
+
onChange: n[3] ||= (e) => i("openInNewTab", e.target.checked)
|
|
906
|
+
}, null, 40, Bn), R(" " + q(J(r).button.openInNewTab), 1)])) : F("", !0)
|
|
907
|
+
]),
|
|
908
|
+
L("div", Vn, [L("div", Hn, [L("label", { class: H(J(E)) }, q(J(r).button.background), 3), z(k, {
|
|
909
|
+
"model-value": e.block.backgroundColor,
|
|
910
|
+
"onUpdate:modelValue": n[4] ||= (e) => i("backgroundColor", e)
|
|
911
|
+
}, null, 8, ["model-value"])]), L("div", Un, [L("label", { class: H(J(E)) }, q(J(r).button.textColor), 3), z(k, {
|
|
912
|
+
"model-value": e.block.textColor,
|
|
913
|
+
"onUpdate:modelValue": n[5] ||= (e) => i("textColor", e)
|
|
914
|
+
}, null, 8, ["model-value"])])]),
|
|
915
|
+
L("div", Wn, [L("div", Gn, [L("label", { class: H(J(E)) }, q(J(r).button.borderRadius), 3), L("div", Kn, [L("input", {
|
|
916
|
+
type: "number",
|
|
917
|
+
class: H(J(O)),
|
|
918
|
+
value: e.block.borderRadius,
|
|
919
|
+
min: "0",
|
|
920
|
+
max: "50",
|
|
921
|
+
onInput: n[6] ||= (e) => i("borderRadius", Number(e.target.value))
|
|
922
|
+
}, null, 42, qn), L("span", { class: H(J(D)) }, "px", 2)])]), L("div", Jn, [L("label", { class: H(J(E)) }, q(J(r).button.fontSize), 3), L("div", Yn, [L("input", {
|
|
923
|
+
type: "number",
|
|
924
|
+
class: H(J(O)),
|
|
925
|
+
value: e.block.fontSize,
|
|
926
|
+
min: "10",
|
|
927
|
+
max: "36",
|
|
928
|
+
onInput: n[7] ||= (e) => i("fontSize", Number(e.target.value))
|
|
929
|
+
}, null, 42, Xn), L("span", { class: H(J(D)) }, "px", 2)])])])
|
|
930
|
+
], 64));
|
|
931
|
+
}
|
|
932
|
+
}), Qn = { class: "spacing-control" }, $n = { class: "tpl:mb-2 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, er = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5" }, tr = { class: "tpl:flex tpl:items-center" }, nr = ["aria-label"], rr = ["value", "aria-label"], ir = ["aria-label"], ar = { class: "tpl:flex tpl:items-center tpl:gap-2" }, or = { class: "tpl:flex tpl:items-center" }, sr = ["aria-label"], cr = ["value", "aria-label"], lr = ["aria-label"], ur = ["aria-label", "title"], dr = { class: "tpl:flex tpl:items-center" }, fr = ["aria-label"], pr = ["value", "aria-label"], mr = ["aria-label"], hr = { class: "tpl:flex tpl:items-center" }, gr = ["aria-label"], _r = ["value", "aria-label"], vr = ["aria-label"], Q = "tpl:flex tpl:items-center tpl:justify-center tpl:w-8 tpl:h-8 tpl:text-[var(--tpl-text-muted)] tpl:bg-[var(--tpl-bg)] tpl:border tpl:border-[var(--tpl-border)] tpl:cursor-pointer tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)] active:tpl:bg-[var(--tpl-bg-active)]", yr = "tpl:w-10 tpl:h-8 tpl:text-center tpl:text-xs tpl:font-medium tpl:border-y tpl:border-x-0 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]", br = /* @__PURE__ */ w(/* @__PURE__ */ B({
|
|
933
|
+
__name: "SpacingControl",
|
|
934
|
+
props: {
|
|
935
|
+
modelValue: {},
|
|
936
|
+
label: {}
|
|
937
|
+
},
|
|
938
|
+
emits: ["update:modelValue"],
|
|
939
|
+
setup(e, { emit: t }) {
|
|
940
|
+
let n = e, r = t, { t: i } = m(), a = N(() => n.modelValue.top === n.modelValue.right && n.modelValue.right === n.modelValue.bottom && n.modelValue.bottom === n.modelValue.left), o = G(a.value);
|
|
941
|
+
Ye(a, (e) => {
|
|
942
|
+
!e && o.value && (o.value = !1);
|
|
943
|
+
});
|
|
944
|
+
function s(e, t) {
|
|
945
|
+
let i = n.modelValue[e], a = Math.max(0, i + t);
|
|
946
|
+
o.value ? r("update:modelValue", {
|
|
947
|
+
top: a,
|
|
948
|
+
right: a,
|
|
949
|
+
bottom: a,
|
|
950
|
+
left: a
|
|
951
|
+
}) : r("update:modelValue", {
|
|
952
|
+
...n.modelValue,
|
|
953
|
+
[e]: a
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
function c(e, t) {
|
|
957
|
+
let i = Math.max(0, t);
|
|
958
|
+
o.value ? r("update:modelValue", {
|
|
959
|
+
top: i,
|
|
960
|
+
right: i,
|
|
961
|
+
bottom: i,
|
|
962
|
+
left: i
|
|
963
|
+
}) : r("update:modelValue", {
|
|
964
|
+
...n.modelValue,
|
|
965
|
+
[e]: i
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
function l() {
|
|
969
|
+
if (o.value = !o.value, o.value) {
|
|
970
|
+
let e = n.modelValue.top;
|
|
971
|
+
r("update:modelValue", {
|
|
972
|
+
top: e,
|
|
973
|
+
right: e,
|
|
974
|
+
bottom: e,
|
|
975
|
+
left: e
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
return (t, n) => (W(), I("div", Qn, [L("label", $n, q(e.label), 1), L("div", er, [
|
|
980
|
+
L("div", tr, [
|
|
981
|
+
L("button", {
|
|
982
|
+
"aria-label": J(i).spacingControl.decreaseTop,
|
|
983
|
+
class: H([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
984
|
+
onClick: n[0] ||= (e) => s("top", -1)
|
|
985
|
+
}, [z(J(ye), {
|
|
986
|
+
size: 12,
|
|
987
|
+
"stroke-width": 2
|
|
988
|
+
})], 10, nr),
|
|
989
|
+
L("input", {
|
|
990
|
+
type: "number",
|
|
991
|
+
class: H(yr),
|
|
992
|
+
value: e.modelValue.top,
|
|
993
|
+
"aria-label": J(i).spacingControl.top,
|
|
994
|
+
min: "0",
|
|
995
|
+
onInput: n[1] ||= (e) => c("top", Number(e.target.value))
|
|
996
|
+
}, null, 40, rr),
|
|
997
|
+
L("button", {
|
|
998
|
+
"aria-label": J(i).spacingControl.increaseTop,
|
|
999
|
+
class: H([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1000
|
+
onClick: n[2] ||= (e) => s("top", 1)
|
|
1001
|
+
}, [z(J(X), {
|
|
1002
|
+
size: 12,
|
|
1003
|
+
"stroke-width": 2
|
|
1004
|
+
})], 10, ir)
|
|
1005
|
+
]),
|
|
1006
|
+
L("div", ar, [
|
|
1007
|
+
L("div", or, [
|
|
1008
|
+
L("button", {
|
|
1009
|
+
"aria-label": J(i).spacingControl.decreaseLeft,
|
|
1010
|
+
class: H([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1011
|
+
onClick: n[3] ||= (e) => s("left", -1)
|
|
1012
|
+
}, [z(J(ye), {
|
|
1013
|
+
size: 12,
|
|
1014
|
+
"stroke-width": 2
|
|
1015
|
+
})], 10, sr),
|
|
1016
|
+
L("input", {
|
|
1017
|
+
type: "number",
|
|
1018
|
+
class: H(yr),
|
|
1019
|
+
value: e.modelValue.left,
|
|
1020
|
+
"aria-label": J(i).spacingControl.left,
|
|
1021
|
+
min: "0",
|
|
1022
|
+
onInput: n[4] ||= (e) => c("left", Number(e.target.value))
|
|
1023
|
+
}, null, 40, cr),
|
|
1024
|
+
L("button", {
|
|
1025
|
+
"aria-label": J(i).spacingControl.increaseLeft,
|
|
1026
|
+
class: H([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1027
|
+
onClick: n[5] ||= (e) => s("left", 1)
|
|
1028
|
+
}, [z(J(X), {
|
|
1029
|
+
size: 12,
|
|
1030
|
+
"stroke-width": 2
|
|
1031
|
+
})], 10, lr)
|
|
1032
|
+
]),
|
|
1033
|
+
L("button", {
|
|
1034
|
+
class: H(["tpl:flex tpl:h-8 tpl:w-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", o.value ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] hover:tpl:bg-[var(--tpl-bg-hover)]"]),
|
|
1035
|
+
"aria-label": o.value ? J(i).spacingControl.unlock : J(i).spacingControl.lockAll,
|
|
1036
|
+
title: o.value ? J(i).spacingControl.unlock : J(i).spacingControl.lockAll,
|
|
1037
|
+
onClick: l
|
|
1038
|
+
}, [o.value ? (W(), P(J(dt), {
|
|
1039
|
+
key: 0,
|
|
1040
|
+
size: 14,
|
|
1041
|
+
"stroke-width": 2
|
|
1042
|
+
})) : (W(), P(J(ut), {
|
|
1043
|
+
key: 1,
|
|
1044
|
+
size: 14,
|
|
1045
|
+
"stroke-width": 2
|
|
1046
|
+
}))], 10, ur),
|
|
1047
|
+
L("div", dr, [
|
|
1048
|
+
L("button", {
|
|
1049
|
+
"aria-label": J(i).spacingControl.decreaseRight,
|
|
1050
|
+
class: H([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1051
|
+
onClick: n[6] ||= (e) => s("right", -1)
|
|
1052
|
+
}, [z(J(ye), {
|
|
1053
|
+
size: 12,
|
|
1054
|
+
"stroke-width": 2
|
|
1055
|
+
})], 10, fr),
|
|
1056
|
+
L("input", {
|
|
1057
|
+
type: "number",
|
|
1058
|
+
class: H(yr),
|
|
1059
|
+
value: e.modelValue.right,
|
|
1060
|
+
"aria-label": J(i).spacingControl.right,
|
|
1061
|
+
min: "0",
|
|
1062
|
+
onInput: n[7] ||= (e) => c("right", Number(e.target.value))
|
|
1063
|
+
}, null, 40, pr),
|
|
1064
|
+
L("button", {
|
|
1065
|
+
"aria-label": J(i).spacingControl.increaseRight,
|
|
1066
|
+
class: H([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1067
|
+
onClick: n[8] ||= (e) => s("right", 1)
|
|
1068
|
+
}, [z(J(X), {
|
|
1069
|
+
size: 12,
|
|
1070
|
+
"stroke-width": 2
|
|
1071
|
+
})], 10, mr)
|
|
1072
|
+
])
|
|
1073
|
+
]),
|
|
1074
|
+
L("div", hr, [
|
|
1075
|
+
L("button", {
|
|
1076
|
+
"aria-label": J(i).spacingControl.decreaseBottom,
|
|
1077
|
+
class: H([Q, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1078
|
+
onClick: n[9] ||= (e) => s("bottom", -1)
|
|
1079
|
+
}, [z(J(ye), {
|
|
1080
|
+
size: 12,
|
|
1081
|
+
"stroke-width": 2
|
|
1082
|
+
})], 10, gr),
|
|
1083
|
+
L("input", {
|
|
1084
|
+
type: "number",
|
|
1085
|
+
class: H(yr),
|
|
1086
|
+
value: e.modelValue.bottom,
|
|
1087
|
+
"aria-label": J(i).spacingControl.bottom,
|
|
1088
|
+
min: "0",
|
|
1089
|
+
onInput: n[10] ||= (e) => c("bottom", Number(e.target.value))
|
|
1090
|
+
}, null, 40, _r),
|
|
1091
|
+
L("button", {
|
|
1092
|
+
"aria-label": J(i).spacingControl.increaseBottom,
|
|
1093
|
+
class: H([Q, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1094
|
+
onClick: n[11] ||= (e) => s("bottom", 1)
|
|
1095
|
+
}, [z(J(X), {
|
|
1096
|
+
size: 12,
|
|
1097
|
+
"stroke-width": 2
|
|
1098
|
+
})], 10, vr)
|
|
1099
|
+
])
|
|
1100
|
+
])]));
|
|
1101
|
+
}
|
|
1102
|
+
}), [["__scopeId", "data-v-9a9c8a07"]]), xr = { class: "tpl:mt-3" }, Sr = /* @__PURE__ */ B({
|
|
1103
|
+
__name: "CollapsibleSection",
|
|
1104
|
+
props: {
|
|
1105
|
+
title: {},
|
|
1106
|
+
open: { type: Boolean },
|
|
1107
|
+
noBorder: { type: Boolean }
|
|
1108
|
+
},
|
|
1109
|
+
emits: ["toggle"],
|
|
1110
|
+
setup(e) {
|
|
1111
|
+
return (t, n) => (W(), I("div", { class: H(["tpl:py-3", e.noBorder ? "" : "tpl:border-t tpl:border-[var(--tpl-border)]"]) }, [L("button", {
|
|
1112
|
+
type: "button",
|
|
1113
|
+
class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
|
|
1114
|
+
onClick: n[0] ||= (e) => t.$emit("toggle")
|
|
1115
|
+
}, [z(J(ge), {
|
|
1116
|
+
class: H(["tpl:transition-transform tpl:duration-200", e.open ? "tpl:rotate-0" : "tpl:-rotate-90"]),
|
|
1117
|
+
size: 12,
|
|
1118
|
+
"stroke-width": 2
|
|
1119
|
+
}, null, 8, ["class"]), L("span", null, q(e.title), 1)]), Xe(L("div", xr, [Ge(t.$slots, "default")], 512), [[Je, e.open]])], 2));
|
|
1120
|
+
}
|
|
1121
|
+
}), Cr = { class: "tpl:mt-4" }, wr = { class: "tpl:space-y-2" }, Tr = ["checked", "onChange"], Er = ["value", "placeholder"], Dr = { class: "tpl:space-y-2" }, Or = ["value"], kr = { value: "" }, Ar = ["label"], jr = ["value"], Mr = ["value"], Nr = {
|
|
1122
|
+
key: 0,
|
|
1123
|
+
value: "__custom__"
|
|
1124
|
+
}, Pr = {
|
|
1125
|
+
key: 0,
|
|
1126
|
+
class: "tpl:space-y-2"
|
|
1127
|
+
}, Fr = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Ir = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Lr = { class: "tpl:flex tpl:justify-end" }, Rr = ["disabled"], zr = {
|
|
1128
|
+
key: 0,
|
|
1129
|
+
class: "tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]"
|
|
1130
|
+
}, Br = { class: "tpl:space-y-1" }, Vr = { class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]" }, Hr = {
|
|
1131
|
+
key: 0,
|
|
1132
|
+
class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]"
|
|
1133
|
+
}, Ur = /* @__PURE__ */ B({
|
|
1134
|
+
__name: "CommonBlockSettings",
|
|
1135
|
+
props: {
|
|
1136
|
+
block: {},
|
|
1137
|
+
isFirstSection: { type: Boolean }
|
|
1138
|
+
},
|
|
1139
|
+
emits: ["update"],
|
|
1140
|
+
setup(e, { emit: t }) {
|
|
1141
|
+
let n = e, r = t, { t: i } = m(), o = V(a, []), s = V(c, !1), l = We(/* @__PURE__ */ new Set()), u = G(!1), d = G(""), f = G(""), p = [
|
|
1142
|
+
{
|
|
1143
|
+
key: "desktop",
|
|
1144
|
+
icon: ft,
|
|
1145
|
+
labelKey: "showOnDesktop"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
key: "tablet",
|
|
1149
|
+
icon: xt,
|
|
1150
|
+
labelKey: "showOnTablet"
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
key: "mobile",
|
|
1154
|
+
icon: _t,
|
|
1155
|
+
labelKey: "showOnMobile"
|
|
1156
|
+
}
|
|
1157
|
+
];
|
|
1158
|
+
function h(e) {
|
|
1159
|
+
l.has(e) ? l.delete(e) : l.add(e);
|
|
1160
|
+
}
|
|
1161
|
+
let g = N(() => o.length > 0 || s), _ = N(() => n.block.displayCondition ? !o.some((e) => e.label === n.block.displayCondition?.label) : !1);
|
|
1162
|
+
function v() {
|
|
1163
|
+
u.value = !0, _.value && n.block.displayCondition ? (d.value = n.block.displayCondition.before, f.value = n.block.displayCondition.after ?? "") : (d.value = "", f.value = "");
|
|
1164
|
+
}
|
|
1165
|
+
function y() {
|
|
1166
|
+
d.value.trim() && (r("update", { displayCondition: {
|
|
1167
|
+
label: i.blockSettings.customCondition,
|
|
1168
|
+
before: d.value.trim(),
|
|
1169
|
+
after: f.value.trim()
|
|
1170
|
+
} }), u.value = !1, d.value = "", f.value = "");
|
|
1171
|
+
}
|
|
1172
|
+
Ye(() => n.block.displayCondition, (e) => {
|
|
1173
|
+
if (!e) {
|
|
1174
|
+
u.value = !1, d.value = "", f.value = "";
|
|
1175
|
+
return;
|
|
1176
|
+
}
|
|
1177
|
+
_.value && (d.value = e.before, f.value = e.after ?? "");
|
|
1178
|
+
}, { immediate: !0 });
|
|
1179
|
+
let ee = N(() => {
|
|
1180
|
+
let e = {};
|
|
1181
|
+
for (let t of o) {
|
|
1182
|
+
let n = t.group ?? "";
|
|
1183
|
+
e[n] || (e[n] = []), e[n].push(t);
|
|
1184
|
+
}
|
|
1185
|
+
return e;
|
|
1186
|
+
});
|
|
1187
|
+
function b(e, t) {
|
|
1188
|
+
r("update", { styles: {
|
|
1189
|
+
...n.block.styles,
|
|
1190
|
+
[e]: t
|
|
1191
|
+
} });
|
|
1192
|
+
}
|
|
1193
|
+
function x(e) {
|
|
1194
|
+
return n.block.visibility?.[e] !== !1;
|
|
1195
|
+
}
|
|
1196
|
+
function te(e) {
|
|
1197
|
+
let t = {
|
|
1198
|
+
desktop: x("desktop"),
|
|
1199
|
+
tablet: x("tablet"),
|
|
1200
|
+
mobile: x("mobile")
|
|
1201
|
+
};
|
|
1202
|
+
t[e] = !t[e], r("update", { visibility: t });
|
|
1203
|
+
}
|
|
1204
|
+
return (t, n) => (W(), I("div", { class: H(["tpl:flex tpl:flex-col", e.isFirstSection ? "" : "tpl:mt-4"]) }, [
|
|
1205
|
+
z(Sr, {
|
|
1206
|
+
title: J(i).blockSettings.spacing,
|
|
1207
|
+
open: l.has("spacing"),
|
|
1208
|
+
"no-border": e.isFirstSection,
|
|
1209
|
+
onToggle: n[2] ||= (e) => h("spacing")
|
|
1210
|
+
}, {
|
|
1211
|
+
default: Y(() => [z(br, {
|
|
1212
|
+
label: J(i).blockSettings.padding,
|
|
1213
|
+
"model-value": e.block.styles.padding,
|
|
1214
|
+
"onUpdate:modelValue": n[0] ||= (e) => b("padding", e)
|
|
1215
|
+
}, null, 8, ["label", "model-value"]), L("div", Cr, [z(br, {
|
|
1216
|
+
label: J(i).blockSettings.margin,
|
|
1217
|
+
"model-value": e.block.styles.margin,
|
|
1218
|
+
"onUpdate:modelValue": n[1] ||= (e) => b("margin", e)
|
|
1219
|
+
}, null, 8, ["label", "model-value"])])]),
|
|
1220
|
+
_: 1
|
|
1221
|
+
}, 8, [
|
|
1222
|
+
"title",
|
|
1223
|
+
"open",
|
|
1224
|
+
"no-border"
|
|
1225
|
+
]),
|
|
1226
|
+
z(Sr, {
|
|
1227
|
+
title: J(i).blockSettings.background,
|
|
1228
|
+
open: l.has("bg"),
|
|
1229
|
+
onToggle: n[4] ||= (e) => h("bg")
|
|
1230
|
+
}, {
|
|
1231
|
+
default: Y(() => [L("label", { class: H(J(E)) }, q(J(i).blockSettings.color), 3), z(k, {
|
|
1232
|
+
size: "large",
|
|
1233
|
+
"model-value": e.block.styles.backgroundColor || J("#ffffff"),
|
|
1234
|
+
"onUpdate:modelValue": n[3] ||= (e) => b("backgroundColor", e)
|
|
1235
|
+
}, null, 8, ["model-value"])]),
|
|
1236
|
+
_: 1
|
|
1237
|
+
}, 8, ["title", "open"]),
|
|
1238
|
+
z(Sr, {
|
|
1239
|
+
title: J(i).blockSettings.display,
|
|
1240
|
+
open: l.has("display"),
|
|
1241
|
+
onToggle: n[5] ||= (e) => h("display")
|
|
1242
|
+
}, {
|
|
1243
|
+
default: Y(() => [L("div", wr, [(W(), I(M, null, K(p, (e) => L("label", {
|
|
1244
|
+
key: e.key,
|
|
1245
|
+
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]"
|
|
1246
|
+
}, [
|
|
1247
|
+
L("input", {
|
|
1248
|
+
type: "checkbox",
|
|
1249
|
+
class: "tpl:accent-[var(--tpl-primary)]",
|
|
1250
|
+
checked: x(e.key),
|
|
1251
|
+
onChange: (t) => te(e.key)
|
|
1252
|
+
}, null, 40, Tr),
|
|
1253
|
+
(W(), P(Ke(e.icon), {
|
|
1254
|
+
size: 14,
|
|
1255
|
+
"stroke-width": 1.5
|
|
1256
|
+
})),
|
|
1257
|
+
R(" " + q(J(i).blockSettings[e.labelKey]), 1)
|
|
1258
|
+
])), 64))])]),
|
|
1259
|
+
_: 1
|
|
1260
|
+
}, 8, ["title", "open"]),
|
|
1261
|
+
z(Sr, {
|
|
1262
|
+
title: J(i).blockSettings.customCss,
|
|
1263
|
+
open: l.has("css"),
|
|
1264
|
+
onToggle: n[7] ||= (e) => h("css")
|
|
1265
|
+
}, {
|
|
1266
|
+
default: Y(() => [L("label", { class: H(J(E)) }, q(J(i).blockSettings.css), 3), L("textarea", {
|
|
1267
|
+
value: e.block.customCss || "",
|
|
1268
|
+
placeholder: J(i).blockSettings.cssPlaceholder,
|
|
1269
|
+
rows: "3",
|
|
1270
|
+
class: H(J(Le)),
|
|
1271
|
+
onInput: n[6] ||= (e) => r("update", { customCss: e.target.value })
|
|
1272
|
+
}, null, 42, Er)]),
|
|
1273
|
+
_: 1
|
|
1274
|
+
}, 8, ["title", "open"]),
|
|
1275
|
+
g.value ? (W(), P(Sr, {
|
|
1276
|
+
key: 0,
|
|
1277
|
+
title: J(i).blockSettings.displayCondition,
|
|
1278
|
+
open: l.has("condition"),
|
|
1279
|
+
onToggle: n[11] ||= (e) => h("condition")
|
|
1280
|
+
}, {
|
|
1281
|
+
default: Y(() => [L("div", Dr, [L("select", {
|
|
1282
|
+
class: H(["tpl:w-full tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:outline-none tpl:transition-all tpl:duration-150 tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]", e.block.displayCondition ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-text)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"]),
|
|
1283
|
+
value: u.value || _.value ? "__custom__" : e.block.displayCondition?.label ?? "",
|
|
1284
|
+
onChange: n[8] ||= (e) => {
|
|
1285
|
+
let t = e.target.value;
|
|
1286
|
+
if (t === "__custom__") {
|
|
1287
|
+
v();
|
|
1288
|
+
return;
|
|
1289
|
+
}
|
|
1290
|
+
if (u.value = !1, !t) {
|
|
1291
|
+
r("update", { displayCondition: void 0 });
|
|
1292
|
+
return;
|
|
1293
|
+
}
|
|
1294
|
+
let n = J(o).find((e) => e.label === t);
|
|
1295
|
+
n && r("update", { displayCondition: n });
|
|
1296
|
+
}
|
|
1297
|
+
}, [
|
|
1298
|
+
L("option", kr, q(J(i).blockSettings.noCondition), 1),
|
|
1299
|
+
(W(!0), I(M, null, K(ee.value, (e, t) => (W(), I(M, { key: t }, [t ? (W(), I("optgroup", {
|
|
1300
|
+
key: 0,
|
|
1301
|
+
label: String(t)
|
|
1302
|
+
}, [(W(!0), I(M, null, K(e, (e) => (W(), I("option", {
|
|
1303
|
+
key: e.label,
|
|
1304
|
+
value: e.label
|
|
1305
|
+
}, q(e.label), 9, jr))), 128))], 8, Ar)) : (W(!0), I(M, { key: 1 }, K(e, (e) => (W(), I("option", {
|
|
1306
|
+
key: e.label,
|
|
1307
|
+
value: e.label
|
|
1308
|
+
}, q(e.label), 9, Mr))), 128))], 64))), 128)),
|
|
1309
|
+
J(s) ? (W(), I("option", Nr, q(J(i).blockSettings.customCondition), 1)) : F("", !0)
|
|
1310
|
+
], 42, Or), u.value || _.value ? (W(), I("div", Pr, [
|
|
1311
|
+
L("div", null, [L("label", Fr, q(J(i).blockSettings.customConditionBefore), 1), Xe(L("textarea", {
|
|
1312
|
+
"onUpdate:modelValue": n[9] ||= (e) => d.value = e,
|
|
1313
|
+
rows: "2",
|
|
1314
|
+
class: H(J(Le))
|
|
1315
|
+
}, null, 2), [[qe, d.value]])]),
|
|
1316
|
+
L("div", null, [L("label", Ir, q(J(i).blockSettings.customConditionAfter), 1), Xe(L("textarea", {
|
|
1317
|
+
"onUpdate:modelValue": n[10] ||= (e) => f.value = e,
|
|
1318
|
+
rows: "2",
|
|
1319
|
+
class: H(J(Le))
|
|
1320
|
+
}, null, 2), [[qe, f.value]])]),
|
|
1321
|
+
L("div", Lr, [L("button", {
|
|
1322
|
+
type: "button",
|
|
1323
|
+
class: "tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:opacity-50",
|
|
1324
|
+
disabled: !d.value.trim(),
|
|
1325
|
+
onClick: y
|
|
1326
|
+
}, q(J(i).blockSettings.applyCondition), 9, Rr)])
|
|
1327
|
+
])) : e.block.displayCondition && !_.value ? (W(), I(M, { key: 1 }, [e.block.displayCondition.description ? (W(), I("p", zr, q(e.block.displayCondition.description), 1)) : F("", !0), L("div", Br, [L("pre", Vr, q(e.block.displayCondition.before), 1), e.block.displayCondition.after ? (W(), I("pre", Hr, q(e.block.displayCondition.after), 1)) : F("", !0)])], 64)) : F("", !0)])]),
|
|
1328
|
+
_: 1
|
|
1329
|
+
}, 8, ["title", "open"])) : F("", !0)
|
|
1330
|
+
], 2));
|
|
1331
|
+
}
|
|
1332
|
+
}), Wr = ["title"], Gr = { class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Kr = {
|
|
1333
|
+
key: 1,
|
|
1334
|
+
class: "tpl:text-[var(--tpl-danger)]"
|
|
1335
|
+
}, qr = [
|
|
1336
|
+
"aria-checked",
|
|
1337
|
+
"aria-label",
|
|
1338
|
+
"disabled"
|
|
1339
|
+
], Jr = /* @__PURE__ */ B({
|
|
1340
|
+
__name: "BooleanField",
|
|
1341
|
+
props: {
|
|
1342
|
+
field: {},
|
|
1343
|
+
modelValue: { type: Boolean },
|
|
1344
|
+
readOnly: { type: Boolean }
|
|
1345
|
+
},
|
|
1346
|
+
emits: ["update:modelValue"],
|
|
1347
|
+
setup(e, { emit: t }) {
|
|
1348
|
+
let n = t, { t: r } = m();
|
|
1349
|
+
return (t, i) => (W(), I("div", {
|
|
1350
|
+
class: "tpl:mb-3.5",
|
|
1351
|
+
title: e.readOnly ? J(r).customBlocks.dataSource.readOnlyTooltip : void 0
|
|
1352
|
+
}, [L("label", { class: H(["tpl:flex tpl:items-center tpl:justify-between tpl:gap-2", e.readOnly ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer"]) }, [L("span", Gr, [
|
|
1353
|
+
R(q(e.field.label) + " ", 1),
|
|
1354
|
+
e.readOnly ? (W(), P(J(dt), {
|
|
1355
|
+
key: 0,
|
|
1356
|
+
size: 12,
|
|
1357
|
+
class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
|
|
1358
|
+
})) : F("", !0),
|
|
1359
|
+
e.field.required ? (W(), I("span", Kr, " * ")) : F("", !0)
|
|
1360
|
+
]), L("button", {
|
|
1361
|
+
type: "button",
|
|
1362
|
+
role: "switch",
|
|
1363
|
+
"aria-checked": e.modelValue,
|
|
1364
|
+
"aria-label": e.field.label,
|
|
1365
|
+
class: H([
|
|
1366
|
+
"tpl:relative tpl:inline-flex tpl:h-5 tpl:w-9 tpl:shrink-0 tpl:rounded-full tpl:border-2 tpl:border-transparent tpl:transition-colors tpl:duration-200",
|
|
1367
|
+
e.modelValue ? "tpl:bg-[var(--tpl-primary)]" : "tpl:bg-[var(--tpl-border)]",
|
|
1368
|
+
e.readOnly ? "tpl:opacity-60 tpl:cursor-not-allowed" : "tpl:cursor-pointer"
|
|
1369
|
+
]),
|
|
1370
|
+
disabled: e.readOnly,
|
|
1371
|
+
onClick: i[0] ||= (t) => !e.readOnly && n("update:modelValue", !e.modelValue)
|
|
1372
|
+
}, [L("span", { class: H(["tpl:pointer-events-none tpl:inline-block tpl:size-4 tpl:rounded-full tpl:bg-[var(--tpl-bg)] tpl:shadow tpl:transition-transform tpl:duration-200", e.modelValue ? "tpl:translate-x-4" : "tpl:translate-x-0"]) }, null, 2)], 10, qr)], 2)], 8, Wr));
|
|
1373
|
+
}
|
|
1374
|
+
}), Yr = { class: "tpl:mb-3.5" }, Xr = {
|
|
1375
|
+
key: 1,
|
|
1376
|
+
class: "tpl:text-[var(--tpl-danger)]"
|
|
1377
|
+
}, $ = /* @__PURE__ */ B({
|
|
1378
|
+
__name: "FieldWrapper",
|
|
1379
|
+
props: {
|
|
1380
|
+
label: {},
|
|
1381
|
+
required: { type: Boolean },
|
|
1382
|
+
readOnly: { type: Boolean }
|
|
1383
|
+
},
|
|
1384
|
+
setup(e) {
|
|
1385
|
+
return (t, n) => (W(), I("div", Yr, [L("label", { class: H(J(E)) }, [
|
|
1386
|
+
R(q(e.label) + " ", 1),
|
|
1387
|
+
e.readOnly ? (W(), P(J(dt), {
|
|
1388
|
+
key: 0,
|
|
1389
|
+
size: 12,
|
|
1390
|
+
class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
|
|
1391
|
+
})) : F("", !0),
|
|
1392
|
+
e.required ? (W(), I("span", Xr, "*")) : F("", !0)
|
|
1393
|
+
], 2), Ge(t.$slots, "default")]));
|
|
1394
|
+
}
|
|
1395
|
+
}), Zr = /* @__PURE__ */ B({
|
|
1396
|
+
__name: "ColorField",
|
|
1397
|
+
props: {
|
|
1398
|
+
field: {},
|
|
1399
|
+
modelValue: {},
|
|
1400
|
+
readOnly: { type: Boolean }
|
|
1401
|
+
},
|
|
1402
|
+
emits: ["update:modelValue"],
|
|
1403
|
+
setup(e, { emit: t }) {
|
|
1404
|
+
let n = t, { t: r } = m();
|
|
1405
|
+
return (t, i) => (W(), P($, {
|
|
1406
|
+
label: e.field.label,
|
|
1407
|
+
required: e.field.required,
|
|
1408
|
+
"read-only": e.readOnly
|
|
1409
|
+
}, {
|
|
1410
|
+
default: Y(() => [z(k, {
|
|
1411
|
+
"model-value": e.modelValue || J("#000000"),
|
|
1412
|
+
placeholder: e.field.placeholder || J("#000000"),
|
|
1413
|
+
disabled: e.readOnly,
|
|
1414
|
+
title: e.readOnly ? J(r).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
1415
|
+
"onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
|
|
1416
|
+
}, null, 8, [
|
|
1417
|
+
"model-value",
|
|
1418
|
+
"placeholder",
|
|
1419
|
+
"disabled",
|
|
1420
|
+
"title"
|
|
1421
|
+
])]),
|
|
1422
|
+
_: 1
|
|
1423
|
+
}, 8, [
|
|
1424
|
+
"label",
|
|
1425
|
+
"required",
|
|
1426
|
+
"read-only"
|
|
1427
|
+
]));
|
|
1428
|
+
}
|
|
1429
|
+
}), Qr = [
|
|
1430
|
+
"value",
|
|
1431
|
+
"placeholder",
|
|
1432
|
+
"title"
|
|
1433
|
+
], $r = ["value", "placeholder"], ei = /* @__PURE__ */ B({
|
|
1434
|
+
__name: "ImageField",
|
|
1435
|
+
props: {
|
|
1436
|
+
field: {},
|
|
1437
|
+
modelValue: {},
|
|
1438
|
+
readOnly: { type: Boolean }
|
|
1439
|
+
},
|
|
1440
|
+
emits: ["update:modelValue"],
|
|
1441
|
+
setup(e, { emit: t }) {
|
|
1442
|
+
let n = t, { t: r } = m(), i = V(p, null), a = N(() => !!i);
|
|
1443
|
+
async function o() {
|
|
1444
|
+
let e = await i?.({ accept: ["images"] });
|
|
1445
|
+
e && n("update:modelValue", e.url);
|
|
1446
|
+
}
|
|
1447
|
+
return (t, i) => (W(), P($, {
|
|
1448
|
+
label: e.field.label,
|
|
1449
|
+
required: e.field.required,
|
|
1450
|
+
"read-only": e.readOnly
|
|
1451
|
+
}, {
|
|
1452
|
+
default: Y(() => [e.readOnly ? (W(), I("input", {
|
|
1453
|
+
key: 0,
|
|
1454
|
+
type: "url",
|
|
1455
|
+
class: H([J(T), "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
1456
|
+
value: e.modelValue,
|
|
1457
|
+
placeholder: e.field.placeholder || "https://...",
|
|
1458
|
+
disabled: "",
|
|
1459
|
+
title: J(r).customBlocks.dataSource.readOnlyTooltip
|
|
1460
|
+
}, null, 10, Qr)) : (W(), I("input", {
|
|
1461
|
+
key: 1,
|
|
1462
|
+
type: "url",
|
|
1463
|
+
class: H(J(T)),
|
|
1464
|
+
value: e.modelValue,
|
|
1465
|
+
placeholder: e.field.placeholder || "https://...",
|
|
1466
|
+
onInput: i[0] ||= (e) => n("update:modelValue", e.target.value)
|
|
1467
|
+
}, null, 42, $r)), a.value && !e.readOnly ? (W(), I("button", {
|
|
1468
|
+
key: 2,
|
|
1469
|
+
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
|
|
1470
|
+
onClick: i[1] ||= (e) => o()
|
|
1471
|
+
}, [z(J(oe), {
|
|
1472
|
+
size: 14,
|
|
1473
|
+
"stroke-width": 1.5
|
|
1474
|
+
}), R(" " + q(J(r).image.browseMedia), 1)])) : F("", !0)]),
|
|
1475
|
+
_: 1
|
|
1476
|
+
}, 8, [
|
|
1477
|
+
"label",
|
|
1478
|
+
"required",
|
|
1479
|
+
"read-only"
|
|
1480
|
+
]));
|
|
1481
|
+
}
|
|
1482
|
+
}), ti = [
|
|
1483
|
+
"value",
|
|
1484
|
+
"placeholder",
|
|
1485
|
+
"min",
|
|
1486
|
+
"max",
|
|
1487
|
+
"step",
|
|
1488
|
+
"disabled",
|
|
1489
|
+
"title"
|
|
1490
|
+
], ni = /* @__PURE__ */ B({
|
|
1491
|
+
__name: "NumberField",
|
|
1492
|
+
props: {
|
|
1493
|
+
field: {},
|
|
1494
|
+
modelValue: {},
|
|
1495
|
+
readOnly: { type: Boolean }
|
|
1496
|
+
},
|
|
1497
|
+
emits: ["update:modelValue"],
|
|
1498
|
+
setup(e, { emit: t }) {
|
|
1499
|
+
let n = t, { t: r } = m();
|
|
1500
|
+
return (t, i) => (W(), P($, {
|
|
1501
|
+
label: e.field.label,
|
|
1502
|
+
required: e.field.required,
|
|
1503
|
+
"read-only": e.readOnly
|
|
1504
|
+
}, {
|
|
1505
|
+
default: Y(() => [L("input", {
|
|
1506
|
+
type: "number",
|
|
1507
|
+
class: H([J(T), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
1508
|
+
value: e.modelValue,
|
|
1509
|
+
placeholder: e.field.placeholder,
|
|
1510
|
+
min: e.field.min,
|
|
1511
|
+
max: e.field.max,
|
|
1512
|
+
step: e.field.step,
|
|
1513
|
+
disabled: e.readOnly,
|
|
1514
|
+
title: e.readOnly ? J(r).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
1515
|
+
onInput: i[0] ||= (t) => !e.readOnly && n("update:modelValue", Number(t.target.value))
|
|
1516
|
+
}, null, 42, ti)]),
|
|
1517
|
+
_: 1
|
|
1518
|
+
}, 8, [
|
|
1519
|
+
"label",
|
|
1520
|
+
"required",
|
|
1521
|
+
"read-only"
|
|
1522
|
+
]));
|
|
1523
|
+
}
|
|
1524
|
+
}), ri = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, ii = { class: "tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between" }, ai = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]" }, oi = ["title", "onClick"], si = {
|
|
1525
|
+
key: 1,
|
|
1526
|
+
class: "tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
1527
|
+
}, ci = /* @__PURE__ */ B({
|
|
1528
|
+
__name: "RepeatableField",
|
|
1529
|
+
props: {
|
|
1530
|
+
field: {},
|
|
1531
|
+
modelValue: {},
|
|
1532
|
+
readOnly: { type: Boolean }
|
|
1533
|
+
},
|
|
1534
|
+
emits: ["update:modelValue"],
|
|
1535
|
+
setup(e, { emit: t }) {
|
|
1536
|
+
let n = e, r = t, { t: i } = m(), a = N(() => n.modelValue || []), o = N(() => !n.field.maxItems || a.value.length < n.field.maxItems), s = N(() => !n.field.minItems || a.value.length > n.field.minItems);
|
|
1537
|
+
function c() {
|
|
1538
|
+
if (!o.value || n.readOnly) return;
|
|
1539
|
+
let e = {};
|
|
1540
|
+
for (let t of n.field.fields) e[t.key] = t.default ?? "";
|
|
1541
|
+
r("update:modelValue", [...a.value, e]);
|
|
1542
|
+
}
|
|
1543
|
+
function l(e) {
|
|
1544
|
+
if (!s.value || n.readOnly) return;
|
|
1545
|
+
let t = [...a.value];
|
|
1546
|
+
t.splice(e, 1), r("update:modelValue", t);
|
|
1547
|
+
}
|
|
1548
|
+
function u(e, t, n) {
|
|
1549
|
+
r("update:modelValue", a.value.map((r, i) => i === e ? {
|
|
1550
|
+
...r,
|
|
1551
|
+
[t]: n
|
|
1552
|
+
} : r));
|
|
1553
|
+
}
|
|
1554
|
+
return (t, n) => (W(), P($, {
|
|
1555
|
+
label: e.field.label,
|
|
1556
|
+
required: e.field.required,
|
|
1557
|
+
"read-only": e.readOnly
|
|
1558
|
+
}, {
|
|
1559
|
+
default: Y(() => [L("div", ri, [
|
|
1560
|
+
(W(!0), I(M, null, K(a.value, (t, n) => (W(), I("div", {
|
|
1561
|
+
key: `${e.field.key}-${n}`,
|
|
1562
|
+
class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3"
|
|
1563
|
+
}, [L("div", ii, [L("span", ai, " #" + q(n + 1), 1), s.value && !e.readOnly ? (W(), I("button", {
|
|
1564
|
+
key: 0,
|
|
1565
|
+
type: "button",
|
|
1566
|
+
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
|
|
1567
|
+
title: J(i).customBlocks.fields.removeItem,
|
|
1568
|
+
onClick: (e) => l(n)
|
|
1569
|
+
}, [z(J(Ae), {
|
|
1570
|
+
size: 12,
|
|
1571
|
+
"stroke-width": 2
|
|
1572
|
+
})], 8, oi)) : F("", !0)]), (W(!0), I(M, null, K(e.field.fields, (r) => (W(), P(Ke(J(_i)(r.type)), {
|
|
1573
|
+
key: r.key,
|
|
1574
|
+
field: r,
|
|
1575
|
+
"model-value": t[r.key],
|
|
1576
|
+
"read-only": e.readOnly,
|
|
1577
|
+
"onUpdate:modelValue": (e) => u(n, r.key, e)
|
|
1578
|
+
}, null, 8, [
|
|
1579
|
+
"field",
|
|
1580
|
+
"model-value",
|
|
1581
|
+
"read-only",
|
|
1582
|
+
"onUpdate:modelValue"
|
|
1583
|
+
]))), 128))]))), 128)),
|
|
1584
|
+
o.value && !e.readOnly ? (W(), I("button", {
|
|
1585
|
+
key: 0,
|
|
1586
|
+
type: "button",
|
|
1587
|
+
class: H(J(Ie)),
|
|
1588
|
+
onClick: c
|
|
1589
|
+
}, [z(J(X), {
|
|
1590
|
+
size: 14,
|
|
1591
|
+
"stroke-width": 2
|
|
1592
|
+
}), R(" " + q(J(i).customBlocks.fields.addItem), 1)], 2)) : F("", !0),
|
|
1593
|
+
!o.value && !e.readOnly ? (W(), I("p", si, q(J(i).customBlocks.fields.maxItemsReached), 1)) : F("", !0)
|
|
1594
|
+
])]),
|
|
1595
|
+
_: 1
|
|
1596
|
+
}, 8, [
|
|
1597
|
+
"label",
|
|
1598
|
+
"required",
|
|
1599
|
+
"read-only"
|
|
1600
|
+
]));
|
|
1601
|
+
}
|
|
1602
|
+
}), li = [
|
|
1603
|
+
"value",
|
|
1604
|
+
"disabled",
|
|
1605
|
+
"title"
|
|
1606
|
+
], ui = ["value"], di = /* @__PURE__ */ B({
|
|
1607
|
+
__name: "SelectField",
|
|
1608
|
+
props: {
|
|
1609
|
+
field: {},
|
|
1610
|
+
modelValue: {},
|
|
1611
|
+
readOnly: { type: Boolean }
|
|
1612
|
+
},
|
|
1613
|
+
emits: ["update:modelValue"],
|
|
1614
|
+
setup(e, { emit: t }) {
|
|
1615
|
+
let n = t, { t: r } = m();
|
|
1616
|
+
return (t, i) => (W(), P($, {
|
|
1617
|
+
label: e.field.label,
|
|
1618
|
+
required: e.field.required,
|
|
1619
|
+
"read-only": e.readOnly
|
|
1620
|
+
}, {
|
|
1621
|
+
default: Y(() => [L("select", {
|
|
1622
|
+
class: H([J(T), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
1623
|
+
value: e.modelValue,
|
|
1624
|
+
disabled: e.readOnly,
|
|
1625
|
+
title: e.readOnly ? J(r).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
1626
|
+
onChange: i[0] ||= (t) => !e.readOnly && n("update:modelValue", t.target.value)
|
|
1627
|
+
}, [(W(!0), I(M, null, K(e.field.options, (e) => (W(), I("option", {
|
|
1628
|
+
key: e.value,
|
|
1629
|
+
value: e.value
|
|
1630
|
+
}, q(e.label), 9, ui))), 128))], 42, li)]),
|
|
1631
|
+
_: 1
|
|
1632
|
+
}, 8, [
|
|
1633
|
+
"label",
|
|
1634
|
+
"required",
|
|
1635
|
+
"read-only"
|
|
1636
|
+
]));
|
|
1637
|
+
}
|
|
1638
|
+
}), fi = [
|
|
1639
|
+
"value",
|
|
1640
|
+
"placeholder",
|
|
1641
|
+
"title"
|
|
1642
|
+
], pi = /* @__PURE__ */ B({
|
|
1643
|
+
__name: "TextField",
|
|
1644
|
+
props: {
|
|
1645
|
+
field: {},
|
|
1646
|
+
modelValue: {},
|
|
1647
|
+
readOnly: { type: Boolean }
|
|
1648
|
+
},
|
|
1649
|
+
emits: ["update:modelValue"],
|
|
1650
|
+
setup(e, { emit: t }) {
|
|
1651
|
+
let n = t, { t: r } = m();
|
|
1652
|
+
return (t, i) => (W(), P($, {
|
|
1653
|
+
label: e.field.label,
|
|
1654
|
+
required: e.field.required,
|
|
1655
|
+
"read-only": e.readOnly
|
|
1656
|
+
}, {
|
|
1657
|
+
default: Y(() => [e.readOnly ? (W(), I("input", {
|
|
1658
|
+
key: 0,
|
|
1659
|
+
type: "text",
|
|
1660
|
+
class: H([J(T), "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
1661
|
+
value: e.modelValue,
|
|
1662
|
+
placeholder: e.field.placeholder,
|
|
1663
|
+
disabled: "",
|
|
1664
|
+
title: J(r).customBlocks.dataSource.readOnlyTooltip
|
|
1665
|
+
}, null, 10, fi)) : (W(), P(Z, {
|
|
1666
|
+
key: 1,
|
|
1667
|
+
"model-value": e.modelValue,
|
|
1668
|
+
placeholder: e.field.placeholder,
|
|
1669
|
+
"onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
|
|
1670
|
+
}, null, 8, ["model-value", "placeholder"]))]),
|
|
1671
|
+
_: 1
|
|
1672
|
+
}, 8, [
|
|
1673
|
+
"label",
|
|
1674
|
+
"required",
|
|
1675
|
+
"read-only"
|
|
1676
|
+
]));
|
|
1677
|
+
}
|
|
1678
|
+
}), mi = [
|
|
1679
|
+
"value",
|
|
1680
|
+
"placeholder",
|
|
1681
|
+
"title"
|
|
1682
|
+
], hi = "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:opacity-60 tpl:cursor-not-allowed", gi = {
|
|
1683
|
+
text: pi,
|
|
1684
|
+
textarea: /* @__PURE__ */ B({
|
|
1685
|
+
__name: "TextareaField",
|
|
1686
|
+
props: {
|
|
1687
|
+
field: {},
|
|
1688
|
+
modelValue: {},
|
|
1689
|
+
readOnly: { type: Boolean }
|
|
1690
|
+
},
|
|
1691
|
+
emits: ["update:modelValue"],
|
|
1692
|
+
setup(e, { emit: t }) {
|
|
1693
|
+
let n = t, { t: r } = m();
|
|
1694
|
+
return (t, i) => (W(), P($, {
|
|
1695
|
+
label: e.field.label,
|
|
1696
|
+
required: e.field.required,
|
|
1697
|
+
"read-only": e.readOnly
|
|
1698
|
+
}, {
|
|
1699
|
+
default: Y(() => [e.readOnly ? (W(), I("textarea", {
|
|
1700
|
+
key: 0,
|
|
1701
|
+
value: e.modelValue,
|
|
1702
|
+
placeholder: e.field.placeholder,
|
|
1703
|
+
rows: "3",
|
|
1704
|
+
disabled: "",
|
|
1705
|
+
title: J(r).customBlocks.dataSource.readOnlyTooltip,
|
|
1706
|
+
class: H(hi)
|
|
1707
|
+
}, null, 8, mi)) : (W(), P(rn, {
|
|
1708
|
+
key: 1,
|
|
1709
|
+
"model-value": e.modelValue,
|
|
1710
|
+
placeholder: e.field.placeholder,
|
|
1711
|
+
"onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
|
|
1712
|
+
}, null, 8, ["model-value", "placeholder"]))]),
|
|
1713
|
+
_: 1
|
|
1714
|
+
}, 8, [
|
|
1715
|
+
"label",
|
|
1716
|
+
"required",
|
|
1717
|
+
"read-only"
|
|
1718
|
+
]));
|
|
1719
|
+
}
|
|
1720
|
+
}),
|
|
1721
|
+
image: ei,
|
|
1722
|
+
color: Zr,
|
|
1723
|
+
number: ni,
|
|
1724
|
+
select: di,
|
|
1725
|
+
boolean: Jr,
|
|
1726
|
+
repeatable: ci
|
|
1727
|
+
};
|
|
1728
|
+
function _i(e) {
|
|
1729
|
+
return gi[e] ?? pi;
|
|
1730
|
+
}
|
|
1731
|
+
//#endregion
|
|
1732
|
+
//#region src/components/toolbar/CustomBlockToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
1733
|
+
var vi = {
|
|
1734
|
+
key: 0,
|
|
1735
|
+
class: "tpl:p-4"
|
|
1736
|
+
}, yi = { class: "tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, bi = { key: 1 }, xi = {
|
|
1737
|
+
key: 0,
|
|
1738
|
+
class: "tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
1739
|
+
}, Si = {
|
|
1740
|
+
key: 1,
|
|
1741
|
+
class: "tpl:mb-4"
|
|
1742
|
+
}, Ci = {
|
|
1743
|
+
key: 1,
|
|
1744
|
+
class: "tpl:flex tpl:h-[32px] tpl:items-center"
|
|
1745
|
+
}, wi = {
|
|
1746
|
+
key: 0,
|
|
1747
|
+
class: "tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
1748
|
+
}, Ti = {
|
|
1749
|
+
key: 2,
|
|
1750
|
+
class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]"
|
|
1751
|
+
}, Ei = /* @__PURE__ */ B({
|
|
1752
|
+
__name: "CustomBlockToolbar",
|
|
1753
|
+
props: { block: {} },
|
|
1754
|
+
emits: ["updateFieldValues", "updateDataSourceFetched"],
|
|
1755
|
+
setup(e, { emit: t }) {
|
|
1756
|
+
let n = e, r = t, { t: i } = m(), a = V(f, []), o = N(() => a.find((e) => e.type === n.block.customType)), { isFetching: s, fetchError: c, fetch: l, hasDataSource: u, needsFetch: d } = $e({
|
|
1757
|
+
definition: o,
|
|
1758
|
+
block: N(() => n.block),
|
|
1759
|
+
onUpdate: (e, t) => {
|
|
1760
|
+
r("updateFieldValues", e), r("updateDataSourceFetched", t);
|
|
1761
|
+
}
|
|
1762
|
+
});
|
|
1763
|
+
function p(e) {
|
|
1764
|
+
return e.readOnly === !0 && u.value && !!n.block.dataSourceFetched;
|
|
1765
|
+
}
|
|
1766
|
+
function h(e, t) {
|
|
1767
|
+
r("updateFieldValues", {
|
|
1768
|
+
...n.block.fieldValues,
|
|
1769
|
+
[e]: t
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
return (t, n) => o.value ? (W(), I("div", bi, [
|
|
1773
|
+
o.value.description ? (W(), I("p", xi, q(o.value.description), 1)) : F("", !0),
|
|
1774
|
+
J(u) ? (W(), I("div", Si, [J(d) && !J(s) ? (W(), I("button", {
|
|
1775
|
+
key: 0,
|
|
1776
|
+
type: "button",
|
|
1777
|
+
class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-md tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:bg-[var(--tpl-primary)]",
|
|
1778
|
+
onClick: n[0] ||= (...e) => J(l) && J(l)(...e)
|
|
1779
|
+
}, q(o.value?.dataSource?.label || J(i).customBlocks.dataSource.fetchButton), 1)) : (W(), I("div", Ci, [J(s) ? (W(), I("div", wi, q(J(i).customBlocks.dataSource.fetching), 1)) : (W(), I("button", {
|
|
1780
|
+
key: 1,
|
|
1781
|
+
type: "button",
|
|
1782
|
+
class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",
|
|
1783
|
+
onClick: n[1] ||= (...e) => J(l) && J(l)(...e)
|
|
1784
|
+
}, [z(J(Ce), { size: 12 }), R(" " + q(J(i).customBlocks.dataSource.changeButton), 1)]))])), J(c) ? (W(), I("p", Ti, [z(J(_e), {
|
|
1785
|
+
size: 14,
|
|
1786
|
+
class: "tpl:shrink-0"
|
|
1787
|
+
}), R(" " + q(J(i).customBlocks.dataSource.fetchError), 1)])) : F("", !0)])) : F("", !0),
|
|
1788
|
+
(W(!0), I(M, null, K(o.value.fields, (t) => (W(), P(Ke(J(_i)(t.type)), {
|
|
1789
|
+
key: t.key,
|
|
1790
|
+
field: t,
|
|
1791
|
+
"model-value": e.block.fieldValues[t.key],
|
|
1792
|
+
"read-only": p(t),
|
|
1793
|
+
"onUpdate:modelValue": (e) => h(t.key, e)
|
|
1794
|
+
}, null, 8, [
|
|
1795
|
+
"field",
|
|
1796
|
+
"model-value",
|
|
1797
|
+
"read-only",
|
|
1798
|
+
"onUpdate:modelValue"
|
|
1799
|
+
]))), 128))
|
|
1800
|
+
])) : (W(), I("div", vi, [L("p", yi, q(J(i).customBlocks.toolbar.noDefinition), 1)]));
|
|
1801
|
+
}
|
|
1802
|
+
}), Di = { class: "tpl:mb-3.5" }, Oi = { class: "tpl:mb-3.5" }, ki = { class: "tpl:mb-3.5" }, Ai = { class: "tpl:flex tpl:items-stretch" }, ji = ["value"], Mi = /* @__PURE__ */ B({
|
|
1803
|
+
__name: "DividerToolbar",
|
|
1804
|
+
props: { block: {} },
|
|
1805
|
+
emits: ["update"],
|
|
1806
|
+
setup(e, { emit: t }) {
|
|
1807
|
+
let n = t, { t: r } = m();
|
|
1808
|
+
function i(e, t) {
|
|
1809
|
+
n("update", { [e]: t });
|
|
1810
|
+
}
|
|
1811
|
+
return (t, n) => (W(), I(M, null, [
|
|
1812
|
+
L("div", Di, [L("label", { class: H(J(E)) }, q(J(r).divider.style), 3), z(j, {
|
|
1813
|
+
options: [
|
|
1814
|
+
{
|
|
1815
|
+
value: "solid",
|
|
1816
|
+
label: J(r).divider.solid
|
|
1817
|
+
},
|
|
1818
|
+
{
|
|
1819
|
+
value: "dashed",
|
|
1820
|
+
label: J(r).divider.dashed
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
value: "dotted",
|
|
1824
|
+
label: J(r).divider.dotted
|
|
1825
|
+
}
|
|
1826
|
+
],
|
|
1827
|
+
"model-value": e.block.lineStyle,
|
|
1828
|
+
"onUpdate:modelValue": n[0] ||= (e) => i("lineStyle", e)
|
|
1829
|
+
}, null, 8, ["options", "model-value"])]),
|
|
1830
|
+
L("div", Oi, [L("label", { class: H(J(E)) }, q(J(r).divider.color), 3), z(k, {
|
|
1831
|
+
"model-value": e.block.color,
|
|
1832
|
+
"onUpdate:modelValue": n[1] ||= (e) => i("color", e)
|
|
1833
|
+
}, null, 8, ["model-value"])]),
|
|
1834
|
+
L("div", ki, [L("label", { class: H(J(E)) }, q(J(r).divider.thickness), 3), L("div", Ai, [L("input", {
|
|
1835
|
+
type: "number",
|
|
1836
|
+
class: H(J(O)),
|
|
1837
|
+
value: e.block.thickness,
|
|
1838
|
+
min: "1",
|
|
1839
|
+
max: "10",
|
|
1840
|
+
onInput: n[2] ||= (e) => i("thickness", Number(e.target.value))
|
|
1841
|
+
}, null, 42, ji), L("span", { class: H(J(D)) }, "px", 2)])])
|
|
1842
|
+
], 64));
|
|
1843
|
+
}
|
|
1844
|
+
}), Ni = { class: "tpl:mb-3.5" }, Pi = ["value"], Fi = { class: "tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, Ii = /* @__PURE__ */ B({
|
|
1845
|
+
__name: "HtmlToolbar",
|
|
1846
|
+
props: { block: {} },
|
|
1847
|
+
emits: ["update"],
|
|
1848
|
+
setup(e, { emit: t }) {
|
|
1849
|
+
let n = t, { t: r } = m();
|
|
1850
|
+
return (t, i) => (W(), I("div", Ni, [
|
|
1851
|
+
L("label", { class: H(J(E)) }, q(J(r).html.content), 3),
|
|
1852
|
+
L("textarea", {
|
|
1853
|
+
value: e.block.content,
|
|
1854
|
+
placeholder: "<div>...</div>",
|
|
1855
|
+
rows: "10",
|
|
1856
|
+
class: H(J(Le)),
|
|
1857
|
+
onInput: i[0] ||= (e) => n("update", { content: e.target.value })
|
|
1858
|
+
}, null, 42, Pi),
|
|
1859
|
+
L("p", Fi, [z(J(xe), {
|
|
1860
|
+
size: 12,
|
|
1861
|
+
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
1862
|
+
}), R(" " + q(J(r).html.sanitizationHint), 1)])
|
|
1863
|
+
]));
|
|
1864
|
+
}
|
|
1865
|
+
}), Li = { class: "tpl:mb-3.5" }, Ri = {
|
|
1866
|
+
key: 0,
|
|
1867
|
+
class: "tpl:mb-3.5"
|
|
1868
|
+
}, zi = ["value", "placeholder"], Bi = { class: "tpl:mb-3.5" }, Vi = { class: "tpl:mb-3.5" }, Hi = ["value"], Ui = { value: "full" }, Wi = { class: "tpl:mb-3.5" }, Gi = { class: "tpl:mb-3.5" }, Ki = {
|
|
1869
|
+
key: 0,
|
|
1870
|
+
class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
|
|
1871
|
+
}, qi = ["checked"], Ji = /* @__PURE__ */ B({
|
|
1872
|
+
__name: "ImageToolbar",
|
|
1873
|
+
props: { block: {} },
|
|
1874
|
+
emits: ["update"],
|
|
1875
|
+
setup(e, { emit: n }) {
|
|
1876
|
+
let i = n, { t: a } = m(), o = V(p, null), s = V(r, et.liquid), c = N(() => !!o), l = G(!1), u = G(!1), { start: d } = t(() => {
|
|
1877
|
+
l.value = !1;
|
|
1878
|
+
}, 1e3, { immediate: !1 });
|
|
1879
|
+
function f(e, t) {
|
|
1880
|
+
i("update", { [e]: t });
|
|
1881
|
+
}
|
|
1882
|
+
async function h() {
|
|
1883
|
+
let e = await o?.({ accept: ["images"] });
|
|
1884
|
+
e && (f("src", e.url), e.alt && (f("alt", e.alt), u.value = !0), l.value = !0, d());
|
|
1885
|
+
}
|
|
1886
|
+
return (t, n) => (W(), I(M, null, [
|
|
1887
|
+
L("div", Li, [
|
|
1888
|
+
L("label", { class: H(J(E)) }, q(J(a).image.imageUrl), 3),
|
|
1889
|
+
z(Z, {
|
|
1890
|
+
"model-value": e.block.src,
|
|
1891
|
+
type: "url",
|
|
1892
|
+
placeholder: J(a).image.imageUrlPlaceholder,
|
|
1893
|
+
pulse: l.value,
|
|
1894
|
+
"onUpdate:modelValue": n[0] ||= (e) => f("src", e)
|
|
1895
|
+
}, null, 8, [
|
|
1896
|
+
"model-value",
|
|
1897
|
+
"placeholder",
|
|
1898
|
+
"pulse"
|
|
1899
|
+
]),
|
|
1900
|
+
c.value ? (W(), I("button", {
|
|
1901
|
+
key: 0,
|
|
1902
|
+
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
1903
|
+
style: {
|
|
1904
|
+
"border-color": "var(--tpl-border)",
|
|
1905
|
+
color: "var(--tpl-primary)",
|
|
1906
|
+
"background-color": "var(--tpl-bg)"
|
|
1907
|
+
},
|
|
1908
|
+
onClick: h
|
|
1909
|
+
}, [z(J(oe), {
|
|
1910
|
+
size: 14,
|
|
1911
|
+
"stroke-width": 1.5
|
|
1912
|
+
}), R(" " + q(J(a).image.browseMedia), 1)])) : F("", !0)
|
|
1913
|
+
]),
|
|
1914
|
+
J(tt)(e.block.src, J(s)) ? (W(), I("div", Ri, [L("label", { class: H(J(E)) }, [R(q(J(a).image.placeholderUrl) + " ", 1), n[7] ||= L("span", { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, q("(optional)"), -1)], 2), L("input", {
|
|
1915
|
+
type: "url",
|
|
1916
|
+
class: H(J(T)),
|
|
1917
|
+
value: e.block.placeholderUrl || "",
|
|
1918
|
+
placeholder: J(a).image.placeholderUrlPlaceholder,
|
|
1919
|
+
onInput: n[1] ||= (e) => f("placeholderUrl", e.target.value)
|
|
1920
|
+
}, null, 42, zi)])) : F("", !0),
|
|
1921
|
+
L("div", Bi, [L("label", { class: H(J(E)) }, q(J(a).image.altText), 3), z(Z, {
|
|
1922
|
+
"model-value": e.block.alt,
|
|
1923
|
+
type: "text",
|
|
1924
|
+
placeholder: J(a).image.altTextPlaceholder,
|
|
1925
|
+
pulse: u.value,
|
|
1926
|
+
"onUpdate:modelValue": n[2] ||= (e) => f("alt", e)
|
|
1927
|
+
}, null, 8, [
|
|
1928
|
+
"model-value",
|
|
1929
|
+
"placeholder",
|
|
1930
|
+
"pulse"
|
|
1931
|
+
])]),
|
|
1932
|
+
L("div", Vi, [L("label", { class: H(J(E)) }, q(J(a).image.width), 3), L("select", {
|
|
1933
|
+
class: H(J(T)),
|
|
1934
|
+
value: e.block.width,
|
|
1935
|
+
onChange: n[3] ||= (e) => f("width", e.target.value === "full" ? "full" : Number(e.target.value))
|
|
1936
|
+
}, [
|
|
1937
|
+
L("option", Ui, q(J(a).image.fullWidth), 1),
|
|
1938
|
+
n[8] ||= L("option", { value: "300" }, "300px", -1),
|
|
1939
|
+
n[9] ||= L("option", { value: "400" }, "400px", -1),
|
|
1940
|
+
n[10] ||= L("option", { value: "500" }, "500px", -1)
|
|
1941
|
+
], 42, Hi)]),
|
|
1942
|
+
L("div", Wi, [L("label", { class: H(J(E)) }, q(J(a).title.align), 3), z(j, {
|
|
1943
|
+
options: [
|
|
1944
|
+
{
|
|
1945
|
+
value: "left",
|
|
1946
|
+
label: J(a).title.alignLeft
|
|
1947
|
+
},
|
|
1948
|
+
{
|
|
1949
|
+
value: "center",
|
|
1950
|
+
label: J(a).title.alignCenter
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
value: "right",
|
|
1954
|
+
label: J(a).title.alignRight
|
|
1955
|
+
}
|
|
1956
|
+
],
|
|
1957
|
+
"model-value": e.block.align,
|
|
1958
|
+
"onUpdate:modelValue": n[4] ||= (e) => f("align", e)
|
|
1959
|
+
}, null, 8, ["options", "model-value"])]),
|
|
1960
|
+
L("div", Gi, [
|
|
1961
|
+
L("label", { class: H(J(E)) }, q(J(a).image.linkUrl), 3),
|
|
1962
|
+
z(Z, {
|
|
1963
|
+
"model-value": e.block.linkUrl || "",
|
|
1964
|
+
type: "url",
|
|
1965
|
+
placeholder: J(a).image.imageUrlPlaceholder,
|
|
1966
|
+
"onUpdate:modelValue": n[5] ||= (e) => f("linkUrl", e)
|
|
1967
|
+
}, null, 8, ["model-value", "placeholder"]),
|
|
1968
|
+
e.block.linkUrl ? (W(), I("label", Ki, [L("input", {
|
|
1969
|
+
type: "checkbox",
|
|
1970
|
+
class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
|
|
1971
|
+
checked: e.block.linkOpenInNewTab ?? !1,
|
|
1972
|
+
onChange: n[6] ||= (e) => f("linkOpenInNewTab", e.target.checked)
|
|
1973
|
+
}, null, 40, qi), R(" " + q(J(a).image.openInNewTab), 1)])) : F("", !0)
|
|
1974
|
+
])
|
|
1975
|
+
], 64));
|
|
1976
|
+
}
|
|
1977
|
+
}), Yi = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Xi = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Zi = [
|
|
1978
|
+
"value",
|
|
1979
|
+
"placeholder",
|
|
1980
|
+
"onInput"
|
|
1981
|
+
], Qi = ["title", "onClick"], $i = { class: "tpl:flex tpl:items-center tpl:gap-3 tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, ea = ["checked", "onChange"], ta = { class: "tpl:flex tpl:items-center tpl:gap-2" }, na = ["value"], ra = { value: "" }, ia = ["value"], aa = ["value"], oa = /* @__PURE__ */ B({
|
|
1982
|
+
__name: "MenuToolbar",
|
|
1983
|
+
props: {
|
|
1984
|
+
block: {},
|
|
1985
|
+
fontFamilies: {}
|
|
1986
|
+
},
|
|
1987
|
+
emits: ["update"],
|
|
1988
|
+
setup(e, { emit: t }) {
|
|
1989
|
+
let n = e, r = t, { t: i } = m(), a = N(() => [
|
|
1990
|
+
{
|
|
1991
|
+
key: "openInNewTab",
|
|
1992
|
+
label: i.menu.openInNewTab
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
key: "bold",
|
|
1996
|
+
label: i.menu.bold
|
|
1997
|
+
},
|
|
1998
|
+
{
|
|
1999
|
+
key: "underline",
|
|
2000
|
+
label: i.menu.underline
|
|
2001
|
+
}
|
|
2002
|
+
]), o = N(() => [
|
|
2003
|
+
{
|
|
2004
|
+
value: "left",
|
|
2005
|
+
label: i.title.alignLeft,
|
|
2006
|
+
icon: ke
|
|
2007
|
+
},
|
|
2008
|
+
{
|
|
2009
|
+
value: "center",
|
|
2010
|
+
label: i.title.alignCenter,
|
|
2011
|
+
icon: Oe
|
|
2012
|
+
},
|
|
2013
|
+
{
|
|
2014
|
+
value: "right",
|
|
2015
|
+
label: i.title.alignRight,
|
|
2016
|
+
icon: De
|
|
2017
|
+
}
|
|
2018
|
+
]);
|
|
2019
|
+
function s(e, t) {
|
|
2020
|
+
r("update", { [e]: t });
|
|
2021
|
+
}
|
|
2022
|
+
function c() {
|
|
2023
|
+
let e = {
|
|
2024
|
+
id: it(),
|
|
2025
|
+
text: "",
|
|
2026
|
+
url: "",
|
|
2027
|
+
openInNewTab: !1,
|
|
2028
|
+
bold: !1,
|
|
2029
|
+
underline: !1
|
|
2030
|
+
};
|
|
2031
|
+
r("update", { items: [...n.block.items, e] });
|
|
2032
|
+
}
|
|
2033
|
+
function l(e, t, i) {
|
|
2034
|
+
r("update", { items: n.block.items.map((n) => n.id === e ? {
|
|
2035
|
+
...n,
|
|
2036
|
+
[t]: i
|
|
2037
|
+
} : n) });
|
|
2038
|
+
}
|
|
2039
|
+
function u(e) {
|
|
2040
|
+
r("update", { items: n.block.items.filter((t) => t.id !== e) });
|
|
2041
|
+
}
|
|
2042
|
+
return (t, n) => (W(), I(M, null, [
|
|
2043
|
+
z(A, { label: J(i).menu.items }, {
|
|
2044
|
+
default: Y(() => [L("div", Yi, [(W(!0), I(M, null, K(e.block.items, (t) => (W(), I("div", {
|
|
2045
|
+
key: t.id,
|
|
2046
|
+
class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
|
|
2047
|
+
}, [
|
|
2048
|
+
L("div", Xi, [L("input", {
|
|
2049
|
+
type: "text",
|
|
2050
|
+
class: H([J(T), "tpl:flex-1"]),
|
|
2051
|
+
value: t.text,
|
|
2052
|
+
placeholder: J(i).menu.text,
|
|
2053
|
+
onInput: (e) => l(t.id, "text", e.target.value)
|
|
2054
|
+
}, null, 42, Zi), L("button", {
|
|
2055
|
+
class: H(J(Fe)),
|
|
2056
|
+
title: J(i).menu.removeItem,
|
|
2057
|
+
onClick: (e) => u(t.id)
|
|
2058
|
+
}, [z(J(je), {
|
|
2059
|
+
size: 14,
|
|
2060
|
+
"stroke-width": 2
|
|
2061
|
+
})], 10, Qi)]),
|
|
2062
|
+
z(Z, {
|
|
2063
|
+
"model-value": t.url,
|
|
2064
|
+
type: "url",
|
|
2065
|
+
placeholder: J(i).menu.urlPlaceholder,
|
|
2066
|
+
"onUpdate:modelValue": (e) => l(t.id, "url", e)
|
|
2067
|
+
}, null, 8, [
|
|
2068
|
+
"model-value",
|
|
2069
|
+
"placeholder",
|
|
2070
|
+
"onUpdate:modelValue"
|
|
2071
|
+
]),
|
|
2072
|
+
L("div", $i, [(W(!0), I(M, null, K(a.value, (e) => (W(), I("label", {
|
|
2073
|
+
key: e.key,
|
|
2074
|
+
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1"
|
|
2075
|
+
}, [L("input", {
|
|
2076
|
+
type: "checkbox",
|
|
2077
|
+
checked: t[e.key],
|
|
2078
|
+
class: "tpl:accent-[var(--tpl-primary)]",
|
|
2079
|
+
onChange: (n) => l(t.id, e.key, n.target.checked)
|
|
2080
|
+
}, null, 40, ea), R(" " + q(e.label), 1)]))), 128))]),
|
|
2081
|
+
L("div", ta, [L("label", { class: H([J(E), "tpl:!mb-0"]) }, q(J(i).menu.color), 3), z(k, {
|
|
2082
|
+
"swatch-only": "",
|
|
2083
|
+
"model-value": t.color || e.block.linkColor || e.block.color,
|
|
2084
|
+
"onUpdate:modelValue": (e) => l(t.id, "color", e)
|
|
2085
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])])
|
|
2086
|
+
]))), 128)), L("button", {
|
|
2087
|
+
class: H(J(Ie)),
|
|
2088
|
+
onClick: c
|
|
2089
|
+
}, [z(J(X), {
|
|
2090
|
+
size: 14,
|
|
2091
|
+
"stroke-width": 2
|
|
2092
|
+
}), R(" " + q(J(i).menu.addItem), 1)], 2)])]),
|
|
2093
|
+
_: 1
|
|
2094
|
+
}, 8, ["label"]),
|
|
2095
|
+
z(A, { label: J(i).menu.fontFamily }, {
|
|
2096
|
+
default: Y(() => [L("select", {
|
|
2097
|
+
class: H(J(T)),
|
|
2098
|
+
value: e.block.fontFamily || "",
|
|
2099
|
+
onChange: n[0] ||= (e) => s("fontFamily", e.target.value || void 0)
|
|
2100
|
+
}, [L("option", ra, q(J(i).title.inheritFont), 1), (W(!0), I(M, null, K(e.fontFamilies, (e) => (W(), I("option", {
|
|
2101
|
+
key: e.value,
|
|
2102
|
+
value: e.value
|
|
2103
|
+
}, q(e.label), 9, ia))), 128))], 42, na)]),
|
|
2104
|
+
_: 1
|
|
2105
|
+
}, 8, ["label"]),
|
|
2106
|
+
z(A, { label: J(i).menu.fontSize }, {
|
|
2107
|
+
default: Y(() => [z(Be, {
|
|
2108
|
+
"model-value": e.block.fontSize,
|
|
2109
|
+
min: 8,
|
|
2110
|
+
max: 48,
|
|
2111
|
+
suffix: "px",
|
|
2112
|
+
"onUpdate:modelValue": n[1] ||= (e) => s("fontSize", e)
|
|
2113
|
+
}, null, 8, ["model-value"])]),
|
|
2114
|
+
_: 1
|
|
2115
|
+
}, 8, ["label"]),
|
|
2116
|
+
z(A, { label: J(i).menu.color }, {
|
|
2117
|
+
default: Y(() => [z(k, {
|
|
2118
|
+
"model-value": e.block.color,
|
|
2119
|
+
"onUpdate:modelValue": n[2] ||= (e) => s("color", e)
|
|
2120
|
+
}, null, 8, ["model-value"])]),
|
|
2121
|
+
_: 1
|
|
2122
|
+
}, 8, ["label"]),
|
|
2123
|
+
z(A, { label: J(i).menu.linkColor }, {
|
|
2124
|
+
default: Y(() => [z(k, {
|
|
2125
|
+
"model-value": e.block.linkColor || e.block.color,
|
|
2126
|
+
"onUpdate:modelValue": n[3] ||= (e) => s("linkColor", e || void 0)
|
|
2127
|
+
}, null, 8, ["model-value"])]),
|
|
2128
|
+
_: 1
|
|
2129
|
+
}, 8, ["label"]),
|
|
2130
|
+
z(A, { label: J(i).menu.textAlign }, {
|
|
2131
|
+
default: Y(() => [z(j, {
|
|
2132
|
+
options: o.value,
|
|
2133
|
+
"model-value": e.block.textAlign,
|
|
2134
|
+
"onUpdate:modelValue": n[4] ||= (e) => s("textAlign", e)
|
|
2135
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2136
|
+
_: 1
|
|
2137
|
+
}, 8, ["label"]),
|
|
2138
|
+
z(A, { label: J(i).menu.separator }, {
|
|
2139
|
+
default: Y(() => [L("input", {
|
|
2140
|
+
type: "text",
|
|
2141
|
+
class: H(J(T)),
|
|
2142
|
+
value: e.block.separator,
|
|
2143
|
+
onInput: n[5] ||= (e) => s("separator", e.target.value)
|
|
2144
|
+
}, null, 42, aa)]),
|
|
2145
|
+
_: 1
|
|
2146
|
+
}, 8, ["label"]),
|
|
2147
|
+
z(A, { label: J(i).menu.separatorColor }, {
|
|
2148
|
+
default: Y(() => [z(k, {
|
|
2149
|
+
"model-value": e.block.separatorColor,
|
|
2150
|
+
"onUpdate:modelValue": n[6] ||= (e) => s("separatorColor", e)
|
|
2151
|
+
}, null, 8, ["model-value"])]),
|
|
2152
|
+
_: 1
|
|
2153
|
+
}, 8, ["label"]),
|
|
2154
|
+
z(A, { label: J(i).menu.spacing }, {
|
|
2155
|
+
default: Y(() => [z(Be, {
|
|
2156
|
+
"model-value": e.block.spacing,
|
|
2157
|
+
min: 0,
|
|
2158
|
+
max: 50,
|
|
2159
|
+
suffix: "px",
|
|
2160
|
+
"onUpdate:modelValue": n[7] ||= (e) => s("spacing", e)
|
|
2161
|
+
}, null, 8, ["model-value"])]),
|
|
2162
|
+
_: 1
|
|
2163
|
+
}, 8, ["label"])
|
|
2164
|
+
], 64));
|
|
2165
|
+
}
|
|
2166
|
+
}), sa = { class: "tpl:mb-3.5" }, ca = ["value"], la = ["value"], ua = /* @__PURE__ */ B({
|
|
2167
|
+
__name: "SectionToolbar",
|
|
2168
|
+
props: { block: {} },
|
|
2169
|
+
emits: ["update"],
|
|
2170
|
+
setup(e, { emit: t }) {
|
|
2171
|
+
let n = t, { t: r } = m(), i = N(() => [
|
|
2172
|
+
{
|
|
2173
|
+
value: "1",
|
|
2174
|
+
label: r.section.column1
|
|
2175
|
+
},
|
|
2176
|
+
{
|
|
2177
|
+
value: "2",
|
|
2178
|
+
label: r.section.column2
|
|
2179
|
+
},
|
|
2180
|
+
{
|
|
2181
|
+
value: "3",
|
|
2182
|
+
label: r.section.column3
|
|
2183
|
+
},
|
|
2184
|
+
{
|
|
2185
|
+
value: "1-2",
|
|
2186
|
+
label: r.section.ratio12
|
|
2187
|
+
},
|
|
2188
|
+
{
|
|
2189
|
+
value: "2-1",
|
|
2190
|
+
label: r.section.ratio21
|
|
2191
|
+
}
|
|
2192
|
+
]);
|
|
2193
|
+
return (t, a) => (W(), I("div", sa, [L("label", { class: H(J(E)) }, q(J(r).section.columns), 3), L("select", {
|
|
2194
|
+
class: H(J(T)),
|
|
2195
|
+
value: e.block.columns,
|
|
2196
|
+
onChange: a[0] ||= (e) => n("update", { columns: e.target.value })
|
|
2197
|
+
}, [(W(!0), I(M, null, K(i.value, (e) => (W(), I("option", {
|
|
2198
|
+
key: e.value,
|
|
2199
|
+
value: e.value
|
|
2200
|
+
}, q(e.label), 9, la))), 128))], 42, ca)]));
|
|
2201
|
+
}
|
|
2202
|
+
}), da = { class: "tpl:mb-3.5" }, fa = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, pa = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ma = ["value", "onChange"], ha = ["value"], ga = ["title", "onClick"], _a = { class: "tpl:mb-3.5" }, va = { class: "tpl:mb-3.5" }, ya = { class: "tpl:mb-3.5" }, ba = { class: "tpl:flex tpl:items-stretch" }, xa = ["value"], Sa = { class: "tpl:mb-3.5" }, Ca = /* @__PURE__ */ B({
|
|
2203
|
+
__name: "SocialToolbar",
|
|
2204
|
+
props: { block: {} },
|
|
2205
|
+
emits: ["update"],
|
|
2206
|
+
setup(e, { emit: t }) {
|
|
2207
|
+
let n = e, r = t, { t: i } = m();
|
|
2208
|
+
function a(e, t) {
|
|
2209
|
+
r("update", { [e]: t });
|
|
2210
|
+
}
|
|
2211
|
+
function o() {
|
|
2212
|
+
let e = {
|
|
2213
|
+
id: it(),
|
|
2214
|
+
platform: "facebook",
|
|
2215
|
+
url: ""
|
|
2216
|
+
};
|
|
2217
|
+
r("update", { icons: [...n.block.icons, e] });
|
|
2218
|
+
}
|
|
2219
|
+
function s(e, t, i) {
|
|
2220
|
+
r("update", { icons: n.block.icons.map((n) => n.id === e ? {
|
|
2221
|
+
...n,
|
|
2222
|
+
[t]: i
|
|
2223
|
+
} : n) });
|
|
2224
|
+
}
|
|
2225
|
+
function c(e) {
|
|
2226
|
+
r("update", { icons: n.block.icons.filter((t) => t.id !== e) });
|
|
2227
|
+
}
|
|
2228
|
+
return (t, n) => (W(), I(M, null, [
|
|
2229
|
+
L("div", da, [L("label", { class: H(J(E)) }, q(J(i).social.icons), 3), L("div", fa, [(W(!0), I(M, null, K(e.block.icons, (e) => (W(), I("div", {
|
|
2230
|
+
key: e.id,
|
|
2231
|
+
class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
|
|
2232
|
+
}, [L("div", pa, [L("select", {
|
|
2233
|
+
class: H([J(T), "tpl:flex-1"]),
|
|
2234
|
+
value: e.platform,
|
|
2235
|
+
onChange: (t) => s(e.id, "platform", t.target.value)
|
|
2236
|
+
}, [(W(!0), I(M, null, K(J(S), (e) => (W(), I("option", {
|
|
2237
|
+
key: e,
|
|
2238
|
+
value: e
|
|
2239
|
+
}, q(J(ue)[e].name), 9, ha))), 128))], 42, ma), L("button", {
|
|
2240
|
+
class: H(J(Fe)),
|
|
2241
|
+
title: J(i).social.removeIcon,
|
|
2242
|
+
onClick: (t) => c(e.id)
|
|
2243
|
+
}, [z(J(je), {
|
|
2244
|
+
size: 14,
|
|
2245
|
+
"stroke-width": 2
|
|
2246
|
+
})], 10, ga)]), z(Z, {
|
|
2247
|
+
"model-value": e.url,
|
|
2248
|
+
type: "url",
|
|
2249
|
+
placeholder: J(i).social.urlPlaceholder,
|
|
2250
|
+
"onUpdate:modelValue": (t) => s(e.id, "url", t)
|
|
2251
|
+
}, null, 8, [
|
|
2252
|
+
"model-value",
|
|
2253
|
+
"placeholder",
|
|
2254
|
+
"onUpdate:modelValue"
|
|
2255
|
+
])]))), 128)), L("button", {
|
|
2256
|
+
class: H(J(Ie)),
|
|
2257
|
+
onClick: o
|
|
2258
|
+
}, [z(J(X), {
|
|
2259
|
+
size: 14,
|
|
2260
|
+
"stroke-width": 2
|
|
2261
|
+
}), R(" " + q(J(i).social.addIcon), 1)], 2)])]),
|
|
2262
|
+
L("div", _a, [L("label", { class: H(J(E)) }, q(J(i).social.style), 3), z(j, {
|
|
2263
|
+
options: [
|
|
2264
|
+
{
|
|
2265
|
+
value: "solid",
|
|
2266
|
+
label: J(i).social.styleSolid
|
|
2267
|
+
},
|
|
2268
|
+
{
|
|
2269
|
+
value: "outlined",
|
|
2270
|
+
label: J(i).social.styleOutlined
|
|
2271
|
+
},
|
|
2272
|
+
{
|
|
2273
|
+
value: "rounded",
|
|
2274
|
+
label: J(i).social.styleRounded
|
|
2275
|
+
},
|
|
2276
|
+
{
|
|
2277
|
+
value: "square",
|
|
2278
|
+
label: J(i).social.styleSquare
|
|
2279
|
+
},
|
|
2280
|
+
{
|
|
2281
|
+
value: "circle",
|
|
2282
|
+
label: J(i).social.styleCircle
|
|
2283
|
+
}
|
|
2284
|
+
],
|
|
2285
|
+
"model-value": e.block.iconStyle,
|
|
2286
|
+
"onUpdate:modelValue": n[0] ||= (e) => a("iconStyle", e)
|
|
2287
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2288
|
+
L("div", va, [L("label", { class: H(J(E)) }, q(J(i).social.size), 3), z(j, {
|
|
2289
|
+
options: [
|
|
2290
|
+
{
|
|
2291
|
+
value: "small",
|
|
2292
|
+
label: J(i).social.sizeSmall
|
|
2293
|
+
},
|
|
2294
|
+
{
|
|
2295
|
+
value: "medium",
|
|
2296
|
+
label: J(i).social.sizeMedium
|
|
2297
|
+
},
|
|
2298
|
+
{
|
|
2299
|
+
value: "large",
|
|
2300
|
+
label: J(i).social.sizeLarge
|
|
2301
|
+
}
|
|
2302
|
+
],
|
|
2303
|
+
"model-value": e.block.iconSize,
|
|
2304
|
+
"onUpdate:modelValue": n[1] ||= (e) => a("iconSize", e)
|
|
2305
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2306
|
+
L("div", ya, [L("label", { class: H(J(E)) }, q(J(i).social.spacing), 3), L("div", ba, [L("input", {
|
|
2307
|
+
type: "number",
|
|
2308
|
+
class: H(J(O)),
|
|
2309
|
+
value: e.block.spacing,
|
|
2310
|
+
min: "0",
|
|
2311
|
+
max: "50",
|
|
2312
|
+
onInput: n[2] ||= (e) => a("spacing", Number(e.target.value))
|
|
2313
|
+
}, null, 42, xa), L("span", { class: H(J(D)) }, "px", 2)])]),
|
|
2314
|
+
L("div", Sa, [L("label", { class: H(J(E)) }, q(J(i).social.align), 3), z(j, {
|
|
2315
|
+
options: [
|
|
2316
|
+
{
|
|
2317
|
+
value: "left",
|
|
2318
|
+
label: J(i).title.alignLeft,
|
|
2319
|
+
icon: J(ke)
|
|
2320
|
+
},
|
|
2321
|
+
{
|
|
2322
|
+
value: "center",
|
|
2323
|
+
label: J(i).title.alignCenter,
|
|
2324
|
+
icon: J(Oe)
|
|
2325
|
+
},
|
|
2326
|
+
{
|
|
2327
|
+
value: "right",
|
|
2328
|
+
label: J(i).title.alignRight,
|
|
2329
|
+
icon: J(De)
|
|
2330
|
+
}
|
|
2331
|
+
],
|
|
2332
|
+
"model-value": e.block.align,
|
|
2333
|
+
"onUpdate:modelValue": n[3] ||= (e) => a("align", e)
|
|
2334
|
+
}, null, 8, ["options", "model-value"])])
|
|
2335
|
+
], 64));
|
|
2336
|
+
}
|
|
2337
|
+
}), wa = { class: "tpl:mb-3.5" }, Ta = { class: "tpl:flex tpl:items-stretch" }, Ea = ["value"], Da = ["value"], Oa = /* @__PURE__ */ B({
|
|
2338
|
+
__name: "SpacerToolbar",
|
|
2339
|
+
props: { block: {} },
|
|
2340
|
+
emits: ["update"],
|
|
2341
|
+
setup(e, { emit: t }) {
|
|
2342
|
+
let n = t, { t: r } = m();
|
|
2343
|
+
return (t, i) => (W(), I("div", wa, [
|
|
2344
|
+
L("label", { class: H(J(E)) }, q(J(r).spacer.height), 3),
|
|
2345
|
+
L("div", Ta, [L("input", {
|
|
2346
|
+
type: "number",
|
|
2347
|
+
class: H(J(O)),
|
|
2348
|
+
value: e.block.height,
|
|
2349
|
+
min: "10",
|
|
2350
|
+
max: "100",
|
|
2351
|
+
onInput: i[0] ||= (e) => n("update", { height: Number(e.target.value) })
|
|
2352
|
+
}, null, 42, Ea), L("span", { class: H(J(D)) }, "px", 2)]),
|
|
2353
|
+
L("input", {
|
|
2354
|
+
type: "range",
|
|
2355
|
+
class: "tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",
|
|
2356
|
+
value: e.block.height,
|
|
2357
|
+
min: "10",
|
|
2358
|
+
max: "100",
|
|
2359
|
+
onInput: i[1] ||= (e) => n("update", { height: Number(e.target.value) })
|
|
2360
|
+
}, null, 40, Da)
|
|
2361
|
+
]));
|
|
2362
|
+
}
|
|
2363
|
+
}), ka = { class: "tpl:mb-3.5" }, Aa = { class: "tpl:flex tpl:items-center tpl:gap-3" }, ja = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, Ma = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Na = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, Pa = ["disabled"], Fa = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, Ia = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, La = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Ra = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, za = ["disabled"], Ba = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, Va = { class: "tpl:mb-3.5" }, Ha = { class: "tpl:mb-1.5 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Ua = ["checked"], Wa = {
|
|
2364
|
+
key: 0,
|
|
2365
|
+
class: "tpl:mb-3.5"
|
|
2366
|
+
}, Ga = { class: "tpl:mb-3.5" }, Ka = { class: "tpl:mb-3.5" }, qa = { class: "tpl:flex tpl:items-stretch" }, Ja = ["value"], Ya = { class: "tpl:mb-3.5" }, Xa = { class: "tpl:flex tpl:items-stretch" }, Za = ["value"], Qa = { class: "tpl:mb-3.5" }, $a = ["value"], eo = { value: "" }, to = ["value"], no = { class: "tpl:mb-3.5" }, ro = { class: "tpl:flex tpl:items-stretch" }, io = ["value"], ao = { class: "tpl:mb-3.5" }, oo = { class: "tpl:mb-3.5" }, so = /* @__PURE__ */ B({
|
|
2367
|
+
__name: "TableToolbar",
|
|
2368
|
+
props: {
|
|
2369
|
+
block: {},
|
|
2370
|
+
fontFamilies: {}
|
|
2371
|
+
},
|
|
2372
|
+
emits: ["update"],
|
|
2373
|
+
setup(e, { emit: t }) {
|
|
2374
|
+
let n = e, r = t, { t: i } = m(), a = N(() => n.block.rows.length > 0 ? n.block.rows[0].cells.length : 0);
|
|
2375
|
+
function o(e, t) {
|
|
2376
|
+
r("update", { [e]: t });
|
|
2377
|
+
}
|
|
2378
|
+
function s() {
|
|
2379
|
+
let e = n.block.rows.length > 0 ? n.block.rows[0].cells.length : 3, t = {
|
|
2380
|
+
id: it(),
|
|
2381
|
+
cells: Array.from({ length: e }, () => ({
|
|
2382
|
+
id: it(),
|
|
2383
|
+
content: ""
|
|
2384
|
+
}))
|
|
2385
|
+
};
|
|
2386
|
+
r("update", { rows: [...n.block.rows, t] });
|
|
2387
|
+
}
|
|
2388
|
+
function c(e) {
|
|
2389
|
+
r("update", { rows: n.block.rows.filter((t) => t.id !== e) });
|
|
2390
|
+
}
|
|
2391
|
+
function l() {
|
|
2392
|
+
r("update", { rows: n.block.rows.map((e) => ({
|
|
2393
|
+
...e,
|
|
2394
|
+
cells: [...e.cells, {
|
|
2395
|
+
id: it(),
|
|
2396
|
+
content: ""
|
|
2397
|
+
}]
|
|
2398
|
+
})) });
|
|
2399
|
+
}
|
|
2400
|
+
function u(e) {
|
|
2401
|
+
r("update", { rows: n.block.rows.map((t) => ({
|
|
2402
|
+
...t,
|
|
2403
|
+
cells: t.cells.filter((t, n) => n !== e)
|
|
2404
|
+
})) });
|
|
2405
|
+
}
|
|
2406
|
+
return (t, n) => (W(), I(M, null, [
|
|
2407
|
+
L("div", ka, [L("label", { class: H(J(E)) }, q(J(i).table.dimensions), 3), L("div", Aa, [L("div", ja, [L("span", Ma, q(J(i).table.rows), 1), L("div", Na, [
|
|
2408
|
+
L("button", {
|
|
2409
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
|
|
2410
|
+
disabled: e.block.rows.length <= 1,
|
|
2411
|
+
onClick: n[0] ||= (t) => c(e.block.rows[e.block.rows.length - 1].id)
|
|
2412
|
+
}, [z(J(ye), {
|
|
2413
|
+
size: 12,
|
|
2414
|
+
"stroke-width": 2
|
|
2415
|
+
})], 8, Pa),
|
|
2416
|
+
L("span", Fa, q(e.block.rows.length), 1),
|
|
2417
|
+
L("button", {
|
|
2418
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",
|
|
2419
|
+
onClick: s
|
|
2420
|
+
}, [z(J(X), {
|
|
2421
|
+
size: 12,
|
|
2422
|
+
"stroke-width": 2
|
|
2423
|
+
})])
|
|
2424
|
+
])]), L("div", Ia, [L("span", La, q(J(i).table.columns), 1), L("div", Ra, [
|
|
2425
|
+
L("button", {
|
|
2426
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
|
|
2427
|
+
disabled: a.value <= 1,
|
|
2428
|
+
onClick: n[1] ||= (e) => u(a.value - 1)
|
|
2429
|
+
}, [z(J(ye), {
|
|
2430
|
+
size: 12,
|
|
2431
|
+
"stroke-width": 2
|
|
2432
|
+
})], 8, za),
|
|
2433
|
+
L("span", Ba, q(a.value), 1),
|
|
2434
|
+
L("button", {
|
|
2435
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",
|
|
2436
|
+
onClick: l
|
|
2437
|
+
}, [z(J(X), {
|
|
2438
|
+
size: 12,
|
|
2439
|
+
"stroke-width": 2
|
|
2440
|
+
})])
|
|
2441
|
+
])])])]),
|
|
2442
|
+
L("div", Va, [L("label", Ha, [L("input", {
|
|
2443
|
+
type: "checkbox",
|
|
2444
|
+
checked: e.block.hasHeaderRow,
|
|
2445
|
+
class: "tpl:accent-[var(--tpl-primary)]",
|
|
2446
|
+
onChange: n[2] ||= (e) => o("hasHeaderRow", e.target.checked)
|
|
2447
|
+
}, null, 40, Ua), R(" " + q(J(i).table.hasHeaderRow), 1)])]),
|
|
2448
|
+
e.block.hasHeaderRow ? (W(), I("div", Wa, [L("label", { class: H(J(E)) }, q(J(i).table.headerBackgroundColor), 3), z(k, {
|
|
2449
|
+
"model-value": e.block.headerBackgroundColor || J("#f2f2f2"),
|
|
2450
|
+
placeholder: J(i).table.noHeaderBg,
|
|
2451
|
+
"onUpdate:modelValue": n[3] ||= (e) => o("headerBackgroundColor", e || null)
|
|
2452
|
+
}, null, 8, ["model-value", "placeholder"])])) : F("", !0),
|
|
2453
|
+
L("div", Ga, [L("label", { class: H(J(E)) }, q(J(i).table.borderColor), 3), z(k, {
|
|
2454
|
+
"model-value": e.block.borderColor,
|
|
2455
|
+
"onUpdate:modelValue": n[4] ||= (e) => o("borderColor", e)
|
|
2456
|
+
}, null, 8, ["model-value"])]),
|
|
2457
|
+
L("div", Ka, [L("label", { class: H(J(E)) }, q(J(i).table.borderWidth), 3), L("div", qa, [L("input", {
|
|
2458
|
+
type: "number",
|
|
2459
|
+
class: H(J(O)),
|
|
2460
|
+
value: e.block.borderWidth,
|
|
2461
|
+
min: "0",
|
|
2462
|
+
max: "10",
|
|
2463
|
+
onInput: n[5] ||= (e) => o("borderWidth", Number(e.target.value))
|
|
2464
|
+
}, null, 42, Ja), L("span", { class: H(J(D)) }, "px", 2)])]),
|
|
2465
|
+
L("div", Ya, [L("label", { class: H(J(E)) }, q(J(i).table.cellPadding), 3), L("div", Xa, [L("input", {
|
|
2466
|
+
type: "number",
|
|
2467
|
+
class: H(J(O)),
|
|
2468
|
+
value: e.block.cellPadding,
|
|
2469
|
+
min: "0",
|
|
2470
|
+
max: "30",
|
|
2471
|
+
onInput: n[6] ||= (e) => o("cellPadding", Number(e.target.value))
|
|
2472
|
+
}, null, 42, Za), L("span", { class: H(J(D)) }, "px", 2)])]),
|
|
2473
|
+
L("div", Qa, [L("label", { class: H(J(E)) }, q(J(i).table.fontFamily), 3), L("select", {
|
|
2474
|
+
class: H(J(T)),
|
|
2475
|
+
value: e.block.fontFamily || "",
|
|
2476
|
+
onChange: n[7] ||= (e) => o("fontFamily", e.target.value || void 0)
|
|
2477
|
+
}, [L("option", eo, q(J(i).title.inheritFont), 1), (W(!0), I(M, null, K(e.fontFamilies, (e) => (W(), I("option", {
|
|
2478
|
+
key: e.value,
|
|
2479
|
+
value: e.value
|
|
2480
|
+
}, q(e.label), 9, to))), 128))], 42, $a)]),
|
|
2481
|
+
L("div", no, [L("label", { class: H(J(E)) }, q(J(i).table.fontSize), 3), L("div", ro, [L("input", {
|
|
2482
|
+
type: "number",
|
|
2483
|
+
class: H(J(O)),
|
|
2484
|
+
value: e.block.fontSize,
|
|
2485
|
+
min: "10",
|
|
2486
|
+
max: "32",
|
|
2487
|
+
onInput: n[8] ||= (e) => o("fontSize", Number(e.target.value))
|
|
2488
|
+
}, null, 42, io), L("span", { class: H(J(D)) }, "px", 2)])]),
|
|
2489
|
+
L("div", ao, [L("label", { class: H(J(E)) }, q(J(i).table.color), 3), z(k, {
|
|
2490
|
+
"model-value": e.block.color,
|
|
2491
|
+
"onUpdate:modelValue": n[9] ||= (e) => o("color", e)
|
|
2492
|
+
}, null, 8, ["model-value"])]),
|
|
2493
|
+
L("div", oo, [L("label", { class: H(J(E)) }, q(J(i).table.textAlign), 3), z(j, {
|
|
2494
|
+
options: [
|
|
2495
|
+
{
|
|
2496
|
+
value: "left",
|
|
2497
|
+
label: J(i).title.alignLeft,
|
|
2498
|
+
icon: J(ke)
|
|
2499
|
+
},
|
|
2500
|
+
{
|
|
2501
|
+
value: "center",
|
|
2502
|
+
label: J(i).title.alignCenter,
|
|
2503
|
+
icon: J(Oe)
|
|
2504
|
+
},
|
|
2505
|
+
{
|
|
2506
|
+
value: "right",
|
|
2507
|
+
label: J(i).title.alignRight,
|
|
2508
|
+
icon: J(De)
|
|
2509
|
+
}
|
|
2510
|
+
],
|
|
2511
|
+
"model-value": e.block.textAlign,
|
|
2512
|
+
"onUpdate:modelValue": n[10] ||= (e) => o("textAlign", e)
|
|
2513
|
+
}, null, 8, ["options", "model-value"])])
|
|
2514
|
+
], 64));
|
|
2515
|
+
}
|
|
2516
|
+
}), co = { class: "tpl:mb-3.5" }, lo = ["value"], uo = { value: 1 }, fo = { value: 2 }, po = { value: 3 }, mo = { value: 4 }, ho = { class: "tpl:mb-3.5" }, go = ["value"], _o = { value: "" }, vo = ["value"], yo = { class: "tpl:mb-3.5" }, bo = { class: "tpl:mb-3.5" }, xo = /* @__PURE__ */ B({
|
|
2517
|
+
__name: "TitleToolbar",
|
|
2518
|
+
props: {
|
|
2519
|
+
block: {},
|
|
2520
|
+
fontFamilies: {}
|
|
2521
|
+
},
|
|
2522
|
+
emits: ["update"],
|
|
2523
|
+
setup(e, { emit: t }) {
|
|
2524
|
+
let n = t, { t: r } = m();
|
|
2525
|
+
function i(e, t) {
|
|
2526
|
+
n("update", { [e]: t });
|
|
2527
|
+
}
|
|
2528
|
+
return (t, n) => (W(), I(M, null, [
|
|
2529
|
+
L("div", co, [L("label", { class: H(J(E)) }, q(J(r).title.level), 3), L("select", {
|
|
2530
|
+
class: H(J(T)),
|
|
2531
|
+
value: e.block.level,
|
|
2532
|
+
onChange: n[0] ||= (e) => i("level", Number(e.target.value))
|
|
2533
|
+
}, [
|
|
2534
|
+
L("option", uo, q(J(r).title.heading1), 1),
|
|
2535
|
+
L("option", fo, q(J(r).title.heading2), 1),
|
|
2536
|
+
L("option", po, q(J(r).title.heading3), 1),
|
|
2537
|
+
L("option", mo, q(J(r).title.heading4), 1)
|
|
2538
|
+
], 42, lo)]),
|
|
2539
|
+
L("div", ho, [L("label", { class: H(J(E)) }, q(J(r).title.fontFamily), 3), L("select", {
|
|
2540
|
+
class: H(J(T)),
|
|
2541
|
+
value: e.block.fontFamily || "",
|
|
2542
|
+
onChange: n[1] ||= (e) => i("fontFamily", e.target.value || void 0)
|
|
2543
|
+
}, [L("option", _o, q(J(r).title.inheritFont), 1), (W(!0), I(M, null, K(e.fontFamilies, (e) => (W(), I("option", {
|
|
2544
|
+
key: e.value,
|
|
2545
|
+
value: e.value
|
|
2546
|
+
}, q(e.label), 9, vo))), 128))], 42, go)]),
|
|
2547
|
+
L("div", yo, [L("label", { class: H(J(E)) }, q(J(r).title.color), 3), z(k, {
|
|
2548
|
+
"model-value": e.block.color,
|
|
2549
|
+
"onUpdate:modelValue": n[2] ||= (e) => i("color", e)
|
|
2550
|
+
}, null, 8, ["model-value"])]),
|
|
2551
|
+
L("div", bo, [L("label", { class: H(J(E)) }, q(J(r).title.align), 3), z(j, {
|
|
2552
|
+
options: [
|
|
2553
|
+
{
|
|
2554
|
+
value: "left",
|
|
2555
|
+
label: J(r).title.alignLeft,
|
|
2556
|
+
icon: J(ke)
|
|
2557
|
+
},
|
|
2558
|
+
{
|
|
2559
|
+
value: "center",
|
|
2560
|
+
label: J(r).title.alignCenter,
|
|
2561
|
+
icon: J(Oe)
|
|
2562
|
+
},
|
|
2563
|
+
{
|
|
2564
|
+
value: "right",
|
|
2565
|
+
label: J(r).title.alignRight,
|
|
2566
|
+
icon: J(De)
|
|
2567
|
+
}
|
|
2568
|
+
],
|
|
2569
|
+
"model-value": e.block.textAlign,
|
|
2570
|
+
"onUpdate:modelValue": n[3] ||= (e) => i("textAlign", e)
|
|
2571
|
+
}, null, 8, ["options", "model-value"])])
|
|
2572
|
+
], 64));
|
|
2573
|
+
}
|
|
2574
|
+
}), So = ["aria-label"], Co = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5" }, wo = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]" }, To = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Eo = { class: "tpl:flex tpl:gap-1" }, Do = ["title"], Oo = ["title"], ko = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, Ao = /* @__PURE__ */ w(/* @__PURE__ */ B({
|
|
2575
|
+
__name: "Toolbar",
|
|
2576
|
+
props: { block: {} },
|
|
2577
|
+
emits: [
|
|
2578
|
+
"update",
|
|
2579
|
+
"delete",
|
|
2580
|
+
"duplicate"
|
|
2581
|
+
],
|
|
2582
|
+
setup(e, { emit: t }) {
|
|
2583
|
+
let r = He(() => import("./CountdownToolbar-ClpBwFoX.js")), i = e, a = t, { t: o } = m(), s = n(u, "Toolbar"), c = V(f, []), l = N(() => i.block.type), d = N(() => ot(i.block)), p = N(() => {
|
|
2584
|
+
if (d.value) return c.find((e) => e.type === i.block.customType);
|
|
2585
|
+
}), h = N(() => d.value ? p.value?.name ?? i.block.customType : g(l.value, o)), v = s.fonts;
|
|
2586
|
+
function y(e) {
|
|
2587
|
+
a("update", e);
|
|
2588
|
+
}
|
|
2589
|
+
return (t, n) => (W(), I("aside", {
|
|
2590
|
+
"aria-label": J(o).landmarks.blockToolbar,
|
|
2591
|
+
class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"
|
|
2592
|
+
}, [L("div", Co, [L("div", wo, [J(be)[l.value] ? (W(), P(Ke(J(be)[l.value]), {
|
|
2593
|
+
key: 0,
|
|
2594
|
+
size: 16,
|
|
2595
|
+
"stroke-width": 1.5
|
|
2596
|
+
})) : d.value ? (W(), P(J(_), {
|
|
2597
|
+
key: 1,
|
|
2598
|
+
size: 16,
|
|
2599
|
+
"stroke-width": 1.5
|
|
2600
|
+
})) : F("", !0), L("h3", To, q(h.value), 1)]), L("div", Eo, [L("button", {
|
|
2601
|
+
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)] tpl:hover:text-[var(--tpl-text)]",
|
|
2602
|
+
title: J(o).toolbar.duplicate,
|
|
2603
|
+
onClick: n[0] ||= (e) => a("duplicate")
|
|
2604
|
+
}, [z(J(ae), {
|
|
2605
|
+
size: 14,
|
|
2606
|
+
"stroke-width": 2
|
|
2607
|
+
})], 8, Do), L("button", {
|
|
2608
|
+
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
|
|
2609
|
+
title: J(o).toolbar.delete,
|
|
2610
|
+
onClick: n[1] ||= (e) => a("delete")
|
|
2611
|
+
}, [z(J(Ae), {
|
|
2612
|
+
size: 14,
|
|
2613
|
+
"stroke-width": 2
|
|
2614
|
+
})], 8, Oo)])]), L("div", ko, [d.value ? (W(), P(Ei, {
|
|
2615
|
+
key: 0,
|
|
2616
|
+
block: e.block,
|
|
2617
|
+
onUpdateFieldValues: n[2] ||= (e) => a("update", { fieldValues: e }),
|
|
2618
|
+
onUpdateDataSourceFetched: n[3] ||= (e) => a("update", { dataSourceFetched: e })
|
|
2619
|
+
}, null, 8, ["block"])) : l.value === "section" ? (W(), P(ua, {
|
|
2620
|
+
key: 1,
|
|
2621
|
+
block: e.block,
|
|
2622
|
+
onUpdate: y
|
|
2623
|
+
}, null, 8, ["block"])) : l.value === "title" ? (W(), P(xo, {
|
|
2624
|
+
key: 2,
|
|
2625
|
+
block: e.block,
|
|
2626
|
+
"font-families": J(v),
|
|
2627
|
+
onUpdate: y
|
|
2628
|
+
}, null, 8, ["block", "font-families"])) : l.value === "paragraph" ? (W(), I(M, { key: 3 }, [], 64)) : l.value === "image" ? (W(), P(Ji, {
|
|
2629
|
+
key: 4,
|
|
2630
|
+
block: e.block,
|
|
2631
|
+
onUpdate: y
|
|
2632
|
+
}, null, 8, ["block"])) : l.value === "button" ? (W(), P(Zn, {
|
|
2633
|
+
key: 5,
|
|
2634
|
+
block: e.block,
|
|
2635
|
+
"font-families": J(v),
|
|
2636
|
+
onUpdate: y
|
|
2637
|
+
}, null, 8, ["block", "font-families"])) : l.value === "divider" ? (W(), P(Mi, {
|
|
2638
|
+
key: 6,
|
|
2639
|
+
block: e.block,
|
|
2640
|
+
onUpdate: y
|
|
2641
|
+
}, null, 8, ["block"])) : l.value === "social" ? (W(), P(Ca, {
|
|
2642
|
+
key: 7,
|
|
2643
|
+
block: e.block,
|
|
2644
|
+
onUpdate: y
|
|
2645
|
+
}, null, 8, ["block"])) : l.value === "menu" ? (W(), P(oa, {
|
|
2646
|
+
key: 8,
|
|
2647
|
+
block: e.block,
|
|
2648
|
+
"font-families": J(v),
|
|
2649
|
+
onUpdate: y
|
|
2650
|
+
}, null, 8, ["block", "font-families"])) : l.value === "table" ? (W(), P(so, {
|
|
2651
|
+
key: 9,
|
|
2652
|
+
block: e.block,
|
|
2653
|
+
"font-families": J(v),
|
|
2654
|
+
onUpdate: y
|
|
2655
|
+
}, null, 8, ["block", "font-families"])) : l.value === "spacer" ? (W(), P(Oa, {
|
|
2656
|
+
key: 10,
|
|
2657
|
+
block: e.block,
|
|
2658
|
+
onUpdate: y
|
|
2659
|
+
}, null, 8, ["block"])) : l.value === "html" ? (W(), P(Ii, {
|
|
2660
|
+
key: 11,
|
|
2661
|
+
block: e.block,
|
|
2662
|
+
onUpdate: y
|
|
2663
|
+
}, null, 8, ["block"])) : l.value === "countdown" ? (W(), P(J(r), {
|
|
2664
|
+
key: 12,
|
|
2665
|
+
block: e.block,
|
|
2666
|
+
"font-families": J(v),
|
|
2667
|
+
onUpdate: y
|
|
2668
|
+
}, null, 8, ["block", "font-families"])) : F("", !0), z(Ur, {
|
|
2669
|
+
block: e.block,
|
|
2670
|
+
"is-first-section": l.value === "paragraph",
|
|
2671
|
+
onUpdate: y
|
|
2672
|
+
}, null, 8, ["block", "is-first-section"])])], 8, So));
|
|
2673
|
+
}
|
|
2674
|
+
}), [["__scopeId", "data-v-0f4a9227"]]), jo = ["aria-label"], Mo = {
|
|
2675
|
+
role: "tablist",
|
|
2676
|
+
class: "tpl:relative tpl:flex tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]"
|
|
2677
|
+
}, No = ["aria-selected"], Po = ["aria-selected"], Fo = {
|
|
2678
|
+
key: 0,
|
|
2679
|
+
id: "tpl-tabpanel-content",
|
|
2680
|
+
role: "tabpanel",
|
|
2681
|
+
"aria-labelledby": "tpl-tab-content",
|
|
2682
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
|
|
2683
|
+
}, Io = {
|
|
2684
|
+
key: 1,
|
|
2685
|
+
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:px-6 tpl:py-10 tpl:text-center tpl:text-[var(--tpl-text-muted)]"
|
|
2686
|
+
}, Lo = { class: "tpl:mb-4 tpl:text-[var(--tpl-text-dim)]" }, Ro = { class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, zo = { class: "tpl:m-0 tpl:text-sm tpl:leading-normal" }, Bo = {
|
|
2687
|
+
key: 1,
|
|
2688
|
+
id: "tpl-tabpanel-settings",
|
|
2689
|
+
role: "tabpanel",
|
|
2690
|
+
"aria-labelledby": "tpl-tab-settings",
|
|
2691
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
|
|
2692
|
+
}, Vo = /* @__PURE__ */ B({
|
|
2693
|
+
__name: "RightSidebar",
|
|
2694
|
+
props: {
|
|
2695
|
+
selectedBlock: {},
|
|
2696
|
+
settings: {},
|
|
2697
|
+
shiftedLeft: { type: Boolean }
|
|
2698
|
+
},
|
|
2699
|
+
emits: [
|
|
2700
|
+
"update-block",
|
|
2701
|
+
"delete-block",
|
|
2702
|
+
"duplicate-block",
|
|
2703
|
+
"update-settings"
|
|
2704
|
+
],
|
|
2705
|
+
setup(e, { emit: t }) {
|
|
2706
|
+
let n = e, r = t, { t: i } = m(), a = G("content"), o = N(() => a.value === "content" ? "tpl:translate-x-0" : "tpl:translate-x-full");
|
|
2707
|
+
return Ye(() => n.selectedBlock, (e) => {
|
|
2708
|
+
e && (a.value = "content");
|
|
2709
|
+
}), (t, n) => (W(), I("aside", {
|
|
2710
|
+
"aria-label": J(i).landmarks.rightSidebar,
|
|
2711
|
+
class: H(["tpl-right-sidebar tpl:absolute tpl:top-14 tpl:bottom-0 tpl:z-40 tpl:flex tpl:w-[320px] tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)] tpl:transition-all tpl:duration-200 tpl:border-l tpl:border-[var(--tpl-border)]", e.shiftedLeft ? "tpl:right-[360px]" : "tpl:right-0"])
|
|
2712
|
+
}, [
|
|
2713
|
+
L("div", Mo, [
|
|
2714
|
+
L("div", { class: H(["tpl:absolute tpl:bottom-0 tpl:left-0 tpl:h-full tpl:w-1/2 tpl:p-1.5 tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", o.value]) }, [...n[6] ||= [L("div", { class: "tpl:h-full tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow)]" }, null, -1)]], 2),
|
|
2715
|
+
L("button", {
|
|
2716
|
+
id: "tpl-tab-content",
|
|
2717
|
+
role: "tab",
|
|
2718
|
+
"aria-selected": a.value === "content",
|
|
2719
|
+
"aria-controls": "tpl-tabpanel-content",
|
|
2720
|
+
class: H(["tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]", a.value === "content" ? "tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]"]),
|
|
2721
|
+
onClick: n[0] ||= (e) => a.value = "content"
|
|
2722
|
+
}, [z(J(mt), {
|
|
2723
|
+
size: 14,
|
|
2724
|
+
"stroke-width": 2
|
|
2725
|
+
}), R(" " + q(J(i).sidebar.content), 1)], 10, No),
|
|
2726
|
+
L("button", {
|
|
2727
|
+
id: "tpl-tab-settings",
|
|
2728
|
+
role: "tab",
|
|
2729
|
+
"aria-selected": a.value === "settings",
|
|
2730
|
+
"aria-controls": "tpl-tabpanel-settings",
|
|
2731
|
+
class: H(["tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]", a.value === "settings" ? "tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]"]),
|
|
2732
|
+
onClick: n[1] ||= (e) => a.value = "settings"
|
|
2733
|
+
}, [z(J(gt), {
|
|
2734
|
+
size: 14,
|
|
2735
|
+
"stroke-width": 1.5
|
|
2736
|
+
}), R(" " + q(J(i).sidebar.settings), 1)], 10, Po)
|
|
2737
|
+
]),
|
|
2738
|
+
a.value === "content" ? (W(), I("div", Fo, [e.selectedBlock ? (W(), P(Ao, {
|
|
2739
|
+
key: 0,
|
|
2740
|
+
block: e.selectedBlock,
|
|
2741
|
+
onUpdate: n[2] ||= (e) => r("update-block", e),
|
|
2742
|
+
onDelete: n[3] ||= (e) => r("delete-block"),
|
|
2743
|
+
onDuplicate: n[4] ||= (e) => r("duplicate-block")
|
|
2744
|
+
}, null, 8, ["block"])) : (W(), I("div", Io, [
|
|
2745
|
+
L("div", Lo, [z(J(lt), {
|
|
2746
|
+
size: 40,
|
|
2747
|
+
"stroke-width": 1.5
|
|
2748
|
+
})]),
|
|
2749
|
+
L("h3", Ro, q(J(i).sidebar.noSelection), 1),
|
|
2750
|
+
L("p", zo, q(J(i).sidebar.noSelectionHint), 1)
|
|
2751
|
+
]))])) : F("", !0),
|
|
2752
|
+
a.value === "settings" ? (W(), I("div", Bo, [z(On, {
|
|
2753
|
+
settings: e.settings,
|
|
2754
|
+
onUpdate: n[5] ||= (e) => r("update-settings", e)
|
|
2755
|
+
}, null, 8, ["settings"])])) : F("", !0)
|
|
2756
|
+
], 10, jo));
|
|
2757
|
+
}
|
|
2758
|
+
}), Ho = ["aria-label"], Uo = [
|
|
2759
|
+
"aria-checked",
|
|
2760
|
+
"aria-label",
|
|
2761
|
+
"title",
|
|
2762
|
+
"onClick"
|
|
2763
|
+
], Wo = /* @__PURE__ */ B({
|
|
2764
|
+
__name: "ViewportToggle",
|
|
2765
|
+
props: { viewport: {} },
|
|
2766
|
+
emits: ["change"],
|
|
2767
|
+
setup(e, { emit: t }) {
|
|
2768
|
+
let n = e, r = t, { t: i } = m(), a = N(() => [
|
|
2769
|
+
{
|
|
2770
|
+
value: "desktop",
|
|
2771
|
+
label: i.viewport.desktop
|
|
2772
|
+
},
|
|
2773
|
+
{
|
|
2774
|
+
value: "tablet",
|
|
2775
|
+
label: i.viewport.tablet
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
value: "mobile",
|
|
2779
|
+
label: i.viewport.mobile
|
|
2780
|
+
}
|
|
2781
|
+
]), o = N(() => `translateX(${a.value.findIndex((e) => e.value === n.viewport) * 100}%)`);
|
|
2782
|
+
return (t, n) => (W(), I("div", {
|
|
2783
|
+
role: "radiogroup",
|
|
2784
|
+
"aria-label": J(i).viewport.label,
|
|
2785
|
+
class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
|
|
2786
|
+
style: U({
|
|
2787
|
+
gridTemplateColumns: `repeat(${a.value.length}, 1fr)`,
|
|
2788
|
+
backgroundColor: "var(--tpl-bg-hover)"
|
|
2789
|
+
})
|
|
2790
|
+
}, [L("div", {
|
|
2791
|
+
class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
|
|
2792
|
+
style: U({
|
|
2793
|
+
left: "4px",
|
|
2794
|
+
width: `calc((100% - 8px) / ${a.value.length})`,
|
|
2795
|
+
transform: o.value,
|
|
2796
|
+
backgroundColor: "var(--tpl-bg)",
|
|
2797
|
+
boxShadow: "var(--tpl-shadow)",
|
|
2798
|
+
transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
2799
|
+
})
|
|
2800
|
+
}, null, 4), (W(!0), I(M, null, K(a.value, (t) => (W(), I("button", {
|
|
2801
|
+
key: t.value,
|
|
2802
|
+
role: "radio",
|
|
2803
|
+
"aria-checked": e.viewport === t.value,
|
|
2804
|
+
"aria-label": t.label,
|
|
2805
|
+
class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium",
|
|
2806
|
+
style: U({
|
|
2807
|
+
color: e.viewport === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2808
|
+
transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
2809
|
+
}),
|
|
2810
|
+
title: t.label,
|
|
2811
|
+
onClick: (e) => r("change", t.value)
|
|
2812
|
+
}, [t.value === "desktop" ? (W(), P(J(ft), {
|
|
2813
|
+
key: 0,
|
|
2814
|
+
size: 18,
|
|
2815
|
+
"stroke-width": 1.5
|
|
2816
|
+
})) : t.value === "tablet" ? (W(), P(J(xt), {
|
|
2817
|
+
key: 1,
|
|
2818
|
+
size: 18,
|
|
2819
|
+
"stroke-width": 1.5
|
|
2820
|
+
})) : (W(), P(J(_t), {
|
|
2821
|
+
key: 2,
|
|
2822
|
+
size: 18,
|
|
2823
|
+
"stroke-width": 1.5
|
|
2824
|
+
})), L("span", null, q(t.label), 1)], 12, Uo))), 128))], 12, Ho));
|
|
2825
|
+
}
|
|
2826
|
+
}), Go = [
|
|
2827
|
+
"aria-label",
|
|
2828
|
+
"title",
|
|
2829
|
+
"aria-pressed"
|
|
2830
|
+
], Ko = /* @__PURE__ */ w(/* @__PURE__ */ B({
|
|
2831
|
+
__name: "PreviewToggle",
|
|
2832
|
+
props: { previewMode: { type: Boolean } },
|
|
2833
|
+
emits: ["change"],
|
|
2834
|
+
setup(e, { emit: t }) {
|
|
2835
|
+
let n = t, { t: r } = m();
|
|
2836
|
+
return (t, i) => (W(), I("button", {
|
|
2837
|
+
class: "tpl-preview-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",
|
|
2838
|
+
style: U({
|
|
2839
|
+
color: e.previewMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2840
|
+
backgroundColor: e.previewMode ? "var(--tpl-primary-light)" : "transparent"
|
|
2841
|
+
}),
|
|
2842
|
+
"aria-label": e.previewMode ? J(r).previewMode.disable : J(r).previewMode.enable,
|
|
2843
|
+
title: e.previewMode ? J(r).previewMode.disable : J(r).previewMode.enable,
|
|
2844
|
+
"aria-pressed": e.previewMode,
|
|
2845
|
+
onClick: i[0] ||= (t) => n("change", !e.previewMode)
|
|
2846
|
+
}, [z(Ve, {
|
|
2847
|
+
"enter-active-class": "tpl-icon-enter-active",
|
|
2848
|
+
"leave-active-class": "tpl-icon-leave-active",
|
|
2849
|
+
"enter-from-class": "tpl-icon-enter-from",
|
|
2850
|
+
"leave-to-class": "tpl-icon-leave-to",
|
|
2851
|
+
mode: "out-in"
|
|
2852
|
+
}, {
|
|
2853
|
+
default: Y(() => [e.previewMode ? (W(), P(J(Se), {
|
|
2854
|
+
key: "eye",
|
|
2855
|
+
size: 18,
|
|
2856
|
+
"stroke-width": 1.5
|
|
2857
|
+
})) : (W(), P(J(h), {
|
|
2858
|
+
key: "eye-off",
|
|
2859
|
+
size: 18,
|
|
2860
|
+
"stroke-width": 1.5
|
|
2861
|
+
}))]),
|
|
2862
|
+
_: 1
|
|
2863
|
+
})], 12, Go));
|
|
2864
|
+
}
|
|
2865
|
+
}), [["__scopeId", "data-v-af87d02a"]]), qo = [
|
|
2866
|
+
"aria-label",
|
|
2867
|
+
"title",
|
|
2868
|
+
"aria-pressed"
|
|
2869
|
+
], Jo = /* @__PURE__ */ w(/* @__PURE__ */ B({
|
|
2870
|
+
__name: "DarkModeToggle",
|
|
2871
|
+
props: { darkMode: { type: Boolean } },
|
|
2872
|
+
emits: ["change"],
|
|
2873
|
+
setup(e, { emit: t }) {
|
|
2874
|
+
let n = t, { t: r } = m();
|
|
2875
|
+
return (t, i) => (W(), I("button", {
|
|
2876
|
+
class: "tpl-dark-mode-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",
|
|
2877
|
+
style: U({
|
|
2878
|
+
color: e.darkMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2879
|
+
backgroundColor: e.darkMode ? "var(--tpl-primary-light)" : "transparent"
|
|
2880
|
+
}),
|
|
2881
|
+
"aria-label": e.darkMode ? J(r).darkMode.disable : J(r).darkMode.enable,
|
|
2882
|
+
title: e.darkMode ? J(r).darkMode.disable : J(r).darkMode.enable,
|
|
2883
|
+
"aria-pressed": e.darkMode,
|
|
2884
|
+
onClick: i[0] ||= (t) => n("change", !e.darkMode)
|
|
2885
|
+
}, [z(Ve, {
|
|
2886
|
+
"enter-active-class": "tpl-icon-enter-active",
|
|
2887
|
+
"leave-active-class": "tpl-icon-leave-active",
|
|
2888
|
+
"enter-from-class": "tpl-icon-enter-from",
|
|
2889
|
+
"leave-to-class": "tpl-icon-leave-to",
|
|
2890
|
+
mode: "out-in"
|
|
2891
|
+
}, {
|
|
2892
|
+
default: Y(() => [e.darkMode ? (W(), P(J(pt), {
|
|
2893
|
+
key: "moon",
|
|
2894
|
+
size: 18,
|
|
2895
|
+
"stroke-width": 1.5
|
|
2896
|
+
})) : (W(), P(J(bt), {
|
|
2897
|
+
key: "sun",
|
|
2898
|
+
size: 18,
|
|
2899
|
+
"stroke-width": 1.5
|
|
2900
|
+
}))]),
|
|
2901
|
+
_: 1
|
|
2902
|
+
})], 12, qo));
|
|
2903
|
+
}
|
|
2904
|
+
}), [["__scopeId", "data-v-f8694f76"]]), Yo = {
|
|
2905
|
+
class: "tpl:pointer-events-auto tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-tl-lg tpl:p-1",
|
|
2906
|
+
style: {
|
|
2907
|
+
"background-color": "color-mix(\n in srgb,\n var(--tpl-canvas-bg) 85%,\n transparent\n )",
|
|
2908
|
+
"backdrop-filter": "blur(8px)",
|
|
2909
|
+
"-webkit-backdrop-filter": "blur(8px)"
|
|
2910
|
+
}
|
|
2911
|
+
}, Xo = {
|
|
2912
|
+
href: "https://github.com/templatical/sdk",
|
|
2913
|
+
target: "_blank",
|
|
2914
|
+
rel: "noopener noreferrer",
|
|
2915
|
+
class: "tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-dim)]",
|
|
2916
|
+
style: { "text-decoration": "none" }
|
|
2917
|
+
}, Zo = /* @__PURE__ */ B({
|
|
2918
|
+
__name: "EditorFooter",
|
|
2919
|
+
props: { positionClass: {} },
|
|
2920
|
+
setup(e) {
|
|
2921
|
+
let { t } = m();
|
|
2922
|
+
return (n, r) => (W(), I("footer", { class: H(["tpl:pointer-events-none tpl:absolute tpl:bottom-0 tpl:z-50 tpl:flex tpl:h-8 tpl:items-center tpl:justify-end tpl:pr-4 tpl:text-[9px] tpl:opacity-90 tpl:transition-all tpl:duration-300 tpl:text-[var(--tpl-text-dim)]", e.positionClass]) }, [L("div", Yo, [
|
|
2923
|
+
L("span", null, q(J(t).footer.poweredBy), 1),
|
|
2924
|
+
r[0] ||= L("a", {
|
|
2925
|
+
href: "https://templatical.com",
|
|
2926
|
+
target: "_blank",
|
|
2927
|
+
rel: "noopener noreferrer",
|
|
2928
|
+
class: "tpl:inline-flex tpl:items-center tpl:gap-1 tpl:font-medium tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-muted)]",
|
|
2929
|
+
style: { "text-decoration": "none" }
|
|
2930
|
+
}, [L("img", {
|
|
2931
|
+
width: "14",
|
|
2932
|
+
height: "14",
|
|
2933
|
+
src: "https://templatical.com/logo.svg",
|
|
2934
|
+
alt: ""
|
|
2935
|
+
}), R(" Templatical ")], -1),
|
|
2936
|
+
r[1] ||= L("span", { class: "tpl:text-[var(--tpl-border)]" }, "·", -1),
|
|
2937
|
+
L("a", Xo, q(J(t).footer.openSource), 1)
|
|
2938
|
+
])], 2));
|
|
2939
|
+
}
|
|
2940
|
+
});
|
|
2941
|
+
//#endregion
|
|
2942
|
+
export { Vo as a, ht as c, Wo as i, Jo as n, Vt as o, Ko as r, Mt as s, Zo as t };
|