@scaleflex/widget-explorer 4.0.4 → 4.0.6

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.
@@ -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(Download, _objectSpread(_objectSpread({}, props), {}, {
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
  },
@@ -102,7 +102,7 @@ var AddFiles = function AddFiles() {
102
102
  var importFromDam = function importFromDam() {
103
103
  openAssetsPicker({
104
104
  onImport: onImportFromDam,
105
- hideUploadButton: true,
105
+ disableUpload: true,
106
106
  securityTemplateId: securityTemplateId,
107
107
  container: container,
108
108
  sassKey: sassKey,
@@ -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, _templateObject37;
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(_templateObject32 || (_templateObject32 = _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]);
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(_templateObject33 || (_templateObject33 = _taggedTemplateLiteral(["\n text-align: center;\n margin: 6px 0px;\n font-size: 20px;\n"])));
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(_templateObject34 || (_templateObject34 = _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(_templateObject35 || (_templateObject35 = _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');
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)(_templateObject36 || (_templateObject36 = _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) {
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(_templateObject37 || (_templateObject37 = _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) {
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 { useMemo, useState, useCallback, useRef } from 'react';
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 isPreviewSupported from '@scaleflex/widget-utils/lib/isPreviewSupported';
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,
@@ -35,7 +35,8 @@ var DnD = function DnD(_ref) {
35
35
  i18n = _useExplorer.i18n,
36
36
  addFiles = _useExplorer.addFiles,
37
37
  opts = _useExplorer.opts;
38
- var disableDnDActions = opts.disableDnDActions;
38
+ var disableDnDActions = opts.disableDnDActions,
39
+ disableUpload = opts.disableUpload;
39
40
  var handleDraggedItem = function handleDraggedItem(id, type) {
40
41
  var draggedElement = document.querySelector("[data-filerobot-focusable-uuid=\"".concat(id, "\"]"));
41
42
  if (draggedElement) {
@@ -213,6 +214,6 @@ var DnD = function DnD(_ref) {
213
214
  onDragOver: handleDragOver,
214
215
  onDragLeave: handleDragLeave
215
216
  };
216
- return /*#__PURE__*/cloneElement(children, _objectSpread({}, draggable ? _objectSpread(_objectSpread({}, disableDrag || disableDnDActions ? {} : dragEvents), disableDrop || disableDnDActions ? {} : dropEvents) : {}));
217
+ return /*#__PURE__*/cloneElement(children, _objectSpread({}, draggable ? _objectSpread(_objectSpread({}, disableDrag || disableDnDActions || disableUpload ? {} : dragEvents), disableDrop || disableDnDActions || disableUpload ? {} : dropEvents) : {}));
217
218
  };
218
219
  export default DnD;
@@ -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(_ref2) {
38
- var hideVariationsTab = _ref2.hideVariationsTab;
41
+ hide: function hide(_ref3) {
42
+ var hideVariationsTab = _ref3.hideVariationsTab;
39
43
  return hideVariationsTab;
40
44
  },
41
- disable: function disable(_ref3) {
42
- var isPublicFile = _ref3.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 = isPreUpload || !isUserAuth || isFastToken || isSvgImage || !isImageFile;
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 isUserPermittedToEditVariant = useSelector(function (state) {
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
- hideDetailsTab = opts.hideDetailsTab,
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 && !hideDetailsTab && !isDetailsSidebarOpened;
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();
@@ -21,12 +21,12 @@ var TopBarUploadButton = function TopBarUploadButton() {
21
21
  var isPermittedToUpload = useSelector(function (state) {
22
22
  return selectIsUserPermittedTo(state, PERMISSIONS.UPLOAD);
23
23
  });
24
- var hideUploadButton = opts.hideUploadButton;
24
+ var disableUpload = opts.disableUpload;
25
25
  var openAddFilesPanel = function openAddFilesPanel() {
26
26
  dispatch(showAddFilesPanelUpdated(true));
27
27
  dispatch(selectionsCleared());
28
28
  };
29
- return !hideUploadButton && isPermittedToUpload && /*#__PURE__*/_jsx(Button, {
29
+ return !disableUpload && isPermittedToUpload && /*#__PURE__*/_jsx(Button, {
30
30
  startIcon: function startIcon(props) {
31
31
  return /*#__PURE__*/_jsx(Upload, _objectSpread({}, props));
32
32
  },
@@ -1,4 +1,4 @@
1
- var _excluded = ["securityTemplateId", "container", "sassKey", "theme", "language", "onImport", "multiSelect", "maxCountOfSelectedFiles", "mutedFilesUuids", "hideUploadButton", "forceFilters", "rootFolderPath", "views", "allowedUploadFileTypes", "onClickUploadButton", "acquirers", "assetsPickerModelTitle", "pluginsToUse", "moreCoreConfig", "moreExplorerConfig", "moreXhrUploadConfig", "moreProgressPanelConfig", "onOpen", "onClose"];
1
+ var _excluded = ["securityTemplateId", "container", "sassKey", "theme", "language", "onImport", "multiSelect", "maxCountOfSelectedFiles", "mutedFilesUuids", "disableUpload", "forceFilters", "rootFolderPath", "views", "allowedUploadFileTypes", "onClickUploadButton", "acquirers", "assetsPickerModelTitle", "pluginsToUse", "moreCoreConfig", "moreExplorerConfig", "moreXhrUploadConfig", "moreProgressPanelConfig", "onOpen", "onClose"];
2
2
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
3
  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; }
4
4
  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; }
@@ -31,7 +31,7 @@ var getConfigs = function getConfigs(_ref) {
31
31
  multiSelect = _ref.multiSelect,
32
32
  maxCountOfSelectedFiles = _ref.maxCountOfSelectedFiles,
33
33
  mutedFilesUuids = _ref.mutedFilesUuids,
34
- hideUploadButton = _ref.hideUploadButton,
34
+ disableUpload = _ref.disableUpload,
35
35
  _ref$theme = _ref.theme,
36
36
  theme = _ref$theme === void 0 ? {} : _ref$theme,
37
37
  rootFolderPath = _ref.rootFolderPath,
@@ -58,7 +58,7 @@ var getConfigs = function getConfigs(_ref) {
58
58
  }
59
59
  }, moreCoreConfig),
60
60
  explorer: _objectSpread({
61
- hideUploadButton: hideUploadButton,
61
+ disableUpload: disableUpload,
62
62
  forceFilters: forceFilters,
63
63
  view: VIEW_IDS.ASSETS,
64
64
  width: '90vw',
@@ -72,7 +72,7 @@ var getConfigs = function getConfigs(_ref) {
72
72
  dismissUrlPathQueryUpdate: true,
73
73
  hideFolderOptions: true,
74
74
  closeAfterExport: true,
75
- hideDetailsTab: true,
75
+ hideDetailsSidebarButton: true,
76
76
  hideActionBarSelectionButtons: true,
77
77
  hideDownloadButtonIcon: true,
78
78
  disableMultipleSelect: !multiSelect,
@@ -134,8 +134,8 @@ var useAssetsPicker = function useAssetsPicker() {
134
134
  maxCountOfSelectedFiles = _ref5.maxCountOfSelectedFiles,
135
135
  _ref5$mutedFilesUuids = _ref5.mutedFilesUuids,
136
136
  mutedFilesUuids = _ref5$mutedFilesUuids === void 0 ? [] : _ref5$mutedFilesUuids,
137
- _ref5$hideUploadButto = _ref5.hideUploadButton,
138
- hideUploadButton = _ref5$hideUploadButto === void 0 ? false : _ref5$hideUploadButto,
137
+ _ref5$disableUpload = _ref5.disableUpload,
138
+ disableUpload = _ref5$disableUpload === void 0 ? false : _ref5$disableUpload,
139
139
  _ref5$forceFilters = _ref5.forceFilters,
140
140
  forceFilters = _ref5$forceFilters === void 0 ? false : _ref5$forceFilters,
141
141
  _ref5$rootFolderPath = _ref5.rootFolderPath,
@@ -172,7 +172,7 @@ var useAssetsPicker = function useAssetsPicker() {
172
172
  multiSelect: multiSelect,
173
173
  maxCountOfSelectedFiles: maxCountOfSelectedFiles,
174
174
  mutedFilesUuids: mutedFilesUuids,
175
- hideUploadButton: hideUploadButton,
175
+ disableUpload: disableUpload,
176
176
  theme: theme,
177
177
  rootFolderPath: rootFolderPath,
178
178
  views: views,
@@ -194,7 +194,7 @@ var useAssetsPicker = function useAssetsPicker() {
194
194
  config = _ref6$config === void 0 ? {} : _ref6$config;
195
195
  filerobot.use(plugin, config);
196
196
  });
197
- if (!hideUploadButton) {
197
+ if (!disableUpload) {
198
198
  import('@scaleflex/widget-xhr-upload').then(function (module) {
199
199
  var XHRUpload = module["default"];
200
200
  filerobot.use(XHRUpload, moreXhrUploadConfig);
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
- hideDetailsTab: false,
1220
+ hideDetailsSidebarButton: false,
1221
1221
  disableDnDActions: false,
1222
1222
  hideActionBarSelectionButtons: false,
1223
1223
  inline: false,
@@ -1226,7 +1226,7 @@ var Explorer = /*#__PURE__*/function (_Plugin) {
1226
1226
  thumbnailWidth: 280,
1227
1227
  thumbnailHeight: 170,
1228
1228
  waitForThumbnailsBeforeUpload: false,
1229
- hideUploadButton: false,
1229
+ disableUpload: false,
1230
1230
  hideSearch: false,
1231
1231
  note: null,
1232
1232
  hint: null,
@@ -1391,14 +1391,16 @@ 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
1398
1400
  _this.opts = _objectSpread(_objectSpread(_objectSpread({}, defaultOptions), _opts), {}, {
1399
1401
  filters: _opts.filters ? getMappedFilterValues(_opts.filters) : defaultOptions.filters,
1400
1402
  views: _opts.views || defaultOptions.views,
1401
- view: _opts.view || _opts.defaultView || defaultOptions.view,
1403
+ view: _opts.view || defaultOptions.view,
1402
1404
  config: _objectSpread(_objectSpread(_objectSpread({}, defaultOptions.config), _opts.config), {}, {
1403
1405
  tagging: _objectSpread(_objectSpread({}, (_defaultOptions$confi = defaultOptions.config) === null || _defaultOptions$confi === void 0 ? void 0 : _defaultOptions$confi.tagging), (_opts$config = _opts.config) === null || _opts$config === void 0 ? void 0 : _opts$config.tagging),
1404
1406
  video: _objectSpread(_objectSpread({}, (_defaultOptions$confi2 = defaultOptions.config) === null || _defaultOptions$confi2 === void 0 ? void 0 : _defaultOptions$confi2.video), (_opts$config2 = _opts.config) === null || _opts$config2 === void 0 ? void 0 : _opts$config2.video),
@@ -1432,7 +1434,7 @@ var Explorer = /*#__PURE__*/function (_Plugin) {
1432
1434
  key: "_isPasteAndDnDUploadDisabled",
1433
1435
  value: function _isPasteAndDnDUploadDisabled() {
1434
1436
  var currentView = selectActiveView(this.getGlobalState());
1435
- return this.opts.disableDnDActions || ![VIEW_IDS.FOLDERS, VIEW_IDS.ASSETS].includes(currentView);
1437
+ return this.opts.disableDnDActions || this.opts.disableUpload || ![VIEW_IDS.FOLDERS, VIEW_IDS.ASSETS].includes(currentView);
1436
1438
  }
1437
1439
  }, {
1438
1440
  key: "getPluginReducer",
@@ -1477,7 +1479,7 @@ var Explorer = /*#__PURE__*/function (_Plugin) {
1477
1479
  var config = opts.config || {};
1478
1480
  var allViews = Object.values(VIEW_IDS);
1479
1481
  var allLayouts = Object.values(LAYOUTS_IDS);
1480
- var currentView = isInstall && ((_this$getUrlQueryPara = this.getUrlQueryParam(FMAW_URL_QUERY_PARAMS.VIEW, opts.view || opts.defaultView)) === null || _this$getUrlQueryPara === void 0 ? void 0 : _this$getUrlQueryPara.toUpperCase());
1482
+ var currentView = isInstall && ((_this$getUrlQueryPara = this.getUrlQueryParam(FMAW_URL_QUERY_PARAMS.VIEW, opts.view)) === null || _this$getUrlQueryPara === void 0 ? void 0 : _this$getUrlQueryPara.toUpperCase());
1481
1483
  var viewState = _objectSpread({
1482
1484
  layout: opts.layoutType ? allLayouts.includes(opts.layoutType) && opts.layoutType || LAYOUTS_IDS.GRID : undefined,
1483
1485
  list: opts.views ? opts.views.filter(function (viewId) {
@@ -130,12 +130,11 @@ export var activateViewFromOutside = createThunk(function (_ref2, thunkApi) {
130
130
  viewItem = opts.viewItem,
131
131
  viewSubItem = opts.viewSubItem,
132
132
  views = opts.views,
133
- defaultView = opts.defaultView,
134
133
  _opts$isRecursiveFetc = opts.isRecursiveFetch,
135
134
  isRecursiveFetch = _opts$isRecursiveFetc === void 0 ? false : _opts$isRecursiveFetc;
136
135
  var activeView = selectActiveView(getState());
137
136
  var viewOptions = {
138
- id: view || defaultView || activeView,
137
+ id: view || activeView,
139
138
  itemToOpen: viewItem,
140
139
  subItemToOpen: viewSubItem,
141
140
  isRecursive: isRecursiveFetch
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleflex/widget-explorer",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
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.4",
22
- "@scaleflex/widget-icons": "^4.0.4",
23
- "@scaleflex/widget-informer": "^4.0.4",
24
- "@scaleflex/widget-provider-views": "^4.0.4",
25
- "@scaleflex/widget-thumbnail-generator": "^4.0.4",
26
- "@scaleflex/widget-utils": "^4.0.4",
21
+ "@scaleflex/widget-common": "^4.0.6",
22
+ "@scaleflex/widget-icons": "^4.0.6",
23
+ "@scaleflex/widget-informer": "^4.0.6",
24
+ "@scaleflex/widget-provider-views": "^4.0.6",
25
+ "@scaleflex/widget-thumbnail-generator": "^4.0.6",
26
+ "@scaleflex/widget-utils": "^4.0.6",
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": "9acad1431f206dd78802489c05e2c76a3ae30a53"
54
+ "gitHead": "17ad9b9abc2add9c8b52ab56e3a72108bee20a7a"
55
55
  }
package/types/index.d.ts CHANGED
@@ -52,7 +52,7 @@ declare module Explorer {
52
52
  thumbnailWidth?: number;
53
53
  thumbnailHeight?: number;
54
54
  waitForThumbnailsBeforeUpload?: boolean;
55
- hideUploadButton?: boolean;
55
+ disableUpload?: boolean;
56
56
  hideSearch?: boolean;
57
57
  note?: string;
58
58
  closeModalOnClickOutside?: boolean;