@vidispine/vdt-react 0.15.0-pre.8 → 21.4.0-pre.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +965 -66
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +969 -63
- package/dist/index.js.map +1 -1
- package/package.json +10 -8
package/dist/index.js
CHANGED
|
@@ -8,9 +8,49 @@ var React = require('react');
|
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
9
|
var vdtApi = require('@vidispine/vdt-api');
|
|
10
10
|
var vdtJs = require('@vidispine/vdt-js');
|
|
11
|
+
var lzString = require('lz-string');
|
|
11
12
|
var useDeepCompareEffect = _interopDefault(require('use-deep-compare-effect'));
|
|
13
|
+
var debounce = _interopDefault(require('lodash.debounce'));
|
|
12
14
|
var reactCookie = require('react-cookie');
|
|
13
15
|
|
|
16
|
+
function ownKeys(object, enumerableOnly) {
|
|
17
|
+
var keys = Object.keys(object);
|
|
18
|
+
|
|
19
|
+
if (Object.getOwnPropertySymbols) {
|
|
20
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
21
|
+
|
|
22
|
+
if (enumerableOnly) {
|
|
23
|
+
symbols = symbols.filter(function (sym) {
|
|
24
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
keys.push.apply(keys, symbols);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return keys;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _objectSpread2(target) {
|
|
35
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
36
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
37
|
+
|
|
38
|
+
if (i % 2) {
|
|
39
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
40
|
+
_defineProperty(target, key, source[key]);
|
|
41
|
+
});
|
|
42
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
43
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
44
|
+
} else {
|
|
45
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
46
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
|
|
14
54
|
function _typeof(obj) {
|
|
15
55
|
"@babel/helpers - typeof";
|
|
16
56
|
|
|
@@ -118,40 +158,6 @@ function _extends() {
|
|
|
118
158
|
return _extends.apply(this, arguments);
|
|
119
159
|
}
|
|
120
160
|
|
|
121
|
-
function ownKeys(object, enumerableOnly) {
|
|
122
|
-
var keys = Object.keys(object);
|
|
123
|
-
|
|
124
|
-
if (Object.getOwnPropertySymbols) {
|
|
125
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
126
|
-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
127
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
128
|
-
});
|
|
129
|
-
keys.push.apply(keys, symbols);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return keys;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function _objectSpread2(target) {
|
|
136
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
137
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
138
|
-
|
|
139
|
-
if (i % 2) {
|
|
140
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
141
|
-
_defineProperty(target, key, source[key]);
|
|
142
|
-
});
|
|
143
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
144
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
145
|
-
} else {
|
|
146
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
147
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return target;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
161
|
function _inherits(subClass, superClass) {
|
|
156
162
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
157
163
|
throw new TypeError("Super expression must either be null or a function");
|
|
@@ -189,7 +195,7 @@ function _isNativeReflectConstruct() {
|
|
|
189
195
|
if (typeof Proxy === "function") return true;
|
|
190
196
|
|
|
191
197
|
try {
|
|
192
|
-
|
|
198
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
193
199
|
return true;
|
|
194
200
|
} catch (e) {
|
|
195
201
|
return false;
|
|
@@ -243,6 +249,8 @@ function _assertThisInitialized(self) {
|
|
|
243
249
|
function _possibleConstructorReturn(self, call) {
|
|
244
250
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
245
251
|
return call;
|
|
252
|
+
} else if (call !== void 0) {
|
|
253
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
246
254
|
}
|
|
247
255
|
|
|
248
256
|
return _assertThisInitialized(self);
|
|
@@ -284,18 +292,21 @@ function _arrayWithHoles(arr) {
|
|
|
284
292
|
}
|
|
285
293
|
|
|
286
294
|
function _iterableToArray(iter) {
|
|
287
|
-
if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
295
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
288
296
|
}
|
|
289
297
|
|
|
290
298
|
function _iterableToArrayLimit(arr, i) {
|
|
291
|
-
|
|
299
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
300
|
+
|
|
301
|
+
if (_i == null) return;
|
|
292
302
|
var _arr = [];
|
|
293
303
|
var _n = true;
|
|
294
304
|
var _d = false;
|
|
295
|
-
|
|
305
|
+
|
|
306
|
+
var _s, _e;
|
|
296
307
|
|
|
297
308
|
try {
|
|
298
|
-
for (
|
|
309
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
299
310
|
_arr.push(_s.value);
|
|
300
311
|
|
|
301
312
|
if (i && _arr.length === i) break;
|
|
@@ -477,6 +488,7 @@ function useApi(apiHandler, initialState, responseRef) {
|
|
|
477
488
|
}, state);
|
|
478
489
|
}
|
|
479
490
|
|
|
491
|
+
var _excluded = ["queryParams", "matrixParams", "itemSearchDocument", "rowsPerPage", "page"];
|
|
480
492
|
var CHANGE_PAGE = 'CHANGE_PAGE';
|
|
481
493
|
var CHANGE_ROWS = 'CHANGE_ROWS';
|
|
482
494
|
var CHANGE_SORT = 'CHANGE_SORT';
|
|
@@ -520,7 +532,7 @@ var setInitialDefaultState = function setInitialDefaultState() {
|
|
|
520
532
|
rowsPerPage = _ref$rowsPerPage === void 0 ? 10 : _ref$rowsPerPage,
|
|
521
533
|
_ref$page = _ref.page,
|
|
522
534
|
page = _ref$page === void 0 ? 0 : _ref$page,
|
|
523
|
-
state = _objectWithoutProperties(_ref,
|
|
535
|
+
state = _objectWithoutProperties(_ref, _excluded);
|
|
524
536
|
|
|
525
537
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
526
538
|
queryParams: _objectSpread2({
|
|
@@ -930,9 +942,11 @@ function useAutocomplete(initialState) {
|
|
|
930
942
|
setAutocompleteDoc = _React$useState2[1];
|
|
931
943
|
|
|
932
944
|
var setAutocompleteField = React__default.useCallback(function (field) {
|
|
945
|
+
var text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
933
946
|
setAutocompleteDoc(function (state) {
|
|
934
947
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
935
|
-
field: field
|
|
948
|
+
field: field,
|
|
949
|
+
text: text
|
|
936
950
|
});
|
|
937
951
|
});
|
|
938
952
|
}, []);
|
|
@@ -1105,6 +1119,7 @@ function useThumbnailScrub() {
|
|
|
1105
1119
|
};
|
|
1106
1120
|
}
|
|
1107
1121
|
|
|
1122
|
+
var _excluded$1 = ["type"];
|
|
1108
1123
|
var CHANGE_PAGE$1 = 'CHANGE_PAGE';
|
|
1109
1124
|
var CHANGE_ROWS$1 = 'CHANGE_ROWS';
|
|
1110
1125
|
var CHANGE_SORT$1 = 'CHANGE_SORT';
|
|
@@ -1145,7 +1160,7 @@ var setInitialDefaultState$2 = function setInitialDefaultState() {
|
|
|
1145
1160
|
|
|
1146
1161
|
var searchReducer$1 = function searchReducer(state, action) {
|
|
1147
1162
|
var type = action.type,
|
|
1148
|
-
rest = _objectWithoutProperties(action,
|
|
1163
|
+
rest = _objectWithoutProperties(action, _excluded$1);
|
|
1149
1164
|
|
|
1150
1165
|
switch (type) {
|
|
1151
1166
|
case ACTION_TYPE$1.CHANGE_PAGE:
|
|
@@ -1445,7 +1460,6 @@ var useLocalStorage = function useLocalStorage(localStorageKey, defaultValue) {
|
|
|
1445
1460
|
return [value, setValue, getValue];
|
|
1446
1461
|
};
|
|
1447
1462
|
|
|
1448
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
1449
1463
|
function uuidv4() {
|
|
1450
1464
|
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) {
|
|
1451
1465
|
return (// eslint-disable-next-line
|
|
@@ -1454,16 +1468,16 @@ function uuidv4() {
|
|
|
1454
1468
|
});
|
|
1455
1469
|
}
|
|
1456
1470
|
function b64EncodeUnicode(str) {
|
|
1457
|
-
return
|
|
1458
|
-
return String.fromCharCode("0x".concat(p1));
|
|
1459
|
-
}));
|
|
1471
|
+
return lzString.compressToEncodedURIComponent(str);
|
|
1460
1472
|
}
|
|
1461
1473
|
function b64DecodeUnicode(str) {
|
|
1462
|
-
|
|
1474
|
+
// fallback for old base64 encoded links
|
|
1475
|
+
return str.slice(-1) === '=' ? decodeURIComponent(atob(str).split('').map(function (c) {
|
|
1463
1476
|
return "%".concat("00".concat(c.charCodeAt(0).toString(16)).slice(-2));
|
|
1464
|
-
}).join(''));
|
|
1477
|
+
}).join('')) : lzString.decompressFromEncodedURIComponent(str);
|
|
1465
1478
|
}
|
|
1466
1479
|
|
|
1480
|
+
var _excluded$2 = ["onUploadFile", "initialMetadata"];
|
|
1467
1481
|
var DEFAULT_AUDIO_SHAPETAGS = ['__mp3_160k'];
|
|
1468
1482
|
var DEFAULT_VIDEO_SHAPETAGS = ['__mp4'];
|
|
1469
1483
|
var DEFAULT_IMAGE_SHAPETAGS = ['__png'];
|
|
@@ -1590,7 +1604,7 @@ function useUploadFiles(_ref3) {
|
|
|
1590
1604
|
handleUploadFile = _ref3$onUploadFile === void 0 ? onUploadFile : _ref3$onUploadFile,
|
|
1591
1605
|
_ref3$initialMetadata = _ref3.initialMetadata,
|
|
1592
1606
|
initialMetadata = _ref3$initialMetadata === void 0 ? {} : _ref3$initialMetadata,
|
|
1593
|
-
props = _objectWithoutProperties(_ref3,
|
|
1607
|
+
props = _objectWithoutProperties(_ref3, _excluded$2);
|
|
1594
1608
|
|
|
1595
1609
|
var _React$useState = React__default.useState([]),
|
|
1596
1610
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -1752,6 +1766,9 @@ function useUpdateQueryState(_ref) {
|
|
|
1752
1766
|
}, [onSearchStateChange, state]);
|
|
1753
1767
|
}
|
|
1754
1768
|
|
|
1769
|
+
var _excluded$3 = ["accessId"],
|
|
1770
|
+
_excluded2 = ["accessControlDocument"];
|
|
1771
|
+
|
|
1755
1772
|
var useEntityAccess = function useEntityAccess(_ref) {
|
|
1756
1773
|
var entityId = _ref.entityId,
|
|
1757
1774
|
entityType = _ref.entityType;
|
|
@@ -1772,7 +1789,7 @@ var useEntityAccess = function useEntityAccess(_ref) {
|
|
|
1772
1789
|
[entityId, entityType]);
|
|
1773
1790
|
var onRemove = React.useCallback(function (_ref2) {
|
|
1774
1791
|
var accessId = _ref2.accessId,
|
|
1775
|
-
props = _objectWithoutProperties(_ref2,
|
|
1792
|
+
props = _objectWithoutProperties(_ref2, _excluded$3);
|
|
1776
1793
|
|
|
1777
1794
|
return vdtApi.access.removeEntityAccess(_objectSpread2({
|
|
1778
1795
|
accessId: accessId,
|
|
@@ -1782,7 +1799,7 @@ var useEntityAccess = function useEntityAccess(_ref) {
|
|
|
1782
1799
|
}, [entityId, entityType]);
|
|
1783
1800
|
var onAdd = React.useCallback(function (_ref3) {
|
|
1784
1801
|
var accessControlDocument = _ref3.accessControlDocument,
|
|
1785
|
-
props = _objectWithoutProperties(_ref3,
|
|
1802
|
+
props = _objectWithoutProperties(_ref3, _excluded2);
|
|
1786
1803
|
|
|
1787
1804
|
return vdtApi.access.createEntityAccess(_objectSpread2({
|
|
1788
1805
|
entityType: entityType,
|
|
@@ -1799,6 +1816,11 @@ var useEntityAccess = function useEntityAccess(_ref) {
|
|
|
1799
1816
|
};
|
|
1800
1817
|
};
|
|
1801
1818
|
|
|
1819
|
+
var _excluded$4 = ["name"],
|
|
1820
|
+
_excluded2$1 = ["label"],
|
|
1821
|
+
_excluded3 = ["name", "field", "group"],
|
|
1822
|
+
_excluded4 = ["label"];
|
|
1823
|
+
|
|
1802
1824
|
var getValueFromData = function getValueFromData() {
|
|
1803
1825
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
1804
1826
|
_ref$data = _ref.data,
|
|
@@ -1895,18 +1917,19 @@ var useAddMetadataFieldAttributes = function useAddMetadataFieldAttributes(_ref5
|
|
|
1895
1917
|
var fieldsAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1896
1918
|
return fieldsArray.map(function (_ref6) {
|
|
1897
1919
|
var name = _ref6.name,
|
|
1898
|
-
overrides = _objectWithoutProperties(_ref6,
|
|
1920
|
+
overrides = _objectWithoutProperties(_ref6, _excluded$4);
|
|
1899
1921
|
|
|
1900
1922
|
var fieldAttributes = fieldsAttributes[name] || {};
|
|
1901
1923
|
|
|
1902
1924
|
var _getDataAttributes = getDataAttributes(fieldAttributes, fieldDataToInclude.split(',')),
|
|
1903
1925
|
label = _getDataAttributes.label,
|
|
1904
|
-
dataAttributes = _objectWithoutProperties(_getDataAttributes,
|
|
1926
|
+
dataAttributes = _objectWithoutProperties(_getDataAttributes, _excluded2$1);
|
|
1905
1927
|
|
|
1906
1928
|
return _objectSpread2(_objectSpread2({
|
|
1907
1929
|
name: name,
|
|
1908
1930
|
label: label || name,
|
|
1909
1931
|
type: fieldAttributes.type,
|
|
1932
|
+
constraint: fieldAttributes.constraint,
|
|
1910
1933
|
options: getOptions(fieldAttributes)
|
|
1911
1934
|
}, dataAttributes), overrides);
|
|
1912
1935
|
});
|
|
@@ -1920,7 +1943,7 @@ var useAddMetadataFieldAttributes = function useAddMetadataFieldAttributes(_ref5
|
|
|
1920
1943
|
var name = _ref7.name,
|
|
1921
1944
|
field = _ref7.field,
|
|
1922
1945
|
group = _ref7.group,
|
|
1923
|
-
overrides = _objectWithoutProperties(_ref7,
|
|
1946
|
+
overrides = _objectWithoutProperties(_ref7, _excluded3);
|
|
1924
1947
|
|
|
1925
1948
|
var groupAttributes = groupsAttributes[name] || {};
|
|
1926
1949
|
var childFields = field || groupAttributes && groupAttributes.field;
|
|
@@ -1928,7 +1951,7 @@ var useAddMetadataFieldAttributes = function useAddMetadataFieldAttributes(_ref5
|
|
|
1928
1951
|
|
|
1929
1952
|
var _getDataAttributes2 = getDataAttributes(groupAttributes, groupDataToInclude.split(',')),
|
|
1930
1953
|
label = _getDataAttributes2.label,
|
|
1931
|
-
dataAttributes = _objectWithoutProperties(_getDataAttributes2,
|
|
1954
|
+
dataAttributes = _objectWithoutProperties(_getDataAttributes2, _excluded4);
|
|
1932
1955
|
|
|
1933
1956
|
return _objectSpread2(_objectSpread2({
|
|
1934
1957
|
name: name,
|
|
@@ -2128,6 +2151,8 @@ var useAddMetadataFieldAttributes = function useAddMetadataFieldAttributes(_ref5
|
|
|
2128
2151
|
};
|
|
2129
2152
|
};
|
|
2130
2153
|
|
|
2154
|
+
var _excluded$5 = ["setItemSearchDocument"];
|
|
2155
|
+
|
|
2131
2156
|
var UPDATE_FREQUENCY = 1000; // Prevents access controls set on the library (i.e. saved search) from cascading down to items
|
|
2132
2157
|
|
|
2133
2158
|
var UPDATE_MODE = 'TRANSIENT';
|
|
@@ -2264,7 +2289,7 @@ function useSavedSearch(_ref11) {
|
|
|
2264
2289
|
}));
|
|
2265
2290
|
|
|
2266
2291
|
var _setItemSearchDocument = searchProps.setItemSearchDocument,
|
|
2267
|
-
props = _objectWithoutProperties(searchProps,
|
|
2292
|
+
props = _objectWithoutProperties(searchProps, _excluded$5);
|
|
2268
2293
|
|
|
2269
2294
|
return {
|
|
2270
2295
|
onSaveSearch: saveSearchWithMarker,
|
|
@@ -2395,6 +2420,8 @@ function useGetCollection$1(_ref) {
|
|
|
2395
2420
|
};
|
|
2396
2421
|
}
|
|
2397
2422
|
|
|
2423
|
+
var _excluded$6 = ["request", "data"];
|
|
2424
|
+
|
|
2398
2425
|
var useGetEntity = function useGetEntity(_ref) {
|
|
2399
2426
|
var _objectSpread3;
|
|
2400
2427
|
|
|
@@ -2430,7 +2457,7 @@ var useGetEntity = function useGetEntity(_ref) {
|
|
|
2430
2457
|
var _useApi = useApi(entityApi),
|
|
2431
2458
|
request = _useApi.request,
|
|
2432
2459
|
data = _useApi.data,
|
|
2433
|
-
apiProps = _objectWithoutProperties(_useApi,
|
|
2460
|
+
apiProps = _objectWithoutProperties(_useApi, _excluded$6);
|
|
2434
2461
|
|
|
2435
2462
|
var onGetEntity = React__default.useCallback(function (props) {
|
|
2436
2463
|
return request(_objectSpread2(_defineProperty({}, entityTypeId, entityId), props));
|
|
@@ -3193,6 +3220,872 @@ var useCollectionAutoPlay = function useCollectionAutoPlay(_ref) {
|
|
|
3193
3220
|
};
|
|
3194
3221
|
};
|
|
3195
3222
|
|
|
3223
|
+
function useHoverScrub() {
|
|
3224
|
+
var srcList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3225
|
+
var customOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3226
|
+
var durationSeconds = arguments.length > 2 ? arguments[2] : undefined;
|
|
3227
|
+
|
|
3228
|
+
var _React$useState = React__default.useState(0),
|
|
3229
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3230
|
+
scrubPosition = _React$useState2[0],
|
|
3231
|
+
setScrubPosition = _React$useState2[1];
|
|
3232
|
+
|
|
3233
|
+
var _React$useState3 = React__default.useState(0),
|
|
3234
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
3235
|
+
thumbnailIndex = _React$useState4[0],
|
|
3236
|
+
setThumbnailIndex = _React$useState4[1];
|
|
3237
|
+
|
|
3238
|
+
var _React$useState5 = React__default.useState(false),
|
|
3239
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
3240
|
+
showScrub = _React$useState6[0],
|
|
3241
|
+
setShowScrub = _React$useState6[1];
|
|
3242
|
+
|
|
3243
|
+
var _React$useState7 = React__default.useState([]),
|
|
3244
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
3245
|
+
thumbnailTimeCodeArray = _React$useState8[0],
|
|
3246
|
+
setThumbnailTimeCodeArray = _React$useState8[1];
|
|
3247
|
+
|
|
3248
|
+
var _React$useState9 = React__default.useState(),
|
|
3249
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
3250
|
+
thumbnailTimeCode = _React$useState10[0],
|
|
3251
|
+
setThumbnailTimeCode = _React$useState10[1];
|
|
3252
|
+
|
|
3253
|
+
var _React$useState11 = React__default.useState(0),
|
|
3254
|
+
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
3255
|
+
thumbnailWidth = _React$useState12[0],
|
|
3256
|
+
setThumbnailWidth = _React$useState12[1];
|
|
3257
|
+
|
|
3258
|
+
var getInnerLeft = React.useCallback(function (e) {
|
|
3259
|
+
var left = e.clientX - e.currentTarget.offsetLeft - customOffset;
|
|
3260
|
+
|
|
3261
|
+
if (left < 0) {
|
|
3262
|
+
return 0;
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3265
|
+
if (left > e.currentTarget.offsetWidth) {
|
|
3266
|
+
return e.currentTarget.offsetWidth;
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3269
|
+
return left;
|
|
3270
|
+
}, [customOffset]);
|
|
3271
|
+
|
|
3272
|
+
var onMouseMove = function onMouseMove(e) {
|
|
3273
|
+
if (durationSeconds) {
|
|
3274
|
+
var innerLeft = getInnerLeft(e);
|
|
3275
|
+
setScrubPosition(innerLeft - 1);
|
|
3276
|
+
setThumbnailWidth(e.currentTarget.offsetWidth);
|
|
3277
|
+
var pxToSec = e.currentTarget.offsetWidth / +durationSeconds;
|
|
3278
|
+
var pxAsTimeCode = innerLeft / pxToSec;
|
|
3279
|
+
setThumbnailTimeCode(vdtJs.formatSeconds(pxAsTimeCode));
|
|
3280
|
+
|
|
3281
|
+
for (var index = 0; index < thumbnailTimeCodeArray.length; index += 1) {
|
|
3282
|
+
var timeCode = thumbnailTimeCodeArray[index];
|
|
3283
|
+
var nextTimeCode = thumbnailTimeCodeArray[index + 1] || thumbnailTimeCodeArray[thumbnailTimeCodeArray.length - 1];
|
|
3284
|
+
|
|
3285
|
+
if (timeCode && nextTimeCode && timeCode.toSeconds().toFixed(0) <= pxAsTimeCode && nextTimeCode.toSeconds().toFixed(0) >= pxAsTimeCode) {
|
|
3286
|
+
setThumbnailIndex(index);
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
};
|
|
3291
|
+
|
|
3292
|
+
useDeepCompareEffect(function () {
|
|
3293
|
+
var timeCodes = [];
|
|
3294
|
+
|
|
3295
|
+
for (var index = 0; index < srcList.length; index += 1) {
|
|
3296
|
+
var uri = srcList[index];
|
|
3297
|
+
|
|
3298
|
+
if (uri && typeof uri === 'string') {
|
|
3299
|
+
try {
|
|
3300
|
+
var timeCodeFromURI = uri.split('version')[1].split('/')[1].split('?')[0];
|
|
3301
|
+
var timecodeText = vdtJs.formatTimeCodeText(timeCodeFromURI);
|
|
3302
|
+
timeCodes.push(timecodeText);
|
|
3303
|
+
} catch (error) {
|
|
3304
|
+
return;
|
|
3305
|
+
}
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
setThumbnailTimeCodeArray(timeCodes);
|
|
3310
|
+
}, [srcList]);
|
|
3311
|
+
|
|
3312
|
+
var handleShowScrub = function handleShowScrub(value) {
|
|
3313
|
+
return function () {
|
|
3314
|
+
if (durationSeconds > 0) {
|
|
3315
|
+
setShowScrub(value);
|
|
3316
|
+
}
|
|
3317
|
+
};
|
|
3318
|
+
};
|
|
3319
|
+
|
|
3320
|
+
return {
|
|
3321
|
+
thumbnailIndex: thumbnailIndex,
|
|
3322
|
+
thumbnailTimeCode: thumbnailTimeCode,
|
|
3323
|
+
thumbnailWidth: thumbnailWidth,
|
|
3324
|
+
showScrub: showScrub,
|
|
3325
|
+
scrubPosition: scrubPosition,
|
|
3326
|
+
handleShowScrub: handleShowScrub,
|
|
3327
|
+
onMouseMove: onMouseMove
|
|
3328
|
+
};
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3331
|
+
function useDocSearchAutocomplete(_ref) {
|
|
3332
|
+
var searchDoc = _ref.searchDoc,
|
|
3333
|
+
queryParams = _ref.queryParams,
|
|
3334
|
+
debounceTime = _ref.debounceTime,
|
|
3335
|
+
_ref$suggestionSettin = _ref.suggestionSettings,
|
|
3336
|
+
suggestionSettings = _ref$suggestionSettin === void 0 ? {
|
|
3337
|
+
maximumSuggestions: 10,
|
|
3338
|
+
accuracy: 1
|
|
3339
|
+
} : _ref$suggestionSettin,
|
|
3340
|
+
_ref$triggerLength = _ref.triggerLength,
|
|
3341
|
+
triggerLength = _ref$triggerLength === void 0 ? 1 : _ref$triggerLength,
|
|
3342
|
+
_ref$apiCall = _ref.apiCall,
|
|
3343
|
+
apiCall = _ref$apiCall === void 0 ? vdtApi.item.searchItem : _ref$apiCall;
|
|
3344
|
+
|
|
3345
|
+
var _React$useState = React__default.useState(''),
|
|
3346
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3347
|
+
textValue = _React$useState2[0],
|
|
3348
|
+
setTextValue = _React$useState2[1];
|
|
3349
|
+
|
|
3350
|
+
var handleAutocompleteChange = React__default.useRef(debounce(setTextValue, debounceTime)).current;
|
|
3351
|
+
|
|
3352
|
+
var _useApi = useApi(apiCall),
|
|
3353
|
+
_useApi$data = _useApi.data;
|
|
3354
|
+
|
|
3355
|
+
_useApi$data = _useApi$data === void 0 ? {} : _useApi$data;
|
|
3356
|
+
var _useApi$data$autocomp = _useApi$data.autocomplete,
|
|
3357
|
+
autocomplete = _useApi$data$autocomp === void 0 ? [] : _useApi$data$autocomp,
|
|
3358
|
+
request = _useApi.request;
|
|
3359
|
+
|
|
3360
|
+
var _ref2 = autocomplete[0] || {},
|
|
3361
|
+
_ref2$suggestion = _ref2.suggestion,
|
|
3362
|
+
suggestion = _ref2$suggestion === void 0 ? [] : _ref2$suggestion;
|
|
3363
|
+
|
|
3364
|
+
useDeepCompareEffect(function () {
|
|
3365
|
+
if (searchDoc && textValue && textValue.length >= triggerLength) {
|
|
3366
|
+
request({
|
|
3367
|
+
body: _objectSpread2(_objectSpread2({}, searchDoc), {}, {
|
|
3368
|
+
suggestion: suggestionSettings,
|
|
3369
|
+
autocomplete: [{
|
|
3370
|
+
text: textValue
|
|
3371
|
+
}],
|
|
3372
|
+
text: [{
|
|
3373
|
+
value: textValue
|
|
3374
|
+
}]
|
|
3375
|
+
}),
|
|
3376
|
+
queryParams: _objectSpread2({
|
|
3377
|
+
count: false,
|
|
3378
|
+
number: 0
|
|
3379
|
+
}, queryParams)
|
|
3380
|
+
});
|
|
3381
|
+
}
|
|
3382
|
+
}, [request, textValue, queryParams, triggerLength]);
|
|
3383
|
+
return {
|
|
3384
|
+
suggestion: suggestion,
|
|
3385
|
+
handleAutocompleteChange: handleAutocompleteChange
|
|
3386
|
+
};
|
|
3387
|
+
}
|
|
3388
|
+
|
|
3389
|
+
function useGetFieldMetadataDataset() {
|
|
3390
|
+
var _useApi = useApi(vdtApi.metadatafield.getMetadataFieldAllowedValues),
|
|
3391
|
+
request = _useApi.request,
|
|
3392
|
+
_useApi$data = _useApi.data;
|
|
3393
|
+
|
|
3394
|
+
_useApi$data = _useApi$data === void 0 ? {} : _useApi$data;
|
|
3395
|
+
var _useApi$data$value = _useApi$data.value,
|
|
3396
|
+
constraintValueListType = _useApi$data$value === void 0 ? [] : _useApi$data$value,
|
|
3397
|
+
isLoading = _useApi.isLoading;
|
|
3398
|
+
|
|
3399
|
+
var getMetadataDataset = function getMetadataDataset(datasetField, parentValue, parentField) {
|
|
3400
|
+
var metadataFieldValueConstraintListDocument = {
|
|
3401
|
+
constraint: parentValue ? [{
|
|
3402
|
+
field: parentField,
|
|
3403
|
+
value: parentValue
|
|
3404
|
+
}] : []
|
|
3405
|
+
};
|
|
3406
|
+
|
|
3407
|
+
if (datasetField) {
|
|
3408
|
+
request({
|
|
3409
|
+
fieldName: datasetField,
|
|
3410
|
+
metadataFieldValueConstraintListDocument: metadataFieldValueConstraintListDocument
|
|
3411
|
+
});
|
|
3412
|
+
}
|
|
3413
|
+
};
|
|
3414
|
+
|
|
3415
|
+
return {
|
|
3416
|
+
getMetadataDataset: getMetadataDataset,
|
|
3417
|
+
dataset: constraintValueListType,
|
|
3418
|
+
isLoading: isLoading
|
|
3419
|
+
};
|
|
3420
|
+
}
|
|
3421
|
+
|
|
3422
|
+
var UPDATE_FREQUENCY$1 = 1000; // Prevents access controls set on the library (i.e. saved search) from cascading down to items
|
|
3423
|
+
|
|
3424
|
+
var UPDATE_MODE$1 = 'TRANSIENT';
|
|
3425
|
+
|
|
3426
|
+
var getCollectionTitle = function getCollectionTitle(fields) {
|
|
3427
|
+
return fields.find(function (field) {
|
|
3428
|
+
return field.name === 'title';
|
|
3429
|
+
}).value[0].value;
|
|
3430
|
+
};
|
|
3431
|
+
|
|
3432
|
+
function useGetSavedSearchFolders(_ref) {
|
|
3433
|
+
var _ref$childFolders = _ref.childFolders,
|
|
3434
|
+
childFolders = _ref$childFolders === void 0 ? [] : _ref$childFolders,
|
|
3435
|
+
_ref$queryParams = _ref.queryParams,
|
|
3436
|
+
queryParams = _ref$queryParams === void 0 ? {
|
|
3437
|
+
content: ['metadata']
|
|
3438
|
+
} : _ref$queryParams,
|
|
3439
|
+
_ref$markerProps = _ref.markerProps,
|
|
3440
|
+
markerProps = _ref$markerProps === void 0 ? {
|
|
3441
|
+
markerValue: 'savedSearch',
|
|
3442
|
+
markerField: 'eidr_referentType'
|
|
3443
|
+
} : _ref$markerProps,
|
|
3444
|
+
expand = _ref.expand;
|
|
3445
|
+
|
|
3446
|
+
var _React$useState = React__default.useState(childFolders),
|
|
3447
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3448
|
+
currentFolders = _React$useState2[0],
|
|
3449
|
+
setCurrentFolders = _React$useState2[1];
|
|
3450
|
+
|
|
3451
|
+
var _React$useState3 = React__default.useState([]),
|
|
3452
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
3453
|
+
subFolders = _React$useState4[0],
|
|
3454
|
+
setSubFolders = _React$useState4[1];
|
|
3455
|
+
|
|
3456
|
+
var _React$useState5 = React__default.useState(),
|
|
3457
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
3458
|
+
errors = _React$useState6[0],
|
|
3459
|
+
setErrors = _React$useState6[1];
|
|
3460
|
+
|
|
3461
|
+
var getSubFolders = React__default.useCallback(function () {
|
|
3462
|
+
Promise.all(currentFolders.map( /*#__PURE__*/function () {
|
|
3463
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(id) {
|
|
3464
|
+
var _yield$CollectionApi$, _yield$CollectionApi$2, content, _yield$CollectionApi$3, metadata, field;
|
|
3465
|
+
|
|
3466
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3467
|
+
while (1) {
|
|
3468
|
+
switch (_context.prev = _context.next) {
|
|
3469
|
+
case 0:
|
|
3470
|
+
_context.next = 2;
|
|
3471
|
+
return vdtApi.collection.getCollection({
|
|
3472
|
+
collectionId: id,
|
|
3473
|
+
queryParams: queryParams
|
|
3474
|
+
});
|
|
3475
|
+
|
|
3476
|
+
case 2:
|
|
3477
|
+
_yield$CollectionApi$ = _context.sent;
|
|
3478
|
+
_yield$CollectionApi$2 = _yield$CollectionApi$.data;
|
|
3479
|
+
content = _yield$CollectionApi$2.content;
|
|
3480
|
+
_yield$CollectionApi$3 = _yield$CollectionApi$2.metadata;
|
|
3481
|
+
metadata = _yield$CollectionApi$3 === void 0 ? {} : _yield$CollectionApi$3;
|
|
3482
|
+
field = metadata.timespan[0].field;
|
|
3483
|
+
|
|
3484
|
+
if (!(content && content[0].type === 'library')) {
|
|
3485
|
+
_context.next = 10;
|
|
3486
|
+
break;
|
|
3487
|
+
}
|
|
3488
|
+
|
|
3489
|
+
return _context.abrupt("return", {
|
|
3490
|
+
id: id,
|
|
3491
|
+
libraryId: content[0].id,
|
|
3492
|
+
title: getCollectionTitle(field),
|
|
3493
|
+
type: 'query',
|
|
3494
|
+
metadata: metadata
|
|
3495
|
+
});
|
|
3496
|
+
|
|
3497
|
+
case 10:
|
|
3498
|
+
return _context.abrupt("return", {
|
|
3499
|
+
id: id,
|
|
3500
|
+
title: getCollectionTitle(field),
|
|
3501
|
+
subFolders: content && content.map(function (c) {
|
|
3502
|
+
return c.id;
|
|
3503
|
+
}),
|
|
3504
|
+
type: 'folder',
|
|
3505
|
+
metadata: metadata
|
|
3506
|
+
});
|
|
3507
|
+
|
|
3508
|
+
case 11:
|
|
3509
|
+
case "end":
|
|
3510
|
+
return _context.stop();
|
|
3511
|
+
}
|
|
3512
|
+
}
|
|
3513
|
+
}, _callee);
|
|
3514
|
+
}));
|
|
3515
|
+
|
|
3516
|
+
return function (_x) {
|
|
3517
|
+
return _ref2.apply(this, arguments);
|
|
3518
|
+
};
|
|
3519
|
+
}())).then(function (newFolders) {
|
|
3520
|
+
setSubFolders(function (prevState) {
|
|
3521
|
+
return [].concat(_toConsumableArray(newFolders), _toConsumableArray(prevState));
|
|
3522
|
+
});
|
|
3523
|
+
})["catch"](function (error) {
|
|
3524
|
+
setErrors(error);
|
|
3525
|
+
});
|
|
3526
|
+
}, [currentFolders, queryParams]);
|
|
3527
|
+
|
|
3528
|
+
var createFolder = function createFolder(parentId, type, title, callback) {
|
|
3529
|
+
vdtApi.collection.createCollection({
|
|
3530
|
+
collectionDocument: {
|
|
3531
|
+
metadata: vdtJs.createMetadataType({
|
|
3532
|
+
saved_search_folder: type,
|
|
3533
|
+
title: title
|
|
3534
|
+
})
|
|
3535
|
+
}
|
|
3536
|
+
}).then(function (_ref3) {
|
|
3537
|
+
var id = _ref3.data.id;
|
|
3538
|
+
|
|
3539
|
+
if (parentId) {
|
|
3540
|
+
return vdtApi.collection.updateCollection({
|
|
3541
|
+
collectionId: parentId,
|
|
3542
|
+
collectionDocument: {
|
|
3543
|
+
content: [{
|
|
3544
|
+
id: id,
|
|
3545
|
+
mode: 'add',
|
|
3546
|
+
type: 'collection'
|
|
3547
|
+
}]
|
|
3548
|
+
}
|
|
3549
|
+
}).then(function (_ref4) {
|
|
3550
|
+
var content = _ref4.data.content;
|
|
3551
|
+
|
|
3552
|
+
if (content) {
|
|
3553
|
+
setCurrentFolders(content.filter(function (collection) {
|
|
3554
|
+
return collection.id === id;
|
|
3555
|
+
}).map(function (collection) {
|
|
3556
|
+
return collection.id;
|
|
3557
|
+
}));
|
|
3558
|
+
if (callback) callback();
|
|
3559
|
+
}
|
|
3560
|
+
})["catch"](function (error) {
|
|
3561
|
+
setErrors(error);
|
|
3562
|
+
});
|
|
3563
|
+
}
|
|
3564
|
+
|
|
3565
|
+
return null;
|
|
3566
|
+
})["catch"](function (error) {
|
|
3567
|
+
setErrors(error);
|
|
3568
|
+
});
|
|
3569
|
+
};
|
|
3570
|
+
|
|
3571
|
+
var saveSearch = function saveSearch(folderId, title, itemSearchDocument, callback) {
|
|
3572
|
+
try {
|
|
3573
|
+
vdtApi.item.searchItem({
|
|
3574
|
+
queryParams: {
|
|
3575
|
+
result: 'library',
|
|
3576
|
+
updateMode: UPDATE_MODE$1,
|
|
3577
|
+
updateFrequency: UPDATE_FREQUENCY$1
|
|
3578
|
+
},
|
|
3579
|
+
itemSearchDocument: itemSearchDocument
|
|
3580
|
+
}).then(function (_ref5) {
|
|
3581
|
+
var _createMetadataType;
|
|
3582
|
+
|
|
3583
|
+
var library = _ref5.data.library;
|
|
3584
|
+
return vdtApi.collection.createCollection({
|
|
3585
|
+
collectionDocument: {
|
|
3586
|
+
metadata: vdtJs.createMetadataType((_createMetadataType = {}, _defineProperty(_createMetadataType, markerProps.markerField, markerProps.markerValue), _defineProperty(_createMetadataType, "title", title), _createMetadataType)),
|
|
3587
|
+
content: [{
|
|
3588
|
+
id: library,
|
|
3589
|
+
type: 'library'
|
|
3590
|
+
}]
|
|
3591
|
+
}
|
|
3592
|
+
});
|
|
3593
|
+
}).then(function (_ref6) {
|
|
3594
|
+
var id = _ref6.data.id;
|
|
3595
|
+
return vdtApi.collection.updateCollection({
|
|
3596
|
+
collectionId: folderId,
|
|
3597
|
+
collectionDocument: {
|
|
3598
|
+
content: [{
|
|
3599
|
+
id: id,
|
|
3600
|
+
mode: 'add',
|
|
3601
|
+
type: 'collection'
|
|
3602
|
+
}]
|
|
3603
|
+
}
|
|
3604
|
+
}).then(function (_ref7) {
|
|
3605
|
+
var content = _ref7.data.content;
|
|
3606
|
+
|
|
3607
|
+
if (content) {
|
|
3608
|
+
setCurrentFolders(content.filter(function (collection) {
|
|
3609
|
+
return collection.id === id;
|
|
3610
|
+
}).map(function (collection) {
|
|
3611
|
+
return collection.id;
|
|
3612
|
+
}));
|
|
3613
|
+
if (callback) callback();
|
|
3614
|
+
}
|
|
3615
|
+
})["catch"](function (error) {
|
|
3616
|
+
setErrors(error);
|
|
3617
|
+
});
|
|
3618
|
+
})["catch"](function (error) {
|
|
3619
|
+
setErrors(error);
|
|
3620
|
+
});
|
|
3621
|
+
} catch (error) {
|
|
3622
|
+
setErrors(error);
|
|
3623
|
+
}
|
|
3624
|
+
};
|
|
3625
|
+
|
|
3626
|
+
var deleteFolder = function deleteFolder(collectionId) {
|
|
3627
|
+
return vdtApi.collection.removeCollection({
|
|
3628
|
+
collectionId: collectionId
|
|
3629
|
+
})["catch"](function (error) {
|
|
3630
|
+
setErrors(error);
|
|
3631
|
+
});
|
|
3632
|
+
};
|
|
3633
|
+
|
|
3634
|
+
var removeItem = function removeItem(id) {
|
|
3635
|
+
setSubFolders(function (prevState) {
|
|
3636
|
+
return prevState.filter(function (folder) {
|
|
3637
|
+
return folder.id !== id;
|
|
3638
|
+
});
|
|
3639
|
+
});
|
|
3640
|
+
};
|
|
3641
|
+
|
|
3642
|
+
useDeepCompareEffect(function () {
|
|
3643
|
+
if (currentFolders.length > 0 && expand) {
|
|
3644
|
+
getSubFolders();
|
|
3645
|
+
}
|
|
3646
|
+
}, [currentFolders, expand]);
|
|
3647
|
+
React__default.useEffect(function () {
|
|
3648
|
+
if (!expand && typeof expand === 'boolean') {
|
|
3649
|
+
setCurrentFolders(function () {
|
|
3650
|
+
return subFolders.map(function (folder) {
|
|
3651
|
+
return folder.id;
|
|
3652
|
+
});
|
|
3653
|
+
});
|
|
3654
|
+
setSubFolders([]);
|
|
3655
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3656
|
+
|
|
3657
|
+
}, [expand]);
|
|
3658
|
+
return {
|
|
3659
|
+
createFolder: createFolder,
|
|
3660
|
+
saveSearch: saveSearch,
|
|
3661
|
+
getSubFolders: getSubFolders,
|
|
3662
|
+
deleteFolder: deleteFolder,
|
|
3663
|
+
removeItem: removeItem,
|
|
3664
|
+
subFolders: subFolders,
|
|
3665
|
+
setSubFolders: setSubFolders,
|
|
3666
|
+
setCurrentFolders: setCurrentFolders,
|
|
3667
|
+
errors: errors
|
|
3668
|
+
};
|
|
3669
|
+
}
|
|
3670
|
+
|
|
3671
|
+
var useRepresentativeItems = function useRepresentativeItems(_ref) {
|
|
3672
|
+
var collectionId = _ref.collectionId,
|
|
3673
|
+
onError = _ref.onError;
|
|
3674
|
+
|
|
3675
|
+
var _React$useState = React__default.useState([]),
|
|
3676
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3677
|
+
representativeItems = _React$useState2[0],
|
|
3678
|
+
setRepresentativeItems = _React$useState2[1];
|
|
3679
|
+
|
|
3680
|
+
var asyncGetRepresentativeItems = /*#__PURE__*/function () {
|
|
3681
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
3682
|
+
var _yield$CollectionApi$, _yield$CollectionApi$2, metadata, _parseMetadataType, _parseMetadataType$re, newRepresentativeItems;
|
|
3683
|
+
|
|
3684
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3685
|
+
while (1) {
|
|
3686
|
+
switch (_context.prev = _context.next) {
|
|
3687
|
+
case 0:
|
|
3688
|
+
_context.prev = 0;
|
|
3689
|
+
|
|
3690
|
+
if (collectionId) {
|
|
3691
|
+
_context.next = 3;
|
|
3692
|
+
break;
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3695
|
+
throw Error('Missing collectionId');
|
|
3696
|
+
|
|
3697
|
+
case 3:
|
|
3698
|
+
_context.next = 5;
|
|
3699
|
+
return vdtApi.collection.getCollectionMetadata({
|
|
3700
|
+
collectionId: collectionId,
|
|
3701
|
+
queryParams: {
|
|
3702
|
+
content: 'metadata',
|
|
3703
|
+
field: 'representativeItems'
|
|
3704
|
+
}
|
|
3705
|
+
})["catch"](function (error) {
|
|
3706
|
+
if (onError) onError(error);
|
|
3707
|
+
});
|
|
3708
|
+
|
|
3709
|
+
case 5:
|
|
3710
|
+
_yield$CollectionApi$ = _context.sent;
|
|
3711
|
+
_yield$CollectionApi$2 = _yield$CollectionApi$.data;
|
|
3712
|
+
metadata = _yield$CollectionApi$2 === void 0 ? {} : _yield$CollectionApi$2;
|
|
3713
|
+
_parseMetadataType = vdtJs.parseMetadataType(metadata, {
|
|
3714
|
+
flat: true,
|
|
3715
|
+
includeValueAttributes: true
|
|
3716
|
+
}), _parseMetadataType$re = _parseMetadataType.representativeItems, newRepresentativeItems = _parseMetadataType$re === void 0 ? [] : _parseMetadataType$re;
|
|
3717
|
+
setRepresentativeItems(function () {
|
|
3718
|
+
return newRepresentativeItems;
|
|
3719
|
+
});
|
|
3720
|
+
_context.next = 15;
|
|
3721
|
+
break;
|
|
3722
|
+
|
|
3723
|
+
case 12:
|
|
3724
|
+
_context.prev = 12;
|
|
3725
|
+
_context.t0 = _context["catch"](0);
|
|
3726
|
+
if (onError) onError(_context.t0);
|
|
3727
|
+
|
|
3728
|
+
case 15:
|
|
3729
|
+
case "end":
|
|
3730
|
+
return _context.stop();
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
}, _callee, null, [[0, 12]]);
|
|
3734
|
+
}));
|
|
3735
|
+
|
|
3736
|
+
return function asyncGetRepresentativeItems() {
|
|
3737
|
+
return _ref2.apply(this, arguments);
|
|
3738
|
+
};
|
|
3739
|
+
}();
|
|
3740
|
+
|
|
3741
|
+
var onRefresh = asyncGetRepresentativeItems;
|
|
3742
|
+
|
|
3743
|
+
var updateAsRepresentativeItem = /*#__PURE__*/function () {
|
|
3744
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(values) {
|
|
3745
|
+
var metadataDocument, response;
|
|
3746
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
3747
|
+
while (1) {
|
|
3748
|
+
switch (_context2.prev = _context2.next) {
|
|
3749
|
+
case 0:
|
|
3750
|
+
_context2.prev = 0;
|
|
3751
|
+
metadataDocument = vdtJs.createMetadataType({
|
|
3752
|
+
representativeItems: Array.isArray(values) ? values : [values]
|
|
3753
|
+
});
|
|
3754
|
+
_context2.next = 4;
|
|
3755
|
+
return vdtApi.collection.updateCollectionMetadata({
|
|
3756
|
+
collectionId: collectionId,
|
|
3757
|
+
metadataDocument: metadataDocument
|
|
3758
|
+
});
|
|
3759
|
+
|
|
3760
|
+
case 4:
|
|
3761
|
+
response = _context2.sent;
|
|
3762
|
+
onRefresh();
|
|
3763
|
+
return _context2.abrupt("return", response);
|
|
3764
|
+
|
|
3765
|
+
case 9:
|
|
3766
|
+
_context2.prev = 9;
|
|
3767
|
+
_context2.t0 = _context2["catch"](0);
|
|
3768
|
+
if (onError) onError(_context2.t0);
|
|
3769
|
+
return _context2.abrupt("return", undefined);
|
|
3770
|
+
|
|
3771
|
+
case 13:
|
|
3772
|
+
case "end":
|
|
3773
|
+
return _context2.stop();
|
|
3774
|
+
}
|
|
3775
|
+
}
|
|
3776
|
+
}, _callee2, null, [[0, 9]]);
|
|
3777
|
+
}));
|
|
3778
|
+
|
|
3779
|
+
return function updateAsRepresentativeItem(_x) {
|
|
3780
|
+
return _ref3.apply(this, arguments);
|
|
3781
|
+
};
|
|
3782
|
+
}();
|
|
3783
|
+
|
|
3784
|
+
var onAdd = function onAdd(entityId) {
|
|
3785
|
+
return updateAsRepresentativeItem({
|
|
3786
|
+
value: entityId,
|
|
3787
|
+
mode: 'add'
|
|
3788
|
+
});
|
|
3789
|
+
};
|
|
3790
|
+
|
|
3791
|
+
var onRemove = function onRemove(entityId) {
|
|
3792
|
+
try {
|
|
3793
|
+
// Get all (if it has been added multiple times)
|
|
3794
|
+
var entityIdValueUuids = representativeItems.filter(function (i) {
|
|
3795
|
+
return i.value === entityId;
|
|
3796
|
+
}).map(function (i) {
|
|
3797
|
+
return i.uuid;
|
|
3798
|
+
});
|
|
3799
|
+
if (!entityIdValueUuids.length) return undefined;
|
|
3800
|
+
return updateAsRepresentativeItem(entityIdValueUuids.map(function (uuid) {
|
|
3801
|
+
return {
|
|
3802
|
+
uuid: uuid,
|
|
3803
|
+
mode: 'remove'
|
|
3804
|
+
};
|
|
3805
|
+
}));
|
|
3806
|
+
} catch (error) {
|
|
3807
|
+
if (onError) onError(error);
|
|
3808
|
+
return undefined;
|
|
3809
|
+
}
|
|
3810
|
+
};
|
|
3811
|
+
|
|
3812
|
+
React__default.useEffect(function () {
|
|
3813
|
+
onRefresh(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3814
|
+
}, [collectionId]);
|
|
3815
|
+
return {
|
|
3816
|
+
representativeItems: representativeItems,
|
|
3817
|
+
onRefresh: onRefresh,
|
|
3818
|
+
onAdd: onAdd,
|
|
3819
|
+
onRemove: onRemove
|
|
3820
|
+
};
|
|
3821
|
+
};
|
|
3822
|
+
|
|
3823
|
+
function defaultOnGetStorage() {
|
|
3824
|
+
var storageData = vdtApi.storage.listStorage().then(function (response) {
|
|
3825
|
+
var storage = {
|
|
3826
|
+
id: response.data.storage[0].id,
|
|
3827
|
+
uri: response.data.storage[0].method[0].uri
|
|
3828
|
+
};
|
|
3829
|
+
return storage;
|
|
3830
|
+
});
|
|
3831
|
+
return storageData;
|
|
3832
|
+
}
|
|
3833
|
+
|
|
3834
|
+
function defaultOnCreate(list) {
|
|
3835
|
+
return vdtApi.library.createLibrary({
|
|
3836
|
+
itemListDocument: {
|
|
3837
|
+
item: _toConsumableArray(list.item.map(function (_ref) {
|
|
3838
|
+
var id = _ref.id;
|
|
3839
|
+
return {
|
|
3840
|
+
id: id
|
|
3841
|
+
};
|
|
3842
|
+
}))
|
|
3843
|
+
}
|
|
3844
|
+
});
|
|
3845
|
+
}
|
|
3846
|
+
|
|
3847
|
+
function defaultOnList(response, storageInfo, queryParams) {
|
|
3848
|
+
var _queryParams$fileName = queryParams.fileName,
|
|
3849
|
+
fileName = _queryParams$fileName === void 0 ? 'output' : _queryParams$fileName,
|
|
3850
|
+
_queryParams$outputFo = queryParams.outputFormat,
|
|
3851
|
+
outputFormat = _queryParams$outputFo === void 0 ? 'csv' : _queryParams$outputFo;
|
|
3852
|
+
var uri = storageInfo.uri;
|
|
3853
|
+
var _response$data = response.data;
|
|
3854
|
+
_response$data = _response$data === void 0 ? {} : _response$data;
|
|
3855
|
+
var _response$data$uri = _response$data.uri;
|
|
3856
|
+
_response$data$uri = _response$data$uri === void 0 ? [] : _response$data$uri;
|
|
3857
|
+
|
|
3858
|
+
var _response$data$uri2 = _slicedToArray(_response$data$uri, 1),
|
|
3859
|
+
libraryId = _response$data$uri2[0];
|
|
3860
|
+
|
|
3861
|
+
var createNewUri = function createNewUri() {
|
|
3862
|
+
if (uri.includes('s3')) {
|
|
3863
|
+
var _uri$split = uri.split('?region'),
|
|
3864
|
+
_uri$split2 = _slicedToArray(_uri$split, 2),
|
|
3865
|
+
uriBeforeRegion = _uri$split2[0],
|
|
3866
|
+
uriAfterRegion = _uri$split2[1];
|
|
3867
|
+
|
|
3868
|
+
return "".concat(uriBeforeRegion).concat(fileName, ".").concat(outputFormat, "?region").concat(uriAfterRegion);
|
|
3869
|
+
}
|
|
3870
|
+
|
|
3871
|
+
return "".concat(uri).concat(fileName, ".").concat(outputFormat);
|
|
3872
|
+
};
|
|
3873
|
+
|
|
3874
|
+
var newUri = encodeURIComponent(createNewUri());
|
|
3875
|
+
return vdtApi.library.getLibraryBatch({
|
|
3876
|
+
libraryId: libraryId,
|
|
3877
|
+
queryParams: _objectSpread2({
|
|
3878
|
+
destinationUri: newUri
|
|
3879
|
+
}, queryParams)
|
|
3880
|
+
});
|
|
3881
|
+
}
|
|
3882
|
+
|
|
3883
|
+
var SUCCESSFUL_STATES = ['FINISHED', 'FINISHED_WARNING'];
|
|
3884
|
+
var INACTIVE_STATES = ['FINISHED', 'FINISHED_WARNING', 'FAILED_TOTAL', 'ABORTED'];
|
|
3885
|
+
|
|
3886
|
+
function defaultOnGetFile(response, storageInfo, params, onError) {
|
|
3887
|
+
var _response$data2 = response.data;
|
|
3888
|
+
_response$data2 = _response$data2 === void 0 ? {} : _response$data2;
|
|
3889
|
+
var jobId = _response$data2.jobId;
|
|
3890
|
+
var id = storageInfo.id;
|
|
3891
|
+
var _params$fileName = params.fileName,
|
|
3892
|
+
fileName = _params$fileName === void 0 ? 'output' : _params$fileName,
|
|
3893
|
+
_params$outputFormat = params.outputFormat,
|
|
3894
|
+
outputFormat = _params$outputFormat === void 0 ? 'csv' : _params$outputFormat;
|
|
3895
|
+
var filePath = "".concat(fileName, ".").concat(outputFormat);
|
|
3896
|
+
vdtApi.job.getJob({
|
|
3897
|
+
jobId: jobId
|
|
3898
|
+
}).then(function () {
|
|
3899
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
3900
|
+
_ref2$data = _ref2.data;
|
|
3901
|
+
|
|
3902
|
+
_ref2$data = _ref2$data === void 0 ? {} : _ref2$data;
|
|
3903
|
+
var status = _ref2$data.status;
|
|
3904
|
+
|
|
3905
|
+
if (SUCCESSFUL_STATES.includes(status)) {
|
|
3906
|
+
try {
|
|
3907
|
+
vdtApi.file.listFileStorage({
|
|
3908
|
+
storageId: id,
|
|
3909
|
+
queryParams: {
|
|
3910
|
+
path: filePath,
|
|
3911
|
+
methodMetadata: [{
|
|
3912
|
+
key: 'format',
|
|
3913
|
+
value: 'SIGNED-AUTO'
|
|
3914
|
+
}, {
|
|
3915
|
+
key: 'contentDisposition',
|
|
3916
|
+
value: "attachment;+filename=".concat(filePath)
|
|
3917
|
+
}],
|
|
3918
|
+
'noauth-url': true
|
|
3919
|
+
}
|
|
3920
|
+
}).then(function (r) {
|
|
3921
|
+
return window.open(r.data.file[0].uri[0]);
|
|
3922
|
+
});
|
|
3923
|
+
} catch (error) {
|
|
3924
|
+
console.error('Download error:'.concat("\n", error));
|
|
3925
|
+
onError({
|
|
3926
|
+
message: 'Download failed'
|
|
3927
|
+
});
|
|
3928
|
+
}
|
|
3929
|
+
} else if (!INACTIVE_STATES.includes(status)) {
|
|
3930
|
+
setTimeout(function () {
|
|
3931
|
+
defaultOnGetFile(response, storageInfo, params);
|
|
3932
|
+
}, 1000);
|
|
3933
|
+
} else {
|
|
3934
|
+
onError({
|
|
3935
|
+
message: 'Download failed'
|
|
3936
|
+
});
|
|
3937
|
+
}
|
|
3938
|
+
});
|
|
3939
|
+
} // Note: Not needed as a react-hook since doesn't use react,
|
|
3940
|
+
// but this is usually where we put logic functions right now
|
|
3941
|
+
|
|
3942
|
+
|
|
3943
|
+
var useCsvDownload = function useCsvDownload(_ref3) {
|
|
3944
|
+
var itemListType = _ref3.itemListType,
|
|
3945
|
+
queryParams = _ref3.queryParams,
|
|
3946
|
+
onSuccess = _ref3.onSuccess,
|
|
3947
|
+
_ref3$onError = _ref3.onError,
|
|
3948
|
+
onError = _ref3$onError === void 0 ? function (_ref4) {
|
|
3949
|
+
var message = _ref4.message,
|
|
3950
|
+
error = _ref4.error;
|
|
3951
|
+
return console.error("".concat(message, "\n").concat(error));
|
|
3952
|
+
} : _ref3$onError,
|
|
3953
|
+
_ref3$onGetFile = _ref3.onGetFile,
|
|
3954
|
+
onGetFile = _ref3$onGetFile === void 0 ? defaultOnGetFile : _ref3$onGetFile,
|
|
3955
|
+
_ref3$onCreateList = _ref3.onCreateList,
|
|
3956
|
+
onCreateList = _ref3$onCreateList === void 0 ? defaultOnCreate : _ref3$onCreateList,
|
|
3957
|
+
_ref3$onList = _ref3.onList,
|
|
3958
|
+
onList = _ref3$onList === void 0 ? defaultOnList : _ref3$onList,
|
|
3959
|
+
_ref3$onGetStorage = _ref3.onGetStorage,
|
|
3960
|
+
onGetStorage = _ref3$onGetStorage === void 0 ? defaultOnGetStorage : _ref3$onGetStorage;
|
|
3961
|
+
|
|
3962
|
+
var onDownload = function onDownload() {
|
|
3963
|
+
return onGetStorage().then(function (storageInfo) {
|
|
3964
|
+
return Promise.all([onCreateList(itemListType).then(function (response) {
|
|
3965
|
+
return onList(response, storageInfo, queryParams);
|
|
3966
|
+
}).then(onSuccess()).then(function (response) {
|
|
3967
|
+
return onGetFile(response, storageInfo, queryParams, onError);
|
|
3968
|
+
})]);
|
|
3969
|
+
});
|
|
3970
|
+
};
|
|
3971
|
+
|
|
3972
|
+
return {
|
|
3973
|
+
onDownload: onDownload
|
|
3974
|
+
};
|
|
3975
|
+
};
|
|
3976
|
+
|
|
3977
|
+
function useCompoundMetadata(itemId, values, groups, groupFields, setGroupFields, onRefresh, onSuccess, onError) {
|
|
3978
|
+
var isFamily = function isFamily(el) {
|
|
3979
|
+
return el.hasMultipleChild;
|
|
3980
|
+
};
|
|
3981
|
+
|
|
3982
|
+
var groupFamily = groups.findIndex(isFamily);
|
|
3983
|
+
var tableColumns = groups[groupFamily].groups[0].fields.map(function (group) {
|
|
3984
|
+
return group;
|
|
3985
|
+
});
|
|
3986
|
+
|
|
3987
|
+
var onChange = function onChange(e, row, groupIndex, editIndex) {
|
|
3988
|
+
var value = e.target.value;
|
|
3989
|
+
var name = e.target.name;
|
|
3990
|
+
var newGroups = groupFields.map(function (group) {
|
|
3991
|
+
return group;
|
|
3992
|
+
});
|
|
3993
|
+
var newRows = newGroups[groupIndex].group.map(function (newRow, rowIndex) {
|
|
3994
|
+
if (rowIndex === editIndex) {
|
|
3995
|
+
return _objectSpread2(_objectSpread2({}, row), {}, _defineProperty({}, name, value));
|
|
3996
|
+
}
|
|
3997
|
+
|
|
3998
|
+
return newRow;
|
|
3999
|
+
});
|
|
4000
|
+
newGroups[groupIndex].group = newRows;
|
|
4001
|
+
setGroupFields(newGroups);
|
|
4002
|
+
};
|
|
4003
|
+
|
|
4004
|
+
var onSubmit = /*#__PURE__*/function () {
|
|
4005
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(data) {
|
|
4006
|
+
var groupNames, metadataDocument, newTimeSpan, uuid, newGroups;
|
|
4007
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
4008
|
+
while (1) {
|
|
4009
|
+
switch (_context.prev = _context.next) {
|
|
4010
|
+
case 0:
|
|
4011
|
+
groupNames = [];
|
|
4012
|
+
groups.forEach(function (group) {
|
|
4013
|
+
var newGroup = {};
|
|
4014
|
+
newGroup.parentGroup = group.name;
|
|
4015
|
+
newGroup.childGroup = group.groups[0].name;
|
|
4016
|
+
groupNames.push(newGroup);
|
|
4017
|
+
});
|
|
4018
|
+
metadataDocument = vdtJs.createMetadataType({
|
|
4019
|
+
group: data
|
|
4020
|
+
});
|
|
4021
|
+
newTimeSpan = metadataDocument.timespan;
|
|
4022
|
+
uuid = values.itemType.metadata.timespan[0].group[0].uuid;
|
|
4023
|
+
newGroups = [];
|
|
4024
|
+
newTimeSpan[0].group.forEach(function (group, index) {
|
|
4025
|
+
var newGroup = {
|
|
4026
|
+
group: []
|
|
4027
|
+
};
|
|
4028
|
+
newGroup.name = groupNames[index].parentGroup;
|
|
4029
|
+
newGroup.mode = 'add';
|
|
4030
|
+
group.group.forEach(function (subGroup) {
|
|
4031
|
+
var newSubGroup = subGroup;
|
|
4032
|
+
newSubGroup.name = groupNames[index].childGroup;
|
|
4033
|
+
newSubGroup.mode = 'add';
|
|
4034
|
+
newGroup.group.push(newSubGroup);
|
|
4035
|
+
});
|
|
4036
|
+
newGroups.push(newGroup);
|
|
4037
|
+
});
|
|
4038
|
+
newTimeSpan[0].group = newGroups;
|
|
4039
|
+
_context.prev = 8;
|
|
4040
|
+
_context.next = 11;
|
|
4041
|
+
return vdtApi.metadata.removeMetadata({
|
|
4042
|
+
metadataUuid: uuid
|
|
4043
|
+
});
|
|
4044
|
+
|
|
4045
|
+
case 11:
|
|
4046
|
+
_context.next = 13;
|
|
4047
|
+
return vdtApi.item.updateItemMetadata({
|
|
4048
|
+
itemId: itemId,
|
|
4049
|
+
metadataDocument: {
|
|
4050
|
+
timespan: newTimeSpan
|
|
4051
|
+
}
|
|
4052
|
+
});
|
|
4053
|
+
|
|
4054
|
+
case 13:
|
|
4055
|
+
_context.next = 15;
|
|
4056
|
+
return onRefresh();
|
|
4057
|
+
|
|
4058
|
+
case 15:
|
|
4059
|
+
onSuccess();
|
|
4060
|
+
_context.next = 21;
|
|
4061
|
+
break;
|
|
4062
|
+
|
|
4063
|
+
case 18:
|
|
4064
|
+
_context.prev = 18;
|
|
4065
|
+
_context.t0 = _context["catch"](8);
|
|
4066
|
+
onError(_context.t0);
|
|
4067
|
+
|
|
4068
|
+
case 21:
|
|
4069
|
+
case "end":
|
|
4070
|
+
return _context.stop();
|
|
4071
|
+
}
|
|
4072
|
+
}
|
|
4073
|
+
}, _callee, null, [[8, 18]]);
|
|
4074
|
+
}));
|
|
4075
|
+
|
|
4076
|
+
return function onSubmit(_x) {
|
|
4077
|
+
return _ref.apply(this, arguments);
|
|
4078
|
+
};
|
|
4079
|
+
}();
|
|
4080
|
+
|
|
4081
|
+
return {
|
|
4082
|
+
tableColumns: tableColumns,
|
|
4083
|
+
onChange: onChange,
|
|
4084
|
+
onSubmit: onSubmit
|
|
4085
|
+
};
|
|
4086
|
+
}
|
|
4087
|
+
|
|
4088
|
+
var _excluded$7 = ["itemType", "collectionType", "joinValue", "flat", "groupAsList", "children"];
|
|
3196
4089
|
function MetadataType(_ref) {
|
|
3197
4090
|
var itemType = _ref.itemType,
|
|
3198
4091
|
collectionType = _ref.collectionType,
|
|
@@ -3200,17 +4093,20 @@ function MetadataType(_ref) {
|
|
|
3200
4093
|
joinValue = _ref$joinValue === void 0 ? ',' : _ref$joinValue,
|
|
3201
4094
|
_ref$flat = _ref.flat,
|
|
3202
4095
|
flat = _ref$flat === void 0 ? true : _ref$flat,
|
|
4096
|
+
_ref$groupAsList = _ref.groupAsList,
|
|
4097
|
+
groupAsList = _ref$groupAsList === void 0 ? true : _ref$groupAsList,
|
|
3203
4098
|
children = _ref.children,
|
|
3204
|
-
props = _objectWithoutProperties(_ref,
|
|
4099
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
3205
4100
|
|
|
3206
4101
|
var entityType = itemType || collectionType || {};
|
|
3207
4102
|
var metadataType = entityType.metadata;
|
|
3208
4103
|
var metadata = React__default.useMemo(function () {
|
|
3209
4104
|
return vdtJs.parseMetadataType(metadataType, {
|
|
3210
4105
|
joinValue: joinValue,
|
|
3211
|
-
flat: flat
|
|
4106
|
+
flat: flat,
|
|
4107
|
+
groupAsList: groupAsList
|
|
3212
4108
|
});
|
|
3213
|
-
}, [flat, joinValue, metadataType]);
|
|
4109
|
+
}, [flat, groupAsList, joinValue, metadataType]);
|
|
3214
4110
|
|
|
3215
4111
|
var cloneProps = _objectSpread2(_objectSpread2(_objectSpread2({}, props), metadata), {}, {
|
|
3216
4112
|
itemType: itemType
|
|
@@ -3585,6 +4481,7 @@ var VidispineApi = /*#__PURE__*/function (_React$Component) {
|
|
|
3585
4481
|
return VidispineApi;
|
|
3586
4482
|
}(React__default.Component);
|
|
3587
4483
|
|
|
4484
|
+
var _excluded$8 = ["LoginComponent", "LoginProps", "AppComponent", "AppProps", "onGetToken", "onSuccess", "onError", "cookieOptions"];
|
|
3588
4485
|
var VIDISPINE_TOKEN = 'VIDISPINE-TOKEN';
|
|
3589
4486
|
var VIDISPINE_USERNAME = 'VIDISPINE-USERNAME';
|
|
3590
4487
|
var VIDISPINE_SERVER_URL = 'VIDISPINE-SERVER-URL';
|
|
@@ -3650,7 +4547,7 @@ function Auth(_ref4) {
|
|
|
3650
4547
|
maxAge: 604800,
|
|
3651
4548
|
path: '/'
|
|
3652
4549
|
} : _ref4$cookieOptions,
|
|
3653
|
-
props = _objectWithoutProperties(_ref4,
|
|
4550
|
+
props = _objectWithoutProperties(_ref4, _excluded$8);
|
|
3654
4551
|
|
|
3655
4552
|
var _useCookies = reactCookie.useCookies([VIDISPINE_TOKEN, VIDISPINE_USERNAME, VIDISPINE_SERVER_URL, VIDISPINE_REMEMBER_ME]),
|
|
3656
4553
|
_useCookies2 = _slicedToArray(_useCookies, 3),
|
|
@@ -3946,11 +4843,13 @@ function HasRole(_ref) {
|
|
|
3946
4843
|
return null;
|
|
3947
4844
|
}
|
|
3948
4845
|
|
|
4846
|
+
var _excluded$9 = ["providers", "children"],
|
|
4847
|
+
_excluded2$2 = ["provider"];
|
|
3949
4848
|
function ComposeProviders(_ref) {
|
|
3950
4849
|
var _ref$providers = _ref.providers,
|
|
3951
4850
|
providers = _ref$providers === void 0 ? [] : _ref$providers,
|
|
3952
4851
|
children = _ref.children,
|
|
3953
|
-
props = _objectWithoutProperties(_ref,
|
|
4852
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
3954
4853
|
|
|
3955
4854
|
return providers.reduceRight(function (acc, Provider) {
|
|
3956
4855
|
if (typeof Provider === 'function') {
|
|
@@ -3959,7 +4858,7 @@ function ComposeProviders(_ref) {
|
|
|
3959
4858
|
}
|
|
3960
4859
|
|
|
3961
4860
|
var ProviderComponent = Provider.provider,
|
|
3962
|
-
providerProps = _objectWithoutProperties(Provider,
|
|
4861
|
+
providerProps = _objectWithoutProperties(Provider, _excluded2$2);
|
|
3963
4862
|
|
|
3964
4863
|
return /*#__PURE__*/React__default.createElement(ProviderComponent // eslint-disable-next-line react/jsx-props-no-spreading
|
|
3965
4864
|
, _extends({}, props, providerProps), acc);
|
|
@@ -4834,12 +5733,18 @@ exports.useApi = useApi;
|
|
|
4834
5733
|
exports.useAuthContext = useAuthContext;
|
|
4835
5734
|
exports.useAutocomplete = useAutocomplete;
|
|
4836
5735
|
exports.useCollectionAutoPlay = useCollectionAutoPlay;
|
|
5736
|
+
exports.useCompoundMetadata = useCompoundMetadata;
|
|
5737
|
+
exports.useCsvDownload = useCsvDownload;
|
|
5738
|
+
exports.useDocSearchAutocomplete = useDocSearchAutocomplete;
|
|
4837
5739
|
exports.useEntityAccess = useEntityAccess;
|
|
4838
5740
|
exports.useGetCollection = useGetCollection;
|
|
4839
5741
|
exports.useGetCollectionItem = useGetCollection$1;
|
|
4840
5742
|
exports.useGetEntity = useGetEntity;
|
|
5743
|
+
exports.useGetFieldMetadataDataset = useGetFieldMetadataDataset;
|
|
4841
5744
|
exports.useGetItem = useGetItem;
|
|
5745
|
+
exports.useGetSavedSearchFolders = useGetSavedSearchFolders;
|
|
4842
5746
|
exports.useGroup = useGroup;
|
|
5747
|
+
exports.useHoverScrub = useHoverScrub;
|
|
4843
5748
|
exports.useInterval = useInterval;
|
|
4844
5749
|
exports.useJobSearch = useJobSearch;
|
|
4845
5750
|
exports.useListGroup = useListGroup;
|
|
@@ -4847,6 +5752,7 @@ exports.useListUser = useListUser;
|
|
|
4847
5752
|
exports.useLocalStorage = useLocalStorage;
|
|
4848
5753
|
exports.useMouseDownPosition = useMouseDownPosition;
|
|
4849
5754
|
exports.useQueryInitialState = useQueryInitialState;
|
|
5755
|
+
exports.useRepresentativeItems = useRepresentativeItems;
|
|
4850
5756
|
exports.useRoles = useRoles;
|
|
4851
5757
|
exports.useSavedSearch = useSavedSearch;
|
|
4852
5758
|
exports.useSearch = useSearch;
|