@contentful/field-editor-reference 4.3.11 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/__fixtures__/FakeSdk.d.ts +20 -151
- package/dist/assets/WrappedAssetCard/FetchingWrappedAssetCard.d.ts +1 -1
- package/dist/common/EntityStore.d.ts +7 -1
- package/dist/common/SortableLinkList.d.ts +19 -0
- package/dist/components/SpaceName/SpaceName.d.ts +6 -0
- package/dist/entries/WrappedEntryCard/FetchingWrappedEntryCard.d.ts +2 -2
- package/dist/entries/WrappedEntryCard/WrappedEntryCard.d.ts +1 -0
- package/dist/field-editor-reference.cjs.development.js +553 -175
- 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 +556 -179
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/types.d.ts +29 -1
- package/package.json +4 -3
- package/dist/assets/SortableElements.d.ts +0 -8
- package/dist/entries/SortableElements.d.ts +0 -10
|
@@ -15,6 +15,7 @@ var moment = _interopDefault(require('moment'));
|
|
|
15
15
|
var deepEqual = _interopDefault(require('deep-equal'));
|
|
16
16
|
var fieldEditorShared = require('@contentful/field-editor-shared');
|
|
17
17
|
var constate = _interopDefault(require('constate'));
|
|
18
|
+
var contentfulManagement = require('contentful-management');
|
|
18
19
|
var isNumber = _interopDefault(require('lodash/isNumber'));
|
|
19
20
|
var arrayMove = _interopDefault(require('array-move'));
|
|
20
21
|
var reactSortableHoc = require('react-sortable-hoc');
|
|
@@ -89,6 +90,44 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
89
90
|
return target;
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
94
|
+
if (!o) return;
|
|
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);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function _arrayLikeToArray(arr, len) {
|
|
103
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
104
|
+
|
|
105
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
106
|
+
|
|
107
|
+
return arr2;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
111
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
112
|
+
if (it) return (it = it.call(o)).next.bind(it);
|
|
113
|
+
|
|
114
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
115
|
+
if (it) o = it;
|
|
116
|
+
var i = 0;
|
|
117
|
+
return function () {
|
|
118
|
+
if (i >= o.length) return {
|
|
119
|
+
done: true
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
done: false,
|
|
123
|
+
value: o[i++]
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
129
|
+
}
|
|
130
|
+
|
|
92
131
|
var container = /*#__PURE__*/emotion.css({
|
|
93
132
|
display: 'flex',
|
|
94
133
|
border: "1px dashed " + tokens.gray500,
|
|
@@ -1829,7 +1868,7 @@ function AssetThumbnail(props) {
|
|
|
1829
1868
|
}
|
|
1830
1869
|
|
|
1831
1870
|
function reducer(state, action) {
|
|
1832
|
-
var _extends2, _extends3, _extends4, _extends5, _extends6;
|
|
1871
|
+
var _extends2, _extends3, _extends4, _extends5, _extends6, _extends7, _extends8;
|
|
1833
1872
|
|
|
1834
1873
|
switch (action.type) {
|
|
1835
1874
|
case 'set_entry':
|
|
@@ -1857,6 +1896,16 @@ function reducer(state, action) {
|
|
|
1857
1896
|
scheduledActions: _extends({}, state.scheduledActions, (_extends6 = {}, _extends6[action.key] = action.actions, _extends6))
|
|
1858
1897
|
});
|
|
1859
1898
|
|
|
1899
|
+
case 'set_resource':
|
|
1900
|
+
return _extends({}, state, {
|
|
1901
|
+
resources: _extends({}, state.resources, (_extends7 = {}, _extends7[action.resourceType + "." + action.urn] = action.resourceInfo, _extends7))
|
|
1902
|
+
});
|
|
1903
|
+
|
|
1904
|
+
case 'set_resource_failed':
|
|
1905
|
+
return _extends({}, state, {
|
|
1906
|
+
resources: _extends({}, state.resources, (_extends8 = {}, _extends8[action.resourceType + "." + action.urn] = 'failed', _extends8))
|
|
1907
|
+
});
|
|
1908
|
+
|
|
1860
1909
|
default:
|
|
1861
1910
|
return state;
|
|
1862
1911
|
}
|
|
@@ -1865,10 +1914,34 @@ function reducer(state, action) {
|
|
|
1865
1914
|
var initialState = {
|
|
1866
1915
|
entries: {},
|
|
1867
1916
|
assets: {},
|
|
1868
|
-
scheduledActions: {}
|
|
1917
|
+
scheduledActions: {},
|
|
1918
|
+
resources: {}
|
|
1919
|
+
};
|
|
1920
|
+
|
|
1921
|
+
var isNotNil = function isNotNil(entity) {
|
|
1922
|
+
return Boolean(entity && entity !== 'failed');
|
|
1923
|
+
};
|
|
1924
|
+
|
|
1925
|
+
var nonNilResources = function nonNilResources(map) {
|
|
1926
|
+
return Object.entries(map).filter(function (_ref) {
|
|
1927
|
+
var value = _ref[1];
|
|
1928
|
+
return isNotNil(value);
|
|
1929
|
+
});
|
|
1869
1930
|
};
|
|
1870
1931
|
|
|
1871
1932
|
function useEntitiesStore(props) {
|
|
1933
|
+
var spaceId = props.sdk.ids.space;
|
|
1934
|
+
var environmentId = props.sdk.ids.environment;
|
|
1935
|
+
|
|
1936
|
+
var _React$useState = React.useState(function () {
|
|
1937
|
+
return contentfulManagement.createClient({
|
|
1938
|
+
apiAdapter: props.sdk.cmaAdapter
|
|
1939
|
+
}, {
|
|
1940
|
+
type: 'plain'
|
|
1941
|
+
});
|
|
1942
|
+
}),
|
|
1943
|
+
cmaClient = _React$useState[0];
|
|
1944
|
+
|
|
1872
1945
|
var _React$useReducer = React.useReducer(reducer, initialState),
|
|
1873
1946
|
state = _React$useReducer[0],
|
|
1874
1947
|
dispatch = _React$useReducer[1];
|
|
@@ -1896,78 +1969,348 @@ function useEntitiesStore(props) {
|
|
|
1896
1969
|
return [];
|
|
1897
1970
|
});
|
|
1898
1971
|
}, [props.sdk.space, state.scheduledActions]);
|
|
1899
|
-
var loadEntry = React.useCallback(function (
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
}, [props.sdk.space]);
|
|
1914
|
-
var loadAsset = React.useCallback(function (id) {
|
|
1915
|
-
return props.sdk.space.getAsset(id).then(function (asset) {
|
|
1916
|
-
dispatch({
|
|
1917
|
-
type: 'set_asset',
|
|
1918
|
-
id: id,
|
|
1919
|
-
asset: asset
|
|
1920
|
-
});
|
|
1921
|
-
return asset;
|
|
1922
|
-
})["catch"](function () {
|
|
1923
|
-
dispatch({
|
|
1924
|
-
type: 'set_asset_failed',
|
|
1925
|
-
id: id
|
|
1926
|
-
});
|
|
1927
|
-
});
|
|
1928
|
-
}, [props.sdk.space]);
|
|
1929
|
-
var getOrLoadAsset = React.useCallback(function (id) {
|
|
1930
|
-
if (state.assets[id] && state.assets[id] !== 'failed') {
|
|
1931
|
-
return Promise.resolve(state.assets[id]);
|
|
1932
|
-
}
|
|
1972
|
+
var loadEntry = React.useCallback( /*#__PURE__*/function () {
|
|
1973
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(entryId) {
|
|
1974
|
+
var entry;
|
|
1975
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1976
|
+
while (1) {
|
|
1977
|
+
switch (_context.prev = _context.next) {
|
|
1978
|
+
case 0:
|
|
1979
|
+
_context.prev = 0;
|
|
1980
|
+
_context.next = 3;
|
|
1981
|
+
return cmaClient.entry.get({
|
|
1982
|
+
spaceId: spaceId,
|
|
1983
|
+
environmentId: environmentId,
|
|
1984
|
+
entryId: entryId
|
|
1985
|
+
});
|
|
1933
1986
|
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1987
|
+
case 3:
|
|
1988
|
+
entry = _context.sent;
|
|
1989
|
+
dispatch({
|
|
1990
|
+
type: 'set_entry',
|
|
1991
|
+
id: entryId,
|
|
1992
|
+
entry: entry
|
|
1993
|
+
});
|
|
1994
|
+
return _context.abrupt("return", entry);
|
|
1995
|
+
|
|
1996
|
+
case 8:
|
|
1997
|
+
_context.prev = 8;
|
|
1998
|
+
_context.t0 = _context["catch"](0);
|
|
1999
|
+
dispatch({
|
|
2000
|
+
type: 'set_entry_failed',
|
|
2001
|
+
id: entryId
|
|
2002
|
+
});
|
|
2003
|
+
return _context.abrupt("return");
|
|
2004
|
+
|
|
2005
|
+
case 12:
|
|
2006
|
+
case "end":
|
|
2007
|
+
return _context.stop();
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
}, _callee, null, [[0, 8]]);
|
|
2011
|
+
}));
|
|
2012
|
+
|
|
2013
|
+
return function (_x) {
|
|
2014
|
+
return _ref2.apply(this, arguments);
|
|
2015
|
+
};
|
|
2016
|
+
}(), [cmaClient, spaceId, environmentId]);
|
|
2017
|
+
var getEntry = React.useCallback( /*#__PURE__*/function () {
|
|
2018
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(entryId) {
|
|
2019
|
+
var cachedEntry;
|
|
2020
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
2021
|
+
while (1) {
|
|
2022
|
+
switch (_context2.prev = _context2.next) {
|
|
2023
|
+
case 0:
|
|
2024
|
+
cachedEntry = state.entries[entryId];
|
|
2025
|
+
|
|
2026
|
+
if (!isNotNil(cachedEntry)) {
|
|
2027
|
+
_context2.next = 3;
|
|
2028
|
+
break;
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
return _context2.abrupt("return", cachedEntry);
|
|
2032
|
+
|
|
2033
|
+
case 3:
|
|
2034
|
+
return _context2.abrupt("return", loadEntry(entryId));
|
|
2035
|
+
|
|
2036
|
+
case 4:
|
|
2037
|
+
case "end":
|
|
2038
|
+
return _context2.stop();
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
}, _callee2);
|
|
2042
|
+
}));
|
|
2043
|
+
|
|
2044
|
+
return function (_x2) {
|
|
2045
|
+
return _ref3.apply(this, arguments);
|
|
2046
|
+
};
|
|
2047
|
+
}(), [loadEntry, state.entries]);
|
|
2048
|
+
var loadAsset = React.useCallback( /*#__PURE__*/function () {
|
|
2049
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(assetId) {
|
|
2050
|
+
var asset;
|
|
2051
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
2052
|
+
while (1) {
|
|
2053
|
+
switch (_context3.prev = _context3.next) {
|
|
2054
|
+
case 0:
|
|
2055
|
+
_context3.prev = 0;
|
|
2056
|
+
_context3.next = 3;
|
|
2057
|
+
return cmaClient.asset.get({
|
|
2058
|
+
spaceId: spaceId,
|
|
2059
|
+
environmentId: environmentId,
|
|
2060
|
+
assetId: assetId
|
|
2061
|
+
});
|
|
2062
|
+
|
|
2063
|
+
case 3:
|
|
2064
|
+
asset = _context3.sent;
|
|
2065
|
+
dispatch({
|
|
2066
|
+
type: 'set_asset',
|
|
2067
|
+
id: assetId,
|
|
2068
|
+
asset: asset
|
|
2069
|
+
});
|
|
2070
|
+
return _context3.abrupt("return", asset);
|
|
2071
|
+
|
|
2072
|
+
case 8:
|
|
2073
|
+
_context3.prev = 8;
|
|
2074
|
+
_context3.t0 = _context3["catch"](0);
|
|
2075
|
+
dispatch({
|
|
2076
|
+
type: 'set_asset_failed',
|
|
2077
|
+
id: assetId
|
|
2078
|
+
});
|
|
2079
|
+
return _context3.abrupt("return");
|
|
2080
|
+
|
|
2081
|
+
case 12:
|
|
2082
|
+
case "end":
|
|
2083
|
+
return _context3.stop();
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
}, _callee3, null, [[0, 8]]);
|
|
2087
|
+
}));
|
|
2088
|
+
|
|
2089
|
+
return function (_x3) {
|
|
2090
|
+
return _ref4.apply(this, arguments);
|
|
2091
|
+
};
|
|
2092
|
+
}(), [cmaClient, spaceId, environmentId]);
|
|
2093
|
+
var getAsset = React.useCallback( /*#__PURE__*/function () {
|
|
2094
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(assetId) {
|
|
2095
|
+
var cachedAsset;
|
|
2096
|
+
return runtime_1.wrap(function _callee4$(_context4) {
|
|
2097
|
+
while (1) {
|
|
2098
|
+
switch (_context4.prev = _context4.next) {
|
|
2099
|
+
case 0:
|
|
2100
|
+
cachedAsset = state.assets[assetId];
|
|
2101
|
+
|
|
2102
|
+
if (!isNotNil(cachedAsset)) {
|
|
2103
|
+
_context4.next = 3;
|
|
2104
|
+
break;
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
return _context4.abrupt("return", cachedAsset);
|
|
2108
|
+
|
|
2109
|
+
case 3:
|
|
2110
|
+
return _context4.abrupt("return", loadAsset(assetId));
|
|
2111
|
+
|
|
2112
|
+
case 4:
|
|
2113
|
+
case "end":
|
|
2114
|
+
return _context4.stop();
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
}, _callee4);
|
|
2118
|
+
}));
|
|
2119
|
+
|
|
2120
|
+
return function (_x4) {
|
|
2121
|
+
return _ref5.apply(this, arguments);
|
|
2122
|
+
};
|
|
2123
|
+
}(), [loadAsset, state.assets]);
|
|
2124
|
+
var loadContentfulEntry = React.useCallback( /*#__PURE__*/function () {
|
|
2125
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(urn) {
|
|
2126
|
+
var _locales$items$find;
|
|
2127
|
+
|
|
2128
|
+
var resourceId, _resourceId$split, spaceId, entryId, environmentId, _yield$Promise$all, space, entry, contentTypeId, _yield$Promise$all2, contentType, locales, defaultLocaleCode;
|
|
2129
|
+
|
|
2130
|
+
return runtime_1.wrap(function _callee5$(_context5) {
|
|
2131
|
+
while (1) {
|
|
2132
|
+
switch (_context5.prev = _context5.next) {
|
|
2133
|
+
case 0:
|
|
2134
|
+
resourceId = urn.split(':', 6)[5];
|
|
2135
|
+
_resourceId$split = resourceId.split('/'), spaceId = _resourceId$split[1], entryId = _resourceId$split[3];
|
|
2136
|
+
environmentId = 'master';
|
|
2137
|
+
_context5.t0 = Promise;
|
|
2138
|
+
_context5.next = 6;
|
|
2139
|
+
return cmaClient.space.get({
|
|
2140
|
+
spaceId: spaceId
|
|
2141
|
+
});
|
|
2142
|
+
|
|
2143
|
+
case 6:
|
|
2144
|
+
_context5.t1 = _context5.sent;
|
|
2145
|
+
_context5.next = 9;
|
|
2146
|
+
return cmaClient.entry.get({
|
|
2147
|
+
spaceId: spaceId,
|
|
2148
|
+
environmentId: environmentId,
|
|
2149
|
+
entryId: entryId
|
|
2150
|
+
});
|
|
2151
|
+
|
|
2152
|
+
case 9:
|
|
2153
|
+
_context5.t2 = _context5.sent;
|
|
2154
|
+
_context5.t3 = [_context5.t1, _context5.t2];
|
|
2155
|
+
_context5.next = 13;
|
|
2156
|
+
return _context5.t0.all.call(_context5.t0, _context5.t3);
|
|
2157
|
+
|
|
2158
|
+
case 13:
|
|
2159
|
+
_yield$Promise$all = _context5.sent;
|
|
2160
|
+
space = _yield$Promise$all[0];
|
|
2161
|
+
entry = _yield$Promise$all[1];
|
|
2162
|
+
contentTypeId = entry.sys.contentType.sys.id;
|
|
2163
|
+
_context5.t4 = Promise;
|
|
2164
|
+
_context5.next = 20;
|
|
2165
|
+
return cmaClient.contentType.get({
|
|
2166
|
+
contentTypeId: contentTypeId,
|
|
2167
|
+
spaceId: spaceId,
|
|
2168
|
+
environmentId: environmentId
|
|
2169
|
+
});
|
|
2170
|
+
|
|
2171
|
+
case 20:
|
|
2172
|
+
_context5.t5 = _context5.sent;
|
|
2173
|
+
_context5.next = 23;
|
|
2174
|
+
return cmaClient.locale.getMany({
|
|
2175
|
+
spaceId: spaceId,
|
|
2176
|
+
environmentId: environmentId,
|
|
2177
|
+
query: {
|
|
2178
|
+
limit: 100
|
|
2179
|
+
}
|
|
2180
|
+
});
|
|
1940
2181
|
|
|
1941
|
-
|
|
1942
|
-
|
|
2182
|
+
case 23:
|
|
2183
|
+
_context5.t6 = _context5.sent;
|
|
2184
|
+
_context5.t7 = [_context5.t5, _context5.t6];
|
|
2185
|
+
_context5.next = 27;
|
|
2186
|
+
return _context5.t4.all.call(_context5.t4, _context5.t7);
|
|
2187
|
+
|
|
2188
|
+
case 27:
|
|
2189
|
+
_yield$Promise$all2 = _context5.sent;
|
|
2190
|
+
contentType = _yield$Promise$all2[0];
|
|
2191
|
+
locales = _yield$Promise$all2[1];
|
|
2192
|
+
defaultLocaleCode = (_locales$items$find = locales.items.find(function (locale) {
|
|
2193
|
+
return locale["default"];
|
|
2194
|
+
})) == null ? void 0 : _locales$items$find.code;
|
|
2195
|
+
return _context5.abrupt("return", {
|
|
2196
|
+
resource: entry,
|
|
2197
|
+
defaultLocaleCode: defaultLocaleCode,
|
|
2198
|
+
space: space,
|
|
2199
|
+
contentType: contentType
|
|
2200
|
+
});
|
|
2201
|
+
|
|
2202
|
+
case 32:
|
|
2203
|
+
case "end":
|
|
2204
|
+
return _context5.stop();
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
}, _callee5);
|
|
2208
|
+
}));
|
|
2209
|
+
|
|
2210
|
+
return function (_x5) {
|
|
2211
|
+
return _ref6.apply(this, arguments);
|
|
2212
|
+
};
|
|
2213
|
+
}(), [cmaClient]);
|
|
2214
|
+
var getResource = React.useCallback( /*#__PURE__*/function () {
|
|
2215
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(resourceType, urn) {
|
|
2216
|
+
var cachedResource, resourceInfo;
|
|
2217
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
2218
|
+
while (1) {
|
|
2219
|
+
switch (_context6.prev = _context6.next) {
|
|
2220
|
+
case 0:
|
|
2221
|
+
cachedResource = state.resources[resourceType + "." + urn];
|
|
2222
|
+
|
|
2223
|
+
if (!isNotNil(cachedResource)) {
|
|
2224
|
+
_context6.next = 3;
|
|
2225
|
+
break;
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
return _context6.abrupt("return", cachedResource);
|
|
2229
|
+
|
|
2230
|
+
case 3:
|
|
2231
|
+
_context6.prev = 3;
|
|
2232
|
+
|
|
2233
|
+
if (!(resourceType === 'Contentful:Entry')) {
|
|
2234
|
+
_context6.next = 8;
|
|
2235
|
+
break;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
_context6.next = 7;
|
|
2239
|
+
return loadContentfulEntry(urn);
|
|
2240
|
+
|
|
2241
|
+
case 7:
|
|
2242
|
+
resourceInfo = _context6.sent;
|
|
2243
|
+
|
|
2244
|
+
case 8:
|
|
2245
|
+
dispatch({
|
|
2246
|
+
type: 'set_resource',
|
|
2247
|
+
resourceType: resourceType,
|
|
2248
|
+
urn: urn,
|
|
2249
|
+
resourceInfo: resourceInfo
|
|
2250
|
+
});
|
|
2251
|
+
return _context6.abrupt("return", resourceInfo);
|
|
2252
|
+
|
|
2253
|
+
case 12:
|
|
2254
|
+
_context6.prev = 12;
|
|
2255
|
+
_context6.t0 = _context6["catch"](3);
|
|
2256
|
+
dispatch({
|
|
2257
|
+
type: 'set_resource_failed',
|
|
2258
|
+
resourceType: resourceType,
|
|
2259
|
+
urn: urn
|
|
2260
|
+
});
|
|
2261
|
+
return _context6.abrupt("return");
|
|
2262
|
+
|
|
2263
|
+
case 16:
|
|
2264
|
+
case "end":
|
|
2265
|
+
return _context6.stop();
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
}, _callee6, null, [[3, 12]]);
|
|
2269
|
+
}));
|
|
2270
|
+
|
|
2271
|
+
return function (_x6, _x7) {
|
|
2272
|
+
return _ref7.apply(this, arguments);
|
|
2273
|
+
};
|
|
2274
|
+
}(), [loadContentfulEntry, state.resources]);
|
|
1943
2275
|
React.useEffect(function () {
|
|
1944
2276
|
// @ts-expect-error
|
|
1945
2277
|
if (typeof props.sdk.space.onEntityChanged !== 'undefined') {
|
|
1946
2278
|
// @ts-expect-error
|
|
1947
2279
|
var onEntityChanged = props.sdk.space.onEntityChanged;
|
|
1948
2280
|
var listeners = [];
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
2281
|
+
|
|
2282
|
+
var _loop = function _loop() {
|
|
2283
|
+
var _step$value = _step.value,
|
|
2284
|
+
id = _step$value[0];
|
|
2285
|
+
listeners.push(onEntityChanged('Entry', id, function (entry) {
|
|
2286
|
+
return dispatch({
|
|
2287
|
+
type: 'set_entry',
|
|
2288
|
+
id: id,
|
|
2289
|
+
entry: entry
|
|
2290
|
+
});
|
|
2291
|
+
}));
|
|
2292
|
+
};
|
|
2293
|
+
|
|
2294
|
+
for (var _iterator = _createForOfIteratorHelperLoose(nonNilResources(state.entries)), _step; !(_step = _iterator()).done;) {
|
|
2295
|
+
_loop();
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
var _loop2 = function _loop2() {
|
|
2299
|
+
var _step2$value = _step2.value,
|
|
2300
|
+
id = _step2$value[0];
|
|
2301
|
+
listeners.push(onEntityChanged('Asset', id, function (asset) {
|
|
2302
|
+
return dispatch({
|
|
2303
|
+
type: 'set_asset',
|
|
2304
|
+
id: id,
|
|
2305
|
+
asset: asset
|
|
2306
|
+
});
|
|
2307
|
+
}));
|
|
2308
|
+
};
|
|
2309
|
+
|
|
2310
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(nonNilResources(state.assets)), _step2; !(_step2 = _iterator2()).done;) {
|
|
2311
|
+
_loop2();
|
|
2312
|
+
}
|
|
2313
|
+
|
|
1971
2314
|
return function () {
|
|
1972
2315
|
return listeners.forEach(function (off) {
|
|
1973
2316
|
return off();
|
|
@@ -1975,29 +2318,46 @@ function useEntitiesStore(props) {
|
|
|
1975
2318
|
};
|
|
1976
2319
|
}
|
|
1977
2320
|
|
|
1978
|
-
return props.sdk.navigator.onSlideInNavigation(function (
|
|
1979
|
-
var oldSlideLevel =
|
|
1980
|
-
newSlideLevel =
|
|
2321
|
+
return props.sdk.navigator.onSlideInNavigation(function (_ref8) {
|
|
2322
|
+
var oldSlideLevel = _ref8.oldSlideLevel,
|
|
2323
|
+
newSlideLevel = _ref8.newSlideLevel;
|
|
1981
2324
|
|
|
1982
2325
|
if (oldSlideLevel > newSlideLevel) {
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
}
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
2326
|
+
for (var _iterator3 = _createForOfIteratorHelperLoose(nonNilResources(state.entries)), _step3; !(_step3 = _iterator3()).done;) {
|
|
2327
|
+
var _step3$value = _step3.value,
|
|
2328
|
+
id = _step3$value[0];
|
|
2329
|
+
loadEntry(id);
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
for (var _iterator4 = _createForOfIteratorHelperLoose(nonNilResources(state.assets)), _step4; !(_step4 = _iterator4()).done;) {
|
|
2333
|
+
var _step4$value = _step4.value,
|
|
2334
|
+
_id = _step4$value[0];
|
|
2335
|
+
loadAsset(_id);
|
|
2336
|
+
}
|
|
1993
2337
|
}
|
|
1994
2338
|
}); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
1995
2339
|
}, [props.sdk, state.assets, state.entries]);
|
|
1996
|
-
return
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2340
|
+
return React.useMemo(function () {
|
|
2341
|
+
return {
|
|
2342
|
+
/**
|
|
2343
|
+
* @deprecated use `getEntry` instead
|
|
2344
|
+
*/
|
|
2345
|
+
getOrLoadEntry: getEntry,
|
|
2346
|
+
|
|
2347
|
+
/**
|
|
2348
|
+
* @deprecated use `getAsset` instead
|
|
2349
|
+
*/
|
|
2350
|
+
getOrLoadAsset: getAsset,
|
|
2351
|
+
getResource: getResource,
|
|
2352
|
+
getEntry: getEntry,
|
|
2353
|
+
getAsset: getAsset,
|
|
2354
|
+
loadEntityScheduledActions: loadEntityScheduledActions,
|
|
2355
|
+
entries: state.entries,
|
|
2356
|
+
assets: state.assets,
|
|
2357
|
+
scheduledActions: state.scheduledActions,
|
|
2358
|
+
resources: state.resources
|
|
2359
|
+
};
|
|
2360
|
+
}, [getResource, getEntry, getAsset, loadEntityScheduledActions, state.entries, state.assets, state.scheduledActions, state.resources]);
|
|
2001
2361
|
}
|
|
2002
2362
|
|
|
2003
2363
|
var _constate = /*#__PURE__*/constate(useEntitiesStore),
|
|
@@ -2454,11 +2814,40 @@ SingleReferenceEditor.defaultProps = {
|
|
|
2454
2814
|
hasCardRemoveActions: true
|
|
2455
2815
|
};
|
|
2456
2816
|
|
|
2817
|
+
var styles$1 = {
|
|
2818
|
+
spaceIcon: /*#__PURE__*/emotion.css({
|
|
2819
|
+
flexShrink: 0,
|
|
2820
|
+
fill: tokens.purple600
|
|
2821
|
+
}),
|
|
2822
|
+
spaceName: /*#__PURE__*/emotion.css({
|
|
2823
|
+
color: tokens.gray700,
|
|
2824
|
+
fontSize: tokens.fontSizeS,
|
|
2825
|
+
fontWeight: tokens.fontWeightDemiBold
|
|
2826
|
+
})
|
|
2827
|
+
};
|
|
2828
|
+
function SpaceName(props) {
|
|
2829
|
+
return React.createElement(f36Components.Tooltip, {
|
|
2830
|
+
placement: "top",
|
|
2831
|
+
as: "div",
|
|
2832
|
+
content: "Space"
|
|
2833
|
+
}, React.createElement(f36Components.Flex, {
|
|
2834
|
+
alignItems: "center",
|
|
2835
|
+
gap: "spacingXs",
|
|
2836
|
+
marginRight: "spacingS"
|
|
2837
|
+
}, React.createElement(f36Icons.FolderOpenTrimmedIcon, {
|
|
2838
|
+
className: styles$1.spaceIcon,
|
|
2839
|
+
size: "tiny",
|
|
2840
|
+
"aria-label": "Source space"
|
|
2841
|
+
}), React.createElement(f36Components.Text, {
|
|
2842
|
+
className: styles$1.spaceName
|
|
2843
|
+
}, props.spaceName)));
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2457
2846
|
var getEntryTitle = fieldEditorShared.entityHelpers.getEntryTitle,
|
|
2458
2847
|
getEntityDescription = fieldEditorShared.entityHelpers.getEntityDescription,
|
|
2459
2848
|
getEntryStatus = fieldEditorShared.entityHelpers.getEntryStatus,
|
|
2460
2849
|
getEntryImage = fieldEditorShared.entityHelpers.getEntryImage;
|
|
2461
|
-
var styles$
|
|
2850
|
+
var styles$2 = {
|
|
2462
2851
|
scheduleIcon: /*#__PURE__*/emotion.css({
|
|
2463
2852
|
marginRight: tokens.spacing2Xs
|
|
2464
2853
|
})
|
|
@@ -2523,12 +2912,17 @@ function WrappedEntryCard(props) {
|
|
|
2523
2912
|
size: props.size,
|
|
2524
2913
|
isSelected: props.isSelected,
|
|
2525
2914
|
status: status,
|
|
2526
|
-
|
|
2915
|
+
style: props.spaceName ? {
|
|
2916
|
+
backgroundColor: tokens.gray100
|
|
2917
|
+
} : undefined,
|
|
2918
|
+
icon: props.spaceName ? React.createElement(SpaceName, {
|
|
2919
|
+
spaceName: props.spaceName
|
|
2920
|
+
}) : React.createElement(ScheduledIconWithTooltip, {
|
|
2527
2921
|
getEntityScheduledActions: props.getEntityScheduledActions,
|
|
2528
2922
|
entityType: "Entry",
|
|
2529
2923
|
entityId: props.entry.sys.id
|
|
2530
2924
|
}, React.createElement(f36Icons.ClockIcon, {
|
|
2531
|
-
className: styles$
|
|
2925
|
+
className: styles$2.scheduleIcon,
|
|
2532
2926
|
size: "small",
|
|
2533
2927
|
variant: "muted",
|
|
2534
2928
|
testId: "schedule-icon"
|
|
@@ -2633,13 +3027,13 @@ function _openEntry() {
|
|
|
2633
3027
|
|
|
2634
3028
|
function FetchingWrappedEntryCard(props) {
|
|
2635
3029
|
var _useEntities = useEntities(),
|
|
2636
|
-
|
|
2637
|
-
|
|
3030
|
+
getEntry = _useEntities.getEntry,
|
|
3031
|
+
getAsset = _useEntities.getAsset,
|
|
2638
3032
|
loadEntityScheduledActions = _useEntities.loadEntityScheduledActions,
|
|
2639
3033
|
entries = _useEntities.entries;
|
|
2640
3034
|
|
|
2641
3035
|
React.useEffect(function () {
|
|
2642
|
-
|
|
3036
|
+
getEntry(props.entryId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2643
3037
|
}, [props.entryId]);
|
|
2644
3038
|
var size = props.viewType === 'link' ? 'small' : 'default';
|
|
2645
3039
|
var entry = entries[props.entryId];
|
|
@@ -2754,7 +3148,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2754
3148
|
hasCardEditActions: hasCardEditActions,
|
|
2755
3149
|
hasCardMoveActions: hasCardMoveActions,
|
|
2756
3150
|
hasCardRemoveActions: hasCardRemoveActions,
|
|
2757
|
-
getAsset:
|
|
3151
|
+
getAsset: getAsset,
|
|
2758
3152
|
getEntityScheduledActions: loadEntityScheduledActions,
|
|
2759
3153
|
entry: (props == null ? void 0 : props.entity) || sharedCardProps.entity,
|
|
2760
3154
|
entryUrl: (props == null ? void 0 : props.entityUrl) || sharedCardProps.entityUrl
|
|
@@ -2903,12 +3297,13 @@ MultipleReferenceEditor.defaultProps = {
|
|
|
2903
3297
|
hasCardEditActions: true
|
|
2904
3298
|
};
|
|
2905
3299
|
|
|
2906
|
-
var styles$
|
|
2907
|
-
|
|
3300
|
+
var styles$3 = {
|
|
3301
|
+
container: /*#__PURE__*/emotion.css({
|
|
2908
3302
|
position: 'relative'
|
|
2909
3303
|
}),
|
|
2910
3304
|
item: /*#__PURE__*/emotion.css({
|
|
2911
|
-
marginBottom: tokens.spacingM
|
|
3305
|
+
marginBottom: tokens.spacingM,
|
|
3306
|
+
marginRight: tokens.spacingM
|
|
2912
3307
|
})
|
|
2913
3308
|
};
|
|
2914
3309
|
|
|
@@ -2921,48 +3316,59 @@ var DragHandle = function DragHandle(props) {
|
|
|
2921
3316
|
|
|
2922
3317
|
var SortableLink = /*#__PURE__*/reactSortableHoc.SortableElement(function (props) {
|
|
2923
3318
|
return React__default.createElement("div", {
|
|
2924
|
-
className: styles$
|
|
3319
|
+
className: styles$3.item
|
|
2925
3320
|
}, props.children);
|
|
2926
3321
|
});
|
|
2927
|
-
var
|
|
2928
|
-
var lastIndex = props.items.length - 1;
|
|
3322
|
+
var SortableLinkListInternal = /*#__PURE__*/reactSortableHoc.SortableContainer(function (props) {
|
|
2929
3323
|
return React__default.createElement("div", {
|
|
2930
|
-
className: styles$
|
|
3324
|
+
className: emotion.cx(styles$3.container, props.className)
|
|
2931
3325
|
}, props.items.map(function (item, index) {
|
|
3326
|
+
var _item$sys$id;
|
|
3327
|
+
|
|
2932
3328
|
return React__default.createElement(SortableLink, {
|
|
2933
3329
|
disabled: props.isDisabled,
|
|
2934
|
-
key: item.sys.id + "-" + index,
|
|
3330
|
+
key: ((_item$sys$id = item.sys.id) != null ? _item$sys$id : item.sys.urn) + "-" + index,
|
|
2935
3331
|
index: index
|
|
2936
|
-
},
|
|
2937
|
-
|
|
3332
|
+
}, props.children(_extends({}, props, {
|
|
3333
|
+
item: item,
|
|
2938
3334
|
index: index,
|
|
2939
|
-
|
|
2940
|
-
isDisabled: props.isDisabled,
|
|
2941
|
-
entryId: item.sys.id,
|
|
2942
|
-
onRemove: function onRemove() {
|
|
2943
|
-
props.setValue(props.items.filter(function (_value, i) {
|
|
2944
|
-
return i !== index;
|
|
2945
|
-
}));
|
|
2946
|
-
},
|
|
2947
|
-
onMoveTop: index !== 0 ? function () {
|
|
2948
|
-
return props.onMove(index, 0);
|
|
2949
|
-
} : undefined,
|
|
2950
|
-
onMoveBottom: index !== lastIndex ? function () {
|
|
2951
|
-
return props.onMove(index, lastIndex);
|
|
2952
|
-
} : undefined,
|
|
2953
|
-
renderDragHandle: props.isDisabled ? undefined : DragHandle
|
|
3335
|
+
DragHandle: props.isDisabled ? undefined : DragHandle
|
|
2954
3336
|
})));
|
|
2955
3337
|
}));
|
|
2956
|
-
});
|
|
3338
|
+
}); // HOC does not support generics, so we mimic it via additional component
|
|
3339
|
+
|
|
3340
|
+
function SortableLinkList(props) {
|
|
3341
|
+
return React__default.createElement(SortableLinkListInternal, Object.assign({}, props, {
|
|
3342
|
+
children: props.children
|
|
3343
|
+
}));
|
|
3344
|
+
}
|
|
2957
3345
|
|
|
2958
3346
|
function MultipleEntryReferenceEditor(props) {
|
|
2959
3347
|
return React.createElement(MultipleReferenceEditor, Object.assign({}, props, {
|
|
2960
3348
|
entityType: "Entry"
|
|
2961
3349
|
}), function (childrenProps) {
|
|
2962
|
-
return React.createElement(SortableLinkList, Object.assign({},
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
3350
|
+
return React.createElement(SortableLinkList, Object.assign({}, childrenProps), function (props) {
|
|
3351
|
+
var lastIndex = props.items.length - 1;
|
|
3352
|
+
return React.createElement(FetchingWrappedEntryCard, Object.assign({}, props, {
|
|
3353
|
+
key: props.item.sys.id + "-" + props.index,
|
|
3354
|
+
index: props.index,
|
|
3355
|
+
allContentTypes: childrenProps.allContentTypes,
|
|
3356
|
+
isDisabled: props.isDisabled,
|
|
3357
|
+
entryId: props.item.sys.id,
|
|
3358
|
+
onRemove: function onRemove() {
|
|
3359
|
+
childrenProps.setValue(props.items.filter(function (_value, i) {
|
|
3360
|
+
return i !== props.index;
|
|
3361
|
+
}));
|
|
3362
|
+
},
|
|
3363
|
+
onMoveTop: props.index !== 0 ? function () {
|
|
3364
|
+
return childrenProps.onMove(props.index, 0);
|
|
3365
|
+
} : undefined,
|
|
3366
|
+
onMoveBottom: props.index !== lastIndex ? function () {
|
|
3367
|
+
return childrenProps.onMove(props.index, lastIndex);
|
|
3368
|
+
} : undefined,
|
|
3369
|
+
renderDragHandle: props.DragHandle
|
|
3370
|
+
}));
|
|
3371
|
+
});
|
|
2966
3372
|
});
|
|
2967
3373
|
}
|
|
2968
3374
|
|
|
@@ -3036,7 +3442,7 @@ var groupToIconMap = {
|
|
|
3036
3442
|
code: 'code',
|
|
3037
3443
|
markup: 'markup'
|
|
3038
3444
|
};
|
|
3039
|
-
var styles$
|
|
3445
|
+
var styles$4 = {
|
|
3040
3446
|
scheduleIcon: /*#__PURE__*/emotion.css({
|
|
3041
3447
|
marginRight: tokens.spacing2Xs
|
|
3042
3448
|
})
|
|
@@ -3098,7 +3504,7 @@ var WrappedAssetCard = function WrappedAssetCard(props) {
|
|
|
3098
3504
|
entityType: "Asset",
|
|
3099
3505
|
entityId: props.asset.sys.id
|
|
3100
3506
|
}, React__default.createElement(f36Icons.ClockIcon, {
|
|
3101
|
-
className: styles$
|
|
3507
|
+
className: styles$4.scheduleIcon,
|
|
3102
3508
|
size: "small",
|
|
3103
3509
|
variant: "muted",
|
|
3104
3510
|
testId: "schedule-icon"
|
|
@@ -3129,7 +3535,7 @@ var WrappedAssetCard = function WrappedAssetCard(props) {
|
|
|
3129
3535
|
};
|
|
3130
3536
|
WrappedAssetCard.defaultProps = defaultProps$1;
|
|
3131
3537
|
|
|
3132
|
-
var styles$
|
|
3538
|
+
var styles$5 = {
|
|
3133
3539
|
scheduleIcon: /*#__PURE__*/emotion.css({
|
|
3134
3540
|
marginRight: tokens.spacing2Xs
|
|
3135
3541
|
})
|
|
@@ -3173,7 +3579,7 @@ var WrappedAssetLink = function WrappedAssetLink(props) {
|
|
|
3173
3579
|
entityType: "Asset",
|
|
3174
3580
|
entityId: props.asset.sys.id
|
|
3175
3581
|
}, React__default.createElement(f36Icons.ClockIcon, {
|
|
3176
|
-
className: styles$
|
|
3582
|
+
className: styles$5.scheduleIcon,
|
|
3177
3583
|
size: "small",
|
|
3178
3584
|
variant: "muted",
|
|
3179
3585
|
testId: "schedule-icon"
|
|
@@ -3199,12 +3605,12 @@ var WrappedAssetLink = function WrappedAssetLink(props) {
|
|
|
3199
3605
|
|
|
3200
3606
|
function FetchingWrappedAssetCard(props) {
|
|
3201
3607
|
var _useEntities = useEntities(),
|
|
3202
|
-
|
|
3608
|
+
getAsset = _useEntities.getAsset,
|
|
3203
3609
|
loadEntityScheduledActions = _useEntities.loadEntityScheduledActions,
|
|
3204
3610
|
assets = _useEntities.assets;
|
|
3205
3611
|
|
|
3206
3612
|
React.useEffect(function () {
|
|
3207
|
-
|
|
3613
|
+
getAsset(props.assetId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
3208
3614
|
}, [props.assetId]);
|
|
3209
3615
|
var asset = assets[props.assetId];
|
|
3210
3616
|
var entityKey = asset === 'failed' ? 'failed' : asset === undefined ? 'undefined' : ":" + asset.sys.id + ":" + asset.sys.version;
|
|
@@ -3372,63 +3778,34 @@ SingleMediaEditor.defaultProps = {
|
|
|
3372
3778
|
isInitiallyDisabled: true
|
|
3373
3779
|
};
|
|
3374
3780
|
|
|
3375
|
-
var styles$
|
|
3376
|
-
|
|
3781
|
+
var styles$6 = {
|
|
3782
|
+
gridContainer: /*#__PURE__*/emotion.css({
|
|
3377
3783
|
position: 'relative',
|
|
3378
3784
|
display: 'flex',
|
|
3379
3785
|
flexWrap: 'wrap'
|
|
3380
|
-
}),
|
|
3381
|
-
container: /*#__PURE__*/emotion.css({
|
|
3382
|
-
position: 'relative'
|
|
3383
|
-
}),
|
|
3384
|
-
item: /*#__PURE__*/emotion.css({
|
|
3385
|
-
marginBottom: tokens.spacingM,
|
|
3386
|
-
marginRight: tokens.spacingM
|
|
3387
3786
|
})
|
|
3388
3787
|
};
|
|
3389
|
-
|
|
3390
|
-
var DragHandle$1 = function DragHandle(props) {
|
|
3391
|
-
var SortableDragHandle = reactSortableHoc.SortableHandle(function () {
|
|
3392
|
-
return props.drag;
|
|
3393
|
-
});
|
|
3394
|
-
return React__default.createElement(SortableDragHandle, null);
|
|
3395
|
-
};
|
|
3396
|
-
|
|
3397
|
-
var SortableLink$1 = /*#__PURE__*/reactSortableHoc.SortableElement(function (props) {
|
|
3398
|
-
return React__default.createElement("div", {
|
|
3399
|
-
className: styles$5.item
|
|
3400
|
-
}, props.children);
|
|
3401
|
-
});
|
|
3402
|
-
var SortableLinkList$1 = /*#__PURE__*/reactSortableHoc.SortableContainer(function (props) {
|
|
3403
|
-
return React__default.createElement("div", {
|
|
3404
|
-
className: props.viewType === 'card' ? styles$5.gridContainter : styles$5.container
|
|
3405
|
-
}, props.items.map(function (item, index) {
|
|
3406
|
-
return React__default.createElement(SortableLink$1, {
|
|
3407
|
-
disabled: props.isDisabled,
|
|
3408
|
-
key: item.sys.id + "-" + index,
|
|
3409
|
-
index: index
|
|
3410
|
-
}, React__default.createElement(FetchingWrappedAssetCard, Object.assign({}, props, {
|
|
3411
|
-
sdk: props.sdk,
|
|
3412
|
-
key: item.sys.id + "-" + index,
|
|
3413
|
-
assetId: item.sys.id,
|
|
3414
|
-
onRemove: function onRemove() {
|
|
3415
|
-
props.setValue(props.items.filter(function (_value, i) {
|
|
3416
|
-
return i !== index;
|
|
3417
|
-
}));
|
|
3418
|
-
},
|
|
3419
|
-
renderDragHandle: props.isDisabled ? undefined : DragHandle$1
|
|
3420
|
-
})));
|
|
3421
|
-
}));
|
|
3422
|
-
});
|
|
3423
|
-
|
|
3424
3788
|
function MultipleMediaEditor(props) {
|
|
3425
3789
|
return React.createElement(MultipleReferenceEditor, Object.assign({}, props, {
|
|
3426
3790
|
entityType: "Asset"
|
|
3427
3791
|
}), function (childrenProps) {
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3792
|
+
var _cx;
|
|
3793
|
+
|
|
3794
|
+
return React.createElement(SortableLinkList, Object.assign({}, childrenProps, {
|
|
3795
|
+
className: emotion.cx((_cx = {}, _cx[styles$6.gridContainer] = childrenProps.viewType === 'card', _cx)),
|
|
3796
|
+
axis: childrenProps.viewType === 'card' ? 'xy' : 'y'
|
|
3797
|
+
}), function (props) {
|
|
3798
|
+
return React.createElement(FetchingWrappedAssetCard, Object.assign({}, props, {
|
|
3799
|
+
key: props.item.sys.id + "-" + props.index,
|
|
3800
|
+
assetId: props.item.sys.id,
|
|
3801
|
+
onRemove: function onRemove() {
|
|
3802
|
+
childrenProps.setValue(props.items.filter(function (_value, i) {
|
|
3803
|
+
return i !== props.index;
|
|
3804
|
+
}));
|
|
3805
|
+
},
|
|
3806
|
+
renderDragHandle: props.DragHandle
|
|
3807
|
+
}));
|
|
3808
|
+
});
|
|
3432
3809
|
});
|
|
3433
3810
|
}
|
|
3434
3811
|
MultipleMediaEditor.defaultProps = {
|
|
@@ -3446,6 +3823,7 @@ exports.MultipleMediaEditor = MultipleMediaEditor;
|
|
|
3446
3823
|
exports.ScheduledIconWithTooltip = ScheduledIconWithTooltip;
|
|
3447
3824
|
exports.SingleEntryReferenceEditor = SingleEntryReferenceEditor;
|
|
3448
3825
|
exports.SingleMediaEditor = SingleMediaEditor;
|
|
3826
|
+
exports.SortableLinkList = SortableLinkList;
|
|
3449
3827
|
exports.WrappedAssetCard = WrappedAssetCard;
|
|
3450
3828
|
exports.WrappedEntryCard = WrappedEntryCard;
|
|
3451
3829
|
exports.getScheduleTooltipContent = getScheduleTooltipContent;
|