@templatical/editor 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{AiChatSidebar-ChrE6pUq.js → AiChatSidebar-K_AehWc-.js} +9 -9
- package/dist/{AiFeatureMenu-DkQ9HhQ6.js → AiFeatureMenu-CcqQDHzJ.js} +6 -6
- package/dist/{BlockIssueBadge-B4QjePax.js → BlockIssueBadge-Dmj9rVra.js} +4 -4
- package/dist/{CloudEditor-CfX-aMiV.js → CloudEditor-Dnww6og-.js} +263 -315
- package/dist/{CollaboratorBar-DTibhQ1j.js → CollaboratorBar-Bj4NZiie.js} +3 -3
- package/dist/{ColorPicker-4vDYhdGe.js → ColorPicker-s9GHXjZs.js} +4 -4
- package/dist/CommentsSidebar-DvNEdugN.js +435 -0
- package/dist/CountdownBlock-J_Q9JRQM.js +91 -0
- package/dist/{CountdownToolbar-D7yQqnA2.js → CountdownToolbar-DPRcv3Fu.js} +3 -4
- package/dist/{DesignReferenceSidebar-DnO6ZdwS.js → DesignReferenceSidebar-DNmK3dxp.js} +8 -8
- package/dist/{IssuesPanel-X_vkNGrs.js → IssuesPanel-CEnEGFtd.js} +7 -7
- package/dist/{MergeTagSuggestion-DCuaSOPQ.js → MergeTagSuggestion-DMe4rqn0.js} +2 -2
- package/dist/NumberWithSuffix-CCPN_oCh.js +121 -0
- package/dist/{ParagraphEditor-C5ixOIYb.js → ParagraphEditor--_zWfxps.js} +47 -47
- package/dist/{RichTextEditorContent-DwhDnMsG.js → RichTextEditorContent-FbnWsh46.js} +6 -6
- package/dist/SaveBlockDialog-CYIEHABH.js +264 -0
- package/dist/SavedBlockPreviewCanvas-2-mzAnZE.js +109 -0
- package/dist/SavedBlocksBrowserModal-D5V5yF_3.js +323 -0
- package/dist/SavedBlocksPanels-Dff38YXu.js +36 -0
- package/dist/SavedBlocksPickBar-rB6iyji6.js +52 -0
- package/dist/{SnapshotHistory-DaVueFv6.js → SnapshotHistory-FtzDq8f0.js} +8 -8
- package/dist/{TemplateScoringPanel-B0UHoTLx.js → TemplateScoringPanel-ifGGGWs5.js} +14 -14
- package/dist/{TestEmailModal-BkauxF7j.js → TestEmailModal-DL2O1H8M.js} +4 -4
- package/dist/{TitleEditor-n6WDVDjW.js → TitleEditor-CPda5lh-.js} +11 -11
- package/dist/{TplModal-BDDyvT-C.js → TplModal-C7Koj5gM.js} +3 -3
- package/dist/{blockTypeIcons-4D0aFXNg.js → blockTypeIcons-CgwECCut.js} +6 -6
- package/dist/bundle-stats.json +8 -8
- package/dist/{cdn/chunks/ca-DbWoy4rG.js → ca-BBgad6y5.js} +50 -5
- package/dist/cdn/chunks/AiChatSidebar-A1CuWGY0.js +203 -0
- package/dist/cdn/chunks/AiChatSidebar-A1CuWGY0.js.map +1 -0
- package/dist/cdn/chunks/{AiFeatureMenu-CIBHAGSz.js → AiFeatureMenu-Duwg413F.js} +12 -8
- package/dist/cdn/chunks/{AiFeatureMenu-CIBHAGSz.js.map → AiFeatureMenu-Duwg413F.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-CxMiLo3p.js → BlockIssueBadge-Da4yR-mh.js} +7 -5
- package/dist/cdn/chunks/{BlockIssueBadge-CxMiLo3p.js.map → BlockIssueBadge-Da4yR-mh.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-CEa3Xgqh.js → CloudEditor-B3hqbwfP.js} +275 -318
- package/dist/cdn/chunks/CloudEditor-B3hqbwfP.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-Bk1gD02G.js → CollaboratorBar-BS3rJy6-.js} +7 -6
- package/dist/cdn/chunks/{CollaboratorBar-Bk1gD02G.js.map → CollaboratorBar-BS3rJy6-.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-ll8pynws.js → ColorPicker-DZSzZ5ZP.js} +168 -164
- package/dist/cdn/chunks/{ColorPicker-ll8pynws.js.map → ColorPicker-DZSzZ5ZP.js.map} +1 -1
- package/dist/cdn/chunks/CommentsSidebar-DHdRiGPX.js +412 -0
- package/dist/cdn/chunks/CommentsSidebar-DHdRiGPX.js.map +1 -0
- package/dist/cdn/chunks/CountdownBlock-Bffpoppw.js +93 -0
- package/dist/cdn/chunks/{CountdownBlock-eGUE7hhw.js.map → CountdownBlock-Bffpoppw.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-C1bkSjUR.js → CountdownToolbar-DAnmIZjq.js} +4 -5
- package/dist/cdn/chunks/{CountdownToolbar-C1bkSjUR.js.map → CountdownToolbar-DAnmIZjq.js.map} +1 -1
- package/dist/cdn/chunks/DesignReferenceSidebar-Dre99DTH.js +223 -0
- package/dist/cdn/chunks/DesignReferenceSidebar-Dre99DTH.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-Csasylf_.js → IssuesPanel-D80JedOj.js} +11 -10
- package/dist/cdn/chunks/{IssuesPanel-Csasylf_.js.map → IssuesPanel-D80JedOj.js.map} +1 -1
- package/dist/cdn/chunks/LoadingTrack-D-CW2tUa.js +12 -0
- package/dist/cdn/chunks/LoadingTrack-D-CW2tUa.js.map +1 -0
- package/dist/cdn/chunks/{MergeTagSuggestion-BmMmdcRg.js → MergeTagSuggestion-D7TsECll.js} +2 -2
- package/dist/cdn/chunks/{MergeTagSuggestion-BmMmdcRg.js.map → MergeTagSuggestion-D7TsECll.js.map} +1 -1
- package/dist/cdn/chunks/NumberWithSuffix-CjlVNIEe.js +123 -0
- package/dist/cdn/chunks/NumberWithSuffix-CjlVNIEe.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-v0_XEL-v.js → ParagraphEditor-CtaRa1vr.js} +90 -85
- package/dist/cdn/chunks/{ParagraphEditor-v0_XEL-v.js.map → ParagraphEditor-CtaRa1vr.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-NQExNsaV.js → RichTextEditorContent-BbdgJqWM.js} +9 -6
- package/dist/cdn/chunks/{RichTextEditorContent-NQExNsaV.js.map → RichTextEditorContent-BbdgJqWM.js.map} +1 -1
- package/dist/cdn/chunks/SaveBlockDialog-Bb3fdUEZ.js +263 -0
- package/dist/cdn/chunks/SaveBlockDialog-Bb3fdUEZ.js.map +1 -0
- package/dist/cdn/chunks/SavedBlockPreviewCanvas-DZOMgNsz.js +111 -0
- package/dist/cdn/chunks/SavedBlockPreviewCanvas-DZOMgNsz.js.map +1 -0
- package/dist/cdn/chunks/SavedBlocksBrowserModal-CeUWcPv0.js +322 -0
- package/dist/cdn/chunks/SavedBlocksBrowserModal-CeUWcPv0.js.map +1 -0
- package/dist/cdn/chunks/SavedBlocksPanels-D-pA_wfk.js +38 -0
- package/dist/cdn/chunks/SavedBlocksPanels-D-pA_wfk.js.map +1 -0
- package/dist/cdn/chunks/SavedBlocksPickBar-1rf1KpqS.js +54 -0
- package/dist/cdn/chunks/SavedBlocksPickBar-1rf1KpqS.js.map +1 -0
- package/dist/cdn/chunks/SnapshotHistory-Bf1uovti.js +121 -0
- package/dist/cdn/chunks/SnapshotHistory-Bf1uovti.js.map +1 -0
- package/dist/cdn/chunks/TemplateScoringPanel-CTk8WwxU.js +231 -0
- package/dist/cdn/chunks/TemplateScoringPanel-CTk8WwxU.js.map +1 -0
- package/dist/cdn/chunks/TestEmailModal-BJTDxFHh.js +96 -0
- package/dist/cdn/chunks/TestEmailModal-BJTDxFHh.js.map +1 -0
- package/dist/cdn/chunks/{TitleEditor-CS-_MzYs.js → TitleEditor-BJ7LFykI.js} +18 -15
- package/dist/cdn/chunks/{TitleEditor-CS-_MzYs.js.map → TitleEditor-BJ7LFykI.js.map} +1 -1
- package/dist/cdn/chunks/TplModal-CH9RzKF7.js +50 -0
- package/dist/cdn/chunks/TplModal-CH9RzKF7.js.map +1 -0
- package/dist/cdn/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/cdn/chunks/blockTypeIcons-etMMQoVv.js +21 -0
- package/dist/cdn/chunks/{blockTypeIcons-B0Hjh42a.js.map → blockTypeIcons-etMMQoVv.js.map} +1 -1
- package/dist/{ca-DbWoy4rG.js → cdn/chunks/ca-BBgad6y5.js} +52 -3
- package/dist/cdn/chunks/ca-BBgad6y5.js.map +1 -0
- package/dist/cdn/chunks/cloud-BJlbXGTJ.js +1787 -0
- package/dist/cdn/chunks/cloud-BJlbXGTJ.js.map +1 -0
- package/dist/{de-CTYXVU9v.js → cdn/chunks/de-Bw6fB5JU.js} +2 -24
- package/dist/cdn/chunks/{de-CTYXVU9v.js.map → de-Bw6fB5JU.js.map} +1 -1
- package/dist/cdn/chunks/{de-CgGOnerg.js → de-D7WbpFBR.js} +50 -3
- package/dist/cdn/chunks/de-D7WbpFBR.js.map +1 -0
- package/dist/cdn/chunks/dist-CiBEt0VR.js +163 -0
- package/dist/cdn/chunks/dist-CiBEt0VR.js.map +1 -0
- package/dist/cdn/chunks/dist-CxTt8FRE.js +403 -0
- package/dist/cdn/chunks/dist-CxTt8FRE.js.map +1 -0
- package/dist/{en-DrUV9xth.js → cdn/chunks/en-BrZ0uGK2.js} +51 -2
- package/dist/cdn/chunks/en-BrZ0uGK2.js.map +1 -0
- package/dist/{en-BtmIaJeb.js → cdn/chunks/en-DAdHJz7h.js} +2 -24
- package/dist/cdn/chunks/{en-BtmIaJeb.js.map → en-DAdHJz7h.js.map} +1 -1
- package/dist/{es-DwbKjU7q.js → cdn/chunks/es-tLSLysPs.js} +51 -2
- package/dist/cdn/chunks/es-tLSLysPs.js.map +1 -0
- package/dist/cdn/chunks/{extensions-Di3hdIRT.js → extensions-ZX2oarW6.js} +28 -26
- package/dist/cdn/chunks/{extensions-Di3hdIRT.js.map → extensions-ZX2oarW6.js.map} +1 -1
- package/dist/cdn/chunks/formatRelativeTime-CtUU-QZ8.js +12 -0
- package/dist/cdn/chunks/formatRelativeTime-CtUU-QZ8.js.map +1 -0
- package/dist/cdn/chunks/htmlparser-CZa2V5cF.js +1008 -0
- package/dist/cdn/chunks/htmlparser-CZa2V5cF.js.map +1 -0
- package/dist/cdn/chunks/icons-CYWw8Xfp.js +1190 -0
- package/dist/cdn/chunks/icons-CYWw8Xfp.js.map +1 -0
- package/dist/cdn/chunks/keys-D7kUmfpE.js +12 -0
- package/dist/cdn/chunks/keys-D7kUmfpE.js.map +1 -0
- package/dist/cdn/chunks/{pt-BR-Bcc5Tjed.js → pt-BR-BWFokdTU.js} +50 -3
- package/dist/cdn/chunks/pt-BR-BWFokdTU.js.map +1 -0
- package/dist/{pt-BR-B2ZvFlRL.js → cdn/chunks/pt-BR-w2sGzHNX.js} +2 -24
- package/dist/cdn/chunks/{pt-BR-B2ZvFlRL.js.map → pt-BR-w2sGzHNX.js.map} +1 -1
- package/dist/cdn/chunks/src-BKI1x1k7.js +546 -0
- package/dist/cdn/chunks/src-BKI1x1k7.js.map +1 -0
- package/dist/cdn/chunks/src-CM0gCvAS.js +1176 -0
- package/dist/cdn/chunks/src-CM0gCvAS.js.map +1 -0
- package/dist/cdn/chunks/{media-library-yYAkAagU.js → src-D6F_3XkE.js} +1754 -1252
- package/dist/cdn/chunks/src-D6F_3XkE.js.map +1 -0
- package/dist/cdn/chunks/{renderer-DpBGiXOg.js → src-DYji-wXB.js} +117 -133
- package/dist/cdn/chunks/src-DYji-wXB.js.map +1 -0
- package/dist/cdn/chunks/{styles-DHSmjlpX.js → styles-DMOEiSX9.js} +1448 -1354
- package/dist/cdn/chunks/styles-DMOEiSX9.js.map +1 -0
- package/dist/cdn/chunks/timeouts-Bmi_yePw.js +6 -0
- package/dist/cdn/chunks/timeouts-Bmi_yePw.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C2indasq.js → tiptap-BMZ-OENR.js} +2012 -1863
- package/dist/cdn/chunks/tiptap-BMZ-OENR.js.map +1 -0
- package/dist/cdn/chunks/useAliveFlag-aanU8uqB.js +12 -0
- package/dist/cdn/chunks/useAliveFlag-aanU8uqB.js.map +1 -0
- package/dist/cdn/chunks/useCloudI18n-BjNENqkM.js +25 -0
- package/dist/cdn/chunks/useCloudI18n-BjNENqkM.js.map +1 -0
- package/dist/cdn/chunks/useEditorCore-BA6mspzD.js +3019 -0
- package/dist/cdn/chunks/useEditorCore-BA6mspzD.js.map +1 -0
- package/dist/cdn/chunks/useI18n-8Wd7G-cq.js +19 -0
- package/dist/cdn/chunks/useI18n-8Wd7G-cq.js.map +1 -0
- package/dist/cdn/chunks/useMergeTag-C7G31KV-.js +46 -0
- package/dist/cdn/chunks/useMergeTag-C7G31KV-.js.map +1 -0
- package/dist/cdn/chunks/usePopoverPosition-Bx0QewTv.js +61 -0
- package/dist/cdn/chunks/usePopoverPosition-Bx0QewTv.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +132 -120
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-Bl4J_tYV.js → check-BpQDKiPz.js} +1 -1
- package/dist/{chevron-down-COEcl2iP.js → chevron-down-j8GrdTyz.js} +1 -1
- package/dist/chevron-up-BACyVhyC.js +7 -0
- package/dist/{circle-alert-CvHi5etc.js → circle-alert-CgtE46ND.js} +1 -1
- package/dist/{clock-CZZw62e8.js → clock-BzKLLW5L.js} +1 -1
- package/dist/{cloud-B-RebwxI.js → cloud-Du7mnkz2.js} +19 -47
- package/dist/{createLucideIcon-_peTZQtY.js → createLucideIcon-JWHwTI6N.js} +2 -2
- package/dist/{cdn/chunks/de-CTYXVU9v.js → de-Bw6fB5JU.js} +0 -26
- package/dist/{de-CgGOnerg.js → de-D7WbpFBR.js} +49 -2
- package/dist/{dist-CgTKuIUN.js → dist-BEpCh2mG.js} +1158 -1125
- package/dist/{dist-Cx7IUM7J.js → dist-BgPYC_8-.js} +14 -6
- package/dist/{dist-BKKo5wPC.js → dist-BkM8A17N.js} +2 -2
- package/dist/{dist-CcX5sLpz.js → dist-BuNDAAVp.js} +361 -256
- package/dist/{dist-COSN3oDJ.js → dist-CBzCU-a-.js} +2 -2
- package/dist/{dist-YSCPD13F.js → dist-CDO52Rxy.js} +2 -2
- package/dist/{dist-Dk5AdwoQ.js → dist-CrjzhIxB.js} +2 -2
- package/dist/{dist-DXAZUjj3.js → dist-CtcgoC_R.js} +2 -2
- package/dist/{dist-D6M5FAY7.js → dist-CuXha2_7.js} +2 -2
- package/dist/dist-CweLDZrs.js +5 -0
- package/dist/dist-DOsdqAEZ.js +5 -0
- package/dist/{dist-8TKf-Jpg.js → dist-DYClLqy8.js} +6 -3
- package/dist/{cdn/chunks/en-DrUV9xth.js → en-BrZ0uGK2.js} +49 -4
- package/dist/{cdn/chunks/en-BtmIaJeb.js → en-DAdHJz7h.js} +0 -26
- package/dist/{cdn/chunks/es-DwbKjU7q.js → es-tLSLysPs.js} +49 -4
- package/dist/{extensions-BCA9pyer.js → extensions-ClY5Sh7S.js} +5 -5
- package/dist/{image-up-D26rNdfX.js → image-up-CQdtq8ge.js} +1 -1
- package/dist/index.d.ts +81 -4
- package/dist/{info-CE3JSTqk.js → info-BUJBXoE6.js} +1 -1
- package/dist/{keys-DFaIbGR8.js → keys-CHPcp-Nz.js} +2 -2
- package/dist/{list-checks-BQsLrtBB.js → list-checks-BGHaCSD5.js} +1 -1
- package/dist/{loader-circle-s9Rh5lLd.js → loader-circle-C-Z6kgI6.js} +1 -1
- package/dist/{message-circle-CI62d690.js → message-circle-CEm5qckV.js} +1 -1
- package/dist/pencil-DdwmkKLb.js +10 -0
- package/dist/{pt-BR-Bcc5Tjed.js → pt-BR-BWFokdTU.js} +49 -2
- package/dist/{cdn/chunks/pt-BR-B2ZvFlRL.js → pt-BR-w2sGzHNX.js} +0 -26
- package/dist/{refresh-cw-DlYfl65Y.js → refresh-cw-maKlg0dl.js} +1 -1
- package/dist/{scan-line-CHadrYVb.js → scan-line-BFgesTOY.js} +1 -1
- package/dist/{send-CbP40otC.js → send-B70aQDrA.js} +1 -1
- package/dist/{shield-check-Bnj9aRoJ.js → shield-check-B7x5OKt5.js} +1 -1
- package/dist/{sparkles-CncWT57a.js → sparkles-DVlm1Ipp.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-DkF_-uX8.js → styles-PcOPXvLO.js} +1235 -1151
- package/dist/templatical-editor.js +134 -125
- package/dist/{text-align-start-B458vzYw.js → text-align-start-Vay3Kvo2.js} +1 -1
- package/dist/{trash-2-DO0yjSU1.js → trash-2-DE8CmxAG.js} +1 -1
- package/dist/{triangle-alert-C18_ima6.js → triangle-alert-Djg6IG8N.js} +1 -1
- package/dist/{upload-DsCd2zTR.js → upload-BwwE0U6G.js} +1 -1
- package/dist/{useCloudI18n-PCDOC2kz.js → useCloudI18n-BmiygEM4.js} +1 -1
- package/dist/{useEditorCore-kKUemYY6.js → useEditorCore-CT1slufs.js} +997 -817
- package/dist/{useI18n-BNMzZTM5.js → useI18n-D2L9Mkik.js} +1 -1
- package/dist/{useMergeTag-DfEY0eK5.js → useMergeTag-BTdDq5DC.js} +1 -1
- package/dist/{usePopoverPosition-F9STHRIr.js → usePopoverPosition-BO2LNy5n.js} +1 -1
- package/dist/{x-BCFQuE_q.js → x-CkD6A1iB.js} +1 -1
- package/package.json +21 -21
- package/dist/CommentsSidebar-D-o5Stlg.js +0 -442
- package/dist/CountdownBlock-Bn5w7C-p.js +0 -92
- package/dist/ModuleBrowserModal-AJt--JPh.js +0 -202
- package/dist/ModulePreviewCanvas-BKYOcVCh.js +0 -106
- package/dist/NumberWithSuffix-Bf3rNxza.js +0 -89
- package/dist/SaveModuleDialog-B4QX9eiv.js +0 -125
- package/dist/ToggleSwitch-DUNuUPsZ.js +0 -37
- package/dist/cdn/chunks/CloudEditor-CEa3Xgqh.js.map +0 -1
- package/dist/cdn/chunks/CountdownBlock-eGUE7hhw.js +0 -93
- package/dist/cdn/chunks/ModuleBrowserModal-DznWWtBI.js +0 -198
- package/dist/cdn/chunks/ModuleBrowserModal-DznWWtBI.js.map +0 -1
- package/dist/cdn/chunks/ModulePreviewCanvas-D-h7fr87.js +0 -107
- package/dist/cdn/chunks/ModulePreviewCanvas-D-h7fr87.js.map +0 -1
- package/dist/cdn/chunks/NumberWithSuffix-Dt-0odUN.js +0 -91
- package/dist/cdn/chunks/NumberWithSuffix-Dt-0odUN.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-BpFhTi-k.js +0 -120
- package/dist/cdn/chunks/SaveModuleDialog-BpFhTi-k.js.map +0 -1
- package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js +0 -39
- package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-B0Hjh42a.js +0 -22
- package/dist/cdn/chunks/ca-DbWoy4rG.js.map +0 -1
- package/dist/cdn/chunks/de-CgGOnerg.js.map +0 -1
- package/dist/cdn/chunks/en-DrUV9xth.js.map +0 -1
- package/dist/cdn/chunks/es-DwbKjU7q.js.map +0 -1
- package/dist/cdn/chunks/features-CLIZ7Q-Y.js +0 -7657
- package/dist/cdn/chunks/features-CLIZ7Q-Y.js.map +0 -1
- package/dist/cdn/chunks/icons-GX40Qm2W.js +0 -690
- package/dist/cdn/chunks/icons-GX40Qm2W.js.map +0 -1
- package/dist/cdn/chunks/media-library-yYAkAagU.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-Bcc5Tjed.js.map +0 -1
- package/dist/cdn/chunks/quality-DffYv9j5.js +0 -2180
- package/dist/cdn/chunks/quality-DffYv9j5.js.map +0 -1
- package/dist/cdn/chunks/renderer-DpBGiXOg.js.map +0 -1
- package/dist/cdn/chunks/src-9K6uFiuK.js +0 -509
- package/dist/cdn/chunks/src-9K6uFiuK.js.map +0 -1
- package/dist/cdn/chunks/styles-DHSmjlpX.js.map +0 -1
- package/dist/cdn/chunks/tiptap-C2indasq.js.map +0 -1
- package/dist/dist-BDVm2MrW.js +0 -5
- package/dist/dist-DbekZDmJ.js +0 -5
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { A as e, H as t, L as n, M as r, P as i, T as a, V as o, Z as s, c, ct as l, f as u, g as d, h as f, it as p, k as m, l as h, m as g, o as _, ot as v, p as y, st as b, t as x, u as S, v as C, x as w, y as T, z as E } from "./draggable-D840DIZB.js";
|
|
2
|
+
import { M as D } from "./useEditorCore-BA6mspzD.js";
|
|
3
|
+
import { B as O, P as k, f as A, h as j } from "./keys-D7kUmfpE.js";
|
|
4
|
+
import { t as M } from "./useI18n-8Wd7G-cq.js";
|
|
5
|
+
import { Pt as N, jt as P, mt as F, rt as I } from "./icons-CYWw8Xfp.js";
|
|
6
|
+
import { t as L } from "./TplModal-CH9RzKF7.js";
|
|
7
|
+
import { t as R } from "./SavedBlockPreviewCanvas-DZOMgNsz.js";
|
|
8
|
+
//#region src/components/SavedBlockPreviewRow.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relative tpl:min-w-0 tpl:flex-1" }, H = {
|
|
10
|
+
key: 0,
|
|
11
|
+
"data-testid": "saved-blocks-preview-fade",
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
class: "tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10",
|
|
14
|
+
style: { background: "linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n )" }
|
|
15
|
+
}, U = ["aria-label", "aria-expanded"], W = 600, G = 240, K = /* @__PURE__ */ w({
|
|
16
|
+
__name: "SavedBlockPreviewRow",
|
|
17
|
+
props: {
|
|
18
|
+
block: {},
|
|
19
|
+
position: {},
|
|
20
|
+
total: {}
|
|
21
|
+
},
|
|
22
|
+
emits: ["move"],
|
|
23
|
+
setup(t, { emit: i }) {
|
|
24
|
+
let o = t, _ = i, { t: v, format: x } = M(), S = a(A, []), w = s(null), E = s(null), O = s(1), k = s(null), j = s(!1), I = null, L = u(() => k.value !== null && k.value > G), K = u(() => k.value === null ? null : j.value || !L.value ? k.value : G);
|
|
25
|
+
function q() {
|
|
26
|
+
let e = w.value, t = E.value;
|
|
27
|
+
if (!e || !t) return;
|
|
28
|
+
let n = e.clientWidth;
|
|
29
|
+
if (n <= 0) return;
|
|
30
|
+
let r = Math.min(1, n / W);
|
|
31
|
+
O.value = r, k.value = t.offsetHeight * r;
|
|
32
|
+
}
|
|
33
|
+
e(() => {
|
|
34
|
+
q(), !(typeof ResizeObserver > "u") && (I = new ResizeObserver(() => q()), w.value && I.observe(w.value), E.value && I.observe(E.value));
|
|
35
|
+
}), m(() => {
|
|
36
|
+
I?.disconnect(), I = null;
|
|
37
|
+
});
|
|
38
|
+
let J = u(() => D(o.block, v, S)), Y = u(() => x(v.savedBlocks.reorderHandle, {
|
|
39
|
+
block: J.value,
|
|
40
|
+
position: o.position,
|
|
41
|
+
total: o.total
|
|
42
|
+
})), X = u(() => x(j.value ? v.savedBlocks.collapsePreview : v.savedBlocks.expandPreview, { block: J.value }));
|
|
43
|
+
return (e, i) => (r(), d("div", {
|
|
44
|
+
"data-testid": "saved-blocks-reorder-row",
|
|
45
|
+
"data-block-id": t.block.id,
|
|
46
|
+
class: "tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]",
|
|
47
|
+
style: { "background-color": "var(--tpl-bg)" }
|
|
48
|
+
}, [y("button", {
|
|
49
|
+
type: "button",
|
|
50
|
+
"data-testid": "saved-blocks-reorder-handle",
|
|
51
|
+
class: "tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]",
|
|
52
|
+
"aria-label": Y.value,
|
|
53
|
+
title: p(v).savedBlocks.reorderHint,
|
|
54
|
+
onKeydown: [i[0] ||= c(h((e) => _("move", -1), ["prevent"]), ["up"]), i[1] ||= c(h((e) => _("move", 1), ["prevent"]), ["down"])]
|
|
55
|
+
}, [T(p(F), {
|
|
56
|
+
size: 14,
|
|
57
|
+
"stroke-width": 1.5
|
|
58
|
+
})], 40, B), y("div", V, [
|
|
59
|
+
y("div", {
|
|
60
|
+
ref_key: "frameEl",
|
|
61
|
+
ref: w,
|
|
62
|
+
class: "tpl:overflow-hidden",
|
|
63
|
+
style: b({ height: K.value === null ? void 0 : `${K.value}px` })
|
|
64
|
+
}, [y("div", {
|
|
65
|
+
ref_key: "contentEl",
|
|
66
|
+
ref: E,
|
|
67
|
+
style: b({
|
|
68
|
+
width: `${W}px`,
|
|
69
|
+
transform: `scale(${O.value})`,
|
|
70
|
+
transformOrigin: "top left"
|
|
71
|
+
})
|
|
72
|
+
}, [T(R, { blocks: [t.block] }, null, 8, ["blocks"])], 4)], 4),
|
|
73
|
+
L.value && !j.value ? (r(), d("div", H)) : f("", !0),
|
|
74
|
+
L.value ? (r(), d("button", {
|
|
75
|
+
key: 1,
|
|
76
|
+
type: "button",
|
|
77
|
+
"data-testid": "saved-blocks-preview-toggle",
|
|
78
|
+
class: "tpl:absolute tpl:bottom-1 tpl:right-1 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)]",
|
|
79
|
+
"aria-label": X.value,
|
|
80
|
+
"aria-expanded": j.value,
|
|
81
|
+
onClick: i[2] ||= (e) => j.value = !j.value
|
|
82
|
+
}, [(r(), g(n(p(j.value ? P : N)), {
|
|
83
|
+
size: 11,
|
|
84
|
+
"stroke-width": 2
|
|
85
|
+
})), C(" " + l(j.value ? p(v).savedBlocks.collapse : p(v).savedBlocks.expand), 1)], 8, U)) : f("", !0)
|
|
86
|
+
])], 8, z));
|
|
87
|
+
}
|
|
88
|
+
}), q = ["aria-busy"], J = {
|
|
89
|
+
id: "tpl-save-block-title",
|
|
90
|
+
class: "tpl:mb-4 tpl:shrink-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
91
|
+
}, Y = { class: "tpl:mb-3 tpl:shrink-0" }, X = { class: "tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, ee = ["placeholder", "disabled"], te = { class: "tpl:mb-3 tpl:shrink-0" }, ne = {
|
|
92
|
+
for: "tpl-save-block-category",
|
|
93
|
+
class: "tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]"
|
|
94
|
+
}, re = ["placeholder", "disabled"], ie = { id: "tpl-saved-block-categories" }, ae = ["value"], oe = {
|
|
95
|
+
"data-testid": "saved-blocks-save-summary",
|
|
96
|
+
class: "tpl:mb-1.5 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
97
|
+
}, se = { class: "tpl:text-[var(--tpl-text-dim)]" }, ce = {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: "tpl:mb-1.5 tpl:shrink-0 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]"
|
|
100
|
+
}, le = {
|
|
101
|
+
class: "tpl-sr-only",
|
|
102
|
+
role: "status",
|
|
103
|
+
"aria-live": "polite",
|
|
104
|
+
"aria-atomic": "true"
|
|
105
|
+
}, ue = {
|
|
106
|
+
key: 1,
|
|
107
|
+
role: "alert",
|
|
108
|
+
class: "tpl:mb-3 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-danger)]"
|
|
109
|
+
}, de = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2" }, fe = ["disabled"], pe = ["disabled"], me = {
|
|
110
|
+
key: 0,
|
|
111
|
+
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
112
|
+
}, he = { key: 1 }, Z = /* @__PURE__ */ w({
|
|
113
|
+
__name: "SaveBlockDialog",
|
|
114
|
+
props: {
|
|
115
|
+
visible: { type: Boolean },
|
|
116
|
+
pickedIds: {}
|
|
117
|
+
},
|
|
118
|
+
emits: ["close", "saved"],
|
|
119
|
+
setup(e, { emit: n }) {
|
|
120
|
+
let c = e, m = n, { t: h, format: b } = M(), w = O(j, "SaveBlockDialog"), N = O(k, "SaveBlockDialog"), P = a(A, []), F = s(""), R = s(""), z = s(!1), B = s(null), V = s(""), H = s([]), U = u(() => {
|
|
121
|
+
let e = new Map(w.content.value.blocks.map((e) => [e.id, e]));
|
|
122
|
+
return H.value.map((t) => e.get(t)).filter((e) => e !== void 0);
|
|
123
|
+
}), W = u({
|
|
124
|
+
get: () => U.value,
|
|
125
|
+
set: (e) => {
|
|
126
|
+
H.value = e.map((e) => e.id);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
function G(e, t) {
|
|
130
|
+
let n = U.value.map((e) => e.id), r = n.indexOf(e), i = r + t;
|
|
131
|
+
if (r === -1 || i < 0 || i >= n.length) return;
|
|
132
|
+
[n[r], n[i]] = [n[i], n[r]], H.value = n;
|
|
133
|
+
let a = U.value[i];
|
|
134
|
+
V.value = a ? b(h.savedBlocks.reorderAnnouncement, {
|
|
135
|
+
block: Z(a),
|
|
136
|
+
position: i + 1,
|
|
137
|
+
total: n.length
|
|
138
|
+
}) : "";
|
|
139
|
+
}
|
|
140
|
+
function Z(e) {
|
|
141
|
+
return D(e, h, P);
|
|
142
|
+
}
|
|
143
|
+
let ge = u(() => U.value.map(Z).join(", "));
|
|
144
|
+
E(() => c.visible, (e) => {
|
|
145
|
+
e && (F.value = "", R.value = "", B.value = null, V.value = "", H.value = [...c.pickedIds]);
|
|
146
|
+
}, { immediate: !0 });
|
|
147
|
+
let Q = u(() => F.value.trim().length > 0 && U.value.length > 0 && !z.value);
|
|
148
|
+
async function _e() {
|
|
149
|
+
if (!Q.value) return;
|
|
150
|
+
let e = U.value;
|
|
151
|
+
if (e.length !== 0) {
|
|
152
|
+
z.value = !0, B.value = null;
|
|
153
|
+
try {
|
|
154
|
+
await N.create(F.value.trim(), e, R.value.trim() || void 0), m("saved"), m("close");
|
|
155
|
+
} catch (e) {
|
|
156
|
+
B.value = e.message;
|
|
157
|
+
} finally {
|
|
158
|
+
z.value = !1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function $() {
|
|
163
|
+
z.value || m("close");
|
|
164
|
+
}
|
|
165
|
+
function ve(e) {
|
|
166
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), _e()), e.key === "Escape" && $();
|
|
167
|
+
}
|
|
168
|
+
return (n, a) => (r(), g(L, {
|
|
169
|
+
visible: e.visible,
|
|
170
|
+
onClose: $,
|
|
171
|
+
onKeydown: ve
|
|
172
|
+
}, {
|
|
173
|
+
default: o(() => [y("div", {
|
|
174
|
+
role: "dialog",
|
|
175
|
+
"aria-modal": "true",
|
|
176
|
+
"aria-busy": z.value,
|
|
177
|
+
"aria-labelledby": "tpl-save-block-title",
|
|
178
|
+
class: "tpl-scale-in tpl:mx-4 tpl:flex tpl:w-full tpl:max-w-2xl tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
179
|
+
style: {
|
|
180
|
+
"background-color": "var(--tpl-bg-elevated)",
|
|
181
|
+
"box-shadow": "var(--tpl-shadow-xl)",
|
|
182
|
+
"max-height": "90vh"
|
|
183
|
+
}
|
|
184
|
+
}, [
|
|
185
|
+
y("h3", J, l(p(h).savedBlocks.saveAsBlock), 1),
|
|
186
|
+
y("div", Y, [y("label", X, l(p(h).savedBlocks.name), 1), t(y("input", {
|
|
187
|
+
"onUpdate:modelValue": a[0] ||= (e) => F.value = e,
|
|
188
|
+
type: "text",
|
|
189
|
+
"data-testid": "saved-blocks-name-input",
|
|
190
|
+
placeholder: p(h).savedBlocks.namePlaceholder,
|
|
191
|
+
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
|
|
192
|
+
disabled: z.value
|
|
193
|
+
}, null, 8, ee), [[_, F.value]])]),
|
|
194
|
+
y("div", te, [
|
|
195
|
+
y("label", ne, l(p(h).savedBlocks.category), 1),
|
|
196
|
+
t(y("input", {
|
|
197
|
+
id: "tpl-save-block-category",
|
|
198
|
+
"onUpdate:modelValue": a[1] ||= (e) => R.value = e,
|
|
199
|
+
type: "text",
|
|
200
|
+
"data-testid": "saved-blocks-category-input",
|
|
201
|
+
list: "tpl-saved-block-categories",
|
|
202
|
+
placeholder: p(h).savedBlocks.categoryPlaceholder,
|
|
203
|
+
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
|
|
204
|
+
disabled: z.value
|
|
205
|
+
}, null, 8, re), [[_, R.value]]),
|
|
206
|
+
y("datalist", ie, [(r(!0), d(S, null, i(p(N).categories.value, (e) => (r(), d("option", {
|
|
207
|
+
key: e,
|
|
208
|
+
value: e
|
|
209
|
+
}, null, 8, ae))), 128))])
|
|
210
|
+
]),
|
|
211
|
+
y("p", oe, [C(l(p(b)(p(h).savedBlocks.savingCount, { count: U.value.length })) + " ", 1), y("span", se, l(ge.value), 1)]),
|
|
212
|
+
U.value.length > 1 ? (r(), d("p", ce, l(p(h).savedBlocks.reorderHint), 1)) : f("", !0),
|
|
213
|
+
T(p(x), {
|
|
214
|
+
modelValue: W.value,
|
|
215
|
+
"onUpdate:modelValue": a[2] ||= (e) => W.value = e,
|
|
216
|
+
"data-testid": "saved-blocks-reorder-list",
|
|
217
|
+
animation: 150,
|
|
218
|
+
"ghost-class": "tpl-ghost",
|
|
219
|
+
"drag-class": "tpl-dragging",
|
|
220
|
+
handle: ".tpl-saved-block-reorder-handle",
|
|
221
|
+
"force-fallback": !0,
|
|
222
|
+
class: "tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto"
|
|
223
|
+
}, {
|
|
224
|
+
default: o(() => [(r(!0), d(S, null, i(W.value, (e, t) => (r(), g(K, {
|
|
225
|
+
key: e.id,
|
|
226
|
+
block: e,
|
|
227
|
+
position: t + 1,
|
|
228
|
+
total: W.value.length,
|
|
229
|
+
onMove: (t) => G(e.id, t)
|
|
230
|
+
}, null, 8, [
|
|
231
|
+
"block",
|
|
232
|
+
"position",
|
|
233
|
+
"total",
|
|
234
|
+
"onMove"
|
|
235
|
+
]))), 128))]),
|
|
236
|
+
_: 1
|
|
237
|
+
}, 8, ["modelValue"]),
|
|
238
|
+
y("div", le, l(V.value), 1),
|
|
239
|
+
B.value ? (r(), d("p", ue, l(B.value), 1)) : f("", !0),
|
|
240
|
+
y("div", de, [y("button", {
|
|
241
|
+
type: "button",
|
|
242
|
+
class: v(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]", { "tpl:cursor-not-allowed tpl:opacity-50": z.value }]),
|
|
243
|
+
disabled: z.value,
|
|
244
|
+
onClick: $
|
|
245
|
+
}, l(p(h).savedBlocks.cancel), 11, fe), y("button", {
|
|
246
|
+
type: "button",
|
|
247
|
+
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
248
|
+
disabled: !Q.value,
|
|
249
|
+
onClick: _e
|
|
250
|
+
}, [z.value ? (r(), d("span", me, [T(p(I), {
|
|
251
|
+
class: "tpl:animate-spin",
|
|
252
|
+
size: 12,
|
|
253
|
+
"stroke-width": 2
|
|
254
|
+
}), C(" " + l(p(h).savedBlocks.saving), 1)])) : (r(), d("span", he, l(p(h).savedBlocks.save), 1))], 8, pe)])
|
|
255
|
+
], 8, q)]),
|
|
256
|
+
_: 1
|
|
257
|
+
}, 8, ["visible"]));
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
//#endregion
|
|
261
|
+
export { Z as default };
|
|
262
|
+
|
|
263
|
+
//# sourceMappingURL=SaveBlockDialog-Bb3fdUEZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveBlockDialog-Bb3fdUEZ.js","names":[],"sources":["../../../src/components/SavedBlockPreviewRow.vue","../../../src/components/SavedBlockPreviewRow.vue","../../../src/components/SaveBlockDialog.vue","../../../src/components/SaveBlockDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One reorderable row in the save dialog's preview list: a grip handle beside a\n * scaled-down render of the real block.\n *\n * The preview is the same `SavedBlockPreviewCanvas` the browser modal uses, so\n * a row shows what the block actually looks like rather than a description of\n * it. That canvas is fixed at the 600px email width every block component\n * renders against, so the row shrinks it with `transform: scale()` instead of\n * re-flowing it at dialog width — a re-flow would show a layout the recipient\n * will never see.\n *\n * `transform` doesn't participate in layout, so the frame would keep reserving\n * the full unscaled height; a `ResizeObserver` mirrors the scaled height back\n * onto it. The handle is a sibling of the scaled subtree, so it stays full size\n * and keeps its real hit area.\n *\n * Row chrome uses the raw theme tokens, not the `--tpl-chrome-*` aliases: the\n * chrome is an ancestor and a sibling of the rendered email content, never a\n * descendant, so the `.tpl-block-content` token override can't reach it.\n */\nimport SavedBlockPreviewCanvas from \"./SavedBlockPreviewCanvas.vue\";\nimport { useI18n } from \"../composables\";\nimport { CUSTOM_BLOCK_DEFINITIONS_KEY } from \"../keys\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { ChevronDown, ChevronUp, GripVertical } from \"@lucide/vue\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, onBeforeUnmount, onMounted, ref } from \"vue\";\n\nconst props = defineProps<{\n block: Block;\n /** 1-based position in the list — spoken by the handle's label. */\n position: number;\n total: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"move\", delta: -1 | 1): void;\n}>();\n\nconst { t, format } = useI18n();\n// Optional: absent when the consumer registers no custom blocks.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\n/** The email width every block component lays itself out against. */\nconst PREVIEW_WIDTH = 600;\n/**\n * Collapsed height for a tall block. A hero card or a multi-row section would\n * otherwise be taller than the whole list, leaving one row on screen — and\n * seeing the rows together is what makes them orderable. Anything taller\n * collapses to this, fades out at the cut, and can be expanded in place.\n */\nconst COLLAPSED_HEIGHT = 240;\n\nconst frameEl = ref<HTMLElement | null>(null);\nconst contentEl = ref<HTMLElement | null>(null);\nconst scale = ref(1);\n/** Scaled height of the whole block; `null` until first measured. */\nconst fullHeight = ref<number | null>(null);\nconst expanded = ref(false);\n\nlet observer: ResizeObserver | null = null;\n\n/** Only a block taller than the collapsed cap needs fading or expanding. */\nconst isClipped = computed(\n () => fullHeight.value !== null && fullHeight.value > COLLAPSED_HEIGHT,\n);\n\nconst frameHeight = computed(() => {\n if (fullHeight.value === null) return null;\n if (expanded.value || !isClipped.value) return fullHeight.value;\n return COLLAPSED_HEIGHT;\n});\n\nfunction measure(): void {\n const frame = frameEl.value;\n const content = contentEl.value;\n if (!frame || !content) return;\n const width = frame.clientWidth;\n if (width <= 0) return;\n // Never scale up: a dialog wider than the email would blow the preview past\n // its real proportions.\n const next = Math.min(1, width / PREVIEW_WIDTH);\n scale.value = next;\n fullHeight.value = content.offsetHeight * next;\n}\n\nonMounted(() => {\n measure();\n // Absent in non-DOM test environments. Without it the frame simply falls back\n // to the untransformed height and clips — degraded, never broken.\n if (typeof ResizeObserver === \"undefined\") return;\n observer = new ResizeObserver(() => measure());\n if (frameEl.value) observer.observe(frameEl.value);\n if (contentEl.value) observer.observe(contentEl.value);\n});\n\nonBeforeUnmount(() => {\n observer?.disconnect();\n observer = null;\n});\n\nconst blockLabel = computed(() =>\n getBlockLabel(props.block, t, customBlockDefinitions),\n);\n\nconst handleLabel = computed(() =>\n format(t.savedBlocks.reorderHandle, {\n block: blockLabel.value,\n position: props.position,\n total: props.total,\n }),\n);\n\nconst toggleLabel = computed(() =>\n format(\n expanded.value\n ? t.savedBlocks.collapsePreview\n : t.savedBlocks.expandPreview,\n { block: blockLabel.value },\n ),\n);\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-reorder-row\"\n :data-block-id=\"block.id\"\n class=\"tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]\"\n style=\"background-color: var(--tpl-bg)\"\n >\n <!-- Sortable's `handle` selector points here, so a pointer-drag can only\n start from the grip — never from the preview itself. -->\n <button\n type=\"button\"\n data-testid=\"saved-blocks-reorder-handle\"\n class=\"tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]\"\n :aria-label=\"handleLabel\"\n :title=\"t.savedBlocks.reorderHint\"\n @keydown.up.prevent=\"emit('move', -1)\"\n @keydown.down.prevent=\"emit('move', 1)\"\n >\n <GripVertical :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n\n <div class=\"tpl:relative tpl:min-w-0 tpl:flex-1\">\n <div\n ref=\"frameEl\"\n class=\"tpl:overflow-hidden\"\n :style=\"{\n height: frameHeight !== null ? `${frameHeight}px` : undefined,\n }\"\n >\n <div\n ref=\"contentEl\"\n :style=\"{\n width: `${PREVIEW_WIDTH}px`,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }\"\n >\n <SavedBlockPreviewCanvas :blocks=\"[block]\" />\n </div>\n </div>\n\n <!-- Fade over the cut, so a clipped block reads as truncated rather than\n as a block that simply ends there. Pointer-transparent: it sits over\n the preview, and swallowing clicks would break the row. -->\n <div\n v-if=\"isClipped && !expanded\"\n data-testid=\"saved-blocks-preview-fade\"\n aria-hidden=\"true\"\n class=\"tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10\"\n style=\"\n background: linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n );\n \"\n />\n\n <button\n v-if=\"isClipped\"\n type=\"button\"\n data-testid=\"saved-blocks-preview-toggle\"\n class=\"tpl:absolute tpl:bottom-1 tpl:right-1 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"toggleLabel\"\n :aria-expanded=\"expanded\"\n @click=\"expanded = !expanded\"\n >\n <component\n :is=\"expanded ? ChevronUp : ChevronDown\"\n :size=\"11\"\n :stroke-width=\"2\"\n />\n {{ expanded ? t.savedBlocks.collapse : t.savedBlocks.expand }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * One reorderable row in the save dialog's preview list: a grip handle beside a\n * scaled-down render of the real block.\n *\n * The preview is the same `SavedBlockPreviewCanvas` the browser modal uses, so\n * a row shows what the block actually looks like rather than a description of\n * it. That canvas is fixed at the 600px email width every block component\n * renders against, so the row shrinks it with `transform: scale()` instead of\n * re-flowing it at dialog width — a re-flow would show a layout the recipient\n * will never see.\n *\n * `transform` doesn't participate in layout, so the frame would keep reserving\n * the full unscaled height; a `ResizeObserver` mirrors the scaled height back\n * onto it. The handle is a sibling of the scaled subtree, so it stays full size\n * and keeps its real hit area.\n *\n * Row chrome uses the raw theme tokens, not the `--tpl-chrome-*` aliases: the\n * chrome is an ancestor and a sibling of the rendered email content, never a\n * descendant, so the `.tpl-block-content` token override can't reach it.\n */\nimport SavedBlockPreviewCanvas from \"./SavedBlockPreviewCanvas.vue\";\nimport { useI18n } from \"../composables\";\nimport { CUSTOM_BLOCK_DEFINITIONS_KEY } from \"../keys\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { ChevronDown, ChevronUp, GripVertical } from \"@lucide/vue\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, onBeforeUnmount, onMounted, ref } from \"vue\";\n\nconst props = defineProps<{\n block: Block;\n /** 1-based position in the list — spoken by the handle's label. */\n position: number;\n total: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"move\", delta: -1 | 1): void;\n}>();\n\nconst { t, format } = useI18n();\n// Optional: absent when the consumer registers no custom blocks.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\n/** The email width every block component lays itself out against. */\nconst PREVIEW_WIDTH = 600;\n/**\n * Collapsed height for a tall block. A hero card or a multi-row section would\n * otherwise be taller than the whole list, leaving one row on screen — and\n * seeing the rows together is what makes them orderable. Anything taller\n * collapses to this, fades out at the cut, and can be expanded in place.\n */\nconst COLLAPSED_HEIGHT = 240;\n\nconst frameEl = ref<HTMLElement | null>(null);\nconst contentEl = ref<HTMLElement | null>(null);\nconst scale = ref(1);\n/** Scaled height of the whole block; `null` until first measured. */\nconst fullHeight = ref<number | null>(null);\nconst expanded = ref(false);\n\nlet observer: ResizeObserver | null = null;\n\n/** Only a block taller than the collapsed cap needs fading or expanding. */\nconst isClipped = computed(\n () => fullHeight.value !== null && fullHeight.value > COLLAPSED_HEIGHT,\n);\n\nconst frameHeight = computed(() => {\n if (fullHeight.value === null) return null;\n if (expanded.value || !isClipped.value) return fullHeight.value;\n return COLLAPSED_HEIGHT;\n});\n\nfunction measure(): void {\n const frame = frameEl.value;\n const content = contentEl.value;\n if (!frame || !content) return;\n const width = frame.clientWidth;\n if (width <= 0) return;\n // Never scale up: a dialog wider than the email would blow the preview past\n // its real proportions.\n const next = Math.min(1, width / PREVIEW_WIDTH);\n scale.value = next;\n fullHeight.value = content.offsetHeight * next;\n}\n\nonMounted(() => {\n measure();\n // Absent in non-DOM test environments. Without it the frame simply falls back\n // to the untransformed height and clips — degraded, never broken.\n if (typeof ResizeObserver === \"undefined\") return;\n observer = new ResizeObserver(() => measure());\n if (frameEl.value) observer.observe(frameEl.value);\n if (contentEl.value) observer.observe(contentEl.value);\n});\n\nonBeforeUnmount(() => {\n observer?.disconnect();\n observer = null;\n});\n\nconst blockLabel = computed(() =>\n getBlockLabel(props.block, t, customBlockDefinitions),\n);\n\nconst handleLabel = computed(() =>\n format(t.savedBlocks.reorderHandle, {\n block: blockLabel.value,\n position: props.position,\n total: props.total,\n }),\n);\n\nconst toggleLabel = computed(() =>\n format(\n expanded.value\n ? t.savedBlocks.collapsePreview\n : t.savedBlocks.expandPreview,\n { block: blockLabel.value },\n ),\n);\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-reorder-row\"\n :data-block-id=\"block.id\"\n class=\"tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]\"\n style=\"background-color: var(--tpl-bg)\"\n >\n <!-- Sortable's `handle` selector points here, so a pointer-drag can only\n start from the grip — never from the preview itself. -->\n <button\n type=\"button\"\n data-testid=\"saved-blocks-reorder-handle\"\n class=\"tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]\"\n :aria-label=\"handleLabel\"\n :title=\"t.savedBlocks.reorderHint\"\n @keydown.up.prevent=\"emit('move', -1)\"\n @keydown.down.prevent=\"emit('move', 1)\"\n >\n <GripVertical :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n\n <div class=\"tpl:relative tpl:min-w-0 tpl:flex-1\">\n <div\n ref=\"frameEl\"\n class=\"tpl:overflow-hidden\"\n :style=\"{\n height: frameHeight !== null ? `${frameHeight}px` : undefined,\n }\"\n >\n <div\n ref=\"contentEl\"\n :style=\"{\n width: `${PREVIEW_WIDTH}px`,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }\"\n >\n <SavedBlockPreviewCanvas :blocks=\"[block]\" />\n </div>\n </div>\n\n <!-- Fade over the cut, so a clipped block reads as truncated rather than\n as a block that simply ends there. Pointer-transparent: it sits over\n the preview, and swallowing clicks would break the row. -->\n <div\n v-if=\"isClipped && !expanded\"\n data-testid=\"saved-blocks-preview-fade\"\n aria-hidden=\"true\"\n class=\"tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10\"\n style=\"\n background: linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n );\n \"\n />\n\n <button\n v-if=\"isClipped\"\n type=\"button\"\n data-testid=\"saved-blocks-preview-toggle\"\n class=\"tpl:absolute tpl:bottom-1 tpl:right-1 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"toggleLabel\"\n :aria-expanded=\"expanded\"\n @click=\"expanded = !expanded\"\n >\n <component\n :is=\"expanded ? ChevronUp : ChevronDown\"\n :size=\"11\"\n :stroke-width=\"2\"\n />\n {{ expanded ? t.savedBlocks.collapse : t.savedBlocks.expand }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport SavedBlockPreviewRow from \"./SavedBlockPreviewRow.vue\";\nimport TplModal from \"./TplModal.vue\";\nimport { useI18n } from \"../composables\";\nimport {\n CUSTOM_BLOCK_DEFINITIONS_KEY,\n EDITOR_KEY,\n SAVED_BLOCKS_KEY,\n requireInject,\n} from \"../keys\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { LoaderCircle } from \"@lucide/vue\";\nimport { VueDraggable } from \"vue-draggable-plus\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, ref, watch } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n /**\n * Blocks chosen during the canvas pick session, in the order they were\n * picked — `pickedIds` is built from a `Set`, which iterates in insertion\n * order. That order seeds the reorderable list below. Every id must be a\n * top-level block, which is what the session guarantees.\n */\n pickedIds: readonly string[];\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"saved\"): void;\n}>();\n\nconst { t, format } = useI18n();\nconst editor = requireInject(EDITOR_KEY, \"SaveBlockDialog\");\nconst savedBlocks = requireInject(SAVED_BLOCKS_KEY, \"SaveBlockDialog\");\n// Optional: a consumer with no custom blocks never provides definitions, and\n// the label helper degrades to the type slug rather than throwing.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst name = ref(\"\");\nconst category = ref(\"\");\nconst isSaving = ref(false);\nconst error = ref<string | null>(null);\nconst announcement = ref(\"\");\n\n/**\n * The order the blocks will be saved in: seeded from the pick order, then owned\n * by this dialog once the user drags a row.\n *\n * Ids rather than blocks, deliberately. Resolving late means a block edited\n * while the dialog is open (a collaborator in Cloud) is persisted as it stands\n * at save time, not as it looked when the dialog opened, and an id that stops\n * resolving drops out on its own instead of leaving a stale snapshot behind.\n */\nconst orderedIds = ref<string[]>([]);\n\n/**\n * The picked blocks in the list's current order. Ids that no longer resolve (a\n * block deleted mid-session) simply drop out.\n */\nconst pickedBlocks = computed(() => {\n const byId = new Map(editor.content.value.blocks.map((b) => [b.id, b]));\n return orderedIds.value\n .map((id) => byId.get(id))\n .filter((b): b is Block => b !== undefined);\n});\n\n/**\n * Sortable's model. The setter reads ids straight back off the emitted entries\n * rather than storing them, so a Sortable `el` expando can never reach the\n * payload `create()` sends to the provider — and because the getter is already\n * filtered, writing through it prunes unresolvable ids too.\n */\nconst orderedBlocks = computed<Block[]>({\n get: () => pickedBlocks.value,\n set: (blocks) => {\n orderedIds.value = blocks.map((b) => b.id);\n },\n});\n\n/** Keyboard reorder from a focused grip: swap with the neighbouring row. */\nfunction moveBlock(blockId: string, delta: -1 | 1): void {\n const order = pickedBlocks.value.map((b) => b.id);\n const from = order.indexOf(blockId);\n const to = from + delta;\n if (from === -1 || to < 0 || to >= order.length) return;\n [order[from], order[to]] = [order[to], order[from]];\n orderedIds.value = order;\n\n const moved = pickedBlocks.value[to];\n announcement.value = moved\n ? format(t.savedBlocks.reorderAnnouncement, {\n block: label(moved),\n position: to + 1,\n total: order.length,\n })\n : \"\";\n}\n\n/** Custom blocks read as the consumer's name for them, not the type `custom`. */\nfunction label(block: Block): string {\n return getBlockLabel(block, t, customBlockDefinitions);\n}\n\n/** e.g. \"Title, Paragraph, Button\" — what the user is about to save. */\nconst summary = computed(() => pickedBlocks.value.map(label).join(\", \"));\n\n// `immediate` matters: the dialog is mounted lazily behind a `v-if` on the\n// same state that drives `visible`, so it can mount with `visible` already\n// true and would otherwise never reset the name field or seed the order.\nwatch(\n () => props.visible,\n (visible) => {\n if (visible) {\n name.value = \"\";\n category.value = \"\";\n error.value = null;\n announcement.value = \"\";\n orderedIds.value = [...props.pickedIds];\n }\n },\n { immediate: true },\n);\n\nconst canSave = computed(\n () =>\n name.value.trim().length > 0 &&\n pickedBlocks.value.length > 0 &&\n !isSaving.value,\n);\n\nasync function handleSave(): Promise<void> {\n if (!canSave.value) return;\n\n const blocks = pickedBlocks.value;\n // Defence in depth: never persist an empty saved block (it would list as\n // \"0 block(s)\" and insert nothing). Guards a pick set whose ids no longer\n // resolve to anything on the canvas.\n if (blocks.length === 0) return;\n\n isSaving.value = true;\n error.value = null;\n\n try {\n // Empty stays undefined rather than \"\": an entry is either categorised or\n // it isn't, and a blank string would show up as a nameless filter option.\n await savedBlocks.create(\n name.value.trim(),\n blocks,\n category.value.trim() || undefined,\n );\n emit(\"saved\");\n emit(\"close\");\n } catch (err) {\n error.value = (err as Error).message;\n } finally {\n isSaving.value = false;\n }\n}\n\nfunction handleClose(): void {\n if (!isSaving.value) {\n emit(\"close\");\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n handleSave();\n }\n if (event.key === \"Escape\") {\n handleClose();\n }\n}\n</script>\n\n<template>\n <TplModal :visible=\"visible\" @close=\"handleClose\" @keydown=\"handleKeydown\">\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-busy=\"isSaving\"\n aria-labelledby=\"tpl-save-block-title\"\n class=\"tpl-scale-in tpl:mx-4 tpl:flex tpl:w-full tpl:max-w-2xl tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5\"\n style=\"\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n max-height: 90vh;\n \"\n >\n <h3\n id=\"tpl-save-block-title\"\n class=\"tpl:mb-4 tpl:shrink-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ t.savedBlocks.saveAsBlock }}\n </h3>\n\n <!-- Saved block name -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.name }}\n </label>\n <input\n v-model=\"name\"\n type=\"text\"\n data-testid=\"saved-blocks-name-input\"\n :placeholder=\"t.savedBlocks.namePlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n </div>\n\n <!-- Category: free text, with the already-used categories offered as\n suggestions. A datalist rather than a <select> because the set is\n derived from existing entries — there is no registry to pick from,\n and the first entry in a category has to be able to name it. -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n for=\"tpl-save-block-category\"\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.category }}\n </label>\n <input\n id=\"tpl-save-block-category\"\n v-model=\"category\"\n type=\"text\"\n data-testid=\"saved-blocks-category-input\"\n list=\"tpl-saved-block-categories\"\n :placeholder=\"t.savedBlocks.categoryPlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n <datalist id=\"tpl-saved-block-categories\">\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n />\n </datalist>\n </div>\n\n <!-- Summary of what the pick session chose. Which blocks were picked is\n settled on the canvas — the dialog re-presents them only so the user\n can see and order what they're about to save. -->\n <p\n data-testid=\"saved-blocks-save-summary\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ format(t.savedBlocks.savingCount, { count: pickedBlocks.length }) }}\n <span class=\"tpl:text-[var(--tpl-text-dim)]\">{{ summary }}</span>\n </p>\n\n <!-- Reorderable preview. Seeded in pick order and saved in whatever order\n the list ends up in. Its own Sortable instance with no `group`, so it\n can never exchange items with the canvas or a section column. -->\n <p\n v-if=\"pickedBlocks.length > 1\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.reorderHint }}\n </p>\n <!-- The only growing region: takes whatever the dialog's 90vh cap leaves\n after the fixed chrome, rather than a hand-tuned vh guess that a row\n expanding to full height would blow past. `min-h-0` is what lets a\n flex child actually shrink below its content and scroll. -->\n <VueDraggable\n v-model=\"orderedBlocks\"\n data-testid=\"saved-blocks-reorder-list\"\n :animation=\"150\"\n ghost-class=\"tpl-ghost\"\n drag-class=\"tpl-dragging\"\n handle=\".tpl-saved-block-reorder-handle\"\n :force-fallback=\"true\"\n class=\"tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto\"\n >\n <SavedBlockPreviewRow\n v-for=\"(block, index) in orderedBlocks\"\n :key=\"block.id\"\n :block=\"block\"\n :position=\"index + 1\"\n :total=\"orderedBlocks.length\"\n @move=\"(delta) => moveBlock(block.id, delta)\"\n />\n </VueDraggable>\n\n <!-- Keyboard reorder announcement region (visually hidden, live) -->\n <div\n class=\"tpl-sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ announcement }}\n </div>\n\n <!-- Error message -->\n <p\n v-if=\"error\"\n role=\"alert\"\n class=\"tpl:mb-3 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ error }}\n </p>\n\n <!-- Actions -->\n <div class=\"tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n :disabled=\"isSaving\"\n :class=\"{\n 'tpl:cursor-not-allowed tpl:opacity-50': isSaving,\n }\"\n @click=\"handleClose\"\n >\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]\"\n :disabled=\"!canSave\"\n @click=\"handleSave\"\n >\n <span v-if=\"isSaving\" class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <LoaderCircle\n class=\"tpl:animate-spin\"\n :size=\"12\"\n :stroke-width=\"2\"\n />\n {{ t.savedBlocks.saving }}\n </span>\n <span v-else>\n {{ t.savedBlocks.save }}\n </span>\n </button>\n </div>\n </div>\n </TplModal>\n</template>\n","<script setup lang=\"ts\">\nimport SavedBlockPreviewRow from \"./SavedBlockPreviewRow.vue\";\nimport TplModal from \"./TplModal.vue\";\nimport { useI18n } from \"../composables\";\nimport {\n CUSTOM_BLOCK_DEFINITIONS_KEY,\n EDITOR_KEY,\n SAVED_BLOCKS_KEY,\n requireInject,\n} from \"../keys\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { LoaderCircle } from \"@lucide/vue\";\nimport { VueDraggable } from \"vue-draggable-plus\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, ref, watch } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n /**\n * Blocks chosen during the canvas pick session, in the order they were\n * picked — `pickedIds` is built from a `Set`, which iterates in insertion\n * order. That order seeds the reorderable list below. Every id must be a\n * top-level block, which is what the session guarantees.\n */\n pickedIds: readonly string[];\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"saved\"): void;\n}>();\n\nconst { t, format } = useI18n();\nconst editor = requireInject(EDITOR_KEY, \"SaveBlockDialog\");\nconst savedBlocks = requireInject(SAVED_BLOCKS_KEY, \"SaveBlockDialog\");\n// Optional: a consumer with no custom blocks never provides definitions, and\n// the label helper degrades to the type slug rather than throwing.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst name = ref(\"\");\nconst category = ref(\"\");\nconst isSaving = ref(false);\nconst error = ref<string | null>(null);\nconst announcement = ref(\"\");\n\n/**\n * The order the blocks will be saved in: seeded from the pick order, then owned\n * by this dialog once the user drags a row.\n *\n * Ids rather than blocks, deliberately. Resolving late means a block edited\n * while the dialog is open (a collaborator in Cloud) is persisted as it stands\n * at save time, not as it looked when the dialog opened, and an id that stops\n * resolving drops out on its own instead of leaving a stale snapshot behind.\n */\nconst orderedIds = ref<string[]>([]);\n\n/**\n * The picked blocks in the list's current order. Ids that no longer resolve (a\n * block deleted mid-session) simply drop out.\n */\nconst pickedBlocks = computed(() => {\n const byId = new Map(editor.content.value.blocks.map((b) => [b.id, b]));\n return orderedIds.value\n .map((id) => byId.get(id))\n .filter((b): b is Block => b !== undefined);\n});\n\n/**\n * Sortable's model. The setter reads ids straight back off the emitted entries\n * rather than storing them, so a Sortable `el` expando can never reach the\n * payload `create()` sends to the provider — and because the getter is already\n * filtered, writing through it prunes unresolvable ids too.\n */\nconst orderedBlocks = computed<Block[]>({\n get: () => pickedBlocks.value,\n set: (blocks) => {\n orderedIds.value = blocks.map((b) => b.id);\n },\n});\n\n/** Keyboard reorder from a focused grip: swap with the neighbouring row. */\nfunction moveBlock(blockId: string, delta: -1 | 1): void {\n const order = pickedBlocks.value.map((b) => b.id);\n const from = order.indexOf(blockId);\n const to = from + delta;\n if (from === -1 || to < 0 || to >= order.length) return;\n [order[from], order[to]] = [order[to], order[from]];\n orderedIds.value = order;\n\n const moved = pickedBlocks.value[to];\n announcement.value = moved\n ? format(t.savedBlocks.reorderAnnouncement, {\n block: label(moved),\n position: to + 1,\n total: order.length,\n })\n : \"\";\n}\n\n/** Custom blocks read as the consumer's name for them, not the type `custom`. */\nfunction label(block: Block): string {\n return getBlockLabel(block, t, customBlockDefinitions);\n}\n\n/** e.g. \"Title, Paragraph, Button\" — what the user is about to save. */\nconst summary = computed(() => pickedBlocks.value.map(label).join(\", \"));\n\n// `immediate` matters: the dialog is mounted lazily behind a `v-if` on the\n// same state that drives `visible`, so it can mount with `visible` already\n// true and would otherwise never reset the name field or seed the order.\nwatch(\n () => props.visible,\n (visible) => {\n if (visible) {\n name.value = \"\";\n category.value = \"\";\n error.value = null;\n announcement.value = \"\";\n orderedIds.value = [...props.pickedIds];\n }\n },\n { immediate: true },\n);\n\nconst canSave = computed(\n () =>\n name.value.trim().length > 0 &&\n pickedBlocks.value.length > 0 &&\n !isSaving.value,\n);\n\nasync function handleSave(): Promise<void> {\n if (!canSave.value) return;\n\n const blocks = pickedBlocks.value;\n // Defence in depth: never persist an empty saved block (it would list as\n // \"0 block(s)\" and insert nothing). Guards a pick set whose ids no longer\n // resolve to anything on the canvas.\n if (blocks.length === 0) return;\n\n isSaving.value = true;\n error.value = null;\n\n try {\n // Empty stays undefined rather than \"\": an entry is either categorised or\n // it isn't, and a blank string would show up as a nameless filter option.\n await savedBlocks.create(\n name.value.trim(),\n blocks,\n category.value.trim() || undefined,\n );\n emit(\"saved\");\n emit(\"close\");\n } catch (err) {\n error.value = (err as Error).message;\n } finally {\n isSaving.value = false;\n }\n}\n\nfunction handleClose(): void {\n if (!isSaving.value) {\n emit(\"close\");\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n handleSave();\n }\n if (event.key === \"Escape\") {\n handleClose();\n }\n}\n</script>\n\n<template>\n <TplModal :visible=\"visible\" @close=\"handleClose\" @keydown=\"handleKeydown\">\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-busy=\"isSaving\"\n aria-labelledby=\"tpl-save-block-title\"\n class=\"tpl-scale-in tpl:mx-4 tpl:flex tpl:w-full tpl:max-w-2xl tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5\"\n style=\"\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n max-height: 90vh;\n \"\n >\n <h3\n id=\"tpl-save-block-title\"\n class=\"tpl:mb-4 tpl:shrink-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ t.savedBlocks.saveAsBlock }}\n </h3>\n\n <!-- Saved block name -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.name }}\n </label>\n <input\n v-model=\"name\"\n type=\"text\"\n data-testid=\"saved-blocks-name-input\"\n :placeholder=\"t.savedBlocks.namePlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n </div>\n\n <!-- Category: free text, with the already-used categories offered as\n suggestions. A datalist rather than a <select> because the set is\n derived from existing entries — there is no registry to pick from,\n and the first entry in a category has to be able to name it. -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n for=\"tpl-save-block-category\"\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.category }}\n </label>\n <input\n id=\"tpl-save-block-category\"\n v-model=\"category\"\n type=\"text\"\n data-testid=\"saved-blocks-category-input\"\n list=\"tpl-saved-block-categories\"\n :placeholder=\"t.savedBlocks.categoryPlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n <datalist id=\"tpl-saved-block-categories\">\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n />\n </datalist>\n </div>\n\n <!-- Summary of what the pick session chose. Which blocks were picked is\n settled on the canvas — the dialog re-presents them only so the user\n can see and order what they're about to save. -->\n <p\n data-testid=\"saved-blocks-save-summary\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ format(t.savedBlocks.savingCount, { count: pickedBlocks.length }) }}\n <span class=\"tpl:text-[var(--tpl-text-dim)]\">{{ summary }}</span>\n </p>\n\n <!-- Reorderable preview. Seeded in pick order and saved in whatever order\n the list ends up in. Its own Sortable instance with no `group`, so it\n can never exchange items with the canvas or a section column. -->\n <p\n v-if=\"pickedBlocks.length > 1\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.reorderHint }}\n </p>\n <!-- The only growing region: takes whatever the dialog's 90vh cap leaves\n after the fixed chrome, rather than a hand-tuned vh guess that a row\n expanding to full height would blow past. `min-h-0` is what lets a\n flex child actually shrink below its content and scroll. -->\n <VueDraggable\n v-model=\"orderedBlocks\"\n data-testid=\"saved-blocks-reorder-list\"\n :animation=\"150\"\n ghost-class=\"tpl-ghost\"\n drag-class=\"tpl-dragging\"\n handle=\".tpl-saved-block-reorder-handle\"\n :force-fallback=\"true\"\n class=\"tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto\"\n >\n <SavedBlockPreviewRow\n v-for=\"(block, index) in orderedBlocks\"\n :key=\"block.id\"\n :block=\"block\"\n :position=\"index + 1\"\n :total=\"orderedBlocks.length\"\n @move=\"(delta) => moveBlock(block.id, delta)\"\n />\n </VueDraggable>\n\n <!-- Keyboard reorder announcement region (visually hidden, live) -->\n <div\n class=\"tpl-sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ announcement }}\n </div>\n\n <!-- Error message -->\n <p\n v-if=\"error\"\n role=\"alert\"\n class=\"tpl:mb-3 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ error }}\n </p>\n\n <!-- Actions -->\n <div class=\"tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n :disabled=\"isSaving\"\n :class=\"{\n 'tpl:cursor-not-allowed tpl:opacity-50': isSaving,\n }\"\n @click=\"handleClose\"\n >\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]\"\n :disabled=\"!canSave\"\n @click=\"handleSave\"\n >\n <span v-if=\"isSaving\" class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <LoaderCircle\n class=\"tpl:animate-spin\"\n :size=\"12\"\n :stroke-width=\"2\"\n />\n {{ t.savedBlocks.saving }}\n </span>\n <span v-else>\n {{ t.savedBlocks.save }}\n </span>\n </button>\n </div>\n </div>\n </TplModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;wCA6CM,IAAgB,KAOhB,IAAmB;;;;;;;;;EAvBzB,IAAM,IAAQ,GAOR,IAAO,GAIP,EAAE,MAAG,cAAW,EAAQ,GAExB,IAAyB,EAAO,GAA8B,CAAC,CAAC,GAYhE,IAAU,EAAwB,IAAI,GACtC,IAAY,EAAwB,IAAI,GACxC,IAAQ,EAAI,CAAC,GAEb,IAAa,EAAmB,IAAI,GACpC,IAAW,EAAI,EAAK,GAEtB,IAAkC,MAGhC,IAAY,QACV,EAAW,UAAU,QAAQ,EAAW,QAAQ,CACxD,GAEM,IAAc,QACd,EAAW,UAAU,OAAa,OAClC,EAAS,SAAS,CAAC,EAAU,QAAc,EAAW,QACnD,CACR;EAED,SAAS,IAAgB;GACvB,IAAM,IAAQ,EAAQ,OAChB,IAAU,EAAU;GAC1B,IAAI,CAAC,KAAS,CAAC,GAAS;GACxB,IAAM,IAAQ,EAAM;GACpB,IAAI,KAAS,GAAG;GAGhB,IAAM,IAAO,KAAK,IAAI,GAAG,IAAQ,CAAa;GAE9C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L,OAAK,EAAA,CAAC,mOAAiO,EAAA,yCAExK,EAAA,MAAA,CAAA,CAAA;KAD9D,UAAU,EAAA;KAIV,SAAO;SAEL,EAAA,CAAA,CAAC,CAAC,YAAY,MAAM,GAAA,IAAA,EAAA,GAEzB,EAiBS,UAAA;KAhBP,MAAK;KACL,OAAM;KACL,UAAQ,CAAG,EAAA;KACX,SAAO;QAEI,EAAA,SAAA,EAAA,GAAZ,EAOO,QAPP,IAOO,CANL,EAIE,EAAA,CAAA,GAAA;KAHA,OAAM;KACL,MAAM;KACN,gBAAc;UACf,MACF,EAAG,EAAA,CAAA,CAAC,CAAC,YAAY,MAAM,GAAA,CAAA,CAAA,CAAA,MAAA,EAAA,GAEzB,EAEO,QAAA,IAAA,EADF,EAAA,CAAA,CAAC,CAAC,YAAY,IAAI,GAAA,CAAA,EAAA,GAAA,GAAA,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
|
|
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";
|
|
5
|
+
//#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
|
+
name: "PreviewSectionBlock",
|
|
8
|
+
__name: "PreviewSectionBlock",
|
|
9
|
+
props: {
|
|
10
|
+
block: {},
|
|
11
|
+
viewport: {}
|
|
12
|
+
},
|
|
13
|
+
setup(e) {
|
|
14
|
+
let p = {
|
|
15
|
+
title: g,
|
|
16
|
+
paragraph: w,
|
|
17
|
+
image: y,
|
|
18
|
+
video: C,
|
|
19
|
+
button: x,
|
|
20
|
+
divider: D,
|
|
21
|
+
social: h,
|
|
22
|
+
menu: S,
|
|
23
|
+
table: T,
|
|
24
|
+
spacer: b,
|
|
25
|
+
html: m,
|
|
26
|
+
custom: O
|
|
27
|
+
}, _ = e, k = a(A, null), N = o(() => {
|
|
28
|
+
switch (_.block.columns) {
|
|
29
|
+
case "2": return ["50%", "50%"];
|
|
30
|
+
case "3": return [
|
|
31
|
+
"33.33%",
|
|
32
|
+
"33.33%",
|
|
33
|
+
"33.33%"
|
|
34
|
+
];
|
|
35
|
+
case "1-2": return ["33.33%", "66.67%"];
|
|
36
|
+
case "2-1": return ["66.67%", "33.33%"];
|
|
37
|
+
default: return ["100%"];
|
|
38
|
+
}
|
|
39
|
+
}), P = o(() => {
|
|
40
|
+
let e = N.value.length, t = [..._.block.children];
|
|
41
|
+
for (; t.length < e;) t.push([]);
|
|
42
|
+
return t.slice(0, e);
|
|
43
|
+
});
|
|
44
|
+
function F(e) {
|
|
45
|
+
return P.value[e] || [];
|
|
46
|
+
}
|
|
47
|
+
function I(e) {
|
|
48
|
+
return v(e, k, p);
|
|
49
|
+
}
|
|
50
|
+
return (e, a) => {
|
|
51
|
+
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
|
+
key: t,
|
|
54
|
+
style: d({ width: N.value[t] })
|
|
55
|
+
}, [(r(!0), s(f, null, i(F(t), (e) => (r(), s("div", {
|
|
56
|
+
key: e.id,
|
|
57
|
+
style: d(c(E)(e))
|
|
58
|
+
}, [e.type === "section" ? (r(), l(o, {
|
|
59
|
+
key: 0,
|
|
60
|
+
block: e,
|
|
61
|
+
viewport: "desktop"
|
|
62
|
+
}, null, 8, ["block"])) : (r(), l(n(I(e)), {
|
|
63
|
+
key: 1,
|
|
64
|
+
block: e,
|
|
65
|
+
viewport: "desktop"
|
|
66
|
+
}, null, 8, ["block"]))], 4))), 128))], 4))), 128))])]);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}), P = /*@__PURE__*/ p({
|
|
70
|
+
__name: "SavedBlockPreviewCanvas",
|
|
71
|
+
props: { blocks: {} },
|
|
72
|
+
setup(e) {
|
|
73
|
+
let t = a(A), u = a(k, null), p = o(() => u ? _(u.content.value.settings) : {}), j = {
|
|
74
|
+
section: N,
|
|
75
|
+
title: g,
|
|
76
|
+
paragraph: w,
|
|
77
|
+
image: y,
|
|
78
|
+
video: C,
|
|
79
|
+
button: x,
|
|
80
|
+
divider: D,
|
|
81
|
+
social: h,
|
|
82
|
+
menu: S,
|
|
83
|
+
table: T,
|
|
84
|
+
spacer: b,
|
|
85
|
+
html: m,
|
|
86
|
+
custom: O
|
|
87
|
+
};
|
|
88
|
+
function M(e) {
|
|
89
|
+
return v(e, t, j);
|
|
90
|
+
}
|
|
91
|
+
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",
|
|
94
|
+
style: d({
|
|
95
|
+
backgroundColor: "var(--tpl-canvas-bg)",
|
|
96
|
+
boxShadow: "var(--tpl-shadow-sm)",
|
|
97
|
+
...p.value
|
|
98
|
+
})
|
|
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));
|
|
106
|
+
}
|
|
107
|
+
}), F = /* @__PURE__ */ e({ default: () => I }), I = P;
|
|
108
|
+
//#endregion
|
|
109
|
+
export { F as n, I as t };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=SavedBlockPreviewCanvas-DZOMgNsz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SavedBlockPreviewCanvas-DZOMgNsz.js","names":[],"sources":["../../../src/components/blocks/PreviewSectionBlock.vue","../../../src/components/blocks/PreviewSectionBlock.vue","../../../src/components/SavedBlockPreviewCanvas.vue","../../../src/components/SavedBlockPreviewCanvas.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, EDITOR_KEY } from \"../keys\";\nimport {\n resolveBlockComponent,\n getBlockWrapperStyle,\n getDocumentStyle,\n} from \"../utils/blockComponentResolver\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, type Component } from \"vue\";\n\ndefineProps<{\n blocks: Block[];\n}>();\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY);\nconst editor = inject(EDITOR_KEY, null);\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=\"saved-blocks-preview-canvas\"\n class=\"tpl:pointer-events-none tpl:mx-auto tpl:w-[600px] tpl:select-none tpl:rounded-lg\"\n :style=\"{\n backgroundColor: 'var(--tpl-canvas-bg)',\n boxShadow: 'var(--tpl-shadow-sm)',\n ...documentStyle,\n }\"\n >\n <div\n v-for=\"block in blocks\"\n :key=\"block.id\"\n :style=\"getBlockWrapperStyle(block)\"\n >\n <component\n :is=\"getBlockComponent(block)\"\n :block=\"block\"\n viewport=\"desktop\"\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, EDITOR_KEY } from \"../keys\";\nimport {\n resolveBlockComponent,\n getBlockWrapperStyle,\n getDocumentStyle,\n} from \"../utils/blockComponentResolver\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, type Component } from \"vue\";\n\ndefineProps<{\n blocks: Block[];\n}>();\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY);\nconst editor = inject(EDITOR_KEY, null);\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=\"saved-blocks-preview-canvas\"\n class=\"tpl:pointer-events-none tpl:mx-auto tpl:w-[600px] tpl:select-none tpl:rounded-lg\"\n :style=\"{\n backgroundColor: 'var(--tpl-canvas-bg)',\n boxShadow: 'var(--tpl-shadow-sm)',\n ...documentStyle,\n }\"\n >\n <div\n v-for=\"block in blocks\"\n :key=\"block.id\"\n :style=\"getBlockWrapperStyle(block)\"\n >\n <component\n :is=\"getBlockComponent(block)\"\n :block=\"block\"\n viewport=\"desktop\"\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,GAE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