@templatical/editor 0.47.0 → 0.49.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/README.md +1 -1
- package/dist/{AiChatSidebar-BPOv5Ra8.js → AiChatSidebar-CdjTb9ej.js} +14 -14
- package/dist/{AiFeatureMenu-H_WT4YR8.js → AiFeatureMenu-DKm7VYCs.js} +7 -7
- package/dist/{BlockIssueBadge-AgO5abEB.js → BlockIssueBadge-BdpJwim0.js} +5 -5
- package/dist/BlockPreviewCanvas-D_sowkf0.js +141 -0
- package/dist/CloudHeaderExtras-CI8RR9hG.js +55 -0
- package/dist/{CloudPanels-H_GdbOfZ.js → CloudPanels-1hwFiJ0G.js} +39 -68
- package/dist/CollaborationNotices-BWpKzueF.js +73 -0
- package/dist/CollaboratorBar-D87phJsw.js +123 -0
- package/dist/{CommentsPanel-CMgsG_yh.js → CommentsPanel-BUvUzO3T.js} +2 -2
- package/dist/{CommentsSidebar-DCh8DTP8.js → CommentsSidebar-J65znlrH.js} +14 -14
- package/dist/{CountdownBlock-zx39Dyby.js → CountdownBlock-DPQXWRvU.js} +4 -4
- package/dist/{CountdownToolbar-DVuucA3v.js → CountdownToolbar-CLMIwfK7.js} +7 -7
- package/dist/{DesignReferenceSidebar-DxNV4lQp.js → DesignReferenceSidebar-BTwCFgz8.js} +13 -13
- package/dist/{IssuesPanel-CUpW54P4.js → IssuesPanel-DeeVsfG7.js} +8 -8
- package/dist/{LoadingTrack-6XsqodoY.js → LoadingTrack-BXOptf5g.js} +1 -1
- package/dist/{LogicTagInsertButton-DDYKnqmj.js → LogicTagInsertButton-CR5E4jSG.js} +17 -17
- package/dist/{MediaEditModal-D_we0Scr.js → MediaEditModal-C_wxoUMG.js} +3 -3
- package/dist/{MediaPanels-L95BwWV1.js → MediaPanels-BVXDkqtH.js} +2 -2
- package/dist/{MergeTagInput-DAL998tx.js → MergeTagInput-BEw_r0PJ.js} +3 -3
- package/dist/{MergeTagModeToggle-CjHO26rb.js → MergeTagModeToggle-CJTpFmVd.js} +7 -7
- package/dist/{ParagraphEditor-CcEN1N6n.js → ParagraphEditor-zLV44z-R.js} +135 -135
- package/dist/{RestoreVersionDialog-B2OH5rgs.js → RestoreVersionDialog-BaDpy3cL.js} +6 -6
- package/dist/{RichTextEditorContent-BGeTg-QL.js → RichTextEditorContent-CsvniFlI.js} +9 -9
- package/dist/{SaveBlockDialog-CCVyU-7y.js → SaveBlockDialog-DzWURF_e.js} +34 -35
- package/dist/{SavedBlocksBrowserModal-_WmSeqIh.js → SavedBlocksBrowserModal-B8DCFW7t.js} +14 -14
- package/dist/{SavedBlocksPanels-DVX_ruQ7.js → SavedBlocksPanels-B3Af8ns2.js} +2 -2
- package/dist/{SavedBlocksPickBar-DVJC28hP.js → SavedBlocksPickBar-Dj11-Lqp.js} +5 -5
- package/dist/{TemplateScoringPanel-U0QFiwdI.js → TemplateScoringPanel-Ba9sgvjS.js} +16 -16
- package/dist/{TemplateSettings-CdhTm9JQ.js → TemplateSettings-Cu5X9DgA.js} +11 -11
- package/dist/{TestEmailModal-BqToA_ls.js → TestEmailModal-BeRYV3eg.js} +14 -14
- package/dist/{TestEmailPanel-Cn4Ptq0j.js → TestEmailPanel-B8c3fQi2.js} +2 -2
- package/dist/{TitleEditor-CZdqeltH.js → TitleEditor-CvpNUoAp.js} +13 -13
- package/dist/{ToggleSwitch-BR8Sgzib.js → ToggleSwitch-DHweVJOr.js} +2 -2
- package/dist/Toolbar-BadDSkkF.js +3153 -0
- package/dist/{TplModal-CoczSDma.js → TplModal-BZgi9Tes.js} +5 -5
- package/dist/{VersionHistoryMenu-DY5z5FZr.js → VersionHistoryMenu-BRlcQ8wX.js} +10 -10
- package/dist/{VersionHistoryPanels-DowHeDAQ.js → VersionHistoryPanels-DGkllN3a.js} +2 -2
- package/dist/{VersionPreviewBanner-Bo8NxBbh.js → VersionPreviewBanner-F-811aps.js} +4 -4
- package/dist/WrapperBlock-DiiaxpMb.js +45 -0
- package/dist/{blockTypeIcons-4E1U8f99.js → blockTypeIcons-CayLluou.js} +49 -19
- package/dist/bundle-stats.json +7 -7
- package/dist/{ca-DMoGGP9L.js → ca-DSJwJ5ov.js} +40 -2
- package/dist/cdn/chunks/{AiChatSidebar-B72rI0be.js → AiChatSidebar-yXJ85Zcg.js} +12 -12
- package/dist/cdn/chunks/{AiChatSidebar-B72rI0be.js.map → AiChatSidebar-yXJ85Zcg.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-BqSG9iEd.js → AiFeatureMenu-4ydjrhsQ.js} +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-BqSG9iEd.js.map → AiFeatureMenu-4ydjrhsQ.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-CS7ytN-z.js → BlockIssueBadge-D1VBS_6x.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-CS7ytN-z.js.map → BlockIssueBadge-D1VBS_6x.js.map} +1 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-m2tWRyWv.js +143 -0
- package/dist/cdn/chunks/BlockPreviewCanvas-m2tWRyWv.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-DJXLTUHc.js → CloudHeaderExtras-DEkRww7n.js} +16 -20
- package/dist/cdn/chunks/CloudHeaderExtras-DEkRww7n.js.map +1 -0
- package/dist/cdn/chunks/{CloudPanels-D1fPLjG8.js → CloudPanels-XufhBZYF.js} +38 -67
- package/dist/cdn/chunks/CloudPanels-XufhBZYF.js.map +1 -0
- package/dist/cdn/chunks/CollaborationNotices-CBvKEj1Q.js +75 -0
- package/dist/cdn/chunks/CollaborationNotices-CBvKEj1Q.js.map +1 -0
- package/dist/cdn/chunks/CollaboratorBar-DWW54Bn_.js +72 -0
- package/dist/cdn/chunks/CollaboratorBar-DWW54Bn_.js.map +1 -0
- package/dist/cdn/chunks/{CommentsPanel-CmxPylNf.js → CommentsPanel-R8YLLO3v.js} +3 -3
- package/dist/cdn/chunks/{CommentsPanel-CmxPylNf.js.map → CommentsPanel-R8YLLO3v.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-CrleQTbo.js → CommentsSidebar-96NZHVq3.js} +16 -16
- package/dist/cdn/chunks/{CommentsSidebar-CrleQTbo.js.map → CommentsSidebar-96NZHVq3.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-Dasj191h.js → CountdownBlock-DB4JNdqh.js} +5 -5
- package/dist/cdn/chunks/{CountdownBlock-Dasj191h.js.map → CountdownBlock-DB4JNdqh.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-DPIOtlN0.js → CountdownToolbar-tmiTPEXm.js} +8 -8
- package/dist/cdn/chunks/{CountdownToolbar-DPIOtlN0.js.map → CountdownToolbar-tmiTPEXm.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-BgTNqgCy.js → DesignReferenceSidebar-D14IIu_P.js} +40 -40
- package/dist/cdn/chunks/{DesignReferenceSidebar-BgTNqgCy.js.map → DesignReferenceSidebar-D14IIu_P.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-BGjLcNpQ.js → IssuesPanel-BoPiCLGc.js} +6 -6
- package/dist/cdn/chunks/{IssuesPanel-BGjLcNpQ.js.map → IssuesPanel-BoPiCLGc.js.map} +1 -1
- package/dist/cdn/chunks/{LoadingTrack-DbH97JR9.js → LoadingTrack-YU44CM8X.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-DbH97JR9.js.map → LoadingTrack-YU44CM8X.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-BEsqPhMr.js → LogicTagInsertButton-BJ2t2vxC.js} +98 -98
- package/dist/cdn/chunks/{LogicTagInsertButton-BEsqPhMr.js.map → LogicTagInsertButton-BJ2t2vxC.js.map} +1 -1
- package/dist/cdn/chunks/{MediaEditModal-C1Ao0i2c.js → MediaEditModal-DD0SZ-S3.js} +3 -3
- package/dist/cdn/chunks/{MediaEditModal-C1Ao0i2c.js.map → MediaEditModal-DD0SZ-S3.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-1GPYiZZ0.js → MediaPanels-CkdJ_kGp.js} +3 -3
- package/dist/cdn/chunks/{MediaPanels-1GPYiZZ0.js.map → MediaPanels-CkdJ_kGp.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-Dy13_OLc.js → MergeTagInput-7wXX71DH.js} +4 -4
- package/dist/cdn/chunks/{MergeTagInput-Dy13_OLc.js.map → MergeTagInput-7wXX71DH.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-B2CPZOeF.js → MergeTagModeToggle-r9vHH4u_.js} +6 -6
- package/dist/cdn/chunks/{MergeTagModeToggle-B2CPZOeF.js.map → MergeTagModeToggle-r9vHH4u_.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BGLIw7kg.js → ParagraphEditor-CJQjRHXV.js} +52 -52
- package/dist/cdn/chunks/{ParagraphEditor-BGLIw7kg.js.map → ParagraphEditor-CJQjRHXV.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-BhykE8En.js → RestoreVersionDialog-C5cxBRKi.js} +8 -8
- package/dist/cdn/chunks/{RestoreVersionDialog-BhykE8En.js.map → RestoreVersionDialog-C5cxBRKi.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-B-txUvPL.js → RichTextEditorContent-BfE7Bkge.js} +8 -8
- package/dist/cdn/chunks/{RichTextEditorContent-B-txUvPL.js.map → RichTextEditorContent-BfE7Bkge.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-BHqEp7jw.js → SaveBlockDialog-BKbjUnPM.js} +25 -26
- package/dist/cdn/chunks/{SaveBlockDialog-BHqEp7jw.js.map → SaveBlockDialog-BKbjUnPM.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BhR6AI0f.js → SavedBlocksBrowserModal-BMtyUrUP.js} +10 -10
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BhR6AI0f.js.map → SavedBlocksBrowserModal-BMtyUrUP.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-YwffJtfY.js → SavedBlocksPanels-s_gxi1im.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-YwffJtfY.js.map → SavedBlocksPanels-s_gxi1im.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-BtpFU7es.js → SavedBlocksPickBar-B8WHk5mI.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksPickBar-BtpFU7es.js.map → SavedBlocksPickBar-B8WHk5mI.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-N4ySFh5w.js → TemplateScoringPanel-BBPnHILC.js} +10 -10
- package/dist/cdn/chunks/{TemplateScoringPanel-N4ySFh5w.js.map → TemplateScoringPanel-BBPnHILC.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-C7b5X34U.js → TemplateSettings-CtrzzQWl.js} +14 -14
- package/dist/cdn/chunks/{TemplateSettings-C7b5X34U.js.map → TemplateSettings-CtrzzQWl.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-DHJKI5y5.js → TestEmailModal-DuZKYMWD.js} +15 -15
- package/dist/cdn/chunks/{TestEmailModal-DHJKI5y5.js.map → TestEmailModal-DuZKYMWD.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-lYtzTXpR.js → TestEmailPanel-DERaCdpG.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-lYtzTXpR.js.map → TestEmailPanel-DERaCdpG.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-5eY01ypW.js → TitleEditor-CEgxjtUX.js} +20 -20
- package/dist/cdn/chunks/{TitleEditor-5eY01ypW.js.map → TitleEditor-CEgxjtUX.js.map} +1 -1
- package/dist/cdn/chunks/{ToggleSwitch-BN8rMC2m.js → ToggleSwitch-DGQ7iRc-.js} +3 -3
- package/dist/cdn/chunks/{ToggleSwitch-BN8rMC2m.js.map → ToggleSwitch-DGQ7iRc-.js.map} +1 -1
- package/dist/cdn/chunks/Toolbar-GFIZQHzw.js +3070 -0
- package/dist/cdn/chunks/Toolbar-GFIZQHzw.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-WIBiBrGy.js → TplModal-DDrbWJcE.js} +5 -5
- package/dist/cdn/chunks/{TplModal-WIBiBrGy.js.map → TplModal-DDrbWJcE.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-CZnlS9K5.js → VersionHistoryMenu-MlxsUmuT.js} +11 -11
- package/dist/cdn/chunks/{VersionHistoryMenu-CZnlS9K5.js.map → VersionHistoryMenu-MlxsUmuT.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-xjLSpR1e.js → VersionHistoryPanels-DVOV8QLv.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryPanels-xjLSpR1e.js.map → VersionHistoryPanels-DVOV8QLv.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-sARpn4hh.js → VersionPreviewBanner-BQwRKc6S.js} +5 -5
- package/dist/cdn/chunks/{VersionPreviewBanner-sARpn4hh.js.map → VersionPreviewBanner-BQwRKc6S.js.map} +1 -1
- package/dist/cdn/chunks/WrapperBlock-CFuP4R0c.js +47 -0
- package/dist/cdn/chunks/WrapperBlock-CFuP4R0c.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-BnAd8qsP.js +22 -0
- package/dist/cdn/chunks/blockTypeIcons-BnAd8qsP.js.map +1 -0
- package/dist/cdn/chunks/{ca-DMoGGP9L.js → ca-DSJwJ5ov.js} +41 -3
- package/dist/cdn/chunks/ca-DSJwJ5ov.js.map +1 -0
- package/dist/{cloud-DwjaAdwK.js → cdn/chunks/cloud-CI_fgDyy.js} +116 -293
- package/dist/cdn/chunks/cloud-CI_fgDyy.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-DtIZ2Lee.js → createCloudRuntime-DiYCJ21w.js} +127 -169
- package/dist/cdn/chunks/createCloudRuntime-DiYCJ21w.js.map +1 -0
- package/dist/{de-DgAelLbM.js → cdn/chunks/de-CBE6O79z.js} +42 -2
- package/dist/cdn/chunks/de-CBE6O79z.js.map +1 -0
- package/dist/{de-mMY5yQJu.js → cdn/chunks/de-D_atmUVB.js} +2 -4
- package/dist/cdn/chunks/{de-mMY5yQJu.js.map → de-D_atmUVB.js.map} +1 -1
- package/dist/cdn/chunks/{dist-MNQYSEWU.js → dist-DdwjXLme.js} +3 -3
- package/dist/cdn/chunks/{dist-MNQYSEWU.js.map → dist-DdwjXLme.js.map} +1 -1
- package/dist/cdn/chunks/{dist-CjL6JHML.js → dist-Doy3r07H.js} +2 -2
- package/dist/cdn/chunks/{dist-CjL6JHML.js.map → dist-Doy3r07H.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-DrsNwZuB.js → draggable-akeQH_JP.js} +1682 -1683
- package/dist/cdn/chunks/draggable-akeQH_JP.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-Bcwo0orC.js → editor-modal-HJBy9kLj.js} +69 -69
- package/dist/cdn/chunks/{editor-modal-Bcwo0orC.js.map → editor-modal-HJBy9kLj.js.map} +1 -1
- package/dist/cdn/chunks/{en-Dekrl7HA.js → en-CDexnk0p.js} +41 -3
- package/dist/cdn/chunks/en-CDexnk0p.js.map +1 -0
- package/dist/{en-ChVeGQBY.js → cdn/chunks/en-DhJLnaBx.js} +2 -4
- package/dist/cdn/chunks/en-DhJLnaBx.js.map +1 -0
- package/dist/cdn/chunks/en-Ve-PWSXu.js +1 -0
- package/dist/{es-BaZzyidV.js → cdn/chunks/es-BE42B6uN.js} +42 -2
- package/dist/cdn/chunks/es-BE42B6uN.js.map +1 -0
- package/dist/cdn/chunks/{extensions-T-t8MKDb.js → extensions-koOuDeZS.js} +23 -23
- package/dist/cdn/chunks/{extensions-T-t8MKDb.js.map → extensions-koOuDeZS.js.map} +1 -1
- package/dist/{fr-C5ucb1HK.js → cdn/chunks/fr-DlJFPDQR.js} +42 -2
- package/dist/cdn/chunks/fr-DlJFPDQR.js.map +1 -0
- package/dist/cdn/chunks/{icons-C4fX9Bwy.js → icons-CjlNV8xD.js} +121 -92
- package/dist/cdn/chunks/icons-CjlNV8xD.js.map +1 -0
- package/dist/{ja-CUgR3mV0.js → cdn/chunks/ja-CUT8gkNI.js} +42 -2
- package/dist/cdn/chunks/ja-CUT8gkNI.js.map +1 -0
- package/dist/cdn/chunks/{keys-HI-INbkz.js → keys-UAWhQ3zW.js} +2 -2
- package/dist/cdn/chunks/{keys-HI-INbkz.js.map → keys-UAWhQ3zW.js.map} +1 -1
- package/dist/{nl-qrLY7hMS.js → cdn/chunks/nl-bXWqqRyS.js} +42 -2
- package/dist/cdn/chunks/nl-bXWqqRyS.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-Co0oi0Jf.js → preRenderCustomBlocks-DqKbdTJ8.js} +5 -5
- package/dist/cdn/chunks/{preRenderCustomBlocks-Co0oi0Jf.js.map → preRenderCustomBlocks-DqKbdTJ8.js.map} +1 -1
- package/dist/{pt-BR-C6hMTQYi.js → cdn/chunks/pt-BR-2_H4-wlb.js} +42 -2
- package/dist/cdn/chunks/pt-BR-2_H4-wlb.js.map +1 -0
- package/dist/{pt-BR-CoCwRUi0.js → cdn/chunks/pt-BR-BphMoUTw.js} +2 -4
- package/dist/cdn/chunks/{pt-BR-CoCwRUi0.js.map → pt-BR-BphMoUTw.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-C8DeiO2X.js → pusher-Cs4GGEtd.js} +2 -2
- package/dist/cdn/chunks/pusher-Cs4GGEtd.js.map +1 -0
- package/dist/cdn/chunks/{rolldown-runtime-B0aSnxlc.js → rolldown-runtime-Y_bBpyJl.js} +1 -1
- package/dist/cdn/chunks/socialIcons-CkZSYpoG.js +2091 -0
- package/dist/cdn/chunks/socialIcons-CkZSYpoG.js.map +1 -0
- package/dist/cdn/chunks/{src-CHlVFp7r.js → src-B1e5SSYP.js} +312 -286
- package/dist/cdn/chunks/src-B1e5SSYP.js.map +1 -0
- package/dist/cdn/chunks/src-B77z1iw4.js +649 -0
- package/dist/cdn/chunks/src-B77z1iw4.js.map +1 -0
- package/dist/cdn/chunks/{src-BnJlDuyB.js → src-CvLTYGdO.js} +555 -283
- package/dist/cdn/chunks/src-CvLTYGdO.js.map +1 -0
- package/dist/cdn/chunks/{styleConstants-D1Jz-TFU.js → styleConstants-v1dNKgJf.js} +2 -4
- package/dist/cdn/chunks/{styleConstants-D1Jz-TFU.js.map → styleConstants-v1dNKgJf.js.map} +1 -1
- package/dist/cdn/chunks/{timeouts-DHPZQ0G3.js → timeouts-o5Y9BuqI.js} +2 -2
- package/dist/cdn/chunks/timeouts-o5Y9BuqI.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-BPigZk5G.js → tiptap-B1RfWFzB.js} +3 -3
- package/dist/cdn/chunks/tiptap-B1RfWFzB.js.map +1 -0
- package/dist/cdn/chunks/{useAliveFlag-DCB96vzR.js → useAliveFlag-PuXh83UK.js} +2 -2
- package/dist/cdn/chunks/{useAliveFlag-DCB96vzR.js.map → useAliveFlag-PuXh83UK.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-BBF4waXO.js → useCloudI18n-kp07GQmk.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-BBF4waXO.js.map → useCloudI18n-kp07GQmk.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorCore-Bf2d1DKI.js → useEditorCore-DpCFvHg_.js} +758 -732
- package/dist/cdn/chunks/useEditorCore-DpCFvHg_.js.map +1 -0
- package/dist/cdn/chunks/useEditorRoot-5SBqm90x.js +10 -0
- package/dist/cdn/chunks/{useEditorRoot-CTc6O8al.js.map → useEditorRoot-5SBqm90x.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-DUlyyIJJ.js → useI18n-DEqtEgOs.js} +3 -3
- package/dist/cdn/chunks/{useI18n-DUlyyIJJ.js.map → useI18n-DEqtEgOs.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-3S63go4E.js → useLogicTag-X8bc5qNl.js} +4 -4
- package/dist/cdn/chunks/{useLogicTag-3S63go4E.js.map → useLogicTag-X8bc5qNl.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-BQtxUHq1.js → useMergeTag-DFoOexIQ.js} +6 -6
- package/dist/cdn/chunks/{useMergeTag-BQtxUHq1.js.map → useMergeTag-DFoOexIQ.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-IbaW6-Ao.js → usePopoverPosition-Cz9-XiXR.js} +3 -3
- package/dist/cdn/chunks/{usePopoverPosition-IbaW6-Ao.js.map → usePopoverPosition-Cz9-XiXR.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-uUa601I4.js → useScrollToBlock-MNzurEZV.js} +3 -3
- package/dist/cdn/chunks/{useScrollToBlock-uUa601I4.js.map → useScrollToBlock-MNzurEZV.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-DwJd-lKc.js → withCurrentFont-D-f61ghC.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-DwJd-lKc.js.map → withCurrentFont-D-f61ghC.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +1328 -1069
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-B5R4zXr7.js → check-DQQzkmIC.js} +1 -1
- package/dist/{chevron-down-BKyl85NV.js → chevron-down-CIF4bdon.js} +1 -1
- package/dist/{chevron-right-BmToZ8qX.js → chevron-right-Cg7Xu-ev.js} +1 -1
- package/dist/{chevron-up-DNYdOxPC.js → chevron-up-Csu7ISD-.js} +1 -1
- package/dist/{circle-alert-Dx9ju3YZ.js → circle-alert-YUvIJAgY.js} +1 -1
- package/dist/{clock-Dv9bxsSH.js → clock-CnSIGKQW.js} +1 -1
- package/dist/{cdn/chunks/cloud-Cd7ptfhL.js → cloud-YUYDtdHt.js} +308 -569
- package/dist/{copy-BsKl4dcy.js → copy-CUC43md_.js} +1 -1
- package/dist/{createCloudRuntime-C8gpPsSi.js → createCloudRuntime-BMDRjL0k.js} +126 -168
- package/dist/{createLucideIcon-DziKp5iU.js → createLucideIcon-BcP1sjdp.js} +6 -6
- package/dist/{cdn/chunks/de-DgAelLbM.js → de-CBE6O79z.js} +40 -4
- package/dist/{cdn/chunks/de-mMY5yQJu.js → de-D_atmUVB.js} +0 -6
- package/dist/{dist-CUWI-IvA.js → dist-Bv_GBr2l.js} +1 -1
- package/dist/{dist-DAAJogrx.js → dist-CCqn-RqE.js} +2 -2
- package/dist/{dist-DuufrR8O.js → dist-CNqjHA8e.js} +2 -2
- package/dist/{dist-C8koXLhl.js → dist-DBG3nh3k.js} +550 -284
- package/dist/{editor-modal-BwyIUnV_.js → editor-modal--7_9A6j-.js} +27 -27
- package/dist/en-BHCMzqib.js +1 -0
- package/dist/{en-Dekrl7HA.js → en-CDexnk0p.js} +40 -2
- package/dist/{cdn/chunks/en-ChVeGQBY.js → en-DhJLnaBx.js} +0 -6
- package/dist/{cdn/chunks/es-BaZzyidV.js → es-BE42B6uN.js} +40 -4
- package/dist/{extensions-DHyKjsNZ.js → extensions-zwsZlWjH.js} +23 -23
- package/dist/{eye-DQuinb9k.js → eye-B1bua-ck.js} +1 -1
- package/dist/{cdn/chunks/fr-C5ucb1HK.js → fr-DlJFPDQR.js} +40 -4
- package/dist/{image-up-yTfLjOrj.js → image-up-BqiO7KCO.js} +1 -1
- package/dist/index.d.ts +356 -38
- package/dist/{info-C7OjlS11.js → info-x26nGOo2.js} +1 -1
- package/dist/{cdn/chunks/ja-CUgR3mV0.js → ja-CUT8gkNI.js} +40 -4
- package/dist/{keys-BKFq19a2.js → keys-BymCnLHD.js} +1 -1
- package/dist/{link-CrUFaZ0t.js → link-CezhndyR.js} +1 -1
- package/dist/{list-CLgv6M-k.js → list-DQqdptI0.js} +1 -1
- package/dist/{loader-circle-BXM5VO0K.js → loader-circle-DCEeoYoi.js} +1 -1
- package/dist/{message-circle-BisdQ8H9.js → message-circle-BLGzfv_7.js} +1 -1
- package/dist/{cdn/chunks/nl-qrLY7hMS.js → nl-bXWqqRyS.js} +40 -4
- package/dist/{package-C1T4AxV1.js → package-D_kEQCMU.js} +1 -1
- package/dist/{pencil-oo2mwf4C.js → pencil-Dct8zGLy.js} +1 -1
- package/dist/{plus-BIilXopD.js → plus-BDd0gTEm.js} +1 -1
- package/dist/{preRenderCustomBlocks-lFX0HHiV.js → preRenderCustomBlocks-CtKJecE-.js} +1 -1
- package/dist/{cdn/chunks/pt-BR-C6hMTQYi.js → pt-BR-2_H4-wlb.js} +40 -4
- package/dist/{cdn/chunks/pt-BR-CoCwRUi0.js → pt-BR-BphMoUTw.js} +0 -6
- package/dist/{refresh-cw-DrLlkEVC.js → refresh-cw-tGMRDxr8.js} +1 -1
- package/dist/{runtime-dom.esm-bundler-lFF-QG3j.js → runtime-dom.esm-bundler-DYn1z2Xf.js} +1 -1
- package/dist/{search-DNu9lImk.js → search-Bm2cCQpe.js} +1 -1
- package/dist/{send-DDNh3LoJ.js → send-sVLaKZ7f.js} +1 -1
- package/dist/{shield-check-aXM3o14f.js → shield-check-YhsbXfQc.js} +1 -1
- package/dist/{smartphone-isccgDee.js → smartphone-B2W81p02.js} +1 -1
- package/dist/socialIcons-Bwv-49EB.js +2167 -0
- package/dist/{sparkles-CIMfFxKv.js → sparkles-a1qkBZ8X.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styleConstants-D1Jz-TFU.js → styleConstants-v1dNKgJf.js} +1 -3
- package/dist/templatical-editor.js +1448 -1189
- package/dist/{text-align-start-C4JFeqsq.js → text-align-start-CTuwQ5YW.js} +1 -1
- package/dist/{timeouts-DHPZQ0G3.js → timeouts-o5Y9BuqI.js} +1 -1
- package/dist/{trash-8ZD9pK_c.js → trash-I3D2peFQ.js} +1 -1
- package/dist/{triangle-alert-pq45xEHl.js → triangle-alert-CenxmLRE.js} +1 -1
- package/dist/{upload-DrNFmVes.js → upload-uU2cK0Ce.js} +1 -1
- package/dist/{useAliveFlag-Dd06mRxe.js → useAliveFlag-BjP0Gxza.js} +1 -1
- package/dist/{useCloudI18n-Nwqo7pI_.js → useCloudI18n-CGVEZV3o.js} +2 -2
- package/dist/{useEditorCore-BcT7UI4e.js → useEditorCore-DRbMRe8F.js} +1103 -1076
- package/dist/{useEditorRoot-BD3piYtD.js → useEditorRoot-BVm2-1N8.js} +2 -2
- package/dist/{useI18n-CxVEpurs.js → useI18n-CSh4gO5c.js} +2 -2
- package/dist/{useLogicTag-D-dI8H6p.js → useLogicTag-zcI6BWIf.js} +3 -3
- package/dist/{useMergeTag-5wMeDBi-.js → useMergeTag-C-iBLlp0.js} +5 -5
- package/dist/{usePopoverPosition-CwnH1o5g.js → usePopoverPosition-CMcsMBtK.js} +2 -2
- package/dist/{useScrollToBlock-Do3suaqp.js → useScrollToBlock-CdCQK9QQ.js} +3 -3
- package/dist/{vue.runtime.esm-bundler-CAzmrXdD.js → vue.runtime.esm-bundler-DV0Wx4r_.js} +1079 -1080
- package/dist/{withCurrentFont-B4YnsG_2.js → withCurrentFont-D62njRLu.js} +1 -1
- package/dist/{x-CBFKGLB1.js → x-KFQ4S-Kz.js} +1 -1
- package/package.json +12 -12
- package/dist/BlockPreviewCanvas-CZDBSPoG.js +0 -136
- package/dist/CloudHeaderExtras-gXsTYoGG.js +0 -59
- package/dist/CollaboratorBar-BazGNMqN.js +0 -103
- package/dist/Toolbar-OGakTBEg.js +0 -2851
- package/dist/WrapperBlock-BOABSX9W.js +0 -46
- package/dist/cdn/chunks/BlockPreviewCanvas-cOTMFRcg.js +0 -138
- package/dist/cdn/chunks/BlockPreviewCanvas-cOTMFRcg.js.map +0 -1
- package/dist/cdn/chunks/CloudHeaderExtras-DJXLTUHc.js.map +0 -1
- package/dist/cdn/chunks/CloudPanels-D1fPLjG8.js.map +0 -1
- package/dist/cdn/chunks/CollaboratorBar-MeRQB1eN.js +0 -52
- package/dist/cdn/chunks/CollaboratorBar-MeRQB1eN.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-Ik54UO_-.js +0 -2767
- package/dist/cdn/chunks/Toolbar-Ik54UO_-.js.map +0 -1
- package/dist/cdn/chunks/WrapperBlock-fsLe7goL.js +0 -48
- package/dist/cdn/chunks/WrapperBlock-fsLe7goL.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-D3g5QzdT.js +0 -21
- package/dist/cdn/chunks/blockTypeIcons-D3g5QzdT.js.map +0 -1
- package/dist/cdn/chunks/ca-DMoGGP9L.js.map +0 -1
- package/dist/cdn/chunks/cloud-Cd7ptfhL.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-DtIZ2Lee.js.map +0 -1
- package/dist/cdn/chunks/de-DgAelLbM.js.map +0 -1
- package/dist/cdn/chunks/draggable-DrsNwZuB.js.map +0 -1
- package/dist/cdn/chunks/en-BANFWZdr.js +0 -1
- package/dist/cdn/chunks/en-ChVeGQBY.js.map +0 -1
- package/dist/cdn/chunks/en-Dekrl7HA.js.map +0 -1
- package/dist/cdn/chunks/es-BaZzyidV.js.map +0 -1
- package/dist/cdn/chunks/fr-C5ucb1HK.js.map +0 -1
- package/dist/cdn/chunks/icons-C4fX9Bwy.js.map +0 -1
- package/dist/cdn/chunks/ja-CUgR3mV0.js.map +0 -1
- package/dist/cdn/chunks/nl-qrLY7hMS.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-C6hMTQYi.js.map +0 -1
- package/dist/cdn/chunks/pusher-C8DeiO2X.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-DACw1wA8.js +0 -1103
- package/dist/cdn/chunks/socialIcons-DACw1wA8.js.map +0 -1
- package/dist/cdn/chunks/src-BnJlDuyB.js.map +0 -1
- package/dist/cdn/chunks/src-Bu0qBpbf.js +0 -616
- package/dist/cdn/chunks/src-Bu0qBpbf.js.map +0 -1
- package/dist/cdn/chunks/src-CHlVFp7r.js.map +0 -1
- package/dist/cdn/chunks/timeouts-DHPZQ0G3.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BPigZk5G.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-Bf2d1DKI.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-CTc6O8al.js +0 -10
- package/dist/en-CC-57eC_.js +0 -1
- package/dist/socialIcons-BctavKBN.js +0 -1180
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let t = e instanceof a ? e.statusCode : void 0;
|
|
1
|
+
import { R as e, Z as t, s as n } from "./vue.runtime.esm-bundler-DV0Wx4r_.js";
|
|
2
|
+
import { f as r } from "./dist-DBG3nh3k.js";
|
|
3
|
+
//#region ../core/dist/cloud/index.js
|
|
4
|
+
function i(e) {
|
|
5
|
+
let t = e instanceof r ? e.statusCode : void 0;
|
|
7
6
|
return t !== void 0 && t >= 400 && t < 500;
|
|
8
7
|
}
|
|
9
|
-
var
|
|
8
|
+
var a = class e {
|
|
10
9
|
static DEFAULT_BASE_URL = "https://templatical.com";
|
|
11
10
|
accessToken = null;
|
|
12
11
|
expiresAt = null;
|
|
@@ -79,17 +78,17 @@ var s = class e {
|
|
|
79
78
|
credentials: this.requestOptions.credentials ?? "include"
|
|
80
79
|
};
|
|
81
80
|
e === "POST" && this.requestOptions.body && (t["Content-Type"] = "application/json", n.body = JSON.stringify(this.requestOptions.body));
|
|
82
|
-
let
|
|
83
|
-
if (!
|
|
84
|
-
let
|
|
85
|
-
if (!
|
|
86
|
-
return this.accessToken =
|
|
87
|
-
allowedEmails:
|
|
88
|
-
signature:
|
|
89
|
-
} : null, this._userConfig =
|
|
90
|
-
id:
|
|
91
|
-
name:
|
|
92
|
-
signature:
|
|
81
|
+
let i = await fetch(this.url, n);
|
|
82
|
+
if (!i.ok) throw new r(`Token refresh failed: ${i.status}`, i.status);
|
|
83
|
+
let a = await i.json();
|
|
84
|
+
if (!a.token || !a.expiresAt || !a.projectId || !a.tenant) throw Error("Invalid token response: missing token, expiresAt, projectId, or tenant");
|
|
85
|
+
return this.accessToken = a.token, this.expiresAt = /* @__PURE__ */ new Date(a.expiresAt * 1e3), this._projectId = a.projectId, this._tenantSlug = a.tenant, this._testEmailConfig = a.testEmail?.allowedEmails && a.testEmail?.signature ? {
|
|
86
|
+
allowedEmails: a.testEmail.allowedEmails,
|
|
87
|
+
signature: a.testEmail.signature
|
|
88
|
+
} : null, this._userConfig = a.user?.id && a.user?.name && a.user?.signature ? {
|
|
89
|
+
id: a.user.id,
|
|
90
|
+
name: a.user.name,
|
|
91
|
+
signature: a.user.signature
|
|
93
92
|
} : null, this.accessToken;
|
|
94
93
|
} catch (e) {
|
|
95
94
|
let t = e instanceof Error ? e : Error("Token refresh failed", { cause: e });
|
|
@@ -107,56 +106,54 @@ var s = class e {
|
|
|
107
106
|
return a.status === 401 && (a = await i(await this.refreshToken())), a;
|
|
108
107
|
}
|
|
109
108
|
};
|
|
110
|
-
|
|
111
|
-
//#region ../core/src/cloud/url-builder.ts
|
|
112
|
-
function c(e, t) {
|
|
109
|
+
function o(e, t) {
|
|
113
110
|
return e.replace(/\{(\w+)\}/g, (e, n) => encodeURIComponent(t[n] ?? ""));
|
|
114
111
|
}
|
|
115
|
-
var
|
|
112
|
+
var s = "/api/v1/projects/{project}/tenants/{tenant}", c = `${s}/templates/{template}`, l = `${c}/ai`, u = `${s}/media`, d = `${u}/folders`, f = `${s}/saved-modules`, p = {
|
|
116
113
|
health: "/api/v1/health",
|
|
117
|
-
"projects.config": `${
|
|
118
|
-
"broadcasting.auth": `${
|
|
119
|
-
"templates.store": `${
|
|
120
|
-
"templates.show": `${
|
|
121
|
-
"templates.update": `${
|
|
122
|
-
"templates.destroy": `${
|
|
123
|
-
"templates.export": `${
|
|
124
|
-
"templates.importFromBeefree": `${
|
|
125
|
-
"templates.sendTestEmail": `${
|
|
126
|
-
"versions.index": `${
|
|
127
|
-
"versions.store": `${
|
|
128
|
-
"versions.show": `${
|
|
129
|
-
"versions.restore": `${
|
|
130
|
-
"comments.index": `${
|
|
131
|
-
"comments.store": `${
|
|
132
|
-
"comments.update": `${
|
|
133
|
-
"comments.destroy": `${
|
|
134
|
-
"comments.resolve": `${
|
|
135
|
-
"ai.generate": `${
|
|
136
|
-
"ai.conversationMessages": `${
|
|
137
|
-
"ai.suggestions": `${
|
|
138
|
-
"ai.rewriteText": `${
|
|
139
|
-
"ai.score": `${
|
|
140
|
-
"ai.fixFinding": `${
|
|
141
|
-
"ai.generateFromDesign": `${
|
|
142
|
-
"media.upload": `${
|
|
143
|
-
"media.browse": `${
|
|
144
|
-
"media.delete": `${
|
|
145
|
-
"media.move": `${
|
|
146
|
-
"media.update": `${
|
|
147
|
-
"media.replace": `${
|
|
148
|
-
"media.checkUsage": `${
|
|
149
|
-
"media.frequentlyUsed": `${
|
|
150
|
-
"media.importFromUrl": `${
|
|
151
|
-
"folders.index": `${
|
|
152
|
-
"folders.store": `${
|
|
153
|
-
"folders.update": `${
|
|
154
|
-
"folders.destroy": `${
|
|
155
|
-
"savedModules.index": `${
|
|
156
|
-
"savedModules.store": `${
|
|
157
|
-
"savedModules.update": `${
|
|
158
|
-
"savedModules.destroy": `${
|
|
159
|
-
},
|
|
114
|
+
"projects.config": `${s}/config`,
|
|
115
|
+
"broadcasting.auth": `${s}/broadcasting/auth`,
|
|
116
|
+
"templates.store": `${s}/templates`,
|
|
117
|
+
"templates.show": `${c}`,
|
|
118
|
+
"templates.update": `${c}`,
|
|
119
|
+
"templates.destroy": `${c}`,
|
|
120
|
+
"templates.export": `${c}/export`,
|
|
121
|
+
"templates.importFromBeefree": `${s}/templates/import/from-beefree`,
|
|
122
|
+
"templates.sendTestEmail": `${c}/send-test-email`,
|
|
123
|
+
"versions.index": `${c}/versions`,
|
|
124
|
+
"versions.store": `${c}/versions`,
|
|
125
|
+
"versions.show": `${c}/versions/{version}`,
|
|
126
|
+
"versions.restore": `${c}/versions/{version}/restore`,
|
|
127
|
+
"comments.index": `${c}/comments`,
|
|
128
|
+
"comments.store": `${c}/comments`,
|
|
129
|
+
"comments.update": `${c}/comments/{comment}`,
|
|
130
|
+
"comments.destroy": `${c}/comments/{comment}`,
|
|
131
|
+
"comments.resolve": `${c}/comments/{comment}/resolve`,
|
|
132
|
+
"ai.generate": `${l}/generate`,
|
|
133
|
+
"ai.conversationMessages": `${l}/conversation-messages`,
|
|
134
|
+
"ai.suggestions": `${l}/suggestions`,
|
|
135
|
+
"ai.rewriteText": `${l}/rewrite-text`,
|
|
136
|
+
"ai.score": `${l}/score`,
|
|
137
|
+
"ai.fixFinding": `${l}/fix-finding`,
|
|
138
|
+
"ai.generateFromDesign": `${l}/generate-from-design`,
|
|
139
|
+
"media.upload": `${u}/upload`,
|
|
140
|
+
"media.browse": `${u}/browse`,
|
|
141
|
+
"media.delete": `${u}/delete`,
|
|
142
|
+
"media.move": `${u}/move`,
|
|
143
|
+
"media.update": `${u}/{media}`,
|
|
144
|
+
"media.replace": `${u}/{media}/replace`,
|
|
145
|
+
"media.checkUsage": `${u}/check-usage`,
|
|
146
|
+
"media.frequentlyUsed": `${u}/frequently-used`,
|
|
147
|
+
"media.importFromUrl": `${u}/import-from-url`,
|
|
148
|
+
"folders.index": `${d}`,
|
|
149
|
+
"folders.store": `${d}`,
|
|
150
|
+
"folders.update": `${d}/{mediaFolder}`,
|
|
151
|
+
"folders.destroy": `${d}/{mediaFolder}`,
|
|
152
|
+
"savedModules.index": `${f}`,
|
|
153
|
+
"savedModules.store": `${f}`,
|
|
154
|
+
"savedModules.update": `${f}/{savedModule}`,
|
|
155
|
+
"savedModules.destroy": `${f}/{savedModule}`
|
|
156
|
+
}, m = class {
|
|
160
157
|
authManager;
|
|
161
158
|
constructor(e) {
|
|
162
159
|
this.authManager = e;
|
|
@@ -184,7 +181,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
184
181
|
});
|
|
185
182
|
if (!n.ok) {
|
|
186
183
|
let e = await n.json().catch(() => ({ message: `HTTP error ${n.status}` })), t = this.extractFirstValidationError(e);
|
|
187
|
-
throw new
|
|
184
|
+
throw new r(t, n.status);
|
|
188
185
|
}
|
|
189
186
|
if (n.status !== 204) return (await n.json()).data;
|
|
190
187
|
}
|
|
@@ -196,7 +193,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
196
193
|
return e.message;
|
|
197
194
|
}
|
|
198
195
|
async createTemplate(e, t) {
|
|
199
|
-
return this.request(
|
|
196
|
+
return this.request(o(p["templates.store"], this.baseParams), {
|
|
200
197
|
method: "POST",
|
|
201
198
|
body: JSON.stringify(t === void 0 ? { content: e } : {
|
|
202
199
|
content: e,
|
|
@@ -205,13 +202,13 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
205
202
|
});
|
|
206
203
|
}
|
|
207
204
|
async getTemplate(e) {
|
|
208
|
-
return this.request(
|
|
205
|
+
return this.request(o(p["templates.show"], {
|
|
209
206
|
...this.baseParams,
|
|
210
207
|
template: e
|
|
211
208
|
}));
|
|
212
209
|
}
|
|
213
210
|
async updateTemplate(e, t) {
|
|
214
|
-
return this.request(
|
|
211
|
+
return this.request(o(p["templates.update"], {
|
|
215
212
|
...this.baseParams,
|
|
216
213
|
template: e
|
|
217
214
|
}), {
|
|
@@ -220,7 +217,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
220
217
|
});
|
|
221
218
|
}
|
|
222
219
|
async createVersion(e, t, n) {
|
|
223
|
-
return this.request(
|
|
220
|
+
return this.request(o(p["versions.store"], {
|
|
224
221
|
...this.baseParams,
|
|
225
222
|
template: e
|
|
226
223
|
}), {
|
|
@@ -232,26 +229,26 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
232
229
|
});
|
|
233
230
|
}
|
|
234
231
|
async deleteTemplate(e) {
|
|
235
|
-
return this.request(
|
|
232
|
+
return this.request(o(p["templates.destroy"], {
|
|
236
233
|
...this.baseParams,
|
|
237
234
|
template: e
|
|
238
235
|
}), { method: "DELETE" });
|
|
239
236
|
}
|
|
240
237
|
async getVersions(e) {
|
|
241
|
-
return this.request(
|
|
238
|
+
return this.request(o(p["versions.index"], {
|
|
242
239
|
...this.baseParams,
|
|
243
240
|
template: e
|
|
244
241
|
}));
|
|
245
242
|
}
|
|
246
243
|
async getVersion(e, t) {
|
|
247
|
-
return this.request(
|
|
244
|
+
return this.request(o(p["versions.show"], {
|
|
248
245
|
...this.baseParams,
|
|
249
246
|
template: e,
|
|
250
247
|
version: t
|
|
251
248
|
}));
|
|
252
249
|
}
|
|
253
250
|
async restoreVersion(e, t) {
|
|
254
|
-
return this.request(
|
|
251
|
+
return this.request(o(p["versions.restore"], {
|
|
255
252
|
...this.baseParams,
|
|
256
253
|
template: e,
|
|
257
254
|
version: t
|
|
@@ -262,7 +259,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
262
259
|
custom_fonts: t.customFonts,
|
|
263
260
|
default_fallback: t.defaultFallback
|
|
264
261
|
}) : void 0;
|
|
265
|
-
return this.request(
|
|
262
|
+
return this.request(o(p["templates.export"], {
|
|
266
263
|
...this.baseParams,
|
|
267
264
|
template: e
|
|
268
265
|
}), {
|
|
@@ -271,7 +268,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
271
268
|
});
|
|
272
269
|
}
|
|
273
270
|
async sendTestEmail(e, t) {
|
|
274
|
-
await this.request(
|
|
271
|
+
await this.request(o(p["templates.sendTestEmail"], {
|
|
275
272
|
...this.baseParams,
|
|
276
273
|
template: e
|
|
277
274
|
}), {
|
|
@@ -280,11 +277,11 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
280
277
|
});
|
|
281
278
|
}
|
|
282
279
|
commentsUrl(e, t) {
|
|
283
|
-
return t ?
|
|
280
|
+
return t ? o(p["comments.update"], {
|
|
284
281
|
...this.baseParams,
|
|
285
282
|
template: e,
|
|
286
283
|
comment: t
|
|
287
|
-
}) :
|
|
284
|
+
}) : o(p["comments.index"], {
|
|
288
285
|
...this.baseParams,
|
|
289
286
|
template: e
|
|
290
287
|
});
|
|
@@ -314,7 +311,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
314
311
|
});
|
|
315
312
|
}
|
|
316
313
|
async resolveComment(e, t, n, r) {
|
|
317
|
-
return this.request(
|
|
314
|
+
return this.request(o(p["comments.resolve"], {
|
|
318
315
|
...this.baseParams,
|
|
319
316
|
template: e,
|
|
320
317
|
comment: t
|
|
@@ -325,22 +322,22 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
325
322
|
});
|
|
326
323
|
}
|
|
327
324
|
async fetchConfig() {
|
|
328
|
-
return this.request(
|
|
325
|
+
return this.request(o(p["projects.config"], this.baseParams));
|
|
329
326
|
}
|
|
330
327
|
async listModules(e, t) {
|
|
331
|
-
let n =
|
|
328
|
+
let n = o(p["savedModules.index"], this.baseParams), r = new URLSearchParams();
|
|
332
329
|
e && r.set("search", e), t && r.set("category", t);
|
|
333
330
|
let i = r.size > 0 ? `?${r}` : "";
|
|
334
331
|
return this.request(`${n}${i}`);
|
|
335
332
|
}
|
|
336
333
|
async createModule(e) {
|
|
337
|
-
return this.request(
|
|
334
|
+
return this.request(o(p["savedModules.store"], this.baseParams), {
|
|
338
335
|
method: "POST",
|
|
339
336
|
body: JSON.stringify(e)
|
|
340
337
|
});
|
|
341
338
|
}
|
|
342
339
|
async updateModule(e, t) {
|
|
343
|
-
return this.request(
|
|
340
|
+
return this.request(o(p["savedModules.update"], {
|
|
344
341
|
...this.baseParams,
|
|
345
342
|
savedModule: e
|
|
346
343
|
}), {
|
|
@@ -349,12 +346,12 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
349
346
|
});
|
|
350
347
|
}
|
|
351
348
|
async deleteModule(e) {
|
|
352
|
-
return this.request(
|
|
349
|
+
return this.request(o(p["savedModules.destroy"], {
|
|
353
350
|
...this.baseParams,
|
|
354
351
|
savedModule: e
|
|
355
352
|
}), { method: "DELETE" });
|
|
356
353
|
}
|
|
357
|
-
},
|
|
354
|
+
}, h = class {
|
|
358
355
|
authManager;
|
|
359
356
|
constructor(e) {
|
|
360
357
|
this.authManager = e;
|
|
@@ -389,7 +386,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
389
386
|
async browseMedia(e) {
|
|
390
387
|
let t = new URLSearchParams();
|
|
391
388
|
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 = `${
|
|
389
|
+
let n = t.toString(), r = `${o(p["media.browse"], this.baseParams)}${n ? `?${n}` : ""}`, i = await this.authManager.authenticatedFetch(r, { headers: { Accept: "application/json" } });
|
|
393
390
|
if (!i.ok) {
|
|
394
391
|
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
395
392
|
throw Error(e.message, { cause: e });
|
|
@@ -399,7 +396,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
399
396
|
async uploadMedia(e, t) {
|
|
400
397
|
let n = new FormData();
|
|
401
398
|
n.append("file", e), t && n.append("folderId", t);
|
|
402
|
-
let r =
|
|
399
|
+
let r = o(p["media.upload"], this.baseParams), i = await this.authManager.authenticatedFetch(r, {
|
|
403
400
|
method: "POST",
|
|
404
401
|
headers: { Accept: "application/json" },
|
|
405
402
|
body: n
|
|
@@ -412,7 +409,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
412
409
|
}
|
|
413
410
|
async updateMedia(e, t, n) {
|
|
414
411
|
let r = {};
|
|
415
|
-
return t !== void 0 && (r.filename = t), n !== void 0 && (r.alt = n), this.request(
|
|
412
|
+
return t !== void 0 && (r.filename = t), n !== void 0 && (r.alt = n), this.request(o(p["media.update"], {
|
|
416
413
|
...this.baseParams,
|
|
417
414
|
media: e
|
|
418
415
|
}), {
|
|
@@ -421,13 +418,13 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
421
418
|
});
|
|
422
419
|
}
|
|
423
420
|
async deleteMedia(e) {
|
|
424
|
-
return this.request(
|
|
421
|
+
return this.request(o(p["media.delete"], this.baseParams), {
|
|
425
422
|
method: "POST",
|
|
426
423
|
body: JSON.stringify({ ids: e })
|
|
427
424
|
});
|
|
428
425
|
}
|
|
429
426
|
async moveMedia(e, t) {
|
|
430
|
-
return this.request(
|
|
427
|
+
return this.request(o(p["media.move"], this.baseParams), {
|
|
431
428
|
method: "POST",
|
|
432
429
|
body: JSON.stringify({
|
|
433
430
|
ids: e,
|
|
@@ -436,10 +433,10 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
436
433
|
});
|
|
437
434
|
}
|
|
438
435
|
async getMediaFolders() {
|
|
439
|
-
return this.request(
|
|
436
|
+
return this.request(o(p["folders.index"], this.baseParams));
|
|
440
437
|
}
|
|
441
438
|
async createMediaFolder(e, t) {
|
|
442
|
-
return this.request(
|
|
439
|
+
return this.request(o(p["folders.store"], this.baseParams), {
|
|
443
440
|
method: "POST",
|
|
444
441
|
body: JSON.stringify({
|
|
445
442
|
name: e,
|
|
@@ -448,7 +445,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
448
445
|
});
|
|
449
446
|
}
|
|
450
447
|
async renameMediaFolder(e, t) {
|
|
451
|
-
return this.request(
|
|
448
|
+
return this.request(o(p["folders.update"], {
|
|
452
449
|
...this.baseParams,
|
|
453
450
|
mediaFolder: e
|
|
454
451
|
}), {
|
|
@@ -457,13 +454,13 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
457
454
|
});
|
|
458
455
|
}
|
|
459
456
|
async deleteMediaFolder(e) {
|
|
460
|
-
return this.request(
|
|
457
|
+
return this.request(o(p["folders.destroy"], {
|
|
461
458
|
...this.baseParams,
|
|
462
459
|
mediaFolder: e
|
|
463
460
|
}), { method: "DELETE" });
|
|
464
461
|
}
|
|
465
462
|
async checkMediaUsage(e) {
|
|
466
|
-
let t = await this.authManager.authenticatedFetch(
|
|
463
|
+
let t = await this.authManager.authenticatedFetch(o(p["media.checkUsage"], this.baseParams), {
|
|
467
464
|
method: "POST",
|
|
468
465
|
headers: {
|
|
469
466
|
"Content-Type": "application/json",
|
|
@@ -478,10 +475,10 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
478
475
|
return t.json();
|
|
479
476
|
}
|
|
480
477
|
async getFrequentlyUsed() {
|
|
481
|
-
return this.request(
|
|
478
|
+
return this.request(o(p["media.frequentlyUsed"], this.baseParams));
|
|
482
479
|
}
|
|
483
480
|
async importFromUrl(e, t) {
|
|
484
|
-
return this.request(
|
|
481
|
+
return this.request(o(p["media.importFromUrl"], this.baseParams), {
|
|
485
482
|
method: "POST",
|
|
486
483
|
body: JSON.stringify({
|
|
487
484
|
url: e,
|
|
@@ -492,7 +489,7 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
492
489
|
async replaceMedia(e, t) {
|
|
493
490
|
let n = new FormData();
|
|
494
491
|
n.append("file", t);
|
|
495
|
-
let r =
|
|
492
|
+
let r = o(p["media.replace"], {
|
|
496
493
|
...this.baseParams,
|
|
497
494
|
media: e
|
|
498
495
|
}), i = await this.authManager.authenticatedFetch(r, {
|
|
@@ -507,16 +504,14 @@ var l = "/api/v1/projects/{project}/tenants/{tenant}", u = `${l}/templates/{temp
|
|
|
507
504
|
return (await i.json()).data;
|
|
508
505
|
}
|
|
509
506
|
};
|
|
510
|
-
|
|
511
|
-
//#region ../core/src/cloud/websocket-client.ts
|
|
512
|
-
function v(e) {
|
|
507
|
+
function g(e) {
|
|
513
508
|
return {
|
|
514
509
|
host: e.host,
|
|
515
510
|
port: e.port,
|
|
516
511
|
appKey: e.appKey
|
|
517
512
|
};
|
|
518
513
|
}
|
|
519
|
-
var
|
|
514
|
+
var _ = class {
|
|
520
515
|
pusher = null;
|
|
521
516
|
authManager;
|
|
522
517
|
config;
|
|
@@ -526,27 +521,27 @@ var y = class {
|
|
|
526
521
|
}
|
|
527
522
|
async connect() {
|
|
528
523
|
if (this.pusher) return;
|
|
529
|
-
let
|
|
524
|
+
let e;
|
|
530
525
|
try {
|
|
531
|
-
({default:
|
|
526
|
+
({default: e} = await import("pusher-js"));
|
|
532
527
|
} catch {
|
|
533
528
|
throw Error("[Templatical] Cloud features require the optional peer dependency 'pusher-js'. Please install it.");
|
|
534
529
|
}
|
|
535
|
-
let { host:
|
|
530
|
+
let { host: t, port: n, appKey: r } = this.config, i = this.authManager.resolveUrl(o(p["broadcasting.auth"], {
|
|
536
531
|
project: this.authManager.projectId,
|
|
537
532
|
tenant: this.authManager.tenantSlug
|
|
538
533
|
}));
|
|
539
|
-
this.pusher = new
|
|
540
|
-
wsHost:
|
|
541
|
-
wsPort:
|
|
542
|
-
wssPort:
|
|
534
|
+
this.pusher = new e(r, {
|
|
535
|
+
wsHost: t,
|
|
536
|
+
wsPort: n,
|
|
537
|
+
wssPort: n,
|
|
543
538
|
forceTLS: !0,
|
|
544
539
|
disableStats: !0,
|
|
545
540
|
enabledTransports: ["ws", "wss"],
|
|
546
541
|
cluster: "",
|
|
547
542
|
channelAuthorization: {
|
|
548
543
|
transport: "ajax",
|
|
549
|
-
endpoint:
|
|
544
|
+
endpoint: i,
|
|
550
545
|
headers: {
|
|
551
546
|
Authorization: `Bearer ${this.authManager.accessTokenValue}`,
|
|
552
547
|
Accept: "application/json"
|
|
@@ -580,70 +575,41 @@ var y = class {
|
|
|
580
575
|
get isConnected() {
|
|
581
576
|
return this.pusher?.connection.state === "connected";
|
|
582
577
|
}
|
|
583
|
-
};
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
function b(e, t) {
|
|
587
|
-
let { operation: n, data: r } = t;
|
|
588
|
-
switch (n) {
|
|
589
|
-
case "addBlock":
|
|
590
|
-
e.addBlock(r.block, r.sectionId, r.columnIndex, r.index);
|
|
591
|
-
break;
|
|
592
|
-
case "updateBlock":
|
|
593
|
-
e.updateBlock(r.blockId, r.updates);
|
|
594
|
-
break;
|
|
595
|
-
case "deleteBlock":
|
|
596
|
-
e.removeBlock(r.blockId);
|
|
597
|
-
break;
|
|
598
|
-
case "moveBlock":
|
|
599
|
-
e.moveBlock(r.blockId, r.index, r.sectionId, r.columnIndex);
|
|
600
|
-
break;
|
|
601
|
-
case "updateSettings":
|
|
602
|
-
e.updateSettings(r.updates);
|
|
603
|
-
break;
|
|
604
|
-
case "setContent":
|
|
605
|
-
e.setContent(r.content);
|
|
606
|
-
break;
|
|
607
|
-
case "updateBlockStyle": e.updateBlock(r.blockId, { styles: r.styles });
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
//#endregion
|
|
611
|
-
//#region ../core/src/cloud/ai-chat.ts
|
|
612
|
-
var x = 0;
|
|
613
|
-
function S() {
|
|
614
|
-
return `msg_${Date.now()}_${++x}`;
|
|
578
|
+
}, v = 0;
|
|
579
|
+
function y() {
|
|
580
|
+
return `msg_${Date.now()}_${++v}`;
|
|
615
581
|
}
|
|
616
|
-
function
|
|
617
|
-
let { authManager:
|
|
618
|
-
function
|
|
619
|
-
let n =
|
|
582
|
+
function b(e) {
|
|
583
|
+
let { authManager: n, getTemplateId: r, onApply: i, onError: a } = e, s = t([]), c = t(!1), l = t(!1), u = t(null), d = t(null), f = t(null), m = t(null), h = t(null), g = t(null), _ = t(!1), v = t([]), b = t(!1);
|
|
584
|
+
function x(e, t) {
|
|
585
|
+
let n = s.value.findIndex((t) => t.id === e);
|
|
620
586
|
if (n === -1) return;
|
|
621
587
|
let r = {
|
|
622
|
-
...
|
|
588
|
+
...s.value[n],
|
|
623
589
|
...t
|
|
624
590
|
};
|
|
625
|
-
|
|
626
|
-
...
|
|
591
|
+
s.value = [
|
|
592
|
+
...s.value.slice(0, n),
|
|
627
593
|
r,
|
|
628
|
-
...
|
|
594
|
+
...s.value.slice(n + 1)
|
|
629
595
|
];
|
|
630
596
|
}
|
|
631
|
-
async function
|
|
597
|
+
async function S() {
|
|
632
598
|
let e = r();
|
|
633
599
|
if (e) {
|
|
634
600
|
l.value = !0;
|
|
635
601
|
try {
|
|
636
|
-
let
|
|
637
|
-
project:
|
|
638
|
-
tenant:
|
|
602
|
+
let t = o(p["ai.conversationMessages"], {
|
|
603
|
+
project: n.projectId,
|
|
604
|
+
tenant: n.tenantSlug,
|
|
639
605
|
template: e
|
|
640
|
-
}), r = await
|
|
606
|
+
}), r = await n.authenticatedFetch(t, {
|
|
641
607
|
method: "GET",
|
|
642
608
|
headers: { Accept: "application/json" }
|
|
643
609
|
});
|
|
644
610
|
if (!r.ok) return;
|
|
645
611
|
let i = await r.json();
|
|
646
|
-
i.conversationId && (f.value = i.conversationId), Array.isArray(i.data) && i.data.length > 0 && (
|
|
612
|
+
i.conversationId && (f.value = i.conversationId), Array.isArray(i.data) && i.data.length > 0 && (s.value = i.data.map((e) => ({
|
|
647
613
|
id: e.id,
|
|
648
614
|
role: e.role,
|
|
649
615
|
content: e.content,
|
|
@@ -654,16 +620,16 @@ function C(e) {
|
|
|
654
620
|
}
|
|
655
621
|
}
|
|
656
622
|
}
|
|
657
|
-
async function C(e,
|
|
623
|
+
async function C(e, t) {
|
|
658
624
|
let i = r();
|
|
659
625
|
if (i) {
|
|
660
|
-
|
|
626
|
+
b.value = !0;
|
|
661
627
|
try {
|
|
662
|
-
let r =
|
|
663
|
-
project:
|
|
664
|
-
tenant:
|
|
628
|
+
let r = o(p["ai.suggestions"], {
|
|
629
|
+
project: n.projectId,
|
|
630
|
+
tenant: n.tenantSlug,
|
|
665
631
|
template: i
|
|
666
|
-
}), a = await
|
|
632
|
+
}), a = await n.authenticatedFetch(r, {
|
|
667
633
|
method: "POST",
|
|
668
634
|
headers: {
|
|
669
635
|
"Content-Type": "application/json",
|
|
@@ -671,20 +637,20 @@ function C(e) {
|
|
|
671
637
|
},
|
|
672
638
|
body: JSON.stringify({
|
|
673
639
|
currentContent: e,
|
|
674
|
-
mergeTags:
|
|
640
|
+
mergeTags: t.map((e) => ({
|
|
675
641
|
label: e.label,
|
|
676
642
|
value: e.value
|
|
677
643
|
}))
|
|
678
644
|
})
|
|
679
645
|
});
|
|
680
646
|
if (!a.ok) return;
|
|
681
|
-
let
|
|
682
|
-
if (!
|
|
683
|
-
let
|
|
647
|
+
let s = a.body?.getReader();
|
|
648
|
+
if (!s) return;
|
|
649
|
+
let c = new TextDecoder(), l = "";
|
|
684
650
|
for (;;) {
|
|
685
|
-
let { done: e, value: t } = await
|
|
651
|
+
let { done: e, value: t } = await s.read();
|
|
686
652
|
if (e) break;
|
|
687
|
-
l +=
|
|
653
|
+
l += c.decode(t, { stream: !0 });
|
|
688
654
|
let n = l.split("\n");
|
|
689
655
|
l = n.pop() ?? "";
|
|
690
656
|
for (let e of n) {
|
|
@@ -699,34 +665,34 @@ function C(e) {
|
|
|
699
665
|
}
|
|
700
666
|
}
|
|
701
667
|
} catch {} finally {
|
|
702
|
-
|
|
668
|
+
b.value = !1;
|
|
703
669
|
}
|
|
704
670
|
}
|
|
705
671
|
}
|
|
706
|
-
async function w(e,
|
|
707
|
-
let
|
|
708
|
-
if (!
|
|
709
|
-
|
|
710
|
-
let
|
|
711
|
-
|
|
712
|
-
id:
|
|
672
|
+
async function w(e, t, l) {
|
|
673
|
+
let b = r();
|
|
674
|
+
if (!b) throw Error("Template must be saved before using AI generation");
|
|
675
|
+
c.value = !0, u.value = null, d.value = null, v.value = [];
|
|
676
|
+
let S = y();
|
|
677
|
+
s.value = [...s.value, {
|
|
678
|
+
id: S,
|
|
713
679
|
role: "user",
|
|
714
680
|
content: e,
|
|
715
681
|
timestamp: Date.now()
|
|
716
682
|
}];
|
|
717
|
-
let C =
|
|
718
|
-
|
|
683
|
+
let C = y();
|
|
684
|
+
s.value = [...s.value, {
|
|
719
685
|
id: C,
|
|
720
686
|
role: "assistant",
|
|
721
687
|
content: "",
|
|
722
688
|
timestamp: Date.now()
|
|
723
689
|
}];
|
|
724
690
|
try {
|
|
725
|
-
let r =
|
|
726
|
-
project:
|
|
727
|
-
tenant:
|
|
728
|
-
template:
|
|
729
|
-
}), a = await
|
|
691
|
+
let r = o(p["ai.generate"], {
|
|
692
|
+
project: n.projectId,
|
|
693
|
+
tenant: n.tenantSlug,
|
|
694
|
+
template: b
|
|
695
|
+
}), a = await n.authenticatedFetch(r, {
|
|
730
696
|
method: "POST",
|
|
731
697
|
headers: {
|
|
732
698
|
"Content-Type": "application/json",
|
|
@@ -734,7 +700,7 @@ function C(e) {
|
|
|
734
700
|
},
|
|
735
701
|
body: JSON.stringify({
|
|
736
702
|
prompt: e,
|
|
737
|
-
currentContent:
|
|
703
|
+
currentContent: t,
|
|
738
704
|
mergeTags: l.map((e) => ({
|
|
739
705
|
label: e.label,
|
|
740
706
|
value: e.value
|
|
@@ -744,90 +710,86 @@ function C(e) {
|
|
|
744
710
|
});
|
|
745
711
|
if (!a.ok) {
|
|
746
712
|
let e = await a.json().catch(() => null);
|
|
747
|
-
throw
|
|
713
|
+
throw a.status === 403 ? Error("aiGenerationNotAvailable") : Error(e?.message || "Failed to generate template");
|
|
748
714
|
}
|
|
749
|
-
let
|
|
750
|
-
if (!
|
|
751
|
-
let d = new TextDecoder(), v = "",
|
|
715
|
+
let c = a.body?.getReader();
|
|
716
|
+
if (!c) throw Error("Failed to read stream");
|
|
717
|
+
let d = new TextDecoder(), v = "", y = null;
|
|
752
718
|
try {
|
|
753
719
|
for (;;) {
|
|
754
|
-
let { done: e, value:
|
|
720
|
+
let { done: e, value: n } = await c.read();
|
|
755
721
|
if (e) break;
|
|
756
|
-
v += d.decode(
|
|
722
|
+
v += d.decode(n, { stream: !0 });
|
|
757
723
|
let r = v.split("\n");
|
|
758
724
|
v = r.pop() ?? "";
|
|
759
725
|
for (let e of r) {
|
|
760
726
|
if (!e.startsWith("data: ")) continue;
|
|
761
|
-
let
|
|
727
|
+
let n = e.slice(6), r;
|
|
762
728
|
try {
|
|
763
|
-
r = JSON.parse(
|
|
729
|
+
r = JSON.parse(n);
|
|
764
730
|
} catch {
|
|
765
731
|
continue;
|
|
766
732
|
}
|
|
767
|
-
if (r.type === "text")
|
|
733
|
+
if (r.type === "text") x(C, { content: (s.value.find((e) => e.id === C)?.content ?? "") + r.text });
|
|
768
734
|
else if (r.type === "error") throw Error(r.message || "Failed to generate template");
|
|
769
|
-
else r.type === "done" && (r.conversationId && (f.value = r.conversationId),
|
|
735
|
+
else r.type === "done" && (r.conversationId && (f.value = r.conversationId), x(C, { content: r.text }), y = r.content ?? null, y ? (h.value = t, g.value = y, m.value = C, _.value = !1, i?.(y)) : u.value = "ai_apply_failed");
|
|
770
736
|
}
|
|
771
737
|
}
|
|
772
738
|
} finally {
|
|
773
|
-
|
|
739
|
+
c.cancel().catch(() => {});
|
|
774
740
|
}
|
|
775
|
-
return
|
|
741
|
+
return y;
|
|
776
742
|
} catch (t) {
|
|
777
743
|
let n = t instanceof Error ? t : Error("Failed to generate template", { cause: t });
|
|
778
|
-
return u.value = n.message, d.value = e, a?.(n),
|
|
744
|
+
return u.value = n.message, d.value = e, a?.(n), s.value = s.value.filter((e) => e.id !== S && e.id !== C), null;
|
|
779
745
|
} finally {
|
|
780
|
-
|
|
746
|
+
c.value = !1;
|
|
781
747
|
}
|
|
782
748
|
}
|
|
783
749
|
function T() {
|
|
784
|
-
_.value ? (g.value && i?.(g.value), _.value = !1) : (
|
|
750
|
+
_.value ? (g.value && i?.(g.value), _.value = !1) : (h.value && i?.(h.value), _.value = !0);
|
|
785
751
|
}
|
|
786
752
|
function E() {
|
|
787
|
-
|
|
753
|
+
s.value = [], f.value = null, u.value = null, m.value = null, h.value = null, g.value = null, _.value = !1;
|
|
788
754
|
}
|
|
789
755
|
return {
|
|
790
|
-
messages:
|
|
791
|
-
isGenerating:
|
|
756
|
+
messages: s,
|
|
757
|
+
isGenerating: c,
|
|
792
758
|
isLoadingHistory: l,
|
|
793
759
|
isLastChangeReverted: _,
|
|
794
|
-
lastApplyMessageId:
|
|
760
|
+
lastApplyMessageId: m,
|
|
795
761
|
error: u,
|
|
796
762
|
failedPrompt: d,
|
|
797
763
|
suggestions: v,
|
|
798
|
-
isLoadingSuggestions:
|
|
764
|
+
isLoadingSuggestions: b,
|
|
799
765
|
sendPrompt: w,
|
|
800
766
|
toggleLastRevert: T,
|
|
801
|
-
loadConversation:
|
|
767
|
+
loadConversation: S,
|
|
802
768
|
loadSuggestions: C,
|
|
803
769
|
clearChat: E
|
|
804
770
|
};
|
|
805
771
|
}
|
|
806
|
-
|
|
807
|
-
//#region ../core/src/cloud/ai-config.ts
|
|
808
|
-
function w(e) {
|
|
772
|
+
function x(e) {
|
|
809
773
|
function t(t) {
|
|
810
774
|
return e !== !1 && e?.[t] !== !1;
|
|
811
775
|
}
|
|
812
776
|
return {
|
|
813
777
|
isFeatureEnabled: t,
|
|
814
|
-
hasAnyMenuFeature:
|
|
778
|
+
hasAnyMenuFeature: n(() => t("chat") || t("scoring") || t("designToTemplate"))
|
|
815
779
|
};
|
|
816
780
|
}
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
function
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
if (!s) return null;
|
|
824
|
-
i.value = !0, o.value = null, a.value = null;
|
|
781
|
+
function S(e) {
|
|
782
|
+
let { authManager: n, getTemplateId: r } = e, i = t(!1), a = t(null), s = t(null), c = t(null), l = t(""), u = t(null);
|
|
783
|
+
async function d(e, t) {
|
|
784
|
+
let c = r();
|
|
785
|
+
if (!c) return null;
|
|
786
|
+
i.value = !0, s.value = null, a.value = null;
|
|
825
787
|
try {
|
|
826
|
-
let r =
|
|
827
|
-
project:
|
|
828
|
-
tenant:
|
|
829
|
-
template:
|
|
830
|
-
}), i = await
|
|
788
|
+
let r = o(p["ai.score"], {
|
|
789
|
+
project: n.projectId,
|
|
790
|
+
tenant: n.tenantSlug,
|
|
791
|
+
template: c
|
|
792
|
+
}), i = await n.authenticatedFetch(r, {
|
|
831
793
|
method: "POST",
|
|
832
794
|
headers: {
|
|
833
795
|
"Content-Type": "application/json",
|
|
@@ -835,7 +797,7 @@ function T(e) {
|
|
|
835
797
|
},
|
|
836
798
|
body: JSON.stringify({
|
|
837
799
|
currentContent: e,
|
|
838
|
-
mergeTags:
|
|
800
|
+
mergeTags: t.map((e) => ({
|
|
839
801
|
label: e.label,
|
|
840
802
|
value: e.value
|
|
841
803
|
}))
|
|
@@ -846,11 +808,11 @@ function T(e) {
|
|
|
846
808
|
let e = await i.json().catch(() => null);
|
|
847
809
|
throw Error(e?.message || "Failed to score template");
|
|
848
810
|
}
|
|
849
|
-
let
|
|
850
|
-
if (!
|
|
811
|
+
let s = i.body?.getReader();
|
|
812
|
+
if (!s) throw Error("Failed to read stream");
|
|
851
813
|
let l = new TextDecoder(), u = "", d = null;
|
|
852
814
|
for (;;) {
|
|
853
|
-
let { done: e, value: t } = await
|
|
815
|
+
let { done: e, value: t } = await s.read();
|
|
854
816
|
if (e) break;
|
|
855
817
|
u += l.decode(t, { stream: !0 });
|
|
856
818
|
let n = u.split("\n");
|
|
@@ -870,21 +832,21 @@ function T(e) {
|
|
|
870
832
|
if (d) for (let [e, t] of Object.entries(d.categories)) for (let n of t.findings) n.category = e;
|
|
871
833
|
return a.value = d, d;
|
|
872
834
|
} catch (e) {
|
|
873
|
-
return
|
|
835
|
+
return s.value = e instanceof Error ? e.message : "Failed to score template", null;
|
|
874
836
|
} finally {
|
|
875
837
|
i.value = !1;
|
|
876
838
|
}
|
|
877
839
|
}
|
|
878
|
-
async function f(e,
|
|
840
|
+
async function f(e, t, i) {
|
|
879
841
|
let a = r();
|
|
880
842
|
if (!a) return null;
|
|
881
|
-
|
|
843
|
+
c.value = t.id, l.value = "", u.value = null;
|
|
882
844
|
try {
|
|
883
|
-
let r =
|
|
884
|
-
project:
|
|
885
|
-
tenant:
|
|
845
|
+
let r = o(p["ai.fixFinding"], {
|
|
846
|
+
project: n.projectId,
|
|
847
|
+
tenant: n.tenantSlug,
|
|
886
848
|
template: a
|
|
887
|
-
}),
|
|
849
|
+
}), s = await n.authenticatedFetch(r, {
|
|
888
850
|
method: "POST",
|
|
889
851
|
headers: {
|
|
890
852
|
"Content-Type": "application/json",
|
|
@@ -893,10 +855,10 @@ function T(e) {
|
|
|
893
855
|
body: JSON.stringify({
|
|
894
856
|
content: e,
|
|
895
857
|
finding: {
|
|
896
|
-
id:
|
|
897
|
-
message:
|
|
898
|
-
suggestion:
|
|
899
|
-
category:
|
|
858
|
+
id: t.id,
|
|
859
|
+
message: t.message,
|
|
860
|
+
suggestion: t.suggestion,
|
|
861
|
+
category: t.category
|
|
900
862
|
},
|
|
901
863
|
mergeTags: i.map((e) => ({
|
|
902
864
|
label: e.label,
|
|
@@ -904,16 +866,16 @@ function T(e) {
|
|
|
904
866
|
}))
|
|
905
867
|
})
|
|
906
868
|
});
|
|
907
|
-
if (!
|
|
908
|
-
if (
|
|
909
|
-
let e = await
|
|
869
|
+
if (!s.ok) {
|
|
870
|
+
if (s.status === 403) throw Error("aiGenerationNotAvailable");
|
|
871
|
+
let e = await s.json().catch(() => null);
|
|
910
872
|
throw Error(e?.message || "Failed to fix finding");
|
|
911
873
|
}
|
|
912
|
-
let
|
|
913
|
-
if (!
|
|
874
|
+
let c = s.body?.getReader();
|
|
875
|
+
if (!c) throw Error("Failed to read stream");
|
|
914
876
|
let u = new TextDecoder(), d = "", f = null;
|
|
915
877
|
for (;;) {
|
|
916
|
-
let { done: e, value: t } = await
|
|
878
|
+
let { done: e, value: t } = await c.read();
|
|
917
879
|
if (e) break;
|
|
918
880
|
d += u.decode(t, { stream: !0 });
|
|
919
881
|
let n = d.split("\n");
|
|
@@ -935,59 +897,57 @@ function T(e) {
|
|
|
935
897
|
} catch (e) {
|
|
936
898
|
return u.value = e instanceof Error ? e.message : "Failed to fix finding", null;
|
|
937
899
|
} finally {
|
|
938
|
-
|
|
900
|
+
c.value = null;
|
|
939
901
|
}
|
|
940
902
|
}
|
|
941
|
-
function
|
|
903
|
+
function m(e, t) {
|
|
942
904
|
if (!a.value) return;
|
|
943
905
|
let n = a.value.categories[e];
|
|
944
906
|
n && (n.findings = n.findings.filter((e) => e.id !== t));
|
|
945
907
|
}
|
|
946
|
-
function
|
|
947
|
-
i.value = !1, a.value = null,
|
|
908
|
+
function h() {
|
|
909
|
+
i.value = !1, a.value = null, s.value = null, c.value = null, l.value = "", u.value = null;
|
|
948
910
|
}
|
|
949
911
|
return {
|
|
950
912
|
isScoring: i,
|
|
951
913
|
scoringResult: a,
|
|
952
|
-
error:
|
|
953
|
-
fixingFindingId:
|
|
914
|
+
error: s,
|
|
915
|
+
fixingFindingId: c,
|
|
954
916
|
fixStreamingText: l,
|
|
955
917
|
fixError: u,
|
|
956
918
|
score: d,
|
|
957
919
|
fixFinding: f,
|
|
958
|
-
removeFinding:
|
|
959
|
-
reset:
|
|
920
|
+
removeFinding: m,
|
|
921
|
+
reset: h
|
|
960
922
|
};
|
|
961
923
|
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
function E(e) {
|
|
965
|
-
let { authManager: t, getTemplateId: r, onApply: i, onError: a } = e, o = n(!1), s = n(null);
|
|
924
|
+
function C(e) {
|
|
925
|
+
let { authManager: n, getTemplateId: r, onApply: i, onError: a } = e, s = t(!1), c = t(null);
|
|
966
926
|
async function l(e) {
|
|
967
|
-
let
|
|
968
|
-
if (!
|
|
969
|
-
|
|
927
|
+
let t = r();
|
|
928
|
+
if (!t) throw Error("Template must be saved before using design reference");
|
|
929
|
+
s.value = !0, c.value = null;
|
|
970
930
|
try {
|
|
971
931
|
let r = new FormData();
|
|
972
932
|
e.prompt && r.append("prompt", e.prompt), e.imageUpload && r.append("image_upload", e.imageUpload), e.pdfUpload && r.append("pdf_upload", e.pdfUpload);
|
|
973
|
-
let a =
|
|
974
|
-
project:
|
|
975
|
-
tenant:
|
|
976
|
-
template:
|
|
977
|
-
}),
|
|
933
|
+
let a = o(p["ai.generateFromDesign"], {
|
|
934
|
+
project: n.projectId,
|
|
935
|
+
tenant: n.tenantSlug,
|
|
936
|
+
template: t
|
|
937
|
+
}), s = await n.authenticatedFetch(a, {
|
|
978
938
|
method: "POST",
|
|
979
939
|
headers: { Accept: "text/event-stream" },
|
|
980
940
|
body: r
|
|
981
941
|
});
|
|
982
|
-
if (!
|
|
983
|
-
let e = await
|
|
984
|
-
throw
|
|
942
|
+
if (!s.ok) {
|
|
943
|
+
let e = await s.json().catch(() => null);
|
|
944
|
+
throw s.status === 403 ? Error("aiGenerationNotAvailable") : Error(e?.message || "Failed to generate template from design");
|
|
985
945
|
}
|
|
986
|
-
let
|
|
987
|
-
if (!
|
|
946
|
+
let c = s.body?.getReader();
|
|
947
|
+
if (!c) throw Error("Failed to read stream");
|
|
988
948
|
let l = new TextDecoder(), u = "", d = null;
|
|
989
949
|
for (;;) {
|
|
990
|
-
let { done: e, value: t } = await
|
|
950
|
+
let { done: e, value: t } = await c.read();
|
|
991
951
|
if (e) break;
|
|
992
952
|
u += l.decode(t, { stream: !0 });
|
|
993
953
|
let n = u.split("\n");
|
|
@@ -1007,25 +967,23 @@ function E(e) {
|
|
|
1007
967
|
return d;
|
|
1008
968
|
} catch (e) {
|
|
1009
969
|
let t = e instanceof Error ? e : Error("Failed to generate template from design", { cause: e });
|
|
1010
|
-
return
|
|
970
|
+
return c.value = t.message, a?.(t), null;
|
|
1011
971
|
} finally {
|
|
1012
|
-
|
|
972
|
+
s.value = !1;
|
|
1013
973
|
}
|
|
1014
974
|
}
|
|
1015
975
|
function u() {
|
|
1016
|
-
|
|
976
|
+
s.value = !1, c.value = null;
|
|
1017
977
|
}
|
|
1018
978
|
return {
|
|
1019
|
-
isGenerating:
|
|
1020
|
-
error:
|
|
979
|
+
isGenerating: s,
|
|
980
|
+
error: c,
|
|
1021
981
|
generate: l,
|
|
1022
982
|
reset: u
|
|
1023
983
|
};
|
|
1024
984
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
var D = "comment-broadcast";
|
|
1028
|
-
function O(e) {
|
|
985
|
+
var w = "comment-broadcast";
|
|
986
|
+
function T(e) {
|
|
1029
987
|
let t = {
|
|
1030
988
|
id: e.id,
|
|
1031
989
|
body: e.body,
|
|
@@ -1035,10 +993,10 @@ function O(e) {
|
|
|
1035
993
|
parentId: e.parentId,
|
|
1036
994
|
resolvedAt: e.resolvedAt
|
|
1037
995
|
};
|
|
1038
|
-
return e.updatedAt !== e.createdAt && (t.updatedAt = e.updatedAt), e.resolvedBy && (t.resolvedBy = e.resolvedBy), e.replies?.length && (t.replies = e.replies.map(
|
|
996
|
+
return e.updatedAt !== e.createdAt && (t.updatedAt = e.updatedAt), e.resolvedBy && (t.resolvedBy = e.resolvedBy), e.replies?.length && (t.replies = e.replies.map(T)), t;
|
|
1039
997
|
}
|
|
1040
|
-
function
|
|
1041
|
-
let { authManager: n, channel: r, getSocketId: i } =
|
|
998
|
+
function E(t) {
|
|
999
|
+
let { authManager: n, channel: r, getSocketId: i } = t, a = new m(n);
|
|
1042
1000
|
function o() {
|
|
1043
1001
|
let e = n.userConfig;
|
|
1044
1002
|
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.");
|
|
@@ -1054,10 +1012,10 @@ function k(e) {
|
|
|
1054
1012
|
}
|
|
1055
1013
|
return {
|
|
1056
1014
|
async list(e) {
|
|
1057
|
-
return (await a.getComments(e)).map(
|
|
1015
|
+
return (await a.getComments(e)).map(T);
|
|
1058
1016
|
},
|
|
1059
1017
|
async create(e, t) {
|
|
1060
|
-
return
|
|
1018
|
+
return T(await a.createComment(e, {
|
|
1061
1019
|
body: t.body,
|
|
1062
1020
|
blockId: t.blockId,
|
|
1063
1021
|
parentId: t.parentId,
|
|
@@ -1066,7 +1024,7 @@ function k(e) {
|
|
|
1066
1024
|
},
|
|
1067
1025
|
async update(e, t, n) {
|
|
1068
1026
|
if (n.body === void 0) throw Error("[Templatical] Cloud comments: update() needs a `body` in the patch.");
|
|
1069
|
-
return
|
|
1027
|
+
return T(await a.updateComment(e, t, {
|
|
1070
1028
|
body: n.body,
|
|
1071
1029
|
...o()
|
|
1072
1030
|
}, s()));
|
|
@@ -1075,11 +1033,11 @@ function k(e) {
|
|
|
1075
1033
|
await a.deleteComment(e, t, o(), s());
|
|
1076
1034
|
},
|
|
1077
1035
|
async setResolved(e, t, n) {
|
|
1078
|
-
return
|
|
1036
|
+
return T(await a.resolveComment(e, t, o(), s()));
|
|
1079
1037
|
},
|
|
1080
|
-
subscribe(
|
|
1038
|
+
subscribe(t, n) {
|
|
1081
1039
|
function i(e) {
|
|
1082
|
-
let t =
|
|
1040
|
+
let t = T(e.comment);
|
|
1083
1041
|
switch (e.action) {
|
|
1084
1042
|
case "commentCreated":
|
|
1085
1043
|
n({
|
|
@@ -1102,209 +1060,22 @@ function k(e) {
|
|
|
1102
1060
|
});
|
|
1103
1061
|
}
|
|
1104
1062
|
}
|
|
1105
|
-
let a =
|
|
1106
|
-
t?.unbind(
|
|
1063
|
+
let a = e(r, (e, t) => {
|
|
1064
|
+
t?.unbind(w, i), e?.bind(w, i);
|
|
1107
1065
|
}, { immediate: !0 });
|
|
1108
1066
|
return () => {
|
|
1109
|
-
a(), r.value?.unbind(
|
|
1067
|
+
a(), r.value?.unbind(w, i);
|
|
1110
1068
|
};
|
|
1111
1069
|
}
|
|
1112
1070
|
};
|
|
1113
1071
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
"pusher:member_added",
|
|
1118
|
-
"pusher:member_removed",
|
|
1119
|
-
"client-blockLocked",
|
|
1120
|
-
"client-blockUnlocked",
|
|
1121
|
-
"client-operation",
|
|
1122
|
-
"mcp-operation"
|
|
1123
|
-
];
|
|
1124
|
-
function j(e) {
|
|
1125
|
-
for (let t of A) e.unbind(t);
|
|
1126
|
-
}
|
|
1127
|
-
var M = [
|
|
1128
|
-
"#3b82f6",
|
|
1129
|
-
"#ef4444",
|
|
1130
|
-
"#10b981",
|
|
1131
|
-
"#f59e0b",
|
|
1132
|
-
"#8b5cf6",
|
|
1133
|
-
"#ec4899",
|
|
1134
|
-
"#06b6d4",
|
|
1135
|
-
"#f97316",
|
|
1136
|
-
"#6366f1",
|
|
1137
|
-
"#14b8a6"
|
|
1138
|
-
];
|
|
1139
|
-
function N(e) {
|
|
1140
|
-
let { authManager: a, editor: o, channel: s } = e, c = n([]), l = n(/* @__PURE__ */ new Map()), u = 0, d = !1, f = i(() => a.userConfig?.id ?? "");
|
|
1141
|
-
function p() {
|
|
1142
|
-
let e = M[u % M.length];
|
|
1143
|
-
return u++, e;
|
|
1144
|
-
}
|
|
1145
|
-
function m(e) {
|
|
1146
|
-
if (e.id === f.value || c.value.some((t) => t.id === e.id)) return;
|
|
1147
|
-
let t = {
|
|
1148
|
-
id: e.id,
|
|
1149
|
-
name: e.name,
|
|
1150
|
-
color: p(),
|
|
1151
|
-
selectedBlockId: null
|
|
1152
|
-
};
|
|
1153
|
-
return c.value = [...c.value, t], t;
|
|
1154
|
-
}
|
|
1155
|
-
function h(e) {
|
|
1156
|
-
let t = new Map(l.value);
|
|
1157
|
-
for (let [n, r] of t) r.id === e && t.delete(n);
|
|
1158
|
-
l.value = t, c.value = c.value.filter((t) => t.id !== e);
|
|
1159
|
-
}
|
|
1160
|
-
function g(e) {
|
|
1161
|
-
let t = c.value.find((t) => t.id === e.userId);
|
|
1162
|
-
if (!t) return;
|
|
1163
|
-
c.value = c.value.map((t) => t.id === e.userId ? {
|
|
1164
|
-
...t,
|
|
1165
|
-
selectedBlockId: e.blockId
|
|
1166
|
-
} : t);
|
|
1167
|
-
let n = new Map(l.value);
|
|
1168
|
-
for (let [t, r] of n) r.id === e.userId && n.delete(t);
|
|
1169
|
-
n.set(e.blockId, {
|
|
1170
|
-
...t,
|
|
1171
|
-
selectedBlockId: e.blockId
|
|
1172
|
-
}), l.value = n, o.state.selectedBlockId === e.blockId && o.selectBlock(null);
|
|
1173
|
-
}
|
|
1174
|
-
function _(e) {
|
|
1175
|
-
let t = new Map(l.value), n = t.get(e.blockId);
|
|
1176
|
-
t.delete(e.blockId), l.value = t, n && (c.value = c.value.map((e) => e.id === n.id ? {
|
|
1177
|
-
...e,
|
|
1178
|
-
selectedBlockId: null
|
|
1179
|
-
} : e));
|
|
1180
|
-
}
|
|
1181
|
-
function v(e) {
|
|
1182
|
-
d = !0;
|
|
1183
|
-
try {
|
|
1184
|
-
b(o, e);
|
|
1185
|
-
} finally {
|
|
1186
|
-
d = !1;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
function y(e) {
|
|
1190
|
-
s.value && !d && s.value.trigger("client-operation", e);
|
|
1191
|
-
}
|
|
1192
|
-
function x(e) {
|
|
1193
|
-
s.value && s.value.trigger("client-blockLocked", {
|
|
1194
|
-
blockId: e,
|
|
1195
|
-
userId: f.value
|
|
1196
|
-
});
|
|
1197
|
-
}
|
|
1198
|
-
function S(e) {
|
|
1199
|
-
s.value && s.value.trigger("client-blockUnlocked", { blockId: e });
|
|
1200
|
-
}
|
|
1201
|
-
return t(() => o.state.selectedBlockId, (e, t) => {
|
|
1202
|
-
d || (t && S(t), e && x(e));
|
|
1203
|
-
}), t(s, (t, n) => {
|
|
1204
|
-
if (n && j(n), !t) {
|
|
1205
|
-
c.value = [], l.value = /* @__PURE__ */ new Map(), u = 0;
|
|
1206
|
-
return;
|
|
1207
|
-
}
|
|
1208
|
-
let r = t.members;
|
|
1209
|
-
r && r.each((e) => {
|
|
1210
|
-
m(e.info);
|
|
1211
|
-
}), t.bind("pusher:member_added", (t) => {
|
|
1212
|
-
let n = m(t.info);
|
|
1213
|
-
n && e.onCollaboratorJoined?.(n);
|
|
1214
|
-
}), t.bind("pusher:member_removed", (t) => {
|
|
1215
|
-
let n = c.value.find((e) => e.id === t.id);
|
|
1216
|
-
h(t.id), n && e.onCollaboratorLeft?.(n);
|
|
1217
|
-
}), t.bind("client-blockLocked", (t) => {
|
|
1218
|
-
g(t);
|
|
1219
|
-
let n = c.value.find((e) => e.id === t.userId);
|
|
1220
|
-
n && e.onBlockLocked?.({
|
|
1221
|
-
blockId: t.blockId,
|
|
1222
|
-
collaborator: n
|
|
1223
|
-
});
|
|
1224
|
-
}), t.bind("client-blockUnlocked", (t) => {
|
|
1225
|
-
let n = l.value.get(t.blockId);
|
|
1226
|
-
_(t), n && e.onBlockUnlocked?.({
|
|
1227
|
-
blockId: t.blockId,
|
|
1228
|
-
collaborator: n
|
|
1229
|
-
});
|
|
1230
|
-
}), t.bind("client-operation", (e) => {
|
|
1231
|
-
v(e);
|
|
1232
|
-
}), t.bind("mcp-operation", (e) => {
|
|
1233
|
-
v(e);
|
|
1234
|
-
});
|
|
1235
|
-
}), r(() => {
|
|
1236
|
-
s.value && j(s.value);
|
|
1237
|
-
}), {
|
|
1238
|
-
collaborators: c,
|
|
1239
|
-
lockedBlocks: l,
|
|
1240
|
-
_broadcastOperation: y,
|
|
1241
|
-
_isProcessingRemoteOperation: () => d
|
|
1242
|
-
};
|
|
1243
|
-
}
|
|
1244
|
-
//#endregion
|
|
1245
|
-
//#region ../core/src/cloud/collaboration-broadcast.ts
|
|
1246
|
-
function P(e, t) {
|
|
1247
|
-
let n = e.addBlock, r = e.updateBlock, i = e.removeBlock, a = e.moveBlock, o = e.updateSettings, s = e.setContent;
|
|
1248
|
-
e.addBlock = (e, r, i, a) => {
|
|
1249
|
-
n(e, r, i, a), t._broadcastOperation({
|
|
1250
|
-
operation: "addBlock",
|
|
1251
|
-
data: {
|
|
1252
|
-
block: e,
|
|
1253
|
-
sectionId: r,
|
|
1254
|
-
columnIndex: i,
|
|
1255
|
-
index: a
|
|
1256
|
-
},
|
|
1257
|
-
timestamp: Date.now()
|
|
1258
|
-
});
|
|
1259
|
-
}, e.updateBlock = (e, n) => {
|
|
1260
|
-
r(e, n), t._broadcastOperation({
|
|
1261
|
-
operation: "updateBlock",
|
|
1262
|
-
data: {
|
|
1263
|
-
blockId: e,
|
|
1264
|
-
updates: n
|
|
1265
|
-
},
|
|
1266
|
-
timestamp: Date.now()
|
|
1267
|
-
});
|
|
1268
|
-
}, e.removeBlock = (e) => {
|
|
1269
|
-
i(e), t._broadcastOperation({
|
|
1270
|
-
operation: "deleteBlock",
|
|
1271
|
-
data: { blockId: e },
|
|
1272
|
-
timestamp: Date.now()
|
|
1273
|
-
});
|
|
1274
|
-
}, e.moveBlock = (e, n, r, i) => {
|
|
1275
|
-
a(e, n, r, i), t._broadcastOperation({
|
|
1276
|
-
operation: "moveBlock",
|
|
1277
|
-
data: {
|
|
1278
|
-
blockId: e,
|
|
1279
|
-
index: n,
|
|
1280
|
-
sectionId: r,
|
|
1281
|
-
columnIndex: i
|
|
1282
|
-
},
|
|
1283
|
-
timestamp: Date.now()
|
|
1284
|
-
});
|
|
1285
|
-
}, e.updateSettings = (e) => {
|
|
1286
|
-
o(e), t._broadcastOperation({
|
|
1287
|
-
operation: "updateSettings",
|
|
1288
|
-
data: { updates: e },
|
|
1289
|
-
timestamp: Date.now()
|
|
1290
|
-
});
|
|
1291
|
-
}, e.setContent = (e, n) => {
|
|
1292
|
-
s(e, n), t._broadcastOperation({
|
|
1293
|
-
operation: "setContent",
|
|
1294
|
-
data: { content: e },
|
|
1295
|
-
timestamp: Date.now()
|
|
1296
|
-
});
|
|
1297
|
-
};
|
|
1298
|
-
}
|
|
1299
|
-
//#endregion
|
|
1300
|
-
//#region ../core/src/cloud/web-socket.ts
|
|
1301
|
-
function F(e) {
|
|
1302
|
-
let { authManager: t, onError: r } = e, i = n(null), a = n(!1), o = null, s = null;
|
|
1303
|
-
async function c(e, n) {
|
|
1072
|
+
function D(e) {
|
|
1073
|
+
let { authManager: n, onError: r } = e, i = t(null), a = t(!1), o = null, s = null;
|
|
1074
|
+
async function c(e, t) {
|
|
1304
1075
|
if (o) return;
|
|
1305
|
-
o = new
|
|
1306
|
-
authManager:
|
|
1307
|
-
config:
|
|
1076
|
+
o = new _({
|
|
1077
|
+
authManager: n,
|
|
1078
|
+
config: t,
|
|
1308
1079
|
onError: r
|
|
1309
1080
|
}), await o.connect(), s = `presence-template.${e}`;
|
|
1310
1081
|
let c = o.subscribePresence(s);
|
|
@@ -1328,10 +1099,8 @@ function F(e) {
|
|
|
1328
1099
|
getSocketId: u
|
|
1329
1100
|
};
|
|
1330
1101
|
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
function I(e) {
|
|
1334
|
-
let t = new g(e);
|
|
1102
|
+
function O(e) {
|
|
1103
|
+
let t = new m(e);
|
|
1335
1104
|
return {
|
|
1336
1105
|
list(e) {
|
|
1337
1106
|
return t.listModules(e?.search, e?.category);
|
|
@@ -1347,9 +1116,7 @@ function I(e) {
|
|
|
1347
1116
|
}
|
|
1348
1117
|
};
|
|
1349
1118
|
}
|
|
1350
|
-
|
|
1351
|
-
//#region ../core/src/cloud/media-provider.ts
|
|
1352
|
-
function L(e) {
|
|
1119
|
+
function k(e) {
|
|
1353
1120
|
let t = {
|
|
1354
1121
|
id: e.id,
|
|
1355
1122
|
url: e.url,
|
|
@@ -1363,27 +1130,27 @@ function L(e) {
|
|
|
1363
1130
|
};
|
|
1364
1131
|
return e.width != null && (t.width = e.width), e.height != null && (t.height = e.height), e.thumbnailUrl != null && (t.thumbnailUrl = e.thumbnailUrl), t;
|
|
1365
1132
|
}
|
|
1366
|
-
function
|
|
1133
|
+
function A(e, t = null) {
|
|
1367
1134
|
return {
|
|
1368
1135
|
id: e.id,
|
|
1369
1136
|
name: e.name,
|
|
1370
1137
|
parentId: e.parentId === void 0 ? t : e.parentId
|
|
1371
1138
|
};
|
|
1372
1139
|
}
|
|
1373
|
-
function
|
|
1140
|
+
function j(e, t = null) {
|
|
1374
1141
|
let n = [];
|
|
1375
|
-
for (let r of e) n.push(
|
|
1142
|
+
for (let r of e) n.push(A(r, t)), r.children?.length && n.push(...j(r.children, r.id));
|
|
1376
1143
|
return n;
|
|
1377
1144
|
}
|
|
1378
|
-
function
|
|
1145
|
+
function M(e) {
|
|
1379
1146
|
let t = e?.media?.categories;
|
|
1380
1147
|
if (!t) return;
|
|
1381
1148
|
let n = {};
|
|
1382
1149
|
for (let [e, r] of Object.entries(t)) n[e] = r.mimeTypes;
|
|
1383
1150
|
return n;
|
|
1384
1151
|
}
|
|
1385
|
-
function
|
|
1386
|
-
let n = new
|
|
1152
|
+
function N(e, t) {
|
|
1153
|
+
let n = new h(e);
|
|
1387
1154
|
return {
|
|
1388
1155
|
async list(e) {
|
|
1389
1156
|
let t = await n.browseMedia({
|
|
@@ -1391,40 +1158,40 @@ function V(e, t) {
|
|
|
1391
1158
|
cursor: e?.cursor,
|
|
1392
1159
|
folderId: e?.folderId,
|
|
1393
1160
|
category: e?.category
|
|
1394
|
-
}), r = { items: t.data.map(
|
|
1161
|
+
}), r = { items: t.data.map(k) };
|
|
1395
1162
|
return t.meta.nextCursor && (r.nextCursor = t.meta.nextCursor), r;
|
|
1396
1163
|
},
|
|
1397
1164
|
async create(e) {
|
|
1398
|
-
return
|
|
1165
|
+
return k(await n.uploadMedia(e.file, e.folderId));
|
|
1399
1166
|
},
|
|
1400
1167
|
async update(e, t) {
|
|
1401
|
-
return
|
|
1168
|
+
return k(await n.updateMedia(e, t.filename, t.alt));
|
|
1402
1169
|
},
|
|
1403
1170
|
delete(e) {
|
|
1404
1171
|
return n.deleteMedia(e);
|
|
1405
1172
|
},
|
|
1406
1173
|
folders: {
|
|
1407
1174
|
async list() {
|
|
1408
|
-
return
|
|
1175
|
+
return j(await n.getMediaFolders());
|
|
1409
1176
|
},
|
|
1410
1177
|
async create(e) {
|
|
1411
|
-
return
|
|
1178
|
+
return A(await n.createMediaFolder(e.name, e.parentId));
|
|
1412
1179
|
},
|
|
1413
1180
|
async update(e, t) {
|
|
1414
|
-
return
|
|
1181
|
+
return A(await n.renameMediaFolder(e, t.name));
|
|
1415
1182
|
},
|
|
1416
1183
|
delete(e) {
|
|
1417
1184
|
return n.deleteMediaFolder(e);
|
|
1418
1185
|
},
|
|
1419
1186
|
async move(e, t) {
|
|
1420
|
-
return (await n.moveMedia(e, t)).map(
|
|
1187
|
+
return (await n.moveMedia(e, t)).map(k);
|
|
1421
1188
|
}
|
|
1422
1189
|
},
|
|
1423
1190
|
async replace(e, t) {
|
|
1424
|
-
return
|
|
1191
|
+
return k(await n.replaceMedia(e, t));
|
|
1425
1192
|
},
|
|
1426
1193
|
async importFromUrl(e, t) {
|
|
1427
|
-
return
|
|
1194
|
+
return k(await n.importFromUrl(e, t));
|
|
1428
1195
|
},
|
|
1429
1196
|
async checkUsage(e) {
|
|
1430
1197
|
let t = await n.checkMediaUsage(e), r = {};
|
|
@@ -1435,7 +1202,7 @@ function V(e, t) {
|
|
|
1435
1202
|
return r;
|
|
1436
1203
|
},
|
|
1437
1204
|
async frequentlyUsed() {
|
|
1438
|
-
return (await n.getFrequentlyUsed()).map(
|
|
1205
|
+
return (await n.getFrequentlyUsed()).map(k);
|
|
1439
1206
|
},
|
|
1440
1207
|
async storage() {
|
|
1441
1208
|
return t?.()?.storage ?? null;
|
|
@@ -1444,18 +1211,16 @@ function V(e, t) {
|
|
|
1444
1211
|
return t?.()?.media?.maxFileSize;
|
|
1445
1212
|
},
|
|
1446
1213
|
get mimeTypes() {
|
|
1447
|
-
return
|
|
1214
|
+
return M(t?.() ?? null);
|
|
1448
1215
|
}
|
|
1449
1216
|
};
|
|
1450
1217
|
}
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
function U(e) {
|
|
1455
|
-
let t = new g(e), n = 0;
|
|
1218
|
+
var P = 6e4;
|
|
1219
|
+
function F(e) {
|
|
1220
|
+
let t = new m(e), n = 0;
|
|
1456
1221
|
function r(e, r) {
|
|
1457
1222
|
let i = Date.now();
|
|
1458
|
-
i - n <
|
|
1223
|
+
i - n < P || (n = i, t.createVersion(e, r).catch((e) => {
|
|
1459
1224
|
console.warn("[Templatical] Automatic version not recorded — the save itself succeeded:", e);
|
|
1460
1225
|
}));
|
|
1461
1226
|
}
|
|
@@ -1472,16 +1237,14 @@ function U(e) {
|
|
|
1472
1237
|
}
|
|
1473
1238
|
};
|
|
1474
1239
|
}
|
|
1475
|
-
|
|
1476
|
-
//#region ../core/src/cloud/export.ts
|
|
1477
|
-
function W(e) {
|
|
1240
|
+
function I(e) {
|
|
1478
1241
|
return {
|
|
1479
1242
|
customFonts: e?.customFonts ?? [],
|
|
1480
1243
|
defaultFallback: e?.defaultFallback ?? "Arial, sans-serif"
|
|
1481
1244
|
};
|
|
1482
1245
|
}
|
|
1483
|
-
function
|
|
1484
|
-
let t = new
|
|
1246
|
+
function L(e) {
|
|
1247
|
+
let t = new m(e.authManager);
|
|
1485
1248
|
async function n(e, n) {
|
|
1486
1249
|
let r = await t.exportTemplate(e, n);
|
|
1487
1250
|
return {
|
|
@@ -1497,10 +1260,8 @@ function G(e) {
|
|
|
1497
1260
|
getMjmlSource: r
|
|
1498
1261
|
};
|
|
1499
1262
|
}
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
function K(e) {
|
|
1503
|
-
let t = G({ authManager: e.authManager });
|
|
1263
|
+
function R(e) {
|
|
1264
|
+
let t = L({ authManager: e.authManager });
|
|
1504
1265
|
function n(e) {
|
|
1505
1266
|
return {
|
|
1506
1267
|
customFonts: e.fonts?.customFonts ?? [],
|
|
@@ -1522,9 +1283,7 @@ function K(e) {
|
|
|
1522
1283
|
}
|
|
1523
1284
|
};
|
|
1524
1285
|
}
|
|
1525
|
-
|
|
1526
|
-
//#region ../core/src/cloud/version-history-provider.ts
|
|
1527
|
-
function q(e) {
|
|
1286
|
+
function z(e) {
|
|
1528
1287
|
return {
|
|
1529
1288
|
id: e.id,
|
|
1530
1289
|
createdAt: e.createdAt,
|
|
@@ -1532,31 +1291,29 @@ function q(e) {
|
|
|
1532
1291
|
content: e.content
|
|
1533
1292
|
};
|
|
1534
1293
|
}
|
|
1535
|
-
function
|
|
1536
|
-
let t = new
|
|
1294
|
+
function B(e) {
|
|
1295
|
+
let t = new m(e);
|
|
1537
1296
|
return {
|
|
1538
1297
|
async list(e) {
|
|
1539
|
-
return { versions: (await t.getVersions(e)).map(
|
|
1298
|
+
return { versions: (await t.getVersions(e)).map(z) };
|
|
1540
1299
|
},
|
|
1541
1300
|
async get(e, n) {
|
|
1542
1301
|
return (await t.getVersion(e, n)).content;
|
|
1543
1302
|
},
|
|
1544
1303
|
async create(e, n, r) {
|
|
1545
|
-
return
|
|
1304
|
+
return z(await t.createVersion(e, n, r?.label));
|
|
1546
1305
|
},
|
|
1547
1306
|
restore(e, n) {
|
|
1548
1307
|
return t.restoreVersion(e, n);
|
|
1549
1308
|
}
|
|
1550
1309
|
};
|
|
1551
1310
|
}
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
a && t(a, (e) => {
|
|
1557
|
-
e && (o.value = r.testEmailConfig);
|
|
1311
|
+
function V(r) {
|
|
1312
|
+
let { authManager: i, isAuthReady: a } = r, o = t(null);
|
|
1313
|
+
a && e(a, (e) => {
|
|
1314
|
+
e && (o.value = i.testEmailConfig);
|
|
1558
1315
|
}, { immediate: !0 });
|
|
1559
|
-
let s =
|
|
1316
|
+
let s = n(() => o.value !== null), c = n(() => o.value?.allowedEmails ?? []);
|
|
1560
1317
|
function l() {
|
|
1561
1318
|
return o.value?.signature ?? null;
|
|
1562
1319
|
}
|
|
@@ -1566,10 +1323,8 @@ function Y(e) {
|
|
|
1566
1323
|
getSignature: l
|
|
1567
1324
|
};
|
|
1568
1325
|
}
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
function X(e) {
|
|
1572
|
-
let t = new g(e.authManager);
|
|
1326
|
+
function H(e) {
|
|
1327
|
+
let t = new m(e.authManager);
|
|
1573
1328
|
return {
|
|
1574
1329
|
get allowedRecipients() {
|
|
1575
1330
|
return e.allowedEmails.value;
|
|
@@ -1590,10 +1345,8 @@ function X(e) {
|
|
|
1590
1345
|
}
|
|
1591
1346
|
};
|
|
1592
1347
|
}
|
|
1593
|
-
|
|
1594
|
-
|
|
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);
|
|
1348
|
+
function U(e) {
|
|
1349
|
+
let { authManager: r, onError: i } = e, a = t(null), o = t(!1), s = new m(r), c = n(() => a.value?.features ?? null);
|
|
1597
1350
|
function l(e) {
|
|
1598
1351
|
return a.value?.features[e] ?? !1;
|
|
1599
1352
|
}
|
|
@@ -1603,7 +1356,7 @@ function Z(e) {
|
|
|
1603
1356
|
try {
|
|
1604
1357
|
a.value = await s.fetchConfig();
|
|
1605
1358
|
} catch (e) {
|
|
1606
|
-
|
|
1359
|
+
i?.(e instanceof Error ? e : Error("Failed to fetch config", { cause: e }));
|
|
1607
1360
|
} finally {
|
|
1608
1361
|
o.value = !1;
|
|
1609
1362
|
}
|
|
@@ -1617,16 +1370,14 @@ function Z(e) {
|
|
|
1617
1370
|
fetchConfig: u
|
|
1618
1371
|
};
|
|
1619
1372
|
}
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
function $(e) {
|
|
1624
|
-
return e.authManager ? e.authManager.resolveUrl(h.health) : `${(e.baseUrl ?? "https://templatical.com").replace(/\/$/, "")}${h.health}`;
|
|
1373
|
+
var W = 5e3;
|
|
1374
|
+
function G(e) {
|
|
1375
|
+
return e.authManager ? e.authManager.resolveUrl(p.health) : `${(e.baseUrl ?? "https://templatical.com").replace(/\/$/, "")}${p.health}`;
|
|
1625
1376
|
}
|
|
1626
|
-
async function
|
|
1377
|
+
async function K(e, t) {
|
|
1627
1378
|
let n = performance.now();
|
|
1628
1379
|
try {
|
|
1629
|
-
let r = t ? await t.authenticatedFetch(
|
|
1380
|
+
let r = t ? await t.authenticatedFetch(p.health, {
|
|
1630
1381
|
method: "GET",
|
|
1631
1382
|
headers: { Accept: "application/json" }
|
|
1632
1383
|
}) : await fetch(e, {
|
|
@@ -1675,7 +1426,7 @@ async function ee(e, t) {
|
|
|
1675
1426
|
};
|
|
1676
1427
|
}
|
|
1677
1428
|
}
|
|
1678
|
-
async function
|
|
1429
|
+
async function q(e) {
|
|
1679
1430
|
if (!e?.host || !e?.appKey) return {
|
|
1680
1431
|
ok: !1,
|
|
1681
1432
|
error: "WebSocket configuration not available"
|
|
@@ -1691,7 +1442,7 @@ async function te(e) {
|
|
|
1691
1442
|
ok: !1,
|
|
1692
1443
|
error: "WebSocket connection timed out"
|
|
1693
1444
|
});
|
|
1694
|
-
},
|
|
1445
|
+
}, W);
|
|
1695
1446
|
try {
|
|
1696
1447
|
n = new WebSocket(t);
|
|
1697
1448
|
} catch (t) {
|
|
@@ -1711,8 +1462,8 @@ async function te(e) {
|
|
|
1711
1462
|
};
|
|
1712
1463
|
});
|
|
1713
1464
|
}
|
|
1714
|
-
async function
|
|
1715
|
-
let t = await
|
|
1465
|
+
async function J(e = {}) {
|
|
1466
|
+
let t = await K(G(e), e.authManager), n = await q(t.wsConfig);
|
|
1716
1467
|
return {
|
|
1717
1468
|
api: t.api,
|
|
1718
1469
|
websocket: n,
|
|
@@ -1721,16 +1472,4 @@ async function ne(e = {}) {
|
|
|
1721
1472
|
};
|
|
1722
1473
|
}
|
|
1723
1474
|
//#endregion
|
|
1724
|
-
|
|
1725
|
-
function re(e) {
|
|
1726
|
-
let { editor: n, channel: r, onOperation: i } = e;
|
|
1727
|
-
t(r, (e, t) => {
|
|
1728
|
-
t && t.unbind("mcp-operation"), e && e.bind("mcp-operation", (e) => {
|
|
1729
|
-
b(n, e), i?.(e);
|
|
1730
|
-
});
|
|
1731
|
-
});
|
|
1732
|
-
}
|
|
1733
|
-
//#endregion
|
|
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 };
|
|
1735
|
-
|
|
1736
|
-
//# sourceMappingURL=cloud-Cd7ptfhL.js.map
|
|
1475
|
+
export { U as _, O as a, D as b, B as c, I as d, g as f, L as g, C as h, R as i, i as l, x as m, E as n, F as o, b as p, N as r, H as s, a as t, J as u, S as v, V as y };
|