@strapi/content-manager 0.0.0-experimental.baa6cf22298e591b4d52d8e59c60406d7a9f137f → 0.0.0-experimental.d954d57341a6623992a0d211daaec8e245c3517d

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.
Files changed (92) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-DiigqkCf.js → ComponentConfigurationPage-WRPUXGd6.js} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-DiigqkCf.js.map → ComponentConfigurationPage-WRPUXGd6.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-CYqQv0ne.mjs → ComponentConfigurationPage-gdUj_t-O.mjs} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-CYqQv0ne.mjs.map → ComponentConfigurationPage-gdUj_t-O.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-BArY-b8_.mjs → EditConfigurationPage-BwuIPOJG.mjs} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-BArY-b8_.mjs.map → EditConfigurationPage-BwuIPOJG.mjs.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-BeeGw2RI.js → EditConfigurationPage-C1vjMBgy.js} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-BeeGw2RI.js.map → EditConfigurationPage-C1vjMBgy.js.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-B8ETGsFo.mjs → EditViewPage-0MiFkXa8.mjs} +46 -46
  10. package/dist/_chunks/EditViewPage-0MiFkXa8.mjs.map +1 -0
  11. package/dist/_chunks/{EditViewPage-DZPDqo_G.js → EditViewPage-DbcGfyqK.js} +45 -45
  12. package/dist/_chunks/EditViewPage-DbcGfyqK.js.map +1 -0
  13. package/dist/_chunks/{Field-Dn4ThnFB.mjs → Field-BDMSCcy5.mjs} +104 -116
  14. package/dist/_chunks/Field-BDMSCcy5.mjs.map +1 -0
  15. package/dist/_chunks/{Field-DnJMS8cB.js → Field-BG1xu38N.js} +103 -115
  16. package/dist/_chunks/Field-BG1xu38N.js.map +1 -0
  17. package/dist/_chunks/{Form-DiTmWq2k.js → Form-9BnFyUjy.js} +21 -25
  18. package/dist/_chunks/Form-9BnFyUjy.js.map +1 -0
  19. package/dist/_chunks/{Form-DY721B6y.mjs → Form-CPVWavB8.mjs} +23 -27
  20. package/dist/_chunks/Form-CPVWavB8.mjs.map +1 -0
  21. package/dist/_chunks/{History-CwWN_uNp.mjs → History-BVpd8LP3.mjs} +101 -22
  22. package/dist/_chunks/History-BVpd8LP3.mjs.map +1 -0
  23. package/dist/_chunks/{History-DShoVAh0.js → History-BWWxLt2Z.js} +100 -21
  24. package/dist/_chunks/History-BWWxLt2Z.js.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-COIRGF5b.js → ListConfigurationPage-6swzjdAZ.js} +42 -43
  26. package/dist/_chunks/ListConfigurationPage-6swzjdAZ.js.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-D062TiTL.mjs → ListConfigurationPage-DozVMKcR.mjs} +43 -45
  28. package/dist/_chunks/ListConfigurationPage-DozVMKcR.mjs.map +1 -0
  29. package/dist/_chunks/{ListViewPage-CFuXPZ_r.js → ListViewPage-BlzfjS2Q.js} +60 -65
  30. package/dist/_chunks/ListViewPage-BlzfjS2Q.js.map +1 -0
  31. package/dist/_chunks/{ListViewPage-BeHTsIr5.mjs → ListViewPage-Ds0ulgfG.mjs} +62 -67
  32. package/dist/_chunks/ListViewPage-Ds0ulgfG.mjs.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-B_KLijrG.mjs → NoContentTypePage-BH11kaKt.mjs} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-B_KLijrG.mjs.map → NoContentTypePage-BH11kaKt.mjs.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-rdH0Zp0A.js → NoContentTypePage-D2nCCWEl.js} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-rdH0Zp0A.js.map → NoContentTypePage-D2nCCWEl.js.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-BPU-v48V.mjs → NoPermissionsPage-BT2Tn0D_.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-BPU-v48V.mjs.map → NoPermissionsPage-BT2Tn0D_.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-D8gbX1Y_.js → NoPermissionsPage-DN_JlsU2.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-D8gbX1Y_.js.map → NoPermissionsPage-DN_JlsU2.js.map} +1 -1
  41. package/dist/_chunks/{Relations-wHyjWWT5.js → Relations-CcgFTcWo.js} +3 -3
  42. package/dist/_chunks/{Relations-wHyjWWT5.js.map → Relations-CcgFTcWo.js.map} +1 -1
  43. package/dist/_chunks/{Relations-Bbz90ZWv.mjs → Relations-Dnag3fhV.mjs} +3 -3
  44. package/dist/_chunks/{Relations-Bbz90ZWv.mjs.map → Relations-Dnag3fhV.mjs.map} +1 -1
  45. package/dist/_chunks/{en-Dzv55oQw.mjs → en-Ux26r5pl.mjs} +4 -1
  46. package/dist/_chunks/{en-Dzv55oQw.mjs.map → en-Ux26r5pl.mjs.map} +1 -1
  47. package/dist/_chunks/{en-BN1bvFK7.js → en-fbKQxLGn.js} +4 -1
  48. package/dist/_chunks/{en-BN1bvFK7.js.map → en-fbKQxLGn.js.map} +1 -1
  49. package/dist/_chunks/{index-BRHpg0az.js → index-CWpLBSt0.js} +120 -283
  50. package/dist/_chunks/index-CWpLBSt0.js.map +1 -0
  51. package/dist/_chunks/{index-Dv4oDn11.mjs → index-JNNNKUHs.mjs} +136 -299
  52. package/dist/_chunks/index-JNNNKUHs.mjs.map +1 -0
  53. package/dist/_chunks/{layout-pZc2Q3bK.js → layout--iHdZzRk.js} +17 -12
  54. package/dist/_chunks/layout--iHdZzRk.js.map +1 -0
  55. package/dist/_chunks/{layout-hInnLBbA.mjs → layout-DC503LnF.mjs} +17 -12
  56. package/dist/_chunks/layout-DC503LnF.mjs.map +1 -0
  57. package/dist/_chunks/{relations-CVE30dYt.js → relations-BbHizA5K.js} +2 -2
  58. package/dist/_chunks/{relations-CVE30dYt.js.map → relations-BbHizA5K.js.map} +1 -1
  59. package/dist/_chunks/{relations-BcPI8XhI.mjs → relations-CTje5t-a.mjs} +2 -2
  60. package/dist/_chunks/{relations-BcPI8XhI.mjs.map → relations-CTje5t-a.mjs.map} +1 -1
  61. package/dist/admin/index.js +1 -1
  62. package/dist/admin/index.mjs +5 -5
  63. package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
  64. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +7 -3
  65. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +2 -10
  66. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  67. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  68. package/dist/server/index.js +18 -11
  69. package/dist/server/index.js.map +1 -1
  70. package/dist/server/index.mjs +18 -11
  71. package/dist/server/index.mjs.map +1 -1
  72. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  73. package/dist/server/src/controllers/single-types.d.ts.map +1 -1
  74. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  75. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  76. package/package.json +8 -8
  77. package/dist/_chunks/EditViewPage-B8ETGsFo.mjs.map +0 -1
  78. package/dist/_chunks/EditViewPage-DZPDqo_G.js.map +0 -1
  79. package/dist/_chunks/Field-Dn4ThnFB.mjs.map +0 -1
  80. package/dist/_chunks/Field-DnJMS8cB.js.map +0 -1
  81. package/dist/_chunks/Form-DY721B6y.mjs.map +0 -1
  82. package/dist/_chunks/Form-DiTmWq2k.js.map +0 -1
  83. package/dist/_chunks/History-CwWN_uNp.mjs.map +0 -1
  84. package/dist/_chunks/History-DShoVAh0.js.map +0 -1
  85. package/dist/_chunks/ListConfigurationPage-COIRGF5b.js.map +0 -1
  86. package/dist/_chunks/ListConfigurationPage-D062TiTL.mjs.map +0 -1
  87. package/dist/_chunks/ListViewPage-BeHTsIr5.mjs.map +0 -1
  88. package/dist/_chunks/ListViewPage-CFuXPZ_r.js.map +0 -1
  89. package/dist/_chunks/index-BRHpg0az.js.map +0 -1
  90. package/dist/_chunks/index-Dv4oDn11.mjs.map +0 -1
  91. package/dist/_chunks/layout-hInnLBbA.mjs.map +0 -1
  92. package/dist/_chunks/layout-pZc2Q3bK.js.map +0 -1
