@templatical/editor 0.47.0 → 0.48.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-BPOv5Ra8.js → AiChatSidebar-DxPHFNoT.js} +8 -8
- package/dist/{AiFeatureMenu-H_WT4YR8.js → AiFeatureMenu-C8GVqu1d.js} +4 -4
- package/dist/{BlockIssueBadge-AgO5abEB.js → BlockIssueBadge-BShkuJis.js} +2 -2
- package/dist/BlockPreviewCanvas-tzAtDkXH.js +141 -0
- package/dist/{CloudHeaderExtras-gXsTYoGG.js → CloudHeaderExtras-CUSftQdm.js} +2 -2
- package/dist/{CloudPanels-H_GdbOfZ.js → CloudPanels-Dgw7tb4R.js} +4 -4
- package/dist/{CollaboratorBar-BazGNMqN.js → CollaboratorBar-5rfopCPx.js} +2 -2
- package/dist/{CommentsPanel-CMgsG_yh.js → CommentsPanel-DiWzYtnZ.js} +1 -1
- package/dist/{CommentsSidebar-DCh8DTP8.js → CommentsSidebar-BOqj16Al.js} +10 -10
- package/dist/{CountdownToolbar-DVuucA3v.js → CountdownToolbar-C4y3Ft7H.js} +4 -4
- package/dist/{DesignReferenceSidebar-DxNV4lQp.js → DesignReferenceSidebar-BWAi3eQQ.js} +7 -7
- package/dist/{IssuesPanel-CUpW54P4.js → IssuesPanel-C-x3I012.js} +5 -5
- package/dist/{LogicTagInsertButton-DDYKnqmj.js → LogicTagInsertButton-B1_Wy0AN.js} +6 -6
- package/dist/{MediaEditModal-D_we0Scr.js → MediaEditModal-ByOvznRC.js} +1 -1
- package/dist/{MediaPanels-L95BwWV1.js → MediaPanels-9mDBv4aL.js} +1 -1
- package/dist/{MergeTagInput-DAL998tx.js → MergeTagInput-fOewuF27.js} +1 -1
- package/dist/{MergeTagModeToggle-CjHO26rb.js → MergeTagModeToggle-BXamLcv7.js} +4 -4
- package/dist/{ParagraphEditor-CcEN1N6n.js → ParagraphEditor-BVjOwwHx.js} +131 -131
- package/dist/{RestoreVersionDialog-B2OH5rgs.js → RestoreVersionDialog-BEKXx9xk.js} +3 -3
- package/dist/{RichTextEditorContent-BGeTg-QL.js → RichTextEditorContent-D7kp7iig.js} +4 -4
- package/dist/{SaveBlockDialog-CCVyU-7y.js → SaveBlockDialog-SJu0lecx.js} +32 -33
- package/dist/{SavedBlocksBrowserModal-_WmSeqIh.js → SavedBlocksBrowserModal-DbmIS5uK.js} +9 -9
- package/dist/{SavedBlocksPanels-DVX_ruQ7.js → SavedBlocksPanels-Dr5Fxx9Z.js} +1 -1
- package/dist/{SavedBlocksPickBar-DVJC28hP.js → SavedBlocksPickBar-DnEWBZJy.js} +2 -2
- package/dist/{TemplateScoringPanel-U0QFiwdI.js → TemplateScoringPanel-ynbGl-sr.js} +11 -11
- package/dist/{TemplateSettings-CdhTm9JQ.js → TemplateSettings-Bi01S3H3.js} +7 -7
- package/dist/{TestEmailModal-BqToA_ls.js → TestEmailModal-CbRY8HQx.js} +7 -7
- package/dist/{TestEmailPanel-Cn4Ptq0j.js → TestEmailPanel-NAOmt3xi.js} +1 -1
- package/dist/{TitleEditor-CZdqeltH.js → TitleEditor-Cc3DHbuN.js} +8 -8
- package/dist/{ToggleSwitch-BR8Sgzib.js → ToggleSwitch-Ozc7YU38.js} +1 -1
- package/dist/Toolbar-B-2lO0I8.js +3156 -0
- package/dist/{TplModal-CoczSDma.js → TplModal-Bz4-IZ9R.js} +1 -1
- package/dist/{VersionHistoryMenu-DY5z5FZr.js → VersionHistoryMenu-CjV1d1zk.js} +5 -5
- package/dist/{VersionHistoryPanels-DowHeDAQ.js → VersionHistoryPanels-BtwxrKJn.js} +1 -1
- package/dist/{VersionPreviewBanner-Bo8NxBbh.js → VersionPreviewBanner-BLAei1kj.js} +1 -1
- package/dist/WrapperBlock-D0qgNqjD.js +45 -0
- package/dist/{blockTypeIcons-4E1U8f99.js → blockTypeIcons-CEDZytqP.js} +49 -19
- package/dist/bundle-stats.json +8 -8
- package/dist/{cdn/chunks/ca-DMoGGP9L.js → ca-CbNzJM3I.js} +17 -3
- package/dist/cdn/chunks/{AiChatSidebar-B72rI0be.js → AiChatSidebar-Dk0rJBQN.js} +7 -7
- package/dist/cdn/chunks/{AiChatSidebar-B72rI0be.js.map → AiChatSidebar-Dk0rJBQN.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-BqSG9iEd.js → AiFeatureMenu-B7b0w8ZS.js} +3 -3
- package/dist/cdn/chunks/{AiFeatureMenu-BqSG9iEd.js.map → AiFeatureMenu-B7b0w8ZS.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-CS7ytN-z.js → BlockIssueBadge-C7sdnkrF.js} +2 -2
- package/dist/cdn/chunks/{BlockIssueBadge-CS7ytN-z.js.map → BlockIssueBadge-C7sdnkrF.js.map} +1 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-vK5tBazr.js +143 -0
- package/dist/cdn/chunks/BlockPreviewCanvas-vK5tBazr.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-DJXLTUHc.js → CloudHeaderExtras-B4fhuwc_.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-DJXLTUHc.js.map → CloudHeaderExtras-B4fhuwc_.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-D1fPLjG8.js → CloudPanels-awqHfJqC.js} +4 -4
- package/dist/cdn/chunks/{CloudPanels-D1fPLjG8.js.map → CloudPanels-awqHfJqC.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-MeRQB1eN.js → CollaboratorBar-CS0ivqkr.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-MeRQB1eN.js.map → CollaboratorBar-CS0ivqkr.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-CmxPylNf.js → CommentsPanel-CbzxwsyI.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-CmxPylNf.js.map → CommentsPanel-CbzxwsyI.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-CrleQTbo.js → CommentsSidebar-DWPHZuQm.js} +13 -13
- package/dist/cdn/chunks/{CommentsSidebar-CrleQTbo.js.map → CommentsSidebar-DWPHZuQm.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-DPIOtlN0.js → CountdownToolbar-Cqg8FUH-.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-DPIOtlN0.js.map → CountdownToolbar-Cqg8FUH-.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-BgTNqgCy.js → DesignReferenceSidebar-BW9cHnA9.js} +7 -7
- package/dist/cdn/chunks/{DesignReferenceSidebar-BgTNqgCy.js.map → DesignReferenceSidebar-BW9cHnA9.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-BGjLcNpQ.js → IssuesPanel-cXf9ywA4.js} +4 -4
- package/dist/cdn/chunks/{IssuesPanel-BGjLcNpQ.js.map → IssuesPanel-cXf9ywA4.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-BEsqPhMr.js → LogicTagInsertButton-BMB9vShs.js} +84 -84
- package/dist/cdn/chunks/{LogicTagInsertButton-BEsqPhMr.js.map → LogicTagInsertButton-BMB9vShs.js.map} +1 -1
- package/dist/cdn/chunks/{MediaEditModal-C1Ao0i2c.js → MediaEditModal-zXfcArr4.js} +2 -2
- package/dist/cdn/chunks/{MediaEditModal-C1Ao0i2c.js.map → MediaEditModal-zXfcArr4.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-1GPYiZZ0.js → MediaPanels-Cp4XB_dH.js} +2 -2
- package/dist/cdn/chunks/{MediaPanels-1GPYiZZ0.js.map → MediaPanels-Cp4XB_dH.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-Dy13_OLc.js → MergeTagInput-DLqrA9co.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-Dy13_OLc.js.map → MergeTagInput-DLqrA9co.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-B2CPZOeF.js → MergeTagModeToggle-BRiJzzn5.js} +3 -3
- package/dist/cdn/chunks/{MergeTagModeToggle-B2CPZOeF.js.map → MergeTagModeToggle-BRiJzzn5.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BGLIw7kg.js → ParagraphEditor-D4aq9eeC.js} +35 -35
- package/dist/cdn/chunks/{ParagraphEditor-BGLIw7kg.js.map → ParagraphEditor-D4aq9eeC.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-BhykE8En.js → RestoreVersionDialog-BgR6RXSb.js} +5 -5
- package/dist/cdn/chunks/{RestoreVersionDialog-BhykE8En.js.map → RestoreVersionDialog-BgR6RXSb.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-B-txUvPL.js → RichTextEditorContent-C4DMAn0g.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-B-txUvPL.js.map → RichTextEditorContent-C4DMAn0g.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-BHqEp7jw.js → SaveBlockDialog-BaIsQd09.js} +23 -24
- package/dist/cdn/chunks/{SaveBlockDialog-BHqEp7jw.js.map → SaveBlockDialog-BaIsQd09.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BhR6AI0f.js → SavedBlocksBrowserModal-CtnB58p_.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BhR6AI0f.js.map → SavedBlocksBrowserModal-CtnB58p_.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-YwffJtfY.js → SavedBlocksPanels-BhEOMzEQ.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-YwffJtfY.js.map → SavedBlocksPanels-BhEOMzEQ.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-BtpFU7es.js → SavedBlocksPickBar-CcdqTEIp.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPickBar-BtpFU7es.js.map → SavedBlocksPickBar-CcdqTEIp.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-N4ySFh5w.js → TemplateScoringPanel-BrWqJCSP.js} +6 -6
- package/dist/cdn/chunks/{TemplateScoringPanel-N4ySFh5w.js.map → TemplateScoringPanel-BrWqJCSP.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-C7b5X34U.js → TemplateSettings-BkkWTDHD.js} +10 -10
- package/dist/cdn/chunks/{TemplateSettings-C7b5X34U.js.map → TemplateSettings-BkkWTDHD.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-DHJKI5y5.js → TestEmailModal-V5mwHsUV.js} +9 -9
- package/dist/cdn/chunks/{TestEmailModal-DHJKI5y5.js.map → TestEmailModal-V5mwHsUV.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-lYtzTXpR.js → TestEmailPanel-DxrKuctP.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-lYtzTXpR.js.map → TestEmailPanel-DxrKuctP.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-5eY01ypW.js → TitleEditor-CsZiG3TT.js} +13 -13
- package/dist/cdn/chunks/{TitleEditor-5eY01ypW.js.map → TitleEditor-CsZiG3TT.js.map} +1 -1
- package/dist/cdn/chunks/{ToggleSwitch-BN8rMC2m.js → ToggleSwitch-BB-bQADJ.js} +2 -2
- package/dist/cdn/chunks/{ToggleSwitch-BN8rMC2m.js.map → ToggleSwitch-BB-bQADJ.js.map} +1 -1
- package/dist/cdn/chunks/Toolbar-C_x2TfFk.js +3073 -0
- package/dist/cdn/chunks/Toolbar-C_x2TfFk.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-WIBiBrGy.js → TplModal-DC_eodTV.js} +2 -2
- package/dist/cdn/chunks/{TplModal-WIBiBrGy.js.map → TplModal-DC_eodTV.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-CZnlS9K5.js → VersionHistoryMenu-DXnM5Df2.js} +7 -7
- package/dist/cdn/chunks/{VersionHistoryMenu-CZnlS9K5.js.map → VersionHistoryMenu-DXnM5Df2.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-xjLSpR1e.js → VersionHistoryPanels-DXSqmaLS.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-xjLSpR1e.js.map → VersionHistoryPanels-DXSqmaLS.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-sARpn4hh.js → VersionPreviewBanner-DKyN6BhO.js} +2 -2
- package/dist/cdn/chunks/{VersionPreviewBanner-sARpn4hh.js.map → VersionPreviewBanner-DKyN6BhO.js.map} +1 -1
- package/dist/cdn/chunks/WrapperBlock-gG_Bleug.js +47 -0
- package/dist/cdn/chunks/WrapperBlock-gG_Bleug.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-HrMJDfVg.js +22 -0
- package/dist/cdn/chunks/blockTypeIcons-HrMJDfVg.js.map +1 -0
- package/dist/{ca-DMoGGP9L.js → cdn/chunks/ca-CbNzJM3I.js} +19 -1
- package/dist/cdn/chunks/ca-CbNzJM3I.js.map +1 -0
- package/dist/cdn/chunks/{cloud-Cd7ptfhL.js → cloud-BHClP3e2.js} +2 -2
- package/dist/cdn/chunks/{cloud-Cd7ptfhL.js.map → cloud-BHClP3e2.js.map} +1 -1
- package/dist/cdn/chunks/{createCloudRuntime-DtIZ2Lee.js → createCloudRuntime-Vd0N4elZ.js} +4 -4
- package/dist/cdn/chunks/{createCloudRuntime-DtIZ2Lee.js.map → createCloudRuntime-Vd0N4elZ.js.map} +1 -1
- package/dist/cdn/chunks/{de-DgAelLbM.js → de-DMquBpZM.js} +18 -2
- package/dist/cdn/chunks/de-DMquBpZM.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-Bcwo0orC.js → editor-modal-vEEmZ8Tu.js} +88 -88
- package/dist/cdn/chunks/{editor-modal-Bcwo0orC.js.map → editor-modal-vEEmZ8Tu.js.map} +1 -1
- package/dist/cdn/chunks/{en-Dekrl7HA.js → en-C8Mp71sO.js} +18 -2
- package/dist/cdn/chunks/en-C8Mp71sO.js.map +1 -0
- package/dist/cdn/chunks/en-eWpiXyZu.js +1 -0
- package/dist/cdn/chunks/{es-BaZzyidV.js → es-Byq4tthI.js} +18 -2
- package/dist/cdn/chunks/es-Byq4tthI.js.map +1 -0
- package/dist/cdn/chunks/{extensions-T-t8MKDb.js → extensions-hJ9VqzDc.js} +4 -4
- package/dist/cdn/chunks/{extensions-T-t8MKDb.js.map → extensions-hJ9VqzDc.js.map} +1 -1
- package/dist/{fr-C5ucb1HK.js → cdn/chunks/fr-B3j35HEw.js} +19 -1
- package/dist/cdn/chunks/fr-B3j35HEw.js.map +1 -0
- package/dist/cdn/chunks/{icons-C4fX9Bwy.js → icons-aTYwH5-g.js} +123 -94
- package/dist/cdn/chunks/icons-aTYwH5-g.js.map +1 -0
- package/dist/{ja-CUgR3mV0.js → cdn/chunks/ja-D7txAuGS.js} +19 -1
- package/dist/cdn/chunks/ja-D7txAuGS.js.map +1 -0
- package/dist/{nl-qrLY7hMS.js → cdn/chunks/nl-ClJ3BY3F.js} +19 -1
- package/dist/cdn/chunks/nl-ClJ3BY3F.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-Co0oi0Jf.js → preRenderCustomBlocks-ByfuSjtL.js} +2 -2
- package/dist/cdn/chunks/{preRenderCustomBlocks-Co0oi0Jf.js.map → preRenderCustomBlocks-ByfuSjtL.js.map} +1 -1
- package/dist/{pt-BR-C6hMTQYi.js → cdn/chunks/pt-BR-DibcXcmv.js} +19 -1
- package/dist/cdn/chunks/pt-BR-DibcXcmv.js.map +1 -0
- package/dist/cdn/chunks/{socialIcons-DACw1wA8.js → socialIcons-C_lnkpG6.js} +355 -179
- package/dist/cdn/chunks/socialIcons-C_lnkpG6.js.map +1 -0
- package/dist/cdn/chunks/{src-BnJlDuyB.js → src-DYCDeBDM.js} +219 -181
- package/dist/cdn/chunks/src-DYCDeBDM.js.map +1 -0
- package/dist/cdn/chunks/{src-CHlVFp7r.js → src-DlFlC9Tt.js} +267 -241
- package/dist/cdn/chunks/src-DlFlC9Tt.js.map +1 -0
- package/dist/cdn/chunks/{src-Bu0qBpbf.js → src-dZ4D_tuP.js} +226 -193
- package/dist/cdn/chunks/src-dZ4D_tuP.js.map +1 -0
- package/dist/cdn/chunks/timeouts-Cv2jvusx.js +6 -0
- package/dist/cdn/chunks/timeouts-Cv2jvusx.js.map +1 -0
- package/dist/cdn/chunks/{useEditorCore-Bf2d1DKI.js → useEditorCore-Bb2UcB20.js} +722 -717
- package/dist/cdn/chunks/useEditorCore-Bb2UcB20.js.map +1 -0
- package/dist/cdn/chunks/{useLogicTag-3S63go4E.js → useLogicTag-HsyUCQtl.js} +2 -2
- package/dist/cdn/chunks/{useLogicTag-3S63go4E.js.map → useLogicTag-HsyUCQtl.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-BQtxUHq1.js → useMergeTag-Dg9pE85U.js} +2 -2
- package/dist/cdn/chunks/{useMergeTag-BQtxUHq1.js.map → useMergeTag-Dg9pE85U.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-DwJd-lKc.js → withCurrentFont-oLcATrQ8.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-DwJd-lKc.js.map → withCurrentFont-oLcATrQ8.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +403 -397
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-B5R4zXr7.js → check-ClwqRMgv.js} +1 -1
- package/dist/{chevron-down-BKyl85NV.js → chevron-down-te6qn-zE.js} +1 -1
- package/dist/{chevron-right-BmToZ8qX.js → chevron-right-W2hbH1FM.js} +1 -1
- package/dist/{chevron-up-DNYdOxPC.js → chevron-up-Bf5Zo7o4.js} +1 -1
- package/dist/{circle-alert-Dx9ju3YZ.js → circle-alert-CIEGV5DN.js} +1 -1
- package/dist/{clock-Dv9bxsSH.js → clock-Y4cx0gkJ.js} +1 -1
- package/dist/{cloud-DwjaAdwK.js → cloud-B5xwm_4X.js} +1 -1
- package/dist/{copy-BsKl4dcy.js → copy-BEcsAlfB.js} +1 -1
- package/dist/{createCloudRuntime-C8gpPsSi.js → createCloudRuntime-zNPkF6T9.js} +3 -3
- package/dist/{createLucideIcon-DziKp5iU.js → createLucideIcon-CYHXK9hn.js} +5 -5
- package/dist/{de-DgAelLbM.js → de-DMquBpZM.js} +17 -1
- package/dist/{dist-C8koXLhl.js → dist-tsmnQugO.js} +285 -249
- package/dist/{editor-modal-BwyIUnV_.js → editor-modal-AlVLkU91.js} +23 -23
- package/dist/en-B0FUfNwz.js +1 -0
- package/dist/{en-Dekrl7HA.js → en-C8Mp71sO.js} +17 -1
- package/dist/{es-BaZzyidV.js → es-Byq4tthI.js} +17 -1
- package/dist/{extensions-DHyKjsNZ.js → extensions-pjO8VGkM.js} +3 -3
- package/dist/{eye-DQuinb9k.js → eye-Ddnz8nnm.js} +1 -1
- package/dist/{cdn/chunks/fr-C5ucb1HK.js → fr-B3j35HEw.js} +17 -3
- package/dist/{image-up-yTfLjOrj.js → image-up-CM_HC0Dx.js} +1 -1
- package/dist/index.d.ts +66 -3
- package/dist/{info-C7OjlS11.js → info-DXLmzoeY.js} +1 -1
- package/dist/{cdn/chunks/ja-CUgR3mV0.js → ja-D7txAuGS.js} +17 -3
- package/dist/{link-CrUFaZ0t.js → link-Cel46wgo.js} +1 -1
- package/dist/{list-CLgv6M-k.js → list-Cl0GwiV9.js} +1 -1
- package/dist/{loader-circle-BXM5VO0K.js → loader-circle-uAwpvfys.js} +1 -1
- package/dist/{message-circle-BisdQ8H9.js → message-circle-DWU1pTM_.js} +1 -1
- package/dist/{cdn/chunks/nl-qrLY7hMS.js → nl-ClJ3BY3F.js} +17 -3
- package/dist/{package-C1T4AxV1.js → package-CbyG_yU_.js} +1 -1
- package/dist/{pencil-oo2mwf4C.js → pencil-BzoDcwKu.js} +1 -1
- package/dist/{plus-BIilXopD.js → plus-8cDvoCjZ.js} +1 -1
- package/dist/{preRenderCustomBlocks-lFX0HHiV.js → preRenderCustomBlocks-DMP5RuHl.js} +3 -3
- package/dist/{cdn/chunks/pt-BR-C6hMTQYi.js → pt-BR-DibcXcmv.js} +17 -3
- package/dist/{refresh-cw-DrLlkEVC.js → refresh-cw-9WinWixo.js} +1 -1
- package/dist/{search-DNu9lImk.js → search-CqgGq1gG.js} +1 -1
- package/dist/{send-DDNh3LoJ.js → send-Ceo3c9Db.js} +1 -1
- package/dist/{shield-check-aXM3o14f.js → shield-check-uDAwur5D.js} +1 -1
- package/dist/{smartphone-isccgDee.js → smartphone-CcLaCpGK.js} +1 -1
- package/dist/{socialIcons-BctavKBN.js → socialIcons-PTiwhLoC.js} +332 -153
- package/dist/{sparkles-CIMfFxKv.js → sparkles-Do9XjAuT.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +549 -543
- package/dist/{text-align-start-C4JFeqsq.js → text-align-start-DvzC0HQA.js} +1 -1
- package/dist/timeouts-Cv2jvusx.js +4 -0
- package/dist/{trash-8ZD9pK_c.js → trash-vlINTx32.js} +1 -1
- package/dist/{triangle-alert-pq45xEHl.js → triangle-alert-MRYSJ9T2.js} +1 -1
- package/dist/{upload-DrNFmVes.js → upload-CtNOI6J2.js} +1 -1
- package/dist/{useEditorCore-BcT7UI4e.js → useEditorCore-PvErWWsp.js} +963 -957
- package/dist/{useLogicTag-D-dI8H6p.js → useLogicTag-BHn67tDd.js} +1 -1
- package/dist/{useMergeTag-5wMeDBi-.js → useMergeTag-CRkm5Ig6.js} +1 -1
- package/dist/{useScrollToBlock-Do3suaqp.js → useScrollToBlock-CXmcHQQN.js} +1 -1
- package/dist/{withCurrentFont-B4YnsG_2.js → withCurrentFont-CxRGeHO3.js} +1 -1
- package/dist/{x-CBFKGLB1.js → x-Cd6SFw8r.js} +1 -1
- package/package.json +8 -8
- package/dist/BlockPreviewCanvas-CZDBSPoG.js +0 -136
- 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/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/de-DgAelLbM.js.map +0 -1
- package/dist/cdn/chunks/en-BANFWZdr.js +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/socialIcons-DACw1wA8.js.map +0 -1
- package/dist/cdn/chunks/src-BnJlDuyB.js.map +0 -1
- 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 +0 -6
- package/dist/cdn/chunks/timeouts-DHPZQ0G3.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-Bf2d1DKI.js.map +0 -1
- package/dist/en-CC-57eC_.js +0 -1
- package/dist/timeouts-DHPZQ0G3.js +0 -4
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { B as e, E as t,
|
|
2
|
-
import { A as
|
|
3
|
-
import { r as
|
|
4
|
-
import { L as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { B as e, E as t, K as n, N as r, Q as i, S as a, W as o, X as s, Y as c, Z as l, at as u, b as d, ct as f, f as p, g as m, lt as h, ot as g, rt as _, u as v, ut as y, y as b } from "./draggable-DrsNwZuB.js";
|
|
2
|
+
import { A as x, D as S, E as C, J as w, Nt as T, St as E, T as D, Y as O, Z as k, ct as A, gt as j, ht as M, i as N, j as P, r as F, t as I } from "./src-DYCDeBDM.js";
|
|
3
|
+
import { r as L } from "./dist-MNQYSEWU.js";
|
|
4
|
+
import { L as R, P as ee, c as te, x as ne } from "./keys-HI-INbkz.js";
|
|
5
|
+
import { r as re } from "./timeouts-Cv2jvusx.js";
|
|
6
|
+
import { t as ie } from "./useI18n-DUlyyIJJ.js";
|
|
7
|
+
import { o as ae, s as oe } from "./usePopoverPosition-IbaW6-Ao.js";
|
|
8
|
+
import { at as se, s as ce } from "./icons-aTYwH5-g.js";
|
|
9
|
+
import { t as le } from "./useAliveFlag-DCB96vzR.js";
|
|
9
10
|
//#region ../core/src/error-reporting.ts
|
|
10
|
-
function
|
|
11
|
+
function z(e) {
|
|
11
12
|
return e instanceof Error ? e : Error(String(e), { cause: e });
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
+
function B(e, t) {
|
|
14
15
|
try {
|
|
15
16
|
t();
|
|
16
17
|
} catch (t) {
|
|
17
|
-
e?.(
|
|
18
|
+
e?.(z(t));
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
//#endregion
|
|
21
22
|
//#region ../core/src/editor.ts
|
|
22
|
-
function
|
|
23
|
+
function V(e) {
|
|
23
24
|
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
let t = e.content ??
|
|
27
|
-
|
|
28
|
-
let n =
|
|
26
|
+
function ue(e) {
|
|
27
|
+
let t = e.content ?? k(e.defaultFontFamily, e.templateDefaults);
|
|
28
|
+
C(t), S(t);
|
|
29
|
+
let n = s({
|
|
29
30
|
template: null,
|
|
30
31
|
content: t,
|
|
31
32
|
selectedBlockId: null,
|
|
@@ -40,12 +41,12 @@ function ee(e) {
|
|
|
40
41
|
function i() {
|
|
41
42
|
n.isDirty = !0, r++;
|
|
42
43
|
}
|
|
43
|
-
let
|
|
44
|
+
let a = o({
|
|
44
45
|
get: () => n.content,
|
|
45
46
|
set: (e) => {
|
|
46
47
|
n.content = e, i();
|
|
47
48
|
}
|
|
48
|
-
}),
|
|
49
|
+
}), c = o(() => n.selectedBlockId ? u(n.content.blocks, n.selectedBlockId) : null);
|
|
49
50
|
function u(e, t) {
|
|
50
51
|
for (let n of e) {
|
|
51
52
|
if (n.id === t) return n;
|
|
@@ -88,7 +89,7 @@ function ee(e) {
|
|
|
88
89
|
};
|
|
89
90
|
}
|
|
90
91
|
function h(e, t = !0) {
|
|
91
|
-
|
|
92
|
+
C(e), S(e), n.content = e, t && i();
|
|
92
93
|
}
|
|
93
94
|
function g(e) {
|
|
94
95
|
e && p(e) || (n.selectedBlockId = e);
|
|
@@ -105,7 +106,7 @@ function ee(e) {
|
|
|
105
106
|
function b(e) {
|
|
106
107
|
n.previewMode = e, e && (n.selectedBlockId = null);
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
+
function x(e, t) {
|
|
109
110
|
if (p(e)) return;
|
|
110
111
|
let r = u(n.content.blocks, e);
|
|
111
112
|
r && (Object.assign(r, t), i());
|
|
@@ -116,17 +117,17 @@ function ee(e) {
|
|
|
116
117
|
...e
|
|
117
118
|
}, i();
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function T(e, t, r = 0, a) {
|
|
120
121
|
let o = {
|
|
121
122
|
settings: n.content.settings,
|
|
122
123
|
blocks: [e]
|
|
123
124
|
};
|
|
124
|
-
if (
|
|
125
|
+
if (C(o), S(o), !(t && e.type === "section")) {
|
|
125
126
|
if (t) {
|
|
126
127
|
if (p(t)) return;
|
|
127
128
|
let i = u(n.content.blocks, t);
|
|
128
129
|
if (i && i.type === "section") {
|
|
129
|
-
if (r < 0 || r >=
|
|
130
|
+
if (r < 0 || r >= V(i.columns)) return;
|
|
130
131
|
i.children[r] = i.children[r] || [];
|
|
131
132
|
let t = i.children[r];
|
|
132
133
|
a !== void 0 && a < t.length ? t.splice(a, 0, e) : t.push(e);
|
|
@@ -135,7 +136,7 @@ function ee(e) {
|
|
|
135
136
|
i();
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
|
-
function
|
|
139
|
+
function E(e) {
|
|
139
140
|
if (p(e)) return;
|
|
140
141
|
let t = f(n.content.blocks, e);
|
|
141
142
|
if (t) {
|
|
@@ -150,7 +151,7 @@ function ee(e) {
|
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
+
function D(e, t, r, a = 0) {
|
|
154
155
|
if (p(e) || r && p(r)) return;
|
|
155
156
|
let o = f(n.content.blocks, e);
|
|
156
157
|
if (!o) return;
|
|
@@ -159,34 +160,34 @@ function ee(e) {
|
|
|
159
160
|
let c;
|
|
160
161
|
if (r) {
|
|
161
162
|
let e = u(n.content.blocks, r);
|
|
162
|
-
if (!e || e.type !== "section" || a < 0 || a >=
|
|
163
|
+
if (!e || e.type !== "section" || a < 0 || a >= V(e.columns)) return;
|
|
163
164
|
e.children[a] = e.children[a] || [], c = e.children[a];
|
|
164
165
|
} else c = n.content.blocks;
|
|
165
166
|
let [l] = o.blocks.splice(s, 1);
|
|
166
167
|
c.splice(t, 0, l), i();
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
+
function O() {
|
|
169
170
|
i();
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
-
throw new
|
|
172
|
+
function A(e, t) {
|
|
173
|
+
throw new I(`[Templatical] Templates: ${e} ${t}`);
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
-
|
|
175
|
+
function j(t) {
|
|
176
|
+
B(e.onError, t);
|
|
176
177
|
}
|
|
177
|
-
function
|
|
178
|
+
function M(t) {
|
|
178
179
|
let { templates: n } = e;
|
|
179
|
-
return n ||
|
|
180
|
+
return n || A(t, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
+
function N(e) {
|
|
182
183
|
n.template && (n.template = {
|
|
183
184
|
...n.template,
|
|
184
185
|
name: e
|
|
185
186
|
}, i());
|
|
186
187
|
}
|
|
187
|
-
async function
|
|
188
|
-
let i =
|
|
189
|
-
typeof a != "function" &&
|
|
188
|
+
async function P(t) {
|
|
189
|
+
let i = M("create()"), { create: a } = i;
|
|
190
|
+
typeof a != "function" && A("create()", "is disabled by the provider — its `create` is `false`.");
|
|
190
191
|
let o;
|
|
191
192
|
n.isLoading = !0;
|
|
192
193
|
try {
|
|
@@ -201,25 +202,25 @@ function ee(e) {
|
|
|
201
202
|
} finally {
|
|
202
203
|
n.isLoading = !1;
|
|
203
204
|
}
|
|
204
|
-
return
|
|
205
|
+
return j(() => i.onCreated?.(o)), o;
|
|
205
206
|
}
|
|
206
|
-
async function
|
|
207
|
-
let r =
|
|
207
|
+
async function F(t) {
|
|
208
|
+
let r = M("load()"), i;
|
|
208
209
|
n.isLoading = !0;
|
|
209
210
|
try {
|
|
210
|
-
i = await r.load(t),
|
|
211
|
+
i = await r.load(t), C(i.content), S(i.content), n.template = i, n.content = i.content, n.isDirty = !1;
|
|
211
212
|
} catch (t) {
|
|
212
213
|
throw e.onError?.(t), t;
|
|
213
214
|
} finally {
|
|
214
215
|
n.isLoading = !1;
|
|
215
216
|
}
|
|
216
|
-
return
|
|
217
|
+
return j(() => r.onLoaded?.(i)), i;
|
|
217
218
|
}
|
|
218
219
|
async function L(t = "api") {
|
|
219
|
-
let i =
|
|
220
|
-
typeof a != "function" &&
|
|
220
|
+
let i = M("save()"), { save: a } = i;
|
|
221
|
+
typeof a != "function" && A("save()", "is disabled by the provider — its `save` is `false`.");
|
|
221
222
|
let o = n.template;
|
|
222
|
-
o ||
|
|
223
|
+
o || A("save()", "has no template loaded. Call create() or load() first.");
|
|
223
224
|
let s = o.name === void 0 ? { content: n.content } : {
|
|
224
225
|
name: o.name,
|
|
225
226
|
content: n.content
|
|
@@ -240,15 +241,15 @@ function ee(e) {
|
|
|
240
241
|
} finally {
|
|
241
242
|
n.isSaving = !1;
|
|
242
243
|
}
|
|
243
|
-
return
|
|
244
|
+
return j(() => i.onSaved?.(c, { trigger: t })), c;
|
|
244
245
|
}
|
|
245
246
|
function R() {
|
|
246
247
|
return n.template?.id !== void 0;
|
|
247
248
|
}
|
|
248
249
|
return {
|
|
249
|
-
state:
|
|
250
|
-
content:
|
|
251
|
-
selectedBlock:
|
|
250
|
+
state: l(n),
|
|
251
|
+
content: a,
|
|
252
|
+
selectedBlock: c,
|
|
252
253
|
isBlockLocked: p,
|
|
253
254
|
setContent: h,
|
|
254
255
|
selectBlock: g,
|
|
@@ -256,39 +257,39 @@ function ee(e) {
|
|
|
256
257
|
setDarkMode: v,
|
|
257
258
|
setUiTheme: y,
|
|
258
259
|
setPreviewMode: b,
|
|
259
|
-
updateBlock:
|
|
260
|
+
updateBlock: x,
|
|
260
261
|
updateSettings: w,
|
|
261
|
-
addBlock:
|
|
262
|
-
removeBlock:
|
|
263
|
-
moveBlock:
|
|
264
|
-
markDirty:
|
|
262
|
+
addBlock: T,
|
|
263
|
+
removeBlock: E,
|
|
264
|
+
moveBlock: D,
|
|
265
|
+
markDirty: O,
|
|
265
266
|
findBlockLocation: m,
|
|
266
|
-
setName:
|
|
267
|
-
create:
|
|
268
|
-
load:
|
|
267
|
+
setName: N,
|
|
268
|
+
create: P,
|
|
269
|
+
load: F,
|
|
269
270
|
save: L,
|
|
270
271
|
hasTemplate: R
|
|
271
272
|
};
|
|
272
273
|
}
|
|
273
274
|
//#endregion
|
|
274
275
|
//#region ../core/src/history.ts
|
|
275
|
-
var
|
|
276
|
-
function
|
|
277
|
-
let { content: t, setContent: n, isRemoteOperation:
|
|
276
|
+
var de = 50, H = 300, fe = 1500;
|
|
277
|
+
function pe(e) {
|
|
278
|
+
let { content: t, setContent: n, isRemoteOperation: r, maxSize: a = de } = e, s = i([]), c = i([]), l = i(!1), u = null, d = null, f = o(() => s.value.length > 0), p = o(() => c.value.length > 0);
|
|
278
279
|
function m() {
|
|
279
|
-
return
|
|
280
|
+
return O(t.value);
|
|
280
281
|
}
|
|
281
282
|
function h(e) {
|
|
282
|
-
s.value.push(e), s.value.length >
|
|
283
|
+
s.value.push(e), s.value.length > a && s.value.splice(0, s.value.length - a);
|
|
283
284
|
}
|
|
284
285
|
function g() {
|
|
285
286
|
d &&= (clearTimeout(d.timeoutId), null);
|
|
286
287
|
}
|
|
287
288
|
function _() {
|
|
288
|
-
|
|
289
|
+
r?.() || (g(), h(m()), c.value = []);
|
|
289
290
|
}
|
|
290
291
|
function v(e) {
|
|
291
|
-
|
|
292
|
+
r?.() || (d && d.blockId === e ? (clearTimeout(d.timeoutId), d.timeoutId = setTimeout(() => {
|
|
292
293
|
d = null;
|
|
293
294
|
}, H)) : (g(), h(m()), c.value = [], d = {
|
|
294
295
|
blockId: e,
|
|
@@ -300,7 +301,7 @@ function U(e) {
|
|
|
300
301
|
function y() {
|
|
301
302
|
l.value = !0, u && clearTimeout(u), u = setTimeout(() => {
|
|
302
303
|
l.value = !1, u = null;
|
|
303
|
-
},
|
|
304
|
+
}, fe);
|
|
304
305
|
}
|
|
305
306
|
function b() {
|
|
306
307
|
if (s.value.length === 0) return;
|
|
@@ -334,14 +335,14 @@ function U(e) {
|
|
|
334
335
|
}
|
|
335
336
|
//#endregion
|
|
336
337
|
//#region ../core/src/block-actions.ts
|
|
337
|
-
function
|
|
338
|
+
function me(e) {
|
|
338
339
|
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
339
340
|
function o(n, r, a) {
|
|
340
|
-
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s =
|
|
341
|
+
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = P(n, o);
|
|
341
342
|
return t(s, r, a), i(s.id), s;
|
|
342
343
|
}
|
|
343
344
|
function s(e, n, r) {
|
|
344
|
-
let o =
|
|
345
|
+
let o = x(e);
|
|
345
346
|
if (n !== void 0 || r !== void 0) t(o, n, r);
|
|
346
347
|
else {
|
|
347
348
|
let i = a?.(e.id) ?? null;
|
|
@@ -364,9 +365,9 @@ function W(e) {
|
|
|
364
365
|
}
|
|
365
366
|
//#endregion
|
|
366
367
|
//#region ../core/src/auto-save.ts
|
|
367
|
-
var
|
|
368
|
-
function
|
|
369
|
-
let { content: t, isDirty: n, onChange: r, debounce: i =
|
|
368
|
+
var U = 2e3;
|
|
369
|
+
function he(e) {
|
|
370
|
+
let { content: t, isDirty: n, onChange: r, debounce: i = U, enabled: a = !0 } = e, o = null, s = !1;
|
|
370
371
|
function c() {
|
|
371
372
|
return typeof a == "function" ? a() : a;
|
|
372
373
|
}
|
|
@@ -387,10 +388,10 @@ function K(e) {
|
|
|
387
388
|
o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
388
389
|
}, i));
|
|
389
390
|
}
|
|
390
|
-
let m =
|
|
391
|
+
let m = g(t, () => {
|
|
391
392
|
p();
|
|
392
393
|
}, { deep: !0 });
|
|
393
|
-
function
|
|
394
|
+
function h() {
|
|
394
395
|
m(), d();
|
|
395
396
|
}
|
|
396
397
|
return {
|
|
@@ -398,33 +399,33 @@ function K(e) {
|
|
|
398
399
|
cancel: d,
|
|
399
400
|
pause: l,
|
|
400
401
|
resume: u,
|
|
401
|
-
destroy:
|
|
402
|
+
destroy: h
|
|
402
403
|
};
|
|
403
404
|
}
|
|
404
405
|
//#endregion
|
|
405
406
|
//#region ../core/src/condition-preview.ts
|
|
406
|
-
function
|
|
407
|
-
let t =
|
|
407
|
+
function ge(e) {
|
|
408
|
+
let t = s(/* @__PURE__ */ new Set()), n = o(() => t.size > 0);
|
|
408
409
|
function r(e) {
|
|
409
410
|
return t.has(e);
|
|
410
411
|
}
|
|
411
412
|
function i(n) {
|
|
412
413
|
t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
|
|
413
414
|
}
|
|
414
|
-
function
|
|
415
|
+
function a() {
|
|
415
416
|
t.clear();
|
|
416
417
|
}
|
|
417
418
|
return {
|
|
418
419
|
isHidden: r,
|
|
419
420
|
toggleBlock: i,
|
|
420
|
-
reset:
|
|
421
|
+
reset: a,
|
|
421
422
|
hasHiddenBlocks: n
|
|
422
423
|
};
|
|
423
424
|
}
|
|
424
425
|
//#endregion
|
|
425
426
|
//#region ../core/src/data-source-fetch.ts
|
|
426
|
-
function
|
|
427
|
-
let t =
|
|
427
|
+
function _e(e) {
|
|
428
|
+
let t = i(!1), n = i(!1), r = o(() => !!e.definition.value?.dataSource), a = o(() => r.value && !e.block.value.dataSourceFetched);
|
|
428
429
|
async function s() {
|
|
429
430
|
let r = e.definition.value;
|
|
430
431
|
if (r?.dataSource) {
|
|
@@ -449,13 +450,13 @@ function J(e) {
|
|
|
449
450
|
isFetching: t,
|
|
450
451
|
fetchError: n,
|
|
451
452
|
fetch: s,
|
|
452
|
-
hasDataSource:
|
|
453
|
-
needsFetch:
|
|
453
|
+
hasDataSource: r,
|
|
454
|
+
needsFetch: a
|
|
454
455
|
};
|
|
455
456
|
}
|
|
456
457
|
//#endregion
|
|
457
458
|
//#region ../core/src/history-interceptor.ts
|
|
458
|
-
function
|
|
459
|
+
function ve(e, t) {
|
|
459
460
|
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
460
461
|
e.addBlock = (r, i, a, o) => {
|
|
461
462
|
i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
|
|
@@ -471,15 +472,15 @@ function Y(e, t) {
|
|
|
471
472
|
}
|
|
472
473
|
//#endregion
|
|
473
474
|
//#region ../core/src/saved-blocks.ts
|
|
474
|
-
function
|
|
475
|
-
let { provider: t } = e, n =
|
|
475
|
+
function ye(e) {
|
|
476
|
+
let { provider: t } = e, n = i([]), r = i(!1), a = p(() => {
|
|
476
477
|
let e = /* @__PURE__ */ new Set();
|
|
477
478
|
for (let t of n.value) {
|
|
478
479
|
let n = t.category?.trim();
|
|
479
480
|
n && e.add(n);
|
|
480
481
|
}
|
|
481
482
|
return [...e].sort((e, t) => e.localeCompare(t));
|
|
482
|
-
}), o =
|
|
483
|
+
}), o = p(() => typeof t.create == "function"), s = p(() => typeof t.update == "function"), c = p(() => typeof t.delete == "function");
|
|
483
484
|
function l(e) {
|
|
484
485
|
return s.value && e.canUpdate !== !1;
|
|
485
486
|
}
|
|
@@ -487,19 +488,19 @@ function X(e) {
|
|
|
487
488
|
return c.value && e.canDelete !== !1;
|
|
488
489
|
}
|
|
489
490
|
function d(e, t) {
|
|
490
|
-
throw new
|
|
491
|
+
throw new I(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
491
492
|
}
|
|
492
|
-
function
|
|
493
|
-
|
|
493
|
+
function f(t) {
|
|
494
|
+
B(e.onError, t);
|
|
494
495
|
}
|
|
495
|
-
async function m(
|
|
496
|
-
|
|
496
|
+
async function m(i) {
|
|
497
|
+
r.value = !0;
|
|
497
498
|
try {
|
|
498
|
-
n.value = await t.list(
|
|
499
|
+
n.value = await t.list(i);
|
|
499
500
|
} catch (t) {
|
|
500
501
|
throw e.onError?.(t), t;
|
|
501
502
|
} finally {
|
|
502
|
-
|
|
503
|
+
r.value = !1;
|
|
503
504
|
}
|
|
504
505
|
}
|
|
505
506
|
async function h(r, i, a) {
|
|
@@ -514,7 +515,7 @@ function X(e) {
|
|
|
514
515
|
name: r,
|
|
515
516
|
content: i
|
|
516
517
|
});
|
|
517
|
-
return n.value = [e, ...n.value],
|
|
518
|
+
return n.value = [e, ...n.value], f(() => t.onCreated?.(e)), e;
|
|
518
519
|
} catch (t) {
|
|
519
520
|
throw e.onError?.(t), t;
|
|
520
521
|
}
|
|
@@ -526,7 +527,7 @@ function X(e) {
|
|
|
526
527
|
o && o.canUpdate === !1 && d("update", `not permitted for entry "${r}"`);
|
|
527
528
|
try {
|
|
528
529
|
let e = await a(r, i);
|
|
529
|
-
return n.value = n.value.map((t) => t.id === r ? e : t),
|
|
530
|
+
return n.value = n.value.map((t) => t.id === r ? e : t), f(() => t.onUpdated?.(e)), e;
|
|
530
531
|
} catch (t) {
|
|
531
532
|
throw e.onError?.(t), t;
|
|
532
533
|
}
|
|
@@ -537,14 +538,14 @@ function X(e) {
|
|
|
537
538
|
let a = n.value.find((e) => e.id === r) ?? null;
|
|
538
539
|
a && a.canDelete === !1 && d("delete", `not permitted for entry "${r}"`);
|
|
539
540
|
try {
|
|
540
|
-
await i(r), n.value = n.value.filter((e) => e.id !== r), a &&
|
|
541
|
+
await i(r), n.value = n.value.filter((e) => e.id !== r), a && f(() => t.onDeleted?.(a));
|
|
541
542
|
} catch (t) {
|
|
542
543
|
throw e.onError?.(t), t;
|
|
543
544
|
}
|
|
544
545
|
}
|
|
545
546
|
return {
|
|
546
547
|
savedBlocks: n,
|
|
547
|
-
isLoading:
|
|
548
|
+
isLoading: r,
|
|
548
549
|
categories: a,
|
|
549
550
|
canCreate: o,
|
|
550
551
|
canUpdate: s,
|
|
@@ -559,9 +560,9 @@ function X(e) {
|
|
|
559
560
|
}
|
|
560
561
|
//#endregion
|
|
561
562
|
//#region ../core/src/saved-blocks-local.ts
|
|
562
|
-
var
|
|
563
|
-
function
|
|
564
|
-
let t = e.key ??
|
|
563
|
+
var be = "templatical:saved-blocks";
|
|
564
|
+
function xe(e = {}) {
|
|
565
|
+
let t = e.key ?? be;
|
|
565
566
|
function n() {
|
|
566
567
|
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.");
|
|
567
568
|
return localStorage;
|
|
@@ -586,7 +587,7 @@ function ne(e = {}) {
|
|
|
586
587
|
},
|
|
587
588
|
async create(e) {
|
|
588
589
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
589
|
-
id:
|
|
590
|
+
id: w(),
|
|
590
591
|
name: e.name,
|
|
591
592
|
content: e.content,
|
|
592
593
|
...e.category ? { category: e.category } : {},
|
|
@@ -614,9 +615,9 @@ function ne(e = {}) {
|
|
|
614
615
|
}
|
|
615
616
|
//#endregion
|
|
616
617
|
//#region ../core/src/media-local.ts
|
|
617
|
-
var
|
|
618
|
-
function
|
|
619
|
-
let t = e.key ??
|
|
618
|
+
var Se = "templatical:media", Ce = 50;
|
|
619
|
+
function we(e = {}) {
|
|
620
|
+
let t = e.key ?? Se;
|
|
620
621
|
function n() {
|
|
621
622
|
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.");
|
|
622
623
|
return localStorage;
|
|
@@ -649,12 +650,12 @@ function ae(e = {}) {
|
|
|
649
650
|
let t = r(), n = e?.search?.trim().toLowerCase(), i = n ? t.filter((e) => {
|
|
650
651
|
let t = e.filename?.toLowerCase() ?? "", r = e.alt?.toLowerCase() ?? "";
|
|
651
652
|
return t.includes(n) || r.includes(n);
|
|
652
|
-
}) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o +
|
|
653
|
+
}) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + Ce), c = { items: s }, l = o + s.length;
|
|
653
654
|
return l < i.length && (c.nextCursor = String(l)), c;
|
|
654
655
|
},
|
|
655
656
|
async create(e) {
|
|
656
657
|
let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
|
|
657
|
-
id:
|
|
658
|
+
id: w(),
|
|
658
659
|
url: t,
|
|
659
660
|
filename: e.filename || e.file.name,
|
|
660
661
|
createdAt: n,
|
|
@@ -691,25 +692,25 @@ function ae(e = {}) {
|
|
|
691
692
|
}
|
|
692
693
|
//#endregion
|
|
693
694
|
//#region ../core/src/version-history.ts
|
|
694
|
-
function
|
|
695
|
-
let { provider: t, getTemplateId: n } = e,
|
|
695
|
+
function Te(e) {
|
|
696
|
+
let { provider: t, getTemplateId: n } = e, r = i([]), a = i(!1), o = i(void 0), s = i(!1), c = /* @__PURE__ */ new Map(), l = p(() => typeof t.create == "function"), u = p(() => typeof t.restore == "function");
|
|
696
697
|
function d(e) {
|
|
697
698
|
let t = n();
|
|
698
|
-
if (!t) throw new
|
|
699
|
+
if (!t) throw new I(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
699
700
|
return t;
|
|
700
701
|
}
|
|
701
|
-
function
|
|
702
|
-
throw new
|
|
702
|
+
function f(e) {
|
|
703
|
+
throw new I(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
703
704
|
}
|
|
704
705
|
function m(t) {
|
|
705
|
-
|
|
706
|
+
B(e.onError, t);
|
|
706
707
|
}
|
|
707
708
|
async function h(n) {
|
|
708
|
-
let
|
|
709
|
+
let i = d("list");
|
|
709
710
|
a.value = !0;
|
|
710
711
|
try {
|
|
711
|
-
let e = await t.list(
|
|
712
|
-
|
|
712
|
+
let e = await t.list(i, n);
|
|
713
|
+
r.value = e.versions, o.value = e.nextCursor;
|
|
713
714
|
} catch (t) {
|
|
714
715
|
throw e.onError?.(t), t;
|
|
715
716
|
} finally {
|
|
@@ -730,20 +731,20 @@ function oe(e) {
|
|
|
730
731
|
throw e.onError?.(t), t;
|
|
731
732
|
}
|
|
732
733
|
}
|
|
733
|
-
async function v(n,
|
|
734
|
+
async function v(n, i) {
|
|
734
735
|
let { create: a } = t;
|
|
735
|
-
typeof a != "function" &&
|
|
736
|
+
typeof a != "function" && f("create");
|
|
736
737
|
let o = d("create");
|
|
737
738
|
try {
|
|
738
|
-
let e = await a(o, n,
|
|
739
|
-
return
|
|
739
|
+
let e = await a(o, n, i);
|
|
740
|
+
return r.value = [e, ...r.value], m(() => t.onCreated?.(e)), e;
|
|
740
741
|
} catch (t) {
|
|
741
742
|
throw e.onError?.(t), t;
|
|
742
743
|
}
|
|
743
744
|
}
|
|
744
745
|
async function y(n) {
|
|
745
746
|
let { restore: r } = t;
|
|
746
|
-
typeof r != "function" &&
|
|
747
|
+
typeof r != "function" && f("restore");
|
|
747
748
|
let i = d("restore"), a;
|
|
748
749
|
s.value = !0;
|
|
749
750
|
try {
|
|
@@ -757,7 +758,7 @@ function oe(e) {
|
|
|
757
758
|
}
|
|
758
759
|
return {
|
|
759
760
|
nextCursor: o,
|
|
760
|
-
versions:
|
|
761
|
+
versions: r,
|
|
761
762
|
isLoading: a,
|
|
762
763
|
isRestoring: s,
|
|
763
764
|
canCreate: l,
|
|
@@ -771,24 +772,24 @@ function oe(e) {
|
|
|
771
772
|
}
|
|
772
773
|
//#endregion
|
|
773
774
|
//#region ../core/src/comments.ts
|
|
774
|
-
function
|
|
775
|
-
let { provider: t, getTemplateId: n, getUser:
|
|
775
|
+
function Ee(e) {
|
|
776
|
+
let { provider: t, getTemplateId: n, getUser: r } = e, a = i([]), o = i(!1), s = i(!1), c = p(() => typeof t.create == "function"), l = p(() => typeof t.update == "function"), u = p(() => typeof t.delete == "function"), d = p(() => typeof t.setResolved == "function"), f = p(() => a.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), m = p(() => a.value.filter((e) => !e.resolvedAt).length), h = p(() => {
|
|
776
777
|
let e = /* @__PURE__ */ new Map();
|
|
777
778
|
for (let t of a.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
|
|
778
779
|
return e;
|
|
779
780
|
});
|
|
780
781
|
function g(e) {
|
|
781
782
|
let t = n();
|
|
782
|
-
if (!t) throw new
|
|
783
|
+
if (!t) throw new I(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
783
784
|
return t;
|
|
784
785
|
}
|
|
785
786
|
function _(e) {
|
|
786
|
-
let t =
|
|
787
|
-
if (!t) throw new
|
|
787
|
+
let t = r();
|
|
788
|
+
if (!t) throw new I(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
788
789
|
return t;
|
|
789
790
|
}
|
|
790
791
|
function v(e) {
|
|
791
|
-
throw new
|
|
792
|
+
throw new I(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
792
793
|
}
|
|
793
794
|
function y(e) {
|
|
794
795
|
for (let t of a.value) {
|
|
@@ -798,15 +799,15 @@ function se(e) {
|
|
|
798
799
|
return null;
|
|
799
800
|
}
|
|
800
801
|
function b(e) {
|
|
801
|
-
let t =
|
|
802
|
+
let t = r();
|
|
802
803
|
return t !== null && e.author.id === t.id;
|
|
803
804
|
}
|
|
804
805
|
function x(t) {
|
|
805
|
-
let n =
|
|
806
|
+
let n = z(t);
|
|
806
807
|
throw e.onError?.(n), n;
|
|
807
808
|
}
|
|
808
809
|
function S(t) {
|
|
809
|
-
|
|
810
|
+
B(e.onError, t);
|
|
810
811
|
}
|
|
811
812
|
function C(e, t, n) {
|
|
812
813
|
return [
|
|
@@ -856,7 +857,7 @@ function se(e) {
|
|
|
856
857
|
o.value = !1;
|
|
857
858
|
}
|
|
858
859
|
}
|
|
859
|
-
async function
|
|
860
|
+
async function O(e) {
|
|
860
861
|
let { create: n } = t;
|
|
861
862
|
typeof n != "function" && v("create");
|
|
862
863
|
let r = g("create");
|
|
@@ -870,7 +871,7 @@ function se(e) {
|
|
|
870
871
|
s.value = !1;
|
|
871
872
|
}
|
|
872
873
|
}
|
|
873
|
-
async function
|
|
874
|
+
async function k(e, n) {
|
|
874
875
|
let { update: r } = t;
|
|
875
876
|
typeof r != "function" && v("update");
|
|
876
877
|
let i = g("update");
|
|
@@ -884,7 +885,7 @@ function se(e) {
|
|
|
884
885
|
s.value = !1;
|
|
885
886
|
}
|
|
886
887
|
}
|
|
887
|
-
async function
|
|
888
|
+
async function A(e) {
|
|
888
889
|
let { delete: n } = t;
|
|
889
890
|
typeof n != "function" && v("delete");
|
|
890
891
|
let r = g("delete");
|
|
@@ -899,7 +900,7 @@ function se(e) {
|
|
|
899
900
|
s.value = !1;
|
|
900
901
|
}
|
|
901
902
|
}
|
|
902
|
-
async function
|
|
903
|
+
async function j(e, n) {
|
|
903
904
|
let { setResolved: r } = t;
|
|
904
905
|
typeof r != "function" && v("setResolved");
|
|
905
906
|
let i = g("setResolved");
|
|
@@ -913,13 +914,13 @@ function se(e) {
|
|
|
913
914
|
s.value = !1;
|
|
914
915
|
}
|
|
915
916
|
}
|
|
916
|
-
function
|
|
917
|
+
function M(e) {
|
|
917
918
|
T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
|
|
918
919
|
}
|
|
919
|
-
function
|
|
920
|
+
function N(e) {
|
|
920
921
|
T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
|
|
921
922
|
}
|
|
922
|
-
function
|
|
923
|
+
function P(e, n) {
|
|
923
924
|
let r = E(e, n);
|
|
924
925
|
r && S(() => t.onDeleted?.(r, { origin: "remote" }));
|
|
925
926
|
}
|
|
@@ -931,30 +932,30 @@ function se(e) {
|
|
|
931
932
|
canUpdate: l,
|
|
932
933
|
canDelete: u,
|
|
933
934
|
canResolve: d,
|
|
934
|
-
totalCount:
|
|
935
|
+
totalCount: f,
|
|
935
936
|
unresolvedCount: m,
|
|
936
937
|
commentCountByBlock: h,
|
|
937
938
|
load: D,
|
|
938
|
-
create:
|
|
939
|
-
update:
|
|
940
|
-
remove:
|
|
941
|
-
setResolved:
|
|
939
|
+
create: O,
|
|
940
|
+
update: k,
|
|
941
|
+
remove: A,
|
|
942
|
+
setResolved: j,
|
|
942
943
|
find: y,
|
|
943
944
|
isOwn: b,
|
|
944
|
-
applyRemoteCreate:
|
|
945
|
-
applyRemoteUpdate:
|
|
946
|
-
applyRemoteDelete:
|
|
945
|
+
applyRemoteCreate: M,
|
|
946
|
+
applyRemoteUpdate: N,
|
|
947
|
+
applyRemoteDelete: P
|
|
947
948
|
};
|
|
948
949
|
}
|
|
949
|
-
function
|
|
950
|
+
function De(t) {
|
|
950
951
|
let { comments: n, provider: r, getTemplateId: i } = t, { subscribe: a } = r;
|
|
951
952
|
if (typeof a != "function") return;
|
|
952
953
|
let o = null;
|
|
953
|
-
function
|
|
954
|
+
function s() {
|
|
954
955
|
o?.(), o = null;
|
|
955
956
|
}
|
|
956
957
|
e(() => i(), (e) => {
|
|
957
|
-
|
|
958
|
+
s(), e && (o = a(e, (e) => {
|
|
958
959
|
switch (e.type) {
|
|
959
960
|
case "created":
|
|
960
961
|
n.applyRemoteCreate(e.comment);
|
|
@@ -965,22 +966,94 @@ function ce(t) {
|
|
|
965
966
|
case "deleted": n.applyRemoteDelete(e.commentId, e.parentId);
|
|
966
967
|
}
|
|
967
968
|
}));
|
|
968
|
-
}, { immediate: !0 }), s
|
|
969
|
+
}, { immediate: !0 }), c(s);
|
|
970
|
+
}
|
|
971
|
+
//#endregion
|
|
972
|
+
//#region src/composables/useImageUrlResolver.ts
|
|
973
|
+
function Oe(e) {
|
|
974
|
+
let t = s(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
975
|
+
function r(e) {
|
|
976
|
+
return t.get(e);
|
|
977
|
+
}
|
|
978
|
+
function i(e) {
|
|
979
|
+
return t.has(e) || n.has(e);
|
|
980
|
+
}
|
|
981
|
+
function a(r) {
|
|
982
|
+
if (i(r)) return;
|
|
983
|
+
let a;
|
|
984
|
+
try {
|
|
985
|
+
a = e(r);
|
|
986
|
+
} catch {
|
|
987
|
+
t.set(r, null);
|
|
988
|
+
return;
|
|
989
|
+
}
|
|
990
|
+
a === null || typeof a == "string" ? t.set(r, a) : (n.add(r), Promise.resolve(a).then((e) => {
|
|
991
|
+
t.set(r, typeof e == "string" ? e : null);
|
|
992
|
+
}, () => {
|
|
993
|
+
t.set(r, null);
|
|
994
|
+
}).finally(() => n.delete(r)));
|
|
995
|
+
}
|
|
996
|
+
return {
|
|
997
|
+
get: r,
|
|
998
|
+
has: i,
|
|
999
|
+
lookup: a
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
function W(r) {
|
|
1003
|
+
let i = t(ne, null), a = p(r);
|
|
1004
|
+
if (!i) return a;
|
|
1005
|
+
let o;
|
|
1006
|
+
function s() {
|
|
1007
|
+
o !== void 0 && (clearTimeout(o), o = void 0);
|
|
1008
|
+
}
|
|
1009
|
+
n() && c(s);
|
|
1010
|
+
let l = !0;
|
|
1011
|
+
return e(a, (e) => {
|
|
1012
|
+
s();
|
|
1013
|
+
let t = l;
|
|
1014
|
+
l = !1, e && !i.has(e) && (t ? i.lookup(e) : o = setTimeout(() => {
|
|
1015
|
+
o = void 0, i.lookup(e);
|
|
1016
|
+
}, 300));
|
|
1017
|
+
}, { immediate: !0 }), p(() => {
|
|
1018
|
+
let e = a.value;
|
|
1019
|
+
if (!e) return e;
|
|
1020
|
+
let t = i.get(e);
|
|
1021
|
+
return typeof t == "string" && t.length > 0 ? t : e;
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
function ke(e, t) {
|
|
1025
|
+
if (!e || !t) return t;
|
|
1026
|
+
let n = e.get(t);
|
|
1027
|
+
return typeof n == "string" && n.length > 0 ? n : t;
|
|
1028
|
+
}
|
|
1029
|
+
function G(e, t) {
|
|
1030
|
+
return typeof e?.url == "string" && N(e.url, t);
|
|
1031
|
+
}
|
|
1032
|
+
function K(e, t) {
|
|
1033
|
+
let n = e?.url;
|
|
1034
|
+
if (typeof n == "string" && n.trim() !== "") return N(n, t) ? void 0 : n;
|
|
1035
|
+
}
|
|
1036
|
+
function Ae(e) {
|
|
1037
|
+
let n = t(ee, F.liquid), r = W(() => K(e(), n));
|
|
1038
|
+
return p(() => G(e(), n) ? null : r.value);
|
|
1039
|
+
}
|
|
1040
|
+
function je(e, t, n) {
|
|
1041
|
+
return G(t, n) ? null : ke(e, K(t, n));
|
|
969
1042
|
}
|
|
970
1043
|
//#endregion
|
|
971
1044
|
//#region src/utils/blockTypeLabels.ts
|
|
972
|
-
function
|
|
1045
|
+
function q(e, t) {
|
|
973
1046
|
return t.blocks[e] ?? e;
|
|
974
1047
|
}
|
|
975
|
-
function
|
|
976
|
-
if (e.type !== "custom") return
|
|
1048
|
+
function Me(e, t, n = []) {
|
|
1049
|
+
if (e.type !== "custom") return q(e.type, t);
|
|
977
1050
|
let { customType: r } = e;
|
|
978
1051
|
return n.find((e) => e.type === r)?.name ?? r;
|
|
979
1052
|
}
|
|
980
1053
|
//#endregion
|
|
981
1054
|
//#region src/utils/resolveFieldColors.ts
|
|
982
|
-
function
|
|
983
|
-
let n =
|
|
1055
|
+
function Ne(e, t) {
|
|
1056
|
+
let n = oe({ presets: e.presets }, ae), r = n.presets.length === 0;
|
|
984
1057
|
return {
|
|
985
1058
|
presets: r ? t.presets : n.presets,
|
|
986
1059
|
allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
|
|
@@ -991,15 +1064,58 @@ function ue(e, t) {
|
|
|
991
1064
|
};
|
|
992
1065
|
}
|
|
993
1066
|
//#endregion
|
|
1067
|
+
//#region src/utils/imageNaturalSize.ts
|
|
1068
|
+
function J(e) {
|
|
1069
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
1070
|
+
}
|
|
1071
|
+
function Y(e, t) {
|
|
1072
|
+
return J(e) && J(t) ? {
|
|
1073
|
+
width: e,
|
|
1074
|
+
height: t
|
|
1075
|
+
} : null;
|
|
1076
|
+
}
|
|
1077
|
+
function Pe(e) {
|
|
1078
|
+
return Y(e.naturalWidth, e.naturalHeight);
|
|
1079
|
+
}
|
|
1080
|
+
function Fe(e) {
|
|
1081
|
+
return e ? {
|
|
1082
|
+
naturalWidth: e.width,
|
|
1083
|
+
naturalHeight: e.height
|
|
1084
|
+
} : {
|
|
1085
|
+
naturalWidth: void 0,
|
|
1086
|
+
naturalHeight: void 0
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
function X(e, t) {
|
|
1090
|
+
if (typeof Image > "u") return t(null), () => {};
|
|
1091
|
+
let n = new Image(), r = () => {
|
|
1092
|
+
n.onload = null, n.onerror = null;
|
|
1093
|
+
};
|
|
1094
|
+
return n.onload = () => {
|
|
1095
|
+
r(), t(Y(n.naturalWidth, n.naturalHeight));
|
|
1096
|
+
}, n.onerror = () => {
|
|
1097
|
+
r(), t(null);
|
|
1098
|
+
}, n.src = e, r;
|
|
1099
|
+
}
|
|
1100
|
+
function Ie(e) {
|
|
1101
|
+
return new Promise((t) => {
|
|
1102
|
+
let n = setTimeout(() => {
|
|
1103
|
+
r(), t(null);
|
|
1104
|
+
}, re), r = X(e, (e) => {
|
|
1105
|
+
clearTimeout(n), t(e);
|
|
1106
|
+
});
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
//#endregion
|
|
994
1110
|
//#region src/components/MediaDropOverlay.vue
|
|
995
|
-
var
|
|
1111
|
+
var Le = /* @__PURE__ */ a({
|
|
996
1112
|
__name: "MediaDropOverlay",
|
|
997
1113
|
props: {
|
|
998
1114
|
uploading: { type: Boolean },
|
|
999
1115
|
size: { default: "field" }
|
|
1000
1116
|
},
|
|
1001
1117
|
setup(e) {
|
|
1002
|
-
let t = e, { t:
|
|
1118
|
+
let t = e, { t: n } = ie(), i = {
|
|
1003
1119
|
field: {
|
|
1004
1120
|
gap: "tpl:gap-1.5",
|
|
1005
1121
|
icon: 18,
|
|
@@ -1010,41 +1126,41 @@ var $ = /* @__PURE__ */ i({
|
|
|
1010
1126
|
icon: 20,
|
|
1011
1127
|
veil: "85%"
|
|
1012
1128
|
}
|
|
1013
|
-
}, a =
|
|
1014
|
-
return (t, i) => (
|
|
1015
|
-
class:
|
|
1016
|
-
style:
|
|
1017
|
-
}, [e.uploading ? (
|
|
1129
|
+
}, a = p(() => i[t.size]);
|
|
1130
|
+
return (t, i) => (r(), m("div", {
|
|
1131
|
+
class: f(["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)]", a.value.gap]),
|
|
1132
|
+
style: h({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${a.value.veil}, transparent)` })
|
|
1133
|
+
}, [e.uploading ? (r(), m(v, { key: 0 }, [d(u(se), {
|
|
1018
1134
|
class: "tpl-spinner",
|
|
1019
1135
|
size: a.value.icon,
|
|
1020
1136
|
"stroke-width": 2
|
|
1021
|
-
}, null, 8, ["size"]),
|
|
1137
|
+
}, null, 8, ["size"]), b(" " + y(u(n).image.uploading), 1)], 64)) : (r(), m(v, { key: 1 }, [d(u(ce), {
|
|
1022
1138
|
size: a.value.icon,
|
|
1023
1139
|
"stroke-width": 1.5
|
|
1024
|
-
}, null, 8, ["size"]),
|
|
1140
|
+
}, null, 8, ["size"]), b(" " + y(u(n).image.dropToUpload), 1)], 64))], 6));
|
|
1025
1141
|
}
|
|
1026
|
-
}),
|
|
1027
|
-
function
|
|
1028
|
-
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 ||
|
|
1142
|
+
}), Re = "image/";
|
|
1143
|
+
function ze(e) {
|
|
1144
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = L(t, {
|
|
1029
1145
|
preventDefaultForUnhandled: !0,
|
|
1030
1146
|
onDrop: (e) => {
|
|
1031
1147
|
if (!i()) return;
|
|
1032
|
-
let t = (e ?? []).filter((e) => e.type.startsWith(
|
|
1148
|
+
let t = (e ?? []).filter((e) => e.type.startsWith(Re));
|
|
1033
1149
|
t.length > 0 && n([t[0]]);
|
|
1034
1150
|
}
|
|
1035
1151
|
});
|
|
1036
|
-
return { isOver:
|
|
1152
|
+
return { isOver: p(() => i() && a.value) };
|
|
1037
1153
|
}
|
|
1038
1154
|
//#endregion
|
|
1039
1155
|
//#region src/composables/useMediaDropField.ts
|
|
1040
|
-
function
|
|
1041
|
-
let { target: n, blocked:
|
|
1156
|
+
function Be(e) {
|
|
1157
|
+
let { target: n, blocked: r, apply: a } = e, o = t(R, null), s = t(te, null), c = le();
|
|
1042
1158
|
async function l() {
|
|
1043
1159
|
let e = await o?.({ accept: ["images"] });
|
|
1044
1160
|
c.alive && e && a(e);
|
|
1045
1161
|
}
|
|
1046
|
-
let u =
|
|
1047
|
-
async function
|
|
1162
|
+
let u = i(!1), d = p(() => (s?.value ?? !!o) && !u.value && !_(r));
|
|
1163
|
+
async function f(e) {
|
|
1048
1164
|
if (o) {
|
|
1049
1165
|
u.value = !0;
|
|
1050
1166
|
try {
|
|
@@ -1059,11 +1175,11 @@ function pe(e) {
|
|
|
1059
1175
|
}
|
|
1060
1176
|
}
|
|
1061
1177
|
}
|
|
1062
|
-
let { isOver: m } =
|
|
1178
|
+
let { isOver: m } = ze({
|
|
1063
1179
|
target: n,
|
|
1064
1180
|
enabled: d,
|
|
1065
|
-
onFiles:
|
|
1066
|
-
}), h =
|
|
1181
|
+
onFiles: f
|
|
1182
|
+
}), h = p(() => d.value && m.value || u.value);
|
|
1067
1183
|
return {
|
|
1068
1184
|
canBrowse: !!o,
|
|
1069
1185
|
dropEnabled: d,
|
|
@@ -1072,13 +1188,73 @@ function pe(e) {
|
|
|
1072
1188
|
openMediaBrowser: l
|
|
1073
1189
|
};
|
|
1074
1190
|
}
|
|
1191
|
+
function Ve(e, t = "desktop") {
|
|
1192
|
+
return t === "mobile" ? 375 : e?.width ?? 600;
|
|
1193
|
+
}
|
|
1194
|
+
var He = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", Ue = {
|
|
1195
|
+
1: [100],
|
|
1196
|
+
2: [50, 50],
|
|
1197
|
+
3: [
|
|
1198
|
+
33.33,
|
|
1199
|
+
33.33,
|
|
1200
|
+
33.34
|
|
1201
|
+
],
|
|
1202
|
+
"1-2": [33.33, 66.67],
|
|
1203
|
+
"2-1": [66.67, 33.33]
|
|
1204
|
+
};
|
|
1205
|
+
function Z(e, t) {
|
|
1206
|
+
let n = (e) => Math.trunc(e ?? 0), r = (e) => T(e) === null ? 0 : Math.trunc(e.width);
|
|
1207
|
+
return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
|
|
1208
|
+
}
|
|
1209
|
+
function We(e, t) {
|
|
1210
|
+
return Math.floor(e) - Z(t);
|
|
1211
|
+
}
|
|
1212
|
+
function Ge(e, t) {
|
|
1213
|
+
let n = "border" in e ? e.border : void 0;
|
|
1214
|
+
return Math.floor(t) - Z(e.styles.padding, n);
|
|
1215
|
+
}
|
|
1216
|
+
function* Q(e, t) {
|
|
1217
|
+
for (let n of e) M(n) ? yield* Q(n.children, We(t, n.styles.padding)) : yield {
|
|
1218
|
+
block: n,
|
|
1219
|
+
bandWidth: A(n) && n.wrapper ? We(t, n.wrapper.padding) : t
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
function Ke(e, t) {
|
|
1223
|
+
if (!t) return e;
|
|
1224
|
+
try {
|
|
1225
|
+
return D(t, e);
|
|
1226
|
+
} catch {
|
|
1227
|
+
return e;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
function qe(e, t, n) {
|
|
1231
|
+
let r = Ke(e, n);
|
|
1232
|
+
for (let { block: e, bandWidth: n } of Q(r.blocks, r.settings.width)) if (A(e)) {
|
|
1233
|
+
let r = E(e)?.applied ? void 0 : e.border, i = Math.floor(n) - Z(e.styles.padding, r), a = Ue[e.columns] ?? [100];
|
|
1234
|
+
for (let n = 0; n < e.children.length; n++) {
|
|
1235
|
+
let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
|
|
1236
|
+
if (o) return Ge(o, r);
|
|
1237
|
+
}
|
|
1238
|
+
} else if (e.id === t) return Ge(e, n);
|
|
1239
|
+
return null;
|
|
1240
|
+
}
|
|
1241
|
+
function $(e, t, n) {
|
|
1242
|
+
let r = Ke(e, n);
|
|
1243
|
+
for (let { block: e, bandWidth: n } of Q(r.blocks, r.settings.width)) if (e.id === t) return Math.floor(n);
|
|
1244
|
+
return null;
|
|
1245
|
+
}
|
|
1246
|
+
function Je(e, t, n) {
|
|
1247
|
+
if (!A(e)) return;
|
|
1248
|
+
let r = E(e);
|
|
1249
|
+
if (r?.applied && r.height === "image") return (t ? $(t, e.id, n) : null) ?? Ve(t?.settings);
|
|
1250
|
+
}
|
|
1075
1251
|
//#endregion
|
|
1076
1252
|
//#region src/constants/socialIcons.ts
|
|
1077
|
-
var
|
|
1253
|
+
var Ye = j, Xe = {
|
|
1078
1254
|
small: 24,
|
|
1079
1255
|
medium: 32,
|
|
1080
1256
|
large: 48
|
|
1081
|
-
},
|
|
1257
|
+
}, Ze = [
|
|
1082
1258
|
"facebook",
|
|
1083
1259
|
"twitter",
|
|
1084
1260
|
"instagram",
|
|
@@ -1098,6 +1274,6 @@ var me = E, he = {
|
|
|
1098
1274
|
"behance"
|
|
1099
1275
|
];
|
|
1100
1276
|
//#endregion
|
|
1101
|
-
export {
|
|
1277
|
+
export { ve as A, W as C, we as D, Te as E, me as F, pe as I, ue as L, ge as M, U as N, xe as O, he as P, Ae as S, Ee as T, Me as _, Je as a, K as b, Ve as c, X as d, Ie as f, Ne as g, Y as h, qe as i, _e as j, ye as k, Be as l, Pe as m, Ye as n, $ as o, Fe as p, Ze as r, He as s, Xe as t, Le as u, q as v, De as w, je as x, Oe as y };
|
|
1102
1278
|
|
|
1103
|
-
//# sourceMappingURL=socialIcons-
|
|
1279
|
+
//# sourceMappingURL=socialIcons-C_lnkpG6.js.map
|