@templatical/editor 0.38.0 → 0.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/dist/{AiChatSidebar-tu4eLcf_.js → AiChatSidebar-pOxCZWz9.js} +67 -67
- package/dist/{AiFeatureMenu-BF0i0vA4.js → AiFeatureMenu-Bljk6Qjv.js} +7 -7
- package/dist/{BlockIssueBadge-DT-FqKeC.js → BlockIssueBadge-D5oGxOQP.js} +5 -5
- package/dist/{BlockPreviewCanvas-DDCmMram.js → BlockPreviewCanvas-DXGjUECG.js} +27 -27
- package/dist/{CloudHeaderExtras-NPhudovT.js → CloudHeaderExtras-DaocwNmy.js} +5 -5
- package/dist/{CloudPanels-Iwnky0iA.js → CloudPanels-CyZAnSJY.js} +7 -7
- package/dist/{CollaboratorBar-DAITu0hz.js → CollaboratorBar-C7Zca3g1.js} +4 -4
- package/dist/{CommentsPanel-CDvgmWP1.js → CommentsPanel-CNOb7YCm.js} +2 -2
- package/dist/{CommentsSidebar-X_xqM3dR.js → CommentsSidebar-VmwjU9va.js} +14 -14
- package/dist/{CountdownBlock-ZFJIdbP6.js → CountdownBlock-DSvbf3qU.js} +3 -3
- package/dist/{CountdownToolbar-DBFoG3a6.js → CountdownToolbar-C2kfS6Oy.js} +31 -30
- package/dist/{DesignReferenceSidebar--QtXjLrw.js → DesignReferenceSidebar-QC4gEUWp.js} +11 -11
- package/dist/{IssuesPanel-BLbNFMSX.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/{MediaPanels-CMTAhDXB.js → MediaPanels-Cc4UkfG1.js} +2 -2
- package/dist/MergeTagInput-QI-5KG2R.js +81 -0
- package/dist/{MergeTagModeToggle-DKN6ihI5.js → MergeTagModeToggle-D793Bj_E.js} +32 -73
- package/dist/{ParagraphEditor-1E9yzOfk.js → ParagraphEditor-DkkPSexG.js} +50 -51
- package/dist/{RestoreVersionDialog-BMGUkcd8.js → RestoreVersionDialog-BgueZnZr.js} +5 -5
- package/dist/{RichTextEditorContent-BnxbQUV9.js → RichTextEditorContent-BC5UTVnb.js} +12 -12
- package/dist/{SaveBlockDialog-WKASpCCT.js → SaveBlockDialog-BuTuVlLr.js} +12 -11
- package/dist/{SavedBlocksBrowserModal-AYEXTMtQ.js → SavedBlocksBrowserModal-Srhix8BB.js} +17 -16
- package/dist/{SavedBlocksPanels-D_CpacTl.js → SavedBlocksPanels-B2iScCS-.js} +2 -2
- package/dist/{SavedBlocksPickBar-BHMwg-1G.js → SavedBlocksPickBar-cI7bDQQi.js} +4 -4
- package/dist/{TemplateScoringPanel-CSin43YM.js → TemplateScoringPanel-C2Rdlyn6.js} +104 -104
- package/dist/TemplateSettings-C_5leDdF.js +245 -0
- package/dist/{TestEmailModal-BxizsRCd.js → TestEmailModal-DJ5q_u4N.js} +55 -55
- package/dist/{TestEmailPanel-vd2e5HzT.js → TestEmailPanel-CP24UGst.js} +2 -2
- package/dist/{TitleEditor-CLJ68Ty4.js → TitleEditor-QBBOXtxx.js} +18 -18
- package/dist/ToggleSwitch-JvQ_CmI1.js +102 -0
- package/dist/Toolbar-COD2TW20.js +2426 -0
- package/dist/{TplModal-Q9fDgS1M.js → TplModal-C8xGjC1l.js} +5 -5
- package/dist/{VersionHistoryMenu-eGYVhM4H.js → VersionHistoryMenu-BVQityes.js} +10 -10
- package/dist/{VersionHistoryPanels-C7Ntrrfq.js → VersionHistoryPanels-BrK6na4A.js} +2 -2
- package/dist/{VersionPreviewBanner-BbQXnR0M.js → VersionPreviewBanner-BaMSgA1O.js} +3 -3
- package/dist/{blockTypeIcons-5qD4bB76.js → blockTypeIcons-CdXugKyV.js} +16 -37
- package/dist/bundle-stats.json +8 -8
- package/dist/{cdn/chunks/ca-D9S-UCfZ.js → ca-YlPDhElv.js} +5 -3
- package/dist/cdn/chunks/{AiChatSidebar-dyqqHAcI.js → AiChatSidebar-CjSEoK4x.js} +54 -54
- package/dist/cdn/chunks/AiChatSidebar-CjSEoK4x.js.map +1 -0
- package/dist/cdn/chunks/{AiFeatureMenu-BjVMwhW8.js → AiFeatureMenu-l0K5TOSn.js} +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-BjVMwhW8.js.map → AiFeatureMenu-l0K5TOSn.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-BJ__oEtm.js → BlockIssueBadge-9hHpaXb9.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-BJ__oEtm.js.map → BlockIssueBadge-9hHpaXb9.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-B5f26eLE.js → BlockPreviewCanvas-lQrAdgG3.js} +30 -30
- package/dist/cdn/chunks/{BlockPreviewCanvas-B5f26eLE.js.map → BlockPreviewCanvas-lQrAdgG3.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-D5P5IEKA.js → CloudHeaderExtras-CXNe7Q-4.js} +5 -5
- package/dist/cdn/chunks/{CloudHeaderExtras-D5P5IEKA.js.map → CloudHeaderExtras-CXNe7Q-4.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-DkmR05nB.js → CloudPanels-bHhh9AUA.js} +6 -6
- package/dist/cdn/chunks/{CloudPanels-DkmR05nB.js.map → CloudPanels-bHhh9AUA.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-Yn7KSpt4.js → CollaboratorBar-DgqcaGGI.js} +5 -5
- package/dist/cdn/chunks/{CollaboratorBar-Yn7KSpt4.js.map → CollaboratorBar-DgqcaGGI.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-CntwwocI.js → CommentsPanel-Cy4TlTHC.js} +3 -3
- package/dist/cdn/chunks/{CommentsPanel-CntwwocI.js.map → CommentsPanel-Cy4TlTHC.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-BLDKnKy7.js → CommentsSidebar-C7oAP3Mx.js} +5 -5
- package/dist/cdn/chunks/{CommentsSidebar-BLDKnKy7.js.map → CommentsSidebar-C7oAP3Mx.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-B4AfqJwb.js → CountdownBlock-DdC8Lg5F.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-B4AfqJwb.js.map → CountdownBlock-DdC8Lg5F.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CA1dpuOI.js → CountdownToolbar-CN9h4nlC.js} +22 -21
- package/dist/cdn/chunks/{CountdownToolbar-CA1dpuOI.js.map → CountdownToolbar-CN9h4nlC.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-D1Y9Hswe.js → DesignReferenceSidebar-Bjo0M-AY.js} +7 -7
- package/dist/cdn/chunks/{DesignReferenceSidebar-D1Y9Hswe.js.map → DesignReferenceSidebar-Bjo0M-AY.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-Q62LTqvd.js → IssuesPanel-DdFk-Blf.js} +6 -6
- package/dist/cdn/chunks/{IssuesPanel-Q62LTqvd.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/{MediaPanels-D21M6shx.js → MediaPanels-kX9AZQ7K.js} +3 -3
- package/dist/cdn/chunks/{MediaPanels-D21M6shx.js.map → MediaPanels-kX9AZQ7K.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-DYxkAGtA.js → MergeTagModeToggle-n3nvSNeQ.js} +33 -33
- package/dist/cdn/chunks/{MergeTagModeToggle-DYxkAGtA.js.map → MergeTagModeToggle-n3nvSNeQ.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-Bd-GQXee.js → ParagraphEditor-DO4RzP8l.js} +43 -43
- package/dist/cdn/chunks/{ParagraphEditor-Bd-GQXee.js.map → ParagraphEditor-DO4RzP8l.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-2X9RpM9A.js → RestoreVersionDialog-CzZ_sFnz.js} +5 -5
- package/dist/cdn/chunks/{RestoreVersionDialog-2X9RpM9A.js.map → RestoreVersionDialog-CzZ_sFnz.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-D_rb0rmU.js → RichTextEditorContent-Ch5zeyZ7.js} +9 -9
- package/dist/cdn/chunks/{RichTextEditorContent-D_rb0rmU.js.map → RichTextEditorContent-Ch5zeyZ7.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CufdTomT.js → SaveBlockDialog-LgxYrXyx.js} +10 -9
- package/dist/cdn/chunks/{SaveBlockDialog-CufdTomT.js.map → SaveBlockDialog-LgxYrXyx.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CqpaNsk7.js → SavedBlocksBrowserModal-CdeSsTpb.js} +9 -9
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CqpaNsk7.js.map → SavedBlocksBrowserModal-CdeSsTpb.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-DpxYxddo.js → SavedBlocksPanels-B5hakNJj.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-DpxYxddo.js.map → SavedBlocksPanels-B5hakNJj.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-Drpoav1B.js → SavedBlocksPickBar-Cl6PLwwV.js} +5 -5
- package/dist/cdn/chunks/{SavedBlocksPickBar-Drpoav1B.js.map → SavedBlocksPickBar-Cl6PLwwV.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-DBjUNULq.js → TemplateScoringPanel--JxR6CsQ.js} +86 -86
- package/dist/cdn/chunks/TemplateScoringPanel--JxR6CsQ.js.map +1 -0
- package/dist/cdn/chunks/TemplateSettings-DjXiiiNr.js +207 -0
- package/dist/cdn/chunks/TemplateSettings-DjXiiiNr.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailModal-BTNlSW6f.js → TestEmailModal-BAuDxJtD.js} +53 -53
- package/dist/cdn/chunks/TestEmailModal-BAuDxJtD.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailPanel-D0A9Zgxr.js → TestEmailPanel-GUGZisLp.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-D0A9Zgxr.js.map → TestEmailPanel-GUGZisLp.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CrnuIq62.js → TitleEditor-uKu33Nwr.js} +16 -16
- package/dist/cdn/chunks/TitleEditor-uKu33Nwr.js.map +1 -0
- 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-DYXrTz42.js → TplModal-DuwS2ifK.js} +5 -5
- package/dist/cdn/chunks/{TplModal-DYXrTz42.js.map → TplModal-DuwS2ifK.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-bDGnE4hb.js → VersionHistoryMenu-Dij1pTEb.js} +6 -6
- package/dist/cdn/chunks/{VersionHistoryMenu-bDGnE4hb.js.map → VersionHistoryMenu-Dij1pTEb.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-82P0Q0HM.js → VersionHistoryPanels-GeR6MStB.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryPanels-82P0Q0HM.js.map → VersionHistoryPanels-GeR6MStB.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-BJiwKkVC.js → VersionPreviewBanner-Df3FVlig.js} +4 -4
- package/dist/cdn/chunks/{VersionPreviewBanner-BJiwKkVC.js.map → VersionPreviewBanner-Df3FVlig.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-CNjJSFun.js → blockTypeIcons-raBjStuv.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-CNjJSFun.js.map → blockTypeIcons-raBjStuv.js.map} +1 -1
- package/dist/{ca-D9S-UCfZ.js → cdn/chunks/ca-YlPDhElv.js} +7 -1
- package/dist/cdn/chunks/{ca-D9S-UCfZ.js.map → ca-YlPDhElv.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-U-qCH-dq.js → createCloudRuntime-D5bXzcTe.js} +6 -6
- package/dist/cdn/chunks/{createCloudRuntime-U-qCH-dq.js.map → createCloudRuntime-D5bXzcTe.js.map} +1 -1
- package/dist/cdn/chunks/{de-BUPszLpi.js → de-CONjnzrF.js} +6 -2
- package/dist/cdn/chunks/{de-BUPszLpi.js.map → de-CONjnzrF.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-MXgtarMl.js → editor-modal-C_xYN_66.js} +7 -7
- package/dist/cdn/chunks/{editor-modal-MXgtarMl.js.map → editor-modal-C_xYN_66.js.map} +1 -1
- package/dist/cdn/chunks/{en-BbOC5x3w.js → en-BAMooiOF.js} +6 -2
- package/dist/cdn/chunks/{en-BbOC5x3w.js.map → en-BAMooiOF.js.map} +1 -1
- package/dist/cdn/chunks/en-BwfjKb4M.js +2 -0
- package/dist/{es-0bCDcT9p.js → cdn/chunks/es-I47lHs2m.js} +7 -1
- package/dist/cdn/chunks/{es-0bCDcT9p.js.map → es-I47lHs2m.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-B8_jnIkD.js → extensions-Bhu8UEE5.js} +185 -100
- package/dist/cdn/chunks/extensions-Bhu8UEE5.js.map +1 -0
- package/dist/cdn/chunks/{fr-Brr8mJ9e.js → fr-B8MIKjT4.js} +6 -2
- package/dist/cdn/chunks/{fr-Brr8mJ9e.js.map → fr-B8MIKjT4.js.map} +1 -1
- package/dist/cdn/chunks/htmlparser-ClUZ6waR.js +1113 -0
- package/dist/cdn/chunks/htmlparser-ClUZ6waR.js.map +1 -0
- package/dist/cdn/chunks/{icons-BUlqGSgd.js → icons-BKkJ-5xF.js} +36 -36
- package/dist/cdn/chunks/{icons-BUlqGSgd.js.map → icons-BKkJ-5xF.js.map} +1 -1
- package/dist/cdn/chunks/keys-dJbD1QPs.js +12 -0
- package/dist/cdn/chunks/keys-dJbD1QPs.js.map +1 -0
- package/dist/{nl-Co3_RL0M.js → cdn/chunks/nl-CBLxcb-0.js} +7 -1
- package/dist/cdn/chunks/{nl-Co3_RL0M.js.map → nl-CBLxcb-0.js.map} +1 -1
- package/dist/{pt-BR-BECez5b0.js → cdn/chunks/pt-BR-CMSRfX7t.js} +7 -1
- package/dist/cdn/chunks/{pt-BR-BECez5b0.js.map → pt-BR-CMSRfX7t.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-IGLRmUar.js → src-CZ-W8YBa.js} +4 -4
- package/dist/cdn/chunks/{src-IGLRmUar.js.map → src-CZ-W8YBa.js.map} +1 -1
- package/dist/cdn/chunks/{src-CUvZWL6Y.js → src-CaNsA_WX.js} +2 -2
- package/dist/cdn/chunks/{src-CUvZWL6Y.js.map → src-CaNsA_WX.js.map} +1 -1
- package/dist/cdn/chunks/src-Dwgq7hf4.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-DSWSGj-A.js → useCloudI18n-C09JcFS0.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-DSWSGj-A.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-B0zW2nT4.js.map → useEditorRoot-DFx2fXJP.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-Dlo7R9RA.js → useI18n-DTZ9sIcv.js} +3 -3
- package/dist/cdn/chunks/{useI18n-Dlo7R9RA.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-BE8oDoha.js +60 -0
- package/dist/cdn/chunks/useMergeTag-BE8oDoha.js.map +1 -0
- package/dist/cdn/chunks/{usePopoverPosition-ElP3ABaV.js → usePopoverPosition-gB9q-ql7.js} +3 -3
- package/dist/cdn/chunks/{usePopoverPosition-ElP3ABaV.js.map → usePopoverPosition-gB9q-ql7.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-nTbWkgaU.js → useScrollToBlock-CtTXwmiU.js} +3 -3
- package/dist/cdn/chunks/{useScrollToBlock-nTbWkgaU.js.map → useScrollToBlock-CtTXwmiU.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +856 -3347
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-DWtkBzBU.js → check-eqb2JhqU.js} +1 -1
- package/dist/{chevron-down-C-Fjxcqj.js → chevron-down-Dkr-7Ywl.js} +1 -1
- package/dist/{chevron-right-SOkn2d4P.js → chevron-right-Bge4XF_B.js} +1 -1
- package/dist/{chevron-up-lntU1ypp.js → chevron-up-CQAyl0kC.js} +1 -1
- package/dist/{circle-alert-CjzUTwy3.js → circle-alert-CYgTHKWr.js} +1 -1
- package/dist/{clock-pB2QKPsJ.js → clock-BgSJZJP5.js} +1 -1
- package/dist/{cloud-DdidMW6f.js → cloud-C9xWZXhg.js} +1 -1
- package/dist/{copy-CId1E038.js → copy-mw6PVnOJ.js} +1 -1
- package/dist/{createCloudRuntime-x5WZm3p8.js → createCloudRuntime-BGd5--Bq.js} +5 -5
- package/dist/{createLucideIcon-Cwf_nTzE.js → createLucideIcon-BxY5yz5u.js} +6 -6
- package/dist/{de-BUPszLpi.js → de-CONjnzrF.js} +5 -1
- 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-B_LaQf0s.js → editor-modal-OPhP71YO.js} +20 -20
- package/dist/{en-BbOC5x3w.js → en-BAMooiOF.js} +5 -1
- package/dist/en-CjNopehs.js +2 -0
- package/dist/{cdn/chunks/es-0bCDcT9p.js → es-I47lHs2m.js} +5 -3
- package/dist/extensions-DRN-elXT.js +1645 -0
- package/dist/{eye-BuGtFUoJ.js → eye-DphkRtAD.js} +1 -1
- package/dist/{fr-Brr8mJ9e.js → fr-B8MIKjT4.js} +5 -1
- package/dist/{image-up-gH4JEpU5.js → image-up-Qi2BXD7T.js} +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/{info-BQ60P82u.js → info-VSyAs02q.js} +1 -1
- package/dist/keys-BdoSgsz9.js +10 -0
- package/dist/{link-3R8it3J7.js → link-CNuozGqD.js} +1 -1
- package/dist/{list-Ccdgj46T.js → list-BA0I5Wmu.js} +1 -1
- package/dist/{loader-circle-B_tAD4k6.js → loader-circle-z5eeqasv.js} +1 -1
- package/dist/{message-circle-P-KSc6V0.js → message-circle-BsQ9hEup.js} +1 -1
- package/dist/{cdn/chunks/nl-Co3_RL0M.js → nl-CBLxcb-0.js} +5 -3
- package/dist/package-OkXfuRoO.js +25 -0
- package/dist/{pencil-9ZiwqS4r.js → pencil-DFVFA7Dj.js} +1 -1
- package/dist/{plus-BwJEzCaO.js → plus-D8bkVjZ7.js} +1 -1
- package/dist/{cdn/chunks/pt-BR-BECez5b0.js → pt-BR-CMSRfX7t.js} +5 -3
- package/dist/{refresh-cw-DEgfb2FK.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-DqQ8Li5E.js → search-C-dCgqIa.js} +1 -1
- package/dist/{send-CE6uvqop.js → send-Cm2fy2zm.js} +1 -1
- package/dist/{shield-check-DhD1Z3rd.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-R0ZQHa6F.js → sparkles-Ds0RF8Iu.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templateSettingsFields-YCFVBVYh.js +34 -0
- package/dist/templatical-editor.js +945 -3511
- package/dist/{text-align-start-DSux2UNn.js → text-align-start-DiavaIm6.js} +1 -1
- package/dist/{trash-Cf_SqsER.js → trash-DnOkfu2V.js} +1 -1
- package/dist/{triangle-alert-C6tGa6jw.js → triangle-alert-DGLAyXnh.js} +1 -1
- package/dist/{upload-DusKjpVr.js → upload-BBDme2cy.js} +1 -1
- package/dist/{useAliveFlag-oyByIcjy.js → useAliveFlag-BkKyhkwZ.js} +1 -1
- package/dist/{useCloudI18n-BLyh_e2T.js → useCloudI18n-D1iedlP3.js} +2 -2
- package/dist/useEditorCore-C5APBjjV.js +4097 -0
- package/dist/{useEditorRoot-ds57-l6F.js → useEditorRoot-BOxn5EfP.js} +2 -2
- package/dist/{useI18n-BbdxxpOE.js → useI18n-Ds_-druD.js} +2 -2
- package/dist/useLogicTag-DoHfc08B.js +36 -0
- package/dist/useMergeTag-DXyum3kG.js +58 -0
- package/dist/{usePopoverPosition-CprM5p-c.js → usePopoverPosition-Du-Ah8E9.js} +2 -2
- package/dist/{useScrollToBlock-BTFw0b9O.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-D_-42Ukq.js → x-3BHV3Q6K.js} +1 -1
- package/package.json +16 -16
- package/dist/ColorPicker-BqlZ_TqG.js +0 -501
- package/dist/FieldRow-C8nOknr_.js +0 -128
- package/dist/MergeTagInput-BEjzj4Iu.js +0 -457
- package/dist/MergeTagSuggestion-DKoLEeoj.js +0 -1329
- package/dist/cdn/chunks/AiChatSidebar-dyqqHAcI.js.map +0 -1
- package/dist/cdn/chunks/ColorPicker-LcrzgMoW.js +0 -502
- package/dist/cdn/chunks/ColorPicker-LcrzgMoW.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-l7paaAml.js +0 -419
- package/dist/cdn/chunks/MergeTagInput-l7paaAml.js.map +0 -1
- package/dist/cdn/chunks/MergeTagSuggestion-t8Uj00Er.js +0 -215
- package/dist/cdn/chunks/MergeTagSuggestion-t8Uj00Er.js.map +0 -1
- package/dist/cdn/chunks/TemplateScoringPanel-DBjUNULq.js.map +0 -1
- package/dist/cdn/chunks/TestEmailModal-BTNlSW6f.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-CrnuIq62.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/en-C9U7N77n.js +0 -2
- package/dist/cdn/chunks/extensions-B8_jnIkD.js.map +0 -1
- package/dist/cdn/chunks/htmlparser-DTML8Gvz.js +0 -1007
- package/dist/cdn/chunks/htmlparser-DTML8Gvz.js.map +0 -1
- package/dist/cdn/chunks/keys-DBFhDFng.js +0 -12
- package/dist/cdn/chunks/keys-DBFhDFng.js.map +0 -1
- package/dist/cdn/chunks/tiptap-Epe8m3Vo.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-Cs7rYVBo.js +0 -3689
- package/dist/cdn/chunks/useEditorCore-Cs7rYVBo.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-B0zW2nT4.js +0 -10
- package/dist/cdn/chunks/useMergeTag-BYAifvh8.js +0 -46
- package/dist/cdn/chunks/useMergeTag-BYAifvh8.js.map +0 -1
- package/dist/en-DcmpWV53.js +0 -2
- package/dist/extensions-CHOBZRab.js +0 -445
- package/dist/keys-DQA2i1k1.js +0 -10
- package/dist/useEditorCore-DhlKOYwe.js +0 -5273
- package/dist/useMergeTag-DlvOBW_B.js +0 -44
|
@@ -0,0 +1,4097 @@
|
|
|
1
|
+
import { $ as e, A as t, At as n, B as r, D as i, E as a, F as o, J as s, K as c, M as l, N as u, O as d, R as f, S as p, V as m, W as h, Y as g, Z as _, _ as v, at as y, b, c as x, d as S, g as C, h as w, it as T, j as E, jt as D, k as O, kt as k, l as A, nt as j, r as M, rt as ee, s as N, u as P, v as F, y as te } from "./vue.runtime.esm-bundler-CyqhBwpY.js";
|
|
2
|
+
import { c as I, o as ne, s as re } from "./runtime-dom.esm-bundler-BGbPz4-g.js";
|
|
3
|
+
import { A as ie, B as ae, C as oe, E as se, F as ce, H as le, I as ue, L as de, M as fe, N as pe, O as me, P as he, R as ge, S as _e, T as ve, U as ye, V as be, W as xe, _ as Se, b as Ce, d as we, f as Te, g as Ee, h as De, i as Oe, k as ke, l as Ae, n as je, o as Me, p as Ne, r as Pe, t as Fe, v as Ie, w as Le, x as Re, y as ze, z as Be } from "./dist-tGkjkX-v.js";
|
|
4
|
+
import { C as Ve, _ as He, a as Ue, b as We, c as Ge, d as Ke, g as qe, i as Je, l as Ye, n as Xe, o as Ze, s as Qe, t as $e, u as et, w as tt, x as nt } from "./socialIcons-DkGcpEwC.js";
|
|
5
|
+
import { _ as rt, h as it, v as at, y as ot } from "./dist-8VFzbeu9.js";
|
|
6
|
+
import { a as st, c as ct, i as lt } from "./dist-BDuPwOyn.js";
|
|
7
|
+
import { A as ut, B as dt, C as ft, D as pt, E as mt, F as ht, G as gt, I as _t, J as vt, K as yt, L as bt, M as xt, N as St, O as Ct, P as wt, R as Tt, S as Et, T as Dt, V as Ot, W as kt, X as At, Y as jt, Z as Mt, _ as Nt, a as Pt, b as Ft, c as It, d as Lt, f as Rt, g as zt, h as Bt, j as Vt, k as Ht, l as Ut, m as Wt, n as Gt, o as Kt, p as qt, q as Jt, r as Yt, s as Xt, v as Zt, w as Qt, x as $t, y as en, z as tn } from "./keys-BdoSgsz9.js";
|
|
8
|
+
import { t as nn } from "./useI18n-Ds_-druD.js";
|
|
9
|
+
import { t as rn } from "./logger-BBlvSn6q.js";
|
|
10
|
+
import { i as an, o as on, r as sn, t as cn } from "./usePopoverPosition-Du-Ah8E9.js";
|
|
11
|
+
import { r as ln, t as un } from "./templateSettingsFields-YCFVBVYh.js";
|
|
12
|
+
import { t as dn } from "./createLucideIcon-BxY5yz5u.js";
|
|
13
|
+
import { t as fn } from "./copy-mw6PVnOJ.js";
|
|
14
|
+
import { t as pn } from "./loader-circle-z5eeqasv.js";
|
|
15
|
+
import { t as mn } from "./message-circle-BsQ9hEup.js";
|
|
16
|
+
import { t as hn } from "./trash-DnOkfu2V.js";
|
|
17
|
+
import { t as gn } from "./triangle-alert-DGLAyXnh.js";
|
|
18
|
+
import { t as _n } from "./upload-BBDme2cy.js";
|
|
19
|
+
import { t as vn } from "./LoadingTrack-C2jKCU2d.js";
|
|
20
|
+
import { t as yn } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
21
|
+
import { t as bn } from "./useEditorRoot-BOxn5EfP.js";
|
|
22
|
+
import "./useCloudI18n-D1iedlP3.js";
|
|
23
|
+
import { t as xn } from "./useMergeTag-DXyum3kG.js";
|
|
24
|
+
import { t as Sn } from "./useLogicTag-DoHfc08B.js";
|
|
25
|
+
import { t as Cn } from "./useAliveFlag-BkKyhkwZ.js";
|
|
26
|
+
//#region src/utils/activeEditorTracker.ts
|
|
27
|
+
var wn = /* @__PURE__ */ new Set(), Tn = 0, En = 0;
|
|
28
|
+
function Dn() {
|
|
29
|
+
let e = ++En;
|
|
30
|
+
return wn.add(e), Tn === 0 && (Tn = e), {
|
|
31
|
+
id: e,
|
|
32
|
+
isActive: () => wn.size <= 1 || Tn === e,
|
|
33
|
+
claim: () => {
|
|
34
|
+
Tn = e;
|
|
35
|
+
},
|
|
36
|
+
dispose: () => {
|
|
37
|
+
if (wn.delete(e), Tn === e) {
|
|
38
|
+
let e = Array.from(wn);
|
|
39
|
+
Tn = e[e.length - 1] ?? 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/composables/usePreviewResolution.ts
|
|
46
|
+
var On = 500;
|
|
47
|
+
function kn(e) {
|
|
48
|
+
let t = typeof e.resolvePreview == "function", n = _(null), r = _(!1), i = _(!1), a = 0, o = null;
|
|
49
|
+
function c() {
|
|
50
|
+
o !== null && (clearTimeout(o), o = null);
|
|
51
|
+
}
|
|
52
|
+
async function l() {
|
|
53
|
+
let t = e.resolvePreview;
|
|
54
|
+
if (!t) return;
|
|
55
|
+
let o = ++a;
|
|
56
|
+
r.value = !0;
|
|
57
|
+
let s = {
|
|
58
|
+
content: le(e.getContent()),
|
|
59
|
+
...e.getRecipient?.() === void 0 ? {} : { recipient: e.getRecipient() }
|
|
60
|
+
};
|
|
61
|
+
try {
|
|
62
|
+
let e = await t(s);
|
|
63
|
+
if (o !== a) return;
|
|
64
|
+
if (!de(e)) {
|
|
65
|
+
i.value = !0;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
n.value = e, i.value = !1;
|
|
69
|
+
} catch {
|
|
70
|
+
if (o !== a) return;
|
|
71
|
+
i.value = !0;
|
|
72
|
+
} finally {
|
|
73
|
+
o === a && (r.value = !1);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function u() {
|
|
77
|
+
if (t) {
|
|
78
|
+
if (c(), n.value === null) {
|
|
79
|
+
l();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
o = setTimeout(() => {
|
|
83
|
+
o = null, l();
|
|
84
|
+
}, On);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return f(() => [e.isActive(), e.getRecipient?.()], ([e]) => {
|
|
88
|
+
if (!e) {
|
|
89
|
+
c(), a++, r.value = !1, n.value = null, i.value = !1;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
u();
|
|
93
|
+
}, { immediate: !0 }), s(() => {
|
|
94
|
+
c(), a++;
|
|
95
|
+
}), {
|
|
96
|
+
isConfigured: t,
|
|
97
|
+
content: N(() => n.value ?? e.getContent()),
|
|
98
|
+
isResolving: r,
|
|
99
|
+
isInitialResolve: N(() => r.value && n.value === null),
|
|
100
|
+
hasFailed: i,
|
|
101
|
+
supersedesSamples: N(() => t)
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/composables/useImageUrlResolver.ts
|
|
106
|
+
function An(e) {
|
|
107
|
+
let t = g(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
108
|
+
function r(e) {
|
|
109
|
+
return t.get(e);
|
|
110
|
+
}
|
|
111
|
+
function i(e) {
|
|
112
|
+
return t.has(e) || n.has(e);
|
|
113
|
+
}
|
|
114
|
+
function a(r) {
|
|
115
|
+
if (i(r)) return;
|
|
116
|
+
let a;
|
|
117
|
+
try {
|
|
118
|
+
a = e(r);
|
|
119
|
+
} catch {
|
|
120
|
+
t.set(r, null);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (a === null || typeof a == "string") {
|
|
124
|
+
t.set(r, a);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
n.add(r), Promise.resolve(a).then((e) => {
|
|
128
|
+
t.set(r, typeof e == "string" ? e : null);
|
|
129
|
+
}, () => {
|
|
130
|
+
t.set(r, null);
|
|
131
|
+
}).finally(() => n.delete(r));
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
get: r,
|
|
135
|
+
has: i,
|
|
136
|
+
lookup: a
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function jn(e) {
|
|
140
|
+
let t = p($t, null), n = N(e);
|
|
141
|
+
if (!t) return n;
|
|
142
|
+
let r;
|
|
143
|
+
function i() {
|
|
144
|
+
r !== void 0 && (clearTimeout(r), r = void 0);
|
|
145
|
+
}
|
|
146
|
+
h() && s(i);
|
|
147
|
+
let a = !0;
|
|
148
|
+
return f(n, (e) => {
|
|
149
|
+
i();
|
|
150
|
+
let n = a;
|
|
151
|
+
if (a = !1, e && !t.has(e)) {
|
|
152
|
+
if (n) {
|
|
153
|
+
t.lookup(e);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
r = setTimeout(() => {
|
|
157
|
+
r = void 0, t.lookup(e);
|
|
158
|
+
}, 300);
|
|
159
|
+
}
|
|
160
|
+
}, { immediate: !0 }), N(() => {
|
|
161
|
+
let e = n.value;
|
|
162
|
+
if (!e) return e;
|
|
163
|
+
let r = t.get(e);
|
|
164
|
+
return typeof r == "string" && r.length > 0 ? r : e;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/composables/useMergeTagPicker.ts
|
|
169
|
+
function Mn() {
|
|
170
|
+
let e = _(!1), t = _([]), n = _(null), r = null;
|
|
171
|
+
function i(i, a) {
|
|
172
|
+
if (r) {
|
|
173
|
+
let e = r;
|
|
174
|
+
r = null, e(null);
|
|
175
|
+
}
|
|
176
|
+
return t.value = i, n.value = a?.current ?? null, e.value = !0, new Promise((e) => {
|
|
177
|
+
r = e;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function a(i) {
|
|
181
|
+
let a = r;
|
|
182
|
+
r = null, e.value = !1, t.value = [], n.value = null, a && a(i);
|
|
183
|
+
}
|
|
184
|
+
return h() && s(() => {
|
|
185
|
+
if (r) {
|
|
186
|
+
let e = r;
|
|
187
|
+
r = null, e(null);
|
|
188
|
+
}
|
|
189
|
+
e.value = !1, t.value = [], n.value = null;
|
|
190
|
+
}), {
|
|
191
|
+
isOpen: e,
|
|
192
|
+
tags: t,
|
|
193
|
+
current: n,
|
|
194
|
+
open: i,
|
|
195
|
+
resolve: a
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/composables/useLogicTagPicker.ts
|
|
200
|
+
function Nn() {
|
|
201
|
+
let e = _(!1), t = _([]), n = _([]), r = null;
|
|
202
|
+
function i(i, a) {
|
|
203
|
+
if (r) {
|
|
204
|
+
let e = r;
|
|
205
|
+
r = null, e(null);
|
|
206
|
+
}
|
|
207
|
+
return t.value = i, n.value = a, e.value = !0, new Promise((e) => {
|
|
208
|
+
r = e;
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function a(i) {
|
|
212
|
+
let a = r;
|
|
213
|
+
r = null, e.value = !1, t.value = [], n.value = [], a && a(i);
|
|
214
|
+
}
|
|
215
|
+
return h() && s(() => {
|
|
216
|
+
if (r) {
|
|
217
|
+
let e = r;
|
|
218
|
+
r = null, e(null);
|
|
219
|
+
}
|
|
220
|
+
e.value = !1, t.value = [], n.value = [];
|
|
221
|
+
}), {
|
|
222
|
+
isOpen: e,
|
|
223
|
+
tags: t,
|
|
224
|
+
pairs: n,
|
|
225
|
+
open: i,
|
|
226
|
+
resolve: a
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/composables/useTemplateLint.ts
|
|
231
|
+
function Pn(e) {
|
|
232
|
+
return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 : !1;
|
|
233
|
+
}
|
|
234
|
+
function Fn(t) {
|
|
235
|
+
let n = _([]), r = _(!1), i = _(!1), a = e(null), o = Pn(t.options), s = null, c = !1;
|
|
236
|
+
o || l();
|
|
237
|
+
async function l() {
|
|
238
|
+
try {
|
|
239
|
+
let e = await import("@templatical/quality");
|
|
240
|
+
if (c) return;
|
|
241
|
+
a.value = { lintTemplate: e.lintTemplate }, r.value = !0, u(), s = ot(t.content, u, {
|
|
242
|
+
debounce: t.debounce ?? 500,
|
|
243
|
+
deep: !0
|
|
244
|
+
});
|
|
245
|
+
} catch {
|
|
246
|
+
if (c) return;
|
|
247
|
+
i.value = !0;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function u() {
|
|
251
|
+
a.value && (n.value = a.value.lintTemplate(t.content.value, t.options));
|
|
252
|
+
}
|
|
253
|
+
let d = f(() => t.options, () => {
|
|
254
|
+
a.value && u();
|
|
255
|
+
}, { deep: !0 });
|
|
256
|
+
function p(e) {
|
|
257
|
+
e.fix && e.fix.apply({
|
|
258
|
+
updateBlock: t.updateBlock,
|
|
259
|
+
updateSettings: t.updateSettings,
|
|
260
|
+
removeBlock: t.removeBlock
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
function m() {
|
|
264
|
+
c = !0, s?.(), d();
|
|
265
|
+
}
|
|
266
|
+
return {
|
|
267
|
+
issues: n,
|
|
268
|
+
ready: r,
|
|
269
|
+
unavailable: i,
|
|
270
|
+
applyFix: p,
|
|
271
|
+
destroy: m
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/composables/useKeyboardReorder.ts
|
|
276
|
+
function In(e, t, n = []) {
|
|
277
|
+
let r = _(null), i = _(""), a = null;
|
|
278
|
+
function o(t) {
|
|
279
|
+
let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
|
|
280
|
+
if (r !== -1) return {
|
|
281
|
+
index: r,
|
|
282
|
+
total: n.length
|
|
283
|
+
};
|
|
284
|
+
for (let e of n) {
|
|
285
|
+
if (e.type !== "section") continue;
|
|
286
|
+
let n = e;
|
|
287
|
+
for (let e = 0; e < n.children.length; e++) {
|
|
288
|
+
let r = n.children[e], i = r.findIndex((e) => e.id === t);
|
|
289
|
+
if (i !== -1) return {
|
|
290
|
+
index: i,
|
|
291
|
+
total: r.length,
|
|
292
|
+
sectionId: n.id,
|
|
293
|
+
columnIndex: e
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
function s(r) {
|
|
300
|
+
let i = o(r);
|
|
301
|
+
if (!i) return "";
|
|
302
|
+
let a = (i.sectionId ? c(i.sectionId, i.columnIndex ?? 0) : e.content.value.blocks)?.[i.index];
|
|
303
|
+
return a ? Ke(a, t.t, n) : "";
|
|
304
|
+
}
|
|
305
|
+
function c(t, n) {
|
|
306
|
+
return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
|
|
307
|
+
}
|
|
308
|
+
function l(e) {
|
|
309
|
+
i.value = "", queueMicrotask(() => {
|
|
310
|
+
i.value = e;
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
function u(e) {
|
|
314
|
+
return r.value === e;
|
|
315
|
+
}
|
|
316
|
+
function d(e) {
|
|
317
|
+
let n = o(e);
|
|
318
|
+
n && (r.value = e, a = n, l(t.format(t.t.blockActions.lifted, {
|
|
319
|
+
block: s(e),
|
|
320
|
+
position: String(n.index + 1),
|
|
321
|
+
total: String(n.total)
|
|
322
|
+
})));
|
|
323
|
+
}
|
|
324
|
+
function f(n, r) {
|
|
325
|
+
let i = o(n);
|
|
326
|
+
if (!i) return;
|
|
327
|
+
let a = i.index + r;
|
|
328
|
+
a < 0 || a >= i.total || (e.moveBlock(n, a, i.sectionId, i.columnIndex), l(t.format(t.t.blockActions.moved, {
|
|
329
|
+
block: s(n),
|
|
330
|
+
position: String(a + 1),
|
|
331
|
+
total: String(i.total)
|
|
332
|
+
})));
|
|
333
|
+
}
|
|
334
|
+
function p(e) {
|
|
335
|
+
f(e, -1);
|
|
336
|
+
}
|
|
337
|
+
function m(e) {
|
|
338
|
+
f(e, 1);
|
|
339
|
+
}
|
|
340
|
+
function h(e) {
|
|
341
|
+
let n = o(e);
|
|
342
|
+
n && l(t.format(t.t.blockActions.dropped, {
|
|
343
|
+
block: s(e),
|
|
344
|
+
position: String(n.index + 1),
|
|
345
|
+
total: String(n.total)
|
|
346
|
+
})), r.value = null, a = null;
|
|
347
|
+
}
|
|
348
|
+
function g() {
|
|
349
|
+
let n = r.value;
|
|
350
|
+
if (n && a) {
|
|
351
|
+
let r = o(n), i = !!r && (r.sectionId !== a.sectionId || r.columnIndex !== a.columnIndex), c = !!r && r.index !== a.index;
|
|
352
|
+
r && (i || c) && e.moveBlock(n, a.index, a.sectionId, a.columnIndex), l(t.format(t.t.blockActions.cancelled, {
|
|
353
|
+
block: s(n),
|
|
354
|
+
position: String(a.index + 1)
|
|
355
|
+
}));
|
|
356
|
+
}
|
|
357
|
+
r.value = null, a = null;
|
|
358
|
+
}
|
|
359
|
+
return {
|
|
360
|
+
liftedBlockId: r,
|
|
361
|
+
announcement: i,
|
|
362
|
+
isLifted: u,
|
|
363
|
+
lift: d,
|
|
364
|
+
cancel: g,
|
|
365
|
+
moveUp: p,
|
|
366
|
+
moveDown: m,
|
|
367
|
+
drop: h
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region src/composables/useUiTheme.ts
|
|
372
|
+
function Ln(e) {
|
|
373
|
+
let t = ct("(prefers-color-scheme: dark)");
|
|
374
|
+
return { resolvedTheme: N(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
|
|
375
|
+
}
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region src/composables/useThemeStyles.ts
|
|
378
|
+
var Rn = {
|
|
379
|
+
bg: "--tpl-bg",
|
|
380
|
+
bgElevated: "--tpl-bg-elevated",
|
|
381
|
+
bgHover: "--tpl-bg-hover",
|
|
382
|
+
bgActive: "--tpl-bg-active",
|
|
383
|
+
border: "--tpl-border",
|
|
384
|
+
borderLight: "--tpl-border-light",
|
|
385
|
+
text: "--tpl-text",
|
|
386
|
+
textMuted: "--tpl-text-muted",
|
|
387
|
+
textDim: "--tpl-text-dim",
|
|
388
|
+
primary: "--tpl-primary",
|
|
389
|
+
primaryHover: "--tpl-primary-hover",
|
|
390
|
+
primaryLight: "--tpl-primary-light",
|
|
391
|
+
secondary: "--tpl-secondary",
|
|
392
|
+
secondaryHover: "--tpl-secondary-hover",
|
|
393
|
+
secondaryLight: "--tpl-secondary-light",
|
|
394
|
+
success: "--tpl-success",
|
|
395
|
+
successLight: "--tpl-success-light",
|
|
396
|
+
warning: "--tpl-warning",
|
|
397
|
+
warningLight: "--tpl-warning-light",
|
|
398
|
+
danger: "--tpl-danger",
|
|
399
|
+
dangerLight: "--tpl-danger-light",
|
|
400
|
+
canvasBg: "--tpl-canvas-bg"
|
|
401
|
+
};
|
|
402
|
+
function zn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
403
|
+
return { themeStyles: N(() => {
|
|
404
|
+
let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
|
|
405
|
+
if (a) for (let [e, t] of Object.entries(Rn)) {
|
|
406
|
+
let n = a[e];
|
|
407
|
+
n && (r[t] = n);
|
|
408
|
+
}
|
|
409
|
+
return n && Object.assign(r, n()), r;
|
|
410
|
+
}) };
|
|
411
|
+
}
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region src/composables/useBlockRegistry.ts
|
|
414
|
+
function Bn() {
|
|
415
|
+
let t = e(/* @__PURE__ */ new Map());
|
|
416
|
+
function n(e, n) {
|
|
417
|
+
t.value.set(e, n), T(t);
|
|
418
|
+
}
|
|
419
|
+
function r(e, n) {
|
|
420
|
+
let r = `custom:${e.type}`, i = {
|
|
421
|
+
component: n,
|
|
422
|
+
createBlock: () => Ne(e),
|
|
423
|
+
definition: e
|
|
424
|
+
};
|
|
425
|
+
t.value.set(r, i), T(t);
|
|
426
|
+
}
|
|
427
|
+
function i(e) {
|
|
428
|
+
if (e.type === "custom") {
|
|
429
|
+
let n = `custom:${e.customType}`;
|
|
430
|
+
return t.value.get(n)?.component;
|
|
431
|
+
}
|
|
432
|
+
return t.value.get(e.type)?.component;
|
|
433
|
+
}
|
|
434
|
+
function a(e) {
|
|
435
|
+
return t.value.get(e)?.createBlock();
|
|
436
|
+
}
|
|
437
|
+
function o(e) {
|
|
438
|
+
let n = `custom:${e}`;
|
|
439
|
+
return t.value.get(n)?.definition;
|
|
440
|
+
}
|
|
441
|
+
function s(e) {
|
|
442
|
+
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>`;
|
|
443
|
+
}
|
|
444
|
+
async function c(e) {
|
|
445
|
+
let t = o(e.customType);
|
|
446
|
+
if (!t) return s("Block definition not found");
|
|
447
|
+
try {
|
|
448
|
+
let { Liquid: n } = await import("./liquid.browser-wPG0n4Cs.js");
|
|
449
|
+
return await new n({
|
|
450
|
+
strictVariables: !1,
|
|
451
|
+
strictFilters: !1
|
|
452
|
+
}).parseAndRender(t.template, e.fieldValues);
|
|
453
|
+
} catch (t) {
|
|
454
|
+
return rn.error(`Failed to render custom block "${e.customType}":`, t), s(`Render error: ${e.customType}`);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
function l(e) {
|
|
458
|
+
return t.value.has(e);
|
|
459
|
+
}
|
|
460
|
+
return {
|
|
461
|
+
registerBuiltIn: n,
|
|
462
|
+
registerCustom: r,
|
|
463
|
+
getComponent: i,
|
|
464
|
+
createBlock: a,
|
|
465
|
+
getDefinition: o,
|
|
466
|
+
renderCustomBlock: c,
|
|
467
|
+
isRegistered: l
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region src/composables/useCustomBlockStylesheets.ts
|
|
472
|
+
function Vn(e, t) {
|
|
473
|
+
return N(() => {
|
|
474
|
+
let n = Hn(e.value.blocks);
|
|
475
|
+
if (n.size === 0) return [];
|
|
476
|
+
let r = /* @__PURE__ */ new Set(), i = [];
|
|
477
|
+
for (let e of n) {
|
|
478
|
+
let n = t.getDefinition(e)?.stylesheet;
|
|
479
|
+
if (!n) continue;
|
|
480
|
+
let a = n.trim();
|
|
481
|
+
a === "" || r.has(a) || (r.add(a), i.push(a));
|
|
482
|
+
}
|
|
483
|
+
return i;
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
function Hn(e) {
|
|
487
|
+
let t = /* @__PURE__ */ new Set();
|
|
488
|
+
return Un(e, t), t;
|
|
489
|
+
}
|
|
490
|
+
function Un(e, t) {
|
|
491
|
+
for (let n of e) {
|
|
492
|
+
if (he(n)) {
|
|
493
|
+
t.add(n.customType);
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
if (n.type === "section") {
|
|
497
|
+
let e = n.children;
|
|
498
|
+
if (!e) continue;
|
|
499
|
+
for (let n of e) Un(n, t);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region src/utils/registerBuiltInBlocks.ts
|
|
505
|
+
var Wn = [
|
|
506
|
+
{
|
|
507
|
+
type: "section",
|
|
508
|
+
createBlock: Ce
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
type: "title",
|
|
512
|
+
createBlock: Le
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
type: "paragraph",
|
|
516
|
+
createBlock: ze
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
type: "image",
|
|
520
|
+
createBlock: Se
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
type: "button",
|
|
524
|
+
createBlock: we
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
type: "divider",
|
|
528
|
+
createBlock: De
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
type: "video",
|
|
532
|
+
createBlock: ve
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
type: "social",
|
|
536
|
+
createBlock: Re
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
type: "menu",
|
|
540
|
+
createBlock: Ie
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
type: "table",
|
|
544
|
+
createBlock: oe
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
type: "spacer",
|
|
548
|
+
createBlock: _e
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
type: "html",
|
|
552
|
+
createBlock: Ee
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
type: "countdown",
|
|
556
|
+
createBlock: Te
|
|
557
|
+
}
|
|
558
|
+
];
|
|
559
|
+
function Gn(e, t) {
|
|
560
|
+
for (let n of Wn) {
|
|
561
|
+
let r = t[n.type];
|
|
562
|
+
r && e.registerBuiltIn(n.type, {
|
|
563
|
+
component: r,
|
|
564
|
+
createBlock: n.createBlock
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
//#endregion
|
|
569
|
+
//#region src/utils/resolveHtmlBlockPreview.ts
|
|
570
|
+
function Kn(e) {
|
|
571
|
+
return typeof e == "boolean" ? e : e?.enabled ?? !1;
|
|
572
|
+
}
|
|
573
|
+
//#endregion
|
|
574
|
+
//#region src/utils/collectOffPaletteDefaults.ts
|
|
575
|
+
function qn(e) {
|
|
576
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
577
|
+
}
|
|
578
|
+
function Jn(e, t, n) {
|
|
579
|
+
let r = new Set(e.map((e) => sn(e))), i = [], a = (e, t) => {
|
|
580
|
+
for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(sn(o)) && i.push(`${t}.${n}: ${o}`) : qn(o) && a(o, `${t}.${n}`);
|
|
581
|
+
}, o = t;
|
|
582
|
+
for (let [e, t] of Object.entries(Fe)) {
|
|
583
|
+
let n = o?.[e];
|
|
584
|
+
a({
|
|
585
|
+
...t,
|
|
586
|
+
...qn(n) ? n : {}
|
|
587
|
+
}, e);
|
|
588
|
+
}
|
|
589
|
+
return a({
|
|
590
|
+
...je,
|
|
591
|
+
...n ?? {}
|
|
592
|
+
}, "template"), i;
|
|
593
|
+
}
|
|
594
|
+
//#endregion
|
|
595
|
+
//#region src/utils/localizedBlockDefaults.ts
|
|
596
|
+
function Yn(e) {
|
|
597
|
+
return {
|
|
598
|
+
title: { content: `<p>${e.blockDefaults.title}</p>` },
|
|
599
|
+
paragraph: { content: `<p>${e.blockDefaults.paragraph}</p>` },
|
|
600
|
+
button: { text: e.blockDefaults.button }
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
//#endregion
|
|
604
|
+
//#region src/i18n/index.ts
|
|
605
|
+
var Xn = /* #__PURE__ */ Object.assign({
|
|
606
|
+
"./locales/ca.ts": () => import("./ca-YlPDhElv.js"),
|
|
607
|
+
"./locales/de.ts": () => import("./de-CONjnzrF.js"),
|
|
608
|
+
"./locales/en.ts": () => import("./en-BAMooiOF.js"),
|
|
609
|
+
"./locales/es.ts": () => import("./es-I47lHs2m.js"),
|
|
610
|
+
"./locales/fr.ts": () => import("./fr-B8MIKjT4.js"),
|
|
611
|
+
"./locales/nl.ts": () => import("./nl-CBLxcb-0.js"),
|
|
612
|
+
"./locales/pt-BR.ts": () => import("./pt-BR-CMSRfX7t.js")
|
|
613
|
+
}), Zn = /* #__PURE__ */ Object.assign({
|
|
614
|
+
"./locales/cloud/de.ts": () => import("./de-BytZwgn6.js"),
|
|
615
|
+
"./locales/cloud/en.ts": () => import("./en-DyOSV0lY.js"),
|
|
616
|
+
"./locales/cloud/pt-BR.ts": () => import("./pt-BR-C1WLSGDh.js")
|
|
617
|
+
});
|
|
618
|
+
function Qn(e) {
|
|
619
|
+
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
620
|
+
}
|
|
621
|
+
var $n = Qn(Xn), er = Qn(Zn);
|
|
622
|
+
function tr(e) {
|
|
623
|
+
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
624
|
+
}
|
|
625
|
+
function nr(e, t) {
|
|
626
|
+
let n = tr(e);
|
|
627
|
+
return t.find((e) => tr(e) === n);
|
|
628
|
+
}
|
|
629
|
+
function rr(e) {
|
|
630
|
+
return tr(e).split("-")[0];
|
|
631
|
+
}
|
|
632
|
+
function ir(e, t) {
|
|
633
|
+
return nr(e, t) ?? nr(rr(e), t);
|
|
634
|
+
}
|
|
635
|
+
function ar(e, t) {
|
|
636
|
+
return ir(e, t) ?? "en";
|
|
637
|
+
}
|
|
638
|
+
async function or(e) {
|
|
639
|
+
let t = Xn[`./locales/${ar(e, $n)}.ts`];
|
|
640
|
+
return (await t()).default;
|
|
641
|
+
}
|
|
642
|
+
async function sr(e) {
|
|
643
|
+
let t = Zn[`./locales/cloud/${ar(e, er)}.ts`];
|
|
644
|
+
return (await t()).default;
|
|
645
|
+
}
|
|
646
|
+
function cr(e) {
|
|
647
|
+
return ir(e, $n) !== void 0;
|
|
648
|
+
}
|
|
649
|
+
function lr(e) {
|
|
650
|
+
return ir(e, er) !== void 0;
|
|
651
|
+
}
|
|
652
|
+
function ur() {
|
|
653
|
+
return [...$n];
|
|
654
|
+
}
|
|
655
|
+
function dr() {
|
|
656
|
+
return [...er];
|
|
657
|
+
}
|
|
658
|
+
//#endregion
|
|
659
|
+
//#region src/i18n/contentDefaults.ts
|
|
660
|
+
var fr = {
|
|
661
|
+
en: {
|
|
662
|
+
video: "Video",
|
|
663
|
+
days: "Days",
|
|
664
|
+
hours: "Hours",
|
|
665
|
+
minutes: "Minutes",
|
|
666
|
+
seconds: "Seconds",
|
|
667
|
+
expired: "This offer has expired"
|
|
668
|
+
},
|
|
669
|
+
de: {
|
|
670
|
+
video: "Video",
|
|
671
|
+
days: "Tage",
|
|
672
|
+
hours: "Stunden",
|
|
673
|
+
minutes: "Minuten",
|
|
674
|
+
seconds: "Sekunden",
|
|
675
|
+
expired: "Dieses Angebot ist abgelaufen"
|
|
676
|
+
},
|
|
677
|
+
es: {
|
|
678
|
+
video: "Vídeo",
|
|
679
|
+
days: "Días",
|
|
680
|
+
hours: "Horas",
|
|
681
|
+
minutes: "Minutos",
|
|
682
|
+
seconds: "Segundos",
|
|
683
|
+
expired: "Esta oferta ha expirado"
|
|
684
|
+
},
|
|
685
|
+
fr: {
|
|
686
|
+
video: "Vidéo",
|
|
687
|
+
days: "Jours",
|
|
688
|
+
hours: "Heures",
|
|
689
|
+
minutes: "Minutes",
|
|
690
|
+
seconds: "Secondes",
|
|
691
|
+
expired: "Cette offre a expiré"
|
|
692
|
+
},
|
|
693
|
+
nl: {
|
|
694
|
+
video: "Video",
|
|
695
|
+
days: "Dagen",
|
|
696
|
+
hours: "Uren",
|
|
697
|
+
minutes: "Minuten",
|
|
698
|
+
seconds: "Seconden",
|
|
699
|
+
expired: "Deze aanbieding is verlopen"
|
|
700
|
+
},
|
|
701
|
+
"pt-BR": {
|
|
702
|
+
video: "Vídeo",
|
|
703
|
+
days: "Dias",
|
|
704
|
+
hours: "Horas",
|
|
705
|
+
minutes: "Minutos",
|
|
706
|
+
seconds: "Segundos",
|
|
707
|
+
expired: "Esta oferta expirou"
|
|
708
|
+
},
|
|
709
|
+
ca: {
|
|
710
|
+
video: "Vídeo",
|
|
711
|
+
days: "Dies",
|
|
712
|
+
hours: "Hores",
|
|
713
|
+
minutes: "Minuts",
|
|
714
|
+
seconds: "Segons",
|
|
715
|
+
expired: "Aquesta oferta ha caducat"
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
Object.keys(fr);
|
|
719
|
+
var pr = new Map(Object.keys(fr).map((e) => [e.toLowerCase(), e]));
|
|
720
|
+
function mr(e) {
|
|
721
|
+
if (!e) return fr.en;
|
|
722
|
+
let t = e.trim().replace(/_/g, "-").toLowerCase(), n = pr.get(t);
|
|
723
|
+
if (n) return fr[n];
|
|
724
|
+
let r = pr.get(rr(t));
|
|
725
|
+
return r ? fr[r] : fr.en;
|
|
726
|
+
}
|
|
727
|
+
function hr(e) {
|
|
728
|
+
let t = mr(e);
|
|
729
|
+
return {
|
|
730
|
+
video: { alt: t.video },
|
|
731
|
+
countdown: {
|
|
732
|
+
labelDays: t.days,
|
|
733
|
+
labelHours: t.hours,
|
|
734
|
+
labelMinutes: t.minutes,
|
|
735
|
+
labelSeconds: t.seconds,
|
|
736
|
+
expiredMessage: t.expired
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
//#endregion
|
|
741
|
+
//#region src/utils/collectColorFieldIssues.ts
|
|
742
|
+
function gr(e, t) {
|
|
743
|
+
let n = [], r = (r, i) => {
|
|
744
|
+
let a = et(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
|
|
745
|
+
if (a.invalidPresets.length > 0 && n.push({
|
|
746
|
+
id: s("invalid-presets"),
|
|
747
|
+
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." : "")
|
|
748
|
+
}), a.emptyPresets && n.push({
|
|
749
|
+
id: s("empty-presets"),
|
|
750
|
+
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.`
|
|
751
|
+
}), a.allowCustomIgnored && n.push({
|
|
752
|
+
id: s("allow-custom-ignored"),
|
|
753
|
+
message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
|
|
754
|
+
}), !a.allowCustom && a.presets.length > 0) {
|
|
755
|
+
let e = r.default ?? "", t = new Set(a.presets.map((e) => sn(e)));
|
|
756
|
+
e !== "" && !t.has(sn(e)) && n.push({
|
|
757
|
+
id: s("off-palette-default"),
|
|
758
|
+
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.`
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
for (let t of e.fields) if (t.type === "color") r(t, t.key);
|
|
763
|
+
else if (t.type === "repeatable") for (let e of t.fields) e.type === "color" && r(e, `${t.key}[].${e.key}`);
|
|
764
|
+
return n;
|
|
765
|
+
}
|
|
766
|
+
//#endregion
|
|
767
|
+
//#region src/utils/keyboardShortcuts.ts
|
|
768
|
+
function _r(e) {
|
|
769
|
+
for (let t of e.composedPath()) {
|
|
770
|
+
if (!(t instanceof HTMLElement)) continue;
|
|
771
|
+
if (t.isContentEditable) return !0;
|
|
772
|
+
let e = t.tagName;
|
|
773
|
+
if (e === "INPUT" || e === "TEXTAREA" || e === "SELECT") return !0;
|
|
774
|
+
}
|
|
775
|
+
return !1;
|
|
776
|
+
}
|
|
777
|
+
function vr(e, t) {
|
|
778
|
+
let n = e.metaKey || e.ctrlKey;
|
|
779
|
+
if (n && e.key.toLowerCase() === "s") {
|
|
780
|
+
e.preventDefault(), t.onSave?.();
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
if (n && e.key.toLowerCase() === "z") {
|
|
784
|
+
if (_r(e)) return;
|
|
785
|
+
e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
if (t.isPicking?.() && !_r(e)) {
|
|
789
|
+
if (e.key === "Escape") {
|
|
790
|
+
e.preventDefault(), t.onCancelPick?.();
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
if (e.key === "Enter") {
|
|
794
|
+
e.preventDefault(), t.onConfirmPick?.();
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
if (e.key === "Delete" || e.key === "Backspace") {
|
|
798
|
+
e.preventDefault();
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
if (e.key === "Escape") {
|
|
803
|
+
t.selectBlock(null);
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !_r(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
|
|
807
|
+
}
|
|
808
|
+
//#endregion
|
|
809
|
+
//#region src/utils/mergeTagLabelSegments.ts
|
|
810
|
+
function yr(e, t, n, r = !1) {
|
|
811
|
+
if (!e) return [];
|
|
812
|
+
let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
|
|
813
|
+
for (; (s = i.exec(e)) !== null;) {
|
|
814
|
+
s.index > o && a.push({
|
|
815
|
+
type: "text",
|
|
816
|
+
value: e.slice(o, s.index)
|
|
817
|
+
});
|
|
818
|
+
let i = s[0];
|
|
819
|
+
if (ue(i, n)) {
|
|
820
|
+
let e = r ? ie(i, t) : void 0;
|
|
821
|
+
a.push(e === void 0 ? {
|
|
822
|
+
type: "tag",
|
|
823
|
+
value: ke(i, t)
|
|
824
|
+
} : {
|
|
825
|
+
type: "text",
|
|
826
|
+
value: e
|
|
827
|
+
});
|
|
828
|
+
} else ce(i, n) ? a.push({
|
|
829
|
+
type: "tag",
|
|
830
|
+
value: me(i, n)
|
|
831
|
+
}) : a.push({
|
|
832
|
+
type: "text",
|
|
833
|
+
value: i
|
|
834
|
+
});
|
|
835
|
+
o = s.index + i.length;
|
|
836
|
+
}
|
|
837
|
+
return o < e.length && a.push({
|
|
838
|
+
type: "text",
|
|
839
|
+
value: e.slice(o)
|
|
840
|
+
}), a;
|
|
841
|
+
}
|
|
842
|
+
//#endregion
|
|
843
|
+
//#region src/components/MergeTagPreviewText.vue
|
|
844
|
+
var br = F({
|
|
845
|
+
name: "MergeTagPreviewText",
|
|
846
|
+
props: { text: {
|
|
847
|
+
type: String,
|
|
848
|
+
required: !0
|
|
849
|
+
} },
|
|
850
|
+
setup(e) {
|
|
851
|
+
let t = p(pt, wt), n = p(St, Me.liquid), r = p(At, null), i = N(() => yr(e.text, t.value, n, r?.value ?? !1));
|
|
852
|
+
return () => i.value.map((e, t) => e.type === "tag" ? b("span", {
|
|
853
|
+
key: t,
|
|
854
|
+
class: "tpl-merge-tag-label"
|
|
855
|
+
}, e.value) : e.value);
|
|
856
|
+
}
|
|
857
|
+
}), xr = ["href"], Sr = /* @__PURE__ */ F({
|
|
858
|
+
__name: "ButtonBlock",
|
|
859
|
+
props: {
|
|
860
|
+
block: {},
|
|
861
|
+
viewport: {}
|
|
862
|
+
},
|
|
863
|
+
setup(e) {
|
|
864
|
+
let r = e, i = N(() => {
|
|
865
|
+
let e = {
|
|
866
|
+
display: "inline-block",
|
|
867
|
+
padding: `${r.block.buttonPadding.top}px ${r.block.buttonPadding.right}px ${r.block.buttonPadding.bottom}px ${r.block.buttonPadding.left}px`,
|
|
868
|
+
backgroundColor: r.block.backgroundColor,
|
|
869
|
+
color: r.block.textColor,
|
|
870
|
+
fontSize: `${r.block.fontSize}px`,
|
|
871
|
+
fontWeight: "bold",
|
|
872
|
+
textDecoration: "none",
|
|
873
|
+
borderRadius: `${r.block.borderRadius}px`,
|
|
874
|
+
textAlign: "center"
|
|
875
|
+
};
|
|
876
|
+
return r.block.fontFamily && (e.fontFamily = r.block.fontFamily), r.block.width === "full" ? (e.display = "block", e.width = "100%", e.boxSizing = "border-box") : typeof r.block.width == "number" && (e.width = `${r.block.width}px`, e.boxSizing = "border-box"), e;
|
|
877
|
+
}), a = N(() => ({ textAlign: r.block.align ?? "center" }));
|
|
878
|
+
return (r, o) => (t(), S("div", { style: n(a.value) }, [x("a", {
|
|
879
|
+
href: e.block.url || "#",
|
|
880
|
+
style: n(i.value),
|
|
881
|
+
class: "tpl:cursor-default",
|
|
882
|
+
onClick: o[0] ||= I(() => {}, ["prevent"])
|
|
883
|
+
}, [C(br, { text: e.block.text }, null, 8, ["text"])], 12, xr)], 4));
|
|
884
|
+
}
|
|
885
|
+
}), Cr = dn({
|
|
886
|
+
name: "bookmark",
|
|
887
|
+
size: 24,
|
|
888
|
+
node: [["path", {
|
|
889
|
+
d: "M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",
|
|
890
|
+
key: "oz39mx"
|
|
891
|
+
}]]
|
|
892
|
+
}), wr = dn({
|
|
893
|
+
name: "box",
|
|
894
|
+
size: 24,
|
|
895
|
+
node: [
|
|
896
|
+
["path", {
|
|
897
|
+
d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",
|
|
898
|
+
key: "hh9hay"
|
|
899
|
+
}],
|
|
900
|
+
["path", {
|
|
901
|
+
d: "m3.3 7 8.7 5 8.7-5",
|
|
902
|
+
key: "g66t2b"
|
|
903
|
+
}],
|
|
904
|
+
["path", {
|
|
905
|
+
d: "M12 22V12",
|
|
906
|
+
key: "d0xqtd"
|
|
907
|
+
}]
|
|
908
|
+
]
|
|
909
|
+
}), Tr = dn({
|
|
910
|
+
name: "eye-off",
|
|
911
|
+
size: 24,
|
|
912
|
+
node: [
|
|
913
|
+
["path", {
|
|
914
|
+
d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
|
|
915
|
+
key: "ct8e1f"
|
|
916
|
+
}],
|
|
917
|
+
["path", {
|
|
918
|
+
d: "M14.084 14.158a3 3 0 0 1-4.242-4.242",
|
|
919
|
+
key: "151rxh"
|
|
920
|
+
}],
|
|
921
|
+
["path", {
|
|
922
|
+
d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
|
|
923
|
+
key: "13bj9a"
|
|
924
|
+
}],
|
|
925
|
+
["path", {
|
|
926
|
+
d: "m2 2 20 20",
|
|
927
|
+
key: "1ooewy"
|
|
928
|
+
}]
|
|
929
|
+
]
|
|
930
|
+
}), Er = dn({
|
|
931
|
+
name: "funnel",
|
|
932
|
+
size: 24,
|
|
933
|
+
node: [["path", {
|
|
934
|
+
d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",
|
|
935
|
+
key: "sc7q7i"
|
|
936
|
+
}]],
|
|
937
|
+
aliases: ["filter"]
|
|
938
|
+
}), Dr = dn({
|
|
939
|
+
name: "grip-vertical",
|
|
940
|
+
size: 24,
|
|
941
|
+
node: [
|
|
942
|
+
["circle", {
|
|
943
|
+
cx: "9",
|
|
944
|
+
cy: "12",
|
|
945
|
+
r: "1",
|
|
946
|
+
key: "1vctgf"
|
|
947
|
+
}],
|
|
948
|
+
["circle", {
|
|
949
|
+
cx: "9",
|
|
950
|
+
cy: "5",
|
|
951
|
+
r: "1",
|
|
952
|
+
key: "hp0tcf"
|
|
953
|
+
}],
|
|
954
|
+
["circle", {
|
|
955
|
+
cx: "9",
|
|
956
|
+
cy: "19",
|
|
957
|
+
r: "1",
|
|
958
|
+
key: "fkjjf6"
|
|
959
|
+
}],
|
|
960
|
+
["circle", {
|
|
961
|
+
cx: "15",
|
|
962
|
+
cy: "12",
|
|
963
|
+
r: "1",
|
|
964
|
+
key: "1tmaij"
|
|
965
|
+
}],
|
|
966
|
+
["circle", {
|
|
967
|
+
cx: "15",
|
|
968
|
+
cy: "5",
|
|
969
|
+
r: "1",
|
|
970
|
+
key: "19l28e"
|
|
971
|
+
}],
|
|
972
|
+
["circle", {
|
|
973
|
+
cx: "15",
|
|
974
|
+
cy: "19",
|
|
975
|
+
r: "1",
|
|
976
|
+
key: "f4zoj3"
|
|
977
|
+
}]
|
|
978
|
+
]
|
|
979
|
+
}), Or = dn({
|
|
980
|
+
name: "puzzle",
|
|
981
|
+
size: 24,
|
|
982
|
+
node: [["path", {
|
|
983
|
+
d: "M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",
|
|
984
|
+
key: "w46dr5"
|
|
985
|
+
}]]
|
|
986
|
+
}), kr = dn({
|
|
987
|
+
name: "video",
|
|
988
|
+
size: 24,
|
|
989
|
+
node: [["path", {
|
|
990
|
+
d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
|
|
991
|
+
key: "ftymec"
|
|
992
|
+
}], ["rect", {
|
|
993
|
+
x: "2",
|
|
994
|
+
y: "6",
|
|
995
|
+
width: "14",
|
|
996
|
+
height: "12",
|
|
997
|
+
rx: "2",
|
|
998
|
+
key: "158x01"
|
|
999
|
+
}]]
|
|
1000
|
+
}), Ar = ["innerHTML"], jr = [
|
|
1001
|
+
"src",
|
|
1002
|
+
"width",
|
|
1003
|
+
"height"
|
|
1004
|
+
], Mr = /* @__PURE__ */ F({
|
|
1005
|
+
__name: "CustomBlockIcon",
|
|
1006
|
+
props: {
|
|
1007
|
+
icon: {},
|
|
1008
|
+
size: {}
|
|
1009
|
+
},
|
|
1010
|
+
setup(e) {
|
|
1011
|
+
let r = e, i = N(() => r.size ?? 20), a = N(() => r.icon && (r.icon.trimStart().startsWith("<svg") || r.icon.trimStart().startsWith("<SVG"))), o = N(() => r.icon && !a.value && (r.icon.startsWith("http") || r.icon.startsWith("/")));
|
|
1012
|
+
return (r, s) => a.value ? (t(), S("span", {
|
|
1013
|
+
key: 0,
|
|
1014
|
+
class: "tpl:inline-flex tpl:items-center tpl:justify-center",
|
|
1015
|
+
style: n({
|
|
1016
|
+
width: `${i.value}px`,
|
|
1017
|
+
height: `${i.value}px`
|
|
1018
|
+
}),
|
|
1019
|
+
innerHTML: e.icon
|
|
1020
|
+
}, null, 12, Ar)) : o.value ? (t(), S("img", {
|
|
1021
|
+
key: 1,
|
|
1022
|
+
src: e.icon,
|
|
1023
|
+
width: i.value,
|
|
1024
|
+
height: i.value,
|
|
1025
|
+
class: "tpl:inline-block",
|
|
1026
|
+
alt: ""
|
|
1027
|
+
}, null, 8, jr)) : (t(), A(y(wr), {
|
|
1028
|
+
key: 2,
|
|
1029
|
+
size: i.value,
|
|
1030
|
+
"stroke-width": 1.5
|
|
1031
|
+
}, null, 8, ["size"]));
|
|
1032
|
+
}
|
|
1033
|
+
}), Nr = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
1034
|
+
function Pr(e, t) {
|
|
1035
|
+
let n = bn(), r = null, i = null, a = null;
|
|
1036
|
+
function o() {
|
|
1037
|
+
return e.value ? Array.from(e.value.querySelectorAll(Nr)).filter((e) => e.offsetParent !== null) : [];
|
|
1038
|
+
}
|
|
1039
|
+
function c(e) {
|
|
1040
|
+
if (e.key !== "Tab") return;
|
|
1041
|
+
let t = o();
|
|
1042
|
+
if (t.length === 0) return;
|
|
1043
|
+
let r = t[0], i = t[t.length - 1];
|
|
1044
|
+
e.shiftKey ? n.activeElement === r && (e.preventDefault(), i.focus()) : n.activeElement === i && (e.preventDefault(), r.focus());
|
|
1045
|
+
}
|
|
1046
|
+
function l() {
|
|
1047
|
+
let t = i !== null || a !== null;
|
|
1048
|
+
t && u({ restoreFocus: !1 }), t || (r = n.activeElement), a = requestAnimationFrame(() => {
|
|
1049
|
+
a = null;
|
|
1050
|
+
let t = o();
|
|
1051
|
+
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
1052
|
+
}), i = st(e, "keydown", c);
|
|
1053
|
+
}
|
|
1054
|
+
function u(e = {}) {
|
|
1055
|
+
let t = e.restoreFocus !== !1;
|
|
1056
|
+
a !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(a), a = null), i?.(), i = null, t && r && r.focus && (r.focus(), r = null);
|
|
1057
|
+
}
|
|
1058
|
+
let d = f([t, e], ([e, t]) => {
|
|
1059
|
+
e && t ? l() : u();
|
|
1060
|
+
}, { flush: "post" });
|
|
1061
|
+
s(() => {
|
|
1062
|
+
d(), u();
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1065
|
+
//#endregion
|
|
1066
|
+
//#region src/composables/useEmoji.ts
|
|
1067
|
+
function Fr() {
|
|
1068
|
+
let [t, n] = at(!1), r = e([]), i = !1;
|
|
1069
|
+
s(() => {
|
|
1070
|
+
i = !0;
|
|
1071
|
+
}), f(t, async (e) => {
|
|
1072
|
+
if (e && r.value.length === 0) {
|
|
1073
|
+
let { emojiCategories: e } = await import("./emojiData-6m0DBh7O.js");
|
|
1074
|
+
if (i) return;
|
|
1075
|
+
r.value = e;
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
function a() {
|
|
1079
|
+
n();
|
|
1080
|
+
}
|
|
1081
|
+
function o() {
|
|
1082
|
+
t.value = !1;
|
|
1083
|
+
}
|
|
1084
|
+
return {
|
|
1085
|
+
categories: r,
|
|
1086
|
+
isOpen: t,
|
|
1087
|
+
toggle: a,
|
|
1088
|
+
close: o
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
//#endregion
|
|
1092
|
+
//#region src/composables/useFonts.ts
|
|
1093
|
+
var Ir = [
|
|
1094
|
+
{
|
|
1095
|
+
value: "Arial",
|
|
1096
|
+
label: "Arial"
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
value: "Helvetica",
|
|
1100
|
+
label: "Helvetica"
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
value: "Georgia",
|
|
1104
|
+
label: "Georgia"
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
value: "Times New Roman",
|
|
1108
|
+
label: "Times New Roman"
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
value: "Verdana",
|
|
1112
|
+
label: "Verdana"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
value: "Trebuchet MS",
|
|
1116
|
+
label: "Trebuchet MS"
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
value: "Courier New",
|
|
1120
|
+
label: "Courier New"
|
|
1121
|
+
}
|
|
1122
|
+
], Lr = {
|
|
1123
|
+
arial: "Arial, sans-serif",
|
|
1124
|
+
helvetica: "Helvetica, sans-serif",
|
|
1125
|
+
georgia: "Georgia, serif",
|
|
1126
|
+
"times new roman": "'Times New Roman', serif",
|
|
1127
|
+
verdana: "Verdana, sans-serif",
|
|
1128
|
+
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
1129
|
+
"courier new": "'Courier New', monospace"
|
|
1130
|
+
}, Rr = "Arial, sans-serif";
|
|
1131
|
+
function zr(e) {
|
|
1132
|
+
if (e === void 0 || e === !0) return [...Ir];
|
|
1133
|
+
if (e === !1) return [];
|
|
1134
|
+
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
1135
|
+
for (let i of e) {
|
|
1136
|
+
let e = i.toLowerCase(), a = Ir.find((t) => t.value.toLowerCase() === e);
|
|
1137
|
+
if (!a) {
|
|
1138
|
+
r.has(e) || (r.add(e), rn.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${Ir.map((e) => e.value).join(", ")}.`));
|
|
1139
|
+
continue;
|
|
1140
|
+
}
|
|
1141
|
+
n.has(a.value) || (n.add(a.value), t.push(a));
|
|
1142
|
+
}
|
|
1143
|
+
return t;
|
|
1144
|
+
}
|
|
1145
|
+
function Br(e) {
|
|
1146
|
+
let t = _(e?.customFonts ?? []), n = _(!1), r = zr(e?.builtIns), i = N(() => e?.defaultFallback ?? Rr), a = N(() => {
|
|
1147
|
+
let e = [...r], n = t.value.map((e) => ({
|
|
1148
|
+
value: e.name,
|
|
1149
|
+
label: e.name,
|
|
1150
|
+
isCustom: !0
|
|
1151
|
+
})), i = [...e, ...n];
|
|
1152
|
+
return i.sort((e, t) => e.label.localeCompare(t.label)), i;
|
|
1153
|
+
});
|
|
1154
|
+
function o(e) {
|
|
1155
|
+
return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1156
|
+
}
|
|
1157
|
+
let c = e?.defaultFont ?? Rr.split(",")[0].trim();
|
|
1158
|
+
o(c) || rn.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.`);
|
|
1159
|
+
function l() {
|
|
1160
|
+
if (e?.defaultFont && o(e.defaultFont)) {
|
|
1161
|
+
let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
1162
|
+
if (t) return t.value;
|
|
1163
|
+
}
|
|
1164
|
+
return Rr;
|
|
1165
|
+
}
|
|
1166
|
+
let u = N(() => l());
|
|
1167
|
+
function d(e) {
|
|
1168
|
+
if (!e) return i.value;
|
|
1169
|
+
let n = t.value.find((t) => t.name.toLowerCase() === e.toLowerCase());
|
|
1170
|
+
if (n) {
|
|
1171
|
+
let e = n.fallback ?? i.value;
|
|
1172
|
+
return `'${n.name}', ${e}`;
|
|
1173
|
+
}
|
|
1174
|
+
return Lr[e.toLowerCase()] || (e.includes(",") ? e : `${e}, ${i.value}`);
|
|
1175
|
+
}
|
|
1176
|
+
let f = [], p = !1;
|
|
1177
|
+
async function m() {
|
|
1178
|
+
if (t.value.length === 0) {
|
|
1179
|
+
p || (n.value = !0);
|
|
1180
|
+
return;
|
|
1181
|
+
}
|
|
1182
|
+
let e = t.value.map(async (e) => {
|
|
1183
|
+
try {
|
|
1184
|
+
if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
|
|
1185
|
+
let t = document.createElement("link");
|
|
1186
|
+
t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), f.push(t), await new Promise((n, r) => {
|
|
1187
|
+
t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
|
|
1188
|
+
});
|
|
1189
|
+
} catch (t) {
|
|
1190
|
+
rn.warn(`Failed to load custom font "${e.name}":`, t);
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
await Promise.allSettled(e), !p && (n.value = !0);
|
|
1194
|
+
}
|
|
1195
|
+
function g() {
|
|
1196
|
+
for (let e of f) e.remove();
|
|
1197
|
+
f.length = 0;
|
|
1198
|
+
}
|
|
1199
|
+
return h() && s(() => {
|
|
1200
|
+
p = !0, g();
|
|
1201
|
+
}), {
|
|
1202
|
+
fonts: a,
|
|
1203
|
+
defaultFont: u,
|
|
1204
|
+
defaultFallback: i,
|
|
1205
|
+
customFonts: t,
|
|
1206
|
+
isLoaded: n,
|
|
1207
|
+
loadCustomFonts: m,
|
|
1208
|
+
cleanupFontLinks: g,
|
|
1209
|
+
getFontWithFallback: d,
|
|
1210
|
+
getDefaultFont: l
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
//#endregion
|
|
1214
|
+
//#region src/utils/mergeTagNodeSpec.ts
|
|
1215
|
+
function Vr(e, t, n) {
|
|
1216
|
+
return ce(e, n) ? {
|
|
1217
|
+
type: "logicMergeTagNode",
|
|
1218
|
+
attrs: {
|
|
1219
|
+
value: e,
|
|
1220
|
+
keyword: me(e, n)
|
|
1221
|
+
}
|
|
1222
|
+
} : {
|
|
1223
|
+
type: "mergeTagNode",
|
|
1224
|
+
attrs: {
|
|
1225
|
+
label: t,
|
|
1226
|
+
value: e
|
|
1227
|
+
}
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
//#endregion
|
|
1231
|
+
//#region src/utils/insertLogicTag.ts
|
|
1232
|
+
function Hr(e) {
|
|
1233
|
+
return "before" in e && "after" in e;
|
|
1234
|
+
}
|
|
1235
|
+
function Ur(e, t, n) {
|
|
1236
|
+
if (!Hr(t)) {
|
|
1237
|
+
e.chain().focus().insertContent(Vr(t.value, t.label, n)).run();
|
|
1238
|
+
return;
|
|
1239
|
+
}
|
|
1240
|
+
let r = Vr(t.before, t.label, n), i = Vr(t.after, t.label, n), { from: a, to: o } = e.state.selection;
|
|
1241
|
+
if (a !== o) {
|
|
1242
|
+
e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
|
|
1243
|
+
return;
|
|
1244
|
+
}
|
|
1245
|
+
e.chain().focus().insertContentAt(a, [r, i]).setTextSelection(a + 1).run();
|
|
1246
|
+
}
|
|
1247
|
+
//#endregion
|
|
1248
|
+
//#region src/utils/linkColorExtension.ts
|
|
1249
|
+
function Wr(e) {
|
|
1250
|
+
if (!e) return null;
|
|
1251
|
+
let t = e.trim();
|
|
1252
|
+
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;
|
|
1253
|
+
}
|
|
1254
|
+
function Gr(e) {
|
|
1255
|
+
return e.extend({ addAttributes() {
|
|
1256
|
+
return {
|
|
1257
|
+
...this.parent?.(),
|
|
1258
|
+
color: {
|
|
1259
|
+
default: null,
|
|
1260
|
+
parseHTML: (e) => Wr(an(e.style.color)),
|
|
1261
|
+
renderHTML: (e) => {
|
|
1262
|
+
let t = Wr(e.color);
|
|
1263
|
+
return t ? { style: `color: ${t}` } : {};
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
} });
|
|
1268
|
+
}
|
|
1269
|
+
//#endregion
|
|
1270
|
+
//#region src/composables/useRichTextLinkDialog.ts
|
|
1271
|
+
function Kr(e, t = Me.liquid) {
|
|
1272
|
+
let n = _(!1), r = _(""), i = _(""), a = _(null);
|
|
1273
|
+
Pr(a, n);
|
|
1274
|
+
function o() {
|
|
1275
|
+
let t = e.value?.getAttributes("link") ?? {};
|
|
1276
|
+
r.value = t.href || "", i.value = t.color || "", n.value = !0;
|
|
1277
|
+
}
|
|
1278
|
+
function s() {
|
|
1279
|
+
if (r.value) {
|
|
1280
|
+
let t = u(r.value);
|
|
1281
|
+
if (t !== null) {
|
|
1282
|
+
let n = Wr(i.value), r = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
|
|
1283
|
+
n && typeof e.value?.commands.unsetColor == "function" && r?.unsetColor(), r?.run();
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
f();
|
|
1287
|
+
}
|
|
1288
|
+
let c = /* @__PURE__ */ new Set([
|
|
1289
|
+
"http",
|
|
1290
|
+
"https",
|
|
1291
|
+
"mailto",
|
|
1292
|
+
"tel",
|
|
1293
|
+
"ftp",
|
|
1294
|
+
"ftps",
|
|
1295
|
+
"sms",
|
|
1296
|
+
"xmpp",
|
|
1297
|
+
"cid"
|
|
1298
|
+
]);
|
|
1299
|
+
function l(e) {
|
|
1300
|
+
return RegExp(`^(?:${t.value.source})`).test(e);
|
|
1301
|
+
}
|
|
1302
|
+
function u(e) {
|
|
1303
|
+
let t = e.trim();
|
|
1304
|
+
if (!t) return null;
|
|
1305
|
+
if (t.startsWith("#")) return t;
|
|
1306
|
+
let n = /^([a-z][a-z0-9+.-]*):/i.exec(t);
|
|
1307
|
+
return n ? c.has(n[1].toLowerCase()) ? t : null : l(t) ? t : `https://${t}`;
|
|
1308
|
+
}
|
|
1309
|
+
function d() {
|
|
1310
|
+
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), f();
|
|
1311
|
+
}
|
|
1312
|
+
function f() {
|
|
1313
|
+
n.value = !1, r.value = "", i.value = "";
|
|
1314
|
+
}
|
|
1315
|
+
function p(e) {
|
|
1316
|
+
e.key === "Enter" ? (e.preventDefault(), s()) : e.key === "Escape" && f();
|
|
1317
|
+
}
|
|
1318
|
+
return {
|
|
1319
|
+
showLinkDialog: n,
|
|
1320
|
+
linkUrl: r,
|
|
1321
|
+
linkColor: i,
|
|
1322
|
+
linkDialogRef: a,
|
|
1323
|
+
openLinkDialog: o,
|
|
1324
|
+
insertLink: s,
|
|
1325
|
+
removeLink: d,
|
|
1326
|
+
closeLinkDialog: f,
|
|
1327
|
+
handleLinkKeydown: p
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
//#endregion
|
|
1331
|
+
//#region src/composables/useRichTextEditor.ts
|
|
1332
|
+
function qr(t) {
|
|
1333
|
+
let n = p(zt, null), { mergeTags: r, canRequestMergeTag: a, isRequesting: o, requestMergeTag: s, syntax: l, autocomplete: u } = xn(), { canInsertLogicTag: d, isRequesting: m, requestLogicTag: h } = Sn(), g = p(Jt, null), v = (c(g) ? g.value : g)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", y = fe(l), b = e(null), x = () => ge(n?.content?.value?.settings ?? { locale: "en" });
|
|
1334
|
+
f(x, (e) => {
|
|
1335
|
+
let t = b.value?.view.dom;
|
|
1336
|
+
t && t.setAttribute("dir", e);
|
|
1337
|
+
});
|
|
1338
|
+
let { showLinkDialog: S, linkUrl: C, linkColor: w, linkDialogRef: T, openLinkDialog: E, insertLink: D, removeLink: O, closeLinkDialog: k, handleLinkKeydown: A } = Kr(b, l), { start: j, stop: M } = rt(() => b.value?.commands.focus("end"), 0, { immediate: !1 }), ee = e(null), N = _(!0), P = _(null), F = !1;
|
|
1339
|
+
async function te() {
|
|
1340
|
+
P.value = null, N.value = !0;
|
|
1341
|
+
try {
|
|
1342
|
+
let { TiptapEditor: e, EC: i, extensions: a } = await t.loadExtensions({
|
|
1343
|
+
mergeTags: r,
|
|
1344
|
+
syntax: l,
|
|
1345
|
+
triggerChar: y,
|
|
1346
|
+
autocompleteEnabled: u,
|
|
1347
|
+
suggestionEmptyText: v
|
|
1348
|
+
});
|
|
1349
|
+
if (F) return;
|
|
1350
|
+
ee.value = i;
|
|
1351
|
+
let o = /* @__PURE__ */ new Map();
|
|
1352
|
+
a.forEach((e, t) => o.set(e.name, t));
|
|
1353
|
+
let s = new e({
|
|
1354
|
+
extensions: a.filter((e, t) => o.get(e.name) === t),
|
|
1355
|
+
content: t.blockContent(),
|
|
1356
|
+
editable: !0,
|
|
1357
|
+
editorProps: { attributes: { dir: x() } },
|
|
1358
|
+
onUpdate: ({ editor: e }) => {
|
|
1359
|
+
F || n && n.updateBlock(t.blockId(), { content: e.getHTML() });
|
|
1360
|
+
}
|
|
1361
|
+
});
|
|
1362
|
+
if (F) {
|
|
1363
|
+
s.destroy();
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1366
|
+
b.value = s, N.value = !1, j();
|
|
1367
|
+
} catch (e) {
|
|
1368
|
+
if (F) return;
|
|
1369
|
+
rn.error(`[${t.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, e), P.value = e instanceof Error ? e.message : "Failed to load editor", N.value = !1;
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
function I() {
|
|
1373
|
+
b.value?.destroy(), b.value = null, te();
|
|
1374
|
+
}
|
|
1375
|
+
te();
|
|
1376
|
+
let ne = f(() => t.blockContent(), (e) => {
|
|
1377
|
+
b.value && b.value.getHTML() !== e && b.value.commands.setContent(e, { emitUpdate: !1 });
|
|
1378
|
+
});
|
|
1379
|
+
function re(e) {
|
|
1380
|
+
if (o.value || m.value) return;
|
|
1381
|
+
let n = e.composedPath(), r = n.find((e) => e instanceof HTMLElement);
|
|
1382
|
+
if (!r) return;
|
|
1383
|
+
t.onClickOutsideSideEffect?.(r);
|
|
1384
|
+
let i = n.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
|
|
1385
|
+
r.closest(".tpl-text-editor-wrapper") || r.closest(".tpl-text-toolbar") || r.closest(".tpl-link-dialog") || i || t.onDone();
|
|
1386
|
+
}
|
|
1387
|
+
st(document, "mousedown", re), i(() => {
|
|
1388
|
+
F = !0, ne(), M(), b.value?.destroy();
|
|
1389
|
+
});
|
|
1390
|
+
async function ie() {
|
|
1391
|
+
let e = await s();
|
|
1392
|
+
F || (e && b.value ? b.value.chain().focus().insertMergeTag({
|
|
1393
|
+
label: e.label,
|
|
1394
|
+
value: e.value
|
|
1395
|
+
}).run() : b.value?.commands.focus());
|
|
1396
|
+
}
|
|
1397
|
+
async function ae() {
|
|
1398
|
+
let e = await h();
|
|
1399
|
+
F || (e && b.value ? Ur(b.value, e, l) : b.value?.commands.focus());
|
|
1400
|
+
}
|
|
1401
|
+
return {
|
|
1402
|
+
editor: b,
|
|
1403
|
+
EditorContent: ee,
|
|
1404
|
+
isLoading: N,
|
|
1405
|
+
initError: P,
|
|
1406
|
+
retry: I,
|
|
1407
|
+
showLinkDialog: S,
|
|
1408
|
+
linkUrl: C,
|
|
1409
|
+
linkColor: w,
|
|
1410
|
+
linkDialogRef: T,
|
|
1411
|
+
mergeTags: r,
|
|
1412
|
+
canRequestMergeTag: a,
|
|
1413
|
+
isRequestingMergeTag: o,
|
|
1414
|
+
syntax: l,
|
|
1415
|
+
canInsertLogicTag: d,
|
|
1416
|
+
isRequestingLogicTag: m,
|
|
1417
|
+
openLinkDialog: E,
|
|
1418
|
+
insertLink: D,
|
|
1419
|
+
removeLink: O,
|
|
1420
|
+
closeLinkDialog: k,
|
|
1421
|
+
handleLinkKeydown: A,
|
|
1422
|
+
handleAddMergeTag: ie,
|
|
1423
|
+
handleAddLogicTag: ae
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
//#endregion
|
|
1427
|
+
//#region src/composables/useSmallScreenNotice.ts
|
|
1428
|
+
var Jr = "(max-width: 767px)";
|
|
1429
|
+
function Yr(e) {
|
|
1430
|
+
let t = ct(Jr);
|
|
1431
|
+
return {
|
|
1432
|
+
isSmallScreen: t,
|
|
1433
|
+
showNotice: N(() => (ee(e) ?? !0) && t.value)
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
//#endregion
|
|
1437
|
+
//#region src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1438
|
+
var Xr = { class: "tpl:w-full" }, Zr = {
|
|
1439
|
+
key: 0,
|
|
1440
|
+
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)]"
|
|
1441
|
+
}, Qr = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, $r = {
|
|
1442
|
+
key: 1,
|
|
1443
|
+
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)]"
|
|
1444
|
+
}, ei = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, ti = {
|
|
1445
|
+
key: 2,
|
|
1446
|
+
class: "tpl:relative"
|
|
1447
|
+
}, ni = ["innerHTML"], ri = {
|
|
1448
|
+
key: 0,
|
|
1449
|
+
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]",
|
|
1450
|
+
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
|
|
1451
|
+
}, ii = /* @__PURE__ */ F({
|
|
1452
|
+
__name: "CustomBlock",
|
|
1453
|
+
props: {
|
|
1454
|
+
block: {},
|
|
1455
|
+
viewport: {}
|
|
1456
|
+
},
|
|
1457
|
+
emits: ["fetchData"],
|
|
1458
|
+
setup(e, { emit: n }) {
|
|
1459
|
+
let r = e, i = n, { t: a } = nn(), o = p(Xt, null), s = _(""), c = _(!1), l = N(() => o?.getDefinition(r.block.customType)), u = N(() => !!l.value), m = N(() => r.block), { isFetching: h, fetch: g, needsFetch: v, hasDataSource: b } = nt({
|
|
1460
|
+
definition: l,
|
|
1461
|
+
block: m,
|
|
1462
|
+
onUpdate: (e, t) => {
|
|
1463
|
+
i("fetchData", {
|
|
1464
|
+
fieldValues: e,
|
|
1465
|
+
dataSourceFetched: t
|
|
1466
|
+
});
|
|
1467
|
+
}
|
|
1468
|
+
}), T = p(pt, wt), E = p(At, null), O = N(() => {
|
|
1469
|
+
if (!E?.value) return r.block;
|
|
1470
|
+
let e = {};
|
|
1471
|
+
for (let [t, n] of Object.entries(r.block.fieldValues)) e[t] = typeof n == "string" ? xe(n, T.value) : n;
|
|
1472
|
+
return {
|
|
1473
|
+
...r.block,
|
|
1474
|
+
fieldValues: e
|
|
1475
|
+
};
|
|
1476
|
+
});
|
|
1477
|
+
async function k() {
|
|
1478
|
+
if (o) {
|
|
1479
|
+
c.value = !1;
|
|
1480
|
+
try {
|
|
1481
|
+
let e = await o.renderCustomBlock(O.value);
|
|
1482
|
+
e.includes("Template render error:") && (c.value = !0), s.value = e;
|
|
1483
|
+
} catch {
|
|
1484
|
+
c.value = !0, s.value = "";
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
let j = it(k, 150);
|
|
1489
|
+
return d(() => {
|
|
1490
|
+
k();
|
|
1491
|
+
}), f(() => r.block.fieldValues, () => {
|
|
1492
|
+
j();
|
|
1493
|
+
}, { deep: !0 }), f(() => E?.value, () => {
|
|
1494
|
+
j();
|
|
1495
|
+
}), (e, n) => (t(), S("div", Xr, [u.value ? c.value ? (t(), S("div", $r, [C(y(gn), {
|
|
1496
|
+
size: 24,
|
|
1497
|
+
class: "tpl:text-[var(--tpl-danger)]"
|
|
1498
|
+
}), x("span", ei, D(y(a).customBlocks.renderError), 1)])) : (t(), S("div", ti, [x("div", { innerHTML: s.value }, null, 8, ni), y(b) && y(v) ? (t(), S("div", ri, [y(h) ? (t(), A(vn, {
|
|
1499
|
+
key: 1,
|
|
1500
|
+
class: "tpl:w-48"
|
|
1501
|
+
})) : (t(), S("button", {
|
|
1502
|
+
key: 0,
|
|
1503
|
+
type: "button",
|
|
1504
|
+
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)]",
|
|
1505
|
+
onClick: n[0] ||= I((...e) => y(g) && y(g)(...e), ["stop"])
|
|
1506
|
+
}, [l.value?.icon ? (t(), A(Mr, {
|
|
1507
|
+
key: 0,
|
|
1508
|
+
icon: l.value.icon,
|
|
1509
|
+
size: 16
|
|
1510
|
+
}, null, 8, ["icon"])) : P("", !0), w(" " + D(l.value?.dataSource?.label || y(a).customBlocks.dataSource.fetchButton), 1)]))])) : P("", !0)])) : (t(), S("div", Zr, [C(y(Or), {
|
|
1511
|
+
size: 24,
|
|
1512
|
+
class: "tpl:text-[var(--tpl-warning)]"
|
|
1513
|
+
}), x("span", Qr, D(y(a).customBlocks.definitionNotFound), 1)]))]));
|
|
1514
|
+
}
|
|
1515
|
+
}), ai = { class: "tpl:w-full" }, oi = /* @__PURE__ */ F({
|
|
1516
|
+
__name: "DividerBlock",
|
|
1517
|
+
props: {
|
|
1518
|
+
block: {},
|
|
1519
|
+
viewport: {}
|
|
1520
|
+
},
|
|
1521
|
+
setup(e) {
|
|
1522
|
+
let r = e, i = N(() => ({
|
|
1523
|
+
borderTop: `${r.block.thickness}px ${r.block.lineStyle} ${r.block.color}`,
|
|
1524
|
+
width: r.block.width === "full" ? "100%" : `${r.block.width}px`,
|
|
1525
|
+
margin: r.block.width === "full" ? "0" : "0 auto"
|
|
1526
|
+
}));
|
|
1527
|
+
return (e, r) => (t(), S("div", ai, [x("hr", {
|
|
1528
|
+
class: "tpl:m-0 tpl:border-none",
|
|
1529
|
+
style: n(i.value)
|
|
1530
|
+
}, null, 4)]));
|
|
1531
|
+
}
|
|
1532
|
+
}), si = { class: "tpl:w-full" }, ci = ["srcdoc", "title"], li = {
|
|
1533
|
+
key: 1,
|
|
1534
|
+
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)]"
|
|
1535
|
+
}, ui = {
|
|
1536
|
+
key: 0,
|
|
1537
|
+
class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
|
|
1538
|
+
}, di = {
|
|
1539
|
+
key: 1,
|
|
1540
|
+
class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
1541
|
+
}, fi = /* @__PURE__ */ F({
|
|
1542
|
+
__name: "HtmlBlock",
|
|
1543
|
+
props: {
|
|
1544
|
+
block: {},
|
|
1545
|
+
viewport: {}
|
|
1546
|
+
},
|
|
1547
|
+
setup(e) {
|
|
1548
|
+
let r = e, { t: a } = nn(), o = p(Ft, !1), s = N(() => r.block.content.trim().length > 0), c = N(() => o && s.value), l = p(pt, wt), u = p(At, null), d = N(() => u?.value ? xe(r.block.content, l.value) : r.block.content), m = _(null), h = _(60), g = null;
|
|
1549
|
+
function v() {
|
|
1550
|
+
let e = m.value?.contentDocument;
|
|
1551
|
+
e && (h.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
|
|
1552
|
+
}
|
|
1553
|
+
function b() {
|
|
1554
|
+
g?.disconnect(), g = null, v();
|
|
1555
|
+
let e = m.value?.contentDocument?.documentElement;
|
|
1556
|
+
e && typeof ResizeObserver < "u" && (g = new ResizeObserver(() => v()), g.observe(e));
|
|
1557
|
+
}
|
|
1558
|
+
return f(c, (e) => {
|
|
1559
|
+
e || (g?.disconnect(), g = null);
|
|
1560
|
+
}), i(() => {
|
|
1561
|
+
g?.disconnect(), g = null;
|
|
1562
|
+
}), (e, r) => (t(), S("div", si, [c.value ? (t(), S("iframe", {
|
|
1563
|
+
key: 0,
|
|
1564
|
+
ref_key: "iframeRef",
|
|
1565
|
+
ref: m,
|
|
1566
|
+
srcdoc: d.value,
|
|
1567
|
+
sandbox: "allow-same-origin",
|
|
1568
|
+
title: y(a).html.preview,
|
|
1569
|
+
class: "tpl:block tpl:w-full tpl:border-0",
|
|
1570
|
+
style: n({ height: `${h.value}px` }),
|
|
1571
|
+
onLoad: b
|
|
1572
|
+
}, null, 44, ci)) : (t(), S("div", li, [C(y(Ye), {
|
|
1573
|
+
size: 24,
|
|
1574
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
1575
|
+
}), s.value ? (t(), S("span", ui, D(y(a).html.preview), 1)) : (t(), S("span", di, D(y(a).html.empty), 1))]))]));
|
|
1576
|
+
}
|
|
1577
|
+
}), pi = ["data-drop-enabled"], mi = {
|
|
1578
|
+
key: 0,
|
|
1579
|
+
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)]",
|
|
1580
|
+
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 85%, transparent)" }
|
|
1581
|
+
}, hi = ["href"], gi = ["src", "alt"], _i = ["src", "alt"], vi = {
|
|
1582
|
+
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
1583
|
+
style: { opacity: "0.7" }
|
|
1584
|
+
}, yi = ["href"], bi = ["src", "alt"], xi = ["src", "alt"], Si = {
|
|
1585
|
+
key: 4,
|
|
1586
|
+
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)]"
|
|
1587
|
+
}, Ci = ["aria-label"], wi = { key: 1 }, Ti = /* @__PURE__ */ F({
|
|
1588
|
+
__name: "ImageBlock",
|
|
1589
|
+
props: {
|
|
1590
|
+
block: {},
|
|
1591
|
+
viewport: {}
|
|
1592
|
+
},
|
|
1593
|
+
emits: ["update"],
|
|
1594
|
+
setup(e, { emit: r }) {
|
|
1595
|
+
let i = e, a = r, { t: o } = nn(), { syntax: s } = xn(), c = p(_t, null), l = p(It, null), u = N(() => !!c), d = Cn();
|
|
1596
|
+
async function f() {
|
|
1597
|
+
let e = await c?.({ accept: ["images"] });
|
|
1598
|
+
if (d.alive && e) {
|
|
1599
|
+
let t = { src: e.url };
|
|
1600
|
+
e.alt && (t.alt = e.alt), a("update", t);
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
let m = _(), h = _(!1), g = N(() => (l?.value ?? !!c) && !h.value && !O.value);
|
|
1604
|
+
async function v(e) {
|
|
1605
|
+
if (c) {
|
|
1606
|
+
h.value = !0;
|
|
1607
|
+
try {
|
|
1608
|
+
let t = await c({
|
|
1609
|
+
accept: ["images"],
|
|
1610
|
+
files: e
|
|
1611
|
+
});
|
|
1612
|
+
if (!d.alive) return;
|
|
1613
|
+
if (t) {
|
|
1614
|
+
let e = { src: t.url };
|
|
1615
|
+
t.alt && (e.alt = t.alt), a("update", e);
|
|
1616
|
+
}
|
|
1617
|
+
} finally {
|
|
1618
|
+
d.alive && (h.value = !1);
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
let { isOver: b } = Je({
|
|
1623
|
+
target: m,
|
|
1624
|
+
enabled: g,
|
|
1625
|
+
onFiles: v
|
|
1626
|
+
}), T = N(() => ({ textAlign: i.block.align })), E = N(() => {
|
|
1627
|
+
let e = i.block.align;
|
|
1628
|
+
return {
|
|
1629
|
+
maxWidth: "100%",
|
|
1630
|
+
width: i.block.width === "full" ? "100%" : `${i.block.width}px`,
|
|
1631
|
+
height: i.block.height ? `${i.block.height}px` : void 0,
|
|
1632
|
+
borderRadius: i.block.borderRadius && i.block.borderRadius > 0 ? `${i.block.borderRadius}px` : void 0,
|
|
1633
|
+
display: "block",
|
|
1634
|
+
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
1635
|
+
marginRight: e === "center" ? "auto" : void 0
|
|
1636
|
+
};
|
|
1637
|
+
}), O = N(() => Ae(i.block.src, s)), k = jn(() => O.value ? void 0 : i.block.src), A = jn(() => O.value ? i.block.placeholderUrl : void 0);
|
|
1638
|
+
return (r, i) => (t(), S("div", {
|
|
1639
|
+
ref_key: "dropZoneRef",
|
|
1640
|
+
ref: m,
|
|
1641
|
+
"data-testid": "image-drop-zone",
|
|
1642
|
+
"data-drop-enabled": g.value,
|
|
1643
|
+
class: "tpl:relative tpl:w-full",
|
|
1644
|
+
style: n(T.value)
|
|
1645
|
+
}, [g.value && (y(b) || h.value) ? (t(), S("div", mi, [h.value ? (t(), S(M, { key: 0 }, [C(y(pn), {
|
|
1646
|
+
class: "tpl-spinner",
|
|
1647
|
+
size: 20,
|
|
1648
|
+
"stroke-width": 2
|
|
1649
|
+
}), w(" " + D(y(o).image.uploading), 1)], 64)) : (t(), S(M, { key: 1 }, [C(y(_n), {
|
|
1650
|
+
size: 20,
|
|
1651
|
+
"stroke-width": 1.5
|
|
1652
|
+
}), w(" " + D(y(o).image.dropToUpload), 1)], 64))])) : P("", !0), e.block.src && O.value && e.block.placeholderUrl ? (t(), S(M, { key: 1 }, [e.block.linkUrl ? (t(), S("a", {
|
|
1653
|
+
key: 0,
|
|
1654
|
+
href: e.block.linkUrl,
|
|
1655
|
+
target: "_blank",
|
|
1656
|
+
rel: "noopener noreferrer",
|
|
1657
|
+
onClick: i[0] ||= I(() => {}, ["prevent"])
|
|
1658
|
+
}, [x("img", {
|
|
1659
|
+
class: "tpl:border-0",
|
|
1660
|
+
loading: "lazy",
|
|
1661
|
+
src: y(A),
|
|
1662
|
+
alt: e.block.alt || y(o).image.altTextPlaceholder,
|
|
1663
|
+
style: n(E.value)
|
|
1664
|
+
}, null, 12, gi)], 8, hi)) : (t(), S("img", {
|
|
1665
|
+
key: 1,
|
|
1666
|
+
class: "tpl:border-0",
|
|
1667
|
+
src: y(A),
|
|
1668
|
+
alt: e.block.alt,
|
|
1669
|
+
style: n(E.value)
|
|
1670
|
+
}, null, 12, _i))], 64)) : e.block.src && O.value ? (t(), S("div", {
|
|
1671
|
+
key: 2,
|
|
1672
|
+
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)]",
|
|
1673
|
+
style: n([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, E.value])
|
|
1674
|
+
}, [C(y(Ge), {
|
|
1675
|
+
size: 32,
|
|
1676
|
+
"stroke-width": 1.5,
|
|
1677
|
+
class: "tpl:text-[var(--tpl-primary)]",
|
|
1678
|
+
style: { opacity: "0.5" }
|
|
1679
|
+
}), x("span", vi, [C(br, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (t(), S(M, { key: 3 }, [e.block.linkUrl ? (t(), S("a", {
|
|
1680
|
+
key: 0,
|
|
1681
|
+
href: e.block.linkUrl,
|
|
1682
|
+
target: "_blank",
|
|
1683
|
+
rel: "noopener noreferrer",
|
|
1684
|
+
onClick: i[1] ||= I(() => {}, ["prevent"])
|
|
1685
|
+
}, [x("img", {
|
|
1686
|
+
class: "tpl:border-0",
|
|
1687
|
+
loading: "lazy",
|
|
1688
|
+
src: y(k),
|
|
1689
|
+
alt: e.block.alt || y(o).image.altTextPlaceholder,
|
|
1690
|
+
style: n(E.value)
|
|
1691
|
+
}, null, 12, bi)], 8, yi)) : (t(), S("img", {
|
|
1692
|
+
key: 1,
|
|
1693
|
+
class: "tpl:border-0",
|
|
1694
|
+
src: y(k),
|
|
1695
|
+
alt: e.block.alt,
|
|
1696
|
+
style: n(E.value)
|
|
1697
|
+
}, null, 12, xi))], 64)) : (t(), S("div", Si, [u.value ? (t(), S("button", {
|
|
1698
|
+
key: 0,
|
|
1699
|
+
"aria-label": y(o).image.browseMedia,
|
|
1700
|
+
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)]",
|
|
1701
|
+
onClick: I(f, ["stop"])
|
|
1702
|
+
}, [C(y(Ge), {
|
|
1703
|
+
size: 14,
|
|
1704
|
+
"stroke-width": 1.5
|
|
1705
|
+
}), w(" " + D(y(o).image.browseMedia), 1)], 8, Ci)) : (t(), S("span", wi, D(y(o).image.clickToAdd), 1))]))], 12, pi));
|
|
1706
|
+
}
|
|
1707
|
+
}), Ei = { class: "tpl:w-full" }, Di = ["href"], Oi = {
|
|
1708
|
+
key: 1,
|
|
1709
|
+
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)]"
|
|
1710
|
+
}, ki = /* @__PURE__ */ F({
|
|
1711
|
+
__name: "MenuBlock",
|
|
1712
|
+
props: {
|
|
1713
|
+
block: {},
|
|
1714
|
+
viewport: {}
|
|
1715
|
+
},
|
|
1716
|
+
setup(e) {
|
|
1717
|
+
let r = e, { t: i } = nn(), a = N(() => ({
|
|
1718
|
+
display: "flex",
|
|
1719
|
+
flexWrap: "wrap",
|
|
1720
|
+
gap: `0 ${r.block.spacing}px`,
|
|
1721
|
+
justifyContent: r.block.textAlign === "left" ? "flex-start" : r.block.textAlign === "right" ? "flex-end" : "center",
|
|
1722
|
+
fontSize: `${r.block.fontSize}px`,
|
|
1723
|
+
fontFamily: r.block.fontFamily || "inherit",
|
|
1724
|
+
alignItems: "center"
|
|
1725
|
+
})), o = N(() => r.block.items.length > 0);
|
|
1726
|
+
function s(e) {
|
|
1727
|
+
return e || r.block.linkColor || r.block.color;
|
|
1728
|
+
}
|
|
1729
|
+
return (r, c) => (t(), S("div", Ei, [o.value ? (t(), S("div", {
|
|
1730
|
+
key: 0,
|
|
1731
|
+
style: n(a.value)
|
|
1732
|
+
}, [(t(!0), S(M, null, l(e.block.items, (r, i) => (t(), S(M, { key: r.id }, [x("a", {
|
|
1733
|
+
href: r.url || "#",
|
|
1734
|
+
class: "tpl:cursor-default tpl:no-underline",
|
|
1735
|
+
style: n({
|
|
1736
|
+
color: s(r.color),
|
|
1737
|
+
fontWeight: r.bold ? "bold" : "normal",
|
|
1738
|
+
textDecoration: r.underline ? "underline" : "none"
|
|
1739
|
+
}),
|
|
1740
|
+
onClick: c[0] ||= I(() => {}, ["prevent"])
|
|
1741
|
+
}, [C(br, { text: r.text || "..." }, null, 8, ["text"])], 12, Di), i < e.block.items.length - 1 ? (t(), S("span", {
|
|
1742
|
+
key: 0,
|
|
1743
|
+
style: n({
|
|
1744
|
+
color: e.block.separatorColor,
|
|
1745
|
+
padding: `0 ${e.block.spacing}px`
|
|
1746
|
+
})
|
|
1747
|
+
}, D(e.block.separator), 5)) : P("", !0)], 64))), 128))], 4)) : (t(), S("div", Oi, [C(y(Qe), { size: 16 }), x("span", null, D(y(i).menu.addLinks), 1)]))]));
|
|
1748
|
+
}
|
|
1749
|
+
}), Ai = /* @__PURE__ */ new Set([
|
|
1750
|
+
"http",
|
|
1751
|
+
"https",
|
|
1752
|
+
"mailto",
|
|
1753
|
+
"tel",
|
|
1754
|
+
"ftp",
|
|
1755
|
+
"ftps",
|
|
1756
|
+
"sms",
|
|
1757
|
+
"xmpp",
|
|
1758
|
+
"cid"
|
|
1759
|
+
]), ji = /* @__PURE__ */ new Set([
|
|
1760
|
+
"SCRIPT",
|
|
1761
|
+
"STYLE",
|
|
1762
|
+
"IFRAME",
|
|
1763
|
+
"OBJECT",
|
|
1764
|
+
"EMBED",
|
|
1765
|
+
"LINK",
|
|
1766
|
+
"META",
|
|
1767
|
+
"BASE",
|
|
1768
|
+
"FORM"
|
|
1769
|
+
]), Mi = /* @__PURE__ */ new Set([
|
|
1770
|
+
"href",
|
|
1771
|
+
"xlink:href",
|
|
1772
|
+
"formaction",
|
|
1773
|
+
"action",
|
|
1774
|
+
"ping",
|
|
1775
|
+
"background",
|
|
1776
|
+
"poster"
|
|
1777
|
+
]);
|
|
1778
|
+
function Ni(e, t) {
|
|
1779
|
+
let n = e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
1780
|
+
if (!n || n.startsWith("#")) return !0;
|
|
1781
|
+
let r = /^([a-z][a-z0-9+.-]*):/i.exec(n);
|
|
1782
|
+
if (!r) return !0;
|
|
1783
|
+
let i = r[1].toLowerCase();
|
|
1784
|
+
return Ai.has(i) ? !0 : t && i === "data" ? /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i.test(n) : !1;
|
|
1785
|
+
}
|
|
1786
|
+
function Pi(e) {
|
|
1787
|
+
if (ji.has(e.tagName)) {
|
|
1788
|
+
e.remove();
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1791
|
+
let t = [];
|
|
1792
|
+
for (let n = 0; n < e.attributes.length; n++) t.push(e.attributes[n].name);
|
|
1793
|
+
for (let n of t) {
|
|
1794
|
+
let t = n.toLowerCase();
|
|
1795
|
+
if (t.startsWith("on")) {
|
|
1796
|
+
e.removeAttribute(n);
|
|
1797
|
+
continue;
|
|
1798
|
+
}
|
|
1799
|
+
if (Mi.has(t)) {
|
|
1800
|
+
Ni(e.getAttribute(n) ?? "", !1) || e.removeAttribute(n);
|
|
1801
|
+
continue;
|
|
1802
|
+
}
|
|
1803
|
+
if (t === "src") {
|
|
1804
|
+
Ni(e.getAttribute(n) ?? "", !0) || e.removeAttribute(n);
|
|
1805
|
+
continue;
|
|
1806
|
+
}
|
|
1807
|
+
t === "srcdoc" && e.removeAttribute(n);
|
|
1808
|
+
}
|
|
1809
|
+
let n = Array.from(e.children);
|
|
1810
|
+
for (let e of n) Pi(e);
|
|
1811
|
+
}
|
|
1812
|
+
function Fi(e) {
|
|
1813
|
+
if (typeof DOMParser > "u") return e;
|
|
1814
|
+
let t = new DOMParser().parseFromString(`<!doctype html><body>${e}</body>`, "text/html").body, n = Array.from(t.children);
|
|
1815
|
+
for (let e of n) Pi(e);
|
|
1816
|
+
return t.innerHTML;
|
|
1817
|
+
}
|
|
1818
|
+
//#endregion
|
|
1819
|
+
//#region src/composables/useEditableTextBlock.ts
|
|
1820
|
+
function Ii(e) {
|
|
1821
|
+
let t = p(pt, wt), n = p(At, null), { syntax: r } = xn(), i = N(() => n?.value ? ye(e(), t.value) : ae(e(), t.value)), a = N(() => Fi(Be(i.value, r))), o = _(!1), s = _(null), { top: c, left: l } = lt(s), { toLocal: u } = cn(), d = N(() => u({
|
|
1822
|
+
top: c.value - 8,
|
|
1823
|
+
left: l.value
|
|
1824
|
+
}));
|
|
1825
|
+
function f() {
|
|
1826
|
+
o.value = !0;
|
|
1827
|
+
}
|
|
1828
|
+
function m() {
|
|
1829
|
+
o.value = !1;
|
|
1830
|
+
}
|
|
1831
|
+
return {
|
|
1832
|
+
isEditing: o,
|
|
1833
|
+
blockRef: s,
|
|
1834
|
+
toolbarPosition: d,
|
|
1835
|
+
resolvedContent: a,
|
|
1836
|
+
handleDoubleClick: f,
|
|
1837
|
+
handleEditorDone: m
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
//#endregion
|
|
1841
|
+
//#region src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1842
|
+
var Li = ["innerHTML"], Ri = /* @__PURE__ */ F({
|
|
1843
|
+
__name: "ParagraphBlock",
|
|
1844
|
+
props: {
|
|
1845
|
+
block: {},
|
|
1846
|
+
viewport: {}
|
|
1847
|
+
},
|
|
1848
|
+
setup(e) {
|
|
1849
|
+
let n = e, r = v(() => import("./ParagraphEditor-DkkPSexG.js")), { isEditing: i, blockRef: a, toolbarPosition: o, resolvedContent: s, handleDoubleClick: c, handleEditorDone: l } = Ii(() => n.block.content);
|
|
1850
|
+
return (n, u) => (t(), S("div", {
|
|
1851
|
+
ref_key: "blockRef",
|
|
1852
|
+
ref: a,
|
|
1853
|
+
class: "tpl:min-h-[1em] tpl:w-full",
|
|
1854
|
+
onDblclick: u[0] ||= (...e) => y(c) && y(c)(...e)
|
|
1855
|
+
}, [y(i) ? (t(), A(y(r), {
|
|
1856
|
+
key: 0,
|
|
1857
|
+
block: e.block,
|
|
1858
|
+
"toolbar-position": y(o),
|
|
1859
|
+
onDone: y(l)
|
|
1860
|
+
}, null, 8, [
|
|
1861
|
+
"block",
|
|
1862
|
+
"toolbar-position",
|
|
1863
|
+
"onDone"
|
|
1864
|
+
])) : (t(), S("div", {
|
|
1865
|
+
key: 1,
|
|
1866
|
+
class: "tpl-text-content tpl:outline-none",
|
|
1867
|
+
innerHTML: y(s)
|
|
1868
|
+
}, null, 8, Li))], 544));
|
|
1869
|
+
}
|
|
1870
|
+
});
|
|
1871
|
+
//#endregion
|
|
1872
|
+
//#region src/utils/blockComponentResolver.ts
|
|
1873
|
+
function zi(e) {
|
|
1874
|
+
let t = { fontFamily: e.fontFamily };
|
|
1875
|
+
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;
|
|
1876
|
+
}
|
|
1877
|
+
function Bi(e, t, n) {
|
|
1878
|
+
if (t) {
|
|
1879
|
+
let n = t.getComponent(e);
|
|
1880
|
+
if (n) return n;
|
|
1881
|
+
}
|
|
1882
|
+
return n[e.type] ?? null;
|
|
1883
|
+
}
|
|
1884
|
+
function Vi(e) {
|
|
1885
|
+
let { padding: t, backgroundColor: n } = e.styles, r = {
|
|
1886
|
+
padding: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
1887
|
+
backgroundColor: n || "transparent"
|
|
1888
|
+
};
|
|
1889
|
+
return (e.type === "paragraph" || e.type === "title") && (r["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ?? Oe.paragraphGap : Oe.paragraphGap}px`), e.type === "section" && e.borderRadius && e.borderRadius > 0 && (r.borderRadius = `${e.borderRadius}px`), r;
|
|
1890
|
+
}
|
|
1891
|
+
function Hi(e) {
|
|
1892
|
+
if (e.type !== "section" || !e.wrapper) return null;
|
|
1893
|
+
let t = e.wrapper, n = {};
|
|
1894
|
+
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;
|
|
1895
|
+
}
|
|
1896
|
+
//#endregion
|
|
1897
|
+
//#region src/components/blocks/BlockWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
1898
|
+
var Ui = [
|
|
1899
|
+
"data-block-id",
|
|
1900
|
+
"data-block-type",
|
|
1901
|
+
"data-tpl-picked"
|
|
1902
|
+
], Wi = ["aria-label"], Gi = [
|
|
1903
|
+
"aria-label",
|
|
1904
|
+
"aria-pressed",
|
|
1905
|
+
"title"
|
|
1906
|
+
], Ki = ["aria-label", "title"], qi = ["aria-label", "title"], Ji = ["aria-label", "title"], Yi = {
|
|
1907
|
+
key: 1,
|
|
1908
|
+
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"
|
|
1909
|
+
}, Xi = { 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)]" }, Zi = {
|
|
1910
|
+
key: 2,
|
|
1911
|
+
class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
|
|
1912
|
+
}, Qi = ["aria-label", "title"], $i = {
|
|
1913
|
+
key: 3,
|
|
1914
|
+
class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
|
|
1915
|
+
}, ea = ["aria-label"], ta = /*#__PURE__*/ yn(/* @__PURE__ */ F({
|
|
1916
|
+
__name: "BlockWrapper",
|
|
1917
|
+
props: {
|
|
1918
|
+
block: {},
|
|
1919
|
+
isSelected: { type: Boolean },
|
|
1920
|
+
viewport: {},
|
|
1921
|
+
previewMode: { type: Boolean },
|
|
1922
|
+
nested: { type: Boolean },
|
|
1923
|
+
picked: { type: Boolean }
|
|
1924
|
+
},
|
|
1925
|
+
emits: ["select"],
|
|
1926
|
+
setup(e, { emit: r }) {
|
|
1927
|
+
let i = v(() => import("./BlockIssueBadge-D5oGxOQP.js")), o = e, s = r, { t: c, format: l } = nn(), d = p(Et, null), f = _(null), m = N(() => d?.liftedBlockId.value === o.block.id), h = N(() => m.value ? l(c.blockActions.dragLifted, { block: o.block.type }) : c.blockActions.drag);
|
|
1928
|
+
async function g() {
|
|
1929
|
+
await a(), f.value?.focus();
|
|
1930
|
+
}
|
|
1931
|
+
function b(e) {
|
|
1932
|
+
if (d) {
|
|
1933
|
+
if (e.key === " " || e.key === "Enter") {
|
|
1934
|
+
e.preventDefault(), e.stopPropagation(), m.value ? d.drop(o.block.id) : d.lift(o.block.id);
|
|
1935
|
+
return;
|
|
1936
|
+
}
|
|
1937
|
+
if (m.value) {
|
|
1938
|
+
if (e.key === "Escape") {
|
|
1939
|
+
e.preventDefault(), e.stopPropagation(), d.cancel(), g();
|
|
1940
|
+
return;
|
|
1941
|
+
}
|
|
1942
|
+
if (e.key === "ArrowUp") {
|
|
1943
|
+
e.preventDefault(), e.stopPropagation(), d.moveUp(o.block.id), g();
|
|
1944
|
+
return;
|
|
1945
|
+
}
|
|
1946
|
+
e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), d.moveDown(o.block.id), g());
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
let T = N(() => !o.viewport || !o.block.visibility ? !1 : o.block.visibility[o.viewport] === !1), E = N(() => o.previewMode === !0 && T.value), O = N(() => o.viewport ? {
|
|
1951
|
+
desktop: c.viewport.desktop,
|
|
1952
|
+
mobile: c.viewport.mobile
|
|
1953
|
+
}[o.viewport] ?? o.viewport : ""), A = N(() => !!o.block.displayCondition), j = p(Pt, null), M = p(Rt, null), ee = p(Ut, {}), F = N(() => ee.savedBlocks?.isPicking.value === !0), te = N(() => !o.nested && ee.savedBlocks?.isAvailable.value === !0 && ee.savedBlocks?.canCreate.value === !0), ne = N(() => o.isSelected && !F.value), re = N(() => ee.comments?.getBlockCount(o.block.id) ?? 0), ie = N(() => Vi(o.block)), ae = N(() => Hi(o.block));
|
|
1954
|
+
function oe(e) {
|
|
1955
|
+
o.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), s("select"));
|
|
1956
|
+
}
|
|
1957
|
+
function se() {
|
|
1958
|
+
j?.deleteBlock(o.block.id);
|
|
1959
|
+
}
|
|
1960
|
+
function ce() {
|
|
1961
|
+
j?.duplicateBlock(o.block);
|
|
1962
|
+
}
|
|
1963
|
+
function le() {
|
|
1964
|
+
ee.savedBlocks?.startPicking(o.block.id);
|
|
1965
|
+
}
|
|
1966
|
+
function ue() {
|
|
1967
|
+
M?.toggleBlock(o.block.id);
|
|
1968
|
+
}
|
|
1969
|
+
return (r, a) => E.value ? P("", !0) : (t(), S("div", {
|
|
1970
|
+
key: 0,
|
|
1971
|
+
class: k(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow", {
|
|
1972
|
+
"tpl-block--selected": e.isSelected,
|
|
1973
|
+
"tpl-block--picked": e.picked,
|
|
1974
|
+
"tpl-block--idle": !e.isSelected && !e.picked,
|
|
1975
|
+
"tpl-block--lifted": m.value
|
|
1976
|
+
}]),
|
|
1977
|
+
"data-block-id": e.block.id,
|
|
1978
|
+
"data-block-type": e.block.type,
|
|
1979
|
+
"data-tpl-picked": e.picked || void 0,
|
|
1980
|
+
onClick: oe
|
|
1981
|
+
}, [
|
|
1982
|
+
C(y(i), { "block-id": e.block.id }, null, 8, ["block-id"]),
|
|
1983
|
+
ne.value ? (t(), S("div", {
|
|
1984
|
+
key: 0,
|
|
1985
|
+
role: "toolbar",
|
|
1986
|
+
"aria-label": y(c).blockActions.drag,
|
|
1987
|
+
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)]"
|
|
1988
|
+
}, [
|
|
1989
|
+
x("button", {
|
|
1990
|
+
ref_key: "dragButtonRef",
|
|
1991
|
+
ref: f,
|
|
1992
|
+
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",
|
|
1993
|
+
"aria-label": h.value,
|
|
1994
|
+
"aria-pressed": m.value,
|
|
1995
|
+
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
1996
|
+
title: y(c).blockActions.drag,
|
|
1997
|
+
onKeydown: b
|
|
1998
|
+
}, [C(y(Dr), {
|
|
1999
|
+
size: 14,
|
|
2000
|
+
"stroke-width": 1.5
|
|
2001
|
+
})], 40, Gi),
|
|
2002
|
+
x("button", {
|
|
2003
|
+
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",
|
|
2004
|
+
"aria-label": y(c).blockActions.duplicate,
|
|
2005
|
+
title: y(c).blockActions.duplicate,
|
|
2006
|
+
onClick: I(ce, ["stop"])
|
|
2007
|
+
}, [C(y(fn), {
|
|
2008
|
+
size: 14,
|
|
2009
|
+
"stroke-width": 1.5
|
|
2010
|
+
})], 8, Ki),
|
|
2011
|
+
te.value ? (t(), S("button", {
|
|
2012
|
+
key: 0,
|
|
2013
|
+
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",
|
|
2014
|
+
"aria-label": y(c).blockActions.saveAsBlock,
|
|
2015
|
+
title: y(c).blockActions.saveAsBlock,
|
|
2016
|
+
onClick: I(le, ["stop"])
|
|
2017
|
+
}, [C(y(Cr), {
|
|
2018
|
+
size: 14,
|
|
2019
|
+
"stroke-width": 1.5
|
|
2020
|
+
})], 8, qi)) : P("", !0),
|
|
2021
|
+
x("button", {
|
|
2022
|
+
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",
|
|
2023
|
+
"aria-label": y(c).blockActions.delete,
|
|
2024
|
+
title: y(c).blockActions.delete,
|
|
2025
|
+
onClick: I(se, ["stop"])
|
|
2026
|
+
}, [C(y(hn), {
|
|
2027
|
+
size: 14,
|
|
2028
|
+
"stroke-width": 1.5
|
|
2029
|
+
})], 8, Ji)
|
|
2030
|
+
], 8, Wi)) : P("", !0),
|
|
2031
|
+
T.value ? (t(), S("div", Yi, [x("span", Xi, [C(y(Tr), {
|
|
2032
|
+
size: 12,
|
|
2033
|
+
"stroke-width": 1.5
|
|
2034
|
+
}), w(" " + D(y(l)(y(c).blockActions.hiddenOnViewport, { viewport: O.value })), 1)])])) : P("", !0),
|
|
2035
|
+
A.value && !T.value ? (t(), S("div", Zi, [x("button", {
|
|
2036
|
+
"data-testid": "condition-toggle",
|
|
2037
|
+
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)]",
|
|
2038
|
+
"aria-label": y(c).blockActions.conditionToggle,
|
|
2039
|
+
title: e.block.displayCondition?.label,
|
|
2040
|
+
onClick: I(ue, ["stop"])
|
|
2041
|
+
}, [C(y(Er), {
|
|
2042
|
+
size: 12,
|
|
2043
|
+
"stroke-width": 2
|
|
2044
|
+
})], 8, Qi)])) : P("", !0),
|
|
2045
|
+
re.value > 0 && !T.value ? (t(), S("div", $i, [x("button", {
|
|
2046
|
+
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)]",
|
|
2047
|
+
"aria-label": y(l)(y(c).blockActions.comments, { count: String(re.value) }),
|
|
2048
|
+
onClick: a[0] ||= I((t) => y(ee).comments?.openForBlock(e.block.id), ["stop"])
|
|
2049
|
+
}, [C(y(mn), {
|
|
2050
|
+
size: 12,
|
|
2051
|
+
"stroke-width": 2.5
|
|
2052
|
+
}), w(" " + D(re.value), 1)], 8, ea)])) : P("", !0),
|
|
2053
|
+
ae.value ? (t(), S("div", {
|
|
2054
|
+
key: 4,
|
|
2055
|
+
class: "tpl-section-wrapper",
|
|
2056
|
+
style: n(ae.value)
|
|
2057
|
+
}, [x("div", {
|
|
2058
|
+
class: "tpl-block-content",
|
|
2059
|
+
style: n(ie.value)
|
|
2060
|
+
}, [u(r.$slots, "default", {}, void 0, !0)], 4)], 4)) : (t(), S("div", {
|
|
2061
|
+
key: 5,
|
|
2062
|
+
class: "tpl-block-content",
|
|
2063
|
+
style: n(ie.value)
|
|
2064
|
+
}, [u(r.$slots, "default", {}, void 0, !0)], 4))
|
|
2065
|
+
], 10, Ui));
|
|
2066
|
+
}
|
|
2067
|
+
}), [["__scopeId", "data-v-2c239048"]]);
|
|
2068
|
+
//#endregion
|
|
2069
|
+
//#region src/utils/unwrapParagraph.ts
|
|
2070
|
+
function na(e) {
|
|
2071
|
+
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
2072
|
+
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
2073
|
+
}
|
|
2074
|
+
//#endregion
|
|
2075
|
+
//#region src/components/blocks/TitleBlock.vue
|
|
2076
|
+
var ra = /* @__PURE__ */ F({
|
|
2077
|
+
__name: "TitleBlock",
|
|
2078
|
+
props: {
|
|
2079
|
+
block: {},
|
|
2080
|
+
viewport: {}
|
|
2081
|
+
},
|
|
2082
|
+
setup(e) {
|
|
2083
|
+
let r = e, i = v(() => import("./TitleEditor-QBBOXtxx.js")), { isEditing: a, blockRef: s, toolbarPosition: c, resolvedContent: l, handleDoubleClick: u, handleEditorDone: d } = Ii(() => r.block.content), f = N(() => {
|
|
2084
|
+
let e = {
|
|
2085
|
+
fontSize: `${Pe[r.block.level]}px`,
|
|
2086
|
+
textAlign: r.block.textAlign
|
|
2087
|
+
};
|
|
2088
|
+
return r.block.color && (e.color = r.block.color), r.block.fontFamily && (e.fontFamily = r.block.fontFamily), e;
|
|
2089
|
+
}), p = N(() => `h${r.block.level}`), m = N(() => na(l.value));
|
|
2090
|
+
return (r, l) => (t(), S("div", {
|
|
2091
|
+
ref_key: "blockRef",
|
|
2092
|
+
ref: s,
|
|
2093
|
+
class: "tpl:min-h-[1em] tpl:w-full",
|
|
2094
|
+
style: n(f.value),
|
|
2095
|
+
onDblclick: l[0] ||= (...e) => y(u) && y(u)(...e)
|
|
2096
|
+
}, [y(a) ? (t(), A(y(i), {
|
|
2097
|
+
key: 0,
|
|
2098
|
+
block: e.block,
|
|
2099
|
+
"toolbar-position": y(c),
|
|
2100
|
+
onDone: y(d)
|
|
2101
|
+
}, null, 8, [
|
|
2102
|
+
"block",
|
|
2103
|
+
"toolbar-position",
|
|
2104
|
+
"onDone"
|
|
2105
|
+
])) : (t(), A(o(p.value), {
|
|
2106
|
+
key: 1,
|
|
2107
|
+
class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-tight tpl:outline-none",
|
|
2108
|
+
style: { color: "inherit" },
|
|
2109
|
+
innerHTML: m.value
|
|
2110
|
+
}, null, 8, ["innerHTML"]))], 36));
|
|
2111
|
+
}
|
|
2112
|
+
});
|
|
2113
|
+
//#endregion
|
|
2114
|
+
//#region src/utils/sectionColumnDrop.ts
|
|
2115
|
+
function ia(e) {
|
|
2116
|
+
return e.dataset.blockType !== "section" && e.dataset.paletteType !== "section";
|
|
2117
|
+
}
|
|
2118
|
+
//#endregion
|
|
2119
|
+
//#region ../../node_modules/.pnpm/vue-draggable-plus@0.6.1_@types+sortablejs@1.15.9/node_modules/vue-draggable-plus/dist/vue-draggable-plus.js
|
|
2120
|
+
var aa = Object.defineProperty, oa = Object.getOwnPropertySymbols, sa = Object.prototype.hasOwnProperty, ca = Object.prototype.propertyIsEnumerable, la = (e, t, n) => t in e ? aa(e, t, {
|
|
2121
|
+
enumerable: !0,
|
|
2122
|
+
configurable: !0,
|
|
2123
|
+
writable: !0,
|
|
2124
|
+
value: n
|
|
2125
|
+
}) : e[t] = n, ua = (e, t) => {
|
|
2126
|
+
for (var n in t ||= {}) sa.call(t, n) && la(e, n, t[n]);
|
|
2127
|
+
if (oa) for (var n of oa(t)) ca.call(t, n) && la(e, n, t[n]);
|
|
2128
|
+
return e;
|
|
2129
|
+
}, da = (e, t) => {
|
|
2130
|
+
var n = {};
|
|
2131
|
+
for (var r in e) sa.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
2132
|
+
if (e != null && oa) for (var r of oa(e)) t.indexOf(r) < 0 && ca.call(e, r) && (n[r] = e[r]);
|
|
2133
|
+
return n;
|
|
2134
|
+
}, fa = "[vue-draggable-plus]: ";
|
|
2135
|
+
function pa(e) {
|
|
2136
|
+
console.warn(fa + e);
|
|
2137
|
+
}
|
|
2138
|
+
function ma(e) {
|
|
2139
|
+
console.error(fa + e);
|
|
2140
|
+
}
|
|
2141
|
+
function ha(e, t, n) {
|
|
2142
|
+
return n >= 0 && n < e.length && e.splice(n, 0, e.splice(t, 1)[0]), e;
|
|
2143
|
+
}
|
|
2144
|
+
function ga(e) {
|
|
2145
|
+
return e.replace(/-(\w)/g, (e, t) => t ? t.toUpperCase() : "");
|
|
2146
|
+
}
|
|
2147
|
+
function _a(e) {
|
|
2148
|
+
return Object.keys(e).reduce((t, n) => (e[n] !== void 0 && (t[ga(n)] = e[n]), t), {});
|
|
2149
|
+
}
|
|
2150
|
+
function va(e, t) {
|
|
2151
|
+
return Array.isArray(e) && e.splice(t, 1), e;
|
|
2152
|
+
}
|
|
2153
|
+
function ya(e, t, n) {
|
|
2154
|
+
return Array.isArray(e) && e.splice(t, 0, n), e;
|
|
2155
|
+
}
|
|
2156
|
+
function ba(e) {
|
|
2157
|
+
return e === void 0;
|
|
2158
|
+
}
|
|
2159
|
+
function xa(e) {
|
|
2160
|
+
return typeof e == "string";
|
|
2161
|
+
}
|
|
2162
|
+
function Sa(e, t, n) {
|
|
2163
|
+
let r = e.children[n];
|
|
2164
|
+
e.insertBefore(t, r);
|
|
2165
|
+
}
|
|
2166
|
+
function Ca(e) {
|
|
2167
|
+
e.parentNode && e.parentNode.removeChild(e);
|
|
2168
|
+
}
|
|
2169
|
+
function wa(e, t = document) {
|
|
2170
|
+
let n = null;
|
|
2171
|
+
return n = typeof t?.querySelector == "function" ? (t?.querySelector)?.call(t, e) : document.querySelector(e), n || pa(`Element not found: ${e}`), n;
|
|
2172
|
+
}
|
|
2173
|
+
function Ta(e, t, n = null) {
|
|
2174
|
+
return function(...r) {
|
|
2175
|
+
return e.apply(n, r), t.apply(n, r);
|
|
2176
|
+
};
|
|
2177
|
+
}
|
|
2178
|
+
function Ea(e, t) {
|
|
2179
|
+
let n = ua({}, e);
|
|
2180
|
+
return Object.keys(t).forEach((r) => {
|
|
2181
|
+
n[r] ? n[r] = Ta(e[r], t[r]) : n[r] = t[r];
|
|
2182
|
+
}), n;
|
|
2183
|
+
}
|
|
2184
|
+
function Da(e) {
|
|
2185
|
+
return e instanceof HTMLElement;
|
|
2186
|
+
}
|
|
2187
|
+
function Oa(e, t) {
|
|
2188
|
+
Object.keys(e).forEach((n) => {
|
|
2189
|
+
t(n, e[n]);
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
function ka(e) {
|
|
2193
|
+
return e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97);
|
|
2194
|
+
}
|
|
2195
|
+
var Aa = Object.assign;
|
|
2196
|
+
function ja(e, t) {
|
|
2197
|
+
var n = Object.keys(e);
|
|
2198
|
+
if (Object.getOwnPropertySymbols) {
|
|
2199
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
2200
|
+
t && (r = r.filter(function(t) {
|
|
2201
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
2202
|
+
})), n.push.apply(n, r);
|
|
2203
|
+
}
|
|
2204
|
+
return n;
|
|
2205
|
+
}
|
|
2206
|
+
function Ma(e) {
|
|
2207
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
2208
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
2209
|
+
t % 2 ? ja(Object(n), !0).forEach(function(t) {
|
|
2210
|
+
Pa(e, t, n[t]);
|
|
2211
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ja(Object(n)).forEach(function(t) {
|
|
2212
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
2213
|
+
});
|
|
2214
|
+
}
|
|
2215
|
+
return e;
|
|
2216
|
+
}
|
|
2217
|
+
function Na(e) {
|
|
2218
|
+
"@babel/helpers - typeof";
|
|
2219
|
+
return Na = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2220
|
+
return typeof e;
|
|
2221
|
+
} : function(e) {
|
|
2222
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2223
|
+
}, Na(e);
|
|
2224
|
+
}
|
|
2225
|
+
function Pa(e, t, n) {
|
|
2226
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
2227
|
+
value: n,
|
|
2228
|
+
enumerable: !0,
|
|
2229
|
+
configurable: !0,
|
|
2230
|
+
writable: !0
|
|
2231
|
+
}) : e[t] = n, e;
|
|
2232
|
+
}
|
|
2233
|
+
function Fa() {
|
|
2234
|
+
return Fa = Object.assign || function(e) {
|
|
2235
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
2236
|
+
var n = arguments[t];
|
|
2237
|
+
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
2238
|
+
}
|
|
2239
|
+
return e;
|
|
2240
|
+
}, Fa.apply(this, arguments);
|
|
2241
|
+
}
|
|
2242
|
+
function Ia(e, t) {
|
|
2243
|
+
if (e == null) return {};
|
|
2244
|
+
for (var n = {}, r = Object.keys(e), i, a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
|
|
2245
|
+
return n;
|
|
2246
|
+
}
|
|
2247
|
+
function La(e, t) {
|
|
2248
|
+
if (e == null) return {};
|
|
2249
|
+
var n = Ia(e, t), r, i;
|
|
2250
|
+
if (Object.getOwnPropertySymbols) {
|
|
2251
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
2252
|
+
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
|
|
2253
|
+
}
|
|
2254
|
+
return n;
|
|
2255
|
+
}
|
|
2256
|
+
var Ra = "1.15.2";
|
|
2257
|
+
function za(e) {
|
|
2258
|
+
if (typeof window < "u" && window.navigator) return !!/* @__PURE__ */ navigator.userAgent.match(e);
|
|
2259
|
+
}
|
|
2260
|
+
var Ba = za(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Va = za(/Edge/i), Ha = za(/firefox/i), Ua = za(/safari/i) && !za(/chrome/i) && !za(/android/i), Wa = za(/iP(ad|od|hone)/i), Ga = za(/chrome/i) && za(/android/i), Ka = {
|
|
2261
|
+
capture: !1,
|
|
2262
|
+
passive: !1
|
|
2263
|
+
};
|
|
2264
|
+
function L(e, t, n) {
|
|
2265
|
+
e.addEventListener(t, n, !Ba && Ka);
|
|
2266
|
+
}
|
|
2267
|
+
function R(e, t, n) {
|
|
2268
|
+
e.removeEventListener(t, n, !Ba && Ka);
|
|
2269
|
+
}
|
|
2270
|
+
function qa(e, t) {
|
|
2271
|
+
if (t) {
|
|
2272
|
+
if (t[0] === ">" && (t = t.substring(1)), e) try {
|
|
2273
|
+
if (e.matches) return e.matches(t);
|
|
2274
|
+
if (e.msMatchesSelector) return e.msMatchesSelector(t);
|
|
2275
|
+
if (e.webkitMatchesSelector) return e.webkitMatchesSelector(t);
|
|
2276
|
+
} catch {
|
|
2277
|
+
return !1;
|
|
2278
|
+
}
|
|
2279
|
+
return !1;
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
function Ja(e) {
|
|
2283
|
+
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
|
|
2284
|
+
}
|
|
2285
|
+
function Ya(e, t, n, r) {
|
|
2286
|
+
if (e) {
|
|
2287
|
+
n ||= document;
|
|
2288
|
+
do {
|
|
2289
|
+
if (t != null && (t[0] === ">" ? e.parentNode === n && qa(e, t) : qa(e, t)) || r && e === n) return e;
|
|
2290
|
+
if (e === n) break;
|
|
2291
|
+
} while (e = Ja(e));
|
|
2292
|
+
}
|
|
2293
|
+
return null;
|
|
2294
|
+
}
|
|
2295
|
+
var Xa = /\s+/g;
|
|
2296
|
+
function Za(e, t, n) {
|
|
2297
|
+
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(Xa, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(Xa, " "));
|
|
2298
|
+
}
|
|
2299
|
+
function z(e, t, n) {
|
|
2300
|
+
var r = e && e.style;
|
|
2301
|
+
if (r) {
|
|
2302
|
+
if (n === void 0) return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (n = e.currentStyle), t === void 0 ? n : n[t];
|
|
2303
|
+
!(t in r) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), r[t] = n + (typeof n == "string" ? "" : "px");
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
function Qa(e, t) {
|
|
2307
|
+
var n = "";
|
|
2308
|
+
if (typeof e == "string") n = e;
|
|
2309
|
+
else do {
|
|
2310
|
+
var r = z(e, "transform");
|
|
2311
|
+
r && r !== "none" && (n = r + " " + n);
|
|
2312
|
+
} while (!t && (e = e.parentNode));
|
|
2313
|
+
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
2314
|
+
return i && new i(n);
|
|
2315
|
+
}
|
|
2316
|
+
function $a(e, t, n) {
|
|
2317
|
+
if (e) {
|
|
2318
|
+
var r = e.getElementsByTagName(t), i = 0, a = r.length;
|
|
2319
|
+
if (n) for (; i < a; i++) n(r[i], i);
|
|
2320
|
+
return r;
|
|
2321
|
+
}
|
|
2322
|
+
return [];
|
|
2323
|
+
}
|
|
2324
|
+
function eo() {
|
|
2325
|
+
return document.scrollingElement || document.documentElement;
|
|
2326
|
+
}
|
|
2327
|
+
function B(e, t, n, r, i) {
|
|
2328
|
+
if (e.getBoundingClientRect || e === window) {
|
|
2329
|
+
var a, o, s, c, l, u, d;
|
|
2330
|
+
if (e !== window && e.parentNode && e !== eo() ? (a = e.getBoundingClientRect(), o = a.top, s = a.left, c = a.bottom, l = a.right, u = a.height, d = a.width) : (o = 0, s = 0, c = window.innerHeight, l = window.innerWidth, u = window.innerHeight, d = window.innerWidth), (t || n) && e !== window && (i ||= e.parentNode, !Ba)) do
|
|
2331
|
+
if (i && i.getBoundingClientRect && (z(i, "transform") !== "none" || n && z(i, "position") !== "static")) {
|
|
2332
|
+
var f = i.getBoundingClientRect();
|
|
2333
|
+
o -= f.top + parseInt(z(i, "border-top-width")), s -= f.left + parseInt(z(i, "border-left-width")), c = o + a.height, l = s + a.width;
|
|
2334
|
+
break;
|
|
2335
|
+
}
|
|
2336
|
+
while (i = i.parentNode);
|
|
2337
|
+
if (r && e !== window) {
|
|
2338
|
+
var p = Qa(i || e), m = p && p.a, h = p && p.d;
|
|
2339
|
+
p && (o /= h, s /= m, d /= m, u /= h, c = o + u, l = s + d);
|
|
2340
|
+
}
|
|
2341
|
+
return {
|
|
2342
|
+
top: o,
|
|
2343
|
+
left: s,
|
|
2344
|
+
bottom: c,
|
|
2345
|
+
right: l,
|
|
2346
|
+
width: d,
|
|
2347
|
+
height: u
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
function to(e, t, n) {
|
|
2352
|
+
for (var r = so(e, !0), i = B(e)[t]; r;) {
|
|
2353
|
+
var a = B(r)[n], o = void 0;
|
|
2354
|
+
if (o = i >= a, !o) return r;
|
|
2355
|
+
if (r === eo()) break;
|
|
2356
|
+
r = so(r, !1);
|
|
2357
|
+
}
|
|
2358
|
+
return !1;
|
|
2359
|
+
}
|
|
2360
|
+
function no(e, t, n, r) {
|
|
2361
|
+
for (var i = 0, a = 0, o = e.children; a < o.length;) {
|
|
2362
|
+
if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) && Ya(o[a], n.draggable, e, !1)) {
|
|
2363
|
+
if (i === t) return o[a];
|
|
2364
|
+
i++;
|
|
2365
|
+
}
|
|
2366
|
+
a++;
|
|
2367
|
+
}
|
|
2368
|
+
return null;
|
|
2369
|
+
}
|
|
2370
|
+
function ro(e, t) {
|
|
2371
|
+
for (var n = e.lastElementChild; n && (n === Q.ghost || z(n, "display") === "none" || t && !qa(n, t));) n = n.previousElementSibling;
|
|
2372
|
+
return n || null;
|
|
2373
|
+
}
|
|
2374
|
+
function io(e, t) {
|
|
2375
|
+
var n = 0;
|
|
2376
|
+
if (!e || !e.parentNode) return -1;
|
|
2377
|
+
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t || qa(e, t)) && n++;
|
|
2378
|
+
return n;
|
|
2379
|
+
}
|
|
2380
|
+
function ao(e) {
|
|
2381
|
+
var t = 0, n = 0, r = eo();
|
|
2382
|
+
if (e) do {
|
|
2383
|
+
var i = Qa(e), a = i.a, o = i.d;
|
|
2384
|
+
t += e.scrollLeft * a, n += e.scrollTop * o;
|
|
2385
|
+
} while (e !== r && (e = e.parentNode));
|
|
2386
|
+
return [t, n];
|
|
2387
|
+
}
|
|
2388
|
+
function oo(e, t) {
|
|
2389
|
+
for (var n in e) if (e.hasOwnProperty(n)) {
|
|
2390
|
+
for (var r in t) if (t.hasOwnProperty(r) && t[r] === e[n][r]) return Number(n);
|
|
2391
|
+
}
|
|
2392
|
+
return -1;
|
|
2393
|
+
}
|
|
2394
|
+
function so(e, t) {
|
|
2395
|
+
if (!e || !e.getBoundingClientRect) return eo();
|
|
2396
|
+
var n = e, r = !1;
|
|
2397
|
+
do
|
|
2398
|
+
if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
|
|
2399
|
+
var i = z(n);
|
|
2400
|
+
if (n.clientWidth < n.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
|
|
2401
|
+
if (!n.getBoundingClientRect || n === document.body) return eo();
|
|
2402
|
+
if (r || t) return n;
|
|
2403
|
+
r = !0;
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
while (n = n.parentNode);
|
|
2407
|
+
return eo();
|
|
2408
|
+
}
|
|
2409
|
+
function co(e, t) {
|
|
2410
|
+
if (e && t) for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
|
|
2411
|
+
return e;
|
|
2412
|
+
}
|
|
2413
|
+
function lo(e, t) {
|
|
2414
|
+
return Math.round(e.top) === Math.round(t.top) && Math.round(e.left) === Math.round(t.left) && Math.round(e.height) === Math.round(t.height) && Math.round(e.width) === Math.round(t.width);
|
|
2415
|
+
}
|
|
2416
|
+
var uo;
|
|
2417
|
+
function fo(e, t) {
|
|
2418
|
+
return function() {
|
|
2419
|
+
if (!uo) {
|
|
2420
|
+
var n = arguments, r = this;
|
|
2421
|
+
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n), uo = setTimeout(function() {
|
|
2422
|
+
uo = void 0;
|
|
2423
|
+
}, t);
|
|
2424
|
+
}
|
|
2425
|
+
};
|
|
2426
|
+
}
|
|
2427
|
+
function po() {
|
|
2428
|
+
clearTimeout(uo), uo = void 0;
|
|
2429
|
+
}
|
|
2430
|
+
function mo(e, t, n) {
|
|
2431
|
+
e.scrollLeft += t, e.scrollTop += n;
|
|
2432
|
+
}
|
|
2433
|
+
function ho(e) {
|
|
2434
|
+
var t = window.Polymer, n = window.jQuery || window.Zepto;
|
|
2435
|
+
return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
|
|
2436
|
+
}
|
|
2437
|
+
function go(e, t, n) {
|
|
2438
|
+
var r = {};
|
|
2439
|
+
return Array.from(e.children).forEach(function(i) {
|
|
2440
|
+
if (Ya(i, t.draggable, e, !1) && !i.animated && i !== n) {
|
|
2441
|
+
var a = B(i);
|
|
2442
|
+
r.left = Math.min(r.left ?? 1 / 0, a.left), r.top = Math.min(r.top ?? 1 / 0, a.top), r.right = Math.max(r.right ?? -1 / 0, a.right), r.bottom = Math.max(r.bottom ?? -1 / 0, a.bottom);
|
|
2443
|
+
}
|
|
2444
|
+
}), r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
|
|
2445
|
+
}
|
|
2446
|
+
var V = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
2447
|
+
function _o() {
|
|
2448
|
+
var e = [], t;
|
|
2449
|
+
return {
|
|
2450
|
+
captureAnimationState: function() {
|
|
2451
|
+
e = [], this.options.animation && [].slice.call(this.el.children).forEach(function(t) {
|
|
2452
|
+
if (z(t, "display") !== "none" && t !== Q.ghost) {
|
|
2453
|
+
e.push({
|
|
2454
|
+
target: t,
|
|
2455
|
+
rect: B(t)
|
|
2456
|
+
});
|
|
2457
|
+
var n = Ma({}, e[e.length - 1].rect);
|
|
2458
|
+
if (t.thisAnimationDuration) {
|
|
2459
|
+
var r = Qa(t, !0);
|
|
2460
|
+
r && (n.top -= r.f, n.left -= r.e);
|
|
2461
|
+
}
|
|
2462
|
+
t.fromRect = n;
|
|
2463
|
+
}
|
|
2464
|
+
});
|
|
2465
|
+
},
|
|
2466
|
+
addAnimationState: function(t) {
|
|
2467
|
+
e.push(t);
|
|
2468
|
+
},
|
|
2469
|
+
removeAnimationState: function(t) {
|
|
2470
|
+
e.splice(oo(e, { target: t }), 1);
|
|
2471
|
+
},
|
|
2472
|
+
animateAll: function(n) {
|
|
2473
|
+
var r = this;
|
|
2474
|
+
if (!this.options.animation) {
|
|
2475
|
+
clearTimeout(t), typeof n == "function" && n();
|
|
2476
|
+
return;
|
|
2477
|
+
}
|
|
2478
|
+
var i = !1, a = 0;
|
|
2479
|
+
e.forEach(function(e) {
|
|
2480
|
+
var t = 0, n = e.target, o = n.fromRect, s = B(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = Qa(n, !0);
|
|
2481
|
+
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && lo(c, s) && !lo(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = yo(u, c, l, r.options)), lo(s, o) || (n.prevFromRect = o, n.prevToRect = s, t ||= r.options.animation, r.animate(n, u, s, t)), t && (i = !0, a = Math.max(a, t), clearTimeout(n.animationResetTimer), n.animationResetTimer = setTimeout(function() {
|
|
2482
|
+
n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null;
|
|
2483
|
+
}, t), n.thisAnimationDuration = t);
|
|
2484
|
+
}), clearTimeout(t), i ? t = setTimeout(function() {
|
|
2485
|
+
typeof n == "function" && n();
|
|
2486
|
+
}, a) : typeof n == "function" && n(), e = [];
|
|
2487
|
+
},
|
|
2488
|
+
animate: function(e, t, n, r) {
|
|
2489
|
+
if (r) {
|
|
2490
|
+
z(e, "transition", ""), z(e, "transform", "");
|
|
2491
|
+
var i = Qa(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1);
|
|
2492
|
+
e.animatingX = !!s, e.animatingY = !!c, z(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = vo(e), z(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), z(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() {
|
|
2493
|
+
z(e, "transition", ""), z(e, "transform", ""), e.animated = !1, e.animatingX = !1, e.animatingY = !1;
|
|
2494
|
+
}, r);
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
};
|
|
2498
|
+
}
|
|
2499
|
+
function vo(e) {
|
|
2500
|
+
return e.offsetWidth;
|
|
2501
|
+
}
|
|
2502
|
+
function yo(e, t, n, r) {
|
|
2503
|
+
return Math.sqrt((t.top - e.top) ** 2 + (t.left - e.left) ** 2) / Math.sqrt((t.top - n.top) ** 2 + (t.left - n.left) ** 2) * r.animation;
|
|
2504
|
+
}
|
|
2505
|
+
var bo = [], xo = { initializeByDefault: !0 }, So = {
|
|
2506
|
+
mount: function(e) {
|
|
2507
|
+
for (var t in xo) xo.hasOwnProperty(t) && !(t in e) && (e[t] = xo[t]);
|
|
2508
|
+
bo.forEach(function(t) {
|
|
2509
|
+
if (t.pluginName === e.pluginName) throw `Sortable: Cannot mount plugin ${e.pluginName} more than once`;
|
|
2510
|
+
}), bo.push(e);
|
|
2511
|
+
},
|
|
2512
|
+
pluginEvent: function(e, t, n) {
|
|
2513
|
+
var r = this;
|
|
2514
|
+
this.eventCanceled = !1, n.cancel = function() {
|
|
2515
|
+
r.eventCanceled = !0;
|
|
2516
|
+
};
|
|
2517
|
+
var i = e + "Global";
|
|
2518
|
+
bo.forEach(function(r) {
|
|
2519
|
+
t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](Ma({ sortable: t }, n)), t.options[r.pluginName] && t[r.pluginName][e] && t[r.pluginName][e](Ma({ sortable: t }, n)));
|
|
2520
|
+
});
|
|
2521
|
+
},
|
|
2522
|
+
initializePlugins: function(e, t, n, r) {
|
|
2523
|
+
for (var i in bo.forEach(function(r) {
|
|
2524
|
+
var i = r.pluginName;
|
|
2525
|
+
if (e.options[i] || r.initializeByDefault) {
|
|
2526
|
+
var a = new r(e, t, e.options);
|
|
2527
|
+
a.sortable = e, a.options = e.options, e[i] = a, Fa(n, a.defaults);
|
|
2528
|
+
}
|
|
2529
|
+
}), e.options) if (e.options.hasOwnProperty(i)) {
|
|
2530
|
+
var a = this.modifyOption(e, i, e.options[i]);
|
|
2531
|
+
a !== void 0 && (e.options[i] = a);
|
|
2532
|
+
}
|
|
2533
|
+
},
|
|
2534
|
+
getEventProperties: function(e, t) {
|
|
2535
|
+
var n = {};
|
|
2536
|
+
return bo.forEach(function(r) {
|
|
2537
|
+
typeof r.eventProperties == "function" && Fa(n, r.eventProperties.call(t[r.pluginName], e));
|
|
2538
|
+
}), n;
|
|
2539
|
+
},
|
|
2540
|
+
modifyOption: function(e, t, n) {
|
|
2541
|
+
var r;
|
|
2542
|
+
return bo.forEach(function(i) {
|
|
2543
|
+
e[i.pluginName] && i.optionListeners && typeof i.optionListeners[t] == "function" && (r = i.optionListeners[t].call(e[i.pluginName], n));
|
|
2544
|
+
}), r;
|
|
2545
|
+
}
|
|
2546
|
+
};
|
|
2547
|
+
function Co(e) {
|
|
2548
|
+
var t = e.sortable, n = e.rootEl, r = e.name, i = e.targetEl, a = e.cloneEl, o = e.toEl, s = e.fromEl, c = e.oldIndex, l = e.newIndex, u = e.oldDraggableIndex, d = e.newDraggableIndex, f = e.originalEvent, p = e.putSortable, m = e.extraEventProperties;
|
|
2549
|
+
if (t ||= n && n[V], t) {
|
|
2550
|
+
var h, g = t.options, _ = "on" + r.charAt(0).toUpperCase() + r.substr(1);
|
|
2551
|
+
window.CustomEvent && !Ba && !Va ? h = new CustomEvent(r, {
|
|
2552
|
+
bubbles: !0,
|
|
2553
|
+
cancelable: !0
|
|
2554
|
+
}) : (h = document.createEvent("Event"), h.initEvent(r, !0, !0)), h.to = o || n, h.from = s || n, h.item = i || n, h.clone = a, h.oldIndex = c, h.newIndex = l, h.oldDraggableIndex = u, h.newDraggableIndex = d, h.originalEvent = f, h.pullMode = p ? p.lastPutMode : void 0;
|
|
2555
|
+
var v = Ma(Ma({}, m), So.getEventProperties(r, t));
|
|
2556
|
+
for (var y in v) h[y] = v[y];
|
|
2557
|
+
n && n.dispatchEvent(h), g[_] && g[_].call(t, h);
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
var wo = ["evt"], H = function(e, t) {
|
|
2561
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = La(n, wo);
|
|
2562
|
+
So.pluginEvent.bind(Q)(e, t, Ma({
|
|
2563
|
+
dragEl: W,
|
|
2564
|
+
parentEl: G,
|
|
2565
|
+
ghostEl: K,
|
|
2566
|
+
rootEl: q,
|
|
2567
|
+
nextEl: To,
|
|
2568
|
+
lastDownEl: Eo,
|
|
2569
|
+
cloneEl: J,
|
|
2570
|
+
cloneHidden: Do,
|
|
2571
|
+
dragStarted: Vo,
|
|
2572
|
+
putSortable: X,
|
|
2573
|
+
activeSortable: Q.active,
|
|
2574
|
+
originalEvent: r,
|
|
2575
|
+
oldIndex: Oo,
|
|
2576
|
+
oldDraggableIndex: ko,
|
|
2577
|
+
newIndex: Y,
|
|
2578
|
+
newDraggableIndex: Ao,
|
|
2579
|
+
hideGhostForTarget: as,
|
|
2580
|
+
unhideGhostForTarget: os,
|
|
2581
|
+
cloneNowHidden: function() {
|
|
2582
|
+
Do = !0;
|
|
2583
|
+
},
|
|
2584
|
+
cloneNowShown: function() {
|
|
2585
|
+
Do = !1;
|
|
2586
|
+
},
|
|
2587
|
+
dispatchSortableEvent: function(e) {
|
|
2588
|
+
U({
|
|
2589
|
+
sortable: t,
|
|
2590
|
+
name: e,
|
|
2591
|
+
originalEvent: r
|
|
2592
|
+
});
|
|
2593
|
+
}
|
|
2594
|
+
}, i));
|
|
2595
|
+
};
|
|
2596
|
+
function U(e) {
|
|
2597
|
+
Co(Ma({
|
|
2598
|
+
putSortable: X,
|
|
2599
|
+
cloneEl: J,
|
|
2600
|
+
targetEl: W,
|
|
2601
|
+
rootEl: q,
|
|
2602
|
+
oldIndex: Oo,
|
|
2603
|
+
oldDraggableIndex: ko,
|
|
2604
|
+
newIndex: Y,
|
|
2605
|
+
newDraggableIndex: Ao
|
|
2606
|
+
}, e));
|
|
2607
|
+
}
|
|
2608
|
+
var W, G, K, q, To, Eo, J, Do, Oo, Y, ko, Ao, jo, X, Mo = !1, No = !1, Po = [], Fo, Io, Lo, Ro, zo, Bo, Vo, Ho, Uo, Wo = !1, Go = !1, Ko, Z, qo = [], Jo = !1, Yo = [], Xo = typeof document < "u", Zo = Wa, Qo = Va || Ba ? "cssFloat" : "float", $o = Xo && !Ga && !Wa && "draggable" in document.createElement("div"), es = function() {
|
|
2609
|
+
if (Xo) {
|
|
2610
|
+
if (Ba) return !1;
|
|
2611
|
+
var e = document.createElement("x");
|
|
2612
|
+
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
2613
|
+
}
|
|
2614
|
+
}(), ts = function(e, t) {
|
|
2615
|
+
var n = z(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = no(e, 0, t), a = no(e, 1, t), o = i && z(i), s = a && z(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + B(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + B(a).width;
|
|
2616
|
+
if (n.display === "flex") return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
2617
|
+
if (n.display === "grid") return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
2618
|
+
if (i && o.float && o.float !== "none") {
|
|
2619
|
+
var u = o.float === "left" ? "left" : "right";
|
|
2620
|
+
return a && (s.clear === "both" || s.clear === u) ? "vertical" : "horizontal";
|
|
2621
|
+
}
|
|
2622
|
+
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[Qo] === "none" || a && n[Qo] === "none" && c + l > r) ? "vertical" : "horizontal";
|
|
2623
|
+
}, ns = function(e, t, n) {
|
|
2624
|
+
var r = n ? e.left : e.top, i = n ? e.right : e.bottom, a = n ? e.width : e.height, o = n ? t.left : t.top, s = n ? t.right : t.bottom, c = n ? t.width : t.height;
|
|
2625
|
+
return r === o || i === s || r + a / 2 === o + c / 2;
|
|
2626
|
+
}, rs = function(e, t) {
|
|
2627
|
+
var n;
|
|
2628
|
+
return Po.some(function(r) {
|
|
2629
|
+
var i = r[V].options.emptyInsertThreshold;
|
|
2630
|
+
if (i && !ro(r)) {
|
|
2631
|
+
var a = B(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i;
|
|
2632
|
+
if (o && s) return n = r;
|
|
2633
|
+
}
|
|
2634
|
+
}), n;
|
|
2635
|
+
}, is = function(e) {
|
|
2636
|
+
function t(e, n) {
|
|
2637
|
+
return function(r, i, a, o) {
|
|
2638
|
+
var s = r.options.group.name && i.options.group.name && r.options.group.name === i.options.group.name;
|
|
2639
|
+
if (e == null && (n || s)) return !0;
|
|
2640
|
+
if (e == null || e === !1) return !1;
|
|
2641
|
+
if (n && e === "clone") return e;
|
|
2642
|
+
if (typeof e == "function") return t(e(r, i, a, o), n)(r, i, a, o);
|
|
2643
|
+
var c = (n ? r : i).options.group.name;
|
|
2644
|
+
return e === !0 || typeof e == "string" && e === c || e.join && e.indexOf(c) > -1;
|
|
2645
|
+
};
|
|
2646
|
+
}
|
|
2647
|
+
var n = {}, r = e.group;
|
|
2648
|
+
(!r || Na(r) != "object") && (r = { name: r }), n.name = r.name, n.checkPull = t(r.pull, !0), n.checkPut = t(r.put), n.revertClone = r.revertClone, e.group = n;
|
|
2649
|
+
}, as = function() {
|
|
2650
|
+
!es && K && z(K, "display", "none");
|
|
2651
|
+
}, os = function() {
|
|
2652
|
+
!es && K && z(K, "display", "");
|
|
2653
|
+
};
|
|
2654
|
+
Xo && !Ga && document.addEventListener("click", function(e) {
|
|
2655
|
+
if (No) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), No = !1, !1;
|
|
2656
|
+
}, !0);
|
|
2657
|
+
var ss = function(e) {
|
|
2658
|
+
if (W) {
|
|
2659
|
+
e = e.touches ? e.touches[0] : e;
|
|
2660
|
+
var t = rs(e.clientX, e.clientY);
|
|
2661
|
+
if (t) {
|
|
2662
|
+
var n = {};
|
|
2663
|
+
for (var r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
|
|
2664
|
+
n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[V]._onDragOver(n);
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
}, cs = function(e) {
|
|
2668
|
+
W && W.parentNode[V]._isOutsideThisEl(e.target);
|
|
2669
|
+
};
|
|
2670
|
+
function Q(e, t) {
|
|
2671
|
+
if (!(e && e.nodeType && e.nodeType === 1)) throw `Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;
|
|
2672
|
+
this.el = e, this.options = t = Fa({}, t), e[V] = this;
|
|
2673
|
+
var n = {
|
|
2674
|
+
group: null,
|
|
2675
|
+
sort: !0,
|
|
2676
|
+
disabled: !1,
|
|
2677
|
+
store: null,
|
|
2678
|
+
handle: null,
|
|
2679
|
+
draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
|
|
2680
|
+
swapThreshold: 1,
|
|
2681
|
+
invertSwap: !1,
|
|
2682
|
+
invertedSwapThreshold: null,
|
|
2683
|
+
removeCloneOnHide: !0,
|
|
2684
|
+
direction: function() {
|
|
2685
|
+
return ts(e, this.options);
|
|
2686
|
+
},
|
|
2687
|
+
ghostClass: "sortable-ghost",
|
|
2688
|
+
chosenClass: "sortable-chosen",
|
|
2689
|
+
dragClass: "sortable-drag",
|
|
2690
|
+
ignore: "a, img",
|
|
2691
|
+
filter: null,
|
|
2692
|
+
preventOnFilter: !0,
|
|
2693
|
+
animation: 0,
|
|
2694
|
+
easing: null,
|
|
2695
|
+
setData: function(e, t) {
|
|
2696
|
+
e.setData("Text", t.textContent);
|
|
2697
|
+
},
|
|
2698
|
+
dropBubble: !1,
|
|
2699
|
+
dragoverBubble: !1,
|
|
2700
|
+
dataIdAttr: "data-id",
|
|
2701
|
+
delay: 0,
|
|
2702
|
+
delayOnTouchOnly: !1,
|
|
2703
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
2704
|
+
forceFallback: !1,
|
|
2705
|
+
fallbackClass: "sortable-fallback",
|
|
2706
|
+
fallbackOnBody: !1,
|
|
2707
|
+
fallbackTolerance: 0,
|
|
2708
|
+
fallbackOffset: {
|
|
2709
|
+
x: 0,
|
|
2710
|
+
y: 0
|
|
2711
|
+
},
|
|
2712
|
+
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && !Ua,
|
|
2713
|
+
emptyInsertThreshold: 5
|
|
2714
|
+
};
|
|
2715
|
+
for (var r in So.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]);
|
|
2716
|
+
for (var i in is(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
2717
|
+
this.nativeDraggable = !t.forceFallback && $o, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? L(e, "pointerdown", this._onTapStart) : (L(e, "mousedown", this._onTapStart), L(e, "touchstart", this._onTapStart)), this.nativeDraggable && (L(e, "dragover", this), L(e, "dragenter", this)), Po.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), Fa(this, _o());
|
|
2718
|
+
}
|
|
2719
|
+
Q.prototype = {
|
|
2720
|
+
constructor: Q,
|
|
2721
|
+
_isOutsideThisEl: function(e) {
|
|
2722
|
+
!this.el.contains(e) && e !== this.el && (Ho = null);
|
|
2723
|
+
},
|
|
2724
|
+
_getDirection: function(e, t) {
|
|
2725
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, W) : this.options.direction;
|
|
2726
|
+
},
|
|
2727
|
+
_onTapStart: function(e) {
|
|
2728
|
+
if (e.cancelable) {
|
|
2729
|
+
var t = this, n = this.el, r = this.options, i = r.preventOnFilter, a = e.type, o = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (o || e).target, c = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, l = r.filter;
|
|
2730
|
+
if (vs(n), !W && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && Ua && s && s.tagName.toUpperCase() === "SELECT") && (s = Ya(s, r.draggable, n, !1), !(s && s.animated) && Eo !== s)) {
|
|
2731
|
+
if (Oo = io(s), ko = io(s, r.draggable), typeof l == "function") {
|
|
2732
|
+
if (l.call(this, e, s, this)) {
|
|
2733
|
+
U({
|
|
2734
|
+
sortable: t,
|
|
2735
|
+
rootEl: c,
|
|
2736
|
+
name: "filter",
|
|
2737
|
+
targetEl: s,
|
|
2738
|
+
toEl: n,
|
|
2739
|
+
fromEl: n
|
|
2740
|
+
}), H("filter", t, { evt: e }), i && e.cancelable && e.preventDefault();
|
|
2741
|
+
return;
|
|
2742
|
+
}
|
|
2743
|
+
} else if (l && (l = l.split(",").some(function(r) {
|
|
2744
|
+
if (r = Ya(c, r.trim(), n, !1), r) return U({
|
|
2745
|
+
sortable: t,
|
|
2746
|
+
rootEl: r,
|
|
2747
|
+
name: "filter",
|
|
2748
|
+
targetEl: s,
|
|
2749
|
+
fromEl: n,
|
|
2750
|
+
toEl: n
|
|
2751
|
+
}), H("filter", t, { evt: e }), !0;
|
|
2752
|
+
}), l)) {
|
|
2753
|
+
i && e.cancelable && e.preventDefault();
|
|
2754
|
+
return;
|
|
2755
|
+
}
|
|
2756
|
+
r.handle && !Ya(c, r.handle, n, !1) || this._prepareDragStart(e, o, s);
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
2759
|
+
},
|
|
2760
|
+
_prepareDragStart: function(e, t, n) {
|
|
2761
|
+
var r = this, i = r.el, a = r.options, o = i.ownerDocument, s;
|
|
2762
|
+
if (n && !W && n.parentNode === i) {
|
|
2763
|
+
var c = B(n);
|
|
2764
|
+
if (q = i, W = n, G = W.parentNode, To = W.nextSibling, Eo = n, jo = a.group, Q.dragged = W, Fo = {
|
|
2765
|
+
target: W,
|
|
2766
|
+
clientX: (t || e).clientX,
|
|
2767
|
+
clientY: (t || e).clientY
|
|
2768
|
+
}, zo = Fo.clientX - c.left, Bo = Fo.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, W.style["will-change"] = "all", s = function() {
|
|
2769
|
+
if (H("delayEnded", r, { evt: e }), Q.eventCanceled) {
|
|
2770
|
+
r._onDrop();
|
|
2771
|
+
return;
|
|
2772
|
+
}
|
|
2773
|
+
r._disableDelayedDragEvents(), !Ha && r.nativeDraggable && (W.draggable = !0), r._triggerDragStart(e, t), U({
|
|
2774
|
+
sortable: r,
|
|
2775
|
+
name: "choose",
|
|
2776
|
+
originalEvent: e
|
|
2777
|
+
}), Za(W, a.chosenClass, !0);
|
|
2778
|
+
}, a.ignore.split(",").forEach(function(e) {
|
|
2779
|
+
$a(W, e.trim(), ds);
|
|
2780
|
+
}), L(o, "dragover", ss), L(o, "mousemove", ss), L(o, "touchmove", ss), L(o, "mouseup", r._onDrop), L(o, "touchend", r._onDrop), L(o, "touchcancel", r._onDrop), Ha && this.nativeDraggable && (this.options.touchStartThreshold = 4, W.draggable = !0), H("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(Va || Ba))) {
|
|
2781
|
+
if (Q.eventCanceled) {
|
|
2782
|
+
this._onDrop();
|
|
2783
|
+
return;
|
|
2784
|
+
}
|
|
2785
|
+
L(o, "mouseup", r._disableDelayedDrag), L(o, "touchend", r._disableDelayedDrag), L(o, "touchcancel", r._disableDelayedDrag), L(o, "mousemove", r._delayedDragTouchMoveHandler), L(o, "touchmove", r._delayedDragTouchMoveHandler), a.supportPointer && L(o, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, a.delay);
|
|
2786
|
+
} else s();
|
|
2787
|
+
}
|
|
2788
|
+
},
|
|
2789
|
+
_delayedDragTouchMoveHandler: function(e) {
|
|
2790
|
+
var t = e.touches ? e.touches[0] : e;
|
|
2791
|
+
Math.max(Math.abs(t.clientX - this._lastX), Math.abs(t.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
|
|
2792
|
+
},
|
|
2793
|
+
_disableDelayedDrag: function() {
|
|
2794
|
+
W && ds(W), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
2795
|
+
},
|
|
2796
|
+
_disableDelayedDragEvents: function() {
|
|
2797
|
+
var e = this.el.ownerDocument;
|
|
2798
|
+
R(e, "mouseup", this._disableDelayedDrag), R(e, "touchend", this._disableDelayedDrag), R(e, "touchcancel", this._disableDelayedDrag), R(e, "mousemove", this._delayedDragTouchMoveHandler), R(e, "touchmove", this._delayedDragTouchMoveHandler), R(e, "pointermove", this._delayedDragTouchMoveHandler);
|
|
2799
|
+
},
|
|
2800
|
+
_triggerDragStart: function(e, t) {
|
|
2801
|
+
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? L(document, "pointermove", this._onTouchMove) : t ? L(document, "touchmove", this._onTouchMove) : L(document, "mousemove", this._onTouchMove) : (L(W, "dragend", this), L(q, "dragstart", this._onDragStart));
|
|
2802
|
+
try {
|
|
2803
|
+
document.selection ? ys(function() {
|
|
2804
|
+
document.selection.empty();
|
|
2805
|
+
}) : window.getSelection().removeAllRanges();
|
|
2806
|
+
} catch {}
|
|
2807
|
+
},
|
|
2808
|
+
_dragStarted: function(e, t) {
|
|
2809
|
+
if (Mo = !1, q && W) {
|
|
2810
|
+
H("dragStarted", this, { evt: t }), this.nativeDraggable && L(document, "dragover", cs);
|
|
2811
|
+
var n = this.options;
|
|
2812
|
+
!e && Za(W, n.dragClass, !1), Za(W, n.ghostClass, !0), Q.active = this, e && this._appendGhost(), U({
|
|
2813
|
+
sortable: this,
|
|
2814
|
+
name: "start",
|
|
2815
|
+
originalEvent: t
|
|
2816
|
+
});
|
|
2817
|
+
} else this._nulling();
|
|
2818
|
+
},
|
|
2819
|
+
_emulateDragOver: function() {
|
|
2820
|
+
if (Io) {
|
|
2821
|
+
this._lastX = Io.clientX, this._lastY = Io.clientY, as();
|
|
2822
|
+
for (var e = document.elementFromPoint(Io.clientX, Io.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(Io.clientX, Io.clientY), e !== t);) t = e;
|
|
2823
|
+
if (W.parentNode[V]._isOutsideThisEl(e), t) do {
|
|
2824
|
+
if (t[V]) {
|
|
2825
|
+
var n = void 0;
|
|
2826
|
+
if (n = t[V]._onDragOver({
|
|
2827
|
+
clientX: Io.clientX,
|
|
2828
|
+
clientY: Io.clientY,
|
|
2829
|
+
target: e,
|
|
2830
|
+
rootEl: t
|
|
2831
|
+
}), n && !this.options.dragoverBubble) break;
|
|
2832
|
+
}
|
|
2833
|
+
e = t;
|
|
2834
|
+
} while (t = t.parentNode);
|
|
2835
|
+
os();
|
|
2836
|
+
}
|
|
2837
|
+
},
|
|
2838
|
+
_onTouchMove: function(e) {
|
|
2839
|
+
if (Fo) {
|
|
2840
|
+
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = K && Qa(K, !0), o = K && a && a.a, s = K && a && a.d, c = Zo && Z && ao(Z), l = (i.clientX - Fo.clientX + r.x) / (o || 1) + (c ? c[0] - qo[0] : 0) / (o || 1), u = (i.clientY - Fo.clientY + r.y) / (s || 1) + (c ? c[1] - qo[1] : 0) / (s || 1);
|
|
2841
|
+
if (!Q.active && !Mo) {
|
|
2842
|
+
if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) return;
|
|
2843
|
+
this._onDragStart(e, !0);
|
|
2844
|
+
}
|
|
2845
|
+
if (K) {
|
|
2846
|
+
a ? (a.e += l - (Lo || 0), a.f += u - (Ro || 0)) : a = {
|
|
2847
|
+
a: 1,
|
|
2848
|
+
b: 0,
|
|
2849
|
+
c: 0,
|
|
2850
|
+
d: 1,
|
|
2851
|
+
e: l,
|
|
2852
|
+
f: u
|
|
2853
|
+
};
|
|
2854
|
+
var d = `matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;
|
|
2855
|
+
z(K, "webkitTransform", d), z(K, "mozTransform", d), z(K, "msTransform", d), z(K, "transform", d), Lo = l, Ro = u, Io = i;
|
|
2856
|
+
}
|
|
2857
|
+
e.cancelable && e.preventDefault();
|
|
2858
|
+
}
|
|
2859
|
+
},
|
|
2860
|
+
_appendGhost: function() {
|
|
2861
|
+
if (!K) {
|
|
2862
|
+
var e = this.options.fallbackOnBody ? document.body : q, t = B(W, !0, Zo, !0, e), n = this.options;
|
|
2863
|
+
if (Zo) {
|
|
2864
|
+
for (Z = e; z(Z, "position") === "static" && z(Z, "transform") === "none" && Z !== document;) Z = Z.parentNode;
|
|
2865
|
+
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z = eo()), t.top += Z.scrollTop, t.left += Z.scrollLeft) : Z = eo(), qo = ao(Z);
|
|
2866
|
+
}
|
|
2867
|
+
K = W.cloneNode(!0), Za(K, n.ghostClass, !1), Za(K, n.fallbackClass, !0), Za(K, n.dragClass, !0), z(K, "transition", ""), z(K, "transform", ""), z(K, "box-sizing", "border-box"), z(K, "margin", 0), z(K, "top", t.top), z(K, "left", t.left), z(K, "width", t.width), z(K, "height", t.height), z(K, "opacity", "0.8"), z(K, "position", Zo ? "absolute" : "fixed"), z(K, "zIndex", "100000"), z(K, "pointerEvents", "none"), Q.ghost = K, e.appendChild(K), z(K, "transform-origin", zo / parseInt(K.style.width) * 100 + "% " + Bo / parseInt(K.style.height) * 100 + "%");
|
|
2868
|
+
}
|
|
2869
|
+
},
|
|
2870
|
+
_onDragStart: function(e, t) {
|
|
2871
|
+
var n = this, r = e.dataTransfer, i = n.options;
|
|
2872
|
+
if (H("dragStart", this, { evt: e }), Q.eventCanceled) {
|
|
2873
|
+
this._onDrop();
|
|
2874
|
+
return;
|
|
2875
|
+
}
|
|
2876
|
+
H("setupClone", this), Q.eventCanceled || (J = ho(W), J.removeAttribute("id"), J.draggable = !1, J.style["will-change"] = "", this._hideClone(), Za(J, this.options.chosenClass, !1), Q.clone = J), n.cloneId = ys(function() {
|
|
2877
|
+
H("clone", n), !Q.eventCanceled && (n.options.removeCloneOnHide || q.insertBefore(J, W), n._hideClone(), U({
|
|
2878
|
+
sortable: n,
|
|
2879
|
+
name: "clone"
|
|
2880
|
+
}));
|
|
2881
|
+
}), !t && Za(W, i.dragClass, !0), t ? (No = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (R(document, "mouseup", n._onDrop), R(document, "touchend", n._onDrop), R(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, W)), L(document, "drop", n), z(W, "transform", "translateZ(0)")), Mo = !0, n._dragStartId = ys(n._dragStarted.bind(n, t, e)), L(document, "selectstart", n), Vo = !0, Ua && z(document.body, "user-select", "none");
|
|
2882
|
+
},
|
|
2883
|
+
_onDragOver: function(e) {
|
|
2884
|
+
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l = jo === s, u = o.sort, d = X || c, f, p = this, m = !1;
|
|
2885
|
+
if (Jo) return;
|
|
2886
|
+
function h(o, s) {
|
|
2887
|
+
H(o, p, Ma({
|
|
2888
|
+
evt: e,
|
|
2889
|
+
isOwner: l,
|
|
2890
|
+
axis: f ? "vertical" : "horizontal",
|
|
2891
|
+
revert: a,
|
|
2892
|
+
dragRect: r,
|
|
2893
|
+
targetRect: i,
|
|
2894
|
+
canSort: u,
|
|
2895
|
+
fromSortable: d,
|
|
2896
|
+
target: n,
|
|
2897
|
+
completed: _,
|
|
2898
|
+
onMove: function(n, i) {
|
|
2899
|
+
return us(q, t, W, r, n, B(n), e, i);
|
|
2900
|
+
},
|
|
2901
|
+
changed: v
|
|
2902
|
+
}, s));
|
|
2903
|
+
}
|
|
2904
|
+
function g() {
|
|
2905
|
+
h("dragOverAnimationCapture"), p.captureAnimationState(), p !== d && d.captureAnimationState();
|
|
2906
|
+
}
|
|
2907
|
+
function _(r) {
|
|
2908
|
+
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (Za(W, X ? X.options.ghostClass : c.options.ghostClass, !1), Za(W, o.ghostClass, !0)), X !== p && p !== Q.active ? X = p : p === Q.active && X && (X = null), d === p && (p._ignoreWhileAnimating = n), p.animateAll(function() {
|
|
2909
|
+
h("dragOverAnimationComplete"), p._ignoreWhileAnimating = null;
|
|
2910
|
+
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === W && !W.animated || n === t && !n.animated) && (Ho = null), !o.dragoverBubble && !e.rootEl && n !== document && (W.parentNode[V]._isOutsideThisEl(e.target), !r && ss(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0;
|
|
2911
|
+
}
|
|
2912
|
+
function v() {
|
|
2913
|
+
Y = io(W), Ao = io(W, o.draggable), U({
|
|
2914
|
+
sortable: p,
|
|
2915
|
+
name: "change",
|
|
2916
|
+
toEl: t,
|
|
2917
|
+
newIndex: Y,
|
|
2918
|
+
newDraggableIndex: Ao,
|
|
2919
|
+
originalEvent: e
|
|
2920
|
+
});
|
|
2921
|
+
}
|
|
2922
|
+
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = Ya(n, o.draggable, t, !0), h("dragOver"), Q.eventCanceled) return m;
|
|
2923
|
+
if (W.contains(e.target) || n.animated && n.animatingX && n.animatingY || p._ignoreWhileAnimating === n) return _(!1);
|
|
2924
|
+
if (No = !1, c && !o.disabled && (l ? u || (a = G !== q) : X === this || (this.lastPutMode = jo.checkPull(this, c, W, e)) && s.checkPut(this, c, W, e))) {
|
|
2925
|
+
if (f = this._getDirection(e, n) === "vertical", r = B(W), h("dragOverValid"), Q.eventCanceled) return m;
|
|
2926
|
+
if (a) return G = q, g(), this._hideClone(), h("revert"), Q.eventCanceled || (To ? q.insertBefore(W, To) : q.appendChild(W)), _(!0);
|
|
2927
|
+
var y = ro(t, o.draggable);
|
|
2928
|
+
if (!y || ms(e, f, this) && !y.animated) {
|
|
2929
|
+
if (y === W) return _(!1);
|
|
2930
|
+
if (y && t === e.target && (n = y), n && (i = B(n)), us(q, t, W, r, n, i, e, !!n) !== !1) return g(), y && y.nextSibling ? t.insertBefore(W, y.nextSibling) : t.appendChild(W), G = t, v(), _(!0);
|
|
2931
|
+
} else if (y && ps(e, f, this)) {
|
|
2932
|
+
var b = no(t, 0, o, !0);
|
|
2933
|
+
if (b === W) return _(!1);
|
|
2934
|
+
if (n = b, i = B(n), us(q, t, W, r, n, i, e, !1) !== !1) return g(), t.insertBefore(W, b), G = t, v(), _(!0);
|
|
2935
|
+
} else if (n.parentNode === t) {
|
|
2936
|
+
i = B(n);
|
|
2937
|
+
var x = 0, S, C = W.parentNode !== t, w = !ns(W.animated && W.toRect || r, n.animated && n.toRect || i, f), T = f ? "top" : "left", E = to(n, "top", "top") || to(W, "top", "top"), D = E ? E.scrollTop : void 0;
|
|
2938
|
+
Ho !== n && (S = i[T], Wo = !1, Go = !w && o.invertSwap || C), x = hs(e, n, i, f, w ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, Go, Ho === n);
|
|
2939
|
+
var O;
|
|
2940
|
+
if (x !== 0) {
|
|
2941
|
+
var k = io(W);
|
|
2942
|
+
do
|
|
2943
|
+
k -= x, O = G.children[k];
|
|
2944
|
+
while (O && (z(O, "display") === "none" || O === K));
|
|
2945
|
+
}
|
|
2946
|
+
if (x === 0 || O === n) return _(!1);
|
|
2947
|
+
Ho = n, Uo = x;
|
|
2948
|
+
var A = n.nextElementSibling, j = !1;
|
|
2949
|
+
j = x === 1;
|
|
2950
|
+
var M = us(q, t, W, r, n, i, e, j);
|
|
2951
|
+
if (M !== !1) return (M === 1 || M === -1) && (j = M === 1), Jo = !0, setTimeout(fs, 30), g(), j && !A ? t.appendChild(W) : n.parentNode.insertBefore(W, j ? A : n), E && mo(E, 0, D - E.scrollTop), G = W.parentNode, S !== void 0 && !Go && (Ko = Math.abs(S - B(n)[T])), v(), _(!0);
|
|
2952
|
+
}
|
|
2953
|
+
if (t.contains(W)) return _(!1);
|
|
2954
|
+
}
|
|
2955
|
+
return !1;
|
|
2956
|
+
},
|
|
2957
|
+
_ignoreWhileAnimating: null,
|
|
2958
|
+
_offMoveEvents: function() {
|
|
2959
|
+
R(document, "mousemove", this._onTouchMove), R(document, "touchmove", this._onTouchMove), R(document, "pointermove", this._onTouchMove), R(document, "dragover", ss), R(document, "mousemove", ss), R(document, "touchmove", ss);
|
|
2960
|
+
},
|
|
2961
|
+
_offUpEvents: function() {
|
|
2962
|
+
var e = this.el.ownerDocument;
|
|
2963
|
+
R(e, "mouseup", this._onDrop), R(e, "touchend", this._onDrop), R(e, "pointerup", this._onDrop), R(e, "touchcancel", this._onDrop), R(document, "selectstart", this);
|
|
2964
|
+
},
|
|
2965
|
+
_onDrop: function(e) {
|
|
2966
|
+
var t = this.el, n = this.options;
|
|
2967
|
+
if (Y = io(W), Ao = io(W, n.draggable), H("drop", this, { evt: e }), G = W && W.parentNode, Y = io(W), Ao = io(W, n.draggable), Q.eventCanceled) {
|
|
2968
|
+
this._nulling();
|
|
2969
|
+
return;
|
|
2970
|
+
}
|
|
2971
|
+
Mo = !1, Go = !1, Wo = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), bs(this.cloneId), bs(this._dragStartId), this.nativeDraggable && (R(document, "drop", this), R(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Ua && z(document.body, "user-select", ""), z(W, "transform", ""), e && (Vo && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), K && K.parentNode && K.parentNode.removeChild(K), (q === G || X && X.lastPutMode !== "clone") && J && J.parentNode && J.parentNode.removeChild(J), W && (this.nativeDraggable && R(W, "dragend", this), ds(W), W.style["will-change"] = "", Vo && !Mo && Za(W, X ? X.options.ghostClass : this.options.ghostClass, !1), Za(W, this.options.chosenClass, !1), U({
|
|
2972
|
+
sortable: this,
|
|
2973
|
+
name: "unchoose",
|
|
2974
|
+
toEl: G,
|
|
2975
|
+
newIndex: null,
|
|
2976
|
+
newDraggableIndex: null,
|
|
2977
|
+
originalEvent: e
|
|
2978
|
+
}), q === G ? Y !== Oo && Y >= 0 && (U({
|
|
2979
|
+
sortable: this,
|
|
2980
|
+
name: "update",
|
|
2981
|
+
toEl: G,
|
|
2982
|
+
originalEvent: e
|
|
2983
|
+
}), U({
|
|
2984
|
+
sortable: this,
|
|
2985
|
+
name: "sort",
|
|
2986
|
+
toEl: G,
|
|
2987
|
+
originalEvent: e
|
|
2988
|
+
})) : (Y >= 0 && (U({
|
|
2989
|
+
rootEl: G,
|
|
2990
|
+
name: "add",
|
|
2991
|
+
toEl: G,
|
|
2992
|
+
fromEl: q,
|
|
2993
|
+
originalEvent: e
|
|
2994
|
+
}), U({
|
|
2995
|
+
sortable: this,
|
|
2996
|
+
name: "remove",
|
|
2997
|
+
toEl: G,
|
|
2998
|
+
originalEvent: e
|
|
2999
|
+
}), U({
|
|
3000
|
+
rootEl: G,
|
|
3001
|
+
name: "sort",
|
|
3002
|
+
toEl: G,
|
|
3003
|
+
fromEl: q,
|
|
3004
|
+
originalEvent: e
|
|
3005
|
+
}), U({
|
|
3006
|
+
sortable: this,
|
|
3007
|
+
name: "sort",
|
|
3008
|
+
toEl: G,
|
|
3009
|
+
originalEvent: e
|
|
3010
|
+
})), X && X.save()), Q.active && ((Y == null || Y === -1) && (Y = Oo, Ao = ko), U({
|
|
3011
|
+
sortable: this,
|
|
3012
|
+
name: "end",
|
|
3013
|
+
toEl: G,
|
|
3014
|
+
originalEvent: e
|
|
3015
|
+
}), this.save()))), this._nulling();
|
|
3016
|
+
},
|
|
3017
|
+
_nulling: function() {
|
|
3018
|
+
H("nulling", this), q = W = G = K = To = J = Eo = Do = Fo = Io = Vo = Y = Ao = Oo = ko = Ho = Uo = X = jo = Q.dragged = Q.ghost = Q.clone = Q.active = null, Yo.forEach(function(e) {
|
|
3019
|
+
e.checked = !0;
|
|
3020
|
+
}), Yo.length = Lo = Ro = 0;
|
|
3021
|
+
},
|
|
3022
|
+
handleEvent: function(e) {
|
|
3023
|
+
switch (e.type) {
|
|
3024
|
+
case "drop":
|
|
3025
|
+
case "dragend":
|
|
3026
|
+
this._onDrop(e);
|
|
3027
|
+
break;
|
|
3028
|
+
case "dragenter":
|
|
3029
|
+
case "dragover":
|
|
3030
|
+
W && (this._onDragOver(e), ls(e));
|
|
3031
|
+
break;
|
|
3032
|
+
case "selectstart": e.preventDefault();
|
|
3033
|
+
}
|
|
3034
|
+
},
|
|
3035
|
+
toArray: function() {
|
|
3036
|
+
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], Ya(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || _s(t));
|
|
3037
|
+
return e;
|
|
3038
|
+
},
|
|
3039
|
+
sort: function(e, t) {
|
|
3040
|
+
var n = {}, r = this.el;
|
|
3041
|
+
this.toArray().forEach(function(e, t) {
|
|
3042
|
+
var i = r.children[t];
|
|
3043
|
+
Ya(i, this.options.draggable, r, !1) && (n[e] = i);
|
|
3044
|
+
}, this), t && this.captureAnimationState(), e.forEach(function(e) {
|
|
3045
|
+
n[e] && (r.removeChild(n[e]), r.appendChild(n[e]));
|
|
3046
|
+
}), t && this.animateAll();
|
|
3047
|
+
},
|
|
3048
|
+
save: function() {
|
|
3049
|
+
var e = this.options.store;
|
|
3050
|
+
e && e.set && e.set(this);
|
|
3051
|
+
},
|
|
3052
|
+
closest: function(e, t) {
|
|
3053
|
+
return Ya(e, t || this.options.draggable, this.el, !1);
|
|
3054
|
+
},
|
|
3055
|
+
option: function(e, t) {
|
|
3056
|
+
var n = this.options;
|
|
3057
|
+
if (t === void 0) return n[e];
|
|
3058
|
+
var r = So.modifyOption(this, e, t);
|
|
3059
|
+
n[e] = r === void 0 ? t : r, e === "group" && is(n);
|
|
3060
|
+
},
|
|
3061
|
+
destroy: function() {
|
|
3062
|
+
H("destroy", this);
|
|
3063
|
+
var e = this.el;
|
|
3064
|
+
e[V] = null, R(e, "mousedown", this._onTapStart), R(e, "touchstart", this._onTapStart), R(e, "pointerdown", this._onTapStart), this.nativeDraggable && (R(e, "dragover", this), R(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) {
|
|
3065
|
+
e.removeAttribute("draggable");
|
|
3066
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), Po.splice(Po.indexOf(this.el), 1), this.el = e = null;
|
|
3067
|
+
},
|
|
3068
|
+
_hideClone: function() {
|
|
3069
|
+
if (!Do) {
|
|
3070
|
+
if (H("hideClone", this), Q.eventCanceled) return;
|
|
3071
|
+
z(J, "display", "none"), this.options.removeCloneOnHide && J.parentNode && J.parentNode.removeChild(J), Do = !0;
|
|
3072
|
+
}
|
|
3073
|
+
},
|
|
3074
|
+
_showClone: function(e) {
|
|
3075
|
+
if (e.lastPutMode !== "clone") {
|
|
3076
|
+
this._hideClone();
|
|
3077
|
+
return;
|
|
3078
|
+
}
|
|
3079
|
+
if (Do) {
|
|
3080
|
+
if (H("showClone", this), Q.eventCanceled) return;
|
|
3081
|
+
W.parentNode == q && !this.options.group.revertClone ? q.insertBefore(J, W) : To ? q.insertBefore(J, To) : q.appendChild(J), this.options.group.revertClone && this.animate(W, J), z(J, "display", ""), Do = !1;
|
|
3082
|
+
}
|
|
3083
|
+
}
|
|
3084
|
+
};
|
|
3085
|
+
function ls(e) {
|
|
3086
|
+
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
3087
|
+
}
|
|
3088
|
+
function us(e, t, n, r, i, a, o, s) {
|
|
3089
|
+
var c, l = e[V], u = l.options.onMove, d;
|
|
3090
|
+
return window.CustomEvent && !Ba && !Va ? c = new CustomEvent("move", {
|
|
3091
|
+
bubbles: !0,
|
|
3092
|
+
cancelable: !0
|
|
3093
|
+
}) : (c = document.createEvent("Event"), c.initEvent("move", !0, !0)), c.to = t, c.from = e, c.dragged = n, c.draggedRect = r, c.related = i || t, c.relatedRect = a || B(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d;
|
|
3094
|
+
}
|
|
3095
|
+
function ds(e) {
|
|
3096
|
+
e.draggable = !1;
|
|
3097
|
+
}
|
|
3098
|
+
function fs() {
|
|
3099
|
+
Jo = !1;
|
|
3100
|
+
}
|
|
3101
|
+
function ps(e, t, n) {
|
|
3102
|
+
var r = B(no(n.el, 0, n.options, !0)), i = go(n.el, n.options, K), a = 10;
|
|
3103
|
+
return t ? e.clientX < i.left - a || e.clientY < r.top && e.clientX < r.right : e.clientY < i.top - a || e.clientY < r.bottom && e.clientX < r.left;
|
|
3104
|
+
}
|
|
3105
|
+
function ms(e, t, n) {
|
|
3106
|
+
var r = B(ro(n.el, n.options.draggable)), i = go(n.el, n.options, K), a = 10;
|
|
3107
|
+
return t ? e.clientX > i.right + a || e.clientY > r.bottom && e.clientX > r.left : e.clientY > i.bottom + a || e.clientX > r.right && e.clientY > r.top;
|
|
3108
|
+
}
|
|
3109
|
+
function hs(e, t, n, r, i, a, o, s) {
|
|
3110
|
+
var c = r ? e.clientY : e.clientX, l = r ? n.height : n.width, u = r ? n.top : n.left, d = r ? n.bottom : n.right, f = !1;
|
|
3111
|
+
if (!o) {
|
|
3112
|
+
if (s && Ko < l * i) {
|
|
3113
|
+
if (!Wo && (Uo === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (Wo = !0), Wo) f = !0;
|
|
3114
|
+
else if (Uo === 1 ? c < u + Ko : c > d - Ko) return -Uo;
|
|
3115
|
+
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return gs(t);
|
|
3116
|
+
}
|
|
3117
|
+
return f ||= o, f && (c < u + l * a / 2 || c > d - l * a / 2) ? c > u + l / 2 ? 1 : -1 : 0;
|
|
3118
|
+
}
|
|
3119
|
+
function gs(e) {
|
|
3120
|
+
return io(W) < io(e) ? 1 : -1;
|
|
3121
|
+
}
|
|
3122
|
+
function _s(e) {
|
|
3123
|
+
for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, r = 0; n--;) r += t.charCodeAt(n);
|
|
3124
|
+
return r.toString(36);
|
|
3125
|
+
}
|
|
3126
|
+
function vs(e) {
|
|
3127
|
+
Yo.length = 0;
|
|
3128
|
+
for (var t = e.getElementsByTagName("input"), n = t.length; n--;) {
|
|
3129
|
+
var r = t[n];
|
|
3130
|
+
r.checked && Yo.push(r);
|
|
3131
|
+
}
|
|
3132
|
+
}
|
|
3133
|
+
function ys(e) {
|
|
3134
|
+
return setTimeout(e, 0);
|
|
3135
|
+
}
|
|
3136
|
+
function bs(e) {
|
|
3137
|
+
return clearTimeout(e);
|
|
3138
|
+
}
|
|
3139
|
+
Xo && L(document, "touchmove", function(e) {
|
|
3140
|
+
(Q.active || Mo) && e.cancelable && e.preventDefault();
|
|
3141
|
+
}), Q.utils = {
|
|
3142
|
+
on: L,
|
|
3143
|
+
off: R,
|
|
3144
|
+
css: z,
|
|
3145
|
+
find: $a,
|
|
3146
|
+
is: function(e, t) {
|
|
3147
|
+
return !!Ya(e, t, e, !1);
|
|
3148
|
+
},
|
|
3149
|
+
extend: co,
|
|
3150
|
+
throttle: fo,
|
|
3151
|
+
closest: Ya,
|
|
3152
|
+
toggleClass: Za,
|
|
3153
|
+
clone: ho,
|
|
3154
|
+
index: io,
|
|
3155
|
+
nextTick: ys,
|
|
3156
|
+
cancelNextTick: bs,
|
|
3157
|
+
detectDirection: ts,
|
|
3158
|
+
getChild: no
|
|
3159
|
+
}, Q.get = function(e) {
|
|
3160
|
+
return e[V];
|
|
3161
|
+
}, Q.mount = function() {
|
|
3162
|
+
var e = [...arguments];
|
|
3163
|
+
e[0].constructor === Array && (e = e[0]), e.forEach(function(e) {
|
|
3164
|
+
if (!e.prototype || !e.prototype.constructor) throw `Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;
|
|
3165
|
+
e.utils && (Q.utils = Ma(Ma({}, Q.utils), e.utils)), So.mount(e);
|
|
3166
|
+
});
|
|
3167
|
+
}, Q.create = function(e, t) {
|
|
3168
|
+
return new Q(e, t);
|
|
3169
|
+
}, Q.version = Ra;
|
|
3170
|
+
var $ = [], xs, Ss, Cs = !1, ws, Ts, Es, Ds;
|
|
3171
|
+
function Os() {
|
|
3172
|
+
function e() {
|
|
3173
|
+
for (var e in this.defaults = {
|
|
3174
|
+
scroll: !0,
|
|
3175
|
+
forceAutoScrollFallback: !1,
|
|
3176
|
+
scrollSensitivity: 30,
|
|
3177
|
+
scrollSpeed: 10,
|
|
3178
|
+
bubbleScroll: !0
|
|
3179
|
+
}, this) e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
|
|
3180
|
+
}
|
|
3181
|
+
return e.prototype = {
|
|
3182
|
+
dragStarted: function(e) {
|
|
3183
|
+
var t = e.originalEvent;
|
|
3184
|
+
this.sortable.nativeDraggable ? L(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? L(document, "pointermove", this._handleFallbackAutoScroll) : t.touches ? L(document, "touchmove", this._handleFallbackAutoScroll) : L(document, "mousemove", this._handleFallbackAutoScroll);
|
|
3185
|
+
},
|
|
3186
|
+
dragOverCompleted: function(e) {
|
|
3187
|
+
var t = e.originalEvent;
|
|
3188
|
+
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
3189
|
+
},
|
|
3190
|
+
drop: function() {
|
|
3191
|
+
this.sortable.nativeDraggable ? R(document, "dragover", this._handleAutoScroll) : (R(document, "pointermove", this._handleFallbackAutoScroll), R(document, "touchmove", this._handleFallbackAutoScroll), R(document, "mousemove", this._handleFallbackAutoScroll)), As(), ks(), po();
|
|
3192
|
+
},
|
|
3193
|
+
nulling: function() {
|
|
3194
|
+
Es = Ss = xs = Cs = Ds = ws = Ts = null, $.length = 0;
|
|
3195
|
+
},
|
|
3196
|
+
_handleFallbackAutoScroll: function(e) {
|
|
3197
|
+
this._handleAutoScroll(e, !0);
|
|
3198
|
+
},
|
|
3199
|
+
_handleAutoScroll: function(e, t) {
|
|
3200
|
+
var n = this, r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = document.elementFromPoint(r, i);
|
|
3201
|
+
if (Es = e, t || this.options.forceAutoScrollFallback || Va || Ba || Ua) {
|
|
3202
|
+
js(e, this.options, a, t);
|
|
3203
|
+
var o = so(a, !0);
|
|
3204
|
+
Cs && (!Ds || r !== ws || i !== Ts) && (Ds && As(), Ds = setInterval(function() {
|
|
3205
|
+
var a = so(document.elementFromPoint(r, i), !0);
|
|
3206
|
+
a !== o && (o = a, ks()), js(e, n.options, a, t);
|
|
3207
|
+
}, 10), ws = r, Ts = i);
|
|
3208
|
+
} else {
|
|
3209
|
+
if (!this.options.bubbleScroll || so(a, !0) === eo()) {
|
|
3210
|
+
ks();
|
|
3211
|
+
return;
|
|
3212
|
+
}
|
|
3213
|
+
js(e, this.options, so(a, !1), !1);
|
|
3214
|
+
}
|
|
3215
|
+
}
|
|
3216
|
+
}, Fa(e, {
|
|
3217
|
+
pluginName: "scroll",
|
|
3218
|
+
initializeByDefault: !0
|
|
3219
|
+
});
|
|
3220
|
+
}
|
|
3221
|
+
function ks() {
|
|
3222
|
+
$.forEach(function(e) {
|
|
3223
|
+
clearInterval(e.pid);
|
|
3224
|
+
}), $ = [];
|
|
3225
|
+
}
|
|
3226
|
+
function As() {
|
|
3227
|
+
clearInterval(Ds);
|
|
3228
|
+
}
|
|
3229
|
+
var js = fo(function(e, t, n, r) {
|
|
3230
|
+
if (t.scroll) {
|
|
3231
|
+
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = eo(), l = !1, u;
|
|
3232
|
+
Ss !== n && (Ss = n, ks(), xs = t.scroll, u = t.scrollFn, xs === !0 && (xs = so(n, !0)));
|
|
3233
|
+
var d = 0, f = xs;
|
|
3234
|
+
do {
|
|
3235
|
+
var p = f, m = B(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, S = void 0, C = p.scrollWidth, w = p.scrollHeight, T = z(p), E = p.scrollLeft, D = p.scrollTop;
|
|
3236
|
+
p === c ? (x = y < C && (T.overflowX === "auto" || T.overflowX === "scroll" || T.overflowX === "visible"), S = b < w && (T.overflowY === "auto" || T.overflowY === "scroll" || T.overflowY === "visible")) : (x = y < C && (T.overflowX === "auto" || T.overflowX === "scroll"), S = b < w && (T.overflowY === "auto" || T.overflowY === "scroll"));
|
|
3237
|
+
var O = x && (Math.abs(v - i) <= o && E + y < C) - (Math.abs(_ - i) <= o && !!E), k = S && (Math.abs(g - a) <= o && D + b < w) - (Math.abs(h - a) <= o && !!D);
|
|
3238
|
+
if (!$[d]) for (var A = 0; A <= d; A++) $[A] || ($[A] = {});
|
|
3239
|
+
($[d].vx != O || $[d].vy != k || $[d].el !== p) && ($[d].el = p, $[d].vx = O, $[d].vy = k, clearInterval($[d].pid), (O != 0 || k != 0) && (l = !0, $[d].pid = setInterval(function() {
|
|
3240
|
+
r && this.layer === 0 && Q.active._onTouchMove(Es);
|
|
3241
|
+
var t = $[this.layer].vy ? $[this.layer].vy * s : 0, n = $[this.layer].vx ? $[this.layer].vx * s : 0;
|
|
3242
|
+
typeof u == "function" && u.call(Q.dragged.parentNode[V], n, t, e, Es, $[this.layer].el) !== "continue" || mo($[this.layer].el, n, t);
|
|
3243
|
+
}.bind({ layer: d }), 24))), d++;
|
|
3244
|
+
} while (t.bubbleScroll && f !== c && (f = so(f, !1)));
|
|
3245
|
+
Cs = l;
|
|
3246
|
+
}
|
|
3247
|
+
}, 30), Ms = function(e) {
|
|
3248
|
+
var t = e.originalEvent, n = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, o = e.hideGhostForTarget, s = e.unhideGhostForTarget;
|
|
3249
|
+
if (t) {
|
|
3250
|
+
var c = n || i;
|
|
3251
|
+
o();
|
|
3252
|
+
var l = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : t, u = document.elementFromPoint(l.clientX, l.clientY);
|
|
3253
|
+
s(), c && !c.el.contains(u) && (a("spill"), this.onSpill({
|
|
3254
|
+
dragEl: r,
|
|
3255
|
+
putSortable: n
|
|
3256
|
+
}));
|
|
3257
|
+
}
|
|
3258
|
+
};
|
|
3259
|
+
function Ns() {}
|
|
3260
|
+
Ns.prototype = {
|
|
3261
|
+
startIndex: null,
|
|
3262
|
+
dragStart: function(e) {
|
|
3263
|
+
var t = e.oldDraggableIndex;
|
|
3264
|
+
this.startIndex = t;
|
|
3265
|
+
},
|
|
3266
|
+
onSpill: function(e) {
|
|
3267
|
+
var t = e.dragEl, n = e.putSortable;
|
|
3268
|
+
this.sortable.captureAnimationState(), n && n.captureAnimationState();
|
|
3269
|
+
var r = no(this.sortable.el, this.startIndex, this.options);
|
|
3270
|
+
r ? this.sortable.el.insertBefore(t, r) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
|
|
3271
|
+
},
|
|
3272
|
+
drop: Ms
|
|
3273
|
+
}, Fa(Ns, { pluginName: "revertOnSpill" });
|
|
3274
|
+
function Ps() {}
|
|
3275
|
+
Ps.prototype = {
|
|
3276
|
+
onSpill: function(e) {
|
|
3277
|
+
var t = e.dragEl, n = e.putSortable || this.sortable;
|
|
3278
|
+
n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll();
|
|
3279
|
+
},
|
|
3280
|
+
drop: Ms
|
|
3281
|
+
}, Fa(Ps, { pluginName: "removeOnSpill" }), Q.mount(new Os()), Q.mount(Ps, Ns);
|
|
3282
|
+
function Fs(e) {
|
|
3283
|
+
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
3284
|
+
}
|
|
3285
|
+
function Is(e) {
|
|
3286
|
+
te() && O(e);
|
|
3287
|
+
}
|
|
3288
|
+
function Ls(e) {
|
|
3289
|
+
te() ? d(e) : a(e);
|
|
3290
|
+
}
|
|
3291
|
+
var Rs = null, zs = null;
|
|
3292
|
+
function Bs(e = null, t = null) {
|
|
3293
|
+
Rs = e, zs = t;
|
|
3294
|
+
}
|
|
3295
|
+
function Vs() {
|
|
3296
|
+
return {
|
|
3297
|
+
data: Rs,
|
|
3298
|
+
clonedData: zs
|
|
3299
|
+
};
|
|
3300
|
+
}
|
|
3301
|
+
var Hs = Symbol("cloneElement");
|
|
3302
|
+
function Us(...e) {
|
|
3303
|
+
let t = te()?.proxy, n = null, r = e[0], [, i, o] = e;
|
|
3304
|
+
Array.isArray(y(i)) || (o = i, i = null);
|
|
3305
|
+
let s = null, { immediate: l = !0, clone: u = Fs, forceFallback: d, fallbackOnBody: p, customUpdate: m } = y(o) ?? {};
|
|
3306
|
+
function h(e) {
|
|
3307
|
+
let { from: t, oldIndex: r, item: a } = e, o = Array.from(t.childNodes);
|
|
3308
|
+
n = d && !p ? o.slice(0, -1) : o;
|
|
3309
|
+
let s = y(y(i)?.[r]), c = u(s);
|
|
3310
|
+
Bs(s, c), a[Hs] = c;
|
|
3311
|
+
}
|
|
3312
|
+
function g(e) {
|
|
3313
|
+
let t = e.item[Hs];
|
|
3314
|
+
if (!ba(t)) {
|
|
3315
|
+
if (Ca(e.item), c(i)) {
|
|
3316
|
+
let n = [...y(i)];
|
|
3317
|
+
i.value = ya(n, e.newDraggableIndex, t);
|
|
3318
|
+
return;
|
|
3319
|
+
}
|
|
3320
|
+
ya(y(i), e.newDraggableIndex, t);
|
|
3321
|
+
}
|
|
3322
|
+
}
|
|
3323
|
+
function _(e) {
|
|
3324
|
+
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, pullMode: o, clone: s } = e;
|
|
3325
|
+
if (Sa(t, n, r), o === "clone") {
|
|
3326
|
+
Ca(s);
|
|
3327
|
+
return;
|
|
3328
|
+
}
|
|
3329
|
+
if (c(i)) {
|
|
3330
|
+
let e = [...y(i)];
|
|
3331
|
+
i.value = va(e, a);
|
|
3332
|
+
return;
|
|
3333
|
+
}
|
|
3334
|
+
va(y(i), a);
|
|
3335
|
+
}
|
|
3336
|
+
function v(e) {
|
|
3337
|
+
if (m) {
|
|
3338
|
+
m(e);
|
|
3339
|
+
return;
|
|
3340
|
+
}
|
|
3341
|
+
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, newDraggableIndex: o } = e;
|
|
3342
|
+
if (Ca(n), Sa(t, n, r), c(i)) {
|
|
3343
|
+
let e = [...y(i)];
|
|
3344
|
+
i.value = ha(e, a, o);
|
|
3345
|
+
return;
|
|
3346
|
+
}
|
|
3347
|
+
ha(y(i), a, o);
|
|
3348
|
+
}
|
|
3349
|
+
function b(e) {
|
|
3350
|
+
let { newIndex: t, oldIndex: r, from: i, to: o } = e, s = null, c = t === r && i === o;
|
|
3351
|
+
try {
|
|
3352
|
+
if (c) {
|
|
3353
|
+
let e = null;
|
|
3354
|
+
n?.some((t, r) => {
|
|
3355
|
+
if (e && n?.length !== o.childNodes.length) return i.insertBefore(e, t.nextSibling), !0;
|
|
3356
|
+
let a = o.childNodes[r];
|
|
3357
|
+
e = o?.replaceChild(t, a);
|
|
3358
|
+
});
|
|
3359
|
+
}
|
|
3360
|
+
} catch (e) {
|
|
3361
|
+
s = e;
|
|
3362
|
+
} finally {
|
|
3363
|
+
n = null;
|
|
3364
|
+
}
|
|
3365
|
+
a(() => {
|
|
3366
|
+
if (Bs(), s) throw s;
|
|
3367
|
+
});
|
|
3368
|
+
}
|
|
3369
|
+
let x = {
|
|
3370
|
+
onUpdate: v,
|
|
3371
|
+
onStart: h,
|
|
3372
|
+
onAdd: g,
|
|
3373
|
+
onRemove: _,
|
|
3374
|
+
onEnd: b
|
|
3375
|
+
};
|
|
3376
|
+
function S(e) {
|
|
3377
|
+
let n = y(r);
|
|
3378
|
+
return e ||= xa(n) ? wa(n, t?.$el) : n, e && !Da(e) && (e = e.$el), e || ma("Root element not found"), e;
|
|
3379
|
+
}
|
|
3380
|
+
function C() {
|
|
3381
|
+
let e = y(o) ?? {}, { immediate: t, clone: n } = e, r = da(e, ["immediate", "clone"]);
|
|
3382
|
+
return Oa(r, (e, t) => {
|
|
3383
|
+
ka(e) && (r[e] = (e, ...n) => (Aa(e, Vs()), t(e, ...n)));
|
|
3384
|
+
}), Ea(i === null ? {} : x, r);
|
|
3385
|
+
}
|
|
3386
|
+
let w = (e) => {
|
|
3387
|
+
e = S(e), s && T.destroy(), s = new Q(e, C());
|
|
3388
|
+
};
|
|
3389
|
+
f(() => o, () => {
|
|
3390
|
+
s && Oa(C(), (e, t) => {
|
|
3391
|
+
s?.option(e, t);
|
|
3392
|
+
});
|
|
3393
|
+
}, { deep: !0 });
|
|
3394
|
+
let T = {
|
|
3395
|
+
option: (e, t) => s?.option(e, t),
|
|
3396
|
+
destroy: () => {
|
|
3397
|
+
s?.destroy(), s = null;
|
|
3398
|
+
},
|
|
3399
|
+
save: () => s?.save(),
|
|
3400
|
+
toArray: () => s?.toArray(),
|
|
3401
|
+
closest: (...e) => s?.closest(...e)
|
|
3402
|
+
};
|
|
3403
|
+
return Ls(() => {
|
|
3404
|
+
l && w();
|
|
3405
|
+
}), Is(T.destroy), ua({
|
|
3406
|
+
start: w,
|
|
3407
|
+
pause: () => T?.option("disabled", !0),
|
|
3408
|
+
resume: () => T?.option("disabled", !1)
|
|
3409
|
+
}, T);
|
|
3410
|
+
}
|
|
3411
|
+
var Ws = [
|
|
3412
|
+
"update",
|
|
3413
|
+
"start",
|
|
3414
|
+
"add",
|
|
3415
|
+
"remove",
|
|
3416
|
+
"choose",
|
|
3417
|
+
"unchoose",
|
|
3418
|
+
"end",
|
|
3419
|
+
"sort",
|
|
3420
|
+
"filter",
|
|
3421
|
+
"clone",
|
|
3422
|
+
"move",
|
|
3423
|
+
"change"
|
|
3424
|
+
], Gs = [
|
|
3425
|
+
"clone",
|
|
3426
|
+
"animation",
|
|
3427
|
+
"ghostClass",
|
|
3428
|
+
"group",
|
|
3429
|
+
"sort",
|
|
3430
|
+
"disabled",
|
|
3431
|
+
"store",
|
|
3432
|
+
"handle",
|
|
3433
|
+
"draggable",
|
|
3434
|
+
"swapThreshold",
|
|
3435
|
+
"invertSwap",
|
|
3436
|
+
"invertedSwapThreshold",
|
|
3437
|
+
"removeCloneOnHide",
|
|
3438
|
+
"direction",
|
|
3439
|
+
"chosenClass",
|
|
3440
|
+
"dragClass",
|
|
3441
|
+
"ignore",
|
|
3442
|
+
"filter",
|
|
3443
|
+
"preventOnFilter",
|
|
3444
|
+
"easing",
|
|
3445
|
+
"setData",
|
|
3446
|
+
"dropBubble",
|
|
3447
|
+
"dragoverBubble",
|
|
3448
|
+
"dataIdAttr",
|
|
3449
|
+
"delay",
|
|
3450
|
+
"delayOnTouchOnly",
|
|
3451
|
+
"touchStartThreshold",
|
|
3452
|
+
"forceFallback",
|
|
3453
|
+
"fallbackClass",
|
|
3454
|
+
"fallbackOnBody",
|
|
3455
|
+
"fallbackTolerance",
|
|
3456
|
+
"fallbackOffset",
|
|
3457
|
+
"supportPointer",
|
|
3458
|
+
"emptyInsertThreshold",
|
|
3459
|
+
"scroll",
|
|
3460
|
+
"forceAutoScrollFallback",
|
|
3461
|
+
"scrollSensitivity",
|
|
3462
|
+
"scrollSpeed",
|
|
3463
|
+
"bubbleScroll",
|
|
3464
|
+
"modelValue",
|
|
3465
|
+
"tag",
|
|
3466
|
+
"target",
|
|
3467
|
+
"customUpdate",
|
|
3468
|
+
...Ws.map((e) => `on${e.replace(/^\S/, (e) => e.toUpperCase())}`)
|
|
3469
|
+
], Ks = F({
|
|
3470
|
+
name: "VueDraggable",
|
|
3471
|
+
model: {
|
|
3472
|
+
prop: "modelValue",
|
|
3473
|
+
event: "update:modelValue"
|
|
3474
|
+
},
|
|
3475
|
+
props: Gs,
|
|
3476
|
+
emits: ["update:modelValue", ...Ws],
|
|
3477
|
+
setup(e, { slots: t, emit: n, expose: r, attrs: i }) {
|
|
3478
|
+
let a = Ws.reduce((e, t) => {
|
|
3479
|
+
let r = `on${t.replace(/^\S/, (e) => e.toUpperCase())}`;
|
|
3480
|
+
return e[r] = (...e) => n(t, ...e), e;
|
|
3481
|
+
}, {}), o = N(() => {
|
|
3482
|
+
let t = j(e), { modelValue: n } = t, r = da(t, ["modelValue"]), o = Object.entries(r).reduce((e, [t, n]) => {
|
|
3483
|
+
let r = y(n);
|
|
3484
|
+
return r !== void 0 && (e[t] = r), e;
|
|
3485
|
+
}, {});
|
|
3486
|
+
return ua(ua({}, a), _a(ua(ua({}, i), o)));
|
|
3487
|
+
}), s = N({
|
|
3488
|
+
get: () => e.modelValue,
|
|
3489
|
+
set: (e) => n("update:modelValue", e)
|
|
3490
|
+
}), c = _(), l = g(Us(e.target || c, s, o));
|
|
3491
|
+
return r(l), () => b(e.tag || "div", { ref: c }, (t?.default)?.call(t, l));
|
|
3492
|
+
}
|
|
3493
|
+
}), qs = {
|
|
3494
|
+
mounted: "mounted",
|
|
3495
|
+
unmounted: "unmounted"
|
|
3496
|
+
};
|
|
3497
|
+
qs.mounted, qs.unmounted;
|
|
3498
|
+
//#endregion
|
|
3499
|
+
//#region src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3500
|
+
var Js = { class: "tpl:w-full" }, Ys = {
|
|
3501
|
+
key: 0,
|
|
3502
|
+
"data-testid": "section-drop-hint",
|
|
3503
|
+
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)]"
|
|
3504
|
+
}, Xs = /* @__PURE__ */ F({
|
|
3505
|
+
__name: "SectionBlock",
|
|
3506
|
+
props: {
|
|
3507
|
+
block: {},
|
|
3508
|
+
viewport: {}
|
|
3509
|
+
},
|
|
3510
|
+
setup(e) {
|
|
3511
|
+
let i = {
|
|
3512
|
+
title: ra,
|
|
3513
|
+
paragraph: Ri,
|
|
3514
|
+
image: Ti,
|
|
3515
|
+
button: Sr,
|
|
3516
|
+
divider: oi,
|
|
3517
|
+
custom: ii
|
|
3518
|
+
}, a = e, { t: s } = nn(), c = Mt(zt, "SectionBlock"), u = p(Rt, null), d = p(Xt, null), f = p(Ut, {}), h = p(Yt, null);
|
|
3519
|
+
function g(e) {
|
|
3520
|
+
let t = f.savedBlocks;
|
|
3521
|
+
if (t?.isPicking.value) {
|
|
3522
|
+
t.togglePick(a.block.id);
|
|
3523
|
+
return;
|
|
3524
|
+
}
|
|
3525
|
+
c.selectBlock(e);
|
|
3526
|
+
}
|
|
3527
|
+
let _ = N(() => {
|
|
3528
|
+
switch (a.block.columns) {
|
|
3529
|
+
case "2": return ["50%", "50%"];
|
|
3530
|
+
case "3": return [
|
|
3531
|
+
"33.33%",
|
|
3532
|
+
"33.33%",
|
|
3533
|
+
"33.33%"
|
|
3534
|
+
];
|
|
3535
|
+
case "1-2": return ["33.33%", "66.67%"];
|
|
3536
|
+
case "2-1": return ["66.67%", "33.33%"];
|
|
3537
|
+
default: return ["100%"];
|
|
3538
|
+
}
|
|
3539
|
+
}), v = N(() => {
|
|
3540
|
+
let e = _.value.length, t = [...a.block.children];
|
|
3541
|
+
for (; t.length < e;) t.push([]);
|
|
3542
|
+
return t.slice(0, e);
|
|
3543
|
+
}), b = N(() => a.viewport === "mobile" && a.block.stackOnMobile !== !1);
|
|
3544
|
+
function w(e) {
|
|
3545
|
+
return v.value[e] || [];
|
|
3546
|
+
}
|
|
3547
|
+
function T(e, t) {
|
|
3548
|
+
let n = t.map((e) => JSON.parse(JSON.stringify(e))), r = [...a.block.children];
|
|
3549
|
+
for (; r.length <= e;) r.push([]);
|
|
3550
|
+
r[e] = n, c.updateBlock(a.block.id, { children: r });
|
|
3551
|
+
}
|
|
3552
|
+
function E(e) {
|
|
3553
|
+
return Bi(e, d, i);
|
|
3554
|
+
}
|
|
3555
|
+
function O(e, t) {
|
|
3556
|
+
e.type === "custom" && c.updateBlock(e.id, {
|
|
3557
|
+
fieldValues: t.fieldValues,
|
|
3558
|
+
dataSourceFetched: t.dataSourceFetched
|
|
3559
|
+
});
|
|
3560
|
+
}
|
|
3561
|
+
return (i, a) => (t(), S("div", Js, [x("div", { class: k(["tpl:flex tpl:gap-0", { "tpl:flex-col": b.value }]) }, [(t(!0), S(M, null, l(v.value, (i, a) => (t(), S("div", {
|
|
3562
|
+
key: a,
|
|
3563
|
+
class: k(["tpl:relative tpl:min-h-[60px] tpl:rounded", w(a).length === 0 ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
|
|
3564
|
+
style: n({ width: b.value ? "100%" : _.value[a] })
|
|
3565
|
+
}, [C(y(Ks), {
|
|
3566
|
+
"model-value": w(a),
|
|
3567
|
+
group: {
|
|
3568
|
+
name: "blocks",
|
|
3569
|
+
pull: !0,
|
|
3570
|
+
put: (e, t, n) => y(ia)(n)
|
|
3571
|
+
},
|
|
3572
|
+
animation: 150,
|
|
3573
|
+
"ghost-class": "tpl-ghost",
|
|
3574
|
+
"drag-class": "tpl-dragging",
|
|
3575
|
+
handle: ".tpl-block-btn",
|
|
3576
|
+
"invert-swap": !0,
|
|
3577
|
+
"inverted-swap-threshold": .65,
|
|
3578
|
+
"empty-insert-threshold": 20,
|
|
3579
|
+
"force-fallback": !0,
|
|
3580
|
+
class: "tpl:min-h-[60px]",
|
|
3581
|
+
"onUpdate:modelValue": (e) => T(a, e)
|
|
3582
|
+
}, {
|
|
3583
|
+
default: r(() => [(t(!0), S(M, null, l(w(a), (n) => m((t(), S("div", { key: n.id }, [C(ta, {
|
|
3584
|
+
block: n,
|
|
3585
|
+
"is-selected": y(c).state.selectedBlockId === n.id,
|
|
3586
|
+
viewport: e.viewport,
|
|
3587
|
+
"preview-mode": y(c).state.previewMode,
|
|
3588
|
+
nested: "",
|
|
3589
|
+
onSelect: (e) => g(n.id)
|
|
3590
|
+
}, {
|
|
3591
|
+
default: r(() => [(t(), A(o(E(n)), {
|
|
3592
|
+
block: n,
|
|
3593
|
+
viewport: e.viewport,
|
|
3594
|
+
onFetchData: (e) => O(n, e),
|
|
3595
|
+
onUpdate: (e) => y(c).updateBlock(n.id, e)
|
|
3596
|
+
}, null, 40, [
|
|
3597
|
+
"block",
|
|
3598
|
+
"viewport",
|
|
3599
|
+
"onFetchData",
|
|
3600
|
+
"onUpdate"
|
|
3601
|
+
]))]),
|
|
3602
|
+
_: 2
|
|
3603
|
+
}, 1032, [
|
|
3604
|
+
"block",
|
|
3605
|
+
"is-selected",
|
|
3606
|
+
"viewport",
|
|
3607
|
+
"preview-mode",
|
|
3608
|
+
"onSelect"
|
|
3609
|
+
])])), [[ne, y(h) === !1 || !y(u)?.isHidden(n.id)]])), 128))]),
|
|
3610
|
+
_: 2
|
|
3611
|
+
}, 1032, [
|
|
3612
|
+
"model-value",
|
|
3613
|
+
"group",
|
|
3614
|
+
"onUpdate:modelValue"
|
|
3615
|
+
]), w(a).length === 0 ? (t(), S("div", Ys, [x("span", null, D(y(s).section.dropHere), 1)])) : P("", !0)], 6))), 128))], 2)]));
|
|
3616
|
+
}
|
|
3617
|
+
}), Zs = [
|
|
3618
|
+
"width",
|
|
3619
|
+
"height",
|
|
3620
|
+
"fill"
|
|
3621
|
+
], Qs = ["d"], $s = /* @__PURE__ */ F({
|
|
3622
|
+
__name: "SocialIconSvg",
|
|
3623
|
+
props: {
|
|
3624
|
+
platform: {},
|
|
3625
|
+
iconStyle: {},
|
|
3626
|
+
iconSize: {}
|
|
3627
|
+
},
|
|
3628
|
+
setup(e) {
|
|
3629
|
+
let r = e, i = N(() => Xe[r.platform]), a = N(() => $e[r.iconSize]), o = N(() => {
|
|
3630
|
+
let e = {
|
|
3631
|
+
display: "inline-flex",
|
|
3632
|
+
alignItems: "center",
|
|
3633
|
+
justifyContent: "center",
|
|
3634
|
+
width: `${a.value}px`,
|
|
3635
|
+
height: `${a.value}px`
|
|
3636
|
+
};
|
|
3637
|
+
switch (r.iconStyle) {
|
|
3638
|
+
case "solid": return {
|
|
3639
|
+
...e,
|
|
3640
|
+
backgroundColor: i.value.color,
|
|
3641
|
+
borderRadius: "4px"
|
|
3642
|
+
};
|
|
3643
|
+
case "outlined": return {
|
|
3644
|
+
...e,
|
|
3645
|
+
backgroundColor: "transparent",
|
|
3646
|
+
border: `2px solid ${i.value.color}`,
|
|
3647
|
+
borderRadius: "4px"
|
|
3648
|
+
};
|
|
3649
|
+
case "rounded": return {
|
|
3650
|
+
...e,
|
|
3651
|
+
backgroundColor: i.value.color,
|
|
3652
|
+
borderRadius: "8px"
|
|
3653
|
+
};
|
|
3654
|
+
case "square": return {
|
|
3655
|
+
...e,
|
|
3656
|
+
backgroundColor: i.value.color,
|
|
3657
|
+
borderRadius: "0"
|
|
3658
|
+
};
|
|
3659
|
+
case "circle": return {
|
|
3660
|
+
...e,
|
|
3661
|
+
backgroundColor: i.value.color,
|
|
3662
|
+
borderRadius: "50%"
|
|
3663
|
+
};
|
|
3664
|
+
default: return e;
|
|
3665
|
+
}
|
|
3666
|
+
}), s = N(() => Math.floor(a.value * .6)), c = N(() => r.iconStyle === "outlined" ? i.value.color : "#ffffff");
|
|
3667
|
+
return (e, r) => (t(), S("span", { style: n(o.value) }, [(t(), S("svg", {
|
|
3668
|
+
width: s.value,
|
|
3669
|
+
height: s.value,
|
|
3670
|
+
viewBox: "0 0 24 24",
|
|
3671
|
+
fill: c.value,
|
|
3672
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3673
|
+
}, [x("path", { d: i.value.path }, null, 8, Qs)], 8, Zs))], 4));
|
|
3674
|
+
}
|
|
3675
|
+
}), ec = { class: "tpl:w-full" }, tc = ["href"], nc = {
|
|
3676
|
+
key: 1,
|
|
3677
|
+
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)]"
|
|
3678
|
+
}, rc = /* @__PURE__ */ F({
|
|
3679
|
+
__name: "SocialIconsBlock",
|
|
3680
|
+
props: {
|
|
3681
|
+
block: {},
|
|
3682
|
+
viewport: {}
|
|
3683
|
+
},
|
|
3684
|
+
setup(e) {
|
|
3685
|
+
let r = e, { t: i } = nn(), a = N(() => ({
|
|
3686
|
+
display: "flex",
|
|
3687
|
+
flexWrap: "wrap",
|
|
3688
|
+
gap: `${r.block.spacing}px`,
|
|
3689
|
+
justifyContent: r.block.align === "left" ? "flex-start" : r.block.align === "right" ? "flex-end" : "center"
|
|
3690
|
+
})), o = N(() => r.block.icons.length > 0);
|
|
3691
|
+
return (r, s) => (t(), S("div", ec, [o.value ? (t(), S("div", {
|
|
3692
|
+
key: 0,
|
|
3693
|
+
style: n(a.value)
|
|
3694
|
+
}, [(t(!0), S(M, null, l(e.block.icons, (n) => (t(), S("a", {
|
|
3695
|
+
key: n.id,
|
|
3696
|
+
href: n.url || "#",
|
|
3697
|
+
class: "tpl:cursor-default",
|
|
3698
|
+
onClick: s[0] ||= I(() => {}, ["prevent"])
|
|
3699
|
+
}, [C($s, {
|
|
3700
|
+
platform: n.platform,
|
|
3701
|
+
"icon-style": e.block.iconStyle,
|
|
3702
|
+
"icon-size": e.block.iconSize
|
|
3703
|
+
}, null, 8, [
|
|
3704
|
+
"platform",
|
|
3705
|
+
"icon-style",
|
|
3706
|
+
"icon-size"
|
|
3707
|
+
])], 8, tc))), 128))], 4)) : (t(), S("div", nc, [C(y(Ze), { size: 16 }), x("span", null, D(y(i).social.addIcons), 1)]))]));
|
|
3708
|
+
}
|
|
3709
|
+
}), ic = { class: "tpl:w-full" }, ac = {
|
|
3710
|
+
key: 0,
|
|
3711
|
+
class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
3712
|
+
style: {
|
|
3713
|
+
"background-color": "var(--tpl-bg-hover)",
|
|
3714
|
+
color: "var(--tpl-text-dim)"
|
|
3715
|
+
}
|
|
3716
|
+
}, oc = /* @__PURE__ */ F({
|
|
3717
|
+
__name: "SpacerBlock",
|
|
3718
|
+
props: {
|
|
3719
|
+
block: {},
|
|
3720
|
+
viewport: {}
|
|
3721
|
+
},
|
|
3722
|
+
setup(e) {
|
|
3723
|
+
let r = e, i = Mt(zt, "SpacerBlock"), a = N(() => ({
|
|
3724
|
+
height: `${r.block.height}px`,
|
|
3725
|
+
minHeight: `${r.block.height}px`,
|
|
3726
|
+
...i.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
3727
|
+
}));
|
|
3728
|
+
return (r, o) => (t(), S("div", ic, [x("div", {
|
|
3729
|
+
style: n(a.value),
|
|
3730
|
+
class: k(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:border-y tpl:border-dashed": !y(i).state.previewMode }])
|
|
3731
|
+
}, [y(i).state.previewMode ? P("", !0) : (t(), S("span", ac, D(e.block.height) + "px ", 1))], 6)]));
|
|
3732
|
+
}
|
|
3733
|
+
}), sc = { class: "tpl:w-full" }, cc = { key: 0 }, lc = [
|
|
3734
|
+
"aria-label",
|
|
3735
|
+
"data-placeholder",
|
|
3736
|
+
"onBlur"
|
|
3737
|
+
], uc = [
|
|
3738
|
+
"aria-label",
|
|
3739
|
+
"data-placeholder",
|
|
3740
|
+
"onBlur"
|
|
3741
|
+
], dc = {
|
|
3742
|
+
key: 1,
|
|
3743
|
+
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)]"
|
|
3744
|
+
}, fc = /*#__PURE__*/ yn(/* @__PURE__ */ F({
|
|
3745
|
+
__name: "TableBlock",
|
|
3746
|
+
props: {
|
|
3747
|
+
block: {},
|
|
3748
|
+
viewport: {}
|
|
3749
|
+
},
|
|
3750
|
+
setup(e) {
|
|
3751
|
+
let r = {
|
|
3752
|
+
mounted(e, t) {
|
|
3753
|
+
e.textContent = t.value ?? "";
|
|
3754
|
+
},
|
|
3755
|
+
updated(e, t) {
|
|
3756
|
+
t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
|
|
3757
|
+
}
|
|
3758
|
+
}, i = e, { t: a } = nn(), o = Mt(zt, "TableBlock"), s = N(() => i.block.rows.length > 0), c = N(() => {
|
|
3759
|
+
let e = {
|
|
3760
|
+
width: "100%",
|
|
3761
|
+
borderCollapse: "collapse",
|
|
3762
|
+
fontSize: `${i.block.fontSize}px`,
|
|
3763
|
+
textAlign: i.block.textAlign,
|
|
3764
|
+
fontFamily: i.block.fontFamily || "inherit"
|
|
3765
|
+
};
|
|
3766
|
+
return i.block.color && (e.color = i.block.color), e;
|
|
3767
|
+
}), u = N(() => ({
|
|
3768
|
+
border: `${i.block.borderWidth}px solid ${i.block.borderColor}`,
|
|
3769
|
+
padding: `${i.block.cellPadding}px`,
|
|
3770
|
+
textAlign: i.block.textAlign
|
|
3771
|
+
})), d = N(() => ({
|
|
3772
|
+
...u.value,
|
|
3773
|
+
fontWeight: "bold",
|
|
3774
|
+
backgroundColor: i.block.headerBackgroundColor || "transparent"
|
|
3775
|
+
})), f = N(() => i.block.hasHeaderRow && i.block.rows.length > 0 ? i.block.rows[0] : null), p = N(() => i.block.hasHeaderRow ? i.block.rows.slice(1) : i.block.rows);
|
|
3776
|
+
function h() {
|
|
3777
|
+
o.selectBlock(i.block.id);
|
|
3778
|
+
}
|
|
3779
|
+
function g(e, t, n) {
|
|
3780
|
+
let r = n.target.innerText.trim(), a = i.block.rows.map((n) => n.id === e ? {
|
|
3781
|
+
...n,
|
|
3782
|
+
cells: n.cells.map((e) => e.id === t ? {
|
|
3783
|
+
...e,
|
|
3784
|
+
content: r
|
|
3785
|
+
} : e)
|
|
3786
|
+
} : n);
|
|
3787
|
+
o.updateBlock(i.block.id, { rows: a });
|
|
3788
|
+
}
|
|
3789
|
+
return (e, i) => (t(), S("div", sc, [s.value ? (t(), S("table", {
|
|
3790
|
+
key: 0,
|
|
3791
|
+
style: n(c.value),
|
|
3792
|
+
class: "tpl-table-editable"
|
|
3793
|
+
}, [f.value ? (t(), S("thead", cc, [x("tr", null, [(t(!0), S(M, null, l(f.value.cells, (e) => m((t(), S("th", {
|
|
3794
|
+
key: e.id,
|
|
3795
|
+
style: n(d.value),
|
|
3796
|
+
"aria-label": y(a).table.cellPlaceholder,
|
|
3797
|
+
contenteditable: "true",
|
|
3798
|
+
"data-placeholder": y(a).table.cellPlaceholder,
|
|
3799
|
+
onBlur: (t) => g(f.value.id, e.id, t),
|
|
3800
|
+
onKeydown: i[0] ||= re(I((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3801
|
+
onClick: I(h, ["stop"])
|
|
3802
|
+
}, null, 44, lc)), [[r, e.content]])), 128))])])) : P("", !0), x("tbody", null, [(t(!0), S(M, null, l(p.value, (e) => (t(), S("tr", { key: e.id }, [(t(!0), S(M, null, l(e.cells, (o) => m((t(), S("td", {
|
|
3803
|
+
key: o.id,
|
|
3804
|
+
style: n(u.value),
|
|
3805
|
+
"aria-label": y(a).table.cellPlaceholder,
|
|
3806
|
+
contenteditable: "true",
|
|
3807
|
+
"data-placeholder": y(a).table.cellPlaceholder,
|
|
3808
|
+
onBlur: (t) => g(e.id, o.id, t),
|
|
3809
|
+
onKeydown: i[1] ||= re(I((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3810
|
+
onClick: I(h, ["stop"])
|
|
3811
|
+
}, null, 44, uc)), [[r, o.content]])), 128))]))), 128))])], 4)) : (t(), S("div", dc, [C(y(Ue), { size: 16 }), x("span", null, D(y(a).table.empty), 1)]))]));
|
|
3812
|
+
}
|
|
3813
|
+
}), [["__scopeId", "data-v-963ac422"]]), pc = /* @__PURE__ */ F({
|
|
3814
|
+
__name: "VideoPlayButton",
|
|
3815
|
+
props: { hoverEffect: {
|
|
3816
|
+
type: Boolean,
|
|
3817
|
+
default: !1
|
|
3818
|
+
} },
|
|
3819
|
+
setup(e) {
|
|
3820
|
+
return (n, r) => (t(), S("div", { class: k(["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"]) }, [...r[0] ||= [x("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)]" }, [x("svg", {
|
|
3821
|
+
class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
|
|
3822
|
+
width: "28",
|
|
3823
|
+
height: "28",
|
|
3824
|
+
viewBox: "0 0 24 24",
|
|
3825
|
+
fill: "currentColor"
|
|
3826
|
+
}, [x("polygon", { points: "5,3 19,12 5,21" })])], -1)]], 2));
|
|
3827
|
+
}
|
|
3828
|
+
});
|
|
3829
|
+
//#endregion
|
|
3830
|
+
//#region src/utils/videoThumbnail.ts
|
|
3831
|
+
function mc(e) {
|
|
3832
|
+
if (!e) return {
|
|
3833
|
+
platform: "unknown",
|
|
3834
|
+
videoId: null,
|
|
3835
|
+
thumbnailUrl: null
|
|
3836
|
+
};
|
|
3837
|
+
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]) {
|
|
3838
|
+
let n = e.match(t);
|
|
3839
|
+
if (n) {
|
|
3840
|
+
let e = n[1];
|
|
3841
|
+
return {
|
|
3842
|
+
platform: "youtube",
|
|
3843
|
+
videoId: e,
|
|
3844
|
+
thumbnailUrl: `https://img.youtube.com/vi/${e}/maxresdefault.jpg`
|
|
3845
|
+
};
|
|
3846
|
+
}
|
|
3847
|
+
}
|
|
3848
|
+
let t = e.match(/vimeo\.com\/(?:video\/)?(\d+)/i);
|
|
3849
|
+
if (t) {
|
|
3850
|
+
let e = t[1];
|
|
3851
|
+
return {
|
|
3852
|
+
platform: "vimeo",
|
|
3853
|
+
videoId: e,
|
|
3854
|
+
thumbnailUrl: `https://vumbnail.com/${e}.jpg`
|
|
3855
|
+
};
|
|
3856
|
+
}
|
|
3857
|
+
return {
|
|
3858
|
+
platform: "unknown",
|
|
3859
|
+
videoId: null,
|
|
3860
|
+
thumbnailUrl: null
|
|
3861
|
+
};
|
|
3862
|
+
}
|
|
3863
|
+
function hc(e, t) {
|
|
3864
|
+
return t || mc(e).thumbnailUrl;
|
|
3865
|
+
}
|
|
3866
|
+
//#endregion
|
|
3867
|
+
//#region src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3868
|
+
var gc = ["src", "alt"], _c = {
|
|
3869
|
+
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
3870
|
+
style: { opacity: "0.7" }
|
|
3871
|
+
}, vc = ["href"], yc = ["src", "alt"], bc = ["src", "alt"], xc = {
|
|
3872
|
+
key: 3,
|
|
3873
|
+
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)]"
|
|
3874
|
+
}, Sc = /* @__PURE__ */ F({
|
|
3875
|
+
__name: "VideoBlock",
|
|
3876
|
+
props: {
|
|
3877
|
+
block: {},
|
|
3878
|
+
viewport: {}
|
|
3879
|
+
},
|
|
3880
|
+
setup(e) {
|
|
3881
|
+
let r = e, { t: i } = nn(), { syntax: a } = xn(), o = N(() => Ae(r.block.url, a) || Ae(r.block.thumbnailUrl, a)), s = jn(() => o.value ? void 0 : r.block.thumbnailUrl || void 0), c = jn(() => o.value ? r.block.placeholderUrl : void 0), l = N(() => o.value ? null : r.block.thumbnailUrl ? s.value ?? null : hc(r.block.url)), u = N(() => ({ textAlign: r.block.align })), d = N(() => {
|
|
3882
|
+
let e = r.block.align;
|
|
3883
|
+
return {
|
|
3884
|
+
maxWidth: "100%",
|
|
3885
|
+
width: r.block.width === "full" ? "100%" : `${r.block.width}px`,
|
|
3886
|
+
height: r.block.height ? `${r.block.height}px` : void 0,
|
|
3887
|
+
display: "block",
|
|
3888
|
+
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
3889
|
+
marginRight: e === "center" ? "auto" : void 0
|
|
3890
|
+
};
|
|
3891
|
+
}), f = N(() => ({ height: r.block.height ? `${r.block.height}px` : void 0 })), p = N(() => Ae(r.block.url, a) ? r.block.url : r.block.thumbnailUrl);
|
|
3892
|
+
return (r, a) => (t(), S("div", {
|
|
3893
|
+
class: "tpl:w-full",
|
|
3894
|
+
style: n(u.value)
|
|
3895
|
+
}, [o.value && e.block.placeholderUrl ? (t(), S("div", {
|
|
3896
|
+
key: 0,
|
|
3897
|
+
class: "tpl:relative tpl:inline-block",
|
|
3898
|
+
style: n(d.value)
|
|
3899
|
+
}, [x("img", {
|
|
3900
|
+
class: "tpl:w-full tpl:border-0",
|
|
3901
|
+
src: y(c),
|
|
3902
|
+
alt: e.block.alt,
|
|
3903
|
+
style: n(f.value)
|
|
3904
|
+
}, null, 12, gc), C(pc)], 4)) : o.value ? (t(), S("div", {
|
|
3905
|
+
key: 1,
|
|
3906
|
+
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)]",
|
|
3907
|
+
style: n([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, d.value])
|
|
3908
|
+
}, [C(y(kr), {
|
|
3909
|
+
size: 36,
|
|
3910
|
+
"stroke-width": 1.5,
|
|
3911
|
+
class: "tpl:text-[var(--tpl-primary)]",
|
|
3912
|
+
style: { opacity: "0.5" }
|
|
3913
|
+
}), x("span", _c, [C(br, { text: p.value }, null, 8, ["text"])])], 4)) : l.value ? (t(), S(M, { key: 2 }, [e.block.url ? (t(), S("a", {
|
|
3914
|
+
key: 0,
|
|
3915
|
+
href: e.block.url,
|
|
3916
|
+
target: "_blank",
|
|
3917
|
+
rel: "noopener noreferrer",
|
|
3918
|
+
class: "tpl:group tpl:relative tpl:inline-block",
|
|
3919
|
+
style: n(d.value),
|
|
3920
|
+
onClick: a[0] ||= I(() => {}, ["prevent"])
|
|
3921
|
+
}, [x("img", {
|
|
3922
|
+
class: "tpl:w-full tpl:border-0",
|
|
3923
|
+
src: l.value,
|
|
3924
|
+
alt: e.block.alt,
|
|
3925
|
+
style: n(f.value)
|
|
3926
|
+
}, null, 12, yc), C(pc, { "hover-effect": "" })], 12, vc)) : (t(), S("div", {
|
|
3927
|
+
key: 1,
|
|
3928
|
+
class: "tpl:relative tpl:inline-block",
|
|
3929
|
+
style: n(d.value)
|
|
3930
|
+
}, [x("img", {
|
|
3931
|
+
class: "tpl:w-full tpl:border-0",
|
|
3932
|
+
src: l.value,
|
|
3933
|
+
alt: e.block.alt,
|
|
3934
|
+
style: n(f.value)
|
|
3935
|
+
}, null, 12, bc), C(pc)], 4))], 64)) : (t(), S("div", xc, [C(y(kr), {
|
|
3936
|
+
size: 40,
|
|
3937
|
+
"stroke-width": 1.5,
|
|
3938
|
+
class: "tpl:text-[var(--tpl-border-light)]"
|
|
3939
|
+
}), x("span", null, D(y(i).video.addVideo), 1)]))], 4));
|
|
3940
|
+
}
|
|
3941
|
+
}), Cc = {
|
|
3942
|
+
section: Xs,
|
|
3943
|
+
title: ra,
|
|
3944
|
+
paragraph: Ri,
|
|
3945
|
+
image: Ti,
|
|
3946
|
+
button: Sr,
|
|
3947
|
+
divider: oi,
|
|
3948
|
+
video: Sc,
|
|
3949
|
+
social: rc,
|
|
3950
|
+
menu: ki,
|
|
3951
|
+
table: fc,
|
|
3952
|
+
spacer: oc,
|
|
3953
|
+
html: fi,
|
|
3954
|
+
countdown: v(() => import("./CountdownBlock-DSvbf3qU.js"))
|
|
3955
|
+
};
|
|
3956
|
+
function wc(t) {
|
|
3957
|
+
let { editor: n, config: r, translations: i, fontsManager: a } = t, { t: o, format: c } = nn(i), l = N(() => se(se(se(Yn(i), hr(n.content.value.settings?.locale)), ge(n.content.value.settings) === "rtl" ? {
|
|
3958
|
+
title: { textAlign: "right" },
|
|
3959
|
+
table: { textAlign: "right" }
|
|
3960
|
+
} : {}), r.blockDefaults ?? {}));
|
|
3961
|
+
n.setUiTheme(r.uiTheme ?? "auto");
|
|
3962
|
+
let { resolvedTheme: u } = Ln(N(() => n.state.uiTheme)), d = _(r.theme ?? {}), { themeStyles: p } = zn({
|
|
3963
|
+
themeOverrides: d,
|
|
3964
|
+
resolvedTheme: u,
|
|
3965
|
+
extraStyles: () => ({
|
|
3966
|
+
"--tpl-drop-text": `"${i.canvas.dropHere}"`,
|
|
3967
|
+
...t.themeExtraStyles?.()
|
|
3968
|
+
})
|
|
3969
|
+
}), m = Ve({
|
|
3970
|
+
content: n.content,
|
|
3971
|
+
setContent: (e, t) => n.setContent(e, t),
|
|
3972
|
+
...t.historyOptions
|
|
3973
|
+
});
|
|
3974
|
+
tt(n, m);
|
|
3975
|
+
let g = He({
|
|
3976
|
+
addBlock: n.addBlock,
|
|
3977
|
+
removeBlock: n.removeBlock,
|
|
3978
|
+
updateBlock: n.updateBlock,
|
|
3979
|
+
selectBlock: n.selectBlock,
|
|
3980
|
+
findBlockLocation: n.findBlockLocation,
|
|
3981
|
+
blockDefaults: () => l.value
|
|
3982
|
+
}), v = We(n), y = t.autoSaveOptions !== null && t.autoSaveOptions !== void 0 ? qe({
|
|
3983
|
+
content: n.content,
|
|
3984
|
+
isDirty: () => n.state.isDirty,
|
|
3985
|
+
...t.autoSaveOptions
|
|
3986
|
+
}) : null, b = null;
|
|
3987
|
+
y && (b = f(m.isNavigating, (e) => {
|
|
3988
|
+
e ? y.pause() : y.resume();
|
|
3989
|
+
}));
|
|
3990
|
+
let x = In(n, {
|
|
3991
|
+
t: o,
|
|
3992
|
+
format: c
|
|
3993
|
+
}, r.customBlocks ?? []), S = on(r.colors);
|
|
3994
|
+
if (S.allowCustomIgnored && rn.warn("config.colors.allowCustom: false is ignored without presets — keeping the color wheel and hex input so a color can still be chosen."), S.invalidPresets.length > 0 && rn.warn(`config.colors.presets skipped invalid entries: ${S.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), S.allowCustom === !1) {
|
|
3995
|
+
let e = Jn(S.presets, r.blockDefaults, r.templateDefaults);
|
|
3996
|
+
e.length > 0 && rn.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.`);
|
|
3997
|
+
}
|
|
3998
|
+
let C = ln(r.templateSettings);
|
|
3999
|
+
for (let e of C.unknown) rn.warn(`config.templateSettings.fields: "${e}" is not a template setting (expected one of ${un.join(", ")}) — skipping it.`);
|
|
4000
|
+
let w = Bn();
|
|
4001
|
+
Gn(w, Cc);
|
|
4002
|
+
let T = /* @__PURE__ */ new Set();
|
|
4003
|
+
function D(e) {
|
|
4004
|
+
for (let t of e) {
|
|
4005
|
+
w.registerCustom(t, ii);
|
|
4006
|
+
for (let e of gr(t, S)) T.has(e.id) || (T.add(e.id), rn.warn(e.message));
|
|
4007
|
+
}
|
|
4008
|
+
}
|
|
4009
|
+
r.customBlocks?.length && D(r.customBlocks);
|
|
4010
|
+
let O = Dn();
|
|
4011
|
+
if (h() && s(O.dispose), t.containerEl) {
|
|
4012
|
+
let e = t.containerEl;
|
|
4013
|
+
st(document, "pointerdown", (t) => {
|
|
4014
|
+
let n = e.value;
|
|
4015
|
+
n && (t.composedPath?.() ?? []).includes(n) && O.claim();
|
|
4016
|
+
}, { capture: !0 });
|
|
4017
|
+
}
|
|
4018
|
+
function k() {
|
|
4019
|
+
let e = t.capabilities?.templates;
|
|
4020
|
+
if (e) {
|
|
4021
|
+
e.save();
|
|
4022
|
+
return;
|
|
4023
|
+
}
|
|
4024
|
+
y?.flush();
|
|
4025
|
+
}
|
|
4026
|
+
function A(e) {
|
|
4027
|
+
O.isActive() && vr(e, {
|
|
4028
|
+
history: m,
|
|
4029
|
+
selectBlock: (e) => n.selectBlock(e),
|
|
4030
|
+
getSelectedBlockId: () => n.state.selectedBlockId,
|
|
4031
|
+
removeBlock: (e) => n.removeBlock(e),
|
|
4032
|
+
onSave: k,
|
|
4033
|
+
onBeforeUndo: t.keyboardOptions?.onBeforeUndo,
|
|
4034
|
+
isPicking: () => t.capabilities?.savedBlocks?.isPicking.value === !0,
|
|
4035
|
+
onConfirmPick: () => t.capabilities?.savedBlocks?.confirmPicking(),
|
|
4036
|
+
onCancelPick: () => t.capabilities?.savedBlocks?.cancelPicking()
|
|
4037
|
+
});
|
|
4038
|
+
}
|
|
4039
|
+
st(document, "keydown", A);
|
|
4040
|
+
let j = _(null);
|
|
4041
|
+
E(Nt, t.editorRoot ?? document), E(tn, j), E(Jt, i), E(zt, n), E(en, m), E(Pt, g), E(Rt, v), E(Zt, a), E(yt, p), E(jt, u), E(Kt, l), E(vt, r.locale), E(Xt, w), E(qt, r.customBlocks ?? []), E(Tt, r.paletteBlocks), E(Ft, Kn(r.htmlBlockPreview)), E(Lt, S), E(gt, C.fields), E(Wt, Vn(n.content, w));
|
|
4042
|
+
let M = be(r.mergeTags?.syntax), ee = e(r.mergeTags?.tags ?? []);
|
|
4043
|
+
function P(e) {
|
|
4044
|
+
if (!Array.isArray(e)) {
|
|
4045
|
+
rn.warn(`setMergeTags() expects an array of merge tags, received ${typeof e} — ignoring.`);
|
|
4046
|
+
return;
|
|
4047
|
+
}
|
|
4048
|
+
ee.value = e;
|
|
4049
|
+
}
|
|
4050
|
+
E(pt, ee), E(St, M), E(bt, r.mergeTags?.onRequest ?? null), E(Ct, r.mergeTags?.autocomplete !== !1), E(xt, r.mergeTags?.showRawValue !== !1);
|
|
4051
|
+
let F = _(pe(r.mergeTags?.tags ?? []));
|
|
4052
|
+
E(Vt, F);
|
|
4053
|
+
let te = kn({
|
|
4054
|
+
resolvePreview: r.resolvePreview,
|
|
4055
|
+
getContent: () => n.content.value,
|
|
4056
|
+
isActive: () => n.state.previewMode
|
|
4057
|
+
});
|
|
4058
|
+
E(dt, te), E(Ot, r.resolvePreview);
|
|
4059
|
+
let I = N(() => !(n.state.previewMode && te.isConfigured));
|
|
4060
|
+
E(Yt, I);
|
|
4061
|
+
let ne = Mn();
|
|
4062
|
+
E(Ht, ne), E(ut, _(!1)), E(mt, _(!1)), E(Qt, r.logicTags?.tags ?? []), E(ft, r.logicTags?.pairs ?? []), E(ht, r.logicTags?.onRequest ?? null), E(Dt, Nn()), E(_t, r.onRequestMedia ?? null), E(It, r.canDropMedia ?? null), E($t, r.resolveImageUrl ? An(r.resolveImageUrl) : null), E(Bt, r.displayConditions?.conditions ?? []), E(Gt, r.displayConditions?.allowCustom ?? !1), E(Ut, t.capabilities ?? {}), E(Et, x);
|
|
4063
|
+
let re = Pn(r.lint) ? null : Fn({
|
|
4064
|
+
content: n.content,
|
|
4065
|
+
options: r.lint ?? {},
|
|
4066
|
+
updateBlock: n.updateBlock,
|
|
4067
|
+
updateSettings: n.updateSettings,
|
|
4068
|
+
removeBlock: n.removeBlock
|
|
4069
|
+
});
|
|
4070
|
+
E(kt, re);
|
|
4071
|
+
function ie() {
|
|
4072
|
+
b?.(), re?.destroy(), y?.destroy(), m.destroy();
|
|
4073
|
+
}
|
|
4074
|
+
return {
|
|
4075
|
+
t: o,
|
|
4076
|
+
format: c,
|
|
4077
|
+
history: m,
|
|
4078
|
+
blockActions: g,
|
|
4079
|
+
conditionPreview: v,
|
|
4080
|
+
autoSave: y,
|
|
4081
|
+
resolvedTheme: u,
|
|
4082
|
+
themeStyles: p,
|
|
4083
|
+
themeOverrides: d,
|
|
4084
|
+
registry: w,
|
|
4085
|
+
keyboardReorder: x,
|
|
4086
|
+
templateLint: re,
|
|
4087
|
+
popoverRoot: j,
|
|
4088
|
+
mergeTagSampleMode: F,
|
|
4089
|
+
previewResolution: te,
|
|
4090
|
+
appliesConditionFilter: I,
|
|
4091
|
+
registerCustomBlocks: D,
|
|
4092
|
+
setMergeTags: P,
|
|
4093
|
+
destroy: ie
|
|
4094
|
+
};
|
|
4095
|
+
}
|
|
4096
|
+
//#endregion
|
|
4097
|
+
export { rr as A, Fr as C, Tr as D, Dr as E, sr as F, or as I, kn as L, ur as M, lr as N, Cr as O, cr as P, Br as S, Mr as T, oi as _, rc as a, qr as b, ra as c, zi as d, Bi as f, fi as g, Ti as h, oc as i, dr as j, Sr as k, ta as l, ki as m, Sc as n, Xs as o, Ri as p, fc as r, Ks as s, wc as t, Vi as u, ii as v, Pr as w, Gr as x, Yr as y };
|