@templatical/editor 0.61.0 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -109
- package/README.md +3 -3
- package/dist/{AiAltTextPopover-DSA1wiiW.js → AiAltTextPopover-C1Ike67q.js} +3 -4
- package/dist/{AiAltTextReview-B9-vfzCj.js → AiAltTextReview-BjT7_PoG.js} +2 -3
- package/dist/{AiChatPanel-DF5TvO9H.js → AiChatPanel-C82fJozf.js} +3 -4
- package/dist/{AiPanels-zRqC5DIP.js → AiPanels-sam_GMNs.js} +1 -1
- package/dist/{AiRewriteMenu-CmZKTO-O.js → AiRewriteMenu-CpBcT6QL.js} +3 -4
- package/dist/{BlockIssueBadge-Bug5iqcK.js → BlockIssueBadge-D3OmWkCh.js} +2 -3
- package/dist/{BlockPreviewCanvas-knSyWaCP.js → BlockPreviewCanvas-BHRmnq0w.js} +6 -6
- package/dist/{CollaborationNotices-BM35YG72.js → CollaborationNotices-Cmc7Ziuf.js} +1 -1
- package/dist/{CollaboratorBar-DMsEOndt.js → CollaboratorBar-DVtWefk1.js} +1 -1
- package/dist/{CommentsPanel-BMYvXRKK.js → CommentsPanel-BSt22Zw9.js} +1 -1
- package/dist/{cdn/chunks/CommentsSidebar-BEiOQ_zT.js → CommentsSidebar-C8qbxjyN.js} +228 -205
- package/dist/{CountdownBlock-AYPypmcX.js → CountdownBlock-bFAELCB6.js} +3 -4
- package/dist/{CountdownToolbar-BprSuPJk.js → CountdownToolbar-CJbPEVV5.js} +4 -4
- package/dist/{IssuesPanel-CeCvUfa7.js → IssuesPanel-CKYf6K84.js} +4 -5
- package/dist/{LanguageMenu-CkGqLYjf.js → LanguageMenu-BFOEQEPy.js} +5 -6
- package/dist/{LocaleNotices-D0be8ovO.js → LocaleNotices-24UYFxo2.js} +7 -8
- package/dist/{LogicTagInsertButton-BzEZUTRZ.js → LogicTagInsertButton-DdaafrjI.js} +95 -96
- package/dist/{MergeTagInput-By2FSStk.js → MergeTagInput-BXM6-eF-.js} +1 -1
- package/dist/{MergeTagModeToggle-DtjOZhoD.js → MergeTagModeToggle-ooA_Ytfq.js} +2 -3
- package/dist/{MergeTagTextarea-BjHlamJv.js → MergeTagTextarea-B86MPY89.js} +3 -4
- package/dist/{ParagraphEditor-Ctu4fSsl.js → ParagraphEditor-C15Glzy_.js} +78 -79
- package/dist/{RestoreVersionDialog-DvZoTJVa.js → RestoreVersionDialog-C13Bo4b0.js} +2 -2
- package/dist/{RichTextEditorContent-B1p7Ykq8.js → RichTextEditorContent-BNMBOkdy.js} +5 -6
- package/dist/{SaveBlockDialog-DHfT-Tpx.js → SaveBlockDialog-lm_1-2w2.js} +23 -24
- package/dist/{SavedBlocksBrowserModal-BjJuuXQv.js → SavedBlocksBrowserModal-BjUZG5_S.js} +8 -9
- package/dist/{SavedBlocksPanels-D6eiMQZ3.js → SavedBlocksPanels-Bj3LAXcL.js} +1 -1
- package/dist/{SavedBlocksPickBar-BkgCDSXe.js → SavedBlocksPickBar-DOTr0Imx.js} +2 -2
- package/dist/{TemplateSettings-DQAbNsiS.js → TemplateSettings-Z-i-_xF5.js} +19 -20
- package/dist/{TestEmailModal-m_AEa36T.js → TestEmailModal-ClEnoNEB.js} +17 -18
- package/dist/{TestEmailPanel-OApkuaVd.js → TestEmailPanel-CVmrt-d9.js} +1 -1
- package/dist/{TitleEditor-Cwdtfk15.js → TitleEditor-BHZF5C6q.js} +8 -9
- package/dist/{Toolbar-D_T55elL.js → Toolbar-bwAdFK4A.js} +308 -310
- package/dist/{TplModal-2MKm5y6r.js → TplModal-QWmSO1nR.js} +4 -4
- package/dist/{VersionHistoryMenu-B3-xJ7GO.js → VersionHistoryMenu-qoOkZKal.js} +6 -7
- package/dist/{VersionHistoryPanels-CCM0IQBg.js → VersionHistoryPanels-D82hgc2v.js} +1 -1
- package/dist/{VersionPreviewBanner-DLAB4ZbS.js → VersionPreviewBanner-DEN9rl6y.js} +1 -1
- package/dist/{WrapperBlock-BZl10HLy.js → WrapperBlock-32v93A9w.js} +4 -4
- package/dist/{blockTypeIcons-C691ZY1l.js → blockTypeIcons-C1S2wVx8.js} +4 -4
- package/dist/bundle-stats.json +8 -8
- package/dist/{ca-C8N05sCU.js → ca-BIseSbs-.js} +1 -2
- package/dist/cdn/chunks/{AiAltTextPopover-BLNN_Pnd.js → AiAltTextPopover-mDx_knAl.js} +4 -5
- package/dist/cdn/chunks/{AiAltTextPopover-BLNN_Pnd.js.map → AiAltTextPopover-mDx_knAl.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-Db8vSNpe.js → AiAltTextReview-Dmg8iVWD.js} +3 -4
- package/dist/cdn/chunks/{AiAltTextReview-Db8vSNpe.js.map → AiAltTextReview-Dmg8iVWD.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-BYAsgmoC.js → AiChatPanel-CEDr_x8G.js} +4 -5
- package/dist/cdn/chunks/{AiChatPanel-BYAsgmoC.js.map → AiChatPanel-CEDr_x8G.js.map} +1 -1
- package/dist/cdn/chunks/{AiPanels-MY_YPls8.js → AiPanels-qJgLTYPs.js} +2 -2
- package/dist/cdn/chunks/{AiPanels-MY_YPls8.js.map → AiPanels-qJgLTYPs.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-BSePiXe_.js → AiRewriteMenu-2a9WjizC.js} +4 -5
- package/dist/cdn/chunks/{AiRewriteMenu-BSePiXe_.js.map → AiRewriteMenu-2a9WjizC.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-fYeNnepj.js → BlockIssueBadge-D87CYoPw.js} +3 -4
- package/dist/cdn/chunks/{BlockIssueBadge-fYeNnepj.js.map → BlockIssueBadge-D87CYoPw.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-B153A3hu.js → BlockPreviewCanvas-DDDKuWJz.js} +8 -8
- package/dist/cdn/chunks/{BlockPreviewCanvas-B153A3hu.js.map → BlockPreviewCanvas-DDDKuWJz.js.map} +1 -1
- package/dist/cdn/chunks/{CollaborationNotices-COkmBmps.js → CollaborationNotices-DyzhN_Ns.js} +2 -2
- package/dist/cdn/chunks/{CollaborationNotices-COkmBmps.js.map → CollaborationNotices-DyzhN_Ns.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-BSzI8YIU.js → CollaboratorBar-bNFuQxxP.js} +2 -2
- package/dist/cdn/chunks/{CollaboratorBar-BSzI8YIU.js.map → CollaboratorBar-bNFuQxxP.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-R27fqh9O.js → CommentsPanel-D-D2qsS6.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-R27fqh9O.js.map → CommentsPanel-D-D2qsS6.js.map} +1 -1
- package/dist/cdn/chunks/CommentsSidebar-CCVp8M2T.js +479 -0
- package/dist/cdn/chunks/CommentsSidebar-CCVp8M2T.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock--hlKE2aj.js → CountdownBlock-5hUzymeP.js} +4 -5
- package/dist/cdn/chunks/{CountdownBlock--hlKE2aj.js.map → CountdownBlock-5hUzymeP.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-DOhXnbsq.js → CountdownToolbar-DaGxwKfG.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-DOhXnbsq.js.map → CountdownToolbar-DaGxwKfG.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-DgxiS3hF.js → IssuesPanel-DQQo1B1z.js} +10 -11
- package/dist/cdn/chunks/IssuesPanel-DQQo1B1z.js.map +1 -0
- package/dist/cdn/chunks/{LanguageMenu-B6kt8SgX.js → LanguageMenu-2Er64H2b.js} +6 -7
- package/dist/cdn/chunks/{LanguageMenu-B6kt8SgX.js.map → LanguageMenu-2Er64H2b.js.map} +1 -1
- package/dist/cdn/chunks/{LocaleNotices-Bleg4gTu.js → LocaleNotices-DSfOyyyf.js} +8 -9
- package/dist/cdn/chunks/{LocaleNotices-Bleg4gTu.js.map → LocaleNotices-DSfOyyyf.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-DGg1Wvhp.js → LogicTagInsertButton-CumMM1rP.js} +7 -8
- package/dist/cdn/chunks/{LogicTagInsertButton-DGg1Wvhp.js.map → LogicTagInsertButton-CumMM1rP.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-BVfTwujW.js → MergeTagInput-Dm_QiG96.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-BVfTwujW.js.map → MergeTagInput-Dm_QiG96.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BoI0C1Y6.js → MergeTagModeToggle-Bir7lkLe.js} +3 -4
- package/dist/cdn/chunks/{MergeTagModeToggle-BoI0C1Y6.js.map → MergeTagModeToggle-Bir7lkLe.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-DGDv-pdn.js → MergeTagTextarea-B_IFeWfZ.js} +4 -5
- package/dist/cdn/chunks/{MergeTagTextarea-DGDv-pdn.js.map → MergeTagTextarea-B_IFeWfZ.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-D0q36Myd.js → ParagraphEditor-CWjMxuy0.js} +135 -136
- package/dist/cdn/chunks/{ParagraphEditor-D0q36Myd.js.map → ParagraphEditor-CWjMxuy0.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-CJggFdbi.js → RestoreVersionDialog-BsfulSK7.js} +3 -3
- package/dist/cdn/chunks/{RestoreVersionDialog-CJggFdbi.js.map → RestoreVersionDialog-BsfulSK7.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-D3ihUF8v.js → RichTextEditorContent-CuvFVxEq.js} +6 -7
- package/dist/cdn/chunks/{RichTextEditorContent-D3ihUF8v.js.map → RichTextEditorContent-CuvFVxEq.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-BzES5tqd.js → SaveBlockDialog-8zxJlHw2.js} +25 -26
- package/dist/cdn/chunks/{SaveBlockDialog-BzES5tqd.js.map → SaveBlockDialog-8zxJlHw2.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CLNcZcLd.js → SavedBlocksBrowserModal-DtaGW2H4.js} +9 -10
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CLNcZcLd.js.map → SavedBlocksBrowserModal-DtaGW2H4.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-R0W9LElD.js → SavedBlocksPanels-CtDhdbiD.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-R0W9LElD.js.map → SavedBlocksPanels-CtDhdbiD.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-JNi5Rx4V.js → SavedBlocksPickBar-DovcCaoW.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPickBar-JNi5Rx4V.js.map → SavedBlocksPickBar-DovcCaoW.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-C5wsNcgX.js → TemplateSettings-B8Ch5ps8.js} +20 -21
- package/dist/cdn/chunks/{TemplateSettings-C5wsNcgX.js.map → TemplateSettings-B8Ch5ps8.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-BxIAwjww.js → TestEmailModal-D1EuQSgA.js} +16 -17
- package/dist/cdn/chunks/{TestEmailModal-BxIAwjww.js.map → TestEmailModal-D1EuQSgA.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-B8BsWXjE.js → TestEmailPanel-0iG-utN7.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-B8BsWXjE.js.map → TestEmailPanel-0iG-utN7.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DhcI1aRS.js → TitleEditor-k2vSwKxN.js} +17 -18
- package/dist/cdn/chunks/{TitleEditor-DhcI1aRS.js.map → TitleEditor-k2vSwKxN.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-Ch3h2BUs.js → Toolbar-BnTSuZQb.js} +310 -312
- package/dist/cdn/chunks/Toolbar-BnTSuZQb.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-CPOqOxVf.js → TplModal-iRdN04Sa.js} +5 -5
- package/dist/cdn/chunks/{TplModal-CPOqOxVf.js.map → TplModal-iRdN04Sa.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-DTDO48HI.js → VersionHistoryMenu-DlPr3twf.js} +7 -8
- package/dist/cdn/chunks/{VersionHistoryMenu-DTDO48HI.js.map → VersionHistoryMenu-DlPr3twf.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-CVrXHYxT.js → VersionHistoryPanels-Bw5UHEvo.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-CVrXHYxT.js.map → VersionHistoryPanels-Bw5UHEvo.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-C1H_fYAr.js → VersionPreviewBanner-anJgZOcw.js} +2 -2
- package/dist/cdn/chunks/VersionPreviewBanner-anJgZOcw.js.map +1 -0
- package/dist/cdn/chunks/{WrapperBlock-B8SJ7Q4w.js → WrapperBlock-CFjCtyvx.js} +5 -5
- package/dist/cdn/chunks/{WrapperBlock-B8SJ7Q4w.js.map → WrapperBlock-CFjCtyvx.js.map} +1 -1
- package/dist/cdn/chunks/{ca-C8N05sCU.js → ca-BIseSbs-.js} +2 -3
- package/dist/cdn/chunks/{ca-C8N05sCU.js.map → ca-BIseSbs-.js.map} +1 -1
- package/dist/cdn/chunks/{composables-CKXPwWo9.js → composables-Nir0umYc.js} +444 -464
- package/dist/cdn/chunks/composables-Nir0umYc.js.map +1 -0
- package/dist/{da-Dno_4nGy.js → cdn/chunks/da-DN46iRXS.js} +3 -2
- package/dist/cdn/chunks/{da-Dno_4nGy.js.map → da-DN46iRXS.js.map} +1 -1
- package/dist/{de-DRR5JSkh.js → cdn/chunks/de-Dyk8PPCm.js} +3 -2
- package/dist/cdn/chunks/{de-DRR5JSkh.js.map → de-Dyk8PPCm.js.map} +1 -1
- package/dist/{en-DAcLbbpg.js → cdn/chunks/en-BzMbMmgz.js} +3 -2
- package/dist/cdn/chunks/{en-DAcLbbpg.js.map → en-BzMbMmgz.js.map} +1 -1
- package/dist/{es-BcEQLQxe.js → cdn/chunks/es-KSHEXYyf.js} +3 -2
- package/dist/cdn/chunks/{es-BcEQLQxe.js.map → es-KSHEXYyf.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-Bq9nXmBP.js → extensions-Br2hHeiR.js} +5 -5
- package/dist/cdn/chunks/{extensions-Bq9nXmBP.js.map → extensions-Br2hHeiR.js.map} +1 -1
- package/dist/{fr-CNQG7ESr.js → cdn/chunks/fr-DtKHfZyk.js} +3 -2
- package/dist/cdn/chunks/{fr-CNQG7ESr.js.map → fr-DtKHfZyk.js.map} +1 -1
- package/dist/{ja-CMxWxqSH.js → cdn/chunks/ja-DUSaDVPA.js} +3 -2
- package/dist/cdn/chunks/{ja-CMxWxqSH.js.map → ja-DUSaDVPA.js.map} +1 -1
- package/dist/{nl-BjyYZDkC.js → cdn/chunks/nl-DQbuxzD6.js} +3 -2
- package/dist/cdn/chunks/{nl-BjyYZDkC.js.map → nl-DQbuxzD6.js.map} +1 -1
- package/dist/{pt-BR-DC2A3C0v.js → cdn/chunks/pt-BR-CxpxBtvc.js} +3 -2
- package/dist/cdn/chunks/{pt-BR-DC2A3C0v.js.map → pt-BR-CxpxBtvc.js.map} +1 -1
- package/dist/cdn/chunks/rolldown-runtime-CGnMp29N.js +10 -0
- package/dist/cdn/chunks/{socialIcons-CSe4YJ52.js → socialIcons-CXQfKLUV.js} +156 -136
- package/dist/cdn/chunks/socialIcons-CXQfKLUV.js.map +1 -0
- package/dist/cdn/chunks/{src-Bk1LF1np.js → src-9e0wFfHH.js} +4 -2
- package/dist/cdn/chunks/src-9e0wFfHH.js.map +1 -0
- package/dist/cdn/chunks/src-A0kzK-pR.js.map +1 -1
- package/dist/cdn/chunks/{src-edESkGqO.js → src-C9jjLNMg.js} +2 -2
- package/dist/cdn/chunks/{src-edESkGqO.js.map → src-C9jjLNMg.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-DDhueoan.js → tiptap-DLW5XdqI.js} +2 -2
- package/dist/cdn/chunks/{tiptap-DDhueoan.js.map → tiptap-DLW5XdqI.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorRoot-D0Lp2x4_.js → useEditorRoot-BPVxLYFD.js} +2 -2
- package/dist/cdn/chunks/{useEditorRoot-D0Lp2x4_.js.map → useEditorRoot-BPVxLYFD.js.map} +1 -1
- package/dist/cdn/chunks/useI18n-DwP1ksBW.js +24 -0
- package/dist/cdn/chunks/{keys-ywH4jHJ2.js.map → useI18n-DwP1ksBW.js.map} +1 -1
- package/dist/cdn/chunks/{useLanguageName-DDhdVpqh.js → useLanguageName-CeuoO9WZ.js} +2 -2
- package/dist/cdn/chunks/{useLanguageName-DDhdVpqh.js.map → useLanguageName-CeuoO9WZ.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-CKtQlJDa.js → useLogicTag-gphGbQfy.js} +3 -3
- package/dist/cdn/chunks/{useLogicTag-CKtQlJDa.js.map → useLogicTag-gphGbQfy.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-Dwy3U0PI.js → useMergeTag-QM-tkBc6.js} +3 -3
- package/dist/cdn/chunks/{useMergeTag-Dwy3U0PI.js.map → useMergeTag-QM-tkBc6.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-CBp9uwjV.js → usePopoverPosition-Cg8LR0W4.js} +2 -2
- package/dist/cdn/chunks/{usePopoverPosition-CBp9uwjV.js.map → usePopoverPosition-Cg8LR0W4.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-32EnuMwu.js → useScrollToBlock-CS7zo4oQ.js} +2 -2
- package/dist/cdn/chunks/{useScrollToBlock-32EnuMwu.js.map → useScrollToBlock-CS7zo4oQ.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +877 -975
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{composables-26aR45W3.js → composables-6SKZrQs-.js} +817 -837
- package/dist/{cdn/chunks/da-Dno_4nGy.js → da-DN46iRXS.js} +1 -4
- package/dist/{cdn/chunks/de-DRR5JSkh.js → de-Dyk8PPCm.js} +1 -4
- package/dist/{cdn/chunks/en-DAcLbbpg.js → en-BzMbMmgz.js} +1 -4
- package/dist/{cdn/chunks/es-BcEQLQxe.js → es-KSHEXYyf.js} +1 -4
- package/dist/{extensions-zHf8YFRw.js → extensions-D74nAP73.js} +3 -3
- package/dist/{cdn/chunks/fr-CNQG7ESr.js → fr-DtKHfZyk.js} +1 -4
- package/dist/index.d.ts +33 -405
- package/dist/{cdn/chunks/ja-CMxWxqSH.js → ja-DUSaDVPA.js} +1 -4
- package/dist/{cdn/chunks/nl-BjyYZDkC.js → nl-DQbuxzD6.js} +1 -4
- package/dist/{cdn/chunks/pt-BR-DC2A3C0v.js → pt-BR-CxpxBtvc.js} +1 -4
- package/dist/{socialIcons-mWE33bOn.js → socialIcons-K89pe-h2.js} +84 -64
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +1060 -1158
- package/dist/{useEditorRoot-DWfC2CVC.js → useEditorRoot-CQeutW_s.js} +1 -1
- package/dist/useI18n-B05qsAsl.js +22 -0
- package/dist/{useLanguageName-CEFzafHB.js → useLanguageName-CnpG7FD5.js} +1 -1
- package/dist/{useLogicTag-K5CPoMTk.js → useLogicTag-DSa1si4o.js} +2 -2
- package/dist/{useMergeTag-tsU_Sw2x.js → useMergeTag-DwxbvRZI.js} +2 -2
- package/dist/{usePopoverPosition-DF0ZYH7g.js → usePopoverPosition-B8CXTr8v.js} +1 -1
- package/dist/{useScrollToBlock-eZXiGa8o.js → useScrollToBlock-ZZBBGFan.js} +1 -1
- package/package.json +11 -13
- package/dist/CloudHeaderExtras-DC_oNrxz.js +0 -22
- package/dist/CloudPanels-BbHJHZri.js +0 -167
- package/dist/CommentsSidebar-_8at1Rug.js +0 -516
- package/dist/cdn/chunks/CloudHeaderExtras-Cd-ePldd.js +0 -24
- package/dist/cdn/chunks/CloudHeaderExtras-Cd-ePldd.js.map +0 -1
- package/dist/cdn/chunks/CloudPanels-Bv26_Sd8.js +0 -167
- package/dist/cdn/chunks/CloudPanels-Bv26_Sd8.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-BEiOQ_zT.js.map +0 -1
- package/dist/cdn/chunks/IssuesPanel-DgxiS3hF.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-Ch3h2BUs.js.map +0 -1
- package/dist/cdn/chunks/VersionPreviewBanner-C1H_fYAr.js.map +0 -1
- package/dist/cdn/chunks/composables-CKXPwWo9.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-CUlw09ix.js +0 -1405
- package/dist/cdn/chunks/createCloudRuntime-CUlw09ix.js.map +0 -1
- package/dist/cdn/chunks/de-6M4JoHoD.js +0 -21
- package/dist/cdn/chunks/de-6M4JoHoD.js.map +0 -1
- package/dist/cdn/chunks/en-FzUuJ8HW.js +0 -21
- package/dist/cdn/chunks/en-FzUuJ8HW.js.map +0 -1
- package/dist/cdn/chunks/keys-ywH4jHJ2.js +0 -11
- package/dist/cdn/chunks/logger-CqQTfJGx.js +0 -26
- package/dist/cdn/chunks/logger-CqQTfJGx.js.map +0 -1
- package/dist/cdn/chunks/preRenderCustomBlocks-BLVFtvl8.js +0 -22
- package/dist/cdn/chunks/preRenderCustomBlocks-BLVFtvl8.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-Bp92Fc6J.js +0 -21
- package/dist/cdn/chunks/pt-BR-Bp92Fc6J.js.map +0 -1
- package/dist/cdn/chunks/pusher-x9rNqzon.js +0 -2473
- package/dist/cdn/chunks/pusher-x9rNqzon.js.map +0 -1
- package/dist/cdn/chunks/rolldown-runtime-QGRDbDUS.js +0 -19
- package/dist/cdn/chunks/socialIcons-CSe4YJ52.js.map +0 -1
- package/dist/cdn/chunks/src-Bk1LF1np.js.map +0 -1
- package/dist/cdn/chunks/useCloudI18n-BTV9uu3c.js +0 -24
- package/dist/cdn/chunks/useCloudI18n-BTV9uu3c.js.map +0 -1
- package/dist/cdn/chunks/useI18n-DPg6rPbu.js +0 -18
- package/dist/cdn/chunks/useI18n-DPg6rPbu.js.map +0 -1
- package/dist/createCloudRuntime-CiEo0wkr.js +0 -1389
- package/dist/de-6M4JoHoD.js +0 -19
- package/dist/en-FzUuJ8HW.js +0 -19
- package/dist/keys-B4DimcgX.js +0 -9
- package/dist/logger-BOu7oEtk.js +0 -24
- package/dist/preRenderCustomBlocks-6CLw2rP6.js +0 -20
- package/dist/pt-BR-Bp92Fc6J.js +0 -19
- package/dist/useCloudI18n-BnuOL1YS.js +0 -22
- package/dist/useI18n-Cx9W7OWb.js +0 -16
|
@@ -1,1405 +0,0 @@
|
|
|
1
|
-
import { r as e } from "./rolldown-runtime-QGRDbDUS.js";
|
|
2
|
-
import { H as t, I as n, p as r, tt as i } from "./draggable-IRVFEZ-b.js";
|
|
3
|
-
import { vn as a } from "./src-A0kzK-pR.js";
|
|
4
|
-
import { t as o } from "./preRenderCustomBlocks-BLVFtvl8.js";
|
|
5
|
-
import { t as s } from "./logger-CqQTfJGx.js";
|
|
6
|
-
import { f as c, o as l } from "./keys-ywH4jHJ2.js";
|
|
7
|
-
// ../core/src/cloud/auth.ts
|
|
8
|
-
function u(e) {
|
|
9
|
-
let t = e instanceof a ? e.statusCode : void 0;
|
|
10
|
-
return t !== void 0 && t >= 400 && t < 500;
|
|
11
|
-
}
|
|
12
|
-
var d = class e {
|
|
13
|
-
static DEFAULT_BASE_URL = "https://templatical.com";
|
|
14
|
-
accessToken = null;
|
|
15
|
-
expiresAt = null;
|
|
16
|
-
_projectId = null;
|
|
17
|
-
_tenantId = null;
|
|
18
|
-
_tenantSlug = null;
|
|
19
|
-
_testEmailConfig = null;
|
|
20
|
-
_userConfig = null;
|
|
21
|
-
url;
|
|
22
|
-
baseUrl;
|
|
23
|
-
requestOptions;
|
|
24
|
-
onError;
|
|
25
|
-
refreshPromise = null;
|
|
26
|
-
static REFRESH_THRESHOLD_MS = 6e4;
|
|
27
|
-
constructor(t) {
|
|
28
|
-
this.url = t.url, this.baseUrl = (t.baseUrl ?? e.DEFAULT_BASE_URL).replace(/\/$/, ""), this.requestOptions = t.requestOptions ?? {}, this.onError = t.onError;
|
|
29
|
-
}
|
|
30
|
-
resolveUrl(e) {
|
|
31
|
-
if (e.startsWith("http://") || e.startsWith("https://")) return e;
|
|
32
|
-
let t = e.startsWith("/") ? e : `/${e}`;
|
|
33
|
-
return `${this.baseUrl}${t}`;
|
|
34
|
-
}
|
|
35
|
-
get projectId() {
|
|
36
|
-
if (!this._projectId) throw Error("Project ID not available. Call initialize() first.");
|
|
37
|
-
return this._projectId;
|
|
38
|
-
}
|
|
39
|
-
get tenantId() {
|
|
40
|
-
if (!this._tenantId) throw Error("Tenant ID not available. Call initialize() first.");
|
|
41
|
-
return this._tenantId;
|
|
42
|
-
}
|
|
43
|
-
get tenantSlug() {
|
|
44
|
-
if (!this._tenantSlug) throw Error("Tenant slug not available. Call initialize() first.");
|
|
45
|
-
return this._tenantSlug;
|
|
46
|
-
}
|
|
47
|
-
get testEmailConfig() {
|
|
48
|
-
return this._testEmailConfig;
|
|
49
|
-
}
|
|
50
|
-
get userConfig() {
|
|
51
|
-
return this._userConfig;
|
|
52
|
-
}
|
|
53
|
-
get accessTokenValue() {
|
|
54
|
-
return this.accessToken;
|
|
55
|
-
}
|
|
56
|
-
async initialize() {
|
|
57
|
-
await this.ensureToken();
|
|
58
|
-
}
|
|
59
|
-
async ensureToken() {
|
|
60
|
-
return this.accessToken && !this.isTokenExpiringSoon() ? this.accessToken : this.refreshToken();
|
|
61
|
-
}
|
|
62
|
-
isTokenExpiringSoon() {
|
|
63
|
-
return !this.expiresAt || this.expiresAt.getTime() - Date.now() < e.REFRESH_THRESHOLD_MS;
|
|
64
|
-
}
|
|
65
|
-
async refreshToken() {
|
|
66
|
-
if (this.refreshPromise) return this.refreshPromise;
|
|
67
|
-
this.refreshPromise = this.performRefresh();
|
|
68
|
-
try {
|
|
69
|
-
return await this.refreshPromise;
|
|
70
|
-
} finally {
|
|
71
|
-
this.refreshPromise = null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
async performRefresh() {
|
|
75
|
-
try {
|
|
76
|
-
let e = this.requestOptions.method ?? "POST", t = {
|
|
77
|
-
Accept: "application/json",
|
|
78
|
-
...this.requestOptions.headers
|
|
79
|
-
}, n = {
|
|
80
|
-
method: e,
|
|
81
|
-
headers: t,
|
|
82
|
-
credentials: this.requestOptions.credentials ?? "include"
|
|
83
|
-
};
|
|
84
|
-
e === "POST" && this.requestOptions.body && (t["Content-Type"] = "application/json", n.body = JSON.stringify(this.requestOptions.body));
|
|
85
|
-
let r = await fetch(this.url, n);
|
|
86
|
-
if (!r.ok) throw new a(`Token refresh failed: ${r.status}`, r.status);
|
|
87
|
-
let i = await r.json();
|
|
88
|
-
if (!i.token || !i.expiresAt || !i.projectId || !i.tenant) throw Error("Invalid token response: missing token, expiresAt, projectId, or tenant");
|
|
89
|
-
return this.accessToken = i.token, this.expiresAt = /* @__PURE__ */ new Date(i.expiresAt * 1e3), this._projectId = i.projectId, this._tenantSlug = i.tenant, this._testEmailConfig = i.testEmail?.allowedEmails && i.testEmail?.signature ? {
|
|
90
|
-
allowedEmails: i.testEmail.allowedEmails,
|
|
91
|
-
signature: i.testEmail.signature
|
|
92
|
-
} : null, this._userConfig = i.user?.id && i.user?.name && i.user?.signature ? {
|
|
93
|
-
id: i.user.id,
|
|
94
|
-
name: i.user.name,
|
|
95
|
-
signature: i.user.signature
|
|
96
|
-
} : null, this.accessToken;
|
|
97
|
-
} catch (e) {
|
|
98
|
-
let t = e instanceof Error ? e : Error("Token refresh failed", { cause: e });
|
|
99
|
-
throw this.onError?.(t), t;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
async authenticatedFetch(e, t = {}) {
|
|
103
|
-
let n = await this.ensureToken(), r = this.resolveUrl(e), i = async (e) => fetch(r, {
|
|
104
|
-
...t,
|
|
105
|
-
headers: {
|
|
106
|
-
...t.headers,
|
|
107
|
-
Authorization: `Bearer ${e}`
|
|
108
|
-
}
|
|
109
|
-
}), a = await i(n);
|
|
110
|
-
return a.status === 401 && (a = await i(await this.refreshToken())), a;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
// ../core/src/cloud/url-builder.ts
|
|
114
|
-
function f(e, t) {
|
|
115
|
-
return e.replace(/\{(\w+)\}/g, (e, n) => encodeURIComponent(t[n] ?? ""));
|
|
116
|
-
}
|
|
117
|
-
var p = "/api/v1/projects/{project}/tenants/{tenant}", m = `${p}/templates/{template}`, h = `${p}/media`, g = `${h}/folders`, _ = `${p}/saved-modules`, v = {
|
|
118
|
-
health: "/api/v1/health",
|
|
119
|
-
"projects.config": `${p}/config`,
|
|
120
|
-
"broadcasting.auth": `${p}/broadcasting/auth`,
|
|
121
|
-
"templates.store": `${p}/templates`,
|
|
122
|
-
"templates.show": `${m}`,
|
|
123
|
-
"templates.update": `${m}`,
|
|
124
|
-
"templates.destroy": `${m}`,
|
|
125
|
-
"templates.export": `${m}/export`,
|
|
126
|
-
"templates.importFromBeefree": `${p}/templates/import/from-beefree`,
|
|
127
|
-
"templates.sendTestEmail": `${m}/send-test-email`,
|
|
128
|
-
"versions.index": `${m}/versions`,
|
|
129
|
-
"versions.store": `${m}/versions`,
|
|
130
|
-
"versions.show": `${m}/versions/{version}`,
|
|
131
|
-
"versions.restore": `${m}/versions/{version}/restore`,
|
|
132
|
-
"comments.index": `${m}/comments`,
|
|
133
|
-
"comments.store": `${m}/comments`,
|
|
134
|
-
"comments.update": `${m}/comments/{comment}`,
|
|
135
|
-
"comments.destroy": `${m}/comments/{comment}`,
|
|
136
|
-
"comments.resolve": `${m}/comments/{comment}/resolve`,
|
|
137
|
-
"media.upload": `${h}/upload`,
|
|
138
|
-
"media.browse": `${h}/browse`,
|
|
139
|
-
"media.delete": `${h}/delete`,
|
|
140
|
-
"media.move": `${h}/move`,
|
|
141
|
-
"media.update": `${h}/{media}`,
|
|
142
|
-
"media.replace": `${h}/{media}/replace`,
|
|
143
|
-
"media.checkUsage": `${h}/check-usage`,
|
|
144
|
-
"media.frequentlyUsed": `${h}/frequently-used`,
|
|
145
|
-
"media.importFromUrl": `${h}/import-from-url`,
|
|
146
|
-
"folders.index": `${g}`,
|
|
147
|
-
"folders.store": `${g}`,
|
|
148
|
-
"folders.update": `${g}/{mediaFolder}`,
|
|
149
|
-
"folders.destroy": `${g}/{mediaFolder}`,
|
|
150
|
-
"savedModules.index": `${_}`,
|
|
151
|
-
"savedModules.store": `${_}`,
|
|
152
|
-
"savedModules.update": `${_}/{savedModule}`,
|
|
153
|
-
"savedModules.destroy": `${_}/{savedModule}`
|
|
154
|
-
}, y = class {
|
|
155
|
-
authManager;
|
|
156
|
-
constructor(e) {
|
|
157
|
-
this.authManager = e;
|
|
158
|
-
}
|
|
159
|
-
get projectId() {
|
|
160
|
-
return this.authManager.projectId;
|
|
161
|
-
}
|
|
162
|
-
get tenantSlug() {
|
|
163
|
-
return this.authManager.tenantSlug;
|
|
164
|
-
}
|
|
165
|
-
get baseParams() {
|
|
166
|
-
return {
|
|
167
|
-
project: this.projectId,
|
|
168
|
-
tenant: this.tenantSlug
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
async request(e, t = {}) {
|
|
172
|
-
let n = await this.authManager.authenticatedFetch(e, {
|
|
173
|
-
...t,
|
|
174
|
-
headers: {
|
|
175
|
-
"Content-Type": "application/json",
|
|
176
|
-
Accept: "application/json",
|
|
177
|
-
...t.headers
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
if (!n.ok) {
|
|
181
|
-
let e = await n.json().catch(() => ({ message: `HTTP error ${n.status}` })), t = this.extractFirstValidationError(e);
|
|
182
|
-
throw new a(t, n.status);
|
|
183
|
-
}
|
|
184
|
-
if (n.status !== 204) return (await n.json()).data;
|
|
185
|
-
}
|
|
186
|
-
extractFirstValidationError(e) {
|
|
187
|
-
if (e.errors) {
|
|
188
|
-
let t = Object.keys(e.errors)[0];
|
|
189
|
-
if (t && e.errors[t]?.length > 0) return e.errors[t][0];
|
|
190
|
-
}
|
|
191
|
-
return e.message;
|
|
192
|
-
}
|
|
193
|
-
async createTemplate(e, t) {
|
|
194
|
-
return this.request(f(v["templates.store"], this.baseParams), {
|
|
195
|
-
method: "POST",
|
|
196
|
-
body: JSON.stringify(t === void 0 ? { content: e } : {
|
|
197
|
-
content: e,
|
|
198
|
-
name: t
|
|
199
|
-
})
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
async getTemplate(e) {
|
|
203
|
-
return this.request(f(v["templates.show"], {
|
|
204
|
-
...this.baseParams,
|
|
205
|
-
template: e
|
|
206
|
-
}));
|
|
207
|
-
}
|
|
208
|
-
async updateTemplate(e, t) {
|
|
209
|
-
return this.request(f(v["templates.update"], {
|
|
210
|
-
...this.baseParams,
|
|
211
|
-
template: e
|
|
212
|
-
}), {
|
|
213
|
-
method: "PUT",
|
|
214
|
-
body: JSON.stringify(t)
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
async createVersion(e, t, n) {
|
|
218
|
-
return this.request(f(v["versions.store"], {
|
|
219
|
-
...this.baseParams,
|
|
220
|
-
template: e
|
|
221
|
-
}), {
|
|
222
|
-
method: "POST",
|
|
223
|
-
body: JSON.stringify(n === void 0 ? { content: t } : {
|
|
224
|
-
content: t,
|
|
225
|
-
label: n
|
|
226
|
-
})
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
async deleteTemplate(e) {
|
|
230
|
-
return this.request(f(v["templates.destroy"], {
|
|
231
|
-
...this.baseParams,
|
|
232
|
-
template: e
|
|
233
|
-
}), { method: "DELETE" });
|
|
234
|
-
}
|
|
235
|
-
async getVersions(e) {
|
|
236
|
-
return this.request(f(v["versions.index"], {
|
|
237
|
-
...this.baseParams,
|
|
238
|
-
template: e
|
|
239
|
-
}));
|
|
240
|
-
}
|
|
241
|
-
async getVersion(e, t) {
|
|
242
|
-
return this.request(f(v["versions.show"], {
|
|
243
|
-
...this.baseParams,
|
|
244
|
-
template: e,
|
|
245
|
-
version: t
|
|
246
|
-
}));
|
|
247
|
-
}
|
|
248
|
-
async restoreVersion(e, t) {
|
|
249
|
-
return this.request(f(v["versions.restore"], {
|
|
250
|
-
...this.baseParams,
|
|
251
|
-
template: e,
|
|
252
|
-
version: t
|
|
253
|
-
}), { method: "POST" });
|
|
254
|
-
}
|
|
255
|
-
async exportTemplate(e, t) {
|
|
256
|
-
let n = t ? JSON.stringify({
|
|
257
|
-
custom_fonts: t.customFonts,
|
|
258
|
-
default_fallback: t.defaultFallback
|
|
259
|
-
}) : void 0;
|
|
260
|
-
return this.request(f(v["templates.export"], {
|
|
261
|
-
...this.baseParams,
|
|
262
|
-
template: e
|
|
263
|
-
}), {
|
|
264
|
-
method: "POST",
|
|
265
|
-
body: n
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
async sendTestEmail(e, t) {
|
|
269
|
-
await this.request(f(v["templates.sendTestEmail"], {
|
|
270
|
-
...this.baseParams,
|
|
271
|
-
template: e
|
|
272
|
-
}), {
|
|
273
|
-
method: "POST",
|
|
274
|
-
body: JSON.stringify(t)
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
commentsUrl(e, t) {
|
|
278
|
-
return t ? f(v["comments.update"], {
|
|
279
|
-
...this.baseParams,
|
|
280
|
-
template: e,
|
|
281
|
-
comment: t
|
|
282
|
-
}) : f(v["comments.index"], {
|
|
283
|
-
...this.baseParams,
|
|
284
|
-
template: e
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
async getComments(e) {
|
|
288
|
-
return this.request(this.commentsUrl(e));
|
|
289
|
-
}
|
|
290
|
-
async createComment(e, t, n) {
|
|
291
|
-
return this.request(this.commentsUrl(e), {
|
|
292
|
-
method: "POST",
|
|
293
|
-
body: JSON.stringify(t),
|
|
294
|
-
headers: n
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
async updateComment(e, t, n, r) {
|
|
298
|
-
return this.request(this.commentsUrl(e, t), {
|
|
299
|
-
method: "PUT",
|
|
300
|
-
body: JSON.stringify(n),
|
|
301
|
-
headers: r
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
async deleteComment(e, t, n, r) {
|
|
305
|
-
return this.request(this.commentsUrl(e, t), {
|
|
306
|
-
method: "DELETE",
|
|
307
|
-
body: JSON.stringify(n),
|
|
308
|
-
headers: r
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
async resolveComment(e, t, n, r) {
|
|
312
|
-
return this.request(f(v["comments.resolve"], {
|
|
313
|
-
...this.baseParams,
|
|
314
|
-
template: e,
|
|
315
|
-
comment: t
|
|
316
|
-
}), {
|
|
317
|
-
method: "POST",
|
|
318
|
-
body: JSON.stringify(n),
|
|
319
|
-
headers: r
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
async fetchConfig() {
|
|
323
|
-
return this.request(f(v["projects.config"], this.baseParams));
|
|
324
|
-
}
|
|
325
|
-
async listModules(e, t) {
|
|
326
|
-
let n = f(v["savedModules.index"], this.baseParams), r = new URLSearchParams();
|
|
327
|
-
e && r.set("search", e), t && r.set("category", t);
|
|
328
|
-
let i = r.size > 0 ? `?${r}` : "";
|
|
329
|
-
return this.request(`${n}${i}`);
|
|
330
|
-
}
|
|
331
|
-
async createModule(e) {
|
|
332
|
-
return this.request(f(v["savedModules.store"], this.baseParams), {
|
|
333
|
-
method: "POST",
|
|
334
|
-
body: JSON.stringify(e)
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
async updateModule(e, t) {
|
|
338
|
-
return this.request(f(v["savedModules.update"], {
|
|
339
|
-
...this.baseParams,
|
|
340
|
-
savedModule: e
|
|
341
|
-
}), {
|
|
342
|
-
method: "PUT",
|
|
343
|
-
body: JSON.stringify(t)
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
async deleteModule(e) {
|
|
347
|
-
return this.request(f(v["savedModules.destroy"], {
|
|
348
|
-
...this.baseParams,
|
|
349
|
-
savedModule: e
|
|
350
|
-
}), { method: "DELETE" });
|
|
351
|
-
}
|
|
352
|
-
}, b = class {
|
|
353
|
-
authManager;
|
|
354
|
-
constructor(e) {
|
|
355
|
-
this.authManager = e;
|
|
356
|
-
}
|
|
357
|
-
get projectId() {
|
|
358
|
-
return this.authManager.projectId;
|
|
359
|
-
}
|
|
360
|
-
get tenantSlug() {
|
|
361
|
-
return this.authManager.tenantSlug;
|
|
362
|
-
}
|
|
363
|
-
get baseParams() {
|
|
364
|
-
return {
|
|
365
|
-
project: this.projectId,
|
|
366
|
-
tenant: this.tenantSlug
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
async request(e, t = {}) {
|
|
370
|
-
let n = await this.authManager.authenticatedFetch(e, {
|
|
371
|
-
...t,
|
|
372
|
-
headers: {
|
|
373
|
-
"Content-Type": "application/json",
|
|
374
|
-
Accept: "application/json",
|
|
375
|
-
...t.headers
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
if (!n.ok) {
|
|
379
|
-
let e = await n.json().catch(() => ({ message: `HTTP error ${n.status}` }));
|
|
380
|
-
throw Error(e.message, { cause: e });
|
|
381
|
-
}
|
|
382
|
-
if (n.status !== 204) return (await n.json()).data;
|
|
383
|
-
}
|
|
384
|
-
async browseMedia(e) {
|
|
385
|
-
let t = new URLSearchParams();
|
|
386
|
-
e.folderId && t.set("folderId", e.folderId), e.search && t.set("search", e.search), e.category && t.set("category", e.category), e.sort && t.set("sort", e.sort), e.cursor && t.set("cursor", e.cursor);
|
|
387
|
-
let n = t.toString(), r = `${f(v["media.browse"], this.baseParams)}${n ? `?${n}` : ""}`, i = await this.authManager.authenticatedFetch(r, { headers: { Accept: "application/json" } });
|
|
388
|
-
if (!i.ok) {
|
|
389
|
-
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
390
|
-
throw Error(e.message, { cause: e });
|
|
391
|
-
}
|
|
392
|
-
return i.json();
|
|
393
|
-
}
|
|
394
|
-
async uploadMedia(e, t) {
|
|
395
|
-
let n = new FormData();
|
|
396
|
-
n.append("file", e), t && n.append("folderId", t);
|
|
397
|
-
let r = f(v["media.upload"], this.baseParams), i = await this.authManager.authenticatedFetch(r, {
|
|
398
|
-
method: "POST",
|
|
399
|
-
headers: { Accept: "application/json" },
|
|
400
|
-
body: n
|
|
401
|
-
});
|
|
402
|
-
if (!i.ok) {
|
|
403
|
-
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
404
|
-
throw Error(e.message, { cause: e });
|
|
405
|
-
}
|
|
406
|
-
return (await i.json()).data;
|
|
407
|
-
}
|
|
408
|
-
async updateMedia(e, t, n) {
|
|
409
|
-
let r = {};
|
|
410
|
-
return t !== void 0 && (r.filename = t), n !== void 0 && (r.alt = n), this.request(f(v["media.update"], {
|
|
411
|
-
...this.baseParams,
|
|
412
|
-
media: e
|
|
413
|
-
}), {
|
|
414
|
-
method: "PUT",
|
|
415
|
-
body: JSON.stringify(r)
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
async deleteMedia(e) {
|
|
419
|
-
return this.request(f(v["media.delete"], this.baseParams), {
|
|
420
|
-
method: "POST",
|
|
421
|
-
body: JSON.stringify({ ids: e })
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
async moveMedia(e, t) {
|
|
425
|
-
return this.request(f(v["media.move"], this.baseParams), {
|
|
426
|
-
method: "POST",
|
|
427
|
-
body: JSON.stringify({
|
|
428
|
-
ids: e,
|
|
429
|
-
folderId: t
|
|
430
|
-
})
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
async getMediaFolders() {
|
|
434
|
-
return this.request(f(v["folders.index"], this.baseParams));
|
|
435
|
-
}
|
|
436
|
-
async createMediaFolder(e, t) {
|
|
437
|
-
return this.request(f(v["folders.store"], this.baseParams), {
|
|
438
|
-
method: "POST",
|
|
439
|
-
body: JSON.stringify({
|
|
440
|
-
name: e,
|
|
441
|
-
parentId: t ?? null
|
|
442
|
-
})
|
|
443
|
-
});
|
|
444
|
-
}
|
|
445
|
-
async renameMediaFolder(e, t) {
|
|
446
|
-
return this.request(f(v["folders.update"], {
|
|
447
|
-
...this.baseParams,
|
|
448
|
-
mediaFolder: e
|
|
449
|
-
}), {
|
|
450
|
-
method: "PUT",
|
|
451
|
-
body: JSON.stringify({ name: t })
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
|
-
async deleteMediaFolder(e) {
|
|
455
|
-
return this.request(f(v["folders.destroy"], {
|
|
456
|
-
...this.baseParams,
|
|
457
|
-
mediaFolder: e
|
|
458
|
-
}), { method: "DELETE" });
|
|
459
|
-
}
|
|
460
|
-
async checkMediaUsage(e) {
|
|
461
|
-
let t = await this.authManager.authenticatedFetch(f(v["media.checkUsage"], this.baseParams), {
|
|
462
|
-
method: "POST",
|
|
463
|
-
headers: {
|
|
464
|
-
"Content-Type": "application/json",
|
|
465
|
-
Accept: "application/json"
|
|
466
|
-
},
|
|
467
|
-
body: JSON.stringify({ ids: e })
|
|
468
|
-
});
|
|
469
|
-
if (!t.ok) {
|
|
470
|
-
let e = await t.json().catch(() => ({ message: `HTTP error ${t.status}` }));
|
|
471
|
-
throw Error(e.message, { cause: e });
|
|
472
|
-
}
|
|
473
|
-
return t.json();
|
|
474
|
-
}
|
|
475
|
-
async getFrequentlyUsed() {
|
|
476
|
-
return this.request(f(v["media.frequentlyUsed"], this.baseParams));
|
|
477
|
-
}
|
|
478
|
-
async importFromUrl(e, t) {
|
|
479
|
-
return this.request(f(v["media.importFromUrl"], this.baseParams), {
|
|
480
|
-
method: "POST",
|
|
481
|
-
body: JSON.stringify({
|
|
482
|
-
url: e,
|
|
483
|
-
folderId: t ?? null
|
|
484
|
-
})
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
async replaceMedia(e, t) {
|
|
488
|
-
let n = new FormData();
|
|
489
|
-
n.append("file", t);
|
|
490
|
-
let r = f(v["media.replace"], {
|
|
491
|
-
...this.baseParams,
|
|
492
|
-
media: e
|
|
493
|
-
}), i = await this.authManager.authenticatedFetch(r, {
|
|
494
|
-
method: "POST",
|
|
495
|
-
headers: { Accept: "application/json" },
|
|
496
|
-
body: n
|
|
497
|
-
});
|
|
498
|
-
if (!i.ok) {
|
|
499
|
-
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
500
|
-
throw Error(e.message, { cause: e });
|
|
501
|
-
}
|
|
502
|
-
return (await i.json()).data;
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
// ../core/src/cloud/websocket-client.ts
|
|
506
|
-
function ee(e) {
|
|
507
|
-
return {
|
|
508
|
-
host: e.host,
|
|
509
|
-
port: e.port,
|
|
510
|
-
appKey: e.appKey
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
var x = class {
|
|
514
|
-
pusher = null;
|
|
515
|
-
authManager;
|
|
516
|
-
config;
|
|
517
|
-
onError;
|
|
518
|
-
constructor(e) {
|
|
519
|
-
this.authManager = e.authManager, this.config = e.config, this.onError = e.onError;
|
|
520
|
-
}
|
|
521
|
-
async connect() {
|
|
522
|
-
if (this.pusher) return;
|
|
523
|
-
let t;
|
|
524
|
-
try {
|
|
525
|
-
({default: t} = await import("./pusher-x9rNqzon.js").then((t) => /* @__PURE__ */ e(t.t(), 1)));
|
|
526
|
-
} catch {
|
|
527
|
-
throw Error("[Templatical] Cloud features require the optional peer dependency 'pusher-js'. Please install it.");
|
|
528
|
-
}
|
|
529
|
-
let { host: n, port: r, appKey: i } = this.config, a = this.authManager.resolveUrl(f(v["broadcasting.auth"], {
|
|
530
|
-
project: this.authManager.projectId,
|
|
531
|
-
tenant: this.authManager.tenantSlug
|
|
532
|
-
}));
|
|
533
|
-
this.pusher = new t(i, {
|
|
534
|
-
wsHost: n,
|
|
535
|
-
wsPort: r,
|
|
536
|
-
wssPort: r,
|
|
537
|
-
forceTLS: !0,
|
|
538
|
-
disableStats: !0,
|
|
539
|
-
enabledTransports: ["ws", "wss"],
|
|
540
|
-
cluster: "",
|
|
541
|
-
channelAuthorization: {
|
|
542
|
-
transport: "ajax",
|
|
543
|
-
endpoint: a,
|
|
544
|
-
headers: {
|
|
545
|
-
Authorization: `Bearer ${this.authManager.accessTokenValue}`,
|
|
546
|
-
Accept: "application/json"
|
|
547
|
-
},
|
|
548
|
-
params: {
|
|
549
|
-
userId: this.authManager.userConfig?.id ?? "",
|
|
550
|
-
userName: this.authManager.userConfig?.name ?? "",
|
|
551
|
-
userSignature: this.authManager.userConfig?.signature ?? ""
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
}), this.pusher.connection.bind("error", (e) => {
|
|
555
|
-
this.onError?.(e instanceof Error ? e : /* @__PURE__ */ Error("WebSocket connection error"));
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
subscribePresence(e) {
|
|
559
|
-
if (!this.pusher) throw Error("WebSocketClient not connected. Call connect() first.");
|
|
560
|
-
return this.pusher.subscribe(e);
|
|
561
|
-
}
|
|
562
|
-
unsubscribe(e) {
|
|
563
|
-
this.pusher?.unsubscribe(e);
|
|
564
|
-
}
|
|
565
|
-
getChannel(e) {
|
|
566
|
-
return this.pusher?.channel(e);
|
|
567
|
-
}
|
|
568
|
-
disconnect() {
|
|
569
|
-
this.pusher &&= (this.pusher.disconnect(), null);
|
|
570
|
-
}
|
|
571
|
-
getSocketId() {
|
|
572
|
-
return this.pusher?.connection.socket_id ?? null;
|
|
573
|
-
}
|
|
574
|
-
get isConnected() {
|
|
575
|
-
return this.pusher?.connection.state === "connected";
|
|
576
|
-
}
|
|
577
|
-
}, S = "comment-broadcast";
|
|
578
|
-
function C(e) {
|
|
579
|
-
let t = {
|
|
580
|
-
id: e.id,
|
|
581
|
-
body: e.body,
|
|
582
|
-
author: e.author,
|
|
583
|
-
createdAt: e.createdAt,
|
|
584
|
-
blockId: e.blockId,
|
|
585
|
-
parentId: e.parentId,
|
|
586
|
-
resolvedAt: e.resolvedAt
|
|
587
|
-
};
|
|
588
|
-
return e.updatedAt !== e.createdAt && (t.updatedAt = e.updatedAt), e.resolvedBy && (t.resolvedBy = e.resolvedBy), e.replies?.length && (t.replies = e.replies.map(C)), t;
|
|
589
|
-
}
|
|
590
|
-
function w(e) {
|
|
591
|
-
let { authManager: n, channel: r, getSocketId: i } = e, a = new y(n);
|
|
592
|
-
function o() {
|
|
593
|
-
let e = n.userConfig;
|
|
594
|
-
if (!e) throw Error("[Templatical] Cloud comments need a signed user in the auth token. The project's token endpoint must include a `user` claim.");
|
|
595
|
-
return {
|
|
596
|
-
userId: e.id,
|
|
597
|
-
userName: e.name,
|
|
598
|
-
userSignature: e.signature
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
function s() {
|
|
602
|
-
let e = i?.();
|
|
603
|
-
return e ? { "X-Socket-ID": e } : void 0;
|
|
604
|
-
}
|
|
605
|
-
return {
|
|
606
|
-
async list(e) {
|
|
607
|
-
return (await a.getComments(e)).map(C);
|
|
608
|
-
},
|
|
609
|
-
async create(e, t) {
|
|
610
|
-
return C(await a.createComment(e, {
|
|
611
|
-
body: t.body,
|
|
612
|
-
blockId: t.blockId,
|
|
613
|
-
parentId: t.parentId,
|
|
614
|
-
...o()
|
|
615
|
-
}, s()));
|
|
616
|
-
},
|
|
617
|
-
async update(e, t, n) {
|
|
618
|
-
if (n.body === void 0) throw Error("[Templatical] Cloud comments: update() needs a `body` in the patch.");
|
|
619
|
-
return C(await a.updateComment(e, t, {
|
|
620
|
-
body: n.body,
|
|
621
|
-
...o()
|
|
622
|
-
}, s()));
|
|
623
|
-
},
|
|
624
|
-
async delete(e, t) {
|
|
625
|
-
await a.deleteComment(e, t, o(), s());
|
|
626
|
-
},
|
|
627
|
-
async setResolved(e, t, n) {
|
|
628
|
-
return C(await a.resolveComment(e, t, o(), s()));
|
|
629
|
-
},
|
|
630
|
-
subscribe(e, n) {
|
|
631
|
-
function i(t) {
|
|
632
|
-
if (t.comment.templateId && t.comment.templateId !== e) return;
|
|
633
|
-
let r = C(t.comment);
|
|
634
|
-
switch (t.action) {
|
|
635
|
-
case "commentCreated":
|
|
636
|
-
n({
|
|
637
|
-
type: "created",
|
|
638
|
-
comment: r
|
|
639
|
-
});
|
|
640
|
-
break;
|
|
641
|
-
case "commentDeleted":
|
|
642
|
-
n({
|
|
643
|
-
type: "deleted",
|
|
644
|
-
commentId: r.id,
|
|
645
|
-
parentId: r.parentId
|
|
646
|
-
});
|
|
647
|
-
break;
|
|
648
|
-
case "commentUpdated":
|
|
649
|
-
case "commentResolved":
|
|
650
|
-
case "commentUnresolved": n({
|
|
651
|
-
type: "updated",
|
|
652
|
-
comment: r
|
|
653
|
-
});
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
let a = t(r, (e, t) => {
|
|
657
|
-
t?.unbind(S, i), e?.bind(S, i);
|
|
658
|
-
}, { immediate: !0 });
|
|
659
|
-
return () => {
|
|
660
|
-
a(), r.value?.unbind(S, i);
|
|
661
|
-
};
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
}
|
|
665
|
-
// ../core/src/cloud/web-socket.ts
|
|
666
|
-
function te(e) {
|
|
667
|
-
let { authManager: t, onError: n } = e, r = i(null), a = i(!1), o = null, s = null, c = null, l = null;
|
|
668
|
-
async function u(e, i) {
|
|
669
|
-
let u = `presence-template.${e}`;
|
|
670
|
-
if (l = u, o && c === u) return;
|
|
671
|
-
if (!o) {
|
|
672
|
-
let e = new x({
|
|
673
|
-
authManager: t,
|
|
674
|
-
config: i,
|
|
675
|
-
onError: n
|
|
676
|
-
});
|
|
677
|
-
o = e, s = e.connect().catch((t) => {
|
|
678
|
-
throw o === e && (o = null, s = null, c = null, l = null), t;
|
|
679
|
-
});
|
|
680
|
-
}
|
|
681
|
-
let d = o;
|
|
682
|
-
if (await s, o !== d) {
|
|
683
|
-
d.disconnect();
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
if (l !== u || c === u) return;
|
|
687
|
-
c && d.unsubscribe(c), c = u, r.value = null, a.value = !1;
|
|
688
|
-
let f = d.subscribePresence(u);
|
|
689
|
-
f.bind("pusher:subscription_succeeded", () => {
|
|
690
|
-
c === u && (a.value = !0, r.value = f);
|
|
691
|
-
}), f.bind("pusher:subscription_error", (e) => {
|
|
692
|
-
c === u && (a.value = !1, r.value = null, n?.(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to subscribe to template channel")));
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
function d() {
|
|
696
|
-
c && o && o.unsubscribe(c), o?.disconnect(), o = null, s = null, c = null, l = null, r.value = null, a.value = !1;
|
|
697
|
-
}
|
|
698
|
-
function f() {
|
|
699
|
-
return o?.getSocketId() ?? null;
|
|
700
|
-
}
|
|
701
|
-
return {
|
|
702
|
-
channel: r,
|
|
703
|
-
isConnected: a,
|
|
704
|
-
connect: u,
|
|
705
|
-
disconnect: d,
|
|
706
|
-
getSocketId: f
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
// ../core/src/cloud/saved-blocks-provider.ts
|
|
710
|
-
function ne(e) {
|
|
711
|
-
let t = new y(e);
|
|
712
|
-
return {
|
|
713
|
-
list(e) {
|
|
714
|
-
return t.listModules(e?.search, e?.category);
|
|
715
|
-
},
|
|
716
|
-
create(e) {
|
|
717
|
-
return t.createModule(e);
|
|
718
|
-
},
|
|
719
|
-
update(e, n) {
|
|
720
|
-
return t.updateModule(e, n);
|
|
721
|
-
},
|
|
722
|
-
delete(e) {
|
|
723
|
-
return t.deleteModule(e);
|
|
724
|
-
}
|
|
725
|
-
};
|
|
726
|
-
}
|
|
727
|
-
// ../core/src/cloud/media-provider.ts
|
|
728
|
-
function T(e) {
|
|
729
|
-
let t = {
|
|
730
|
-
id: e.id,
|
|
731
|
-
url: e.url,
|
|
732
|
-
filename: e.filename,
|
|
733
|
-
alt: e.alt,
|
|
734
|
-
mimeType: e.mimeType,
|
|
735
|
-
folderId: e.folderId,
|
|
736
|
-
createdAt: e.createdAt,
|
|
737
|
-
updatedAt: e.updatedAt,
|
|
738
|
-
size: e.size
|
|
739
|
-
};
|
|
740
|
-
return e.width != null && (t.width = e.width), e.height != null && (t.height = e.height), e.thumbnailUrl != null && (t.thumbnailUrl = e.thumbnailUrl), t;
|
|
741
|
-
}
|
|
742
|
-
function E(e, t = null) {
|
|
743
|
-
return {
|
|
744
|
-
id: e.id,
|
|
745
|
-
name: e.name,
|
|
746
|
-
parentId: e.parentId === void 0 ? t : e.parentId
|
|
747
|
-
};
|
|
748
|
-
}
|
|
749
|
-
function D(e, t = null) {
|
|
750
|
-
let n = [];
|
|
751
|
-
for (let r of e) n.push(E(r, t)), r.children?.length && n.push(...D(r.children, r.id));
|
|
752
|
-
return n;
|
|
753
|
-
}
|
|
754
|
-
function O(e) {
|
|
755
|
-
let t = e?.media?.categories;
|
|
756
|
-
if (!t) return;
|
|
757
|
-
let n = {};
|
|
758
|
-
for (let [e, r] of Object.entries(t)) n[e] = r.mimeTypes;
|
|
759
|
-
return n;
|
|
760
|
-
}
|
|
761
|
-
function re(e, t) {
|
|
762
|
-
let n = new b(e);
|
|
763
|
-
return {
|
|
764
|
-
async list(e) {
|
|
765
|
-
let t = await n.browseMedia({
|
|
766
|
-
search: e?.search,
|
|
767
|
-
cursor: e?.cursor,
|
|
768
|
-
folderId: e?.folderId,
|
|
769
|
-
category: e?.category
|
|
770
|
-
}), r = { items: t.data.map(T) };
|
|
771
|
-
return t.meta.nextCursor && (r.nextCursor = t.meta.nextCursor), r;
|
|
772
|
-
},
|
|
773
|
-
async create(e) {
|
|
774
|
-
return T(await n.uploadMedia(e.file, e.folderId));
|
|
775
|
-
},
|
|
776
|
-
async update(e, t) {
|
|
777
|
-
return T(await n.updateMedia(e, t.filename, t.alt));
|
|
778
|
-
},
|
|
779
|
-
delete(e) {
|
|
780
|
-
return n.deleteMedia(e);
|
|
781
|
-
},
|
|
782
|
-
folders: {
|
|
783
|
-
async list() {
|
|
784
|
-
return D(await n.getMediaFolders());
|
|
785
|
-
},
|
|
786
|
-
async create(e) {
|
|
787
|
-
return E(await n.createMediaFolder(e.name, e.parentId));
|
|
788
|
-
},
|
|
789
|
-
async update(e, t) {
|
|
790
|
-
return E(await n.renameMediaFolder(e, t.name));
|
|
791
|
-
},
|
|
792
|
-
delete(e) {
|
|
793
|
-
return n.deleteMediaFolder(e);
|
|
794
|
-
},
|
|
795
|
-
async move(e, t) {
|
|
796
|
-
return (await n.moveMedia(e, t)).map(T);
|
|
797
|
-
}
|
|
798
|
-
},
|
|
799
|
-
async replace(e, t) {
|
|
800
|
-
return T(await n.replaceMedia(e, t));
|
|
801
|
-
},
|
|
802
|
-
async importFromUrl(e, t) {
|
|
803
|
-
return T(await n.importFromUrl(e, t));
|
|
804
|
-
},
|
|
805
|
-
async checkUsage(e) {
|
|
806
|
-
let t = await n.checkMediaUsage(e), r = {};
|
|
807
|
-
for (let [e, n] of Object.entries(t.data)) r[e] = {
|
|
808
|
-
templateCount: n.templateCount,
|
|
809
|
-
templateNames: n.templateNames
|
|
810
|
-
};
|
|
811
|
-
return r;
|
|
812
|
-
},
|
|
813
|
-
async frequentlyUsed() {
|
|
814
|
-
return (await n.getFrequentlyUsed()).map(T);
|
|
815
|
-
},
|
|
816
|
-
async storage() {
|
|
817
|
-
return t?.()?.storage ?? null;
|
|
818
|
-
},
|
|
819
|
-
get maxFileSize() {
|
|
820
|
-
return t?.()?.media?.maxFileSize;
|
|
821
|
-
},
|
|
822
|
-
get mimeTypes() {
|
|
823
|
-
return O(t?.() ?? null);
|
|
824
|
-
}
|
|
825
|
-
};
|
|
826
|
-
}
|
|
827
|
-
// ../core/src/cloud/templates-provider.ts
|
|
828
|
-
var k = 6e4;
|
|
829
|
-
function A(e) {
|
|
830
|
-
let t = new y(e), n = 0;
|
|
831
|
-
function r(e, r) {
|
|
832
|
-
let i = Date.now();
|
|
833
|
-
i - n < k || (n = i, t.createVersion(e, r).catch((e) => {
|
|
834
|
-
console.warn("[Templatical] Automatic version not recorded — the save itself succeeded:", e);
|
|
835
|
-
}));
|
|
836
|
-
}
|
|
837
|
-
return {
|
|
838
|
-
load(e) {
|
|
839
|
-
return t.getTemplate(e);
|
|
840
|
-
},
|
|
841
|
-
create(e) {
|
|
842
|
-
return t.createTemplate(e.content, e.name);
|
|
843
|
-
},
|
|
844
|
-
async save(e, n) {
|
|
845
|
-
let i = await t.updateTemplate(e, n);
|
|
846
|
-
return n.content && r(e, n.content), i;
|
|
847
|
-
}
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
// ../core/src/cloud/export.ts
|
|
851
|
-
function ie(e) {
|
|
852
|
-
return {
|
|
853
|
-
customFonts: e?.customFonts ?? [],
|
|
854
|
-
defaultFallback: e?.defaultFallback ?? "Arial, sans-serif"
|
|
855
|
-
};
|
|
856
|
-
}
|
|
857
|
-
function j(e) {
|
|
858
|
-
let t = new y(e.authManager);
|
|
859
|
-
async function n(e, n) {
|
|
860
|
-
let r = await t.exportTemplate(e, n);
|
|
861
|
-
return {
|
|
862
|
-
html: r.html,
|
|
863
|
-
mjml: r.mjml
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
async function r(e, n) {
|
|
867
|
-
return (await t.exportTemplate(e, n)).mjml;
|
|
868
|
-
}
|
|
869
|
-
return {
|
|
870
|
-
exportHtml: n,
|
|
871
|
-
getMjmlSource: r
|
|
872
|
-
};
|
|
873
|
-
}
|
|
874
|
-
// ../core/src/cloud/render-provider.ts
|
|
875
|
-
function ae(e) {
|
|
876
|
-
let t = j({ authManager: e.authManager });
|
|
877
|
-
function n(e) {
|
|
878
|
-
return {
|
|
879
|
-
customFonts: e.fonts?.customFonts ?? [],
|
|
880
|
-
defaultFallback: e.fonts?.defaultFallback ?? "Arial, sans-serif"
|
|
881
|
-
};
|
|
882
|
-
}
|
|
883
|
-
async function r() {
|
|
884
|
-
if (e.getTemplateId() === null) throw Error("[Templatical] Cloud renders from the saved template, so one must exist first. Call create() or load() before toMjml() / toHtml().");
|
|
885
|
-
return (await e.save()).id;
|
|
886
|
-
}
|
|
887
|
-
return {
|
|
888
|
-
async toMjml(e) {
|
|
889
|
-
let i = n(e), a = await r();
|
|
890
|
-
return t.getMjmlSource(a, i);
|
|
891
|
-
},
|
|
892
|
-
async toHtml(e) {
|
|
893
|
-
let i = n(e), a = await r(), { html: o } = await t.exportHtml(a, i);
|
|
894
|
-
return o;
|
|
895
|
-
}
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
// ../core/src/cloud/version-history-provider.ts
|
|
899
|
-
function M(e) {
|
|
900
|
-
return {
|
|
901
|
-
id: e.id,
|
|
902
|
-
createdAt: e.createdAt,
|
|
903
|
-
isAutomatic: e.isAutomatic,
|
|
904
|
-
content: e.content
|
|
905
|
-
};
|
|
906
|
-
}
|
|
907
|
-
function oe(e) {
|
|
908
|
-
let t = new y(e);
|
|
909
|
-
return {
|
|
910
|
-
async list(e) {
|
|
911
|
-
return { versions: (await t.getVersions(e)).map(M) };
|
|
912
|
-
},
|
|
913
|
-
async get(e, n) {
|
|
914
|
-
return (await t.getVersion(e, n)).content;
|
|
915
|
-
},
|
|
916
|
-
async create(e, n, r) {
|
|
917
|
-
return M(await t.createVersion(e, n, r?.label));
|
|
918
|
-
},
|
|
919
|
-
restore(e, n) {
|
|
920
|
-
return t.restoreVersion(e, n);
|
|
921
|
-
}
|
|
922
|
-
};
|
|
923
|
-
}
|
|
924
|
-
// ../core/src/cloud/test-email.ts
|
|
925
|
-
function se(e) {
|
|
926
|
-
let { authManager: n, isAuthReady: a } = e, o = i(null);
|
|
927
|
-
a && t(a, (e) => {
|
|
928
|
-
e && (o.value = n.testEmailConfig);
|
|
929
|
-
}, { immediate: !0 });
|
|
930
|
-
let s = r(() => o.value !== null), c = r(() => o.value?.allowedEmails ?? []);
|
|
931
|
-
function l() {
|
|
932
|
-
return o.value?.signature ?? null;
|
|
933
|
-
}
|
|
934
|
-
return {
|
|
935
|
-
isEnabled: s,
|
|
936
|
-
allowedEmails: c,
|
|
937
|
-
getSignature: l
|
|
938
|
-
};
|
|
939
|
-
}
|
|
940
|
-
// ../core/src/cloud/test-email-provider.ts
|
|
941
|
-
function ce(e) {
|
|
942
|
-
let t = new y(e.authManager);
|
|
943
|
-
return {
|
|
944
|
-
get allowedRecipients() {
|
|
945
|
-
return e.allowedEmails.value;
|
|
946
|
-
},
|
|
947
|
-
async send({ recipient: n }) {
|
|
948
|
-
let r = e.getSignature();
|
|
949
|
-
if (r === null) throw Error("Test email is not enabled for this project");
|
|
950
|
-
let i = e.getTemplateId();
|
|
951
|
-
if (i === null) throw Error("Template must be saved before sending a test email");
|
|
952
|
-
await e.save();
|
|
953
|
-
let { html: a } = await e.exportHtml(i);
|
|
954
|
-
e.onBeforeTestEmail && (a = await e.onBeforeTestEmail(a)), await t.sendTestEmail(i, {
|
|
955
|
-
recipient: n,
|
|
956
|
-
html: a,
|
|
957
|
-
allowedEmails: e.allowedEmails.value,
|
|
958
|
-
signature: r
|
|
959
|
-
});
|
|
960
|
-
}
|
|
961
|
-
};
|
|
962
|
-
}
|
|
963
|
-
// ../core/src/cloud/plan-config.ts
|
|
964
|
-
function le(e) {
|
|
965
|
-
let { authManager: t, onError: n } = e, a = i(null), o = i(!1), s = new y(t), c = r(() => a.value?.features ?? null);
|
|
966
|
-
function l(e) {
|
|
967
|
-
return a.value?.features[e] ?? !1;
|
|
968
|
-
}
|
|
969
|
-
async function u() {
|
|
970
|
-
if (!o.value) {
|
|
971
|
-
o.value = !0;
|
|
972
|
-
try {
|
|
973
|
-
a.value = await s.fetchConfig();
|
|
974
|
-
} catch (e) {
|
|
975
|
-
n?.(e instanceof Error ? e : Error("Failed to fetch config", { cause: e }));
|
|
976
|
-
} finally {
|
|
977
|
-
o.value = !1;
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
return {
|
|
982
|
-
config: a,
|
|
983
|
-
isLoading: o,
|
|
984
|
-
hasFeature: l,
|
|
985
|
-
features: c,
|
|
986
|
-
fetchConfig: u
|
|
987
|
-
};
|
|
988
|
-
}
|
|
989
|
-
// ../core/src/cloud/health-check.ts
|
|
990
|
-
var N = 5e3;
|
|
991
|
-
function P(e) {
|
|
992
|
-
return e.authManager ? e.authManager.resolveUrl(v.health) : `${(e.baseUrl ?? "https://templatical.com").replace(/\/$/, "")}${v.health}`;
|
|
993
|
-
}
|
|
994
|
-
async function F(e, t) {
|
|
995
|
-
let n = performance.now();
|
|
996
|
-
try {
|
|
997
|
-
let r = t ? await t.authenticatedFetch(v.health, {
|
|
998
|
-
method: "GET",
|
|
999
|
-
headers: { Accept: "application/json" }
|
|
1000
|
-
}) : await fetch(e, {
|
|
1001
|
-
method: "GET",
|
|
1002
|
-
headers: { Accept: "application/json" }
|
|
1003
|
-
}), i = Math.round(performance.now() - n);
|
|
1004
|
-
if (r.status === 401) return {
|
|
1005
|
-
api: {
|
|
1006
|
-
ok: !0,
|
|
1007
|
-
latency: i
|
|
1008
|
-
},
|
|
1009
|
-
auth: {
|
|
1010
|
-
ok: !1,
|
|
1011
|
-
error: "HTTP 401"
|
|
1012
|
-
}
|
|
1013
|
-
};
|
|
1014
|
-
if (!r.ok) return {
|
|
1015
|
-
api: {
|
|
1016
|
-
ok: !1,
|
|
1017
|
-
latency: i
|
|
1018
|
-
},
|
|
1019
|
-
auth: {
|
|
1020
|
-
ok: !t,
|
|
1021
|
-
error: t ? `HTTP ${r.status}` : void 0
|
|
1022
|
-
}
|
|
1023
|
-
};
|
|
1024
|
-
let a = await r.json();
|
|
1025
|
-
return {
|
|
1026
|
-
api: {
|
|
1027
|
-
ok: a.status === "ok",
|
|
1028
|
-
latency: i
|
|
1029
|
-
},
|
|
1030
|
-
auth: { ok: !0 },
|
|
1031
|
-
wsConfig: a.websocket
|
|
1032
|
-
};
|
|
1033
|
-
} catch (e) {
|
|
1034
|
-
return {
|
|
1035
|
-
api: {
|
|
1036
|
-
ok: !1,
|
|
1037
|
-
latency: Math.round(performance.now() - n)
|
|
1038
|
-
},
|
|
1039
|
-
auth: {
|
|
1040
|
-
ok: !t,
|
|
1041
|
-
error: t ? e instanceof Error ? e.message : "Authentication check failed" : void 0
|
|
1042
|
-
}
|
|
1043
|
-
};
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
async function I(e) {
|
|
1047
|
-
if (!e?.host || !e?.appKey) return {
|
|
1048
|
-
ok: !1,
|
|
1049
|
-
error: "WebSocket configuration not available"
|
|
1050
|
-
};
|
|
1051
|
-
if (typeof WebSocket > "u") return {
|
|
1052
|
-
ok: !1,
|
|
1053
|
-
error: "WebSocket not supported in this environment"
|
|
1054
|
-
};
|
|
1055
|
-
let t = `${e.port === 443 ? "wss" : "ws"}://${e.host}:${e.port}/app/${e.appKey}?protocol=7&client=js&version=8.4.0-rc2&flash=false`;
|
|
1056
|
-
return new Promise((e) => {
|
|
1057
|
-
let n = null, r = setTimeout(() => {
|
|
1058
|
-
n?.close(), e({
|
|
1059
|
-
ok: !1,
|
|
1060
|
-
error: "WebSocket connection timed out"
|
|
1061
|
-
});
|
|
1062
|
-
}, N);
|
|
1063
|
-
try {
|
|
1064
|
-
n = new WebSocket(t);
|
|
1065
|
-
} catch (t) {
|
|
1066
|
-
clearTimeout(r), e({
|
|
1067
|
-
ok: !1,
|
|
1068
|
-
error: t instanceof Error ? t.message : "WebSocket connection failed"
|
|
1069
|
-
});
|
|
1070
|
-
return;
|
|
1071
|
-
}
|
|
1072
|
-
n.onopen = () => {
|
|
1073
|
-
clearTimeout(r), n?.close(), e({ ok: !0 });
|
|
1074
|
-
}, n.onerror = () => {
|
|
1075
|
-
clearTimeout(r), e({
|
|
1076
|
-
ok: !1,
|
|
1077
|
-
error: "WebSocket connection failed"
|
|
1078
|
-
});
|
|
1079
|
-
};
|
|
1080
|
-
});
|
|
1081
|
-
}
|
|
1082
|
-
async function L(e = {}) {
|
|
1083
|
-
let t = await F(P(e), e.authManager), n = await I(t.wsConfig);
|
|
1084
|
-
return {
|
|
1085
|
-
api: t.api,
|
|
1086
|
-
websocket: n,
|
|
1087
|
-
auth: t.auth,
|
|
1088
|
-
overall: t.api.ok && t.auth.ok
|
|
1089
|
-
};
|
|
1090
|
-
}
|
|
1091
|
-
// src/cloud/composables/useCloudFeatureFlags.ts
|
|
1092
|
-
function R(e) {
|
|
1093
|
-
let { planConfigInstance: t, getTemplateId: n } = e;
|
|
1094
|
-
return {
|
|
1095
|
-
canSendTestEmail: r(() => t.hasFeature("testEmail")),
|
|
1096
|
-
hasTemplateSaved: r(() => n() !== null),
|
|
1097
|
-
templateLimit: r(() => t.config.value?.limits.maxTemplates ?? null),
|
|
1098
|
-
templateCount: r(() => t.config.value?.templateCount ?? 0)
|
|
1099
|
-
};
|
|
1100
|
-
}
|
|
1101
|
-
// src/cloud/composables/useCloudPanelState.ts
|
|
1102
|
-
function z() {
|
|
1103
|
-
let e = i(null);
|
|
1104
|
-
return {
|
|
1105
|
-
activePanel: e,
|
|
1106
|
-
commentsOpen: r({
|
|
1107
|
-
get: () => e.value === "comments",
|
|
1108
|
-
set: (t) => e.value = t ? "comments" : null
|
|
1109
|
-
}),
|
|
1110
|
-
rightPanelOpen: r(() => e.value !== null)
|
|
1111
|
-
};
|
|
1112
|
-
}
|
|
1113
|
-
// src/cloud/composables/useCloudSaveGate.ts
|
|
1114
|
-
function B(e) {
|
|
1115
|
-
let t = i(!1), n = null, a = r(() => e.planConfig.value?.accessibility?.blockOnError === !0), o = r(() => a.value ? e.issues.value.filter((e) => e.severity === "error") : []), s = r(() => o.value.length > 0);
|
|
1116
|
-
async function c(e) {
|
|
1117
|
-
return s.value ? (n = e, t.value = !0, !1) : (await e(), !0);
|
|
1118
|
-
}
|
|
1119
|
-
async function l(e) {
|
|
1120
|
-
return !s.value && (await e(), !0);
|
|
1121
|
-
}
|
|
1122
|
-
async function u() {
|
|
1123
|
-
let e = n;
|
|
1124
|
-
n = null, t.value = !1, e && await e();
|
|
1125
|
-
}
|
|
1126
|
-
function d() {
|
|
1127
|
-
n = null, t.value = !1;
|
|
1128
|
-
}
|
|
1129
|
-
return {
|
|
1130
|
-
shouldBlock: s,
|
|
1131
|
-
blockingIssues: o,
|
|
1132
|
-
modalOpen: t,
|
|
1133
|
-
tryRunSave: c,
|
|
1134
|
-
runUnlessBlocked: l,
|
|
1135
|
-
confirmAndSave: u,
|
|
1136
|
-
cancel: d
|
|
1137
|
-
};
|
|
1138
|
-
}
|
|
1139
|
-
// src/cloud/collectSavedBlockIds.ts
|
|
1140
|
-
function V(e) {
|
|
1141
|
-
let t = /* @__PURE__ */ new Set();
|
|
1142
|
-
return H(e?.content?.blocks, t), t;
|
|
1143
|
-
}
|
|
1144
|
-
function H(e, t) {
|
|
1145
|
-
if (e) {
|
|
1146
|
-
for (let n of e) if (t.add(n.id), n.children) {
|
|
1147
|
-
if (n.type === "section") for (let e of n.children) H(e, t);
|
|
1148
|
-
else n.type === "wrapper" && H(n.children, t);
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
// src/cloud/createCloudRuntime.ts
|
|
1153
|
-
function U(e) {
|
|
1154
|
-
if (!e) return {};
|
|
1155
|
-
let { onSaved: t, onCreated: n, onLoaded: r } = e;
|
|
1156
|
-
return {
|
|
1157
|
-
...typeof t == "function" ? { onSaved: t } : {},
|
|
1158
|
-
...typeof n == "function" ? { onCreated: n } : {},
|
|
1159
|
-
...typeof r == "function" ? { onLoaded: r } : {}
|
|
1160
|
-
};
|
|
1161
|
-
}
|
|
1162
|
-
function ue(e) {
|
|
1163
|
-
if (!e) return {};
|
|
1164
|
-
let { onCreated: t, onUpdated: n, onDeleted: r, onResolved: i, onUnresolved: a } = e;
|
|
1165
|
-
return {
|
|
1166
|
-
...typeof t == "function" ? { onCreated: t } : {},
|
|
1167
|
-
...typeof n == "function" ? { onUpdated: n } : {},
|
|
1168
|
-
...typeof r == "function" ? { onDeleted: r } : {},
|
|
1169
|
-
...typeof i == "function" ? { onResolved: i } : {},
|
|
1170
|
-
...typeof a == "function" ? { onUnresolved: a } : {}
|
|
1171
|
-
};
|
|
1172
|
-
}
|
|
1173
|
-
function de(e) {
|
|
1174
|
-
if (typeof e != "object" || !e) return {};
|
|
1175
|
-
let { onCreated: t, onUpdated: n, onDeleted: r } = e;
|
|
1176
|
-
return {
|
|
1177
|
-
...typeof t == "function" ? { onCreated: t } : {},
|
|
1178
|
-
...typeof n == "function" ? { onUpdated: n } : {},
|
|
1179
|
-
...typeof r == "function" ? { onDeleted: r } : {}
|
|
1180
|
-
};
|
|
1181
|
-
}
|
|
1182
|
-
function fe(e) {
|
|
1183
|
-
if (typeof e != "object" || !e) return {};
|
|
1184
|
-
let { onSent: t, defaultRecipient: n } = e;
|
|
1185
|
-
return {
|
|
1186
|
-
...typeof t == "function" ? { onSent: t } : {},
|
|
1187
|
-
...typeof n == "string" ? { defaultRecipient: n } : {}
|
|
1188
|
-
};
|
|
1189
|
-
}
|
|
1190
|
-
function pe(e) {
|
|
1191
|
-
if (typeof e != "object" || !e) return {};
|
|
1192
|
-
let { onCreated: t, onUpdated: n, onDeleted: r } = e;
|
|
1193
|
-
return {
|
|
1194
|
-
...typeof t == "function" ? { onCreated: t } : {},
|
|
1195
|
-
...typeof n == "function" ? { onUpdated: n } : {},
|
|
1196
|
-
...typeof r == "function" ? { onDeleted: r } : {}
|
|
1197
|
-
};
|
|
1198
|
-
}
|
|
1199
|
-
function me(e) {
|
|
1200
|
-
if (!e) return {};
|
|
1201
|
-
let { onCreated: t, onRestored: n } = e;
|
|
1202
|
-
return {
|
|
1203
|
-
...typeof t == "function" ? { onCreated: t } : {},
|
|
1204
|
-
...typeof n == "function" ? { onRestored: n } : {}
|
|
1205
|
-
};
|
|
1206
|
-
}
|
|
1207
|
-
function W(e) {
|
|
1208
|
-
return e.length < 2 ? e.join("") : e.length === 2 ? e.join(" and ") : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
|
|
1209
|
-
}
|
|
1210
|
-
async function G(e) {
|
|
1211
|
-
let { config: r, cloudTranslations: a } = e;
|
|
1212
|
-
r.localization !== void 0 && s.warn("initCloud ignores `localization`; the Cloud editor does not support language versions."), r.translation !== void 0 && s.warn("initCloud ignores `translation`; the Cloud editor does not support translation.");
|
|
1213
|
-
let f = null, p = null, m = null, h = null, g = i(null), _ = i(null);
|
|
1214
|
-
function v() {
|
|
1215
|
-
if (!f) throw Error("[Templatical] The Cloud editor is not mounted yet.");
|
|
1216
|
-
return f;
|
|
1217
|
-
}
|
|
1218
|
-
function y() {
|
|
1219
|
-
return f?.state.template?.id ?? null;
|
|
1220
|
-
}
|
|
1221
|
-
let b = new d({
|
|
1222
|
-
...r.auth,
|
|
1223
|
-
onError: (e) => {
|
|
1224
|
-
u(e) && (g.value = e), r.onError?.(e);
|
|
1225
|
-
}
|
|
1226
|
-
}), x = le({
|
|
1227
|
-
authManager: b,
|
|
1228
|
-
onError: r.onError
|
|
1229
|
-
});
|
|
1230
|
-
await b.initialize();
|
|
1231
|
-
let S = await L({ authManager: b });
|
|
1232
|
-
if (!S.api.ok) throw Error("Health check failed: API is not reachable");
|
|
1233
|
-
if (!S.auth.ok) throw Error(`Health check failed: authentication error${S.auth.error ? ` - ${S.auth.error}` : ""}`);
|
|
1234
|
-
S.websocket.ok || s.warn("WebSocket health check failed:", S.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await x.fetchConfig(), g.value = null;
|
|
1235
|
-
let C = r.templates, T = [
|
|
1236
|
-
"load",
|
|
1237
|
-
"create",
|
|
1238
|
-
"save"
|
|
1239
|
-
].filter((e) => C?.[e] !== void 0);
|
|
1240
|
-
T.length > 0 && s.warn(`initCloud ignores ${W(T.map((e) => `templates.${e}`))} — the template id is the join key for version history, comments and the server-side export, so an id Cloud never issued would break them. Your event handlers were kept. Use init() to bring your own storage.`);
|
|
1241
|
-
let E = r.versionHistory, D = [
|
|
1242
|
-
"list",
|
|
1243
|
-
"get",
|
|
1244
|
-
"create",
|
|
1245
|
-
"restore"
|
|
1246
|
-
].filter((e) => E?.[e] !== void 0);
|
|
1247
|
-
D.length > 0 && s.warn(`initCloud ignores ${W(D.map((e) => `versionHistory.${e}`))} — a version is keyed to a template id Cloud issued, so Cloud owns its history. Your event handlers were kept. Use init() to bring your own storage.`);
|
|
1248
|
-
let O = r.comments, k = [
|
|
1249
|
-
"list",
|
|
1250
|
-
"create",
|
|
1251
|
-
"update",
|
|
1252
|
-
"delete",
|
|
1253
|
-
"setResolved",
|
|
1254
|
-
"subscribe"
|
|
1255
|
-
].filter((e) => O?.[e] !== void 0);
|
|
1256
|
-
k.length > 0 && s.warn(`initCloud ignores ${W(k.map((e) => `comments.${e}`))} — a comment is keyed to a template id Cloud issued, and its author is signed by the auth token, so Cloud owns the conversation. Your event handlers were kept. Use init() to bring your own storage.`), r.render && s.warn("initCloud does not accept a `render` provider — Cloud renders server-side for test email, sends and exports, so a supplied renderer would change only what you preview and export, never what Cloud delivers. The supplied provider is ignored. For your own MJML, call renderToMjml(editor.getContent()) from @templatical/renderer."), r.ai !== void 0 && s.warn("initCloud does not take an `ai` key yet — Cloud's AI arrives as its own provider in a later release. The key is ignored. To bring your own AI backend, use init({ ai }).");
|
|
1257
|
-
function M(e) {
|
|
1258
|
-
let t = x.config.value?.websocket;
|
|
1259
|
-
m && t && m.connect(e.id, ee(t));
|
|
1260
|
-
}
|
|
1261
|
-
let N = A(b), P = N.create, F = N.save, I = {
|
|
1262
|
-
...U(r.templates),
|
|
1263
|
-
load: async (e) => {
|
|
1264
|
-
let t = await N.load(e);
|
|
1265
|
-
return M(t), t;
|
|
1266
|
-
},
|
|
1267
|
-
create: typeof P == "function" ? async (e) => {
|
|
1268
|
-
let t = await P(e);
|
|
1269
|
-
return M(t), t;
|
|
1270
|
-
} : !1,
|
|
1271
|
-
save: typeof F == "function" ? async (e, t) => {
|
|
1272
|
-
if (p && f) {
|
|
1273
|
-
let e = p.registry;
|
|
1274
|
-
await o(f.content.value, {
|
|
1275
|
-
renderCustomBlock: e.renderCustomBlock,
|
|
1276
|
-
getCustomBlockStylesheet: (t) => e.getDefinition(t)?.stylesheet
|
|
1277
|
-
});
|
|
1278
|
-
}
|
|
1279
|
-
return F(e, t);
|
|
1280
|
-
} : !1
|
|
1281
|
-
}, H = ae({
|
|
1282
|
-
authManager: b,
|
|
1283
|
-
getTemplateId: y,
|
|
1284
|
-
save: () => v().save()
|
|
1285
|
-
}), G = {
|
|
1286
|
-
...me(r.versionHistory),
|
|
1287
|
-
...oe(b)
|
|
1288
|
-
}, he = {
|
|
1289
|
-
...ue(r.comments),
|
|
1290
|
-
...w({
|
|
1291
|
-
authManager: b,
|
|
1292
|
-
channel: _,
|
|
1293
|
-
getSocketId: () => m?.getSocketId() ?? null
|
|
1294
|
-
})
|
|
1295
|
-
}, ge = b.userConfig ? {
|
|
1296
|
-
id: b.userConfig.id,
|
|
1297
|
-
name: b.userConfig.name
|
|
1298
|
-
} : void 0, K = typeof r.savedBlocks?.list == "function" ? r.savedBlocks : null;
|
|
1299
|
-
if (K === null && typeof r.savedBlocks == "object" && r.savedBlocks !== null) {
|
|
1300
|
-
let e = r.savedBlocks, t = [
|
|
1301
|
-
"list",
|
|
1302
|
-
"create",
|
|
1303
|
-
"update",
|
|
1304
|
-
"delete"
|
|
1305
|
-
].filter((t) => e[t] !== void 0);
|
|
1306
|
-
t.length > 0 && s.warn(`initCloud ignores ${W(t.map((e) => `savedBlocks.${e}`))} — a provider needs a working list to replace Cloud's store, and this value has none, so it configures Cloud's own store instead. Your event handlers were kept. Use init() to bring your own storage.`);
|
|
1307
|
-
}
|
|
1308
|
-
let q = r.savedBlocks === !1 ? void 0 : K ?? {
|
|
1309
|
-
...de(r.savedBlocks),
|
|
1310
|
-
...ne(b)
|
|
1311
|
-
}, J = se({
|
|
1312
|
-
authManager: b,
|
|
1313
|
-
isAuthReady: i(!0)
|
|
1314
|
-
}), _e = j({ authManager: b }), Y = typeof r.testEmail?.send == "function" ? r.testEmail : null;
|
|
1315
|
-
if (Y === null && typeof r.testEmail == "object" && r.testEmail !== null) {
|
|
1316
|
-
let e = r.testEmail, t = [
|
|
1317
|
-
"send",
|
|
1318
|
-
"includeMjml",
|
|
1319
|
-
"allowedRecipients"
|
|
1320
|
-
].filter((t) => e[t] !== void 0);
|
|
1321
|
-
t.length > 0 && s.warn(`initCloud ignores ${W(t.map((e) => `testEmail.${e}`))} — a provider needs a working send to replace Cloud's sender outright, and Cloud renders server-side with the signed allowlist from your project's JWT either way, so none of these apply here. Your event handlers were kept.`);
|
|
1322
|
-
}
|
|
1323
|
-
let X = Y ?? Object.assign(ce({
|
|
1324
|
-
authManager: b,
|
|
1325
|
-
getTemplateId: y,
|
|
1326
|
-
save: () => v().save(),
|
|
1327
|
-
exportHtml: (e) => _e.exportHtml(e, ie(r.fonts)),
|
|
1328
|
-
allowedEmails: J.allowedEmails,
|
|
1329
|
-
getSignature: J.getSignature,
|
|
1330
|
-
onBeforeTestEmail: r.onBeforeTestEmail
|
|
1331
|
-
}), fe(r.testEmail)), Z = typeof r.media?.list == "function" ? r.media : null;
|
|
1332
|
-
if (Z === null && typeof r.media == "object" && r.media !== null) {
|
|
1333
|
-
let e = r.media, t = [
|
|
1334
|
-
"list",
|
|
1335
|
-
"create",
|
|
1336
|
-
"update",
|
|
1337
|
-
"delete"
|
|
1338
|
-
].filter((t) => e[t] !== void 0);
|
|
1339
|
-
t.length > 0 && s.warn(`initCloud ignores ${W(t.map((e) => `media.${e}`))} — a provider needs a working list to replace Cloud's store, and this value has none, so it configures Cloud's own store instead. Your event handlers were kept. Use init() to bring your own storage.`);
|
|
1340
|
-
let n = ["maxFileSize", "mimeTypes"].filter((t) => e[t] !== void 0);
|
|
1341
|
-
n.length > 0 && s.warn(`initCloud ignores ${W(n.map((e) => `media.${e}`))} — Cloud's plan owns those limits whenever Cloud's store is in play. Your event handlers were kept.`);
|
|
1342
|
-
}
|
|
1343
|
-
let Q = r.media === !1 ? void 0 : Z ?? Object.assign(re(b, () => x.config.value), pe(r.media)), $ = R({
|
|
1344
|
-
planConfigInstance: x,
|
|
1345
|
-
getTemplateId: y
|
|
1346
|
-
});
|
|
1347
|
-
function ve(e) {
|
|
1348
|
-
f = e.editor, n(c, a), n(l, b);
|
|
1349
|
-
let i = te({
|
|
1350
|
-
authManager: b,
|
|
1351
|
-
onError: r.onError
|
|
1352
|
-
});
|
|
1353
|
-
return m = i, t(i.channel, (e) => {
|
|
1354
|
-
_.value = e;
|
|
1355
|
-
}, { immediate: !0 }), {
|
|
1356
|
-
websocket: i,
|
|
1357
|
-
panelState: z(),
|
|
1358
|
-
featureFlags: $
|
|
1359
|
-
};
|
|
1360
|
-
}
|
|
1361
|
-
function ye(e) {
|
|
1362
|
-
let { core: t, capabilities: n } = e;
|
|
1363
|
-
return p = t, h = B({
|
|
1364
|
-
issues: t.templateLint ? t.templateLint.issues : i([]),
|
|
1365
|
-
planConfig: x.config
|
|
1366
|
-
}), n.plan = x, r.customBlocks?.length && t.registerCustomBlocks(r.customBlocks), r.theme && (t.themeOverrides.value = r.theme), {
|
|
1367
|
-
saveGate: h,
|
|
1368
|
-
sessionError: g,
|
|
1369
|
-
retry: async () => {
|
|
1370
|
-
try {
|
|
1371
|
-
await b.initialize(), g.value = null;
|
|
1372
|
-
} catch (e) {
|
|
1373
|
-
g.value = e instanceof Error ? e : /* @__PURE__ */ Error("Authentication failed");
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
};
|
|
1377
|
-
}
|
|
1378
|
-
return {
|
|
1379
|
-
runtime: {
|
|
1380
|
-
isSavedBlocksAvailable: K ? () => !0 : () => r.savedBlocks !== !1 && x.hasFeature("savedModules"),
|
|
1381
|
-
isTestEmailAvailable: Y ? () => !0 : () => J.isEnabled.value && $.canSendTestEmail.value && $.hasTemplateSaved.value,
|
|
1382
|
-
isCommentsAvailable: () => r.comments !== !1 && x.hasFeature("commenting") && $.hasTemplateSaved.value,
|
|
1383
|
-
isBlockSaved: (e) => V(f?.state.template ?? null).has(e),
|
|
1384
|
-
getSaveGate: () => h,
|
|
1385
|
-
attach: ve,
|
|
1386
|
-
ready: ye,
|
|
1387
|
-
destroy() {
|
|
1388
|
-
m?.disconnect(), r.onUnmount?.();
|
|
1389
|
-
}
|
|
1390
|
-
},
|
|
1391
|
-
providers: {
|
|
1392
|
-
templates: I,
|
|
1393
|
-
render: H,
|
|
1394
|
-
versionHistory: G,
|
|
1395
|
-
...q ? { savedBlocks: q } : {},
|
|
1396
|
-
testEmail: X,
|
|
1397
|
-
comments: he,
|
|
1398
|
-
...Q ? { media: Q } : {}
|
|
1399
|
-
},
|
|
1400
|
-
user: ge
|
|
1401
|
-
};
|
|
1402
|
-
}
|
|
1403
|
-
export { G as bootstrapCloud };
|
|
1404
|
-
|
|
1405
|
-
//# sourceMappingURL=createCloudRuntime-CUlw09ix.js.map
|