@strapi/content-manager 0.0.0-experimental.e14656d3b8681880212c13260b9a2b340c182f2d → 0.0.0-experimental.e350eaa6073e65190102b4b798c32c287053cc02
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-D_M8iBw5.js → ComponentConfigurationPage-BTR_hQow.js} +5 -6
- package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js.map → ComponentConfigurationPage-BTR_hQow.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs → ComponentConfigurationPage-bLQr82ce.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs.map → ComponentConfigurationPage-bLQr82ce.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-CjUrEewK.mjs → EditConfigurationPage-BhRSnUsL.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs.map → EditConfigurationPage-BhRSnUsL.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js → EditConfigurationPage-z39Wv3E6.js} +5 -6
- package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js.map → EditConfigurationPage-z39Wv3E6.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-De8GyU8P.mjs → EditViewPage-BCjNxNlY.mjs} +50 -10
- package/dist/_chunks/EditViewPage-BCjNxNlY.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-B-RJeiJD.js → EditViewPage-wujOq90c.js} +50 -11
- package/dist/_chunks/EditViewPage-wujOq90c.js.map +1 -0
- package/dist/_chunks/{Field-dq8Tg1M_.js → Field-B5QXnctJ.js} +238 -153
- package/dist/_chunks/Field-B5QXnctJ.js.map +1 -0
- package/dist/_chunks/{Field-pb2o8uBe.mjs → Field-Byr3mPTl.mjs} +232 -147
- package/dist/_chunks/Field-Byr3mPTl.mjs.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-DJn0Dxha.mjs → Form-BZgvE8C8.mjs} +17 -9
- package/dist/_chunks/Form-BZgvE8C8.mjs.map +1 -0
- package/dist/_chunks/{Form-DGIf4jQU.js → Form-D7mexvm3.js} +19 -12
- package/dist/_chunks/Form-D7mexvm3.js.map +1 -0
- package/dist/_chunks/{History-BowL3JKP.mjs → History-CqNgxkqK.mjs} +43 -100
- package/dist/_chunks/History-CqNgxkqK.mjs.map +1 -0
- package/dist/_chunks/{History-Dh2NEHnR.js → History-DYl2A8Z_.js} +42 -100
- package/dist/_chunks/History-DYl2A8Z_.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BxYCWz9e.js → ListConfigurationPage-BXnu_OoY.js} +7 -7
- package/dist/_chunks/ListConfigurationPage-BXnu_OoY.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BpVOB-hn.mjs → ListConfigurationPage-BbQjzKkQ.mjs} +7 -6
- package/dist/_chunks/ListConfigurationPage-BbQjzKkQ.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-4XsciqHZ.js → ListViewPage-BtSi8C1l.js} +103 -77
- package/dist/_chunks/ListViewPage-BtSi8C1l.js.map +1 -0
- package/dist/_chunks/{ListViewPage-CXFUjZQC.mjs → ListViewPage-D4ofkbjR.mjs} +99 -72
- package/dist/_chunks/ListViewPage-D4ofkbjR.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js → NoContentTypePage-CitJeOq4.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js.map → NoContentTypePage-CitJeOq4.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs → NoContentTypePage-DyUx5mXh.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs.map → NoContentTypePage-DyUx5mXh.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs → NoPermissionsPage-DhIiyWkk.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs.map → NoPermissionsPage-DhIiyWkk.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js → NoPermissionsPage-DzgWz0M-.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js.map → NoPermissionsPage-DzgWz0M-.js.map} +1 -1
- package/dist/_chunks/Preview-BaYGJ0nb.mjs +293 -0
- package/dist/_chunks/Preview-BaYGJ0nb.mjs.map +1 -0
- package/dist/_chunks/Preview-DfNx8Ke-.js +311 -0
- package/dist/_chunks/Preview-DfNx8Ke-.js.map +1 -0
- package/dist/_chunks/{Relations-CVNLrn1Y.mjs → Relations-DM2yUTST.mjs} +75 -41
- package/dist/_chunks/Relations-DM2yUTST.mjs.map +1 -0
- package/dist/_chunks/{Relations-DPFCAa7b.js → Relations-DuKCaXrv.js} +75 -42
- package/dist/_chunks/Relations-DuKCaXrv.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-C3fJE-1-.js → index-BUWEmX8m.js} +1273 -996
- package/dist/_chunks/index-BUWEmX8m.js.map +1 -0
- package/dist/_chunks/{index-DiMrfcfy.mjs → index-DVAIIsOs.mjs} +1276 -999
- package/dist/_chunks/index-DVAIIsOs.mjs.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-ls3gxfpH.mjs → layout-Bxsv5mP7.mjs} +6 -5
- package/dist/_chunks/{layout-ls3gxfpH.mjs.map → layout-Bxsv5mP7.mjs.map} +1 -1
- package/dist/_chunks/{layout-C788OmNr.js → layout-C3fN7Ejz.js} +7 -7
- package/dist/_chunks/{layout-C788OmNr.js.map → layout-C3fN7Ejz.js.map} +1 -1
- 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-DYeotliT.js → relations-BPZKAoEY.js} +6 -7
- package/dist/_chunks/relations-BPZKAoEY.js.map +1 -0
- package/dist/_chunks/{relations-CLcOmGO0.mjs → relations-o3pPhzY4.mjs} +6 -7
- package/dist/_chunks/relations-o3pPhzY4.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 +4 -3
- package/dist/admin/src/content-manager.d.ts +3 -2
- package/dist/admin/src/exports.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/WysiwygStyles.d.ts +0 -32
- 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/documents.d.ts +3 -4
- package/dist/server/index.js +453 -201
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +453 -200
- 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 +15 -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 +3 -3
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +4 -4
- 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 +8 -8
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +4 -4
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
- package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
- 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-B-RJeiJD.js.map +0 -1
- package/dist/_chunks/EditViewPage-De8GyU8P.mjs.map +0 -1
- package/dist/_chunks/Field-dq8Tg1M_.js.map +0 -1
- package/dist/_chunks/Field-pb2o8uBe.mjs.map +0 -1
- package/dist/_chunks/Form-DGIf4jQU.js.map +0 -1
- package/dist/_chunks/Form-DJn0Dxha.mjs.map +0 -1
- package/dist/_chunks/History-BowL3JKP.mjs.map +0 -1
- package/dist/_chunks/History-Dh2NEHnR.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-BpVOB-hn.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-BxYCWz9e.js.map +0 -1
- package/dist/_chunks/ListViewPage-4XsciqHZ.js.map +0 -1
- package/dist/_chunks/ListViewPage-CXFUjZQC.mjs.map +0 -1
- package/dist/_chunks/Relations-CVNLrn1Y.mjs.map +0 -1
- package/dist/_chunks/Relations-DPFCAa7b.js.map +0 -1
- package/dist/_chunks/index-C3fJE-1-.js.map +0 -1
- package/dist/_chunks/index-DiMrfcfy.mjs.map +0 -1
- package/dist/_chunks/relations-CLcOmGO0.mjs.map +0 -1
- package/dist/_chunks/relations-DYeotliT.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 @@ import { useStrapiApp, createContext, useField, useNotification, useForm, useAPI
|
|
5
5
|
import { Box, SingleSelect, SingleSelectOption, Typography, Flex, BaseLink, Button, Popover, Field, Tooltip, IconButton, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, Accordion, TextButton, TextInput, IconButtonGroup, Menu, MenuItem } from "@strapi/design-system";
|
6
6
|
import pipe$1 from "lodash/fp/pipe";
|
7
7
|
import { useIntl } from "react-intl";
|
8
|
-
import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, o as useDocLayout } from "./index-
|
8
|
+
import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, S as SINGLE_TYPES, o as useDocLayout } from "./index-DVAIIsOs.mjs";
|
9
9
|
import { generateNKeysBetween } from "fractional-indexing";
|
10
|
-
import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-
|
11
|
-
import {
|
10
|
+
import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-DM2yUTST.mjs";
|
11
|
+
import { CodeBlock as CodeBlock$1, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Code, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
|
12
12
|
import { styled, css, keyframes } from "styled-components";
|
13
13
|
import { C as ComponentIcon, a as COMPONENT_ICONS } from "./ComponentIcon-u4bIXTFY.mjs";
|
14
14
|
import { getEmptyImage } from "react-dnd-html5-backend";
|
15
|
-
import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-
|
16
|
-
import { g as getIn } from "./objects-
|
15
|
+
import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DJ6jqvZN.mjs";
|
16
|
+
import { g as getIn } from "./objects-D6yBsdmx.mjs";
|
17
17
|
import { Editor as Editor$1, Transforms, Node, Element, Range, Path, Point, createEditor } from "slate";
|
18
18
|
import { withHistory } from "slate-history";
|
19
19
|
import { useFocused, useSelected, ReactEditor, Editable, useSlate, Slate, withReact } from "slate-react";
|
20
|
-
import
|
20
|
+
import * as Prism from "prismjs";
|
21
|
+
import "prismjs/themes/prism-solarizedlight.css";
|
22
|
+
import "prismjs/components/prism-asmatmel";
|
23
|
+
import "prismjs/components/prism-bash";
|
24
|
+
import "prismjs/components/prism-basic";
|
25
|
+
import "prismjs/components/prism-c";
|
26
|
+
import "prismjs/components/prism-clojure";
|
27
|
+
import "prismjs/components/prism-cobol";
|
28
|
+
import "prismjs/components/prism-cpp";
|
29
|
+
import "prismjs/components/prism-csharp";
|
30
|
+
import "prismjs/components/prism-dart";
|
31
|
+
import "prismjs/components/prism-docker";
|
32
|
+
import "prismjs/components/prism-elixir";
|
33
|
+
import "prismjs/components/prism-erlang";
|
34
|
+
import "prismjs/components/prism-fortran";
|
35
|
+
import "prismjs/components/prism-fsharp";
|
36
|
+
import "prismjs/components/prism-go";
|
37
|
+
import "prismjs/components/prism-graphql";
|
38
|
+
import "prismjs/components/prism-groovy";
|
39
|
+
import "prismjs/components/prism-haskell";
|
40
|
+
import "prismjs/components/prism-haxe";
|
41
|
+
import "prismjs/components/prism-ini";
|
42
|
+
import "prismjs/components/prism-java";
|
43
|
+
import "prismjs/components/prism-javascript";
|
44
|
+
import "prismjs/components/prism-jsx";
|
45
|
+
import "prismjs/components/prism-json";
|
46
|
+
import "prismjs/components/prism-julia";
|
47
|
+
import "prismjs/components/prism-kotlin";
|
48
|
+
import "prismjs/components/prism-latex";
|
49
|
+
import "prismjs/components/prism-lua";
|
50
|
+
import "prismjs/components/prism-markdown";
|
51
|
+
import "prismjs/components/prism-matlab";
|
52
|
+
import "prismjs/components/prism-makefile";
|
53
|
+
import "prismjs/components/prism-objectivec";
|
54
|
+
import "prismjs/components/prism-perl";
|
55
|
+
import "prismjs/components/prism-php";
|
56
|
+
import "prismjs/components/prism-powershell";
|
57
|
+
import "prismjs/components/prism-python";
|
58
|
+
import "prismjs/components/prism-r";
|
59
|
+
import "prismjs/components/prism-ruby";
|
60
|
+
import "prismjs/components/prism-rust";
|
61
|
+
import "prismjs/components/prism-sas";
|
62
|
+
import "prismjs/components/prism-scala";
|
63
|
+
import "prismjs/components/prism-scheme";
|
64
|
+
import "prismjs/components/prism-sql";
|
65
|
+
import "prismjs/components/prism-stata";
|
66
|
+
import "prismjs/components/prism-swift";
|
67
|
+
import "prismjs/components/prism-typescript";
|
68
|
+
import "prismjs/components/prism-tsx";
|
69
|
+
import "prismjs/components/prism-vbnet";
|
70
|
+
import "prismjs/components/prism-yaml";
|
71
|
+
import { p as prefixFileUrlWithBackendUrl, u as usePrev, a as useDebounce } from "./useDebounce-DmuSJIF3.mjs";
|
21
72
|
import * as Toolbar from "@radix-ui/react-toolbar";
|
22
73
|
import { useLocation, useMatch } from "react-router-dom";
|
23
74
|
import CodeMirror from "codemirror5";
|
@@ -163,7 +214,8 @@ const useLazyComponents = (componentUids = []) => {
|
|
163
214
|
const codeLanguages = [
|
164
215
|
{
|
165
216
|
value: "asm",
|
166
|
-
label: "Assembly"
|
217
|
+
label: "Assembly",
|
218
|
+
decorate: "asmatmel"
|
167
219
|
},
|
168
220
|
{
|
169
221
|
value: "bash",
|
@@ -199,7 +251,8 @@ const codeLanguages = [
|
|
199
251
|
},
|
200
252
|
{
|
201
253
|
value: "dockerfile",
|
202
|
-
label: "Dockerfile"
|
254
|
+
label: "Dockerfile",
|
255
|
+
decorate: "docker"
|
203
256
|
},
|
204
257
|
{
|
205
258
|
value: "elixir",
|
@@ -355,7 +408,8 @@ const codeLanguages = [
|
|
355
408
|
},
|
356
409
|
{
|
357
410
|
value: "typescript",
|
358
|
-
label: "TypeScript"
|
411
|
+
label: "TypeScript",
|
412
|
+
decorate: "ts"
|
359
413
|
},
|
360
414
|
{
|
361
415
|
value: "tsx",
|
@@ -371,7 +425,8 @@ const codeLanguages = [
|
|
371
425
|
},
|
372
426
|
{
|
373
427
|
value: "yaml",
|
374
|
-
label: "YAML"
|
428
|
+
label: "YAML",
|
429
|
+
decorate: "yml"
|
375
430
|
}
|
376
431
|
];
|
377
432
|
const baseHandleConvert = (editor, attributesToSet) => {
|
@@ -437,6 +492,29 @@ const pressEnterTwiceToExit = (editor) => {
|
|
437
492
|
});
|
438
493
|
}
|
439
494
|
};
|
495
|
+
const decorateCode = ([node, path]) => {
|
496
|
+
const ranges = [];
|
497
|
+
if (!Element.isElement(node) || node.type !== "code") return ranges;
|
498
|
+
const text = Node.string(node);
|
499
|
+
const language = codeLanguages.find((lang) => lang.value === node.language);
|
500
|
+
const decorateKey = language?.decorate ?? language?.value;
|
501
|
+
const selectedLanguage = Prism.languages[decorateKey || "plaintext"];
|
502
|
+
const tokens = Prism.tokenize(text, selectedLanguage);
|
503
|
+
let start = 0;
|
504
|
+
for (const token of tokens) {
|
505
|
+
const length = token.length;
|
506
|
+
const end = start + length;
|
507
|
+
if (typeof token !== "string") {
|
508
|
+
ranges.push({
|
509
|
+
anchor: { path, offset: start },
|
510
|
+
focus: { path, offset: end },
|
511
|
+
className: `token ${token.type}`
|
512
|
+
});
|
513
|
+
}
|
514
|
+
start = end;
|
515
|
+
}
|
516
|
+
return ranges;
|
517
|
+
};
|
440
518
|
const CodeBlock = styled.pre`
|
441
519
|
border-radius: ${({ theme }) => theme.borderRadius};
|
442
520
|
background-color: ${({ theme }) => theme.colors.neutral100};
|
@@ -508,7 +586,7 @@ const CodeEditor = (props) => {
|
|
508
586
|
const codeBlocks = {
|
509
587
|
code: {
|
510
588
|
renderElement: (props) => /* @__PURE__ */ jsx(CodeEditor, { ...props }),
|
511
|
-
icon:
|
589
|
+
icon: CodeBlock$1,
|
512
590
|
label: {
|
513
591
|
id: "components.Blocks.blocks.code",
|
514
592
|
defaultMessage: "Code block"
|
@@ -697,8 +775,7 @@ const ImageDialog = () => {
|
|
697
775
|
const [isOpen, setIsOpen] = React.useState(true);
|
698
776
|
const { editor } = useBlocksEditorContext("ImageDialog");
|
699
777
|
const components = useStrapiApp("ImageDialog", (state) => state.components);
|
700
|
-
if (!components || !isOpen)
|
701
|
-
return null;
|
778
|
+
if (!components || !isOpen) return null;
|
702
779
|
const MediaLibraryDialog = components["media-library"];
|
703
780
|
const insertImages = (images) => {
|
704
781
|
Transforms.unwrapNodes(editor, {
|
@@ -707,14 +784,12 @@ const ImageDialog = () => {
|
|
707
784
|
});
|
708
785
|
const nodeEntryBeingReplaced = Editor$1.above(editor, {
|
709
786
|
match(node) {
|
710
|
-
if (Editor$1.isEditor(node))
|
711
|
-
return false;
|
787
|
+
if (Editor$1.isEditor(node)) return false;
|
712
788
|
const isInlineNode = ["text", "link"].includes(node.type);
|
713
789
|
return !isInlineNode;
|
714
790
|
}
|
715
791
|
});
|
716
|
-
if (!nodeEntryBeingReplaced)
|
717
|
-
return;
|
792
|
+
if (!nodeEntryBeingReplaced) return;
|
718
793
|
const [, pathToInsert] = nodeEntryBeingReplaced;
|
719
794
|
Transforms.removeNodes(editor);
|
720
795
|
const nodesToInsert = images.map((image) => {
|
@@ -892,8 +967,7 @@ const LinkContent = React.forwardRef(
|
|
892
967
|
ReactEditor.focus(editor);
|
893
968
|
};
|
894
969
|
React.useEffect(() => {
|
895
|
-
if (popoverOpen)
|
896
|
-
linkInputRef.current?.focus();
|
970
|
+
if (popoverOpen) linkInputRef.current?.focus();
|
897
971
|
}, [popoverOpen]);
|
898
972
|
const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
|
899
973
|
return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
|
@@ -963,11 +1037,11 @@ const LinkContent = React.forwardRef(
|
|
963
1037
|
),
|
964
1038
|
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
965
1039
|
/* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
|
966
|
-
id: "
|
1040
|
+
id: "global.cancel",
|
967
1041
|
defaultMessage: "Cancel"
|
968
1042
|
}) }),
|
969
1043
|
/* @__PURE__ */ jsx(Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
|
970
|
-
id: "
|
1044
|
+
id: "global.save",
|
971
1045
|
defaultMessage: "Save"
|
972
1046
|
}) })
|
973
1047
|
] })
|
@@ -1048,8 +1122,7 @@ const isText$1 = (node) => {
|
|
1048
1122
|
return Node.isNode(node) && !Editor$1.isEditor(node) && node.type === "text";
|
1049
1123
|
};
|
1050
1124
|
const handleBackspaceKeyOnList = (editor, event) => {
|
1051
|
-
if (!editor.selection)
|
1052
|
-
return;
|
1125
|
+
if (!editor.selection) return;
|
1053
1126
|
const [currentListItem, currentListItemPath] = Editor$1.parent(editor, editor.selection.anchor);
|
1054
1127
|
const [currentList, currentListPath] = Editor$1.parent(editor, currentListItemPath);
|
1055
1128
|
const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
|
@@ -1158,8 +1231,7 @@ const handleEnterKeyOnList = (editor) => {
|
|
1158
1231
|
};
|
1159
1232
|
const handleConvertToList = (editor, format) => {
|
1160
1233
|
const convertedPath = baseHandleConvert(editor, { type: "list-item" });
|
1161
|
-
if (!convertedPath)
|
1162
|
-
return;
|
1234
|
+
if (!convertedPath) return;
|
1163
1235
|
Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
|
1164
1236
|
};
|
1165
1237
|
const handleTabOnList = (editor) => {
|
@@ -1171,8 +1243,7 @@ const handleTabOnList = (editor) => {
|
|
1171
1243
|
}
|
1172
1244
|
const [currentListItem, currentListItemPath] = currentListItemEntry;
|
1173
1245
|
const [currentList] = Editor$1.parent(editor, currentListItemPath);
|
1174
|
-
if (currentListItem === currentList.children[0])
|
1175
|
-
return;
|
1246
|
+
if (currentListItem === currentList.children[0]) return;
|
1176
1247
|
const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
|
1177
1248
|
const previousNode = currentList.children[currentListItemIndex - 1];
|
1178
1249
|
if (previousNode.type === "list") {
|
@@ -1407,7 +1478,7 @@ const ToolbarButton = ({
|
|
1407
1478
|
width: 7,
|
1408
1479
|
height: 7,
|
1409
1480
|
hasRadius: true,
|
1410
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
1481
|
+
children: /* @__PURE__ */ jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
|
1411
1482
|
}
|
1412
1483
|
)
|
1413
1484
|
}
|
@@ -1539,8 +1610,7 @@ const isListNode = (node) => {
|
|
1539
1610
|
const ListButton = ({ block, format }) => {
|
1540
1611
|
const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
|
1541
1612
|
const isListActive = () => {
|
1542
|
-
if (!editor.selection)
|
1543
|
-
return false;
|
1613
|
+
if (!editor.selection) return false;
|
1544
1614
|
const currentListEntry = Editor$1.above(editor, {
|
1545
1615
|
match: (node) => !Editor$1.isEditor(node) && node.type === "list",
|
1546
1616
|
at: editor.selection.anchor
|
@@ -1614,8 +1684,7 @@ const LinkButton = ({ disabled }) => {
|
|
1614
1684
|
const { editor } = useBlocksEditorContext("LinkButton");
|
1615
1685
|
const isLinkActive = () => {
|
1616
1686
|
const { selection } = editor;
|
1617
|
-
if (!selection)
|
1618
|
-
return false;
|
1687
|
+
if (!selection) return false;
|
1619
1688
|
const [match] = Array.from(
|
1620
1689
|
Editor$1.nodes(editor, {
|
1621
1690
|
at: Editor$1.unhangRange(editor, selection),
|
@@ -1749,6 +1818,7 @@ const DragItem = styled(Flex)`
|
|
1749
1818
|
}
|
1750
1819
|
`;
|
1751
1820
|
const DragIconButton = styled(IconButton)`
|
1821
|
+
user-select: none;
|
1752
1822
|
display: flex;
|
1753
1823
|
align-items: center;
|
1754
1824
|
justify-content: center;
|
@@ -1820,8 +1890,7 @@ const DragAndDropElement = ({
|
|
1820
1890
|
displayedValue: children
|
1821
1891
|
},
|
1822
1892
|
onDropItem(currentIndex, newIndex) {
|
1823
|
-
if (newIndex)
|
1824
|
-
handleMoveBlock(newIndex, currentIndex);
|
1893
|
+
if (newIndex) handleMoveBlock(newIndex, currentIndex);
|
1825
1894
|
}
|
1826
1895
|
});
|
1827
1896
|
const composedBoxRefs = useComposedRefs(blockRef, dropRef);
|
@@ -1877,6 +1946,7 @@ const DragAndDropElement = ({
|
|
1877
1946
|
DragIconButton,
|
1878
1947
|
{
|
1879
1948
|
tag: "div",
|
1949
|
+
contentEditable: false,
|
1880
1950
|
role: "button",
|
1881
1951
|
tabIndex: 0,
|
1882
1952
|
withTooltip: false,
|
@@ -1926,7 +1996,7 @@ const baseRenderLeaf = (props, modifiers2) => {
|
|
1926
1996
|
}
|
1927
1997
|
return currentChildren;
|
1928
1998
|
}, props.children);
|
1929
|
-
return /* @__PURE__ */ jsx("span", { ...props.attributes, children: wrappedChildren });
|
1999
|
+
return /* @__PURE__ */ jsx("span", { ...props.attributes, className: props.leaf.className, children: wrappedChildren });
|
1930
2000
|
};
|
1931
2001
|
const baseRenderElement = ({
|
1932
2002
|
props,
|
@@ -1964,8 +2034,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
1964
2034
|
[modifiers2]
|
1965
2035
|
);
|
1966
2036
|
const handleMoveBlocks = (editor2, event) => {
|
1967
|
-
if (!editor2.selection)
|
1968
|
-
return;
|
2037
|
+
if (!editor2.selection) return;
|
1969
2038
|
const start = Range.start(editor2.selection);
|
1970
2039
|
const currentIndex = [start.path[0]];
|
1971
2040
|
let newIndexPosition = 0;
|
@@ -2102,8 +2171,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2102
2171
|
}
|
2103
2172
|
};
|
2104
2173
|
const handleScrollSelectionIntoView = () => {
|
2105
|
-
if (!editor.selection)
|
2106
|
-
return;
|
2174
|
+
if (!editor.selection) return;
|
2107
2175
|
const domRange = ReactEditor.toDOMRange(editor, editor.selection);
|
2108
2176
|
const domRect = domRange.getBoundingClientRect();
|
2109
2177
|
const blocksInput = blocksRef.current;
|
@@ -2141,6 +2209,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2141
2209
|
readOnly: disabled,
|
2142
2210
|
placeholder,
|
2143
2211
|
isExpandedMode,
|
2212
|
+
decorate: decorateCode,
|
2144
2213
|
renderElement,
|
2145
2214
|
renderLeaf,
|
2146
2215
|
onKeyDown: handleKeyDown,
|
@@ -2297,8 +2366,7 @@ const InlineCode = styled.code`
|
|
2297
2366
|
`;
|
2298
2367
|
const baseCheckIsActive = (editor, name2) => {
|
2299
2368
|
const marks = Editor$1.marks(editor);
|
2300
|
-
if (!marks)
|
2301
|
-
return false;
|
2369
|
+
if (!marks) return false;
|
2302
2370
|
return Boolean(marks[name2]);
|
2303
2371
|
};
|
2304
2372
|
const baseHandleToggle = (editor, name2) => {
|
@@ -2622,7 +2690,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2622
2690
|
Box,
|
2623
2691
|
{
|
2624
2692
|
tag: "button",
|
2625
|
-
background: "neutral100",
|
2693
|
+
background: disabled ? "neutral150" : "neutral100",
|
2626
2694
|
borderColor: field.error ? "danger600" : "neutral200",
|
2627
2695
|
hasRadius: true,
|
2628
2696
|
disabled,
|
@@ -2630,32 +2698,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2630
2698
|
paddingTop: 9,
|
2631
2699
|
paddingBottom: 9,
|
2632
2700
|
type: "button",
|
2701
|
+
style: { cursor: disabled ? "not-allowed" : "pointer" },
|
2633
2702
|
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
2634
|
-
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2635
|
-
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2703
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsx(PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
|
2704
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2705
|
+
Typography,
|
2706
|
+
{
|
2707
|
+
textColor: disabled ? "neutral600" : "primary600",
|
2708
|
+
variant: "pi",
|
2709
|
+
fontWeight: "bold",
|
2710
|
+
children: formatMessage({
|
2711
|
+
id: getTranslation("components.empty-repeatable"),
|
2712
|
+
defaultMessage: "No entry yet. Click to add one."
|
2713
|
+
})
|
2714
|
+
}
|
2715
|
+
) })
|
2639
2716
|
] })
|
2640
2717
|
}
|
2641
2718
|
) });
|
2642
2719
|
};
|
2643
|
-
const CircleIcon = styled(PlusCircle)`
|
2644
|
-
width: 2.4rem;
|
2645
|
-
height: 2.4rem;
|
2646
|
-
> circle {
|
2647
|
-
fill: ${({ theme }) => theme.colors.primary200};
|
2648
|
-
}
|
2649
|
-
> path {
|
2650
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
2651
|
-
}
|
2652
|
-
`;
|
2653
2720
|
const NonRepeatableComponent = ({
|
2654
2721
|
attribute,
|
2655
2722
|
name: name2,
|
2656
2723
|
children,
|
2657
2724
|
layout
|
2658
2725
|
}) => {
|
2726
|
+
const { formatMessage } = useIntl();
|
2659
2727
|
const { value } = useField(name2);
|
2660
2728
|
const level = useComponent("NonRepeatableComponent", (state) => state.level);
|
2661
2729
|
const isNested = level > 0;
|
@@ -2672,6 +2740,10 @@ const NonRepeatableComponent = ({
|
|
2672
2740
|
children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
|
2673
2741
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2674
2742
|
const completeFieldName = `${name2}.${field.name}`;
|
2743
|
+
const translatedLabel = formatMessage({
|
2744
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2745
|
+
defaultMessage: field.label
|
2746
|
+
});
|
2675
2747
|
return /* @__PURE__ */ jsx(
|
2676
2748
|
Grid$1.Item,
|
2677
2749
|
{
|
@@ -2680,7 +2752,7 @@ const NonRepeatableComponent = ({
|
|
2680
2752
|
xs: 12,
|
2681
2753
|
direction: "column",
|
2682
2754
|
alignItems: "stretch",
|
2683
|
-
children: children({ ...field, name: completeFieldName })
|
2755
|
+
children: children({ ...field, label: translatedLabel, name: completeFieldName })
|
2684
2756
|
},
|
2685
2757
|
completeFieldName
|
2686
2758
|
);
|
@@ -2702,13 +2774,34 @@ const RepeatableComponent = ({
|
|
2702
2774
|
const { search: searchString } = useLocation();
|
2703
2775
|
const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2704
2776
|
const { components } = useDoc();
|
2705
|
-
const {
|
2777
|
+
const {
|
2778
|
+
value = [],
|
2779
|
+
error,
|
2780
|
+
rawError
|
2781
|
+
} = useField(name2);
|
2706
2782
|
const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2707
2783
|
const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2708
2784
|
const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2709
2785
|
const { max = Infinity } = attribute;
|
2710
2786
|
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
2711
2787
|
const [liveText, setLiveText] = React.useState("");
|
2788
|
+
React.useEffect(() => {
|
2789
|
+
const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
|
2790
|
+
const hasNestedValue = value && Array.isArray(value) && value.length > 0;
|
2791
|
+
if (hasNestedErrors && hasNestedValue) {
|
2792
|
+
const errorOpenItems = rawError.map((_, idx) => {
|
2793
|
+
return value[idx] ? value[idx].__temp_key__ : null;
|
2794
|
+
}).filter((value2) => !!value2);
|
2795
|
+
if (errorOpenItems && errorOpenItems.length > 0) {
|
2796
|
+
setCollapseToOpen((collapseToOpen2) => {
|
2797
|
+
if (!errorOpenItems.includes(collapseToOpen2)) {
|
2798
|
+
return errorOpenItems[0];
|
2799
|
+
}
|
2800
|
+
return collapseToOpen2;
|
2801
|
+
});
|
2802
|
+
}
|
2803
|
+
}
|
2804
|
+
}, [rawError, value]);
|
2712
2805
|
const componentTmpKeyWithFocussedField = React.useMemo(() => {
|
2713
2806
|
if (search.has("field")) {
|
2714
2807
|
const fieldParam = search.get("field");
|
@@ -2861,6 +2954,10 @@ const RepeatableComponent = ({
|
|
2861
2954
|
children: layout.map((row, index2) => {
|
2862
2955
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2863
2956
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2957
|
+
const translatedLabel = formatMessage({
|
2958
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2959
|
+
defaultMessage: field.label
|
2960
|
+
});
|
2864
2961
|
return /* @__PURE__ */ jsx(
|
2865
2962
|
Grid$1.Item,
|
2866
2963
|
{
|
@@ -2869,7 +2966,11 @@ const RepeatableComponent = ({
|
|
2869
2966
|
xs: 12,
|
2870
2967
|
direction: "column",
|
2871
2968
|
alignItems: "stretch",
|
2872
|
-
children: children({
|
2969
|
+
children: children({
|
2970
|
+
...field,
|
2971
|
+
label: translatedLabel,
|
2972
|
+
name: completeFieldName
|
2973
|
+
})
|
2873
2974
|
},
|
2874
2975
|
completeFieldName
|
2875
2976
|
);
|
@@ -3256,18 +3357,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
3256
3357
|
/* @__PURE__ */ jsx(Field.Hint, {})
|
3257
3358
|
] });
|
3258
3359
|
};
|
3259
|
-
function useDebounce(value, delay) {
|
3260
|
-
const [debouncedValue, setDebouncedValue] = useState(value);
|
3261
|
-
useEffect(() => {
|
3262
|
-
const handler = setTimeout(() => {
|
3263
|
-
setDebouncedValue(value);
|
3264
|
-
}, delay);
|
3265
|
-
return () => {
|
3266
|
-
clearTimeout(handler);
|
3267
|
-
};
|
3268
|
-
}, [value, delay]);
|
3269
|
-
return debouncedValue;
|
3270
|
-
}
|
3271
3360
|
const uidApi = contentManagerApi.injectEndpoints({
|
3272
3361
|
endpoints: (builder) => ({
|
3273
3362
|
getDefaultUID: builder.query({
|
@@ -3725,8 +3814,7 @@ const Wrapper = styled.div`
|
|
3725
3814
|
`;
|
3726
3815
|
var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
|
3727
3816
|
function newlineAndIndentContinueMarkdownList(cm) {
|
3728
|
-
if (cm.getOption("disableInput"))
|
3729
|
-
return CodeMirror.Pass;
|
3817
|
+
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
3730
3818
|
var ranges = cm.listSelections(), replacements = [];
|
3731
3819
|
for (var i = 0; i < ranges.length; i++) {
|
3732
3820
|
var pos = ranges[i].head;
|
@@ -3760,8 +3848,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
|
|
3760
3848
|
var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
|
3761
3849
|
var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
|
3762
3850
|
replacements[i] = "\n" + indent + bullet + after;
|
3763
|
-
if (numbered)
|
3764
|
-
incrementRemainingMarkdownListNumbers(cm, pos);
|
3851
|
+
if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
|
3765
3852
|
}
|
3766
3853
|
}
|
3767
3854
|
cm.replaceSelections(replacements);
|
@@ -3779,10 +3866,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3779
3866
|
var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
|
3780
3867
|
var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
|
3781
3868
|
if (startIndent === nextIndent && !isNaN(nextNumber)) {
|
3782
|
-
if (newNumber === nextNumber)
|
3783
|
-
|
3784
|
-
if (newNumber > nextNumber)
|
3785
|
-
itemNumber = newNumber + 1;
|
3869
|
+
if (newNumber === nextNumber) itemNumber = nextNumber + 1;
|
3870
|
+
if (newNumber > nextNumber) itemNumber = newNumber + 1;
|
3786
3871
|
cm.replaceRange(
|
3787
3872
|
nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
|
3788
3873
|
{
|
@@ -3795,10 +3880,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3795
3880
|
}
|
3796
3881
|
);
|
3797
3882
|
} else {
|
3798
|
-
if (startIndent.length > nextIndent.length)
|
3799
|
-
|
3800
|
-
if (startIndent.length < nextIndent.length && lookAhead === 1)
|
3801
|
-
return;
|
3883
|
+
if (startIndent.length > nextIndent.length) return;
|
3884
|
+
if (startIndent.length < nextIndent.length && lookAhead === 1) return;
|
3802
3885
|
skipCount += 1;
|
3803
3886
|
}
|
3804
3887
|
}
|
@@ -4585,31 +4668,11 @@ const quoteAndCodeHandler = (editor, markdownType) => {
|
|
4585
4668
|
insertWithoutTextToEdit(editor, markdownType, line, contentLength);
|
4586
4669
|
}
|
4587
4670
|
};
|
4588
|
-
const CustomIconButton = styled(IconButton)`
|
4589
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4590
|
-
|
4591
|
-
svg {
|
4592
|
-
width: 1.8rem;
|
4593
|
-
height: 1.8rem;
|
4594
|
-
}
|
4595
|
-
`;
|
4596
|
-
const CustomLinkIconButton = styled(CustomIconButton)`
|
4597
|
-
svg {
|
4598
|
-
width: 0.8rem;
|
4599
|
-
height: 0.8rem;
|
4600
|
-
}
|
4601
|
-
`;
|
4602
4671
|
const MainButtons = styled(IconButtonGroup)`
|
4603
4672
|
margin-left: ${({ theme }) => theme.spaces[4]};
|
4604
4673
|
`;
|
4605
4674
|
const MoreButton = styled(IconButton)`
|
4606
4675
|
margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
|
4607
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4608
|
-
|
4609
|
-
svg {
|
4610
|
-
width: 1.8rem;
|
4611
|
-
height: 1.8rem;
|
4612
|
-
}
|
4613
4676
|
`;
|
4614
4677
|
const IconButtonGroupMargin = styled(IconButtonGroup)`
|
4615
4678
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
@@ -4693,9 +4756,9 @@ const WysiwygNav = ({
|
|
4693
4756
|
}
|
4694
4757
|
) }),
|
4695
4758
|
/* @__PURE__ */ jsxs(MainButtons, { children: [
|
4696
|
-
/* @__PURE__ */ jsx(
|
4697
|
-
/* @__PURE__ */ jsx(
|
4698
|
-
/* @__PURE__ */ jsx(
|
4759
|
+
/* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
|
4760
|
+
/* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
|
4761
|
+
/* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
|
4699
4762
|
] }),
|
4700
4763
|
/* @__PURE__ */ jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsx(More, {}) })
|
4701
4764
|
] }),
|
@@ -4734,17 +4797,9 @@ const WysiwygNav = ({
|
|
4734
4797
|
}
|
4735
4798
|
) }),
|
4736
4799
|
/* @__PURE__ */ jsxs(MainButtons, { children: [
|
4800
|
+
/* @__PURE__ */ jsx(IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
|
4737
4801
|
/* @__PURE__ */ jsx(
|
4738
|
-
|
4739
|
-
{
|
4740
|
-
onClick: () => onActionClick("Bold", editorRef),
|
4741
|
-
label: "Bold",
|
4742
|
-
name: "Bold",
|
4743
|
-
children: /* @__PURE__ */ jsx(Bold, {})
|
4744
|
-
}
|
4745
|
-
),
|
4746
|
-
/* @__PURE__ */ jsx(
|
4747
|
-
CustomIconButton,
|
4802
|
+
IconButton,
|
4748
4803
|
{
|
4749
4804
|
onClick: () => onActionClick("Italic", editorRef),
|
4750
4805
|
label: "Italic",
|
@@ -4753,7 +4808,7 @@ const WysiwygNav = ({
|
|
4753
4808
|
}
|
4754
4809
|
),
|
4755
4810
|
/* @__PURE__ */ jsx(
|
4756
|
-
|
4811
|
+
IconButton,
|
4757
4812
|
{
|
4758
4813
|
onClick: () => onActionClick("Underline", editorRef),
|
4759
4814
|
label: "Underline",
|
@@ -4767,7 +4822,7 @@ const WysiwygNav = ({
|
|
4767
4822
|
/* @__PURE__ */ jsx(Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxs(Flex, { padding: 2, children: [
|
4768
4823
|
/* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
|
4769
4824
|
/* @__PURE__ */ jsx(
|
4770
|
-
|
4825
|
+
IconButton,
|
4771
4826
|
{
|
4772
4827
|
onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
|
4773
4828
|
label: "Strikethrough",
|
@@ -4776,7 +4831,7 @@ const WysiwygNav = ({
|
|
4776
4831
|
}
|
4777
4832
|
),
|
4778
4833
|
/* @__PURE__ */ jsx(
|
4779
|
-
|
4834
|
+
IconButton,
|
4780
4835
|
{
|
4781
4836
|
onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
|
4782
4837
|
label: "BulletList",
|
@@ -4785,7 +4840,7 @@ const WysiwygNav = ({
|
|
4785
4840
|
}
|
4786
4841
|
),
|
4787
4842
|
/* @__PURE__ */ jsx(
|
4788
|
-
|
4843
|
+
IconButton,
|
4789
4844
|
{
|
4790
4845
|
onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
|
4791
4846
|
label: "NumberList",
|
@@ -4796,7 +4851,7 @@ const WysiwygNav = ({
|
|
4796
4851
|
] }),
|
4797
4852
|
/* @__PURE__ */ jsxs(IconButtonGroup, { children: [
|
4798
4853
|
/* @__PURE__ */ jsx(
|
4799
|
-
|
4854
|
+
IconButton,
|
4800
4855
|
{
|
4801
4856
|
onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
|
4802
4857
|
label: "Code",
|
@@ -4805,7 +4860,7 @@ const WysiwygNav = ({
|
|
4805
4860
|
}
|
4806
4861
|
),
|
4807
4862
|
/* @__PURE__ */ jsx(
|
4808
|
-
|
4863
|
+
IconButton,
|
4809
4864
|
{
|
4810
4865
|
onClick: () => {
|
4811
4866
|
handleTogglePopover();
|
@@ -4817,7 +4872,7 @@ const WysiwygNav = ({
|
|
4817
4872
|
}
|
4818
4873
|
),
|
4819
4874
|
/* @__PURE__ */ jsx(
|
4820
|
-
|
4875
|
+
IconButton,
|
4821
4876
|
{
|
4822
4877
|
onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
|
4823
4878
|
label: "Link",
|
@@ -4826,7 +4881,7 @@ const WysiwygNav = ({
|
|
4826
4881
|
}
|
4827
4882
|
),
|
4828
4883
|
/* @__PURE__ */ jsx(
|
4829
|
-
|
4884
|
+
IconButton,
|
4830
4885
|
{
|
4831
4886
|
onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
|
4832
4887
|
label: "Quote",
|
@@ -4963,15 +5018,19 @@ const Wysiwyg = React.forwardRef(
|
|
4963
5018
|
);
|
4964
5019
|
const MemoizedWysiwyg = React.memo(Wysiwyg);
|
4965
5020
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4966
|
-
const { id } = useDoc();
|
5021
|
+
const { id, document: document2, collectionType } = useDoc();
|
4967
5022
|
const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
|
4968
5023
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4969
5024
|
const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4970
5025
|
const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4971
5026
|
const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4972
5027
|
const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4973
|
-
|
4974
|
-
|
5028
|
+
let idToCheck = id;
|
5029
|
+
if (collectionType === SINGLE_TYPES) {
|
5030
|
+
idToCheck = document2?.documentId;
|
5031
|
+
}
|
5032
|
+
const editableFields = idToCheck ? canUpdateFields : canCreateFields;
|
5033
|
+
const readableFields = idToCheck ? canReadFields : canCreateFields;
|
4975
5034
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4976
5035
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4977
5036
|
const fields = useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4982,6 +5041,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4982
5041
|
const {
|
4983
5042
|
edit: { components }
|
4984
5043
|
} = useDocLayout();
|
5044
|
+
const field = useField(props.name);
|
4985
5045
|
if (!visible) {
|
4986
5046
|
return null;
|
4987
5047
|
}
|
@@ -4992,7 +5052,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4992
5052
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4993
5053
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4994
5054
|
if (CustomInput) {
|
4995
|
-
return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
5055
|
+
return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4996
5056
|
}
|
4997
5057
|
return /* @__PURE__ */ jsx(
|
4998
5058
|
InputRenderer$1,
|
@@ -5153,6 +5213,14 @@ const DynamicComponent = ({
|
|
5153
5213
|
React.useEffect(() => {
|
5154
5214
|
dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
|
5155
5215
|
}, [dragPreviewRef, index]);
|
5216
|
+
const accordionValue = React.useId();
|
5217
|
+
const { value = [], rawError } = useField(`${name2}.${index}`);
|
5218
|
+
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
5219
|
+
React.useEffect(() => {
|
5220
|
+
if (rawError && value) {
|
5221
|
+
setCollapseToOpen(accordionValue);
|
5222
|
+
}
|
5223
|
+
}, [rawError, value, accordionValue]);
|
5156
5224
|
const composedBoxRefs = useComposedRefs(boxRef, dropRef);
|
5157
5225
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
5158
5226
|
/* @__PURE__ */ jsx(
|
@@ -5218,10 +5286,9 @@ const DynamicComponent = ({
|
|
5218
5286
|
] })
|
5219
5287
|
] });
|
5220
5288
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5221
|
-
const accordionValue = React.useId();
|
5222
5289
|
return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5223
5290
|
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
|
5224
|
-
/* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
|
5291
|
+
/* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
|
5225
5292
|
/* @__PURE__ */ jsxs(Accordion.Header, { children: [
|
5226
5293
|
/* @__PURE__ */ jsx(
|
5227
5294
|
Accordion.Trigger,
|
@@ -5232,21 +5299,39 @@ const DynamicComponent = ({
|
|
5232
5299
|
),
|
5233
5300
|
/* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
|
5234
5301
|
] }),
|
5235
|
-
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children:
|
5236
|
-
|
5237
|
-
|
5238
|
-
|
5239
|
-
|
5240
|
-
|
5241
|
-
|
5242
|
-
|
5243
|
-
|
5244
|
-
|
5245
|
-
|
5246
|
-
|
5247
|
-
|
5248
|
-
|
5249
|
-
|
5302
|
+
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(
|
5303
|
+
Grid$1.Item,
|
5304
|
+
{
|
5305
|
+
col: 12,
|
5306
|
+
s: 12,
|
5307
|
+
xs: 12,
|
5308
|
+
direction: "column",
|
5309
|
+
alignItems: "stretch",
|
5310
|
+
children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5311
|
+
const fieldName = `${name2}.${index}.${field.name}`;
|
5312
|
+
const fieldWithTranslatedLabel = {
|
5313
|
+
...field,
|
5314
|
+
label: formatMessage({
|
5315
|
+
id: `content-manager.components.${componentUid}.${field.name}`,
|
5316
|
+
defaultMessage: field.label
|
5317
|
+
})
|
5318
|
+
};
|
5319
|
+
return /* @__PURE__ */ jsx(
|
5320
|
+
Grid$1.Item,
|
5321
|
+
{
|
5322
|
+
col: size,
|
5323
|
+
s: 12,
|
5324
|
+
xs: 12,
|
5325
|
+
direction: "column",
|
5326
|
+
alignItems: "stretch",
|
5327
|
+
children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
|
5328
|
+
},
|
5329
|
+
fieldName
|
5330
|
+
);
|
5331
|
+
}) })
|
5332
|
+
},
|
5333
|
+
rowInd
|
5334
|
+
)) }) }) }) })
|
5250
5335
|
] }) }) })
|
5251
5336
|
] });
|
5252
5337
|
};
|
@@ -5554,4 +5639,4 @@ export {
|
|
5554
5639
|
transformDocument as t,
|
5555
5640
|
useLazyComponents as u
|
5556
5641
|
};
|
5557
|
-
//# sourceMappingURL=Field-
|
5642
|
+
//# sourceMappingURL=Field-Byr3mPTl.mjs.map
|