@strapi/content-manager 0.0.0-experimental.edc24aaa3bb5a90fa5fd4fee208167dd4e2e38d4 → 0.0.0-experimental.ee7402bacc4656d268ab76aa9c334a7b7a951201
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/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -1
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-5ukroXAh.js → ComponentConfigurationPage-BlzvDpbX.js} +5 -6
- package/dist/_chunks/{ComponentConfigurationPage-5ukroXAh.js.map → ComponentConfigurationPage-BlzvDpbX.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BAgyHiMm.mjs → ComponentConfigurationPage-DaPOlQaD.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-BAgyHiMm.mjs.map → ComponentConfigurationPage-DaPOlQaD.mjs.map} +1 -1
- package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
- package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
- package/dist/_chunks/{EditConfigurationPage-DmoXawIh.mjs → EditConfigurationPage-BZPXItXo.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-DmoXawIh.mjs.map → EditConfigurationPage-BZPXItXo.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-Xp7lun0f.js → EditConfigurationPage-uy-v43AR.js} +5 -6
- package/dist/_chunks/{EditConfigurationPage-Xp7lun0f.js.map → EditConfigurationPage-uy-v43AR.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-C-ukDOB7.js → EditViewPage-DT6A4ayX.js} +63 -13
- package/dist/_chunks/EditViewPage-DT6A4ayX.js.map +1 -0
- package/dist/_chunks/{EditViewPage-BLsjc5F-.mjs → EditViewPage-oOLeTySr.mjs} +63 -12
- package/dist/_chunks/EditViewPage-oOLeTySr.mjs.map +1 -0
- package/dist/_chunks/{Field-Cs7duwWd.mjs → Field-D7dv2aUX.mjs} +335 -211
- package/dist/_chunks/Field-D7dv2aUX.mjs.map +1 -0
- package/dist/_chunks/{Field-Bfph5SOd.js → Field-kYFVIGiP.js} +339 -215
- package/dist/_chunks/Field-kYFVIGiP.js.map +1 -0
- package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
- package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
- package/dist/_chunks/{Form-Dg_GS5TQ.mjs → Form-BxR6sc29.mjs} +37 -18
- package/dist/_chunks/Form-BxR6sc29.mjs.map +1 -0
- package/dist/_chunks/{Form-CPYqIWDG.js → Form-CCijSg3V.js} +39 -21
- package/dist/_chunks/Form-CCijSg3V.js.map +1 -0
- package/dist/_chunks/{History-DNQkXANT.js → History-BMndx49M.js} +42 -100
- package/dist/_chunks/History-BMndx49M.js.map +1 -0
- package/dist/_chunks/{History-wrnHqf09.mjs → History-D8F7aYQU.mjs} +43 -100
- package/dist/_chunks/History-D8F7aYQU.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-CUQxfpjT.js → ListConfigurationPage-DouY1EWM.js} +19 -9
- package/dist/_chunks/ListConfigurationPage-DouY1EWM.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DScmJVkW.mjs → ListConfigurationPage-DqAdSPwC.mjs} +19 -8
- package/dist/_chunks/ListConfigurationPage-DqAdSPwC.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-BsLiH2-2.js → ListViewPage-BPVmh9pq.js} +109 -78
- package/dist/_chunks/ListViewPage-BPVmh9pq.js.map +1 -0
- package/dist/_chunks/{ListViewPage-C4IvrMgY.mjs → ListViewPage-C73F0jPh.mjs} +106 -74
- package/dist/_chunks/ListViewPage-C73F0jPh.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Djg8nPlj.mjs → NoContentTypePage-B5w7iJOF.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-Djg8nPlj.mjs.map → NoContentTypePage-B5w7iJOF.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BZ-PnGAf.js → NoContentTypePage-BwcL--4H.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-BZ-PnGAf.js.map → NoContentTypePage-BwcL--4H.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-_lUqjGW3.js → NoPermissionsPage-BMFKVcwJ.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-_lUqjGW3.js.map → NoPermissionsPage-BMFKVcwJ.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DSP7R-hv.mjs → NoPermissionsPage-UnEgMGK4.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DSP7R-hv.mjs.map → NoPermissionsPage-UnEgMGK4.mjs.map} +1 -1
- package/dist/_chunks/Preview-B7PR3Ok_.js +312 -0
- package/dist/_chunks/Preview-B7PR3Ok_.js.map +1 -0
- package/dist/_chunks/Preview-DECOhK0D.mjs +294 -0
- package/dist/_chunks/Preview-DECOhK0D.mjs.map +1 -0
- package/dist/_chunks/{Relations-BZr8tL0R.mjs → Relations-DinMQJ4B.mjs} +76 -42
- package/dist/_chunks/Relations-DinMQJ4B.mjs.map +1 -0
- package/dist/_chunks/{Relations-CtELXYIK.js → Relations-lndx3aQk.js} +76 -43
- package/dist/_chunks/Relations-lndx3aQk.js.map +1 -0
- package/dist/_chunks/{en-uOUIxfcQ.js → en-BK8Xyl5I.js} +28 -15
- package/dist/_chunks/{en-uOUIxfcQ.js.map → en-BK8Xyl5I.js.map} +1 -1
- package/dist/_chunks/{en-BrCTWlZv.mjs → en-Dtk_ot79.mjs} +28 -15
- package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
- package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
- package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
- package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
- package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
- package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
- package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
- package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
- package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
- package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
- package/dist/_chunks/{index-c_5DdJi-.mjs → index-C2SagWVW.mjs} +1107 -777
- package/dist/_chunks/index-C2SagWVW.mjs.map +1 -0
- package/dist/_chunks/{index-OerGjbAN.js → index-Cnw4gqee.js} +1089 -759
- package/dist/_chunks/index-Cnw4gqee.js.map +1 -0
- package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
- package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
- package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
- package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
- package/dist/_chunks/{layout-oPBiO7RY.mjs → layout-DY_D9MGA.mjs} +23 -10
- package/dist/_chunks/layout-DY_D9MGA.mjs.map +1 -0
- package/dist/_chunks/{layout-Ci7qHlFb.js → layout-ivwIVPnV.js} +23 -11
- package/dist/_chunks/layout-ivwIVPnV.js.map +1 -0
- package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
- package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
- package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
- package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
- package/dist/_chunks/{relations-COBpStiF.js → relations-B7C7O_Pv.js} +6 -7
- package/dist/_chunks/relations-B7C7O_Pv.js.map +1 -0
- package/dist/_chunks/{relations-BIdWFjdq.mjs → relations-Boc5Y9kX.mjs} +6 -7
- package/dist/_chunks/relations-Boc5Y9kX.mjs.map +1 -0
- package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
- package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
- package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
- package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
- package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +5 -4
- package/dist/admin/src/content-manager.d.ts +3 -2
- package/dist/admin/src/exports.d.ts +1 -1
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +32 -1
- package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
- package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
- package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/preview/pages/Preview.d.ts +11 -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/admin/src/utils/validation.d.ts +4 -1
- package/dist/server/index.js +648 -333
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +649 -333
- 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 +16 -1
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- 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 +4 -4
- 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/policies/hasPermissions.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/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts +2 -2
- 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 -1
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/index.d.ts +1 -0
- package/dist/shared/contracts/index.d.ts.map +1 -1
- package/dist/shared/contracts/preview.d.ts +27 -0
- package/dist/shared/contracts/preview.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +17 -15
- package/dist/_chunks/EditViewPage-BLsjc5F-.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-C-ukDOB7.js.map +0 -1
- package/dist/_chunks/Field-Bfph5SOd.js.map +0 -1
- package/dist/_chunks/Field-Cs7duwWd.mjs.map +0 -1
- package/dist/_chunks/Form-CPYqIWDG.js.map +0 -1
- package/dist/_chunks/Form-Dg_GS5TQ.mjs.map +0 -1
- package/dist/_chunks/History-DNQkXANT.js.map +0 -1
- package/dist/_chunks/History-wrnHqf09.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-CUQxfpjT.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DScmJVkW.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BsLiH2-2.js.map +0 -1
- package/dist/_chunks/ListViewPage-C4IvrMgY.mjs.map +0 -1
- package/dist/_chunks/Relations-BZr8tL0R.mjs.map +0 -1
- package/dist/_chunks/Relations-CtELXYIK.js.map +0 -1
- package/dist/_chunks/index-OerGjbAN.js.map +0 -1
- package/dist/_chunks/index-c_5DdJi-.mjs.map +0 -1
- package/dist/_chunks/layout-Ci7qHlFb.js.map +0 -1
- package/dist/_chunks/layout-oPBiO7RY.mjs.map +0 -1
- package/dist/_chunks/relations-BIdWFjdq.mjs.map +0 -1
- package/dist/_chunks/relations-COBpStiF.js.map +0 -1
- 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/strapi-server.js +0 -3
@@ -5,19 +5,70 @@ const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
6
6
|
const pipe$1 = require("lodash/fp/pipe");
|
7
7
|
const reactIntl = require("react-intl");
|
8
|
-
const index = require("./index-
|
8
|
+
const index = require("./index-Cnw4gqee.js");
|
9
9
|
const fractionalIndexing = require("fractional-indexing");
|
10
|
-
const Relations = require("./Relations-
|
10
|
+
const Relations = require("./Relations-lndx3aQk.js");
|
11
11
|
const Icons = require("@strapi/icons");
|
12
12
|
const styledComponents = require("styled-components");
|
13
|
-
const ComponentIcon = require("./ComponentIcon-
|
13
|
+
const ComponentIcon = require("./ComponentIcon-CRbtQEUV.js");
|
14
14
|
const reactDndHtml5Backend = require("react-dnd-html5-backend");
|
15
|
-
const useDragAndDrop = require("./useDragAndDrop-
|
16
|
-
const objects = require("./objects-
|
15
|
+
const useDragAndDrop = require("./useDragAndDrop-BMtgCYzL.js");
|
16
|
+
const objects = require("./objects-BcXOv6_9.js");
|
17
17
|
const slate = require("slate");
|
18
18
|
const slateHistory = require("slate-history");
|
19
19
|
const slateReact = require("slate-react");
|
20
|
-
const
|
20
|
+
const Prism = require("prismjs");
|
21
|
+
require("prismjs/themes/prism-solarizedlight.css");
|
22
|
+
require("prismjs/components/prism-asmatmel");
|
23
|
+
require("prismjs/components/prism-bash");
|
24
|
+
require("prismjs/components/prism-basic");
|
25
|
+
require("prismjs/components/prism-c");
|
26
|
+
require("prismjs/components/prism-clojure");
|
27
|
+
require("prismjs/components/prism-cobol");
|
28
|
+
require("prismjs/components/prism-cpp");
|
29
|
+
require("prismjs/components/prism-csharp");
|
30
|
+
require("prismjs/components/prism-dart");
|
31
|
+
require("prismjs/components/prism-docker");
|
32
|
+
require("prismjs/components/prism-elixir");
|
33
|
+
require("prismjs/components/prism-erlang");
|
34
|
+
require("prismjs/components/prism-fortran");
|
35
|
+
require("prismjs/components/prism-fsharp");
|
36
|
+
require("prismjs/components/prism-go");
|
37
|
+
require("prismjs/components/prism-graphql");
|
38
|
+
require("prismjs/components/prism-groovy");
|
39
|
+
require("prismjs/components/prism-haskell");
|
40
|
+
require("prismjs/components/prism-haxe");
|
41
|
+
require("prismjs/components/prism-ini");
|
42
|
+
require("prismjs/components/prism-java");
|
43
|
+
require("prismjs/components/prism-javascript");
|
44
|
+
require("prismjs/components/prism-jsx");
|
45
|
+
require("prismjs/components/prism-json");
|
46
|
+
require("prismjs/components/prism-julia");
|
47
|
+
require("prismjs/components/prism-kotlin");
|
48
|
+
require("prismjs/components/prism-latex");
|
49
|
+
require("prismjs/components/prism-lua");
|
50
|
+
require("prismjs/components/prism-markdown");
|
51
|
+
require("prismjs/components/prism-matlab");
|
52
|
+
require("prismjs/components/prism-makefile");
|
53
|
+
require("prismjs/components/prism-objectivec");
|
54
|
+
require("prismjs/components/prism-perl");
|
55
|
+
require("prismjs/components/prism-php");
|
56
|
+
require("prismjs/components/prism-powershell");
|
57
|
+
require("prismjs/components/prism-python");
|
58
|
+
require("prismjs/components/prism-r");
|
59
|
+
require("prismjs/components/prism-ruby");
|
60
|
+
require("prismjs/components/prism-rust");
|
61
|
+
require("prismjs/components/prism-sas");
|
62
|
+
require("prismjs/components/prism-scala");
|
63
|
+
require("prismjs/components/prism-scheme");
|
64
|
+
require("prismjs/components/prism-sql");
|
65
|
+
require("prismjs/components/prism-stata");
|
66
|
+
require("prismjs/components/prism-swift");
|
67
|
+
require("prismjs/components/prism-typescript");
|
68
|
+
require("prismjs/components/prism-tsx");
|
69
|
+
require("prismjs/components/prism-vbnet");
|
70
|
+
require("prismjs/components/prism-yaml");
|
71
|
+
const useDebounce = require("./useDebounce-CtcjDB3L.js");
|
21
72
|
const Toolbar = require("@radix-ui/react-toolbar");
|
22
73
|
const reactRouterDom = require("react-router-dom");
|
23
74
|
const CodeMirror = require("codemirror5");
|
@@ -37,8 +88,7 @@ require("highlight.js/styles/solarized-dark.css");
|
|
37
88
|
require("codemirror5/addon/display/placeholder");
|
38
89
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
39
90
|
function _interopNamespace(e) {
|
40
|
-
if (e && e.__esModule)
|
41
|
-
return e;
|
91
|
+
if (e && e.__esModule) return e;
|
42
92
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
43
93
|
if (e) {
|
44
94
|
for (const k in e) {
|
@@ -56,6 +106,7 @@ function _interopNamespace(e) {
|
|
56
106
|
}
|
57
107
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
58
108
|
const pipe__default = /* @__PURE__ */ _interopDefault(pipe$1);
|
109
|
+
const Prism__namespace = /* @__PURE__ */ _interopNamespace(Prism);
|
59
110
|
const Toolbar__namespace = /* @__PURE__ */ _interopNamespace(Toolbar);
|
60
111
|
const CodeMirror__default = /* @__PURE__ */ _interopDefault(CodeMirror);
|
61
112
|
const sanitizeHtml__default = /* @__PURE__ */ _interopDefault(sanitizeHtml);
|
@@ -197,7 +248,8 @@ const useLazyComponents = (componentUids = []) => {
|
|
197
248
|
const codeLanguages = [
|
198
249
|
{
|
199
250
|
value: "asm",
|
200
|
-
label: "Assembly"
|
251
|
+
label: "Assembly",
|
252
|
+
decorate: "asmatmel"
|
201
253
|
},
|
202
254
|
{
|
203
255
|
value: "bash",
|
@@ -233,7 +285,8 @@ const codeLanguages = [
|
|
233
285
|
},
|
234
286
|
{
|
235
287
|
value: "dockerfile",
|
236
|
-
label: "Dockerfile"
|
288
|
+
label: "Dockerfile",
|
289
|
+
decorate: "docker"
|
237
290
|
},
|
238
291
|
{
|
239
292
|
value: "elixir",
|
@@ -389,7 +442,8 @@ const codeLanguages = [
|
|
389
442
|
},
|
390
443
|
{
|
391
444
|
value: "typescript",
|
392
|
-
label: "TypeScript"
|
445
|
+
label: "TypeScript",
|
446
|
+
decorate: "ts"
|
393
447
|
},
|
394
448
|
{
|
395
449
|
value: "tsx",
|
@@ -405,7 +459,8 @@ const codeLanguages = [
|
|
405
459
|
},
|
406
460
|
{
|
407
461
|
value: "yaml",
|
408
|
-
label: "YAML"
|
462
|
+
label: "YAML",
|
463
|
+
decorate: "yml"
|
409
464
|
}
|
410
465
|
];
|
411
466
|
const baseHandleConvert = (editor, attributesToSet) => {
|
@@ -471,6 +526,29 @@ const pressEnterTwiceToExit = (editor) => {
|
|
471
526
|
});
|
472
527
|
}
|
473
528
|
};
|
529
|
+
const decorateCode = ([node, path]) => {
|
530
|
+
const ranges = [];
|
531
|
+
if (!slate.Element.isElement(node) || node.type !== "code") return ranges;
|
532
|
+
const text = slate.Node.string(node);
|
533
|
+
const language = codeLanguages.find((lang) => lang.value === node.language);
|
534
|
+
const decorateKey = language?.decorate ?? language?.value;
|
535
|
+
const selectedLanguage = Prism__namespace.languages[decorateKey || "plaintext"];
|
536
|
+
const tokens = Prism__namespace.tokenize(text, selectedLanguage);
|
537
|
+
let start = 0;
|
538
|
+
for (const token of tokens) {
|
539
|
+
const length = token.length;
|
540
|
+
const end = start + length;
|
541
|
+
if (typeof token !== "string") {
|
542
|
+
ranges.push({
|
543
|
+
anchor: { path, offset: start },
|
544
|
+
focus: { path, offset: end },
|
545
|
+
className: `token ${token.type}`
|
546
|
+
});
|
547
|
+
}
|
548
|
+
start = end;
|
549
|
+
}
|
550
|
+
return ranges;
|
551
|
+
};
|
474
552
|
const CodeBlock = styledComponents.styled.pre`
|
475
553
|
border-radius: ${({ theme }) => theme.borderRadius};
|
476
554
|
background-color: ${({ theme }) => theme.colors.neutral100};
|
@@ -542,7 +620,7 @@ const CodeEditor = (props) => {
|
|
542
620
|
const codeBlocks = {
|
543
621
|
code: {
|
544
622
|
renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(CodeEditor, { ...props }),
|
545
|
-
icon: Icons.
|
623
|
+
icon: Icons.CodeBlock,
|
546
624
|
label: {
|
547
625
|
id: "components.Blocks.blocks.code",
|
548
626
|
defaultMessage: "Code block"
|
@@ -555,8 +633,7 @@ const codeBlocks = {
|
|
555
633
|
handleEnterKey(editor) {
|
556
634
|
pressEnterTwiceToExit(editor);
|
557
635
|
},
|
558
|
-
snippets: ["```"]
|
559
|
-
dragHandleTopMargin: "10px"
|
636
|
+
snippets: ["```"]
|
560
637
|
}
|
561
638
|
};
|
562
639
|
const H1 = styledComponents.styled(designSystem.Typography).attrs({ tag: "h1" })`
|
@@ -731,8 +808,7 @@ const ImageDialog = () => {
|
|
731
808
|
const [isOpen, setIsOpen] = React__namespace.useState(true);
|
732
809
|
const { editor } = useBlocksEditorContext("ImageDialog");
|
733
810
|
const components = strapiAdmin.useStrapiApp("ImageDialog", (state) => state.components);
|
734
|
-
if (!components || !isOpen)
|
735
|
-
return null;
|
811
|
+
if (!components || !isOpen) return null;
|
736
812
|
const MediaLibraryDialog = components["media-library"];
|
737
813
|
const insertImages = (images) => {
|
738
814
|
slate.Transforms.unwrapNodes(editor, {
|
@@ -741,14 +817,12 @@ const ImageDialog = () => {
|
|
741
817
|
});
|
742
818
|
const nodeEntryBeingReplaced = slate.Editor.above(editor, {
|
743
819
|
match(node) {
|
744
|
-
if (slate.Editor.isEditor(node))
|
745
|
-
return false;
|
820
|
+
if (slate.Editor.isEditor(node)) return false;
|
746
821
|
const isInlineNode = ["text", "link"].includes(node.type);
|
747
822
|
return !isInlineNode;
|
748
823
|
}
|
749
824
|
});
|
750
|
-
if (!nodeEntryBeingReplaced)
|
751
|
-
return;
|
825
|
+
if (!nodeEntryBeingReplaced) return;
|
752
826
|
const [, pathToInsert] = nodeEntryBeingReplaced;
|
753
827
|
slate.Transforms.removeNodes(editor);
|
754
828
|
const nodesToInsert = images.map((image) => {
|
@@ -768,7 +842,7 @@ const ImageDialog = () => {
|
|
768
842
|
const nodeImage = {
|
769
843
|
...expectedImage,
|
770
844
|
alternativeText: expectedImage.alternativeText || expectedImage.name,
|
771
|
-
url:
|
845
|
+
url: useDebounce.prefixFileUrlWithBackendUrl(image.url)
|
772
846
|
};
|
773
847
|
return nodeImage;
|
774
848
|
});
|
@@ -926,8 +1000,7 @@ const LinkContent = React__namespace.forwardRef(
|
|
926
1000
|
slateReact.ReactEditor.focus(editor);
|
927
1001
|
};
|
928
1002
|
React__namespace.useEffect(() => {
|
929
|
-
if (popoverOpen)
|
930
|
-
linkInputRef.current?.focus();
|
1003
|
+
if (popoverOpen) linkInputRef.current?.focus();
|
931
1004
|
}, [popoverOpen]);
|
932
1005
|
const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
|
933
1006
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { open: popoverOpen, children: [
|
@@ -997,11 +1070,11 @@ const LinkContent = React__namespace.forwardRef(
|
|
997
1070
|
),
|
998
1071
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
999
1072
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
|
1000
|
-
id: "
|
1073
|
+
id: "global.cancel",
|
1001
1074
|
defaultMessage: "Cancel"
|
1002
1075
|
}) }),
|
1003
1076
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
|
1004
|
-
id: "
|
1077
|
+
id: "global.save",
|
1005
1078
|
defaultMessage: "Save"
|
1006
1079
|
}) })
|
1007
1080
|
] })
|
@@ -1082,8 +1155,7 @@ const isText$1 = (node) => {
|
|
1082
1155
|
return slate.Node.isNode(node) && !slate.Editor.isEditor(node) && node.type === "text";
|
1083
1156
|
};
|
1084
1157
|
const handleBackspaceKeyOnList = (editor, event) => {
|
1085
|
-
if (!editor.selection)
|
1086
|
-
return;
|
1158
|
+
if (!editor.selection) return;
|
1087
1159
|
const [currentListItem, currentListItemPath] = slate.Editor.parent(editor, editor.selection.anchor);
|
1088
1160
|
const [currentList, currentListPath] = slate.Editor.parent(editor, currentListItemPath);
|
1089
1161
|
const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
|
@@ -1192,8 +1264,7 @@ const handleEnterKeyOnList = (editor) => {
|
|
1192
1264
|
};
|
1193
1265
|
const handleConvertToList = (editor, format) => {
|
1194
1266
|
const convertedPath = baseHandleConvert(editor, { type: "list-item" });
|
1195
|
-
if (!convertedPath)
|
1196
|
-
return;
|
1267
|
+
if (!convertedPath) return;
|
1197
1268
|
slate.Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
|
1198
1269
|
};
|
1199
1270
|
const handleTabOnList = (editor) => {
|
@@ -1205,8 +1276,7 @@ const handleTabOnList = (editor) => {
|
|
1205
1276
|
}
|
1206
1277
|
const [currentListItem, currentListItemPath] = currentListItemEntry;
|
1207
1278
|
const [currentList] = slate.Editor.parent(editor, currentListItemPath);
|
1208
|
-
if (currentListItem === currentList.children[0])
|
1209
|
-
return;
|
1279
|
+
if (currentListItem === currentList.children[0]) return;
|
1210
1280
|
const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
|
1211
1281
|
const previousNode = currentList.children[currentListItemIndex - 1];
|
1212
1282
|
if (previousNode.type === "list") {
|
@@ -1342,13 +1412,13 @@ const quoteBlocks = {
|
|
1342
1412
|
handleEnterKey(editor) {
|
1343
1413
|
pressEnterTwiceToExit(editor);
|
1344
1414
|
},
|
1345
|
-
snippets: [">"]
|
1346
|
-
dragHandleTopMargin: "6px"
|
1415
|
+
snippets: [">"]
|
1347
1416
|
}
|
1348
1417
|
};
|
1349
1418
|
const ToolbarWrapper = styledComponents.styled(designSystem.Flex)`
|
1350
1419
|
&[aria-disabled='true'] {
|
1351
1420
|
cursor: not-allowed;
|
1421
|
+
background: ${({ theme }) => theme.colors.neutral150};
|
1352
1422
|
}
|
1353
1423
|
`;
|
1354
1424
|
const Separator = styledComponents.styled(Toolbar__namespace.Separator)`
|
@@ -1359,7 +1429,7 @@ const Separator = styledComponents.styled(Toolbar__namespace.Separator)`
|
|
1359
1429
|
const FlexButton = styledComponents.styled(designSystem.Flex)`
|
1360
1430
|
// Inherit the not-allowed cursor from ToolbarWrapper when disabled
|
1361
1431
|
&[aria-disabled] {
|
1362
|
-
cursor:
|
1432
|
+
cursor: not-allowed;
|
1363
1433
|
}
|
1364
1434
|
|
1365
1435
|
&[aria-disabled='false'] {
|
@@ -1441,7 +1511,7 @@ const ToolbarButton = ({
|
|
1441
1511
|
width: 7,
|
1442
1512
|
height: 7,
|
1443
1513
|
hasRadius: true,
|
1444
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {
|
1514
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
|
1445
1515
|
}
|
1446
1516
|
)
|
1447
1517
|
}
|
@@ -1573,8 +1643,7 @@ const isListNode = (node) => {
|
|
1573
1643
|
const ListButton = ({ block, format }) => {
|
1574
1644
|
const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
|
1575
1645
|
const isListActive = () => {
|
1576
|
-
if (!editor.selection)
|
1577
|
-
return false;
|
1646
|
+
if (!editor.selection) return false;
|
1578
1647
|
const currentListEntry = slate.Editor.above(editor, {
|
1579
1648
|
match: (node) => !slate.Editor.isEditor(node) && node.type === "list",
|
1580
1649
|
at: editor.selection.anchor
|
@@ -1648,8 +1717,7 @@ const LinkButton = ({ disabled }) => {
|
|
1648
1717
|
const { editor } = useBlocksEditorContext("LinkButton");
|
1649
1718
|
const isLinkActive = () => {
|
1650
1719
|
const { selection } = editor;
|
1651
|
-
if (!selection)
|
1652
|
-
return false;
|
1720
|
+
if (!selection) return false;
|
1653
1721
|
const [match] = Array.from(
|
1654
1722
|
slate.Editor.nodes(editor, {
|
1655
1723
|
at: slate.Editor.unhangRange(editor, selection),
|
@@ -1713,7 +1781,7 @@ const BlocksToolbar = () => {
|
|
1713
1781
|
return false;
|
1714
1782
|
};
|
1715
1783
|
const isButtonDisabled = checkButtonDisabled();
|
1716
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Toolbar__namespace.Root, { "aria-disabled": disabled, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarWrapper, { gap: 2, padding: 2, children: [
|
1784
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Toolbar__namespace.Root, { "aria-disabled": disabled, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarWrapper, { gap: 2, padding: 2, width: "100%", children: [
|
1717
1785
|
/* @__PURE__ */ jsxRuntime.jsx(BlocksDropdown, {}),
|
1718
1786
|
/* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
|
1719
1787
|
/* @__PURE__ */ jsxRuntime.jsx(Toolbar__namespace.ToggleGroup, { type: "multiple", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 1, children: [
|
@@ -1783,33 +1851,36 @@ const DragItem = styledComponents.styled(designSystem.Flex)`
|
|
1783
1851
|
}
|
1784
1852
|
`;
|
1785
1853
|
const DragIconButton = styledComponents.styled(designSystem.IconButton)`
|
1854
|
+
user-select: none;
|
1786
1855
|
display: flex;
|
1787
1856
|
align-items: center;
|
1788
1857
|
justify-content: center;
|
1858
|
+
border: none;
|
1789
1859
|
border-radius: ${({ theme }) => theme.borderRadius};
|
1790
|
-
|
1791
|
-
|
1860
|
+
padding-left: ${({ theme }) => theme.spaces[0]};
|
1861
|
+
padding-right: ${({ theme }) => theme.spaces[0]};
|
1862
|
+
padding-top: ${({ theme }) => theme.spaces[1]};
|
1863
|
+
padding-bottom: ${({ theme }) => theme.spaces[1]};
|
1792
1864
|
visibility: hidden;
|
1793
1865
|
cursor: grab;
|
1794
1866
|
opacity: inherit;
|
1795
1867
|
margin-top: ${(props) => props.$dragHandleTopMargin ?? 0};
|
1796
1868
|
|
1797
1869
|
&:hover {
|
1798
|
-
background: ${({ theme }) => theme.colors.
|
1870
|
+
background: ${({ theme }) => theme.colors.neutral100};
|
1799
1871
|
}
|
1800
1872
|
&:active {
|
1801
1873
|
cursor: grabbing;
|
1874
|
+
background: ${({ theme }) => theme.colors.neutral150};
|
1802
1875
|
}
|
1803
1876
|
&[aria-disabled='true'] {
|
1804
|
-
|
1805
|
-
background: transparent;
|
1877
|
+
visibility: hidden;
|
1806
1878
|
}
|
1807
1879
|
svg {
|
1808
|
-
height: auto;
|
1809
1880
|
min-width: ${({ theme }) => theme.spaces[3]};
|
1810
1881
|
|
1811
1882
|
path {
|
1812
|
-
fill: ${({ theme }) => theme.colors.
|
1883
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
1813
1884
|
}
|
1814
1885
|
}
|
1815
1886
|
`;
|
@@ -1854,8 +1925,7 @@ const DragAndDropElement = ({
|
|
1854
1925
|
displayedValue: children
|
1855
1926
|
},
|
1856
1927
|
onDropItem(currentIndex, newIndex) {
|
1857
|
-
if (newIndex)
|
1858
|
-
handleMoveBlock(newIndex, currentIndex);
|
1928
|
+
if (newIndex) handleMoveBlock(newIndex, currentIndex);
|
1859
1929
|
}
|
1860
1930
|
});
|
1861
1931
|
const composedBoxRefs = designSystem.useComposedRefs(blockRef, dropRef);
|
@@ -1911,6 +1981,7 @@ const DragAndDropElement = ({
|
|
1911
1981
|
DragIconButton,
|
1912
1982
|
{
|
1913
1983
|
tag: "div",
|
1984
|
+
contentEditable: false,
|
1914
1985
|
role: "button",
|
1915
1986
|
tabIndex: 0,
|
1916
1987
|
withTooltip: false,
|
@@ -1960,7 +2031,7 @@ const baseRenderLeaf = (props, modifiers2) => {
|
|
1960
2031
|
}
|
1961
2032
|
return currentChildren;
|
1962
2033
|
}, props.children);
|
1963
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props.attributes, children: wrappedChildren });
|
2034
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props.attributes, className: props.leaf.className, children: wrappedChildren });
|
1964
2035
|
};
|
1965
2036
|
const baseRenderElement = ({
|
1966
2037
|
props,
|
@@ -1998,8 +2069,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
1998
2069
|
[modifiers2]
|
1999
2070
|
);
|
2000
2071
|
const handleMoveBlocks = (editor2, event) => {
|
2001
|
-
if (!editor2.selection)
|
2002
|
-
return;
|
2072
|
+
if (!editor2.selection) return;
|
2003
2073
|
const start = slate.Range.start(editor2.selection);
|
2004
2074
|
const currentIndex = [start.path[0]];
|
2005
2075
|
let newIndexPosition = 0;
|
@@ -2136,8 +2206,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2136
2206
|
}
|
2137
2207
|
};
|
2138
2208
|
const handleScrollSelectionIntoView = () => {
|
2139
|
-
if (!editor.selection)
|
2140
|
-
return;
|
2209
|
+
if (!editor.selection) return;
|
2141
2210
|
const domRange = slateReact.ReactEditor.toDOMRange(editor, editor.selection);
|
2142
2211
|
const domRect = domRange.getBoundingClientRect();
|
2143
2212
|
const blocksInput = blocksRef.current;
|
@@ -2164,7 +2233,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2164
2233
|
background: "neutral0",
|
2165
2234
|
color: "neutral800",
|
2166
2235
|
lineHeight: 6,
|
2167
|
-
paddingRight:
|
2236
|
+
paddingRight: 7,
|
2168
2237
|
paddingTop: 6,
|
2169
2238
|
paddingBottom: 3,
|
2170
2239
|
children: [
|
@@ -2175,6 +2244,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2175
2244
|
readOnly: disabled,
|
2176
2245
|
placeholder,
|
2177
2246
|
isExpandedMode,
|
2247
|
+
decorate: decorateCode,
|
2178
2248
|
renderElement,
|
2179
2249
|
renderLeaf,
|
2180
2250
|
onKeyDown: handleKeyDown,
|
@@ -2331,8 +2401,7 @@ const InlineCode = styledComponents.styled.code`
|
|
2331
2401
|
`;
|
2332
2402
|
const baseCheckIsActive = (editor, name2) => {
|
2333
2403
|
const marks = slate.Editor.marks(editor);
|
2334
|
-
if (!marks)
|
2335
|
-
return false;
|
2404
|
+
if (!marks) return false;
|
2336
2405
|
return Boolean(marks[name2]);
|
2337
2406
|
};
|
2338
2407
|
const baseHandleToggle = (editor, name2) => {
|
@@ -2498,6 +2567,7 @@ const ExpandIconButton = styledComponents.styled(designSystem.IconButton)`
|
|
2498
2567
|
position: absolute;
|
2499
2568
|
bottom: 1.2rem;
|
2500
2569
|
right: 1.2rem;
|
2570
|
+
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
2501
2571
|
`;
|
2502
2572
|
function useResetKey(value) {
|
2503
2573
|
const slateUpdatesCount = React__namespace.useRef(0);
|
@@ -2656,7 +2726,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2656
2726
|
designSystem.Box,
|
2657
2727
|
{
|
2658
2728
|
tag: "button",
|
2659
|
-
background: "neutral100",
|
2729
|
+
background: disabled ? "neutral150" : "neutral100",
|
2660
2730
|
borderColor: field.error ? "danger600" : "neutral200",
|
2661
2731
|
hasRadius: true,
|
2662
2732
|
disabled,
|
@@ -2664,32 +2734,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2664
2734
|
paddingTop: 9,
|
2665
2735
|
paddingBottom: 9,
|
2666
2736
|
type: "button",
|
2737
|
+
style: { cursor: disabled ? "not-allowed" : "pointer" },
|
2667
2738
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
|
2668
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
2669
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
2670
|
-
|
2671
|
-
|
2672
|
-
|
2739
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
|
2740
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
2741
|
+
designSystem.Typography,
|
2742
|
+
{
|
2743
|
+
textColor: disabled ? "neutral600" : "primary600",
|
2744
|
+
variant: "pi",
|
2745
|
+
fontWeight: "bold",
|
2746
|
+
children: formatMessage({
|
2747
|
+
id: index.getTranslation("components.empty-repeatable"),
|
2748
|
+
defaultMessage: "No entry yet. Click to add one."
|
2749
|
+
})
|
2750
|
+
}
|
2751
|
+
) })
|
2673
2752
|
] })
|
2674
2753
|
}
|
2675
2754
|
) });
|
2676
2755
|
};
|
2677
|
-
const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
|
2678
|
-
width: 2.4rem;
|
2679
|
-
height: 2.4rem;
|
2680
|
-
> circle {
|
2681
|
-
fill: ${({ theme }) => theme.colors.primary200};
|
2682
|
-
}
|
2683
|
-
> path {
|
2684
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
2685
|
-
}
|
2686
|
-
`;
|
2687
2756
|
const NonRepeatableComponent = ({
|
2688
2757
|
attribute,
|
2689
2758
|
name: name2,
|
2690
2759
|
children,
|
2691
2760
|
layout
|
2692
2761
|
}) => {
|
2762
|
+
const { formatMessage } = reactIntl.useIntl();
|
2693
2763
|
const { value } = strapiAdmin.useField(name2);
|
2694
2764
|
const level = Relations.useComponent("NonRepeatableComponent", (state) => state.level);
|
2695
2765
|
const isNested = level > 0;
|
@@ -2706,7 +2776,22 @@ const NonRepeatableComponent = ({
|
|
2706
2776
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
|
2707
2777
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2708
2778
|
const completeFieldName = `${name2}.${field.name}`;
|
2709
|
-
|
2779
|
+
const translatedLabel = formatMessage({
|
2780
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2781
|
+
defaultMessage: field.label
|
2782
|
+
});
|
2783
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
2784
|
+
designSystem.Grid.Item,
|
2785
|
+
{
|
2786
|
+
col: size,
|
2787
|
+
s: 12,
|
2788
|
+
xs: 12,
|
2789
|
+
direction: "column",
|
2790
|
+
alignItems: "stretch",
|
2791
|
+
children: children({ ...field, label: translatedLabel, name: completeFieldName })
|
2792
|
+
},
|
2793
|
+
completeFieldName
|
2794
|
+
);
|
2710
2795
|
}) }, index2);
|
2711
2796
|
}) })
|
2712
2797
|
}
|
@@ -2725,13 +2810,34 @@ const RepeatableComponent = ({
|
|
2725
2810
|
const { search: searchString } = reactRouterDom.useLocation();
|
2726
2811
|
const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2727
2812
|
const { components } = index.useDoc();
|
2728
|
-
const {
|
2813
|
+
const {
|
2814
|
+
value = [],
|
2815
|
+
error,
|
2816
|
+
rawError
|
2817
|
+
} = strapiAdmin.useField(name2);
|
2729
2818
|
const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2730
2819
|
const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2731
2820
|
const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2732
2821
|
const { max = Infinity } = attribute;
|
2733
2822
|
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
|
2734
2823
|
const [liveText, setLiveText] = React__namespace.useState("");
|
2824
|
+
React__namespace.useEffect(() => {
|
2825
|
+
const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
|
2826
|
+
const hasNestedValue = value && Array.isArray(value) && value.length > 0;
|
2827
|
+
if (hasNestedErrors && hasNestedValue) {
|
2828
|
+
const errorOpenItems = rawError.map((_, idx) => {
|
2829
|
+
return value[idx] ? value[idx].__temp_key__ : null;
|
2830
|
+
}).filter((value2) => !!value2);
|
2831
|
+
if (errorOpenItems && errorOpenItems.length > 0) {
|
2832
|
+
setCollapseToOpen((collapseToOpen2) => {
|
2833
|
+
if (!errorOpenItems.includes(collapseToOpen2)) {
|
2834
|
+
return errorOpenItems[0];
|
2835
|
+
}
|
2836
|
+
return collapseToOpen2;
|
2837
|
+
});
|
2838
|
+
}
|
2839
|
+
}
|
2840
|
+
}, [rawError, value]);
|
2735
2841
|
const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
|
2736
2842
|
if (search.has("field")) {
|
2737
2843
|
const fieldParam = search.get("field");
|
@@ -2746,7 +2852,7 @@ const RepeatableComponent = ({
|
|
2746
2852
|
}
|
2747
2853
|
return void 0;
|
2748
2854
|
}, [search, name2, value]);
|
2749
|
-
const prevValue =
|
2855
|
+
const prevValue = useDebounce.usePrev(value);
|
2750
2856
|
React__namespace.useEffect(() => {
|
2751
2857
|
if (prevValue && prevValue.length < value.length) {
|
2752
2858
|
setCollapseToOpen(value[value.length - 1].__temp_key__);
|
@@ -2884,7 +2990,26 @@ const RepeatableComponent = ({
|
|
2884
2990
|
children: layout.map((row, index22) => {
|
2885
2991
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2886
2992
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2887
|
-
|
2993
|
+
const translatedLabel = formatMessage({
|
2994
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2995
|
+
defaultMessage: field.label
|
2996
|
+
});
|
2997
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
2998
|
+
designSystem.Grid.Item,
|
2999
|
+
{
|
3000
|
+
col: size,
|
3001
|
+
s: 12,
|
3002
|
+
xs: 12,
|
3003
|
+
direction: "column",
|
3004
|
+
alignItems: "stretch",
|
3005
|
+
children: children({
|
3006
|
+
...field,
|
3007
|
+
label: translatedLabel,
|
3008
|
+
name: completeFieldName
|
3009
|
+
})
|
3010
|
+
},
|
3011
|
+
completeFieldName
|
3012
|
+
);
|
2888
3013
|
}) }, index22);
|
2889
3014
|
})
|
2890
3015
|
}
|
@@ -2979,7 +3104,7 @@ const Component = ({
|
|
2979
3104
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2980
3105
|
designSystem.IconButton,
|
2981
3106
|
{
|
2982
|
-
|
3107
|
+
variant: "ghost",
|
2983
3108
|
onClick: onDeleteComponent,
|
2984
3109
|
label: formatMessage({
|
2985
3110
|
id: index.getTranslation("containers.Edit.delete"),
|
@@ -2992,7 +3117,7 @@ const Component = ({
|
|
2992
3117
|
designSystem.IconButton,
|
2993
3118
|
{
|
2994
3119
|
ref: composedAccordionRefs,
|
2995
|
-
|
3120
|
+
variant: "ghost",
|
2996
3121
|
onClick: (e) => e.stopPropagation(),
|
2997
3122
|
"data-handler-id": handlerId,
|
2998
3123
|
label: formatMessage({
|
@@ -3062,7 +3187,7 @@ const ComponentInput = ({
|
|
3062
3187
|
id: index.getTranslation("components.reset-entry"),
|
3063
3188
|
defaultMessage: "Reset Entry"
|
3064
3189
|
}),
|
3065
|
-
|
3190
|
+
variant: "ghost",
|
3066
3191
|
onClick: () => {
|
3067
3192
|
field.onChange(name2, null);
|
3068
3193
|
},
|
@@ -3091,19 +3216,16 @@ const AddComponentButton = ({
|
|
3091
3216
|
onClick,
|
3092
3217
|
disabled: isDisabled,
|
3093
3218
|
background: "neutral0",
|
3094
|
-
paddingTop: 3,
|
3095
|
-
paddingBottom: 3,
|
3096
|
-
paddingLeft: 4,
|
3097
|
-
paddingRight: 4,
|
3098
3219
|
style: { cursor: isDisabled ? "not-allowed" : "pointer" },
|
3220
|
+
variant: "tertiary",
|
3099
3221
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
|
3100
3222
|
/* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
|
3101
3223
|
/* @__PURE__ */ jsxRuntime.jsx(
|
3102
|
-
|
3224
|
+
designSystem.Typography,
|
3103
3225
|
{
|
3104
3226
|
variant: "pi",
|
3105
3227
|
fontWeight: "bold",
|
3106
|
-
textColor: hasError && !isOpen ? "danger600" : "
|
3228
|
+
textColor: hasError && !isOpen ? "danger600" : "neutral600",
|
3107
3229
|
children
|
3108
3230
|
}
|
3109
3231
|
)
|
@@ -3120,42 +3242,14 @@ const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
|
|
3120
3242
|
fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger200 : theme.colors.neutral150};
|
3121
3243
|
}
|
3122
3244
|
> path {
|
3123
|
-
fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.
|
3245
|
+
fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral500};
|
3124
3246
|
}
|
3125
3247
|
`;
|
3126
|
-
const
|
3127
|
-
|
3248
|
+
const StyledButton = styledComponents.styled(designSystem.Button)`
|
3249
|
+
padding-left: ${({ theme }) => theme.spaces[3]};
|
3128
3250
|
border-radius: 26px;
|
3129
|
-
border-color: ${({ theme }) => theme.colors.neutral150};
|
3130
3251
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
3131
|
-
|
3132
|
-
&:hover {
|
3133
|
-
${AddComponentTitle} {
|
3134
|
-
color: ${({ theme }) => theme.colors.primary600};
|
3135
|
-
}
|
3136
|
-
|
3137
|
-
${StyledAddIcon} {
|
3138
|
-
> circle {
|
3139
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
3140
|
-
}
|
3141
|
-
> path {
|
3142
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
3143
|
-
}
|
3144
|
-
}
|
3145
|
-
}
|
3146
|
-
&:active {
|
3147
|
-
${AddComponentTitle} {
|
3148
|
-
color: ${({ theme }) => theme.colors.primary600};
|
3149
|
-
}
|
3150
|
-
${StyledAddIcon} {
|
3151
|
-
> circle {
|
3152
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
3153
|
-
}
|
3154
|
-
> path {
|
3155
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
3156
|
-
}
|
3157
|
-
}
|
3158
|
-
}
|
3252
|
+
height: 5rem;
|
3159
3253
|
`;
|
3160
3254
|
const ComponentCategory = ({
|
3161
3255
|
category,
|
@@ -3270,18 +3364,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
3270
3364
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
3271
3365
|
] });
|
3272
3366
|
};
|
3273
|
-
function useDebounce(value, delay) {
|
3274
|
-
const [debouncedValue, setDebouncedValue] = React.useState(value);
|
3275
|
-
React.useEffect(() => {
|
3276
|
-
const handler = setTimeout(() => {
|
3277
|
-
setDebouncedValue(value);
|
3278
|
-
}, delay);
|
3279
|
-
return () => {
|
3280
|
-
clearTimeout(handler);
|
3281
|
-
};
|
3282
|
-
}, [value, delay]);
|
3283
|
-
return debouncedValue;
|
3284
|
-
}
|
3285
3367
|
const uidApi = index.contentManagerApi.injectEndpoints({
|
3286
3368
|
endpoints: (builder) => ({
|
3287
3369
|
getDefaultUID: builder.query({
|
@@ -3316,7 +3398,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
|
|
3316
3398
|
config: {
|
3317
3399
|
params
|
3318
3400
|
}
|
3319
|
-
})
|
3401
|
+
}),
|
3402
|
+
providesTags: (_res, _error, params) => [
|
3403
|
+
{ type: "UidAvailability", id: params.contentTypeUID }
|
3404
|
+
]
|
3320
3405
|
})
|
3321
3406
|
})
|
3322
3407
|
});
|
@@ -3328,8 +3413,10 @@ const UIDInput = React__namespace.forwardRef(
|
|
3328
3413
|
const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
|
3329
3414
|
const [availability, setAvailability] = React__namespace.useState();
|
3330
3415
|
const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
|
3416
|
+
const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
|
3331
3417
|
const field = strapiAdmin.useField(name2);
|
3332
|
-
const debouncedValue = useDebounce(field.value, 300);
|
3418
|
+
const debouncedValue = useDebounce.useDebounce(field.value, 300);
|
3419
|
+
const hasChanged = debouncedValue !== field.initialValue;
|
3333
3420
|
const { toggleNotification } = strapiAdmin.useNotification();
|
3334
3421
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
3335
3422
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -3405,8 +3492,9 @@ const UIDInput = React__namespace.forwardRef(
|
|
3405
3492
|
params
|
3406
3493
|
},
|
3407
3494
|
{
|
3495
|
+
// Don't check availability if the value is empty or wasn't changed
|
3408
3496
|
skip: !Boolean(
|
3409
|
-
|
3497
|
+
(hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
|
3410
3498
|
)
|
3411
3499
|
}
|
3412
3500
|
);
|
@@ -3435,6 +3523,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3435
3523
|
const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
|
3436
3524
|
const fieldRef = strapiAdmin.useFocusInputField(name2);
|
3437
3525
|
const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
|
3526
|
+
const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
|
3438
3527
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
|
3439
3528
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
|
3440
3529
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -3443,7 +3532,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3443
3532
|
ref: composedRefs,
|
3444
3533
|
disabled: props.disabled,
|
3445
3534
|
endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
|
3446
|
-
|
3535
|
+
shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
|
3447
3536
|
TextValidation,
|
3448
3537
|
{
|
3449
3538
|
alignItems: "center",
|
@@ -3732,8 +3821,7 @@ const Wrapper = styledComponents.styled.div`
|
|
3732
3821
|
`;
|
3733
3822
|
var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
|
3734
3823
|
function newlineAndIndentContinueMarkdownList(cm) {
|
3735
|
-
if (cm.getOption("disableInput"))
|
3736
|
-
return CodeMirror__default.default.Pass;
|
3824
|
+
if (cm.getOption("disableInput")) return CodeMirror__default.default.Pass;
|
3737
3825
|
var ranges = cm.listSelections(), replacements = [];
|
3738
3826
|
for (var i = 0; i < ranges.length; i++) {
|
3739
3827
|
var pos = ranges[i].head;
|
@@ -3767,8 +3855,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
|
|
3767
3855
|
var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
|
3768
3856
|
var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
|
3769
3857
|
replacements[i] = "\n" + indent + bullet + after;
|
3770
|
-
if (numbered)
|
3771
|
-
incrementRemainingMarkdownListNumbers(cm, pos);
|
3858
|
+
if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
|
3772
3859
|
}
|
3773
3860
|
}
|
3774
3861
|
cm.replaceSelections(replacements);
|
@@ -3786,10 +3873,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3786
3873
|
var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
|
3787
3874
|
var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
|
3788
3875
|
if (startIndent === nextIndent && !isNaN(nextNumber)) {
|
3789
|
-
if (newNumber === nextNumber)
|
3790
|
-
|
3791
|
-
if (newNumber > nextNumber)
|
3792
|
-
itemNumber = newNumber + 1;
|
3876
|
+
if (newNumber === nextNumber) itemNumber = nextNumber + 1;
|
3877
|
+
if (newNumber > nextNumber) itemNumber = newNumber + 1;
|
3793
3878
|
cm.replaceRange(
|
3794
3879
|
nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
|
3795
3880
|
{
|
@@ -3802,10 +3887,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3802
3887
|
}
|
3803
3888
|
);
|
3804
3889
|
} else {
|
3805
|
-
if (startIndent.length > nextIndent.length)
|
3806
|
-
|
3807
|
-
if (startIndent.length < nextIndent.length && lookAhead === 1)
|
3808
|
-
return;
|
3890
|
+
if (startIndent.length > nextIndent.length) return;
|
3891
|
+
if (startIndent.length < nextIndent.length && lookAhead === 1) return;
|
3809
3892
|
skipCount += 1;
|
3810
3893
|
}
|
3811
3894
|
}
|
@@ -4277,7 +4360,7 @@ const EditorLayout = ({
|
|
4277
4360
|
justifyContent: "flex-end",
|
4278
4361
|
shrink: 0,
|
4279
4362
|
width: "100%",
|
4280
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, children: [
|
4363
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
|
4281
4364
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
4282
4365
|
id: "components.Wysiwyg.collapse",
|
4283
4366
|
defaultMessage: "Collapse"
|
@@ -4295,12 +4378,14 @@ const EditorLayout = ({
|
|
4295
4378
|
) }) });
|
4296
4379
|
}
|
4297
4380
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4298
|
-
designSystem.
|
4381
|
+
designSystem.Flex,
|
4299
4382
|
{
|
4300
4383
|
borderColor: error ? "danger600" : "neutral200",
|
4301
4384
|
borderStyle: "solid",
|
4302
4385
|
borderWidth: "1px",
|
4303
4386
|
hasRadius: true,
|
4387
|
+
direction: "column",
|
4388
|
+
alignItems: "stretch",
|
4304
4389
|
children
|
4305
4390
|
}
|
4306
4391
|
);
|
@@ -4311,11 +4396,19 @@ const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
|
|
4311
4396
|
const BoxWithBorder = styledComponents.styled(designSystem.Box)`
|
4312
4397
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
4313
4398
|
`;
|
4314
|
-
const ExpandButton$1 = styledComponents.styled(designSystem.
|
4399
|
+
const ExpandButton$1 = styledComponents.styled(designSystem.Button)`
|
4315
4400
|
background-color: transparent;
|
4316
4401
|
border: none;
|
4317
4402
|
align-items: center;
|
4318
4403
|
|
4404
|
+
& > span {
|
4405
|
+
display: flex;
|
4406
|
+
justify-content: space-between;
|
4407
|
+
align-items: center;
|
4408
|
+
width: 100%;
|
4409
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4410
|
+
}
|
4411
|
+
|
4319
4412
|
svg {
|
4320
4413
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4321
4414
|
|
@@ -4582,40 +4675,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
|
|
4582
4675
|
insertWithoutTextToEdit(editor, markdownType, line, contentLength);
|
4583
4676
|
}
|
4584
4677
|
};
|
4585
|
-
const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
|
4586
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4587
|
-
|
4588
|
-
svg {
|
4589
|
-
width: 1.8rem;
|
4590
|
-
height: 1.8rem;
|
4591
|
-
}
|
4592
|
-
`;
|
4593
|
-
const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
|
4594
|
-
svg {
|
4595
|
-
width: 0.8rem;
|
4596
|
-
height: 0.8rem;
|
4597
|
-
}
|
4598
|
-
`;
|
4599
4678
|
const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
|
4600
4679
|
margin-left: ${({ theme }) => theme.spaces[4]};
|
4601
4680
|
`;
|
4602
4681
|
const MoreButton = styledComponents.styled(designSystem.IconButton)`
|
4603
4682
|
margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
|
4604
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4605
|
-
|
4606
|
-
svg {
|
4607
|
-
width: 1.8rem;
|
4608
|
-
height: 1.8rem;
|
4609
|
-
}
|
4610
4683
|
`;
|
4611
4684
|
const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
|
4612
4685
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
4613
4686
|
`;
|
4614
|
-
const ExpandButton = styledComponents.styled(designSystem.
|
4687
|
+
const ExpandButton = styledComponents.styled(designSystem.Button)`
|
4615
4688
|
background-color: transparent;
|
4616
4689
|
border: none;
|
4617
4690
|
align-items: center;
|
4618
4691
|
|
4692
|
+
& > span {
|
4693
|
+
display: flex;
|
4694
|
+
justify-content: space-between;
|
4695
|
+
align-items: center;
|
4696
|
+
width: 100%;
|
4697
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4698
|
+
}
|
4699
|
+
|
4619
4700
|
svg {
|
4620
4701
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4621
4702
|
path {
|
@@ -4627,7 +4708,7 @@ const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
|
|
4627
4708
|
`;
|
4628
4709
|
const WysiwygFooter = ({ onToggleExpand }) => {
|
4629
4710
|
const { formatMessage } = reactIntl.useIntl();
|
4630
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
|
4711
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
|
4631
4712
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
|
4632
4713
|
id: "components.WysiwygBottomControls.fullscreen",
|
4633
4714
|
defaultMessage: "Expand"
|
@@ -4664,18 +4745,27 @@ const WysiwygNav = ({
|
|
4664
4745
|
borderRadius: `0.4rem 0.4rem 0 0`,
|
4665
4746
|
children: [
|
4666
4747
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
4667
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4668
|
-
|
4669
|
-
|
4670
|
-
|
4671
|
-
|
4672
|
-
|
4673
|
-
|
4674
|
-
|
4748
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4749
|
+
designSystem.SingleSelect,
|
4750
|
+
{
|
4751
|
+
disabled: true,
|
4752
|
+
placeholder: selectPlaceholder,
|
4753
|
+
"aria-label": selectPlaceholder,
|
4754
|
+
size: "S",
|
4755
|
+
children: [
|
4756
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4757
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
4758
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
|
4759
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
|
4760
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
|
4761
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
|
4762
|
+
]
|
4763
|
+
}
|
4764
|
+
) }),
|
4675
4765
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4676
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4677
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4678
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4766
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4767
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
|
4768
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
|
4679
4769
|
] }),
|
4680
4770
|
/* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
|
4681
4771
|
] }),
|
@@ -4702,6 +4792,7 @@ const WysiwygNav = ({
|
|
4702
4792
|
placeholder: selectPlaceholder,
|
4703
4793
|
"aria-label": selectPlaceholder,
|
4704
4794
|
onChange: (value) => onActionClick(value, editorRef),
|
4795
|
+
size: "S",
|
4705
4796
|
children: [
|
4706
4797
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4707
4798
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
@@ -4713,17 +4804,9 @@ const WysiwygNav = ({
|
|
4713
4804
|
}
|
4714
4805
|
) }),
|
4715
4806
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4807
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4716
4808
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4717
|
-
|
4718
|
-
{
|
4719
|
-
onClick: () => onActionClick("Bold", editorRef),
|
4720
|
-
label: "Bold",
|
4721
|
-
name: "Bold",
|
4722
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
|
4723
|
-
}
|
4724
|
-
),
|
4725
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4726
|
-
CustomIconButton,
|
4809
|
+
designSystem.IconButton,
|
4727
4810
|
{
|
4728
4811
|
onClick: () => onActionClick("Italic", editorRef),
|
4729
4812
|
label: "Italic",
|
@@ -4732,7 +4815,7 @@ const WysiwygNav = ({
|
|
4732
4815
|
}
|
4733
4816
|
),
|
4734
4817
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4735
|
-
|
4818
|
+
designSystem.IconButton,
|
4736
4819
|
{
|
4737
4820
|
onClick: () => onActionClick("Underline", editorRef),
|
4738
4821
|
label: "Underline",
|
@@ -4746,7 +4829,7 @@ const WysiwygNav = ({
|
|
4746
4829
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
|
4747
4830
|
/* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
|
4748
4831
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4749
|
-
|
4832
|
+
designSystem.IconButton,
|
4750
4833
|
{
|
4751
4834
|
onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
|
4752
4835
|
label: "Strikethrough",
|
@@ -4755,7 +4838,7 @@ const WysiwygNav = ({
|
|
4755
4838
|
}
|
4756
4839
|
),
|
4757
4840
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4758
|
-
|
4841
|
+
designSystem.IconButton,
|
4759
4842
|
{
|
4760
4843
|
onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
|
4761
4844
|
label: "BulletList",
|
@@ -4764,7 +4847,7 @@ const WysiwygNav = ({
|
|
4764
4847
|
}
|
4765
4848
|
),
|
4766
4849
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4767
|
-
|
4850
|
+
designSystem.IconButton,
|
4768
4851
|
{
|
4769
4852
|
onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
|
4770
4853
|
label: "NumberList",
|
@@ -4775,7 +4858,7 @@ const WysiwygNav = ({
|
|
4775
4858
|
] }),
|
4776
4859
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
|
4777
4860
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4778
|
-
|
4861
|
+
designSystem.IconButton,
|
4779
4862
|
{
|
4780
4863
|
onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
|
4781
4864
|
label: "Code",
|
@@ -4784,7 +4867,7 @@ const WysiwygNav = ({
|
|
4784
4867
|
}
|
4785
4868
|
),
|
4786
4869
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4787
|
-
|
4870
|
+
designSystem.IconButton,
|
4788
4871
|
{
|
4789
4872
|
onClick: () => {
|
4790
4873
|
handleTogglePopover();
|
@@ -4796,7 +4879,7 @@ const WysiwygNav = ({
|
|
4796
4879
|
}
|
4797
4880
|
),
|
4798
4881
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4799
|
-
|
4882
|
+
designSystem.IconButton,
|
4800
4883
|
{
|
4801
4884
|
onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
|
4802
4885
|
label: "Link",
|
@@ -4805,7 +4888,7 @@ const WysiwygNav = ({
|
|
4805
4888
|
}
|
4806
4889
|
),
|
4807
4890
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4808
|
-
|
4891
|
+
designSystem.IconButton,
|
4809
4892
|
{
|
4810
4893
|
onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
|
4811
4894
|
label: "Quote",
|
@@ -4883,7 +4966,7 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4883
4966
|
const handleSelectAssets = (files) => {
|
4884
4967
|
const formattedFiles = files.map((f) => ({
|
4885
4968
|
alt: f.alternativeText || f.name,
|
4886
|
-
url:
|
4969
|
+
url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
|
4887
4970
|
mime: f.mime
|
4888
4971
|
}));
|
4889
4972
|
insertFile(editorRef, formattedFiles);
|
@@ -4942,15 +5025,19 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4942
5025
|
);
|
4943
5026
|
const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
|
4944
5027
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4945
|
-
const { id } = index.useDoc();
|
5028
|
+
const { id, document: document2, collectionType } = index.useDoc();
|
4946
5029
|
const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
|
4947
5030
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4948
5031
|
const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4949
5032
|
const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4950
5033
|
const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4951
5034
|
const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4952
|
-
|
4953
|
-
|
5035
|
+
let idToCheck = id;
|
5036
|
+
if (collectionType === index.SINGLE_TYPES) {
|
5037
|
+
idToCheck = document2?.documentId;
|
5038
|
+
}
|
5039
|
+
const editableFields = idToCheck ? canUpdateFields : canCreateFields;
|
5040
|
+
const readableFields = idToCheck ? canReadFields : canCreateFields;
|
4954
5041
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4955
5042
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4956
5043
|
const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4961,6 +5048,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4961
5048
|
const {
|
4962
5049
|
edit: { components }
|
4963
5050
|
} = index.useDocLayout();
|
5051
|
+
const field = strapiAdmin.useField(props.name);
|
4964
5052
|
if (!visible) {
|
4965
5053
|
return null;
|
4966
5054
|
}
|
@@ -4971,7 +5059,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4971
5059
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4972
5060
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4973
5061
|
if (CustomInput) {
|
4974
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
5062
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4975
5063
|
}
|
4976
5064
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4977
5065
|
strapiAdmin.InputRenderer,
|
@@ -5132,12 +5220,20 @@ const DynamicComponent = ({
|
|
5132
5220
|
React__namespace.useEffect(() => {
|
5133
5221
|
dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
|
5134
5222
|
}, [dragPreviewRef, index$1]);
|
5223
|
+
const accordionValue = React__namespace.useId();
|
5224
|
+
const { value = [], rawError } = strapiAdmin.useField(`${name2}.${index$1}`);
|
5225
|
+
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
|
5226
|
+
React__namespace.useEffect(() => {
|
5227
|
+
if (rawError && value) {
|
5228
|
+
setCollapseToOpen(accordionValue);
|
5229
|
+
}
|
5230
|
+
}, [rawError, value, accordionValue]);
|
5135
5231
|
const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
|
5136
5232
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
5137
5233
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5138
5234
|
designSystem.IconButton,
|
5139
5235
|
{
|
5140
|
-
|
5236
|
+
variant: "ghost",
|
5141
5237
|
label: formatMessage(
|
5142
5238
|
{
|
5143
5239
|
id: index.getTranslation("components.DynamicZone.delete-label"),
|
@@ -5152,7 +5248,7 @@ const DynamicComponent = ({
|
|
5152
5248
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5153
5249
|
designSystem.IconButton,
|
5154
5250
|
{
|
5155
|
-
|
5251
|
+
variant: "ghost",
|
5156
5252
|
onClick: (e) => e.stopPropagation(),
|
5157
5253
|
"data-handler-id": handlerId,
|
5158
5254
|
ref: dragRef,
|
@@ -5197,10 +5293,9 @@ const DynamicComponent = ({
|
|
5197
5293
|
] })
|
5198
5294
|
] });
|
5199
5295
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5200
|
-
const accordionValue = React__namespace.useId();
|
5201
5296
|
return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5202
5297
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
|
5203
|
-
/* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
|
5298
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
|
5204
5299
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
|
5205
5300
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5206
5301
|
designSystem.Accordion.Trigger,
|
@@ -5211,10 +5306,39 @@ const DynamicComponent = ({
|
|
5211
5306
|
),
|
5212
5307
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
|
5213
5308
|
] }),
|
5214
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children:
|
5215
|
-
|
5216
|
-
|
5217
|
-
|
5309
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(
|
5310
|
+
designSystem.Grid.Item,
|
5311
|
+
{
|
5312
|
+
col: 12,
|
5313
|
+
s: 12,
|
5314
|
+
xs: 12,
|
5315
|
+
direction: "column",
|
5316
|
+
alignItems: "stretch",
|
5317
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5318
|
+
const fieldName = `${name2}.${index$1}.${field.name}`;
|
5319
|
+
const fieldWithTranslatedLabel = {
|
5320
|
+
...field,
|
5321
|
+
label: formatMessage({
|
5322
|
+
id: `content-manager.components.${componentUid}.${field.name}`,
|
5323
|
+
defaultMessage: field.label
|
5324
|
+
})
|
5325
|
+
};
|
5326
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
5327
|
+
designSystem.Grid.Item,
|
5328
|
+
{
|
5329
|
+
col: size,
|
5330
|
+
s: 12,
|
5331
|
+
xs: 12,
|
5332
|
+
direction: "column",
|
5333
|
+
alignItems: "stretch",
|
5334
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
|
5335
|
+
},
|
5336
|
+
fieldName
|
5337
|
+
);
|
5338
|
+
}) })
|
5339
|
+
},
|
5340
|
+
rowInd
|
5341
|
+
)) }) }) }) })
|
5218
5342
|
] }) }) })
|
5219
5343
|
] });
|
5220
5344
|
};
|
@@ -5520,4 +5644,4 @@ exports.transformDocument = transformDocument;
|
|
5520
5644
|
exports.useDynamicZone = useDynamicZone;
|
5521
5645
|
exports.useFieldHint = useFieldHint;
|
5522
5646
|
exports.useLazyComponents = useLazyComponents;
|
5523
|
-
//# sourceMappingURL=Field-
|
5647
|
+
//# sourceMappingURL=Field-kYFVIGiP.js.map
|