@templatical/editor 0.35.0 → 0.37.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/dist/{AiChatSidebar-DPHbCGu4.js → AiChatSidebar-tu4eLcf_.js} +57 -57
- package/dist/{AiFeatureMenu--8z7qvg1.js → AiFeatureMenu-BF0i0vA4.js} +17 -17
- package/dist/{BlockIssueBadge-BGCsJqqM.js → BlockIssueBadge-DT-FqKeC.js} +9 -9
- package/dist/{BlockPreviewCanvas-DKspIy8V.js → BlockPreviewCanvas-DDCmMram.js} +28 -28
- package/dist/CloudHeaderExtras-NPhudovT.js +59 -0
- package/dist/{CloudPanels-Bp5gFtaL.js → CloudPanels-Iwnky0iA.js} +78 -108
- package/dist/{CollaboratorBar-DvwZm5u7.js → CollaboratorBar-DAITu0hz.js} +17 -17
- package/dist/{ColorPicker-DtozuN75.js → ColorPicker-BqlZ_TqG.js} +193 -193
- package/dist/{CommentsPanel-3C-DsEjy.js → CommentsPanel-CDvgmWP1.js} +3 -3
- package/dist/{CommentsSidebar-go1FnjDW.js → CommentsSidebar-X_xqM3dR.js} +158 -158
- package/dist/{CountdownBlock-D1fsNsyS.js → CountdownBlock-ZFJIdbP6.js} +12 -12
- package/dist/{CountdownToolbar-SLBuij7Q.js → CountdownToolbar-DBFoG3a6.js} +67 -67
- package/dist/{DesignReferenceSidebar-rcE_BvUd.js → DesignReferenceSidebar--QtXjLrw.js} +57 -57
- package/dist/{FieldRow-BWt7ECqo.js → FieldRow-C8nOknr_.js} +39 -39
- package/dist/{IssuesPanel-Cig46N1i.js → IssuesPanel-BLbNFMSX.js} +38 -38
- package/dist/{LoadingTrack-SQXoZVf2.js → LoadingTrack-BlTL4zFv.js} +2 -2
- package/dist/MediaPanels-CMTAhDXB.js +43 -0
- package/dist/{MergeTagInput-D1hzsn2b.js → MergeTagInput-BEjzj4Iu.js} +115 -115
- package/dist/{MergeTagModeToggle-CH9wR5YF.js → MergeTagModeToggle-DKN6ihI5.js} +40 -40
- package/dist/{MergeTagSuggestion-CoCuzEmW.js → MergeTagSuggestion-DKoLEeoj.js} +21 -21
- package/dist/{ParagraphEditor-CT2AdMdZ.js → ParagraphEditor-1E9yzOfk.js} +231 -258
- package/dist/{RestoreVersionDialog-mdqgQxFR.js → RestoreVersionDialog-BMGUkcd8.js} +28 -28
- package/dist/{RichTextEditorContent-riOB-rKD.js → RichTextEditorContent-BnxbQUV9.js} +49 -59
- package/dist/{SaveBlockDialog-Cn2v4Lpj.js → SaveBlockDialog-WKASpCCT.js} +78 -78
- package/dist/SavedBlocksBrowserModal-AYEXTMtQ.js +323 -0
- package/dist/{SavedBlocksPanels-ffBnWuVU.js → SavedBlocksPanels-D_CpacTl.js} +6 -6
- package/dist/{SavedBlocksPickBar-BmQC2tWN.js → SavedBlocksPickBar-BHMwg-1G.js} +11 -11
- package/dist/{TemplateScoringPanel-CxAtdreR.js → TemplateScoringPanel-CSin43YM.js} +99 -98
- package/dist/{TestEmailModal-Cjn1padY.js → TestEmailModal-BxizsRCd.js} +59 -59
- package/dist/{TestEmailPanel-Bf3XZ1jn.js → TestEmailPanel-vd2e5HzT.js} +3 -3
- package/dist/TitleEditor-CLJ68Ty4.js +199 -0
- package/dist/TplModal-Q9fDgS1M.js +51 -0
- package/dist/{VersionHistoryMenu-CrNrGsaa.js → VersionHistoryMenu-eGYVhM4H.js} +41 -47
- package/dist/{VersionHistoryPanels-CsuQk6W3.js → VersionHistoryPanels-C7Ntrrfq.js} +4 -4
- package/dist/{VersionPreviewBanner-BqbO0Zss.js → VersionPreviewBanner-BbQXnR0M.js} +9 -9
- package/dist/{blockTypeIcons-D_4HdaY9.js → blockTypeIcons-5qD4bB76.js} +5 -17
- package/dist/bundle-stats.json +8 -8
- package/dist/ca-Jx2CDwtn.js +83 -0
- package/dist/cdn/chunks/{AiChatSidebar-D0f74_nS.js → AiChatSidebar-dyqqHAcI.js} +4 -4
- package/dist/cdn/chunks/{AiChatSidebar-D0f74_nS.js.map → AiChatSidebar-dyqqHAcI.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-DwGb3eF9.js → AiFeatureMenu-BjVMwhW8.js} +5 -5
- package/dist/cdn/chunks/{AiFeatureMenu-DwGb3eF9.js.map → AiFeatureMenu-BjVMwhW8.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-CosQgeJ-.js → BlockIssueBadge-BJ__oEtm.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-CosQgeJ-.js.map → BlockIssueBadge-BJ__oEtm.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-CIpZ2a6g.js → BlockPreviewCanvas-B5f26eLE.js} +5 -5
- package/dist/cdn/chunks/{BlockPreviewCanvas-CIpZ2a6g.js.map → BlockPreviewCanvas-B5f26eLE.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-CQzQwKFB.js → CloudHeaderExtras-D5P5IEKA.js} +4 -4
- package/dist/cdn/chunks/{CloudHeaderExtras-CQzQwKFB.js.map → CloudHeaderExtras-D5P5IEKA.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BmexuLOU.js → CloudPanels-DkmR05nB.js} +15 -45
- package/dist/cdn/chunks/{CloudPanels-BmexuLOU.js.map → CloudPanels-DkmR05nB.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-DEICobpp.js → CollaboratorBar-Yn7KSpt4.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-DEICobpp.js.map → CollaboratorBar-Yn7KSpt4.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-C7yC58FK.js → ColorPicker-LcrzgMoW.js} +7 -7
- package/dist/cdn/chunks/{ColorPicker-C7yC58FK.js.map → ColorPicker-LcrzgMoW.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-OjmKxLL7.js → CommentsPanel-CntwwocI.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-OjmKxLL7.js.map → CommentsPanel-CntwwocI.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-C4pWZGpy.js → CommentsSidebar-BLDKnKy7.js} +4 -4
- package/dist/cdn/chunks/{CommentsSidebar-C4pWZGpy.js.map → CommentsSidebar-BLDKnKy7.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-rK055jpy.js → CountdownBlock-B4AfqJwb.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-rK055jpy.js.map → CountdownBlock-B4AfqJwb.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-wlJOxyAl.js → CountdownToolbar-CA1dpuOI.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-wlJOxyAl.js.map → CountdownToolbar-CA1dpuOI.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-DELhnh8h.js → DesignReferenceSidebar-D1Y9Hswe.js} +5 -5
- package/dist/cdn/chunks/{DesignReferenceSidebar-DELhnh8h.js.map → DesignReferenceSidebar-D1Y9Hswe.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-C9i3o8aE.js → IssuesPanel-Q62LTqvd.js} +5 -5
- package/dist/cdn/chunks/{IssuesPanel-C9i3o8aE.js.map → IssuesPanel-Q62LTqvd.js.map} +1 -1
- package/dist/cdn/chunks/MediaPanels-D21M6shx.js +45 -0
- package/dist/cdn/chunks/MediaPanels-D21M6shx.js.map +1 -0
- package/dist/cdn/chunks/{MergeTagInput-D76Kyvgu.js → MergeTagInput-l7paaAml.js} +7 -7
- package/dist/cdn/chunks/{MergeTagInput-D76Kyvgu.js.map → MergeTagInput-l7paaAml.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-Dz3gxN2y.js → MergeTagModeToggle-DYxkAGtA.js} +4 -4
- package/dist/cdn/chunks/{MergeTagModeToggle-Dz3gxN2y.js.map → MergeTagModeToggle-DYxkAGtA.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DQn0HMfV.js → ParagraphEditor-Bd-GQXee.js} +15 -15
- package/dist/cdn/chunks/{ParagraphEditor-DQn0HMfV.js.map → ParagraphEditor-Bd-GQXee.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-BdjOL8Oy.js → RestoreVersionDialog-2X9RpM9A.js} +4 -4
- package/dist/cdn/chunks/{RestoreVersionDialog-BdjOL8Oy.js.map → RestoreVersionDialog-2X9RpM9A.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-Drzwgh0J.js → RichTextEditorContent-D_rb0rmU.js} +8 -8
- package/dist/cdn/chunks/{RichTextEditorContent-Drzwgh0J.js.map → RichTextEditorContent-D_rb0rmU.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-B3rbmXSM.js → SaveBlockDialog-CufdTomT.js} +15 -15
- package/dist/cdn/chunks/{SaveBlockDialog-B3rbmXSM.js.map → SaveBlockDialog-CufdTomT.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CkUXlnd2.js → SavedBlocksBrowserModal-CqpaNsk7.js} +8 -8
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CkUXlnd2.js.map → SavedBlocksBrowserModal-CqpaNsk7.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-BPi3PZKP.js → SavedBlocksPanels-DpxYxddo.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-BPi3PZKP.js.map → SavedBlocksPanels-DpxYxddo.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-BvB9A5W2.js → SavedBlocksPickBar-Drpoav1B.js} +4 -4
- package/dist/cdn/chunks/{SavedBlocksPickBar-BvB9A5W2.js.map → SavedBlocksPickBar-Drpoav1B.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-BBCyLnOi.js → TemplateScoringPanel-DBjUNULq.js} +5 -5
- package/dist/cdn/chunks/{TemplateScoringPanel-BBCyLnOi.js.map → TemplateScoringPanel-DBjUNULq.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-DAGTsBqi.js → TestEmailModal-BTNlSW6f.js} +10 -10
- package/dist/cdn/chunks/{TestEmailModal-DAGTsBqi.js.map → TestEmailModal-BTNlSW6f.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-BfenVvfx.js → TestEmailPanel-D0A9Zgxr.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-BfenVvfx.js.map → TestEmailPanel-D0A9Zgxr.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-oQ4gr6wS.js → TitleEditor-CrnuIq62.js} +9 -9
- package/dist/cdn/chunks/{TitleEditor-oQ4gr6wS.js.map → TitleEditor-CrnuIq62.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-DxOMcVwp.js → TplModal-DYXrTz42.js} +5 -5
- package/dist/cdn/chunks/{TplModal-DxOMcVwp.js.map → TplModal-DYXrTz42.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-BfVUvWHT.js → VersionHistoryMenu-bDGnE4hb.js} +4 -4
- package/dist/cdn/chunks/VersionHistoryMenu-bDGnE4hb.js.map +1 -0
- package/dist/cdn/chunks/{VersionHistoryPanels-NpDb641L.js → VersionHistoryPanels-82P0Q0HM.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-NpDb641L.js.map → VersionHistoryPanels-82P0Q0HM.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-Cpgt4xHc.js → VersionPreviewBanner-BJiwKkVC.js} +3 -3
- package/dist/cdn/chunks/{VersionPreviewBanner-Cpgt4xHc.js.map → VersionPreviewBanner-BJiwKkVC.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-t9vvaiuH.js → blockTypeIcons-CNjJSFun.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-t9vvaiuH.js.map → blockTypeIcons-CNjJSFun.js.map} +1 -1
- package/dist/cdn/chunks/{ca-CNRWAMHI.js → ca-Jx2CDwtn.js} +2 -6
- package/dist/cdn/chunks/ca-Jx2CDwtn.js.map +1 -0
- package/dist/cdn/chunks/{cloud-CullB76F.js → cloud-BLgCKP7Z.js} +452 -227
- package/dist/cdn/chunks/cloud-BLgCKP7Z.js.map +1 -0
- package/dist/cdn/chunks/createCloudRuntime-U-qCH-dq.js +385 -0
- package/dist/cdn/chunks/createCloudRuntime-U-qCH-dq.js.map +1 -0
- package/dist/cdn/chunks/{de-DFYCT4QU.js → de-Ck0pBGHu.js} +2 -6
- package/dist/cdn/chunks/de-Ck0pBGHu.js.map +1 -0
- package/dist/cdn/chunks/{src-CaXeO-gG.js → editor-modal-MXgtarMl.js} +1474 -1935
- package/dist/cdn/chunks/editor-modal-MXgtarMl.js.map +1 -0
- package/dist/cdn/chunks/en-C9U7N77n.js +2 -0
- package/dist/cdn/chunks/{es-OgkdMZGX.js → es-lagTvUfX.js} +2 -6
- package/dist/cdn/chunks/es-lagTvUfX.js.map +1 -0
- package/dist/cdn/chunks/{extensions-BpXY7jO5.js → extensions-B8_jnIkD.js} +3 -3
- package/dist/cdn/chunks/{extensions-BpXY7jO5.js.map → extensions-B8_jnIkD.js.map} +1 -1
- package/dist/cdn/chunks/{fr-Dswns199.js → fr-C4hVl5Lk.js} +2 -6
- package/dist/cdn/chunks/fr-C4hVl5Lk.js.map +1 -0
- package/dist/cdn/chunks/{icons-BLxcQUck.js → icons-BUlqGSgd.js} +24 -24
- package/dist/cdn/chunks/{icons-BLxcQUck.js.map → icons-BUlqGSgd.js.map} +1 -1
- package/dist/cdn/chunks/{keys-DQp8x7Nx.js → keys-DBFhDFng.js} +4 -4
- package/dist/cdn/chunks/{keys-DQp8x7Nx.js.map → keys-DBFhDFng.js.map} +1 -1
- package/dist/cdn/chunks/{nl-CbcPJlrL.js → nl-CReD7Apd.js} +2 -6
- package/dist/cdn/chunks/nl-CReD7Apd.js.map +1 -0
- package/dist/cdn/chunks/{pt-BR-BibOQm-o.js → pt-BR-BRA0-vGP.js} +2 -6
- package/dist/cdn/chunks/pt-BR-BRA0-vGP.js.map +1 -0
- package/dist/cdn/chunks/{src-BC-eolWY.js → src-Ozknnj-v.js} +2 -2
- package/dist/cdn/chunks/{src-BC-eolWY.js.map → src-Ozknnj-v.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-MxgHWrV6.js → useCloudI18n-DSWSGj-A.js} +2 -2
- package/dist/cdn/chunks/{useCloudI18n-MxgHWrV6.js.map → useCloudI18n-DSWSGj-A.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorCore-D4MytYB9.js → useEditorCore-Cs7rYVBo.js} +488 -406
- package/dist/cdn/chunks/useEditorCore-Cs7rYVBo.js.map +1 -0
- package/dist/cdn/chunks/{useEditorRoot-CteADR3y.js → useEditorRoot-B0zW2nT4.js} +2 -2
- package/dist/cdn/chunks/{useEditorRoot-CteADR3y.js.map → useEditorRoot-B0zW2nT4.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-Ct1VIFcf.js → useI18n-Dlo7R9RA.js} +2 -2
- package/dist/cdn/chunks/{useI18n-Ct1VIFcf.js.map → useI18n-Dlo7R9RA.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-CSocWpxV.js → useMergeTag-BYAifvh8.js} +3 -3
- package/dist/cdn/chunks/{useMergeTag-CSocWpxV.js.map → useMergeTag-BYAifvh8.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-BxVWE5_0.js → usePopoverPosition-ElP3ABaV.js} +2 -2
- package/dist/cdn/chunks/{usePopoverPosition-BxVWE5_0.js.map → usePopoverPosition-ElP3ABaV.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-Cz3fpgTK.js → useScrollToBlock-nTbWkgaU.js} +2 -2
- package/dist/cdn/chunks/{useScrollToBlock-Cz3fpgTK.js.map → useScrollToBlock-nTbWkgaU.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +1094 -1005
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-CY-Ec6FV.js → check-DWtkBzBU.js} +1 -1
- package/dist/{chevron-down-BghbWA9p.js → chevron-down-C-Fjxcqj.js} +1 -1
- package/dist/chevron-right-SOkn2d4P.js +11 -0
- package/dist/{chevron-up-n3qFAPS3.js → chevron-up-lntU1ypp.js} +1 -1
- package/dist/{circle-alert-L5uGGFRP.js → circle-alert-CjzUTwy3.js} +1 -1
- package/dist/{clock-Dgnwp18n.js → clock-pB2QKPsJ.js} +1 -1
- package/dist/{cloud-B1c4XIsn.js → cloud-DdidMW6f.js} +445 -200
- package/dist/copy-CId1E038.js +19 -0
- package/dist/createCloudRuntime-x5WZm3p8.js +383 -0
- package/dist/{createLucideIcon-05lB8iWe.js → createLucideIcon-Cwf_nTzE.js} +6 -6
- package/dist/de-Ck0pBGHu.js +83 -0
- package/dist/{dist-BxFbxpgW.js → dist-BVqAYoRB.js} +125 -125
- package/dist/dist-D8i1ixHK.js +177 -0
- package/dist/dist-DBirAJIs.js +410 -0
- package/dist/editor-modal-B_LaQf0s.js +5998 -0
- package/dist/en-DcmpWV53.js +2 -0
- package/dist/es-lagTvUfX.js +83 -0
- package/dist/{extensions-Bawm4BOM.js → extensions-CHOBZRab.js} +42 -42
- package/dist/eye-BuGtFUoJ.js +16 -0
- package/dist/fr-C4hVl5Lk.js +83 -0
- package/dist/{image-up-ovhjl9u9.js → image-up-gH4JEpU5.js} +1 -1
- package/dist/index.d.ts +90 -11
- package/dist/{info-c3KI927I.js → info-BQ60P82u.js} +1 -1
- package/dist/{keys-C3P1yxnr.js → keys-DQA2i1k1.js} +4 -4
- package/dist/link-3R8it3J7.js +14 -0
- package/dist/list-Ccdgj46T.js +33 -0
- package/dist/{loader-circle-B2Y8xZQb.js → loader-circle-B_tAD4k6.js} +1 -1
- package/dist/{message-circle-B7K-naUa.js → message-circle-P-KSc6V0.js} +1 -1
- package/dist/nl-CReD7Apd.js +83 -0
- package/dist/{pencil-BhWTFcp4.js → pencil-9ZiwqS4r.js} +1 -1
- package/dist/plus-BwJEzCaO.js +14 -0
- package/dist/pt-BR-BRA0-vGP.js +83 -0
- package/dist/{refresh-cw-BqUR5vgO.js → refresh-cw-DEgfb2FK.js} +2 -14
- package/dist/{runtime-dom.esm-bundler-BuG03jBM.js → runtime-dom.esm-bundler-PnoZU512.js} +106 -106
- package/dist/search-DqQ8Li5E.js +16 -0
- package/dist/{send-D1vvuW79.js → send-CE6uvqop.js} +1 -1
- package/dist/{shield-check-DjK54PnW.js → shield-check-DhD1Z3rd.js} +1 -1
- package/dist/{sparkles-DNdS9V_3.js → sparkles-R0ZQHa6F.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +2491 -2408
- package/dist/{text-align-start-Bcmo_VUY.js → text-align-start-DSux2UNn.js} +1 -1
- package/dist/{trash-C9bMXvw4.js → trash-Cf_SqsER.js} +1 -1
- package/dist/{triangle-alert-Bn8Bd2Yv.js → triangle-alert-C6tGa6jw.js} +1 -1
- package/dist/{upload-DKgg1gno.js → upload-DusKjpVr.js} +1 -1
- package/dist/{useAliveFlag-PVmp95MT.js → useAliveFlag-oyByIcjy.js} +1 -1
- package/dist/{useCloudI18n-BKoiYsWZ.js → useCloudI18n-BLyh_e2T.js} +2 -2
- package/dist/{useEditorCore-CYGvurZa.js → useEditorCore-DhlKOYwe.js} +1552 -1486
- package/dist/{useEditorRoot-DkRGTQRs.js → useEditorRoot-ds57-l6F.js} +2 -2
- package/dist/{useI18n-CL6RfPzK.js → useI18n-BbdxxpOE.js} +2 -2
- package/dist/{useMergeTag-C9GEpljB.js → useMergeTag-DlvOBW_B.js} +3 -3
- package/dist/{usePopoverPosition-CWxaIWd3.js → usePopoverPosition-CprM5p-c.js} +2 -2
- package/dist/{useScrollToBlock-oUx1HIZ2.js → useScrollToBlock-BTFw0b9O.js} +3 -3
- package/dist/{vue.runtime.esm-bundler-D9JUcKrV.js → vue.runtime.esm-bundler-DShF3P6k.js} +1192 -1181
- package/dist/{x-BPKoRPTG.js → x-D_-42Ukq.js} +1 -1
- package/package.json +9 -12
- package/dist/CloudHeaderExtras-CRUQvgSV.js +0 -59
- package/dist/SavedBlocksBrowserModal-BORqqASb.js +0 -322
- package/dist/TitleEditor-pYEUX6lR.js +0 -198
- package/dist/TplModal-DRx4ytx8.js +0 -51
- package/dist/cdn/chunks/VersionHistoryMenu-BfVUvWHT.js.map +0 -1
- package/dist/cdn/chunks/ca-CNRWAMHI.js.map +0 -1
- package/dist/cdn/chunks/cloud-CullB76F.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-Cx2JpUYU.js +0 -443
- package/dist/cdn/chunks/createCloudRuntime-Cx2JpUYU.js.map +0 -1
- package/dist/cdn/chunks/de-DFYCT4QU.js.map +0 -1
- package/dist/cdn/chunks/en-rGHphLWo.js +0 -2
- package/dist/cdn/chunks/es-OgkdMZGX.js.map +0 -1
- package/dist/cdn/chunks/fr-Dswns199.js.map +0 -1
- package/dist/cdn/chunks/nl-CbcPJlrL.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-BibOQm-o.js.map +0 -1
- package/dist/cdn/chunks/src-CaXeO-gG.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-D4MytYB9.js.map +0 -1
- package/dist/createCloudRuntime-PevFSH74.js +0 -441
- package/dist/dist-dNiknO7j.js +0 -251
- package/dist/dist-heatwAdo.js +0 -150
|
@@ -82,10 +82,10 @@ var s = class e {
|
|
|
82
82
|
let r = await fetch(this.url, n);
|
|
83
83
|
if (!r.ok) throw new a(`Token refresh failed: ${r.status}`, r.status);
|
|
84
84
|
let i = await r.json();
|
|
85
|
-
if (!i.token || !i.
|
|
86
|
-
return this.accessToken = i.token, this.expiresAt = /* @__PURE__ */ new Date(i.
|
|
87
|
-
allowedEmails: i.
|
|
88
|
-
signature: i.
|
|
85
|
+
if (!i.token || !i.expiresAt || !i.projectId || !i.tenant) throw Error("Invalid token response: missing token, expiresAt, projectId, or tenant");
|
|
86
|
+
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 ? {
|
|
87
|
+
allowedEmails: i.testEmail.allowedEmails,
|
|
88
|
+
signature: i.testEmail.signature
|
|
89
89
|
} : null, this._userConfig = i.user?.id && i.user?.name && i.user?.signature ? {
|
|
90
90
|
id: i.user.id,
|
|
91
91
|
name: i.user.name,
|
|
@@ -107,78 +107,56 @@ var s = class e {
|
|
|
107
107
|
return a.status === 401 && (a = await i(await this.refreshToken())), a;
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
function c(e, t) {
|
|
111
|
-
return e.mode === "direct" ? new s({
|
|
112
|
-
url: `${(e.baseUrl ?? "https://templatical.com").replace(/\/$/, "")}/api/v1/auth/token`,
|
|
113
|
-
baseUrl: e.baseUrl,
|
|
114
|
-
requestOptions: {
|
|
115
|
-
method: "POST",
|
|
116
|
-
headers: { "Content-Type": "application/json" },
|
|
117
|
-
body: {
|
|
118
|
-
client_id: e.clientId,
|
|
119
|
-
client_secret: e.clientSecret,
|
|
120
|
-
tenant: e.tenant,
|
|
121
|
-
client_type: "sdk"
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
onError: t
|
|
125
|
-
}) : new s({
|
|
126
|
-
url: e.url,
|
|
127
|
-
baseUrl: e.baseUrl,
|
|
128
|
-
requestOptions: e.requestOptions,
|
|
129
|
-
onError: t
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
110
|
//#endregion
|
|
133
111
|
//#region ../core/src/cloud/url-builder.ts
|
|
134
|
-
function
|
|
112
|
+
function c(e, t) {
|
|
135
113
|
return e.replace(/\{(\w+)\}/g, (e, n) => encodeURIComponent(t[n] ?? ""));
|
|
136
114
|
}
|
|
137
|
-
var
|
|
115
|
+
var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{template}`, d = `${u}/ai`, f = `${l}/media`, p = `${f}/folders`, m = `${l}/saved-modules`, h = {
|
|
138
116
|
health: "/api/v1/health",
|
|
139
|
-
"projects.config": `${
|
|
140
|
-
"broadcasting.auth": `${
|
|
141
|
-
"templates.store": `${
|
|
142
|
-
"templates.show": `${
|
|
143
|
-
"templates.update": `${
|
|
144
|
-
"templates.destroy": `${
|
|
145
|
-
"templates.export": `${
|
|
146
|
-
"templates.importFromBeefree": `${
|
|
147
|
-
"templates.sendTestEmail": `${
|
|
148
|
-
"versions.index": `${
|
|
149
|
-
"versions.store": `${
|
|
150
|
-
"versions.show": `${
|
|
151
|
-
"versions.restore": `${
|
|
152
|
-
"comments.index": `${
|
|
153
|
-
"comments.store": `${
|
|
154
|
-
"comments.update": `${
|
|
155
|
-
"comments.destroy": `${
|
|
156
|
-
"comments.resolve": `${
|
|
157
|
-
"ai.generate": `${
|
|
158
|
-
"ai.conversationMessages": `${
|
|
159
|
-
"ai.suggestions": `${
|
|
160
|
-
"ai.rewriteText": `${
|
|
161
|
-
"ai.score": `${
|
|
162
|
-
"ai.fixFinding": `${
|
|
163
|
-
"ai.generateFromDesign": `${
|
|
164
|
-
"media.upload": `${
|
|
165
|
-
"media.browse": `${
|
|
166
|
-
"media.delete": `${
|
|
167
|
-
"media.move": `${
|
|
168
|
-
"media.update": `${
|
|
169
|
-
"media.replace": `${
|
|
170
|
-
"media.checkUsage": `${
|
|
171
|
-
"media.frequentlyUsed": `${
|
|
172
|
-
"media.importFromUrl": `${
|
|
173
|
-
"folders.index": `${
|
|
174
|
-
"folders.store": `${
|
|
175
|
-
"folders.update": `${
|
|
176
|
-
"folders.destroy": `${
|
|
177
|
-
"savedModules.index": `${
|
|
178
|
-
"savedModules.store": `${
|
|
179
|
-
"savedModules.update": `${
|
|
180
|
-
"savedModules.destroy": `${
|
|
181
|
-
},
|
|
117
|
+
"projects.config": `${l}/config`,
|
|
118
|
+
"broadcasting.auth": `${l}/broadcasting/auth`,
|
|
119
|
+
"templates.store": `${l}/templates`,
|
|
120
|
+
"templates.show": `${u}`,
|
|
121
|
+
"templates.update": `${u}`,
|
|
122
|
+
"templates.destroy": `${u}`,
|
|
123
|
+
"templates.export": `${u}/export`,
|
|
124
|
+
"templates.importFromBeefree": `${l}/templates/import/from-beefree`,
|
|
125
|
+
"templates.sendTestEmail": `${u}/send-test-email`,
|
|
126
|
+
"versions.index": `${u}/versions`,
|
|
127
|
+
"versions.store": `${u}/versions`,
|
|
128
|
+
"versions.show": `${u}/versions/{version}`,
|
|
129
|
+
"versions.restore": `${u}/versions/{version}/restore`,
|
|
130
|
+
"comments.index": `${u}/comments`,
|
|
131
|
+
"comments.store": `${u}/comments`,
|
|
132
|
+
"comments.update": `${u}/comments/{comment}`,
|
|
133
|
+
"comments.destroy": `${u}/comments/{comment}`,
|
|
134
|
+
"comments.resolve": `${u}/comments/{comment}/resolve`,
|
|
135
|
+
"ai.generate": `${d}/generate`,
|
|
136
|
+
"ai.conversationMessages": `${d}/conversation-messages`,
|
|
137
|
+
"ai.suggestions": `${d}/suggestions`,
|
|
138
|
+
"ai.rewriteText": `${d}/rewrite-text`,
|
|
139
|
+
"ai.score": `${d}/score`,
|
|
140
|
+
"ai.fixFinding": `${d}/fix-finding`,
|
|
141
|
+
"ai.generateFromDesign": `${d}/generate-from-design`,
|
|
142
|
+
"media.upload": `${f}/upload`,
|
|
143
|
+
"media.browse": `${f}/browse`,
|
|
144
|
+
"media.delete": `${f}/delete`,
|
|
145
|
+
"media.move": `${f}/move`,
|
|
146
|
+
"media.update": `${f}/{media}`,
|
|
147
|
+
"media.replace": `${f}/{media}/replace`,
|
|
148
|
+
"media.checkUsage": `${f}/check-usage`,
|
|
149
|
+
"media.frequentlyUsed": `${f}/frequently-used`,
|
|
150
|
+
"media.importFromUrl": `${f}/import-from-url`,
|
|
151
|
+
"folders.index": `${p}`,
|
|
152
|
+
"folders.store": `${p}`,
|
|
153
|
+
"folders.update": `${p}/{mediaFolder}`,
|
|
154
|
+
"folders.destroy": `${p}/{mediaFolder}`,
|
|
155
|
+
"savedModules.index": `${m}`,
|
|
156
|
+
"savedModules.store": `${m}`,
|
|
157
|
+
"savedModules.update": `${m}/{savedModule}`,
|
|
158
|
+
"savedModules.destroy": `${m}/{savedModule}`
|
|
159
|
+
}, g = class {
|
|
182
160
|
authManager;
|
|
183
161
|
constructor(e) {
|
|
184
162
|
this.authManager = e;
|
|
@@ -218,7 +196,7 @@ var u = "/api/v1/projects/{project}/tenants/{tenant}", d = `${u}/templates/{temp
|
|
|
218
196
|
return e.message;
|
|
219
197
|
}
|
|
220
198
|
async createTemplate(e, t) {
|
|
221
|
-
return this.request(
|
|
199
|
+
return this.request(c(h["templates.store"], this.baseParams), {
|
|
222
200
|
method: "POST",
|
|
223
201
|
body: JSON.stringify(t === void 0 ? { content: e } : {
|
|
224
202
|
content: e,
|
|
@@ -227,13 +205,13 @@ var u = "/api/v1/projects/{project}/tenants/{tenant}", d = `${u}/templates/{temp
|
|
|
227
205
|
});
|
|
228
206
|
}
|
|
229
207
|
async getTemplate(e) {
|
|
230
|
-
return this.request(
|
|
208
|
+
return this.request(c(h["templates.show"], {
|
|
231
209
|
...this.baseParams,
|
|
232
210
|
template: e
|
|
233
211
|
}));
|
|
234
212
|
}
|
|
235
213
|
async updateTemplate(e, t) {
|
|
236
|
-
return this.request(
|
|
214
|
+
return this.request(c(h["templates.update"], {
|
|
237
215
|
...this.baseParams,
|
|
238
216
|
template: e
|
|
239
217
|
}), {
|
|
@@ -242,7 +220,7 @@ var u = "/api/v1/projects/{project}/tenants/{tenant}", d = `${u}/templates/{temp
|
|
|
242
220
|
});
|
|
243
221
|
}
|
|
244
222
|
async createVersion(e, t, n) {
|
|
245
|
-
return this.request(
|
|
223
|
+
return this.request(c(h["versions.store"], {
|
|
246
224
|
...this.baseParams,
|
|
247
225
|
template: e
|
|
248
226
|
}), {
|
|
@@ -254,26 +232,26 @@ var u = "/api/v1/projects/{project}/tenants/{tenant}", d = `${u}/templates/{temp
|
|
|
254
232
|
});
|
|
255
233
|
}
|
|
256
234
|
async deleteTemplate(e) {
|
|
257
|
-
return this.request(
|
|
235
|
+
return this.request(c(h["templates.destroy"], {
|
|
258
236
|
...this.baseParams,
|
|
259
237
|
template: e
|
|
260
238
|
}), { method: "DELETE" });
|
|
261
239
|
}
|
|
262
240
|
async getVersions(e) {
|
|
263
|
-
return this.request(
|
|
241
|
+
return this.request(c(h["versions.index"], {
|
|
264
242
|
...this.baseParams,
|
|
265
243
|
template: e
|
|
266
244
|
}));
|
|
267
245
|
}
|
|
268
246
|
async getVersion(e, t) {
|
|
269
|
-
return this.request(
|
|
247
|
+
return this.request(c(h["versions.show"], {
|
|
270
248
|
...this.baseParams,
|
|
271
249
|
template: e,
|
|
272
250
|
version: t
|
|
273
251
|
}));
|
|
274
252
|
}
|
|
275
253
|
async restoreVersion(e, t) {
|
|
276
|
-
return this.request(
|
|
254
|
+
return this.request(c(h["versions.restore"], {
|
|
277
255
|
...this.baseParams,
|
|
278
256
|
template: e,
|
|
279
257
|
version: t
|
|
@@ -284,7 +262,7 @@ var u = "/api/v1/projects/{project}/tenants/{tenant}", d = `${u}/templates/{temp
|
|
|
284
262
|
custom_fonts: t.customFonts,
|
|
285
263
|
default_fallback: t.defaultFallback
|
|
286
264
|
}) : void 0;
|
|
287
|
-
return this.request(
|
|
265
|
+
return this.request(c(h["templates.export"], {
|
|
288
266
|
...this.baseParams,
|
|
289
267
|
template: e
|
|
290
268
|
}), {
|
|
@@ -293,7 +271,7 @@ var u = "/api/v1/projects/{project}/tenants/{tenant}", d = `${u}/templates/{temp
|
|
|
293
271
|
});
|
|
294
272
|
}
|
|
295
273
|
async sendTestEmail(e, t) {
|
|
296
|
-
await this.request(
|
|
274
|
+
await this.request(c(h["templates.sendTestEmail"], {
|
|
297
275
|
...this.baseParams,
|
|
298
276
|
template: e
|
|
299
277
|
}), {
|
|
@@ -302,11 +280,11 @@ var u = "/api/v1/projects/{project}/tenants/{tenant}", d = `${u}/templates/{temp
|
|
|
302
280
|
});
|
|
303
281
|
}
|
|
304
282
|
commentsUrl(e, t) {
|
|
305
|
-
return t ?
|
|
283
|
+
return t ? c(h["comments.update"], {
|
|
306
284
|
...this.baseParams,
|
|
307
285
|
template: e,
|
|
308
286
|
comment: t
|
|
309
|
-
}) :
|
|
287
|
+
}) : c(h["comments.index"], {
|
|
310
288
|
...this.baseParams,
|
|
311
289
|
template: e
|
|
312
290
|
});
|
|
@@ -336,7 +314,7 @@ var u = "/api/v1/projects/{project}/tenants/{tenant}", d = `${u}/templates/{temp
|
|
|
336
314
|
});
|
|
337
315
|
}
|
|
338
316
|
async resolveComment(e, t, n, r) {
|
|
339
|
-
return this.request(
|
|
317
|
+
return this.request(c(h["comments.resolve"], {
|
|
340
318
|
...this.baseParams,
|
|
341
319
|
template: e,
|
|
342
320
|
comment: t
|
|
@@ -347,22 +325,22 @@ var u = "/api/v1/projects/{project}/tenants/{tenant}", d = `${u}/templates/{temp
|
|
|
347
325
|
});
|
|
348
326
|
}
|
|
349
327
|
async fetchConfig() {
|
|
350
|
-
return this.request(
|
|
328
|
+
return this.request(c(h["projects.config"], this.baseParams));
|
|
351
329
|
}
|
|
352
330
|
async listModules(e, t) {
|
|
353
|
-
let n =
|
|
331
|
+
let n = c(h["savedModules.index"], this.baseParams), r = new URLSearchParams();
|
|
354
332
|
e && r.set("search", e), t && r.set("category", t);
|
|
355
333
|
let i = r.size > 0 ? `?${r}` : "";
|
|
356
334
|
return this.request(`${n}${i}`);
|
|
357
335
|
}
|
|
358
336
|
async createModule(e) {
|
|
359
|
-
return this.request(
|
|
337
|
+
return this.request(c(h["savedModules.store"], this.baseParams), {
|
|
360
338
|
method: "POST",
|
|
361
339
|
body: JSON.stringify(e)
|
|
362
340
|
});
|
|
363
341
|
}
|
|
364
342
|
async updateModule(e, t) {
|
|
365
|
-
return this.request(
|
|
343
|
+
return this.request(c(h["savedModules.update"], {
|
|
366
344
|
...this.baseParams,
|
|
367
345
|
savedModule: e
|
|
368
346
|
}), {
|
|
@@ -371,11 +349,163 @@ var u = "/api/v1/projects/{project}/tenants/{tenant}", d = `${u}/templates/{temp
|
|
|
371
349
|
});
|
|
372
350
|
}
|
|
373
351
|
async deleteModule(e) {
|
|
374
|
-
return this.request(
|
|
352
|
+
return this.request(c(h["savedModules.destroy"], {
|
|
375
353
|
...this.baseParams,
|
|
376
354
|
savedModule: e
|
|
377
355
|
}), { method: "DELETE" });
|
|
378
356
|
}
|
|
357
|
+
}, _ = class {
|
|
358
|
+
authManager;
|
|
359
|
+
constructor(e) {
|
|
360
|
+
this.authManager = e;
|
|
361
|
+
}
|
|
362
|
+
get projectId() {
|
|
363
|
+
return this.authManager.projectId;
|
|
364
|
+
}
|
|
365
|
+
get tenantSlug() {
|
|
366
|
+
return this.authManager.tenantSlug;
|
|
367
|
+
}
|
|
368
|
+
get baseParams() {
|
|
369
|
+
return {
|
|
370
|
+
project: this.projectId,
|
|
371
|
+
tenant: this.tenantSlug
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
async request(e, t = {}) {
|
|
375
|
+
let n = await this.authManager.authenticatedFetch(e, {
|
|
376
|
+
...t,
|
|
377
|
+
headers: {
|
|
378
|
+
"Content-Type": "application/json",
|
|
379
|
+
Accept: "application/json",
|
|
380
|
+
...t.headers
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
if (!n.ok) {
|
|
384
|
+
let e = await n.json().catch(() => ({ message: `HTTP error ${n.status}` }));
|
|
385
|
+
throw Error(e.message, { cause: e });
|
|
386
|
+
}
|
|
387
|
+
if (n.status !== 204) return (await n.json()).data;
|
|
388
|
+
}
|
|
389
|
+
async browseMedia(e) {
|
|
390
|
+
let t = new URLSearchParams();
|
|
391
|
+
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);
|
|
392
|
+
let n = t.toString(), r = `${c(h["media.browse"], this.baseParams)}${n ? `?${n}` : ""}`, i = await this.authManager.authenticatedFetch(r, { headers: { Accept: "application/json" } });
|
|
393
|
+
if (!i.ok) {
|
|
394
|
+
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
395
|
+
throw Error(e.message, { cause: e });
|
|
396
|
+
}
|
|
397
|
+
return i.json();
|
|
398
|
+
}
|
|
399
|
+
async uploadMedia(e, t) {
|
|
400
|
+
let n = new FormData();
|
|
401
|
+
n.append("file", e), t && n.append("folderId", t);
|
|
402
|
+
let r = c(h["media.upload"], this.baseParams), i = await this.authManager.authenticatedFetch(r, {
|
|
403
|
+
method: "POST",
|
|
404
|
+
headers: { Accept: "application/json" },
|
|
405
|
+
body: n
|
|
406
|
+
});
|
|
407
|
+
if (!i.ok) {
|
|
408
|
+
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
409
|
+
throw Error(e.message, { cause: e });
|
|
410
|
+
}
|
|
411
|
+
return (await i.json()).data;
|
|
412
|
+
}
|
|
413
|
+
async updateMedia(e, t, n) {
|
|
414
|
+
let r = {};
|
|
415
|
+
return t !== void 0 && (r.filename = t), n !== void 0 && (r.alt = n), this.request(c(h["media.update"], {
|
|
416
|
+
...this.baseParams,
|
|
417
|
+
media: e
|
|
418
|
+
}), {
|
|
419
|
+
method: "PUT",
|
|
420
|
+
body: JSON.stringify(r)
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
async deleteMedia(e) {
|
|
424
|
+
return this.request(c(h["media.delete"], this.baseParams), {
|
|
425
|
+
method: "POST",
|
|
426
|
+
body: JSON.stringify({ ids: e })
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
async moveMedia(e, t) {
|
|
430
|
+
return this.request(c(h["media.move"], this.baseParams), {
|
|
431
|
+
method: "POST",
|
|
432
|
+
body: JSON.stringify({
|
|
433
|
+
ids: e,
|
|
434
|
+
folderId: t
|
|
435
|
+
})
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
async getMediaFolders() {
|
|
439
|
+
return this.request(c(h["folders.index"], this.baseParams));
|
|
440
|
+
}
|
|
441
|
+
async createMediaFolder(e, t) {
|
|
442
|
+
return this.request(c(h["folders.store"], this.baseParams), {
|
|
443
|
+
method: "POST",
|
|
444
|
+
body: JSON.stringify({
|
|
445
|
+
name: e,
|
|
446
|
+
parentId: t ?? null
|
|
447
|
+
})
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
async renameMediaFolder(e, t) {
|
|
451
|
+
return this.request(c(h["folders.update"], {
|
|
452
|
+
...this.baseParams,
|
|
453
|
+
mediaFolder: e
|
|
454
|
+
}), {
|
|
455
|
+
method: "PUT",
|
|
456
|
+
body: JSON.stringify({ name: t })
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
async deleteMediaFolder(e) {
|
|
460
|
+
return this.request(c(h["folders.destroy"], {
|
|
461
|
+
...this.baseParams,
|
|
462
|
+
mediaFolder: e
|
|
463
|
+
}), { method: "DELETE" });
|
|
464
|
+
}
|
|
465
|
+
async checkMediaUsage(e) {
|
|
466
|
+
let t = await this.authManager.authenticatedFetch(c(h["media.checkUsage"], this.baseParams), {
|
|
467
|
+
method: "POST",
|
|
468
|
+
headers: {
|
|
469
|
+
"Content-Type": "application/json",
|
|
470
|
+
Accept: "application/json"
|
|
471
|
+
},
|
|
472
|
+
body: JSON.stringify({ ids: e })
|
|
473
|
+
});
|
|
474
|
+
if (!t.ok) {
|
|
475
|
+
let e = await t.json().catch(() => ({ message: `HTTP error ${t.status}` }));
|
|
476
|
+
throw Error(e.message, { cause: e });
|
|
477
|
+
}
|
|
478
|
+
return t.json();
|
|
479
|
+
}
|
|
480
|
+
async getFrequentlyUsed() {
|
|
481
|
+
return this.request(c(h["media.frequentlyUsed"], this.baseParams));
|
|
482
|
+
}
|
|
483
|
+
async importFromUrl(e, t) {
|
|
484
|
+
return this.request(c(h["media.importFromUrl"], this.baseParams), {
|
|
485
|
+
method: "POST",
|
|
486
|
+
body: JSON.stringify({
|
|
487
|
+
url: e,
|
|
488
|
+
folderId: t ?? null
|
|
489
|
+
})
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
async replaceMedia(e, t) {
|
|
493
|
+
let n = new FormData();
|
|
494
|
+
n.append("file", t);
|
|
495
|
+
let r = c(h["media.replace"], {
|
|
496
|
+
...this.baseParams,
|
|
497
|
+
media: e
|
|
498
|
+
}), i = await this.authManager.authenticatedFetch(r, {
|
|
499
|
+
method: "POST",
|
|
500
|
+
headers: { Accept: "application/json" },
|
|
501
|
+
body: n
|
|
502
|
+
});
|
|
503
|
+
if (!i.ok) {
|
|
504
|
+
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
505
|
+
throw Error(e.message, { cause: e });
|
|
506
|
+
}
|
|
507
|
+
return (await i.json()).data;
|
|
508
|
+
}
|
|
379
509
|
};
|
|
380
510
|
//#endregion
|
|
381
511
|
//#region ../core/src/cloud/websocket-client.ts
|
|
@@ -383,7 +513,7 @@ function v(e) {
|
|
|
383
513
|
return {
|
|
384
514
|
host: e.host,
|
|
385
515
|
port: e.port,
|
|
386
|
-
appKey: e.
|
|
516
|
+
appKey: e.appKey
|
|
387
517
|
};
|
|
388
518
|
}
|
|
389
519
|
var y = class {
|
|
@@ -402,7 +532,7 @@ var y = class {
|
|
|
402
532
|
} catch {
|
|
403
533
|
throw Error("[Templatical] Cloud features require the optional peer dependency 'pusher-js'. Please install it.");
|
|
404
534
|
}
|
|
405
|
-
let { host: n, port: r, appKey: i } = this.config, a = this.authManager.resolveUrl(
|
|
535
|
+
let { host: n, port: r, appKey: i } = this.config, a = this.authManager.resolveUrl(c(h["broadcasting.auth"], {
|
|
406
536
|
project: this.authManager.projectId,
|
|
407
537
|
tenant: this.authManager.tenantSlug
|
|
408
538
|
}));
|
|
@@ -422,9 +552,9 @@ var y = class {
|
|
|
422
552
|
Accept: "application/json"
|
|
423
553
|
},
|
|
424
554
|
params: {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
555
|
+
userId: this.authManager.userConfig?.id ?? "",
|
|
556
|
+
userName: this.authManager.userConfig?.name ?? "",
|
|
557
|
+
userSignature: this.authManager.userConfig?.signature ?? ""
|
|
428
558
|
}
|
|
429
559
|
}
|
|
430
560
|
}), this.pusher.connection.bind("error", (e) => {
|
|
@@ -456,25 +586,25 @@ var y = class {
|
|
|
456
586
|
function b(e, t) {
|
|
457
587
|
let { operation: n, data: r } = t;
|
|
458
588
|
switch (n) {
|
|
459
|
-
case "
|
|
460
|
-
e.addBlock(r.block, r.
|
|
589
|
+
case "addBlock":
|
|
590
|
+
e.addBlock(r.block, r.sectionId, r.columnIndex, r.index);
|
|
461
591
|
break;
|
|
462
|
-
case "
|
|
463
|
-
e.updateBlock(r.
|
|
592
|
+
case "updateBlock":
|
|
593
|
+
e.updateBlock(r.blockId, r.updates);
|
|
464
594
|
break;
|
|
465
|
-
case "
|
|
466
|
-
e.removeBlock(r.
|
|
595
|
+
case "deleteBlock":
|
|
596
|
+
e.removeBlock(r.blockId);
|
|
467
597
|
break;
|
|
468
|
-
case "
|
|
469
|
-
e.moveBlock(r.
|
|
598
|
+
case "moveBlock":
|
|
599
|
+
e.moveBlock(r.blockId, r.index, r.sectionId, r.columnIndex);
|
|
470
600
|
break;
|
|
471
|
-
case "
|
|
601
|
+
case "updateSettings":
|
|
472
602
|
e.updateSettings(r.updates);
|
|
473
603
|
break;
|
|
474
|
-
case "
|
|
604
|
+
case "setContent":
|
|
475
605
|
e.setContent(r.content);
|
|
476
606
|
break;
|
|
477
|
-
case "
|
|
607
|
+
case "updateBlockStyle": e.updateBlock(r.blockId, { styles: r.styles });
|
|
478
608
|
}
|
|
479
609
|
}
|
|
480
610
|
//#endregion
|
|
@@ -484,7 +614,7 @@ function S() {
|
|
|
484
614
|
return `msg_${Date.now()}_${++x}`;
|
|
485
615
|
}
|
|
486
616
|
function C(e) {
|
|
487
|
-
let { authManager: t, getTemplateId: r, onApply: i, onError: a } = e, o = n([]), s = n(!1),
|
|
617
|
+
let { authManager: t, getTemplateId: r, onApply: i, onError: a } = e, o = n([]), s = n(!1), l = n(!1), u = n(null), d = n(null), f = n(null), p = n(null), m = n(null), g = n(null), _ = n(!1), v = n([]), y = n(!1);
|
|
488
618
|
function b(e, t) {
|
|
489
619
|
let n = o.value.findIndex((t) => t.id === e);
|
|
490
620
|
if (n === -1) return;
|
|
@@ -501,9 +631,9 @@ function C(e) {
|
|
|
501
631
|
async function x() {
|
|
502
632
|
let e = r();
|
|
503
633
|
if (e) {
|
|
504
|
-
|
|
634
|
+
l.value = !0;
|
|
505
635
|
try {
|
|
506
|
-
let n =
|
|
636
|
+
let n = c(h["ai.conversationMessages"], {
|
|
507
637
|
project: t.projectId,
|
|
508
638
|
tenant: t.tenantSlug,
|
|
509
639
|
template: e
|
|
@@ -513,14 +643,14 @@ function C(e) {
|
|
|
513
643
|
});
|
|
514
644
|
if (!r.ok) return;
|
|
515
645
|
let i = await r.json();
|
|
516
|
-
i.
|
|
646
|
+
i.conversationId && (f.value = i.conversationId), Array.isArray(i.data) && i.data.length > 0 && (o.value = i.data.map((e) => ({
|
|
517
647
|
id: e.id,
|
|
518
648
|
role: e.role,
|
|
519
649
|
content: e.content,
|
|
520
|
-
timestamp: new Date(e.
|
|
650
|
+
timestamp: new Date(e.createdAt).getTime()
|
|
521
651
|
})));
|
|
522
652
|
} catch {} finally {
|
|
523
|
-
|
|
653
|
+
l.value = !1;
|
|
524
654
|
}
|
|
525
655
|
}
|
|
526
656
|
}
|
|
@@ -529,7 +659,7 @@ function C(e) {
|
|
|
529
659
|
if (i) {
|
|
530
660
|
y.value = !0;
|
|
531
661
|
try {
|
|
532
|
-
let r =
|
|
662
|
+
let r = c(h["ai.suggestions"], {
|
|
533
663
|
project: t.projectId,
|
|
534
664
|
tenant: t.tenantSlug,
|
|
535
665
|
template: i
|
|
@@ -540,8 +670,8 @@ function C(e) {
|
|
|
540
670
|
Accept: "text/event-stream"
|
|
541
671
|
},
|
|
542
672
|
body: JSON.stringify({
|
|
543
|
-
|
|
544
|
-
|
|
673
|
+
currentContent: e,
|
|
674
|
+
mergeTags: n.map((e) => ({
|
|
545
675
|
label: e.label,
|
|
546
676
|
value: e.value
|
|
547
677
|
}))
|
|
@@ -550,13 +680,13 @@ function C(e) {
|
|
|
550
680
|
if (!a.ok) return;
|
|
551
681
|
let o = a.body?.getReader();
|
|
552
682
|
if (!o) return;
|
|
553
|
-
let s = new TextDecoder(),
|
|
683
|
+
let s = new TextDecoder(), l = "";
|
|
554
684
|
for (;;) {
|
|
555
685
|
let { done: e, value: t } = await o.read();
|
|
556
686
|
if (e) break;
|
|
557
|
-
|
|
558
|
-
let n =
|
|
559
|
-
|
|
687
|
+
l += s.decode(t, { stream: !0 });
|
|
688
|
+
let n = l.split("\n");
|
|
689
|
+
l = n.pop() ?? "";
|
|
560
690
|
for (let e of n) {
|
|
561
691
|
if (!e.startsWith("data: ")) continue;
|
|
562
692
|
let t;
|
|
@@ -573,7 +703,7 @@ function C(e) {
|
|
|
573
703
|
}
|
|
574
704
|
}
|
|
575
705
|
}
|
|
576
|
-
async function w(e, n,
|
|
706
|
+
async function w(e, n, l) {
|
|
577
707
|
let y = r();
|
|
578
708
|
if (!y) throw Error("Template must be saved before using AI generation");
|
|
579
709
|
s.value = !0, u.value = null, d.value = null, v.value = [];
|
|
@@ -592,7 +722,7 @@ function C(e) {
|
|
|
592
722
|
timestamp: Date.now()
|
|
593
723
|
}];
|
|
594
724
|
try {
|
|
595
|
-
let r =
|
|
725
|
+
let r = c(h["ai.generate"], {
|
|
596
726
|
project: t.projectId,
|
|
597
727
|
tenant: t.tenantSlug,
|
|
598
728
|
template: y
|
|
@@ -604,17 +734,17 @@ function C(e) {
|
|
|
604
734
|
},
|
|
605
735
|
body: JSON.stringify({
|
|
606
736
|
prompt: e,
|
|
607
|
-
|
|
608
|
-
|
|
737
|
+
currentContent: n,
|
|
738
|
+
mergeTags: l.map((e) => ({
|
|
609
739
|
label: e.label,
|
|
610
740
|
value: e.value
|
|
611
741
|
})),
|
|
612
|
-
|
|
742
|
+
conversationId: f.value
|
|
613
743
|
})
|
|
614
744
|
});
|
|
615
745
|
if (!a.ok) {
|
|
616
746
|
let e = await a.json().catch(() => null);
|
|
617
|
-
throw Error(a.status === 403 ? "
|
|
747
|
+
throw Error(a.status === 403 ? "aiGenerationNotAvailable" : e?.message || "Failed to generate template");
|
|
618
748
|
}
|
|
619
749
|
let s = a.body?.getReader();
|
|
620
750
|
if (!s) throw Error("Failed to read stream");
|
|
@@ -636,7 +766,7 @@ function C(e) {
|
|
|
636
766
|
}
|
|
637
767
|
if (r.type === "text") b(C, { content: (o.value.find((e) => e.id === C)?.content ?? "") + r.text });
|
|
638
768
|
else if (r.type === "error") throw Error(r.message || "Failed to generate template");
|
|
639
|
-
else r.type === "done" && (r.
|
|
769
|
+
else r.type === "done" && (r.conversationId && (f.value = r.conversationId), b(C, { content: r.text }), x = r.content ?? null, x ? (m.value = n, g.value = x, p.value = C, _.value = !1, i?.(x)) : u.value = "ai_apply_failed");
|
|
640
770
|
}
|
|
641
771
|
}
|
|
642
772
|
} finally {
|
|
@@ -651,15 +781,15 @@ function C(e) {
|
|
|
651
781
|
}
|
|
652
782
|
}
|
|
653
783
|
function T() {
|
|
654
|
-
_.value ? (
|
|
784
|
+
_.value ? (g.value && i?.(g.value), _.value = !1) : (m.value && i?.(m.value), _.value = !0);
|
|
655
785
|
}
|
|
656
786
|
function E() {
|
|
657
|
-
o.value = [], f.value = null, u.value = null, p.value = null, m.value = null,
|
|
787
|
+
o.value = [], f.value = null, u.value = null, p.value = null, m.value = null, g.value = null, _.value = !1;
|
|
658
788
|
}
|
|
659
789
|
return {
|
|
660
790
|
messages: o,
|
|
661
791
|
isGenerating: s,
|
|
662
|
-
isLoadingHistory:
|
|
792
|
+
isLoadingHistory: l,
|
|
663
793
|
isLastChangeReverted: _,
|
|
664
794
|
lastApplyMessageId: p,
|
|
665
795
|
error: u,
|
|
@@ -687,13 +817,13 @@ function w(e) {
|
|
|
687
817
|
//#endregion
|
|
688
818
|
//#region ../core/src/cloud/template-scoring.ts
|
|
689
819
|
function T(e) {
|
|
690
|
-
let { authManager: t, getTemplateId: r } = e, i = n(!1), a = n(null), o = n(null), s = n(null),
|
|
820
|
+
let { authManager: t, getTemplateId: r } = e, i = n(!1), a = n(null), o = n(null), s = n(null), l = n(""), u = n(null);
|
|
691
821
|
async function d(e, n) {
|
|
692
822
|
let s = r();
|
|
693
823
|
if (!s) return null;
|
|
694
824
|
i.value = !0, o.value = null, a.value = null;
|
|
695
825
|
try {
|
|
696
|
-
let r =
|
|
826
|
+
let r = c(h["ai.score"], {
|
|
697
827
|
project: t.projectId,
|
|
698
828
|
tenant: t.tenantSlug,
|
|
699
829
|
template: s
|
|
@@ -704,25 +834,25 @@ function T(e) {
|
|
|
704
834
|
Accept: "text/event-stream"
|
|
705
835
|
},
|
|
706
836
|
body: JSON.stringify({
|
|
707
|
-
|
|
708
|
-
|
|
837
|
+
currentContent: e,
|
|
838
|
+
mergeTags: n.map((e) => ({
|
|
709
839
|
label: e.label,
|
|
710
840
|
value: e.value
|
|
711
841
|
}))
|
|
712
842
|
})
|
|
713
843
|
});
|
|
714
844
|
if (!i.ok) {
|
|
715
|
-
if (i.status === 403) throw Error("
|
|
845
|
+
if (i.status === 403) throw Error("aiGenerationNotAvailable");
|
|
716
846
|
let e = await i.json().catch(() => null);
|
|
717
847
|
throw Error(e?.message || "Failed to score template");
|
|
718
848
|
}
|
|
719
849
|
let o = i.body?.getReader();
|
|
720
850
|
if (!o) throw Error("Failed to read stream");
|
|
721
|
-
let
|
|
851
|
+
let l = new TextDecoder(), u = "", d = null;
|
|
722
852
|
for (;;) {
|
|
723
853
|
let { done: e, value: t } = await o.read();
|
|
724
854
|
if (e) break;
|
|
725
|
-
u +=
|
|
855
|
+
u += l.decode(t, { stream: !0 });
|
|
726
856
|
let n = u.split("\n");
|
|
727
857
|
u = n.pop() ?? "";
|
|
728
858
|
for (let e of n) {
|
|
@@ -748,9 +878,9 @@ function T(e) {
|
|
|
748
878
|
async function f(e, n, i) {
|
|
749
879
|
let a = r();
|
|
750
880
|
if (!a) return null;
|
|
751
|
-
s.value = n.id,
|
|
881
|
+
s.value = n.id, l.value = "", u.value = null;
|
|
752
882
|
try {
|
|
753
|
-
let r =
|
|
883
|
+
let r = c(h["ai.fixFinding"], {
|
|
754
884
|
project: t.projectId,
|
|
755
885
|
tenant: t.tenantSlug,
|
|
756
886
|
template: a
|
|
@@ -768,14 +898,14 @@ function T(e) {
|
|
|
768
898
|
suggestion: n.suggestion,
|
|
769
899
|
category: n.category
|
|
770
900
|
},
|
|
771
|
-
|
|
901
|
+
mergeTags: i.map((e) => ({
|
|
772
902
|
label: e.label,
|
|
773
903
|
value: e.value
|
|
774
904
|
}))
|
|
775
905
|
})
|
|
776
906
|
});
|
|
777
907
|
if (!o.ok) {
|
|
778
|
-
if (o.status === 403) throw Error("
|
|
908
|
+
if (o.status === 403) throw Error("aiGenerationNotAvailable");
|
|
779
909
|
let e = await o.json().catch(() => null);
|
|
780
910
|
throw Error(e?.message || "Failed to fix finding");
|
|
781
911
|
}
|
|
@@ -796,7 +926,7 @@ function T(e) {
|
|
|
796
926
|
} catch {
|
|
797
927
|
continue;
|
|
798
928
|
}
|
|
799
|
-
if (t.type === "text")
|
|
929
|
+
if (t.type === "text") l.value += t.text;
|
|
800
930
|
else if (t.type === "error") throw Error(t.message || "Failed to fix finding");
|
|
801
931
|
else t.type === "done" && (f = t.content ?? null);
|
|
802
932
|
}
|
|
@@ -814,14 +944,14 @@ function T(e) {
|
|
|
814
944
|
n && (n.findings = n.findings.filter((e) => e.id !== t));
|
|
815
945
|
}
|
|
816
946
|
function m() {
|
|
817
|
-
i.value = !1, a.value = null, o.value = null, s.value = null,
|
|
947
|
+
i.value = !1, a.value = null, o.value = null, s.value = null, l.value = "", u.value = null;
|
|
818
948
|
}
|
|
819
949
|
return {
|
|
820
950
|
isScoring: i,
|
|
821
951
|
scoringResult: a,
|
|
822
952
|
error: o,
|
|
823
953
|
fixingFindingId: s,
|
|
824
|
-
fixStreamingText:
|
|
954
|
+
fixStreamingText: l,
|
|
825
955
|
fixError: u,
|
|
826
956
|
score: d,
|
|
827
957
|
fixFinding: f,
|
|
@@ -833,14 +963,14 @@ function T(e) {
|
|
|
833
963
|
//#region ../core/src/cloud/design-reference.ts
|
|
834
964
|
function E(e) {
|
|
835
965
|
let { authManager: t, getTemplateId: r, onApply: i, onError: a } = e, o = n(!1), s = n(null);
|
|
836
|
-
async function
|
|
966
|
+
async function l(e) {
|
|
837
967
|
let n = r();
|
|
838
968
|
if (!n) throw Error("Template must be saved before using design reference");
|
|
839
969
|
o.value = !0, s.value = null;
|
|
840
970
|
try {
|
|
841
971
|
let r = new FormData();
|
|
842
972
|
e.prompt && r.append("prompt", e.prompt), e.imageUpload && r.append("image_upload", e.imageUpload), e.pdfUpload && r.append("pdf_upload", e.pdfUpload);
|
|
843
|
-
let a =
|
|
973
|
+
let a = c(h["ai.generateFromDesign"], {
|
|
844
974
|
project: t.projectId,
|
|
845
975
|
tenant: t.tenantSlug,
|
|
846
976
|
template: n
|
|
@@ -851,15 +981,15 @@ function E(e) {
|
|
|
851
981
|
});
|
|
852
982
|
if (!o.ok) {
|
|
853
983
|
let e = await o.json().catch(() => null);
|
|
854
|
-
throw Error(o.status === 403 ? "
|
|
984
|
+
throw Error(o.status === 403 ? "aiGenerationNotAvailable" : e?.message || "Failed to generate template from design");
|
|
855
985
|
}
|
|
856
986
|
let s = o.body?.getReader();
|
|
857
987
|
if (!s) throw Error("Failed to read stream");
|
|
858
|
-
let
|
|
988
|
+
let l = new TextDecoder(), u = "", d = null;
|
|
859
989
|
for (;;) {
|
|
860
990
|
let { done: e, value: t } = await s.read();
|
|
861
991
|
if (e) break;
|
|
862
|
-
u +=
|
|
992
|
+
u += l.decode(t, { stream: !0 });
|
|
863
993
|
let n = u.split("\n");
|
|
864
994
|
u = n.pop() ?? "";
|
|
865
995
|
for (let e of n) {
|
|
@@ -888,7 +1018,7 @@ function E(e) {
|
|
|
888
1018
|
return {
|
|
889
1019
|
isGenerating: o,
|
|
890
1020
|
error: s,
|
|
891
|
-
generate:
|
|
1021
|
+
generate: l,
|
|
892
1022
|
reset: u
|
|
893
1023
|
};
|
|
894
1024
|
}
|
|
@@ -899,29 +1029,23 @@ function O(e) {
|
|
|
899
1029
|
let t = {
|
|
900
1030
|
id: e.id,
|
|
901
1031
|
body: e.body,
|
|
902
|
-
author:
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
blockId: e.block_id,
|
|
908
|
-
parentId: e.parent_id,
|
|
909
|
-
resolvedAt: e.resolved_at
|
|
1032
|
+
author: e.author,
|
|
1033
|
+
createdAt: e.createdAt,
|
|
1034
|
+
blockId: e.blockId,
|
|
1035
|
+
parentId: e.parentId,
|
|
1036
|
+
resolvedAt: e.resolvedAt
|
|
910
1037
|
};
|
|
911
|
-
return e.
|
|
912
|
-
id: e.resolved_by_identifier,
|
|
913
|
-
name: e.resolved_by_name ?? ""
|
|
914
|
-
}), e.replies?.length && (t.replies = e.replies.map(O)), t;
|
|
1038
|
+
return e.updatedAt !== e.createdAt && (t.updatedAt = e.updatedAt), e.resolvedBy && (t.resolvedBy = e.resolvedBy), e.replies?.length && (t.replies = e.replies.map(O)), t;
|
|
915
1039
|
}
|
|
916
1040
|
function k(e) {
|
|
917
|
-
let { authManager: n, channel: r, getSocketId: i } = e, a = new
|
|
1041
|
+
let { authManager: n, channel: r, getSocketId: i } = e, a = new g(n);
|
|
918
1042
|
function o() {
|
|
919
1043
|
let e = n.userConfig;
|
|
920
1044
|
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.");
|
|
921
1045
|
return {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1046
|
+
userId: e.id,
|
|
1047
|
+
userName: e.name,
|
|
1048
|
+
userSignature: e.signature
|
|
925
1049
|
};
|
|
926
1050
|
}
|
|
927
1051
|
function s() {
|
|
@@ -935,8 +1059,8 @@ function k(e) {
|
|
|
935
1059
|
async create(e, t) {
|
|
936
1060
|
return O(await a.createComment(e, {
|
|
937
1061
|
body: t.body,
|
|
938
|
-
|
|
939
|
-
|
|
1062
|
+
blockId: t.blockId,
|
|
1063
|
+
parentId: t.parentId,
|
|
940
1064
|
...o()
|
|
941
1065
|
}, s()));
|
|
942
1066
|
},
|
|
@@ -957,22 +1081,22 @@ function k(e) {
|
|
|
957
1081
|
function i(e) {
|
|
958
1082
|
let t = O(e.comment);
|
|
959
1083
|
switch (e.action) {
|
|
960
|
-
case "
|
|
1084
|
+
case "commentCreated":
|
|
961
1085
|
n({
|
|
962
1086
|
type: "created",
|
|
963
1087
|
comment: t
|
|
964
1088
|
});
|
|
965
1089
|
break;
|
|
966
|
-
case "
|
|
1090
|
+
case "commentDeleted":
|
|
967
1091
|
n({
|
|
968
1092
|
type: "deleted",
|
|
969
1093
|
commentId: t.id,
|
|
970
1094
|
parentId: t.parentId
|
|
971
1095
|
});
|
|
972
1096
|
break;
|
|
973
|
-
case "
|
|
974
|
-
case "
|
|
975
|
-
case "
|
|
1097
|
+
case "commentUpdated":
|
|
1098
|
+
case "commentResolved":
|
|
1099
|
+
case "commentUnresolved": n({
|
|
976
1100
|
type: "updated",
|
|
977
1101
|
comment: t
|
|
978
1102
|
});
|
|
@@ -992,8 +1116,8 @@ function k(e) {
|
|
|
992
1116
|
var A = [
|
|
993
1117
|
"pusher:member_added",
|
|
994
1118
|
"pusher:member_removed",
|
|
995
|
-
"client-
|
|
996
|
-
"client-
|
|
1119
|
+
"client-blockLocked",
|
|
1120
|
+
"client-blockUnlocked",
|
|
997
1121
|
"client-operation",
|
|
998
1122
|
"mcp-operation"
|
|
999
1123
|
];
|
|
@@ -1066,13 +1190,13 @@ function N(e) {
|
|
|
1066
1190
|
s.value && !d && s.value.trigger("client-operation", e);
|
|
1067
1191
|
}
|
|
1068
1192
|
function x(e) {
|
|
1069
|
-
s.value && s.value.trigger("client-
|
|
1193
|
+
s.value && s.value.trigger("client-blockLocked", {
|
|
1070
1194
|
blockId: e,
|
|
1071
1195
|
userId: f.value
|
|
1072
1196
|
});
|
|
1073
1197
|
}
|
|
1074
1198
|
function S(e) {
|
|
1075
|
-
s.value && s.value.trigger("client-
|
|
1199
|
+
s.value && s.value.trigger("client-blockUnlocked", { blockId: e });
|
|
1076
1200
|
}
|
|
1077
1201
|
return t(() => o.state.selectedBlockId, (e, t) => {
|
|
1078
1202
|
d || (t && S(t), e && x(e));
|
|
@@ -1090,14 +1214,14 @@ function N(e) {
|
|
|
1090
1214
|
}), t.bind("pusher:member_removed", (t) => {
|
|
1091
1215
|
let n = c.value.find((e) => e.id === t.id);
|
|
1092
1216
|
h(t.id), n && e.onCollaboratorLeft?.(n);
|
|
1093
|
-
}), t.bind("client-
|
|
1217
|
+
}), t.bind("client-blockLocked", (t) => {
|
|
1094
1218
|
g(t);
|
|
1095
1219
|
let n = c.value.find((e) => e.id === t.userId);
|
|
1096
1220
|
n && e.onBlockLocked?.({
|
|
1097
1221
|
blockId: t.blockId,
|
|
1098
1222
|
collaborator: n
|
|
1099
1223
|
});
|
|
1100
|
-
}), t.bind("client-
|
|
1224
|
+
}), t.bind("client-blockUnlocked", (t) => {
|
|
1101
1225
|
let n = l.value.get(t.blockId);
|
|
1102
1226
|
_(t), n && e.onBlockUnlocked?.({
|
|
1103
1227
|
blockId: t.blockId,
|
|
@@ -1123,50 +1247,50 @@ function P(e, t) {
|
|
|
1123
1247
|
let n = e.addBlock, r = e.updateBlock, i = e.removeBlock, a = e.moveBlock, o = e.updateSettings, s = e.setContent;
|
|
1124
1248
|
e.addBlock = (e, r, i, a) => {
|
|
1125
1249
|
n(e, r, i, a), t._broadcastOperation({
|
|
1126
|
-
operation: "
|
|
1250
|
+
operation: "addBlock",
|
|
1127
1251
|
data: {
|
|
1128
1252
|
block: e,
|
|
1129
|
-
|
|
1130
|
-
|
|
1253
|
+
sectionId: r,
|
|
1254
|
+
columnIndex: i,
|
|
1131
1255
|
index: a
|
|
1132
1256
|
},
|
|
1133
1257
|
timestamp: Date.now()
|
|
1134
1258
|
});
|
|
1135
1259
|
}, e.updateBlock = (e, n) => {
|
|
1136
1260
|
r(e, n), t._broadcastOperation({
|
|
1137
|
-
operation: "
|
|
1261
|
+
operation: "updateBlock",
|
|
1138
1262
|
data: {
|
|
1139
|
-
|
|
1263
|
+
blockId: e,
|
|
1140
1264
|
updates: n
|
|
1141
1265
|
},
|
|
1142
1266
|
timestamp: Date.now()
|
|
1143
1267
|
});
|
|
1144
1268
|
}, e.removeBlock = (e) => {
|
|
1145
1269
|
i(e), t._broadcastOperation({
|
|
1146
|
-
operation: "
|
|
1147
|
-
data: {
|
|
1270
|
+
operation: "deleteBlock",
|
|
1271
|
+
data: { blockId: e },
|
|
1148
1272
|
timestamp: Date.now()
|
|
1149
1273
|
});
|
|
1150
1274
|
}, e.moveBlock = (e, n, r, i) => {
|
|
1151
1275
|
a(e, n, r, i), t._broadcastOperation({
|
|
1152
|
-
operation: "
|
|
1276
|
+
operation: "moveBlock",
|
|
1153
1277
|
data: {
|
|
1154
|
-
|
|
1278
|
+
blockId: e,
|
|
1155
1279
|
index: n,
|
|
1156
|
-
|
|
1157
|
-
|
|
1280
|
+
sectionId: r,
|
|
1281
|
+
columnIndex: i
|
|
1158
1282
|
},
|
|
1159
1283
|
timestamp: Date.now()
|
|
1160
1284
|
});
|
|
1161
1285
|
}, e.updateSettings = (e) => {
|
|
1162
1286
|
o(e), t._broadcastOperation({
|
|
1163
|
-
operation: "
|
|
1287
|
+
operation: "updateSettings",
|
|
1164
1288
|
data: { updates: e },
|
|
1165
1289
|
timestamp: Date.now()
|
|
1166
1290
|
});
|
|
1167
1291
|
}, e.setContent = (e, n) => {
|
|
1168
1292
|
s(e, n), t._broadcastOperation({
|
|
1169
|
-
operation: "
|
|
1293
|
+
operation: "setContent",
|
|
1170
1294
|
data: { content: e },
|
|
1171
1295
|
timestamp: Date.now()
|
|
1172
1296
|
});
|
|
@@ -1207,7 +1331,7 @@ function F(e) {
|
|
|
1207
1331
|
//#endregion
|
|
1208
1332
|
//#region ../core/src/cloud/saved-blocks-provider.ts
|
|
1209
1333
|
function I(e) {
|
|
1210
|
-
let t = new
|
|
1334
|
+
let t = new g(e);
|
|
1211
1335
|
return {
|
|
1212
1336
|
list(e) {
|
|
1213
1337
|
return t.listModules(e?.search, e?.category);
|
|
@@ -1224,13 +1348,114 @@ function I(e) {
|
|
|
1224
1348
|
};
|
|
1225
1349
|
}
|
|
1226
1350
|
//#endregion
|
|
1351
|
+
//#region ../core/src/cloud/media-provider.ts
|
|
1352
|
+
function L(e) {
|
|
1353
|
+
let t = {
|
|
1354
|
+
id: e.id,
|
|
1355
|
+
url: e.url,
|
|
1356
|
+
filename: e.filename,
|
|
1357
|
+
alt: e.alt,
|
|
1358
|
+
mimeType: e.mimeType,
|
|
1359
|
+
folderId: e.folderId,
|
|
1360
|
+
createdAt: e.createdAt,
|
|
1361
|
+
updatedAt: e.updatedAt,
|
|
1362
|
+
size: e.size
|
|
1363
|
+
};
|
|
1364
|
+
return e.width != null && (t.width = e.width), e.height != null && (t.height = e.height), e.thumbnailUrl != null && (t.thumbnailUrl = e.thumbnailUrl), t;
|
|
1365
|
+
}
|
|
1366
|
+
function R(e, t = null) {
|
|
1367
|
+
return {
|
|
1368
|
+
id: e.id,
|
|
1369
|
+
name: e.name,
|
|
1370
|
+
parentId: e.parentId === void 0 ? t : e.parentId
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1373
|
+
function z(e, t = null) {
|
|
1374
|
+
let n = [];
|
|
1375
|
+
for (let r of e) n.push(R(r, t)), r.children?.length && n.push(...z(r.children, r.id));
|
|
1376
|
+
return n;
|
|
1377
|
+
}
|
|
1378
|
+
function B(e) {
|
|
1379
|
+
let t = e?.media?.categories;
|
|
1380
|
+
if (!t) return;
|
|
1381
|
+
let n = {};
|
|
1382
|
+
for (let [e, r] of Object.entries(t)) n[e] = r.mimeTypes;
|
|
1383
|
+
return n;
|
|
1384
|
+
}
|
|
1385
|
+
function V(e, t) {
|
|
1386
|
+
let n = new _(e);
|
|
1387
|
+
return {
|
|
1388
|
+
async list(e) {
|
|
1389
|
+
let t = await n.browseMedia({
|
|
1390
|
+
search: e?.search,
|
|
1391
|
+
cursor: e?.cursor,
|
|
1392
|
+
folderId: e?.folderId,
|
|
1393
|
+
category: e?.category
|
|
1394
|
+
}), r = { items: t.data.map(L) };
|
|
1395
|
+
return t.meta.nextCursor && (r.nextCursor = t.meta.nextCursor), r;
|
|
1396
|
+
},
|
|
1397
|
+
async create(e) {
|
|
1398
|
+
return L(await n.uploadMedia(e.file, e.folderId));
|
|
1399
|
+
},
|
|
1400
|
+
async update(e, t) {
|
|
1401
|
+
return L(await n.updateMedia(e, t.filename, t.alt));
|
|
1402
|
+
},
|
|
1403
|
+
delete(e) {
|
|
1404
|
+
return n.deleteMedia(e);
|
|
1405
|
+
},
|
|
1406
|
+
folders: {
|
|
1407
|
+
async list() {
|
|
1408
|
+
return z(await n.getMediaFolders());
|
|
1409
|
+
},
|
|
1410
|
+
async create(e) {
|
|
1411
|
+
return R(await n.createMediaFolder(e.name, e.parentId));
|
|
1412
|
+
},
|
|
1413
|
+
async update(e, t) {
|
|
1414
|
+
return R(await n.renameMediaFolder(e, t.name));
|
|
1415
|
+
},
|
|
1416
|
+
delete(e) {
|
|
1417
|
+
return n.deleteMediaFolder(e);
|
|
1418
|
+
},
|
|
1419
|
+
async move(e, t) {
|
|
1420
|
+
return (await n.moveMedia(e, t)).map(L);
|
|
1421
|
+
}
|
|
1422
|
+
},
|
|
1423
|
+
async replace(e, t) {
|
|
1424
|
+
return L(await n.replaceMedia(e, t));
|
|
1425
|
+
},
|
|
1426
|
+
async importFromUrl(e, t) {
|
|
1427
|
+
return L(await n.importFromUrl(e, t));
|
|
1428
|
+
},
|
|
1429
|
+
async checkUsage(e) {
|
|
1430
|
+
let t = await n.checkMediaUsage(e), r = {};
|
|
1431
|
+
for (let [e, n] of Object.entries(t.data)) r[e] = {
|
|
1432
|
+
templateCount: n.templateCount,
|
|
1433
|
+
templateNames: n.templateNames
|
|
1434
|
+
};
|
|
1435
|
+
return r;
|
|
1436
|
+
},
|
|
1437
|
+
async frequentlyUsed() {
|
|
1438
|
+
return (await n.getFrequentlyUsed()).map(L);
|
|
1439
|
+
},
|
|
1440
|
+
async storage() {
|
|
1441
|
+
return t?.()?.storage ?? null;
|
|
1442
|
+
},
|
|
1443
|
+
get maxFileSize() {
|
|
1444
|
+
return t?.()?.media?.maxFileSize;
|
|
1445
|
+
},
|
|
1446
|
+
get mimeTypes() {
|
|
1447
|
+
return B(t?.() ?? null);
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
//#endregion
|
|
1227
1452
|
//#region ../core/src/cloud/templates-provider.ts
|
|
1228
|
-
var
|
|
1229
|
-
function
|
|
1230
|
-
let t = new
|
|
1453
|
+
var H = 6e4;
|
|
1454
|
+
function U(e) {
|
|
1455
|
+
let t = new g(e), n = 0;
|
|
1231
1456
|
function r(e, r) {
|
|
1232
1457
|
let i = Date.now();
|
|
1233
|
-
i - n <
|
|
1458
|
+
i - n < H || (n = i, t.createVersion(e, r).catch((e) => {
|
|
1234
1459
|
console.warn("[Templatical] Automatic version not recorded — the save itself succeeded:", e);
|
|
1235
1460
|
}));
|
|
1236
1461
|
}
|
|
@@ -1249,14 +1474,14 @@ function R(e) {
|
|
|
1249
1474
|
}
|
|
1250
1475
|
//#endregion
|
|
1251
1476
|
//#region ../core/src/cloud/export.ts
|
|
1252
|
-
function
|
|
1477
|
+
function W(e) {
|
|
1253
1478
|
return {
|
|
1254
1479
|
customFonts: e?.customFonts ?? [],
|
|
1255
1480
|
defaultFallback: e?.defaultFallback ?? "Arial, sans-serif"
|
|
1256
1481
|
};
|
|
1257
1482
|
}
|
|
1258
|
-
function
|
|
1259
|
-
let t = new
|
|
1483
|
+
function G(e) {
|
|
1484
|
+
let t = new g(e.authManager);
|
|
1260
1485
|
async function n(e, n) {
|
|
1261
1486
|
let r = await t.exportTemplate(e, n);
|
|
1262
1487
|
return {
|
|
@@ -1274,8 +1499,8 @@ function B(e) {
|
|
|
1274
1499
|
}
|
|
1275
1500
|
//#endregion
|
|
1276
1501
|
//#region ../core/src/cloud/render-provider.ts
|
|
1277
|
-
function
|
|
1278
|
-
let t =
|
|
1502
|
+
function K(e) {
|
|
1503
|
+
let t = G({ authManager: e.authManager });
|
|
1279
1504
|
function n(e) {
|
|
1280
1505
|
return {
|
|
1281
1506
|
customFonts: e.fonts?.customFonts ?? [],
|
|
@@ -1299,25 +1524,25 @@ function V(e) {
|
|
|
1299
1524
|
}
|
|
1300
1525
|
//#endregion
|
|
1301
1526
|
//#region ../core/src/cloud/version-history-provider.ts
|
|
1302
|
-
function
|
|
1527
|
+
function q(e) {
|
|
1303
1528
|
return {
|
|
1304
1529
|
id: e.id,
|
|
1305
|
-
createdAt: e.
|
|
1306
|
-
isAutomatic: e.
|
|
1530
|
+
createdAt: e.createdAt,
|
|
1531
|
+
isAutomatic: e.isAutomatic,
|
|
1307
1532
|
content: e.content
|
|
1308
1533
|
};
|
|
1309
1534
|
}
|
|
1310
|
-
function
|
|
1311
|
-
let t = new
|
|
1535
|
+
function J(e) {
|
|
1536
|
+
let t = new g(e);
|
|
1312
1537
|
return {
|
|
1313
1538
|
async list(e) {
|
|
1314
|
-
return { versions: (await t.getVersions(e)).map(
|
|
1539
|
+
return { versions: (await t.getVersions(e)).map(q) };
|
|
1315
1540
|
},
|
|
1316
1541
|
async get(e, n) {
|
|
1317
1542
|
return (await t.getVersion(e, n)).content;
|
|
1318
1543
|
},
|
|
1319
1544
|
async create(e, n, r) {
|
|
1320
|
-
return
|
|
1545
|
+
return q(await t.createVersion(e, n, r?.label));
|
|
1321
1546
|
},
|
|
1322
1547
|
restore(e, n) {
|
|
1323
1548
|
return t.restoreVersion(e, n);
|
|
@@ -1326,7 +1551,7 @@ function U(e) {
|
|
|
1326
1551
|
}
|
|
1327
1552
|
//#endregion
|
|
1328
1553
|
//#region ../core/src/cloud/test-email.ts
|
|
1329
|
-
function
|
|
1554
|
+
function Y(e) {
|
|
1330
1555
|
let { authManager: r, isAuthReady: a } = e, o = n(null);
|
|
1331
1556
|
a && t(a, (e) => {
|
|
1332
1557
|
e && (o.value = r.testEmailConfig);
|
|
@@ -1343,8 +1568,8 @@ function W(e) {
|
|
|
1343
1568
|
}
|
|
1344
1569
|
//#endregion
|
|
1345
1570
|
//#region ../core/src/cloud/test-email-provider.ts
|
|
1346
|
-
function
|
|
1347
|
-
let t = new
|
|
1571
|
+
function X(e) {
|
|
1572
|
+
let t = new g(e.authManager);
|
|
1348
1573
|
return {
|
|
1349
1574
|
get allowedRecipients() {
|
|
1350
1575
|
return e.allowedEmails.value;
|
|
@@ -1359,7 +1584,7 @@ function G(e) {
|
|
|
1359
1584
|
e.onBeforeTestEmail && (a = await e.onBeforeTestEmail(a)), await t.sendTestEmail(i, {
|
|
1360
1585
|
recipient: n,
|
|
1361
1586
|
html: a,
|
|
1362
|
-
|
|
1587
|
+
allowedEmails: e.allowedEmails.value,
|
|
1363
1588
|
signature: r
|
|
1364
1589
|
});
|
|
1365
1590
|
}
|
|
@@ -1367,8 +1592,8 @@ function G(e) {
|
|
|
1367
1592
|
}
|
|
1368
1593
|
//#endregion
|
|
1369
1594
|
//#region ../core/src/cloud/plan-config.ts
|
|
1370
|
-
function
|
|
1371
|
-
let { authManager: t, onError: r } = e, a = n(null), o = n(!1), s = new
|
|
1595
|
+
function Z(e) {
|
|
1596
|
+
let { authManager: t, onError: r } = e, a = n(null), o = n(!1), s = new g(t), c = i(() => a.value?.features ?? null);
|
|
1372
1597
|
function l(e) {
|
|
1373
1598
|
return a.value?.features[e] ?? !1;
|
|
1374
1599
|
}
|
|
@@ -1394,14 +1619,14 @@ function K(e) {
|
|
|
1394
1619
|
}
|
|
1395
1620
|
//#endregion
|
|
1396
1621
|
//#region ../core/src/cloud/health-check.ts
|
|
1397
|
-
var
|
|
1398
|
-
function
|
|
1399
|
-
return e.authManager ? e.authManager.resolveUrl(
|
|
1622
|
+
var Q = 5e3;
|
|
1623
|
+
function $(e) {
|
|
1624
|
+
return e.authManager ? e.authManager.resolveUrl(h.health) : `${(e.baseUrl ?? "https://templatical.com").replace(/\/$/, "")}${h.health}`;
|
|
1400
1625
|
}
|
|
1401
|
-
async function
|
|
1626
|
+
async function ee(e, t) {
|
|
1402
1627
|
let n = performance.now();
|
|
1403
1628
|
try {
|
|
1404
|
-
let r = t ? await t.authenticatedFetch(
|
|
1629
|
+
let r = t ? await t.authenticatedFetch(h.health, {
|
|
1405
1630
|
method: "GET",
|
|
1406
1631
|
headers: { Accept: "application/json" }
|
|
1407
1632
|
}) : await fetch(e, {
|
|
@@ -1450,8 +1675,8 @@ async function Y(e, t) {
|
|
|
1450
1675
|
};
|
|
1451
1676
|
}
|
|
1452
1677
|
}
|
|
1453
|
-
async function
|
|
1454
|
-
if (!e?.host || !e?.
|
|
1678
|
+
async function te(e) {
|
|
1679
|
+
if (!e?.host || !e?.appKey) return {
|
|
1455
1680
|
ok: !1,
|
|
1456
1681
|
error: "WebSocket configuration not available"
|
|
1457
1682
|
};
|
|
@@ -1459,14 +1684,14 @@ async function X(e) {
|
|
|
1459
1684
|
ok: !1,
|
|
1460
1685
|
error: "WebSocket not supported in this environment"
|
|
1461
1686
|
};
|
|
1462
|
-
let t = `${e.port === 443 ? "wss" : "ws"}://${e.host}:${e.port}/app/${e.
|
|
1687
|
+
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`;
|
|
1463
1688
|
return new Promise((e) => {
|
|
1464
1689
|
let n = null, r = setTimeout(() => {
|
|
1465
1690
|
n?.close(), e({
|
|
1466
1691
|
ok: !1,
|
|
1467
1692
|
error: "WebSocket connection timed out"
|
|
1468
1693
|
});
|
|
1469
|
-
},
|
|
1694
|
+
}, Q);
|
|
1470
1695
|
try {
|
|
1471
1696
|
n = new WebSocket(t);
|
|
1472
1697
|
} catch (t) {
|
|
@@ -1486,8 +1711,8 @@ async function X(e) {
|
|
|
1486
1711
|
};
|
|
1487
1712
|
});
|
|
1488
1713
|
}
|
|
1489
|
-
async function
|
|
1490
|
-
let t = await
|
|
1714
|
+
async function ne(e = {}) {
|
|
1715
|
+
let t = await ee($(e), e.authManager), n = await te(t.wsConfig);
|
|
1491
1716
|
return {
|
|
1492
1717
|
api: t.api,
|
|
1493
1718
|
websocket: n,
|
|
@@ -1497,7 +1722,7 @@ async function Z(e = {}) {
|
|
|
1497
1722
|
}
|
|
1498
1723
|
//#endregion
|
|
1499
1724
|
//#region ../core/src/cloud/mcp-listener.ts
|
|
1500
|
-
function
|
|
1725
|
+
function re(e) {
|
|
1501
1726
|
let { editor: n, channel: r, onOperation: i } = e;
|
|
1502
1727
|
t(r, (e, t) => {
|
|
1503
1728
|
t && t.unbind("mcp-operation"), e && e.bind("mcp-operation", (e) => {
|
|
@@ -1506,6 +1731,6 @@ function Q(e) {
|
|
|
1506
1731
|
});
|
|
1507
1732
|
}
|
|
1508
1733
|
//#endregion
|
|
1509
|
-
export {
|
|
1734
|
+
export { o as C, s as S, E as _, Y as a, C as b, W as c, V as d, I as f, k as g, N as h, X as i, G as l, P as m, ne as n, J as o, F as p, Z as r, K as s, re as t, U as u, T as v, v as x, w as y };
|
|
1510
1735
|
|
|
1511
|
-
//# sourceMappingURL=cloud-
|
|
1736
|
+
//# sourceMappingURL=cloud-BLgCKP7Z.js.map
|