@contentful/field-editor-reference 7.0.3-canary.1 → 7.0.3-canary.4

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.
@@ -82,7 +82,8 @@ function Editor(props) {
82
82
  const items = _react.useMemo(()=>{
83
83
  return (props.items || []).map((link)=>link || nullableValue);
84
84
  }, [
85
- props.items
85
+ props.items,
86
+ props.items.length
86
87
  ]);
87
88
  const { rearrangeSortIDs } = (0, _useSortIDs.useSortIDs)(items);
88
89
  const onSortStart = (0, _react.useCallback)(()=>{
@@ -72,7 +72,8 @@ const nullableValue = {
72
72
  function ResourceEditor(props) {
73
73
  const { setValue } = props;
74
74
  const items = _react.useMemo(()=>(props.items || []).map((link)=>link || nullableValue), [
75
- props.items
75
+ props.items,
76
+ props.items.length
76
77
  ]);
77
78
  const onSortStart = ()=>(0, _noop.default)();
78
79
  const onSortEnd = (0, _react.useCallback)(({ oldIndex, newIndex })=>{
@@ -101,6 +102,7 @@ function ResourceEditor(props) {
101
102
  });
102
103
  return /*#__PURE__*/ _react.createElement(_react.Fragment, null, props.children({
103
104
  ...props,
105
+ items,
104
106
  onSortStart,
105
107
  onSortEnd,
106
108
  onMove,
@@ -32,7 +32,8 @@ function Editor(props) {
32
32
  const items = React.useMemo(()=>{
33
33
  return (props.items || []).map((link)=>link || nullableValue);
34
34
  }, [
35
- props.items
35
+ props.items,
36
+ props.items.length
36
37
  ]);
37
38
  const { rearrangeSortIDs } = useSortIDs(items);
38
39
  const onSortStart = useCallback(()=>{
@@ -17,7 +17,8 @@ const nullableValue = {
17
17
  function ResourceEditor(props) {
18
18
  const { setValue } = props;
19
19
  const items = React.useMemo(()=>(props.items || []).map((link)=>link || nullableValue), [
20
- props.items
20
+ props.items,
21
+ props.items.length
21
22
  ]);
22
23
  const onSortStart = ()=>noop();
23
24
  const onSortEnd = useCallback(({ oldIndex, newIndex })=>{
@@ -46,6 +47,7 @@ function ResourceEditor(props) {
46
47
  });
47
48
  return /*#__PURE__*/ React.createElement(React.Fragment, null, props.children({
48
49
  ...props,
50
+ items,
49
51
  onSortStart,
50
52
  onSortEnd,
51
53
  onMove,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-reference",
3
- "version": "7.0.3-canary.1+660fa121",
3
+ "version": "7.0.3-canary.4+e426f2e3",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "registry": "https://npm.pkg.github.com/"
71
71
  },
72
- "gitHead": "660fa1215eebdd5b31ec011bb8ece7cc89483e77"
72
+ "gitHead": "e426f2e382bf5dc3932ba192c1843192bdf69a8b"
73
73
  }