@templatical/editor 0.21.2 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/README.md +1 -1
  2. package/dist/{AiChatSidebar-K_AehWc-.js → AiChatSidebar-Bru6-ziQ.js} +1 -1
  3. package/dist/{AiFeatureMenu-CcqQDHzJ.js → AiFeatureMenu-CcqjRMFW.js} +1 -1
  4. package/dist/{SavedBlockPreviewCanvas-2-mzAnZE.js → BlockPreviewCanvas-MD9BGuXV.js} +36 -30
  5. package/dist/{CloudEditor-DOjGJwPe.js → CloudEditor-iK4vkpNm.js} +275 -279
  6. package/dist/{CollaboratorBar-Bj4NZiie.js → CollaboratorBar-C_1SF7Xf.js} +1 -1
  7. package/dist/{DesignReferenceSidebar-DNmK3dxp.js → DesignReferenceSidebar-BxPo0zyx.js} +1 -1
  8. package/dist/{MergeTagSuggestion-DMe4rqn0.js → MergeTagSuggestion-D9eCryMC.js} +2 -2
  9. package/dist/{ParagraphEditor--_zWfxps.js → ParagraphEditor-MKJYyWN9.js} +13 -13
  10. package/dist/{SaveBlockDialog-CYIEHABH.js → SaveBlockDialog-CFAJHP3v.js} +99 -98
  11. package/dist/{SavedBlocksBrowserModal-D5V5yF_3.js → SavedBlocksBrowserModal-C_-Xcm0Q.js} +4 -4
  12. package/dist/{SavedBlocksPanels-Dff38YXu.js → SavedBlocksPanels-CRf7zzFn.js} +1 -1
  13. package/dist/{SavedBlocksPickBar-rB6iyji6.js → SavedBlocksPickBar-C1FTJP-I.js} +1 -1
  14. package/dist/{SnapshotHistory-FtzDq8f0.js → SnapshotHistory-DWlQ3Eh0.js} +1 -1
  15. package/dist/TestEmailModal-D90-3Yex.js +162 -0
  16. package/dist/TestEmailPanel-B0u_Yd3X.js +33 -0
  17. package/dist/{TitleEditor-CPda5lh-.js → TitleEditor-DzsPxKv4.js} +5 -5
  18. package/dist/{TplModal-C7Koj5gM.js → TplModal-CykwWFhF.js} +1 -1
  19. package/dist/ViewportToggle-BjmbNoao.js +97 -0
  20. package/dist/{blockTypeIcons-CgwECCut.js → blockTypeIcons-CpKkI47V.js} +1 -1
  21. package/dist/bundle-stats.json +8 -8
  22. package/dist/{ca-BBgad6y5.js → ca-D47BxSGu.js} +14 -0
  23. package/dist/cdn/chunks/{AiChatSidebar-A1CuWGY0.js → AiChatSidebar-BMnsF8G6.js} +2 -2
  24. package/dist/cdn/chunks/{AiChatSidebar-A1CuWGY0.js.map → AiChatSidebar-BMnsF8G6.js.map} +1 -1
  25. package/dist/cdn/chunks/{AiFeatureMenu-Duwg413F.js → AiFeatureMenu-hWgWQg11.js} +2 -2
  26. package/dist/cdn/chunks/{AiFeatureMenu-Duwg413F.js.map → AiFeatureMenu-hWgWQg11.js.map} +1 -1
  27. package/dist/cdn/chunks/{SavedBlockPreviewCanvas-DZOMgNsz.js → BlockPreviewCanvas-eASrdFSN.js} +37 -31
  28. package/dist/cdn/chunks/BlockPreviewCanvas-eASrdFSN.js.map +1 -0
  29. package/dist/cdn/chunks/{CloudEditor-C0Y4RD4c.js → CloudEditor-S8zLHtKb.js} +253 -257
  30. package/dist/cdn/chunks/CloudEditor-S8zLHtKb.js.map +1 -0
  31. package/dist/cdn/chunks/{CollaboratorBar-BS3rJy6-.js → CollaboratorBar-mkJVAkSh.js} +2 -2
  32. package/dist/cdn/chunks/{CollaboratorBar-BS3rJy6-.js.map → CollaboratorBar-mkJVAkSh.js.map} +1 -1
  33. package/dist/cdn/chunks/{DesignReferenceSidebar-Dre99DTH.js → DesignReferenceSidebar-CM-k15pd.js} +2 -2
  34. package/dist/cdn/chunks/{DesignReferenceSidebar-Dre99DTH.js.map → DesignReferenceSidebar-CM-k15pd.js.map} +1 -1
  35. package/dist/cdn/chunks/{MergeTagSuggestion-D7TsECll.js → MergeTagSuggestion-BM349_QH.js} +2 -2
  36. package/dist/cdn/chunks/{MergeTagSuggestion-D7TsECll.js.map → MergeTagSuggestion-BM349_QH.js.map} +1 -1
  37. package/dist/cdn/chunks/{ParagraphEditor-CtaRa1vr.js → ParagraphEditor-J-1RLyi7.js} +14 -14
  38. package/dist/cdn/chunks/{ParagraphEditor-CtaRa1vr.js.map → ParagraphEditor-J-1RLyi7.js.map} +1 -1
  39. package/dist/cdn/chunks/{SaveBlockDialog-Bb3fdUEZ.js → SaveBlockDialog-Bi_Z3kuA.js} +100 -99
  40. package/dist/cdn/chunks/SaveBlockDialog-Bi_Z3kuA.js.map +1 -0
  41. package/dist/cdn/chunks/{SavedBlocksBrowserModal-CeUWcPv0.js → SavedBlocksBrowserModal-CesYxFsH.js} +4 -4
  42. package/dist/cdn/chunks/SavedBlocksBrowserModal-CesYxFsH.js.map +1 -0
  43. package/dist/cdn/chunks/{SavedBlocksPanels-D-pA_wfk.js → SavedBlocksPanels-BsSpJwrW.js} +2 -2
  44. package/dist/cdn/chunks/{SavedBlocksPanels-D-pA_wfk.js.map → SavedBlocksPanels-BsSpJwrW.js.map} +1 -1
  45. package/dist/cdn/chunks/{SavedBlocksPickBar-1rf1KpqS.js → SavedBlocksPickBar-CduR1Cpb.js} +2 -2
  46. package/dist/cdn/chunks/{SavedBlocksPickBar-1rf1KpqS.js.map → SavedBlocksPickBar-CduR1Cpb.js.map} +1 -1
  47. package/dist/cdn/chunks/{SnapshotHistory-Bf1uovti.js → SnapshotHistory-DO-gzr3i.js} +2 -2
  48. package/dist/cdn/chunks/{SnapshotHistory-Bf1uovti.js.map → SnapshotHistory-DO-gzr3i.js.map} +1 -1
  49. package/dist/cdn/chunks/TestEmailModal-CCWEVrE2.js +162 -0
  50. package/dist/cdn/chunks/TestEmailModal-CCWEVrE2.js.map +1 -0
  51. package/dist/cdn/chunks/TestEmailPanel-048m0kxX.js +35 -0
  52. package/dist/cdn/chunks/TestEmailPanel-048m0kxX.js.map +1 -0
  53. package/dist/cdn/chunks/{TitleEditor-BJ7LFykI.js → TitleEditor-J1vgU_J6.js} +6 -6
  54. package/dist/cdn/chunks/{TitleEditor-BJ7LFykI.js.map → TitleEditor-J1vgU_J6.js.map} +1 -1
  55. package/dist/cdn/chunks/{TplModal-CH9RzKF7.js → TplModal-BN53d9Se.js} +2 -2
  56. package/dist/cdn/chunks/{TplModal-CH9RzKF7.js.map → TplModal-BN53d9Se.js.map} +1 -1
  57. package/dist/cdn/chunks/ViewportToggle-CFmF-N4i.js +66 -0
  58. package/dist/cdn/chunks/ViewportToggle-CFmF-N4i.js.map +1 -0
  59. package/dist/cdn/chunks/{ca-BBgad6y5.js → ca-D47BxSGu.js} +15 -1
  60. package/dist/cdn/chunks/{ca-BBgad6y5.js.map → ca-D47BxSGu.js.map} +1 -1
  61. package/dist/cdn/chunks/{cloud-BJlbXGTJ.js → cloud-F-aVi9hj.js} +45 -41
  62. package/dist/cdn/chunks/cloud-F-aVi9hj.js.map +1 -0
  63. package/dist/{de-D7WbpFBR.js → cdn/chunks/de-CnnxBwh7.js} +16 -0
  64. package/dist/cdn/chunks/{de-D7WbpFBR.js.map → de-CnnxBwh7.js.map} +1 -1
  65. package/dist/{de-Bw6fB5JU.js → cdn/chunks/de-uVoSP1xF.js} +2 -9
  66. package/dist/cdn/chunks/de-uVoSP1xF.js.map +1 -0
  67. package/dist/cdn/chunks/emailFrameWidth-BmFCN2dp.js +8 -0
  68. package/dist/cdn/chunks/emailFrameWidth-BmFCN2dp.js.map +1 -0
  69. package/dist/{en-BrZ0uGK2.js → cdn/chunks/en-5gW-bYy2.js} +16 -0
  70. package/dist/cdn/chunks/{en-BrZ0uGK2.js.map → en-5gW-bYy2.js.map} +1 -1
  71. package/dist/{en-DAdHJz7h.js → cdn/chunks/en-CjhsJxb-.js} +2 -9
  72. package/dist/cdn/chunks/en-CjhsJxb-.js.map +1 -0
  73. package/dist/{es-tLSLysPs.js → cdn/chunks/es-sQ9SdI0l.js} +16 -0
  74. package/dist/cdn/chunks/{es-tLSLysPs.js.map → es-sQ9SdI0l.js.map} +1 -1
  75. package/dist/cdn/chunks/{extensions-ZX2oarW6.js → extensions-C49c51P1.js} +3 -3
  76. package/dist/cdn/chunks/{extensions-ZX2oarW6.js.map → extensions-C49c51P1.js.map} +1 -1
  77. package/dist/cdn/chunks/fr-DBZ5w21C.js +624 -0
  78. package/dist/cdn/chunks/fr-DBZ5w21C.js.map +1 -0
  79. package/dist/cdn/chunks/fr-Dswns199.js +89 -0
  80. package/dist/cdn/chunks/fr-Dswns199.js.map +1 -0
  81. package/dist/cdn/chunks/nl-CbcPJlrL.js +89 -0
  82. package/dist/cdn/chunks/nl-CbcPJlrL.js.map +1 -0
  83. package/dist/cdn/chunks/nl-DOL7Fnfo.js +624 -0
  84. package/dist/cdn/chunks/nl-DOL7Fnfo.js.map +1 -0
  85. package/dist/{pt-BR-w2sGzHNX.js → cdn/chunks/pt-BR-CTzHTqJD.js} +2 -9
  86. package/dist/cdn/chunks/pt-BR-CTzHTqJD.js.map +1 -0
  87. package/dist/cdn/chunks/{pt-BR-BWFokdTU.js → pt-BR-DRCdHX1d.js} +15 -1
  88. package/dist/cdn/chunks/{pt-BR-BWFokdTU.js.map → pt-BR-DRCdHX1d.js.map} +1 -1
  89. package/dist/cdn/chunks/{src-D6F_3XkE.js → src-CzoMNRq4.js} +19 -17
  90. package/dist/cdn/chunks/{src-D6F_3XkE.js.map → src-CzoMNRq4.js.map} +1 -1
  91. package/dist/cdn/chunks/{src-BuC_IHzN.js → src-SluTVSz_.js} +2 -2
  92. package/dist/cdn/chunks/{src-BuC_IHzN.js.map → src-SluTVSz_.js.map} +1 -1
  93. package/dist/cdn/chunks/{styles-DMOEiSX9.js → styles-BbfU2w9R.js} +617 -585
  94. package/dist/cdn/chunks/styles-BbfU2w9R.js.map +1 -0
  95. package/dist/cdn/chunks/{tiptap-BMZ-OENR.js → tiptap-DUTbZTeR.js} +5 -5
  96. package/dist/cdn/chunks/{tiptap-BMZ-OENR.js.map → tiptap-DUTbZTeR.js.map} +1 -1
  97. package/dist/cdn/chunks/{useEditorCore-BA6mspzD.js → useEditorCore-CzMhD6Gd.js} +3 -3
  98. package/dist/cdn/chunks/{useEditorCore-BA6mspzD.js.map → useEditorCore-CzMhD6Gd.js.map} +1 -1
  99. package/dist/cdn/editor.css +1 -1
  100. package/dist/cdn/editor.js +164 -145
  101. package/dist/cdn/editor.js.map +1 -1
  102. package/dist/{cloud-Du7mnkz2.js → cloud-CeZPgo1V.js} +41 -39
  103. package/dist/{cdn/chunks/de-D7WbpFBR.js → de-CnnxBwh7.js} +14 -2
  104. package/dist/{cdn/chunks/de-Bw6fB5JU.js → de-uVoSP1xF.js} +0 -11
  105. package/dist/{dist-CDO52Rxy.js → dist-3DHaYEiT.js} +2 -2
  106. package/dist/{dist-BEpCh2mG.js → dist-3HenmYIg.js} +1 -1
  107. package/dist/{dist-CrjzhIxB.js → dist-BCnJcAQc.js} +2 -2
  108. package/dist/{dist-BgPYC_8-.js → dist-B_etKYyh.js} +5 -5
  109. package/dist/{dist-CBzCU-a-.js → dist-CL_CfQ3Q.js} +2 -2
  110. package/dist/dist-CcQLJeWV.js +5 -0
  111. package/dist/{dist-CuXha2_7.js → dist-CclnU_v0.js} +2 -2
  112. package/dist/{dist-BkM8A17N.js → dist-DKWoZJAV.js} +2 -2
  113. package/dist/{dist-DYClLqy8.js → dist-DOtLGnLr.js} +2 -2
  114. package/dist/dist-DerdmERj.js +5 -0
  115. package/dist/{dist-BuNDAAVp.js → dist-Ih7ejWzn.js} +2 -2
  116. package/dist/{dist-CtcgoC_R.js → dist-bivrM-nS.js} +2 -2
  117. package/dist/emailFrameWidth-BmFCN2dp.js +6 -0
  118. package/dist/{cdn/chunks/en-BrZ0uGK2.js → en-5gW-bYy2.js} +14 -2
  119. package/dist/{cdn/chunks/en-DAdHJz7h.js → en-CjhsJxb-.js} +0 -11
  120. package/dist/{cdn/chunks/es-tLSLysPs.js → es-sQ9SdI0l.js} +14 -2
  121. package/dist/{extensions-ClY5Sh7S.js → extensions-3870a_3R.js} +3 -3
  122. package/dist/fr-DBZ5w21C.js +622 -0
  123. package/dist/index.d.ts +74 -0
  124. package/dist/nl-DOL7Fnfo.js +622 -0
  125. package/dist/{cdn/chunks/pt-BR-w2sGzHNX.js → pt-BR-CTzHTqJD.js} +0 -11
  126. package/dist/{pt-BR-BWFokdTU.js → pt-BR-DRCdHX1d.js} +14 -0
  127. package/dist/style.css +1 -1
  128. package/dist/{styles-PcOPXvLO.js → styles-BWTIgN5L.js} +672 -673
  129. package/dist/templatical-editor.js +128 -108
  130. package/dist/{useEditorCore-CT1slufs.js → useEditorCore-CuMMIfiS.js} +2 -2
  131. package/package.json +20 -20
  132. package/dist/TestEmailModal-DL2O1H8M.js +0 -95
  133. package/dist/cdn/chunks/CloudEditor-C0Y4RD4c.js.map +0 -1
  134. package/dist/cdn/chunks/SaveBlockDialog-Bb3fdUEZ.js.map +0 -1
  135. package/dist/cdn/chunks/SavedBlockPreviewCanvas-DZOMgNsz.js.map +0 -1
  136. package/dist/cdn/chunks/SavedBlocksBrowserModal-CeUWcPv0.js.map +0 -1
  137. package/dist/cdn/chunks/TestEmailModal-BJTDxFHh.js +0 -96
  138. package/dist/cdn/chunks/TestEmailModal-BJTDxFHh.js.map +0 -1
  139. package/dist/cdn/chunks/cloud-BJlbXGTJ.js.map +0 -1
  140. package/dist/cdn/chunks/de-Bw6fB5JU.js.map +0 -1
  141. package/dist/cdn/chunks/en-DAdHJz7h.js.map +0 -1
  142. package/dist/cdn/chunks/pt-BR-w2sGzHNX.js.map +0 -1
  143. package/dist/cdn/chunks/styles-DMOEiSX9.js.map +0 -1
  144. package/dist/dist-CweLDZrs.js +0 -5
  145. package/dist/dist-DOsdqAEZ.js +0 -5
