@strapi/content-manager 5.13.0-beta.0 → 5.13.0-beta.1

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 (41) hide show
  1. package/dist/admin/components/LeftMenu.js +34 -30
  2. package/dist/admin/components/LeftMenu.js.map +1 -1
  3. package/dist/admin/components/LeftMenu.mjs +36 -32
  4. package/dist/admin/components/LeftMenu.mjs.map +1 -1
  5. package/dist/admin/hooks/useDocumentActions.js +1 -5
  6. package/dist/admin/hooks/useDocumentActions.js.map +1 -1
  7. package/dist/admin/hooks/useDocumentActions.mjs +1 -5
  8. package/dist/admin/hooks/useDocumentActions.mjs.map +1 -1
  9. package/dist/admin/hooks/useDocumentContext.js.map +1 -1
  10. package/dist/admin/hooks/useDocumentContext.mjs.map +1 -1
  11. package/dist/admin/pages/EditView/components/DocumentActions.js +21 -206
  12. package/dist/admin/pages/EditView/components/DocumentActions.js.map +1 -1
  13. package/dist/admin/pages/EditView/components/DocumentActions.mjs +23 -208
  14. package/dist/admin/pages/EditView/components/DocumentActions.mjs.map +1 -1
  15. package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.js +137 -199
  16. package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.js.map +1 -1
  17. package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.mjs +137 -199
  18. package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.mjs.map +1 -1
  19. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js +50 -89
  20. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js.map +1 -1
  21. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs +52 -91
  22. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs.map +1 -1
  23. package/dist/admin/pages/ListView/ListViewPage.js +77 -0
  24. package/dist/admin/pages/ListView/ListViewPage.js.map +1 -1
  25. package/dist/admin/pages/ListView/ListViewPage.mjs +78 -1
  26. package/dist/admin/pages/ListView/ListViewPage.mjs.map +1 -1
  27. package/dist/admin/src/hooks/useDocumentContext.d.ts +1 -1
  28. package/dist/admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.d.ts +5 -26
  29. package/dist/admin/translations/en.json.js +1 -2
  30. package/dist/admin/translations/en.json.js.map +1 -1
  31. package/dist/admin/translations/en.json.mjs +1 -2
  32. package/dist/admin/translations/en.json.mjs.map +1 -1
  33. package/dist/server/src/index.d.ts +1 -0
  34. package/dist/server/src/index.d.ts.map +1 -1
  35. package/dist/server/src/services/data-mapper.d.ts +1 -0
  36. package/dist/server/src/services/data-mapper.d.ts.map +1 -1
  37. package/dist/server/src/services/homepage.d.ts +11 -0
  38. package/dist/server/src/services/homepage.d.ts.map +1 -0
  39. package/dist/server/src/services/index.d.ts +1 -0
  40. package/dist/server/src/services/index.d.ts.map +1 -1
  41. package/package.json +5 -5
@@ -51,37 +51,23 @@ const StyledModalContent = styledComponents.styled(designSystem.Modal.Content)`
51
51
  height: 90%;
52
52
  max-height: 100%;
53
53
  `;