@@ -7,8 +7,8 @@ const designSystem = require("@strapi/design-system");
7
7
  const reactIntl = require("react-intl");
8
8
  const reactRouterDom = require("react-router-dom");
9
9
  const styledComponents = require("styled-components");
10
- const index = require("./index-BRHpg0az.js");
11
- const Field = require("./Field-DnJMS8cB.js");
10
+ const index = require("./index-CWpLBSt0.js");
11
+ const Field = require("./Field-BG1xu38N.js");
12
12
  function _interopNamespace(e) {
13
13
  if (e && e.__esModule)
14
14
  return e;
@@ -35,7 +35,7 @@ const FormLayout = ({ layout }) => {
35
35
  if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
36
36
  const [row] = panel;
37
37
  const [field] = row;
38
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedInputRenderer, { ...field }) }) }, field.name);
38
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedInputRenderer, { ...field }) }) }, field.name);
39
39
  }
40
40
  return /* @__PURE__ */ jsxRuntime.jsx(
41
41
  designSystem.Box,
@@ -48,8 +48,8 @@ const FormLayout = ({ layout }) => {
48
48
  paddingTop: 6,
49
49
  paddingBottom: 6,
50
50
  borderColor: "neutral150",
51
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: row.map(({ size, ...field }) => {
52
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedInputRenderer, { ...field }) }, field.name);
51
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
52
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedInputRenderer, { ...field }) }, field.name);
53
53
  }) }, gridRowIndex)) })
54
54
  },
55
55
  index2
@@ -63,10 +63,11 @@ const EditViewPage = () => {
63
63
  query: { status }
64
64
  },
65
65
  setQuery
66
- ] = strapiAdmin.useQueryParams();
66
+ ] = strapiAdmin.useQueryParams({
67
+ status: "draft"
68
+ });
67
69
  const { formatMessage } = reactIntl.useIntl();
68
70
  const { toggleNotification } = strapiAdmin.useNotification();
