@strapi/content-manager 0.0.0-experimental.d954d57341a6623992a0d211daaec8e245c3517d → 0.0.0-experimental.e14656d3b8681880212c13260b9a2b340c182f2d
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/LICENSE +18 -3
- package/dist/_chunks/{ComponentConfigurationPage-WRPUXGd6.js → ComponentConfigurationPage-D_M8iBw5.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-WRPUXGd6.js.map → ComponentConfigurationPage-D_M8iBw5.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-gdUj_t-O.mjs → ComponentConfigurationPage-qemkOlnj.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-gdUj_t-O.mjs.map → ComponentConfigurationPage-qemkOlnj.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-C1vjMBgy.js → EditConfigurationPage-BePwPuHy.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-C1vjMBgy.js.map → EditConfigurationPage-BePwPuHy.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BwuIPOJG.mjs → EditConfigurationPage-CjUrEewK.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BwuIPOJG.mjs.map → EditConfigurationPage-CjUrEewK.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-DbcGfyqK.js → EditViewPage-B-RJeiJD.js} +19 -8
- package/dist/_chunks/EditViewPage-B-RJeiJD.js.map +1 -0
- package/dist/_chunks/{EditViewPage-0MiFkXa8.mjs → EditViewPage-De8GyU8P.mjs} +19 -8
- package/dist/_chunks/EditViewPage-De8GyU8P.mjs.map +1 -0
- package/dist/_chunks/{Field-BG1xu38N.js → Field-dq8Tg1M_.js} +444 -86
- package/dist/_chunks/Field-dq8Tg1M_.js.map +1 -0
- package/dist/_chunks/{Field-BDMSCcy5.mjs → Field-pb2o8uBe.mjs} +446 -88
- package/dist/_chunks/Field-pb2o8uBe.mjs.map +1 -0
- package/dist/_chunks/{Form-9BnFyUjy.js → Form-DGIf4jQU.js} +26 -12
- package/dist/_chunks/Form-DGIf4jQU.js.map +1 -0
- package/dist/_chunks/{Form-CPVWavB8.mjs → Form-DJn0Dxha.mjs} +26 -12
- package/dist/_chunks/Form-DJn0Dxha.mjs.map +1 -0
- package/dist/_chunks/{History-BVpd8LP3.mjs → History-BowL3JKP.mjs} +44 -19
- package/dist/_chunks/History-BowL3JKP.mjs.map +1 -0
- package/dist/_chunks/{History-BWWxLt2Z.js → History-Dh2NEHnR.js} +44 -19
- package/dist/_chunks/History-Dh2NEHnR.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DozVMKcR.mjs → ListConfigurationPage-BpVOB-hn.mjs} +20 -8
- package/dist/_chunks/ListConfigurationPage-BpVOB-hn.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-6swzjdAZ.js → ListConfigurationPage-BxYCWz9e.js} +20 -8
- package/dist/_chunks/ListConfigurationPage-BxYCWz9e.js.map +1 -0
- package/dist/_chunks/{ListViewPage-BlzfjS2Q.js → ListViewPage-4XsciqHZ.js} +21 -7
- package/dist/_chunks/ListViewPage-4XsciqHZ.js.map +1 -0
- package/dist/_chunks/{ListViewPage-Ds0ulgfG.mjs → ListViewPage-CXFUjZQC.mjs} +22 -8
- package/dist/_chunks/ListViewPage-CXFUjZQC.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-D2nCCWEl.js → NoContentTypePage-C8OpoHeU.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-D2nCCWEl.js.map → NoContentTypePage-C8OpoHeU.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BH11kaKt.mjs → NoContentTypePage-DuhOTp3x.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-BH11kaKt.mjs.map → NoContentTypePage-DuhOTp3x.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BT2Tn0D_.mjs → NoPermissionsPage-DVz3mzDz.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BT2Tn0D_.mjs.map → NoPermissionsPage-DVz3mzDz.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DN_JlsU2.js → NoPermissionsPage-y_r7DVA2.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DN_JlsU2.js.map → NoPermissionsPage-y_r7DVA2.js.map} +1 -1
- package/dist/_chunks/{Relations-Dnag3fhV.mjs → Relations-CVNLrn1Y.mjs} +4 -4
- package/dist/_chunks/Relations-CVNLrn1Y.mjs.map +1 -0
- package/dist/_chunks/{Relations-CcgFTcWo.js → Relations-DPFCAa7b.js} +4 -4
- package/dist/_chunks/Relations-DPFCAa7b.js.map +1 -0
- package/dist/_chunks/{en-Ux26r5pl.mjs → en-BrCTWlZv.mjs} +5 -4
- package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-BrCTWlZv.mjs.map} +1 -1
- package/dist/_chunks/{en-fbKQxLGn.js → en-uOUIxfcQ.js} +5 -4
- package/dist/_chunks/{en-fbKQxLGn.js.map → en-uOUIxfcQ.js.map} +1 -1
- package/dist/_chunks/{index-CWpLBSt0.js → index-C3fJE-1-.js} +390 -169
- package/dist/_chunks/index-C3fJE-1-.js.map +1 -0
- package/dist/_chunks/{index-JNNNKUHs.mjs → index-DiMrfcfy.mjs} +397 -176
- package/dist/_chunks/index-DiMrfcfy.mjs.map +1 -0
- package/dist/_chunks/{layout--iHdZzRk.js → layout-C788OmNr.js} +23 -11
- package/dist/_chunks/layout-C788OmNr.js.map +1 -0
- package/dist/_chunks/{layout-DC503LnF.mjs → layout-ls3gxfpH.mjs} +25 -13
- package/dist/_chunks/layout-ls3gxfpH.mjs.map +1 -0
- package/dist/_chunks/{relations-CTje5t-a.mjs → relations-CLcOmGO0.mjs} +2 -2
- package/dist/_chunks/{relations-CTje5t-a.mjs.map → relations-CLcOmGO0.mjs.map} +1 -1
- package/dist/_chunks/{relations-BbHizA5K.js → relations-DYeotliT.js} +2 -2
- package/dist/_chunks/{relations-BbHizA5K.js.map → relations-DYeotliT.js.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +10 -22
- 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 -16
- package/dist/admin/src/services/init.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +2 -2
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/validation.d.ts +4 -1
- package/dist/server/index.js +166 -108
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +167 -109
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
- package/dist/server/src/controllers/validation/dimensions.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 +1 -1
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/policies/hasPermissions.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.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/_chunks/EditViewPage-0MiFkXa8.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DbcGfyqK.js.map +0 -1
- package/dist/_chunks/Field-BDMSCcy5.mjs.map +0 -1
- package/dist/_chunks/Field-BG1xu38N.js.map +0 -1
- package/dist/_chunks/Form-9BnFyUjy.js.map +0 -1
- package/dist/_chunks/Form-CPVWavB8.mjs.map +0 -1
- package/dist/_chunks/History-BVpd8LP3.mjs.map +0 -1
- package/dist/_chunks/History-BWWxLt2Z.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-6swzjdAZ.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DozVMKcR.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BlzfjS2Q.js.map +0 -1
- package/dist/_chunks/ListViewPage-Ds0ulgfG.mjs.map +0 -1
- package/dist/_chunks/Relations-CcgFTcWo.js.map +0 -1
- package/dist/_chunks/Relations-Dnag3fhV.mjs.map +0 -1
- package/dist/_chunks/index-CWpLBSt0.js.map +0 -1
- package/dist/_chunks/index-JNNNKUHs.mjs.map +0 -1
- package/dist/_chunks/layout--iHdZzRk.js.map +0 -1
- package/dist/_chunks/layout-DC503LnF.mjs.map +0 -1
@@ -2,12 +2,12 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
3
3
|
import { useState, useEffect, useCallback, memo } from "react";
|
4
4
|
import { useStrapiApp, createContext, useField, useNotification, useForm, useAPIErrorHandler, useQueryParams, useFocusInputField, InputRenderer as InputRenderer$1 } from "@strapi/admin/strapi-admin";
|
5
|
-
import { Typography, Flex,
|
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, d as buildValidParams, f as useDocumentRBAC,
|
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-DiMrfcfy.mjs";
|
9
9
|
import { generateNKeysBetween } from "fractional-indexing";
|
10
|
-
import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-
|
10
|
+
import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-CVNLrn1Y.mjs";
|
11
11
|
import { Code, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, 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";
|
@@ -19,7 +19,7 @@ import { withHistory } from "slate-history";
|
|
19
19
|
import { useFocused, useSelected, ReactEditor, Editable, useSlate, Slate, withReact } from "slate-react";
|
20
20
|
import { p as prefixFileUrlWithBackendUrl, u as usePrev } from "./usePrev-DH6iah0A.mjs";
|
21
21
|
import * as Toolbar from "@radix-ui/react-toolbar";
|
22
|
-
import { useLocation } from "react-router-dom";
|
22
|
+
import { useLocation, useMatch } from "react-router-dom";
|
23
23
|
import CodeMirror from "codemirror5";
|
24
24
|
import sanitizeHtml from "sanitize-html";
|
25
25
|
import { getLanguage, highlight, highlightAuto } from "highlight.js";
|
@@ -160,6 +160,220 @@ const useLazyComponents = (componentUids = []) => {
|
|
160
160
|
}, []);
|
161
161
|
return { isLazyLoading: loading, lazyComponentStore, cleanup };
|
162
162
|
};
|
163
|
+
const codeLanguages = [
|
164
|
+
{
|
165
|
+
value: "asm",
|
166
|
+
label: "Assembly"
|
167
|
+
},
|
168
|
+
{
|
169
|
+
value: "bash",
|
170
|
+
label: "Bash"
|
171
|
+
},
|
172
|
+
{
|
173
|
+
value: "c",
|
174
|
+
label: "C"
|
175
|
+
},
|
176
|
+
{
|
177
|
+
value: "clojure",
|
178
|
+
label: "Clojure"
|
179
|
+
},
|
180
|
+
{
|
181
|
+
value: "cobol",
|
182
|
+
label: "COBOL"
|
183
|
+
},
|
184
|
+
{
|
185
|
+
value: "cpp",
|
186
|
+
label: "C++"
|
187
|
+
},
|
188
|
+
{
|
189
|
+
value: "csharp",
|
190
|
+
label: "C#"
|
191
|
+
},
|
192
|
+
{
|
193
|
+
value: "css",
|
194
|
+
label: "CSS"
|
195
|
+
},
|
196
|
+
{
|
197
|
+
value: "dart",
|
198
|
+
label: "Dart"
|
199
|
+
},
|
200
|
+
{
|
201
|
+
value: "dockerfile",
|
202
|
+
label: "Dockerfile"
|
203
|
+
},
|
204
|
+
{
|
205
|
+
value: "elixir",
|
206
|
+
label: "Elixir"
|
207
|
+
},
|
208
|
+
{
|
209
|
+
value: "erlang",
|
210
|
+
label: "Erlang"
|
211
|
+
},
|
212
|
+
{
|
213
|
+
value: "fortran",
|
214
|
+
label: "Fortran"
|
215
|
+
},
|
216
|
+
{
|
217
|
+
value: "fsharp",
|
218
|
+
label: "F#"
|
219
|
+
},
|
220
|
+
{
|
221
|
+
value: "go",
|
222
|
+
label: "Go"
|
223
|
+
},
|
224
|
+
{
|
225
|
+
value: "graphql",
|
226
|
+
label: "GraphQL"
|
227
|
+
},
|
228
|
+
{
|
229
|
+
value: "groovy",
|
230
|
+
label: "Groovy"
|
231
|
+
},
|
232
|
+
{
|
233
|
+
value: "haskell",
|
234
|
+
label: "Haskell"
|
235
|
+
},
|
236
|
+
{
|
237
|
+
value: "haxe",
|
238
|
+
label: "Haxe"
|
239
|
+
},
|
240
|
+
{
|
241
|
+
value: "html",
|
242
|
+
label: "HTML"
|
243
|
+
},
|
244
|
+
{
|
245
|
+
value: "ini",
|
246
|
+
label: "INI"
|
247
|
+
},
|
248
|
+
{
|
249
|
+
value: "java",
|
250
|
+
label: "Java"
|
251
|
+
},
|
252
|
+
{
|
253
|
+
value: "javascript",
|
254
|
+
label: "JavaScript"
|
255
|
+
},
|
256
|
+
{
|
257
|
+
value: "jsx",
|
258
|
+
label: "JavaScript (React)"
|
259
|
+
},
|
260
|
+
{
|
261
|
+
value: "json",
|
262
|
+
label: "JSON"
|
263
|
+
},
|
264
|
+
{
|
265
|
+
value: "julia",
|
266
|
+
label: "Julia"
|
267
|
+
},
|
268
|
+
{
|
269
|
+
value: "kotlin",
|
270
|
+
label: "Kotlin"
|
271
|
+
},
|
272
|
+
{
|
273
|
+
value: "latex",
|
274
|
+
label: "LaTeX"
|
275
|
+
},
|
276
|
+
{
|
277
|
+
value: "lua",
|
278
|
+
label: "Lua"
|
279
|
+
},
|
280
|
+
{
|
281
|
+
value: "markdown",
|
282
|
+
label: "Markdown"
|
283
|
+
},
|
284
|
+
{
|
285
|
+
value: "matlab",
|
286
|
+
label: "MATLAB"
|
287
|
+
},
|
288
|
+
{
|
289
|
+
value: "makefile",
|
290
|
+
label: "Makefile"
|
291
|
+
},
|
292
|
+
{
|
293
|
+
value: "objectivec",
|
294
|
+
label: "Objective-C"
|
295
|
+
},
|
296
|
+
{
|
297
|
+
value: "perl",
|
298
|
+
label: "Perl"
|
299
|
+
},
|
300
|
+
{
|
301
|
+
value: "php",
|
302
|
+
label: "PHP"
|
303
|
+
},
|
304
|
+
{
|
305
|
+
value: "plaintext",
|
306
|
+
label: "Plain text"
|
307
|
+
},
|
308
|
+
{
|
309
|
+
value: "powershell",
|
310
|
+
label: "PowerShell"
|
311
|
+
},
|
312
|
+
{
|
313
|
+
value: "python",
|
314
|
+
label: "Python"
|
315
|
+
},
|
316
|
+
{
|
317
|
+
value: "r",
|
318
|
+
label: "R"
|
319
|
+
},
|
320
|
+
{
|
321
|
+
value: "ruby",
|
322
|
+
label: "Ruby"
|
323
|
+
},
|
324
|
+
{
|
325
|
+
value: "rust",
|
326
|
+
label: "Rust"
|
327
|
+
},
|
328
|
+
{
|
329
|
+
value: "sas",
|
330
|
+
label: "SAS"
|
331
|
+
},
|
332
|
+
{
|
333
|
+
value: "scala",
|
334
|
+
label: "Scala"
|
335
|
+
},
|
336
|
+
{
|
337
|
+
value: "scheme",
|
338
|
+
label: "Scheme"
|
339
|
+
},
|
340
|
+
{
|
341
|
+
value: "shell",
|
342
|
+
label: "Shell"
|
343
|
+
},
|
344
|
+
{
|
345
|
+
value: "sql",
|
346
|
+
label: "SQL"
|
347
|
+
},
|
348
|
+
{
|
349
|
+
value: "stata",
|
350
|
+
label: "Stata"
|
351
|
+
},
|
352
|
+
{
|
353
|
+
value: "swift",
|
354
|
+
label: "Swift"
|
355
|
+
},
|
356
|
+
{
|
357
|
+
value: "typescript",
|
358
|
+
label: "TypeScript"
|
359
|
+
},
|
360
|
+
{
|
361
|
+
value: "tsx",
|
362
|
+
label: "TypeScript (React)"
|
363
|
+
},
|
364
|
+
{
|
365
|
+
value: "vbnet",
|
366
|
+
label: "VB.NET"
|
367
|
+
},
|
368
|
+
{
|
369
|
+
value: "xml",
|
370
|
+
label: "XML"
|
371
|
+
},
|
372
|
+
{
|
373
|
+
value: "yaml",
|
374
|
+
label: "YAML"
|
375
|
+
}
|
376
|
+
];
|
163
377
|
const baseHandleConvert = (editor, attributesToSet) => {
|
164
378
|
const [_, lastNodePath] = Editor$1.last(editor, []);
|
165
379
|
Transforms.unwrapNodes(editor, {
|
@@ -230,6 +444,7 @@ const CodeBlock = styled.pre`
|
|
230
444
|
overflow: auto;
|
231
445
|
padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};
|
232
446
|
flex-shrink: 1;
|
447
|
+
|
233
448
|
& > code {
|
234
449
|
font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,
|
235
450
|
monospace;
|
@@ -238,9 +453,61 @@ const CodeBlock = styled.pre`
|
|
238
453
|
max-width: 100%;
|
239
454
|
}
|
240
455
|
`;
|
456
|
+
const CodeEditor = (props) => {
|
457
|
+
const { editor } = useBlocksEditorContext("ImageDialog");
|
458
|
+
const editorIsFocused = useFocused();
|
459
|
+
const imageIsSelected = useSelected();
|
460
|
+
const { formatMessage } = useIntl();
|
461
|
+
const [isSelectOpen, setIsSelectOpen] = React.useState(false);
|
462
|
+
const shouldDisplayLanguageSelect = editorIsFocused && imageIsSelected || isSelectOpen;
|
463
|
+
return /* @__PURE__ */ jsxs(Box, { position: "relative", width: "100%", children: [
|
464
|
+
/* @__PURE__ */ jsx(CodeBlock, { ...props.attributes, children: /* @__PURE__ */ jsx("code", { children: props.children }) }),
|
465
|
+
shouldDisplayLanguageSelect && /* @__PURE__ */ jsx(
|
466
|
+
Box,
|
467
|
+
{
|
468
|
+
position: "absolute",
|
469
|
+
background: "neutral0",
|
470
|
+
borderColor: "neutral150",
|
471
|
+
borderStyle: "solid",
|
472
|
+
borderWidth: "0.5px",
|
473
|
+
shadow: "tableShadow",
|
474
|
+
top: "100%",
|
475
|
+
marginTop: 1,
|
476
|
+
right: 0,
|
477
|
+
padding: 1,
|
478
|
+
hasRadius: true,
|
479
|
+
children: /* @__PURE__ */ jsx(
|
480
|
+
SingleSelect,
|
481
|
+
{
|
482
|
+
onChange: (open) => {
|
483
|
+
Transforms.setNodes(
|
484
|
+
editor,
|
485
|
+
{ language: open.toString() },
|
486
|
+
{ match: (node) => !Editor$1.isEditor(node) && node.type === "code" }
|
487
|
+
);
|
488
|
+
},
|
489
|
+
value: props.element.type === "code" && props.element.language || "plaintext",
|
490
|
+
onOpenChange: (open) => {
|
491
|
+
setIsSelectOpen(open);
|
492
|
+
if (!open) {
|
493
|
+
ReactEditor.focus(editor);
|
494
|
+
}
|
495
|
+
},
|
496
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
497
|
+
"aria-label": formatMessage({
|
498
|
+
id: "components.Blocks.blocks.code.languageLabel",
|
499
|
+
defaultMessage: "Select a language"
|
500
|
+
}),
|
501
|
+
children: codeLanguages.map(({ value, label }) => /* @__PURE__ */ jsx(SingleSelectOption, { value, children: label }, value))
|
502
|
+
}
|
503
|
+
)
|
504
|
+
}
|
505
|
+
)
|
506
|
+
] });
|
507
|
+
};
|
241
508
|
const codeBlocks = {
|
242
509
|
code: {
|
243
|
-
renderElement: (props) => /* @__PURE__ */ jsx(
|
510
|
+
renderElement: (props) => /* @__PURE__ */ jsx(CodeEditor, { ...props }),
|
244
511
|
icon: Code,
|
245
512
|
label: {
|
246
513
|
id: "components.Blocks.blocks.code",
|
@@ -249,7 +516,7 @@ const codeBlocks = {
|
|
249
516
|
matchNode: (node) => node.type === "code",
|
250
517
|
isInBlocksSelector: true,
|
251
518
|
handleConvert(editor) {
|
252
|
-
baseHandleConvert(editor, { type: "code" });
|
519
|
+
baseHandleConvert(editor, { type: "code", language: "plaintext" });
|
253
520
|
},
|
254
521
|
handleEnterKey(editor) {
|
255
522
|
pressEnterTwiceToExit(editor);
|
@@ -593,20 +860,8 @@ const LinkContent = React.forwardRef(
|
|
593
860
|
const [linkText, setLinkText] = React.useState(elementText);
|
594
861
|
const [linkUrl, setLinkUrl] = React.useState(link.url);
|
595
862
|
const linkInputRef = React.useRef(null);
|
596
|
-
const
|
863
|
+
const isLastInsertedLink = editor.lastInsertedLinkPath ? !Path.equals(path, editor.lastInsertedLinkPath) : true;
|
597
864
|
const [isSaveDisabled, setIsSaveDisabled] = React.useState(false);
|
598
|
-
const handleOpenChange = (isOpen) => {
|
599
|
-
if (isOpen) {
|
600
|
-
setPopoverOpen(isOpen);
|
601
|
-
setShowRemoveButton(isOpen);
|
602
|
-
} else {
|
603
|
-
setPopoverOpen(isOpen);
|
604
|
-
if (link.url === "") {
|
605
|
-
removeLink(editor);
|
606
|
-
}
|
607
|
-
ReactEditor.focus(editor);
|
608
|
-
}
|
609
|
-
};
|
610
865
|
const onLinkChange = (e) => {
|
611
866
|
setIsSaveDisabled(false);
|
612
867
|
setLinkUrl(e.target.value);
|
@@ -627,15 +882,33 @@ const LinkContent = React.forwardRef(
|
|
627
882
|
editLink(editor, { url: linkUrl, text: linkText });
|
628
883
|
setPopoverOpen(false);
|
629
884
|
editor.lastInsertedLinkPath = null;
|
885
|
+
ReactEditor.focus(editor);
|
886
|
+
};
|
887
|
+
const handleClose = () => {
|
888
|
+
if (link.url === "") {
|
889
|
+
removeLink(editor);
|
890
|
+
}
|
891
|
+
setPopoverOpen(false);
|
892
|
+
ReactEditor.focus(editor);
|
630
893
|
};
|
631
894
|
React.useEffect(() => {
|
632
895
|
if (popoverOpen)
|
633
896
|
linkInputRef.current?.focus();
|
634
897
|
}, [popoverOpen]);
|
635
898
|
const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
|
636
|
-
return /* @__PURE__ */ jsxs(Popover.Root, {
|
637
|
-
/* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
638
|
-
|
899
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
|
900
|
+
/* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
901
|
+
StyledBaseLink,
|
902
|
+
{
|
903
|
+
...attributes,
|
904
|
+
ref: forwardedRef,
|
905
|
+
href: link.url,
|
906
|
+
onClick: () => setPopoverOpen(true),
|
907
|
+
color: "primary600",
|
908
|
+
children
|
909
|
+
}
|
910
|
+
) }),
|
911
|
+
/* @__PURE__ */ jsx(Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxs(Flex, { padding: 4, direction: "column", gap: 4, children: [
|
639
912
|
/* @__PURE__ */ jsx(Field.Root, { width: "368px", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
|
640
913
|
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
641
914
|
id: "components.Blocks.popover.text",
|
@@ -681,7 +954,7 @@ const LinkContent = React.forwardRef(
|
|
681
954
|
{
|
682
955
|
variant: "danger-light",
|
683
956
|
onClick: () => removeLink(editor),
|
684
|
-
$visible:
|
957
|
+
$visible: isLastInsertedLink,
|
685
958
|
children: formatMessage({
|
686
959
|
id: "components.Blocks.popover.remove",
|
687
960
|
defaultMessage: "Remove"
|
@@ -689,11 +962,11 @@ const LinkContent = React.forwardRef(
|
|
689
962
|
}
|
690
963
|
),
|
691
964
|
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
692
|
-
/* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick:
|
965
|
+
/* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
|
693
966
|
id: "components.Blocks.popover.cancel",
|
694
967
|
defaultMessage: "Cancel"
|
695
968
|
}) }),
|
696
|
-
/* @__PURE__ */ jsx(Button, {
|
969
|
+
/* @__PURE__ */ jsx(Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
|
697
970
|
id: "components.Blocks.popover.save",
|
698
971
|
defaultMessage: "Save"
|
699
972
|
}) })
|
@@ -1279,6 +1552,26 @@ const ListButton = ({ block, format }) => {
|
|
1279
1552
|
}
|
1280
1553
|
return false;
|
1281
1554
|
};
|
1555
|
+
const isListDisabled = () => {
|
1556
|
+
if (disabled) {
|
1557
|
+
return true;
|
1558
|
+
}
|
1559
|
+
if (!editor.selection) {
|
1560
|
+
return false;
|
1561
|
+
}
|
1562
|
+
const anchorNodeEntry = Editor$1.above(editor, {
|
1563
|
+
at: editor.selection.anchor,
|
1564
|
+
match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
|
1565
|
+
});
|
1566
|
+
const focusNodeEntry = Editor$1.above(editor, {
|
1567
|
+
at: editor.selection.focus,
|
1568
|
+
match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
|
1569
|
+
});
|
1570
|
+
if (!anchorNodeEntry || !focusNodeEntry) {
|
1571
|
+
return false;
|
1572
|
+
}
|
1573
|
+
return anchorNodeEntry[0] !== focusNodeEntry[0];
|
1574
|
+
};
|
1282
1575
|
const toggleList = (format2) => {
|
1283
1576
|
let currentListEntry;
|
1284
1577
|
if (editor.selection) {
|
@@ -1312,7 +1605,7 @@ const ListButton = ({ block, format }) => {
|
|
1312
1605
|
name: format,
|
1313
1606
|
label: block.label,
|
1314
1607
|
isActive: isListActive(),
|
1315
|
-
disabled,
|
1608
|
+
disabled: isListDisabled(),
|
1316
1609
|
handleClick: () => toggleList(format)
|
1317
1610
|
}
|
1318
1611
|
);
|
@@ -1479,7 +1772,7 @@ const DragIconButton = styled(IconButton)`
|
|
1479
1772
|
}
|
1480
1773
|
svg {
|
1481
1774
|
height: auto;
|
1482
|
-
width: ${({ theme }) => theme.spaces[3]};
|
1775
|
+
min-width: ${({ theme }) => theme.spaces[3]};
|
1483
1776
|
|
1484
1777
|
path {
|
1485
1778
|
fill: ${({ theme }) => theme.colors.neutral700};
|
@@ -1596,7 +1889,7 @@ const DragAndDropElement = ({
|
|
1596
1889
|
disabled,
|
1597
1890
|
draggable: true,
|
1598
1891
|
$dragHandleTopMargin: dragHandleTopMargin,
|
1599
|
-
children: /* @__PURE__ */ jsx(Drag, { color: "
|
1892
|
+
children: /* @__PURE__ */ jsx(Drag, { color: "primary500" })
|
1600
1893
|
}
|
1601
1894
|
),
|
1602
1895
|
children
|
@@ -1920,7 +2213,7 @@ const EditorLayout$1 = ({
|
|
1920
2213
|
/* @__PURE__ */ jsx(
|
1921
2214
|
CollapseIconButton,
|
1922
2215
|
{
|
1923
|
-
|
2216
|
+
label: formatMessage({
|
1924
2217
|
id: getTranslation("components.Blocks.collapse"),
|
1925
2218
|
defaultMessage: "Collapse"
|
1926
2219
|
}),
|
@@ -2259,7 +2552,7 @@ const BlocksEditor = React.forwardRef(
|
|
2259
2552
|
!isExpandedMode && /* @__PURE__ */ jsx(
|
2260
2553
|
ExpandIconButton,
|
2261
2554
|
{
|
2262
|
-
|
2555
|
+
label: formatMessage({
|
2263
2556
|
id: getTranslation("components.Blocks.expand"),
|
2264
2557
|
defaultMessage: "Expand"
|
2265
2558
|
}),
|
@@ -2325,30 +2618,27 @@ const createDefaultForm = (contentType, components = {}) => {
|
|
2325
2618
|
const Initializer = ({ disabled, name: name2, onClick }) => {
|
2326
2619
|
const { formatMessage } = useIntl();
|
2327
2620
|
const field = useField(name2);
|
2328
|
-
return /* @__PURE__ */
|
2329
|
-
|
2330
|
-
|
2331
|
-
|
2332
|
-
|
2333
|
-
|
2334
|
-
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
|
2345
|
-
|
2346
|
-
|
2347
|
-
|
2348
|
-
|
2349
|
-
),
|
2350
|
-
field.error && /* @__PURE__ */ jsx(Typography, { textColor: "danger600", variant: "pi", children: field.error })
|
2351
|
-
] });
|
2621
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
2622
|
+
Box,
|
2623
|
+
{
|
2624
|
+
tag: "button",
|
2625
|
+
background: "neutral100",
|
2626
|
+
borderColor: field.error ? "danger600" : "neutral200",
|
2627
|
+
hasRadius: true,
|
2628
|
+
disabled,
|
2629
|
+
onClick,
|
2630
|
+
paddingTop: 9,
|
2631
|
+
paddingBottom: 9,
|
2632
|
+
type: "button",
|
2633
|
+
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
2634
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(CircleIcon, {}) }),
|
2635
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
|
2636
|
+
id: getTranslation("components.empty-repeatable"),
|
2637
|
+
defaultMessage: "No entry yet. Click on the button below to add one."
|
2638
|
+
}) }) })
|
2639
|
+
] })
|
2640
|
+
}
|
2641
|
+
) });
|
2352
2642
|
};
|
2353
2643
|
const CircleIcon = styled(PlusCircle)`
|
2354
2644
|
width: 2.4rem;
|
@@ -2382,7 +2672,18 @@ const NonRepeatableComponent = ({
|
|
2382
2672
|
children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
|
2383
2673
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2384
2674
|
const completeFieldName = `${name2}.${field.name}`;
|
2385
|
-
return /* @__PURE__ */ jsx(
|
2675
|
+
return /* @__PURE__ */ jsx(
|
2676
|
+
Grid$1.Item,
|
2677
|
+
{
|
2678
|
+
col: size,
|
2679
|
+
s: 12,
|
2680
|
+
xs: 12,
|
2681
|
+
direction: "column",
|
2682
|
+
alignItems: "stretch",
|
2683
|
+
children: children({ ...field, name: completeFieldName })
|
2684
|
+
},
|
2685
|
+
completeFieldName
|
2686
|
+
);
|
2386
2687
|
}) }, index);
|
2387
2688
|
}) })
|
2388
2689
|
}
|
@@ -2560,7 +2861,18 @@ const RepeatableComponent = ({
|
|
2560
2861
|
children: layout.map((row, index2) => {
|
2561
2862
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2562
2863
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2563
|
-
return /* @__PURE__ */ jsx(
|
2864
|
+
return /* @__PURE__ */ jsx(
|
2865
|
+
Grid$1.Item,
|
2866
|
+
{
|
2867
|
+
col: size,
|
2868
|
+
s: 12,
|
2869
|
+
xs: 12,
|
2870
|
+
direction: "column",
|
2871
|
+
alignItems: "stretch",
|
2872
|
+
children: children({ ...field, name: completeFieldName })
|
2873
|
+
},
|
2874
|
+
completeFieldName
|
2875
|
+
);
|
2564
2876
|
}) }, index2);
|
2565
2877
|
})
|
2566
2878
|
}
|
@@ -2655,7 +2967,7 @@ const Component = ({
|
|
2655
2967
|
/* @__PURE__ */ jsx(
|
2656
2968
|
IconButton,
|
2657
2969
|
{
|
2658
|
-
|
2970
|
+
variant: "ghost",
|
2659
2971
|
onClick: onDeleteComponent,
|
2660
2972
|
label: formatMessage({
|
2661
2973
|
id: getTranslation("containers.Edit.delete"),
|
@@ -2668,7 +2980,7 @@ const Component = ({
|
|
2668
2980
|
IconButton,
|
2669
2981
|
{
|
2670
2982
|
ref: composedAccordionRefs,
|
2671
|
-
|
2983
|
+
variant: "ghost",
|
2672
2984
|
onClick: (e) => e.stopPropagation(),
|
2673
2985
|
"data-handler-id": handlerId,
|
2674
2986
|
label: formatMessage({
|
@@ -2738,7 +3050,7 @@ const ComponentInput = ({
|
|
2738
3050
|
id: getTranslation("components.reset-entry"),
|
2739
3051
|
defaultMessage: "Reset Entry"
|
2740
3052
|
}),
|
2741
|
-
|
3053
|
+
variant: "ghost",
|
2742
3054
|
onClick: () => {
|
2743
3055
|
field.onChange(name2, null);
|
2744
3056
|
},
|
@@ -2767,11 +3079,8 @@ const AddComponentButton = ({
|
|
2767
3079
|
onClick,
|
2768
3080
|
disabled: isDisabled,
|
2769
3081
|
background: "neutral0",
|
2770
|
-
paddingTop: 3,
|
2771
|
-
paddingBottom: 3,
|
2772
|
-
paddingLeft: 4,
|
2773
|
-
paddingRight: 4,
|
2774
3082
|
style: { cursor: isDisabled ? "not-allowed" : "pointer" },
|
3083
|
+
variant: "tertiary",
|
2775
3084
|
children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
|
2776
3085
|
/* @__PURE__ */ jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
|
2777
3086
|
/* @__PURE__ */ jsx(
|
@@ -2800,10 +3109,11 @@ const StyledAddIcon = styled(PlusCircle)`
|
|
2800
3109
|
}
|
2801
3110
|
`;
|
2802
3111
|
const AddComponentTitle = styled(Typography)``;
|
2803
|
-
const StyledButton = styled(
|
3112
|
+
const StyledButton = styled(Button)`
|
2804
3113
|
border-radius: 26px;
|
2805
3114
|
border-color: ${({ theme }) => theme.colors.neutral150};
|
2806
3115
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
3116
|
+
height: 5rem;
|
2807
3117
|
|
2808
3118
|
&:hover {
|
2809
3119
|
${AddComponentTitle} {
|
@@ -2815,7 +3125,7 @@ const StyledButton = styled(BaseButton)`
|
|
2815
3125
|
fill: ${({ theme }) => theme.colors.primary600};
|
2816
3126
|
}
|
2817
3127
|
> path {
|
2818
|
-
fill: ${({ theme }) => theme.colors.
|
3128
|
+
fill: ${({ theme }) => theme.colors.primary600};
|
2819
3129
|
}
|
2820
3130
|
}
|
2821
3131
|
}
|
@@ -2992,7 +3302,10 @@ const uidApi = contentManagerApi.injectEndpoints({
|
|
2992
3302
|
config: {
|
2993
3303
|
params
|
2994
3304
|
}
|
2995
|
-
})
|
3305
|
+
}),
|
3306
|
+
providesTags: (_res, _error, params) => [
|
3307
|
+
{ type: "UidAvailability", id: params.contentTypeUID }
|
3308
|
+
]
|
2996
3309
|
})
|
2997
3310
|
})
|
2998
3311
|
});
|
@@ -3004,8 +3317,10 @@ const UIDInput = React.forwardRef(
|
|
3004
3317
|
const allFormValues = useForm("InputUID", (form) => form.values);
|
3005
3318
|
const [availability, setAvailability] = React.useState();
|
3006
3319
|
const [showRegenerate, setShowRegenerate] = React.useState(false);
|
3320
|
+
const isCloning = useMatch(CLONE_PATH) !== null;
|
3007
3321
|
const field = useField(name2);
|
3008
3322
|
const debouncedValue = useDebounce(field.value, 300);
|
3323
|
+
const hasChanged = debouncedValue !== field.initialValue;
|
3009
3324
|
const { toggleNotification } = useNotification();
|
3010
3325
|
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
|
3011
3326
|
const { formatMessage } = useIntl();
|
@@ -3081,8 +3396,9 @@ const UIDInput = React.forwardRef(
|
|
3081
3396
|
params
|
3082
3397
|
},
|
3083
3398
|
{
|
3399
|
+
// Don't check availability if the value is empty or wasn't changed
|
3084
3400
|
skip: !Boolean(
|
3085
|
-
|
3401
|
+
(hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
|
3086
3402
|
)
|
3087
3403
|
}
|
3088
3404
|
);
|
@@ -3111,6 +3427,7 @@ const UIDInput = React.forwardRef(
|
|
3111
3427
|
const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
|
3112
3428
|
const fieldRef = useFocusInputField(name2);
|
3113
3429
|
const composedRefs = useComposedRefs(ref, fieldRef);
|
3430
|
+
const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
|
3114
3431
|
return /* @__PURE__ */ jsxs(Field.Root, { hint, name: name2, error: field.error, required, children: [
|
3115
3432
|
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
|
3116
3433
|
/* @__PURE__ */ jsx(
|
@@ -3119,7 +3436,7 @@ const UIDInput = React.forwardRef(
|
|
3119
3436
|
ref: composedRefs,
|
3120
3437
|
disabled: props.disabled,
|
3121
3438
|
endAction: /* @__PURE__ */ jsxs(Flex, { position: "relative", gap: 1, children: [
|
3122
|
-
|
3439
|
+
shouldShowAvailability && /* @__PURE__ */ jsxs(
|
3123
3440
|
TextValidation,
|
3124
3441
|
{
|
3125
3442
|
alignItems: "center",
|
@@ -3953,7 +4270,7 @@ const EditorLayout = ({
|
|
3953
4270
|
justifyContent: "flex-end",
|
3954
4271
|
shrink: 0,
|
3955
4272
|
width: "100%",
|
3956
|
-
children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, children: [
|
4273
|
+
children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
|
3957
4274
|
/* @__PURE__ */ jsx(Typography, { children: formatMessage({
|
3958
4275
|
id: "components.Wysiwyg.collapse",
|
3959
4276
|
defaultMessage: "Collapse"
|
@@ -3971,12 +4288,14 @@ const EditorLayout = ({
|
|
3971
4288
|
) }) });
|
3972
4289
|
}
|
3973
4290
|
return /* @__PURE__ */ jsx(
|
3974
|
-
|
4291
|
+
Flex,
|
3975
4292
|
{
|
3976
4293
|
borderColor: error ? "danger600" : "neutral200",
|
3977
4294
|
borderStyle: "solid",
|
3978
4295
|
borderWidth: "1px",
|
3979
4296
|
hasRadius: true,
|
4297
|
+
direction: "column",
|
4298
|
+
alignItems: "stretch",
|
3980
4299
|
children
|
3981
4300
|
}
|
3982
4301
|
);
|
@@ -3987,11 +4306,19 @@ const ExpandWrapper = styled(Flex)`
|
|
3987
4306
|
const BoxWithBorder = styled(Box)`
|
3988
4307
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
3989
4308
|
`;
|
3990
|
-
const ExpandButton$1 = styled(
|
4309
|
+
const ExpandButton$1 = styled(Button)`
|
3991
4310
|
background-color: transparent;
|
3992
4311
|
border: none;
|
3993
4312
|
align-items: center;
|
3994
4313
|
|
4314
|
+
& > span {
|
4315
|
+
display: flex;
|
4316
|
+
justify-content: space-between;
|
4317
|
+
align-items: center;
|
4318
|
+
width: 100%;
|
4319
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4320
|
+
}
|
4321
|
+
|
3995
4322
|
svg {
|
3996
4323
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
3997
4324
|
|
@@ -4287,11 +4614,19 @@ const MoreButton = styled(IconButton)`
|
|
4287
4614
|
const IconButtonGroupMargin = styled(IconButtonGroup)`
|
4288
4615
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
4289
4616
|
`;
|
4290
|
-
const ExpandButton = styled(
|
4617
|
+
const ExpandButton = styled(Button)`
|
4291
4618
|
background-color: transparent;
|
4292
4619
|
border: none;
|
4293
4620
|
align-items: center;
|
4294
4621
|
|
4622
|
+
& > span {
|
4623
|
+
display: flex;
|
4624
|
+
justify-content: space-between;
|
4625
|
+
align-items: center;
|
4626
|
+
width: 100%;
|
4627
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4628
|
+
}
|
4629
|
+
|
4295
4630
|
svg {
|
4296
4631
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4297
4632
|
path {
|
@@ -4303,8 +4638,8 @@ const ExpandButton = styled(BaseButton)`
|
|
4303
4638
|
`;
|
4304
4639
|
const WysiwygFooter = ({ onToggleExpand }) => {
|
4305
4640
|
const { formatMessage } = useIntl();
|
4306
|
-
return /* @__PURE__ */ jsx(Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
|
4307
|
-
/* @__PURE__ */ jsx(Typography, { children: formatMessage({
|
4641
|
+
return /* @__PURE__ */ jsx(Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
|
4642
|
+
/* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: formatMessage({
|
4308
4643
|
id: "components.WysiwygBottomControls.fullscreen",
|
4309
4644
|
defaultMessage: "Expand"
|
4310
4645
|
}) }),
|
@@ -4340,14 +4675,23 @@ const WysiwygNav = ({
|
|
4340
4675
|
borderRadius: `0.4rem 0.4rem 0 0`,
|
4341
4676
|
children: [
|
4342
4677
|
/* @__PURE__ */ jsxs(Flex, { children: [
|
4343
|
-
/* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(
|
4344
|
-
|
4345
|
-
|
4346
|
-
|
4347
|
-
|
4348
|
-
|
4349
|
-
|
4350
|
-
|
4678
|
+
/* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(
|
4679
|
+
SingleSelect,
|
4680
|
+
{
|
4681
|
+
disabled: true,
|
4682
|
+
placeholder: selectPlaceholder,
|
4683
|
+
"aria-label": selectPlaceholder,
|
4684
|
+
size: "S",
|
4685
|
+
children: [
|
4686
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
|
4687
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
|
4688
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h3", children: "h3" }),
|
4689
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h4", children: "h4" }),
|
4690
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h5", children: "h5" }),
|
4691
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h6", children: "h6" })
|
4692
|
+
]
|
4693
|
+
}
|
4694
|
+
) }),
|
4351
4695
|
/* @__PURE__ */ jsxs(MainButtons, { children: [
|
4352
4696
|
/* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
|
4353
4697
|
/* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
|
@@ -4378,6 +4722,7 @@ const WysiwygNav = ({
|
|
4378
4722
|
placeholder: selectPlaceholder,
|
4379
4723
|
"aria-label": selectPlaceholder,
|
4380
4724
|
onChange: (value) => onActionClick(value, editorRef),
|
4725
|
+
size: "S",
|
4381
4726
|
children: [
|
4382
4727
|
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
|
4383
4728
|
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
|
@@ -4717,7 +5062,9 @@ const useFieldHint = (hint = void 0, attribute) => {
|
|
4717
5062
|
if (!maximum && !minimum) {
|
4718
5063
|
return hint;
|
4719
5064
|
}
|
4720
|
-
const units = !["biginteger", "integer", "number"].includes(
|
5065
|
+
const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
|
5066
|
+
attribute.type
|
5067
|
+
) ? formatMessage(
|
4721
5068
|
{
|
4722
5069
|
id: "content-manager.form.Input.hint.character.unit",
|
4723
5070
|
defaultMessage: "{maxValue, plural, one { character} other { characters}}"
|
@@ -4811,7 +5158,7 @@ const DynamicComponent = ({
|
|
4811
5158
|
/* @__PURE__ */ jsx(
|
4812
5159
|
IconButton,
|
4813
5160
|
{
|
4814
|
-
|
5161
|
+
variant: "ghost",
|
4815
5162
|
label: formatMessage(
|
4816
5163
|
{
|
4817
5164
|
id: getTranslation("components.DynamicZone.delete-label"),
|
@@ -4826,7 +5173,7 @@ const DynamicComponent = ({
|
|
4826
5173
|
/* @__PURE__ */ jsx(
|
4827
5174
|
IconButton,
|
4828
5175
|
{
|
4829
|
-
|
5176
|
+
variant: "ghost",
|
4830
5177
|
onClick: (e) => e.stopPropagation(),
|
4831
5178
|
"data-handler-id": handlerId,
|
4832
5179
|
ref: dragRef,
|
@@ -4887,7 +5234,18 @@ const DynamicComponent = ({
|
|
4887
5234
|
] }),
|
4888
5235
|
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
4889
5236
|
const fieldName = `${name2}.${index}.${field.name}`;
|
4890
|
-
return /* @__PURE__ */ jsx(
|
5237
|
+
return /* @__PURE__ */ jsx(
|
5238
|
+
Grid$1.Item,
|
5239
|
+
{
|
5240
|
+
col: size,
|
5241
|
+
s: 12,
|
5242
|
+
xs: 12,
|
5243
|
+
direction: "column",
|
5244
|
+
alignItems: "stretch",
|
5245
|
+
children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName })
|
5246
|
+
},
|
5247
|
+
fieldName
|
5248
|
+
);
|
4891
5249
|
}) }, rowInd)) }) }) })
|
4892
5250
|
] }) }) })
|
4893
5251
|
] });
|
@@ -5080,7 +5438,7 @@ const DynamicZone = ({
|
|
5080
5438
|
const handleRemoveComponent = (name22, currentIndex) => () => {
|
5081
5439
|
removeFieldRow(name22, currentIndex);
|
5082
5440
|
};
|
5083
|
-
const hasError = error !== void 0
|
5441
|
+
const hasError = error !== void 0;
|
5084
5442
|
const renderButtonLabel = () => {
|
5085
5443
|
if (addComponentIsOpen) {
|
5086
5444
|
return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
|
@@ -5196,4 +5554,4 @@ export {
|
|
5196
5554
|
transformDocument as t,
|
5197
5555
|
useLazyComponents as u
|
5198
5556
|
};
|
5199
|
-
//# sourceMappingURL=Field-
|
5557
|
+
//# sourceMappingURL=Field-pb2o8uBe.mjs.map
|