@strapi/content-manager 0.0.0-experimental.e0df4d50334a17a1beb3d203bff414fbbff62f7b → 0.0.0-experimental.e12978dcee698470990e9c5c63384faf2c307443

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 (120) hide show
  1. package/dist/admin/chunks/{ComponentConfigurationPage-C5H-5L1u.js → ComponentConfigurationPage-Ci3dN40b.js} +5 -6
  2. package/dist/admin/chunks/{ComponentConfigurationPage-C5H-5L1u.js.map → ComponentConfigurationPage-Ci3dN40b.js.map} +1 -1
  3. package/dist/admin/chunks/{ComponentConfigurationPage-BN2kOtDm.mjs → ComponentConfigurationPage-DFPdl9pm.mjs} +5 -6
  4. package/dist/admin/chunks/{ComponentConfigurationPage-BN2kOtDm.mjs.map → ComponentConfigurationPage-DFPdl9pm.mjs.map} +1 -1
  5. package/dist/admin/chunks/{EditConfigurationPage-BExtZuB7.js → EditConfigurationPage-7xe8u-Pp.js} +5 -6
  6. package/dist/admin/chunks/{EditConfigurationPage-BExtZuB7.js.map → EditConfigurationPage-7xe8u-Pp.js.map} +1 -1
  7. package/dist/admin/chunks/{EditConfigurationPage-tMgOELQG.mjs → EditConfigurationPage-BFse-urJ.mjs} +5 -6
  8. package/dist/admin/chunks/{EditConfigurationPage-tMgOELQG.mjs.map → EditConfigurationPage-BFse-urJ.mjs.map} +1 -1
  9. package/dist/admin/chunks/{EditViewPage-CYe7wAXF.mjs → EditViewPage-BNpRr7fZ.mjs} +99 -98
  10. package/dist/admin/chunks/EditViewPage-BNpRr7fZ.mjs.map +1 -0
  11. package/dist/admin/chunks/{EditViewPage-DFkloeMZ.js → EditViewPage-CwYSs8Cq.js} +99 -98
  12. package/dist/admin/chunks/EditViewPage-CwYSs8Cq.js.map +1 -0
  13. package/dist/admin/chunks/{Form-DTO0ZIaB.mjs → Form-D9Ee-exF.mjs} +3 -3
  14. package/dist/admin/chunks/{Form-DTO0ZIaB.mjs.map → Form-D9Ee-exF.mjs.map} +1 -1
  15. package/dist/admin/chunks/{Form-DGUP3zQO.js → Form-DDbxreII.js} +5 -5
  16. package/dist/admin/chunks/{Form-DGUP3zQO.js.map → Form-DDbxreII.js.map} +1 -1
  17. package/dist/admin/chunks/{History-CQznK1pG.js → History-D5joC76n.js} +17 -13
  18. package/dist/admin/chunks/History-D5joC76n.js.map +1 -0
  19. package/dist/admin/chunks/{History-C333pgXF.mjs → History-FuD7Tp5I.mjs} +16 -12
  20. package/dist/admin/chunks/History-FuD7Tp5I.mjs.map +1 -0
  21. package/dist/admin/chunks/{Input-BexkC_pp.mjs → Input-BHucdqva.mjs} +1108 -47
  22. package/dist/admin/chunks/Input-BHucdqva.mjs.map +1 -0
  23. package/dist/admin/chunks/{Input-DLJZHw9Y.js → Input-BJCenRYN.js} +1121 -57
  24. package/dist/admin/chunks/Input-BJCenRYN.js.map +1 -0
  25. package/dist/admin/chunks/{ListConfigurationPage-BX2WR7MI.mjs → ListConfigurationPage-3kSfz9xV.mjs} +4 -5
  26. package/dist/admin/chunks/{ListConfigurationPage-BX2WR7MI.mjs.map → ListConfigurationPage-3kSfz9xV.mjs.map} +1 -1
  27. package/dist/admin/chunks/{ListConfigurationPage-71I_stAM.js → ListConfigurationPage-CgJEcEkD.js} +6 -7
  28. package/dist/admin/chunks/{ListConfigurationPage-71I_stAM.js.map → ListConfigurationPage-CgJEcEkD.js.map} +1 -1
  29. package/dist/admin/chunks/{ListViewPage-DV3heO4F.js → ListViewPage-CvQ1w8IW.js} +7 -8
  30. package/dist/admin/chunks/{ListViewPage-DV3heO4F.js.map → ListViewPage-CvQ1w8IW.js.map} +1 -1
  31. package/dist/admin/chunks/{ListViewPage-BDeT3Dkk.mjs → ListViewPage-DPUYRHss.mjs} +3 -4
  32. package/dist/admin/chunks/{ListViewPage-BDeT3Dkk.mjs.map → ListViewPage-DPUYRHss.mjs.map} +1 -1
  33. package/dist/admin/chunks/{NoContentTypePage-9JHYpYVX.mjs → NoContentTypePage-BRLLtjLb.mjs} +2 -2
  34. package/dist/admin/chunks/{NoContentTypePage-9JHYpYVX.mjs.map → NoContentTypePage-BRLLtjLb.mjs.map} +1 -1
  35. package/dist/admin/chunks/{NoContentTypePage-COih9y2J.js → NoContentTypePage-C5Vut1Af.js} +2 -2
  36. package/dist/admin/chunks/{NoContentTypePage-COih9y2J.js.map → NoContentTypePage-C5Vut1Af.js.map} +1 -1
  37. package/dist/admin/chunks/{NoPermissionsPage-DTe9I47q.mjs → NoPermissionsPage-B5HJbcjm.mjs} +2 -2
  38. package/dist/admin/chunks/{NoPermissionsPage-DTe9I47q.mjs.map → NoPermissionsPage-B5HJbcjm.mjs.map} +1 -1
  39. package/dist/admin/chunks/{NoPermissionsPage-DGAwRIlN.js → NoPermissionsPage-BBXnpc7M.js} +2 -2
  40. package/dist/admin/chunks/{NoPermissionsPage-DGAwRIlN.js.map → NoPermissionsPage-BBXnpc7M.js.map} +1 -1
  41. package/dist/admin/chunks/{Preview-BEq0FXda.mjs → Preview-C3lnOgQx.mjs} +244 -116
  42. package/dist/admin/chunks/Preview-C3lnOgQx.mjs.map +1 -0
  43. package/dist/admin/chunks/{Preview-CXtc9yEV.js → Preview-DB7ZGawL.js} +240 -112
  44. package/dist/admin/chunks/Preview-DB7ZGawL.js.map +1 -0
  45. package/dist/admin/chunks/{en-C1CjdAtC.js → en-CH__IC8g.js} +4 -1
  46. package/dist/admin/chunks/{en-C1CjdAtC.js.map → en-CH__IC8g.js.map} +1 -1
  47. package/dist/admin/chunks/{en-LfhocNG2.mjs → en-DBP0Gaid.mjs} +4 -1
  48. package/dist/admin/chunks/{en-LfhocNG2.mjs.map → en-DBP0Gaid.mjs.map} +1 -1
  49. package/dist/admin/chunks/{index-Cs6qwFQu.mjs → index-DYrCidCq.mjs} +225 -140
  50. package/dist/admin/chunks/index-DYrCidCq.mjs.map +1 -0
  51. package/dist/admin/chunks/{index-BHimg6jW.js → index-DoUQnFTk.js} +227 -138
  52. package/dist/admin/chunks/index-DoUQnFTk.js.map +1 -0
  53. package/dist/admin/chunks/{layout-Dtahn4Ue.js → layout-CqndYVtU.js} +86 -13
  54. package/dist/admin/chunks/layout-CqndYVtU.js.map +1 -0
  55. package/dist/admin/chunks/{layout-DStNia_P.mjs → layout-D2NJmgCw.mjs} +78 -5
  56. package/dist/admin/chunks/layout-D2NJmgCw.mjs.map +1 -0
  57. package/dist/admin/chunks/{useDragAndDrop-gcqEJMnO.js → objects-BJTP843m.js} +73 -1
  58. package/dist/admin/chunks/objects-BJTP843m.js.map +1 -0
  59. package/dist/admin/chunks/{useDragAndDrop-HYwNDExe.mjs → objects-D2z-IJgu.mjs} +72 -2
  60. package/dist/admin/chunks/objects-D2z-IJgu.mjs.map +1 -0
  61. package/dist/admin/chunks/uk-BtM6WnaE.mjs +313 -0
  62. package/dist/admin/chunks/uk-BtM6WnaE.mjs.map +1 -0
  63. package/dist/admin/chunks/uk-DB6OgySY.js +318 -0
  64. package/dist/admin/chunks/uk-DB6OgySY.js.map +1 -0
  65. package/dist/admin/chunks/{relations-XOYEEqMz.js → usePrev-Cm_0-qRC.js} +18 -2
  66. package/dist/admin/chunks/usePrev-Cm_0-qRC.js.map +1 -0
  67. package/dist/admin/chunks/{relations-Cq8NRUto.mjs → usePrev-DinC2aha.mjs} +18 -4
  68. package/dist/admin/chunks/usePrev-DinC2aha.mjs.map +1 -0
  69. package/dist/admin/index.js +1 -1
  70. package/dist/admin/index.mjs +1 -1
  71. package/dist/admin/src/components/InjectionZone.d.ts +7 -1
  72. package/dist/admin/src/content-manager.d.ts +4 -0
  73. package/dist/admin/src/features/DocumentContext.d.ts +48 -0
  74. package/dist/admin/src/features/DocumentRBAC.d.ts +3 -2
  75. package/dist/admin/src/hooks/useDocument.d.ts +2 -0
  76. package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
  77. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +2 -1
  78. package/dist/admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.d.ts +7 -0
  79. package/dist/admin/src/pages/EditView/components/FormInputs/{Relations.d.ts → Relations/Relations.d.ts} +9 -4
  80. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +5 -2
  81. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +3 -3
  82. package/dist/admin/src/preview/components/PreviewContent.d.ts +1 -2
  83. package/dist/admin/src/preview/pages/Preview.d.ts +2 -0
  84. package/dist/server/index.js +1 -1
  85. package/dist/server/index.js.map +1 -1
  86. package/dist/server/index.mjs +1 -1
  87. package/dist/server/index.mjs.map +1 -1
  88. package/package.json +8 -8
  89. package/dist/admin/chunks/EditViewPage-CYe7wAXF.mjs.map +0 -1
  90. package/dist/admin/chunks/EditViewPage-DFkloeMZ.js.map +0 -1
  91. package/dist/admin/chunks/History-C333pgXF.mjs.map +0 -1
  92. package/dist/admin/chunks/History-CQznK1pG.js.map +0 -1
  93. package/dist/admin/chunks/Input-BexkC_pp.mjs.map +0 -1
  94. package/dist/admin/chunks/Input-DLJZHw9Y.js.map +0 -1
  95. package/dist/admin/chunks/Preview-BEq0FXda.mjs.map +0 -1
  96. package/dist/admin/chunks/Preview-CXtc9yEV.js.map +0 -1
  97. package/dist/admin/chunks/Relations-o7_hVGyK.js +0 -1318
  98. package/dist/admin/chunks/Relations-o7_hVGyK.js.map +0 -1
  99. package/dist/admin/chunks/Relations-qeZyLDgQ.mjs +0 -1291
  100. package/dist/admin/chunks/Relations-qeZyLDgQ.mjs.map +0 -1
  101. package/dist/admin/chunks/index-BHimg6jW.js.map +0 -1
  102. package/dist/admin/chunks/index-Cs6qwFQu.mjs.map +0 -1
  103. package/dist/admin/chunks/layout-DStNia_P.mjs.map +0 -1
  104. package/dist/admin/chunks/layout-Dtahn4Ue.js.map +0 -1
  105. package/dist/admin/chunks/objects-C3EebVVe.js +0 -76
  106. package/dist/admin/chunks/objects-C3EebVVe.js.map +0 -1
  107. package/dist/admin/chunks/objects-wl73iEma.mjs +0 -73
  108. package/dist/admin/chunks/objects-wl73iEma.mjs.map +0 -1
  109. package/dist/admin/chunks/relations-Cq8NRUto.mjs.map +0 -1
  110. package/dist/admin/chunks/relations-XOYEEqMz.js.map +0 -1
  111. package/dist/admin/chunks/uk-B24MoTVg.js +0 -145
  112. package/dist/admin/chunks/uk-B24MoTVg.js.map +0 -1
  113. package/dist/admin/chunks/uk-Cpgmm7gE.mjs +0 -140
  114. package/dist/admin/chunks/uk-Cpgmm7gE.mjs.map +0 -1
  115. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs.map +0 -1
  116. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +0 -1
  117. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs +0 -18
  118. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs.map +0 -1
  119. package/dist/admin/chunks/usePrev-DIYl-IAL.js +0 -21
  120. package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +0 -1