69
- const tabApi = React__namespace.useRef(null);
70
71
  const {
71
72
  document,
72
73
  meta,
@@ -112,11 +113,9 @@ const EditViewPage = () => {
112
113
  if (!initialValues) {
113
114
  return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
114
115
  }
115
- const handleTabChange = (index2) => {
116
- if (index2 === 0) {
117
- setQuery({ status: "draft" }, "push", true);
118
- } else {
119
- setQuery({ status: "published" }, "push", true);
116
+ const handleTabChange = (status2) => {
117
+ if (status2 === "published" || status2 === "draft") {
118
+ setQuery({ status: status2 }, "push", true);
120
119
  }
121
120
  };
122
121
  const documentTitle = mainField !== "id" && document?.[mainField] ? document[mainField] : "Untitled";
@@ -138,40 +137,41 @@ const EditViewPage = () => {
138
137
  title: documentTitle
139
138
  }
140
139
  ),
141
- /* @__PURE__ */ jsxRuntime.jsxs(
142
- designSystem.TabGroup,
143
- {
144
- ref: tabApi,
145
- variant: "simple",
146
- label: formatMessage({
147
- id: index.getTranslation("containers.edit.tabs.label"),
148
- defaultMessage: "Document status"
149
- }),
150
- selectedTabIndex: hasDraftAndPublished && status === "published" ? 1 : 0,
151
- onTabChange: (index2) => {
152
- handleTabChange(index2);
153
- },
154
- children: [
155
- hasDraftAndPublished ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs, { children: [
156
- /* @__PURE__ */ jsxRuntime.jsx(StatusTab, { children: formatMessage({
140
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs.Root, { variant: "simple", value: status, onValueChange: handleTabChange, children: [
141
+ /* @__PURE__ */ jsxRuntime.jsx(
142
+ designSystem.Tabs.List,
143
+ {
144
+ "aria-label": formatMessage({
145
+ id: index.getTranslation("containers.edit.tabs.label"),
146
+ defaultMessage: "Document status"
147
+ }),
148
+ children: hasDraftAndPublished ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
149
+ /* @__PURE__ */ jsxRuntime.jsx(StatusTab, { value: "draft", children: formatMessage({
157
150
  id: index.getTranslation("containers.edit.tabs.draft"),
158
151
  defaultMessage: "draft"
159
152
  }) }),
160
- /* @__PURE__ */ jsxRuntime.jsx(StatusTab, { disabled: !meta || meta.availableStatus.length === 0, children: formatMessage({
161
- id: index.getTranslation("containers.edit.tabs.published"),
162
- defaultMessage: "published"
163
- }) })
164
- ] }) : null,
165
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid, { paddingTop: 8, gap: 4, children: [
166
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 9, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.TabPanels, { children: [
167
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TabPanel, { children: /* @__PURE__ */ jsxRuntime.jsx(FormLayout, { layout }) }),
168
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TabPanel, { children: /* @__PURE__ */ jsxRuntime.jsx(FormLayout, { layout }) })
169
- ] }) }),
170
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 3, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(index.Panels, {}) })
171
- ] })
172
- ]
173
- }
174
- ),
153
+ /* @__PURE__ */ jsxRuntime.jsx(
154
+ StatusTab,
155
+ {
156
+ disabled: !meta || meta.availableStatus.length === 0,
157
+ value: "published",
158
+ children: formatMessage({
159
+ id: index.getTranslation("containers.edit.tabs.published"),
160
+ defaultMessage: "published"
161
+ })
162
+ }
163
+ )
164
+ ] }) : null
165
+ }
166
+ ),
167
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { paddingTop: 8, gap: 4, children: [
168
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Item, { col: 9, s: 12, children: [
169
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "draft", children: /* @__PURE__ */ jsxRuntime.jsx(FormLayout, { layout }) }),
170
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "published", children: /* @__PURE__ */ jsxRuntime.jsx(FormLayout, { layout }) })
171
+ ] }),
172
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(index.Panels, {}) })
173
+ ] })
174
+ ] }),
175
175
  /* @__PURE__ */ jsxRuntime.jsx(
176
176
  strapiAdmin.Blocker,
177
177
  {
@@ -183,7 +183,7 @@ const EditViewPage = () => {
183
183
  )
184
184
  ] });
185
185
  };
186
- const StatusTab = styledComponents.styled(designSystem.Tab)`
186
+ const StatusTab = styledComponents.styled(designSystem.Tabs.Trigger)`
187
187
  text-transform: uppercase;
