@scaleflex/widget-explorer 4.5.0 → 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.
Files changed (48) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +21 -3
  3. package/lib/components/ActionBar/DownloadWithExportButton.js +32 -4
  4. package/lib/components/AssetsList/ListView/AssetsSection/AssetsSectionTableRow.js +1 -1
  5. package/lib/components/Breadcrumbs/index.js +114 -6
  6. package/lib/components/CollectionsView/CollectionFolderIcon.js +35 -0
  7. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionTreeSkeletion.js +26 -0
  8. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionVirtualFoldersTree.styled.js +52 -0
  9. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionVirtualFoldersTree.utils.js +24 -0
  10. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/Folder.js +88 -0
  11. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/Tree.js +50 -0
  12. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/index.js +75 -0
  13. package/lib/components/CollectionsView/CollectionsSkeleton.js +30 -0
  14. package/lib/components/CollectionsView/CollectionsTree/ActiveCollectionContent.js +61 -0
  15. package/lib/components/CollectionsView/CollectionsTree/CollectionTreeItem.js +44 -0
  16. package/lib/components/CollectionsView/CollectionsTree/CollectionsContent.js +130 -0
  17. package/lib/components/CollectionsView/CollectionsTree/CollectionsTree.styled.js +84 -0
  18. package/lib/components/CollectionsView/CollectionsTree/index.js +47 -0
  19. package/lib/components/CollectionsView/CollectionsView.styled.js +38 -0
  20. package/lib/components/CollectionsView/VirtualFoldersGrid.js +67 -0
  21. package/lib/components/CollectionsView/index.js +188 -0
  22. package/lib/components/Details/Details.constants.js +1 -0
  23. package/lib/components/FileItem/FileInfo/index.js +8 -2
  24. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTabNavigator.js +1 -7
  25. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/index.js +4 -1
  26. package/lib/components/FileWindowPanel/Header/index.js +9 -0
  27. package/lib/components/Filters/hooks/useFilters.js +3 -2
  28. package/lib/components/HeaderBar/index.js +6 -2
  29. package/lib/components/LabelsView/LabelsTree/LabelsTree.styled.js +86 -0
  30. package/lib/components/LabelsView/LabelsTree/LabelsTreeSkeleton.js +21 -0
  31. package/lib/components/LabelsView/LabelsTree/index.js +128 -0
  32. package/lib/components/LabelsView/LabelsView.styled.js +10 -0
  33. package/lib/components/LabelsView/index.js +139 -0
  34. package/lib/components/Modals/DownloadConsent/DownloadConsent.hooks.js +11 -0
  35. package/lib/components/Modals/TransformedDownload/TransformedDownload.hooks.js +9 -0
  36. package/lib/components/Views/Views.constants.js +30 -4
  37. package/lib/components/Views/index.js +11 -4
  38. package/lib/components/common/FileMetadataFieldValue/GeneralMetadataFieldValue.js +1 -1
  39. package/lib/components/common/Sort/Sort.constants.js +28 -1
  40. package/lib/defaultLocale.js +36 -1
  41. package/lib/slices/collections.slice.js +714 -0
  42. package/lib/slices/common.slice.js +15 -52
  43. package/lib/slices/files.slice.js +6 -3
  44. package/lib/slices/index.js +5 -1
  45. package/lib/slices/labels.slice.js +652 -0
  46. package/lib/slices/views.slice.js +12 -0
  47. package/lib/utils/prepareSearchUrl.js +10 -0
  48. package/package.json +8 -8
@@ -26,25 +26,14 @@ var initialState = {
26
26
  publicConstants: {},
27
27
  accessRoles: [],
28
28
  accessRolesPermissions: [],
29
- permissionModel: null,
30
- labels: []
29
+ permissionModel: null
31
30
  };