54
- const getFullPageUrl = (currentDocumentMeta)=>{
55
- const isSingleType = currentDocumentMeta.collectionType === collections.SINGLE_TYPES;
56
- const queryParams = currentDocumentMeta.params?.locale ? `?plugins[i18n][locale]=${currentDocumentMeta.params.locale}` : '';
57
- return `/content-manager/${currentDocumentMeta.collectionType}/${currentDocumentMeta.model}${isSingleType ? '' : '/' + currentDocumentMeta.documentId}${queryParams}`;
58
- };
59
54
  function reducer(state, action) {
60
55
  switch(action.type){
61
56
  case 'GO_TO_RELATION':
62
57
  if (state.hasUnsavedChanges && !action.payload.shouldBypassConfirmation) {
63
58
  return {
64
59
  ...state,
65
- confirmDialogIntent: action.payload.document,
66
- fieldToConnect: action.payload.fieldToConnect,
67
- fieldToConnectUID: action.payload.fieldToConnectUID
60
+ confirmDialogIntent: action.payload.document
68
61
  };
69
62
  }
70
- const lastItemDocumentHistory = state.documentHistory.at(-1);
71
- const hasToResetDocumentHistory = lastItemDocumentHistory && !lastItemDocumentHistory.documentId;
72
63
  return {
73
64
  ...state,
74
- // Reset document history if the last item has documentId undefined
75
- documentHistory: hasToResetDocumentHistory ? [
76
- action.payload.document
77
- ] : [
65
+ documentHistory: [
78
66
  ...state.documentHistory,
79
67
  action.payload.document
80
68
  ],
81
69
  confirmDialogIntent: null,
82
- isModalOpen: true,
83
- fieldToConnect: hasToResetDocumentHistory ? undefined : action.payload.fieldToConnect,
84
- fieldToConnectUID: hasToResetDocumentHistory ? undefined : action.payload.fieldToConnectUID
70
+ isModalOpen: true
85
71
  };
86
72
  case 'GO_BACK':
87
73
  if (state.hasUnsavedChanges && !action.payload.shouldBypassConfirmation) {
@@ -109,21 +95,6 @@ function reducer(state, action) {
109
95
  isModalOpen: false,
110
96
  confirmDialogIntent: null
111
97
  };
112
- case 'GO_TO_CREATED_RELATION':
113
- return {
114
- ...state,
115
- // Reset document history if the last item has documentId undefined
116
- documentHistory: state.documentHistory ? [
117
- ...state.documentHistory.slice(0, -1),
118
- action.payload.document
119
- ] : [
120
- action.payload.document
121
- ],
122
- confirmDialogIntent: null,
123
- isModalOpen: true,
124
- fieldToConnect: undefined,
125
- fieldToConnectUID: undefined
126
- };
127
98
  case 'CANCEL_CONFIRM_DIALOG':
128
99
  return {
129
100
  ...state,
@@ -153,17 +124,21 @@ function reducer(state, action) {
153
124
  }
154
125
  }
155
126
  const [RelationModalProvider, useRelationModal] = strapiAdmin.createContext('RelationModal');
156
- function isRenderProp(children) {
157
- return typeof children === 'function';
158
- }
159
- const RootRelationRenderer = (props)=>{
160
- const { children } = props;
127
+ const getFullPageUrl = (currentDocumentMeta)=>{
128
+ const isSingleType = currentDocumentMeta.collectionType === collections.SINGLE_TYPES;
129
+ const queryParams = currentDocumentMeta.params?.locale ? `?plugins[i18n][locale]=${currentDocumentMeta.params.locale}` : '';
130
+ return `/content-manager/${currentDocumentMeta.collectionType}/${currentDocumentMeta.model}${isSingleType ? '' : '/' + currentDocumentMeta.documentId}${queryParams}`;
131
+ };
132
+ /**
133
+ * Component responsible of rendering its children wrapped in a modal, form and context if needed
134
+ */ const RelationModalRenderer = ({ children, trigger, relation })=>{
135
+ const { formatMessage } = reactIntl.useIntl();
136
+ const navigate = reactRouterDom.useNavigate();
161
137
  const [state, dispatch] = React__namespace.useReducer(reducer, {
162
138
  documentHistory: [],
163
139
  confirmDialogIntent: null,
164
140
  isModalOpen: false,
165
- hasUnsavedChanges: false,
166
- fieldToConnect: undefined
141
+ hasUnsavedChanges: false
167
142
  });
168
143
  const rootDocument = useDocument.useDoc();
169
144
  const [{ query }] = strapiAdmin.useQueryParams();
@@ -178,9 +153,11 @@ const RootRelationRenderer = (props)=>{
178
153
  };
179
154
  const currentDocumentMeta = state.documentHistory.at(-1) ?? rootDocumentMeta;
180
155
  const currentDocument = useDocument.useDocument(currentDocumentMeta);
181
- // TODO: check if we can remove the single type check
182
- const isSingleType = currentDocumentMeta.collectionType === collections.SINGLE_TYPES;
183
- const isCreating = !currentDocumentMeta.documentId && !isSingleType;
156
+ const parentContextValue = useRelationModal('RelationContextWrapper', (state)=>state, false);
157
+ // A parent relation is already rendering a modal. In this case simply render the trigger
158
+ if (parentContextValue) {
159
+ return trigger;
160
+ }
184
161
  /**
185
162
  * There is no parent relation, so the relation modal doesn't exist. Create it and set up all the
186
163
  * pieces that will be used by potential child relations: the context, header, form, and footer.
@@ -190,156 +167,113 @@ const RootRelationRenderer = (props)=>{
190
167
  rootDocumentMeta: rootDocumentMeta,
191
168
  currentDocumentMeta: currentDocumentMeta,
192
169
  currentDocument: currentDocument,
193
- isCreating: isCreating,
194
- children: /*#__PURE__*/ jsxRuntime.jsx(RelationModal, {
195
- children: isRenderProp(children) ? children({
196
- dispatch
197
- }) : props.relation && /*#__PURE__*/ jsxRuntime.jsx(RelationModalTrigger, {
198
- relation: props.relation,
199
- children: children
200
- })
201
- })
202
- });
203
- };
204
- const NestedRelationRenderer = (props)=>{
205
- const { children } = props;
206
- const dispatch = useRelationModal('NestedRelation', (state)=>state.dispatch);
207
- return isRenderProp(children) ? children({
208
- dispatch
209
- }) : props.relation && /*#__PURE__*/ jsxRuntime.jsx(RelationModalTrigger, {
210
- relation: props.relation,
211
- children: children
212
- }); /* This is the trigger that will be rendered in the parent relation */
213
- };
214
- /**
215
- * Component responsible for rendering its children wrapped in a modal, form and context if needed
216
- */ const RelationModalRenderer = (props)=>{
217
- // We're in a nested relation if the relation modal context is not undefined
218
- const isNested = useRelationModal('RelationContextWrapper', (state)=>state != undefined, false);
219
- return isNested ? /*#__PURE__*/ jsxRuntime.jsx(NestedRelationRenderer, {
220
- ...props
221
- }) : /*#__PURE__*/ jsxRuntime.jsx(RootRelationRenderer, {
222
- ...props
223
- });
224
- };
225
- /* -------------------------------------------------------------------------------------------------
226
- * RelationModal
227
- * -----------------------------------------------------------------------------------------------*/ const generateCreateUrl = (currentDocumentMeta)=>{
228
- return `/content-manager/${currentDocumentMeta.collectionType}/${currentDocumentMeta.model}/create${currentDocumentMeta.params?.locale ? `?plugins[i18n][locale]=${currentDocumentMeta.params.locale}` : ''}`;
229
- };
230
- const RelationModal = ({ children })=>{
231
- const { formatMessage } = reactIntl.useIntl();
232
- const navigate = reactRouterDom.useNavigate();
233
- const state = useRelationModal('RelationModalForm', (state)=>state.state);
234
- const dispatch = useRelationModal('RelationModalForm', (state)=>state.dispatch);
235
- const currentDocumentMeta = useRelationModal('RelationModalForm', (state)=>state.currentDocumentMeta);
236
- const currentDocument = useRelationModal('RelationModalForm', (state)=>state.currentDocument);
237
- const isCreating = useRelationModal('RelationModalForm', (state)=>state.isCreating);
238
- return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Modal.Root, {
239
- open: state.isModalOpen,
240
- onOpenChange: (open)=>{
241
- if (!open) {
242
- dispatch({
243
- type: 'CLOSE_MODAL',
244
- payload: {
245
- shouldBypassConfirmation: false
246
- }
247
- });
248
- }
249
- },
250
- children: [
251
- children,
252
- /*#__PURE__*/ jsxRuntime.jsxs(StyledModalContent, {
253
- children: [
254
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Header, {
255
- gap: 2,
256
- children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
257
- justifyContent: "space-between",
258
- alignItems: "center",
259
- width: "100%",
260
- children: [
261
- /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
262
- gap: 2,
263
- children: [
264
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
265
- withTooltip: false,
266
- label: formatMessage({
267
- id: 'global.back',
268
- defaultMessage: 'Back'
170
+ children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Modal.Root, {
171
+ open: state.isModalOpen,
172
+ onOpenChange: (open)=>{
173
+ if (open) {
174
+ dispatch({
175
+ type: 'GO_TO_RELATION',
176
+ payload: {
177
+ document: relation,
178
+ shouldBypassConfirmation: false
179
+ }
180
+ });
181
+ } else {
182
+ dispatch({
183
+ type: 'CLOSE_MODAL',
184
+ payload: {
185
+ shouldBypassConfirmation: false
186
+ }
187
+ });
188
+ }
189
+ },
190
+ children: [
191
+ trigger,
192
+ /*#__PURE__*/ jsxRuntime.jsxs(StyledModalContent, {
193
+ children: [
194
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Header, {
195
+ gap: 2,
196
+ children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
197
+ justifyContent: "space-between",
198
+ alignItems: "center",
199
+ width: "100%",
200
+ children: [
201
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
202
+ gap: 2,
203
+ children: [
204
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
205
+ withTooltip: false,
206
+ label: formatMessage({
207
+ id: 'global.back',
208
+ defaultMessage: 'Back'
209
+ }),
210
+ variant: "ghost",
211
+ disabled: state.documentHistory.length < 2,
212
+ onClick: ()=>{
213
+ dispatch({
214
+ type: 'GO_BACK',
215
+ payload: {
216
+ shouldBypassConfirmation: false
217
+ }
218
+ });
219
+ },
220
+ marginRight: 1,
221
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.ArrowLeft, {})
269
222
  }),
270
- variant: "ghost",
271
- disabled: state.documentHistory.length < 2,
272
- onClick: ()=>{
273
- dispatch({
274
- type: 'GO_BACK',
275
- payload: {
276
- shouldBypassConfirmation: false
277
- }
278
- });
279
- },
280
- marginRight: 1,
281
- children: /*#__PURE__*/ jsxRuntime.jsx(Icons.ArrowLeft, {})
282
- }),
283
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
284
- tag: "span",
285
- fontWeight: 600,
286
- children: isCreating ? formatMessage({
287
- id: 'content-manager.relation.create',
288
- defaultMessage: 'Create a relation'
289
- }) : formatMessage({
290
- id: 'content-manager.components.RelationInputModal.modal-title',
291
- defaultMessage: 'Edit a relation'
223
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
224
+ tag: "span",
225
+ fontWeight: 600,
226
+ children: formatMessage({
227
+ id: 'content-manager.components.RelationInputModal.modal-title',
228
+ defaultMessage: 'Edit a relation'
229
+ })
292
230
  })
293
- })
294
- ]
295
- }),
296
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
297
- onClick: ()=>{
298
- dispatch({
299
- type: 'GO_FULL_PAGE'
300
- });
301
- if (!state.hasUnsavedChanges) {
302
- if (isCreating) {
303
- navigate(generateCreateUrl(currentDocumentMeta));
304
- } else {
231
+ ]
232
+ }),
233
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
234
+ onClick: ()=>{
235
+ dispatch({
236
+ type: 'GO_FULL_PAGE'
237
+ });
238
+ if (!state.hasUnsavedChanges) {
305
239
  navigate(getFullPageUrl(currentDocumentMeta));
306
240
  }
307
- }
308
- },
309
- variant: "tertiary",
310
- label: formatMessage({
311
- id: 'content-manager.components.RelationInputModal.button-fullpage',
312
- defaultMessage: 'Go to entry'
313
- }),
314
- children: /*#__PURE__*/ jsxRuntime.jsx(Icons.ArrowsOut, {})
315
- })
316
- ]
317
- })
318
- }),
319
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Body, {
320
- children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Form, {
321
- method: isCreating ? 'POST' : 'PUT',
322
- initialValues: currentDocument.getInitialFormValues(isCreating),
323
- validate: (values, options)=>{
324
- const yupSchema = validation.createYupSchema(currentDocument.schema?.attributes, currentDocument.components, {
325
- status: currentDocument.document?.status,
326
- ...options
327
- });
328
- return yupSchema.validate(values, {
329
- abortEarly: false
330
- });
331
- },
332
- children: /*#__PURE__*/ jsxRuntime.jsx(RelationModalBody, {})
241
+ },
242
+ variant: "tertiary",
243
+ label: formatMessage({
244
+ id: 'content-manager.components.RelationInputModal.button-fullpage',
245
+ defaultMessage: 'Go to entry'
246
+ }),
247
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.ArrowsOut, {})
248
+ })
249
+ ]
250
+ })
251
+ }),
252
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Body, {
253
+ children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Form, {
254
+ method: "PUT",
255
+ initialValues: currentDocument.getInitialFormValues(),
256
+ validate: (values, options)=>{
257
+ const yupSchema = validation.createYupSchema(currentDocument.schema?.attributes, currentDocument.components, {
258
+ status: currentDocument.document?.status,
259
+ ...options
260
+ });
261
+ return yupSchema.validate(values, {
262
+ abortEarly: false
263
+ });
264
+ },
265
+ children: children
266
+ })
333
267
  })
