@strapi/content-manager 5.4.1 → 5.5.0
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-ClKl_TA2.js → ComponentConfigurationPage-BPiQrhZ6.js} +4 -5
- package/dist/_chunks/{ComponentConfigurationPage-ClKl_TA2.js.map → ComponentConfigurationPage-BPiQrhZ6.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-D3ZWDAHG.mjs → ComponentConfigurationPage-viOAdZM6.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-D3ZWDAHG.mjs.map → ComponentConfigurationPage-viOAdZM6.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-OWez0Kxp.js → EditConfigurationPage-CZRKq8CN.js} +4 -5
- package/dist/_chunks/{EditConfigurationPage-OWez0Kxp.js.map → EditConfigurationPage-CZRKq8CN.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BYCBSJxP.mjs → EditConfigurationPage-DKtPyjs_.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BYCBSJxP.mjs.map → EditConfigurationPage-DKtPyjs_.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-BEs5iGDi.js → EditViewPage-C-TZmK5r.js} +4 -5
- package/dist/_chunks/{EditViewPage-BEs5iGDi.js.map → EditViewPage-C-TZmK5r.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-5pdbvsO_.mjs → EditViewPage-D2FPb5Mh.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-5pdbvsO_.mjs.map → EditViewPage-D2FPb5Mh.mjs.map} +1 -1
- package/dist/_chunks/{Field-DNHm4wHx.js → Field-IMBnqF-k.js} +26 -46
- package/dist/_chunks/Field-IMBnqF-k.js.map +1 -0
- package/dist/_chunks/{Field-DcKuFHYK.mjs → Field-hD0Y00Mt.mjs} +25 -44
- package/dist/_chunks/Field-hD0Y00Mt.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-CoRxWJOz.js → Form-BaURS01O.js} +5 -6
- package/dist/_chunks/{Form-CoRxWJOz.js.map → Form-BaURS01O.js.map} +1 -1
- package/dist/_chunks/{Form-CGwM_-5c.mjs → Form-ZQ9fzWkd.mjs} +3 -3
- package/dist/_chunks/{Form-CGwM_-5c.mjs.map → Form-ZQ9fzWkd.mjs.map} +1 -1
- package/dist/_chunks/{History-BcUTQrfG.js → History-BqRQm2Lc.js} +6 -7
- package/dist/_chunks/History-BqRQm2Lc.js.map +1 -0
- package/dist/_chunks/{History-DEvr3Q_V.mjs → History-C4X3jiQJ.mjs} +5 -5
- package/dist/_chunks/History-C4X3jiQJ.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BE_Ho7tV.js → ListConfigurationPage-BT69-TvF.js} +4 -5
- package/dist/_chunks/{ListConfigurationPage-BE_Ho7tV.js.map → ListConfigurationPage-BT69-TvF.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-BM4zZZcM.mjs → ListConfigurationPage-CwMU6tWQ.mjs} +3 -3
- package/dist/_chunks/{ListConfigurationPage-BM4zZZcM.mjs.map → ListConfigurationPage-CwMU6tWQ.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-BkT8Eao0.js → ListViewPage-CYkrfWsm.js} +51 -51
- package/dist/_chunks/ListViewPage-CYkrfWsm.js.map +1 -0
- package/dist/_chunks/{ListViewPage-BK2mkrql.mjs → ListViewPage-CvxfiNTc.mjs} +50 -49
- package/dist/_chunks/ListViewPage-CvxfiNTc.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-C8mtyc4H.js → NoContentTypePage-BZMfRsrg.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-C8mtyc4H.js.map → NoContentTypePage-BZMfRsrg.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BvcAutu9.mjs → NoContentTypePage-Dy6sa9LT.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-BvcAutu9.mjs.map → NoContentTypePage-Dy6sa9LT.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BmbRz7PR.mjs → NoPermissionsPage-DiW-TIzq.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BmbRz7PR.mjs.map → NoPermissionsPage-DiW-TIzq.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-B5Y9Y78B.js → NoPermissionsPage-DjUdvhJ6.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B5Y9Y78B.js.map → NoPermissionsPage-DjUdvhJ6.js.map} +1 -1
- package/dist/_chunks/{Preview-BF8ZDYqS.js → Preview-BqRUSbFU.js} +17 -7
- package/dist/_chunks/Preview-BqRUSbFU.js.map +1 -0
- package/dist/_chunks/{Preview-DcexhKJE.mjs → Preview-DwWET-X7.mjs} +17 -6
- package/dist/_chunks/Preview-DwWET-X7.mjs.map +1 -0
- package/dist/_chunks/{Relations-BjIzc4EK.mjs → Relations-BOTC_ZqE.mjs} +6 -8
- package/dist/_chunks/{Relations-BjIzc4EK.mjs.map → Relations-BOTC_ZqE.mjs.map} +1 -1
- package/dist/_chunks/{Relations-BKnoK1R0.js → Relations-DnCdLzq_.js} +7 -10
- package/dist/_chunks/{Relations-BKnoK1R0.js.map → Relations-DnCdLzq_.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-BW-rXkjn.mjs → index-BeYsz0Vi.mjs} +89 -51
- package/dist/_chunks/index-BeYsz0Vi.mjs.map +1 -0
- package/dist/_chunks/{index-DOzAG2cq.js → index-CptTdHNy.js} +90 -53
- package/dist/_chunks/index-CptTdHNy.js.map +1 -0
- package/dist/_chunks/{layout-DFVbgjp2.mjs → layout-CzSSEy9b.mjs} +4 -4
- package/dist/_chunks/{layout-DFVbgjp2.mjs.map → layout-CzSSEy9b.mjs.map} +1 -1
- package/dist/_chunks/{layout-RC3W2obV.js → layout-szfTCeYm.js} +5 -6
- package/dist/_chunks/{layout-RC3W2obV.js.map → layout-szfTCeYm.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-Dogh8HWI.mjs → relations-DvzmDbWc.mjs} +2 -2
- package/dist/_chunks/{relations-Dogh8HWI.mjs.map → relations-DvzmDbWc.mjs.map} +1 -1
- package/dist/_chunks/{relations-zam7-5H7.js → relations-qssSbh1V.js} +2 -2
- package/dist/_chunks/{relations-zam7-5H7.js.map → relations-qssSbh1V.js.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/services/documents.d.ts +0 -3
- package/dist/server/index.js +74 -45
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +74 -44
- 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 +9 -9
- package/dist/_chunks/Field-DNHm4wHx.js.map +0 -1
- package/dist/_chunks/Field-DcKuFHYK.mjs.map +0 -1
- package/dist/_chunks/History-BcUTQrfG.js.map +0 -1
- package/dist/_chunks/History-DEvr3Q_V.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BK2mkrql.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BkT8Eao0.js.map +0 -1
- package/dist/_chunks/Preview-BF8ZDYqS.js.map +0 -1
- package/dist/_chunks/Preview-DcexhKJE.mjs.map +0 -1
- package/dist/_chunks/index-BW-rXkjn.mjs.map +0 -1
- package/dist/_chunks/index-DOzAG2cq.js.map +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Field-DcKuFHYK.mjs","sources":["../../admin/src/pages/EditView/utils/data.ts","../../admin/src/hooks/useLazyComponents.ts","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.ts","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/conversions.ts","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/enterKey.ts","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Heading.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Image.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/links.ts","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/types.ts","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Link.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/List.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Paragraph.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Quote.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksToolbar.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksContent.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Modifiers.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/plugins/withImages.ts","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/plugins/withLinks.ts","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/plugins/withStrapiSchema.ts","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.tsx","../../admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.tsx","../../admin/src/pages/EditView/utils/forms.ts","../../admin/src/pages/EditView/components/FormInputs/Component/Initializer.tsx","../../admin/src/pages/EditView/components/FormInputs/Component/NonRepeatable.tsx","../../admin/src/pages/EditView/components/FormInputs/Component/Repeatable.tsx","../../admin/src/pages/EditView/components/FormInputs/Component/Input.tsx","../../admin/src/pages/EditView/components/FormInputs/DynamicZone/AddComponentButton.tsx","../../admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.tsx","../../admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.tsx","../../admin/src/pages/EditView/components/FormInputs/NotAllowed.tsx","../../admin/src/services/uid.ts","../../admin/src/pages/EditView/components/FormInputs/UID.tsx","../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/utils/mdRenderer.ts","../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.tsx","../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/utils/continueList.ts","../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/Editor.tsx","../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.tsx","../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/utils/utils.ts","../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.tsx","../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.tsx","../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.tsx","../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.tsx","../../admin/src/pages/EditView/components/InputRenderer.tsx","../../admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.tsx","../../admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicZoneLabel.tsx","../../admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.tsx"],"sourcesContent":["import { generateNKeysBetween } from 'fractional-indexing';\nimport pipe from 'lodash/fp/pipe';\n\nimport { DOCUMENT_META_FIELDS } from '../../../constants/attributes';\n\nimport type { ComponentsDictionary, Document } from '../../../hooks/useDocument';\nimport type { Schema, UID } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * traverseData\n * -----------------------------------------------------------------------------------------------*/\n\n// Make only attributes required since it's the only one Content History has\ntype PartialSchema = Partial<Schema.Schema> & Pick<Schema.Schema, 'attributes'>;\n\ntype Predicate = <TAttribute extends Schema.Attribute.AnyAttribute>(\n attribute: TAttribute,\n value: Schema.Attribute.Value<TAttribute>\n) => boolean;\ntype Transform = <TAttribute extends Schema.Attribute.AnyAttribute>(\n value: any,\n attribute: TAttribute\n) => any;\ntype AnyData = Omit<Document, 'id'>;\n\nconst BLOCK_LIST_ATTRIBUTE_KEYS = ['__component', '__temp_key__'];\n\n/**\n * @internal This function is used to traverse the data and transform the values.\n * Given a predicate function, it will transform the value (using the given transform function)\n * if the predicate returns true. If it finds that the attribute is a component or dynamiczone,\n * it will recursively traverse those data structures as well.\n *\n * It is possible to break the ContentManager by using this function incorrectly, for example,\n * if you transform a number into a string but the attribute type is a number, the ContentManager\n * will not be able to save the data and the Form will likely crash because the component it's\n * passing the data too won't succesfully be able to handle the value.\n */\nconst traverseData =\n (predicate: Predicate, transform: Transform) =>\n (schema: PartialSchema, components: ComponentsDictionary = {}) =>\n (data: AnyData = {}) => {\n const traverse = (datum: AnyData, attributes: Schema.Schema['attributes']) => {\n return Object.entries(datum).reduce<AnyData>((acc, [key, value]) => {\n const attribute = attributes[key];\n\n /**\n * If the attribute is a block list attribute, we don't want to transform it.\n * We also don't want to transform null or undefined values.\n */\n if (BLOCK_LIST_ATTRIBUTE_KEYS.includes(key) || value === null || value === undefined) {\n acc[key] = value;\n return acc;\n }\n\n if (attribute.type === 'component') {\n if (attribute.repeatable) {\n const componentValue = (\n predicate(attribute, value) ? transform(value, attribute) : value\n ) as Schema.Attribute.Value<Schema.Attribute.Component<UID.Component, true>>;\n acc[key] = componentValue.map((componentData) =>\n traverse(componentData, components[attribute.component]?.attributes ?? {})\n );\n } else {\n const componentValue = (\n predicate(attribute, value) ? transform(value, attribute) : value\n ) as Schema.Attribute.Value<Schema.Attribute.Component<UID.Component, false>>;\n\n acc[key] = traverse(componentValue, components[attribute.component]?.attributes ?? {});\n }\n } else if (attribute.type === 'dynamiczone') {\n const dynamicZoneValue = (\n predicate(attribute, value) ? transform(value, attribute) : value\n ) as Schema.Attribute.Value<Schema.Attribute.DynamicZone>;\n\n acc[key] = dynamicZoneValue.map((componentData) =>\n traverse(componentData, components[componentData.__component]?.attributes ?? {})\n );\n } else if (predicate(attribute, value)) {\n acc[key] = transform(value, attribute);\n } else {\n acc[key] = value;\n }\n\n return acc;\n }, {});\n };\n\n return traverse(data, schema.attributes);\n };\n\n/* -------------------------------------------------------------------------------------------------\n * removeProhibitedFields\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * @internal Removes all the fields that are not allowed.\n */\nconst removeProhibitedFields = (prohibitedFields: Schema.Attribute.Kind[]) =>\n traverseData(\n (attribute) => prohibitedFields.includes(attribute.type),\n () => ''\n );\n\n/* -------------------------------------------------------------------------------------------------\n * prepareRelations\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * @internal\n * @description Sets all relation values to an empty array.\n */\nconst prepareRelations = traverseData(\n (attribute) => attribute.type === 'relation',\n () => ({\n connect: [],\n disconnect: [],\n })\n);\n\n/* -------------------------------------------------------------------------------------------------\n * prepareTempKeys\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * @internal\n * @description Adds a `__temp_key__` to each component and dynamiczone item. This gives us\n * a stable identifier regardless of its ids etc. that we can then use for drag and drop.\n */\nconst prepareTempKeys = traverseData(\n (attribute) =>\n (attribute.type === 'component' && attribute.repeatable) || attribute.type === 'dynamiczone',\n (data) => {\n if (Array.isArray(data) && data.length > 0) {\n const keys = generateNKeysBetween(undefined, undefined, data.length);\n\n return data.map((datum, index) => ({\n ...datum,\n __temp_key__: keys[index],\n }));\n }\n\n return data;\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * removeFieldsThatDontExistOnSchema\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * @internal\n * @description Fields that don't exist in the schema like createdAt etc. are only on the first level (not nested),\n * as such we don't need to traverse the components to remove them.\n */\nconst removeFieldsThatDontExistOnSchema = (schema: PartialSchema) => (data: AnyData) => {\n const schemaKeys = Object.keys(schema.attributes);\n const dataKeys = Object.keys(data);\n\n const keysToRemove = dataKeys.filter((key) => !schemaKeys.includes(key));\n\n const revisedData = [...keysToRemove, ...DOCUMENT_META_FIELDS].reduce((acc, key) => {\n delete acc[key];\n\n return acc;\n }, structuredClone(data));\n\n return revisedData;\n};\n\n/**\n * @internal\n * @description We need to remove null fields from the data-structure because it will pass it\n * to the specific inputs breaking them as most would prefer empty strings or `undefined` if\n * they're controlled / uncontrolled.\n */\nconst removeNullValues = (data: AnyData) => {\n return Object.entries(data).reduce<AnyData>((acc, [key, value]) => {\n if (value === null) {\n return acc;\n }\n\n acc[key] = value;\n\n return acc;\n }, {});\n};\n\n/* -------------------------------------------------------------------------------------------------\n * transformDocuments\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * @internal\n * @description Takes a document data structure (this could be from the API or a default form structure)\n * and applies consistent data transformations to it. This is also used when we add new components to the\n * form to ensure the data is correctly prepared from their default state e.g. relations are set to an empty array.\n */\nconst transformDocument =\n (schema: PartialSchema, components: ComponentsDictionary = {}) =>\n (document: AnyData) => {\n const transformations = pipe(\n removeFieldsThatDontExistOnSchema(schema),\n removeProhibitedFields(['password'])(schema, components),\n removeNullValues,\n prepareRelations(schema, components),\n prepareTempKeys(schema, components)\n );\n\n return transformations(document);\n };\n\nexport {\n removeProhibitedFields,\n prepareRelations,\n prepareTempKeys,\n removeFieldsThatDontExistOnSchema,\n transformDocument,\n};\n","import { ComponentType, useCallback, useEffect, useState } from 'react';\n\nimport { StrapiAppContextValue, useStrapiApp } from '@strapi/admin/strapi-admin';\n\nconst componentStore = new Map<string, ComponentType | undefined>();\n\ntype LazyComponentStore = Record<string, ComponentType | undefined>;\n\ntype CustomField = NonNullable<ReturnType<StrapiAppContextValue['customFields']['get']>>;\n\ninterface UseLazyComponentsReturn {\n isLazyLoading: boolean;\n lazyComponentStore: LazyComponentStore;\n cleanup: () => void;\n}\n\n/**\n * @description A hook to lazy load custom field components\n */\nconst useLazyComponents = (componentUids: string[] = []): UseLazyComponentsReturn => {\n const [lazyComponentStore, setLazyComponentStore] = useState(Object.fromEntries(componentStore));\n /**\n * Start loading only if there are any components passed in\n * and there are some new to load\n */\n const newUids = componentUids.filter((uid) => !componentStore.get(uid));\n const [loading, setLoading] = useState(() => !!newUids.length);\n const getCustomField = useStrapiApp('useLazyComponents', (state) => state.customFields.get);\n\n useEffect(() => {\n const setStore = (store: Record<string, ComponentType | undefined>) => {\n setLazyComponentStore(store);\n setLoading(false);\n };\n\n const lazyLoadComponents = async (\n uids: string[],\n components: Array<ReturnType<CustomField['components']['Input']>>\n ) => {\n const modules = await Promise.all(components);\n\n uids.forEach((uid, index) => {\n componentStore.set(uid, modules[index].default);\n });\n\n setStore(Object.fromEntries(componentStore));\n };\n\n if (newUids.length > 0) {\n setLoading(true);\n\n const componentPromises = newUids.reduce<\n Array<ReturnType<CustomField['components']['Input']>>\n >((arrayOfPromises, uid) => {\n const customField = getCustomField(uid);\n\n if (customField) {\n arrayOfPromises.push(customField.components.Input());\n }\n\n return arrayOfPromises;\n }, []);\n\n if (componentPromises.length > 0) {\n lazyLoadComponents(newUids, componentPromises);\n }\n }\n }, [newUids, getCustomField]);\n\n /**\n * Wrap this in a callback so it can be used in\n * effects to cleanup the cached store if required\n */\n const cleanup = useCallback(() => {\n componentStore.clear();\n setLazyComponentStore({});\n }, []);\n\n return { isLazyLoading: loading, lazyComponentStore, cleanup };\n};\n\nexport { useLazyComponents };\nexport type { UseLazyComponentsReturn, LazyComponentStore };\n","export const codeLanguages: { value: string; label: string }[] = [\n {\n value: 'asm',\n label: 'Assembly',\n },\n {\n value: 'bash',\n label: 'Bash',\n },\n {\n value: 'c',\n label: 'C',\n },\n {\n value: 'clojure',\n label: 'Clojure',\n },\n {\n value: 'cobol',\n label: 'COBOL',\n },\n {\n value: 'cpp',\n label: 'C++',\n },\n {\n value: 'csharp',\n label: 'C#',\n },\n {\n value: 'css',\n label: 'CSS',\n },\n {\n value: 'dart',\n label: 'Dart',\n },\n {\n value: 'dockerfile',\n label: 'Dockerfile',\n },\n {\n value: 'elixir',\n label: 'Elixir',\n },\n {\n value: 'erlang',\n label: 'Erlang',\n },\n {\n value: 'fortran',\n label: 'Fortran',\n },\n {\n value: 'fsharp',\n label: 'F#',\n },\n {\n value: 'go',\n label: 'Go',\n },\n {\n value: 'graphql',\n label: 'GraphQL',\n },\n {\n value: 'groovy',\n label: 'Groovy',\n },\n {\n value: 'haskell',\n label: 'Haskell',\n },\n {\n value: 'haxe',\n label: 'Haxe',\n },\n {\n value: 'html',\n label: 'HTML',\n },\n {\n value: 'ini',\n label: 'INI',\n },\n {\n value: 'java',\n label: 'Java',\n },\n {\n value: 'javascript',\n label: 'JavaScript',\n },\n {\n value: 'jsx',\n label: 'JavaScript (React)',\n },\n {\n value: 'json',\n label: 'JSON',\n },\n {\n value: 'julia',\n label: 'Julia',\n },\n {\n value: 'kotlin',\n label: 'Kotlin',\n },\n {\n value: 'latex',\n label: 'LaTeX',\n },\n {\n value: 'lua',\n label: 'Lua',\n },\n {\n value: 'markdown',\n label: 'Markdown',\n },\n {\n value: 'matlab',\n label: 'MATLAB',\n },\n {\n value: 'makefile',\n label: 'Makefile',\n },\n {\n value: 'objectivec',\n label: 'Objective-C',\n },\n {\n value: 'perl',\n label: 'Perl',\n },\n {\n value: 'php',\n label: 'PHP',\n },\n {\n value: 'plaintext',\n label: 'Plain text',\n },\n {\n value: 'powershell',\n label: 'PowerShell',\n },\n {\n value: 'python',\n label: 'Python',\n },\n {\n value: 'r',\n label: 'R',\n },\n {\n value: 'ruby',\n label: 'Ruby',\n },\n {\n value: 'rust',\n label: 'Rust',\n },\n {\n value: 'sas',\n label: 'SAS',\n },\n {\n value: 'scala',\n label: 'Scala',\n },\n {\n value: 'scheme',\n label: 'Scheme',\n },\n {\n value: 'shell',\n label: 'Shell',\n },\n {\n value: 'sql',\n label: 'SQL',\n },\n {\n value: 'stata',\n label: 'Stata',\n },\n {\n value: 'swift',\n label: 'Swift',\n },\n {\n value: 'typescript',\n label: 'TypeScript',\n },\n {\n value: 'tsx',\n label: 'TypeScript (React)',\n },\n {\n value: 'vbnet',\n label: 'VB.NET',\n },\n {\n value: 'xml',\n label: 'XML',\n },\n {\n value: 'yaml',\n label: 'YAML',\n },\n];\n","import { type Element, type Path, Editor, Transforms } from 'slate';\n\n/**\n * Extracts some logic that is common to most blocks' handleConvert functions.\n * @returns The path of the converted block\n */\nconst baseHandleConvert = <T extends Element>(\n editor: Editor,\n attributesToSet: Partial<T> & { type: T['type'] }\n): void | Path => {\n // If there is no selection, convert last inserted node\n const [_, lastNodePath] = Editor.last(editor, []);\n\n // If the selection is inside a list, split the list so that the modified block is outside of it\n Transforms.unwrapNodes(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n split: true,\n at: editor.selection ?? lastNodePath,\n });\n\n // Make sure we get a block node, not an inline node\n const [, updatedLastNodePath] = Editor.last(editor, []);\n const entry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type !== 'text' && node.type !== 'link',\n at: editor.selection ?? updatedLastNodePath,\n });\n\n if (!entry || Editor.isEditor(entry[0])) {\n return;\n }\n\n const [element, elementPath] = entry;\n\n Transforms.setNodes(\n editor,\n {\n ...getAttributesToClear(element),\n ...attributesToSet,\n } as Partial<Element>,\n { at: elementPath }\n );\n\n return elementPath;\n};\n\n/**\n * Set all attributes except type and children to null so that Slate deletes them\n */\nconst getAttributesToClear = (element: Element) => {\n const { children: _children, type: _type, ...extra } = element;\n\n const attributesToClear = Object.keys(extra).reduce(\n (currentAttributes, key) => ({ ...currentAttributes, [key]: null }),\n {}\n );\n\n return attributesToClear as Record<string, null>;\n};\n\nexport { baseHandleConvert, getAttributesToClear };\n","import { type Text, Editor, Node, Transforms } from 'slate';\n\nconst isText = (node: unknown): node is Text => {\n return Node.isNode(node) && !Editor.isEditor(node) && node.type === 'text';\n};\n\n/**\n * Inserts a line break the first time the user presses enter, and exits the node the second time.\n */\nconst pressEnterTwiceToExit = (editor: Editor) => {\n /**\n * To determine if we should break out of the node, check 2 things:\n * 1. If the cursor is at the end of the node\n * 2. If the last line of the node is empty\n */\n const nodeEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && !['link', 'text'].includes(node.type),\n });\n if (!nodeEntry || !editor.selection) {\n return;\n }\n const [node, nodePath] = nodeEntry;\n const isNodeEnd = Editor.isEnd(editor, editor.selection.anchor, nodePath);\n const lastTextNode = node.children.at(-1);\n const isEmptyLine = isText(lastTextNode) && lastTextNode.text.endsWith('\\n');\n\n if (isNodeEnd && isEmptyLine) {\n // Remove the last line break\n Transforms.delete(editor, { distance: 1, unit: 'character', reverse: true });\n // Break out of the node by creating a new paragraph\n Transforms.insertNodes(editor, {\n type: 'paragraph',\n children: [{ type: 'text', text: '' }],\n });\n return;\n }\n\n // Otherwise insert a new line within the node\n Transforms.insertText(editor, '\\n');\n\n // If there's nothing after the cursor, disable modifiers\n if (isNodeEnd) {\n ['bold', 'italic', 'underline', 'strikethrough', 'code'].forEach((modifier) => {\n Editor.removeMark(editor, modifier);\n });\n }\n};\n\nexport { pressEnterTwiceToExit };\n","import * as React from 'react';\n\nimport { Box, SingleSelect, SingleSelectOption } from '@strapi/design-system';\nimport { Code } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { Editor, Transforms } from 'slate';\nimport { useSelected, type RenderElementProps, useFocused, ReactEditor } from 'slate-react';\nimport { styled } from 'styled-components';\n\nimport { useBlocksEditorContext, type BlocksStore } from '../BlocksEditor';\nimport { codeLanguages } from '../utils/constants';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { pressEnterTwiceToExit } from '../utils/enterKey';\nimport { type Block } from '../utils/types';\n\nconst CodeBlock = styled.pre`\n border-radius: ${({ theme }) => theme.borderRadius};\n background-color: ${({ theme }) => theme.colors.neutral100};\n max-width: 100%;\n overflow: auto;\n padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};\n flex-shrink: 1;\n\n & > code {\n font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,\n monospace;\n color: ${({ theme }) => theme.colors.neutral800};\n overflow: auto;\n max-width: 100%;\n }\n`;\n\nconst CodeEditor = (props: RenderElementProps) => {\n const { editor } = useBlocksEditorContext('ImageDialog');\n const editorIsFocused = useFocused();\n const imageIsSelected = useSelected();\n const { formatMessage } = useIntl();\n const [isSelectOpen, setIsSelectOpen] = React.useState(false);\n const shouldDisplayLanguageSelect = (editorIsFocused && imageIsSelected) || isSelectOpen;\n\n return (\n <Box position=\"relative\" width=\"100%\">\n <CodeBlock {...props.attributes}>\n <code>{props.children}</code>\n </CodeBlock>\n {shouldDisplayLanguageSelect && (\n <Box\n position=\"absolute\"\n background=\"neutral0\"\n borderColor=\"neutral150\"\n borderStyle=\"solid\"\n borderWidth=\"0.5px\"\n shadow=\"tableShadow\"\n top=\"100%\"\n marginTop={1}\n right={0}\n padding={1}\n hasRadius\n >\n <SingleSelect\n onChange={(open) => {\n Transforms.setNodes(\n editor,\n { language: open.toString() },\n { match: (node) => !Editor.isEditor(node) && node.type === 'code' }\n );\n }}\n value={(props.element.type === 'code' && props.element.language) || 'plaintext'}\n onOpenChange={(open) => {\n setIsSelectOpen(open);\n\n // Focus the editor again when closing the select so the user can continue typing\n if (!open) {\n ReactEditor.focus(editor);\n }\n }}\n onCloseAutoFocus={(e) => e.preventDefault()}\n aria-label={formatMessage({\n id: 'components.Blocks.blocks.code.languageLabel',\n defaultMessage: 'Select a language',\n })}\n >\n {codeLanguages.map(({ value, label }) => (\n <SingleSelectOption value={value} key={value}>\n {label}\n </SingleSelectOption>\n ))}\n </SingleSelect>\n </Box>\n )}\n </Box>\n );\n};\n\nconst codeBlocks: Pick<BlocksStore, 'code'> = {\n code: {\n renderElement: (props) => <CodeEditor {...props} />,\n icon: Code,\n label: {\n id: 'components.Blocks.blocks.code',\n defaultMessage: 'Code block',\n },\n matchNode: (node) => node.type === 'code',\n isInBlocksSelector: true,\n handleConvert(editor) {\n baseHandleConvert<Block<'code'>>(editor, { type: 'code', language: 'plaintext' });\n },\n handleEnterKey(editor) {\n pressEnterTwiceToExit(editor);\n },\n snippets: ['```'],\n dragHandleTopMargin: '10px',\n },\n};\n\nexport { codeBlocks };\n","import * as React from 'react';\n\nimport { Typography, TypographyComponent } from '@strapi/design-system';\nimport {\n HeadingFive,\n HeadingFour,\n HeadingOne,\n HeadingSix,\n HeadingThree,\n HeadingTwo,\n} from '@strapi/icons';\nimport { Editor } from 'slate';\nimport { styled } from 'styled-components';\n\nimport { type BlocksStore } from '../BlocksEditor';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { type Block } from '../utils/types';\n\nconst H1 = styled<TypographyComponent<'h1'>>(Typography).attrs({ tag: 'h1' })`\n font-size: 4.2rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H2 = styled<TypographyComponent<'h2'>>(Typography).attrs({ tag: 'h2' })`\n font-size: 3.5rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H3 = styled<TypographyComponent<'h3'>>(Typography).attrs({ tag: 'h3' })`\n font-size: 2.9rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H4 = styled<TypographyComponent<'h4'>>(Typography).attrs({ tag: 'h4' })`\n font-size: 2.4rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H5 = styled<TypographyComponent<'h5'>>(Typography).attrs({ tag: 'h5' })`\n font-size: 2rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H6 = styled<TypographyComponent<'h6'>>(Typography).attrs({ tag: 'h6' })`\n font-size: 1.6rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\n/**\n * Common handler for converting a node to a heading\n */\nconst handleConvertToHeading = (editor: Editor, level: Block<'heading'>['level']) => {\n baseHandleConvert<Block<'heading'>>(editor, { type: 'heading', level });\n};\n\nconst headingBlocks: Pick<\n BlocksStore,\n 'heading-one' | 'heading-two' | 'heading-three' | 'heading-four' | 'heading-five' | 'heading-six'\n> = {\n 'heading-one': {\n renderElement: (props) => <H1 {...props.attributes}>{props.children}</H1>,\n icon: HeadingOne,\n label: {\n id: 'components.Blocks.blocks.heading1',\n defaultMessage: 'Heading 1',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 1),\n matchNode: (node) => node.type === 'heading' && node.level === 1,\n isInBlocksSelector: true,\n snippets: ['#'],\n dragHandleTopMargin: '14px',\n },\n 'heading-two': {\n renderElement: (props) => <H2 {...props.attributes}>{props.children}</H2>,\n icon: HeadingTwo,\n label: {\n id: 'components.Blocks.blocks.heading2',\n defaultMessage: 'Heading 2',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 2),\n matchNode: (node) => node.type === 'heading' && node.level === 2,\n isInBlocksSelector: true,\n snippets: ['##'],\n dragHandleTopMargin: '10px',\n },\n 'heading-three': {\n renderElement: (props) => <H3 {...props.attributes}>{props.children}</H3>,\n icon: HeadingThree,\n label: {\n id: 'components.Blocks.blocks.heading3',\n defaultMessage: 'Heading 3',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 3),\n matchNode: (node) => node.type === 'heading' && node.level === 3,\n isInBlocksSelector: true,\n snippets: ['###'],\n dragHandleTopMargin: '7px',\n },\n 'heading-four': {\n renderElement: (props) => <H4 {...props.attributes}>{props.children}</H4>,\n icon: HeadingFour,\n label: {\n id: 'components.Blocks.blocks.heading4',\n defaultMessage: 'Heading 4',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 4),\n matchNode: (node) => node.type === 'heading' && node.level === 4,\n isInBlocksSelector: true,\n snippets: ['####'],\n dragHandleTopMargin: '4px',\n },\n 'heading-five': {\n renderElement: (props) => <H5 {...props.attributes}>{props.children}</H5>,\n icon: HeadingFive,\n label: {\n id: 'components.Blocks.blocks.heading5',\n defaultMessage: 'Heading 5',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 5),\n matchNode: (node) => node.type === 'heading' && node.level === 5,\n isInBlocksSelector: true,\n snippets: ['#####'],\n },\n 'heading-six': {\n renderElement: (props) => <H6 {...props.attributes}>{props.children}</H6>,\n icon: HeadingSix,\n label: {\n id: 'components.Blocks.blocks.heading6',\n defaultMessage: 'Heading 6',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 6),\n matchNode: (node) => node.type === 'heading' && node.level === 6,\n isInBlocksSelector: true,\n snippets: ['######'],\n dragHandleTopMargin: '-2px',\n },\n};\n\nexport { headingBlocks };\n","import * as React from 'react';\n\nimport { useStrapiApp } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, FlexComponent } from '@strapi/design-system';\nimport { Image as Picture } from '@strapi/icons';\nimport { type Element, Transforms, Editor } from 'slate';\nimport { useFocused, type RenderElementProps, useSelected } from 'slate-react';\nimport { styled, css } from 'styled-components';\n\nimport { prefixFileUrlWithBackendUrl } from '../../../../../../utils/urls';\nimport { useBlocksEditorContext, type BlocksStore } from '../BlocksEditor';\nimport { type Block } from '../utils/types';\n\nimport type { Schema } from '@strapi/types';\n\nconst ImageWrapper = styled<FlexComponent>(Flex)<{ $isFocused?: boolean }>`\n transition-property: box-shadow;\n transition-duration: 0.2s;\n ${(props) =>\n props.$isFocused &&\n css`\n box-shadow: ${props.theme.colors.primary600} 0px 0px 0px 3px;\n `}\n\n & > img {\n height: auto;\n // The max-height is decided with the design team, the 56px is the height of the toolbar\n max-height: calc(512px - 56px);\n max-width: 100%;\n object-fit: contain;\n }\n`;\n\nconst IMAGE_SCHEMA_FIELDS = [\n 'name',\n 'alternativeText',\n 'url',\n 'caption',\n 'width',\n 'height',\n 'formats',\n 'hash',\n 'ext',\n 'mime',\n 'size',\n 'previewUrl',\n 'provider',\n 'provider_metadata',\n 'createdAt',\n 'updatedAt',\n];\n\nconst pick = <T extends object, K extends keyof T>(object: T, keys: K[]): Pick<T, K> => {\n const entries = keys.map((key) => [key, object[key]]);\n return Object.fromEntries(entries);\n};\n\n// Type guard to force TypeScript to narrow the type of the element in Blocks component\nconst isImage = (element: Element): element is Block<'image'> => {\n return element.type === 'image';\n};\n\n// Added a background color to the image wrapper to make it easier to recognize the image block\nconst Image = ({ attributes, children, element }: RenderElementProps) => {\n const editorIsFocused = useFocused();\n const imageIsSelected = useSelected();\n\n if (!isImage(element)) {\n return null;\n }\n const { url, alternativeText, width, height } = element.image;\n\n return (\n <Box {...attributes}>\n {children}\n <ImageWrapper\n background=\"neutral100\"\n contentEditable={false}\n justifyContent=\"center\"\n $isFocused={editorIsFocused && imageIsSelected}\n hasRadius\n >\n <img src={url} alt={alternativeText} width={width} height={height} />\n </ImageWrapper>\n </Box>\n );\n};\n\nconst ImageDialog = () => {\n const [isOpen, setIsOpen] = React.useState(true);\n const { editor } = useBlocksEditorContext('ImageDialog');\n const components = useStrapiApp('ImageDialog', (state) => state.components);\n\n if (!components || !isOpen) return null;\n\n const MediaLibraryDialog = components['media-library'] as React.ComponentType<{\n allowedTypes: Schema.Attribute.MediaKind[];\n onClose: () => void;\n onSelectAssets: (_images: Schema.Attribute.MediaValue<true>) => void;\n }>;\n\n const insertImages = (images: Block<'image'>['image'][]) => {\n // If the selection is inside a list, split the list so that the modified block is outside of it\n Transforms.unwrapNodes(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n split: true,\n });\n\n // Save the path of the node that is being replaced by an image to insert the images there later\n // It's the closest full block node above the selection\n const nodeEntryBeingReplaced = Editor.above(editor, {\n match(node) {\n if (Editor.isEditor(node)) return false;\n\n const isInlineNode = ['text', 'link'].includes(node.type);\n\n return !isInlineNode;\n },\n });\n\n if (!nodeEntryBeingReplaced) return;\n const [, pathToInsert] = nodeEntryBeingReplaced;\n\n // Remove the previous node that is being replaced by an image\n Transforms.removeNodes(editor);\n\n // Convert images to nodes and insert them\n const nodesToInsert = images.map((image) => {\n const imageNode: Block<'image'> = {\n type: 'image',\n image,\n children: [{ type: 'text', text: '' }],\n };\n return imageNode;\n });\n Transforms.insertNodes(editor, nodesToInsert, { at: pathToInsert });\n\n // Set the selection on the image since it was cleared by calling removeNodes\n Transforms.select(editor, pathToInsert);\n };\n\n const handleSelectAssets = (images: Schema.Attribute.MediaValue<true>) => {\n const formattedImages = images.map((image) => {\n // Create an object with imageSchema defined and exclude unnecessary props coming from media library config\n const expectedImage = pick(image, IMAGE_SCHEMA_FIELDS);\n\n const nodeImage: Block<'image'>['image'] = {\n ...expectedImage,\n alternativeText: expectedImage.alternativeText || expectedImage.name,\n url: prefixFileUrlWithBackendUrl(image.url),\n };\n\n return nodeImage;\n });\n\n insertImages(formattedImages);\n setIsOpen(false);\n };\n\n return (\n <MediaLibraryDialog\n allowedTypes={['images']}\n onClose={() => setIsOpen(false)}\n onSelectAssets={handleSelectAssets}\n />\n );\n};\n\nconst imageBlocks: Pick<BlocksStore, 'image'> = {\n image: {\n renderElement: (props) => <Image {...props} />,\n icon: Picture,\n label: {\n id: 'components.Blocks.blocks.image',\n defaultMessage: 'Image',\n },\n matchNode: (node) => node.type === 'image',\n isInBlocksSelector: true,\n handleBackspaceKey(editor) {\n // Prevent issue where the image remains when it's the only block in the document\n if (editor.children.length === 1) {\n Transforms.setNodes(editor, {\n type: 'paragraph',\n // @ts-expect-error we're only setting image as null so that Slate deletes it\n image: null,\n children: [{ type: 'text', text: '' }],\n });\n } else {\n Transforms.removeNodes(editor);\n }\n },\n handleEnterKey(editor) {\n Transforms.insertNodes(editor, {\n type: 'paragraph',\n children: [{ type: 'text', text: '' }],\n });\n },\n handleConvert: () => {\n /**\n * All the logic is managed inside the ImageDialog component,\n * because the blocks are only created when the user selects images in the modal and submits\n * and if he closes the modal, then no changes are made to the editor\n */\n return () => <ImageDialog />;\n },\n snippets: ['!['],\n },\n};\n\nexport { imageBlocks };\n","import { Transforms, Editor, Element as SlateElement, Node, Range } from 'slate';\n\nimport { type Block } from './types';\n\nconst removeLink = (editor: Editor) => {\n Transforms.unwrapNodes(editor, {\n match: (node) => !Editor.isEditor(node) && SlateElement.isElement(node) && node.type === 'link',\n });\n};\n\nconst insertLink = (editor: Editor, { url }: { url: string }) => {\n if (editor.selection) {\n // We want to remove all link on the selection\n const linkNodes = Array.from(\n Editor.nodes(editor, {\n at: editor.selection,\n match: (node) => !Editor.isEditor(node) && node.type === 'link',\n })\n );\n\n linkNodes.forEach(([, path]) => {\n Transforms.unwrapNodes(editor, { at: path });\n });\n\n if (Range.isCollapsed(editor.selection)) {\n const link: Block<'link'> = {\n type: 'link',\n url: url ?? '',\n children: [{ type: 'text', text: url }],\n };\n\n Transforms.insertNodes(editor, link);\n } else {\n Transforms.wrapNodes(editor, { type: 'link', url: url ?? '' } as Block<'link'>, {\n split: true,\n });\n }\n }\n};\n\nconst editLink = (editor: Editor, link: { url: string; text: string }) => {\n const { url, text } = link;\n\n if (!editor.selection) {\n return;\n }\n\n const linkEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'link',\n });\n\n if (linkEntry) {\n const [, linkPath] = linkEntry;\n Transforms.setNodes(editor, { url }, { at: linkPath });\n\n // If link text is different, we remove the old text and insert the new one\n if (text !== '' && text !== Editor.string(editor, linkPath)) {\n const linkNodeChildrens = Array.from(Node.children(editor, linkPath, { reverse: true }));\n\n linkNodeChildrens.forEach(([, childPath]) => {\n Transforms.removeNodes(editor, { at: childPath });\n });\n\n Transforms.insertNodes(editor, [{ type: 'text', text }], { at: linkPath.concat(0) });\n }\n }\n};\n\nexport { insertLink, editLink, removeLink };\n","import type { Schema } from '@strapi/types';\nimport type { Element, Node } from 'slate';\n\ntype Block<T extends Element['type']> = Extract<Node, { type: T }>;\n\n// Wrap Object.entries to get the correct types\nconst getEntries = <T extends object>(object: T) =>\n Object.entries(object) as [keyof T, T[keyof T]][];\n\n// Wrap Object.keys to get the correct types\nconst getKeys = <T extends object>(object: T) => Object.keys(object) as (keyof T)[];\n\nconst isLinkNode = (element: Element): element is Schema.Attribute.LinkInlineNode => {\n return element.type === 'link';\n};\n\nconst isListNode = (element: Element): element is Schema.Attribute.ListBlockNode => {\n return element.type === 'list';\n};\n\nexport { type Block, getEntries, getKeys, isLinkNode, isListNode };\n","import * as React from 'react';\n\nimport { BaseLink, Button, Field, Flex, Popover, useComposedRefs } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { Editor, Path, Range, Transforms } from 'slate';\nimport { type RenderElementProps, ReactEditor } from 'slate-react';\nimport { styled } from 'styled-components';\n\nimport { type BlocksStore, useBlocksEditorContext } from '../BlocksEditor';\nimport { editLink, removeLink } from '../utils/links';\nimport { isLinkNode, type Block } from '../utils/types';\n\nconst StyledBaseLink = styled(BaseLink)`\n text-decoration: none;\n`;\n\nconst RemoveButton = styled(Button)<{ $visible: boolean }>`\n visibility: ${(props) => (props.$visible ? 'visible' : 'hidden')};\n`;\n\ninterface LinkContentProps extends RenderElementProps {\n link: Block<'link'>;\n}\n\nconst LinkContent = React.forwardRef<HTMLAnchorElement, LinkContentProps>(\n ({ link, children, attributes }, forwardedRef) => {\n const { formatMessage } = useIntl();\n const { editor } = useBlocksEditorContext('Link');\n const path = ReactEditor.findPath(editor, link);\n const [popoverOpen, setPopoverOpen] = React.useState(\n editor.lastInsertedLinkPath ? Path.equals(path, editor.lastInsertedLinkPath) : false\n );\n const elementText = link.children.map((child) => child.text).join('');\n const [linkText, setLinkText] = React.useState(elementText);\n const [linkUrl, setLinkUrl] = React.useState(link.url);\n const linkInputRef = React.useRef<HTMLInputElement>(null);\n const isLastInsertedLink = editor.lastInsertedLinkPath\n ? !Path.equals(path, editor.lastInsertedLinkPath)\n : true;\n const [isSaveDisabled, setIsSaveDisabled] = React.useState(false);\n\n const onLinkChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setIsSaveDisabled(false);\n setLinkUrl(e.target.value);\n\n try {\n // eslint-disable-next-line no-new\n new URL(\n e.target.value?.startsWith('/') ? `https://strapi.io${e.target.value}` : e.target.value\n );\n } catch (error) {\n setIsSaveDisabled(true);\n }\n };\n\n const handleSave: React.FormEventHandler = (e) => {\n e.stopPropagation();\n\n // If the selection is collapsed, we select the parent node because we want all the link to be replaced)\n if (editor.selection && Range.isCollapsed(editor.selection)) {\n const [, parentPath] = Editor.parent(editor, editor.selection.focus?.path);\n Transforms.select(editor, parentPath);\n }\n\n editLink(editor, { url: linkUrl, text: linkText });\n setPopoverOpen(false);\n editor.lastInsertedLinkPath = null;\n ReactEditor.focus(editor);\n };\n\n const handleClose = () => {\n if (link.url === '') {\n removeLink(editor);\n }\n\n setPopoverOpen(false);\n ReactEditor.focus(editor);\n };\n\n React.useEffect(() => {\n // Focus on the link input element when the popover opens\n if (popoverOpen) linkInputRef.current?.focus();\n }, [popoverOpen]);\n\n const inputNotDirty =\n !linkText ||\n !linkUrl ||\n (link.url && link.url === linkUrl && elementText && elementText === linkText);\n\n return (\n <Popover.Root open={popoverOpen}>\n <Popover.Trigger>\n <StyledBaseLink\n {...attributes}\n ref={forwardedRef}\n href={link.url}\n onClick={() => setPopoverOpen(true)}\n color=\"primary600\"\n >\n {children}\n </StyledBaseLink>\n </Popover.Trigger>\n <Popover.Content onPointerDownOutside={handleClose}>\n <Flex padding={4} direction=\"column\" gap={4}>\n <Field.Root width=\"368px\">\n <Flex direction=\"column\" gap={1} alignItems=\"stretch\">\n <Field.Label>\n {formatMessage({\n id: 'components.Blocks.popover.text',\n defaultMessage: 'Text',\n })}\n </Field.Label>\n <Field.Input\n name=\"text\"\n placeholder={formatMessage({\n id: 'components.Blocks.popover.text.placeholder',\n defaultMessage: 'Enter link text',\n })}\n value={linkText}\n onChange={(e) => {\n setLinkText(e.target.value);\n }}\n />\n </Flex>\n </Field.Root>\n <Field.Root width=\"368px\">\n <Flex direction=\"column\" gap={1} alignItems=\"stretch\">\n <Field.Label>\n {formatMessage({\n id: 'components.Blocks.popover.link',\n defaultMessage: 'Link',\n })}\n </Field.Label>\n <Field.Input\n ref={linkInputRef}\n name=\"url\"\n placeholder={formatMessage({\n id: 'components.Blocks.popover.link.placeholder',\n defaultMessage: 'Paste link',\n })}\n value={linkUrl}\n onChange={onLinkChange}\n />\n </Flex>\n </Field.Root>\n <Flex justifyContent=\"space-between\" width=\"100%\">\n <RemoveButton\n variant=\"danger-light\"\n onClick={() => removeLink(editor)}\n $visible={isLastInsertedLink}\n >\n {formatMessage({\n id: 'components.Blocks.popover.remove',\n defaultMessage: 'Remove',\n })}\n </RemoveButton>\n <Flex gap={2}>\n <Button variant=\"tertiary\" onClick={handleClose}>\n {formatMessage({\n id: 'components.Blocks.popover.cancel',\n defaultMessage: 'Cancel',\n })}\n </Button>\n <Button disabled={Boolean(inputNotDirty) || isSaveDisabled} onClick={handleSave}>\n {formatMessage({\n id: 'components.Blocks.popover.save',\n defaultMessage: 'Save',\n })}\n </Button>\n </Flex>\n </Flex>\n </Flex>\n </Popover.Content>\n </Popover.Root>\n );\n }\n);\n\nconst Link = React.forwardRef<HTMLAnchorElement, RenderElementProps>((props, forwardedRef) => {\n if (!isLinkNode(props.element)) {\n return null;\n }\n\n // LinkContent uses React hooks that rely on props.element being a link. If the type guard above\n // doesn't pass, those hooks would be called conditionnally, which is not allowed.\n // Hence the need for a separate component.\n return <LinkContent {...props} link={props.element} ref={forwardedRef} />;\n});\n\nconst linkBlocks: Pick<BlocksStore, 'link'> = {\n link: {\n renderElement: (props) => (\n <Link element={props.element} attributes={props.attributes}>\n {props.children}\n </Link>\n ),\n // No handleConvert here, links are created via the link button in the toolbar\n matchNode: (node) => node.type === 'link',\n isInBlocksSelector: false,\n },\n};\n\nexport { linkBlocks };\n","import * as React from 'react';\n\nimport { Typography } from '@strapi/design-system';\nimport { BulletList, NumberList } from '@strapi/icons';\nimport { type Text, Editor, Node, Transforms, Path } from 'slate';\nimport { type RenderElementProps, ReactEditor } from 'slate-react';\nimport { styled, type CSSProperties, css } from 'styled-components';\n\nimport { type BlocksStore } from '../BlocksEditor';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { isListNode, type Block } from '../utils/types';\n\nconst listStyle = css`\n display: flex;\n flex-direction: column;\n gap: ${({ theme }) => theme.spaces[2]};\n margin-inline-start: ${({ theme }) => theme.spaces[0]};\n margin-inline-end: ${({ theme }) => theme.spaces[0]};\n padding-inline-start: ${({ theme }) => theme.spaces[2]};\n\n ol,\n ul {\n margin-block-start: ${({ theme }) => theme.spaces[0]};\n margin-block-end: ${({ theme }) => theme.spaces[0]};\n }\n\n li {\n margin-inline-start: ${({ theme }) => theme.spaces[3]};\n }\n`;\n\nconst Orderedlist = styled.ol<{ $listStyleType: CSSProperties['listStyleType'] }>`\n list-style-type: ${(props) => props.$listStyleType};\n ${listStyle}\n`;\n\nconst Unorderedlist = styled.ul<{ $listStyleType: CSSProperties['listStyleType'] }>`\n list-style-type: ${(props) => props.$listStyleType};\n ${listStyle}\n`;\n\nconst orderedStyles = ['decimal', 'lower-alpha', 'upper-roman'];\nconst unorderedStyles = ['disc', 'circle', 'square'];\n\nconst List = ({ attributes, children, element }: RenderElementProps) => {\n if (!isListNode(element)) {\n return null;\n }\n\n // Decide the subsequent style by referencing the given styles according to the format,\n // allowing for infinite nested lists\n const listStyles = element.format === 'ordered' ? orderedStyles : unorderedStyles;\n const nextIndex = (element.indentLevel || 0) % listStyles!.length;\n const listStyleType = listStyles![nextIndex];\n\n if (element.format === 'ordered') {\n return (\n <Orderedlist $listStyleType={listStyleType} {...attributes}>\n {children}\n </Orderedlist>\n );\n }\n\n return (\n <Unorderedlist $listStyleType={listStyleType} {...attributes}>\n {children}\n </Unorderedlist>\n );\n};\n\nconst replaceListWithEmptyBlock = (editor: Editor, currentListPath: Path) => {\n // Delete the empty list\n Transforms.removeNodes(editor, { at: currentListPath });\n\n if (currentListPath[0] === 0) {\n // If the list was the only (or first) block element then insert empty paragraph as editor needs default value\n Transforms.insertNodes(\n editor,\n {\n type: 'paragraph',\n children: [{ type: 'text', text: '' }],\n },\n { at: currentListPath }\n );\n Transforms.select(editor, currentListPath);\n }\n};\n\nconst isText = (node: unknown): node is Text => {\n return Node.isNode(node) && !Editor.isEditor(node) && node.type === 'text';\n};\n\n/**\n * Common handler for the backspace event on ordered and unordered lists\n */\nconst handleBackspaceKeyOnList = (editor: Editor, event: React.KeyboardEvent<HTMLElement>) => {\n if (!editor.selection) return;\n\n const [currentListItem, currentListItemPath] = Editor.parent(editor, editor.selection.anchor);\n const [currentList, currentListPath] = Editor.parent(editor, currentListItemPath);\n const isListEmpty =\n currentList.children.length === 1 &&\n isText(currentListItem.children[0]) &&\n currentListItem.children[0].text === '';\n const isListItemEmpty =\n currentListItem.children.length === 1 &&\n isText(currentListItem.children[0]) &&\n currentListItem.children[0].text === '';\n const isFocusAtTheBeginningOfAChild =\n editor.selection.focus.offset === 0 && editor.selection.focus.path.at(-2) === 0;\n\n if (isListEmpty) {\n const parentListEntry = Editor.above(editor, {\n at: currentListPath,\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n });\n if (!parentListEntry) {\n event.preventDefault();\n replaceListWithEmptyBlock(editor, currentListPath);\n }\n } else if (isFocusAtTheBeginningOfAChild) {\n // If the focus is at the beginning of a child node we need to replace it with a paragraph\n Transforms.liftNodes(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list-item',\n });\n Transforms.setNodes(editor, { type: 'paragraph' });\n } else if (isListItemEmpty) {\n const previousEntry = Editor.previous(editor, {\n at: currentListItemPath,\n });\n const nextEntry = Editor.next(editor, {\n at: currentListItemPath,\n });\n\n if (previousEntry && nextEntry) {\n // If previous and next nodes are lists or list-items, delete empty list item\n event.preventDefault();\n Transforms.removeNodes(editor, {\n at: currentListItemPath,\n });\n\n // If previous and next nodes are lists with same format and indent Levels, then merge the nodes\n const [previousList] = previousEntry;\n const [nextList] = nextEntry;\n if (\n !Editor.isEditor(previousList) &&\n !isText(previousList) &&\n isListNode(previousList) &&\n !Editor.isEditor(nextList) &&\n !isText(nextList) &&\n isListNode(nextList)\n ) {\n if (\n previousList.type === 'list' &&\n nextList.type === 'list' &&\n previousList.format === nextList.format &&\n previousList.indentLevel === nextList.indentLevel\n ) {\n Transforms.mergeNodes(editor, {\n at: currentListItemPath,\n });\n }\n }\n }\n }\n};\n\n/**\n * Common handler for the enter key on ordered and unordered lists\n */\nconst handleEnterKeyOnList = (editor: Editor) => {\n const currentListItemEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list-item',\n });\n\n if (!currentListItemEntry || !editor.selection) {\n return;\n }\n\n const [currentListItem, currentListItemPath] = currentListItemEntry;\n const [currentList, currentListPath] = Editor.parent(editor, currentListItemPath);\n const isListEmpty =\n currentList.children.length === 1 &&\n isText(currentListItem.children[0]) &&\n currentListItem.children[0].text === '';\n const isListItemEmpty =\n currentListItem.children.length === 1 &&\n isText(currentListItem.children[0]) &&\n currentListItem.children[0].text === '';\n const isFocusAtTheBeginningOfAChild =\n editor.selection.focus.offset === 0 && editor.selection.focus.path.at(-1) === 0;\n\n if (isListEmpty) {\n replaceListWithEmptyBlock(editor, currentListPath);\n } else if (isFocusAtTheBeginningOfAChild && !isListItemEmpty) {\n // If the focus is at the beginning of a child node, shift below the list item and create a new list-item\n const currentNode = Editor.above(editor, { at: editor.selection.anchor });\n Transforms.insertNodes(editor, { type: 'list-item', children: [{ type: 'text', text: '' }] });\n if (currentNode) {\n const path = currentNode[1];\n const updatedPath = [...path.slice(0, -1), path[path.length - 1] + 1];\n Transforms.select(editor, {\n anchor: { path: updatedPath.concat(0), offset: 0 },\n focus: { path: updatedPath.concat(0), offset: 0 },\n });\n }\n } else if (isListItemEmpty) {\n // Check if there is a list above the current list and shift list-item under it\n if (\n !Editor.isEditor(currentList) &&\n isListNode(currentList) &&\n currentList?.indentLevel &&\n currentList.indentLevel > 0\n ) {\n const previousIndentLevel = currentList.indentLevel - 1;\n\n const parentListNodeEntry = Editor.above(editor, {\n match: (node) =>\n !Editor.isEditor(node) &&\n node.type === 'list' &&\n (node.indentLevel || 0) === previousIndentLevel,\n });\n\n if (parentListNodeEntry) {\n // Get the parent list path and add 1 to it to exit from the current list\n const modifiedPath = currentListItemPath.slice(0, -1);\n if (modifiedPath.length > 0) {\n modifiedPath[modifiedPath.length - 1] += 1;\n }\n\n // Shift list-item under parent list\n Transforms.moveNodes(editor, {\n at: currentListItemPath,\n to: modifiedPath,\n });\n return;\n }\n }\n\n // Otherwise delete the empty list item and create a new paragraph below the parent list\n Transforms.removeNodes(editor, { at: currentListItemPath });\n\n const createdParagraphPath = Path.next(currentListPath);\n Transforms.insertNodes(\n editor,\n {\n type: 'paragraph',\n children: [{ type: 'text', text: '' }],\n },\n { at: createdParagraphPath }\n );\n\n // Move the selection to the newly created paragraph\n Transforms.select(editor, createdParagraphPath);\n } else {\n // Check if the cursor is at the end of the list item\n const isNodeEnd = Editor.isEnd(editor, editor.selection.anchor, currentListItemPath);\n\n if (isNodeEnd) {\n // If there was nothing after the cursor, create a fresh new list item,\n // in order to avoid carrying over the modifiers from the previous list item\n Transforms.insertNodes(editor, { type: 'list-item', children: [{ type: 'text', text: '' }] });\n } else {\n // If there is something after the cursor, split the current list item,\n // so that we keep the content and the modifiers\n Transforms.splitNodes(editor);\n }\n }\n};\n\n/**\n * Common handler for converting a node to a list\n */\nconst handleConvertToList = (editor: Editor, format: Block<'list'>['format']) => {\n const convertedPath = baseHandleConvert<Block<'list-item'>>(editor, { type: 'list-item' });\n\n if (!convertedPath) return;\n\n Transforms.wrapNodes(editor, { type: 'list', format, children: [] }, { at: convertedPath });\n};\n\n/**\n * Common handler for the tab key on ordered and unordered lists\n */\nconst handleTabOnList = (editor: Editor) => {\n const currentListItemEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list-item',\n });\n\n if (!currentListItemEntry || !editor.selection) {\n return;\n }\n\n const [currentListItem, currentListItemPath] = currentListItemEntry;\n const [currentList] = Editor.parent(editor, currentListItemPath);\n\n // Skip tabbing if list-item is the first item in the list\n if (currentListItem === currentList.children[0]) return;\n\n const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);\n const previousNode = currentList.children[currentListItemIndex - 1];\n\n // If previous node is a list block then move the list-item under it\n if (previousNode.type === 'list') {\n const nodePath = ReactEditor.findPath(editor, previousNode);\n const insertAtPath = previousNode.children.length;\n\n Transforms.moveNodes(editor, {\n at: currentListItemPath,\n to: nodePath.concat(insertAtPath),\n });\n return;\n }\n\n if (!Editor.isEditor(currentList) && isListNode(currentList)) {\n // Wrap list-item with list block on tab\n Transforms.wrapNodes(editor, {\n type: 'list',\n format: currentList.format,\n indentLevel: (currentList.indentLevel || 0) + 1,\n children: [],\n });\n }\n};\n\nconst listBlocks: Pick<BlocksStore, 'list-ordered' | 'list-unordered' | 'list-item'> = {\n 'list-ordered': {\n renderElement: (props) => <List {...props} />,\n label: {\n id: 'components.Blocks.blocks.orderedList',\n defaultMessage: 'Numbered list',\n },\n icon: NumberList,\n matchNode: (node) => node.type === 'list' && node.format === 'ordered',\n isInBlocksSelector: true,\n handleConvert: (editor) => handleConvertToList(editor, 'ordered'),\n handleEnterKey: handleEnterKeyOnList,\n handleBackspaceKey: handleBackspaceKeyOnList,\n handleTab: handleTabOnList,\n snippets: ['1.'],\n },\n 'list-unordered': {\n renderElement: (props) => <List {...props} />,\n label: {\n id: 'components.Blocks.blocks.unorderedList',\n defaultMessage: 'Bulleted list',\n },\n icon: BulletList,\n matchNode: (node) => node.type === 'list' && node.format === 'unordered',\n isInBlocksSelector: true,\n handleConvert: (editor) => handleConvertToList(editor, 'unordered'),\n handleEnterKey: handleEnterKeyOnList,\n handleBackspaceKey: handleBackspaceKeyOnList,\n handleTab: handleTabOnList,\n snippets: ['-', '*', '+'],\n },\n 'list-item': {\n renderElement: (props) => (\n <Typography tag=\"li\" {...props.attributes}>\n {props.children}\n </Typography>\n ),\n // No handleConvert, list items are created when converting to the parent list\n matchNode: (node) => node.type === 'list-item',\n isInBlocksSelector: false,\n dragHandleTopMargin: '-2px',\n },\n};\n\nexport { listBlocks };\n","import * as React from 'react';\n\nimport { Typography } from '@strapi/design-system';\nimport { Paragraph } from '@strapi/icons';\nimport { type Text, Editor, Transforms } from 'slate';\n\nimport { type BlocksStore } from '../BlocksEditor';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { type Block } from '../utils/types';\n\nconst paragraphBlocks: Pick<BlocksStore, 'paragraph'> = {\n paragraph: {\n renderElement: (props) => (\n <Typography tag=\"p\" variant=\"omega\" {...props.attributes}>\n {props.children}\n </Typography>\n ),\n icon: Paragraph,\n label: {\n id: 'components.Blocks.blocks.text',\n defaultMessage: 'Text',\n },\n matchNode: (node) => node.type === 'paragraph',\n isInBlocksSelector: true,\n dragHandleTopMargin: '-2px',\n handleConvert(editor) {\n baseHandleConvert<Block<'paragraph'>>(editor, { type: 'paragraph' });\n },\n handleEnterKey(editor) {\n if (!editor.selection) {\n return;\n }\n\n // We need to keep track of the initial position of the cursor\n const anchorPathInitialPosition = editor.selection.anchor.path;\n /**\n * Split the nodes where the cursor is. This will create a new paragraph with the content\n * after the cursor, while retaining all the children, modifiers etc.\n */\n Transforms.splitNodes(editor, {\n // Makes sure we always create a new node,\n // even if there's nothing to the right of the cursor in the node.\n always: true,\n });\n\n // Check if the created node is empty (if there was no text after the cursor in the node)\n // This lets us know if we need to carry over the modifiers from the previous node\n const parentBlockEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type !== 'text',\n });\n if (!parentBlockEntry) {\n return;\n }\n const [, parentBlockPath] = parentBlockEntry;\n const isNodeEnd = Editor.isEnd(editor, editor.selection.anchor, parentBlockPath);\n\n /**\n * Delete and recreate the node that was created at the right of the cursor.\n * This is to avoid node pollution\n * (e.g. keeping the level attribute when converting a heading to a paragraph).\n * Select the parent of the selection because we want the full block, not the leaf.\n * And copy its children to make sure we keep the modifiers.\n */\n const [fragmentedNode] = Editor.parent(editor, editor.selection.anchor.path);\n Transforms.removeNodes(editor);\n\n // Check if after the current position there is another node\n const hasNextNode = editor.children.length - anchorPathInitialPosition[0] > 1;\n\n // Insert the new node at the right position.\n // The next line after the editor selection if present or otherwise at the end of the editor.\n Transforms.insertNodes(\n editor,\n {\n type: 'paragraph',\n // Don't carry over the modifiers from the previous node if there was no text after the cursor\n children: (isNodeEnd ? [{ type: 'text', text: '' }] : fragmentedNode.children) as Text[],\n },\n {\n at: hasNextNode ? [anchorPathInitialPosition[0] + 1] : [editor.children.length],\n }\n );\n\n /**\n * The new selection will by default be at the end of the created node.\n * Instead we manually move it to the start of the created node.\n * Make sure to we go to the start of the node and not the start of the leaf.\n */\n Transforms.select(editor, editor.start([anchorPathInitialPosition[0] + 1]));\n },\n },\n};\n\nexport { paragraphBlocks };\n","import { Quotes } from '@strapi/icons';\nimport { styled } from 'styled-components';\n\nimport { type BlocksStore } from '../BlocksEditor';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { pressEnterTwiceToExit } from '../utils/enterKey';\nimport { type Block } from '../utils/types';\n\nconst Blockquote = styled.blockquote.attrs({ role: 'blockquote' })`\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n border-left: ${({ theme }) => `${theme.spaces[1]} solid ${theme.colors.neutral200}`};\n padding: ${({ theme }) => theme.spaces[2]} ${({ theme }) => theme.spaces[4]};\n color: ${({ theme }) => theme.colors.neutral600};\n`;\n\nconst quoteBlocks: Pick<BlocksStore, 'quote'> = {\n quote: {\n renderElement: (props) => (\n // The div is needed to make sure the padding bottom from BlocksContent is applied properly\n // when the quote is the last block in the editor\n <div>\n <Blockquote {...props.attributes}>{props.children}</Blockquote>\n </div>\n ),\n icon: Quotes,\n label: {\n id: 'components.Blocks.blocks.quote',\n defaultMessage: 'Quote',\n },\n matchNode: (node) => node.type === 'quote',\n isInBlocksSelector: true,\n handleConvert(editor) {\n baseHandleConvert<Block<'quote'>>(editor, { type: 'quote' });\n },\n handleEnterKey(editor) {\n pressEnterTwiceToExit(editor);\n },\n snippets: ['>'],\n dragHandleTopMargin: '6px',\n },\n};\n\nexport { quoteBlocks };\n","import * as React from 'react';\n\nimport * as Toolbar from '@radix-ui/react-toolbar';\nimport {\n Flex,\n Tooltip,\n SingleSelect,\n SingleSelectOption,\n Box,\n FlexComponent,\n BoxComponent,\n} from '@strapi/design-system';\nimport { Link } from '@strapi/icons';\nimport { MessageDescriptor, useIntl } from 'react-intl';\nimport { Editor, Transforms, Element as SlateElement, Node, type Ancestor } from 'slate';\nimport { ReactEditor } from 'slate-react';\nimport { styled } from 'styled-components';\n\nimport {\n type BlocksStore,\n type SelectorBlockKey,\n isSelectorBlockKey,\n useBlocksEditorContext,\n} from './BlocksEditor';\nimport { insertLink } from './utils/links';\nimport { type Block, getEntries, getKeys } from './utils/types';\n\nconst ToolbarWrapper = styled<FlexComponent>(Flex)`\n &[aria-disabled='true'] {\n cursor: not-allowed;\n }\n`;\n\nconst Separator = styled(Toolbar.Separator)`\n background: ${({ theme }) => theme.colors.neutral150};\n width: 1px;\n height: 2.4rem;\n`;\n\nconst FlexButton = styled<FlexComponent<'button'>>(Flex)`\n // Inherit the not-allowed cursor from ToolbarWrapper when disabled\n &[aria-disabled] {\n cursor: inherit;\n }\n\n &[aria-disabled='false'] {\n cursor: pointer;\n\n // Only apply hover styles if the button is enabled\n &:hover {\n background: ${({ theme }) => theme.colors.primary100};\n }\n }\n`;\n\nconst SelectWrapper = styled<BoxComponent>(Box)`\n // Styling changes to SingleSelect component don't work, so adding wrapper to target SingleSelect\n div[role='combobox'] {\n border: none;\n cursor: pointer;\n min-height: unset;\n padding-top: 6px;\n padding-bottom: 6px;\n\n &[aria-disabled='false']:hover {\n cursor: pointer;\n background: ${({ theme }) => theme.colors.primary100};\n }\n\n &[aria-disabled] {\n background: transparent;\n cursor: inherit;\n\n // Select text and icons should also have disabled color\n span {\n color: ${({ theme }) => theme.colors.neutral600};\n }\n }\n }\n`;\n\n/**\n * Handles the modal component that may be returned by a block when converting it\n */\nfunction useConversionModal() {\n const [modalElement, setModalComponent] = React.useState<React.JSX.Element | null>(null);\n\n const handleConversionResult = (renderModal: void | (() => React.JSX.Element) | undefined) => {\n // Not all blocks return a modal\n if (renderModal) {\n // Use cloneElement to apply a key because to create a new instance of the component\n // Without the new key, the state is kept from previous times that option was picked\n setModalComponent(React.cloneElement(renderModal(), { key: Date.now() }));\n }\n };\n\n return { modalElement, handleConversionResult };\n}\n\ninterface ToolbarButtonProps {\n icon: React.ComponentType<React.SVGProps<SVGSVGElement>>;\n name: string;\n label: MessageDescriptor;\n isActive: boolean;\n disabled: boolean;\n handleClick: () => void;\n}\n\nconst ToolbarButton = ({\n icon: Icon,\n name,\n label,\n isActive,\n disabled,\n handleClick,\n}: ToolbarButtonProps) => {\n const { editor } = useBlocksEditorContext('ToolbarButton');\n const { formatMessage } = useIntl();\n const labelMessage = formatMessage(label);\n\n const enabledColor = isActive ? 'primary600' : 'neutral600';\n\n return (\n <Tooltip description={labelMessage}>\n <Toolbar.ToggleItem\n value={name}\n data-state={isActive ? 'on' : 'off'}\n onMouseDown={(e) => {\n e.preventDefault();\n handleClick();\n ReactEditor.focus(editor);\n }}\n aria-disabled={disabled}\n disabled={disabled}\n aria-label={labelMessage}\n asChild\n >\n <FlexButton\n tag=\"button\"\n background={isActive ? 'primary100' : ''}\n alignItems=\"center\"\n justifyContent=\"center\"\n width={7}\n height={7}\n hasRadius\n >\n <Icon fill={disabled ? 'neutral300' : enabledColor} />\n </FlexButton>\n </Toolbar.ToggleItem>\n </Tooltip>\n );\n};\n\nconst BlocksDropdown = () => {\n const { editor, blocks, disabled } = useBlocksEditorContext('BlocksDropdown');\n const { formatMessage } = useIntl();\n const { modalElement, handleConversionResult } = useConversionModal();\n\n const blockKeysToInclude: SelectorBlockKey[] = getEntries(blocks).reduce<\n ReturnType<typeof getEntries>\n >((currentKeys, entry) => {\n const [key, block] = entry;\n\n return block.isInBlocksSelector ? [...currentKeys, key] : currentKeys;\n }, []);\n\n const [blockSelected, setBlockSelected] = React.useState<SelectorBlockKey>('paragraph');\n\n const handleSelect = (optionKey: unknown) => {\n if (!isSelectorBlockKey(optionKey)) {\n return;\n }\n\n const editorIsEmpty =\n editor.children.length === 1 && Editor.isEmpty(editor, editor.children[0]);\n\n if (!editor.selection && !editorIsEmpty) {\n // When there is no selection, create an empty block at the end of the editor\n // so that it can be converted to the selected block\n Transforms.insertNodes(\n editor,\n {\n type: 'quote',\n children: [{ type: 'text', text: '' }],\n },\n {\n select: true,\n // Since there's no selection, Slate will automatically insert the node at the end\n }\n );\n } else if (!editor.selection && editorIsEmpty) {\n // When there is no selection and the editor is empty,\n // select the empty paragraph from Slate's initialValue so it gets converted\n Transforms.select(editor, Editor.start(editor, [0, 0]));\n }\n\n // If selection is already a list block, toggle its format\n const currentListEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n });\n\n if (currentListEntry && ['list-ordered', 'list-unordered'].includes(optionKey)) {\n const [currentList, currentListPath] = currentListEntry;\n const format = optionKey === 'list-ordered' ? 'ordered' : 'unordered';\n\n if (!Editor.isEditor(currentList) && isListNode(currentList)) {\n // Format is different, toggle list format\n if (currentList.format !== format) {\n Transforms.setNodes(editor, { format }, { at: currentListPath });\n }\n }\n return;\n }\n\n // Let the block handle the Slate conversion logic\n const maybeRenderModal = blocks[optionKey].handleConvert?.(editor);\n handleConversionResult(maybeRenderModal);\n\n setBlockSelected(optionKey);\n\n ReactEditor.focus(editor);\n };\n\n /**\n * Prevent the select from focusing itself so ReactEditor.focus(editor) can focus the editor instead.\n *\n * The editor first loses focus to a blur event when clicking the select button. However,\n * refocusing the editor is not enough since the select's default behavior is to refocus itself\n * after an option is selected.\n *\n */\n const preventSelectFocus = (e: Event) => e.preventDefault();\n\n // Listen to the selection change and update the selected block in the dropdown\n React.useEffect(() => {\n if (editor.selection) {\n let selectedNode: Ancestor;\n\n // If selection anchor is a list-item, get its parent\n const currentListEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n at: editor.selection.anchor,\n });\n\n if (currentListEntry) {\n const [currentList] = currentListEntry;\n selectedNode = currentList;\n } else {\n // Get the parent node of the anchor other than list-item\n const [anchorNode] = Editor.parent(editor, editor.selection.anchor, {\n edge: 'start',\n depth: 2,\n });\n\n // @ts-expect-error slate's delete behaviour creates an exceptional type\n if (anchorNode.type === 'list-item') {\n // When the last node in the selection is a list item,\n // slate's default delete operation leaves an empty list-item instead of converting it into a paragraph.\n // Issue: https://github.com/ianstormtaylor/slate/issues/2500\n\n Transforms.setNodes(editor, { type: 'paragraph' });\n // @ts-expect-error convert explicitly type to paragraph\n selectedNode = { ...anchorNode, type: 'paragraph' };\n } else {\n selectedNode = anchorNode;\n }\n }\n\n // Find the block key that matches the anchor node\n const anchorBlockKey = getKeys(blocks).find(\n (blockKey) => !Editor.isEditor(selectedNode) && blocks[blockKey].matchNode(selectedNode)\n );\n\n // Change the value selected in the dropdown if it doesn't match the anchor block key\n if (anchorBlockKey && anchorBlockKey !== blockSelected) {\n setBlockSelected(anchorBlockKey as SelectorBlockKey);\n }\n }\n }, [editor.selection, editor, blocks, blockSelected]);\n\n const Icon = blocks[blockSelected].icon;\n\n return (\n <>\n <SelectWrapper>\n <SingleSelect\n startIcon={<Icon />}\n onChange={handleSelect}\n placeholder={formatMessage(blocks[blockSelected].label)}\n value={blockSelected}\n onCloseAutoFocus={preventSelectFocus}\n aria-label={formatMessage({\n id: 'components.Blocks.blocks.selectBlock',\n defaultMessage: 'Select a block',\n })}\n disabled={disabled}\n >\n {blockKeysToInclude.map((key) => (\n <BlockOption\n key={key}\n value={key}\n label={blocks[key].label}\n icon={blocks[key].icon}\n blockSelected={blockSelected}\n />\n ))}\n </SingleSelect>\n </SelectWrapper>\n {modalElement}\n </>\n );\n};\n\ninterface BlockOptionProps {\n value: string;\n icon: React.ComponentType<React.SVGProps<SVGElement>>;\n label: MessageDescriptor;\n blockSelected: string;\n}\n\nconst BlockOption = ({ value, icon: Icon, label, blockSelected }: BlockOptionProps) => {\n const { formatMessage } = useIntl();\n\n const isSelected = value === blockSelected;\n\n return (\n <SingleSelectOption\n startIcon={<Icon fill={isSelected ? 'primary600' : 'neutral600'} />}\n value={value}\n >\n {formatMessage(label)}\n </SingleSelectOption>\n );\n};\n\nconst isListNode = (node: unknown): node is Block<'list'> => {\n return Node.isNode(node) && !Editor.isEditor(node) && node.type === 'list';\n};\n\ninterface ListButtonProps {\n block: BlocksStore['list-ordered'] | BlocksStore['list-unordered'];\n format: Block<'list'>['format'];\n}\n\nconst ListButton = ({ block, format }: ListButtonProps) => {\n const { editor, disabled, blocks } = useBlocksEditorContext('ListButton');\n\n const isListActive = () => {\n if (!editor.selection) return false;\n\n // Get the parent list at selection anchor node\n const currentListEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n at: editor.selection.anchor,\n });\n\n if (currentListEntry) {\n const [currentList] = currentListEntry;\n if (!Editor.isEditor(currentList) && isListNode(currentList) && currentList.format === format)\n return true;\n }\n return false;\n };\n\n /**\n * @TODO: Currently, applying list while multiple blocks are selected is not supported.\n * We should implement this feature in the future.\n */\n const isListDisabled = () => {\n // Always disabled when the whole editor is disabled\n if (disabled) {\n return true;\n }\n\n // Always enabled when there's no selection\n if (!editor.selection) {\n return false;\n }\n\n // Get the block node closest to the anchor and focus\n const anchorNodeEntry = Editor.above(editor, {\n at: editor.selection.anchor,\n match: (node) => !Editor.isEditor(node) && node.type !== 'text',\n });\n const focusNodeEntry = Editor.above(editor, {\n at: editor.selection.focus,\n match: (node) => !Editor.isEditor(node) && node.type !== 'text',\n });\n\n if (!anchorNodeEntry || !focusNodeEntry) {\n return false;\n }\n\n // Disabled if the anchor and focus are not in the same block\n return anchorNodeEntry[0] !== focusNodeEntry[0];\n };\n\n const toggleList = (format: Block<'list'>['format']) => {\n let currentListEntry;\n if (editor.selection) {\n currentListEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n });\n } else {\n // If no selection, toggle last inserted node\n const [_, lastNodePath] = Editor.last(editor, []);\n currentListEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n at: lastNodePath,\n });\n }\n\n if (!currentListEntry) {\n // If selection is not a list then convert it to list\n blocks[`list-${format}`].handleConvert!(editor);\n return;\n }\n\n // If selection is already a list then toggle format\n const [currentList, currentListPath] = currentListEntry;\n\n if (!Editor.isEditor(currentList) && isListNode(currentList)) {\n if (currentList.format !== format) {\n // Format is different, toggle list format\n Transforms.setNodes(editor, { format }, { at: currentListPath });\n } else {\n // Format is same, convert selected list-item to paragraph\n blocks['paragraph'].handleConvert!(editor);\n }\n }\n };\n\n return (\n <ToolbarButton\n icon={block.icon}\n name={format}\n label={block.label}\n isActive={isListActive()}\n disabled={isListDisabled()}\n handleClick={() => toggleList(format)}\n />\n );\n};\n\nconst LinkButton = ({ disabled }: { disabled: boolean }) => {\n const { editor } = useBlocksEditorContext('LinkButton');\n\n const isLinkActive = () => {\n const { selection } = editor;\n\n if (!selection) return false;\n\n const [match] = Array.from(\n Editor.nodes(editor, {\n at: Editor.unhangRange(editor, selection),\n match: (node) => SlateElement.isElement(node) && node.type === 'link',\n })\n );\n\n return Boolean(match);\n };\n\n const isLinkDisabled = () => {\n // Always disabled when the whole editor is disabled\n if (disabled) {\n return true;\n }\n\n // Always enabled when there's no selection\n if (!editor.selection) {\n return false;\n }\n\n // Get the block node closest to the anchor and focus\n const anchorNodeEntry = Editor.above(editor, {\n at: editor.selection.anchor,\n match: (node) => !Editor.isEditor(node) && node.type !== 'text',\n });\n const focusNodeEntry = Editor.above(editor, {\n at: editor.selection.focus,\n match: (node) => !Editor.isEditor(node) && node.type !== 'text',\n });\n\n if (!anchorNodeEntry || !focusNodeEntry) {\n return false;\n }\n\n // Disabled if the anchor and focus are not in the same block\n return anchorNodeEntry[0] !== focusNodeEntry[0];\n };\n\n const addLink = () => {\n editor.shouldSaveLinkPath = true;\n // We insert an empty anchor, so we split the DOM to have a element we can use as reference for the popover\n insertLink(editor, { url: '' });\n };\n\n return (\n <ToolbarButton\n icon={Link}\n name=\"link\"\n label={{\n id: 'components.Blocks.link',\n defaultMessage: 'Link',\n }}\n isActive={isLinkActive()}\n handleClick={addLink}\n disabled={isLinkDisabled()}\n />\n );\n};\n\nconst BlocksToolbar = () => {\n const { editor, blocks, modifiers, disabled } = useBlocksEditorContext('BlocksToolbar');\n\n /**\n * The modifier buttons are disabled when an image is selected.\n */\n const checkButtonDisabled = () => {\n // Always disabled when the whole editor is disabled\n if (disabled) {\n return true;\n }\n\n if (!editor.selection) {\n return false;\n }\n\n const selectedNode = editor.children[editor.selection.anchor.path[0]];\n\n if (['image', 'code'].includes(selectedNode.type)) {\n return true;\n }\n\n return false;\n };\n\n const isButtonDisabled = checkButtonDisabled();\n\n return (\n <Toolbar.Root aria-disabled={disabled} asChild>\n <ToolbarWrapper gap={2} padding={2}>\n <BlocksDropdown />\n <Separator />\n <Toolbar.ToggleGroup type=\"multiple\" asChild>\n <Flex gap={1}>\n {Object.entries(modifiers).map(([name, modifier]) => (\n <ToolbarButton\n key={name}\n name={name}\n icon={modifier.icon}\n label={modifier.label}\n isActive={modifier.checkIsActive(editor)}\n handleClick={() => modifier.handleToggle(editor)}\n disabled={isButtonDisabled}\n />\n ))}\n <LinkButton disabled={isButtonDisabled} />\n </Flex>\n </Toolbar.ToggleGroup>\n <Separator />\n <Toolbar.ToggleGroup type=\"single\" asChild>\n <Flex gap={1}>\n <ListButton block={blocks['list-unordered']} format=\"unordered\" />\n <ListButton block={blocks['list-ordered']} format=\"ordered\" />\n </Flex>\n </Toolbar.ToggleGroup>\n </ToolbarWrapper>\n </Toolbar.Root>\n );\n};\n\nexport { BlocksToolbar, useConversionModal };\n","import * as React from 'react';\n\nimport {\n Box,\n BoxComponent,\n Flex,\n FlexComponent,\n IconButton,\n IconButtonComponent,\n useComposedRefs,\n} from '@strapi/design-system';\nimport { Drag } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { Editor, Range, Transforms } from 'slate';\nimport { ReactEditor, type RenderElementProps, type RenderLeafProps, Editable } from 'slate-react';\nimport { styled, CSSProperties, css } from 'styled-components';\n\nimport { ItemTypes } from '../../../../../constants/dragAndDrop';\nimport { useDragAndDrop, DIRECTIONS } from '../../../../../hooks/useDragAndDrop';\nimport { getTranslation } from '../../../../../utils/translations';\n\nimport { type BlocksStore, useBlocksEditorContext } from './BlocksEditor';\nimport { useConversionModal } from './BlocksToolbar';\nimport { type ModifiersStore } from './Modifiers';\nimport { getEntries, isLinkNode, isListNode } from './utils/types';\n\nconst StyledEditable = styled(Editable)<{ isExpandedMode: boolean }>`\n // The outline style is set on the wrapper with :focus-within\n outline: none;\n display: flex;\n flex-direction: column;\n gap: ${({ theme }) => theme.spaces[3]};\n height: 100%;\n // For fullscreen align input in the center with fixed width\n width: ${(props) => (props.isExpandedMode ? '512px' : '100%')};\n margin: auto;\n\n > *:last-child {\n padding-bottom: ${({ theme }) => theme.spaces[3]};\n }\n`;\n\nconst Wrapper = styled<BoxComponent>(Box)<{ isOverDropTarget: boolean }>`\n position: ${({ isOverDropTarget }) => isOverDropTarget && 'relative'};\n`;\n\ntype DragDirection = (typeof DIRECTIONS)[keyof typeof DIRECTIONS];\n\nconst DropPlaceholder = styled<BoxComponent>(Box)<{\n dragDirection: DragDirection | null;\n placeholderMargin: 1 | 2;\n}>`\n position: absolute;\n right: 0;\n\n // Show drop placeholder 8px above or below the drop target\n ${({ dragDirection, theme, placeholderMargin }) => css`\n top: ${dragDirection === DIRECTIONS.UPWARD && `-${theme.spaces[placeholderMargin]}`};\n bottom: ${dragDirection === DIRECTIONS.DOWNWARD && `-${theme.spaces[placeholderMargin]}`};\n `}\n`;\n\nconst DragItem = styled<FlexComponent>(Flex)<{ $dragVisibility: CSSProperties['visibility'] }>`\n // Style each block rendered using renderElement()\n & > [data-slate-node='element'] {\n width: 100%;\n opacity: inherit;\n }\n\n // Set the visibility of drag button\n [role='button'] {\n visibility: ${(props) => props.$dragVisibility};\n opacity: inherit;\n }\n &[aria-disabled='true'] {\n user-drag: none;\n }\n`;\n\nconst DragIconButton = styled<IconButtonComponent<'div'>>(IconButton)<{\n $dragHandleTopMargin?: CSSProperties['marginTop'];\n}>`\n user-select: none;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ${({ theme }) => theme.borderRadius};\n width: ${({ theme }) => theme.spaces[4]};\n height: ${({ theme }) => theme.spaces[6]};\n visibility: hidden;\n cursor: grab;\n opacity: inherit;\n margin-top: ${(props) => props.$dragHandleTopMargin ?? 0};\n\n &:hover {\n background: ${({ theme }) => theme.colors.neutral200};\n }\n &:active {\n cursor: grabbing;\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background: transparent;\n }\n svg {\n height: auto;\n min-width: ${({ theme }) => theme.spaces[3]};\n\n path {\n fill: ${({ theme }) => theme.colors.neutral700};\n }\n }\n`;\n\ntype Direction = {\n setDragDirection: (direction: DragDirection) => void;\n dragDirection: DragDirection | null;\n};\n\ntype DragAndDropElementProps = Direction & {\n children: RenderElementProps['children'];\n index: Array<number>;\n dragHandleTopMargin?: CSSProperties['marginTop'];\n};\n\nconst DragAndDropElement = ({\n children,\n index,\n setDragDirection,\n dragDirection,\n dragHandleTopMargin,\n}: DragAndDropElementProps) => {\n const { editor, disabled, name, setLiveText } = useBlocksEditorContext('drag-and-drop');\n const { formatMessage } = useIntl();\n const [dragVisibility, setDragVisibility] = React.useState<CSSProperties['visibility']>('hidden');\n\n const handleMoveBlock = React.useCallback(\n (newIndex: Array<number>, currentIndex: Array<number>) => {\n Transforms.moveNodes(editor, {\n at: currentIndex,\n to: newIndex,\n });\n\n // Add 1 to the index for the live text message\n const currentIndexPosition = [currentIndex[0] + 1, ...currentIndex.slice(1)];\n const newIndexPosition = [newIndex[0] + 1, ...newIndex.slice(1)];\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('components.Blocks.dnd.reorder'),\n defaultMessage: '{item}, moved. New position in the editor: {position}.',\n },\n {\n item: `${name}.${currentIndexPosition.join(',')}`,\n position: `${newIndexPosition.join(',')} of ${editor.children.length}`,\n }\n )\n );\n },\n [editor, formatMessage, name, setLiveText]\n );\n\n const [{ handlerId, isDragging, isOverDropTarget, direction }, blockRef, dropRef, dragRef] =\n useDragAndDrop(!disabled, {\n type: `${ItemTypes.BLOCKS}_${name}`,\n index,\n item: {\n index,\n displayedValue: children,\n },\n onDropItem(currentIndex, newIndex) {\n if (newIndex) handleMoveBlock(newIndex, currentIndex);\n },\n });\n\n const composedBoxRefs = useComposedRefs(blockRef, dropRef);\n\n // Set Drag direction before loosing state while dragging\n React.useEffect(() => {\n if (direction) {\n setDragDirection(direction);\n }\n }, [direction, setDragDirection]);\n\n // On selection change hide drag handle\n React.useEffect(() => {\n setDragVisibility('hidden');\n }, [editor.selection]);\n\n return (\n <Wrapper ref={composedBoxRefs} isOverDropTarget={isOverDropTarget}>\n {isOverDropTarget && (\n <DropPlaceholder\n borderStyle=\"solid\"\n borderColor=\"secondary200\"\n borderWidth=\"2px\"\n width=\"calc(100% - 24px)\"\n marginLeft=\"auto\"\n dragDirection={dragDirection}\n // For list items placeholder reduce the margin around\n placeholderMargin={children.props.as && children.props.as === 'li' ? 1 : 2}\n />\n )}\n {isDragging ? (\n <CloneDragItem dragHandleTopMargin={dragHandleTopMargin}>{children}</CloneDragItem>\n ) : (\n <DragItem\n ref={dragRef}\n data-handler-id={handlerId}\n gap={2}\n paddingLeft={2}\n alignItems=\"start\"\n onDragStart={(event) => {\n const target = event.target as HTMLElement;\n const currentTarget = event.currentTarget as HTMLElement;\n\n // Dragging action should only trigger drag event when button is dragged, however update styles on the whole dragItem.\n if (target.getAttribute('role') !== 'button') {\n event.preventDefault();\n } else {\n // Setting styles using dragging state is not working, so set it on current target element as nodes get dragged\n currentTarget.style.opacity = '0.5';\n }\n }}\n onDragEnd={(event) => {\n const currentTarget = event.currentTarget as HTMLElement;\n currentTarget.style.opacity = '1';\n }}\n onMouseMove={() => setDragVisibility('visible')}\n onSelect={() => setDragVisibility('visible')}\n onMouseLeave={() => setDragVisibility('hidden')}\n aria-disabled={disabled}\n $dragVisibility={dragVisibility}\n >\n <DragIconButton\n tag=\"div\"\n contentEditable={false}\n role=\"button\"\n tabIndex={0}\n withTooltip={false}\n label={formatMessage({\n id: getTranslation('components.DragHandle-label'),\n defaultMessage: 'Drag',\n })}\n onClick={(e) => e.stopPropagation()}\n aria-disabled={disabled}\n disabled={disabled}\n draggable\n // For some blocks top margin added to drag handle to align at the text level\n $dragHandleTopMargin={dragHandleTopMargin}\n >\n <Drag color=\"primary500\" />\n </DragIconButton>\n {children}\n </DragItem>\n )}\n </Wrapper>\n );\n};\n\ninterface CloneDragItemProps {\n children: RenderElementProps['children'];\n dragHandleTopMargin?: CSSProperties['marginTop'];\n}\n\n// To prevent applying opacity to the original item being dragged, display a cloned element without opacity.\nconst CloneDragItem = ({ children, dragHandleTopMargin }: CloneDragItemProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <DragItem gap={2} paddingLeft={2} alignItems=\"start\" $dragVisibility=\"visible\">\n <DragIconButton\n tag=\"div\"\n role=\"button\"\n withTooltip={false}\n label={formatMessage({\n id: getTranslation('components.DragHandle-label'),\n defaultMessage: 'Drag',\n })}\n $dragHandleTopMargin={dragHandleTopMargin}\n >\n <Drag color=\"neutral600\" />\n </DragIconButton>\n {children}\n </DragItem>\n );\n};\n\nconst baseRenderLeaf = (props: RenderLeafProps, modifiers: ModifiersStore) => {\n // Recursively wrap the children for each active modifier\n const wrappedChildren = getEntries(modifiers).reduce((currentChildren, modifierEntry) => {\n const [name, modifier] = modifierEntry;\n\n if (props.leaf[name]) {\n return modifier.renderLeaf(currentChildren);\n }\n\n return currentChildren;\n }, props.children);\n\n return <span {...props.attributes}>{wrappedChildren}</span>;\n};\n\ntype BaseRenderElementProps = Direction & {\n props: RenderElementProps['children'];\n blocks: BlocksStore;\n editor: Editor;\n};\n\nconst baseRenderElement = ({\n props,\n blocks,\n editor,\n setDragDirection,\n dragDirection,\n}: BaseRenderElementProps) => {\n const { element } = props;\n\n const blockMatch = Object.values(blocks).find((block) => block.matchNode(element));\n const block = blockMatch || blocks.paragraph;\n const nodePath = ReactEditor.findPath(editor, element);\n\n // Link is inline block so it cannot be dragged\n // List items and nested list blocks i.e. lists with indent level higher than 0 are skipped from dragged items\n if (\n isLinkNode(element) ||\n (isListNode(element) && element.indentLevel && element.indentLevel > 0) ||\n element.type === 'list-item'\n ) {\n return block.renderElement(props);\n }\n\n return (\n <DragAndDropElement\n index={nodePath}\n setDragDirection={setDragDirection}\n dragDirection={dragDirection}\n dragHandleTopMargin={block.dragHandleTopMargin}\n >\n {block.renderElement(props)}\n </DragAndDropElement>\n );\n};\n\ninterface BlocksContentProps {\n placeholder?: string;\n ariaLabelId: string;\n}\n\nconst BlocksContent = ({ placeholder, ariaLabelId }: BlocksContentProps) => {\n const { editor, disabled, blocks, modifiers, setLiveText, isExpandedMode } =\n useBlocksEditorContext('BlocksContent');\n const blocksRef = React.useRef<HTMLDivElement>(null);\n const { formatMessage } = useIntl();\n const [dragDirection, setDragDirection] = React.useState<DragDirection | null>(null);\n const { modalElement, handleConversionResult } = useConversionModal();\n\n // Create renderLeaf function based on the modifiers store\n const renderLeaf = React.useCallback(\n (props: RenderLeafProps) => baseRenderLeaf(props, modifiers),\n [modifiers]\n );\n\n const handleMoveBlocks = (editor: Editor, event: React.KeyboardEvent<HTMLElement>) => {\n if (!editor.selection) return;\n\n const start = Range.start(editor.selection);\n const currentIndex = [start.path[0]];\n let newIndexPosition = 0;\n\n if (event.key === 'ArrowUp') {\n newIndexPosition = currentIndex[0] > 0 ? currentIndex[0] - 1 : currentIndex[0];\n } else {\n newIndexPosition =\n currentIndex[0] < editor.children.length - 1 ? currentIndex[0] + 1 : currentIndex[0];\n }\n\n const newIndex = [newIndexPosition];\n\n if (newIndexPosition !== currentIndex[0]) {\n Transforms.moveNodes(editor, {\n at: currentIndex,\n to: newIndex,\n });\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('components.Blocks.dnd.reorder'),\n defaultMessage: '{item}, moved. New position in the editor: {position}.',\n },\n {\n item: `${name}.${currentIndex[0] + 1}`,\n position: `${newIndex[0] + 1} of ${editor.children.length}`,\n }\n )\n );\n\n event.preventDefault();\n }\n };\n\n // Create renderElement function base on the blocks store\n const renderElement = React.useCallback(\n (props: RenderElementProps) =>\n baseRenderElement({ props, blocks, editor, dragDirection, setDragDirection }),\n [blocks, editor, dragDirection, setDragDirection]\n );\n\n const checkSnippet = (event: React.KeyboardEvent<HTMLElement>) => {\n // Get current text block\n if (!editor.selection) {\n return;\n }\n\n const [textNode, textNodePath] = Editor.node(editor, editor.selection.anchor.path);\n\n // Narrow the type to a text node\n if (Editor.isEditor(textNode) || textNode.type !== 'text') {\n return;\n }\n\n // Don't check for snippets if we're not at the start of a block\n if (textNodePath.at(-1) !== 0) {\n return;\n }\n\n // Check if the text node starts with a known snippet\n const blockMatchingSnippet = Object.values(blocks).find((block) => {\n return block.snippets?.includes(textNode.text);\n });\n\n if (blockMatchingSnippet?.handleConvert) {\n // Prevent the space from being created and delete the snippet\n event.preventDefault();\n Transforms.delete(editor, {\n distance: textNode.text.length,\n unit: 'character',\n reverse: true,\n });\n\n // Convert the selected block\n const maybeRenderModal = blockMatchingSnippet.handleConvert(editor);\n handleConversionResult(maybeRenderModal);\n }\n };\n\n const handleEnter = (event: React.KeyboardEvent<HTMLElement>) => {\n if (!editor.selection) {\n return;\n }\n\n const selectedNode = editor.children[editor.selection.anchor.path[0]];\n const selectedBlock = Object.values(blocks).find((block) => block.matchNode(selectedNode));\n if (!selectedBlock) {\n return;\n }\n\n // Allow forced line breaks when shift is pressed\n if (event.shiftKey && selectedNode.type !== 'image') {\n Transforms.insertText(editor, '\\n');\n return;\n }\n\n // Check if there's an enter handler for the selected block\n if (selectedBlock.handleEnterKey) {\n selectedBlock.handleEnterKey(editor);\n } else {\n blocks.paragraph.handleEnterKey!(editor);\n }\n };\n\n const handleBackspaceEvent = (event: React.KeyboardEvent<HTMLElement>) => {\n if (!editor.selection) {\n return;\n }\n\n const selectedNode = editor.children[editor.selection.anchor.path[0]];\n const selectedBlock = Object.values(blocks).find((block) => block.matchNode(selectedNode));\n\n if (!selectedBlock) {\n return;\n }\n\n if (selectedBlock.handleBackspaceKey) {\n selectedBlock.handleBackspaceKey(editor, event);\n }\n };\n\n const handleTab = (event: React.KeyboardEvent<HTMLElement>) => {\n if (!editor.selection) {\n return;\n }\n\n const selectedNode = editor.children[editor.selection.anchor.path[0]];\n const selectedBlock = Object.values(blocks).find((block) => block.matchNode(selectedNode));\n if (!selectedBlock) {\n return;\n }\n\n if (selectedBlock.handleTab) {\n event.preventDefault();\n selectedBlock.handleTab(editor);\n }\n };\n\n const handleKeyboardShortcuts = (event: React.KeyboardEvent<HTMLElement>) => {\n const isCtrlOrCmd = event.metaKey || event.ctrlKey;\n\n if (isCtrlOrCmd) {\n // Check if there's a modifier to toggle\n Object.values(modifiers).forEach((value) => {\n if (value.isValidEventKey(event)) {\n value.handleToggle(editor);\n return;\n }\n });\n if (event.shiftKey && ['ArrowUp', 'ArrowDown'].includes(event.key)) {\n handleMoveBlocks(editor, event);\n }\n }\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLElement> = (event) => {\n // Find the right block-specific handlers for enter and backspace key presses\n switch (event.key) {\n case 'Enter':\n event.preventDefault();\n return handleEnter(event);\n case 'Backspace':\n return handleBackspaceEvent(event);\n case 'Tab':\n return handleTab(event);\n case 'Escape':\n return ReactEditor.blur(editor);\n }\n\n handleKeyboardShortcuts(event);\n\n // Check if a snippet was triggered\n if (event.key === ' ') {\n checkSnippet(event);\n }\n };\n\n /**\n * scrollSelectionIntoView : Slate's default method to scroll a DOM selection into the view,\n * thats shifting layout for us when there is a overflowY:scroll on the viewport.\n * We are overriding it to check if the selection is not fully within the visible area of the editor,\n * we use scrollBy one line to the bottom\n */\n const handleScrollSelectionIntoView = () => {\n if (!editor.selection) return;\n const domRange = ReactEditor.toDOMRange(editor, editor.selection);\n const domRect = domRange.getBoundingClientRect();\n const blocksInput = blocksRef.current;\n\n if (!blocksInput) {\n return;\n }\n\n const editorRect = blocksInput.getBoundingClientRect();\n\n // Check if the selection is not fully within the visible area of the editor\n if (domRect.top < editorRect.top || domRect.bottom > editorRect.bottom) {\n // Scroll by one line to the bottom\n blocksInput.scrollBy({\n top: 28, // 20px is the line-height + 8px line gap\n behavior: 'smooth',\n });\n }\n };\n\n return (\n <Box\n ref={blocksRef}\n grow={1}\n width=\"100%\"\n overflow=\"auto\"\n fontSize={2}\n background=\"neutral0\"\n color=\"neutral800\"\n lineHeight={6}\n paddingRight={4}\n paddingTop={6}\n paddingBottom={3}\n >\n <StyledEditable\n aria-labelledby={ariaLabelId}\n readOnly={disabled}\n placeholder={placeholder}\n isExpandedMode={isExpandedMode}\n renderElement={renderElement}\n renderLeaf={renderLeaf}\n onKeyDown={handleKeyDown}\n scrollSelectionIntoView={handleScrollSelectionIntoView}\n // As we have our own handler to drag and drop the elements returing true will skip slate's own event handler\n onDrop={() => {\n return true;\n }}\n onDragStart={() => {\n return true;\n }}\n />\n {modalElement}\n </Box>\n );\n};\n\nexport { BlocksContent, BlocksContentProps };\n","import * as React from 'react';\n\nimport { Box, Flex, FocusTrap, Portal, IconButton, FlexComponent } from '@strapi/design-system';\nimport { Collapse } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { css, styled } from 'styled-components';\n\nimport { getTranslation } from '../../../../../utils/translations';\n\nimport { useBlocksEditorContext } from './BlocksEditor';\n\nconst CollapseIconButton = styled(IconButton)`\n position: absolute;\n bottom: 1.2rem;\n right: 1.2rem;\n`;\n\nconst ExpandWrapper = styled<FlexComponent>(Flex)`\n // Background with 20% opacity\n background: ${({ theme }) => `${theme.colors.neutral800}1F`};\n`;\n\ninterface EditorLayoutProps {\n children: React.ReactNode;\n error?: string;\n onCollapse: () => void;\n disabled: boolean;\n ariaDescriptionId: string;\n}\n\nconst EditorLayout = ({\n children,\n error,\n disabled,\n onCollapse,\n ariaDescriptionId,\n}: EditorLayoutProps) => {\n const { formatMessage } = useIntl();\n const { isExpandedMode } = useBlocksEditorContext('editorLayout');\n\n React.useEffect(() => {\n if (isExpandedMode) {\n document.body.classList.add('lock-body-scroll');\n }\n\n return () => {\n document.body.classList.remove('lock-body-scroll');\n };\n }, [isExpandedMode]);\n\n if (isExpandedMode) {\n return (\n <Portal role=\"dialog\" aria-modal={false}>\n <FocusTrap onEscape={onCollapse}>\n <ExpandWrapper\n position=\"fixed\"\n top={0}\n left={0}\n right={0}\n bottom={0}\n zIndex={4}\n justifyContent=\"center\"\n onClick={onCollapse}\n >\n <Box<'div'>\n background=\"neutral0\"\n hasRadius\n shadow=\"popupShadow\"\n overflow=\"hidden\"\n width=\"90%\"\n height=\"90%\"\n onClick={(e) => e.stopPropagation()}\n aria-describedby={ariaDescriptionId}\n position=\"relative\"\n >\n <Flex height=\"100%\" alignItems=\"flex-start\" direction=\"column\">\n {children}\n <CollapseIconButton\n label={formatMessage({\n id: getTranslation('components.Blocks.collapse'),\n defaultMessage: 'Collapse',\n })}\n onClick={onCollapse}\n >\n <Collapse />\n </CollapseIconButton>\n </Flex>\n </Box>\n </ExpandWrapper>\n </FocusTrap>\n </Portal>\n );\n }\n\n return (\n <InputWrapper\n direction=\"column\"\n alignItems=\"flex-start\"\n height=\"512px\"\n $disabled={disabled}\n $hasError={Boolean(error)}\n style={{ overflow: 'hidden' }}\n aria-describedby={ariaDescriptionId}\n position=\"relative\"\n >\n {children}\n </InputWrapper>\n );\n};\n\nconst InputWrapper = styled<FlexComponent>(Flex)<{ $disabled?: boolean; $hasError?: boolean }>`\n border: 1px solid\n ${({ theme, $hasError }) => ($hasError ? theme.colors.danger600 : theme.colors.neutral200)};\n border-radius: ${({ theme }) => theme.borderRadius};\n background: ${({ theme }) => theme.colors.neutral0};\n\n ${({ theme, $hasError = false }) => css`\n outline: none;\n box-shadow: 0;\n transition-property: border-color, box-shadow, fill;\n transition-duration: 0.2s;\n\n &:focus-within {\n border: 1px solid ${$hasError ? theme.colors.danger600 : theme.colors.primary600};\n box-shadow: ${$hasError ? theme.colors.danger600 : theme.colors.primary600} 0px 0px 0px 2px;\n }\n `}\n\n ${({ theme, $disabled }) =>\n $disabled\n ? css`\n color: ${theme.colors.neutral600};\n background: ${theme.colors.neutral150};\n `\n : undefined}\n`;\n\nexport { EditorLayout };\n","import * as React from 'react';\n\nimport { Typography, TypographyComponent } from '@strapi/design-system';\nimport { Bold, Italic, Underline, StrikeThrough, Code } from '@strapi/icons';\nimport { type MessageDescriptor } from 'react-intl';\nimport { Editor, Text, Transforms } from 'slate';\nimport { styled, css } from 'styled-components';\n\nconst stylesToInherit = css`\n font-size: inherit;\n color: inherit;\n line-height: inherit;\n`;\n\nconst BoldText = styled<TypographyComponent>(Typography).attrs({ fontWeight: 'bold' })`\n ${stylesToInherit}\n`;\n\nconst ItalicText = styled<TypographyComponent>(Typography)`\n font-style: italic;\n ${stylesToInherit}\n`;\n\nconst UnderlineText = styled<TypographyComponent>(Typography).attrs({\n textDecoration: 'underline',\n})`\n ${stylesToInherit}\n`;\n\nconst StrikeThroughText = styled<TypographyComponent>(Typography).attrs({\n textDecoration: 'line-through',\n})`\n ${stylesToInherit}\n`;\n\nconst InlineCode = styled.code`\n background-color: ${({ theme }) => theme.colors.neutral150};\n border-radius: ${({ theme }) => theme.borderRadius};\n padding: ${({ theme }) => `0 ${theme.spaces[2]}`};\n font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,\n monospace;\n color: inherit;\n`;\n\ntype ModifierKey = Exclude<keyof Text, 'type' | 'text'>;\n\ntype ModifiersStore = {\n [K in ModifierKey]: {\n icon: React.ComponentType;\n isValidEventKey: (event: React.KeyboardEvent<HTMLElement>) => boolean;\n label: MessageDescriptor;\n checkIsActive: (editor: Editor) => boolean;\n handleToggle: (editor: Editor) => void;\n renderLeaf: (children: React.JSX.Element | string) => React.JSX.Element;\n };\n};\n\n/**\n * The default handler for checking if a modifier is active\n */\nconst baseCheckIsActive = (editor: Editor, name: ModifierKey) => {\n const marks = Editor.marks(editor);\n if (!marks) return false;\n\n return Boolean(marks[name]);\n};\n\n/**\n * The default handler for toggling a modifier\n */\nconst baseHandleToggle = (editor: Editor, name: ModifierKey) => {\n const marks = Editor.marks(editor);\n\n // If there is no selection, set selection to the end of line\n if (!editor.selection) {\n const endOfEditor = Editor.end(editor, []);\n Transforms.select(editor, endOfEditor);\n }\n\n // Toggle the modifier\n if (marks?.[name]) {\n Editor.removeMark(editor, name);\n } else {\n Editor.addMark(editor, name, true);\n }\n};\n\nconst modifiers: ModifiersStore = {\n bold: {\n icon: Bold,\n isValidEventKey: (event) => event.key === 'b',\n label: { id: 'components.Blocks.modifiers.bold', defaultMessage: 'Bold' },\n checkIsActive: (editor) => baseCheckIsActive(editor, 'bold'),\n handleToggle: (editor) => baseHandleToggle(editor, 'bold'),\n renderLeaf: (children) => <BoldText>{children}</BoldText>,\n },\n italic: {\n icon: Italic,\n isValidEventKey: (event) => event.key === 'i',\n label: { id: 'components.Blocks.modifiers.italic', defaultMessage: 'Italic' },\n checkIsActive: (editor) => baseCheckIsActive(editor, 'italic'),\n handleToggle: (editor) => baseHandleToggle(editor, 'italic'),\n renderLeaf: (children) => <ItalicText>{children}</ItalicText>,\n },\n underline: {\n icon: Underline,\n isValidEventKey: (event) => event.key === 'u',\n label: { id: 'components.Blocks.modifiers.underline', defaultMessage: 'Underline' },\n checkIsActive: (editor) => baseCheckIsActive(editor, 'underline'),\n handleToggle: (editor) => baseHandleToggle(editor, 'underline'),\n renderLeaf: (children) => <UnderlineText>{children}</UnderlineText>,\n },\n strikethrough: {\n icon: StrikeThrough,\n isValidEventKey: (event) => event.key === 'S' && event.shiftKey,\n label: { id: 'components.Blocks.modifiers.strikethrough', defaultMessage: 'Strikethrough' },\n checkIsActive: (editor) => baseCheckIsActive(editor, 'strikethrough'),\n handleToggle: (editor) => baseHandleToggle(editor, 'strikethrough'),\n renderLeaf: (children) => <StrikeThroughText>{children}</StrikeThroughText>,\n },\n code: {\n icon: Code,\n isValidEventKey: (event) => event.key === 'e',\n label: { id: 'components.Blocks.modifiers.code', defaultMessage: 'Inline code' },\n checkIsActive: (editor) => baseCheckIsActive(editor, 'code'),\n handleToggle: (editor) => baseHandleToggle(editor, 'code'),\n renderLeaf: (children) => <InlineCode>{children}</InlineCode>,\n },\n};\n\nexport { type ModifiersStore, modifiers };\n","import { type Editor } from 'slate';\n\n/**\n * Images are void elements. They handle the rendering of their children instead of Slate.\n * See the Slate documentation for more information:\n * - https://docs.slatejs.org/api/nodes/element#void-vs-not-void\n * - https://docs.slatejs.org/api/nodes/element#rendering-void-elements\n */\nconst withImages = (editor: Editor) => {\n const { isVoid } = editor;\n\n editor.isVoid = (element) => {\n return element.type === 'image' ? true : isVoid(element);\n };\n\n return editor;\n};\n\nexport { withImages };\n","import { type BaseEditor, Path, Transforms, Range, Point, Editor } from 'slate';\n\nimport { insertLink } from '../utils/links';\n\ninterface LinkEditor extends BaseEditor {\n lastInsertedLinkPath: Path | null;\n shouldSaveLinkPath: boolean;\n}\n\nconst withLinks = (editor: Editor) => {\n const { isInline, apply, insertText, insertData } = editor;\n\n // Links are inline elements, so we need to override the isInline method for slate\n editor.isInline = (element) => {\n return element.type === 'link' ? true : isInline(element);\n };\n\n // We keep a track of the last inserted link path\n // So we can show the popover on the link component if that link is the last one inserted\n editor.lastInsertedLinkPath = null;\n\n // We intercept the apply method, so everytime we insert a new link, we save its path\n editor.apply = (operation) => {\n if (operation.type === 'insert_node') {\n if (\n !Editor.isEditor(operation.node) &&\n operation.node.type === 'link' &&\n editor.shouldSaveLinkPath\n ) {\n editor.lastInsertedLinkPath = operation.path;\n }\n } else if (operation.type === 'move_node') {\n // We need to update the last inserted link path when link is moved\n // If link is the first word in the paragraph we dont need to update the path\n if (\n Path.hasPrevious(operation.path) &&\n editor.lastInsertedLinkPath &&\n editor.shouldSaveLinkPath\n ) {\n editor.lastInsertedLinkPath = Path.transform(editor.lastInsertedLinkPath, operation);\n }\n }\n\n apply(operation);\n };\n\n editor.insertText = (text) => {\n // When selection is at the end of a link and user types a space, we want to break the link\n if (editor.selection && Range.isCollapsed(editor.selection) && text === ' ') {\n const linksInSelection = Array.from(\n Editor.nodes(editor, {\n at: editor.selection,\n match: (node) => !Editor.isEditor(node) && node.type === 'link',\n })\n );\n\n const selectionIsInLink = editor.selection && linksInSelection.length > 0;\n const selectionIsAtEndOfLink =\n selectionIsInLink &&\n Point.equals(editor.selection.anchor, Editor.end(editor, linksInSelection[0][1]));\n\n if (selectionIsAtEndOfLink) {\n Transforms.insertNodes(\n editor,\n { text: ' ', type: 'text' },\n { at: Path.next(linksInSelection[0][1]), select: true }\n );\n\n return;\n }\n }\n\n insertText(text);\n };\n\n // Add data as a clickable link if its a valid URL\n editor.insertData = (data) => {\n const pastedText = data.getData('text/plain');\n\n if (pastedText) {\n try {\n // eslint-disable-next-line no-new\n new URL(pastedText);\n // Do not show link popup on copy-paste a link, so do not save its path\n editor.shouldSaveLinkPath = false;\n insertLink(editor, { url: pastedText });\n return;\n } catch (error) {\n // continue normal data insertion\n }\n }\n\n insertData(data);\n };\n\n return editor;\n};\n\nexport { withLinks, type LinkEditor };\n","import { type Text, Node, Editor, Element, Transforms } from 'slate';\n\nconst isText = (node: unknown): node is Text => {\n return Node.isNode(node) && !Editor.isEditor(node) && node.type === 'text';\n};\n\n/**\n * This plugin is used to normalize the Slate document to match the Strapi schema.\n */\nconst withStrapiSchema = (editor: Editor) => {\n const { normalizeNode } = editor;\n\n /**\n * On the strapi schema, we want text nodes to have type: text\n * By default, Slate add text nodes without type: text\n * So we add this normalization for the cases when Slate add text nodes automatically\n */\n editor.normalizeNode = (entry) => {\n const [node, path] = entry;\n\n if (!Element.isElement(node) && !isText(node)) {\n Transforms.setNodes(editor, { type: 'text' }, { at: path });\n\n return;\n }\n\n normalizeNode(entry);\n };\n\n return editor;\n};\n\nexport { withStrapiSchema };\n","import * as React from 'react';\n\nimport { createContext, type FieldValue } from '@strapi/admin/strapi-admin';\nimport { IconButton, Divider, VisuallyHidden } from '@strapi/design-system';\nimport { Expand } from '@strapi/icons';\nimport { MessageDescriptor, useIntl } from 'react-intl';\nimport { Editor, type Descendant, createEditor } from 'slate';\nimport { withHistory } from 'slate-history';\nimport { type RenderElementProps, Slate, withReact, ReactEditor, useSlate } from 'slate-react';\nimport { styled, type CSSProperties } from 'styled-components';\n\nimport { getTranslation } from '../../../../../utils/translations';\n\nimport { codeBlocks } from './Blocks/Code';\nimport { headingBlocks } from './Blocks/Heading';\nimport { imageBlocks } from './Blocks/Image';\nimport { linkBlocks } from './Blocks/Link';\nimport { listBlocks } from './Blocks/List';\nimport { paragraphBlocks } from './Blocks/Paragraph';\nimport { quoteBlocks } from './Blocks/Quote';\nimport { BlocksContent, type BlocksContentProps } from './BlocksContent';\nimport { BlocksToolbar } from './BlocksToolbar';\nimport { EditorLayout } from './EditorLayout';\nimport { type ModifiersStore, modifiers } from './Modifiers';\nimport { withImages } from './plugins/withImages';\nimport { withLinks } from './plugins/withLinks';\nimport { withStrapiSchema } from './plugins/withStrapiSchema';\n\nimport type { Schema } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * BlocksEditorProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface BaseBlock {\n renderElement: (props: RenderElementProps) => React.JSX.Element;\n matchNode: (node: Schema.Attribute.BlocksNode) => boolean;\n handleConvert?: (editor: Editor) => void | (() => React.JSX.Element);\n handleEnterKey?: (editor: Editor) => void;\n handleBackspaceKey?: (editor: Editor, event: React.KeyboardEvent<HTMLElement>) => void;\n handleTab?: (editor: Editor) => void;\n snippets?: string[];\n dragHandleTopMargin?: CSSProperties['marginTop'];\n}\n\ninterface NonSelectorBlock extends BaseBlock {\n isInBlocksSelector: false;\n}\n\ninterface SelectorBlock extends BaseBlock {\n isInBlocksSelector: true;\n icon: React.ComponentType;\n label: MessageDescriptor;\n}\n\ntype NonSelectorBlockKey = 'list-item' | 'link';\n\nconst selectorBlockKeys = [\n 'paragraph',\n 'heading-one',\n 'heading-two',\n 'heading-three',\n 'heading-four',\n 'heading-five',\n 'heading-six',\n 'list-ordered',\n 'list-unordered',\n 'image',\n 'quote',\n 'code',\n] as const;\n\ntype SelectorBlockKey = (typeof selectorBlockKeys)[number];\n\nconst isSelectorBlockKey = (key: unknown): key is SelectorBlockKey => {\n return typeof key === 'string' && selectorBlockKeys.includes(key as SelectorBlockKey);\n};\n\ntype BlocksStore = {\n [K in SelectorBlockKey]: SelectorBlock;\n} & {\n [K in NonSelectorBlockKey]: NonSelectorBlock;\n};\n\ninterface BlocksEditorContextValue {\n blocks: BlocksStore;\n modifiers: ModifiersStore;\n disabled: boolean;\n name: string;\n setLiveText: (text: string) => void;\n isExpandedMode: boolean;\n}\n\nconst [BlocksEditorProvider, usePartialBlocksEditorContext] =\n createContext<BlocksEditorContextValue>('BlocksEditor');\n\nfunction useBlocksEditorContext(\n consumerName: string\n): BlocksEditorContextValue & { editor: Editor } {\n const context = usePartialBlocksEditorContext(consumerName, (state) => state);\n const editor = useSlate();\n\n return {\n ...context,\n editor,\n };\n}\n\n/* -------------------------------------------------------------------------------------------------\n * BlocksEditor\n * -----------------------------------------------------------------------------------------------*/\n\nconst EditorDivider = styled(Divider)`\n background: ${({ theme }) => theme.colors.neutral200};\n`;\n\nconst ExpandIconButton = styled(IconButton)`\n position: absolute;\n bottom: 1.2rem;\n right: 1.2rem;\n`;\n\n/**\n * Forces an update of the Slate editor when the value prop changes from outside of Slate.\n * The root cause is that Slate is not a controlled component: https://github.com/ianstormtaylor/slate/issues/4612\n * Why not use JSON.stringify(value) as the key?\n * Because it would force a rerender of the entire editor every time the user types a character.\n * Why not use the entity id as the key, since it's unique for each locale?\n * Because it would not solve the problem when using the \"fill in from other locale\" feature\n */\nfunction useResetKey(value?: Schema.Attribute.BlocksValue): {\n key: number;\n incrementSlateUpdatesCount: () => void;\n} {\n // Keep track how many times Slate detected a change from a user interaction in the editor\n const slateUpdatesCount = React.useRef(0);\n // Keep track of how many times the value prop was updated, whether from within editor or from outside\n const valueUpdatesCount = React.useRef(0);\n // Use a key to force a rerender of the Slate editor when needed\n const [key, setKey] = React.useState(0);\n\n React.useEffect(() => {\n valueUpdatesCount.current += 1;\n\n // If the 2 refs are not equal, it means the value was updated from outside\n if (valueUpdatesCount.current !== slateUpdatesCount.current) {\n // So we change the key to force a rerender of the Slate editor,\n // which will pick up the new value through its initialValue prop\n setKey((previousKey) => previousKey + 1);\n\n // Then bring the 2 refs back in sync\n slateUpdatesCount.current = valueUpdatesCount.current;\n }\n }, [value]);\n\n return { key, incrementSlateUpdatesCount: () => (slateUpdatesCount.current += 1) };\n}\n\nconst pipe =\n (...fns: ((baseEditor: Editor) => Editor)[]) =>\n (value: Editor) =>\n fns.reduce<Editor>((prev, fn) => fn(prev), value);\n\ninterface BlocksEditorProps\n extends Pick<FieldValue<Schema.Attribute.BlocksValue>, 'onChange' | 'value' | 'error'>,\n BlocksContentProps {\n disabled?: boolean;\n name: string;\n}\n\nconst BlocksEditor = React.forwardRef<{ focus: () => void }, BlocksEditorProps>(\n ({ disabled = false, name, onChange, value, error, ...contentProps }, forwardedRef) => {\n const { formatMessage } = useIntl();\n const [editor] = React.useState(() =>\n pipe(withHistory, withImages, withStrapiSchema, withReact, withLinks)(createEditor())\n );\n const [liveText, setLiveText] = React.useState('');\n const ariaDescriptionId = React.useId();\n const [isExpandedMode, setIsExpandedMode] = React.useState(false);\n\n const handleToggleExpand = () => {\n setIsExpandedMode((prev) => !prev);\n };\n\n /**\n * Editable is not able to hold the ref, https://github.com/ianstormtaylor/slate/issues/4082\n * so with \"useImperativeHandle\" we can use ReactEditor methods to expose to the parent above\n * also not passing forwarded ref here, gives console warning.\n */\n React.useImperativeHandle(\n forwardedRef,\n () => ({\n focus() {\n ReactEditor.focus(editor);\n },\n }),\n [editor]\n );\n\n const { key, incrementSlateUpdatesCount } = useResetKey(value);\n\n const handleSlateChange = (state: Descendant[]) => {\n const isAstChange = editor.operations.some((op) => op.type !== 'set_selection');\n\n if (isAstChange) {\n incrementSlateUpdatesCount();\n\n onChange(name, state as Schema.Attribute.BlocksValue);\n }\n };\n\n const blocks: BlocksStore = {\n ...paragraphBlocks,\n ...headingBlocks,\n ...listBlocks,\n ...linkBlocks,\n ...imageBlocks,\n ...quoteBlocks,\n ...codeBlocks,\n };\n\n return (\n <>\n <VisuallyHidden id={ariaDescriptionId}>\n {formatMessage({\n id: getTranslation('components.Blocks.dnd.instruction'),\n defaultMessage: `To reorder blocks, press Command or Control along with Shift and the Up or Down arrow keys`,\n })}\n </VisuallyHidden>\n <VisuallyHidden aria-live=\"assertive\">{liveText}</VisuallyHidden>\n <Slate\n editor={editor}\n initialValue={value || [{ type: 'paragraph', children: [{ type: 'text', text: '' }] }]}\n onChange={handleSlateChange}\n key={key}\n >\n <BlocksEditorProvider\n blocks={blocks}\n modifiers={modifiers}\n disabled={disabled}\n name={name}\n setLiveText={setLiveText}\n isExpandedMode={isExpandedMode}\n >\n <EditorLayout\n error={error}\n disabled={disabled}\n onCollapse={handleToggleExpand}\n ariaDescriptionId={ariaDescriptionId}\n >\n <BlocksToolbar />\n <EditorDivider width=\"100%\" />\n <BlocksContent {...contentProps} />\n {!isExpandedMode && (\n <ExpandIconButton\n label={formatMessage({\n id: getTranslation('components.Blocks.expand'),\n defaultMessage: 'Expand',\n })}\n onClick={handleToggleExpand}\n >\n <Expand />\n </ExpandIconButton>\n )}\n </EditorLayout>\n </BlocksEditorProvider>\n </Slate>\n </>\n );\n }\n);\n\nexport {\n type BlocksStore,\n type SelectorBlockKey,\n BlocksEditor,\n BlocksEditorProvider,\n useBlocksEditorContext,\n isSelectorBlockKey,\n};\n","import * as React from 'react';\n\nimport { useField, type InputProps } from '@strapi/admin/strapi-admin';\nimport { Field, Flex } from '@strapi/design-system';\n\nimport { BlocksEditor } from './BlocksEditor';\n\nimport type { Schema } from '@strapi/types';\n\ninterface BlocksInputProps extends Omit<InputProps, 'type'> {\n labelAction?: React.ReactNode;\n type: Schema.Attribute.Blocks['type'];\n}\n\nconst BlocksInput = React.forwardRef<{ focus: () => void }, BlocksInputProps>(\n ({ label, name, required = false, hint, labelAction, ...editorProps }, forwardedRef) => {\n const id = React.useId();\n const field = useField(name);\n\n return (\n <Field.Root id={id} name={name} hint={hint} error={field.error} required={required}>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1}>\n <Field.Label action={labelAction}>{label}</Field.Label>\n <BlocksEditor\n name={name}\n error={field.error}\n ref={forwardedRef}\n value={field.value}\n onChange={field.onChange}\n ariaLabelId={id}\n {...editorProps}\n />\n <Field.Hint />\n <Field.Error />\n </Flex>\n </Field.Root>\n );\n }\n);\n\nconst MemoizedBlocksInput = React.memo(BlocksInput);\n\nexport { MemoizedBlocksInput as BlocksInput };\n","import type { ComponentsDictionary, Document } from '../../../hooks/useDocument';\nimport type { Schema } from '@strapi/types';\n\ntype AnyData = Omit<Document, 'id'>;\n\n/* -------------------------------------------------------------------------------------------------\n * createDefaultForm\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * @internal Using the content-type schema & the components dictionary of the content-type,\n * creates a form with pre-filled default values. This is used when creating a new entry.\n */\nconst createDefaultForm = (\n contentType: Schema.Schema,\n components: ComponentsDictionary = {}\n): AnyData => {\n const traverseSchema = (attributes: Schema.Schema['attributes']): AnyData => {\n return Object.entries(attributes).reduce<AnyData>((acc, [key, attribute]) => {\n if ('default' in attribute) {\n acc[key] = attribute.default;\n } else if (attribute.type === 'component' && attribute.required) {\n const defaultComponentForm = traverseSchema(components[attribute.component].attributes);\n\n if (attribute.repeatable) {\n acc[key] = attribute.min ? [...Array(attribute.min).fill(defaultComponentForm)] : [];\n } else {\n acc[key] = defaultComponentForm;\n }\n } else if (attribute.type === 'dynamiczone' && attribute.required) {\n acc[key] = [];\n }\n\n return acc;\n }, {});\n };\n\n return traverseSchema(contentType.attributes);\n};\n\nexport { createDefaultForm };\n","import * as React from 'react';\n\nimport { useField } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, Typography } from '@strapi/design-system';\nimport { PlusCircle } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { getTranslation } from '../../../../../utils/translations';\n\ninterface InitializerProps {\n disabled?: boolean;\n name: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement> & React.MouseEventHandler<HTMLDivElement>;\n}\n\nconst Initializer = ({ disabled, name, onClick }: InitializerProps) => {\n const { formatMessage } = useIntl();\n\n const field = useField(name);\n\n return (\n <>\n <Box\n tag=\"button\"\n background={disabled ? 'neutral150' : 'neutral100'}\n borderColor={field.error ? 'danger600' : 'neutral200'}\n hasRadius\n disabled={disabled}\n onClick={onClick}\n paddingTop={9}\n paddingBottom={9}\n type=\"button\"\n style={{ cursor: disabled ? 'not-allowed' : 'pointer' }}\n >\n <Flex direction=\"column\" gap={2}>\n <Flex justifyContent=\"center\" color={disabled ? 'neutral500' : 'primary600'}>\n <PlusCircle width=\"3.2rem\" height=\"3.2rem\" />\n </Flex>\n <Flex justifyContent=\"center\">\n <Typography\n textColor={disabled ? 'neutral600' : 'primary600'}\n variant=\"pi\"\n fontWeight=\"bold\"\n >\n {formatMessage({\n id: getTranslation('components.empty-repeatable'),\n defaultMessage: 'No entry yet. Click to add one.',\n })}\n </Typography>\n </Flex>\n </Flex>\n </Box>\n </>\n );\n};\n\nexport { Initializer };\nexport type { InitializerProps };\n","import { useField } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, Grid } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { ComponentProvider, useComponent } from '../ComponentContext';\n\nimport type { ComponentInputProps } from './Input';\n\ntype NonRepeatableComponentProps = Omit<ComponentInputProps, 'required' | 'label'>;\n\nconst NonRepeatableComponent = ({\n attribute,\n name,\n children,\n layout,\n}: NonRepeatableComponentProps) => {\n const { formatMessage } = useIntl();\n const { value } = useField(name);\n const level = useComponent('NonRepeatableComponent', (state) => state.level);\n const isNested = level > 0;\n\n return (\n <ComponentProvider id={value?.id} uid={attribute.component} level={level + 1} type=\"component\">\n <Box\n background={'neutral100'}\n paddingLeft={6}\n paddingRight={6}\n paddingTop={6}\n paddingBottom={6}\n hasRadius={isNested}\n borderColor={isNested ? 'neutral200' : undefined}\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {layout.map((row, index) => {\n return (\n <Grid.Root gap={4} key={index}>\n {row.map(({ size, ...field }) => {\n /**\n * Layouts are built from schemas so they don't understand the complete\n * schema tree, for components we append the parent name to the field name\n * because this is the structure for the data & permissions also understand\n * the nesting involved.\n */\n const completeFieldName = `${name}.${field.name}`;\n\n const translatedLabel = formatMessage({\n id: `content-manager.components.${attribute.component}.${field.name}`,\n defaultMessage: field.label,\n });\n\n return (\n <Grid.Item\n col={size}\n key={completeFieldName}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children({ ...field, label: translatedLabel, name: completeFieldName })}\n </Grid.Item>\n );\n })}\n </Grid.Root>\n );\n })}\n </Flex>\n </Box>\n </ComponentProvider>\n );\n};\n\nexport { NonRepeatableComponent };\nexport type { NonRepeatableComponentProps };\n","import * as React from 'react';\n\nimport { useField, useNotification, useForm } from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Flex,\n TextButton,\n VisuallyHidden,\n Accordion,\n IconButton,\n useComposedRefs,\n Grid,\n BoxComponent,\n} from '@strapi/design-system';\nimport { Plus, Drag, Trash } from '@strapi/icons';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { useLocation } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { ItemTypes } from '../../../../../constants/dragAndDrop';\nimport { useDoc } from '../../../../../hooks/useDocument';\nimport { useDragAndDrop, type UseDragAndDropOptions } from '../../../../../hooks/useDragAndDrop';\nimport { usePrev } from '../../../../../hooks/usePrev';\nimport { getIn } from '../../../../../utils/objects';\nimport { getTranslation } from '../../../../../utils/translations';\nimport { transformDocument } from '../../../utils/data';\nimport { createDefaultForm } from '../../../utils/forms';\nimport { ComponentProvider, useComponent } from '../ComponentContext';\n\nimport { Initializer } from './Initializer';\n\nimport type { ComponentInputProps } from './Input';\nimport type { Schema } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * RepeatableComponent\n * -----------------------------------------------------------------------------------------------*/\n\ntype RepeatableComponentProps = Omit<ComponentInputProps, 'required' | 'label'>;\n\nconst RepeatableComponent = ({\n attribute,\n disabled,\n name,\n mainField,\n children,\n layout,\n}: RepeatableComponentProps) => {\n const { toggleNotification } = useNotification();\n const { formatMessage } = useIntl();\n const { search: searchString } = useLocation();\n const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);\n const { components } = useDoc();\n\n const {\n value = [],\n error,\n rawError,\n } = useField<Schema.Attribute.ComponentValue<`${string}.${string}`, true>>(name);\n const addFieldRow = useForm('RepeatableComponent', (state) => state.addFieldRow);\n const moveFieldRow = useForm('RepeatableComponent', (state) => state.moveFieldRow);\n const removeFieldRow = useForm('RepeatableComponent', (state) => state.removeFieldRow);\n const { max = Infinity } = attribute;\n\n const [collapseToOpen, setCollapseToOpen] = React.useState<string>('');\n const [liveText, setLiveText] = React.useState('');\n\n React.useEffect(() => {\n const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;\n const hasNestedValue = value && Array.isArray(value) && value.length > 0;\n\n if (hasNestedErrors && hasNestedValue) {\n const errorOpenItems = rawError\n .map((_: unknown, idx: number) => {\n return value[idx] ? value[idx].__temp_key__ : null;\n })\n .filter((value) => !!value);\n\n if (errorOpenItems && errorOpenItems.length > 0) {\n setCollapseToOpen((collapseToOpen) => {\n if (!errorOpenItems.includes(collapseToOpen)) {\n return errorOpenItems[0];\n }\n\n return collapseToOpen;\n });\n }\n }\n }, [rawError, value]);\n\n /**\n * Get the temp key of the component that has the field that is currently focussed\n * as defined by the `field` query param. We can then force this specific component\n * to be in its \"open\" state.\n */\n const componentTmpKeyWithFocussedField = React.useMemo(() => {\n if (search.has('field')) {\n const fieldParam = search.get('field');\n\n if (!fieldParam) {\n return undefined;\n }\n\n const [, path] = fieldParam.split(`${name}.`);\n\n if (getIn(value, path, undefined) !== undefined) {\n const [subpath] = path.split('.');\n\n return getIn(value, subpath, undefined)?.__temp_key__;\n }\n }\n\n return undefined;\n }, [search, name, value]);\n\n const prevValue = usePrev(value);\n\n React.useEffect(() => {\n /**\n * When we add a new item to the array, we want to open the collapse.\n */\n if (prevValue && prevValue.length < value.length) {\n setCollapseToOpen(value[value.length - 1].__temp_key__);\n }\n }, [value, prevValue]);\n\n React.useEffect(() => {\n if (typeof componentTmpKeyWithFocussedField === 'string') {\n setCollapseToOpen(componentTmpKeyWithFocussedField);\n }\n }, [componentTmpKeyWithFocussedField]);\n\n const toggleCollapses = () => {\n setCollapseToOpen('');\n };\n\n const handleClick = () => {\n if (value.length < max) {\n const schema = components[attribute.component];\n const form = createDefaultForm(schema, components);\n const data = transformDocument(schema, components)(form);\n\n addFieldRow(name, data);\n // setCollapseToOpen(nextTempKey);\n } else if (value.length >= max) {\n toggleNotification({\n type: 'info',\n message: formatMessage({\n id: getTranslation('components.notification.info.maximum-requirement'),\n }),\n });\n }\n };\n\n const handleMoveComponentField: ComponentProps['onMoveItem'] = (newIndex, currentIndex) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.reorder'),\n defaultMessage: '{item}, moved. New position in list: {position}.',\n },\n {\n item: `${name}.${currentIndex}`,\n position: getItemPos(newIndex),\n }\n )\n );\n\n moveFieldRow(name, currentIndex, newIndex);\n };\n\n const handleValueChange = (key: string) => {\n setCollapseToOpen(key);\n };\n\n const getItemPos = (index: number) => `${index + 1} of ${value.length}`;\n\n const handleCancel = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.cancel-item'),\n defaultMessage: '{item}, dropped. Re-order cancelled.',\n },\n {\n item: `${name}.${index}`,\n }\n )\n );\n };\n\n const handleGrabItem = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.grab-item'),\n defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`,\n },\n {\n item: `${name}.${index}`,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleDropItem = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.drop-item'),\n defaultMessage: `{item}, dropped. Final position in list: {position}.`,\n },\n {\n item: `${name}.${index}`,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const ariaDescriptionId = React.useId();\n\n const level = useComponent('RepeatableComponent', (state) => state.level);\n\n if (value.length === 0) {\n return <Initializer disabled={disabled} name={name} onClick={handleClick} />;\n }\n\n return (\n <Box hasRadius>\n <VisuallyHidden id={ariaDescriptionId}>\n {formatMessage({\n id: getTranslation('dnd.instructions'),\n defaultMessage: `Press spacebar to grab and re-order`,\n })}\n </VisuallyHidden>\n <VisuallyHidden aria-live=\"assertive\">{liveText}</VisuallyHidden>\n <AccordionRoot\n $error={error}\n value={collapseToOpen}\n onValueChange={handleValueChange}\n aria-describedby={ariaDescriptionId}\n >\n {value.map(({ __temp_key__: key, id }, index) => {\n const nameWithIndex = `${name}.${index}`;\n return (\n <ComponentProvider\n key={key}\n // id is always a number in a component\n id={id as number}\n uid={attribute.component}\n level={level + 1}\n type=\"repeatable\"\n >\n <Component\n disabled={disabled}\n name={nameWithIndex}\n attribute={attribute}\n index={index}\n mainField={mainField}\n onMoveItem={handleMoveComponentField}\n onDeleteComponent={() => {\n removeFieldRow(name, index);\n toggleCollapses();\n }}\n toggleCollapses={toggleCollapses}\n onCancel={handleCancel}\n onDropItem={handleDropItem}\n onGrabItem={handleGrabItem}\n __temp_key__={key}\n >\n {layout.map((row, index) => {\n return (\n <Grid.Root gap={4} key={index}>\n {row.map(({ size, ...field }) => {\n /**\n * Layouts are built from schemas so they don't understand the complete\n * schema tree, for components we append the parent name to the field name\n * because this is the structure for the data & permissions also understand\n * the nesting involved.\n */\n const completeFieldName = `${nameWithIndex}.${field.name}`;\n\n const translatedLabel = formatMessage({\n id: `content-manager.components.${attribute.component}.${field.name}`,\n defaultMessage: field.label,\n });\n\n return (\n <Grid.Item\n col={size}\n key={completeFieldName}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children({\n ...field,\n label: translatedLabel,\n name: completeFieldName,\n })}\n </Grid.Item>\n );\n })}\n </Grid.Root>\n );\n })}\n </Component>\n </ComponentProvider>\n );\n })}\n <TextButtonCustom disabled={disabled} onClick={handleClick} startIcon={<Plus />}>\n {formatMessage({\n id: getTranslation('containers.EditView.add.new-entry'),\n defaultMessage: 'Add an entry',\n })}\n </TextButtonCustom>\n </AccordionRoot>\n </Box>\n );\n};\n\nconst AccordionRoot = styled(Accordion.Root)<{ $error?: string }>`\n border: 1px solid\n ${({ theme, $error }) => ($error ? theme.colors.danger600 : theme.colors.neutral200)};\n`;\n\nconst TextButtonCustom = styled(TextButton)`\n width: 100%;\n display: flex;\n justify-content: center;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral200};\n padding-inline: ${(props) => props.theme.spaces[6]};\n padding-block: ${(props) => props.theme.spaces[3]};\n\n &:not([disabled]) {\n cursor: pointer;\n\n &:hover {\n background-color: ${(props) => props.theme.colors.primary100};\n }\n }\n\n span {\n font-weight: 600;\n font-size: 1.4rem;\n line-height: 2.4rem;\n }\n\n @media (prefers-reduced-motion: no-preference) {\n transition: background-color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * Field\n * -----------------------------------------------------------------------------------------------*/\n\ninterface ComponentProps\n extends Pick<UseDragAndDropOptions, 'onGrabItem' | 'onDropItem' | 'onCancel' | 'onMoveItem'>,\n Pick<RepeatableComponentProps, 'mainField'> {\n attribute: Schema.Attribute.Component<`${string}.${string}`, boolean>;\n disabled?: boolean;\n index: number;\n name: string;\n onDeleteComponent?: React.MouseEventHandler<HTMLButtonElement>;\n toggleCollapses: () => void;\n children: React.ReactNode;\n __temp_key__: string;\n}\n\nconst Component = ({\n disabled,\n index,\n name,\n mainField = {\n name: 'id',\n type: 'integer',\n },\n children,\n onDeleteComponent,\n toggleCollapses,\n __temp_key__,\n ...dragProps\n}: ComponentProps) => {\n const { formatMessage } = useIntl();\n\n const displayValue = useForm('RepeatableComponent', (state) => {\n return getIn(state.values, [...name.split('.'), mainField.name]);\n });\n\n const accordionRef = React.useRef<HTMLButtonElement>(null!);\n\n /**\n * The last item in the fieldName array will be the index of this component.\n * Drag and drop should be isolated to the parent component so nested repeatable\n * components are not affected by the drag and drop of the parent component in\n * their own re-ordering context.\n */\n const componentKey = name.split('.').slice(0, -1).join('.');\n\n const [{ handlerId, isDragging, handleKeyDown }, boxRef, dropRef, dragRef, dragPreviewRef] =\n useDragAndDrop(!disabled, {\n type: `${ItemTypes.COMPONENT}_${componentKey}`,\n index,\n item: {\n index,\n displayedValue: displayValue,\n },\n onStart() {\n // Close all collapses\n toggleCollapses();\n },\n ...dragProps,\n });\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage(), { captureDraggingState: false });\n }, [dragPreviewRef, index]);\n\n const composedAccordionRefs = useComposedRefs<HTMLButtonElement>(accordionRef, dragRef);\n const composedBoxRefs = useComposedRefs<HTMLDivElement>(\n boxRef as React.RefObject<HTMLDivElement>,\n dropRef\n );\n\n return (\n <>\n {isDragging ? (\n <Preview />\n ) : (\n <Accordion.Item ref={composedBoxRefs} value={__temp_key__}>\n <Accordion.Header>\n <Accordion.Trigger>{displayValue}</Accordion.Trigger>\n <Accordion.Actions>\n <IconButton\n variant=\"ghost\"\n onClick={onDeleteComponent}\n label={formatMessage({\n id: getTranslation('containers.Edit.delete'),\n defaultMessage: 'Delete',\n })}\n >\n <Trash />\n </IconButton>\n <IconButton\n ref={composedAccordionRefs}\n variant=\"ghost\"\n onClick={(e) => e.stopPropagation()}\n data-handler-id={handlerId}\n label={formatMessage({\n id: getTranslation('components.DragHandle-label'),\n defaultMessage: 'Drag',\n })}\n onKeyDown={handleKeyDown}\n >\n <Drag />\n </IconButton>\n </Accordion.Actions>\n </Accordion.Header>\n <Accordion.Content>\n <Flex\n direction=\"column\"\n alignItems=\"stretch\"\n background=\"neutral100\"\n padding={6}\n gap={6}\n >\n {children}\n </Flex>\n </Accordion.Content>\n </Accordion.Item>\n )}\n </>\n );\n};\n\nconst Preview = () => {\n return <StyledSpan tag=\"span\" padding={6} background=\"primary100\" />;\n};\n\nconst StyledSpan = styled<BoxComponent<'span'>>(Box)`\n display: block;\n outline: 1px dashed ${({ theme }) => theme.colors.primary500};\n outline-offset: -1px;\n`;\n\nexport { RepeatableComponent };\nexport type { RepeatableComponentProps };\n","import * as React from 'react';\n\nimport { InputProps, useField } from '@strapi/admin/strapi-admin';\nimport { Field, Flex, IconButton } from '@strapi/design-system';\nimport { Trash } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport { useDoc } from '../../../../../hooks/useDocument';\nimport { EditFieldLayout } from '../../../../../hooks/useDocumentLayout';\nimport { getTranslation } from '../../../../../utils/translations';\nimport { transformDocument } from '../../../utils/data';\nimport { createDefaultForm } from '../../../utils/forms';\nimport { type InputRendererProps } from '../../InputRenderer';\n\nimport { Initializer } from './Initializer';\nimport { NonRepeatableComponent } from './NonRepeatable';\nimport { RepeatableComponent } from './Repeatable';\n\ninterface ComponentInputProps\n extends Omit<Extract<EditFieldLayout, { type: 'component' }>, 'size' | 'hint'>,\n Pick<InputProps, 'hint'> {\n labelAction?: React.ReactNode;\n children: (props: InputRendererProps) => React.ReactNode;\n /**\n * We need layout to come from the props, and not via a hook, because Content History needs\n * a way to modify the normal component layout to add hidden fields.\n */\n layout: EditFieldLayout[][];\n}\n\nconst ComponentInput = ({\n label,\n required,\n name,\n attribute,\n disabled,\n labelAction,\n ...props\n}: ComponentInputProps) => {\n const { formatMessage } = useIntl();\n const field = useField(name);\n\n const showResetComponent = !attribute.repeatable && field.value && !disabled;\n\n const { components } = useDoc();\n\n const handleInitialisationClick = () => {\n const schema = components[attribute.component];\n const form = createDefaultForm(schema, components);\n const data = transformDocument(schema, components)(form);\n\n field.onChange(name, data);\n };\n\n return (\n <Field.Root error={field.error} required={required}>\n <Flex justifyContent=\"space-between\">\n <Field.Label action={labelAction}>\n {label}\n {attribute.repeatable && (\n <> ({Array.isArray(field.value) ? field.value.length : 0})</>\n )}\n </Field.Label>\n\n {showResetComponent && (\n <IconButton\n label={formatMessage({\n id: getTranslation('components.reset-entry'),\n defaultMessage: 'Reset Entry',\n })}\n variant=\"ghost\"\n onClick={() => {\n field.onChange(name, null);\n }}\n >\n <Trash />\n </IconButton>\n )}\n </Flex>\n {/**\n * if the field isn't repeatable then we display a button to start the field\n * TODO: should this just live in the `NonRepeatableComponent`?\n */}\n {!attribute.repeatable && !field.value && (\n <Initializer disabled={disabled} name={name} onClick={handleInitialisationClick} />\n )}\n {!attribute.repeatable && field.value ? (\n <NonRepeatableComponent attribute={attribute} name={name} disabled={disabled} {...props}>\n {props.children}\n </NonRepeatableComponent>\n ) : null}\n {attribute.repeatable && (\n <RepeatableComponent attribute={attribute} name={name} disabled={disabled} {...props}>\n {props.children}\n </RepeatableComponent>\n )}\n <Field.Error />\n </Field.Root>\n );\n};\n\nconst MemoizedComponentInput = React.memo(ComponentInput);\n\nexport { MemoizedComponentInput as ComponentInput };\nexport type { ComponentInputProps };\n","import * as React from 'react';\n\nimport { Button, Flex, Typography, TypographyComponent } from '@strapi/design-system';\nimport { PlusCircle } from '@strapi/icons';\nimport { styled } from 'styled-components';\n\ninterface AddComponentButtonProps {\n children: React.ReactNode;\n hasError?: boolean;\n isDisabled?: boolean;\n isOpen?: boolean;\n onClick: React.MouseEventHandler<HTMLButtonElement> & React.MouseEventHandler<HTMLDivElement>;\n}\n\nconst AddComponentButton = ({\n hasError,\n isDisabled,\n isOpen,\n children,\n onClick,\n}: AddComponentButtonProps) => {\n return (\n <StyledButton\n type=\"button\"\n onClick={onClick}\n disabled={isDisabled}\n background=\"neutral0\"\n style={{ cursor: isDisabled ? 'not-allowed' : 'pointer' }}\n variant=\"tertiary\"\n >\n <Flex tag=\"span\" gap={2}>\n <StyledAddIcon aria-hidden $isOpen={isOpen} $hasError={hasError && !isOpen} />\n <AddComponentTitle\n variant=\"pi\"\n fontWeight=\"bold\"\n textColor={hasError && !isOpen ? 'danger600' : 'neutral500'}\n >\n {children}\n </AddComponentTitle>\n </Flex>\n </StyledButton>\n );\n};\n\nconst StyledAddIcon = styled(PlusCircle)<{ $isOpen?: boolean; $hasError?: boolean }>`\n height: ${({ theme }) => theme.spaces[6]};\n width: ${({ theme }) => theme.spaces[6]};\n transform: ${({ $isOpen }) => ($isOpen ? 'rotate(45deg)' : 'rotate(0deg)')};\n\n > circle {\n fill: ${({ theme, $hasError }) =>\n $hasError ? theme.colors.danger200 : theme.colors.neutral150};\n }\n > path {\n fill: ${({ theme, $hasError }) =>\n $hasError ? theme.colors.danger600 : theme.colors.neutral600};\n }\n`;\n\nconst AddComponentTitle = styled<TypographyComponent>(Typography)``;\n\nconst StyledButton = styled(Button)`\n border-radius: 26px;\n border-color: ${({ theme }) => theme.colors.neutral150};\n box-shadow: ${({ theme }) => theme.shadows.filterShadow};\n height: 5rem;\n\n &:hover {\n ${AddComponentTitle} {\n color: ${({ theme }) => theme.colors.primary600};\n }\n\n ${StyledAddIcon} {\n > circle {\n fill: ${({ theme }) => theme.colors.primary600};\n }\n > path {\n fill: ${({ theme }) => theme.colors.primary600};\n }\n }\n }\n &:active {\n ${AddComponentTitle} {\n color: ${({ theme }) => theme.colors.primary600};\n }\n ${StyledAddIcon} {\n > circle {\n fill: ${({ theme }) => theme.colors.primary600};\n }\n > path {\n fill: ${({ theme }) => theme.colors.neutral100};\n }\n }\n }\n`;\n\nexport { AddComponentButton };\nexport type { AddComponentButtonProps };\n","import * as React from 'react';\n\nimport { Accordion, Box, Flex, FlexComponent, Typography } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { ComponentIcon } from '../../../../../components/ComponentIcon';\n\ninterface ComponentCategoryProps {\n category: string;\n components?: Array<{\n uid: string;\n displayName: string;\n icon?: string;\n }>;\n onAddComponent: (\n componentUid: string\n ) => React.MouseEventHandler<HTMLButtonElement> & React.MouseEventHandler<HTMLDivElement>;\n variant?: Accordion.Variant;\n}\n\nconst ComponentCategory = ({\n category,\n components = [],\n variant = 'primary',\n onAddComponent,\n}: ComponentCategoryProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <Accordion.Item value={category}>\n <Accordion.Header variant={variant}>\n <Accordion.Trigger>\n {formatMessage({ id: category, defaultMessage: category })}\n </Accordion.Trigger>\n </Accordion.Header>\n <Accordion.Content>\n <Grid paddingTop={4} paddingBottom={4} paddingLeft={3} paddingRight={3}>\n {components.map(({ uid, displayName, icon }) => (\n <ComponentBox\n key={uid}\n tag=\"button\"\n type=\"button\"\n background=\"neutral100\"\n justifyContent=\"center\"\n onClick={onAddComponent(uid)}\n hasRadius\n height=\"8.4rem\"\n shrink={0}\n borderColor=\"neutral200\"\n >\n <Flex direction=\"column\" gap={1} alignItems=\"center\" justifyContent=\"center\">\n <ComponentIcon color=\"currentColor\" background=\"primary200\" icon={icon} />\n\n <Typography variant=\"pi\" fontWeight=\"bold\">\n {displayName}\n </Typography>\n </Flex>\n </ComponentBox>\n ))}\n </Grid>\n </Accordion.Content>\n </Accordion.Item>\n );\n};\n\nconst Grid = styled(Box)`\n display: grid;\n grid-template-columns: repeat(auto-fit, 14rem);\n grid-gap: ${({ theme }) => theme.spaces[1]};\n`;\n\nconst ComponentBox = styled<FlexComponent<'button'>>(Flex)`\n color: ${({ theme }) => theme.colors.neutral600};\n cursor: pointer;\n\n @media (prefers-reduced-motion: no-preference) {\n transition: color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};\n }\n\n &:focus,\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.primary200};\n background: ${({ theme }) => theme.colors.primary100};\n color: ${({ theme }) => theme.colors.primary600};\n }\n`;\n\nexport { ComponentCategory };\nexport type { ComponentCategoryProps };\n","import * as React from 'react';\n\nimport { Box, Flex, Accordion, Typography } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { getTranslation } from '../../../../../utils/translations';\n\nimport { ComponentCategory, ComponentCategoryProps } from './ComponentCategory';\n\ninterface ComponentPickerProps {\n dynamicComponentsByCategory?: Record<string, NonNullable<ComponentCategoryProps['components']>>;\n isOpen?: boolean;\n onClickAddComponent: (componentUid: string) => void;\n}\n\nconst ComponentPicker = ({\n dynamicComponentsByCategory = {},\n isOpen,\n onClickAddComponent,\n}: ComponentPickerProps) => {\n const { formatMessage } = useIntl();\n\n const handleAddComponentToDz = (componentUid: string) => () => {\n onClickAddComponent(componentUid);\n };\n\n if (!isOpen) {\n return null;\n }\n\n return (\n <Box\n paddingTop={6}\n paddingBottom={6}\n paddingLeft={5}\n paddingRight={5}\n background=\"neutral0\"\n shadow=\"tableShadow\"\n borderColor=\"neutral150\"\n hasRadius\n >\n <Flex justifyContent=\"center\">\n <Typography fontWeight=\"bold\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslation('components.DynamicZone.ComponentPicker-label'),\n defaultMessage: 'Pick one component',\n })}\n </Typography>\n </Flex>\n <Box paddingTop={2}>\n <Accordion.Root defaultValue={Object.keys(dynamicComponentsByCategory)[0]}>\n {Object.entries(dynamicComponentsByCategory).map(([category, components], index) => (\n <ComponentCategory\n key={category}\n category={category}\n components={components}\n onAddComponent={handleAddComponentToDz}\n variant={index % 2 === 1 ? 'primary' : 'secondary'}\n />\n ))}\n </Accordion.Root>\n </Box>\n </Box>\n );\n};\n\nexport { ComponentPicker };\nexport type { ComponentPickerProps };\n","import { Field, TextInput } from '@strapi/design-system';\nimport { EyeStriked } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport type { InputProps } from '@strapi/admin/strapi-admin';\nimport type { Schema } from '@strapi/types';\n\ninterface NotAllowedInputProps extends Omit<InputProps, 'type'> {\n type: Schema.Attribute.Kind;\n}\n\nconst NotAllowedInput = ({ hint, label, required, name }: NotAllowedInputProps) => {\n const { formatMessage } = useIntl();\n\n const placeholder = formatMessage({\n id: 'components.NotAllowedInput.text',\n defaultMessage: 'No permissions to see this field',\n });\n\n return (\n <Field.Root id={name} hint={hint} name={name} required={required}>\n <Field.Label>{label}</Field.Label>\n <TextInput\n disabled\n placeholder={placeholder}\n startAction={<EyeStriked fill=\"neutral600\" />}\n type=\"text\"\n value=\"\"\n />\n <Field.Hint />\n </Field.Root>\n );\n};\n\nexport { NotAllowedInput };\n","/**\n * Related to the InputUID component, not the UIDs of content-types.\n */\n\nimport { GenerateUID, CheckUIDAvailability } from '../../../shared/contracts/uid';\n\nimport { contentManagerApi } from './api';\n\nconst uidApi = contentManagerApi.injectEndpoints({\n endpoints: (builder) => ({\n getDefaultUID: builder.query<\n GenerateUID.Response['data'],\n GenerateUID.Request['body'] & {\n params: GenerateUID.Request['query'];\n }\n >({\n query: ({ params, ...data }) => {\n return {\n url: '/content-manager/uid/generate',\n method: 'POST',\n data,\n config: {\n params,\n },\n };\n },\n transformResponse: (response: GenerateUID.Response) => response.data,\n }),\n generateUID: builder.mutation<\n GenerateUID.Response['data'],\n GenerateUID.Request['body'] & {\n params: GenerateUID.Request['query'];\n }\n >({\n query: ({ params, ...data }) => ({\n url: '/content-manager/uid/generate',\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n transformResponse: (response: GenerateUID.Response) => response.data,\n }),\n getAvailability: builder.query<\n CheckUIDAvailability.Response,\n CheckUIDAvailability.Request['body'] & {\n params: CheckUIDAvailability.Request['query'];\n }\n >({\n query: ({ params, ...data }) => ({\n url: '/content-manager/uid/check-availability',\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n providesTags: (_res, _error, params) => [\n { type: 'UidAvailability', id: params.contentTypeUID },\n ],\n }),\n }),\n});\n\nconst { useGenerateUIDMutation, useGetDefaultUIDQuery, useGetAvailabilityQuery } = uidApi;\n\nexport { useGenerateUIDMutation, useGetDefaultUIDQuery, useGetAvailabilityQuery };\n","import * as React from 'react';\n\nimport {\n type InputProps,\n useField,\n useForm,\n useNotification,\n useAPIErrorHandler,\n useQueryParams,\n useFocusInputField,\n} from '@strapi/admin/strapi-admin';\nimport {\n Field,\n Flex,\n FlexComponent,\n TextInput,\n Typography,\n useComposedRefs,\n} from '@strapi/design-system';\nimport { CheckCircle, WarningCircle, Loader, ArrowClockwise } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { useMatch } from 'react-router-dom';\nimport { styled, keyframes } from 'styled-components';\n\nimport { useDebounce } from '../../../../hooks/useDebounce';\nimport { useDoc } from '../../../../hooks/useDocument';\nimport { CLONE_PATH } from '../../../../router';\nimport {\n useGenerateUIDMutation,\n useGetAvailabilityQuery,\n useGetDefaultUIDQuery,\n} from '../../../../services/uid';\nimport { buildValidParams } from '../../../../utils/api';\n\nimport type { CheckUIDAvailability } from '../../../../../../shared/contracts/uid';\nimport type { Schema } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * InputUID\n * -----------------------------------------------------------------------------------------------*/\n\nconst UID_REGEX = /^[A-Za-z0-9-_.~]*$/;\n\ninterface UIDInputProps extends Omit<InputProps, 'type'> {\n type: Schema.Attribute.TypeOf<Schema.Attribute.UID>;\n}\n\nconst UIDInput = React.forwardRef<any, UIDInputProps>(\n ({ hint, label, labelAction, name, required, ...props }, ref) => {\n const { model, id } = useDoc();\n const allFormValues = useForm('InputUID', (form) => form.values);\n const [availability, setAvailability] = React.useState<CheckUIDAvailability.Response>();\n const [showRegenerate, setShowRegenerate] = React.useState(false);\n const isCloning = useMatch(CLONE_PATH) !== null;\n const field = useField(name);\n const debouncedValue = useDebounce(field.value, 300);\n const hasChanged = debouncedValue !== field.initialValue;\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n const { formatMessage } = useIntl();\n const [{ query }] = useQueryParams();\n const params = React.useMemo(() => buildValidParams(query), [query]);\n\n const {\n data: defaultGeneratedUID,\n isLoading: isGeneratingDefaultUID,\n error: apiError,\n } = useGetDefaultUIDQuery(\n {\n contentTypeUID: model,\n field: name,\n data: {\n id: id ?? '',\n ...allFormValues,\n },\n params,\n },\n {\n skip: field.value || !required,\n }\n );\n\n React.useEffect(() => {\n if (apiError) {\n toggleNotification({\n type: 'warning',\n message: formatAPIError(apiError),\n });\n }\n }, [apiError, formatAPIError, toggleNotification]);\n\n /**\n * If the defaultGeneratedUID is available, then we set it as the value,\n * but we also want to set it as the initialValue too.\n */\n React.useEffect(() => {\n if (defaultGeneratedUID && field.value === undefined) {\n field.onChange(name, defaultGeneratedUID);\n }\n }, [defaultGeneratedUID, field, name]);\n\n const [generateUID, { isLoading: isGeneratingUID }] = useGenerateUIDMutation();\n\n const handleRegenerateClick = async () => {\n try {\n const res = await generateUID({\n contentTypeUID: model,\n field: name,\n data: { id: id ?? '', ...allFormValues },\n params,\n });\n\n if ('data' in res) {\n field.onChange(name, res.data);\n } else {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n }\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'notification.error',\n defaultMessage: 'An error occurred.',\n }),\n });\n }\n };\n\n const {\n data: availabilityData,\n isLoading: isCheckingAvailability,\n error: availabilityError,\n } = useGetAvailabilityQuery(\n {\n contentTypeUID: model,\n field: name,\n value: debouncedValue ? debouncedValue.trim() : '',\n params,\n },\n {\n // Don't check availability if the value is empty or wasn't changed\n skip: !Boolean(\n (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())\n ),\n }\n );\n\n React.useEffect(() => {\n if (availabilityError) {\n toggleNotification({\n type: 'warning',\n message: formatAPIError(availabilityError),\n });\n }\n }, [availabilityError, formatAPIError, toggleNotification]);\n\n React.useEffect(() => {\n /**\n * always store the data in state because that way as seen below\n * we can then remove the data to stop showing the label.\n */\n setAvailability(availabilityData);\n\n let timer: number;\n\n if (availabilityData?.isAvailable) {\n timer = window.setTimeout(() => {\n setAvailability(undefined);\n }, 4000);\n }\n\n return () => {\n if (timer) {\n clearTimeout(timer);\n }\n };\n }, [availabilityData]);\n\n const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;\n\n const fieldRef = useFocusInputField(name);\n const composedRefs = useComposedRefs(ref, fieldRef);\n\n const shouldShowAvailability =\n (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;\n\n return (\n <Field.Root hint={hint} name={name} error={field.error} required={required}>\n <Field.Label action={labelAction}>{label}</Field.Label>\n <TextInput\n ref={composedRefs}\n disabled={props.disabled}\n endAction={\n <Flex position=\"relative\" gap={1}>\n {shouldShowAvailability && (\n <TextValidation\n alignItems=\"center\"\n gap={1}\n justifyContent=\"flex-end\"\n $available={!!availability?.isAvailable}\n data-not-here-outer\n position=\"absolute\"\n pointerEvents=\"none\"\n right={6}\n width=\"100px\"\n >\n {availability?.isAvailable ? <CheckCircle /> : <WarningCircle />}\n\n <Typography\n textColor={availability.isAvailable ? 'success600' : 'danger600'}\n variant=\"pi\"\n >\n {formatMessage(\n availability.isAvailable\n ? {\n id: 'content-manager.components.uid.available',\n defaultMessage: 'Available',\n }\n : {\n id: 'content-manager.components.uid.unavailable',\n defaultMessage: 'Unavailable',\n }\n )}\n </Typography>\n </TextValidation>\n )}\n\n {!props.disabled && (\n <>\n {showRegenerate && (\n <TextValidation alignItems=\"center\" justifyContent=\"flex-end\" gap={1}>\n <Typography textColor=\"primary600\" variant=\"pi\">\n {formatMessage({\n id: 'content-manager.components.uid.regenerate',\n defaultMessage: 'Regenerate',\n })}\n </Typography>\n </TextValidation>\n )}\n\n <FieldActionWrapper\n onClick={handleRegenerateClick}\n label={formatMessage({\n id: 'content-manager.components.uid.regenerate',\n defaultMessage: 'Regenerate',\n })}\n onMouseEnter={() => setShowRegenerate(true)}\n onMouseLeave={() => setShowRegenerate(false)}\n >\n {isLoading ? (\n <LoadingWrapper data-testid=\"loading-wrapper\">\n <Loader />\n </LoadingWrapper>\n ) : (\n <ArrowClockwise />\n )}\n </FieldActionWrapper>\n </>\n )}\n </Flex>\n }\n onChange={field.onChange}\n value={field.value ?? ''}\n {...props}\n />\n <Field.Error />\n <Field.Hint />\n </Field.Root>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * FieldActionWrapper\n * -----------------------------------------------------------------------------------------------*/\n\nconst FieldActionWrapper = styled(Field.Action)`\n width: 1.6rem;\n\n svg {\n height: 1.6rem;\n width: 1.6rem;\n path {\n fill: ${({ theme }) => theme.colors.neutral400};\n }\n }\n\n svg:hover {\n path {\n fill: ${({ theme }) => theme.colors.primary600};\n }\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * TextValidation\n * -----------------------------------------------------------------------------------------------*/\n\nconst TextValidation = styled<FlexComponent>(Flex)<{ $available?: boolean }>`\n svg {\n height: 1.2rem;\n width: 1.2rem;\n\n path {\n fill: ${({ theme, $available }) =>\n $available ? theme.colors.success600 : theme.colors.danger600};\n }\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * LoadingWrapper\n * -----------------------------------------------------------------------------------------------*/\n\nconst rotation = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(359deg);\n }\n`;\n\nconst LoadingWrapper = styled<FlexComponent>(Flex)`\n animation: ${rotation} 2s infinite linear;\n`;\n\nconst MemoizedUIDInput = React.memo(UIDInput);\n\nexport { MemoizedUIDInput as UIDInput };\nexport type { UIDInputProps };\n","import { getLanguage, highlight, highlightAuto } from 'highlight.js';\nimport Markdown from 'markdown-it';\n// @ts-expect-error - library does not export types\nimport abbr from 'markdown-it-abbr';\nimport container from 'markdown-it-container';\n// @ts-expect-error - library does not export types\nimport deflist from 'markdown-it-deflist';\nimport emoji from 'markdown-it-emoji';\nimport footnote from 'markdown-it-footnote';\n// @ts-expect-error - library does not export types\nimport ins from 'markdown-it-ins';\n// @ts-expect-error - library does not export types\nimport mark from 'markdown-it-mark';\n// @ts-expect-error - library does not export types\nimport sub from 'markdown-it-sub';\n// @ts-expect-error - library does not export types\nimport sup from 'markdown-it-sup';\n\nimport 'highlight.js/styles/solarized-dark.css';\n\nconst md: Markdown = new Markdown({\n html: true, // Enable HTML tags in source\n xhtmlOut: false,\n breaks: true,\n langPrefix: 'language-',\n linkify: true,\n typographer: true,\n // Code from: https://github.com/markdown-it/markdown-it/blob/master/support/demo_template/index.js#L83\n highlight(str, lang) {\n if (lang && lang !== 'auto' && getLanguage(lang)) {\n return (\n '<pre class=\"hljs language-' +\n md.utils.escapeHtml(lang.toLowerCase()) +\n '\"><code>' +\n highlight(lang, str, true).value +\n '</code></pre>'\n );\n }\n\n if (lang === 'auto') {\n const result = highlightAuto(str);\n\n return (\n '<pre class=\"hljs language-' +\n md.utils.escapeHtml(result.language!) +\n '\"><code>' +\n result.value +\n '</code></pre>'\n );\n }\n\n return '<pre class=\"hljs\"><code>' + md.utils.escapeHtml(str) + '</code></pre>';\n },\n})\n .use(abbr)\n .use(container, 'warning')\n .use(container, 'tip')\n .use(deflist)\n .use(emoji)\n .use(footnote)\n .use(ins)\n .use(mark)\n .use(sub)\n .use(sup);\n\n// Code from: https://github.com/markdown-it/markdown-it-footnote/blob/master/index.js#L29\nmd.renderer.rules.footnote_ref = (tokens, idx, options, env, slf) => {\n const caption = slf.rules.footnote_caption?.(tokens, idx, options, env, slf);\n\n return '<sup class=\"footnote-ref\"><span>' + caption + '</span></sup>';\n};\n\nmd.renderer.rules.footnote_anchor = () => {\n /* ↩ with escape code to prevent display as Apple Emoji on iOS */\n return ' <span class=\"footnote-backref\">\\u21a9\\uFE0E</span>';\n};\n\nexport { md };\n","import * as React from 'react';\n\nimport sanitizeHtml from 'sanitize-html';\nimport { styled } from 'styled-components';\n\nimport { md } from './utils/mdRenderer';\n\ninterface PreviewWysiwygProps {\n data?: string;\n}\n\nconst PreviewWysiwyg = ({ data = '' }: PreviewWysiwygProps) => {\n const html = React.useMemo(\n () =>\n sanitizeHtml(md.render(data.replaceAll('\\\\n', '\\n') || ''), {\n ...sanitizeHtml.defaults,\n allowedTags: false,\n allowedAttributes: {\n '*': ['href', 'align', 'alt', 'center', 'width', 'height', 'type', 'controls', 'target'],\n img: ['src', 'alt'],\n source: ['src', 'type'],\n },\n }),\n [data]\n );\n\n return (\n <Wrapper>\n <div dangerouslySetInnerHTML={{ __html: html }} />\n </Wrapper>\n );\n};\n\nconst Wrapper = styled.div`\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};\n font-size: 1.4rem;\n background-color: ${({ theme }) => theme.colors.neutral0};\n color: ${({ theme }) => theme.colors.neutral800};\n line-height: ${({ theme }) => theme.lineHeights[6]};\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-block-start: ${({ theme }) => theme.spaces[2]};\n margin-block-end: ${({ theme }) => theme.spaces[2]};\n }\n\n p {\n margin-bottom: ${({ theme }) => theme.spaces[2]};\n }\n\n h1 {\n font-size: 3.6rem;\n font-weight: 600;\n }\n\n h2 {\n font-size: 3rem;\n font-weight: 500;\n }\n\n h3 {\n font-size: 2.4rem;\n font-weight: 500;\n }\n\n h4 {\n font-size: 2rem;\n font-weight: 500;\n }\n\n strong {\n font-weight: 800;\n }\n\n em {\n font-style: italic;\n }\n\n blockquote {\n margin-top: ${({ theme }) => theme.spaces[8]};\n margin-bottom: ${({ theme }) => theme.spaces[7]};\n font-size: 1.4rem;\n font-weight: 400;\n border-left: 4px solid ${({ theme }) => theme.colors.neutral150};\n font-style: italic;\n padding: ${({ theme }) => theme.spaces[2]} ${({ theme }) => theme.spaces[5]};\n }\n\n img {\n max-width: 100%;\n }\n\n table {\n thead {\n background: ${({ theme }) => theme.colors.neutral150};\n\n th {\n padding: ${({ theme }) => theme.spaces[4]};\n }\n }\n tr {\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n }\n th,\n td {\n padding: ${({ theme }) => theme.spaces[4]};\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n border-bottom: 0;\n border-top: 0;\n }\n }\n\n pre,\n code {\n font-size: 1.4rem;\n border-radius: 4px;\n /* \n Hard coded since the color is the same between themes,\n theme.colors.neutral800 changes between themes.\n\n Matches the color of the JSON Input component.\n */\n background-color: #32324d;\n max-width: 100%;\n overflow: auto;\n padding: ${({ theme }) => theme.spaces[2]};\n }\n\n /* Inline code */\n p,\n pre,\n td {\n > code {\n color: #839496;\n }\n }\n\n ol {\n list-style-type: decimal;\n margin-block-start: ${({ theme }) => theme.spaces[4]};\n margin-block-end: ${({ theme }) => theme.spaces[4]};\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding-inline-start: ${({ theme }) => theme.spaces[4]};\n\n ol,\n ul {\n margin-block-start: 0px;\n margin-block-end: 0px;\n }\n }\n\n ul {\n list-style-type: disc;\n margin-block-start: ${({ theme }) => theme.spaces[4]};\n margin-block-end: ${({ theme }) => theme.spaces[4]};\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding-inline-start: ${({ theme }) => theme.spaces[4]};\n\n ul,\n ol {\n margin-block-start: 0px;\n margin-block-end: 0px;\n }\n }\n`;\n\nexport { PreviewWysiwyg };\n","import CodeMirror from 'codemirror5';\n\n// Disabling eslint on purpose\n/* eslint-disable */\n\nvar listRE = /^(\\s*)(>[> ]*|[*+-] \\[[x ]\\]\\s|[*+-]\\s|(\\d+)([.)]))(\\s*)/,\n emptyListRE = /^(\\s*)(>[> ]*|[*+-] \\[[x ]\\]|[*+-]|(\\d+)[.)])(\\s*)$/,\n unorderedListRE = /[*+-]\\s/;\n\n/*\n functions coming from CodeMirror addons continuelist.js\n ===> https://github.com/codemirror/CodeMirror/blob/master/addon/edit/continuelist.js\n\n we imported it because the way the addon ask to use markdown mode\n since we have our own markdown preview system we couldn't use it directly\n only thing we changed is removing the part that enabled addon only with markdown mode\n*/\n\nfunction newlineAndIndentContinueMarkdownList(cm: CodeMirror.Editor) {\n // @ts-expect-error - cm does not recognize disableInput.\n if (cm.getOption('disableInput')) return CodeMirror.Pass;\n var ranges = cm.listSelections(),\n replacements = [];\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].head;\n\n var eolState = cm.getStateAfter(pos.line);\n var inList = eolState.list !== false;\n var inQuote = eolState.quote !== 0;\n\n var line = cm.getLine(pos.line),\n match = listRE.exec(line);\n var cursorBeforeBullet = /^\\s*$/.test(line.slice(0, pos.ch));\n if (!ranges[i].empty() || (!inList && !inQuote) || !match || cursorBeforeBullet) {\n cm.execCommand('newlineAndIndent');\n return;\n }\n if (emptyListRE.test(line)) {\n var endOfQuote = inQuote && />\\s*$/.test(line);\n var endOfList = !/>\\s*$/.test(line);\n if (endOfQuote || endOfList)\n cm.replaceRange(\n '',\n {\n line: pos.line,\n ch: 0,\n },\n {\n line: pos.line,\n ch: pos.ch + 1,\n }\n );\n replacements[i] = '\\n';\n } else {\n var indent = match[1],\n after = match[5];\n var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf('>') >= 0);\n var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace('x', ' ');\n replacements[i] = '\\n' + indent + bullet + after;\n\n if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);\n }\n }\n\n cm.replaceSelections(replacements);\n}\n\nfunction incrementRemainingMarkdownListNumbers(cm: CodeMirror.Editor, pos: CodeMirror.Position) {\n var startLine = pos.line,\n lookAhead = 0,\n skipCount = 0;\n var startItem = listRE.exec(cm.getLine(startLine)),\n startIndent = startItem![1];\n\n do {\n lookAhead += 1;\n var nextLineNumber = startLine + lookAhead;\n var nextLine = cm.getLine(nextLineNumber);\n var nextItem = listRE.exec(nextLine);\n\n if (nextItem) {\n var nextIndent = nextItem[1];\n var newNumber = parseInt(startItem![3], 10) + lookAhead - skipCount;\n var nextNumber = parseInt(nextItem[3], 10),\n itemNumber = nextNumber;\n\n if (startIndent === nextIndent && !isNaN(nextNumber)) {\n if (newNumber === nextNumber) itemNumber = nextNumber + 1;\n if (newNumber > nextNumber) itemNumber = newNumber + 1;\n cm.replaceRange(\n nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),\n {\n line: nextLineNumber,\n ch: 0,\n },\n {\n line: nextLineNumber,\n ch: nextLine.length,\n }\n );\n } else {\n if (startIndent.length > nextIndent.length) return;\n // This doesn't run if the next line immediately indents, as it is\n // not clear of the users intention (new indented item or same level)\n if (startIndent.length < nextIndent.length && lookAhead === 1) return;\n skipCount += 1;\n }\n }\n } while (nextItem);\n}\n\nexport { newlineAndIndentContinueMarkdownList };\n","import * as React from 'react';\n\nimport CodeMirror, { EditorFromTextArea } from 'codemirror5';\nimport { styled } from 'styled-components';\n\nimport { PreviewWysiwyg } from './PreviewWysiwyg';\nimport { newlineAndIndentContinueMarkdownList } from './utils/continueList';\n\nimport type { FieldValue, InputProps } from '@strapi/admin/strapi-admin';\n\nimport 'codemirror5/addon/display/placeholder';\n\ninterface EditorApi {\n focus: () => void;\n scrollIntoView: (args?: Parameters<HTMLElement['scrollIntoView']>[0]) => void;\n}\n\ninterface EditorProps extends Omit<FieldValue, 'initialValue'>, Omit<InputProps, 'type' | 'label'> {\n editorRef: React.MutableRefObject<EditorFromTextArea>;\n isPreviewMode?: boolean;\n isExpandMode?: boolean;\n textareaRef: React.RefObject<HTMLTextAreaElement>;\n}\n\nconst Editor = React.forwardRef<EditorApi, EditorProps>(\n (\n {\n disabled,\n editorRef,\n error,\n isPreviewMode,\n isExpandMode,\n name,\n onChange,\n placeholder,\n textareaRef,\n value,\n },\n forwardedRef\n ) => {\n const onChangeRef = React.useRef(onChange);\n\n React.useEffect(() => {\n if (editorRef.current) {\n // Ensure the editor and its wrapper are cleaned up whenever this view is re-rendered\n // e.g. in case of re-ordering wysiwyg components in a DynamicZone\n editorRef.current.toTextArea();\n }\n editorRef.current = CodeMirror.fromTextArea(textareaRef.current!, {\n lineWrapping: true,\n extraKeys: {\n Enter: 'newlineAndIndentContinueMarkdownList',\n Tab: false,\n 'Shift-Tab': false,\n },\n readOnly: false,\n smartIndent: false,\n placeholder,\n spellcheck: true,\n inputStyle: 'contenteditable',\n });\n\n // @ts-expect-error – doesn't think command exists?\n CodeMirror.commands.newlineAndIndentContinueMarkdownList =\n newlineAndIndentContinueMarkdownList;\n editorRef.current.on('change', (doc) => {\n onChangeRef.current(name, doc.getValue());\n });\n }, [editorRef, textareaRef, name, placeholder]);\n\n React.useEffect(() => {\n if (value && !editorRef.current.hasFocus()) {\n editorRef.current.setValue(value);\n }\n }, [editorRef, value]);\n\n React.useEffect(() => {\n if (isPreviewMode || disabled) {\n editorRef.current.setOption('readOnly', 'nocursor');\n } else {\n editorRef.current.setOption('readOnly', false);\n }\n }, [disabled, isPreviewMode, editorRef]);\n\n React.useEffect(() => {\n if (error) {\n editorRef.current.setOption('screenReaderLabel', error);\n } else {\n // to replace with translation\n editorRef.current.setOption('screenReaderLabel', 'Editor');\n }\n }, [editorRef, error]);\n\n React.useImperativeHandle(\n forwardedRef,\n () => ({\n focus() {\n editorRef.current.getInputField().focus();\n },\n scrollIntoView(args?: Parameters<HTMLElement['scrollIntoView']>[0]) {\n editorRef.current.getInputField().scrollIntoView(args);\n },\n }),\n [editorRef]\n );\n\n return (\n <EditorAndPreviewWrapper>\n <EditorStylesContainer $isExpandMode={isExpandMode} $disabled={disabled || isPreviewMode}>\n <textarea ref={textareaRef} />\n </EditorStylesContainer>\n {isPreviewMode && <PreviewWysiwyg data={value} />}\n </EditorAndPreviewWrapper>\n );\n }\n);\n\nconst EditorAndPreviewWrapper = styled.div`\n position: relative;\n height: calc(100% - 48px);\n`;\n\nconst EditorStylesContainer = styled.div<{ $disabled?: boolean; $isExpandMode?: boolean }>`\n cursor: ${({ $disabled }) => ($disabled ? 'not-allowed !important' : 'auto')};\n height: 100%;\n /* BASICS */\n .CodeMirror-placeholder {\n color: ${({ theme }) => theme.colors.neutral600} !important;\n }\n\n .CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-size: 1.4rem;\n height: ${({ $isExpandMode }) =>\n $isExpandMode\n ? '100%'\n : '410px'}; // 512px(total height) - 48px (header) - 52px(footer) - 2px border\n color: ${({ theme }) => theme.colors.neutral800};\n direction: ltr;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,\n 'Open Sans', 'Helvetica Neue', sans-serif;\n }\n\n /* PADDING */\n\n .CodeMirror-lines {\n padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};\n /* Vertical padding around content */\n }\n\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n /* The little square between H and V scrollbars */\n background-color: ${({ theme }) => `${theme.colors.neutral0}`};\n }\n\n /* GUTTER */\n\n .CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n }\n .CodeMirror-linenumbers {\n }\n .CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n }\n\n .CodeMirror-guttermarker {\n color: black;\n }\n .CodeMirror-guttermarker-subtle {\n color: #999;\n }\n\n /* CURSOR */\n\n .CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n }\n /* Shown when moving in bi-directional text */\n .CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n }\n .cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n }\n .cm-fat-cursor div.CodeMirror-cursors {\n /* z-index: 1; */\n }\n\n .cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n }\n .cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n }\n\n /* Can style cursor different in overwrite (non-insert) mode */\n .CodeMirror-overwrite .CodeMirror-cursor {\n }\n\n .cm-tab {\n display: inline-block;\n text-decoration: inherit;\n }\n\n .CodeMirror-rulers {\n position: absolute;\n left: 0;\n right: 0;\n top: -50px;\n bottom: 0;\n overflow: hidden;\n }\n .CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0;\n bottom: 0;\n position: absolute;\n }\n\n /* DEFAULT THEME */\n\n .cm-header,\n .cm-strong {\n font-weight: bold;\n }\n .cm-em {\n font-style: italic;\n }\n .cm-link {\n text-decoration: underline;\n }\n .cm-strikethrough {\n text-decoration: line-through;\n }\n\n .CodeMirror-composing {\n border-bottom: 2px solid;\n }\n\n /* Default styles for common addons */\n\n div.CodeMirror span.CodeMirror-matchingbracket {\n color: #0b0;\n }\n div.CodeMirror span.CodeMirror-nonmatchingbracket {\n color: #a22;\n }\n .CodeMirror-matchingtag {\n background: rgba(255, 150, 0, 0.3);\n }\n .CodeMirror-activeline-background {\n background: #e8f2ff;\n }\n\n /* STOP */\n\n /* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n .CodeMirror {\n position: relative;\n overflow: hidden;\n background: ${({ theme }) => `${theme.colors.neutral0}`};\n }\n\n .CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 50px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -50px;\n margin-right: -50px;\n padding-bottom: 50px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n }\n .CodeMirror-sizer {\n position: relative;\n border-right: 50px solid transparent;\n }\n\n /* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n .CodeMirror-vscrollbar,\n .CodeMirror-hscrollbar,\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 1;\n display: none;\n outline: none;\n }\n\n .CodeMirror-vscrollbar {\n right: 0;\n top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n .CodeMirror-hscrollbar {\n bottom: 0;\n left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n }\n .CodeMirror-scrollbar-filler {\n right: 0;\n bottom: 0;\n }\n\n .CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n }\n /* Reset some styles that the rest of the page might have set */\n .CodeMirror pre.CodeMirror-line,\n .CodeMirror pre.CodeMirror-line-like {\n -moz-border-radius: 0;\n -webkit-border-radius: 0;\n border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: 1.5;\n color: inherit;\n /* z-index: 2; */\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n }\n\n .CodeMirror pre.CodeMirror-line-like {\n z-index: 2;\n }\n\n .CodeMirror-wrap pre.CodeMirror-line,\n .CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n }\n\n .CodeMirror-linebackground {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 0;\n }\n\n .CodeMirror-linewidget {\n position: relative;\n /* z-index: 2; */\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n }\n\n .CodeMirror-widget {\n }\n\n .CodeMirror-rtl pre {\n direction: rtl;\n }\n\n .CodeMirror-code {\n outline: none;\n }\n\n /* Force content-box sizing for the elements where we expect it */\n .CodeMirror-scroll,\n .CodeMirror-sizer,\n .CodeMirror-gutter,\n .CodeMirror-gutters,\n .CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n }\n\n .CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n .CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n border-color: ${({ theme }) => `${theme.colors.neutral800}`};\n }\n .CodeMirror-measure pre {\n position: static;\n }\n\n div.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n + div {\n z-index: 0 !important;\n }\n }\n\n div.CodeMirror-dragcursors {\n visibility: visible;\n }\n\n .CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n }\n\n .CodeMirror-selected {\n background: ${({ theme }) => theme.colors.neutral200};\n /* z-index: -10; */\n }\n .CodeMirror-crosshair {\n cursor: crosshair;\n }\n\n /* Used to force a border model for a node */\n .cm-force-border {\n padding-right: 0.1px;\n }\n\n /* See issue #2901 */\n .cm-tab-wrap-hack:after {\n content: '';\n }\n\n /* Help users use markselection to safely style text background */\n span.CodeMirror-selectedtext {\n background: none;\n }\n\n span {\n color: ${({ theme }) => theme.colors.neutral800} !important;\n }\n`;\n\nexport { Editor };\nexport type { EditorProps, EditorApi };\n","import * as React from 'react';\n\nimport {\n Button,\n Box,\n BoxComponent,\n Flex,\n FlexComponent,\n FocusTrap,\n Portal,\n Typography,\n} from '@strapi/design-system';\nimport { Collapse } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { PreviewWysiwyg } from './PreviewWysiwyg';\n\ninterface EditorLayoutProps {\n children: React.ReactNode;\n isExpandMode: boolean;\n error?: string;\n previewContent?: string;\n onCollapse: () => void;\n}\n\nconst EditorLayout = ({\n children,\n isExpandMode,\n error,\n previewContent = '',\n onCollapse,\n}: EditorLayoutProps) => {\n const { formatMessage } = useIntl();\n\n React.useEffect(() => {\n if (isExpandMode) {\n document.body.classList.add('lock-body-scroll');\n }\n\n return () => {\n document.body.classList.remove('lock-body-scroll');\n };\n }, [isExpandMode]);\n\n if (isExpandMode) {\n return (\n <Portal role=\"dialog\" aria-modal={false}>\n <FocusTrap onEscape={onCollapse}>\n <ExpandWrapper\n position=\"fixed\"\n top={0}\n left={0}\n right={0}\n bottom={0}\n zIndex={4}\n justifyContent=\"center\"\n onClick={onCollapse}\n >\n <Box<'div'>\n background=\"neutral0\"\n hasRadius\n shadow=\"popupShadow\"\n overflow=\"hidden\"\n width=\"90%\"\n height=\"90%\"\n onClick={(e) => e.stopPropagation()}\n >\n <Flex height=\"100%\" alignItems=\"flex-start\">\n <BoxWithBorder flex=\"1\" height=\"100%\">\n {children}\n </BoxWithBorder>\n <Flex alignItems=\"start\" direction=\"column\" flex={1} height=\"100%\" width=\"100%\">\n <Flex\n height=\"4.8rem\"\n background=\"neutral100\"\n justifyContent=\"flex-end\"\n shrink={0}\n width=\"100%\"\n >\n <ExpandButton onClick={onCollapse} variant=\"tertiary\" size=\"M\">\n <Typography>\n {formatMessage({\n id: 'components.Wysiwyg.collapse',\n defaultMessage: 'Collapse',\n })}\n </Typography>\n <Collapse />\n </ExpandButton>\n </Flex>\n\n <Box position=\"relative\" height=\"100%\" width=\"100%\">\n <PreviewWysiwyg data={previewContent} />\n </Box>\n </Flex>\n </Flex>\n </Box>\n </ExpandWrapper>\n </FocusTrap>\n </Portal>\n );\n }\n\n return (\n <Flex\n borderColor={error ? 'danger600' : 'neutral200'}\n borderStyle=\"solid\"\n borderWidth=\"1px\"\n hasRadius\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children}\n </Flex>\n );\n};\n\nconst ExpandWrapper = styled<FlexComponent>(Flex)`\n background: ${({ theme }) =>\n `${theme.colors.neutral800}${Math.floor(0.2 * 255)\n .toString(16)\n .padStart(2, '0')}`};\n`;\n\nconst BoxWithBorder = styled<BoxComponent>(Box)`\n border-right: 1px solid ${({ theme }) => theme.colors.neutral200};\n`;\n\nconst ExpandButton = styled(Button)`\n background-color: transparent;\n border: none;\n align-items: center;\n\n & > span {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n }\n\n svg {\n margin-left: ${({ theme }) => `${theme.spaces[2]}`};\n\n path {\n fill: ${({ theme }) => theme.colors.neutral700};\n width: 1.2rem;\n height: 1.2rem;\n }\n }\n`;\n\nexport { EditorLayout, ExpandButton };\nexport type { EditorLayoutProps };\n","import { MutableRefObject } from 'react';\n\nimport CodeMirror from 'codemirror5';\n\nexport const replaceText = (markdownName: string, textToChange: string) => {\n let editedText;\n\n switch (markdownName) {\n case 'Strikethrough':\n editedText = `~~${textToChange}~~`;\n break;\n case 'Bold':\n editedText = `**${textToChange}**`;\n break;\n case 'Italic':\n editedText = `_${textToChange}_`;\n break;\n case 'Underline':\n editedText = `<u>${textToChange}</u>`;\n break;\n case 'Code':\n editedText = `\\`\\`\\`\\n${textToChange}\\n\\`\\`\\``;\n break;\n case 'Link':\n editedText = `[${textToChange}](link)`;\n break;\n case 'Quote':\n editedText = `>${textToChange}`;\n break;\n default:\n editedText = textToChange;\n }\n\n return editedText;\n};\n\nexport const insertText = (markdownName: string) => {\n let editedText;\n // object to calculate text that will be selected after insert of markdown\n const selection = { start: markdownName.length, end: 0 };\n\n switch (markdownName) {\n case 'Strikethrough':\n editedText = `~~${markdownName}~~`;\n selection.end = 2;\n break;\n case 'Bold':\n editedText = `**${markdownName}**`;\n selection.end = 2;\n break;\n case 'Italic':\n editedText = `_${markdownName}_`;\n selection.end = 1;\n break;\n case 'alt':\n editedText = `[${markdownName}]()`;\n selection.end = 3;\n break;\n case 'Underline':\n editedText = `<u>${markdownName}</u>`;\n selection.end = 4;\n break;\n case 'Code':\n editedText = `\\`\\`\\`\\n${markdownName}\\n\\`\\`\\``;\n selection.end = 3;\n break;\n case 'Link':\n editedText = `[${markdownName}](link)`;\n selection.end = 7;\n break;\n case 'Quote':\n editedText = `>${markdownName}`;\n selection.end = 0;\n break;\n default:\n editedText = '';\n }\n\n return { editedText, selection };\n};\n\nexport const insertListOrTitle = (markdown: string) => {\n let textToInsert;\n\n switch (markdown) {\n case 'BulletList':\n textToInsert = '- ';\n break;\n case 'NumberList':\n textToInsert = '1. ';\n break;\n case 'h1':\n textToInsert = '# ';\n break;\n case 'h2':\n textToInsert = '## ';\n break;\n case 'h3':\n textToInsert = '### ';\n break;\n case 'h4':\n textToInsert = '#### ';\n break;\n case 'h5':\n textToInsert = '##### ';\n break;\n case 'h6':\n textToInsert = '###### ';\n break;\n default:\n return '';\n }\n\n return textToInsert;\n};\n\n// EDITOR ACTIONS FUNCTIONS\n\nexport const markdownHandler = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n markdownType: string\n) => {\n const textToEdit = editor.current.getSelection();\n let textToInsert;\n\n if (textToEdit) {\n const editedText = replaceText(markdownType, textToEdit);\n editor.current.replaceSelection(editedText);\n editor.current.focus();\n } else {\n textToInsert = insertText(markdownType);\n editor.current.replaceSelection(textToInsert.editedText);\n editor.current.focus();\n // set selection-focus to text to replace with content\n const { line, ch } = editor.current.getCursor();\n const endSelection = ch - textToInsert.selection.end;\n const startSelection = ch - textToInsert.selection.end - textToInsert.selection.start;\n editor.current.setSelection({ line, ch: startSelection }, { line, ch: endSelection });\n }\n};\n\nexport const listHandler = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n listType: string\n) => {\n const doc = editor.current.getDoc();\n const insertion = listType === 'BulletList' ? '- ' : '1. ';\n\n if (doc.somethingSelected()) {\n const selections = doc.listSelections();\n let remove: boolean | null = null;\n\n editor.current.operation(function () {\n selections.forEach(function (selection) {\n const pos = [selection.head.line, selection.anchor.line].sort();\n\n // Remove if the first text starts with it\n if (remove == null) {\n remove = doc.getLine(pos[0]).startsWith(insertion);\n }\n\n for (let i = pos[0]; i <= pos[1]; i++) {\n if (remove) {\n // Don't remove if we don't start with it\n if (doc.getLine(i).startsWith(insertion)) {\n doc.replaceRange('', { line: i, ch: 0 }, { line: i, ch: insertion.length });\n }\n } else {\n const lineInsertion = listType === 'BulletList' ? '- ' : `${i + 1}. `;\n doc.replaceRange(lineInsertion, { line: i, ch: 0 });\n }\n }\n });\n });\n } else {\n const { line: currentLine } = doc.getCursor();\n const listToInsert = insertListOrTitle(listType);\n const lineContent = editor.current.getLine(currentLine);\n\n const textToInsert = listToInsert + lineContent;\n editor.current.setSelection(\n { line: currentLine, ch: 0 },\n { line: currentLine, ch: lineContent.length }\n );\n editor.current.replaceSelection(textToInsert);\n }\n\n editor.current.focus();\n};\n\nexport const titleHandler = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n titleType: string\n) => {\n const { line: currentLine } = editor.current.getCursor();\n const titleToInsert = insertListOrTitle(titleType);\n const lineContent = editor.current.getLine(currentLine);\n\n // replace hashtags followed by a space in case user want to change the type of title\n const lineWithNoTitle = lineContent.replace(/#{1,6}\\s/g, '').trim();\n\n const textToInsert = titleToInsert + lineWithNoTitle;\n editor.current.setSelection(\n { line: currentLine, ch: 0 },\n { line: currentLine, ch: lineContent.length }\n );\n editor.current.replaceSelection(textToInsert);\n\n setTimeout(() => {\n const newLastLineLength = editor.current.getLine(currentLine).length;\n editor.current.focus();\n editor.current.setCursor({ line: currentLine, ch: newLastLineLength });\n }, 0);\n};\n\nexport const insertFile = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n files: any[]\n) => {\n let { line } = editor.current.getCursor();\n const { ch } = editor.current.getCursor();\n\n files.forEach((file, i) => {\n let contentLength = editor.current.getLine(line).length;\n editor.current.setCursor({ line, ch: contentLength });\n // create a new line after first image markdown inserted\n // or if there is content in current line\n\n if (i > 0 || (i === 0 && ch !== 0)) {\n contentLength = editor.current.getLine(line).length;\n editor.current.setCursor({ line, ch: contentLength });\n line++;\n editor.current.replaceSelection('\\n');\n }\n\n if (file.mime.includes('image')) {\n editor.current.replaceSelection(``);\n } else {\n editor.current.replaceSelection(`[${file.alt}](${file.url})`);\n }\n });\n\n setTimeout(() => editor.current.focus(), 0);\n};\n\n// NEXT FUNCTIONS FOR QUOTE OR CODE MARKDOWN\n\nconst insertWithTextToEdit = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n markdownType: string,\n line: number,\n contentLength: number,\n textToEdit: string\n) => {\n const textToInsert = replaceText(markdownType, textToEdit);\n\n // remove content after current line\n const contentToMove = editor.current.getRange(\n { line: line + 1, ch: 0 },\n { line: Infinity, ch: Infinity }\n );\n editor.current.replaceRange('', { line: line + 1, ch: 0 }, { line: Infinity, ch: Infinity });\n\n // remove word that was selected\n // set cursor end of line + move to next line\n // add text to insert\n editor.current.replaceSelection('');\n editor.current.setCursor({ line, ch: contentLength });\n editor.current.replaceSelection('\\n');\n editor.current.replaceSelection(textToInsert);\n\n if (markdownType === 'Code') {\n const { line: newLine } = editor.current.getCursor();\n editor.current.setCursor({ line: newLine - 1, ch: textToEdit.length });\n }\n\n // add content we had to remove earlier\n editor.current.replaceRange(\n contentToMove,\n { line: line + 4, ch: 0 },\n { line: Infinity, ch: Infinity }\n );\n\n editor.current.focus();\n};\n\nconst insertWithoutTextToEdit = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n markdownType: string,\n line: number,\n contentLength: number\n) => {\n const textToInsert = insertText(markdownType);\n\n // remove content after current line\n const contentToMove = editor.current.getRange(\n { line: line + 1, ch: 0 },\n { line: Infinity, ch: Infinity }\n );\n editor.current.replaceRange('', { line: line + 1, ch: 0 }, { line: Infinity, ch: Infinity });\n\n // replace cursor to next line\n editor.current.setCursor({ line, ch: contentLength });\n editor.current.replaceSelection('\\n');\n editor.current.replaceSelection(textToInsert.editedText);\n\n // set selection on \"Code\" or \"Quote\" word\n\n if (markdownType === 'Code') {\n line += 2;\n\n editor.current.setSelection({ line, ch: 0 }, { line, ch: 4 });\n } else {\n line += 1;\n\n const { ch } = editor.current.getCursor();\n const endSelection = ch - textToInsert.selection.end;\n const startSelection = ch - textToInsert.selection.end - textToInsert.selection.start;\n editor.current.setSelection({ line, ch: startSelection }, { line, ch: endSelection });\n }\n\n // add content we had to remove earlier\n editor.current.replaceRange(\n contentToMove,\n { line: line + 2, ch: 0 },\n { line: Infinity, ch: Infinity }\n );\n editor.current.focus();\n};\n\nexport const quoteAndCodeHandler = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n markdownType: string\n) => {\n const textToEdit = editor.current.getSelection();\n const { line } = editor.current.getCursor();\n const contentLength = editor.current.getLine(line).length;\n\n if (textToEdit) {\n insertWithTextToEdit(editor, markdownType, line, contentLength, textToEdit);\n } else {\n insertWithoutTextToEdit(editor, markdownType, line, contentLength);\n }\n};\n","import { Button, IconButton, IconButtonComponent, IconButtonGroup } from '@strapi/design-system';\nimport { styled } from 'styled-components';\n\n// NAV BUTTONS\nexport const MainButtons = styled(IconButtonGroup)`\n margin-left: ${({ theme }) => theme.spaces[4]};\n`;\n\nexport const MoreButton = styled<IconButtonComponent>(IconButton)`\n margin: ${({ theme }) => `0 ${theme.spaces[2]}`};\n`;\n\n// NAV\n\nexport const IconButtonGroupMargin = styled(IconButtonGroup)`\n margin-right: ${({ theme }) => `${theme.spaces[2]}`};\n`;\n\n// FOOTER\nexport const ExpandButton = styled(Button)`\n background-color: transparent;\n border: none;\n align-items: center;\n\n & > span {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n }\n\n svg {\n margin-left: ${({ theme }) => `${theme.spaces[2]}`};\n path {\n fill: ${({ theme }) => theme.colors.neutral700};\n width: 1.2rem;\n height: 1.2rem;\n }\n }\n`;\n","import { ButtonProps, Box, Flex, Typography } from '@strapi/design-system';\nimport { Expand } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport { ExpandButton } from './WysiwygStyles';\n\ninterface WysiwygFooterProps {\n onToggleExpand: ButtonProps['onClick'];\n}\n\nconst WysiwygFooter = ({ onToggleExpand }: WysiwygFooterProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <Box padding={2} background=\"neutral100\" borderRadius={`0 0 0.4rem 0.4rem`}>\n <Flex justifyContent=\"flex-end\" alignItems=\"flex-end\">\n <ExpandButton id=\"expand\" onClick={onToggleExpand} variant=\"tertiary\" size=\"M\">\n <Typography textColor=\"neutral800\">\n {formatMessage({\n id: 'components.WysiwygBottomControls.fullscreen',\n defaultMessage: 'Expand',\n })}\n </Typography>\n <Expand />\n </ExpandButton>\n </Flex>\n </Box>\n );\n};\n\nexport { WysiwygFooter };\nexport type { WysiwygFooterProps };\n","import * as React from 'react';\n\nimport {\n Button,\n Flex,\n IconButton,\n IconButtonGroup,\n SingleSelectOption,\n Popover,\n SingleSelect,\n Field,\n} from '@strapi/design-system';\nimport {\n Bold,\n BulletList,\n Code,\n Italic,\n Link,\n More,\n NumberList,\n Image,\n Quotes,\n StrikeThrough,\n Underline,\n} from '@strapi/icons';\nimport { EditorFromTextArea } from 'codemirror5';\nimport { useIntl } from 'react-intl';\n\nimport { IconButtonGroupMargin, MainButtons, MoreButton } from './WysiwygStyles';\n\ninterface WysiwygNavProps {\n disabled?: boolean;\n editorRef: React.MutableRefObject<EditorFromTextArea>;\n isExpandMode?: boolean;\n isPreviewMode?: boolean;\n onActionClick: (\n action: string,\n editorRef: React.MutableRefObject<EditorFromTextArea>,\n callback?: () => void\n ) => void;\n onToggleMediaLib: () => void;\n onTogglePreviewMode?: () => void;\n}\n\n/**\n * TODO: refactor this mess.\n */\nconst WysiwygNav = ({\n disabled,\n editorRef,\n isExpandMode,\n isPreviewMode,\n onActionClick,\n onToggleMediaLib,\n onTogglePreviewMode,\n}: WysiwygNavProps) => {\n const [visiblePopover, setVisiblePopover] = React.useState(false);\n const { formatMessage } = useIntl();\n const selectPlaceholder = formatMessage({\n id: 'components.Wysiwyg.selectOptions.title',\n defaultMessage: 'Add a title',\n });\n const buttonMoreRef = React.useRef<HTMLButtonElement>(null!);\n\n const handleTogglePopover = () => {\n setVisiblePopover((prev) => !prev);\n };\n\n if (disabled || isPreviewMode) {\n return (\n <Flex\n padding={2}\n background=\"neutral100\"\n justifyContent=\"space-between\"\n borderRadius={`0.4rem 0.4rem 0 0`}\n >\n <Flex>\n <Field.Root>\n <SingleSelect\n disabled\n placeholder={selectPlaceholder}\n aria-label={selectPlaceholder}\n size=\"S\"\n >\n <SingleSelectOption value=\"h1\">h1</SingleSelectOption>\n <SingleSelectOption value=\"h2\">h2</SingleSelectOption>\n <SingleSelectOption value=\"h3\">h3</SingleSelectOption>\n <SingleSelectOption value=\"h4\">h4</SingleSelectOption>\n <SingleSelectOption value=\"h5\">h5</SingleSelectOption>\n <SingleSelectOption value=\"h6\">h6</SingleSelectOption>\n </SingleSelect>\n </Field.Root>\n\n <MainButtons>\n <IconButton disabled label=\"Bold\" name=\"Bold\">\n <Bold />\n </IconButton>\n <IconButton disabled label=\"Italic\" name=\"Italic\">\n <Italic />\n </IconButton>\n <IconButton disabled label=\"Underline\" name=\"Underline\">\n <Underline />\n </IconButton>\n </MainButtons>\n\n <MoreButton disabled label=\"More\">\n <More />\n </MoreButton>\n </Flex>\n\n {!isExpandMode && (\n <Button onClick={onTogglePreviewMode} variant=\"tertiary\">\n {formatMessage({\n id: 'components.Wysiwyg.ToggleMode.markdown-mode',\n defaultMessage: 'Markdown mode',\n })}\n </Button>\n )}\n </Flex>\n );\n }\n\n return (\n <Flex\n padding={2}\n background=\"neutral100\"\n justifyContent=\"space-between\"\n borderRadius={`0.4rem 0.4rem 0 0`}\n >\n <Flex>\n <Field.Root>\n <SingleSelect\n placeholder={selectPlaceholder}\n aria-label={selectPlaceholder}\n // @ts-expect-error – DS v2 will only allow strings.\n onChange={(value) => onActionClick(value, editorRef)}\n size=\"S\"\n >\n <SingleSelectOption value=\"h1\">h1</SingleSelectOption>\n <SingleSelectOption value=\"h2\">h2</SingleSelectOption>\n <SingleSelectOption value=\"h3\">h3</SingleSelectOption>\n <SingleSelectOption value=\"h4\">h4</SingleSelectOption>\n <SingleSelectOption value=\"h5\">h5</SingleSelectOption>\n <SingleSelectOption value=\"h6\">h6</SingleSelectOption>\n </SingleSelect>\n </Field.Root>\n\n <MainButtons>\n <IconButton onClick={() => onActionClick('Bold', editorRef)} label=\"Bold\" name=\"Bold\">\n <Bold />\n </IconButton>\n <IconButton\n onClick={() => onActionClick('Italic', editorRef)}\n label=\"Italic\"\n name=\"Italic\"\n >\n <Italic />\n </IconButton>\n <IconButton\n onClick={() => onActionClick('Underline', editorRef)}\n label=\"Underline\"\n name=\"Underline\"\n >\n <Underline />\n </IconButton>\n </MainButtons>\n <Popover.Root>\n <Popover.Trigger>\n <MoreButton label=\"More\">\n <More />\n </MoreButton>\n </Popover.Trigger>\n <Popover.Content sideOffset={12}>\n <Flex padding={2}>\n <IconButtonGroupMargin>\n <IconButton\n onClick={() => onActionClick('Strikethrough', editorRef, handleTogglePopover)}\n label=\"Strikethrough\"\n name=\"Strikethrough\"\n >\n <StrikeThrough />\n </IconButton>\n <IconButton\n onClick={() => onActionClick('BulletList', editorRef, handleTogglePopover)}\n label=\"BulletList\"\n name=\"BulletList\"\n >\n <BulletList />\n </IconButton>\n <IconButton\n onClick={() => onActionClick('NumberList', editorRef, handleTogglePopover)}\n label=\"NumberList\"\n name=\"NumberList\"\n >\n <NumberList />\n </IconButton>\n </IconButtonGroupMargin>\n <IconButtonGroup>\n <IconButton\n onClick={() => onActionClick('Code', editorRef, handleTogglePopover)}\n label=\"Code\"\n name=\"Code\"\n >\n <Code />\n </IconButton>\n <IconButton\n onClick={() => {\n handleTogglePopover();\n onToggleMediaLib();\n }}\n label=\"Image\"\n name=\"Image\"\n >\n <Image />\n </IconButton>\n <IconButton\n onClick={() => onActionClick('Link', editorRef, handleTogglePopover)}\n label=\"Link\"\n name=\"Link\"\n >\n <Link />\n </IconButton>\n <IconButton\n onClick={() => onActionClick('Quote', editorRef, handleTogglePopover)}\n label=\"Quote\"\n name=\"Quote\"\n >\n <Quotes />\n </IconButton>\n </IconButtonGroup>\n </Flex>\n </Popover.Content>\n </Popover.Root>\n </Flex>\n\n {onTogglePreviewMode && (\n <Button onClick={onTogglePreviewMode} variant=\"tertiary\">\n {formatMessage({\n id: 'components.Wysiwyg.ToggleMode.preview-mode',\n defaultMessage: 'Preview mode',\n })}\n </Button>\n )}\n </Flex>\n );\n};\n\nexport { WysiwygNav };\nexport type { WysiwygNavProps };\n","import * as React from 'react';\n\nimport { useField, useStrapiApp, type InputProps } from '@strapi/admin/strapi-admin';\nimport { Field, Flex } from '@strapi/design-system';\nimport { EditorFromTextArea } from 'codemirror5';\n\nimport { prefixFileUrlWithBackendUrl } from '../../../../../utils/urls';\n\nimport { Editor, EditorApi } from './Editor';\nimport { EditorLayout } from './EditorLayout';\nimport {\n insertFile,\n listHandler,\n markdownHandler,\n quoteAndCodeHandler,\n titleHandler,\n} from './utils/utils';\nimport { WysiwygFooter } from './WysiwygFooter';\nimport { WysiwygNav } from './WysiwygNav';\n\nimport type { Schema } from '@strapi/types';\n\ninterface WysiwygProps extends Omit<InputProps, 'type'> {\n labelAction?: React.ReactNode;\n type: Schema.Attribute.RichText['type'];\n}\n\nconst Wysiwyg = React.forwardRef<EditorApi, WysiwygProps>(\n ({ hint, disabled, label, name, placeholder, required, labelAction }, forwardedRef) => {\n const field = useField(name);\n const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n const editorRef = React.useRef<EditorFromTextArea>(\n null\n ) as React.MutableRefObject<EditorFromTextArea>;\n const [isPreviewMode, setIsPreviewMode] = React.useState(false);\n const [mediaLibVisible, setMediaLibVisible] = React.useState(false);\n const [isExpandMode, setIsExpandMode] = React.useState(false);\n const components = useStrapiApp('ImageDialog', (state) => state.components);\n\n const MediaLibraryDialog = components['media-library'];\n\n const handleToggleMediaLib = () => setMediaLibVisible((prev) => !prev);\n const handleTogglePreviewMode = () => setIsPreviewMode((prev) => !prev);\n const handleToggleExpand = () => {\n setIsPreviewMode(false);\n setIsExpandMode((prev) => !prev);\n };\n\n const handleActionClick = (\n value: string,\n currentEditorRef: React.MutableRefObject<EditorFromTextArea>,\n togglePopover?: () => void\n ) => {\n switch (value) {\n case 'Link':\n case 'Strikethrough': {\n markdownHandler(currentEditorRef, value);\n togglePopover?.();\n break;\n }\n case 'Code':\n case 'Quote': {\n quoteAndCodeHandler(currentEditorRef, value);\n togglePopover?.();\n break;\n }\n case 'Bold':\n case 'Italic':\n case 'Underline': {\n markdownHandler(currentEditorRef, value);\n break;\n }\n case 'BulletList':\n case 'NumberList': {\n listHandler(currentEditorRef, value);\n togglePopover?.();\n break;\n }\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6': {\n titleHandler(currentEditorRef, value);\n break;\n }\n default: {\n // Nothing\n }\n }\n };\n\n const handleSelectAssets = (files: any[]) => {\n const formattedFiles = files.map((f) => ({\n alt: f.alternativeText || f.name,\n url: prefixFileUrlWithBackendUrl(f.url),\n mime: f.mime,\n }));\n\n insertFile(editorRef, formattedFiles);\n setMediaLibVisible(false);\n };\n\n return (\n <Field.Root name={name} hint={hint} error={field.error} required={required}>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1}>\n <Field.Label action={labelAction}>{label}</Field.Label>\n <EditorLayout\n isExpandMode={isExpandMode}\n error={field.error}\n previewContent={field.value}\n onCollapse={handleToggleExpand}\n >\n <WysiwygNav\n isExpandMode={isExpandMode}\n editorRef={editorRef}\n isPreviewMode={isPreviewMode}\n onActionClick={handleActionClick}\n onToggleMediaLib={handleToggleMediaLib}\n onTogglePreviewMode={isExpandMode ? undefined : handleTogglePreviewMode}\n disabled={disabled}\n />\n\n <Editor\n disabled={disabled}\n isExpandMode={isExpandMode}\n editorRef={editorRef}\n error={field.error}\n isPreviewMode={isPreviewMode}\n name={name}\n onChange={field.onChange}\n placeholder={placeholder}\n textareaRef={textareaRef}\n value={field.value}\n ref={forwardedRef}\n />\n\n {!isExpandMode && <WysiwygFooter onToggleExpand={handleToggleExpand} />}\n </EditorLayout>\n <Field.Hint />\n <Field.Error />\n </Flex>\n {mediaLibVisible && (\n // @ts-expect-error – TODO: fix this way of injecting because it's not really typeable without a registry.\n <MediaLibraryDialog onClose={handleToggleMediaLib} onSelectAssets={handleSelectAssets} />\n )}\n </Field.Root>\n );\n }\n);\n\nconst MemoizedWysiwyg = React.memo(Wysiwyg);\n\nexport { MemoizedWysiwyg as Wysiwyg };\nexport type { WysiwygProps };\n","import { ReactNode, memo } from 'react';\n\nimport {\n useStrapiApp,\n useForm,\n InputRenderer as FormInputRenderer,\n useField,\n} from '@strapi/admin/strapi-admin';\nimport { useIntl } from 'react-intl';\n\nimport { SINGLE_TYPES } from '../../../constants/collections';\nimport { useDocumentRBAC } from '../../../features/DocumentRBAC';\nimport { useDoc } from '../../../hooks/useDocument';\nimport { useDocLayout } from '../../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../../hooks/useLazyComponents';\n\nimport { BlocksInput } from './FormInputs/BlocksInput/BlocksInput';\nimport { ComponentInput } from './FormInputs/Component/Input';\nimport { DynamicZone, useDynamicZone } from './FormInputs/DynamicZone/Field';\nimport { NotAllowedInput } from './FormInputs/NotAllowed';\nimport { RelationsInput } from './FormInputs/Relations';\nimport { UIDInput } from './FormInputs/UID';\nimport { Wysiwyg } from './FormInputs/Wysiwyg/Field';\n\nimport type { EditFieldLayout } from '../../../hooks/useDocumentLayout';\nimport type { Schema } from '@strapi/types';\nimport type { DistributiveOmit } from 'react-redux';\n\ntype InputRendererProps = DistributiveOmit<EditFieldLayout, 'size'>;\n/**\n * @internal\n *\n * @description An abstraction around the regular form input renderer designed\n * specifically to be used in the EditView of the content-manager this understands\n * the complete EditFieldLayout and will handle RBAC conditions and rendering CM specific\n * components such as Blocks / Relations.\n */\nconst InputRenderer = ({ visible, hint: providedHint, ...props }: InputRendererProps) => {\n const { id, document, collectionType } = useDoc();\n const isFormDisabled = useForm('InputRenderer', (state) => state.disabled);\n\n const isInDynamicZone = useDynamicZone('isInDynamicZone', (state) => state.isInDynamicZone);\n\n const canCreateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canCreateFields);\n const canReadFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canReadFields);\n const canUpdateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUpdateFields);\n const canUserAction = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUserAction);\n\n let idToCheck = id;\n if (collectionType === SINGLE_TYPES) {\n idToCheck = document?.documentId;\n }\n\n const editableFields = idToCheck ? canUpdateFields : canCreateFields;\n const readableFields = idToCheck ? canReadFields : canCreateFields;\n\n /**\n * Component fields are always readable and editable,\n * however the fields within them may not be.\n */\n const canUserReadField = canUserAction(props.name, readableFields, props.type);\n const canUserEditField = canUserAction(props.name, editableFields, props.type);\n\n const fields = useStrapiApp('InputRenderer', (app) => app.fields);\n const { lazyComponentStore } = useLazyComponents(\n attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : undefined\n );\n\n const hint = useFieldHint(providedHint, props.attribute);\n const {\n edit: { components },\n } = useDocLayout();\n\n // We pass field in case of Custom Fields to keep backward compatibility\n const field = useField(props.name);\n\n if (!visible) {\n return null;\n }\n\n /**\n * If the user can't read the field then we don't want to ever render it.\n */\n if (!canUserReadField && !isInDynamicZone) {\n return <NotAllowedInput hint={hint} {...props} />;\n }\n\n const fieldIsDisabled =\n (!canUserEditField && !isInDynamicZone) || props.disabled || isFormDisabled;\n\n /**\n * Because a custom field has a unique prop but the type could be confused with either\n * the useField hook or the type of the field we need to handle it separately and first.\n */\n if (attributeHasCustomFieldProperty(props.attribute)) {\n const CustomInput = lazyComponentStore[props.attribute.customField];\n\n if (CustomInput) {\n // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.\n return <CustomInput {...props} {...field} hint={hint} disabled={fieldIsDisabled} />;\n }\n\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n // @ts-expect-error – this workaround lets us display that the custom field is missing.\n type={props.attribute.customField}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * This is where we handle ONLY the fields from the `useLibrary` hook.\n */\n const addedInputTypes = Object.keys(fields);\n if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {\n const CustomInput = fields[props.type];\n // @ts-expect-error – TODO: fix this type error in the useLibrary hook.\n return <CustomInput {...props} hint={hint} disabled={fieldIsDisabled} />;\n }\n\n /**\n * These include the content-manager specific fields, failing that we fall back\n * to the more generic form input renderer.\n */\n switch (props.type) {\n case 'blocks':\n return <BlocksInput {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n case 'component':\n return (\n <ComponentInput\n {...props}\n hint={hint}\n layout={components[props.attribute.component].layout}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <InputRenderer {...inputProps} />}\n </ComponentInput>\n );\n case 'dynamiczone':\n return <DynamicZone {...props} hint={hint} disabled={fieldIsDisabled} />;\n case 'relation':\n return <RelationsInput {...props} hint={hint} disabled={fieldIsDisabled} />;\n case 'richtext':\n return <Wysiwyg {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n case 'uid':\n return <UIDInput {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n /**\n * Enumerations are a special case because they require options.\n */\n case 'enumeration':\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n options={props.attribute.enum.map((value) => ({ value }))}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n default:\n // These props are not needed for the generic form input renderer.\n const { unique: _unique, mainField: _mainField, ...restProps } = props;\n return (\n <FormInputRenderer\n {...restProps}\n hint={hint}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n }\n};\n\nconst attributeHasCustomFieldProperty = (\n attribute: Schema.Attribute.AnyAttribute\n): attribute is Schema.Attribute.AnyAttribute & Schema.Attribute.CustomField<string> =>\n 'customField' in attribute && typeof attribute.customField === 'string';\n\nconst useFieldHint = (hint: ReactNode = undefined, attribute: Schema.Attribute.AnyAttribute) => {\n const { formatMessage } = useIntl();\n\n const { maximum, minimum } = getMinMax(attribute);\n\n if (!maximum && !minimum) {\n return hint;\n }\n\n const units = !['biginteger', 'integer', 'number', 'dynamiczone', 'component'].includes(\n attribute.type\n )\n ? formatMessage(\n {\n id: 'content-manager.form.Input.hint.character.unit',\n defaultMessage: '{maxValue, plural, one { character} other { characters}}',\n },\n {\n maxValue: Math.max(minimum || 0, maximum || 0),\n }\n )\n : null;\n\n const hasMinAndMax = typeof minimum === 'number' && typeof maximum === 'number';\n\n return formatMessage(\n {\n id: 'content-manager.form.Input.hint.text',\n defaultMessage:\n '{min, select, undefined {} other {min. {min}}}{divider}{max, select, undefined {} other {max. {max}}}{unit}{br}{description}',\n },\n {\n min: minimum,\n max: maximum,\n description: hint,\n unit: units,\n divider: hasMinAndMax\n ? formatMessage({\n id: 'content-manager.form.Input.hint.minMaxDivider',\n defaultMessage: ' / ',\n })\n : null,\n br: <br />,\n }\n );\n};\n\nconst getMinMax = (attribute: Schema.Attribute.AnyAttribute) => {\n if ('min' in attribute || 'max' in attribute) {\n return {\n maximum: !Number.isNaN(Number(attribute.max)) ? Number(attribute.max) : undefined,\n minimum: !Number.isNaN(Number(attribute.min)) ? Number(attribute.min) : undefined,\n };\n } else if ('maxLength' in attribute || 'minLength' in attribute) {\n return { maximum: attribute.maxLength, minimum: attribute.minLength };\n } else {\n return { maximum: undefined, minimum: undefined };\n }\n};\n\nconst MemoizedInputRenderer = memo(InputRenderer);\n\nexport type { InputRendererProps };\nexport { MemoizedInputRenderer as InputRenderer, useFieldHint };\n","import * as React from 'react';\n\nimport { useForm, useField } from '@strapi/admin/strapi-admin';\nimport {\n Accordion,\n Box,\n Flex,\n Grid,\n IconButton,\n VisuallyHidden,\n useComposedRefs,\n Menu,\n MenuItem,\n BoxComponent,\n} from '@strapi/design-system';\nimport { Drag, More, Trash } from '@strapi/icons';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { COMPONENT_ICONS } from '../../../../../components/ComponentIcon';\nimport { ItemTypes } from '../../../../../constants/dragAndDrop';\nimport { useDocLayout } from '../../../../../hooks/useDocumentLayout';\nimport { type UseDragAndDropOptions, useDragAndDrop } from '../../../../../hooks/useDragAndDrop';\nimport { getIn } from '../../../../../utils/objects';\nimport { getTranslation } from '../../../../../utils/translations';\nimport { InputRenderer } from '../../InputRenderer';\n\nimport type { ComponentPickerProps } from './ComponentPicker';\n\ninterface DynamicComponentProps\n extends Pick<UseDragAndDropOptions, 'onGrabItem' | 'onDropItem' | 'onCancel'>,\n Pick<ComponentPickerProps, 'dynamicComponentsByCategory'> {\n componentUid: string;\n disabled?: boolean;\n index: number;\n name: string;\n onAddComponent: (componentUid: string, index: number) => void;\n onRemoveComponentClick: () => void;\n onMoveComponent: (dragIndex: number, hoverIndex: number) => void;\n}\n\nconst DynamicComponent = ({\n componentUid,\n disabled,\n index,\n name,\n onRemoveComponentClick,\n onMoveComponent,\n onGrabItem,\n onDropItem,\n onCancel,\n dynamicComponentsByCategory = {},\n onAddComponent,\n}: DynamicComponentProps) => {\n const { formatMessage } = useIntl();\n const formValues = useForm('DynamicComponent', (state) => state.values);\n const {\n edit: { components },\n } = useDocLayout();\n\n const title = React.useMemo(() => {\n const { mainField } = components[componentUid]?.settings ?? { mainField: 'id' };\n\n const mainFieldValue = getIn(formValues, `${name}.${index}.${mainField}`);\n\n const displayedValue =\n mainField === 'id' || !mainFieldValue ? '' : String(mainFieldValue).trim();\n\n const mainValue = displayedValue.length > 0 ? `- ${displayedValue}` : displayedValue;\n\n return mainValue;\n }, [componentUid, components, formValues, name, index]);\n\n const { icon, displayName } = React.useMemo(() => {\n const [category] = componentUid.split('.');\n const { icon, displayName } = (dynamicComponentsByCategory[category] ?? []).find(\n (component) => component.uid === componentUid\n ) ?? { icon: null, displayName: null };\n\n return { icon, displayName };\n }, [componentUid, dynamicComponentsByCategory]);\n\n const [{ handlerId, isDragging, handleKeyDown }, boxRef, dropRef, dragRef, dragPreviewRef] =\n useDragAndDrop(!disabled, {\n type: `${ItemTypes.DYNAMIC_ZONE}_${name}`,\n index,\n item: {\n index,\n displayedValue: `${displayName} ${title}`,\n icon,\n },\n onMoveItem: onMoveComponent,\n onDropItem,\n onGrabItem,\n onCancel,\n });\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage(), { captureDraggingState: false });\n }, [dragPreviewRef, index]);\n\n /**\n * We don't need the accordion's to communicate with each other,\n * so a unique value for their state is enough.\n */\n const accordionValue = React.useId();\n\n const { value = [], rawError } = useField(`${name}.${index}`);\n\n const [collapseToOpen, setCollapseToOpen] = React.useState<string>('');\n\n React.useEffect(() => {\n if (rawError && value) {\n setCollapseToOpen(accordionValue);\n }\n }, [rawError, value, accordionValue]);\n\n const composedBoxRefs = useComposedRefs(boxRef, dropRef);\n\n const accordionActions = disabled ? null : (\n <>\n <IconButton\n variant=\"ghost\"\n label={formatMessage(\n {\n id: getTranslation('components.DynamicZone.delete-label'),\n defaultMessage: 'Delete {name}',\n },\n { name: title }\n )}\n onClick={onRemoveComponentClick}\n >\n <Trash />\n </IconButton>\n <IconButton\n variant=\"ghost\"\n onClick={(e) => e.stopPropagation()}\n data-handler-id={handlerId}\n ref={dragRef}\n label={formatMessage({\n id: getTranslation('components.DragHandle-label'),\n defaultMessage: 'Drag',\n })}\n onKeyDown={handleKeyDown}\n >\n <Drag />\n </IconButton>\n <Menu.Root>\n <Menu.Trigger size=\"S\" endIcon={null} paddingLeft={2} paddingRight={2}>\n <More aria-hidden focusable={false} />\n <VisuallyHidden tag=\"span\">\n {formatMessage({\n id: getTranslation('components.DynamicZone.more-actions'),\n defaultMessage: 'More actions',\n })}\n </VisuallyHidden>\n </Menu.Trigger>\n <Menu.Content>\n <Menu.SubRoot>\n <Menu.SubTrigger>\n {formatMessage({\n id: getTranslation('components.DynamicZone.add-item-above'),\n defaultMessage: 'Add component above',\n })}\n </Menu.SubTrigger>\n <Menu.SubContent>\n {Object.entries(dynamicComponentsByCategory).map(([category, components]) => (\n <React.Fragment key={category}>\n <Menu.Label>{category}</Menu.Label>\n {components.map(({ displayName, uid }) => (\n <MenuItem key={componentUid} onSelect={() => onAddComponent(uid, index)}>\n {displayName}\n </MenuItem>\n ))}\n </React.Fragment>\n ))}\n </Menu.SubContent>\n </Menu.SubRoot>\n <Menu.SubRoot>\n <Menu.SubTrigger>\n {formatMessage({\n id: getTranslation('components.DynamicZone.add-item-below'),\n defaultMessage: 'Add component below',\n })}\n </Menu.SubTrigger>\n <Menu.SubContent>\n {Object.entries(dynamicComponentsByCategory).map(([category, components]) => (\n <React.Fragment key={category}>\n <Menu.Label>{category}</Menu.Label>\n {components.map(({ displayName, uid }) => (\n <MenuItem key={componentUid} onSelect={() => onAddComponent(uid, index + 1)}>\n {displayName}\n </MenuItem>\n ))}\n </React.Fragment>\n ))}\n </Menu.SubContent>\n </Menu.SubRoot>\n </Menu.Content>\n </Menu.Root>\n </>\n );\n\n const accordionTitle = title ? `${displayName} ${title}` : displayName;\n\n return (\n <ComponentContainer tag=\"li\" width=\"100%\">\n <Flex justifyContent=\"center\">\n <Rectangle background=\"neutral200\" />\n </Flex>\n <StyledBox ref={composedBoxRefs} hasRadius>\n {isDragging ? (\n <Preview />\n ) : (\n <Accordion.Root value={collapseToOpen} onValueChange={setCollapseToOpen}>\n <Accordion.Item value={accordionValue}>\n <Accordion.Header>\n <Accordion.Trigger\n icon={\n icon && COMPONENT_ICONS[icon]\n ? COMPONENT_ICONS[icon]\n : COMPONENT_ICONS.dashboard\n }\n >\n {accordionTitle}\n </Accordion.Trigger>\n <Accordion.Actions>{accordionActions}</Accordion.Actions>\n </Accordion.Header>\n <Accordion.Content>\n <AccordionContentRadius background=\"neutral0\">\n <Box paddingLeft={6} paddingRight={6} paddingTop={6} paddingBottom={6}>\n <Grid.Root gap={4}>\n {components[componentUid]?.layout?.map((row, rowInd) => (\n <Grid.Item\n col={12}\n key={rowInd}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <Grid.Root gap={4}>\n {row.map(({ size, ...field }) => {\n const fieldName = `${name}.${index}.${field.name}`;\n\n const fieldWithTranslatedLabel = {\n ...field,\n label: formatMessage({\n id: `content-manager.components.${componentUid}.${field.name}`,\n defaultMessage: field.label,\n }),\n };\n\n return (\n <Grid.Item\n col={size}\n key={fieldName}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <InputRenderer {...fieldWithTranslatedLabel} name={fieldName} />\n </Grid.Item>\n );\n })}\n </Grid.Root>\n </Grid.Item>\n ))}\n </Grid.Root>\n </Box>\n </AccordionContentRadius>\n </Accordion.Content>\n </Accordion.Item>\n </Accordion.Root>\n )}\n </StyledBox>\n </ComponentContainer>\n );\n};\n\n// TODO: Delete once https://github.com/strapi/design-system/pull/858\n// is merged and released.\nconst StyledBox = styled<BoxComponent>(Box)`\n > div:first-child {\n box-shadow: ${({ theme }) => theme.shadows.tableShadow};\n }\n`;\n\nconst AccordionContentRadius = styled<BoxComponent>(Box)`\n border-radius: 0 0 ${({ theme }) => theme.spaces[1]} ${({ theme }) => theme.spaces[1]};\n`;\n\nconst Rectangle = styled<BoxComponent>(Box)`\n width: ${({ theme }) => theme.spaces[2]};\n height: ${({ theme }) => theme.spaces[4]};\n`;\n\nconst Preview = styled.span`\n display: block;\n background-color: ${({ theme }) => theme.colors.primary100};\n outline: 1px dashed ${({ theme }) => theme.colors.primary500};\n outline-offset: -1px;\n padding: ${({ theme }) => theme.spaces[6]};\n`;\n\nconst ComponentContainer = styled<BoxComponent<'li'>>(Box)`\n list-style: none;\n padding: 0;\n margin: 0;\n`;\n\nexport { DynamicComponent };\nexport type { DynamicComponentProps };\n","import * as React from 'react';\n\nimport { Box, Flex, Typography } from '@strapi/design-system';\n\ninterface DynamicZoneLabelProps {\n label?: React.ReactNode;\n labelAction?: React.ReactNode;\n name: string;\n numberOfComponents?: number;\n required?: boolean;\n hint?: React.ReactNode;\n}\n\nconst DynamicZoneLabel = ({\n hint,\n label,\n labelAction,\n name,\n numberOfComponents = 0,\n required,\n}: DynamicZoneLabelProps) => {\n return (\n <Flex justifyContent=\"center\">\n <Box\n paddingTop={3}\n paddingBottom={3}\n paddingRight={4}\n paddingLeft={4}\n borderRadius=\"26px\"\n background=\"neutral0\"\n shadow=\"filterShadow\"\n color=\"neutral500\"\n >\n <Flex direction=\"column\" justifyContent=\"center\">\n <Flex maxWidth=\"35.6rem\">\n <Typography variant=\"pi\" textColor=\"neutral600\" fontWeight=\"bold\" ellipsis>\n {label || name} \n </Typography>\n <Typography variant=\"pi\" textColor=\"neutral600\" fontWeight=\"bold\">\n ({numberOfComponents})\n </Typography>\n {required && <Typography textColor=\"danger600\">*</Typography>}\n {labelAction && <Box paddingLeft={1}>{labelAction}</Box>}\n </Flex>\n {hint && (\n <Box paddingTop={1} maxWidth=\"35.6rem\">\n <Typography variant=\"pi\" textColor=\"neutral600\" ellipsis>\n {hint}\n </Typography>\n </Box>\n )}\n </Flex>\n </Box>\n </Flex>\n );\n};\n\nexport { DynamicZoneLabel };\nexport type { DynamicZoneLabelProps };\n","import * as React from 'react';\n\nimport {\n createContext,\n InputProps,\n useField,\n useForm,\n useNotification,\n} from '@strapi/admin/strapi-admin';\nimport { Box, Flex, VisuallyHidden } from '@strapi/design-system';\nimport pipe from 'lodash/fp/pipe';\nimport { useIntl } from 'react-intl';\n\nimport { useDoc } from '../../../../../hooks/useDocument';\nimport { type EditFieldLayout } from '../../../../../hooks/useDocumentLayout';\nimport { getTranslation } from '../../../../../utils/translations';\nimport { transformDocument } from '../../../utils/data';\nimport { createDefaultForm } from '../../../utils/forms';\nimport { ComponentProvider, useComponent } from '../ComponentContext';\n\nimport { AddComponentButton } from './AddComponentButton';\nimport { ComponentPicker } from './ComponentPicker';\nimport { DynamicComponent, DynamicComponentProps } from './DynamicComponent';\nimport { DynamicZoneLabel, DynamicZoneLabelProps } from './DynamicZoneLabel';\n\nimport type { Schema } from '@strapi/types';\n\ninterface DynamicZoneContextValue {\n isInDynamicZone: boolean;\n}\n\nconst [DynamicZoneProvider, useDynamicZone] = createContext<DynamicZoneContextValue>(\n 'DynamicZone',\n {\n isInDynamicZone: false,\n }\n);\n\ninterface DynamicZoneProps\n extends Omit<Extract<EditFieldLayout, { type: 'dynamiczone' }>, 'size' | 'hint'>,\n Pick<InputProps, 'hint'>,\n Pick<DynamicZoneLabelProps, 'labelAction'> {}\n\nconst DynamicZone = ({\n attribute,\n disabled: disabledProp,\n hint,\n label,\n labelAction,\n name,\n required = false,\n}: DynamicZoneProps) => {\n // We cannot use the default props here\n const { max = Infinity, min = -Infinity } = attribute ?? {};\n\n const [addComponentIsOpen, setAddComponentIsOpen] = React.useState(false);\n const [liveText, setLiveText] = React.useState('');\n const { components, isLoading } = useDoc();\n const disabled = disabledProp || isLoading;\n const { addFieldRow, removeFieldRow, moveFieldRow } = useForm(\n 'DynamicZone',\n ({ addFieldRow, removeFieldRow, moveFieldRow }) => ({\n addFieldRow,\n removeFieldRow,\n moveFieldRow,\n })\n );\n\n type DzWithTempKey =\n Schema.Attribute.GetDynamicZoneValue<Schema.Attribute.DynamicZone>[number] & {\n __temp_key__: number;\n };\n\n const { value = [], error } = useField<Array<DzWithTempKey>>(name);\n\n const dynamicComponentsByCategory = React.useMemo(() => {\n return attribute.components.reduce<\n NonNullable<DynamicComponentProps['dynamicComponentsByCategory']>\n >((acc, componentUid) => {\n const { category, info } = components[componentUid] ?? { info: {} };\n\n const component = { uid: componentUid, displayName: info.displayName, icon: info.icon };\n\n if (!acc[category]) {\n acc[category] = [];\n }\n\n acc[category] = [...acc[category], component];\n\n return acc;\n }, {});\n }, [attribute.components, components]);\n\n const { formatMessage } = useIntl();\n\n const { toggleNotification } = useNotification();\n\n const dynamicDisplayedComponentsLength = value.length;\n\n const handleAddComponent = (uid: string, position?: number) => {\n setAddComponentIsOpen(false);\n\n const schema = components[uid];\n const form = createDefaultForm(schema, components);\n const transformations = pipe(transformDocument(schema, components), (data) => ({\n ...data,\n __component: uid,\n }));\n\n const data = transformations(form);\n\n addFieldRow(name, data, position);\n };\n\n const handleClickOpenPicker = () => {\n if (dynamicDisplayedComponentsLength < max) {\n setAddComponentIsOpen((prev) => !prev);\n } else {\n toggleNotification({\n type: 'info',\n message: formatMessage({\n id: getTranslation('components.notification.info.maximum-requirement'),\n }),\n });\n }\n };\n\n const handleMoveComponent = (newIndex: number, currentIndex: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.reorder'),\n defaultMessage: '{item}, moved. New position in list: {position}.',\n },\n {\n item: `${name}.${currentIndex}`,\n position: getItemPos(newIndex),\n }\n )\n );\n\n moveFieldRow(name, currentIndex, newIndex);\n };\n\n const getItemPos = (index: number) => `${index + 1} of ${value.length}`;\n\n const handleCancel = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.cancel-item'),\n defaultMessage: '{item}, dropped. Re-order cancelled.',\n },\n {\n item: `${name}.${index}`,\n }\n )\n );\n };\n\n const handleGrabItem = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.grab-item'),\n defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`,\n },\n {\n item: `${name}.${index}`,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleDropItem = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.drop-item'),\n defaultMessage: `{item}, dropped. Final position in list: {position}.`,\n },\n {\n item: `${name}.${index}`,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleRemoveComponent = (name: string, currentIndex: number) => () => {\n removeFieldRow(name, currentIndex);\n };\n\n const hasError = error !== undefined;\n\n const renderButtonLabel = () => {\n if (addComponentIsOpen) {\n return formatMessage({ id: 'app.utils.close-label', defaultMessage: 'Close' });\n }\n\n if (hasError && dynamicDisplayedComponentsLength > max) {\n return formatMessage(\n {\n id: getTranslation(`components.DynamicZone.extra-components`),\n defaultMessage:\n 'There {number, plural, =0 {are # extra components} one {is # extra component} other {are # extra components}}',\n },\n {\n number: dynamicDisplayedComponentsLength - max,\n }\n );\n }\n\n if (hasError && dynamicDisplayedComponentsLength < min) {\n return formatMessage(\n {\n id: getTranslation(`components.DynamicZone.missing-components`),\n defaultMessage:\n 'There {number, plural, =0 {are # missing components} one {is # missing component} other {are # missing components}}',\n },\n { number: min - dynamicDisplayedComponentsLength }\n );\n }\n\n return formatMessage(\n {\n id: getTranslation('components.DynamicZone.add-component'),\n defaultMessage: 'Add a component to {componentName}',\n },\n { componentName: label || name }\n );\n };\n\n const level = useComponent('DynamicZone', (state) => state.level);\n\n const ariaDescriptionId = React.useId();\n\n return (\n <DynamicZoneProvider isInDynamicZone>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {dynamicDisplayedComponentsLength > 0 && (\n <Box>\n <DynamicZoneLabel\n hint={hint}\n label={label}\n labelAction={labelAction}\n name={name}\n numberOfComponents={dynamicDisplayedComponentsLength}\n required={required}\n />\n <VisuallyHidden id={ariaDescriptionId}>\n {formatMessage({\n id: getTranslation('dnd.instructions'),\n defaultMessage: `Press spacebar to grab and re-order`,\n })}\n </VisuallyHidden>\n <VisuallyHidden aria-live=\"assertive\">{liveText}</VisuallyHidden>\n <ol aria-describedby={ariaDescriptionId}>\n {value.map((field, index) => (\n <ComponentProvider\n key={field.__temp_key__}\n level={level + 1}\n uid={field.__component}\n // id is always a number in a dynamic zone.\n id={field.id as number}\n type=\"dynamiczone\"\n >\n <DynamicComponent\n disabled={disabled}\n name={name}\n index={index}\n componentUid={field.__component}\n onMoveComponent={handleMoveComponent}\n onRemoveComponentClick={handleRemoveComponent(name, index)}\n onCancel={handleCancel}\n onDropItem={handleDropItem}\n onGrabItem={handleGrabItem}\n onAddComponent={handleAddComponent}\n dynamicComponentsByCategory={dynamicComponentsByCategory}\n />\n </ComponentProvider>\n ))}\n </ol>\n </Box>\n )}\n <Flex justifyContent=\"center\">\n <AddComponentButton\n hasError={hasError}\n isDisabled={disabled}\n isOpen={addComponentIsOpen}\n onClick={handleClickOpenPicker}\n >\n {renderButtonLabel()}\n </AddComponentButton>\n </Flex>\n <ComponentPicker\n dynamicComponentsByCategory={dynamicComponentsByCategory}\n isOpen={addComponentIsOpen}\n onClickAddComponent={handleAddComponent}\n />\n </Flex>\n </DynamicZoneProvider>\n );\n};\n\nexport { DynamicZone, useDynamicZone };\nexport type { DynamicZoneProps };\n"],"names":["document","pipe","Editor","isText","node","Picture","SlateElement","isListNode","name","format","Link","modifiers","Wrapper","block","editor","ExpandWrapper","EditorLayout","insertText","Grid","value","collapseToOpen","index","Preview","ExpandButton","Image","FormInputRenderer","BlocksInput","ComponentInput","RelationsInput","Wysiwyg","UIDInput","icon","displayName","components","InputRenderer","addFieldRow","removeFieldRow","moveFieldRow","data"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,4BAA4B,CAAC,eAAe,cAAc;AAahE,MAAM,eACJ,CAAC,WAAsB,cACvB,CAA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