32
- export var fetchLabels = createThunk(async function (_, thunkApi) {
33
- var _await$thunkApi$extra = await thunkApi.extra.apiClient.get('labels', {
34
- id: 'listLabels',
35
- abortSignal: thunkApi.signal
36
- }),
37
- labels = _await$thunkApi$extra.labels;
38
- return labels || [];
39
- }, {
40
- actionType: "".concat(sliceName, "/fetchLabels")
41
- });
42
31
  export var fetchPublicConstants = createThunk(async function (_, thunkApi) {
43
- var _await$thunkApi$extra2 = await thunkApi.extra.apiClient.getAdmin('public/constants', {
32
+ var _await$thunkApi$extra = await thunkApi.extra.apiClient.getAdmin('public/constants', {
44
33
  abortSignal: thunkApi.signal
45
34
  }),
46
- _await$thunkApi$extra3 = _await$thunkApi$extra2.constants,
47
- constants = _await$thunkApi$extra3 === void 0 ? {} : _await$thunkApi$extra3;
35
+ _await$thunkApi$extra2 = _await$thunkApi$extra.constants,
36
+ constants = _await$thunkApi$extra2 === void 0 ? {} : _await$thunkApi$extra2;
48
37
  return {
49
38
  publicConstants: constants
50
39
  };
@@ -68,10 +57,10 @@ export var fetchAccessConstants = createThunk(async function (_, thunkApi) {
68
57
  accessRolesPermissions: accessRolesPermissions
69
58
  };
70
59
  if (projectUuid && !(getPlugin !== null && getPlugin !== void 0 && (_getPlugin2 = getPlugin(PLUGINS_IDS.EXPLORER)) !== null && _getPlugin2 !== void 0 && (_getPlugin2$opts = _getPlugin2.opts) !== null && _getPlugin2$opts !== void 0 && _getPlugin2$opts.galleryRoles)) {
71
- var _await$thunkApi$extra4 = await thunkApi.extra.apiClient.getAdmin("project/".concat(projectUuid, "/accesses/constants"), {
60
+ var _await$thunkApi$extra3 = await thunkApi.extra.apiClient.getAdmin("project/".concat(projectUuid, "/accesses/constants"), {
72
61
  abortSignal: thunkApi.signal
73
62
  }),
74
- roles = _await$thunkApi$extra4.roles;
63
+ roles = _await$thunkApi$extra3.roles;
75
64
  var accessRoles = (roles || []).map(function (role) {
76
65
  return _objectSpread(_objectSpread({}, role), {}, {
77
66
  permissions: typeof (role === null || role === void 0 ? void 0 : role.permissions) === 'string' ? JSON.parse(role.permissions) : (role === null || role === void 0 ? void 0 : role.permissions) || []
@@ -135,46 +124,32 @@ var commonSlice = createSlice({
135
124
  }
136
125
  },
137
126
  extraReducers: function extraReducers(builder) {
138
- builder.addCase(fetchLabels.pending, function (state) {
139
- return _objectSpread(_objectSpread({}, state), {}, {
140
- isLabelsLoading: true
141
- });
142
- }).addCase(fetchLabels.fulfilled, function (state, _ref2) {
143
- var labels = _ref2.payload;
144
- return _objectSpread(_objectSpread({}, state), {}, {
145
- labels: labels,
146
- isLabelsLoading: false
147
- });
148
- }).addCase(fetchLabels.rejected, function (state) {
149
- return _objectSpread(_objectSpread({}, state), {}, {
150
- isLabelsLoading: false
151
- });
152
- }).addCase(viewsChanged, function (state) {
127
+ builder.addCase(viewsChanged, function (state) {
153
128
  return _objectSpread(_objectSpread({}, state), {}, {
154
129
  sortOrder: initialState.sortOrder,
155
130
  sortedBy: initialState.sortedBy
156
131
  });
157
- }).addCase(fetchMetaAndSettings.fulfilled, function (state, _ref3) {
158
- var permissionModel = _ref3.payload.permissionModel;
132
+ }).addCase(fetchMetaAndSettings.fulfilled, function (state, _ref2) {
133
+ var permissionModel = _ref2.payload.permissionModel;
159
134
  return _objectSpread(_objectSpread({}, state), {}, {
160
135
  permissionModel: permissionModel
161
136
  });
162
- }).addMatcher(function (_ref4) {
163
- var type = _ref4.type;
137
+ }).addMatcher(function (_ref3) {
138
+ var type = _ref3.type;
164
139
  return type.startsWith(sliceName) && type.endsWith('/set/pending');
165
140
  }, function (state, action) {
166
141
  return _objectSpread(_objectSpread({}, state), {}, {
167
142
  error: null
168
143
  });
169
- }).addMatcher(function (_ref5) {
170
- var type = _ref5.type;
144
+ }).addMatcher(function (_ref4) {
145
+ var type = _ref4.type;
171
146
  return type.startsWith(sliceName) && type.endsWith('/set/fulfilled');
172
147
  }, function (state, action) {
173
148
  return _objectSpread(_objectSpread(_objectSpread({}, state), action.payload), {}, {
174
149
  error: null
175
150
  });
176
- }).addMatcher(function (_ref6) {
177
- var type = _ref6.type;
151
+ }).addMatcher(function (_ref5) {
152
+ var type = _ref5.type;
178
153
  return type.startsWith(sliceName) && type.endsWith('/set/rejected');
179
154
  }, function (state, action) {
180
155
  return _objectSpread(_objectSpread({}, state), {}, {
@@ -239,16 +214,4 @@ export var selectAccessRolesPermissions = function selectAccessRolesPermissions(
239
214
  export var selectIsDraggingOver = function selectIsDraggingOver(state) {
240
215
  return selectCommon(state).isDraggingOver;
241
216
  };
242
- export var selectLabelsArray = function selectLabelsArray(state) {
243
- return selectCommon(state).labels;
244
- };
245
- export var selectFileLabels = createSelector([selectLabelsArray, function (_state, fileLabels) {
246
- return Array.isArray(fileLabels) ? fileLabels : [];
247
- }], function (labels, fileLabels) {
248
- return fileLabels.map(function (fileLabel) {
249
- return labels.find(function (label) {
250
- return fileLabel === label.sid;
251
- });
252
- });
253
- });
254
217
  export default commonSlice.reducer;
@@ -41,6 +41,7 @@ import decodeB64ToStr from '../utils/decodeB64ToStr';
41
41
  import { getMetaRegionalGroupsLanguagesApiValues } from '../components/metadata.adapter';
42
42
  import { selectActiveRegionalLang, selectIsCdnPermalinkEnabled, selectMetadataRegionalGroups } from './metadata.slice';
43
43
  import { adaptFiltersToBackendNotation } from '../utils/filters';
44
+ import { fetchCollectionVirtualFolders } from './collections.slice';
44
45
 
45
46
  /**
46
47
  * The order of the code in slice file is:
@@ -310,9 +311,9 @@ var updateFilesSorting = function updateFilesSorting(_ref11) {
310
311
  return !sortBy ? undefined : "".concat(sortBy, ":").concat(sortOrder);
311
312
  };
312
313
  /**
313
- * cachedViewQueries === { [key]: value }, means we are fetching the files for which view-mode/feature (folder/label/...etc), examples:
314
+ * * cachedViewQueries === { [key]: value }, means we are fetching the files for which view-mode/feature (folder/label/product/collection...etc), examples:
314
315
  * { folder: 'folderUuid' } or { labels: 'labelSid' }
315
- * or { search: 'searchQuery' } or { search: 'searchQuery', folder: 'folderPath' }
316
+ * or { search: 'searchQuery' } or { search: 'searchQuery', folder: 'folderPath' } or { collections: 'collectionSid' }
316
317
  * -- u could add `recursive: true` to be cached with the view also to be considered always in the request till changing the view.
317
318
  *
318
319
  */
@@ -1044,7 +1045,9 @@ var filesSlice = createSlice({
1044
1045
  loading: true
1045
1046
  })
1046
1047
  });
1047
- }).addCase(viewChanged.type, getInitialState).addCase(fileWindowUpdated.type, function (state, action) {
1048
+ }).addCase(viewChanged.type, getInitialState).addCase(fetchCollectionVirtualFolders.pending, function (state, action) {
1049
+ return filesSlice.caseReducers.filesRemoved(state, action);
1050
+ }).addCase(fileWindowUpdated.type, function (state, action) {
1048
1051
  return action.payload === null ? _objectSpread(_objectSpread({}, state), {}, {
1049
1052
  tmpFile: null
1050
1053
  }) : state;
@@ -12,6 +12,8 @@ import filters from './filters.slice';
12
12
  import views from './views.slice';
13
13
  import foldersTree from './foldersTree.slice';
14
14
  import drag from './drag.slice';
15
+ import collections from './collections.slice';
16
+ import labels from './labels.slice';
15
17
 
16
18
  // Any new slice is added, must be imported here.
17
19
  var explorerReducer = combineReducers({
@@ -27,6 +29,8 @@ var explorerReducer = combineReducers({
27
29
  topSection: topSection,
28
30
  filters: filters,
29
31
  foldersTree: foldersTree,
30
- drag: drag
32
+ drag: drag,
33
+ collections: collections,
34
+ labels: labels
31
35
  });
32
36
  export default explorerReducer;