@strapi/content-manager 0.0.0-experimental.afa3b513b8f95459043f33fb94f4bac03af1474f → 0.0.0-experimental.b05633daea1bf090c66312b8ab30ec13bdb52f57
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-CnL10QYC.mjs → ComponentConfigurationPage-A5f-t42A.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-CnL10QYC.mjs.map → ComponentConfigurationPage-A5f-t42A.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-G4EIirP8.js → ComponentConfigurationPage-BtmEfYUS.js} +5 -6
- package/dist/_chunks/{ComponentConfigurationPage-G4EIirP8.js.map → ComponentConfigurationPage-BtmEfYUS.js.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-B2AA1kVF.js → EditConfigurationPage-CXLQhPpj.js} +5 -6
- package/dist/_chunks/{EditConfigurationPage-B2AA1kVF.js.map → EditConfigurationPage-CXLQhPpj.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-I2kKh9dx.mjs → EditConfigurationPage-DN6yaDFZ.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-I2kKh9dx.mjs.map → EditConfigurationPage-DN6yaDFZ.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-CHgoNwlc.js → EditViewPage-BW-BJJVg.js} +50 -11
- package/dist/_chunks/EditViewPage-BW-BJJVg.js.map +1 -0
- package/dist/_chunks/{EditViewPage-zFjJK0s8.mjs → EditViewPage-ONky_-8U.mjs} +50 -10
- package/dist/_chunks/EditViewPage-ONky_-8U.mjs.map +1 -0
- package/dist/_chunks/{Field-DPAzUS1M.mjs → Field-B4gAYDmQ.mjs} +215 -92
- package/dist/_chunks/Field-B4gAYDmQ.mjs.map +1 -0
- package/dist/_chunks/{Field-9DePZh-0.js → Field-BMlzghtV.js} +217 -94
- package/dist/_chunks/Field-BMlzghtV.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-DPm-KZ1A.js → Form-DQPyv3UY.js} +6 -7
- package/dist/_chunks/Form-DQPyv3UY.js.map +1 -0
- package/dist/_chunks/{Form-CEkENbkF.mjs → Form-e4RpNQY0.mjs} +4 -4
- package/dist/_chunks/Form-e4RpNQY0.mjs.map +1 -0
- package/dist/_chunks/{History-utls71em.mjs → History-Bk2VCzmJ.mjs} +43 -100
- package/dist/_chunks/History-Bk2VCzmJ.mjs.map +1 -0
- package/dist/_chunks/{History-DXSbTWez.js → History-CzkXjAR0.js} +42 -100
- package/dist/_chunks/History-CzkXjAR0.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-D5C7ACZ_.js → ListConfigurationPage-B9TbaEqp.js} +7 -7
- package/dist/_chunks/ListConfigurationPage-B9TbaEqp.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-CuMXWWqb.mjs → ListConfigurationPage-BhNCzkQd.mjs} +7 -6
- package/dist/_chunks/ListConfigurationPage-BhNCzkQd.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-DfuwH1tt.js → ListViewPage-CIHO4H2J.js} +64 -42
- package/dist/_chunks/ListViewPage-CIHO4H2J.js.map +1 -0
- package/dist/_chunks/{ListViewPage-CdKd-PS_.mjs → ListViewPage-mK-sFVGU.mjs} +63 -40
- package/dist/_chunks/ListViewPage-mK-sFVGU.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DkToTT7u.mjs → NoContentTypePage-BSVg7nZI.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-DkToTT7u.mjs.map → NoContentTypePage-BSVg7nZI.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BIxlkWWi.js → NoContentTypePage-Dbfi49ek.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-BIxlkWWi.js.map → NoContentTypePage-Dbfi49ek.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-Bu4GWYb-.js → NoPermissionsPage-CDvWOtEy.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-Bu4GWYb-.js.map → NoPermissionsPage-CDvWOtEy.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DlWi4BAH.mjs → NoPermissionsPage-zpYME1_X.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DlWi4BAH.mjs.map → NoPermissionsPage-zpYME1_X.mjs.map} +1 -1
- package/dist/_chunks/Preview-8U27vy1U.js +311 -0
- package/dist/_chunks/Preview-8U27vy1U.js.map +1 -0
- package/dist/_chunks/Preview-Dd3kQluA.mjs +293 -0
- package/dist/_chunks/Preview-Dd3kQluA.mjs.map +1 -0
- package/dist/_chunks/{Relations-QP5yn9_z.mjs → Relations-BvdARGTL.mjs} +75 -41
- package/dist/_chunks/Relations-BvdARGTL.mjs.map +1 -0
- package/dist/_chunks/{Relations-CFjTESWQ.js → Relations-CFMS6Dm8.js} +75 -42
- package/dist/_chunks/Relations-CFMS6Dm8.js.map +1 -0
- package/dist/_chunks/{en-BVzUkPxZ.js → en-BzQmavmK.js} +28 -11
- package/dist/_chunks/{en-BVzUkPxZ.js.map → en-BzQmavmK.js.map} +1 -1
- package/dist/_chunks/{en-CPTj6CjC.mjs → en-CSxLmrh1.mjs} +28 -11
- package/dist/_chunks/{en-CPTj6CjC.mjs.map → en-CSxLmrh1.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-BHfS6_D5.mjs → index-B3tHjkLZ.mjs} +971 -724
- package/dist/_chunks/index-B3tHjkLZ.mjs.map +1 -0
- package/dist/_chunks/{index-DXiHxy70.js → index-TSBwtMDV.js} +969 -722
- package/dist/_chunks/index-TSBwtMDV.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-DX_52HSH.mjs → layout-C71zeI19.mjs} +4 -4
- package/dist/_chunks/{layout-DX_52HSH.mjs.map → layout-C71zeI19.mjs.map} +1 -1
- package/dist/_chunks/{layout-bE-WUnQ0.js → layout-CB2vrWLp.js} +5 -6
- package/dist/_chunks/{layout-bE-WUnQ0.js.map → layout-CB2vrWLp.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-D706vblp.js → relations-8mON7ZVQ.js} +6 -7
- package/dist/_chunks/relations-8mON7ZVQ.js.map +1 -0
- package/dist/_chunks/{relations-SCVAL_aJ.mjs → relations-DcEHhh0U.mjs} +6 -7
- package/dist/_chunks/relations-DcEHhh0U.mjs.map +1 -0
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -1
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -1
- 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 +3 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +5 -3
- package/dist/admin/src/content-manager.d.ts +3 -2
- package/dist/admin/src/exports.d.ts +2 -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 +3 -3
- 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/Header.d.ts +1 -0
- 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 +16 -19
- package/dist/admin/src/services/init.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +2 -2
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/server/index.js +432 -194
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +432 -193
- 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 +2 -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/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 +14 -12
- package/dist/_chunks/EditViewPage-CHgoNwlc.js.map +0 -1
- package/dist/_chunks/EditViewPage-zFjJK0s8.mjs.map +0 -1
- package/dist/_chunks/Field-9DePZh-0.js.map +0 -1
- package/dist/_chunks/Field-DPAzUS1M.mjs.map +0 -1
- package/dist/_chunks/Form-CEkENbkF.mjs.map +0 -1
- package/dist/_chunks/Form-DPm-KZ1A.js.map +0 -1
- package/dist/_chunks/History-DXSbTWez.js.map +0 -1
- package/dist/_chunks/History-utls71em.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-CuMXWWqb.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-D5C7ACZ_.js.map +0 -1
- package/dist/_chunks/ListViewPage-CdKd-PS_.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-DfuwH1tt.js.map +0 -1
- package/dist/_chunks/Relations-CFjTESWQ.js.map +0 -1
- package/dist/_chunks/Relations-QP5yn9_z.mjs.map +0 -1
- package/dist/_chunks/index-BHfS6_D5.mjs.map +0 -1
- package/dist/_chunks/index-DXiHxy70.js.map +0 -1
- package/dist/_chunks/relations-D706vblp.js.map +0 -1
- package/dist/_chunks/relations-SCVAL_aJ.mjs.map +0 -1
@@ -5,18 +5,69 @@ 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-B3tHjkLZ.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-BvdARGTL.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 * 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";
|
20
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";
|
@@ -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") {
|
@@ -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),
|
@@ -1821,8 +1890,7 @@ const DragAndDropElement = ({
|
|
1821
1890
|
displayedValue: children
|
1822
1891
|
},
|
1823
1892
|
onDropItem(currentIndex, newIndex) {
|
1824
|
-
if (newIndex)
|
1825
|
-
handleMoveBlock(newIndex, currentIndex);
|
1893
|
+
if (newIndex) handleMoveBlock(newIndex, currentIndex);
|
1826
1894
|
}
|
1827
1895
|
});
|
1828
1896
|
const composedBoxRefs = useComposedRefs(blockRef, dropRef);
|
@@ -1928,7 +1996,7 @@ const baseRenderLeaf = (props, modifiers2) => {
|
|
1928
1996
|
}
|
1929
1997
|
return currentChildren;
|
1930
1998
|
}, props.children);
|
1931
|
-
return /* @__PURE__ */ jsx("span", { ...props.attributes, children: wrappedChildren });
|
1999
|
+
return /* @__PURE__ */ jsx("span", { ...props.attributes, className: props.leaf.className, children: wrappedChildren });
|
1932
2000
|
};
|
1933
2001
|
const baseRenderElement = ({
|
1934
2002
|
props,
|
@@ -1966,8 +2034,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
1966
2034
|
[modifiers2]
|
1967
2035
|
);
|
1968
2036
|
const handleMoveBlocks = (editor2, event) => {
|
1969
|
-
if (!editor2.selection)
|
1970
|
-
return;
|
2037
|
+
if (!editor2.selection) return;
|
1971
2038
|
const start = Range.start(editor2.selection);
|
1972
2039
|
const currentIndex = [start.path[0]];
|
1973
2040
|
let newIndexPosition = 0;
|
@@ -2104,8 +2171,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2104
2171
|
}
|
2105
2172
|
};
|
2106
2173
|
const handleScrollSelectionIntoView = () => {
|
2107
|
-
if (!editor.selection)
|
2108
|
-
return;
|
2174
|
+
if (!editor.selection) return;
|
2109
2175
|
const domRange = ReactEditor.toDOMRange(editor, editor.selection);
|
2110
2176
|
const domRect = domRange.getBoundingClientRect();
|
2111
2177
|
const blocksInput = blocksRef.current;
|
@@ -2143,6 +2209,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2143
2209
|
readOnly: disabled,
|
2144
2210
|
placeholder,
|
2145
2211
|
isExpandedMode,
|
2212
|
+
decorate: decorateCode,
|
2146
2213
|
renderElement,
|
2147
2214
|
renderLeaf,
|
2148
2215
|
onKeyDown: handleKeyDown,
|
@@ -2299,8 +2366,7 @@ const InlineCode = styled.code`
|
|
2299
2366
|
`;
|
2300
2367
|
const baseCheckIsActive = (editor, name2) => {
|
2301
2368
|
const marks = Editor$1.marks(editor);
|
2302
|
-
if (!marks)
|
2303
|
-
return false;
|
2369
|
+
if (!marks) return false;
|
2304
2370
|
return Boolean(marks[name2]);
|
2305
2371
|
};
|
2306
2372
|
const baseHandleToggle = (editor, name2) => {
|
@@ -2624,7 +2690,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2624
2690
|
Box,
|
2625
2691
|
{
|
2626
2692
|
tag: "button",
|
2627
|
-
background: "neutral100",
|
2693
|
+
background: disabled ? "neutral150" : "neutral100",
|
2628
2694
|
borderColor: field.error ? "danger600" : "neutral200",
|
2629
2695
|
hasRadius: true,
|
2630
2696
|
disabled,
|
@@ -2632,32 +2698,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2632
2698
|
paddingTop: 9,
|
2633
2699
|
paddingBottom: 9,
|
2634
2700
|
type: "button",
|
2701
|
+
style: { cursor: disabled ? "not-allowed" : "pointer" },
|
2635
2702
|
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
2636
|
-
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2637
|
-
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
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
|
+
) })
|
2641
2716
|
] })
|
2642
2717
|
}
|
2643
2718
|
) });
|
2644
2719
|
};
|
2645
|
-
const CircleIcon = styled(PlusCircle)`
|
2646
|
-
width: 2.4rem;
|
2647
|
-
height: 2.4rem;
|
2648
|
-
> circle {
|
2649
|
-
fill: ${({ theme }) => theme.colors.primary200};
|
2650
|
-
}
|
2651
|
-
> path {
|
2652
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
2653
|
-
}
|
2654
|
-
`;
|
2655
2720
|
const NonRepeatableComponent = ({
|
2656
2721
|
attribute,
|
2657
2722
|
name: name2,
|
2658
2723
|
children,
|
2659
2724
|
layout
|
2660
2725
|
}) => {
|
2726
|
+
const { formatMessage } = useIntl();
|
2661
2727
|
const { value } = useField(name2);
|
2662
2728
|
const level = useComponent("NonRepeatableComponent", (state) => state.level);
|
2663
2729
|
const isNested = level > 0;
|
@@ -2674,6 +2740,10 @@ const NonRepeatableComponent = ({
|
|
2674
2740
|
children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
|
2675
2741
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2676
2742
|
const completeFieldName = `${name2}.${field.name}`;
|
2743
|
+
const translatedLabel = formatMessage({
|
2744
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2745
|
+
defaultMessage: field.label
|
2746
|
+
});
|
2677
2747
|
return /* @__PURE__ */ jsx(
|
2678
2748
|
Grid$1.Item,
|
2679
2749
|
{
|
@@ -2682,7 +2752,7 @@ const NonRepeatableComponent = ({
|
|
2682
2752
|
xs: 12,
|
2683
2753
|
direction: "column",
|
2684
2754
|
alignItems: "stretch",
|
2685
|
-
children: children({ ...field, name: completeFieldName })
|
2755
|
+
children: children({ ...field, label: translatedLabel, name: completeFieldName })
|
2686
2756
|
},
|
2687
2757
|
completeFieldName
|
2688
2758
|
);
|
@@ -2704,13 +2774,34 @@ const RepeatableComponent = ({
|
|
2704
2774
|
const { search: searchString } = useLocation();
|
2705
2775
|
const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2706
2776
|
const { components } = useDoc();
|
2707
|
-
const {
|
2777
|
+
const {
|
2778
|
+
value = [],
|
2779
|
+
error,
|
2780
|
+
rawError
|
2781
|
+
} = useField(name2);
|
2708
2782
|
const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2709
2783
|
const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2710
2784
|
const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2711
2785
|
const { max = Infinity } = attribute;
|
2712
2786
|
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
2713
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]);
|
2714
2805
|
const componentTmpKeyWithFocussedField = React.useMemo(() => {
|
2715
2806
|
if (search.has("field")) {
|
2716
2807
|
const fieldParam = search.get("field");
|
@@ -2863,6 +2954,10 @@ const RepeatableComponent = ({
|
|
2863
2954
|
children: layout.map((row, index2) => {
|
2864
2955
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2865
2956
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2957
|
+
const translatedLabel = formatMessage({
|
2958
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2959
|
+
defaultMessage: field.label
|
2960
|
+
});
|
2866
2961
|
return /* @__PURE__ */ jsx(
|
2867
2962
|
Grid$1.Item,
|
2868
2963
|
{
|
@@ -2871,7 +2966,11 @@ const RepeatableComponent = ({
|
|
2871
2966
|
xs: 12,
|
2872
2967
|
direction: "column",
|
2873
2968
|
alignItems: "stretch",
|
2874
|
-
children: children({
|
2969
|
+
children: children({
|
2970
|
+
...field,
|
2971
|
+
label: translatedLabel,
|
2972
|
+
name: completeFieldName
|
2973
|
+
})
|
2875
2974
|
},
|
2876
2975
|
completeFieldName
|
2877
2976
|
);
|
@@ -3715,8 +3814,7 @@ const Wrapper = styled.div`
|
|
3715
3814
|
`;
|
3716
3815
|
var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
|
3717
3816
|
function newlineAndIndentContinueMarkdownList(cm) {
|
3718
|
-
if (cm.getOption("disableInput"))
|
3719
|
-
return CodeMirror.Pass;
|
3817
|
+
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
3720
3818
|
var ranges = cm.listSelections(), replacements = [];
|
3721
3819
|
for (var i = 0; i < ranges.length; i++) {
|
3722
3820
|
var pos = ranges[i].head;
|
@@ -3750,8 +3848,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
|
|
3750
3848
|
var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
|
3751
3849
|
var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
|
3752
3850
|
replacements[i] = "\n" + indent + bullet + after;
|
3753
|
-
if (numbered)
|
3754
|
-
incrementRemainingMarkdownListNumbers(cm, pos);
|
3851
|
+
if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
|
3755
3852
|
}
|
3756
3853
|
}
|
3757
3854
|
cm.replaceSelections(replacements);
|
@@ -3769,10 +3866,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3769
3866
|
var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
|
3770
3867
|
var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
|
3771
3868
|
if (startIndent === nextIndent && !isNaN(nextNumber)) {
|
3772
|
-
if (newNumber === nextNumber)
|
3773
|
-
|
3774
|
-
if (newNumber > nextNumber)
|
3775
|
-
itemNumber = newNumber + 1;
|
3869
|
+
if (newNumber === nextNumber) itemNumber = nextNumber + 1;
|
3870
|
+
if (newNumber > nextNumber) itemNumber = newNumber + 1;
|
3776
3871
|
cm.replaceRange(
|
3777
3872
|
nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
|
3778
3873
|
{
|
@@ -3785,10 +3880,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3785
3880
|
}
|
3786
3881
|
);
|
3787
3882
|
} else {
|
3788
|
-
if (startIndent.length > nextIndent.length)
|
3789
|
-
|
3790
|
-
if (startIndent.length < nextIndent.length && lookAhead === 1)
|
3791
|
-
return;
|
3883
|
+
if (startIndent.length > nextIndent.length) return;
|
3884
|
+
if (startIndent.length < nextIndent.length && lookAhead === 1) return;
|
3792
3885
|
skipCount += 1;
|
3793
3886
|
}
|
3794
3887
|
}
|
@@ -4925,15 +5018,19 @@ const Wysiwyg = React.forwardRef(
|
|
4925
5018
|
);
|
4926
5019
|
const MemoizedWysiwyg = React.memo(Wysiwyg);
|
4927
5020
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4928
|
-
const { id } = useDoc();
|
5021
|
+
const { id, document: document2, collectionType } = useDoc();
|
4929
5022
|
const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
|
4930
5023
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4931
5024
|
const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4932
5025
|
const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4933
5026
|
const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4934
5027
|
const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4935
|
-
|
4936
|
-
|
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;
|
4937
5034
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4938
5035
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4939
5036
|
const fields = useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4944,6 +5041,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4944
5041
|
const {
|
4945
5042
|
edit: { components }
|
4946
5043
|
} = useDocLayout();
|
5044
|
+
const field = useField(props.name);
|
4947
5045
|
if (!visible) {
|
4948
5046
|
return null;
|
4949
5047
|
}
|
@@ -4954,7 +5052,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4954
5052
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4955
5053
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4956
5054
|
if (CustomInput) {
|
4957
|
-
return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
5055
|
+
return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4958
5056
|
}
|
4959
5057
|
return /* @__PURE__ */ jsx(
|
4960
5058
|
InputRenderer$1,
|
@@ -5115,6 +5213,14 @@ const DynamicComponent = ({
|
|
5115
5213
|
React.useEffect(() => {
|
5116
5214
|
dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
|
5117
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]);
|
5118
5224
|
const composedBoxRefs = useComposedRefs(boxRef, dropRef);
|
5119
5225
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
5120
5226
|
/* @__PURE__ */ jsx(
|
@@ -5180,10 +5286,9 @@ const DynamicComponent = ({
|
|
5180
5286
|
] })
|
5181
5287
|
] });
|
5182
5288
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5183
|
-
const accordionValue = React.useId();
|
5184
5289
|
return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5185
5290
|
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
|
5186
|
-
/* @__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: [
|
5187
5292
|
/* @__PURE__ */ jsxs(Accordion.Header, { children: [
|
5188
5293
|
/* @__PURE__ */ jsx(
|
5189
5294
|
Accordion.Trigger,
|
@@ -5194,21 +5299,39 @@ const DynamicComponent = ({
|
|
5194
5299
|
),
|
5195
5300
|
/* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
|
5196
5301
|
] }),
|
5197
|
-
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children:
|
5198
|
-
|
5199
|
-
|
5200
|
-
|
5201
|
-
|
5202
|
-
|
5203
|
-
|
5204
|
-
|
5205
|
-
|
5206
|
-
|
5207
|
-
|
5208
|
-
|
5209
|
-
|
5210
|
-
|
5211
|
-
|
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
|
+
)) }) }) }) })
|
5212
5335
|
] }) }) })
|
5213
5336
|
] });
|
5214
5337
|
};
|
@@ -5516,4 +5639,4 @@ export {
|
|
5516
5639
|
transformDocument as t,
|
5517
5640
|
useLazyComponents as u
|
5518
5641
|
};
|
5519
|
-
//# sourceMappingURL=Field-
|
5642
|
+
//# sourceMappingURL=Field-B4gAYDmQ.mjs.map
|