188
188
  `;
189
189
  const getDocumentStatus = (document, meta) => {
@@ -219,4 +219,4 @@ const ProtectedEditViewPage = () => {
219
219
  };
220
220
  exports.EditViewPage = EditViewPage;
221
221
  exports.ProtectedEditViewPage = ProtectedEditViewPage;
222
- //# sourceMappingURL=EditViewPage-DZPDqo_G.js.map
222
+ //# sourceMappingURL=EditViewPage-DbcGfyqK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditViewPage-DbcGfyqK.js","sources":["../../admin/src/hooks/useOnce.ts","../../admin/src/pages/EditView/components/FormLayout.tsx","../../admin/src/pages/EditView/EditViewPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport * as React from 'react';\n\nexport const useOnce = (effect: React.EffectCallback) => React.useEffect(effect, emptyDeps);\n\nconst emptyDeps: React.DependencyList = [];\n","import { Box, Flex, Grid } from '@strapi/design-system';\n\nimport { EditLayout } from '../../../hooks/useDocumentLayout';\n\nimport { InputRenderer } from './InputRenderer';\n\ninterface FormLayoutProps extends Pick<EditLayout, 'layout'> {}\n\nconst FormLayout = ({ layout }: FormLayoutProps) => {\n return (\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {layout.map((panel, index) => {\n if (panel.some((row) => row.some((field) => field.type === 'dynamiczone'))) {\n const [row] = panel;\n const [field] = row;\n return (\n <Grid.Root key={field.name} gap={4}>\n <Grid.Item col={12} s={12} xs={12}>\n <InputRenderer {...field} />\n </Grid.Item>\n </Grid.Root>\n );\n }\n\n return (\n <Box\n key={index}\n hasRadius\n background=\"neutral0\"\n shadow=\"tableShadow\"\n paddingLeft={6}\n paddingRight={6}\n paddingTop={6}\n paddingBottom={6}\n borderColor=\"neutral150\"\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {panel.map((row, gridRowIndex) => (\n <Grid.Root key={gridRowIndex} gap={4}>\n {row.map(({ size, ...field }) => {\n return (\n <Grid.Item col={size} key={field.name} s={12} xs={12}>\n <InputRenderer {...field} />\n </Grid.Item>\n );\n })}\n </Grid.Root>\n ))}\n </Flex>\n </Box>\n );\n })}\n </Flex>\n );\n};\n\nexport { FormLayout, FormLayoutProps };\n","import * as React from 'react';\n\nimport {\n Page,\n Blocker,\n Form,\n useRBAC,\n useNotification,\n useQueryParams,\n} from '@strapi/admin/strapi-admin';\nimport { Grid, Main, Tabs } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useLocation, useParams } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { SINGLE_TYPES } from '../../constants/collections';\nimport { PERMISSIONS } from '../../constants/plugin';\nimport { DocumentRBAC, useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { type UseDocument, useDoc } from '../../hooks/useDocument';\nimport { useDocumentLayout } from '../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../hooks/useLazyComponents';\nimport { useOnce } from '../../hooks/useOnce';\nimport { getTranslation } from '../../utils/translations';\nimport { createYupSchema } from '../../utils/validation';\n\nimport { FormLayout } from './components/FormLayout';\nimport { Header } from './components/Header';\nimport { Panels } from './components/Panels';\nimport { transformDocument } from './utils/data';\nimport { createDefaultForm } from './utils/forms';\n\n/* -------------------------------------------------------------------------------------------------\n * EditViewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst EditViewPage = () => {\n const location = useLocation();\n const [\n {\n query: { status },\n },\n setQuery,\n ] = useQueryParams<{ status: 'draft' | 'published' }>({\n status: 'draft',\n });\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n\n const {\n document,\n meta,\n isLoading: isLoadingDocument,\n schema,\n components,\n collectionType,\n id,\n model,\n } = useDoc();\n\n const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;\n\n useOnce(() => {\n /**\n * We only ever want to fire the notification once otherwise\n * whenever the app re-renders it'll pop up regardless of\n * what we do because the state comes from react-router-dom\n */\n if (location?.state && 'error' in location.state) {\n toggleNotification({\n type: 'danger',\n message: location.state.error,\n timeout: 5000,\n });\n }\n });\n\n const isLoadingActionsRBAC = useDocumentRBAC('EditViewPage', (state) => state.isLoading);\n\n const isSingleType = collectionType === SINGLE_TYPES;\n\n /**\n * single-types don't current have an id, but because they're a singleton\n * we can simply use the update operation to continuously update the same\n * document with varying params.\n */\n const isCreatingDocument = !id && !isSingleType;\n\n const {\n isLoading: isLoadingLayout,\n edit: {\n layout,\n settings: { mainField },\n },\n } = useDocumentLayout(model);\n\n const { isLazyLoading } = useLazyComponents([]);\n\n const isLoading = isLoadingActionsRBAC || isLoadingDocument || isLoadingLayout || isLazyLoading;\n\n /**\n * Here we prepare the form for editing, we need to:\n * - remove prohibited fields from the document (passwords | ADD YOURS WHEN THERES A NEW ONE)\n * - swap out count objects on relations for empty arrays\n * - set __temp_key__ on array objects for drag & drop\n *\n * We also prepare the form for new documents, so we need to:\n * - set default values on fields\n */\n const initialValues = React.useMemo(() => {\n if ((!document && !isCreatingDocument && !isSingleType) || !schema) {\n return undefined;\n }\n\n /**\n * Check that we have an ID so we know the\n * document has been created in some way.\n */\n const form = document?.id ? document : createDefaultForm(schema, components);\n\n return transformDocument(schema, components)(form);\n }, [document, isCreatingDocument, isSingleType, schema, components]);\n\n if (isLoading && !document?.documentId) {\n return <Page.Loading />;\n }\n\n if (!initialValues) {\n return <Page.Error />;\n }\n\n const handleTabChange = (status: string) => {\n if (status === 'published' || status === 'draft') {\n setQuery({ status }, 'push', true);\n }\n };\n\n /**\n * We look to see what the mainField is from the configuration,\n * if it's an id we don't use it because it's a uuid format and\n * not very user friendly. Instead in that case, we simply write \"Untitled\".\n */\n const documentTitle =\n mainField !== 'id' && document?.[mainField] ? document[mainField] : 'Untitled';\n\n return (\n <Main paddingLeft={10} paddingRight={10}>\n <Page.Title>{`${documentTitle}`}</Page.Title>\n <Form\n disabled={hasDraftAndPublished && status === 'published'}\n initialValues={initialValues}\n method={isCreatingDocument ? 'POST' : 'PUT'}\n validationSchema={createYupSchema(schema?.attributes, components)}\n >\n {({ resetForm }) => (\n <>\n <Header\n isCreating={isCreatingDocument}\n status={hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined}\n title={documentTitle}\n />\n <Tabs.Root variant=\"simple\" value={status} onValueChange={handleTabChange}>\n <Tabs.List\n aria-label={formatMessage({\n id: getTranslation('containers.edit.tabs.label'),\n defaultMessage: 'Document status',\n })}\n >\n {hasDraftAndPublished ? (\n <>\n <StatusTab value=\"draft\">\n {formatMessage({\n id: getTranslation('containers.edit.tabs.draft'),\n defaultMessage: 'draft',\n })}\n </StatusTab>\n <StatusTab\n disabled={!meta || meta.availableStatus.length === 0}\n value=\"published\"\n >\n {formatMessage({\n id: getTranslation('containers.edit.tabs.published'),\n defaultMessage: 'published',\n })}\n </StatusTab>\n </>\n ) : null}\n </Tabs.List>\n <Grid.Root paddingTop={8} gap={4}>\n <Grid.Item col={9} s={12}>\n <Tabs.Content value=\"draft\">\n <FormLayout layout={layout} />\n </Tabs.Content>\n <Tabs.Content value=\"published\">\n <FormLayout layout={layout} />\n </Tabs.Content>\n </Grid.Item>\n <Grid.Item col={3} s={12}>\n <Panels />\n </Grid.Item>\n </Grid.Root>\n </Tabs.Root>\n <Blocker\n // We reset the form to the published version to avoid errors like – https://strapi-inc.atlassian.net/browse/CONTENT-2284\n onProceed={resetForm}\n />\n </>\n )}\n </Form>\n </Main>\n );\n};\n\nconst StatusTab = styled(Tabs.Trigger)`\n text-transform: uppercase;\n`;\n\n/**\n * @internal\n * @description Returns the status of the document where it's latest state takes priority,\n * this typically will be \"published\" unless a user has edited their draft in which we should\n * display \"modified\".\n */\nconst getDocumentStatus = (\n document: ReturnType<UseDocument>['document'],\n meta: ReturnType<UseDocument>['meta']\n): 'draft' | 'published' | 'modified' => {\n const docStatus = document?.status;\n const statuses = meta?.availableStatus ?? [];\n\n /**\n * Creating an entry\n */\n if (!docStatus) {\n return 'draft';\n }\n\n /**\n * We're viewing a draft, but the document could have a published version\n */\n if (docStatus === 'draft' && statuses.find((doc) => doc.publishedAt !== null)) {\n return 'published';\n }\n\n return docStatus;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedEditViewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedEditViewPage = () => {\n const { slug = '' } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC(\n PERMISSIONS.map((action) => ({\n action,\n subject: slug,\n }))\n );\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !slug) {\n return <Page.Error />;\n }\n\n return (\n <Page.Protect permissions={permissions}>\n {({ permissions }) => (\n <DocumentRBAC permissions={permissions}>\n <EditViewPage />\n </DocumentRBAC>\n )}\n </Page.Protect>\n );\n};\n\nexport { EditViewPage, ProtectedEditViewPage };\n"],"names":["React","jsx","Flex","index","Grid","InputRenderer","Box","useLocation","useQueryParams","useIntl","useNotification","useDoc","useDocumentRBAC","SINGLE_TYPES","useDocumentLayout","useLazyComponents","createDefaultForm","transformDocument","Page","status","jsxs","Main","Form","createYupSchema","Fragment","Header","Tabs","getTranslation","Panels","Blocker","styled","useParams","useRBAC","PERMISSIONS","permissions","DocumentRBAC"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,UAAU,CAAC,WAAiCA,iBAAM,UAAU,QAAQ,SAAS;AAE1F,MAAM,YAAkC,CAAC;ACGzC,MAAM,aAAa,CAAC,EAAE,aAA8B;AAClD,SACGC,2BAAAA,IAAAC,aAAAA,MAAA,EAAK,WAAU,UAAS,YAAW,WAAU,KAAK,GAChD,UAAO,OAAA,IAAI,CAAC,OAAOC,WAAU;AAC5B,QAAI,MAAM,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,UAAU,MAAM,SAAS,aAAa,CAAC,GAAG;AACpE,YAAA,CAAC,GAAG,IAAI;AACR,YAAA,CAAC,KAAK,IAAI;AAEd,aAAAF,2BAAA,IAACG,kBAAK,MAAL,EAA2B,KAAK,GAC/B,UAAAH,2BAAAA,IAACG,aAAAA,KAAK,MAAL,EAAU,KAAK,IAAI,GAAG,IA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AM,wBAAwB,MAAM;AAClC,QAAM,EAAE,OAAO,GAAG,IAAIK,eAEnB,UAAA;AACG,QAAA;AAAA,IACJ,cAAc,CAAC;AAAA,IACf;AAAA,IACA;AAAA,EAAA,IACEC,YAAA;AAAA,IACFC,kBAAY,IAAI,CAAC,YAAY;AAAA,MAC3B;AAAA,MACA,SAAS;AAAA,IAAA,EACT;AAAA,EAAA;AAGJ,MAAI,WAAW;AACN,WAAAhC,+BAACiB,YAAAA,KAAK,SAAL,CAAa,CAAA;AAAA,EACvB;AAEI,MAAA,SAAS,CAAC,MAAM;AACX,WAAAjB,+BAACiB,YAAAA,KAAK,OAAL,CAAW,CAAA;AAAA,EACrB;AAEA,wCACGA,iBAAK,SAAL,EAAa,aACX,WAAC,EAAE,aAAAgB,kDACDC,MAAAA,cAAa,EAAA,aAAaD,cACzB,UAACjC,2BAAAA,IAAA,cAAA,CAAa,CAAA,GAChB,EAEJ,CAAA;AAEJ;;;"}
@@ -2,12 +2,12 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { useState, useEffect, useCallback, memo } from "react";
4
4
  import { useStrapiApp, createContext, useField, useNotification, useForm, useAPIErrorHandler, useQueryParams, useFocusInputField, InputRenderer as InputRenderer$1 } from "@strapi/admin/strapi-admin";
5
- import { Typography, Flex, Box, BaseLink, Button, useComposedRefs, Popover, Field, Tooltip, SingleSelect, SingleSelectOption, IconButton, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, GridItem, Accordion, TextButton, BaseButton, TextInput, IconButtonGroup, Menu, MenuItem } from "@strapi/design-system";
5
+ import { Typography, Flex, Box, BaseLink, Button, Popover, Field, Tooltip, SingleSelect, SingleSelectOption, IconButton, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, Accordion, TextButton, BaseButton, TextInput, IconButtonGroup, Menu, MenuItem } from "@strapi/design-system";
6
6
  import pipe$1 from "lodash/fp/pipe";
7
7
  import { useIntl } from "react-intl";
8
- import { l as DOCUMENT_META_FIELDS, g as getTranslation, b as useDoc, d as contentManagerApi, c as buildValidParams, e as useDocumentRBAC, m as useDocLayout } from "./index-Dv4oDn11.mjs";
8
+ import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, d as buildValidParams, f as useDocumentRBAC, n as useDocLayout } from "./index-JNNNKUHs.mjs";
9
9
  import { generateNKeysBetween } from "fractional-indexing";
10
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-Bbz90ZWv.mjs";
10
+ import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-Dnag3fhV.mjs";
11
11
  import { Code, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
12
12
  import { styled, css, keyframes } from "styled-components";
13
13
  import { C as ComponentIcon, a as COMPONENT_ICONS } from "./ComponentIcon-u4bIXTFY.mjs";
@@ -589,17 +589,23 @@ const LinkContent = React.forwardRef(
589
589
  const [popoverOpen, setPopoverOpen] = React.useState(
590
590
  editor.lastInsertedLinkPath ? Path.equals(path, editor.lastInsertedLinkPath) : false
591
591
  );
592
- const linkRef = React.useRef(null);
593
592
  const elementText = link.children.map((child) => child.text).join("");
594
593
  const [linkText, setLinkText] = React.useState(elementText);
595
594
  const [linkUrl, setLinkUrl] = React.useState(link.url);
596
595
  const linkInputRef = React.useRef(null);
597
596
  const [showRemoveButton, setShowRemoveButton] = React.useState(false);
598
597
  const [isSaveDisabled, setIsSaveDisabled] = React.useState(false);
599
- const handleOpenEditPopover = (e) => {
600
- e.preventDefault();
601
- setPopoverOpen(true);
602
- setShowRemoveButton(true);
598
+ const handleOpenChange = (isOpen) => {
599
+ if (isOpen) {
600
+ setPopoverOpen(isOpen);
601
+ setShowRemoveButton(isOpen);
602
+ } else {
603
+ setPopoverOpen(isOpen);
604
+ if (link.url === "") {
605
+ removeLink(editor);
606
+ }
607
+ ReactEditor.focus(editor);
608
+ }
603
609
  };
604
610
  const onLinkChange = (e) => {
605
611
  setIsSaveDisabled(false);
@@ -622,32 +628,14 @@ const LinkContent = React.forwardRef(
622
628
  setPopoverOpen(false);
623
629
  editor.lastInsertedLinkPath = null;
624
630
  };
625
- const handleDismiss = () => {
626
- setPopoverOpen(false);
627
- if (link.url === "") {
628
- removeLink(editor);
629
- }
630
- ReactEditor.focus(editor);
631
- };
632
- const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
633
- const composedRefs = useComposedRefs(linkRef, forwardedRef);
634
631
  React.useEffect(() => {
635
632
  if (popoverOpen)
636
633
  linkInputRef.current?.focus();
637
634
  }, [popoverOpen]);
638
- return /* @__PURE__ */ jsxs(Fragment, { children: [
639
- /* @__PURE__ */ jsx(
640
- StyledBaseLink,
641
- {
642
- ...attributes,
643
- ref: composedRefs,
644
- href: link.url,
645
- onClick: handleOpenEditPopover,
646
- color: "primary600",
647
- children
648
- }
649
- ),
650
- popoverOpen && /* @__PURE__ */ jsx(Popover, { source: linkRef, onDismiss: handleDismiss, padding: 4, contentEditable: false, children: /* @__PURE__ */ jsxs(Flex, { tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
635
+ const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
636
+ return /* @__PURE__ */ jsxs(Popover.Root, { onOpenChange: handleOpenChange, open: popoverOpen, children: [
637
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(StyledBaseLink, { ...attributes, ref: forwardedRef, href: link.url, color: "primary600", children }) }),
638
+ /* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsxs(Flex, { padding: 4, tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
651
639
  /* @__PURE__ */ jsx(Field.Root, { width: "368px", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
652
640
  /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
653
641
  id: "components.Blocks.popover.text",
@@ -701,7 +689,7 @@ const LinkContent = React.forwardRef(
701
689
  }
702
690
  ),
703
691
  /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
704
- /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleDismiss, children: formatMessage({
692
+ /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: () => handleOpenChange(false), children: formatMessage({
705
693
  id: "components.Blocks.popover.cancel",
706
694
  defaultMessage: "Cancel"
707
695
  }) }),
@@ -2392,9 +2380,9 @@ const NonRepeatableComponent = ({
2392
2380
  hasRadius: isNested,
2393
2381
  borderColor: isNested ? "neutral200" : void 0,
2394
2382
  children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
2395
- return /* @__PURE__ */ jsx(Grid$1, { gap: 4, children: row.map(({ size, ...field }) => {
2383
+ return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2396
2384
  const completeFieldName = `${name2}.${field.name}`;
2397
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2385
+ return /* @__PURE__ */ jsx(Grid$1.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2398
2386
  }) }, index);
2399
2387
  }) })
2400
2388
  }
@@ -2570,9 +2558,9 @@ const RepeatableComponent = ({
2570
2558
  onGrabItem: handleGrabItem,
2571
2559
  __temp_key__: key,
2572
2560
  children: layout.map((row, index2) => {
2573
- return /* @__PURE__ */ jsx(Grid$1, { gap: 4, children: row.map(({ size, ...field }) => {
2561
+ return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2574
2562
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2575
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2563
+ return /* @__PURE__ */ jsx(Grid$1.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2576
2564
  }) }, index2);
2577
2565
  })
2578
2566
  }
@@ -2617,7 +2605,7 @@ const TextButtonCustom = styled(TextButton)`
2617
2605
  }