334
- })
335
- ]
336
- })
337
- ]
268
+ ]
269
+ })
270
+ ]
271
+ })
338
272
  });
339
273
  };
340
274
  /**
341
275
  * All the main content (not header and footer) of the relation modal, plus the confirmation dialog.
342
- * Will be wrapped in a Modal.Body by the RelationModal component.
276
+ * Will be wrapped in a Modal.Body by the RelationModalRenderer.
343
277
  * Cannot be moved directly inside RelationModal because it needs access to the context via hooks.
344
278
  */ const RelationModalBody = ()=>{
345
279
  const navigate = reactRouterDom.useNavigate();
@@ -350,7 +284,6 @@ const RelationModal = ({ children })=>{
350
284
  const dispatch = useRelationModal('RelationModalForm', (state)=>state.dispatch);
351
285
  const rootDocumentMeta = useRelationModal('RelationModalForm', (state)=>state.rootDocumentMeta);
352
286
  const currentDocumentMeta = useRelationModal('RelationModalForm', (state)=>state.currentDocumentMeta);
353
- const isCreating = useRelationModal('RelationModalForm', (state)=>state.isCreating);
354
287
  /**
355
288
  * One-way sync the modified state from the form to the modal state.
356
289
  * It is needed because we need to consume state from the form context in order to lift it up
@@ -392,11 +325,7 @@ const RelationModal = ({ children })=>{
392
325
  if (isRootDocumentUrl) {
393
326
  handleCloseModal(true);
394
327
  } else {
395
- if (isCreating) {
396
- navigate(generateCreateUrl(currentDocumentMeta));
397
- } else {
398
- navigate(fullPageUrl);
399
- }
328
+ navigate(fullPageUrl);
400
329
  }
401
330
  };
402
331
  const handleConfirm = ()=>{
@@ -426,7 +355,7 @@ const RelationModal = ({ children })=>{
426
355
  };
427
356
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
428
357
  children: [
429
- /*#__PURE__*/ jsxRuntime.jsx(RelationModalForm, {}),
358
+ /*#__PURE__*/ jsxRuntime.jsx(RelationEditView, {}),
430
359
  /*#__PURE__*/ jsxRuntime.jsx(designSystem.Dialog.Root, {
431
360
  open: state.confirmDialogIntent != null,
432
361
  children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.ConfirmDialog, {
@@ -444,7 +373,7 @@ const RelationModal = ({ children })=>{
444
373
  ]
445
374
  });
446
375
  };
447
- const RelationModalTrigger = ({ children, relation })=>{
376
+ const ModalTrigger = ({ children, relation })=>{
448
377
  const dispatch = useRelationModal('ModalTrigger', (state)=>state.dispatch);
449
378
  return /*#__PURE__*/ jsxRuntime.jsx(StyledTextButton, {
450
379
  onClick: ()=>{
@@ -459,6 +388,16 @@ const RelationModalTrigger = ({ children, relation })=>{
459
388
  children: children
460
389
  });
461
390
  };
391
+ const RelationModal = /*#__PURE__*/ React__namespace.memo(({ relation, children })=>{
392
+ return /*#__PURE__*/ jsxRuntime.jsx(RelationModalRenderer, {
393
+ relation: relation,
394
+ trigger: /*#__PURE__*/ jsxRuntime.jsx(ModalTrigger, {
395
+ relation: relation,
396
+ children: children
397
+ }),
398
+ children: /*#__PURE__*/ jsxRuntime.jsx(RelationModalBody, {})
399
+ });
400
+ });
462
401
  const StyledTextButton = styledComponents.styled(designSystem.TextButton)`
463
402
  max-width: 100%;
464
403
  & > span {
@@ -472,14 +411,13 @@ const StyledTextButton = styledComponents.styled(designSystem.TextButton)`
472
411
  /**
473
412
  * The mini edit view for a relation that is displayed inside a modal.
474
413
  * It's complete with its header, document actions and form layout.
475
- */ const RelationModalForm = ()=>{
414
+ */ const RelationEditView = ()=>{
476
415
  const { formatMessage } = reactIntl.useIntl();
477
- const currentDocumentMeta = useRelationModal('RelationModalForm', (state)=>state.currentDocumentMeta);
478
- const isCreating = useRelationModal('RelationModalForm', (state)=>state.isCreating);
479
- const currentDocument = useRelationModal('RelationModalForm', (state)=>state.currentDocument);
416
+ const currentDocumentMeta = useRelationModal('RelationModalBody', (state)=>state.currentDocumentMeta);
417
+ const currentDocument = useRelationModal('RelationModalBody', (state)=>state.currentDocument);
480
418
  const documentLayoutResponse = useDocumentLayout.useDocumentLayout(currentDocumentMeta.model);
481
- const plugins = strapiAdmin.useStrapiApp('RelationModalForm', (state)=>state.plugins);
482
- const initialValues = isCreating ? currentDocument.getInitialFormValues(isCreating) : currentDocument.getInitialFormValues();
419
+ const plugins = strapiAdmin.useStrapiApp('RelationModalBody', (state)=>state.plugins);
420
+ const initialValues = currentDocument.getInitialFormValues();
483
421
  const { permissions = [], isLoading: isLoadingPermissions, error } = strapiAdmin.useRBAC(plugin.PERMISSIONS.map((action)=>({
484
422
  action,
485
423
  subject: currentDocumentMeta.model
@@ -494,7 +432,7 @@ const StyledTextButton = styledComponents.styled(designSystem.TextButton)`
494
432
  })
495
433
  });
496
434
  }
497
- if (error || !currentDocumentMeta.model || documentLayoutResponse.error || !isCreating && !currentDocument.document || !isCreating && !currentDocument.meta || !currentDocument.schema || !initialValues) {
435
+ if (error || !currentDocumentMeta.model || documentLayoutResponse.error || !currentDocument.document || !currentDocument.meta || !currentDocument.schema || !initialValues) {
498
436
  return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
499
437
  alignItems: "center",
500
438
  height: "100%",
@@ -603,7 +541,7 @@ const StyledTextButton = styledComponents.styled(designSystem.TextButton)`
603
541
  });
604
542
  };
605
543
 
606
- exports.RelationModalRenderer = RelationModalRenderer;
544
+ exports.RelationModal = RelationModal;
607
545
  exports.getCollectionType = getCollectionType;
608
546
  exports.reducer = reducer;
609
547
  exports.useRelationModal = useRelationModal;