@strapi/content-manager 0.0.0-next.f4ec69568d980c6fee91ce2ee0f41c138347aa81 → 0.0.0-next.f698d55751345c4ca87477ef683475c1a68f310a
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-_g_oKvB0.js → ComponentConfigurationPage-BTR_hQow.js} +4 -5
- package/dist/_chunks/{ComponentConfigurationPage-_g_oKvB0.js.map → ComponentConfigurationPage-BTR_hQow.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-WXfrBq-Q.mjs → ComponentConfigurationPage-bLQr82ce.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-WXfrBq-Q.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-CRbOzCGy.mjs → EditConfigurationPage-BhRSnUsL.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-CRbOzCGy.mjs.map → EditConfigurationPage-BhRSnUsL.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-PD0wJ9L3.js → EditConfigurationPage-z39Wv3E6.js} +4 -5
- package/dist/_chunks/{EditConfigurationPage-PD0wJ9L3.js.map → EditConfigurationPage-z39Wv3E6.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-5Vpyf6AO.mjs → EditViewPage-BCjNxNlY.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-5Vpyf6AO.mjs.map → EditViewPage-BCjNxNlY.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-B_tonadE.js → EditViewPage-wujOq90c.js} +4 -5
- package/dist/_chunks/{EditViewPage-B_tonadE.js.map → EditViewPage-wujOq90c.js.map} +1 -1
- package/dist/_chunks/{Field-CbqsLSaw.js → Field-B5QXnctJ.js} +128 -69
- package/dist/_chunks/Field-B5QXnctJ.js.map +1 -0
- package/dist/_chunks/{Field-CvMC_y_i.mjs → Field-Byr3mPTl.mjs} +126 -67
- 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-DcK34IgP.mjs → Form-BZgvE8C8.mjs} +3 -3
- package/dist/_chunks/{Form-DcK34IgP.mjs.map → Form-BZgvE8C8.mjs.map} +1 -1
- package/dist/_chunks/{Form-BB0z-JxK.js → Form-D7mexvm3.js} +5 -6
- package/dist/_chunks/{Form-BB0z-JxK.js.map → Form-D7mexvm3.js.map} +1 -1
- package/dist/_chunks/{History-Bcj_FGwn.mjs → History-CqNgxkqK.mjs} +5 -5
- package/dist/_chunks/History-CqNgxkqK.mjs.map +1 -0
- package/dist/_chunks/{History-BD4ZcdUO.js → History-DYl2A8Z_.js} +6 -7
- package/dist/_chunks/History-DYl2A8Z_.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BLxjX7Pw.js → ListConfigurationPage-BXnu_OoY.js} +4 -5
- package/dist/_chunks/{ListConfigurationPage-BLxjX7Pw.js.map → ListConfigurationPage-BXnu_OoY.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-D6cBGWEz.mjs → ListConfigurationPage-BbQjzKkQ.mjs} +3 -3
- package/dist/_chunks/{ListConfigurationPage-D6cBGWEz.mjs.map → ListConfigurationPage-BbQjzKkQ.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-nUnSzeLc.js → ListViewPage-BtSi8C1l.js} +51 -51
- package/dist/_chunks/ListViewPage-BtSi8C1l.js.map +1 -0
- package/dist/_chunks/{ListViewPage-_2xuTV87.mjs → ListViewPage-D4ofkbjR.mjs} +50 -49
- package/dist/_chunks/ListViewPage-D4ofkbjR.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DerCWb61.js → NoContentTypePage-CitJeOq4.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-DerCWb61.js.map → NoContentTypePage-CitJeOq4.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-D07aE8fc.mjs → NoContentTypePage-DyUx5mXh.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-D07aE8fc.mjs.map → NoContentTypePage-DyUx5mXh.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-Bft8fI7p.mjs → NoPermissionsPage-DhIiyWkk.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-Bft8fI7p.mjs.map → NoPermissionsPage-DhIiyWkk.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BrcLxQs2.js → NoPermissionsPage-DzgWz0M-.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BrcLxQs2.js.map → NoPermissionsPage-DzgWz0M-.js.map} +1 -1
- package/dist/_chunks/{Preview-_n0hyyGd.mjs → Preview-BaYGJ0nb.mjs} +49 -12
- package/dist/_chunks/Preview-BaYGJ0nb.mjs.map +1 -0
- package/dist/_chunks/{Preview-d3J-Ku7A.js → Preview-DfNx8Ke-.js} +48 -12
- package/dist/_chunks/Preview-DfNx8Ke-.js.map +1 -0
- package/dist/_chunks/{Relations-C_1bopDf.mjs → Relations-DM2yUTST.mjs} +6 -8
- package/dist/_chunks/{Relations-C_1bopDf.mjs.map → Relations-DM2yUTST.mjs.map} +1 -1
- package/dist/_chunks/{Relations-BIX7Mm2F.js → Relations-DuKCaXrv.js} +7 -10
- package/dist/_chunks/{Relations-BIX7Mm2F.js.map → Relations-DuKCaXrv.js.map} +1 -1
- package/dist/_chunks/{en-DTWPCdTS.js → en-BK8Xyl5I.js} +3 -2
- package/dist/_chunks/{en-DTWPCdTS.js.map → en-BK8Xyl5I.js.map} +1 -1
- package/dist/_chunks/{en-CfIXaZf9.mjs → en-Dtk_ot79.mjs} +3 -2
- package/dist/_chunks/{en-CfIXaZf9.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
- package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
- package/dist/_chunks/{index-PscLJrm0.js → index-BUWEmX8m.js} +207 -135
- package/dist/_chunks/index-BUWEmX8m.js.map +1 -0
- package/dist/_chunks/{index-NgJzBbDY.mjs → index-DVAIIsOs.mjs} +206 -133
- package/dist/_chunks/index-DVAIIsOs.mjs.map +1 -0
- package/dist/_chunks/{layout-D5HneXd1.mjs → layout-Bxsv5mP7.mjs} +4 -4
- package/dist/_chunks/{layout-D5HneXd1.mjs.map → layout-Bxsv5mP7.mjs.map} +1 -1
- package/dist/_chunks/{layout-BFjOzyo2.js → layout-C3fN7Ejz.js} +5 -6
- package/dist/_chunks/{layout-BFjOzyo2.js.map → layout-C3fN7Ejz.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-BPyA_0mB.js → relations-BPZKAoEY.js} +2 -2
- package/dist/_chunks/{relations-BPyA_0mB.js.map → relations-BPZKAoEY.js.map} +1 -1
- package/dist/_chunks/{relations-BIjRMG_U.mjs → relations-o3pPhzY4.mjs} +2 -2
- package/dist/_chunks/{relations-BIjRMG_U.mjs.map → relations-o3pPhzY4.mjs.map} +1 -1
- 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 +1 -1
- package/dist/admin/src/content-manager.d.ts +3 -2
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
- 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/services/documents.d.ts +0 -3
- package/dist/server/index.js +74 -49
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +74 -48
- package/dist/server/index.mjs.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/package.json +12 -10
- package/dist/_chunks/Field-CbqsLSaw.js.map +0 -1
- package/dist/_chunks/Field-CvMC_y_i.mjs.map +0 -1
- package/dist/_chunks/History-BD4ZcdUO.js.map +0 -1
- package/dist/_chunks/History-Bcj_FGwn.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-_2xuTV87.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-nUnSzeLc.js.map +0 -1
- package/dist/_chunks/Preview-_n0hyyGd.mjs.map +0 -1
- package/dist/_chunks/Preview-d3J-Ku7A.js.map +0 -1
- package/dist/_chunks/index-NgJzBbDY.mjs.map +0 -1
- package/dist/_chunks/index-PscLJrm0.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-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-
|
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"
|
@@ -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,26 +2698,25 @@ 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,
|
@@ -3749,8 +3814,7 @@ const Wrapper = styled.div`
|
|
3749
3814
|
`;
|
3750
3815
|
var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
|
3751
3816
|
function newlineAndIndentContinueMarkdownList(cm) {
|
3752
|
-
if (cm.getOption("disableInput"))
|
3753
|
-
return CodeMirror.Pass;
|
3817
|
+
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
3754
3818
|
var ranges = cm.listSelections(), replacements = [];
|
3755
3819
|
for (var i = 0; i < ranges.length; i++) {
|
3756
3820
|
var pos = ranges[i].head;
|
@@ -3784,8 +3848,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
|
|
3784
3848
|
var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
|
3785
3849
|
var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
|
3786
3850
|
replacements[i] = "\n" + indent + bullet + after;
|
3787
|
-
if (numbered)
|
3788
|
-
incrementRemainingMarkdownListNumbers(cm, pos);
|
3851
|
+
if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
|
3789
3852
|
}
|
3790
3853
|
}
|
3791
3854
|
cm.replaceSelections(replacements);
|
@@ -3803,10 +3866,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3803
3866
|
var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
|
3804
3867
|
var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
|
3805
3868
|
if (startIndent === nextIndent && !isNaN(nextNumber)) {
|
3806
|
-
if (newNumber === nextNumber)
|
3807
|
-
|
3808
|
-
if (newNumber > nextNumber)
|
3809
|
-
itemNumber = newNumber + 1;
|
3869
|
+
if (newNumber === nextNumber) itemNumber = nextNumber + 1;
|
3870
|
+
if (newNumber > nextNumber) itemNumber = newNumber + 1;
|
3810
3871
|
cm.replaceRange(
|
3811
3872
|
nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
|
3812
3873
|
{
|
@@ -3819,10 +3880,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3819
3880
|
}
|
3820
3881
|
);
|
3821
3882
|
} else {
|
3822
|
-
if (startIndent.length > nextIndent.length)
|
3823
|
-
|
3824
|
-
if (startIndent.length < nextIndent.length && lookAhead === 1)
|
3825
|
-
return;
|
3883
|
+
if (startIndent.length > nextIndent.length) return;
|
3884
|
+
if (startIndent.length < nextIndent.length && lookAhead === 1) return;
|
3826
3885
|
skipCount += 1;
|
3827
3886
|
}
|
3828
3887
|
}
|
@@ -5580,4 +5639,4 @@ export {
|
|
5580
5639
|
transformDocument as t,
|
5581
5640
|
useLazyComponents as u
|
5582
5641
|
};
|
5583
|
-
//# sourceMappingURL=Field-
|
5642
|
+
//# sourceMappingURL=Field-Byr3mPTl.mjs.map
|