@scaleflex/widget-utils 4.0.7 → 4.3.0

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 (65) hide show
  1. package/CHANGELOG.md +7278 -7250
  2. package/LICENSE +21 -21
  3. package/README.md +58 -58
  4. package/lib/AbortController.js +2 -2
  5. package/lib/BlurHash/decode.js +4 -4
  6. package/lib/CustomDate.js +27 -27
  7. package/lib/EventTracker.js +3 -3
  8. package/lib/LinkHelper.js +26 -26
  9. package/lib/ProgressTimeout.js +5 -5
  10. package/lib/RateLimitedQueue.js +2 -2
  11. package/lib/TranslationMissingKeysConsoleHelper.js +13 -13
  12. package/lib/Translator.js +39 -39
  13. package/lib/addUrlParams.js +6 -6
  14. package/lib/adjustUpdatedFolders.js +7 -7
  15. package/lib/canvasToBlob.js +5 -5
  16. package/lib/checkItemsSupportExportWithReason.js +5 -5
  17. package/lib/checkPermissions.js +6 -6
  18. package/lib/clsx.js +3 -3
  19. package/lib/convertVideoFileTypeToSupported.js +9 -9
  20. package/lib/copyText.js +10 -10
  21. package/lib/createThunk.js +21 -21
  22. package/lib/customEncodeURIComponent.js +21 -21
  23. package/lib/fetchWithNetworkError.js +2 -2
  24. package/lib/findAllDOMElements.js +5 -5
  25. package/lib/findDOMElement.js +5 -5
  26. package/lib/findIndex.js +2 -2
  27. package/lib/formatDuration.js +8 -8
  28. package/lib/formatResolution.js +9 -9
  29. package/lib/formatSeconds.js +6 -6
  30. package/lib/generateFileId.js +12 -12
  31. package/lib/generateSelectInputPlaceholder.js +6 -6
  32. package/lib/getCloudimagePrefixedUrl.js +6 -6
  33. package/lib/getDateDaysFromNow.js +5 -5
  34. package/lib/getDateString.js +2 -2
  35. package/lib/getDroppedFiles/index.js +8 -8
  36. package/lib/getDroppedFiles/utils/webkitGetAsEntryApi/getFilesAndDirectoriesFromDirectory.js +7 -7
  37. package/lib/getDroppedFiles/utils/webkitGetAsEntryApi/getRelativePath.js +6 -6
  38. package/lib/getDroppedFiles/utils/webkitGetAsEntryApi/index.js +5 -5
  39. package/lib/getFileNameAndExtension.js +5 -5
  40. package/lib/getFormattedPreviewUrl.js +18 -18
  41. package/lib/getHoursAndMinutes.js +4 -4
  42. package/lib/getMetadataMultiSelectQuery.js +6 -6
  43. package/lib/getNormalizedItems.js +15 -15
  44. package/lib/getRandomNumber.js +5 -5
  45. package/lib/getTime.js +2 -2
  46. package/lib/getTimeStamp.js +4 -4
  47. package/lib/handlePromise.js +8 -8
  48. package/lib/humanReadableDate.js +4 -4
  49. package/lib/humanReadableDateWithTranslations.js +2 -2
  50. package/lib/injectVirtualPathToFolders.js +5 -5
  51. package/lib/isDOMElement.js +4 -4
  52. package/lib/isDragDropSupported.js +4 -4
  53. package/lib/isFileSupportedByCloudimage.js +5 -5
  54. package/lib/isMobileDevice.js +5 -5
  55. package/lib/isObjectURL.js +5 -5
  56. package/lib/metadata/checkFieldValidation.js +9 -9
  57. package/lib/metadata/generateItemMetadataState.js +8 -8
  58. package/lib/metadata/generateMetadataDefaultState.js +4 -4
  59. package/lib/metadata/updateValidationErrors.js +8 -8
  60. package/lib/nanoid.js +4 -4
  61. package/lib/recursiveFnCall.js +2 -2
  62. package/lib/removeDuplicatesFromArray.js +9 -9
  63. package/lib/toArray.js +2 -2
  64. package/package.json +3 -3
  65. package/types/index.d.ts +279 -279
@@ -4,13 +4,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  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; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
6
  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); }
7
- /**
8
- * Adjust updated folders as currently BE API returns string instead of object for visibility field
9
- * To fix that problem, visibilities object is merged to visibility
10
- * BE task to fix it https://scaleflexhq.atlassian.net/browse/FRA-2010, after it's fixed, this function will not be
11
- * needed anymore
12
- * @param {Array} folders - array of folders
13
- * @returns {Array} - updated array of folders
7
+ /**
8
+ * Adjust updated folders as currently BE API returns string instead of object for visibility field
9
+ * To fix that problem, visibilities object is merged to visibility
10
+ * BE task to fix it https://scaleflexhq.atlassian.net/browse/FRA-2010, after it's fixed, this function will not be
11
+ * needed anymore
12
+ * @param {Array} folders - array of folders
13
+ * @returns {Array} - updated array of folders
14
14
  */
