@templatical/editor 0.0.4 → 0.0.6

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.
Files changed (163) hide show
  1. package/dist/AiChatSidebar-CNhSl_ty.js +228 -0
  2. package/dist/{AiFeatureMenu-K44aZa_P.js → AiFeatureMenu-BFVsjUJY.js} +23 -23
  3. package/dist/CloudEditor-Bz5Xkxej.js +1082 -0
  4. package/dist/{CollaboratorBar-BuCEcdbB.js → CollaboratorBar-D2Gu5Xj2.js} +3 -3
  5. package/dist/{CommentsSidebar-2lcqMfIP.js → CommentsSidebar-CTeEAZTj.js} +131 -131
  6. package/dist/{DesignReferenceSidebar-CNMu4Zrx.js → DesignReferenceSidebar-u2tKSQK0.js} +52 -52
  7. package/dist/{LoadingTrack-vK8W2PJf.js → LoadingTrack--aUassFH.js} +1 -1
  8. package/dist/{ModuleBrowserModal-CvQ0xyQf.js → ModuleBrowserModal-DNxODPlX.js} +58 -58
  9. package/dist/{ModulePreviewCanvas-Be2B3Y07.js → ModulePreviewCanvas-DnGe1Y-2.js} +32 -32
  10. package/dist/ParagraphEditor-CYrzYJO5.js +688 -0
  11. package/dist/{RichTextEditorContent-CHJlh7HJ.js → RichTextEditorContent-BeqlWlWB.js} +2 -2
  12. package/dist/{SaveModuleDialog-BaaeH5Xm.js → SaveModuleDialog-Kde6X13X.js} +25 -25
  13. package/dist/{SnapshotHistory-BPfjiuu1.js → SnapshotHistory-B3EfIcLW.js} +7 -7
  14. package/dist/TemplateScoringPanel-D2vCRGgx.js +254 -0
  15. package/dist/{TestEmailModal-DIAlB3e_.js → TestEmailModal-Egk0DFDf.js} +3 -3
  16. package/dist/{TitleEditor-D9DPjQkX.js → TitleEditor-DwUpo4gF.js} +11 -11
  17. package/dist/{TplModal-CmTSvCY-.js → TplModal-BCruYWks.js} +4 -4
  18. package/dist/{_plugin-vue_export-helper-B1-bu7yR.js → _plugin-vue_export-helper-5TQrnOhO.js} +2 -2
  19. package/dist/{blockTypeIcons-D1RTWOkx.js → blockTypeIcons-rW4BUUNC.js} +2 -2
  20. package/dist/cdn/chunks/{AiFeatureMenu-lxVm1RjH.js → AiFeatureMenu-Dcbshcfu.js} +16 -16
  21. package/dist/cdn/chunks/AiFeatureMenu-Dcbshcfu.js.map +1 -0
  22. package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js +1056 -0
  23. package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js.map +1 -0
  24. package/dist/cdn/chunks/{CollaboratorBar-D2PKtlOw.js → CollaboratorBar-sToKJfHi.js} +4 -4
  25. package/dist/cdn/chunks/{CollaboratorBar-D2PKtlOw.js.map → CollaboratorBar-sToKJfHi.js.map} +1 -1
  26. package/dist/cdn/chunks/{ModuleBrowserModal-CxDXzkKS.js → ModuleBrowserModal-BNhwXbWw.js} +52 -52
  27. package/dist/cdn/chunks/ModuleBrowserModal-BNhwXbWw.js.map +1 -0
  28. package/dist/cdn/chunks/{ModulePreviewCanvas-DEfHampA.js → ModulePreviewCanvas-DylUylPU.js} +3 -3
  29. package/dist/cdn/chunks/{ModulePreviewCanvas-DEfHampA.js.map → ModulePreviewCanvas-DylUylPU.js.map} +1 -1
  30. package/dist/cdn/chunks/ParagraphEditor-BBw90y_p.js +539 -0
  31. package/dist/cdn/chunks/ParagraphEditor-BBw90y_p.js.map +1 -0
  32. package/dist/cdn/chunks/{RichTextEditorContent-DWUzizsC.js → RichTextEditorContent-DvyIO3nR.js} +5 -5
  33. package/dist/cdn/chunks/{RichTextEditorContent-DWUzizsC.js.map → RichTextEditorContent-DvyIO3nR.js.map} +1 -1
  34. package/dist/cdn/chunks/{SaveModuleDialog-DVna2xUl.js → SaveModuleDialog-DvbSHvhF.js} +24 -24
  35. package/dist/cdn/chunks/SaveModuleDialog-DvbSHvhF.js.map +1 -0
  36. package/dist/cdn/chunks/{TitleEditor-DDf_OcHS.js → TitleEditor-tS3mgoVr.js} +10 -10
  37. package/dist/cdn/chunks/{TitleEditor-DDf_OcHS.js.map → TitleEditor-tS3mgoVr.js.map} +1 -1
  38. package/dist/cdn/chunks/{blockTypeIcons-BnobReQm.js → blockTypeIcons-DbnbyEQE.js} +3 -3
  39. package/dist/cdn/chunks/{blockTypeIcons-BnobReQm.js.map → blockTypeIcons-DbnbyEQE.js.map} +1 -1
  40. package/dist/cdn/chunks/{de-BvYD17KT.js → de-CgUR_S5I.js} +1 -1
  41. package/dist/cdn/chunks/{de-BvYD17KT.js.map → de-CgUR_S5I.js.map} +1 -1
  42. package/dist/cdn/chunks/{de-BB3dgVOc.js → de-D8oDPhBD.js} +1 -1
  43. package/dist/cdn/chunks/de-D8oDPhBD.js.map +1 -0
  44. package/dist/cdn/chunks/{dist-B878xb_62.js → dist-BUmN5e4r.js} +15 -12
  45. package/dist/cdn/chunks/dist-BUmN5e4r.js.map +1 -0
  46. package/dist/cdn/chunks/{draggable-BQNU47zu.js → draggable-m78lz0gI.js} +1591 -1563
  47. package/dist/cdn/chunks/draggable-m78lz0gI.js.map +1 -0
  48. package/dist/cdn/chunks/{emojiData-BVEJHcNH.js → emojiData-CNNgvDqx.js} +1 -1
  49. package/dist/cdn/chunks/{emojiData-BVEJHcNH.js.map → emojiData-CNNgvDqx.js.map} +1 -1
  50. package/dist/cdn/chunks/{en-CpotcOPr.js → en-BBmfBDqY.js} +1 -1
  51. package/dist/cdn/chunks/{en-CpotcOPr.js.map → en-BBmfBDqY.js.map} +1 -1
  52. package/dist/cdn/chunks/{en-DeDcpnoS.js → en-HseRPPeK.js} +1 -1
  53. package/dist/cdn/chunks/en-HseRPPeK.js.map +1 -0
  54. package/dist/cdn/chunks/{extensions-B_kcV0tK.js → extensions-ClpY3m0W.js} +31 -31
  55. package/dist/cdn/chunks/{extensions-B_kcV0tK.js.map → extensions-ClpY3m0W.js.map} +1 -1
  56. package/dist/cdn/chunks/{features-ofOGnSC0.js → features-B5dGxWLi.js} +1645 -1608
  57. package/dist/cdn/chunks/features-B5dGxWLi.js.map +1 -0
  58. package/dist/cdn/chunks/{icons-bIb7PBOE.js → icons-hflTyPmb.js} +8 -8
  59. package/dist/cdn/chunks/icons-hflTyPmb.js.map +1 -0
  60. package/dist/cdn/chunks/{liquid.browser-C1VIYISn.js → liquid.browser-BxyRVCKv.js} +24 -17
  61. package/dist/cdn/chunks/liquid.browser-BxyRVCKv.js.map +1 -0
  62. package/dist/cdn/chunks/{media-library-BIYzV2Y2.js → media-library-Dgy-V-JA.js} +547 -543
  63. package/dist/cdn/chunks/{media-library-BIYzV2Y2.js.map → media-library-Dgy-V-JA.js.map} +1 -1
  64. package/dist/cdn/chunks/{pusher-DJPhQnE8.js → pusher-D-m2WSdL.js} +10 -7
  65. package/dist/cdn/chunks/pusher-D-m2WSdL.js.map +1 -0
  66. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -1
  67. package/dist/cdn/chunks/{rolldown-runtime-DPITmOBR.js → rolldown-runtime-BNuo_Jkg.js} +1 -1
  68. package/dist/cdn/chunks/{src-BuW9oYtm.js → src-TDwMmqm0.js} +7 -7
  69. package/dist/cdn/chunks/{src-BuW9oYtm.js.map → src-TDwMmqm0.js.map} +1 -1
  70. package/dist/cdn/chunks/{styleConstants-1KwsBMxJ.js → styleConstants-DFe3I4Op.js} +6 -6
  71. package/dist/cdn/chunks/{styleConstants-1KwsBMxJ.js.map → styleConstants-DFe3I4Op.js.map} +1 -1
  72. package/dist/cdn/chunks/{styles-DQFExz-T.js → styles-hCOCOR6K.js} +1229 -1101
  73. package/dist/cdn/chunks/styles-hCOCOR6K.js.map +1 -0
  74. package/dist/cdn/chunks/{tiptap-DplY-S-k.js → tiptap-C28NLMX8.js} +1531 -1309
  75. package/dist/cdn/chunks/tiptap-C28NLMX8.js.map +1 -0
  76. package/dist/cdn/editor.css +1 -1
  77. package/dist/cdn/editor.js +112 -141
  78. package/dist/cdn/editor.js.map +1 -1
  79. package/dist/{check-B7kDuZmP.js → check-B5S-C0bz.js} +1 -1
  80. package/dist/{chevron-down-DJLW2Q9Z.js → chevron-down-CjsV1T0W.js} +1 -1
  81. package/dist/{circle-alert-E2vYPs5r.js → circle-alert-CVTmJHKW.js} +1 -1
  82. package/dist/{clock-lWIIQA3C.js → clock-CAjdSHBy.js} +1 -1
  83. package/dist/{dist-CG-vEqSU.js → dist-Ac4o1O4a.js} +2 -2
  84. package/dist/{dist-BkIys9zn.js → dist-B4LTlrAn.js} +6 -6
  85. package/dist/{dist-ChAGLpWo.js → dist-BTtKPcd2.js} +2 -2
  86. package/dist/{dist-C1BIRHCQ.js → dist-CBr-qhie.js} +2 -2
  87. package/dist/{dist-DmOE-Ubp.js → dist-COOFiBFV.js} +2 -2
  88. package/dist/{dist-4LiM9FDd.js → dist-COguaIvm.js} +2 -2
  89. package/dist/{dist-Bu7veieH.js → dist-Crqkuf-w.js} +2 -2
  90. package/dist/{dist-DkypH7qG.js → dist-DEJZ9iAU.js} +2 -2
  91. package/dist/{dist-D_HQYSY-.js → dist-DHYuVJ_7.js} +2 -2
  92. package/dist/{dist-C_ymrGFi.js → dist-DJrDTuRr.js} +973 -958
  93. package/dist/{dist-DysAFIPy.js → dist-DPM-DFvh.js} +142 -114
  94. package/dist/{dist-DrvKRSU6.js → dist-DfqLGwSF.js} +2 -2
  95. package/dist/dist-DmVOCJjI.js +5 -0
  96. package/dist/{extensions-DEjfEFhD.js → extensions-C6xp_B7K.js} +3 -3
  97. package/dist/{image-up-X4xIq4ea.js → image-up-vZa1Txr-.js} +1 -1
  98. package/dist/index.d.ts +223 -0
  99. package/dist/{liquid.browser-BemTg3sZ.js → liquid.browser-C02owkex.js} +20 -15
  100. package/dist/{loader-circle-BTQQxC3l.js → loader-circle-DilFjHSk.js} +1 -1
  101. package/dist/{message-circle-Blgm6V_h.js → message-circle-Dpcnc2oa.js} +1 -1
  102. package/dist/{refresh-cw-Bb4PEeW1.js → refresh-cw-4r7rkHHX.js} +1 -1
  103. package/dist/rolldown-runtime-gEudmnaM.js +23 -0
  104. package/dist/{scan-line-7lZPfOdm.js → scan-line-684IxPQ0.js} +1 -1
  105. package/dist/{send-C0ltAQrv.js → send-ChDw64yL.js} +1 -1
  106. package/dist/{shield-check-f-qv4RKs.js → shield-check-9dhLdyST.js} +1 -1
  107. package/dist/{sparkles-KhBCGlqB.js → sparkles-Co9fkDcv.js} +1 -1
  108. package/dist/{styleConstants-D4SOZGBV.js → styleConstants-RV3eYwkD.js} +6 -6
  109. package/dist/styles-nvxFh6L6.js +3557 -0
  110. package/dist/templatical-editor.css +1 -1
  111. package/dist/templatical-editor.js +111 -141
  112. package/dist/templatical-editor.umd.cjs +63 -73
  113. package/dist/{trash-2-OwjZ-guZ.js → trash-2-CZkMtjeC.js} +1 -1
  114. package/dist/{triangle-alert-DOSRIUYZ.js → triangle-alert-Dvt51agD.js} +1 -1
  115. package/dist/{useEditorCore-CjwRMl7K.js → useEditorCore-ColJh1ST.js} +1183 -1182
  116. package/dist/{x-CGlq2XQe.js → x-CU2XZOkQ.js} +1 -1
  117. package/package.json +52 -49
  118. package/dist/AiChatSidebar-CjfhTZwo.js +0 -214
  119. package/dist/CloudEditor-DFyuRxUV.js +0 -926
  120. package/dist/ParagraphEditor-CcMPnbDr.js +0 -652
  121. package/dist/TemplateScoringPanel-D58A23Vq.js +0 -249
  122. package/dist/cdn/chunks/AiChatSidebar-CmPTbTFG.js +0 -2
  123. package/dist/cdn/chunks/AiFeatureMenu-lxVm1RjH.js.map +0 -1
  124. package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js +0 -900
  125. package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js.map +0 -1
  126. package/dist/cdn/chunks/CommentsSidebar-BOelj4Ca.js +0 -2
  127. package/dist/cdn/chunks/DesignReferenceSidebar-Bf6rg0A7.js +0 -2
  128. package/dist/cdn/chunks/ModuleBrowserModal-CxDXzkKS.js.map +0 -1
  129. package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js +0 -503
  130. package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js.map +0 -1
  131. package/dist/cdn/chunks/SaveModuleDialog-DVna2xUl.js.map +0 -1
  132. package/dist/cdn/chunks/SnapshotHistory-BFF2SsTN.js +0 -2
  133. package/dist/cdn/chunks/TemplateScoringPanel-gi8wc_m7.js +0 -2
  134. package/dist/cdn/chunks/TestEmailModal-Qtd6aC-6.js +0 -2
  135. package/dist/cdn/chunks/de-BB3dgVOc.js.map +0 -1
  136. package/dist/cdn/chunks/dist-B6AUkMyh.js +0 -2
  137. package/dist/cdn/chunks/dist-B878xb_62.js.map +0 -1
  138. package/dist/cdn/chunks/dist-Bf1Op9A1.js +0 -2
  139. package/dist/cdn/chunks/dist-BkETaOfw.js +0 -2
  140. package/dist/cdn/chunks/dist-CJcMnY7o.js +0 -2
  141. package/dist/cdn/chunks/dist-CWsl6S1K.js +0 -2
  142. package/dist/cdn/chunks/dist-CllLxIMQ.js +0 -2
  143. package/dist/cdn/chunks/dist-Cs0wFwdw.js +0 -2
  144. package/dist/cdn/chunks/dist-DLWHlekl.js +0 -2
  145. package/dist/cdn/chunks/dist-DS3_HVpX.js +0 -2
  146. package/dist/cdn/chunks/dist-DTXopj1a.js +0 -2
  147. package/dist/cdn/chunks/dist-DnwLoNLm.js +0 -2
  148. package/dist/cdn/chunks/draggable-BQNU47zu.js.map +0 -1
  149. package/dist/cdn/chunks/en-DeDcpnoS.js.map +0 -1
  150. package/dist/cdn/chunks/features-ofOGnSC0.js.map +0 -1
  151. package/dist/cdn/chunks/icons-bIb7PBOE.js.map +0 -1
  152. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +0 -1
  153. package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +0 -1
  154. package/dist/cdn/chunks/styles-DQFExz-T.js.map +0 -1
  155. package/dist/cdn/chunks/tiptap-DplY-S-k.js.map +0 -1
  156. package/dist/dist-Dxnd0GRf.js +0 -5
  157. package/dist/styles-CgLaxDfu.js +0 -3428
  158. /package/dist/{de-D7TLGIPA.js → de-Dh8ON-dm.js} +0 -0
  159. /package/dist/{emojiData-BfWQS72m.js → emojiData-Qc8mH_zW.js} +0 -0
  160. /package/dist/{en-DvtiEMwP.js → en-C7IShRSD.js} +0 -0
  161. /package/dist/{formatRelativeTime-DX3FgqN9.js → formatRelativeTime-D8f6NR7i.js} +0 -0
  162. /package/dist/{readableTextColor-LDlmVEUv.js → readableTextColor-B809bF5J.js} +0 -0
  163. /package/dist/{useMergeTag-BZ3X0bNr.js → useMergeTag-CSXcnFBc.js} +0 -0
