@templatical/editor 0.7.1 → 0.7.3

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