15
15
  export default (function (folders) {
16
16
  return folders.map(function (folder) {
@@ -1,10 +1,10 @@
1
1
  import dataURItoBlob from './dataURItoBlob';
2
2
 
3
- /**
4
- * Save a <canvas> element's content to a Blob object.
5
- *
6
- * @param {HTMLCanvasElement} canvas
7
- * @returns {Promise}
3
+ /**
4
+ * Save a <canvas> element's content to a Blob object.
5
+ *
6
+ * @param {HTMLCanvasElement} canvas
7
+ * @returns {Promise}
8
8
  */
9
9
  export default function canvasToBlob(canvas, type, quality) {
10
10
  if (canvas.toBlob) {
@@ -13,11 +13,11 @@ var areSelectionsMixedWithPdf = function areSelectionsMixedWithPdf(items) {
13
13
  });
14
14
  };
15
15
 
16
- /**
17
- * Check if the items provided are supportted to be exported.
18
- * @param {items}
19
- * @returns {i18nStr} If not supported.
20
- * @returns {undefined} If supported.
16
+ /**
17
+ * Check if the items provided are supportted to be exported.
18
+ * @param {items}
19
+ * @returns {i18nStr} If not supported.
20
+ * @returns {undefined} If supported.
21
21
  */
22
22
 
23
23
  export default function checkItemsSupportExportWithReason(items) {
@@ -1,9 +1,9 @@
1
- /**
2
- * A function to check the provided permissions facing the user's permissions
3
- * @param {*} userPermissions - the user permissions array.
4
- * @param {*} permissionsChecking - the permissions to check array
5
- * @param {*} returnObject - if true, the permissionsChecking object would be returned with boolean value (true permission is found, false is not found)
6
- * @returns {Boolean} - true = all permissionsChecking are found, false = one of them not found.
1
+ /**
2
+ * A function to check the provided permissions facing the user's permissions
3
+ * @param {*} userPermissions - the user permissions array.
4
+ * @param {*} permissionsChecking - the permissions to check array
5
+ * @param {*} returnObject - if true, the permissionsChecking object would be returned with boolean value (true permission is found, false is not found)
6
+ * @returns {Boolean} - true = all permissionsChecking are found, false = one of them not found.
7
7
  */
8
8
  var checkPermissions = function checkPermissions() {
9
9
  var userPermissions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
package/lib/clsx.js CHANGED
@@ -1,7 +1,7 @@
1
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
- /**
3
- * @param {{[key:string]:boolean}} classes
4
- * @returns {string}
2
+ /**
3
+ * @param {{[key:string]:boolean}} classes
4
+ * @returns {string}
5
5
  */
6
6
  function clsx(classes) {
7
7
  if (_typeof(classes) !== 'object') {
@@ -1,12 +1,12 @@
1
- /**
2
- * Method to fix <video> support issue for *.mov (video/quicktime) video type (maybe some other types later).
3
- * To make mov video works good we need to use "video/mp4" type instead of "video/quicktime".
4
- *
5
- * Scaban card: https://sfx.li/MVcgYtX894WiUD (ID T11986)
6
- *
7
- * Since the browser doesn't supproted .mkv videos, used same idea as *.mov videos and works (but not sure if it works with no issues and for all the browsers or not)
8
- * Jira's card URL: https://scaleflexhq.atlassian.net/browse/FRA-2494
9
- *
1
+ /**
2
+ * Method to fix <video> support issue for *.mov (video/quicktime) video type (maybe some other types later).
3
+ * To make mov video works good we need to use "video/mp4" type instead of "video/quicktime".
4
+ *
5
+ * Scaban card: https://sfx.li/MVcgYtX894WiUD (ID T11986)
6
+ *
7
+ * Since the browser doesn't supproted .mkv videos, used same idea as *.mov videos and works (but not sure if it works with no issues and for all the browsers or not)
8
+ * Jira's card URL: https://scaleflexhq.atlassian.net/browse/FRA-2494
9
+ *
10
10
  */
11
11
  var convertVideoFileTypeToSupported = function convertVideoFileTypeToSupported(videoFileType) {
12
12
  if (videoFileType === 'video/quicktime' || videoFileType === 'video/x-matroska') {
package/lib/copyText.js CHANGED
@@ -1,13 +1,13 @@
1
- /**
2
- * Copies any text passed to the parameter with showing confirmation message in case of success
3
- * or showing an prompt for handling the copy manually if the browser doesn't support auto copy
4
- *
5
- * @returns {boolean}
6
- *
7
- * @param {string} text -- The string to be copied
8
- * @param {Function} i18n -- The translation function for translating the shown confirmation message - eg. plugin.i18n
9
- * @param {Function} info -- The filerobot info function for showing confirmation message - eg. plugin.filerobot.info
10
- * @param {string} successMsgI18nKey -- (optional) The translation key of the success msg that will show after copying text, default is 'File link is copied'
1
+ /**
2
+ * Copies any text passed to the parameter with showing confirmation message in case of success
3
+ * or showing an prompt for handling the copy manually if the browser doesn't support auto copy
4
+ *
5
+ * @returns {boolean}
6
+ *
7
+ * @param {string} text -- The string to be copied
8
+ * @param {Function} i18n -- The translation function for translating the shown confirmation message - eg. plugin.i18n
9
+ * @param {Function} info -- The filerobot info function for showing confirmation message - eg. plugin.filerobot.info
10
+ * @param {string} successMsgI18nKey -- (optional) The translation key of the success msg that will show after copying text, default is 'File link is copied'
11
11
  */
12
12
  export default function copyText(_ref) {
13
13
  var text = _ref.text,
@@ -121,27 +121,27 @@ var abortAllInProgressAsyncThunks = function abortAllInProgressAsyncThunks() {
121
121
  return true;
122
122
  };
123
123
 
124
- /**
125
- * Exact Similar to createAsyncThunk with some extra options:
126
- * 1. supporting both async & sync thunk functions
127
- * 2. added 1 more dispatched action ${actionType}/(loading, fulfilled, rejected & *final*)
128
- * 3. `skipDispatch` or don't provide `actionType` - incase of not wanting to dispatch any action and only need to trigger the sync/async function or manual handling for actions.
129
- * 4. `informError` - incase of wanting to inform the error to the user (ex. in a toast) and not dispatching any action.
130
- * 5. `throwRejection` - if u want to throw the error of the promise and u will handle it by catching the error by (handlePromise utility function) or .catch, then provide this `true`.
131
- *
132
- * @param {Function} dispatchedFn - the function that will be called when the thunk is dispatched
133
- * @param {Object} options - the options passed for configuring the function operation
134
- * @param {String} options.actionType - the action type that will be dispatched
135
- * @param {Function} options.condition - the condition that will be checked before calling the dispatchedFn,
136
- * -- `true`/`resolved promise` do the normal dispatch,
137
- * -- `false`/`rejected promise` cancels the dispatched function implementation and return empty resolved promise.
138
- * @param {Boolean} options.skipDispatch - incase of NOT wanting to dispatch any action and only need to trigger the sync/async function or manual handling for actions.
139
- * @param {Boolean} options.skipPendingDispatch - it disables the dispatching of pending action, and only dispatches the fulfilled/rejected/final actions.
140
- * @param {Boolean} options.informError - incase of wanting to inform the error to the user (ex. in a toast).
141
- * @param {Boolean} options.throwRejection - incase of NOT wanting to handle the rejection in the return of dispatch from the function side, in that case u have to catch it urself ex. of dispatch(...).catch(...)
142
- * @param {Boolean} options.dismissGlobalAbort - if u don't need to abort the request on calling abortInProgressThunks
143
- *
144
- * @returns Function - the thunk function
124
+ /**
125
+ * Exact Similar to createAsyncThunk with some extra options:
126
+ * 1. supporting both async & sync thunk functions
127
+ * 2. added 1 more dispatched action ${actionType}/(loading, fulfilled, rejected & *final*)
128
+ * 3. `skipDispatch` or don't provide `actionType` - incase of not wanting to dispatch any action and only need to trigger the sync/async function or manual handling for actions.
129
+ * 4. `informError` - incase of wanting to inform the error to the user (ex. in a toast) and not dispatching any action.
130
+ * 5. `throwRejection` - if u want to throw the error of the promise and u will handle it by catching the error by (handlePromise utility function) or .catch, then provide this `true`.
131
+ *
132
+ * @param {Function} dispatchedFn - the function that will be called when the thunk is dispatched
133
+ * @param {Object} options - the options passed for configuring the function operation
134
+ * @param {String} options.actionType - the action type that will be dispatched
135
+ * @param {Function} options.condition - the condition that will be checked before calling the dispatchedFn,
136
+ * -- `true`/`resolved promise` do the normal dispatch,
137
+ * -- `false`/`rejected promise` cancels the dispatched function implementation and return empty resolved promise.
138
+ * @param {Boolean} options.skipDispatch - incase of NOT wanting to dispatch any action and only need to trigger the sync/async function or manual handling for actions.
139
+ * @param {Boolean} options.skipPendingDispatch - it disables the dispatching of pending action, and only dispatches the fulfilled/rejected/final actions.
140
+ * @param {Boolean} options.informError - incase of wanting to inform the error to the user (ex. in a toast).
141
+ * @param {Boolean} options.throwRejection - incase of NOT wanting to handle the rejection in the return of dispatch from the function side, in that case u have to catch it urself ex. of dispatch(...).catch(...)
142
+ * @param {Boolean} options.dismissGlobalAbort - if u don't need to abort the request on calling abortInProgressThunks
143
+ *
144
+ * @returns Function - the thunk function
145
145
  */
146
146
  var createThunk = function createThunk(dispatchedFn) {
147
147
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -10,27 +10,27 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
10
10
  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; }
11
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
12
  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); }
13
- /*
14
- Task: https://scaleflexhq.atlassian.net/browse/FRA-4340
15
-
16
- Julian, [27 Jan 2024 at 06:47:04 (27 Jan 2024 at 06:48:19)]:
17
- I think the debugging would be much easier so it wil make save time to all PO, QA, etc. — so overall I think it's a very impactful todo
18
-
19
- In general, chars that need to be URL encoded are spaces, very special characters like:
20
- — # bcs it's the anchor
21
- — % bcs it's the start of an url encoded,
22
- — & of course bcs it's param delimiter
23
- — and + since it means an encoded-space
24
- — and maybe other non-printable ASCII characters
25
-
26
- but for our cases here, things like >, <, / .., : etc don't need to be URL-encoded
27
- maybe a way to make this todo very very simple first at low risk is simply to "re-encode" 2 chars :
28
- %2F -> /
29
- %2C -> :
30
- %3A -> ,
31
-
32
- I think just this will fix 98% of our QA-PO- etc misunderstanding and make debugging much easier
33
- when people look at Network console and copy paste things
13
+ /*
14
+ Task: https://scaleflexhq.atlassian.net/browse/FRA-4340
15
+
16
+ Julian, [27 Jan 2024 at 06:47:04 (27 Jan 2024 at 06:48:19)]:
17
+ I think the debugging would be much easier so it wil make save time to all PO, QA, etc. — so overall I think it's a very impactful todo
18
+
19
+ In general, chars that need to be URL encoded are spaces, very special characters like:
20
+ — # bcs it's the anchor
21
+ — % bcs it's the start of an url encoded,
22
+ — & of course bcs it's param delimiter
23
+ — and + since it means an encoded-space
24
+ — and maybe other non-printable ASCII characters
25
+
26
+ but for our cases here, things like >, <, / .., : etc don't need to be URL-encoded
27
+ maybe a way to make this todo very very simple first at low risk is simply to "re-encode" 2 chars :
28
+ %2F -> /
29
+ %2C -> :
30
+ %3A -> ,
31
+
32
+ I think just this will fix 98% of our QA-PO- etc misunderstanding and make debugging much easier
33
+ when people look at Network console and copy paste things
34
34
  */
35
35
 
36
36
  export var customEncodeURIComponent = function customEncodeURIComponent(str, opts) {
@@ -1,7 +1,7 @@
1
1
  import NetworkError from '@scaleflex/widget-utils/lib/NetworkError';
2
2
 
3
- /**
4
- * Wrapper around window.fetch that throws a NetworkError when appropriate
3
+ /**
4
+ * Wrapper around window.fetch that throws a NetworkError when appropriate
5
5
  */
6
6
  export default function fetchWithNetworkError() {
7
7
  return fetch.apply(void 0, arguments)["catch"](function (err) {
@@ -1,11 +1,11 @@
1
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
2
  import isDOMElement from './isDOMElement';
3
3
 
4
- /**
5
- * Find one or more DOM elements.
6
- *
7
- * @param {string} element
8
- * @returns {Array|null}
4
+ /**
5
+ * Find one or more DOM elements.
6
+ *
7
+ * @param {string} element
8
+ * @returns {Array|null}
9
9
  */
10
10
  export default function findAllDOMElements(element) {
11
11
  if (typeof element === 'string') {
@@ -1,10 +1,10 @@
1
1
  import isDOMElement from './isDOMElement';
2
2
 
3
- /**
4
- * Find a DOM element.
5
- *
6
- * @param {Node|string} element
7
- * @returns {Node|null}
3
+ /**
4
+ * Find a DOM element.
5
+ *
6
+ * @param {Node|string} element
7
+ * @returns {Node|null}
8
8
  */
9
9
  export default function findDOMElement(element) {
10
10
  var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
package/lib/findIndex.js CHANGED
@@ -1,5 +1,5 @@
1
- /**
2
- * Array.prototype.findIndex ponyfill for old browsers.
1
+ /**
2
+ * Array.prototype.findIndex ponyfill for old browsers.
3
3
  */
4
4
  export default function findIndex(array, predicate) {
5
5
  for (var i = 0; i < array.length; i++) {
@@ -1,11 +1,11 @@
1
- /**
2
- * Formats duration from 02:25:33 to 2h 25m 33s (separator is configurable, so possible to convert 02.33.44)
3
- *
4
- * @returns {string}
5
- *
6
- * @param {string|number} duration -- Duration as string or number
7
- * @param {Function} i18n -- The translation function for translating the shown confirmation message - eg. plugin.i18n
8
- * @param {string} separator -- The separator is used between time parts
1
+ /**
2
+ * Formats duration from 02:25:33 to 2h 25m 33s (separator is configurable, so possible to convert 02.33.44)
3
+ *
4
+ * @returns {string}
5
+ *
6
+ * @param {string|number} duration -- Duration as string or number
7
+ * @param {Function} i18n -- The translation function for translating the shown confirmation message - eg. plugin.i18n
8
+ * @param {string} separator -- The separator is used between time parts
9
9
  */
10
10
  export default (function (duration) {
11
11
  var i18n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
@@ -1,12 +1,12 @@
1
- /**
2
- * Formats resolution from 1200x800 to 1200 x 800 px
3
- *
4
- * @returns {string}
5
- *
6
- * @param {string} resolution -- Resolution as string
7
- * @param {string} separator -- Separator that should be replaced
8
- * @param {string} newSeparator -- Separator that should be placed
9
- * @param {boolean} addPx -- Either add px at the end or not
1
+ /**
2
+ * Formats resolution from 1200x800 to 1200 x 800 px
3
+ *
4
+ * @returns {string}
5
+ *
6
+ * @param {string} resolution -- Resolution as string
7
+ * @param {string} separator -- Separator that should be replaced
8
+ * @param {string} newSeparator -- Separator that should be placed
9
+ * @param {boolean} addPx -- Either add px at the end or not
10
10
  */
11
11
  export default (function () {
12
12
  var resolution = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
@@ -1,9 +1,9 @@
1
- /**
2
- * Takes an Integer value of seconds (e.g. 83) and converts it into a human-readable formatted string (e.g. '1:10:23').
3
- *
4
- * @param {Integer} seconds
5
- * @returns {string} the formatted seconds (e.g. '1:10:23' for 1 hour, 10 minutes and 23 seconds)
6
- *
1
+ /**
2
+ * Takes an Integer value of seconds (e.g. 83) and converts it into a human-readable formatted string (e.g. '1:10:23').
3
+ *
4
+ * @param {Integer} seconds
5
+ * @returns {string} the formatted seconds (e.g. '1:10:23' for 1 hour, 10 minutes and 23 seconds)
6
+ *
7
7
  */
8
8
  export default function formatSeconds(seconds) {
9
9
  if (!seconds) return;
@@ -1,9 +1,9 @@
1
- /**
2
- * Takes a file object and turns it into fileID, by converting file.name to lowercase,
3
- * removing extra characters and adding type, size and lastModified
4
- *
5
- * @param {object} file
6
- * @returns {string} the fileID
1
+ /**
2
+ * Takes a file object and turns it into fileID, by converting file.name to lowercase,
3
+ * removing extra characters and adding type, size and lastModified
4
+ *
5
+ * @param {object} file
6
+ * @returns {string} the fileID
7
7
  */
8
8
  export default function generateFileId(file) {
9
9
  // It's tempting to do `[items].filter(Boolean).join('-')` here, but that
@@ -24,12 +24,12 @@ export default function generateFileId(file) {
24
24
  id += '-' + encodeFilename(file.data.relativePath.toLowerCase());
25
25
  }
26
26
 
27
- /**
28
- * TODO: check the following comment after the commiting time,
29
- * Removed the data size, and last modified, to make the id unified for the files
30
- * so if a new version is being uploaded we will override the base on in the progress panel's activities if there
31
- * If no issues reported about progress panel/activities related to this comment after some time, please remove it and improve the wrapper condition.
32
- * related to this task: https://scaleflexhq.atlassian.net/browse/FRA-7291
27
+ /**
28
+ * TODO: check the following comment after the commiting time,
29
+ * Removed the data size, and last modified, to make the id unified for the files
30
+ * so if a new version is being uploaded we will override the base on in the progress panel's activities if there
31
+ * If no issues reported about progress panel/activities related to this comment after some time, please remove it and improve the wrapper condition.
32
+ * related to this task: https://scaleflexhq.atlassian.net/browse/FRA-7291
33
33
  */
34
34
 
35
35
  // if (file.data.size !== undefined) {
@@ -6,12 +6,12 @@ var style = {
6
6
  fontSize: 14
7
7
  };
8
8
 
9
- /**
10
- * [TODO] We may remove this util when this feature implemented in Scaleflex UI
11
- * @param {string} placeholder
12
- * @param {value} string
13
- * @param {value} Array
14
- * @returns {Object} placeholder with styles
9
+ /**
10
+ * [TODO] We may remove this util when this feature implemented in Scaleflex UI
11
+ * @param {string} placeholder
12
+ * @param {value} string
13
+ * @param {value} Array
14
+ * @returns {Object} placeholder with styles
15
15
  */
16
16
 
17
17
  export default function generateSelectInputPlaceholder(placeholder) {
@@ -1,10 +1,10 @@
1
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
- /**
3
- * Get url prefixed by Cloudimage, to be able to process original image and cache it on CDN.
4
- * @param {string} url - Original URL
5
- * @param {object} opts
6
- * @param {object} opts.params - Cloudimage params (https://docs.scaleflex.com/filerobot-documentation/media-optimizers-and-cdn-delivery/image-optimization)
7
- * @returns {string} - Prefixed url with params
2
+ /**
3
+ * Get url prefixed by Cloudimage, to be able to process original image and cache it on CDN.
4
+ * @param {string} url - Original URL
5
+ * @param {object} opts
6
+ * @param {object} opts.params - Cloudimage params (https://docs.scaleflex.com/filerobot-documentation/media-optimizers-and-cdn-delivery/image-optimization)
7
+ * @returns {string} - Prefixed url with params
8
8
  */
9
9
  var getCloudimagePrefixedUrl = function getCloudimagePrefixedUrl(url, opts) {
10
10
  var _url$split;
@@ -1,10 +1,10 @@
1
1
  import { ONE_DAY_MS } from './constants';
2
2
  var ONE_MIN_IN_MS = 1000 * 60;
3
- /**
4
- * Returns a date days from now
5
- * @param {Number} days - sets the new date by adding the provided number of days for the current date
6
- * @param {Boolean} timeExcluded - either to return timestamp with time (hours, minutes etc) or without
7
- * @returns {number} - timestamp in milliseconds
3
+ /**
4
+ * Returns a date days from now
5
+ * @param {Number} days - sets the new date by adding the provided number of days for the current date
6
+ * @param {Boolean} timeExcluded - either to return timestamp with time (hours, minutes etc) or without
7
+ * @returns {number} - timestamp in milliseconds
8
8
  */
9
9
 
10
10
  export default (function (_ref) {
@@ -1,5 +1,5 @@
1
- /**
2
- * Returns a date in the all formats
1
+ /**
2
+ * Returns a date in the all formats
3
3
  */
4
4
 
5
5
  export default function getDateString(format, spaceType, timeStamp) {
@@ -1,14 +1,14 @@
1
1
  import webkitGetAsEntryApi from './utils/webkitGetAsEntryApi/index';
2
2
  import fallbackApi from './utils/fallbackApi';
3
3
 
4
- /**
5
- * Returns a promise that resolves to the array of dropped files (if a folder is dropped, and browser supports folder parsing - promise resolves to the flat array of all files in all directories).
6
- * Each file has .relativePath prop appended to it (e.g. "/docs/Prague/ticket_from_prague_to_ufa.pdf") if browser supports it. Otherwise it's undefined.
7
- *
8
- * @param {DataTransfer} dataTransfer
9
- * @param {Function} logDropError - a function that's called every time some folder or some file error out (e.g. because of the folder name being too long on Windows). Notice that resulting promise will always be resolved anyway.
10
- *
11
- * @returns {Promise} - Array<File>
4
+ /**
5
+ * Returns a promise that resolves to the array of dropped files (if a folder is dropped, and browser supports folder parsing - promise resolves to the flat array of all files in all directories).
6
+ * Each file has .relativePath prop appended to it (e.g. "/docs/Prague/ticket_from_prague_to_ufa.pdf") if browser supports it. Otherwise it's undefined.
7
+ *
8
+ * @param {DataTransfer} dataTransfer
9
+ * @param {Function} logDropError - a function that's called every time some folder or some file error out (e.g. because of the folder name being too long on Windows). Notice that resulting promise will always be resolved anyway.
10
+ *
11
+ * @returns {Promise} - Array<File>
12
12
  */
13
13
  export default function getDroppedFiles(dataTransfer) {
14
14
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
@@ -4,13 +4,13 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
4
4
  function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
5
5
  function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
6
6
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7
- /**
8
- * Recursive function, calls the original callback() when the directory is entirely parsed.
9
- *
10
- * @param {FileSystemDirectoryReader} directoryReader
11
- * @param {Array} oldEntries
12
- * @param {Function} logDropError
13
- * @param {Function} callback - called with ([ all files and directories in that directoryReader ])
7
+ /**
8
+ * Recursive function, calls the original callback() when the directory is entirely parsed.
9
+ *
10
+ * @param {FileSystemDirectoryReader} directoryReader
11
+ * @param {Array} oldEntries
12
+ * @param {Function} logDropError
13
+ * @param {Function} callback - called with ([ all files and directories in that directoryReader ])
14
14
  */
15
15
  export default function getFilesAndDirectoriesFromDirectory(directoryReader, oldEntries, logDropError, _ref) {
16
16
  var onSuccess = _ref.onSuccess;
@@ -1,9 +1,9 @@
1
- /**
2
- * Get the relative path from the FileEntry#fullPath, because File#webkitRelativePath is always '', at least onDrop.
3
- *
4
- * @param {FileEntry} fileEntry
5
- *
6
- * @returns {string|null} - if file is not in a folder - return null (this is to be consistent with .relativePath-s of files selected from My Device). If file is in a folder - return its fullPath, e.g. '/simpsons/hi.jpeg'.
1
+ /**
2
+ * Get the relative path from the FileEntry#fullPath, because File#webkitRelativePath is always '', at least onDrop.
3
+ *
4
+ * @param {FileEntry} fileEntry
5
+ *
6
+ * @returns {string|null} - if file is not in a folder - return null (this is to be consistent with .relativePath-s of files selected from My Device). If file is in a folder - return its fullPath, e.g. '/simpsons/hi.jpeg'.
7
7
  */
8
8
  export default function getRelativePath(fileEntry) {
9
9
  // fileEntry.fullPath - "/simpsons/hi.jpeg" or undefined (for browsers that don't support it)
@@ -5,11 +5,11 @@ export default function webkitGetAsEntryApi(dataTransfer, logDropError) {
5
5
  var files = [];
6
6
  var rootPromises = [];
7
7
 
8
- /**
9
- * Returns a resolved promise, when :files array is enhanced
10
- *
11
- * @param {(FileSystemFileEntry|FileSystemDirectoryEntry)} entry
12
- * @returns {Promise} - empty promise that resolves when :files is enhanced with a file
8
+ /**
9
+ * Returns a resolved promise, when :files array is enhanced
10
+ *
11
+ * @param {(FileSystemFileEntry|FileSystemDirectoryEntry)} entry
12
+ * @returns {Promise} - empty promise that resolves when :files is enhanced with a file
13
13
  */
14
14
  var _createPromiseToAddFileOrParseDirectory = function createPromiseToAddFileOrParseDirectory(entry) {
15
15
  return new Promise(function (resolve) {
@@ -1,8 +1,8 @@
1
- /**
2
- * Takes a full filename string and returns an object {name, extension}
3
- *
4
- * @param {string} fullFileName
5
- * @returns {object} {name, extension}
1
+ /**
2
+ * Takes a full filename string and returns an object {name, extension}
3
+ *
4
+ * @param {string} fullFileName
5
+ * @returns {object} {name, extension}
6
6
  */
7
7
  export default function getFileNameAndExtension(fullFileName, fileType) {
8
8
  var lastDot = fullFileName.lastIndexOf('.');
@@ -10,24 +10,24 @@ var DEFAULT_FILEROBOT_SUBDOMAIN_PROD = 'assets';
10
10
  var DEFAULT_FILEROBOT_SUBDOMAIN_DEV = 'assets-dev';
11
11
  var TOP_LEVEL_DOMAIN = 'com';
12
12
 
13
- /**
14
- * Ge preview url from filerobot url
15
- *
16
- * Based on documentation https://scaleflexhq.atlassian.net/wiki/spaces/DEVOPS/pages/166199297/Delivery+Filerobot+Hub+Thumbs+v3
17
- *
18
- * There are 2 cases:
19
- * 1) when there is v7 in the url
20
- * v2 https://fldytuwm.filerobot.com/v7/120049.jpg into v3 https://assets.filerobot.com/fldytuwm/120049.jpg
21
- * v2 https://cdn.scaleflex.com/cloudimage.io/checkerboard.svg?vh=938ef5 into v3 https://assets.filerobot.com/scaleflex/cloudimage.io/checkerboard.svg?vh=938ef5
22
- *
23
- * 2)when there is no v7 in the url
24
- * v2 https://fyjnhqim.filerobot.com/ganchev/test_files+doubled/01+-+StyleSense+-+Falsche+Darstellung.png?vh=2b64bd into https://assets.filerobot.com/fyjnhqim/ganchev/test_files+doubled/01+-+StyleSense+-+Falsche+Darstellung.png?vh=2b64bd
25
- * v2 https://fyjnhqim.filerobot.com/.internal/video_thumbnails/2oaTbKYAtv/20220818_112552.jpg into https://assets.filerobot.com/fyjnhqim/.internal/video_thumbnails/2oaTbKYAtv/20220818_112552.jpg
26
- *
27
- * @returns {string} -- New url based on the rules above
28
- *
29
- * @param {string} url -- Filerobot file url
30
- * @param {boolean} replaceWithAssetsToken -- was `isHubMode` that recognize whether to replace the CDN link with the assets token or not.
13
+ /**
14
+ * Ge preview url from filerobot url
15
+ *
16
+ * Based on documentation https://scaleflexhq.atlassian.net/wiki/spaces/DEVOPS/pages/166199297/Delivery+Filerobot+Hub+Thumbs+v3
17
+ *
18
+ * There are 2 cases:
19
+ * 1) when there is v7 in the url
20
+ * v2 https://fldytuwm.filerobot.com/v7/120049.jpg into v3 https://assets.filerobot.com/fldytuwm/120049.jpg
21
+ * v2 https://cdn.scaleflex.com/cloudimage.io/checkerboard.svg?vh=938ef5 into v3 https://assets.filerobot.com/scaleflex/cloudimage.io/checkerboard.svg?vh=938ef5
22
+ *
23
+ * 2)when there is no v7 in the url
24
+ * v2 https://fyjnhqim.filerobot.com/ganchev/test_files+doubled/01+-+StyleSense+-+Falsche+Darstellung.png?vh=2b64bd into https://assets.filerobot.com/fyjnhqim/ganchev/test_files+doubled/01+-+StyleSense+-+Falsche+Darstellung.png?vh=2b64bd
25
+ * v2 https://fyjnhqim.filerobot.com/.internal/video_thumbnails/2oaTbKYAtv/20220818_112552.jpg into https://assets.filerobot.com/fyjnhqim/.internal/video_thumbnails/2oaTbKYAtv/20220818_112552.jpg
26
+ *
27
+ * @returns {string} -- New url based on the rules above
28
+ *
29
+ * @param {string} url -- Filerobot file url
30
+ * @param {boolean} replaceWithAssetsToken -- was `isHubMode` that recognize whether to replace the CDN link with the assets token or not.
31
31
  */
32
32
  export default (function (_ref) {
33
33
  var _url$match;
@@ -1,7 +1,7 @@
1
- /**
2
- * Function to extract time from time stamp and convert into string as hh:mm e.g. 15:55
3
- * @param {Number} timeStamp - sets the new date by adding the provided number of days for the current date
4
- * @returns {String} - time in format HH:mm
1
+ /**
2
+ * Function to extract time from time stamp and convert into string as hh:mm e.g. 15:55
3
+ * @param {Number} timeStamp - sets the new date by adding the provided number of days for the current date
4
+ * @returns {String} - time in format HH:mm
5
5
  */
6
6
 
7
7
  export default (function (timeStamp) {
@@ -30,12 +30,12 @@ var createContainsNotQuery = function createContainsNotQuery(_ref) {
30
30
  return "".concat(valueQuery, " ").concat(extraValueQuery).trim();
31
31
  };
32
32
 
33
- /**
34
- * Generates a multi-select field query based on the metadata filter.
35
- * Docs: https://scaleflexhq.atlassian.net/wiki/spaces/FIL/pages/466452497
36
- *
37
- * @param {Object} metadataFilter - The metadata filter object.
38
- * @returns {string} - The resulting query string.
33
+ /**
34
+ * Generates a multi-select field query based on the metadata filter.
35
+ * Docs: https://scaleflexhq.atlassian.net/wiki/spaces/FIL/pages/466452497
36
+ *
37
+ * @param {Object} metadataFilter - The metadata filter object.
38
+ * @returns {string} - The resulting query string.
39
39
  */
40
40
 
41
41
  export var getMetadataMultiSelectQuery = function getMetadataMultiSelectQuery(metadataFilter) {