@templatical/editor 0.39.0 → 0.39.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/dist/{AiChatSidebar-jVlXXND3.js → AiChatSidebar-pOxCZWz9.js} +14 -14
- package/dist/{AiFeatureMenu-C1HCntyQ.js → AiFeatureMenu-Bljk6Qjv.js} +7 -7
- package/dist/{BlockIssueBadge-JhNgcUmZ.js → BlockIssueBadge-D5oGxOQP.js} +5 -5
- package/dist/{BlockPreviewCanvas-C_rA5LJN.js → BlockPreviewCanvas-DXGjUECG.js} +27 -27
- package/dist/{CloudHeaderExtras-DvYyNsPB.js → CloudHeaderExtras-DaocwNmy.js} +5 -5
- package/dist/{CloudPanels-CDPhPVdd.js → CloudPanels-CyZAnSJY.js} +7 -7
- package/dist/{CollaboratorBar-Co9UPoB0.js → CollaboratorBar-C7Zca3g1.js} +4 -4
- package/dist/{CommentsPanel-CRcVN9Ri.js → CommentsPanel-CNOb7YCm.js} +2 -2
- package/dist/{CommentsSidebar-gDU977br.js → CommentsSidebar-VmwjU9va.js} +14 -14
- package/dist/{CountdownBlock-CEzrfe5R.js → CountdownBlock-DSvbf3qU.js} +3 -3
- package/dist/{CountdownToolbar-B00zhkNJ.js → CountdownToolbar-C2kfS6Oy.js} +31 -30
- package/dist/{DesignReferenceSidebar-DedivZZl.js → DesignReferenceSidebar-QC4gEUWp.js} +11 -11
- package/dist/{IssuesPanel-C-PjdmAV.js → IssuesPanel-DL2Xr14_.js} +8 -8
- package/dist/{LoadingTrack-BlTL4zFv.js → LoadingTrack-C2jKCU2d.js} +1 -1
- package/dist/LogicTagInsertButton-D8IwH-9Z.js +1071 -0
- package/dist/MediaEditModal-D4GEq2md.js +3545 -0
- package/dist/{MediaPanels-BpQNY8YX.js → MediaPanels-sapgKtxu.js} +2 -2
- package/dist/MergeTagInput-QI-5KG2R.js +81 -0
- package/dist/{MergeTagModeToggle-DGuzSAdX.js → MergeTagModeToggle-D793Bj_E.js} +14 -55
- package/dist/{ParagraphEditor-jMKLLTa8.js → ParagraphEditor-DkkPSexG.js} +65 -66
- package/dist/{RestoreVersionDialog-DG1jUdBM.js → RestoreVersionDialog-BgueZnZr.js} +5 -5
- package/dist/{RichTextEditorContent-JrNEg0kv.js → RichTextEditorContent-BC5UTVnb.js} +11 -11
- package/dist/{SaveBlockDialog-C0KC-OKs.js → SaveBlockDialog-BuTuVlLr.js} +12 -11
- package/dist/{SavedBlocksBrowserModal-zyOiRgWZ.js → SavedBlocksBrowserModal-Srhix8BB.js} +17 -16
- package/dist/{SavedBlocksPanels-epMd799w.js → SavedBlocksPanels-B2iScCS-.js} +2 -2
- package/dist/{SavedBlocksPickBar-CJqqQ3jd.js → SavedBlocksPickBar-cI7bDQQi.js} +4 -4
- package/dist/{TemplateScoringPanel-m2FOeaai.js → TemplateScoringPanel-C2Rdlyn6.js} +16 -16
- package/dist/TemplateSettings-C_5leDdF.js +245 -0
- package/dist/{TestEmailModal-D58kYkMV.js → TestEmailModal-DJ5q_u4N.js} +10 -10
- package/dist/{TestEmailPanel-BmFVBIQt.js → TestEmailPanel-CP24UGst.js} +2 -2
- package/dist/{TitleEditor-C4BGPXnf.js → TitleEditor-QBBOXtxx.js} +15 -15
- package/dist/ToggleSwitch-JvQ_CmI1.js +102 -0
- package/dist/Toolbar-COD2TW20.js +2426 -0
- package/dist/{TplModal-BIDJw4Kj.js → TplModal-C8xGjC1l.js} +5 -5
- package/dist/{VersionHistoryMenu-dt_aZQfh.js → VersionHistoryMenu-BVQityes.js} +10 -10
- package/dist/{VersionHistoryPanels-B_5SBRrr.js → VersionHistoryPanels-BrK6na4A.js} +2 -2
- package/dist/{VersionPreviewBanner-DttvOkwd.js → VersionPreviewBanner-BaMSgA1O.js} +3 -3
- package/dist/{blockTypeIcons-CzTizYmK.js → blockTypeIcons-CdXugKyV.js} +16 -37
- package/dist/bundle-stats.json +8 -8
- package/dist/{ca-Jx2CDwtn.js → ca-BTf1Zbqb.js} +9 -0
- package/dist/cdn/chunks/{AiChatSidebar-DeZl9Tk0.js → AiChatSidebar-CjSEoK4x.js} +8 -8
- package/dist/cdn/chunks/{AiChatSidebar-DeZl9Tk0.js.map → AiChatSidebar-CjSEoK4x.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-Bv8jMu9p.js → AiFeatureMenu-l0K5TOSn.js} +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-Bv8jMu9p.js.map → AiFeatureMenu-l0K5TOSn.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-B6PpoOPv.js → BlockIssueBadge-9hHpaXb9.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-B6PpoOPv.js.map → BlockIssueBadge-9hHpaXb9.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-DfEtDosD.js → BlockPreviewCanvas-lQrAdgG3.js} +30 -30
- package/dist/cdn/chunks/{BlockPreviewCanvas-DfEtDosD.js.map → BlockPreviewCanvas-lQrAdgG3.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-Hk98ub-C.js → CloudHeaderExtras-CXNe7Q-4.js} +5 -5
- package/dist/cdn/chunks/{CloudHeaderExtras-Hk98ub-C.js.map → CloudHeaderExtras-CXNe7Q-4.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-Ba3GLmvF.js → CloudPanels-bHhh9AUA.js} +6 -6
- package/dist/cdn/chunks/{CloudPanels-Ba3GLmvF.js.map → CloudPanels-bHhh9AUA.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-D2dCQ9gg.js → CollaboratorBar-DgqcaGGI.js} +5 -5
- package/dist/cdn/chunks/{CollaboratorBar-D2dCQ9gg.js.map → CollaboratorBar-DgqcaGGI.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-CV2HveQk.js → CommentsPanel-Cy4TlTHC.js} +3 -3
- package/dist/cdn/chunks/{CommentsPanel-CV2HveQk.js.map → CommentsPanel-Cy4TlTHC.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-Dok_vaRc.js → CommentsSidebar-C7oAP3Mx.js} +5 -5
- package/dist/cdn/chunks/{CommentsSidebar-Dok_vaRc.js.map → CommentsSidebar-C7oAP3Mx.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-DGDl3ota.js → CountdownBlock-DdC8Lg5F.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-DGDl3ota.js.map → CountdownBlock-DdC8Lg5F.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-B9Rin64t.js → CountdownToolbar-CN9h4nlC.js} +22 -21
- package/dist/cdn/chunks/{CountdownToolbar-B9Rin64t.js.map → CountdownToolbar-CN9h4nlC.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-eCuTFak2.js → DesignReferenceSidebar-Bjo0M-AY.js} +7 -7
- package/dist/cdn/chunks/{DesignReferenceSidebar-eCuTFak2.js.map → DesignReferenceSidebar-Bjo0M-AY.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CP7FEzw7.js → IssuesPanel-DdFk-Blf.js} +6 -6
- package/dist/cdn/chunks/{IssuesPanel-CP7FEzw7.js.map → IssuesPanel-DdFk-Blf.js.map} +1 -1
- package/dist/cdn/chunks/{LoadingTrack-Cm3TDKb3.js → LoadingTrack-Ba5xh5HD.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-Cm3TDKb3.js.map → LoadingTrack-Ba5xh5HD.js.map} +1 -1
- package/dist/cdn/chunks/LogicTagInsertButton-DpyPozop.js +1035 -0
- package/dist/cdn/chunks/LogicTagInsertButton-DpyPozop.js.map +1 -0
- package/dist/cdn/chunks/MediaEditModal-BBZRcYKe.js +3529 -0
- package/dist/cdn/chunks/MediaEditModal-BBZRcYKe.js.map +1 -0
- package/dist/cdn/chunks/{MediaPanels-TYrKKHX5.js → MediaPanels-CSBCsFwT.js} +3 -3
- package/dist/cdn/chunks/{MediaPanels-TYrKKHX5.js.map → MediaPanels-CSBCsFwT.js.map} +1 -1
- package/dist/cdn/chunks/MergeTagInput-ERJr7bP_.js +83 -0
- package/dist/cdn/chunks/MergeTagInput-ERJr7bP_.js.map +1 -0
- package/dist/cdn/chunks/{MergeTagModeToggle-QGTUIWWo.js → MergeTagModeToggle-n3nvSNeQ.js} +5 -5
- package/dist/cdn/chunks/{MergeTagModeToggle-QGTUIWWo.js.map → MergeTagModeToggle-n3nvSNeQ.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-D1tsPv4v.js → ParagraphEditor-DO4RzP8l.js} +40 -40
- package/dist/cdn/chunks/{ParagraphEditor-D1tsPv4v.js.map → ParagraphEditor-DO4RzP8l.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-BeCxNPLS.js → RestoreVersionDialog-CzZ_sFnz.js} +5 -5
- package/dist/cdn/chunks/{RestoreVersionDialog-BeCxNPLS.js.map → RestoreVersionDialog-CzZ_sFnz.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-BBxzACFQ.js → RichTextEditorContent-Ch5zeyZ7.js} +8 -8
- package/dist/cdn/chunks/{RichTextEditorContent-BBxzACFQ.js.map → RichTextEditorContent-Ch5zeyZ7.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CLgh_g7H.js → SaveBlockDialog-LgxYrXyx.js} +10 -9
- package/dist/cdn/chunks/{SaveBlockDialog-CLgh_g7H.js.map → SaveBlockDialog-LgxYrXyx.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-B4TcUJJe.js → SavedBlocksBrowserModal-CdeSsTpb.js} +9 -9
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-B4TcUJJe.js.map → SavedBlocksBrowserModal-CdeSsTpb.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-CaBsHoRC.js → SavedBlocksPanels-B5hakNJj.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-CaBsHoRC.js.map → SavedBlocksPanels-B5hakNJj.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-iG35XCDx.js → SavedBlocksPickBar-Cl6PLwwV.js} +5 -5
- package/dist/cdn/chunks/{SavedBlocksPickBar-iG35XCDx.js.map → SavedBlocksPickBar-Cl6PLwwV.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-DuQJBykq.js → TemplateScoringPanel--JxR6CsQ.js} +6 -6
- package/dist/cdn/chunks/{TemplateScoringPanel-DuQJBykq.js.map → TemplateScoringPanel--JxR6CsQ.js.map} +1 -1
- package/dist/cdn/chunks/TemplateSettings-DjXiiiNr.js +207 -0
- package/dist/cdn/chunks/TemplateSettings-DjXiiiNr.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailModal-D6Woss3r.js → TestEmailModal-BAuDxJtD.js} +9 -9
- package/dist/cdn/chunks/{TestEmailModal-D6Woss3r.js.map → TestEmailModal-BAuDxJtD.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-CWQFB7J3.js → TestEmailPanel-GUGZisLp.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-CWQFB7J3.js.map → TestEmailPanel-GUGZisLp.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CbY1tgSl.js → TitleEditor-uKu33Nwr.js} +12 -12
- package/dist/cdn/chunks/{TitleEditor-CbY1tgSl.js.map → TitleEditor-uKu33Nwr.js.map} +1 -1
- package/dist/cdn/chunks/ToggleSwitch-CDy8OfcB.js +104 -0
- package/dist/cdn/chunks/ToggleSwitch-CDy8OfcB.js.map +1 -0
- package/dist/cdn/chunks/Toolbar-dxDYwN5E.js +2385 -0
- package/dist/cdn/chunks/Toolbar-dxDYwN5E.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-CGpp-d_r.js → TplModal-DuwS2ifK.js} +5 -5
- package/dist/cdn/chunks/{TplModal-CGpp-d_r.js.map → TplModal-DuwS2ifK.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-ByVJXDbK.js → VersionHistoryMenu-Dij1pTEb.js} +6 -6
- package/dist/cdn/chunks/{VersionHistoryMenu-ByVJXDbK.js.map → VersionHistoryMenu-Dij1pTEb.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-CQJ5OggF.js → VersionHistoryPanels-GeR6MStB.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryPanels-CQJ5OggF.js.map → VersionHistoryPanels-GeR6MStB.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-G4lLbfr8.js → VersionPreviewBanner-Df3FVlig.js} +4 -4
- package/dist/cdn/chunks/{VersionPreviewBanner-G4lLbfr8.js.map → VersionPreviewBanner-Df3FVlig.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-CQY-vxdM.js → blockTypeIcons-raBjStuv.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-CQY-vxdM.js.map → blockTypeIcons-raBjStuv.js.map} +1 -1
- package/dist/cdn/chunks/{ca-Jx2CDwtn.js → ca-BTf1Zbqb.js} +10 -1
- package/dist/cdn/chunks/{ca-Jx2CDwtn.js.map → ca-BTf1Zbqb.js.map} +1 -1
- package/dist/cdn/chunks/{cloud-BLgCKP7Z.js → cloud-eaXyxZ8l.js} +2 -2
- package/dist/cdn/chunks/{cloud-BLgCKP7Z.js.map → cloud-eaXyxZ8l.js.map} +1 -1
- package/dist/cdn/chunks/{createCloudRuntime-ClvtMBF1.js → createCloudRuntime-D5bXzcTe.js} +6 -6
- package/dist/cdn/chunks/{createCloudRuntime-ClvtMBF1.js.map → createCloudRuntime-D5bXzcTe.js.map} +1 -1
- package/dist/{de-Ck0pBGHu.js → cdn/chunks/de-xzrh9PA3.js} +11 -0
- package/dist/cdn/chunks/{de-Ck0pBGHu.js.map → de-xzrh9PA3.js.map} +1 -1
- package/dist/cdn/chunks/{dist-BW6Y49zE.js → dist-BRZhN8qJ.js} +4 -4
- package/dist/cdn/chunks/dist-BRZhN8qJ.js.map +1 -0
- package/dist/cdn/chunks/{dist-CAFTQ6Y2.js → dist-CXB2_kBa.js} +27 -22
- package/dist/cdn/chunks/dist-CXB2_kBa.js.map +1 -0
- package/dist/cdn/chunks/{draggable-kbOhCgnk.js → draggable-IB4x6w2O.js} +1477 -1470
- package/dist/cdn/chunks/draggable-IB4x6w2O.js.map +1 -0
- package/dist/cdn/chunks/editor-modal-C-yBlj2C.js +2700 -0
- package/dist/cdn/chunks/editor-modal-C-yBlj2C.js.map +1 -0
- package/dist/cdn/chunks/en-DYtFUE2l.js +2 -0
- package/dist/cdn/chunks/{es-lagTvUfX.js → es-BT4LSpE2.js} +10 -1
- package/dist/cdn/chunks/{es-lagTvUfX.js.map → es-BT4LSpE2.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-D2YIhF7u.js → extensions-Bhu8UEE5.js} +105 -45
- package/dist/cdn/chunks/extensions-Bhu8UEE5.js.map +1 -0
- package/dist/cdn/chunks/{fr-C4hVl5Lk.js → fr-CI7OJoql.js} +10 -1
- package/dist/cdn/chunks/{fr-C4hVl5Lk.js.map → fr-CI7OJoql.js.map} +1 -1
- package/dist/cdn/chunks/{icons-DdrAicM2.js → icons-BKkJ-5xF.js} +43 -43
- package/dist/cdn/chunks/{icons-DdrAicM2.js.map → icons-BKkJ-5xF.js.map} +1 -1
- package/dist/cdn/chunks/{keys-DXYJTLZF.js → keys-dJbD1QPs.js} +2 -2
- package/dist/cdn/chunks/{keys-DXYJTLZF.js.map → keys-dJbD1QPs.js.map} +1 -1
- package/dist/{nl-CReD7Apd.js → cdn/chunks/nl-D8y5OWGB.js} +11 -0
- package/dist/cdn/chunks/{nl-CReD7Apd.js.map → nl-D8y5OWGB.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-BRA0-vGP.js → pt-BR-DMCbUBvJ.js} +10 -1
- package/dist/cdn/chunks/{pt-BR-BRA0-vGP.js.map → pt-BR-DMCbUBvJ.js.map} +1 -1
- package/dist/cdn/chunks/socialIcons-9VrG8X3m.js +1054 -0
- package/dist/cdn/chunks/socialIcons-9VrG8X3m.js.map +1 -0
- package/dist/cdn/chunks/{src-fn7uy1FD.js → src-O5Sp_qJ7.js} +3 -3
- package/dist/cdn/chunks/{src-fn7uy1FD.js.map → src-O5Sp_qJ7.js.map} +1 -1
- package/dist/cdn/chunks/templateSettingsFields-YCFVBVYh.js +36 -0
- package/dist/cdn/chunks/templateSettingsFields-YCFVBVYh.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-Epe8m3Vo.js → tiptap-DhLuKyDc.js} +2776 -2773
- package/dist/cdn/chunks/tiptap-DhLuKyDc.js.map +1 -0
- package/dist/cdn/chunks/{useAliveFlag-CT9gjvO_.js → useAliveFlag-DAlQLbM2.js} +2 -2
- package/dist/cdn/chunks/{useAliveFlag-CT9gjvO_.js.map → useAliveFlag-DAlQLbM2.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-OezCj0cx.js → useCloudI18n-C09JcFS0.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-OezCj0cx.js.map → useCloudI18n-C09JcFS0.js.map} +1 -1
- package/dist/cdn/chunks/useEditorCore-BHmIp1hW.js +2592 -0
- package/dist/cdn/chunks/useEditorCore-BHmIp1hW.js.map +1 -0
- package/dist/cdn/chunks/useEditorRoot-DFx2fXJP.js +10 -0
- package/dist/cdn/chunks/{useEditorRoot-ByHPMqYT.js.map → useEditorRoot-DFx2fXJP.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-BhE7ndNr.js → useI18n-DTZ9sIcv.js} +3 -3
- package/dist/cdn/chunks/{useI18n-BhE7ndNr.js.map → useI18n-DTZ9sIcv.js.map} +1 -1
- package/dist/cdn/chunks/useLogicTag-E2V0Xdcb.js +38 -0
- package/dist/cdn/chunks/useLogicTag-E2V0Xdcb.js.map +1 -0
- package/dist/cdn/chunks/{useMergeTag-DE2mpy1w.js → useMergeTag-BE8oDoha.js} +3 -3
- package/dist/cdn/chunks/{useMergeTag-DE2mpy1w.js.map → useMergeTag-BE8oDoha.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-BPL891uG.js → usePopoverPosition-gB9q-ql7.js} +3 -3
- package/dist/cdn/chunks/{usePopoverPosition-BPL891uG.js.map → usePopoverPosition-gB9q-ql7.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-DwF4pVur.js → useScrollToBlock-CtTXwmiU.js} +3 -3
- package/dist/cdn/chunks/{useScrollToBlock-DwF4pVur.js.map → useScrollToBlock-CtTXwmiU.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +809 -3337
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-9xX6RVHz.js → check-eqb2JhqU.js} +1 -1
- package/dist/{chevron-down-J5hFJ6TL.js → chevron-down-Dkr-7Ywl.js} +1 -1
- package/dist/{chevron-right-BJuo5PQ-.js → chevron-right-Bge4XF_B.js} +1 -1
- package/dist/{chevron-up-Qfi5k52_.js → chevron-up-CQAyl0kC.js} +1 -1
- package/dist/{circle-alert-BiArYmkB.js → circle-alert-CYgTHKWr.js} +1 -1
- package/dist/{clock-BkYJZ7Y0.js → clock-BgSJZJP5.js} +1 -1
- package/dist/{cloud-DdidMW6f.js → cloud-C9xWZXhg.js} +1 -1
- package/dist/{copy-BRLUNHwF.js → copy-mw6PVnOJ.js} +1 -1
- package/dist/{createCloudRuntime-CNFXaTNQ.js → createCloudRuntime-BGd5--Bq.js} +5 -5
- package/dist/{createLucideIcon-CDDkF1Tm.js → createLucideIcon-BxY5yz5u.js} +6 -6
- package/dist/{cdn/chunks/de-Ck0pBGHu.js → de-xzrh9PA3.js} +9 -2
- package/dist/{dist-D8i1ixHK.js → dist-8VFzbeu9.js} +3 -3
- package/dist/{dist-DBirAJIs.js → dist-BDuPwOyn.js} +26 -21
- package/dist/{dist-CtF9STPS.js → dist-BJM3eFyT.js} +1 -1
- package/dist/{dist-DkcA6epL.js → dist-BdHF7nyq.js} +3 -3
- package/dist/{dist-ByT5fgKq.js → dist-Bl4rxpX9.js} +1 -1
- package/dist/{dist-BVqAYoRB.js → dist-BmsLcnrO.js} +4 -4
- package/dist/{dist-CtMXAH7a.js → dist-BxVnMgXZ.js} +1 -1
- package/dist/{dist-DC-3T0ED.js → dist-CQSVro7b.js} +1 -1
- package/dist/{dist-f7HXo6j6.js → dist-DQbOebGW.js} +1 -1
- package/dist/{dist-DL9334yz.js → dist-DerFNpDY.js} +3 -3
- package/dist/{dist-D08oVYhr.js → dist-Djmzp6wi.js} +1 -1
- package/dist/{dist-D7WY8VPq.js → dist-DyrEOKEJ.js} +1 -1
- package/dist/{dist-DzdeVn-W.js → dist-EDkj3Ub1.js} +1 -1
- package/dist/{dist-C1tsW_99.js → dist-wyXxj3R1.js} +1 -1
- package/dist/editor-modal-oD1qNz_P.js +2773 -0
- package/dist/en-CM5fTFSo.js +2 -0
- package/dist/{es-lagTvUfX.js → es-BT4LSpE2.js} +9 -0
- package/dist/extensions-DRN-elXT.js +1645 -0
- package/dist/{eye-DwhBOaV8.js → eye-DphkRtAD.js} +1 -1
- package/dist/{fr-C4hVl5Lk.js → fr-CI7OJoql.js} +9 -0
- package/dist/{image-up-CiyQNZBt.js → image-up-Qi2BXD7T.js} +1 -1
- package/dist/{info-D6A1qEiF.js → info-VSyAs02q.js} +1 -1
- package/dist/{keys-DD1rl72F.js → keys-BdoSgsz9.js} +1 -1
- package/dist/{link-tKGmYWsB.js → link-CNuozGqD.js} +1 -1
- package/dist/{list-DjZQRpeI.js → list-BA0I5Wmu.js} +1 -1
- package/dist/{loader-circle-D9ZL3Sv0.js → loader-circle-z5eeqasv.js} +1 -1
- package/dist/{message-circle-KTHxCcpB.js → message-circle-BsQ9hEup.js} +1 -1
- package/dist/{cdn/chunks/nl-CReD7Apd.js → nl-D8y5OWGB.js} +9 -2
- package/dist/package-OkXfuRoO.js +25 -0
- package/dist/{pencil-Bq-nbQ7F.js → pencil-DFVFA7Dj.js} +1 -1
- package/dist/{plus-CRMnR4IG.js → plus-D8bkVjZ7.js} +1 -1
- package/dist/{pt-BR-BRA0-vGP.js → pt-BR-DMCbUBvJ.js} +9 -0
- package/dist/{refresh-cw-D7bYS5tm.js → refresh-cw-DPB7YFuz.js} +1 -1
- package/dist/{runtime-dom.esm-bundler-PnoZU512.js → runtime-dom.esm-bundler-BGbPz4-g.js} +2 -2
- package/dist/{search-DUo0YwPz.js → search-C-dCgqIa.js} +1 -1
- package/dist/{send-DaVMQphu.js → send-Cm2fy2zm.js} +1 -1
- package/dist/{shield-check-DxaaurL9.js → shield-check-COgBYFDF.js} +1 -1
- package/dist/smartphone-v0u_MOEV.js +46 -0
- package/dist/socialIcons-DkGcpEwC.js +1130 -0
- package/dist/{sparkles-D6T6k30e.js → sparkles-Ds0RF8Iu.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templateSettingsFields-YCFVBVYh.js +34 -0
- package/dist/templatical-editor.js +895 -3498
- package/dist/{text-align-start-vreFpmCX.js → text-align-start-DiavaIm6.js} +1 -1
- package/dist/{trash-DBv8MGY6.js → trash-DnOkfu2V.js} +1 -1
- package/dist/{triangle-alert-CmNS2LLv.js → triangle-alert-DGLAyXnh.js} +1 -1
- package/dist/{upload-DDB9Fs0P.js → upload-BBDme2cy.js} +1 -1
- package/dist/{useAliveFlag-oyByIcjy.js → useAliveFlag-BkKyhkwZ.js} +1 -1
- package/dist/{useCloudI18n-C1wuXik6.js → useCloudI18n-D1iedlP3.js} +2 -2
- package/dist/{useEditorCore-jfwgLThK.js → useEditorCore-C5APBjjV.js} +1140 -2325
- package/dist/{useEditorRoot-eVv4doqZ.js → useEditorRoot-BOxn5EfP.js} +2 -2
- package/dist/{useI18n-VOtdfENx.js → useI18n-Ds_-druD.js} +2 -2
- package/dist/useLogicTag-DoHfc08B.js +36 -0
- package/dist/{useMergeTag-CQM9pFca.js → useMergeTag-DXyum3kG.js} +2 -2
- package/dist/{usePopoverPosition-gZjRywai.js → usePopoverPosition-Du-Ah8E9.js} +2 -2
- package/dist/{useScrollToBlock-C0Ehnyl4.js → useScrollToBlock-DXQYPCnJ.js} +3 -3
- package/dist/{vue.runtime.esm-bundler-DShF3P6k.js → vue.runtime.esm-bundler-CyqhBwpY.js} +1133 -1126
- package/dist/{x-B7sgO_z8.js → x-3BHV3Q6K.js} +1 -1
- package/package.json +14 -14
- package/dist/ColorPicker-BTtN94te.js +0 -501
- package/dist/FieldRow-C8nOknr_.js +0 -128
- package/dist/MergeTagInput-Cw1RoMly.js +0 -509
- package/dist/MergeTagSuggestion-BXO3UIXW.js +0 -1329
- package/dist/cdn/chunks/ColorPicker-BaonTCAQ.js +0 -502
- package/dist/cdn/chunks/ColorPicker-BaonTCAQ.js.map +0 -1
- package/dist/cdn/chunks/FieldRow-D9OJhYeb.js +0 -130
- package/dist/cdn/chunks/FieldRow-D9OJhYeb.js.map +0 -1
- package/dist/cdn/chunks/MergeTagInput-CSIThqkz.js +0 -470
- package/dist/cdn/chunks/MergeTagInput-CSIThqkz.js.map +0 -1
- package/dist/cdn/chunks/MergeTagSuggestion-CY6WK8Eb.js +0 -215
- package/dist/cdn/chunks/MergeTagSuggestion-CY6WK8Eb.js.map +0 -1
- package/dist/cdn/chunks/dist-BW6Y49zE.js.map +0 -1
- package/dist/cdn/chunks/dist-CAFTQ6Y2.js.map +0 -1
- package/dist/cdn/chunks/draggable-kbOhCgnk.js.map +0 -1
- package/dist/cdn/chunks/editor-modal-B6IdQWlf.js +0 -5908
- package/dist/cdn/chunks/editor-modal-B6IdQWlf.js.map +0 -1
- package/dist/cdn/chunks/en-DjunooBz.js +0 -2
- package/dist/cdn/chunks/extensions-D2YIhF7u.js.map +0 -1
- package/dist/cdn/chunks/tiptap-Epe8m3Vo.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-06PtcUi1.js +0 -3698
- package/dist/cdn/chunks/useEditorCore-06PtcUi1.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-ByHPMqYT.js +0 -10
- package/dist/editor-modal-uAEB6xKz.js +0 -5998
- package/dist/en-CQWkDCpm.js +0 -2
- package/dist/extensions-CcGj7OfS.js +0 -470
|
@@ -0,0 +1,2592 @@
|
|
|
1
|
+
import { A as e, B as t, E as n, F as r, H as i, I as a, K as o, N as s, P as c, Q as l, R as u, S as d, U as f, X as p, Y as m, at as h, b as g, c as _, ct as v, et as y, f as b, g as x, h as S, it as C, j as w, k as T, l as E, lt as D, m as O, p as k, q as A, rt as j, s as M, t as N, u as P, ut as F, w as I, x as L, y as R } from "./draggable-IB4x6w2O.js";
|
|
2
|
+
import { A as z, B, C as V, D as H, E as ee, F as te, H as U, I as ne, M as re, N as ie, O as ae, P as oe, R as se, T as ce, V as le, W as ue, _ as de, a as fe, b as pe, d as me, f as he, g as ge, h as _e, i as W, it as ve, j as ye, k as be, l as xe, m as Se, n as Ce, o as we, p as Te, r as Ee, rt as De, s as Oe, u as ke, w as Ae } from "./src-Dwgq7hf4.js";
|
|
3
|
+
import { a as je, b as Me, g as Ne, h as Pe, i as Fe, m as Ie, n as Le, o as Re, t as ze, v as Be, y as Ve } from "./socialIcons-9VrG8X3m.js";
|
|
4
|
+
import { _ as He, h as Ue, v as We, y as Ge } from "./dist-BRZhN8qJ.js";
|
|
5
|
+
import { a as G, c as Ke, i as qe } from "./dist-CXB2_kBa.js";
|
|
6
|
+
import { A as Je, B as Ye, C as Xe, D as K, E as Ze, F as Qe, G as $e, I as et, J as tt, K as nt, L as rt, M as it, N as at, O as ot, P as q, R as st, S as ct, T as lt, V as ut, W as dt, X as J, Y as ft, Z as pt, _ as mt, a as ht, b as gt, c as _t, d as vt, f as yt, g as Y, h as bt, j as xt, k as St, l as Ct, m as wt, n as Tt, o as Et, p as Dt, q as Ot, r as kt, s as At, v as jt, w as Mt, x as Nt, y as Pt, z as Ft } from "./keys-dJbD1QPs.js";
|
|
7
|
+
import "./timeouts-DHPZQ0G3.js";
|
|
8
|
+
import { t as X } from "./useI18n-DTZ9sIcv.js";
|
|
9
|
+
import { t as Z } from "./logger-ByvdoAwq.js";
|
|
10
|
+
import { i as It, o as Lt, r as Rt, t as zt } from "./usePopoverPosition-gB9q-ql7.js";
|
|
11
|
+
import { r as Bt, t as Vt } from "./templateSettingsFields-YCFVBVYh.js";
|
|
12
|
+
import { A as Ht, Bt as Ut, Et as Wt, H as Gt, Ot as Kt, Tt as qt, X as Jt, d as Yt, ft as Xt, ht as Zt, it as Qt, o as $t, s as en, tt as tn, u as nn, v as rn, vt as an, zt as on } from "./icons-BKkJ-5xF.js";
|
|
13
|
+
import { t as sn } from "./LoadingTrack-Ba5xh5HD.js";
|
|
14
|
+
import { t as cn } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
15
|
+
import { t as ln } from "./useEditorRoot-DFx2fXJP.js";
|
|
16
|
+
import "./useCloudI18n-C09JcFS0.js";
|
|
17
|
+
import { t as un } from "./useMergeTag-BE8oDoha.js";
|
|
18
|
+
import { t as dn } from "./useLogicTag-E2V0Xdcb.js";
|
|
19
|
+
import { t as fn } from "./useAliveFlag-DAlQLbM2.js";
|
|
20
|
+
//#region src/utils/activeEditorTracker.ts
|
|
21
|
+
var pn = /* @__PURE__ */ new Set(), Q = 0, mn = 0;
|
|
22
|
+
function hn() {
|
|
23
|
+
let e = ++mn;
|
|
24
|
+
return pn.add(e), Q === 0 && (Q = e), {
|
|
25
|
+
id: e,
|
|
26
|
+
isActive: () => pn.size <= 1 || Q === e,
|
|
27
|
+
claim: () => {
|
|
28
|
+
Q = e;
|
|
29
|
+
},
|
|
30
|
+
dispose: () => {
|
|
31
|
+
if (pn.delete(e), Q === e) {
|
|
32
|
+
let e = Array.from(pn);
|
|
33
|
+
Q = e[e.length - 1] ?? 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/composables/usePreviewResolution.ts
|
|
40
|
+
var gn = 500;
|
|
41
|
+
function _n(e) {
|
|
42
|
+
let n = typeof e.resolvePreview == "function", r = l(null), i = l(!1), a = l(!1), o = 0, s = null;
|
|
43
|
+
function c() {
|
|
44
|
+
s !== null && (clearTimeout(s), s = null);
|
|
45
|
+
}
|
|
46
|
+
async function u() {
|
|
47
|
+
let t = e.resolvePreview;
|
|
48
|
+
if (!t) return;
|
|
49
|
+
let n = ++o;
|
|
50
|
+
i.value = !0;
|
|
51
|
+
let s = {
|
|
52
|
+
content: pe(e.getContent()),
|
|
53
|
+
...e.getRecipient?.() === void 0 ? {} : { recipient: e.getRecipient() }
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
let e = await t(s);
|
|
57
|
+
if (n !== o) return;
|
|
58
|
+
if (!Ce(e)) {
|
|
59
|
+
a.value = !0;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
r.value = e, a.value = !1;
|
|
63
|
+
} catch {
|
|
64
|
+
if (n !== o) return;
|
|
65
|
+
a.value = !0;
|
|
66
|
+
} finally {
|
|
67
|
+
n === o && (i.value = !1);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function d() {
|
|
71
|
+
if (n) {
|
|
72
|
+
if (c(), r.value === null) {
|
|
73
|
+
u();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
s = setTimeout(() => {
|
|
77
|
+
s = null, u();
|
|
78
|
+
}, gn);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return t(() => [e.isActive(), e.getRecipient?.()], ([e]) => {
|
|
82
|
+
if (!e) {
|
|
83
|
+
c(), o++, i.value = !1, r.value = null, a.value = !1;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
d();
|
|
87
|
+
}, { immediate: !0 }), m(() => {
|
|
88
|
+
c(), o++;
|
|
89
|
+
}), {
|
|
90
|
+
isConfigured: n,
|
|
91
|
+
content: b(() => r.value ?? e.getContent()),
|
|
92
|
+
isResolving: i,
|
|
93
|
+
isInitialResolve: b(() => i.value && r.value === null),
|
|
94
|
+
hasFailed: a,
|
|
95
|
+
supersedesSamples: b(() => n)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/composables/useImageUrlResolver.ts
|
|
100
|
+
function vn(e) {
|
|
101
|
+
let t = p(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
102
|
+
function r(e) {
|
|
103
|
+
return t.get(e);
|
|
104
|
+
}
|
|
105
|
+
function i(e) {
|
|
106
|
+
return t.has(e) || n.has(e);
|
|
107
|
+
}
|
|
108
|
+
function a(r) {
|
|
109
|
+
if (i(r)) return;
|
|
110
|
+
let a;
|
|
111
|
+
try {
|
|
112
|
+
a = e(r);
|
|
113
|
+
} catch {
|
|
114
|
+
t.set(r, null);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (a === null || typeof a == "string") {
|
|
118
|
+
t.set(r, a);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
n.add(r), Promise.resolve(a).then((e) => {
|
|
122
|
+
t.set(r, typeof e == "string" ? e : null);
|
|
123
|
+
}, () => {
|
|
124
|
+
t.set(r, null);
|
|
125
|
+
}).finally(() => n.delete(r));
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
get: r,
|
|
129
|
+
has: i,
|
|
130
|
+
lookup: a
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function yn(e) {
|
|
134
|
+
let r = n(Nt, null), i = b(e);
|
|
135
|
+
if (!r) return i;
|
|
136
|
+
let a;
|
|
137
|
+
function s() {
|
|
138
|
+
a !== void 0 && (clearTimeout(a), a = void 0);
|
|
139
|
+
}
|
|
140
|
+
o() && m(s);
|
|
141
|
+
let c = !0;
|
|
142
|
+
return t(i, (e) => {
|
|
143
|
+
s();
|
|
144
|
+
let t = c;
|
|
145
|
+
if (c = !1, e && !r.has(e)) {
|
|
146
|
+
if (t) {
|
|
147
|
+
r.lookup(e);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
a = setTimeout(() => {
|
|
151
|
+
a = void 0, r.lookup(e);
|
|
152
|
+
}, 300);
|
|
153
|
+
}
|
|
154
|
+
}, { immediate: !0 }), b(() => {
|
|
155
|
+
let e = i.value;
|
|
156
|
+
if (!e) return e;
|
|
157
|
+
let t = r.get(e);
|
|
158
|
+
return typeof t == "string" && t.length > 0 ? t : e;
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/composables/useMergeTagPicker.ts
|
|
163
|
+
function bn() {
|
|
164
|
+
let e = l(!1), t = l([]), n = l(null), r = null;
|
|
165
|
+
function i(i, a) {
|
|
166
|
+
if (r) {
|
|
167
|
+
let e = r;
|
|
168
|
+
r = null, e(null);
|
|
169
|
+
}
|
|
170
|
+
return t.value = i, n.value = a?.current ?? null, e.value = !0, new Promise((e) => {
|
|
171
|
+
r = e;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function a(i) {
|
|
175
|
+
let a = r;
|
|
176
|
+
r = null, e.value = !1, t.value = [], n.value = null, a && a(i);
|
|
177
|
+
}
|
|
178
|
+
return o() && m(() => {
|
|
179
|
+
if (r) {
|
|
180
|
+
let e = r;
|
|
181
|
+
r = null, e(null);
|
|
182
|
+
}
|
|
183
|
+
e.value = !1, t.value = [], n.value = null;
|
|
184
|
+
}), {
|
|
185
|
+
isOpen: e,
|
|
186
|
+
tags: t,
|
|
187
|
+
current: n,
|
|
188
|
+
open: i,
|
|
189
|
+
resolve: a
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/composables/useLogicTagPicker.ts
|
|
194
|
+
function xn() {
|
|
195
|
+
let e = l(!1), t = l([]), n = l([]), r = null;
|
|
196
|
+
function i(i, a) {
|
|
197
|
+
if (r) {
|
|
198
|
+
let e = r;
|
|
199
|
+
r = null, e(null);
|
|
200
|
+
}
|
|
201
|
+
return t.value = i, n.value = a, e.value = !0, new Promise((e) => {
|
|
202
|
+
r = e;
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
function a(i) {
|
|
206
|
+
let a = r;
|
|
207
|
+
r = null, e.value = !1, t.value = [], n.value = [], a && a(i);
|
|
208
|
+
}
|
|
209
|
+
return o() && m(() => {
|
|
210
|
+
if (r) {
|
|
211
|
+
let e = r;
|
|
212
|
+
r = null, e(null);
|
|
213
|
+
}
|
|
214
|
+
e.value = !1, t.value = [], n.value = [];
|
|
215
|
+
}), {
|
|
216
|
+
isOpen: e,
|
|
217
|
+
tags: t,
|
|
218
|
+
pairs: n,
|
|
219
|
+
open: i,
|
|
220
|
+
resolve: a
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/composables/useTemplateLint.ts
|
|
225
|
+
function Sn(e) {
|
|
226
|
+
return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 : !1;
|
|
227
|
+
}
|
|
228
|
+
function Cn(e) {
|
|
229
|
+
let n = l([]), r = l(!1), i = l(!1), a = y(null), o = Sn(e.options), s = null, c = !1;
|
|
230
|
+
o || u();
|
|
231
|
+
async function u() {
|
|
232
|
+
try {
|
|
233
|
+
let t = await import("./src-CaNsA_WX.js");
|
|
234
|
+
if (c) return;
|
|
235
|
+
a.value = { lintTemplate: t.lintTemplate }, r.value = !0, d(), s = Ge(e.content, d, {
|
|
236
|
+
debounce: e.debounce ?? 500,
|
|
237
|
+
deep: !0
|
|
238
|
+
});
|
|
239
|
+
} catch {
|
|
240
|
+
if (c) return;
|
|
241
|
+
i.value = !0;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function d() {
|
|
245
|
+
a.value && (n.value = a.value.lintTemplate(e.content.value, e.options));
|
|
246
|
+
}
|
|
247
|
+
let f = t(() => e.options, () => {
|
|
248
|
+
a.value && d();
|
|
249
|
+
}, { deep: !0 });
|
|
250
|
+
function p(t) {
|
|
251
|
+
t.fix && t.fix.apply({
|
|
252
|
+
updateBlock: e.updateBlock,
|
|
253
|
+
updateSettings: e.updateSettings,
|
|
254
|
+
removeBlock: e.removeBlock
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
function m() {
|
|
258
|
+
c = !0, s?.(), f();
|
|
259
|
+
}
|
|
260
|
+
return {
|
|
261
|
+
issues: n,
|
|
262
|
+
ready: r,
|
|
263
|
+
unavailable: i,
|
|
264
|
+
applyFix: p,
|
|
265
|
+
destroy: m
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
//#endregion
|
|
269
|
+
//#region src/composables/useKeyboardReorder.ts
|
|
270
|
+
function wn(e, t, n = []) {
|
|
271
|
+
let r = l(null), i = l(""), a = null;
|
|
272
|
+
function o(t) {
|
|
273
|
+
let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
|
|
274
|
+
if (r !== -1) return {
|
|
275
|
+
index: r,
|
|
276
|
+
total: n.length
|
|
277
|
+
};
|
|
278
|
+
for (let e of n) {
|
|
279
|
+
if (e.type !== "section") continue;
|
|
280
|
+
let n = e;
|
|
281
|
+
for (let e = 0; e < n.children.length; e++) {
|
|
282
|
+
let r = n.children[e], i = r.findIndex((e) => e.id === t);
|
|
283
|
+
if (i !== -1) return {
|
|
284
|
+
index: i,
|
|
285
|
+
total: r.length,
|
|
286
|
+
sectionId: n.id,
|
|
287
|
+
columnIndex: e
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
function s(r) {
|
|
294
|
+
let i = o(r);
|
|
295
|
+
if (!i) return "";
|
|
296
|
+
let a = (i.sectionId ? c(i.sectionId, i.columnIndex ?? 0) : e.content.value.blocks)?.[i.index];
|
|
297
|
+
return a ? Re(a, t.t, n) : "";
|
|
298
|
+
}
|
|
299
|
+
function c(t, n) {
|
|
300
|
+
return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
|
|
301
|
+
}
|
|
302
|
+
function u(e) {
|
|
303
|
+
i.value = "", queueMicrotask(() => {
|
|
304
|
+
i.value = e;
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
function d(e) {
|
|
308
|
+
return r.value === e;
|
|
309
|
+
}
|
|
310
|
+
function f(e) {
|
|
311
|
+
let n = o(e);
|
|
312
|
+
n && (r.value = e, a = n, u(t.format(t.t.blockActions.lifted, {
|
|
313
|
+
block: s(e),
|
|
314
|
+
position: String(n.index + 1),
|
|
315
|
+
total: String(n.total)
|
|
316
|
+
})));
|
|
317
|
+
}
|
|
318
|
+
function p(n, r) {
|
|
319
|
+
let i = o(n);
|
|
320
|
+
if (!i) return;
|
|
321
|
+
let a = i.index + r;
|
|
322
|
+
a < 0 || a >= i.total || (e.moveBlock(n, a, i.sectionId, i.columnIndex), u(t.format(t.t.blockActions.moved, {
|
|
323
|
+
block: s(n),
|
|
324
|
+
position: String(a + 1),
|
|
325
|
+
total: String(i.total)
|
|
326
|
+
})));
|
|
327
|
+
}
|
|
328
|
+
function m(e) {
|
|
329
|
+
p(e, -1);
|
|
330
|
+
}
|
|
331
|
+
function h(e) {
|
|
332
|
+
p(e, 1);
|
|
333
|
+
}
|
|
334
|
+
function g(e) {
|
|
335
|
+
let n = o(e);
|
|
336
|
+
n && u(t.format(t.t.blockActions.dropped, {
|
|
337
|
+
block: s(e),
|
|
338
|
+
position: String(n.index + 1),
|
|
339
|
+
total: String(n.total)
|
|
340
|
+
})), r.value = null, a = null;
|
|
341
|
+
}
|
|
342
|
+
function _() {
|
|
343
|
+
let n = r.value;
|
|
344
|
+
if (n && a) {
|
|
345
|
+
let r = o(n);
|
|
346
|
+
r && (r && (r.sectionId !== a.sectionId || r.columnIndex !== a.columnIndex) || r && r.index !== a.index) && e.moveBlock(n, a.index, a.sectionId, a.columnIndex), u(t.format(t.t.blockActions.cancelled, {
|
|
347
|
+
block: s(n),
|
|
348
|
+
position: String(a.index + 1)
|
|
349
|
+
}));
|
|
350
|
+
}
|
|
351
|
+
r.value = null, a = null;
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
354
|
+
liftedBlockId: r,
|
|
355
|
+
announcement: i,
|
|
356
|
+
isLifted: d,
|
|
357
|
+
lift: f,
|
|
358
|
+
cancel: _,
|
|
359
|
+
moveUp: m,
|
|
360
|
+
moveDown: h,
|
|
361
|
+
drop: g
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/composables/useUiTheme.ts
|
|
366
|
+
function Tn(e) {
|
|
367
|
+
let t = Ke("(prefers-color-scheme: dark)");
|
|
368
|
+
return { resolvedTheme: b(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
|
|
369
|
+
}
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region src/composables/useThemeStyles.ts
|
|
372
|
+
var En = {
|
|
373
|
+
bg: "--tpl-bg",
|
|
374
|
+
bgElevated: "--tpl-bg-elevated",
|
|
375
|
+
bgHover: "--tpl-bg-hover",
|
|
376
|
+
bgActive: "--tpl-bg-active",
|
|
377
|
+
border: "--tpl-border",
|
|
378
|
+
borderLight: "--tpl-border-light",
|
|
379
|
+
text: "--tpl-text",
|
|
380
|
+
textMuted: "--tpl-text-muted",
|
|
381
|
+
textDim: "--tpl-text-dim",
|
|
382
|
+
primary: "--tpl-primary",
|
|
383
|
+
primaryHover: "--tpl-primary-hover",
|
|
384
|
+
primaryLight: "--tpl-primary-light",
|
|
385
|
+
secondary: "--tpl-secondary",
|
|
386
|
+
secondaryHover: "--tpl-secondary-hover",
|
|
387
|
+
secondaryLight: "--tpl-secondary-light",
|
|
388
|
+
success: "--tpl-success",
|
|
389
|
+
successLight: "--tpl-success-light",
|
|
390
|
+
warning: "--tpl-warning",
|
|
391
|
+
warningLight: "--tpl-warning-light",
|
|
392
|
+
danger: "--tpl-danger",
|
|
393
|
+
dangerLight: "--tpl-danger-light",
|
|
394
|
+
canvasBg: "--tpl-canvas-bg"
|
|
395
|
+
};
|
|
396
|
+
function Dn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
397
|
+
return { themeStyles: b(() => {
|
|
398
|
+
let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
|
|
399
|
+
if (a) for (let [e, t] of Object.entries(En)) {
|
|
400
|
+
let n = a[e];
|
|
401
|
+
n && (r[t] = n);
|
|
402
|
+
}
|
|
403
|
+
return n && Object.assign(r, n()), r;
|
|
404
|
+
}) };
|
|
405
|
+
}
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region src/composables/useBlockRegistry.ts
|
|
408
|
+
function On() {
|
|
409
|
+
let e = y(/* @__PURE__ */ new Map());
|
|
410
|
+
function t(t, n) {
|
|
411
|
+
e.value.set(t, n), C(e);
|
|
412
|
+
}
|
|
413
|
+
function n(t, n) {
|
|
414
|
+
let r = `custom:${t.type}`;
|
|
415
|
+
e.value.set(r, {
|
|
416
|
+
component: n,
|
|
417
|
+
createBlock: () => ce(t),
|
|
418
|
+
definition: t
|
|
419
|
+
}), C(e);
|
|
420
|
+
}
|
|
421
|
+
function r(t) {
|
|
422
|
+
if (t.type === "custom") {
|
|
423
|
+
let n = `custom:${t.customType}`;
|
|
424
|
+
return e.value.get(n)?.component;
|
|
425
|
+
}
|
|
426
|
+
return e.value.get(t.type)?.component;
|
|
427
|
+
}
|
|
428
|
+
function i(t) {
|
|
429
|
+
return e.value.get(t)?.createBlock();
|
|
430
|
+
}
|
|
431
|
+
function a(t) {
|
|
432
|
+
let n = `custom:${t}`;
|
|
433
|
+
return e.value.get(n)?.definition;
|
|
434
|
+
}
|
|
435
|
+
function o(e) {
|
|
436
|
+
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>`;
|
|
437
|
+
}
|
|
438
|
+
async function s(e) {
|
|
439
|
+
let t = a(e.customType);
|
|
440
|
+
if (!t) return o("Block definition not found");
|
|
441
|
+
try {
|
|
442
|
+
let { Liquid: n } = await import("./liquid.browser-BypTT2oc.js");
|
|
443
|
+
return await new n({
|
|
444
|
+
strictVariables: !1,
|
|
445
|
+
strictFilters: !1
|
|
446
|
+
}).parseAndRender(t.template, e.fieldValues);
|
|
447
|
+
} catch (t) {
|
|
448
|
+
return Z.error(`Failed to render custom block "${e.customType}":`, t), o(`Render error: ${e.customType}`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function c(t) {
|
|
452
|
+
return e.value.has(t);
|
|
453
|
+
}
|
|
454
|
+
return {
|
|
455
|
+
registerBuiltIn: t,
|
|
456
|
+
registerCustom: n,
|
|
457
|
+
getComponent: r,
|
|
458
|
+
createBlock: i,
|
|
459
|
+
getDefinition: a,
|
|
460
|
+
renderCustomBlock: s,
|
|
461
|
+
isRegistered: c
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/composables/useCustomBlockStylesheets.ts
|
|
466
|
+
function kn(e, t) {
|
|
467
|
+
return b(() => {
|
|
468
|
+
let n = An(e.value.blocks);
|
|
469
|
+
if (n.size === 0) return [];
|
|
470
|
+
let r = /* @__PURE__ */ new Set(), i = [];
|
|
471
|
+
for (let e of n) {
|
|
472
|
+
let n = t.getDefinition(e)?.stylesheet;
|
|
473
|
+
if (!n) continue;
|
|
474
|
+
let a = n.trim();
|
|
475
|
+
a === "" || r.has(a) || (r.add(a), i.push(a));
|
|
476
|
+
}
|
|
477
|
+
return i;
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
function An(e) {
|
|
481
|
+
let t = /* @__PURE__ */ new Set();
|
|
482
|
+
return jn(e, t), t;
|
|
483
|
+
}
|
|
484
|
+
function jn(e, t) {
|
|
485
|
+
for (let n of e) {
|
|
486
|
+
if (ue(n)) {
|
|
487
|
+
t.add(n.customType);
|
|
488
|
+
continue;
|
|
489
|
+
}
|
|
490
|
+
if (n.type === "section") {
|
|
491
|
+
let e = n.children;
|
|
492
|
+
if (!e) continue;
|
|
493
|
+
for (let n of e) jn(n, t);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region src/utils/registerBuiltInBlocks.ts
|
|
499
|
+
var Mn = [
|
|
500
|
+
{
|
|
501
|
+
type: "section",
|
|
502
|
+
createBlock: ye
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
type: "title",
|
|
506
|
+
createBlock: te
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
type: "paragraph",
|
|
510
|
+
createBlock: z
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
type: "image",
|
|
514
|
+
createBlock: ae
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
type: "button",
|
|
518
|
+
createBlock: V
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
type: "divider",
|
|
522
|
+
createBlock: ee
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
type: "video",
|
|
526
|
+
createBlock: ne
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
type: "social",
|
|
530
|
+
createBlock: re
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
type: "menu",
|
|
534
|
+
createBlock: be
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
type: "table",
|
|
538
|
+
createBlock: oe
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
type: "spacer",
|
|
542
|
+
createBlock: ie
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
type: "html",
|
|
546
|
+
createBlock: H
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
type: "countdown",
|
|
550
|
+
createBlock: Ae
|
|
551
|
+
}
|
|
552
|
+
];
|
|
553
|
+
function Nn(e, t) {
|
|
554
|
+
for (let n of Mn) {
|
|
555
|
+
let r = t[n.type];
|
|
556
|
+
r && e.registerBuiltIn(n.type, {
|
|
557
|
+
component: r,
|
|
558
|
+
createBlock: n.createBlock
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
//#endregion
|
|
563
|
+
//#region src/utils/resolveHtmlBlockPreview.ts
|
|
564
|
+
function Pn(e) {
|
|
565
|
+
return typeof e == "boolean" ? e : e?.enabled ?? !1;
|
|
566
|
+
}
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/utils/collectOffPaletteDefaults.ts
|
|
569
|
+
function Fn(e) {
|
|
570
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
571
|
+
}
|
|
572
|
+
function In(e, t, n) {
|
|
573
|
+
let r = new Set(e.map((e) => Rt(e))), i = [], a = (e, t) => {
|
|
574
|
+
for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(Rt(o)) && i.push(`${t}.${n}: ${o}`) : Fn(o) && a(o, `${t}.${n}`);
|
|
575
|
+
}, o = t;
|
|
576
|
+
for (let [e, t] of Object.entries(B)) {
|
|
577
|
+
let n = o?.[e];
|
|
578
|
+
a({
|
|
579
|
+
...t,
|
|
580
|
+
...Fn(n) ? n : {}
|
|
581
|
+
}, e);
|
|
582
|
+
}
|
|
583
|
+
return a({
|
|
584
|
+
...le,
|
|
585
|
+
...n ?? {}
|
|
586
|
+
}, "template"), i;
|
|
587
|
+
}
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region src/utils/localizedBlockDefaults.ts
|
|
590
|
+
function Ln(e) {
|
|
591
|
+
return {
|
|
592
|
+
title: { content: `<p>${e.blockDefaults.title}</p>` },
|
|
593
|
+
paragraph: { content: `<p>${e.blockDefaults.paragraph}</p>` },
|
|
594
|
+
button: { text: e.blockDefaults.button }
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
//#endregion
|
|
598
|
+
//#region src/i18n/index.ts
|
|
599
|
+
var Rn = /* #__PURE__ */ Object.assign({
|
|
600
|
+
"./locales/ca.ts": () => import("./ca-YlPDhElv.js"),
|
|
601
|
+
"./locales/de.ts": () => import("./de-CONjnzrF.js"),
|
|
602
|
+
"./locales/en.ts": () => import("./en-BAMooiOF.js"),
|
|
603
|
+
"./locales/es.ts": () => import("./es-I47lHs2m.js"),
|
|
604
|
+
"./locales/fr.ts": () => import("./fr-B8MIKjT4.js"),
|
|
605
|
+
"./locales/nl.ts": () => import("./nl-CBLxcb-0.js"),
|
|
606
|
+
"./locales/pt-BR.ts": () => import("./pt-BR-CMSRfX7t.js")
|
|
607
|
+
}), zn = /* #__PURE__ */ Object.assign({
|
|
608
|
+
"./locales/cloud/de.ts": () => import("./de-BytZwgn6.js"),
|
|
609
|
+
"./locales/cloud/en.ts": () => import("./en-DyOSV0lY.js"),
|
|
610
|
+
"./locales/cloud/pt-BR.ts": () => import("./pt-BR-C1WLSGDh.js")
|
|
611
|
+
});
|
|
612
|
+
function Bn(e) {
|
|
613
|
+
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
614
|
+
}
|
|
615
|
+
var Vn = Bn(Rn), Hn = Bn(zn);
|
|
616
|
+
function Un(e) {
|
|
617
|
+
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
618
|
+
}
|
|
619
|
+
function Wn(e, t) {
|
|
620
|
+
let n = Un(e);
|
|
621
|
+
return t.find((e) => Un(e) === n);
|
|
622
|
+
}
|
|
623
|
+
function Gn(e) {
|
|
624
|
+
return Un(e).split("-")[0];
|
|
625
|
+
}
|
|
626
|
+
function Kn(e, t) {
|
|
627
|
+
return Wn(e, t) ?? Wn(Gn(e), t);
|
|
628
|
+
}
|
|
629
|
+
function qn(e, t) {
|
|
630
|
+
return Kn(e, t) ?? "en";
|
|
631
|
+
}
|
|
632
|
+
async function Jn(e) {
|
|
633
|
+
let t = Rn[`./locales/${qn(e, Vn)}.ts`];
|
|
634
|
+
return (await t()).default;
|
|
635
|
+
}
|
|
636
|
+
async function Yn(e) {
|
|
637
|
+
let t = zn[`./locales/cloud/${qn(e, Hn)}.ts`];
|
|
638
|
+
return (await t()).default;
|
|
639
|
+
}
|
|
640
|
+
function Xn(e) {
|
|
641
|
+
return Kn(e, Vn) !== void 0;
|
|
642
|
+
}
|
|
643
|
+
function Zn(e) {
|
|
644
|
+
return Kn(e, Hn) !== void 0;
|
|
645
|
+
}
|
|
646
|
+
function Qn() {
|
|
647
|
+
return [...Vn];
|
|
648
|
+
}
|
|
649
|
+
function $n() {
|
|
650
|
+
return [...Hn];
|
|
651
|
+
}
|
|
652
|
+
//#endregion
|
|
653
|
+
//#region src/i18n/contentDefaults.ts
|
|
654
|
+
var $ = {
|
|
655
|
+
en: {
|
|
656
|
+
video: "Video",
|
|
657
|
+
days: "Days",
|
|
658
|
+
hours: "Hours",
|
|
659
|
+
minutes: "Minutes",
|
|
660
|
+
seconds: "Seconds",
|
|
661
|
+
expired: "This offer has expired"
|
|
662
|
+
},
|
|
663
|
+
de: {
|
|
664
|
+
video: "Video",
|
|
665
|
+
days: "Tage",
|
|
666
|
+
hours: "Stunden",
|
|
667
|
+
minutes: "Minuten",
|
|
668
|
+
seconds: "Sekunden",
|
|
669
|
+
expired: "Dieses Angebot ist abgelaufen"
|
|
670
|
+
},
|
|
671
|
+
es: {
|
|
672
|
+
video: "Vídeo",
|
|
673
|
+
days: "Días",
|
|
674
|
+
hours: "Horas",
|
|
675
|
+
minutes: "Minutos",
|
|
676
|
+
seconds: "Segundos",
|
|
677
|
+
expired: "Esta oferta ha expirado"
|
|
678
|
+
},
|
|
679
|
+
fr: {
|
|
680
|
+
video: "Vidéo",
|
|
681
|
+
days: "Jours",
|
|
682
|
+
hours: "Heures",
|
|
683
|
+
minutes: "Minutes",
|
|
684
|
+
seconds: "Secondes",
|
|
685
|
+
expired: "Cette offre a expiré"
|
|
686
|
+
},
|
|
687
|
+
nl: {
|
|
688
|
+
video: "Video",
|
|
689
|
+
days: "Dagen",
|
|
690
|
+
hours: "Uren",
|
|
691
|
+
minutes: "Minuten",
|
|
692
|
+
seconds: "Seconden",
|
|
693
|
+
expired: "Deze aanbieding is verlopen"
|
|
694
|
+
},
|
|
695
|
+
"pt-BR": {
|
|
696
|
+
video: "Vídeo",
|
|
697
|
+
days: "Dias",
|
|
698
|
+
hours: "Horas",
|
|
699
|
+
minutes: "Minutos",
|
|
700
|
+
seconds: "Segundos",
|
|
701
|
+
expired: "Esta oferta expirou"
|
|
702
|
+
},
|
|
703
|
+
ca: {
|
|
704
|
+
video: "Vídeo",
|
|
705
|
+
days: "Dies",
|
|
706
|
+
hours: "Hores",
|
|
707
|
+
minutes: "Minuts",
|
|
708
|
+
seconds: "Segons",
|
|
709
|
+
expired: "Aquesta oferta ha caducat"
|
|
710
|
+
}
|
|
711
|
+
}, er = new Map(Object.keys($).map((e) => [e.toLowerCase(), e]));
|
|
712
|
+
function tr(e) {
|
|
713
|
+
if (!e) return $.en;
|
|
714
|
+
let t = e.trim().replace(/_/g, "-").toLowerCase(), n = er.get(t);
|
|
715
|
+
if (n) return $[n];
|
|
716
|
+
let r = er.get(Gn(t));
|
|
717
|
+
return r ? $[r] : $.en;
|
|
718
|
+
}
|
|
719
|
+
function nr(e) {
|
|
720
|
+
let t = tr(e);
|
|
721
|
+
return {
|
|
722
|
+
video: { alt: t.video },
|
|
723
|
+
countdown: {
|
|
724
|
+
labelDays: t.days,
|
|
725
|
+
labelHours: t.hours,
|
|
726
|
+
labelMinutes: t.minutes,
|
|
727
|
+
labelSeconds: t.seconds,
|
|
728
|
+
expiredMessage: t.expired
|
|
729
|
+
}
|
|
730
|
+
};
|
|
731
|
+
}
|
|
732
|
+
//#endregion
|
|
733
|
+
//#region src/utils/collectColorFieldIssues.ts
|
|
734
|
+
function rr(e, t) {
|
|
735
|
+
let n = [], r = (r, i) => {
|
|
736
|
+
let a = je(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
|
|
737
|
+
if (a.invalidPresets.length > 0 && n.push({
|
|
738
|
+
id: s("invalid-presets"),
|
|
739
|
+
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." : "")
|
|
740
|
+
}), a.emptyPresets && n.push({
|
|
741
|
+
id: s("empty-presets"),
|
|
742
|
+
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.`
|
|
743
|
+
}), a.allowCustomIgnored && n.push({
|
|
744
|
+
id: s("allow-custom-ignored"),
|
|
745
|
+
message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
|
|
746
|
+
}), !a.allowCustom && a.presets.length > 0) {
|
|
747
|
+
let e = r.default ?? "", t = new Set(a.presets.map((e) => Rt(e)));
|
|
748
|
+
e !== "" && !t.has(Rt(e)) && n.push({
|
|
749
|
+
id: s("off-palette-default"),
|
|
750
|
+
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.`
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
for (let t of e.fields) if (t.type === "color") r(t, t.key);
|
|
755
|
+
else if (t.type === "repeatable") for (let e of t.fields) e.type === "color" && r(e, `${t.key}[].${e.key}`);
|
|
756
|
+
return n;
|
|
757
|
+
}
|
|
758
|
+
//#endregion
|
|
759
|
+
//#region src/utils/keyboardShortcuts.ts
|
|
760
|
+
function ir(e) {
|
|
761
|
+
for (let t of e.composedPath()) {
|
|
762
|
+
if (!(t instanceof HTMLElement)) continue;
|
|
763
|
+
if (t.isContentEditable) return !0;
|
|
764
|
+
let e = t.tagName;
|
|
765
|
+
if (e === "INPUT" || e === "TEXTAREA" || e === "SELECT") return !0;
|
|
766
|
+
}
|
|
767
|
+
return !1;
|
|
768
|
+
}
|
|
769
|
+
function ar(e, t) {
|
|
770
|
+
let n = e.metaKey || e.ctrlKey;
|
|
771
|
+
if (n && e.key.toLowerCase() === "s") {
|
|
772
|
+
e.preventDefault(), t.onSave?.();
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
if (n && e.key.toLowerCase() === "z") {
|
|
776
|
+
if (ir(e)) return;
|
|
777
|
+
e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
if (t.isPicking?.() && !ir(e)) {
|
|
781
|
+
if (e.key === "Escape") {
|
|
782
|
+
e.preventDefault(), t.onCancelPick?.();
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
if (e.key === "Enter") {
|
|
786
|
+
e.preventDefault(), t.onConfirmPick?.();
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
if (e.key === "Delete" || e.key === "Backspace") {
|
|
790
|
+
e.preventDefault();
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
if (e.key === "Escape") {
|
|
795
|
+
t.selectBlock(null);
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !ir(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
|
|
799
|
+
}
|
|
800
|
+
//#endregion
|
|
801
|
+
//#region src/utils/mergeTagLabelSegments.ts
|
|
802
|
+
function or(e, t, n, r = !1) {
|
|
803
|
+
if (!e) return [];
|
|
804
|
+
let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
|
|
805
|
+
for (; (s = i.exec(e)) !== null;) {
|
|
806
|
+
s.index > o && a.push({
|
|
807
|
+
type: "text",
|
|
808
|
+
value: e.slice(o, s.index)
|
|
809
|
+
});
|
|
810
|
+
let i = s[0];
|
|
811
|
+
if (he(i, n)) {
|
|
812
|
+
let e = r ? Oe(i, t) : void 0;
|
|
813
|
+
a.push(e === void 0 ? {
|
|
814
|
+
type: "tag",
|
|
815
|
+
value: we(i, t)
|
|
816
|
+
} : {
|
|
817
|
+
type: "text",
|
|
818
|
+
value: e
|
|
819
|
+
});
|
|
820
|
+
} else me(i, n) ? a.push({
|
|
821
|
+
type: "tag",
|
|
822
|
+
value: fe(i, n)
|
|
823
|
+
}) : a.push({
|
|
824
|
+
type: "text",
|
|
825
|
+
value: i
|
|
826
|
+
});
|
|
827
|
+
o = s.index + i.length;
|
|
828
|
+
}
|
|
829
|
+
return o < e.length && a.push({
|
|
830
|
+
type: "text",
|
|
831
|
+
value: e.slice(o)
|
|
832
|
+
}), a;
|
|
833
|
+
}
|
|
834
|
+
//#endregion
|
|
835
|
+
//#region src/components/MergeTagPreviewText.vue
|
|
836
|
+
var sr = d({
|
|
837
|
+
name: "MergeTagPreviewText",
|
|
838
|
+
props: { text: {
|
|
839
|
+
type: String,
|
|
840
|
+
required: !0
|
|
841
|
+
} },
|
|
842
|
+
setup(e) {
|
|
843
|
+
let t = n(K, q), r = n(at, Ee.liquid), i = n(J, null), a = b(() => or(e.text, t.value, r, i?.value ?? !1));
|
|
844
|
+
return () => a.value.map((e, t) => e.type === "tag" ? I("span", {
|
|
845
|
+
key: t,
|
|
846
|
+
class: "tpl-merge-tag-label"
|
|
847
|
+
}, e.value) : e.value);
|
|
848
|
+
}
|
|
849
|
+
}), cr = ["href"], lr = /* @__PURE__ */ d({
|
|
850
|
+
__name: "ButtonBlock",
|
|
851
|
+
props: {
|
|
852
|
+
block: {},
|
|
853
|
+
viewport: {}
|
|
854
|
+
},
|
|
855
|
+
setup(e) {
|
|
856
|
+
let t = e, n = b(() => {
|
|
857
|
+
let e = {
|
|
858
|
+
display: "inline-block",
|
|
859
|
+
padding: `${t.block.buttonPadding.top}px ${t.block.buttonPadding.right}px ${t.block.buttonPadding.bottom}px ${t.block.buttonPadding.left}px`,
|
|
860
|
+
backgroundColor: t.block.backgroundColor,
|
|
861
|
+
color: t.block.textColor,
|
|
862
|
+
fontSize: `${t.block.fontSize}px`,
|
|
863
|
+
fontWeight: "bold",
|
|
864
|
+
textDecoration: "none",
|
|
865
|
+
borderRadius: `${t.block.borderRadius}px`,
|
|
866
|
+
textAlign: "center"
|
|
867
|
+
};
|
|
868
|
+
return t.block.fontFamily && (e.fontFamily = 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;
|
|
869
|
+
}), r = b(() => ({ textAlign: t.block.align ?? "center" }));
|
|
870
|
+
return (t, i) => (s(), x("div", { style: D(r.value) }, [k("a", {
|
|
871
|
+
href: e.block.url || "#",
|
|
872
|
+
style: D(n.value),
|
|
873
|
+
class: "tpl:cursor-default",
|
|
874
|
+
onClick: i[0] ||= E(() => {}, ["prevent"])
|
|
875
|
+
}, [g(sr, { text: e.block.text }, null, 8, ["text"])], 12, cr)], 4));
|
|
876
|
+
}
|
|
877
|
+
}), ur = ["innerHTML"], dr = [
|
|
878
|
+
"src",
|
|
879
|
+
"width",
|
|
880
|
+
"height"
|
|
881
|
+
], fr = /* @__PURE__ */ d({
|
|
882
|
+
__name: "CustomBlockIcon",
|
|
883
|
+
props: {
|
|
884
|
+
icon: {},
|
|
885
|
+
size: {}
|
|
886
|
+
},
|
|
887
|
+
setup(e) {
|
|
888
|
+
let t = e, n = b(() => t.size ?? 20), r = b(() => t.icon && (t.icon.trimStart().startsWith("<svg") || t.icon.trimStart().startsWith("<SVG"))), i = b(() => t.icon && !r.value && (t.icon.startsWith("http") || t.icon.startsWith("/")));
|
|
889
|
+
return (t, a) => r.value ? (s(), x("span", {
|
|
890
|
+
key: 0,
|
|
891
|
+
class: "tpl:inline-flex tpl:items-center tpl:justify-center",
|
|
892
|
+
style: D({
|
|
893
|
+
width: `${n.value}px`,
|
|
894
|
+
height: `${n.value}px`
|
|
895
|
+
}),
|
|
896
|
+
innerHTML: e.icon
|
|
897
|
+
}, null, 12, ur)) : i.value ? (s(), x("img", {
|
|
898
|
+
key: 1,
|
|
899
|
+
src: e.icon,
|
|
900
|
+
width: n.value,
|
|
901
|
+
height: n.value,
|
|
902
|
+
class: "tpl:inline-block",
|
|
903
|
+
alt: ""
|
|
904
|
+
}, null, 8, dr)) : (s(), O(h(on), {
|
|
905
|
+
key: 2,
|
|
906
|
+
size: n.value,
|
|
907
|
+
"stroke-width": 1.5
|
|
908
|
+
}, null, 8, ["size"]));
|
|
909
|
+
}
|
|
910
|
+
}), pr = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
911
|
+
function mr(e, n) {
|
|
912
|
+
let r = ln(), i = null, a = null, o = null;
|
|
913
|
+
function s() {
|
|
914
|
+
return e.value ? Array.from(e.value.querySelectorAll(pr)).filter((e) => e.offsetParent !== null) : [];
|
|
915
|
+
}
|
|
916
|
+
function c(e) {
|
|
917
|
+
if (e.key !== "Tab") return;
|
|
918
|
+
let t = s();
|
|
919
|
+
if (t.length === 0) return;
|
|
920
|
+
let n = t[0], i = t[t.length - 1];
|
|
921
|
+
e.shiftKey ? r.activeElement === n && (e.preventDefault(), i.focus()) : r.activeElement === i && (e.preventDefault(), n.focus());
|
|
922
|
+
}
|
|
923
|
+
function l() {
|
|
924
|
+
let t = a !== null || o !== null;
|
|
925
|
+
t && u({ restoreFocus: !1 }), t || (i = r.activeElement), o = requestAnimationFrame(() => {
|
|
926
|
+
o = null;
|
|
927
|
+
let t = s();
|
|
928
|
+
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
929
|
+
}), a = G(e, "keydown", c);
|
|
930
|
+
}
|
|
931
|
+
function u(e = {}) {
|
|
932
|
+
let t = e.restoreFocus !== !1;
|
|
933
|
+
o !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(o), o = null), a?.(), a = null, t && i && i.focus && (i.focus(), i = null);
|
|
934
|
+
}
|
|
935
|
+
let d = t([n, e], ([e, t]) => {
|
|
936
|
+
e && t ? l() : u();
|
|
937
|
+
}, { flush: "post" });
|
|
938
|
+
m(() => {
|
|
939
|
+
d(), u();
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
//#endregion
|
|
943
|
+
//#region src/composables/useEmoji.ts
|
|
944
|
+
function hr() {
|
|
945
|
+
let [e, n] = We(!1), r = y([]), i = !1;
|
|
946
|
+
m(() => {
|
|
947
|
+
i = !0;
|
|
948
|
+
}), t(e, async (e) => {
|
|
949
|
+
if (e && r.value.length === 0) {
|
|
950
|
+
let { emojiCategories: e } = await import("./emojiData-6m0DBh7O.js");
|
|
951
|
+
if (i) return;
|
|
952
|
+
r.value = e;
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
function a() {
|
|
956
|
+
n();
|
|
957
|
+
}
|
|
958
|
+
function o() {
|
|
959
|
+
e.value = !1;
|
|
960
|
+
}
|
|
961
|
+
return {
|
|
962
|
+
categories: r,
|
|
963
|
+
isOpen: e,
|
|
964
|
+
toggle: a,
|
|
965
|
+
close: o
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region src/composables/useFonts.ts
|
|
970
|
+
var gr = [
|
|
971
|
+
{
|
|
972
|
+
value: "Arial",
|
|
973
|
+
label: "Arial"
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
value: "Helvetica",
|
|
977
|
+
label: "Helvetica"
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
value: "Georgia",
|
|
981
|
+
label: "Georgia"
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
value: "Times New Roman",
|
|
985
|
+
label: "Times New Roman"
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
value: "Verdana",
|
|
989
|
+
label: "Verdana"
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
value: "Trebuchet MS",
|
|
993
|
+
label: "Trebuchet MS"
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
value: "Courier New",
|
|
997
|
+
label: "Courier New"
|
|
998
|
+
}
|
|
999
|
+
], _r = {
|
|
1000
|
+
arial: "Arial, sans-serif",
|
|
1001
|
+
helvetica: "Helvetica, sans-serif",
|
|
1002
|
+
georgia: "Georgia, serif",
|
|
1003
|
+
"times new roman": "'Times New Roman', serif",
|
|
1004
|
+
verdana: "Verdana, sans-serif",
|
|
1005
|
+
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
1006
|
+
"courier new": "'Courier New', monospace"
|
|
1007
|
+
}, vr = "Arial, sans-serif";
|
|
1008
|
+
function yr(e) {
|
|
1009
|
+
if (e === void 0 || e === !0) return [...gr];
|
|
1010
|
+
if (e === !1) return [];
|
|
1011
|
+
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
1012
|
+
for (let i of e) {
|
|
1013
|
+
let e = i.toLowerCase(), a = gr.find((t) => t.value.toLowerCase() === e);
|
|
1014
|
+
if (!a) {
|
|
1015
|
+
r.has(e) || (r.add(e), Z.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${gr.map((e) => e.value).join(", ")}.`));
|
|
1016
|
+
continue;
|
|
1017
|
+
}
|
|
1018
|
+
n.has(a.value) || (n.add(a.value), t.push(a));
|
|
1019
|
+
}
|
|
1020
|
+
return t;
|
|
1021
|
+
}
|
|
1022
|
+
function br(e) {
|
|
1023
|
+
let t = l(e?.customFonts ?? []), n = l(!1), r = yr(e?.builtIns), i = b(() => e?.defaultFallback ?? vr), a = b(() => {
|
|
1024
|
+
let e = [...r], n = t.value.map((e) => ({
|
|
1025
|
+
value: e.name,
|
|
1026
|
+
label: e.name,
|
|
1027
|
+
isCustom: !0
|
|
1028
|
+
})), i = [...e, ...n];
|
|
1029
|
+
return i.sort((e, t) => e.label.localeCompare(t.label)), i;
|
|
1030
|
+
});
|
|
1031
|
+
function s(e) {
|
|
1032
|
+
return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1033
|
+
}
|
|
1034
|
+
let c = e?.defaultFont ?? vr.split(",")[0].trim();
|
|
1035
|
+
s(c) || Z.warn(`config.fonts: new templates seed "${c}", 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.`);
|
|
1036
|
+
function u() {
|
|
1037
|
+
if (e?.defaultFont && s(e.defaultFont)) {
|
|
1038
|
+
let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
1039
|
+
if (t) return t.value;
|
|
1040
|
+
}
|
|
1041
|
+
return vr;
|
|
1042
|
+
}
|
|
1043
|
+
let d = b(() => u());
|
|
1044
|
+
function f(e) {
|
|
1045
|
+
if (!e) return i.value;
|
|
1046
|
+
let n = t.value.find((t) => t.name.toLowerCase() === e.toLowerCase());
|
|
1047
|
+
return n ? `'${n.name}', ${n.fallback ?? i.value}` : _r[e.toLowerCase()] || (e.includes(",") ? e : `${e}, ${i.value}`);
|
|
1048
|
+
}
|
|
1049
|
+
let p = [], h = !1;
|
|
1050
|
+
async function g() {
|
|
1051
|
+
if (t.value.length === 0) {
|
|
1052
|
+
h || (n.value = !0);
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
let e = t.value.map(async (e) => {
|
|
1056
|
+
try {
|
|
1057
|
+
if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
|
|
1058
|
+
let t = document.createElement("link");
|
|
1059
|
+
t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), p.push(t), await new Promise((n, r) => {
|
|
1060
|
+
t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
|
|
1061
|
+
});
|
|
1062
|
+
} catch (t) {
|
|
1063
|
+
Z.warn(`Failed to load custom font "${e.name}":`, t);
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
await Promise.allSettled(e), !h && (n.value = !0);
|
|
1067
|
+
}
|
|
1068
|
+
function _() {
|
|
1069
|
+
for (let e of p) e.remove();
|
|
1070
|
+
p.length = 0;
|
|
1071
|
+
}
|
|
1072
|
+
return o() && m(() => {
|
|
1073
|
+
h = !0, _();
|
|
1074
|
+
}), {
|
|
1075
|
+
fonts: a,
|
|
1076
|
+
defaultFont: d,
|
|
1077
|
+
defaultFallback: i,
|
|
1078
|
+
customFonts: t,
|
|
1079
|
+
isLoaded: n,
|
|
1080
|
+
loadCustomFonts: g,
|
|
1081
|
+
cleanupFontLinks: _,
|
|
1082
|
+
getFontWithFallback: f,
|
|
1083
|
+
getDefaultFont: u
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
//#endregion
|
|
1087
|
+
//#region src/utils/mergeTagNodeSpec.ts
|
|
1088
|
+
function xr(e, t, n) {
|
|
1089
|
+
return me(e, n) ? {
|
|
1090
|
+
type: "logicMergeTagNode",
|
|
1091
|
+
attrs: {
|
|
1092
|
+
value: e,
|
|
1093
|
+
keyword: fe(e, n)
|
|
1094
|
+
}
|
|
1095
|
+
} : {
|
|
1096
|
+
type: "mergeTagNode",
|
|
1097
|
+
attrs: {
|
|
1098
|
+
label: t,
|
|
1099
|
+
value: e
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
//#endregion
|
|
1104
|
+
//#region src/utils/insertLogicTag.ts
|
|
1105
|
+
function Sr(e) {
|
|
1106
|
+
return "before" in e && "after" in e;
|
|
1107
|
+
}
|
|
1108
|
+
function Cr(e, t, n) {
|
|
1109
|
+
if (!Sr(t)) {
|
|
1110
|
+
e.chain().focus().insertContent(xr(t.value, t.label, n)).run();
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
let r = xr(t.before, t.label, n), i = xr(t.after, t.label, n), { from: a, to: o } = e.state.selection;
|
|
1114
|
+
if (a !== o) {
|
|
1115
|
+
e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
e.chain().focus().insertContentAt(a, [r, i]).setTextSelection(a + 1).run();
|
|
1119
|
+
}
|
|
1120
|
+
//#endregion
|
|
1121
|
+
//#region src/utils/linkColorExtension.ts
|
|
1122
|
+
function wr(e) {
|
|
1123
|
+
if (!e) return null;
|
|
1124
|
+
let t = e.trim();
|
|
1125
|
+
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;
|
|
1126
|
+
}
|
|
1127
|
+
function Tr(e) {
|
|
1128
|
+
return e.extend({ addAttributes() {
|
|
1129
|
+
return {
|
|
1130
|
+
...this.parent?.(),
|
|
1131
|
+
color: {
|
|
1132
|
+
default: null,
|
|
1133
|
+
parseHTML: (e) => wr(It(e.style.color)),
|
|
1134
|
+
renderHTML: (e) => {
|
|
1135
|
+
let t = wr(e.color);
|
|
1136
|
+
return t ? { style: `color: ${t}` } : {};
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
} });
|
|
1141
|
+
}
|
|
1142
|
+
//#endregion
|
|
1143
|
+
//#region src/composables/useRichTextLinkDialog.ts
|
|
1144
|
+
function Er(e, t = Ee.liquid) {
|
|
1145
|
+
let n = l(!1), r = l(""), i = l(""), a = l(null);
|
|
1146
|
+
mr(a, n);
|
|
1147
|
+
function o() {
|
|
1148
|
+
let t = e.value?.getAttributes("link") ?? {};
|
|
1149
|
+
r.value = t.href || "", i.value = t.color || "", n.value = !0;
|
|
1150
|
+
}
|
|
1151
|
+
function s() {
|
|
1152
|
+
if (r.value) {
|
|
1153
|
+
let t = d(r.value);
|
|
1154
|
+
if (t !== null) {
|
|
1155
|
+
let n = wr(i.value), r = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
|
|
1156
|
+
n && typeof e.value?.commands.unsetColor == "function" && r?.unsetColor(), r?.run();
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
p();
|
|
1160
|
+
}
|
|
1161
|
+
let c = /* @__PURE__ */ new Set([
|
|
1162
|
+
"http",
|
|
1163
|
+
"https",
|
|
1164
|
+
"mailto",
|
|
1165
|
+
"tel",
|
|
1166
|
+
"ftp",
|
|
1167
|
+
"ftps",
|
|
1168
|
+
"sms",
|
|
1169
|
+
"xmpp",
|
|
1170
|
+
"cid"
|
|
1171
|
+
]);
|
|
1172
|
+
function u(e) {
|
|
1173
|
+
return RegExp(`^(?:${t.value.source})`).test(e);
|
|
1174
|
+
}
|
|
1175
|
+
function d(e) {
|
|
1176
|
+
let t = e.trim();
|
|
1177
|
+
if (!t) return null;
|
|
1178
|
+
if (t.startsWith("#")) return t;
|
|
1179
|
+
let n = /^([a-z][a-z0-9+.-]*):/i.exec(t);
|
|
1180
|
+
return n ? c.has(n[1].toLowerCase()) ? t : null : u(t) ? t : `https://${t}`;
|
|
1181
|
+
}
|
|
1182
|
+
function f() {
|
|
1183
|
+
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), p();
|
|
1184
|
+
}
|
|
1185
|
+
function p() {
|
|
1186
|
+
n.value = !1, r.value = "", i.value = "";
|
|
1187
|
+
}
|
|
1188
|
+
function m(e) {
|
|
1189
|
+
e.key === "Enter" ? (e.preventDefault(), s()) : e.key === "Escape" && p();
|
|
1190
|
+
}
|
|
1191
|
+
return {
|
|
1192
|
+
showLinkDialog: n,
|
|
1193
|
+
linkUrl: r,
|
|
1194
|
+
linkColor: i,
|
|
1195
|
+
linkDialogRef: a,
|
|
1196
|
+
openLinkDialog: o,
|
|
1197
|
+
insertLink: s,
|
|
1198
|
+
removeLink: f,
|
|
1199
|
+
closeLinkDialog: p,
|
|
1200
|
+
handleLinkKeydown: m
|
|
1201
|
+
};
|
|
1202
|
+
}
|
|
1203
|
+
//#endregion
|
|
1204
|
+
//#region src/composables/useRichTextEditor.ts
|
|
1205
|
+
function Dr(r) {
|
|
1206
|
+
let i = n(Y, null), { mergeTags: a, canRequestMergeTag: o, isRequesting: s, requestMergeTag: c, syntax: u, autocomplete: d } = un(), { canInsertLogicTag: f, isRequesting: p, requestLogicTag: m } = dn(), h = n(Ot, null), g = (A(h) ? h.value : h)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", _ = xe(u), v = y(null), b = () => se(i?.content?.value?.settings ?? { locale: "en" });
|
|
1207
|
+
t(b, (e) => {
|
|
1208
|
+
let t = v.value?.view.dom;
|
|
1209
|
+
t && t.setAttribute("dir", e);
|
|
1210
|
+
});
|
|
1211
|
+
let { showLinkDialog: x, linkUrl: S, linkColor: C, linkDialogRef: w, openLinkDialog: T, insertLink: E, removeLink: D, closeLinkDialog: O, handleLinkKeydown: k } = Er(v, u), { start: j, stop: M } = He(() => v.value?.commands.focus("end"), 0, { immediate: !1 }), N = y(null), P = l(!0), F = l(null), I = !1;
|
|
1212
|
+
async function L() {
|
|
1213
|
+
F.value = null, P.value = !0;
|
|
1214
|
+
try {
|
|
1215
|
+
let { TiptapEditor: e, EC: t, extensions: n } = await r.loadExtensions({
|
|
1216
|
+
mergeTags: a,
|
|
1217
|
+
syntax: u,
|
|
1218
|
+
triggerChar: _,
|
|
1219
|
+
autocompleteEnabled: d,
|
|
1220
|
+
suggestionEmptyText: g
|
|
1221
|
+
});
|
|
1222
|
+
if (I) return;
|
|
1223
|
+
N.value = t;
|
|
1224
|
+
let o = /* @__PURE__ */ new Map();
|
|
1225
|
+
n.forEach((e, t) => o.set(e.name, t));
|
|
1226
|
+
let s = new e({
|
|
1227
|
+
extensions: n.filter((e, t) => o.get(e.name) === t),
|
|
1228
|
+
content: r.blockContent(),
|
|
1229
|
+
editable: !0,
|
|
1230
|
+
editorProps: { attributes: { dir: b() } },
|
|
1231
|
+
onUpdate: ({ editor: e }) => {
|
|
1232
|
+
I || i && i.updateBlock(r.blockId(), { content: e.getHTML() });
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
if (I) {
|
|
1236
|
+
s.destroy();
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
v.value = s, P.value = !1, j();
|
|
1240
|
+
} catch (e) {
|
|
1241
|
+
if (I) return;
|
|
1242
|
+
Z.error(`[${r.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, e), F.value = e instanceof Error ? e.message : "Failed to load editor", P.value = !1;
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
function R() {
|
|
1246
|
+
v.value?.destroy(), v.value = null, L();
|
|
1247
|
+
}
|
|
1248
|
+
L();
|
|
1249
|
+
let z = t(() => r.blockContent(), (e) => {
|
|
1250
|
+
v.value && v.value.getHTML() !== e && v.value.commands.setContent(e, { emitUpdate: !1 });
|
|
1251
|
+
});
|
|
1252
|
+
function B(e) {
|
|
1253
|
+
if (s.value || p.value) return;
|
|
1254
|
+
let t = e.composedPath(), n = t.find((e) => e instanceof HTMLElement);
|
|
1255
|
+
if (!n) return;
|
|
1256
|
+
r.onClickOutsideSideEffect?.(n);
|
|
1257
|
+
let i = t.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
|
|
1258
|
+
n.closest(".tpl-text-editor-wrapper") || n.closest(".tpl-text-toolbar") || n.closest(".tpl-link-dialog") || i || r.onDone();
|
|
1259
|
+
}
|
|
1260
|
+
G(document, "mousedown", B), e(() => {
|
|
1261
|
+
I = !0, z(), M(), v.value?.destroy();
|
|
1262
|
+
});
|
|
1263
|
+
async function V() {
|
|
1264
|
+
let e = await c();
|
|
1265
|
+
I || (e && v.value ? v.value.chain().focus().insertMergeTag({
|
|
1266
|
+
label: e.label,
|
|
1267
|
+
value: e.value
|
|
1268
|
+
}).run() : v.value?.commands.focus());
|
|
1269
|
+
}
|
|
1270
|
+
async function H() {
|
|
1271
|
+
let e = await m();
|
|
1272
|
+
I || (e && v.value ? Cr(v.value, e, u) : v.value?.commands.focus());
|
|
1273
|
+
}
|
|
1274
|
+
return {
|
|
1275
|
+
editor: v,
|
|
1276
|
+
EditorContent: N,
|
|
1277
|
+
isLoading: P,
|
|
1278
|
+
initError: F,
|
|
1279
|
+
retry: R,
|
|
1280
|
+
showLinkDialog: x,
|
|
1281
|
+
linkUrl: S,
|
|
1282
|
+
linkColor: C,
|
|
1283
|
+
linkDialogRef: w,
|
|
1284
|
+
mergeTags: a,
|
|
1285
|
+
canRequestMergeTag: o,
|
|
1286
|
+
isRequestingMergeTag: s,
|
|
1287
|
+
syntax: u,
|
|
1288
|
+
canInsertLogicTag: f,
|
|
1289
|
+
isRequestingLogicTag: p,
|
|
1290
|
+
openLinkDialog: T,
|
|
1291
|
+
insertLink: E,
|
|
1292
|
+
removeLink: D,
|
|
1293
|
+
closeLinkDialog: O,
|
|
1294
|
+
handleLinkKeydown: k,
|
|
1295
|
+
handleAddMergeTag: V,
|
|
1296
|
+
handleAddLogicTag: H
|
|
1297
|
+
};
|
|
1298
|
+
}
|
|
1299
|
+
//#endregion
|
|
1300
|
+
//#region src/composables/useSmallScreenNotice.ts
|
|
1301
|
+
var Or = "(max-width: 767px)";
|
|
1302
|
+
function kr(e) {
|
|
1303
|
+
let t = Ke(Or);
|
|
1304
|
+
return {
|
|
1305
|
+
isSmallScreen: t,
|
|
1306
|
+
showNotice: b(() => (j(e) ?? !0) && t.value)
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
//#endregion
|
|
1310
|
+
//#region src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1311
|
+
var Ar = { class: "tpl:w-full" }, jr = {
|
|
1312
|
+
key: 0,
|
|
1313
|
+
class: "tpl:flex 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)]"
|
|
1314
|
+
}, Mr = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Nr = {
|
|
1315
|
+
key: 1,
|
|
1316
|
+
class: "tpl:flex 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)]"
|
|
1317
|
+
}, Pr = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Fr = {
|
|
1318
|
+
key: 2,
|
|
1319
|
+
class: "tpl:relative"
|
|
1320
|
+
}, Ir = ["innerHTML"], Lr = {
|
|
1321
|
+
key: 0,
|
|
1322
|
+
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]",
|
|
1323
|
+
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
|
|
1324
|
+
}, Rr = /* @__PURE__ */ d({
|
|
1325
|
+
__name: "CustomBlock",
|
|
1326
|
+
props: {
|
|
1327
|
+
block: {},
|
|
1328
|
+
viewport: {}
|
|
1329
|
+
},
|
|
1330
|
+
emits: ["fetchData"],
|
|
1331
|
+
setup(e, { emit: r }) {
|
|
1332
|
+
let i = e, a = r, { t: o } = X(), c = n(At, null), u = l(""), d = l(!1), f = b(() => c?.getDefinition(i.block.customType)), p = b(() => !!f.value), m = b(() => i.block), { isFetching: _, fetch: v, needsFetch: y, hasDataSource: C } = Pe({
|
|
1333
|
+
definition: f,
|
|
1334
|
+
block: m,
|
|
1335
|
+
onUpdate: (e, t) => {
|
|
1336
|
+
a("fetchData", {
|
|
1337
|
+
fieldValues: e,
|
|
1338
|
+
dataSourceFetched: t
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
}), T = n(K, q), D = n(J, null), A = b(() => {
|
|
1342
|
+
if (!D?.value) return i.block;
|
|
1343
|
+
let e = {};
|
|
1344
|
+
for (let [t, n] of Object.entries(i.block.fieldValues)) e[t] = typeof n == "string" ? de(n, T.value) : n;
|
|
1345
|
+
return {
|
|
1346
|
+
...i.block,
|
|
1347
|
+
fieldValues: e
|
|
1348
|
+
};
|
|
1349
|
+
});
|
|
1350
|
+
async function j() {
|
|
1351
|
+
if (c) {
|
|
1352
|
+
d.value = !1;
|
|
1353
|
+
try {
|
|
1354
|
+
let e = await c.renderCustomBlock(A.value);
|
|
1355
|
+
e.includes("Template render error:") && (d.value = !0), u.value = e;
|
|
1356
|
+
} catch {
|
|
1357
|
+
d.value = !0, u.value = "";
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
let M = Ue(j, 150);
|
|
1362
|
+
return w(() => {
|
|
1363
|
+
j();
|
|
1364
|
+
}), t(() => i.block.fieldValues, () => {
|
|
1365
|
+
M();
|
|
1366
|
+
}, { deep: !0 }), t(() => D?.value, () => {
|
|
1367
|
+
M();
|
|
1368
|
+
}), (e, t) => (s(), x("div", Ar, [p.value ? d.value ? (s(), x("div", Nr, [g(h(nn), {
|
|
1369
|
+
size: 24,
|
|
1370
|
+
class: "tpl:text-[var(--tpl-danger)]"
|
|
1371
|
+
}), k("span", Pr, F(h(o).customBlocks.renderError), 1)])) : (s(), x("div", Fr, [k("div", { innerHTML: u.value }, null, 8, Ir), h(C) && h(y) ? (s(), x("div", Lr, [h(_) ? (s(), O(sn, {
|
|
1372
|
+
key: 1,
|
|
1373
|
+
class: "tpl:w-48"
|
|
1374
|
+
})) : (s(), x("button", {
|
|
1375
|
+
key: 0,
|
|
1376
|
+
type: "button",
|
|
1377
|
+
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)]",
|
|
1378
|
+
onClick: t[0] ||= E((...e) => h(v) && h(v)(...e), ["stop"])
|
|
1379
|
+
}, [f.value?.icon ? (s(), O(fr, {
|
|
1380
|
+
key: 0,
|
|
1381
|
+
icon: f.value.icon,
|
|
1382
|
+
size: 16
|
|
1383
|
+
}, null, 8, ["icon"])) : S("", !0), R(" " + F(f.value?.dataSource?.label || h(o).customBlocks.dataSource.fetchButton), 1)]))])) : S("", !0)])) : (s(), x("div", jr, [g(h(Gt), {
|
|
1384
|
+
size: 24,
|
|
1385
|
+
class: "tpl:text-[var(--tpl-warning)]"
|
|
1386
|
+
}), k("span", Mr, F(h(o).customBlocks.definitionNotFound), 1)]))]));
|
|
1387
|
+
}
|
|
1388
|
+
}), zr = { class: "tpl:w-full" }, Br = /* @__PURE__ */ d({
|
|
1389
|
+
__name: "DividerBlock",
|
|
1390
|
+
props: {
|
|
1391
|
+
block: {},
|
|
1392
|
+
viewport: {}
|
|
1393
|
+
},
|
|
1394
|
+
setup(e) {
|
|
1395
|
+
let t = e, n = b(() => ({
|
|
1396
|
+
borderTop: `${t.block.thickness}px ${t.block.lineStyle} ${t.block.color}`,
|
|
1397
|
+
width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
|
|
1398
|
+
margin: t.block.width === "full" ? "0" : "0 auto"
|
|
1399
|
+
}));
|
|
1400
|
+
return (e, t) => (s(), x("div", zr, [k("hr", {
|
|
1401
|
+
class: "tpl:m-0 tpl:border-none",
|
|
1402
|
+
style: D(n.value)
|
|
1403
|
+
}, null, 4)]));
|
|
1404
|
+
}
|
|
1405
|
+
}), Vr = { class: "tpl:w-full" }, Hr = ["srcdoc", "title"], Ur = {
|
|
1406
|
+
key: 1,
|
|
1407
|
+
class: "tpl:flex 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)]"
|
|
1408
|
+
}, Wr = {
|
|
1409
|
+
key: 0,
|
|
1410
|
+
class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
|
|
1411
|
+
}, Gr = {
|
|
1412
|
+
key: 1,
|
|
1413
|
+
class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
1414
|
+
}, Kr = /* @__PURE__ */ d({
|
|
1415
|
+
__name: "HtmlBlock",
|
|
1416
|
+
props: {
|
|
1417
|
+
block: {},
|
|
1418
|
+
viewport: {}
|
|
1419
|
+
},
|
|
1420
|
+
setup(r) {
|
|
1421
|
+
let i = r, { t: a } = X(), o = n(gt, !1), c = b(() => i.block.content.trim().length > 0), u = b(() => o && c.value), d = n(K, q), f = n(J, null), p = b(() => f?.value ? de(i.block.content, d.value) : i.block.content), m = l(null), _ = l(60), v = null;
|
|
1422
|
+
function y() {
|
|
1423
|
+
let e = m.value?.contentDocument;
|
|
1424
|
+
e && (_.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
|
|
1425
|
+
}
|
|
1426
|
+
function S() {
|
|
1427
|
+
v?.disconnect(), v = null, y();
|
|
1428
|
+
let e = m.value?.contentDocument?.documentElement;
|
|
1429
|
+
e && typeof ResizeObserver < "u" && (v = new ResizeObserver(() => y()), v.observe(e));
|
|
1430
|
+
}
|
|
1431
|
+
return t(u, (e) => {
|
|
1432
|
+
e || (v?.disconnect(), v = null);
|
|
1433
|
+
}), e(() => {
|
|
1434
|
+
v?.disconnect(), v = null;
|
|
1435
|
+
}), (e, t) => (s(), x("div", Vr, [u.value ? (s(), x("iframe", {
|
|
1436
|
+
key: 0,
|
|
1437
|
+
ref_key: "iframeRef",
|
|
1438
|
+
ref: m,
|
|
1439
|
+
srcdoc: p.value,
|
|
1440
|
+
sandbox: "allow-same-origin",
|
|
1441
|
+
title: h(a).html.preview,
|
|
1442
|
+
class: "tpl:block tpl:w-full tpl:border-0",
|
|
1443
|
+
style: D({ height: `${_.value}px` }),
|
|
1444
|
+
onLoad: S
|
|
1445
|
+
}, null, 44, Hr)) : (s(), x("div", Ur, [g(h(Kt), {
|
|
1446
|
+
size: 24,
|
|
1447
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
1448
|
+
}), c.value ? (s(), x("span", Wr, F(h(a).html.preview), 1)) : (s(), x("span", Gr, F(h(a).html.empty), 1))]))]));
|
|
1449
|
+
}
|
|
1450
|
+
}), qr = ["data-drop-enabled"], Jr = {
|
|
1451
|
+
key: 0,
|
|
1452
|
+
class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]",
|
|
1453
|
+
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 85%, transparent)" }
|
|
1454
|
+
}, Yr = ["href"], Xr = ["src", "alt"], Zr = ["src", "alt"], Qr = {
|
|
1455
|
+
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
1456
|
+
style: { opacity: "0.7" }
|
|
1457
|
+
}, $r = ["href"], ei = ["src", "alt"], ti = ["src", "alt"], ni = {
|
|
1458
|
+
key: 4,
|
|
1459
|
+
class: "tpl:flex 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)]"
|
|
1460
|
+
}, ri = ["aria-label"], ii = { key: 1 }, ai = /* @__PURE__ */ d({
|
|
1461
|
+
__name: "ImageBlock",
|
|
1462
|
+
props: {
|
|
1463
|
+
block: {},
|
|
1464
|
+
viewport: {}
|
|
1465
|
+
},
|
|
1466
|
+
emits: ["update"],
|
|
1467
|
+
setup(e, { emit: t }) {
|
|
1468
|
+
let r = e, i = t, { t: a } = X(), { syntax: o } = un(), c = n(et, null), u = n(_t, null), d = b(() => !!c), f = fn();
|
|
1469
|
+
async function p() {
|
|
1470
|
+
let e = await c?.({ accept: ["images"] });
|
|
1471
|
+
if (f.alive && e) {
|
|
1472
|
+
let t = { src: e.url };
|
|
1473
|
+
e.alt && (t.alt = e.alt), i("update", t);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
let m = l(), _ = l(!1), v = b(() => (u?.value ?? !!c) && !_.value && !O.value);
|
|
1477
|
+
async function y(e) {
|
|
1478
|
+
if (c) {
|
|
1479
|
+
_.value = !0;
|
|
1480
|
+
try {
|
|
1481
|
+
let t = await c({
|
|
1482
|
+
accept: ["images"],
|
|
1483
|
+
files: e
|
|
1484
|
+
});
|
|
1485
|
+
if (!f.alive) return;
|
|
1486
|
+
if (t) {
|
|
1487
|
+
let e = { src: t.url };
|
|
1488
|
+
t.alt && (e.alt = t.alt), i("update", e);
|
|
1489
|
+
}
|
|
1490
|
+
} finally {
|
|
1491
|
+
f.alive && (_.value = !1);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
let { isOver: C } = Fe({
|
|
1496
|
+
target: m,
|
|
1497
|
+
enabled: v,
|
|
1498
|
+
onFiles: y
|
|
1499
|
+
}), w = b(() => ({ textAlign: r.block.align })), T = b(() => {
|
|
1500
|
+
let e = r.block.align;
|
|
1501
|
+
return {
|
|
1502
|
+
maxWidth: "100%",
|
|
1503
|
+
width: r.block.width === "full" ? "100%" : `${r.block.width}px`,
|
|
1504
|
+
height: r.block.height ? `${r.block.height}px` : void 0,
|
|
1505
|
+
borderRadius: r.block.borderRadius && r.block.borderRadius > 0 ? `${r.block.borderRadius}px` : void 0,
|
|
1506
|
+
display: "block",
|
|
1507
|
+
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
1508
|
+
marginRight: e === "center" ? "auto" : void 0
|
|
1509
|
+
};
|
|
1510
|
+
}), O = b(() => W(r.block.src, o)), A = yn(() => O.value ? void 0 : r.block.src), j = yn(() => O.value ? r.block.placeholderUrl : void 0);
|
|
1511
|
+
return (t, n) => (s(), x("div", {
|
|
1512
|
+
ref_key: "dropZoneRef",
|
|
1513
|
+
ref: m,
|
|
1514
|
+
"data-testid": "image-drop-zone",
|
|
1515
|
+
"data-drop-enabled": v.value,
|
|
1516
|
+
class: "tpl:relative tpl:w-full",
|
|
1517
|
+
style: D(w.value)
|
|
1518
|
+
}, [v.value && (h(C) || _.value) ? (s(), x("div", Jr, [_.value ? (s(), x(P, { key: 0 }, [g(h(Qt), {
|
|
1519
|
+
class: "tpl-spinner",
|
|
1520
|
+
size: 20,
|
|
1521
|
+
"stroke-width": 2
|
|
1522
|
+
}), R(" " + F(h(a).image.uploading), 1)], 64)) : (s(), x(P, { key: 1 }, [g(h(en), {
|
|
1523
|
+
size: 20,
|
|
1524
|
+
"stroke-width": 1.5
|
|
1525
|
+
}), R(" " + F(h(a).image.dropToUpload), 1)], 64))])) : S("", !0), e.block.src && O.value && e.block.placeholderUrl ? (s(), x(P, { key: 1 }, [e.block.linkUrl ? (s(), x("a", {
|
|
1526
|
+
key: 0,
|
|
1527
|
+
href: e.block.linkUrl,
|
|
1528
|
+
target: "_blank",
|
|
1529
|
+
rel: "noopener noreferrer",
|
|
1530
|
+
onClick: n[0] ||= E(() => {}, ["prevent"])
|
|
1531
|
+
}, [k("img", {
|
|
1532
|
+
class: "tpl:border-0",
|
|
1533
|
+
loading: "lazy",
|
|
1534
|
+
src: h(j),
|
|
1535
|
+
alt: e.block.alt || h(a).image.altTextPlaceholder,
|
|
1536
|
+
style: D(T.value)
|
|
1537
|
+
}, null, 12, Xr)], 8, Yr)) : (s(), x("img", {
|
|
1538
|
+
key: 1,
|
|
1539
|
+
class: "tpl:border-0",
|
|
1540
|
+
src: h(j),
|
|
1541
|
+
alt: e.block.alt,
|
|
1542
|
+
style: D(T.value)
|
|
1543
|
+
}, null, 12, Zr))], 64)) : e.block.src && O.value ? (s(), x("div", {
|
|
1544
|
+
key: 2,
|
|
1545
|
+
class: "tpl:!flex 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)]",
|
|
1546
|
+
style: D([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, T.value])
|
|
1547
|
+
}, [g(h(Xt), {
|
|
1548
|
+
size: 32,
|
|
1549
|
+
"stroke-width": 1.5,
|
|
1550
|
+
class: "tpl:text-[var(--tpl-primary)]",
|
|
1551
|
+
style: { opacity: "0.5" }
|
|
1552
|
+
}), k("span", Qr, [g(sr, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (s(), x(P, { key: 3 }, [e.block.linkUrl ? (s(), x("a", {
|
|
1553
|
+
key: 0,
|
|
1554
|
+
href: e.block.linkUrl,
|
|
1555
|
+
target: "_blank",
|
|
1556
|
+
rel: "noopener noreferrer",
|
|
1557
|
+
onClick: n[1] ||= E(() => {}, ["prevent"])
|
|
1558
|
+
}, [k("img", {
|
|
1559
|
+
class: "tpl:border-0",
|
|
1560
|
+
loading: "lazy",
|
|
1561
|
+
src: h(A),
|
|
1562
|
+
alt: e.block.alt || h(a).image.altTextPlaceholder,
|
|
1563
|
+
style: D(T.value)
|
|
1564
|
+
}, null, 12, ei)], 8, $r)) : (s(), x("img", {
|
|
1565
|
+
key: 1,
|
|
1566
|
+
class: "tpl:border-0",
|
|
1567
|
+
src: h(A),
|
|
1568
|
+
alt: e.block.alt,
|
|
1569
|
+
style: D(T.value)
|
|
1570
|
+
}, null, 12, ti))], 64)) : (s(), x("div", ni, [d.value ? (s(), x("button", {
|
|
1571
|
+
key: 0,
|
|
1572
|
+
"aria-label": h(a).image.browseMedia,
|
|
1573
|
+
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)]",
|
|
1574
|
+
onClick: E(p, ["stop"])
|
|
1575
|
+
}, [g(h(Xt), {
|
|
1576
|
+
size: 14,
|
|
1577
|
+
"stroke-width": 1.5
|
|
1578
|
+
}), R(" " + F(h(a).image.browseMedia), 1)], 8, ri)) : (s(), x("span", ii, F(h(a).image.clickToAdd), 1))]))], 12, qr));
|
|
1579
|
+
}
|
|
1580
|
+
}), oi = { class: "tpl:w-full" }, si = ["href"], ci = {
|
|
1581
|
+
key: 1,
|
|
1582
|
+
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)]"
|
|
1583
|
+
}, li = /* @__PURE__ */ d({
|
|
1584
|
+
__name: "MenuBlock",
|
|
1585
|
+
props: {
|
|
1586
|
+
block: {},
|
|
1587
|
+
viewport: {}
|
|
1588
|
+
},
|
|
1589
|
+
setup(e) {
|
|
1590
|
+
let t = e, { t: n } = X(), i = b(() => ({
|
|
1591
|
+
display: "flex",
|
|
1592
|
+
flexWrap: "wrap",
|
|
1593
|
+
gap: `0 ${t.block.spacing}px`,
|
|
1594
|
+
justifyContent: t.block.textAlign === "left" ? "flex-start" : t.block.textAlign === "right" ? "flex-end" : "center",
|
|
1595
|
+
fontSize: `${t.block.fontSize}px`,
|
|
1596
|
+
fontFamily: t.block.fontFamily || "inherit",
|
|
1597
|
+
alignItems: "center"
|
|
1598
|
+
})), a = b(() => t.block.items.length > 0);
|
|
1599
|
+
function o(e) {
|
|
1600
|
+
return e || t.block.linkColor || t.block.color;
|
|
1601
|
+
}
|
|
1602
|
+
return (t, c) => (s(), x("div", oi, [a.value ? (s(), x("div", {
|
|
1603
|
+
key: 0,
|
|
1604
|
+
style: D(i.value)
|
|
1605
|
+
}, [(s(!0), x(P, null, r(e.block.items, (t, n) => (s(), x(P, { key: t.id }, [k("a", {
|
|
1606
|
+
href: t.url || "#",
|
|
1607
|
+
class: "tpl:cursor-default tpl:no-underline",
|
|
1608
|
+
style: D({
|
|
1609
|
+
color: o(t.color),
|
|
1610
|
+
fontWeight: t.bold ? "bold" : "normal",
|
|
1611
|
+
textDecoration: t.underline ? "underline" : "none"
|
|
1612
|
+
}),
|
|
1613
|
+
onClick: c[0] ||= E(() => {}, ["prevent"])
|
|
1614
|
+
}, [g(sr, { text: t.text || "..." }, null, 8, ["text"])], 12, si), n < e.block.items.length - 1 ? (s(), x("span", {
|
|
1615
|
+
key: 0,
|
|
1616
|
+
style: D({
|
|
1617
|
+
color: e.block.separatorColor,
|
|
1618
|
+
padding: `0 ${e.block.spacing}px`
|
|
1619
|
+
})
|
|
1620
|
+
}, F(e.block.separator), 5)) : S("", !0)], 64))), 128))], 4)) : (s(), x("div", ci, [g(h(Jt), { size: 16 }), k("span", null, F(h(n).menu.addLinks), 1)]))]));
|
|
1621
|
+
}
|
|
1622
|
+
}), ui = /* @__PURE__ */ new Set([
|
|
1623
|
+
"http",
|
|
1624
|
+
"https",
|
|
1625
|
+
"mailto",
|
|
1626
|
+
"tel",
|
|
1627
|
+
"ftp",
|
|
1628
|
+
"ftps",
|
|
1629
|
+
"sms",
|
|
1630
|
+
"xmpp",
|
|
1631
|
+
"cid"
|
|
1632
|
+
]), di = /* @__PURE__ */ new Set([
|
|
1633
|
+
"SCRIPT",
|
|
1634
|
+
"STYLE",
|
|
1635
|
+
"IFRAME",
|
|
1636
|
+
"OBJECT",
|
|
1637
|
+
"EMBED",
|
|
1638
|
+
"LINK",
|
|
1639
|
+
"META",
|
|
1640
|
+
"BASE",
|
|
1641
|
+
"FORM"
|
|
1642
|
+
]), fi = /* @__PURE__ */ new Set([
|
|
1643
|
+
"href",
|
|
1644
|
+
"xlink:href",
|
|
1645
|
+
"formaction",
|
|
1646
|
+
"action",
|
|
1647
|
+
"ping",
|
|
1648
|
+
"background",
|
|
1649
|
+
"poster"
|
|
1650
|
+
]);
|
|
1651
|
+
function pi(e, t) {
|
|
1652
|
+
let n = e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
1653
|
+
if (!n || n.startsWith("#")) return !0;
|
|
1654
|
+
let r = /^([a-z][a-z0-9+.-]*):/i.exec(n);
|
|
1655
|
+
if (!r) return !0;
|
|
1656
|
+
let i = r[1].toLowerCase();
|
|
1657
|
+
return ui.has(i) ? !0 : t && i === "data" ? /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i.test(n) : !1;
|
|
1658
|
+
}
|
|
1659
|
+
function mi(e) {
|
|
1660
|
+
if (di.has(e.tagName)) {
|
|
1661
|
+
e.remove();
|
|
1662
|
+
return;
|
|
1663
|
+
}
|
|
1664
|
+
let t = [];
|
|
1665
|
+
for (let n = 0; n < e.attributes.length; n++) t.push(e.attributes[n].name);
|
|
1666
|
+
for (let n of t) {
|
|
1667
|
+
let t = n.toLowerCase();
|
|
1668
|
+
if (t.startsWith("on")) {
|
|
1669
|
+
e.removeAttribute(n);
|
|
1670
|
+
continue;
|
|
1671
|
+
}
|
|
1672
|
+
if (fi.has(t)) {
|
|
1673
|
+
pi(e.getAttribute(n) ?? "", !1) || e.removeAttribute(n);
|
|
1674
|
+
continue;
|
|
1675
|
+
}
|
|
1676
|
+
if (t === "src") {
|
|
1677
|
+
pi(e.getAttribute(n) ?? "", !0) || e.removeAttribute(n);
|
|
1678
|
+
continue;
|
|
1679
|
+
}
|
|
1680
|
+
t === "srcdoc" && e.removeAttribute(n);
|
|
1681
|
+
}
|
|
1682
|
+
let n = Array.from(e.children);
|
|
1683
|
+
for (let e of n) mi(e);
|
|
1684
|
+
}
|
|
1685
|
+
function hi(e) {
|
|
1686
|
+
if (typeof DOMParser > "u") return e;
|
|
1687
|
+
let t = new DOMParser().parseFromString(`<!doctype html><body>${e}</body>`, "text/html").body, n = Array.from(t.children);
|
|
1688
|
+
for (let e of n) mi(e);
|
|
1689
|
+
return t.innerHTML;
|
|
1690
|
+
}
|
|
1691
|
+
//#endregion
|
|
1692
|
+
//#region src/composables/useEditableTextBlock.ts
|
|
1693
|
+
function gi(e) {
|
|
1694
|
+
let t = n(K, q), r = n(J, null), { syntax: i } = un(), a = b(() => r?.value ? ge(e(), t.value) : Se(e(), t.value)), o = b(() => hi(Te(a.value, i))), s = l(!1), c = l(null), { top: u, left: d } = qe(c), { toLocal: f } = zt(), p = b(() => f({
|
|
1695
|
+
top: u.value - 8,
|
|
1696
|
+
left: d.value
|
|
1697
|
+
}));
|
|
1698
|
+
function m() {
|
|
1699
|
+
s.value = !0;
|
|
1700
|
+
}
|
|
1701
|
+
function h() {
|
|
1702
|
+
s.value = !1;
|
|
1703
|
+
}
|
|
1704
|
+
return {
|
|
1705
|
+
isEditing: s,
|
|
1706
|
+
blockRef: c,
|
|
1707
|
+
toolbarPosition: p,
|
|
1708
|
+
resolvedContent: o,
|
|
1709
|
+
handleDoubleClick: m,
|
|
1710
|
+
handleEditorDone: h
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1713
|
+
//#endregion
|
|
1714
|
+
//#region src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1715
|
+
var _i = ["innerHTML"], vi = /* @__PURE__ */ d({
|
|
1716
|
+
__name: "ParagraphBlock",
|
|
1717
|
+
props: {
|
|
1718
|
+
block: {},
|
|
1719
|
+
viewport: {}
|
|
1720
|
+
},
|
|
1721
|
+
setup(e) {
|
|
1722
|
+
let t = e, n = L(() => import("./ParagraphEditor-DO4RzP8l.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = gi(() => t.block.content);
|
|
1723
|
+
return (t, u) => (s(), x("div", {
|
|
1724
|
+
ref_key: "blockRef",
|
|
1725
|
+
ref: i,
|
|
1726
|
+
class: "tpl:min-h-[1em] tpl:w-full",
|
|
1727
|
+
onDblclick: u[0] ||= (...e) => h(c) && h(c)(...e)
|
|
1728
|
+
}, [h(r) ? (s(), O(h(n), {
|
|
1729
|
+
key: 0,
|
|
1730
|
+
block: e.block,
|
|
1731
|
+
"toolbar-position": h(a),
|
|
1732
|
+
onDone: h(l)
|
|
1733
|
+
}, null, 8, [
|
|
1734
|
+
"block",
|
|
1735
|
+
"toolbar-position",
|
|
1736
|
+
"onDone"
|
|
1737
|
+
])) : (s(), x("div", {
|
|
1738
|
+
key: 1,
|
|
1739
|
+
class: "tpl-text-content tpl:outline-none",
|
|
1740
|
+
innerHTML: h(o)
|
|
1741
|
+
}, null, 8, _i))], 544));
|
|
1742
|
+
}
|
|
1743
|
+
});
|
|
1744
|
+
//#endregion
|
|
1745
|
+
//#region src/utils/blockComponentResolver.ts
|
|
1746
|
+
function yi(e) {
|
|
1747
|
+
let t = { fontFamily: e.fontFamily };
|
|
1748
|
+
return e.textColor && (t.color = e.textColor), e.linkColor && (t["--tpl-doc-link-color"] = e.linkColor), e.linkUnderline && (t["--tpl-doc-link-underline"] = "underline"), t;
|
|
1749
|
+
}
|
|
1750
|
+
function bi(e, t, n) {
|
|
1751
|
+
if (t) {
|
|
1752
|
+
let n = t.getComponent(e);
|
|
1753
|
+
if (n) return n;
|
|
1754
|
+
}
|
|
1755
|
+
return n[e.type] ?? null;
|
|
1756
|
+
}
|
|
1757
|
+
function xi(e) {
|
|
1758
|
+
let { padding: t, backgroundColor: n } = e.styles, r = {
|
|
1759
|
+
padding: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
1760
|
+
backgroundColor: n || "transparent"
|
|
1761
|
+
};
|
|
1762
|
+
return (e.type === "paragraph" || e.type === "title") && (r["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ?? ve.paragraphGap : ve.paragraphGap}px`), e.type === "section" && e.borderRadius && e.borderRadius > 0 && (r.borderRadius = `${e.borderRadius}px`), r;
|
|
1763
|
+
}
|
|
1764
|
+
function Si(e) {
|
|
1765
|
+
if (e.type !== "section" || !e.wrapper) return null;
|
|
1766
|
+
let t = e.wrapper, n = {};
|
|
1767
|
+
return t.backgroundColor && (n.backgroundColor = t.backgroundColor), t.padding && (n.padding = `${t.padding.top}px ${t.padding.right}px ${t.padding.bottom}px ${t.padding.left}px`), t.borderRadius && t.borderRadius > 0 && (n.borderRadius = `${t.borderRadius}px`), n;
|
|
1768
|
+
}
|
|
1769
|
+
//#endregion
|
|
1770
|
+
//#region src/components/blocks/BlockWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
1771
|
+
var Ci = [
|
|
1772
|
+
"data-block-id",
|
|
1773
|
+
"data-block-type",
|
|
1774
|
+
"data-tpl-picked"
|
|
1775
|
+
], wi = ["aria-label"], Ti = [
|
|
1776
|
+
"aria-label",
|
|
1777
|
+
"aria-pressed",
|
|
1778
|
+
"title"
|
|
1779
|
+
], Ei = ["aria-label", "title"], Di = ["aria-label", "title"], Oi = ["aria-label", "title"], ki = {
|
|
1780
|
+
key: 1,
|
|
1781
|
+
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"
|
|
1782
|
+
}, Ai = { 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)]" }, ji = {
|
|
1783
|
+
key: 2,
|
|
1784
|
+
class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
|
|
1785
|
+
}, Mi = ["aria-label", "title"], Ni = {
|
|
1786
|
+
key: 3,
|
|
1787
|
+
class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
|
|
1788
|
+
}, Pi = ["aria-label"], Fi = /*#__PURE__*/ cn(/* @__PURE__ */ d({
|
|
1789
|
+
__name: "BlockWrapper",
|
|
1790
|
+
props: {
|
|
1791
|
+
block: {},
|
|
1792
|
+
isSelected: { type: Boolean },
|
|
1793
|
+
viewport: {},
|
|
1794
|
+
previewMode: { type: Boolean },
|
|
1795
|
+
nested: { type: Boolean },
|
|
1796
|
+
picked: { type: Boolean }
|
|
1797
|
+
},
|
|
1798
|
+
emits: ["select"],
|
|
1799
|
+
setup(e, { emit: t }) {
|
|
1800
|
+
let r = L(() => import("./BlockIssueBadge-9hHpaXb9.js")), i = e, o = t, { t: c, format: u } = X(), d = n(ct, null), f = l(null), p = b(() => d?.liftedBlockId.value === i.block.id), m = b(() => p.value ? u(c.blockActions.dragLifted, { block: i.block.type }) : c.blockActions.drag);
|
|
1801
|
+
async function _() {
|
|
1802
|
+
await T(), f.value?.focus();
|
|
1803
|
+
}
|
|
1804
|
+
function y(e) {
|
|
1805
|
+
if (d) {
|
|
1806
|
+
if (e.key === " " || e.key === "Enter") {
|
|
1807
|
+
e.preventDefault(), e.stopPropagation(), p.value ? d.drop(i.block.id) : d.lift(i.block.id);
|
|
1808
|
+
return;
|
|
1809
|
+
}
|
|
1810
|
+
if (p.value) {
|
|
1811
|
+
if (e.key === "Escape") {
|
|
1812
|
+
e.preventDefault(), e.stopPropagation(), d.cancel(), _();
|
|
1813
|
+
return;
|
|
1814
|
+
}
|
|
1815
|
+
if (e.key === "ArrowUp") {
|
|
1816
|
+
e.preventDefault(), e.stopPropagation(), d.moveUp(i.block.id), _();
|
|
1817
|
+
return;
|
|
1818
|
+
}
|
|
1819
|
+
e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), d.moveDown(i.block.id), _());
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
let C = b(() => !i.viewport || !i.block.visibility ? !1 : i.block.visibility[i.viewport] === !1), w = b(() => i.previewMode === !0 && C.value), O = b(() => i.viewport ? {
|
|
1824
|
+
desktop: c.viewport.desktop,
|
|
1825
|
+
mobile: c.viewport.mobile
|
|
1826
|
+
}[i.viewport] ?? i.viewport : ""), A = b(() => !!i.block.displayCondition), j = n(ht, null), M = n(yt, null), N = n(Ct, {}), P = b(() => N.savedBlocks?.isPicking.value === !0), I = b(() => !i.nested && N.savedBlocks?.isAvailable.value === !0 && N.savedBlocks?.canCreate.value === !0), z = b(() => i.isSelected && !P.value), B = b(() => N.comments?.getBlockCount(i.block.id) ?? 0), V = b(() => xi(i.block)), H = b(() => Si(i.block));
|
|
1827
|
+
function ee(e) {
|
|
1828
|
+
i.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), o("select"));
|
|
1829
|
+
}
|
|
1830
|
+
function te() {
|
|
1831
|
+
j?.deleteBlock(i.block.id);
|
|
1832
|
+
}
|
|
1833
|
+
function U() {
|
|
1834
|
+
j?.duplicateBlock(i.block);
|
|
1835
|
+
}
|
|
1836
|
+
function ne() {
|
|
1837
|
+
N.savedBlocks?.startPicking(i.block.id);
|
|
1838
|
+
}
|
|
1839
|
+
function re() {
|
|
1840
|
+
M?.toggleBlock(i.block.id);
|
|
1841
|
+
}
|
|
1842
|
+
return (t, n) => w.value ? S("", !0) : (s(), x("div", {
|
|
1843
|
+
key: 0,
|
|
1844
|
+
class: v(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow", {
|
|
1845
|
+
"tpl-block--selected": e.isSelected,
|
|
1846
|
+
"tpl-block--picked": e.picked,
|
|
1847
|
+
"tpl-block--idle": !e.isSelected && !e.picked,
|
|
1848
|
+
"tpl-block--lifted": p.value
|
|
1849
|
+
}]),
|
|
1850
|
+
"data-block-id": e.block.id,
|
|
1851
|
+
"data-block-type": e.block.type,
|
|
1852
|
+
"data-tpl-picked": e.picked || void 0,
|
|
1853
|
+
onClick: ee
|
|
1854
|
+
}, [
|
|
1855
|
+
g(h(r), { "block-id": e.block.id }, null, 8, ["block-id"]),
|
|
1856
|
+
z.value ? (s(), x("div", {
|
|
1857
|
+
key: 0,
|
|
1858
|
+
role: "toolbar",
|
|
1859
|
+
"aria-label": h(c).blockActions.drag,
|
|
1860
|
+
class: "tpl-block-actions tpl-fade-in tpl:absolute tpl:-right-2 tpl:top-1/2 tpl:z-10 tpl:flex tpl:-translate-y-1/2 tpl:translate-x-full 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)]"
|
|
1861
|
+
}, [
|
|
1862
|
+
k("button", {
|
|
1863
|
+
ref_key: "dragButtonRef",
|
|
1864
|
+
ref: f,
|
|
1865
|
+
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",
|
|
1866
|
+
"aria-label": m.value,
|
|
1867
|
+
"aria-pressed": p.value,
|
|
1868
|
+
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
1869
|
+
title: h(c).blockActions.drag,
|
|
1870
|
+
onKeydown: y
|
|
1871
|
+
}, [g(h(Zt), {
|
|
1872
|
+
size: 14,
|
|
1873
|
+
"stroke-width": 1.5
|
|
1874
|
+
})], 40, Ti),
|
|
1875
|
+
k("button", {
|
|
1876
|
+
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",
|
|
1877
|
+
"aria-label": h(c).blockActions.duplicate,
|
|
1878
|
+
title: h(c).blockActions.duplicate,
|
|
1879
|
+
onClick: E(U, ["stop"])
|
|
1880
|
+
}, [g(h(Wt), {
|
|
1881
|
+
size: 14,
|
|
1882
|
+
"stroke-width": 1.5
|
|
1883
|
+
})], 8, Ei),
|
|
1884
|
+
I.value ? (s(), x("button", {
|
|
1885
|
+
key: 0,
|
|
1886
|
+
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",
|
|
1887
|
+
"aria-label": h(c).blockActions.saveAsBlock,
|
|
1888
|
+
title: h(c).blockActions.saveAsBlock,
|
|
1889
|
+
onClick: E(ne, ["stop"])
|
|
1890
|
+
}, [g(h(Ut), {
|
|
1891
|
+
size: 14,
|
|
1892
|
+
"stroke-width": 1.5
|
|
1893
|
+
})], 8, Di)) : S("", !0),
|
|
1894
|
+
k("button", {
|
|
1895
|
+
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",
|
|
1896
|
+
"aria-label": h(c).blockActions.delete,
|
|
1897
|
+
title: h(c).blockActions.delete,
|
|
1898
|
+
onClick: E(te, ["stop"])
|
|
1899
|
+
}, [g(h(Yt), {
|
|
1900
|
+
size: 14,
|
|
1901
|
+
"stroke-width": 1.5
|
|
1902
|
+
})], 8, Oi)
|
|
1903
|
+
], 8, wi)) : S("", !0),
|
|
1904
|
+
C.value ? (s(), x("div", ki, [k("span", Ai, [g(h(qt), {
|
|
1905
|
+
size: 12,
|
|
1906
|
+
"stroke-width": 1.5
|
|
1907
|
+
}), R(" " + F(h(u)(h(c).blockActions.hiddenOnViewport, { viewport: O.value })), 1)])])) : S("", !0),
|
|
1908
|
+
A.value && !C.value ? (s(), x("div", ji, [k("button", {
|
|
1909
|
+
"data-testid": "condition-toggle",
|
|
1910
|
+
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)]",
|
|
1911
|
+
"aria-label": h(c).blockActions.conditionToggle,
|
|
1912
|
+
title: e.block.displayCondition?.label,
|
|
1913
|
+
onClick: E(re, ["stop"])
|
|
1914
|
+
}, [g(h(an), {
|
|
1915
|
+
size: 12,
|
|
1916
|
+
"stroke-width": 2
|
|
1917
|
+
})], 8, Mi)])) : S("", !0),
|
|
1918
|
+
B.value > 0 && !C.value ? (s(), x("div", Ni, [k("button", {
|
|
1919
|
+
class: "tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 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)]",
|
|
1920
|
+
"aria-label": h(u)(h(c).blockActions.comments, { count: String(B.value) }),
|
|
1921
|
+
onClick: n[0] ||= E((t) => h(N).comments?.openForBlock(e.block.id), ["stop"])
|
|
1922
|
+
}, [g(h(tn), {
|
|
1923
|
+
size: 12,
|
|
1924
|
+
"stroke-width": 2.5
|
|
1925
|
+
}), R(" " + F(B.value), 1)], 8, Pi)])) : S("", !0),
|
|
1926
|
+
H.value ? (s(), x("div", {
|
|
1927
|
+
key: 4,
|
|
1928
|
+
class: "tpl-section-wrapper",
|
|
1929
|
+
style: D(H.value)
|
|
1930
|
+
}, [k("div", {
|
|
1931
|
+
class: "tpl-block-content",
|
|
1932
|
+
style: D(V.value)
|
|
1933
|
+
}, [a(t.$slots, "default", {}, void 0, !0)], 4)], 4)) : (s(), x("div", {
|
|
1934
|
+
key: 5,
|
|
1935
|
+
class: "tpl-block-content",
|
|
1936
|
+
style: D(V.value)
|
|
1937
|
+
}, [a(t.$slots, "default", {}, void 0, !0)], 4))
|
|
1938
|
+
], 10, Ci));
|
|
1939
|
+
}
|
|
1940
|
+
}), [["__scopeId", "data-v-2c239048"]]);
|
|
1941
|
+
//#endregion
|
|
1942
|
+
//#region src/utils/unwrapParagraph.ts
|
|
1943
|
+
function Ii(e) {
|
|
1944
|
+
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
1945
|
+
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
1946
|
+
}
|
|
1947
|
+
//#endregion
|
|
1948
|
+
//#region src/components/blocks/TitleBlock.vue
|
|
1949
|
+
var Li = /* @__PURE__ */ d({
|
|
1950
|
+
__name: "TitleBlock",
|
|
1951
|
+
props: {
|
|
1952
|
+
block: {},
|
|
1953
|
+
viewport: {}
|
|
1954
|
+
},
|
|
1955
|
+
setup(e) {
|
|
1956
|
+
let t = e, n = L(() => import("./TitleEditor-uKu33Nwr.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = gi(() => t.block.content), d = b(() => {
|
|
1957
|
+
let e = {
|
|
1958
|
+
fontSize: `${De[t.block.level]}px`,
|
|
1959
|
+
textAlign: t.block.textAlign
|
|
1960
|
+
};
|
|
1961
|
+
return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = t.block.fontFamily), e;
|
|
1962
|
+
}), f = b(() => `h${t.block.level}`), p = b(() => Ii(o.value));
|
|
1963
|
+
return (t, o) => (s(), x("div", {
|
|
1964
|
+
ref_key: "blockRef",
|
|
1965
|
+
ref: i,
|
|
1966
|
+
class: "tpl:min-h-[1em] tpl:w-full",
|
|
1967
|
+
style: D(d.value),
|
|
1968
|
+
onDblclick: o[0] ||= (...e) => h(c) && h(c)(...e)
|
|
1969
|
+
}, [h(r) ? (s(), O(h(n), {
|
|
1970
|
+
key: 0,
|
|
1971
|
+
block: e.block,
|
|
1972
|
+
"toolbar-position": h(a),
|
|
1973
|
+
onDone: h(l)
|
|
1974
|
+
}, null, 8, [
|
|
1975
|
+
"block",
|
|
1976
|
+
"toolbar-position",
|
|
1977
|
+
"onDone"
|
|
1978
|
+
])) : (s(), O(u(f.value), {
|
|
1979
|
+
key: 1,
|
|
1980
|
+
class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-tight tpl:outline-none",
|
|
1981
|
+
style: { color: "inherit" },
|
|
1982
|
+
innerHTML: p.value
|
|
1983
|
+
}, null, 8, ["innerHTML"]))], 36));
|
|
1984
|
+
}
|
|
1985
|
+
});
|
|
1986
|
+
//#endregion
|
|
1987
|
+
//#region src/utils/sectionColumnDrop.ts
|
|
1988
|
+
function Ri(e) {
|
|
1989
|
+
return e.dataset.blockType !== "section" && e.dataset.paletteType !== "section";
|
|
1990
|
+
}
|
|
1991
|
+
//#endregion
|
|
1992
|
+
//#region src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1993
|
+
var zi = { class: "tpl:w-full" }, Bi = {
|
|
1994
|
+
key: 0,
|
|
1995
|
+
"data-testid": "section-drop-hint",
|
|
1996
|
+
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)]"
|
|
1997
|
+
}, Vi = /* @__PURE__ */ d({
|
|
1998
|
+
__name: "SectionBlock",
|
|
1999
|
+
props: {
|
|
2000
|
+
block: {},
|
|
2001
|
+
viewport: {}
|
|
2002
|
+
},
|
|
2003
|
+
setup(e) {
|
|
2004
|
+
let t = {
|
|
2005
|
+
title: Li,
|
|
2006
|
+
paragraph: vi,
|
|
2007
|
+
image: ai,
|
|
2008
|
+
button: lr,
|
|
2009
|
+
divider: Br,
|
|
2010
|
+
custom: Rr
|
|
2011
|
+
}, a = e, { t: o } = X(), c = pt(Y, "SectionBlock"), l = n(yt, null), d = n(At, null), p = n(Ct, {}), m = n(kt, null);
|
|
2012
|
+
function _(e) {
|
|
2013
|
+
let t = p.savedBlocks;
|
|
2014
|
+
if (t?.isPicking.value) {
|
|
2015
|
+
t.togglePick(a.block.id);
|
|
2016
|
+
return;
|
|
2017
|
+
}
|
|
2018
|
+
c.selectBlock(e);
|
|
2019
|
+
}
|
|
2020
|
+
let y = b(() => {
|
|
2021
|
+
switch (a.block.columns) {
|
|
2022
|
+
case "2": return ["50%", "50%"];
|
|
2023
|
+
case "3": return [
|
|
2024
|
+
"33.33%",
|
|
2025
|
+
"33.33%",
|
|
2026
|
+
"33.33%"
|
|
2027
|
+
];
|
|
2028
|
+
case "1-2": return ["33.33%", "66.67%"];
|
|
2029
|
+
case "2-1": return ["66.67%", "33.33%"];
|
|
2030
|
+
default: return ["100%"];
|
|
2031
|
+
}
|
|
2032
|
+
}), C = b(() => {
|
|
2033
|
+
let e = y.value.length, t = [...a.block.children];
|
|
2034
|
+
for (; t.length < e;) t.push([]);
|
|
2035
|
+
return t.slice(0, e);
|
|
2036
|
+
}), w = b(() => a.viewport === "mobile" && a.block.stackOnMobile !== !1);
|
|
2037
|
+
function T(e) {
|
|
2038
|
+
return C.value[e] || [];
|
|
2039
|
+
}
|
|
2040
|
+
function E(e, t) {
|
|
2041
|
+
let n = t.map((e) => JSON.parse(JSON.stringify(e))), r = [...a.block.children];
|
|
2042
|
+
for (; r.length <= e;) r.push([]);
|
|
2043
|
+
r[e] = n, c.updateBlock(a.block.id, { children: r });
|
|
2044
|
+
}
|
|
2045
|
+
function A(e) {
|
|
2046
|
+
return bi(e, d, t);
|
|
2047
|
+
}
|
|
2048
|
+
function j(e, t) {
|
|
2049
|
+
e.type === "custom" && c.updateBlock(e.id, {
|
|
2050
|
+
fieldValues: t.fieldValues,
|
|
2051
|
+
dataSourceFetched: t.dataSourceFetched
|
|
2052
|
+
});
|
|
2053
|
+
}
|
|
2054
|
+
return (t, n) => (s(), x("div", zi, [k("div", { class: v(["tpl:flex tpl:gap-0", { "tpl:flex-col": w.value }]) }, [(s(!0), x(P, null, r(C.value, (t, n) => (s(), x("div", {
|
|
2055
|
+
key: n,
|
|
2056
|
+
class: v(["tpl:relative tpl:min-h-[60px] tpl:rounded", T(n).length === 0 ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
|
|
2057
|
+
style: D({ width: w.value ? "100%" : y.value[n] })
|
|
2058
|
+
}, [g(h(N), {
|
|
2059
|
+
"model-value": T(n),
|
|
2060
|
+
group: {
|
|
2061
|
+
name: "blocks",
|
|
2062
|
+
pull: !0,
|
|
2063
|
+
put: (e, t, n) => h(Ri)(n)
|
|
2064
|
+
},
|
|
2065
|
+
animation: 150,
|
|
2066
|
+
"ghost-class": "tpl-ghost",
|
|
2067
|
+
"drag-class": "tpl-dragging",
|
|
2068
|
+
handle: ".tpl-block-btn",
|
|
2069
|
+
"invert-swap": !0,
|
|
2070
|
+
"inverted-swap-threshold": .65,
|
|
2071
|
+
"empty-insert-threshold": 20,
|
|
2072
|
+
"force-fallback": !0,
|
|
2073
|
+
class: "tpl:min-h-[60px]",
|
|
2074
|
+
"onUpdate:modelValue": (e) => E(n, e)
|
|
2075
|
+
}, {
|
|
2076
|
+
default: i(() => [(s(!0), x(P, null, r(T(n), (t) => f((s(), x("div", { key: t.id }, [g(Fi, {
|
|
2077
|
+
block: t,
|
|
2078
|
+
"is-selected": h(c).state.selectedBlockId === t.id,
|
|
2079
|
+
viewport: e.viewport,
|
|
2080
|
+
"preview-mode": h(c).state.previewMode,
|
|
2081
|
+
nested: "",
|
|
2082
|
+
onSelect: (e) => _(t.id)
|
|
2083
|
+
}, {
|
|
2084
|
+
default: i(() => [(s(), O(u(A(t)), {
|
|
2085
|
+
block: t,
|
|
2086
|
+
viewport: e.viewport,
|
|
2087
|
+
onFetchData: (e) => j(t, e),
|
|
2088
|
+
onUpdate: (e) => h(c).updateBlock(t.id, e)
|
|
2089
|
+
}, null, 40, [
|
|
2090
|
+
"block",
|
|
2091
|
+
"viewport",
|
|
2092
|
+
"onFetchData",
|
|
2093
|
+
"onUpdate"
|
|
2094
|
+
]))]),
|
|
2095
|
+
_: 2
|
|
2096
|
+
}, 1032, [
|
|
2097
|
+
"block",
|
|
2098
|
+
"is-selected",
|
|
2099
|
+
"viewport",
|
|
2100
|
+
"preview-mode",
|
|
2101
|
+
"onSelect"
|
|
2102
|
+
])])), [[M, h(m) === !1 || !h(l)?.isHidden(t.id)]])), 128))]),
|
|
2103
|
+
_: 2
|
|
2104
|
+
}, 1032, [
|
|
2105
|
+
"model-value",
|
|
2106
|
+
"group",
|
|
2107
|
+
"onUpdate:modelValue"
|
|
2108
|
+
]), T(n).length === 0 ? (s(), x("div", Bi, [k("span", null, F(h(o).section.dropHere), 1)])) : S("", !0)], 6))), 128))], 2)]));
|
|
2109
|
+
}
|
|
2110
|
+
}), Hi = [
|
|
2111
|
+
"width",
|
|
2112
|
+
"height",
|
|
2113
|
+
"fill"
|
|
2114
|
+
], Ui = ["d"], Wi = /* @__PURE__ */ d({
|
|
2115
|
+
__name: "SocialIconSvg",
|
|
2116
|
+
props: {
|
|
2117
|
+
platform: {},
|
|
2118
|
+
iconStyle: {},
|
|
2119
|
+
iconSize: {}
|
|
2120
|
+
},
|
|
2121
|
+
setup(e) {
|
|
2122
|
+
let t = e, n = b(() => Le[t.platform]), r = b(() => ze[t.iconSize]), i = b(() => {
|
|
2123
|
+
let e = {
|
|
2124
|
+
display: "inline-flex",
|
|
2125
|
+
alignItems: "center",
|
|
2126
|
+
justifyContent: "center",
|
|
2127
|
+
width: `${r.value}px`,
|
|
2128
|
+
height: `${r.value}px`
|
|
2129
|
+
};
|
|
2130
|
+
switch (t.iconStyle) {
|
|
2131
|
+
case "solid": return {
|
|
2132
|
+
...e,
|
|
2133
|
+
backgroundColor: n.value.color,
|
|
2134
|
+
borderRadius: "4px"
|
|
2135
|
+
};
|
|
2136
|
+
case "outlined": return {
|
|
2137
|
+
...e,
|
|
2138
|
+
backgroundColor: "transparent",
|
|
2139
|
+
border: `2px solid ${n.value.color}`,
|
|
2140
|
+
borderRadius: "4px"
|
|
2141
|
+
};
|
|
2142
|
+
case "rounded": return {
|
|
2143
|
+
...e,
|
|
2144
|
+
backgroundColor: n.value.color,
|
|
2145
|
+
borderRadius: "8px"
|
|
2146
|
+
};
|
|
2147
|
+
case "square": return {
|
|
2148
|
+
...e,
|
|
2149
|
+
backgroundColor: n.value.color,
|
|
2150
|
+
borderRadius: "0"
|
|
2151
|
+
};
|
|
2152
|
+
case "circle": return {
|
|
2153
|
+
...e,
|
|
2154
|
+
backgroundColor: n.value.color,
|
|
2155
|
+
borderRadius: "50%"
|
|
2156
|
+
};
|
|
2157
|
+
default: return e;
|
|
2158
|
+
}
|
|
2159
|
+
}), a = b(() => Math.floor(r.value * .6)), o = b(() => t.iconStyle === "outlined" ? n.value.color : "#ffffff");
|
|
2160
|
+
return (e, t) => (s(), x("span", { style: D(i.value) }, [(s(), x("svg", {
|
|
2161
|
+
width: a.value,
|
|
2162
|
+
height: a.value,
|
|
2163
|
+
viewBox: "0 0 24 24",
|
|
2164
|
+
fill: o.value,
|
|
2165
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2166
|
+
}, [k("path", { d: n.value.path }, null, 8, Ui)], 8, Hi))], 4));
|
|
2167
|
+
}
|
|
2168
|
+
}), Gi = { class: "tpl:w-full" }, Ki = ["href"], qi = {
|
|
2169
|
+
key: 1,
|
|
2170
|
+
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)]"
|
|
2171
|
+
}, Ji = /* @__PURE__ */ d({
|
|
2172
|
+
__name: "SocialIconsBlock",
|
|
2173
|
+
props: {
|
|
2174
|
+
block: {},
|
|
2175
|
+
viewport: {}
|
|
2176
|
+
},
|
|
2177
|
+
setup(e) {
|
|
2178
|
+
let t = e, { t: n } = X(), i = b(() => ({
|
|
2179
|
+
display: "flex",
|
|
2180
|
+
flexWrap: "wrap",
|
|
2181
|
+
gap: `${t.block.spacing}px`,
|
|
2182
|
+
justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
|
|
2183
|
+
})), a = b(() => t.block.icons.length > 0);
|
|
2184
|
+
return (t, o) => (s(), x("div", Gi, [a.value ? (s(), x("div", {
|
|
2185
|
+
key: 0,
|
|
2186
|
+
style: D(i.value)
|
|
2187
|
+
}, [(s(!0), x(P, null, r(e.block.icons, (t) => (s(), x("a", {
|
|
2188
|
+
key: t.id,
|
|
2189
|
+
href: t.url || "#",
|
|
2190
|
+
class: "tpl:cursor-default",
|
|
2191
|
+
onClick: o[0] ||= E(() => {}, ["prevent"])
|
|
2192
|
+
}, [g(Wi, {
|
|
2193
|
+
platform: t.platform,
|
|
2194
|
+
"icon-style": e.block.iconStyle,
|
|
2195
|
+
"icon-size": e.block.iconSize
|
|
2196
|
+
}, null, 8, [
|
|
2197
|
+
"platform",
|
|
2198
|
+
"icon-style",
|
|
2199
|
+
"icon-size"
|
|
2200
|
+
])], 8, Ki))), 128))], 4)) : (s(), x("div", qi, [g(h(Ht), { size: 16 }), k("span", null, F(h(n).social.addIcons), 1)]))]));
|
|
2201
|
+
}
|
|
2202
|
+
}), Yi = { class: "tpl:w-full" }, Xi = {
|
|
2203
|
+
key: 0,
|
|
2204
|
+
class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
2205
|
+
style: {
|
|
2206
|
+
"background-color": "var(--tpl-bg-hover)",
|
|
2207
|
+
color: "var(--tpl-text-dim)"
|
|
2208
|
+
}
|
|
2209
|
+
}, Zi = /* @__PURE__ */ d({
|
|
2210
|
+
__name: "SpacerBlock",
|
|
2211
|
+
props: {
|
|
2212
|
+
block: {},
|
|
2213
|
+
viewport: {}
|
|
2214
|
+
},
|
|
2215
|
+
setup(e) {
|
|
2216
|
+
let t = e, n = pt(Y, "SpacerBlock"), r = b(() => ({
|
|
2217
|
+
height: `${t.block.height}px`,
|
|
2218
|
+
minHeight: `${t.block.height}px`,
|
|
2219
|
+
...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
2220
|
+
}));
|
|
2221
|
+
return (t, i) => (s(), x("div", Yi, [k("div", {
|
|
2222
|
+
style: D(r.value),
|
|
2223
|
+
class: v(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:border-y tpl:border-dashed": !h(n).state.previewMode }])
|
|
2224
|
+
}, [h(n).state.previewMode ? S("", !0) : (s(), x("span", Xi, F(e.block.height) + "px ", 1))], 6)]));
|
|
2225
|
+
}
|
|
2226
|
+
}), Qi = { class: "tpl:w-full" }, $i = { key: 0 }, ea = [
|
|
2227
|
+
"aria-label",
|
|
2228
|
+
"data-placeholder",
|
|
2229
|
+
"onBlur"
|
|
2230
|
+
], ta = [
|
|
2231
|
+
"aria-label",
|
|
2232
|
+
"data-placeholder",
|
|
2233
|
+
"onBlur"
|
|
2234
|
+
], na = {
|
|
2235
|
+
key: 1,
|
|
2236
|
+
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)]"
|
|
2237
|
+
}, ra = /*#__PURE__*/ cn(/* @__PURE__ */ d({
|
|
2238
|
+
__name: "TableBlock",
|
|
2239
|
+
props: {
|
|
2240
|
+
block: {},
|
|
2241
|
+
viewport: {}
|
|
2242
|
+
},
|
|
2243
|
+
setup(e) {
|
|
2244
|
+
let t = {
|
|
2245
|
+
mounted(e, t) {
|
|
2246
|
+
e.textContent = t.value ?? "";
|
|
2247
|
+
},
|
|
2248
|
+
updated(e, t) {
|
|
2249
|
+
t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
|
|
2250
|
+
}
|
|
2251
|
+
}, n = e, { t: i } = X(), a = pt(Y, "TableBlock"), o = b(() => n.block.rows.length > 0), c = b(() => {
|
|
2252
|
+
let e = {
|
|
2253
|
+
width: "100%",
|
|
2254
|
+
borderCollapse: "collapse",
|
|
2255
|
+
fontSize: `${n.block.fontSize}px`,
|
|
2256
|
+
textAlign: n.block.textAlign,
|
|
2257
|
+
fontFamily: n.block.fontFamily || "inherit"
|
|
2258
|
+
};
|
|
2259
|
+
return n.block.color && (e.color = n.block.color), e;
|
|
2260
|
+
}), l = b(() => ({
|
|
2261
|
+
border: `${n.block.borderWidth}px solid ${n.block.borderColor}`,
|
|
2262
|
+
padding: `${n.block.cellPadding}px`,
|
|
2263
|
+
textAlign: n.block.textAlign
|
|
2264
|
+
})), u = b(() => ({
|
|
2265
|
+
...l.value,
|
|
2266
|
+
fontWeight: "bold",
|
|
2267
|
+
backgroundColor: n.block.headerBackgroundColor || "transparent"
|
|
2268
|
+
})), d = b(() => n.block.hasHeaderRow && n.block.rows.length > 0 ? n.block.rows[0] : null), p = b(() => n.block.hasHeaderRow ? n.block.rows.slice(1) : n.block.rows);
|
|
2269
|
+
function m() {
|
|
2270
|
+
a.selectBlock(n.block.id);
|
|
2271
|
+
}
|
|
2272
|
+
function v(e, t, r) {
|
|
2273
|
+
let i = r.target.innerText.trim(), o = n.block.rows.map((n) => n.id === e ? {
|
|
2274
|
+
...n,
|
|
2275
|
+
cells: n.cells.map((e) => e.id === t ? {
|
|
2276
|
+
...e,
|
|
2277
|
+
content: i
|
|
2278
|
+
} : e)
|
|
2279
|
+
} : n);
|
|
2280
|
+
a.updateBlock(n.block.id, { rows: o });
|
|
2281
|
+
}
|
|
2282
|
+
return (e, n) => (s(), x("div", Qi, [o.value ? (s(), x("table", {
|
|
2283
|
+
key: 0,
|
|
2284
|
+
style: D(c.value),
|
|
2285
|
+
class: "tpl-table-editable"
|
|
2286
|
+
}, [d.value ? (s(), x("thead", $i, [k("tr", null, [(s(!0), x(P, null, r(d.value.cells, (e) => f((s(), x("th", {
|
|
2287
|
+
key: e.id,
|
|
2288
|
+
style: D(u.value),
|
|
2289
|
+
"aria-label": h(i).table.cellPlaceholder,
|
|
2290
|
+
contenteditable: "true",
|
|
2291
|
+
"data-placeholder": h(i).table.cellPlaceholder,
|
|
2292
|
+
onBlur: (t) => v(d.value.id, e.id, t),
|
|
2293
|
+
onKeydown: n[0] ||= _(E((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
2294
|
+
onClick: E(m, ["stop"])
|
|
2295
|
+
}, null, 44, ea)), [[t, e.content]])), 128))])])) : S("", !0), k("tbody", null, [(s(!0), x(P, null, r(p.value, (e) => (s(), x("tr", { key: e.id }, [(s(!0), x(P, null, r(e.cells, (r) => f((s(), x("td", {
|
|
2296
|
+
key: r.id,
|
|
2297
|
+
style: D(l.value),
|
|
2298
|
+
"aria-label": h(i).table.cellPlaceholder,
|
|
2299
|
+
contenteditable: "true",
|
|
2300
|
+
"data-placeholder": h(i).table.cellPlaceholder,
|
|
2301
|
+
onBlur: (t) => v(e.id, r.id, t),
|
|
2302
|
+
onKeydown: n[1] ||= _(E((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
2303
|
+
onClick: E(m, ["stop"])
|
|
2304
|
+
}, null, 44, ta)), [[t, r.content]])), 128))]))), 128))])], 4)) : (s(), x("div", na, [g(h(rn), { size: 16 }), k("span", null, F(h(i).table.empty), 1)]))]));
|
|
2305
|
+
}
|
|
2306
|
+
}), [["__scopeId", "data-v-963ac422"]]), ia = /* @__PURE__ */ d({
|
|
2307
|
+
__name: "VideoPlayButton",
|
|
2308
|
+
props: { hoverEffect: {
|
|
2309
|
+
type: Boolean,
|
|
2310
|
+
default: !1
|
|
2311
|
+
} },
|
|
2312
|
+
setup(e) {
|
|
2313
|
+
return (t, n) => (s(), x("div", { class: v(["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] ||= [k("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)]" }, [k("svg", {
|
|
2314
|
+
class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
|
|
2315
|
+
width: "28",
|
|
2316
|
+
height: "28",
|
|
2317
|
+
viewBox: "0 0 24 24",
|
|
2318
|
+
fill: "currentColor"
|
|
2319
|
+
}, [k("polygon", { points: "5,3 19,12 5,21" })])], -1)]], 2));
|
|
2320
|
+
}
|
|
2321
|
+
});
|
|
2322
|
+
//#endregion
|
|
2323
|
+
//#region src/utils/videoThumbnail.ts
|
|
2324
|
+
function aa(e) {
|
|
2325
|
+
if (!e) return {
|
|
2326
|
+
platform: "unknown",
|
|
2327
|
+
videoId: null,
|
|
2328
|
+
thumbnailUrl: null
|
|
2329
|
+
};
|
|
2330
|
+
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]) {
|
|
2331
|
+
let n = e.match(t);
|
|
2332
|
+
if (n) {
|
|
2333
|
+
let e = n[1];
|
|
2334
|
+
return {
|
|
2335
|
+
platform: "youtube",
|
|
2336
|
+
videoId: e,
|
|
2337
|
+
thumbnailUrl: `https://img.youtube.com/vi/${e}/maxresdefault.jpg`
|
|
2338
|
+
};
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
let t = e.match(/vimeo\.com\/(?:video\/)?(\d+)/i);
|
|
2342
|
+
if (t) {
|
|
2343
|
+
let e = t[1];
|
|
2344
|
+
return {
|
|
2345
|
+
platform: "vimeo",
|
|
2346
|
+
videoId: e,
|
|
2347
|
+
thumbnailUrl: `https://vumbnail.com/${e}.jpg`
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
return {
|
|
2351
|
+
platform: "unknown",
|
|
2352
|
+
videoId: null,
|
|
2353
|
+
thumbnailUrl: null
|
|
2354
|
+
};
|
|
2355
|
+
}
|
|
2356
|
+
function oa(e, t) {
|
|
2357
|
+
return t || aa(e).thumbnailUrl;
|
|
2358
|
+
}
|
|
2359
|
+
//#endregion
|
|
2360
|
+
//#region src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2361
|
+
var sa = ["src", "alt"], ca = {
|
|
2362
|
+
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
2363
|
+
style: { opacity: "0.7" }
|
|
2364
|
+
}, la = ["href"], ua = ["src", "alt"], da = ["src", "alt"], fa = {
|
|
2365
|
+
key: 3,
|
|
2366
|
+
class: "tpl:flex 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)]"
|
|
2367
|
+
}, pa = /* @__PURE__ */ d({
|
|
2368
|
+
__name: "VideoBlock",
|
|
2369
|
+
props: {
|
|
2370
|
+
block: {},
|
|
2371
|
+
viewport: {}
|
|
2372
|
+
},
|
|
2373
|
+
setup(e) {
|
|
2374
|
+
let t = e, { t: n } = X(), { syntax: r } = un(), i = b(() => W(t.block.url, r) || W(t.block.thumbnailUrl, r)), a = yn(() => i.value ? void 0 : t.block.thumbnailUrl || void 0), o = yn(() => i.value ? t.block.placeholderUrl : void 0), c = b(() => i.value ? null : t.block.thumbnailUrl ? a.value ?? null : oa(t.block.url)), l = b(() => ({ textAlign: t.block.align })), u = b(() => {
|
|
2375
|
+
let e = t.block.align;
|
|
2376
|
+
return {
|
|
2377
|
+
maxWidth: "100%",
|
|
2378
|
+
width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
|
|
2379
|
+
height: t.block.height ? `${t.block.height}px` : void 0,
|
|
2380
|
+
display: "block",
|
|
2381
|
+
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
2382
|
+
marginRight: e === "center" ? "auto" : void 0
|
|
2383
|
+
};
|
|
2384
|
+
}), d = b(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), f = b(() => W(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
|
|
2385
|
+
return (t, r) => (s(), x("div", {
|
|
2386
|
+
class: "tpl:w-full",
|
|
2387
|
+
style: D(l.value)
|
|
2388
|
+
}, [i.value && e.block.placeholderUrl ? (s(), x("div", {
|
|
2389
|
+
key: 0,
|
|
2390
|
+
class: "tpl:relative tpl:inline-block",
|
|
2391
|
+
style: D(u.value)
|
|
2392
|
+
}, [k("img", {
|
|
2393
|
+
class: "tpl:w-full tpl:border-0",
|
|
2394
|
+
src: h(o),
|
|
2395
|
+
alt: e.block.alt,
|
|
2396
|
+
style: D(d.value)
|
|
2397
|
+
}, null, 12, sa), g(ia)], 4)) : i.value ? (s(), x("div", {
|
|
2398
|
+
key: 1,
|
|
2399
|
+
class: "tpl:relative tpl:!flex 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)]",
|
|
2400
|
+
style: D([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
|
|
2401
|
+
}, [g(h($t), {
|
|
2402
|
+
size: 36,
|
|
2403
|
+
"stroke-width": 1.5,
|
|
2404
|
+
class: "tpl:text-[var(--tpl-primary)]",
|
|
2405
|
+
style: { opacity: "0.5" }
|
|
2406
|
+
}), k("span", ca, [g(sr, { text: f.value }, null, 8, ["text"])])], 4)) : c.value ? (s(), x(P, { key: 2 }, [e.block.url ? (s(), x("a", {
|
|
2407
|
+
key: 0,
|
|
2408
|
+
href: e.block.url,
|
|
2409
|
+
target: "_blank",
|
|
2410
|
+
rel: "noopener noreferrer",
|
|
2411
|
+
class: "tpl:group tpl:relative tpl:inline-block",
|
|
2412
|
+
style: D(u.value),
|
|
2413
|
+
onClick: r[0] ||= E(() => {}, ["prevent"])
|
|
2414
|
+
}, [k("img", {
|
|
2415
|
+
class: "tpl:w-full tpl:border-0",
|
|
2416
|
+
src: c.value,
|
|
2417
|
+
alt: e.block.alt,
|
|
2418
|
+
style: D(d.value)
|
|
2419
|
+
}, null, 12, ua), g(ia, { "hover-effect": "" })], 12, la)) : (s(), x("div", {
|
|
2420
|
+
key: 1,
|
|
2421
|
+
class: "tpl:relative tpl:inline-block",
|
|
2422
|
+
style: D(u.value)
|
|
2423
|
+
}, [k("img", {
|
|
2424
|
+
class: "tpl:w-full tpl:border-0",
|
|
2425
|
+
src: c.value,
|
|
2426
|
+
alt: e.block.alt,
|
|
2427
|
+
style: D(d.value)
|
|
2428
|
+
}, null, 12, da), g(ia)], 4))], 64)) : (s(), x("div", fa, [g(h($t), {
|
|
2429
|
+
size: 40,
|
|
2430
|
+
"stroke-width": 1.5,
|
|
2431
|
+
class: "tpl:text-[var(--tpl-border-light)]"
|
|
2432
|
+
}), k("span", null, F(h(n).video.addVideo), 1)]))], 4));
|
|
2433
|
+
}
|
|
2434
|
+
}), ma = {
|
|
2435
|
+
section: Vi,
|
|
2436
|
+
title: Li,
|
|
2437
|
+
paragraph: vi,
|
|
2438
|
+
image: ai,
|
|
2439
|
+
button: lr,
|
|
2440
|
+
divider: Br,
|
|
2441
|
+
video: pa,
|
|
2442
|
+
social: Ji,
|
|
2443
|
+
menu: li,
|
|
2444
|
+
table: ra,
|
|
2445
|
+
spacer: Zi,
|
|
2446
|
+
html: Kr,
|
|
2447
|
+
countdown: L(() => import("./CountdownBlock-DdC8Lg5F.js"))
|
|
2448
|
+
};
|
|
2449
|
+
function ha(e) {
|
|
2450
|
+
let { editor: n, config: r, translations: i, fontsManager: a } = e, { t: s, format: u } = X(i), d = b(() => U(U(U(Ln(i), nr(n.content.value.settings?.locale)), se(n.content.value.settings) === "rtl" ? {
|
|
2451
|
+
title: { textAlign: "right" },
|
|
2452
|
+
table: { textAlign: "right" }
|
|
2453
|
+
} : {}), r.blockDefaults ?? {}));
|
|
2454
|
+
n.setUiTheme(r.uiTheme ?? "auto");
|
|
2455
|
+
let { resolvedTheme: f } = Tn(b(() => n.state.uiTheme)), p = l(r.theme ?? {}), { themeStyles: h } = Dn({
|
|
2456
|
+
themeOverrides: p,
|
|
2457
|
+
resolvedTheme: f,
|
|
2458
|
+
extraStyles: () => ({
|
|
2459
|
+
"--tpl-drop-text": `"${i.canvas.dropHere}"`,
|
|
2460
|
+
...e.themeExtraStyles?.()
|
|
2461
|
+
})
|
|
2462
|
+
}), g = Me({
|
|
2463
|
+
content: n.content,
|
|
2464
|
+
setContent: (e, t) => n.setContent(e, t),
|
|
2465
|
+
...e.historyOptions
|
|
2466
|
+
});
|
|
2467
|
+
Ie(n, g);
|
|
2468
|
+
let _ = Ve({
|
|
2469
|
+
addBlock: n.addBlock,
|
|
2470
|
+
removeBlock: n.removeBlock,
|
|
2471
|
+
updateBlock: n.updateBlock,
|
|
2472
|
+
selectBlock: n.selectBlock,
|
|
2473
|
+
findBlockLocation: n.findBlockLocation,
|
|
2474
|
+
blockDefaults: () => d.value
|
|
2475
|
+
}), v = Ne(n), x = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? Be({
|
|
2476
|
+
content: n.content,
|
|
2477
|
+
isDirty: () => n.state.isDirty,
|
|
2478
|
+
...e.autoSaveOptions
|
|
2479
|
+
}) : null, S = null;
|
|
2480
|
+
x && (S = t(g.isNavigating, (e) => {
|
|
2481
|
+
e ? x.pause() : x.resume();
|
|
2482
|
+
}));
|
|
2483
|
+
let C = wn(n, {
|
|
2484
|
+
t: s,
|
|
2485
|
+
format: u
|
|
2486
|
+
}, r.customBlocks ?? []), w = Lt(r.colors);
|
|
2487
|
+
if (w.allowCustomIgnored && Z.warn("config.colors.allowCustom: false is ignored without presets — keeping the color wheel and hex input so a color can still be chosen."), w.invalidPresets.length > 0 && Z.warn(`config.colors.presets skipped invalid entries: ${w.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), w.allowCustom === !1) {
|
|
2488
|
+
let e = In(w.presets, r.blockDefaults, r.templateDefaults);
|
|
2489
|
+
e.length > 0 && Z.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.`);
|
|
2490
|
+
}
|
|
2491
|
+
let T = Bt(r.templateSettings);
|
|
2492
|
+
for (let e of T.unknown) Z.warn(`config.templateSettings.fields: "${e}" is not a template setting (expected one of ${Vt.join(", ")}) — skipping it.`);
|
|
2493
|
+
let E = On();
|
|
2494
|
+
Nn(E, ma);
|
|
2495
|
+
let D = /* @__PURE__ */ new Set();
|
|
2496
|
+
function O(e) {
|
|
2497
|
+
for (let t of e) {
|
|
2498
|
+
E.registerCustom(t, Rr);
|
|
2499
|
+
for (let e of rr(t, w)) D.has(e.id) || (D.add(e.id), Z.warn(e.message));
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
r.customBlocks?.length && O(r.customBlocks);
|
|
2503
|
+
let k = hn();
|
|
2504
|
+
if (o() && m(k.dispose), e.containerEl) {
|
|
2505
|
+
let t = e.containerEl;
|
|
2506
|
+
G(document, "pointerdown", (e) => {
|
|
2507
|
+
let n = t.value;
|
|
2508
|
+
n && (e.composedPath?.() ?? []).includes(n) && k.claim();
|
|
2509
|
+
}, { capture: !0 });
|
|
2510
|
+
}
|
|
2511
|
+
function A() {
|
|
2512
|
+
let t = e.capabilities?.templates;
|
|
2513
|
+
if (t) {
|
|
2514
|
+
t.save();
|
|
2515
|
+
return;
|
|
2516
|
+
}
|
|
2517
|
+
x?.flush();
|
|
2518
|
+
}
|
|
2519
|
+
function j(t) {
|
|
2520
|
+
k.isActive() && ar(t, {
|
|
2521
|
+
history: g,
|
|
2522
|
+
selectBlock: (e) => n.selectBlock(e),
|
|
2523
|
+
getSelectedBlockId: () => n.state.selectedBlockId,
|
|
2524
|
+
removeBlock: (e) => n.removeBlock(e),
|
|
2525
|
+
onSave: A,
|
|
2526
|
+
onBeforeUndo: e.keyboardOptions?.onBeforeUndo,
|
|
2527
|
+
isPicking: () => e.capabilities?.savedBlocks?.isPicking.value === !0,
|
|
2528
|
+
onConfirmPick: () => e.capabilities?.savedBlocks?.confirmPicking(),
|
|
2529
|
+
onCancelPick: () => e.capabilities?.savedBlocks?.cancelPicking()
|
|
2530
|
+
});
|
|
2531
|
+
}
|
|
2532
|
+
G(document, "keydown", j);
|
|
2533
|
+
let M = l(null);
|
|
2534
|
+
c(mt, e.editorRoot ?? document), c(Ft, M), c(Ot, i), c(Y, n), c(Pt, g), c(ht, _), c(yt, v), c(jt, a), c(nt, h), c(ft, f), c(Et, d), c(tt, r.locale), c(At, E), c(Dt, r.customBlocks ?? []), c(st, r.paletteBlocks), c(gt, Pn(r.htmlBlockPreview)), c(vt, w), c($e, T.fields), c(wt, kn(n.content, E));
|
|
2535
|
+
let N = _e(r.mergeTags?.syntax), P = y(r.mergeTags?.tags ?? []);
|
|
2536
|
+
function F(e) {
|
|
2537
|
+
if (!Array.isArray(e)) {
|
|
2538
|
+
Z.warn(`setMergeTags() expects an array of merge tags, received ${typeof e} — ignoring.`);
|
|
2539
|
+
return;
|
|
2540
|
+
}
|
|
2541
|
+
P.value = e;
|
|
2542
|
+
}
|
|
2543
|
+
c(K, P), c(at, N), c(rt, r.mergeTags?.onRequest ?? null), c(ot, r.mergeTags?.autocomplete !== !1), c(it, r.mergeTags?.showRawValue !== !1);
|
|
2544
|
+
let I = l(ke(r.mergeTags?.tags ?? []));
|
|
2545
|
+
c(xt, I);
|
|
2546
|
+
let L = _n({
|
|
2547
|
+
resolvePreview: r.resolvePreview,
|
|
2548
|
+
getContent: () => n.content.value,
|
|
2549
|
+
isActive: () => n.state.previewMode
|
|
2550
|
+
});
|
|
2551
|
+
c(Ye, L), c(ut, r.resolvePreview);
|
|
2552
|
+
let R = b(() => !(n.state.previewMode && L.isConfigured));
|
|
2553
|
+
c(kt, R);
|
|
2554
|
+
let z = bn();
|
|
2555
|
+
c(St, z), c(Je, l(!1)), c(Ze, l(!1)), c(Mt, r.logicTags?.tags ?? []), c(Xe, r.logicTags?.pairs ?? []), c(Qe, r.logicTags?.onRequest ?? null), c(lt, xn()), c(et, r.onRequestMedia ?? null), c(_t, r.canDropMedia ?? null), c(Nt, r.resolveImageUrl ? vn(r.resolveImageUrl) : null), c(bt, r.displayConditions?.conditions ?? []), c(Tt, r.displayConditions?.allowCustom ?? !1), c(Ct, e.capabilities ?? {}), c(ct, C);
|
|
2556
|
+
let B = Sn(r.lint) ? null : Cn({
|
|
2557
|
+
content: n.content,
|
|
2558
|
+
options: r.lint ?? {},
|
|
2559
|
+
updateBlock: n.updateBlock,
|
|
2560
|
+
updateSettings: n.updateSettings,
|
|
2561
|
+
removeBlock: n.removeBlock
|
|
2562
|
+
});
|
|
2563
|
+
c(dt, B);
|
|
2564
|
+
function V() {
|
|
2565
|
+
S?.(), B?.destroy(), x?.destroy(), g.destroy();
|
|
2566
|
+
}
|
|
2567
|
+
return {
|
|
2568
|
+
t: s,
|
|
2569
|
+
format: u,
|
|
2570
|
+
history: g,
|
|
2571
|
+
blockActions: _,
|
|
2572
|
+
conditionPreview: v,
|
|
2573
|
+
autoSave: x,
|
|
2574
|
+
resolvedTheme: f,
|
|
2575
|
+
themeStyles: h,
|
|
2576
|
+
themeOverrides: p,
|
|
2577
|
+
registry: E,
|
|
2578
|
+
keyboardReorder: C,
|
|
2579
|
+
templateLint: B,
|
|
2580
|
+
popoverRoot: M,
|
|
2581
|
+
mergeTagSampleMode: I,
|
|
2582
|
+
previewResolution: L,
|
|
2583
|
+
appliesConditionFilter: R,
|
|
2584
|
+
registerCustomBlocks: O,
|
|
2585
|
+
setMergeTags: F,
|
|
2586
|
+
destroy: V
|
|
2587
|
+
};
|
|
2588
|
+
}
|
|
2589
|
+
//#endregion
|
|
2590
|
+
export { Xn as A, mr as C, $n as D, Gn as E, Jn as M, _n as N, Qn as O, hr as S, lr as T, Rr as _, Ji as a, Tr as b, Fi as c, bi as d, vi as f, Br as g, Kr as h, Zi as i, Yn as j, Zn as k, xi as l, ai as m, pa as n, Vi as o, li as p, ra as r, Li as s, ha as t, yi as u, kr as v, fr as w, br as x, Dr as y };
|
|
2591
|
+
|
|
2592
|
+
//# sourceMappingURL=useEditorCore-BHmIp1hW.js.map
|