@@ -5,8 +5,8 @@ import { Main, Tabs, Grid } from '@strapi/design-system';
5
5
  import { useIntl } from 'react-intl';
6
6
  import { useLocation, useParams } from 'react-router-dom';
7
7
  import { styled } from 'styled-components';
8
- import { c as useDoc, f as useDocumentRBAC, h as useDocumentLayout, i as createYupSchema, j as Header, g as getTranslation, P as Panels, k as PERMISSIONS, l as DocumentRBAC, S as SINGLE_TYPES } from './index-Cs6qwFQu.mjs';
9
- import { u as useLazyComponents, F as FormLayout } from './Input-BexkC_pp.mjs';
8
+ import { m as useDoc, o as useDocumentRBAC, d as useDocumentLayout, q as DocumentContextProvider, h as createYupSchema, r as Header, g as getTranslation, v as Panels, P as PERMISSIONS, f as DocumentRBAC, S as SINGLE_TYPES } from './index-DYrCidCq.mjs';
9
+ import { u as useLazyComponents, a as FormLayout } from './Input-BHucdqva.mjs';
10
10
  import '@strapi/icons';
11
11
  import 'lodash/fp/mapValues';
12
12
  import 'yup';
@@ -69,19 +69,16 @@ import 'prismjs/components/prism-typescript';
69
69
  import 'prismjs/components/prism-tsx';