@@ -1,9 +1,10 @@
1
1
  import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
2
2
  import { I as t, L as n, M as r, P as i, T as a, f as o, g as s, it as c, m as l, p as u, st as d, u as f, x as p } from "./draggable-D840DIZB.js";
3
- import { _ as m, a as h, c as g, d as _, f as v, h as y, i as b, k as x, m as S, n as C, p as w, r as T, u as E, v as D, y as O } from "./useEditorCore-BA6mspzD.js";
4
- import { h as k, o as A } from "./keys-D7kUmfpE.js";
3
+ import { _ as m, a as h, c as g, d as _, f as v, h as y, i as b, k as x, m as S, n as C, p as w, r as T, u as E, v as D, y as O } from "./useEditorCore-CzMhD6Gd.js";
4
+ import { d as k, h as A, o as j } from "./keys-D7kUmfpE.js";
5
+ import { n as M, t as N } from "./emailFrameWidth-BmFCN2dp.js";
5
6
  //#region src/components/blocks/PreviewSectionBlock.vue?vue&type=script&setup=true&lang.ts
6
- var j = { class: "tpl:w-full" }, M = { class: "tpl:flex tpl:gap-0" }, N = /* @__PURE__ */ p({
7
+ var P = { class: "tpl:w-full" }, F = { class: "tpl:flex tpl:gap-0" }, I = /* @__PURE__ */ p({
7
8
  name: "PreviewSectionBlock",
8
9
  __name: "PreviewSectionBlock",
9
10
  props: {
@@ -24,7 +25,7 @@ var j = { class: "tpl:w-full" }, M = { class: "tpl:flex tpl:gap-0" }, N = /* @__
24
25
  spacer: b,
25
26
  html: m,
26
27
  custom: O
27
- }, _ = e, k = a(A, null), N = o(() => {
28
+ }, _ = e, k = a(j, null), A = o(() => {
28
29
  switch (_.block.columns) {
29
30
  case "2": return ["50%", "50%"];
30
31
  case "3": return [
@@ -36,23 +37,23 @@ var j = { class: "tpl:w-full" }, M = { class: "tpl:flex tpl:gap-0" }, N = /* @__
36
37
  case "2-1": return ["66.67%", "33.33%"];
37
38
  default: return ["100%"];
38
39
  }
39
- }), P = o(() => {
40
- let e = N.value.length, t = [..._.block.children];
40
+ }), M = o(() => {
41
+ let e = A.value.length, t = [..._.block.children];
41
42
  for (; t.length < e;) t.push([]);
42
43
  return t.slice(0, e);
43
44
  });
44
- function F(e) {
45
- return P.value[e] || [];
45
+ function N(e) {
46
+ return M.value[e] || [];
46
47
  }
47
48
  function I(e) {
48
49
  return v(e, k, p);
49
50
  }
50
51
  return (e, a) => {
51
52
  let o = t("PreviewSectionBlock", !0);
52
- return r(), s("div", j, [u("div", M, [(r(!0), s(f, null, i(P.value, (e, t) => (r(), s("div", {
53
+ return r(), s("div", P, [u("div", F, [(r(!0), s(f, null, i(M.value, (e, t) => (r(), s("div", {
53
54
  key: t,
54
- style: d({ width: N.value[t] })
55
- }, [(r(!0), s(f, null, i(F(t), (e) => (r(), s("div", {
55
+ style: d({ width: A.value[t] })
56
+ }, [(r(!0), s(f, null, i(N(t), (e) => (r(), s("div", {
56
57
  key: e.id,
57
58
  style: d(c(E)(e))
58
59
  }, [e.type === "section" ? (r(), l(o, {
@@ -66,12 +67,15 @@ var j = { class: "tpl:w-full" }, M = { class: "tpl:flex tpl:gap-0" }, N = /* @__
66
67
  }, null, 8, ["block"]))], 4))), 128))], 4))), 128))])]);
67
68
  };
68
69
  }
69
- }), P = /*@__PURE__*/ p({
70
- __name: "SavedBlockPreviewCanvas",
71
- props: { blocks: {} },
70
+ }), L = /*@__PURE__*/ p({
71
+ __name: "BlockPreviewCanvas",
72
+ props: {
73
+ blocks: {},
74
+ viewport: { default: "desktop" }
75
+ },
72
76
  setup(e) {
73
- let t = a(A), u = a(k, null), p = o(() => u ? _(u.content.value.settings) : {}), j = {
74
- section: N,
77
+ let t = e, u = a(j), p = a(A, null), P = a(k, null), F = o(() => t.blocks.filter((e) => !P?.isHidden(e.id))), L = o(() => M(p?.content.value.settings, t.viewport)), R = o(() => p ? _(p.content.value.settings) : {}), z = {
78
+ section: I,
75
79
  title: g,
76
80
  paragraph: w,
77
81
  image: y,
@@ -85,27 +89,29 @@ var j = { class: "tpl:w-full" }, M = { class: "tpl:flex tpl:gap-0" }, N = /* @__
85
89
  html: m,
86
90
  custom: O
87
91
  };
88
- function M(e) {
89
- return v(e, t, j);
92
+ function B(e) {
93
+ return v(e, u, z);
90
94
  }
91
95
  return (t, a) => (r(), s("div", {
92
- "data-testid": "saved-blocks-preview-canvas",
93
- class: "tpl:pointer-events-none tpl:mx-auto tpl:w-[600px] tpl:select-none tpl:rounded-lg",
96
+ "data-testid": "block-preview-canvas",
97
+ class: "tpl:pointer-events-none tpl:mx-auto tpl:select-none tpl:rounded-lg",
94
98
  style: d({
99
+ width: `${L.value}px`,
100
+ transition: c(N),
95
101
  backgroundColor: "var(--tpl-canvas-bg)",
96
102
  boxShadow: "var(--tpl-shadow-sm)",
97
- ...p.value
103
+ ...R.value
98
104
  })
99
- }, [(r(!0), s(f, null, i(e.blocks, (e) => (r(), s("div", {
100
- key: e.id,
101
- style: d(c(E)(e))
102
- }, [(r(), l(n(M(e)), {
103
- block: e,
104
- viewport: "desktop"
105
- }, null, 8, ["block"]))], 4))), 128))], 4));
105
+ }, [(r(!0), s(f, null, i(F.value, (t) => (r(), s("div", {
106
+ key: t.id,
107
+ style: d(c(E)(t))
108
+ }, [(r(), l(n(B(t)), {
109
+ block: t,
110
+ viewport: e.viewport
111
+ }, null, 8, ["block", "viewport"]))], 4))), 128))], 4));
106
112
  }
107
- }), F = /* @__PURE__ */ e({ default: () => I }), I = P;
113
+ }), R = /* @__PURE__ */ e({ default: () => z }), z = L;
108
114
  //#endregion
109
- export { F as n, I as t };
115
+ export { R as n, z as t };
110
116
 
111
- //# sourceMappingURL=SavedBlockPreviewCanvas-DZOMgNsz.js.map
117
+ //# sourceMappingURL=BlockPreviewCanvas-eASrdFSN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockPreviewCanvas-eASrdFSN.js","names":[],"sources":["../../../src/components/blocks/PreviewSectionBlock.vue","../../../src/components/blocks/PreviewSectionBlock.vue","../../../src/components/BlockPreviewCanvas.vue","../../../src/components/BlockPreviewCanvas.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport ButtonBlock from \"./ButtonBlock.vue\";\nimport CustomBlock from \"./CustomBlock.vue\";\nimport DividerBlock from \"./DividerBlock.vue\";\nimport HtmlBlock from \"./HtmlBlock.vue\";\nimport ImageBlock from \"./ImageBlock.vue\";\nimport MenuBlock from \"./MenuBlock.vue\";\nimport SocialIconsBlock from \"./SocialIconsBlock.vue\";\nimport SpacerBlock from \"./SpacerBlock.vue\";\nimport TableBlock from \"./TableBlock.vue\";\nimport TitleBlock from \"./TitleBlock.vue\";\nimport ParagraphBlock from \"./ParagraphBlock.vue\";\nimport VideoBlock from \"./VideoBlock.vue\";\nimport {\n resolveBlockComponent,\n getBlockWrapperStyle,\n} from \"../../utils/blockComponentResolver\";\nimport type {\n Block,\n SectionBlock as SectionBlockType,\n} from \"@templatical/types\";\nimport { computed, inject, type Component } from \"vue\";\nimport { BLOCK_REGISTRY_KEY } from \"../../keys\";\n\nconst previewBlockComponentMap: Record<string, Component> = {\n title: TitleBlock,\n paragraph: ParagraphBlock,\n image: ImageBlock,\n video: VideoBlock,\n button: ButtonBlock,\n divider: DividerBlock,\n social: SocialIconsBlock,\n menu: MenuBlock,\n table: TableBlock,\n spacer: SpacerBlock,\n html: HtmlBlock,\n custom: CustomBlock,\n};\n\nconst props = defineProps<{\n block: SectionBlockType;\n viewport: \"desktop\";\n}>();\n\ndefineOptions({ name: \"PreviewSectionBlock\" });\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY, null);\n\nconst columnWidths = computed(() => {\n switch (props.block.columns) {\n case \"2\":\n return [\"50%\", \"50%\"];\n case \"3\":\n return [\"33.33%\", \"33.33%\", \"33.33%\"];\n case \"1-2\":\n return [\"33.33%\", \"66.67%\"];\n case \"2-1\":\n return [\"66.67%\", \"33.33%\"];\n default:\n return [\"100%\"];\n }\n});\n\nconst columns = computed(() => {\n const count = columnWidths.value.length;\n const children = [...props.block.children];\n while (children.length < count) {\n children.push([]);\n }\n return children.slice(0, count);\n});\n\nfunction getColumnBlocks(colIndex: number): Block[] {\n return columns.value[colIndex] || [];\n}\n\nfunction getBlockComponent(block: Block): Component | null {\n return resolveBlockComponent(block, blockRegistry, previewBlockComponentMap);\n}\n</script>\n\n<template>\n <div class=\"tpl:w-full\">\n <div class=\"tpl:flex tpl:gap-0\">\n <div\n v-for=\"(_, colIndex) in columns\"\n :key=\"colIndex\"\n :style=\"{ width: columnWidths[colIndex] }\"\n >\n <div\n v-for=\"childBlock in getColumnBlocks(colIndex)\"\n :key=\"childBlock.id\"\n :style=\"getBlockWrapperStyle(childBlock)\"\n >\n <!-- Recursive self-reference for nested sections -->\n <PreviewSectionBlock\n v-if=\"childBlock.type === 'section'\"\n :block=\"childBlock\"\n viewport=\"desktop\"\n />\n <component\n :is=\"getBlockComponent(childBlock)\"\n v-else\n :block=\"childBlock\"\n viewport=\"desktop\"\n />\n </div>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport ButtonBlock from \"./ButtonBlock.vue\";\nimport CustomBlock from \"./CustomBlock.vue\";\nimport DividerBlock from \"./DividerBlock.vue\";\nimport HtmlBlock from \"./HtmlBlock.vue\";\nimport ImageBlock from \"./ImageBlock.vue\";\nimport MenuBlock from \"./MenuBlock.vue\";\nimport SocialIconsBlock from \"./SocialIconsBlock.vue\";\nimport SpacerBlock from \"./SpacerBlock.vue\";\nimport TableBlock from \"./TableBlock.vue\";\nimport TitleBlock from \"./TitleBlock.vue\";\nimport ParagraphBlock from \"./ParagraphBlock.vue\";\nimport VideoBlock from \"./VideoBlock.vue\";\nimport {\n resolveBlockComponent,\n getBlockWrapperStyle,\n} from \"../../utils/blockComponentResolver\";\nimport type {\n Block,\n SectionBlock as SectionBlockType,\n} from \"@templatical/types\";\nimport { computed, inject, type Component } from \"vue\";\nimport { BLOCK_REGISTRY_KEY } from \"../../keys\";\n\nconst previewBlockComponentMap: Record<string, Component> = {\n title: TitleBlock,\n paragraph: ParagraphBlock,\n image: ImageBlock,\n video: VideoBlock,\n button: ButtonBlock,\n divider: DividerBlock,\n social: SocialIconsBlock,\n menu: MenuBlock,\n table: TableBlock,\n spacer: SpacerBlock,\n html: HtmlBlock,\n custom: CustomBlock,\n};\n\nconst props = defineProps<{\n block: SectionBlockType;\n viewport: \"desktop\";\n}>();\n\ndefineOptions({ name: \"PreviewSectionBlock\" });\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY, null);\n\nconst columnWidths = computed(() => {\n switch (props.block.columns) {\n case \"2\":\n return [\"50%\", \"50%\"];\n case \"3\":\n return [\"33.33%\", \"33.33%\", \"33.33%\"];\n case \"1-2\":\n return [\"33.33%\", \"66.67%\"];\n case \"2-1\":\n return [\"66.67%\", \"33.33%\"];\n default:\n return [\"100%\"];\n }\n});\n\nconst columns = computed(() => {\n const count = columnWidths.value.length;\n const children = [...props.block.children];\n while (children.length < count) {\n children.push([]);\n }\n return children.slice(0, count);\n});\n\nfunction getColumnBlocks(colIndex: number): Block[] {\n return columns.value[colIndex] || [];\n}\n\nfunction getBlockComponent(block: Block): Component | null {\n return resolveBlockComponent(block, blockRegistry, previewBlockComponentMap);\n}\n</script>\n\n<template>\n <div class=\"tpl:w-full\">\n <div class=\"tpl:flex tpl:gap-0\">\n <div\n v-for=\"(_, colIndex) in columns\"\n :key=\"colIndex\"\n :style=\"{ width: columnWidths[colIndex] }\"\n >\n <div\n v-for=\"childBlock in getColumnBlocks(colIndex)\"\n :key=\"childBlock.id\"\n :style=\"getBlockWrapperStyle(childBlock)\"\n >\n <!-- Recursive self-reference for nested sections -->\n <PreviewSectionBlock\n v-if=\"childBlock.type === 'section'\"\n :block=\"childBlock\"\n viewport=\"desktop\"\n />\n <component\n :is=\"getBlockComponent(childBlock)\"\n v-else\n :block=\"childBlock\"\n viewport=\"desktop\"\n />\n </div>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport ButtonBlock from \"./blocks/ButtonBlock.vue\";\nimport CustomBlock from \"./blocks/CustomBlock.vue\";\nimport DividerBlock from \"./blocks/DividerBlock.vue\";\nimport HtmlBlock from \"./blocks/HtmlBlock.vue\";\nimport ImageBlock from \"./blocks/ImageBlock.vue\";\nimport MenuBlock from \"./blocks/MenuBlock.vue\";\nimport PreviewSectionBlock from \"./blocks/PreviewSectionBlock.vue\";\nimport SocialIconsBlock from \"./blocks/SocialIconsBlock.vue\";\nimport SpacerBlock from \"./blocks/SpacerBlock.vue\";\nimport TableBlock from \"./blocks/TableBlock.vue\";\nimport TitleBlock from \"./blocks/TitleBlock.vue\";\nimport ParagraphBlock from \"./blocks/ParagraphBlock.vue\";\nimport VideoBlock from \"./blocks/VideoBlock.vue\";\nimport { BLOCK_REGISTRY_KEY, CONDITION_PREVIEW_KEY, EDITOR_KEY } from \"../keys\";\nimport {\n resolveBlockComponent,\n getBlockWrapperStyle,\n getDocumentStyle,\n} from \"../utils/blockComponentResolver\";\nimport {\n EMAIL_FRAME_WIDTH_TRANSITION,\n getEmailFrameWidth,\n} from \"../utils/emailFrameWidth\";\nimport type { Block, ViewportSize } from \"@templatical/types\";\nimport { computed, inject, type Component } from \"vue\";\n\nconst props = withDefaults(\n defineProps<{\n blocks: Block[];\n /**\n * Which viewport to render. Defaults to `desktop`, so the saved-blocks\n * surfaces — which have no viewport control — behave exactly as before.\n * The test-email dialog passes the user's choice so responsive blocks show\n * the variant a recipient on that device would receive.\n */\n viewport?: ViewportSize;\n }>(),\n { viewport: \"desktop\" },\n);\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY);\nconst editor = inject(EDITOR_KEY, null);\nconst conditionPreview = inject(CONDITION_PREVIEW_KEY, null);\n\n/**\n * Blocks a display condition currently excludes, so a preview never shows\n * content the recipient won't get. The canvas does the same via\n * `v-show=\"!conditionPreview?.isHidden(block.id)\"`.\n *\n * A no-op for the saved-blocks browser: entries there carry their *stored* ids,\n * which aren't in the current template, so nothing is tracked as hidden. It\n * bites where it should — the save dialog and the test-email preview, both of\n * which show blocks that are live on the canvas.\n */\nconst visibleBlocks = computed(() =>\n props.blocks.filter((block) => !conditionPreview?.isHidden(block.id)),\n);\n\n/**\n * Frame width, from the one helper the canvas and the scaled preview rows also\n * use — so all three agree by construction rather than by three constants that\n * happen to match. A template with a custom body width now previews at that\n * width instead of a flat 600.\n */\nconst frameWidth = computed(() =>\n getEmailFrameWidth(editor?.content.value.settings, props.viewport),\n);\n\n/**\n * The same document-level style the canvas applies, so a previewed block\n * renders identically to the canvas one: without it the font falls back to the\n * editor UI's and the link rules hit their unset defaults, dropping the\n * underline and the link colour.\n *\n * Read from the *current* template even in the saved-blocks browser, where the\n * previewed content came from elsewhere — a saved block stores only `Block[]`,\n * and the current settings are what it will actually look like once inserted.\n */\nconst documentStyle = computed(() =>\n editor ? getDocumentStyle(editor.content.value.settings) : {},\n);\n\nconst previewComponentMap: Record<string, Component> = {\n section: PreviewSectionBlock,\n title: TitleBlock,\n paragraph: ParagraphBlock,\n image: ImageBlock,\n video: VideoBlock,\n button: ButtonBlock,\n divider: DividerBlock,\n social: SocialIconsBlock,\n menu: MenuBlock,\n table: TableBlock,\n spacer: SpacerBlock,\n html: HtmlBlock,\n custom: CustomBlock,\n};\n\nfunction getBlockComponent(block: Block): Component | null {\n return resolveBlockComponent(block, blockRegistry, previewComponentMap);\n}\n</script>\n\n<template>\n <div\n data-testid=\"block-preview-canvas\"\n class=\"tpl:pointer-events-none tpl:mx-auto tpl:select-none tpl:rounded-lg\"\n :style=\"{\n width: `${frameWidth}px`,\n transition: EMAIL_FRAME_WIDTH_TRANSITION,\n backgroundColor: 'var(--tpl-canvas-bg)',\n boxShadow: 'var(--tpl-shadow-sm)',\n ...documentStyle,\n }\"\n >\n <div\n v-for=\"block in visibleBlocks\"\n :key=\"block.id\"\n :style=\"getBlockWrapperStyle(block)\"\n >\n <component\n :is=\"getBlockComponent(block)\"\n :block=\"block\"\n :viewport=\"viewport\"\n />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport ButtonBlock from \"./blocks/ButtonBlock.vue\";\nimport CustomBlock from \"./blocks/CustomBlock.vue\";\nimport DividerBlock from \"./blocks/DividerBlock.vue\";\nimport HtmlBlock from \"./blocks/HtmlBlock.vue\";\nimport ImageBlock from \"./blocks/ImageBlock.vue\";\nimport MenuBlock from \"./blocks/MenuBlock.vue\";\nimport PreviewSectionBlock from \"./blocks/PreviewSectionBlock.vue\";\nimport SocialIconsBlock from \"./blocks/SocialIconsBlock.vue\";\nimport SpacerBlock from \"./blocks/SpacerBlock.vue\";\nimport TableBlock from \"./blocks/TableBlock.vue\";\nimport TitleBlock from \"./blocks/TitleBlock.vue\";\nimport ParagraphBlock from \"./blocks/ParagraphBlock.vue\";\nimport VideoBlock from \"./blocks/VideoBlock.vue\";\nimport { BLOCK_REGISTRY_KEY, CONDITION_PREVIEW_KEY, EDITOR_KEY } from \"../keys\";\nimport {\n resolveBlockComponent,\n getBlockWrapperStyle,\n getDocumentStyle,\n} from \"../utils/blockComponentResolver\";\nimport {\n EMAIL_FRAME_WIDTH_TRANSITION,\n getEmailFrameWidth,\n} from \"../utils/emailFrameWidth\";\nimport type { Block, ViewportSize } from \"@templatical/types\";\nimport { computed, inject, type Component } from \"vue\";\n\nconst props = withDefaults(\n defineProps<{\n blocks: Block[];\n /**\n * Which viewport to render. Defaults to `desktop`, so the saved-blocks\n * surfaces — which have no viewport control — behave exactly as before.\n * The test-email dialog passes the user's choice so responsive blocks show\n * the variant a recipient on that device would receive.\n */\n viewport?: ViewportSize;\n }>(),\n { viewport: \"desktop\" },\n);\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY);\nconst editor = inject(EDITOR_KEY, null);\nconst conditionPreview = inject(CONDITION_PREVIEW_KEY, null);\n\n/**\n * Blocks a display condition currently excludes, so a preview never shows\n * content the recipient won't get. The canvas does the same via\n * `v-show=\"!conditionPreview?.isHidden(block.id)\"`.\n *\n * A no-op for the saved-blocks browser: entries there carry their *stored* ids,\n * which aren't in the current template, so nothing is tracked as hidden. It\n * bites where it should — the save dialog and the test-email preview, both of\n * which show blocks that are live on the canvas.\n */\nconst visibleBlocks = computed(() =>\n props.blocks.filter((block) => !conditionPreview?.isHidden(block.id)),\n);\n\n/**\n * Frame width, from the one helper the canvas and the scaled preview rows also\n * use — so all three agree by construction rather than by three constants that\n * happen to match. A template with a custom body width now previews at that\n * width instead of a flat 600.\n */\nconst frameWidth = computed(() =>\n getEmailFrameWidth(editor?.content.value.settings, props.viewport),\n);\n\n/**\n * The same document-level style the canvas applies, so a previewed block\n * renders identically to the canvas one: without it the font falls back to the\n * editor UI's and the link rules hit their unset defaults, dropping the\n * underline and the link colour.\n *\n * Read from the *current* template even in the saved-blocks browser, where the\n * previewed content came from elsewhere — a saved block stores only `Block[]`,\n * and the current settings are what it will actually look like once inserted.\n */\nconst documentStyle = computed(() =>\n editor ? getDocumentStyle(editor.content.value.settings) : {},\n);\n\nconst previewComponentMap: Record<string, Component> = {\n section: PreviewSectionBlock,\n title: TitleBlock,\n paragraph: ParagraphBlock,\n image: ImageBlock,\n video: VideoBlock,\n button: ButtonBlock,\n divider: DividerBlock,\n social: SocialIconsBlock,\n menu: MenuBlock,\n table: TableBlock,\n spacer: SpacerBlock,\n html: HtmlBlock,\n custom: CustomBlock,\n};\n\nfunction getBlockComponent(block: Block): Component | null {\n return resolveBlockComponent(block, blockRegistry, previewComponentMap);\n}\n</script>\n\n<template>\n <div\n data-testid=\"block-preview-canvas\"\n class=\"tpl:pointer-events-none tpl:mx-auto tpl:select-none tpl:rounded-lg\"\n :style=\"{\n width: `${frameWidth}px`,\n transition: EMAIL_FRAME_WIDTH_TRANSITION,\n backgroundColor: 'var(--tpl-canvas-bg)',\n boxShadow: 'var(--tpl-shadow-sm)',\n ...documentStyle,\n }\"\n >\n <div\n v-for=\"block in visibleBlocks\"\n :key=\"block.id\"\n :style=\"getBlockWrapperStyle(block)\"\n >\n <component\n :is=\"getBlockComponent(block)\"\n :block=\"block\"\n :viewport=\"viewport\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAwBA,IAAM,IAAsD;GAC1D,OAAO;GACP,WAAW;GACX,OAAO;GACP,OAAO;GACP,QAAQ;GACR,SAAS;GACT,QAAQ;GACR,MAAM;GACN,OAAO;GACP,QAAQ;GACR,MAAM;GACN,QAAQ;EACV,GAEM,IAAQ,GAOR,IAAgB,EAAO,GAAoB,IAAI,GAE/C,IAAe,QAAe;GAClC,QAAQ,EAAM,MAAM,SAApB;IACE,KAAK,KACH,OAAO,CAAC,OAAO,KAAK;IACtB,KAAK,KACH,OAAO;KAAC;KAAU;KAAU;IAAQ;IACtC,KAAK,OACH,OAAO,CAAC,UAAU,QAAQ;IAC5B,KAAK,OACH,OAAO,CAAC,UAAU,QAAQ;IAC5B,SACE,OAAO,CAAC,MAAM;GAClB;EACF,CAAC,GAEK,IAAU,QAAe;GAC7B,IAAM,IAAQ,EAAa,MAAM,QAC3B,IAAW,CAAC,GAAG,EAAM,MAAM,QAAQ;GACzC,OAAO,EAAS,SAAS,IACvB,EAAS,KAAK,CAAC,CAAC;GAElB,OAAO,EAAS,MAAM,GAAG,CAAK;EAChC,CAAC;EAED,SAAS,EAAgB,GAA2B;GAClD,OAAO,EAAQ,MAAM,MAAa,CAAC;EACrC;EAEA,SAAS,EAAkB,GAAgC;GACzD,OAAO,EAAsB,GAAO,GAAe,CAAwB;EAC7E;;;eAIE,EA2BM,OA3BN,GA2BM,CA1BJ,EAyBM,OAzBN,GAyBM,EAAA,EAAA,EAAA,GAxBJ,EAuBM,GAAA,MAAA,EAtBoB,EAAA,QAAhB,GAAG,YADb,EAuBM,OAAA;IArBH,KAAK;IACL,OAAK,EAAA,EAAA,OAAW,EAAA,MAAa,GAAQ,CAAA;eAEtC,EAiBM,GAAA,MAAA,EAhBiB,EAAgB,CAAQ,IAAtC,YADT,EAiBM,OAAA;IAfH,KAAK,EAAW;IAChB,OAAK,EAAE,EAAA,CAAA,CAAoB,CAAC,CAAU,CAAA;OAI/B,EAAW,SAAI,aAAA,EAAA,GADvB,EAIE,GAAA;;IAFC,OAAO;IACR,UAAS;mCAEX,EAKE,EAJK,EAAkB,CAAU,CAAA,GAAA;;IAEhC,OAAO;IACR,UAAS;;;;;;;;;;;EE7ErB,IAAM,IAAQ,GAcR,IAAgB,EAAO,CAAkB,GACzC,IAAS,EAAO,GAAY,IAAI,GAChC,IAAmB,EAAO,GAAuB,IAAI,GAYrD,IAAgB,QACpB,EAAM,OAAO,QAAQ,MAAU,CAAC,GAAkB,SAAS,EAAM,EAAE,CAAC,CACtE,GAQM,IAAa,QACjB,EAAmB,GAAQ,QAAQ,MAAM,UAAU,EAAM,QAAQ,CACnE,GAYM,IAAgB,QACpB,IAAS,EAAiB,EAAO,QAAQ,MAAM,QAAQ,IAAI,CAAC,CAC9D,GAEM,IAAiD;GACrD,SAAS;GACT,OAAO;GACP,WAAW;GACX,OAAO;GACP,OAAO;GACP,QAAQ;GACR,SAAS;GACT,QAAQ;GACR,MAAM;GACN,OAAO;GACP,QAAQ;GACR,MAAM;GACN,QAAQ;EACV;EAEA,SAAS,EAAkB,GAAgC;GACzD,OAAO,EAAsB,GAAO,GAAe,CAAmB;EACxE;yBAIE,EAsBM,OAAA;GArBJ,eAAY;GACZ,OAAM;GACL,OAAK,EAAA;cAAoB,EAAA,MAAU;gBAAwB,EAAA,CAAA;;;OAA+H,EAAA;;cAQ3L,EAUM,GAAA,MAAA,EATY,EAAA,QAAT,YADT,EAUM,OAAA;GARH,KAAK,EAAM;GACX,OAAK,EAAE,EAAA,CAAA,CAAoB,CAAC,CAAK,CAAA;YAElC,EAIE,EAHK,EAAkB,CAAK,CAAA,GAAA;GACpB;GACP,UAAU,EAAA"}