@templatical/editor 0.52.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/AiAltTextPopover-NMJqQKvD.js +106 -0
- package/dist/{AiAltTextReview-DE8t8Rud.js → AiAltTextReview-Ci4zHwRc.js} +68 -66
- package/dist/{AiChatPanel-7ftS7d40.js → AiChatPanel-DdhtfsmO.js} +223 -210
- package/dist/{AiPanels-CxGp6klr.js → AiPanels-HBx7xoJR.js} +6 -6
- package/dist/{AiRewriteMenu-DNI-5CUj.js → AiRewriteMenu-DPzSekZt.js} +78 -107
- package/dist/BlockIssueBadge-eIXZJ9M3.js +33 -0
- package/dist/BlockPreviewCanvas-DO-2TP_6.js +140 -0
- package/dist/{CloudHeaderExtras-CsgyNNV1.js → CloudHeaderExtras-XpjJjn3o.js} +4 -4
- package/dist/{CloudPanels-BDV4XQ_l.js → CloudPanels-i2kZdrdP.js} +44 -44
- package/dist/CollaborationNotices-DANsjl7c.js +65 -0
- package/dist/{CollaboratorBar-EeqqWcX6.js → CollaboratorBar-CbbAA0m1.js} +24 -24
- package/dist/CommentsPanel-CYW3LWis.js +16 -0
- package/dist/CommentsSidebar-CcF4ISMi.js +526 -0
- package/dist/{CountdownBlock-BT3ZTH1F.js → CountdownBlock-BMezkFbJ.js} +21 -21
- package/dist/CountdownToolbar-D3Lv74kU.js +258 -0
- package/dist/{IssuesPanel-BHFQ3wrP.js → IssuesPanel-BMAG9042.js} +141 -129
- package/dist/LanguageMenu-FlP_Jbup.js +403 -0
- package/dist/{LoadingTrack-DZA5AoP9.js → LoadingTrack-BG8cg9xi.js} +2 -2
- package/dist/LocaleNotices-DAnVszWu.js +46 -0
- package/dist/{LogicTagInsertButton-CSD9cfJB.js → LogicTagInsertButton-BjYs-UQX.js} +439 -430
- package/dist/{MediaEditModal-DQl5w44r.js → MediaEditModal-LnG-cF_S.js} +160 -160
- package/dist/{MediaPanels-BFWYuJot.js → MediaPanels-C2r5fiFo.js} +4 -4
- package/dist/{cdn/chunks/MergeTagInput-CFu9VXPS.js → MergeTagInput-BsnogCeY.js} +32 -34
- package/dist/{MergeTagModeToggle-DvD0ne7N.js → MergeTagModeToggle-DiufIQ-_.js} +49 -49
- package/dist/MergeTagTextarea-BweI-Xsi.js +126 -0
- package/dist/{ParagraphEditor-D-nqs82g.js → ParagraphEditor-qgBp5yIB.js} +286 -257
- package/dist/{RestoreVersionDialog-DqUPsLB9.js → RestoreVersionDialog-DdYUrFiK.js} +23 -23
- package/dist/{RichTextEditorContent-Xq9D0Zs3.js → RichTextEditorContent-C5MAzx3E.js} +54 -53
- package/dist/{SaveBlockDialog-DAPv70p4.js → SaveBlockDialog-eK6fjtTy.js} +86 -86
- package/dist/SavedBlocksBrowserModal-D2QHd2Yp.js +359 -0
- package/dist/{SavedBlocksPanels-ChbL9v9x.js → SavedBlocksPanels-Cl61f4Mf.js} +9 -9
- package/dist/{SavedBlocksPickBar-hRaiLNdu.js → SavedBlocksPickBar-CXP2dkeB.js} +15 -15
- package/dist/TemplateSettings-BKJrdZcH.js +294 -0
- package/dist/TestEmailModal-DQotJg6g.js +212 -0
- package/dist/{TestEmailPanel-COJQa2A9.js → TestEmailPanel-CwiTzJsh.js} +4 -4
- package/dist/TitleEditor-CzSvsPAn.js +202 -0
- package/dist/ToggleSwitch-R3wCCYE6.js +43 -0
- package/dist/Toolbar-Cd75ci5W.js +3711 -0
- package/dist/{TplModal-9IndEYk5.js → TplModal-ZoXu40T9.js} +17 -17
- package/dist/{VersionHistoryMenu-BG5qayvg.js → VersionHistoryMenu-BvhN-Ofk.js} +39 -39
- package/dist/{VersionHistoryPanels-hPg7Q5-f.js → VersionHistoryPanels-DPWMnYbd.js} +5 -5
- package/dist/VersionPreviewBanner-CuJnasxH.js +37 -0
- package/dist/WrapperBlock-D4fPwO0t.js +44 -0
- package/dist/{blockTypeIcons-yt7SLzub.js → blockTypeIcons-BXMxu86H.js} +27 -26
- package/dist/bundle-stats.json +8 -8
- package/dist/{cdn/chunks/ca-CD-Kt1qz.js → ca-DOuIxWRv.js} +114 -2
- package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js +107 -0
- package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js.map +1 -0
- package/dist/cdn/chunks/{AiAltTextReview-BafAtBoA.js → AiAltTextReview-Dtm3A2cD.js} +71 -69
- package/dist/cdn/chunks/AiAltTextReview-Dtm3A2cD.js.map +1 -0
- package/dist/cdn/chunks/AiChatPanel-DciEt27y.js +487 -0
- package/dist/cdn/chunks/AiChatPanel-DciEt27y.js.map +1 -0
- package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js → AiPanels-BV5D1itk.js} +11 -11
- package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js.map → AiPanels-BV5D1itk.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-4F6vwhJ5.js → AiRewriteMenu-D3jkh6Xb.js} +80 -80
- package/dist/cdn/chunks/AiRewriteMenu-D3jkh6Xb.js.map +1 -0
- package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js +34 -0
- package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js.map +1 -0
- package/dist/cdn/chunks/BlockPreviewCanvas-RQFilqXC.js +142 -0
- package/dist/cdn/chunks/{BlockPreviewCanvas-Ny1X_mee.js.map → BlockPreviewCanvas-RQFilqXC.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js → CloudHeaderExtras-BtqdN777.js} +4 -4
- package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js.map → CloudHeaderExtras-BtqdN777.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js → CloudPanels-BSJ-Z5Hw.js} +43 -43
- package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js.map → CloudPanels-BSJ-Z5Hw.js.map} +1 -1
- package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js +67 -0
- package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js → CollaboratorBar-Bc9914Az.js} +16 -16
- package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js.map → CollaboratorBar-Bc9914Az.js.map} +1 -1
- package/dist/cdn/chunks/CommentsPanel-DbR9phAk.js +18 -0
- package/dist/cdn/chunks/{CommentsPanel-CAiwilM2.js.map → CommentsPanel-DbR9phAk.js.map} +1 -1
- package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js +496 -0
- package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js → CountdownBlock-CjMhMhnv.js} +26 -26
- package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js.map → CountdownBlock-CjMhMhnv.js.map} +1 -1
- package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js +260 -0
- package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-pr7_nuLI.js → IssuesPanel-CUmI4HMm.js} +132 -120
- package/dist/cdn/chunks/IssuesPanel-CUmI4HMm.js.map +1 -0
- package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js +359 -0
- package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js.map +1 -0
- package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js → LoadingTrack-DUYcDHOV.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js.map → LoadingTrack-DUYcDHOV.js.map} +1 -1
- package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js +47 -0
- package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js.map +1 -0
- package/dist/cdn/chunks/{LogicTagInsertButton-B_ldj3TO.js → LogicTagInsertButton-5Z3fFzjc.js} +465 -456
- package/dist/cdn/chunks/LogicTagInsertButton-5Z3fFzjc.js.map +1 -0
- package/dist/cdn/chunks/{MediaEditModal-CGfzcHwP.js → MediaEditModal-DDCIwr9U.js} +439 -439
- package/dist/cdn/chunks/MediaEditModal-DDCIwr9U.js.map +1 -0
- package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js → MediaPanels-Dz79oy8P.js} +5 -5
- package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js.map → MediaPanels-Dz79oy8P.js.map} +1 -1
- package/dist/cdn/chunks/MergeTagInput-CIWy-cXf.js +82 -0
- package/dist/cdn/chunks/{MergeTagInput-CFu9VXPS.js.map → MergeTagInput-CIWy-cXf.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BFpK5dxg.js → MergeTagModeToggle-BrP5GR-x.js} +50 -50
- package/dist/cdn/chunks/MergeTagModeToggle-BrP5GR-x.js.map +1 -0
- package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js +128 -0
- package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js +660 -0
- package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js → RestoreVersionDialog-Crj1DBqC.js} +18 -18
- package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js.map → RestoreVersionDialog-Crj1DBqC.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js → RichTextEditorContent-rCCqFlwJ.js} +43 -43
- package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js.map → RichTextEditorContent-rCCqFlwJ.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js → SaveBlockDialog-C34RW1aM.js} +71 -71
- package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js.map → SaveBlockDialog-C34RW1aM.js.map} +1 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-CJnwWPT-.js +356 -0
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-B9XCjDfm.js.map → SavedBlocksBrowserModal-CJnwWPT-.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js → SavedBlocksPanels-CA2PqXIH.js} +9 -9
- package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js.map → SavedBlocksPanels-CA2PqXIH.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js → SavedBlocksPickBar-Dj3ortee.js} +16 -16
- package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js.map → SavedBlocksPickBar-Dj3ortee.js.map} +1 -1
- package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js +266 -0
- package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailModal-DcwKhFnI.js → TestEmailModal-BXeCtTjU.js} +81 -78
- package/dist/cdn/chunks/TestEmailModal-BXeCtTjU.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js → TestEmailPanel-CpZcpB9D.js} +5 -5
- package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js.map → TestEmailPanel-CpZcpB9D.js.map} +1 -1
- package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js +202 -0
- package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js.map +1 -0
- package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js +45 -0
- package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js.map +1 -0
- package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js +3626 -0
- package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-BDyeS69p.js → TplModal-DDDUDMYC.js} +19 -19
- package/dist/cdn/chunks/{TplModal-BDyeS69p.js.map → TplModal-DDDUDMYC.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js → VersionHistoryMenu-DSElv3Sv.js} +36 -36
- package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js.map → VersionHistoryMenu-DSElv3Sv.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js → VersionHistoryPanels-H2nuik1l.js} +6 -6
- package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js.map → VersionHistoryPanels-H2nuik1l.js.map} +1 -1
- package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js +39 -0
- package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js.map +1 -0
- package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js +46 -0
- package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-DMgLcuI8.js +21 -0
- package/dist/cdn/chunks/blockTypeIcons-DMgLcuI8.js.map +1 -0
- package/dist/{ca-CD-Kt1qz.js → cdn/chunks/ca-DOuIxWRv.js} +116 -0
- package/dist/cdn/chunks/ca-DOuIxWRv.js.map +1 -0
- package/dist/cdn/chunks/composables-D0UYam2P.js +3039 -0
- package/dist/cdn/chunks/composables-D0UYam2P.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-D6niZ2Rc.js → createCloudRuntime-BdsclY8_.js} +85 -83
- package/dist/cdn/chunks/createCloudRuntime-BdsclY8_.js.map +1 -0
- package/dist/{de-CeFJ6wbM.js → cdn/chunks/de-DaOUfYBX.js} +116 -0
- package/dist/cdn/chunks/de-DaOUfYBX.js.map +1 -0
- package/dist/{dist-CEdyyDn7.js → cdn/chunks/dist-BzXULHvI.js} +63 -61
- package/dist/cdn/chunks/{dist-C2epoAwW.js.map → dist-BzXULHvI.js.map} +1 -1
- package/dist/{dist-BA-jTQgw.js → cdn/chunks/dist-DqGgijFI.js} +108 -109
- package/dist/cdn/chunks/{dist-CONcGNwy.js.map → dist-DqGgijFI.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-B8hTTYFO.js → draggable-DepKdldn.js} +1384 -1376
- package/dist/cdn/chunks/draggable-DepKdldn.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js → editor-modal-CPbgthOv.js} +986 -986
- package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js.map → editor-modal-CPbgthOv.js.map} +1 -1
- package/dist/{en-D14i5nFh.js → cdn/chunks/en-C0pHHMiR.js} +116 -0
- package/dist/cdn/chunks/en-C0pHHMiR.js.map +1 -0
- package/dist/cdn/chunks/en-IYVryJRl.js +1 -0
- package/dist/{es-zDacbMhs.js → cdn/chunks/es-CxyEKr6n.js} +116 -0
- package/dist/cdn/chunks/es-CxyEKr6n.js.map +1 -0
- package/dist/cdn/chunks/{extensions-ClDhn88e.js → extensions-Uh9vuFfK.js} +57 -57
- package/dist/cdn/chunks/{extensions-ClDhn88e.js.map → extensions-Uh9vuFfK.js.map} +1 -1
- package/dist/{fr-CSgYtjOd.js → cdn/chunks/fr-CYbamiI6.js} +116 -0
- package/dist/cdn/chunks/fr-CYbamiI6.js.map +1 -0
- package/dist/cdn/chunks/{icons-HCBP93Ch.js → icons-CSSMtbGK.js} +187 -144
- package/dist/cdn/chunks/icons-CSSMtbGK.js.map +1 -0
- package/dist/{ja-B7H3ID8O.js → cdn/chunks/ja-DfaIAoGI.js} +116 -0
- package/dist/cdn/chunks/ja-DfaIAoGI.js.map +1 -0
- package/dist/cdn/chunks/keys-CoQtCqNv.js +11 -0
- package/dist/cdn/chunks/keys-CoQtCqNv.js.map +1 -0
- package/dist/cdn/chunks/languageName-DEEOhDWI.js +12 -0
- package/dist/cdn/chunks/languageName-DEEOhDWI.js.map +1 -0
- package/dist/cdn/chunks/{liquid.browser-DkLBNrft.js → liquid.browser-rubac0VA.js} +782 -746
- package/dist/cdn/chunks/liquid.browser-rubac0VA.js.map +1 -0
- package/dist/{nl-176ySmc5.js → cdn/chunks/nl-DkrB-VKZ.js} +116 -0
- package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +1 -0
- package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js +290 -0
- package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js.map +1 -0
- package/dist/cdn/chunks/noticeTones-D7BPu-Le.js +16 -0
- package/dist/cdn/chunks/noticeTones-D7BPu-Le.js.map +1 -0
- package/dist/cdn/chunks/plural-CyxrJXL1.js +17 -0
- package/dist/cdn/chunks/plural-CyxrJXL1.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js → preRenderCustomBlocks-C8k7tw98.js} +5 -5
- package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js.map → preRenderCustomBlocks-C8k7tw98.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +115 -1
- package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +1 -0
- package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js +61 -0
- package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js.map +1 -0
- package/dist/cdn/chunks/socialIcons-BAiuHyJs.js +2638 -0
- package/dist/cdn/chunks/socialIcons-BAiuHyJs.js.map +1 -0
- package/dist/cdn/chunks/src-CACM3o--.js +2606 -0
- package/dist/cdn/chunks/src-CACM3o--.js.map +1 -0
- package/dist/cdn/chunks/{src-CUH_EI7k.js → src-Ddpm4HsS.js} +225 -259
- package/dist/cdn/chunks/src-Ddpm4HsS.js.map +1 -0
- package/dist/cdn/chunks/{src-BKpAis_q.js → src-DheBmnvF.js} +635 -478
- package/dist/cdn/chunks/src-DheBmnvF.js.map +1 -0
- package/dist/{styleConstants-B8xVRiwX.js → cdn/chunks/styleConstants-CgiNKdnc.js} +7 -5
- package/dist/cdn/chunks/styleConstants-CgiNKdnc.js.map +1 -0
- package/dist/cdn/chunks/templateSettingsFields-cjlP-jdw.js.map +1 -1
- package/dist/cdn/chunks/{tiptap-ChSZybTi.js → tiptap-Dipw_zOQ.js} +48 -48
- package/dist/cdn/chunks/{tiptap-ChSZybTi.js.map → tiptap-Dipw_zOQ.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js → useCloudI18n-Cc5NZqiI.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js.map → useCloudI18n-Cc5NZqiI.js.map} +1 -1
- package/dist/cdn/chunks/useEditorRoot-D_LuZ_hE.js +9 -0
- package/dist/cdn/chunks/{useEditorRoot-BT3c9CXj.js.map → useEditorRoot-D_LuZ_hE.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-11iqzC6m.js → useI18n-BnJYydPv.js} +3 -3
- package/dist/cdn/chunks/{useI18n-11iqzC6m.js.map → useI18n-BnJYydPv.js.map} +1 -1
- package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js +33 -0
- package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js.map +1 -0
- package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js → useLogicTag-B7RpqVFQ.js} +5 -5
- package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js.map → useLogicTag-B7RpqVFQ.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js → useMergeTag-C-32ETjj.js} +6 -6
- package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js.map → useMergeTag-C-32ETjj.js.map} +1 -1
- package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js +78 -0
- package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js.map +1 -0
- package/dist/cdn/chunks/{useScrollToBlock-C0dawxGr.js → useScrollToBlock-Ct1AwLD-.js} +5 -5
- package/dist/cdn/chunks/useScrollToBlock-Ct1AwLD-.js.map +1 -0
- package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js → withCurrentFont-D33ZXoWp.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js.map → withCurrentFont-D33ZXoWp.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +2503 -1809
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-N3x4z_rH.js → check-ChQ0l8EQ.js} +1 -1
- package/dist/{chevron-down-gXu9qNwO.js → chevron-down-Bh6cp6PI.js} +1 -1
- package/dist/{chevron-right-rL0ayGk5.js → chevron-right-LUgdqdoW.js} +1 -1
- package/dist/{chevron-up-0ugh8HnW.js → chevron-up-XsDeJxQN.js} +1 -1
- package/dist/{circle-alert-B9Ls75B5.js → circle-alert-lODfDsrj.js} +1 -1
- package/dist/{clock-BqHBaCLm.js → clock-DrqFEZkT.js} +1 -1
- package/dist/composables-BOP3ERRP.js +4517 -0
- package/dist/{createCloudRuntime-B5VIdnwz.js → createCloudRuntime-DGV5a5Af.js} +47 -45
- package/dist/{createLucideIcon-BV7Gwz_Z.js → createLucideIcon-Dw5e5gVE.js} +16 -16
- package/dist/{cdn/chunks/de-CeFJ6wbM.js → de-DaOUfYBX.js} +114 -2
- package/dist/{cdn/chunks/dist-CONcGNwy.js → dist-0alKVRc_.js} +100 -99
- package/dist/{dist-Cy8I5scI.js → dist-54VCNoC0.js} +2 -2
- package/dist/dist-6DU0me3E.js +4 -0
- package/dist/{dist-p3wymUDt.js → dist-B8dY8drK.js} +2 -2
- package/dist/{dist-Dd5MU2Ev.js → dist-B9a7iVye.js} +2 -2
- package/dist/{dist-V7W1UhVr.js → dist-BWflWcpW.js} +2 -2
- package/dist/{dist-D6fZec6r.js → dist-C3hu_C3w.js} +2 -2
- package/dist/{cdn/chunks/dist-C2epoAwW.js → dist-CX7skkvG.js} +29 -31
- package/dist/dist-CcOn7WCo.js +4 -0
- package/dist/dist-Cdkm20M6.js +2542 -0
- package/dist/{dist-BS5uKktL.js → dist-ChOb5XHW.js} +2 -2
- package/dist/{dist-BF5zEHop.js → dist-DZ3X-uB8.js} +2 -2
- package/dist/{dist-CWSG7Kj0.js → dist-D_XrUEET.js} +5 -5
- package/dist/{dist-txQLT2sF.js → dist-TAv500j6.js} +2 -2
- package/dist/{dist-DDN7yR-w.js → dist-fqSers8_.js} +131 -131
- package/dist/{editor-modal-Du9VI9q4.js → editor-modal-B_2EAOjN.js} +907 -906
- package/dist/{cdn/chunks/en-D14i5nFh.js → en-C0pHHMiR.js} +114 -2
- package/dist/en-DTtwco2Q.js +1 -0
- package/dist/{cdn/chunks/es-zDacbMhs.js → es-CxyEKr6n.js} +114 -2
- package/dist/{extensions-FRYhx7qa.js → extensions-DOLZkLzV.js} +173 -173
- package/dist/{eye-BKj9Tfnc.js → eye-DChfk0gi.js} +1 -1
- package/dist/{cdn/chunks/fr-CSgYtjOd.js → fr-CYbamiI6.js} +114 -2
- package/dist/{image-DNdvdTla.js → image--Hj2by1G.js} +1 -1
- package/dist/index.d.ts +182 -14
- package/dist/{info-Bx-kBkbH.js → info-BbXgy82f.js} +1 -1
- package/dist/{cdn/chunks/ja-B7H3ID8O.js → ja-DfaIAoGI.js} +114 -2
- package/dist/keys-BCqskl51.js +9 -0
- package/dist/languageName-DEEOhDWI.js +10 -0
- package/dist/{link-D8-rYdIQ.js → link-C2_8yJno.js} +1 -1
- package/dist/{liquid.browser-D1RxawkY.js → liquid.browser-DUXEekoN.js} +781 -745
- package/dist/{list-BneisA27.js → list-DLGs2n0V.js} +1 -1
- package/dist/{loader-circle-DBEXphyx.js → loader-circle-BbDItE_O.js} +1 -1
- package/dist/{message-circle-Bg4xInCM.js → message-circle-NAModq0p.js} +1 -1
- package/dist/{cdn/chunks/nl-176ySmc5.js → nl-DkrB-VKZ.js} +114 -2
- package/dist/normalizeMergeTagMarkup-CUCo7B5X.js +288 -0
- package/dist/noticeTones-D7BPu-Le.js +14 -0
- package/dist/{package-B40Vkfsp.js → package-BuzsfRyH.js} +1 -1
- package/dist/{pencil-CYdAHTds.js → pencil-BTUUECH4.js} +1 -1
- package/dist/plural-CyxrJXL1.js +15 -0
- package/dist/plus-Dm7DN65T.js +13 -0
- package/dist/{preRenderCustomBlocks-AbZArwkR.js → preRenderCustomBlocks-Bs3N9no-.js} +4 -4
- package/dist/{pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +114 -0
- package/dist/{refresh-cw-Bb1FWrU0.js → refresh-cw-xMURqGWi.js} +2 -12
- package/dist/rotate-ccw-DqVcEIn5.js +13 -0
- package/dist/{runtime-dom.esm-bundler-CLGymEyk.js → runtime-dom.esm-bundler-DlHp8xgy.js} +167 -167
- package/dist/sanitizeHtml-mKgNUdME.js +962 -0
- package/dist/{search-BZEo08gi.js → search-Cfr3W44N.js} +1 -1
- package/dist/{send-DHtrnXQs.js → send-CH1SrvyB.js} +1 -1
- package/dist/{smartphone-dlN3vpA3.js → smartphone-pAkvzjdI.js} +1 -1
- package/dist/socialIcons-Dqr4DJOz.js +2705 -0
- package/dist/{sparkles-NOttoDnJ.js → sparkles-CRO0cCnp.js} +1 -1
- package/dist/{square-B1CJgdt2.js → square-CaQWMntx.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{cdn/chunks/styleConstants-B8xVRiwX.js → styleConstants-CgiNKdnc.js} +5 -7
- package/dist/templatical-editor.js +2294 -1608
- package/dist/{text-align-start-zpoXmb-Z.js → text-align-start-BQ39AaRK.js} +1 -1
- package/dist/{trash-CGbk4Sgt.js → trash-BL5gEFHN.js} +1 -1
- package/dist/{triangle-alert-CKLMyGVp.js → triangle-alert-BYbKu7zZ.js} +1 -1
- package/dist/{upload-DQoackAn.js → upload-BhmL4Vqx.js} +1 -1
- package/dist/{useCloudI18n-DcLtxOQZ.js → useCloudI18n-Dh2iydo1.js} +4 -4
- package/dist/useEditorRoot-DY3mgcHm.js +7 -0
- package/dist/{useI18n-CeTm777E.js → useI18n-CgtvtF4C.js} +4 -4
- package/dist/useLocalizedDisplay-DNNwDRxL.js +31 -0
- package/dist/{useLogicTag-DFDYJeMN.js → useLogicTag-BXXXQQmi.js} +4 -4
- package/dist/{useMergeTag-B46vACAG.js → useMergeTag-C9Okr87y.js} +5 -5
- package/dist/usePopoverPosition-VDQjyX_A.js +76 -0
- package/dist/{useScrollToBlock-C-NzvjeO.js → useScrollToBlock-C0Kapxdh.js} +5 -5
- package/dist/{vue.runtime.esm-bundler-CrlI8j5R.js → vue.runtime.esm-bundler-BJXc_Mri.js} +1247 -1239
- package/dist/withCurrentFont-DJiQqZzL.js +18 -0
- package/dist/{x-zcrnmcmU.js → x-B7NZYzhx.js} +1 -1
- package/package.json +23 -23
- package/dist/AiAltTextPopover-Cm11CsKH.js +0 -105
- package/dist/BlockIssueBadge-6Ri2FfX-.js +0 -33
- package/dist/BlockPreviewCanvas-Df9iz7sK.js +0 -140
- package/dist/CollaborationNotices-JQ3vQoqO.js +0 -75
- package/dist/CommentsPanel-BuftXc0U.js +0 -16
- package/dist/CommentsSidebar-Co3x4uH0.js +0 -499
- package/dist/CountdownToolbar-CrL4WKy9.js +0 -197
- package/dist/MergeTagInput-DE7kWwXx.js +0 -80
- package/dist/MergeTagTextarea-DVPQkiYY.js +0 -69
- package/dist/SavedBlocksBrowserModal-SRtN5h9q.js +0 -359
- package/dist/TemplateSettings-D0XcH32O.js +0 -236
- package/dist/TestEmailModal-Cb5t0yB2.js +0 -209
- package/dist/TitleEditor-BYk_9SpQ.js +0 -198
- package/dist/ToggleSwitch-poGWbduy.js +0 -36
- package/dist/Toolbar-Dku_pZni.js +0 -3145
- package/dist/VersionPreviewBanner-CSs7zum_.js +0 -37
- package/dist/WrapperBlock-DwjK_IdJ.js +0 -44
- package/dist/cdn/chunks/AiAltTextPopover-DjMoJCgU.js +0 -106
- package/dist/cdn/chunks/AiAltTextPopover-DjMoJCgU.js.map +0 -1
- package/dist/cdn/chunks/AiAltTextReview-BafAtBoA.js.map +0 -1
- package/dist/cdn/chunks/AiChatPanel-DXeZgc7D.js +0 -474
- package/dist/cdn/chunks/AiChatPanel-DXeZgc7D.js.map +0 -1
- package/dist/cdn/chunks/AiRewriteMenu-4F6vwhJ5.js.map +0 -1
- package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js +0 -34
- package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js.map +0 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-Ny1X_mee.js +0 -142
- package/dist/cdn/chunks/CollaborationNotices-Hf8r08Sw.js +0 -77
- package/dist/cdn/chunks/CollaborationNotices-Hf8r08Sw.js.map +0 -1
- package/dist/cdn/chunks/CommentsPanel-CAiwilM2.js +0 -18
- package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js +0 -469
- package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-CguFJdqn.js +0 -199
- package/dist/cdn/chunks/CountdownToolbar-CguFJdqn.js.map +0 -1
- package/dist/cdn/chunks/IssuesPanel-pr7_nuLI.js.map +0 -1
- package/dist/cdn/chunks/LogicTagInsertButton-B_ldj3TO.js.map +0 -1
- package/dist/cdn/chunks/MediaEditModal-CGfzcHwP.js.map +0 -1
- package/dist/cdn/chunks/MergeTagModeToggle-BFpK5dxg.js.map +0 -1
- package/dist/cdn/chunks/MergeTagTextarea-Zo0mYWbf.js +0 -71
- package/dist/cdn/chunks/MergeTagTextarea-Zo0mYWbf.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js +0 -631
- package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-B9XCjDfm.js +0 -356
- package/dist/cdn/chunks/TemplateSettings-jWpmuWDR.js +0 -208
- package/dist/cdn/chunks/TemplateSettings-jWpmuWDR.js.map +0 -1
- package/dist/cdn/chunks/TestEmailModal-DcwKhFnI.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js +0 -198
- package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js.map +0 -1
- package/dist/cdn/chunks/ToggleSwitch-BDMugNES.js +0 -38
- package/dist/cdn/chunks/ToggleSwitch-BDMugNES.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-CnvfW72e.js +0 -3061
- package/dist/cdn/chunks/Toolbar-CnvfW72e.js.map +0 -1
- package/dist/cdn/chunks/VersionPreviewBanner-CZ--HOoa.js +0 -39
- package/dist/cdn/chunks/VersionPreviewBanner-CZ--HOoa.js.map +0 -1
- package/dist/cdn/chunks/WrapperBlock-D3obNGab.js +0 -46
- package/dist/cdn/chunks/WrapperBlock-D3obNGab.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js +0 -21
- package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js.map +0 -1
- package/dist/cdn/chunks/ca-CD-Kt1qz.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-D6niZ2Rc.js.map +0 -1
- package/dist/cdn/chunks/de-CeFJ6wbM.js.map +0 -1
- package/dist/cdn/chunks/draggable-B8hTTYFO.js.map +0 -1
- package/dist/cdn/chunks/en-CKAXAo3Z.js +0 -1
- package/dist/cdn/chunks/en-D14i5nFh.js.map +0 -1
- package/dist/cdn/chunks/es-zDacbMhs.js.map +0 -1
- package/dist/cdn/chunks/fr-CSgYtjOd.js.map +0 -1
- package/dist/cdn/chunks/icons-HCBP93Ch.js.map +0 -1
- package/dist/cdn/chunks/ja-B7H3ID8O.js.map +0 -1
- package/dist/cdn/chunks/keys-BF9gazbd.js +0 -11
- package/dist/cdn/chunks/keys-BF9gazbd.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-DkLBNrft.js.map +0 -1
- package/dist/cdn/chunks/nl-176ySmc5.js.map +0 -1
- package/dist/cdn/chunks/normalizeMergeTagMarkup-DpHCSESZ.js +0 -198
- package/dist/cdn/chunks/normalizeMergeTagMarkup-DpHCSESZ.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-dDlTwX18.js.map +0 -1
- package/dist/cdn/chunks/sanitizeHtml-B2h15u0_.js +0 -72
- package/dist/cdn/chunks/sanitizeHtml-B2h15u0_.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-rJoqO1TJ.js +0 -2008
- package/dist/cdn/chunks/socialIcons-rJoqO1TJ.js.map +0 -1
- package/dist/cdn/chunks/src-BKpAis_q.js.map +0 -1
- package/dist/cdn/chunks/src-C9DTvn1H.js +0 -1423
- package/dist/cdn/chunks/src-C9DTvn1H.js.map +0 -1
- package/dist/cdn/chunks/src-CUH_EI7k.js.map +0 -1
- package/dist/cdn/chunks/styleConstants-B8xVRiwX.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-CjaEV_01.js +0 -2534
- package/dist/cdn/chunks/useEditorCore-CjaEV_01.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-BT3c9CXj.js +0 -9
- package/dist/cdn/chunks/usePopoverPosition-AnVIwiVv.js +0 -70
- package/dist/cdn/chunks/usePopoverPosition-AnVIwiVv.js.map +0 -1
- package/dist/cdn/chunks/useScrollToBlock-C0dawxGr.js.map +0 -1
- package/dist/dist-CzrLYq2s.js +0 -1363
- package/dist/dist-DyFArF_G.js +0 -4
- package/dist/dist-pA3ooG6N.js +0 -4
- package/dist/en-CyEE7FPY.js +0 -1
- package/dist/keys-DBjrQkYH.js +0 -9
- package/dist/normalizeMergeTagMarkup-IH8COHzd.js +0 -196
- package/dist/sanitizeHtml-CnOA1efV.js +0 -942
- package/dist/socialIcons-B_d52_eS.js +0 -2075
- package/dist/useEditorCore-DG9UvWUm.js +0 -4011
- package/dist/useEditorRoot-BKr6nNkC.js +0 -7
- package/dist/usePopoverPosition-C42kD7zt.js +0 -68
- package/dist/withCurrentFont-v_a4Oso8.js +0 -18
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as q } from "./
|
|
1
|
+
import { C as e, F as t, G as n, H as r, I as i, K as a, L as o, M as s, O as c, Q as l, S as u, X as d, _ as f, at as p, b as m, c as h, ct as g, dt as _, f as v, g as y, h as b, l as x, m as S, mt as C, n as w, o as T, ot as E, p as D, pt as O, tt as k, u as A, x as j, z as M } from "./draggable-DepKdldn.js";
|
|
2
|
+
import { t as N } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
3
|
+
import { At as P, Ct as F, G as I, H as L, J as ee, M as te, R, Vt as z, at as B, bt as ne, f as re, lt as ie, ot as V, s as H, t as ae, w as U, wt as W, zt as G } from "./icons-CSSMtbGK.js";
|
|
4
|
+
import { h as oe } from "./dist-BzXULHvI.js";
|
|
5
|
+
import { a as K, n as se, o as ce, r as le, s as ue, t as q } from "./dist-DqGgijFI.js";
|
|
6
6
|
// ../media-library/src/keys.ts
|
|
7
7
|
var de = Symbol("templaticalMediaLimits"), J = Symbol("templaticalMediaPopoverTarget"), fe = Symbol("templaticalMediaTranslations"), Y = Symbol("templaticalMediaUiTheme"), X = Symbol("templaticalMediaUiLocale"), pe = { mediaLibrary: {
|
|
8
8
|
title: "Media Library",
|
|
@@ -99,13 +99,13 @@ var de = Symbol("templaticalMediaLimits"), J = Symbol("templaticalMediaPopoverTa
|
|
|
99
99
|
} };
|
|
100
100
|
// ../media-library/src/composables/useI18n.ts
|
|
101
101
|
function Z(e) {
|
|
102
|
-
let t = e ??
|
|
103
|
-
function
|
|
102
|
+
let t = e ?? c(fe, null), n = (d(t) ? t.value : t) ?? pe;
|
|
103
|
+
function r(e, t) {
|
|
104
104
|
return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
|
|
105
105
|
}
|
|
106
106
|
return {
|
|
107
|
-
t:
|
|
108
|
-
format:
|
|
107
|
+
t: n,
|
|
108
|
+
format: r
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
// ../media-library/src/composables/useMediaCategories.ts
|
|
@@ -116,41 +116,41 @@ var me = [
|
|
|
116
116
|
"audio"
|
|
117
117
|
];
|
|
118
118
|
function Q(e) {
|
|
119
|
-
let t = e ??
|
|
119
|
+
let t = e ?? c(de, null);
|
|
120
120
|
if (!t) throw Error("[Templatical] useMediaCategories() needs media limits in scope. Render it under <MediaLibraryModal> or provide MEDIA_LIMITS_KEY yourself.");
|
|
121
|
-
let
|
|
122
|
-
let e =
|
|
121
|
+
let n = t, r = D(() => !0), i = D(() => n.maxFileSize ?? Infinity), a = D(() => {
|
|
122
|
+
let e = n.accept;
|
|
123
123
|
if (e && e.length > 0) return e;
|
|
124
|
-
let t =
|
|
124
|
+
let t = n.mimeTypes;
|
|
125
125
|
return t ? Object.keys(t) : me;
|
|
126
|
-
}),
|
|
127
|
-
let e =
|
|
128
|
-
return e ?
|
|
129
|
-
}),
|
|
126
|
+
}), o = D(() => {
|
|
127
|
+
let e = n.mimeTypes;
|
|
128
|
+
return e ? a.value.flatMap((t) => e[t] ?? []) : [];
|
|
129
|
+
}), s = D(() => o.value.join(",")), l = D(() => n.mimeTypes !== void 0);
|
|
130
130
|
function u(e, t) {
|
|
131
|
-
let
|
|
132
|
-
return !
|
|
131
|
+
let r = n.mimeTypes;
|
|
132
|
+
return !r || (t && t.length > 0 ? t : Object.keys(r)).some((t) => r[t]?.includes(e) ?? !1);
|
|
133
133
|
}
|
|
134
134
|
function d(e) {
|
|
135
|
-
return u(e.type) && e.size <=
|
|
135
|
+
return u(e.type) && e.size <= i.value;
|
|
136
136
|
}
|
|
137
137
|
function f(e) {
|
|
138
|
-
let t =
|
|
138
|
+
let t = n.mimeTypes;
|
|
139
139
|
return t ? t.images?.includes(e) ?? !1 : e.startsWith("image/");
|
|
140
140
|
}
|
|
141
141
|
function p(e) {
|
|
142
|
-
let t =
|
|
142
|
+
let t = n.mimeTypes;
|
|
143
143
|
if (!t) return null;
|
|
144
144
|
for (let [n, r] of Object.entries(t)) if (r?.includes(e)) return n;
|
|
145
145
|
return null;
|
|
146
146
|
}
|
|
147
147
|
return {
|
|
148
|
-
isMediaLibraryEnabled:
|
|
149
|
-
allAcceptedMimeTypes:
|
|
150
|
-
allAcceptedInputString:
|
|
148
|
+
isMediaLibraryEnabled: r,
|
|
149
|
+
allAcceptedMimeTypes: o,
|
|
150
|
+
allAcceptedInputString: s,
|
|
151
151
|
restrictsMimeTypes: l,
|
|
152
|
-
maxFileSize:
|
|
153
|
-
availableCategories:
|
|
152
|
+
maxFileSize: i,
|
|
153
|
+
availableCategories: a,
|
|
154
154
|
isAcceptedMimeType: u,
|
|
155
155
|
isAcceptedFile: d,
|
|
156
156
|
isImageMimeType: f,
|
|
@@ -160,39 +160,39 @@ function Q(e) {
|
|
|
160
160
|
// ../media-library/src/composables/useFocusTrap.ts
|
|
161
161
|
var he = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
162
162
|
function ge(e, t) {
|
|
163
|
-
let n = null,
|
|
164
|
-
function
|
|
163
|
+
let n = null, i = null, a = null;
|
|
164
|
+
function o(e) {
|
|
165
165
|
if (!e) return document;
|
|
166
166
|
let t = e.getRootNode();
|
|
167
167
|
return t && "activeElement" in t ? t : document;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function s() {
|
|
170
170
|
return e.value ? Array.from(e.value.querySelectorAll(he)).filter((e) => e.offsetParent !== null) : [];
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function c(t) {
|
|
173
173
|
if (t.key !== "Tab") return;
|
|
174
|
-
let n =
|
|
174
|
+
let n = s();
|
|
175
175
|
if (n.length === 0) return;
|
|
176
|
-
let r = n[0], i = n[n.length - 1],
|
|
177
|
-
t.shiftKey ?
|
|
178
|
-
}
|
|
179
|
-
function
|
|
180
|
-
let t =
|
|
181
|
-
t &&
|
|
182
|
-
|
|
183
|
-
let t =
|
|
176
|
+
let r = n[0], i = n[n.length - 1], a = o(e.value).activeElement;
|
|
177
|
+
t.shiftKey ? a === r && (t.preventDefault(), i.focus()) : a === i && (t.preventDefault(), r.focus());
|
|
178
|
+
}
|
|
179
|
+
function u() {
|
|
180
|
+
let t = i !== null || a !== null;
|
|
181
|
+
t && d({ restoreFocus: !1 }), t || (n = o(e.value).activeElement), a = requestAnimationFrame(() => {
|
|
182
|
+
a = null;
|
|
183
|
+
let t = s();
|
|
184
184
|
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
185
|
-
}),
|
|
185
|
+
}), i = K(e, "keydown", c);
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function d(e = {}) {
|
|
188
188
|
let t = e.restoreFocus !== !1;
|
|
189
|
-
|
|
189
|
+
a !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(a), a = null), i?.(), i = null, t && n && n.focus && (n.focus(), n = null);
|
|
190
190
|
}
|
|
191
|
-
let
|
|
192
|
-
e && t ?
|
|
191
|
+
let f = r([t, e], ([e, t]) => {
|
|
192
|
+
e && t ? u() : d();
|
|
193
193
|
}, { flush: "post" });
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
l(() => {
|
|
195
|
+
f(), d();
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
// ../media-library/src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -203,18 +203,18 @@ var _e = {
|
|
|
203
203
|
}, ve = ["onClick"], ye = {
|
|
204
204
|
key: 1,
|
|
205
205
|
style: { color: "var(--tpl-text)" }
|
|
206
|
-
}, be = /* @__PURE__ */
|
|
206
|
+
}, be = /* @__PURE__ */ e({
|
|
207
207
|
__name: "MediaBreadcrumb",
|
|
208
208
|
props: {
|
|
209
209
|
folders: {},
|
|
210
210
|
currentFolderId: {}
|
|
211
211
|
},
|
|
212
212
|
emits: ["navigate"],
|
|
213
|
-
setup(e, { emit:
|
|
214
|
-
let
|
|
215
|
-
if (!
|
|
213
|
+
setup(e, { emit: n }) {
|
|
214
|
+
let r = e, i = n, { t: a } = Z(), s = D(() => {
|
|
215
|
+
if (!r.currentFolderId) return [];
|
|
216
216
|
let e = [];
|
|
217
|
-
return c(
|
|
217
|
+
return c(r.folders, r.currentFolderId, e), e;
|
|
218
218
|
});
|
|
219
219
|
function c(e, t, n) {
|
|
220
220
|
for (let r of e) {
|
|
@@ -223,19 +223,19 @@ var _e = {
|
|
|
223
223
|
}
|
|
224
224
|
return !1;
|
|
225
225
|
}
|
|
226
|
-
return (e,
|
|
226
|
+
return (e, n) => s.value.length > 0 ? (t(), f("div", _e, [S("button", {
|
|
227
227
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
228
228
|
style: { color: "var(--tpl-primary)" },
|
|
229
|
-
onClick:
|
|
230
|
-
}, g(
|
|
229
|
+
onClick: n[0] ||= (e) => i("navigate", null)
|
|
230
|
+
}, C(g(a).mediaLibrary.allFiles), 1), (t(!0), f(A, null, o(s.value, (e, n) => (t(), f(A, { key: e.id }, [j(g(G), {
|
|
231
231
|
size: 12,
|
|
232
232
|
"stroke-width": 2
|
|
233
|
-
}),
|
|
233
|
+
}), n < s.value.length - 1 ? (t(), f("button", {
|
|
234
234
|
key: 0,
|
|
235
235
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
236
236
|
style: { color: "var(--tpl-primary)" },
|
|
237
|
-
onClick: (t) =>
|
|
238
|
-
},
|
|
237
|
+
onClick: (t) => i("navigate", e.id)
|
|
238
|
+
}, C(e.name), 9, ve)) : (t(), f("span", ye, C(e.name), 1))], 64))), 128))])) : y("", !0);
|
|
239
239
|
}
|
|
240
240
|
}), xe = ["aria-expanded", "aria-label"], Se = {
|
|
241
241
|
key: 1,
|
|
@@ -243,7 +243,7 @@ var _e = {
|
|
|
243
243
|
}, Ce = {
|
|
244
244
|
key: 0,
|
|
245
245
|
class: "tpl:truncate"
|
|
246
|
-
}, we = ["onKeydown"], Te = ["title", "aria-label"], Ee = ["title", "aria-label"], De = ["title", "aria-label"], Oe = { key: 0 }, ke = ["placeholder", "onKeydown"], Ae = /* @__PURE__ */
|
|
246
|
+
}, we = ["onKeydown"], Te = ["title", "aria-label"], Ee = ["title", "aria-label"], De = ["title", "aria-label"], Oe = { key: 0 }, ke = ["placeholder", "onKeydown"], Ae = /* @__PURE__ */ e({
|
|
247
247
|
__name: "MediaFolderTreeNode",
|
|
248
248
|
props: {
|
|
249
249
|
folder: {},
|
|
@@ -259,76 +259,76 @@ var _e = {
|
|
|
259
259
|
"renameFolder",
|
|
260
260
|
"deleteFolder"
|
|
261
261
|
],
|
|
262
|
-
setup(
|
|
263
|
-
let r =
|
|
264
|
-
function
|
|
265
|
-
for (let n of e) if (n.id === t ||
|
|
262
|
+
setup(e, { emit: n }) {
|
|
263
|
+
let r = e, i = n, { t: s } = Z(), c = k(!1), l = k(!1), u = k(""), d = k(!1), p = k(""), m = k(!1), v = D(() => r.folder.children.length > 0), w = D(() => r.depth < 4), E = D(() => r.currentFolderId === r.folder.id), N = D(() => r.currentFolderId ? ee(r.folder.children, r.currentFolderId) : !1), P = D(() => c.value || N.value);
|
|
264
|
+
function ee(e, t) {
|
|
265
|
+
for (let n of e) if (n.id === t || ee(n.children, t)) return !0;
|
|
266
266
|
return !1;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
function L() {
|
|
272
|
-
u.value = !0, f.value = r.folder.name;
|
|
268
|
+
function te() {
|
|
269
|
+
c.value = !c.value;
|
|
273
270
|
}
|
|
274
271
|
function R() {
|
|
275
|
-
|
|
276
|
-
e && e !== r.folder.name && a("renameFolder", r.folder.id, e), u.value = !1, f.value = "";
|
|
272
|
+
l.value = !0, u.value = r.folder.name;
|
|
277
273
|
}
|
|
278
274
|
function z() {
|
|
279
|
-
|
|
275
|
+
let e = u.value.trim();
|
|
276
|
+
e && e !== r.folder.name && i("renameFolder", r.folder.id, e), l.value = !1, u.value = "";
|
|
280
277
|
}
|
|
281
278
|
function B() {
|
|
282
|
-
|
|
279
|
+
l.value = !1, u.value = "";
|
|
283
280
|
}
|
|
284
281
|
function ne() {
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
function re() {
|
|
288
|
-
m.value = !1, _.value = "";
|
|
282
|
+
d.value = !0, p.value = "", c.value = !0;
|
|
289
283
|
}
|
|
290
284
|
function ie() {
|
|
291
|
-
|
|
285
|
+
p.value.trim() && i("createFolder", p.value.trim(), r.folder.id), d.value = !1, p.value = "";
|
|
286
|
+
}
|
|
287
|
+
function V() {
|
|
288
|
+
d.value = !1, p.value = "";
|
|
292
289
|
}
|
|
293
|
-
function H(
|
|
290
|
+
function H() {
|
|
291
|
+
m.value ? (i("deleteFolder", r.folder.id), m.value = !1) : m.value = !0;
|
|
292
|
+
}
|
|
293
|
+
function ae(e) {
|
|
294
294
|
let t = e.relatedTarget;
|
|
295
|
-
t && e.currentTarget.contains(t) || (
|
|
295
|
+
t && e.currentTarget.contains(t) || (m.value = !1);
|
|
296
296
|
}
|
|
297
|
-
return (
|
|
298
|
-
let
|
|
299
|
-
return
|
|
297
|
+
return (n, r) => {
|
|
298
|
+
let c = M("MediaFolderTreeNode", !0);
|
|
299
|
+
return t(), f("div", null, [S("div", {
|
|
300
300
|
class: "tpl:group tpl:flex tpl:w-full tpl:items-center tpl:gap-1 tpl:py-1.5 tpl:pr-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
|
|
301
|
-
style:
|
|
302
|
-
paddingLeft: `${
|
|
303
|
-
backgroundColor:
|
|
304
|
-
color:
|
|
301
|
+
style: O({
|
|
302
|
+
paddingLeft: `${e.depth * 16 + 8}px`,
|
|
303
|
+
backgroundColor: E.value ? "var(--tpl-bg-active)" : "transparent",
|
|
304
|
+
color: E.value ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
305
305
|
}),
|
|
306
|
-
onFocusout:
|
|
306
|
+
onFocusout: ae
|
|
307
307
|
}, [
|
|
308
|
-
|
|
308
|
+
v.value || d.value ? (t(), f("button", {
|
|
309
309
|
key: 0,
|
|
310
310
|
type: "button",
|
|
311
311
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
312
312
|
"aria-expanded": P.value,
|
|
313
|
-
"aria-label": P.value ?
|
|
314
|
-
onClick:
|
|
315
|
-
}, [
|
|
316
|
-
class:
|
|
313
|
+
"aria-label": P.value ? g(s).mediaLibrary.collapseFolder : g(s).mediaLibrary.expandFolder,
|
|
314
|
+
onClick: x(te, ["stop"])
|
|
315
|
+
}, [j(g(G), {
|
|
316
|
+
class: _(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": P.value }]),
|
|
317
317
|
size: 10,
|
|
318
318
|
"stroke-width": 2
|
|
319
|
-
}, null, 8, ["class"])], 8, xe)) : (
|
|
320
|
-
|
|
319
|
+
}, null, 8, ["class"])], 8, xe)) : (t(), f("span", Se)),
|
|
320
|
+
S("button", {
|
|
321
321
|
type: "button",
|
|
322
322
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
323
|
-
onClick:
|
|
324
|
-
}, [
|
|
323
|
+
onClick: r[0] ||= (t) => i("navigate", e.folder.id)
|
|
324
|
+
}, [j(g(F), {
|
|
325
325
|
class: "tpl:shrink-0",
|
|
326
326
|
size: 14,
|
|
327
327
|
"stroke-width": 1.5
|
|
328
|
-
}),
|
|
329
|
-
|
|
328
|
+
}), l.value ? y("", !0) : (t(), f("span", Ce, C(e.folder.name), 1))]),
|
|
329
|
+
l.value ? a((t(), f("input", {
|
|
330
330
|
key: 2,
|
|
331
|
-
"onUpdate:modelValue":
|
|
331
|
+
"onUpdate:modelValue": r[1] ||= (e) => u.value = e,
|
|
332
332
|
type: "text",
|
|
333
333
|
class: "tpl:min-w-0 tpl:flex-1 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-xs tpl:outline-none",
|
|
334
334
|
style: {
|
|
@@ -337,62 +337,62 @@ var _e = {
|
|
|
337
337
|
color: "var(--tpl-text)"
|
|
338
338
|
},
|
|
339
339
|
autofocus: "",
|
|
340
|
-
onKeydown: [h(
|
|
341
|
-
onBlur:
|
|
342
|
-
onClick:
|
|
343
|
-
}, null, 40, we)), [[
|
|
344
|
-
|
|
340
|
+
onKeydown: [h(z, ["enter"]), h(x(B, ["stop"]), ["escape"])],
|
|
341
|
+
onBlur: z,
|
|
342
|
+
onClick: r[2] ||= x(() => {}, ["stop"])
|
|
343
|
+
}, null, 40, we)), [[T, u.value]]) : y("", !0),
|
|
344
|
+
l.value ? y("", !0) : (t(), f("span", {
|
|
345
345
|
key: 3,
|
|
346
|
-
class:
|
|
346
|
+
class: _(["tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:transition-opacity", E.value || m.value ? "tpl:opacity-100" : "tpl:opacity-0 tpl:group-hover:opacity-100 tpl:group-focus-within:opacity-100"])
|
|
347
347
|
}, [
|
|
348
|
-
|
|
348
|
+
w.value && e.canCreateFolder ? (t(), f("button", {
|
|
349
349
|
key: 0,
|
|
350
350
|
type: "button",
|
|
351
351
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
352
|
-
title:
|
|
353
|
-
"aria-label":
|
|
354
|
-
onClick:
|
|
355
|
-
}, [
|
|
352
|
+
title: g(s).mediaLibrary.addSubfolder,
|
|
353
|
+
"aria-label": g(s).mediaLibrary.addSubfolder,
|
|
354
|
+
onClick: x(ne, ["stop"])
|
|
355
|
+
}, [j(g(L), {
|
|
356
356
|
size: 12,
|
|
357
357
|
"stroke-width": 2
|
|
358
|
-
})], 8, Te)) :
|
|
359
|
-
|
|
358
|
+
})], 8, Te)) : y("", !0),
|
|
359
|
+
e.canRenameFolder ? (t(), f("button", {
|
|
360
360
|
key: 1,
|
|
361
361
|
type: "button",
|
|
362
362
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
363
|
-
title:
|
|
364
|
-
"aria-label":
|
|
365
|
-
onClick:
|
|
366
|
-
}, [
|
|
363
|
+
title: g(s).mediaLibrary.renameFolder,
|
|
364
|
+
"aria-label": g(s).mediaLibrary.renameFolder,
|
|
365
|
+
onClick: x(R, ["stop"])
|
|
366
|
+
}, [j(g(I), {
|
|
367
367
|
size: 12,
|
|
368
368
|
"stroke-width": 2
|
|
369
|
-
})], 8, Ee)) :
|
|
370
|
-
|
|
369
|
+
})], 8, Ee)) : y("", !0),
|
|
370
|
+
e.canDeleteFolder ? (t(), f("button", {
|
|
371
371
|
key: 2,
|
|
372
372
|
type: "button",
|
|
373
373
|
"data-testid": "media-folder-delete",
|
|
374
374
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
375
|
-
title:
|
|
376
|
-
"aria-label":
|
|
377
|
-
onClick:
|
|
378
|
-
}, [
|
|
375
|
+
title: m.value ? g(s).mediaLibrary.deleteFolderConfirm : g(s).mediaLibrary.deleteFolder,
|
|
376
|
+
"aria-label": m.value ? g(s).mediaLibrary.deleteFolderConfirm : g(s).mediaLibrary.deleteFolder,
|
|
377
|
+
onClick: x(H, ["stop"])
|
|
378
|
+
}, [j(g(re), {
|
|
379
379
|
size: 12,
|
|
380
380
|
"stroke-width": 2,
|
|
381
381
|
style: { color: "var(--tpl-danger)" }
|
|
382
|
-
})], 8, De)) :
|
|
382
|
+
})], 8, De)) : y("", !0)
|
|
383
383
|
], 2))
|
|
384
|
-
], 36), P.value ? (
|
|
385
|
-
key:
|
|
386
|
-
folder:
|
|
387
|
-
"current-folder-id":
|
|
388
|
-
depth:
|
|
389
|
-
"can-create-folder":
|
|
390
|
-
"can-rename-folder":
|
|
391
|
-
"can-delete-folder":
|
|
392
|
-
onNavigate:
|
|
393
|
-
onCreateFolder:
|
|
394
|
-
onRenameFolder:
|
|
395
|
-
onDeleteFolder:
|
|
384
|
+
], 36), P.value ? (t(), f("div", Oe, [(t(!0), f(A, null, o(e.folder.children, (n) => (t(), b(c, {
|
|
385
|
+
key: n.id,
|
|
386
|
+
folder: n,
|
|
387
|
+
"current-folder-id": e.currentFolderId,
|
|
388
|
+
depth: e.depth + 1,
|
|
389
|
+
"can-create-folder": e.canCreateFolder,
|
|
390
|
+
"can-rename-folder": e.canRenameFolder,
|
|
391
|
+
"can-delete-folder": e.canDeleteFolder,
|
|
392
|
+
onNavigate: r[3] ||= (e) => i("navigate", e),
|
|
393
|
+
onCreateFolder: r[4] ||= (e, t) => i("createFolder", e, t),
|
|
394
|
+
onRenameFolder: r[5] ||= (e, t) => i("renameFolder", e, t),
|
|
395
|
+
onDeleteFolder: r[6] ||= (e) => i("deleteFolder", e)
|
|
396
396
|
}, null, 8, [
|
|
397
397
|
"folder",
|
|
398
398
|
"current-folder-id",
|
|
@@ -400,12 +400,12 @@ var _e = {
|
|
|
400
400
|
"can-create-folder",
|
|
401
401
|
"can-rename-folder",
|
|
402
402
|
"can-delete-folder"
|
|
403
|
-
]))), 128)),
|
|
403
|
+
]))), 128)), d.value ? (t(), f("div", {
|
|
404
404
|
key: 0,
|
|
405
|
-
style:
|
|
405
|
+
style: O({ paddingLeft: `${(e.depth + 1) * 16 + 8}px` }),
|
|
406
406
|
class: "tpl:py-1.5 tpl:pr-2"
|
|
407
|
-
}, [
|
|
408
|
-
"onUpdate:modelValue":
|
|
407
|
+
}, [a(S("input", {
|
|
408
|
+
"onUpdate:modelValue": r[7] ||= (e) => p.value = e,
|
|
409
409
|
type: "text",
|
|
410
410
|
class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
|
|
411
411
|
style: {
|
|
@@ -413,11 +413,11 @@ var _e = {
|
|
|
413
413
|
"background-color": "var(--tpl-bg)",
|
|
414
414
|
color: "var(--tpl-text)"
|
|
415
415
|
},
|
|
416
|
-
placeholder:
|
|
416
|
+
placeholder: g(s).mediaLibrary.subfolderName,
|
|
417
417
|
autofocus: "",
|
|
418
|
-
onKeydown: [h(
|
|
419
|
-
onBlur:
|
|
420
|
-
}, null, 40, ke), [[
|
|
418
|
+
onKeydown: [h(ie, ["enter"]), h(x(V, ["stop"]), ["escape"])],
|
|
419
|
+
onBlur: ie
|
|
420
|
+
}, null, 40, ke), [[T, p.value]])], 4)) : y("", !0)])) : y("", !0)]);
|
|
421
421
|
};
|
|
422
422
|
}
|
|
423
423
|
}), je = {
|
|
@@ -426,7 +426,7 @@ var _e = {
|
|
|
426
426
|
}, Me = {
|
|
427
427
|
key: 0,
|
|
428
428
|
class: "tpl:px-3 tpl:py-2"
|
|
429
|
-
}, Ne = ["placeholder", "onKeydown"], Pe = /* @__PURE__ */
|
|
429
|
+
}, Ne = ["placeholder", "onKeydown"], Pe = /* @__PURE__ */ e({
|
|
430
430
|
__name: "MediaFolderTree",
|
|
431
431
|
props: {
|
|
432
432
|
folders: {},
|
|
@@ -444,41 +444,41 @@ var _e = {
|
|
|
444
444
|
"deleteFolder",
|
|
445
445
|
"showFrequentlyUsed"
|
|
446
446
|
],
|
|
447
|
-
setup(
|
|
448
|
-
let r = n, { t:
|
|
447
|
+
setup(e, { emit: n }) {
|
|
448
|
+
let r = n, { t: i } = Z(), s = k(!1), c = k("");
|
|
449
449
|
function l() {
|
|
450
450
|
s.value = !0, c.value = "";
|
|
451
451
|
}
|
|
452
452
|
function u() {
|
|
453
453
|
c.value.trim() && r("createFolder", c.value.trim()), s.value = !1, c.value = "";
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function d() {
|
|
456
456
|
s.value = !1, c.value = "";
|
|
457
457
|
}
|
|
458
|
-
return (
|
|
459
|
-
|
|
458
|
+
return (n, p) => (t(), f("div", je, [
|
|
459
|
+
S("button", {
|
|
460
460
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
461
|
-
style:
|
|
462
|
-
backgroundColor:
|
|
463
|
-
color:
|
|
461
|
+
style: O({
|
|
462
|
+
backgroundColor: e.viewMode === "files" && e.currentFolderId === null ? "var(--tpl-bg-active)" : "transparent",
|
|
463
|
+
color: e.viewMode === "files" && e.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
464
464
|
}),
|
|
465
|
-
onClick:
|
|
466
|
-
}, [
|
|
465
|
+
onClick: p[0] ||= (e) => r("navigate", null)
|
|
466
|
+
}, [j(g(W), {
|
|
467
467
|
size: 14,
|
|
468
468
|
"stroke-width": 1.5
|
|
469
|
-
}), m(" " + g(
|
|
470
|
-
(
|
|
471
|
-
key:
|
|
472
|
-
folder:
|
|
473
|
-
"current-folder-id":
|
|
469
|
+
}), m(" " + C(g(i).mediaLibrary.allFiles), 1)], 4),
|
|
470
|
+
(t(!0), f(A, null, o(e.folders, (n) => (t(), b(Ae, {
|
|
471
|
+
key: n.id,
|
|
472
|
+
folder: n,
|
|
473
|
+
"current-folder-id": e.currentFolderId,
|
|
474
474
|
depth: 0,
|
|
475
|
-
"can-create-folder":
|
|
476
|
-
"can-rename-folder":
|
|
477
|
-
"can-delete-folder":
|
|
478
|
-
onNavigate:
|
|
479
|
-
onCreateFolder:
|
|
480
|
-
onRenameFolder:
|
|
481
|
-
onDeleteFolder:
|
|
475
|
+
"can-create-folder": e.canCreateFolder,
|
|
476
|
+
"can-rename-folder": e.canRenameFolder,
|
|
477
|
+
"can-delete-folder": e.canDeleteFolder,
|
|
478
|
+
onNavigate: p[1] ||= (e) => r("navigate", e),
|
|
479
|
+
onCreateFolder: p[2] ||= (e, t) => r("createFolder", e, t),
|
|
480
|
+
onRenameFolder: p[3] ||= (e, t) => r("renameFolder", e, t),
|
|
481
|
+
onDeleteFolder: p[4] ||= (e) => r("deleteFolder", e)
|
|
482
482
|
}, null, 8, [
|
|
483
483
|
"folder",
|
|
484
484
|
"current-folder-id",
|
|
@@ -486,8 +486,8 @@ var _e = {
|
|
|
486
486
|
"can-rename-folder",
|
|
487
487
|
"can-delete-folder"
|
|
488
488
|
]))), 128)),
|
|
489
|
-
s.value ? (
|
|
490
|
-
"onUpdate:modelValue":
|
|
489
|
+
s.value ? (t(), f("div", Me, [a(S("input", {
|
|
490
|
+
"onUpdate:modelValue": p[5] ||= (e) => c.value = e,
|
|
491
491
|
type: "text",
|
|
492
492
|
class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
|
|
493
493
|
style: {
|
|
@@ -495,42 +495,42 @@ var _e = {
|
|
|
495
495
|
"background-color": "var(--tpl-bg)",
|
|
496
496
|
color: "var(--tpl-text)"
|
|
497
497
|
},
|
|
498
|
-
placeholder:
|
|
498
|
+
placeholder: g(i).mediaLibrary.folderName,
|
|
499
499
|
autofocus: "",
|
|
500
|
-
onKeydown: [h(u, ["enter"]), h(
|
|
500
|
+
onKeydown: [h(u, ["enter"]), h(x(d, ["stop"]), ["escape"])],
|
|
501
501
|
onBlur: u
|
|
502
|
-
}, null, 40, Ne), [[
|
|
503
|
-
!s.value &&
|
|
502
|
+
}, null, 40, Ne), [[T, c.value]])])) : y("", !0),
|
|
503
|
+
!s.value && e.canCreateFolder ? (t(), f("button", {
|
|
504
504
|
key: 1,
|
|
505
505
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
|
|
506
506
|
style: { color: "var(--tpl-text-muted)" },
|
|
507
507
|
onClick: l
|
|
508
|
-
}, [
|
|
508
|
+
}, [j(g(L), {
|
|
509
509
|
size: 14,
|
|
510
510
|
"stroke-width": 1.5
|
|
511
|
-
}), m(" " + g(
|
|
512
|
-
|
|
513
|
-
|
|
511
|
+
}), m(" " + C(g(i).mediaLibrary.newFolder), 1)])) : y("", !0),
|
|
512
|
+
p[7] ||= S("div", { class: "tpl:flex-1" }, null, -1),
|
|
513
|
+
e.hasFrequentlyUsed ? (t(), f("button", {
|
|
514
514
|
key: 2,
|
|
515
515
|
"data-testid": "media-frequently-used",
|
|
516
516
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:border-t tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
517
|
-
style:
|
|
517
|
+
style: O({
|
|
518
518
|
borderColor: "var(--tpl-border)",
|
|
519
|
-
backgroundColor:
|
|
520
|
-
color:
|
|
519
|
+
backgroundColor: e.viewMode === "frequently-used" ? "var(--tpl-bg-active)" : "transparent",
|
|
520
|
+
color: e.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
521
521
|
}),
|
|
522
|
-
onClick:
|
|
523
|
-
}, [
|
|
522
|
+
onClick: p[6] ||= (e) => r("showFrequentlyUsed")
|
|
523
|
+
}, [j(g(U), {
|
|
524
524
|
size: 14,
|
|
525
525
|
"stroke-width": 1.5
|
|
526
|
-
}), m(" " + g(
|
|
526
|
+
}), m(" " + C(g(i).mediaLibrary.frequentlyUsed), 1)], 4)) : y("", !0)
|
|
527
527
|
]));
|
|
528
528
|
}
|
|
529
|
-
}), Fe = /* @__PURE__ */
|
|
529
|
+
}), Fe = /* @__PURE__ */ e({
|
|
530
530
|
__name: "MediaFileIcon",
|
|
531
531
|
props: { mimeType: {} },
|
|
532
532
|
setup(e) {
|
|
533
|
-
let
|
|
533
|
+
let n = e, r = {
|
|
534
534
|
"application/pdf": {
|
|
535
535
|
label: "PDF",
|
|
536
536
|
color: "var(--tpl-danger)",
|
|
@@ -621,16 +621,16 @@ var _e = {
|
|
|
621
621
|
bgColor: "var(--tpl-secondary-light)",
|
|
622
622
|
icon: "audio"
|
|
623
623
|
}
|
|
624
|
-
},
|
|
624
|
+
}, i = {
|
|
625
625
|
label: "FILE",
|
|
626
626
|
color: "var(--tpl-text-muted)",
|
|
627
627
|
bgColor: "var(--tpl-bg-hover)",
|
|
628
628
|
icon: "document"
|
|
629
|
-
},
|
|
630
|
-
return (e,
|
|
629
|
+
}, a = D(() => r[n.mimeType] ?? i);
|
|
630
|
+
return (e, n) => (t(), f("div", {
|
|
631
631
|
class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2",
|
|
632
|
-
style:
|
|
633
|
-
}, [
|
|
632
|
+
style: O({ backgroundColor: a.value.bgColor })
|
|
633
|
+
}, [a.value.icon === "document" ? (t(), f("svg", {
|
|
634
634
|
key: 0,
|
|
635
635
|
width: "60",
|
|
636
636
|
height: "60",
|
|
@@ -638,23 +638,23 @@ var _e = {
|
|
|
638
638
|
fill: "none",
|
|
639
639
|
stroke: "currentColor",
|
|
640
640
|
"stroke-width": "1.5",
|
|
641
|
-
style:
|
|
642
|
-
}, [...
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
641
|
+
style: O({ color: a.value.color })
|
|
642
|
+
}, [...n[0] ||= [
|
|
643
|
+
S("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }, null, -1),
|
|
644
|
+
S("polyline", { points: "14 2 14 8 20 8" }, null, -1),
|
|
645
|
+
S("line", {
|
|
646
646
|
x1: "8",
|
|
647
647
|
y1: "13",
|
|
648
648
|
x2: "16",
|
|
649
649
|
y2: "13"
|
|
650
650
|
}, null, -1),
|
|
651
|
-
|
|
651
|
+
S("line", {
|
|
652
652
|
x1: "8",
|
|
653
653
|
y1: "17",
|
|
654
654
|
x2: "12",
|
|
655
655
|
y2: "17"
|
|
656
656
|
}, null, -1)
|
|
657
|
-
]], 4)) :
|
|
657
|
+
]], 4)) : a.value.icon === "video" ? (t(), f("svg", {
|
|
658
658
|
key: 1,
|
|
659
659
|
width: "40",
|
|
660
660
|
height: "40",
|
|
@@ -662,18 +662,18 @@ var _e = {
|
|
|
662
662
|
fill: "none",
|
|
663
663
|
stroke: "currentColor",
|
|
664
664
|
"stroke-width": "1.5",
|
|
665
|
-
style:
|
|
666
|
-
}, [...
|
|
665
|
+
style: O({ color: a.value.color })
|
|
666
|
+
}, [...n[1] ||= [S("rect", {
|
|
667
667
|
x: "2",
|
|
668
668
|
y: "4",
|
|
669
669
|
width: "20",
|
|
670
670
|
height: "16",
|
|
671
671
|
rx: "2"
|
|
672
|
-
}, null, -1),
|
|
672
|
+
}, null, -1), S("polygon", {
|
|
673
673
|
points: "10,8 16,12 10,16",
|
|
674
674
|
fill: "currentColor",
|
|
675
675
|
stroke: "none"
|
|
676
|
-
}, null, -1)]], 4)) : (
|
|
676
|
+
}, null, -1)]], 4)) : (t(), f("svg", {
|
|
677
677
|
key: 2,
|
|
678
678
|
width: "40",
|
|
679
679
|
height: "40",
|
|
@@ -681,23 +681,23 @@ var _e = {
|
|
|
681
681
|
fill: "none",
|
|
682
682
|
stroke: "currentColor",
|
|
683
683
|
"stroke-width": "1.5",
|
|
684
|
-
style:
|
|
685
|
-
}, [...
|
|
686
|
-
|
|
687
|
-
|
|
684
|
+
style: O({ color: a.value.color })
|
|
685
|
+
}, [...n[2] ||= [
|
|
686
|
+
S("path", { d: "M9 18V5l12-2v13" }, null, -1),
|
|
687
|
+
S("circle", {
|
|
688
688
|
cx: "6",
|
|
689
689
|
cy: "18",
|
|
690
690
|
r: "3"
|
|
691
691
|
}, null, -1),
|
|
692
|
-
|
|
692
|
+
S("circle", {
|
|
693
693
|
cx: "18",
|
|
694
694
|
cy: "16",
|
|
695
695
|
r: "3"
|
|
696
696
|
}, null, -1)
|
|
697
|
-
]], 4)),
|
|
697
|
+
]], 4)), S("span", {
|
|
698
698
|
class: "tpl:text-xs tpl:font-bold tpl:tracking-wider",
|
|
699
|
-
style:
|
|
700
|
-
},
|
|
699
|
+
style: O({ color: a.value.color })
|
|
700
|
+
}, C(a.value.label), 5)], 4));
|
|
701
701
|
}
|
|
702
702
|
});
|
|
703
703
|
// ../media-library/src/utils/formatAbsoluteDate.ts
|
|
@@ -797,7 +797,7 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
797
797
|
}, dt = {
|
|
798
798
|
key: 4,
|
|
799
799
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
800
|
-
}, ft = /*#__PURE__*/
|
|
800
|
+
}, ft = /*#__PURE__*/ N(/* @__PURE__ */ e({
|
|
801
801
|
__name: "MediaGrid",
|
|
802
802
|
props: {
|
|
803
803
|
items: {},
|
|
@@ -818,41 +818,41 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
818
818
|
"replace",
|
|
819
819
|
"confirm"
|
|
820
820
|
],
|
|
821
|
-
setup(
|
|
822
|
-
let
|
|
823
|
-
function
|
|
821
|
+
setup(e, { emit: n }) {
|
|
822
|
+
let r = e, i = n, { isAcceptedMimeType: a, isImageMimeType: s } = Q();
|
|
823
|
+
function l(e) {
|
|
824
824
|
return e.mimeType ?? "";
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function u(e) {
|
|
827
827
|
return e.thumbnailUrl ?? e.url;
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
return !
|
|
829
|
+
function d(e) {
|
|
830
|
+
return !r.accept || r.accept.length === 0 || a(l(e), r.accept);
|
|
831
831
|
}
|
|
832
|
-
function
|
|
833
|
-
return
|
|
832
|
+
function p(e) {
|
|
833
|
+
return r.canUpdate === !0 && e.canUpdate !== !1;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
return
|
|
835
|
+
function h(e) {
|
|
836
|
+
return r.canReplace === !0 && e.canUpdate !== !1;
|
|
837
837
|
}
|
|
838
|
-
function
|
|
839
|
-
t.metaKey || t.ctrlKey ?
|
|
838
|
+
function v(e, t) {
|
|
839
|
+
t.metaKey || t.ctrlKey ? i("toggle", e.id) : i("select", e);
|
|
840
840
|
}
|
|
841
|
-
function
|
|
842
|
-
|
|
841
|
+
function w(e) {
|
|
842
|
+
d(e) && i("confirm", e);
|
|
843
843
|
}
|
|
844
844
|
function T(e, t) {
|
|
845
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(),
|
|
845
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), i("select", e));
|
|
846
846
|
}
|
|
847
847
|
function E(e) {
|
|
848
|
-
return
|
|
848
|
+
return r.selectedIds.has(e.id);
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function D(e) {
|
|
851
851
|
return E(e) ? "tpl:opacity-100" : "tpl:opacity-0 tpl:group-hover:opacity-100 tpl:group-focus-within:opacity-100";
|
|
852
852
|
}
|
|
853
|
-
let { t:
|
|
854
|
-
|
|
855
|
-
e &&
|
|
853
|
+
let { t: M } = Z(), N = c(X, null), P = k(null);
|
|
854
|
+
ue(P, ([{ isIntersecting: e }]) => {
|
|
855
|
+
e && r.hasMore && !r.isLoading && i("loadMore");
|
|
856
856
|
}, { threshold: .1 });
|
|
857
857
|
function F(e) {
|
|
858
858
|
return Ie(e, N?.value, {
|
|
@@ -861,123 +861,123 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
861
861
|
day: "numeric"
|
|
862
862
|
});
|
|
863
863
|
}
|
|
864
|
-
return (
|
|
865
|
-
|
|
864
|
+
return (n, r) => (t(), f("div", Re, [
|
|
865
|
+
e.isLoading && e.items.length === 0 ? (t(), f("div", {
|
|
866
866
|
key: 0,
|
|
867
867
|
role: "status",
|
|
868
868
|
"aria-busy": "true",
|
|
869
|
-
"aria-label":
|
|
870
|
-
class:
|
|
871
|
-
}, [(
|
|
872
|
-
key:
|
|
873
|
-
class:
|
|
869
|
+
"aria-label": g(M).mediaLibrary.loading,
|
|
870
|
+
class: _(e.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
|
|
871
|
+
}, [(t(), f(A, null, o(8, (t) => S("div", {
|
|
872
|
+
key: t,
|
|
873
|
+
class: _(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
874
874
|
style: { "background-color": "var(--tpl-bg-hover)" },
|
|
875
875
|
"aria-hidden": "true"
|
|
876
|
-
}, null, 2)), 64))], 10, ze)) :
|
|
876
|
+
}, null, 2)), 64))], 10, ze)) : e.items.length === 0 ? (t(), f("div", Be, [j(g(W), {
|
|
877
877
|
class: "tpl:mb-3",
|
|
878
878
|
size: 40,
|
|
879
879
|
"stroke-width": 1,
|
|
880
880
|
style: { color: "var(--tpl-text-dim)" }
|
|
881
|
-
}),
|
|
881
|
+
}), S("p", Ve, C(e.searchQuery ? g(M).mediaLibrary.noSearchResults : g(M).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (t(), f("div", {
|
|
882
882
|
key: 3,
|
|
883
883
|
role: "listbox",
|
|
884
|
-
"aria-label":
|
|
884
|
+
"aria-label": g(M).mediaLibrary.filesListAriaLabel,
|
|
885
885
|
"aria-multiselectable": "true",
|
|
886
886
|
class: "tpl:flex tpl:flex-col tpl:gap-1"
|
|
887
|
-
}, [(
|
|
887
|
+
}, [(t(!0), f(A, null, o(e.items, (e) => (t(), f("div", {
|
|
888
888
|
key: e.id,
|
|
889
889
|
role: "option",
|
|
890
890
|
tabindex: "0",
|
|
891
891
|
"data-testid": "media-library-item",
|
|
892
|
-
class:
|
|
892
|
+
class: _(["tpl-media-list-item tpl:group tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-150", [!d(e) && !E(e) ? "tpl:opacity-60" : ""]]),
|
|
893
893
|
"data-media-id": e.id,
|
|
894
894
|
"aria-selected": E(e),
|
|
895
895
|
"aria-label": e.filename || e.url,
|
|
896
|
-
style:
|
|
897
|
-
onClick: (t) =>
|
|
898
|
-
onDblclick: (t) =>
|
|
896
|
+
style: O({ backgroundColor: E(e) ? "var(--tpl-bg-hover)" : "transparent" }),
|
|
897
|
+
onClick: (t) => v(e, t),
|
|
898
|
+
onDblclick: (t) => w(e),
|
|
899
899
|
onKeydown: (t) => T(e, t)
|
|
900
900
|
}, [
|
|
901
|
-
|
|
901
|
+
S("div", nt, [g(s)(l(e)) ? (t(), f("img", {
|
|
902
902
|
key: 0,
|
|
903
|
-
src:
|
|
903
|
+
src: u(e),
|
|
904
904
|
alt: e.filename || e.url,
|
|
905
905
|
class: "tpl:size-full tpl:object-cover",
|
|
906
906
|
loading: "lazy"
|
|
907
|
-
}, null, 8, rt)) : (
|
|
908
|
-
|
|
909
|
-
e.size == null ?
|
|
910
|
-
e.createdAt ? (
|
|
911
|
-
|
|
907
|
+
}, null, 8, rt)) : (t(), f("div", it, [j(Fe, { "mime-type": l(e) }, null, 8, ["mime-type"])]))]),
|
|
908
|
+
S("div", at, [S("p", ot, C(e.filename || e.url), 1), S("p", st, [
|
|
909
|
+
e.size == null ? y("", !0) : (t(), f(A, { key: 0 }, [m(C(g($)(e.size)), 1)], 64)),
|
|
910
|
+
e.createdAt ? (t(), f(A, { key: 1 }, [e.size == null ? y("", !0) : (t(), f(A, { key: 0 }, [m(" · ")], 64)), m(" " + C(F(e.createdAt)), 1)], 64)) : y("", !0),
|
|
911
|
+
g(s)(l(e)) && e.width && e.height ? (t(), f(A, { key: 2 }, [m(" · " + C(e.width) + "×" + C(e.height), 1)], 64)) : y("", !0)
|
|
912
912
|
])]),
|
|
913
|
-
|
|
913
|
+
S("div", { class: _(["tpl:flex tpl:gap-1 tpl:transition-opacity tpl:duration-150", D(e)]) }, [p(e) ? (t(), f("button", {
|
|
914
914
|
key: 0,
|
|
915
915
|
type: "button",
|
|
916
916
|
"data-testid": "media-edit",
|
|
917
917
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
918
918
|
style: { color: "var(--tpl-text-muted)" },
|
|
919
|
-
title:
|
|
920
|
-
"aria-label":
|
|
921
|
-
onClick:
|
|
922
|
-
}, [
|
|
919
|
+
title: g(M).mediaLibrary.editFile,
|
|
920
|
+
"aria-label": g(M).mediaLibrary.editFile,
|
|
921
|
+
onClick: x((t) => i("edit", e), ["stop"])
|
|
922
|
+
}, [j(g(I), {
|
|
923
923
|
size: 12,
|
|
924
924
|
"stroke-width": 2
|
|
925
|
-
})], 8, ct)) :
|
|
925
|
+
})], 8, ct)) : y("", !0), h(e) ? (t(), f("button", {
|
|
926
926
|
key: 1,
|
|
927
927
|
type: "button",
|
|
928
928
|
"data-testid": "media-replace",
|
|
929
929
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
930
930
|
style: { color: "var(--tpl-text-muted)" },
|
|
931
|
-
title:
|
|
932
|
-
"aria-label":
|
|
933
|
-
onClick:
|
|
934
|
-
}, [
|
|
931
|
+
title: g(M).mediaLibrary.replaceFile,
|
|
932
|
+
"aria-label": g(M).mediaLibrary.replaceFile,
|
|
933
|
+
onClick: x((t) => i("replace", e), ["stop"])
|
|
934
|
+
}, [j(g(R), {
|
|
935
935
|
size: 12,
|
|
936
936
|
"stroke-width": 2
|
|
937
|
-
})], 8, lt)) :
|
|
938
|
-
E(e) ? (
|
|
937
|
+
})], 8, lt)) : y("", !0)], 2),
|
|
938
|
+
E(e) ? (t(), f("div", ut, [j(g(z), {
|
|
939
939
|
size: 12,
|
|
940
940
|
"stroke-width": 3
|
|
941
|
-
})])) :
|
|
942
|
-
], 46, tt))), 128))], 8, et)) : (
|
|
941
|
+
})])) : y("", !0)
|
|
942
|
+
], 46, tt))), 128))], 8, et)) : (t(), f("div", {
|
|
943
943
|
key: 2,
|
|
944
944
|
role: "listbox",
|
|
945
|
-
"aria-label":
|
|
945
|
+
"aria-label": g(M).mediaLibrary.filesListAriaLabel,
|
|
946
946
|
"aria-multiselectable": "true",
|
|
947
947
|
class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
|
|
948
|
-
}, [(
|
|
948
|
+
}, [(t(!0), f(A, null, o(e.items, (e) => (t(), f("div", {
|
|
949
949
|
key: e.id,
|
|
950
950
|
role: "option",
|
|
951
951
|
tabindex: "0",
|
|
952
952
|
"data-testid": "media-library-item",
|
|
953
|
-
class:
|
|
953
|
+
class: _(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
|
|
954
954
|
"tpl:cursor-pointer",
|
|
955
|
-
!
|
|
955
|
+
!d(e) && !E(e) ? "tpl:opacity-60" : "",
|
|
956
956
|
E(e) ? "tpl-media-item--selected" : ""
|
|
957
957
|
]]),
|
|
958
958
|
"data-media-id": e.id,
|
|
959
959
|
"aria-selected": E(e),
|
|
960
960
|
"aria-label": e.filename || e.url,
|
|
961
|
-
style:
|
|
961
|
+
style: O({
|
|
962
962
|
borderColor: E(e) ? "var(--tpl-primary)" : "transparent",
|
|
963
|
-
backgroundColor: !
|
|
963
|
+
backgroundColor: !d(e) && !E(e) ? "var(--tpl-bg)" : "var(--tpl-bg-hover)"
|
|
964
964
|
}),
|
|
965
|
-
onClick: (t) =>
|
|
966
|
-
onDblclick: (t) =>
|
|
965
|
+
onClick: (t) => v(e, t),
|
|
966
|
+
onDblclick: (t) => w(e),
|
|
967
967
|
onKeydown: (t) => T(e, t)
|
|
968
968
|
}, [
|
|
969
|
-
|
|
969
|
+
S("div", We, [g(s)(l(e)) ? (t(), f("img", {
|
|
970
970
|
key: 0,
|
|
971
|
-
src:
|
|
971
|
+
src: u(e),
|
|
972
972
|
alt: e.filename || e.url,
|
|
973
973
|
class: "tpl:size-full tpl:object-cover",
|
|
974
974
|
loading: "lazy"
|
|
975
|
-
}, null, 8, Ge)) : (
|
|
975
|
+
}, null, 8, Ge)) : (t(), b(Fe, {
|
|
976
976
|
key: 1,
|
|
977
|
-
"mime-type":
|
|
977
|
+
"mime-type": l(e)
|
|
978
978
|
}, null, 8, ["mime-type"]))]),
|
|
979
|
-
|
|
980
|
-
|
|
979
|
+
S("div", Ke, [S("p", qe, C(e.filename || e.url), 1), S("p", Je, [e.size == null ? y("", !0) : (t(), f("span", Ye, C(g($)(e.size)), 1)), g(s)(l(e)) && e.width && e.height ? (t(), f("span", Xe, C(e.width) + "×" + C(e.height), 1)) : y("", !0)])]),
|
|
980
|
+
S("div", { class: _(["tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:transition-opacity tpl:duration-150", D(e)]) }, [p(e) ? (t(), f("button", {
|
|
981
981
|
key: 0,
|
|
982
982
|
type: "button",
|
|
983
983
|
"data-testid": "media-edit",
|
|
@@ -986,13 +986,13 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
986
986
|
"background-color": "var(--tpl-overlay)",
|
|
987
987
|
color: "var(--tpl-on-primary)"
|
|
988
988
|
},
|
|
989
|
-
title:
|
|
990
|
-
"aria-label":
|
|
991
|
-
onClick:
|
|
992
|
-
}, [
|
|
989
|
+
title: g(M).mediaLibrary.editFile,
|
|
990
|
+
"aria-label": g(M).mediaLibrary.editFile,
|
|
991
|
+
onClick: x((t) => i("edit", e), ["stop"])
|
|
992
|
+
}, [j(g(I), {
|
|
993
993
|
size: 11,
|
|
994
994
|
"stroke-width": 2
|
|
995
|
-
})], 8, Ze)) :
|
|
995
|
+
})], 8, Ze)) : y("", !0), h(e) ? (t(), f("button", {
|
|
996
996
|
key: 1,
|
|
997
997
|
type: "button",
|
|
998
998
|
"data-testid": "media-replace",
|
|
@@ -1001,29 +1001,29 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1001
1001
|
"background-color": "var(--tpl-overlay)",
|
|
1002
1002
|
color: "var(--tpl-on-primary)"
|
|
1003
1003
|
},
|
|
1004
|
-
title:
|
|
1005
|
-
"aria-label":
|
|
1006
|
-
onClick:
|
|
1007
|
-
}, [
|
|
1004
|
+
title: g(M).mediaLibrary.replaceFile,
|
|
1005
|
+
"aria-label": g(M).mediaLibrary.replaceFile,
|
|
1006
|
+
onClick: x((t) => i("replace", e), ["stop"])
|
|
1007
|
+
}, [j(g(R), {
|
|
1008
1008
|
size: 11,
|
|
1009
1009
|
"stroke-width": 2
|
|
1010
|
-
})], 8, Qe)) :
|
|
1011
|
-
E(e) ? (
|
|
1010
|
+
})], 8, Qe)) : y("", !0)], 2),
|
|
1011
|
+
E(e) ? (t(), f("div", $e, [j(g(z), {
|
|
1012
1012
|
size: 12,
|
|
1013
1013
|
"stroke-width": 3
|
|
1014
|
-
})])) :
|
|
1014
|
+
})])) : y("", !0)
|
|
1015
1015
|
], 46, Ue))), 128))], 8, He)),
|
|
1016
|
-
|
|
1016
|
+
S("div", {
|
|
1017
1017
|
ref_key: "sentinelRef",
|
|
1018
1018
|
ref: P,
|
|
1019
1019
|
class: "tpl:h-4"
|
|
1020
1020
|
}, null, 512),
|
|
1021
|
-
|
|
1021
|
+
e.isLoading && e.items.length > 0 ? (t(), f("div", dt, [j(g(B), {
|
|
1022
1022
|
class: "tpl-spinner",
|
|
1023
1023
|
size: 20,
|
|
1024
1024
|
"stroke-width": 2,
|
|
1025
1025
|
style: { color: "var(--tpl-primary)" }
|
|
1026
|
-
})])) :
|
|
1026
|
+
})])) : y("", !0)
|
|
1027
1027
|
]));
|
|
1028
1028
|
}
|
|
1029
1029
|
}), [["__scopeId", "data-v-57c35946"]]), pt = ["data-tpl-theme"], mt = {
|
|
@@ -1045,7 +1045,7 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1045
1045
|
}, vt = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, yt = ["disabled"], bt = ["disabled"], xt = {
|
|
1046
1046
|
key: 0,
|
|
1047
1047
|
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
1048
|
-
}, St = { key: 1 }, Ct = /* @__PURE__ */
|
|
1048
|
+
}, St = { key: 1 }, Ct = /* @__PURE__ */ e({
|
|
1049
1049
|
__name: "MediaImportUrlModal",
|
|
1050
1050
|
props: {
|
|
1051
1051
|
visible: { type: Boolean },
|
|
@@ -1053,24 +1053,24 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1053
1053
|
error: {}
|
|
1054
1054
|
},
|
|
1055
1055
|
emits: ["import", "close"],
|
|
1056
|
-
setup(
|
|
1057
|
-
let
|
|
1058
|
-
|
|
1059
|
-
e && (
|
|
1056
|
+
setup(e, { emit: i }) {
|
|
1057
|
+
let o = e, s = i, { t: l } = Z(), u = c(Y, null), d = c(J, k(null)), p = k("");
|
|
1058
|
+
r(() => o.visible, (e) => {
|
|
1059
|
+
e && (p.value = "");
|
|
1060
1060
|
});
|
|
1061
|
-
function
|
|
1062
|
-
let e =
|
|
1063
|
-
e && !
|
|
1061
|
+
function h() {
|
|
1062
|
+
let e = p.value.trim();
|
|
1063
|
+
e && !o.isImporting && s("import", e);
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1066
|
-
|
|
1065
|
+
function E() {
|
|
1066
|
+
o.isImporting || s("close");
|
|
1067
1067
|
}
|
|
1068
|
-
let
|
|
1069
|
-
ge(
|
|
1068
|
+
let O = k(null);
|
|
1069
|
+
ge(O, D(() => o.visible));
|
|
1070
1070
|
function A(e) {
|
|
1071
|
-
e.stopPropagation(), e.key === "Enter" && (e.preventDefault(),
|
|
1071
|
+
e.stopPropagation(), e.key === "Enter" && (e.preventDefault(), h()), e.key === "Escape" && E();
|
|
1072
1072
|
}
|
|
1073
|
-
return (
|
|
1073
|
+
return (r, i) => (t(), b(v, { to: g(d) || "body" }, [j(w, {
|
|
1074
1074
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1075
1075
|
"enter-from-class": "tpl:opacity-0",
|
|
1076
1076
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -1078,63 +1078,63 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1078
1078
|
"leave-from-class": "tpl:opacity-100",
|
|
1079
1079
|
"leave-to-class": "tpl:opacity-0"
|
|
1080
1080
|
}, {
|
|
1081
|
-
default:
|
|
1081
|
+
default: n(() => [e.visible ? (t(), f("div", {
|
|
1082
1082
|
key: 0,
|
|
1083
|
-
"data-tpl-theme":
|
|
1084
|
-
class:
|
|
1083
|
+
"data-tpl-theme": g(u),
|
|
1084
|
+
class: _([g(d) ? void 0 : "tpl", "tpl:fixed tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:p-4"]),
|
|
1085
1085
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
1086
|
-
onClick:
|
|
1086
|
+
onClick: x(E, ["self"]),
|
|
1087
1087
|
onKeydown: A
|
|
1088
|
-
}, [
|
|
1088
|
+
}, [S("div", {
|
|
1089
1089
|
ref_key: "dialogRef",
|
|
1090
|
-
ref:
|
|
1090
|
+
ref: O,
|
|
1091
1091
|
role: "dialog",
|
|
1092
1092
|
"aria-modal": "true",
|
|
1093
1093
|
"aria-labelledby": "tpl-media-import-title",
|
|
1094
1094
|
class: "tpl:max-h-[90%] tpl:w-full tpl:max-w-sm tpl:overflow-y-auto tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
1095
1095
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1096
1096
|
}, [
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
"onUpdate:modelValue":
|
|
1097
|
+
S("h3", mt, C(g(l).mediaLibrary.importFromUrl), 1),
|
|
1098
|
+
S("div", ht, [a(S("input", {
|
|
1099
|
+
"onUpdate:modelValue": i[0] ||= (e) => p.value = e,
|
|
1100
1100
|
type: "url",
|
|
1101
|
-
"aria-label":
|
|
1102
|
-
"aria-invalid": !!
|
|
1103
|
-
"aria-describedby":
|
|
1101
|
+
"aria-label": g(l).mediaLibrary.importFromUrl,
|
|
1102
|
+
"aria-invalid": !!e.error,
|
|
1103
|
+
"aria-describedby": e.error ? "tpl-media-import-error" : void 0,
|
|
1104
1104
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
1105
1105
|
style: {
|
|
1106
1106
|
"border-color": "var(--tpl-border)",
|
|
1107
1107
|
"background-color": "var(--tpl-bg)",
|
|
1108
1108
|
color: "var(--tpl-text)"
|
|
1109
1109
|
},
|
|
1110
|
-
placeholder:
|
|
1111
|
-
disabled:
|
|
1110
|
+
placeholder: g(l).mediaLibrary.importUrlPlaceholder,
|
|
1111
|
+
disabled: e.isImporting,
|
|
1112
1112
|
autofocus: ""
|
|
1113
|
-
}, null, 8, gt), [[
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
class:
|
|
1113
|
+
}, null, 8, gt), [[T, p.value]])]),
|
|
1114
|
+
e.error ? (t(), f("p", _t, C(e.error), 1)) : y("", !0),
|
|
1115
|
+
S("div", vt, [S("button", {
|
|
1116
|
+
class: _(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150", { "tpl:cursor-not-allowed tpl:opacity-50": e.isImporting }]),
|
|
1117
1117
|
style: {
|
|
1118
1118
|
"border-color": "var(--tpl-border)",
|
|
1119
1119
|
color: "var(--tpl-text)",
|
|
1120
1120
|
"background-color": "var(--tpl-bg)"
|
|
1121
1121
|
},
|
|
1122
|
-
disabled:
|
|
1123
|
-
onClick:
|
|
1124
|
-
}, g(
|
|
1122
|
+
disabled: e.isImporting,
|
|
1123
|
+
onClick: E
|
|
1124
|
+
}, C(g(l).mediaLibrary.cancel), 11, yt), S("button", {
|
|
1125
1125
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
1126
1126
|
style: {
|
|
1127
1127
|
"background-color": "var(--tpl-primary)",
|
|
1128
1128
|
color: "var(--tpl-on-primary)"
|
|
1129
1129
|
},
|
|
1130
|
-
disabled: !
|
|
1131
|
-
onClick:
|
|
1132
|
-
}, [
|
|
1130
|
+
disabled: !p.value.trim() || e.isImporting,
|
|
1131
|
+
onClick: h
|
|
1132
|
+
}, [e.isImporting ? (t(), f("span", xt, [j(g(B), {
|
|
1133
1133
|
class: "tpl:animate-spin",
|
|
1134
1134
|
size: 12,
|
|
1135
1135
|
"stroke-width": 2
|
|
1136
|
-
}), m(" " + g(
|
|
1137
|
-
], 512)], 42, pt)) :
|
|
1136
|
+
}), m(" " + C(g(l).mediaLibrary.importing), 1)])) : (t(), f("span", St, C(g(l).mediaLibrary.import), 1))], 8, bt)])
|
|
1137
|
+
], 512)], 42, pt)) : y("", !0)]),
|
|
1138
1138
|
_: 1
|
|
1139
1139
|
})], 8, ["to"]));
|
|
1140
1140
|
}
|
|
@@ -1142,62 +1142,62 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1142
1142
|
key: 0,
|
|
1143
1143
|
class: "tpl:shrink-0",
|
|
1144
1144
|
style: { color: "var(--tpl-text-dim)" }
|
|
1145
|
-
}, Ot = /* @__PURE__ */
|
|
1145
|
+
}, Ot = /* @__PURE__ */ e({
|
|
1146
1146
|
__name: "MediaMovePicker",
|
|
1147
1147
|
props: {
|
|
1148
1148
|
folders: {},
|
|
1149
1149
|
currentFolderId: {}
|
|
1150
1150
|
},
|
|
1151
1151
|
emits: ["select", "close"],
|
|
1152
|
-
setup(
|
|
1153
|
-
let r = n, { t:
|
|
1154
|
-
function
|
|
1152
|
+
setup(e, { emit: n }) {
|
|
1153
|
+
let r = n, { t: i } = Z(), a = k(null);
|
|
1154
|
+
function s(e, t = 0) {
|
|
1155
1155
|
let n = [];
|
|
1156
1156
|
for (let r of e) n.push({
|
|
1157
1157
|
id: r.id,
|
|
1158
1158
|
name: r.name,
|
|
1159
1159
|
depth: t
|
|
1160
|
-
}), r.children.length && n.push(...
|
|
1160
|
+
}), r.children.length && n.push(...s(r.children, t + 1));
|
|
1161
1161
|
return n;
|
|
1162
1162
|
}
|
|
1163
|
-
return
|
|
1163
|
+
return q(a, () => {
|
|
1164
1164
|
r("close");
|
|
1165
|
-
}), (
|
|
1165
|
+
}), (n, c) => (t(), f("div", {
|
|
1166
1166
|
ref_key: "pickerRef",
|
|
1167
|
-
ref:
|
|
1167
|
+
ref: a,
|
|
1168
1168
|
"data-testid": "media-move-picker",
|
|
1169
1169
|
class: "tpl:absolute tpl:bottom-full tpl:left-0 tpl:z-10 tpl:mb-2 tpl:w-56 tpl:overflow-hidden tpl:rounded-lg tpl:border tpl:shadow-lg",
|
|
1170
1170
|
style: {
|
|
1171
1171
|
"border-color": "var(--tpl-border)",
|
|
1172
1172
|
"background-color": "var(--tpl-bg-elevated)"
|
|
1173
1173
|
}
|
|
1174
|
-
}, [
|
|
1174
|
+
}, [S("div", wt, [e.currentFolderId === null ? y("", !0) : (t(), f("button", {
|
|
1175
1175
|
key: 0,
|
|
1176
1176
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
|
|
1177
1177
|
style: { color: "var(--tpl-text)" },
|
|
1178
|
-
onClick:
|
|
1179
|
-
}, [
|
|
1178
|
+
onClick: c[0] ||= (e) => r("select", null)
|
|
1179
|
+
}, [j(g(W), {
|
|
1180
1180
|
class: "tpl:shrink-0",
|
|
1181
1181
|
size: 14,
|
|
1182
1182
|
"stroke-width": 1.5
|
|
1183
|
-
}), m(" " + g(
|
|
1184
|
-
key:
|
|
1183
|
+
}), m(" " + C(g(i).mediaLibrary.moveToRoot), 1)])), (t(!0), f(A, null, o(s(e.folders), (n) => (t(), f("button", {
|
|
1184
|
+
key: n.id,
|
|
1185
1185
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:py-1.5 tpl:pr-3 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
|
|
1186
|
-
style:
|
|
1187
|
-
paddingLeft: `${
|
|
1188
|
-
color:
|
|
1189
|
-
opacity:
|
|
1186
|
+
style: O({
|
|
1187
|
+
paddingLeft: `${n.depth * 16 + 12}px`,
|
|
1188
|
+
color: n.id === e.currentFolderId ? "var(--tpl-text-dim)" : "var(--tpl-text)",
|
|
1189
|
+
opacity: n.id === e.currentFolderId ? .5 : 1
|
|
1190
1190
|
}),
|
|
1191
|
-
disabled:
|
|
1192
|
-
onClick: (
|
|
1191
|
+
disabled: n.id === e.currentFolderId,
|
|
1192
|
+
onClick: (e) => r("select", n.id)
|
|
1193
1193
|
}, [
|
|
1194
|
-
|
|
1194
|
+
j(g(F), {
|
|
1195
1195
|
class: "tpl:shrink-0",
|
|
1196
1196
|
size: 14,
|
|
1197
1197
|
"stroke-width": 1.5
|
|
1198
1198
|
}),
|
|
1199
|
-
|
|
1200
|
-
|
|
1199
|
+
S("span", Et, C(n.name), 1),
|
|
1200
|
+
n.id === e.currentFolderId ? (t(), f("span", Dt, C(g(i).mediaLibrary.currentFolder), 1)) : y("", !0)
|
|
1201
1201
|
], 12, Tt))), 128))])], 512));
|
|
1202
1202
|
}
|
|
1203
1203
|
}), kt = { class: "tpl:flex tpl:items-center tpl:gap-3" }, At = ["src", "alt"], jt = {
|
|
@@ -1210,14 +1210,14 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1210
1210
|
}, Pt = {
|
|
1211
1211
|
class: "tpl:mt-0.5 tpl:text-[10px]",
|
|
1212
1212
|
style: { color: "var(--tpl-text-muted)" }
|
|
1213
|
-
}, Ft = /*#__PURE__*/
|
|
1213
|
+
}, Ft = /*#__PURE__*/ N(/* @__PURE__ */ e({
|
|
1214
1214
|
__name: "MediaPreviewPanel",
|
|
1215
1215
|
props: {
|
|
1216
1216
|
item: {},
|
|
1217
1217
|
folders: {}
|
|
1218
1218
|
},
|
|
1219
1219
|
setup(e) {
|
|
1220
|
-
let
|
|
1220
|
+
let n = e, r = c(X, null), { isImageMimeType: i } = Q();
|
|
1221
1221
|
function a(e, t, n = []) {
|
|
1222
1222
|
for (let r of e) {
|
|
1223
1223
|
let e = [...n, r.name];
|
|
@@ -1229,11 +1229,11 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1229
1229
|
}
|
|
1230
1230
|
return null;
|
|
1231
1231
|
}
|
|
1232
|
-
let
|
|
1233
|
-
if (!
|
|
1234
|
-
let e = a(
|
|
1232
|
+
let o = D(() => {
|
|
1233
|
+
if (!n.item.folderId || !n.folders) return null;
|
|
1234
|
+
let e = a(n.folders, n.item.folderId);
|
|
1235
1235
|
return e ? e.join("/") : null;
|
|
1236
|
-
}),
|
|
1236
|
+
}), s = D(() => n.item.mimeType ?? ""), l = D(() => i(s.value));
|
|
1237
1237
|
function u(e) {
|
|
1238
1238
|
return Ie(e, r?.value, {
|
|
1239
1239
|
year: "numeric",
|
|
@@ -1241,37 +1241,37 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1241
1241
|
day: "numeric"
|
|
1242
1242
|
});
|
|
1243
1243
|
}
|
|
1244
|
-
let d =
|
|
1245
|
-
return (
|
|
1244
|
+
let d = D(() => n.item.filename || n.item.url);
|
|
1245
|
+
return (n, r) => (t(), f("div", kt, [l.value ? (t(), f("img", {
|
|
1246
1246
|
key: 0,
|
|
1247
1247
|
src: e.item.url,
|
|
1248
1248
|
alt: e.item.alt || d.value,
|
|
1249
1249
|
class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
|
|
1250
1250
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1251
|
-
}, null, 8, At)) : (
|
|
1252
|
-
"mime-type":
|
|
1251
|
+
}, null, 8, At)) : (t(), f("div", jt, [j(Fe, {
|
|
1252
|
+
"mime-type": s.value,
|
|
1253
1253
|
class: "tpl-preview-icon"
|
|
1254
|
-
}, null, 8, ["mime-type"])])),
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
e.item.size == null ?
|
|
1258
|
-
e.item.createdAt ? (
|
|
1259
|
-
l.value && e.item.width && e.item.height ? (
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1254
|
+
}, null, 8, ["mime-type"])])), S("div", Mt, [
|
|
1255
|
+
S("p", Nt, C(d.value), 1),
|
|
1256
|
+
S("p", Pt, [
|
|
1257
|
+
e.item.size == null ? y("", !0) : (t(), f(A, { key: 0 }, [m(C(g($)(e.item.size)), 1)], 64)),
|
|
1258
|
+
e.item.createdAt ? (t(), f(A, { key: 1 }, [e.item.size == null ? y("", !0) : (t(), f(A, { key: 0 }, [m(" · ")], 64)), m(" " + C(u(e.item.createdAt)), 1)], 64)) : y("", !0),
|
|
1259
|
+
l.value && e.item.width && e.item.height ? (t(), f(A, { key: 2 }, [m(" · " + C(e.item.width) + "×" + C(e.item.height) + "px ", 1)], 64)) : y("", !0),
|
|
1260
|
+
o.value ? (t(), f(A, { key: 3 }, [
|
|
1261
|
+
r[0] ||= m(" · ", -1),
|
|
1262
|
+
j(g(F), {
|
|
1263
1263
|
class: "tpl:mb-px tpl:inline",
|
|
1264
1264
|
size: 9,
|
|
1265
1265
|
"stroke-width": 2
|
|
1266
1266
|
}),
|
|
1267
|
-
m(" " +
|
|
1268
|
-
], 64)) :
|
|
1267
|
+
m(" " + C(o.value), 1)
|
|
1268
|
+
], 64)) : y("", !0)
|
|
1269
1269
|
]),
|
|
1270
|
-
l.value ? (
|
|
1270
|
+
l.value ? (t(), f("p", {
|
|
1271
1271
|
key: 0,
|
|
1272
|
-
class:
|
|
1272
|
+
class: _(["tpl:mt-0.5 tpl:truncate tpl:text-[10px] tpl:italic", { "tpl:invisible": !e.item.alt }]),
|
|
1273
1273
|
style: { color: "var(--tpl-text-dim)" }
|
|
1274
|
-
},
|
|
1274
|
+
}, C(e.item.alt || "\xA0"), 3)) : y("", !0)
|
|
1275
1275
|
])]));
|
|
1276
1276
|
}
|
|
1277
1277
|
}), [["__scopeId", "data-v-50993988"]]), It = ["data-tpl-theme"], Lt = {
|
|
@@ -1304,7 +1304,7 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1304
1304
|
role: "alert",
|
|
1305
1305
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1306
1306
|
style: { color: "var(--tpl-danger)" }
|
|
1307
|
-
}, Kt = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, qt = ["disabled"], Jt = ["disabled"], Yt = /* @__PURE__ */
|
|
1307
|
+
}, Kt = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, qt = ["disabled"], Jt = ["disabled"], Yt = /* @__PURE__ */ e({
|
|
1308
1308
|
__name: "MediaReplaceModal",
|
|
1309
1309
|
props: {
|
|
1310
1310
|
visible: { type: Boolean },
|
|
@@ -1314,28 +1314,28 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1314
1314
|
error: {}
|
|
1315
1315
|
},
|
|
1316
1316
|
emits: ["replace", "close"],
|
|
1317
|
-
setup(
|
|
1318
|
-
let
|
|
1319
|
-
if (!
|
|
1320
|
-
let e = (
|
|
1317
|
+
setup(e, { emit: i }) {
|
|
1318
|
+
let a = e, o = i, { t: s } = Z(), l = c(Y, null), u = c(J, k(null)), d = k(null), p = k(null), m = D(() => {
|
|
1319
|
+
if (!a.item) return "";
|
|
1320
|
+
let e = (a.item.filename ?? "").split(".");
|
|
1321
1321
|
return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
|
|
1322
|
-
}),
|
|
1323
|
-
|
|
1324
|
-
e || (
|
|
1322
|
+
}), h = D(() => m.value ? `.${m.value}` : "*"), T = D(() => (a.usageInfo?.templateCount ?? 0) > 0);
|
|
1323
|
+
r(() => a.visible, (e) => {
|
|
1324
|
+
e || (p.value = null, d.value && (d.value.value = ""));
|
|
1325
1325
|
});
|
|
1326
1326
|
function E(e) {
|
|
1327
1327
|
let t = e.target;
|
|
1328
|
-
t.files && t.files.length > 0 && (
|
|
1328
|
+
t.files && t.files.length > 0 && (p.value = t.files[0]);
|
|
1329
1329
|
}
|
|
1330
|
-
function
|
|
1331
|
-
|
|
1330
|
+
function O() {
|
|
1331
|
+
p.value && o("replace", p.value);
|
|
1332
1332
|
}
|
|
1333
|
-
let A =
|
|
1334
|
-
ge(A,
|
|
1335
|
-
function
|
|
1336
|
-
e.stopPropagation(), e.key === "Escape" &&
|
|
1333
|
+
let A = k(null);
|
|
1334
|
+
ge(A, D(() => a.visible && a.item !== null));
|
|
1335
|
+
function M(e) {
|
|
1336
|
+
e.stopPropagation(), e.key === "Escape" && o("close");
|
|
1337
1337
|
}
|
|
1338
|
-
return (
|
|
1338
|
+
return (r, i) => (t(), b(v, { to: g(u) || "body" }, [j(w, {
|
|
1339
1339
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1340
1340
|
"enter-from-class": "tpl:opacity-0",
|
|
1341
1341
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -1343,14 +1343,14 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1343
1343
|
"leave-from-class": "tpl:opacity-100",
|
|
1344
1344
|
"leave-to-class": "tpl:opacity-0"
|
|
1345
1345
|
}, {
|
|
1346
|
-
default:
|
|
1346
|
+
default: n(() => [e.visible && e.item ? (t(), f("div", {
|
|
1347
1347
|
key: 0,
|
|
1348
|
-
"data-tpl-theme":
|
|
1349
|
-
class:
|
|
1348
|
+
"data-tpl-theme": g(l),
|
|
1349
|
+
class: _([g(u) ? void 0 : "tpl", "tpl:fixed tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:p-4"]),
|
|
1350
1350
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
1351
|
-
onClick:
|
|
1352
|
-
onKeydown:
|
|
1353
|
-
}, [
|
|
1351
|
+
onClick: i[1] ||= x((e) => o("close"), ["self"]),
|
|
1352
|
+
onKeydown: M
|
|
1353
|
+
}, [S("div", {
|
|
1354
1354
|
ref_key: "dialogRef",
|
|
1355
1355
|
ref: A,
|
|
1356
1356
|
role: "dialog",
|
|
@@ -1359,17 +1359,17 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1359
1359
|
class: "tpl:max-h-[90%] tpl:w-full tpl:max-w-sm tpl:overflow-y-auto tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
1360
1360
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1361
1361
|
}, [
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1362
|
+
S("h3", Lt, C(g(s).mediaLibrary.replaceWarningTitle), 1),
|
|
1363
|
+
S("p", Rt, C(g(s).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${m.value}`)), 1),
|
|
1364
|
+
T.value ? (t(), f("p", zt, C(g(s).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.templateCount.toString())), 1)) : y("", !0),
|
|
1365
|
+
S("div", Bt, [S("p", Vt, C(e.item.filename), 1)]),
|
|
1366
|
+
S("div", Ht, [S("label", Ut, C(g(s).mediaLibrary.replaceSelectFile), 1), S("input", {
|
|
1367
1367
|
ref_key: "fileInputRef",
|
|
1368
|
-
ref:
|
|
1368
|
+
ref: d,
|
|
1369
1369
|
type: "file",
|
|
1370
|
-
accept:
|
|
1371
|
-
"aria-invalid": !!
|
|
1372
|
-
"aria-describedby":
|
|
1370
|
+
accept: h.value,
|
|
1371
|
+
"aria-invalid": !!e.error,
|
|
1372
|
+
"aria-describedby": e.error ? "tpl-media-replace-error" : void 0,
|
|
1373
1373
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs",
|
|
1374
1374
|
style: {
|
|
1375
1375
|
"border-color": "var(--tpl-border)",
|
|
@@ -1378,26 +1378,26 @@ var Re = { class: "tpl:p-4" }, ze = ["aria-label"], Be = {
|
|
|
1378
1378
|
},
|
|
1379
1379
|
onChange: E
|
|
1380
1380
|
}, null, 40, Wt)]),
|
|
1381
|
-
|
|
1382
|
-
|
|
1381
|
+
e.error ? (t(), f("p", Gt, C(e.error), 1)) : y("", !0),
|
|
1382
|
+
S("div", Kt, [S("button", {
|
|
1383
1383
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
1384
1384
|
style: {
|
|
1385
1385
|
"border-color": "var(--tpl-border)",
|
|
1386
1386
|
color: "var(--tpl-text)",
|
|
1387
1387
|
"background-color": "var(--tpl-bg)"
|
|
1388
1388
|
},
|
|
1389
|
-
disabled:
|
|
1390
|
-
onClick:
|
|
1391
|
-
}, g(
|
|
1389
|
+
disabled: e.isReplacing,
|
|
1390
|
+
onClick: i[0] ||= (e) => o("close")
|
|
1391
|
+
}, C(g(s).mediaLibrary.cancel), 9, qt), S("button", {
|
|
1392
1392
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
1393
1393
|
style: {
|
|
1394
1394
|
"background-color": "var(--tpl-primary)",
|
|
1395
1395
|
color: "var(--tpl-on-primary)"
|
|
1396
1396
|
},
|
|
1397
|
-
disabled: !
|
|
1398
|
-
onClick:
|
|
1399
|
-
},
|
|
1400
|
-
], 512)], 42, It)) :
|
|
1397
|
+
disabled: !p.value || e.isReplacing,
|
|
1398
|
+
onClick: O
|
|
1399
|
+
}, C(e.isReplacing ? g(s).mediaLibrary.replacing : g(s).mediaLibrary.replace), 9, Jt)])
|
|
1400
|
+
], 512)], 42, It)) : y("", !0)]),
|
|
1401
1401
|
_: 1
|
|
1402
1402
|
})], 8, ["to"]));
|
|
1403
1403
|
}
|
|
@@ -1440,71 +1440,71 @@ var Zt = [
|
|
|
1440
1440
|
role: "alert",
|
|
1441
1441
|
class: "tpl:mt-1.5 tpl:text-xs tpl:break-words",
|
|
1442
1442
|
style: { color: "var(--tpl-danger)" }
|
|
1443
|
-
}, rn = /* @__PURE__ */
|
|
1443
|
+
}, rn = /* @__PURE__ */ e({
|
|
1444
1444
|
__name: "MediaUploadZone",
|
|
1445
1445
|
props: {
|
|
1446
1446
|
isUploading: { type: Boolean },
|
|
1447
1447
|
uploadProgress: {}
|
|
1448
1448
|
},
|
|
1449
1449
|
emits: ["upload"],
|
|
1450
|
-
setup(
|
|
1451
|
-
let
|
|
1450
|
+
setup(e, { emit: n }) {
|
|
1451
|
+
let r = n, { t: i, format: a } = Z(), o = c(X, null), { allAcceptedInputString: s, restrictsMimeTypes: l, availableCategories: u, maxFileSize: d, isAcceptedFile: p } = Q(), m = {
|
|
1452
1452
|
images: "filterImages",
|
|
1453
1453
|
documents: "filterDocuments",
|
|
1454
1454
|
videos: "filterVideos",
|
|
1455
1455
|
audio: "filterAudio"
|
|
1456
|
-
},
|
|
1457
|
-
let e =
|
|
1458
|
-
return Number.isFinite(
|
|
1456
|
+
}, h = D(() => {
|
|
1457
|
+
let e = i.mediaLibrary, t = l.value ? Xt(u.value.map((t) => e[m[t]]), o?.value) : i.mediaLibrary.acceptedAnyType;
|
|
1458
|
+
return Number.isFinite(d.value) ? a(i.mediaLibrary.acceptedFormatsMaxSize, {
|
|
1459
1459
|
formats: t,
|
|
1460
|
-
size: $(
|
|
1460
|
+
size: $(d.value)
|
|
1461
1461
|
}) : t;
|
|
1462
|
-
}),
|
|
1462
|
+
}), v = k([]), b = k();
|
|
1463
1463
|
function x(e) {
|
|
1464
1464
|
let t = [], n = [];
|
|
1465
|
-
for (let r of Array.from(e))
|
|
1466
|
-
|
|
1465
|
+
for (let r of Array.from(e)) p(r) ? t.push(r) : n.push(r.name);
|
|
1466
|
+
v.value = n, t.length && r("upload", t);
|
|
1467
1467
|
}
|
|
1468
|
-
let { isOverDropZone:
|
|
1468
|
+
let { isOverDropZone: w } = le(b, { onDrop: (e) => {
|
|
1469
1469
|
e?.length && x(e);
|
|
1470
|
-
} }), { open: T, onChange: E } =
|
|
1471
|
-
accept:
|
|
1470
|
+
} }), { open: T, onChange: E } = ce({
|
|
1471
|
+
accept: s.value,
|
|
1472
1472
|
multiple: !0
|
|
1473
1473
|
});
|
|
1474
1474
|
return E((e) => {
|
|
1475
1475
|
e?.length && x(e);
|
|
1476
|
-
}), (
|
|
1476
|
+
}), (n, r) => (t(), f(A, null, [S("button", {
|
|
1477
1477
|
ref_key: "dropZoneRef",
|
|
1478
1478
|
ref: b,
|
|
1479
1479
|
type: "button",
|
|
1480
1480
|
"data-testid": "media-upload-zone",
|
|
1481
|
-
class:
|
|
1482
|
-
"aria-label":
|
|
1483
|
-
"aria-describedby":
|
|
1484
|
-
"aria-busy":
|
|
1481
|
+
class: _(["tpl-upload-zone tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", g(w) ? "tpl-upload-zone-active" : ""]),
|
|
1482
|
+
"aria-label": g(i).mediaLibrary.dropOrClick,
|
|
1483
|
+
"aria-describedby": e.isUploading ? void 0 : "tpl-media-upload-hint",
|
|
1484
|
+
"aria-busy": e.isUploading,
|
|
1485
1485
|
style: {
|
|
1486
1486
|
"border-color": "var(--tpl-border-light)",
|
|
1487
1487
|
"background-color": "var(--tpl-bg)"
|
|
1488
1488
|
},
|
|
1489
|
-
onClick:
|
|
1490
|
-
}, [
|
|
1489
|
+
onClick: r[0] ||= (e) => g(T)()
|
|
1490
|
+
}, [e.isUploading ? (t(), f("div", Qt, [j(g(B), {
|
|
1491
1491
|
class: "tpl-spinner",
|
|
1492
1492
|
size: 20,
|
|
1493
1493
|
"stroke-width": 2,
|
|
1494
1494
|
style: { color: "var(--tpl-primary)" }
|
|
1495
|
-
}),
|
|
1496
|
-
current:
|
|
1497
|
-
total:
|
|
1498
|
-
}) :
|
|
1499
|
-
|
|
1495
|
+
}), S("span", $t, C(e.uploadProgress && e.uploadProgress.total > 1 ? g(a)(g(i).mediaLibrary.uploadingProgress, {
|
|
1496
|
+
current: e.uploadProgress.current,
|
|
1497
|
+
total: e.uploadProgress.total
|
|
1498
|
+
}) : g(i).mediaLibrary.uploading), 1)])) : (t(), f(A, { key: 1 }, [
|
|
1499
|
+
j(g(H), {
|
|
1500
1500
|
class: "tpl:mb-2",
|
|
1501
1501
|
size: 24,
|
|
1502
1502
|
"stroke-width": 1.5,
|
|
1503
1503
|
style: { color: "var(--tpl-text-dim)" }
|
|
1504
1504
|
}),
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
], 64))], 10, Zt),
|
|
1505
|
+
S("p", en, C(g(i).mediaLibrary.dropOrClick), 1),
|
|
1506
|
+
S("p", tn, C(h.value), 1)
|
|
1507
|
+
], 64))], 10, Zt), v.value.length ? (t(), f("p", nn, C(g(a)(g(i).mediaLibrary.uploadRejected, { files: v.value.join(", ") })), 1)) : y("", !0)], 64));
|
|
1508
1508
|
}
|
|
1509
1509
|
}), an = ["aria-label"], on = [
|
|
1510
1510
|
"width",
|
|
@@ -1530,52 +1530,52 @@ var Zt = [
|
|
|
1530
1530
|
"background-color": "var(--tpl-text)",
|
|
1531
1531
|
color: "var(--tpl-bg-elevated)"
|
|
1532
1532
|
}
|
|
1533
|
-
}, un = /* @__PURE__ */
|
|
1533
|
+
}, un = /* @__PURE__ */ e({
|
|
1534
1534
|
__name: "StorageProgressRing",
|
|
1535
1535
|
props: {
|
|
1536
1536
|
usedBytes: {},
|
|
1537
1537
|
limitBytes: {},
|
|
1538
1538
|
size: {}
|
|
1539
1539
|
},
|
|
1540
|
-
setup(
|
|
1541
|
-
let
|
|
1542
|
-
used:
|
|
1543
|
-
total:
|
|
1544
|
-
remaining:
|
|
1540
|
+
setup(e) {
|
|
1541
|
+
let r = e, { t: i, format: a } = Z(), o = k(!1), s = D(() => r.size ?? 24), c = D(() => Math.max(2, s.value / 8)), l = D(() => (s.value - c.value) / 2), u = D(() => 2 * Math.PI * l.value), d = D(() => r.limitBytes <= 0 ? 0 : Math.min(100, r.usedBytes / r.limitBytes * 100)), p = D(() => u.value - d.value / 100 * u.value), h = D(() => d.value >= 95 ? "var(--tpl-danger)" : d.value >= 75 ? "var(--tpl-warning)" : "var(--tpl-primary)"), g = D(() => $(r.usedBytes)), _ = D(() => $(r.limitBytes)), v = D(() => Math.max(0, r.limitBytes - r.usedBytes)), b = D(() => $(v.value)), x = D(() => a(i.mediaLibrary.storageTooltip, {
|
|
1542
|
+
used: g.value,
|
|
1543
|
+
total: _.value,
|
|
1544
|
+
remaining: b.value
|
|
1545
1545
|
}));
|
|
1546
|
-
return (e,
|
|
1546
|
+
return (e, r) => (t(), f("div", {
|
|
1547
1547
|
"data-testid": "media-storage-ring",
|
|
1548
1548
|
class: "tpl:relative tpl:inline-flex tpl:cursor-help tpl:items-center tpl:justify-center",
|
|
1549
1549
|
tabindex: "0",
|
|
1550
|
-
"aria-label":
|
|
1551
|
-
onMouseenter:
|
|
1552
|
-
onMouseleave:
|
|
1553
|
-
onFocus:
|
|
1554
|
-
onBlur:
|
|
1555
|
-
}, [(
|
|
1550
|
+
"aria-label": x.value,
|
|
1551
|
+
onMouseenter: r[0] ||= (e) => o.value = !0,
|
|
1552
|
+
onMouseleave: r[1] ||= (e) => o.value = !1,
|
|
1553
|
+
onFocus: r[2] ||= (e) => o.value = !0,
|
|
1554
|
+
onBlur: r[3] ||= (e) => o.value = !1
|
|
1555
|
+
}, [(t(), f("svg", {
|
|
1556
1556
|
width: s.value,
|
|
1557
1557
|
height: s.value,
|
|
1558
1558
|
class: "tpl:-rotate-90",
|
|
1559
1559
|
viewBox: `0 0 ${s.value} ${s.value}`
|
|
1560
|
-
}, [
|
|
1560
|
+
}, [S("circle", {
|
|
1561
1561
|
cx: s.value / 2,
|
|
1562
1562
|
cy: s.value / 2,
|
|
1563
|
-
r:
|
|
1563
|
+
r: l.value,
|
|
1564
1564
|
fill: "none",
|
|
1565
1565
|
"stroke-width": c.value,
|
|
1566
1566
|
style: { stroke: "var(--tpl-border)" }
|
|
1567
|
-
}, null, 8, sn),
|
|
1567
|
+
}, null, 8, sn), S("circle", {
|
|
1568
1568
|
cx: s.value / 2,
|
|
1569
1569
|
cy: s.value / 2,
|
|
1570
|
-
r:
|
|
1570
|
+
r: l.value,
|
|
1571
1571
|
fill: "none",
|
|
1572
1572
|
"stroke-width": c.value,
|
|
1573
|
-
stroke:
|
|
1573
|
+
stroke: h.value,
|
|
1574
1574
|
"stroke-linecap": "round",
|
|
1575
|
-
"stroke-dasharray":
|
|
1576
|
-
"stroke-dashoffset":
|
|
1575
|
+
"stroke-dasharray": u.value,
|
|
1576
|
+
"stroke-dashoffset": p.value,
|
|
1577
1577
|
class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
|
|
1578
|
-
}, null, 8, cn)], 8, on)),
|
|
1578
|
+
}, null, 8, cn)], 8, on)), j(w, {
|
|
1579
1579
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1580
1580
|
"enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
|
|
1581
1581
|
"enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
@@ -1583,10 +1583,10 @@ var Zt = [
|
|
|
1583
1583
|
"leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
1584
1584
|
"leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
|
|
1585
1585
|
}, {
|
|
1586
|
-
default:
|
|
1586
|
+
default: n(() => [o.value ? (t(), f("div", ln, [m(C(x.value) + " ", 1), r[4] ||= S("div", {
|
|
1587
1587
|
class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
|
|
1588
1588
|
style: { "background-color": "var(--tpl-text)" }
|
|
1589
|
-
}, null, -1)])) :
|
|
1589
|
+
}, null, -1)])) : y("", !0)]),
|
|
1590
1590
|
_: 1
|
|
1591
1591
|
})], 40, an));
|
|
1592
1592
|
}
|
|
@@ -1606,71 +1606,71 @@ function dn(e) {
|
|
|
1606
1606
|
return n;
|
|
1607
1607
|
}
|
|
1608
1608
|
// ../media-library/src/composables/useMediaLibraryUI.ts
|
|
1609
|
-
function fn(
|
|
1610
|
-
let { library:
|
|
1609
|
+
function fn(e) {
|
|
1610
|
+
let { library: t, translations: n } = e;
|
|
1611
1611
|
function i() {
|
|
1612
|
-
return "value" in
|
|
1612
|
+
return "value" in n && typeof n.value == "object" ? n.value : n;
|
|
1613
1613
|
}
|
|
1614
|
-
let a =
|
|
1614
|
+
let a = k("grid"), o = k(!1), s = k(""), c = k(null), l = k(!1), u = k(!1), d = D(() => t.previewItem.value?.url ?? null), f = D(() => t.frequentlyUsedItems.value.length > 0), p = D(() => t.viewMode.value === "frequently-used" ? t.frequentlyUsedItems.value : t.items.value), m = D(() => Object.values(t.deleteUsageInfo.value).some((e) => e.templateCount > 0)), h = D(() => dn(t.folders.value)), g = {
|
|
1615
1615
|
images: () => i().mediaLibrary.filterImages,
|
|
1616
1616
|
documents: () => i().mediaLibrary.filterDocuments,
|
|
1617
1617
|
videos: () => i().mediaLibrary.filterVideos,
|
|
1618
1618
|
audio: () => i().mediaLibrary.filterAudio
|
|
1619
1619
|
};
|
|
1620
|
-
function
|
|
1621
|
-
return
|
|
1620
|
+
function _(e) {
|
|
1621
|
+
return g[e]?.() ?? e;
|
|
1622
1622
|
}
|
|
1623
|
-
|
|
1624
|
-
e &&
|
|
1623
|
+
r(o, (e) => {
|
|
1624
|
+
e && t.loadFolders();
|
|
1625
1625
|
});
|
|
1626
|
-
let
|
|
1627
|
-
|
|
1626
|
+
let v = oe((e) => {
|
|
1627
|
+
t.search(e);
|
|
1628
1628
|
}, 300);
|
|
1629
|
-
function
|
|
1630
|
-
s.value = e,
|
|
1629
|
+
function y(e) {
|
|
1630
|
+
s.value = e, v(e);
|
|
1631
1631
|
}
|
|
1632
|
-
let { copy:
|
|
1632
|
+
let { copy: b, copied: x } = se({
|
|
1633
1633
|
copiedDuring: 2e3,
|
|
1634
1634
|
legacy: !0
|
|
1635
1635
|
});
|
|
1636
|
-
async function
|
|
1637
|
-
await
|
|
1636
|
+
async function S(e) {
|
|
1637
|
+
await t.uploadFiles(e);
|
|
1638
1638
|
}
|
|
1639
|
-
function
|
|
1640
|
-
|
|
1639
|
+
function C(e) {
|
|
1640
|
+
t.selectItem(e);
|
|
1641
1641
|
}
|
|
1642
|
-
async function
|
|
1643
|
-
await
|
|
1642
|
+
async function w(e, n) {
|
|
1643
|
+
await t.createFolder(e, n);
|
|
1644
1644
|
}
|
|
1645
|
-
async function
|
|
1646
|
-
await
|
|
1645
|
+
async function T(e, n) {
|
|
1646
|
+
await t.renameFolder(e, n);
|
|
1647
1647
|
}
|
|
1648
|
-
async function
|
|
1649
|
-
await
|
|
1648
|
+
async function E(e) {
|
|
1649
|
+
await t.deleteFolder(e);
|
|
1650
1650
|
}
|
|
1651
|
-
function
|
|
1651
|
+
function O(e) {
|
|
1652
1652
|
c.value = e;
|
|
1653
1653
|
}
|
|
1654
|
-
async function A(e,
|
|
1655
|
-
return i && !await
|
|
1654
|
+
async function A(e, n, r, i) {
|
|
1655
|
+
return i && !await t.replaceMediaDirectly(e, i.file) ? "failed" : await t.updateFile(e, n, r) ? (c.value = null, "saved") : i ? "replaced" : "failed";
|
|
1656
1656
|
}
|
|
1657
1657
|
async function j(e) {
|
|
1658
|
-
await
|
|
1658
|
+
await t.importFromUrl(e) && (l.value = !1);
|
|
1659
1659
|
}
|
|
1660
1660
|
async function M(e) {
|
|
1661
|
-
|
|
1661
|
+
u.value = !1, await t.moveSelected(e);
|
|
1662
1662
|
}
|
|
1663
|
-
async function
|
|
1664
|
-
await
|
|
1663
|
+
async function N() {
|
|
1664
|
+
await t.checkUsageBeforeDelete();
|
|
1665
1665
|
}
|
|
1666
|
-
function
|
|
1667
|
-
|
|
1666
|
+
function P(e) {
|
|
1667
|
+
t.checkUsageBeforeReplace(e);
|
|
1668
1668
|
}
|
|
1669
|
-
async function
|
|
1670
|
-
await
|
|
1669
|
+
async function F(e) {
|
|
1670
|
+
await t.replaceFile(e);
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1673
|
-
|
|
1672
|
+
function I() {
|
|
1673
|
+
t.clearSelection(), t.cancelDelete(), t.cancelReplace(), s.value = "", t.searchQuery.value = "", t.categoryFilter.value = null, t.sortOption.value = "newest", t.viewMode.value = "files", c.value = null, l.value = !1;
|
|
1674
1674
|
}
|
|
1675
1675
|
return {
|
|
1676
1676
|
layoutMode: a,
|
|
@@ -1678,396 +1678,396 @@ function fn(t) {
|
|
|
1678
1678
|
searchInput: s,
|
|
1679
1679
|
editingItem: c,
|
|
1680
1680
|
showImportUrlModal: l,
|
|
1681
|
-
showMovePicker:
|
|
1682
|
-
selectedUrl:
|
|
1683
|
-
hasFrequentlyUsed:
|
|
1684
|
-
displayItems:
|
|
1685
|
-
hasUsedFiles:
|
|
1686
|
-
folderTree:
|
|
1687
|
-
copy:
|
|
1688
|
-
copied:
|
|
1689
|
-
getCategoryLabel:
|
|
1690
|
-
handleSearchInput:
|
|
1691
|
-
handleUpload:
|
|
1692
|
-
handleSelect:
|
|
1693
|
-
handleCreateFolder:
|
|
1694
|
-
handleRenameFolder:
|
|
1695
|
-
handleDeleteFolder:
|
|
1696
|
-
handleEditItem:
|
|
1681
|
+
showMovePicker: u,
|
|
1682
|
+
selectedUrl: d,
|
|
1683
|
+
hasFrequentlyUsed: f,
|
|
1684
|
+
displayItems: p,
|
|
1685
|
+
hasUsedFiles: m,
|
|
1686
|
+
folderTree: h,
|
|
1687
|
+
copy: b,
|
|
1688
|
+
copied: x,
|
|
1689
|
+
getCategoryLabel: _,
|
|
1690
|
+
handleSearchInput: y,
|
|
1691
|
+
handleUpload: S,
|
|
1692
|
+
handleSelect: C,
|
|
1693
|
+
handleCreateFolder: w,
|
|
1694
|
+
handleRenameFolder: T,
|
|
1695
|
+
handleDeleteFolder: E,
|
|
1696
|
+
handleEditItem: O,
|
|
1697
1697
|
handleEditSave: A,
|
|
1698
1698
|
handleImportFromUrl: j,
|
|
1699
1699
|
handleMoveToFolder: M,
|
|
1700
|
-
handleDeleteClick:
|
|
1701
|
-
handleReplaceItem:
|
|
1702
|
-
handleReplaceFile:
|
|
1703
|
-
resetUI:
|
|
1700
|
+
handleDeleteClick: N,
|
|
1701
|
+
handleReplaceItem: P,
|
|
1702
|
+
handleReplaceFile: F,
|
|
1703
|
+
resetUI: I
|
|
1704
1704
|
};
|
|
1705
1705
|
}
|
|
1706
1706
|
// ../media-library/src/composable.ts
|
|
1707
|
-
function pn(
|
|
1708
|
-
let { provider:
|
|
1709
|
-
function j(
|
|
1707
|
+
function pn(e) {
|
|
1708
|
+
let { provider: t } = e, n = k([]), r = k([]), i = k(null), a = k("files"), o = k(""), s = k(null), c = k("newest"), l = k(!1), u = k(!1), d = k(!1), f = k(null), p = k(null), m = k(/* @__PURE__ */ new Set()), h = k(null), g = k([]), _ = k({}), v = k(!1), y = k([]), b = k(!1), x = k(null), S = k(!1), C = k(null), w = k(!1), T = k(null), D = k(null), O = k(null), A = 0;
|
|
1709
|
+
function j(t) {
|
|
1710
1710
|
try {
|
|
1711
|
-
|
|
1712
|
-
} catch (
|
|
1713
|
-
|
|
1711
|
+
t();
|
|
1712
|
+
} catch (t) {
|
|
1713
|
+
e.onError?.(t);
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
1716
|
function M() {
|
|
1717
|
-
return
|
|
1717
|
+
return t.folders === !1 ? null : t.folders;
|
|
1718
1718
|
}
|
|
1719
1719
|
function N() {
|
|
1720
|
-
return
|
|
1720
|
+
return E(e.templateId);
|
|
1721
1721
|
}
|
|
1722
1722
|
function P(e) {
|
|
1723
1723
|
let t = {};
|
|
1724
|
-
|
|
1724
|
+
o.value ? t.search = o.value : i.value != null && (t.folderId = i.value), s.value && (t.category = s.value), e && (t.cursor = e);
|
|
1725
1725
|
let n = N();
|
|
1726
1726
|
return n && (t.templateId = n), t;
|
|
1727
1727
|
}
|
|
1728
1728
|
async function F() {
|
|
1729
|
-
let
|
|
1730
|
-
|
|
1729
|
+
let r = ++A;
|
|
1730
|
+
l.value = !0;
|
|
1731
1731
|
let i = P();
|
|
1732
1732
|
try {
|
|
1733
|
-
let
|
|
1734
|
-
if (
|
|
1735
|
-
|
|
1736
|
-
} catch (
|
|
1737
|
-
if (
|
|
1738
|
-
|
|
1733
|
+
let e = await t.list(i);
|
|
1734
|
+
if (r !== A) return;
|
|
1735
|
+
n.value = e.items, f.value = e.nextCursor ?? null, d.value = !!e.nextCursor;
|
|
1736
|
+
} catch (t) {
|
|
1737
|
+
if (r !== A) return;
|
|
1738
|
+
e.onError?.(t);
|
|
1739
1739
|
} finally {
|
|
1740
|
-
|
|
1740
|
+
r === A && (l.value = !1);
|
|
1741
1741
|
}
|
|
1742
1742
|
}
|
|
1743
1743
|
async function I() {
|
|
1744
|
-
if (!
|
|
1745
|
-
let
|
|
1746
|
-
|
|
1747
|
-
let i = P(
|
|
1744
|
+
if (!d.value || !f.value || l.value) return;
|
|
1745
|
+
let r = ++A;
|
|
1746
|
+
l.value = !0;
|
|
1747
|
+
let i = P(f.value);
|
|
1748
1748
|
try {
|
|
1749
|
-
let
|
|
1750
|
-
if (
|
|
1751
|
-
|
|
1752
|
-
} catch (
|
|
1753
|
-
if (
|
|
1754
|
-
|
|
1749
|
+
let e = await t.list(i);
|
|
1750
|
+
if (r !== A) return;
|
|
1751
|
+
n.value = [...n.value, ...e.items], f.value = e.nextCursor ?? null, d.value = !!e.nextCursor;
|
|
1752
|
+
} catch (t) {
|
|
1753
|
+
if (r !== A) return;
|
|
1754
|
+
e.onError?.(t);
|
|
1755
1755
|
} finally {
|
|
1756
|
-
|
|
1756
|
+
r === A && (l.value = !1);
|
|
1757
1757
|
}
|
|
1758
1758
|
}
|
|
1759
1759
|
async function L(e) {
|
|
1760
|
+
o.value = e, await F();
|
|
1761
|
+
}
|
|
1762
|
+
async function ee(e) {
|
|
1760
1763
|
s.value = e, await F();
|
|
1761
1764
|
}
|
|
1762
|
-
async function
|
|
1765
|
+
async function te(e) {
|
|
1763
1766
|
c.value = e, await F();
|
|
1764
1767
|
}
|
|
1765
|
-
async function
|
|
1766
|
-
|
|
1767
|
-
}
|
|
1768
|
-
async function B(e) {
|
|
1769
|
-
o.value = "files", a.value = e, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await F();
|
|
1768
|
+
async function R(e) {
|
|
1769
|
+
a.value = "files", i.value = e, o.value = "", m.value = /* @__PURE__ */ new Set(), h.value = null, await F();
|
|
1770
1770
|
}
|
|
1771
|
-
async function
|
|
1772
|
-
|
|
1771
|
+
async function z() {
|
|
1772
|
+
a.value = "frequently-used", i.value = null, o.value = "", m.value = /* @__PURE__ */ new Set(), h.value = null, await U();
|
|
1773
1773
|
}
|
|
1774
|
-
async function
|
|
1775
|
-
let { create:
|
|
1776
|
-
if (typeof
|
|
1777
|
-
|
|
1774
|
+
async function B(r) {
|
|
1775
|
+
let { create: a } = t;
|
|
1776
|
+
if (typeof a != "function") return null;
|
|
1777
|
+
u.value = !0;
|
|
1778
1778
|
try {
|
|
1779
|
-
let
|
|
1780
|
-
|
|
1779
|
+
let e = { file: r };
|
|
1780
|
+
i.value != null && (e.folderId = i.value);
|
|
1781
1781
|
let o = N();
|
|
1782
|
-
o && (
|
|
1783
|
-
let s = await
|
|
1784
|
-
return
|
|
1785
|
-
} catch (
|
|
1786
|
-
return
|
|
1782
|
+
o && (e.templateId = o);
|
|
1783
|
+
let s = await a(e);
|
|
1784
|
+
return n.value = [s, ...n.value], j(() => t.onCreated?.(s)), s;
|
|
1785
|
+
} catch (t) {
|
|
1786
|
+
return e.onError?.(t), null;
|
|
1787
1787
|
} finally {
|
|
1788
|
-
|
|
1788
|
+
u.value = !1;
|
|
1789
1789
|
}
|
|
1790
1790
|
}
|
|
1791
|
-
async function
|
|
1792
|
-
let { create:
|
|
1793
|
-
if (typeof
|
|
1794
|
-
|
|
1791
|
+
async function ne(r) {
|
|
1792
|
+
let { create: a } = t;
|
|
1793
|
+
if (typeof a == "function") {
|
|
1794
|
+
u.value = !0, p.value = {
|
|
1795
1795
|
current: 0,
|
|
1796
|
-
total:
|
|
1796
|
+
total: r.length
|
|
1797
1797
|
};
|
|
1798
1798
|
try {
|
|
1799
|
-
for (let o = 0; o <
|
|
1800
|
-
|
|
1799
|
+
for (let o = 0; o < r.length; o++) {
|
|
1800
|
+
p.value = {
|
|
1801
1801
|
current: o + 1,
|
|
1802
|
-
total:
|
|
1802
|
+
total: r.length
|
|
1803
1803
|
};
|
|
1804
1804
|
try {
|
|
1805
|
-
let
|
|
1806
|
-
|
|
1805
|
+
let e = { file: r[o] };
|
|
1806
|
+
i.value != null && (e.folderId = i.value);
|
|
1807
1807
|
let s = N();
|
|
1808
|
-
s && (
|
|
1809
|
-
let c = await
|
|
1810
|
-
|
|
1811
|
-
} catch (
|
|
1812
|
-
|
|
1808
|
+
s && (e.templateId = s);
|
|
1809
|
+
let c = await a(e);
|
|
1810
|
+
n.value = [c, ...n.value], j(() => t.onCreated?.(c));
|
|
1811
|
+
} catch (t) {
|
|
1812
|
+
e.onError?.(t);
|
|
1813
1813
|
}
|
|
1814
1814
|
}
|
|
1815
1815
|
} finally {
|
|
1816
|
-
|
|
1816
|
+
u.value = !1, p.value = null;
|
|
1817
1817
|
}
|
|
1818
1818
|
}
|
|
1819
1819
|
}
|
|
1820
|
-
async function
|
|
1821
|
-
if (
|
|
1822
|
-
let { move:
|
|
1823
|
-
if (typeof
|
|
1824
|
-
let
|
|
1825
|
-
if (
|
|
1826
|
-
let
|
|
1827
|
-
|
|
1828
|
-
} else
|
|
1829
|
-
|
|
1830
|
-
} catch (
|
|
1831
|
-
|
|
1820
|
+
async function re(t) {
|
|
1821
|
+
if (m.value.size === 0) return;
|
|
1822
|
+
let { move: r } = M() ?? { move: !1 };
|
|
1823
|
+
if (typeof r == "function") try {
|
|
1824
|
+
let e = await r([...m.value], t);
|
|
1825
|
+
if (i.value === null) {
|
|
1826
|
+
let t = new Map(e.map((e) => [e.id, e]));
|
|
1827
|
+
n.value = n.value.map((e) => t.get(e.id) ?? e);
|
|
1828
|
+
} else n.value = n.value.filter((e) => !m.value.has(e.id));
|
|
1829
|
+
m.value = /* @__PURE__ */ new Set(), h.value = null;
|
|
1830
|
+
} catch (t) {
|
|
1831
|
+
e.onError?.(t);
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
1834
|
-
async function
|
|
1835
|
-
let { update: o } =
|
|
1834
|
+
async function ie(r, i, a) {
|
|
1835
|
+
let { update: o } = t;
|
|
1836
1836
|
if (typeof o != "function") return !1;
|
|
1837
1837
|
try {
|
|
1838
|
-
let
|
|
1839
|
-
a !== void 0 && (
|
|
1840
|
-
let s = await o(
|
|
1841
|
-
return
|
|
1842
|
-
} catch (
|
|
1843
|
-
return
|
|
1838
|
+
let e = { filename: i };
|
|
1839
|
+
a !== void 0 && (e.alt = a);
|
|
1840
|
+
let s = await o(r, e);
|
|
1841
|
+
return n.value = n.value.map((e) => e.id === r ? s : e), h.value?.id === r && (h.value = s), j(() => t.onUpdated?.(s)), !0;
|
|
1842
|
+
} catch (t) {
|
|
1843
|
+
return e.onError?.(t), !1;
|
|
1844
1844
|
}
|
|
1845
1845
|
}
|
|
1846
|
-
function
|
|
1846
|
+
function V(e) {
|
|
1847
1847
|
let t = /* @__PURE__ */ new Map();
|
|
1848
|
-
for (let
|
|
1849
|
-
for (let n of
|
|
1848
|
+
for (let r of n.value) e.includes(r.id) && t.set(r.id, r);
|
|
1849
|
+
for (let n of g.value) e.includes(n.id) && !t.has(n.id) && t.set(n.id, n);
|
|
1850
1850
|
return [...t.values()];
|
|
1851
1851
|
}
|
|
1852
1852
|
function H(e) {
|
|
1853
|
-
|
|
1853
|
+
n.value = n.value.filter((t) => !e.includes(t.id)), g.value = g.value.filter((t) => !e.includes(t.id)), m.value = /* @__PURE__ */ new Set(), h.value = null;
|
|
1854
1854
|
}
|
|
1855
|
-
async function
|
|
1856
|
-
if (
|
|
1857
|
-
let { delete:
|
|
1858
|
-
if (typeof
|
|
1859
|
-
let r = [...
|
|
1855
|
+
async function ae() {
|
|
1856
|
+
if (m.value.size === 0) return;
|
|
1857
|
+
let { delete: n } = t;
|
|
1858
|
+
if (typeof n != "function") return;
|
|
1859
|
+
let r = [...m.value], i = V(r);
|
|
1860
1860
|
try {
|
|
1861
|
-
await
|
|
1862
|
-
for (let e of i) j(() =>
|
|
1863
|
-
} catch (
|
|
1864
|
-
|
|
1861
|
+
await n(r), H(r);
|
|
1862
|
+
for (let e of i) j(() => t.onDeleted?.(e));
|
|
1863
|
+
} catch (t) {
|
|
1864
|
+
e.onError?.(t);
|
|
1865
1865
|
}
|
|
1866
1866
|
}
|
|
1867
|
-
async function
|
|
1868
|
-
let { frequentlyUsed:
|
|
1869
|
-
if (typeof
|
|
1870
|
-
|
|
1871
|
-
} catch (
|
|
1872
|
-
|
|
1867
|
+
async function U() {
|
|
1868
|
+
let { frequentlyUsed: n } = t;
|
|
1869
|
+
if (typeof n == "function") try {
|
|
1870
|
+
g.value = await n();
|
|
1871
|
+
} catch (t) {
|
|
1872
|
+
e.onError?.(t);
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
|
-
async function
|
|
1876
|
-
if (
|
|
1877
|
-
|
|
1878
|
-
let { checkUsage:
|
|
1879
|
-
if (typeof
|
|
1875
|
+
async function W() {
|
|
1876
|
+
if (m.value.size === 0) return !1;
|
|
1877
|
+
y.value = [...m.value];
|
|
1878
|
+
let { checkUsage: n } = t;
|
|
1879
|
+
if (typeof n != "function") return _.value = {}, v.value = !0, !1;
|
|
1880
1880
|
try {
|
|
1881
|
-
let
|
|
1882
|
-
|
|
1883
|
-
let
|
|
1884
|
-
return
|
|
1885
|
-
} catch (
|
|
1886
|
-
return
|
|
1881
|
+
let e = await n(y.value);
|
|
1882
|
+
_.value = e;
|
|
1883
|
+
let t = Object.values(e).some((e) => e.templateCount > 0);
|
|
1884
|
+
return v.value = !0, t;
|
|
1885
|
+
} catch (t) {
|
|
1886
|
+
return e.onError?.(t), !1;
|
|
1887
1887
|
}
|
|
1888
1888
|
}
|
|
1889
|
-
async function
|
|
1890
|
-
let { delete:
|
|
1891
|
-
if (typeof
|
|
1892
|
-
let r =
|
|
1889
|
+
async function G() {
|
|
1890
|
+
let { delete: n } = t;
|
|
1891
|
+
if (typeof n != "function" || (v.value = !1, y.value.length === 0)) return;
|
|
1892
|
+
let r = y.value, i = V(r);
|
|
1893
1893
|
try {
|
|
1894
|
-
await
|
|
1895
|
-
for (let e of i) j(() =>
|
|
1896
|
-
} catch (
|
|
1897
|
-
|
|
1894
|
+
await n(r), H(r), y.value = [], _.value = {};
|
|
1895
|
+
for (let e of i) j(() => t.onDeleted?.(e));
|
|
1896
|
+
} catch (t) {
|
|
1897
|
+
e.onError?.(t);
|
|
1898
1898
|
}
|
|
1899
1899
|
}
|
|
1900
|
-
function
|
|
1901
|
-
|
|
1900
|
+
function oe() {
|
|
1901
|
+
v.value = !1, y.value = [], _.value = {};
|
|
1902
1902
|
}
|
|
1903
|
-
async function
|
|
1904
|
-
let
|
|
1905
|
-
if (typeof
|
|
1906
|
-
|
|
1903
|
+
async function K(r) {
|
|
1904
|
+
let a = t.importFromUrl;
|
|
1905
|
+
if (typeof a != "function") return null;
|
|
1906
|
+
b.value = !0, x.value = null;
|
|
1907
1907
|
try {
|
|
1908
|
-
let
|
|
1909
|
-
return
|
|
1910
|
-
} catch (
|
|
1911
|
-
return
|
|
1908
|
+
let e = await a(r, i.value, N());
|
|
1909
|
+
return n.value = [e, ...n.value], j(() => t.onCreated?.(e)), e;
|
|
1910
|
+
} catch (t) {
|
|
1911
|
+
return x.value = t instanceof Error ? t.message : "Import failed", e.onError?.(t), null;
|
|
1912
1912
|
} finally {
|
|
1913
|
-
|
|
1913
|
+
b.value = !1;
|
|
1914
1914
|
}
|
|
1915
1915
|
}
|
|
1916
|
-
function
|
|
1917
|
-
let t = new Set(
|
|
1918
|
-
t.has(e) ? t.delete(e) : t.add(e),
|
|
1916
|
+
function se(e) {
|
|
1917
|
+
let t = new Set(m.value);
|
|
1918
|
+
t.has(e) ? t.delete(e) : t.add(e), m.value = t;
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1921
|
-
|
|
1920
|
+
function ce() {
|
|
1921
|
+
m.value = /* @__PURE__ */ new Set(), h.value = null;
|
|
1922
1922
|
}
|
|
1923
|
-
function
|
|
1924
|
-
|
|
1923
|
+
function le(e) {
|
|
1924
|
+
h.value = e, m.value = /* @__PURE__ */ new Set([e.id]);
|
|
1925
1925
|
}
|
|
1926
|
-
async function
|
|
1927
|
-
let { storage:
|
|
1928
|
-
if (typeof
|
|
1926
|
+
async function ue() {
|
|
1927
|
+
let { storage: n } = t;
|
|
1928
|
+
if (typeof n != "function") O.value = null;
|
|
1929
1929
|
else try {
|
|
1930
|
-
|
|
1931
|
-
} catch (
|
|
1932
|
-
|
|
1930
|
+
O.value = await n();
|
|
1931
|
+
} catch (t) {
|
|
1932
|
+
e.onError?.(t);
|
|
1933
1933
|
}
|
|
1934
1934
|
}
|
|
1935
1935
|
async function q() {
|
|
1936
|
-
let
|
|
1937
|
-
if (
|
|
1938
|
-
|
|
1939
|
-
} catch (
|
|
1940
|
-
|
|
1936
|
+
let t = M();
|
|
1937
|
+
if (t) try {
|
|
1938
|
+
r.value = await t.list();
|
|
1939
|
+
} catch (t) {
|
|
1940
|
+
e.onError?.(t);
|
|
1941
1941
|
}
|
|
1942
1942
|
}
|
|
1943
|
-
async function de(
|
|
1943
|
+
async function de(t, n) {
|
|
1944
1944
|
let { create: r } = M() ?? { create: !1 };
|
|
1945
1945
|
if (typeof r != "function") return null;
|
|
1946
1946
|
try {
|
|
1947
|
-
let
|
|
1948
|
-
n !== void 0 && (
|
|
1949
|
-
let i = await r(
|
|
1947
|
+
let e = { name: t };
|
|
1948
|
+
n !== void 0 && (e.parentId = n);
|
|
1949
|
+
let i = await r(e);
|
|
1950
1950
|
return await q(), i;
|
|
1951
|
-
} catch (
|
|
1952
|
-
return
|
|
1951
|
+
} catch (t) {
|
|
1952
|
+
return e.onError?.(t), null;
|
|
1953
1953
|
}
|
|
1954
1954
|
}
|
|
1955
1955
|
function J(e, t) {
|
|
1956
1956
|
for (let n of e) if (n.id === t) return n;
|
|
1957
1957
|
return null;
|
|
1958
1958
|
}
|
|
1959
|
-
async function fe(
|
|
1959
|
+
async function fe(t, n) {
|
|
1960
1960
|
let { update: r } = M() ?? { update: !1 };
|
|
1961
1961
|
if (typeof r == "function") try {
|
|
1962
|
-
await r(
|
|
1963
|
-
} catch (
|
|
1964
|
-
|
|
1962
|
+
await r(t, { name: n }), await q();
|
|
1963
|
+
} catch (t) {
|
|
1964
|
+
e.onError?.(t);
|
|
1965
1965
|
}
|
|
1966
1966
|
}
|
|
1967
|
-
async function Y(
|
|
1967
|
+
async function Y(t) {
|
|
1968
1968
|
let { delete: n } = M() ?? { delete: !1 };
|
|
1969
1969
|
if (typeof n == "function") try {
|
|
1970
|
-
let
|
|
1971
|
-
await n(
|
|
1972
|
-
} catch (
|
|
1973
|
-
|
|
1970
|
+
let e = J(r.value, t)?.parentId ?? null;
|
|
1971
|
+
await n(t), i.value === t && (i.value = e), await q(), await F();
|
|
1972
|
+
} catch (t) {
|
|
1973
|
+
e.onError?.(t);
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
|
-
async function X(
|
|
1977
|
-
|
|
1978
|
-
let { checkUsage: r } =
|
|
1979
|
-
if (typeof r != "function")
|
|
1976
|
+
async function X(n) {
|
|
1977
|
+
T.value = n, C.value = null;
|
|
1978
|
+
let { checkUsage: r } = t;
|
|
1979
|
+
if (typeof r != "function") D.value = null, w.value = !0;
|
|
1980
1980
|
else try {
|
|
1981
|
-
let
|
|
1982
|
-
|
|
1983
|
-
} catch (
|
|
1984
|
-
|
|
1981
|
+
let e = await r([n.id]);
|
|
1982
|
+
D.value = e[n.id] ?? null, w.value = !0;
|
|
1983
|
+
} catch (t) {
|
|
1984
|
+
e.onError?.(t);
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
1987
1987
|
function pe() {
|
|
1988
|
-
|
|
1988
|
+
w.value = !1, T.value = null, D.value = null, C.value = null;
|
|
1989
1989
|
}
|
|
1990
1990
|
function Z(e) {
|
|
1991
|
-
|
|
1991
|
+
n.value = n.value.map((t) => t.id === e.id ? e : t), g.value = g.value.map((t) => t.id === e.id ? e : t), h.value?.id === e.id && (h.value = e), j(() => t.onUpdated?.(e));
|
|
1992
1992
|
}
|
|
1993
|
-
async function me(
|
|
1994
|
-
let { replace: r } =
|
|
1995
|
-
if (typeof r != "function" || !
|
|
1996
|
-
|
|
1993
|
+
async function me(n) {
|
|
1994
|
+
let { replace: r } = t;
|
|
1995
|
+
if (typeof r != "function" || !T.value) return null;
|
|
1996
|
+
S.value = !0, C.value = null;
|
|
1997
1997
|
try {
|
|
1998
|
-
let
|
|
1999
|
-
return Z(
|
|
2000
|
-
} catch (
|
|
2001
|
-
return
|
|
1998
|
+
let e = await r(T.value.id, n);
|
|
1999
|
+
return Z(e), w.value = !1, T.value = null, D.value = null, e;
|
|
2000
|
+
} catch (t) {
|
|
2001
|
+
return C.value = t instanceof Error ? t.message : "Replace failed", e.onError?.(t), null;
|
|
2002
2002
|
} finally {
|
|
2003
|
-
|
|
2003
|
+
S.value = !1;
|
|
2004
2004
|
}
|
|
2005
2005
|
}
|
|
2006
|
-
async function Q(
|
|
2007
|
-
let { replace: i } =
|
|
2006
|
+
async function Q(n, r) {
|
|
2007
|
+
let { replace: i } = t;
|
|
2008
2008
|
if (typeof i != "function") return null;
|
|
2009
2009
|
try {
|
|
2010
|
-
let
|
|
2011
|
-
return Z(
|
|
2012
|
-
} catch (
|
|
2013
|
-
return
|
|
2010
|
+
let e = await i(n, r);
|
|
2011
|
+
return Z(e), e;
|
|
2012
|
+
} catch (t) {
|
|
2013
|
+
return e.onError?.(t), null;
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
2016
|
return {
|
|
2017
|
-
items:
|
|
2018
|
-
folders:
|
|
2019
|
-
currentFolderId:
|
|
2020
|
-
viewMode:
|
|
2021
|
-
searchQuery:
|
|
2022
|
-
categoryFilter:
|
|
2023
|
-
sortOption:
|
|
2024
|
-
isLoading:
|
|
2025
|
-
isUploading:
|
|
2026
|
-
uploadProgress:
|
|
2027
|
-
hasMore:
|
|
2028
|
-
selectedItems:
|
|
2029
|
-
previewItem:
|
|
2030
|
-
frequentlyUsedItems:
|
|
2031
|
-
deleteUsageInfo:
|
|
2032
|
-
showDeleteWarning:
|
|
2017
|
+
items: n,
|
|
2018
|
+
folders: r,
|
|
2019
|
+
currentFolderId: i,
|
|
2020
|
+
viewMode: a,
|
|
2021
|
+
searchQuery: o,
|
|
2022
|
+
categoryFilter: s,
|
|
2023
|
+
sortOption: c,
|
|
2024
|
+
isLoading: l,
|
|
2025
|
+
isUploading: u,
|
|
2026
|
+
uploadProgress: p,
|
|
2027
|
+
hasMore: d,
|
|
2028
|
+
selectedItems: m,
|
|
2029
|
+
previewItem: h,
|
|
2030
|
+
frequentlyUsedItems: g,
|
|
2031
|
+
deleteUsageInfo: _,
|
|
2032
|
+
showDeleteWarning: v,
|
|
2033
2033
|
loadItems: F,
|
|
2034
2034
|
loadMore: I,
|
|
2035
2035
|
search: L,
|
|
2036
|
-
filterByCategory:
|
|
2037
|
-
sortBy:
|
|
2038
|
-
navigateToFolder:
|
|
2039
|
-
showFrequentlyUsed:
|
|
2040
|
-
uploadFile:
|
|
2041
|
-
uploadFiles:
|
|
2042
|
-
moveSelected:
|
|
2043
|
-
updateFile:
|
|
2044
|
-
deleteSelected:
|
|
2045
|
-
isImportingFromUrl:
|
|
2046
|
-
importFromUrlError:
|
|
2047
|
-
importFromUrl:
|
|
2048
|
-
toggleSelection:
|
|
2049
|
-
clearSelection:
|
|
2050
|
-
selectItem:
|
|
2036
|
+
filterByCategory: ee,
|
|
2037
|
+
sortBy: te,
|
|
2038
|
+
navigateToFolder: R,
|
|
2039
|
+
showFrequentlyUsed: z,
|
|
2040
|
+
uploadFile: B,
|
|
2041
|
+
uploadFiles: ne,
|
|
2042
|
+
moveSelected: re,
|
|
2043
|
+
updateFile: ie,
|
|
2044
|
+
deleteSelected: ae,
|
|
2045
|
+
isImportingFromUrl: b,
|
|
2046
|
+
importFromUrlError: x,
|
|
2047
|
+
importFromUrl: K,
|
|
2048
|
+
toggleSelection: se,
|
|
2049
|
+
clearSelection: ce,
|
|
2050
|
+
selectItem: le,
|
|
2051
2051
|
loadFolders: q,
|
|
2052
2052
|
createFolder: de,
|
|
2053
2053
|
renameFolder: fe,
|
|
2054
2054
|
deleteFolder: Y,
|
|
2055
2055
|
findFolderInTree: J,
|
|
2056
|
-
loadFrequentlyUsed:
|
|
2057
|
-
checkUsageBeforeDelete:
|
|
2058
|
-
confirmDelete:
|
|
2059
|
-
cancelDelete:
|
|
2060
|
-
isReplacing:
|
|
2061
|
-
replaceError:
|
|
2062
|
-
showReplaceWarning:
|
|
2063
|
-
pendingReplaceItem:
|
|
2064
|
-
replaceUsageInfo:
|
|
2056
|
+
loadFrequentlyUsed: U,
|
|
2057
|
+
checkUsageBeforeDelete: W,
|
|
2058
|
+
confirmDelete: G,
|
|
2059
|
+
cancelDelete: oe,
|
|
2060
|
+
isReplacing: S,
|
|
2061
|
+
replaceError: C,
|
|
2062
|
+
showReplaceWarning: w,
|
|
2063
|
+
pendingReplaceItem: T,
|
|
2064
|
+
replaceUsageInfo: D,
|
|
2065
2065
|
checkUsageBeforeReplace: X,
|
|
2066
2066
|
cancelReplace: pe,
|
|
2067
2067
|
replaceFile: me,
|
|
2068
2068
|
replaceMediaDirectly: Q,
|
|
2069
|
-
storageInfo:
|
|
2070
|
-
loadStorage:
|
|
2069
|
+
storageInfo: O,
|
|
2070
|
+
loadStorage: ue
|
|
2071
2071
|
};
|
|
2072
2072
|
}
|
|
2073
2073
|
// ../media-library/src/components/MediaLibraryChrome.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -2146,7 +2146,7 @@ var mn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2146
2146
|
}, Jn = {
|
|
2147
2147
|
key: 1,
|
|
2148
2148
|
class: "tpl:relative"
|
|
2149
|
-
}, Yn = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Xn = ["data-testid", "disabled"], Zn = /* @__PURE__ */
|
|
2149
|
+
}, Yn = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Xn = ["data-testid", "disabled"], Zn = /* @__PURE__ */ e({
|
|
2150
2150
|
__name: "MediaLibraryChrome",
|
|
2151
2151
|
props: {
|
|
2152
2152
|
provider: {},
|
|
@@ -2163,110 +2163,110 @@ var mn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2163
2163
|
"confirm",
|
|
2164
2164
|
"ready"
|
|
2165
2165
|
],
|
|
2166
|
-
setup(e, { expose:
|
|
2167
|
-
let
|
|
2166
|
+
setup(e, { expose: a, emit: c }) {
|
|
2167
|
+
let l = e, d = c, p = u(() => import("./MediaEditModal-DDCIwr9U.js")), h = D(() => l.translations), v = D(() => l.confirmTestId ?? "media-confirm"), T = {
|
|
2168
2168
|
get maxFileSize() {
|
|
2169
|
-
return
|
|
2169
|
+
return l.provider.maxFileSize;
|
|
2170
2170
|
},
|
|
2171
2171
|
get mimeTypes() {
|
|
2172
|
-
return
|
|
2172
|
+
return l.provider.mimeTypes;
|
|
2173
2173
|
},
|
|
2174
2174
|
get accept() {
|
|
2175
|
-
return
|
|
2175
|
+
return l.accept;
|
|
2176
2176
|
}
|
|
2177
2177
|
};
|
|
2178
|
-
|
|
2179
|
-
let { isAcceptedMimeType:
|
|
2180
|
-
provider:
|
|
2181
|
-
templateId: () =>
|
|
2182
|
-
onError: (e) =>
|
|
2178
|
+
i(de, T);
|
|
2179
|
+
let { isAcceptedMimeType: E, availableCategories: k } = Q(T), M = pn({
|
|
2180
|
+
provider: l.provider,
|
|
2181
|
+
templateId: () => l.templateId,
|
|
2182
|
+
onError: (e) => l.onError?.(e)
|
|
2183
2183
|
}), N = fn({
|
|
2184
|
-
library:
|
|
2185
|
-
translations:
|
|
2186
|
-
}),
|
|
2187
|
-
let e =
|
|
2184
|
+
library: M,
|
|
2185
|
+
translations: h
|
|
2186
|
+
}), F = D(() => typeof l.provider.create == "function"), I = D(() => l.provider.folders !== !1), L = D(() => typeof l.provider.importFromUrl == "function"), R = D(() => typeof l.provider.delete == "function"), B = D(() => typeof l.provider.update == "function"), re = D(() => typeof l.provider.replace == "function"), H = D(() => typeof l.provider.frequentlyUsed == "function"), U = D(() => {
|
|
2187
|
+
let e = l.provider.folders;
|
|
2188
2188
|
return e !== !1 && typeof e.move == "function";
|
|
2189
|
-
}),
|
|
2190
|
-
let e =
|
|
2189
|
+
}), W = D(() => {
|
|
2190
|
+
let e = l.provider.folders;
|
|
2191
2191
|
return e !== !1 && typeof e.create == "function";
|
|
2192
|
-
}),
|
|
2193
|
-
let e =
|
|
2192
|
+
}), G = D(() => {
|
|
2193
|
+
let e = l.provider.folders;
|
|
2194
2194
|
return e !== !1 && typeof e.update == "function";
|
|
2195
|
-
}),
|
|
2196
|
-
let e =
|
|
2195
|
+
}), oe = D(() => {
|
|
2196
|
+
let e = l.provider.folders;
|
|
2197
2197
|
return e !== !1 && typeof e.delete == "function";
|
|
2198
|
-
}),
|
|
2199
|
-
let e =
|
|
2200
|
-
return e ? !
|
|
2201
|
-
}),
|
|
2202
|
-
if (!
|
|
2198
|
+
}), K = D(() => M.isLoading.value && N.displayItems.value.length === 0), se = D(() => {
|
|
2199
|
+
let e = M.previewItem.value;
|
|
2200
|
+
return e ? !l.accept?.length || E(e.mimeType ?? "", l.accept) : !1;
|
|
2201
|
+
}), ce = D(() => {
|
|
2202
|
+
if (!R.value) return 0;
|
|
2203
2203
|
let e = 0;
|
|
2204
|
-
for (let t of
|
|
2204
|
+
for (let t of M.selectedItems.value) N.displayItems.value.find((e) => e.id === t)?.canDelete !== !1 && (e += 1);
|
|
2205
2205
|
return e;
|
|
2206
|
-
}),
|
|
2207
|
-
function
|
|
2208
|
-
return
|
|
2206
|
+
}), le = D(() => N.showImportUrlModal.value || N.editingItem.value !== null || M.showReplaceWarning.value);
|
|
2207
|
+
function ue() {
|
|
2208
|
+
return le.value ? !0 : N.showMovePicker.value ? (N.showMovePicker.value = !1, !0) : M.showDeleteWarning.value ? (M.cancelDelete(), !0) : !1;
|
|
2209
2209
|
}
|
|
2210
2210
|
function q() {
|
|
2211
|
-
|
|
2211
|
+
se.value && M.previewItem.value && d("confirm", M.previewItem.value);
|
|
2212
2212
|
}
|
|
2213
2213
|
function J(e) {
|
|
2214
|
-
|
|
2214
|
+
M.filterByCategory(e.target.value || null);
|
|
2215
2215
|
}
|
|
2216
2216
|
async function fe() {
|
|
2217
2217
|
let e = /* @__PURE__ */ new Set();
|
|
2218
|
-
for (let t of
|
|
2219
|
-
|
|
2218
|
+
for (let t of M.selectedItems.value) N.displayItems.value.find((e) => e.id === t)?.canDelete !== !1 && e.add(t);
|
|
2219
|
+
M.selectedItems.value = e, await N.handleDeleteClick();
|
|
2220
2220
|
}
|
|
2221
|
-
return
|
|
2222
|
-
e?.length === 1 && (
|
|
2223
|
-
}, { immediate: !0 }),
|
|
2221
|
+
return r(() => l.accept, (e) => {
|
|
2222
|
+
e?.length === 1 && (M.categoryFilter.value = e[0]);
|
|
2223
|
+
}, { immediate: !0 }), M.loadItems(), M.loadFrequentlyUsed(), M.loadStorage(), d("ready"), s(() => {
|
|
2224
2224
|
N.resetUI();
|
|
2225
|
-
}),
|
|
2226
|
-
nestedDialogOpen:
|
|
2227
|
-
handleEscape:
|
|
2228
|
-
library:
|
|
2225
|
+
}), a({
|
|
2226
|
+
nestedDialogOpen: le,
|
|
2227
|
+
handleEscape: ue,
|
|
2228
|
+
library: M,
|
|
2229
2229
|
ui: N
|
|
2230
|
-
}), (
|
|
2231
|
-
|
|
2232
|
-
|
|
2230
|
+
}), (r, i) => (t(), f("div", mn, [
|
|
2231
|
+
S("div", hn, [S("h2", gn, C(h.value.mediaLibrary.title), 1), S("div", _n, [
|
|
2232
|
+
g(M).storageInfo.value ? (t(), b(un, {
|
|
2233
2233
|
key: 0,
|
|
2234
|
-
"used-bytes":
|
|
2235
|
-
"limit-bytes":
|
|
2234
|
+
"used-bytes": g(M).storageInfo.value.usedBytes,
|
|
2235
|
+
"limit-bytes": g(M).storageInfo.value.limitBytes,
|
|
2236
2236
|
size: 22
|
|
2237
|
-
}, null, 8, ["used-bytes", "limit-bytes"])) :
|
|
2238
|
-
|
|
2239
|
-
value:
|
|
2237
|
+
}, null, 8, ["used-bytes", "limit-bytes"])) : y("", !0),
|
|
2238
|
+
S("div", vn, [S("input", {
|
|
2239
|
+
value: g(N).searchInput.value,
|
|
2240
2240
|
type: "search",
|
|
2241
|
-
disabled:
|
|
2242
|
-
"aria-label":
|
|
2241
|
+
disabled: K.value,
|
|
2242
|
+
"aria-label": h.value.mediaLibrary.searchAriaLabel,
|
|
2243
2243
|
class: "tpl:w-52 tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-xs tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:outline-none tpl:focus:shadow-[var(--tpl-ring)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
2244
2244
|
style: {
|
|
2245
2245
|
"border-color": "var(--tpl-border)",
|
|
2246
2246
|
"background-color": "var(--tpl-bg)",
|
|
2247
2247
|
color: "var(--tpl-text)"
|
|
2248
2248
|
},
|
|
2249
|
-
placeholder:
|
|
2250
|
-
onInput:
|
|
2251
|
-
}, null, 40, yn),
|
|
2249
|
+
placeholder: h.value.mediaLibrary.searchPlaceholder,
|
|
2250
|
+
onInput: i[0] ||= (e) => g(N).handleSearchInput(e.target.value)
|
|
2251
|
+
}, null, 40, yn), j(g(te), {
|
|
2252
2252
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
2253
2253
|
size: 13,
|
|
2254
2254
|
"stroke-width": 2,
|
|
2255
2255
|
style: { color: "var(--tpl-text-dim)" }
|
|
2256
2256
|
})]),
|
|
2257
|
-
e.showClose ? (
|
|
2257
|
+
e.showClose ? (t(), f("button", {
|
|
2258
2258
|
key: 1,
|
|
2259
2259
|
type: "button",
|
|
2260
|
-
"aria-label":
|
|
2260
|
+
"aria-label": h.value.mediaLibrary.close,
|
|
2261
2261
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2262
2262
|
style: { color: "var(--tpl-text-muted)" },
|
|
2263
|
-
onClick:
|
|
2264
|
-
}, [
|
|
2263
|
+
onClick: i[1] ||= (e) => d("close")
|
|
2264
|
+
}, [j(g(ae), {
|
|
2265
2265
|
size: 18,
|
|
2266
2266
|
"stroke-width": 2
|
|
2267
|
-
})], 8, bn)) :
|
|
2267
|
+
})], 8, bn)) : y("", !0)
|
|
2268
2268
|
])]),
|
|
2269
|
-
|
|
2269
|
+
S("div", xn, [j(w, {
|
|
2270
2270
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
2271
2271
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
2272
2272
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -2274,19 +2274,19 @@ var mn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2274
2274
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
2275
2275
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
2276
2276
|
}, {
|
|
2277
|
-
default:
|
|
2278
|
-
folders:
|
|
2279
|
-
"current-folder-id":
|
|
2280
|
-
"view-mode":
|
|
2281
|
-
"has-frequently-used":
|
|
2282
|
-
"can-create-folder":
|
|
2283
|
-
"can-rename-folder":
|
|
2284
|
-
"can-delete-folder":
|
|
2285
|
-
onNavigate:
|
|
2286
|
-
onCreateFolder:
|
|
2287
|
-
onRenameFolder:
|
|
2288
|
-
onDeleteFolder:
|
|
2289
|
-
onShowFrequentlyUsed:
|
|
2277
|
+
default: n(() => [I.value && g(N).showSidebar.value ? (t(), f("div", Sn, [j(Pe, {
|
|
2278
|
+
folders: g(N).folderTree.value,
|
|
2279
|
+
"current-folder-id": g(M).currentFolderId.value,
|
|
2280
|
+
"view-mode": g(M).viewMode.value,
|
|
2281
|
+
"has-frequently-used": H.value && g(N).hasFrequentlyUsed.value,
|
|
2282
|
+
"can-create-folder": W.value,
|
|
2283
|
+
"can-rename-folder": G.value,
|
|
2284
|
+
"can-delete-folder": oe.value,
|
|
2285
|
+
onNavigate: g(M).navigateToFolder,
|
|
2286
|
+
onCreateFolder: g(N).handleCreateFolder,
|
|
2287
|
+
onRenameFolder: g(N).handleRenameFolder,
|
|
2288
|
+
onDeleteFolder: g(N).handleDeleteFolder,
|
|
2289
|
+
onShowFrequentlyUsed: g(M).showFrequentlyUsed
|
|
2290
2290
|
}, null, 8, [
|
|
2291
2291
|
"folders",
|
|
2292
2292
|
"current-folder-id",
|
|
@@ -2300,90 +2300,90 @@ var mn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2300
2300
|
"onRenameFolder",
|
|
2301
2301
|
"onDeleteFolder",
|
|
2302
2302
|
"onShowFrequentlyUsed"
|
|
2303
|
-
])])) :
|
|
2303
|
+
])])) : y("", !0)]),
|
|
2304
2304
|
_: 1
|
|
2305
|
-
}),
|
|
2306
|
-
|
|
2305
|
+
}), S("div", Cn, [S("div", wn, [S("div", Tn, [
|
|
2306
|
+
I.value ? (t(), f("button", {
|
|
2307
2307
|
key: 0,
|
|
2308
2308
|
type: "button",
|
|
2309
2309
|
"data-testid": "media-folder-toggle",
|
|
2310
2310
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2311
|
-
style:
|
|
2312
|
-
color:
|
|
2313
|
-
backgroundColor:
|
|
2314
|
-
border:
|
|
2311
|
+
style: O({
|
|
2312
|
+
color: g(N).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2313
|
+
backgroundColor: g(N).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
2314
|
+
border: g(N).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
2315
2315
|
}),
|
|
2316
|
-
title:
|
|
2317
|
-
"aria-label":
|
|
2318
|
-
"aria-pressed":
|
|
2319
|
-
onClick:
|
|
2320
|
-
}, [
|
|
2316
|
+
title: g(N).showSidebar.value ? h.value.mediaLibrary.hideFolders : h.value.mediaLibrary.showFolders,
|
|
2317
|
+
"aria-label": g(N).showSidebar.value ? h.value.mediaLibrary.hideFolders : h.value.mediaLibrary.showFolders,
|
|
2318
|
+
"aria-pressed": g(N).showSidebar.value,
|
|
2319
|
+
onClick: i[2] ||= (e) => g(N).showSidebar.value = !g(N).showSidebar.value
|
|
2320
|
+
}, [j(g(ee), {
|
|
2321
2321
|
size: 16,
|
|
2322
2322
|
"stroke-width": 2
|
|
2323
|
-
})], 12, En)) :
|
|
2324
|
-
|
|
2323
|
+
})], 12, En)) : y("", !0),
|
|
2324
|
+
g(M).viewMode.value === "frequently-used" ? (t(), f("span", Dn, C(h.value.mediaLibrary.frequentlyUsed), 1)) : (t(), b(be, {
|
|
2325
2325
|
key: 2,
|
|
2326
|
-
folders:
|
|
2327
|
-
"current-folder-id":
|
|
2328
|
-
onNavigate:
|
|
2326
|
+
folders: g(N).folderTree.value,
|
|
2327
|
+
"current-folder-id": g(M).currentFolderId.value,
|
|
2328
|
+
onNavigate: g(M).navigateToFolder
|
|
2329
2329
|
}, null, 8, [
|
|
2330
2330
|
"folders",
|
|
2331
2331
|
"current-folder-id",
|
|
2332
2332
|
"onNavigate"
|
|
2333
2333
|
])),
|
|
2334
|
-
|
|
2334
|
+
S("div", On, [S("button", {
|
|
2335
2335
|
type: "button",
|
|
2336
2336
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2337
|
-
style:
|
|
2338
|
-
color:
|
|
2339
|
-
backgroundColor:
|
|
2337
|
+
style: O({
|
|
2338
|
+
color: g(N).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2339
|
+
backgroundColor: g(N).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2340
2340
|
}),
|
|
2341
|
-
title:
|
|
2342
|
-
"aria-label":
|
|
2343
|
-
"aria-pressed":
|
|
2344
|
-
onClick:
|
|
2345
|
-
}, [
|
|
2341
|
+
title: h.value.mediaLibrary.viewGrid,
|
|
2342
|
+
"aria-label": h.value.mediaLibrary.viewGrid,
|
|
2343
|
+
"aria-pressed": g(N).layoutMode.value === "grid",
|
|
2344
|
+
onClick: i[3] ||= (e) => g(N).layoutMode.value = "grid"
|
|
2345
|
+
}, [j(g(ne), {
|
|
2346
2346
|
size: 14,
|
|
2347
2347
|
"stroke-width": 2
|
|
2348
|
-
})], 12, kn),
|
|
2348
|
+
})], 12, kn), S("button", {
|
|
2349
2349
|
type: "button",
|
|
2350
2350
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2351
|
-
style:
|
|
2352
|
-
color:
|
|
2353
|
-
backgroundColor:
|
|
2351
|
+
style: O({
|
|
2352
|
+
color: g(N).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2353
|
+
backgroundColor: g(N).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2354
2354
|
}),
|
|
2355
|
-
title:
|
|
2356
|
-
"aria-label":
|
|
2357
|
-
"aria-pressed":
|
|
2358
|
-
onClick:
|
|
2359
|
-
}, [
|
|
2355
|
+
title: h.value.mediaLibrary.viewList,
|
|
2356
|
+
"aria-label": h.value.mediaLibrary.viewList,
|
|
2357
|
+
"aria-pressed": g(N).layoutMode.value === "list",
|
|
2358
|
+
onClick: i[4] ||= (e) => g(N).layoutMode.value = "list"
|
|
2359
|
+
}, [j(g(V), {
|
|
2360
2360
|
size: 14,
|
|
2361
2361
|
"stroke-width": 2
|
|
2362
2362
|
})], 12, An)])
|
|
2363
|
-
]),
|
|
2363
|
+
]), S("div", jn, [g(k).length > 1 ? (t(), f("select", {
|
|
2364
2364
|
key: 0,
|
|
2365
|
-
"aria-label":
|
|
2365
|
+
"aria-label": h.value.mediaLibrary.filterAriaLabel,
|
|
2366
2366
|
class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
|
|
2367
2367
|
style: {
|
|
2368
2368
|
"border-color": "var(--tpl-border)",
|
|
2369
2369
|
"background-color": "var(--tpl-bg)",
|
|
2370
2370
|
color: "var(--tpl-text)"
|
|
2371
2371
|
},
|
|
2372
|
-
value:
|
|
2372
|
+
value: g(M).categoryFilter.value ?? "",
|
|
2373
2373
|
onChange: J
|
|
2374
|
-
}, [
|
|
2374
|
+
}, [S("option", Nn, C(h.value.mediaLibrary.filterAll), 1), (t(!0), f(A, null, o(g(k), (e) => (t(), f("option", {
|
|
2375
2375
|
key: e,
|
|
2376
2376
|
value: e
|
|
2377
|
-
}, g(
|
|
2377
|
+
}, C(g(N).getCategoryLabel(e)), 9, Pn))), 128))], 40, Mn)) : y("", !0)])]), S("div", Fn, [g(M).viewMode.value === "files" && (F.value || L.value) ? (t(), f("div", In, [F.value ? (t(), b(rn, {
|
|
2378
2378
|
key: 0,
|
|
2379
|
-
"is-uploading":
|
|
2380
|
-
"upload-progress":
|
|
2381
|
-
onUpload:
|
|
2379
|
+
"is-uploading": g(M).isUploading.value,
|
|
2380
|
+
"upload-progress": g(M).uploadProgress.value,
|
|
2381
|
+
onUpload: g(N).handleUpload
|
|
2382
2382
|
}, null, 8, [
|
|
2383
2383
|
"is-uploading",
|
|
2384
2384
|
"upload-progress",
|
|
2385
2385
|
"onUpload"
|
|
2386
|
-
])) :
|
|
2386
|
+
])) : y("", !0), L.value ? (t(), f("button", {
|
|
2387
2387
|
key: 1,
|
|
2388
2388
|
"data-testid": "media-import-url",
|
|
2389
2389
|
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
@@ -2392,25 +2392,25 @@ var mn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2392
2392
|
color: "var(--tpl-text-muted)",
|
|
2393
2393
|
"background-color": "var(--tpl-bg)"
|
|
2394
2394
|
},
|
|
2395
|
-
onClick:
|
|
2396
|
-
}, [
|
|
2395
|
+
onClick: i[5] ||= (e) => g(N).showImportUrlModal.value = !0
|
|
2396
|
+
}, [j(g(ie), {
|
|
2397
2397
|
size: 14,
|
|
2398
2398
|
"stroke-width": 2
|
|
2399
|
-
}), m(" " +
|
|
2400
|
-
items:
|
|
2401
|
-
"selected-ids":
|
|
2402
|
-
"is-loading":
|
|
2403
|
-
"has-more":
|
|
2399
|
+
}), m(" " + C(h.value.mediaLibrary.importFromUrl), 1)])) : y("", !0)])) : y("", !0), j(ft, {
|
|
2400
|
+
items: g(N).displayItems.value,
|
|
2401
|
+
"selected-ids": g(M).selectedItems.value,
|
|
2402
|
+
"is-loading": g(M).isLoading.value,
|
|
2403
|
+
"has-more": g(M).viewMode.value === "files" && g(M).hasMore.value,
|
|
2404
2404
|
accept: e.accept,
|
|
2405
|
-
layout:
|
|
2406
|
-
"search-query":
|
|
2407
|
-
"can-update":
|
|
2408
|
-
"can-replace":
|
|
2409
|
-
onSelect:
|
|
2410
|
-
onToggle:
|
|
2411
|
-
onLoadMore:
|
|
2412
|
-
onEdit:
|
|
2413
|
-
onReplace:
|
|
2405
|
+
layout: g(N).layoutMode.value,
|
|
2406
|
+
"search-query": g(M).searchQuery.value,
|
|
2407
|
+
"can-update": B.value,
|
|
2408
|
+
"can-replace": re.value,
|
|
2409
|
+
onSelect: g(N).handleSelect,
|
|
2410
|
+
onToggle: g(M).toggleSelection,
|
|
2411
|
+
onLoadMore: g(M).loadMore,
|
|
2412
|
+
onEdit: g(N).handleEditItem,
|
|
2413
|
+
onReplace: g(N).handleReplaceItem,
|
|
2414
2414
|
onConfirm: q
|
|
2415
2415
|
}, null, 8, [
|
|
2416
2416
|
"items",
|
|
@@ -2428,38 +2428,38 @@ var mn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2428
2428
|
"onEdit",
|
|
2429
2429
|
"onReplace"
|
|
2430
2430
|
])])])]),
|
|
2431
|
-
|
|
2432
|
-
visible:
|
|
2433
|
-
"is-importing":
|
|
2434
|
-
error:
|
|
2435
|
-
onImport:
|
|
2436
|
-
onClose:
|
|
2431
|
+
j(Ct, {
|
|
2432
|
+
visible: g(N).showImportUrlModal.value,
|
|
2433
|
+
"is-importing": g(M).isImportingFromUrl.value,
|
|
2434
|
+
error: g(M).importFromUrlError.value,
|
|
2435
|
+
onImport: g(N).handleImportFromUrl,
|
|
2436
|
+
onClose: i[6] ||= (e) => g(N).showImportUrlModal.value = !1
|
|
2437
2437
|
}, null, 8, [
|
|
2438
2438
|
"visible",
|
|
2439
2439
|
"is-importing",
|
|
2440
2440
|
"error",
|
|
2441
2441
|
"onImport"
|
|
2442
2442
|
]),
|
|
2443
|
-
|
|
2443
|
+
g(N).editingItem.value ? (t(), b(g(p), {
|
|
2444
2444
|
key: 0,
|
|
2445
2445
|
visible: !0,
|
|
2446
|
-
item:
|
|
2447
|
-
save:
|
|
2448
|
-
"can-crop":
|
|
2449
|
-
onClose:
|
|
2446
|
+
item: g(N).editingItem.value,
|
|
2447
|
+
save: g(N).handleEditSave,
|
|
2448
|
+
"can-crop": re.value && g(N).editingItem.value.canUpdate !== !1,
|
|
2449
|
+
onClose: i[7] ||= (e) => g(N).editingItem.value = null
|
|
2450
2450
|
}, null, 8, [
|
|
2451
2451
|
"item",
|
|
2452
2452
|
"save",
|
|
2453
2453
|
"can-crop"
|
|
2454
|
-
])) :
|
|
2455
|
-
|
|
2456
|
-
visible:
|
|
2457
|
-
item:
|
|
2458
|
-
"usage-info":
|
|
2459
|
-
"is-replacing":
|
|
2460
|
-
error:
|
|
2461
|
-
onReplace:
|
|
2462
|
-
onClose:
|
|
2454
|
+
])) : y("", !0),
|
|
2455
|
+
j(Yt, {
|
|
2456
|
+
visible: g(M).showReplaceWarning.value,
|
|
2457
|
+
item: g(M).pendingReplaceItem.value,
|
|
2458
|
+
"usage-info": g(M).replaceUsageInfo.value,
|
|
2459
|
+
"is-replacing": g(M).isReplacing.value,
|
|
2460
|
+
error: g(M).replaceError.value,
|
|
2461
|
+
onReplace: g(N).handleReplaceFile,
|
|
2462
|
+
onClose: g(M).cancelReplace
|
|
2463
2463
|
}, null, 8, [
|
|
2464
2464
|
"visible",
|
|
2465
2465
|
"item",
|
|
@@ -2469,7 +2469,7 @@ var mn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2469
2469
|
"onReplace",
|
|
2470
2470
|
"onClose"
|
|
2471
2471
|
]),
|
|
2472
|
-
|
|
2472
|
+
j(w, {
|
|
2473
2473
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
2474
2474
|
"enter-from-class": "tpl:opacity-0",
|
|
2475
2475
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -2477,7 +2477,7 @@ var mn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2477
2477
|
"leave-from-class": "tpl:opacity-100",
|
|
2478
2478
|
"leave-to-class": "tpl:opacity-0"
|
|
2479
2479
|
}, {
|
|
2480
|
-
default:
|
|
2480
|
+
default: n(() => [g(M).showDeleteWarning.value ? (t(), f("div", {
|
|
2481
2481
|
key: 0,
|
|
2482
2482
|
role: "dialog",
|
|
2483
2483
|
"aria-modal": "true",
|
|
@@ -2488,79 +2488,79 @@ var mn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2488
2488
|
"backdrop-filter": "blur(8px)",
|
|
2489
2489
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
2490
2490
|
},
|
|
2491
|
-
onClick:
|
|
2492
|
-
}, [
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
class:
|
|
2491
|
+
onClick: i[10] ||= x((...e) => g(M).cancelDelete && g(M).cancelDelete(...e), ["self"])
|
|
2492
|
+
}, [S("div", Ln, [
|
|
2493
|
+
S("h3", Rn, C(h.value.mediaLibrary.deleteWarningTitle), 1),
|
|
2494
|
+
S("p", {
|
|
2495
|
+
class: _(["tpl:text-xs", g(N).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
2496
2496
|
style: { color: "var(--tpl-text-muted)" }
|
|
2497
|
-
},
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
key:
|
|
2497
|
+
}, C(h.value.mediaLibrary.deleteWarningMessage), 3),
|
|
2498
|
+
g(N).hasUsedFiles.value ? (t(), f("p", zn, C(h.value.mediaLibrary.deleteWarningUsageNote), 1)) : y("", !0),
|
|
2499
|
+
g(N).hasUsedFiles.value ? (t(), f("div", Bn, [(t(!0), f(A, null, o(g(M).deleteUsageInfo.value, (e, n) => (t(), f("div", {
|
|
2500
|
+
key: n,
|
|
2501
2501
|
class: "tpl:text-xs",
|
|
2502
2502
|
style: { color: "var(--tpl-text)" }
|
|
2503
|
-
}, [e.templateCount > 0 ? (
|
|
2504
|
-
|
|
2503
|
+
}, [e.templateCount > 0 ? (t(), f(A, { key: 0 }, [S("span", Vn, C(g(N).displayItems.value.find((e) => e.id === n)?.filename || n), 1), S("span", Hn, " - " + C(h.value.mediaLibrary.usedInTemplates.replace("{count}", e.templateCount.toString())), 1)], 64)) : y("", !0)]))), 128))])) : y("", !0),
|
|
2504
|
+
S("div", Un, [S("button", {
|
|
2505
2505
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
2506
2506
|
style: {
|
|
2507
2507
|
"border-color": "var(--tpl-border)",
|
|
2508
2508
|
color: "var(--tpl-text)",
|
|
2509
2509
|
"background-color": "var(--tpl-bg)"
|
|
2510
2510
|
},
|
|
2511
|
-
onClick:
|
|
2512
|
-
},
|
|
2511
|
+
onClick: i[8] ||= (...e) => g(M).cancelDelete && g(M).cancelDelete(...e)
|
|
2512
|
+
}, C(h.value.mediaLibrary.cancel), 1), S("button", {
|
|
2513
2513
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
2514
2514
|
style: {
|
|
2515
2515
|
"border-color": "var(--tpl-danger)",
|
|
2516
2516
|
color: "var(--tpl-danger)",
|
|
2517
2517
|
"background-color": "var(--tpl-bg)"
|
|
2518
2518
|
},
|
|
2519
|
-
onClick:
|
|
2520
|
-
}, g(
|
|
2521
|
-
])])) :
|
|
2519
|
+
onClick: i[9] ||= (...e) => g(M).confirmDelete && g(M).confirmDelete(...e)
|
|
2520
|
+
}, C(g(N).hasUsedFiles.value ? h.value.mediaLibrary.deleteAnyway : h.value.mediaLibrary.confirmDelete), 1)])
|
|
2521
|
+
])])) : y("", !0)]),
|
|
2522
2522
|
_: 1
|
|
2523
2523
|
}),
|
|
2524
|
-
|
|
2524
|
+
S("div", Wn, [S("div", Gn, [g(M).previewItem.value ? (t(), b(Ft, {
|
|
2525
2525
|
key: 0,
|
|
2526
|
-
item:
|
|
2527
|
-
folders:
|
|
2528
|
-
}, null, 8, ["item", "folders"])) :
|
|
2526
|
+
item: g(M).previewItem.value,
|
|
2527
|
+
folders: g(N).folderTree.value
|
|
2528
|
+
}, null, 8, ["item", "folders"])) : y("", !0)]), S("div", Kn, [g(M).selectedItems.value.size > 0 ? (t(), f("div", qn, [g(M).previewItem.value ? (t(), f("button", {
|
|
2529
2529
|
key: 0,
|
|
2530
2530
|
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
2531
|
-
style:
|
|
2532
|
-
borderColor:
|
|
2533
|
-
color:
|
|
2531
|
+
style: O({
|
|
2532
|
+
borderColor: g(N).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
2533
|
+
color: g(N).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
2534
2534
|
backgroundColor: "var(--tpl-bg)"
|
|
2535
2535
|
}),
|
|
2536
|
-
onClick:
|
|
2537
|
-
}, [
|
|
2536
|
+
onClick: i[11] ||= (e) => g(N).copy(g(N).selectedUrl.value)
|
|
2537
|
+
}, [g(N).copied.value ? (t(), b(g(z), {
|
|
2538
2538
|
key: 1,
|
|
2539
2539
|
size: 12,
|
|
2540
2540
|
"stroke-width": 2
|
|
2541
|
-
})) : (
|
|
2541
|
+
})) : (t(), b(g(P), {
|
|
2542
2542
|
key: 0,
|
|
2543
2543
|
size: 12,
|
|
2544
2544
|
"stroke-width": 2
|
|
2545
|
-
})), m(" " + g(
|
|
2545
|
+
})), m(" " + C(g(N).copied.value ? h.value.mediaLibrary.copied : h.value.mediaLibrary.copyUrl), 1)], 4)) : y("", !0), U.value ? (t(), f("div", Jn, [S("button", {
|
|
2546
2546
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
2547
2547
|
style: {
|
|
2548
2548
|
"border-color": "var(--tpl-border)",
|
|
2549
2549
|
color: "var(--tpl-text)",
|
|
2550
2550
|
"background-color": "var(--tpl-bg)"
|
|
2551
2551
|
},
|
|
2552
|
-
onClick:
|
|
2553
|
-
},
|
|
2552
|
+
onClick: i[12] ||= (e) => g(N).showMovePicker.value = !g(N).showMovePicker.value
|
|
2553
|
+
}, C(h.value.mediaLibrary.moveSelected), 1), g(N).showMovePicker.value ? (t(), b(Ot, {
|
|
2554
2554
|
key: 0,
|
|
2555
|
-
folders:
|
|
2556
|
-
"current-folder-id":
|
|
2557
|
-
onSelect:
|
|
2558
|
-
onClose:
|
|
2555
|
+
folders: g(N).folderTree.value,
|
|
2556
|
+
"current-folder-id": g(M).currentFolderId.value,
|
|
2557
|
+
onSelect: g(N).handleMoveToFolder,
|
|
2558
|
+
onClose: i[13] ||= (e) => g(N).showMovePicker.value = !1
|
|
2559
2559
|
}, null, 8, [
|
|
2560
2560
|
"folders",
|
|
2561
2561
|
"current-folder-id",
|
|
2562
2562
|
"onSelect"
|
|
2563
|
-
])) :
|
|
2563
|
+
])) : y("", !0)])) : y("", !0)])) : y("", !0), S("div", Yn, [ce.value > 0 ? (t(), f("button", {
|
|
2564
2564
|
key: 0,
|
|
2565
2565
|
"data-testid": "media-delete",
|
|
2566
2566
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
@@ -2570,23 +2570,23 @@ var mn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2570
2570
|
"background-color": "var(--tpl-bg)"
|
|
2571
2571
|
},
|
|
2572
2572
|
onClick: fe
|
|
2573
|
-
},
|
|
2573
|
+
}, C(h.value.mediaLibrary.deleteSelected), 1)) : y("", !0), e.showConfirm ? (t(), f("button", {
|
|
2574
2574
|
key: 1,
|
|
2575
|
-
"data-testid":
|
|
2575
|
+
"data-testid": v.value,
|
|
2576
2576
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
2577
2577
|
style: {
|
|
2578
2578
|
"background-color": "var(--tpl-primary)",
|
|
2579
2579
|
color: "var(--tpl-on-primary)"
|
|
2580
2580
|
},
|
|
2581
|
-
disabled: !
|
|
2581
|
+
disabled: !se.value,
|
|
2582
2582
|
onClick: q
|
|
2583
|
-
},
|
|
2583
|
+
}, C(e.accept?.length ? h.value.mediaLibrary.selectImage : h.value.mediaLibrary.selectFile), 9, Xn)) : y("", !0)])])])
|
|
2584
2584
|
]));
|
|
2585
2585
|
}
|
|
2586
2586
|
}), Qn = /* #__PURE__ */ Object.assign({
|
|
2587
2587
|
"./locales/ca.ts": () => import("./ca-Cc6eL0ZS.js"),
|
|
2588
2588
|
"./locales/de.ts": () => import("./de-DtrXVcuY.js"),
|
|
2589
|
-
"./locales/en.ts": () => import("./en-
|
|
2589
|
+
"./locales/en.ts": () => import("./en-IYVryJRl.js"),
|
|
2590
2590
|
"./locales/es.ts": () => import("./es-Dw_h7Oll.js"),
|
|
2591
2591
|
"./locales/fr.ts": () => import("./fr-BJaeKu_8.js"),
|
|
2592
2592
|
"./locales/ja.ts": () => import("./ja-Cu2HdYaK.js"),
|
|
@@ -2615,7 +2615,7 @@ async function ar(e) {
|
|
|
2615
2615
|
return (await t()).default;
|
|
2616
2616
|
}
|
|
2617
2617
|
// ../media-library/src/components/MediaLibraryModal.vue?vue&type=script&setup=true&lang.ts
|
|
2618
|
-
var or = ["data-tpl-theme"], sr = /* @__PURE__ */
|
|
2618
|
+
var or = ["data-tpl-theme"], sr = /* @__PURE__ */ e({
|
|
2619
2619
|
__name: "MediaLibraryModal",
|
|
2620
2620
|
props: {
|
|
2621
2621
|
visible: { type: Boolean },
|
|
@@ -2628,25 +2628,25 @@ var or = ["data-tpl-theme"], sr = /* @__PURE__ */ t({
|
|
|
2628
2628
|
onError: { type: Function }
|
|
2629
2629
|
},
|
|
2630
2630
|
emits: ["close", "select"],
|
|
2631
|
-
setup(
|
|
2632
|
-
let
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
}, { immediate: !0 }),
|
|
2636
|
-
let
|
|
2637
|
-
|
|
2638
|
-
let
|
|
2639
|
-
|
|
2640
|
-
let
|
|
2641
|
-
ge(
|
|
2631
|
+
setup(e, { emit: a }) {
|
|
2632
|
+
let o = e, s = a, c = k(null);
|
|
2633
|
+
r(() => o.locale, async (e) => {
|
|
2634
|
+
c.value = await ar(e ?? "en");
|
|
2635
|
+
}, { immediate: !0 }), i(fe, c);
|
|
2636
|
+
let l = D(() => o.uiTheme);
|
|
2637
|
+
i(Y, l);
|
|
2638
|
+
let u = p(() => o.popoverTarget ?? null);
|
|
2639
|
+
i(J, u), i(X, p(() => o.locale));
|
|
2640
|
+
let d = k(null), m = k(null);
|
|
2641
|
+
ge(d, D(() => o.visible && c.value !== null && !m.value?.nestedDialogOpen));
|
|
2642
2642
|
function h(e) {
|
|
2643
|
-
e.key === "Escape" && (m.value?.handleEscape() ? e.preventDefault() :
|
|
2643
|
+
e.key === "Escape" && (m.value?.handleEscape() ? e.preventDefault() : s("close"));
|
|
2644
2644
|
}
|
|
2645
|
-
|
|
2645
|
+
K(document, "keydown", h);
|
|
2646
2646
|
function g(e) {
|
|
2647
|
-
|
|
2647
|
+
s("select", e), s("close");
|
|
2648
2648
|
}
|
|
2649
|
-
return (
|
|
2649
|
+
return (r, i) => (t(), b(v, { to: e.popoverTarget || "body" }, [j(w, {
|
|
2650
2650
|
"enter-active-class": "tpl:transition tpl:duration-200",
|
|
2651
2651
|
"enter-from-class": "tpl:opacity-0",
|
|
2652
2652
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -2654,20 +2654,20 @@ var or = ["data-tpl-theme"], sr = /* @__PURE__ */ t({
|
|
|
2654
2654
|
"leave-from-class": "tpl:opacity-100",
|
|
2655
2655
|
"leave-to-class": "tpl:opacity-0"
|
|
2656
2656
|
}, {
|
|
2657
|
-
default:
|
|
2657
|
+
default: n(() => [e.visible && c.value ? (t(), f("div", {
|
|
2658
2658
|
key: 0,
|
|
2659
2659
|
"data-testid": "media-library-modal",
|
|
2660
|
-
"data-tpl-theme":
|
|
2661
|
-
class:
|
|
2660
|
+
"data-tpl-theme": l.value,
|
|
2661
|
+
class: _([e.popoverTarget ? void 0 : "tpl", "tpl-media-overlay tpl:fixed tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:p-4"]),
|
|
2662
2662
|
style: {
|
|
2663
2663
|
"background-color": "var(--tpl-overlay)",
|
|
2664
2664
|
"backdrop-filter": "blur(8px)",
|
|
2665
2665
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
2666
2666
|
},
|
|
2667
|
-
onClick:
|
|
2668
|
-
}, [
|
|
2667
|
+
onClick: i[1] ||= x((e) => s("close"), ["self"])
|
|
2668
|
+
}, [S("div", {
|
|
2669
2669
|
ref_key: "dialogRef",
|
|
2670
|
-
ref:
|
|
2670
|
+
ref: d,
|
|
2671
2671
|
role: "dialog",
|
|
2672
2672
|
"aria-modal": "true",
|
|
2673
2673
|
"aria-labelledby": "tpl-media-library-title",
|
|
@@ -2682,18 +2682,18 @@ var or = ["data-tpl-theme"], sr = /* @__PURE__ */ t({
|
|
|
2682
2682
|
border: "1px solid var(--tpl-border)",
|
|
2683
2683
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2684
2684
|
}
|
|
2685
|
-
}, [
|
|
2685
|
+
}, [j(Zn, {
|
|
2686
2686
|
ref_key: "chromeRef",
|
|
2687
2687
|
ref: m,
|
|
2688
|
-
provider:
|
|
2689
|
-
accept:
|
|
2690
|
-
"template-id":
|
|
2691
|
-
"on-error":
|
|
2692
|
-
translations:
|
|
2688
|
+
provider: e.provider,
|
|
2689
|
+
accept: e.accept,
|
|
2690
|
+
"template-id": e.templateId,
|
|
2691
|
+
"on-error": e.onError,
|
|
2692
|
+
translations: c.value,
|
|
2693
2693
|
"show-close": "",
|
|
2694
2694
|
"show-confirm": "",
|
|
2695
2695
|
"confirm-test-id": "media-confirm",
|
|
2696
|
-
onClose:
|
|
2696
|
+
onClose: i[0] ||= (e) => s("close"),
|
|
2697
2697
|
onConfirm: g
|
|
2698
2698
|
}, null, 8, [
|
|
2699
2699
|
"provider",
|
|
@@ -2701,11 +2701,11 @@ var or = ["data-tpl-theme"], sr = /* @__PURE__ */ t({
|
|
|
2701
2701
|
"template-id",
|
|
2702
2702
|
"on-error",
|
|
2703
2703
|
"translations"
|
|
2704
|
-
])], 512)], 10, or)) :
|
|
2704
|
+
])], 512)], 10, or)) : y("", !0)]),
|
|
2705
2705
|
_: 1
|
|
2706
2706
|
})], 8, ["to"]));
|
|
2707
2707
|
}
|
|
2708
2708
|
});
|
|
2709
2709
|
export { sr as MediaLibraryModal, J as a, pe as i, Q as n, Y as o, Z as r, ge as t };
|
|
2710
2710
|
|
|
2711
|
-
//# sourceMappingURL=editor-modal-
|
|
2711
|
+
//# sourceMappingURL=editor-modal-CPbgthOv.js.map
|