@strapi/content-manager 0.0.0-experimental.e14656d3b8681880212c13260b9a2b340c182f2d → 0.0.0-experimental.e576af447d9f97e89e24c6daa32d8f714376cd5f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs +80 -0
- package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.map +1 -0
- package/dist/admin/chunks/CardDragPreview-_dubYgXO.js +82 -0
- package/dist/admin/chunks/CardDragPreview-_dubYgXO.js.map +1 -0
- package/dist/admin/chunks/ComponentConfigurationPage-BRMxaaa0.mjs +277 -0
- package/dist/admin/chunks/ComponentConfigurationPage-BRMxaaa0.mjs.map +1 -0
- package/dist/admin/chunks/ComponentConfigurationPage-DwjhCutb.js +299 -0
- package/dist/admin/chunks/ComponentConfigurationPage-DwjhCutb.js.map +1 -0
- package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs +153 -0
- package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.map +1 -0
- package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js +176 -0
- package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js.map +1 -0
- package/dist/admin/chunks/EditConfigurationPage-DPQ6e_ZU.js +181 -0
- package/dist/admin/chunks/EditConfigurationPage-DPQ6e_ZU.js.map +1 -0
- package/dist/admin/chunks/EditConfigurationPage-mHz7EIZ9.mjs +159 -0
- package/dist/admin/chunks/EditConfigurationPage-mHz7EIZ9.mjs.map +1 -0
- package/dist/admin/chunks/EditViewPage-CXmEDGW2.js +334 -0
- package/dist/admin/chunks/EditViewPage-CXmEDGW2.js.map +1 -0
- package/dist/admin/chunks/EditViewPage-DC_tEaOd.mjs +311 -0
- package/dist/admin/chunks/EditViewPage-DC_tEaOd.mjs.map +1 -0
- package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs +56 -0
- package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.map +1 -0
- package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js +58 -0
- package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js.map +1 -0
- package/dist/admin/chunks/Form-CmzyWdCy.js +978 -0
- package/dist/admin/chunks/Form-CmzyWdCy.js.map +1 -0
- package/dist/admin/chunks/Form-Sz84KGej.mjs +955 -0
- package/dist/admin/chunks/Form-Sz84KGej.mjs.map +1 -0
- package/dist/admin/chunks/History-B75NuF92.js +1380 -0
- package/dist/admin/chunks/History-B75NuF92.js.map +1 -0
- package/dist/admin/chunks/History-C5fFAagI.mjs +1357 -0
- package/dist/admin/chunks/History-C5fFAagI.mjs.map +1 -0
- package/dist/admin/chunks/Input-BIzj18xW.js +7221 -0
- package/dist/admin/chunks/Input-BIzj18xW.js.map +1 -0
- package/dist/admin/chunks/Input-DDV2blpv.mjs +7190 -0
- package/dist/admin/chunks/Input-DDV2blpv.mjs.map +1 -0
- package/dist/admin/chunks/ListConfigurationPage-DVFNbbLl.js +819 -0
- package/dist/admin/chunks/ListConfigurationPage-DVFNbbLl.js.map +1 -0
- package/dist/admin/chunks/ListConfigurationPage-Ddq1APAQ.mjs +796 -0
- package/dist/admin/chunks/ListConfigurationPage-Ddq1APAQ.mjs.map +1 -0
- package/dist/admin/chunks/ListViewPage-D3gpvdM2.js +1155 -0
- package/dist/admin/chunks/ListViewPage-D3gpvdM2.js.map +1 -0
- package/dist/admin/chunks/ListViewPage-IIou-WFn.mjs +1133 -0
- package/dist/admin/chunks/ListViewPage-IIou-WFn.mjs.map +1 -0
- package/dist/admin/chunks/NoContentTypePage-B7sfKVrj.js +60 -0
- package/dist/admin/chunks/NoContentTypePage-B7sfKVrj.js.map +1 -0
- package/dist/admin/chunks/NoContentTypePage-mZFnYA3z.mjs +58 -0
- package/dist/admin/chunks/NoContentTypePage-mZFnYA3z.mjs.map +1 -0
- package/dist/admin/chunks/NoPermissionsPage-C-XBYfpZ.js +39 -0
- package/dist/admin/chunks/NoPermissionsPage-C-XBYfpZ.js.map +1 -0
- package/dist/admin/chunks/NoPermissionsPage-CfUdeuGT.mjs +37 -0
- package/dist/admin/chunks/NoPermissionsPage-CfUdeuGT.mjs.map +1 -0
- package/dist/admin/chunks/Preview-DkU1bar6.js +696 -0
- package/dist/admin/chunks/Preview-DkU1bar6.js.map +1 -0
- package/dist/admin/chunks/Preview-xr-5BCHr.mjs +674 -0
- package/dist/admin/chunks/Preview-xr-5BCHr.mjs.map +1 -0
- package/dist/admin/chunks/Relations-Ddnb_jYb.mjs +1291 -0
- package/dist/admin/chunks/Relations-Ddnb_jYb.mjs.map +1 -0
- package/dist/admin/chunks/Relations-VSItCr8c.js +1318 -0
- package/dist/admin/chunks/Relations-VSItCr8c.js.map +1 -0
- package/dist/admin/chunks/ar-DckYq_WK.mjs +222 -0
- package/dist/{_chunks/ar-CCEVvqGG.mjs.map → admin/chunks/ar-DckYq_WK.mjs.map} +1 -1
- package/dist/admin/chunks/ar-DeQBSsfl.js +227 -0
- package/dist/{_chunks/ru-BT3ybNny.js.map → admin/chunks/ar-DeQBSsfl.js.map} +1 -1
- package/dist/admin/chunks/ca-ClDTvatJ.js +202 -0
- package/dist/admin/chunks/ca-ClDTvatJ.js.map +1 -0
- package/dist/admin/chunks/ca-DviY7mRj.mjs +197 -0
- package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
- package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
- package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
- package/dist/admin/chunks/cs-C7OSYFQ7.mjs +122 -0
- package/dist/{_chunks/cs-CM2aBUar.mjs.map → admin/chunks/cs-C7OSYFQ7.mjs.map} +1 -1
- package/dist/admin/chunks/de-5QRlDHyR.mjs +195 -0
- package/dist/{_chunks/eu-CdALomew.mjs.map → admin/chunks/de-5QRlDHyR.mjs.map} +1 -1
- package/dist/admin/chunks/de-CbImAUA5.js +200 -0
- package/dist/{_chunks/gu-BRmF601H.js.map → admin/chunks/de-CbImAUA5.js.map} +1 -1
- package/dist/admin/chunks/en-CImiNxXE.mjs +310 -0
- package/dist/{_chunks/en-BrCTWlZv.mjs.map → admin/chunks/en-CImiNxXE.mjs.map} +1 -1
- package/dist/admin/chunks/en-CLf4SuMQ.js +315 -0
- package/dist/{_chunks/en-uOUIxfcQ.js.map → admin/chunks/en-CLf4SuMQ.js.map} +1 -1
- package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
- package/dist/{_chunks/es-EUonQTon.js.map → admin/chunks/es-C8vLuvZL.js.map} +1 -1
- package/dist/admin/chunks/es-DkoWSExG.mjs +192 -0
- package/dist/{_chunks/ja-CtsUxOvk.mjs.map → admin/chunks/es-DkoWSExG.mjs.map} +1 -1
- package/dist/admin/chunks/eu-BG1xX7HK.mjs +198 -0
- package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +1 -0
- package/dist/admin/chunks/eu-BJW3AvXu.js +203 -0
- package/dist/admin/chunks/eu-BJW3AvXu.js.map +1 -0
- package/dist/admin/chunks/fr-CFdRaRVj.mjs +215 -0
- package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +1 -0
- package/dist/admin/chunks/fr-gQSilC7w.js +220 -0
- package/dist/admin/chunks/fr-gQSilC7w.js.map +1 -0
- package/dist/admin/chunks/gu-D5MMMXRs.mjs +196 -0
- package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +1 -0
- package/dist/admin/chunks/gu-DPU4wyx7.js +201 -0
- package/dist/{_chunks/eu-VDH-3ovk.js.map → admin/chunks/gu-DPU4wyx7.js.map} +1 -1
- package/dist/admin/chunks/hi-Dp4omeBb.js +201 -0
- package/dist/admin/chunks/hi-Dp4omeBb.js.map +1 -0
- package/dist/admin/chunks/hi-lp17SCjr.mjs +196 -0
- package/dist/admin/chunks/hi-lp17SCjr.mjs.map +1 -0
- package/dist/{_chunks/hooks-BAaaKPS_.js → admin/chunks/hooks-D-sOYd1s.js} +6 -3
- package/dist/admin/chunks/hooks-D-sOYd1s.js.map +1 -0
- package/dist/admin/chunks/hooks-DMvik5y_.mjs +7 -0
- package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
- package/dist/admin/chunks/hu-CLka1U2C.mjs +198 -0
- package/dist/admin/chunks/hu-CLka1U2C.mjs.map +1 -0
- package/dist/admin/chunks/hu-CtFJuhTd.js +203 -0
- package/dist/admin/chunks/hu-CtFJuhTd.js.map +1 -0
- package/dist/admin/chunks/id-D7V5S1rB.js +161 -0
- package/dist/{_chunks/it-DkBIs7vD.js.map → admin/chunks/id-D7V5S1rB.js.map} +1 -1
- package/dist/admin/chunks/id-USfY9m1g.mjs +156 -0
- package/dist/{_chunks/id-BtwA9WJT.mjs.map → admin/chunks/id-USfY9m1g.mjs.map} +1 -1
- package/dist/admin/chunks/index-BE23Vyc8.js +5456 -0
- package/dist/admin/chunks/index-BE23Vyc8.js.map +1 -0
- package/dist/admin/chunks/index-TXDGJBhY.mjs +5389 -0
- package/dist/admin/chunks/index-TXDGJBhY.mjs.map +1 -0
- package/dist/admin/chunks/it-BAHrwmYS.mjs +158 -0
- package/dist/{_chunks/it-BrVPqaf1.mjs.map → admin/chunks/it-BAHrwmYS.mjs.map} +1 -1
- package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
- package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
- package/dist/admin/chunks/ja-BWKmBJFT.mjs +192 -0
- package/dist/{_chunks/ko-HVQRlfUI.mjs.map → admin/chunks/ja-BWKmBJFT.mjs.map} +1 -1
- package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
- package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ja-jdQM-B79.js.map} +1 -1
- package/dist/admin/chunks/ko-CgADGBNt.mjs +191 -0
- package/dist/{_chunks/es-CeXiYflN.mjs.map → admin/chunks/ko-CgADGBNt.mjs.map} +1 -1
- package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
- package/dist/{_chunks/ja-CcFe8diO.js.map → admin/chunks/ko-k46sEyzt.js.map} +1 -1
- package/dist/admin/chunks/layout-B3zsQDhd.js +619 -0
- package/dist/admin/chunks/layout-B3zsQDhd.js.map +1 -0
- package/dist/admin/chunks/layout-DmbmZmt8.mjs +599 -0
- package/dist/admin/chunks/layout-DmbmZmt8.mjs.map +1 -0
- package/dist/admin/chunks/ml-CnhCfOn_.mjs +196 -0
- package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +1 -0
- package/dist/admin/chunks/ml-DqxPwODx.js +201 -0
- package/dist/admin/chunks/ml-DqxPwODx.js.map +1 -0
- package/dist/admin/chunks/ms-Bh09NFff.mjs +140 -0
- package/dist/{_chunks/ms-m_WjyWx7.mjs.map → admin/chunks/ms-Bh09NFff.mjs.map} +1 -1
- package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
- package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/ms-CvSC0OdG.js.map} +1 -1
- package/dist/admin/chunks/nl-BEubhS8C.js +203 -0
- package/dist/admin/chunks/nl-BEubhS8C.js.map +1 -0
- package/dist/admin/chunks/nl-C8HYflTc.mjs +198 -0
- package/dist/admin/chunks/nl-C8HYflTc.mjs.map +1 -0
- package/dist/admin/chunks/objects-C3EebVVe.js +76 -0
- package/dist/admin/chunks/objects-C3EebVVe.js.map +1 -0
- package/dist/admin/chunks/objects-wl73iEma.mjs +73 -0
- package/dist/admin/chunks/objects-wl73iEma.mjs.map +1 -0
- package/dist/admin/chunks/pl-DWhGDzmM.js +200 -0
- package/dist/{_chunks/ca-Cmk45QO6.js.map → admin/chunks/pl-DWhGDzmM.js.map} +1 -1
- package/dist/admin/chunks/pl-MFCZJZuZ.mjs +195 -0
- package/dist/{_chunks/ca-5U32ON2v.mjs.map → admin/chunks/pl-MFCZJZuZ.mjs.map} +1 -1
- package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
- package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CPtAXD-4.js.map} +1 -1
- package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs +197 -0
- package/dist/{_chunks/pt-BR-C71iDxnh.mjs.map → admin/chunks/pt-BR-CcotyBGJ.mjs.map} +1 -1
- package/dist/admin/chunks/pt-BoPxN80n.js +96 -0
- package/dist/admin/chunks/pt-BoPxN80n.js.map +1 -0
- package/dist/admin/chunks/pt-HbmgeiYO.mjs +93 -0
- package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
- package/dist/admin/chunks/relations-B93RmIIQ.js +178 -0
- package/dist/admin/chunks/relations-B93RmIIQ.js.map +1 -0
- package/dist/admin/chunks/relations-Ccbyl2K1.mjs +173 -0
- package/dist/admin/chunks/relations-Ccbyl2K1.mjs.map +1 -0
- package/dist/admin/chunks/ru-C0op0ALG.js +232 -0
- package/dist/admin/chunks/ru-C0op0ALG.js.map +1 -0
- package/dist/admin/chunks/ru-CB4BUyQp.mjs +230 -0
- package/dist/{_chunks/ru-BE6A4Exp.mjs.map → admin/chunks/ru-CB4BUyQp.mjs.map} +1 -1
- package/dist/admin/chunks/sa-B_FuPyMw.js +201 -0
- package/dist/admin/chunks/sa-B_FuPyMw.js.map +1 -0
- package/dist/admin/chunks/sa-n_aPA-pU.mjs +196 -0
- package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +1 -0
- package/dist/admin/chunks/sk-D_iXML2C.js +203 -0
- package/dist/admin/chunks/sk-D_iXML2C.js.map +1 -0
- package/dist/admin/chunks/sk-tn_BDjE2.mjs +198 -0
- package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +1 -0
- package/dist/admin/chunks/sv-BstBC1Yp.js +203 -0
- package/dist/admin/chunks/sv-BstBC1Yp.js.map +1 -0
- package/dist/admin/chunks/sv-cq4ZrQRd.mjs +198 -0
- package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +1 -0
- package/dist/admin/chunks/th-lXoOCqPC.js +149 -0
- package/dist/{_chunks/th-D9_GfAjc.js.map → admin/chunks/th-lXoOCqPC.js.map} +1 -1
- package/dist/admin/chunks/th-mUH7hEtc.mjs +144 -0
- package/dist/{_chunks/uk-CR-zDhAY.mjs.map → admin/chunks/th-mUH7hEtc.mjs.map} +1 -1
- package/dist/admin/chunks/tr-CkS6sLIE.js +200 -0
- package/dist/admin/chunks/tr-CkS6sLIE.js.map +1 -0
- package/dist/admin/chunks/tr-Yt38daxh.mjs +195 -0
- package/dist/{_chunks/de-C72KDNOl.mjs.map → admin/chunks/tr-Yt38daxh.mjs.map} +1 -1
- package/dist/admin/chunks/uk-BtM6WnaE.mjs +313 -0
- package/dist/admin/chunks/uk-BtM6WnaE.mjs.map +1 -0
- package/dist/admin/chunks/uk-DB6OgySY.js +318 -0
- package/dist/admin/chunks/uk-DB6OgySY.js.map +1 -0
- package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs +247 -0
- package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs.map +1 -0
- package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js +271 -0
- package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +1 -0
- package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs +18 -0
- package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs.map +1 -0
- package/dist/admin/chunks/usePrev-DIYl-IAL.js +21 -0
- package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +1 -0
- package/dist/admin/chunks/vi-BGr1X_HZ.js +112 -0
- package/dist/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-BGr1X_HZ.js.map} +1 -1
- package/dist/admin/chunks/vi-CvBGlTjr.mjs +108 -0
- package/dist/{_chunks/vi-DUXIk_fw.mjs.map → admin/chunks/vi-CvBGlTjr.mjs.map} +1 -1
- package/dist/admin/chunks/zh-BmF-sHaT.mjs +205 -0
- package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +1 -0
- package/dist/admin/chunks/zh-DwFu_Kfj.js +210 -0
- package/dist/admin/chunks/zh-DwFu_Kfj.js.map +1 -0
- package/dist/admin/chunks/zh-Hans-CI0HKio3.mjs +934 -0
- package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-CI0HKio3.mjs.map} +1 -1
- package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
- package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
- package/dist/admin/index.js +26 -4
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +17 -11
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/src/components/InjectionZone.d.ts +7 -1
- package/dist/admin/src/content-manager.d.ts +7 -2
- package/dist/admin/src/exports.d.ts +2 -1
- package/dist/admin/src/history/services/historyVersion.d.ts +2 -2
- package/dist/admin/src/hooks/useDocument.d.ts +52 -2
- package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +3 -2
- package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
- package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +55 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +2 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +0 -32
- package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +29 -1
- package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
- package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
- package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +3 -0
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/index.d.ts +3 -0
- package/dist/admin/src/preview/pages/Preview.d.ts +15 -0
- package/dist/admin/src/preview/routes.d.ts +3 -0
- package/dist/admin/src/preview/services/preview.d.ts +3 -0
- package/dist/admin/src/router.d.ts +1 -1
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +3 -3
- package/dist/admin/src/services/documents.d.ts +19 -20
- package/dist/admin/src/services/init.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +2 -2
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/server/index.js +5473 -4131
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +5451 -4106
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +17 -2
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- package/dist/server/src/history/controllers/history-version.d.ts +1 -1
- package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
- package/dist/server/src/history/services/history.d.ts +3 -3
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +7 -11
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +7 -6
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/preview/controllers/index.d.ts +2 -0
- package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/preview.d.ts +13 -0
- package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
- package/dist/server/src/preview/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/index.d.ts +8 -0
- package/dist/server/src/preview/routes/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/preview.d.ts +4 -0
- package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
- package/dist/server/src/preview/services/index.d.ts +16 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +32 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview.d.ts +12 -0
- package/dist/server/src/preview/services/preview.d.ts.map +1 -0
- package/dist/server/src/preview/utils.d.ts +19 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +12 -10
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +7 -6
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/utils/count.d.ts +1 -1
- package/dist/server/src/services/utils/count.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts +3 -3
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +2 -0
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +3 -2
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/components.d.ts +0 -1
- package/dist/shared/contracts/content-types.d.ts +0 -1
- package/dist/shared/contracts/history-versions.d.ts +0 -1
- package/dist/shared/contracts/index.d.ts +1 -1
- package/dist/shared/contracts/index.d.ts.map +1 -1
- package/dist/shared/contracts/init.d.ts +0 -1
- package/dist/shared/contracts/preview.d.ts +26 -0
- package/dist/shared/contracts/preview.d.ts.map +1 -0
- package/dist/shared/contracts/relations.d.ts +1 -2
- package/dist/shared/contracts/relations.d.ts.map +1 -1
- package/dist/shared/contracts/review-workflows.d.ts +0 -1
- package/dist/shared/contracts/single-types.d.ts +0 -1
- package/dist/shared/contracts/uid.d.ts +0 -1
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/index.js +37 -22
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +36 -23
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +25 -21
- package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
- package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
- package/dist/_chunks/ComponentConfigurationPage-D_M8iBw5.js +0 -255
- package/dist/_chunks/ComponentConfigurationPage-D_M8iBw5.js.map +0 -1
- package/dist/_chunks/ComponentConfigurationPage-qemkOlnj.mjs +0 -236
- package/dist/_chunks/ComponentConfigurationPage-qemkOlnj.mjs.map +0 -1
- package/dist/_chunks/ComponentIcon-BXdiCGQp.js +0 -176
- package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +0 -1
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
- package/dist/_chunks/EditConfigurationPage-BePwPuHy.js +0 -151
- package/dist/_chunks/EditConfigurationPage-BePwPuHy.js.map +0 -1
- package/dist/_chunks/EditConfigurationPage-CjUrEewK.mjs +0 -132
- package/dist/_chunks/EditConfigurationPage-CjUrEewK.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-B-RJeiJD.js +0 -233
- package/dist/_chunks/EditViewPage-B-RJeiJD.js.map +0 -1
- package/dist/_chunks/EditViewPage-De8GyU8P.mjs +0 -214
- package/dist/_chunks/EditViewPage-De8GyU8P.mjs.map +0 -1
- package/dist/_chunks/Field-dq8Tg1M_.js +0 -5589
- package/dist/_chunks/Field-dq8Tg1M_.js.map +0 -1
- package/dist/_chunks/Field-pb2o8uBe.mjs +0 -5557
- package/dist/_chunks/Field-pb2o8uBe.mjs.map +0 -1
- package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
- package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
- package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
- package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
- package/dist/_chunks/Form-DGIf4jQU.js +0 -771
- package/dist/_chunks/Form-DGIf4jQU.js.map +0 -1
- package/dist/_chunks/Form-DJn0Dxha.mjs +0 -750
- package/dist/_chunks/Form-DJn0Dxha.mjs.map +0 -1
- package/dist/_chunks/History-BowL3JKP.mjs +0 -1032
- package/dist/_chunks/History-BowL3JKP.mjs.map +0 -1
- package/dist/_chunks/History-Dh2NEHnR.js +0 -1053
- package/dist/_chunks/History-Dh2NEHnR.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-BpVOB-hn.mjs +0 -632
- package/dist/_chunks/ListConfigurationPage-BpVOB-hn.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-BxYCWz9e.js +0 -652
- package/dist/_chunks/ListConfigurationPage-BxYCWz9e.js.map +0 -1
- package/dist/_chunks/ListViewPage-4XsciqHZ.js +0 -848
- package/dist/_chunks/ListViewPage-4XsciqHZ.js.map +0 -1
- package/dist/_chunks/ListViewPage-CXFUjZQC.mjs +0 -824
- package/dist/_chunks/ListViewPage-CXFUjZQC.mjs.map +0 -1
- package/dist/_chunks/NoContentTypePage-C8OpoHeU.js +0 -51
- package/dist/_chunks/NoContentTypePage-C8OpoHeU.js.map +0 -1
- package/dist/_chunks/NoContentTypePage-DuhOTp3x.mjs +0 -51
- package/dist/_chunks/NoContentTypePage-DuhOTp3x.mjs.map +0 -1
- package/dist/_chunks/NoPermissionsPage-DVz3mzDz.mjs +0 -23
- package/dist/_chunks/NoPermissionsPage-DVz3mzDz.mjs.map +0 -1
- package/dist/_chunks/NoPermissionsPage-y_r7DVA2.js +0 -23
- package/dist/_chunks/NoPermissionsPage-y_r7DVA2.js.map +0 -1
- package/dist/_chunks/Relations-CVNLrn1Y.mjs +0 -694
- package/dist/_chunks/Relations-CVNLrn1Y.mjs.map +0 -1
- package/dist/_chunks/Relations-DPFCAa7b.js +0 -714
- package/dist/_chunks/Relations-DPFCAa7b.js.map +0 -1
- package/dist/_chunks/ar-BUUWXIYu.js +0 -226
- package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
- package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
- package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
- package/dist/_chunks/ca-Cmk45QO6.js +0 -201
- package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
- package/dist/_chunks/cs-CkJy6B2v.js +0 -125
- package/dist/_chunks/de-C72KDNOl.mjs +0 -199
- package/dist/_chunks/de-CCEmbAah.js +0 -199
- package/dist/_chunks/en-BrCTWlZv.mjs +0 -292
- package/dist/_chunks/en-uOUIxfcQ.js +0 -292
- package/dist/_chunks/es-CeXiYflN.mjs +0 -196
- package/dist/_chunks/es-EUonQTon.js +0 -196
- package/dist/_chunks/eu-CdALomew.mjs +0 -202
- package/dist/_chunks/eu-VDH-3ovk.js +0 -202
- package/dist/_chunks/fr-B7kGGg3E.js +0 -206
- package/dist/_chunks/fr-B7kGGg3E.js.map +0 -1
- package/dist/_chunks/fr-CD9VFbPM.mjs +0 -206
- package/dist/_chunks/fr-CD9VFbPM.mjs.map +0 -1
- package/dist/_chunks/gu-BRmF601H.js +0 -200
- package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
- package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
- package/dist/_chunks/hi-CCJBptSq.js +0 -200
- package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
- package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
- package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
- package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
- package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
- package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
- package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
- package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
- package/dist/_chunks/hu-sNV_yLYy.js +0 -202
- package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
- package/dist/_chunks/id-B5Ser98A.js +0 -160
- package/dist/_chunks/id-B5Ser98A.js.map +0 -1
- package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
- package/dist/_chunks/index-C3fJE-1-.js +0 -3999
- package/dist/_chunks/index-C3fJE-1-.js.map +0 -1
- package/dist/_chunks/index-DiMrfcfy.mjs +0 -3980
- package/dist/_chunks/index-DiMrfcfy.mjs.map +0 -1
- package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
- package/dist/_chunks/it-DkBIs7vD.js +0 -162
- package/dist/_chunks/ja-CcFe8diO.js +0 -196
- package/dist/_chunks/ja-CtsUxOvk.mjs +0 -196
- package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
- package/dist/_chunks/ko-woFZPmLk.js +0 -195
- package/dist/_chunks/layout-C788OmNr.js +0 -488
- package/dist/_chunks/layout-C788OmNr.js.map +0 -1
- package/dist/_chunks/layout-ls3gxfpH.mjs +0 -470
- package/dist/_chunks/layout-ls3gxfpH.mjs.map +0 -1
- package/dist/_chunks/ml-BihZwQit.mjs +0 -200
- package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
- package/dist/_chunks/ml-C2W8N8k1.js +0 -200
- package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
- package/dist/_chunks/ms-BuFotyP_.js +0 -144
- package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
- package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
- package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
- package/dist/_chunks/nl-bbEOHChV.js +0 -202
- package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
- package/dist/_chunks/objects-gigeqt7s.js +0 -49
- package/dist/_chunks/objects-gigeqt7s.js.map +0 -1
- package/dist/_chunks/objects-mKMAmfec.mjs +0 -47
- package/dist/_chunks/objects-mKMAmfec.mjs.map +0 -1
- package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
- package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
- package/dist/_chunks/pl-uzwG-hk7.js +0 -199
- package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
- package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
- package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
- package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
- package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
- package/dist/_chunks/pt-CeXQuq50.js +0 -95
- package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
- package/dist/_chunks/relations-CLcOmGO0.mjs +0 -135
- package/dist/_chunks/relations-CLcOmGO0.mjs.map +0 -1
- package/dist/_chunks/relations-DYeotliT.js +0 -134
- package/dist/_chunks/relations-DYeotliT.js.map +0 -1
- package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
- package/dist/_chunks/ru-BT3ybNny.js +0 -231
- package/dist/_chunks/sa-CcvkYInH.js +0 -200
- package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
- package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
- package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
- package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
- package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
- package/dist/_chunks/sk-CvY09Xjv.js +0 -202
- package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
- package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
- package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
- package/dist/_chunks/sv-MYDuzgvT.js +0 -202
- package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
- package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
- package/dist/_chunks/th-BqbI8lIT.mjs.map +0 -1
- package/dist/_chunks/th-D9_GfAjc.js +0 -148
- package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
- package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
- package/dist/_chunks/tr-D9UH-O_R.js +0 -199
- package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
- package/dist/_chunks/uk-C8EiqJY7.js +0 -144
- package/dist/_chunks/uk-C8EiqJY7.js.map +0 -1
- package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
- package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs +0 -231
- package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +0 -1
- package/dist/_chunks/useDragAndDrop-J0TUUbR6.js +0 -249
- package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +0 -1
- package/dist/_chunks/usePrev-B9w_-eYc.js +0 -15
- package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
- package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
- package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
- package/dist/_chunks/vi-CJlYDheJ.js +0 -111
- package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
- package/dist/_chunks/zh-BWZspA60.mjs +0 -209
- package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
- package/dist/_chunks/zh-CQQfszqR.js +0 -209
- package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
- package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
- package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
- package/strapi-server.js +0 -3
@@ -1,231 +0,0 @@
|
|
1
|
-
import * as React from "react";
|
2
|
-
import { useDrop, useDrag } from "react-dnd";
|
3
|
-
const ItemTypes = {
|
4
|
-
COMPONENT: "component",
|
5
|
-
EDIT_FIELD: "editField",
|
6
|
-
FIELD: "field",
|
7
|
-
DYNAMIC_ZONE: "dynamicZone",
|
8
|
-
RELATION: "relation",
|
9
|
-
BLOCKS: "blocks"
|
10
|
-
};
|
11
|
-
const useKeyboardDragAndDrop = (active, index, { onCancel, onDropItem, onGrabItem, onMoveItem }) => {
|
12
|
-
const [isSelected, setIsSelected] = React.useState(false);
|
13
|
-
const handleMove = (movement) => {
|
14
|
-
if (!isSelected) {
|
15
|
-
return;
|
16
|
-
}
|
17
|
-
if (typeof index === "number" && onMoveItem) {
|
18
|
-
if (movement === "UP") {
|
19
|
-
onMoveItem(index - 1, index);
|
20
|
-
} else if (movement === "DOWN") {
|
21
|
-
onMoveItem(index + 1, index);
|
22
|
-
}
|
23
|
-
}
|
24
|
-
};
|
25
|
-
const handleDragClick = () => {
|
26
|
-
if (isSelected) {
|
27
|
-
if (onDropItem) {
|
28
|
-
onDropItem(index);
|
29
|
-
}
|
30
|
-
setIsSelected(false);
|
31
|
-
} else {
|
32
|
-
if (onGrabItem) {
|
33
|
-
onGrabItem(index);
|
34
|
-
}
|
35
|
-
setIsSelected(true);
|
36
|
-
}
|
37
|
-
};
|
38
|
-
const handleCancel = () => {
|
39
|
-
if (isSelected) {
|
40
|
-
setIsSelected(false);
|
41
|
-
if (onCancel) {
|
42
|
-
onCancel(index);
|
43
|
-
}
|
44
|
-
}
|
45
|
-
};
|
46
|
-
const handleKeyDown = (e) => {
|
47
|
-
if (!active) {
|
48
|
-
return;
|
49
|
-
}
|
50
|
-
if (e.key === "Tab" && !isSelected) {
|
51
|
-
return;
|
52
|
-
}
|
53
|
-
e.preventDefault();
|
54
|
-
switch (e.key) {
|
55
|
-
case " ":
|
56
|
-
case "Enter":
|
57
|
-
handleDragClick();
|
58
|
-
break;
|
59
|
-
case "Escape":
|
60
|
-
handleCancel();
|
61
|
-
break;
|
62
|
-
case "ArrowDown":
|
63
|
-
case "ArrowRight":
|
64
|
-
handleMove("DOWN");
|
65
|
-
break;
|
66
|
-
case "ArrowUp":
|
67
|
-
case "ArrowLeft":
|
68
|
-
handleMove("UP");
|
69
|
-
break;
|
70
|
-
}
|
71
|
-
};
|
72
|
-
return handleKeyDown;
|
73
|
-
};
|
74
|
-
const DIRECTIONS = {
|
75
|
-
UPWARD: "upward",
|
76
|
-
DOWNWARD: "downward"
|
77
|
-
};
|
78
|
-
const DROP_SENSITIVITY = {
|
79
|
-
REGULAR: "regular",
|
80
|
-
IMMEDIATE: "immediate"
|
81
|
-
};
|
82
|
-
const useDragAndDrop = (active, {
|
83
|
-
type = "STRAPI_DND",
|
84
|
-
index,
|
85
|
-
item,
|
86
|
-
onStart,
|
87
|
-
onEnd,
|
88
|
-
onGrabItem,
|
89
|
-
onDropItem,
|
90
|
-
onCancel,
|
91
|
-
onMoveItem,
|
92
|
-
dropSensitivity = DROP_SENSITIVITY.REGULAR
|
93
|
-
}) => {
|
94
|
-
const objectRef = React.useRef(null);
|
95
|
-
const [{ handlerId, isOver }, dropRef] = useDrop({
|
96
|
-
accept: type,
|
97
|
-
collect(monitor) {
|
98
|
-
return {
|
99
|
-
handlerId: monitor.getHandlerId(),
|
100
|
-
isOver: monitor.isOver({ shallow: true })
|
101
|
-
};
|
102
|
-
},
|
103
|
-
drop(item2) {
|
104
|
-
const draggedIndex = item2.index;
|
105
|
-
const newIndex = index;
|
106
|
-
if (isOver && onDropItem) {
|
107
|
-
onDropItem(draggedIndex, newIndex);
|
108
|
-
}
|
109
|
-
},
|
110
|
-
hover(item2, monitor) {
|
111
|
-
if (!objectRef.current || !onMoveItem) {
|
112
|
-
return;
|
113
|
-
}
|
114
|
-
const dragIndex = item2.index;
|
115
|
-
const newIndex = index;
|
116
|
-
const hoverBoundingRect = objectRef.current?.getBoundingClientRect();
|
117
|
-
const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
118
|
-
const clientOffset = monitor.getClientOffset();
|
119
|
-
if (!clientOffset)
|
120
|
-
return;
|
121
|
-
const hoverClientY = clientOffset && clientOffset.y - hoverBoundingRect.top;
|
122
|
-
if (typeof dragIndex === "number" && typeof newIndex === "number") {
|
123
|
-
if (dragIndex === newIndex) {
|
124
|
-
return;
|
125
|
-
}
|
126
|
-
if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {
|
127
|
-
if (dragIndex < newIndex && hoverClientY < hoverMiddleY) {
|
128
|
-
return;
|
129
|
-
}
|
130
|
-
if (dragIndex > newIndex && hoverClientY > hoverMiddleY) {
|
131
|
-
return;
|
132
|
-
}
|
133
|
-
}
|
134
|
-
onMoveItem(newIndex, dragIndex);
|
135
|
-
item2.index = newIndex;
|
136
|
-
} else {
|
137
|
-
if (Array.isArray(dragIndex) && Array.isArray(newIndex)) {
|
138
|
-
const minLength = Math.min(dragIndex.length, newIndex.length);
|
139
|
-
let areEqual = true;
|
140
|
-
let isLessThan = false;
|
141
|
-
let isGreaterThan = false;
|
142
|
-
for (let i = 0; i < minLength; i++) {
|
143
|
-
if (dragIndex[i] < newIndex[i]) {
|
144
|
-
isLessThan = true;
|
145
|
-
areEqual = false;
|
146
|
-
break;
|
147
|
-
} else if (dragIndex[i] > newIndex[i]) {
|
148
|
-
isGreaterThan = true;
|
149
|
-
areEqual = false;
|
150
|
-
break;
|
151
|
-
}
|
152
|
-
}
|
153
|
-
if (areEqual && dragIndex.length === newIndex.length) {
|
154
|
-
return;
|
155
|
-
}
|
156
|
-
if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {
|
157
|
-
if (isLessThan && !isGreaterThan && hoverClientY < hoverMiddleY) {
|
158
|
-
return;
|
159
|
-
}
|
160
|
-
if (isGreaterThan && !isLessThan && hoverClientY > hoverMiddleY) {
|
161
|
-
return;
|
162
|
-
}
|
163
|
-
}
|
164
|
-
}
|
165
|
-
onMoveItem(newIndex, dragIndex);
|
166
|
-
item2.index = newIndex;
|
167
|
-
}
|
168
|
-
}
|
169
|
-
});
|
170
|
-
const getDragDirection = (monitor) => {
|
171
|
-
if (monitor && monitor.isDragging() && !monitor.didDrop() && monitor.getInitialClientOffset() && monitor.getClientOffset()) {
|
172
|
-
const deltaY = monitor.getInitialClientOffset().y - monitor.getClientOffset().y;
|
173
|
-
if (deltaY > 0)
|
174
|
-
return DIRECTIONS.UPWARD;
|
175
|
-
if (deltaY < 0)
|
176
|
-
return DIRECTIONS.DOWNWARD;
|
177
|
-
return null;
|
178
|
-
}
|
179
|
-
return null;
|
180
|
-
};
|
181
|
-
const [{ isDragging, direction }, dragRef, dragPreviewRef] = useDrag({
|
182
|
-
type,
|
183
|
-
item() {
|
184
|
-
if (onStart) {
|
185
|
-
onStart();
|
186
|
-
}
|
187
|
-
const { width } = objectRef.current?.getBoundingClientRect() ?? {};
|
188
|
-
return { index, width, ...item };
|
189
|
-
},
|
190
|
-
end() {
|
191
|
-
if (onEnd) {
|
192
|
-
onEnd();
|
193
|
-
}
|
194
|
-
},
|
195
|
-
canDrag: active,
|
196
|
-
/**
|
197
|
-
* This is useful when the item is in a virtualized list.
|
198
|
-
* However, if we don't have an ID then we want the libraries
|
199
|
-
* defaults to take care of this.
|
200
|
-
*/
|
201
|
-
isDragging: item?.id ? (monitor) => {
|
202
|
-
return item.id === monitor.getItem().id;
|
203
|
-
} : void 0,
|
204
|
-
collect: (monitor) => ({
|
205
|
-
isDragging: monitor.isDragging(),
|
206
|
-
initialOffset: monitor.getInitialClientOffset(),
|
207
|
-
currentOffset: monitor.getClientOffset(),
|
208
|
-
direction: getDragDirection(monitor)
|
209
|
-
})
|
210
|
-
});
|
211
|
-
const handleKeyDown = useKeyboardDragAndDrop(active, index, {
|
212
|
-
onGrabItem,
|
213
|
-
onDropItem,
|
214
|
-
onCancel,
|
215
|
-
onMoveItem
|
216
|
-
});
|
217
|
-
return [
|
218
|
-
{ handlerId, isDragging, handleKeyDown, isOverDropTarget: isOver, direction },
|
219
|
-
objectRef,
|
220
|
-
dropRef,
|
221
|
-
dragRef,
|
222
|
-
dragPreviewRef
|
223
|
-
];
|
224
|
-
};
|
225
|
-
export {
|
226
|
-
DROP_SENSITIVITY as D,
|
227
|
-
ItemTypes as I,
|
228
|
-
DIRECTIONS as a,
|
229
|
-
useDragAndDrop as u
|
230
|
-
};
|
231
|
-
//# sourceMappingURL=useDragAndDrop-DdHgKsqq.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useDragAndDrop-DdHgKsqq.mjs","sources":["../../admin/src/constants/dragAndDrop.ts","../../admin/src/hooks/useKeyboardDragAndDrop.ts","../../admin/src/hooks/useDragAndDrop.ts"],"sourcesContent":["export const ItemTypes = {\n COMPONENT: 'component',\n EDIT_FIELD: 'editField',\n FIELD: 'field',\n DYNAMIC_ZONE: 'dynamicZone',\n RELATION: 'relation',\n BLOCKS: 'blocks',\n} as const;\n","import * as React from 'react';\n\nexport type UseKeyboardDragAndDropCallbacks<TIndex extends number | Array<number> = number> = {\n onCancel?: (index: TIndex) => void;\n onDropItem?: (currentIndex: TIndex, newIndex?: TIndex) => void;\n onGrabItem?: (index: TIndex) => void;\n onMoveItem?: (newIndex: TIndex, currentIndex: TIndex) => void;\n};\n\n/**\n * Utility hook designed to implement keyboard accessibile drag and drop by\n * returning an onKeyDown handler to be passed to the drag icon button.\n *\n * @internal - You should use `useDragAndDrop` instead.\n */\nexport const useKeyboardDragAndDrop = <TIndex extends number | Array<number> = number>(\n active: boolean,\n index: TIndex,\n { onCancel, onDropItem, onGrabItem, onMoveItem }: UseKeyboardDragAndDropCallbacks<TIndex>\n) => {\n const [isSelected, setIsSelected] = React.useState(false);\n\n const handleMove = (movement: 'UP' | 'DOWN') => {\n if (!isSelected) {\n return;\n }\n if (typeof index === 'number' && onMoveItem) {\n if (movement === 'UP') {\n onMoveItem((index - 1) as TIndex, index);\n } else if (movement === 'DOWN') {\n onMoveItem((index + 1) as TIndex, index);\n }\n }\n };\n\n const handleDragClick = () => {\n if (isSelected) {\n if (onDropItem) {\n onDropItem(index);\n }\n setIsSelected(false);\n } else {\n if (onGrabItem) {\n onGrabItem(index);\n }\n setIsSelected(true);\n }\n };\n\n const handleCancel = () => {\n if (isSelected) {\n setIsSelected(false);\n\n if (onCancel) {\n onCancel(index);\n }\n }\n };\n\n const handleKeyDown = <E extends Element>(e: React.KeyboardEvent<E>) => {\n if (!active) {\n return;\n }\n\n if (e.key === 'Tab' && !isSelected) {\n return;\n }\n\n e.preventDefault();\n\n switch (e.key) {\n case ' ':\n case 'Enter':\n handleDragClick();\n break;\n\n case 'Escape':\n handleCancel();\n break;\n\n case 'ArrowDown':\n case 'ArrowRight':\n handleMove('DOWN');\n break;\n\n case 'ArrowUp':\n case 'ArrowLeft':\n handleMove('UP');\n break;\n\n default:\n }\n };\n\n return handleKeyDown;\n};\n","import * as React from 'react';\n\nimport {\n useDrag,\n useDrop,\n type HandlerManager,\n type ConnectDragSource,\n type ConnectDropTarget,\n type ConnectDragPreview,\n type DragSourceMonitor,\n} from 'react-dnd';\n\nimport {\n useKeyboardDragAndDrop,\n type UseKeyboardDragAndDropCallbacks,\n} from './useKeyboardDragAndDrop';\n\nimport type { Data } from '@strapi/types';\n\nconst DIRECTIONS = {\n UPWARD: 'upward',\n DOWNWARD: 'downward',\n} as const;\n\nconst DROP_SENSITIVITY = {\n REGULAR: 'regular',\n IMMEDIATE: 'immediate',\n} as const;\n\ninterface UseDragAndDropOptions<\n TIndex extends number | Array<number> = number,\n TItem extends { index: TIndex } = { index: TIndex },\n> extends UseKeyboardDragAndDropCallbacks<TIndex> {\n type?: string;\n index: TIndex;\n item?: TItem;\n onStart?: () => void;\n onEnd?: () => void;\n dropSensitivity?: (typeof DROP_SENSITIVITY)[keyof typeof DROP_SENSITIVITY];\n}\n\ntype Identifier = ReturnType<HandlerManager['getHandlerId']>;\n\ntype UseDragAndDropReturn<E extends Element = HTMLElement> = [\n props: {\n handlerId: Identifier;\n isDragging: boolean;\n handleKeyDown: <E extends Element>(event: React.KeyboardEvent<E>) => void;\n isOverDropTarget: boolean;\n direction: (typeof DIRECTIONS)[keyof typeof DIRECTIONS] | null;\n },\n objectRef: React.RefObject<E>,\n dropRef: ConnectDropTarget,\n dragRef: ConnectDragSource,\n dragPreviewRef: ConnectDragPreview,\n];\n\ntype DropCollectedProps = {\n handlerId: Identifier;\n isOver: boolean;\n};\n\n/**\n * A utility hook abstracting the general drag and drop hooks from react-dnd.\n * Centralising the same behaviours and by default offering keyboard support.\n */\nconst useDragAndDrop = <\n TIndex extends number | Array<number>,\n TItem extends { index: TIndex; id?: Data.ID; [key: string]: unknown } = {\n index: TIndex;\n [key: string]: unknown;\n },\n E extends Element = HTMLElement,\n>(\n active: boolean,\n {\n type = 'STRAPI_DND',\n index,\n item,\n onStart,\n onEnd,\n onGrabItem,\n onDropItem,\n onCancel,\n onMoveItem,\n dropSensitivity = DROP_SENSITIVITY.REGULAR,\n }: UseDragAndDropOptions<TIndex, TItem>\n): UseDragAndDropReturn<E> => {\n const objectRef = React.useRef<E>(null);\n\n const [{ handlerId, isOver }, dropRef] = useDrop<TItem, void, DropCollectedProps>({\n accept: type,\n collect(monitor) {\n return {\n handlerId: monitor.getHandlerId(),\n isOver: monitor.isOver({ shallow: true }),\n };\n },\n drop(item) {\n const draggedIndex = item.index;\n const newIndex = index;\n\n if (isOver && onDropItem) {\n onDropItem(draggedIndex, newIndex);\n }\n },\n hover(item, monitor) {\n if (!objectRef.current || !onMoveItem) {\n return;\n }\n\n const dragIndex = item.index;\n const newIndex = index;\n\n const hoverBoundingRect = objectRef.current?.getBoundingClientRect();\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n const clientOffset = monitor.getClientOffset();\n if (!clientOffset) return;\n\n const hoverClientY = clientOffset && clientOffset.y - hoverBoundingRect.top;\n if (typeof dragIndex === 'number' && typeof newIndex === 'number') {\n if (dragIndex === newIndex) {\n // Don't replace items with themselves\n return;\n }\n\n if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {\n // Dragging downwards\n if (dragIndex < newIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // Dragging upwards\n if (dragIndex > newIndex && hoverClientY > hoverMiddleY) {\n return;\n }\n }\n\n // Time to actually perform the action\n onMoveItem(newIndex, dragIndex);\n item.index = newIndex;\n } else {\n // Using numbers as indices doesn't work for nested list items with path like [1, 1, 0]\n if (Array.isArray(dragIndex) && Array.isArray(newIndex)) {\n // Indices comparison to find item position in nested list\n const minLength = Math.min(dragIndex.length, newIndex.length);\n let areEqual = true;\n let isLessThan = false;\n let isGreaterThan = false;\n\n for (let i = 0; i < minLength; i++) {\n if (dragIndex[i] < newIndex[i]) {\n isLessThan = true;\n areEqual = false;\n break;\n } else if (dragIndex[i] > newIndex[i]) {\n isGreaterThan = true;\n areEqual = false;\n break;\n }\n }\n\n // Don't replace items with themselves\n if (areEqual && dragIndex.length === newIndex.length) {\n return;\n }\n\n if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {\n // Dragging downwards\n if (isLessThan && !isGreaterThan && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // Dragging upwards\n if (isGreaterThan && !isLessThan && hoverClientY > hoverMiddleY) {\n return;\n }\n }\n }\n\n onMoveItem(newIndex, dragIndex);\n item.index = newIndex;\n }\n },\n });\n\n const getDragDirection = (monitor: DragSourceMonitor<TItem, void>) => {\n if (\n monitor &&\n monitor.isDragging() &&\n !monitor.didDrop() &&\n monitor.getInitialClientOffset() &&\n monitor.getClientOffset()\n ) {\n const deltaY = monitor.getInitialClientOffset()!.y - monitor.getClientOffset()!.y;\n\n if (deltaY > 0) return DIRECTIONS.UPWARD;\n\n if (deltaY < 0) return DIRECTIONS.DOWNWARD;\n\n return null;\n }\n\n return null;\n };\n\n const [{ isDragging, direction }, dragRef, dragPreviewRef] = useDrag({\n type,\n item() {\n if (onStart) {\n onStart();\n }\n\n /**\n * This will be attached and it helps define the preview sizes\n * when a component is flexy e.g. Relations\n */\n const { width } = objectRef.current?.getBoundingClientRect() ?? {};\n\n return { index, width, ...item };\n },\n end() {\n if (onEnd) {\n onEnd();\n }\n },\n canDrag: active,\n /**\n * This is useful when the item is in a virtualized list.\n * However, if we don't have an ID then we want the libraries\n * defaults to take care of this.\n */\n isDragging: item?.id\n ? (monitor) => {\n return item.id === monitor.getItem().id;\n }\n : undefined,\n collect: (monitor) => ({\n isDragging: monitor.isDragging(),\n initialOffset: monitor.getInitialClientOffset(),\n currentOffset: monitor.getClientOffset(),\n direction: getDragDirection(monitor),\n }),\n });\n\n const handleKeyDown = useKeyboardDragAndDrop(active, index, {\n onGrabItem,\n onDropItem,\n onCancel,\n onMoveItem,\n });\n\n return [\n { handlerId, isDragging, handleKeyDown, isOverDropTarget: isOver, direction },\n objectRef,\n dropRef,\n dragRef,\n dragPreviewRef,\n ];\n};\n\nexport {\n useDragAndDrop,\n UseDragAndDropReturn,\n UseDragAndDropOptions,\n DIRECTIONS,\n DROP_SENSITIVITY,\n};\n"],"names":["item"],"mappings":";;AAAO,MAAM,YAAY;AAAA,EACvB,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,cAAc;AAAA,EACd,UAAU;AAAA,EACV,QAAQ;AACV;ACQa,MAAA,yBAAyB,CACpC,QACA,OACA,EAAE,UAAU,YAAY,YAAY,iBACjC;AACH,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAS,KAAK;AAElD,QAAA,aAAa,CAAC,aAA4B;AAC9C,QAAI,CAAC,YAAY;AACf;AAAA,IACF;AACI,QAAA,OAAO,UAAU,YAAY,YAAY;AAC3C,UAAI,aAAa,MAAM;AACT,mBAAA,QAAQ,GAAc,KAAK;AAAA,MAAA,WAC9B,aAAa,QAAQ;AAClB,mBAAA,QAAQ,GAAc,KAAK;AAAA,MACzC;AAAA,IACF;AAAA,EAAA;AAGF,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MACvC,WAAW,iBAAiB,OAAO;AAAA,IAAA;AAAA,EACrC,CACD;AAEK,QAAA,gBAAgB,uBAAuB,QAAQ,OAAO;AAAA,IAC1D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAEM,SAAA;AAAA,IACL,EAAE,WAAW,YAAY,eAAe,kBAAkB,QAAQ,UAAU;AAAA,IAC5E;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
@@ -1,249 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
const React = require("react");
|
3
|
-
const reactDnd = require("react-dnd");
|
4
|
-
function _interopNamespace(e) {
|
5
|
-
if (e && e.__esModule)
|
6
|
-
return e;
|
7
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
8
|
-
if (e) {
|
9
|
-
for (const k in e) {
|
10
|
-
if (k !== "default") {
|
11
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
13
|
-
enumerable: true,
|
14
|
-
get: () => e[k]
|
15
|
-
});
|
16
|
-
}
|
17
|
-
}
|
18
|
-
}
|
19
|
-
n.default = e;
|
20
|
-
return Object.freeze(n);
|
21
|
-
}
|
22
|
-
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
23
|
-
const ItemTypes = {
|
24
|
-
COMPONENT: "component",
|
25
|
-
EDIT_FIELD: "editField",
|
26
|
-
FIELD: "field",
|
27
|
-
DYNAMIC_ZONE: "dynamicZone",
|
28
|
-
RELATION: "relation",
|
29
|
-
BLOCKS: "blocks"
|
30
|
-
};
|
31
|
-
const useKeyboardDragAndDrop = (active, index, { onCancel, onDropItem, onGrabItem, onMoveItem }) => {
|
32
|
-
const [isSelected, setIsSelected] = React__namespace.useState(false);
|
33
|
-
const handleMove = (movement) => {
|
34
|
-
if (!isSelected) {
|
35
|
-
return;
|
36
|
-
}
|
37
|
-
if (typeof index === "number" && onMoveItem) {
|
38
|
-
if (movement === "UP") {
|
39
|
-
onMoveItem(index - 1, index);
|
40
|
-
} else if (movement === "DOWN") {
|
41
|
-
onMoveItem(index + 1, index);
|
42
|
-
}
|
43
|
-
}
|
44
|
-
};
|
45
|
-
const handleDragClick = () => {
|
46
|
-
if (isSelected) {
|
47
|
-
if (onDropItem) {
|
48
|
-
onDropItem(index);
|
49
|
-
}
|
50
|
-
setIsSelected(false);
|
51
|
-
} else {
|
52
|
-
if (onGrabItem) {
|
53
|
-
onGrabItem(index);
|
54
|
-
}
|
55
|
-
setIsSelected(true);
|
56
|
-
}
|
57
|
-
};
|
58
|
-
const handleCancel = () => {
|
59
|
-
if (isSelected) {
|
60
|
-
setIsSelected(false);
|
61
|
-
if (onCancel) {
|
62
|
-
onCancel(index);
|
63
|
-
}
|
64
|
-
}
|
65
|
-
};
|
66
|
-
const handleKeyDown = (e) => {
|
67
|
-
if (!active) {
|
68
|
-
return;
|
69
|
-
}
|
70
|
-
if (e.key === "Tab" && !isSelected) {
|
71
|
-
return;
|
72
|
-
}
|
73
|
-
e.preventDefault();
|
74
|
-
switch (e.key) {
|
75
|
-
case " ":
|
76
|
-
case "Enter":
|
77
|
-
handleDragClick();
|
78
|
-
break;
|
79
|
-
case "Escape":
|
80
|
-
handleCancel();
|
81
|
-
break;
|
82
|
-
case "ArrowDown":
|
83
|
-
case "ArrowRight":
|
84
|
-
handleMove("DOWN");
|
85
|
-
break;
|
86
|
-
case "ArrowUp":
|
87
|
-
case "ArrowLeft":
|
88
|
-
handleMove("UP");
|
89
|
-
break;
|
90
|
-
}
|
91
|
-
};
|
92
|
-
return handleKeyDown;
|
93
|
-
};
|
94
|
-
const DIRECTIONS = {
|
95
|
-
UPWARD: "upward",
|
96
|
-
DOWNWARD: "downward"
|
97
|
-
};
|
98
|
-
const DROP_SENSITIVITY = {
|
99
|
-
REGULAR: "regular",
|
100
|
-
IMMEDIATE: "immediate"
|
101
|
-
};
|
102
|
-
const useDragAndDrop = (active, {
|
103
|
-
type = "STRAPI_DND",
|
104
|
-
index,
|
105
|
-
item,
|
106
|
-
onStart,
|
107
|
-
onEnd,
|
108
|
-
onGrabItem,
|
109
|
-
onDropItem,
|
110
|
-
onCancel,
|
111
|
-
onMoveItem,
|
112
|
-
dropSensitivity = DROP_SENSITIVITY.REGULAR
|
113
|
-
}) => {
|
114
|
-
const objectRef = React__namespace.useRef(null);
|
115
|
-
const [{ handlerId, isOver }, dropRef] = reactDnd.useDrop({
|
116
|
-
accept: type,
|
117
|
-
collect(monitor) {
|
118
|
-
return {
|
119
|
-
handlerId: monitor.getHandlerId(),
|
120
|
-
isOver: monitor.isOver({ shallow: true })
|
121
|
-
};
|
122
|
-
},
|
123
|
-
drop(item2) {
|
124
|
-
const draggedIndex = item2.index;
|
125
|
-
const newIndex = index;
|
126
|
-
if (isOver && onDropItem) {
|
127
|
-
onDropItem(draggedIndex, newIndex);
|
128
|
-
}
|
129
|
-
},
|
130
|
-
hover(item2, monitor) {
|
131
|
-
if (!objectRef.current || !onMoveItem) {
|
132
|
-
return;
|
133
|
-
}
|
134
|
-
const dragIndex = item2.index;
|
135
|
-
const newIndex = index;
|
136
|
-
const hoverBoundingRect = objectRef.current?.getBoundingClientRect();
|
137
|
-
const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
138
|
-
const clientOffset = monitor.getClientOffset();
|
139
|
-
if (!clientOffset)
|
140
|
-
return;
|
141
|
-
const hoverClientY = clientOffset && clientOffset.y - hoverBoundingRect.top;
|
142
|
-
if (typeof dragIndex === "number" && typeof newIndex === "number") {
|
143
|
-
if (dragIndex === newIndex) {
|
144
|
-
return;
|
145
|
-
}
|
146
|
-
if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {
|
147
|
-
if (dragIndex < newIndex && hoverClientY < hoverMiddleY) {
|
148
|
-
return;
|
149
|
-
}
|
150
|
-
if (dragIndex > newIndex && hoverClientY > hoverMiddleY) {
|
151
|
-
return;
|
152
|
-
}
|
153
|
-
}
|
154
|
-
onMoveItem(newIndex, dragIndex);
|
155
|
-
item2.index = newIndex;
|
156
|
-
} else {
|
157
|
-
if (Array.isArray(dragIndex) && Array.isArray(newIndex)) {
|
158
|
-
const minLength = Math.min(dragIndex.length, newIndex.length);
|
159
|
-
let areEqual = true;
|
160
|
-
let isLessThan = false;
|
161
|
-
let isGreaterThan = false;
|
162
|
-
for (let i = 0; i < minLength; i++) {
|
163
|
-
if (dragIndex[i] < newIndex[i]) {
|
164
|
-
isLessThan = true;
|
165
|
-
areEqual = false;
|
166
|
-
break;
|
167
|
-
} else if (dragIndex[i] > newIndex[i]) {
|
168
|
-
isGreaterThan = true;
|
169
|
-
areEqual = false;
|
170
|
-
break;
|
171
|
-
}
|
172
|
-
}
|
173
|
-
if (areEqual && dragIndex.length === newIndex.length) {
|
174
|
-
return;
|
175
|
-
}
|
176
|
-
if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {
|
177
|
-
if (isLessThan && !isGreaterThan && hoverClientY < hoverMiddleY) {
|
178
|
-
return;
|
179
|
-
}
|
180
|
-
if (isGreaterThan && !isLessThan && hoverClientY > hoverMiddleY) {
|
181
|
-
return;
|
182
|
-
}
|
183
|
-
}
|
184
|
-
}
|
185
|
-
onMoveItem(newIndex, dragIndex);
|
186
|
-
item2.index = newIndex;
|
187
|
-
}
|
188
|
-
}
|
189
|
-
});
|
190
|
-
const getDragDirection = (monitor) => {
|
191
|
-
if (monitor && monitor.isDragging() && !monitor.didDrop() && monitor.getInitialClientOffset() && monitor.getClientOffset()) {
|
192
|
-
const deltaY = monitor.getInitialClientOffset().y - monitor.getClientOffset().y;
|
193
|
-
if (deltaY > 0)
|
194
|
-
return DIRECTIONS.UPWARD;
|
195
|
-
if (deltaY < 0)
|
196
|
-
return DIRECTIONS.DOWNWARD;
|
197
|
-
return null;
|
198
|
-
}
|
199
|
-
return null;
|
200
|
-
};
|
201
|
-
const [{ isDragging, direction }, dragRef, dragPreviewRef] = reactDnd.useDrag({
|
202
|
-
type,
|
203
|
-
item() {
|
204
|
-
if (onStart) {
|
205
|
-
onStart();
|
206
|
-
}
|
207
|
-
const { width } = objectRef.current?.getBoundingClientRect() ?? {};
|
208
|
-
return { index, width, ...item };
|
209
|
-
},
|
210
|
-
end() {
|
211
|
-
if (onEnd) {
|
212
|
-
onEnd();
|
213
|
-
}
|
214
|
-
},
|
215
|
-
canDrag: active,
|
216
|
-
/**
|
217
|
-
* This is useful when the item is in a virtualized list.
|
218
|
-
* However, if we don't have an ID then we want the libraries
|
219
|
-
* defaults to take care of this.
|
220
|
-
*/
|
221
|
-
isDragging: item?.id ? (monitor) => {
|
222
|
-
return item.id === monitor.getItem().id;
|
223
|
-
} : void 0,
|
224
|
-
collect: (monitor) => ({
|
225
|
-
isDragging: monitor.isDragging(),
|
226
|
-
initialOffset: monitor.getInitialClientOffset(),
|
227
|
-
currentOffset: monitor.getClientOffset(),
|
228
|
-
direction: getDragDirection(monitor)
|
229
|
-
})
|
230
|
-
});
|
231
|
-
const handleKeyDown = useKeyboardDragAndDrop(active, index, {
|
232
|
-
onGrabItem,
|
233
|
-
onDropItem,
|
234
|
-
onCancel,
|
235
|
-
onMoveItem
|
236
|
-
});
|
237
|
-
return [
|
238
|
-
{ handlerId, isDragging, handleKeyDown, isOverDropTarget: isOver, direction },
|
239
|
-
objectRef,
|
240
|
-
dropRef,
|
241
|
-
dragRef,
|
242
|
-
dragPreviewRef
|
243
|
-
];
|
244
|
-
};
|
245
|
-
exports.DIRECTIONS = DIRECTIONS;
|
246
|
-
exports.DROP_SENSITIVITY = DROP_SENSITIVITY;
|
247
|
-
exports.ItemTypes = ItemTypes;
|
248
|
-
exports.useDragAndDrop = useDragAndDrop;
|
249
|
-
//# sourceMappingURL=useDragAndDrop-J0TUUbR6.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useDragAndDrop-J0TUUbR6.js","sources":["../../admin/src/constants/dragAndDrop.ts","../../admin/src/hooks/useKeyboardDragAndDrop.ts","../../admin/src/hooks/useDragAndDrop.ts"],"sourcesContent":["export const ItemTypes = {\n COMPONENT: 'component',\n EDIT_FIELD: 'editField',\n FIELD: 'field',\n DYNAMIC_ZONE: 'dynamicZone',\n RELATION: 'relation',\n BLOCKS: 'blocks',\n} as const;\n","import * as React from 'react';\n\nexport type UseKeyboardDragAndDropCallbacks<TIndex extends number | Array<number> = number> = {\n onCancel?: (index: TIndex) => void;\n onDropItem?: (currentIndex: TIndex, newIndex?: TIndex) => void;\n onGrabItem?: (index: TIndex) => void;\n onMoveItem?: (newIndex: TIndex, currentIndex: TIndex) => void;\n};\n\n/**\n * Utility hook designed to implement keyboard accessibile drag and drop by\n * returning an onKeyDown handler to be passed to the drag icon button.\n *\n * @internal - You should use `useDragAndDrop` instead.\n */\nexport const useKeyboardDragAndDrop = <TIndex extends number | Array<number> = number>(\n active: boolean,\n index: TIndex,\n { onCancel, onDropItem, onGrabItem, onMoveItem }: UseKeyboardDragAndDropCallbacks<TIndex>\n) => {\n const [isSelected, setIsSelected] = React.useState(false);\n\n const handleMove = (movement: 'UP' | 'DOWN') => {\n if (!isSelected) {\n return;\n }\n if (typeof index === 'number' && onMoveItem) {\n if (movement === 'UP') {\n onMoveItem((index - 1) as TIndex, index);\n } else if (movement === 'DOWN') {\n onMoveItem((index + 1) as TIndex, index);\n }\n }\n };\n\n const handleDragClick = () => {\n if (isSelected) {\n if (onDropItem) {\n onDropItem(index);\n }\n setIsSelected(false);\n } else {\n if (onGrabItem) {\n onGrabItem(index);\n }\n setIsSelected(true);\n }\n };\n\n const handleCancel = () => {\n if (isSelected) {\n setIsSelected(false);\n\n if (onCancel) {\n onCancel(index);\n }\n }\n };\n\n const handleKeyDown = <E extends Element>(e: React.KeyboardEvent<E>) => {\n if (!active) {\n return;\n }\n\n if (e.key === 'Tab' && !isSelected) {\n return;\n }\n\n e.preventDefault();\n\n switch (e.key) {\n case ' ':\n case 'Enter':\n handleDragClick();\n break;\n\n case 'Escape':\n handleCancel();\n break;\n\n case 'ArrowDown':\n case 'ArrowRight':\n handleMove('DOWN');\n break;\n\n case 'ArrowUp':\n case 'ArrowLeft':\n handleMove('UP');\n break;\n\n default:\n }\n };\n\n return handleKeyDown;\n};\n","import * as React from 'react';\n\nimport {\n useDrag,\n useDrop,\n type HandlerManager,\n type ConnectDragSource,\n type ConnectDropTarget,\n type ConnectDragPreview,\n type DragSourceMonitor,\n} from 'react-dnd';\n\nimport {\n useKeyboardDragAndDrop,\n type UseKeyboardDragAndDropCallbacks,\n} from './useKeyboardDragAndDrop';\n\nimport type { Data } from '@strapi/types';\n\nconst DIRECTIONS = {\n UPWARD: 'upward',\n DOWNWARD: 'downward',\n} as const;\n\nconst DROP_SENSITIVITY = {\n REGULAR: 'regular',\n IMMEDIATE: 'immediate',\n} as const;\n\ninterface UseDragAndDropOptions<\n TIndex extends number | Array<number> = number,\n TItem extends { index: TIndex } = { index: TIndex },\n> extends UseKeyboardDragAndDropCallbacks<TIndex> {\n type?: string;\n index: TIndex;\n item?: TItem;\n onStart?: () => void;\n onEnd?: () => void;\n dropSensitivity?: (typeof DROP_SENSITIVITY)[keyof typeof DROP_SENSITIVITY];\n}\n\ntype Identifier = ReturnType<HandlerManager['getHandlerId']>;\n\ntype UseDragAndDropReturn<E extends Element = HTMLElement> = [\n props: {\n handlerId: Identifier;\n isDragging: boolean;\n handleKeyDown: <E extends Element>(event: React.KeyboardEvent<E>) => void;\n isOverDropTarget: boolean;\n direction: (typeof DIRECTIONS)[keyof typeof DIRECTIONS] | null;\n },\n objectRef: React.RefObject<E>,\n dropRef: ConnectDropTarget,\n dragRef: ConnectDragSource,\n dragPreviewRef: ConnectDragPreview,\n];\n\ntype DropCollectedProps = {\n handlerId: Identifier;\n isOver: boolean;\n};\n\n/**\n * A utility hook abstracting the general drag and drop hooks from react-dnd.\n * Centralising the same behaviours and by default offering keyboard support.\n */\nconst useDragAndDrop = <\n TIndex extends number | Array<number>,\n TItem extends { index: TIndex; id?: Data.ID; [key: string]: unknown } = {\n index: TIndex;\n [key: string]: unknown;\n },\n E extends Element = HTMLElement,\n>(\n active: boolean,\n {\n type = 'STRAPI_DND',\n index,\n item,\n onStart,\n onEnd,\n onGrabItem,\n onDropItem,\n onCancel,\n onMoveItem,\n dropSensitivity = DROP_SENSITIVITY.REGULAR,\n }: UseDragAndDropOptions<TIndex, TItem>\n): UseDragAndDropReturn<E> => {\n const objectRef = React.useRef<E>(null);\n\n const [{ handlerId, isOver }, dropRef] = useDrop<TItem, void, DropCollectedProps>({\n accept: type,\n collect(monitor) {\n return {\n handlerId: monitor.getHandlerId(),\n isOver: monitor.isOver({ shallow: true }),\n };\n },\n drop(item) {\n const draggedIndex = item.index;\n const newIndex = index;\n\n if (isOver && onDropItem) {\n onDropItem(draggedIndex, newIndex);\n }\n },\n hover(item, monitor) {\n if (!objectRef.current || !onMoveItem) {\n return;\n }\n\n const dragIndex = item.index;\n const newIndex = index;\n\n const hoverBoundingRect = objectRef.current?.getBoundingClientRect();\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n const clientOffset = monitor.getClientOffset();\n if (!clientOffset) return;\n\n const hoverClientY = clientOffset && clientOffset.y - hoverBoundingRect.top;\n if (typeof dragIndex === 'number' && typeof newIndex === 'number') {\n if (dragIndex === newIndex) {\n // Don't replace items with themselves\n return;\n }\n\n if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {\n // Dragging downwards\n if (dragIndex < newIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // Dragging upwards\n if (dragIndex > newIndex && hoverClientY > hoverMiddleY) {\n return;\n }\n }\n\n // Time to actually perform the action\n onMoveItem(newIndex, dragIndex);\n item.index = newIndex;\n } else {\n // Using numbers as indices doesn't work for nested list items with path like [1, 1, 0]\n if (Array.isArray(dragIndex) && Array.isArray(newIndex)) {\n // Indices comparison to find item position in nested list\n const minLength = Math.min(dragIndex.length, newIndex.length);\n let areEqual = true;\n let isLessThan = false;\n let isGreaterThan = false;\n\n for (let i = 0; i < minLength; i++) {\n if (dragIndex[i] < newIndex[i]) {\n isLessThan = true;\n areEqual = false;\n break;\n } else if (dragIndex[i] > newIndex[i]) {\n isGreaterThan = true;\n areEqual = false;\n break;\n }\n }\n\n // Don't replace items with themselves\n if (areEqual && dragIndex.length === newIndex.length) {\n return;\n }\n\n if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {\n // Dragging downwards\n if (isLessThan && !isGreaterThan && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // Dragging upwards\n if (isGreaterThan && !isLessThan && hoverClientY > hoverMiddleY) {\n return;\n }\n }\n }\n\n onMoveItem(newIndex, dragIndex);\n item.index = newIndex;\n }\n },\n });\n\n const getDragDirection = (monitor: DragSourceMonitor<TItem, void>) => {\n if (\n monitor &&\n monitor.isDragging() &&\n !monitor.didDrop() &&\n monitor.getInitialClientOffset() &&\n monitor.getClientOffset()\n ) {\n const deltaY = monitor.getInitialClientOffset()!.y - monitor.getClientOffset()!.y;\n\n if (deltaY > 0) return DIRECTIONS.UPWARD;\n\n if (deltaY < 0) return DIRECTIONS.DOWNWARD;\n\n return null;\n }\n\n return null;\n };\n\n const [{ isDragging, direction }, dragRef, dragPreviewRef] = useDrag({\n type,\n item() {\n if (onStart) {\n onStart();\n }\n\n /**\n * This will be attached and it helps define the preview sizes\n * when a component is flexy e.g. Relations\n */\n const { width } = objectRef.current?.getBoundingClientRect() ?? {};\n\n return { index, width, ...item };\n },\n end() {\n if (onEnd) {\n onEnd();\n }\n },\n canDrag: active,\n /**\n * This is useful when the item is in a virtualized list.\n * However, if we don't have an ID then we want the libraries\n * defaults to take care of this.\n */\n isDragging: item?.id\n ? (monitor) => {\n return item.id === monitor.getItem().id;\n }\n : undefined,\n collect: (monitor) => ({\n isDragging: monitor.isDragging(),\n initialOffset: monitor.getInitialClientOffset(),\n currentOffset: monitor.getClientOffset(),\n direction: getDragDirection(monitor),\n }),\n });\n\n const handleKeyDown = useKeyboardDragAndDrop(active, index, {\n onGrabItem,\n onDropItem,\n onCancel,\n onMoveItem,\n });\n\n return [\n { handlerId, isDragging, handleKeyDown, isOverDropTarget: isOver, direction },\n objectRef,\n dropRef,\n dragRef,\n dragPreviewRef,\n ];\n};\n\nexport {\n useDragAndDrop,\n UseDragAndDropReturn,\n UseDragAndDropOptions,\n DIRECTIONS,\n DROP_SENSITIVITY,\n};\n"],"names":["React","useDrop","item","useDrag"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,YAAY;AAAA,EACvB,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,cAAc;AAAA,EACd,UAAU;AAAA,EACV,QAAQ;AACV;ACQa,MAAA,yBAAyB,CACpC,QACA,OACA,EAAE,UAAU,YAAY,YAAY,iBACjC;AACH,QAAM,CAAC,YAAY,aAAa,IAAIA,iBAAM,SAAS,KAAK;AAElD,QAAA,aAAa,CAAC,aAA4B;AAC9C,QAAI,CAAC,YAAY;AACf;AAAA,IACF;AACI,QAAA,OAAO,UAAU,YAAY,YAAY;AAC3C,UAAI,aAAa,MAAM;AACT,mBAAA,QAAQ,GAAc,KAAK;AAAA,MAAA,WAC9B,aAAa,QAAQ;AAClB,mBAAA,QAAQ,GAAc,KAAK;AAAA,MACzC;AAAA,IACF;AAAA,EAAA;AAGF,QAAM,kBAAkB,MAAM;AAC5B,QAAI,YAAY;AACd,UAAI,YAAY;AACd,mBAAW,KAAK;AAAA,MAClB;AACA,oBAAc,KAAK;AAAA,IAAA,OACd;AACL,UAAI,YAAY;AACd,mBAAW,KAAK;AAAA,MAClB;AACA,oBAAc,IAAI;AAAA,IACpB;AAAA,EAAA;AAGF,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY;AACd,oBAAc,KAAK;AAEnB,UAAI,UAAU;AACZ,iBAAS,KAAK;AAAA,MAChB;AAAA,IACF;AAAA,EAAA;AAGI,QAAA,gBAAgB,CAAoB,MAA8B;AACtE,QAAI,CAAC,QAAQ;AACX;AAAA,IACF;AAEA,QAAI,EAAE,QAAQ,SAAS,CAAC,Y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QAAQ,uBAAA,KACR,QAAQ,mBACR;AACA,YAAM,SAAS,QAAQ,yBAA0B,IAAI,QAAQ,gBAAmB,EAAA;AAEhF,UAAI,SAAS;AAAG,eAAO,WAAW;AAElC,UAAI,SAAS;AAAG,eAAO,WAAW;AAE3B,aAAA;AAAA,IACT;AAEO,WAAA;AAAA,EAAA;AAGH,QAAA,CAAC,EAAE,YAAY,UAAA,GAAa,SAAS,cAAc,IAAIC,iBAAQ;AAAA,IACnE;AAAA,IACA,OAAO;AACL,UAAI,SAAS;AACH;MACV;AAMA,YAAM,EAAE,MAAM,IAAI,UAAU,SAAS,2BAA2B;AAEhE,aAAO,EAAE,OAAO,OAAO,GAAG,KAAK;AAAA,IACjC;AAAA,IACA,MAAM;AACJ,UAAI,OAAO;AACH;MACR;AAAA,IACF;AAAA,IACA,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMT,YAAY,MAAM,KACd,CAAC,YAAY;AACX,aAAO,KAAK,OAAO,QAAQ,QAAA,EAAU;AAAA,IAEvC,IAAA;AAAA,IACJ,SAAS,CAAC,aAAa;AAAA,MACrB,YAAY,QAAQ,WAAW;AAAA,MAC/B,eAAe,QAAQ,uBAAuB;AAAA,MAC9C,eAAe,QAAQ,gBAAgB;AAAA,MACvC,WAAW,iBAAiB,OAAO;AAAA,IAAA;AAAA,EACrC,CACD;AAEK,QAAA,gBAAgB,uBAAuB,QAAQ,OAAO;AAAA,IAC1D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAEM,SAAA;AAAA,IACL,EAAE,WAAW,YAAY,eAAe,kBAAkB,QAAQ,UAAU;AAAA,IAC5E;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;;;;;"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
const React = require("react");
|
3
|
-
const prefixFileUrlWithBackendUrl = (fileURL) => {
|
4
|
-
return !!fileURL && fileURL.startsWith("/") ? `${window.strapi.backendURL}${fileURL}` : fileURL;
|
5
|
-
};
|
6
|
-
const usePrev = (value) => {
|
7
|
-
const ref = React.useRef();
|
8
|
-
React.useEffect(() => {
|
9
|
-
ref.current = value;
|
10
|
-
}, [value]);
|
11
|
-
return ref.current;
|
12
|
-
};
|
13
|
-
exports.prefixFileUrlWithBackendUrl = prefixFileUrlWithBackendUrl;
|
14
|
-
exports.usePrev = usePrev;
|
15
|
-
//# sourceMappingURL=usePrev-B9w_-eYc.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"usePrev-B9w_-eYc.js","sources":["../../admin/src/utils/urls.ts","../../admin/src/hooks/usePrev.ts"],"sourcesContent":["const prefixFileUrlWithBackendUrl = (fileURL?: string): string | undefined => {\n return !!fileURL && fileURL.startsWith('/') ? `${window.strapi.backendURL}${fileURL}` : fileURL;\n};\n\nexport { prefixFileUrlWithBackendUrl };\n","import { useEffect, useRef } from 'react';\n\nexport const usePrev = <T>(value: T): T | undefined => {\n const ref = useRef<T>();\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref.current;\n};\n"],"names":["useRef","useEffect"],"mappings":";;AAAM,MAAA,8BAA8B,CAAC,YAAyC;AAC5E,SAAO,CAAC,CAAC,WAAW,QAAQ,WAAW,GAAG,IAAI,GAAG,OAAO,OAAO,UAAU,GAAG,OAAO,KAAK;AAC1F;ACAa,MAAA,UAAU,CAAI,UAA4B;AACrD,QAAM,MAAMA,MAAAA;AAEZC,QAAAA,UAAU,MAAM;AACd,QAAI,UAAU;AAAA,EAAA,GACb,CAAC,KAAK,CAAC;AAEV,SAAO,IAAI;AACb;;;"}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import { useRef, useEffect } from "react";
|
2
|
-
const prefixFileUrlWithBackendUrl = (fileURL) => {
|
3
|
-
return !!fileURL && fileURL.startsWith("/") ? `${window.strapi.backendURL}${fileURL}` : fileURL;
|
4
|
-
};
|
5
|
-
const usePrev = (value) => {
|
6
|
-
const ref = useRef();
|
7
|
-
useEffect(() => {
|
8
|
-
ref.current = value;
|
9
|
-
}, [value]);
|
10
|
-
return ref.current;
|
11
|
-
};
|
12
|
-
export {
|
13
|
-
prefixFileUrlWithBackendUrl as p,
|
14
|
-
usePrev as u
|
15
|
-
};
|
16
|
-
//# sourceMappingURL=usePrev-DH6iah0A.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"usePrev-DH6iah0A.mjs","sources":["../../admin/src/utils/urls.ts","../../admin/src/hooks/usePrev.ts"],"sourcesContent":["const prefixFileUrlWithBackendUrl = (fileURL?: string): string | undefined => {\n return !!fileURL && fileURL.startsWith('/') ? `${window.strapi.backendURL}${fileURL}` : fileURL;\n};\n\nexport { prefixFileUrlWithBackendUrl };\n","import { useEffect, useRef } from 'react';\n\nexport const usePrev = <T>(value: T): T | undefined => {\n const ref = useRef<T>();\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref.current;\n};\n"],"names":[],"mappings":";AAAM,MAAA,8BAA8B,CAAC,YAAyC;AAC5E,SAAO,CAAC,CAAC,WAAW,QAAQ,WAAW,GAAG,IAAI,GAAG,OAAO,OAAO,UAAU,GAAG,OAAO,KAAK;AAC1F;ACAa,MAAA,UAAU,CAAI,UAA4B;AACrD,QAAM,MAAM;AAEZ,YAAU,MAAM;AACd,QAAI,UAAU;AAAA,EAAA,GACb,CAAC,KAAK,CAAC;AAEV,SAAO,IAAI;AACb;"}
|