@strapi/content-manager 0.0.0-next.c823b10e981295994d8b0733c78fa065aec064ee → 0.0.0-next.cb5f24c83e8fde7c31e5850c14430d38aa9b8862
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-CL9CAMaL.js → ComponentConfigurationPage-BSEZcJVB.js} +4 -5
- package/dist/_chunks/{ComponentConfigurationPage-CL9CAMaL.js.map → ComponentConfigurationPage-BSEZcJVB.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BpM_Hc7r.mjs → ComponentConfigurationPage-BiASGi7x.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-BpM_Hc7r.mjs.map → ComponentConfigurationPage-BiASGi7x.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-ILWo0h1e.js → EditConfigurationPage-D2rtvneE.js} +4 -5
- package/dist/_chunks/{EditConfigurationPage-ILWo0h1e.js.map → EditConfigurationPage-D2rtvneE.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-_prbqpTM.mjs → EditConfigurationPage-vN4zupij.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-_prbqpTM.mjs.map → EditConfigurationPage-vN4zupij.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-BqZvBN4s.js → EditViewPage-BwisF04Q.js} +38 -9
- package/dist/_chunks/EditViewPage-BwisF04Q.js.map +1 -0
- package/dist/_chunks/{EditViewPage-DAtscabN.mjs → EditViewPage-_A31Cl4g.mjs} +38 -8
- package/dist/_chunks/EditViewPage-_A31Cl4g.mjs.map +1 -0
- package/dist/_chunks/{Field-D-mgn1tH.mjs → Field-CvIunNOj.mjs} +169 -117
- package/dist/_chunks/Field-CvIunNOj.mjs.map +1 -0
- package/dist/_chunks/{Field-CcoQiiz1.js → Field-Dsu6-FrM.js} +171 -119
- package/dist/_chunks/Field-Dsu6-FrM.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-BxyeWiXW.mjs → Form-DK0fG0Gj.mjs} +3 -3
- package/dist/_chunks/{Form-BxyeWiXW.mjs.map → Form-DK0fG0Gj.mjs.map} +1 -1
- package/dist/_chunks/{Form-CmLbZDfi.js → Form-DUwWcCmA.js} +5 -6
- package/dist/_chunks/{Form-CmLbZDfi.js.map → Form-DUwWcCmA.js.map} +1 -1
- package/dist/_chunks/{History-uECUbCZB.js → History-CeCDhoJG.js} +9 -64
- package/dist/_chunks/History-CeCDhoJG.js.map +1 -0
- package/dist/_chunks/{History-BOhLaq_g.mjs → History-DP8gmXpm.mjs} +9 -63
- package/dist/_chunks/History-DP8gmXpm.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-D0vQez6F.mjs → ListConfigurationPage-BCkO5iuN.mjs} +6 -5
- package/dist/_chunks/ListConfigurationPage-BCkO5iuN.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-D_bBSFNW.js → ListConfigurationPage-C-bAd44a.js} +6 -6
- package/dist/_chunks/ListConfigurationPage-C-bAd44a.js.map +1 -0
- package/dist/_chunks/{ListViewPage-BkZ83b1A.js → ListViewPage-BKTZFhsM.js} +64 -53
- package/dist/_chunks/ListViewPage-BKTZFhsM.js.map +1 -0
- package/dist/_chunks/{ListViewPage-ns-bmy5C.mjs → ListViewPage-Cf_DgaFV.mjs} +63 -51
- package/dist/_chunks/ListViewPage-Cf_DgaFV.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-C1439s4s.js → NoContentTypePage-D3Cm3v3q.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-C1439s4s.js.map → NoContentTypePage-D3Cm3v3q.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BA5ZKMDR.mjs → NoContentTypePage-nHIyvJcB.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-BA5ZKMDR.mjs.map → NoContentTypePage-nHIyvJcB.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-B0GdMw1Q.mjs → NoPermissionsPage-BALVSJ7x.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B0GdMw1Q.mjs.map → NoPermissionsPage-BALVSJ7x.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-CPGwsVfb.js → NoPermissionsPage-CChGWBj5.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-CPGwsVfb.js.map → NoPermissionsPage-CChGWBj5.js.map} +1 -1
- package/dist/_chunks/Preview-C4NBzKUV.mjs +294 -0
- package/dist/_chunks/Preview-C4NBzKUV.mjs.map +1 -0
- package/dist/_chunks/Preview-CT28Ckpg.js +312 -0
- package/dist/_chunks/Preview-CT28Ckpg.js.map +1 -0
- package/dist/_chunks/{Relations-BIGPMSW4.mjs → Relations-C8uC89cT.mjs} +6 -8
- package/dist/_chunks/{Relations-BIGPMSW4.mjs.map → Relations-C8uC89cT.mjs.map} +1 -1
- package/dist/_chunks/{Relations-d-8Uef_-.js → Relations-CvkPCng_.js} +7 -10
- package/dist/_chunks/{Relations-d-8Uef_-.js.map → Relations-CvkPCng_.js.map} +1 -1
- package/dist/_chunks/{en-Bdpa50w3.js → en-BK8Xyl5I.js} +11 -3
- package/dist/_chunks/{en-Bdpa50w3.js.map → en-BK8Xyl5I.js.map} +1 -1
- package/dist/_chunks/{en-CZw4xdPY.mjs → en-Dtk_ot79.mjs} +11 -3
- package/dist/_chunks/{en-CZw4xdPY.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
- package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
- package/dist/_chunks/{index-BgaeYWIy.js → index-CnX_j5h-.js} +298 -210
- package/dist/_chunks/index-CnX_j5h-.js.map +1 -0
- package/dist/_chunks/{index-3_WeHXYp.mjs → index-Dh2aGTGJ.mjs} +303 -214
- package/dist/_chunks/index-Dh2aGTGJ.mjs.map +1 -0
- package/dist/_chunks/{layout-CrTxOnCy.mjs → layout-B5qsPihj.mjs} +4 -4
- package/dist/_chunks/{layout-CrTxOnCy.mjs.map → layout-B5qsPihj.mjs.map} +1 -1
- package/dist/_chunks/{layout-ByFyQRDH.js → layout-B_qdWGny.js} +5 -6
- package/dist/_chunks/{layout-ByFyQRDH.js.map → layout-B_qdWGny.js.map} +1 -1
- package/dist/_chunks/objects-BcXOv6_9.js.map +1 -1
- package/dist/_chunks/objects-D6yBsdmx.mjs.map +1 -1
- package/dist/_chunks/{relations-C5RSW926.js → relations-ChcieiF5.js} +6 -3
- package/dist/_chunks/relations-ChcieiF5.js.map +1 -0
- package/dist/_chunks/{relations-BlpLgngh.mjs → relations-DMXpNY-e.mjs} +6 -3
- package/dist/_chunks/relations-DMXpNY-e.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 +1 -1
- package/dist/admin/index.mjs +4 -4
- package/dist/admin/src/content-manager.d.ts +3 -2
- 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/preview/components/PreviewContent.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -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/router.d.ts +1 -1
- package/dist/admin/src/services/documents.d.ts +0 -3
- package/dist/server/index.js +151 -112
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +152 -112
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +1 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +3 -2
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -1
- package/dist/server/src/preview/index.d.ts.map +1 -1
- package/dist/server/src/preview/services/index.d.ts +1 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -1
- package/dist/server/src/preview/services/preview-config.d.ts +2 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -1
- package/dist/server/src/preview/utils.d.ts +1 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -1
- package/dist/server/src/register.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 +4 -2
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +3 -2
- 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/services/utils/populate.d.ts +2 -2
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/package.json +12 -10
- package/dist/_chunks/EditViewPage-BqZvBN4s.js.map +0 -1
- package/dist/_chunks/EditViewPage-DAtscabN.mjs.map +0 -1
- package/dist/_chunks/Field-CcoQiiz1.js.map +0 -1
- package/dist/_chunks/Field-D-mgn1tH.mjs.map +0 -1
- package/dist/_chunks/History-BOhLaq_g.mjs.map +0 -1
- package/dist/_chunks/History-uECUbCZB.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-D0vQez6F.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-D_bBSFNW.js.map +0 -1
- package/dist/_chunks/ListViewPage-BkZ83b1A.js.map +0 -1
- package/dist/_chunks/ListViewPage-ns-bmy5C.mjs.map +0 -1
- package/dist/_chunks/index-3_WeHXYp.mjs.map +0 -1
- package/dist/_chunks/index-BgaeYWIy.js.map +0 -1
- package/dist/_chunks/relations-BlpLgngh.mjs.map +0 -1
- package/dist/_chunks/relations-C5RSW926.js.map +0 -1
- package/dist/admin/src/preview/constants.d.ts +0 -1
- package/dist/server/src/preview/constants.d.ts +0 -2
- package/dist/server/src/preview/constants.d.ts.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, S as SINGLE_TYPES, 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-Dh2aGTGJ.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-C8uC89cT.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-
|
15
|
+
import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DJ6jqvZN.mjs";
|
16
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"
|
@@ -521,8 +599,7 @@ const codeBlocks = {
|
|
521
599
|
handleEnterKey(editor) {
|
522
600
|
pressEnterTwiceToExit(editor);
|
523
601
|
},
|
524
|
-
snippets: ["```"]
|
525
|
-
dragHandleTopMargin: "10px"
|
602
|
+
snippets: ["```"]
|
526
603
|
}
|
527
604
|
};
|
528
605
|
const H1 = styled(Typography).attrs({ tag: "h1" })`
|
@@ -697,8 +774,7 @@ const ImageDialog = () => {
|
|
697
774
|
const [isOpen, setIsOpen] = React.useState(true);
|
698
775
|
const { editor } = useBlocksEditorContext("ImageDialog");
|
699
776
|
const components = useStrapiApp("ImageDialog", (state) => state.components);
|
700
|
-
if (!components || !isOpen)
|
701
|
-
return null;
|
777
|
+
if (!components || !isOpen) return null;
|
702
778
|
const MediaLibraryDialog = components["media-library"];
|
703
779
|
const insertImages = (images) => {
|
704
780
|
Transforms.unwrapNodes(editor, {
|
@@ -707,14 +783,12 @@ const ImageDialog = () => {
|
|
707
783
|
});
|
708
784
|
const nodeEntryBeingReplaced = Editor$1.above(editor, {
|
709
785
|
match(node) {
|
710
|
-
if (Editor$1.isEditor(node))
|
711
|
-
return false;
|
786
|
+
if (Editor$1.isEditor(node)) return false;
|
712
787
|
const isInlineNode = ["text", "link"].includes(node.type);
|
713
788
|
return !isInlineNode;
|
714
789
|
}
|
715
790
|
});
|
716
|
-
if (!nodeEntryBeingReplaced)
|
717
|
-
return;
|
791
|
+
if (!nodeEntryBeingReplaced) return;
|
718
792
|
const [, pathToInsert] = nodeEntryBeingReplaced;
|
719
793
|
Transforms.removeNodes(editor);
|
720
794
|
const nodesToInsert = images.map((image) => {
|
@@ -892,8 +966,7 @@ const LinkContent = React.forwardRef(
|
|
892
966
|
ReactEditor.focus(editor);
|
893
967
|
};
|
894
968
|
React.useEffect(() => {
|
895
|
-
if (popoverOpen)
|
896
|
-
linkInputRef.current?.focus();
|
969
|
+
if (popoverOpen) linkInputRef.current?.focus();
|
897
970
|
}, [popoverOpen]);
|
898
971
|
const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
|
899
972
|
return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
|
@@ -963,11 +1036,11 @@ const LinkContent = React.forwardRef(
|
|
963
1036
|
),
|
964
1037
|
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
965
1038
|
/* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
|
966
|
-
id: "
|
1039
|
+
id: "global.cancel",
|
967
1040
|
defaultMessage: "Cancel"
|
968
1041
|
}) }),
|
969
1042
|
/* @__PURE__ */ jsx(Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
|
970
|
-
id: "
|
1043
|
+
id: "global.save",
|
971
1044
|
defaultMessage: "Save"
|
972
1045
|
}) })
|
973
1046
|
] })
|
@@ -1048,8 +1121,7 @@ const isText$1 = (node) => {
|
|
1048
1121
|
return Node.isNode(node) && !Editor$1.isEditor(node) && node.type === "text";
|
1049
1122
|
};
|
1050
1123
|
const handleBackspaceKeyOnList = (editor, event) => {
|
1051
|
-
if (!editor.selection)
|
1052
|
-
return;
|
1124
|
+
if (!editor.selection) return;
|
1053
1125
|
const [currentListItem, currentListItemPath] = Editor$1.parent(editor, editor.selection.anchor);
|
1054
1126
|
const [currentList, currentListPath] = Editor$1.parent(editor, currentListItemPath);
|
1055
1127
|
const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
|
@@ -1158,8 +1230,7 @@ const handleEnterKeyOnList = (editor) => {
|
|
1158
1230
|
};
|
1159
1231
|
const handleConvertToList = (editor, format) => {
|
1160
1232
|
const convertedPath = baseHandleConvert(editor, { type: "list-item" });
|
1161
|
-
if (!convertedPath)
|
1162
|
-
return;
|
1233
|
+
if (!convertedPath) return;
|
1163
1234
|
Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
|
1164
1235
|
};
|
1165
1236
|
const handleTabOnList = (editor) => {
|
@@ -1171,8 +1242,7 @@ const handleTabOnList = (editor) => {
|
|
1171
1242
|
}
|
1172
1243
|
const [currentListItem, currentListItemPath] = currentListItemEntry;
|
1173
1244
|
const [currentList] = Editor$1.parent(editor, currentListItemPath);
|
1174
|
-
if (currentListItem === currentList.children[0])
|
1175
|
-
return;
|
1245
|
+
if (currentListItem === currentList.children[0]) return;
|
1176
1246
|
const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
|
1177
1247
|
const previousNode = currentList.children[currentListItemIndex - 1];
|
1178
1248
|
if (previousNode.type === "list") {
|
@@ -1308,13 +1378,13 @@ const quoteBlocks = {
|
|
1308
1378
|
handleEnterKey(editor) {
|
1309
1379
|
pressEnterTwiceToExit(editor);
|
1310
1380
|
},
|
1311
|
-
snippets: [">"]
|
1312
|
-
dragHandleTopMargin: "6px"
|
1381
|
+
snippets: [">"]
|
1313
1382
|
}
|
1314
1383
|
};
|
1315
1384
|
const ToolbarWrapper = styled(Flex)`
|
1316
1385
|
&[aria-disabled='true'] {
|
1317
1386
|
cursor: not-allowed;
|
1387
|
+
background: ${({ theme }) => theme.colors.neutral150};
|
1318
1388
|
}
|
1319
1389
|
`;
|
1320
1390
|
const Separator = styled(Toolbar.Separator)`
|
@@ -1325,7 +1395,7 @@ const Separator = styled(Toolbar.Separator)`
|
|
1325
1395
|
const FlexButton = styled(Flex)`
|
1326
1396
|
// Inherit the not-allowed cursor from ToolbarWrapper when disabled
|
1327
1397
|
&[aria-disabled] {
|
1328
|
-
cursor:
|
1398
|
+
cursor: not-allowed;
|
1329
1399
|
}
|
1330
1400
|
|
1331
1401
|
&[aria-disabled='false'] {
|
@@ -1539,8 +1609,7 @@ const isListNode = (node) => {
|
|
1539
1609
|
const ListButton = ({ block, format }) => {
|
1540
1610
|
const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
|
1541
1611
|
const isListActive = () => {
|
1542
|
-
if (!editor.selection)
|
1543
|
-
return false;
|
1612
|
+
if (!editor.selection) return false;
|
1544
1613
|
const currentListEntry = Editor$1.above(editor, {
|
1545
1614
|
match: (node) => !Editor$1.isEditor(node) && node.type === "list",
|
1546
1615
|
at: editor.selection.anchor
|
@@ -1614,8 +1683,7 @@ const LinkButton = ({ disabled }) => {
|
|
1614
1683
|
const { editor } = useBlocksEditorContext("LinkButton");
|
1615
1684
|
const isLinkActive = () => {
|
1616
1685
|
const { selection } = editor;
|
1617
|
-
if (!selection)
|
1618
|
-
return false;
|
1686
|
+
if (!selection) return false;
|
1619
1687
|
const [match] = Array.from(
|
1620
1688
|
Editor$1.nodes(editor, {
|
1621
1689
|
at: Editor$1.unhangRange(editor, selection),
|
@@ -1679,7 +1747,7 @@ const BlocksToolbar = () => {
|
|
1679
1747
|
return false;
|
1680
1748
|
};
|
1681
1749
|
const isButtonDisabled = checkButtonDisabled();
|
1682
|
-
return /* @__PURE__ */ jsx(Toolbar.Root, { "aria-disabled": disabled, asChild: true, children: /* @__PURE__ */ jsxs(ToolbarWrapper, { gap: 2, padding: 2, children: [
|
1750
|
+
return /* @__PURE__ */ jsx(Toolbar.Root, { "aria-disabled": disabled, asChild: true, children: /* @__PURE__ */ jsxs(ToolbarWrapper, { gap: 2, padding: 2, width: "100%", children: [
|
1683
1751
|
/* @__PURE__ */ jsx(BlocksDropdown, {}),
|
1684
1752
|
/* @__PURE__ */ jsx(Separator, {}),
|
1685
1753
|
/* @__PURE__ */ jsx(Toolbar.ToggleGroup, { type: "multiple", asChild: true, children: /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
|
@@ -1753,30 +1821,32 @@ const DragIconButton = styled(IconButton)`
|
|
1753
1821
|
display: flex;
|
1754
1822
|
align-items: center;
|
1755
1823
|
justify-content: center;
|
1824
|
+
border: none;
|
1756
1825
|
border-radius: ${({ theme }) => theme.borderRadius};
|
1757
|
-
|
1758
|
-
|
1826
|
+
padding-left: ${({ theme }) => theme.spaces[0]};
|
1827
|
+
padding-right: ${({ theme }) => theme.spaces[0]};
|
1828
|
+
padding-top: ${({ theme }) => theme.spaces[1]};
|
1829
|
+
padding-bottom: ${({ theme }) => theme.spaces[1]};
|
1759
1830
|
visibility: hidden;
|
1760
1831
|
cursor: grab;
|
1761
1832
|
opacity: inherit;
|
1762
1833
|
margin-top: ${(props) => props.$dragHandleTopMargin ?? 0};
|
1763
1834
|
|
1764
1835
|
&:hover {
|
1765
|
-
background: ${({ theme }) => theme.colors.
|
1836
|
+
background: ${({ theme }) => theme.colors.neutral100};
|
1766
1837
|
}
|
1767
1838
|
&:active {
|
1768
1839
|
cursor: grabbing;
|
1840
|
+
background: ${({ theme }) => theme.colors.neutral150};
|
1769
1841
|
}
|
1770
1842
|
&[aria-disabled='true'] {
|
1771
|
-
|
1772
|
-
background: transparent;
|
1843
|
+
visibility: hidden;
|
1773
1844
|
}
|
1774
1845
|
svg {
|
1775
|
-
height: auto;
|
1776
1846
|
min-width: ${({ theme }) => theme.spaces[3]};
|
1777
1847
|
|
1778
1848
|
path {
|
1779
|
-
fill: ${({ theme }) => theme.colors.
|
1849
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
1780
1850
|
}
|
1781
1851
|
}
|
1782
1852
|
`;
|
@@ -1821,8 +1891,7 @@ const DragAndDropElement = ({
|
|
1821
1891
|
displayedValue: children
|
1822
1892
|
},
|
1823
1893
|
onDropItem(currentIndex, newIndex) {
|
1824
|
-
if (newIndex)
|
1825
|
-
handleMoveBlock(newIndex, currentIndex);
|
1894
|
+
if (newIndex) handleMoveBlock(newIndex, currentIndex);
|
1826
1895
|
}
|
1827
1896
|
});
|
1828
1897
|
const composedBoxRefs = useComposedRefs(blockRef, dropRef);
|
@@ -1928,7 +1997,7 @@ const baseRenderLeaf = (props, modifiers2) => {
|
|
1928
1997
|
}
|
1929
1998
|
return currentChildren;
|
1930
1999
|
}, props.children);
|
1931
|
-
return /* @__PURE__ */ jsx("span", { ...props.attributes, children: wrappedChildren });
|
2000
|
+
return /* @__PURE__ */ jsx("span", { ...props.attributes, className: props.leaf.className, children: wrappedChildren });
|
1932
2001
|
};
|
1933
2002
|
const baseRenderElement = ({
|
1934
2003
|
props,
|
@@ -1966,8 +2035,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
1966
2035
|
[modifiers2]
|
1967
2036
|
);
|
1968
2037
|
const handleMoveBlocks = (editor2, event) => {
|
1969
|
-
if (!editor2.selection)
|
1970
|
-
return;
|
2038
|
+
if (!editor2.selection) return;
|
1971
2039
|
const start = Range.start(editor2.selection);
|
1972
2040
|
const currentIndex = [start.path[0]];
|
1973
2041
|
let newIndexPosition = 0;
|
@@ -2104,8 +2172,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2104
2172
|
}
|
2105
2173
|
};
|
2106
2174
|
const handleScrollSelectionIntoView = () => {
|
2107
|
-
if (!editor.selection)
|
2108
|
-
return;
|
2175
|
+
if (!editor.selection) return;
|
2109
2176
|
const domRange = ReactEditor.toDOMRange(editor, editor.selection);
|
2110
2177
|
const domRect = domRange.getBoundingClientRect();
|
2111
2178
|
const blocksInput = blocksRef.current;
|
@@ -2132,7 +2199,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2132
2199
|
background: "neutral0",
|
2133
2200
|
color: "neutral800",
|
2134
2201
|
lineHeight: 6,
|
2135
|
-
paddingRight:
|
2202
|
+
paddingRight: 7,
|
2136
2203
|
paddingTop: 6,
|
2137
2204
|
paddingBottom: 3,
|
2138
2205
|
children: [
|
@@ -2143,6 +2210,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2143
2210
|
readOnly: disabled,
|
2144
2211
|
placeholder,
|
2145
2212
|
isExpandedMode,
|
2213
|
+
decorate: decorateCode,
|
2146
2214
|
renderElement,
|
2147
2215
|
renderLeaf,
|
2148
2216
|
onKeyDown: handleKeyDown,
|
@@ -2299,8 +2367,7 @@ const InlineCode = styled.code`
|
|
2299
2367
|
`;
|
2300
2368
|
const baseCheckIsActive = (editor, name2) => {
|
2301
2369
|
const marks = Editor$1.marks(editor);
|
2302
|
-
if (!marks)
|
2303
|
-
return false;
|
2370
|
+
if (!marks) return false;
|
2304
2371
|
return Boolean(marks[name2]);
|
2305
2372
|
};
|
2306
2373
|
const baseHandleToggle = (editor, name2) => {
|
@@ -2466,6 +2533,7 @@ const ExpandIconButton = styled(IconButton)`
|
|
2466
2533
|
position: absolute;
|
2467
2534
|
bottom: 1.2rem;
|
2468
2535
|
right: 1.2rem;
|
2536
|
+
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
2469
2537
|
`;
|
2470
2538
|
function useResetKey(value) {
|
2471
2539
|
const slateUpdatesCount = React.useRef(0);
|
@@ -2624,7 +2692,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2624
2692
|
Box,
|
2625
2693
|
{
|
2626
2694
|
tag: "button",
|
2627
|
-
background: "neutral100",
|
2695
|
+
background: disabled ? "neutral150" : "neutral100",
|
2628
2696
|
borderColor: field.error ? "danger600" : "neutral200",
|
2629
2697
|
hasRadius: true,
|
2630
2698
|
disabled,
|
@@ -2632,32 +2700,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2632
2700
|
paddingTop: 9,
|
2633
2701
|
paddingBottom: 9,
|
2634
2702
|
type: "button",
|
2703
|
+
style: { cursor: disabled ? "not-allowed" : "pointer" },
|
2635
2704
|
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
|
-
|
2705
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsx(PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
|
2706
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2707
|
+
Typography,
|
2708
|
+
{
|
2709
|
+
textColor: disabled ? "neutral600" : "primary600",
|
2710
|
+
variant: "pi",
|
2711
|
+
fontWeight: "bold",
|
2712
|
+
children: formatMessage({
|
2713
|
+
id: getTranslation("components.empty-repeatable"),
|
2714
|
+
defaultMessage: "No entry yet. Click to add one."
|
2715
|
+
})
|
2716
|
+
}
|
2717
|
+
) })
|
2641
2718
|
] })
|
2642
2719
|
}
|
2643
2720
|
) });
|
2644
2721
|
};
|
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
2722
|
const NonRepeatableComponent = ({
|
2656
2723
|
attribute,
|
2657
2724
|
name: name2,
|
2658
2725
|
children,
|
2659
2726
|
layout
|
2660
2727
|
}) => {
|
2728
|
+
const { formatMessage } = useIntl();
|
2661
2729
|
const { value } = useField(name2);
|
2662
2730
|
const level = useComponent("NonRepeatableComponent", (state) => state.level);
|
2663
2731
|
const isNested = level > 0;
|
@@ -2674,6 +2742,10 @@ const NonRepeatableComponent = ({
|
|
2674
2742
|
children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
|
2675
2743
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2676
2744
|
const completeFieldName = `${name2}.${field.name}`;
|
2745
|
+
const translatedLabel = formatMessage({
|
2746
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2747
|
+
defaultMessage: field.label
|
2748
|
+
});
|
2677
2749
|
return /* @__PURE__ */ jsx(
|
2678
2750
|
Grid$1.Item,
|
2679
2751
|
{
|
@@ -2682,7 +2754,7 @@ const NonRepeatableComponent = ({
|
|
2682
2754
|
xs: 12,
|
2683
2755
|
direction: "column",
|
2684
2756
|
alignItems: "stretch",
|
2685
|
-
children: children({ ...field, name: completeFieldName })
|
2757
|
+
children: children({ ...field, label: translatedLabel, name: completeFieldName })
|
2686
2758
|
},
|
2687
2759
|
completeFieldName
|
2688
2760
|
);
|
@@ -2884,6 +2956,10 @@ const RepeatableComponent = ({
|
|
2884
2956
|
children: layout.map((row, index2) => {
|
2885
2957
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2886
2958
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2959
|
+
const translatedLabel = formatMessage({
|
2960
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2961
|
+
defaultMessage: field.label
|
2962
|
+
});
|
2887
2963
|
return /* @__PURE__ */ jsx(
|
2888
2964
|
Grid$1.Item,
|
2889
2965
|
{
|
@@ -2892,7 +2968,11 @@ const RepeatableComponent = ({
|
|
2892
2968
|
xs: 12,
|
2893
2969
|
direction: "column",
|
2894
2970
|
alignItems: "stretch",
|
2895
|
-
children: children({
|
2971
|
+
children: children({
|
2972
|
+
...field,
|
2973
|
+
label: translatedLabel,
|
2974
|
+
name: completeFieldName
|
2975
|
+
})
|
2896
2976
|
},
|
2897
2977
|
completeFieldName
|
2898
2978
|
);
|
@@ -3107,11 +3187,11 @@ const AddComponentButton = ({
|
|
3107
3187
|
children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
|
3108
3188
|
/* @__PURE__ */ jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
|
3109
3189
|
/* @__PURE__ */ jsx(
|
3110
|
-
|
3190
|
+
Typography,
|
3111
3191
|
{
|
3112
3192
|
variant: "pi",
|
3113
3193
|
fontWeight: "bold",
|
3114
|
-
textColor: hasError && !isOpen ? "danger600" : "
|
3194
|
+
textColor: hasError && !isOpen ? "danger600" : "neutral600",
|
3115
3195
|
children
|
3116
3196
|
}
|
3117
3197
|
)
|
@@ -3128,43 +3208,14 @@ const StyledAddIcon = styled(PlusCircle)`
|
|
3128
3208
|
fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger200 : theme.colors.neutral150};
|
3129
3209
|
}
|
3130
3210
|
> path {
|
3131
|
-
fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.
|
3211
|
+
fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral500};
|
3132
3212
|
}
|
3133
3213
|
`;
|
3134
|
-
const AddComponentTitle = styled(Typography)``;
|
3135
3214
|
const StyledButton = styled(Button)`
|
3215
|
+
padding-left: ${({ theme }) => theme.spaces[3]};
|
3136
3216
|
border-radius: 26px;
|
3137
|
-
border-color: ${({ theme }) => theme.colors.neutral150};
|
3138
3217
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
3139
3218
|
height: 5rem;
|
3140
|
-
|
3141
|
-
&:hover {
|
3142
|
-
${AddComponentTitle} {
|
3143
|
-
color: ${({ theme }) => theme.colors.primary600};
|
3144
|
-
}
|
3145
|
-
|
3146
|
-
${StyledAddIcon} {
|
3147
|
-
> circle {
|
3148
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
3149
|
-
}
|
3150
|
-
> path {
|
3151
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
3152
|
-
}
|
3153
|
-
}
|
3154
|
-
}
|
3155
|
-
&:active {
|
3156
|
-
${AddComponentTitle} {
|
3157
|
-
color: ${({ theme }) => theme.colors.primary600};
|
3158
|
-
}
|
3159
|
-
${StyledAddIcon} {
|
3160
|
-
> circle {
|
3161
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
3162
|
-
}
|
3163
|
-
> path {
|
3164
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
3165
|
-
}
|
3166
|
-
}
|
3167
|
-
}
|
3168
3219
|
`;
|
3169
3220
|
const ComponentCategory = ({
|
3170
3221
|
category,
|
@@ -3736,8 +3787,7 @@ const Wrapper = styled.div`
|
|
3736
3787
|
`;
|
3737
3788
|
var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
|
3738
3789
|
function newlineAndIndentContinueMarkdownList(cm) {
|
3739
|
-
if (cm.getOption("disableInput"))
|
3740
|
-
return CodeMirror.Pass;
|
3790
|
+
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
3741
3791
|
var ranges = cm.listSelections(), replacements = [];
|
3742
3792
|
for (var i = 0; i < ranges.length; i++) {
|
3743
3793
|
var pos = ranges[i].head;
|
@@ -3771,8 +3821,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
|
|
3771
3821
|
var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
|
3772
3822
|
var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
|
3773
3823
|
replacements[i] = "\n" + indent + bullet + after;
|
3774
|
-
if (numbered)
|
3775
|
-
incrementRemainingMarkdownListNumbers(cm, pos);
|
3824
|
+
if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
|
3776
3825
|
}
|
3777
3826
|
}
|
3778
3827
|
cm.replaceSelections(replacements);
|
@@ -3790,10 +3839,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3790
3839
|
var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
|
3791
3840
|
var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
|
3792
3841
|
if (startIndent === nextIndent && !isNaN(nextNumber)) {
|
3793
|
-
if (newNumber === nextNumber)
|
3794
|
-
|
3795
|
-
if (newNumber > nextNumber)
|
3796
|
-
itemNumber = newNumber + 1;
|
3842
|
+
if (newNumber === nextNumber) itemNumber = nextNumber + 1;
|
3843
|
+
if (newNumber > nextNumber) itemNumber = newNumber + 1;
|
3797
3844
|
cm.replaceRange(
|
3798
3845
|
nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
|
3799
3846
|
{
|
@@ -3806,10 +3853,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3806
3853
|
}
|
3807
3854
|
);
|
3808
3855
|
} else {
|
3809
|
-
if (startIndent.length > nextIndent.length)
|
3810
|
-
|
3811
|
-
if (startIndent.length < nextIndent.length && lookAhead === 1)
|
3812
|
-
return;
|
3856
|
+
if (startIndent.length > nextIndent.length) return;
|
3857
|
+
if (startIndent.length < nextIndent.length && lookAhead === 1) return;
|
3813
3858
|
skipCount += 1;
|
3814
3859
|
}
|
3815
3860
|
}
|
@@ -5237,6 +5282,13 @@ const DynamicComponent = ({
|
|
5237
5282
|
alignItems: "stretch",
|
5238
5283
|
children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5239
5284
|
const fieldName = `${name2}.${index}.${field.name}`;
|
5285
|
+
const fieldWithTranslatedLabel = {
|
5286
|
+
...field,
|
5287
|
+
label: formatMessage({
|
5288
|
+
id: `content-manager.components.${componentUid}.${field.name}`,
|
5289
|
+
defaultMessage: field.label
|
5290
|
+
})
|
5291
|
+
};
|
5240
5292
|
return /* @__PURE__ */ jsx(
|
5241
5293
|
Grid$1.Item,
|
5242
5294
|
{
|
@@ -5245,7 +5297,7 @@ const DynamicComponent = ({
|
|
5245
5297
|
xs: 12,
|
5246
5298
|
direction: "column",
|
5247
5299
|
alignItems: "stretch",
|
5248
|
-
children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...
|
5300
|
+
children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
|
5249
5301
|
},
|
5250
5302
|
fieldName
|
5251
5303
|
);
|
@@ -5560,4 +5612,4 @@ export {
|
|
5560
5612
|
transformDocument as t,
|
5561
5613
|
useLazyComponents as u
|
5562
5614
|
};
|
5563
|
-
//# sourceMappingURL=Field-
|
5615
|
+
//# sourceMappingURL=Field-CvIunNOj.mjs.map
|