@templatical/editor 0.55.0 → 0.56.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/dist/{AiAltTextPopover-D5QosKvB.js → AiAltTextPopover-CpZ7UeAZ.js} +4 -4
- package/dist/{AiAltTextReview-D1W_lrI_.js → AiAltTextReview-LYxvn7Qe.js} +4 -4
- package/dist/{AiChatPanel-C8SeEJRP.js → AiChatPanel-Cy05P-iO.js} +56 -56
- package/dist/{AiPanels-CR6zphjP.js → AiPanels-CwKmXzyr.js} +1 -1
- package/dist/{AiRewriteMenu-BwztoMov.js → AiRewriteMenu-DgqJHnza.js} +13 -13
- package/dist/{BlockIssueBadge-DaPTq1RE.js → BlockIssueBadge-CxHJmuOh.js} +5 -5
- package/dist/BlockPreviewCanvas-DEmNZkEG.js +154 -0
- package/dist/{CloudHeaderExtras-XpjJjn3o.js → CloudHeaderExtras-Cqhw-jMz.js} +1 -1
- package/dist/{CloudPanels-Baoaj6Xf.js → CloudPanels-Bmlf05Il.js} +12 -12
- package/dist/{CollaborationNotices-Cnx0XHzZ.js → CollaborationNotices-C27GCMvK.js} +8 -8
- package/dist/{CollaboratorBar-BaBoNhwB.js → CollaboratorBar-CLQjksX-.js} +2 -2
- package/dist/{CommentsPanel-Ck3QmqiC.js → CommentsPanel-B5NqPMmY.js} +1 -1
- package/dist/{CommentsSidebar-CHknhOar.js → CommentsSidebar-BDrcrDxS.js} +42 -42
- package/dist/{CountdownBlock-BMezkFbJ.js → CountdownBlock-D8dqjm3F.js} +6 -6
- package/dist/{CountdownToolbar-CA_gDIdZ.js → CountdownToolbar-IjpCOjCd.js} +30 -30
- package/dist/{IssuesPanel-nmFhWG1p.js → IssuesPanel-uwuzeMSW.js} +89 -89
- package/dist/LanguageMenu-C-eQ0lFy.js +403 -0
- package/dist/{LocaleNotices-WzsYtBRs.js → LocaleNotices-CDK_9D7P.js} +10 -10
- package/dist/{LogicTagInsertButton-qZ82VMFx.js → LogicTagInsertButton-BSolF7Fd.js} +24 -24
- package/dist/{MediaEditModal-C3U9Mi31.js → MediaEditModal-C8yc9dxt.js} +7 -7
- package/dist/{MediaPanels-CGmk9ufe.js → MediaPanels-FI4I8asn.js} +1 -1
- package/dist/{MergeTagInput-JJeZbFkD.js → MergeTagInput-B1nl2ZMT.js} +12 -12
- package/dist/{MergeTagModeToggle-DDucd1eC.js → MergeTagModeToggle-DXvb80OE.js} +6 -6
- package/dist/{MergeTagTextarea-dQ2LRrNB.js → MergeTagTextarea-DJlf3VbS.js} +5 -5
- package/dist/{ParagraphEditor-VXYwGoz_.js → ParagraphEditor-Dqco128s.js} +173 -173
- package/dist/{RestoreVersionDialog-BibNvAaJ.js → RestoreVersionDialog-hqLCuGV5.js} +12 -12
- package/dist/{RichTextEditorContent-CU5EOlM_.js → RichTextEditorContent-xIEF0Y3Z.js} +8 -8
- package/dist/{SaveBlockDialog-S9aFi0cy.js → SaveBlockDialog-CQlCP_XC.js} +47 -47
- package/dist/{SavedBlocksBrowserModal-DIdn6B0J.js → SavedBlocksBrowserModal-BXA32Fx6.js} +24 -24
- package/dist/{SavedBlocksPanels-Cme2M6u8.js → SavedBlocksPanels-BKUzbamj.js} +1 -1
- package/dist/{SavedBlocksPickBar-BDmA7r3m.js → SavedBlocksPickBar-BlvF-4UF.js} +9 -9
- package/dist/{TemplateSettings-C_LHLm5M.js → TemplateSettings-CYFtR8zv.js} +41 -41
- package/dist/{TestEmailModal-CLIRn7eL.js → TestEmailModal-BbaL17HO.js} +20 -20
- package/dist/{TestEmailPanel-frdtjC8h.js → TestEmailPanel-DhB1CSpg.js} +1 -1
- package/dist/{TitleEditor-D5kC56Jl.js → TitleEditor-3BRl8u5l.js} +22 -22
- package/dist/{Toolbar-D904Yw_R.js → Toolbar-pzNIakGM.js} +1090 -856
- package/dist/{TplModal-BBdotDf1.js → TplModal-WNuWhHZm.js} +4 -4
- package/dist/{VersionHistoryMenu-BnP0EyLl.js → VersionHistoryMenu--T-Qp_mH.js} +17 -17
- package/dist/{VersionHistoryPanels-DhagEgOk.js → VersionHistoryPanels-BPubvYIE.js} +1 -1
- package/dist/{VersionPreviewBanner-BPP939cD.js → VersionPreviewBanner-ClL3Wkln.js} +7 -7
- package/dist/WrapperBlock-CjfCPceb.js +56 -0
- package/dist/{blockTypeIcons-CoRQV_hP.js → blockTypeIcons-12OMwVyN.js} +3 -3
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-DIkMxYCN.js → ca-BJn8lcJx.js} +8 -0
- package/dist/cdn/chunks/{AiAltTextPopover-CUGOPuRo.js → AiAltTextPopover-PFjTrl0y.js} +5 -5
- package/dist/cdn/chunks/{AiAltTextPopover-CUGOPuRo.js.map → AiAltTextPopover-PFjTrl0y.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-B9vm_L-8.js → AiAltTextReview-BMjzvApH.js} +5 -5
- package/dist/cdn/chunks/{AiAltTextReview-B9vm_L-8.js.map → AiAltTextReview-BMjzvApH.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-By8Uo1nH.js → AiChatPanel-C2gpq4kP.js} +107 -107
- package/dist/cdn/chunks/{AiChatPanel-By8Uo1nH.js.map → AiChatPanel-C2gpq4kP.js.map} +1 -1
- package/dist/cdn/chunks/{AiPanels-BblCSkQy.js → AiPanels-Cx3PE2mE.js} +2 -2
- package/dist/cdn/chunks/{AiPanels-BblCSkQy.js.map → AiPanels-Cx3PE2mE.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-BvV_7tNZ.js → AiRewriteMenu-CnkyjPEu.js} +13 -13
- package/dist/cdn/chunks/{AiRewriteMenu-BvV_7tNZ.js.map → AiRewriteMenu-CnkyjPEu.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-D3Plo_wt.js → BlockIssueBadge-DncZ-HDf.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-D3Plo_wt.js.map → BlockIssueBadge-DncZ-HDf.js.map} +1 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-CCSEzL46.js +156 -0
- package/dist/cdn/chunks/BlockPreviewCanvas-CCSEzL46.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-BtqdN777.js → CloudHeaderExtras-uUJYJFJ6.js} +2 -2
- package/dist/cdn/chunks/{CloudHeaderExtras-BtqdN777.js.map → CloudHeaderExtras-uUJYJFJ6.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-CQ0vNgsH.js → CloudPanels-CRztnw4M.js} +4 -4
- package/dist/cdn/chunks/{CloudPanels-CQ0vNgsH.js.map → CloudPanels-CRztnw4M.js.map} +1 -1
- package/dist/cdn/chunks/{CollaborationNotices-DraFUhyo.js → CollaborationNotices-IuLYT2x7.js} +9 -9
- package/dist/cdn/chunks/{CollaborationNotices-DraFUhyo.js.map → CollaborationNotices-IuLYT2x7.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-0OEH3hrj.js → CollaboratorBar-C1ZI2xwa.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-0OEH3hrj.js.map → CollaboratorBar-C1ZI2xwa.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-tZZswofV.js → CommentsPanel-lgjJNrrY.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-tZZswofV.js.map → CommentsPanel-lgjJNrrY.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-7Hfl3Hdj.js → CommentsSidebar-DTold7iy.js} +214 -214
- package/dist/cdn/chunks/{CommentsSidebar-7Hfl3Hdj.js.map → CommentsSidebar-DTold7iy.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-CjMhMhnv.js → CountdownBlock-8aPSExrv.js} +7 -7
- package/dist/cdn/chunks/{CountdownBlock-CjMhMhnv.js.map → CountdownBlock-8aPSExrv.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BxW-J7DX.js → CountdownToolbar-CnWQEW5g.js} +50 -50
- package/dist/cdn/chunks/{CountdownToolbar-BxW-J7DX.js.map → CountdownToolbar-CnWQEW5g.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-BoHeIjvw.js → IssuesPanel-CrplCzo8.js} +13 -13
- package/dist/cdn/chunks/{IssuesPanel-BoHeIjvw.js.map → IssuesPanel-CrplCzo8.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-BnYN5N1h.js → LanguageMenu-B6MNInCL.js} +57 -57
- package/dist/cdn/chunks/{LanguageMenu-BnYN5N1h.js.map → LanguageMenu-B6MNInCL.js.map} +1 -1
- package/dist/cdn/chunks/{LocaleNotices-8J2DRWeg.js → LocaleNotices-TxeAl8Iq.js} +10 -10
- package/dist/cdn/chunks/{LocaleNotices-8J2DRWeg.js.map → LocaleNotices-TxeAl8Iq.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-Bt2PXbQ0.js → LogicTagInsertButton-DvSVx2DB.js} +30 -30
- package/dist/cdn/chunks/LogicTagInsertButton-DvSVx2DB.js.map +1 -0
- package/dist/cdn/chunks/{MediaEditModal-Dz972UFx.js → MediaEditModal-tGK6htBl.js} +8 -8
- package/dist/cdn/chunks/{MediaEditModal-Dz972UFx.js.map → MediaEditModal-tGK6htBl.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-C6Hqtp1H.js → MediaPanels-BVrQYz2C.js} +2 -2
- package/dist/cdn/chunks/{MediaPanels-C6Hqtp1H.js.map → MediaPanels-BVrQYz2C.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-BELdMRni.js → MergeTagInput-DeuNH3re.js} +13 -13
- package/dist/cdn/chunks/{MergeTagInput-BELdMRni.js.map → MergeTagInput-DeuNH3re.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-DKfMDIEF.js → MergeTagModeToggle-D7maMGIM.js} +5 -5
- package/dist/cdn/chunks/{MergeTagModeToggle-DKfMDIEF.js.map → MergeTagModeToggle-D7maMGIM.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-w6xen3Xh.js → MergeTagTextarea-B2xxIU3e.js} +6 -6
- package/dist/cdn/chunks/{MergeTagTextarea-w6xen3Xh.js.map → MergeTagTextarea-B2xxIU3e.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-Cal9hY3U.js → ParagraphEditor-Bx_Hlw8d.js} +106 -106
- package/dist/cdn/chunks/{ParagraphEditor-Cal9hY3U.js.map → ParagraphEditor-Bx_Hlw8d.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-f_ulmASY.js → RestoreVersionDialog-CPrrWTsT.js} +12 -12
- package/dist/cdn/chunks/{RestoreVersionDialog-f_ulmASY.js.map → RestoreVersionDialog-CPrrWTsT.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-C_v0kS4A.js → RichTextEditorContent-Dze4C9VI.js} +8 -8
- package/dist/cdn/chunks/{RichTextEditorContent-C_v0kS4A.js.map → RichTextEditorContent-Dze4C9VI.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-C6N9RFls.js → SaveBlockDialog-CXVwnfsy.js} +51 -51
- package/dist/cdn/chunks/{SaveBlockDialog-C6N9RFls.js.map → SaveBlockDialog-CXVwnfsy.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-Bl2sl09D.js → SavedBlocksBrowserModal-BDTmenOE.js} +23 -23
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-Bl2sl09D.js.map → SavedBlocksBrowserModal-BDTmenOE.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-DqVcmEUK.js → SavedBlocksPanels-B41Rk_v1.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-DqVcmEUK.js.map → SavedBlocksPanels-B41Rk_v1.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-DE-J1JVL.js → SavedBlocksPickBar-B97z_rFH.js} +11 -11
- package/dist/cdn/chunks/{SavedBlocksPickBar-DE-J1JVL.js.map → SavedBlocksPickBar-B97z_rFH.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-CpoKZ8oV.js → TemplateSettings-YwwRbxPc.js} +102 -102
- package/dist/cdn/chunks/{TemplateSettings-CpoKZ8oV.js.map → TemplateSettings-YwwRbxPc.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-DI3z__Bd.js → TestEmailModal-BiFP2Cbx.js} +20 -20
- package/dist/cdn/chunks/{TestEmailModal-DI3z__Bd.js.map → TestEmailModal-BiFP2Cbx.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-Cp5d2YGn.js → TestEmailPanel-BrivPMk2.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-Cp5d2YGn.js.map → TestEmailPanel-BrivPMk2.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-C2syRLdZ.js → TitleEditor-CzPkkL2s.js} +19 -19
- package/dist/cdn/chunks/{TitleEditor-C2syRLdZ.js.map → TitleEditor-CzPkkL2s.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-NEE8qxYh.js → Toolbar-VH07SzX7.js} +1153 -919
- package/dist/cdn/chunks/Toolbar-VH07SzX7.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-B1MgvtX8.js → TplModal-DMe6J811.js} +6 -6
- package/dist/cdn/chunks/{TplModal-B1MgvtX8.js.map → TplModal-DMe6J811.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-CZury5gU.js → VersionHistoryMenu-DkwbKhBl.js} +16 -16
- package/dist/cdn/chunks/{VersionHistoryMenu-CZury5gU.js.map → VersionHistoryMenu-DkwbKhBl.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-Cefd8i_e.js → VersionHistoryPanels-CgxhMRAl.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-Cefd8i_e.js.map → VersionHistoryPanels-CgxhMRAl.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-C4Ji8nu4.js → VersionPreviewBanner-WVBDBrwQ.js} +8 -8
- package/dist/cdn/chunks/{VersionPreviewBanner-C4Ji8nu4.js.map → VersionPreviewBanner-WVBDBrwQ.js.map} +1 -1
- package/dist/cdn/chunks/WrapperBlock-CCCIcqe2.js +58 -0
- package/dist/cdn/chunks/WrapperBlock-CCCIcqe2.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-Cc6RJ27V.js → blockTypeIcons-CzYA5DF9.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-Cc6RJ27V.js.map → blockTypeIcons-CzYA5DF9.js.map} +1 -1
- package/dist/cdn/chunks/{ca-DIkMxYCN.js → ca-BJn8lcJx.js} +9 -1
- package/dist/cdn/chunks/ca-BJn8lcJx.js.map +1 -0
- package/dist/cdn/chunks/composables-D3lsO7Io.js +3101 -0
- package/dist/cdn/chunks/composables-D3lsO7Io.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-DJkDGKQ_.js → createCloudRuntime-CE79GB1H.js} +16 -16
- package/dist/cdn/chunks/{createCloudRuntime-DJkDGKQ_.js.map → createCloudRuntime-CE79GB1H.js.map} +1 -1
- package/dist/{de-Cc6Ue0UD.js → cdn/chunks/de-BLFp3nWx.js} +10 -0
- package/dist/cdn/chunks/de-BLFp3nWx.js.map +1 -0
- package/dist/cdn/chunks/dist-Cf1pSluo.js +405 -0
- package/dist/cdn/chunks/{dist-DqGgijFI.js.map → dist-Cf1pSluo.js.map} +1 -1
- package/dist/cdn/chunks/{editor-modal-erQEOHZN.js → editor-modal-CN69NlOK.js} +187 -187
- package/dist/cdn/chunks/{editor-modal-erQEOHZN.js.map → editor-modal-CN69NlOK.js.map} +1 -1
- package/dist/cdn/chunks/en-Bcz4gS9U.js +1 -0
- package/dist/cdn/chunks/{en-BX4FujAQ.js → en-DGGQJGbm.js} +9 -1
- package/dist/cdn/chunks/en-DGGQJGbm.js.map +1 -0
- package/dist/cdn/chunks/{es-Do5b-MKU.js → es-DTY9qgLv.js} +9 -1
- package/dist/cdn/chunks/es-DTY9qgLv.js.map +1 -0
- package/dist/cdn/chunks/{extensions-BcwkOjVq.js → extensions-8dlM-fU4.js} +112 -112
- package/dist/cdn/chunks/extensions-8dlM-fU4.js.map +1 -0
- package/dist/{fr-S1n2Ebzp.js → cdn/chunks/fr-L4FqO9Gp.js} +10 -0
- package/dist/cdn/chunks/{fr-S1n2Ebzp.js.map → fr-L4FqO9Gp.js.map} +1 -1
- package/dist/cdn/chunks/{icons-Da9GKjPx.js → icons-DHExFLlT.js} +43 -43
- package/dist/cdn/chunks/{icons-Da9GKjPx.js.map → icons-DHExFLlT.js.map} +1 -1
- package/dist/cdn/chunks/{ja-DLwcq4bA.js → ja-6uOXkh4v.js} +9 -1
- package/dist/cdn/chunks/ja-6uOXkh4v.js.map +1 -0
- package/dist/cdn/chunks/{keys-CoQtCqNv.js → keys-BUmIvYy3.js} +4 -4
- package/dist/cdn/chunks/keys-BUmIvYy3.js.map +1 -0
- package/dist/{nl-0JSWaZpT.js → cdn/chunks/nl-DCxuxwNq.js} +10 -0
- package/dist/cdn/chunks/nl-DCxuxwNq.js.map +1 -0
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-BrGw5jxk.js → normalizeMergeTagMarkup-aWjkotui.js} +67 -67
- package/dist/cdn/chunks/normalizeMergeTagMarkup-aWjkotui.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-Cj0XYwuh.js → preRenderCustomBlocks-Dn6dFUwx.js} +4 -4
- package/dist/cdn/chunks/{preRenderCustomBlocks-Cj0XYwuh.js.map → preRenderCustomBlocks-Dn6dFUwx.js.map} +1 -1
- package/dist/{pt-BR-D3VlIMDZ.js → cdn/chunks/pt-BR-CBkcrebr.js} +10 -0
- package/dist/cdn/chunks/pt-BR-CBkcrebr.js.map +1 -0
- package/dist/cdn/chunks/{sanitizeHtml-GxJCxKcP.js → sanitizeHtml-B3njfkSy.js} +11 -11
- package/dist/cdn/chunks/{sanitizeHtml-GxJCxKcP.js.map → sanitizeHtml-B3njfkSy.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-B5zrrV8-.js → socialIcons-BFgc3qqJ.js} +354 -341
- package/dist/cdn/chunks/{socialIcons-B5zrrV8-.js.map → socialIcons-BFgc3qqJ.js.map} +1 -1
- package/dist/cdn/chunks/{src-Diw9SLIe.js → src-C9JWWxAk.js} +419 -423
- package/dist/cdn/chunks/src-C9JWWxAk.js.map +1 -0
- package/dist/cdn/chunks/src-GgKlXNxy.js +710 -0
- package/dist/cdn/chunks/src-GgKlXNxy.js.map +1 -0
- package/dist/cdn/chunks/{src-v47QHNmB.js → src-mXG-Of9A.js} +669 -662
- package/dist/cdn/chunks/src-mXG-Of9A.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-Dipw_zOQ.js → tiptap-C940SvId.js} +3 -3
- package/dist/cdn/chunks/{tiptap-Dipw_zOQ.js.map → tiptap-C940SvId.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-Cc5NZqiI.js → useCloudI18n-Xsih9yRH.js} +2 -2
- package/dist/cdn/chunks/{useCloudI18n-Cc5NZqiI.js.map → useCloudI18n-Xsih9yRH.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorRoot-D_LuZ_hE.js → useEditorRoot-Beau2Z_T.js} +2 -2
- package/dist/cdn/chunks/{useEditorRoot-D_LuZ_hE.js.map → useEditorRoot-Beau2Z_T.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-BnJYydPv.js → useI18n-D8s7HtTn.js} +2 -2
- package/dist/cdn/chunks/{useI18n-BnJYydPv.js.map → useI18n-D8s7HtTn.js.map} +1 -1
- package/dist/cdn/chunks/{useLocalizedDisplay-DekV8qar.js → useLocalizedDisplay-Bgg4qpev.js} +6 -6
- package/dist/cdn/chunks/{useLocalizedDisplay-DekV8qar.js.map → useLocalizedDisplay-Bgg4qpev.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-Cbp3I7UN.js → useLogicTag-B0PDeDxl.js} +5 -5
- package/dist/cdn/chunks/{useLogicTag-Cbp3I7UN.js.map → useLogicTag-B0PDeDxl.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-1lrpNyR5.js → useMergeTag-BSU75bKk.js} +8 -8
- package/dist/cdn/chunks/{useMergeTag-1lrpNyR5.js.map → useMergeTag-BSU75bKk.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-BWAXWeBv.js → usePopoverPosition-esO6wjvU.js} +5 -5
- package/dist/cdn/chunks/{usePopoverPosition-BWAXWeBv.js.map → usePopoverPosition-esO6wjvU.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-Ct1AwLD-.js → useScrollToBlock-CJuUu7Xj.js} +2 -2
- package/dist/cdn/chunks/{useScrollToBlock-Ct1AwLD-.js.map → useScrollToBlock-CJuUu7Xj.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-DZfmiv8V.js → withCurrentFont-QqBilClC.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-DZfmiv8V.js.map → withCurrentFont-QqBilClC.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +814 -817
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-XMnOOIEC.js → check-CcuCoJDh.js} +1 -1
- package/dist/{chevron-down-DmamTEWQ.js → chevron-down-BfYIbFbC.js} +1 -1
- package/dist/{chevron-right-BEFXOH27.js → chevron-right-DyjFqY35.js} +1 -1
- package/dist/{chevron-up-Dw7woXj8.js → chevron-up-BHEIxuS-.js} +1 -1
- package/dist/{circle-alert-BTKC9vkq.js → circle-alert-Tq7kAh9S.js} +1 -1
- package/dist/{clock-BVT5u2uG.js → clock-Df0ZiXwQ.js} +1 -1
- package/dist/{composables-DPgNn9GZ.js → composables-DreAt_0A.js} +1660 -1620
- package/dist/{createCloudRuntime-Bw8TLmQ8.js → createCloudRuntime-CL4tUlDC.js} +15 -15
- package/dist/{createLucideIcon-CgDE3xAR.js → createLucideIcon-CfBdtoUw.js} +5 -5
- package/dist/{cdn/chunks/de-Cc6Ue0UD.js → de-BLFp3nWx.js} +8 -2
- package/dist/{dist-ChOb5XHW.js → dist-0GWMyHtM.js} +1 -1
- package/dist/{dist-CBdk1Vcb.js → dist-BMUUt3zJ.js} +284 -277
- package/dist/{dist-6DU0me3E.js → dist-B_0FPmoy.js} +1 -1
- package/dist/{dist-B8dY8drK.js → dist-BjzK1g4Z.js} +1 -1
- package/dist/{dist-54VCNoC0.js → dist-BsumKKh9.js} +1 -1
- package/dist/{dist-BWflWcpW.js → dist-C3avsUq9.js} +2 -2
- package/dist/{dist-fqSers8_.js → dist-CCLRTtJP.js} +197 -197
- package/dist/dist-CiYotUR8.js +406 -0
- package/dist/{dist-C3hu_C3w.js → dist-Cr1CLCmx.js} +1 -1
- package/dist/{dist-D_XrUEET.js → dist-CsknfjrZ.js} +3 -3
- package/dist/{dist-TAv500j6.js → dist-DDytHU_6.js} +1 -1
- package/dist/{dist-CcOn7WCo.js → dist-DKV9m4Uu.js} +1 -1
- package/dist/{dist-B9a7iVye.js → dist-Dq9VnANT.js} +1 -1
- package/dist/{dist-DZ3X-uB8.js → dist-ZrT0vAB6.js} +1 -1
- package/dist/{editor-modal-BeX6otLk.js → editor-modal-BD32TXws.js} +107 -107
- package/dist/{en-BX4FujAQ.js → en-DGGQJGbm.js} +8 -0
- package/dist/en-Dgs_-NBw.js +1 -0
- package/dist/{es-Do5b-MKU.js → es-DTY9qgLv.js} +8 -0
- package/dist/{extensions-QFAARrjF.js → extensions-DKxHlSd7.js} +385 -385
- package/dist/{eye-ByMgHeA_.js → eye-B3psrAqd.js} +1 -1
- package/dist/{cdn/chunks/fr-S1n2Ebzp.js → fr-L4FqO9Gp.js} +8 -2
- package/dist/{image-Ch8tR35K.js → image-C3yuPDxx.js} +1 -1
- package/dist/index.d.ts +60 -12
- package/dist/{info-DzSD-Wpk.js → info-DKja7A68.js} +1 -1
- package/dist/{ja-DLwcq4bA.js → ja-6uOXkh4v.js} +8 -0
- package/dist/{keys-BCqskl51.js → keys-w_VRjoMu.js} +3 -3
- package/dist/{link-oDn9AR2w.js → link-DhzPI4Hn.js} +1 -1
- package/dist/{list-C5t07dp8.js → list-DVGn7Ik2.js} +1 -1
- package/dist/{loader-circle-k6xvKgUB.js → loader-circle-DqKWsMHO.js} +1 -1
- package/dist/{message-circle-C23R6OJR.js → message-circle-C4TonoBs.js} +1 -1
- package/dist/{cdn/chunks/nl-0JSWaZpT.js → nl-DCxuxwNq.js} +8 -2
- package/dist/{normalizeMergeTagMarkup-BS0nRvhq.js → normalizeMergeTagMarkup-Da9JAgx7.js} +75 -75
- package/dist/{package-C90eQ7NU.js → package-9OkiEO4S.js} +1 -1
- package/dist/{pencil-BK7GrQuA.js → pencil-M9vkOB7C.js} +1 -1
- package/dist/{plus-Cr0Mis63.js → plus-DxZiv9YC.js} +1 -1
- package/dist/{preRenderCustomBlocks-CiKvKd8V.js → preRenderCustomBlocks-CdqSp2P7.js} +4 -4
- package/dist/{cdn/chunks/pt-BR-D3VlIMDZ.js → pt-BR-CBkcrebr.js} +8 -2
- package/dist/{refresh-cw-_ZLOIEvA.js → refresh-cw-UY8_sdFG.js} +1 -1
- package/dist/{rotate-ccw-CB5wsHwv.js → rotate-ccw-BFTGCpHn.js} +1 -1
- package/dist/{sanitizeHtml-USjTyALR.js → sanitizeHtml-wBibnBF4.js} +6 -6
- package/dist/{search-BmrQNox8.js → search-RuGJnMEn.js} +1 -1
- package/dist/{send-blAsIBBg.js → send-DGB1ar02.js} +1 -1
- package/dist/{smartphone-BPpWYrwV.js → smartphone-CVA29CU_.js} +1 -1
- package/dist/{socialIcons-NvIg5ahU.js → socialIcons-oo4uL16Y.js} +427 -414
- package/dist/{sparkles-OqIxrNp-.js → sparkles-IHfEwEcd.js} +1 -1
- package/dist/{square-BP-V7iT-.js → square-_Cl44UU6.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +922 -925
- package/dist/{text-align-start-4mwX2o-F.js → text-align-start-Dqk2Xt_Q.js} +13 -13
- package/dist/{trash-B99WixTA.js → trash-Cr7rD5Hh.js} +1 -1
- package/dist/{triangle-alert-CHMiDkHa.js → triangle-alert-CKcpwtUj.js} +1 -1
- package/dist/{upload-Cp8o-hrN.js → upload-DR9pqVON.js} +1 -1
- package/dist/{useCloudI18n-Dh2iydo1.js → useCloudI18n-BczJoFf4.js} +1 -1
- package/dist/{useEditorRoot-DY3mgcHm.js → useEditorRoot-BcXKhM_8.js} +1 -1
- package/dist/{useI18n-CgtvtF4C.js → useI18n-zeWYtWSv.js} +1 -1
- package/dist/useLocalizedDisplay-Cbhx208c.js +31 -0
- package/dist/{useLogicTag-D8zgkXfb.js → useLogicTag-B4Zpk3eo.js} +4 -4
- package/dist/{useMergeTag-k7Kr0nMd.js → useMergeTag-B5qlq8px.js} +8 -8
- package/dist/{usePopoverPosition-VDQjyX_A.js → usePopoverPosition-Br3zt_MQ.js} +4 -4
- package/dist/{useScrollToBlock-B35ObCGK.js → useScrollToBlock-BfOzc1Z6.js} +2 -2
- package/dist/{withCurrentFont-Bzeg_gfH.js → withCurrentFont-m_PHcOD0.js} +1 -1
- package/dist/{x-BIBStNMS.js → x-DZSFHafL.js} +1 -1
- package/package.json +10 -10
- package/dist/BlockPreviewCanvas-C23A6FRm.js +0 -140
- package/dist/LanguageMenu-DcABUYop.js +0 -403
- package/dist/WrapperBlock-BAT3T0Cz.js +0 -44
- package/dist/cdn/chunks/BlockPreviewCanvas-Dr-xGq6v.js +0 -142
- package/dist/cdn/chunks/BlockPreviewCanvas-Dr-xGq6v.js.map +0 -1
- package/dist/cdn/chunks/LogicTagInsertButton-Bt2PXbQ0.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-NEE8qxYh.js.map +0 -1
- package/dist/cdn/chunks/WrapperBlock-DFY-7YSs.js +0 -46
- package/dist/cdn/chunks/WrapperBlock-DFY-7YSs.js.map +0 -1
- package/dist/cdn/chunks/ca-DIkMxYCN.js.map +0 -1
- package/dist/cdn/chunks/composables-nyxwrM27.js +0 -3061
- package/dist/cdn/chunks/composables-nyxwrM27.js.map +0 -1
- package/dist/cdn/chunks/de-Cc6Ue0UD.js.map +0 -1
- package/dist/cdn/chunks/dist-DqGgijFI.js +0 -405
- package/dist/cdn/chunks/en-B6tLGRHq.js +0 -1
- package/dist/cdn/chunks/en-BX4FujAQ.js.map +0 -1
- package/dist/cdn/chunks/es-Do5b-MKU.js.map +0 -1
- package/dist/cdn/chunks/extensions-BcwkOjVq.js.map +0 -1
- package/dist/cdn/chunks/ja-DLwcq4bA.js.map +0 -1
- package/dist/cdn/chunks/keys-CoQtCqNv.js.map +0 -1
- package/dist/cdn/chunks/nl-0JSWaZpT.js.map +0 -1
- package/dist/cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-D3VlIMDZ.js.map +0 -1
- package/dist/cdn/chunks/src-Diw9SLIe.js.map +0 -1
- package/dist/cdn/chunks/src-UR3AQocX.js +0 -683
- package/dist/cdn/chunks/src-UR3AQocX.js.map +0 -1
- package/dist/cdn/chunks/src-v47QHNmB.js.map +0 -1
- package/dist/dist-0alKVRc_.js +0 -406
- package/dist/en-Do0SU6tR.js +0 -1
- package/dist/useLocalizedDisplay-LdjosX4w.js +0 -31
|
@@ -1,3061 +0,0 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, E as r, F as i, G as a, H as o, I as s, K as c, L as l, M as u, N as d, O as f, P as p, Q as m, R as h, S as g, W as _, X as v, Y as y, _ as b, b as x, c as S, ct as C, dt as w, f as T, g as E, h as D, j as O, l as k, m as A, mt as j, ot as M, p as N, pt as P, rt as F, s as I, st as L, t as R, tt as z, u as B, x as V } from "./draggable-DepKdldn.js";
|
|
2
|
-
import { $ as H, A as U, At as W, B as G, C as ee, D as K, E as q, G as J, Gt as te, H as ne, I as re, J as ie, K as Y, L as X, M as ae, N as oe, O as se, P as ce, Q as Z, R as le, S as ue, Sn as de, T as fe, U as pe, W as me, X as he, Xt as ge, Y as _e, Z as ve, Zt as ye, _n as be, _t as xe, a as Se, an as Ce, b as we, bn as Te, ct as Ee, d as De, et as Oe, ft as ke, i as Ae, it as je, j as Me, ln as Ne, mn as Pe, mt as Fe, nn as Ie, nt as Le, on as Re, ot as ze, p as Be, pn as Ve, pt as He, rt as Ue, sn as We, st as Ge, t as Ke, tt as qe, u as Je, ut as Ye, vn as Xe, w as Ze, x as Qe, xn as $e, y as et, yn as tt } from "./src-v47QHNmB.js";
|
|
3
|
-
import { B as nt, C as rt, F as it, I as at, P as ot, R as st, T as ct, _ as lt, a as ut, f as dt, h as ft, n as pt, o as mt, t as ht, u as gt, v as _t, w as vt, x as yt, y as bt, z as xt } from "./socialIcons-B5zrrV8-.js";
|
|
4
|
-
import { t as St } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
5
|
-
import { At as Ct, G as wt, Mt as Tt, Nt as Et, Ot as Dt, St as Ot, Ut as kt, V as At, Wt as jt, X as Mt, _t as Nt, d as Pt, f as Ft, k as It, mt as Lt, nt as Rt, o as zt, y as Bt, yt as Vt } from "./icons-Da9GKjPx.js";
|
|
6
|
-
import { $ as Ht, A as Ut, B as Wt, C as Gt, D as Kt, F as qt, G as Jt, H as Yt, I as Xt, J as Zt, K as Qt, L as $t, M as en, N as tn, O as nn, P as rn, Q as an, R as on, S as sn, T as cn, U as ln, V as un, W as dn, X as fn, _ as pn, a as mn, at as hn, b as gn, c as _n, d as vn, et as yn, g as bn, h as xn, i as Sn, it as Cn, j as wn, k as Tn, l as En, m as Dn, nt as On, ot as kn, p as An, q as jn, r as Mn, rt as Nn, s as Pn, tt as Fn, u as In, v as Ln, w as Rn, x as zn, y as Bn, z as Vn } from "./keys-CoQtCqNv.js";
|
|
7
|
-
import { t as Q } from "./useI18n-BnJYydPv.js";
|
|
8
|
-
import { n as Hn } from "./useLocalizedDisplay-DekV8qar.js";
|
|
9
|
-
import { t as Un } from "./plural-CyxrJXL1.js";
|
|
10
|
-
import { t as Wn } from "./languageName-DEEOhDWI.js";
|
|
11
|
-
import { m as Gn, w as Kn, x as qn } from "./styleConstants-CgiNKdnc.js";
|
|
12
|
-
import { _ as Jn, h as Yn, v as Xn, y as Zn } from "./dist-BzXULHvI.js";
|
|
13
|
-
import { a as Qn, c as $n, i as er, l as tr } from "./dist-DqGgijFI.js";
|
|
14
|
-
import { t as nr } from "./useEditorRoot-D_LuZ_hE.js";
|
|
15
|
-
import "./useCloudI18n-Cc5NZqiI.js";
|
|
16
|
-
import { t as rr } from "./useMergeTag-1lrpNyR5.js";
|
|
17
|
-
import { t as $ } from "./logger-CqQTfJGx.js";
|
|
18
|
-
import { a as ir, c as ar, i as or, n as sr, o as cr, t as lr } from "./usePopoverPosition-BWAXWeBv.js";
|
|
19
|
-
import { t as ur } from "./useLogicTag-Cbp3I7UN.js";
|
|
20
|
-
import { r as dr, t as fr } from "./templateSettingsFields-cjlP-jdw.js";
|
|
21
|
-
import { n as pr, t as mr } from "./sanitizeHtml-GxJCxKcP.js";
|
|
22
|
-
import { t as hr } from "./LoadingTrack-DUYcDHOV.js";
|
|
23
|
-
import { t as gr } from "./readableTextColor-BfZUGnVj.js";
|
|
24
|
-
// src/composables/useFocusTrap.ts
|
|
25
|
-
var _r = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
26
|
-
function vr(e, t) {
|
|
27
|
-
let n = nr(), r = null, i = null, a = null;
|
|
28
|
-
function s() {
|
|
29
|
-
return e.value ? Array.from(e.value.querySelectorAll(_r)).filter((e) => e.offsetParent !== null) : [];
|
|
30
|
-
}
|
|
31
|
-
function c(e) {
|
|
32
|
-
if (e.key !== "Tab") return;
|
|
33
|
-
let t = s();
|
|
34
|
-
if (t.length === 0) return;
|
|
35
|
-
let r = t[0], i = t[t.length - 1];
|
|
36
|
-
e.shiftKey ? n.activeElement === r && (e.preventDefault(), i.focus()) : n.activeElement === i && (e.preventDefault(), r.focus());
|
|
37
|
-
}
|
|
38
|
-
function l() {
|
|
39
|
-
let t = i !== null || a !== null;
|
|
40
|
-
t && u({ restoreFocus: !1 }), t || (r = n.activeElement), a = requestAnimationFrame(() => {
|
|
41
|
-
a = null;
|
|
42
|
-
let t = s();
|
|
43
|
-
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
44
|
-
}), i = Qn(e, "keydown", c);
|
|
45
|
-
}
|
|
46
|
-
function u(e = {}) {
|
|
47
|
-
let t = e.restoreFocus !== !1;
|
|
48
|
-
a !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(a), a = null), i?.(), i = null, t && r && r.focus && (r.focus(), r = null);
|
|
49
|
-
}
|
|
50
|
-
let d = o([t, e], ([e, t]) => {
|
|
51
|
-
e && t ? l() : u();
|
|
52
|
-
}, { flush: "post" });
|
|
53
|
-
m(() => {
|
|
54
|
-
d(), u();
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
// src/composables/useEmoji.ts
|
|
58
|
-
function yr() {
|
|
59
|
-
let [e, t] = Xn(!1), n = F([]), r = !1;
|
|
60
|
-
m(() => {
|
|
61
|
-
r = !0;
|
|
62
|
-
}), o(e, async (e) => {
|
|
63
|
-
if (e && n.value.length === 0) {
|
|
64
|
-
let { emojiCategories: e } = await import("./emojiData-CBNuCfum.js");
|
|
65
|
-
if (r) return;
|
|
66
|
-
n.value = e;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
function i() {
|
|
70
|
-
t();
|
|
71
|
-
}
|
|
72
|
-
function a() {
|
|
73
|
-
e.value = !1;
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
categories: n,
|
|
77
|
-
isOpen: e,
|
|
78
|
-
toggle: i,
|
|
79
|
-
close: a
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
// src/composables/useBlockRegistry.ts
|
|
83
|
-
function br() {
|
|
84
|
-
let e = F(/* @__PURE__ */ new Map());
|
|
85
|
-
function t(t, n) {
|
|
86
|
-
e.value.set(t, n), L(e);
|
|
87
|
-
}
|
|
88
|
-
function n(t, n) {
|
|
89
|
-
let r = `custom:${t.type}`;
|
|
90
|
-
e.value.set(r, {
|
|
91
|
-
component: n,
|
|
92
|
-
createBlock: () => ue(t),
|
|
93
|
-
definition: t
|
|
94
|
-
}), L(e);
|
|
95
|
-
}
|
|
96
|
-
function r(t) {
|
|
97
|
-
if (t.type === "custom") {
|
|
98
|
-
let n = `custom:${t.customType}`;
|
|
99
|
-
return e.value.get(n)?.component;
|
|
100
|
-
}
|
|
101
|
-
return e.value.get(t.type)?.component;
|
|
102
|
-
}
|
|
103
|
-
function i(t) {
|
|
104
|
-
return e.value.get(t)?.createBlock();
|
|
105
|
-
}
|
|
106
|
-
function a(t) {
|
|
107
|
-
let n = `custom:${t}`;
|
|
108
|
-
return e.value.get(n)?.definition;
|
|
109
|
-
}
|
|
110
|
-
function o(e) {
|
|
111
|
-
return `<div style="color: var(--tpl-text-muted); padding: 16px; text-align: center; border: 1px dashed var(--tpl-border); border-radius: var(--tpl-radius-sm); font-family: var(--tpl-font-family); font-size: 14px;">${e}</div>`;
|
|
112
|
-
}
|
|
113
|
-
async function s(e) {
|
|
114
|
-
let t = a(e.customType);
|
|
115
|
-
if (!t) return o("Block definition not found");
|
|
116
|
-
try {
|
|
117
|
-
return await X(await import("./liquid.browser-rubac0VA.js")).parseAndRender(t.template, e.fieldValues);
|
|
118
|
-
} catch (t) {
|
|
119
|
-
return $.error(`Failed to render custom block "${e.customType}":`, t), o(`Render error: ${e.customType}`);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function c(t) {
|
|
123
|
-
return e.value.has(t);
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
registerBuiltIn: t,
|
|
127
|
-
registerCustom: n,
|
|
128
|
-
getComponent: r,
|
|
129
|
-
createBlock: i,
|
|
130
|
-
getDefinition: a,
|
|
131
|
-
renderCustomBlock: s,
|
|
132
|
-
isRegistered: c
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
// src/composables/useFonts.ts
|
|
136
|
-
var xr = [
|
|
137
|
-
{
|
|
138
|
-
value: "Arial",
|
|
139
|
-
label: "Arial"
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
value: "Helvetica",
|
|
143
|
-
label: "Helvetica"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
value: "Georgia",
|
|
147
|
-
label: "Georgia"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
value: "Times New Roman",
|
|
151
|
-
label: "Times New Roman"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
value: "Verdana",
|
|
155
|
-
label: "Verdana"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
value: "Trebuchet MS",
|
|
159
|
-
label: "Trebuchet MS"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
value: "Courier New",
|
|
163
|
-
label: "Courier New"
|
|
164
|
-
}
|
|
165
|
-
], Sr = "Arial, sans-serif";
|
|
166
|
-
function Cr(e) {
|
|
167
|
-
if (e === void 0 || e === !0) return [...xr];
|
|
168
|
-
if (e === !1) return [];
|
|
169
|
-
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
170
|
-
for (let i of e) {
|
|
171
|
-
let e = i.toLowerCase(), a = xr.find((t) => t.value.toLowerCase() === e);
|
|
172
|
-
a ? n.has(a.value) || (n.add(a.value), t.push(a)) : r.has(e) || (r.add(e), $.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${xr.map((e) => e.value).join(", ")}.`));
|
|
173
|
-
}
|
|
174
|
-
return t;
|
|
175
|
-
}
|
|
176
|
-
function wr(e) {
|
|
177
|
-
let t = z(e?.customFonts ?? []), n = z(!1), r = Cr(e?.builtIns), i = N(() => e?.defaultFallback ?? Sr), a = N(() => {
|
|
178
|
-
let e = [...r], n = t.value.map((e) => ({
|
|
179
|
-
value: e.name,
|
|
180
|
-
label: e.name,
|
|
181
|
-
isCustom: !0
|
|
182
|
-
})), i = [...e, ...n];
|
|
183
|
-
return i.sort((e, t) => e.label.localeCompare(t.label)), i;
|
|
184
|
-
});
|
|
185
|
-
function o(e) {
|
|
186
|
-
return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
187
|
-
}
|
|
188
|
-
let s = e?.defaultFont ?? Sr.split(",")[0].trim();
|
|
189
|
-
o(s) || $.warn(`config.fonts: new templates seed "${s}", which the font picker doesn't offer — authors can't reselect it. Either add it to fonts.builtIns, or set fonts.defaultFont to an offered font.`);
|
|
190
|
-
function c() {
|
|
191
|
-
if (e?.defaultFont && o(e.defaultFont)) {
|
|
192
|
-
let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
193
|
-
if (t) return t.value;
|
|
194
|
-
}
|
|
195
|
-
return Sr;
|
|
196
|
-
}
|
|
197
|
-
let l = N(() => c());
|
|
198
|
-
function u(e) {
|
|
199
|
-
return Ae(e, {
|
|
200
|
-
customFonts: t.value,
|
|
201
|
-
defaultFallback: i.value
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
let d = [], f = !1;
|
|
205
|
-
async function p() {
|
|
206
|
-
if (t.value.length === 0) {
|
|
207
|
-
f || (n.value = !0);
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
let e = t.value.map(async (e) => {
|
|
211
|
-
try {
|
|
212
|
-
if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
|
|
213
|
-
let t = document.createElement("link");
|
|
214
|
-
t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), d.push(t), await new Promise((n, r) => {
|
|
215
|
-
t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
|
|
216
|
-
});
|
|
217
|
-
} catch (t) {
|
|
218
|
-
$.warn(`Failed to load custom font "${e.name}":`, t);
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
await Promise.allSettled(e), !f && (n.value = !0);
|
|
222
|
-
}
|
|
223
|
-
function h() {
|
|
224
|
-
for (let e of d) e.remove();
|
|
225
|
-
d.length = 0;
|
|
226
|
-
}
|
|
227
|
-
return y() && m(() => {
|
|
228
|
-
f = !0, h();
|
|
229
|
-
}), {
|
|
230
|
-
fonts: a,
|
|
231
|
-
defaultFont: l,
|
|
232
|
-
defaultFallback: i,
|
|
233
|
-
customFonts: t,
|
|
234
|
-
isLoaded: n,
|
|
235
|
-
loadCustomFonts: p,
|
|
236
|
-
cleanupFontLinks: h,
|
|
237
|
-
resolveFontFamily: u,
|
|
238
|
-
getDefaultFont: c
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
// src/composables/useThemeStyles.ts
|
|
242
|
-
var Tr = {
|
|
243
|
-
bg: "--tpl-bg",
|
|
244
|
-
bgElevated: "--tpl-bg-elevated",
|
|
245
|
-
bgHover: "--tpl-bg-hover",
|
|
246
|
-
bgActive: "--tpl-bg-active",
|
|
247
|
-
border: "--tpl-border",
|
|
248
|
-
borderLight: "--tpl-border-light",
|
|
249
|
-
text: "--tpl-text",
|
|
250
|
-
textMuted: "--tpl-text-muted",
|
|
251
|
-
textDim: "--tpl-text-dim",
|
|
252
|
-
primary: "--tpl-primary",
|
|
253
|
-
primaryHover: "--tpl-primary-hover",
|
|
254
|
-
primaryLight: "--tpl-primary-light",
|
|
255
|
-
secondary: "--tpl-secondary",
|
|
256
|
-
secondaryHover: "--tpl-secondary-hover",
|
|
257
|
-
secondaryLight: "--tpl-secondary-light",
|
|
258
|
-
success: "--tpl-success",
|
|
259
|
-
successLight: "--tpl-success-light",
|
|
260
|
-
warning: "--tpl-warning",
|
|
261
|
-
warningLight: "--tpl-warning-light",
|
|
262
|
-
danger: "--tpl-danger",
|
|
263
|
-
dangerLight: "--tpl-danger-light",
|
|
264
|
-
canvasBg: "--tpl-canvas-bg"
|
|
265
|
-
};
|
|
266
|
-
function Er({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
267
|
-
return { themeStyles: N(() => {
|
|
268
|
-
let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
|
|
269
|
-
if (a) for (let [e, t] of Object.entries(Tr)) {
|
|
270
|
-
let n = a[e];
|
|
271
|
-
n && (r[t] = n);
|
|
272
|
-
}
|
|
273
|
-
return n && Object.assign(r, n()), r;
|
|
274
|
-
}) };
|
|
275
|
-
}
|
|
276
|
-
// src/utils/mergeTagNodeSpec.ts
|
|
277
|
-
function Dr(e, t, n) {
|
|
278
|
-
return he(e, n) ? {
|
|
279
|
-
type: "logicMergeTagNode",
|
|
280
|
-
attrs: {
|
|
281
|
-
value: e,
|
|
282
|
-
keyword: me(e, n)
|
|
283
|
-
}
|
|
284
|
-
} : {
|
|
285
|
-
type: "mergeTagNode",
|
|
286
|
-
attrs: {
|
|
287
|
-
label: t,
|
|
288
|
-
value: e
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
// src/utils/insertLogicTag.ts
|
|
293
|
-
function Or(e) {
|
|
294
|
-
return "before" in e && "after" in e;
|
|
295
|
-
}
|
|
296
|
-
function kr(e, t, n) {
|
|
297
|
-
if (!Or(t)) {
|
|
298
|
-
e.chain().focus().insertContent(Dr(t.value, t.label, n)).run();
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
let r = Dr(t.before, t.label, n), i = Dr(t.after, t.label, n), { from: a, to: o } = e.state.selection;
|
|
302
|
-
a === o ? e.chain().focus().insertContentAt(a, [r, i]).setTextSelection(a + 1).run() : e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
|
|
303
|
-
}
|
|
304
|
-
// src/utils/linkColorExtension.ts
|
|
305
|
-
function Ar(e) {
|
|
306
|
-
if (!e) return null;
|
|
307
|
-
let t = e.trim();
|
|
308
|
-
return /^#[0-9a-f]{3,8}$/i.test(t) || /^(rgb|rgba|hsl|hsla)\(\s*[0-9.,%/\s]+\)$/i.test(t) || /^[a-z]+$/i.test(t) ? t : null;
|
|
309
|
-
}
|
|
310
|
-
function jr(e) {
|
|
311
|
-
return e.extend({ addAttributes() {
|
|
312
|
-
return {
|
|
313
|
-
...this.parent?.(),
|
|
314
|
-
color: {
|
|
315
|
-
default: null,
|
|
316
|
-
parseHTML: (e) => Ar(cr(e.style.color)),
|
|
317
|
-
renderHTML: (e) => {
|
|
318
|
-
let t = Ar(e.color);
|
|
319
|
-
return t ? { style: `color: ${t}` } : {};
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
} });
|
|
324
|
-
}
|
|
325
|
-
// src/composables/useRichTextLinkDialog.ts
|
|
326
|
-
function Mr(e, t = ne.liquid, n = () => !0) {
|
|
327
|
-
let r = z(!1), i = z(""), a = z(""), o = z(null);
|
|
328
|
-
vr(o, r);
|
|
329
|
-
function s() {
|
|
330
|
-
if (!n()) return;
|
|
331
|
-
let t = e.value?.getAttributes("link") ?? {};
|
|
332
|
-
i.value = t.href || "", a.value = t.color || "", r.value = !0;
|
|
333
|
-
}
|
|
334
|
-
function c() {
|
|
335
|
-
if (n()) {
|
|
336
|
-
if (i.value) {
|
|
337
|
-
let t = d(i.value);
|
|
338
|
-
if (t !== null) {
|
|
339
|
-
let n = Ar(a.value), r = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
|
|
340
|
-
n && typeof e.value?.commands.unsetColor == "function" && r?.unsetColor(), r?.run();
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
p();
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
let l = /^(?:\/|\.{1,2}\/|\?)/;
|
|
347
|
-
function u(e) {
|
|
348
|
-
return RegExp(`^(?:${t.value.source})`).test(e);
|
|
349
|
-
}
|
|
350
|
-
function d(e) {
|
|
351
|
-
let t = e.trim();
|
|
352
|
-
if (!t) return null;
|
|
353
|
-
if (t.startsWith("#")) return t;
|
|
354
|
-
if (t.startsWith("//")) return `https:${t}`;
|
|
355
|
-
if (l.test(t)) return t;
|
|
356
|
-
let n = De(t);
|
|
357
|
-
return n ? Je.some((e) => e === n) ? t : null : u(t) ? t : `https://${t}`;
|
|
358
|
-
}
|
|
359
|
-
function f() {
|
|
360
|
-
n() && (e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), p());
|
|
361
|
-
}
|
|
362
|
-
function p() {
|
|
363
|
-
r.value = !1, i.value = "", a.value = "";
|
|
364
|
-
}
|
|
365
|
-
function m(e) {
|
|
366
|
-
e.key === "Enter" ? (e.preventDefault(), c()) : e.key === "Escape" && p();
|
|
367
|
-
}
|
|
368
|
-
return {
|
|
369
|
-
showLinkDialog: r,
|
|
370
|
-
linkUrl: i,
|
|
371
|
-
linkColor: a,
|
|
372
|
-
linkDialogRef: o,
|
|
373
|
-
openLinkDialog: s,
|
|
374
|
-
insertLink: c,
|
|
375
|
-
removeLink: f,
|
|
376
|
-
closeLinkDialog: p,
|
|
377
|
-
handleLinkKeydown: m
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
// src/composables/useRichTextEditor.ts
|
|
381
|
-
function Nr(e) {
|
|
382
|
-
let t = f(Ln, null), n = ar(), { mergeTags: r, canRequestMergeTag: i, isRequesting: a, requestMergeTag: s, syntax: c, autocomplete: l } = rr(), { canInsertLogicTag: d, isRequesting: p, requestLogicTag: m } = ur(), h = f(Fn, null), g = (v(h) ? h.value : h)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", _ = ie(c), y = F(null), b = t?.content ? Hn(t) : null, x = () => Ye(b?.settings.value ?? { locale: "en" });
|
|
383
|
-
o(x, (e) => {
|
|
384
|
-
let t = y.value?.view.dom;
|
|
385
|
-
t && t.setAttribute("dir", e);
|
|
386
|
-
});
|
|
387
|
-
let { showLinkDialog: S, linkUrl: C, linkColor: w, linkDialogRef: T, openLinkDialog: E, insertLink: D, removeLink: O, closeLinkDialog: k, handleLinkKeydown: A } = Mr(y, c, () => n.value);
|
|
388
|
-
o(n, (e) => {
|
|
389
|
-
if (y.value?.setEditable(e, !1), !e) {
|
|
390
|
-
k();
|
|
391
|
-
let e = y.value;
|
|
392
|
-
e && e.view.dispatch(e.state.tr);
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
let { start: j, stop: M } = Jn(() => y.value?.commands.focus("end"), 0, { immediate: !1 }), N = F(null), P = z(!0), I = z(null), L = !1, R = null;
|
|
396
|
-
async function B() {
|
|
397
|
-
I.value = null, P.value = !0;
|
|
398
|
-
try {
|
|
399
|
-
let { TiptapEditor: i, EC: a, extensions: o } = await e.loadExtensions({
|
|
400
|
-
mergeTags: r,
|
|
401
|
-
syntax: c,
|
|
402
|
-
triggerChar: _,
|
|
403
|
-
autocompleteEnabled: l,
|
|
404
|
-
suggestionEmptyText: g
|
|
405
|
-
});
|
|
406
|
-
if (L) return;
|
|
407
|
-
N.value = a;
|
|
408
|
-
let s = /* @__PURE__ */ new Map();
|
|
409
|
-
o.forEach((e, t) => s.set(e.name, t));
|
|
410
|
-
let u = new i({
|
|
411
|
-
extensions: o.filter((e, t) => s.get(e.name) === t),
|
|
412
|
-
content: e.blockContent(),
|
|
413
|
-
editable: n.value,
|
|
414
|
-
editorProps: { attributes: { dir: x() } },
|
|
415
|
-
onUpdate: ({ editor: r }) => {
|
|
416
|
-
!L && n.value && t && (R = r.getHTML(), t.updateBlock(e.blockId(), { content: R }));
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
if (L) {
|
|
420
|
-
u.destroy();
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
y.value = u, P.value = !1, j();
|
|
424
|
-
} catch (t) {
|
|
425
|
-
if (L) return;
|
|
426
|
-
$.error(`[${e.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, t), I.value = t instanceof Error ? t.message : "Failed to load editor", P.value = !1;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
function V() {
|
|
430
|
-
y.value?.destroy(), y.value = null, B();
|
|
431
|
-
}
|
|
432
|
-
B();
|
|
433
|
-
let H = o(() => e.blockContent(), (e) => {
|
|
434
|
-
y.value && e !== R && (R = e, y.value.getHTML() !== e && y.value.commands.setContent(e, { emitUpdate: !1 }));
|
|
435
|
-
});
|
|
436
|
-
function U(t) {
|
|
437
|
-
if (a.value || p.value) return;
|
|
438
|
-
let n = t.composedPath(), r = n.find((e) => e instanceof HTMLElement);
|
|
439
|
-
if (!r) return;
|
|
440
|
-
e.onClickOutsideSideEffect?.(r);
|
|
441
|
-
let i = n.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
|
|
442
|
-
r.closest(".tpl-text-editor-wrapper") || r.closest(".tpl-text-toolbar") || r.closest(".tpl-link-dialog") || i || e.onDone();
|
|
443
|
-
}
|
|
444
|
-
Qn(document, "mousedown", U), u(() => {
|
|
445
|
-
L = !0, H(), M(), y.value?.destroy();
|
|
446
|
-
});
|
|
447
|
-
async function W() {
|
|
448
|
-
if (!n.value) return;
|
|
449
|
-
let e = await s();
|
|
450
|
-
!L && n.value && (e && y.value ? y.value.chain().focus().insertMergeTag({
|
|
451
|
-
label: e.label,
|
|
452
|
-
value: e.value
|
|
453
|
-
}).run() : y.value?.commands.focus());
|
|
454
|
-
}
|
|
455
|
-
async function G() {
|
|
456
|
-
if (!n.value) return;
|
|
457
|
-
let e = await m();
|
|
458
|
-
!L && n.value && (e && y.value ? kr(y.value, e, c) : y.value?.commands.focus());
|
|
459
|
-
}
|
|
460
|
-
return {
|
|
461
|
-
editor: y,
|
|
462
|
-
EditorContent: N,
|
|
463
|
-
isLoading: P,
|
|
464
|
-
isEditable: n,
|
|
465
|
-
initError: I,
|
|
466
|
-
retry: V,
|
|
467
|
-
showLinkDialog: S,
|
|
468
|
-
linkUrl: C,
|
|
469
|
-
linkColor: w,
|
|
470
|
-
linkDialogRef: T,
|
|
471
|
-
mergeTags: r,
|
|
472
|
-
canRequestMergeTag: i,
|
|
473
|
-
isRequestingMergeTag: a,
|
|
474
|
-
syntax: c,
|
|
475
|
-
canInsertLogicTag: d,
|
|
476
|
-
isRequestingLogicTag: p,
|
|
477
|
-
openLinkDialog: E,
|
|
478
|
-
insertLink: D,
|
|
479
|
-
removeLink: O,
|
|
480
|
-
closeLinkDialog: k,
|
|
481
|
-
handleLinkKeydown: A,
|
|
482
|
-
handleAddMergeTag: W,
|
|
483
|
-
handleAddLogicTag: G
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
// src/utils/activeEditorTracker.ts
|
|
487
|
-
var Pr = /* @__PURE__ */ new Set(), Fr = 0, Ir = 0;
|
|
488
|
-
function Lr() {
|
|
489
|
-
let e = ++Ir;
|
|
490
|
-
return Pr.add(e), Fr === 0 && (Fr = e), {
|
|
491
|
-
id: e,
|
|
492
|
-
isActive: () => Pr.size <= 1 || Fr === e,
|
|
493
|
-
claim: () => {
|
|
494
|
-
Fr = e;
|
|
495
|
-
},
|
|
496
|
-
dispose: () => {
|
|
497
|
-
if (Pr.delete(e), Fr === e) {
|
|
498
|
-
let e = Array.from(Pr);
|
|
499
|
-
Fr = e[e.length - 1] ?? 0;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
// src/utils/resolveLintOptions.ts
|
|
505
|
-
function Rr(e) {
|
|
506
|
-
let t = e.contentLocale ?? e.content?.settings.locale;
|
|
507
|
-
return {
|
|
508
|
-
...e.lint,
|
|
509
|
-
locale: e.locale,
|
|
510
|
-
...t === void 0 ? {} : { contentLocale: t }
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
// src/composables/usePreviewResolution.ts
|
|
514
|
-
var zr = 500;
|
|
515
|
-
function Br(e) {
|
|
516
|
-
let t = typeof e.resolvePreview == "function", n = z(null), r = z(!1), i = z(!1), a = 0, s = null;
|
|
517
|
-
function c() {
|
|
518
|
-
s !== null && (clearTimeout(s), s = null);
|
|
519
|
-
}
|
|
520
|
-
async function l() {
|
|
521
|
-
let t = e.resolvePreview;
|
|
522
|
-
if (!t) return;
|
|
523
|
-
let o = ++a;
|
|
524
|
-
r.value = !0;
|
|
525
|
-
let s = {
|
|
526
|
-
content: Ie(e.getContent()),
|
|
527
|
-
...e.getRecipient?.() === void 0 ? {} : { recipient: e.getRecipient() }
|
|
528
|
-
};
|
|
529
|
-
try {
|
|
530
|
-
let e = await t(s);
|
|
531
|
-
if (o !== a) return;
|
|
532
|
-
if (!Ke(e)) {
|
|
533
|
-
i.value = !0;
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
n.value = e, i.value = !1;
|
|
537
|
-
} catch {
|
|
538
|
-
if (o !== a) return;
|
|
539
|
-
i.value = !0;
|
|
540
|
-
} finally {
|
|
541
|
-
o === a && (r.value = !1);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
function u() {
|
|
545
|
-
t && (c(), n.value === null ? l() : s = setTimeout(() => {
|
|
546
|
-
s = null, l();
|
|
547
|
-
}, zr));
|
|
548
|
-
}
|
|
549
|
-
return o(() => [
|
|
550
|
-
e.isActive(),
|
|
551
|
-
e.getRecipient?.(),
|
|
552
|
-
e.getLocale?.()
|
|
553
|
-
], ([e, , t], o) => {
|
|
554
|
-
o && t !== o[2] && (c(), a++, n.value = null, r.value = !1, i.value = !1), e ? u() : (c(), a++, r.value = !1, n.value = null, i.value = !1);
|
|
555
|
-
}, {
|
|
556
|
-
immediate: !0,
|
|
557
|
-
flush: "sync"
|
|
558
|
-
}), m(() => {
|
|
559
|
-
c(), a++;
|
|
560
|
-
}), {
|
|
561
|
-
isConfigured: t,
|
|
562
|
-
content: N(() => n.value ?? e.getContent()),
|
|
563
|
-
isResolving: r,
|
|
564
|
-
isInitialResolve: N(() => r.value && n.value === null),
|
|
565
|
-
hasFailed: i,
|
|
566
|
-
supersedesSamples: N(() => t)
|
|
567
|
-
};
|
|
568
|
-
}
|
|
569
|
-
// src/composables/useMergeTagPicker.ts
|
|
570
|
-
function Vr() {
|
|
571
|
-
let e = z(!1), t = z([]), n = z(null), r = null;
|
|
572
|
-
function i(i, a) {
|
|
573
|
-
if (r) {
|
|
574
|
-
let e = r;
|
|
575
|
-
r = null, e(null);
|
|
576
|
-
}
|
|
577
|
-
return t.value = i, n.value = a?.current ?? null, e.value = !0, new Promise((e) => {
|
|
578
|
-
r = e;
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
function a(i) {
|
|
582
|
-
let a = r;
|
|
583
|
-
r = null, e.value = !1, t.value = [], n.value = null, a && a(i);
|
|
584
|
-
}
|
|
585
|
-
return y() && m(() => {
|
|
586
|
-
if (r) {
|
|
587
|
-
let e = r;
|
|
588
|
-
r = null, e(null);
|
|
589
|
-
}
|
|
590
|
-
e.value = !1, t.value = [], n.value = null;
|
|
591
|
-
}), {
|
|
592
|
-
isOpen: e,
|
|
593
|
-
tags: t,
|
|
594
|
-
current: n,
|
|
595
|
-
open: i,
|
|
596
|
-
resolve: a
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
// src/composables/useLogicTagPicker.ts
|
|
600
|
-
function Hr() {
|
|
601
|
-
let e = z(!1), t = z([]), n = z([]), r = null;
|
|
602
|
-
function i(i, a) {
|
|
603
|
-
if (r) {
|
|
604
|
-
let e = r;
|
|
605
|
-
r = null, e(null);
|
|
606
|
-
}
|
|
607
|
-
return t.value = i, n.value = a, e.value = !0, new Promise((e) => {
|
|
608
|
-
r = e;
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
function a(i) {
|
|
612
|
-
let a = r;
|
|
613
|
-
r = null, e.value = !1, t.value = [], n.value = [], a && a(i);
|
|
614
|
-
}
|
|
615
|
-
return y() && m(() => {
|
|
616
|
-
if (r) {
|
|
617
|
-
let e = r;
|
|
618
|
-
r = null, e(null);
|
|
619
|
-
}
|
|
620
|
-
e.value = !1, t.value = [], n.value = [];
|
|
621
|
-
}), {
|
|
622
|
-
isOpen: e,
|
|
623
|
-
tags: t,
|
|
624
|
-
pairs: n,
|
|
625
|
-
open: i,
|
|
626
|
-
resolve: a
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
// src/composables/useTemplateLint.ts
|
|
630
|
-
function Ur(e) {
|
|
631
|
-
return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 && e.deliverability === !1 && e.compatibility === !1 && e.localization === !1 : !1;
|
|
632
|
-
}
|
|
633
|
-
var Wr = !1;
|
|
634
|
-
function Gr(e) {
|
|
635
|
-
let t = z([]), n = z(0), r = z(-1), i = o(e.content, () => {
|
|
636
|
-
n.value++;
|
|
637
|
-
}, { deep: !0 }), a = z(!1), s = z(!1), c = F(null), l = Ur(e.options), u = null, d = !1;
|
|
638
|
-
l || f();
|
|
639
|
-
async function f() {
|
|
640
|
-
try {
|
|
641
|
-
let t = await import("./src-Diw9SLIe.js");
|
|
642
|
-
if (d) return;
|
|
643
|
-
c.value = { lintTemplate: t.lintTemplate }, a.value = !0, p(), u = Zn(n, p, { debounce: e.debounce ?? 500 });
|
|
644
|
-
} catch {
|
|
645
|
-
if (d) return;
|
|
646
|
-
s.value = !0, Wr || (Wr = !0, $.info("@templatical/quality isn't installed, so the Issues panel and its lint badges are off. Add @templatical/quality to your dependencies to turn them on."));
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
function p() {
|
|
650
|
-
if (!c.value) return;
|
|
651
|
-
let i = c.value.lintTemplate(e.content.value, {
|
|
652
|
-
...e.options,
|
|
653
|
-
...e.customBlocks === void 0 ? {} : { customBlocks: e.customBlocks },
|
|
654
|
-
...e.mergeTagSyntax === void 0 ? {} : { mergeTagSyntax: e.mergeTagSyntax }
|
|
655
|
-
});
|
|
656
|
-
r.value = n.value, t.value = i;
|
|
657
|
-
}
|
|
658
|
-
let m = o(() => e.options, () => {
|
|
659
|
-
c.value && p();
|
|
660
|
-
}, { deep: !0 });
|
|
661
|
-
function h(t) {
|
|
662
|
-
t.fix && t.fix.apply({
|
|
663
|
-
updateBlock: e.updateBlock,
|
|
664
|
-
updateSettings: e.updateSettings,
|
|
665
|
-
removeBlock: (t) => {
|
|
666
|
-
let n = e.content.value.settings.locale ?? "en";
|
|
667
|
-
(e.options.contentLocale ?? n) === n && e.removeBlock(t);
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
function g() {
|
|
672
|
-
d = !0, u?.(), i(), m();
|
|
673
|
-
}
|
|
674
|
-
return {
|
|
675
|
-
issues: t,
|
|
676
|
-
contentVersion: n,
|
|
677
|
-
lintVersion: r,
|
|
678
|
-
ready: a,
|
|
679
|
-
unavailable: s,
|
|
680
|
-
applyFix: h,
|
|
681
|
-
destroy: g
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
// src/composables/useKeyboardReorder.ts
|
|
685
|
-
function Kr(e, t, n = []) {
|
|
686
|
-
let r = z(null), i = z(""), a = null;
|
|
687
|
-
function o(t) {
|
|
688
|
-
let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
|
|
689
|
-
if (r !== -1) return {
|
|
690
|
-
index: r,
|
|
691
|
-
total: n.length
|
|
692
|
-
};
|
|
693
|
-
for (let e of n) {
|
|
694
|
-
if (e.type !== "section") continue;
|
|
695
|
-
let n = e;
|
|
696
|
-
for (let e = 0; e < n.children.length; e++) {
|
|
697
|
-
let r = n.children[e], i = r.findIndex((e) => e.id === t);
|
|
698
|
-
if (i !== -1) return {
|
|
699
|
-
index: i,
|
|
700
|
-
total: r.length,
|
|
701
|
-
sectionId: n.id,
|
|
702
|
-
columnIndex: e
|
|
703
|
-
};
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
return null;
|
|
707
|
-
}
|
|
708
|
-
function s(r) {
|
|
709
|
-
let i = o(r);
|
|
710
|
-
if (!i) return "";
|
|
711
|
-
let a = (i.sectionId ? c(i.sectionId, i.columnIndex ?? 0) : e.content.value.blocks)?.[i.index];
|
|
712
|
-
return a ? bt(a, t.t, n) : "";
|
|
713
|
-
}
|
|
714
|
-
function c(t, n) {
|
|
715
|
-
return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
|
|
716
|
-
}
|
|
717
|
-
function l(e) {
|
|
718
|
-
i.value = "", queueMicrotask(() => {
|
|
719
|
-
i.value = e;
|
|
720
|
-
});
|
|
721
|
-
}
|
|
722
|
-
function u(e) {
|
|
723
|
-
return r.value === e;
|
|
724
|
-
}
|
|
725
|
-
function d(e) {
|
|
726
|
-
let n = o(e);
|
|
727
|
-
n && (r.value = e, a = n, l(t.format(t.t.blockActions.lifted, {
|
|
728
|
-
block: s(e),
|
|
729
|
-
position: String(n.index + 1),
|
|
730
|
-
total: String(n.total)
|
|
731
|
-
})));
|
|
732
|
-
}
|
|
733
|
-
function f(n, r) {
|
|
734
|
-
let i = o(n);
|
|
735
|
-
if (!i) return;
|
|
736
|
-
let a = i.index + r;
|
|
737
|
-
a < 0 || a >= i.total || (e.moveBlock(n, a, i.sectionId, i.columnIndex), l(t.format(t.t.blockActions.moved, {
|
|
738
|
-
block: s(n),
|
|
739
|
-
position: String(a + 1),
|
|
740
|
-
total: String(i.total)
|
|
741
|
-
})));
|
|
742
|
-
}
|
|
743
|
-
function p(e) {
|
|
744
|
-
f(e, -1);
|
|
745
|
-
}
|
|
746
|
-
function m(e) {
|
|
747
|
-
f(e, 1);
|
|
748
|
-
}
|
|
749
|
-
function h(e) {
|
|
750
|
-
let n = o(e);
|
|
751
|
-
n && l(t.format(t.t.blockActions.dropped, {
|
|
752
|
-
block: s(e),
|
|
753
|
-
position: String(n.index + 1),
|
|
754
|
-
total: String(n.total)
|
|
755
|
-
})), r.value = null, a = null;
|
|
756
|
-
}
|
|
757
|
-
function g() {
|
|
758
|
-
let n = r.value;
|
|
759
|
-
if (n && a) {
|
|
760
|
-
let r = o(n);
|
|
761
|
-
r && (r && (r.sectionId !== a.sectionId || r.columnIndex !== a.columnIndex) || r && r.index !== a.index) && e.moveBlock(n, a.index, a.sectionId, a.columnIndex), l(t.format(t.t.blockActions.cancelled, {
|
|
762
|
-
block: s(n),
|
|
763
|
-
position: String(a.index + 1)
|
|
764
|
-
}));
|
|
765
|
-
}
|
|
766
|
-
r.value = null, a = null;
|
|
767
|
-
}
|
|
768
|
-
return {
|
|
769
|
-
liftedBlockId: r,
|
|
770
|
-
announcement: i,
|
|
771
|
-
isLifted: u,
|
|
772
|
-
lift: d,
|
|
773
|
-
cancel: g,
|
|
774
|
-
moveUp: p,
|
|
775
|
-
moveDown: m,
|
|
776
|
-
drop: h
|
|
777
|
-
};
|
|
778
|
-
}
|
|
779
|
-
// src/composables/useUiTheme.ts
|
|
780
|
-
function qr(e) {
|
|
781
|
-
let t = $n("(prefers-color-scheme: dark)");
|
|
782
|
-
return { resolvedTheme: N(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
|
|
783
|
-
}
|
|
784
|
-
// src/composables/useCustomBlockStylesheets.ts
|
|
785
|
-
function Jr(e, t) {
|
|
786
|
-
return N(() => {
|
|
787
|
-
let n = Yr(e.value.blocks);
|
|
788
|
-
if (n.size === 0) return [];
|
|
789
|
-
let r = /* @__PURE__ */ new Set(), i = [];
|
|
790
|
-
for (let e of n) {
|
|
791
|
-
let n = t.getDefinition(e)?.stylesheet;
|
|
792
|
-
if (!n) continue;
|
|
793
|
-
let a = n.trim();
|
|
794
|
-
a === "" || r.has(a) || (r.add(a), i.push(a));
|
|
795
|
-
}
|
|
796
|
-
return i;
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
function Yr(e) {
|
|
800
|
-
let t = /* @__PURE__ */ new Set();
|
|
801
|
-
return Xr(e, t), t;
|
|
802
|
-
}
|
|
803
|
-
function Xr(e, t) {
|
|
804
|
-
for (let n of e) if (xe(n)) t.add(n.customType);
|
|
805
|
-
else if (n.type === "section") {
|
|
806
|
-
let e = n.children;
|
|
807
|
-
if (!e) continue;
|
|
808
|
-
for (let n of e) Xr(n, t);
|
|
809
|
-
} else W(n) && Xr(n.children, t);
|
|
810
|
-
}
|
|
811
|
-
// src/utils/registerBuiltInBlocks.ts
|
|
812
|
-
var Zr = [
|
|
813
|
-
{
|
|
814
|
-
type: "section",
|
|
815
|
-
createBlock: se
|
|
816
|
-
},
|
|
817
|
-
{
|
|
818
|
-
type: "title",
|
|
819
|
-
createBlock: oe
|
|
820
|
-
},
|
|
821
|
-
{
|
|
822
|
-
type: "paragraph",
|
|
823
|
-
createBlock: K
|
|
824
|
-
},
|
|
825
|
-
{
|
|
826
|
-
type: "image",
|
|
827
|
-
createBlock: fe
|
|
828
|
-
},
|
|
829
|
-
{
|
|
830
|
-
type: "button",
|
|
831
|
-
createBlock: we
|
|
832
|
-
},
|
|
833
|
-
{
|
|
834
|
-
type: "divider",
|
|
835
|
-
createBlock: ee
|
|
836
|
-
},
|
|
837
|
-
{
|
|
838
|
-
type: "video",
|
|
839
|
-
createBlock: ce
|
|
840
|
-
},
|
|
841
|
-
{
|
|
842
|
-
type: "social",
|
|
843
|
-
createBlock: U
|
|
844
|
-
},
|
|
845
|
-
{
|
|
846
|
-
type: "menu",
|
|
847
|
-
createBlock: q
|
|
848
|
-
},
|
|
849
|
-
{
|
|
850
|
-
type: "table",
|
|
851
|
-
createBlock: ae
|
|
852
|
-
},
|
|
853
|
-
{
|
|
854
|
-
type: "spacer",
|
|
855
|
-
createBlock: Me
|
|
856
|
-
},
|
|
857
|
-
{
|
|
858
|
-
type: "html",
|
|
859
|
-
createBlock: Ze
|
|
860
|
-
},
|
|
861
|
-
{
|
|
862
|
-
type: "countdown",
|
|
863
|
-
createBlock: Qe
|
|
864
|
-
}
|
|
865
|
-
];
|
|
866
|
-
function Qr(e, t) {
|
|
867
|
-
for (let n of Zr) {
|
|
868
|
-
let r = t[n.type];
|
|
869
|
-
r && e.registerBuiltIn(n.type, {
|
|
870
|
-
component: r,
|
|
871
|
-
createBlock: n.createBlock
|
|
872
|
-
});
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
// src/utils/resolveHtmlBlockPreview.ts
|
|
876
|
-
function $r(e) {
|
|
877
|
-
return typeof e == "boolean" ? e : e?.enabled ?? !1;
|
|
878
|
-
}
|
|
879
|
-
// src/utils/collectOffPaletteDefaults.ts
|
|
880
|
-
function ei(e) {
|
|
881
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
882
|
-
}
|
|
883
|
-
function ti(e, t, n) {
|
|
884
|
-
let r = new Set(e.map((e) => ir(e))), i = [], a = (e, t) => {
|
|
885
|
-
for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(ir(o)) && i.push(`${t}.${n}: ${o}`) : ei(o) && a(o, `${t}.${n}`);
|
|
886
|
-
}, o = t;
|
|
887
|
-
for (let [e, t] of Object.entries(ke)) {
|
|
888
|
-
let n = o?.[e];
|
|
889
|
-
a({
|
|
890
|
-
...t,
|
|
891
|
-
...ei(n) ? n : {}
|
|
892
|
-
}, e);
|
|
893
|
-
}
|
|
894
|
-
return a({
|
|
895
|
-
...He,
|
|
896
|
-
...n ?? {}
|
|
897
|
-
}, "template"), i;
|
|
898
|
-
}
|
|
899
|
-
// src/utils/localizedBlockDefaults.ts
|
|
900
|
-
function ni(e) {
|
|
901
|
-
return {
|
|
902
|
-
title: { content: `<p>${e.blockDefaults.title}</p>` },
|
|
903
|
-
paragraph: { content: `<p>${e.blockDefaults.paragraph}</p>` },
|
|
904
|
-
button: { text: e.blockDefaults.button }
|
|
905
|
-
};
|
|
906
|
-
}
|
|
907
|
-
// src/i18n/index.ts
|
|
908
|
-
var ri = /* #__PURE__ */ Object.assign({
|
|
909
|
-
"./locales/ca.ts": () => import("./ca-DIkMxYCN.js"),
|
|
910
|
-
"./locales/de.ts": () => import("./de-Cc6Ue0UD.js"),
|
|
911
|
-
"./locales/en.ts": () => import("./en-BX4FujAQ.js"),
|
|
912
|
-
"./locales/es.ts": () => import("./es-Do5b-MKU.js"),
|
|
913
|
-
"./locales/fr.ts": () => import("./fr-S1n2Ebzp.js"),
|
|
914
|
-
"./locales/ja.ts": () => import("./ja-DLwcq4bA.js"),
|
|
915
|
-
"./locales/nl.ts": () => import("./nl-0JSWaZpT.js"),
|
|
916
|
-
"./locales/pt-BR.ts": () => import("./pt-BR-D3VlIMDZ.js")
|
|
917
|
-
}), ii = /* #__PURE__ */ Object.assign({
|
|
918
|
-
"./locales/cloud/de.ts": () => import("./de-6M4JoHoD.js"),
|
|
919
|
-
"./locales/cloud/en.ts": () => import("./en-FzUuJ8HW.js"),
|
|
920
|
-
"./locales/cloud/pt-BR.ts": () => import("./pt-BR-Bp92Fc6J.js")
|
|
921
|
-
});
|
|
922
|
-
function ai(e) {
|
|
923
|
-
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
924
|
-
}
|
|
925
|
-
var oi = ai(ri), si = ai(ii);
|
|
926
|
-
function ci(e) {
|
|
927
|
-
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
928
|
-
}
|
|
929
|
-
function li(e, t) {
|
|
930
|
-
let n = ci(e);
|
|
931
|
-
return t.find((e) => ci(e) === n);
|
|
932
|
-
}
|
|
933
|
-
function ui(e) {
|
|
934
|
-
return ci(e).split("-")[0];
|
|
935
|
-
}
|
|
936
|
-
function di(e, t) {
|
|
937
|
-
return li(e, t) ?? li(ui(e), t);
|
|
938
|
-
}
|
|
939
|
-
function fi(e, t) {
|
|
940
|
-
return di(e, t) ?? "en";
|
|
941
|
-
}
|
|
942
|
-
async function pi(e) {
|
|
943
|
-
let t = ri[`./locales/${fi(e, oi)}.ts`];
|
|
944
|
-
return (await t()).default;
|
|
945
|
-
}
|
|
946
|
-
async function mi(e) {
|
|
947
|
-
let t = ii[`./locales/cloud/${fi(e, si)}.ts`];
|
|
948
|
-
return (await t()).default;
|
|
949
|
-
}
|
|
950
|
-
function hi(e) {
|
|
951
|
-
return di(e, oi) !== void 0;
|
|
952
|
-
}
|
|
953
|
-
function gi(e) {
|
|
954
|
-
return di(e, si) !== void 0;
|
|
955
|
-
}
|
|
956
|
-
function _i() {
|
|
957
|
-
return [...oi];
|
|
958
|
-
}
|
|
959
|
-
function vi() {
|
|
960
|
-
return [...si];
|
|
961
|
-
}
|
|
962
|
-
// src/i18n/contentDefaults.ts
|
|
963
|
-
var yi = {
|
|
964
|
-
en: {
|
|
965
|
-
video: "Video",
|
|
966
|
-
days: "Days",
|
|
967
|
-
hours: "Hours",
|
|
968
|
-
minutes: "Minutes",
|
|
969
|
-
seconds: "Seconds",
|
|
970
|
-
expired: "This offer has expired"
|
|
971
|
-
},
|
|
972
|
-
de: {
|
|
973
|
-
video: "Video",
|
|
974
|
-
days: "Tage",
|
|
975
|
-
hours: "Stunden",
|
|
976
|
-
minutes: "Minuten",
|
|
977
|
-
seconds: "Sekunden",
|
|
978
|
-
expired: "Dieses Angebot ist abgelaufen"
|
|
979
|
-
},
|
|
980
|
-
es: {
|
|
981
|
-
video: "Vídeo",
|
|
982
|
-
days: "Días",
|
|
983
|
-
hours: "Horas",
|
|
984
|
-
minutes: "Minutos",
|
|
985
|
-
seconds: "Segundos",
|
|
986
|
-
expired: "Esta oferta ha expirado"
|
|
987
|
-
},
|
|
988
|
-
fr: {
|
|
989
|
-
video: "Vidéo",
|
|
990
|
-
days: "Jours",
|
|
991
|
-
hours: "Heures",
|
|
992
|
-
minutes: "Minutes",
|
|
993
|
-
seconds: "Secondes",
|
|
994
|
-
expired: "Cette offre a expiré"
|
|
995
|
-
},
|
|
996
|
-
nl: {
|
|
997
|
-
video: "Video",
|
|
998
|
-
days: "Dagen",
|
|
999
|
-
hours: "Uren",
|
|
1000
|
-
minutes: "Minuten",
|
|
1001
|
-
seconds: "Seconden",
|
|
1002
|
-
expired: "Deze aanbieding is verlopen"
|
|
1003
|
-
},
|
|
1004
|
-
"pt-BR": {
|
|
1005
|
-
video: "Vídeo",
|
|
1006
|
-
days: "Dias",
|
|
1007
|
-
hours: "Horas",
|
|
1008
|
-
minutes: "Minutos",
|
|
1009
|
-
seconds: "Segundos",
|
|
1010
|
-
expired: "Esta oferta expirou"
|
|
1011
|
-
},
|
|
1012
|
-
ca: {
|
|
1013
|
-
video: "Vídeo",
|
|
1014
|
-
days: "Dies",
|
|
1015
|
-
hours: "Hores",
|
|
1016
|
-
minutes: "Minuts",
|
|
1017
|
-
seconds: "Segons",
|
|
1018
|
-
expired: "Aquesta oferta ha caducat"
|
|
1019
|
-
},
|
|
1020
|
-
ja: {
|
|
1021
|
-
video: "動画",
|
|
1022
|
-
days: "日",
|
|
1023
|
-
hours: "時間",
|
|
1024
|
-
minutes: "分",
|
|
1025
|
-
seconds: "秒",
|
|
1026
|
-
expired: "このオファーは終了しました"
|
|
1027
|
-
}
|
|
1028
|
-
}, bi = new Map(Object.keys(yi).map((e) => [e.toLowerCase(), e]));
|
|
1029
|
-
function xi(e) {
|
|
1030
|
-
if (!e) return yi.en;
|
|
1031
|
-
let t = e.trim().replace(/_/g, "-").toLowerCase(), n = bi.get(t);
|
|
1032
|
-
if (n) return yi[n];
|
|
1033
|
-
let r = bi.get(ui(t));
|
|
1034
|
-
return r ? yi[r] : yi.en;
|
|
1035
|
-
}
|
|
1036
|
-
function Si(e) {
|
|
1037
|
-
let t = xi(e);
|
|
1038
|
-
return {
|
|
1039
|
-
video: { alt: t.video },
|
|
1040
|
-
countdown: {
|
|
1041
|
-
labelDays: t.days,
|
|
1042
|
-
labelHours: t.hours,
|
|
1043
|
-
labelMinutes: t.minutes,
|
|
1044
|
-
labelSeconds: t.seconds,
|
|
1045
|
-
expiredMessage: t.expired
|
|
1046
|
-
}
|
|
1047
|
-
};
|
|
1048
|
-
}
|
|
1049
|
-
// src/utils/collectColorFieldIssues.ts
|
|
1050
|
-
function Ci(e, t) {
|
|
1051
|
-
let n = [], r = (r, i) => {
|
|
1052
|
-
let a = _t(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
|
|
1053
|
-
if (a.invalidPresets.length > 0 && n.push({
|
|
1054
|
-
id: s("invalid-presets"),
|
|
1055
|
-
message: `${o}: presets skipped invalid entries: ${a.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).` + (a.presetsInherited ? " No valid entries are left, so the field inherits colors.presets." : "")
|
|
1056
|
-
}), a.emptyPresets && n.push({
|
|
1057
|
-
id: s("empty-presets"),
|
|
1058
|
-
message: `${o}: presets is empty — a field palette can only narrow the editor's, so an empty list is ignored and the field inherits colors.presets.`
|
|
1059
|
-
}), a.allowCustomIgnored && n.push({
|
|
1060
|
-
id: s("allow-custom-ignored"),
|
|
1061
|
-
message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
|
|
1062
|
-
}), !a.allowCustom && a.presets.length > 0) {
|
|
1063
|
-
let e = r.default ?? "", t = new Set(a.presets.map((e) => ir(e)));
|
|
1064
|
-
e !== "" && !t.has(ir(e)) && n.push({
|
|
1065
|
-
id: s("off-palette-default"),
|
|
1066
|
-
message: `${o} locks custom colours, but its default ${e} falls outside the field's presets: ${a.presets.join(", ")}. New blocks start on a colour the picker can't reselect — set the default from the same palette.`
|
|
1067
|
-
});
|
|
1068
|
-
}
|
|
1069
|
-
};
|
|
1070
|
-
for (let t of e.fields) if (t.type === "color") r(t, t.key);
|
|
1071
|
-
else if (t.type === "repeatable") for (let e of t.fields) e.type === "color" && r(e, `${t.key}[].${e.key}`);
|
|
1072
|
-
return n;
|
|
1073
|
-
}
|
|
1074
|
-
// src/utils/keyboardShortcuts.ts
|
|
1075
|
-
function wi(e) {
|
|
1076
|
-
for (let t of e.composedPath()) {
|
|
1077
|
-
if (!(t instanceof HTMLElement)) continue;
|
|
1078
|
-
if (t.isContentEditable) return !0;
|
|
1079
|
-
let e = t.tagName;
|
|
1080
|
-
if (e === "INPUT" || e === "TEXTAREA" || e === "SELECT") return !0;
|
|
1081
|
-
}
|
|
1082
|
-
return !1;
|
|
1083
|
-
}
|
|
1084
|
-
function Ti(e, t) {
|
|
1085
|
-
let n = e.metaKey || e.ctrlKey;
|
|
1086
|
-
if (n && e.key.toLowerCase() === "s") e.preventDefault(), t.onSave?.();
|
|
1087
|
-
else if (n && e.key.toLowerCase() === "z") {
|
|
1088
|
-
if (wi(e)) return;
|
|
1089
|
-
e.preventDefault(), e.shiftKey ? t.history.redo() : t.history.undo();
|
|
1090
|
-
} else {
|
|
1091
|
-
if (t.isPicking?.() && !wi(e)) {
|
|
1092
|
-
if (e.key === "Escape") {
|
|
1093
|
-
e.preventDefault(), t.onCancelPick?.();
|
|
1094
|
-
return;
|
|
1095
|
-
}
|
|
1096
|
-
if (e.key === "Enter") {
|
|
1097
|
-
e.preventDefault(), t.onConfirmPick?.();
|
|
1098
|
-
return;
|
|
1099
|
-
}
|
|
1100
|
-
if (e.key === "Delete" || e.key === "Backspace") {
|
|
1101
|
-
e.preventDefault();
|
|
1102
|
-
return;
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
e.key === "Escape" ? t.selectBlock(null) : (e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !wi(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
// src/utils/blockComponentResolver.ts
|
|
1109
|
-
function Ei(e, t) {
|
|
1110
|
-
let n = { fontFamily: t(e.fontFamily) };
|
|
1111
|
-
return e.textColor && (n.color = e.textColor), e.linkColor && (n["--tpl-doc-link-color"] = e.linkColor), e.linkUnderline && (n["--tpl-doc-link-underline"] = "underline"), n;
|
|
1112
|
-
}
|
|
1113
|
-
function Di(e, t, n) {
|
|
1114
|
-
if (t) {
|
|
1115
|
-
let n = t.getComponent(e);
|
|
1116
|
-
if (n) return n;
|
|
1117
|
-
}
|
|
1118
|
-
return n[e.type] ?? null;
|
|
1119
|
-
}
|
|
1120
|
-
var Oi = "--tpl-block-bg-layer", ki = "tpl-has-bg-image";
|
|
1121
|
-
function Ai(e, t) {
|
|
1122
|
-
if (t === null) return {};
|
|
1123
|
-
let n = Pe(e);
|
|
1124
|
-
if (n === null) return {};
|
|
1125
|
-
let r = t?.trim(), i = r ? Ve(r) : n.url;
|
|
1126
|
-
return {
|
|
1127
|
-
backgroundImage: `url("${i}")`,
|
|
1128
|
-
backgroundSize: n.size,
|
|
1129
|
-
backgroundPosition: n.position,
|
|
1130
|
-
backgroundRepeat: n.repeat,
|
|
1131
|
-
[Oi]: `url("${i}") ${n.position} / ${n.size} ${n.repeat}`
|
|
1132
|
-
};
|
|
1133
|
-
}
|
|
1134
|
-
function ji(e) {
|
|
1135
|
-
return e && Oi in e ? ki : void 0;
|
|
1136
|
-
}
|
|
1137
|
-
var Mi = {
|
|
1138
|
-
top: "flex-start",
|
|
1139
|
-
middle: "center",
|
|
1140
|
-
bottom: "flex-end"
|
|
1141
|
-
};
|
|
1142
|
-
function Ni(e, t) {
|
|
1143
|
-
let n = typeof e.height == "number" ? { minHeight: `${e.height}px` } : t !== void 0 && e.aspectRatio !== null ? { minHeight: `${Pi(t, e.aspectRatio)}px` } : { aspectRatio: `1 / ${e.aspectRatio ?? 1}` };
|
|
1144
|
-
return {
|
|
1145
|
-
display: "flex",
|
|
1146
|
-
flexDirection: "column",
|
|
1147
|
-
justifyContent: Mi[e.verticalAlign],
|
|
1148
|
-
boxSizing: "border-box",
|
|
1149
|
-
...n
|
|
1150
|
-
};
|
|
1151
|
-
}
|
|
1152
|
-
function Pi(e, t) {
|
|
1153
|
-
return Math.max(1, Math.round(Math.max(1, Math.round(e)) * t));
|
|
1154
|
-
}
|
|
1155
|
-
function Fi(e, t = {}) {
|
|
1156
|
-
if (e.type === "wrapper") return {};
|
|
1157
|
-
let { padding: n, backgroundColor: r } = e.styles, i = {
|
|
1158
|
-
padding: `${n.top}px ${n.right}px ${n.bottom}px ${n.left}px`,
|
|
1159
|
-
backgroundColor: r || "transparent"
|
|
1160
|
-
};
|
|
1161
|
-
if ((e.type === "paragraph" || e.type === "title") && (i["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ?? Xe.paragraphGap : Xe.paragraphGap}px`), e.type === "section") {
|
|
1162
|
-
let n = de(e.borderRadius);
|
|
1163
|
-
n !== null && (i.borderRadius = n);
|
|
1164
|
-
let r = Ne(e);
|
|
1165
|
-
r?.applied && e.backgroundImage ? (Object.assign(i, Ni(r, t.heroBoxWidth)), Object.assign(i, Ai({
|
|
1166
|
-
...e.backgroundImage,
|
|
1167
|
-
size: "cover",
|
|
1168
|
-
repeat: !1
|
|
1169
|
-
}, t.backgroundImageUrl))) : (Object.assign(i, Li(e.border)), Object.assign(i, Ai(e.backgroundImage, t.backgroundImageUrl)));
|
|
1170
|
-
}
|
|
1171
|
-
return i;
|
|
1172
|
-
}
|
|
1173
|
-
function Ii(e, t, n, r) {
|
|
1174
|
-
return e.type === "section" ? Fi(e, {
|
|
1175
|
-
backgroundImageUrl: rt(t, e.backgroundImage, n),
|
|
1176
|
-
heroBoxWidth: r
|
|
1177
|
-
}) : Fi(e);
|
|
1178
|
-
}
|
|
1179
|
-
function Li(e) {
|
|
1180
|
-
let t = {};
|
|
1181
|
-
for (let [n, r] of Object.entries($e(e))) t[n.replace(/-(\w)/g, (e, t) => t.toUpperCase())] = r;
|
|
1182
|
-
return t;
|
|
1183
|
-
}
|
|
1184
|
-
function Ri(e, t = {}) {
|
|
1185
|
-
if (e.type !== "section" || !e.wrapper) return null;
|
|
1186
|
-
let n = e.wrapper, r = {};
|
|
1187
|
-
n.backgroundColor && (r.backgroundColor = n.backgroundColor), n.padding && (r.padding = `${n.padding.top}px ${n.padding.right}px ${n.padding.bottom}px ${n.padding.left}px`);
|
|
1188
|
-
let i = de(n.borderRadius);
|
|
1189
|
-
return i !== null && (r.borderRadius = i), Object.assign(r, Ai(n.backgroundImage, t.backgroundImageUrl)), r;
|
|
1190
|
-
}
|
|
1191
|
-
function zi(e, t = {}) {
|
|
1192
|
-
if (e.type !== "wrapper") return null;
|
|
1193
|
-
let n = {};
|
|
1194
|
-
if (e.styles.backgroundColor && (n.backgroundColor = e.styles.backgroundColor), e.styles.padding) {
|
|
1195
|
-
let t = e.styles.padding;
|
|
1196
|
-
n.padding = `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;
|
|
1197
|
-
}
|
|
1198
|
-
return e.borderRadius && e.borderRadius > 0 && (n.borderRadius = `${e.borderRadius}px`), Object.assign(n, Ai(e.backgroundImage, t.backgroundImageUrl)), n;
|
|
1199
|
-
}
|
|
1200
|
-
// src/utils/mergeTagLabelSegments.ts
|
|
1201
|
-
function Bi(e, t, n, r = !1) {
|
|
1202
|
-
if (!e) return [];
|
|
1203
|
-
let i = [], a = 0;
|
|
1204
|
-
for (let o of qe(e, n)) {
|
|
1205
|
-
o.index > a && i.push({
|
|
1206
|
-
type: "text",
|
|
1207
|
-
value: e.slice(a, o.index)
|
|
1208
|
-
});
|
|
1209
|
-
let s = o.value;
|
|
1210
|
-
if (ve(s, n)) {
|
|
1211
|
-
let e = r ? Y(s, t) : void 0;
|
|
1212
|
-
i.push(e === void 0 ? {
|
|
1213
|
-
type: "tag",
|
|
1214
|
-
value: J(s, t)
|
|
1215
|
-
} : {
|
|
1216
|
-
type: "text",
|
|
1217
|
-
value: e
|
|
1218
|
-
});
|
|
1219
|
-
} else he(s, n) ? i.push({
|
|
1220
|
-
type: "tag",
|
|
1221
|
-
value: me(s, n)
|
|
1222
|
-
}) : i.push({
|
|
1223
|
-
type: "text",
|
|
1224
|
-
value: s
|
|
1225
|
-
});
|
|
1226
|
-
a = o.index + s.length;
|
|
1227
|
-
}
|
|
1228
|
-
return a < e.length && i.push({
|
|
1229
|
-
type: "text",
|
|
1230
|
-
value: e.slice(a)
|
|
1231
|
-
}), i;
|
|
1232
|
-
}
|
|
1233
|
-
// src/components/MergeTagPreviewText.vue
|
|
1234
|
-
var Vi = n({
|
|
1235
|
-
name: "MergeTagPreviewText",
|
|
1236
|
-
props: { text: {
|
|
1237
|
-
type: String,
|
|
1238
|
-
required: !0
|
|
1239
|
-
} },
|
|
1240
|
-
setup(e) {
|
|
1241
|
-
let t = f(rn, un), n = f(Wt, ne.liquid), i = f(hn, null), a = N(() => Bi(e.text, t.value, n, i?.value ?? !1));
|
|
1242
|
-
return () => a.value.map((e, t) => e.type === "tag" ? r("span", {
|
|
1243
|
-
key: t,
|
|
1244
|
-
class: "tpl-merge-tag-label"
|
|
1245
|
-
}, e.value) : e.value);
|
|
1246
|
-
}
|
|
1247
|
-
}), Hi = ["href"], Ui = /* @__PURE__ */ n({
|
|
1248
|
-
__name: "ButtonBlock",
|
|
1249
|
-
props: {
|
|
1250
|
-
block: {},
|
|
1251
|
-
viewport: {}
|
|
1252
|
-
},
|
|
1253
|
-
setup(e) {
|
|
1254
|
-
let t = e, n = kn(gn, "ButtonBlock");
|
|
1255
|
-
function r(e) {
|
|
1256
|
-
return e === "regular" ? "400" : e === "medium" ? "500" : e === "bold" ? "700" : "bold";
|
|
1257
|
-
}
|
|
1258
|
-
let a = N(() => {
|
|
1259
|
-
let e = {
|
|
1260
|
-
display: "inline-block",
|
|
1261
|
-
padding: `${t.block.buttonPadding.top}px ${t.block.buttonPadding.right}px ${t.block.buttonPadding.bottom}px ${t.block.buttonPadding.left}px`,
|
|
1262
|
-
backgroundColor: t.block.backgroundColor,
|
|
1263
|
-
color: t.block.textColor,
|
|
1264
|
-
fontSize: `${t.block.fontSize}px`,
|
|
1265
|
-
fontWeight: r(t.block.fontWeight),
|
|
1266
|
-
textDecoration: "none",
|
|
1267
|
-
borderRadius: typeof t.block.borderRadius == "number" ? `${t.block.borderRadius}px` : de(t.block.borderRadius) ?? "0px",
|
|
1268
|
-
textAlign: "center"
|
|
1269
|
-
};
|
|
1270
|
-
return Object.assign(e, Li(t.block.border)), t.block.fontFamily && (e.fontFamily = n.resolveFontFamily(t.block.fontFamily)), t.block.width === "full" ? (e.display = "block", e.width = "100%", e.boxSizing = "border-box") : typeof t.block.width == "number" && (e.width = `${t.block.width}px`, e.boxSizing = "border-box"), e;
|
|
1271
|
-
}), o = N(() => ({ textAlign: t.block.align ?? "center" }));
|
|
1272
|
-
return (t, n) => (i(), b("div", { style: P(o.value) }, [A("a", {
|
|
1273
|
-
href: e.block.url || "#",
|
|
1274
|
-
style: P(a.value),
|
|
1275
|
-
class: "tpl:cursor-default",
|
|
1276
|
-
onClick: n[0] ||= k(() => {}, ["prevent"])
|
|
1277
|
-
}, [V(Vi, { text: e.block.text }, null, 8, ["text"])], 12, Hi)], 4));
|
|
1278
|
-
}
|
|
1279
|
-
}), Wi = ["innerHTML"], Gi = [
|
|
1280
|
-
"src",
|
|
1281
|
-
"width",
|
|
1282
|
-
"height"
|
|
1283
|
-
], Ki = /* @__PURE__ */ n({
|
|
1284
|
-
__name: "CustomBlockIcon",
|
|
1285
|
-
props: {
|
|
1286
|
-
icon: {},
|
|
1287
|
-
size: {}
|
|
1288
|
-
},
|
|
1289
|
-
setup(e) {
|
|
1290
|
-
let t = e, n = N(() => t.size ?? 20), r = N(() => t.icon && (t.icon.trimStart().startsWith("<svg") || t.icon.trimStart().startsWith("<SVG"))), a = N(() => t.icon && !r.value && (t.icon.startsWith("http") || t.icon.startsWith("/"))), o = N(() => r.value ? pr(t.icon ?? "") : "");
|
|
1291
|
-
return (t, s) => r.value ? (i(), b("span", {
|
|
1292
|
-
key: 0,
|
|
1293
|
-
class: "tpl:inline-flex tpl:items-center tpl:justify-center",
|
|
1294
|
-
style: P({
|
|
1295
|
-
width: `${n.value}px`,
|
|
1296
|
-
height: `${n.value}px`
|
|
1297
|
-
}),
|
|
1298
|
-
innerHTML: o.value
|
|
1299
|
-
}, null, 12, Wi)) : a.value ? (i(), b("img", {
|
|
1300
|
-
key: 1,
|
|
1301
|
-
src: e.icon,
|
|
1302
|
-
width: n.value,
|
|
1303
|
-
height: n.value,
|
|
1304
|
-
class: "tpl:inline-block",
|
|
1305
|
-
alt: ""
|
|
1306
|
-
}, null, 8, Gi)) : (i(), D(C(kt), {
|
|
1307
|
-
key: 2,
|
|
1308
|
-
size: n.value,
|
|
1309
|
-
"stroke-width": 1.5
|
|
1310
|
-
}, null, 8, ["size"]));
|
|
1311
|
-
}
|
|
1312
|
-
}), qi = { class: "tpl:w-full" }, Ji = {
|
|
1313
|
-
key: 0,
|
|
1314
|
-
class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-warning)] tpl:bg-[var(--tpl-warning-light)]"
|
|
1315
|
-
}, Yi = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Xi = {
|
|
1316
|
-
key: 1,
|
|
1317
|
-
class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-danger)] tpl:bg-[var(--tpl-danger-light)]"
|
|
1318
|
-
}, Zi = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Qi = {
|
|
1319
|
-
key: 2,
|
|
1320
|
-
class: "tpl:relative"
|
|
1321
|
-
}, $i = ["innerHTML"], ea = {
|
|
1322
|
-
key: 0,
|
|
1323
|
-
class: "tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:rounded tpl:backdrop-blur-[2px]",
|
|
1324
|
-
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
|
|
1325
|
-
}, ta = /* @__PURE__ */ n({
|
|
1326
|
-
__name: "CustomBlock",
|
|
1327
|
-
props: {
|
|
1328
|
-
block: {},
|
|
1329
|
-
viewport: {}
|
|
1330
|
-
},
|
|
1331
|
-
emits: ["fetchData"],
|
|
1332
|
-
setup(e, { emit: t }) {
|
|
1333
|
-
let n = e, r = t, { t: a } = Q(), s = f(En, null), c = z(""), l = N(() => mr(c.value)), u = z(!1), p = N(() => s?.getDefinition(n.block.customType)), m = N(() => !!p.value), h = N(() => n.block), { isFetching: g, fetch: _, needsFetch: v, hasDataSource: y } = it({
|
|
1334
|
-
definition: p,
|
|
1335
|
-
block: h,
|
|
1336
|
-
onUpdate: (e, t) => {
|
|
1337
|
-
r("fetchData", {
|
|
1338
|
-
fieldValues: e,
|
|
1339
|
-
dataSourceFetched: t
|
|
1340
|
-
});
|
|
1341
|
-
}
|
|
1342
|
-
}), S = f(rn, un), w = f(hn, null), T = N(() => {
|
|
1343
|
-
if (!w?.value) return n.block;
|
|
1344
|
-
let e = {};
|
|
1345
|
-
for (let [t, r] of Object.entries(n.block.fieldValues)) e[t] = typeof r == "string" ? je(r, S.value) : r;
|
|
1346
|
-
return {
|
|
1347
|
-
...n.block,
|
|
1348
|
-
fieldValues: e
|
|
1349
|
-
};
|
|
1350
|
-
});
|
|
1351
|
-
async function O() {
|
|
1352
|
-
if (s) {
|
|
1353
|
-
u.value = !1;
|
|
1354
|
-
try {
|
|
1355
|
-
let e = await s.renderCustomBlock(T.value);
|
|
1356
|
-
e.includes("Template render error:") && (u.value = !0), c.value = e;
|
|
1357
|
-
} catch {
|
|
1358
|
-
u.value = !0, c.value = "";
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
let M = Yn(O, 150);
|
|
1363
|
-
return d(() => {
|
|
1364
|
-
O();
|
|
1365
|
-
}), o(() => n.block.fieldValues, () => {
|
|
1366
|
-
M();
|
|
1367
|
-
}, { deep: !0 }), o(() => w?.value, () => {
|
|
1368
|
-
M();
|
|
1369
|
-
}), (e, t) => (i(), b("div", qi, [m.value ? u.value ? (i(), b("div", Xi, [V(C(Pt), {
|
|
1370
|
-
size: 24,
|
|
1371
|
-
class: "tpl:text-[var(--tpl-danger)]"
|
|
1372
|
-
}), A("span", Zi, j(C(a).customBlocks.renderError), 1)])) : (i(), b("div", Qi, [A("div", { innerHTML: l.value }, null, 8, $i), C(y) && C(v) ? (i(), b("div", ea, [C(g) ? (i(), D(hr, {
|
|
1373
|
-
key: 1,
|
|
1374
|
-
class: "tpl:w-48"
|
|
1375
|
-
})) : (i(), b("button", {
|
|
1376
|
-
key: 0,
|
|
1377
|
-
type: "button",
|
|
1378
|
-
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:shadow-[var(--tpl-shadow)] tpl:transition-all tpl:hover:border-[var(--tpl-primary)] tpl:hover:shadow-[var(--tpl-shadow-md)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
|
|
1379
|
-
onClick: t[0] ||= k((...e) => C(_) && C(_)(...e), ["stop"])
|
|
1380
|
-
}, [p.value?.icon ? (i(), D(Ki, {
|
|
1381
|
-
key: 0,
|
|
1382
|
-
icon: p.value.icon,
|
|
1383
|
-
size: 16
|
|
1384
|
-
}, null, 8, ["icon"])) : E("", !0), x(" " + j(p.value?.dataSource?.label || C(a).customBlocks.dataSource.fetchButton), 1)]))])) : E("", !0)])) : (i(), b("div", Ji, [V(C(At), {
|
|
1385
|
-
size: 24,
|
|
1386
|
-
class: "tpl:text-[var(--tpl-warning)]"
|
|
1387
|
-
}), A("span", Yi, j(C(a).customBlocks.definitionNotFound), 1)]))]));
|
|
1388
|
-
}
|
|
1389
|
-
}), na = { class: "tpl:w-full" }, ra = /* @__PURE__ */ n({
|
|
1390
|
-
__name: "DividerBlock",
|
|
1391
|
-
props: {
|
|
1392
|
-
block: {},
|
|
1393
|
-
viewport: {}
|
|
1394
|
-
},
|
|
1395
|
-
setup(e) {
|
|
1396
|
-
let t = e, n = N(() => ({
|
|
1397
|
-
borderTop: `${t.block.thickness}px ${t.block.lineStyle} ${t.block.color}`,
|
|
1398
|
-
width: t.block.width === "full" ? "100%" : typeof t.block.width == "number" ? `${t.block.width}px` : t.block.width,
|
|
1399
|
-
margin: t.block.width === "full" ? "0" : "0 auto"
|
|
1400
|
-
}));
|
|
1401
|
-
return (e, t) => (i(), b("div", na, [A("hr", {
|
|
1402
|
-
class: "tpl:m-0 tpl:border-none",
|
|
1403
|
-
style: P(n.value)
|
|
1404
|
-
}, null, 4)]));
|
|
1405
|
-
}
|
|
1406
|
-
}), ia = { class: "tpl:w-full" }, aa = ["srcdoc", "title"], oa = {
|
|
1407
|
-
key: 1,
|
|
1408
|
-
class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]"
|
|
1409
|
-
}, sa = {
|
|
1410
|
-
key: 0,
|
|
1411
|
-
class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
|
|
1412
|
-
}, ca = {
|
|
1413
|
-
key: 1,
|
|
1414
|
-
class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
1415
|
-
}, la = /* @__PURE__ */ n({
|
|
1416
|
-
__name: "HtmlBlock",
|
|
1417
|
-
props: {
|
|
1418
|
-
block: {},
|
|
1419
|
-
viewport: {}
|
|
1420
|
-
},
|
|
1421
|
-
setup(e) {
|
|
1422
|
-
let t = e, { t: n } = Q(), r = f(sn, !1), a = N(() => t.block.content.trim().length > 0), s = N(() => r && a.value), c = f(rn, un), l = f(hn, null), d = N(() => l?.value ? je(t.block.content, c.value) : t.block.content), p = z(null), m = z(60), h = null;
|
|
1423
|
-
function g() {
|
|
1424
|
-
let e = p.value?.contentDocument;
|
|
1425
|
-
e && (m.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
|
|
1426
|
-
}
|
|
1427
|
-
function _() {
|
|
1428
|
-
h?.disconnect(), h = null, g();
|
|
1429
|
-
let e = p.value?.contentDocument?.documentElement;
|
|
1430
|
-
e && typeof ResizeObserver < "u" && (h = new ResizeObserver(() => g()), h.observe(e));
|
|
1431
|
-
}
|
|
1432
|
-
return o(s, (e) => {
|
|
1433
|
-
e || (h?.disconnect(), h = null);
|
|
1434
|
-
}), u(() => {
|
|
1435
|
-
h?.disconnect(), h = null;
|
|
1436
|
-
}), (e, t) => (i(), b("div", ia, [s.value ? (i(), b("iframe", {
|
|
1437
|
-
key: 0,
|
|
1438
|
-
ref_key: "iframeRef",
|
|
1439
|
-
ref: p,
|
|
1440
|
-
srcdoc: d.value,
|
|
1441
|
-
sandbox: "allow-same-origin",
|
|
1442
|
-
title: C(n).html.preview,
|
|
1443
|
-
class: "tpl:block tpl:w-full tpl:border-0",
|
|
1444
|
-
style: P({ height: `${m.value}px` }),
|
|
1445
|
-
onLoad: _
|
|
1446
|
-
}, null, 44, aa)) : (i(), b("div", oa, [V(C(Tt), {
|
|
1447
|
-
size: 24,
|
|
1448
|
-
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
1449
|
-
}), a.value ? (i(), b("span", sa, j(C(n).html.preview), 1)) : (i(), b("span", ca, j(C(n).html.empty), 1))]))]));
|
|
1450
|
-
}
|
|
1451
|
-
}), ua = ["data-drop-enabled"], da = ["href"], fa = ["src", "alt"], pa = ["src", "alt"], ma = {
|
|
1452
|
-
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
1453
|
-
style: { opacity: "0.7" }
|
|
1454
|
-
}, ha = ["href"], ga = ["src", "alt"], _a = ["src", "alt"], va = {
|
|
1455
|
-
key: 4,
|
|
1456
|
-
class: "tpl:flex tpl:box-border tpl:min-h-[100px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
|
|
1457
|
-
}, ya = ["aria-label"], ba = { key: 1 }, xa = /* @__PURE__ */ n({
|
|
1458
|
-
__name: "ImageBlock",
|
|
1459
|
-
props: {
|
|
1460
|
-
block: {},
|
|
1461
|
-
viewport: {}
|
|
1462
|
-
},
|
|
1463
|
-
emits: ["update"],
|
|
1464
|
-
setup(e, { emit: t }) {
|
|
1465
|
-
let n = e, r = t, { t: a } = Q(), { syntax: o } = rr(), s = N(() => pe(n.block.src, o));
|
|
1466
|
-
function c(e) {
|
|
1467
|
-
let t = {
|
|
1468
|
-
src: e.url,
|
|
1469
|
-
...ft(lt(e.width, e.height))
|
|
1470
|
-
};
|
|
1471
|
-
e.alt && (t.alt = e.alt), r("update", t);
|
|
1472
|
-
}
|
|
1473
|
-
let l = z(), { canBrowse: u, dropEnabled: d, isUploading: f, showOverlay: p, openMediaBrowser: m } = gt({
|
|
1474
|
-
target: l,
|
|
1475
|
-
blocked: s,
|
|
1476
|
-
apply: c
|
|
1477
|
-
}), h = N(() => ({ textAlign: n.block.align })), g = N(() => {
|
|
1478
|
-
let e = n.block.border, t = ["left", "right"].map((t) => Te(e?.[t]) === null ? 0 : e[t].width).reduce((e, t) => e + t, 0);
|
|
1479
|
-
return t > 0 ? `calc(100% - ${t}px)` : "100%";
|
|
1480
|
-
}), _ = N(() => {
|
|
1481
|
-
let e = n.block.align;
|
|
1482
|
-
return {
|
|
1483
|
-
maxWidth: "100%",
|
|
1484
|
-
width: n.block.width === "full" ? g.value : `${n.block.width}px`,
|
|
1485
|
-
height: n.block.height ? `${n.block.height}px` : void 0,
|
|
1486
|
-
borderRadius: de(n.block.borderRadius) ?? void 0,
|
|
1487
|
-
...Li(n.block.border),
|
|
1488
|
-
display: "block",
|
|
1489
|
-
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
1490
|
-
marginRight: e === "center" ? "auto" : void 0
|
|
1491
|
-
};
|
|
1492
|
-
}), v = ct(() => s.value ? void 0 : n.block.src), y = ct(() => s.value ? n.block.placeholderUrl : void 0);
|
|
1493
|
-
return (t, n) => (i(), b("div", {
|
|
1494
|
-
ref_key: "dropZoneRef",
|
|
1495
|
-
ref: l,
|
|
1496
|
-
"data-testid": "image-drop-zone",
|
|
1497
|
-
"data-drop-enabled": C(d),
|
|
1498
|
-
class: "tpl:relative tpl:w-full",
|
|
1499
|
-
style: P(h.value)
|
|
1500
|
-
}, [C(p) ? (i(), D(dt, {
|
|
1501
|
-
key: 0,
|
|
1502
|
-
uploading: C(f),
|
|
1503
|
-
size: "canvas"
|
|
1504
|
-
}, null, 8, ["uploading"])) : E("", !0), e.block.src && s.value && e.block.placeholderUrl ? (i(), b(B, { key: 1 }, [e.block.linkUrl ? (i(), b("a", {
|
|
1505
|
-
key: 0,
|
|
1506
|
-
href: e.block.linkUrl,
|
|
1507
|
-
target: "_blank",
|
|
1508
|
-
rel: "noopener noreferrer",
|
|
1509
|
-
onClick: n[0] ||= k(() => {}, ["prevent"])
|
|
1510
|
-
}, [A("img", {
|
|
1511
|
-
class: "tpl:border-0",
|
|
1512
|
-
loading: "lazy",
|
|
1513
|
-
src: C(y),
|
|
1514
|
-
alt: e.block.alt || C(a).image.altTextPlaceholder,
|
|
1515
|
-
style: P(_.value)
|
|
1516
|
-
}, null, 12, fa)], 8, da)) : (i(), b("img", {
|
|
1517
|
-
key: 1,
|
|
1518
|
-
class: "tpl:border-0",
|
|
1519
|
-
src: C(y),
|
|
1520
|
-
alt: e.block.alt,
|
|
1521
|
-
style: P(_.value)
|
|
1522
|
-
}, null, 12, pa))], 64)) : e.block.src && s.value ? (i(), b("div", {
|
|
1523
|
-
key: 2,
|
|
1524
|
-
class: "tpl:!flex tpl:box-border tpl:min-h-[120px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
|
|
1525
|
-
style: P([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, _.value])
|
|
1526
|
-
}, [V(C(Nt), {
|
|
1527
|
-
size: 32,
|
|
1528
|
-
"stroke-width": 1.5,
|
|
1529
|
-
class: "tpl:text-[var(--tpl-primary)]",
|
|
1530
|
-
style: { opacity: "0.5" }
|
|
1531
|
-
}), A("span", ma, [V(Vi, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (i(), b(B, { key: 3 }, [e.block.linkUrl ? (i(), b("a", {
|
|
1532
|
-
key: 0,
|
|
1533
|
-
href: e.block.linkUrl,
|
|
1534
|
-
target: "_blank",
|
|
1535
|
-
rel: "noopener noreferrer",
|
|
1536
|
-
onClick: n[1] ||= k(() => {}, ["prevent"])
|
|
1537
|
-
}, [A("img", {
|
|
1538
|
-
class: "tpl:border-0",
|
|
1539
|
-
loading: "lazy",
|
|
1540
|
-
src: C(v),
|
|
1541
|
-
alt: e.block.alt || C(a).image.altTextPlaceholder,
|
|
1542
|
-
style: P(_.value)
|
|
1543
|
-
}, null, 12, ga)], 8, ha)) : (i(), b("img", {
|
|
1544
|
-
key: 1,
|
|
1545
|
-
class: "tpl:border-0",
|
|
1546
|
-
src: C(v),
|
|
1547
|
-
alt: e.block.alt,
|
|
1548
|
-
style: P(_.value)
|
|
1549
|
-
}, null, 12, _a))], 64)) : (i(), b("div", va, [C(u) ? (i(), b("button", {
|
|
1550
|
-
key: 0,
|
|
1551
|
-
"aria-label": C(a).image.browseMedia,
|
|
1552
|
-
class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:cursor-pointer tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
|
|
1553
|
-
onClick: n[2] ||= k((...e) => C(m) && C(m)(...e), ["stop"])
|
|
1554
|
-
}, [V(C(Nt), {
|
|
1555
|
-
size: 14,
|
|
1556
|
-
"stroke-width": 1.5
|
|
1557
|
-
}), x(" " + j(C(a).image.browseMedia), 1)], 8, ya)) : (i(), b("span", ba, j(C(a).image.clickToAdd), 1))]))], 12, ua));
|
|
1558
|
-
}
|
|
1559
|
-
}), Sa = { class: "tpl:w-full" }, Ca = ["href"], wa = {
|
|
1560
|
-
key: 1,
|
|
1561
|
-
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
|
|
1562
|
-
}, Ta = /* @__PURE__ */ n({
|
|
1563
|
-
__name: "MenuBlock",
|
|
1564
|
-
props: {
|
|
1565
|
-
block: {},
|
|
1566
|
-
viewport: {}
|
|
1567
|
-
},
|
|
1568
|
-
setup(e) {
|
|
1569
|
-
let t = e, { t: n } = Q(), r = kn(gn, "MenuBlock"), a = N(() => ({
|
|
1570
|
-
display: "flex",
|
|
1571
|
-
flexWrap: "wrap",
|
|
1572
|
-
gap: `0 ${t.block.spacing}px`,
|
|
1573
|
-
justifyContent: t.block.textAlign === "left" ? "flex-start" : t.block.textAlign === "right" ? "flex-end" : "center",
|
|
1574
|
-
fontSize: `${t.block.fontSize}px`,
|
|
1575
|
-
fontFamily: t.block.fontFamily ? r.resolveFontFamily(t.block.fontFamily) : "inherit",
|
|
1576
|
-
alignItems: "center"
|
|
1577
|
-
})), o = N(() => t.block.items.length > 0);
|
|
1578
|
-
function s(e) {
|
|
1579
|
-
return e || t.block.linkColor || t.block.color;
|
|
1580
|
-
}
|
|
1581
|
-
return (t, r) => (i(), b("div", Sa, [o.value ? (i(), b("div", {
|
|
1582
|
-
key: 0,
|
|
1583
|
-
style: P(a.value)
|
|
1584
|
-
}, [(i(!0), b(B, null, l(e.block.items, (t, n) => (i(), b(B, { key: t.id }, [A("a", {
|
|
1585
|
-
href: t.url || "#",
|
|
1586
|
-
class: "tpl:cursor-default tpl:no-underline",
|
|
1587
|
-
style: P({
|
|
1588
|
-
color: s(t.color),
|
|
1589
|
-
fontWeight: t.bold ? "bold" : "normal",
|
|
1590
|
-
textDecoration: t.underline ? "underline" : "none"
|
|
1591
|
-
}),
|
|
1592
|
-
onClick: r[0] ||= k(() => {}, ["prevent"])
|
|
1593
|
-
}, [V(Vi, { text: t.text || "..." }, null, 8, ["text"])], 12, Ca), n < e.block.items.length - 1 ? (i(), b("span", {
|
|
1594
|
-
key: 0,
|
|
1595
|
-
style: P({
|
|
1596
|
-
color: e.block.separatorColor,
|
|
1597
|
-
padding: `0 ${e.block.spacing}px`
|
|
1598
|
-
})
|
|
1599
|
-
}, j(e.block.separator), 5)) : E("", !0)], 64))), 128))], 4)) : (i(), b("div", wa, [V(C(Mt), { size: 16 }), A("span", null, j(C(n).menu.addLinks), 1)]))]));
|
|
1600
|
-
}
|
|
1601
|
-
});
|
|
1602
|
-
// src/composables/useEditableTextBlock.ts
|
|
1603
|
-
function Ea(e) {
|
|
1604
|
-
let t = f(rn, un), n = f(hn, null), { syntax: r } = rr(), i = N(() => n?.value ? Ue(e(), t.value) : H(e(), t.value)), a = N(() => Se(mr(Z(i.value, r)))), o = z(!1), s = z(null), { top: c, left: l } = er(s), { toLocal: u } = lr(), d = N(() => u({
|
|
1605
|
-
top: c.value - 8,
|
|
1606
|
-
left: l.value
|
|
1607
|
-
}));
|
|
1608
|
-
function p() {
|
|
1609
|
-
o.value = !0;
|
|
1610
|
-
}
|
|
1611
|
-
function m() {
|
|
1612
|
-
o.value = !1;
|
|
1613
|
-
}
|
|
1614
|
-
return {
|
|
1615
|
-
isEditing: o,
|
|
1616
|
-
blockRef: s,
|
|
1617
|
-
toolbarPosition: d,
|
|
1618
|
-
resolvedContent: a,
|
|
1619
|
-
handleDoubleClick: p,
|
|
1620
|
-
handleEditorDone: m
|
|
1621
|
-
};
|
|
1622
|
-
}
|
|
1623
|
-
// src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1624
|
-
var Da = ["innerHTML"], Oa = /* @__PURE__ */ n({
|
|
1625
|
-
__name: "ParagraphBlock",
|
|
1626
|
-
props: {
|
|
1627
|
-
block: {},
|
|
1628
|
-
viewport: {}
|
|
1629
|
-
},
|
|
1630
|
-
setup(e) {
|
|
1631
|
-
let t = e, n = g(() => import("./ParagraphEditor-Cal9hY3U.js").then((e) => e.t)), { isEditing: r, blockRef: a, toolbarPosition: o, resolvedContent: s, handleDoubleClick: c, handleEditorDone: l } = Ea(() => t.block.content);
|
|
1632
|
-
return (t, u) => (i(), b("div", {
|
|
1633
|
-
ref_key: "blockRef",
|
|
1634
|
-
ref: a,
|
|
1635
|
-
class: "tpl:min-h-[1em] tpl:w-full",
|
|
1636
|
-
onDblclick: u[0] ||= (...e) => C(c) && C(c)(...e)
|
|
1637
|
-
}, [C(r) ? (i(), D(C(n), {
|
|
1638
|
-
key: 0,
|
|
1639
|
-
block: e.block,
|
|
1640
|
-
"toolbar-position": C(o),
|
|
1641
|
-
onDone: C(l)
|
|
1642
|
-
}, null, 8, [
|
|
1643
|
-
"block",
|
|
1644
|
-
"toolbar-position",
|
|
1645
|
-
"onDone"
|
|
1646
|
-
])) : (i(), b("div", {
|
|
1647
|
-
key: 1,
|
|
1648
|
-
class: "tpl-text-content tpl:outline-none",
|
|
1649
|
-
innerHTML: C(s)
|
|
1650
|
-
}, null, 8, Da))], 544));
|
|
1651
|
-
}
|
|
1652
|
-
});
|
|
1653
|
-
// src/utils/updateBlockList.ts
|
|
1654
|
-
function ka(e, t, n, r = 0, i) {
|
|
1655
|
-
let a = n ? e.content.value.blocks.find((e) => e.id === n) : void 0, o = n ? a?.type === "section" ? a.children[r] ?? [] : [] : e.content.value.blocks, s = t.map((e) => e.id);
|
|
1656
|
-
if (o.some((e) => !s.includes(e.id))) return;
|
|
1657
|
-
let c = t.filter((e) => !o.some((t) => t.id === e.id)), l, u = -1;
|
|
1658
|
-
if (c.length === 1) l = c[0], u = s.indexOf(l.id);
|
|
1659
|
-
else if (c.length === 0 && i) {
|
|
1660
|
-
let e = i.oldDraggableIndex ?? i.oldIndex, t = i.newDraggableIndex ?? i.newIndex;
|
|
1661
|
-
if (t === void 0 || !Number.isInteger(t) || t < 0 || t >= o.length || (l = i.data?.id ? o.find((e) => e.id === i.data.id) : e === void 0 ? void 0 : o[e], !l || o.indexOf(l) === t)) return;
|
|
1662
|
-
u = t;
|
|
1663
|
-
}
|
|
1664
|
-
l && (e.findBlockLocation(l.id) ? e.moveBlock(l.id, u, n, r) : e.addBlock(JSON.parse(JSON.stringify(l)), n, r, u));
|
|
1665
|
-
}
|
|
1666
|
-
// src/utils/mergeTagTokens.ts
|
|
1667
|
-
function Aa(e, t, n) {
|
|
1668
|
-
let r = [], i = "\0MT";
|
|
1669
|
-
for (; e.includes(i);) i += "_";
|
|
1670
|
-
let a = n === "html" ? ze(e, (e) => {
|
|
1671
|
-
let t = r.push(e) - 1;
|
|
1672
|
-
return `${i}${t}\u0000`;
|
|
1673
|
-
}) : e, o = Array.from(a.matchAll(RegExp(`${i}\\d+\u0000`, "g")), (e) => ({
|
|
1674
|
-
start: e.index,
|
|
1675
|
-
end: e.index + e[0].length
|
|
1676
|
-
})), s = [], c = Le(a, t, "logic"), l = [], u = 0;
|
|
1677
|
-
for (let e of ["logic", "value"]) {
|
|
1678
|
-
let r = 0;
|
|
1679
|
-
for (let i of e === "logic" ? c : Le(a, t, "value")) {
|
|
1680
|
-
let t = i.index, a = t + i.value.length;
|
|
1681
|
-
for (; o[r]?.end <= t;) r++;
|
|
1682
|
-
let c = o[r];
|
|
1683
|
-
if (!(c && t < c.end && a > c.start)) {
|
|
1684
|
-
if (e === "value") {
|
|
1685
|
-
for (; l[u]?.end <= t;) u++;
|
|
1686
|
-
let e = l[u];
|
|
1687
|
-
if (e && t < e.end && a > e.start) continue;
|
|
1688
|
-
}
|
|
1689
|
-
e === "logic" && l.push({
|
|
1690
|
-
start: t,
|
|
1691
|
-
end: a
|
|
1692
|
-
}), s.push({
|
|
1693
|
-
start: t,
|
|
1694
|
-
end: a,
|
|
1695
|
-
value: n === "html" ? Ge(i.value) : i.value
|
|
1696
|
-
});
|
|
1697
|
-
}
|
|
1698
|
-
}
|
|
1699
|
-
}
|
|
1700
|
-
return [...r, ...s.map((e) => e.value)].sort();
|
|
1701
|
-
}
|
|
1702
|
-
function ja(e, t, n, r) {
|
|
1703
|
-
return JSON.stringify(Aa(e, n, r)) !== JSON.stringify(Aa(t, n, r));
|
|
1704
|
-
}
|
|
1705
|
-
// src/components/localization/LocaleStatusChip.vue?vue&type=script&setup=true&lang.ts
|
|
1706
|
-
var Ma = [
|
|
1707
|
-
"data-state",
|
|
1708
|
-
"aria-label",
|
|
1709
|
-
"title",
|
|
1710
|
-
"aria-expanded",
|
|
1711
|
-
"aria-controls",
|
|
1712
|
-
"onKeydown"
|
|
1713
|
-
], Na = [
|
|
1714
|
-
"aria-label",
|
|
1715
|
-
"aria-labelledby",
|
|
1716
|
-
"aria-describedby",
|
|
1717
|
-
"onKeydown"
|
|
1718
|
-
], Pa = ["id"], Fa = ["id"], Ia = { class: "tpl:mt-2 tpl:flex tpl:flex-wrap tpl:justify-end tpl:gap-2" }, La = ["disabled"], Ra = {
|
|
1719
|
-
key: 0,
|
|
1720
|
-
class: "tpl:m-0 tpl:mb-2 tpl:text-xs tpl:font-medium"
|
|
1721
|
-
}, za = {
|
|
1722
|
-
key: 1,
|
|
1723
|
-
class: "tpl:m-0"
|
|
1724
|
-
}, Ba = { class: "tpl:m-0" }, Va = { class: "tpl:mt-2 tpl:mb-0 tpl:break-words tpl:text-[var(--tpl-chrome-text-muted)]" }, Ha = {
|
|
1725
|
-
key: 3,
|
|
1726
|
-
class: "tpl:m-0"
|
|
1727
|
-
}, Ua = {
|
|
1728
|
-
key: 4,
|
|
1729
|
-
class: "tpl:m-0"
|
|
1730
|
-
}, Wa = {
|
|
1731
|
-
key: 5,
|
|
1732
|
-
class: "tpl:m-0"
|
|
1733
|
-
}, Ga = {
|
|
1734
|
-
key: 6,
|
|
1735
|
-
class: "tpl:m-0 tpl:list-none tpl:p-0"
|
|
1736
|
-
}, Ka = ["onClick"], qa = {
|
|
1737
|
-
key: 7,
|
|
1738
|
-
class: "tpl:mt-2 tpl:flex tpl:flex-wrap tpl:gap-1"
|
|
1739
|
-
}, Ja = ["data-testid", "disabled"], Ya = /*#__PURE__*/ St(/* @__PURE__ */ n({
|
|
1740
|
-
__name: "LocaleStatusChip",
|
|
1741
|
-
props: {
|
|
1742
|
-
blockId: {},
|
|
1743
|
-
state: {},
|
|
1744
|
-
count: {},
|
|
1745
|
-
popoverState: {},
|
|
1746
|
-
popoverCount: {},
|
|
1747
|
-
stale: {},
|
|
1748
|
-
tagsDiffer: {},
|
|
1749
|
-
setPaths: {},
|
|
1750
|
-
staleLocales: {},
|
|
1751
|
-
excerpt: {},
|
|
1752
|
-
eligibleGaps: { type: Boolean },
|
|
1753
|
-
translationCount: {},
|
|
1754
|
-
replacesCurrent: { type: Boolean },
|
|
1755
|
-
editable: { type: Boolean }
|
|
1756
|
-
},
|
|
1757
|
-
emits: ["target"],
|
|
1758
|
-
setup(e, { emit: n }) {
|
|
1759
|
-
let r = e, a = n, s = f(Ln, null), c = f(On, null), u = f(Kt, null), d = f(Nn, "en") ?? "en", { t: m, format: h } = Q(), g = nr(), _ = sr(), { toLocal: v } = lr(), y = z(null), x = z(null), M = z(!1), F = z(!1), I = z(null), L = z(null), R = null, V = z({
|
|
1760
|
-
top: 0,
|
|
1761
|
-
left: 0
|
|
1762
|
-
}), H = z({
|
|
1763
|
-
maxHeight: 0,
|
|
1764
|
-
maxWidth: 0
|
|
1765
|
-
}), U = `tpl-locale-popover-${re()}`, W = N(() => Wn(s?.activeLocale?.value ?? "")), G = N(() => Wn(s?.content.value.settings.locale ?? "en"));
|
|
1766
|
-
function ee(e, t) {
|
|
1767
|
-
switch (e) {
|
|
1768
|
-
case "tags-differ": return m.localization.tagsDiffer;
|
|
1769
|
-
case "hidden": return h(m.localization.hidden, { language: W.value });
|
|
1770
|
-
case "changed": return h(m.localization.changed, { language: W.value });
|
|
1771
|
-
case "default-stale": return Un(m.localization.staleLanguages, t, d);
|
|
1772
|
-
case "missing": return t === 1 ? m.localization.notTranslated : Un(m.localization.notTranslatedCount, t, d);
|
|
1773
|
-
default: return t === 1 ? m.localization.outOfDate : Un(m.localization.staleCount, t, d);
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
let K = N(() => ee(r.state, r.count)), q = N(() => r.popoverState ?? r.state), J = N(() => r.popoverCount ?? r.count), te = N(() => ee(q.value, J.value)), ne = N(() => r.state === "hidden" ? Dt : r.state === "changed" ? wt : r.state === "default-stale" ? Lt : r.state === "stale" ? Et : Pt), ie = N(() => q.value === "default-stale" || (q.value === "missing" || q.value === "stale") && J.value > 1), Y = N(() => r.editable && r.eligibleGaps && c?.isAvailable.value);
|
|
1777
|
-
function X(e = !1) {
|
|
1778
|
-
M.value = !1, F.value = !1, R = null, e && y.value?.focus({ preventScroll: !0 });
|
|
1779
|
-
}
|
|
1780
|
-
async function ae() {
|
|
1781
|
-
if (M.value) return X();
|
|
1782
|
-
_.value && (M.value = !0, await oe());
|
|
1783
|
-
}
|
|
1784
|
-
async function oe() {
|
|
1785
|
-
let e = _.value;
|
|
1786
|
-
if (!e || !M.value) return;
|
|
1787
|
-
let t = e.ownerDocument.defaultView, n = t?.visualViewport, r = n?.offsetTop ?? 0, i = n?.offsetLeft ?? 0, a = r + (n?.height ?? t?.innerHeight ?? 0), o = i + (n?.width ?? t?.innerWidth ?? 0), s = e.parentElement?.getBoundingClientRect(), c = Math.max(r, s?.height ? s.top : r) + 8, l = Math.max(i, s?.width ? s.left : i) + 8, u = Math.max(c, Math.min(a, s?.height ? s.bottom : a) - 8), d = Math.max(l, Math.min(o, s?.width ? s.right : o) - 8);
|
|
1788
|
-
H.value = {
|
|
1789
|
-
maxHeight: u - c,
|
|
1790
|
-
maxWidth: d - l
|
|
1791
|
-
};
|
|
1792
|
-
let f = y.value.getBoundingClientRect();
|
|
1793
|
-
if (R = f, V.value = v({
|
|
1794
|
-
top: c,
|
|
1795
|
-
left: l
|
|
1796
|
-
}), await O(), !M.value || !x.value) return;
|
|
1797
|
-
let p = x.value.getBoundingClientRect(), m = Math.min(p.height, H.value.maxHeight), h = Math.min(p.width, H.value.maxWidth), g = f.bottom + 4, b = g + m <= u ? g : f.top - m - 4;
|
|
1798
|
-
V.value = v({
|
|
1799
|
-
top: Math.max(c, Math.min(b, u - m)),
|
|
1800
|
-
left: Math.max(l, Math.min(f.left, d - h))
|
|
1801
|
-
}), await O(), M.value && (F.value ? L.value : x.value)?.focus({ preventScroll: !0 });
|
|
1802
|
-
}
|
|
1803
|
-
o(F, async () => {
|
|
1804
|
-
M.value && (await oe(), M.value && !F.value && I.value?.focus({ preventScroll: !0 }));
|
|
1805
|
-
});
|
|
1806
|
-
function se(e) {
|
|
1807
|
-
let t = e.composedPath();
|
|
1808
|
-
!t.includes(y.value) && !t.includes(x.value) && X();
|
|
1809
|
-
}
|
|
1810
|
-
function ce(e) {
|
|
1811
|
-
if (e.composedPath().includes(x.value)) return;
|
|
1812
|
-
let t = y.value?.getBoundingClientRect();
|
|
1813
|
-
t && R && t.top === R.top && t.right === R.right || X();
|
|
1814
|
-
}
|
|
1815
|
-
function Z() {
|
|
1816
|
-
g.removeEventListener("click", se, !0), g.removeEventListener("scroll", ce, !0);
|
|
1817
|
-
}
|
|
1818
|
-
o(M, (e) => {
|
|
1819
|
-
Z(), e ? (g.addEventListener("click", se, !0), g.addEventListener("scroll", ce, !0)) : a("target", null);
|
|
1820
|
-
}, { flush: "sync" }), o(q, () => {
|
|
1821
|
-
F.value = !1, M.value && oe();
|
|
1822
|
-
}), o([
|
|
1823
|
-
() => r.blockId,
|
|
1824
|
-
() => r.state,
|
|
1825
|
-
() => s?.activeLocale?.value,
|
|
1826
|
-
() => s?.state.template?.id,
|
|
1827
|
-
() => s?.loadVersion?.value
|
|
1828
|
-
], () => X()), p(Z);
|
|
1829
|
-
let le = (e) => {
|
|
1830
|
-
(M.value || _.value) && (a("target", e ?? null), M.value || ae());
|
|
1831
|
-
};
|
|
1832
|
-
o(() => r.blockId, (e, t) => {
|
|
1833
|
-
t && u?.get(t) === le && u.delete(t), u?.set(e, le);
|
|
1834
|
-
}, { immediate: !0 }), p(() => {
|
|
1835
|
-
u?.get(r.blockId) === le && u.delete(r.blockId);
|
|
1836
|
-
});
|
|
1837
|
-
function ue() {
|
|
1838
|
-
s?.keepTranslations?.(r.blockId, r.stale), X(!0);
|
|
1839
|
-
}
|
|
1840
|
-
function de(e) {
|
|
1841
|
-
s?.resetLocaleFields?.(r.blockId, e), X(!0);
|
|
1842
|
-
}
|
|
1843
|
-
function fe() {
|
|
1844
|
-
s?.setBlockHidden?.(r.blockId, !1), X(!0);
|
|
1845
|
-
}
|
|
1846
|
-
function pe(e) {
|
|
1847
|
-
s?.setActiveLocale?.(e), X();
|
|
1848
|
-
}
|
|
1849
|
-
function me() {
|
|
1850
|
-
Y.value && !c?.running.value && (q.value === "tags-differ" && r.replacesCurrent ? F.value = !0 : c?.translate({
|
|
1851
|
-
only: q.value === "tags-differ" ? "all" : "gaps",
|
|
1852
|
-
blockId: r.blockId
|
|
1853
|
-
}));
|
|
1854
|
-
}
|
|
1855
|
-
function he() {
|
|
1856
|
-
F.value = !1;
|
|
1857
|
-
}
|
|
1858
|
-
function ge() {
|
|
1859
|
-
F.value ? he() : X(!0);
|
|
1860
|
-
}
|
|
1861
|
-
function _e() {
|
|
1862
|
-
Y.value && !c?.running.value && r.translationCount && (F.value = !1, c?.translate({
|
|
1863
|
-
only: "all",
|
|
1864
|
-
blockId: r.blockId
|
|
1865
|
-
}));
|
|
1866
|
-
}
|
|
1867
|
-
return (n, r) => (i(), b(B, null, [A("button", {
|
|
1868
|
-
ref_key: "trigger",
|
|
1869
|
-
ref: y,
|
|
1870
|
-
type: "button",
|
|
1871
|
-
"data-testid": "locale-chip",
|
|
1872
|
-
"data-state": e.state,
|
|
1873
|
-
"aria-label": K.value,
|
|
1874
|
-
title: K.value,
|
|
1875
|
-
"aria-expanded": M.value,
|
|
1876
|
-
"aria-controls": M.value ? U : void 0,
|
|
1877
|
-
"aria-haspopup": "dialog",
|
|
1878
|
-
class: "tpl-locale-chip tpl:flex tpl:size-5 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:p-0 tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-chrome-text-muted)] tpl:ring-1 tpl:ring-[var(--tpl-border)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:shadow-[var(--tpl-shadow-sm)] tpl:focus-visible:outline-none tpl:focus-visible:shadow-[var(--tpl-ring)] tpl:hover:focus-visible:shadow-[var(--tpl-ring),var(--tpl-shadow-sm)]",
|
|
1879
|
-
onClick: k(ae, ["stop"]),
|
|
1880
|
-
onKeydown: [S(k(ae, ["stop", "prevent"]), ["enter"]), S(k(ge, ["stop", "prevent"]), ["esc"])]
|
|
1881
|
-
}, [(i(), D(t(ne.value), {
|
|
1882
|
-
size: 12,
|
|
1883
|
-
"stroke-width": 2,
|
|
1884
|
-
"aria-hidden": "true"
|
|
1885
|
-
}))], 40, Ma), C(_) && M.value ? (i(), D(T, {
|
|
1886
|
-
key: 0,
|
|
1887
|
-
to: C(_)
|
|
1888
|
-
}, [A("div", {
|
|
1889
|
-
id: U,
|
|
1890
|
-
ref_key: "popover",
|
|
1891
|
-
ref: x,
|
|
1892
|
-
role: "dialog",
|
|
1893
|
-
"aria-label": F.value ? void 0 : te.value,
|
|
1894
|
-
"aria-labelledby": F.value ? `${U}-question` : void 0,
|
|
1895
|
-
"aria-describedby": F.value ? `${U}-warning` : void 0,
|
|
1896
|
-
tabindex: "-1",
|
|
1897
|
-
"data-testid": "locale-popover",
|
|
1898
|
-
class: "tpl-locale-popover tpl:absolute tpl:z-[10000] tpl:w-[300px] tpl:overflow-y-auto tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3 tpl:text-sm tpl:text-[var(--tpl-chrome-text)] tpl:shadow-[var(--tpl-shadow-md)] tpl:outline-none",
|
|
1899
|
-
style: P({
|
|
1900
|
-
top: `${V.value.top}px`,
|
|
1901
|
-
left: `${V.value.left}px`,
|
|
1902
|
-
maxHeight: `${H.value.maxHeight}px`,
|
|
1903
|
-
maxWidth: `${H.value.maxWidth}px`
|
|
1904
|
-
}),
|
|
1905
|
-
onClick: r[2] ||= k(() => {}, ["stop"]),
|
|
1906
|
-
onKeydown: S(k(ge, ["stop", "prevent"]), ["esc"])
|
|
1907
|
-
}, [F.value ? (i(), b(B, { key: 0 }, [
|
|
1908
|
-
A("h3", {
|
|
1909
|
-
id: `${U}-question`,
|
|
1910
|
-
class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
1911
|
-
}, j(C(Un)(C(m).localization.translationConfirmation, e.translationCount ?? 0, C(d))), 9, Pa),
|
|
1912
|
-
A("p", {
|
|
1913
|
-
id: `${U}-warning`,
|
|
1914
|
-
class: "tpl:m-0 tpl:text-[var(--tpl-text-muted)]"
|
|
1915
|
-
}, j(C(h)(C(m).localization.translationDescription, { language: W.value })), 9, Fa),
|
|
1916
|
-
A("div", Ia, [A("button", {
|
|
1917
|
-
ref_key: "confirmationCancel",
|
|
1918
|
-
ref: L,
|
|
1919
|
-
type: "button",
|
|
1920
|
-
"data-testid": "translation-confirm-cancel",
|
|
1921
|
-
class: w(C(Kn)),
|
|
1922
|
-
onClick: he
|
|
1923
|
-
}, j(C(m).localization.cancel), 3), A("button", {
|
|
1924
|
-
type: "button",
|
|
1925
|
-
"data-testid": "translation-confirm",
|
|
1926
|
-
class: w(C(qn)),
|
|
1927
|
-
disabled: !Y.value || !!C(c)?.running.value || !e.translationCount,
|
|
1928
|
-
onClick: _e
|
|
1929
|
-
}, j(C(Un)(C(m).localization.translateAllFields, e.translationCount ?? 0, C(d))), 11, La)])
|
|
1930
|
-
], 64)) : (i(), b(B, { key: 1 }, [
|
|
1931
|
-
ie.value ? (i(), b("p", Ra, j(te.value), 1)) : E("", !0),
|
|
1932
|
-
q.value === "missing" ? (i(), b("p", za, j(C(h)(C(m).localization.missingExplanation, { default: G.value })), 1)) : q.value === "stale" ? (i(), b(B, { key: 2 }, [A("p", Ba, j(C(h)(C(m).localization.staleExplanation, { default: G.value })), 1), A("p", Va, j(C(h)(C(m).localization.currentExcerpt, { excerpt: e.excerpt })), 1)], 64)) : q.value === "tags-differ" ? (i(), b("p", Ha, j(C(h)(C(m).localization.tagsDifferExplanation, { default: G.value })), 1)) : q.value === "changed" ? (i(), b("p", Ua, j(C(Un)(C(m).localization.changedProperties, J.value, C(d), { default: G.value })), 1)) : q.value === "hidden" ? (i(), b("p", Wa, j(C(h)(C(m).localization.hiddenExplanation, { language: W.value })), 1)) : (i(), b("ul", Ga, [(i(!0), b(B, null, l(e.staleLocales, (e) => (i(), b("li", {
|
|
1933
|
-
key: e,
|
|
1934
|
-
class: "tpl:flex tpl:items-center tpl:justify-between tpl:gap-3"
|
|
1935
|
-
}, [A("span", null, j(C(Wn)(e)), 1), A("button", {
|
|
1936
|
-
type: "button",
|
|
1937
|
-
class: w(C(Gn)),
|
|
1938
|
-
onClick: (t) => pe(e)
|
|
1939
|
-
}, j(C(m).localization.open), 11, Ka)]))), 128))])),
|
|
1940
|
-
e.editable && q.value !== "default-stale" ? (i(), b("div", qa, [
|
|
1941
|
-
Y.value && (q.value === "missing" || q.value === "stale" || q.value === "tags-differ") ? (i(), b("button", {
|
|
1942
|
-
key: 0,
|
|
1943
|
-
type: "button",
|
|
1944
|
-
ref_key: "retranslate",
|
|
1945
|
-
ref: I,
|
|
1946
|
-
"data-testid": q.value === "missing" ? "locale-translate" : "locale-retranslate",
|
|
1947
|
-
class: w(C(Kn)),
|
|
1948
|
-
disabled: !!C(c)?.running.value,
|
|
1949
|
-
onClick: me
|
|
1950
|
-
}, j(q.value === "missing" ? C(m).localization.translate : C(m).localization.retranslate), 11, Ja)) : E("", !0),
|
|
1951
|
-
q.value === "stale" || q.value === "tags-differ" ? (i(), b(B, { key: 1 }, [q.value === "stale" ? (i(), b("button", {
|
|
1952
|
-
key: 0,
|
|
1953
|
-
type: "button",
|
|
1954
|
-
"data-testid": "locale-keep",
|
|
1955
|
-
class: w(C(Y.value ? Gn : Kn)),
|
|
1956
|
-
onClick: ue
|
|
1957
|
-
}, j(C(m).localization.keep), 3)) : E("", !0), A("button", {
|
|
1958
|
-
type: "button",
|
|
1959
|
-
"data-testid": "locale-use-default",
|
|
1960
|
-
class: w(C(q.value === "tags-differ" && !Y.value ? Kn : Gn)),
|
|
1961
|
-
onClick: r[0] ||= (t) => de(q.value === "tags-differ" ? e.tagsDiffer ?? [] : e.stale)
|
|
1962
|
-
}, j(C(h)(C(m).localization.useDefaultLanguage, { default: G.value })), 3)], 64)) : E("", !0),
|
|
1963
|
-
q.value === "changed" ? (i(), b("button", {
|
|
1964
|
-
key: 2,
|
|
1965
|
-
type: "button",
|
|
1966
|
-
"data-testid": "locale-reset",
|
|
1967
|
-
class: w(C(Kn)),
|
|
1968
|
-
onClick: r[1] ||= (t) => de(e.setPaths)
|
|
1969
|
-
}, j(C(m).localization.resetChanges), 3)) : E("", !0),
|
|
1970
|
-
q.value === "hidden" ? (i(), b("button", {
|
|
1971
|
-
key: 3,
|
|
1972
|
-
type: "button",
|
|
1973
|
-
"data-testid": "locale-show",
|
|
1974
|
-
class: w(C(Kn)),
|
|
1975
|
-
onClick: fe
|
|
1976
|
-
}, j(C(m).localization.show), 3)) : E("", !0)
|
|
1977
|
-
])) : E("", !0)
|
|
1978
|
-
], 64))], 44, Na)], 8, ["to"])) : E("", !0)], 64));
|
|
1979
|
-
}
|
|
1980
|
-
}), [["__scopeId", "data-v-3343ae7d"]]), Xa = /* @__PURE__ */ n({
|
|
1981
|
-
__name: "LocaleMarkers",
|
|
1982
|
-
props: { block: {} },
|
|
1983
|
-
setup(e) {
|
|
1984
|
-
let t = e, n = f(Ln, null), r = f(nn, void 0), a = f(xn, []), s = f(Wt, ne.liquid), c = f(Sn, N(() => /* @__PURE__ */ new Set())), l = N(() => n?.activeLocale?.value), u = N(() => l.value ? t.block.l10n?.[l.value] : void 0), d = N(() => ({
|
|
1985
|
-
blocks: [t.block.type === "section" || t.block.type === "wrapper" ? {
|
|
1986
|
-
...t.block,
|
|
1987
|
-
children: []
|
|
1988
|
-
} : t.block],
|
|
1989
|
-
settings: {
|
|
1990
|
-
locale: n.content.value.settings.locale,
|
|
1991
|
-
locales: n.content.value.settings.locales
|
|
1992
|
-
}
|
|
1993
|
-
})), p = N(() => n && l.value && !c.value.has(l.value) ? te(d.value, l.value, a) : {
|
|
1994
|
-
missing: [],
|
|
1995
|
-
stale: [],
|
|
1996
|
-
translated: []
|
|
1997
|
-
}), m = N(() => p.value.stale.map((e) => e.slice(t.block.id.length + 1))), h = N(() => p.value.translated.flatMap((e) => {
|
|
1998
|
-
let n = e.slice(t.block.id.length + 1), r = ge(t.block, n), i = u.value?.text?.[n]?.value, a = t.block.type === "html" || le[t.block.type]?.includes(n) ? "html" : "text";
|
|
1999
|
-
return typeof r == "string" && i !== void 0 && ja(r, i, s, a) ? [n] : [];
|
|
2000
|
-
})), g = z(null), _ = N(() => n && l.value && !c.value.has(l.value) ? G(d.value, l.value, {
|
|
2001
|
-
syntax: s,
|
|
2002
|
-
definitions: a,
|
|
2003
|
-
doNotTranslate: r?.doNotTranslate,
|
|
2004
|
-
blockId: t.block.id,
|
|
2005
|
-
only: T.value === "tags-differ" ? "all" : "gaps"
|
|
2006
|
-
}).strings : []), v = N(() => _.value.some(({ id: e }) => {
|
|
2007
|
-
let n = e.slice(t.block.id.length + 1);
|
|
2008
|
-
return p.value.translated.includes(e) && !h.value.includes(n);
|
|
2009
|
-
})), y = N(() => Object.keys(u.value?.set ?? {}).filter((e) => {
|
|
2010
|
-
let n = e.split("."), r = n.pop(), i = n.length ? ge(t.block, n.join(".")) : t.block;
|
|
2011
|
-
return Array.isArray(i) ? ge(i, r) !== void 0 : i !== void 0;
|
|
2012
|
-
})), b = N(() => !l.value && n ? (n.content.value.settings.locales ?? []).filter((e) => !c.value.has(e) && te(d.value, e, a).stale.length > 0) : []), x = N(() => l.value ? c.value.has(l.value) ? null : u.value?.hidden ? "hidden" : p.value.missing.length ? "missing" : m.value.length ? "stale" : h.value.length ? "tags-differ" : y.value.length ? "changed" : null : b.value.length ? "default-stale" : null);
|
|
2013
|
-
function S(e) {
|
|
2014
|
-
return e === "missing" ? p.value.missing.length : e === "stale" ? m.value.length : e === "tags-differ" ? h.value.length : e === "default-stale" ? b.value.length : y.value.length;
|
|
2015
|
-
}
|
|
2016
|
-
let w = N(() => S(x.value)), T = N(() => g.value && S(g.value) > 0 ? g.value : x.value), O = N(() => S(T.value));
|
|
2017
|
-
o([x, () => T.value !== (g.value ?? x.value)], () => {
|
|
2018
|
-
g.value = null;
|
|
2019
|
-
});
|
|
2020
|
-
let k = N(() => {
|
|
2021
|
-
let e = ge(t.block, m.value[0] ?? "");
|
|
2022
|
-
if (typeof e != "string") return "";
|
|
2023
|
-
let n = e.split(/<[^>]*>/).join("");
|
|
2024
|
-
return Array.from(n).slice(0, 60).join("");
|
|
2025
|
-
});
|
|
2026
|
-
return (t, n) => C(r) && x.value ? (i(), D(Ya, {
|
|
2027
|
-
key: 0,
|
|
2028
|
-
"block-id": e.block.id,
|
|
2029
|
-
state: x.value,
|
|
2030
|
-
count: w.value,
|
|
2031
|
-
"popover-state": T.value ?? void 0,
|
|
2032
|
-
"popover-count": O.value,
|
|
2033
|
-
stale: m.value,
|
|
2034
|
-
"tags-differ": h.value,
|
|
2035
|
-
"set-paths": y.value,
|
|
2036
|
-
"stale-locales": b.value,
|
|
2037
|
-
excerpt: k.value,
|
|
2038
|
-
"eligible-gaps": _.value.length > 0,
|
|
2039
|
-
"translation-count": _.value.length,
|
|
2040
|
-
"replaces-current": v.value,
|
|
2041
|
-
editable: !!l.value && C(r).locales.includes(l.value),
|
|
2042
|
-
onTarget: n[0] ||= (e) => g.value = e
|
|
2043
|
-
}, null, 8, [
|
|
2044
|
-
"block-id",
|
|
2045
|
-
"state",
|
|
2046
|
-
"count",
|
|
2047
|
-
"popover-state",
|
|
2048
|
-
"popover-count",
|
|
2049
|
-
"stale",
|
|
2050
|
-
"tags-differ",
|
|
2051
|
-
"set-paths",
|
|
2052
|
-
"stale-locales",
|
|
2053
|
-
"excerpt",
|
|
2054
|
-
"eligible-gaps",
|
|
2055
|
-
"translation-count",
|
|
2056
|
-
"replaces-current",
|
|
2057
|
-
"editable"
|
|
2058
|
-
])) : E("", !0);
|
|
2059
|
-
}
|
|
2060
|
-
}), Za = [
|
|
2061
|
-
"data-block-id",
|
|
2062
|
-
"data-block-type",
|
|
2063
|
-
"data-tpl-picked"
|
|
2064
|
-
], Qa = ["aria-label"], $a = ["data-lock-holder"], eo = ["aria-label"], to = [
|
|
2065
|
-
"aria-label",
|
|
2066
|
-
"aria-pressed",
|
|
2067
|
-
"title"
|
|
2068
|
-
], no = ["aria-label", "title"], ro = ["aria-label", "title"], io = ["aria-label", "title"], ao = {
|
|
2069
|
-
key: 3,
|
|
2070
|
-
class: "tpl-block-hidden-overlay tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[5] tpl:flex tpl:items-center tpl:justify-center tpl:rounded-sm"
|
|
2071
|
-
}, oo = { class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-2 tpl:py-1 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-chrome-text-muted)] tpl:shadow-[var(--tpl-shadow-sm)]" }, so = {
|
|
2072
|
-
key: 4,
|
|
2073
|
-
class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
|
|
2074
|
-
}, co = ["aria-label", "title"], lo = /*#__PURE__*/ St(/* @__PURE__ */ n({
|
|
2075
|
-
__name: "BlockWrapper",
|
|
2076
|
-
props: {
|
|
2077
|
-
block: {},
|
|
2078
|
-
displayBlock: {},
|
|
2079
|
-
isSelected: { type: Boolean },
|
|
2080
|
-
viewport: {},
|
|
2081
|
-
previewMode: { type: Boolean },
|
|
2082
|
-
nested: { type: Boolean },
|
|
2083
|
-
picked: { type: Boolean }
|
|
2084
|
-
},
|
|
2085
|
-
emits: ["select"],
|
|
2086
|
-
setup(e, { emit: t }) {
|
|
2087
|
-
let n = g(() => import("./BlockIssueBadge-D3Plo_wt.js")), r = e, a = N(() => r.displayBlock ?? r.block), s = t, { t: c, format: l } = Q(), u = f(Rn, null), d = z(null), p = N(() => u?.liftedBlockId.value === r.block.id), m = N(() => p.value ? l(c.blockActions.dragLifted, { block: r.block.type }) : c.blockActions.drag);
|
|
2088
|
-
async function v() {
|
|
2089
|
-
await O(), d.value?.focus();
|
|
2090
|
-
}
|
|
2091
|
-
function y(e) {
|
|
2092
|
-
u && (e.key === " " || e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), p.value ? u.drop(r.block.id) : u.lift(r.block.id)) : p.value && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), u.cancel(), v()) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), u.moveUp(r.block.id), v()) : e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), u.moveDown(r.block.id), v())));
|
|
2093
|
-
}
|
|
2094
|
-
let S = N(() => !r.viewport || !a.value.visibility ? !1 : a.value.visibility[r.viewport] === !1), T = N(() => !!(Z?.activeLocale?.value && r.block.l10n?.[Z.activeLocale.value]?.hidden)), M = N(() => r.previewMode === !0 && (S.value || T.value)), F = N(() => r.viewport ? {
|
|
2095
|
-
desktop: c.viewport.desktop,
|
|
2096
|
-
mobile: c.viewport.mobile
|
|
2097
|
-
}[r.viewport] ?? r.viewport : ""), I = N(() => !!a.value.displayCondition), L = f(Pn, null), R = f(Dn, null), B = f(vn, {}), H = N(() => B.savedBlocks?.isPicking.value === !0), U = N(() => !r.nested && B.savedBlocks?.isAvailable.value === !0 && B.savedBlocks?.canCreate.value === !0), W = N(() => r.isSelected && !H.value), G = N(() => B.comments?.getBlockCount(r.block.id) ?? 0), ee = z(null), K = z(null), q = z(null), J = z(null), te = z({
|
|
2098
|
-
left: "calc(100% + 8px)",
|
|
2099
|
-
top: "50%"
|
|
2100
|
-
}), ne = z(!1), re = N(() => K.value ?? J.value), ie = N(() => re.value?.closest(".tpl-body"));
|
|
2101
|
-
function Y() {
|
|
2102
|
-
let e = ne.value, t = K.value, n = J.value, r = ee.value;
|
|
2103
|
-
if (!t && !n || !r?.offsetWidth) return;
|
|
2104
|
-
let i = r.getBoundingClientRect(), a = i.width / r.offsetWidth || 1, o = ie.value, s = o ? (o.getBoundingClientRect().left - i.left) / a + o.clientLeft : -Infinity, c = o ? s + o.clientWidth : Infinity, l = getComputedStyle(r).direction === "rtl";
|
|
2105
|
-
if (n?.offsetWidth) {
|
|
2106
|
-
let t = l ? -4 - n.offsetWidth : r.offsetWidth + 4, i = t >= s + 4 && t + n.offsetWidth + 4 <= c;
|
|
2107
|
-
if (e === i) {
|
|
2108
|
-
ne.value = !i, O(Y);
|
|
2109
|
-
return;
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2112
|
-
if (!t?.offsetWidth) return;
|
|
2113
|
-
let u = Math.max(s + 4, Math.min(r.offsetWidth + 8, c - t.offsetWidth - 4)), d = q.value, f = Math.max(28, d?.offsetHeight ? d.offsetTop + d.offsetHeight + 4 : 0), p = Math.max(f + t.offsetHeight / 2, r.offsetHeight / 2), m = u < r.offsetWidth && p + t.offsetHeight / 2 <= r.offsetHeight + 8 ? `${p}px` : "50%";
|
|
2114
|
-
if (u >= r.offsetWidth && n?.offsetWidth && !e && !l) {
|
|
2115
|
-
let e = (n.getBoundingClientRect().bottom - i.top) / a + 4 + t.offsetHeight / 2;
|
|
2116
|
-
e > r.offsetHeight / 2 && (m = `${e}px`);
|
|
2117
|
-
}
|
|
2118
|
-
if (u < r.offsetWidth && m === "50%") {
|
|
2119
|
-
let e = d?.getBoundingClientRect();
|
|
2120
|
-
if (e?.width) {
|
|
2121
|
-
let n = l ? (e.right - i.left) / a + 8 : (e.left - i.left) / a - t.offsetWidth - 8;
|
|
2122
|
-
u = Math.max(s + 4, Math.min(n, c - t.offsetWidth - 4));
|
|
2123
|
-
}
|
|
2124
|
-
}
|
|
2125
|
-
(te.value.left !== `${u}px` || te.value.top !== m) && (te.value = {
|
|
2126
|
-
left: `${u}px`,
|
|
2127
|
-
top: m
|
|
2128
|
-
});
|
|
2129
|
-
}
|
|
2130
|
-
_(Y), tr(N(() => re.value ? [
|
|
2131
|
-
ee.value,
|
|
2132
|
-
K.value,
|
|
2133
|
-
q.value,
|
|
2134
|
-
J.value,
|
|
2135
|
-
ie.value
|
|
2136
|
-
].filter((e) => !!e) : []), Y), Qn(ie, "scroll", Y, { passive: !0 });
|
|
2137
|
-
let X = N(() => B.collaboration?.lockOf(r.block.id) ?? null), ae = N(() => X.value?.holder.type === "guest" ? c.collaboration.guest : X.value?.holder.name ?? ""), oe = N(() => B.collaboration?.agentHighlightOf(r.block.id) ?? B.ai?.highlightOf(r.block.id) ?? null), se = vt(() => a.value.type === "section" ? a.value.backgroundImage : void 0), ce = vt(() => a.value.type === "section" ? a.value.wrapper?.backgroundImage : void 0), Z = f(Ln, null), le = Z ? Hn(Z) : null, ue = f(Tn, null) ?? le?.content ?? null;
|
|
2138
|
-
o([() => Z?.activeLocale?.value, () => le && Ye(le.settings.value)], Y, { flush: "post" });
|
|
2139
|
-
let de = f(cn, void 0), fe = N(() => Fi(a.value, {
|
|
2140
|
-
backgroundImageUrl: se.value,
|
|
2141
|
-
heroBoxWidth: ut(a.value) ? mt(a.value, ue?.value, de) : void 0
|
|
2142
|
-
})), pe = N(() => Ri(a.value, { backgroundImageUrl: ce.value }));
|
|
2143
|
-
function me(e) {
|
|
2144
|
-
r.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), s("select"));
|
|
2145
|
-
}
|
|
2146
|
-
function he() {
|
|
2147
|
-
L?.deleteBlock(r.block.id);
|
|
2148
|
-
}
|
|
2149
|
-
function ge() {
|
|
2150
|
-
L?.duplicateBlock(r.block);
|
|
2151
|
-
}
|
|
2152
|
-
function _e() {
|
|
2153
|
-
B.savedBlocks?.startPicking(r.block.id);
|
|
2154
|
-
}
|
|
2155
|
-
function ve() {
|
|
2156
|
-
R?.toggleBlock(r.block.id);
|
|
2157
|
-
}
|
|
2158
|
-
return (t, r) => M.value ? E("", !0) : (i(), b("div", {
|
|
2159
|
-
key: 0,
|
|
2160
|
-
ref_key: "blockElement",
|
|
2161
|
-
ref: ee,
|
|
2162
|
-
class: w(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow", {
|
|
2163
|
-
"tpl-block--selected": e.isSelected,
|
|
2164
|
-
"tpl-block--locale-hidden": T.value,
|
|
2165
|
-
"tpl-block--picked": e.picked,
|
|
2166
|
-
"tpl-block--idle": !e.isSelected && !e.picked,
|
|
2167
|
-
"tpl-block--lifted": p.value
|
|
2168
|
-
}]),
|
|
2169
|
-
"data-block-id": e.block.id,
|
|
2170
|
-
"data-block-type": e.block.type,
|
|
2171
|
-
"data-tpl-picked": e.picked || void 0,
|
|
2172
|
-
onClick: me
|
|
2173
|
-
}, [
|
|
2174
|
-
A("div", {
|
|
2175
|
-
ref_key: "badgesElement",
|
|
2176
|
-
ref: q,
|
|
2177
|
-
class: "tpl-block-badges tpl:absolute tpl:top-1 tpl:inset-e-1 tpl:z-10 tpl:flex tpl:gap-1"
|
|
2178
|
-
}, [
|
|
2179
|
-
G.value > 0 && !S.value ? (i(), b("button", {
|
|
2180
|
-
key: 0,
|
|
2181
|
-
ref_key: "commentElement",
|
|
2182
|
-
ref: J,
|
|
2183
|
-
class: w(["tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-0.5 tpl:rounded-full tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-semibold tpl:transition-colors tpl:bg-[var(--tpl-chrome-primary-light)] tpl:text-[var(--tpl-primary)]", ne.value ? void 0 : "tpl:absolute tpl:-top-2 tpl:inset-s-full tpl:ms-2"]),
|
|
2184
|
-
"aria-label": C(l)(C(c).blockActions.comments, { count: String(G.value) }),
|
|
2185
|
-
onClick: r[0] ||= k((t) => C(B).comments?.openForBlock(e.block.id), ["stop"])
|
|
2186
|
-
}, [V(C(Rt), {
|
|
2187
|
-
size: 12,
|
|
2188
|
-
"stroke-width": 2.5
|
|
2189
|
-
}), x(" " + j(G.value), 1)], 10, Qa)) : E("", !0),
|
|
2190
|
-
V(C(n), { "block-id": e.block.id }, null, 8, ["block-id"]),
|
|
2191
|
-
e.previewMode ? E("", !0) : (i(), D(Xa, {
|
|
2192
|
-
key: 1,
|
|
2193
|
-
block: e.block
|
|
2194
|
-
}, null, 8, ["block"]))
|
|
2195
|
-
], 512),
|
|
2196
|
-
X.value ? (i(), b("div", {
|
|
2197
|
-
key: 0,
|
|
2198
|
-
"data-testid": "block-lock",
|
|
2199
|
-
"data-lock-holder": X.value.holder.sessionId,
|
|
2200
|
-
class: "tpl-block-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
|
|
2201
|
-
style: P({
|
|
2202
|
-
outline: `2px solid ${X.value.holder.color}`,
|
|
2203
|
-
outlineOffset: "-1px"
|
|
2204
|
-
})
|
|
2205
|
-
}, [A("span", {
|
|
2206
|
-
class: "tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:-translate-x-1/2 tpl:-translate-y-full tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:whitespace-nowrap",
|
|
2207
|
-
style: P({
|
|
2208
|
-
backgroundColor: X.value.holder.color,
|
|
2209
|
-
color: C(gr)(X.value.holder.color)
|
|
2210
|
-
})
|
|
2211
|
-
}, j(C(l)(C(c).collaboration.editing, { name: ae.value })), 5)], 12, $a)) : E("", !0),
|
|
2212
|
-
oe.value === null ? E("", !0) : (i(), b("div", {
|
|
2213
|
-
key: oe.value,
|
|
2214
|
-
"data-testid": "block-agent-highlight",
|
|
2215
|
-
"aria-hidden": "true",
|
|
2216
|
-
class: "tpl-block-agent-highlight tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm"
|
|
2217
|
-
})),
|
|
2218
|
-
W.value ? (i(), b("div", {
|
|
2219
|
-
key: 2,
|
|
2220
|
-
ref_key: "actionsElement",
|
|
2221
|
-
ref: K,
|
|
2222
|
-
style: P(te.value),
|
|
2223
|
-
role: "toolbar",
|
|
2224
|
-
"aria-label": C(c).blockActions.drag,
|
|
2225
|
-
class: "tpl-block-actions tpl-fade-in tpl:absolute tpl:top-1/2 tpl:z-20 tpl:flex tpl:-translate-y-1/2 tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:shadow-[var(--tpl-shadow-md)] tpl:border tpl:border-[var(--tpl-border)]"
|
|
2226
|
-
}, [
|
|
2227
|
-
A("button", {
|
|
2228
|
-
ref_key: "dragButtonRef",
|
|
2229
|
-
ref: d,
|
|
2230
|
-
class: "tpl-block-btn tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-grab tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:active:cursor-grabbing",
|
|
2231
|
-
"aria-label": m.value,
|
|
2232
|
-
"aria-pressed": p.value,
|
|
2233
|
-
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
2234
|
-
title: C(c).blockActions.drag,
|
|
2235
|
-
onKeydown: y
|
|
2236
|
-
}, [V(C(Vt), {
|
|
2237
|
-
size: 14,
|
|
2238
|
-
"stroke-width": 1.5
|
|
2239
|
-
})], 40, to),
|
|
2240
|
-
A("button", {
|
|
2241
|
-
class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
|
|
2242
|
-
"aria-label": C(c).blockActions.duplicate,
|
|
2243
|
-
title: C(c).blockActions.duplicate,
|
|
2244
|
-
onClick: k(ge, ["stop"])
|
|
2245
|
-
}, [V(C(Ct), {
|
|
2246
|
-
size: 14,
|
|
2247
|
-
"stroke-width": 1.5
|
|
2248
|
-
})], 8, no),
|
|
2249
|
-
U.value ? (i(), b("button", {
|
|
2250
|
-
key: 0,
|
|
2251
|
-
class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
|
|
2252
|
-
"aria-label": C(c).blockActions.saveAsBlock,
|
|
2253
|
-
title: C(c).blockActions.saveAsBlock,
|
|
2254
|
-
onClick: k(_e, ["stop"])
|
|
2255
|
-
}, [V(C(jt), {
|
|
2256
|
-
size: 14,
|
|
2257
|
-
"stroke-width": 1.5
|
|
2258
|
-
})], 8, ro)) : E("", !0),
|
|
2259
|
-
A("button", {
|
|
2260
|
-
class: "tpl-block-action-btn tpl-block-delete-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
|
|
2261
|
-
"aria-label": C(c).blockActions.delete,
|
|
2262
|
-
title: C(c).blockActions.delete,
|
|
2263
|
-
onClick: k(he, ["stop"])
|
|
2264
|
-
}, [V(C(Ft), {
|
|
2265
|
-
size: 14,
|
|
2266
|
-
"stroke-width": 1.5
|
|
2267
|
-
})], 8, io)
|
|
2268
|
-
], 12, eo)) : E("", !0),
|
|
2269
|
-
S.value ? (i(), b("div", ao, [A("span", oo, [V(C(Dt), {
|
|
2270
|
-
size: 12,
|
|
2271
|
-
"stroke-width": 1.5
|
|
2272
|
-
}), x(" " + j(C(l)(C(c).blockActions.hiddenOnViewport, { viewport: F.value })), 1)])])) : E("", !0),
|
|
2273
|
-
I.value && !S.value ? (i(), b("div", so, [A("button", {
|
|
2274
|
-
"data-testid": "condition-toggle",
|
|
2275
|
-
class: "tpl-condition-toggle tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1 tpl:transition-colors tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-primary)] tpl:border tpl:border-[var(--tpl-border)]",
|
|
2276
|
-
"aria-label": C(c).blockActions.conditionToggle,
|
|
2277
|
-
title: e.block.displayCondition?.label,
|
|
2278
|
-
onClick: k(ve, ["stop"])
|
|
2279
|
-
}, [V(C(Ot), {
|
|
2280
|
-
size: 12,
|
|
2281
|
-
"stroke-width": 2
|
|
2282
|
-
})], 8, co)])) : E("", !0),
|
|
2283
|
-
pe.value ? (i(), b("div", {
|
|
2284
|
-
key: 5,
|
|
2285
|
-
class: w(["tpl-section-wrapper tpl-email-surface", C(ji)(pe.value)]),
|
|
2286
|
-
style: P(pe.value)
|
|
2287
|
-
}, [A("div", {
|
|
2288
|
-
class: w(["tpl-block-content tpl-email-surface", C(ji)(fe.value)]),
|
|
2289
|
-
style: P(fe.value)
|
|
2290
|
-
}, [h(t.$slots, "default", {}, void 0, !0)], 6)], 6)) : (i(), b("div", {
|
|
2291
|
-
key: 6,
|
|
2292
|
-
class: w(["tpl-block-content tpl-email-surface", C(ji)(fe.value)]),
|
|
2293
|
-
style: P(fe.value)
|
|
2294
|
-
}, [h(t.$slots, "default", {}, void 0, !0)], 6))
|
|
2295
|
-
], 10, Za));
|
|
2296
|
-
}
|
|
2297
|
-
}), [["__scopeId", "data-v-8c371dc9"]]);
|
|
2298
|
-
// src/utils/unwrapParagraph.ts
|
|
2299
|
-
function uo(e) {
|
|
2300
|
-
let t = /^\s*<p\b/.exec(e);
|
|
2301
|
-
if (!t) return e;
|
|
2302
|
-
let n = Ee(e, t[0].length);
|
|
2303
|
-
if (n === -1) return e;
|
|
2304
|
-
let r = /<\/p>\s*$/.exec(e);
|
|
2305
|
-
if (!r || r.index <= n) return e;
|
|
2306
|
-
let i = e.slice(n + 1, r.index);
|
|
2307
|
-
return /<\/p>\s*<p\b/i.test(i) ? e : i;
|
|
2308
|
-
}
|
|
2309
|
-
// src/components/blocks/TitleBlock.vue
|
|
2310
|
-
var fo = /* @__PURE__ */ n({
|
|
2311
|
-
__name: "TitleBlock",
|
|
2312
|
-
props: {
|
|
2313
|
-
block: {},
|
|
2314
|
-
viewport: {}
|
|
2315
|
-
},
|
|
2316
|
-
setup(e) {
|
|
2317
|
-
let n = e, r = g(() => import("./TitleEditor-C2syRLdZ.js")), a = kn(gn, "TitleBlock"), { isEditing: o, blockRef: s, toolbarPosition: c, resolvedContent: l, handleDoubleClick: u, handleEditorDone: d } = Ea(() => n.block.content), f = N(() => {
|
|
2318
|
-
let e = {
|
|
2319
|
-
fontSize: `${be[n.block.level]}px`,
|
|
2320
|
-
lineHeight: String(tt),
|
|
2321
|
-
fontWeight: "700",
|
|
2322
|
-
textAlign: n.block.textAlign
|
|
2323
|
-
};
|
|
2324
|
-
return n.block.color && (e.color = n.block.color), n.block.fontFamily && (e.fontFamily = a.resolveFontFamily(n.block.fontFamily)), e;
|
|
2325
|
-
}), p = N(() => `h${n.block.level}`), m = N(() => mr(uo(l.value)));
|
|
2326
|
-
return (n, a) => (i(), b("div", {
|
|
2327
|
-
ref_key: "blockRef",
|
|
2328
|
-
ref: s,
|
|
2329
|
-
class: "tpl:min-h-[1em] tpl:w-full",
|
|
2330
|
-
style: P(f.value),
|
|
2331
|
-
onDblclick: a[0] ||= (...e) => C(u) && C(u)(...e)
|
|
2332
|
-
}, [C(o) ? (i(), D(C(r), {
|
|
2333
|
-
key: 0,
|
|
2334
|
-
block: e.block,
|
|
2335
|
-
"toolbar-position": C(c),
|
|
2336
|
-
onDone: C(d)
|
|
2337
|
-
}, null, 8, [
|
|
2338
|
-
"block",
|
|
2339
|
-
"toolbar-position",
|
|
2340
|
-
"onDone"
|
|
2341
|
-
])) : (i(), D(t(p.value), {
|
|
2342
|
-
key: 1,
|
|
2343
|
-
class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-[inherit] tpl:outline-none",
|
|
2344
|
-
style: {
|
|
2345
|
-
color: "inherit",
|
|
2346
|
-
fontWeight: "inherit"
|
|
2347
|
-
},
|
|
2348
|
-
innerHTML: m.value
|
|
2349
|
-
}, null, 8, ["innerHTML"]))], 36));
|
|
2350
|
-
}
|
|
2351
|
-
}), po = "hero", mo = "#1f2937", ho = "#ffffff";
|
|
2352
|
-
function go(e, t) {
|
|
2353
|
-
let n = et("title", e);
|
|
2354
|
-
n.color = ho, n.textAlign = "center";
|
|
2355
|
-
let r = et("paragraph", e);
|
|
2356
|
-
r.content = `<p style="text-align: center"><span style="color: ${ho}">${_o(t)}</span></p>`;
|
|
2357
|
-
let i = et("button", e);
|
|
2358
|
-
return i.align = "center", se({
|
|
2359
|
-
columns: "1",
|
|
2360
|
-
children: [[
|
|
2361
|
-
n,
|
|
2362
|
-
r,
|
|
2363
|
-
i
|
|
2364
|
-
]],
|
|
2365
|
-
hero: {
|
|
2366
|
-
height: "image",
|
|
2367
|
-
verticalAlign: "middle"
|
|
2368
|
-
},
|
|
2369
|
-
styles: {
|
|
2370
|
-
padding: {
|
|
2371
|
-
top: 48,
|
|
2372
|
-
right: 24,
|
|
2373
|
-
bottom: 48,
|
|
2374
|
-
left: 24
|
|
2375
|
-
},
|
|
2376
|
-
backgroundColor: mo
|
|
2377
|
-
}
|
|
2378
|
-
});
|
|
2379
|
-
}
|
|
2380
|
-
function _o(e) {
|
|
2381
|
-
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2382
|
-
}
|
|
2383
|
-
// src/utils/sectionColumnDrop.ts
|
|
2384
|
-
var vo = /* @__PURE__ */ new Set(["section", po]);
|
|
2385
|
-
function yo(e) {
|
|
2386
|
-
return e.dataset.blockType !== "section" && !vo.has(e.dataset.paletteType ?? "");
|
|
2387
|
-
}
|
|
2388
|
-
// src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2389
|
-
var bo = { class: "tpl:relative tpl:w-full" }, xo = {
|
|
2390
|
-
key: 0,
|
|
2391
|
-
"data-testid": "hero-image-hint",
|
|
2392
|
-
class: "tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-full tpl:mb-2 tpl:flex tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]"
|
|
2393
|
-
}, So = {
|
|
2394
|
-
key: 0,
|
|
2395
|
-
"data-testid": "section-drop-hint",
|
|
2396
|
-
class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]"
|
|
2397
|
-
}, Co = /* @__PURE__ */ n({
|
|
2398
|
-
__name: "SectionBlock",
|
|
2399
|
-
props: {
|
|
2400
|
-
block: {},
|
|
2401
|
-
sourceBlock: {},
|
|
2402
|
-
viewport: {}
|
|
2403
|
-
},
|
|
2404
|
-
setup(n) {
|
|
2405
|
-
let r = {
|
|
2406
|
-
title: fo,
|
|
2407
|
-
paragraph: Oa,
|
|
2408
|
-
image: xa,
|
|
2409
|
-
button: Ui,
|
|
2410
|
-
divider: ra,
|
|
2411
|
-
custom: ta
|
|
2412
|
-
}, o = n, { t: u } = Q(), d = kn(Ln, "SectionBlock"), { displayBlock: p } = Hn(d), m = N(() => o.sourceBlock ?? o.block), h = f(Sn, N(() => /* @__PURE__ */ new Set()));
|
|
2413
|
-
s(Sn, N(() => /* @__PURE__ */ new Set([...h.value, ...Object.entries(m.value.l10n ?? {}).filter(([, e]) => e.hidden).map(([e]) => e)])));
|
|
2414
|
-
let g = f(Dn, null), _ = f(En, null), v = f(vn, {}), y = f(mn, null);
|
|
2415
|
-
function x(e) {
|
|
2416
|
-
let t = v.savedBlocks;
|
|
2417
|
-
t?.isPicking.value ? t.togglePick(o.block.id) : d.selectBlock(e);
|
|
2418
|
-
}
|
|
2419
|
-
let S = N(() => {
|
|
2420
|
-
switch (o.block.columns) {
|
|
2421
|
-
case "2": return ["50%", "50%"];
|
|
2422
|
-
case "3": return [
|
|
2423
|
-
"33.33%",
|
|
2424
|
-
"33.33%",
|
|
2425
|
-
"33.33%"
|
|
2426
|
-
];
|
|
2427
|
-
case "1-2": return ["33.33%", "66.67%"];
|
|
2428
|
-
case "2-1": return ["66.67%", "33.33%"];
|
|
2429
|
-
default: return ["100%"];
|
|
2430
|
-
}
|
|
2431
|
-
}), T = N(() => {
|
|
2432
|
-
let e = S.value.length, t = [...(d.state.previewMode ? o.block : m.value).children];
|
|
2433
|
-
for (; t.length < e;) t.push([]);
|
|
2434
|
-
return t.slice(0, e);
|
|
2435
|
-
}), O = N(() => o.viewport === "mobile" && o.block.stackOnMobile !== !1);
|
|
2436
|
-
function k(e) {
|
|
2437
|
-
return T.value[e] || [];
|
|
2438
|
-
}
|
|
2439
|
-
function M(e) {
|
|
2440
|
-
return y?.value === !1 || !g?.isHidden(e);
|
|
2441
|
-
}
|
|
2442
|
-
function F(e) {
|
|
2443
|
-
return !k(e).some((e) => M(e.id));
|
|
2444
|
-
}
|
|
2445
|
-
let L = z(null);
|
|
2446
|
-
function H(e) {
|
|
2447
|
-
return d.state.previewMode ? !1 : F(e) ? !0 : L.value === e && k(e).filter((e) => M(e.id)).length <= 1;
|
|
2448
|
-
}
|
|
2449
|
-
let U = N(() => {
|
|
2450
|
-
if (d.state.previewMode) return !1;
|
|
2451
|
-
let e = Ne(o.block);
|
|
2452
|
-
return e !== null && !e.applied && e.reason === "image";
|
|
2453
|
-
});
|
|
2454
|
-
function W(e) {
|
|
2455
|
-
return k(e).length === 0 && !d.state.previewMode;
|
|
2456
|
-
}
|
|
2457
|
-
function G(e) {
|
|
2458
|
-
return k(e).length === 0 && d.state.previewMode;
|
|
2459
|
-
}
|
|
2460
|
-
function ee(e, t) {
|
|
2461
|
-
ka(d, t, o.block.id, e);
|
|
2462
|
-
}
|
|
2463
|
-
function K(e) {
|
|
2464
|
-
return Di(e, _, r);
|
|
2465
|
-
}
|
|
2466
|
-
function q(e, t) {
|
|
2467
|
-
e.type === "custom" && d.updateBlock(e.id, {
|
|
2468
|
-
fieldValues: t.fieldValues,
|
|
2469
|
-
dataSourceFetched: t.dataSourceFetched
|
|
2470
|
-
});
|
|
2471
|
-
}
|
|
2472
|
-
return (r, s) => (i(), b("div", bo, [U.value ? (i(), b("div", xo, [A("span", null, j(C(u).section.heroAddImage), 1)])) : E("", !0), A("div", { class: w(["tpl:flex tpl:gap-0", { "tpl:flex-col": O.value }]) }, [(i(!0), b(B, null, l(T.value, (r, f) => (i(), b("div", {
|
|
2473
|
-
key: f,
|
|
2474
|
-
class: w(["tpl:relative tpl:flex tpl:flex-col tpl:rounded", W(f) ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
|
|
2475
|
-
style: P({ width: O.value ? "100%" : S.value[f] })
|
|
2476
|
-
}, [V(C(R), {
|
|
2477
|
-
"model-value": k(f),
|
|
2478
|
-
group: {
|
|
2479
|
-
name: "blocks",
|
|
2480
|
-
pull: !0,
|
|
2481
|
-
put: (e, t, n) => C(yo)(n)
|
|
2482
|
-
},
|
|
2483
|
-
animation: 150,
|
|
2484
|
-
"ghost-class": "tpl-ghost",
|
|
2485
|
-
"drag-class": "tpl-dragging",
|
|
2486
|
-
handle: ".tpl-block-btn",
|
|
2487
|
-
"invert-swap": !0,
|
|
2488
|
-
"inverted-swap-threshold": .65,
|
|
2489
|
-
"empty-insert-threshold": 20,
|
|
2490
|
-
"force-fallback": !0,
|
|
2491
|
-
class: w(["tpl:grow", {
|
|
2492
|
-
"tpl:min-h-[60px]": H(f),
|
|
2493
|
-
"tpl:min-h-[34px]": G(f)
|
|
2494
|
-
}]),
|
|
2495
|
-
onUpdate: (e) => C(ka)(C(d), k(f), o.block.id, f, e),
|
|
2496
|
-
onStart: (e) => L.value = f,
|
|
2497
|
-
onEnd: s[0] ||= (e) => L.value = null,
|
|
2498
|
-
"onUpdate:modelValue": (e) => ee(f, e)
|
|
2499
|
-
}, {
|
|
2500
|
-
default: a(() => [(i(!0), b(B, null, l(k(f), (r) => c((i(), b("div", { key: r.id }, [V(lo, {
|
|
2501
|
-
block: r,
|
|
2502
|
-
"display-block": C(p)(r),
|
|
2503
|
-
"is-selected": C(d).state.selectedBlockId === r.id,
|
|
2504
|
-
viewport: n.viewport,
|
|
2505
|
-
"preview-mode": C(d).state.previewMode,
|
|
2506
|
-
nested: "",
|
|
2507
|
-
onSelect: (e) => x(r.id)
|
|
2508
|
-
}, {
|
|
2509
|
-
default: a(() => [(i(), D(t(K(r)), e({ block: C(p)(r) }, { ref_for: !0 }, r.type === "section" ? { sourceBlock: r } : {}, {
|
|
2510
|
-
viewport: n.viewport,
|
|
2511
|
-
onFetchData: (e) => q(r, e),
|
|
2512
|
-
onUpdate: (e) => C(d).updateBlock(r.id, e)
|
|
2513
|
-
}), null, 16, [
|
|
2514
|
-
"block",
|
|
2515
|
-
"viewport",
|
|
2516
|
-
"onFetchData",
|
|
2517
|
-
"onUpdate"
|
|
2518
|
-
]))]),
|
|
2519
|
-
_: 2
|
|
2520
|
-
}, 1032, [
|
|
2521
|
-
"block",
|
|
2522
|
-
"display-block",
|
|
2523
|
-
"is-selected",
|
|
2524
|
-
"viewport",
|
|
2525
|
-
"preview-mode",
|
|
2526
|
-
"onSelect"
|
|
2527
|
-
])])), [[I, M(r.id)]])), 128))]),
|
|
2528
|
-
_: 2
|
|
2529
|
-
}, 1032, [
|
|
2530
|
-
"model-value",
|
|
2531
|
-
"group",
|
|
2532
|
-
"class",
|
|
2533
|
-
"onUpdate",
|
|
2534
|
-
"onStart",
|
|
2535
|
-
"onUpdate:modelValue"
|
|
2536
|
-
]), W(f) ? (i(), b("div", So, [A("span", null, j(C(u).section.dropHere), 1)])) : E("", !0)], 6))), 128))], 2)]));
|
|
2537
|
-
}
|
|
2538
|
-
}), wo = ["width", "height"], To = [
|
|
2539
|
-
"d",
|
|
2540
|
-
"stroke",
|
|
2541
|
-
"stroke-opacity",
|
|
2542
|
-
"stroke-width"
|
|
2543
|
-
], Eo = ["d", "fill"], Do = /* @__PURE__ */ n({
|
|
2544
|
-
__name: "SocialIconSvg",
|
|
2545
|
-
props: {
|
|
2546
|
-
platform: {},
|
|
2547
|
-
iconStyle: {},
|
|
2548
|
-
iconTone: {},
|
|
2549
|
-
iconSize: {}
|
|
2550
|
-
},
|
|
2551
|
-
setup(e) {
|
|
2552
|
-
let t = e, n = N(() => pt[t.platform]), r = N(() => ht[t.iconSize]), a = N(() => Ce(t.platform, t.iconTone)), o = N(() => We(t.iconStyle, t.iconTone)), s = N(() => {
|
|
2553
|
-
let e = {
|
|
2554
|
-
display: "inline-flex",
|
|
2555
|
-
alignItems: "center",
|
|
2556
|
-
justifyContent: "center",
|
|
2557
|
-
width: `${r.value}px`,
|
|
2558
|
-
height: `${r.value}px`
|
|
2559
|
-
}, n = a.value.fill;
|
|
2560
|
-
switch (t.iconStyle) {
|
|
2561
|
-
case "solid": return {
|
|
2562
|
-
...e,
|
|
2563
|
-
backgroundColor: n,
|
|
2564
|
-
borderRadius: "4px"
|
|
2565
|
-
};
|
|
2566
|
-
case "outlined": return {
|
|
2567
|
-
...e,
|
|
2568
|
-
backgroundColor: "transparent",
|
|
2569
|
-
border: `2px solid ${n}`,
|
|
2570
|
-
borderRadius: "4px",
|
|
2571
|
-
...o.value && { boxShadow: u(o.value) }
|
|
2572
|
-
};
|
|
2573
|
-
case "rounded": return {
|
|
2574
|
-
...e,
|
|
2575
|
-
backgroundColor: n,
|
|
2576
|
-
borderRadius: "8px"
|
|
2577
|
-
};
|
|
2578
|
-
case "square": return {
|
|
2579
|
-
...e,
|
|
2580
|
-
backgroundColor: n,
|
|
2581
|
-
borderRadius: "0"
|
|
2582
|
-
};
|
|
2583
|
-
case "circle": return {
|
|
2584
|
-
...e,
|
|
2585
|
-
backgroundColor: n,
|
|
2586
|
-
borderRadius: "50%"
|
|
2587
|
-
};
|
|
2588
|
-
default: return e;
|
|
2589
|
-
}
|
|
2590
|
-
}), c = N(() => Re(t.iconStyle)), l = N(() => Math.floor(r.value * c.value));
|
|
2591
|
-
function u(e) {
|
|
2592
|
-
let t = `${e.width / 2 * r.value / 24}px`, n = Math.round(e.opacity * 255).toString(16).padStart(2, "0"), i = `${e.color}${n}`;
|
|
2593
|
-
return `0 0 0 ${t} ${i}, inset 0 0 0 ${t} ${i}`;
|
|
2594
|
-
}
|
|
2595
|
-
let d = N(() => t.iconStyle === "outlined" || t.iconStyle === "plain" ? a.value.fill : a.value.onFill);
|
|
2596
|
-
return (e, t) => (i(), b("span", { style: P(s.value) }, [(i(), b("svg", {
|
|
2597
|
-
width: l.value,
|
|
2598
|
-
height: l.value,
|
|
2599
|
-
viewBox: "0 0 24 24",
|
|
2600
|
-
overflow: "visible",
|
|
2601
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2602
|
-
}, [o.value ? (i(), b("path", {
|
|
2603
|
-
key: 0,
|
|
2604
|
-
"data-testid": "social-icon-halo",
|
|
2605
|
-
d: n.value.path,
|
|
2606
|
-
fill: "none",
|
|
2607
|
-
stroke: o.value.color,
|
|
2608
|
-
"stroke-opacity": o.value.opacity,
|
|
2609
|
-
"stroke-width": o.value.width / c.value,
|
|
2610
|
-
"stroke-linejoin": "round"
|
|
2611
|
-
}, null, 8, To)) : E("", !0), A("path", {
|
|
2612
|
-
d: n.value.path,
|
|
2613
|
-
fill: d.value
|
|
2614
|
-
}, null, 8, Eo)], 8, wo))], 4));
|
|
2615
|
-
}
|
|
2616
|
-
}), Oo = { class: "tpl:w-full" }, ko = ["href"], Ao = {
|
|
2617
|
-
key: 1,
|
|
2618
|
-
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
|
|
2619
|
-
}, jo = /* @__PURE__ */ n({
|
|
2620
|
-
__name: "SocialIconsBlock",
|
|
2621
|
-
props: {
|
|
2622
|
-
block: {},
|
|
2623
|
-
viewport: {}
|
|
2624
|
-
},
|
|
2625
|
-
setup(e) {
|
|
2626
|
-
let t = e, { t: n } = Q(), r = N(() => ({
|
|
2627
|
-
display: "flex",
|
|
2628
|
-
flexWrap: "wrap",
|
|
2629
|
-
gap: `${t.block.spacing}px`,
|
|
2630
|
-
justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
|
|
2631
|
-
})), a = N(() => t.block.icons.length > 0);
|
|
2632
|
-
return (t, o) => (i(), b("div", Oo, [a.value ? (i(), b("div", {
|
|
2633
|
-
key: 0,
|
|
2634
|
-
style: P(r.value)
|
|
2635
|
-
}, [(i(!0), b(B, null, l(e.block.icons, (t) => (i(), b("a", {
|
|
2636
|
-
key: t.id,
|
|
2637
|
-
href: t.url || "#",
|
|
2638
|
-
class: "tpl:cursor-default",
|
|
2639
|
-
onClick: o[0] ||= k(() => {}, ["prevent"])
|
|
2640
|
-
}, [V(Do, {
|
|
2641
|
-
platform: t.platform,
|
|
2642
|
-
"icon-style": e.block.iconStyle,
|
|
2643
|
-
"icon-tone": e.block.iconTone,
|
|
2644
|
-
"icon-size": e.block.iconSize
|
|
2645
|
-
}, null, 8, [
|
|
2646
|
-
"platform",
|
|
2647
|
-
"icon-style",
|
|
2648
|
-
"icon-tone",
|
|
2649
|
-
"icon-size"
|
|
2650
|
-
])], 8, ko))), 128))], 4)) : (i(), b("div", Ao, [V(C(It), { size: 16 }), A("span", null, j(C(n).social.addIcons), 1)]))]));
|
|
2651
|
-
}
|
|
2652
|
-
}), Mo = { class: "tpl:w-full" }, No = {
|
|
2653
|
-
key: 0,
|
|
2654
|
-
class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
2655
|
-
style: {
|
|
2656
|
-
"background-color": "var(--tpl-bg-hover)",
|
|
2657
|
-
color: "var(--tpl-text-dim)"
|
|
2658
|
-
}
|
|
2659
|
-
}, Po = /* @__PURE__ */ n({
|
|
2660
|
-
__name: "SpacerBlock",
|
|
2661
|
-
props: {
|
|
2662
|
-
block: {},
|
|
2663
|
-
viewport: {}
|
|
2664
|
-
},
|
|
2665
|
-
setup(e) {
|
|
2666
|
-
let t = e, n = kn(Ln, "SpacerBlock"), r = N(() => ({
|
|
2667
|
-
height: `${t.block.height}px`,
|
|
2668
|
-
minHeight: `${t.block.height}px`,
|
|
2669
|
-
...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
2670
|
-
}));
|
|
2671
|
-
return (t, a) => (i(), b("div", Mo, [A("div", {
|
|
2672
|
-
style: P(r.value),
|
|
2673
|
-
class: w(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:box-border tpl:border-y tpl:border-x-0 tpl:border-dashed": !C(n).state.previewMode }])
|
|
2674
|
-
}, [C(n).state.previewMode ? E("", !0) : (i(), b("span", No, j(e.block.height) + "px ", 1))], 6)]));
|
|
2675
|
-
}
|
|
2676
|
-
}), Fo = { class: "tpl:w-full" }, Io = { key: 0 }, Lo = [
|
|
2677
|
-
"aria-label",
|
|
2678
|
-
"data-placeholder",
|
|
2679
|
-
"onBlur"
|
|
2680
|
-
], Ro = [
|
|
2681
|
-
"aria-label",
|
|
2682
|
-
"data-placeholder",
|
|
2683
|
-
"onBlur"
|
|
2684
|
-
], zo = {
|
|
2685
|
-
key: 1,
|
|
2686
|
-
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
|
|
2687
|
-
}, Bo = /*#__PURE__*/ St(/* @__PURE__ */ n({
|
|
2688
|
-
__name: "TableBlock",
|
|
2689
|
-
props: {
|
|
2690
|
-
block: {},
|
|
2691
|
-
viewport: {}
|
|
2692
|
-
},
|
|
2693
|
-
setup(e) {
|
|
2694
|
-
let t = {
|
|
2695
|
-
mounted(e, t) {
|
|
2696
|
-
e.textContent = t.value ?? "";
|
|
2697
|
-
},
|
|
2698
|
-
updated(e, t) {
|
|
2699
|
-
t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
|
|
2700
|
-
}
|
|
2701
|
-
}, n = e, { t: r } = Q(), a = kn(Ln, "TableBlock"), o = kn(gn, "TableBlock"), s = N(() => n.block.rows.length > 0), u = N(() => {
|
|
2702
|
-
let e = {
|
|
2703
|
-
width: "100%",
|
|
2704
|
-
borderCollapse: "collapse",
|
|
2705
|
-
fontSize: `${n.block.fontSize}px`,
|
|
2706
|
-
textAlign: n.block.textAlign,
|
|
2707
|
-
fontFamily: n.block.fontFamily ? o.resolveFontFamily(n.block.fontFamily) : "inherit"
|
|
2708
|
-
};
|
|
2709
|
-
return n.block.color && (e.color = n.block.color), e;
|
|
2710
|
-
}), d = N(() => ({
|
|
2711
|
-
border: `${n.block.borderWidth}px solid ${n.block.borderColor}`,
|
|
2712
|
-
padding: `${n.block.cellPadding}px`,
|
|
2713
|
-
textAlign: n.block.textAlign
|
|
2714
|
-
})), f = N(() => ({
|
|
2715
|
-
...d.value,
|
|
2716
|
-
fontWeight: "bold",
|
|
2717
|
-
backgroundColor: n.block.headerBackgroundColor || "transparent"
|
|
2718
|
-
})), p = N(() => n.block.hasHeaderRow && n.block.rows.length > 0 ? n.block.rows[0] : null), m = N(() => n.block.hasHeaderRow ? n.block.rows.slice(1) : n.block.rows);
|
|
2719
|
-
function h() {
|
|
2720
|
-
a.selectBlock(n.block.id);
|
|
2721
|
-
}
|
|
2722
|
-
function g(e, t, r) {
|
|
2723
|
-
let i = r.target.innerText.trim(), o = n.block.rows.map((n) => n.id === e ? {
|
|
2724
|
-
...n,
|
|
2725
|
-
cells: n.cells.map((e) => e.id === t ? {
|
|
2726
|
-
...e,
|
|
2727
|
-
content: i
|
|
2728
|
-
} : e)
|
|
2729
|
-
} : n);
|
|
2730
|
-
a.updateBlock(n.block.id, { rows: o });
|
|
2731
|
-
}
|
|
2732
|
-
return (e, n) => (i(), b("div", Fo, [s.value ? (i(), b("table", {
|
|
2733
|
-
key: 0,
|
|
2734
|
-
style: P(u.value),
|
|
2735
|
-
class: "tpl-table-editable"
|
|
2736
|
-
}, [p.value ? (i(), b("thead", Io, [A("tr", null, [(i(!0), b(B, null, l(p.value.cells, (e) => c((i(), b("th", {
|
|
2737
|
-
key: e.id,
|
|
2738
|
-
style: P(f.value),
|
|
2739
|
-
"aria-label": C(r).table.cellPlaceholder,
|
|
2740
|
-
contenteditable: "true",
|
|
2741
|
-
"data-placeholder": C(r).table.cellPlaceholder,
|
|
2742
|
-
onBlur: (t) => g(p.value.id, e.id, t),
|
|
2743
|
-
onKeydown: n[0] ||= S(k((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
2744
|
-
onClick: k(h, ["stop"])
|
|
2745
|
-
}, null, 44, Lo)), [[t, e.content]])), 128))])])) : E("", !0), A("tbody", null, [(i(!0), b(B, null, l(m.value, (e) => (i(), b("tr", { key: e.id }, [(i(!0), b(B, null, l(e.cells, (a) => c((i(), b("td", {
|
|
2746
|
-
key: a.id,
|
|
2747
|
-
style: P(d.value),
|
|
2748
|
-
"aria-label": C(r).table.cellPlaceholder,
|
|
2749
|
-
contenteditable: "true",
|
|
2750
|
-
"data-placeholder": C(r).table.cellPlaceholder,
|
|
2751
|
-
onBlur: (t) => g(e.id, a.id, t),
|
|
2752
|
-
onKeydown: n[1] ||= S(k((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
2753
|
-
onClick: k(h, ["stop"])
|
|
2754
|
-
}, null, 44, Ro)), [[t, a.content]])), 128))]))), 128))])], 4)) : (i(), b("div", zo, [V(C(Bt), { size: 16 }), A("span", null, j(C(r).table.empty), 1)]))]));
|
|
2755
|
-
}
|
|
2756
|
-
}), [["__scopeId", "data-v-6751d456"]]), Vo = /* @__PURE__ */ n({
|
|
2757
|
-
__name: "VideoPlayButton",
|
|
2758
|
-
props: { hoverEffect: {
|
|
2759
|
-
type: Boolean,
|
|
2760
|
-
default: !1
|
|
2761
|
-
} },
|
|
2762
|
-
setup(e) {
|
|
2763
|
-
return (t, n) => (i(), b("div", { class: w(["tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30", e.hoverEffect && "tpl:transition-opacity tpl:group-hover:bg-black/40"]) }, [...n[0] ||= [A("div", { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[color-mix(in_srgb,var(--tpl-bg)_90%,transparent)] tpl:shadow-[var(--tpl-shadow-lg)]" }, [A("svg", {
|
|
2764
|
-
class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
|
|
2765
|
-
width: "28",
|
|
2766
|
-
height: "28",
|
|
2767
|
-
viewBox: "0 0 24 24",
|
|
2768
|
-
fill: "currentColor"
|
|
2769
|
-
}, [A("polygon", { points: "5,3 19,12 5,21" })])], -1)]], 2));
|
|
2770
|
-
}
|
|
2771
|
-
});
|
|
2772
|
-
// src/utils/videoThumbnail.ts
|
|
2773
|
-
function Ho(e) {
|
|
2774
|
-
if (!e) return {
|
|
2775
|
-
platform: "unknown",
|
|
2776
|
-
videoId: null,
|
|
2777
|
-
thumbnailUrl: null
|
|
2778
|
-
};
|
|
2779
|
-
for (let t of [/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/i, /youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/i]) {
|
|
2780
|
-
let n = e.match(t);
|
|
2781
|
-
if (n) {
|
|
2782
|
-
let e = n[1];
|
|
2783
|
-
return {
|
|
2784
|
-
platform: "youtube",
|
|
2785
|
-
videoId: e,
|
|
2786
|
-
thumbnailUrl: `https://img.youtube.com/vi/${e}/maxresdefault.jpg`
|
|
2787
|
-
};
|
|
2788
|
-
}
|
|
2789
|
-
}
|
|
2790
|
-
let t = e.match(/vimeo\.com\/(?:video\/)?(\d+)/i);
|
|
2791
|
-
if (t) {
|
|
2792
|
-
let e = t[1];
|
|
2793
|
-
return {
|
|
2794
|
-
platform: "vimeo",
|
|
2795
|
-
videoId: e,
|
|
2796
|
-
thumbnailUrl: `https://vumbnail.com/${e}.jpg`
|
|
2797
|
-
};
|
|
2798
|
-
}
|
|
2799
|
-
return {
|
|
2800
|
-
platform: "unknown",
|
|
2801
|
-
videoId: null,
|
|
2802
|
-
thumbnailUrl: null
|
|
2803
|
-
};
|
|
2804
|
-
}
|
|
2805
|
-
function Uo(e, t) {
|
|
2806
|
-
return t || Ho(e).thumbnailUrl;
|
|
2807
|
-
}
|
|
2808
|
-
// src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2809
|
-
var Wo = ["src", "alt"], Go = {
|
|
2810
|
-
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
2811
|
-
style: { opacity: "0.7" }
|
|
2812
|
-
}, Ko = ["href"], qo = ["src", "alt"], Jo = ["src", "alt"], Yo = {
|
|
2813
|
-
key: 3,
|
|
2814
|
-
class: "tpl:flex tpl:box-border tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
|
|
2815
|
-
}, Xo = /* @__PURE__ */ n({
|
|
2816
|
-
__name: "VideoBlock",
|
|
2817
|
-
props: {
|
|
2818
|
-
block: {},
|
|
2819
|
-
viewport: {}
|
|
2820
|
-
},
|
|
2821
|
-
setup(e) {
|
|
2822
|
-
let t = e, { t: n } = Q(), { syntax: r } = rr(), a = N(() => pe(t.block.url, r) || pe(t.block.thumbnailUrl, r)), o = ct(() => a.value ? void 0 : t.block.thumbnailUrl || void 0), s = ct(() => a.value ? t.block.placeholderUrl : void 0), c = N(() => a.value ? null : t.block.thumbnailUrl ? o.value ?? null : Uo(t.block.url)), l = N(() => ({ textAlign: t.block.align })), u = N(() => {
|
|
2823
|
-
let e = t.block.align;
|
|
2824
|
-
return {
|
|
2825
|
-
maxWidth: "100%",
|
|
2826
|
-
width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
|
|
2827
|
-
height: t.block.height ? `${t.block.height}px` : void 0,
|
|
2828
|
-
display: "block",
|
|
2829
|
-
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
2830
|
-
marginRight: e === "center" ? "auto" : void 0
|
|
2831
|
-
};
|
|
2832
|
-
}), d = N(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), f = N(() => pe(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
|
|
2833
|
-
return (t, r) => (i(), b("div", {
|
|
2834
|
-
class: "tpl:w-full",
|
|
2835
|
-
style: P(l.value)
|
|
2836
|
-
}, [a.value && e.block.placeholderUrl ? (i(), b("div", {
|
|
2837
|
-
key: 0,
|
|
2838
|
-
class: "tpl:relative tpl:inline-block",
|
|
2839
|
-
style: P(u.value)
|
|
2840
|
-
}, [A("img", {
|
|
2841
|
-
class: "tpl:block tpl:w-full tpl:border-0",
|
|
2842
|
-
src: C(s),
|
|
2843
|
-
alt: e.block.alt,
|
|
2844
|
-
style: P(d.value)
|
|
2845
|
-
}, null, 12, Wo), V(Vo)], 4)) : a.value ? (i(), b("div", {
|
|
2846
|
-
key: 1,
|
|
2847
|
-
class: "tpl:relative tpl:!flex tpl:box-border tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
|
|
2848
|
-
style: P([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
|
|
2849
|
-
}, [V(C(zt), {
|
|
2850
|
-
size: 36,
|
|
2851
|
-
"stroke-width": 1.5,
|
|
2852
|
-
class: "tpl:text-[var(--tpl-primary)]",
|
|
2853
|
-
style: { opacity: "0.5" }
|
|
2854
|
-
}), A("span", Go, [V(Vi, { text: f.value }, null, 8, ["text"])])], 4)) : c.value ? (i(), b(B, { key: 2 }, [e.block.url ? (i(), b("a", {
|
|
2855
|
-
key: 0,
|
|
2856
|
-
href: e.block.url,
|
|
2857
|
-
target: "_blank",
|
|
2858
|
-
rel: "noopener noreferrer",
|
|
2859
|
-
class: "tpl:group tpl:relative tpl:inline-block",
|
|
2860
|
-
style: P(u.value),
|
|
2861
|
-
onClick: r[0] ||= k(() => {}, ["prevent"])
|
|
2862
|
-
}, [A("img", {
|
|
2863
|
-
class: "tpl:block tpl:w-full tpl:border-0",
|
|
2864
|
-
src: c.value,
|
|
2865
|
-
alt: e.block.alt,
|
|
2866
|
-
style: P(d.value)
|
|
2867
|
-
}, null, 12, qo), V(Vo, { "hover-effect": "" })], 12, Ko)) : (i(), b("div", {
|
|
2868
|
-
key: 1,
|
|
2869
|
-
class: "tpl:relative tpl:inline-block",
|
|
2870
|
-
style: P(u.value)
|
|
2871
|
-
}, [A("img", {
|
|
2872
|
-
class: "tpl:block tpl:w-full tpl:border-0",
|
|
2873
|
-
src: c.value,
|
|
2874
|
-
alt: e.block.alt,
|
|
2875
|
-
style: P(d.value)
|
|
2876
|
-
}, null, 12, Jo), V(Vo)], 4))], 64)) : (i(), b("div", Yo, [V(C(zt), {
|
|
2877
|
-
size: 40,
|
|
2878
|
-
"stroke-width": 1.5,
|
|
2879
|
-
class: "tpl:text-[var(--tpl-border-light)]"
|
|
2880
|
-
}), A("span", null, j(C(n).video.addVideo), 1)]))], 4));
|
|
2881
|
-
}
|
|
2882
|
-
}), Zo = {
|
|
2883
|
-
section: Co,
|
|
2884
|
-
title: fo,
|
|
2885
|
-
paragraph: Oa,
|
|
2886
|
-
image: xa,
|
|
2887
|
-
button: Ui,
|
|
2888
|
-
divider: ra,
|
|
2889
|
-
video: Xo,
|
|
2890
|
-
social: jo,
|
|
2891
|
-
menu: Ta,
|
|
2892
|
-
table: Bo,
|
|
2893
|
-
spacer: Po,
|
|
2894
|
-
html: la,
|
|
2895
|
-
countdown: g(() => import("./CountdownBlock-CjMhMhnv.js"))
|
|
2896
|
-
};
|
|
2897
|
-
function Qo(e) {
|
|
2898
|
-
let { editor: t, config: n, translations: r, fontsManager: i } = e, { t: a, format: c } = Q(r), l = N(() => Fe(Fe(Fe(ni(r), Si(t.content.value.settings?.locale)), Ye(t.content.value.settings) === "rtl" ? {
|
|
2899
|
-
title: { textAlign: "right" },
|
|
2900
|
-
table: { textAlign: "right" }
|
|
2901
|
-
} : {}), n.blockDefaults ?? {}));
|
|
2902
|
-
t.setUiTheme(n.uiTheme ?? "auto");
|
|
2903
|
-
let { resolvedTheme: u } = qr(N(() => t.state.uiTheme)), d = z(n.theme ?? {}), { themeStyles: f } = Er({
|
|
2904
|
-
themeOverrides: d,
|
|
2905
|
-
resolvedTheme: u,
|
|
2906
|
-
extraStyles: () => ({
|
|
2907
|
-
"--tpl-drop-text": `"${r.canvas.dropHere}"`,
|
|
2908
|
-
...e.themeExtraStyles?.()
|
|
2909
|
-
})
|
|
2910
|
-
}), p = e.history ?? nt({
|
|
2911
|
-
content: t.content,
|
|
2912
|
-
setContent: (e, n) => t.setContent(e, n)
|
|
2913
|
-
});
|
|
2914
|
-
e.history || ot(t, p);
|
|
2915
|
-
let h = xt({
|
|
2916
|
-
addBlock: t.addBlock,
|
|
2917
|
-
removeBlock: t.removeBlock,
|
|
2918
|
-
updateBlock: t.updateBlock,
|
|
2919
|
-
selectBlock: t.selectBlock,
|
|
2920
|
-
findBlockLocation: t.findBlockLocation,
|
|
2921
|
-
blockDefaults: () => l.value
|
|
2922
|
-
}), g = at(t), _ = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? st({
|
|
2923
|
-
content: t.content,
|
|
2924
|
-
isDirty: () => t.state.isDirty,
|
|
2925
|
-
...e.autoSaveOptions
|
|
2926
|
-
}) : null, v = null;
|
|
2927
|
-
_ && (v = o(p.isNavigating, (e) => {
|
|
2928
|
-
e ? _.pause() : _.resume();
|
|
2929
|
-
}));
|
|
2930
|
-
let b = Kr(t, {
|
|
2931
|
-
t: a,
|
|
2932
|
-
format: c
|
|
2933
|
-
}, n.customBlocks ?? []), x = or(n.colors);
|
|
2934
|
-
if (x.allowCustomIgnored && $.warn("config.colors.allowCustom: false is ignored without presets — keeping the color wheel and hex input so a color can still be chosen."), x.invalidPresets.length > 0 && $.warn(`config.colors.presets skipped invalid entries: ${x.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), x.allowCustom === !1) {
|
|
2935
|
-
let e = ti(x.presets, n.blockDefaults, n.templateDefaults);
|
|
2936
|
-
e.length > 0 && $.warn(`config.colors locks custom colours, but these block/template default colours fall outside colors.presets: ${e.join(", ")}. New blocks start on a colour the palette can't reselect — set blockDefaults / templateDefaults from the same palette.`);
|
|
2937
|
-
}
|
|
2938
|
-
let S = dr(n.templateSettings);
|
|
2939
|
-
for (let e of S.unknown) $.warn(`config.templateSettings.fields: "${e}" is not a template setting (expected one of ${fr.join(", ")}) — skipping it.`);
|
|
2940
|
-
let C = br();
|
|
2941
|
-
Qr(C, Zo);
|
|
2942
|
-
let w = /* @__PURE__ */ new Set();
|
|
2943
|
-
function T(e) {
|
|
2944
|
-
for (let t of e) {
|
|
2945
|
-
C.registerCustom(t, ta);
|
|
2946
|
-
for (let e of Ci(t, x)) w.has(e.id) || (w.add(e.id), $.warn(e.message));
|
|
2947
|
-
}
|
|
2948
|
-
}
|
|
2949
|
-
n.customBlocks?.length && T(n.customBlocks);
|
|
2950
|
-
let E = Lr();
|
|
2951
|
-
if (y() && m(E.dispose), e.containerEl) {
|
|
2952
|
-
let t = e.containerEl;
|
|
2953
|
-
Qn(document, "pointerdown", (e) => {
|
|
2954
|
-
let n = t.value;
|
|
2955
|
-
n && (e.composedPath?.() ?? []).includes(n) && E.claim();
|
|
2956
|
-
}, { capture: !0 });
|
|
2957
|
-
}
|
|
2958
|
-
function D() {
|
|
2959
|
-
let t = e.capabilities?.templates;
|
|
2960
|
-
t ? t.save() : _?.flush();
|
|
2961
|
-
}
|
|
2962
|
-
function O(n) {
|
|
2963
|
-
E.isActive() && Ti(n, {
|
|
2964
|
-
history: p,
|
|
2965
|
-
selectBlock: (e) => t.selectBlock(e),
|
|
2966
|
-
getSelectedBlockId: () => t.state.selectedBlockId,
|
|
2967
|
-
removeBlock: (e) => t.removeBlock(e),
|
|
2968
|
-
onSave: D,
|
|
2969
|
-
isPicking: () => e.capabilities?.savedBlocks?.isPicking.value === !0,
|
|
2970
|
-
onConfirmPick: () => e.capabilities?.savedBlocks?.confirmPicking(),
|
|
2971
|
-
onCancelPick: () => e.capabilities?.savedBlocks?.cancelPicking()
|
|
2972
|
-
});
|
|
2973
|
-
}
|
|
2974
|
-
Qn(document, "keydown", O);
|
|
2975
|
-
let k = z(null), A = e.editorRoot ?? document;
|
|
2976
|
-
s(Bn, A), s(Qt, k), s(Kt, /* @__PURE__ */ new Map()), s(Fn, r), s(Ln, t), s(zn, p), s(Pn, h), s(Dn, g), s(gn, i), s(yn, f), s(Cn, u), s(_n, l), s(Nn, n.locale), s(En, C), s(xn, n.customBlocks ?? []), s(Jt, n.paletteBlocks), s(sn, $r(n.htmlBlockPreview)), s(cn, n.layout), s(fn, n.sectionWrapper), s(An, x), s(Ht, S.fields), s(bn, Jr(t.content, C));
|
|
2977
|
-
let j = Oe(n.mergeTags?.syntax);
|
|
2978
|
-
for (let e of ["opener", "closer"]) {
|
|
2979
|
-
let t = j[e];
|
|
2980
|
-
typeof t == "string" && t.trim() === "" && $.warn(`config.mergeTags.syntax.${e} is blank — ignoring it.`);
|
|
2981
|
-
}
|
|
2982
|
-
typeof j.opener != "string" && typeof j.closer == "string" && j.closer.trim() !== "" && ie(j) === null && $.warn("config.mergeTags.syntax.closer has no effect without an opener — set opener to turn on autocomplete for this syntax.");
|
|
2983
|
-
let M = F(n.mergeTags?.tags ?? []);
|
|
2984
|
-
function P(e) {
|
|
2985
|
-
Array.isArray(e) ? M.value = e : $.warn(`setMergeTags() expects an array of merge tags, received ${typeof e} — ignoring.`);
|
|
2986
|
-
}
|
|
2987
|
-
s(rn, M), s(Wt, j), s(dn, n.mergeTags?.onRequest ?? null), s(qt, n.mergeTags?.autocomplete !== !1), s(Vn, n.mergeTags?.showRawValue !== !1);
|
|
2988
|
-
let I = z(_e(n.mergeTags?.tags ?? []));
|
|
2989
|
-
s(on, I);
|
|
2990
|
-
let L = Br({
|
|
2991
|
-
resolvePreview: n.resolvePreview,
|
|
2992
|
-
getContent: () => {
|
|
2993
|
-
let e = t.content.value;
|
|
2994
|
-
if (!t.state.previewMode) return e;
|
|
2995
|
-
let r = t.activeLocale?.value ?? e.settings.locale ?? "en", i = ye(e, r);
|
|
2996
|
-
return n.layout ? Be(ye(n.layout, r, { missing: "default" }), i) : i;
|
|
2997
|
-
},
|
|
2998
|
-
isActive: () => t.state.previewMode,
|
|
2999
|
-
getLocale: () => t.activeLocale?.value ?? t.content.value.settings.locale
|
|
3000
|
-
});
|
|
3001
|
-
s(jn, L), s(Zt, n.resolvePreview);
|
|
3002
|
-
let R = N(() => !(t.state.previewMode && L.isConfigured));
|
|
3003
|
-
s(mn, R);
|
|
3004
|
-
let B = Vr();
|
|
3005
|
-
s(Xt, B), s($t, z(!1)), s(tn, z(!1)), s(wn, n.logicTags?.tags ?? []), s(Ut, n.logicTags?.pairs ?? []), s(Yt, n.logicTags?.onRequest ?? null), s(en, Hr()), s(ln, n.onRequestMedia ?? null), s(In, n.canDropMedia ?? null), s(Gt, n.resolveImageUrl ? yt(n.resolveImageUrl) : null), s(pn, n.displayConditions?.conditions ?? []), s(Mn, n.displayConditions?.allowCustom ?? !1), s(vn, e.capabilities ?? {}), s(Rn, b);
|
|
3006
|
-
let V = Ur(n.lint) ? null : Gr({
|
|
3007
|
-
content: t.content,
|
|
3008
|
-
get options() {
|
|
3009
|
-
return Rr({
|
|
3010
|
-
...n,
|
|
3011
|
-
content: t.content.value,
|
|
3012
|
-
contentLocale: t.activeLocale?.value ?? void 0
|
|
3013
|
-
});
|
|
3014
|
-
},
|
|
3015
|
-
customBlocks: n.customBlocks,
|
|
3016
|
-
mergeTagSyntax: j,
|
|
3017
|
-
updateBlock: t.updateBlock,
|
|
3018
|
-
updateSettings: t.updateSettings,
|
|
3019
|
-
removeBlock: t.removeBlock
|
|
3020
|
-
});
|
|
3021
|
-
s(an, V);
|
|
3022
|
-
function H() {
|
|
3023
|
-
v?.(), V?.destroy(), _?.destroy(), p.destroy();
|
|
3024
|
-
}
|
|
3025
|
-
return {
|
|
3026
|
-
t: a,
|
|
3027
|
-
format: c,
|
|
3028
|
-
editorRoot: A,
|
|
3029
|
-
history: p,
|
|
3030
|
-
blockActions: h,
|
|
3031
|
-
conditionPreview: g,
|
|
3032
|
-
autoSave: _,
|
|
3033
|
-
resolvedTheme: u,
|
|
3034
|
-
themeStyles: f,
|
|
3035
|
-
themeOverrides: d,
|
|
3036
|
-
registry: C,
|
|
3037
|
-
keyboardReorder: b,
|
|
3038
|
-
templateLint: V,
|
|
3039
|
-
popoverRoot: k,
|
|
3040
|
-
mergeTagSampleMode: I,
|
|
3041
|
-
previewResolution: L,
|
|
3042
|
-
appliesConditionFilter: R,
|
|
3043
|
-
registerCustomBlocks: T,
|
|
3044
|
-
setMergeTags: P,
|
|
3045
|
-
mergeTags: M,
|
|
3046
|
-
mergeTagSyntax: j,
|
|
3047
|
-
destroy: H
|
|
3048
|
-
};
|
|
3049
|
-
}
|
|
3050
|
-
// src/composables/useSmallScreenNotice.ts
|
|
3051
|
-
var $o = "(max-width: 767px)";
|
|
3052
|
-
function es(e) {
|
|
3053
|
-
let t = $n($o);
|
|
3054
|
-
return {
|
|
3055
|
-
isSmallScreen: t,
|
|
3056
|
-
showNotice: N(() => (M(e) ?? !0) && t.value)
|
|
3057
|
-
};
|
|
3058
|
-
}
|
|
3059
|
-
export { gi as A, vr as B, Ii as C, ui as D, Di as E, Rr as F, Nr as I, jr as L, mi as M, pi as N, vi as O, Br as P, wr as R, Fi as S, zi as T, ra as _, Po as a, Ui as b, po as c, lo as d, ka as f, la as g, xa as h, Bo as i, hi as j, _i as k, go as l, Ta as m, Qo as n, jo as o, Oa as p, Xo as r, Co as s, es as t, fo as u, ta as v, Ei as w, ji as x, Ki as y, yr as z };
|
|
3060
|
-
|
|
3061
|
-
//# sourceMappingURL=composables-nyxwrM27.js.map
|