@templatical/editor 0.14.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-J8iO_sX7.js → AiChatSidebar-BIKvYREk.js} +57 -56
- package/dist/{AiFeatureMenu-F2diEDgV.js → AiFeatureMenu-CU6kTMTf.js} +20 -20
- package/dist/{BlockIssueBadge-a-qlByxF.js → BlockIssueBadge-B3xVgMTh.js} +11 -11
- package/dist/{CloudEditor-CDjtwb4i.js → CloudEditor-DRPxvUEj.js} +470 -468
- package/dist/{CollaboratorBar-B_EnJLtW.js → CollaboratorBar-DMSjd3HZ.js} +20 -20
- package/dist/{CommentsSidebar-DaP9BA_r.js → CommentsSidebar-D_tSGvTX.js} +154 -153
- package/dist/CountdownBlock-apiYUhkQ.js +92 -0
- package/dist/CountdownToolbar-CS0axcjz.js +210 -0
- package/dist/{DesignReferenceSidebar-BHRlTqlT.js → DesignReferenceSidebar-DWYK9nTk.js} +58 -57
- package/dist/{IssuesPanel-u7ee3Wrl.js → IssuesPanel-CR1MPaDE.js} +40 -40
- package/dist/{LoadingTrack-CV3ID80N.js → LoadingTrack-DsecR8Rw.js} +1 -1
- package/dist/MergeTagSuggestion-CH2SUxBo.js +1327 -0
- package/dist/{ModuleBrowserModal-DOsdaS6s.js → ModuleBrowserModal-BOzleijA.js} +60 -59
- package/dist/{ModulePreviewCanvas-Cx4MOJ0X.js → ModulePreviewCanvas-Cg99Pbde.js} +29 -29
- package/dist/{NumberWithSuffix-D2mW_DhT.js → NumberWithSuffix-CrA6quxx.js} +143 -142
- package/dist/{ParagraphEditor-DMzkVnST.js → ParagraphEditor-8jnzoL0A.js} +250 -247
- package/dist/{RichTextEditorContent-CRCxCwKf.js → RichTextEditorContent-BqLHIZY7.js} +45 -44
- package/dist/{SaveModuleDialog-DuEKgumL.js → SaveModuleDialog-Cy2XyjYT.js} +38 -37
- package/dist/{SnapshotHistory-CVgiNJtE.js → SnapshotHistory-cfxmOsJu.js} +34 -33
- package/dist/{TemplateScoringPanel-lm0_9nYi.js → TemplateScoringPanel-CZ62rGHz.js} +83 -82
- package/dist/{TestEmailModal-WBMdiW5S.js → TestEmailModal-sr1MaMVX.js} +22 -21
- package/dist/{TitleEditor-eyT0h-Sa.js → TitleEditor-CvGTprIg.js} +46 -45
- package/dist/{TplModal-tjQ7OB0g.js → TplModal-BtKB-0Bx.js} +14 -13
- package/dist/{blockTypeIcons-DdB3uTKD.js → blockTypeIcons-BxEbbev5.js} +2 -2
- package/dist/bundle-stats.json +8 -8
- package/dist/cdn/chunks/{AiFeatureMenu-D7rB2SBs.js → AiFeatureMenu-fDUpv_-s.js} +5 -5
- package/dist/cdn/chunks/{AiFeatureMenu-D7rB2SBs.js.map → AiFeatureMenu-fDUpv_-s.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-DHOe0pgx.js → BlockIssueBadge-Byce0j0W.js} +3 -3
- package/dist/cdn/chunks/{BlockIssueBadge-DHOe0pgx.js.map → BlockIssueBadge-Byce0j0W.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-DNed_Ym0.js → CloudEditor-B4m8ldiE.js} +89 -89
- package/dist/cdn/chunks/{CloudEditor-DNed_Ym0.js.map → CloudEditor-B4m8ldiE.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-sj_9Lee3.js → CollaboratorBar-LnLmjxw_.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-sj_9Lee3.js.map → CollaboratorBar-LnLmjxw_.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-C1Ikjpn4.js → CountdownBlock-DxTuMRBM.js} +3 -3
- package/dist/cdn/chunks/{CountdownBlock-C1Ikjpn4.js.map → CountdownBlock-DxTuMRBM.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-j1G_X8rB.js → CountdownToolbar-DUrVfQZH.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-j1G_X8rB.js.map → CountdownToolbar-DUrVfQZH.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CTOf3PsH.js → IssuesPanel-CHl90k4h.js} +4 -4
- package/dist/cdn/chunks/{IssuesPanel-CTOf3PsH.js.map → IssuesPanel-CHl90k4h.js.map} +1 -1
- package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js +213 -0
- package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js.map +1 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-DCh88-rr.js → ModuleBrowserModal-DW0iQW0J.js} +6 -6
- package/dist/cdn/chunks/{ModuleBrowserModal-DCh88-rr.js.map → ModuleBrowserModal-DW0iQW0J.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DJqvTKmg.js → ModulePreviewCanvas-Cxo8v8t1.js} +3 -3
- package/dist/cdn/chunks/{ModulePreviewCanvas-DJqvTKmg.js.map → ModulePreviewCanvas-Cxo8v8t1.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-Bu45XWSl.js → NumberWithSuffix-CnSRmUMK.js} +6 -6
- package/dist/cdn/chunks/{NumberWithSuffix-Bu45XWSl.js.map → NumberWithSuffix-CnSRmUMK.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DwZqLJp2.js → ParagraphEditor-iG5cDjH0.js} +25 -23
- package/dist/cdn/chunks/{ParagraphEditor-DwZqLJp2.js.map → ParagraphEditor-iG5cDjH0.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-CIuZ-2DV.js → RichTextEditorContent-DQpgeGMj.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-CIuZ-2DV.js.map → RichTextEditorContent-DQpgeGMj.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-Bep0X2s_.js → SaveModuleDialog-sJQXg2Mh.js} +3 -3
- package/dist/cdn/chunks/{SaveModuleDialog-Bep0X2s_.js.map → SaveModuleDialog-sJQXg2Mh.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DO1-h3RY.js → TitleEditor-C8qIn9Oi.js} +12 -11
- package/dist/cdn/chunks/TitleEditor-C8qIn9Oi.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-8o24HVJu.js → blockTypeIcons-DySnOpPo.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-8o24HVJu.js.map → blockTypeIcons-DySnOpPo.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-kPCz_3zM.js → draggable-kG-D5Xsm.js} +6 -6
- package/dist/cdn/chunks/draggable-kG-D5Xsm.js.map +1 -0
- package/dist/cdn/chunks/extensions-C2pTX899.js +421 -0
- package/dist/cdn/chunks/extensions-C2pTX899.js.map +1 -0
- package/dist/cdn/chunks/{features-CkTMVylx.js → features-CHE3YjQE.js} +886 -837
- package/dist/cdn/chunks/features-CHE3YjQE.js.map +1 -0
- package/dist/cdn/chunks/{icons-9zjCuoJx.js → icons-M4uqBV-_.js} +26 -26
- package/dist/cdn/chunks/{icons-9zjCuoJx.js.map → icons-M4uqBV-_.js.map} +1 -1
- package/dist/cdn/chunks/{liquid.browser-DKKBzRQu.js → liquid.browser-BJOEu6Cg.js} +693 -678
- package/dist/cdn/chunks/liquid.browser-BJOEu6Cg.js.map +1 -0
- package/dist/cdn/chunks/{media-library-DMRIPx4g.js → media-library-Bqr15VN2.js} +33 -33
- package/dist/cdn/chunks/{media-library-DMRIPx4g.js.map → media-library-Bqr15VN2.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-CdEqyLwF.js → pusher-CIwiKF8H.js} +4 -4
- package/dist/cdn/chunks/{pusher-CdEqyLwF.js.map → pusher-CIwiKF8H.js.map} +1 -1
- package/dist/cdn/chunks/{quality-CyeUgs_c.js → quality-DJZ_fqc2.js} +112 -112
- package/dist/cdn/chunks/{quality-CyeUgs_c.js.map → quality-DJZ_fqc2.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-BIKUEKDD.js → renderer-CyzTR1Vq.js} +20 -20
- package/dist/cdn/chunks/renderer-CyzTR1Vq.js.map +1 -0
- package/dist/cdn/chunks/{src-pDy_imWG.js → src-q-SBgWx7.js} +5 -5
- package/dist/cdn/chunks/{src-pDy_imWG.js.map → src-q-SBgWx7.js.map} +1 -1
- package/dist/cdn/chunks/{styles-D4Bd3SCx.js → styles-PWISdaws.js} +1484 -1344
- package/dist/cdn/chunks/styles-PWISdaws.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-BlLFFU3M.js → tiptap-DF9PEiqH.js} +6859 -6823
- package/dist/cdn/chunks/tiptap-DF9PEiqH.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +35 -35
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-CYJwFmjy.js → check-rl7ok6uJ.js} +1 -1
- package/dist/{chevron-down-C5l-DzAA.js → chevron-down-BKe__NOD.js} +1 -1
- package/dist/{circle-alert-wf5HUFZY.js → circle-alert-C8xmpMsK.js} +1 -1
- package/dist/{clock-Bj0bQw-K.js → clock-BW4JuDCN.js} +1 -1
- package/dist/{cloud-CoFDm9YA.js → cloud-BQusL53H.js} +208 -208
- package/dist/createLucideIcon-Dx-EjR9r.js +43 -0
- package/dist/{dist-CLpPNKy9.js → dist-B5Sov3sS.js} +7 -7
- package/dist/dist-BEWiuOMi.js +251 -0
- package/dist/{dist-CrQZ_af9.js → dist-BFmE-7hB.js} +2 -2
- package/dist/{dist-U5vfDdYI.js → dist-BMoa33wT.js} +2 -2
- package/dist/{dist-BctFrpeA.js → dist-BibU4HNl.js} +74 -65
- package/dist/{dist-Dd3ibRZm.js → dist-BsCGIDSt.js} +103 -102
- package/dist/dist-CNLKj9wa.js +5 -0
- package/dist/{dist-BX3gGwL8.js → dist-CNXDNYQn.js} +728 -694
- package/dist/{dist-Bn703mnA.js → dist-COG3IdPK.js} +3 -3
- package/dist/{dist-B7w6xTU6.js → dist-CQZxDvFw.js} +3 -3
- package/dist/{dist-34OcyoK1.js → dist-CRsjOQM-.js} +2 -2
- package/dist/dist-CTT6WYJ6.js +134 -0
- package/dist/dist-Cqa6aeAJ.js +5 -0
- package/dist/{dist-ChMninLH.js → dist-SXJJ2v41.js} +2 -2
- package/dist/{dist-CyjyYg52.js → dist-itdjZraK.js} +28 -23
- package/dist/extensions-DwaZAqm6.js +423 -0
- package/dist/{image-up-x8-WXfsx.js → image-up-BwBCmQ4P.js} +1 -1
- package/dist/{info-RS_fGcGi.js → info-TCn7uWR5.js} +1 -1
- package/dist/{keys-DgYXDafq.js → keys-Cv8-8GsD.js} +1 -1
- package/dist/{liquid.browser-CVjP5Mex.js → liquid.browser-DZLtv26k.js} +692 -677
- package/dist/{list-checks-Bf7XdDyv.js → list-checks-CSrOWNgq.js} +1 -1
- package/dist/{loader-circle-CLZ0_FvW.js → loader-circle-BLmicnPG.js} +1 -1
- package/dist/{message-circle-B-1bN9ab.js → message-circle-C9hHMQCI.js} +1 -1
- package/dist/{refresh-cw-CWKWqJYG.js → refresh-cw-D1JQ1LNa.js} +1 -1
- package/dist/runtime-dom.esm-bundler-BzuoCyNp.js +523 -0
- package/dist/{scan-line-BtK5dEai.js → scan-line-DgijVq9y.js} +1 -1
- package/dist/{send-Cn1IUdzh.js → send-DjPdq69F.js} +1 -1
- package/dist/{shield-check-CrvMk4Ea.js → shield-check-Bqluu8FS.js} +1 -1
- package/dist/{sparkles-CgfjwvnG.js → sparkles-M4azPVSP.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/styles-B2OrgEnn.js +4164 -0
- package/dist/templatical-editor.js +127 -126
- package/dist/{text-align-start-C3r_Rnvy.js → text-align-start-CMya5pCQ.js} +11 -11
- package/dist/{trash-2-CjERg4x9.js → trash-2-C-81rkLS.js} +1 -1
- package/dist/{triangle-alert-Chkny574.js → triangle-alert-BuRWnynk.js} +1 -1
- package/dist/{upload-e5kDRkPb.js → upload-CWBIoLd4.js} +1 -1
- package/dist/{useAliveFlag-cUQj9rmB.js → useAliveFlag-CECL_OUb.js} +1 -1
- package/dist/{useCloudI18n-CYJKqXtI.js → useCloudI18n-AKCy98qD.js} +2 -2
- package/dist/{useEditorCore-8JxXDOA4.js → useEditorCore-DJeOXVxQ.js} +1407 -1365
- package/dist/{useI18n-BWqM8i78.js → useI18n-C-TDeJBt.js} +2 -2
- package/dist/{useMergeTag-NHC4ylza.js → useMergeTag-DSrBY0-2.js} +5 -5
- package/dist/usePopoverRoot-DKUDnr55.js +8 -0
- package/dist/{vue.runtime.esm-bundler-BPa483TZ.js → vue.runtime.esm-bundler-l0XAqiyv.js} +626 -1147
- package/dist/{x-DiPIbccg.js → x-CQSvXnGR.js} +1 -1
- package/package.json +26 -26
- package/dist/CountdownBlock-DtAokAVw.js +0 -92
- package/dist/CountdownToolbar-Dtqgwy0g.js +0 -210
- package/dist/cdn/chunks/TitleEditor-DO1-h3RY.js.map +0 -1
- package/dist/cdn/chunks/draggable-kPCz_3zM.js.map +0 -1
- package/dist/cdn/chunks/extensions-iwBXnEwq.js +0 -605
- package/dist/cdn/chunks/extensions-iwBXnEwq.js.map +0 -1
- package/dist/cdn/chunks/features-CkTMVylx.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-DKKBzRQu.js.map +0 -1
- package/dist/cdn/chunks/renderer-BIKUEKDD.js.map +0 -1
- package/dist/cdn/chunks/styles-D4Bd3SCx.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BlLFFU3M.js.map +0 -1
- package/dist/createLucideIcon-Bad2kKE0.js +0 -43
- package/dist/dist-CADDCv0o.js +0 -5
- package/dist/dist-CGvz7vkq.js +0 -5
- package/dist/dist-DuCzdgDA.js +0 -382
- package/dist/extensions-J439b7y7.js +0 -1720
- package/dist/styles-BUwDOWd3.js +0 -4022
- package/dist/usePopoverRoot-B1sdY4es.js +0 -8
|
@@ -0,0 +1,4164 @@
|
|
|
1
|
+
import { A as e, Dt as t, Et as n, H as r, I as i, K as a, N as o, O as s, Ot as c, R as l, W as u, Y as d, _ as f, c as p, d as m, g as h, h as g, j as _, l as v, m as y, nt as b, q as x, r as S, s as C, u as w, w as T, x as E, y as D, z as O } from "./vue.runtime.esm-bundler-l0XAqiyv.js";
|
|
2
|
+
import { a as k, c as A, o as j, s as M, t as N } from "./runtime-dom.esm-bundler-BzuoCyNp.js";
|
|
3
|
+
import { C as P, D as F, E as I, O as L, k as R, o as z, r as B, s as V, u as ee, w as te } from "./dist-BibU4HNl.js";
|
|
4
|
+
import { D as ne, F as re, I as H, L as ie, M as ae, N as oe, P as se, R as ce, S as le, _ as ue, a as de, c as fe, f as pe, g as me, h as he, i as ge, j as _e, l as ve, m as ye, n as be, o as xe, p as Se, r as Ce, s as we, u as Te, v as Ee, y as De } from "./useEditorCore-DJeOXVxQ.js";
|
|
5
|
+
import { c as Oe, m as ke } from "./dist-CTT6WYJ6.js";
|
|
6
|
+
import { D as Ae, F as je, I as Me, L as Ne, N as Pe, P as Fe, T as Ie, a as Le, d as Re, f as ze, g as Be, k as Ve, m as He, n as Ue, o as We, p as Ge, s as Ke, u as qe, w as Je, x as Ye } from "./keys-Cv8-8GsD.js";
|
|
7
|
+
import { t as U } from "./useI18n-C-TDeJBt.js";
|
|
8
|
+
import { t as W } from "./createLucideIcon-Dx-EjR9r.js";
|
|
9
|
+
import { n as Xe, t as Ze } from "./scan-line-DgijVq9y.js";
|
|
10
|
+
import { t as Qe } from "./chevron-down-BKe__NOD.js";
|
|
11
|
+
import { t as $e } from "./circle-alert-C8xmpMsK.js";
|
|
12
|
+
import { i as et, n as tt, r as nt, t as rt } from "./blockTypeIcons-BxEbbev5.js";
|
|
13
|
+
import { n as it, t as at } from "./refresh-cw-D1JQ1LNa.js";
|
|
14
|
+
import { t as ot } from "./image-up-BwBCmQ4P.js";
|
|
15
|
+
import { t as st } from "./info-TCn7uWR5.js";
|
|
16
|
+
import { t as ct } from "./list-checks-CSrOWNgq.js";
|
|
17
|
+
import { t as lt } from "./loader-circle-BLmicnPG.js";
|
|
18
|
+
import { t as ut } from "./sparkles-M4azPVSP.js";
|
|
19
|
+
import { n as dt, r as ft, t as pt } from "./text-align-start-CMya5pCQ.js";
|
|
20
|
+
import { t as mt } from "./trash-2-C-81rkLS.js";
|
|
21
|
+
import { t as ht } from "./upload-CWBIoLd4.js";
|
|
22
|
+
import { t as gt } from "./x-CQSvXnGR.js";
|
|
23
|
+
import { t as _t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
24
|
+
import { t as vt } from "./useCloudI18n-AKCy98qD.js";
|
|
25
|
+
import { t as yt } from "./useMergeTag-DSrBY0-2.js";
|
|
26
|
+
import { t as bt } from "./useAliveFlag-CECL_OUb.js";
|
|
27
|
+
import { t as xt } from "./readableTextColor-f8Kykfnh.js";
|
|
28
|
+
import { t as St } from "./CountdownBlock-apiYUhkQ.js";
|
|
29
|
+
import { _ as Ct, c as wt, f as G, g as Tt, h as K, l as Et, m as q, p as J, r as Dt, t as Ot } from "./styleConstants-lGobwiLH.js";
|
|
30
|
+
import { i as Y, n as X, r as Z, t as kt } from "./NumberWithSuffix-CrA6quxx.js";
|
|
31
|
+
import { n as At, r as jt } from "./MergeTagSuggestion-CH2SUxBo.js";
|
|
32
|
+
import { t as Mt } from "./usePopoverRoot-DKUDnr55.js";
|
|
33
|
+
import { t as Nt } from "./TplModal-BtKB-0Bx.js";
|
|
34
|
+
var Pt = W("circle", [["circle", {
|
|
35
|
+
cx: "12",
|
|
36
|
+
cy: "12",
|
|
37
|
+
r: "10",
|
|
38
|
+
key: "1mglay"
|
|
39
|
+
}]]), Ft = W("globe", [
|
|
40
|
+
["circle", {
|
|
41
|
+
cx: "12",
|
|
42
|
+
cy: "12",
|
|
43
|
+
r: "10",
|
|
44
|
+
key: "1mglay"
|
|
45
|
+
}],
|
|
46
|
+
["path", {
|
|
47
|
+
d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",
|
|
48
|
+
key: "13o1zl"
|
|
49
|
+
}],
|
|
50
|
+
["path", {
|
|
51
|
+
d: "M2 12h20",
|
|
52
|
+
key: "9i4pu4"
|
|
53
|
+
}]
|
|
54
|
+
]), It = W("layout-template", [
|
|
55
|
+
["rect", {
|
|
56
|
+
width: "18",
|
|
57
|
+
height: "7",
|
|
58
|
+
x: "3",
|
|
59
|
+
y: "3",
|
|
60
|
+
rx: "1",
|
|
61
|
+
key: "f1a2em"
|
|
62
|
+
}],
|
|
63
|
+
["rect", {
|
|
64
|
+
width: "9",
|
|
65
|
+
height: "7",
|
|
66
|
+
x: "3",
|
|
67
|
+
y: "14",
|
|
68
|
+
rx: "1",
|
|
69
|
+
key: "jqznyg"
|
|
70
|
+
}],
|
|
71
|
+
["rect", {
|
|
72
|
+
width: "5",
|
|
73
|
+
height: "7",
|
|
74
|
+
x: "16",
|
|
75
|
+
y: "14",
|
|
76
|
+
rx: "1",
|
|
77
|
+
key: "q5h2i8"
|
|
78
|
+
}]
|
|
79
|
+
]), Lt = W("lock-open", [["rect", {
|
|
80
|
+
width: "18",
|
|
81
|
+
height: "11",
|
|
82
|
+
x: "3",
|
|
83
|
+
y: "11",
|
|
84
|
+
rx: "2",
|
|
85
|
+
ry: "2",
|
|
86
|
+
key: "1w4ew1"
|
|
87
|
+
}], ["path", {
|
|
88
|
+
d: "M7 11V7a5 5 0 0 1 9.9-1",
|
|
89
|
+
key: "1mm8w8"
|
|
90
|
+
}]]), Rt = W("lock", [["rect", {
|
|
91
|
+
width: "18",
|
|
92
|
+
height: "11",
|
|
93
|
+
x: "3",
|
|
94
|
+
y: "11",
|
|
95
|
+
rx: "2",
|
|
96
|
+
ry: "2",
|
|
97
|
+
key: "1w4ew1"
|
|
98
|
+
}], ["path", {
|
|
99
|
+
d: "M7 11V7a5 5 0 0 1 10 0v4",
|
|
100
|
+
key: "fwvmzm"
|
|
101
|
+
}]]), zt = W("monitor", [
|
|
102
|
+
["rect", {
|
|
103
|
+
width: "20",
|
|
104
|
+
height: "14",
|
|
105
|
+
x: "2",
|
|
106
|
+
y: "3",
|
|
107
|
+
rx: "2",
|
|
108
|
+
key: "48i651"
|
|
109
|
+
}],
|
|
110
|
+
["line", {
|
|
111
|
+
x1: "8",
|
|
112
|
+
x2: "16",
|
|
113
|
+
y1: "21",
|
|
114
|
+
y2: "21",
|
|
115
|
+
key: "1svkeh"
|
|
116
|
+
}],
|
|
117
|
+
["line", {
|
|
118
|
+
x1: "12",
|
|
119
|
+
x2: "12",
|
|
120
|
+
y1: "17",
|
|
121
|
+
y2: "21",
|
|
122
|
+
key: "vw1qmm"
|
|
123
|
+
}]
|
|
124
|
+
]), Bt = W("moon", [["path", {
|
|
125
|
+
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",
|
|
126
|
+
key: "kfwtm"
|
|
127
|
+
}]]), Vt = W("panel-top", [["rect", {
|
|
128
|
+
width: "18",
|
|
129
|
+
height: "18",
|
|
130
|
+
x: "3",
|
|
131
|
+
y: "3",
|
|
132
|
+
rx: "2",
|
|
133
|
+
key: "afitv7"
|
|
134
|
+
}], ["path", {
|
|
135
|
+
d: "M3 9h18",
|
|
136
|
+
key: "1pudct"
|
|
137
|
+
}]]), Q = W("plus", [["path", {
|
|
138
|
+
d: "M5 12h14",
|
|
139
|
+
key: "1ays0h"
|
|
140
|
+
}], ["path", {
|
|
141
|
+
d: "M12 5v14",
|
|
142
|
+
key: "s699le"
|
|
143
|
+
}]]), Ht = W("rotate-ccw", [["path", {
|
|
144
|
+
d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
|
|
145
|
+
key: "1357e3"
|
|
146
|
+
}], ["path", {
|
|
147
|
+
d: "M3 3v5h5",
|
|
148
|
+
key: "1xhq8a"
|
|
149
|
+
}]]), Ut = W("settings", [["path", {
|
|
150
|
+
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",
|
|
151
|
+
key: "1i5ecw"
|
|
152
|
+
}], ["circle", {
|
|
153
|
+
cx: "12",
|
|
154
|
+
cy: "12",
|
|
155
|
+
r: "3",
|
|
156
|
+
key: "1v7zrd"
|
|
157
|
+
}]]), Wt = W("smartphone", [["rect", {
|
|
158
|
+
width: "14",
|
|
159
|
+
height: "20",
|
|
160
|
+
x: "5",
|
|
161
|
+
y: "2",
|
|
162
|
+
rx: "2",
|
|
163
|
+
ry: "2",
|
|
164
|
+
key: "1yt0o3"
|
|
165
|
+
}], ["path", {
|
|
166
|
+
d: "M12 18h.01",
|
|
167
|
+
key: "mhygvu"
|
|
168
|
+
}]]), Gt = W("square-plus", [
|
|
169
|
+
["rect", {
|
|
170
|
+
width: "18",
|
|
171
|
+
height: "18",
|
|
172
|
+
x: "3",
|
|
173
|
+
y: "3",
|
|
174
|
+
rx: "2",
|
|
175
|
+
key: "afitv7"
|
|
176
|
+
}],
|
|
177
|
+
["path", {
|
|
178
|
+
d: "M8 12h8",
|
|
179
|
+
key: "1wcyev"
|
|
180
|
+
}],
|
|
181
|
+
["path", {
|
|
182
|
+
d: "M12 8v8",
|
|
183
|
+
key: "napkw2"
|
|
184
|
+
}]
|
|
185
|
+
]), Kt = W("square", [["rect", {
|
|
186
|
+
width: "18",
|
|
187
|
+
height: "18",
|
|
188
|
+
x: "3",
|
|
189
|
+
y: "3",
|
|
190
|
+
rx: "2",
|
|
191
|
+
key: "afitv7"
|
|
192
|
+
}]]), qt = W("sun", [
|
|
193
|
+
["circle", {
|
|
194
|
+
cx: "12",
|
|
195
|
+
cy: "12",
|
|
196
|
+
r: "4",
|
|
197
|
+
key: "4exip2"
|
|
198
|
+
}],
|
|
199
|
+
["path", {
|
|
200
|
+
d: "M12 2v2",
|
|
201
|
+
key: "tus03m"
|
|
202
|
+
}],
|
|
203
|
+
["path", {
|
|
204
|
+
d: "M12 20v2",
|
|
205
|
+
key: "1lh1kg"
|
|
206
|
+
}],
|
|
207
|
+
["path", {
|
|
208
|
+
d: "m4.93 4.93 1.41 1.41",
|
|
209
|
+
key: "149t6j"
|
|
210
|
+
}],
|
|
211
|
+
["path", {
|
|
212
|
+
d: "m17.66 17.66 1.41 1.41",
|
|
213
|
+
key: "ptbguv"
|
|
214
|
+
}],
|
|
215
|
+
["path", {
|
|
216
|
+
d: "M2 12h2",
|
|
217
|
+
key: "1t8f8n"
|
|
218
|
+
}],
|
|
219
|
+
["path", {
|
|
220
|
+
d: "M20 12h2",
|
|
221
|
+
key: "1q8mjw"
|
|
222
|
+
}],
|
|
223
|
+
["path", {
|
|
224
|
+
d: "m6.34 17.66-1.41 1.41",
|
|
225
|
+
key: "1m8zz5"
|
|
226
|
+
}],
|
|
227
|
+
["path", {
|
|
228
|
+
d: "m19.07 4.93-1.41 1.41",
|
|
229
|
+
key: "1shlcs"
|
|
230
|
+
}]
|
|
231
|
+
]);
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/utils/resolveLintOptions.ts
|
|
234
|
+
function Jt(e) {
|
|
235
|
+
return {
|
|
236
|
+
...e.lint,
|
|
237
|
+
locale: e.locale
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/components/Canvas.vue?vue&type=script&setup=true&lang.ts
|
|
242
|
+
var Yt = ["aria-label"], Xt = {
|
|
243
|
+
key: 0,
|
|
244
|
+
class: "tpl-canvas-empty-content tpl:flex tpl:flex-col tpl:items-center"
|
|
245
|
+
}, Zt = { class: "tpl-canvas-empty-icon tpl:mb-4 tpl:text-[var(--tpl-primary)]" }, Qt = { class: "tpl-canvas-empty-title tpl:m-0 tpl:mb-2 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-primary)]" }, $t = { class: "tpl-canvas-empty-text tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-dim)]" }, en = {
|
|
246
|
+
key: 0,
|
|
247
|
+
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)]"
|
|
248
|
+
}, tn = {
|
|
249
|
+
key: 1,
|
|
250
|
+
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)]"
|
|
251
|
+
}, nn = { class: "tpl:relative" }, rn = {
|
|
252
|
+
class: "tpl:inline-flex tpl:size-3 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[8px] tpl:font-bold",
|
|
253
|
+
style: { "background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 30%,\n transparent\n )" }
|
|
254
|
+
}, an = 96, on = /*#__PURE__*/ _t(/* @__PURE__ */ f({
|
|
255
|
+
__name: "Canvas",
|
|
256
|
+
props: {
|
|
257
|
+
viewport: {},
|
|
258
|
+
content: {},
|
|
259
|
+
selectedBlockId: {},
|
|
260
|
+
darkMode: { type: Boolean },
|
|
261
|
+
previewMode: { type: Boolean },
|
|
262
|
+
lockedBlocks: {}
|
|
263
|
+
},
|
|
264
|
+
emits: [
|
|
265
|
+
"select-block",
|
|
266
|
+
"open-ai-chat",
|
|
267
|
+
"open-design-reference"
|
|
268
|
+
],
|
|
269
|
+
setup(r, { emit: i }) {
|
|
270
|
+
let a = {
|
|
271
|
+
section: we,
|
|
272
|
+
title: ve,
|
|
273
|
+
paragraph: Se,
|
|
274
|
+
image: he,
|
|
275
|
+
button: re,
|
|
276
|
+
divider: Ee,
|
|
277
|
+
spacer: ge,
|
|
278
|
+
html: ue,
|
|
279
|
+
social: de,
|
|
280
|
+
menu: ye,
|
|
281
|
+
table: Ce,
|
|
282
|
+
video: be,
|
|
283
|
+
countdown: St,
|
|
284
|
+
custom: De
|
|
285
|
+
}, u = r, f = i, { t: h } = U(), { t: _ } = vt(), x = Ne(He, "Canvas"), T = E(qe, null), D = E(We, null), k = E(Ke, {}), A = C(() => (k.plan?.hasFeature("ai_generation") ?? !1) && (k.ai?.isFeatureEnabled("chat") ?? !1)), M = C(() => (k.plan?.hasFeature("ai_generation") ?? !1) && (k.ai?.isFeatureEnabled("designToTemplate") ?? !1)), N = C({
|
|
286
|
+
get: () => u.content.blocks,
|
|
287
|
+
set: (e) => {
|
|
288
|
+
x.setContent({
|
|
289
|
+
...u.content,
|
|
290
|
+
blocks: e
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}), P = C(() => {
|
|
294
|
+
switch (u.viewport) {
|
|
295
|
+
case "mobile": return 375;
|
|
296
|
+
default: return u.content.settings.width;
|
|
297
|
+
}
|
|
298
|
+
}), F = C(() => P.value + an * 2), I = C(() => ({ fontFamily: u.content.settings.fontFamily })), L = C(() => N.value.length === 0 && !u.previewMode), R = d(0), z = C(() => L.value && R.value > 0);
|
|
299
|
+
function B() {
|
|
300
|
+
L.value && (R.value += 1);
|
|
301
|
+
}
|
|
302
|
+
function V() {
|
|
303
|
+
L.value && (R.value = Math.max(0, R.value - 1));
|
|
304
|
+
}
|
|
305
|
+
function ee() {
|
|
306
|
+
R.value = 0;
|
|
307
|
+
}
|
|
308
|
+
function te(e) {
|
|
309
|
+
u.previewMode || e.target === e.currentTarget && f("select-block", null);
|
|
310
|
+
}
|
|
311
|
+
function ne(e) {
|
|
312
|
+
return pe(e, D, a);
|
|
313
|
+
}
|
|
314
|
+
function H(e) {
|
|
315
|
+
return u.lockedBlocks?.get(e) ?? null;
|
|
316
|
+
}
|
|
317
|
+
function ie(e, t) {
|
|
318
|
+
e.type === "custom" && x.updateBlock(e.id, {
|
|
319
|
+
fieldValues: t.fieldValues,
|
|
320
|
+
dataSourceFetched: t.dataSourceFetched
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
return (i, a) => (s(), m("div", {
|
|
324
|
+
class: "tpl-canvas-stage tpl:relative tpl:flex tpl:justify-center tpl:rounded-lg",
|
|
325
|
+
style: t({
|
|
326
|
+
width: `${F.value}px`,
|
|
327
|
+
boxShadow: r.darkMode ? "none" : "var(--tpl-shadow-xl)",
|
|
328
|
+
transition: "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)"
|
|
329
|
+
})
|
|
330
|
+
}, [p("div", {
|
|
331
|
+
class: "tpl-canvas-bg tpl:absolute tpl:inset-0 tpl:rounded-lg tpl:pointer-events-none",
|
|
332
|
+
style: t({
|
|
333
|
+
backgroundColor: r.content.settings.backgroundColor,
|
|
334
|
+
...r.darkMode ? { filter: "invert(1) hue-rotate(180deg)" } : {},
|
|
335
|
+
transition: "filter 300ms ease"
|
|
336
|
+
})
|
|
337
|
+
}, null, 4), p("div", {
|
|
338
|
+
"data-testid": "canvas-wrapper",
|
|
339
|
+
role: "region",
|
|
340
|
+
"aria-label": b(h).landmarks.canvas,
|
|
341
|
+
class: "tpl-canvas-wrapper tpl:relative",
|
|
342
|
+
style: t({
|
|
343
|
+
width: `${P.value}px`,
|
|
344
|
+
transition: "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)"
|
|
345
|
+
})
|
|
346
|
+
}, [p("div", {
|
|
347
|
+
class: n(["tpl-canvas tpl:relative tpl:rounded-lg", {
|
|
348
|
+
"tpl-canvas--dark-mode": r.darkMode,
|
|
349
|
+
"tpl-preview-mode": r.previewMode
|
|
350
|
+
}]),
|
|
351
|
+
style: t(I.value),
|
|
352
|
+
onClick: te
|
|
353
|
+
}, [g(b(fe), {
|
|
354
|
+
modelValue: N.value,
|
|
355
|
+
"onUpdate:modelValue": a[2] ||= (e) => N.value = e,
|
|
356
|
+
group: "blocks",
|
|
357
|
+
animation: 150,
|
|
358
|
+
"ghost-class": "tpl-ghost",
|
|
359
|
+
"drag-class": "tpl-dragging",
|
|
360
|
+
handle: ".tpl-block-btn",
|
|
361
|
+
"invert-swap": !0,
|
|
362
|
+
"inverted-swap-threshold": .65,
|
|
363
|
+
disabled: r.previewMode,
|
|
364
|
+
draggable: ".tpl-block-item",
|
|
365
|
+
"force-fallback": !0,
|
|
366
|
+
class: n([
|
|
367
|
+
"tpl-canvas-blocks",
|
|
368
|
+
L.value ? "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:bg-[var(--tpl-bg-elevated)] tpl:font-[var(--tpl-font-family)] tpl:transition-colors tpl:duration-150" : "",
|
|
369
|
+
L.value && z.value ? "tpl-canvas-empty--drag-over tpl:border-[var(--tpl-primary-hover)] tpl:bg-[var(--tpl-primary-light)]" : "",
|
|
370
|
+
L.value && !z.value ? "tpl:border-[var(--tpl-primary)]" : ""
|
|
371
|
+
]),
|
|
372
|
+
onDragenter: B,
|
|
373
|
+
onDragleave: V,
|
|
374
|
+
onDrop: ee
|
|
375
|
+
}, {
|
|
376
|
+
default: l(() => [L.value ? (s(), m("div", Xt, [
|
|
377
|
+
p("div", Zt, [g(b(Gt), {
|
|
378
|
+
size: 48,
|
|
379
|
+
"stroke-width": 1
|
|
380
|
+
})]),
|
|
381
|
+
p("p", Qt, c(b(h).canvas.noBlocks), 1),
|
|
382
|
+
p("p", $t, c(b(h).canvas.dragHint), 1),
|
|
383
|
+
A.value && b(_) ? (s(), m("p", en, [
|
|
384
|
+
y(c(b(h).canvas.aiHintChat) + " ", 1),
|
|
385
|
+
p("button", {
|
|
386
|
+
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)]",
|
|
387
|
+
onClick: a[0] ||= (e) => f("open-ai-chat")
|
|
388
|
+
}, [g(b(ut), {
|
|
389
|
+
size: 14,
|
|
390
|
+
"stroke-width": 2
|
|
391
|
+
}), y(" " + c(b(_).aiMenu.aiAssistant), 1)]),
|
|
392
|
+
y(" " + c(b(h).canvas.aiHintChatSuffix), 1)
|
|
393
|
+
])) : w("", !0),
|
|
394
|
+
M.value && b(_) ? (s(), m("p", tn, [
|
|
395
|
+
y(c(b(h).canvas.aiHintDesign) + " ", 1),
|
|
396
|
+
p("button", {
|
|
397
|
+
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)]",
|
|
398
|
+
onClick: a[1] ||= (e) => f("open-design-reference")
|
|
399
|
+
}, [g(b(ot), {
|
|
400
|
+
size: 14,
|
|
401
|
+
"stroke-width": 2
|
|
402
|
+
}), y(" " + c(b(_).aiMenu.designToTemplate), 1)]),
|
|
403
|
+
y(" " + c(b(h).canvas.aiHintDesignSuffix), 1)
|
|
404
|
+
])) : w("", !0)
|
|
405
|
+
])) : w("", !0), (s(!0), m(S, null, e(N.value, (e) => O((s(), m("div", {
|
|
406
|
+
key: e.id,
|
|
407
|
+
class: "tpl-block-item"
|
|
408
|
+
}, [p("div", nn, [H(e.id) ? (s(), m("div", {
|
|
409
|
+
key: 0,
|
|
410
|
+
class: "tpl-collab-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
|
|
411
|
+
style: t({
|
|
412
|
+
outline: `2px solid ${H(e.id).color}`,
|
|
413
|
+
outlineOffset: "-1px"
|
|
414
|
+
})
|
|
415
|
+
}, [p("span", {
|
|
416
|
+
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",
|
|
417
|
+
style: t({
|
|
418
|
+
backgroundColor: H(e.id).color,
|
|
419
|
+
color: b(xt)(H(e.id).color)
|
|
420
|
+
})
|
|
421
|
+
}, [p("span", rn, c(H(e.id).name.charAt(0)), 1), y(" " + c(H(e.id).name), 1)], 4)], 4)) : w("", !0), g(Te, {
|
|
422
|
+
block: e,
|
|
423
|
+
"is-selected": !r.previewMode && r.selectedBlockId === e.id && !H(e.id),
|
|
424
|
+
viewport: r.viewport,
|
|
425
|
+
"preview-mode": r.previewMode,
|
|
426
|
+
onSelect: (t) => r.previewMode || H(e.id) ? void 0 : f("select-block", e.id)
|
|
427
|
+
}, {
|
|
428
|
+
default: l(() => [(s(), v(o(ne(e)), {
|
|
429
|
+
block: e,
|
|
430
|
+
viewport: r.viewport,
|
|
431
|
+
onFetchData: (t) => ie(e, t),
|
|
432
|
+
onUpdate: (t) => b(x).updateBlock(e.id, t)
|
|
433
|
+
}, null, 40, [
|
|
434
|
+
"block",
|
|
435
|
+
"viewport",
|
|
436
|
+
"onFetchData",
|
|
437
|
+
"onUpdate"
|
|
438
|
+
]))]),
|
|
439
|
+
_: 2
|
|
440
|
+
}, 1032, [
|
|
441
|
+
"block",
|
|
442
|
+
"is-selected",
|
|
443
|
+
"viewport",
|
|
444
|
+
"preview-mode",
|
|
445
|
+
"onSelect"
|
|
446
|
+
])])])), [[j, !b(T)?.isHidden(e.id)]])), 128))]),
|
|
447
|
+
_: 1
|
|
448
|
+
}, 8, [
|
|
449
|
+
"modelValue",
|
|
450
|
+
"disabled",
|
|
451
|
+
"class"
|
|
452
|
+
])], 6)], 12, Yt)], 4));
|
|
453
|
+
}
|
|
454
|
+
}), [["__scopeId", "data-v-a9a1158b"]]), sn = f({
|
|
455
|
+
name: "CustomBlockStylesheets",
|
|
456
|
+
setup() {
|
|
457
|
+
let e = E(ze, null);
|
|
458
|
+
return () => e ? e.value.map((e, t) => D("style", {
|
|
459
|
+
key: t,
|
|
460
|
+
"data-tpl-custom-block-stylesheet": "",
|
|
461
|
+
innerHTML: e
|
|
462
|
+
})) : null;
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region src/utils/resolvePaletteBlocks.ts
|
|
467
|
+
function cn(e, t) {
|
|
468
|
+
if (!t || t.length === 0) return {
|
|
469
|
+
items: e,
|
|
470
|
+
unknown: []
|
|
471
|
+
};
|
|
472
|
+
let n = new Map(e.map((e) => [e.type, e])), r = [], i = [], a = /* @__PURE__ */ new Set();
|
|
473
|
+
for (let e of t) {
|
|
474
|
+
if (a.has(e)) continue;
|
|
475
|
+
a.add(e);
|
|
476
|
+
let t = n.get(e);
|
|
477
|
+
t ? r.push(t) : i.push(e);
|
|
478
|
+
}
|
|
479
|
+
return {
|
|
480
|
+
items: r,
|
|
481
|
+
unknown: i
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
//#endregion
|
|
485
|
+
//#region src/components/Sidebar.vue?vue&type=script&setup=true&lang.ts
|
|
486
|
+
var ln = ["aria-label"], un = {
|
|
487
|
+
key: 0,
|
|
488
|
+
class: "tpl:border-b tpl:px-1 tpl:pb-1 tpl:border-[var(--tpl-border)]"
|
|
489
|
+
}, dn = ["aria-label"], fn = {
|
|
490
|
+
key: 0,
|
|
491
|
+
class: "tpl:flex-1 tpl:truncate tpl:text-sm tpl:font-medium"
|
|
492
|
+
}, pn = {
|
|
493
|
+
key: 1,
|
|
494
|
+
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)]"
|
|
495
|
+
}, mn = [
|
|
496
|
+
"data-palette-type",
|
|
497
|
+
"aria-label",
|
|
498
|
+
"onClick",
|
|
499
|
+
"onKeydown"
|
|
500
|
+
], hn = { 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" }, gn = {
|
|
501
|
+
key: 0,
|
|
502
|
+
class: "tpl:truncate tpl:text-sm tpl:font-medium"
|
|
503
|
+
}, _n = /* @__PURE__ */ f({
|
|
504
|
+
__name: "Sidebar",
|
|
505
|
+
setup(n) {
|
|
506
|
+
let { t: r, format: a } = U(), { t: u } = vt(), f = E(Re, []), h = E(Ve, void 0), _ = E(Le, void 0), y = E(He, null), x = E(Ke, {}), T = C(() => (x.savedModules?.moduleCount.value ?? 0) > 0), D = d(!1), O = d(!1);
|
|
507
|
+
function k() {
|
|
508
|
+
O.value || (D.value = !1);
|
|
509
|
+
}
|
|
510
|
+
function A() {
|
|
511
|
+
O.value = !0;
|
|
512
|
+
}
|
|
513
|
+
function j() {
|
|
514
|
+
O.value = !1;
|
|
515
|
+
}
|
|
516
|
+
let M = [
|
|
517
|
+
"section",
|
|
518
|
+
"image",
|
|
519
|
+
"title",
|
|
520
|
+
"paragraph",
|
|
521
|
+
"button",
|
|
522
|
+
"divider",
|
|
523
|
+
"video",
|
|
524
|
+
"social",
|
|
525
|
+
"menu",
|
|
526
|
+
"table",
|
|
527
|
+
"spacer",
|
|
528
|
+
"html"
|
|
529
|
+
], N = C(() => {
|
|
530
|
+
let e = M.map((e) => ({
|
|
531
|
+
type: e,
|
|
532
|
+
label: ie(e, r)
|
|
533
|
+
}));
|
|
534
|
+
return x.plan && e.splice(-1, 0, {
|
|
535
|
+
type: "countdown",
|
|
536
|
+
label: ie("countdown", r)
|
|
537
|
+
}), e;
|
|
538
|
+
}), P = C(() => f.map((e) => ({
|
|
539
|
+
type: `custom:${e.type}`,
|
|
540
|
+
label: e.name,
|
|
541
|
+
isCustom: !0,
|
|
542
|
+
icon: e.icon
|
|
543
|
+
}))), F = C(() => [...N.value, ...P.value]), I = C(() => cn(F.value, h)), L = C(() => I.value.items), R = /* @__PURE__ */ new Set();
|
|
544
|
+
i(() => I.value.unknown, (e) => {
|
|
545
|
+
for (let t of e) R.has(t) || (R.add(t), H.warn(`config.paletteBlocks: "${t}" is not a built-in or registered custom block (use the "custom:" prefix for custom blocks) — skipping it in the palette.`));
|
|
546
|
+
}, { immediate: !0 });
|
|
547
|
+
function z(e) {
|
|
548
|
+
if (e.isCustom) {
|
|
549
|
+
let t = e.type.replace("custom:", ""), n = f.find((e) => e.type === t);
|
|
550
|
+
if (n) return ee(n);
|
|
551
|
+
}
|
|
552
|
+
return V(e.type, _);
|
|
553
|
+
}
|
|
554
|
+
function B(e) {
|
|
555
|
+
if (!y) return;
|
|
556
|
+
let t = z(e);
|
|
557
|
+
y.addBlock(t), y.selectBlock(t.id);
|
|
558
|
+
}
|
|
559
|
+
function te(e, t) {
|
|
560
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), B(t));
|
|
561
|
+
}
|
|
562
|
+
return (n, i) => (s(), m("aside", {
|
|
563
|
+
"aria-label": b(r).sidebarNav.palette,
|
|
564
|
+
class: "tpl-sidebar-rail tpl:absolute tpl:top-14 tpl:bottom-0 tpl:left-0 tpl:z-40 tpl:flex tpl:flex-col tpl:overflow-hidden",
|
|
565
|
+
style: t({
|
|
566
|
+
width: D.value ? "200px" : "48px",
|
|
567
|
+
backgroundColor: "var(--tpl-bg-elevated)",
|
|
568
|
+
borderRight: "1px solid var(--tpl-border)",
|
|
569
|
+
boxShadow: D.value ? "var(--tpl-shadow-lg)" : "none",
|
|
570
|
+
transition: "width 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
571
|
+
}),
|
|
572
|
+
onMouseenter: i[1] ||= (e) => D.value = !0,
|
|
573
|
+
onMouseleave: k,
|
|
574
|
+
onFocusin: i[2] ||= (e) => D.value = !0,
|
|
575
|
+
onFocusout: i[3] ||= (e) => D.value = !1
|
|
576
|
+
}, [T.value && b(u) ? (s(), m("div", un, [p("button", {
|
|
577
|
+
type: "button",
|
|
578
|
+
"aria-label": b(r).sidebarNav.browseModules,
|
|
579
|
+
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)]",
|
|
580
|
+
style: t({ justifyContent: D.value ? "flex-start" : "center" }),
|
|
581
|
+
onClick: i[0] ||= (e) => b(x).savedModules?.openBrowser()
|
|
582
|
+
}, [
|
|
583
|
+
g(b(nt), {
|
|
584
|
+
size: 20,
|
|
585
|
+
"stroke-width": 1.5,
|
|
586
|
+
class: "tpl:shrink-0"
|
|
587
|
+
}),
|
|
588
|
+
D.value ? (s(), m("span", fn, c(b(u).modules.title), 1)) : w("", !0),
|
|
589
|
+
D.value ? (s(), m("span", pn, c(b(x).savedModules?.moduleCount.value ?? 0), 1)) : w("", !0)
|
|
590
|
+
], 12, dn)])) : w("", !0), g(b(fe), {
|
|
591
|
+
"model-value": L.value,
|
|
592
|
+
group: {
|
|
593
|
+
name: "blocks",
|
|
594
|
+
pull: "clone",
|
|
595
|
+
put: !1
|
|
596
|
+
},
|
|
597
|
+
clone: z,
|
|
598
|
+
sort: !1,
|
|
599
|
+
animation: 150,
|
|
600
|
+
"force-fallback": !0,
|
|
601
|
+
class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-0.5 tpl:overflow-y-auto tpl:p-1",
|
|
602
|
+
onChoose: A,
|
|
603
|
+
onEnd: j
|
|
604
|
+
}, {
|
|
605
|
+
default: l(() => [(s(!0), m(S, null, e(L.value, (e) => (s(), m("button", {
|
|
606
|
+
key: e.type,
|
|
607
|
+
type: "button",
|
|
608
|
+
"data-palette-type": e.type,
|
|
609
|
+
"aria-label": b(a)(b(r).sidebarNav.insertBlock, { block: e.label }),
|
|
610
|
+
class: "tpl:flex tpl:h-10 tpl:w-full tpl:shrink-0 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",
|
|
611
|
+
style: t({ justifyContent: D.value ? "flex-start" : "center" }),
|
|
612
|
+
onClick: (t) => B(e),
|
|
613
|
+
onKeydown: (t) => te(t, e)
|
|
614
|
+
}, [p("div", hn, [b(rt)[e.type] ? (s(), v(o(b(rt)[e.type]), {
|
|
615
|
+
key: 0,
|
|
616
|
+
size: 20,
|
|
617
|
+
"stroke-width": 1.5
|
|
618
|
+
})) : e.isCustom ? (s(), v(ne, {
|
|
619
|
+
key: 1,
|
|
620
|
+
icon: e.icon,
|
|
621
|
+
size: 20
|
|
622
|
+
}, null, 8, ["icon"])) : w("", !0)]), D.value ? (s(), m("span", gn, c(e.label), 1)) : w("", !0)], 44, mn))), 128))]),
|
|
623
|
+
_: 1
|
|
624
|
+
}, 8, ["model-value"])], 44, ln));
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
//#endregion
|
|
628
|
+
//#region src/utils/mergeTagTrigger.ts
|
|
629
|
+
function vn(e, t, n, r) {
|
|
630
|
+
if (!n) return null;
|
|
631
|
+
let i = e.slice(0, t), a = i.lastIndexOf(n);
|
|
632
|
+
if (a === -1) return null;
|
|
633
|
+
let o = i.slice(a + n.length);
|
|
634
|
+
return /\s/.test(o) || r && o.includes(r) ? null : {
|
|
635
|
+
triggerStart: a,
|
|
636
|
+
caret: t,
|
|
637
|
+
query: o
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region src/utils/textFieldCaret.ts
|
|
642
|
+
var yn = /* @__PURE__ */ "boxSizing.width.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.borderStyle.paddingTop.paddingRight.paddingBottom.paddingLeft.fontStyle.fontVariant.fontWeight.fontStretch.fontSize.lineHeight.fontFamily.textAlign.textTransform.textIndent.letterSpacing.wordSpacing.tabSize.whiteSpace.wordWrap.wordBreak".split(".");
|
|
643
|
+
function bn(e, t, n) {
|
|
644
|
+
return {
|
|
645
|
+
left: e,
|
|
646
|
+
top: t,
|
|
647
|
+
bottom: n,
|
|
648
|
+
right: e,
|
|
649
|
+
width: 0,
|
|
650
|
+
height: n - t,
|
|
651
|
+
x: e,
|
|
652
|
+
y: t,
|
|
653
|
+
toJSON: () => ({})
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
function xn(e, t) {
|
|
657
|
+
let n = e.ownerDocument, r = n.defaultView;
|
|
658
|
+
if (!r) return null;
|
|
659
|
+
let i = e.tagName === "INPUT", a = r.getComputedStyle(e), o = n.createElement("div");
|
|
660
|
+
o.setAttribute("aria-hidden", "true");
|
|
661
|
+
let s = o.style;
|
|
662
|
+
s.position = "absolute", s.visibility = "hidden", s.top = "0", s.left = "0", s.overflow = "hidden", s.whiteSpace = i ? "pre" : "pre-wrap", s.wordWrap = i ? "normal" : "break-word";
|
|
663
|
+
let c = s, l = a;
|
|
664
|
+
for (let e of yn) c[e] = l[e];
|
|
665
|
+
i && (s.width = "auto", s.whiteSpace = "pre");
|
|
666
|
+
let u = e.value, d = u.slice(0, t);
|
|
667
|
+
i && (d = d.replace(/\s/g, "\xA0")), o.textContent = d;
|
|
668
|
+
let f = n.createElement("span");
|
|
669
|
+
f.textContent = u.slice(t) || ".", o.appendChild(f), n.body.appendChild(o);
|
|
670
|
+
let p = f.offsetTop, m = f.offsetLeft;
|
|
671
|
+
n.body.removeChild(o);
|
|
672
|
+
let h = e.getBoundingClientRect(), g = parseFloat(a.borderTopWidth) || 0, _ = parseFloat(a.borderLeftWidth) || 0, v = parseFloat(a.lineHeight) || parseFloat(a.fontSize) || 0, y = h.left + m + _ - e.scrollLeft;
|
|
673
|
+
if (i) return bn(y, h.top, h.bottom);
|
|
674
|
+
let b = h.top + p + g - e.scrollTop;
|
|
675
|
+
return bn(y, b, b + v);
|
|
676
|
+
}
|
|
677
|
+
//#endregion
|
|
678
|
+
//#region src/composables/useMergeTagAutocomplete.ts
|
|
679
|
+
var Sn = /* @__PURE__ */ new Set([
|
|
680
|
+
"ArrowLeft",
|
|
681
|
+
"ArrowRight",
|
|
682
|
+
"Home",
|
|
683
|
+
"End"
|
|
684
|
+
]);
|
|
685
|
+
function Cn(e) {
|
|
686
|
+
let { elementRef: t, modelValue: n, emit: i, mergeTags: o, syntax: s, enabled: c, onInsert: l } = e, d = F(s), f = I(s), p = c && d !== null && o.length > 0, m = E(je, null), h = At((u(m) ? m.value : m)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", Mt()), g = !1;
|
|
687
|
+
r() && a(() => {
|
|
688
|
+
g = !0, h.close();
|
|
689
|
+
});
|
|
690
|
+
function _(e) {
|
|
691
|
+
let t = e.value ?? "";
|
|
692
|
+
return vn(t, e.selectionStart ?? t.length, d, f);
|
|
693
|
+
}
|
|
694
|
+
function v(e, r, a) {
|
|
695
|
+
let o = e.value ?? n(), s = o.slice(r.caret), c = f && s.startsWith(f) ? f.length : 0, u = o.slice(0, r.triggerStart), d = o.slice(r.caret + c), p = u + a.value + d, m = u.length + a.value.length;
|
|
696
|
+
l?.(), i(p), h.close(), T(() => {
|
|
697
|
+
if (g) return;
|
|
698
|
+
let e = t.value;
|
|
699
|
+
e?.focus(), e?.setSelectionRange(m, m);
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
function y() {
|
|
703
|
+
if (!p || g) return;
|
|
704
|
+
let e = t.value;
|
|
705
|
+
if (!e) {
|
|
706
|
+
h.close();
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
let n = _(e);
|
|
710
|
+
if (!n) {
|
|
711
|
+
h.close();
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
let r = jt(o, n.query), i = () => xn(e, n.triggerStart), a = (t) => v(e, n, t);
|
|
715
|
+
h.isOpen() ? h.update({
|
|
716
|
+
items: r,
|
|
717
|
+
getRect: i,
|
|
718
|
+
onCommand: a
|
|
719
|
+
}) : h.open({
|
|
720
|
+
items: r,
|
|
721
|
+
getRect: i,
|
|
722
|
+
anchorEl: e,
|
|
723
|
+
onCommand: a
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
function b(e) {
|
|
727
|
+
return h.isOpen() ? e.key === "Escape" ? (h.close(), !0) : Sn.has(e.key) ? (h.close(), !1) : h.handleKeyDown(e) : !1;
|
|
728
|
+
}
|
|
729
|
+
return {
|
|
730
|
+
available: p,
|
|
731
|
+
refresh: y,
|
|
732
|
+
handleKeydown: b,
|
|
733
|
+
close: () => h.close(),
|
|
734
|
+
isOpen: () => h.isOpen()
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region src/composables/useMergeTagField.ts
|
|
739
|
+
function wn(e) {
|
|
740
|
+
let { modelValue: t, emit: n, elementRef: i } = e, { mergeTags: o, canRequestMergeTag: s, isRequesting: c, isMergeTagValue: l, getMergeTagLabel: u, requestMergeTag: f, syntax: p, autocomplete: m } = yt(), { canInsertLogicTag: h, isRequesting: g, requestLogicTag: _ } = le(), v = d(!1), y = !1, b = !1;
|
|
741
|
+
r() && a(() => {
|
|
742
|
+
b = !0;
|
|
743
|
+
});
|
|
744
|
+
let x = Cn({
|
|
745
|
+
elementRef: i,
|
|
746
|
+
modelValue: t,
|
|
747
|
+
emit: n,
|
|
748
|
+
mergeTags: o,
|
|
749
|
+
syntax: p,
|
|
750
|
+
enabled: m,
|
|
751
|
+
onInsert: () => {
|
|
752
|
+
v.value = !0;
|
|
753
|
+
}
|
|
754
|
+
}), S = C(() => {
|
|
755
|
+
let e = t();
|
|
756
|
+
if (!e) return [];
|
|
757
|
+
let n = [], r = `(${p.value.source}|${p.logic.source})`, i = new RegExp(r, "g"), a = 0, o;
|
|
758
|
+
for (; (o = i.exec(e)) !== null;) {
|
|
759
|
+
o.index > a && n.push({
|
|
760
|
+
type: "text",
|
|
761
|
+
value: e.slice(a, o.index)
|
|
762
|
+
});
|
|
763
|
+
let t = o[0];
|
|
764
|
+
l(t) ? n.push({
|
|
765
|
+
type: "mergeTag",
|
|
766
|
+
value: t,
|
|
767
|
+
label: u(t)
|
|
768
|
+
}) : R(t, p) ? n.push({
|
|
769
|
+
type: "logicMergeTag",
|
|
770
|
+
value: t,
|
|
771
|
+
keyword: te(t, p)
|
|
772
|
+
}) : n.push({
|
|
773
|
+
type: "text",
|
|
774
|
+
value: t
|
|
775
|
+
}), a = o.index + t.length;
|
|
776
|
+
}
|
|
777
|
+
return a < e.length && n.push({
|
|
778
|
+
type: "text",
|
|
779
|
+
value: e.slice(a)
|
|
780
|
+
}), n;
|
|
781
|
+
}), w = C(() => S.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
|
|
782
|
+
function E() {
|
|
783
|
+
v.value = !0, T(() => {
|
|
784
|
+
i.value?.focus();
|
|
785
|
+
let e = t()?.length || 0;
|
|
786
|
+
i.value?.setSelectionRange(e, e);
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
function D() {
|
|
790
|
+
y || (v.value = !1);
|
|
791
|
+
}
|
|
792
|
+
function O(e) {
|
|
793
|
+
n(e.target.value), x.refresh();
|
|
794
|
+
}
|
|
795
|
+
function k(e) {
|
|
796
|
+
if (x.handleKeydown(e)) {
|
|
797
|
+
e.preventDefault();
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
e.key === "Escape" && D();
|
|
801
|
+
}
|
|
802
|
+
function A() {
|
|
803
|
+
x.refresh();
|
|
804
|
+
}
|
|
805
|
+
function j() {
|
|
806
|
+
x.close(), D();
|
|
807
|
+
}
|
|
808
|
+
function M() {
|
|
809
|
+
n("");
|
|
810
|
+
}
|
|
811
|
+
async function N() {
|
|
812
|
+
let e = v.value && i.value ? i.value.selectionStart ?? t().length : t().length;
|
|
813
|
+
y = !0;
|
|
814
|
+
let r;
|
|
815
|
+
try {
|
|
816
|
+
r = await f();
|
|
817
|
+
} finally {
|
|
818
|
+
y = !1;
|
|
819
|
+
}
|
|
820
|
+
if (!b && r) {
|
|
821
|
+
let a = t().slice(0, e), o = t().slice(e), s = a + r.value + o;
|
|
822
|
+
n(s), v.value = !0, T(() => {
|
|
823
|
+
if (b) return;
|
|
824
|
+
let t = e + r.value.length;
|
|
825
|
+
i.value?.focus(), i.value?.setSelectionRange(t, t);
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
async function P() {
|
|
830
|
+
let e = i.value, r = e?.selectionStart ?? t().length, a = e?.selectionEnd ?? r;
|
|
831
|
+
y = !0;
|
|
832
|
+
let o;
|
|
833
|
+
try {
|
|
834
|
+
o = await _();
|
|
835
|
+
} finally {
|
|
836
|
+
y = !1;
|
|
837
|
+
}
|
|
838
|
+
if (b || !o) return;
|
|
839
|
+
let s = t(), c, l;
|
|
840
|
+
"before" in o ? (c = s.slice(0, r) + o.before + s.slice(r, a) + o.after + s.slice(a), l = r + o.before.length + (a - r)) : (c = s.slice(0, r) + o.value + s.slice(r), l = r + o.value.length), n(c), v.value = !0, T(() => {
|
|
841
|
+
b || (i.value?.focus(), i.value?.setSelectionRange(l, l));
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
return {
|
|
845
|
+
segments: S,
|
|
846
|
+
hasMergeTags: w,
|
|
847
|
+
canRequestMergeTag: s,
|
|
848
|
+
isRequestingMergeTag: c,
|
|
849
|
+
canInsertLogicTag: h,
|
|
850
|
+
isRequestingLogicTag: g,
|
|
851
|
+
isEditing: v,
|
|
852
|
+
startEditing: E,
|
|
853
|
+
stopEditing: D,
|
|
854
|
+
handleInput: O,
|
|
855
|
+
handleKeydown: k,
|
|
856
|
+
handleClick: A,
|
|
857
|
+
handleBlur: j,
|
|
858
|
+
clearValue: M,
|
|
859
|
+
insertMergeTag: N,
|
|
860
|
+
insertLogicTag: P,
|
|
861
|
+
autocompleteAvailable: x.available
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
//#endregion
|
|
865
|
+
//#region src/components/MergeTagSegments.vue?vue&type=script&setup=true&lang.ts
|
|
866
|
+
var Tn = ["aria-label", "onKeydown"], En = ["data-tooltip"], Dn = ["data-tooltip"], On = {
|
|
867
|
+
key: 2,
|
|
868
|
+
class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
|
|
869
|
+
}, kn = ["aria-label", "title"], An = /* @__PURE__ */ f({
|
|
870
|
+
__name: "MergeTagSegments",
|
|
871
|
+
props: {
|
|
872
|
+
segments: {},
|
|
873
|
+
displayClass: {},
|
|
874
|
+
pulse: { type: Boolean }
|
|
875
|
+
},
|
|
876
|
+
emits: ["edit", "clear"],
|
|
877
|
+
setup(t, { emit: r }) {
|
|
878
|
+
let i = r, { t: a } = U();
|
|
879
|
+
function o() {
|
|
880
|
+
i("edit");
|
|
881
|
+
}
|
|
882
|
+
return (r, l) => (s(), m("div", {
|
|
883
|
+
role: "button",
|
|
884
|
+
tabindex: "0",
|
|
885
|
+
"aria-label": b(a).mergeTag.clickToEdit,
|
|
886
|
+
class: n([t.displayClass, { "tpl-pulse-fill": t.pulse }]),
|
|
887
|
+
onClick: o,
|
|
888
|
+
onKeydown: [M(o, ["enter"]), M(A(o, ["prevent"]), ["space"])]
|
|
889
|
+
}, [(s(!0), m(S, null, e(t.segments, (e, t) => (s(), m(S, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" ? (s(), m("span", {
|
|
890
|
+
key: 0,
|
|
891
|
+
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",
|
|
892
|
+
"data-tooltip": e.value,
|
|
893
|
+
style: {
|
|
894
|
+
"background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
|
|
895
|
+
color: "var(--tpl-primary)"
|
|
896
|
+
}
|
|
897
|
+
}, c(e.label), 9, En)) : e.type === "logicMergeTag" ? (s(), m("span", {
|
|
898
|
+
key: 1,
|
|
899
|
+
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",
|
|
900
|
+
"data-tooltip": e.value,
|
|
901
|
+
style: {
|
|
902
|
+
"background-color": "transparent",
|
|
903
|
+
border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
|
|
904
|
+
color: "var(--tpl-primary)"
|
|
905
|
+
}
|
|
906
|
+
}, c(e.keyword), 9, Dn)) : (s(), m("span", On, c(e.value), 1))], 64))), 128)), p("button", {
|
|
907
|
+
type: "button",
|
|
908
|
+
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",
|
|
909
|
+
"aria-label": b(a).mergeTag.remove,
|
|
910
|
+
title: b(a).mergeTag.remove,
|
|
911
|
+
onClick: l[0] ||= A((e) => i("clear"), ["stop"])
|
|
912
|
+
}, [g(b(gt), {
|
|
913
|
+
size: 12,
|
|
914
|
+
"stroke-width": 2.5
|
|
915
|
+
})], 8, kn)], 42, Tn));
|
|
916
|
+
}
|
|
917
|
+
}), jn = [
|
|
918
|
+
"aria-label",
|
|
919
|
+
"title",
|
|
920
|
+
"disabled"
|
|
921
|
+
], Mn = "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)]", Nn = /* @__PURE__ */ f({
|
|
922
|
+
__name: "MergeTagInsertButton",
|
|
923
|
+
props: { disabled: { type: Boolean } },
|
|
924
|
+
emits: ["insert"],
|
|
925
|
+
setup(e) {
|
|
926
|
+
let { t } = U();
|
|
927
|
+
return (r, i) => (s(), m("button", {
|
|
928
|
+
type: "button",
|
|
929
|
+
class: n([Mn, "tpl:mt-1.5"]),
|
|
930
|
+
"aria-label": b(t).mergeTag.insert,
|
|
931
|
+
title: b(t).mergeTag.insert,
|
|
932
|
+
disabled: e.disabled,
|
|
933
|
+
onMousedown: i[0] ||= A(() => {}, ["prevent"]),
|
|
934
|
+
onClick: i[1] ||= (e) => r.$emit("insert")
|
|
935
|
+
}, [g(b(Ze), {
|
|
936
|
+
size: 12,
|
|
937
|
+
"stroke-width": 2
|
|
938
|
+
}), y(" " + c(b(t).mergeTag.insertShort), 1)], 42, jn));
|
|
939
|
+
}
|
|
940
|
+
}), Pn = [
|
|
941
|
+
"aria-label",
|
|
942
|
+
"title",
|
|
943
|
+
"disabled"
|
|
944
|
+
], Fn = "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)]", In = /* @__PURE__ */ f({
|
|
945
|
+
__name: "LogicTagInsertButton",
|
|
946
|
+
props: { disabled: { type: Boolean } },
|
|
947
|
+
emits: ["insert"],
|
|
948
|
+
setup(e) {
|
|
949
|
+
let { t } = U();
|
|
950
|
+
return (r, i) => (s(), m("button", {
|
|
951
|
+
type: "button",
|
|
952
|
+
class: n([Fn, "tpl:mt-1.5"]),
|
|
953
|
+
"aria-label": b(t).logicTag.insert,
|
|
954
|
+
title: b(t).logicTag.insert,
|
|
955
|
+
disabled: e.disabled,
|
|
956
|
+
"data-testid": "field-insert-logic-button",
|
|
957
|
+
onMousedown: i[0] ||= A(() => {}, ["prevent"]),
|
|
958
|
+
onClick: i[1] ||= (e) => r.$emit("insert")
|
|
959
|
+
}, [g(b(Xe), {
|
|
960
|
+
size: 12,
|
|
961
|
+
"stroke-width": 2
|
|
962
|
+
}), y(" " + c(b(t).logicTag.insertShort), 1)], 42, Pn));
|
|
963
|
+
}
|
|
964
|
+
}), Ln = { key: 0 }, Rn = {
|
|
965
|
+
key: 0,
|
|
966
|
+
class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
|
|
967
|
+
}, zn = { key: 1 }, Bn = [
|
|
968
|
+
"value",
|
|
969
|
+
"placeholder",
|
|
970
|
+
"rows"
|
|
971
|
+
], Vn = {
|
|
972
|
+
key: 0,
|
|
973
|
+
class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
|
|
974
|
+
}, Hn = "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)]", Un = "tpl:flex tpl:w-full tpl:min-h-20 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)]", Wn = /* @__PURE__ */ f({
|
|
975
|
+
__name: "MergeTagTextarea",
|
|
976
|
+
props: {
|
|
977
|
+
modelValue: {},
|
|
978
|
+
placeholder: { default: "" },
|
|
979
|
+
rows: { default: 3 }
|
|
980
|
+
},
|
|
981
|
+
emits: ["update:modelValue"],
|
|
982
|
+
setup(e, { emit: t }) {
|
|
983
|
+
let r = e, i = t, a = d(null), { segments: o, hasMergeTags: c, canRequestMergeTag: l, isRequestingMergeTag: u, canInsertLogicTag: f, isRequestingLogicTag: h, isEditing: _, startEditing: y, handleInput: x, handleKeydown: S, handleClick: C, handleBlur: T, clearValue: E, insertMergeTag: D, insertLogicTag: O } = wn({
|
|
984
|
+
modelValue: () => r.modelValue,
|
|
985
|
+
emit: (e) => i("update:modelValue", e),
|
|
986
|
+
elementRef: a
|
|
987
|
+
});
|
|
988
|
+
return (t, r) => b(c) && !b(_) ? (s(), m("div", Ln, [g(An, {
|
|
989
|
+
segments: b(o),
|
|
990
|
+
"display-class": Un,
|
|
991
|
+
onEdit: b(y),
|
|
992
|
+
onClear: b(E)
|
|
993
|
+
}, null, 8, [
|
|
994
|
+
"segments",
|
|
995
|
+
"onEdit",
|
|
996
|
+
"onClear"
|
|
997
|
+
]), b(l) || b(f) ? (s(), m("div", Rn, [b(l) ? (s(), v(Nn, {
|
|
998
|
+
key: 0,
|
|
999
|
+
disabled: b(u),
|
|
1000
|
+
onInsert: b(D)
|
|
1001
|
+
}, null, 8, ["disabled", "onInsert"])) : w("", !0), b(f) ? (s(), v(In, {
|
|
1002
|
+
key: 1,
|
|
1003
|
+
disabled: b(h),
|
|
1004
|
+
onInsert: b(O)
|
|
1005
|
+
}, null, 8, ["disabled", "onInsert"])) : w("", !0)])) : w("", !0)])) : (s(), m("div", zn, [p("textarea", {
|
|
1006
|
+
ref_key: "textareaRef",
|
|
1007
|
+
ref: a,
|
|
1008
|
+
class: n(Hn),
|
|
1009
|
+
value: e.modelValue,
|
|
1010
|
+
placeholder: e.placeholder,
|
|
1011
|
+
rows: e.rows,
|
|
1012
|
+
onInput: r[0] ||= (...e) => b(x) && b(x)(...e),
|
|
1013
|
+
onKeydown: r[1] ||= (...e) => b(S) && b(S)(...e),
|
|
1014
|
+
onClick: r[2] ||= (...e) => b(C) && b(C)(...e),
|
|
1015
|
+
onBlur: r[3] ||= (...e) => b(T) && b(T)(...e)
|
|
1016
|
+
}, null, 40, Bn), b(l) || b(f) ? (s(), m("div", Vn, [b(l) ? (s(), v(Nn, {
|
|
1017
|
+
key: 0,
|
|
1018
|
+
disabled: b(u),
|
|
1019
|
+
onInsert: b(D)
|
|
1020
|
+
}, null, 8, ["disabled", "onInsert"])) : w("", !0), b(f) ? (s(), v(In, {
|
|
1021
|
+
key: 1,
|
|
1022
|
+
disabled: b(h),
|
|
1023
|
+
onInsert: b(O)
|
|
1024
|
+
}, null, 8, ["disabled", "onInsert"])) : w("", !0)])) : w("", !0)]));
|
|
1025
|
+
}
|
|
1026
|
+
}), Gn = { class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]" }, Kn = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:gap-3 tpl:overflow-y-auto tpl:p-4" }, qn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Jn = { class: "tpl:mb-3.5" }, Yn = { 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)]" }, Xn = ["onClick"], Zn = { class: "tpl:flex tpl:items-stretch" }, Qn = ["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)]" }, er = { class: "tpl:mb-3.5" }, tr = ["value"], nr = ["value"], rr = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, ir = ["value"], ar = { class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, or = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, sr = { class: "tpl:mt-1 tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, cr = { class: "tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, lr = { class: "tpl:shrink-0 tpl:text-xs tpl:tabular-nums tpl:text-[var(--tpl-text-dim)]" }, ur = { class: "tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3" }, dr = { 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)]" }, fr = { class: "tpl:m-0 tpl:pl-[18px] tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, pr = { class: "tpl:mb-1 tpl:last:mb-0" }, mr = { class: "tpl:mb-1 tpl:last:mb-0" }, hr = { class: "tpl:mb-1 tpl:last:mb-0" }, gr = 150, _r = /* @__PURE__ */ f({
|
|
1027
|
+
__name: "TemplateSettings",
|
|
1028
|
+
props: { settings: {} },
|
|
1029
|
+
emits: ["update"],
|
|
1030
|
+
setup(r, { emit: i }) {
|
|
1031
|
+
let a = r, o = i, { t: l } = U(), u = Ne(Be, "TemplateSettings"), d = C(() => u.fonts.value), f = C(() => d.value.some((e) => e.value === a.settings.fontFamily) ? a.settings.fontFamily : u.defaultFont.value), h = [
|
|
1032
|
+
{
|
|
1033
|
+
value: 480,
|
|
1034
|
+
label: "480px"
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
value: 600,
|
|
1038
|
+
label: "600px"
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
value: 700,
|
|
1042
|
+
label: "700px"
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
value: 800,
|
|
1046
|
+
label: "800px"
|
|
1047
|
+
}
|
|
1048
|
+
];
|
|
1049
|
+
return (i, a) => (s(), m("aside", Gn, [p("div", Kn, [
|
|
1050
|
+
p("div", { class: n(b(Et)) }, [
|
|
1051
|
+
p("div", qn, [g(b(Kt), {
|
|
1052
|
+
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
1053
|
+
size: 14,
|
|
1054
|
+
"stroke-width": 2
|
|
1055
|
+
}), p("span", null, c(b(l).templateSettings.layout), 1)]),
|
|
1056
|
+
p("div", Jn, [p("label", { class: n(b(K)) }, c(b(l).templateSettings.widthPreset), 3), p("div", Yn, [(s(), m(S, null, e(h, (e) => p("button", {
|
|
1057
|
+
key: e.value,
|
|
1058
|
+
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)]",
|
|
1059
|
+
style: t({
|
|
1060
|
+
backgroundColor: r.settings.width === e.value ? "var(--tpl-bg)" : "transparent",
|
|
1061
|
+
color: r.settings.width === e.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
1062
|
+
boxShadow: r.settings.width === e.value ? "var(--tpl-shadow)" : "none"
|
|
1063
|
+
}),
|
|
1064
|
+
onClick: (t) => o("update", { width: e.value })
|
|
1065
|
+
}, c(e.label), 13, Xn)), 64))])]),
|
|
1066
|
+
p("div", null, [p("label", { class: n(b(K)) }, c(b(l).templateSettings.customWidth), 3), p("div", Zn, [p("input", {
|
|
1067
|
+
type: "number",
|
|
1068
|
+
class: n(b(J)),
|
|
1069
|
+
value: r.settings.width,
|
|
1070
|
+
min: "300",
|
|
1071
|
+
max: "900",
|
|
1072
|
+
onInput: a[0] ||= (e) => o("update", { width: Number(e.target.value) })
|
|
1073
|
+
}, null, 42, Qn), p("span", { class: n(b(q)) }, "px", 2)])])
|
|
1074
|
+
], 2),
|
|
1075
|
+
p("div", { class: n(b(Et)) }, [
|
|
1076
|
+
p("div", $n, [g(b(Pt), {
|
|
1077
|
+
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
1078
|
+
size: 14,
|
|
1079
|
+
"stroke-width": 2
|
|
1080
|
+
}), p("span", null, c(b(l).templateSettings.appearance), 1)]),
|
|
1081
|
+
p("div", er, [p("label", { class: n(b(K)) }, c(b(l).templateSettings.backgroundColor), 3), g(Y, {
|
|
1082
|
+
"model-value": r.settings.backgroundColor,
|
|
1083
|
+
placeholder: b(Ot),
|
|
1084
|
+
"onUpdate:modelValue": a[1] ||= (e) => o("update", { backgroundColor: e })
|
|
1085
|
+
}, null, 8, ["model-value", "placeholder"])]),
|
|
1086
|
+
p("div", null, [p("label", { class: n(b(K)) }, c(b(l).templateSettings.fontFamily), 3), p("select", {
|
|
1087
|
+
class: n(b(G)),
|
|
1088
|
+
value: f.value,
|
|
1089
|
+
onChange: a[2] ||= (e) => o("update", { fontFamily: e.target.value })
|
|
1090
|
+
}, [(s(!0), m(S, null, e(d.value, (e) => (s(), m("option", {
|
|
1091
|
+
key: e.value,
|
|
1092
|
+
value: e.value
|
|
1093
|
+
}, c(e.label), 9, nr))), 128))], 42, tr)])
|
|
1094
|
+
], 2),
|
|
1095
|
+
p("div", { class: n(b(Et)) }, [p("div", rr, [g(b(Ft), {
|
|
1096
|
+
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
1097
|
+
size: 14,
|
|
1098
|
+
"stroke-width": 2
|
|
1099
|
+
}), p("span", null, c(b(l).templateSettings.language), 1)]), p("div", null, [
|
|
1100
|
+
p("label", { class: n(b(K)) }, c(b(l).templateSettings.contentLocale), 3),
|
|
1101
|
+
p("input", {
|
|
1102
|
+
type: "text",
|
|
1103
|
+
class: n(b(G)),
|
|
1104
|
+
value: r.settings.locale ?? "",
|
|
1105
|
+
placeholder: "en",
|
|
1106
|
+
spellcheck: "false",
|
|
1107
|
+
autocapitalize: "off",
|
|
1108
|
+
autocomplete: "off",
|
|
1109
|
+
onInput: a[3] ||= (e) => o("update", { locale: e.target.value.trim() || void 0 })
|
|
1110
|
+
}, null, 42, ir),
|
|
1111
|
+
p("p", ar, c(b(l).templateSettings.contentLocaleHint), 1)
|
|
1112
|
+
])], 2),
|
|
1113
|
+
p("div", { class: n(b(Et)) }, [p("div", or, [g(b(it), {
|
|
1114
|
+
class: "tpl:text-[var(--tpl-text-muted)]",
|
|
1115
|
+
size: 14,
|
|
1116
|
+
"stroke-width": 2
|
|
1117
|
+
}), p("span", null, c(b(l).templateSettings.preheaderText), 1)]), p("div", null, [g(Wn, {
|
|
1118
|
+
"model-value": r.settings.preheaderText ?? "",
|
|
1119
|
+
placeholder: b(l).templateSettings.preheaderTextPlaceholder,
|
|
1120
|
+
rows: 2,
|
|
1121
|
+
"onUpdate:modelValue": a[4] ||= (e) => o("update", { preheaderText: e.replace(/[\r\n]/g, " ") || void 0 })
|
|
1122
|
+
}, null, 8, ["model-value", "placeholder"]), p("div", sr, [p("span", cr, c(b(l).templateSettings.preheaderTextHint), 1), p("span", lr, c((r.settings.preheaderText ?? "").length) + "/" + c(gr), 1)])])], 2),
|
|
1123
|
+
p("div", ur, [p("div", dr, [g(b(st), {
|
|
1124
|
+
size: 14,
|
|
1125
|
+
"stroke-width": 2
|
|
1126
|
+
}), p("span", null, c(b(l).templateSettings.tips), 1)]), p("ul", fr, [
|
|
1127
|
+
p("li", pr, c(b(l).templateSettings.tip1), 1),
|
|
1128
|
+
p("li", mr, c(b(l).templateSettings.tip2), 1),
|
|
1129
|
+
p("li", hr, c(b(l).templateSettings.tip3), 1)
|
|
1130
|
+
])])
|
|
1131
|
+
])]));
|
|
1132
|
+
}
|
|
1133
|
+
}), vr = { key: 0 }, yr = {
|
|
1134
|
+
key: 0,
|
|
1135
|
+
class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
|
|
1136
|
+
}, br = { key: 1 }, xr = [
|
|
1137
|
+
"type",
|
|
1138
|
+
"value",
|
|
1139
|
+
"placeholder"
|
|
1140
|
+
], Sr = {
|
|
1141
|
+
key: 0,
|
|
1142
|
+
class: "tpl:flex tpl:flex-wrap tpl:gap-1.5"
|
|
1143
|
+
}, Cr = "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)]", $ = /*#__PURE__*/ _t(/* @__PURE__ */ f({
|
|
1144
|
+
__name: "MergeTagInput",
|
|
1145
|
+
props: {
|
|
1146
|
+
modelValue: {},
|
|
1147
|
+
type: { default: "text" },
|
|
1148
|
+
placeholder: { default: "" },
|
|
1149
|
+
pulse: {
|
|
1150
|
+
type: Boolean,
|
|
1151
|
+
default: !1
|
|
1152
|
+
}
|
|
1153
|
+
},
|
|
1154
|
+
emits: ["update:modelValue"],
|
|
1155
|
+
setup(e, { emit: t }) {
|
|
1156
|
+
let r = e, i = t, a = d(null), { segments: o, hasMergeTags: c, canRequestMergeTag: l, isRequestingMergeTag: u, canInsertLogicTag: f, isRequestingLogicTag: h, isEditing: _, startEditing: y, handleInput: x, handleKeydown: S, handleClick: C, handleBlur: T, clearValue: E, insertMergeTag: D, insertLogicTag: O } = wn({
|
|
1157
|
+
modelValue: () => r.modelValue,
|
|
1158
|
+
emit: (e) => i("update:modelValue", e),
|
|
1159
|
+
elementRef: a
|
|
1160
|
+
});
|
|
1161
|
+
return (t, r) => b(c) && !b(_) ? (s(), m("div", vr, [g(An, {
|
|
1162
|
+
segments: b(o),
|
|
1163
|
+
"display-class": Cr,
|
|
1164
|
+
pulse: e.pulse,
|
|
1165
|
+
onEdit: b(y),
|
|
1166
|
+
onClear: b(E)
|
|
1167
|
+
}, null, 8, [
|
|
1168
|
+
"segments",
|
|
1169
|
+
"pulse",
|
|
1170
|
+
"onEdit",
|
|
1171
|
+
"onClear"
|
|
1172
|
+
]), b(l) || b(f) ? (s(), m("div", yr, [b(l) ? (s(), v(Nn, {
|
|
1173
|
+
key: 0,
|
|
1174
|
+
disabled: b(u),
|
|
1175
|
+
onInsert: b(D)
|
|
1176
|
+
}, null, 8, ["disabled", "onInsert"])) : w("", !0), b(f) ? (s(), v(In, {
|
|
1177
|
+
key: 1,
|
|
1178
|
+
disabled: b(h),
|
|
1179
|
+
onInsert: b(O)
|
|
1180
|
+
}, null, 8, ["disabled", "onInsert"])) : w("", !0)])) : w("", !0)])) : (s(), m("div", br, [p("input", {
|
|
1181
|
+
ref_key: "inputRef",
|
|
1182
|
+
ref: a,
|
|
1183
|
+
type: e.type,
|
|
1184
|
+
class: n([b(G), { "tpl-pulse-fill": e.pulse }]),
|
|
1185
|
+
value: e.modelValue,
|
|
1186
|
+
placeholder: e.placeholder,
|
|
1187
|
+
onInput: r[0] ||= (...e) => b(x) && b(x)(...e),
|
|
1188
|
+
onKeydown: r[1] ||= (...e) => b(S) && b(S)(...e),
|
|
1189
|
+
onClick: r[2] ||= (...e) => b(C) && b(C)(...e),
|
|
1190
|
+
onBlur: r[3] ||= (...e) => b(T) && b(T)(...e)
|
|
1191
|
+
}, null, 42, xr), b(l) || b(f) ? (s(), m("div", Sr, [b(l) ? (s(), v(Nn, {
|
|
1192
|
+
key: 0,
|
|
1193
|
+
disabled: b(u),
|
|
1194
|
+
onInsert: b(D)
|
|
1195
|
+
}, null, 8, ["disabled", "onInsert"])) : w("", !0), b(f) ? (s(), v(In, {
|
|
1196
|
+
key: 1,
|
|
1197
|
+
disabled: b(h),
|
|
1198
|
+
onInsert: b(O)
|
|
1199
|
+
}, null, 8, ["disabled", "onInsert"])) : w("", !0)])) : w("", !0)]));
|
|
1200
|
+
}
|
|
1201
|
+
}), [["__scopeId", "data-v-d6563be6"]]), wr = { class: "tpl:mb-3.5" }, Tr = ["value"], Er = { value: "" }, Dr = ["value"], Or = { class: "tpl:mb-3.5" }, kr = { class: "tpl:mb-3.5" }, Ar = {
|
|
1202
|
+
key: 0,
|
|
1203
|
+
class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
|
|
1204
|
+
}, jr = ["checked"], Mr = { class: "tpl:mb-3.5" }, Nr = { class: "tpl:mb-3.5" }, Pr = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, Fr = { class: "tpl:mb-3.5" }, Ir = { class: "tpl:flex tpl:items-stretch" }, Lr = ["value"], Rr = { class: "tpl:mb-3.5" }, zr = { class: "tpl:flex tpl:items-stretch" }, Br = ["value"], Vr = { class: "tpl:mb-3.5" }, Hr = ["value"], Ur = { value: "auto" }, Wr = { value: "full" }, Gr = { value: "custom" }, Kr = {
|
|
1205
|
+
key: 0,
|
|
1206
|
+
class: "tpl:mt-2 tpl:flex tpl:items-stretch"
|
|
1207
|
+
}, qr = ["value"], Jr = 200, Yr = /* @__PURE__ */ f({
|
|
1208
|
+
__name: "ButtonToolbar",
|
|
1209
|
+
props: {
|
|
1210
|
+
block: {},
|
|
1211
|
+
fontFamilies: {}
|
|
1212
|
+
},
|
|
1213
|
+
emits: ["update"],
|
|
1214
|
+
setup(t, { emit: r }) {
|
|
1215
|
+
let i = t, a = r, { t: o } = U(), l = C(() => i.block.width === "full" ? "full" : typeof i.block.width == "number" ? "custom" : "auto");
|
|
1216
|
+
function u(e, t) {
|
|
1217
|
+
a("update", { [e]: t });
|
|
1218
|
+
}
|
|
1219
|
+
function d(e) {
|
|
1220
|
+
if (e === "full") {
|
|
1221
|
+
u("width", "full");
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
1224
|
+
if (e === "custom") {
|
|
1225
|
+
u("width", typeof i.block.width == "number" ? i.block.width : Jr);
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
u("width", void 0);
|
|
1229
|
+
}
|
|
1230
|
+
function f(e) {
|
|
1231
|
+
let t = Number(e);
|
|
1232
|
+
!Number.isFinite(t) || t <= 0 || u("width", t);
|
|
1233
|
+
}
|
|
1234
|
+
return (r, i) => (s(), m(S, null, [
|
|
1235
|
+
p("div", wr, [p("label", { class: n(b(K)) }, c(b(o).button.fontFamily), 3), p("select", {
|
|
1236
|
+
class: n(b(G)),
|
|
1237
|
+
value: t.block.fontFamily || "",
|
|
1238
|
+
onChange: i[0] ||= (e) => u("fontFamily", e.target.value || void 0)
|
|
1239
|
+
}, [p("option", Er, c(b(o).button.inheritFont), 1), (s(!0), m(S, null, e(t.fontFamilies, (e) => (s(), m("option", {
|
|
1240
|
+
key: e.value,
|
|
1241
|
+
value: e.value
|
|
1242
|
+
}, c(e.label), 9, Dr))), 128))], 42, Tr)]),
|
|
1243
|
+
p("div", Or, [p("label", { class: n(b(K)) }, c(b(o).button.text), 3), g($, {
|
|
1244
|
+
"model-value": t.block.text,
|
|
1245
|
+
type: "text",
|
|
1246
|
+
"onUpdate:modelValue": i[1] ||= (e) => u("text", e)
|
|
1247
|
+
}, null, 8, ["model-value"])]),
|
|
1248
|
+
p("div", kr, [
|
|
1249
|
+
p("label", { class: n(b(K)) }, c(b(o).button.url), 3),
|
|
1250
|
+
g($, {
|
|
1251
|
+
"model-value": t.block.url,
|
|
1252
|
+
type: "url",
|
|
1253
|
+
placeholder: b(o).button.urlPlaceholder,
|
|
1254
|
+
"onUpdate:modelValue": i[2] ||= (e) => u("url", e)
|
|
1255
|
+
}, null, 8, ["model-value", "placeholder"]),
|
|
1256
|
+
t.block.url ? (s(), m("label", Ar, [p("input", {
|
|
1257
|
+
type: "checkbox",
|
|
1258
|
+
class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
|
|
1259
|
+
checked: t.block.openInNewTab ?? !1,
|
|
1260
|
+
onChange: i[3] ||= (e) => u("openInNewTab", e.target.checked)
|
|
1261
|
+
}, null, 40, jr), y(" " + c(b(o).button.openInNewTab), 1)])) : w("", !0)
|
|
1262
|
+
]),
|
|
1263
|
+
p("div", Mr, [p("label", { class: n(b(K)) }, c(b(o).button.background), 3), g(Y, {
|
|
1264
|
+
"model-value": t.block.backgroundColor,
|
|
1265
|
+
"onUpdate:modelValue": i[4] ||= (e) => u("backgroundColor", e)
|
|
1266
|
+
}, null, 8, ["model-value"])]),
|
|
1267
|
+
p("div", Nr, [p("label", { class: n(b(K)) }, c(b(o).button.textColor), 3), g(Y, {
|
|
1268
|
+
"model-value": t.block.textColor,
|
|
1269
|
+
"onUpdate:modelValue": i[5] ||= (e) => u("textColor", e)
|
|
1270
|
+
}, null, 8, ["model-value"])]),
|
|
1271
|
+
p("div", Pr, [p("div", Fr, [p("label", { class: n(b(K)) }, c(b(o).button.borderRadius), 3), p("div", Ir, [p("input", {
|
|
1272
|
+
type: "number",
|
|
1273
|
+
class: n(b(J)),
|
|
1274
|
+
value: t.block.borderRadius,
|
|
1275
|
+
min: "0",
|
|
1276
|
+
max: "50",
|
|
1277
|
+
onInput: i[6] ||= (e) => u("borderRadius", Number(e.target.value))
|
|
1278
|
+
}, null, 42, Lr), p("span", { class: n(b(q)) }, "px", 2)])]), p("div", Rr, [p("label", { class: n(b(K)) }, c(b(o).button.fontSize), 3), p("div", zr, [p("input", {
|
|
1279
|
+
type: "number",
|
|
1280
|
+
class: n(b(J)),
|
|
1281
|
+
value: t.block.fontSize,
|
|
1282
|
+
min: "10",
|
|
1283
|
+
max: "36",
|
|
1284
|
+
onInput: i[7] ||= (e) => u("fontSize", Number(e.target.value))
|
|
1285
|
+
}, null, 42, Br), p("span", { class: n(b(q)) }, "px", 2)])])]),
|
|
1286
|
+
p("div", Vr, [
|
|
1287
|
+
p("label", { class: n(b(K)) }, c(b(o).button.width), 3),
|
|
1288
|
+
p("select", {
|
|
1289
|
+
class: n(b(G)),
|
|
1290
|
+
value: l.value,
|
|
1291
|
+
onChange: i[8] ||= (e) => d(e.target.value)
|
|
1292
|
+
}, [
|
|
1293
|
+
p("option", Ur, c(b(o).button.widthAuto), 1),
|
|
1294
|
+
p("option", Wr, c(b(o).button.fullWidth), 1),
|
|
1295
|
+
p("option", Gr, c(b(o).button.widthCustom), 1)
|
|
1296
|
+
], 42, Hr),
|
|
1297
|
+
l.value === "custom" ? (s(), m("div", Kr, [p("input", {
|
|
1298
|
+
type: "number",
|
|
1299
|
+
class: n(b(J)),
|
|
1300
|
+
value: typeof t.block.width == "number" ? t.block.width : Jr,
|
|
1301
|
+
min: "20",
|
|
1302
|
+
onInput: i[9] ||= (e) => f(e.target.value)
|
|
1303
|
+
}, null, 42, qr), p("span", { class: n(b(q)) }, "px", 2)])) : w("", !0)
|
|
1304
|
+
])
|
|
1305
|
+
], 64));
|
|
1306
|
+
}
|
|
1307
|
+
}), Xr = { class: "spacing-control" }, Zr = { class: "tpl:mb-2 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Qr = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5" }, $r = { class: "tpl:flex tpl:items-center" }, ei = ["aria-label"], ti = ["value", "aria-label"], ni = ["aria-label"], ri = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ii = { class: "tpl:flex tpl:items-center" }, ai = ["aria-label"], oi = ["value", "aria-label"], si = ["aria-label"], ci = ["aria-label", "title"], li = { class: "tpl:flex tpl:items-center" }, ui = ["aria-label"], di = ["value", "aria-label"], fi = ["aria-label"], pi = { class: "tpl:flex tpl:items-center" }, mi = ["aria-label"], hi = ["value", "aria-label"], gi = ["aria-label"], _i = "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)]", vi = "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)]", yi = /*#__PURE__*/ _t(/* @__PURE__ */ f({
|
|
1308
|
+
__name: "SpacingControl",
|
|
1309
|
+
props: {
|
|
1310
|
+
modelValue: {},
|
|
1311
|
+
label: {}
|
|
1312
|
+
},
|
|
1313
|
+
emits: ["update:modelValue"],
|
|
1314
|
+
setup(e, { emit: t }) {
|
|
1315
|
+
let r = e, a = t, { t: o } = U(), l = C(() => r.modelValue.top === r.modelValue.right && r.modelValue.right === r.modelValue.bottom && r.modelValue.bottom === r.modelValue.left), u = d(l.value);
|
|
1316
|
+
i(l, (e) => {
|
|
1317
|
+
!e && u.value && (u.value = !1);
|
|
1318
|
+
});
|
|
1319
|
+
function f(e, t) {
|
|
1320
|
+
let n = r.modelValue[e], i = Math.max(0, n + t);
|
|
1321
|
+
u.value ? a("update:modelValue", {
|
|
1322
|
+
top: i,
|
|
1323
|
+
right: i,
|
|
1324
|
+
bottom: i,
|
|
1325
|
+
left: i
|
|
1326
|
+
}) : a("update:modelValue", {
|
|
1327
|
+
...r.modelValue,
|
|
1328
|
+
[e]: i
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
function h(e, t) {
|
|
1332
|
+
let n = Math.max(0, t);
|
|
1333
|
+
u.value ? a("update:modelValue", {
|
|
1334
|
+
top: n,
|
|
1335
|
+
right: n,
|
|
1336
|
+
bottom: n,
|
|
1337
|
+
left: n
|
|
1338
|
+
}) : a("update:modelValue", {
|
|
1339
|
+
...r.modelValue,
|
|
1340
|
+
[e]: n
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
function _() {
|
|
1344
|
+
if (u.value = !u.value, u.value) {
|
|
1345
|
+
let e = r.modelValue.top;
|
|
1346
|
+
a("update:modelValue", {
|
|
1347
|
+
top: e,
|
|
1348
|
+
right: e,
|
|
1349
|
+
bottom: e,
|
|
1350
|
+
left: e
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
return (t, r) => (s(), m("div", Xr, [p("label", Zr, c(e.label), 1), p("div", Qr, [
|
|
1355
|
+
p("div", $r, [
|
|
1356
|
+
p("button", {
|
|
1357
|
+
"aria-label": b(o).spacingControl.decreaseTop,
|
|
1358
|
+
class: n([_i, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1359
|
+
onClick: r[0] ||= (e) => f("top", -1)
|
|
1360
|
+
}, [g(b(et), {
|
|
1361
|
+
size: 12,
|
|
1362
|
+
"stroke-width": 2
|
|
1363
|
+
})], 10, ei),
|
|
1364
|
+
p("input", {
|
|
1365
|
+
type: "number",
|
|
1366
|
+
class: n(vi),
|
|
1367
|
+
value: e.modelValue.top,
|
|
1368
|
+
"aria-label": b(o).spacingControl.top,
|
|
1369
|
+
min: "0",
|
|
1370
|
+
onInput: r[1] ||= (e) => h("top", Number(e.target.value))
|
|
1371
|
+
}, null, 40, ti),
|
|
1372
|
+
p("button", {
|
|
1373
|
+
"aria-label": b(o).spacingControl.increaseTop,
|
|
1374
|
+
class: n([_i, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1375
|
+
onClick: r[2] ||= (e) => f("top", 1)
|
|
1376
|
+
}, [g(b(Q), {
|
|
1377
|
+
size: 12,
|
|
1378
|
+
"stroke-width": 2
|
|
1379
|
+
})], 10, ni)
|
|
1380
|
+
]),
|
|
1381
|
+
p("div", ri, [
|
|
1382
|
+
p("div", ii, [
|
|
1383
|
+
p("button", {
|
|
1384
|
+
"aria-label": b(o).spacingControl.decreaseLeft,
|
|
1385
|
+
class: n([_i, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1386
|
+
onClick: r[3] ||= (e) => f("left", -1)
|
|
1387
|
+
}, [g(b(et), {
|
|
1388
|
+
size: 12,
|
|
1389
|
+
"stroke-width": 2
|
|
1390
|
+
})], 10, ai),
|
|
1391
|
+
p("input", {
|
|
1392
|
+
type: "number",
|
|
1393
|
+
class: n(vi),
|
|
1394
|
+
value: e.modelValue.left,
|
|
1395
|
+
"aria-label": b(o).spacingControl.left,
|
|
1396
|
+
min: "0",
|
|
1397
|
+
onInput: r[4] ||= (e) => h("left", Number(e.target.value))
|
|
1398
|
+
}, null, 40, oi),
|
|
1399
|
+
p("button", {
|
|
1400
|
+
"aria-label": b(o).spacingControl.increaseLeft,
|
|
1401
|
+
class: n([_i, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1402
|
+
onClick: r[5] ||= (e) => f("left", 1)
|
|
1403
|
+
}, [g(b(Q), {
|
|
1404
|
+
size: 12,
|
|
1405
|
+
"stroke-width": 2
|
|
1406
|
+
})], 10, si)
|
|
1407
|
+
]),
|
|
1408
|
+
p("button", {
|
|
1409
|
+
class: n(["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)]", u.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)]"]),
|
|
1410
|
+
"aria-label": u.value ? b(o).spacingControl.unlock : b(o).spacingControl.lockAll,
|
|
1411
|
+
title: u.value ? b(o).spacingControl.unlock : b(o).spacingControl.lockAll,
|
|
1412
|
+
onClick: _
|
|
1413
|
+
}, [u.value ? (s(), v(b(Rt), {
|
|
1414
|
+
key: 0,
|
|
1415
|
+
size: 14,
|
|
1416
|
+
"stroke-width": 2
|
|
1417
|
+
})) : (s(), v(b(Lt), {
|
|
1418
|
+
key: 1,
|
|
1419
|
+
size: 14,
|
|
1420
|
+
"stroke-width": 2
|
|
1421
|
+
}))], 10, ci),
|
|
1422
|
+
p("div", li, [
|
|
1423
|
+
p("button", {
|
|
1424
|
+
"aria-label": b(o).spacingControl.decreaseRight,
|
|
1425
|
+
class: n([_i, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1426
|
+
onClick: r[6] ||= (e) => f("right", -1)
|
|
1427
|
+
}, [g(b(et), {
|
|
1428
|
+
size: 12,
|
|
1429
|
+
"stroke-width": 2
|
|
1430
|
+
})], 10, ui),
|
|
1431
|
+
p("input", {
|
|
1432
|
+
type: "number",
|
|
1433
|
+
class: n(vi),
|
|
1434
|
+
value: e.modelValue.right,
|
|
1435
|
+
"aria-label": b(o).spacingControl.right,
|
|
1436
|
+
min: "0",
|
|
1437
|
+
onInput: r[7] ||= (e) => h("right", Number(e.target.value))
|
|
1438
|
+
}, null, 40, di),
|
|
1439
|
+
p("button", {
|
|
1440
|
+
"aria-label": b(o).spacingControl.increaseRight,
|
|
1441
|
+
class: n([_i, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1442
|
+
onClick: r[8] ||= (e) => f("right", 1)
|
|
1443
|
+
}, [g(b(Q), {
|
|
1444
|
+
size: 12,
|
|
1445
|
+
"stroke-width": 2
|
|
1446
|
+
})], 10, fi)
|
|
1447
|
+
])
|
|
1448
|
+
]),
|
|
1449
|
+
p("div", pi, [
|
|
1450
|
+
p("button", {
|
|
1451
|
+
"aria-label": b(o).spacingControl.decreaseBottom,
|
|
1452
|
+
class: n([_i, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
|
|
1453
|
+
onClick: r[9] ||= (e) => f("bottom", -1)
|
|
1454
|
+
}, [g(b(et), {
|
|
1455
|
+
size: 12,
|
|
1456
|
+
"stroke-width": 2
|
|
1457
|
+
})], 10, mi),
|
|
1458
|
+
p("input", {
|
|
1459
|
+
type: "number",
|
|
1460
|
+
class: n(vi),
|
|
1461
|
+
value: e.modelValue.bottom,
|
|
1462
|
+
"aria-label": b(o).spacingControl.bottom,
|
|
1463
|
+
min: "0",
|
|
1464
|
+
onInput: r[10] ||= (e) => h("bottom", Number(e.target.value))
|
|
1465
|
+
}, null, 40, hi),
|
|
1466
|
+
p("button", {
|
|
1467
|
+
"aria-label": b(o).spacingControl.increaseBottom,
|
|
1468
|
+
class: n([_i, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
|
|
1469
|
+
onClick: r[11] ||= (e) => f("bottom", 1)
|
|
1470
|
+
}, [g(b(Q), {
|
|
1471
|
+
size: 12,
|
|
1472
|
+
"stroke-width": 2
|
|
1473
|
+
})], 10, gi)
|
|
1474
|
+
])
|
|
1475
|
+
])]));
|
|
1476
|
+
}
|
|
1477
|
+
}), [["__scopeId", "data-v-9a9c8a07"]]), bi = { class: "tpl:mt-3" }, xi = /* @__PURE__ */ f({
|
|
1478
|
+
__name: "CollapsibleSection",
|
|
1479
|
+
props: {
|
|
1480
|
+
title: {},
|
|
1481
|
+
open: { type: Boolean },
|
|
1482
|
+
noBorder: { type: Boolean }
|
|
1483
|
+
},
|
|
1484
|
+
emits: ["toggle"],
|
|
1485
|
+
setup(e) {
|
|
1486
|
+
return (t, r) => (s(), m("div", { class: n(["tpl:py-3", e.noBorder ? "" : "tpl:border-t tpl:border-[var(--tpl-border)]"]) }, [p("button", {
|
|
1487
|
+
type: "button",
|
|
1488
|
+
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)]",
|
|
1489
|
+
onClick: r[0] ||= (e) => t.$emit("toggle")
|
|
1490
|
+
}, [g(b(Qe), {
|
|
1491
|
+
class: n(["tpl:transition-transform tpl:duration-200", e.open ? "tpl:rotate-0" : "tpl:-rotate-90"]),
|
|
1492
|
+
size: 12,
|
|
1493
|
+
"stroke-width": 2
|
|
1494
|
+
}, null, 8, ["class"]), p("span", null, c(e.title), 1)]), O(p("div", bi, [_(t.$slots, "default")], 512), [[j, e.open]])], 2));
|
|
1495
|
+
}
|
|
1496
|
+
}), Si = { class: "tpl:space-y-2" }, Ci = ["checked", "onChange"], wi = { class: "tpl:space-y-2" }, Ti = ["value"], Ei = { value: "" }, Di = ["label"], Oi = ["value"], ki = ["value"], Ai = {
|
|
1497
|
+
key: 0,
|
|
1498
|
+
value: "__custom__"
|
|
1499
|
+
}, ji = {
|
|
1500
|
+
key: 0,
|
|
1501
|
+
class: "tpl:space-y-2"
|
|
1502
|
+
}, Mi = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Ni = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Pi = { class: "tpl:flex tpl:justify-end" }, Fi = ["disabled"], Ii = {
|
|
1503
|
+
key: 0,
|
|
1504
|
+
class: "tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]"
|
|
1505
|
+
}, Li = { class: "tpl:space-y-1" }, Ri = { 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)]" }, zi = {
|
|
1506
|
+
key: 0,
|
|
1507
|
+
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)]"
|
|
1508
|
+
}, Bi = /* @__PURE__ */ f({
|
|
1509
|
+
__name: "CommonBlockSettings",
|
|
1510
|
+
props: {
|
|
1511
|
+
block: {},
|
|
1512
|
+
isFirstSection: { type: Boolean }
|
|
1513
|
+
},
|
|
1514
|
+
emits: ["update"],
|
|
1515
|
+
setup(t, { emit: r }) {
|
|
1516
|
+
let a = t, u = r, { t: f } = U(), h = E(Ge, []), _ = E(Ue, !1), T = x(/* @__PURE__ */ new Set()), D = d(!1), A = d(""), j = d(""), M = [{
|
|
1517
|
+
key: "desktop",
|
|
1518
|
+
icon: zt,
|
|
1519
|
+
labelKey: "showOnDesktop"
|
|
1520
|
+
}, {
|
|
1521
|
+
key: "mobile",
|
|
1522
|
+
icon: Wt,
|
|
1523
|
+
labelKey: "showOnMobile"
|
|
1524
|
+
}];
|
|
1525
|
+
function N(e) {
|
|
1526
|
+
T.has(e) ? T.delete(e) : T.add(e);
|
|
1527
|
+
}
|
|
1528
|
+
let P = C(() => h.length > 0 || _), F = C(() => a.block.displayCondition ? !h.some((e) => e.label === a.block.displayCondition?.label) : !1);
|
|
1529
|
+
function I() {
|
|
1530
|
+
D.value = !0, F.value && a.block.displayCondition ? (A.value = a.block.displayCondition.before, j.value = a.block.displayCondition.after ?? "") : (A.value = "", j.value = "");
|
|
1531
|
+
}
|
|
1532
|
+
function L() {
|
|
1533
|
+
A.value.trim() && (u("update", { displayCondition: {
|
|
1534
|
+
label: f.blockSettings.customCondition,
|
|
1535
|
+
before: A.value.trim(),
|
|
1536
|
+
after: j.value.trim()
|
|
1537
|
+
} }), D.value = !1, A.value = "", j.value = "");
|
|
1538
|
+
}
|
|
1539
|
+
i(() => a.block.displayCondition, (e) => {
|
|
1540
|
+
if (!e) {
|
|
1541
|
+
D.value = !1, A.value = "", j.value = "";
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
F.value && (A.value = e.before, j.value = e.after ?? "");
|
|
1545
|
+
}, { immediate: !0 });
|
|
1546
|
+
let R = C(() => {
|
|
1547
|
+
let e = {};
|
|
1548
|
+
for (let t of h) {
|
|
1549
|
+
let n = t.group ?? "";
|
|
1550
|
+
e[n] || (e[n] = []), e[n].push(t);
|
|
1551
|
+
}
|
|
1552
|
+
return e;
|
|
1553
|
+
});
|
|
1554
|
+
function z(e, t) {
|
|
1555
|
+
u("update", { styles: {
|
|
1556
|
+
...a.block.styles,
|
|
1557
|
+
[e]: t
|
|
1558
|
+
} });
|
|
1559
|
+
}
|
|
1560
|
+
function B(e) {
|
|
1561
|
+
return a.block.visibility?.[e] !== !1;
|
|
1562
|
+
}
|
|
1563
|
+
function V(e) {
|
|
1564
|
+
let t = {
|
|
1565
|
+
desktop: B("desktop"),
|
|
1566
|
+
mobile: B("mobile")
|
|
1567
|
+
};
|
|
1568
|
+
t[e] = !t[e], u("update", { visibility: t });
|
|
1569
|
+
}
|
|
1570
|
+
return (r, i) => (s(), m("div", { class: n(["tpl:flex tpl:flex-col", t.isFirstSection ? "" : "tpl:mt-4"]) }, [
|
|
1571
|
+
g(xi, {
|
|
1572
|
+
title: b(f).blockSettings.spacing,
|
|
1573
|
+
open: T.has("spacing"),
|
|
1574
|
+
"no-border": t.isFirstSection,
|
|
1575
|
+
onToggle: i[1] ||= (e) => N("spacing")
|
|
1576
|
+
}, {
|
|
1577
|
+
default: l(() => [g(yi, {
|
|
1578
|
+
label: b(f).blockSettings.padding,
|
|
1579
|
+
"model-value": t.block.styles.padding,
|
|
1580
|
+
"onUpdate:modelValue": i[0] ||= (e) => z("padding", e)
|
|
1581
|
+
}, null, 8, ["label", "model-value"])]),
|
|
1582
|
+
_: 1
|
|
1583
|
+
}, 8, [
|
|
1584
|
+
"title",
|
|
1585
|
+
"open",
|
|
1586
|
+
"no-border"
|
|
1587
|
+
]),
|
|
1588
|
+
g(xi, {
|
|
1589
|
+
title: b(f).blockSettings.background,
|
|
1590
|
+
open: T.has("bg"),
|
|
1591
|
+
onToggle: i[3] ||= (e) => N("bg")
|
|
1592
|
+
}, {
|
|
1593
|
+
default: l(() => [p("label", { class: n(b(K)) }, c(b(f).blockSettings.color), 3), g(Y, {
|
|
1594
|
+
"model-value": t.block.styles.backgroundColor ?? "",
|
|
1595
|
+
"onUpdate:modelValue": i[2] ||= (e) => z("backgroundColor", e)
|
|
1596
|
+
}, null, 8, ["model-value"])]),
|
|
1597
|
+
_: 1
|
|
1598
|
+
}, 8, ["title", "open"]),
|
|
1599
|
+
g(xi, {
|
|
1600
|
+
title: b(f).blockSettings.display,
|
|
1601
|
+
open: T.has("display"),
|
|
1602
|
+
onToggle: i[4] ||= (e) => N("display")
|
|
1603
|
+
}, {
|
|
1604
|
+
default: l(() => [p("div", Si, [(s(), m(S, null, e(M, (e) => p("label", {
|
|
1605
|
+
key: e.key,
|
|
1606
|
+
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]"
|
|
1607
|
+
}, [
|
|
1608
|
+
p("input", {
|
|
1609
|
+
type: "checkbox",
|
|
1610
|
+
class: "tpl:accent-[var(--tpl-primary)]",
|
|
1611
|
+
checked: B(e.key),
|
|
1612
|
+
onChange: (t) => V(e.key)
|
|
1613
|
+
}, null, 40, Ci),
|
|
1614
|
+
(s(), v(o(e.icon), {
|
|
1615
|
+
size: 14,
|
|
1616
|
+
"stroke-width": 1.5
|
|
1617
|
+
})),
|
|
1618
|
+
y(" " + c(b(f).blockSettings[e.labelKey]), 1)
|
|
1619
|
+
])), 64))])]),
|
|
1620
|
+
_: 1
|
|
1621
|
+
}, 8, ["title", "open"]),
|
|
1622
|
+
P.value ? (s(), v(xi, {
|
|
1623
|
+
key: 0,
|
|
1624
|
+
title: b(f).blockSettings.displayCondition,
|
|
1625
|
+
open: T.has("condition"),
|
|
1626
|
+
onToggle: i[8] ||= (e) => N("condition")
|
|
1627
|
+
}, {
|
|
1628
|
+
default: l(() => [p("div", wi, [p("select", {
|
|
1629
|
+
class: n(["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)]", t.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)]"]),
|
|
1630
|
+
value: D.value || F.value ? "__custom__" : t.block.displayCondition?.label ?? "",
|
|
1631
|
+
onChange: i[5] ||= (e) => {
|
|
1632
|
+
let t = e.target.value;
|
|
1633
|
+
if (t === "__custom__") {
|
|
1634
|
+
I();
|
|
1635
|
+
return;
|
|
1636
|
+
}
|
|
1637
|
+
if (D.value = !1, !t) {
|
|
1638
|
+
u("update", { displayCondition: void 0 });
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
let n = b(h).find((e) => e.label === t);
|
|
1642
|
+
n && u("update", { displayCondition: n });
|
|
1643
|
+
}
|
|
1644
|
+
}, [
|
|
1645
|
+
p("option", Ei, c(b(f).blockSettings.noCondition), 1),
|
|
1646
|
+
(s(!0), m(S, null, e(R.value, (t, n) => (s(), m(S, { key: n }, [n ? (s(), m("optgroup", {
|
|
1647
|
+
key: 0,
|
|
1648
|
+
label: String(n)
|
|
1649
|
+
}, [(s(!0), m(S, null, e(t, (e) => (s(), m("option", {
|
|
1650
|
+
key: e.label,
|
|
1651
|
+
value: e.label
|
|
1652
|
+
}, c(e.label), 9, Oi))), 128))], 8, Di)) : (s(!0), m(S, { key: 1 }, e(t, (e) => (s(), m("option", {
|
|
1653
|
+
key: e.label,
|
|
1654
|
+
value: e.label
|
|
1655
|
+
}, c(e.label), 9, ki))), 128))], 64))), 128)),
|
|
1656
|
+
b(_) ? (s(), m("option", Ai, c(b(f).blockSettings.customCondition), 1)) : w("", !0)
|
|
1657
|
+
], 42, Ti), D.value || F.value ? (s(), m("div", ji, [
|
|
1658
|
+
p("div", null, [p("label", Mi, c(b(f).blockSettings.customConditionBefore), 1), O(p("textarea", {
|
|
1659
|
+
"onUpdate:modelValue": i[6] ||= (e) => A.value = e,
|
|
1660
|
+
rows: "2",
|
|
1661
|
+
class: n(b(Tt))
|
|
1662
|
+
}, null, 2), [[k, A.value]])]),
|
|
1663
|
+
p("div", null, [p("label", Ni, c(b(f).blockSettings.customConditionAfter), 1), O(p("textarea", {
|
|
1664
|
+
"onUpdate:modelValue": i[7] ||= (e) => j.value = e,
|
|
1665
|
+
rows: "2",
|
|
1666
|
+
class: n(b(Tt))
|
|
1667
|
+
}, null, 2), [[k, j.value]])]),
|
|
1668
|
+
p("div", Pi, [p("button", {
|
|
1669
|
+
type: "button",
|
|
1670
|
+
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",
|
|
1671
|
+
disabled: !A.value.trim(),
|
|
1672
|
+
onClick: L
|
|
1673
|
+
}, c(b(f).blockSettings.applyCondition), 9, Fi)])
|
|
1674
|
+
])) : t.block.displayCondition && !F.value ? (s(), m(S, { key: 1 }, [t.block.displayCondition.description ? (s(), m("p", Ii, c(t.block.displayCondition.description), 1)) : w("", !0), p("div", Li, [p("pre", Ri, c(t.block.displayCondition.before), 1), t.block.displayCondition.after ? (s(), m("pre", zi, c(t.block.displayCondition.after), 1)) : w("", !0)])], 64)) : w("", !0)])]),
|
|
1675
|
+
_: 1
|
|
1676
|
+
}, 8, ["title", "open"])) : w("", !0)
|
|
1677
|
+
], 2));
|
|
1678
|
+
}
|
|
1679
|
+
}), Vi = ["title"], Hi = { class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Ui = {
|
|
1680
|
+
key: 1,
|
|
1681
|
+
class: "tpl:text-[var(--tpl-danger)]"
|
|
1682
|
+
}, Wi = [
|
|
1683
|
+
"aria-checked",
|
|
1684
|
+
"aria-label",
|
|
1685
|
+
"disabled"
|
|
1686
|
+
], Gi = /* @__PURE__ */ f({
|
|
1687
|
+
__name: "BooleanField",
|
|
1688
|
+
props: {
|
|
1689
|
+
field: {},
|
|
1690
|
+
modelValue: { type: Boolean },
|
|
1691
|
+
readOnly: { type: Boolean }
|
|
1692
|
+
},
|
|
1693
|
+
emits: ["update:modelValue"],
|
|
1694
|
+
setup(e, { emit: t }) {
|
|
1695
|
+
let r = t, { t: i } = U();
|
|
1696
|
+
return (t, a) => (s(), m("div", {
|
|
1697
|
+
class: "tpl:mb-3.5",
|
|
1698
|
+
title: e.readOnly ? b(i).customBlocks.dataSource.readOnlyTooltip : void 0
|
|
1699
|
+
}, [p("label", { class: n(["tpl:flex tpl:items-center tpl:justify-between tpl:gap-2", e.readOnly ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer"]) }, [p("span", Hi, [
|
|
1700
|
+
y(c(e.field.label) + " ", 1),
|
|
1701
|
+
e.readOnly ? (s(), v(b(Rt), {
|
|
1702
|
+
key: 0,
|
|
1703
|
+
size: 12,
|
|
1704
|
+
class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
|
|
1705
|
+
})) : w("", !0),
|
|
1706
|
+
e.field.required ? (s(), m("span", Ui, " * ")) : w("", !0)
|
|
1707
|
+
]), p("button", {
|
|
1708
|
+
type: "button",
|
|
1709
|
+
role: "switch",
|
|
1710
|
+
"aria-checked": e.modelValue,
|
|
1711
|
+
"aria-label": e.field.label,
|
|
1712
|
+
class: n([
|
|
1713
|
+
"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",
|
|
1714
|
+
e.modelValue ? "tpl:bg-[var(--tpl-primary)]" : "tpl:bg-[var(--tpl-border)]",
|
|
1715
|
+
e.readOnly ? "tpl:opacity-60 tpl:cursor-not-allowed" : "tpl:cursor-pointer"
|
|
1716
|
+
]),
|
|
1717
|
+
disabled: e.readOnly,
|
|
1718
|
+
onClick: a[0] ||= (t) => !e.readOnly && r("update:modelValue", !e.modelValue)
|
|
1719
|
+
}, [p("span", { class: n(["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, Wi)], 2)], 8, Vi));
|
|
1720
|
+
}
|
|
1721
|
+
}), Ki = { class: "tpl:mb-3.5" }, qi = {
|
|
1722
|
+
key: 1,
|
|
1723
|
+
class: "tpl:text-[var(--tpl-danger)]"
|
|
1724
|
+
}, Ji = /* @__PURE__ */ f({
|
|
1725
|
+
__name: "FieldWrapper",
|
|
1726
|
+
props: {
|
|
1727
|
+
label: {},
|
|
1728
|
+
required: { type: Boolean },
|
|
1729
|
+
readOnly: { type: Boolean }
|
|
1730
|
+
},
|
|
1731
|
+
setup(e) {
|
|
1732
|
+
return (t, r) => (s(), m("div", Ki, [p("label", { class: n(b(K)) }, [
|
|
1733
|
+
y(c(e.label) + " ", 1),
|
|
1734
|
+
e.readOnly ? (s(), v(b(Rt), {
|
|
1735
|
+
key: 0,
|
|
1736
|
+
size: 12,
|
|
1737
|
+
class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
|
|
1738
|
+
})) : w("", !0),
|
|
1739
|
+
e.required ? (s(), m("span", qi, "*")) : w("", !0)
|
|
1740
|
+
], 2), _(t.$slots, "default")]));
|
|
1741
|
+
}
|
|
1742
|
+
}), Yi = /* @__PURE__ */ f({
|
|
1743
|
+
__name: "ColorField",
|
|
1744
|
+
props: {
|
|
1745
|
+
field: {},
|
|
1746
|
+
modelValue: {},
|
|
1747
|
+
readOnly: { type: Boolean }
|
|
1748
|
+
},
|
|
1749
|
+
emits: ["update:modelValue"],
|
|
1750
|
+
setup(e, { emit: t }) {
|
|
1751
|
+
let n = t, { t: r } = U();
|
|
1752
|
+
return (t, i) => (s(), v(Ji, {
|
|
1753
|
+
label: e.field.label,
|
|
1754
|
+
required: e.field.required,
|
|
1755
|
+
"read-only": e.readOnly
|
|
1756
|
+
}, {
|
|
1757
|
+
default: l(() => [g(Y, {
|
|
1758
|
+
"model-value": e.modelValue,
|
|
1759
|
+
placeholder: e.field.placeholder,
|
|
1760
|
+
disabled: e.readOnly,
|
|
1761
|
+
title: e.readOnly ? b(r).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
1762
|
+
"onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
|
|
1763
|
+
}, null, 8, [
|
|
1764
|
+
"model-value",
|
|
1765
|
+
"placeholder",
|
|
1766
|
+
"disabled",
|
|
1767
|
+
"title"
|
|
1768
|
+
])]),
|
|
1769
|
+
_: 1
|
|
1770
|
+
}, 8, [
|
|
1771
|
+
"label",
|
|
1772
|
+
"required",
|
|
1773
|
+
"read-only"
|
|
1774
|
+
]));
|
|
1775
|
+
}
|
|
1776
|
+
}), Xi = {
|
|
1777
|
+
key: 0,
|
|
1778
|
+
class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]",
|
|
1779
|
+
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 90%, transparent)" }
|
|
1780
|
+
}, Zi = [
|
|
1781
|
+
"value",
|
|
1782
|
+
"placeholder",
|
|
1783
|
+
"title"
|
|
1784
|
+
], Qi = ["value", "placeholder"], $i = /* @__PURE__ */ f({
|
|
1785
|
+
__name: "ImageField",
|
|
1786
|
+
props: {
|
|
1787
|
+
field: {},
|
|
1788
|
+
modelValue: {},
|
|
1789
|
+
readOnly: { type: Boolean }
|
|
1790
|
+
},
|
|
1791
|
+
emits: ["update:modelValue"],
|
|
1792
|
+
setup(e, { emit: t }) {
|
|
1793
|
+
let r = e, i = t, { t: a } = U(), o = E(Ae, null), u = bt(), f = C(() => !!o);
|
|
1794
|
+
async function h() {
|
|
1795
|
+
let e = await o?.({ accept: ["images"] });
|
|
1796
|
+
u.alive && e && i("update:modelValue", e.url);
|
|
1797
|
+
}
|
|
1798
|
+
let _ = d(), x = d(!1), T = C(() => f.value && !x.value && !r.readOnly);
|
|
1799
|
+
async function D(e) {
|
|
1800
|
+
if (o) {
|
|
1801
|
+
x.value = !0;
|
|
1802
|
+
try {
|
|
1803
|
+
let t = await o({
|
|
1804
|
+
accept: ["images"],
|
|
1805
|
+
files: e
|
|
1806
|
+
});
|
|
1807
|
+
if (!u.alive) return;
|
|
1808
|
+
t && i("update:modelValue", t.url);
|
|
1809
|
+
} finally {
|
|
1810
|
+
u.alive && (x.value = !1);
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
let { isOver: O } = me({
|
|
1815
|
+
target: _,
|
|
1816
|
+
enabled: T,
|
|
1817
|
+
onFiles: D
|
|
1818
|
+
});
|
|
1819
|
+
return (t, r) => (s(), v(Ji, {
|
|
1820
|
+
label: e.field.label,
|
|
1821
|
+
required: e.field.required,
|
|
1822
|
+
"read-only": e.readOnly
|
|
1823
|
+
}, {
|
|
1824
|
+
default: l(() => [p("div", {
|
|
1825
|
+
ref_key: "dropZoneRef",
|
|
1826
|
+
ref: _,
|
|
1827
|
+
class: "tpl:relative"
|
|
1828
|
+
}, [
|
|
1829
|
+
T.value && (b(O) || x.value) ? (s(), m("div", Xi, [x.value ? (s(), m(S, { key: 0 }, [g(b(lt), {
|
|
1830
|
+
class: "tpl-spinner",
|
|
1831
|
+
size: 18,
|
|
1832
|
+
"stroke-width": 2
|
|
1833
|
+
}), y(" " + c(b(a).image.uploading), 1)], 64)) : (s(), m(S, { key: 1 }, [g(b(ht), {
|
|
1834
|
+
size: 18,
|
|
1835
|
+
"stroke-width": 1.5
|
|
1836
|
+
}), y(" " + c(b(a).image.dropToUpload), 1)], 64))])) : w("", !0),
|
|
1837
|
+
e.readOnly ? (s(), m("input", {
|
|
1838
|
+
key: 1,
|
|
1839
|
+
type: "url",
|
|
1840
|
+
class: n([b(G), "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
1841
|
+
value: e.modelValue,
|
|
1842
|
+
placeholder: e.field.placeholder || "https://...",
|
|
1843
|
+
disabled: "",
|
|
1844
|
+
title: b(a).customBlocks.dataSource.readOnlyTooltip
|
|
1845
|
+
}, null, 10, Zi)) : (s(), m("input", {
|
|
1846
|
+
key: 2,
|
|
1847
|
+
type: "url",
|
|
1848
|
+
class: n(b(G)),
|
|
1849
|
+
value: e.modelValue,
|
|
1850
|
+
placeholder: e.field.placeholder || "https://...",
|
|
1851
|
+
onInput: r[0] ||= (e) => i("update:modelValue", e.target.value)
|
|
1852
|
+
}, null, 42, Qi)),
|
|
1853
|
+
f.value && !e.readOnly ? (s(), m("button", {
|
|
1854
|
+
key: 3,
|
|
1855
|
+
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)]",
|
|
1856
|
+
onClick: r[1] ||= (e) => h()
|
|
1857
|
+
}, [g(b(_e), {
|
|
1858
|
+
size: 14,
|
|
1859
|
+
"stroke-width": 1.5
|
|
1860
|
+
}), y(" " + c(b(a).image.browseMedia), 1)])) : w("", !0)
|
|
1861
|
+
], 512)]),
|
|
1862
|
+
_: 1
|
|
1863
|
+
}, 8, [
|
|
1864
|
+
"label",
|
|
1865
|
+
"required",
|
|
1866
|
+
"read-only"
|
|
1867
|
+
]));
|
|
1868
|
+
}
|
|
1869
|
+
}), ea = [
|
|
1870
|
+
"value",
|
|
1871
|
+
"placeholder",
|
|
1872
|
+
"min",
|
|
1873
|
+
"max",
|
|
1874
|
+
"step",
|
|
1875
|
+
"disabled",
|
|
1876
|
+
"title"
|
|
1877
|
+
], ta = /* @__PURE__ */ f({
|
|
1878
|
+
__name: "NumberField",
|
|
1879
|
+
props: {
|
|
1880
|
+
field: {},
|
|
1881
|
+
modelValue: {},
|
|
1882
|
+
readOnly: { type: Boolean }
|
|
1883
|
+
},
|
|
1884
|
+
emits: ["update:modelValue"],
|
|
1885
|
+
setup(e, { emit: t }) {
|
|
1886
|
+
let r = t, { t: i } = U();
|
|
1887
|
+
return (t, a) => (s(), v(Ji, {
|
|
1888
|
+
label: e.field.label,
|
|
1889
|
+
required: e.field.required,
|
|
1890
|
+
"read-only": e.readOnly
|
|
1891
|
+
}, {
|
|
1892
|
+
default: l(() => [p("input", {
|
|
1893
|
+
type: "number",
|
|
1894
|
+
class: n([b(G), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
1895
|
+
value: e.modelValue,
|
|
1896
|
+
placeholder: e.field.placeholder,
|
|
1897
|
+
min: e.field.min,
|
|
1898
|
+
max: e.field.max,
|
|
1899
|
+
step: e.field.step,
|
|
1900
|
+
disabled: e.readOnly,
|
|
1901
|
+
title: e.readOnly ? b(i).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
1902
|
+
onInput: a[0] ||= (t) => !e.readOnly && r("update:modelValue", Number(t.target.value))
|
|
1903
|
+
}, null, 42, ea)]),
|
|
1904
|
+
_: 1
|
|
1905
|
+
}, 8, [
|
|
1906
|
+
"label",
|
|
1907
|
+
"required",
|
|
1908
|
+
"read-only"
|
|
1909
|
+
]));
|
|
1910
|
+
}
|
|
1911
|
+
}), na = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, ra = { class: "tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between" }, ia = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]" }, aa = ["title", "onClick"], oa = {
|
|
1912
|
+
key: 1,
|
|
1913
|
+
class: "tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
1914
|
+
}, sa = /* @__PURE__ */ f({
|
|
1915
|
+
__name: "RepeatableField",
|
|
1916
|
+
props: {
|
|
1917
|
+
field: {},
|
|
1918
|
+
modelValue: {},
|
|
1919
|
+
readOnly: { type: Boolean }
|
|
1920
|
+
},
|
|
1921
|
+
emits: ["update:modelValue"],
|
|
1922
|
+
setup(t, { emit: r }) {
|
|
1923
|
+
let i = t, a = r, { t: u } = U(), d = C(() => i.modelValue || []), f = C(() => !i.field.maxItems || d.value.length < i.field.maxItems), h = C(() => !i.field.minItems || d.value.length > i.field.minItems);
|
|
1924
|
+
function _() {
|
|
1925
|
+
if (!f.value || i.readOnly) return;
|
|
1926
|
+
let e = {};
|
|
1927
|
+
for (let t of i.field.fields) e[t.key] = t.default ?? "";
|
|
1928
|
+
a("update:modelValue", [...d.value, e]);
|
|
1929
|
+
}
|
|
1930
|
+
function x(e) {
|
|
1931
|
+
if (!h.value || i.readOnly) return;
|
|
1932
|
+
let t = [...d.value];
|
|
1933
|
+
t.splice(e, 1), a("update:modelValue", t);
|
|
1934
|
+
}
|
|
1935
|
+
function T(e, t, n) {
|
|
1936
|
+
let r = d.value.map((r, i) => i === e ? {
|
|
1937
|
+
...r,
|
|
1938
|
+
[t]: n
|
|
1939
|
+
} : r);
|
|
1940
|
+
a("update:modelValue", r);
|
|
1941
|
+
}
|
|
1942
|
+
return (r, i) => (s(), v(Ji, {
|
|
1943
|
+
label: t.field.label,
|
|
1944
|
+
required: t.field.required,
|
|
1945
|
+
"read-only": t.readOnly
|
|
1946
|
+
}, {
|
|
1947
|
+
default: l(() => [p("div", na, [
|
|
1948
|
+
(s(!0), m(S, null, e(d.value, (n, r) => (s(), m("div", {
|
|
1949
|
+
key: `${t.field.key}-${r}`,
|
|
1950
|
+
class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3"
|
|
1951
|
+
}, [p("div", ra, [p("span", ia, " #" + c(r + 1), 1), h.value && !t.readOnly ? (s(), m("button", {
|
|
1952
|
+
key: 0,
|
|
1953
|
+
type: "button",
|
|
1954
|
+
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)]",
|
|
1955
|
+
title: b(u).customBlocks.fields.removeItem,
|
|
1956
|
+
onClick: (e) => x(r)
|
|
1957
|
+
}, [g(b(mt), {
|
|
1958
|
+
size: 12,
|
|
1959
|
+
"stroke-width": 2
|
|
1960
|
+
})], 8, aa)) : w("", !0)]), (s(!0), m(S, null, e(t.field.fields, (e) => (s(), v(o(b(ga)(e.type)), {
|
|
1961
|
+
key: e.key,
|
|
1962
|
+
field: e,
|
|
1963
|
+
"model-value": n[e.key],
|
|
1964
|
+
"read-only": t.readOnly,
|
|
1965
|
+
"onUpdate:modelValue": (t) => T(r, e.key, t)
|
|
1966
|
+
}, null, 8, [
|
|
1967
|
+
"field",
|
|
1968
|
+
"model-value",
|
|
1969
|
+
"read-only",
|
|
1970
|
+
"onUpdate:modelValue"
|
|
1971
|
+
]))), 128))]))), 128)),
|
|
1972
|
+
f.value && !t.readOnly ? (s(), m("button", {
|
|
1973
|
+
key: 0,
|
|
1974
|
+
type: "button",
|
|
1975
|
+
class: n(b(wt)),
|
|
1976
|
+
onClick: _
|
|
1977
|
+
}, [g(b(Q), {
|
|
1978
|
+
size: 14,
|
|
1979
|
+
"stroke-width": 2
|
|
1980
|
+
}), y(" " + c(b(u).customBlocks.fields.addItem), 1)], 2)) : w("", !0),
|
|
1981
|
+
!f.value && !t.readOnly ? (s(), m("p", oa, c(b(u).customBlocks.fields.maxItemsReached), 1)) : w("", !0)
|
|
1982
|
+
])]),
|
|
1983
|
+
_: 1
|
|
1984
|
+
}, 8, [
|
|
1985
|
+
"label",
|
|
1986
|
+
"required",
|
|
1987
|
+
"read-only"
|
|
1988
|
+
]));
|
|
1989
|
+
}
|
|
1990
|
+
}), ca = [
|
|
1991
|
+
"value",
|
|
1992
|
+
"disabled",
|
|
1993
|
+
"title"
|
|
1994
|
+
], la = ["value"], ua = /* @__PURE__ */ f({
|
|
1995
|
+
__name: "SelectField",
|
|
1996
|
+
props: {
|
|
1997
|
+
field: {},
|
|
1998
|
+
modelValue: {},
|
|
1999
|
+
readOnly: { type: Boolean }
|
|
2000
|
+
},
|
|
2001
|
+
emits: ["update:modelValue"],
|
|
2002
|
+
setup(t, { emit: r }) {
|
|
2003
|
+
let i = r, { t: a } = U();
|
|
2004
|
+
return (r, o) => (s(), v(Ji, {
|
|
2005
|
+
label: t.field.label,
|
|
2006
|
+
required: t.field.required,
|
|
2007
|
+
"read-only": t.readOnly
|
|
2008
|
+
}, {
|
|
2009
|
+
default: l(() => [p("select", {
|
|
2010
|
+
class: n([b(G), t.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
2011
|
+
value: t.modelValue,
|
|
2012
|
+
disabled: t.readOnly,
|
|
2013
|
+
title: t.readOnly ? b(a).customBlocks.dataSource.readOnlyTooltip : void 0,
|
|
2014
|
+
onChange: o[0] ||= (e) => !t.readOnly && i("update:modelValue", e.target.value)
|
|
2015
|
+
}, [(s(!0), m(S, null, e(t.field.options, (e) => (s(), m("option", {
|
|
2016
|
+
key: e.value,
|
|
2017
|
+
value: e.value
|
|
2018
|
+
}, c(e.label), 9, la))), 128))], 42, ca)]),
|
|
2019
|
+
_: 1
|
|
2020
|
+
}, 8, [
|
|
2021
|
+
"label",
|
|
2022
|
+
"required",
|
|
2023
|
+
"read-only"
|
|
2024
|
+
]));
|
|
2025
|
+
}
|
|
2026
|
+
}), da = [
|
|
2027
|
+
"value",
|
|
2028
|
+
"placeholder",
|
|
2029
|
+
"title"
|
|
2030
|
+
], fa = /* @__PURE__ */ f({
|
|
2031
|
+
__name: "TextField",
|
|
2032
|
+
props: {
|
|
2033
|
+
field: {},
|
|
2034
|
+
modelValue: {},
|
|
2035
|
+
readOnly: { type: Boolean }
|
|
2036
|
+
},
|
|
2037
|
+
emits: ["update:modelValue"],
|
|
2038
|
+
setup(e, { emit: t }) {
|
|
2039
|
+
let r = t, { t: i } = U();
|
|
2040
|
+
return (t, a) => (s(), v(Ji, {
|
|
2041
|
+
label: e.field.label,
|
|
2042
|
+
required: e.field.required,
|
|
2043
|
+
"read-only": e.readOnly
|
|
2044
|
+
}, {
|
|
2045
|
+
default: l(() => [e.readOnly ? (s(), m("input", {
|
|
2046
|
+
key: 0,
|
|
2047
|
+
type: "text",
|
|
2048
|
+
class: n([b(G), "tpl:opacity-60 tpl:cursor-not-allowed"]),
|
|
2049
|
+
value: e.modelValue,
|
|
2050
|
+
placeholder: e.field.placeholder,
|
|
2051
|
+
disabled: "",
|
|
2052
|
+
title: b(i).customBlocks.dataSource.readOnlyTooltip
|
|
2053
|
+
}, null, 10, da)) : (s(), v($, {
|
|
2054
|
+
key: 1,
|
|
2055
|
+
"model-value": e.modelValue,
|
|
2056
|
+
placeholder: e.field.placeholder,
|
|
2057
|
+
"onUpdate:modelValue": a[0] ||= (e) => r("update:modelValue", e)
|
|
2058
|
+
}, null, 8, ["model-value", "placeholder"]))]),
|
|
2059
|
+
_: 1
|
|
2060
|
+
}, 8, [
|
|
2061
|
+
"label",
|
|
2062
|
+
"required",
|
|
2063
|
+
"read-only"
|
|
2064
|
+
]));
|
|
2065
|
+
}
|
|
2066
|
+
}), pa = [
|
|
2067
|
+
"value",
|
|
2068
|
+
"placeholder",
|
|
2069
|
+
"title"
|
|
2070
|
+
], ma = "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", ha = {
|
|
2071
|
+
text: fa,
|
|
2072
|
+
textarea: /* @__PURE__ */ f({
|
|
2073
|
+
__name: "TextareaField",
|
|
2074
|
+
props: {
|
|
2075
|
+
field: {},
|
|
2076
|
+
modelValue: {},
|
|
2077
|
+
readOnly: { type: Boolean }
|
|
2078
|
+
},
|
|
2079
|
+
emits: ["update:modelValue"],
|
|
2080
|
+
setup(e, { emit: t }) {
|
|
2081
|
+
let r = t, { t: i } = U();
|
|
2082
|
+
return (t, a) => (s(), v(Ji, {
|
|
2083
|
+
label: e.field.label,
|
|
2084
|
+
required: e.field.required,
|
|
2085
|
+
"read-only": e.readOnly
|
|
2086
|
+
}, {
|
|
2087
|
+
default: l(() => [e.readOnly ? (s(), m("textarea", {
|
|
2088
|
+
key: 0,
|
|
2089
|
+
value: e.modelValue,
|
|
2090
|
+
placeholder: e.field.placeholder,
|
|
2091
|
+
rows: "3",
|
|
2092
|
+
disabled: "",
|
|
2093
|
+
title: b(i).customBlocks.dataSource.readOnlyTooltip,
|
|
2094
|
+
class: n(ma)
|
|
2095
|
+
}, null, 8, pa)) : (s(), v(Wn, {
|
|
2096
|
+
key: 1,
|
|
2097
|
+
"model-value": e.modelValue,
|
|
2098
|
+
placeholder: e.field.placeholder,
|
|
2099
|
+
"onUpdate:modelValue": a[0] ||= (e) => r("update:modelValue", e)
|
|
2100
|
+
}, null, 8, ["model-value", "placeholder"]))]),
|
|
2101
|
+
_: 1
|
|
2102
|
+
}, 8, [
|
|
2103
|
+
"label",
|
|
2104
|
+
"required",
|
|
2105
|
+
"read-only"
|
|
2106
|
+
]));
|
|
2107
|
+
}
|
|
2108
|
+
}),
|
|
2109
|
+
image: $i,
|
|
2110
|
+
color: Yi,
|
|
2111
|
+
number: ta,
|
|
2112
|
+
select: ua,
|
|
2113
|
+
boolean: Gi,
|
|
2114
|
+
repeatable: sa
|
|
2115
|
+
};
|
|
2116
|
+
function ga(e) {
|
|
2117
|
+
return ha[e] ?? fa;
|
|
2118
|
+
}
|
|
2119
|
+
//#endregion
|
|
2120
|
+
//#region src/components/toolbar/CustomBlockToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
2121
|
+
var _a = {
|
|
2122
|
+
key: 0,
|
|
2123
|
+
class: "tpl:p-4"
|
|
2124
|
+
}, va = { class: "tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, ya = { key: 1 }, ba = {
|
|
2125
|
+
key: 0,
|
|
2126
|
+
class: "tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
2127
|
+
}, xa = {
|
|
2128
|
+
key: 1,
|
|
2129
|
+
class: "tpl:mb-4"
|
|
2130
|
+
}, Sa = {
|
|
2131
|
+
key: 1,
|
|
2132
|
+
class: "tpl:flex tpl:h-[32px] tpl:items-center"
|
|
2133
|
+
}, Ca = {
|
|
2134
|
+
key: 0,
|
|
2135
|
+
class: "tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
2136
|
+
}, wa = {
|
|
2137
|
+
key: 2,
|
|
2138
|
+
class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]"
|
|
2139
|
+
}, Ta = /* @__PURE__ */ f({
|
|
2140
|
+
__name: "CustomBlockToolbar",
|
|
2141
|
+
props: { block: {} },
|
|
2142
|
+
emits: ["updateFieldValues", "updateDataSourceFetched"],
|
|
2143
|
+
setup(t, { emit: n }) {
|
|
2144
|
+
let r = t, i = n, { t: a } = U(), l = E(Re, []), u = C(() => l.find((e) => e.type === r.block.customType)), { isFetching: d, fetchError: f, fetch: h, hasDataSource: _, needsFetch: x } = ce({
|
|
2145
|
+
definition: u,
|
|
2146
|
+
block: C(() => r.block),
|
|
2147
|
+
onUpdate: (e, t) => {
|
|
2148
|
+
i("updateFieldValues", e), i("updateDataSourceFetched", t);
|
|
2149
|
+
}
|
|
2150
|
+
});
|
|
2151
|
+
function T(e) {
|
|
2152
|
+
return e.readOnly === !0 && _.value && !!r.block.dataSourceFetched;
|
|
2153
|
+
}
|
|
2154
|
+
function D(e, t) {
|
|
2155
|
+
i("updateFieldValues", {
|
|
2156
|
+
...r.block.fieldValues,
|
|
2157
|
+
[e]: t
|
|
2158
|
+
});
|
|
2159
|
+
}
|
|
2160
|
+
return (n, r) => u.value ? (s(), m("div", ya, [
|
|
2161
|
+
u.value.description ? (s(), m("p", ba, c(u.value.description), 1)) : w("", !0),
|
|
2162
|
+
b(_) ? (s(), m("div", xa, [b(x) && !b(d) ? (s(), m("button", {
|
|
2163
|
+
key: 0,
|
|
2164
|
+
type: "button",
|
|
2165
|
+
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)]",
|
|
2166
|
+
onClick: r[0] ||= (...e) => b(h) && b(h)(...e)
|
|
2167
|
+
}, c(u.value?.dataSource?.label || b(a).customBlocks.dataSource.fetchButton), 1)) : (s(), m("div", Sa, [b(d) ? (s(), m("div", Ca, c(b(a).customBlocks.dataSource.fetching), 1)) : (s(), m("button", {
|
|
2168
|
+
key: 1,
|
|
2169
|
+
type: "button",
|
|
2170
|
+
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)]",
|
|
2171
|
+
onClick: r[1] ||= (...e) => b(h) && b(h)(...e)
|
|
2172
|
+
}, [g(b(at), { size: 12 }), y(" " + c(b(a).customBlocks.dataSource.changeButton), 1)]))])), b(f) ? (s(), m("p", wa, [g(b($e), {
|
|
2173
|
+
size: 14,
|
|
2174
|
+
class: "tpl:shrink-0"
|
|
2175
|
+
}), y(" " + c(b(a).customBlocks.dataSource.fetchError), 1)])) : w("", !0)])) : w("", !0),
|
|
2176
|
+
(s(!0), m(S, null, e(u.value.fields, (e) => (s(), v(o(b(ga)(e.type)), {
|
|
2177
|
+
key: e.key,
|
|
2178
|
+
field: e,
|
|
2179
|
+
"model-value": t.block.fieldValues[e.key],
|
|
2180
|
+
"read-only": T(e),
|
|
2181
|
+
"onUpdate:modelValue": (t) => D(e.key, t)
|
|
2182
|
+
}, null, 8, [
|
|
2183
|
+
"field",
|
|
2184
|
+
"model-value",
|
|
2185
|
+
"read-only",
|
|
2186
|
+
"onUpdate:modelValue"
|
|
2187
|
+
]))), 128))
|
|
2188
|
+
])) : (s(), m("div", _a, [p("p", va, c(b(a).customBlocks.toolbar.noDefinition), 1)]));
|
|
2189
|
+
}
|
|
2190
|
+
}), Ea = { class: "tpl:mb-3.5" }, Da = { class: "tpl:mb-3.5" }, Oa = { class: "tpl:mb-3.5" }, ka = { class: "tpl:flex tpl:items-stretch" }, Aa = ["value"], ja = /* @__PURE__ */ f({
|
|
2191
|
+
__name: "DividerToolbar",
|
|
2192
|
+
props: { block: {} },
|
|
2193
|
+
emits: ["update"],
|
|
2194
|
+
setup(e, { emit: t }) {
|
|
2195
|
+
let r = t, { t: i } = U();
|
|
2196
|
+
function a(e, t) {
|
|
2197
|
+
r("update", { [e]: t });
|
|
2198
|
+
}
|
|
2199
|
+
return (t, r) => (s(), m(S, null, [
|
|
2200
|
+
p("div", Ea, [p("label", { class: n(b(K)) }, c(b(i).divider.style), 3), g(Z, {
|
|
2201
|
+
options: [
|
|
2202
|
+
{
|
|
2203
|
+
value: "solid",
|
|
2204
|
+
label: b(i).divider.solid
|
|
2205
|
+
},
|
|
2206
|
+
{
|
|
2207
|
+
value: "dashed",
|
|
2208
|
+
label: b(i).divider.dashed
|
|
2209
|
+
},
|
|
2210
|
+
{
|
|
2211
|
+
value: "dotted",
|
|
2212
|
+
label: b(i).divider.dotted
|
|
2213
|
+
}
|
|
2214
|
+
],
|
|
2215
|
+
"model-value": e.block.lineStyle,
|
|
2216
|
+
"onUpdate:modelValue": r[0] ||= (e) => a("lineStyle", e)
|
|
2217
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2218
|
+
p("div", Da, [p("label", { class: n(b(K)) }, c(b(i).divider.color), 3), g(Y, {
|
|
2219
|
+
"model-value": e.block.color,
|
|
2220
|
+
"onUpdate:modelValue": r[1] ||= (e) => a("color", e)
|
|
2221
|
+
}, null, 8, ["model-value"])]),
|
|
2222
|
+
p("div", Oa, [p("label", { class: n(b(K)) }, c(b(i).divider.thickness), 3), p("div", ka, [p("input", {
|
|
2223
|
+
type: "number",
|
|
2224
|
+
class: n(b(J)),
|
|
2225
|
+
value: e.block.thickness,
|
|
2226
|
+
min: "1",
|
|
2227
|
+
max: "10",
|
|
2228
|
+
onInput: r[2] ||= (e) => a("thickness", Number(e.target.value))
|
|
2229
|
+
}, null, 42, Aa), p("span", { class: n(b(q)) }, "px", 2)])])
|
|
2230
|
+
], 64));
|
|
2231
|
+
}
|
|
2232
|
+
}), Ma = { class: "tpl:mb-3.5" }, Na = ["value"], Pa = { class: "tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, Fa = /* @__PURE__ */ f({
|
|
2233
|
+
__name: "HtmlToolbar",
|
|
2234
|
+
props: { block: {} },
|
|
2235
|
+
emits: ["update"],
|
|
2236
|
+
setup(e, { emit: t }) {
|
|
2237
|
+
let r = t, { t: i } = U();
|
|
2238
|
+
return (t, a) => (s(), m("div", Ma, [
|
|
2239
|
+
p("label", { class: n(b(K)) }, c(b(i).html.content), 3),
|
|
2240
|
+
p("textarea", {
|
|
2241
|
+
value: e.block.content,
|
|
2242
|
+
placeholder: "<div>...</div>",
|
|
2243
|
+
rows: "10",
|
|
2244
|
+
class: n(b(Tt)),
|
|
2245
|
+
onInput: a[0] ||= (e) => r("update", { content: e.target.value })
|
|
2246
|
+
}, null, 42, Na),
|
|
2247
|
+
p("p", Pa, [g(b(st), {
|
|
2248
|
+
size: 12,
|
|
2249
|
+
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
2250
|
+
}), y(" " + c(b(i).html.sanitizationHint), 1)])
|
|
2251
|
+
]));
|
|
2252
|
+
}
|
|
2253
|
+
}), Ia = { class: "tpl:mb-3.5" }, La = {
|
|
2254
|
+
key: 0,
|
|
2255
|
+
class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]",
|
|
2256
|
+
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 90%, transparent)" }
|
|
2257
|
+
}, Ra = {
|
|
2258
|
+
key: 0,
|
|
2259
|
+
class: "tpl:mb-3.5"
|
|
2260
|
+
}, za = ["value", "placeholder"], Ba = { class: "tpl:mb-3.5" }, Va = { class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]" }, Ha = ["checked"], Ua = { class: "tpl:block tpl:text-[var(--tpl-text-dim)]" }, Wa = { class: "tpl:mb-3.5" }, Ga = ["value"], Ka = { value: "full" }, qa = { value: "custom" }, Ja = {
|
|
2261
|
+
key: 0,
|
|
2262
|
+
class: "tpl:mt-2 tpl:flex tpl:items-stretch"
|
|
2263
|
+
}, Ya = ["value"], Xa = { class: "tpl:mb-3.5" }, Za = { class: "tpl:mb-3.5" }, Qa = {
|
|
2264
|
+
key: 0,
|
|
2265
|
+
class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
|
|
2266
|
+
}, $a = ["checked"], eo = 350, to = /* @__PURE__ */ f({
|
|
2267
|
+
__name: "ImageToolbar",
|
|
2268
|
+
props: { block: {} },
|
|
2269
|
+
emits: ["update"],
|
|
2270
|
+
setup(e, { emit: t }) {
|
|
2271
|
+
let r = e, i = t, { t: a } = U(), o = E(Ae, null), l = E(Ie, B.liquid), u = bt(), f = C(() => !!o), h = d(!1), _ = d(!1), { start: v } = ke(() => {
|
|
2272
|
+
h.value = !1;
|
|
2273
|
+
}, 1e3, { immediate: !1 }), x = [
|
|
2274
|
+
300,
|
|
2275
|
+
400,
|
|
2276
|
+
500
|
|
2277
|
+
], T = C(() => {
|
|
2278
|
+
let e = r.block.width;
|
|
2279
|
+
return e === "full" ? "full" : x.includes(e) ? String(e) : "custom";
|
|
2280
|
+
});
|
|
2281
|
+
function D(e, t) {
|
|
2282
|
+
i("update", { [e]: t });
|
|
2283
|
+
}
|
|
2284
|
+
function O(e) {
|
|
2285
|
+
if (e === "custom") {
|
|
2286
|
+
let e = r.block.width;
|
|
2287
|
+
(typeof e != "number" || x.includes(e)) && D("width", eo);
|
|
2288
|
+
return;
|
|
2289
|
+
}
|
|
2290
|
+
D("width", e === "full" ? "full" : Number(e));
|
|
2291
|
+
}
|
|
2292
|
+
function k(e) {
|
|
2293
|
+
let t = Number(e);
|
|
2294
|
+
!Number.isFinite(t) || t <= 0 || D("width", t);
|
|
2295
|
+
}
|
|
2296
|
+
async function A() {
|
|
2297
|
+
let e = await o?.({ accept: ["images"] });
|
|
2298
|
+
u.alive && e && (D("src", e.url), e.alt && (D("alt", e.alt), _.value = !0), h.value = !0, v());
|
|
2299
|
+
}
|
|
2300
|
+
let j = d(), M = d(!1), N = C(() => z(r.block.src, l)), P = C(() => f.value && !M.value && !N.value);
|
|
2301
|
+
async function F(e) {
|
|
2302
|
+
if (o) {
|
|
2303
|
+
M.value = !0;
|
|
2304
|
+
try {
|
|
2305
|
+
let t = await o({
|
|
2306
|
+
accept: ["images"],
|
|
2307
|
+
files: e
|
|
2308
|
+
});
|
|
2309
|
+
if (!u.alive) return;
|
|
2310
|
+
t && (D("src", t.url), t.alt && (D("alt", t.alt), _.value = !0), h.value = !0, v());
|
|
2311
|
+
} finally {
|
|
2312
|
+
u.alive && (M.value = !1);
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
let { isOver: I } = me({
|
|
2317
|
+
target: j,
|
|
2318
|
+
enabled: P,
|
|
2319
|
+
onFiles: F
|
|
2320
|
+
});
|
|
2321
|
+
return (t, r) => (s(), m(S, null, [
|
|
2322
|
+
p("div", Ia, [p("label", { class: n(b(K)) }, c(b(a).image.imageUrl), 3), p("div", {
|
|
2323
|
+
ref_key: "dropZoneRef",
|
|
2324
|
+
ref: j,
|
|
2325
|
+
class: "tpl:relative"
|
|
2326
|
+
}, [
|
|
2327
|
+
P.value && (b(I) || M.value) ? (s(), m("div", La, [M.value ? (s(), m(S, { key: 0 }, [g(b(lt), {
|
|
2328
|
+
class: "tpl-spinner",
|
|
2329
|
+
size: 18,
|
|
2330
|
+
"stroke-width": 2
|
|
2331
|
+
}), y(" " + c(b(a).image.uploading), 1)], 64)) : (s(), m(S, { key: 1 }, [g(b(ht), {
|
|
2332
|
+
size: 18,
|
|
2333
|
+
"stroke-width": 1.5
|
|
2334
|
+
}), y(" " + c(b(a).image.dropToUpload), 1)], 64))])) : w("", !0),
|
|
2335
|
+
g($, {
|
|
2336
|
+
"model-value": e.block.src,
|
|
2337
|
+
type: "url",
|
|
2338
|
+
placeholder: b(a).image.imageUrlPlaceholder,
|
|
2339
|
+
pulse: h.value,
|
|
2340
|
+
"onUpdate:modelValue": r[0] ||= (e) => D("src", e)
|
|
2341
|
+
}, null, 8, [
|
|
2342
|
+
"model-value",
|
|
2343
|
+
"placeholder",
|
|
2344
|
+
"pulse"
|
|
2345
|
+
]),
|
|
2346
|
+
f.value ? (s(), m("button", {
|
|
2347
|
+
key: 1,
|
|
2348
|
+
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",
|
|
2349
|
+
style: {
|
|
2350
|
+
"border-color": "var(--tpl-border)",
|
|
2351
|
+
color: "var(--tpl-primary)",
|
|
2352
|
+
"background-color": "var(--tpl-bg)"
|
|
2353
|
+
},
|
|
2354
|
+
onClick: A
|
|
2355
|
+
}, [g(b(_e), {
|
|
2356
|
+
size: 14,
|
|
2357
|
+
"stroke-width": 1.5
|
|
2358
|
+
}), y(" " + c(b(a).image.browseMedia), 1)])) : w("", !0)
|
|
2359
|
+
], 512)]),
|
|
2360
|
+
b(z)(e.block.src, b(l)) ? (s(), m("div", Ra, [p("label", { class: n(b(K)) }, [y(c(b(a).image.placeholderUrl) + " ", 1), r[9] ||= p("span", { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, c("(optional)"), -1)], 2), p("input", {
|
|
2361
|
+
type: "url",
|
|
2362
|
+
class: n(b(G)),
|
|
2363
|
+
value: e.block.placeholderUrl || "",
|
|
2364
|
+
placeholder: b(a).image.placeholderUrlPlaceholder,
|
|
2365
|
+
onInput: r[1] ||= (e) => D("placeholderUrl", e.target.value)
|
|
2366
|
+
}, null, 42, za)])) : w("", !0),
|
|
2367
|
+
p("div", Ba, [
|
|
2368
|
+
p("label", { class: n(b(K)) }, c(b(a).image.altText), 3),
|
|
2369
|
+
g($, {
|
|
2370
|
+
"model-value": e.block.alt,
|
|
2371
|
+
type: "text",
|
|
2372
|
+
placeholder: b(a).image.altTextPlaceholder,
|
|
2373
|
+
pulse: _.value,
|
|
2374
|
+
disabled: e.block.decorative === !0,
|
|
2375
|
+
"onUpdate:modelValue": r[2] ||= (e) => D("alt", e)
|
|
2376
|
+
}, null, 8, [
|
|
2377
|
+
"model-value",
|
|
2378
|
+
"placeholder",
|
|
2379
|
+
"pulse",
|
|
2380
|
+
"disabled"
|
|
2381
|
+
]),
|
|
2382
|
+
p("label", Va, [p("input", {
|
|
2383
|
+
type: "checkbox",
|
|
2384
|
+
class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
|
|
2385
|
+
checked: e.block.decorative === !0,
|
|
2386
|
+
onChange: r[3] ||= (e) => D("decorative", e.target.checked)
|
|
2387
|
+
}, null, 40, Ha), p("span", null, [y(c(b(a).image.decorative) + " ", 1), p("span", Ua, c(b(a).image.decorativeHint), 1)])])
|
|
2388
|
+
]),
|
|
2389
|
+
p("div", Wa, [
|
|
2390
|
+
p("label", { class: n(b(K)) }, c(b(a).image.width), 3),
|
|
2391
|
+
p("select", {
|
|
2392
|
+
class: n(b(G)),
|
|
2393
|
+
value: T.value,
|
|
2394
|
+
onChange: r[4] ||= (e) => O(e.target.value)
|
|
2395
|
+
}, [
|
|
2396
|
+
p("option", Ka, c(b(a).image.fullWidth), 1),
|
|
2397
|
+
r[10] ||= p("option", { value: "300" }, "300px", -1),
|
|
2398
|
+
r[11] ||= p("option", { value: "400" }, "400px", -1),
|
|
2399
|
+
r[12] ||= p("option", { value: "500" }, "500px", -1),
|
|
2400
|
+
p("option", qa, c(b(a).image.widthCustom), 1)
|
|
2401
|
+
], 42, Ga),
|
|
2402
|
+
T.value === "custom" ? (s(), m("div", Ja, [p("input", {
|
|
2403
|
+
type: "number",
|
|
2404
|
+
class: n(b(J)),
|
|
2405
|
+
value: typeof e.block.width == "number" ? e.block.width : eo,
|
|
2406
|
+
min: "20",
|
|
2407
|
+
onInput: r[5] ||= (e) => k(e.target.value)
|
|
2408
|
+
}, null, 42, Ya), p("span", { class: n(b(q)) }, "px", 2)])) : w("", !0)
|
|
2409
|
+
]),
|
|
2410
|
+
p("div", Xa, [p("label", { class: n(b(K)) }, c(b(a).title.align), 3), g(Z, {
|
|
2411
|
+
options: [
|
|
2412
|
+
{
|
|
2413
|
+
value: "left",
|
|
2414
|
+
label: b(a).title.alignLeft
|
|
2415
|
+
},
|
|
2416
|
+
{
|
|
2417
|
+
value: "center",
|
|
2418
|
+
label: b(a).title.alignCenter
|
|
2419
|
+
},
|
|
2420
|
+
{
|
|
2421
|
+
value: "right",
|
|
2422
|
+
label: b(a).title.alignRight
|
|
2423
|
+
}
|
|
2424
|
+
],
|
|
2425
|
+
"model-value": e.block.align,
|
|
2426
|
+
"onUpdate:modelValue": r[6] ||= (e) => D("align", e)
|
|
2427
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2428
|
+
p("div", Za, [
|
|
2429
|
+
p("label", { class: n(b(K)) }, c(b(a).image.linkUrl), 3),
|
|
2430
|
+
g($, {
|
|
2431
|
+
"model-value": e.block.linkUrl || "",
|
|
2432
|
+
type: "url",
|
|
2433
|
+
placeholder: b(a).image.imageUrlPlaceholder,
|
|
2434
|
+
"onUpdate:modelValue": r[7] ||= (e) => D("linkUrl", e)
|
|
2435
|
+
}, null, 8, ["model-value", "placeholder"]),
|
|
2436
|
+
e.block.linkUrl ? (s(), m("label", Qa, [p("input", {
|
|
2437
|
+
type: "checkbox",
|
|
2438
|
+
class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
|
|
2439
|
+
checked: e.block.linkOpenInNewTab ?? !1,
|
|
2440
|
+
onChange: r[8] ||= (e) => D("linkOpenInNewTab", e.target.checked)
|
|
2441
|
+
}, null, 40, $a), y(" " + c(b(a).image.openInNewTab), 1)])) : w("", !0)
|
|
2442
|
+
])
|
|
2443
|
+
], 64));
|
|
2444
|
+
}
|
|
2445
|
+
}), no = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, ro = { class: "tpl:flex tpl:items-center tpl:gap-2" }, io = [
|
|
2446
|
+
"value",
|
|
2447
|
+
"placeholder",
|
|
2448
|
+
"onInput"
|
|
2449
|
+
], ao = ["title", "onClick"], oo = { class: "tpl:flex tpl:items-center tpl:gap-3 tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, so = ["checked", "onChange"], co = { class: "tpl:flex tpl:items-center tpl:gap-2" }, lo = ["value"], uo = { value: "" }, fo = ["value"], po = ["value"], mo = /* @__PURE__ */ f({
|
|
2450
|
+
__name: "MenuToolbar",
|
|
2451
|
+
props: {
|
|
2452
|
+
block: {},
|
|
2453
|
+
fontFamilies: {}
|
|
2454
|
+
},
|
|
2455
|
+
emits: ["update"],
|
|
2456
|
+
setup(t, { emit: r }) {
|
|
2457
|
+
let i = t, a = r, { t: o } = U(), u = C(() => [
|
|
2458
|
+
{
|
|
2459
|
+
key: "openInNewTab",
|
|
2460
|
+
label: o.menu.openInNewTab
|
|
2461
|
+
},
|
|
2462
|
+
{
|
|
2463
|
+
key: "bold",
|
|
2464
|
+
label: o.menu.bold
|
|
2465
|
+
},
|
|
2466
|
+
{
|
|
2467
|
+
key: "underline",
|
|
2468
|
+
label: o.menu.underline
|
|
2469
|
+
}
|
|
2470
|
+
]), d = C(() => [
|
|
2471
|
+
{
|
|
2472
|
+
value: "left",
|
|
2473
|
+
label: o.title.alignLeft,
|
|
2474
|
+
icon: pt
|
|
2475
|
+
},
|
|
2476
|
+
{
|
|
2477
|
+
value: "center",
|
|
2478
|
+
label: o.title.alignCenter,
|
|
2479
|
+
icon: dt
|
|
2480
|
+
},
|
|
2481
|
+
{
|
|
2482
|
+
value: "right",
|
|
2483
|
+
label: o.title.alignRight,
|
|
2484
|
+
icon: ft
|
|
2485
|
+
}
|
|
2486
|
+
]);
|
|
2487
|
+
function f(e, t) {
|
|
2488
|
+
a("update", { [e]: t });
|
|
2489
|
+
}
|
|
2490
|
+
function h() {
|
|
2491
|
+
let e = {
|
|
2492
|
+
id: P(),
|
|
2493
|
+
text: "",
|
|
2494
|
+
url: "",
|
|
2495
|
+
openInNewTab: !1,
|
|
2496
|
+
bold: !1,
|
|
2497
|
+
underline: !1
|
|
2498
|
+
};
|
|
2499
|
+
a("update", { items: [...i.block.items, e] });
|
|
2500
|
+
}
|
|
2501
|
+
function _(e, t, n) {
|
|
2502
|
+
let r = i.block.items.map((r) => r.id === e ? {
|
|
2503
|
+
...r,
|
|
2504
|
+
[t]: n
|
|
2505
|
+
} : r);
|
|
2506
|
+
a("update", { items: r });
|
|
2507
|
+
}
|
|
2508
|
+
function v(e) {
|
|
2509
|
+
a("update", { items: i.block.items.filter((t) => t.id !== e) });
|
|
2510
|
+
}
|
|
2511
|
+
return (r, i) => (s(), m(S, null, [
|
|
2512
|
+
g(X, { label: b(o).menu.items }, {
|
|
2513
|
+
default: l(() => [p("div", no, [(s(!0), m(S, null, e(t.block.items, (r) => (s(), m("div", {
|
|
2514
|
+
key: r.id,
|
|
2515
|
+
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"
|
|
2516
|
+
}, [
|
|
2517
|
+
p("div", ro, [p("input", {
|
|
2518
|
+
type: "text",
|
|
2519
|
+
class: n([b(G), "tpl:flex-1"]),
|
|
2520
|
+
value: r.text,
|
|
2521
|
+
placeholder: b(o).menu.text,
|
|
2522
|
+
onInput: (e) => _(r.id, "text", e.target.value)
|
|
2523
|
+
}, null, 42, io), p("button", {
|
|
2524
|
+
class: n(b(Ct)),
|
|
2525
|
+
title: b(o).menu.removeItem,
|
|
2526
|
+
onClick: (e) => v(r.id)
|
|
2527
|
+
}, [g(b(gt), {
|
|
2528
|
+
size: 14,
|
|
2529
|
+
"stroke-width": 2
|
|
2530
|
+
})], 10, ao)]),
|
|
2531
|
+
g($, {
|
|
2532
|
+
"model-value": r.url,
|
|
2533
|
+
type: "url",
|
|
2534
|
+
placeholder: b(o).menu.urlPlaceholder,
|
|
2535
|
+
"onUpdate:modelValue": (e) => _(r.id, "url", e)
|
|
2536
|
+
}, null, 8, [
|
|
2537
|
+
"model-value",
|
|
2538
|
+
"placeholder",
|
|
2539
|
+
"onUpdate:modelValue"
|
|
2540
|
+
]),
|
|
2541
|
+
p("div", oo, [(s(!0), m(S, null, e(u.value, (e) => (s(), m("label", {
|
|
2542
|
+
key: e.key,
|
|
2543
|
+
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1"
|
|
2544
|
+
}, [p("input", {
|
|
2545
|
+
type: "checkbox",
|
|
2546
|
+
checked: r[e.key],
|
|
2547
|
+
class: "tpl:accent-[var(--tpl-primary)]",
|
|
2548
|
+
onChange: (t) => _(r.id, e.key, t.target.checked)
|
|
2549
|
+
}, null, 40, so), y(" " + c(e.label), 1)]))), 128))]),
|
|
2550
|
+
p("div", co, [p("label", { class: n([b(K), "tpl:!mb-0"]) }, c(b(o).menu.color), 3), g(Y, {
|
|
2551
|
+
"swatch-only": "",
|
|
2552
|
+
"model-value": r.color || t.block.linkColor || t.block.color,
|
|
2553
|
+
"onUpdate:modelValue": (e) => _(r.id, "color", e)
|
|
2554
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])])
|
|
2555
|
+
]))), 128)), p("button", {
|
|
2556
|
+
class: n(b(wt)),
|
|
2557
|
+
onClick: h
|
|
2558
|
+
}, [g(b(Q), {
|
|
2559
|
+
size: 14,
|
|
2560
|
+
"stroke-width": 2
|
|
2561
|
+
}), y(" " + c(b(o).menu.addItem), 1)], 2)])]),
|
|
2562
|
+
_: 1
|
|
2563
|
+
}, 8, ["label"]),
|
|
2564
|
+
g(X, { label: b(o).menu.fontFamily }, {
|
|
2565
|
+
default: l(() => [p("select", {
|
|
2566
|
+
class: n(b(G)),
|
|
2567
|
+
value: t.block.fontFamily || "",
|
|
2568
|
+
onChange: i[0] ||= (e) => f("fontFamily", e.target.value || void 0)
|
|
2569
|
+
}, [p("option", uo, c(b(o).title.inheritFont), 1), (s(!0), m(S, null, e(t.fontFamilies, (e) => (s(), m("option", {
|
|
2570
|
+
key: e.value,
|
|
2571
|
+
value: e.value
|
|
2572
|
+
}, c(e.label), 9, fo))), 128))], 42, lo)]),
|
|
2573
|
+
_: 1
|
|
2574
|
+
}, 8, ["label"]),
|
|
2575
|
+
g(X, { label: b(o).menu.fontSize }, {
|
|
2576
|
+
default: l(() => [g(kt, {
|
|
2577
|
+
"model-value": t.block.fontSize,
|
|
2578
|
+
min: 8,
|
|
2579
|
+
max: 48,
|
|
2580
|
+
suffix: "px",
|
|
2581
|
+
"onUpdate:modelValue": i[1] ||= (e) => f("fontSize", e)
|
|
2582
|
+
}, null, 8, ["model-value"])]),
|
|
2583
|
+
_: 1
|
|
2584
|
+
}, 8, ["label"]),
|
|
2585
|
+
g(X, { label: b(o).menu.color }, {
|
|
2586
|
+
default: l(() => [g(Y, {
|
|
2587
|
+
"model-value": t.block.color,
|
|
2588
|
+
"onUpdate:modelValue": i[2] ||= (e) => f("color", e)
|
|
2589
|
+
}, null, 8, ["model-value"])]),
|
|
2590
|
+
_: 1
|
|
2591
|
+
}, 8, ["label"]),
|
|
2592
|
+
g(X, { label: b(o).menu.linkColor }, {
|
|
2593
|
+
default: l(() => [g(Y, {
|
|
2594
|
+
"model-value": t.block.linkColor || t.block.color,
|
|
2595
|
+
"onUpdate:modelValue": i[3] ||= (e) => f("linkColor", e || void 0)
|
|
2596
|
+
}, null, 8, ["model-value"])]),
|
|
2597
|
+
_: 1
|
|
2598
|
+
}, 8, ["label"]),
|
|
2599
|
+
g(X, { label: b(o).menu.textAlign }, {
|
|
2600
|
+
default: l(() => [g(Z, {
|
|
2601
|
+
options: d.value,
|
|
2602
|
+
"model-value": t.block.textAlign,
|
|
2603
|
+
"onUpdate:modelValue": i[4] ||= (e) => f("textAlign", e)
|
|
2604
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2605
|
+
_: 1
|
|
2606
|
+
}, 8, ["label"]),
|
|
2607
|
+
g(X, { label: b(o).menu.separator }, {
|
|
2608
|
+
default: l(() => [p("input", {
|
|
2609
|
+
type: "text",
|
|
2610
|
+
class: n(b(G)),
|
|
2611
|
+
value: t.block.separator,
|
|
2612
|
+
onInput: i[5] ||= (e) => f("separator", e.target.value)
|
|
2613
|
+
}, null, 42, po)]),
|
|
2614
|
+
_: 1
|
|
2615
|
+
}, 8, ["label"]),
|
|
2616
|
+
g(X, { label: b(o).menu.separatorColor }, {
|
|
2617
|
+
default: l(() => [g(Y, {
|
|
2618
|
+
"model-value": t.block.separatorColor,
|
|
2619
|
+
"onUpdate:modelValue": i[6] ||= (e) => f("separatorColor", e)
|
|
2620
|
+
}, null, 8, ["model-value"])]),
|
|
2621
|
+
_: 1
|
|
2622
|
+
}, 8, ["label"]),
|
|
2623
|
+
g(X, { label: b(o).menu.spacing }, {
|
|
2624
|
+
default: l(() => [g(kt, {
|
|
2625
|
+
"model-value": t.block.spacing,
|
|
2626
|
+
min: 0,
|
|
2627
|
+
max: 50,
|
|
2628
|
+
suffix: "px",
|
|
2629
|
+
"onUpdate:modelValue": i[7] ||= (e) => f("spacing", e)
|
|
2630
|
+
}, null, 8, ["model-value"])]),
|
|
2631
|
+
_: 1
|
|
2632
|
+
}, 8, ["label"])
|
|
2633
|
+
], 64));
|
|
2634
|
+
}
|
|
2635
|
+
});
|
|
2636
|
+
//#endregion
|
|
2637
|
+
//#region src/utils/rebalanceColumnChildren.ts
|
|
2638
|
+
function ho(e) {
|
|
2639
|
+
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
2640
|
+
}
|
|
2641
|
+
function go(e, t) {
|
|
2642
|
+
let n = ho(t);
|
|
2643
|
+
if (e.length === n) return e;
|
|
2644
|
+
if (e.length < n) {
|
|
2645
|
+
let t = Array.from({ length: n - e.length }, () => []);
|
|
2646
|
+
return [...e, ...t];
|
|
2647
|
+
}
|
|
2648
|
+
let r = e.slice(0, n), i = e.slice(n).flat(), a = [...r[n - 1], ...i];
|
|
2649
|
+
return [...r.slice(0, n - 1), a];
|
|
2650
|
+
}
|
|
2651
|
+
//#endregion
|
|
2652
|
+
//#region src/components/toolbar/SectionToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
2653
|
+
var _o = { class: "tpl:mb-3.5" }, vo = ["value"], yo = ["value"], bo = { class: "tpl:mb-3.5" }, xo = { class: "tpl:flex tpl:items-stretch" }, So = ["value"], Co = { class: "tpl:mb-3.5" }, wo = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, To = ["checked"], Eo = {
|
|
2654
|
+
key: 0,
|
|
2655
|
+
class: "tpl:mt-3 tpl:ml-0.5 tpl:space-y-3 tpl:border-l tpl:border-[var(--tpl-border)] tpl:pl-3"
|
|
2656
|
+
}, Do = { class: "tpl:flex tpl:items-stretch" }, Oo = ["value"], ko = /* @__PURE__ */ f({
|
|
2657
|
+
__name: "SectionToolbar",
|
|
2658
|
+
props: { block: {} },
|
|
2659
|
+
emits: ["update"],
|
|
2660
|
+
setup(t, { emit: r }) {
|
|
2661
|
+
let i = t, a = r, { t: o } = U(), l = C(() => [
|
|
2662
|
+
{
|
|
2663
|
+
value: "1",
|
|
2664
|
+
label: o.section.column1
|
|
2665
|
+
},
|
|
2666
|
+
{
|
|
2667
|
+
value: "2",
|
|
2668
|
+
label: o.section.column2
|
|
2669
|
+
},
|
|
2670
|
+
{
|
|
2671
|
+
value: "3",
|
|
2672
|
+
label: o.section.column3
|
|
2673
|
+
},
|
|
2674
|
+
{
|
|
2675
|
+
value: "1-2",
|
|
2676
|
+
label: o.section.ratio12
|
|
2677
|
+
},
|
|
2678
|
+
{
|
|
2679
|
+
value: "2-1",
|
|
2680
|
+
label: o.section.ratio21
|
|
2681
|
+
}
|
|
2682
|
+
]);
|
|
2683
|
+
function u(e) {
|
|
2684
|
+
let t = e.target.value, n = go(i.block.children, t);
|
|
2685
|
+
a("update", {
|
|
2686
|
+
columns: t,
|
|
2687
|
+
children: n
|
|
2688
|
+
});
|
|
2689
|
+
}
|
|
2690
|
+
function d(e) {
|
|
2691
|
+
let t = Number(e.target.value);
|
|
2692
|
+
a("update", { borderRadius: t });
|
|
2693
|
+
}
|
|
2694
|
+
function f(e) {
|
|
2695
|
+
a("update", { wrapper: e ? { padding: {
|
|
2696
|
+
top: 20,
|
|
2697
|
+
right: 20,
|
|
2698
|
+
bottom: 20,
|
|
2699
|
+
left: 20
|
|
2700
|
+
} } : void 0 });
|
|
2701
|
+
}
|
|
2702
|
+
function h(e) {
|
|
2703
|
+
a("update", { wrapper: {
|
|
2704
|
+
...i.block.wrapper,
|
|
2705
|
+
...e
|
|
2706
|
+
} });
|
|
2707
|
+
}
|
|
2708
|
+
function _(e) {
|
|
2709
|
+
h({ padding: e });
|
|
2710
|
+
}
|
|
2711
|
+
function v(e) {
|
|
2712
|
+
h({ borderRadius: Number(e.target.value) });
|
|
2713
|
+
}
|
|
2714
|
+
return (r, i) => (s(), m(S, null, [
|
|
2715
|
+
p("div", _o, [p("label", { class: n(b(K)) }, c(b(o).section.columns), 3), p("select", {
|
|
2716
|
+
class: n(b(G)),
|
|
2717
|
+
value: t.block.columns,
|
|
2718
|
+
onChange: u
|
|
2719
|
+
}, [(s(!0), m(S, null, e(l.value, (e) => (s(), m("option", {
|
|
2720
|
+
key: e.value,
|
|
2721
|
+
value: e.value
|
|
2722
|
+
}, c(e.label), 9, yo))), 128))], 42, vo)]),
|
|
2723
|
+
p("div", bo, [p("label", { class: n(b(K)) }, c(b(o).section.borderRadius), 3), p("div", xo, [p("input", {
|
|
2724
|
+
type: "number",
|
|
2725
|
+
class: n(b(J)),
|
|
2726
|
+
value: t.block.borderRadius ?? 0,
|
|
2727
|
+
min: "0",
|
|
2728
|
+
max: "50",
|
|
2729
|
+
onInput: d
|
|
2730
|
+
}, null, 42, So), p("span", { class: n(b(q)) }, "px", 2)])]),
|
|
2731
|
+
p("div", Co, [p("label", wo, [p("input", {
|
|
2732
|
+
type: "checkbox",
|
|
2733
|
+
class: "tpl:accent-[var(--tpl-primary)]",
|
|
2734
|
+
checked: !!t.block.wrapper,
|
|
2735
|
+
onChange: i[0] ||= (e) => f(e.target.checked)
|
|
2736
|
+
}, null, 40, To), y(" " + c(b(o).section.wrapperEnable), 1)]), t.block.wrapper ? (s(), m("div", Eo, [
|
|
2737
|
+
p("div", null, [p("label", { class: n(b(K)) }, c(b(o).blockSettings.color), 3), g(Y, {
|
|
2738
|
+
"model-value": t.block.wrapper.backgroundColor ?? "",
|
|
2739
|
+
"onUpdate:modelValue": i[1] ||= (e) => h({ backgroundColor: e })
|
|
2740
|
+
}, null, 8, ["model-value"])]),
|
|
2741
|
+
g(yi, {
|
|
2742
|
+
label: b(o).blockSettings.padding,
|
|
2743
|
+
"model-value": t.block.wrapper.padding ?? {
|
|
2744
|
+
top: 0,
|
|
2745
|
+
right: 0,
|
|
2746
|
+
bottom: 0,
|
|
2747
|
+
left: 0
|
|
2748
|
+
},
|
|
2749
|
+
"onUpdate:modelValue": _
|
|
2750
|
+
}, null, 8, ["label", "model-value"]),
|
|
2751
|
+
p("div", null, [p("label", { class: n(b(K)) }, c(b(o).section.borderRadius), 3), p("div", Do, [p("input", {
|
|
2752
|
+
type: "number",
|
|
2753
|
+
class: n(b(J)),
|
|
2754
|
+
value: t.block.wrapper.borderRadius ?? 0,
|
|
2755
|
+
min: "0",
|
|
2756
|
+
max: "50",
|
|
2757
|
+
onInput: v
|
|
2758
|
+
}, null, 42, Oo), p("span", { class: n(b(q)) }, "px", 2)])])
|
|
2759
|
+
])) : w("", !0)])
|
|
2760
|
+
], 64));
|
|
2761
|
+
}
|
|
2762
|
+
}), Ao = { class: "tpl:mb-3.5" }, jo = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Mo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, No = ["value", "onChange"], Po = ["value"], Fo = ["title", "onClick"], Io = { class: "tpl:mb-3.5" }, Lo = ["value"], Ro = { value: "solid" }, zo = { value: "outlined" }, Bo = { value: "rounded" }, Vo = { value: "square" }, Ho = { value: "circle" }, Uo = { class: "tpl:mb-3.5" }, Wo = { class: "tpl:mb-3.5" }, Go = { class: "tpl:flex tpl:items-stretch" }, Ko = ["value"], qo = { class: "tpl:mb-3.5" }, Jo = /* @__PURE__ */ f({
|
|
2763
|
+
__name: "SocialToolbar",
|
|
2764
|
+
props: { block: {} },
|
|
2765
|
+
emits: ["update"],
|
|
2766
|
+
setup(t, { emit: r }) {
|
|
2767
|
+
let i = t, a = r, { t: o } = U();
|
|
2768
|
+
function l(e, t) {
|
|
2769
|
+
a("update", { [e]: t });
|
|
2770
|
+
}
|
|
2771
|
+
function u() {
|
|
2772
|
+
let e = {
|
|
2773
|
+
id: P(),
|
|
2774
|
+
platform: "facebook",
|
|
2775
|
+
url: ""
|
|
2776
|
+
};
|
|
2777
|
+
a("update", { icons: [...i.block.icons, e] });
|
|
2778
|
+
}
|
|
2779
|
+
function d(e, t, n) {
|
|
2780
|
+
let r = i.block.icons.map((r) => r.id === e ? {
|
|
2781
|
+
...r,
|
|
2782
|
+
[t]: n
|
|
2783
|
+
} : r);
|
|
2784
|
+
a("update", { icons: r });
|
|
2785
|
+
}
|
|
2786
|
+
function f(e) {
|
|
2787
|
+
a("update", { icons: i.block.icons.filter((t) => t.id !== e) });
|
|
2788
|
+
}
|
|
2789
|
+
return (r, i) => (s(), m(S, null, [
|
|
2790
|
+
p("div", Ao, [p("label", { class: n(b(K)) }, c(b(o).social.icons), 3), p("div", jo, [(s(!0), m(S, null, e(t.block.icons, (t) => (s(), m("div", {
|
|
2791
|
+
key: t.id,
|
|
2792
|
+
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"
|
|
2793
|
+
}, [p("div", Mo, [p("select", {
|
|
2794
|
+
"data-testid": "social-platform-select",
|
|
2795
|
+
class: n([b(G), "tpl:flex-1"]),
|
|
2796
|
+
value: t.platform,
|
|
2797
|
+
onChange: (e) => d(t.id, "platform", e.target.value)
|
|
2798
|
+
}, [(s(!0), m(S, null, e(b(xe), (e) => (s(), m("option", {
|
|
2799
|
+
key: e,
|
|
2800
|
+
value: e
|
|
2801
|
+
}, c(b(o).social.platforms[e]), 9, Po))), 128))], 42, No), p("button", {
|
|
2802
|
+
class: n(b(Ct)),
|
|
2803
|
+
title: b(o).social.removeIcon,
|
|
2804
|
+
onClick: (e) => f(t.id)
|
|
2805
|
+
}, [g(b(gt), {
|
|
2806
|
+
size: 14,
|
|
2807
|
+
"stroke-width": 2
|
|
2808
|
+
})], 10, Fo)]), g($, {
|
|
2809
|
+
"model-value": t.url,
|
|
2810
|
+
type: "url",
|
|
2811
|
+
placeholder: b(o).social.urlPlaceholder,
|
|
2812
|
+
"onUpdate:modelValue": (e) => d(t.id, "url", e)
|
|
2813
|
+
}, null, 8, [
|
|
2814
|
+
"model-value",
|
|
2815
|
+
"placeholder",
|
|
2816
|
+
"onUpdate:modelValue"
|
|
2817
|
+
])]))), 128)), p("button", {
|
|
2818
|
+
class: n(b(wt)),
|
|
2819
|
+
onClick: u
|
|
2820
|
+
}, [g(b(Q), {
|
|
2821
|
+
size: 14,
|
|
2822
|
+
"stroke-width": 2
|
|
2823
|
+
}), y(" " + c(b(o).social.addIcon), 1)], 2)])]),
|
|
2824
|
+
p("div", Io, [p("label", { class: n(b(K)) }, c(b(o).social.style), 3), p("select", {
|
|
2825
|
+
class: n(b(G)),
|
|
2826
|
+
value: t.block.iconStyle,
|
|
2827
|
+
onChange: i[0] ||= (e) => l("iconStyle", e.target.value)
|
|
2828
|
+
}, [
|
|
2829
|
+
p("option", Ro, c(b(o).social.styleSolid), 1),
|
|
2830
|
+
p("option", zo, c(b(o).social.styleOutlined), 1),
|
|
2831
|
+
p("option", Bo, c(b(o).social.styleRounded), 1),
|
|
2832
|
+
p("option", Vo, c(b(o).social.styleSquare), 1),
|
|
2833
|
+
p("option", Ho, c(b(o).social.styleCircle), 1)
|
|
2834
|
+
], 42, Lo)]),
|
|
2835
|
+
p("div", Uo, [p("label", { class: n(b(K)) }, c(b(o).social.size), 3), g(Z, {
|
|
2836
|
+
options: [
|
|
2837
|
+
{
|
|
2838
|
+
value: "small",
|
|
2839
|
+
label: b(o).social.sizeSmall
|
|
2840
|
+
},
|
|
2841
|
+
{
|
|
2842
|
+
value: "medium",
|
|
2843
|
+
label: b(o).social.sizeMedium
|
|
2844
|
+
},
|
|
2845
|
+
{
|
|
2846
|
+
value: "large",
|
|
2847
|
+
label: b(o).social.sizeLarge
|
|
2848
|
+
}
|
|
2849
|
+
],
|
|
2850
|
+
"model-value": t.block.iconSize,
|
|
2851
|
+
"onUpdate:modelValue": i[1] ||= (e) => l("iconSize", e)
|
|
2852
|
+
}, null, 8, ["options", "model-value"])]),
|
|
2853
|
+
p("div", Wo, [p("label", { class: n(b(K)) }, c(b(o).social.spacing), 3), p("div", Go, [p("input", {
|
|
2854
|
+
type: "number",
|
|
2855
|
+
class: n(b(J)),
|
|
2856
|
+
value: t.block.spacing,
|
|
2857
|
+
min: "0",
|
|
2858
|
+
max: "50",
|
|
2859
|
+
onInput: i[2] ||= (e) => l("spacing", Number(e.target.value))
|
|
2860
|
+
}, null, 42, Ko), p("span", { class: n(b(q)) }, "px", 2)])]),
|
|
2861
|
+
p("div", qo, [p("label", { class: n(b(K)) }, c(b(o).social.align), 3), g(Z, {
|
|
2862
|
+
options: [
|
|
2863
|
+
{
|
|
2864
|
+
value: "left",
|
|
2865
|
+
label: b(o).title.alignLeft,
|
|
2866
|
+
icon: b(pt)
|
|
2867
|
+
},
|
|
2868
|
+
{
|
|
2869
|
+
value: "center",
|
|
2870
|
+
label: b(o).title.alignCenter,
|
|
2871
|
+
icon: b(dt)
|
|
2872
|
+
},
|
|
2873
|
+
{
|
|
2874
|
+
value: "right",
|
|
2875
|
+
label: b(o).title.alignRight,
|
|
2876
|
+
icon: b(ft)
|
|
2877
|
+
}
|
|
2878
|
+
],
|
|
2879
|
+
"model-value": t.block.align,
|
|
2880
|
+
"onUpdate:modelValue": i[3] ||= (e) => l("align", e)
|
|
2881
|
+
}, null, 8, ["options", "model-value"])])
|
|
2882
|
+
], 64));
|
|
2883
|
+
}
|
|
2884
|
+
}), Yo = { class: "tpl:mb-3.5" }, Xo = { class: "tpl:flex tpl:items-stretch" }, Zo = ["value"], Qo = ["value"], $o = /* @__PURE__ */ f({
|
|
2885
|
+
__name: "SpacerToolbar",
|
|
2886
|
+
props: { block: {} },
|
|
2887
|
+
emits: ["update"],
|
|
2888
|
+
setup(e, { emit: t }) {
|
|
2889
|
+
let r = t, { t: i } = U();
|
|
2890
|
+
return (t, a) => (s(), m("div", Yo, [
|
|
2891
|
+
p("label", { class: n(b(K)) }, c(b(i).spacer.height), 3),
|
|
2892
|
+
p("div", Xo, [p("input", {
|
|
2893
|
+
type: "number",
|
|
2894
|
+
class: n(b(J)),
|
|
2895
|
+
value: e.block.height,
|
|
2896
|
+
min: "10",
|
|
2897
|
+
max: "100",
|
|
2898
|
+
onInput: a[0] ||= (e) => r("update", { height: Number(e.target.value) })
|
|
2899
|
+
}, null, 42, Zo), p("span", { class: n(b(q)) }, "px", 2)]),
|
|
2900
|
+
p("input", {
|
|
2901
|
+
type: "range",
|
|
2902
|
+
class: "tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",
|
|
2903
|
+
value: e.block.height,
|
|
2904
|
+
min: "10",
|
|
2905
|
+
max: "100",
|
|
2906
|
+
onInput: a[1] ||= (e) => r("update", { height: Number(e.target.value) })
|
|
2907
|
+
}, null, 40, Qo)
|
|
2908
|
+
]));
|
|
2909
|
+
}
|
|
2910
|
+
}), es = { class: "tpl:mb-3.5" }, ts = { class: "tpl:flex tpl:items-center tpl:gap-3" }, ns = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, rs = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, is = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, as = ["disabled"], os = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, ss = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, cs = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, ls = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, us = ["disabled"], ds = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, fs = { class: "tpl:mb-3.5" }, ps = { 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)]" }, ms = ["checked"], hs = {
|
|
2911
|
+
key: 0,
|
|
2912
|
+
class: "tpl:mb-3.5"
|
|
2913
|
+
}, gs = { class: "tpl:mb-3.5" }, _s = { class: "tpl:mb-3.5" }, vs = { class: "tpl:flex tpl:items-stretch" }, ys = ["value"], bs = { class: "tpl:mb-3.5" }, xs = { class: "tpl:flex tpl:items-stretch" }, Ss = ["value"], Cs = { class: "tpl:mb-3.5" }, ws = ["value"], Ts = { value: "" }, Es = ["value"], Ds = { class: "tpl:mb-3.5" }, Os = { class: "tpl:flex tpl:items-stretch" }, ks = ["value"], As = { class: "tpl:mb-3.5" }, js = { class: "tpl:mb-3.5" }, Ms = /* @__PURE__ */ f({
|
|
2914
|
+
__name: "TableToolbar",
|
|
2915
|
+
props: {
|
|
2916
|
+
block: {},
|
|
2917
|
+
fontFamilies: {}
|
|
2918
|
+
},
|
|
2919
|
+
emits: ["update"],
|
|
2920
|
+
setup(t, { emit: r }) {
|
|
2921
|
+
let i = t, a = r, { t: o } = U(), l = C(() => i.block.rows.length > 0 ? i.block.rows[0].cells.length : 0);
|
|
2922
|
+
function u(e, t) {
|
|
2923
|
+
a("update", { [e]: t });
|
|
2924
|
+
}
|
|
2925
|
+
function d() {
|
|
2926
|
+
let e = i.block.rows.length > 0 ? i.block.rows[0].cells.length : 3, t = {
|
|
2927
|
+
id: P(),
|
|
2928
|
+
cells: Array.from({ length: e }, () => ({
|
|
2929
|
+
id: P(),
|
|
2930
|
+
content: ""
|
|
2931
|
+
}))
|
|
2932
|
+
};
|
|
2933
|
+
a("update", { rows: [...i.block.rows, t] });
|
|
2934
|
+
}
|
|
2935
|
+
function f(e) {
|
|
2936
|
+
a("update", { rows: i.block.rows.filter((t) => t.id !== e) });
|
|
2937
|
+
}
|
|
2938
|
+
function h() {
|
|
2939
|
+
let e = i.block.rows.map((e) => ({
|
|
2940
|
+
...e,
|
|
2941
|
+
cells: [...e.cells, {
|
|
2942
|
+
id: P(),
|
|
2943
|
+
content: ""
|
|
2944
|
+
}]
|
|
2945
|
+
}));
|
|
2946
|
+
a("update", { rows: e });
|
|
2947
|
+
}
|
|
2948
|
+
function _(e) {
|
|
2949
|
+
let t = i.block.rows.map((t) => ({
|
|
2950
|
+
...t,
|
|
2951
|
+
cells: t.cells.filter((t, n) => n !== e)
|
|
2952
|
+
}));
|
|
2953
|
+
a("update", { rows: t });
|
|
2954
|
+
}
|
|
2955
|
+
return (r, i) => (s(), m(S, null, [
|
|
2956
|
+
p("div", es, [p("label", { class: n(b(K)) }, c(b(o).table.dimensions), 3), p("div", ts, [p("div", ns, [p("span", rs, c(b(o).table.rows), 1), p("div", is, [
|
|
2957
|
+
p("button", {
|
|
2958
|
+
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",
|
|
2959
|
+
disabled: t.block.rows.length <= 1,
|
|
2960
|
+
onClick: i[0] ||= (e) => f(t.block.rows[t.block.rows.length - 1].id)
|
|
2961
|
+
}, [g(b(et), {
|
|
2962
|
+
size: 12,
|
|
2963
|
+
"stroke-width": 2
|
|
2964
|
+
})], 8, as),
|
|
2965
|
+
p("span", os, c(t.block.rows.length), 1),
|
|
2966
|
+
p("button", {
|
|
2967
|
+
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)]",
|
|
2968
|
+
onClick: d
|
|
2969
|
+
}, [g(b(Q), {
|
|
2970
|
+
size: 12,
|
|
2971
|
+
"stroke-width": 2
|
|
2972
|
+
})])
|
|
2973
|
+
])]), p("div", ss, [p("span", cs, c(b(o).table.columns), 1), p("div", ls, [
|
|
2974
|
+
p("button", {
|
|
2975
|
+
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",
|
|
2976
|
+
disabled: l.value <= 1,
|
|
2977
|
+
onClick: i[1] ||= (e) => _(l.value - 1)
|
|
2978
|
+
}, [g(b(et), {
|
|
2979
|
+
size: 12,
|
|
2980
|
+
"stroke-width": 2
|
|
2981
|
+
})], 8, us),
|
|
2982
|
+
p("span", ds, c(l.value), 1),
|
|
2983
|
+
p("button", {
|
|
2984
|
+
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)]",
|
|
2985
|
+
onClick: h
|
|
2986
|
+
}, [g(b(Q), {
|
|
2987
|
+
size: 12,
|
|
2988
|
+
"stroke-width": 2
|
|
2989
|
+
})])
|
|
2990
|
+
])])])]),
|
|
2991
|
+
p("div", fs, [p("label", ps, [p("input", {
|
|
2992
|
+
type: "checkbox",
|
|
2993
|
+
checked: t.block.hasHeaderRow,
|
|
2994
|
+
class: "tpl:accent-[var(--tpl-primary)]",
|
|
2995
|
+
onChange: i[2] ||= (e) => u("hasHeaderRow", e.target.checked)
|
|
2996
|
+
}, null, 40, ms), y(" " + c(b(o).table.hasHeaderRow), 1)])]),
|
|
2997
|
+
t.block.hasHeaderRow ? (s(), m("div", hs, [p("label", { class: n(b(K)) }, c(b(o).table.headerBackgroundColor), 3), g(Y, {
|
|
2998
|
+
"model-value": t.block.headerBackgroundColor ?? "",
|
|
2999
|
+
"seed-color": b(Dt),
|
|
3000
|
+
placeholder: b(o).table.noHeaderBg,
|
|
3001
|
+
"onUpdate:modelValue": i[3] ||= (e) => u("headerBackgroundColor", e || null)
|
|
3002
|
+
}, null, 8, [
|
|
3003
|
+
"model-value",
|
|
3004
|
+
"seed-color",
|
|
3005
|
+
"placeholder"
|
|
3006
|
+
])])) : w("", !0),
|
|
3007
|
+
p("div", gs, [p("label", { class: n(b(K)) }, c(b(o).table.borderColor), 3), g(Y, {
|
|
3008
|
+
"model-value": t.block.borderColor,
|
|
3009
|
+
"onUpdate:modelValue": i[4] ||= (e) => u("borderColor", e)
|
|
3010
|
+
}, null, 8, ["model-value"])]),
|
|
3011
|
+
p("div", _s, [p("label", { class: n(b(K)) }, c(b(o).table.borderWidth), 3), p("div", vs, [p("input", {
|
|
3012
|
+
type: "number",
|
|
3013
|
+
class: n(b(J)),
|
|
3014
|
+
value: t.block.borderWidth,
|
|
3015
|
+
min: "0",
|
|
3016
|
+
max: "10",
|
|
3017
|
+
onInput: i[5] ||= (e) => u("borderWidth", Number(e.target.value))
|
|
3018
|
+
}, null, 42, ys), p("span", { class: n(b(q)) }, "px", 2)])]),
|
|
3019
|
+
p("div", bs, [p("label", { class: n(b(K)) }, c(b(o).table.cellPadding), 3), p("div", xs, [p("input", {
|
|
3020
|
+
type: "number",
|
|
3021
|
+
class: n(b(J)),
|
|
3022
|
+
value: t.block.cellPadding,
|
|
3023
|
+
min: "0",
|
|
3024
|
+
max: "30",
|
|
3025
|
+
onInput: i[6] ||= (e) => u("cellPadding", Number(e.target.value))
|
|
3026
|
+
}, null, 42, Ss), p("span", { class: n(b(q)) }, "px", 2)])]),
|
|
3027
|
+
p("div", Cs, [p("label", { class: n(b(K)) }, c(b(o).table.fontFamily), 3), p("select", {
|
|
3028
|
+
class: n(b(G)),
|
|
3029
|
+
value: t.block.fontFamily || "",
|
|
3030
|
+
onChange: i[7] ||= (e) => u("fontFamily", e.target.value || void 0)
|
|
3031
|
+
}, [p("option", Ts, c(b(o).title.inheritFont), 1), (s(!0), m(S, null, e(t.fontFamilies, (e) => (s(), m("option", {
|
|
3032
|
+
key: e.value,
|
|
3033
|
+
value: e.value
|
|
3034
|
+
}, c(e.label), 9, Es))), 128))], 42, ws)]),
|
|
3035
|
+
p("div", Ds, [p("label", { class: n(b(K)) }, c(b(o).table.fontSize), 3), p("div", Os, [p("input", {
|
|
3036
|
+
type: "number",
|
|
3037
|
+
class: n(b(J)),
|
|
3038
|
+
value: t.block.fontSize,
|
|
3039
|
+
min: "10",
|
|
3040
|
+
max: "32",
|
|
3041
|
+
onInput: i[8] ||= (e) => u("fontSize", Number(e.target.value))
|
|
3042
|
+
}, null, 42, ks), p("span", { class: n(b(q)) }, "px", 2)])]),
|
|
3043
|
+
p("div", As, [p("label", { class: n(b(K)) }, c(b(o).table.color), 3), g(Y, {
|
|
3044
|
+
"model-value": t.block.color,
|
|
3045
|
+
"onUpdate:modelValue": i[9] ||= (e) => u("color", e)
|
|
3046
|
+
}, null, 8, ["model-value"])]),
|
|
3047
|
+
p("div", js, [p("label", { class: n(b(K)) }, c(b(o).table.textAlign), 3), g(Z, {
|
|
3048
|
+
options: [
|
|
3049
|
+
{
|
|
3050
|
+
value: "left",
|
|
3051
|
+
label: b(o).title.alignLeft,
|
|
3052
|
+
icon: b(pt)
|
|
3053
|
+
},
|
|
3054
|
+
{
|
|
3055
|
+
value: "center",
|
|
3056
|
+
label: b(o).title.alignCenter,
|
|
3057
|
+
icon: b(dt)
|
|
3058
|
+
},
|
|
3059
|
+
{
|
|
3060
|
+
value: "right",
|
|
3061
|
+
label: b(o).title.alignRight,
|
|
3062
|
+
icon: b(ft)
|
|
3063
|
+
}
|
|
3064
|
+
],
|
|
3065
|
+
"model-value": t.block.textAlign,
|
|
3066
|
+
"onUpdate:modelValue": i[10] ||= (e) => u("textAlign", e)
|
|
3067
|
+
}, null, 8, ["options", "model-value"])])
|
|
3068
|
+
], 64));
|
|
3069
|
+
}
|
|
3070
|
+
}), Ns = { class: "tpl:mb-3.5" }, Ps = ["value"], Fs = { value: 1 }, Is = { value: 2 }, Ls = { value: 3 }, Rs = { value: 4 }, zs = { class: "tpl:mb-3.5" }, Bs = ["value"], Vs = { value: "" }, Hs = ["value"], Us = { class: "tpl:mb-3.5" }, Ws = { class: "tpl:mb-3.5" }, Gs = /* @__PURE__ */ f({
|
|
3071
|
+
__name: "TitleToolbar",
|
|
3072
|
+
props: {
|
|
3073
|
+
block: {},
|
|
3074
|
+
fontFamilies: {}
|
|
3075
|
+
},
|
|
3076
|
+
emits: ["update"],
|
|
3077
|
+
setup(t, { emit: r }) {
|
|
3078
|
+
let i = r, { t: a } = U();
|
|
3079
|
+
function o(e, t) {
|
|
3080
|
+
i("update", { [e]: t });
|
|
3081
|
+
}
|
|
3082
|
+
return (r, i) => (s(), m(S, null, [
|
|
3083
|
+
p("div", Ns, [p("label", { class: n(b(K)) }, c(b(a).title.level), 3), p("select", {
|
|
3084
|
+
class: n(b(G)),
|
|
3085
|
+
value: t.block.level,
|
|
3086
|
+
onChange: i[0] ||= (e) => o("level", Number(e.target.value))
|
|
3087
|
+
}, [
|
|
3088
|
+
p("option", Fs, c(b(a).title.heading1), 1),
|
|
3089
|
+
p("option", Is, c(b(a).title.heading2), 1),
|
|
3090
|
+
p("option", Ls, c(b(a).title.heading3), 1),
|
|
3091
|
+
p("option", Rs, c(b(a).title.heading4), 1)
|
|
3092
|
+
], 42, Ps)]),
|
|
3093
|
+
p("div", zs, [p("label", { class: n(b(K)) }, c(b(a).title.fontFamily), 3), p("select", {
|
|
3094
|
+
class: n(b(G)),
|
|
3095
|
+
value: t.block.fontFamily || "",
|
|
3096
|
+
onChange: i[1] ||= (e) => o("fontFamily", e.target.value || void 0)
|
|
3097
|
+
}, [p("option", Vs, c(b(a).title.inheritFont), 1), (s(!0), m(S, null, e(t.fontFamilies, (e) => (s(), m("option", {
|
|
3098
|
+
key: e.value,
|
|
3099
|
+
value: e.value
|
|
3100
|
+
}, c(e.label), 9, Hs))), 128))], 42, Bs)]),
|
|
3101
|
+
p("div", Us, [p("label", { class: n(b(K)) }, c(b(a).title.color), 3), g(Y, {
|
|
3102
|
+
"model-value": t.block.color,
|
|
3103
|
+
"onUpdate:modelValue": i[2] ||= (e) => o("color", e)
|
|
3104
|
+
}, null, 8, ["model-value"])]),
|
|
3105
|
+
p("div", Ws, [p("label", { class: n(b(K)) }, c(b(a).title.align), 3), g(Z, {
|
|
3106
|
+
options: [
|
|
3107
|
+
{
|
|
3108
|
+
value: "left",
|
|
3109
|
+
label: b(a).title.alignLeft,
|
|
3110
|
+
icon: b(pt)
|
|
3111
|
+
},
|
|
3112
|
+
{
|
|
3113
|
+
value: "center",
|
|
3114
|
+
label: b(a).title.alignCenter,
|
|
3115
|
+
icon: b(dt)
|
|
3116
|
+
},
|
|
3117
|
+
{
|
|
3118
|
+
value: "right",
|
|
3119
|
+
label: b(a).title.alignRight,
|
|
3120
|
+
icon: b(ft)
|
|
3121
|
+
}
|
|
3122
|
+
],
|
|
3123
|
+
"model-value": t.block.textAlign,
|
|
3124
|
+
"onUpdate:modelValue": i[3] ||= (e) => o("textAlign", e)
|
|
3125
|
+
}, null, 8, ["options", "model-value"])])
|
|
3126
|
+
], 64));
|
|
3127
|
+
}
|
|
3128
|
+
}), Ks = { class: "tpl:mb-3.5" }, qs = {
|
|
3129
|
+
key: 0,
|
|
3130
|
+
class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
|
|
3131
|
+
}, Js = ["checked"], Ys = {
|
|
3132
|
+
key: 0,
|
|
3133
|
+
class: "tpl:mb-3.5"
|
|
3134
|
+
}, Xs = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, Zs = [
|
|
3135
|
+
"value",
|
|
3136
|
+
"placeholder",
|
|
3137
|
+
"title"
|
|
3138
|
+
], Qs = { class: "tpl:mb-3.5" }, $s = { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, ec = { class: "tpl:mb-3.5" }, tc = { class: "tpl:mb-3.5" }, nc = ["value"], rc = { value: "full" }, ic = { class: "tpl:mb-3.5" }, ac = /* @__PURE__ */ f({
|
|
3139
|
+
__name: "VideoToolbar",
|
|
3140
|
+
props: { block: {} },
|
|
3141
|
+
emits: ["update"],
|
|
3142
|
+
setup(e, { emit: t }) {
|
|
3143
|
+
let r = e, i = t, { t: a } = U(), o = E(Ae, null), l = E(Ie, B.liquid), u = bt(), f = C(() => !!o), h = C(() => z(r.block.url, l)), _ = d(!1), { start: v } = ke(() => {
|
|
3144
|
+
_.value = !1;
|
|
3145
|
+
}, 1e3, { immediate: !1 });
|
|
3146
|
+
function x(e, t) {
|
|
3147
|
+
i("update", { [e]: t });
|
|
3148
|
+
}
|
|
3149
|
+
async function T() {
|
|
3150
|
+
let e = await o?.({ accept: ["images"] });
|
|
3151
|
+
u.alive && e && (x("thumbnailUrl", e.url), _.value = !0, v());
|
|
3152
|
+
}
|
|
3153
|
+
return (t, r) => (s(), m(S, null, [
|
|
3154
|
+
p("div", Ks, [
|
|
3155
|
+
p("label", { class: n(b(K)) }, c(b(a).video.videoUrl), 3),
|
|
3156
|
+
g($, {
|
|
3157
|
+
"model-value": e.block.url,
|
|
3158
|
+
type: "url",
|
|
3159
|
+
placeholder: b(a).video.videoUrlPlaceholder,
|
|
3160
|
+
"onUpdate:modelValue": r[0] ||= (e) => x("url", e)
|
|
3161
|
+
}, null, 8, ["model-value", "placeholder"]),
|
|
3162
|
+
e.block.url ? (s(), m("label", qs, [p("input", {
|
|
3163
|
+
type: "checkbox",
|
|
3164
|
+
class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
|
|
3165
|
+
checked: e.block.openInNewTab ?? !1,
|
|
3166
|
+
onChange: r[1] ||= (e) => x("openInNewTab", e.target.checked)
|
|
3167
|
+
}, null, 40, Js), y(" " + c(b(a).video.openInNewTab), 1)])) : w("", !0)
|
|
3168
|
+
]),
|
|
3169
|
+
h.value ? (s(), m("div", Ys, [p("label", { class: n(b(K)) }, [y(c(b(a).video.placeholderUrl) + " ", 1), p("span", Xs, c(b(a).video.optional), 1)], 2), p("input", {
|
|
3170
|
+
type: "url",
|
|
3171
|
+
class: n(b(G)),
|
|
3172
|
+
value: e.block.placeholderUrl || "",
|
|
3173
|
+
placeholder: b(a).video.placeholderUrlPlaceholder,
|
|
3174
|
+
title: b(a).video.placeholderUrlTooltip,
|
|
3175
|
+
onInput: r[2] ||= (e) => x("placeholderUrl", e.target.value)
|
|
3176
|
+
}, null, 42, Zs)])) : w("", !0),
|
|
3177
|
+
p("div", Qs, [
|
|
3178
|
+
p("label", { class: n(b(K)) }, [y(c(b(a).video.customThumbnail) + " ", 1), p("span", $s, c(b(a).video.optional), 1)], 2),
|
|
3179
|
+
g($, {
|
|
3180
|
+
"model-value": e.block.thumbnailUrl,
|
|
3181
|
+
type: "url",
|
|
3182
|
+
placeholder: b(a).video.thumbnailPlaceholder,
|
|
3183
|
+
pulse: _.value,
|
|
3184
|
+
"onUpdate:modelValue": r[3] ||= (e) => x("thumbnailUrl", e)
|
|
3185
|
+
}, null, 8, [
|
|
3186
|
+
"model-value",
|
|
3187
|
+
"placeholder",
|
|
3188
|
+
"pulse"
|
|
3189
|
+
]),
|
|
3190
|
+
f.value ? (s(), m("button", {
|
|
3191
|
+
key: 0,
|
|
3192
|
+
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",
|
|
3193
|
+
style: {
|
|
3194
|
+
"border-color": "var(--tpl-border)",
|
|
3195
|
+
color: "var(--tpl-primary)",
|
|
3196
|
+
"background-color": "var(--tpl-bg)"
|
|
3197
|
+
},
|
|
3198
|
+
onClick: T
|
|
3199
|
+
}, [g(b(_e), {
|
|
3200
|
+
size: 14,
|
|
3201
|
+
"stroke-width": 1.5
|
|
3202
|
+
}), y(" " + c(b(a).image.browseMedia), 1)])) : w("", !0)
|
|
3203
|
+
]),
|
|
3204
|
+
p("div", ec, [p("label", { class: n(b(K)) }, c(b(a).video.altText), 3), g($, {
|
|
3205
|
+
"model-value": e.block.alt,
|
|
3206
|
+
type: "text",
|
|
3207
|
+
placeholder: b(a).video.altTextPlaceholder,
|
|
3208
|
+
"onUpdate:modelValue": r[4] ||= (e) => x("alt", e)
|
|
3209
|
+
}, null, 8, ["model-value", "placeholder"])]),
|
|
3210
|
+
p("div", tc, [p("label", { class: n(b(K)) }, c(b(a).video.width), 3), p("select", {
|
|
3211
|
+
class: n(b(G)),
|
|
3212
|
+
value: e.block.width,
|
|
3213
|
+
onChange: r[5] ||= (e) => x("width", e.target.value === "full" ? "full" : Number(e.target.value))
|
|
3214
|
+
}, [
|
|
3215
|
+
p("option", rc, c(b(a).video.fullWidth), 1),
|
|
3216
|
+
r[7] ||= p("option", { value: "300" }, "300px", -1),
|
|
3217
|
+
r[8] ||= p("option", { value: "400" }, "400px", -1),
|
|
3218
|
+
r[9] ||= p("option", { value: "500" }, "500px", -1)
|
|
3219
|
+
], 42, nc)]),
|
|
3220
|
+
p("div", ic, [p("label", { class: n(b(K)) }, c(b(a).title.align), 3), g(Z, {
|
|
3221
|
+
options: [
|
|
3222
|
+
{
|
|
3223
|
+
value: "left",
|
|
3224
|
+
label: b(a).title.alignLeft
|
|
3225
|
+
},
|
|
3226
|
+
{
|
|
3227
|
+
value: "center",
|
|
3228
|
+
label: b(a).title.alignCenter
|
|
3229
|
+
},
|
|
3230
|
+
{
|
|
3231
|
+
value: "right",
|
|
3232
|
+
label: b(a).title.alignRight
|
|
3233
|
+
}
|
|
3234
|
+
],
|
|
3235
|
+
"model-value": e.block.align,
|
|
3236
|
+
"onUpdate:modelValue": r[6] ||= (e) => x("align", e)
|
|
3237
|
+
}, null, 8, ["options", "model-value"])])
|
|
3238
|
+
], 64));
|
|
3239
|
+
}
|
|
3240
|
+
}), oc = ["aria-label"], sc = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5" }, cc = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]" }, lc = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, uc = { class: "tpl:flex tpl:gap-1" }, dc = ["title"], fc = ["title"], pc = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, mc = /*#__PURE__*/ _t(/* @__PURE__ */ f({
|
|
3241
|
+
__name: "Toolbar",
|
|
3242
|
+
props: { block: {} },
|
|
3243
|
+
emits: [
|
|
3244
|
+
"update",
|
|
3245
|
+
"delete",
|
|
3246
|
+
"duplicate"
|
|
3247
|
+
],
|
|
3248
|
+
setup(e, { emit: t }) {
|
|
3249
|
+
let n = h(() => import("./CountdownToolbar-CS0axcjz.js")), r = e, i = t, { t: a } = U(), l = Ne(Be, "Toolbar"), u = E(Re, []), d = C(() => r.block.type), f = C(() => L(r.block)), _ = C(() => {
|
|
3250
|
+
if (f.value) return u.find((e) => e.type === r.block.customType);
|
|
3251
|
+
}), y = C(() => f.value ? _.value?.name ?? r.block.customType : ie(d.value, a)), x = l.fonts;
|
|
3252
|
+
function T(e) {
|
|
3253
|
+
i("update", e);
|
|
3254
|
+
}
|
|
3255
|
+
return (t, r) => (s(), m("aside", {
|
|
3256
|
+
"aria-label": b(a).landmarks.blockToolbar,
|
|
3257
|
+
class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"
|
|
3258
|
+
}, [p("div", sc, [p("div", cc, [b(rt)[d.value] ? (s(), v(o(b(rt)[d.value]), {
|
|
3259
|
+
key: 0,
|
|
3260
|
+
size: 16,
|
|
3261
|
+
"stroke-width": 1.5
|
|
3262
|
+
})) : f.value ? (s(), v(b(se), {
|
|
3263
|
+
key: 1,
|
|
3264
|
+
size: 16,
|
|
3265
|
+
"stroke-width": 1.5
|
|
3266
|
+
})) : w("", !0), p("h3", lc, c(y.value), 1)]), p("div", uc, [p("button", {
|
|
3267
|
+
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)]",
|
|
3268
|
+
title: b(a).toolbar.duplicate,
|
|
3269
|
+
onClick: r[0] ||= (e) => i("duplicate")
|
|
3270
|
+
}, [g(b(oe), {
|
|
3271
|
+
size: 14,
|
|
3272
|
+
"stroke-width": 2
|
|
3273
|
+
})], 8, dc), p("button", {
|
|
3274
|
+
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)]",
|
|
3275
|
+
title: b(a).toolbar.delete,
|
|
3276
|
+
onClick: r[1] ||= (e) => i("delete")
|
|
3277
|
+
}, [g(b(mt), {
|
|
3278
|
+
size: 14,
|
|
3279
|
+
"stroke-width": 2
|
|
3280
|
+
})], 8, fc)])]), p("div", pc, [f.value ? (s(), v(Ta, {
|
|
3281
|
+
key: 0,
|
|
3282
|
+
block: e.block,
|
|
3283
|
+
onUpdateFieldValues: r[2] ||= (e) => i("update", { fieldValues: e }),
|
|
3284
|
+
onUpdateDataSourceFetched: r[3] ||= (e) => i("update", { dataSourceFetched: e })
|
|
3285
|
+
}, null, 8, ["block"])) : d.value === "section" ? (s(), v(ko, {
|
|
3286
|
+
key: 1,
|
|
3287
|
+
block: e.block,
|
|
3288
|
+
onUpdate: T
|
|
3289
|
+
}, null, 8, ["block"])) : d.value === "title" ? (s(), v(Gs, {
|
|
3290
|
+
key: 2,
|
|
3291
|
+
block: e.block,
|
|
3292
|
+
"font-families": b(x),
|
|
3293
|
+
onUpdate: T
|
|
3294
|
+
}, null, 8, ["block", "font-families"])) : d.value === "paragraph" ? (s(), m(S, { key: 3 }, [], 64)) : d.value === "image" ? (s(), v(to, {
|
|
3295
|
+
key: 4,
|
|
3296
|
+
block: e.block,
|
|
3297
|
+
onUpdate: T
|
|
3298
|
+
}, null, 8, ["block"])) : d.value === "video" ? (s(), v(ac, {
|
|
3299
|
+
key: 5,
|
|
3300
|
+
block: e.block,
|
|
3301
|
+
onUpdate: T
|
|
3302
|
+
}, null, 8, ["block"])) : d.value === "button" ? (s(), v(Yr, {
|
|
3303
|
+
key: 6,
|
|
3304
|
+
block: e.block,
|
|
3305
|
+
"font-families": b(x),
|
|
3306
|
+
onUpdate: T
|
|
3307
|
+
}, null, 8, ["block", "font-families"])) : d.value === "divider" ? (s(), v(ja, {
|
|
3308
|
+
key: 7,
|
|
3309
|
+
block: e.block,
|
|
3310
|
+
onUpdate: T
|
|
3311
|
+
}, null, 8, ["block"])) : d.value === "social" ? (s(), v(Jo, {
|
|
3312
|
+
key: 8,
|
|
3313
|
+
block: e.block,
|
|
3314
|
+
onUpdate: T
|
|
3315
|
+
}, null, 8, ["block"])) : d.value === "menu" ? (s(), v(mo, {
|
|
3316
|
+
key: 9,
|
|
3317
|
+
block: e.block,
|
|
3318
|
+
"font-families": b(x),
|
|
3319
|
+
onUpdate: T
|
|
3320
|
+
}, null, 8, ["block", "font-families"])) : d.value === "table" ? (s(), v(Ms, {
|
|
3321
|
+
key: 10,
|
|
3322
|
+
block: e.block,
|
|
3323
|
+
"font-families": b(x),
|
|
3324
|
+
onUpdate: T
|
|
3325
|
+
}, null, 8, ["block", "font-families"])) : d.value === "spacer" ? (s(), v($o, {
|
|
3326
|
+
key: 11,
|
|
3327
|
+
block: e.block,
|
|
3328
|
+
onUpdate: T
|
|
3329
|
+
}, null, 8, ["block"])) : d.value === "html" ? (s(), v(Fa, {
|
|
3330
|
+
key: 12,
|
|
3331
|
+
block: e.block,
|
|
3332
|
+
onUpdate: T
|
|
3333
|
+
}, null, 8, ["block"])) : d.value === "countdown" ? (s(), v(b(n), {
|
|
3334
|
+
key: 13,
|
|
3335
|
+
block: e.block,
|
|
3336
|
+
"font-families": b(x),
|
|
3337
|
+
onUpdate: T
|
|
3338
|
+
}, null, 8, ["block", "font-families"])) : w("", !0), g(Bi, {
|
|
3339
|
+
block: e.block,
|
|
3340
|
+
"is-first-section": d.value === "paragraph",
|
|
3341
|
+
onUpdate: T
|
|
3342
|
+
}, null, 8, ["block", "is-first-section"])])], 8, oc));
|
|
3343
|
+
}
|
|
3344
|
+
}), [["__scopeId", "data-v-2ac88283"]]), hc = ["aria-label"], gc = {
|
|
3345
|
+
role: "tablist",
|
|
3346
|
+
class: "tpl:relative tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-active)] tpl:p-1.5"
|
|
3347
|
+
}, _c = [
|
|
3348
|
+
"aria-selected",
|
|
3349
|
+
"aria-label",
|
|
3350
|
+
"title"
|
|
3351
|
+
], vc = { key: 0 }, yc = [
|
|
3352
|
+
"aria-selected",
|
|
3353
|
+
"aria-label",
|
|
3354
|
+
"title"
|
|
3355
|
+
], bc = { key: 0 }, xc = [
|
|
3356
|
+
"aria-selected",
|
|
3357
|
+
"aria-label",
|
|
3358
|
+
"title"
|
|
3359
|
+
], Sc = { key: 0 }, Cc = {
|
|
3360
|
+
key: 1,
|
|
3361
|
+
class: "tpl:ml-1 tpl:rounded-full tpl:bg-[var(--tpl-bg-hover)] tpl:px-1.5 tpl:text-[10px]"
|
|
3362
|
+
}, wc = {
|
|
3363
|
+
key: 0,
|
|
3364
|
+
id: "tpl-tabpanel-content",
|
|
3365
|
+
role: "tabpanel",
|
|
3366
|
+
"aria-labelledby": "tpl-tab-content",
|
|
3367
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
|
|
3368
|
+
}, Tc = {
|
|
3369
|
+
key: 1,
|
|
3370
|
+
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)]"
|
|
3371
|
+
}, Ec = { class: "tpl:mb-4 tpl:text-[var(--tpl-text-dim)]" }, Dc = { class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Oc = { class: "tpl:m-0 tpl:text-sm tpl:leading-normal" }, kc = {
|
|
3372
|
+
key: 1,
|
|
3373
|
+
id: "tpl-tabpanel-settings",
|
|
3374
|
+
role: "tabpanel",
|
|
3375
|
+
"aria-labelledby": "tpl-tab-settings",
|
|
3376
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
|
|
3377
|
+
}, Ac = {
|
|
3378
|
+
key: 2,
|
|
3379
|
+
id: "tpl-tabpanel-issues",
|
|
3380
|
+
role: "tabpanel",
|
|
3381
|
+
"aria-labelledby": "tpl-tab-issues",
|
|
3382
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
|
|
3383
|
+
}, jc = /* @__PURE__ */ f({
|
|
3384
|
+
__name: "RightSidebar",
|
|
3385
|
+
props: {
|
|
3386
|
+
selectedBlock: {},
|
|
3387
|
+
settings: {},
|
|
3388
|
+
shiftedLeft: { type: Boolean }
|
|
3389
|
+
},
|
|
3390
|
+
emits: [
|
|
3391
|
+
"update-block",
|
|
3392
|
+
"delete-block",
|
|
3393
|
+
"duplicate-block",
|
|
3394
|
+
"update-settings"
|
|
3395
|
+
],
|
|
3396
|
+
setup(e, { emit: r }) {
|
|
3397
|
+
let a = h(() => import("./IssuesPanel-CR1MPaDE.js")), o = e, l = r, { t: u } = U(), f = d("content"), _ = E(Pe, null), y = C(() => _ !== null), x = C(() => _?.issues.value.length ?? 0);
|
|
3398
|
+
function S(e) {
|
|
3399
|
+
return f.value === e ? "tpl:flex-1 tpl:text-[var(--tpl-primary)]" : "tpl:shrink-0 tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]";
|
|
3400
|
+
}
|
|
3401
|
+
function T(e) {
|
|
3402
|
+
return f.value === e ? {
|
|
3403
|
+
backgroundColor: "var(--tpl-bg)",
|
|
3404
|
+
boxShadow: "var(--tpl-shadow-md)"
|
|
3405
|
+
} : { backgroundColor: "transparent" };
|
|
3406
|
+
}
|
|
3407
|
+
return i(() => o.selectedBlock, (e) => {
|
|
3408
|
+
e && (f.value = "content");
|
|
3409
|
+
}), (r, i) => (s(), m("aside", {
|
|
3410
|
+
"aria-label": b(u).landmarks.rightSidebar,
|
|
3411
|
+
class: n(["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"])
|
|
3412
|
+
}, [
|
|
3413
|
+
p("div", gc, [
|
|
3414
|
+
p("button", {
|
|
3415
|
+
id: "tpl-tab-content",
|
|
3416
|
+
role: "tab",
|
|
3417
|
+
"aria-selected": f.value === "content",
|
|
3418
|
+
"aria-controls": "tpl-tabpanel-content",
|
|
3419
|
+
"aria-label": b(u).sidebar.content,
|
|
3420
|
+
title: b(u).sidebar.content,
|
|
3421
|
+
class: n(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", S("content")]),
|
|
3422
|
+
style: t(T("content")),
|
|
3423
|
+
onClick: i[0] ||= (e) => f.value = "content"
|
|
3424
|
+
}, [g(b(Vt), {
|
|
3425
|
+
size: 14,
|
|
3426
|
+
"stroke-width": 2
|
|
3427
|
+
}), f.value === "content" ? (s(), m("span", vc, c(b(u).sidebar.content), 1)) : w("", !0)], 14, _c),
|
|
3428
|
+
p("button", {
|
|
3429
|
+
id: "tpl-tab-settings",
|
|
3430
|
+
role: "tab",
|
|
3431
|
+
"aria-selected": f.value === "settings",
|
|
3432
|
+
"aria-controls": "tpl-tabpanel-settings",
|
|
3433
|
+
"aria-label": b(u).sidebar.settings,
|
|
3434
|
+
title: b(u).sidebar.settings,
|
|
3435
|
+
class: n(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", S("settings")]),
|
|
3436
|
+
style: t(T("settings")),
|
|
3437
|
+
onClick: i[1] ||= (e) => f.value = "settings"
|
|
3438
|
+
}, [g(b(Ut), {
|
|
3439
|
+
size: 14,
|
|
3440
|
+
"stroke-width": 1.5
|
|
3441
|
+
}), f.value === "settings" ? (s(), m("span", bc, c(b(u).sidebar.settings), 1)) : w("", !0)], 14, yc),
|
|
3442
|
+
y.value ? (s(), m("button", {
|
|
3443
|
+
key: 0,
|
|
3444
|
+
id: "tpl-tab-issues",
|
|
3445
|
+
role: "tab",
|
|
3446
|
+
"aria-selected": f.value === "issues",
|
|
3447
|
+
"aria-controls": "tpl-tabpanel-issues",
|
|
3448
|
+
"aria-label": b(u).issues.panelTabLabel,
|
|
3449
|
+
title: b(u).issues.panelTabLabel,
|
|
3450
|
+
class: n(["tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", S("issues")]),
|
|
3451
|
+
style: t(T("issues")),
|
|
3452
|
+
onClick: i[2] ||= (e) => f.value = "issues"
|
|
3453
|
+
}, [
|
|
3454
|
+
g(b(ct), {
|
|
3455
|
+
size: 14,
|
|
3456
|
+
"stroke-width": 1.5
|
|
3457
|
+
}),
|
|
3458
|
+
f.value === "issues" ? (s(), m("span", Sc, c(b(u).issues.panelTabLabel), 1)) : w("", !0),
|
|
3459
|
+
x.value > 0 ? (s(), m("span", Cc, c(x.value), 1)) : w("", !0)
|
|
3460
|
+
], 14, xc)) : w("", !0)
|
|
3461
|
+
]),
|
|
3462
|
+
f.value === "content" ? (s(), m("div", wc, [e.selectedBlock ? (s(), v(mc, {
|
|
3463
|
+
key: 0,
|
|
3464
|
+
block: e.selectedBlock,
|
|
3465
|
+
onUpdate: i[3] ||= (e) => l("update-block", e),
|
|
3466
|
+
onDelete: i[4] ||= (e) => l("delete-block"),
|
|
3467
|
+
onDuplicate: i[5] ||= (e) => l("duplicate-block")
|
|
3468
|
+
}, null, 8, ["block"])) : (s(), m("div", Tc, [
|
|
3469
|
+
p("div", Ec, [g(b(It), {
|
|
3470
|
+
size: 40,
|
|
3471
|
+
"stroke-width": 1.5
|
|
3472
|
+
})]),
|
|
3473
|
+
p("h3", Dc, c(b(u).sidebar.noSelection), 1),
|
|
3474
|
+
p("p", Oc, c(b(u).sidebar.noSelectionHint), 1)
|
|
3475
|
+
]))])) : w("", !0),
|
|
3476
|
+
f.value === "settings" ? (s(), m("div", kc, [g(_r, {
|
|
3477
|
+
settings: e.settings,
|
|
3478
|
+
onUpdate: i[6] ||= (e) => l("update-settings", e)
|
|
3479
|
+
}, null, 8, ["settings"])])) : w("", !0),
|
|
3480
|
+
f.value === "issues" && y.value ? (s(), m("div", Ac, [g(b(a))])) : w("", !0)
|
|
3481
|
+
], 10, hc));
|
|
3482
|
+
}
|
|
3483
|
+
}), Mc = {
|
|
3484
|
+
class: "tpl-small-screen-notice tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-6 tpl:py-10 tpl:text-center tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)]",
|
|
3485
|
+
style: { "z-index": "10001" },
|
|
3486
|
+
role: "status",
|
|
3487
|
+
"data-testid": "small-screen-notice"
|
|
3488
|
+
}, Nc = { class: "tpl:text-[var(--tpl-text-dim)]" }, Pc = { class: "tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Fc = { class: "tpl:m-0 tpl:max-w-sm tpl:text-sm tpl:leading-normal" }, Ic = /* @__PURE__ */ f({
|
|
3489
|
+
__name: "SmallScreenNotice",
|
|
3490
|
+
setup(e) {
|
|
3491
|
+
let { t } = U();
|
|
3492
|
+
return (e, n) => (s(), m("div", Mc, [
|
|
3493
|
+
p("div", Nc, [g(b(zt), {
|
|
3494
|
+
size: 48,
|
|
3495
|
+
"stroke-width": 1.5
|
|
3496
|
+
})]),
|
|
3497
|
+
p("h2", Pc, c(b(t).smallScreen.title), 1),
|
|
3498
|
+
p("p", Fc, c(b(t).smallScreen.message), 1)
|
|
3499
|
+
]));
|
|
3500
|
+
}
|
|
3501
|
+
}), Lc = ["aria-label"], Rc = [
|
|
3502
|
+
"aria-checked",
|
|
3503
|
+
"aria-label",
|
|
3504
|
+
"title",
|
|
3505
|
+
"onClick"
|
|
3506
|
+
], zc = /* @__PURE__ */ f({
|
|
3507
|
+
__name: "ViewportToggle",
|
|
3508
|
+
props: { viewport: {} },
|
|
3509
|
+
emits: ["change"],
|
|
3510
|
+
setup(n, { emit: r }) {
|
|
3511
|
+
let i = n, a = r, { t: o } = U(), l = C(() => [{
|
|
3512
|
+
value: "desktop",
|
|
3513
|
+
label: o.viewport.desktop
|
|
3514
|
+
}, {
|
|
3515
|
+
value: "mobile",
|
|
3516
|
+
label: o.viewport.mobile
|
|
3517
|
+
}]), u = C(() => `translateX(${l.value.findIndex((e) => e.value === i.viewport) * 100}%)`);
|
|
3518
|
+
return (r, i) => (s(), m("div", {
|
|
3519
|
+
role: "radiogroup",
|
|
3520
|
+
"aria-label": b(o).viewport.label,
|
|
3521
|
+
class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
|
|
3522
|
+
style: t({
|
|
3523
|
+
gridTemplateColumns: `repeat(${l.value.length}, 1fr)`,
|
|
3524
|
+
backgroundColor: "var(--tpl-bg-hover)"
|
|
3525
|
+
})
|
|
3526
|
+
}, [p("div", {
|
|
3527
|
+
class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
|
|
3528
|
+
style: t({
|
|
3529
|
+
left: "4px",
|
|
3530
|
+
width: `calc((100% - 8px) / ${l.value.length})`,
|
|
3531
|
+
transform: u.value,
|
|
3532
|
+
backgroundColor: "var(--tpl-bg)",
|
|
3533
|
+
boxShadow: "var(--tpl-shadow)",
|
|
3534
|
+
transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
3535
|
+
})
|
|
3536
|
+
}, null, 4), (s(!0), m(S, null, e(l.value, (e) => (s(), m("button", {
|
|
3537
|
+
key: e.value,
|
|
3538
|
+
role: "radio",
|
|
3539
|
+
"aria-checked": n.viewport === e.value,
|
|
3540
|
+
"aria-label": e.label,
|
|
3541
|
+
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",
|
|
3542
|
+
style: t({
|
|
3543
|
+
color: n.viewport === e.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
3544
|
+
transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
3545
|
+
}),
|
|
3546
|
+
title: e.label,
|
|
3547
|
+
onClick: (t) => a("change", e.value)
|
|
3548
|
+
}, [e.value === "desktop" ? (s(), v(b(zt), {
|
|
3549
|
+
key: 0,
|
|
3550
|
+
size: 18,
|
|
3551
|
+
"stroke-width": 1.5
|
|
3552
|
+
})) : (s(), v(b(Wt), {
|
|
3553
|
+
key: 1,
|
|
3554
|
+
size: 18,
|
|
3555
|
+
"stroke-width": 1.5
|
|
3556
|
+
})), p("span", null, c(e.label), 1)], 12, Rc))), 128))], 12, Lc));
|
|
3557
|
+
}
|
|
3558
|
+
}), Bc = [
|
|
3559
|
+
"aria-label",
|
|
3560
|
+
"title",
|
|
3561
|
+
"aria-pressed"
|
|
3562
|
+
], Vc = /*#__PURE__*/ _t(/* @__PURE__ */ f({
|
|
3563
|
+
__name: "PreviewToggle",
|
|
3564
|
+
props: { previewMode: { type: Boolean } },
|
|
3565
|
+
emits: ["change"],
|
|
3566
|
+
setup(e, { emit: n }) {
|
|
3567
|
+
let r = n, { t: i } = U();
|
|
3568
|
+
return (n, a) => (s(), m("button", {
|
|
3569
|
+
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",
|
|
3570
|
+
style: t({
|
|
3571
|
+
color: e.previewMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
3572
|
+
backgroundColor: e.previewMode ? "var(--tpl-primary-light)" : "transparent"
|
|
3573
|
+
}),
|
|
3574
|
+
"aria-label": e.previewMode ? b(i).previewMode.disable : b(i).previewMode.enable,
|
|
3575
|
+
title: e.previewMode ? b(i).previewMode.disable : b(i).previewMode.enable,
|
|
3576
|
+
"aria-pressed": e.previewMode,
|
|
3577
|
+
onClick: a[0] ||= (t) => r("change", !e.previewMode)
|
|
3578
|
+
}, [g(N, {
|
|
3579
|
+
"enter-active-class": "tpl-icon-enter-active",
|
|
3580
|
+
"leave-active-class": "tpl-icon-leave-active",
|
|
3581
|
+
"enter-from-class": "tpl-icon-enter-from",
|
|
3582
|
+
"leave-to-class": "tpl-icon-leave-to",
|
|
3583
|
+
mode: "out-in"
|
|
3584
|
+
}, {
|
|
3585
|
+
default: l(() => [e.previewMode ? (s(), v(b(it), {
|
|
3586
|
+
key: "eye",
|
|
3587
|
+
size: 18,
|
|
3588
|
+
"stroke-width": 1.5
|
|
3589
|
+
})) : (s(), v(b(ae), {
|
|
3590
|
+
key: "eye-off",
|
|
3591
|
+
size: 18,
|
|
3592
|
+
"stroke-width": 1.5
|
|
3593
|
+
}))]),
|
|
3594
|
+
_: 1
|
|
3595
|
+
})], 12, Bc));
|
|
3596
|
+
}
|
|
3597
|
+
}), [["__scopeId", "data-v-af87d02a"]]), Hc = [
|
|
3598
|
+
"aria-label",
|
|
3599
|
+
"title",
|
|
3600
|
+
"aria-pressed"
|
|
3601
|
+
], Uc = /*#__PURE__*/ _t(/* @__PURE__ */ f({
|
|
3602
|
+
__name: "DarkModeToggle",
|
|
3603
|
+
props: { darkMode: { type: Boolean } },
|
|
3604
|
+
emits: ["change"],
|
|
3605
|
+
setup(e, { emit: n }) {
|
|
3606
|
+
let r = n, { t: i } = U();
|
|
3607
|
+
return (n, a) => (s(), m("button", {
|
|
3608
|
+
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",
|
|
3609
|
+
style: t({
|
|
3610
|
+
color: e.darkMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
3611
|
+
backgroundColor: e.darkMode ? "var(--tpl-primary-light)" : "transparent"
|
|
3612
|
+
}),
|
|
3613
|
+
"aria-label": e.darkMode ? b(i).darkMode.disable : b(i).darkMode.enable,
|
|
3614
|
+
title: e.darkMode ? b(i).darkMode.disable : b(i).darkMode.enable,
|
|
3615
|
+
"aria-pressed": e.darkMode,
|
|
3616
|
+
onClick: a[0] ||= (t) => r("change", !e.darkMode)
|
|
3617
|
+
}, [g(N, {
|
|
3618
|
+
"enter-active-class": "tpl-icon-enter-active",
|
|
3619
|
+
"leave-active-class": "tpl-icon-leave-active",
|
|
3620
|
+
"enter-from-class": "tpl-icon-enter-from",
|
|
3621
|
+
"leave-to-class": "tpl-icon-leave-to",
|
|
3622
|
+
mode: "out-in"
|
|
3623
|
+
}, {
|
|
3624
|
+
default: l(() => [e.darkMode ? (s(), v(b(Bt), {
|
|
3625
|
+
key: "moon",
|
|
3626
|
+
size: 18,
|
|
3627
|
+
"stroke-width": 1.5
|
|
3628
|
+
})) : (s(), v(b(qt), {
|
|
3629
|
+
key: "sun",
|
|
3630
|
+
size: 18,
|
|
3631
|
+
"stroke-width": 1.5
|
|
3632
|
+
}))]),
|
|
3633
|
+
_: 1
|
|
3634
|
+
})], 12, Hc));
|
|
3635
|
+
}
|
|
3636
|
+
}), [["__scopeId", "data-v-f8694f76"]]), Wc = {
|
|
3637
|
+
class: "tpl:pointer-events-auto tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-tl-lg tpl:p-1",
|
|
3638
|
+
style: {
|
|
3639
|
+
"background-color": "color-mix(\n in srgb,\n var(--tpl-canvas-bg) 85%,\n transparent\n )",
|
|
3640
|
+
"backdrop-filter": "blur(8px)",
|
|
3641
|
+
"-webkit-backdrop-filter": "blur(8px)"
|
|
3642
|
+
}
|
|
3643
|
+
}, Gc = {
|
|
3644
|
+
href: "https://github.com/templatical/sdk",
|
|
3645
|
+
target: "_blank",
|
|
3646
|
+
rel: "noopener noreferrer",
|
|
3647
|
+
class: "tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-dim)]",
|
|
3648
|
+
style: { "text-decoration": "none" }
|
|
3649
|
+
}, Kc = /* @__PURE__ */ f({
|
|
3650
|
+
__name: "EditorFooter",
|
|
3651
|
+
props: { positionClass: {} },
|
|
3652
|
+
setup(e) {
|
|
3653
|
+
let { t } = U();
|
|
3654
|
+
return (r, i) => (s(), m("footer", { class: n(["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]) }, [p("div", Wc, [
|
|
3655
|
+
p("span", null, c(b(t).footer.poweredBy), 1),
|
|
3656
|
+
i[0] ||= p("a", {
|
|
3657
|
+
href: "https://templatical.com",
|
|
3658
|
+
target: "_blank",
|
|
3659
|
+
rel: "noopener noreferrer",
|
|
3660
|
+
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)]",
|
|
3661
|
+
style: { "text-decoration": "none" }
|
|
3662
|
+
}, [p("img", {
|
|
3663
|
+
width: "14",
|
|
3664
|
+
height: "14",
|
|
3665
|
+
src: "https://templatical.com/logo.svg",
|
|
3666
|
+
alt: ""
|
|
3667
|
+
}), y(" Templatical ")], -1),
|
|
3668
|
+
i[1] ||= p("span", { class: "tpl:text-[var(--tpl-border)]" }, "·", -1),
|
|
3669
|
+
p("a", Gc, c(b(t).footer.openSource), 1)
|
|
3670
|
+
])], 2));
|
|
3671
|
+
}
|
|
3672
|
+
}), qc = ["aria-labelledby", "data-tpl-theme"], Jc = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:gap-3 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, Yc = ["id"], Xc = ["aria-label"], Zc = { class: "tpl:relative tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, Qc = [
|
|
3673
|
+
"id",
|
|
3674
|
+
"placeholder",
|
|
3675
|
+
"aria-label",
|
|
3676
|
+
"aria-activedescendant"
|
|
3677
|
+
], $c = {
|
|
3678
|
+
key: 0,
|
|
3679
|
+
class: "tpl:flex tpl:gap-1.5 tpl:overflow-x-auto tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2",
|
|
3680
|
+
"data-testid": "merge-tag-picker-group-pills"
|
|
3681
|
+
}, el = ["data-group-name", "onClick"], tl = ["aria-label"], nl = {
|
|
3682
|
+
key: 0,
|
|
3683
|
+
class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
3684
|
+
"data-testid": "merge-tag-picker-empty"
|
|
3685
|
+
}, rl = {
|
|
3686
|
+
key: 1,
|
|
3687
|
+
class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
3688
|
+
"data-testid": "merge-tag-picker-empty"
|
|
3689
|
+
}, il = [
|
|
3690
|
+
"aria-expanded",
|
|
3691
|
+
"data-group-name",
|
|
3692
|
+
"data-group-collapsed",
|
|
3693
|
+
"onClick"
|
|
3694
|
+
], al = { class: "tpl:ml-1 tpl:font-normal" }, ol = [
|
|
3695
|
+
"id",
|
|
3696
|
+
"aria-selected",
|
|
3697
|
+
"data-selected",
|
|
3698
|
+
"data-merge-tag-index",
|
|
3699
|
+
"data-merge-tag-value",
|
|
3700
|
+
"title",
|
|
3701
|
+
"onMousemove",
|
|
3702
|
+
"onClick"
|
|
3703
|
+
], sl = { class: "tpl:text-sm tpl:font-medium" }, cl = { class: "tpl:line-clamp-2 tpl:font-mono tpl:text-xs tpl:text-ellipsis tpl:break-all tpl:text-[var(--tpl-text-dim)]" }, ll = {
|
|
3704
|
+
key: 0,
|
|
3705
|
+
class: "tpl:line-clamp-2 tpl:text-xs tpl:text-ellipsis tpl:text-[var(--tpl-text-dim)]"
|
|
3706
|
+
}, ul = "tpl-merge-tag-picker-list", dl = /* @__PURE__ */ f({
|
|
3707
|
+
__name: "MergeTagPickerModal",
|
|
3708
|
+
setup(r) {
|
|
3709
|
+
let a = Ne(Je, "MergeTagPickerModal"), { t: o, format: u } = U(), f = E(Fe, null), h = E(Me, null), _ = d(""), y = Oe(_, 200), x = d(null), D = C(() => y.value.trim().length > 0), j = d(0), N = C(() => a.tags.value.some((e) => !!e.group)), P = d(/* @__PURE__ */ new Set());
|
|
3710
|
+
function F(e) {
|
|
3711
|
+
return P.value.has(e);
|
|
3712
|
+
}
|
|
3713
|
+
function I(e) {
|
|
3714
|
+
let t = new Set(P.value);
|
|
3715
|
+
t.has(e) ? t.delete(e) : t.add(e), P.value = t, j.value = 0;
|
|
3716
|
+
}
|
|
3717
|
+
let L = C(() => {
|
|
3718
|
+
let e = y.value.trim().toLowerCase();
|
|
3719
|
+
return e ? a.tags.value.filter((t) => [
|
|
3720
|
+
t.label,
|
|
3721
|
+
t.value,
|
|
3722
|
+
t.description ?? ""
|
|
3723
|
+
].join(" ").toLowerCase().includes(e)) : a.tags.value;
|
|
3724
|
+
}), R = C(() => {
|
|
3725
|
+
if (!N.value) return [];
|
|
3726
|
+
let e = o.mergeTag.picker.otherGroup, t = /* @__PURE__ */ new Set(), n = [];
|
|
3727
|
+
for (let r of a.tags.value) {
|
|
3728
|
+
let i = r.group ?? e;
|
|
3729
|
+
t.has(i) || (t.add(i), n.push(i));
|
|
3730
|
+
}
|
|
3731
|
+
return n;
|
|
3732
|
+
}), z = C(() => {
|
|
3733
|
+
let e = L.value;
|
|
3734
|
+
if (!N.value || D.value) return e.map((e, t) => ({
|
|
3735
|
+
kind: "tag",
|
|
3736
|
+
tag: e,
|
|
3737
|
+
index: t
|
|
3738
|
+
}));
|
|
3739
|
+
let t = o.mergeTag.picker.otherGroup, n = /* @__PURE__ */ new Map(), r = [];
|
|
3740
|
+
for (let i of e) {
|
|
3741
|
+
let e = i.group ?? t;
|
|
3742
|
+
n.has(e) || (n.set(e, []), r.push(e)), n.get(e).push(i);
|
|
3743
|
+
}
|
|
3744
|
+
let i = [], a = 0;
|
|
3745
|
+
for (let e of r) {
|
|
3746
|
+
let t = n.get(e);
|
|
3747
|
+
if (i.push({
|
|
3748
|
+
kind: "header",
|
|
3749
|
+
group: e,
|
|
3750
|
+
count: t.length
|
|
3751
|
+
}), !P.value.has(e)) for (let e of t) i.push({
|
|
3752
|
+
kind: "tag",
|
|
3753
|
+
tag: e,
|
|
3754
|
+
index: a
|
|
3755
|
+
}), a++;
|
|
3756
|
+
}
|
|
3757
|
+
return i;
|
|
3758
|
+
}), B = C(() => z.value.flatMap((e) => e.kind === "tag" ? [e.tag] : []));
|
|
3759
|
+
i(() => a.isOpen.value, (e) => {
|
|
3760
|
+
e && (_.value = "", j.value = 0, P.value = /* @__PURE__ */ new Set(), T(() => {
|
|
3761
|
+
x.value?.focus();
|
|
3762
|
+
}));
|
|
3763
|
+
}), i(B, (e) => {
|
|
3764
|
+
j.value >= e.length && (j.value = Math.max(0, e.length - 1));
|
|
3765
|
+
});
|
|
3766
|
+
function V(e) {
|
|
3767
|
+
a.resolve(e);
|
|
3768
|
+
}
|
|
3769
|
+
function ee() {
|
|
3770
|
+
a.resolve(null);
|
|
3771
|
+
}
|
|
3772
|
+
function te(e) {
|
|
3773
|
+
if (B.value.length === 0) return;
|
|
3774
|
+
let t = j.value + e;
|
|
3775
|
+
j.value = Math.max(0, Math.min(B.value.length - 1, t)), ie();
|
|
3776
|
+
}
|
|
3777
|
+
let ne = d(null), re = d({});
|
|
3778
|
+
function H(e, t) {
|
|
3779
|
+
re.value[e] = t ?? null;
|
|
3780
|
+
}
|
|
3781
|
+
function ie() {
|
|
3782
|
+
T(() => {
|
|
3783
|
+
let e = ne.value;
|
|
3784
|
+
e && e.querySelector(`[data-merge-tag-index="${j.value}"]`)?.scrollIntoView({ block: "nearest" });
|
|
3785
|
+
});
|
|
3786
|
+
}
|
|
3787
|
+
function ae(e) {
|
|
3788
|
+
if (P.value.has(e)) {
|
|
3789
|
+
let t = new Set(P.value);
|
|
3790
|
+
t.delete(e), P.value = t;
|
|
3791
|
+
}
|
|
3792
|
+
T(() => {
|
|
3793
|
+
let t = ne.value;
|
|
3794
|
+
if (!t) return;
|
|
3795
|
+
let n = 0, r = !1;
|
|
3796
|
+
for (let i of Array.from(t.children)) {
|
|
3797
|
+
if (i.dataset.testid === "merge-tag-picker-group-header" && i.dataset.groupName === e) {
|
|
3798
|
+
r = !0;
|
|
3799
|
+
break;
|
|
3800
|
+
}
|
|
3801
|
+
n += i.offsetHeight;
|
|
3802
|
+
}
|
|
3803
|
+
r && t.scrollTo({
|
|
3804
|
+
top: n,
|
|
3805
|
+
behavior: "smooth"
|
|
3806
|
+
});
|
|
3807
|
+
});
|
|
3808
|
+
}
|
|
3809
|
+
function oe(e) {
|
|
3810
|
+
if (e.key === "ArrowDown") e.preventDefault(), te(1);
|
|
3811
|
+
else if (e.key === "ArrowUp") e.preventDefault(), te(-1);
|
|
3812
|
+
else if (e.key === "Enter") {
|
|
3813
|
+
e.preventDefault();
|
|
3814
|
+
let t = B.value[j.value];
|
|
3815
|
+
t && V(t);
|
|
3816
|
+
}
|
|
3817
|
+
}
|
|
3818
|
+
function se() {
|
|
3819
|
+
if (B.value.length !== 0) return `${ul}-opt-${j.value}`;
|
|
3820
|
+
}
|
|
3821
|
+
function ce(e) {
|
|
3822
|
+
return `${ul}-opt-${e}`;
|
|
3823
|
+
}
|
|
3824
|
+
let le = C(() => a.tags.value.length === 0), ue = C(() => !le.value && L.value.length === 0), de = C(() => N.value && R.value.length > 1 && !D.value);
|
|
3825
|
+
return (r, i) => (s(), v(Nt, {
|
|
3826
|
+
visible: b(a).isOpen.value,
|
|
3827
|
+
onClose: ee,
|
|
3828
|
+
onKeydown: oe
|
|
3829
|
+
}, {
|
|
3830
|
+
default: l(() => [p("div", {
|
|
3831
|
+
role: "dialog",
|
|
3832
|
+
"aria-modal": "true",
|
|
3833
|
+
"aria-labelledby": `${ul}-title`,
|
|
3834
|
+
"data-tpl-theme": b(h),
|
|
3835
|
+
"data-testid": "merge-tag-picker-modal",
|
|
3836
|
+
class: "tpl tpl:flex tpl:max-h-[80vh] tpl:w-[min(420px,92vw)] tpl:flex-col tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
3837
|
+
style: t(b(f))
|
|
3838
|
+
}, [
|
|
3839
|
+
p("header", Jc, [p("h2", {
|
|
3840
|
+
id: `${ul}-title`,
|
|
3841
|
+
class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
3842
|
+
}, c(b(o).mergeTag.picker.title), 9, Yc), p("button", {
|
|
3843
|
+
type: "button",
|
|
3844
|
+
class: "tpl:flex tpl:h-7 tpl:w-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
3845
|
+
"aria-label": b(o).mergeTag.picker.close,
|
|
3846
|
+
"data-testid": "merge-tag-picker-close",
|
|
3847
|
+
onClick: ee
|
|
3848
|
+
}, [g(b(gt), {
|
|
3849
|
+
size: 16,
|
|
3850
|
+
"stroke-width": 2
|
|
3851
|
+
})], 8, Xc)]),
|
|
3852
|
+
p("div", Zc, [g(b(tt), {
|
|
3853
|
+
class: "tpl:pointer-events-none tpl:absolute tpl:top-1/2 tpl:left-5 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]",
|
|
3854
|
+
size: 14,
|
|
3855
|
+
"stroke-width": 2
|
|
3856
|
+
}), O(p("input", {
|
|
3857
|
+
id: `${ul}-search`,
|
|
3858
|
+
ref_key: "searchInputRef",
|
|
3859
|
+
ref: x,
|
|
3860
|
+
"onUpdate:modelValue": i[0] ||= (e) => _.value = e,
|
|
3861
|
+
type: "text",
|
|
3862
|
+
class: "tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)]",
|
|
3863
|
+
placeholder: b(o).mergeTag.picker.searchPlaceholder,
|
|
3864
|
+
"aria-label": b(o).mergeTag.picker.searchAriaLabel,
|
|
3865
|
+
"aria-controls": ul,
|
|
3866
|
+
"aria-activedescendant": se(),
|
|
3867
|
+
"data-testid": "merge-tag-picker-search",
|
|
3868
|
+
onKeydown: i[1] ||= M(A(() => {}, ["prevent"]), ["enter"])
|
|
3869
|
+
}, null, 40, Qc), [[k, _.value]])]),
|
|
3870
|
+
de.value ? (s(), m("div", $c, [(s(!0), m(S, null, e(R.value, (e) => (s(), m("button", {
|
|
3871
|
+
key: e,
|
|
3872
|
+
type: "button",
|
|
3873
|
+
class: "tpl:flex tpl:flex-shrink-0 tpl:cursor-pointer tpl:items-center tpl:rounded-full tpl:border tpl:border-[var(--tpl-border)] tpl:bg-transparent tpl:px-2.5 tpl:py-0.5 tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
3874
|
+
"data-testid": "merge-tag-picker-group-pill",
|
|
3875
|
+
"data-group-name": e,
|
|
3876
|
+
onClick: (t) => ae(e)
|
|
3877
|
+
}, c(e), 9, el))), 128))])) : w("", !0),
|
|
3878
|
+
p("div", {
|
|
3879
|
+
id: ul,
|
|
3880
|
+
ref_key: "listRef",
|
|
3881
|
+
ref: ne,
|
|
3882
|
+
class: "tpl:relative tpl:max-h-[60vh] tpl:flex-1 tpl:overflow-y-auto",
|
|
3883
|
+
role: "listbox",
|
|
3884
|
+
"aria-label": b(o).mergeTag.picker.title,
|
|
3885
|
+
"data-testid": "merge-tag-picker-list"
|
|
3886
|
+
}, [le.value ? (s(), m("div", nl, c(b(o).mergeTag.picker.empty), 1)) : ue.value ? (s(), m("div", rl, c(b(o).mergeTag.picker.noResults), 1)) : (s(!0), m(S, { key: 2 }, e(z.value, (e, t) => (s(), m(S, { key: t }, [e.kind === "header" ? (s(), m("button", {
|
|
3887
|
+
key: 0,
|
|
3888
|
+
ref_for: !0,
|
|
3889
|
+
ref: (t) => H(e.group, t),
|
|
3890
|
+
type: "button",
|
|
3891
|
+
"aria-expanded": !F(e.group),
|
|
3892
|
+
"aria-controls": ul,
|
|
3893
|
+
class: "tpl:sticky tpl:top-0 tpl:z-10 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-[var(--tpl-bg-elevated)] tpl:px-3 tpl:pt-2.5 tpl:pb-1 tpl:text-left tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)]",
|
|
3894
|
+
"data-testid": "merge-tag-picker-group-header",
|
|
3895
|
+
"data-group-name": e.group,
|
|
3896
|
+
"data-group-collapsed": F(e.group) ? "true" : "false",
|
|
3897
|
+
onClick: (t) => I(e.group)
|
|
3898
|
+
}, [
|
|
3899
|
+
g(b(Qe), {
|
|
3900
|
+
size: 12,
|
|
3901
|
+
"stroke-width": 2,
|
|
3902
|
+
class: n(["tpl:transition-transform", F(e.group) ? "tpl:-rotate-90" : ""])
|
|
3903
|
+
}, null, 8, ["class"]),
|
|
3904
|
+
p("span", null, c(e.group), 1),
|
|
3905
|
+
p("span", al, " (" + c(b(u)(b(o).mergeTag.picker.groupCount, { count: e.count })) + ") ", 1)
|
|
3906
|
+
], 8, il)) : (s(), m("button", {
|
|
3907
|
+
key: 1,
|
|
3908
|
+
id: ce(e.index),
|
|
3909
|
+
type: "button",
|
|
3910
|
+
role: "option",
|
|
3911
|
+
"aria-selected": e.index === j.value,
|
|
3912
|
+
"data-selected": e.index === j.value ? "true" : "false",
|
|
3913
|
+
"data-merge-tag-index": e.index,
|
|
3914
|
+
"data-merge-tag-value": e.tag.value,
|
|
3915
|
+
title: e.tag.description ? `${e.tag.value} — ${e.tag.description}` : e.tag.value,
|
|
3916
|
+
class: n(["tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:border-none tpl:px-3 tpl:py-1.5 tpl:text-left tpl:transition-colors", e.index === j.value ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:bg-transparent tpl:text-[var(--tpl-text)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
|
|
3917
|
+
"data-testid": "merge-tag-picker-item",
|
|
3918
|
+
onMousemove: (t) => j.value = e.index,
|
|
3919
|
+
onClick: (t) => V(e.tag)
|
|
3920
|
+
}, [
|
|
3921
|
+
p("span", sl, c(e.tag.label), 1),
|
|
3922
|
+
p("span", cl, c(e.tag.value), 1),
|
|
3923
|
+
e.tag.description ? (s(), m("span", ll, c(e.tag.description), 1)) : w("", !0)
|
|
3924
|
+
], 42, ol))], 64))), 128))], 8, tl)
|
|
3925
|
+
], 12, qc)]),
|
|
3926
|
+
_: 1
|
|
3927
|
+
}, 8, ["visible"]));
|
|
3928
|
+
}
|
|
3929
|
+
}), fl = ["data-logic-keyword"], pl = /* @__PURE__ */ f({
|
|
3930
|
+
__name: "LogicTagBadge",
|
|
3931
|
+
props: {
|
|
3932
|
+
value: {},
|
|
3933
|
+
syntax: {}
|
|
3934
|
+
},
|
|
3935
|
+
setup(e) {
|
|
3936
|
+
let t = e, n = C(() => R(t.value, t.syntax)), r = C(() => te(t.value, t.syntax));
|
|
3937
|
+
return (e, t) => n.value ? (s(), m("span", {
|
|
3938
|
+
key: 0,
|
|
3939
|
+
class: "tpl:inline-flex tpl:flex-shrink-0 tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:leading-none tpl:font-bold tpl:tracking-wide tpl:uppercase",
|
|
3940
|
+
style: {
|
|
3941
|
+
border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
|
|
3942
|
+
color: "var(--tpl-primary)"
|
|
3943
|
+
},
|
|
3944
|
+
"data-testid": "merge-tag-logic-badge",
|
|
3945
|
+
"data-logic-keyword": r.value
|
|
3946
|
+
}, c(r.value), 9, fl)) : w("", !0);
|
|
3947
|
+
}
|
|
3948
|
+
}), ml = ["aria-labelledby", "data-tpl-theme"], hl = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:gap-3 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, gl = ["id"], _l = ["aria-label"], vl = { class: "tpl:relative tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2.5" }, yl = [
|
|
3949
|
+
"id",
|
|
3950
|
+
"placeholder",
|
|
3951
|
+
"aria-label",
|
|
3952
|
+
"aria-activedescendant"
|
|
3953
|
+
], bl = ["aria-label"], xl = {
|
|
3954
|
+
key: 0,
|
|
3955
|
+
class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
3956
|
+
"data-testid": "logic-picker-empty"
|
|
3957
|
+
}, Sl = {
|
|
3958
|
+
key: 1,
|
|
3959
|
+
class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
3960
|
+
"data-testid": "logic-picker-empty"
|
|
3961
|
+
}, Cl = ["data-group-name"], wl = [
|
|
3962
|
+
"id",
|
|
3963
|
+
"aria-selected",
|
|
3964
|
+
"data-selected",
|
|
3965
|
+
"data-logic-index",
|
|
3966
|
+
"data-logic-kind",
|
|
3967
|
+
"onMousemove",
|
|
3968
|
+
"onClick"
|
|
3969
|
+
], Tl = { class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-between tpl:gap-2" }, El = { class: "tpl:text-sm tpl:font-medium" }, Dl = {
|
|
3970
|
+
key: 0,
|
|
3971
|
+
class: "tpl:flex tpl:items-center"
|
|
3972
|
+
}, Ol = {
|
|
3973
|
+
key: 1,
|
|
3974
|
+
class: "tpl:flex tpl:items-center tpl:gap-1"
|
|
3975
|
+
}, kl = { class: "tpl:line-clamp-2 tpl:font-mono tpl:text-xs tpl:text-ellipsis tpl:break-all tpl:text-[var(--tpl-text-dim)]" }, Al = {
|
|
3976
|
+
key: 0,
|
|
3977
|
+
class: "tpl:line-clamp-2 tpl:text-xs tpl:text-ellipsis tpl:text-[var(--tpl-text-dim)]"
|
|
3978
|
+
}, jl = "tpl-logic-picker-list", Ml = /* @__PURE__ */ f({
|
|
3979
|
+
__name: "LogicTagPickerModal",
|
|
3980
|
+
setup(r) {
|
|
3981
|
+
let a = Ne(Ye, "LogicTagPickerModal"), { t: o } = U(), u = E(Ie, B.liquid), f = E(Fe, null), h = E(Me, null), _ = d(""), y = Oe(_, 200), x = d(null), D = C(() => y.value.trim().length > 0), j = d(0);
|
|
3982
|
+
function N(e) {
|
|
3983
|
+
let t = y.value.trim().toLowerCase();
|
|
3984
|
+
return !t || e.filter(Boolean).join(" ").toLowerCase().includes(t);
|
|
3985
|
+
}
|
|
3986
|
+
let P = C(() => a.tags.value.filter((e) => N([
|
|
3987
|
+
e.label,
|
|
3988
|
+
e.value,
|
|
3989
|
+
e.description
|
|
3990
|
+
]))), F = C(() => a.pairs.value.filter((e) => N([
|
|
3991
|
+
e.label,
|
|
3992
|
+
e.before,
|
|
3993
|
+
e.after,
|
|
3994
|
+
e.description
|
|
3995
|
+
]))), I = C(() => [...F.value.map((e) => ({
|
|
3996
|
+
kind: "pair",
|
|
3997
|
+
pair: e,
|
|
3998
|
+
group: e.group
|
|
3999
|
+
})), ...P.value.map((e) => ({
|
|
4000
|
+
kind: "tag",
|
|
4001
|
+
tag: e,
|
|
4002
|
+
group: e.group
|
|
4003
|
+
}))]), L = C(() => a.tags.value.some((e) => !!e.group) || a.pairs.value.some((e) => !!e.group));
|
|
4004
|
+
function R(e) {
|
|
4005
|
+
let t = o.logicTag.picker.otherGroup, n = /* @__PURE__ */ new Map(), r = [];
|
|
4006
|
+
for (let i of e) {
|
|
4007
|
+
let e = i.group ?? t;
|
|
4008
|
+
n.has(e) || (n.set(e, []), r.push(e)), n.get(e).push(i);
|
|
4009
|
+
}
|
|
4010
|
+
return r.map((e) => [e, n.get(e)]);
|
|
4011
|
+
}
|
|
4012
|
+
let z = C(() => {
|
|
4013
|
+
let e = [], t = [], n = 0, r = (r) => {
|
|
4014
|
+
r.kind === "tag" ? (e.push({
|
|
4015
|
+
kind: "tag",
|
|
4016
|
+
tag: r.tag,
|
|
4017
|
+
index: n
|
|
4018
|
+
}), t.push(r.tag)) : (e.push({
|
|
4019
|
+
kind: "pair",
|
|
4020
|
+
pair: r.pair,
|
|
4021
|
+
index: n
|
|
4022
|
+
}), t.push(r.pair)), n++;
|
|
4023
|
+
}, i = I.value;
|
|
4024
|
+
if (D.value || !L.value) for (let e of i) r(e);
|
|
4025
|
+
else for (let [t, n] of R(i)) {
|
|
4026
|
+
e.push({
|
|
4027
|
+
kind: "header",
|
|
4028
|
+
label: t
|
|
4029
|
+
});
|
|
4030
|
+
for (let e of n) r(e);
|
|
4031
|
+
}
|
|
4032
|
+
return {
|
|
4033
|
+
rows: e,
|
|
4034
|
+
items: t
|
|
4035
|
+
};
|
|
4036
|
+
}), V = C(() => z.value.items), ee = C(() => a.tags.value.length === 0 && a.pairs.value.length === 0), te = C(() => !ee.value && V.value.length === 0);
|
|
4037
|
+
i(() => a.isOpen.value, (e) => {
|
|
4038
|
+
e && (_.value = "", j.value = 0, T(() => x.value?.focus()));
|
|
4039
|
+
}), i(V, (e) => {
|
|
4040
|
+
j.value >= e.length && (j.value = Math.max(0, e.length - 1));
|
|
4041
|
+
});
|
|
4042
|
+
let ne = d(null);
|
|
4043
|
+
function re(e) {
|
|
4044
|
+
a.resolve(e);
|
|
4045
|
+
}
|
|
4046
|
+
function H() {
|
|
4047
|
+
a.resolve(null);
|
|
4048
|
+
}
|
|
4049
|
+
function ie(e) {
|
|
4050
|
+
V.value.length !== 0 && (j.value = Math.max(0, Math.min(V.value.length - 1, j.value + e)), T(() => {
|
|
4051
|
+
ne.value?.querySelector(`[data-logic-index="${j.value}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4052
|
+
}));
|
|
4053
|
+
}
|
|
4054
|
+
function ae(e) {
|
|
4055
|
+
if (e.key === "ArrowDown") e.preventDefault(), ie(1);
|
|
4056
|
+
else if (e.key === "ArrowUp") e.preventDefault(), ie(-1);
|
|
4057
|
+
else if (e.key === "Enter") {
|
|
4058
|
+
e.preventDefault();
|
|
4059
|
+
let t = V.value[j.value];
|
|
4060
|
+
t && re(t);
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
function oe(e) {
|
|
4064
|
+
return `${jl}-opt-${e}`;
|
|
4065
|
+
}
|
|
4066
|
+
function se() {
|
|
4067
|
+
return V.value.length === 0 ? void 0 : `${jl}-opt-${j.value}`;
|
|
4068
|
+
}
|
|
4069
|
+
return (r, i) => (s(), v(Nt, {
|
|
4070
|
+
visible: b(a).isOpen.value,
|
|
4071
|
+
onClose: H,
|
|
4072
|
+
onKeydown: ae
|
|
4073
|
+
}, {
|
|
4074
|
+
default: l(() => [p("div", {
|
|
4075
|
+
role: "dialog",
|
|
4076
|
+
"aria-modal": "true",
|
|
4077
|
+
"aria-labelledby": `${jl}-title`,
|
|
4078
|
+
"data-tpl-theme": b(h),
|
|
4079
|
+
"data-testid": "logic-picker-modal",
|
|
4080
|
+
class: "tpl tpl:flex tpl:max-h-[80vh] tpl:w-[min(420px,92vw)] tpl:flex-col tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
4081
|
+
style: t(b(f))
|
|
4082
|
+
}, [
|
|
4083
|
+
p("header", hl, [p("h2", {
|
|
4084
|
+
id: `${jl}-title`,
|
|
4085
|
+
class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
4086
|
+
}, c(b(o).logicTag.picker.title), 9, gl), p("button", {
|
|
4087
|
+
type: "button",
|
|
4088
|
+
class: "tpl:flex tpl:h-7 tpl:w-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
4089
|
+
"aria-label": b(o).logicTag.picker.close,
|
|
4090
|
+
"data-testid": "logic-picker-close",
|
|
4091
|
+
onClick: H
|
|
4092
|
+
}, [g(b(gt), {
|
|
4093
|
+
size: 16,
|
|
4094
|
+
"stroke-width": 2
|
|
4095
|
+
})], 8, _l)]),
|
|
4096
|
+
p("div", vl, [g(b(tt), {
|
|
4097
|
+
class: "tpl:pointer-events-none tpl:absolute tpl:top-1/2 tpl:left-5 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]",
|
|
4098
|
+
size: 14,
|
|
4099
|
+
"stroke-width": 2
|
|
4100
|
+
}), O(p("input", {
|
|
4101
|
+
id: `${jl}-search`,
|
|
4102
|
+
ref_key: "searchInputRef",
|
|
4103
|
+
ref: x,
|
|
4104
|
+
"onUpdate:modelValue": i[0] ||= (e) => _.value = e,
|
|
4105
|
+
type: "text",
|
|
4106
|
+
class: "tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:focus:border-[var(--tpl-primary)]",
|
|
4107
|
+
placeholder: b(o).logicTag.picker.searchPlaceholder,
|
|
4108
|
+
"aria-label": b(o).logicTag.picker.searchAriaLabel,
|
|
4109
|
+
"aria-controls": jl,
|
|
4110
|
+
"aria-activedescendant": se(),
|
|
4111
|
+
"data-testid": "logic-picker-search",
|
|
4112
|
+
onKeydown: i[1] ||= M(A(() => {}, ["prevent"]), ["enter"])
|
|
4113
|
+
}, null, 40, yl), [[k, _.value]])]),
|
|
4114
|
+
p("div", {
|
|
4115
|
+
id: jl,
|
|
4116
|
+
ref_key: "listRef",
|
|
4117
|
+
ref: ne,
|
|
4118
|
+
class: "tpl:relative tpl:max-h-[60vh] tpl:flex-1 tpl:overflow-y-auto",
|
|
4119
|
+
role: "listbox",
|
|
4120
|
+
"aria-label": b(o).logicTag.picker.title,
|
|
4121
|
+
"data-testid": "logic-picker-list"
|
|
4122
|
+
}, [ee.value ? (s(), m("div", xl, c(b(o).logicTag.picker.empty), 1)) : te.value ? (s(), m("div", Sl, c(b(o).logicTag.picker.noResults), 1)) : (s(!0), m(S, { key: 2 }, e(z.value.rows, (e, t) => (s(), m(S, { key: t }, [e.kind === "header" ? (s(), m("div", {
|
|
4123
|
+
key: 0,
|
|
4124
|
+
class: "tpl:px-3 tpl:pt-2.5 tpl:pb-1 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]",
|
|
4125
|
+
"data-testid": "logic-picker-header",
|
|
4126
|
+
"data-group-name": e.label
|
|
4127
|
+
}, c(e.label), 9, Cl)) : (s(), m("button", {
|
|
4128
|
+
key: 1,
|
|
4129
|
+
id: oe(e.index),
|
|
4130
|
+
type: "button",
|
|
4131
|
+
role: "option",
|
|
4132
|
+
"aria-selected": e.index === j.value,
|
|
4133
|
+
"data-selected": e.index === j.value ? "true" : "false",
|
|
4134
|
+
"data-logic-index": e.index,
|
|
4135
|
+
"data-logic-kind": e.kind,
|
|
4136
|
+
class: n(["tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:border-none tpl:px-3 tpl:py-1.5 tpl:text-left tpl:transition-colors", e.index === j.value ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:bg-transparent tpl:text-[var(--tpl-text)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
|
|
4137
|
+
"data-testid": "logic-picker-item",
|
|
4138
|
+
onMousemove: (t) => j.value = e.index,
|
|
4139
|
+
onClick: (t) => re(e.kind === "tag" ? e.tag : e.pair)
|
|
4140
|
+
}, [
|
|
4141
|
+
p("span", Tl, [p("span", El, c(e.kind === "tag" ? e.tag.label : e.pair.label), 1), e.kind === "tag" ? (s(), m("span", Dl, [g(pl, {
|
|
4142
|
+
value: e.tag.value,
|
|
4143
|
+
syntax: b(u)
|
|
4144
|
+
}, null, 8, ["value", "syntax"])])) : (s(), m("span", Ol, [
|
|
4145
|
+
g(pl, {
|
|
4146
|
+
value: e.pair.before,
|
|
4147
|
+
syntax: b(u)
|
|
4148
|
+
}, null, 8, ["value", "syntax"]),
|
|
4149
|
+
i[2] ||= p("span", { class: "tpl:text-[var(--tpl-text-dim)]" }, "…", -1),
|
|
4150
|
+
g(pl, {
|
|
4151
|
+
value: e.pair.after,
|
|
4152
|
+
syntax: b(u)
|
|
4153
|
+
}, null, 8, ["value", "syntax"])
|
|
4154
|
+
]))]),
|
|
4155
|
+
p("span", kl, c(e.kind === "tag" ? e.tag.value : `${e.pair.before} … ${e.pair.after}`), 1),
|
|
4156
|
+
(e.kind === "tag" ? e.tag.description : e.pair.description) ? (s(), m("span", Al, c(e.kind === "tag" ? e.tag.description : e.pair.description), 1)) : w("", !0)
|
|
4157
|
+
], 42, wl))], 64))), 128))], 8, bl)
|
|
4158
|
+
], 12, ml)]),
|
|
4159
|
+
_: 1
|
|
4160
|
+
}, 8, ["visible"]));
|
|
4161
|
+
}
|
|
4162
|
+
});
|
|
4163
|
+
//#endregion
|
|
4164
|
+
export { Vc as a, jc as c, on as d, Jt as f, Uc as i, _n as l, dl as n, zc as o, Ht as p, Kc as r, Ic as s, Ml as t, sn as u };
|