70
70
  import 'prismjs/components/prism-vbnet';
71
71
  import 'prismjs/components/prism-yaml';
72
- import './usePrev-Bjw2dhmq.mjs';
73
- import './useDragAndDrop-HYwNDExe.mjs';
72
+ import './usePrev-DinC2aha.mjs';
73
+ import './objects-D2z-IJgu.mjs';
74
74
  import 'react-dnd';
75
- import '@radix-ui/react-toolbar';
76
- import 'react-dnd-html5-backend';
77
- import './objects-wl73iEma.mjs';
78
75
  import 'lodash/clone';
79
76
  import 'lodash/toPath';
80
- import './Relations-qeZyLDgQ.mjs';
81
- import 'react-window';
82
- import './relations-Cq8NRUto.mjs';
77
+ import '@radix-ui/react-toolbar';
78
+ import 'react-dnd-html5-backend';
83
79
  import './ComponentIcon-BZcTc4rj.mjs';
84
80
  import '@strapi/icons/symbols';
81
+ import 'react-window';
85
82
  import 'codemirror5';
86
83
  import 'sanitize-html';
87
84
  import 'highlight.js';
@@ -136,13 +133,10 @@ const emptyDeps = [];
136
133
  const { isLazyLoading } = useLazyComponents([]);
137
134
  const isLoading = isLoadingActionsRBAC || isLoadingDocument || isLoadingLayout || isLazyLoading;
138
135
  const initialValues = getInitialFormValues(isCreatingDocument);
139
- if (hasError) {
140
- return /*#__PURE__*/ jsx(Page.Error, {});
141
- }
142
136
  if (isLoading && !document?.documentId) {
143
137
  return /*#__PURE__*/ jsx(Page.Loading, {});
144
138
  }
