@templatical/editor 0.25.2 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-JLsbPnsH.js → AiChatSidebar-c-3yyjN1.js} +8 -8
- package/dist/{AiFeatureMenu-BvA-lViN.js → AiFeatureMenu-B-COyG7k.js} +4 -4
- package/dist/{BlockIssueBadge-Cf0-GC3o.js → BlockIssueBadge-Buk3_6QF.js} +2 -2
- package/dist/{BlockPreviewCanvas-CnJIM5TO.js → BlockPreviewCanvas-CJPHGI93.js} +1 -1
- package/dist/{CloudEditor-Caq7z4-7.js → CloudEditor-BdSQ8hfv.js} +19 -19
- package/dist/{CollaboratorBar-BFz4LgA0.js → CollaboratorBar-mGoi6yye.js} +2 -2
- package/dist/{ColorPicker-B5xXWWX5.js → ColorPicker-ClETsjA3.js} +1 -1
- package/dist/{CommentsSidebar-CGihWwn9.js → CommentsSidebar-CdRCCSDD.js} +10 -10
- package/dist/{CountdownToolbar-DpNCZAUI.js → CountdownToolbar-CBE9wRaV.js} +2 -2
- package/dist/{DesignReferenceSidebar-CiIHHiil.js → DesignReferenceSidebar-CgYkySre.js} +6 -6
- package/dist/{IssuesPanel-CUkmAC_S.js → IssuesPanel-Do7RLXsP.js} +5 -5
- package/dist/{MergeTagModeToggle-C6nS3qri.js → MergeTagModeToggle-hAJgIKhw.js} +3 -3
- package/dist/{MergeTagSuggestion-98fAcuM-.js → MergeTagSuggestion-BJ43ihWR.js} +9 -9
- package/dist/{NumberWithSuffix-DB-1GNvx.js → NumberWithSuffix-D37ZWiZh.js} +1 -1
- package/dist/{ParagraphEditor-NgW-T9YV.js → ParagraphEditor-DBG63S70.js} +19 -19
- package/dist/{RichTextEditorContent-CN7OVR6u.js → RichTextEditorContent-fbYJXAio.js} +3 -3
- package/dist/{SaveBlockDialog-lgcmhAsO.js → SaveBlockDialog-Dq9UVihi.js} +6 -6
- package/dist/{SavedBlocksBrowserModal-3u247V2z.js → SavedBlocksBrowserModal-CtFG4zeV.js} +7 -7
- package/dist/{SavedBlocksPanels-Dh6dABJt.js → SavedBlocksPanels-DNVdso_W.js} +1 -1
- package/dist/{SavedBlocksPickBar-Bo82D3Qy.js → SavedBlocksPickBar-Cv4dIpP-.js} +2 -2
- package/dist/{SnapshotHistory-Dsb1i40w.js → SnapshotHistory-DsOtMHOV.js} +11 -11
- package/dist/{TemplateScoringPanel-Bzd_YSag.js → TemplateScoringPanel-BZUsb3FD.js} +10 -10
- package/dist/{TestEmailModal-DvqDTOcO.js → TestEmailModal-CIwqtGfr.js} +7 -7
- package/dist/{TestEmailPanel-BXoVnAqu.js → TestEmailPanel-l6LDmBGM.js} +1 -1
- package/dist/{TitleEditor-DWSi998C.js → TitleEditor-imoBUynh.js} +8 -8
- package/dist/{TplModal-DKn0h2qe.js → TplModal-DDDHcoir.js} +1 -1
- package/dist/{blockTypeIcons-DKlza6aR.js → blockTypeIcons-CfLN4A6t.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiChatSidebar-BY1Iy-e8.js → AiChatSidebar-BHqNxNcX.js} +35 -35
- package/dist/cdn/chunks/{AiChatSidebar-BY1Iy-e8.js.map → AiChatSidebar-BHqNxNcX.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-BS4Rek6j.js → AiFeatureMenu-D2AIDwEG.js} +11 -11
- package/dist/cdn/chunks/{AiFeatureMenu-BS4Rek6j.js.map → AiFeatureMenu-D2AIDwEG.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-BcIQUe_Q.js → BlockIssueBadge-BEEY9o2o.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-BcIQUe_Q.js.map → BlockIssueBadge-BEEY9o2o.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-oND1iXLL.js → BlockPreviewCanvas-DH5ULGkw.js} +22 -22
- package/dist/cdn/chunks/{BlockPreviewCanvas-oND1iXLL.js.map → BlockPreviewCanvas-DH5ULGkw.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-BaqiFbf0.js → CloudEditor-C0nB1JfD.js} +65 -65
- package/dist/cdn/chunks/{CloudEditor-BaqiFbf0.js.map → CloudEditor-C0nB1JfD.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-DF02nTwF.js → CollaboratorBar-f6Ni7KNH.js} +12 -12
- package/dist/cdn/chunks/{CollaboratorBar-DF02nTwF.js.map → CollaboratorBar-f6Ni7KNH.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-BXH44v2H.js → ColorPicker-W_UyiVGc.js} +131 -131
- package/dist/cdn/chunks/{ColorPicker-BXH44v2H.js.map → ColorPicker-W_UyiVGc.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-B9bWvvbl.js → CommentsSidebar-BLRZRSSC.js} +112 -112
- package/dist/cdn/chunks/{CommentsSidebar-B9bWvvbl.js.map → CommentsSidebar-BLRZRSSC.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-BTpRd0Hn.js → CountdownBlock-vLTkTI9e.js} +11 -11
- package/dist/cdn/chunks/{CountdownBlock-BTpRd0Hn.js.map → CountdownBlock-vLTkTI9e.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CW10rbWt.js → CountdownToolbar-DPjcgcVR.js} +41 -41
- package/dist/cdn/chunks/{CountdownToolbar-CW10rbWt.js.map → CountdownToolbar-DPjcgcVR.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-BXjH47QC.js → DesignReferenceSidebar-DBoEBKxQ.js} +28 -28
- package/dist/cdn/chunks/{DesignReferenceSidebar-BXjH47QC.js.map → DesignReferenceSidebar-DBoEBKxQ.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-DStHCHfr.js → IssuesPanel-DKTS4QVb.js} +32 -32
- package/dist/cdn/chunks/{IssuesPanel-DStHCHfr.js.map → IssuesPanel-DKTS4QVb.js.map} +1 -1
- package/dist/cdn/chunks/{LoadingTrack-DQowK3MV.js → LoadingTrack-C52ZGL5q.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-DQowK3MV.js.map → LoadingTrack-C52ZGL5q.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BCmQg4Qe.js → MergeTagModeToggle-D8iKvz7v.js} +20 -20
- package/dist/cdn/chunks/{MergeTagModeToggle-BCmQg4Qe.js.map → MergeTagModeToggle-D8iKvz7v.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagSuggestion-BgExdloL.js → MergeTagSuggestion-Dn8dExNa.js} +18 -18
- package/dist/cdn/chunks/{MergeTagSuggestion-BgExdloL.js.map → MergeTagSuggestion-Dn8dExNa.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-BANVbpT0.js → NumberWithSuffix-BXrRdfq1.js} +22 -22
- package/dist/cdn/chunks/{NumberWithSuffix-BANVbpT0.js.map → NumberWithSuffix-BXrRdfq1.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DqilB4_f.js → ParagraphEditor-Cuc83Blj.js} +43 -43
- package/dist/cdn/chunks/{ParagraphEditor-DqilB4_f.js.map → ParagraphEditor-Cuc83Blj.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-BeJx4LVH.js → RichTextEditorContent-DtL49Jpo.js} +20 -20
- package/dist/cdn/chunks/{RichTextEditorContent-BeJx4LVH.js.map → RichTextEditorContent-DtL49Jpo.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-Dm31xRZy.js → SaveBlockDialog-B8KHhVkI.js} +43 -43
- package/dist/cdn/chunks/{SaveBlockDialog-Dm31xRZy.js.map → SaveBlockDialog-B8KHhVkI.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-Tp37b4y7.js → SavedBlocksBrowserModal-B-sjsIJv.js} +62 -62
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-Tp37b4y7.js.map → SavedBlocksBrowserModal-B-sjsIJv.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-ElerTTa_.js → SavedBlocksPanels-Bb-eDMAh.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-ElerTTa_.js.map → SavedBlocksPanels-Bb-eDMAh.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-QHJ-Mjx0.js → SavedBlocksPickBar-GudFfXa4.js} +12 -12
- package/dist/cdn/chunks/{SavedBlocksPickBar-QHJ-Mjx0.js.map → SavedBlocksPickBar-GudFfXa4.js.map} +1 -1
- package/dist/cdn/chunks/{SnapshotHistory-jogWGLB-.js → SnapshotHistory-Srpzt2na.js} +26 -26
- package/dist/cdn/chunks/{SnapshotHistory-jogWGLB-.js.map → SnapshotHistory-Srpzt2na.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-B2XIOTl-.js → TemplateScoringPanel-NucRtAP0.js} +34 -34
- package/dist/cdn/chunks/{TemplateScoringPanel-B2XIOTl-.js.map → TemplateScoringPanel-NucRtAP0.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-BcPjQygV.js → TestEmailModal-DLeoJqaJ.js} +31 -31
- package/dist/cdn/chunks/{TestEmailModal-BcPjQygV.js.map → TestEmailModal-DLeoJqaJ.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-1zxRa00s.js → TestEmailPanel-Dr7Dkq2P.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-1zxRa00s.js.map → TestEmailPanel-Dr7Dkq2P.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DTrmublj.js → TitleEditor-DzYRr18C.js} +35 -35
- package/dist/cdn/chunks/{TitleEditor-DTrmublj.js.map → TitleEditor-DzYRr18C.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-By50gtwa.js → TplModal-byw7-3wg.js} +17 -17
- package/dist/cdn/chunks/{TplModal-By50gtwa.js.map → TplModal-byw7-3wg.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-BhFhHuFt.js → blockTypeIcons-FXlMM3PL.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-BhFhHuFt.js.map → blockTypeIcons-FXlMM3PL.js.map} +1 -1
- package/dist/cdn/chunks/{cloud-B0f7Ub8f.js → cloud-CuItCnN_.js} +3 -3
- package/dist/cdn/chunks/{cloud-B0f7Ub8f.js.map → cloud-CuItCnN_.js.map} +1 -1
- package/dist/cdn/chunks/{dist-H51neg3K.js → dist-B2HKGHnc.js} +3 -3
- package/dist/cdn/chunks/{dist-H51neg3K.js.map → dist-B2HKGHnc.js.map} +1 -1
- package/dist/cdn/chunks/{dist-B4VIlp1g.js → dist-C6z8AjBC.js} +2 -2
- package/dist/cdn/chunks/{dist-B4VIlp1g.js.map → dist-C6z8AjBC.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-Z4XXmbPC.js → draggable-DCs9qL-b.js} +2 -2
- package/dist/cdn/chunks/{draggable-Z4XXmbPC.js.map → draggable-DCs9qL-b.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-Dq0D79tq.js → extensions-B7laxHjs.js} +22 -22
- package/dist/cdn/chunks/{extensions-Dq0D79tq.js.map → extensions-B7laxHjs.js.map} +1 -1
- package/dist/cdn/chunks/{icons-C_kRN0_C.js → icons-CvYN6zrM.js} +8 -8
- package/dist/cdn/chunks/{icons-C_kRN0_C.js.map → icons-CvYN6zrM.js.map} +1 -1
- package/dist/cdn/chunks/{keys-DsoX52o_.js → keys-Cmc2Yl3D.js} +2 -2
- package/dist/cdn/chunks/{keys-DsoX52o_.js.map → keys-Cmc2Yl3D.js.map} +1 -1
- package/dist/cdn/chunks/{liquid.browser-DrGys_ek.js → liquid.browser-UlAOKBjI.js} +99 -91
- package/dist/cdn/chunks/liquid.browser-UlAOKBjI.js.map +1 -0
- package/dist/cdn/chunks/{src-Aea1Vl1H.js → src-BYKYmEOD.js} +7 -6
- package/dist/cdn/chunks/src-BYKYmEOD.js.map +1 -0
- package/dist/cdn/chunks/{src-_GNJgPcS.js → src-Bi-Qhtfs.js} +2 -2
- package/dist/cdn/chunks/{src-_GNJgPcS.js.map → src-Bi-Qhtfs.js.map} +1 -1
- package/dist/cdn/chunks/{src-CRvTVX4F.js → src-C0N74uvF.js} +201 -201
- package/dist/cdn/chunks/{src-CRvTVX4F.js.map → src-C0N74uvF.js.map} +1 -1
- package/dist/cdn/chunks/{src-CZjSXPYq.js → src-EKTTBQ0y.js} +3 -2
- package/dist/cdn/chunks/src-EKTTBQ0y.js.map +1 -0
- package/dist/cdn/chunks/{styles-znpPfrFd.js → styles-C7s-VtJi.js} +1112 -1094
- package/dist/cdn/chunks/styles-C7s-VtJi.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C5vzWlHv.js → tiptap-C44S1Cmh.js} +3480 -2806
- package/dist/cdn/chunks/tiptap-C44S1Cmh.js.map +1 -0
- package/dist/cdn/chunks/{useAliveFlag-4IDYQRNu.js → useAliveFlag-Dxwgo6P4.js} +2 -2
- package/dist/cdn/chunks/{useAliveFlag-4IDYQRNu.js.map → useAliveFlag-Dxwgo6P4.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-D4JpHTPk.js → useCloudI18n-8wkJtuJD.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-D4JpHTPk.js.map → useCloudI18n-8wkJtuJD.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorCore-BMXBmdd8.js → useEditorCore-C_nUXiph.js} +268 -268
- package/dist/cdn/chunks/useEditorCore-C_nUXiph.js.map +1 -0
- package/dist/cdn/chunks/{useI18n-BvcEYzrI.js → useI18n-UMs0F71x.js} +3 -3
- package/dist/cdn/chunks/{useI18n-BvcEYzrI.js.map → useI18n-UMs0F71x.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-BSdxMUzg.js → useMergeTag-CPa_9VOq.js} +4 -4
- package/dist/cdn/chunks/{useMergeTag-BSdxMUzg.js.map → useMergeTag-CPa_9VOq.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-ig-71caO.js → usePopoverPosition-cf8Y-ynK.js} +3 -3
- package/dist/cdn/chunks/{usePopoverPosition-ig-71caO.js.map → usePopoverPosition-cf8Y-ynK.js.map} +1 -1
- package/dist/cdn/editor.js +47 -47
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-COV27dGb.js → check-On4TSac-.js} +1 -1
- package/dist/{chevron-down-vsU88vcr.js → chevron-down-69EiBGoB.js} +1 -1
- package/dist/{chevron-up-RrZ0Rjn9.js → chevron-up-Dh3MG1Dw.js} +1 -1
- package/dist/{circle-alert-B6GlHmmi.js → circle-alert-cilwzafX.js} +1 -1
- package/dist/{clock-egOt8zjQ.js → clock-Dt0APH92.js} +1 -1
- package/dist/{cloud-D-2StbvU.js → cloud-C7-FhzMc.js} +1 -1
- package/dist/{createLucideIcon-D6cqT5Pm.js → createLucideIcon-C8WzBYCv.js} +2 -2
- package/dist/dist-6YJAWMuf.js +5 -0
- package/dist/dist-8vlm9kfO.js +5 -0
- package/dist/{dist-DHwnYYx0.js → dist-BImfm-46.js} +2 -2
- package/dist/{dist-DzzTB4eE.js → dist-C08jiemd.js} +7 -7
- package/dist/{dist-CqV4XslQ.js → dist-C27SeFL5.js} +15 -15
- package/dist/{dist-MwT7T6Xp.js → dist-CYx-E82k.js} +2 -2
- package/dist/{dist-CHxPjcxA.js → dist-ChYLhoJ4.js} +2143 -1583
- package/dist/{dist-UkG5ZJ1P.js → dist-Cl8J0IES.js} +258 -172
- package/dist/{dist-CQ0fVBQ3.js → dist-D5zCZFdU.js} +2 -1
- package/dist/{dist-D4GoAr2g.js → dist-DMJRSouD.js} +464 -436
- package/dist/{dist-GUZZpDK3.js → dist-DfpeSdmE.js} +2 -2
- package/dist/{dist-Du95Y9M3.js → dist-M7m1lYRe.js} +47 -47
- package/dist/{dist-vpuiQ7_Q.js → dist-g6cbzhZW.js} +2 -2
- package/dist/{extensions-y6KjLr9t.js → extensions-CxwhoG8v.js} +16 -16
- package/dist/{image-up-CycES-MQ.js → image-up-Ceggh_R3.js} +1 -1
- package/dist/{info-BUdvm046.js → info-DO5odBcZ.js} +1 -1
- package/dist/{liquid.browser-Di5zMIEx.js → liquid.browser-B-rGrnrQ.js} +98 -90
- package/dist/{list-checks-BAeuuATD.js → list-checks-BSkPKbuI.js} +1 -1
- package/dist/{loader-circle-L5yuAx_j.js → loader-circle-bO7o7_HD.js} +1 -1
- package/dist/{message-circle-DRdaapVc.js → message-circle-BEkAk65X.js} +1 -1
- package/dist/{pencil-BfErVPf_.js → pencil-t6m0EtKL.js} +1 -1
- package/dist/{refresh-cw-D0PYatER.js → refresh-cw-CkOYVzK5.js} +1 -1
- package/dist/{scan-line-Byi3fJcr.js → scan-line-DwSVj25O.js} +1 -1
- package/dist/{send-DuyNexMY.js → send-CWsWN8PQ.js} +1 -1
- package/dist/{shield-check-BkkN_1qw.js → shield-check-qje8Kufw.js} +1 -1
- package/dist/{sparkles-DAw2sBXk.js → sparkles-DumaWRW-.js} +1 -1
- package/dist/{styles-BzwheHH_.js → styles-C_slTGwp.js} +446 -428
- package/dist/templatical-editor.js +9 -9
- package/dist/{text-align-start-Ba3xJKn6.js → text-align-start-Ir8Ah4mT.js} +1 -1
- package/dist/{trash-2-CapEBXBI.js → trash-2-CklAFCmO.js} +1 -1
- package/dist/{triangle-alert-52pdw8jI.js → triangle-alert-BBi4n93g.js} +1 -1
- package/dist/{upload-oAgigC31.js → upload-sVqqppuv.js} +1 -1
- package/dist/{useEditorCore-BhjEMSeE.js → useEditorCore-r4gWzCBA.js} +889 -889
- package/dist/{useMergeTag-DTSOQnyr.js → useMergeTag-C-_WxrgL.js} +1 -1
- package/dist/{x-DvBgbDuf.js → x-Mby7KlhS.js} +1 -1
- package/package.json +22 -22
- package/dist/cdn/chunks/liquid.browser-DrGys_ek.js.map +0 -1
- package/dist/cdn/chunks/src-Aea1Vl1H.js.map +0 -1
- package/dist/cdn/chunks/src-CZjSXPYq.js.map +0 -1
- package/dist/cdn/chunks/styles-znpPfrFd.js.map +0 -1
- package/dist/cdn/chunks/tiptap-C5vzWlHv.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-BMXBmdd8.js.map +0 -1
- package/dist/dist-B56SufAv.js +0 -5
- package/dist/dist-BQZkRg05.js +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-B0aSnxlc.js";
|
|
2
|
-
import { I as t, L as n, M as r, N as i, P as a, T as o,
|
|
3
|
-
import { _ as h, a as g, c as _, d as v, f as y, h as b, i as x, k as S, m as C, n as w, p as T, r as E, u as D, v as O, y as k } from "./useEditorCore-
|
|
4
|
-
import { W as A, f as j, g as M, k as N, s as P } from "./keys-
|
|
2
|
+
import { I as t, L as n, M as r, N as i, P as a, T as o, ct as s, f as c, g as l, it as u, m as d, p as f, u as p, x as m } from "./draggable-DCs9qL-b.js";
|
|
3
|
+
import { _ as h, a as g, c as _, d as v, f as y, h as b, i as x, k as S, m as C, n as w, p as T, r as E, u as D, v as O, y as k } from "./useEditorCore-C_nUXiph.js";
|
|
4
|
+
import { W as A, f as j, g as M, k as N, s as P } from "./keys-Cmc2Yl3D.js";
|
|
5
5
|
import { n as F, t as I } from "./emailFrameWidth-BmFCN2dp.js";
|
|
6
6
|
//#region src/components/blocks/PreviewSectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var L = { class: "tpl:w-full" }, R = { class: "tpl:flex tpl:gap-0" }, z = /* @__PURE__ */ m({
|
|
@@ -25,7 +25,7 @@ var L = { class: "tpl:w-full" }, R = { class: "tpl:flex tpl:gap-0" }, z = /* @__
|
|
|
25
25
|
spacer: x,
|
|
26
26
|
html: h,
|
|
27
27
|
custom: k
|
|
28
|
-
}, m = e, v = o(P, null), A =
|
|
28
|
+
}, m = e, v = o(P, null), A = c(() => {
|
|
29
29
|
switch (m.block.columns) {
|
|
30
30
|
case "2": return ["50%", "50%"];
|
|
31
31
|
case "3": return [
|
|
@@ -37,7 +37,7 @@ var L = { class: "tpl:w-full" }, R = { class: "tpl:flex tpl:gap-0" }, z = /* @__
|
|
|
37
37
|
case "2-1": return ["66.67%", "33.33%"];
|
|
38
38
|
default: return ["100%"];
|
|
39
39
|
}
|
|
40
|
-
}), j =
|
|
40
|
+
}), j = c(() => {
|
|
41
41
|
let e = A.value.length, t = [...m.block.children];
|
|
42
42
|
for (; t.length < e;) t.push([]);
|
|
43
43
|
return t.slice(0, e);
|
|
@@ -50,17 +50,17 @@ var L = { class: "tpl:w-full" }, R = { class: "tpl:flex tpl:gap-0" }, z = /* @__
|
|
|
50
50
|
}
|
|
51
51
|
return (e, i) => {
|
|
52
52
|
let o = t("PreviewSectionBlock", !0);
|
|
53
|
-
return r(),
|
|
53
|
+
return r(), l("div", L, [f("div", R, [(r(!0), l(p, null, a(j.value, (e, t) => (r(), l("div", {
|
|
54
54
|
key: t,
|
|
55
|
-
style:
|
|
56
|
-
}, [(r(!0),
|
|
55
|
+
style: s({ width: A.value[t] })
|
|
56
|
+
}, [(r(!0), l(p, null, a(M(t), (e) => (r(), l("div", {
|
|
57
57
|
key: e.id,
|
|
58
|
-
style:
|
|
59
|
-
}, [e.type === "section" ? (r(),
|
|
58
|
+
style: s(u(D)(e))
|
|
59
|
+
}, [e.type === "section" ? (r(), d(o, {
|
|
60
60
|
key: 0,
|
|
61
61
|
block: e,
|
|
62
62
|
viewport: "desktop"
|
|
63
|
-
}, null, 8, ["block"])) : (r(),
|
|
63
|
+
}, null, 8, ["block"])) : (r(), d(n(N(e)), {
|
|
64
64
|
key: 1,
|
|
65
65
|
block: e,
|
|
66
66
|
viewport: "desktop"
|
|
@@ -78,9 +78,9 @@ var L = { class: "tpl:w-full" }, R = { class: "tpl:flex tpl:gap-0" }, z = /* @__
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
setup(e) {
|
|
81
|
-
let t = e,
|
|
82
|
-
i(A,
|
|
83
|
-
let B =
|
|
81
|
+
let t = e, f = o(P), m = o(M, null), L = o(j, null), R = o(N, null);
|
|
82
|
+
i(A, c(() => R?.value ?? !1));
|
|
83
|
+
let B = c(() => t.applyConditionFilter ? t.blocks.filter((e) => !L?.isHidden(e.id)) : t.blocks), V = c(() => F(m?.content.value.settings, t.viewport)), H = c(() => m ? v(m.content.value.settings) : {}), U = {
|
|
84
84
|
section: z,
|
|
85
85
|
title: _,
|
|
86
86
|
paragraph: T,
|
|
@@ -96,22 +96,22 @@ var L = { class: "tpl:w-full" }, R = { class: "tpl:flex tpl:gap-0" }, z = /* @__
|
|
|
96
96
|
custom: k
|
|
97
97
|
};
|
|
98
98
|
function W(e) {
|
|
99
|
-
return y(e,
|
|
99
|
+
return y(e, f, U);
|
|
100
100
|
}
|
|
101
|
-
return (t, i) => (r(),
|
|
101
|
+
return (t, i) => (r(), l("div", {
|
|
102
102
|
"data-testid": "block-preview-canvas",
|
|
103
103
|
class: "tpl:pointer-events-none tpl:mx-auto tpl:select-none tpl:rounded-lg",
|
|
104
|
-
style:
|
|
104
|
+
style: s({
|
|
105
105
|
width: `${V.value}px`,
|
|
106
|
-
transition:
|
|
106
|
+
transition: u(I),
|
|
107
107
|
backgroundColor: "var(--tpl-canvas-bg)",
|
|
108
108
|
boxShadow: "var(--tpl-shadow-sm)",
|
|
109
109
|
...H.value
|
|
110
110
|
})
|
|
111
|
-
}, [(r(!0),
|
|
111
|
+
}, [(r(!0), l(p, null, a(B.value, (t) => (r(), l("div", {
|
|
112
112
|
key: t.id,
|
|
113
|
-
style:
|
|
114
|
-
}, [(r(),
|
|
113
|
+
style: s(u(D)(t))
|
|
114
|
+
}, [(r(), d(n(W(t)), {
|
|
115
115
|
block: t,
|
|
116
116
|
viewport: e.viewport
|
|
117
117
|
}, null, 8, ["block", "viewport"]))], 4))), 128))], 4));
|
|
@@ -120,4 +120,4 @@ var L = { class: "tpl:w-full" }, R = { class: "tpl:flex tpl:gap-0" }, z = /* @__
|
|
|
120
120
|
//#endregion
|
|
121
121
|
export { V as n, H as t };
|
|
122
122
|
|
|
123
|
-
//# sourceMappingURL=BlockPreviewCanvas-
|
|
123
|
+
//# sourceMappingURL=BlockPreviewCanvas-DH5ULGkw.js.map
|
package/dist/cdn/chunks/{BlockPreviewCanvas-oND1iXLL.js.map → BlockPreviewCanvas-DH5ULGkw.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockPreviewCanvas-oND1iXLL.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 {\n BLOCK_REGISTRY_KEY,\n CONDITION_PREVIEW_KEY,\n EDITOR_KEY,\n MERGE_TAG_SAMPLE_MODE_KEY,\n USE_MERGE_TAG_SAMPLES_KEY,\n} 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, provide, 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 * Whether the hand-toggled display-condition filter still applies here.\n * `false` where a resolver owns the preview: it has already evaluated every\n * condition against real data, so layering a manual hide on top would veto\n * the answer that was asked for.\n *\n * A prop rather than an injected `PREVIEW_RESOLUTION_KEY` read, because the\n * test-email dialog builds its *own* resolution instance (keyed to the\n * selected recipient) — injecting would consult the shared canvas instance\n * and get the wrong answer.\n */\n applyConditionFilter?: boolean;\n }>(),\n { viewport: \"desktop\", applyConditionFilter: true },\n);\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY);\nconst editor = inject(EDITOR_KEY, null);\nconst conditionPreview = inject(CONDITION_PREVIEW_KEY, null);\n\n/**\n * This canvas is only ever a preview — nothing here is editable — so it honours\n * the user's mode directly, with no `previewMode` gate of the kind `Canvas.vue`\n * needs. Re-provided rather than left to inherit, because a `BlockPreviewCanvas`\n * inside a dialog may sit under an editing `Canvas` that provides `false`.\n */\nconst mergeTagSampleMode = inject(MERGE_TAG_SAMPLE_MODE_KEY, null);\nprovide(\n USE_MERGE_TAG_SAMPLES_KEY,\n computed(() => mergeTagSampleMode?.value ?? false),\n);\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 *\n * Skipped entirely when `applyConditionFilter` is false — see the prop.\n */\nconst visibleBlocks = computed(() =>\n props.applyConditionFilter\n ? props.blocks.filter((block) => !conditionPreview?.isHidden(block.id))\n : props.blocks,\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 {\n BLOCK_REGISTRY_KEY,\n CONDITION_PREVIEW_KEY,\n EDITOR_KEY,\n MERGE_TAG_SAMPLE_MODE_KEY,\n USE_MERGE_TAG_SAMPLES_KEY,\n} 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, provide, 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 * Whether the hand-toggled display-condition filter still applies here.\n * `false` where a resolver owns the preview: it has already evaluated every\n * condition against real data, so layering a manual hide on top would veto\n * the answer that was asked for.\n *\n * A prop rather than an injected `PREVIEW_RESOLUTION_KEY` read, because the\n * test-email dialog builds its *own* resolution instance (keyed to the\n * selected recipient) — injecting would consult the shared canvas instance\n * and get the wrong answer.\n */\n applyConditionFilter?: boolean;\n }>(),\n { viewport: \"desktop\", applyConditionFilter: true },\n);\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY);\nconst editor = inject(EDITOR_KEY, null);\nconst conditionPreview = inject(CONDITION_PREVIEW_KEY, null);\n\n/**\n * This canvas is only ever a preview — nothing here is editable — so it honours\n * the user's mode directly, with no `previewMode` gate of the kind `Canvas.vue`\n * needs. Re-provided rather than left to inherit, because a `BlockPreviewCanvas`\n * inside a dialog may sit under an editing `Canvas` that provides `false`.\n */\nconst mergeTagSampleMode = inject(MERGE_TAG_SAMPLE_MODE_KEY, null);\nprovide(\n USE_MERGE_TAG_SAMPLES_KEY,\n computed(() => mergeTagSampleMode?.value ?? false),\n);\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 *\n * Skipped entirely when `applyConditionFilter` is false — see the prop.\n */\nconst visibleBlocks = computed(() =>\n props.applyConditionFilter\n ? props.blocks.filter((block) => !conditionPreview?.isHidden(block.id))\n : props.blocks,\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;;;GAIE,OAAA,EAAA,GAAA,EA2BM,OA3BN,GA2BM,CA1BJ,EAyBM,OAzBN,GAyBM,EAxBJ,EAAA,EAAA,GAAA,EAuBM,GAAA,MAAA,EAtBoB,EAAA,QAAhB,GAAG,OADb,EAAA,GAAA,EAuBM,OAAA;IArBH,KAAK;IACL,OAAK,EAAA,EAAA,OAAW,EAAA,MAAa,GAAQ,CAAA;GAEtC,GAAA,EAAA,EAAA,EAAA,GAAA,EAiBM,GAAA,MAAA,EAhBiB,EAAgB,CAAQ,IAAtC,OADT,EAAA,GAAA,EAiBM,OAAA;IAfH,KAAK,EAAW;IAChB,OAAK,EAAE,EAAA,CAAA,CAAoB,CAAC,CAAU,CAAA;GAI/B,GAAA,CAAA,EAAW,SAAI,aADvB,EAAA,GAAA,EAIE,GAAA;;IAFC,OAAO;IACR,UAAS;GAEX,GAAA,MAAA,GAAA,CAAA,OAAA,CAAA,MAAA,EAAA,GAAA,EAKE,EAJK,EAAkB,CAAU,CAAA,GAAA;;IAEhC,OAAO;IACR,UAAS;;;;;;;;;;;;;;;EEvErB,IAAM,IAAQ,GA0BR,IAAgB,EAAO,CAAkB,GACzC,IAAS,EAAO,GAAY,IAAI,GAChC,IAAmB,EAAO,GAAuB,IAAI,GAQrD,IAAqB,EAAO,GAA2B,IAAI;EACjE,EACE,GACA,QAAe,GAAoB,SAAS,EAAK,CACnD;EAcA,IAAM,IAAgB,QACpB,EAAM,uBACF,EAAM,OAAO,QAAQ,MAAU,CAAC,GAAkB,SAAS,EAAM,EAAE,CAAC,IACpE,EAAM,MACZ,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;oBAIE,EAAA,GAAA,EAsBM,OAAA;GArBJ,eAAY;GACZ,OAAM;GACL,OAAK,EAAA;IAAoB,OAAA,GAAA,EAAA,MAAU;IAAwB,YAAA,EAAA,CAAA;;;IAA+H,GAAA,EAAA;;EAQ3L,GAAA,EAAA,EAAA,EAAA,GAAA,EAUM,GAAA,MAAA,EATY,EAAA,QAAT,OADT,EAAA,GAAA,EAUM,OAAA;GARH,KAAK,EAAM;GACX,OAAK,EAAE,EAAA,CAAA,CAAoB,CAAC,CAAK,CAAA;EAElC,GAAA,EAAA,EAAA,GAAA,EAIE,EAHK,EAAkB,CAAK,CAAA,GAAA;GACpB;GACP,UAAU,EAAA"}
|
|
1
|
+
{"version":3,"file":"BlockPreviewCanvas-DH5ULGkw.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 {\n BLOCK_REGISTRY_KEY,\n CONDITION_PREVIEW_KEY,\n EDITOR_KEY,\n MERGE_TAG_SAMPLE_MODE_KEY,\n USE_MERGE_TAG_SAMPLES_KEY,\n} 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, provide, 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 * Whether the hand-toggled display-condition filter still applies here.\n * `false` where a resolver owns the preview: it has already evaluated every\n * condition against real data, so layering a manual hide on top would veto\n * the answer that was asked for.\n *\n * A prop rather than an injected `PREVIEW_RESOLUTION_KEY` read, because the\n * test-email dialog builds its *own* resolution instance (keyed to the\n * selected recipient) — injecting would consult the shared canvas instance\n * and get the wrong answer.\n */\n applyConditionFilter?: boolean;\n }>(),\n { viewport: \"desktop\", applyConditionFilter: true },\n);\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY);\nconst editor = inject(EDITOR_KEY, null);\nconst conditionPreview = inject(CONDITION_PREVIEW_KEY, null);\n\n/**\n * This canvas is only ever a preview — nothing here is editable — so it honours\n * the user's mode directly, with no `previewMode` gate of the kind `Canvas.vue`\n * needs. Re-provided rather than left to inherit, because a `BlockPreviewCanvas`\n * inside a dialog may sit under an editing `Canvas` that provides `false`.\n */\nconst mergeTagSampleMode = inject(MERGE_TAG_SAMPLE_MODE_KEY, null);\nprovide(\n USE_MERGE_TAG_SAMPLES_KEY,\n computed(() => mergeTagSampleMode?.value ?? false),\n);\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 *\n * Skipped entirely when `applyConditionFilter` is false — see the prop.\n */\nconst visibleBlocks = computed(() =>\n props.applyConditionFilter\n ? props.blocks.filter((block) => !conditionPreview?.isHidden(block.id))\n : props.blocks,\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 {\n BLOCK_REGISTRY_KEY,\n CONDITION_PREVIEW_KEY,\n EDITOR_KEY,\n MERGE_TAG_SAMPLE_MODE_KEY,\n USE_MERGE_TAG_SAMPLES_KEY,\n} 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, provide, 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 * Whether the hand-toggled display-condition filter still applies here.\n * `false` where a resolver owns the preview: it has already evaluated every\n * condition against real data, so layering a manual hide on top would veto\n * the answer that was asked for.\n *\n * A prop rather than an injected `PREVIEW_RESOLUTION_KEY` read, because the\n * test-email dialog builds its *own* resolution instance (keyed to the\n * selected recipient) — injecting would consult the shared canvas instance\n * and get the wrong answer.\n */\n applyConditionFilter?: boolean;\n }>(),\n { viewport: \"desktop\", applyConditionFilter: true },\n);\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY);\nconst editor = inject(EDITOR_KEY, null);\nconst conditionPreview = inject(CONDITION_PREVIEW_KEY, null);\n\n/**\n * This canvas is only ever a preview — nothing here is editable — so it honours\n * the user's mode directly, with no `previewMode` gate of the kind `Canvas.vue`\n * needs. Re-provided rather than left to inherit, because a `BlockPreviewCanvas`\n * inside a dialog may sit under an editing `Canvas` that provides `false`.\n */\nconst mergeTagSampleMode = inject(MERGE_TAG_SAMPLE_MODE_KEY, null);\nprovide(\n USE_MERGE_TAG_SAMPLES_KEY,\n computed(() => mergeTagSampleMode?.value ?? false),\n);\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 *\n * Skipped entirely when `applyConditionFilter` is false — see the prop.\n */\nconst visibleBlocks = computed(() =>\n props.applyConditionFilter\n ? props.blocks.filter((block) => !conditionPreview?.isHidden(block.id))\n : props.blocks,\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;;;GAIE,OAAA,EAAA,GAAA,EA2BM,OA3BN,GA2BM,CA1BJ,EAyBM,OAzBN,GAyBM,EAxBJ,EAAA,EAAA,GAAA,EAuBM,GAAA,MAAA,EAtBoB,EAAA,QAAhB,GAAG,OADb,EAAA,GAAA,EAuBM,OAAA;IArBH,KAAK;IACL,OAAK,EAAA,EAAA,OAAW,EAAA,MAAa,GAAQ,CAAA;GAEtC,GAAA,EAAA,EAAA,EAAA,GAAA,EAiBM,GAAA,MAAA,EAhBiB,EAAgB,CAAQ,IAAtC,OADT,EAAA,GAAA,EAiBM,OAAA;IAfH,KAAK,EAAW;IAChB,OAAK,EAAE,EAAA,CAAA,CAAoB,CAAC,CAAU,CAAA;GAI/B,GAAA,CAAA,EAAW,SAAI,aADvB,EAAA,GAAA,EAIE,GAAA;;IAFC,OAAO;IACR,UAAS;GAEX,GAAA,MAAA,GAAA,CAAA,OAAA,CAAA,MAAA,EAAA,GAAA,EAKE,EAJK,EAAkB,CAAU,CAAA,GAAA;;IAEhC,OAAO;IACR,UAAS;;;;;;;;;;;;;;;EEvErB,IAAM,IAAQ,GA0BR,IAAgB,EAAO,CAAkB,GACzC,IAAS,EAAO,GAAY,IAAI,GAChC,IAAmB,EAAO,GAAuB,IAAI,GAQrD,IAAqB,EAAO,GAA2B,IAAI;EACjE,EACE,GACA,QAAe,GAAoB,SAAS,EAAK,CACnD;EAcA,IAAM,IAAgB,QACpB,EAAM,uBACF,EAAM,OAAO,QAAQ,MAAU,CAAC,GAAkB,SAAS,EAAM,EAAE,CAAC,IACpE,EAAM,MACZ,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;oBAIE,EAAA,GAAA,EAsBM,OAAA;GArBJ,eAAY;GACZ,OAAM;GACL,OAAK,EAAA;IAAoB,OAAA,GAAA,EAAA,MAAU;IAAwB,YAAA,EAAA,CAAA;;;IAA+H,GAAA,EAAA;;EAQ3L,GAAA,EAAA,EAAA,EAAA,GAAA,EAUM,GAAA,MAAA,EATY,EAAA,QAAT,OADT,EAAA,GAAA,EAUM,OAAA;GARH,KAAK,EAAM;GACX,OAAK,EAAE,EAAA,CAAA,CAAoB,CAAC,CAAK,CAAA;EAElC,GAAA,EAAA,EAAA,GAAA,EAIE,EAHK,EAAkB,CAAK,CAAA,GAAA;GACpB;GACP,UAAU,EAAA"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { $ as e, A as t, H as n, J as r, M as i, N as a, P as o, V as s, Z as c, _ as l, b as u, ct as d, f, g as p, h as m, it as h, j as g, l as _,
|
|
1
|
+
import { $ as e, A as t, H as n, J as r, M as i, N as a, P as o, V as s, Z as c, _ as l, b as u, ct as d, f, g as p, h as m, it as h, j as g, l as _, lt as v, m as y, n as b, p as x, s as S, st as C, u as w, v as T, x as E, y as D, z as O } from "./draggable-DCs9qL-b.js";
|
|
2
2
|
import { t as k } from "./timeouts-SsLMC4a3.js";
|
|
3
|
-
import { B as A } from "./src-
|
|
4
|
-
import { T as j, b as M, j as ee, t as N } from "./useEditorCore-
|
|
5
|
-
import { _ as P } from "./dist-
|
|
6
|
-
import { t as F } from "./dist-
|
|
7
|
-
import { M as I, c as te, d as L, i as R, l as z, t as B, z as ne } from "./keys-
|
|
8
|
-
import { t as V } from "./useI18n-
|
|
9
|
-
import { E as H, F as U, I as W, Lt as G, M as K, Mt as q, it as J, kt as Y, tt as re, u as ie } from "./icons-
|
|
3
|
+
import { B as A } from "./src-EKTTBQ0y.js";
|
|
4
|
+
import { T as j, b as M, j as ee, t as N } from "./useEditorCore-C_nUXiph.js";
|
|
5
|
+
import { _ as P } from "./dist-C6z8AjBC.js";
|
|
6
|
+
import { t as F } from "./dist-B2HKGHnc.js";
|
|
7
|
+
import { M as I, c as te, d as L, i as R, l as z, t as B, z as ne } from "./keys-Cmc2Yl3D.js";
|
|
8
|
+
import { t as V } from "./useI18n-UMs0F71x.js";
|
|
9
|
+
import { E as H, F as U, I as W, Lt as G, M as K, Mt as q, it as J, kt as Y, tt as re, u as ie } from "./icons-CvYN6zrM.js";
|
|
10
10
|
import { t as ae } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
11
|
-
import { n as X } from "./useCloudI18n-
|
|
12
|
-
import { a as Z, c as oe, d as Q, f as se, i as ce, l as le, m as ue, n as de, o as fe, p as pe, r as me, s as he, t as ge, u as _e } from "./styles-
|
|
13
|
-
import { d as $ } from "./ColorPicker-
|
|
14
|
-
import { n as ve, t as ye } from "./MergeTagModeToggle-
|
|
15
|
-
import { C as be, a as xe, c as Se, d as Ce, f as we, g as Te, h as Ee, i as De, l as Oe, n as ke, o as Ae, p as je, r as Me, s as Ne, t as Pe, u as Fe, v as Ie, y as Le } from "./cloud-
|
|
11
|
+
import { n as X } from "./useCloudI18n-8wkJtuJD.js";
|
|
12
|
+
import { a as Z, c as oe, d as Q, f as se, i as ce, l as le, m as ue, n as de, o as fe, p as pe, r as me, s as he, t as ge, u as _e } from "./styles-C7s-VtJi.js";
|
|
13
|
+
import { d as $ } from "./ColorPicker-W_UyiVGc.js";
|
|
14
|
+
import { n as ve, t as ye } from "./MergeTagModeToggle-D8iKvz7v.js";
|
|
15
|
+
import { C as be, a as xe, c as Se, d as Ce, f as we, g as Te, h as Ee, i as De, l as Oe, n as ke, o as Ae, p as je, r as Me, s as Ne, t as Pe, u as Fe, v as Ie, y as Le } from "./cloud-CuItCnN_.js";
|
|
16
16
|
//#region src/cloud/composables/useSnapshotPreview.ts
|
|
17
17
|
function Re(t) {
|
|
18
18
|
let { authManager: n, editor: i, history: a, conditionPreview: o, autoSave: s, onError: l } = t, u = e(null), d = c(null), p = c(null), m = !1;
|
|
@@ -184,7 +184,7 @@ function He(e) {
|
|
|
184
184
|
let t = f(e);
|
|
185
185
|
if (t) return s?.(t), null;
|
|
186
186
|
try {
|
|
187
|
-
let { MediaApiClient: t } = await import("./src-
|
|
187
|
+
let { MediaApiClient: t } = await import("./src-C0N74uvF.js");
|
|
188
188
|
return l(await new t(a).uploadMedia(e));
|
|
189
189
|
} catch (e) {
|
|
190
190
|
return s?.(e), null;
|
|
@@ -532,7 +532,7 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
532
532
|
emits: ["cancel", "confirm"],
|
|
533
533
|
setup(e, { emit: t }) {
|
|
534
534
|
let n = t, { t: r } = X();
|
|
535
|
-
return (t, a) => (i(),
|
|
535
|
+
return (t, a) => (i(), y(b, {
|
|
536
536
|
"enter-active-class": "tpl:transition-opacity tpl:duration-150",
|
|
537
537
|
"leave-active-class": "tpl:transition-opacity tpl:duration-150",
|
|
538
538
|
"enter-from-class": "tpl:opacity-0",
|
|
@@ -550,21 +550,21 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
550
550
|
size: 18,
|
|
551
551
|
"stroke-width": 2,
|
|
552
552
|
class: "tpl:text-[var(--tpl-warning)]"
|
|
553
|
-
}), x("h2", Xe,
|
|
554
|
-
x("p", Ze,
|
|
553
|
+
}), x("h2", Xe, v(h(r).saveGate.title), 1)]),
|
|
554
|
+
x("p", Ze, v(h(r).saveGate.body), 1),
|
|
555
555
|
x("ul", Qe, [(i(!0), p(w, null, o(e.issues, (e) => (i(), p("li", {
|
|
556
556
|
key: `${e.ruleId}-${e.blockId ?? "template"}`,
|
|
557
557
|
class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:rounded tpl:px-2 tpl:py-1.5"
|
|
558
|
-
}, [x("span", $e,
|
|
558
|
+
}, [x("span", $e, v(e.message), 1), x("span", et, v(e.ruleId), 1)]))), 128))]),
|
|
559
559
|
x("footer", tt, [x("button", {
|
|
560
560
|
type: "button",
|
|
561
561
|
class: "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)]",
|
|
562
562
|
onClick: a[0] ||= (e) => n("cancel")
|
|
563
|
-
},
|
|
563
|
+
}, v(h(r).saveGate.cancel), 1), x("button", {
|
|
564
564
|
type: "button",
|
|
565
565
|
class: "tpl:rounded-md tpl:bg-[var(--tpl-danger)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white",
|
|
566
566
|
onClick: a[1] ||= (e) => n("confirm")
|
|
567
|
-
},
|
|
567
|
+
}, v(h(r).saveGate.confirm), 1)])
|
|
568
568
|
])], 8, qe)) : m("", !0)]),
|
|
569
569
|
_: 1
|
|
570
570
|
}));
|
|
@@ -613,9 +613,9 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
613
613
|
},
|
|
614
614
|
emits: ["save"],
|
|
615
615
|
setup(e) {
|
|
616
|
-
let t = u(() => import("./CollaboratorBar-
|
|
616
|
+
let t = u(() => import("./CollaboratorBar-f6Ni7KNH.js")), n = u(() => import("./SnapshotHistory-Srpzt2na.js")), r = u(() => import("./AiFeatureMenu-D2AIDwEG.js")), { t: a } = V(), { t: o, format: c } = X();
|
|
617
617
|
return (l, u) => (i(), p("header", rt, [
|
|
618
|
-
x("div", it, [e.featureFlags.templateLimit.value === null ? m("", !0) : (i(), p("span", at,
|
|
618
|
+
x("div", it, [e.featureFlags.templateLimit.value === null ? m("", !0) : (i(), p("span", at, v(h(c)(h(o).header.templatesUsed, {
|
|
619
619
|
used: e.featureFlags.templateCount.value,
|
|
620
620
|
max: e.featureFlags.templateLimit.value
|
|
621
621
|
})), 1))]),
|
|
@@ -632,17 +632,17 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
632
632
|
"preview-mode": e.editor.state.previewMode,
|
|
633
633
|
onChange: e.editor.setPreviewMode
|
|
634
634
|
}, null, 8, ["preview-mode", "onChange"]),
|
|
635
|
-
e.editor.state.previewMode && !e.core.previewResolution.supersedesSamples.value ? (i(),
|
|
635
|
+
e.editor.state.previewMode && !e.core.previewResolution.supersedesSamples.value ? (i(), y(ye, {
|
|
636
636
|
key: 0,
|
|
637
637
|
"sample-mode": e.core.mergeTagSampleMode.value,
|
|
638
638
|
onChange: u[0] ||= (t) => e.core.mergeTagSampleMode.value = t
|
|
639
639
|
}, null, 8, ["sample-mode"])) : m("", !0),
|
|
640
|
-
e.collaboration && e.isCollaborationEnabled ? (i(),
|
|
640
|
+
e.collaboration && e.isCollaborationEnabled ? (i(), y(h(t), {
|
|
641
641
|
key: 1,
|
|
642
642
|
collaborators: e.collaboration.collaborators.value,
|
|
643
643
|
"is-connected": e.websocket.isConnected.value
|
|
644
644
|
}, null, 8, ["collaborators", "is-connected"])) : m("", !0),
|
|
645
|
-
e.snapshotPreview.snapshotHistoryInstance.value ? (i(),
|
|
645
|
+
e.snapshotPreview.snapshotHistoryInstance.value ? (i(), y(h(n), {
|
|
646
646
|
key: 2,
|
|
647
647
|
snapshots: e.snapshotPreview.snapshotHistorySnapshots.value,
|
|
648
648
|
"is-loading": e.snapshotPreview.snapshotHistoryIsLoading.value,
|
|
@@ -666,16 +666,16 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
666
666
|
}, [D(h(q), {
|
|
667
667
|
size: 12,
|
|
668
668
|
"stroke-width": 2.5
|
|
669
|
-
}), T(" " +
|
|
669
|
+
}), T(" " + v(h(o).header.saveFailed), 1)], 8, ct)) : e.featureFlags.saveStatus.value === "saved" ? (i(), p("div", lt, [D(h(G), {
|
|
670
670
|
size: 12,
|
|
671
671
|
"stroke-width": 2.5
|
|
672
|
-
}), T(" " +
|
|
672
|
+
}), T(" " + v(h(o).header.saved), 1)])) : e.editor.state.isDirty ? (i(), p("div", ut, [u[5] ||= x("span", { class: "tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]" }, null, -1), T(" " + v(h(o).header.unsaved), 1)])) : m("", !0),
|
|
673
673
|
e.commentsInstance.isEnabled.value && e.featureFlags.hasTemplateSaved.value ? (i(), p("button", {
|
|
674
674
|
key: 3,
|
|
675
675
|
"aria-label": e.commentsInstance.unresolvedCount.value > 0 ? `${h(o).comments.button} (${e.commentsInstance.unresolvedCount.value})` : h(o).comments.button,
|
|
676
676
|
"aria-expanded": e.panelState.commentsOpen.value,
|
|
677
|
-
class:
|
|
678
|
-
style:
|
|
677
|
+
class: C(h($)),
|
|
678
|
+
style: d({
|
|
679
679
|
backgroundColor: e.panelState.commentsOpen.value ? "var(--tpl-primary)" : "transparent",
|
|
680
680
|
color: e.panelState.commentsOpen.value ? "var(--tpl-bg)" : "var(--tpl-primary)",
|
|
681
681
|
borderColor: "var(--tpl-primary)"
|
|
@@ -686,8 +686,8 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
686
686
|
size: 16,
|
|
687
687
|
"stroke-width": 2
|
|
688
688
|
}),
|
|
689
|
-
T(" " +
|
|
690
|
-
e.commentsInstance.unresolvedCount.value > 0 && !e.panelState.commentsOpen.value ? (i(), p("span", ft,
|
|
689
|
+
T(" " + v(h(o).comments.button) + " ", 1),
|
|
690
|
+
e.commentsInstance.unresolvedCount.value > 0 && !e.panelState.commentsOpen.value ? (i(), p("span", ft, v(e.commentsInstance.unresolvedCount.value), 1)) : m("", !0)
|
|
691
691
|
], 14, dt)) : m("", !0),
|
|
692
692
|
e.featureFlags.canUseAiGeneration.value && e.featureFlags.hasTemplateSaved.value ? (i(), p("div", {
|
|
693
693
|
key: 4,
|
|
@@ -695,13 +695,13 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
695
695
|
class: "tpl:relative"
|
|
696
696
|
}, [x("button", {
|
|
697
697
|
"aria-expanded": e.panelState.aiMenuOpen.value,
|
|
698
|
-
class:
|
|
698
|
+
class: C(["tpl-ai-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:whitespace-nowrap tpl:transition-all tpl:duration-200", e.panelState.aiButtonActive.value ? "tpl-ai-btn--active" : "tpl-ai-btn--idle"]),
|
|
699
699
|
onClick: u[2] ||= _((...t) => e.panelState.toggleAiMenu && e.panelState.toggleAiMenu(...t), ["stop"])
|
|
700
700
|
}, [D(h(H), {
|
|
701
701
|
size: 16,
|
|
702
702
|
"stroke-width": 2,
|
|
703
703
|
class: "tpl-ai-btn-icon"
|
|
704
|
-
}), T(" " +
|
|
704
|
+
}), T(" " + v(h(o).aiChat.button), 1)], 10, pt), D(b, {
|
|
705
705
|
"enter-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-out",
|
|
706
706
|
"enter-from-class": "tpl:scale-95 tpl:opacity-0",
|
|
707
707
|
"enter-to-class": "tpl:scale-100 tpl:opacity-100",
|
|
@@ -717,7 +717,7 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
717
717
|
})], 512)) : m("", !0),
|
|
718
718
|
e.testEmail.isAvailable.value ? (i(), p("button", {
|
|
719
719
|
key: 5,
|
|
720
|
-
class:
|
|
720
|
+
class: C(h($)),
|
|
721
721
|
"data-testid": "test-email-trigger",
|
|
722
722
|
style: {
|
|
723
723
|
"background-color": "transparent",
|
|
@@ -726,18 +726,18 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
726
726
|
},
|
|
727
727
|
disabled: e.testEmail.isSending.value,
|
|
728
728
|
onClick: u[3] ||= (t) => e.testEmail.open()
|
|
729
|
-
}, [e.testEmail.isSending.value ? (i(),
|
|
729
|
+
}, [e.testEmail.isSending.value ? (i(), y(h(J), {
|
|
730
730
|
key: 1,
|
|
731
731
|
class: "tpl-spinner",
|
|
732
732
|
size: 16,
|
|
733
733
|
"stroke-width": 2
|
|
734
|
-
})) : (i(),
|
|
734
|
+
})) : (i(), y(h(K), {
|
|
735
735
|
key: 0,
|
|
736
736
|
size: 16,
|
|
737
737
|
"stroke-width": 2
|
|
738
|
-
})), T(" " +
|
|
738
|
+
})), T(" " + v(h(a).testEmail.button), 1)], 10, ht)) : m("", !0),
|
|
739
739
|
x("button", {
|
|
740
|
-
class:
|
|
740
|
+
class: C(h($)),
|
|
741
741
|
style: {
|
|
742
742
|
"background-color": "transparent",
|
|
743
743
|
color: "var(--tpl-primary)",
|
|
@@ -745,16 +745,16 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
745
745
|
},
|
|
746
746
|
disabled: e.isSaveDisabled,
|
|
747
747
|
onClick: u[4] ||= (e) => l.$emit("save")
|
|
748
|
-
}, [e.isSaving ? (i(),
|
|
748
|
+
}, [e.isSaving ? (i(), y(h(J), {
|
|
749
749
|
key: 1,
|
|
750
750
|
class: "tpl-spinner",
|
|
751
751
|
size: 16,
|
|
752
752
|
"stroke-width": 2
|
|
753
|
-
})) : (i(),
|
|
753
|
+
})) : (i(), y(h(U), {
|
|
754
754
|
key: 0,
|
|
755
755
|
size: 16,
|
|
756
756
|
"stroke-width": 2
|
|
757
|
-
})), T(" " +
|
|
757
|
+
})), T(" " + v(e.isSaving ? h(o).header.saving : h(o).header.save), 1)], 10, gt)
|
|
758
758
|
])
|
|
759
759
|
]));
|
|
760
760
|
}
|
|
@@ -769,9 +769,9 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
769
769
|
mediaLib: {}
|
|
770
770
|
},
|
|
771
771
|
setup(e, { expose: t }) {
|
|
772
|
-
let n = u(() => import("./AiChatSidebar-
|
|
772
|
+
let n = u(() => import("./AiChatSidebar-BHqNxNcX.js")), r = u(() => import("./CommentsSidebar-BLRZRSSC.js")), a = u(() => import("./DesignReferenceSidebar-DBoEBKxQ.js")), o = u(() => import("./TemplateScoringPanel-NucRtAP0.js")), s = u(async () => {
|
|
773
773
|
try {
|
|
774
|
-
return (await import("./src-
|
|
774
|
+
return (await import("./src-C0N74uvF.js")).MediaLibraryModal;
|
|
775
775
|
} catch {
|
|
776
776
|
throw Error("[Templatical] Cloud media library requires the optional peer dependency '@templatical/media-library'. Please install it.");
|
|
777
777
|
}
|
|
@@ -857,12 +857,12 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
857
857
|
"stroke-width": 1.5,
|
|
858
858
|
class: "tpl:text-[var(--tpl-danger)]"
|
|
859
859
|
})]),
|
|
860
|
-
x("div", Tt, [x("h2", Et,
|
|
860
|
+
x("div", Tt, [x("h2", Et, v(h(r).error.title), 1), x("p", Dt, v(a(e.error)), 1)]),
|
|
861
861
|
o(e.error) ? m("", !0) : (i(), p("button", {
|
|
862
862
|
key: 0,
|
|
863
863
|
class: "tpl-btn tpl-btn-primary tpl:inline-flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
864
864
|
onClick: s[0] ||= (e) => n("retry")
|
|
865
|
-
},
|
|
865
|
+
}, v(h(r).error.retry), 1))
|
|
866
866
|
])) : m("", !0);
|
|
867
867
|
}
|
|
868
868
|
}), kt = {
|
|
@@ -878,14 +878,14 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
878
878
|
size: 18,
|
|
879
879
|
"stroke-width": 2,
|
|
880
880
|
class: "tpl:text-[var(--tpl-primary)]"
|
|
881
|
-
}), x("span", null,
|
|
881
|
+
}), x("span", null, v(h(r).snapshotPreview.message), 1)]), x("div", jt, [x("button", {
|
|
882
882
|
class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]",
|
|
883
883
|
style: { "background-color": "transparent" },
|
|
884
884
|
onClick: a[0] ||= (e) => n("cancel")
|
|
885
|
-
},
|
|
885
|
+
}, v(h(r).snapshotPreview.cancel), 1), x("button", {
|
|
886
886
|
class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
887
887
|
onClick: a[1] ||= (e) => n("confirm")
|
|
888
|
-
},
|
|
888
|
+
}, v(h(r).snapshotPreview.restore), 1)])])) : m("", !0);
|
|
889
889
|
}
|
|
890
890
|
}), Nt = {
|
|
891
891
|
key: 0,
|
|
@@ -902,7 +902,7 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
902
902
|
props: { visible: { type: Boolean } },
|
|
903
903
|
setup(e) {
|
|
904
904
|
let { t } = V();
|
|
905
|
-
return (n, r) => e.visible ? (i(), p("div", Nt,
|
|
905
|
+
return (n, r) => e.visible ? (i(), p("div", Nt, v(h(t).history.collabWarning), 1)) : m("", !0);
|
|
906
906
|
}
|
|
907
907
|
}), Ft = ["data-tpl-theme"], It = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, Lt = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, Rt = ["aria-label"], zt = /*#__PURE__*/ ae(/* @__PURE__ */ E({
|
|
908
908
|
__name: "CloudEditor",
|
|
@@ -915,7 +915,7 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
915
915
|
},
|
|
916
916
|
emits: ["ready"],
|
|
917
917
|
setup(e, { expose: r, emit: o }) {
|
|
918
|
-
let l = u(() => import("./SavedBlocksPanels-
|
|
918
|
+
let l = u(() => import("./SavedBlocksPanels-Bb-eDMAh.js")), f = u(() => import("./TestEmailPanel-Dr7Dkq2P.js")), w = e;
|
|
919
919
|
a(z, w.cloudTranslations);
|
|
920
920
|
let E = o, O = c(null), k = c(null), A = Ue({
|
|
921
921
|
config: w.config,
|
|
@@ -964,14 +964,14 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
964
964
|
}), (t, r) => (i(), p("div", {
|
|
965
965
|
ref_key: "rootEl",
|
|
966
966
|
ref: k,
|
|
967
|
-
class:
|
|
967
|
+
class: C(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": h(L).state.darkMode }]),
|
|
968
968
|
"data-tpl-theme": h(R).resolvedTheme.value,
|
|
969
|
-
style:
|
|
969
|
+
style: d(h(R).themeStyles.value),
|
|
970
970
|
onDragover: r[6] ||= _(() => {}, ["prevent"]),
|
|
971
971
|
onDrop: r[7] ||= _(() => {}, ["prevent"])
|
|
972
972
|
}, [
|
|
973
973
|
D(le),
|
|
974
|
-
D(
|
|
974
|
+
D(b, {
|
|
975
975
|
"enter-active-class": "tpl:transition-opacity tpl:duration-200",
|
|
976
976
|
"enter-from-class": "tpl:opacity-100",
|
|
977
977
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -982,7 +982,7 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
982
982
|
default: s(() => [D(St, { visible: h(j) || h(L).state.isLoading }, null, 8, ["visible"])]),
|
|
983
983
|
_: 1
|
|
984
984
|
}),
|
|
985
|
-
D(
|
|
985
|
+
D(b, {
|
|
986
986
|
"enter-active-class": "tpl:transition-opacity tpl:duration-200",
|
|
987
987
|
"enter-from-class": "tpl:opacity-0",
|
|
988
988
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -1045,7 +1045,7 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
1045
1045
|
onCancel: h(q).cancelPreview,
|
|
1046
1046
|
onConfirm: ae
|
|
1047
1047
|
}, null, 8, ["visible", "onCancel"]),
|
|
1048
|
-
D(
|
|
1048
|
+
D(b, {
|
|
1049
1049
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
1050
1050
|
"enter-from-class": "tpl:translate-y-[-8px] tpl:opacity-0",
|
|
1051
1051
|
"enter-to-class": "tpl:translate-y-0 tpl:opacity-100",
|
|
@@ -1058,12 +1058,12 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
1058
1058
|
}),
|
|
1059
1059
|
n(D(oe, null, null, 512), [[S, !h(L).state.previewMode]]),
|
|
1060
1060
|
x("div", {
|
|
1061
|
-
class:
|
|
1061
|
+
class: C(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [h(L).state.previewMode ? "tpl:left-0 tpl:right-0" : h(K).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", h(q).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
|
|
1062
1062
|
style: {
|
|
1063
1063
|
transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
1064
1064
|
"background-color": "var(--tpl-canvas-bg)"
|
|
1065
1065
|
}
|
|
1066
|
-
}, [x("div", It, [D(
|
|
1066
|
+
}, [x("div", It, [D(b, { name: "tpl-restore-btn" }, {
|
|
1067
1067
|
default: s(() => [h(R).conditionPreview.hasHiddenBlocks.value && h(R).appliesConditionFilter.value ? (i(), p("button", {
|
|
1068
1068
|
key: 0,
|
|
1069
1069
|
class: "tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80",
|
|
@@ -1078,7 +1078,7 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
1078
1078
|
}, [D(h(W), {
|
|
1079
1079
|
size: 13,
|
|
1080
1080
|
"stroke-width": 2
|
|
1081
|
-
}), T(" " +
|
|
1081
|
+
}), T(" " + v(h(R).t.blockSettings.restoreHiddenBlocks), 1)])) : m("", !0)]),
|
|
1082
1082
|
_: 1
|
|
1083
1083
|
})]), x("main", Lt, [D(_e, {
|
|
1084
1084
|
viewport: h(L).state.viewport,
|
|
@@ -1099,7 +1099,7 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
1099
1099
|
"locked-blocks",
|
|
1100
1100
|
"onSelectBlock"
|
|
1101
1101
|
])])], 2),
|
|
1102
|
-
e.config.branding !== !1 && !h(B).isWhiteLabeled.value ? (i(),
|
|
1102
|
+
e.config.branding !== !1 && !h(B).isWhiteLabeled.value ? (i(), y(me, {
|
|
1103
1103
|
key: 0,
|
|
1104
1104
|
"position-class": [h(L).state.previewMode ? "tpl:left-0 tpl:right-0" : h(K).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]
|
|
1105
1105
|
}, null, 8, ["position-class"])) : m("", !0),
|
|
@@ -1109,7 +1109,7 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
1109
1109
|
"aria-live": "polite",
|
|
1110
1110
|
"aria-atomic": "true",
|
|
1111
1111
|
"aria-label": h(R).t.landmarks.reorderAnnouncements
|
|
1112
|
-
},
|
|
1112
|
+
}, v(h(R).keyboardReorder.announcement.value), 9, Rt),
|
|
1113
1113
|
n(D(he, {
|
|
1114
1114
|
"selected-block": h(L).selectedBlock.value,
|
|
1115
1115
|
settings: h(L).content.value.settings,
|
|
@@ -1124,7 +1124,7 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
1124
1124
|
"shifted-left",
|
|
1125
1125
|
"onUpdateSettings"
|
|
1126
1126
|
]), [[S, !h(L).state.previewMode]]),
|
|
1127
|
-
!h(j) && h(ee) ? (i(),
|
|
1127
|
+
!h(j) && h(ee) ? (i(), y(vt, {
|
|
1128
1128
|
key: 1,
|
|
1129
1129
|
ref_key: "cloudPanelsRef",
|
|
1130
1130
|
ref: O,
|
|
@@ -1142,11 +1142,11 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
1142
1142
|
"plan-config-instance",
|
|
1143
1143
|
"media-lib"
|
|
1144
1144
|
])) : m("", !0),
|
|
1145
|
-
h(G).isAvailable.value ? (i(),
|
|
1145
|
+
h(G).isAvailable.value ? (i(), y(h(l), {
|
|
1146
1146
|
key: 2,
|
|
1147
1147
|
feature: h(G)
|
|
1148
1148
|
}, null, 8, ["feature"])) : m("", !0),
|
|
1149
|
-
h(H).isAvailable.value ? (i(),
|
|
1149
|
+
h(H).isAvailable.value ? (i(), y(h(f), {
|
|
1150
1150
|
key: 3,
|
|
1151
1151
|
feature: h(H)
|
|
1152
1152
|
}, null, 8, ["feature"])) : m("", !0),
|
|
@@ -1156,11 +1156,11 @@ var qe = ["aria-label"], Je = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
|
|
|
1156
1156
|
}, null, 512),
|
|
1157
1157
|
D(de),
|
|
1158
1158
|
D(ge),
|
|
1159
|
-
h(ie) ? (i(),
|
|
1159
|
+
h(ie) ? (i(), y(fe, { key: 4 })) : m("", !0)
|
|
1160
1160
|
], 46, Ft));
|
|
1161
1161
|
}
|
|
1162
1162
|
}), [["__scopeId", "data-v-16786f1a"]]);
|
|
1163
1163
|
//#endregion
|
|
1164
1164
|
export { zt as default };
|
|
1165
1165
|
|
|
1166
|
-
//# sourceMappingURL=CloudEditor-
|
|
1166
|
+
//# sourceMappingURL=CloudEditor-C0nB1JfD.js.map
|