@scaleflex/widget-explorer 0.0.1 → 0.0.3
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
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
|
-
|
|
6
|
+
## [0.0.3](https://code.scaleflex.cloud/scaleflex/widget/compare/v0.0.2...v0.0.3) (2025-07-20)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @scaleflex/widget-explorer
|
|
9
9
|
|
|
@@ -12,6 +12,23 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
## [0.0.2](https://code.scaleflex.cloud/scaleflex/widget/compare/v0.0.1...v0.0.2) (2025-07-20)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @scaleflex/widget-explorer
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
**Note:** Version bump only for package @scaleflex/widget-explorer
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
15
32
|
|
|
16
33
|
|
|
17
34
|
**Note:** Version bump only for package @scaleflex/widget-explorer
|
package/README.md
CHANGED
|
@@ -308,15 +308,17 @@ Multiple triggers are supported as click events.
|
|
|
308
308
|
|
|
309
309
|
### `target`
|
|
310
310
|
|
|
311
|
-
<u>Type:</u> `string
|
|
311
|
+
<u>Type:</u> `string`.
|
|
312
312
|
|
|
313
|
-
<u>Default:</u>
|
|
313
|
+
<u>Default:</u> ``
|
|
314
314
|
|
|
315
315
|
The selector used for displaying the plugin, if passed to `querySelector` function. Options:
|
|
316
316
|
|
|
317
317
|
- HTML tag, eg. `body`
|
|
318
318
|
- CSS selector, eg. `#scaleflex-widget-container` or `.scaleflex-widget-container`
|
|
319
319
|
|
|
320
|
+
> **_Required if_** [inline](#inline): false
|
|
321
|
+
|
|
320
322
|
### `width`
|
|
321
323
|
|
|
322
324
|
<u>Type:</u> `number`| `string`.
|
|
@@ -9,6 +9,7 @@ import { useDispatch, useSelector } from 'react-redux';
|
|
|
9
9
|
import { MyDevice, DamIcon } from '@scaleflex/widget-icons/lib';
|
|
10
10
|
import { usePluginsType, useCore } from '@scaleflex/widget-core/lib/hooks';
|
|
11
11
|
import toArray from '@scaleflex/widget-utils/lib/toArray';
|
|
12
|
+
import { useTheme } from '@scaleflex/ui/theme/hooks';
|
|
12
13
|
import { useAssetsPicker, useExplorer } from '../../hooks';
|
|
13
14
|
import Styled from './AddFiles.styled';
|
|
14
15
|
import { setNewPickerPanel } from '../../slices/panels.slice';
|
|
@@ -18,16 +19,26 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
18
19
|
var AddFiles = function AddFiles() {
|
|
19
20
|
var dispatch = useDispatch();
|
|
20
21
|
var acquirers = usePluginsType('acquirer');
|
|
22
|
+
var theme = useTheme();
|
|
21
23
|
var _useExplorer = useExplorer(),
|
|
22
24
|
addUploads = _useExplorer.addFiles,
|
|
23
25
|
i18n = _useExplorer.i18n,
|
|
24
26
|
i18nArray = _useExplorer.i18nArray,
|
|
25
27
|
explorerOpts = _useExplorer.opts;
|
|
26
28
|
var _useCore = useCore(),
|
|
27
|
-
_useCore$opts
|
|
28
|
-
|
|
29
|
+
_useCore$opts = _useCore.opts,
|
|
30
|
+
_useCore$opts$restric = _useCore$opts.restrictions,
|
|
31
|
+
restrictions = _useCore$opts$restric === void 0 ? {} : _useCore$opts$restric,
|
|
32
|
+
securityTemplateId = _useCore$opts.securityTemplateId,
|
|
33
|
+
container = _useCore$opts.container,
|
|
34
|
+
sassKey = _useCore$opts.sassKey;
|
|
29
35
|
var isDraggingOver = useSelector(selectIsDraggingOver);
|
|
30
|
-
var _useAssetsPicker = useAssetsPicker(
|
|
36
|
+
var _useAssetsPicker = useAssetsPicker({
|
|
37
|
+
securityTemplateId: securityTemplateId,
|
|
38
|
+
container: container,
|
|
39
|
+
sassKey: sassKey,
|
|
40
|
+
theme: theme
|
|
41
|
+
}),
|
|
31
42
|
openAssetPicker = _useAssetsPicker.openAssetPicker;
|
|
32
43
|
var maxNumberOfFiles = restrictions.maxNumberOfFiles,
|
|
33
44
|
allowedFileTypes = restrictions.allowedFileTypes;
|
|
@@ -19,6 +19,7 @@ import { PC } from '@scaleflex/widget-common';
|
|
|
19
19
|
import MetadataAttachmentsFieldType from '@scaleflex/widget-common/lib/MetaData/MetaDataFieldTypes/MetadataAttachmentsFieldType';
|
|
20
20
|
// TODO: Check this MetaDataField component (and other old metadata components) to be refactored and maybe move its location.
|
|
21
21
|
import MetaDataField from '@scaleflex/widget-common/lib/MetaData/MetaDataField';
|
|
22
|
+
import { useCore } from '@scaleflex/widget-core/lib/hooks';
|
|
22
23
|
import { selectMetadataRegionalFilters, selectMetadataRegionalGroups } from '../../../../slices/metadata.slice';
|
|
23
24
|
import { useAssetsPicker, useExplorer, useFileMetadata, useLocateFile } from '../../../../hooks';
|
|
24
25
|
import FileMetadataFieldValue from '../../../common/FileMetadataFieldValue';
|
|
@@ -67,7 +68,17 @@ var CustomMetadataSection = function CustomMetadataSection(_ref) {
|
|
|
67
68
|
var metaRegionalFilters = useSelector(selectMetadataRegionalFilters);
|
|
68
69
|
var metaRegionalGroups = useSelector(selectMetadataRegionalGroups);
|
|
69
70
|
var theme = useTheme();
|
|
70
|
-
var
|
|
71
|
+
var _useCore = useCore(),
|
|
72
|
+
_useCore$opts = _useCore.opts,
|
|
73
|
+
securityTemplateId = _useCore$opts.securityTemplateId,
|
|
74
|
+
container = _useCore$opts.container,
|
|
75
|
+
sassKey = _useCore$opts.sassKey;
|
|
76
|
+
var _useAssetsPicker = useAssetsPicker({
|
|
77
|
+
securityTemplateId: securityTemplateId,
|
|
78
|
+
container: container,
|
|
79
|
+
sassKey: sassKey,
|
|
80
|
+
theme: theme
|
|
81
|
+
}),
|
|
71
82
|
openAssetPicker = _useAssetsPicker.openAssetPicker;
|
|
72
83
|
var _useExplorer = useExplorer(),
|
|
73
84
|
info = _useExplorer.info,
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _excluded = ["onImport", "multiSelect", "maxCountOfSelectedFiles", "mutedFilesUuids", "hideUploadButton", "forceFilters", "rootFolderPath", "views", "allowedUploadFileTypes", "onClickUploadButton", "ExploreViewComponent", "acquirers", "assetsPickerModelTitle"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
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
|
+
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; }
|
|
1
10
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
11
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
12
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -6,9 +15,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
15
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
16
|
import { useRef } from 'react';
|
|
8
17
|
import Filerobot from '@scaleflex/widget-core';
|
|
9
|
-
import { useCore } from '@scaleflex/widget-core/lib/hooks';
|
|
10
18
|
import { VIEW_IDS, PLUGINS_IDS } from '@scaleflex/widget-utils/lib/constants';
|
|
11
|
-
import { useTheme } from '@scaleflex/ui/theme/hooks';
|
|
12
19
|
|
|
13
20
|
// We are importing Explorer dynamically to avoid issue with redux slice initialization
|
|
14
21
|
var Explorer;
|
|
@@ -76,17 +83,15 @@ var getConfigs = function getConfigs(_ref) {
|
|
|
76
83
|
}
|
|
77
84
|
};
|
|
78
85
|
};
|
|
79
|
-
var useAssetsPicker = function useAssetsPicker() {
|
|
80
|
-
var
|
|
86
|
+
var useAssetsPicker = function useAssetsPicker(_ref2) {
|
|
87
|
+
var securityTemplateId = _ref2.securityTemplateId,
|
|
88
|
+
container = _ref2.container,
|
|
89
|
+
sassKey = _ref2.sassKey,
|
|
90
|
+
theme = _ref2.theme;
|
|
81
91
|
var filerobotInstance = useRef(null);
|
|
82
|
-
var _useCore = useCore(),
|
|
83
|
-
_useCore$opts = _useCore.opts,
|
|
84
|
-
securityTemplateId = _useCore$opts.securityTemplateId,
|
|
85
|
-
container = _useCore$opts.container,
|
|
86
|
-
sassKey = _useCore$opts.sassKey;
|
|
87
92
|
var getExplorerPlugin = function getExplorerPlugin(filerobot) {
|
|
88
|
-
var
|
|
89
|
-
return (
|
|
93
|
+
var _ref3;
|
|
94
|
+
return (_ref3 = filerobot !== null && filerobot !== void 0 ? filerobot : filerobotInstance.current) === null || _ref3 === void 0 ? void 0 : _ref3.getPlugin(PLUGINS_IDS.EXPLORER);
|
|
90
95
|
};
|
|
91
96
|
var closeAssetsPicker = function closeAssetsPicker() {
|
|
92
97
|
var _getExplorerPlugin;
|
|
@@ -96,17 +101,17 @@ var useAssetsPicker = function useAssetsPicker() {
|
|
|
96
101
|
}
|
|
97
102
|
filerobotInstance.current = null;
|
|
98
103
|
};
|
|
99
|
-
var onFileAdd = function onFileAdd(
|
|
100
|
-
var nextFiles =
|
|
101
|
-
onImport =
|
|
104
|
+
var onFileAdd = function onFileAdd(_ref4) {
|
|
105
|
+
var nextFiles = _ref4.nextFiles,
|
|
106
|
+
onImport = _ref4.onImport;
|
|
102
107
|
if (!onImport) return;
|
|
103
108
|
onImport(nextFiles);
|
|
104
109
|
closeAssetsPicker();
|
|
105
110
|
};
|
|
106
|
-
var handleExport = function handleExport(
|
|
107
|
-
var files =
|
|
108
|
-
onImport =
|
|
109
|
-
multiSelect =
|
|
111
|
+
var handleExport = function handleExport(_ref5) {
|
|
112
|
+
var files = _ref5.files,
|
|
113
|
+
onImport = _ref5.onImport,
|
|
114
|
+
multiSelect = _ref5.multiSelect;
|
|
110
115
|
var _files = _slicedToArray(files, 1),
|
|
111
116
|
file = _files[0].file;
|
|
112
117
|
var nextFiles = multiSelect ? files : file;
|
|
@@ -116,30 +121,31 @@ var useAssetsPicker = function useAssetsPicker() {
|
|
|
116
121
|
});
|
|
117
122
|
};
|
|
118
123
|
var openAssetPicker = function openAssetPicker() {
|
|
119
|
-
var
|
|
120
|
-
onImport =
|
|
121
|
-
multiSelect =
|
|
122
|
-
maxCountOfSelectedFiles =
|
|
123
|
-
|
|
124
|
-
mutedFilesUuids =
|
|
125
|
-
|
|
126
|
-
hideUploadButton =
|
|
127
|
-
|
|
128
|
-
forceFilters =
|
|
129
|
-
|
|
130
|
-
rootFolderPath =
|
|
131
|
-
|
|
132
|
-
views =
|
|
133
|
-
|
|
134
|
-
allowedUploadFileTypes =
|
|
135
|
-
onClickUploadButton =
|
|
136
|
-
|
|
137
|
-
ExploreViewComponent =
|
|
138
|
-
|
|
139
|
-
acquirers =
|
|
140
|
-
assetsPickerModelTitle =
|
|
124
|
+
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
125
|
+
onImport = _ref6.onImport,
|
|
126
|
+
multiSelect = _ref6.multiSelect,
|
|
127
|
+
maxCountOfSelectedFiles = _ref6.maxCountOfSelectedFiles,
|
|
128
|
+
_ref6$mutedFilesUuids = _ref6.mutedFilesUuids,
|
|
129
|
+
mutedFilesUuids = _ref6$mutedFilesUuids === void 0 ? [] : _ref6$mutedFilesUuids,
|
|
130
|
+
_ref6$hideUploadButto = _ref6.hideUploadButton,
|
|
131
|
+
hideUploadButton = _ref6$hideUploadButto === void 0 ? false : _ref6$hideUploadButto,
|
|
132
|
+
_ref6$forceFilters = _ref6.forceFilters,
|
|
133
|
+
forceFilters = _ref6$forceFilters === void 0 ? false : _ref6$forceFilters,
|
|
134
|
+
_ref6$rootFolderPath = _ref6.rootFolderPath,
|
|
135
|
+
rootFolderPath = _ref6$rootFolderPath === void 0 ? '/' : _ref6$rootFolderPath,
|
|
136
|
+
_ref6$views = _ref6.views,
|
|
137
|
+
views = _ref6$views === void 0 ? DEFAULT_VIEWS : _ref6$views,
|
|
138
|
+
_ref6$allowedUploadFi = _ref6.allowedUploadFileTypes,
|
|
139
|
+
allowedUploadFileTypes = _ref6$allowedUploadFi === void 0 ? null : _ref6$allowedUploadFi,
|
|
140
|
+
onClickUploadButton = _ref6.onClickUploadButton,
|
|
141
|
+
_ref6$ExploreViewComp = _ref6.ExploreViewComponent,
|
|
142
|
+
ExploreViewComponent = _ref6$ExploreViewComp === void 0 ? null : _ref6$ExploreViewComp,
|
|
143
|
+
_ref6$acquirers = _ref6.acquirers,
|
|
144
|
+
acquirers = _ref6$acquirers === void 0 ? [] : _ref6$acquirers,
|
|
145
|
+
assetsPickerModelTitle = _ref6.assetsPickerModelTitle,
|
|
146
|
+
rest = _objectWithoutProperties(_ref6, _excluded);
|
|
141
147
|
if (!window || filerobotInstance.current) return;
|
|
142
|
-
var _getConfigs = getConfigs({
|
|
148
|
+
var _getConfigs = getConfigs(_objectSpread({
|
|
143
149
|
container: container,
|
|
144
150
|
securityTemplateId: securityTemplateId,
|
|
145
151
|
sassKey: sassKey,
|
|
@@ -155,7 +161,7 @@ var useAssetsPicker = function useAssetsPicker() {
|
|
|
155
161
|
onClickUploadButton: onClickUploadButton,
|
|
156
162
|
ExploreViewComponent: ExploreViewComponent,
|
|
157
163
|
assetsPickerModelTitle: assetsPickerModelTitle
|
|
158
|
-
}),
|
|
164
|
+
}, rest)),
|
|
159
165
|
core = _getConfigs.core,
|
|
160
166
|
explorer = _getConfigs.explorer;
|
|
161
167
|
var filerobot = Filerobot(core);
|
package/lib/index.js
CHANGED
|
@@ -1193,7 +1193,7 @@ var Explorer = /*#__PURE__*/function (_Plugin) {
|
|
|
1193
1193
|
strings: defaultLocale
|
|
1194
1194
|
};
|
|
1195
1195
|
var defaultOptions = {
|
|
1196
|
-
target: '
|
|
1196
|
+
target: '',
|
|
1197
1197
|
trigger: '#filerobot-trigger-button',
|
|
1198
1198
|
useAssetsPicker: false,
|
|
1199
1199
|
assetsPickerModelTitle: 'explorerTopSectionImportFileTitle',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleflex/widget-explorer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
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": "^0.0.
|
|
22
|
-
"@scaleflex/widget-icons": "^0.0.
|
|
23
|
-
"@scaleflex/widget-informer": "^0.0.
|
|
24
|
-
"@scaleflex/widget-provider-views": "^0.0.
|
|
25
|
-
"@scaleflex/widget-thumbnail-generator": "^0.0.
|
|
26
|
-
"@scaleflex/widget-utils": "^0.0.
|
|
21
|
+
"@scaleflex/widget-common": "^0.0.3",
|
|
22
|
+
"@scaleflex/widget-icons": "^0.0.0",
|
|
23
|
+
"@scaleflex/widget-informer": "^0.0.3",
|
|
24
|
+
"@scaleflex/widget-provider-views": "^0.0.3",
|
|
25
|
+
"@scaleflex/widget-thumbnail-generator": "^0.0.3",
|
|
26
|
+
"@scaleflex/widget-utils": "^0.0.0",
|
|
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": "81d1b053c6deb611f65a4bbc0018f57df39c378f"
|
|
55
55
|
}
|