@templatical/editor 0.46.0 → 0.47.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-DGcH4Lyo.js → AiChatSidebar-BPOv5Ra8.js} +14 -14
- package/dist/{AiFeatureMenu-B4q-0g1S.js → AiFeatureMenu-H_WT4YR8.js} +7 -7
- package/dist/{BlockIssueBadge-CZA1XvAh.js → BlockIssueBadge-AgO5abEB.js} +5 -5
- package/dist/BlockPreviewCanvas-CZDBSPoG.js +136 -0
- package/dist/{CloudHeaderExtras-ehMYJP68.js → CloudHeaderExtras-gXsTYoGG.js} +5 -5
- package/dist/{CloudPanels-BwOaAlKz.js → CloudPanels-H_GdbOfZ.js} +9 -9
- package/dist/{CollaboratorBar-qOZFRNPx.js → CollaboratorBar-BazGNMqN.js} +4 -4
- package/dist/{CommentsPanel-Bn6P5crU.js → CommentsPanel-CMgsG_yh.js} +2 -2
- package/dist/{CommentsSidebar-B8wT932T.js → CommentsSidebar-DCh8DTP8.js} +14 -14
- package/dist/CountdownBlock-zx39Dyby.js +92 -0
- package/dist/{CountdownToolbar-BeF21SeB.js → CountdownToolbar-DVuucA3v.js} +7 -7
- package/dist/{DesignReferenceSidebar-zH93uB15.js → DesignReferenceSidebar-DxNV4lQp.js} +12 -12
- package/dist/{IssuesPanel-Dltw9haP.js → IssuesPanel-CUpW54P4.js} +8 -8
- package/dist/{LoadingTrack-DROqNuuD.js → LoadingTrack-6XsqodoY.js} +1 -1
- package/dist/{LogicTagInsertButton-CHa-UD76.js → LogicTagInsertButton-DDYKnqmj.js} +13 -13
- package/dist/{MediaEditModal-EY1YYcpw.js → MediaEditModal-D_we0Scr.js} +4 -4
- package/dist/{MediaPanels-CRVFGFZW.js → MediaPanels-L95BwWV1.js} +2 -2
- package/dist/{MergeTagInput-B3ntd4dN.js → MergeTagInput-DAL998tx.js} +3 -3
- package/dist/{MergeTagModeToggle-C_06ZL0Q.js → MergeTagModeToggle-CjHO26rb.js} +7 -7
- package/dist/{ParagraphEditor-CxuW3TV0.js → ParagraphEditor-CcEN1N6n.js} +165 -150
- package/dist/{RestoreVersionDialog-B1n37M1Z.js → RestoreVersionDialog-B2OH5rgs.js} +6 -6
- package/dist/{RichTextEditorContent-CP_uULWB.js → RichTextEditorContent-BGeTg-QL.js} +12 -12
- package/dist/{SaveBlockDialog-BSKX_7_v.js → SaveBlockDialog-CCVyU-7y.js} +13 -13
- package/dist/{SavedBlocksBrowserModal-CHKrH1gO.js → SavedBlocksBrowserModal-_WmSeqIh.js} +14 -14
- package/dist/{SavedBlocksPanels-B-xDqBcz.js → SavedBlocksPanels-DVX_ruQ7.js} +2 -2
- package/dist/{SavedBlocksPickBar-D2J-g82g.js → SavedBlocksPickBar-DVJC28hP.js} +5 -5
- package/dist/{TemplateScoringPanel-3lHzuCl0.js → TemplateScoringPanel-U0QFiwdI.js} +16 -16
- package/dist/{TemplateSettings-D07K_Y4m.js → TemplateSettings-CdhTm9JQ.js} +12 -12
- package/dist/{TestEmailModal-BNPw_lID.js → TestEmailModal-BqToA_ls.js} +14 -14
- package/dist/{TestEmailPanel-8klWo8hE.js → TestEmailPanel-Cn4Ptq0j.js} +2 -2
- package/dist/{TitleEditor-CmC9OuhA.js → TitleEditor-CZdqeltH.js} +13 -13
- package/dist/{ToggleSwitch-COeyWGfT.js → ToggleSwitch-BR8Sgzib.js} +2 -2
- package/dist/{Toolbar-CqhRb6EM.js → Toolbar-OGakTBEg.js} +747 -628
- package/dist/{TplModal-BGFawHY9.js → TplModal-CoczSDma.js} +6 -6
- package/dist/{VersionHistoryMenu-D7zaTMrb.js → VersionHistoryMenu-DY5z5FZr.js} +10 -10
- package/dist/{VersionHistoryPanels-DdbGjEOR.js → VersionHistoryPanels-DowHeDAQ.js} +2 -2
- package/dist/{VersionPreviewBanner-BUKb9gc6.js → VersionPreviewBanner-Bo8NxBbh.js} +4 -4
- package/dist/WrapperBlock-BOABSX9W.js +46 -0
- package/dist/{blockTypeIcons-CVKo6V_v.js → blockTypeIcons-4E1U8f99.js} +5 -5
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-C__Dzq--.js → ca-DMoGGP9L.js} +21 -0
- package/dist/cdn/chunks/{AiChatSidebar-kCK4NZM9.js → AiChatSidebar-B72rI0be.js} +12 -12
- package/dist/cdn/chunks/{AiChatSidebar-kCK4NZM9.js.map → AiChatSidebar-B72rI0be.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-K1dLeDft.js → AiFeatureMenu-BqSG9iEd.js} +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-K1dLeDft.js.map → AiFeatureMenu-BqSG9iEd.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-05Q3L4RV.js → BlockIssueBadge-CS7ytN-z.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-05Q3L4RV.js.map → BlockIssueBadge-CS7ytN-z.js.map} +1 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-cOTMFRcg.js +138 -0
- package/dist/cdn/chunks/BlockPreviewCanvas-cOTMFRcg.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-5ONQ1RCa.js → CloudHeaderExtras-DJXLTUHc.js} +5 -5
- package/dist/cdn/chunks/{CloudHeaderExtras-5ONQ1RCa.js.map → CloudHeaderExtras-DJXLTUHc.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-_irSdWbi.js → CloudPanels-D1fPLjG8.js} +8 -8
- package/dist/cdn/chunks/{CloudPanels-_irSdWbi.js.map → CloudPanels-D1fPLjG8.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-CZufI1On.js → CollaboratorBar-MeRQB1eN.js} +5 -5
- package/dist/cdn/chunks/{CollaboratorBar-CZufI1On.js.map → CollaboratorBar-MeRQB1eN.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-VH_NJ5HZ.js → CommentsPanel-CmxPylNf.js} +3 -3
- package/dist/cdn/chunks/{CommentsPanel-VH_NJ5HZ.js.map → CommentsPanel-CmxPylNf.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-CYPH5rVi.js → CommentsSidebar-CrleQTbo.js} +13 -13
- package/dist/cdn/chunks/{CommentsSidebar-CYPH5rVi.js.map → CommentsSidebar-CrleQTbo.js.map} +1 -1
- package/dist/cdn/chunks/CountdownBlock-Dasj191h.js +94 -0
- package/dist/cdn/chunks/CountdownBlock-Dasj191h.js.map +1 -0
- package/dist/cdn/chunks/{CountdownToolbar-BaXCefQM.js → CountdownToolbar-DPIOtlN0.js} +8 -8
- package/dist/cdn/chunks/{CountdownToolbar-BaXCefQM.js.map → CountdownToolbar-DPIOtlN0.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-GjkpHylX.js → DesignReferenceSidebar-BgTNqgCy.js} +8 -8
- package/dist/cdn/chunks/{DesignReferenceSidebar-GjkpHylX.js.map → DesignReferenceSidebar-BgTNqgCy.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-C1Lv2y_O.js → IssuesPanel-BGjLcNpQ.js} +6 -6
- package/dist/cdn/chunks/{IssuesPanel-C1Lv2y_O.js.map → IssuesPanel-BGjLcNpQ.js.map} +1 -1
- package/dist/cdn/chunks/{LoadingTrack-Cg1HRIND.js → LoadingTrack-DbH97JR9.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-Cg1HRIND.js.map → LoadingTrack-DbH97JR9.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-BYjdrDnQ.js → LogicTagInsertButton-BEsqPhMr.js} +11 -11
- package/dist/cdn/chunks/{LogicTagInsertButton-BYjdrDnQ.js.map → LogicTagInsertButton-BEsqPhMr.js.map} +1 -1
- package/dist/cdn/chunks/{MediaEditModal-CD3fVbWI.js → MediaEditModal-C1Ao0i2c.js} +4 -4
- package/dist/cdn/chunks/{MediaEditModal-CD3fVbWI.js.map → MediaEditModal-C1Ao0i2c.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-B2AyUUcf.js → MediaPanels-1GPYiZZ0.js} +3 -3
- package/dist/cdn/chunks/{MediaPanels-B2AyUUcf.js.map → MediaPanels-1GPYiZZ0.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-Cx67J_vg.js → MergeTagInput-Dy13_OLc.js} +4 -4
- package/dist/cdn/chunks/{MergeTagInput-Cx67J_vg.js.map → MergeTagInput-Dy13_OLc.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-DZ4EuXVp.js → MergeTagModeToggle-B2CPZOeF.js} +6 -6
- package/dist/cdn/chunks/{MergeTagModeToggle-DZ4EuXVp.js.map → MergeTagModeToggle-B2CPZOeF.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DndEFXmR.js → ParagraphEditor-BGLIw7kg.js} +91 -76
- package/dist/cdn/chunks/ParagraphEditor-BGLIw7kg.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog-CFYs13a4.js → RestoreVersionDialog-BhykE8En.js} +8 -8
- package/dist/cdn/chunks/{RestoreVersionDialog-CFYs13a4.js.map → RestoreVersionDialog-BhykE8En.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DKkDQ0dc.js → RichTextEditorContent-B-txUvPL.js} +11 -11
- package/dist/cdn/chunks/{RichTextEditorContent-DKkDQ0dc.js.map → RichTextEditorContent-B-txUvPL.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-BOA2RaC_.js → SaveBlockDialog-BHqEp7jw.js} +40 -40
- package/dist/cdn/chunks/{SaveBlockDialog-BOA2RaC_.js.map → SaveBlockDialog-BHqEp7jw.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-DQDVek3K.js → SavedBlocksBrowserModal-BhR6AI0f.js} +10 -10
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-DQDVek3K.js.map → SavedBlocksBrowserModal-BhR6AI0f.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-Lu3tJ3QA.js → SavedBlocksPanels-YwffJtfY.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-Lu3tJ3QA.js.map → SavedBlocksPanels-YwffJtfY.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-D7MtqG6r.js → SavedBlocksPickBar-BtpFU7es.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksPickBar-D7MtqG6r.js.map → SavedBlocksPickBar-BtpFU7es.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-C_57Bfkf.js → TemplateScoringPanel-N4ySFh5w.js} +12 -12
- package/dist/cdn/chunks/{TemplateScoringPanel-C_57Bfkf.js.map → TemplateScoringPanel-N4ySFh5w.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-rZiHmq24.js → TemplateSettings-C7b5X34U.js} +13 -13
- package/dist/cdn/chunks/TemplateSettings-C7b5X34U.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailModal-DWEyHXH2.js → TestEmailModal-DHJKI5y5.js} +11 -11
- package/dist/cdn/chunks/{TestEmailModal-DWEyHXH2.js.map → TestEmailModal-DHJKI5y5.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-XXMD-Lnr.js → TestEmailPanel-lYtzTXpR.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-XXMD-Lnr.js.map → TestEmailPanel-lYtzTXpR.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-D1F0YoE-.js → TitleEditor-5eY01ypW.js} +15 -15
- package/dist/cdn/chunks/{TitleEditor-D1F0YoE-.js.map → TitleEditor-5eY01ypW.js.map} +1 -1
- package/dist/cdn/chunks/{ToggleSwitch-B5U9cqhi.js → ToggleSwitch-BN8rMC2m.js} +3 -3
- package/dist/cdn/chunks/{ToggleSwitch-B5U9cqhi.js.map → ToggleSwitch-BN8rMC2m.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-C_5HfUQq.js → Toolbar-Ik54UO_-.js} +696 -575
- package/dist/cdn/chunks/Toolbar-Ik54UO_-.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-CYBbPCHL.js → TplModal-WIBiBrGy.js} +6 -6
- package/dist/cdn/chunks/TplModal-WIBiBrGy.js.map +1 -0
- package/dist/cdn/chunks/{VersionHistoryMenu-DbxuJgDO.js → VersionHistoryMenu-CZnlS9K5.js} +6 -6
- package/dist/cdn/chunks/{VersionHistoryMenu-DbxuJgDO.js.map → VersionHistoryMenu-CZnlS9K5.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-Dq12VsTX.js → VersionHistoryPanels-xjLSpR1e.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryPanels-Dq12VsTX.js.map → VersionHistoryPanels-xjLSpR1e.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-HRERIH-v.js → VersionPreviewBanner-sARpn4hh.js} +5 -5
- package/dist/cdn/chunks/{VersionPreviewBanner-HRERIH-v.js.map → VersionPreviewBanner-sARpn4hh.js.map} +1 -1
- package/dist/cdn/chunks/WrapperBlock-fsLe7goL.js +48 -0
- package/dist/cdn/chunks/WrapperBlock-fsLe7goL.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-DdZP-3FM.js → blockTypeIcons-D3g5QzdT.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-DdZP-3FM.js.map → blockTypeIcons-D3g5QzdT.js.map} +1 -1
- package/dist/cdn/chunks/{ca-C__Dzq--.js → ca-DMoGGP9L.js} +22 -1
- package/dist/cdn/chunks/ca-DMoGGP9L.js.map +1 -0
- package/dist/cdn/chunks/{cloud-h1vaHp2p.js → cloud-Cd7ptfhL.js} +3 -3
- package/dist/cdn/chunks/{cloud-h1vaHp2p.js.map → cloud-Cd7ptfhL.js.map} +1 -1
- package/dist/cdn/chunks/{createCloudRuntime-bJN9EM1H.js → createCloudRuntime-DtIZ2Lee.js} +17 -8
- package/dist/cdn/chunks/createCloudRuntime-DtIZ2Lee.js.map +1 -0
- package/dist/cdn/chunks/{de-CGjbQ2mt.js → de-DgAelLbM.js} +22 -1
- package/dist/cdn/chunks/de-DgAelLbM.js.map +1 -0
- package/dist/cdn/chunks/{dist-B7W-Lb65.js → dist-CjL6JHML.js} +3 -3
- package/dist/cdn/chunks/{dist-B7W-Lb65.js.map → dist-CjL6JHML.js.map} +1 -1
- package/dist/cdn/chunks/{dist-C5nRd_ua.js → dist-MNQYSEWU.js} +4 -4
- package/dist/cdn/chunks/{dist-C5nRd_ua.js.map → dist-MNQYSEWU.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-BUTN5vZC.js → draggable-DrsNwZuB.js} +1673 -1595
- package/dist/cdn/chunks/draggable-DrsNwZuB.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-BpsbYA4_.js → editor-modal-Bcwo0orC.js} +34 -34
- package/dist/cdn/chunks/{editor-modal-BpsbYA4_.js.map → editor-modal-Bcwo0orC.js.map} +1 -1
- package/dist/cdn/chunks/en-BANFWZdr.js +1 -0
- package/dist/cdn/chunks/{en-BTiiAC-B.js → en-Dekrl7HA.js} +22 -1
- package/dist/cdn/chunks/en-Dekrl7HA.js.map +1 -0
- package/dist/cdn/chunks/{es-CdTOcSTf.js → es-BaZzyidV.js} +22 -1
- package/dist/cdn/chunks/es-BaZzyidV.js.map +1 -0
- package/dist/cdn/chunks/{extensions-CrmXF4MW.js → extensions-T-t8MKDb.js} +7 -7
- package/dist/cdn/chunks/{extensions-CrmXF4MW.js.map → extensions-T-t8MKDb.js.map} +1 -1
- package/dist/cdn/chunks/{fr-B6lcLLzC.js → fr-C5ucb1HK.js} +22 -1
- package/dist/cdn/chunks/fr-C5ucb1HK.js.map +1 -0
- package/dist/cdn/chunks/{icons-Dr9erFGs.js → icons-C4fX9Bwy.js} +27 -27
- package/dist/cdn/chunks/{icons-Dr9erFGs.js.map → icons-C4fX9Bwy.js.map} +1 -1
- package/dist/cdn/chunks/{ja-BhdkqENz.js → ja-CUgR3mV0.js} +22 -1
- package/dist/cdn/chunks/ja-CUgR3mV0.js.map +1 -0
- package/dist/cdn/chunks/{keys-BKu-LOk5.js → keys-HI-INbkz.js} +2 -2
- package/dist/cdn/chunks/{keys-BKu-LOk5.js.map → keys-HI-INbkz.js.map} +1 -1
- package/dist/{nl-CE3YItYg.js → cdn/chunks/nl-qrLY7hMS.js} +23 -0
- package/dist/cdn/chunks/nl-qrLY7hMS.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-CyGB3lZr.js → preRenderCustomBlocks-Co0oi0Jf.js} +4 -2
- package/dist/cdn/chunks/preRenderCustomBlocks-Co0oi0Jf.js.map +1 -0
- package/dist/cdn/chunks/{pt-BR-CUIT4rq4.js → pt-BR-C6hMTQYi.js} +22 -1
- package/dist/cdn/chunks/pt-BR-C6hMTQYi.js.map +1 -0
- package/dist/cdn/chunks/socialIcons-DACw1wA8.js +1103 -0
- package/dist/cdn/chunks/socialIcons-DACw1wA8.js.map +1 -0
- package/dist/{dist-BI_LeQGl.js → cdn/chunks/src-BnJlDuyB.js} +392 -249
- package/dist/cdn/chunks/src-BnJlDuyB.js.map +1 -0
- package/dist/cdn/chunks/{src-BMw3u-iV.js → src-Bu0qBpbf.js} +214 -212
- package/dist/cdn/chunks/src-Bu0qBpbf.js.map +1 -0
- package/dist/cdn/chunks/{src-B0pZeTYO.js → src-CHlVFp7r.js} +308 -268
- package/dist/cdn/chunks/src-CHlVFp7r.js.map +1 -0
- package/dist/{styleConstants-C_YAPdQS.js → cdn/chunks/styleConstants-D1Jz-TFU.js} +9 -28
- package/dist/cdn/chunks/{styleConstants-C_YAPdQS.js.map → styleConstants-D1Jz-TFU.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-CYDXLO17.js → tiptap-BPigZk5G.js} +3258 -3098
- package/dist/cdn/chunks/tiptap-BPigZk5G.js.map +1 -0
- package/dist/cdn/chunks/{useAliveFlag-DzyXG-8A.js → useAliveFlag-DCB96vzR.js} +2 -2
- package/dist/cdn/chunks/{useAliveFlag-DzyXG-8A.js.map → useAliveFlag-DCB96vzR.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-Cgk0ts_F.js → useCloudI18n-BBF4waXO.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-Cgk0ts_F.js.map → useCloudI18n-BBF4waXO.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorCore-DuC7kVti.js → useEditorCore-Bf2d1DKI.js} +543 -532
- package/dist/cdn/chunks/useEditorCore-Bf2d1DKI.js.map +1 -0
- package/dist/cdn/chunks/useEditorRoot-CTc6O8al.js +10 -0
- package/dist/cdn/chunks/{useEditorRoot-DDPIcEOO.js.map → useEditorRoot-CTc6O8al.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-DO4NTunW.js → useI18n-DUlyyIJJ.js} +3 -3
- package/dist/cdn/chunks/{useI18n-DO4NTunW.js.map → useI18n-DUlyyIJJ.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-B3uV3XHG.js → useLogicTag-3S63go4E.js} +4 -4
- package/dist/cdn/chunks/{useLogicTag-B3uV3XHG.js.map → useLogicTag-3S63go4E.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-DJLM-7WQ.js → useMergeTag-BQtxUHq1.js} +4 -4
- package/dist/cdn/chunks/{useMergeTag-DJLM-7WQ.js.map → useMergeTag-BQtxUHq1.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-CtVNwoHj.js → usePopoverPosition-IbaW6-Ao.js} +3 -3
- package/dist/cdn/chunks/{usePopoverPosition-CtVNwoHj.js.map → usePopoverPosition-IbaW6-Ao.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-CpmB5KxW.js → useScrollToBlock-uUa601I4.js} +3 -3
- package/dist/cdn/chunks/{useScrollToBlock-CpmB5KxW.js.map → useScrollToBlock-uUa601I4.js.map} +1 -1
- package/dist/cdn/chunks/withCurrentFont-DwJd-lKc.js +21 -0
- package/dist/cdn/chunks/{withCurrentFont-isIyuezD.js.map → withCurrentFont-DwJd-lKc.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +614 -610
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-ZKvtMdpe.js → check-B5R4zXr7.js} +1 -1
- package/dist/{chevron-down-RrwkYMlp.js → chevron-down-BKyl85NV.js} +1 -1
- package/dist/{chevron-right-CklHaa1U.js → chevron-right-BmToZ8qX.js} +1 -1
- package/dist/{chevron-up-DjN2NTbo.js → chevron-up-DNYdOxPC.js} +1 -1
- package/dist/{circle-alert-BR1_Yfb-.js → circle-alert-Dx9ju3YZ.js} +1 -1
- package/dist/{clock-BEagNj21.js → clock-Dv9bxsSH.js} +1 -1
- package/dist/{cloud-DPGjMGfv.js → cloud-DwjaAdwK.js} +2 -2
- package/dist/{copy-D6DNoSq1.js → copy-BsKl4dcy.js} +1 -1
- package/dist/{createCloudRuntime-D0RRgWab.js → createCloudRuntime-C8gpPsSi.js} +16 -7
- package/dist/{createLucideIcon-BAPyioGd.js → createLucideIcon-DziKp5iU.js} +6 -6
- package/dist/{de-CGjbQ2mt.js → de-DgAelLbM.js} +21 -0
- package/dist/{dist-Bd7khQsg.js → dist-3HpYixwF.js} +2 -2
- package/dist/{dist-lL3nVbxV.js → dist-BC-ZEYLd.js} +2 -2
- package/dist/dist-BPFcLKTw.js +5 -0
- package/dist/{cdn/chunks/src-Bh0MoJ67.js → dist-C8koXLhl.js} +295 -298
- package/dist/{dist-C-VFTX82.js → dist-CUWI-IvA.js} +2 -2
- package/dist/{dist-Bc30883t.js → dist-Cr7RPxI9.js} +5 -5
- package/dist/{dist-DapsJxn_.js → dist-CuLwJF7H.js} +2 -2
- package/dist/{dist-5KNKxglR.js → dist-CyBwSiAa.js} +2 -2
- package/dist/dist-D7Yj7E-F.js +5 -0
- package/dist/{dist-B_vYjCsk.js → dist-DAAJogrx.js} +3 -3
- package/dist/{dist-CMcFD7gP.js → dist-DBxgrOeo.js} +1906 -1746
- package/dist/{dist-DHensKDY.js → dist-DPcf6XZ8.js} +2 -2
- package/dist/{dist-5DAb7bYT.js → dist-DVNjPKsH.js} +2 -2
- package/dist/{dist-C3eH9-N2.js → dist-DXyGqIDE.js} +2 -2
- package/dist/{dist-1H4cnaoD.js → dist-DuufrR8O.js} +4 -4
- package/dist/{editor-modal-oRmkDlUs.js → editor-modal-BwyIUnV_.js} +27 -27
- package/dist/en-CC-57eC_.js +1 -0
- package/dist/{en-BTiiAC-B.js → en-Dekrl7HA.js} +21 -0
- package/dist/{es-CdTOcSTf.js → es-BaZzyidV.js} +21 -0
- package/dist/{extensions-CYigjb1g.js → extensions-DHyKjsNZ.js} +9 -9
- package/dist/{eye-DvsTBI57.js → eye-DQuinb9k.js} +1 -1
- package/dist/{fr-B6lcLLzC.js → fr-C5ucb1HK.js} +21 -0
- package/dist/{image-up-BoFGZm5Q.js → image-up-yTfLjOrj.js} +1 -1
- package/dist/index.d.ts +58 -8
- package/dist/{info-0bQQGjTV.js → info-C7OjlS11.js} +1 -1
- package/dist/{ja-BhdkqENz.js → ja-CUgR3mV0.js} +21 -0
- package/dist/{keys-injl74ob.js → keys-BKFq19a2.js} +1 -1
- package/dist/{link-Cstrr3Ep.js → link-CrUFaZ0t.js} +1 -1
- package/dist/{list-Dx9Rmy5s.js → list-CLgv6M-k.js} +1 -1
- package/dist/{loader-circle-D8Qqs0MG.js → loader-circle-BXM5VO0K.js} +1 -1
- package/dist/{message-circle-D78ELX6I.js → message-circle-BisdQ8H9.js} +1 -1
- package/dist/{cdn/chunks/nl-CE3YItYg.js → nl-qrLY7hMS.js} +21 -2
- package/dist/{package-DOvM9sHE.js → package-C1T4AxV1.js} +1 -1
- package/dist/{pencil-B6m0OG0n.js → pencil-oo2mwf4C.js} +1 -1
- package/dist/{plus-D-nEKxTc.js → plus-BIilXopD.js} +1 -1
- package/dist/{preRenderCustomBlocks-DokBGA_M.js → preRenderCustomBlocks-lFX0HHiV.js} +5 -3
- package/dist/{pt-BR-CUIT4rq4.js → pt-BR-C6hMTQYi.js} +21 -0
- package/dist/{refresh-cw-CXZS-R1U.js → refresh-cw-DrLlkEVC.js} +1 -1
- package/dist/{runtime-dom.esm-bundler-CO67ema2.js → runtime-dom.esm-bundler-lFF-QG3j.js} +3 -3
- package/dist/{search-DSvil0jo.js → search-DNu9lImk.js} +1 -1
- package/dist/{send-BBR28V94.js → send-DDNh3LoJ.js} +1 -1
- package/dist/{shield-check-ByxUnaU9.js → shield-check-aXM3o14f.js} +1 -1
- package/dist/{smartphone-CNOwGf5T.js → smartphone-isccgDee.js} +1 -1
- package/dist/socialIcons-BctavKBN.js +1180 -0
- package/dist/{sparkles-DO1hzwzf.js → sparkles-CIMfFxKv.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{cdn/chunks/styleConstants-C_YAPdQS.js → styleConstants-D1Jz-TFU.js} +7 -30
- package/dist/templatical-editor.js +559 -555
- package/dist/{text-align-start-BKEKMheq.js → text-align-start-C4JFeqsq.js} +1 -1
- package/dist/{trash-CKEQH4vH.js → trash-8ZD9pK_c.js} +1 -1
- package/dist/{triangle-alert-BHnfd3fV.js → triangle-alert-pq45xEHl.js} +1 -1
- package/dist/{upload-C8uO7KsR.js → upload-DrNFmVes.js} +1 -1
- package/dist/{useAliveFlag-6PtarpNZ.js → useAliveFlag-Dd06mRxe.js} +1 -1
- package/dist/{useCloudI18n-GvIOLziA.js → useCloudI18n-Nwqo7pI_.js} +2 -2
- package/dist/{useEditorCore-BJAQMvNW.js → useEditorCore-BcT7UI4e.js} +1011 -1006
- package/dist/{useEditorRoot-OWzNpDdT.js → useEditorRoot-BD3piYtD.js} +2 -2
- package/dist/{useI18n-uF11q85g.js → useI18n-CxVEpurs.js} +2 -2
- package/dist/{useLogicTag-B5gjcMzn.js → useLogicTag-D-dI8H6p.js} +3 -3
- package/dist/{useMergeTag-BwsBIDzR.js → useMergeTag-5wMeDBi-.js} +5 -5
- package/dist/{usePopoverPosition-DkBrHfCo.js → usePopoverPosition-CwnH1o5g.js} +2 -2
- package/dist/{useScrollToBlock-JRxhT1u_.js → useScrollToBlock-Do3suaqp.js} +3 -3
- package/dist/{vue.runtime.esm-bundler-CctRY8kr.js → vue.runtime.esm-bundler-CAzmrXdD.js} +1215 -1155
- package/dist/{withCurrentFont-C9vqrduu.js → withCurrentFont-B4YnsG_2.js} +1 -1
- package/dist/{x-gEC0yMci.js → x-CBFKGLB1.js} +1 -1
- package/package.json +23 -23
- package/dist/BlockPreviewCanvas-DIZ0KgUD.js +0 -133
- package/dist/CountdownBlock-RNx3hIu0.js +0 -91
- package/dist/WrapperBlock-CTkmA887.js +0 -34
- package/dist/cdn/chunks/BlockPreviewCanvas-Djz9YAFx.js +0 -135
- package/dist/cdn/chunks/BlockPreviewCanvas-Djz9YAFx.js.map +0 -1
- package/dist/cdn/chunks/CountdownBlock-lHU3Lu7Q.js +0 -93
- package/dist/cdn/chunks/CountdownBlock-lHU3Lu7Q.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-DndEFXmR.js.map +0 -1
- package/dist/cdn/chunks/TemplateSettings-rZiHmq24.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-C_5HfUQq.js.map +0 -1
- package/dist/cdn/chunks/TplModal-CYBbPCHL.js.map +0 -1
- package/dist/cdn/chunks/WrapperBlock-CJ0CLqi2.js +0 -36
- package/dist/cdn/chunks/WrapperBlock-CJ0CLqi2.js.map +0 -1
- package/dist/cdn/chunks/ca-C__Dzq--.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-bJN9EM1H.js.map +0 -1
- package/dist/cdn/chunks/de-CGjbQ2mt.js.map +0 -1
- package/dist/cdn/chunks/draggable-BUTN5vZC.js.map +0 -1
- package/dist/cdn/chunks/en-BTiiAC-B.js.map +0 -1
- package/dist/cdn/chunks/en-CAt6y87e.js +0 -1
- package/dist/cdn/chunks/es-CdTOcSTf.js.map +0 -1
- package/dist/cdn/chunks/fr-B6lcLLzC.js.map +0 -1
- package/dist/cdn/chunks/ja-BhdkqENz.js.map +0 -1
- package/dist/cdn/chunks/nl-CE3YItYg.js.map +0 -1
- package/dist/cdn/chunks/preRenderCustomBlocks-CyGB3lZr.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-CUIT4rq4.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-ClJVDZwt.js +0 -1031
- package/dist/cdn/chunks/socialIcons-ClJVDZwt.js.map +0 -1
- package/dist/cdn/chunks/src-B0pZeTYO.js.map +0 -1
- package/dist/cdn/chunks/src-BMw3u-iV.js.map +0 -1
- package/dist/cdn/chunks/src-Bh0MoJ67.js.map +0 -1
- package/dist/cdn/chunks/tiptap-CYDXLO17.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-DuC7kVti.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-DDPIcEOO.js +0 -10
- package/dist/cdn/chunks/withCurrentFont-isIyuezD.js +0 -21
- package/dist/dist-CFC4pg2o.js +0 -5
- package/dist/dist-j2FavQmU.js +0 -5
- package/dist/en-Bk4iCfjp.js +0 -1
- package/dist/socialIcons-Ct_IoqPQ.js +0 -1107
|
@@ -0,0 +1,1180 @@
|
|
|
1
|
+
import { A as e, At as t, H as n, J as r, R as i, S as a, X as o, Y as s, Z as c, at as l, d as u, g as d, h as f, jt as p, kt as m, ot as h, r as g, rt as _, s as v, v as y } from "./vue.runtime.esm-bundler-CAzmrXdD.js";
|
|
2
|
+
import { C as b, V as x, d as S, g as C, h as w, l as T, lt as E, m as D, y as O } from "./dist-C8koXLhl.js";
|
|
3
|
+
import { r as k } from "./dist-DAAJogrx.js";
|
|
4
|
+
import { L as A, c as j } from "./keys-BKFq19a2.js";
|
|
5
|
+
import { t as M } from "./useI18n-CxVEpurs.js";
|
|
6
|
+
import { o as N, s as P } from "./usePopoverPosition-CwnH1o5g.js";
|
|
7
|
+
import { t as F } from "./createLucideIcon-DziKp5iU.js";
|
|
8
|
+
import { t as I } from "./loader-circle-BXM5VO0K.js";
|
|
9
|
+
import { t as L } from "./upload-DrNFmVes.js";
|
|
10
|
+
import { t as R } from "./useAliveFlag-Dd06mRxe.js";
|
|
11
|
+
//#region ../core/dist/index.js
|
|
12
|
+
function z(e) {
|
|
13
|
+
return e instanceof Error ? e : Error(String(e), { cause: e });
|
|
14
|
+
}
|
|
15
|
+
function B(e, t) {
|
|
16
|
+
try {
|
|
17
|
+
t();
|
|
18
|
+
} catch (t) {
|
|
19
|
+
e?.(z(t));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function V(e) {
|
|
23
|
+
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
24
|
+
}
|
|
25
|
+
function ee(e) {
|
|
26
|
+
let t = e.content ?? b(e.defaultFontFamily, e.templateDefaults);
|
|
27
|
+
D(t), w(t);
|
|
28
|
+
let r = s({
|
|
29
|
+
template: null,
|
|
30
|
+
content: t,
|
|
31
|
+
selectedBlockId: null,
|
|
32
|
+
viewport: "desktop",
|
|
33
|
+
darkMode: !1,
|
|
34
|
+
previewMode: !1,
|
|
35
|
+
isDirty: !1,
|
|
36
|
+
isSaving: !1,
|
|
37
|
+
isLoading: !1,
|
|
38
|
+
uiTheme: "auto"
|
|
39
|
+
}), i = 0;
|
|
40
|
+
function a() {
|
|
41
|
+
r.isDirty = !0, i++;
|
|
42
|
+
}
|
|
43
|
+
let c = n({
|
|
44
|
+
get: () => r.content,
|
|
45
|
+
set: (e) => {
|
|
46
|
+
r.content = e, a();
|
|
47
|
+
}
|
|
48
|
+
}), l = n(() => r.selectedBlockId ? u(r.content.blocks, r.selectedBlockId) : null);
|
|
49
|
+
function u(e, t) {
|
|
50
|
+
for (let n of e) {
|
|
51
|
+
if (n.id === t) return n;
|
|
52
|
+
if (n.type === "section") for (let e of n.children) {
|
|
53
|
+
let n = u(e, t);
|
|
54
|
+
if (n) return n;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function d(e, t) {
|
|
60
|
+
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) d(e, t);
|
|
61
|
+
}
|
|
62
|
+
function f(e, t, n = { blocks: e }) {
|
|
63
|
+
for (let r = 0; r < e.length; r++) {
|
|
64
|
+
let i = e[r];
|
|
65
|
+
if (i.id === t) return n;
|
|
66
|
+
if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
|
|
67
|
+
let n = f(i.children[e], t, {
|
|
68
|
+
blocks: i.children[e],
|
|
69
|
+
sectionId: i.id,
|
|
70
|
+
columnIndex: e
|
|
71
|
+
});
|
|
72
|
+
if (n) return n;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
function p(t) {
|
|
78
|
+
return e.lockedBlocks?.value.has(t) ?? !1;
|
|
79
|
+
}
|
|
80
|
+
function m(e) {
|
|
81
|
+
let t = f(r.content.blocks, e);
|
|
82
|
+
if (!t) return null;
|
|
83
|
+
let n = t.blocks.findIndex((t) => t.id === e);
|
|
84
|
+
return n === -1 ? null : {
|
|
85
|
+
targetSectionId: t.sectionId,
|
|
86
|
+
columnIndex: t.columnIndex,
|
|
87
|
+
index: n
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function h(e, t = !0) {
|
|
91
|
+
D(e), w(e), r.content = e, t && a();
|
|
92
|
+
}
|
|
93
|
+
function g(e) {
|
|
94
|
+
e && p(e) || (r.selectedBlockId = e);
|
|
95
|
+
}
|
|
96
|
+
function _(e) {
|
|
97
|
+
r.viewport = e;
|
|
98
|
+
}
|
|
99
|
+
function v(e) {
|
|
100
|
+
r.darkMode = e;
|
|
101
|
+
}
|
|
102
|
+
function y(e) {
|
|
103
|
+
r.uiTheme = e;
|
|
104
|
+
}
|
|
105
|
+
function x(e) {
|
|
106
|
+
r.previewMode = e, e && (r.selectedBlockId = null);
|
|
107
|
+
}
|
|
108
|
+
function C(e, t) {
|
|
109
|
+
if (p(e)) return;
|
|
110
|
+
let n = u(r.content.blocks, e);
|
|
111
|
+
n && (Object.assign(n, t), a());
|
|
112
|
+
}
|
|
113
|
+
function T(e) {
|
|
114
|
+
r.content.settings = {
|
|
115
|
+
...r.content.settings,
|
|
116
|
+
...e
|
|
117
|
+
}, a();
|
|
118
|
+
}
|
|
119
|
+
function E(e, t, n = 0, i) {
|
|
120
|
+
let o = {
|
|
121
|
+
settings: r.content.settings,
|
|
122
|
+
blocks: [e]
|
|
123
|
+
};
|
|
124
|
+
if (D(o), w(o), !(t && e.type === "section")) {
|
|
125
|
+
if (t) {
|
|
126
|
+
if (p(t)) return;
|
|
127
|
+
let a = u(r.content.blocks, t);
|
|
128
|
+
if (a && a.type === "section") {
|
|
129
|
+
if (n < 0 || n >= V(a.columns)) return;
|
|
130
|
+
a.children[n] = a.children[n] || [];
|
|
131
|
+
let t = a.children[n];
|
|
132
|
+
i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
|
|
133
|
+
}
|
|
134
|
+
} else i !== void 0 && i < r.content.blocks.length ? r.content.blocks.splice(i, 0, e) : r.content.blocks.push(e);
|
|
135
|
+
a();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function O(e) {
|
|
139
|
+
if (p(e)) return;
|
|
140
|
+
let t = f(r.content.blocks, e);
|
|
141
|
+
if (t) {
|
|
142
|
+
let n = t.blocks.findIndex((t) => t.id === e);
|
|
143
|
+
if (n !== -1) {
|
|
144
|
+
let [e] = t.blocks.splice(n, 1);
|
|
145
|
+
if (r.selectedBlockId) {
|
|
146
|
+
let t = /* @__PURE__ */ new Set();
|
|
147
|
+
d(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
|
|
148
|
+
}
|
|
149
|
+
a();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function k(e, t, n, i = 0) {
|
|
154
|
+
if (p(e) || n && p(n)) return;
|
|
155
|
+
let o = f(r.content.blocks, e);
|
|
156
|
+
if (!o) return;
|
|
157
|
+
let s = o.blocks.findIndex((t) => t.id === e);
|
|
158
|
+
if (s === -1 || n && o.blocks[s].type === "section") return;
|
|
159
|
+
let c;
|
|
160
|
+
if (n) {
|
|
161
|
+
let e = u(r.content.blocks, n);
|
|
162
|
+
if (!e || e.type !== "section" || i < 0 || i >= V(e.columns)) return;
|
|
163
|
+
e.children[i] = e.children[i] || [], c = e.children[i];
|
|
164
|
+
} else c = r.content.blocks;
|
|
165
|
+
let [l] = o.blocks.splice(s, 1);
|
|
166
|
+
c.splice(t, 0, l), a();
|
|
167
|
+
}
|
|
168
|
+
function A() {
|
|
169
|
+
a();
|
|
170
|
+
}
|
|
171
|
+
function j(e, t) {
|
|
172
|
+
throw new S(`[Templatical] Templates: ${e} ${t}`);
|
|
173
|
+
}
|
|
174
|
+
function M(t) {
|
|
175
|
+
B(e.onError, t);
|
|
176
|
+
}
|
|
177
|
+
function N(t) {
|
|
178
|
+
let { templates: n } = e;
|
|
179
|
+
return n || j(t, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
|
|
180
|
+
}
|
|
181
|
+
function P(e) {
|
|
182
|
+
r.template && (r.template = {
|
|
183
|
+
...r.template,
|
|
184
|
+
name: e
|
|
185
|
+
}, a());
|
|
186
|
+
}
|
|
187
|
+
async function F(t) {
|
|
188
|
+
let n = N("create()"), { create: a } = n;
|
|
189
|
+
typeof a != "function" && j("create()", "is disabled by the provider — its `create` is `false`.");
|
|
190
|
+
let o;
|
|
191
|
+
r.isLoading = !0;
|
|
192
|
+
try {
|
|
193
|
+
t?.content && (r.content = t.content);
|
|
194
|
+
let e = i;
|
|
195
|
+
o = await a(t?.name === void 0 ? { content: r.content } : {
|
|
196
|
+
name: t.name,
|
|
197
|
+
content: r.content
|
|
198
|
+
}), r.template = o, i === e && (r.isDirty = !1);
|
|
199
|
+
} catch (t) {
|
|
200
|
+
throw e.onError?.(t), t;
|
|
201
|
+
} finally {
|
|
202
|
+
r.isLoading = !1;
|
|
203
|
+
}
|
|
204
|
+
return M(() => n.onCreated?.(o)), o;
|
|
205
|
+
}
|
|
206
|
+
async function I(t) {
|
|
207
|
+
let n = N("load()"), i;
|
|
208
|
+
r.isLoading = !0;
|
|
209
|
+
try {
|
|
210
|
+
i = await n.load(t), D(i.content), w(i.content), r.template = i, r.content = i.content, r.isDirty = !1;
|
|
211
|
+
} catch (t) {
|
|
212
|
+
throw e.onError?.(t), t;
|
|
213
|
+
} finally {
|
|
214
|
+
r.isLoading = !1;
|
|
215
|
+
}
|
|
216
|
+
return M(() => n.onLoaded?.(i)), i;
|
|
217
|
+
}
|
|
218
|
+
async function L(t = "api") {
|
|
219
|
+
let n = N("save()"), { save: a } = n;
|
|
220
|
+
typeof a != "function" && j("save()", "is disabled by the provider — its `save` is `false`.");
|
|
221
|
+
let o = r.template;
|
|
222
|
+
o || j("save()", "has no template loaded. Call create() or load() first.");
|
|
223
|
+
let s = o.name === void 0 ? { content: r.content } : {
|
|
224
|
+
name: o.name,
|
|
225
|
+
content: r.content
|
|
226
|
+
}, c;
|
|
227
|
+
r.isSaving = !0;
|
|
228
|
+
try {
|
|
229
|
+
let e = i;
|
|
230
|
+
if (c = await a(o.id, s), r.template?.id === o.id) {
|
|
231
|
+
let e = r.template.name;
|
|
232
|
+
r.template = e === o.name ? c : {
|
|
233
|
+
...c,
|
|
234
|
+
name: e
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
i === e && (r.isDirty = !1);
|
|
238
|
+
} catch (t) {
|
|
239
|
+
throw e.onError?.(t), t;
|
|
240
|
+
} finally {
|
|
241
|
+
r.isSaving = !1;
|
|
242
|
+
}
|
|
243
|
+
return M(() => n.onSaved?.(c, { trigger: t })), c;
|
|
244
|
+
}
|
|
245
|
+
function R() {
|
|
246
|
+
return r.template?.id !== void 0;
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
state: o(r),
|
|
250
|
+
content: c,
|
|
251
|
+
selectedBlock: l,
|
|
252
|
+
isBlockLocked: p,
|
|
253
|
+
setContent: h,
|
|
254
|
+
selectBlock: g,
|
|
255
|
+
setViewport: _,
|
|
256
|
+
setDarkMode: v,
|
|
257
|
+
setUiTheme: y,
|
|
258
|
+
setPreviewMode: x,
|
|
259
|
+
updateBlock: C,
|
|
260
|
+
updateSettings: T,
|
|
261
|
+
addBlock: E,
|
|
262
|
+
removeBlock: O,
|
|
263
|
+
moveBlock: k,
|
|
264
|
+
markDirty: A,
|
|
265
|
+
findBlockLocation: m,
|
|
266
|
+
setName: P,
|
|
267
|
+
create: F,
|
|
268
|
+
load: I,
|
|
269
|
+
save: L,
|
|
270
|
+
hasTemplate: R
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
var H = 50, U = 300, te = 1500;
|
|
274
|
+
function W(e) {
|
|
275
|
+
let { content: t, setContent: r, isRemoteOperation: i, maxSize: a = H } = e, o = c([]), s = c([]), l = c(!1), u = null, d = null, f = n(() => o.value.length > 0), p = n(() => s.value.length > 0);
|
|
276
|
+
function m() {
|
|
277
|
+
return E(t.value);
|
|
278
|
+
}
|
|
279
|
+
function h(e) {
|
|
280
|
+
o.value.push(e), o.value.length > a && o.value.splice(0, o.value.length - a);
|
|
281
|
+
}
|
|
282
|
+
function g() {
|
|
283
|
+
d &&= (clearTimeout(d.timeoutId), null);
|
|
284
|
+
}
|
|
285
|
+
function _() {
|
|
286
|
+
i?.() || (g(), h(m()), s.value = []);
|
|
287
|
+
}
|
|
288
|
+
function v(e) {
|
|
289
|
+
i?.() || (d && d.blockId === e ? (clearTimeout(d.timeoutId), d.timeoutId = setTimeout(() => {
|
|
290
|
+
d = null;
|
|
291
|
+
}, U)) : (g(), h(m()), s.value = [], d = {
|
|
292
|
+
blockId: e,
|
|
293
|
+
timeoutId: setTimeout(() => {
|
|
294
|
+
d = null;
|
|
295
|
+
}, U)
|
|
296
|
+
}));
|
|
297
|
+
}
|
|
298
|
+
function y() {
|
|
299
|
+
l.value = !0, u && clearTimeout(u), u = setTimeout(() => {
|
|
300
|
+
l.value = !1, u = null;
|
|
301
|
+
}, te);
|
|
302
|
+
}
|
|
303
|
+
function b() {
|
|
304
|
+
if (o.value.length === 0) return;
|
|
305
|
+
g();
|
|
306
|
+
let e = o.value.pop();
|
|
307
|
+
s.value.push(m()), r(e, !0), y();
|
|
308
|
+
}
|
|
309
|
+
function x() {
|
|
310
|
+
if (s.value.length === 0) return;
|
|
311
|
+
g();
|
|
312
|
+
let e = s.value.pop();
|
|
313
|
+
o.value.push(m()), r(e, !0), y();
|
|
314
|
+
}
|
|
315
|
+
function S() {
|
|
316
|
+
o.value = [], s.value = [], g();
|
|
317
|
+
}
|
|
318
|
+
function C() {
|
|
319
|
+
S(), u &&= (clearTimeout(u), null);
|
|
320
|
+
}
|
|
321
|
+
return {
|
|
322
|
+
canUndo: f,
|
|
323
|
+
canRedo: p,
|
|
324
|
+
isNavigating: l,
|
|
325
|
+
undo: b,
|
|
326
|
+
redo: x,
|
|
327
|
+
record: _,
|
|
328
|
+
recordDebounced: v,
|
|
329
|
+
clear: S,
|
|
330
|
+
destroy: C
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function G(e) {
|
|
334
|
+
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
335
|
+
function o(n, r, a) {
|
|
336
|
+
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = O(n, o);
|
|
337
|
+
return t(s, r, a), i(s.id), s;
|
|
338
|
+
}
|
|
339
|
+
function s(e, n, r) {
|
|
340
|
+
let o = C(e);
|
|
341
|
+
if (n !== void 0 || r !== void 0) t(o, n, r);
|
|
342
|
+
else {
|
|
343
|
+
let i = a?.(e.id) ?? null;
|
|
344
|
+
i ? t(o, i.targetSectionId, i.columnIndex, i.index + 1) : t(o, n, r);
|
|
345
|
+
}
|
|
346
|
+
return i(o.id), o;
|
|
347
|
+
}
|
|
348
|
+
function c(e) {
|
|
349
|
+
n(e);
|
|
350
|
+
}
|
|
351
|
+
function l(e, t, n) {
|
|
352
|
+
r(e, { [t]: n });
|
|
353
|
+
}
|
|
354
|
+
return {
|
|
355
|
+
createAndAddBlock: o,
|
|
356
|
+
duplicateBlock: s,
|
|
357
|
+
deleteBlock: c,
|
|
358
|
+
updateBlockProperty: l
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
var K = 2e3;
|
|
362
|
+
function q(e) {
|
|
363
|
+
let { content: t, isDirty: n, onChange: r, debounce: i = K, enabled: a = !0 } = e, o = null, s = !1;
|
|
364
|
+
function c() {
|
|
365
|
+
return typeof a == "function" ? a() : a;
|
|
366
|
+
}
|
|
367
|
+
function l() {
|
|
368
|
+
s = !0, d();
|
|
369
|
+
}
|
|
370
|
+
function u() {
|
|
371
|
+
s = !1;
|
|
372
|
+
}
|
|
373
|
+
function d() {
|
|
374
|
+
o &&= (clearTimeout(o), null);
|
|
375
|
+
}
|
|
376
|
+
function f() {
|
|
377
|
+
d(), n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
378
|
+
}
|
|
379
|
+
function p() {
|
|
380
|
+
c() && !s && (d(), o = setTimeout(() => {
|
|
381
|
+
o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
382
|
+
}, i));
|
|
383
|
+
}
|
|
384
|
+
let m = h(t, () => {
|
|
385
|
+
p();
|
|
386
|
+
}, { deep: !0 });
|
|
387
|
+
function g() {
|
|
388
|
+
m(), d();
|
|
389
|
+
}
|
|
390
|
+
return {
|
|
391
|
+
flush: f,
|
|
392
|
+
cancel: d,
|
|
393
|
+
pause: l,
|
|
394
|
+
resume: u,
|
|
395
|
+
destroy: g
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
function J(e) {
|
|
399
|
+
let t = s(/* @__PURE__ */ new Set()), r = n(() => t.size > 0);
|
|
400
|
+
function i(e) {
|
|
401
|
+
return t.has(e);
|
|
402
|
+
}
|
|
403
|
+
function a(n) {
|
|
404
|
+
t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
|
|
405
|
+
}
|
|
406
|
+
function o() {
|
|
407
|
+
t.clear();
|
|
408
|
+
}
|
|
409
|
+
return {
|
|
410
|
+
isHidden: i,
|
|
411
|
+
toggleBlock: a,
|
|
412
|
+
reset: o,
|
|
413
|
+
hasHiddenBlocks: r
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
function Y(e) {
|
|
417
|
+
let t = c(!1), r = c(!1), i = n(() => !!e.definition.value?.dataSource), a = n(() => i.value && !e.block.value.dataSourceFetched);
|
|
418
|
+
async function o() {
|
|
419
|
+
let n = e.definition.value;
|
|
420
|
+
if (n?.dataSource) {
|
|
421
|
+
t.value = !0, r.value = !1;
|
|
422
|
+
try {
|
|
423
|
+
let t = await n.dataSource.onFetch({
|
|
424
|
+
fieldValues: { ...e.block.value.fieldValues },
|
|
425
|
+
blockId: e.block.value.id
|
|
426
|
+
});
|
|
427
|
+
if (t == null) return;
|
|
428
|
+
let r = { ...e.block.value.fieldValues };
|
|
429
|
+
for (let e of Object.keys(r)) e in t && (r[e] = t[e]);
|
|
430
|
+
e.onUpdate(r, !0);
|
|
431
|
+
} catch (e) {
|
|
432
|
+
console.warn("[Templatical] Data source fetch error:", e), r.value = !0;
|
|
433
|
+
} finally {
|
|
434
|
+
t.value = !1;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return {
|
|
439
|
+
isFetching: t,
|
|
440
|
+
fetchError: r,
|
|
441
|
+
fetch: o,
|
|
442
|
+
hasDataSource: i,
|
|
443
|
+
needsFetch: a
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
function X(e, t) {
|
|
447
|
+
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
448
|
+
e.addBlock = (r, i, a, o) => {
|
|
449
|
+
i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
|
|
450
|
+
}, e.removeBlock = (n) => {
|
|
451
|
+
e.isBlockLocked(n) || (t.record(), r(n));
|
|
452
|
+
}, e.moveBlock = (n, r, a, o) => {
|
|
453
|
+
e.isBlockLocked(n) || a && e.isBlockLocked(a) || (t.record(), i(n, r, a, o));
|
|
454
|
+
}, e.updateBlock = (n, r) => {
|
|
455
|
+
e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r));
|
|
456
|
+
}, e.updateSettings = (e) => {
|
|
457
|
+
t.record(), o(e);
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
function Z(e) {
|
|
461
|
+
let { provider: t } = e, n = c([]), r = c(!1), i = v(() => {
|
|
462
|
+
let e = /* @__PURE__ */ new Set();
|
|
463
|
+
for (let t of n.value) {
|
|
464
|
+
let n = t.category?.trim();
|
|
465
|
+
n && e.add(n);
|
|
466
|
+
}
|
|
467
|
+
return [...e].sort((e, t) => e.localeCompare(t));
|
|
468
|
+
}), a = v(() => typeof t.create == "function"), o = v(() => typeof t.update == "function"), s = v(() => typeof t.delete == "function");
|
|
469
|
+
function l(e) {
|
|
470
|
+
return o.value && e.canUpdate !== !1;
|
|
471
|
+
}
|
|
472
|
+
function u(e) {
|
|
473
|
+
return s.value && e.canDelete !== !1;
|
|
474
|
+
}
|
|
475
|
+
function d(e, t) {
|
|
476
|
+
throw new S(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
477
|
+
}
|
|
478
|
+
function f(t) {
|
|
479
|
+
B(e.onError, t);
|
|
480
|
+
}
|
|
481
|
+
async function p(i) {
|
|
482
|
+
r.value = !0;
|
|
483
|
+
try {
|
|
484
|
+
n.value = await t.list(i);
|
|
485
|
+
} catch (t) {
|
|
486
|
+
throw e.onError?.(t), t;
|
|
487
|
+
} finally {
|
|
488
|
+
r.value = !1;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
async function m(r, i, a) {
|
|
492
|
+
let { create: o } = t;
|
|
493
|
+
typeof o != "function" && d("create", "disabled by the provider");
|
|
494
|
+
try {
|
|
495
|
+
let e = await o(a ? {
|
|
496
|
+
name: r,
|
|
497
|
+
content: i,
|
|
498
|
+
category: a
|
|
499
|
+
} : {
|
|
500
|
+
name: r,
|
|
501
|
+
content: i
|
|
502
|
+
});
|
|
503
|
+
return n.value = [e, ...n.value], f(() => t.onCreated?.(e)), e;
|
|
504
|
+
} catch (t) {
|
|
505
|
+
throw e.onError?.(t), t;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
async function h(r, i) {
|
|
509
|
+
let { update: a } = t;
|
|
510
|
+
typeof a != "function" && d("update", "disabled by the provider");
|
|
511
|
+
let o = n.value.find((e) => e.id === r);
|
|
512
|
+
o && o.canUpdate === !1 && d("update", `not permitted for entry "${r}"`);
|
|
513
|
+
try {
|
|
514
|
+
let e = await a(r, i);
|
|
515
|
+
return n.value = n.value.map((t) => t.id === r ? e : t), f(() => t.onUpdated?.(e)), e;
|
|
516
|
+
} catch (t) {
|
|
517
|
+
throw e.onError?.(t), t;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
async function g(r) {
|
|
521
|
+
let { delete: i } = t;
|
|
522
|
+
typeof i != "function" && d("delete", "disabled by the provider");
|
|
523
|
+
let a = n.value.find((e) => e.id === r) ?? null;
|
|
524
|
+
a && a.canDelete === !1 && d("delete", `not permitted for entry "${r}"`);
|
|
525
|
+
try {
|
|
526
|
+
await i(r), n.value = n.value.filter((e) => e.id !== r), a && f(() => t.onDeleted?.(a));
|
|
527
|
+
} catch (t) {
|
|
528
|
+
throw e.onError?.(t), t;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
return {
|
|
532
|
+
savedBlocks: n,
|
|
533
|
+
isLoading: r,
|
|
534
|
+
categories: i,
|
|
535
|
+
canCreate: a,
|
|
536
|
+
canUpdate: o,
|
|
537
|
+
canDelete: s,
|
|
538
|
+
canUpdateBlock: l,
|
|
539
|
+
canDeleteBlock: u,
|
|
540
|
+
load: p,
|
|
541
|
+
create: m,
|
|
542
|
+
update: h,
|
|
543
|
+
remove: g
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
var ne = "templatical:saved-blocks";
|
|
547
|
+
function re(e = {}) {
|
|
548
|
+
let t = e.key ?? ne;
|
|
549
|
+
function n() {
|
|
550
|
+
if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageSavedBlocksProvider requires a browser environment with localStorage. Supply your own SavedBlocksProvider for server-side or non-browser use.");
|
|
551
|
+
return localStorage;
|
|
552
|
+
}
|
|
553
|
+
function r() {
|
|
554
|
+
let e = n().getItem(t);
|
|
555
|
+
if (!e) return [];
|
|
556
|
+
try {
|
|
557
|
+
let t = JSON.parse(e);
|
|
558
|
+
return Array.isArray(t) ? t : [];
|
|
559
|
+
} catch {
|
|
560
|
+
return [];
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
function i(e) {
|
|
564
|
+
n().setItem(t, JSON.stringify(e));
|
|
565
|
+
}
|
|
566
|
+
return {
|
|
567
|
+
async list(e) {
|
|
568
|
+
let t = r(), n = e?.search?.trim().toLowerCase(), i = e?.category?.trim();
|
|
569
|
+
return t.filter((e) => !(n && !e.name.toLowerCase().includes(n) || i && e.category !== i));
|
|
570
|
+
},
|
|
571
|
+
async create(e) {
|
|
572
|
+
let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
573
|
+
id: x(),
|
|
574
|
+
name: e.name,
|
|
575
|
+
content: e.content,
|
|
576
|
+
...e.category ? { category: e.category } : {},
|
|
577
|
+
createdAt: t,
|
|
578
|
+
updatedAt: t
|
|
579
|
+
};
|
|
580
|
+
return i([n, ...r()]), n;
|
|
581
|
+
},
|
|
582
|
+
async update(e, t) {
|
|
583
|
+
let n = r(), a = n.findIndex((t) => t.id === e);
|
|
584
|
+
if (a === -1) throw Error(`[Templatical] Saved block not found: ${e}`);
|
|
585
|
+
let o = {
|
|
586
|
+
...n[a],
|
|
587
|
+
...t,
|
|
588
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
589
|
+
}, s = [...n];
|
|
590
|
+
return s[a] = o, i(s), o;
|
|
591
|
+
},
|
|
592
|
+
async delete(e) {
|
|
593
|
+
let t = r();
|
|
594
|
+
if (!t.some((t) => t.id === e)) throw Error(`[Templatical] Saved block not found: ${e}`);
|
|
595
|
+
i(t.filter((t) => t.id !== e));
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
var ie = "templatical:media", ae = 50;
|
|
600
|
+
function oe(e = {}) {
|
|
601
|
+
let t = e.key ?? ie;
|
|
602
|
+
function n() {
|
|
603
|
+
if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with localStorage. Supply your own MediaProvider for server-side or non-browser use.");
|
|
604
|
+
return localStorage;
|
|
605
|
+
}
|
|
606
|
+
function r() {
|
|
607
|
+
let e = n().getItem(t);
|
|
608
|
+
if (!e) return [];
|
|
609
|
+
try {
|
|
610
|
+
let t = JSON.parse(e);
|
|
611
|
+
return Array.isArray(t) ? t : [];
|
|
612
|
+
} catch {
|
|
613
|
+
return [];
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function i(e) {
|
|
617
|
+
n().setItem(t, JSON.stringify(e));
|
|
618
|
+
}
|
|
619
|
+
function a(e) {
|
|
620
|
+
return typeof FileReader > "u" ? Promise.reject(/* @__PURE__ */ Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with FileReader.")) : new Promise((t, n) => {
|
|
621
|
+
let r = new FileReader();
|
|
622
|
+
r.onload = () => {
|
|
623
|
+
typeof r.result == "string" ? t(r.result) : n(/* @__PURE__ */ Error("[Templatical] Failed to read file as a data URL."));
|
|
624
|
+
}, r.onerror = () => {
|
|
625
|
+
n(r.error ?? /* @__PURE__ */ Error("[Templatical] Failed to read file as a data URL."));
|
|
626
|
+
}, r.readAsDataURL(e);
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
return {
|
|
630
|
+
async list(e) {
|
|
631
|
+
let t = r(), n = e?.search?.trim().toLowerCase(), i = n ? t.filter((e) => {
|
|
632
|
+
let t = e.filename?.toLowerCase() ?? "", r = e.alt?.toLowerCase() ?? "";
|
|
633
|
+
return t.includes(n) || r.includes(n);
|
|
634
|
+
}) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + ae), c = { items: s }, l = o + s.length;
|
|
635
|
+
return l < i.length && (c.nextCursor = String(l)), c;
|
|
636
|
+
},
|
|
637
|
+
async create(e) {
|
|
638
|
+
let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
|
|
639
|
+
id: x(),
|
|
640
|
+
url: t,
|
|
641
|
+
filename: e.filename || e.file.name,
|
|
642
|
+
createdAt: n,
|
|
643
|
+
updatedAt: n,
|
|
644
|
+
size: e.file.size
|
|
645
|
+
};
|
|
646
|
+
return e.alt !== void 0 && (o.alt = e.alt), e.file.type && (o.mimeType = e.file.type), e.folderId !== void 0 && (o.folderId = e.folderId), i([o, ...r()]), o;
|
|
647
|
+
},
|
|
648
|
+
async update(e, t) {
|
|
649
|
+
let n = r(), a = n.findIndex((t) => t.id === e);
|
|
650
|
+
if (a === -1) throw Error(`[Templatical] Media asset not found: ${e}`);
|
|
651
|
+
let o = n[a], s = {
|
|
652
|
+
...o,
|
|
653
|
+
...t,
|
|
654
|
+
id: o.id,
|
|
655
|
+
url: o.url,
|
|
656
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
657
|
+
}, c = [...n];
|
|
658
|
+
return c[a] = s, i(c), s;
|
|
659
|
+
},
|
|
660
|
+
async delete(e) {
|
|
661
|
+
let t = r();
|
|
662
|
+
for (let n of e) if (!t.some((e) => e.id === n)) throw Error(`[Templatical] Media asset not found: ${n}`);
|
|
663
|
+
let n = new Set(e);
|
|
664
|
+
i(t.filter((e) => !n.has(e.id)));
|
|
665
|
+
},
|
|
666
|
+
folders: !1,
|
|
667
|
+
replace: !1,
|
|
668
|
+
importFromUrl: !1,
|
|
669
|
+
checkUsage: !1,
|
|
670
|
+
frequentlyUsed: !1,
|
|
671
|
+
storage: !1
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
function se(e) {
|
|
675
|
+
let { provider: t, getTemplateId: n } = e, r = c([]), i = c(!1), a = c(void 0), o = c(!1), s = /* @__PURE__ */ new Map(), l = v(() => typeof t.create == "function"), u = v(() => typeof t.restore == "function");
|
|
676
|
+
function d(e) {
|
|
677
|
+
let t = n();
|
|
678
|
+
if (!t) throw new S(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
679
|
+
return t;
|
|
680
|
+
}
|
|
681
|
+
function f(e) {
|
|
682
|
+
throw new S(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
683
|
+
}
|
|
684
|
+
function p(t) {
|
|
685
|
+
B(e.onError, t);
|
|
686
|
+
}
|
|
687
|
+
async function m(n) {
|
|
688
|
+
let o = d("list");
|
|
689
|
+
i.value = !0;
|
|
690
|
+
try {
|
|
691
|
+
let e = await t.list(o, n);
|
|
692
|
+
r.value = e.versions, a.value = e.nextCursor;
|
|
693
|
+
} catch (t) {
|
|
694
|
+
throw e.onError?.(t), t;
|
|
695
|
+
} finally {
|
|
696
|
+
i.value = !1;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function h(e) {
|
|
700
|
+
return e.content ?? s.get(e.id) ?? null;
|
|
701
|
+
}
|
|
702
|
+
async function g(n) {
|
|
703
|
+
let r = h(n);
|
|
704
|
+
if (r) return r;
|
|
705
|
+
let i = d("get");
|
|
706
|
+
try {
|
|
707
|
+
let e = await t.get(i, n.id);
|
|
708
|
+
return s.set(n.id, e), e;
|
|
709
|
+
} catch (t) {
|
|
710
|
+
throw e.onError?.(t), t;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
async function _(n, i) {
|
|
714
|
+
let { create: a } = t;
|
|
715
|
+
typeof a != "function" && f("create");
|
|
716
|
+
let o = d("create");
|
|
717
|
+
try {
|
|
718
|
+
let e = await a(o, n, i);
|
|
719
|
+
return r.value = [e, ...r.value], p(() => t.onCreated?.(e)), e;
|
|
720
|
+
} catch (t) {
|
|
721
|
+
throw e.onError?.(t), t;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
async function y(n) {
|
|
725
|
+
let { restore: r } = t;
|
|
726
|
+
typeof r != "function" && f("restore");
|
|
727
|
+
let i = d("restore"), a;
|
|
728
|
+
o.value = !0;
|
|
729
|
+
try {
|
|
730
|
+
a = await r(i, n);
|
|
731
|
+
} catch (t) {
|
|
732
|
+
throw e.onError?.(t), t;
|
|
733
|
+
} finally {
|
|
734
|
+
o.value = !1;
|
|
735
|
+
}
|
|
736
|
+
return p(() => t.onRestored?.(a)), a;
|
|
737
|
+
}
|
|
738
|
+
return {
|
|
739
|
+
nextCursor: a,
|
|
740
|
+
versions: r,
|
|
741
|
+
isLoading: i,
|
|
742
|
+
isRestoring: o,
|
|
743
|
+
canCreate: l,
|
|
744
|
+
canRestore: u,
|
|
745
|
+
load: m,
|
|
746
|
+
peekContent: h,
|
|
747
|
+
resolveContent: g,
|
|
748
|
+
create: _,
|
|
749
|
+
restore: y
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
function ce(e) {
|
|
753
|
+
let { provider: t, getTemplateId: n, getUser: r } = e, i = c([]), a = c(!1), o = c(!1), s = v(() => typeof t.create == "function"), l = v(() => typeof t.update == "function"), u = v(() => typeof t.delete == "function"), d = v(() => typeof t.setResolved == "function"), f = v(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), p = v(() => i.value.filter((e) => !e.resolvedAt).length), m = v(() => {
|
|
754
|
+
let e = /* @__PURE__ */ new Map();
|
|
755
|
+
for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
|
|
756
|
+
return e;
|
|
757
|
+
});
|
|
758
|
+
function h(e) {
|
|
759
|
+
let t = n();
|
|
760
|
+
if (!t) throw new S(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
761
|
+
return t;
|
|
762
|
+
}
|
|
763
|
+
function g(e) {
|
|
764
|
+
let t = r();
|
|
765
|
+
if (!t) throw new S(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
766
|
+
return t;
|
|
767
|
+
}
|
|
768
|
+
function _(e) {
|
|
769
|
+
throw new S(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
770
|
+
}
|
|
771
|
+
function y(e) {
|
|
772
|
+
for (let t of i.value) {
|
|
773
|
+
if (t.id === e) return t;
|
|
774
|
+
for (let n of t.replies ?? []) if (n.id === e) return n;
|
|
775
|
+
}
|
|
776
|
+
return null;
|
|
777
|
+
}
|
|
778
|
+
function b(e) {
|
|
779
|
+
let t = r();
|
|
780
|
+
return t !== null && e.author.id === t.id;
|
|
781
|
+
}
|
|
782
|
+
function x(t) {
|
|
783
|
+
let n = z(t);
|
|
784
|
+
throw e.onError?.(n), n;
|
|
785
|
+
}
|
|
786
|
+
function C(t) {
|
|
787
|
+
B(e.onError, t);
|
|
788
|
+
}
|
|
789
|
+
function w(e, t, n) {
|
|
790
|
+
return [
|
|
791
|
+
...e.slice(0, t),
|
|
792
|
+
n,
|
|
793
|
+
...e.slice(t + 1)
|
|
794
|
+
];
|
|
795
|
+
}
|
|
796
|
+
function T(e, t) {
|
|
797
|
+
return e !== void 0 && JSON.stringify(e) === JSON.stringify(t);
|
|
798
|
+
}
|
|
799
|
+
function E(e) {
|
|
800
|
+
if (e.parentId) {
|
|
801
|
+
let t = !1, n = i.value.map((n) => {
|
|
802
|
+
if (n.id !== e.parentId) return n;
|
|
803
|
+
let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
|
|
804
|
+
return i !== -1 && T(r[i], e) ? n : (t = !0, {
|
|
805
|
+
...n,
|
|
806
|
+
replies: i === -1 ? [...r, e] : w(r, i, e)
|
|
807
|
+
});
|
|
808
|
+
});
|
|
809
|
+
return t && (i.value = n), t;
|
|
810
|
+
}
|
|
811
|
+
let t = i.value.findIndex((t) => t.id === e.id);
|
|
812
|
+
if (t === -1) return i.value = [...i.value, e], !0;
|
|
813
|
+
let n = {
|
|
814
|
+
...e,
|
|
815
|
+
replies: e.replies ?? i.value[t].replies
|
|
816
|
+
};
|
|
817
|
+
return !T(i.value[t], n) && (i.value = w(i.value, t, n), !0);
|
|
818
|
+
}
|
|
819
|
+
function D(e, t) {
|
|
820
|
+
let n = y(e), r = t ?? n?.parentId ?? null;
|
|
821
|
+
return r ? i.value = i.value.map((t) => t.id === r ? {
|
|
822
|
+
...t,
|
|
823
|
+
replies: (t.replies ?? []).filter((t) => t.id !== e)
|
|
824
|
+
} : t) : i.value = i.value.filter((t) => t.id !== e), n;
|
|
825
|
+
}
|
|
826
|
+
async function O(e) {
|
|
827
|
+
let n = h("list");
|
|
828
|
+
a.value = !0;
|
|
829
|
+
try {
|
|
830
|
+
i.value = await t.list(n, e);
|
|
831
|
+
} catch (e) {
|
|
832
|
+
x(e);
|
|
833
|
+
} finally {
|
|
834
|
+
a.value = !1;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
async function k(e) {
|
|
838
|
+
let { create: n } = t;
|
|
839
|
+
typeof n != "function" && _("create");
|
|
840
|
+
let r = h("create");
|
|
841
|
+
g("create"), o.value = !0;
|
|
842
|
+
try {
|
|
843
|
+
let i = await n(r, e);
|
|
844
|
+
return E(i), C(() => t.onCreated?.(i, { origin: "local" })), i;
|
|
845
|
+
} catch (e) {
|
|
846
|
+
x(e);
|
|
847
|
+
} finally {
|
|
848
|
+
o.value = !1;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
async function A(e, n) {
|
|
852
|
+
let { update: r } = t;
|
|
853
|
+
typeof r != "function" && _("update");
|
|
854
|
+
let i = h("update");
|
|
855
|
+
g("update"), o.value = !0;
|
|
856
|
+
try {
|
|
857
|
+
let a = await r(i, e, n);
|
|
858
|
+
return E(a), C(() => t.onUpdated?.(a, { origin: "local" })), a;
|
|
859
|
+
} catch (e) {
|
|
860
|
+
x(e);
|
|
861
|
+
} finally {
|
|
862
|
+
o.value = !1;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
async function j(e) {
|
|
866
|
+
let { delete: n } = t;
|
|
867
|
+
typeof n != "function" && _("delete");
|
|
868
|
+
let r = h("delete");
|
|
869
|
+
g("delete");
|
|
870
|
+
let i = y(e);
|
|
871
|
+
o.value = !0;
|
|
872
|
+
try {
|
|
873
|
+
await n(r, e), D(e), i && C(() => t.onDeleted?.(i, { origin: "local" }));
|
|
874
|
+
} catch (e) {
|
|
875
|
+
x(e);
|
|
876
|
+
} finally {
|
|
877
|
+
o.value = !1;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
async function M(e, n) {
|
|
881
|
+
let { setResolved: r } = t;
|
|
882
|
+
typeof r != "function" && _("setResolved");
|
|
883
|
+
let i = h("setResolved");
|
|
884
|
+
g("setResolved"), o.value = !0;
|
|
885
|
+
try {
|
|
886
|
+
let a = await r(i, e, n);
|
|
887
|
+
return E(a), C(() => (a.resolvedAt ? t.onResolved : t.onUnresolved)?.(a, { origin: "local" })), a;
|
|
888
|
+
} catch (e) {
|
|
889
|
+
x(e);
|
|
890
|
+
} finally {
|
|
891
|
+
o.value = !1;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
function N(e) {
|
|
895
|
+
E(e) && C(() => t.onCreated?.(e, { origin: "remote" }));
|
|
896
|
+
}
|
|
897
|
+
function P(e) {
|
|
898
|
+
E(e) && C(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
|
|
899
|
+
}
|
|
900
|
+
function F(e, n) {
|
|
901
|
+
let r = D(e, n);
|
|
902
|
+
r && C(() => t.onDeleted?.(r, { origin: "remote" }));
|
|
903
|
+
}
|
|
904
|
+
return {
|
|
905
|
+
comments: i,
|
|
906
|
+
isLoading: a,
|
|
907
|
+
isSubmitting: o,
|
|
908
|
+
canCreate: s,
|
|
909
|
+
canUpdate: l,
|
|
910
|
+
canDelete: u,
|
|
911
|
+
canResolve: d,
|
|
912
|
+
totalCount: f,
|
|
913
|
+
unresolvedCount: p,
|
|
914
|
+
commentCountByBlock: m,
|
|
915
|
+
load: O,
|
|
916
|
+
create: k,
|
|
917
|
+
update: A,
|
|
918
|
+
remove: j,
|
|
919
|
+
setResolved: M,
|
|
920
|
+
find: y,
|
|
921
|
+
isOwn: b,
|
|
922
|
+
applyRemoteCreate: N,
|
|
923
|
+
applyRemoteUpdate: P,
|
|
924
|
+
applyRemoteDelete: F
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
function le(e) {
|
|
928
|
+
let { comments: t, provider: n, getTemplateId: a } = e, { subscribe: o } = n;
|
|
929
|
+
if (typeof o != "function") return;
|
|
930
|
+
let s = null;
|
|
931
|
+
function c() {
|
|
932
|
+
s?.(), s = null;
|
|
933
|
+
}
|
|
934
|
+
i(() => a(), (e) => {
|
|
935
|
+
c(), e && (s = o(e, (e) => {
|
|
936
|
+
switch (e.type) {
|
|
937
|
+
case "created":
|
|
938
|
+
t.applyRemoteCreate(e.comment);
|
|
939
|
+
break;
|
|
940
|
+
case "updated":
|
|
941
|
+
t.applyRemoteUpdate(e.comment);
|
|
942
|
+
break;
|
|
943
|
+
case "deleted": t.applyRemoteDelete(e.commentId, e.parentId);
|
|
944
|
+
}
|
|
945
|
+
}));
|
|
946
|
+
}, { immediate: !0 }), r(c);
|
|
947
|
+
}
|
|
948
|
+
//#endregion
|
|
949
|
+
//#region src/utils/blockTypeLabels.ts
|
|
950
|
+
function Q(e, t) {
|
|
951
|
+
return t.blocks[e] ?? e;
|
|
952
|
+
}
|
|
953
|
+
function ue(e, t, n = []) {
|
|
954
|
+
if (e.type !== "custom") return Q(e.type, t);
|
|
955
|
+
let { customType: r } = e;
|
|
956
|
+
return n.find((e) => e.type === r)?.name ?? r;
|
|
957
|
+
}
|
|
958
|
+
//#endregion
|
|
959
|
+
//#region src/utils/resolveFieldColors.ts
|
|
960
|
+
function de(e, t) {
|
|
961
|
+
let n = P({ presets: e.presets }, N), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
|
|
962
|
+
return {
|
|
963
|
+
presets: r ? t.presets : n.presets,
|
|
964
|
+
allowCustom: t.allowCustom !== !1 && i,
|
|
965
|
+
invalidPresets: n.invalidPresets,
|
|
966
|
+
emptyPresets: e.presets !== void 0 && e.presets.length === 0,
|
|
967
|
+
presetsInherited: r,
|
|
968
|
+
allowCustomIgnored: e.allowCustom === !0 && t.allowCustom === !1
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
var fe = F({
|
|
972
|
+
name: "code",
|
|
973
|
+
size: 24,
|
|
974
|
+
node: [["path", {
|
|
975
|
+
d: "m16 18 6-6-6-6",
|
|
976
|
+
key: "eg8j8"
|
|
977
|
+
}], ["path", {
|
|
978
|
+
d: "m8 6-6 6 6 6",
|
|
979
|
+
key: "ppft3o"
|
|
980
|
+
}]]
|
|
981
|
+
}), $ = F({
|
|
982
|
+
name: "image",
|
|
983
|
+
size: 24,
|
|
984
|
+
node: [
|
|
985
|
+
["rect", {
|
|
986
|
+
width: "18",
|
|
987
|
+
height: "18",
|
|
988
|
+
x: "3",
|
|
989
|
+
y: "3",
|
|
990
|
+
rx: "2",
|
|
991
|
+
ry: "2",
|
|
992
|
+
key: "1m3agn"
|
|
993
|
+
}],
|
|
994
|
+
["circle", {
|
|
995
|
+
cx: "9",
|
|
996
|
+
cy: "9",
|
|
997
|
+
r: "2",
|
|
998
|
+
key: "af1f0g"
|
|
999
|
+
}],
|
|
1000
|
+
["path", {
|
|
1001
|
+
d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
|
|
1002
|
+
key: "1xmnt7"
|
|
1003
|
+
}]
|
|
1004
|
+
]
|
|
1005
|
+
}), pe = F({
|
|
1006
|
+
name: "navigation",
|
|
1007
|
+
size: 24,
|
|
1008
|
+
node: [["polygon", {
|
|
1009
|
+
points: "3 11 22 2 13 21 11 13 3 11",
|
|
1010
|
+
key: "1ltx0t"
|
|
1011
|
+
}]]
|
|
1012
|
+
}), me = F({
|
|
1013
|
+
name: "share-2",
|
|
1014
|
+
size: 24,
|
|
1015
|
+
node: [
|
|
1016
|
+
["circle", {
|
|
1017
|
+
cx: "18",
|
|
1018
|
+
cy: "5",
|
|
1019
|
+
r: "3",
|
|
1020
|
+
key: "gq8acd"
|
|
1021
|
+
}],
|
|
1022
|
+
["circle", {
|
|
1023
|
+
cx: "6",
|
|
1024
|
+
cy: "12",
|
|
1025
|
+
r: "3",
|
|
1026
|
+
key: "w7nqdw"
|
|
1027
|
+
}],
|
|
1028
|
+
["circle", {
|
|
1029
|
+
cx: "18",
|
|
1030
|
+
cy: "19",
|
|
1031
|
+
r: "3",
|
|
1032
|
+
key: "1xt0gg"
|
|
1033
|
+
}],
|
|
1034
|
+
["line", {
|
|
1035
|
+
x1: "8.59",
|
|
1036
|
+
x2: "15.42",
|
|
1037
|
+
y1: "13.51",
|
|
1038
|
+
y2: "17.49",
|
|
1039
|
+
key: "47mynk"
|
|
1040
|
+
}],
|
|
1041
|
+
["line", {
|
|
1042
|
+
x1: "15.41",
|
|
1043
|
+
x2: "8.59",
|
|
1044
|
+
y1: "6.51",
|
|
1045
|
+
y2: "10.49",
|
|
1046
|
+
key: "1n3mei"
|
|
1047
|
+
}]
|
|
1048
|
+
]
|
|
1049
|
+
}), he = F({
|
|
1050
|
+
name: "table",
|
|
1051
|
+
size: 24,
|
|
1052
|
+
node: [
|
|
1053
|
+
["path", {
|
|
1054
|
+
d: "M12 3v18",
|
|
1055
|
+
key: "108xh3"
|
|
1056
|
+
}],
|
|
1057
|
+
["rect", {
|
|
1058
|
+
width: "18",
|
|
1059
|
+
height: "18",
|
|
1060
|
+
x: "3",
|
|
1061
|
+
y: "3",
|
|
1062
|
+
rx: "2",
|
|
1063
|
+
key: "afitv7"
|
|
1064
|
+
}],
|
|
1065
|
+
["path", {
|
|
1066
|
+
d: "M3 9h18",
|
|
1067
|
+
key: "1pudct"
|
|
1068
|
+
}],
|
|
1069
|
+
["path", {
|
|
1070
|
+
d: "M3 15h18",
|
|
1071
|
+
key: "5xshup"
|
|
1072
|
+
}]
|
|
1073
|
+
]
|
|
1074
|
+
}), ge = /* @__PURE__ */ y({
|
|
1075
|
+
__name: "MediaDropOverlay",
|
|
1076
|
+
props: {
|
|
1077
|
+
uploading: { type: Boolean },
|
|
1078
|
+
size: { default: "field" }
|
|
1079
|
+
},
|
|
1080
|
+
setup(n) {
|
|
1081
|
+
let r = n, { t: i } = M(), a = {
|
|
1082
|
+
field: {
|
|
1083
|
+
gap: "tpl:gap-1.5",
|
|
1084
|
+
icon: 18,
|
|
1085
|
+
veil: "90%"
|
|
1086
|
+
},
|
|
1087
|
+
canvas: {
|
|
1088
|
+
gap: "tpl:gap-2",
|
|
1089
|
+
icon: 20,
|
|
1090
|
+
veil: "85%"
|
|
1091
|
+
}
|
|
1092
|
+
}, o = v(() => a[r.size]);
|
|
1093
|
+
return (r, a) => (e(), u("div", {
|
|
1094
|
+
class: m(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", o.value.gap]),
|
|
1095
|
+
style: t({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${o.value.veil}, transparent)` })
|
|
1096
|
+
}, [n.uploading ? (e(), u(g, { key: 0 }, [d(l(I), {
|
|
1097
|
+
class: "tpl-spinner",
|
|
1098
|
+
size: o.value.icon,
|
|
1099
|
+
"stroke-width": 2
|
|
1100
|
+
}, null, 8, ["size"]), f(" " + p(l(i).image.uploading), 1)], 64)) : (e(), u(g, { key: 1 }, [d(l(L), {
|
|
1101
|
+
size: o.value.icon,
|
|
1102
|
+
"stroke-width": 1.5
|
|
1103
|
+
}, null, 8, ["size"]), f(" " + p(l(i).image.dropToUpload), 1)], 64))], 6));
|
|
1104
|
+
}
|
|
1105
|
+
}), _e = "image/";
|
|
1106
|
+
function ve(e) {
|
|
1107
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = k(t, {
|
|
1108
|
+
preventDefaultForUnhandled: !0,
|
|
1109
|
+
onDrop: (e) => {
|
|
1110
|
+
if (!i()) return;
|
|
1111
|
+
let t = (e ?? []).filter((e) => e.type.startsWith(_e));
|
|
1112
|
+
t.length > 0 && n([t[0]]);
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
1115
|
+
return { isOver: v(() => i() && a.value) };
|
|
1116
|
+
}
|
|
1117
|
+
//#endregion
|
|
1118
|
+
//#region src/composables/useMediaDropField.ts
|
|
1119
|
+
function ye(e) {
|
|
1120
|
+
let { target: t, blocked: n, apply: r } = e, i = a(A, null), o = a(j, null), s = R();
|
|
1121
|
+
async function l() {
|
|
1122
|
+
let e = await i?.({ accept: ["images"] });
|
|
1123
|
+
s.alive && e && r(e);
|
|
1124
|
+
}
|
|
1125
|
+
let u = c(!1), d = v(() => (o?.value ?? !!i) && !u.value && !_(n));
|
|
1126
|
+
async function f(e) {
|
|
1127
|
+
if (i) {
|
|
1128
|
+
u.value = !0;
|
|
1129
|
+
try {
|
|
1130
|
+
let t = await i({
|
|
1131
|
+
accept: ["images"],
|
|
1132
|
+
files: e
|
|
1133
|
+
});
|
|
1134
|
+
if (!s.alive) return;
|
|
1135
|
+
t && r(t);
|
|
1136
|
+
} finally {
|
|
1137
|
+
s.alive && (u.value = !1);
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
let { isOver: p } = ve({
|
|
1142
|
+
target: t,
|
|
1143
|
+
enabled: d,
|
|
1144
|
+
onFiles: f
|
|
1145
|
+
}), m = v(() => d.value && p.value || u.value);
|
|
1146
|
+
return {
|
|
1147
|
+
canBrowse: !!i,
|
|
1148
|
+
dropEnabled: d,
|
|
1149
|
+
isUploading: u,
|
|
1150
|
+
showOverlay: m,
|
|
1151
|
+
openMediaBrowser: l
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
//#endregion
|
|
1155
|
+
//#region src/constants/socialIcons.ts
|
|
1156
|
+
var be = T, xe = {
|
|
1157
|
+
small: 24,
|
|
1158
|
+
medium: 32,
|
|
1159
|
+
large: 48
|
|
1160
|
+
}, Se = [
|
|
1161
|
+
"facebook",
|
|
1162
|
+
"twitter",
|
|
1163
|
+
"instagram",
|
|
1164
|
+
"linkedin",
|
|
1165
|
+
"youtube",
|
|
1166
|
+
"tiktok",
|
|
1167
|
+
"pinterest",
|
|
1168
|
+
"email",
|
|
1169
|
+
"website",
|
|
1170
|
+
"whatsapp",
|
|
1171
|
+
"telegram",
|
|
1172
|
+
"discord",
|
|
1173
|
+
"snapchat",
|
|
1174
|
+
"reddit",
|
|
1175
|
+
"github",
|
|
1176
|
+
"dribbble",
|
|
1177
|
+
"behance"
|
|
1178
|
+
];
|
|
1179
|
+
//#endregion
|
|
1180
|
+
export { ee as C, se as D, Z as E, Y as S, X as T, q as _, ge as a, ce as b, pe as c, de as d, ue as f, re as g, oe as h, ye as i, $ as l, K as m, be as n, he as o, Q as p, Se as r, me as s, xe as t, fe as u, G as v, W as w, J as x, le as y };
|