@contentful/field-editor-reference 4.6.10 → 5.0.0
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 +12 -0
- package/dist/assets/WrappedAssetCard/AssetCardActions.d.ts +1 -1
- package/dist/common/EntityStore.d.ts +55 -5
- package/dist/common/ReferenceEditor.d.ts +1 -1
- package/dist/common/useAccessApi.d.ts +1 -1
- package/dist/components/LinkActions/helpers.d.ts +3 -3
- package/dist/field-editor-reference.cjs.development.js +527 -540
- 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 +526 -541
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +3 -2
|
@@ -12,10 +12,12 @@ var get = _interopDefault(require('lodash/get'));
|
|
|
12
12
|
var f36Components = require('@contentful/f36-components');
|
|
13
13
|
var f36Icons = require('@contentful/f36-icons');
|
|
14
14
|
var moment = _interopDefault(require('moment'));
|
|
15
|
-
var deepEqual = _interopDefault(require('deep-equal'));
|
|
16
15
|
var fieldEditorShared = require('@contentful/field-editor-shared');
|
|
16
|
+
var deepEqual = _interopDefault(require('deep-equal'));
|
|
17
|
+
var reactQuery = require('@tanstack/react-query');
|
|
17
18
|
var constate = _interopDefault(require('constate'));
|
|
18
19
|
var contentfulManagement = require('contentful-management');
|
|
20
|
+
var PQueue = _interopDefault(require('p-queue'));
|
|
19
21
|
var isNumber = _interopDefault(require('lodash/isNumber'));
|
|
20
22
|
var arrayMove = _interopDefault(require('array-move'));
|
|
21
23
|
var reactSortableHoc = require('react-sortable-hoc');
|
|
@@ -75,57 +77,110 @@ function _extends() {
|
|
|
75
77
|
return _extends.apply(this, arguments);
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
function
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
var sourceKeys = Object.keys(source);
|
|
82
|
-
var key, i;
|
|
80
|
+
function _inheritsLoose(subClass, superClass) {
|
|
81
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
82
|
+
subClass.prototype.constructor = subClass;
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
_setPrototypeOf(subClass, superClass);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function _getPrototypeOf(o) {
|
|
88
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
89
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
90
|
+
};
|
|
91
|
+
return _getPrototypeOf(o);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function _setPrototypeOf(o, p) {
|
|
95
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
96
|
+
o.__proto__ = p;
|
|
97
|
+
return o;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return _setPrototypeOf(o, p);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function _isNativeReflectConstruct() {
|
|
104
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
105
|
+
if (Reflect.construct.sham) return false;
|
|
106
|
+
if (typeof Proxy === "function") return true;
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
110
|
+
return true;
|
|
111
|
+
} catch (e) {
|
|
112
|
+
return false;
|
|
88
113
|
}
|
|
114
|
+
}
|
|
89
115
|
|
|
90
|
-
|
|
116
|
+
function _construct(Parent, args, Class) {
|
|
117
|
+
if (_isNativeReflectConstruct()) {
|
|
118
|
+
_construct = Reflect.construct;
|
|
119
|
+
} else {
|
|
120
|
+
_construct = function _construct(Parent, args, Class) {
|
|
121
|
+
var a = [null];
|
|
122
|
+
a.push.apply(a, args);
|
|
123
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
124
|
+
var instance = new Constructor();
|
|
125
|
+
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
126
|
+
return instance;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return _construct.apply(null, arguments);
|
|
91
131
|
}
|
|
92
132
|
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
96
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
97
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
98
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
99
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
133
|
+
function _isNativeFunction(fn) {
|
|
134
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
100
135
|
}
|
|
101
136
|
|
|
102
|
-
function
|
|
103
|
-
|
|
137
|
+
function _wrapNativeSuper(Class) {
|
|
138
|
+
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
139
|
+
|
|
140
|
+
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
141
|
+
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
142
|
+
|
|
143
|
+
if (typeof Class !== "function") {
|
|
144
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (typeof _cache !== "undefined") {
|
|
148
|
+
if (_cache.has(Class)) return _cache.get(Class);
|
|
149
|
+
|
|
150
|
+
_cache.set(Class, Wrapper);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function Wrapper() {
|
|
154
|
+
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
|
155
|
+
}
|
|
104
156
|
|
|
105
|
-
|
|
157
|
+
Wrapper.prototype = Object.create(Class.prototype, {
|
|
158
|
+
constructor: {
|
|
159
|
+
value: Wrapper,
|
|
160
|
+
enumerable: false,
|
|
161
|
+
writable: true,
|
|
162
|
+
configurable: true
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
return _setPrototypeOf(Wrapper, Class);
|
|
166
|
+
};
|
|
106
167
|
|
|
107
|
-
return
|
|
168
|
+
return _wrapNativeSuper(Class);
|
|
108
169
|
}
|
|
109
170
|
|
|
110
|
-
function
|
|
111
|
-
|
|
112
|
-
|
|
171
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
172
|
+
if (source == null) return {};
|
|
173
|
+
var target = {};
|
|
174
|
+
var sourceKeys = Object.keys(source);
|
|
175
|
+
var key, i;
|
|
113
176
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (i >= o.length) return {
|
|
119
|
-
done: true
|
|
120
|
-
};
|
|
121
|
-
return {
|
|
122
|
-
done: false,
|
|
123
|
-
value: o[i++]
|
|
124
|
-
};
|
|
125
|
-
};
|
|
177
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
178
|
+
key = sourceKeys[i];
|
|
179
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
180
|
+
target[key] = source[key];
|
|
126
181
|
}
|
|
127
182
|
|
|
128
|
-
|
|
183
|
+
return target;
|
|
129
184
|
}
|
|
130
185
|
|
|
131
186
|
var container = /*#__PURE__*/emotion.css({
|
|
@@ -505,7 +560,7 @@ function CombinedLinkActions(props) {
|
|
|
505
560
|
var hideEmptyCard = props.entityType === 'Asset' && !props.isEmpty;
|
|
506
561
|
return React.createElement("div", {
|
|
507
562
|
className: hideEmptyCard ? '' : container
|
|
508
|
-
}, !props.canCreateEntity && !props.canLinkEntity && React.createElement(NoLinkPermissionsInfo, null), props.entityType === 'Entry' && React.createElement(CombinedEntryLinkActions,
|
|
563
|
+
}, !props.canCreateEntity && !props.canLinkEntity && React.createElement(NoLinkPermissionsInfo, null), props.entityType === 'Entry' && React.createElement(CombinedEntryLinkActions, _extends({}, props)), props.entityType === 'Asset' && React.createElement(CombinedAssetLinkActions, _extends({}, props)));
|
|
509
564
|
}
|
|
510
565
|
|
|
511
566
|
function CombinedEntryLinkActions(props) {
|
|
@@ -1745,7 +1800,7 @@ function LinkEntityActions(_ref4) {
|
|
|
1745
1800
|
props = _objectWithoutPropertiesLoose(_ref4, _excluded);
|
|
1746
1801
|
|
|
1747
1802
|
var renderLinkActions = renderCustomActions ? renderCustomActions : function (props) {
|
|
1748
|
-
return React.createElement(LinkActions,
|
|
1803
|
+
return React.createElement(LinkActions, _extends({}, props));
|
|
1749
1804
|
};
|
|
1750
1805
|
return renderLinkActions(props);
|
|
1751
1806
|
}
|
|
@@ -1806,6 +1861,8 @@ var ScheduleTooltip = function ScheduleTooltip(_ref2) {
|
|
|
1806
1861
|
};
|
|
1807
1862
|
|
|
1808
1863
|
var ScheduledIconWithTooltip = function ScheduledIconWithTooltip(_ref) {
|
|
1864
|
+
var _status$jobs;
|
|
1865
|
+
|
|
1809
1866
|
var entityType = _ref.entityType,
|
|
1810
1867
|
entityId = _ref.entityId,
|
|
1811
1868
|
getEntityScheduledActions = _ref.getEntityScheduledActions,
|
|
@@ -1837,7 +1894,7 @@ var ScheduledIconWithTooltip = function ScheduledIconWithTooltip(_ref) {
|
|
|
1837
1894
|
return null;
|
|
1838
1895
|
}
|
|
1839
1896
|
|
|
1840
|
-
var jobs = status.jobs ?
|
|
1897
|
+
var jobs = (_status$jobs = status.jobs) != null ? _status$jobs : [];
|
|
1841
1898
|
|
|
1842
1899
|
if (jobs.length === 0) {
|
|
1843
1900
|
return null;
|
|
@@ -1863,502 +1920,426 @@ function AssetThumbnail(props) {
|
|
|
1863
1920
|
});
|
|
1864
1921
|
}
|
|
1865
1922
|
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
switch (action.type) {
|
|
1870
|
-
case 'set_entry':
|
|
1871
|
-
return _extends({}, state, {
|
|
1872
|
-
entries: _extends({}, state.entries, (_extends2 = {}, _extends2[action.id] = action.entry, _extends2))
|
|
1873
|
-
});
|
|
1874
|
-
|
|
1875
|
-
case 'set_entry_failed':
|
|
1876
|
-
return _extends({}, state, {
|
|
1877
|
-
entries: _extends({}, state.entries, (_extends3 = {}, _extends3[action.id] = 'failed', _extends3))
|
|
1878
|
-
});
|
|
1923
|
+
var _excluded$1 = ["priority"],
|
|
1924
|
+
_excluded2 = ["children"];
|
|
1879
1925
|
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
case 'set_asset_failed':
|
|
1886
|
-
return _extends({}, state, {
|
|
1887
|
-
assets: _extends({}, state.assets, (_extends5 = {}, _extends5[action.id] = 'failed', _extends5))
|
|
1888
|
-
});
|
|
1889
|
-
|
|
1890
|
-
case 'set_scheduled_actions':
|
|
1891
|
-
return _extends({}, state, {
|
|
1892
|
-
scheduledActions: _extends({}, state.scheduledActions, (_extends6 = {}, _extends6[action.key] = action.actions, _extends6))
|
|
1893
|
-
});
|
|
1926
|
+
var globalQueue = /*#__PURE__*/new PQueue({
|
|
1927
|
+
concurrency: 20
|
|
1928
|
+
});
|
|
1929
|
+
var UnsupportedError = /*#__PURE__*/function (_Error) {
|
|
1930
|
+
_inheritsLoose(UnsupportedError, _Error);
|
|
1894
1931
|
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
resources: _extends({}, state.resources, (_extends7 = {}, _extends7[action.resourceType + "." + action.urn] = action.resourceInfo, _extends7))
|
|
1898
|
-
});
|
|
1932
|
+
function UnsupportedError(message) {
|
|
1933
|
+
var _this;
|
|
1899
1934
|
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
default:
|
|
1906
|
-
return state;
|
|
1935
|
+
_this = _Error.call(this, message) || this;
|
|
1936
|
+
_this.isUnsupportedError = void 0;
|
|
1937
|
+
_this.isUnsupportedError = true;
|
|
1938
|
+
return _this;
|
|
1907
1939
|
}
|
|
1908
|
-
}
|
|
1909
1940
|
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
assets: {},
|
|
1913
|
-
scheduledActions: {},
|
|
1914
|
-
resources: {}
|
|
1915
|
-
};
|
|
1941
|
+
return UnsupportedError;
|
|
1942
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
1916
1943
|
|
|
1917
|
-
var
|
|
1918
|
-
return
|
|
1919
|
-
};
|
|
1920
|
-
|
|
1921
|
-
var nonNilResources = function nonNilResources(map) {
|
|
1922
|
-
return Object.entries(map).filter(function (_ref) {
|
|
1923
|
-
var value = _ref[1];
|
|
1924
|
-
return isNotNil(value);
|
|
1925
|
-
});
|
|
1944
|
+
var isEntityQueryKey = function isEntityQueryKey(queryKey) {
|
|
1945
|
+
return Array.isArray(queryKey) && (queryKey[0] === 'Entry' || queryKey[0] === 'Asset') && queryKey.length === 4;
|
|
1926
1946
|
};
|
|
1927
1947
|
|
|
1928
|
-
function
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
var _React$useState = React.useState(function () {
|
|
1933
|
-
return contentfulManagement.createClient({
|
|
1934
|
-
apiAdapter: props.sdk.cmaAdapter
|
|
1935
|
-
}, {
|
|
1936
|
-
type: 'plain'
|
|
1937
|
-
});
|
|
1938
|
-
}),
|
|
1939
|
-
cmaClient = _React$useState[0];
|
|
1940
|
-
|
|
1941
|
-
var _React$useReducer = React.useReducer(reducer, initialState),
|
|
1942
|
-
state = _React$useReducer[0],
|
|
1943
|
-
dispatch = _React$useReducer[1];
|
|
1944
|
-
|
|
1945
|
-
var loadEntityScheduledActions = React.useCallback(function (entityType, id) {
|
|
1946
|
-
var key = entityType + ":" + id;
|
|
1947
|
-
|
|
1948
|
-
if (state.scheduledActions[key]) {
|
|
1949
|
-
return Promise.resolve(state.scheduledActions[key]);
|
|
1950
|
-
}
|
|
1951
|
-
|
|
1952
|
-
return props.sdk.space.getEntityScheduledActions(entityType, id).then(function (data) {
|
|
1953
|
-
dispatch({
|
|
1954
|
-
type: 'set_scheduled_actions',
|
|
1955
|
-
key: key,
|
|
1956
|
-
actions: data
|
|
1957
|
-
});
|
|
1958
|
-
return data;
|
|
1959
|
-
})["catch"](function () {
|
|
1960
|
-
dispatch({
|
|
1961
|
-
type: 'set_scheduled_actions',
|
|
1962
|
-
key: key,
|
|
1963
|
-
actions: undefined
|
|
1964
|
-
});
|
|
1965
|
-
return [];
|
|
1966
|
-
});
|
|
1967
|
-
}, [props.sdk.space, state.scheduledActions]);
|
|
1968
|
-
var loadEntry = React.useCallback( /*#__PURE__*/function () {
|
|
1969
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(entryId) {
|
|
1970
|
-
var entry;
|
|
1971
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
1972
|
-
while (1) {
|
|
1973
|
-
switch (_context.prev = _context.next) {
|
|
1974
|
-
case 0:
|
|
1975
|
-
_context.prev = 0;
|
|
1976
|
-
_context.next = 3;
|
|
1977
|
-
return cmaClient.entry.get({
|
|
1978
|
-
spaceId: spaceId,
|
|
1979
|
-
environmentId: environmentId,
|
|
1980
|
-
entryId: entryId
|
|
1981
|
-
});
|
|
1982
|
-
|
|
1983
|
-
case 3:
|
|
1984
|
-
entry = _context.sent;
|
|
1985
|
-
dispatch({
|
|
1986
|
-
type: 'set_entry',
|
|
1987
|
-
id: entryId,
|
|
1988
|
-
entry: entry
|
|
1989
|
-
});
|
|
1990
|
-
return _context.abrupt("return", entry);
|
|
1991
|
-
|
|
1992
|
-
case 8:
|
|
1993
|
-
_context.prev = 8;
|
|
1994
|
-
_context.t0 = _context["catch"](0);
|
|
1995
|
-
dispatch({
|
|
1996
|
-
type: 'set_entry_failed',
|
|
1997
|
-
id: entryId
|
|
1998
|
-
});
|
|
1999
|
-
return _context.abrupt("return");
|
|
2000
|
-
|
|
2001
|
-
case 12:
|
|
2002
|
-
case "end":
|
|
2003
|
-
return _context.stop();
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
}, _callee, null, [[0, 8]]);
|
|
2007
|
-
}));
|
|
2008
|
-
|
|
2009
|
-
return function (_x) {
|
|
2010
|
-
return _ref2.apply(this, arguments);
|
|
2011
|
-
};
|
|
2012
|
-
}(), [cmaClient, spaceId, environmentId]);
|
|
2013
|
-
var getEntry = React.useCallback( /*#__PURE__*/function () {
|
|
2014
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(entryId) {
|
|
2015
|
-
var cachedEntry;
|
|
2016
|
-
return runtime_1.wrap(function _callee2$(_context2) {
|
|
2017
|
-
while (1) {
|
|
2018
|
-
switch (_context2.prev = _context2.next) {
|
|
2019
|
-
case 0:
|
|
2020
|
-
cachedEntry = state.entries[entryId];
|
|
2021
|
-
|
|
2022
|
-
if (!isNotNil(cachedEntry)) {
|
|
2023
|
-
_context2.next = 3;
|
|
2024
|
-
break;
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
return _context2.abrupt("return", cachedEntry);
|
|
2028
|
-
|
|
2029
|
-
case 3:
|
|
2030
|
-
return _context2.abrupt("return", loadEntry(entryId));
|
|
2031
|
-
|
|
2032
|
-
case 4:
|
|
2033
|
-
case "end":
|
|
2034
|
-
return _context2.stop();
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
|
-
}, _callee2);
|
|
2038
|
-
}));
|
|
2039
|
-
|
|
2040
|
-
return function (_x2) {
|
|
2041
|
-
return _ref3.apply(this, arguments);
|
|
2042
|
-
};
|
|
2043
|
-
}(), [loadEntry, state.entries]);
|
|
2044
|
-
var loadAsset = React.useCallback( /*#__PURE__*/function () {
|
|
2045
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(assetId) {
|
|
2046
|
-
var asset;
|
|
2047
|
-
return runtime_1.wrap(function _callee3$(_context3) {
|
|
2048
|
-
while (1) {
|
|
2049
|
-
switch (_context3.prev = _context3.next) {
|
|
2050
|
-
case 0:
|
|
2051
|
-
_context3.prev = 0;
|
|
2052
|
-
_context3.next = 3;
|
|
2053
|
-
return cmaClient.asset.get({
|
|
2054
|
-
spaceId: spaceId,
|
|
2055
|
-
environmentId: environmentId,
|
|
2056
|
-
assetId: assetId
|
|
2057
|
-
});
|
|
2058
|
-
|
|
2059
|
-
case 3:
|
|
2060
|
-
asset = _context3.sent;
|
|
2061
|
-
dispatch({
|
|
2062
|
-
type: 'set_asset',
|
|
2063
|
-
id: assetId,
|
|
2064
|
-
asset: asset
|
|
2065
|
-
});
|
|
2066
|
-
return _context3.abrupt("return", asset);
|
|
2067
|
-
|
|
2068
|
-
case 8:
|
|
2069
|
-
_context3.prev = 8;
|
|
2070
|
-
_context3.t0 = _context3["catch"](0);
|
|
2071
|
-
dispatch({
|
|
2072
|
-
type: 'set_asset_failed',
|
|
2073
|
-
id: assetId
|
|
2074
|
-
});
|
|
2075
|
-
return _context3.abrupt("return");
|
|
2076
|
-
|
|
2077
|
-
case 12:
|
|
2078
|
-
case "end":
|
|
2079
|
-
return _context3.stop();
|
|
2080
|
-
}
|
|
2081
|
-
}
|
|
2082
|
-
}, _callee3, null, [[0, 8]]);
|
|
2083
|
-
}));
|
|
2084
|
-
|
|
2085
|
-
return function (_x3) {
|
|
2086
|
-
return _ref4.apply(this, arguments);
|
|
2087
|
-
};
|
|
2088
|
-
}(), [cmaClient, spaceId, environmentId]);
|
|
2089
|
-
var getAsset = React.useCallback( /*#__PURE__*/function () {
|
|
2090
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(assetId) {
|
|
2091
|
-
var cachedAsset;
|
|
2092
|
-
return runtime_1.wrap(function _callee4$(_context4) {
|
|
2093
|
-
while (1) {
|
|
2094
|
-
switch (_context4.prev = _context4.next) {
|
|
2095
|
-
case 0:
|
|
2096
|
-
cachedAsset = state.assets[assetId];
|
|
2097
|
-
|
|
2098
|
-
if (!isNotNil(cachedAsset)) {
|
|
2099
|
-
_context4.next = 3;
|
|
2100
|
-
break;
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
return _context4.abrupt("return", cachedAsset);
|
|
2104
|
-
|
|
2105
|
-
case 3:
|
|
2106
|
-
return _context4.abrupt("return", loadAsset(assetId));
|
|
2107
|
-
|
|
2108
|
-
case 4:
|
|
2109
|
-
case "end":
|
|
2110
|
-
return _context4.stop();
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
}, _callee4);
|
|
2114
|
-
}));
|
|
2115
|
-
|
|
2116
|
-
return function (_x4) {
|
|
2117
|
-
return _ref5.apply(this, arguments);
|
|
2118
|
-
};
|
|
2119
|
-
}(), [loadAsset, state.assets]);
|
|
2120
|
-
var loadContentfulEntry = React.useCallback( /*#__PURE__*/function () {
|
|
2121
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(urn) {
|
|
2122
|
-
var _locales$items$find;
|
|
1948
|
+
function fetchContentfulEntry(_x) {
|
|
1949
|
+
return _fetchContentfulEntry.apply(this, arguments);
|
|
1950
|
+
}
|
|
2123
1951
|
|
|
2124
|
-
|
|
1952
|
+
function _fetchContentfulEntry() {
|
|
1953
|
+
_fetchContentfulEntry = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(params) {
|
|
1954
|
+
var urn, fetch, options, resourceId, _resourceId$split, spaceId, entryId, environmentId, _yield$Promise$all, space, entry, contentTypeId, _yield$Promise$all2, contentType, defaultLocaleCode;
|
|
2125
1955
|
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
1956
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
1957
|
+
while (1) {
|
|
1958
|
+
switch (_context3.prev = _context3.next) {
|
|
1959
|
+
case 0:
|
|
1960
|
+
urn = params.urn, fetch = params.fetch, options = params.options;
|
|
1961
|
+
resourceId = urn.split(':', 6)[5];
|
|
1962
|
+
_resourceId$split = resourceId.split('/'), spaceId = _resourceId$split[1], entryId = _resourceId$split[3];
|
|
1963
|
+
environmentId = 'master';
|
|
1964
|
+
_context3.next = 6;
|
|
1965
|
+
return Promise.all([fetch(['space', spaceId], function (_ref9) {
|
|
1966
|
+
var cmaClient = _ref9.cmaClient;
|
|
2135
1967
|
return cmaClient.space.get({
|
|
2136
1968
|
spaceId: spaceId
|
|
2137
1969
|
});
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
_context5.t1 = _context5.sent;
|
|
2141
|
-
_context5.next = 9;
|
|
1970
|
+
}, options), fetch(['entry', spaceId, environmentId, entryId], function (_ref10) {
|
|
1971
|
+
var cmaClient = _ref10.cmaClient;
|
|
2142
1972
|
return cmaClient.entry.get({
|
|
2143
1973
|
spaceId: spaceId,
|
|
2144
1974
|
environmentId: environmentId,
|
|
2145
1975
|
entryId: entryId
|
|
2146
1976
|
});
|
|
1977
|
+
}, options)]);
|
|
2147
1978
|
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
space = _yield$Promise$all[0];
|
|
2157
|
-
entry = _yield$Promise$all[1];
|
|
2158
|
-
contentTypeId = entry.sys.contentType.sys.id;
|
|
2159
|
-
_context5.t4 = Promise;
|
|
2160
|
-
_context5.next = 20;
|
|
1979
|
+
case 6:
|
|
1980
|
+
_yield$Promise$all = _context3.sent;
|
|
1981
|
+
space = _yield$Promise$all[0];
|
|
1982
|
+
entry = _yield$Promise$all[1];
|
|
1983
|
+
contentTypeId = entry.sys.contentType.sys.id;
|
|
1984
|
+
_context3.next = 12;
|
|
1985
|
+
return Promise.all([fetch(['contentType', spaceId, environmentId, contentTypeId], function (_ref11) {
|
|
1986
|
+
var cmaClient = _ref11.cmaClient;
|
|
2161
1987
|
return cmaClient.contentType.get({
|
|
2162
1988
|
contentTypeId: contentTypeId,
|
|
2163
1989
|
spaceId: spaceId,
|
|
2164
1990
|
environmentId: environmentId
|
|
2165
1991
|
});
|
|
1992
|
+
}, options), fetch(['defaultLocale', spaceId, environmentId], /*#__PURE__*/function () {
|
|
1993
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(_ref12) {
|
|
1994
|
+
var _locales$items$find;
|
|
2166
1995
|
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
1996
|
+
var cmaClient, locales, defaultLocaleCode;
|
|
1997
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1998
|
+
while (1) {
|
|
1999
|
+
switch (_context2.prev = _context2.next) {
|
|
2000
|
+
case 0:
|
|
2001
|
+
cmaClient = _ref12.cmaClient;
|
|
2002
|
+
_context2.next = 3;
|
|
2003
|
+
return cmaClient.locale.getMany({
|
|
2004
|
+
spaceId: spaceId,
|
|
2005
|
+
environmentId: environmentId,
|
|
2006
|
+
query: {
|
|
2007
|
+
limit: 100
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2010
|
+
|
|
2011
|
+
case 3:
|
|
2012
|
+
locales = _context2.sent;
|
|
2013
|
+
defaultLocaleCode = (_locales$items$find = locales.items.find(function (locale) {
|
|
2014
|
+
return locale["default"];
|
|
2015
|
+
})) == null ? void 0 : _locales$items$find.code;
|
|
2016
|
+
return _context2.abrupt("return", defaultLocaleCode);
|
|
2177
2017
|
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
_yield$Promise$all2 = _context5.sent;
|
|
2186
|
-
contentType = _yield$Promise$all2[0];
|
|
2187
|
-
locales = _yield$Promise$all2[1];
|
|
2188
|
-
defaultLocaleCode = (_locales$items$find = locales.items.find(function (locale) {
|
|
2189
|
-
return locale["default"];
|
|
2190
|
-
})) == null ? void 0 : _locales$items$find.code;
|
|
2191
|
-
return _context5.abrupt("return", {
|
|
2192
|
-
resource: entry,
|
|
2193
|
-
defaultLocaleCode: defaultLocaleCode,
|
|
2194
|
-
space: space,
|
|
2195
|
-
contentType: contentType
|
|
2196
|
-
});
|
|
2018
|
+
case 6:
|
|
2019
|
+
case "end":
|
|
2020
|
+
return _context2.stop();
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
}, _callee2);
|
|
2024
|
+
}));
|
|
2197
2025
|
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2026
|
+
return function (_x3) {
|
|
2027
|
+
return _ref13.apply(this, arguments);
|
|
2028
|
+
};
|
|
2029
|
+
}(), options)]);
|
|
2030
|
+
|
|
2031
|
+
case 12:
|
|
2032
|
+
_yield$Promise$all2 = _context3.sent;
|
|
2033
|
+
contentType = _yield$Promise$all2[0];
|
|
2034
|
+
defaultLocaleCode = _yield$Promise$all2[1];
|
|
2035
|
+
return _context3.abrupt("return", {
|
|
2036
|
+
defaultLocaleCode: defaultLocaleCode,
|
|
2037
|
+
resource: entry,
|
|
2038
|
+
space: space,
|
|
2039
|
+
contentType: contentType
|
|
2040
|
+
});
|
|
2205
2041
|
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
switch (_context6.prev = _context6.next) {
|
|
2216
|
-
case 0:
|
|
2217
|
-
cachedResource = state.resources[resourceType + "." + urn];
|
|
2042
|
+
case 16:
|
|
2043
|
+
case "end":
|
|
2044
|
+
return _context3.stop();
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
}, _callee3);
|
|
2048
|
+
}));
|
|
2049
|
+
return _fetchContentfulEntry.apply(this, arguments);
|
|
2050
|
+
}
|
|
2218
2051
|
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2052
|
+
var _constate = /*#__PURE__*/constate(function useInitServices(props) {
|
|
2053
|
+
var currentSpaceId = props.sdk.ids.space;
|
|
2054
|
+
var currentEnvironmentId = props.sdk.ids.environment;
|
|
2055
|
+
var queryClient = reactQuery.useQueryClient();
|
|
2056
|
+
var queryCache = queryClient.getQueryCache();
|
|
2057
|
+
var entityChangeUnsubscribers = React.useRef({});
|
|
2058
|
+
var cmaClient = React.useMemo(function () {
|
|
2059
|
+
return contentfulManagement.createClient({
|
|
2060
|
+
apiAdapter: props.sdk.cmaAdapter
|
|
2061
|
+
}, {
|
|
2062
|
+
type: 'plain'
|
|
2063
|
+
});
|
|
2064
|
+
}, [props.sdk.cmaAdapter]);
|
|
2065
|
+
var queryQueue = React.useMemo(function () {
|
|
2066
|
+
if (props.queryConcurrency) {
|
|
2067
|
+
return new PQueue({
|
|
2068
|
+
concurrency: props.queryConcurrency
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2223
2071
|
|
|
2224
|
-
|
|
2072
|
+
return globalQueue;
|
|
2073
|
+
}, [props.queryConcurrency]);
|
|
2074
|
+
var fetch = React.useCallback(function fetch(queryKey, fn, options) {
|
|
2075
|
+
if (options === void 0) {
|
|
2076
|
+
options = {};
|
|
2077
|
+
}
|
|
2225
2078
|
|
|
2226
|
-
|
|
2227
|
-
|
|
2079
|
+
var _options = options,
|
|
2080
|
+
priority = _options.priority,
|
|
2081
|
+
queryOptions = _objectWithoutPropertiesLoose(_options, _excluded$1);
|
|
2228
2082
|
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2083
|
+
return queryClient.fetchQuery(queryKey, function () {
|
|
2084
|
+
return queryQueue.add(function () {
|
|
2085
|
+
return fn({
|
|
2086
|
+
cmaClient: cmaClient
|
|
2087
|
+
});
|
|
2088
|
+
}, {
|
|
2089
|
+
priority: priority
|
|
2090
|
+
});
|
|
2091
|
+
}, queryOptions);
|
|
2092
|
+
}, [queryClient, queryQueue, cmaClient]);
|
|
2093
|
+
var getEntity = React.useCallback(function getEntity(entityType, entityId, options) {
|
|
2094
|
+
var _options$spaceId, _options$environmentI;
|
|
2095
|
+
|
|
2096
|
+
var spaceId = (_options$spaceId = options == null ? void 0 : options.spaceId) != null ? _options$spaceId : currentSpaceId;
|
|
2097
|
+
var environmentId = (_options$environmentI = options == null ? void 0 : options.environmentId) != null ? _options$environmentI : currentEnvironmentId;
|
|
2098
|
+
var queryKey = [entityType, entityId, spaceId, environmentId];
|
|
2099
|
+
return fetch(queryKey, function (_ref) {
|
|
2100
|
+
var cmaClient = _ref.cmaClient;
|
|
2101
|
+
|
|
2102
|
+
if (entityType === 'Entry') {
|
|
2103
|
+
return cmaClient.entry.get({
|
|
2104
|
+
entryId: entityId,
|
|
2105
|
+
spaceId: spaceId,
|
|
2106
|
+
environmentId: environmentId
|
|
2107
|
+
});
|
|
2108
|
+
}
|
|
2233
2109
|
|
|
2234
|
-
|
|
2235
|
-
|
|
2110
|
+
if (entityType === 'Asset') {
|
|
2111
|
+
return cmaClient.asset.get({
|
|
2112
|
+
assetId: entityId,
|
|
2113
|
+
spaceId: spaceId,
|
|
2114
|
+
environmentId: environmentId
|
|
2115
|
+
});
|
|
2116
|
+
}
|
|
2236
2117
|
|
|
2237
|
-
|
|
2238
|
-
|
|
2118
|
+
throw new UnsupportedError('Unsupported entity type');
|
|
2119
|
+
}, options);
|
|
2120
|
+
}, [fetch, currentSpaceId, currentEnvironmentId]);
|
|
2121
|
+
var getEntityScheduledActions = React.useCallback(function getEntityScheduledActions(entityType, entityId, options) {
|
|
2122
|
+
var _options$spaceId2, _options$environmentI2;
|
|
2123
|
+
|
|
2124
|
+
var spaceId = (_options$spaceId2 = options == null ? void 0 : options.spaceId) != null ? _options$spaceId2 : currentSpaceId;
|
|
2125
|
+
var environmentId = (_options$environmentI2 = options == null ? void 0 : options.environmentId) != null ? _options$environmentI2 : currentEnvironmentId;
|
|
2126
|
+
var queryKey = ['scheduled-actions', entityType, entityId, spaceId, environmentId];
|
|
2127
|
+
return fetch(queryKey, /*#__PURE__*/function () {
|
|
2128
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
2129
|
+
var cmaClient, response;
|
|
2130
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
2131
|
+
while (1) {
|
|
2132
|
+
switch (_context.prev = _context.next) {
|
|
2133
|
+
case 0:
|
|
2134
|
+
cmaClient = _ref2.cmaClient;
|
|
2135
|
+
_context.next = 3;
|
|
2136
|
+
return cmaClient.scheduledActions.getMany({
|
|
2137
|
+
spaceId: spaceId,
|
|
2138
|
+
query: {
|
|
2139
|
+
'environment.sys.id': environmentId,
|
|
2140
|
+
'entity.sys.id': entityId,
|
|
2141
|
+
'sys.status[in]': 'scheduled',
|
|
2142
|
+
order: 'scheduledFor.datetime'
|
|
2143
|
+
}
|
|
2144
|
+
});
|
|
2239
2145
|
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
resourceType: resourceType,
|
|
2244
|
-
urn: urn,
|
|
2245
|
-
resourceInfo: resourceInfo
|
|
2246
|
-
});
|
|
2247
|
-
return _context6.abrupt("return", resourceInfo);
|
|
2248
|
-
|
|
2249
|
-
case 12:
|
|
2250
|
-
_context6.prev = 12;
|
|
2251
|
-
_context6.t0 = _context6["catch"](3);
|
|
2252
|
-
dispatch({
|
|
2253
|
-
type: 'set_resource_failed',
|
|
2254
|
-
resourceType: resourceType,
|
|
2255
|
-
urn: urn
|
|
2256
|
-
});
|
|
2257
|
-
return _context6.abrupt("return");
|
|
2146
|
+
case 3:
|
|
2147
|
+
response = _context.sent;
|
|
2148
|
+
return _context.abrupt("return", response.items);
|
|
2258
2149
|
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2150
|
+
case 5:
|
|
2151
|
+
case "end":
|
|
2152
|
+
return _context.stop();
|
|
2153
|
+
}
|
|
2262
2154
|
}
|
|
2263
|
-
}
|
|
2264
|
-
}
|
|
2265
|
-
}));
|
|
2155
|
+
}, _callee);
|
|
2156
|
+
}));
|
|
2266
2157
|
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
};
|
|
2270
|
-
}(), [loadContentfulEntry, state.resources]);
|
|
2271
|
-
React.useEffect(function () {
|
|
2272
|
-
// @ts-expect-error
|
|
2273
|
-
if (typeof props.sdk.space.onEntityChanged !== 'undefined') {
|
|
2274
|
-
// @ts-expect-error
|
|
2275
|
-
var onEntityChanged = props.sdk.space.onEntityChanged;
|
|
2276
|
-
var listeners = [];
|
|
2277
|
-
|
|
2278
|
-
var _loop = function _loop() {
|
|
2279
|
-
var _step$value = _step.value,
|
|
2280
|
-
id = _step$value[0];
|
|
2281
|
-
listeners.push(onEntityChanged('Entry', id, function (entry) {
|
|
2282
|
-
return dispatch({
|
|
2283
|
-
type: 'set_entry',
|
|
2284
|
-
id: id,
|
|
2285
|
-
entry: entry
|
|
2286
|
-
});
|
|
2287
|
-
}));
|
|
2158
|
+
return function (_x2) {
|
|
2159
|
+
return _ref3.apply(this, arguments);
|
|
2288
2160
|
};
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2161
|
+
}(), options);
|
|
2162
|
+
}, [fetch, currentSpaceId, currentEnvironmentId]);
|
|
2163
|
+
var getResource = React.useCallback(function getResource(resourceType, urn, options) {
|
|
2164
|
+
var queryKey = ['Resource', resourceType, urn];
|
|
2165
|
+
return fetch(queryKey, function () {
|
|
2166
|
+
if (resourceType === 'Contentful:Entry') {
|
|
2167
|
+
return fetchContentfulEntry({
|
|
2168
|
+
fetch: fetch,
|
|
2169
|
+
urn: urn,
|
|
2170
|
+
options: options
|
|
2171
|
+
});
|
|
2292
2172
|
}
|
|
2293
2173
|
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2174
|
+
throw new UnsupportedError('Unsupported resource type');
|
|
2175
|
+
}, options);
|
|
2176
|
+
}, [fetch]);
|
|
2177
|
+
var isSameSpaceEntityQueryKey = React.useCallback(function (queryKey) {
|
|
2178
|
+
var isEntityKey = isEntityQueryKey(queryKey);
|
|
2179
|
+
var isSameSpaceEntityKey = isEntityKey && queryKey[2] === currentSpaceId && queryKey[3] === currentEnvironmentId;
|
|
2180
|
+
return isSameSpaceEntityKey;
|
|
2181
|
+
}, [currentSpaceId, currentEnvironmentId]); // @ts-expect-error ...
|
|
2182
|
+
|
|
2183
|
+
// @ts-expect-error ...
|
|
2184
|
+
var onEntityChanged = props.sdk.space.onEntityChanged;
|
|
2185
|
+
React.useEffect(function () {
|
|
2186
|
+
if (typeof onEntityChanged !== 'function') {
|
|
2187
|
+
return;
|
|
2188
|
+
}
|
|
2305
2189
|
|
|
2306
|
-
|
|
2307
|
-
|
|
2190
|
+
var subscribeQuery = function subscribeQuery(_ref4) {
|
|
2191
|
+
var queryKey = _ref4.queryKey,
|
|
2192
|
+
queryHash = _ref4.queryHash;
|
|
2193
|
+
var entityType = queryKey[0],
|
|
2194
|
+
entityId = queryKey[1];
|
|
2195
|
+
entityChangeUnsubscribers.current[queryHash] = onEntityChanged(entityType, entityId, function (data) {
|
|
2196
|
+
queryClient.setQueryData(queryKey, data);
|
|
2197
|
+
});
|
|
2198
|
+
};
|
|
2199
|
+
|
|
2200
|
+
var queries = queryCache.findAll({
|
|
2201
|
+
type: 'active',
|
|
2202
|
+
predicate: function predicate(query) {
|
|
2203
|
+
return isSameSpaceEntityQueryKey(query.queryKey);
|
|
2204
|
+
}
|
|
2205
|
+
});
|
|
2206
|
+
queries.forEach(subscribeQuery);
|
|
2207
|
+
var unsubscribe = queryCache.subscribe(function (event) {
|
|
2208
|
+
if (!event) {
|
|
2209
|
+
return;
|
|
2308
2210
|
}
|
|
2309
2211
|
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
};
|
|
2315
|
-
}
|
|
2212
|
+
var type = event.type,
|
|
2213
|
+
query = event.query;
|
|
2214
|
+
var queryKey = query.queryKey,
|
|
2215
|
+
queryHash = query.queryHash;
|
|
2316
2216
|
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2217
|
+
if (!isSameSpaceEntityQueryKey(queryKey)) {
|
|
2218
|
+
return;
|
|
2219
|
+
}
|
|
2320
2220
|
|
|
2321
|
-
if (
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
id = _step3$value[0];
|
|
2325
|
-
loadEntry(id);
|
|
2326
|
-
}
|
|
2221
|
+
if (type === 'added') {
|
|
2222
|
+
subscribeQuery(query);
|
|
2223
|
+
}
|
|
2327
2224
|
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2225
|
+
if (type === 'removed') {
|
|
2226
|
+
var _entityChangeUnsubscr, _entityChangeUnsubscr2;
|
|
2227
|
+
|
|
2228
|
+
// calling unsubscribe
|
|
2229
|
+
(_entityChangeUnsubscr = (_entityChangeUnsubscr2 = entityChangeUnsubscribers.current)[queryHash]) == null ? void 0 : _entityChangeUnsubscr.call(_entityChangeUnsubscr2);
|
|
2333
2230
|
}
|
|
2334
|
-
});
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
getOrLoadEntry: getEntry,
|
|
2342
|
-
|
|
2343
|
-
/**
|
|
2344
|
-
* @deprecated use `getAsset` instead
|
|
2345
|
-
*/
|
|
2346
|
-
getOrLoadAsset: getAsset,
|
|
2347
|
-
getResource: getResource,
|
|
2348
|
-
getEntry: getEntry,
|
|
2349
|
-
getAsset: getAsset,
|
|
2350
|
-
loadEntityScheduledActions: loadEntityScheduledActions,
|
|
2351
|
-
entries: state.entries,
|
|
2352
|
-
assets: state.assets,
|
|
2353
|
-
scheduledActions: state.scheduledActions,
|
|
2354
|
-
resources: state.resources
|
|
2231
|
+
});
|
|
2232
|
+
return function () {
|
|
2233
|
+
unsubscribe();
|
|
2234
|
+
Object.values(entityChangeUnsubscribers.current).forEach(function (off) {
|
|
2235
|
+
return off();
|
|
2236
|
+
});
|
|
2237
|
+
entityChangeUnsubscribers.current = {};
|
|
2355
2238
|
};
|
|
2356
|
-
}, [
|
|
2239
|
+
}, [onEntityChanged, queryCache, isSameSpaceEntityQueryKey, queryClient]);
|
|
2240
|
+
return {
|
|
2241
|
+
cmaClient: cmaClient,
|
|
2242
|
+
fetch: fetch,
|
|
2243
|
+
getResource: getResource,
|
|
2244
|
+
getEntity: getEntity,
|
|
2245
|
+
ids: props.sdk.ids,
|
|
2246
|
+
getEntityScheduledActions: getEntityScheduledActions
|
|
2247
|
+
};
|
|
2248
|
+
}, function (_ref5) {
|
|
2249
|
+
var fetch = _ref5.fetch;
|
|
2250
|
+
return fetch;
|
|
2251
|
+
}, function (_ref6) {
|
|
2252
|
+
var getResource = _ref6.getResource,
|
|
2253
|
+
getEntity = _ref6.getEntity,
|
|
2254
|
+
getEntityScheduledActions = _ref6.getEntityScheduledActions;
|
|
2255
|
+
return {
|
|
2256
|
+
getResource: getResource,
|
|
2257
|
+
getEntity: getEntity,
|
|
2258
|
+
getEntityScheduledActions: getEntityScheduledActions
|
|
2259
|
+
};
|
|
2260
|
+
}, function (_ref7) {
|
|
2261
|
+
var ids = _ref7.ids;
|
|
2262
|
+
return ids;
|
|
2263
|
+
}),
|
|
2264
|
+
InternalServiceProvider = _constate[0],
|
|
2265
|
+
useEntityLoader = _constate[2],
|
|
2266
|
+
useCurrentIds = _constate[3];
|
|
2267
|
+
|
|
2268
|
+
function useEntity(entityType, entityId, options) {
|
|
2269
|
+
var _options$spaceId3, _options$environmentI3;
|
|
2270
|
+
|
|
2271
|
+
var _useCurrentIds = useCurrentIds(),
|
|
2272
|
+
space = _useCurrentIds.space,
|
|
2273
|
+
environment = _useCurrentIds.environment;
|
|
2274
|
+
|
|
2275
|
+
var _useEntityLoader = useEntityLoader(),
|
|
2276
|
+
getEntity = _useEntityLoader.getEntity;
|
|
2277
|
+
|
|
2278
|
+
var queryKey = [entityType, entityId, (_options$spaceId3 = options == null ? void 0 : options.spaceId) != null ? _options$spaceId3 : space, (_options$environmentI3 = options == null ? void 0 : options.environmentId) != null ? _options$environmentI3 : environment];
|
|
2279
|
+
|
|
2280
|
+
var _useQuery = reactQuery.useQuery(queryKey, function () {
|
|
2281
|
+
return getEntity(entityType, entityId, options);
|
|
2282
|
+
}, {
|
|
2283
|
+
enabled: options == null ? void 0 : options.enabled,
|
|
2284
|
+
useErrorBoundary: false
|
|
2285
|
+
}),
|
|
2286
|
+
status = _useQuery.status,
|
|
2287
|
+
data = _useQuery.data;
|
|
2288
|
+
|
|
2289
|
+
return {
|
|
2290
|
+
status: status,
|
|
2291
|
+
data: data
|
|
2292
|
+
};
|
|
2357
2293
|
}
|
|
2294
|
+
function useResource(resourceType, urn, options) {
|
|
2295
|
+
var queryKey = ['Resource', resourceType, urn];
|
|
2296
|
+
|
|
2297
|
+
var _useEntityLoader2 = useEntityLoader(),
|
|
2298
|
+
getResource = _useEntityLoader2.getResource;
|
|
2299
|
+
|
|
2300
|
+
var _useQuery2 = reactQuery.useQuery(queryKey, function () {
|
|
2301
|
+
return getResource(resourceType, urn, options);
|
|
2302
|
+
}, {
|
|
2303
|
+
enabled: options == null ? void 0 : options.enabled,
|
|
2304
|
+
// TODO: check if this is ok for all errors
|
|
2305
|
+
useErrorBoundary: false
|
|
2306
|
+
}),
|
|
2307
|
+
status = _useQuery2.status,
|
|
2308
|
+
data = _useQuery2.data,
|
|
2309
|
+
error = _useQuery2.error;
|
|
2358
2310
|
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2311
|
+
return {
|
|
2312
|
+
status: status,
|
|
2313
|
+
data: data,
|
|
2314
|
+
error: error
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
function EntityProvider(_ref8) {
|
|
2319
|
+
var children = _ref8.children,
|
|
2320
|
+
props = _objectWithoutPropertiesLoose(_ref8, _excluded2);
|
|
2321
|
+
|
|
2322
|
+
var reactQueryClient = React.useMemo(function () {
|
|
2323
|
+
var queryCache = new reactQuery.QueryCache();
|
|
2324
|
+
var queryClient = new reactQuery.QueryClient({
|
|
2325
|
+
queryCache: queryCache,
|
|
2326
|
+
defaultOptions: {
|
|
2327
|
+
queries: {
|
|
2328
|
+
useErrorBoundary: true,
|
|
2329
|
+
refetchOnWindowFocus: false,
|
|
2330
|
+
refetchOnReconnect: true,
|
|
2331
|
+
refetchOnMount: false,
|
|
2332
|
+
staleTime: Infinity,
|
|
2333
|
+
retry: false
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
});
|
|
2337
|
+
return queryClient;
|
|
2338
|
+
}, []);
|
|
2339
|
+
return React__default.createElement(reactQuery.QueryClientProvider, {
|
|
2340
|
+
client: reactQueryClient
|
|
2341
|
+
}, React__default.createElement(InternalServiceProvider, _extends({}, props), children));
|
|
2342
|
+
}
|
|
2362
2343
|
|
|
2363
2344
|
function ReferenceEditor(props) {
|
|
2364
2345
|
return React.createElement(EntityProvider, {
|
|
@@ -2580,7 +2561,10 @@ function fromFieldValidations(field) {
|
|
|
2580
2561
|
var result = {
|
|
2581
2562
|
contentTypes: (_linkContentTypeValid = linkContentTypeValidations == null ? void 0 : linkContentTypeValidations.linkContentType) != null ? _linkContentTypeValid : undefined,
|
|
2582
2563
|
mimetypeGroups: (_linkMimetypeGroupVal = linkMimetypeGroupValidations == null ? void 0 : linkMimetypeGroupValidations.linkMimetypeGroup) != null ? _linkMimetypeGroupVal : undefined,
|
|
2583
|
-
numberOfLinks: numberOfLinks
|
|
2564
|
+
numberOfLinks: numberOfLinks // todo: there are multiple BE problems that need to be solved first, for now we don't want to apply size constraints
|
|
2565
|
+
// linkedFileSize: findValidation(field, 'assetFileSize', {}),
|
|
2566
|
+
// linkedImageDimensions: findValidation(field, 'assetImageDimensions', {})
|
|
2567
|
+
|
|
2584
2568
|
};
|
|
2585
2569
|
return result;
|
|
2586
2570
|
}
|
|
@@ -2779,7 +2763,7 @@ function Editor(props) {
|
|
|
2779
2763
|
[linkActionsProps]);
|
|
2780
2764
|
|
|
2781
2765
|
if (!props.entityId) {
|
|
2782
|
-
return React.createElement(LinkEntityActions,
|
|
2766
|
+
return React.createElement(LinkEntityActions, _extends({
|
|
2783
2767
|
renderCustomActions: props.renderCustomActions
|
|
2784
2768
|
}, linkActionsProps));
|
|
2785
2769
|
}
|
|
@@ -2791,12 +2775,12 @@ function Editor(props) {
|
|
|
2791
2775
|
|
|
2792
2776
|
function SingleReferenceEditor(props) {
|
|
2793
2777
|
var allContentTypes = props.sdk.space.getCachedContentTypes();
|
|
2794
|
-
return React.createElement(ReferenceEditor,
|
|
2778
|
+
return React.createElement(ReferenceEditor, _extends({}, props), function (_ref) {
|
|
2795
2779
|
var value = _ref.value,
|
|
2796
2780
|
setValue = _ref.setValue,
|
|
2797
2781
|
disabled = _ref.disabled,
|
|
2798
2782
|
externalReset = _ref.externalReset;
|
|
2799
|
-
return React.createElement(Editor,
|
|
2783
|
+
return React.createElement(Editor, _extends({}, props, {
|
|
2800
2784
|
key: externalReset + "-reference",
|
|
2801
2785
|
entityId: value ? value.sys.id : '',
|
|
2802
2786
|
isDisabled: disabled,
|
|
@@ -3026,18 +3010,24 @@ function _openEntry() {
|
|
|
3026
3010
|
}
|
|
3027
3011
|
|
|
3028
3012
|
function FetchingWrappedEntryCard(props) {
|
|
3029
|
-
var
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
loadEntityScheduledActions = _useEntities.loadEntityScheduledActions,
|
|
3033
|
-
entries = _useEntities.entries;
|
|
3013
|
+
var _useEntity = useEntity('Entry', props.entryId),
|
|
3014
|
+
entry = _useEntity.data,
|
|
3015
|
+
status = _useEntity.status;
|
|
3034
3016
|
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3017
|
+
var _useEntityLoader = useEntityLoader(),
|
|
3018
|
+
getEntityScheduledActions = _useEntityLoader.getEntityScheduledActions;
|
|
3019
|
+
|
|
3020
|
+
var loadEntityScheduledActions = React.useCallback(function () {
|
|
3021
|
+
return getEntityScheduledActions('Entry', props.entryId);
|
|
3022
|
+
}, [getEntityScheduledActions, props.entryId]);
|
|
3038
3023
|
var size = props.viewType === 'link' ? 'small' : 'default';
|
|
3039
|
-
|
|
3040
|
-
var
|
|
3024
|
+
|
|
3025
|
+
var _useEntityLoader2 = useEntityLoader(),
|
|
3026
|
+
getEntity = _useEntityLoader2.getEntity;
|
|
3027
|
+
|
|
3028
|
+
var getAsset = function getAsset(assetId) {
|
|
3029
|
+
return getEntity('Asset', assetId);
|
|
3030
|
+
};
|
|
3041
3031
|
|
|
3042
3032
|
var onEdit = /*#__PURE__*/function () {
|
|
3043
3033
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
@@ -3095,7 +3085,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
3095
3085
|
|
|
3096
3086
|
}, [entry]);
|
|
3097
3087
|
return React.useMemo(function () {
|
|
3098
|
-
if (
|
|
3088
|
+
if (status === 'error') {
|
|
3099
3089
|
var card = React.createElement(MissingEntityCard, {
|
|
3100
3090
|
entityType: "Entry",
|
|
3101
3091
|
isDisabled: props.isDisabled,
|
|
@@ -3115,7 +3105,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
3115
3105
|
return card;
|
|
3116
3106
|
}
|
|
3117
3107
|
|
|
3118
|
-
if (
|
|
3108
|
+
if (status === 'loading') {
|
|
3119
3109
|
return React.createElement(f36Components.EntryCard, {
|
|
3120
3110
|
size: size,
|
|
3121
3111
|
isLoading: true
|
|
@@ -3154,7 +3144,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
3154
3144
|
entryUrl: (props == null ? void 0 : props.entityUrl) || sharedCardProps.entityUrl
|
|
3155
3145
|
});
|
|
3156
3146
|
|
|
3157
|
-
return React.createElement(WrappedEntryCard,
|
|
3147
|
+
return React.createElement(WrappedEntryCard, _extends({}, builtinCardProps));
|
|
3158
3148
|
}
|
|
3159
3149
|
|
|
3160
3150
|
if (props.renderCustomCard) {
|
|
@@ -3167,11 +3157,11 @@ function FetchingWrappedEntryCard(props) {
|
|
|
3167
3157
|
}
|
|
3168
3158
|
|
|
3169
3159
|
return renderDefaultCard(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
3170
|
-
}, [props,
|
|
3160
|
+
}, [props, status, entry]);
|
|
3171
3161
|
}
|
|
3172
3162
|
|
|
3173
3163
|
function SingleEntryReferenceEditor(props) {
|
|
3174
|
-
return React.createElement(SingleReferenceEditor,
|
|
3164
|
+
return React.createElement(SingleReferenceEditor, _extends({}, props, {
|
|
3175
3165
|
entityType: "Entry"
|
|
3176
3166
|
}), function (_ref) {
|
|
3177
3167
|
var allContentTypes = _ref.allContentTypes,
|
|
@@ -3181,7 +3171,7 @@ function SingleEntryReferenceEditor(props) {
|
|
|
3181
3171
|
renderCustomCard = _ref.renderCustomCard,
|
|
3182
3172
|
hasCardRemoveActions = _ref.hasCardRemoveActions,
|
|
3183
3173
|
hasCardEditActions = _ref.hasCardEditActions;
|
|
3184
|
-
return React.createElement(FetchingWrappedEntryCard,
|
|
3174
|
+
return React.createElement(FetchingWrappedEntryCard, _extends({}, props, {
|
|
3185
3175
|
allContentTypes: allContentTypes,
|
|
3186
3176
|
isDisabled: isDisabled,
|
|
3187
3177
|
entryId: entityId,
|
|
@@ -3272,19 +3262,19 @@ function Editor$1(props) {
|
|
|
3272
3262
|
onSortEnd: onSortEnd,
|
|
3273
3263
|
onMove: onMove,
|
|
3274
3264
|
renderCustomCard: props.renderCustomCard && customCardRenderer
|
|
3275
|
-
})), React.createElement(LinkEntityActions,
|
|
3265
|
+
})), React.createElement(LinkEntityActions, _extends({
|
|
3276
3266
|
renderCustomActions: props.renderCustomActions
|
|
3277
3267
|
}, linkActionsProps)));
|
|
3278
3268
|
}
|
|
3279
3269
|
|
|
3280
3270
|
function MultipleReferenceEditor(props) {
|
|
3281
3271
|
var allContentTypes = props.sdk.space.getCachedContentTypes();
|
|
3282
|
-
return React.createElement(ReferenceEditor,
|
|
3272
|
+
return React.createElement(ReferenceEditor, _extends({}, props), function (_ref2) {
|
|
3283
3273
|
var value = _ref2.value,
|
|
3284
3274
|
disabled = _ref2.disabled,
|
|
3285
3275
|
setValue = _ref2.setValue,
|
|
3286
3276
|
externalReset = _ref2.externalReset;
|
|
3287
|
-
return React.createElement(Editor$1,
|
|
3277
|
+
return React.createElement(Editor$1, _extends({}, props, {
|
|
3288
3278
|
items: value || emptyArray,
|
|
3289
3279
|
isDisabled: disabled,
|
|
3290
3280
|
setValue: setValue,
|
|
@@ -3341,16 +3331,16 @@ var SortableLinkListInternal = /*#__PURE__*/reactSortableHoc.SortableContainer(f
|
|
|
3341
3331
|
function SortableLinkList(props) {
|
|
3342
3332
|
// with the default distance of 0 the drag start event is "confused" with the click event,
|
|
3343
3333
|
// so the latter one isn't fired and click handlers on child elements don't work
|
|
3344
|
-
return React__default.createElement(SortableLinkListInternal,
|
|
3334
|
+
return React__default.createElement(SortableLinkListInternal, _extends({
|
|
3345
3335
|
distance: 1
|
|
3346
3336
|
}, props), props.children);
|
|
3347
3337
|
}
|
|
3348
3338
|
|
|
3349
3339
|
function MultipleEntryReferenceEditor(props) {
|
|
3350
|
-
return React.createElement(MultipleReferenceEditor,
|
|
3340
|
+
return React.createElement(MultipleReferenceEditor, _extends({}, props, {
|
|
3351
3341
|
entityType: "Entry"
|
|
3352
3342
|
}), function (childrenProps) {
|
|
3353
|
-
return React.createElement(SortableLinkList,
|
|
3343
|
+
return React.createElement(SortableLinkList, _extends({}, childrenProps, {
|
|
3354
3344
|
axis: "y",
|
|
3355
3345
|
useDragHandle: true
|
|
3356
3346
|
}), function (_ref) {
|
|
@@ -3360,7 +3350,7 @@ function MultipleEntryReferenceEditor(props) {
|
|
|
3360
3350
|
isDisabled = _ref.isDisabled,
|
|
3361
3351
|
DragHandle = _ref.DragHandle;
|
|
3362
3352
|
var lastIndex = items.length - 1;
|
|
3363
|
-
return React.createElement(FetchingWrappedEntryCard,
|
|
3353
|
+
return React.createElement(FetchingWrappedEntryCard, _extends({}, childrenProps, {
|
|
3364
3354
|
key: item.sys.id + "-" + index,
|
|
3365
3355
|
index: index,
|
|
3366
3356
|
allContentTypes: childrenProps.allContentTypes,
|
|
@@ -3615,20 +3605,16 @@ var WrappedAssetLink = function WrappedAssetLink(props) {
|
|
|
3615
3605
|
};
|
|
3616
3606
|
|
|
3617
3607
|
function FetchingWrappedAssetCard(props) {
|
|
3618
|
-
var
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
assets = _useEntities.assets;
|
|
3608
|
+
var _useEntity = useEntity('Asset', props.assetId),
|
|
3609
|
+
asset = _useEntity.data,
|
|
3610
|
+
status = _useEntity.status;
|
|
3622
3611
|
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
return;
|
|
3626
|
-
}
|
|
3612
|
+
var _useEntityLoader = useEntityLoader(),
|
|
3613
|
+
getEntityScheduledActions = _useEntityLoader.getEntityScheduledActions;
|
|
3627
3614
|
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
var entityKey = asset === 'failed' ? 'failed' : asset === undefined ? 'undefined' : ":" + asset.sys.id + ":" + asset.sys.version;
|
|
3615
|
+
var loadEntityScheduledActions = React.useCallback(function () {
|
|
3616
|
+
return getEntityScheduledActions('Asset', props.assetId);
|
|
3617
|
+
}, [getEntityScheduledActions, props.assetId]);
|
|
3632
3618
|
React.useEffect(function () {
|
|
3633
3619
|
if (asset) {
|
|
3634
3620
|
props.onAction && props.onAction({
|
|
@@ -3687,7 +3673,7 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3687
3673
|
};
|
|
3688
3674
|
|
|
3689
3675
|
return React.useMemo(function () {
|
|
3690
|
-
if (
|
|
3676
|
+
if (status === 'error') {
|
|
3691
3677
|
var card = React.createElement(MissingEntityCard, {
|
|
3692
3678
|
entityType: "Asset",
|
|
3693
3679
|
asSquare: props.viewType !== 'link',
|
|
@@ -3708,8 +3694,7 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3708
3694
|
return card;
|
|
3709
3695
|
}
|
|
3710
3696
|
|
|
3711
|
-
var getEntityUrl = props.getEntityUrl
|
|
3712
|
-
sdk = props.sdk;
|
|
3697
|
+
var getEntityUrl = props.getEntityUrl;
|
|
3713
3698
|
var size = props.viewType === 'big_card' ? 'default' : 'small';
|
|
3714
3699
|
var commonProps = {
|
|
3715
3700
|
asset: asset,
|
|
@@ -3724,20 +3709,20 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3724
3709
|
};
|
|
3725
3710
|
|
|
3726
3711
|
if (props.viewType === 'link') {
|
|
3727
|
-
if (
|
|
3712
|
+
if (status === 'loading') {
|
|
3728
3713
|
return React.createElement(f36Components.EntryCard, {
|
|
3729
3714
|
size: "small",
|
|
3730
3715
|
isLoading: true
|
|
3731
3716
|
});
|
|
3732
3717
|
}
|
|
3733
3718
|
|
|
3734
|
-
return React.createElement(WrappedAssetLink,
|
|
3719
|
+
return React.createElement(WrappedAssetLink, _extends({}, commonProps, {
|
|
3735
3720
|
href: commonProps.entityUrl,
|
|
3736
|
-
getEntityScheduledActions:
|
|
3721
|
+
getEntityScheduledActions: loadEntityScheduledActions
|
|
3737
3722
|
}));
|
|
3738
3723
|
}
|
|
3739
3724
|
|
|
3740
|
-
if (
|
|
3725
|
+
if (status === 'loading') {
|
|
3741
3726
|
return React.createElement(f36Components.AssetCard, {
|
|
3742
3727
|
size: size,
|
|
3743
3728
|
isLoading: true
|
|
@@ -3752,7 +3737,7 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3752
3737
|
getAssetUrl: getEntityUrl
|
|
3753
3738
|
});
|
|
3754
3739
|
|
|
3755
|
-
return React.createElement(WrappedAssetCard,
|
|
3740
|
+
return React.createElement(WrappedAssetCard, _extends({}, builtinCardProps));
|
|
3756
3741
|
}
|
|
3757
3742
|
|
|
3758
3743
|
if (props.renderCustomCard) {
|
|
@@ -3769,17 +3754,17 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3769
3754
|
}
|
|
3770
3755
|
|
|
3771
3756
|
return renderDefaultCard(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
3772
|
-
}, [props,
|
|
3757
|
+
}, [props, status, asset]);
|
|
3773
3758
|
}
|
|
3774
3759
|
|
|
3775
3760
|
function SingleMediaEditor(props) {
|
|
3776
|
-
return React.createElement(SingleReferenceEditor,
|
|
3761
|
+
return React.createElement(SingleReferenceEditor, _extends({}, props, {
|
|
3777
3762
|
entityType: "Asset"
|
|
3778
3763
|
}), function (_ref) {
|
|
3779
3764
|
var entityId = _ref.entityId,
|
|
3780
3765
|
isDisabled = _ref.isDisabled,
|
|
3781
3766
|
setValue = _ref.setValue;
|
|
3782
|
-
return React.createElement(FetchingWrappedAssetCard,
|
|
3767
|
+
return React.createElement(FetchingWrappedAssetCard, _extends({}, props, {
|
|
3783
3768
|
viewType: "big_card",
|
|
3784
3769
|
assetId: entityId,
|
|
3785
3770
|
isDisabled: isDisabled,
|
|
@@ -3801,12 +3786,12 @@ var styles$6 = {
|
|
|
3801
3786
|
})
|
|
3802
3787
|
};
|
|
3803
3788
|
function MultipleMediaEditor(props) {
|
|
3804
|
-
return React.createElement(MultipleReferenceEditor,
|
|
3789
|
+
return React.createElement(MultipleReferenceEditor, _extends({}, props, {
|
|
3805
3790
|
entityType: "Asset"
|
|
3806
3791
|
}), function (childrenProps) {
|
|
3807
3792
|
var _cx;
|
|
3808
3793
|
|
|
3809
|
-
return React.createElement(SortableLinkList,
|
|
3794
|
+
return React.createElement(SortableLinkList, _extends({}, childrenProps, {
|
|
3810
3795
|
className: emotion.cx((_cx = {}, _cx[styles$6.gridContainer] = childrenProps.viewType === 'card', _cx)),
|
|
3811
3796
|
axis: childrenProps.viewType === 'card' ? 'xy' : 'y',
|
|
3812
3797
|
useDragHandle: true
|
|
@@ -3816,7 +3801,7 @@ function MultipleMediaEditor(props) {
|
|
|
3816
3801
|
index = _ref.index,
|
|
3817
3802
|
isDisabled = _ref.isDisabled,
|
|
3818
3803
|
DragHandle = _ref.DragHandle;
|
|
3819
|
-
return React.createElement(FetchingWrappedAssetCard,
|
|
3804
|
+
return React.createElement(FetchingWrappedAssetCard, _extends({}, childrenProps, {
|
|
3820
3805
|
isDisabled: isDisabled,
|
|
3821
3806
|
key: item.sys.id + "-" + index,
|
|
3822
3807
|
assetId: item.sys.id,
|
|
@@ -3849,5 +3834,7 @@ exports.SortableLinkList = SortableLinkList;
|
|
|
3849
3834
|
exports.WrappedAssetCard = WrappedAssetCard;
|
|
3850
3835
|
exports.WrappedEntryCard = WrappedEntryCard;
|
|
3851
3836
|
exports.getScheduleTooltipContent = getScheduleTooltipContent;
|
|
3852
|
-
exports.
|
|
3837
|
+
exports.useEntity = useEntity;
|
|
3838
|
+
exports.useEntityLoader = useEntityLoader;
|
|
3839
|
+
exports.useResource = useResource;
|
|
3853
3840
|
//# sourceMappingURL=field-editor-reference.cjs.development.js.map
|