@contentful/field-editor-reference 5.5.1 → 5.5.3
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/CHANGELOG.md +10 -0
- package/dist/common/ReferenceEditor.d.ts +2 -4
- package/dist/field-editor-reference.cjs.development.js +7 -7
- package/dist/field-editor-reference.cjs.development.js.map +1 -1
- package/dist/field-editor-reference.cjs.production.min.js +1 -1
- package/dist/field-editor-reference.cjs.production.min.js.map +1 -1
- package/dist/field-editor-reference.esm.js +7 -7
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/package.json +4 -4
|
@@ -3289,17 +3289,17 @@ function Editor$1(props) {
|
|
|
3289
3289
|
}, []);
|
|
3290
3290
|
var onSortEnd = useCallback(function (_ref) {
|
|
3291
3291
|
var oldIndex = _ref.oldIndex,
|
|
3292
|
-
newIndex = _ref.newIndex
|
|
3293
|
-
|
|
3292
|
+
newIndex = _ref.newIndex;
|
|
3293
|
+
// custom callback that is invoked *before* we sort the array
|
|
3294
|
+
// e.g. in Compose we want to sort the references in the referenceMap before re-rendering drag and drop
|
|
3295
|
+
props.onSortingEnd && props.onSortingEnd({
|
|
3296
|
+
oldIndex: oldIndex,
|
|
3297
|
+
newIndex: newIndex
|
|
3298
|
+
});
|
|
3294
3299
|
var newItems = arrayMove(items, oldIndex, newIndex);
|
|
3295
3300
|
setValue(newItems);
|
|
3296
3301
|
setIndexToUpdate && setIndexToUpdate(undefined);
|
|
3297
3302
|
document.body.classList.remove('grabbing');
|
|
3298
|
-
props.onSortingEnd && props.onSortingEnd({
|
|
3299
|
-
oldIndex: oldIndex,
|
|
3300
|
-
newIndex: newIndex,
|
|
3301
|
-
collection: collection
|
|
3302
|
-
});
|
|
3303
3303
|
}, [items, props, setIndexToUpdate, setValue]);
|
|
3304
3304
|
var onMove = useCallback(function (oldIndex, newIndex) {
|
|
3305
3305
|
var newItems = arrayMove(items, oldIndex, newIndex);
|