@@ -1,3428 +0,0 @@
1
- import { A as e, F as t, L as n, M as r, N as i, P as a, T as o, _ as s, a as c, c as l, d as u, g as d, h as f, i as p, j as m, k as h, l as g, m as _, n as ee, o as te, p as ne, r as re, s as ie, u as ae, v as oe, y as se } from "./useEditorCore-CjwRMl7K.js";
2
- import { s as ce, t as le } from "./dist-CG-vEqSU.js";
3
- import { T as ue, _ as de, a as fe, d as pe, f as me, l as he, n as ge, o as _e, p as ve, s as ye, u as v, v as be } from "./keys-C0MQRs8d.js";
4
- import { t as y } from "./useI18n-D6m7ZUgY.js";
5
- import { n as b, t as x } from "./_plugin-vue_export-helper-B1-bu7yR.js";
6
- import { t as xe } from "./chevron-down-DJLW2Q9Z.js";
7
- import { t as Se } from "./circle-alert-E2vYPs5r.js";
8
- import { n as Ce, r as S, t as we } from "./blockTypeIcons-D1RTWOkx.js";
9
- import { n as Te, r as Ee, t as De } from "./refresh-cw-Bb4PEeW1.js";
10
- import { t as Oe } from "./image-up-X4xIq4ea.js";
11
- import { t as ke } from "./scan-line-7lZPfOdm.js";
12
- import { t as Ae } from "./sparkles-KhBCGlqB.js";
13
- import { _ as je, c as Me, d as C, f as w, g as Ne, h as Pe, i as Fe, l as Ie, m as T, p as E, t as Le } from "./styleConstants-D4SOZGBV.js";
14
- import { t as Re } from "./trash-2-OwjZ-guZ.js";
15
- import { t as ze } from "./x-CGlq2XQe.js";
16
- import { t as Be } from "./useMergeTag-BZ3X0bNr.js";
17
- import { t as Ve } from "./readableTextColor-LDlmVEUv.js";
18
- import { Fragment as D, Transition as He, computed as O, createBlock as k, createCommentVNode as A, createElementBlock as j, createElementVNode as M, createStaticVNode as Ue, createTextVNode as N, createVNode as P, defineComponent as F, inject as I, nextTick as We, normalizeClass as L, normalizeStyle as R, openBlock as z, reactive as Ge, ref as B, renderList as V, renderSlot as Ke, resolveDynamicComponent as qe, toDisplayString as H, unref as U, vModelText as Je, vShow as Ye, watch as Xe, withCtx as W, withDirectives as G, withKeys as K, withModifiers as Ze } from "vue";
19
- import { useDataSourceFetch as Qe } from "@templatical/core";
20
- import { SYNTAX_PRESETS as $e, containsMergeTag as et, createBlock as tt, createCustomBlock as nt, generateId as rt, getLogicMergeTagKeyword as it, isCustomBlock as at, isLogicMergeTagValue as ot } from "@templatical/types";
21
- var st = b("circle", [["circle", {
22
- cx: "12",
23
- cy: "12",
24
- r: "10",
25
- key: "1mglay"
26
- }]]), ct = b("layout-template", [
27
- ["rect", {
28
- width: "18",
29
- height: "7",
30
- x: "3",
31
- y: "3",
32
- rx: "1",
33
- key: "f1a2em"
34
- }],
35
- ["rect", {
36
- width: "9",
37
- height: "7",
38
- x: "3",
39
- y: "14",
40
- rx: "1",
41
- key: "jqznyg"
42
- }],
43
- ["rect", {
44
- width: "5",
45
- height: "7",
46
- x: "16",
47
- y: "14",
48
- rx: "1",
49
- key: "q5h2i8"
50
- }]
51
- ]), lt = b("lock-open", [["rect", {
52
- width: "18",
53
- height: "11",
54
- x: "3",
55
- y: "11",
56
- rx: "2",
57
- ry: "2",
58
- key: "1w4ew1"
59
- }], ["path", {
60
- d: "M7 11V7a5 5 0 0 1 9.9-1",
61
- key: "1mm8w8"
62
- }]]), ut = b("lock", [["rect", {
63
- width: "18",
64
- height: "11",
65
- x: "3",
66
- y: "11",
67
- rx: "2",
68
- ry: "2",
69
- key: "1w4ew1"
70
- }], ["path", {
71
- d: "M7 11V7a5 5 0 0 1 10 0v4",
72
- key: "fwvmzm"
73
- }]]), dt = b("monitor", [
74
- ["rect", {
75
- width: "20",
76
- height: "14",
77
- x: "2",
78
- y: "3",
79
- rx: "2",
80
- key: "48i651"
81
- }],
82
- ["line", {
83
- x1: "8",
84
- x2: "16",
85
- y1: "21",
86
- y2: "21",
87
- key: "1svkeh"
88
- }],
89
- ["line", {
90
- x1: "12",
91
- x2: "12",
92
- y1: "17",
93
- y2: "21",
94
- key: "vw1qmm"
95
- }]
96
- ]), ft = b("moon", [["path", {
97
- 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",
98
- key: "kfwtm"
99
- }]]), pt = b("panel-top", [["rect", {
100
- width: "18",
101
- height: "18",
102
- x: "3",
103
- y: "3",
104
- rx: "2",
105
- key: "afitv7"
106
- }], ["path", {
107
- d: "M3 9h18",
108
- key: "1pudct"
109
- }]]), q = b("plus", [["path", {
110
- d: "M5 12h14",
111
- key: "1ays0h"
112
- }], ["path", {
113
- d: "M12 5v14",
114
- key: "s699le"
115
- }]]), mt = b("rotate-ccw", [["path", {
116
- d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
117
- key: "1357e3"
118
- }], ["path", {
119
- d: "M3 3v5h5",
120
- key: "1xhq8a"
121
- }]]), ht = b("settings", [["path", {
122
- 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",
123
- key: "1i5ecw"
124
- }], ["circle", {
125
- cx: "12",
126
- cy: "12",
127
- r: "3",
128
- key: "1v7zrd"
129
- }]]), gt = b("smartphone", [["rect", {
130
- width: "14",
131
- height: "20",
132
- x: "5",
133
- y: "2",
134
- rx: "2",
135
- ry: "2",
136
- key: "1yt0o3"
137
- }], ["path", {
138
- d: "M12 18h.01",
139
- key: "mhygvu"
140
- }]]), _t = b("square-plus", [
141
- ["rect", {
142
- width: "18",
143
- height: "18",
144
- x: "3",
145
- y: "3",
146
- rx: "2",
147
- key: "afitv7"
148
- }],
149
- ["path", {
150
- d: "M8 12h8",
151
- key: "1wcyev"
152
- }],
153
- ["path", {
154
- d: "M12 8v8",
155
- key: "napkw2"
156
- }]
157
- ]), vt = b("square", [["rect", {
158
- width: "18",
159
- height: "18",
160
- x: "3",
161
- y: "3",
162
- rx: "2",
163
- key: "afitv7"
164
- }]]), yt = b("sun", [
165
- ["circle", {
166
- cx: "12",
167
- cy: "12",
168
- r: "4",
169
- key: "4exip2"
170
- }],
171
- ["path", {
172
- d: "M12 2v2",
173
- key: "tus03m"
174
- }],
175
- ["path", {
176
- d: "M12 20v2",
177
- key: "1lh1kg"
178
- }],
179
- ["path", {
180
- d: "m4.93 4.93 1.41 1.41",
181
- key: "149t6j"
182
- }],
183
- ["path", {
184
- d: "m17.66 17.66 1.41 1.41",
185
- key: "ptbguv"
186
- }],
187
- ["path", {
188
- d: "M2 12h2",
189
- key: "1t8f8n"
190
- }],
191
- ["path", {
192
- d: "M20 12h2",
193
- key: "1q8mjw"
194
- }],
195
- ["path", {
196
- d: "m6.34 17.66-1.41 1.41",
197
- key: "1m8zz5"
198
- }],
199
- ["path", {
200
- d: "m19.07 4.93-1.41 1.41",
201
- key: "1shlcs"
202
- }]
203
- ]), bt = b("tablet", [["rect", {
204
- width: "16",
205
- height: "20",
206
- x: "4",
207
- y: "2",
208
- rx: "2",
209
- ry: "2",
210
- key: "76otgf"
211
- }], ["line", {
212
- x1: "12",
213
- x2: "12.01",
214
- y1: "18",
215
- y2: "18",
216
- key: "1dp563"
217
- }]]), xt = /* @__PURE__ */ n(g(), 1), St = ["aria-label"], Ct = { class: "tpl:relative" }, wt = {
218
- class: "tpl:inline-flex tpl:size-3 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[8px] tpl:font-bold",
219
- style: { "background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 30%,\n transparent\n )" }
220
- }, Tt = {
221
- key: 0,
222
- class: "tpl-canvas-empty tpl:m-6 tpl:flex tpl:min-h-[400px] tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-xl tpl:border-2 tpl:border-dashed tpl:px-10 tpl:py-12 tpl:text-center tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg-elevated)] tpl:font-[var(--tpl-font-family)]"
223
- }, Et = { class: "tpl-canvas-empty-icon tpl:mb-4 tpl:text-[var(--tpl-primary)]" }, Dt = { class: "tpl-canvas-empty-title tpl:m-0 tpl:mb-2 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-primary)]" }, Ot = { class: "tpl-canvas-empty-text tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-dim)]" }, kt = {
224
- key: 0,
225
- 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)]"
226
- }, At = {
227
- key: 1,
228
- 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)]"
229
- }, jt = /* @__PURE__ */ x(/* @__PURE__ */ F({
230
- __name: "Canvas",
231
- props: {
232
- viewport: {},
233
- content: {},
234
- selectedBlockId: {},
235
- darkMode: { type: Boolean },
236
- previewMode: { type: Boolean },
237
- lockedBlocks: {}
238
- },
239
- emits: [
240
- "select-block",
241
- "open-ai-chat",
242
- "open-design-reference"
243
- ],
244
- setup(e, { emit: t }) {
245
- let n = {
246
- section: l,
247
- title: ae,
248
- paragraph: _,
249
- image: d,
250
- button: a,
251
- divider: oe,
252
- spacer: p,
253
- html: s,
254
- social: c,
255
- menu: f,
256
- table: re,
257
- video: ee,
258
- countdown: i,
259
- custom: se
260
- }, r = e, o = t, { t: m } = y(), h = ue(me, "Canvas"), g = I(he, null), te = I(_e, null), ie = I(ye, {}), ce = O(() => (ie.plan?.hasFeature("ai_generation") ?? !1) && (ie.ai?.isFeatureEnabled("chat") ?? !1)), le = O(() => (ie.plan?.hasFeature("ai_generation") ?? !1) && (ie.ai?.isFeatureEnabled("designToTemplate") ?? !1)), de = O({
261
- get: () => r.content.blocks,
262
- set: (e) => {
263
- h.setContent({
264
- ...r.content,
265
- blocks: e
266
- });
267
- }
268
- }), fe = O(() => {
269
- switch (r.viewport) {
270
- case "mobile": return 375;
271
- case "tablet": return 768;
272
- default: return r.content.settings.width;
273
- }
274
- }), pe = O(() => ({
275
- backgroundColor: r.content.settings.backgroundColor,
276
- fontFamily: r.content.settings.fontFamily
277
- }));
278
- function ge(e) {
279
- r.previewMode || e.target === e.currentTarget && o("select-block", null);
280
- }
281
- function ve(e) {
282
- return ne(e, te, n);
283
- }
284
- function v(e) {
285
- return r.lockedBlocks?.get(e) ?? null;
286
- }
287
- function be(e, t) {
288
- e.type === "custom" && h.updateBlock(e.id, {
289
- fieldValues: t.fieldValues,
290
- dataSourceFetched: t.dataSourceFetched
291
- });
292
- }
293
- return (t, n) => (z(), j("div", {
294
- "data-testid": "canvas-wrapper",
295
- role: "region",
296
- "aria-label": U(m).landmarks.canvas,
297
- class: "tpl-canvas-wrapper tpl:rounded-lg",
298
- style: R({
299
- width: `${fe.value}px`,
300
- backgroundColor: e.content.settings.backgroundColor,
301
- boxShadow: e.darkMode ? "none" : "var(--tpl-shadow-xl)",
302
- filter: e.darkMode ? "invert(1) hue-rotate(180deg)" : "none",
303
- transition: "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 300ms ease"
304
- })
305
- }, [M("div", {
306
- class: L(["tpl-canvas tpl:rounded-lg", {
307
- "tpl-canvas--dark-mode": e.darkMode,
308
- "tpl-preview-mode": e.previewMode
309
- }]),
310
- style: R(pe.value),
311
- onClick: ge
312
- }, [P(U(xt.default), {
313
- modelValue: de.value,
314
- "onUpdate:modelValue": n[2] ||= (e) => de.value = e,
315
- group: "blocks",
316
- "item-key": "id",
317
- animation: 150,
318
- "ghost-class": "tpl-ghost",
319
- "drag-class": "tpl-dragging",
320
- handle: ".tpl-block-btn",
321
- "invert-swap": !0,
322
- "inverted-swap-threshold": .65,
323
- disabled: e.previewMode,
324
- class: "tpl-canvas-blocks"
325
- }, {
326
- item: W(({ element: t }) => [G(M("div", null, [M("div", Ct, [v(t.id) ? (z(), j("div", {
327
- key: 0,
328
- class: "tpl-collab-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
329
- style: R({
330
- outline: `2px solid ${v(t.id).color}`,
331
- outlineOffset: "-1px"
332
- })
333
- }, [M("span", {
334
- 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",
335
- style: R({
336
- backgroundColor: v(t.id).color,
337
- color: U(Ve)(v(t.id).color)
338
- })
339
- }, [M("span", wt, H(v(t.id).name.charAt(0)), 1), N(" " + H(v(t.id).name), 1)], 4)], 4)) : A("", !0), P(u, {
340
- block: t,
341
- "is-selected": !e.previewMode && e.selectedBlockId === t.id && !v(t.id),
342
- viewport: e.viewport,
343
- "preview-mode": e.previewMode,
344
- onSelect: (n) => e.previewMode || v(t.id) ? void 0 : o("select-block", t.id)
345
- }, {
346
- default: W(() => [(z(), k(qe(ve(t)), {
347
- block: t,
348
- viewport: e.viewport,
349
- onFetchData: (e) => be(t, e),
350
- onUpdate: (e) => U(h).updateBlock(t.id, e)
351
- }, null, 40, [
352
- "block",
353
- "viewport",
354
- "onFetchData",
355
- "onUpdate"
356
- ]))]),
357
- _: 2
358
- }, 1032, [
359
- "block",
360
- "is-selected",
361
- "viewport",
362
- "preview-mode",
363
- "onSelect"
364
- ])])], 512), [[Ye, !U(g)?.isHidden(t.id)]])]),
365
- footer: W(() => [de.value.length === 0 && !e.previewMode ? (z(), j("div", Tt, [
366
- M("div", Et, [P(U(_t), {
367
- size: 48,
368
- "stroke-width": 1
369
- })]),
370
- M("p", Dt, H(U(m).canvas.noBlocks), 1),
371
- M("p", Ot, H(U(m).canvas.dragHint), 1),
372
- ce.value ? (z(), j("p", kt, [
373
- N(H(U(m).canvas.aiHintChat) + " ", 1),
374
- M("button", {
375
- 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)]",
376
- onClick: n[0] ||= (e) => o("open-ai-chat")
377
- }, [P(U(Ae), {
378
- size: 14,
379
- "stroke-width": 2
380
- }), N(" " + H(U(m).aiMenu.aiAssistant), 1)]),
381
- N(" " + H(U(m).canvas.aiHintChatSuffix), 1)
382
- ])) : A("", !0),
383
- le.value ? (z(), j("p", At, [
384
- N(H(U(m).canvas.aiHintDesign) + " ", 1),
385
- M("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: n[1] ||= (e) => o("open-design-reference")
388
- }, [P(U(Oe), {
389
- size: 14,
390
- "stroke-width": 2
391
- }), N(" " + H(U(m).aiMenu.designToTemplate), 1)]),
392
- N(" " + H(U(m).canvas.aiHintDesignSuffix), 1)
393
- ])) : A("", !0)
394
- ])) : A("", !0)]),
395
- _: 1
396
- }, 8, ["modelValue", "disabled"])], 6)], 12, St));
397
- }
398
- }), [["__scopeId", "data-v-43f4b3a0"]]), Mt = ["aria-label"], Nt = {
399
- key: 0,
400
- class: "tpl:border-b tpl:px-1 tpl:pb-1 tpl:border-[var(--tpl-border)]"
401
- }, Pt = ["aria-label"], Ft = {
402
- key: 0,
403
- class: "tpl:flex-1 tpl:truncate tpl:text-sm tpl:font-medium"
404
- }, It = {
405
- key: 1,
406
- 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)]"
407
- }, Lt = [
408
- "data-palette-type",
409
- "aria-label",
410
- "onClick",
411
- "onKeydown"
412
- ], Rt = { 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" }, zt = {
413
- key: 0,
414
- class: "tpl:truncate tpl:text-sm tpl:font-medium"
415
- }, Bt = /* @__PURE__ */ F({
416
- __name: "Sidebar",
417
- setup(e) {
418
- let { t: n, format: r } = y(), i = I(v, []), a = I(fe, void 0), s = I(me, null), c = I(ye, {}), l = O(() => (c.savedModules?.moduleCount.value ?? 0) > 0), u = B(!1), d = [
419
- "section",
420
- "image",
421
- "title",
422
- "paragraph",
423
- "button",
424
- "divider",
425
- "video",
426
- "social",
427
- "menu",
428
- "table",
429
- "spacer",
430
- "html"
431
- ], f = O(() => {
432
- let e = d.map((e) => ({
433
- type: e,
434
- label: t(e, n)
435
- }));
436
- return c.plan && e.splice(-1, 0, {
437
- type: "countdown",
438
- label: t("countdown", n)
439
- }), e;
440
- }), p = O(() => i.map((e) => ({
441
- type: `custom:${e.type}`,
442
- label: e.name,
443
- isCustom: !0,
444
- icon: e.icon
445
- }))), m = O(() => [...f.value, ...p.value]);
446
- function h(e) {
447
- if (e.isCustom) {
448
- let t = e.type.replace("custom:", ""), n = i.find((e) => e.type === t);
449
- if (n) return nt(n);
450
- }
451
- return tt(e.type, a);
452
- }
453
- function g(e) {
454
- if (!s) return;
455
- let t = h(e);
456
- s.addBlock(t), s.selectBlock(t.id);
457
- }
458
- function _(e, t) {
459
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), g(t));
460
- }
461
- return (e, t) => (z(), j("aside", {
462
- "aria-label": U(n).sidebarNav.palette,
463
- class: "tpl-sidebar-rail tpl:absolute tpl:top-14 tpl:bottom-0 tpl:left-0 tpl:z-40 tpl:overflow-hidden",
464
- style: R({
465
- width: u.value ? "200px" : "48px",
466
- backgroundColor: "var(--tpl-bg-elevated)",
467
- borderRight: "1px solid var(--tpl-border)",
468
- boxShadow: u.value ? "var(--tpl-shadow-lg)" : "none",
469
- transition: "width 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1)"
470
- }),
471
- onMouseenter: t[1] ||= (e) => u.value = !0,
472
- onMouseleave: t[2] ||= (e) => u.value = !1,
473
- onFocusin: t[3] ||= (e) => u.value = !0,
474
- onFocusout: t[4] ||= (e) => u.value = !1
475
- }, [l.value ? (z(), j("div", Nt, [M("button", {
476
- type: "button",
477
- "aria-label": U(n).sidebarNav.browseModules,
478
- 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)]",
479
- style: R({ justifyContent: u.value ? "flex-start" : "center" }),
480
- onClick: t[0] ||= (e) => U(c).savedModules?.openBrowser()
481
- }, [
482
- P(U(Ce), {
483
- size: 20,
484
- "stroke-width": 1.5,
485
- class: "tpl:shrink-0"
486
- }),
487
- u.value ? (z(), j("span", Ft, H(U(n).modules.title), 1)) : A("", !0),
488
- u.value ? (z(), j("span", It, H(U(c).savedModules?.moduleCount.value ?? 0), 1)) : A("", !0)
489
- ], 12, Pt)])) : A("", !0), P(U(xt.default), {
490
- list: m.value,
491
- group: {
492
- name: "blocks",
493
- pull: "clone",
494
- put: !1
495
- },
496
- clone: h,
497
- sort: !1,
498
- "item-key": "type",
499
- animation: 150,
500
- "ghost-class": "tpl-ghost",
501
- class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:p-1"
502
- }, {
503
- item: W(({ element: e }) => [M("button", {
504
- type: "button",
505
- "data-palette-type": e.type,
506
- "aria-label": U(r)(U(n).sidebarNav.insertBlock, { block: e.label }),
507
- class: "tpl:flex tpl:h-10 tpl:w-full tpl:cursor-grab tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] active:tpl:cursor-grabbing",
508
- style: R({ justifyContent: u.value ? "flex-start" : "center" }),
509
- onClick: (t) => g(e),
510
- onKeydown: (t) => _(t, e)
511
- }, [M("div", Rt, [U(we)[e.type] ? (z(), k(qe(U(we)[e.type]), {
512
- key: 0,
513
- size: 20,
514
- "stroke-width": 1.5
515
- })) : e.isCustom ? (z(), k(o, {
516
- key: 1,
517
- icon: e.icon,
518
- size: 20
519
- }, null, 8, ["icon"])) : A("", !0)]), u.value ? (z(), j("span", zt, H(e.label), 1)) : A("", !0)], 44, Lt)]),
520
- _: 1
521
- }, 8, ["list"])], 44, Mt));
522
- }
523
- }), Vt = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, J = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n;
524
- 360 / (Math.PI * 2);
525
- var Ht = (e) => Xt(Ut(e)), Ut = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
526
- r: parseInt(e[0] + e[0], 16),
527
- g: parseInt(e[1] + e[1], 16),
528
- b: parseInt(e[2] + e[2], 16),
529
- a: e.length === 4 ? J(parseInt(e[3] + e[3], 16) / 255, 2) : 1
530
- } : {
531
- r: parseInt(e.substring(0, 2), 16),
532
- g: parseInt(e.substring(2, 4), 16),
533
- b: parseInt(e.substring(4, 6), 16),
534
- a: e.length === 8 ? J(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
535
- }), Wt = (e) => Yt(qt(e)), Gt = ({ h: e, s: t, v: n, a: r }) => {
536
- let i = (200 - t) * n / 100;
537
- return {
538
- h: J(e),
539
- s: J(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
540
- l: J(i / 2),
541
- a: J(r, 2)
542
- };
543
- }, Kt = (e) => {
544
- let { h: t, s: n, l: r } = Gt(e);
545
- return `hsl(${t}, ${n}%, ${r}%)`;
546
- }, qt = ({ h: e, s: t, v: n, a: r }) => {
547
- e = e / 360 * 6, t /= 100, n /= 100;
548
- let i = Math.floor(e), a = n * (1 - t), o = n * (1 - (e - i) * t), s = n * (1 - (1 - e + i) * t), c = i % 6;
549
- return {
550
- r: J([
551
- n,
552
- o,
553
- a,
554
- a,
555
- s,
556
- n
557
- ][c] * 255),
558
- g: J([
559
- s,
560
- n,
561
- n,
562
- o,
563
- a,
564
- a
565
- ][c] * 255),
566
- b: J([
567
- a,
568
- a,
569
- s,
570
- n,
571
- n,
572
- o
573
- ][c] * 255),
574
- a: J(r, 2)
575
- };
576
- }, Jt = (e) => {
577
- let t = e.toString(16);
578
- return t.length < 2 ? "0" + t : t;
579
- }, Yt = ({ r: e, g: t, b: n, a: r }) => {
580
- let i = r < 1 ? Jt(J(r * 255)) : "";
581
- return "#" + Jt(e) + Jt(t) + Jt(n) + i;
582
- }, Xt = ({ r: e, g: t, b: n, a: r }) => {
583
- let i = Math.max(e, t, n), a = i - Math.min(e, t, n), o = a ? i === e ? (t - n) / a : i === t ? 2 + (n - e) / a : 4 + (e - t) / a : 0;
584
- return {
585
- h: J(60 * (o < 0 ? o + 6 : o)),
586
- s: J(i ? a / i * 100 : 0),
587
- v: J(i / 255 * 100),
588
- a: r
589
- };
590
- }, Zt = (e, t) => {
591
- if (e === t) return !0;
592
- for (let n in e) if (e[n] !== t[n]) return !1;
593
- return !0;
594
- }, Qt = (e, t) => e.toLowerCase() === t.toLowerCase() ? !0 : Zt(Ut(e), Ut(t)), $t = {}, en = (e) => {
595
- let t = $t[e];
596
- return t || (t = document.createElement("template"), t.innerHTML = e, $t[e] = t), t;
597
- }, tn = (e, t, n) => {
598
- e.dispatchEvent(new CustomEvent(t, {
599
- bubbles: !0,
600
- detail: n
601
- }));
602
- }, nn = !1, rn = (e) => "touches" in e, an = (e) => nn && !rn(e) ? !1 : (nn ||= rn(e), !0), on = (e, t) => {
603
- let n = rn(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
604
- tn(e.el, "move", e.getMove({
605
- x: Vt((n.pageX - (r.left + window.pageXOffset)) / r.width),
606
- y: Vt((n.pageY - (r.top + window.pageYOffset)) / r.height)
607
- }));
608
- }, sn = (e, t) => {
609
- let n = t.keyCode;
610
- n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), tn(e.el, "move", e.getMove({
611
- x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
612
- y: n === 40 ? .01 : n === 38 ? -.01 : 0
613
- }, !0)));
614
- }, cn = class {
615
- constructor(e, t, n, r) {
616
- let i = en(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
617
- e.appendChild(i.content.cloneNode(!0));
618
- let a = e.querySelector(`[part=${t}]`);
619
- a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
620
- }
621
- set dragging(e) {
622
- let t = e ? document.addEventListener : document.removeEventListener;
623
- t(nn ? "touchmove" : "mousemove", this), t(nn ? "touchend" : "mouseup", this);
624
- }
625
- handleEvent(e) {
626
- switch (e.type) {
627
- case "mousedown":
628
- case "touchstart":
629
- if (e.preventDefault(), !an(e) || !nn && e.button != 0) return;
630
- this.el.focus(), on(this, e), this.dragging = !0;
631
- break;
632
- case "mousemove":
633
- case "touchmove":
634
- e.preventDefault(), on(this, e);
635
- break;
636
- case "mouseup":
637
- case "touchend":
638
- this.dragging = !1;
639
- break;
640
- case "keydown":
641
- sn(this, e);
642
- break;
643
- }
644
- }
645
- style(e) {
646
- e.forEach((e, t) => {
647
- for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
648
- });
649
- }
650
- }, ln = class extends cn {
651
- constructor(e) {
652
- super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
653
- }
654
- update({ h: e }) {
655
- this.h = e, this.style([{
656
- left: `${e / 360 * 100}%`,
657
- color: Kt({
658
- h: e,
659
- s: 100,
660
- v: 100,
661
- a: 1
662
- })
663
- }]), this.el.setAttribute("aria-valuenow", `${J(e)}`);
664
- }
665
- getMove(e, t) {
666
- return { h: t ? Vt(this.h + e.x * 360, 0, 360) : 360 * e.x };
667
- }
668
- }, un = class extends cn {
669
- constructor(e) {
670
- super(e, "saturation", "aria-label=\"Color\"", !0);
671
- }
672
- update(e) {
673
- this.hsva = e, this.style([{
674
- top: `${100 - e.v}%`,
675
- left: `${e.s}%`,
676
- color: Kt(e)
677
- }, { "background-color": Kt({
678
- h: e.h,
679
- s: 100,
680
- v: 100,
681
- a: 1
682
- }) }]), this.el.setAttribute("aria-valuetext", `Saturation ${J(e.s)}%, Brightness ${J(e.v)}%`);
683
- }
684
- getMove(e, t) {
685
- return {
686
- s: t ? Vt(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
687
- v: t ? Vt(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
688
- };
689
- }
690
- }, dn = ":host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:\"\";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}", fn = "[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}", pn = "[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}", mn = Symbol("same"), hn = Symbol("color"), gn = Symbol("hsva"), _n = Symbol("update"), vn = Symbol("parts"), yn = Symbol("css"), bn = Symbol("sliders"), xn = class extends HTMLElement {
691
- static get observedAttributes() {
692
- return ["color"];
693
- }
694
- get [yn]() {
695
- return [
696
- dn,
697
- fn,
698
- pn
699
- ];
700
- }
701
- get [bn]() {
702
- return [un, ln];
703
- }
704
- get color() {
705
- return this[hn];
706
- }
707
- set color(e) {
708
- if (!this[mn](e)) {
709
- let t = this.colorModel.toHsva(e);
710
- this[_n](t), this[hn] = e;
711
- }
712
- }
713
- constructor() {
714
- super();
715
- let e = en(`<style>${this[yn].join("")}</style>`), t = this.attachShadow({ mode: "open" });
716
- t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[vn] = this[bn].map((e) => new e(t));
717
- }
718
- connectedCallback() {
719
- if (this.hasOwnProperty("color")) {
720
- let e = this.color;
721
- delete this.color, this.color = e;
722
- } else this.color ||= this.colorModel.defaultColor;
723
- }
724
- attributeChangedCallback(e, t, n) {
725
- let r = this.colorModel.fromAttr(n);
726
- this[mn](r) || (this.color = r);
727
- }
728
- handleEvent(e) {
729
- let t = this[gn], n = {
730
- ...t,
731
- ...e.detail
732
- };
733
- this[_n](n);
734
- let r;
735
- !Zt(n, t) && !this[mn](r = this.colorModel.fromHsva(n)) && (this[hn] = r, tn(this, "color-changed", { value: r }));
736
- }
737
- [mn](e) {
738
- return this.color && this.colorModel.equal(e, this.color);
739
- }
740
- [_n](e) {
741
- this[gn] = e, this[vn].forEach((t) => t.update(e));
742
- }
743
- }, Sn = {
744
- defaultColor: "#000",
745
- toHsva: Ht,
746
- fromHsva: ({ h: e, s: t, v: n }) => Wt({
747
- h: e,
748
- s: t,
749
- v: n,
750
- a: 1
751
- }),
752
- equal: Qt,
753
- fromAttr: (e) => e
754
- }, Cn = class extends xn {
755
- get colorModel() {
756
- return Sn;
757
- }
758
- }, wn = class extends Cn {};
759
- customElements.define("hex-color-picker", wn);
760
- //#endregion
761
- //#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
762
- var Tn = [
763
- "disabled",
764
- "aria-label",
765
- "aria-expanded"
766
- ], En = [
767
- "value",
768
- "placeholder",
769
- "disabled",
770
- "aria-label"
771
- ], Dn = ["color", "aria-label"], Y = /* @__PURE__ */ F({
772
- __name: "ColorPicker",
773
- props: {
774
- modelValue: {},
775
- placeholder: { default: Fe },
776
- size: { default: "default" },
777
- swatchOnly: {
778
- type: Boolean,
779
- default: !1
780
- },
781
- disabled: {
782
- type: Boolean,
783
- default: !1
784
- }
785
- },
786
- emits: ["update:modelValue"],
787
- setup(e, { emit: t }) {
788
- let n = e, r = t, { t: i } = y(), a = B(!1), o = B(), s = B();
789
- le(o, () => {
790
- a.value = !1;
791
- }, { ignore: [s] });
792
- let c = O({
793
- get: () => n.modelValue || "#000000",
794
- set: (e) => r("update:modelValue", e)
795
- });
796
- function l(e) {
797
- c.value = e.detail.value;
798
- }
799
- function u(e) {
800
- c.value = e.target.value;
801
- }
802
- return (t, n) => (z(), j("div", { class: L(["tpl:flex tpl:gap-2 tpl:relative", e.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
803
- M("button", {
804
- ref_key: "swatchRef",
805
- ref: s,
806
- type: "button",
807
- disabled: e.disabled,
808
- "aria-label": U(i).colorPicker.pickColor,
809
- "aria-expanded": a.value,
810
- class: L([
811
- "tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-0.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
812
- e.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
813
- a.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !e.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
814
- e.size === "large" ? "tpl:size-12" : "tpl:size-10"
815
- ]),
816
- onClick: n[0] ||= (t) => !e.disabled && (a.value = !a.value)
817
- }, [M("span", {
818
- class: "tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]",
819
- style: R({ backgroundColor: c.value })
820
- }, null, 4)], 10, Tn),
821
- e.swatchOnly ? A("", !0) : (z(), j("input", {
822
- key: 0,
823
- type: "text",
824
- class: L(U(Ie)),
825
- value: e.modelValue,
826
- placeholder: e.placeholder,
827
- disabled: e.disabled,
828
- "aria-label": U(i).colorPicker.hexValue,
829
- onInput: u
830
- }, null, 42, En)),
831
- P(He, {
832
- "enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
833
- "enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
834
- "enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
835
- "leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
836
- "leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
837
- "leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
838
- }, {
839
- default: W(() => [a.value ? (z(), j("div", {
840
- key: 0,
841
- ref_key: "popoverRef",
842
- ref: o,
843
- class: "tpl:absolute tpl:left-0 tpl:top-full tpl:z-50 tpl:mt-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg"
844
- }, [M("hex-color-picker", {
845
- color: c.value,
846
- "aria-label": U(i).colorPicker.pickColor,
847
- onColorChanged: l,
848
- onKeydown: n[1] ||= K((e) => a.value = !1, ["escape"])
849
- }, null, 40, Dn)], 512)) : A("", !0)]),
850
- _: 1
851
- })
852
- ], 2));
853
- }
854
- });
855
- //#endregion
856
- //#region src/composables/useMergeTagField.ts
857
- function On(e) {
858
- let { modelValue: t, emit: n, elementRef: r } = e, { isEnabled: i, isRequesting: a, isMergeTagValue: o, getMergeTagLabel: s, requestMergeTag: c, syntax: l } = Be(), u = B(!1), d = !1, f = O(() => {
859
- let e = t();
860
- if (!e) return [];
861
- let n = [], r = `(${l.value.source}|${l.logic.source})`, i = new RegExp(r, "g"), a = 0, c;
862
- for (; (c = i.exec(e)) !== null;) {
863
- c.index > a && n.push({
864
- type: "text",
865
- value: e.slice(a, c.index)
866
- });
867
- let t = c[0];
868
- o(t) ? n.push({
869
- type: "mergeTag",
870
- value: t,
871
- label: s(t)
872
- }) : ot(t, l) ? n.push({
873
- type: "logicMergeTag",
874
- value: t,
875
- keyword: it(t, l)
876
- }) : n.push({
877
- type: "text",
878
- value: t
879
- }), a = c.index + t.length;
880
- }
881
- return a < e.length && n.push({
882
- type: "text",
883
- value: e.slice(a)
884
- }), n;
885
- }), p = O(() => f.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
886
- function m() {
887
- u.value = !0, We(() => {
888
- r.value?.focus();
889
- let e = t()?.length || 0;
890
- r.value?.setSelectionRange(e, e);
891
- });
892
- }
893
- function h() {
894
- d || (u.value = !1);
895
- }
896
- function g(e) {
897
- n(e.target.value);
898
- }
899
- function _() {
900
- n("");
901
- }
902
- async function ee() {
903
- let e = u.value && r.value ? r.value.selectionStart ?? t().length : t().length;
904
- d = !0;
905
- let i = await c();
906
- if (d = !1, i) {
907
- let a = t().slice(0, e), o = t().slice(e);
908
- n(a + i.value + o), u.value = !0, We(() => {
909
- let t = e + i.value.length;
910
- r.value?.focus(), r.value?.setSelectionRange(t, t);
911
- });
912
- }
913
- }
914
- return {
915
- segments: f,
916
- hasMergeTags: p,
917
- mergeTagEnabled: i,
918
- isRequestingMergeTag: a,
919
- isEditing: u,
920
- startEditing: m,
921
- stopEditing: h,
922
- handleInput: g,
923
- clearValue: _,
924
- insertMergeTag: ee
925
- };
926
- }
927
- //#endregion
928
- //#region src/components/MergeTagTextarea.vue?vue&type=script&setup=true&lang.ts
929
- var kn = { key: 0 }, An = ["aria-label"], jn = ["data-tooltip"], Mn = ["data-tooltip"], Nn = {
930
- key: 2,
931
- class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
932
- }, Pn = ["aria-label", "title"], Fn = [
933
- "aria-label",
934
- "title",
935
- "disabled"
936
- ], In = { key: 1 }, Ln = [
937
- "value",
938
- "placeholder",
939
- "rows"
940
- ], Rn = [
941
- "aria-label",
942
- "title",
943
- "disabled"
944
- ], zn = "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)]", Bn = "tpl:flex tpl:w-full tpl:min-h-[5rem] tpl:cursor-pointer tpl:items-start tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", Vn = "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)]", Hn = /* @__PURE__ */ F({
945
- __name: "MergeTagTextarea",
946
- props: {
947
- modelValue: {},
948
- placeholder: { default: "" },
949
- rows: { default: 3 }
950
- },
951
- emits: ["update:modelValue"],
952
- setup(e, { emit: t }) {
953
- let n = e, r = t, { t: i } = y(), a = B(null), { segments: o, hasMergeTags: s, mergeTagEnabled: c, isRequestingMergeTag: l, isEditing: u, startEditing: d, stopEditing: f, handleInput: p, clearValue: m, insertMergeTag: h } = On({
954
- modelValue: () => n.modelValue,
955
- emit: (e) => r("update:modelValue", e),
956
- elementRef: a
957
- });
958
- return (t, n) => U(s) && !U(u) ? (z(), j("div", kn, [M("div", {
959
- role: "button",
960
- tabindex: "0",
961
- "aria-label": U(i).mergeTag.clickToEdit,
962
- class: L(Bn),
963
- onClick: n[1] ||= (...e) => U(d) && U(d)(...e),
964
- onKeydown: [n[2] ||= K((...e) => U(d) && U(d)(...e), ["enter"]), n[3] ||= K(Ze((...e) => U(d) && U(d)(...e), ["prevent"]), ["space"])]
965
- }, [(z(!0), j(D, null, V(U(o), (e, t) => (z(), j(D, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" ? (z(), j("span", {
966
- key: 0,
967
- 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",
968
- "data-tooltip": e.value,
969
- style: {
970
- "background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
971
- color: "var(--tpl-primary)"
972
- }
973
- }, H(e.label), 9, jn)) : e.type === "logicMergeTag" ? (z(), j("span", {
974
- key: 1,
975
- 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",
976
- "data-tooltip": e.value,
977
- style: {
978
- "background-color": "transparent",
979
- border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
980
- color: "var(--tpl-primary)"
981
- }
982
- }, H(e.keyword), 9, Mn)) : (z(), j("span", Nn, H(e.value), 1))], 64))), 128)), M("button", {
983
- type: "button",
984
- 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",
985
- "aria-label": U(i).mergeTag.remove,
986
- title: U(i).mergeTag.remove,
987
- onClick: n[0] ||= Ze((...e) => U(m) && U(m)(...e), ["stop"])
988
- }, [P(U(ze), {
989
- size: 12,
990
- "stroke-width": 2.5
991
- })], 8, Pn)], 40, An), U(c) ? (z(), j("button", {
992
- key: 0,
993
- type: "button",
994
- class: L([Vn, "tpl:mt-1.5"]),
995
- "aria-label": U(i).mergeTag.insert,
996
- title: U(i).mergeTag.insert,
997
- disabled: U(l),
998
- onClick: n[4] ||= (...e) => U(h) && U(h)(...e)
999
- }, [P(U(ke), {
1000
- size: 12,
1001
- "stroke-width": 2
1002
- }), N(" " + H(U(i).mergeTag.insert), 1)], 8, Fn)) : A("", !0)])) : (z(), j("div", In, [M("textarea", {
1003
- ref_key: "textareaRef",
1004
- ref: a,
1005
- class: L(zn),
1006
- value: e.modelValue,
1007
- placeholder: e.placeholder,
1008
- rows: e.rows,
1009
- onInput: n[5] ||= (...e) => U(p) && U(p)(...e),
1010
- onBlur: n[6] ||= (...e) => U(f) && U(f)(...e),
1011
- onKeydown: n[7] ||= K((...e) => U(f) && U(f)(...e), ["escape"])
1012
- }, null, 40, Ln), U(c) ? (z(), j("button", {
1013
- key: 0,
1014
- type: "button",
1015
- class: L([Vn, "tpl:mt-1.5"]),
1016
- "aria-label": U(i).mergeTag.insert,
1017
- title: U(i).mergeTag.insert,
1018
- disabled: U(l),
1019
- onClick: n[8] ||= (...e) => U(h) && U(h)(...e)
1020
- }, [P(U(ke), {
1021
- size: 12,
1022
- "stroke-width": 2
1023
- }), N(" " + H(U(i).mergeTag.insert), 1)], 8, Rn)) : A("", !0)]));
1024
- }
1025
- }), Un = { class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]" }, Wn = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:gap-3 tpl:overflow-y-auto tpl:p-4" }, Gn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Kn = { class: "tpl:mb-3.5" }, qn = { 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)]" }, Jn = ["onClick"], Yn = { class: "tpl:flex tpl:items-stretch" }, Xn = ["value"], Zn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Qn = { class: "tpl:mb-3.5" }, $n = ["value"], er = ["value"], tr = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, nr = { class: "tpl:mt-1 tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, rr = { class: "tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, ir = { class: "tpl:shrink-0 tpl:text-xs tpl:tabular-nums tpl:text-[var(--tpl-text-dim)]" }, ar = { class: "tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3" }, or = { 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)]" }, sr = { class: "tpl:m-0 tpl:pl-[18px] tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, cr = { class: "tpl:mb-1 tpl:last:mb-0" }, lr = { class: "tpl:mb-1 tpl:last:mb-0" }, ur = { class: "tpl:mb-1 tpl:last:mb-0" }, dr = 150, fr = /* @__PURE__ */ F({
1026
- __name: "TemplateSettings",
1027
- props: { settings: {} },
1028
- emits: ["update"],
1029
- setup(e, { emit: t }) {
1030
- let n = e, r = t, { t: i } = y(), a = ue(ve, "TemplateSettings"), o = O(() => a.fonts.value), s = O(() => o.value.some((e) => e.value === n.settings.fontFamily) ? n.settings.fontFamily : a.defaultFont.value), c = [
1031
- {
1032
- value: 480,
1033
- label: "480px"
1034
- },
1035
- {
1036
- value: 600,
1037
- label: "600px"
1038
- },
1039
- {
1040
- value: 700,
1041
- label: "700px"
1042
- },
1043
- {
1044
- value: 800,
1045
- label: "800px"
1046
- }
1047
- ];
1048
- return (t, n) => (z(), j("aside", Un, [M("div", Wn, [
1049
- M("div", { class: L(U(Me)) }, [
1050
- M("div", Gn, [P(U(vt), {
1051
- class: "tpl:text-[var(--tpl-text-muted)]",
1052
- size: 14,
1053
- "stroke-width": 2
1054
- }), M("span", null, H(U(i).templateSettings.layout), 1)]),
1055
- M("div", Kn, [M("label", { class: L(U(T)) }, H(U(i).templateSettings.widthPreset), 3), M("div", qn, [(z(), j(D, null, V(c, (t) => M("button", {
1056
- key: t.value,
1057
- 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)]",
1058
- style: R({
1059
- backgroundColor: e.settings.width === t.value ? "var(--tpl-bg)" : "transparent",
1060
- color: e.settings.width === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
1061
- boxShadow: e.settings.width === t.value ? "var(--tpl-shadow)" : "none"
1062
- }),
1063
- onClick: (e) => r("update", { width: t.value })
1064
- }, H(t.label), 13, Jn)), 64))])]),
1065
- M("div", null, [M("label", { class: L(U(T)) }, H(U(i).templateSettings.customWidth), 3), M("div", Yn, [M("input", {
1066
- type: "number",
1067
- class: L(U(w)),
1068
- value: e.settings.width,
1069
- min: "300",
1070
- max: "900",
1071
- onInput: n[0] ||= (e) => r("update", { width: Number(e.target.value) })
1072
- }, null, 42, Xn), M("span", { class: L(U(E)) }, "px", 2)])])
1073
- ], 2),
1074
- M("div", { class: L(U(Me)) }, [
1075
- M("div", Zn, [P(U(st), {
1076
- class: "tpl:text-[var(--tpl-text-muted)]",
1077
- size: 14,
1078
- "stroke-width": 2
1079
- }), M("span", null, H(U(i).templateSettings.appearance), 1)]),
1080
- M("div", Qn, [M("label", { class: L(U(T)) }, H(U(i).templateSettings.backgroundColor), 3), P(Y, {
1081
- "model-value": e.settings.backgroundColor,
1082
- placeholder: U(Le),
1083
- "onUpdate:modelValue": n[1] ||= (e) => r("update", { backgroundColor: e })
1084
- }, null, 8, ["model-value", "placeholder"])]),
1085
- M("div", null, [M("label", { class: L(U(T)) }, H(U(i).templateSettings.fontFamily), 3), M("select", {
1086
- class: L(U(C)),
1087
- value: s.value,
1088
- onChange: n[2] ||= (e) => r("update", { fontFamily: e.target.value })
1089
- }, [(z(!0), j(D, null, V(o.value, (e) => (z(), j("option", {
1090
- key: e.value,
1091
- value: e.value
1092
- }, H(e.label), 9, er))), 128))], 42, $n)])
1093
- ], 2),
1094
- M("div", { class: L(U(Me)) }, [M("div", tr, [P(U(Ee), {
1095
- class: "tpl:text-[var(--tpl-text-muted)]",
1096
- size: 14,
1097
- "stroke-width": 2
1098
- }), M("span", null, H(U(i).templateSettings.preheaderText), 1)]), M("div", null, [P(Hn, {
1099
- "model-value": e.settings.preheaderText ?? "",
1100
- placeholder: U(i).templateSettings.preheaderTextPlaceholder,
1101
- rows: 2,
1102
- "onUpdate:modelValue": n[3] ||= (e) => r("update", { preheaderText: e.replace(/[\r\n]/g, " ") || void 0 })
1103
- }, null, 8, ["model-value", "placeholder"]), M("div", nr, [M("span", rr, H(U(i).templateSettings.preheaderTextHint), 1), M("span", ir, H((e.settings.preheaderText ?? "").length) + "/" + H(dr), 1)])])], 2),
1104
- M("div", ar, [M("div", or, [P(U(Te), {
1105
- size: 14,
1106
- "stroke-width": 2
1107
- }), M("span", null, H(U(i).templateSettings.tips), 1)]), M("ul", sr, [
1108
- M("li", cr, H(U(i).templateSettings.tip1), 1),
1109
- M("li", lr, H(U(i).templateSettings.tip2), 1),
1110
- M("li", ur, H(U(i).templateSettings.tip3), 1)
1111
- ])])
1112
- ])]));
1113
- }
1114
- }), pr = { key: 0 }, mr = ["aria-label"], hr = ["data-tooltip"], gr = ["data-tooltip"], _r = {
1115
- key: 2,
1116
- class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
1117
- }, vr = ["aria-label", "title"], yr = [
1118
- "aria-label",
1119
- "title",
1120
- "disabled"
1121
- ], br = { key: 1 }, xr = [
1122
- "type",
1123
- "value",
1124
- "placeholder"
1125
- ], Sr = [
1126
- "aria-label",
1127
- "title",
1128
- "disabled"
1129
- ], 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)]", wr = "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)]", X = /* @__PURE__ */ x(/* @__PURE__ */ F({
1130
- __name: "MergeTagInput",
1131
- props: {
1132
- modelValue: {},
1133
- type: { default: "text" },
1134
- placeholder: { default: "" },
1135
- pulse: {
1136
- type: Boolean,
1137
- default: !1
1138
- }
1139
- },
1140
- emits: ["update:modelValue"],
1141
- setup(e, { emit: t }) {
1142
- let n = e, r = t, { t: i } = y(), a = B(null), { segments: o, hasMergeTags: s, mergeTagEnabled: c, isRequestingMergeTag: l, isEditing: u, startEditing: d, stopEditing: f, handleInput: p, clearValue: m, insertMergeTag: h } = On({
1143
- modelValue: () => n.modelValue,
1144
- emit: (e) => r("update:modelValue", e),
1145
- elementRef: a
1146
- });
1147
- return (t, n) => U(s) && !U(u) ? (z(), j("div", pr, [M("div", {
1148
- role: "button",
1149
- tabindex: "0",
1150
- "aria-label": U(i).mergeTag.clickToEdit,
1151
- class: L([Cr, { "tpl-pulse-fill": e.pulse }]),
1152
- onClick: n[1] ||= (...e) => U(d) && U(d)(...e),
1153
- onKeydown: [n[2] ||= K((...e) => U(d) && U(d)(...e), ["enter"]), n[3] ||= K(Ze((...e) => U(d) && U(d)(...e), ["prevent"]), ["space"])]
1154
- }, [(z(!0), j(D, null, V(U(o), (e, t) => (z(), j(D, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" ? (z(), j("span", {
1155
- key: 0,
1156
- 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",
1157
- "data-tooltip": e.value,
1158
- style: {
1159
- "background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
1160
- color: "var(--tpl-primary)"
1161
- }
1162
- }, H(e.label), 9, hr)) : e.type === "logicMergeTag" ? (z(), j("span", {
1163
- key: 1,
1164
- 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",
1165
- "data-tooltip": e.value,
1166
- style: {
1167
- "background-color": "transparent",
1168
- border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
1169
- color: "var(--tpl-primary)"
1170
- }
1171
- }, H(e.keyword), 9, gr)) : (z(), j("span", _r, H(e.value), 1))], 64))), 128)), M("button", {
1172
- type: "button",
1173
- 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",
1174
- "aria-label": U(i).mergeTag.remove,
1175
- title: U(i).mergeTag.remove,
1176
- onClick: n[0] ||= Ze((...e) => U(m) && U(m)(...e), ["stop"])
1177
- }, [P(U(ze), {
1178
- size: 12,
1179
- "stroke-width": 2.5
1180
- })], 8, vr)], 42, mr), U(c) ? (z(), j("button", {
1181
- key: 0,
1182
- type: "button",
1183
- class: L([wr, "tpl:mt-1.5"]),
1184
- "aria-label": U(i).mergeTag.insert,
1185
- title: U(i).mergeTag.insert,
1186
- disabled: U(l),
1187
- onClick: n[4] ||= (...e) => U(h) && U(h)(...e)
1188
- }, [P(U(ke), {
1189
- size: 12,
1190
- "stroke-width": 2
1191
- }), N(" " + H(U(i).mergeTag.insert), 1)], 8, yr)) : A("", !0)])) : (z(), j("div", br, [M("input", {
1192
- ref_key: "inputRef",
1193
- ref: a,
1194
- type: e.type,
1195
- class: L([U(C), { "tpl-pulse-fill": e.pulse }]),
1196
- value: e.modelValue,
1197
- placeholder: e.placeholder,
1198
- onInput: n[5] ||= (...e) => U(p) && U(p)(...e),
1199
- onBlur: n[6] ||= (...e) => U(f) && U(f)(...e),
1200
- onKeydown: n[7] ||= K((...e) => U(f) && U(f)(...e), ["escape"])
1201
- }, null, 42, xr), U(c) ? (z(), j("button", {
1202
- key: 0,
1203
- type: "button",
1204
- class: L([wr, "tpl:mt-1.5"]),
1205
- "aria-label": U(i).mergeTag.insert,
1206
- title: U(i).mergeTag.insert,
1207
- disabled: U(l),
1208
- onClick: n[8] ||= (...e) => U(h) && U(h)(...e)
1209
- }, [P(U(ke), {
1210
- size: 12,
1211
- "stroke-width": 2
1212
- }), N(" " + H(U(i).mergeTag.insert), 1)], 8, Sr)) : A("", !0)]));
1213
- }
1214
- }), [["__scopeId", "data-v-978af663"]]), Tr = { class: "tpl:mb-3.5" }, Er = ["value"], Dr = { value: "" }, Or = ["value"], kr = { class: "tpl:mb-3.5" }, Ar = { class: "tpl:mb-3.5" }, jr = {
1215
- key: 0,
1216
- class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
1217
- }, Mr = ["checked"], Nr = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, Pr = { class: "tpl:mb-3.5" }, Fr = { class: "tpl:mb-3.5" }, Ir = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, Lr = { class: "tpl:mb-3.5" }, Rr = { class: "tpl:flex tpl:items-stretch" }, zr = ["value"], Br = { class: "tpl:mb-3.5" }, Vr = { class: "tpl:flex tpl:items-stretch" }, Hr = ["value"], Ur = /* @__PURE__ */ F({
1218
- __name: "ButtonToolbar",
1219
- props: {
1220
- block: {},
1221
- fontFamilies: {}
1222
- },
1223
- emits: ["update"],
1224
- setup(e, { emit: t }) {
1225
- let n = t, { t: r } = y();
1226
- function i(e, t) {
1227
- n("update", { [e]: t });
1228
- }
1229
- return (t, n) => (z(), j(D, null, [
1230
- M("div", Tr, [M("label", { class: L(U(T)) }, H(U(r).button.fontFamily), 3), M("select", {
1231
- class: L(U(C)),
1232
- value: e.block.fontFamily || "",
1233
- onChange: n[0] ||= (e) => i("fontFamily", e.target.value || void 0)
1234
- }, [M("option", Dr, H(U(r).button.inheritFont), 1), (z(!0), j(D, null, V(e.fontFamilies, (e) => (z(), j("option", {
1235
- key: e.value,
1236
- value: e.value
1237
- }, H(e.label), 9, Or))), 128))], 42, Er)]),
1238
- M("div", kr, [M("label", { class: L(U(T)) }, H(U(r).button.text), 3), P(X, {
1239
- "model-value": e.block.text,
1240
- type: "text",
1241
- "onUpdate:modelValue": n[1] ||= (e) => i("text", e)
1242
- }, null, 8, ["model-value"])]),
1243
- M("div", Ar, [
1244
- M("label", { class: L(U(T)) }, H(U(r).button.url), 3),
1245
- P(X, {
1246
- "model-value": e.block.url,
1247
- type: "url",
1248
- placeholder: U(r).button.urlPlaceholder,
1249
- "onUpdate:modelValue": n[2] ||= (e) => i("url", e)
1250
- }, null, 8, ["model-value", "placeholder"]),
1251
- e.block.url ? (z(), j("label", jr, [M("input", {
1252
- type: "checkbox",
1253
- class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1254
- checked: e.block.openInNewTab ?? !1,
1255
- onChange: n[3] ||= (e) => i("openInNewTab", e.target.checked)
1256
- }, null, 40, Mr), N(" " + H(U(r).button.openInNewTab), 1)])) : A("", !0)
1257
- ]),
1258
- M("div", Nr, [M("div", Pr, [M("label", { class: L(U(T)) }, H(U(r).button.background), 3), P(Y, {
1259
- "model-value": e.block.backgroundColor,
1260
- "onUpdate:modelValue": n[4] ||= (e) => i("backgroundColor", e)
1261
- }, null, 8, ["model-value"])]), M("div", Fr, [M("label", { class: L(U(T)) }, H(U(r).button.textColor), 3), P(Y, {
1262
- "model-value": e.block.textColor,
1263
- "onUpdate:modelValue": n[5] ||= (e) => i("textColor", e)
1264
- }, null, 8, ["model-value"])])]),
1265
- M("div", Ir, [M("div", Lr, [M("label", { class: L(U(T)) }, H(U(r).button.borderRadius), 3), M("div", Rr, [M("input", {
1266
- type: "number",
1267
- class: L(U(w)),
1268
- value: e.block.borderRadius,
1269
- min: "0",
1270
- max: "50",
1271
- onInput: n[6] ||= (e) => i("borderRadius", Number(e.target.value))
1272
- }, null, 42, zr), M("span", { class: L(U(E)) }, "px", 2)])]), M("div", Br, [M("label", { class: L(U(T)) }, H(U(r).button.fontSize), 3), M("div", Vr, [M("input", {
1273
- type: "number",
1274
- class: L(U(w)),
1275
- value: e.block.fontSize,
1276
- min: "10",
1277
- max: "36",
1278
- onInput: n[7] ||= (e) => i("fontSize", Number(e.target.value))
1279
- }, null, 42, Hr), M("span", { class: L(U(E)) }, "px", 2)])])])
1280
- ], 64));
1281
- }
1282
- }), Wr = { class: "spacing-control" }, Gr = { class: "tpl:mb-2 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Kr = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5" }, qr = { class: "tpl:flex tpl:items-center" }, Jr = ["aria-label"], Yr = ["value", "aria-label"], Xr = ["aria-label"], Zr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Qr = { class: "tpl:flex tpl:items-center" }, $r = ["aria-label"], ei = ["value", "aria-label"], ti = ["aria-label"], ni = ["aria-label", "title"], ri = { class: "tpl:flex tpl:items-center" }, ii = ["aria-label"], ai = ["value", "aria-label"], oi = ["aria-label"], si = { class: "tpl:flex tpl:items-center" }, ci = ["aria-label"], li = ["value", "aria-label"], ui = ["aria-label"], Z = "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)]", di = "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)]", fi = /* @__PURE__ */ x(/* @__PURE__ */ F({
1283
- __name: "SpacingControl",
1284
- props: {
1285
- modelValue: {},
1286
- label: {}
1287
- },
1288
- emits: ["update:modelValue"],
1289
- setup(e, { emit: t }) {
1290
- let n = e, r = t, { t: i } = y(), a = O(() => n.modelValue.top === n.modelValue.right && n.modelValue.right === n.modelValue.bottom && n.modelValue.bottom === n.modelValue.left), o = B(a.value);
1291
- Xe(a, (e) => {
1292
- !e && o.value && (o.value = !1);
1293
- });
1294
- function s(e, t) {
1295
- let i = n.modelValue[e], a = Math.max(0, i + t);
1296
- o.value ? r("update:modelValue", {
1297
- top: a,
1298
- right: a,
1299
- bottom: a,
1300
- left: a
1301
- }) : r("update:modelValue", {
1302
- ...n.modelValue,
1303
- [e]: a
1304
- });
1305
- }
1306
- function c(e, t) {
1307
- let i = Math.max(0, t);
1308
- o.value ? r("update:modelValue", {
1309
- top: i,
1310
- right: i,
1311
- bottom: i,
1312
- left: i
1313
- }) : r("update:modelValue", {
1314
- ...n.modelValue,
1315
- [e]: i
1316
- });
1317
- }
1318
- function l() {
1319
- if (o.value = !o.value, o.value) {
1320
- let e = n.modelValue.top;
1321
- r("update:modelValue", {
1322
- top: e,
1323
- right: e,
1324
- bottom: e,
1325
- left: e
1326
- });
1327
- }
1328
- }
1329
- return (t, n) => (z(), j("div", Wr, [M("label", Gr, H(e.label), 1), M("div", Kr, [
1330
- M("div", qr, [
1331
- M("button", {
1332
- "aria-label": U(i).spacingControl.decreaseTop,
1333
- class: L([Z, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1334
- onClick: n[0] ||= (e) => s("top", -1)
1335
- }, [P(U(S), {
1336
- size: 12,
1337
- "stroke-width": 2
1338
- })], 10, Jr),
1339
- M("input", {
1340
- type: "number",
1341
- class: L(di),
1342
- value: e.modelValue.top,
1343
- "aria-label": U(i).spacingControl.top,
1344
- min: "0",
1345
- onInput: n[1] ||= (e) => c("top", Number(e.target.value))
1346
- }, null, 40, Yr),
1347
- M("button", {
1348
- "aria-label": U(i).spacingControl.increaseTop,
1349
- class: L([Z, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1350
- onClick: n[2] ||= (e) => s("top", 1)
1351
- }, [P(U(q), {
1352
- size: 12,
1353
- "stroke-width": 2
1354
- })], 10, Xr)
1355
- ]),
1356
- M("div", Zr, [
1357
- M("div", Qr, [
1358
- M("button", {
1359
- "aria-label": U(i).spacingControl.decreaseLeft,
1360
- class: L([Z, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1361
- onClick: n[3] ||= (e) => s("left", -1)
1362
- }, [P(U(S), {
1363
- size: 12,
1364
- "stroke-width": 2
1365
- })], 10, $r),
1366
- M("input", {
1367
- type: "number",
1368
- class: L(di),
1369
- value: e.modelValue.left,
1370
- "aria-label": U(i).spacingControl.left,
1371
- min: "0",
1372
- onInput: n[4] ||= (e) => c("left", Number(e.target.value))
1373
- }, null, 40, ei),
1374
- M("button", {
1375
- "aria-label": U(i).spacingControl.increaseLeft,
1376
- class: L([Z, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1377
- onClick: n[5] ||= (e) => s("left", 1)
1378
- }, [P(U(q), {
1379
- size: 12,
1380
- "stroke-width": 2
1381
- })], 10, ti)
1382
- ]),
1383
- M("button", {
1384
- class: L(["tpl:flex tpl:h-8 tpl:w-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", o.value ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] hover:tpl:bg-[var(--tpl-bg-hover)]"]),
1385
- "aria-label": o.value ? U(i).spacingControl.unlock : U(i).spacingControl.lockAll,
1386
- title: o.value ? U(i).spacingControl.unlock : U(i).spacingControl.lockAll,
1387
- onClick: l
1388
- }, [o.value ? (z(), k(U(ut), {
1389
- key: 0,
1390
- size: 14,
1391
- "stroke-width": 2
1392
- })) : (z(), k(U(lt), {
1393
- key: 1,
1394
- size: 14,
1395
- "stroke-width": 2
1396
- }))], 10, ni),
1397
- M("div", ri, [
1398
- M("button", {
1399
- "aria-label": U(i).spacingControl.decreaseRight,
1400
- class: L([Z, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1401
- onClick: n[6] ||= (e) => s("right", -1)
1402
- }, [P(U(S), {
1403
- size: 12,
1404
- "stroke-width": 2
1405
- })], 10, ii),
1406
- M("input", {
1407
- type: "number",
1408
- class: L(di),
1409
- value: e.modelValue.right,
1410
- "aria-label": U(i).spacingControl.right,
1411
- min: "0",
1412
- onInput: n[7] ||= (e) => c("right", Number(e.target.value))
1413
- }, null, 40, ai),
1414
- M("button", {
1415
- "aria-label": U(i).spacingControl.increaseRight,
1416
- class: L([Z, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1417
- onClick: n[8] ||= (e) => s("right", 1)
1418
- }, [P(U(q), {
1419
- size: 12,
1420
- "stroke-width": 2
1421
- })], 10, oi)
1422
- ])
1423
- ]),
1424
- M("div", si, [
1425
- M("button", {
1426
- "aria-label": U(i).spacingControl.decreaseBottom,
1427
- class: L([Z, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1428
- onClick: n[9] ||= (e) => s("bottom", -1)
1429
- }, [P(U(S), {
1430
- size: 12,
1431
- "stroke-width": 2
1432
- })], 10, ci),
1433
- M("input", {
1434
- type: "number",
1435
- class: L(di),
1436
- value: e.modelValue.bottom,
1437
- "aria-label": U(i).spacingControl.bottom,
1438
- min: "0",
1439
- onInput: n[10] ||= (e) => c("bottom", Number(e.target.value))
1440
- }, null, 40, li),
1441
- M("button", {
1442
- "aria-label": U(i).spacingControl.increaseBottom,
1443
- class: L([Z, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1444
- onClick: n[11] ||= (e) => s("bottom", 1)
1445
- }, [P(U(q), {
1446
- size: 12,
1447
- "stroke-width": 2
1448
- })], 10, ui)
1449
- ])
1450
- ])]));
1451
- }
1452
- }), [["__scopeId", "data-v-9a9c8a07"]]), pi = { class: "tpl:mt-3" }, mi = { class: "tpl:mt-4" }, hi = { class: "tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3" }, gi = { class: "tpl:mt-3" }, _i = { class: "tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3" }, vi = { class: "tpl:mt-3 tpl:space-y-2" }, yi = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, bi = ["checked"], xi = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, Si = ["checked"], Ci = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, wi = ["checked"], Ti = { class: "tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3" }, Ei = { class: "tpl:mt-3" }, Di = ["value", "placeholder"], Oi = {
1453
- key: 0,
1454
- class: "tpl:border-t tpl:border-[var(--tpl-border)] tpl:py-3"
1455
- }, ki = { class: "tpl:mt-3 tpl:space-y-2" }, Ai = ["value"], ji = { value: "" }, Mi = ["label"], Ni = ["value"], Pi = ["value"], Fi = {
1456
- key: 0,
1457
- value: "__custom__"
1458
- }, Ii = {
1459
- key: 0,
1460
- class: "tpl:space-y-2"
1461
- }, Li = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Ri = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, zi = { class: "tpl:flex tpl:justify-end" }, Bi = ["disabled"], Vi = {
1462
- key: 0,
1463
- class: "tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]"
1464
- }, Hi = { class: "tpl:space-y-1" }, Ui = { 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)]" }, Wi = {
1465
- key: 0,
1466
- 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)]"
1467
- }, Gi = /* @__PURE__ */ F({
1468
- __name: "CommonBlockSettings",
1469
- props: {
1470
- block: {},
1471
- isFirstSection: { type: Boolean }
1472
- },
1473
- emits: ["update"],
1474
- setup(e, { emit: t }) {
1475
- let n = e, r = t, { t: i } = y(), a = I(pe, []), o = I(ge, !1), s = Ge(/* @__PURE__ */ new Set());
1476
- function c(e) {
1477
- s.has(e) ? s.delete(e) : s.add(e);
1478
- }
1479
- let l = O(() => a.length > 0 || o), u = B(!1), d = B(""), f = B(""), p = O(() => n.block.displayCondition ? !a.some((e) => e.label === n.block.displayCondition?.label) : !1);
1480
- function m() {
1481
- u.value = !0, p.value && n.block.displayCondition ? (d.value = n.block.displayCondition.before, f.value = n.block.displayCondition.after ?? "") : (d.value = "", f.value = "");
1482
- }
1483
- function h() {
1484
- d.value.trim() && (r("update", { displayCondition: {
1485
- label: i.blockSettings.customCondition,
1486
- before: d.value.trim(),
1487
- after: f.value.trim()
1488
- } }), u.value = !1, d.value = "", f.value = "");
1489
- }
1490
- Xe(() => n.block.displayCondition, (e) => {
1491
- if (!e) {
1492
- u.value = !1, d.value = "", f.value = "";
1493
- return;
1494
- }
1495
- p.value && (d.value = e.before, f.value = e.after ?? "");
1496
- }, { immediate: !0 });
1497
- let g = O(() => {
1498
- let e = {};
1499
- for (let t of a) {
1500
- let n = t.group ?? "";
1501
- e[n] || (e[n] = []), e[n].push(t);
1502
- }
1503
- return e;
1504
- });
1505
- function _(e, t) {
1506
- r("update", { styles: {
1507
- ...n.block.styles,
1508
- [e]: t
1509
- } });
1510
- }
1511
- return (t, n) => (z(), j("div", { class: L(["tpl:flex tpl:flex-col", e.isFirstSection ? "" : "tpl:mt-4"]) }, [
1512
- M("div", { class: L(["tpl:py-3", e.isFirstSection ? "" : "tpl:border-t tpl:border-[var(--tpl-border)]"]) }, [M("button", {
1513
- type: "button",
1514
- 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)]",
1515
- onClick: n[0] ||= (e) => c("spacing")
1516
- }, [P(U(xe), {
1517
- class: L(["tpl:transition-transform tpl:duration-200", s.has("spacing") ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1518
- size: 12,
1519
- "stroke-width": 2
1520
- }, null, 8, ["class"]), M("span", null, H(U(i).blockSettings.spacing), 1)]), G(M("div", pi, [P(fi, {
1521
- label: U(i).blockSettings.padding,
1522
- "model-value": e.block.styles.padding,
1523
- "onUpdate:modelValue": n[1] ||= (e) => _("padding", e)
1524
- }, null, 8, ["label", "model-value"]), M("div", mi, [P(fi, {
1525
- label: U(i).blockSettings.margin,
1526
- "model-value": e.block.styles.margin,
1527
- "onUpdate:modelValue": n[2] ||= (e) => _("margin", e)
1528
- }, null, 8, ["label", "model-value"])])], 512), [[Ye, s.has("spacing")]])], 2),
1529
- M("div", hi, [M("button", {
1530
- type: "button",
1531
- 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)]",
1532
- onClick: n[3] ||= (e) => c("bg")
1533
- }, [P(U(xe), {
1534
- class: L(["tpl:transition-transform tpl:duration-200", s.has("bg") ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1535
- size: 12,
1536
- "stroke-width": 2
1537
- }, null, 8, ["class"]), M("span", null, H(U(i).blockSettings.background), 1)]), G(M("div", gi, [M("label", { class: L(U(T)) }, H(U(i).blockSettings.color), 3), P(Y, {
1538
- size: "large",
1539
- "model-value": e.block.styles.backgroundColor || U("#ffffff"),
1540
- "onUpdate:modelValue": n[4] ||= (e) => _("backgroundColor", e)
1541
- }, null, 8, ["model-value"])], 512), [[Ye, s.has("bg")]])]),
1542
- M("div", _i, [M("button", {
1543
- type: "button",
1544
- 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)]",
1545
- onClick: n[5] ||= (e) => c("display")
1546
- }, [P(U(xe), {
1547
- class: L(["tpl:transition-transform tpl:duration-200", s.has("display") ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1548
- size: 12,
1549
- "stroke-width": 2
1550
- }, null, 8, ["class"]), M("span", null, H(U(i).blockSettings.display), 1)]), G(M("div", vi, [
1551
- M("label", yi, [
1552
- M("input", {
1553
- type: "checkbox",
1554
- class: "tpl:accent-[var(--tpl-primary)]",
1555
- checked: e.block.visibility?.desktop !== !1,
1556
- onChange: n[6] ||= (t) => r("update", { visibility: {
1557
- desktop: e.block.visibility?.desktop === !1,
1558
- tablet: e.block.visibility?.tablet !== !1,
1559
- mobile: e.block.visibility?.mobile !== !1
1560
- } })
1561
- }, null, 40, bi),
1562
- P(U(dt), {
1563
- size: 14,
1564
- "stroke-width": 1.5
1565
- }),
1566
- N(" " + H(U(i).blockSettings.showOnDesktop), 1)
1567
- ]),
1568
- M("label", xi, [
1569
- M("input", {
1570
- type: "checkbox",
1571
- class: "tpl:accent-[var(--tpl-primary)]",
1572
- checked: e.block.visibility?.tablet !== !1,
1573
- onChange: n[7] ||= (t) => r("update", { visibility: {
1574
- desktop: e.block.visibility?.desktop !== !1,
1575
- tablet: e.block.visibility?.tablet === !1,
1576
- mobile: e.block.visibility?.mobile !== !1
1577
- } })
1578
- }, null, 40, Si),
1579
- P(U(bt), {
1580
- size: 14,
1581
- "stroke-width": 1.5
1582
- }),
1583
- N(" " + H(U(i).blockSettings.showOnTablet), 1)
1584
- ]),
1585
- M("label", Ci, [
1586
- M("input", {
1587
- type: "checkbox",
1588
- class: "tpl:accent-[var(--tpl-primary)]",
1589
- checked: e.block.visibility?.mobile !== !1,
1590
- onChange: n[8] ||= (t) => r("update", { visibility: {
1591
- desktop: e.block.visibility?.desktop !== !1,
1592
- tablet: e.block.visibility?.tablet !== !1,
1593
- mobile: e.block.visibility?.mobile === !1
1594
- } })
1595
- }, null, 40, wi),
1596
- P(U(gt), {
1597
- size: 14,
1598
- "stroke-width": 1.5
1599
- }),
1600
- N(" " + H(U(i).blockSettings.showOnMobile), 1)
1601
- ])
1602
- ], 512), [[Ye, s.has("display")]])]),
1603
- M("div", Ti, [M("button", {
1604
- type: "button",
1605
- 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)]",
1606
- onClick: n[9] ||= (e) => c("css")
1607
- }, [P(U(xe), {
1608
- class: L(["tpl:transition-transform tpl:duration-200", s.has("css") ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1609
- size: 12,
1610
- "stroke-width": 2
1611
- }, null, 8, ["class"]), M("span", null, H(U(i).blockSettings.customCss), 1)]), G(M("div", Ei, [M("label", { class: L(U(T)) }, H(U(i).blockSettings.css), 3), M("textarea", {
1612
- value: e.block.customCss || "",
1613
- placeholder: U(i).blockSettings.cssPlaceholder,
1614
- rows: "3",
1615
- class: "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:outline-none tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]",
1616
- onInput: n[10] ||= (e) => r("update", { customCss: e.target.value })
1617
- }, null, 40, Di)], 512), [[Ye, s.has("css")]])]),
1618
- l.value ? (z(), j("div", Oi, [M("button", {
1619
- type: "button",
1620
- 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)]",
1621
- onClick: n[11] ||= (e) => c("condition")
1622
- }, [P(U(xe), {
1623
- class: L(["tpl:transition-transform tpl:duration-200", s.has("condition") ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1624
- size: 12,
1625
- "stroke-width": 2
1626
- }, null, 8, ["class"]), M("span", null, H(U(i).blockSettings.displayCondition), 1)]), G(M("div", ki, [M("select", {
1627
- class: L(["tpl:w-full tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:outline-none tpl:transition-all tpl:duration-150 tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]", e.block.displayCondition ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-text)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"]),
1628
- value: u.value || p.value ? "__custom__" : e.block.displayCondition?.label ?? "",
1629
- onChange: n[12] ||= (e) => {
1630
- let t = e.target.value;
1631
- if (t === "__custom__") {
1632
- m();
1633
- return;
1634
- }
1635
- if (u.value = !1, !t) {
1636
- r("update", { displayCondition: void 0 });
1637
- return;
1638
- }
1639
- let n = U(a).find((e) => e.label === t);
1640
- n && r("update", { displayCondition: n });
1641
- }
1642
- }, [
1643
- M("option", ji, H(U(i).blockSettings.noCondition), 1),
1644
- (z(!0), j(D, null, V(g.value, (e, t) => (z(), j(D, { key: t }, [t ? (z(), j("optgroup", {
1645
- key: 0,
1646
- label: String(t)
1647
- }, [(z(!0), j(D, null, V(e, (e) => (z(), j("option", {
1648
- key: e.label,
1649
- value: e.label
1650
- }, H(e.label), 9, Ni))), 128))], 8, Mi)) : (z(!0), j(D, { key: 1 }, V(e, (e) => (z(), j("option", {
1651
- key: e.label,
1652
- value: e.label
1653
- }, H(e.label), 9, Pi))), 128))], 64))), 128)),
1654
- U(o) ? (z(), j("option", Fi, H(U(i).blockSettings.customCondition), 1)) : A("", !0)
1655
- ], 42, Ai), u.value || p.value ? (z(), j("div", Ii, [
1656
- M("div", null, [M("label", Li, H(U(i).blockSettings.customConditionBefore), 1), G(M("textarea", {
1657
- "onUpdate:modelValue": n[13] ||= (e) => d.value = e,
1658
- rows: "2",
1659
- class: "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-150 tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]"
1660
- }, null, 512), [[Je, d.value]])]),
1661
- M("div", null, [M("label", Ri, H(U(i).blockSettings.customConditionAfter), 1), G(M("textarea", {
1662
- "onUpdate:modelValue": n[14] ||= (e) => f.value = e,
1663
- rows: "2",
1664
- class: "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-150 tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]"
1665
- }, null, 512), [[Je, f.value]])]),
1666
- M("div", zi, [M("button", {
1667
- type: "button",
1668
- 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",
1669
- disabled: !d.value.trim(),
1670
- onClick: h
1671
- }, H(U(i).blockSettings.applyCondition), 9, Bi)])
1672
- ])) : e.block.displayCondition && !p.value ? (z(), j(D, { key: 1 }, [e.block.displayCondition.description ? (z(), j("p", Vi, H(e.block.displayCondition.description), 1)) : A("", !0), M("div", Hi, [M("pre", Ui, H(e.block.displayCondition.before), 1), e.block.displayCondition.after ? (z(), j("pre", Wi, H(e.block.displayCondition.after), 1)) : A("", !0)])], 64)) : A("", !0)], 512), [[Ye, s.has("condition")]])])) : A("", !0)
1673
- ], 2));
1674
- }
1675
- }), Ki = [
1676
- "aria-checked",
1677
- "aria-label",
1678
- "title",
1679
- "onClick"
1680
- ], qi = { key: 1 }, Q = /* @__PURE__ */ F({
1681
- __name: "SlidingPillSelect",
1682
- props: {
1683
- options: {},
1684
- modelValue: {}
1685
- },
1686
- emits: ["update:modelValue"],
1687
- setup(e, { emit: t }) {
1688
- let n = e, r = t, i = O(() => {
1689
- let e = n.options.findIndex((e) => e.value === n.modelValue);
1690
- return `translateX(${Math.max(e, 0) * 100}%)`;
1691
- });
1692
- return (t, n) => (z(), j("div", {
1693
- role: "radiogroup",
1694
- class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
1695
- style: R({
1696
- gridTemplateColumns: `repeat(${e.options.length}, 1fr)`,
1697
- backgroundColor: "var(--tpl-bg-hover)"
1698
- })
1699
- }, [M("div", {
1700
- class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
1701
- style: R({
1702
- left: "4px",
1703
- width: `calc((100% - 8px) / ${e.options.length})`,
1704
- transform: i.value,
1705
- backgroundColor: "var(--tpl-bg)",
1706
- boxShadow: "var(--tpl-shadow)",
1707
- transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
1708
- })
1709
- }, null, 4), (z(!0), j(D, null, V(e.options, (t) => (z(), j("button", {
1710
- key: t.value,
1711
- role: "radio",
1712
- "aria-checked": e.modelValue === t.value,
1713
- "aria-label": t.label,
1714
- class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:py-[5px] tpl:text-xs tpl:font-medium",
1715
- style: R({
1716
- color: e.modelValue === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
1717
- transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
1718
- }),
1719
- title: t.label,
1720
- onClick: (e) => r("update:modelValue", t.value)
1721
- }, [t.icon ? (z(), k(qe(t.icon), {
1722
- key: 0,
1723
- size: 14,
1724
- "stroke-width": 2
1725
- })) : (z(), j("span", qi, H(t.label), 1))], 12, Ki))), 128))], 4));
1726
- }
1727
- }), Ji = { class: "tpl:mb-3.5" }, Yi = ["value"], Xi = { class: "tpl:mb-3.5" }, Zi = ["value"], Qi = { class: "tpl:mb-3.5" }, $i = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-2" }, ea = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, ta = ["checked"], na = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, ra = ["checked"], ia = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, aa = ["checked"], oa = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, sa = ["checked"], ca = { class: "tpl:mb-3.5" }, la = { class: "tpl:mb-3.5" }, ua = ["value"], da = { value: "" }, fa = ["value"], pa = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, ma = { class: "tpl:mb-3.5" }, ha = { class: "tpl:flex tpl:items-stretch" }, ga = ["value"], _a = { class: "tpl:mb-3.5" }, va = { class: "tpl:flex tpl:items-stretch" }, ya = ["value"], ba = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, xa = { class: "tpl:mb-3.5" }, Sa = { class: "tpl:mb-3.5" }, Ca = { class: "tpl:mb-3.5" }, wa = { class: "tpl:mb-3.5" }, Ta = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-2" }, Ea = ["value", "placeholder"], Da = ["value", "placeholder"], Oa = ["value", "placeholder"], ka = ["value", "placeholder"], Aa = { class: "tpl:mb-3.5" }, ja = ["value", "placeholder"], Ma = { class: "tpl:mb-3.5" }, Na = ["value"], Pa = { class: "tpl:mb-3.5 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, Fa = ["checked"], Ia = /* @__PURE__ */ F({
1728
- __name: "CountdownToolbar",
1729
- props: {
1730
- block: {},
1731
- fontFamilies: {}
1732
- },
1733
- emits: ["update"],
1734
- setup(e, { emit: t }) {
1735
- let n = t, { t: r } = y();
1736
- function i(e, t) {
1737
- n("update", { [e]: t });
1738
- }
1739
- return (t, n) => (z(), j(D, null, [
1740
- M("div", Ji, [M("label", { class: L(U(T)) }, H(U(r).countdown.targetDate), 3), M("input", {
1741
- type: "datetime-local",
1742
- class: L(U(C)),
1743
- value: e.block.targetDate,
1744
- onInput: n[0] ||= (e) => i("targetDate", e.target.value)
1745
- }, null, 42, Yi)]),
1746
- M("div", Xi, [M("label", { class: L(U(T)) }, H(U(r).countdown.timezone), 3), M("select", {
1747
- class: L(U(C)),
1748
- value: e.block.timezone,
1749
- onChange: n[1] ||= (e) => i("timezone", e.target.value)
1750
- }, [...n[20] ||= [Ue("<option value=\"UTC\">UTC</option><option value=\"America/New_York\">America/New_York</option><option value=\"America/Chicago\">America/Chicago</option><option value=\"America/Denver\">America/Denver</option><option value=\"America/Los_Angeles\">America/Los_Angeles</option><option value=\"Europe/London\">Europe/London</option><option value=\"Europe/Berlin\">Europe/Berlin</option><option value=\"Europe/Paris\">Europe/Paris</option><option value=\"Europe/Moscow\">Europe/Moscow</option><option value=\"Asia/Dubai\">Asia/Dubai</option><option value=\"Asia/Kolkata\">Asia/Kolkata</option><option value=\"Asia/Shanghai\">Asia/Shanghai</option><option value=\"Asia/Tokyo\">Asia/Tokyo</option><option value=\"Australia/Sydney\">Australia/Sydney</option><option value=\"Pacific/Auckland\">Pacific/Auckland</option>", 15)]], 42, Zi)]),
1751
- M("div", Qi, [M("label", { class: L(U(T)) }, H(U(r).countdown.display), 3), M("div", $i, [
1752
- M("label", ea, [M("input", {
1753
- type: "checkbox",
1754
- class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1755
- checked: e.block.showDays,
1756
- onChange: n[2] ||= (e) => i("showDays", e.target.checked)
1757
- }, null, 40, ta), N(" " + H(U(r).countdown.days), 1)]),
1758
- M("label", na, [M("input", {
1759
- type: "checkbox",
1760
- class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1761
- checked: e.block.showHours,
1762
- onChange: n[3] ||= (e) => i("showHours", e.target.checked)
1763
- }, null, 40, ra), N(" " + H(U(r).countdown.hours), 1)]),
1764
- M("label", ia, [M("input", {
1765
- type: "checkbox",
1766
- class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1767
- checked: e.block.showMinutes,
1768
- onChange: n[4] ||= (e) => i("showMinutes", e.target.checked)
1769
- }, null, 40, aa), N(" " + H(U(r).countdown.minutes), 1)]),
1770
- M("label", oa, [M("input", {
1771
- type: "checkbox",
1772
- class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1773
- checked: e.block.showSeconds,
1774
- onChange: n[5] ||= (e) => i("showSeconds", e.target.checked)
1775
- }, null, 40, sa), N(" " + H(U(r).countdown.seconds), 1)])
1776
- ])]),
1777
- M("div", ca, [M("label", { class: L(U(T)) }, H(U(r).countdown.separator), 3), P(Q, {
1778
- options: [
1779
- {
1780
- value: ":",
1781
- label: ":"
1782
- },
1783
- {
1784
- value: "-",
1785
- label: "-"
1786
- },
1787
- {
1788
- value: " ",
1789
- label: "␣"
1790
- }
1791
- ],
1792
- "model-value": e.block.separator,
1793
- "onUpdate:modelValue": n[6] ||= (e) => i("separator", e)
1794
- }, null, 8, ["model-value"])]),
1795
- M("div", la, [M("label", { class: L(U(T)) }, H(U(r).countdown.fontFamily), 3), M("select", {
1796
- class: L(U(C)),
1797
- value: e.block.fontFamily || "",
1798
- onChange: n[7] ||= (e) => i("fontFamily", e.target.value || void 0)
1799
- }, [M("option", da, H(U(r).countdown.inheritFont), 1), (z(!0), j(D, null, V(e.fontFamilies, (e) => (z(), j("option", {
1800
- key: e.value,
1801
- value: e.value
1802
- }, H(e.label), 9, fa))), 128))], 42, ua)]),
1803
- M("div", pa, [M("div", ma, [M("label", { class: L(U(T)) }, H(U(r).countdown.digitFontSize), 3), M("div", ha, [M("input", {
1804
- type: "number",
1805
- class: L(U(w)),
1806
- value: e.block.digitFontSize,
1807
- min: "12",
1808
- max: "72",
1809
- onInput: n[8] ||= (e) => i("digitFontSize", Number(e.target.value))
1810
- }, null, 42, ga), M("span", { class: L(U(E)) }, "px", 2)])]), M("div", _a, [M("label", { class: L(U(T)) }, H(U(r).countdown.labelFontSize), 3), M("div", va, [M("input", {
1811
- type: "number",
1812
- class: L(U(w)),
1813
- value: e.block.labelFontSize,
1814
- min: "8",
1815
- max: "24",
1816
- onInput: n[9] ||= (e) => i("labelFontSize", Number(e.target.value))
1817
- }, null, 42, ya), M("span", { class: L(U(E)) }, "px", 2)])])]),
1818
- M("div", ba, [M("div", xa, [M("label", { class: L(U(T)) }, H(U(r).countdown.digitColor), 3), P(Y, {
1819
- "model-value": e.block.digitColor,
1820
- "onUpdate:modelValue": n[10] ||= (e) => i("digitColor", e)
1821
- }, null, 8, ["model-value"])]), M("div", Sa, [M("label", { class: L(U(T)) }, H(U(r).countdown.labelColor), 3), P(Y, {
1822
- "model-value": e.block.labelColor,
1823
- "onUpdate:modelValue": n[11] ||= (e) => i("labelColor", e)
1824
- }, null, 8, ["model-value"])])]),
1825
- M("div", Ca, [M("label", { class: L(U(T)) }, H(U(r).countdown.background), 3), P(Y, {
1826
- "model-value": e.block.backgroundColor,
1827
- "onUpdate:modelValue": n[12] ||= (e) => i("backgroundColor", e)
1828
- }, null, 8, ["model-value"])]),
1829
- M("div", wa, [M("label", { class: L(U(T)) }, H(U(r).countdown.labels), 3), M("div", Ta, [
1830
- M("input", {
1831
- type: "text",
1832
- class: L(U(C)),
1833
- value: e.block.labelDays,
1834
- placeholder: U(r).countdown.days,
1835
- onInput: n[13] ||= (e) => i("labelDays", e.target.value)
1836
- }, null, 42, Ea),
1837
- M("input", {
1838
- type: "text",
1839
- class: L(U(C)),
1840
- value: e.block.labelHours,
1841
- placeholder: U(r).countdown.hours,
1842
- onInput: n[14] ||= (e) => i("labelHours", e.target.value)
1843
- }, null, 42, Da),
1844
- M("input", {
1845
- type: "text",
1846
- class: L(U(C)),
1847
- value: e.block.labelMinutes,
1848
- placeholder: U(r).countdown.minutes,
1849
- onInput: n[15] ||= (e) => i("labelMinutes", e.target.value)
1850
- }, null, 42, Oa),
1851
- M("input", {
1852
- type: "text",
1853
- class: L(U(C)),
1854
- value: e.block.labelSeconds,
1855
- placeholder: U(r).countdown.seconds,
1856
- onInput: n[16] ||= (e) => i("labelSeconds", e.target.value)
1857
- }, null, 42, ka)
1858
- ])]),
1859
- M("div", Aa, [M("label", { class: L(U(T)) }, H(U(r).countdown.expiry), 3), M("input", {
1860
- type: "text",
1861
- class: L(U(C)),
1862
- value: e.block.expiredMessage,
1863
- placeholder: U(r).countdown.expiredMessagePlaceholder,
1864
- onInput: n[17] ||= (e) => i("expiredMessage", e.target.value)
1865
- }, null, 42, ja)]),
1866
- M("div", Ma, [M("label", { class: L(U(T)) }, H(U(r).countdown.expiredImageUrl), 3), M("input", {
1867
- type: "url",
1868
- class: L(U(C)),
1869
- value: e.block.expiredImageUrl,
1870
- placeholder: "https://...",
1871
- onInput: n[18] ||= (e) => i("expiredImageUrl", e.target.value)
1872
- }, null, 42, Na)]),
1873
- M("label", Pa, [M("input", {
1874
- type: "checkbox",
1875
- class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1876
- checked: e.block.hideOnExpiry,
1877
- onChange: n[19] ||= (e) => i("hideOnExpiry", e.target.checked)
1878
- }, null, 40, Fa), N(" " + H(U(r).countdown.hideOnExpiry), 1)])
1879
- ], 64));
1880
- }
1881
- }), La = ["title"], Ra = { class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, za = {
1882
- key: 1,
1883
- class: "tpl:text-[var(--tpl-danger)]"
1884
- }, Ba = [
1885
- "aria-checked",
1886
- "aria-label",
1887
- "disabled"
1888
- ], Va = /* @__PURE__ */ F({
1889
- __name: "BooleanField",
1890
- props: {
1891
- field: {},
1892
- modelValue: { type: Boolean },
1893
- readOnly: { type: Boolean }
1894
- },
1895
- emits: ["update:modelValue"],
1896
- setup(e, { emit: t }) {
1897
- let n = t, { t: r } = y();
1898
- return (t, i) => (z(), j("div", {
1899
- class: "tpl:mb-3.5",
1900
- title: e.readOnly ? U(r).customBlocks.dataSource.readOnlyTooltip : void 0
1901
- }, [M("label", { class: L(["tpl:flex tpl:items-center tpl:justify-between tpl:gap-2", e.readOnly ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer"]) }, [M("span", Ra, [
1902
- N(H(e.field.label) + " ", 1),
1903
- e.readOnly ? (z(), k(U(ut), {
1904
- key: 0,
1905
- size: 12,
1906
- class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
1907
- })) : A("", !0),
1908
- e.field.required ? (z(), j("span", za, " * ")) : A("", !0)
1909
- ]), M("button", {
1910
- type: "button",
1911
- role: "switch",
1912
- "aria-checked": e.modelValue,
1913
- "aria-label": e.field.label,
1914
- class: L([
1915
- "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",
1916
- e.modelValue ? "tpl:bg-[var(--tpl-primary)]" : "tpl:bg-[var(--tpl-border)]",
1917
- e.readOnly ? "tpl:opacity-60 tpl:cursor-not-allowed" : "tpl:cursor-pointer"
1918
- ]),
1919
- disabled: e.readOnly,
1920
- onClick: i[0] ||= (t) => !e.readOnly && n("update:modelValue", !e.modelValue)
1921
- }, [M("span", { class: L(["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, Ba)], 2)], 8, La));
1922
- }
1923
- }), Ha = { class: "tpl:mb-3.5" }, Ua = {
1924
- key: 1,
1925
- class: "tpl:text-[var(--tpl-danger)]"
1926
- }, $ = /* @__PURE__ */ F({
1927
- __name: "FieldWrapper",
1928
- props: {
1929
- label: {},
1930
- required: { type: Boolean },
1931
- readOnly: { type: Boolean }
1932
- },
1933
- setup(e) {
1934
- return (t, n) => (z(), j("div", Ha, [M("label", { class: L(U(T)) }, [
1935
- N(H(e.label) + " ", 1),
1936
- e.readOnly ? (z(), k(U(ut), {
1937
- key: 0,
1938
- size: 12,
1939
- class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
1940
- })) : A("", !0),
1941
- e.required ? (z(), j("span", Ua, "*")) : A("", !0)
1942
- ], 2), Ke(t.$slots, "default")]));
1943
- }
1944
- }), Wa = /* @__PURE__ */ F({
1945
- __name: "ColorField",
1946
- props: {
1947
- field: {},
1948
- modelValue: {},
1949
- readOnly: { type: Boolean }
1950
- },
1951
- emits: ["update:modelValue"],
1952
- setup(e, { emit: t }) {
1953
- let n = t, { t: r } = y();
1954
- return (t, i) => (z(), k($, {
1955
- label: e.field.label,
1956
- required: e.field.required,
1957
- "read-only": e.readOnly
1958
- }, {
1959
- default: W(() => [P(Y, {
1960
- "model-value": e.modelValue || U("#000000"),
1961
- placeholder: e.field.placeholder || U("#000000"),
1962
- disabled: e.readOnly,
1963
- title: e.readOnly ? U(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1964
- "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
1965
- }, null, 8, [
1966
- "model-value",
1967
- "placeholder",
1968
- "disabled",
1969
- "title"
1970
- ])]),
1971
- _: 1
1972
- }, 8, [
1973
- "label",
1974
- "required",
1975
- "read-only"
1976
- ]));
1977
- }
1978
- }), Ga = [
1979
- "value",
1980
- "placeholder",
1981
- "title"
1982
- ], Ka = ["value", "placeholder"], qa = /* @__PURE__ */ F({
1983
- __name: "ImageField",
1984
- props: {
1985
- field: {},
1986
- modelValue: {},
1987
- readOnly: { type: Boolean }
1988
- },
1989
- emits: ["update:modelValue"],
1990
- setup(e, { emit: t }) {
1991
- let n = t, { t: r } = y(), i = I(be, null), a = O(() => !!i);
1992
- async function o() {
1993
- let e = await i?.({ accept: ["images"] });
1994
- e && n("update:modelValue", e.url);
1995
- }
1996
- return (t, i) => (z(), k($, {
1997
- label: e.field.label,
1998
- required: e.field.required,
1999
- "read-only": e.readOnly
2000
- }, {
2001
- default: W(() => [e.readOnly ? (z(), j("input", {
2002
- key: 0,
2003
- type: "url",
2004
- class: L([U(C), "tpl:opacity-60 tpl:cursor-not-allowed"]),
2005
- value: e.modelValue,
2006
- placeholder: e.field.placeholder || "https://...",
2007
- disabled: "",
2008
- title: U(r).customBlocks.dataSource.readOnlyTooltip
2009
- }, null, 10, Ga)) : (z(), j("input", {
2010
- key: 1,
2011
- type: "url",
2012
- class: L(U(C)),
2013
- value: e.modelValue,
2014
- placeholder: e.field.placeholder || "https://...",
2015
- onInput: i[0] ||= (e) => n("update:modelValue", e.target.value)
2016
- }, null, 42, Ka)), a.value && !e.readOnly ? (z(), j("button", {
2017
- key: 2,
2018
- 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)]",
2019
- onClick: i[1] ||= (e) => o()
2020
- }, [P(U(h), {
2021
- size: 14,
2022
- "stroke-width": 1.5
2023
- }), N(" " + H(U(r).image.browseMedia), 1)])) : A("", !0)]),
2024
- _: 1
2025
- }, 8, [
2026
- "label",
2027
- "required",
2028
- "read-only"
2029
- ]));
2030
- }
2031
- }), Ja = [
2032
- "value",
2033
- "placeholder",
2034
- "min",
2035
- "max",
2036
- "step",
2037
- "disabled",
2038
- "title"
2039
- ], Ya = /* @__PURE__ */ F({
2040
- __name: "NumberField",
2041
- props: {
2042
- field: {},
2043
- modelValue: {},
2044
- readOnly: { type: Boolean }
2045
- },
2046
- emits: ["update:modelValue"],
2047
- setup(e, { emit: t }) {
2048
- let n = t, { t: r } = y();
2049
- return (t, i) => (z(), k($, {
2050
- label: e.field.label,
2051
- required: e.field.required,
2052
- "read-only": e.readOnly
2053
- }, {
2054
- default: W(() => [M("input", {
2055
- type: "number",
2056
- class: L([U(C), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
2057
- value: e.modelValue,
2058
- placeholder: e.field.placeholder,
2059
- min: e.field.min,
2060
- max: e.field.max,
2061
- step: e.field.step,
2062
- disabled: e.readOnly,
2063
- title: e.readOnly ? U(r).customBlocks.dataSource.readOnlyTooltip : void 0,
2064
- onInput: i[0] ||= (t) => !e.readOnly && n("update:modelValue", Number(t.target.value))
2065
- }, null, 42, Ja)]),
2066
- _: 1
2067
- }, 8, [
2068
- "label",
2069
- "required",
2070
- "read-only"
2071
- ]));
2072
- }
2073
- }), Xa = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Za = { class: "tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between" }, Qa = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]" }, $a = ["title", "onClick"], eo = {
2074
- key: 1,
2075
- class: "tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
2076
- }, to = /* @__PURE__ */ F({
2077
- __name: "RepeatableField",
2078
- props: {
2079
- field: {},
2080
- modelValue: {},
2081
- readOnly: { type: Boolean }
2082
- },
2083
- emits: ["update:modelValue"],
2084
- setup(e, { emit: t }) {
2085
- let n = e, r = t, { t: i } = y(), a = O(() => n.modelValue || []), o = O(() => !n.field.maxItems || a.value.length < n.field.maxItems), s = O(() => !n.field.minItems || a.value.length > n.field.minItems);
2086
- function c() {
2087
- if (!o.value || n.readOnly) return;
2088
- let e = {};
2089
- for (let t of n.field.fields) e[t.key] = t.default ?? "";
2090
- r("update:modelValue", [...a.value, e]);
2091
- }
2092
- function l(e) {
2093
- if (!s.value || n.readOnly) return;
2094
- let t = [...a.value];
2095
- t.splice(e, 1), r("update:modelValue", t);
2096
- }
2097
- function u(e, t, n) {
2098
- r("update:modelValue", a.value.map((r, i) => i === e ? {
2099
- ...r,
2100
- [t]: n
2101
- } : r));
2102
- }
2103
- return (t, n) => (z(), k($, {
2104
- label: e.field.label,
2105
- required: e.field.required,
2106
- "read-only": e.readOnly
2107
- }, {
2108
- default: W(() => [M("div", Xa, [
2109
- (z(!0), j(D, null, V(a.value, (t, n) => (z(), j("div", {
2110
- key: `${e.field.key}-${n}`,
2111
- class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3"
2112
- }, [M("div", Za, [M("span", Qa, " #" + H(n + 1), 1), s.value && !e.readOnly ? (z(), j("button", {
2113
- key: 0,
2114
- type: "button",
2115
- 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)]",
2116
- title: U(i).customBlocks.fields.removeItem,
2117
- onClick: (e) => l(n)
2118
- }, [P(U(Re), {
2119
- size: 12,
2120
- "stroke-width": 2
2121
- })], 8, $a)) : A("", !0)]), (z(!0), j(D, null, V(e.field.fields, (r) => (z(), k(qe(U(uo)(r.type)), {
2122
- key: r.key,
2123
- field: r,
2124
- "model-value": t[r.key],
2125
- "read-only": e.readOnly,
2126
- "onUpdate:modelValue": (e) => u(n, r.key, e)
2127
- }, null, 8, [
2128
- "field",
2129
- "model-value",
2130
- "read-only",
2131
- "onUpdate:modelValue"
2132
- ]))), 128))]))), 128)),
2133
- o.value && !e.readOnly ? (z(), j("button", {
2134
- key: 0,
2135
- type: "button",
2136
- class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 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)]",
2137
- onClick: c
2138
- }, [P(U(q), {
2139
- size: 14,
2140
- "stroke-width": 2
2141
- }), N(" " + H(U(i).customBlocks.fields.addItem), 1)])) : A("", !0),
2142
- !o.value && !e.readOnly ? (z(), j("p", eo, H(U(i).customBlocks.fields.maxItemsReached), 1)) : A("", !0)
2143
- ])]),
2144
- _: 1
2145
- }, 8, [
2146
- "label",
2147
- "required",
2148
- "read-only"
2149
- ]));
2150
- }
2151
- }), no = [
2152
- "value",
2153
- "disabled",
2154
- "title"
2155
- ], ro = ["value"], io = /* @__PURE__ */ F({
2156
- __name: "SelectField",
2157
- props: {
2158
- field: {},
2159
- modelValue: {},
2160
- readOnly: { type: Boolean }
2161
- },
2162
- emits: ["update:modelValue"],
2163
- setup(e, { emit: t }) {
2164
- let n = t, { t: r } = y();
2165
- return (t, i) => (z(), k($, {
2166
- label: e.field.label,
2167
- required: e.field.required,
2168
- "read-only": e.readOnly
2169
- }, {
2170
- default: W(() => [M("select", {
2171
- class: L([U(C), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
2172
- value: e.modelValue,
2173
- disabled: e.readOnly,
2174
- title: e.readOnly ? U(r).customBlocks.dataSource.readOnlyTooltip : void 0,
2175
- onChange: i[0] ||= (t) => !e.readOnly && n("update:modelValue", t.target.value)
2176
- }, [(z(!0), j(D, null, V(e.field.options, (e) => (z(), j("option", {
2177
- key: e.value,
2178
- value: e.value
2179
- }, H(e.label), 9, ro))), 128))], 42, no)]),
2180
- _: 1
2181
- }, 8, [
2182
- "label",
2183
- "required",
2184
- "read-only"
2185
- ]));
2186
- }
2187
- }), ao = [
2188
- "value",
2189
- "placeholder",
2190
- "title"
2191
- ], oo = /* @__PURE__ */ F({
2192
- __name: "TextField",
2193
- props: {
2194
- field: {},
2195
- modelValue: {},
2196
- readOnly: { type: Boolean }
2197
- },
2198
- emits: ["update:modelValue"],
2199
- setup(e, { emit: t }) {
2200
- let n = t, { t: r } = y();
2201
- return (t, i) => (z(), k($, {
2202
- label: e.field.label,
2203
- required: e.field.required,
2204
- "read-only": e.readOnly
2205
- }, {
2206
- default: W(() => [e.readOnly ? (z(), j("input", {
2207
- key: 0,
2208
- type: "text",
2209
- class: L([U(C), "tpl:opacity-60 tpl:cursor-not-allowed"]),
2210
- value: e.modelValue,
2211
- placeholder: e.field.placeholder,
2212
- disabled: "",
2213
- title: U(r).customBlocks.dataSource.readOnlyTooltip
2214
- }, null, 10, ao)) : (z(), k(X, {
2215
- key: 1,
2216
- "model-value": e.modelValue,
2217
- placeholder: e.field.placeholder,
2218
- "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
2219
- }, null, 8, ["model-value", "placeholder"]))]),
2220
- _: 1
2221
- }, 8, [
2222
- "label",
2223
- "required",
2224
- "read-only"
2225
- ]));
2226
- }
2227
- }), so = [
2228
- "value",
2229
- "placeholder",
2230
- "title"
2231
- ], co = "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", lo = {
2232
- text: oo,
2233
- textarea: /* @__PURE__ */ F({
2234
- __name: "TextareaField",
2235
- props: {
2236
- field: {},
2237
- modelValue: {},
2238
- readOnly: { type: Boolean }
2239
- },
2240
- emits: ["update:modelValue"],
2241
- setup(e, { emit: t }) {
2242
- let n = t, { t: r } = y();
2243
- return (t, i) => (z(), k($, {
2244
- label: e.field.label,
2245
- required: e.field.required,
2246
- "read-only": e.readOnly
2247
- }, {
2248
- default: W(() => [e.readOnly ? (z(), j("textarea", {
2249
- key: 0,
2250
- value: e.modelValue,
2251
- placeholder: e.field.placeholder,
2252
- rows: "3",
2253
- disabled: "",
2254
- title: U(r).customBlocks.dataSource.readOnlyTooltip,
2255
- class: L(co)
2256
- }, null, 8, so)) : (z(), k(Hn, {
2257
- key: 1,
2258
- "model-value": e.modelValue,
2259
- placeholder: e.field.placeholder,
2260
- "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
2261
- }, null, 8, ["model-value", "placeholder"]))]),
2262
- _: 1
2263
- }, 8, [
2264
- "label",
2265
- "required",
2266
- "read-only"
2267
- ]));
2268
- }
2269
- }),
2270
- image: qa,
2271
- color: Wa,
2272
- number: Ya,
2273
- select: io,
2274
- boolean: Va,
2275
- repeatable: to
2276
- };
2277
- function uo(e) {
2278
- return lo[e] ?? oo;
2279
- }
2280
- //#endregion
2281
- //#region src/components/toolbar/CustomBlockToolbar.vue?vue&type=script&setup=true&lang.ts
2282
- var fo = {
2283
- key: 0,
2284
- class: "tpl:p-4"
2285
- }, po = { class: "tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, mo = { key: 1 }, ho = {
2286
- key: 0,
2287
- class: "tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
2288
- }, go = {
2289
- key: 1,
2290
- class: "tpl:mb-4"
2291
- }, _o = {
2292
- key: 1,
2293
- class: "tpl:flex tpl:h-[32px] tpl:items-center"
2294
- }, vo = {
2295
- key: 0,
2296
- class: "tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
2297
- }, yo = {
2298
- key: 2,
2299
- class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]"
2300
- }, bo = /* @__PURE__ */ F({
2301
- __name: "CustomBlockToolbar",
2302
- props: { block: {} },
2303
- emits: ["updateFieldValues", "updateDataSourceFetched"],
2304
- setup(e, { emit: t }) {
2305
- let n = e, r = t, { t: i } = y(), a = I(v, []), o = O(() => a.find((e) => e.type === n.block.customType)), { isFetching: s, fetchError: c, fetch: l, hasDataSource: u, needsFetch: d } = Qe({
2306
- definition: o,
2307
- block: O(() => n.block),
2308
- onUpdate: (e, t) => {
2309
- r("updateFieldValues", e), r("updateDataSourceFetched", t);
2310
- }
2311
- });
2312
- function f(e) {
2313
- return e.readOnly === !0 && u.value && !!n.block.dataSourceFetched;
2314
- }
2315
- function p(e, t) {
2316
- r("updateFieldValues", {
2317
- ...n.block.fieldValues,
2318
- [e]: t
2319
- });
2320
- }
2321
- return (t, n) => o.value ? (z(), j("div", mo, [
2322
- o.value.description ? (z(), j("p", ho, H(o.value.description), 1)) : A("", !0),
2323
- U(u) ? (z(), j("div", go, [U(d) && !U(s) ? (z(), j("button", {
2324
- key: 0,
2325
- type: "button",
2326
- 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)]",
2327
- onClick: n[0] ||= (...e) => U(l) && U(l)(...e)
2328
- }, H(o.value?.dataSource?.label || U(i).customBlocks.dataSource.fetchButton), 1)) : (z(), j("div", _o, [U(s) ? (z(), j("div", vo, H(U(i).customBlocks.dataSource.fetching), 1)) : (z(), j("button", {
2329
- key: 1,
2330
- type: "button",
2331
- 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)]",
2332
- onClick: n[1] ||= (...e) => U(l) && U(l)(...e)
2333
- }, [P(U(De), { size: 12 }), N(" " + H(U(i).customBlocks.dataSource.changeButton), 1)]))])), U(c) ? (z(), j("p", yo, [P(U(Se), {
2334
- size: 14,
2335
- class: "tpl:shrink-0"
2336
- }), N(" " + H(U(i).customBlocks.dataSource.fetchError), 1)])) : A("", !0)])) : A("", !0),
2337
- (z(!0), j(D, null, V(o.value.fields, (t) => (z(), k(qe(U(uo)(t.type)), {
2338
- key: t.key,
2339
- field: t,
2340
- "model-value": e.block.fieldValues[t.key],
2341
- "read-only": f(t),
2342
- "onUpdate:modelValue": (e) => p(t.key, e)
2343
- }, null, 8, [
2344
- "field",
2345
- "model-value",
2346
- "read-only",
2347
- "onUpdate:modelValue"
2348
- ]))), 128))
2349
- ])) : (z(), j("div", fo, [M("p", po, H(U(i).customBlocks.toolbar.noDefinition), 1)]));
2350
- }
2351
- }), xo = { class: "tpl:mb-3.5" }, So = { class: "tpl:mb-3.5" }, Co = { class: "tpl:mb-3.5" }, wo = { class: "tpl:flex tpl:items-stretch" }, To = ["value"], Eo = /* @__PURE__ */ F({
2352
- __name: "DividerToolbar",
2353
- props: { block: {} },
2354
- emits: ["update"],
2355
- setup(e, { emit: t }) {
2356
- let n = t, { t: r } = y();
2357
- function i(e, t) {
2358
- n("update", { [e]: t });
2359
- }
2360
- return (t, n) => (z(), j(D, null, [
2361
- M("div", xo, [M("label", { class: L(U(T)) }, H(U(r).divider.style), 3), P(Q, {
2362
- options: [
2363
- {
2364
- value: "solid",
2365
- label: U(r).divider.solid
2366
- },
2367
- {
2368
- value: "dashed",
2369
- label: U(r).divider.dashed
2370
- },
2371
- {
2372
- value: "dotted",
2373
- label: U(r).divider.dotted
2374
- }
2375
- ],
2376
- "model-value": e.block.lineStyle,
2377
- "onUpdate:modelValue": n[0] ||= (e) => i("lineStyle", e)
2378
- }, null, 8, ["options", "model-value"])]),
2379
- M("div", So, [M("label", { class: L(U(T)) }, H(U(r).divider.color), 3), P(Y, {
2380
- "model-value": e.block.color,
2381
- "onUpdate:modelValue": n[1] ||= (e) => i("color", e)
2382
- }, null, 8, ["model-value"])]),
2383
- M("div", Co, [M("label", { class: L(U(T)) }, H(U(r).divider.thickness), 3), M("div", wo, [M("input", {
2384
- type: "number",
2385
- class: L(U(w)),
2386
- value: e.block.thickness,
2387
- min: "1",
2388
- max: "10",
2389
- onInput: n[2] ||= (e) => i("thickness", Number(e.target.value))
2390
- }, null, 42, To), M("span", { class: L(U(E)) }, "px", 2)])])
2391
- ], 64));
2392
- }
2393
- }), Do = { class: "tpl:mb-3.5" }, Oo = ["value"], ko = { class: "tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, Ao = /* @__PURE__ */ F({
2394
- __name: "HtmlToolbar",
2395
- props: { block: {} },
2396
- emits: ["update"],
2397
- setup(e, { emit: t }) {
2398
- let n = t, { t: r } = y();
2399
- return (t, i) => (z(), j("div", Do, [
2400
- M("label", { class: L(U(T)) }, H(U(r).html.content), 3),
2401
- M("textarea", {
2402
- value: e.block.content,
2403
- placeholder: "<div>...</div>",
2404
- rows: "10",
2405
- class: "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:outline-none tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]",
2406
- onInput: i[0] ||= (e) => n("update", { content: e.target.value })
2407
- }, null, 40, Oo),
2408
- M("p", ko, [P(U(Te), {
2409
- size: 12,
2410
- class: "tpl:mt-0.5 tpl:shrink-0"
2411
- }), N(" " + H(U(r).html.sanitizationHint), 1)])
2412
- ]));
2413
- }
2414
- }), jo = { class: "tpl:mb-3.5" }, Mo = {
2415
- key: 0,
2416
- class: "tpl:mb-3.5"
2417
- }, No = ["value", "placeholder"], Po = { class: "tpl:mb-3.5" }, Fo = { class: "tpl:mb-3.5" }, Io = ["value"], Lo = { value: "full" }, Ro = { class: "tpl:mb-3.5" }, zo = { class: "tpl:mb-3.5" }, Bo = {
2418
- key: 0,
2419
- class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
2420
- }, Vo = ["checked"], Ho = /* @__PURE__ */ F({
2421
- __name: "ImageToolbar",
2422
- props: { block: {} },
2423
- emits: ["update"],
2424
- setup(e, { emit: t }) {
2425
- let n = t, { t: r } = y(), i = I(be, null), a = I(de, $e.liquid), o = O(() => !!i), s = B(!1), c = B(!1), { start: l } = ce(() => {
2426
- s.value = !1;
2427
- }, 1e3, { immediate: !1 });
2428
- function u(e, t) {
2429
- n("update", { [e]: t });
2430
- }
2431
- async function d() {
2432
- let e = await i?.({ accept: ["images"] });
2433
- e && (u("src", e.url), e.alt && (u("alt", e.alt), c.value = !0), s.value = !0, l());
2434
- }
2435
- return (t, n) => (z(), j(D, null, [
2436
- M("div", jo, [
2437
- M("label", { class: L(U(T)) }, H(U(r).image.imageUrl), 3),
2438
- P(X, {
2439
- "model-value": e.block.src,
2440
- type: "url",
2441
- placeholder: U(r).image.imageUrlPlaceholder,
2442
- pulse: s.value,
2443
- "onUpdate:modelValue": n[0] ||= (e) => u("src", e)
2444
- }, null, 8, [
2445
- "model-value",
2446
- "placeholder",
2447
- "pulse"
2448
- ]),
2449
- o.value ? (z(), j("button", {
2450
- key: 0,
2451
- 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",
2452
- style: {
2453
- "border-color": "var(--tpl-border)",
2454
- color: "var(--tpl-primary)",
2455
- "background-color": "var(--tpl-bg)"
2456
- },
2457
- onClick: d
2458
- }, [P(U(h), {
2459
- size: 14,
2460
- "stroke-width": 1.5
2461
- }), N(" " + H(U(r).image.browseMedia), 1)])) : A("", !0)
2462
- ]),
2463
- U(et)(e.block.src, U(a)) ? (z(), j("div", Mo, [M("label", { class: L(U(T)) }, [N(H(U(r).image.placeholderUrl) + " ", 1), n[7] ||= M("span", { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, H("(optional)"), -1)], 2), M("input", {
2464
- type: "url",
2465
- class: L(U(C)),
2466
- value: e.block.placeholderUrl || "",
2467
- placeholder: U(r).image.placeholderUrlPlaceholder,
2468
- onInput: n[1] ||= (e) => u("placeholderUrl", e.target.value)
2469
- }, null, 42, No)])) : A("", !0),
2470
- M("div", Po, [M("label", { class: L(U(T)) }, H(U(r).image.altText), 3), P(X, {
2471
- "model-value": e.block.alt,
2472
- type: "text",
2473
- placeholder: U(r).image.altTextPlaceholder,
2474
- pulse: c.value,
2475
- "onUpdate:modelValue": n[2] ||= (e) => u("alt", e)
2476
- }, null, 8, [
2477
- "model-value",
2478
- "placeholder",
2479
- "pulse"
2480
- ])]),
2481
- M("div", Fo, [M("label", { class: L(U(T)) }, H(U(r).image.width), 3), M("select", {
2482
- class: L(U(C)),
2483
- value: e.block.width,
2484
- onChange: n[3] ||= (e) => u("width", e.target.value === "full" ? "full" : Number(e.target.value))
2485
- }, [
2486
- M("option", Lo, H(U(r).image.fullWidth), 1),
2487
- n[8] ||= M("option", { value: "300" }, "300px", -1),
2488
- n[9] ||= M("option", { value: "400" }, "400px", -1),
2489
- n[10] ||= M("option", { value: "500" }, "500px", -1)
2490
- ], 42, Io)]),
2491
- M("div", Ro, [M("label", { class: L(U(T)) }, H(U(r).title.align), 3), P(Q, {
2492
- options: [
2493
- {
2494
- value: "left",
2495
- label: U(r).title.alignLeft
2496
- },
2497
- {
2498
- value: "center",
2499
- label: U(r).title.alignCenter
2500
- },
2501
- {
2502
- value: "right",
2503
- label: U(r).title.alignRight
2504
- }
2505
- ],
2506
- "model-value": e.block.align,
2507
- "onUpdate:modelValue": n[4] ||= (e) => u("align", e)
2508
- }, null, 8, ["options", "model-value"])]),
2509
- M("div", zo, [
2510
- M("label", { class: L(U(T)) }, H(U(r).image.linkUrl), 3),
2511
- P(X, {
2512
- "model-value": e.block.linkUrl || "",
2513
- type: "url",
2514
- placeholder: U(r).image.imageUrlPlaceholder,
2515
- "onUpdate:modelValue": n[5] ||= (e) => u("linkUrl", e)
2516
- }, null, 8, ["model-value", "placeholder"]),
2517
- e.block.linkUrl ? (z(), j("label", Bo, [M("input", {
2518
- type: "checkbox",
2519
- class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
2520
- checked: e.block.linkOpenInNewTab ?? !1,
2521
- onChange: n[6] ||= (e) => u("linkOpenInNewTab", e.target.checked)
2522
- }, null, 40, Vo), N(" " + H(U(r).image.openInNewTab), 1)])) : A("", !0)
2523
- ])
2524
- ], 64));
2525
- }
2526
- }), Uo = { class: "tpl:mb-3.5" }, Wo = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Go = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ko = [
2527
- "value",
2528
- "placeholder",
2529
- "onInput"
2530
- ], qo = ["title", "onClick"], Jo = { class: "tpl:flex tpl:items-center tpl:gap-3 tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Yo = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1" }, Xo = ["checked", "onChange"], Zo = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1" }, Qo = ["checked", "onChange"], $o = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1" }, es = ["checked", "onChange"], ts = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ns = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, rs = { class: "tpl:mb-3.5" }, is = ["value"], as = { value: "" }, os = ["value"], ss = { class: "tpl:mb-3.5" }, cs = { class: "tpl:flex tpl:items-stretch" }, ls = ["value"], us = { class: "tpl:mb-3.5" }, ds = { class: "tpl:mb-3.5" }, fs = { class: "tpl:mb-3.5" }, ps = { class: "tpl:mb-3.5" }, ms = ["value"], hs = { class: "tpl:mb-3.5" }, gs = { class: "tpl:mb-3.5" }, _s = { class: "tpl:flex tpl:items-stretch" }, vs = ["value"], ys = /* @__PURE__ */ F({
2531
- __name: "MenuToolbar",
2532
- props: {
2533
- block: {},
2534
- fontFamilies: {}
2535
- },
2536
- emits: ["update"],
2537
- setup(e, { emit: t }) {
2538
- let n = e, r = t, { t: i } = y();
2539
- function a(e, t) {
2540
- r("update", { [e]: t });
2541
- }
2542
- function o() {
2543
- let e = {
2544
- id: rt(),
2545
- text: "",
2546
- url: "",
2547
- openInNewTab: !1,
2548
- bold: !1,
2549
- underline: !1
2550
- };
2551
- r("update", { items: [...n.block.items, e] });
2552
- }
2553
- function s(e, t, i) {
2554
- r("update", { items: n.block.items.map((n) => n.id === e ? {
2555
- ...n,
2556
- [t]: i
2557
- } : n) });
2558
- }
2559
- function c(e) {
2560
- r("update", { items: n.block.items.filter((t) => t.id !== e) });
2561
- }
2562
- return (t, n) => (z(), j(D, null, [
2563
- M("div", Uo, [M("label", { class: L(U(T)) }, H(U(i).menu.items), 3), M("div", Wo, [(z(!0), j(D, null, V(e.block.items, (t) => (z(), j("div", {
2564
- key: t.id,
2565
- 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"
2566
- }, [
2567
- M("div", Go, [M("input", {
2568
- type: "text",
2569
- class: L([U(C), "tpl:flex-1"]),
2570
- value: t.text,
2571
- placeholder: U(i).menu.text,
2572
- onInput: (e) => s(t.id, "text", e.target.value)
2573
- }, null, 42, Ko), M("button", {
2574
- class: "tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md 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)]",
2575
- title: U(i).menu.removeItem,
2576
- onClick: (e) => c(t.id)
2577
- }, [P(U(ze), {
2578
- size: 14,
2579
- "stroke-width": 2
2580
- })], 8, qo)]),
2581
- P(X, {
2582
- "model-value": t.url,
2583
- type: "url",
2584
- placeholder: U(i).menu.urlPlaceholder,
2585
- "onUpdate:modelValue": (e) => s(t.id, "url", e)
2586
- }, null, 8, [
2587
- "model-value",
2588
- "placeholder",
2589
- "onUpdate:modelValue"
2590
- ]),
2591
- M("div", Jo, [
2592
- M("label", Yo, [M("input", {
2593
- type: "checkbox",
2594
- checked: t.openInNewTab,
2595
- class: "tpl:accent-[var(--tpl-primary)]",
2596
- onChange: (e) => s(t.id, "openInNewTab", e.target.checked)
2597
- }, null, 40, Xo), N(" " + H(U(i).menu.openInNewTab), 1)]),
2598
- M("label", Zo, [M("input", {
2599
- type: "checkbox",
2600
- checked: t.bold,
2601
- class: "tpl:accent-[var(--tpl-primary)]",
2602
- onChange: (e) => s(t.id, "bold", e.target.checked)
2603
- }, null, 40, Qo), N(" " + H(U(i).menu.bold), 1)]),
2604
- M("label", $o, [M("input", {
2605
- type: "checkbox",
2606
- checked: t.underline,
2607
- class: "tpl:accent-[var(--tpl-primary)]",
2608
- onChange: (e) => s(t.id, "underline", e.target.checked)
2609
- }, null, 40, es), N(" " + H(U(i).menu.underline), 1)])
2610
- ]),
2611
- M("div", ts, [M("label", ns, H(U(i).menu.color), 1), P(Y, {
2612
- "swatch-only": "",
2613
- "model-value": t.color || e.block.linkColor || e.block.color,
2614
- "onUpdate:modelValue": (e) => s(t.id, "color", e)
2615
- }, null, 8, ["model-value", "onUpdate:modelValue"])])
2616
- ]))), 128)), M("button", {
2617
- class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 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)]",
2618
- onClick: o
2619
- }, [P(U(q), {
2620
- size: 14,
2621
- "stroke-width": 2
2622
- }), N(" " + H(U(i).menu.addItem), 1)])])]),
2623
- M("div", rs, [M("label", { class: L(U(T)) }, H(U(i).menu.fontFamily), 3), M("select", {
2624
- class: L(U(C)),
2625
- value: e.block.fontFamily || "",
2626
- onChange: n[0] ||= (e) => a("fontFamily", e.target.value || void 0)
2627
- }, [M("option", as, H(U(i).title.inheritFont), 1), (z(!0), j(D, null, V(e.fontFamilies, (e) => (z(), j("option", {
2628
- key: e.value,
2629
- value: e.value
2630
- }, H(e.label), 9, os))), 128))], 42, is)]),
2631
- M("div", ss, [M("label", { class: L(U(T)) }, H(U(i).menu.fontSize), 3), M("div", cs, [M("input", {
2632
- type: "number",
2633
- class: L(U(w)),
2634
- value: e.block.fontSize,
2635
- min: "8",
2636
- max: "48",
2637
- onInput: n[1] ||= (e) => a("fontSize", Number(e.target.value))
2638
- }, null, 42, ls), M("span", { class: L(U(E)) }, "px", 2)])]),
2639
- M("div", us, [M("label", { class: L(U(T)) }, H(U(i).menu.color), 3), P(Y, {
2640
- "model-value": e.block.color,
2641
- "onUpdate:modelValue": n[2] ||= (e) => a("color", e)
2642
- }, null, 8, ["model-value"])]),
2643
- M("div", ds, [M("label", { class: L(U(T)) }, H(U(i).menu.linkColor), 3), P(Y, {
2644
- "model-value": e.block.linkColor || e.block.color,
2645
- "onUpdate:modelValue": n[3] ||= (e) => a("linkColor", e || void 0)
2646
- }, null, 8, ["model-value"])]),
2647
- M("div", fs, [M("label", { class: L(U(T)) }, H(U(i).menu.textAlign), 3), P(Q, {
2648
- options: [
2649
- {
2650
- value: "left",
2651
- label: U(i).title.alignLeft,
2652
- icon: U(Pe)
2653
- },
2654
- {
2655
- value: "center",
2656
- label: U(i).title.alignCenter,
2657
- icon: U(je)
2658
- },
2659
- {
2660
- value: "right",
2661
- label: U(i).title.alignRight,
2662
- icon: U(Ne)
2663
- }
2664
- ],
2665
- "model-value": e.block.textAlign,
2666
- "onUpdate:modelValue": n[4] ||= (e) => a("textAlign", e)
2667
- }, null, 8, ["options", "model-value"])]),
2668
- M("div", ps, [M("label", { class: L(U(T)) }, H(U(i).menu.separator), 3), M("input", {
2669
- type: "text",
2670
- class: L(U(C)),
2671
- value: e.block.separator,
2672
- onInput: n[5] ||= (e) => a("separator", e.target.value)
2673
- }, null, 42, ms)]),
2674
- M("div", hs, [M("label", { class: L(U(T)) }, H(U(i).menu.separatorColor), 3), P(Y, {
2675
- "model-value": e.block.separatorColor,
2676
- "onUpdate:modelValue": n[6] ||= (e) => a("separatorColor", e)
2677
- }, null, 8, ["model-value"])]),
2678
- M("div", gs, [M("label", { class: L(U(T)) }, H(U(i).menu.spacing), 3), M("div", _s, [M("input", {
2679
- type: "number",
2680
- class: L(U(w)),
2681
- value: e.block.spacing,
2682
- min: "0",
2683
- max: "50",
2684
- onInput: n[7] ||= (e) => a("spacing", Number(e.target.value))
2685
- }, null, 42, vs), M("span", { class: L(U(E)) }, "px", 2)])])
2686
- ], 64));
2687
- }
2688
- }), bs = { class: "tpl:mb-3.5" }, xs = ["value"], Ss = ["value"], Cs = /* @__PURE__ */ F({
2689
- __name: "SectionToolbar",
2690
- props: { block: {} },
2691
- emits: ["update"],
2692
- setup(e, { emit: t }) {
2693
- let n = t, { t: r } = y(), i = O(() => [
2694
- {
2695
- value: "1",
2696
- label: r.section.column1
2697
- },
2698
- {
2699
- value: "2",
2700
- label: r.section.column2
2701
- },
2702
- {
2703
- value: "3",
2704
- label: r.section.column3
2705
- },
2706
- {
2707
- value: "1-2",
2708
- label: r.section.ratio12
2709
- },
2710
- {
2711
- value: "2-1",
2712
- label: r.section.ratio21
2713
- }
2714
- ]);
2715
- return (t, a) => (z(), j("div", bs, [M("label", { class: L(U(T)) }, H(U(r).section.columns), 3), M("select", {
2716
- class: L(U(C)),
2717
- value: e.block.columns,
2718
- onChange: a[0] ||= (e) => n("update", { columns: e.target.value })
2719
- }, [(z(!0), j(D, null, V(i.value, (e) => (z(), j("option", {
2720
- key: e.value,
2721
- value: e.value
2722
- }, H(e.label), 9, Ss))), 128))], 42, xs)]));
2723
- }
2724
- }), ws = { class: "tpl:mb-3.5" }, Ts = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, Es = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ds = ["value", "onChange"], Os = ["value"], ks = ["title", "onClick"], As = { class: "tpl:mb-3.5" }, js = { class: "tpl:mb-3.5" }, Ms = { class: "tpl:mb-3.5" }, Ns = { class: "tpl:flex tpl:items-stretch" }, Ps = ["value"], Fs = { class: "tpl:mb-3.5" }, Is = /* @__PURE__ */ F({
2725
- __name: "SocialToolbar",
2726
- props: { block: {} },
2727
- emits: ["update"],
2728
- setup(e, { emit: t }) {
2729
- let n = e, r = t, { t: i } = y();
2730
- function a(e, t) {
2731
- r("update", { [e]: t });
2732
- }
2733
- function o() {
2734
- let e = {
2735
- id: rt(),
2736
- platform: "facebook",
2737
- url: ""
2738
- };
2739
- r("update", { icons: [...n.block.icons, e] });
2740
- }
2741
- function s(e, t, i) {
2742
- r("update", { icons: n.block.icons.map((n) => n.id === e ? {
2743
- ...n,
2744
- [t]: i
2745
- } : n) });
2746
- }
2747
- function c(e) {
2748
- r("update", { icons: n.block.icons.filter((t) => t.id !== e) });
2749
- }
2750
- return (t, n) => (z(), j(D, null, [
2751
- M("div", ws, [M("label", { class: L(U(T)) }, H(U(i).social.icons), 3), M("div", Ts, [(z(!0), j(D, null, V(e.block.icons, (e) => (z(), j("div", {
2752
- key: e.id,
2753
- 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"
2754
- }, [M("div", Es, [M("select", {
2755
- class: L([U(C), "tpl:flex-1"]),
2756
- value: e.platform,
2757
- onChange: (t) => s(e.id, "platform", t.target.value)
2758
- }, [(z(!0), j(D, null, V(U(ie), (e) => (z(), j("option", {
2759
- key: e,
2760
- value: e
2761
- }, H(U(te)[e].name), 9, Os))), 128))], 42, Ds), M("button", {
2762
- class: "tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md 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)]",
2763
- title: U(i).social.removeIcon,
2764
- onClick: (t) => c(e.id)
2765
- }, [P(U(ze), {
2766
- size: 14,
2767
- "stroke-width": 2
2768
- })], 8, ks)]), P(X, {
2769
- "model-value": e.url,
2770
- type: "url",
2771
- placeholder: U(i).social.urlPlaceholder,
2772
- "onUpdate:modelValue": (t) => s(e.id, "url", t)
2773
- }, null, 8, [
2774
- "model-value",
2775
- "placeholder",
2776
- "onUpdate:modelValue"
2777
- ])]))), 128)), M("button", {
2778
- class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 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)]",
2779
- onClick: o
2780
- }, [P(U(q), {
2781
- size: 14,
2782
- "stroke-width": 2
2783
- }), N(" " + H(U(i).social.addIcon), 1)])])]),
2784
- M("div", As, [M("label", { class: L(U(T)) }, H(U(i).social.style), 3), P(Q, {
2785
- options: [
2786
- {
2787
- value: "solid",
2788
- label: U(i).social.styleSolid
2789
- },
2790
- {
2791
- value: "outlined",
2792
- label: U(i).social.styleOutlined
2793
- },
2794
- {
2795
- value: "rounded",
2796
- label: U(i).social.styleRounded
2797
- },
2798
- {
2799
- value: "square",
2800
- label: U(i).social.styleSquare
2801
- },
2802
- {
2803
- value: "circle",
2804
- label: U(i).social.styleCircle
2805
- }
2806
- ],
2807
- "model-value": e.block.iconStyle,
2808
- "onUpdate:modelValue": n[0] ||= (e) => a("iconStyle", e)
2809
- }, null, 8, ["options", "model-value"])]),
2810
- M("div", js, [M("label", { class: L(U(T)) }, H(U(i).social.size), 3), P(Q, {
2811
- options: [
2812
- {
2813
- value: "small",
2814
- label: U(i).social.sizeSmall
2815
- },
2816
- {
2817
- value: "medium",
2818
- label: U(i).social.sizeMedium
2819
- },
2820
- {
2821
- value: "large",
2822
- label: U(i).social.sizeLarge
2823
- }
2824
- ],
2825
- "model-value": e.block.iconSize,
2826
- "onUpdate:modelValue": n[1] ||= (e) => a("iconSize", e)
2827
- }, null, 8, ["options", "model-value"])]),
2828
- M("div", Ms, [M("label", { class: L(U(T)) }, H(U(i).social.spacing), 3), M("div", Ns, [M("input", {
2829
- type: "number",
2830
- class: L(U(w)),
2831
- value: e.block.spacing,
2832
- min: "0",
2833
- max: "50",
2834
- onInput: n[2] ||= (e) => a("spacing", Number(e.target.value))
2835
- }, null, 42, Ps), M("span", { class: L(U(E)) }, "px", 2)])]),
2836
- M("div", Fs, [M("label", { class: L(U(T)) }, H(U(i).social.align), 3), P(Q, {
2837
- options: [
2838
- {
2839
- value: "left",
2840
- label: U(i).title.alignLeft,
2841
- icon: U(Pe)
2842
- },
2843
- {
2844
- value: "center",
2845
- label: U(i).title.alignCenter,
2846
- icon: U(je)
2847
- },
2848
- {
2849
- value: "right",
2850
- label: U(i).title.alignRight,
2851
- icon: U(Ne)
2852
- }
2853
- ],
2854
- "model-value": e.block.align,
2855
- "onUpdate:modelValue": n[3] ||= (e) => a("align", e)
2856
- }, null, 8, ["options", "model-value"])])
2857
- ], 64));
2858
- }
2859
- }), Ls = { class: "tpl:mb-3.5" }, Rs = { class: "tpl:flex tpl:items-stretch" }, zs = ["value"], Bs = ["value"], Vs = /* @__PURE__ */ F({
2860
- __name: "SpacerToolbar",
2861
- props: { block: {} },
2862
- emits: ["update"],
2863
- setup(e, { emit: t }) {
2864
- let n = t, { t: r } = y();
2865
- return (t, i) => (z(), j("div", Ls, [
2866
- M("label", { class: L(U(T)) }, H(U(r).spacer.height), 3),
2867
- M("div", Rs, [M("input", {
2868
- type: "number",
2869
- class: L(U(w)),
2870
- value: e.block.height,
2871
- min: "10",
2872
- max: "100",
2873
- onInput: i[0] ||= (e) => n("update", { height: Number(e.target.value) })
2874
- }, null, 42, zs), M("span", { class: L(U(E)) }, "px", 2)]),
2875
- M("input", {
2876
- type: "range",
2877
- class: "tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",
2878
- value: e.block.height,
2879
- min: "10",
2880
- max: "100",
2881
- onInput: i[1] ||= (e) => n("update", { height: Number(e.target.value) })
2882
- }, null, 40, Bs)
2883
- ]));
2884
- }
2885
- }), Hs = { class: "tpl:mb-3.5" }, Us = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Ws = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, Gs = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Ks = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, qs = ["disabled"], Js = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, Ys = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, Xs = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Zs = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, Qs = ["disabled"], $s = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, ec = { class: "tpl:mb-3.5" }, tc = { 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)]" }, nc = ["checked"], rc = {
2886
- key: 0,
2887
- class: "tpl:mb-3.5"
2888
- }, ic = { class: "tpl:mb-3.5" }, ac = { class: "tpl:mb-3.5" }, oc = { class: "tpl:flex tpl:items-stretch" }, sc = ["value"], cc = { class: "tpl:mb-3.5" }, lc = { class: "tpl:flex tpl:items-stretch" }, uc = ["value"], dc = { class: "tpl:mb-3.5" }, fc = ["value"], pc = { value: "" }, mc = ["value"], hc = { class: "tpl:mb-3.5" }, gc = { class: "tpl:flex tpl:items-stretch" }, _c = ["value"], vc = { class: "tpl:mb-3.5" }, yc = { class: "tpl:mb-3.5" }, bc = /* @__PURE__ */ F({
2889
- __name: "TableToolbar",
2890
- props: {
2891
- block: {},
2892
- fontFamilies: {}
2893
- },
2894
- emits: ["update"],
2895
- setup(e, { emit: t }) {
2896
- let n = e, r = t, { t: i } = y(), a = O(() => n.block.rows.length > 0 ? n.block.rows[0].cells.length : 0);
2897
- function o(e, t) {
2898
- r("update", { [e]: t });
2899
- }
2900
- function s() {
2901
- let e = n.block.rows.length > 0 ? n.block.rows[0].cells.length : 3, t = {
2902
- id: rt(),
2903
- cells: Array.from({ length: e }, () => ({
2904
- id: rt(),
2905
- content: ""
2906
- }))
2907
- };
2908
- r("update", { rows: [...n.block.rows, t] });
2909
- }
2910
- function c(e) {
2911
- r("update", { rows: n.block.rows.filter((t) => t.id !== e) });
2912
- }
2913
- function l() {
2914
- r("update", { rows: n.block.rows.map((e) => ({
2915
- ...e,
2916
- cells: [...e.cells, {
2917
- id: rt(),
2918
- content: ""
2919
- }]
2920
- })) });
2921
- }
2922
- function u(e) {
2923
- r("update", { rows: n.block.rows.map((t) => ({
2924
- ...t,
2925
- cells: t.cells.filter((t, n) => n !== e)
2926
- })) });
2927
- }
2928
- return (t, n) => (z(), j(D, null, [
2929
- M("div", Hs, [M("label", { class: L(U(T)) }, H(U(i).table.dimensions), 3), M("div", Us, [M("div", Ws, [M("span", Gs, H(U(i).table.rows), 1), M("div", Ks, [
2930
- M("button", {
2931
- 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",
2932
- disabled: e.block.rows.length <= 1,
2933
- onClick: n[0] ||= (t) => c(e.block.rows[e.block.rows.length - 1].id)
2934
- }, [P(U(S), {
2935
- size: 12,
2936
- "stroke-width": 2
2937
- })], 8, qs),
2938
- M("span", Js, H(e.block.rows.length), 1),
2939
- M("button", {
2940
- 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)]",
2941
- onClick: s
2942
- }, [P(U(q), {
2943
- size: 12,
2944
- "stroke-width": 2
2945
- })])
2946
- ])]), M("div", Ys, [M("span", Xs, H(U(i).table.columns), 1), M("div", Zs, [
2947
- M("button", {
2948
- 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",
2949
- disabled: a.value <= 1,
2950
- onClick: n[1] ||= (e) => u(a.value - 1)
2951
- }, [P(U(S), {
2952
- size: 12,
2953
- "stroke-width": 2
2954
- })], 8, Qs),
2955
- M("span", $s, H(a.value), 1),
2956
- M("button", {
2957
- 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)]",
2958
- onClick: l
2959
- }, [P(U(q), {
2960
- size: 12,
2961
- "stroke-width": 2
2962
- })])
2963
- ])])])]),
2964
- M("div", ec, [M("label", tc, [M("input", {
2965
- type: "checkbox",
2966
- checked: e.block.hasHeaderRow,
2967
- class: "tpl:accent-[var(--tpl-primary)]",
2968
- onChange: n[2] ||= (e) => o("hasHeaderRow", e.target.checked)
2969
- }, null, 40, nc), N(" " + H(U(i).table.hasHeaderRow), 1)])]),
2970
- e.block.hasHeaderRow ? (z(), j("div", rc, [M("label", { class: L(U(T)) }, H(U(i).table.headerBackgroundColor), 3), P(Y, {
2971
- "model-value": e.block.headerBackgroundColor || U("#f2f2f2"),
2972
- placeholder: U(i).table.noHeaderBg,
2973
- "onUpdate:modelValue": n[3] ||= (e) => o("headerBackgroundColor", e || null)
2974
- }, null, 8, ["model-value", "placeholder"])])) : A("", !0),
2975
- M("div", ic, [M("label", { class: L(U(T)) }, H(U(i).table.borderColor), 3), P(Y, {
2976
- "model-value": e.block.borderColor,
2977
- "onUpdate:modelValue": n[4] ||= (e) => o("borderColor", e)
2978
- }, null, 8, ["model-value"])]),
2979
- M("div", ac, [M("label", { class: L(U(T)) }, H(U(i).table.borderWidth), 3), M("div", oc, [M("input", {
2980
- type: "number",
2981
- class: L(U(w)),
2982
- value: e.block.borderWidth,
2983
- min: "0",
2984
- max: "10",
2985
- onInput: n[5] ||= (e) => o("borderWidth", Number(e.target.value))
2986
- }, null, 42, sc), M("span", { class: L(U(E)) }, "px", 2)])]),
2987
- M("div", cc, [M("label", { class: L(U(T)) }, H(U(i).table.cellPadding), 3), M("div", lc, [M("input", {
2988
- type: "number",
2989
- class: L(U(w)),
2990
- value: e.block.cellPadding,
2991
- min: "0",
2992
- max: "30",
2993
- onInput: n[6] ||= (e) => o("cellPadding", Number(e.target.value))
2994
- }, null, 42, uc), M("span", { class: L(U(E)) }, "px", 2)])]),
2995
- M("div", dc, [M("label", { class: L(U(T)) }, H(U(i).table.fontFamily), 3), M("select", {
2996
- class: L(U(C)),
2997
- value: e.block.fontFamily || "",
2998
- onChange: n[7] ||= (e) => o("fontFamily", e.target.value || void 0)
2999
- }, [M("option", pc, H(U(i).title.inheritFont), 1), (z(!0), j(D, null, V(e.fontFamilies, (e) => (z(), j("option", {
3000
- key: e.value,
3001
- value: e.value
3002
- }, H(e.label), 9, mc))), 128))], 42, fc)]),
3003
- M("div", hc, [M("label", { class: L(U(T)) }, H(U(i).table.fontSize), 3), M("div", gc, [M("input", {
3004
- type: "number",
3005
- class: L(U(w)),
3006
- value: e.block.fontSize,
3007
- min: "10",
3008
- max: "32",
3009
- onInput: n[8] ||= (e) => o("fontSize", Number(e.target.value))
3010
- }, null, 42, _c), M("span", { class: L(U(E)) }, "px", 2)])]),
3011
- M("div", vc, [M("label", { class: L(U(T)) }, H(U(i).table.color), 3), P(Y, {
3012
- "model-value": e.block.color,
3013
- "onUpdate:modelValue": n[9] ||= (e) => o("color", e)
3014
- }, null, 8, ["model-value"])]),
3015
- M("div", yc, [M("label", { class: L(U(T)) }, H(U(i).table.textAlign), 3), P(Q, {
3016
- options: [
3017
- {
3018
- value: "left",
3019
- label: U(i).title.alignLeft,
3020
- icon: U(Pe)
3021
- },
3022
- {
3023
- value: "center",
3024
- label: U(i).title.alignCenter,
3025
- icon: U(je)
3026
- },
3027
- {
3028
- value: "right",
3029
- label: U(i).title.alignRight,
3030
- icon: U(Ne)
3031
- }
3032
- ],
3033
- "model-value": e.block.textAlign,
3034
- "onUpdate:modelValue": n[10] ||= (e) => o("textAlign", e)
3035
- }, null, 8, ["options", "model-value"])])
3036
- ], 64));
3037
- }
3038
- }), xc = { class: "tpl:mb-3.5" }, Sc = ["value"], Cc = { value: 1 }, wc = { value: 2 }, Tc = { value: 3 }, Ec = { value: 4 }, Dc = { class: "tpl:mb-3.5" }, Oc = ["value"], kc = { value: "" }, Ac = ["value"], jc = { class: "tpl:mb-3.5" }, Mc = { class: "tpl:mb-3.5" }, Nc = /* @__PURE__ */ F({
3039
- __name: "TitleToolbar",
3040
- props: {
3041
- block: {},
3042
- fontFamilies: {}
3043
- },
3044
- emits: ["update"],
3045
- setup(e, { emit: t }) {
3046
- let n = t, { t: r } = y();
3047
- function i(e, t) {
3048
- n("update", { [e]: t });
3049
- }
3050
- return (t, n) => (z(), j(D, null, [
3051
- M("div", xc, [M("label", { class: L(U(T)) }, H(U(r).title.level), 3), M("select", {
3052
- class: L(U(C)),
3053
- value: e.block.level,
3054
- onChange: n[0] ||= (e) => i("level", Number(e.target.value))
3055
- }, [
3056
- M("option", Cc, H(U(r).title.heading1), 1),
3057
- M("option", wc, H(U(r).title.heading2), 1),
3058
- M("option", Tc, H(U(r).title.heading3), 1),
3059
- M("option", Ec, H(U(r).title.heading4), 1)
3060
- ], 42, Sc)]),
3061
- M("div", Dc, [M("label", { class: L(U(T)) }, H(U(r).title.fontFamily), 3), M("select", {
3062
- class: L(U(C)),
3063
- value: e.block.fontFamily || "",
3064
- onChange: n[1] ||= (e) => i("fontFamily", e.target.value || void 0)
3065
- }, [M("option", kc, H(U(r).title.inheritFont), 1), (z(!0), j(D, null, V(e.fontFamilies, (e) => (z(), j("option", {
3066
- key: e.value,
3067
- value: e.value
3068
- }, H(e.label), 9, Ac))), 128))], 42, Oc)]),
3069
- M("div", jc, [M("label", { class: L(U(T)) }, H(U(r).title.color), 3), P(Y, {
3070
- "model-value": e.block.color,
3071
- "onUpdate:modelValue": n[2] ||= (e) => i("color", e)
3072
- }, null, 8, ["model-value"])]),
3073
- M("div", Mc, [M("label", { class: L(U(T)) }, H(U(r).title.align), 3), P(Q, {
3074
- options: [
3075
- {
3076
- value: "left",
3077
- label: U(r).title.alignLeft,
3078
- icon: U(Pe)
3079
- },
3080
- {
3081
- value: "center",
3082
- label: U(r).title.alignCenter,
3083
- icon: U(je)
3084
- },
3085
- {
3086
- value: "right",
3087
- label: U(r).title.alignRight,
3088
- icon: U(Ne)
3089
- }
3090
- ],
3091
- "model-value": e.block.textAlign,
3092
- "onUpdate:modelValue": n[3] ||= (e) => i("textAlign", e)
3093
- }, null, 8, ["options", "model-value"])])
3094
- ], 64));
3095
- }
3096
- }), Pc = ["aria-label"], Fc = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5" }, Ic = { 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)]" }, Rc = { class: "tpl:flex tpl:gap-1" }, zc = ["title"], Bc = ["title"], Vc = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, Hc = /* @__PURE__ */ x(/* @__PURE__ */ F({
3097
- __name: "Toolbar",
3098
- props: { block: {} },
3099
- emits: [
3100
- "update",
3101
- "delete",
3102
- "duplicate"
3103
- ],
3104
- setup(e, { emit: n }) {
3105
- let i = e, a = n, { t: o } = y(), s = ue(ve, "Toolbar"), c = I(v, []), l = O(() => i.block.type), u = O(() => at(i.block)), d = O(() => {
3106
- if (u.value) return c.find((e) => e.type === i.block.customType);
3107
- }), f = O(() => u.value ? d.value?.name ?? i.block.customType : t(l.value, o)), p = s.fonts;
3108
- function h(e) {
3109
- a("update", e);
3110
- }
3111
- return (t, n) => (z(), j("aside", {
3112
- "aria-label": U(o).landmarks.blockToolbar,
3113
- class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"
3114
- }, [M("div", Fc, [M("div", Ic, [U(we)[l.value] ? (z(), k(qe(U(we)[l.value]), {
3115
- key: 0,
3116
- size: 16,
3117
- "stroke-width": 1.5
3118
- })) : u.value ? (z(), k(U(r), {
3119
- key: 1,
3120
- size: 16,
3121
- "stroke-width": 1.5
3122
- })) : A("", !0), M("h3", Lc, H(f.value), 1)]), M("div", Rc, [M("button", {
3123
- 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)]",
3124
- title: U(o).toolbar.duplicate,
3125
- onClick: n[0] ||= (e) => a("duplicate")
3126
- }, [P(U(m), {
3127
- size: 14,
3128
- "stroke-width": 2
3129
- })], 8, zc), M("button", {
3130
- 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)]",
3131
- title: U(o).toolbar.delete,
3132
- onClick: n[1] ||= (e) => a("delete")
3133
- }, [P(U(Re), {
3134
- size: 14,
3135
- "stroke-width": 2
3136
- })], 8, Bc)])]), M("div", Vc, [u.value ? (z(), k(bo, {
3137
- key: 0,
3138
- block: e.block,
3139
- onUpdateFieldValues: n[2] ||= (e) => a("update", { fieldValues: e }),
3140
- onUpdateDataSourceFetched: n[3] ||= (e) => a("update", { dataSourceFetched: e })
3141
- }, null, 8, ["block"])) : l.value === "section" ? (z(), k(Cs, {
3142
- key: 1,
3143
- block: e.block,
3144
- onUpdate: h
3145
- }, null, 8, ["block"])) : l.value === "title" ? (z(), k(Nc, {
3146
- key: 2,
3147
- block: e.block,
3148
- "font-families": U(p),
3149
- onUpdate: h
3150
- }, null, 8, ["block", "font-families"])) : l.value === "paragraph" ? (z(), j(D, { key: 3 }, [], 64)) : l.value === "image" ? (z(), k(Ho, {
3151
- key: 4,
3152
- block: e.block,
3153
- onUpdate: h
3154
- }, null, 8, ["block"])) : l.value === "button" ? (z(), k(Ur, {
3155
- key: 5,
3156
- block: e.block,
3157
- "font-families": U(p),
3158
- onUpdate: h
3159
- }, null, 8, ["block", "font-families"])) : l.value === "divider" ? (z(), k(Eo, {
3160
- key: 6,
3161
- block: e.block,
3162
- onUpdate: h
3163
- }, null, 8, ["block"])) : l.value === "social" ? (z(), k(Is, {
3164
- key: 7,
3165
- block: e.block,
3166
- onUpdate: h
3167
- }, null, 8, ["block"])) : l.value === "menu" ? (z(), k(ys, {
3168
- key: 8,
3169
- block: e.block,
3170
- "font-families": U(p),
3171
- onUpdate: h
3172
- }, null, 8, ["block", "font-families"])) : l.value === "table" ? (z(), k(bc, {
3173
- key: 9,
3174
- block: e.block,
3175
- "font-families": U(p),
3176
- onUpdate: h
3177
- }, null, 8, ["block", "font-families"])) : l.value === "spacer" ? (z(), k(Vs, {
3178
- key: 10,
3179
- block: e.block,
3180
- onUpdate: h
3181
- }, null, 8, ["block"])) : l.value === "html" ? (z(), k(Ao, {
3182
- key: 11,
3183
- block: e.block,
3184
- onUpdate: h
3185
- }, null, 8, ["block"])) : l.value === "countdown" ? (z(), k(Ia, {
3186
- key: 12,
3187
- block: e.block,
3188
- "font-families": U(p),
3189
- onUpdate: h
3190
- }, null, 8, ["block", "font-families"])) : A("", !0), P(Gi, {
3191
- block: e.block,
3192
- "is-first-section": l.value === "paragraph",
3193
- onUpdate: h
3194
- }, null, 8, ["block", "is-first-section"])])], 8, Pc));
3195
- }
3196
- }), [["__scopeId", "data-v-fb6efed6"]]), Uc = ["aria-label"], Wc = {
3197
- role: "tablist",
3198
- class: "tpl:relative tpl:flex tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]"
3199
- }, Gc = ["aria-selected"], Kc = ["aria-selected"], qc = {
3200
- key: 0,
3201
- id: "tpl-tabpanel-content",
3202
- role: "tabpanel",
3203
- "aria-labelledby": "tpl-tab-content",
3204
- class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
3205
- }, Jc = {
3206
- key: 1,
3207
- 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)]"
3208
- }, Yc = { class: "tpl:mb-4 tpl:text-[var(--tpl-text-dim)]" }, Xc = { class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Zc = { class: "tpl:m-0 tpl:text-sm tpl:leading-normal" }, Qc = {
3209
- key: 1,
3210
- id: "tpl-tabpanel-settings",
3211
- role: "tabpanel",
3212
- "aria-labelledby": "tpl-tab-settings",
3213
- class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
3214
- }, $c = /* @__PURE__ */ F({
3215
- __name: "RightSidebar",
3216
- props: {
3217
- selectedBlock: {},
3218
- settings: {},
3219
- shiftedLeft: { type: Boolean }
3220
- },
3221
- emits: [
3222
- "update-block",
3223
- "delete-block",
3224
- "duplicate-block",
3225
- "update-settings"
3226
- ],
3227
- setup(e, { emit: t }) {
3228
- let n = e, r = t, { t: i } = y(), a = B("content"), o = O(() => a.value === "content" ? "tpl:translate-x-0" : "tpl:translate-x-full");
3229
- return Xe(() => n.selectedBlock, (e) => {
3230
- e && (a.value = "content");
3231
- }), (t, n) => (z(), j("aside", {
3232
- "aria-label": U(i).landmarks.rightSidebar,
3233
- class: L(["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"])
3234
- }, [
3235
- M("div", Wc, [
3236
- M("div", { class: L(["tpl:absolute tpl:bottom-0 tpl:left-0 tpl:h-full tpl:w-1/2 tpl:p-1.5 tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", o.value]) }, [...n[6] ||= [M("div", { class: "tpl:h-full tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow)]" }, null, -1)]], 2),
3237
- M("button", {
3238
- id: "tpl-tab-content",
3239
- role: "tab",
3240
- "aria-selected": a.value === "content",
3241
- "aria-controls": "tpl-tabpanel-content",
3242
- class: L(["tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]", a.value === "content" ? "tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]"]),
3243
- onClick: n[0] ||= (e) => a.value = "content"
3244
- }, [P(U(pt), {
3245
- size: 14,
3246
- "stroke-width": 2
3247
- }), N(" " + H(U(i).sidebar.content), 1)], 10, Gc),
3248
- M("button", {
3249
- id: "tpl-tab-settings",
3250
- role: "tab",
3251
- "aria-selected": a.value === "settings",
3252
- "aria-controls": "tpl-tabpanel-settings",
3253
- class: L(["tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]", a.value === "settings" ? "tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]"]),
3254
- onClick: n[1] ||= (e) => a.value = "settings"
3255
- }, [P(U(ht), {
3256
- size: 14,
3257
- "stroke-width": 1.5
3258
- }), N(" " + H(U(i).sidebar.settings), 1)], 10, Kc)
3259
- ]),
3260
- a.value === "content" ? (z(), j("div", qc, [e.selectedBlock ? (z(), k(Hc, {
3261
- key: 0,
3262
- block: e.selectedBlock,
3263
- onUpdate: n[2] ||= (e) => r("update-block", e),
3264
- onDelete: n[3] ||= (e) => r("delete-block"),
3265
- onDuplicate: n[4] ||= (e) => r("duplicate-block")
3266
- }, null, 8, ["block"])) : (z(), j("div", Jc, [
3267
- M("div", Yc, [P(U(ct), {
3268
- size: 40,
3269
- "stroke-width": 1.5
3270
- })]),
3271
- M("h3", Xc, H(U(i).sidebar.noSelection), 1),
3272
- M("p", Zc, H(U(i).sidebar.noSelectionHint), 1)
3273
- ]))])) : A("", !0),
3274
- a.value === "settings" ? (z(), j("div", Qc, [P(fr, {
3275
- settings: e.settings,
3276
- onUpdate: n[5] ||= (e) => r("update-settings", e)
3277
- }, null, 8, ["settings"])])) : A("", !0)
3278
- ], 10, Uc));
3279
- }
3280
- }), el = ["aria-label"], tl = [
3281
- "aria-checked",
3282
- "aria-label",
3283
- "title",
3284
- "onClick"
3285
- ], nl = /* @__PURE__ */ F({
3286
- __name: "ViewportToggle",
3287
- props: { viewport: {} },
3288
- emits: ["change"],
3289
- setup(e, { emit: t }) {
3290
- let n = e, r = t, { t: i } = y(), a = O(() => [
3291
- {
3292
- value: "desktop",
3293
- label: i.viewport.desktop
3294
- },
3295
- {
3296
- value: "tablet",
3297
- label: i.viewport.tablet
3298
- },
3299
- {
3300
- value: "mobile",
3301
- label: i.viewport.mobile
3302
- }
3303
- ]), o = O(() => `translateX(${a.value.findIndex((e) => e.value === n.viewport) * 100}%)`);
3304
- return (t, n) => (z(), j("div", {
3305
- role: "radiogroup",
3306
- "aria-label": U(i).viewport.label,
3307
- class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
3308
- style: R({
3309
- gridTemplateColumns: `repeat(${a.value.length}, 1fr)`,
3310
- backgroundColor: "var(--tpl-bg-hover)"
3311
- })
3312
- }, [M("div", {
3313
- class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
3314
- style: R({
3315
- left: "4px",
3316
- width: `calc((100% - 8px) / ${a.value.length})`,
3317
- transform: o.value,
3318
- backgroundColor: "var(--tpl-bg)",
3319
- boxShadow: "var(--tpl-shadow)",
3320
- transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
3321
- })
3322
- }, null, 4), (z(!0), j(D, null, V(a.value, (t) => (z(), j("button", {
3323
- key: t.value,
3324
- role: "radio",
3325
- "aria-checked": e.viewport === t.value,
3326
- "aria-label": t.label,
3327
- 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",
3328
- style: R({
3329
- color: e.viewport === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3330
- transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
3331
- }),
3332
- title: t.label,
3333
- onClick: (e) => r("change", t.value)
3334
- }, [t.value === "desktop" ? (z(), k(U(dt), {
3335
- key: 0,
3336
- size: 18,
3337
- "stroke-width": 1.5
3338
- })) : t.value === "tablet" ? (z(), k(U(bt), {
3339
- key: 1,
3340
- size: 18,
3341
- "stroke-width": 1.5
3342
- })) : (z(), k(U(gt), {
3343
- key: 2,
3344
- size: 18,
3345
- "stroke-width": 1.5
3346
- })), M("span", null, H(t.label), 1)], 12, tl))), 128))], 12, el));
3347
- }
3348
- }), rl = [
3349
- "aria-label",
3350
- "title",
3351
- "aria-pressed"
3352
- ], il = /* @__PURE__ */ x(/* @__PURE__ */ F({
3353
- __name: "PreviewToggle",
3354
- props: { previewMode: { type: Boolean } },
3355
- emits: ["change"],
3356
- setup(t, { emit: n }) {
3357
- let r = n, { t: i } = y();
3358
- return (n, a) => (z(), j("button", {
3359
- 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",
3360
- style: R({
3361
- color: t.previewMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3362
- backgroundColor: t.previewMode ? "var(--tpl-primary-light)" : "transparent"
3363
- }),
3364
- "aria-label": t.previewMode ? U(i).previewMode.disable : U(i).previewMode.enable,
3365
- title: t.previewMode ? U(i).previewMode.disable : U(i).previewMode.enable,
3366
- "aria-pressed": t.previewMode,
3367
- onClick: a[0] ||= (e) => r("change", !t.previewMode)
3368
- }, [P(He, {
3369
- "enter-active-class": "tpl-icon-enter-active",
3370
- "leave-active-class": "tpl-icon-leave-active",
3371
- "enter-from-class": "tpl-icon-enter-from",
3372
- "leave-to-class": "tpl-icon-leave-to",
3373
- mode: "out-in"
3374
- }, {
3375
- default: W(() => [t.previewMode ? (z(), k(U(Ee), {
3376
- key: "eye",
3377
- size: 18,
3378
- "stroke-width": 1.5
3379
- })) : (z(), k(U(e), {
3380
- key: "eye-off",
3381
- size: 18,
3382
- "stroke-width": 1.5
3383
- }))]),
3384
- _: 1
3385
- })], 12, rl));
3386
- }
3387
- }), [["__scopeId", "data-v-af87d02a"]]), al = [
3388
- "aria-label",
3389
- "title",
3390
- "aria-pressed"
3391
- ], ol = /* @__PURE__ */ x(/* @__PURE__ */ F({
3392
- __name: "DarkModeToggle",
3393
- props: { darkMode: { type: Boolean } },
3394
- emits: ["change"],
3395
- setup(e, { emit: t }) {
3396
- let n = t, { t: r } = y();
3397
- return (t, i) => (z(), j("button", {
3398
- 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",
3399
- style: R({
3400
- color: e.darkMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3401
- backgroundColor: e.darkMode ? "var(--tpl-primary-light)" : "transparent"
3402
- }),
3403
- "aria-label": e.darkMode ? U(r).darkMode.disable : U(r).darkMode.enable,
3404
- title: e.darkMode ? U(r).darkMode.disable : U(r).darkMode.enable,
3405
- "aria-pressed": e.darkMode,
3406
- onClick: i[0] ||= (t) => n("change", !e.darkMode)
3407
- }, [P(He, {
3408
- "enter-active-class": "tpl-icon-enter-active",
3409
- "leave-active-class": "tpl-icon-leave-active",
3410
- "enter-from-class": "tpl-icon-enter-from",
3411
- "leave-to-class": "tpl-icon-leave-to",
3412
- mode: "out-in"
3413
- }, {
3414
- default: W(() => [e.darkMode ? (z(), k(U(ft), {
3415
- key: "moon",
3416
- size: 18,
3417
- "stroke-width": 1.5
3418
- })) : (z(), k(U(yt), {
3419
- key: "sun",
3420
- size: 18,
3421
- "stroke-width": 1.5
3422
- }))]),
3423
- _: 1
3424
- })], 12, al));
3425
- }
3426
- }), [["__scopeId", "data-v-f8694f76"]]);
3427
- //#endregion
3428
- export { Bt as a, $c as i, il as n, jt as o, nl as r, mt as s, ol as t };