145
- if (!initialValues) {
139
+ if (!initialValues || hasError) {
146
140
  return /*#__PURE__*/ jsx(Page.Error, {});
147
141
  }
148
142
  const handleTabChange = (status)=>{
@@ -168,98 +162,105 @@ const emptyDeps = [];
168
162
  /*#__PURE__*/ jsx(Page.Title, {
169
163
  children: getTitle(mainField)
170
164
  }),
171
- /*#__PURE__*/ jsx(Form, {
172
- disabled: hasDraftAndPublished && status === 'published',
173
- initialValues: initialValues,
174
- method: isCreatingDocument ? 'POST' : 'PUT',
175
- validate: (values, options)=>{
176
- const yupSchema = createYupSchema(schema?.attributes, components, {
177
- status,
178
- ...options
179
- });
180
- return yupSchema.validate(values, {
181
- abortEarly: false
182
- });
165
+ /*#__PURE__*/ jsx(DocumentContextProvider, {
166
+ initialDocument: {
167
+ documentId: id,
168
+ model,
169
+ collectionType
183
170
  },
184
- initialErrors: location?.state?.forceValidation ? validateSync(initialValues, {}) : {},
185
- children: ({ resetForm })=>/*#__PURE__*/ jsxs(Fragment, {
186
- children: [
187
- /*#__PURE__*/ jsx(Header, {
188
- isCreating: isCreatingDocument,
189
- status: hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined,
190
- title: getTitle(mainField)
191
- }),
192
- /*#__PURE__*/ jsxs(Tabs.Root, {
193
- variant: "simple",
194
- value: status,
195
- onValueChange: handleTabChange,
196
- children: [
197
- /*#__PURE__*/ jsx(Tabs.List, {
198
- "aria-label": formatMessage({
199
- id: getTranslation('containers.edit.tabs.label'),
200
- defaultMessage: 'Document status'
201
- }),
202
- children: hasDraftAndPublished ? /*#__PURE__*/ jsxs(Fragment, {
203
- children: [
204
- /*#__PURE__*/ jsx(StatusTab, {
205
- value: "draft",
206
- children: formatMessage({
207
- id: getTranslation('containers.edit.tabs.draft'),
208
- defaultMessage: 'draft'
209
- })
210
- }),
211
- /*#__PURE__*/ jsx(StatusTab, {
212
- disabled: !meta || meta.availableStatus.length === 0,
213
- value: "published",
214
- children: formatMessage({
215
- id: getTranslation('containers.edit.tabs.published'),
216
- defaultMessage: 'published'
217
- })
218
- })
219
- ]
220
- }) : null
221
- }),
222
- /*#__PURE__*/ jsxs(Grid.Root, {
223
- paddingTop: 8,
224
- gap: 4,
225
- children: [
226
- /*#__PURE__*/ jsxs(Grid.Item, {
227
- col: 9,
228
- s: 12,
229
- direction: "column",
230
- alignItems: "stretch",
171
+ children: /*#__PURE__*/ jsx(Form, {
172
+ disabled: hasDraftAndPublished && status === 'published',
173
+ initialValues: initialValues,
174
+ method: isCreatingDocument ? 'POST' : 'PUT',
175
+ validate: (values, options)=>{
176
+ const yupSchema = createYupSchema(schema?.attributes, components, {
177
+ status,
178
+ ...options
179
+ });
180
+ return yupSchema.validate(values, {
181
+ abortEarly: false
182
+ });
183
+ },
184
+ initialErrors: location?.state?.forceValidation ? validateSync(initialValues, {}) : {},
185
+ children: ({ resetForm })=>/*#__PURE__*/ jsxs(Fragment, {
186
+ children: [
187
+ /*#__PURE__*/ jsx(Header, {
188
+ isCreating: isCreatingDocument,
189
+ status: hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined,
190
+ title: getTitle(mainField)
191
+ }),
192
+ /*#__PURE__*/ jsxs(Tabs.Root, {
193
+ variant: "simple",
194
+ value: status,
195
+ onValueChange: handleTabChange,
196
+ children: [
197
+ /*#__PURE__*/ jsx(Tabs.List, {
198
+ "aria-label": formatMessage({
199
+ id: getTranslation('containers.edit.tabs.label'),
200
+ defaultMessage: 'Document status'
201
+ }),
202
+ children: hasDraftAndPublished ? /*#__PURE__*/ jsxs(Fragment, {
231
203
  children: [
232
- /*#__PURE__*/ jsx(Tabs.Content, {
204
+ /*#__PURE__*/ jsx(StatusTab, {
233
205
  value: "draft",
234
- children: /*#__PURE__*/ jsx(FormLayout, {
235
- layout: layout
206
+ children: formatMessage({
207
+ id: getTranslation('containers.edit.tabs.draft'),
208
+ defaultMessage: 'draft'
236
209
  })
237
210
  }),
238
- /*#__PURE__*/ jsx(Tabs.Content, {
211
+ /*#__PURE__*/ jsx(StatusTab, {
212
+ disabled: !meta || meta.availableStatus.length === 0,
239
213
  value: "published",
240
- children: /*#__PURE__*/ jsx(FormLayout, {
241
- layout: layout
214
+ children: formatMessage({
215
+ id: getTranslation('containers.edit.tabs.published'),
216
+ defaultMessage: 'published'
242
217
  })
243
218
  })
244
219
  ]
245
- }),
246
- /*#__PURE__*/ jsx(Grid.Item, {
247
- col: 3,
248
- s: 12,
249
- direction: "column",
250
- alignItems: "stretch",
251
- children: /*#__PURE__*/ jsx(Panels, {})
252
- })
253
- ]
254
- })
255
- ]
256
- }),
257
- /*#__PURE__*/ jsx(Blocker, {
258
- // We reset the form to the published version to avoid errors like – https://strapi-inc.atlassian.net/browse/CONTENT-2284
259
- onProceed: resetForm
260
- })
261
- ]
262
- })
220
+ }) : null
221
+ }),
222
+ /*#__PURE__*/ jsxs(Grid.Root, {
223
+ paddingTop: 8,
224
+ gap: 4,
225
+ children: [
226
+ /*#__PURE__*/ jsxs(Grid.Item, {
227
+ col: 9,
228
+ s: 12,
229
+ direction: "column",
230
+ alignItems: "stretch",
231
+ children: [
232
+ /*#__PURE__*/ jsx(Tabs.Content, {
233
+ value: "draft",
234
+ children: /*#__PURE__*/ jsx(FormLayout, {
235
+ layout: layout
236
+ })
237
+ }),
238
+ /*#__PURE__*/ jsx(Tabs.Content, {
239
+ value: "published",
240
+ children: /*#__PURE__*/ jsx(FormLayout, {
241
+ layout: layout
242
+ })
243
+ })
244
+ ]
245
+ }),
246
+ /*#__PURE__*/ jsx(Grid.Item, {
247
+ col: 3,
248
+ s: 12,
249
+ direction: "column",
250
+ alignItems: "stretch",
251
+ children: /*#__PURE__*/ jsx(Panels, {})
252
+ })
253
+ ]
254
+ })
255
+ ]
256
+ }),
257
+ /*#__PURE__*/ jsx(Blocker, {
258
+ // We reset the form to the published version to avoid errors like – https://strapi-inc.atlassian.net/browse/CONTENT-2284
259
+ onProceed: resetForm
260
+ })
261
+ ]
262
+ })
263
+ })
263
264
  })
264
265
  ]
265
266
  });
@@ -311,4 +312,4 @@ const StatusTab = styled(Tabs.Trigger)`
311
312
  };
312
313
 
313
314
  export { EditViewPage, ProtectedEditViewPage, getDocumentStatus };
314
- //# sourceMappingURL=EditViewPage-CYe7wAXF.mjs.map
315
+ //# sourceMappingURL=EditViewPage-BNpRr7fZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditViewPage-BNpRr7fZ.mjs","sources":["../../../admin/src/hooks/useOnce.ts","../../../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 * 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 { DocumentContextProvider } from '../../features/DocumentContext';\nimport { DocumentRBAC, useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDoc, type UseDocument } 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';\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 hasError,\n getTitle,\n getInitialFormValues,\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 const initialValues = getInitialFormValues(isCreatingDocument);\n\n if (isLoading && !document?.documentId) {\n return <Page.Loading />;\n }\n\n if (!initialValues || hasError) {\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 const validateSync = (values: Record<string, unknown>, options: Record<string, string>) => {\n const yupSchema = createYupSchema(schema?.attributes, components, {\n status,\n ...options,\n });\n\n return yupSchema.validateSync(values, { abortEarly: false });\n };\n\n return (\n <Main paddingLeft={10} paddingRight={10}>\n <Page.Title>{getTitle(mainField)}</Page.Title>\n <DocumentContextProvider\n initialDocument={{\n documentId: id!,\n model,\n collectionType,\n }}\n >\n <Form\n disabled={hasDraftAndPublished && status === 'published'}\n initialValues={initialValues}\n method={isCreatingDocument ? 'POST' : 'PUT'}\n validate={(values: Record<string, unknown>, options: Record<string, string>) => {\n const yupSchema = createYupSchema(schema?.attributes, components, {\n status,\n ...options,\n });\n\n return yupSchema.validate(values, { abortEarly: false });\n }}\n initialErrors={location?.state?.forceValidation ? validateSync(initialValues, {}) : {}}\n >\n {({ resetForm }) => (\n <>\n <Header\n isCreating={isCreatingDocument}\n status={hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined}\n title={getTitle(mainField)}\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} direction=\"column\" alignItems=\"stretch\">\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} direction=\"column\" alignItems=\"stretch\">\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 </DocumentContextProvider>\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 its 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, getDocumentStatus };\n"],"names":["useOnce","effect","React","useEffect","emptyDeps","EditViewPage","location","useLocation","query","status","setQuery","useQueryParams","formatMessage","useIntl","toggleNotification","useNotification","document","meta","isLoading","isLoadingDocument","schema","components","collectionType","id","model","hasError","getTitle","getInitialFormValues","useDoc","hasDraftAndPublished","options","draftAndPublish","state","type","message","error","timeout","isLoadingActionsRBAC","useDocumentRBAC","isSingleType","SINGLE_TYPES","isCreatingDocument","isLoadingLayout","edit","layout","settings","mainField","useDocumentLayout","isLazyLoading","useLazyComponents","initialValues","documentId","_jsx","Page","Loading","Error","handleTabChange","validateSync","values","yupSchema","createYupSchema","attributes","abortEarly","_jsxs","Main","paddingLeft","paddingRight","Title","DocumentContextProvider","initialDocument","Form","disabled","method","validate","initialErrors","forceValidation","resetForm","_Fragment","Header","isCreating","getDocumentStatus","undefined","title","Tabs","Root","variant","value","onValueChange","List","aria-label","getTranslation","defaultMessage","StatusTab","availableStatus","length","Grid","paddingTop","gap","Item","col","s","direction","alignItems","Content","FormLayout","Panels","Blocker","onProceed","styled","Trigger","docStatus","statuses","find","doc","publishedAt","ProtectedEditViewPage","slug","useParams","permissions","useRBAC","PERMISSIONS","map","action","subject","Protect","DocumentRBAC"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,UAAU,CAACC,MAAAA,GAAiCC,MAAMC,SAAS,CAACF,QAAQG,SAAW,CAAA;AAE5F,MAAMA,YAAkC,EAA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qBAAOkC,GAAA,CAACC,KAAKC,OAAO,EAAA,EAAA,CAAA;AACtB;IAEA,IAAInB,KAAAA,IAAS,CAACiF,IAAM,EAAA;QAClB,qBAAOhE,GAAA,CAACC,KAAKE,KAAK,EAAA,EAAA,CAAA;AACpB;IAEA,qBACEH,GAAA,CAACC,KAAKuE,OAAO,EAAA;QAACN,WAAaA,EAAAA,WAAAA;AACxB,QAAA,QAAA,EAAA,CAAC,EAAEA,WAAW,EAAE,iBACflE,GAACyE,CAAAA,YAAAA,EAAAA;gBAAaP,WAAaA,EAAAA,WAAAA;AACzB,gBAAA,QAAA,gBAAAlE,GAAC/C,CAAAA,YAAAA,EAAAA,EAAAA;;;AAKX;;;;"}
@@ -7,8 +7,8 @@ var designSystem = require('@strapi/design-system');
7
7
  var reactIntl = require('react-intl');
8
8
  var reactRouterDom = require('react-router-dom');
9
9
  var styledComponents = require('styled-components');
10
- var index = require('./index-BHimg6jW.js');
11
- var Input = require('./Input-DLJZHw9Y.js');
10
+ var index = require('./index-DoUQnFTk.js');
11
+ var Input = require('./Input-BJCenRYN.js');
12
12
  require('@strapi/icons');
13
13
  require('lodash/fp/mapValues');
14
14
  require('yup');
@@ -71,19 +71,16 @@ require('prismjs/components/prism-typescript');
71
71
  require('prismjs/components/prism-tsx');
72
72
  require('prismjs/components/prism-vbnet');
73
73
  require('prismjs/components/prism-yaml');
74
- require('./usePrev-DIYl-IAL.js');
75
- require('./useDragAndDrop-gcqEJMnO.js');
74
+ require('./usePrev-Cm_0-qRC.js');
75
+ require('./objects-BJTP843m.js');
76
76
  require('react-dnd');
77
- require('@radix-ui/react-toolbar');
78
- require('react-dnd-html5-backend');
79
- require('./objects-C3EebVVe.js');
80
77
  require('lodash/clone');
81
78
  require('lodash/toPath');
82
- require('./Relations-o7_hVGyK.js');
83
- require('react-window');
84
- require('./relations-XOYEEqMz.js');
79
+ require('@radix-ui/react-toolbar');
80
+ require('react-dnd-html5-backend');
85
81
  require('./ComponentIcon-C-EjOUPA.js');
86
82
  require('@strapi/icons/symbols');
83
+ require('react-window');
87
84
  require('codemirror5');
88
85
  require('sanitize-html');
89
86
  require('highlight.js');
@@ -157,13 +154,10 @@ const emptyDeps = [];
157
154
  const { isLazyLoading } = Input.useLazyComponents([]);
158
155
  const isLoading = isLoadingActionsRBAC || isLoadingDocument || isLoadingLayout || isLazyLoading;
159
156
  const initialValues = getInitialFormValues(isCreatingDocument);
160
- if (hasError) {
161
- return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
162
- }
163
157
  if (isLoading && !document?.documentId) {
164
158
  return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
165
159
  }
166
- if (!initialValues) {
160
+ if (!initialValues || hasError) {
167
161
  return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
168
162
  }
169
163
  const handleTabChange = (status)=>{
@@ -189,98 +183,105 @@ const emptyDeps = [];
189
183
  /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Title, {
190
184
  children: getTitle(mainField)
191
185
  }),
192
- /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Form, {
193
- disabled: hasDraftAndPublished && status === 'published',
194
- initialValues: initialValues,
195
- method: isCreatingDocument ? 'POST' : 'PUT',
196
- validate: (values, options)=>{
197
- const yupSchema = index.createYupSchema(schema?.attributes, components, {
198
- status,
199
- ...options
200
- });
201
- return yupSchema.validate(values, {
202
- abortEarly: false
203
- });
186
+ /*#__PURE__*/ jsxRuntime.jsx(index.DocumentContextProvider, {
187
+ initialDocument: {
188
+ documentId: id,
189
+ model,
190
+ collectionType
204
191
  },
205
- initialErrors: location?.state?.forceValidation ? validateSync(initialValues, {}) : {},
206
- children: ({ resetForm })=>/*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
207
- children: [
208
- /*#__PURE__*/ jsxRuntime.jsx(index.Header, {
209
- isCreating: isCreatingDocument,
210
- status: hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined,
211
- title: getTitle(mainField)
212
- }),
213
- /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Tabs.Root, {
214
- variant: "simple",
215
- value: status,
216
- onValueChange: handleTabChange,
217
- children: [
218
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tabs.List, {
219
- "aria-label": formatMessage({
220
- id: index.getTranslation('containers.edit.tabs.label'),
221
- defaultMessage: 'Document status'
222
- }),
223
- children: hasDraftAndPublished ? /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
224
- children: [
225
- /*#__PURE__*/ jsxRuntime.jsx(StatusTab, {
226
- value: "draft",
227
- children: formatMessage({
228
- id: index.getTranslation('containers.edit.tabs.draft'),
229
- defaultMessage: 'draft'
230
- })
231
- }),
232
- /*#__PURE__*/ jsxRuntime.jsx(StatusTab, {
233
- disabled: !meta || meta.availableStatus.length === 0,
234
- value: "published",
235
- children: formatMessage({
236
- id: index.getTranslation('containers.edit.tabs.published'),
237
- defaultMessage: 'published'
238
- })
239
- })
240
- ]
241
- }) : null
242
- }),
243
- /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Grid.Root, {
244
- paddingTop: 8,
245
- gap: 4,
246
- children: [
247
- /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Grid.Item, {
248
- col: 9,
249
- s: 12,
250
- direction: "column",
251
- alignItems: "stretch",
192
+ children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Form, {
193
+ disabled: hasDraftAndPublished && status === 'published',
194
+ initialValues: initialValues,
195
+ method: isCreatingDocument ? 'POST' : 'PUT',
196
+ validate: (values, options)=>{
197
+ const yupSchema = index.createYupSchema(schema?.attributes, components, {
198
+ status,
199
+ ...options
200
+ });
201
+ return yupSchema.validate(values, {
202
+ abortEarly: false
203
+ });
204
+ },
205
+ initialErrors: location?.state?.forceValidation ? validateSync(initialValues, {}) : {},
206
+ children: ({ resetForm })=>/*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
207
+ children: [
208
+ /*#__PURE__*/ jsxRuntime.jsx(index.Header, {
209
+ isCreating: isCreatingDocument,
210
+ status: hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined,
211
+ title: getTitle(mainField)
212
+ }),
213
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Tabs.Root, {
214
+ variant: "simple",
215
+ value: status,
216
+ onValueChange: handleTabChange,
217
+ children: [
218
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tabs.List, {
219
+ "aria-label": formatMessage({
220
+ id: index.getTranslation('containers.edit.tabs.label'),
221
+ defaultMessage: 'Document status'
222
+ }),
223
+ children: hasDraftAndPublished ? /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
252
224
  children: [
253
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tabs.Content, {
225
+ /*#__PURE__*/ jsxRuntime.jsx(StatusTab, {
254
226
  value: "draft",
255
- children: /*#__PURE__*/ jsxRuntime.jsx(Input.FormLayout, {
256
- layout: layout
227
+ children: formatMessage({
228
+ id: index.getTranslation('containers.edit.tabs.draft'),
229
+ defaultMessage: 'draft'
257
230
  })
258
231
  }),
259
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tabs.Content, {
232
+ /*#__PURE__*/ jsxRuntime.jsx(StatusTab, {
233
+ disabled: !meta || meta.availableStatus.length === 0,
260
234
  value: "published",
261
- children: /*#__PURE__*/ jsxRuntime.jsx(Input.FormLayout, {
262
- layout: layout
235
+ children: formatMessage({
236
+ id: index.getTranslation('containers.edit.tabs.published'),
237
+ defaultMessage: 'published'
263
238
  })
264
239
  })
265
240
  ]
266
- }),
267
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
268
- col: 3,
269
- s: 12,
270
- direction: "column",
271
- alignItems: "stretch",
272
- children: /*#__PURE__*/ jsxRuntime.jsx(index.Panels, {})
273
- })
274
- ]
275
- })
276
- ]
277
- }),
278
- /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Blocker, {
279
- // We reset the form to the published version to avoid errors like – https://strapi-inc.atlassian.net/browse/CONTENT-2284
280
- onProceed: resetForm
281
- })
282
- ]
283
- })
241
+ }) : null
242
+ }),
243
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Grid.Root, {
244
+ paddingTop: 8,
245
+ gap: 4,
246
+ children: [
247
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Grid.Item, {
248
+ col: 9,
249
+ s: 12,
250
+ direction: "column",
251
+ alignItems: "stretch",
252
+ children: [
253
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tabs.Content, {
254
+ value: "draft",
255
+ children: /*#__PURE__*/ jsxRuntime.jsx(Input.FormLayout, {
256
+ layout: layout
257
+ })
258
+ }),
259
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tabs.Content, {
260
+ value: "published",
261
+ children: /*#__PURE__*/ jsxRuntime.jsx(Input.FormLayout, {
262
+ layout: layout
263
+ })
264
+ })
265
+ ]
266
+ }),
267
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
268
+ col: 3,
269
+ s: 12,
270
+ direction: "column",
271
+ alignItems: "stretch",
272
+ children: /*#__PURE__*/ jsxRuntime.jsx(index.Panels, {})
273
+ })
274
+ ]
275
+ })
276
+ ]
277
+ }),
278
+ /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Blocker, {
279
+ // We reset the form to the published version to avoid errors like – https://strapi-inc.atlassian.net/browse/CONTENT-2284
280
+ onProceed: resetForm
281
+ })
282
+ ]
283
+ })
284
+ })
284
285
  })
285
286
  ]
286
287
  });
@@ -334,4 +335,4 @@ const StatusTab = styledComponents.styled(designSystem.Tabs.Trigger)`
334
335
  exports.EditViewPage = EditViewPage;
335
336
  exports.ProtectedEditViewPage = ProtectedEditViewPage;
336
337
  exports.getDocumentStatus = getDocumentStatus;
337
- //# sourceMappingURL=EditViewPage-DFkloeMZ.js.map
338
+ //# sourceMappingURL=EditViewPage-CwYSs8Cq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditViewPage-CwYSs8Cq.js","sources":["../../../admin/src/hooks/useOnce.ts","../../../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 * 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 { DocumentContextProvider } from '../../features/DocumentContext';\nimport { DocumentRBAC, useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDoc, type UseDocument } 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';\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 hasError,\n getTitle,\n getInitialFormValues,\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 const initialValues = getInitialFormValues(isCreatingDocument);\n\n if (isLoading && !document?.documentId) {\n return <Page.Loading />;\n }\n\n if (!initialValues || hasError) {\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 const validateSync = (values: Record<string, unknown>, options: Record<string, string>) => {\n const yupSchema = createYupSchema(schema?.attributes, components, {\n status,\n ...options,\n });\n\n return yupSchema.validateSync(values, { abortEarly: false });\n };\n\n return (\n <Main paddingLeft={10} paddingRight={10}>\n <Page.Title>{getTitle(mainField)}</Page.Title>\n <DocumentContextProvider\n initialDocument={{\n documentId: id!,\n model,\n collectionType,\n }}\n >\n <Form\n disabled={hasDraftAndPublished && status === 'published'}\n initialValues={initialValues}\n method={isCreatingDocument ? 'POST' : 'PUT'}\n validate={(values: Record<string, unknown>, options: Record<string, string>) => {\n const yupSchema = createYupSchema(schema?.attributes, components, {\n status,\n ...options,\n });\n\n return yupSchema.validate(values, { abortEarly: false });\n }}\n initialErrors={location?.state?.forceValidation ? validateSync(initialValues, {}) : {}}\n >\n {({ resetForm }) => (\n <>\n <Header\n isCreating={isCreatingDocument}\n status={hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined}\n title={getTitle(mainField)}\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} direction=\"column\" alignItems=\"stretch\">\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} direction=\"column\" alignItems=\"stretch\">\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 </DocumentContextProvider>\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 its 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, getDocumentStatus };\n"],"names":["useOnce","effect","React","useEffect","emptyDeps","EditViewPage","location","useLocation","query","status","setQuery","useQueryParams","formatMessage","useIntl","toggleNotification","useNotification","document","meta","isLoading","isLoadingDocument","schema","components","collectionType","id","model","hasError","getTitle","getInitialFormValues","useDoc","hasDraftAndPublished","options","draftAndPublish","state","type","message","error","timeout","isLoadingActionsRBAC","useDocumentRBAC","isSingleType","SINGLE_TYPES","isCreatingDocument","isLoadingLayout","edit","layout","settings","mainField","useDocumentLayout","isLazyLoading","useLazyComponents","initialValues","documentId","_jsx","Page","Loading","Error","handleTabChange","validateSync","values","yupSchema","createYupSchema","attributes","abortEarly","_jsxs","Main","paddingLeft","paddingRight","Title","DocumentContextProvider","initialDocument","Form","disabled","method","validate","initialErrors","forceValidation","resetForm","_Fragment","Header","isCreating","getDocumentStatus","undefined","title","Tabs","Root","variant","value","onValueChange","List","aria-label","getTranslation","defaultMessage","StatusTab","availableStatus","length","Grid","paddingTop","gap","Item","col","s","direction","alignItems","Content","FormLayout","Panels","Blocker","onProceed","styled","Trigger","docStatus","statuses","find","doc","publishedAt","ProtectedEditViewPage","slug","useParams","permissions","useRBAC","PERMISSIONS","map","action","subject","Protect","D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B,IAAA,MAAM,EAAEC,IAAAA,GAAO,EAAE,EAAE,GAAGC,wBAAAA,EAAAA;AAGtB,IAAA,MAAM,EACJC,WAAAA,GAAc,EAAE,EAChBpG,SAAS,EACTiB,KAAK,EACN,GAAGoF,oBACFC,iBAAYC,CAAAA,GAAG,CAAC,CAACC,UAAY;AAC3BA,YAAAA,MAAAA;YACAC,OAASP,EAAAA;SACX,CAAA,CAAA,CAAA;AAGF,IAAA,IAAIlG,SAAW,EAAA;QACb,qBAAOkC,cAAA,CAACC,iBAAKC,OAAO,EAAA,EAAA,CAAA;AACtB;IAEA,IAAInB,KAAAA,IAAS,CAACiF,IAAM,EAAA;QAClB,qBAAOhE,cAAA,CAACC,iBAAKE,KAAK,EAAA,EAAA,CAAA;AACpB;IAEA,qBACEH,cAAA,CAACC,iBAAKuE,OAAO,EAAA;QAACN,WAAaA,EAAAA,WAAAA;AACxB,QAAA,QAAA,EAAA,CAAC,EAAEA,WAAW,EAAE,iBACflE,cAACyE,CAAAA,kBAAAA,EAAAA;gBAAaP,WAAaA,EAAAA,WAAAA;AACzB,gBAAA,QAAA,gBAAAlE,cAAC/C,CAAAA,YAAAA,EAAAA,EAAAA;;;AAKX;;;;;;"}
@@ -5,12 +5,12 @@ import { Modal, Flex, Grid, Button, IconButton, Typography, Box, Menu, useCompos
5
5
  import { generateNKeysBetween as generateNKeysBetween$1 } from 'fractional-indexing';
6
6
  import pipe from 'lodash/fp/pipe';
7
7
  import { useIntl } from 'react-intl';
8
- import { a as useGetInitialDataQuery, E as ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD, z as capitalise, g as getTranslation } from './index-Cs6qwFQu.mjs';
8
+ import { a as useGetInitialDataQuery, K as ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD, G as capitalise, g as getTranslation } from './index-DYrCidCq.mjs';
9
9
  import { Plus, Drag, Pencil, Cross, Cog } from '@strapi/icons';
10
10
  import { getEmptyImage } from 'react-dnd-html5-backend';
11
11
  import { NavLink } from 'react-router-dom';
12
12
  import { styled } from 'styled-components';
13
- import { u as useDragAndDrop, I as ItemTypes } from './useDragAndDrop-HYwNDExe.mjs';
13
+ import { u as useDragAndDrop, I as ItemTypes } from './objects-D2z-IJgu.mjs';
14
14
  import { C as ComponentIcon } from './ComponentIcon-BZcTc4rj.mjs';
15
15
  import * as yup from 'yup';
16
16
  import { F as FieldTypeIcon } from './FieldTypeIcon-BY6MrVF4.mjs';
@@ -952,4 +952,4 @@ const Header = ({ name })=>{
952
952
  };
953
953
 
954
954
  export { ConfigurationForm as C, TEMP_FIELD_NAME as T };
955
- //# sourceMappingURL=Form-DTO0ZIaB.mjs.map
955
+ //# sourceMappingURL=Form-D9Ee-exF.mjs.map