2618
2606
 
2619
2607
  @media (prefers-reduced-motion: no-preference) {
2620
- transition: background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
2608
+ transition: background-color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
2621
2609
  }
2622
2610
  `;
2623
2611
  const Component = ({
@@ -2885,7 +2873,7 @@ const ComponentBox = styled(Flex)`
2885
2873
  cursor: pointer;
2886
2874
 
2887
2875
  @media (prefers-reduced-motion: no-preference) {
2888
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
2876
+ transition: color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
2889
2877
  }
2890
2878
 
2891
2879
  &:focus,
@@ -4272,8 +4260,6 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4272
4260
  };
4273
4261
  const CustomIconButton = styled(IconButton)`
4274
4262
  padding: ${({ theme }) => theme.spaces[2]};
4275
- /* Trick to prevent the outline from overflowing because of the general outline-offset */
4276
- outline-offset: -2px !important;
4277
4263
 
4278
4264
  svg {
4279
4265
  width: 1.8rem;
@@ -4340,7 +4326,7 @@ const WysiwygNav = ({
4340
4326
  id: "components.Wysiwyg.selectOptions.title",
4341
4327
  defaultMessage: "Add a title"
4342
4328
  });
4343
- const buttonMoreRef = React.useRef(null);
4329
+ React.useRef(null);
4344
4330
  const handleTogglePopover = () => {
4345
4331
  setVisiblePopover((prev) => !prev);
4346
4332
  };
@@ -4431,79 +4417,81 @@ const WysiwygNav = ({
4431
4417
  }
4432
4418
  )
4433
4419
  ] }),
4434
- /* @__PURE__ */ jsx(MoreButton, { ref: buttonMoreRef, onClick: handleTogglePopover, label: "More", children: /* @__PURE__ */ jsx(More, {}) }),
4435
- visiblePopover && /* @__PURE__ */ jsx(Popover, { onDismiss: handleTogglePopover, centered: true, source: buttonMoreRef, spacing: 4, children: /* @__PURE__ */ jsxs(Flex, { children: [
4436
- /* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
4437
- /* @__PURE__ */ jsx(
4438
- CustomIconButton,
4439
- {
4440
- onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4441
- label: "Strikethrough",
4442
- name: "Strikethrough",
4443
- children: /* @__PURE__ */ jsx(StrikeThrough, {})
4444
- }
4445
- ),
4446
- /* @__PURE__ */ jsx(
4447
- CustomIconButton,
4448
- {
4449
- onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4450
- label: "BulletList",
4451
- name: "BulletList",
4452
- children: /* @__PURE__ */ jsx(BulletList, {})
4453
- }
4454
- ),
4455
- /* @__PURE__ */ jsx(
4456
- CustomIconButton,
4457
- {
4458
- onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4459
- label: "NumberList",
4460
- name: "NumberList",
4461
- children: /* @__PURE__ */ jsx(NumberList, {})
4462
- }
4463
- )
4464
- ] }),
4465
- /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
4466
- /* @__PURE__ */ jsx(
4467
- CustomIconButton,
4468
- {
4469
- onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4470
- label: "Code",
4471
- name: "Code",
4472
- children: /* @__PURE__ */ jsx(Code, {})
4473
- }
4474
- ),
4475
- /* @__PURE__ */ jsx(
4476
- CustomIconButton,
4477
- {
4478
- onClick: () => {
4479
- handleTogglePopover();
4480
- onToggleMediaLib();
4481
- },
4482
- label: "Image",
4483
- name: "Image",
4484
- children: /* @__PURE__ */ jsx(Image$1, {})
4485
- }
4486
- ),
4487
- /* @__PURE__ */ jsx(
4488
- CustomLinkIconButton,
4489
- {
4490
- onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4491
- label: "Link",
4492
- name: "Link",
4493
- children: /* @__PURE__ */ jsx(Link$1, {})
4494
- }
4495
- ),
4496
- /* @__PURE__ */ jsx(
4497
- CustomIconButton,
4498
- {
4499
- onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4500
- label: "Quote",
4501
- name: "Quote",
4502
- children: /* @__PURE__ */ jsx(Quotes, {})
4503
- }
4504
- )
4505
- ] })
4506
- ] }) })
4420
+ /* @__PURE__ */ jsxs(Popover.Root, { children: [
4421
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(MoreButton, { label: "More", children: /* @__PURE__ */ jsx(More, {}) }) }),
4422
+ /* @__PURE__ */ jsx(Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxs(Flex, { padding: 2, children: [
4423
+ /* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
4424
+ /* @__PURE__ */ jsx(
4425
+ CustomIconButton,
4426
+ {
4427
+ onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4428
+ label: "Strikethrough",
4429
+ name: "Strikethrough",
4430
+ children: /* @__PURE__ */ jsx(StrikeThrough, {})
4431
+ }
4432
+ ),
4433
+ /* @__PURE__ */ jsx(
4434
+ CustomIconButton,
4435
+ {
4436
+ onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4437
+ label: "BulletList",
4438
+ name: "BulletList",
4439
+ children: /* @__PURE__ */ jsx(BulletList, {})
4440
+ }
4441
+ ),
4442
+ /* @__PURE__ */ jsx(
4443
+ CustomIconButton,
4444
+ {
4445
+ onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4446
+ label: "NumberList",
4447
+ name: "NumberList",
4448
+ children: /* @__PURE__ */ jsx(NumberList, {})
4449
+ }
4450
+ )
4451
+ ] }),
4452
+ /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
4453
+ /* @__PURE__ */ jsx(
4454
+ CustomIconButton,
4455
+ {
4456
+ onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4457
+ label: "Code",
4458
+ name: "Code",
4459
+ children: /* @__PURE__ */ jsx(Code, {})
4460
+ }
4461
+ ),
4462
+ /* @__PURE__ */ jsx(
4463
+ CustomIconButton,
4464
+ {
4465
+ onClick: () => {
4466
+ handleTogglePopover();
4467
+ onToggleMediaLib();
4468
+ },
4469
+ label: "Image",
4470
+ name: "Image",
4471
+ children: /* @__PURE__ */ jsx(Image$1, {})
4472
+ }
4473
+ ),
4474
+ /* @__PURE__ */ jsx(
4475
+ CustomLinkIconButton,
4476
+ {
4477
+ onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4478
+ label: "Link",
4479
+ name: "Link",
4480
+ children: /* @__PURE__ */ jsx(Link$1, {})
4481
+ }
4482
+ ),
4483
+ /* @__PURE__ */ jsx(
4484
+ CustomIconButton,
4485
+ {
4486
+ onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4487
+ label: "Quote",
4488
+ name: "Quote",
4489
+ children: /* @__PURE__ */ jsx(Quotes, {})
4490
+ }
4491
+ )
4492
+ ] })
4493
+ ] }) })
4494
+ ] })
4507
4495
  ] }),
4508
4496
  onTogglePreviewMode && /* @__PURE__ */ jsx(Button, { onClick: onTogglePreviewMode, variant: "tertiary", children: formatMessage({
4509
4497
  id: "components.Wysiwyg.ToggleMode.preview-mode",
@@ -4897,9 +4885,9 @@ const DynamicComponent = ({
4897
4885
  ),
4898
4886
  /* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
4899
4887
  ] }),
4900
- /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(Grid$1, { gap: 4, children: row.map(({ size, ...field }) => {
4888
+ /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
4901
4889
  const fieldName = `${name2}.${index}.${field.name}`;
4902
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
4890
+ return /* @__PURE__ */ jsx(Grid$1.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
4903
4891
  }) }, rowInd)) }) }) })
4904
4892
  ] }) }) })
4905
4893
  ] });
@@ -5208,4 +5196,4 @@ export {
5208
5196
  transformDocument as t,
5209
5197
  useLazyComponents as u
5210
5198
  };
5211
- //# sourceMappingURL=Field-Dn4ThnFB.mjs.map
5199
+ //# sourceMappingURL=Field-BDMSCcy5.mjs.map