@scaleflex/widget-explorer 4.0.4 → 4.0.5
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 +14 -1
- package/README.md +19 -3
- package/lib/components/ActionBar/DownloadWithExportButton.js +4 -2
- package/lib/components/AssetsList/AssetsList.styled.js +6 -8
- package/lib/components/AssetsList/GridView/FilesSection/FileCell.js +2 -18
- package/lib/components/FileWindowPanel/FileTabs/FileTabs.constants.js +9 -5
- package/lib/components/FileWindowPanel/FileTabs/FileTabsList.js +7 -4
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsContent.js +4 -2
- package/lib/components/HeaderBar/RightSide.js +2 -2
- package/lib/hooks/useAssetsPicker.js +1 -1
- package/lib/index.js +4 -2
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [4.0.
|
|
6
|
+
## [4.0.5](https://code.scaleflex.cloud/scaleflex/widget/compare/v4.0.0...v4.0.5) (2025-09-10)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
@@ -16,6 +16,19 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
## [4.0.4](https://code.scaleflex.cloud/scaleflex/widget/compare/v4.0.0...v4.0.4) (2025-09-02)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* update CodeSandbox links in HTML and README files to point to the new sandbox version for better user access ([cf4f794](https://code.scaleflex.cloud/scaleflex/widget/commits/cf4f7941cc3b79e5bb9ce604ff7a2f25665072a4))
|
|
25
|
+
* update output filename for Scaleflex widget CSS and adjust CDN links for consistency across various components ([244813e](https://code.scaleflex.cloud/scaleflex/widget/commits/244813e3100c606995ec8988484cf7697398f062))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
19
32
|
## [4.0.3](https://code.scaleflex.cloud/scaleflex/widget/compare/v4.0.0...v4.0.3) (2025-08-26)
|
|
20
33
|
|
|
21
34
|
|
package/README.md
CHANGED
|
@@ -861,13 +861,13 @@ If set to `true`, disable the possiblity to select folder(s).
|
|
|
861
861
|
|
|
862
862
|
If set to `true`, hide the folder item top options.
|
|
863
863
|
|
|
864
|
-
### `
|
|
864
|
+
### `hideDetailsSidebarButton`
|
|
865
865
|
|
|
866
866
|
<u>Type:</u> `boolean`.
|
|
867
867
|
|
|
868
868
|
<u>Default:</u> `false`
|
|
869
869
|
|
|
870
|
-
If set to `true`, hide toggle details
|
|
870
|
+
If set to `true`, hide toggle details sidebar button.
|
|
871
871
|
|
|
872
872
|
### `hideActionBarSelectionButtons`
|
|
873
873
|
|
|
@@ -1013,7 +1013,7 @@ _Note_: only exist filters will be shown.
|
|
|
1013
1013
|
Filters to be applied to the views that accept filters, and will be locked if `disableFiltersAndSearch` or `forceFilters` is `true`, consists of the following:
|
|
1014
1014
|
|
|
1015
1015
|
| Property | Type | Default | Description |
|
|
1016
|
-
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1016
|
+
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1017
1017
|
| **`date`** | `object` | `{ key: 'created', value: undefined, operator: ':' } ` | the date filter that combines both the option/type and range with the operator |
|
|
1018
1018
|
| **`dateOption`** | `string` \| `integer` | `CREATED === 0` | the date option/type to filter with |
|
|
1019
1019
|
| **`dateRange`** | `integer`(1, 2, 3, 4, 5) \| `string` \| `string['yyyy-mm-dd', 'yyyy-mm-dd']` | `undefined` | The date range used in filtering with the date option |
|
|
@@ -1195,6 +1195,22 @@ Assigns the default field of the bulk edit panel to be opened on showing the bul
|
|
|
1195
1195
|
|
|
1196
1196
|
Enables the generate description by AI in the description input of file window.
|
|
1197
1197
|
|
|
1198
|
+
### `hideVariationsTab`
|
|
1199
|
+
|
|
1200
|
+
<u>Type:</u> `boolean`.
|
|
1201
|
+
|
|
1202
|
+
<u>Default:</u> `false`
|
|
1203
|
+
|
|
1204
|
+
If `true` force hides the variations tab in file window panel.
|
|
1205
|
+
|
|
1206
|
+
### `hideMetadataTab`
|
|
1207
|
+
|
|
1208
|
+
<u>Type:</u> `boolean`.
|
|
1209
|
+
|
|
1210
|
+
<u>Default:</u> `false`
|
|
1211
|
+
|
|
1212
|
+
If `true` force hides the metadata tab in file window panel.
|
|
1213
|
+
|
|
1198
1214
|
## Events
|
|
1199
1215
|
|
|
1200
1216
|
The explorer plugin emits different events that you could subscribe to or add your handler to be called with the provided arguments passed while emitting/firing the event, the events are listed below with examples show the parameters for handler:
|
|
@@ -12,7 +12,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
12
12
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
13
|
import { useMemo, useRef, useState } from 'react';
|
|
14
14
|
import { useDispatch, useSelector } from 'react-redux';
|
|
15
|
-
import { Cross, Download, Original, Transformation } from '@scaleflex/icons';
|
|
15
|
+
import { Cross, Download, Original, Sharebox, Transformation } from '@scaleflex/icons';
|
|
16
16
|
import { Menu, TooltipV2 } from '@scaleflex/ui/core';
|
|
17
17
|
import { useTheme } from '@scaleflex/ui/theme/hooks';
|
|
18
18
|
import checkItemsSupportExportWithReason from '@scaleflex/widget-utils/lib/checkItemsSupportExportWithReason';
|
|
@@ -147,7 +147,9 @@ var DownloadWithExportButton = function DownloadWithExportButton() {
|
|
|
147
147
|
children: /*#__PURE__*/_jsx(Styled.DownloadButton, {
|
|
148
148
|
disabled: downloadButtonDisabled,
|
|
149
149
|
startIcon: !hideDownloadButtonIcon && function (props) {
|
|
150
|
-
return /*#__PURE__*/_jsx(
|
|
150
|
+
return useAssetsPicker ? /*#__PURE__*/_jsx(Sharebox, _objectSpread(_objectSpread({}, props), {}, {
|
|
151
|
+
ref: menuRef
|
|
152
|
+
})) : /*#__PURE__*/_jsx(Download, _objectSpread(_objectSpread({}, props), {}, {
|
|
151
153
|
ref: menuRef
|
|
152
154
|
}));
|
|
153
155
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36;
|
|
2
2
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
3
3
|
import styled, { css, keyframes } from 'styled-components';
|
|
4
4
|
import { CheckBox, Input, Label as SfxLabel, Skeleton, Accordion as SfxAccordion, IconButton, Button } from '@scaleflex/ui/core';
|
|
@@ -128,7 +128,6 @@ var FileVideoDurationWrapper = styled.div(_templateObject29 || (_templateObject2
|
|
|
128
128
|
return props.theme.palette[PC.IconsInvert];
|
|
129
129
|
});
|
|
130
130
|
var FileListVideoDurationWrapper = styled(FileVideoDurationWrapper)(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n bottom: 17%;\n left: 7%;\n padding: 1px 2px;\n font-size: 9px;\n line-height: 9px;\n"])));
|
|
131
|
-
var FileVideoOptions = styled.div(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n & > .filerobot-common-ItemHoverTopOptions {\n right: calc(50% - 22px);\n top: calc(50% - 22px);\n padding: 0;\n\n .filerobot-common-BaseButton {\n width: 44px;\n height: 44px;\n margin: 0;\n\n svg {\n width: 22px;\n height: 22px;\n }\n }\n }\n\n *:hover > & {\n .filerobot-common-ItemHoverTopOptions {\n visibility: visible;\n }\n }\n"])));
|
|
132
131
|
var Accordion = styled(SfxAccordion)(function (_ref17) {
|
|
133
132
|
var hideHeader = _ref17.hideHeader,
|
|
134
133
|
noTopMargin = _ref17.noTopMargin,
|
|
@@ -136,9 +135,9 @@ var Accordion = styled(SfxAccordion)(function (_ref17) {
|
|
|
136
135
|
_ref17$theme = _ref17.theme,
|
|
137
136
|
typography = _ref17$theme.typography,
|
|
138
137
|
palette = _ref17$theme.palette;
|
|
139
|
-
return css(
|
|
138
|
+
return css(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n margin-bottom: 12px;\n margin-top: ", ";\n\n ", "\n\n .SfxAccordionHeader-root {\n padding: 0 24px;\n display: ", "\n }\n\n .SfxAccordionHeader-label {\n ", ";\n color: ", "\n }\n"])), noTopMargin ? 0 : '12px', isListView && "\n max-width: 2200px;\n margin: auto;\n ", hideHeader ? 'none' : 'inline-flex', typography.font[FV.LabelMediumEmphasis], palette[PC.TextSecondary]);
|
|
140
139
|
});
|
|
141
|
-
var RelevanceScore = styled.div(
|
|
140
|
+
var RelevanceScore = styled.div(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n text-align: center;\n margin: 6px 0px;\n font-size: 20px;\n"])));
|
|
142
141
|
var FileRelevanceBadge = styled.div(function (_ref18) {
|
|
143
142
|
var $isListView = _ref18.$isListView,
|
|
144
143
|
$relevance = _ref18.$relevance,
|
|
@@ -146,7 +145,7 @@ var FileRelevanceBadge = styled.div(function (_ref18) {
|
|
|
146
145
|
_ref18$theme = _ref18.theme,
|
|
147
146
|
palette = _ref18$theme.palette,
|
|
148
147
|
typography = _ref18$theme.typography;
|
|
149
|
-
return css(
|
|
148
|
+
return css(_templateObject33 || (_templateObject33 = _taggedTemplateLiteral(["\n ", ";\n ", "\n background-color: ", ";\n color: ", ";\n width: 47px;\n height: 22px;\n display: ", ";\n justify-content: center;\n align-items: center;\n z-index: 2;\n visibility: visible;\n border-radius: 4px;\n"])), typography.font[FV.LabelMediumEmphasis], !$isListView && css(_templateObject34 || (_templateObject34 = _taggedTemplateLiteral(["\n top: 0%;\n margin: 12px;\n position: absolute;\n "]))), palette[$relevance >= 90 ? PC.Success : PC.BordersPrimaryHover], palette[PC.ButtonPrimaryText], isFileChecked && !$isListView ? 'none' : 'flex');
|
|
150
149
|
});
|
|
151
150
|
var getScrollTopButtonPosition = function getScrollTopButtonPosition(isProgressPanelMinimized) {
|
|
152
151
|
if (isProgressPanelMinimized) {
|
|
@@ -154,7 +153,7 @@ var getScrollTopButtonPosition = function getScrollTopButtonPosition(isProgressP
|
|
|
154
153
|
}
|
|
155
154
|
return '36px';
|
|
156
155
|
};
|
|
157
|
-
var ScrollToTopButton = styled(IconButton)(
|
|
156
|
+
var ScrollToTopButton = styled(IconButton)(_templateObject35 || (_templateObject35 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: ", ";\n right: 24px;\n z-index: 1000;\n max-height: 48px;\n padding: 15px;\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n\n &:hover {\n background-color: ", ";\n & > svg {\n path {\n fill: ", ";\n }\n }\n }\n\n &:focus,\n &:active {\n background-color: ", ";\n color: ", ";\n }\n"])), function (_ref19) {
|
|
158
157
|
var isProgressPanelMinimized = _ref19.isProgressPanelMinimized;
|
|
159
158
|
return getScrollTopButtonPosition(isProgressPanelMinimized);
|
|
160
159
|
}, function (_ref20) {
|
|
@@ -179,7 +178,7 @@ var ScrollToTopButton = styled(IconButton)(_templateObject36 || (_templateObject
|
|
|
179
178
|
var palette = _ref26.theme.palette;
|
|
180
179
|
return palette[PC.IconsSecondary];
|
|
181
180
|
});
|
|
182
|
-
var ApprovalStatusWrapper = styled.div(
|
|
181
|
+
var ApprovalStatusWrapper = styled.div(_templateObject36 || (_templateObject36 = _taggedTemplateLiteral(["\n display: flex;\n visibility: visible;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 14px;\n right: 12px;\n background-color: ", ";\n box-shadow: 0px 1px 3px 0px rgba(77, 78, 78, 0.15);\n border-radius: 4px;\n z-index: 100;\n padding: 2px 4px;\n transition: visibility 0s linear 180ms;\n\n ", ":hover & {\n visibility: hidden;\n transition: visibility 0s linear 30ms;\n };\n\n div {\n color: ", ";\n }\n"])), function (_ref27) {
|
|
183
182
|
var palette = _ref27.theme.palette;
|
|
184
183
|
return palette[PC.BackgroundStateless];
|
|
185
184
|
}, FileSectionItem, function (_ref28) {
|
|
@@ -209,7 +208,6 @@ var Styled = {
|
|
|
209
208
|
FileSkeleton: FileSkeleton,
|
|
210
209
|
FileVideoDurationWrapper: FileVideoDurationWrapper,
|
|
211
210
|
FileListVideoDurationWrapper: FileListVideoDurationWrapper,
|
|
212
|
-
FileVideoOptions: FileVideoOptions,
|
|
213
211
|
Accordion: Accordion,
|
|
214
212
|
RelevanceScore: RelevanceScore,
|
|
215
213
|
ScrollToTopButton: ScrollToTopButton,
|
|
@@ -7,18 +7,15 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
7
7
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
8
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
-
import {
|
|
10
|
+
import { useState, useCallback, useRef } from 'react';
|
|
11
11
|
import { useSelector, useDispatch } from 'react-redux';
|
|
12
|
-
import { Play } from '@scaleflex/icons';
|
|
13
12
|
import FileInfo from '@scaleflex/widget-explorer/lib/components/FileItem/FileInfo';
|
|
14
13
|
import formatSeconds from '@scaleflex/widget-utils/lib/formatSeconds';
|
|
15
14
|
import _getItemIcon from '@scaleflex/widget-utils/lib/getItemIcon';
|
|
16
|
-
import
|
|
17
|
-
import { ItemHoverTopOptions, AssetPreview } from '@scaleflex/widget-common';
|
|
15
|
+
import { AssetPreview } from '@scaleflex/widget-common';
|
|
18
16
|
import ignoreEvent from '@scaleflex/widget-utils/lib/ignoreEvent';
|
|
19
17
|
import { TooltipV2 } from '@scaleflex/ui/core';
|
|
20
18
|
import { selectIsRelevanceAvailable } from '@scaleflex/widget-core/lib/slices/common.slice';
|
|
21
|
-
import isVideo from '@scaleflex/widget-utils/lib/isVideo';
|
|
22
19
|
import { PERMISSIONS } from '@scaleflex/widget-utils/lib/constants';
|
|
23
20
|
import DnD from '../../../DnD';
|
|
24
21
|
import FileOverlayOptions from './FileOverlayOptions';
|
|
@@ -110,15 +107,6 @@ var FileCell = function FileCell(_ref) {
|
|
|
110
107
|
}, [file]);
|
|
111
108
|
var isItemBeingRenamed = renameItemFor === uuid;
|
|
112
109
|
var isFileChecked = isChecked;
|
|
113
|
-
var options = useMemo(function () {
|
|
114
|
-
return [{
|
|
115
|
-
key: 'GridLi-PreviewVideo',
|
|
116
|
-
Icon: Play,
|
|
117
|
-
iconSize: 22,
|
|
118
|
-
onClick: toggleFileWindow,
|
|
119
|
-
hidden: !isPreviewSupported(file)
|
|
120
|
-
}];
|
|
121
|
-
}, [file]);
|
|
122
110
|
var handleMouseOver = function handleMouseOver() {
|
|
123
111
|
var _file$info, _file$info2;
|
|
124
112
|
if (isLoading) {
|
|
@@ -245,10 +233,6 @@ var FileCell = function FileCell(_ref) {
|
|
|
245
233
|
container: container,
|
|
246
234
|
children: [!!((_file$info5 = file.info) !== null && _file$info5 !== void 0 && _file$info5.video_duration) && /*#__PURE__*/_jsx(Styled.FileVideoDurationWrapper, {
|
|
247
235
|
children: formatSeconds((_file$info6 = file.info) === null || _file$info6 === void 0 ? void 0 : _file$info6.video_duration)
|
|
248
|
-
}), isVideo(file) && /*#__PURE__*/_jsx(Styled.FileVideoOptions, {
|
|
249
|
-
children: /*#__PURE__*/_jsx(ItemHoverTopOptions, {
|
|
250
|
-
options: options
|
|
251
|
-
})
|
|
252
236
|
}), !hideOverlayOptions && /*#__PURE__*/_jsx(FileOverlayOptions, {
|
|
253
237
|
file: file,
|
|
254
238
|
onContextMenu: handleOnContextMenu,
|
|
@@ -29,17 +29,21 @@ export var ALL_TABS = [{
|
|
|
29
29
|
}, {
|
|
30
30
|
id: FILE_WINDOW_TAB_IDS.METADATA,
|
|
31
31
|
i18nStr: 'explorerFileWindowMetadataTabLabel',
|
|
32
|
-
iconComponent: SfxMetadataIcon
|
|
32
|
+
iconComponent: SfxMetadataIcon,
|
|
33
|
+
hide: function hide(_ref2) {
|
|
34
|
+
var hideMetadataTab = _ref2.hideMetadataTab;
|
|
35
|
+
return hideMetadataTab;
|
|
36
|
+
}
|
|
33
37
|
}, {
|
|
34
38
|
id: FILE_WINDOW_TAB_IDS.VARIATIONS,
|
|
35
39
|
i18nStr: 'explorerFileWindowVariationsTabLabel',
|
|
36
40
|
iconComponent: Variations,
|
|
37
|
-
hide: function hide(
|
|
38
|
-
var hideVariationsTab =
|
|
41
|
+
hide: function hide(_ref3) {
|
|
42
|
+
var hideVariationsTab = _ref3.hideVariationsTab;
|
|
39
43
|
return hideVariationsTab;
|
|
40
44
|
},
|
|
41
|
-
disable: function disable(
|
|
42
|
-
var isPublicFile =
|
|
45
|
+
disable: function disable(_ref4) {
|
|
46
|
+
var isPublicFile = _ref4.isPublicFile;
|
|
43
47
|
return !isPublicFile;
|
|
44
48
|
},
|
|
45
49
|
disabledI18nKey: 'explorerFileWindowVariationsTabDisabledDesc'
|
|
@@ -30,13 +30,15 @@ var FileTabsList = function FileTabsList(_ref) {
|
|
|
30
30
|
cancelEditing = _ref2.cancelEditing;
|
|
31
31
|
var isUserAuth = useSelector(selectIsUserAuth);
|
|
32
32
|
var metadataModel = useSelector(selectMetadataModel);
|
|
33
|
-
var isFastToken = opts.isFastToken
|
|
33
|
+
var isFastToken = opts.isFastToken,
|
|
34
|
+
hideVariationsTabOpts = opts.hideVariationsTab,
|
|
35
|
+
hideMetadataTabOpts = opts.hideMetadataTab;
|
|
34
36
|
var isSvgImage = isSvg(originalFile);
|
|
35
37
|
var isImageFile = isImage(originalFile);
|
|
36
38
|
var approvalPlugin = filerobot.getPlugin(PLUGINS_IDS.APPROVALS);
|
|
37
39
|
var showDetailsTabContent = isEditing;
|
|
38
|
-
var hideVariationsTab =
|
|
39
|
-
var hideMetadataTab = Object.keys(metadataModel).length === 0;
|
|
40
|
+
var hideVariationsTab = hideVariationsTabOpts || isPreUpload || isFastToken || isSvgImage || !isImageFile;
|
|
41
|
+
var hideMetadataTab = hideMetadataTabOpts || Object.keys(metadataModel).length === 0;
|
|
40
42
|
var visibleTabs = useMemo(function () {
|
|
41
43
|
if (isPreUpload) {
|
|
42
44
|
return PRE_UPLOAD_TABS.filter(function (_ref3) {
|
|
@@ -52,7 +54,8 @@ var FileTabsList = function FileTabsList(_ref) {
|
|
|
52
54
|
var isVisible = !(hide !== null && hide !== void 0 && hide({
|
|
53
55
|
isFastToken: isFastToken,
|
|
54
56
|
isUserAuth: isUserAuth,
|
|
55
|
-
hideVariationsTab: hideVariationsTab
|
|
57
|
+
hideVariationsTab: hideVariationsTab,
|
|
58
|
+
hideMetadataTab: hideMetadataTab
|
|
56
59
|
}));
|
|
57
60
|
if (id === FILE_WINDOW_TAB_IDS.APPROVALS) {
|
|
58
61
|
return (approvalPlugin === null || approvalPlugin === void 0 ? void 0 : approvalPlugin.isEnabled()) && isVisible;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useDispatch, useSelector } from 'react-redux';
|
|
2
2
|
import { VariantPlaceholder, PlusOutline } from '@scaleflex/icons';
|
|
3
|
-
import { selectIsUserPermittedTo } from '@scaleflex/widget-core/lib/slices/user.slice';
|
|
3
|
+
import { selectIsUserPermittedTo, selectIsUserAuth } from '@scaleflex/widget-core/lib/slices/user.slice';
|
|
4
4
|
import { PERMISSIONS } from '@scaleflex/widget-utils/lib/constants';
|
|
5
5
|
import VariationItem from './VariationItem';
|
|
6
6
|
import StyledVariants from './Variations.styled';
|
|
@@ -23,9 +23,11 @@ var VariationsContent = function VariationsContent(_ref) {
|
|
|
23
23
|
i18n = _ref.i18n,
|
|
24
24
|
activeTabId = _ref.activeTabId;
|
|
25
25
|
var dispatch = useDispatch();
|
|
26
|
-
var
|
|
26
|
+
var hasUserVariantEditPermission = useSelector(function (state) {
|
|
27
27
|
return selectIsUserPermittedTo(state, PERMISSIONS.FILE_IMAGE_EDITOR);
|
|
28
28
|
});
|
|
29
|
+
var isUserAuth = useSelector(selectIsUserAuth);
|
|
30
|
+
var isUserPermittedToEditVariant = isUserAuth && hasUserVariantEditPermission;
|
|
29
31
|
var showAddVariantButton = isUserPermittedToEditVariant && activeTabId === VARIATIONS_TAB_IDS.MANUAL;
|
|
30
32
|
var onSelectVariant = function onSelectVariant(variant) {
|
|
31
33
|
setSelectedVariant(variant);
|
|
@@ -34,7 +34,7 @@ var RightSide = function RightSide(_ref) {
|
|
|
34
34
|
opts = _useExplorer$opts === void 0 ? {} : _useExplorer$opts,
|
|
35
35
|
i18n = _useExplorer.i18n;
|
|
36
36
|
var showGlobalRegVariants = opts.showGlobalRegVariants,
|
|
37
|
-
|
|
37
|
+
hideDetailsSidebarButton = opts.hideDetailsSidebarButton,
|
|
38
38
|
hideDetailsViewButton = opts.hideDetailsViewButton;
|
|
39
39
|
var dispatch = useDispatch();
|
|
40
40
|
var _useState = useState(false),
|
|
@@ -51,7 +51,7 @@ var RightSide = function RightSide(_ref) {
|
|
|
51
51
|
});
|
|
52
52
|
var isNoFilesFound = useSelector(selectIsNoFilesFound);
|
|
53
53
|
var areItemsBasedBtnsDisabled = isNoFilesFound && isNoFoldersFound;
|
|
54
|
-
var showDetailsButton = !hideDetailsViewButton && showLayoutAndDetailsBtns && !
|
|
54
|
+
var showDetailsButton = !hideDetailsViewButton && showLayoutAndDetailsBtns && !hideDetailsSidebarButton && !isDetailsSidebarOpened;
|
|
55
55
|
var handleRefresh = async function handleRefresh() {
|
|
56
56
|
if (!isRefreshButtonDisabled && typeof onRefresh === 'function') {
|
|
57
57
|
var res = onRefresh();
|
|
@@ -72,7 +72,7 @@ var getConfigs = function getConfigs(_ref) {
|
|
|
72
72
|
dismissUrlPathQueryUpdate: true,
|
|
73
73
|
hideFolderOptions: true,
|
|
74
74
|
closeAfterExport: true,
|
|
75
|
-
|
|
75
|
+
hideDetailsSidebarButton: true,
|
|
76
76
|
hideActionBarSelectionButtons: true,
|
|
77
77
|
hideDownloadButtonIcon: true,
|
|
78
78
|
disableMultipleSelect: !multiSelect,
|
package/lib/index.js
CHANGED
|
@@ -1217,7 +1217,7 @@ var Explorer = /*#__PURE__*/function (_Plugin) {
|
|
|
1217
1217
|
assetsPickerModelTitle: 'explorerTopSectionImportFileTitle',
|
|
1218
1218
|
disableFolderSelection: false,
|
|
1219
1219
|
hideFolderOptions: false,
|
|
1220
|
-
|
|
1220
|
+
hideDetailsSidebarButton: false,
|
|
1221
1221
|
disableDnDActions: false,
|
|
1222
1222
|
hideActionBarSelectionButtons: false,
|
|
1223
1223
|
inline: false,
|
|
@@ -1391,7 +1391,9 @@ var Explorer = /*#__PURE__*/function (_Plugin) {
|
|
|
1391
1391
|
onImportFromDam: function onImportFromDam() {},
|
|
1392
1392
|
showImportFromDamButton: false,
|
|
1393
1393
|
defaultFieldKeyOfBulkEditPanel: '',
|
|
1394
|
-
hideDetailsViewButton: false
|
|
1394
|
+
hideDetailsViewButton: false,
|
|
1395
|
+
hideVariationsTab: false,
|
|
1396
|
+
hideMetadataTab: false
|
|
1395
1397
|
};
|
|
1396
1398
|
|
|
1397
1399
|
// merge default options with the ones set by user
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleflex/widget-explorer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "Scaleflex explorer for the files uploaded on filerobot, handling them & upload new files.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"style": "dist/style.min.css",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"@scaleflex/icons": "^3.0.0-beta.11",
|
|
19
19
|
"@scaleflex/react-url-builder": "^0.0.72",
|
|
20
20
|
"@scaleflex/ui": "^3.0.0-beta.11",
|
|
21
|
-
"@scaleflex/widget-common": "^4.0.
|
|
22
|
-
"@scaleflex/widget-icons": "^4.0.
|
|
23
|
-
"@scaleflex/widget-informer": "^4.0.
|
|
24
|
-
"@scaleflex/widget-provider-views": "^4.0.
|
|
25
|
-
"@scaleflex/widget-thumbnail-generator": "^4.0.
|
|
26
|
-
"@scaleflex/widget-utils": "^4.0.
|
|
21
|
+
"@scaleflex/widget-common": "^4.0.5",
|
|
22
|
+
"@scaleflex/widget-icons": "^4.0.5",
|
|
23
|
+
"@scaleflex/widget-informer": "^4.0.5",
|
|
24
|
+
"@scaleflex/widget-provider-views": "^4.0.5",
|
|
25
|
+
"@scaleflex/widget-thumbnail-generator": "^4.0.5",
|
|
26
|
+
"@scaleflex/widget-utils": "^4.0.5",
|
|
27
27
|
"@transloadit/prettier-bytes": "0.1.0",
|
|
28
28
|
"akamai-filerobot-converter": "^0.1.6",
|
|
29
29
|
"classnames": "^2.2.6",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"react-konva": ">=19.0.3"
|
|
52
52
|
},
|
|
53
53
|
"license": "MIT",
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "c95faef749de50d9c458d63a8b01da02efa268e2"
|
|
55
55
|
}
|