@strapi/content-manager 0.0.0-experimental.6b93a97ac754785f7894c17263d3b4fd5272454a → 0.0.0-experimental.6cc8ff695218d5a391739344d308dfb3683215c1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/components/DragPreviews/RelationDragPreview.js +1 -1
- package/dist/admin/components/DragPreviews/RelationDragPreview.js.map +1 -1
- package/dist/admin/components/DragPreviews/RelationDragPreview.mjs +1 -1
- package/dist/admin/components/DragPreviews/RelationDragPreview.mjs.map +1 -1
- package/dist/admin/components/LeftMenu.js +34 -30
- package/dist/admin/components/LeftMenu.js.map +1 -1
- package/dist/admin/components/LeftMenu.mjs +36 -32
- package/dist/admin/components/LeftMenu.mjs.map +1 -1
- package/dist/admin/content-manager.js.map +1 -1
- package/dist/admin/content-manager.mjs.map +1 -1
- package/dist/admin/features/DocumentContext.js +71 -0
- package/dist/admin/features/DocumentContext.js.map +1 -0
- package/dist/admin/features/DocumentContext.mjs +49 -0
- package/dist/admin/features/DocumentContext.mjs.map +1 -0
- package/dist/admin/features/DocumentRBAC.js +7 -6
- package/dist/admin/features/DocumentRBAC.js.map +1 -1
- package/dist/admin/features/DocumentRBAC.mjs +7 -6
- package/dist/admin/features/DocumentRBAC.mjs.map +1 -1
- package/dist/admin/history/components/VersionInputRenderer.js.map +1 -1
- package/dist/admin/history/components/VersionInputRenderer.mjs.map +1 -1
- package/dist/admin/history/pages/History.js +9 -1
- package/dist/admin/history/pages/History.js.map +1 -1
- package/dist/admin/history/pages/History.mjs +9 -1
- package/dist/admin/history/pages/History.mjs.map +1 -1
- package/dist/admin/hooks/useDocumentActions.js +12 -3
- package/dist/admin/hooks/useDocumentActions.js.map +1 -1
- package/dist/admin/hooks/useDocumentActions.mjs +12 -3
- package/dist/admin/hooks/useDocumentActions.mjs.map +1 -1
- package/dist/admin/pages/EditView/EditViewPage.js +95 -84
- package/dist/admin/pages/EditView/EditViewPage.js.map +1 -1
- package/dist/admin/pages/EditView/EditViewPage.mjs +95 -84
- package/dist/admin/pages/EditView/EditViewPage.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentActions.js +26 -11
- package/dist/admin/pages/EditView/components/DocumentActions.js.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentActions.mjs +26 -11
- package/dist/admin/pages/EditView/components/DocumentActions.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentStatus.js +1 -2
- package/dist/admin/pages/EditView/components/DocumentStatus.js.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentStatus.mjs +1 -2
- package/dist/admin/pages/EditView/components/DocumentStatus.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Input.js +2 -2
- package/dist/admin/pages/EditView/components/FormInputs/Component/Input.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Input.mjs +2 -2
- package/dist/admin/pages/EditView/components/FormInputs/Component/Input.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.js +4 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.mjs +4 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js +5 -3
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs +5 -3
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.js +17 -8
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.mjs +17 -8
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.js +16 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.mjs +17 -2
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.js +3 -2
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.mjs +3 -2
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.js +460 -0
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.js.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.mjs +438 -0
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.mjs.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/{Relations.js → Relations/Relations.js} +65 -42
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/{Relations.mjs → Relations/Relations.mjs} +66 -43
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs.map +1 -0
- package/dist/admin/pages/EditView/components/FormLayout.js +20 -13
- package/dist/admin/pages/EditView/components/FormLayout.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormLayout.mjs +20 -13
- package/dist/admin/pages/EditView/components/FormLayout.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/InputRenderer.js +35 -8
- package/dist/admin/pages/EditView/components/InputRenderer.js.map +1 -1
- package/dist/admin/pages/EditView/components/InputRenderer.mjs +18 -10
- package/dist/admin/pages/EditView/components/InputRenderer.mjs.map +1 -1
- package/dist/admin/pages/ListView/ListViewPage.js +41 -0
- package/dist/admin/pages/ListView/ListViewPage.js.map +1 -1
- package/dist/admin/pages/ListView/ListViewPage.mjs +42 -1
- package/dist/admin/pages/ListView/ListViewPage.mjs.map +1 -1
- package/dist/admin/pages/ListView/components/TableCells/Relations.js +0 -1
- package/dist/admin/pages/ListView/components/TableCells/Relations.js.map +1 -1
- package/dist/admin/pages/ListView/components/TableCells/Relations.mjs +0 -1
- package/dist/admin/pages/ListView/components/TableCells/Relations.mjs.map +1 -1
- package/dist/admin/preview/components/PreviewHeader.js +5 -77
- package/dist/admin/preview/components/PreviewHeader.js.map +1 -1
- package/dist/admin/preview/components/PreviewHeader.mjs +7 -78
- package/dist/admin/preview/components/PreviewHeader.mjs.map +1 -1
- package/dist/admin/preview/pages/Preview.js +47 -39
- package/dist/admin/preview/pages/Preview.js.map +1 -1
- package/dist/admin/preview/pages/Preview.mjs +48 -40
- package/dist/admin/preview/pages/Preview.mjs.map +1 -1
- package/dist/admin/services/documents.js +16 -0
- package/dist/admin/services/documents.js.map +1 -1
- package/dist/admin/services/documents.mjs +16 -0
- package/dist/admin/services/documents.mjs.map +1 -1
- package/dist/admin/src/content-manager.d.ts +2 -0
- package/dist/admin/src/features/DocumentContext.d.ts +53 -0
- package/dist/admin/src/features/DocumentRBAC.d.ts +3 -2
- package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.d.ts +8 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/{Relations.d.ts → Relations/Relations.d.ts} +8 -2
- package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +8 -3
- package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +7 -4
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +1 -2
- package/dist/admin/src/preview/pages/Preview.d.ts +0 -2
- package/dist/admin/translations/en.json.js +3 -0
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +3 -0
- package/dist/admin/translations/en.json.mjs.map +1 -1
- package/dist/admin/translations/zh-Hans.json.js +2 -1
- package/dist/admin/translations/zh-Hans.json.js.map +1 -1
- package/dist/admin/translations/zh-Hans.json.mjs +2 -1
- package/dist/admin/translations/zh-Hans.json.mjs.map +1 -1
- package/dist/server/src/index.d.ts +1 -0
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/services/data-mapper.d.ts +1 -0
- package/dist/server/src/services/data-mapper.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +1 -0
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/admin/pages/EditView/components/FormInputs/Relations.js.map +0 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations.mjs.map +0 -1
- package/dist/admin/preview/components/PreviewContent.js +0 -25
- package/dist/admin/preview/components/PreviewContent.js.map +0 -1
- package/dist/admin/preview/components/PreviewContent.mjs +0 -23
- package/dist/admin/preview/components/PreviewContent.mjs.map +0 -1
- package/dist/admin/src/preview/components/PreviewContent.d.ts +0 -2
package/dist/admin/pages/EditView/components/FormInputs/{Relations.js → Relations/Relations.js}
RENAMED
@@ -9,20 +9,20 @@ var fractionalIndexing = require('fractional-indexing');
|
|
9
9
|
var pipe = require('lodash/fp/pipe');
|
10
10
|
var reactDndHtml5Backend = require('react-dnd-html5-backend');
|
11
11
|
var reactIntl = require('react-intl');
|
12
|
-
var reactRouterDom = require('react-router-dom');
|
13
12
|
var reactWindow = require('react-window');
|
14
13
|
var styledComponents = require('styled-components');
|
15
|
-
var collections = require('
|
16
|
-
var dragAndDrop = require('
|
17
|
-
var
|
18
|
-
var
|
19
|
-
var useDragAndDrop = require('
|
20
|
-
var relations = require('
|
21
|
-
var api = require('
|
22
|
-
var relations$1 = require('
|
23
|
-
var translations = require('
|
24
|
-
var DocumentStatus = require('
|
25
|
-
var ComponentContext = require('
|
14
|
+
var collections = require('../../../../../constants/collections.js');
|
15
|
+
var dragAndDrop = require('../../../../../constants/dragAndDrop.js');
|
16
|
+
var DocumentContext = require('../../../../../features/DocumentContext.js');
|
17
|
+
var useDebounce = require('../../../../../hooks/useDebounce.js');
|
18
|
+
var useDragAndDrop = require('../../../../../hooks/useDragAndDrop.js');
|
19
|
+
var relations = require('../../../../../services/relations.js');
|
20
|
+
var api = require('../../../../../utils/api.js');
|
21
|
+
var relations$1 = require('../../../../../utils/relations.js');
|
22
|
+
var translations = require('../../../../../utils/translations.js');
|
23
|
+
var DocumentStatus = require('../../DocumentStatus.js');
|
24
|
+
var ComponentContext = require('../ComponentContext.js');
|
25
|
+
var RelationModal = require('./RelationModal.js');
|
26
26
|
|
27
27
|
function _interopNamespaceDefault(e) {
|
28
28
|
var n = Object.create(null);
|
@@ -96,12 +96,17 @@ const ONE_WAY_RELATIONS = [
|
|
96
96
|
* At present we do not expose this to plugin developers, however, they are able to overwrite it themselves should
|
97
97
|
* they wish to do so.
|
98
98
|
*/ const RelationsField = /*#__PURE__*/ React__namespace.forwardRef(({ disabled, label, ...props }, ref)=>{
|
99
|
+
const currentDocumentMeta = DocumentContext.useDocumentContext('RelationsField', (state)=>state.meta);
|
100
|
+
const currentDocument = DocumentContext.useDocumentContext('RelationsField', (state)=>state.document);
|
101
|
+
const rootDocumentMeta = DocumentContext.useDocumentContext('RelationsField', (state)=>state.rootDocumentMeta);
|
99
102
|
const [currentPage, setCurrentPage] = React__namespace.useState(1);
|
100
|
-
const
|
101
|
-
const
|
103
|
+
const isRootDocument = rootDocumentMeta.documentId === currentDocumentMeta.documentId;
|
104
|
+
const documentMeta = isRootDocument ? rootDocumentMeta : currentDocumentMeta;
|
105
|
+
// Use the documentId from the actual document, not the params (meta)
|
106
|
+
const documentId = currentDocument.document?.documentId;
|
102
107
|
const { formatMessage } = reactIntl.useIntl();
|
103
108
|
const [{ query }] = strapiAdmin.useQueryParams();
|
104
|
-
const params = api.buildValidParams(query);
|
109
|
+
const params = documentMeta.params ?? api.buildValidParams(query);
|
105
110
|
const isMorph = props.attribute.relation.toLowerCase().includes('morph');
|
106
111
|
const isDisabled = isMorph || disabled;
|
107
112
|
const { componentId, componentUID } = ComponentContext.useComponent('RelationsField', ({ uid, id })=>({
|
@@ -114,22 +119,29 @@ const ONE_WAY_RELATIONS = [
|
|
114
119
|
}, [
|
115
120
|
isSubmitting
|
116
121
|
]);
|
122
|
+
const component = componentUID && currentDocument.components[componentUID];
|
117
123
|
/**
|
118
124
|
* We'll always have a documentId in a created entry, so we look for a componentId first.
|
119
125
|
* Same with `uid` and `documentModel`.
|
120
|
-
*/ const
|
121
|
-
const
|
126
|
+
*/ const model = component ? component.uid : documentMeta.model;
|
127
|
+
const id = component && componentId ? componentId.toString() : documentId;
|
122
128
|
/**
|
123
129
|
* The `name` prop is a complete path to the field, e.g. `field1.field2.field3`.
|
124
130
|
* Where the above example would a nested field within two components, however
|
125
131
|
* we only require the field on the component not the complete path since we query
|
126
132
|
* individual components. Therefore we split the string and take the last item.
|
127
133
|
*/ const [targetField] = props.name.split('.').slice(-1);
|
134
|
+
const schemaAttributes = component ? component.attributes ?? {} : currentDocument.schema?.attributes ?? {};
|
135
|
+
/**
|
136
|
+
* Confirm the target field is related to the current document.
|
137
|
+
* Since relations can exist in a modal on top of the root document,
|
138
|
+
* we need to ensure we are fetching relations for the correct document (root document vs related document),
|
139
|
+
*/ const isRelatedToCurrentDocument = Object.values(schemaAttributes).filter((attribute)=>attribute.type === 'relation' && 'target' in attribute && 'target' in props.attribute && attribute.target === props.attribute.target).length > 0;
|
128
140
|
const { data, isLoading, isFetching } = relations.useGetRelationsQuery({
|
129
141
|
model,
|
130
142
|
targetField,
|
131
143
|
// below we don't run the query if there is no id.
|
132
|
-
id
|
144
|
+
id,
|
133
145
|
params: {
|
134
146
|
...params,
|
135
147
|
pageSize: RELATIONS_TO_DISPLAY,
|
@@ -137,7 +149,7 @@ const ONE_WAY_RELATIONS = [
|
|
137
149
|
}
|
138
150
|
}, {
|
139
151
|
refetchOnMountOrArgChange: true,
|
140
|
-
skip: !id,
|
152
|
+
skip: !id || !isRelatedToCurrentDocument,
|
141
153
|
selectFromResult: (result)=>{
|
142
154
|
return {
|
143
155
|
...result,
|
@@ -246,10 +258,11 @@ const ONE_WAY_RELATIONS = [
|
|
246
258
|
/*#__PURE__*/ jsxRuntime.jsx(RelationsInput, {
|
247
259
|
disabled: isDisabled,
|
248
260
|
// NOTE: we should not default to using the documentId if the component is being created (componentUID is undefined)
|
249
|
-
id: componentUID ? componentId ? `${componentId}` : '' : documentId,
|
261
|
+
id: componentUID && component ? componentId ? `${componentId}` : '' : documentId,
|
250
262
|
label: `${label} ${relationsCount > 0 ? `(${relationsCount})` : ''}`,
|
251
263
|
model: model,
|
252
264
|
onChange: handleConnect,
|
265
|
+
isRelatedToCurrentDocument: isRelatedToCurrentDocument,
|
253
266
|
...props
|
254
267
|
}),
|
255
268
|
'pagination' in data && data.pagination && data.pagination.pageCount > data.pagination.page ? /*#__PURE__*/ jsxRuntime.jsx(designSystem.TextButton, {
|
@@ -272,7 +285,9 @@ const ONE_WAY_RELATIONS = [
|
|
272
285
|
disabled: isDisabled,
|
273
286
|
name: props.name,
|
274
287
|
isLoading: isFetchingMoreRelations,
|
275
|
-
relationType: props.attribute.relation
|
288
|
+
relationType: props.attribute.relation,
|
289
|
+
// @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
|
290
|
+
targetModel: props.attribute.targetModel
|
276
291
|
})
|
277
292
|
]
|
278
293
|
});
|
@@ -315,7 +330,7 @@ const ONE_WAY_RELATIONS = [
|
|
315
330
|
/**
|
316
331
|
* @description Contains all the logic for the combobox that can search
|
317
332
|
* for relations and then add them to the field's connect array.
|
318
|
-
*/ const RelationsInput = ({ hint, id, model, label, labelAction, name, mainField, placeholder, required, unique: _unique, 'aria-label': _ariaLabel, onChange, ...props })=>{
|
333
|
+
*/ const RelationsInput = ({ hint, id, model, label, labelAction, name, mainField, placeholder, required, unique: _unique, 'aria-label': _ariaLabel, onChange, isRelatedToCurrentDocument, ...props })=>{
|
319
334
|
const [textValue, setTextValue] = React__namespace.useState('');
|
320
335
|
const [searchParams, setSearchParams] = React__namespace.useState({
|
321
336
|
_q: '',
|
@@ -323,6 +338,10 @@ const ONE_WAY_RELATIONS = [
|
|
323
338
|
});
|
324
339
|
const { toggleNotification } = strapiAdmin.useNotification();
|
325
340
|
const [{ query }] = strapiAdmin.useQueryParams();
|
341
|
+
const currentDocumentMeta = DocumentContext.useDocumentContext('RelationsInput', (state)=>state.meta);
|
342
|
+
const rootDocumentMeta = DocumentContext.useDocumentContext('RelationsInput', (state)=>state.rootDocumentMeta);
|
343
|
+
const isRootDocument = rootDocumentMeta.documentId === currentDocumentMeta.documentId;
|
344
|
+
const documentMeta = isRootDocument ? rootDocumentMeta : currentDocumentMeta;
|
326
345
|
const { formatMessage } = reactIntl.useIntl();
|
327
346
|
const fieldRef = strapiAdmin.useFocusInputField(name);
|
328
347
|
const field = strapiAdmin.useField(name);
|
@@ -340,11 +359,14 @@ const ONE_WAY_RELATIONS = [
|
|
340
359
|
* we only require the field on the component not the complete path since we query
|
341
360
|
* individual components. Therefore we split the string and take the last item.
|
342
361
|
*/ const [targetField] = name.split('.').slice(-1);
|
362
|
+
// Return early if there is no relation to the document
|
363
|
+
if (!isRelatedToCurrentDocument) return;
|
364
|
+
const params = documentMeta.params ?? api.buildValidParams(query);
|
343
365
|
searchForTrigger({
|
344
366
|
model,
|
345
367
|
targetField,
|
346
368
|
params: {
|
347
|
-
...
|
369
|
+
...params,
|
348
370
|
id: id ?? '',
|
349
371
|
pageSize: 10,
|
350
372
|
idsToInclude: field.value?.disconnect?.map((rel)=>rel.id.toString()) ?? [],
|
@@ -360,7 +382,9 @@ const ONE_WAY_RELATIONS = [
|
|
360
382
|
name,
|
361
383
|
query,
|
362
384
|
searchForTrigger,
|
363
|
-
searchParamsDebounced
|
385
|
+
searchParamsDebounced,
|
386
|
+
isRelatedToCurrentDocument,
|
387
|
+
documentMeta
|
364
388
|
]);
|
365
389
|
const handleSearch = async (search)=>{
|
366
390
|
setSearchParams((s)=>({
|
@@ -482,7 +506,7 @@ const ONE_WAY_RELATIONS = [
|
|
482
506
|
* RelationsList
|
483
507
|
* -----------------------------------------------------------------------------------------------*/ const RELATION_ITEM_HEIGHT = 50;
|
484
508
|
const RELATION_GUTTER = 4;
|
485
|
-
const RelationsList = ({ data, serverData, disabled, name, isLoading, relationType })=>{
|
509
|
+
const RelationsList = ({ data, serverData, disabled, name, isLoading, relationType, targetModel })=>{
|
486
510
|
const ariaDescriptionId = React__namespace.useId();
|
487
511
|
const { formatMessage } = reactIntl.useIntl();
|
488
512
|
const listRef = React__namespace.useRef(null);
|
@@ -566,8 +590,8 @@ const RelationsList = ({ data, serverData, disabled, name, isLoading, relationTy
|
|
566
590
|
...{
|
567
591
|
apiData: {
|
568
592
|
id: relation.id,
|
569
|
-
documentId: relation.documentId,
|
570
|
-
locale: relation.locale,
|
593
|
+
documentId: relation.documentId ?? relation.apiData?.documentId ?? '',
|
594
|
+
locale: relation.locale || relation.apiData?.locale,
|
571
595
|
position
|
572
596
|
}
|
573
597
|
}
|
@@ -646,7 +670,8 @@ const RelationsList = ({ data, serverData, disabled, name, isLoading, relationTy
|
|
646
670
|
handleMoveItem,
|
647
671
|
name,
|
648
672
|
handleDisconnect,
|
649
|
-
relations: data
|
673
|
+
relations: data,
|
674
|
+
targetModel
|
650
675
|
},
|
651
676
|
itemKey: (index)=>data[index].id,
|
652
677
|
innerElementType: "ol",
|
@@ -687,9 +712,9 @@ const ShadowBox = styledComponents.styled(designSystem.Box)`
|
|
687
712
|
}
|
688
713
|
`;
|
689
714
|
const ListItem = ({ data, index, style })=>{
|
690
|
-
const { ariaDescribedBy, canDrag = false, disabled = false, handleCancel, handleDisconnect, handleDropItem, handleGrabItem, handleMoveItem, name, relations } = data;
|
715
|
+
const { ariaDescribedBy, canDrag = false, disabled = false, handleCancel, handleDisconnect, handleDropItem, handleGrabItem, handleMoveItem, name, relations, targetModel } = data;
|
691
716
|
const { formatMessage } = reactIntl.useIntl();
|
692
|
-
const { href, id, label, status } = relations[index];
|
717
|
+
const { href, id, label, status, documentId, apiData, locale } = relations[index];
|
693
718
|
const [{ handlerId, isDragging, handleKeyDown }, relationRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop.useDragAndDrop(canDrag && !disabled, {
|
694
719
|
type: `${dragAndDrop.ItemTypes.RELATION}_${name}`,
|
695
720
|
index,
|
@@ -756,18 +781,16 @@ const ListItem = ({ data, index, style })=>{
|
|
756
781
|
paddingTop: 1,
|
757
782
|
paddingBottom: 1,
|
758
783
|
paddingRight: 4,
|
759
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
children: label
|
770
|
-
})
|
784
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(RelationModal.RelationModalForm, {
|
785
|
+
triggerButtonLabel: label,
|
786
|
+
relation: {
|
787
|
+
documentId: documentId ?? apiData?.documentId,
|
788
|
+
model: targetModel,
|
789
|
+
collectionType: RelationModal.getCollectionType(href),
|
790
|
+
params: {
|
791
|
+
locale: locale || apiData?.locale || null
|
792
|
+
}
|
793
|
+
}
|
771
794
|
})
|
772
795
|
}),
|
773
796
|
status ? /*#__PURE__*/ jsxRuntime.jsx(DocumentStatus.DocumentStatus, {
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Relations.js","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/Relations/Relations.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n type InputProps,\n useField,\n useForm,\n useNotification,\n useFocusInputField,\n useQueryParams,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Combobox,\n ComboboxOption,\n Flex,\n IconButton,\n TextButton,\n Typography,\n VisuallyHidden,\n useComposedRefs,\n Link,\n Field,\n FlexComponent,\n BoxComponent,\n} from '@strapi/design-system';\nimport { Cross, Drag, ArrowClockwise } from '@strapi/icons';\nimport { generateNKeysBetween } from 'fractional-indexing';\nimport pipe from 'lodash/fp/pipe';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { FixedSizeList, ListChildComponentProps } from 'react-window';\nimport { styled } from 'styled-components';\n\nimport { RelationDragPreviewProps } from '../../../../../components/DragPreviews/RelationDragPreview';\nimport { COLLECTION_TYPES } from '../../../../../constants/collections';\nimport { ItemTypes } from '../../../../../constants/dragAndDrop';\nimport { useDocumentContext } from '../../../../../features/DocumentContext';\nimport { useDebounce } from '../../../../../hooks/useDebounce';\nimport { type EditFieldLayout } from '../../../../../hooks/useDocumentLayout';\nimport {\n DROP_SENSITIVITY,\n UseDragAndDropOptions,\n useDragAndDrop,\n} from '../../../../../hooks/useDragAndDrop';\nimport {\n useGetRelationsQuery,\n useLazySearchRelationsQuery,\n RelationResult,\n} from '../../../../../services/relations';\nimport { buildValidParams } from '../../../../../utils/api';\nimport { getRelationLabel } from '../../../../../utils/relations';\nimport { getTranslation } from '../../../../../utils/translations';\nimport { DocumentStatus } from '../../DocumentStatus';\nimport { useComponent } from '../ComponentContext';\nimport { RelationModalForm, getCollectionType } from '../Relations/RelationModal';\n\nimport type { Schema } from '@strapi/types';\n\n/**\n * Remove a relation, whether it's been already saved or not.\n * It's used both in RelationsList, where the \"remove relation\" button is, and in the input,\n * because we sometimes need to remove a previous relation when selecting a new one.\n */\nfunction useHandleDisconnect(fieldName: string, consumerName: string) {\n const field = useField(fieldName);\n const removeFieldRow = useForm(consumerName, (state) => state.removeFieldRow);\n const addFieldRow = useForm(consumerName, (state) => state.addFieldRow);\n\n const handleDisconnect: ListItemProps['data']['handleDisconnect'] = (relation) => {\n if (field.value && field.value.connect) {\n /**\n * A relation will exist in the `connect` array _if_ it has\n * been added without saving. In this case, we just remove it\n * from the connect array\n */\n const indexOfRelationInConnectArray = field.value.connect.findIndex(\n (rel: NonNullable<RelationsFormValue['connect']>[number]) => rel.id === relation.id\n );\n\n if (indexOfRelationInConnectArray >= 0) {\n removeFieldRow(`${fieldName}.connect`, indexOfRelationInConnectArray);\n return;\n }\n }\n\n addFieldRow(`${fieldName}.disconnect`, {\n id: relation.id,\n apiData: {\n id: relation.id,\n documentId: relation.documentId,\n locale: relation.locale,\n },\n });\n };\n\n return handleDisconnect;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * RelationsField\n * -----------------------------------------------------------------------------------------------*/\n\nconst RELATIONS_TO_DISPLAY = 5;\nconst ONE_WAY_RELATIONS = ['oneWay', 'oneToOne', 'manyToOne', 'oneToManyMorph', 'oneToOneMorph'];\n\ntype RelationPosition =\n | (Pick<RelationResult, 'status' | 'locale'> & {\n before: string;\n end?: never;\n })\n | { end: boolean; before?: never; status?: never; locale?: never };\n\ninterface Relation extends Pick<RelationResult, 'documentId' | 'id' | 'locale' | 'status'> {\n href: string;\n label: string;\n position?: RelationPosition;\n __temp_key__: string;\n apiData?: {\n documentId: RelationResult['documentId'];\n id: RelationResult['id'];\n locale?: RelationResult['locale'];\n position: RelationPosition;\n };\n}\n\ninterface RelationsFieldProps\n extends Omit<Extract<EditFieldLayout, { type: 'relation' }>, 'size' | 'hint'>,\n Pick<InputProps, 'hint'> {}\n\nexport interface RelationsFormValue {\n connect?: Relation[];\n disconnect?: Pick<Relation, 'id'>[];\n}\n\n/**\n * TODO: we get a rather ugly flash when we remove a single relation from the list leaving\n * no other relations when we press save. The initial relation re-renders, probably because\n * of the lag in the Form cleaning it's \"disconnect\" array, whilst our data has not been invalidated.\n *\n * Could we invalidate relation data on the document actions? Should we?\n */\n\n/**\n * @internal\n * @description The relations field holds a lot of domain logic for handling relations which is rather complicated\n * At present we do not expose this to plugin developers, however, they are able to overwrite it themselves should\n * they wish to do so.\n */\nconst RelationsField = React.forwardRef<HTMLDivElement, RelationsFieldProps>(\n ({ disabled, label, ...props }, ref) => {\n const currentDocumentMeta = useDocumentContext('RelationsField', (state) => state.meta);\n const currentDocument = useDocumentContext('RelationsField', (state) => state.document);\n const rootDocumentMeta = useDocumentContext(\n 'RelationsField',\n (state) => state.rootDocumentMeta\n );\n\n const [currentPage, setCurrentPage] = React.useState(1);\n const isRootDocument = rootDocumentMeta.documentId === currentDocumentMeta.documentId;\n const documentMeta = isRootDocument ? rootDocumentMeta : currentDocumentMeta;\n\n // Use the documentId from the actual document, not the params (meta)\n const documentId = currentDocument.document?.documentId;\n\n const { formatMessage } = useIntl();\n\n const [{ query }] = useQueryParams();\n const params = documentMeta.params ?? buildValidParams(query);\n\n const isMorph = props.attribute.relation.toLowerCase().includes('morph');\n const isDisabled = isMorph || disabled;\n\n const { componentId, componentUID } = useComponent('RelationsField', ({ uid, id }) => ({\n componentId: id,\n componentUID: uid,\n }));\n\n const isSubmitting = useForm('RelationsList', (state) => state.isSubmitting);\n\n React.useEffect(() => {\n setCurrentPage(1);\n }, [isSubmitting]);\n\n const component = componentUID && currentDocument.components[componentUID];\n /**\n * We'll always have a documentId in a created entry, so we look for a componentId first.\n * Same with `uid` and `documentModel`.\n */\n const model = component ? component.uid : documentMeta.model;\n const id = component && componentId ? componentId.toString() : documentId;\n\n /**\n * The `name` prop is a complete path to the field, e.g. `field1.field2.field3`.\n * Where the above example would a nested field within two components, however\n * we only require the field on the component not the complete path since we query\n * individual components. Therefore we split the string and take the last item.\n */\n const [targetField] = props.name.split('.').slice(-1);\n\n const schemaAttributes = component\n ? (component.attributes ?? {})\n : (currentDocument.schema?.attributes ?? {});\n\n /**\n * Confirm the target field is related to the current document.\n * Since relations can exist in a modal on top of the root document,\n * we need to ensure we are fetching relations for the correct document (root document vs related document),\n */\n const isRelatedToCurrentDocument =\n Object.values(schemaAttributes).filter(\n (attribute) =>\n attribute.type === 'relation' &&\n 'target' in attribute &&\n 'target' in props.attribute &&\n attribute.target === props.attribute.target\n ).length > 0;\n\n const { data, isLoading, isFetching } = useGetRelationsQuery(\n {\n model,\n targetField,\n // below we don't run the query if there is no id.\n id,\n params: {\n ...params,\n pageSize: RELATIONS_TO_DISPLAY,\n page: currentPage,\n },\n },\n {\n refetchOnMountOrArgChange: true,\n skip: !id || !isRelatedToCurrentDocument,\n selectFromResult: (result) => {\n return {\n ...result,\n data: {\n ...result.data,\n results: result.data?.results ? result.data.results : [],\n },\n };\n },\n }\n );\n\n const handleLoadMore = () => {\n setCurrentPage((prev) => prev + 1);\n };\n\n const field = useField(props.name);\n\n const isFetchingMoreRelations = isLoading || isFetching;\n\n const realServerRelationsCount =\n 'pagination' in data && data.pagination ? data.pagination.total : 0;\n\n /**\n * Items that are already connected, but reordered would be in\n * this list, so to get an accurate figure, we remove them.\n */\n const relationsConnected =\n (field.value?.connect ?? []).filter(\n (rel: Relation) => data.results.findIndex((relation) => relation.id === rel.id) === -1\n ).length ?? 0;\n const relationsDisconnected = field.value?.disconnect?.length ?? 0;\n\n const relationsCount = realServerRelationsCount + relationsConnected - relationsDisconnected;\n\n /**\n * This is it, the source of truth for reordering in conjunction with partial loading & updating\n * of relations. Relations on load are given __temp_key__ when fetched, because we don't want to\n * create brand new keys everytime the data updates, just keep adding them onto the newly loaded ones.\n */\n const relations = React.useMemo(() => {\n const ctx = {\n field: field.value,\n // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.\n href: `../${COLLECTION_TYPES}/${props.attribute.targetModel}`,\n mainField: props.mainField,\n };\n\n /**\n * Tidy up our data.\n */\n const transformations = pipe(\n removeConnected(ctx),\n removeDisconnected(ctx),\n addLabelAndHref(ctx)\n );\n\n const transformedRels = transformations([...data.results]);\n\n /**\n * THIS IS CRUCIAL. If you don't sort by the __temp_key__ which comes from fractional indexing\n * then the list will be in the wrong order.\n */\n return [...transformedRels, ...(field.value?.connect ?? [])].sort((a, b) => {\n if (a.__temp_key__ < b.__temp_key__) return -1;\n if (a.__temp_key__ > b.__temp_key__) return 1;\n return 0;\n });\n }, [\n data.results,\n field.value,\n // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.\n props.attribute.targetModel,\n props.mainField,\n ]);\n\n const handleDisconnect = useHandleDisconnect(props.name, 'RelationsField');\n\n const handleConnect: RelationsInputProps['onChange'] = (relation) => {\n const [lastItemInList] = relations.slice(-1);\n\n const item = {\n id: relation.id,\n apiData: {\n id: relation.id,\n documentId: relation.documentId,\n locale: relation.locale,\n },\n status: relation.status,\n /**\n * If there's a last item, that's the first key we use to generate out next one.\n */\n __temp_key__: generateNKeysBetween(lastItemInList?.__temp_key__ ?? null, null, 1)[0],\n // Fallback to `id` if there is no `mainField` value, which will overwrite the above `id` property with the exact same data.\n [props.mainField?.name ?? 'documentId']: relation[props.mainField?.name ?? 'documentId'],\n label: getRelationLabel(relation, props.mainField),\n // @ts-expect-error – targetModel does exist on the attribute, but it's not typed.\n href: `../${COLLECTION_TYPES}/${props.attribute.targetModel}/${relation.documentId}?${relation.locale ? `plugins[i18n][locale]=${relation.locale}` : ''}`,\n };\n\n if (ONE_WAY_RELATIONS.includes(props.attribute.relation)) {\n // Remove any existing relation so they can be replaced with the new one\n field.value?.connect?.forEach(handleDisconnect);\n relations.forEach(handleDisconnect);\n\n field.onChange(`${props.name}.connect`, [item]);\n } else {\n field.onChange(`${props.name}.connect`, [...(field.value?.connect ?? []), item]);\n }\n };\n\n return (\n <Flex\n ref={ref}\n direction=\"column\"\n gap={3}\n justifyContent=\"space-between\"\n alignItems=\"stretch\"\n wrap=\"wrap\"\n >\n <StyledFlex direction=\"column\" alignItems=\"start\" gap={2} width=\"100%\">\n <RelationsInput\n disabled={isDisabled}\n // NOTE: we should not default to using the documentId if the component is being created (componentUID is undefined)\n id={componentUID && component ? (componentId ? `${componentId}` : '') : documentId}\n label={`${label} ${relationsCount > 0 ? `(${relationsCount})` : ''}`}\n model={model}\n onChange={handleConnect}\n isRelatedToCurrentDocument={isRelatedToCurrentDocument}\n {...props}\n />\n {'pagination' in data &&\n data.pagination &&\n data.pagination.pageCount > data.pagination.page ? (\n <TextButton\n disabled={isFetchingMoreRelations}\n onClick={handleLoadMore}\n loading={isFetchingMoreRelations}\n startIcon={<ArrowClockwise />}\n // prevent the label from line-wrapping\n shrink={0}\n >\n {formatMessage({\n id: getTranslation('relation.loadMore'),\n defaultMessage: 'Load More',\n })}\n </TextButton>\n ) : null}\n </StyledFlex>\n <RelationsList\n data={relations}\n serverData={data.results}\n disabled={isDisabled}\n name={props.name}\n isLoading={isFetchingMoreRelations}\n relationType={props.attribute.relation}\n // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.\n targetModel={props.attribute.targetModel}\n />\n </Flex>\n );\n }\n);\n\n/**\n * TODO: this can be removed once we stop shipping Inputs with\n * labels wrapped round in DS@2.\n */\nconst StyledFlex = styled<FlexComponent>(Flex)`\n & > div {\n width: 100%;\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * Relation Transformations\n * -----------------------------------------------------------------------------------------------*/\n\ninterface TransformationContext extends Pick<RelationsFieldProps, 'mainField'> {\n field?: RelationsFormValue;\n href: string;\n}\n\n/**\n * If it's in the connected array, it can get out of our data array,\n * we'll be putting it back in later and sorting it anyway.\n */\nconst removeConnected =\n ({ field }: TransformationContext) =>\n (relations: RelationResult[]) => {\n return relations.filter((relation) => {\n const connectedRelations = field?.connect ?? [];\n\n return connectedRelations.findIndex((rel) => rel.id === relation.id) === -1;\n });\n };\n\n/**\n * @description Removes relations that are in the `disconnect` array of the field\n */\nconst removeDisconnected =\n ({ field }: TransformationContext) =>\n (relations: RelationResult[]): RelationResult[] =>\n relations.filter((relation) => {\n const disconnectedRelations = field?.disconnect ?? [];\n\n return disconnectedRelations.findIndex((rel) => rel.id === relation.id) === -1;\n });\n\n/**\n * @description Adds a label and href to the relation object we use this to render\n * a better UI where we can link to the relation and display a human-readable label.\n */\nconst addLabelAndHref =\n ({ mainField, href }: TransformationContext) =>\n (relations: RelationResult[]): Relation[] =>\n relations.map((relation) => {\n return {\n ...relation,\n // Fallback to `id` if there is no `mainField` value, which will overwrite the above `documentId` property with the exact same data.\n [mainField?.name ?? 'documentId']: relation[mainField?.name ?? 'documentId'],\n label: getRelationLabel(relation, mainField),\n href: `${href}/${relation.documentId}?${relation.locale ? `plugins[i18n][locale]=${relation.locale}` : ''}`,\n };\n });\n\n/* -------------------------------------------------------------------------------------------------\n * RelationsInput\n * -----------------------------------------------------------------------------------------------*/\n\ninterface RelationsInputProps extends Omit<RelationsFieldProps, 'type'> {\n id?: string;\n model: string;\n isRelatedToCurrentDocument: boolean;\n onChange: (\n relation: Pick<RelationResult, 'documentId' | 'id' | 'locale' | 'status'> & {\n [key: string]: any;\n }\n ) => void;\n}\n\n/**\n * @description Contains all the logic for the combobox that can search\n * for relations and then add them to the field's connect array.\n */\nconst RelationsInput = ({\n hint,\n id,\n model,\n label,\n labelAction,\n name,\n mainField,\n placeholder,\n required,\n unique: _unique,\n 'aria-label': _ariaLabel,\n onChange,\n isRelatedToCurrentDocument,\n ...props\n}: RelationsInputProps) => {\n const [textValue, setTextValue] = React.useState<string | undefined>('');\n const [searchParams, setSearchParams] = React.useState({\n _q: '',\n page: 1,\n });\n const { toggleNotification } = useNotification();\n const [{ query }] = useQueryParams();\n const currentDocumentMeta = useDocumentContext('RelationsInput', (state) => state.meta);\n const rootDocumentMeta = useDocumentContext('RelationsInput', (state) => state.rootDocumentMeta);\n const isRootDocument = rootDocumentMeta.documentId === currentDocumentMeta.documentId;\n const documentMeta = isRootDocument ? rootDocumentMeta : currentDocumentMeta;\n\n const { formatMessage } = useIntl();\n const fieldRef = useFocusInputField<HTMLInputElement>(name);\n const field = useField<RelationsFormValue>(name);\n\n const searchParamsDebounced = useDebounce(searchParams, 300);\n const [searchForTrigger, { data, isLoading }] = useLazySearchRelationsQuery();\n\n /**\n * Because we're using a lazy query, we need to trigger the search\n * when the component mounts and when the search params change.\n * We also need to trigger the search when the field value changes\n * so that we can filter out the relations that are already connected.\n */\n React.useEffect(() => {\n /**\n * The `name` prop is a complete path to the field, e.g. `field1.field2.field3`.\n * Where the above example would a nested field within two components, however\n * we only require the field on the component not the complete path since we query\n * individual components. Therefore we split the string and take the last item.\n */\n const [targetField] = name.split('.').slice(-1);\n\n // Return early if there is no relation to the document\n if (!isRelatedToCurrentDocument) return;\n\n const params = documentMeta.params ?? buildValidParams(query);\n\n searchForTrigger({\n model,\n targetField,\n params: {\n ...params,\n id: id ?? '',\n pageSize: 10,\n idsToInclude: field.value?.disconnect?.map((rel) => rel.id.toString()) ?? [],\n idsToOmit: field.value?.connect?.map((rel) => rel.id.toString()) ?? [],\n ...searchParamsDebounced,\n },\n });\n }, [\n field.value?.connect,\n field.value?.disconnect,\n id,\n model,\n name,\n query,\n searchForTrigger,\n searchParamsDebounced,\n isRelatedToCurrentDocument,\n documentMeta,\n ]);\n\n const handleSearch = async (search: string) => {\n setSearchParams((s) => ({ ...s, _q: search, page: 1 }));\n };\n\n const hasNextPage = data?.pagination ? data.pagination.page < data.pagination.pageCount : false;\n\n const options = data?.results ?? [];\n\n const handleChange = (relationId?: string) => {\n if (!relationId) {\n return;\n }\n\n const relation = options.find((opt) => opt.id.toString() === relationId);\n\n if (!relation) {\n // This is very unlikely to happen, but it ensures we don't have any data for.\n console.error(\n \"You've tried to add a relation with an id that does not exist in the options you can see, this is likely a bug with Strapi. Please open an issue.\"\n );\n\n toggleNotification({\n message: formatMessage({\n id: getTranslation('relation.error-adding-relation'),\n defaultMessage: 'An error occurred while trying to add the relation.',\n }),\n type: 'danger',\n });\n\n return;\n }\n\n /**\n * You need to give this relation a correct _temp_key_ but\n * this component doesn't know about those ones, you can't rely\n * on the connect array because that doesn't hold items that haven't\n * moved. So use a callback to fill in the gaps when connecting.\n *\n */\n onChange(relation);\n };\n\n const handleLoadMore = () => {\n if (!data || !data.pagination) {\n return;\n } else if (data.pagination.page < data.pagination.pageCount) {\n setSearchParams((s) => ({ ...s, page: s.page + 1 }));\n }\n };\n\n React.useLayoutEffect(() => {\n setTextValue('');\n }, [field.value]);\n\n return (\n <Field.Root error={field.error} hint={hint} name={name} required={required}>\n <Field.Label action={labelAction}>{label}</Field.Label>\n <Combobox\n ref={fieldRef}\n name={name}\n autocomplete=\"list\"\n placeholder={\n placeholder ||\n formatMessage({\n id: getTranslation('relation.add'),\n defaultMessage: 'Add relation',\n })\n }\n hasMoreItems={hasNextPage}\n loading={isLoading}\n onOpenChange={() => {\n handleSearch(textValue ?? '');\n }}\n noOptionsMessage={() =>\n formatMessage({\n id: getTranslation('relation.notAvailable'),\n defaultMessage: 'No relations available',\n })\n }\n loadingMessage={formatMessage({\n id: getTranslation('relation.isLoading'),\n defaultMessage: 'Relations are loading',\n })}\n onLoadMore={handleLoadMore}\n textValue={textValue}\n onChange={handleChange}\n onTextValueChange={(text) => {\n setTextValue(text);\n }}\n onInputChange={(event) => {\n handleSearch(event.currentTarget.value);\n }}\n {...props}\n >\n {options.map((opt) => {\n const textValue = getRelationLabel(opt, mainField);\n\n return (\n <ComboboxOption key={opt.id} value={opt.id.toString()} textValue={textValue}>\n <Flex gap={2} justifyContent=\"space-between\">\n <Typography ellipsis>{textValue}</Typography>\n {opt.status ? <DocumentStatus status={opt.status} /> : null}\n </Flex>\n </ComboboxOption>\n );\n })}\n </Combobox>\n <Field.Error />\n <Field.Hint />\n </Field.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * RelationsList\n * -----------------------------------------------------------------------------------------------*/\nconst RELATION_ITEM_HEIGHT = 50;\nconst RELATION_GUTTER = 4;\n\ninterface RelationsListProps extends Pick<RelationsFieldProps, 'disabled' | 'name'> {\n data: Relation[];\n isLoading?: boolean;\n relationType: Schema.Attribute.RelationKind.Any;\n /**\n * The existing relations connected on the server. We need these to diff against.\n */\n serverData: RelationResult[];\n targetModel: string;\n}\n\nconst RelationsList = ({\n data,\n serverData,\n disabled,\n name,\n isLoading,\n relationType,\n targetModel,\n}: RelationsListProps) => {\n const ariaDescriptionId = React.useId();\n const { formatMessage } = useIntl();\n const listRef = React.useRef<FixedSizeList>(null);\n const outerListRef = React.useRef<HTMLUListElement>(null);\n const [overflow, setOverflow] = React.useState<'top' | 'bottom' | 'top-bottom'>();\n const [liveText, setLiveText] = React.useState('');\n const field = useField(name);\n\n React.useEffect(() => {\n if (data.length <= RELATIONS_TO_DISPLAY) {\n return setOverflow(undefined);\n }\n\n const handleNativeScroll = (e: Event) => {\n const el = e.target as HTMLUListElement;\n const parentScrollContainerHeight = (el.parentNode as HTMLDivElement).scrollHeight;\n const maxScrollBottom = el.scrollHeight - el.scrollTop;\n\n if (el.scrollTop === 0) {\n return setOverflow('bottom');\n }\n\n if (maxScrollBottom === parentScrollContainerHeight) {\n return setOverflow('top');\n }\n\n return setOverflow('top-bottom');\n };\n\n const outerListRefCurrent = outerListRef?.current;\n\n if (!isLoading && data.length > 0 && outerListRefCurrent) {\n outerListRef.current.addEventListener('scroll', handleNativeScroll);\n }\n\n return () => {\n if (outerListRefCurrent) {\n outerListRefCurrent.removeEventListener('scroll', handleNativeScroll);\n }\n };\n }, [isLoading, data.length]);\n\n const getItemPos = (index: number) => `${index + 1} of ${data.length}`;\n\n const handleMoveItem: UseDragAndDropOptions['onMoveItem'] = (newIndex, oldIndex) => {\n const item = data[oldIndex];\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.reorder'),\n defaultMessage: '{item}, moved. New position in list: {position}.',\n },\n {\n item: item.label ?? item.documentId,\n position: getItemPos(newIndex),\n }\n )\n );\n\n /**\n * Splicing mutates the array, so we need to create a new array\n */\n const newData = [...data];\n const currentRow = data[oldIndex];\n\n const startKey =\n oldIndex > newIndex ? newData[newIndex - 1]?.__temp_key__ : newData[newIndex]?.__temp_key__;\n const endKey =\n oldIndex > newIndex ? newData[newIndex]?.__temp_key__ : newData[newIndex + 1]?.__temp_key__;\n\n /**\n * We're moving the relation between two other relations, so\n * we need to generate a new key that keeps the order\n */\n const [newKey] = generateNKeysBetween(startKey, endKey, 1);\n\n newData.splice(oldIndex, 1);\n newData.splice(newIndex, 0, { ...currentRow, __temp_key__: newKey });\n\n /**\n * Now we diff against the server to understand what's different so we\n * can keep the connect array nice and tidy. It also needs reversing because\n * we reverse the relations from the server in the first place.\n */\n const connectedRelations = newData\n .reduce<Relation[]>((acc, relation, currentIndex, array) => {\n const relationOnServer = serverData.find((oldRelation) => oldRelation.id === relation.id);\n\n const relationInFront = array[currentIndex + 1];\n\n if (!relationOnServer || relationOnServer.__temp_key__ !== relation.__temp_key__) {\n const position = relationInFront\n ? {\n before: relationInFront.documentId,\n locale: relationInFront.locale,\n status:\n 'publishedAt' in relationInFront && relationInFront.publishedAt\n ? ('published' as Relation['status'])\n : ('draft' as Relation['status']),\n }\n : { end: true };\n\n const relationWithPosition: Relation = {\n ...relation,\n ...{\n apiData: {\n id: relation.id,\n documentId: relation.documentId ?? relation.apiData?.documentId ?? '',\n locale: relation.locale || relation.apiData?.locale,\n position,\n },\n },\n };\n\n return [...acc, relationWithPosition];\n }\n\n return acc;\n }, [])\n .toReversed();\n\n field.onChange(`${name}.connect`, connectedRelations);\n };\n\n const handleGrabItem: UseDragAndDropOptions['onGrabItem'] = (index) => {\n const item = data[index];\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.grab-item'),\n defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`,\n },\n {\n item: item.label ?? item.documentId,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleDropItem: UseDragAndDropOptions['onDropItem'] = (index) => {\n const { href: _href, label, ...item } = data[index];\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.drop-item'),\n defaultMessage: `{item}, dropped. Final position in list: {position}.`,\n },\n {\n item: label ?? item.documentId,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleCancel: UseDragAndDropOptions['onCancel'] = (index) => {\n const item = data[index];\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.cancel-item'),\n defaultMessage: '{item}, dropped. Re-order cancelled.',\n },\n {\n item: item.label ?? item.documentId,\n }\n )\n );\n };\n\n const handleDisconnect = useHandleDisconnect(name, 'RelationsList');\n\n /**\n * These relation types will only ever have one item\n * in their list, so you can't reorder a single item!\n */\n const canReorder = !ONE_WAY_RELATIONS.includes(relationType);\n\n const dynamicListHeight =\n data.length > RELATIONS_TO_DISPLAY\n ? Math.min(data.length, RELATIONS_TO_DISPLAY) * (RELATION_ITEM_HEIGHT + RELATION_GUTTER) +\n RELATION_ITEM_HEIGHT / 2\n : Math.min(data.length, RELATIONS_TO_DISPLAY) * (RELATION_ITEM_HEIGHT + RELATION_GUTTER);\n\n return (\n <ShadowBox $overflowDirection={overflow}>\n <VisuallyHidden id={ariaDescriptionId}>\n {formatMessage({\n id: getTranslation('dnd.instructions'),\n defaultMessage: `Press spacebar to grab and re-order`,\n })}\n </VisuallyHidden>\n <VisuallyHidden aria-live=\"assertive\">{liveText}</VisuallyHidden>\n {/* @ts-expect-error – width is expected, but we've not needed to pass it before. */}\n <FixedSizeList\n height={dynamicListHeight}\n ref={listRef}\n outerRef={outerListRef}\n itemCount={data.length}\n itemSize={RELATION_ITEM_HEIGHT + RELATION_GUTTER}\n itemData={{\n ariaDescribedBy: ariaDescriptionId,\n canDrag: canReorder,\n disabled,\n handleCancel,\n handleDropItem,\n handleGrabItem,\n handleMoveItem,\n name,\n handleDisconnect,\n relations: data,\n targetModel,\n }}\n itemKey={(index) => data[index].id}\n innerElementType=\"ol\"\n >\n {ListItem}\n </FixedSizeList>\n </ShadowBox>\n );\n};\n\nconst ShadowBox = styled<BoxComponent>(Box)<{\n $overflowDirection?: 'top-bottom' | 'top' | 'bottom';\n}>`\n position: relative;\n overflow: hidden;\n flex: 1;\n\n &:before,\n &:after {\n position: absolute;\n width: 100%;\n height: 4px;\n z-index: 1;\n }\n\n &:before {\n /* TODO: as for DS Table component we would need this to be handled by the DS theme */\n content: '';\n background: linear-gradient(rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);\n top: 0;\n opacity: ${({ $overflowDirection }) =>\n $overflowDirection === 'top-bottom' || $overflowDirection === 'top' ? 1 : 0};\n transition: opacity 0.2s ease-in-out;\n }\n\n &:after {\n /* TODO: as for DS Table component we would need this to be handled by the DS theme */\n content: '';\n background: linear-gradient(0deg, rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);\n bottom: 0;\n opacity: ${({ $overflowDirection }) =>\n $overflowDirection === 'top-bottom' || $overflowDirection === 'bottom' ? 1 : 0};\n transition: opacity 0.2s ease-in-out;\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * ListItem\n * -----------------------------------------------------------------------------------------------*/\n\ninterface ListItemProps extends Pick<ListChildComponentProps, 'style' | 'index'> {\n data: {\n ariaDescribedBy: string;\n canDrag?: boolean;\n disabled?: boolean;\n handleCancel: UseDragAndDropOptions['onCancel'];\n handleDropItem: UseDragAndDropOptions['onDropItem'];\n handleGrabItem: UseDragAndDropOptions['onGrabItem'];\n handleMoveItem: UseDragAndDropOptions['onMoveItem'];\n handleDisconnect: (relation: Relation) => void;\n name: string;\n relations: Relation[];\n targetModel: string;\n };\n}\n\nconst ListItem = ({ data, index, style }: ListItemProps) => {\n const {\n ariaDescribedBy,\n canDrag = false,\n disabled = false,\n handleCancel,\n handleDisconnect,\n handleDropItem,\n handleGrabItem,\n handleMoveItem,\n name,\n relations,\n targetModel,\n } = data;\n\n const { formatMessage } = useIntl();\n\n const { href, id, label, status, documentId, apiData, locale } = relations[index];\n\n const [{ handlerId, isDragging, handleKeyDown }, relationRef, dropRef, dragRef, dragPreviewRef] =\n useDragAndDrop<number, Omit<RelationDragPreviewProps, 'width'>, HTMLDivElement>(\n canDrag && !disabled,\n {\n type: `${ItemTypes.RELATION}_${name}`,\n index,\n item: {\n displayedValue: label,\n status,\n id: id,\n index,\n },\n onMoveItem: handleMoveItem,\n onDropItem: handleDropItem,\n onGrabItem: handleGrabItem,\n onCancel: handleCancel,\n dropSensitivity: DROP_SENSITIVITY.REGULAR,\n }\n );\n\n const composedRefs = useComposedRefs<HTMLDivElement>(relationRef, dragRef);\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage());\n }, [dragPreviewRef]);\n\n return (\n <Box\n style={style}\n tag=\"li\"\n ref={dropRef}\n aria-describedby={ariaDescribedBy}\n cursor={canDrag ? 'all-scroll' : 'default'}\n >\n {isDragging ? (\n <RelationItemPlaceholder />\n ) : (\n <Flex\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={canDrag ? 2 : 4}\n paddingRight={4}\n hasRadius\n borderColor=\"neutral200\"\n background={disabled ? 'neutral150' : 'neutral0'}\n justifyContent=\"space-between\"\n ref={composedRefs}\n data-handler-id={handlerId}\n >\n <FlexWrapper gap={1}>\n {canDrag ? (\n <IconButton\n tag=\"div\"\n role=\"button\"\n tabIndex={0}\n withTooltip={false}\n label={formatMessage({\n id: getTranslation('components.RelationInput.icon-button-aria-label'),\n defaultMessage: 'Drag',\n })}\n variant=\"ghost\"\n onKeyDown={handleKeyDown}\n disabled={disabled}\n >\n <Drag />\n </IconButton>\n ) : null}\n <Flex width=\"100%\" minWidth={0} justifyContent=\"space-between\">\n <Box minWidth={0} paddingTop={1} paddingBottom={1} paddingRight={4}>\n <RelationModalForm\n triggerButtonLabel={label}\n relation={{\n documentId: documentId ?? apiData?.documentId,\n model: targetModel,\n collectionType: getCollectionType(href)!,\n params: {\n locale: locale || apiData?.locale || null,\n },\n }}\n />\n </Box>\n {status ? <DocumentStatus status={status} /> : null}\n </Flex>\n </FlexWrapper>\n <Box paddingLeft={4}>\n <IconButton\n onClick={() => handleDisconnect(relations[index])}\n disabled={disabled}\n label={formatMessage({\n id: getTranslation('relation.disconnect'),\n defaultMessage: 'Remove',\n })}\n variant=\"ghost\"\n size=\"S\"\n >\n <Cross />\n </IconButton>\n </Box>\n </Flex>\n )}\n </Box>\n );\n};\n\nconst FlexWrapper = styled<FlexComponent>(Flex)`\n width: 100%;\n /* Used to prevent endAction to be pushed out of container */\n min-width: 0;\n\n & > div[role='button'] {\n cursor: all-scroll;\n }\n`;\n\nconst DisconnectButton = styled.button`\n svg path {\n fill: ${({ theme, disabled }) =>\n disabled ? theme.colors.neutral600 : theme.colors.neutral500};\n }\n\n &:hover svg path,\n &:focus svg path {\n fill: ${({ theme, disabled }) => !disabled && theme.colors.neutral600};\n }\n`;\n\nconst LinkEllipsis = styled(Link)`\n display: block;\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n }\n`;\n\nconst RelationItemPlaceholder = () => (\n <Box\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={4}\n paddingRight={4}\n hasRadius\n borderStyle=\"dashed\"\n borderColor=\"primary600\"\n borderWidth=\"1px\"\n background=\"primary100\"\n height={`calc(100% - ${RELATION_GUTTER}px)`}\n />\n);\n\nconst MemoizedRelationsField = React.memo(RelationsField);\n\nexport { MemoizedRelationsField as RelationsInput, FlexWrapper, DisconnectButton, LinkEllipsis };\nexport type { RelationsFieldProps };\n"],"names":["useHandleDisconnect","fieldName","consumerName","field","useField","removeFieldRow","useForm","state","addFieldRow","handleDisconnect","relation","value","connect","indexOfRelationInConnectArray","findIndex","rel","id","apiData","documentId","locale","RELATIONS_TO_DISPLAY","ONE_WAY_RELATIONS","RelationsField","React","forwardRef","disabled","label","props","ref","currentDocumentMeta","useDocumentContext","meta","currentDocument","document","rootDocumentMeta","currentPage","setCurrentPage","useState","isRootDocument","documentMeta","formatMessage","useIntl","query","useQueryParams","params","buildValidParams","isMorph","attribute","toLowerCase","includes","isDisabled","componentId","componentUID","useComponent","uid","isSubmitting","useEffect","component","components","model","toString","targetField","name","split","slice","schemaAttributes","attributes","schema","isRelatedToCurrentDocument","Object","values","filter","type","target","length","data","isLoading","isFetching","useGetRelationsQuery","pageSize","page","refetchOnMountOrArgChange","skip","selectFromResult","result","results","handleLoadMore","prev","isFetchingMoreRelations","realServerRelationsCount","pagination","total","relationsConnected","relationsDisconnected","disconnect","relationsCount","relations","useMemo","ctx","href","COLLECTION_TYPES","targetModel","mainField","transformations","pipe","removeConnected","removeDisconnected","addLabelAndHref","transformedRels","sort","a","b","__temp_key__","handleConnect","lastItemInList","item","status","generateNKeysBetween","getRelationLabel","forEach","onChange","_jsxs","Flex","direction","gap","justifyContent","alignItems","wrap","StyledFlex","width","_jsx","RelationsInput","pageCount","TextButton","onClick","loading","startIcon","ArrowClockwise","shrink","getTranslation","defaultMessage","RelationsList","serverData","relationType","styled","connectedRelations","disconnectedRelations","map","hint","labelAction","placeholder","required","unique","_unique","_ariaLabel","textValue","setTextValue","searchParams","setSearchParams","_q","toggleNotification","useNotification","fieldRef","useFocusInputField","searchParamsDebounced","useDebounce","searchForTrigger","useLazySearchRelationsQuery","idsToInclude","idsToOmit","handleSearch","search","s","hasNextPage","options","handleChange","relationId","find","opt","console","error","message","useLayoutEffect","Field","Root","Label","action","Combobox","autocomplete","hasMoreItems","onOpenChange","noOptionsMessage","loadingMessage","onLoadMore","onTextValueChange","text","onInputChange","event","currentTarget","ComboboxOption","Typography","ellipsis","DocumentStatus","Error","Hint","RELATION_ITEM_HEIGHT","RELATION_GUTTER","ariaDescriptionId","useId","listRef","useRef","outerListRef","overflow","setOverflow","liveText","setLiveText","undefined","handleNativeScroll","e","el","parentScrollContainerHeight","parentNode","scrollHeight","maxScrollBottom","scrollTop","outerListRefCurrent","current","addEventListener","removeEventListener","getItemPos","index","handleMoveItem","newIndex","oldIndex","position","newData","currentRow","startKey","endKey","newKey","splice","reduce","acc","currentIndex","array","relationOnServer","oldRelation","relationInFront","before","publishedAt","end","relationWithPosition","toReversed","handleGrabItem","handleDropItem","_href","handleCancel","canReorder","dynamicListHeight","Math","min","ShadowBox","$overflowDirection","VisuallyHidden","aria-live","FixedSizeList","height","outerRef","itemCount","itemSize","itemData","ariaDescribedBy","canDrag","itemKey","innerElementType","ListItem","Box","style","handlerId","isDragging","handleKeyDown","relationRef","dropRef","dragRef","dragPreviewRef","useDragAndDrop","ItemTypes","RELATION","displayedValue","onMoveItem","onDropItem","onGrabItem","onCancel","dropSensitivity","DROP_SENSITIVITY","REGULAR","composedRefs","useComposedRefs","getEmptyImage","tag","aria-describedby","cursor","RelationItemPlaceholder","paddingTop","paddingBottom","paddingLeft","paddingRight","hasRadius","borderColor","background","data-handler-id","FlexWrapper","IconButton","role","tabIndex","withTooltip","variant","onKeyDown","Drag","minWidth","RelationModalForm","triggerButtonLabel","collectionType","getCollectionType","size","Cross","DisconnectButton","button","theme","colors","neutral600","neutral500","LinkEllipsis","Link","borderStyle","borderWidth","MemoizedRelationsField","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA;;;;AAIC,IACD,SAASA,mBAAAA,CAAoBC,SAAiB,EAAEC,YAAoB,EAAA;AAClE,IAAA,MAAMC,QAAQC,oBAASH,CAAAA,SAAAA,CAAAA;AACvB,IAAA,MAAMI,iBAAiBC,mBAAQJ,CAAAA,YAAAA,EAAc,CAACK,KAAAA,GAAUA,MAAMF,cAAc,CAAA;AAC5E,IAAA,MAAMG,cAAcF,mBAAQJ,CAAAA,YAAAA,EAAc,CAACK,KAAAA,GAAUA,MAAMC,WAAW,CAAA;AAEtE,IAAA,MAAMC,mBAA8D,CAACC,QAAAA,GAAAA;AACnE,QAAA,IAAIP,MAAMQ,KAAK,IAAIR,MAAMQ,KAAK,CAACC,OAAO,EAAE;AACtC;;;;AAIC,UACD,MAAMC,6BAAAA,GAAgCV,KAAMQ,CAAAA,KAAK,CAACC,OAAO,CAACE,SAAS,CACjE,CAACC,GAA4DA,GAAAA,GAAAA,CAAIC,EAAE,KAAKN,SAASM,EAAE,CAAA;AAGrF,YAAA,IAAIH,iCAAiC,CAAG,EAAA;AACtCR,gBAAAA,cAAAA,CAAe,CAAC,EAAEJ,SAAU,CAAA,QAAQ,CAAC,EAAEY,6BAAAA,CAAAA;AACvC,gBAAA;AACF;AACF;AAEAL,QAAAA,WAAAA,CAAY,CAAC,EAAEP,SAAU,CAAA,WAAW,CAAC,EAAE;AACrCe,YAAAA,EAAAA,EAAIN,SAASM,EAAE;YACfC,OAAS,EAAA;AACPD,gBAAAA,EAAAA,EAAIN,SAASM,EAAE;AACfE,gBAAAA,UA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