@uploadcare/file-uploader 1.18.0 → 1.19.0-rc.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 (199) hide show
  1. package/abstract/Block.d.ts +11 -2
  2. package/abstract/Block.d.ts.map +1 -1
  3. package/abstract/Block.js +29 -3
  4. package/abstract/CTX.d.ts +2 -2
  5. package/abstract/CTX.d.ts.map +1 -1
  6. package/abstract/CTX.js +1 -1
  7. package/abstract/SolutionBlock.d.ts +1 -1
  8. package/abstract/UploaderBlock.d.ts +3 -3
  9. package/abstract/UploaderBlock.d.ts.map +1 -1
  10. package/abstract/UploaderBlock.js +2 -3
  11. package/abstract/UploaderPublicApi.d.ts.map +1 -1
  12. package/abstract/UploaderPublicApi.js +0 -3
  13. package/abstract/l10nProcessor.js +1 -1
  14. package/abstract/{LocaleManager.d.ts → managers/LocaleManager.d.ts} +8 -8
  15. package/abstract/{LocaleManager.d.ts.map → managers/LocaleManager.d.ts.map} +1 -1
  16. package/abstract/{LocaleManager.js → managers/LocaleManager.js} +8 -8
  17. package/abstract/{ModalManager.d.ts → managers/ModalManager.d.ts} +7 -7
  18. package/abstract/{ModalManager.d.ts.map → managers/ModalManager.d.ts.map} +1 -1
  19. package/abstract/{ModalManager.js → managers/ModalManager.js} +3 -3
  20. package/abstract/managers/SecureUploadsManager.d.ts +22 -0
  21. package/abstract/{SecureUploadsManager.d.ts.map → managers/SecureUploadsManager.d.ts.map} +1 -1
  22. package/abstract/{SecureUploadsManager.js → managers/SecureUploadsManager.js} +5 -5
  23. package/abstract/managers/TelemetryManager.d.ts +65 -0
  24. package/abstract/managers/TelemetryManager.d.ts.map +1 -0
  25. package/abstract/managers/TelemetryManager.js +201 -0
  26. package/abstract/{ValidationManager.d.ts → managers/ValidationManager.d.ts} +7 -7
  27. package/abstract/{ValidationManager.d.ts.map → managers/ValidationManager.d.ts.map} +1 -1
  28. package/abstract/{ValidationManager.js → managers/ValidationManager.js} +14 -14
  29. package/abstract/{a11y.d.ts → managers/a11y.d.ts} +2 -2
  30. package/abstract/managers/a11y.d.ts.map +1 -0
  31. package/abstract/{a11y.js → managers/a11y.js} +1 -1
  32. package/blocks/CameraSource/CameraSource.d.ts +1 -1
  33. package/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts.map +1 -1
  34. package/blocks/CloudImageEditor/src/EditorCropButtonControl.js +8 -1
  35. package/blocks/CloudImageEditor/src/EditorFilterControl.d.ts.map +1 -1
  36. package/blocks/CloudImageEditor/src/EditorFilterControl.js +7 -1
  37. package/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +1 -1
  38. package/blocks/CloudImageEditor/src/EditorOperationControl.d.ts.map +1 -1
  39. package/blocks/CloudImageEditor/src/EditorOperationControl.js +9 -3
  40. package/blocks/CloudImageEditor/src/EditorToolbar.d.ts +8 -4
  41. package/blocks/CloudImageEditor/src/EditorToolbar.d.ts.map +1 -1
  42. package/blocks/CloudImageEditor/src/EditorToolbar.js +24 -4
  43. package/blocks/CloudImageEditor/src/toolbar-constants.d.ts +1 -0
  44. package/blocks/CloudImageEditor/src/toolbar-constants.d.ts.map +1 -1
  45. package/blocks/CloudImageEditor/src/toolbar-constants.js +2 -0
  46. package/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts +11 -0
  47. package/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts.map +1 -0
  48. package/blocks/CloudImageEditor/src/utils/parseFilterValue.js +11 -0
  49. package/blocks/Config/initialConfig.js +2 -2
  50. package/blocks/Config/normalizeConfigValue.js +2 -2
  51. package/blocks/DropArea/DropArea.d.ts +1 -1
  52. package/blocks/ExternalSource/ExternalSource.d.ts +1 -7
  53. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  54. package/blocks/ExternalSource/ExternalSource.js +2 -24
  55. package/blocks/ExternalSource/MessageBridge.d.ts.map +1 -1
  56. package/blocks/ExternalSource/MessageBridge.js +1 -3
  57. package/blocks/ExternalSource/types.d.ts +0 -4
  58. package/blocks/ExternalSource/types.d.ts.map +1 -1
  59. package/blocks/ExternalSource/types.js +0 -4
  60. package/blocks/FileItem/FileItem.d.ts +1 -1
  61. package/blocks/FileItem/FileItem.d.ts.map +1 -1
  62. package/blocks/FileItem/FileItem.js +16 -0
  63. package/blocks/Modal/Modal.d.ts +6 -6
  64. package/blocks/Modal/Modal.d.ts.map +1 -1
  65. package/blocks/Modal/Modal.js +10 -12
  66. package/blocks/SimpleBtn/SimpleBtn.d.ts +1 -1
  67. package/blocks/SourceBtn/SourceBtn.d.ts +1 -1
  68. package/blocks/Thumb/Thumb.d.ts +1 -1
  69. package/blocks/UploadCtxProvider/EventEmitter.d.ts +17 -4
  70. package/blocks/UploadCtxProvider/EventEmitter.d.ts.map +1 -1
  71. package/blocks/UploadCtxProvider/EventEmitter.js +14 -2
  72. package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts.map +1 -1
  73. package/blocks/UploadCtxProvider/UploadCtxProvider.js +0 -1
  74. package/blocks/UploadList/UploadList.d.ts +1 -1
  75. package/blocks/themes/uc-basic/svg-sprite.d.ts +1 -1
  76. package/blocks/themes/uc-basic/svg-sprite.d.ts.map +1 -1
  77. package/blocks/themes/uc-basic/svg-sprite.js +1 -1
  78. package/env.d.ts +1 -1
  79. package/env.js +1 -1
  80. package/index.d.ts +1 -1
  81. package/index.js +1 -1
  82. package/index.ssr.d.ts +4 -2
  83. package/index.ssr.d.ts.map +1 -1
  84. package/index.ssr.js +7 -7
  85. package/locales/file-uploader/ar.d.ts +0 -1
  86. package/locales/file-uploader/ar.js +0 -1
  87. package/locales/file-uploader/az.d.ts +0 -1
  88. package/locales/file-uploader/az.js +0 -1
  89. package/locales/file-uploader/ca.d.ts +0 -1
  90. package/locales/file-uploader/ca.js +0 -1
  91. package/locales/file-uploader/cs.d.ts +0 -1
  92. package/locales/file-uploader/cs.js +0 -1
  93. package/locales/file-uploader/da.d.ts +0 -1
  94. package/locales/file-uploader/da.js +0 -1
  95. package/locales/file-uploader/de.d.ts +0 -1
  96. package/locales/file-uploader/de.js +0 -1
  97. package/locales/file-uploader/el.d.ts +0 -1
  98. package/locales/file-uploader/el.js +0 -1
  99. package/locales/file-uploader/en.d.ts +0 -1
  100. package/locales/file-uploader/en.js +0 -1
  101. package/locales/file-uploader/es.d.ts +0 -1
  102. package/locales/file-uploader/es.js +0 -1
  103. package/locales/file-uploader/et.d.ts +0 -1
  104. package/locales/file-uploader/et.js +0 -1
  105. package/locales/file-uploader/fi.d.ts +0 -1
  106. package/locales/file-uploader/fi.js +0 -1
  107. package/locales/file-uploader/fr.d.ts +0 -1
  108. package/locales/file-uploader/fr.js +0 -1
  109. package/locales/file-uploader/he.d.ts +0 -1
  110. package/locales/file-uploader/he.js +0 -1
  111. package/locales/file-uploader/hy.d.ts +0 -1
  112. package/locales/file-uploader/hy.js +0 -1
  113. package/locales/file-uploader/is.d.ts +0 -1
  114. package/locales/file-uploader/is.js +0 -1
  115. package/locales/file-uploader/it.d.ts +0 -1
  116. package/locales/file-uploader/it.js +0 -1
  117. package/locales/file-uploader/ja.d.ts +0 -1
  118. package/locales/file-uploader/ja.js +0 -1
  119. package/locales/file-uploader/ka.d.ts +0 -1
  120. package/locales/file-uploader/ka.js +0 -1
  121. package/locales/file-uploader/kk.d.ts +0 -1
  122. package/locales/file-uploader/kk.js +0 -1
  123. package/locales/file-uploader/ko.d.ts +0 -1
  124. package/locales/file-uploader/ko.js +0 -1
  125. package/locales/file-uploader/lv.d.ts +0 -1
  126. package/locales/file-uploader/lv.js +0 -1
  127. package/locales/file-uploader/nb.d.ts +0 -1
  128. package/locales/file-uploader/nb.js +0 -1
  129. package/locales/file-uploader/nl.d.ts +0 -1
  130. package/locales/file-uploader/nl.js +0 -1
  131. package/locales/file-uploader/pl.d.ts +0 -1
  132. package/locales/file-uploader/pl.js +0 -1
  133. package/locales/file-uploader/pt.d.ts +0 -1
  134. package/locales/file-uploader/pt.js +0 -1
  135. package/locales/file-uploader/ro.d.ts +0 -1
  136. package/locales/file-uploader/ro.js +0 -1
  137. package/locales/file-uploader/ru.d.ts +0 -1
  138. package/locales/file-uploader/ru.js +0 -1
  139. package/locales/file-uploader/sk.d.ts +0 -1
  140. package/locales/file-uploader/sk.js +0 -1
  141. package/locales/file-uploader/sr.d.ts +0 -1
  142. package/locales/file-uploader/sr.js +0 -1
  143. package/locales/file-uploader/sv.d.ts +0 -1
  144. package/locales/file-uploader/sv.js +0 -1
  145. package/locales/file-uploader/tr.d.ts +0 -1
  146. package/locales/file-uploader/tr.js +0 -1
  147. package/locales/file-uploader/uk.d.ts +0 -1
  148. package/locales/file-uploader/uk.js +0 -1
  149. package/locales/file-uploader/vi.d.ts +0 -1
  150. package/locales/file-uploader/vi.js +0 -1
  151. package/locales/file-uploader/zh-TW.d.ts +0 -1
  152. package/locales/file-uploader/zh-TW.js +0 -1
  153. package/locales/file-uploader/zh.d.ts +0 -1
  154. package/locales/file-uploader/zh.js +0 -1
  155. package/package.json +5 -2
  156. package/solutions/cloud-image-editor/CloudImageEditor.d.ts +34 -0
  157. package/solutions/cloud-image-editor/CloudImageEditor.d.ts.map +1 -1
  158. package/solutions/cloud-image-editor/CloudImageEditor.js +12 -0
  159. package/solutions/file-uploader/inline/FileUploaderInline.d.ts +2 -1
  160. package/solutions/file-uploader/inline/FileUploaderInline.d.ts.map +1 -1
  161. package/solutions/file-uploader/inline/FileUploaderInline.js +4 -0
  162. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +10 -9
  163. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -1
  164. package/solutions/file-uploader/minimal/FileUploaderMinimal.js +7 -3
  165. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +2 -1
  166. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -1
  167. package/solutions/file-uploader/regular/FileUploaderRegular.js +4 -0
  168. package/types/events.d.ts +1 -1
  169. package/types/exported.d.ts +54 -61
  170. package/utils/validators/collection/validateCollectionUploadError.d.ts +2 -2
  171. package/utils/validators/collection/validateCollectionUploadError.d.ts.map +1 -1
  172. package/utils/validators/collection/validateCollectionUploadError.js +1 -1
  173. package/utils/validators/collection/validateMultiple.d.ts +2 -2
  174. package/utils/validators/collection/validateMultiple.d.ts.map +1 -1
  175. package/utils/validators/collection/validateMultiple.js +1 -1
  176. package/utils/validators/file/validateFileType.d.ts +2 -2
  177. package/utils/validators/file/validateFileType.d.ts.map +1 -1
  178. package/utils/validators/file/validateFileType.js +1 -1
  179. package/utils/validators/file/validateIsImage.d.ts +2 -2
  180. package/utils/validators/file/validateIsImage.d.ts.map +1 -1
  181. package/utils/validators/file/validateIsImage.js +1 -1
  182. package/utils/validators/file/validateMaxSizeLimit.d.ts +2 -2
  183. package/utils/validators/file/validateMaxSizeLimit.d.ts.map +1 -1
  184. package/utils/validators/file/validateMaxSizeLimit.js +1 -1
  185. package/utils/validators/file/validateUploadError.d.ts +2 -2
  186. package/utils/validators/file/validateUploadError.d.ts.map +1 -1
  187. package/utils/validators/file/validateUploadError.js +1 -1
  188. package/web/file-uploader.iife.min.js +4 -4
  189. package/web/file-uploader.min.js +4 -4
  190. package/web/uc-cloud-image-editor.min.js +4 -4
  191. package/web/uc-file-uploader-inline.min.js +4 -4
  192. package/web/uc-file-uploader-minimal.min.js +4 -4
  193. package/web/uc-file-uploader-regular.min.js +4 -4
  194. package/web/uc-img.min.js +1 -1
  195. package/abstract/SecureUploadsManager.d.ts +0 -22
  196. package/abstract/a11y.d.ts.map +0 -1
  197. package/utils/get-top-level-origin.d.ts +0 -2
  198. package/utils/get-top-level-origin.d.ts.map +0 -1
  199. package/utils/get-top-level-origin.js +0 -11
@@ -0,0 +1,201 @@
1
+ import { TelemetryAPIService } from '@uploadcare/quality-insights';
2
+
3
+ import { Queue } from '@uploadcare/upload-client';
4
+ import { PACKAGE_VERSION, PACKAGE_NAME } from '../../env.js';
5
+ import { initialConfig } from '../../blocks/Config/initialConfig.js';
6
+ import { EventType } from '../../blocks/UploadCtxProvider/EventEmitter.js';
7
+
8
+ /** @typedef {import('@uploadcare/quality-insights').TelemetryRequest & { eventTimestamp: number }} TelemetryState */
9
+
10
+ export class TelemetryManager {
11
+ /** @type {ReturnType<Crypto['randomUUID']>} */
12
+ _sessionId = crypto.randomUUID();
13
+
14
+ /** @type {TelemetryAPIService | null} */
15
+ _telemetryInstance = null;
16
+
17
+ /** @type {import('../Block.js').Block | null} */
18
+ _block = null;
19
+
20
+ _config = initialConfig;
21
+
22
+ /** @type {boolean} */
23
+ _initialized = false;
24
+
25
+ /** @type {TelemetryState | null} */
26
+ _lastPayload = null;
27
+
28
+ /** @type {import('@uploadcare/upload-client').Queue | null} */
29
+ _queue = null;
30
+
31
+ /** @param {import('../Block.js').Block} block */
32
+ constructor(block) {
33
+ this._block = block;
34
+
35
+ this._telemetryInstance = new TelemetryAPIService();
36
+
37
+ this._queue = new Queue(10);
38
+
39
+ for (const key of /** @type {(keyof import('../../types/exported').ConfigType)[]} */ (Object.keys(initialConfig))) {
40
+ block.subConfigValue(key, (value) => {
41
+ if (this._initialized && this._config[key] !== value) {
42
+ this._block?.emit(EventType.CHANGE_CONFIG, undefined);
43
+ }
44
+
45
+ this._setConfig(key, value);
46
+ });
47
+ }
48
+ }
49
+
50
+ /** @param {keyof import('../../blocks/UploadCtxProvider/EventEmitter.js').EventPayload | undefined} type */
51
+ _init(type) {
52
+ if (type === EventType.INIT_SOLUTION && !this._initialized) {
53
+ this._initialized = true;
54
+ }
55
+ }
56
+
57
+ /**
58
+ * @template {keyof import('../../types').ConfigType} T
59
+ * @param {T} key
60
+ * @param {import('../../types').ConfigType[T]} value
61
+ */
62
+ _setConfig(key, value) {
63
+ if (this._config[key] === value) {
64
+ return;
65
+ }
66
+
67
+ this._config[key] = value;
68
+ }
69
+
70
+ /**
71
+ * @param {Pick<TelemetryState, 'eventType' | 'payload' | 'config'>} body
72
+ * @returns {TelemetryState}
73
+ */
74
+ _formattingPayload(body) {
75
+ const payload = body.payload ? { ...body.payload } : {};
76
+ if (payload.activity) payload.activity = undefined;
77
+
78
+ const result = { ...body };
79
+ if (body.eventType === EventType.INIT_SOLUTION || body.eventType === EventType.CHANGE_CONFIG) {
80
+ result.config = this._config;
81
+ }
82
+
83
+ return {
84
+ ...result,
85
+
86
+ appVersion: PACKAGE_VERSION,
87
+ appName: PACKAGE_NAME,
88
+ sessionId: this._sessionId,
89
+ component: this._solution,
90
+ activity: this._activity,
91
+ projectPubkey: this._config?.pubkey,
92
+ userAgent: navigator.userAgent,
93
+ eventType: result.eventType ?? '',
94
+ eventTimestamp: this._timestamp,
95
+
96
+ payload: {
97
+ ...payload,
98
+ },
99
+ };
100
+ }
101
+
102
+ /** @param {keyof import('../../blocks/UploadCtxProvider/EventEmitter.js').EventPayload | undefined} type */
103
+ _excludedEvents(type) {
104
+ if (
105
+ type &&
106
+ [
107
+ EventType.CHANGE,
108
+ EventType.COMMON_UPLOAD_PROGRESS,
109
+ EventType.FILE_ADDED,
110
+ EventType.FILE_REMOVED,
111
+ EventType.FILE_UPLOAD_START,
112
+ EventType.FILE_UPLOAD_PROGRESS,
113
+ EventType.FILE_UPLOAD_SUCCESS,
114
+ EventType.FILE_UPLOAD_FAILED,
115
+ EventType.FILE_URL_CHANGED,
116
+ EventType.GROUP_CREATED,
117
+ ].includes(type)
118
+ ) {
119
+ return true;
120
+ }
121
+
122
+ return false;
123
+ }
124
+
125
+ /**
126
+ * @param {Partial<Pick<TelemetryState, 'eventType' | 'payload'>> & {
127
+ * modalId?: string;
128
+ * eventType?: keyof import('../../blocks/UploadCtxProvider/EventEmitter.js').EventPayload;
129
+ * }} body
130
+ */
131
+ sendEvent(body) {
132
+ const payload = this._formattingPayload(
133
+ /** @type {Pick<TelemetryState, 'eventType' | 'payload' | 'config'>} */ (body),
134
+ );
135
+
136
+ this._init(body.eventType);
137
+
138
+ const hasExcludedEvents = this._excludedEvents(body.eventType);
139
+ if (hasExcludedEvents) return null;
140
+
141
+ const hasDataSame = this._lastPayload && this._checkObj(this._lastPayload, payload);
142
+ if (hasDataSame) return null;
143
+
144
+ this._queue?.add(async () => {
145
+ this._lastPayload = payload;
146
+ await this._telemetryInstance?.sendEvent(/** @type {TelemetryState} */ (payload));
147
+ });
148
+ }
149
+
150
+ /**
151
+ * Method to send telemetry event for Cloud Image Editor.
152
+ *
153
+ * @param {MouseEvent} e
154
+ * @param {string} tabId
155
+ * @param {Record<string, unknown>} options
156
+ */
157
+ sendEventCloudImageEditor(e, tabId, options = {}) {
158
+ this.sendEvent({
159
+ payload: {
160
+ metadata: {
161
+ tabId,
162
+ node: /** @type {HTMLElement} */ (e.currentTarget)?.tagName,
163
+ event: e.type,
164
+ ...options,
165
+ },
166
+ },
167
+ });
168
+ }
169
+
170
+ /**
171
+ * Deeply compares two objects and returns true if they are equal, false otherwise.
172
+ *
173
+ * @param {any} last
174
+ * @param {any} current
175
+ */
176
+ _checkObj(last, current) {
177
+ if (JSON.stringify(last) === JSON.stringify(current)) return true;
178
+ if (typeof last !== 'object' || typeof current !== 'object' || last == null || current == null) return false;
179
+ const lastKeys = Object.keys(last);
180
+ const currentKeys = Object.keys(current);
181
+ if (lastKeys.length !== currentKeys.length) return false;
182
+ for (const key of lastKeys) {
183
+ if (!Object.prototype.hasOwnProperty.call(current, key)) return false;
184
+ if (!this._checkObj(last[key], current[key])) return false;
185
+ }
186
+
187
+ return true;
188
+ }
189
+
190
+ get _timestamp() {
191
+ return Date.now();
192
+ }
193
+
194
+ get _solution() {
195
+ return this._block?.has('*solution') ? this._block?.$['*solution'].toLowerCase() : null;
196
+ }
197
+
198
+ get _activity() {
199
+ return this._block?.has('*currentActivity') ? this._block?.$['*currentActivity'] : null;
200
+ }
201
+ }
@@ -1,16 +1,16 @@
1
1
  export class ValidationManager {
2
- /** @param {import('./UploaderBlock.js').UploaderBlock} blockInstance */
3
- constructor(blockInstance: import("./UploaderBlock.js").UploaderBlock);
2
+ /** @param {import('../UploaderBlock.js').UploaderBlock} blockInstance */
3
+ constructor(blockInstance: import("../UploaderBlock.js").UploaderBlock);
4
4
  /**
5
5
  * @private
6
- * @type {import('./UploaderBlock.js').UploaderBlock}
6
+ * @type {import('../UploaderBlock.js').UploaderBlock}
7
7
  */
8
8
  private _blockInstance;
9
9
  /** @type {FuncFileValidator[]} */
10
10
  _fileValidators: FuncFileValidator[];
11
11
  /** @type {FuncCollectionValidator[]} */
12
12
  _collectionValidators: FuncCollectionValidator[];
13
- _uploadCollection: import("./TypedCollection.js").TypedCollection<Readonly<{
13
+ _uploadCollection: import("../TypedCollection.js").TypedCollection<Readonly<{
14
14
  file: Readonly<{
15
15
  type: {
16
16
  new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
@@ -135,7 +135,7 @@ export class ValidationManager {
135
135
  runCollectionValidators(): void;
136
136
  /**
137
137
  * @private
138
- * @param {import('./TypedData.js').TypedData<typeof import('./uploadEntrySchema.js').uploadEntrySchema>} entry
138
+ * @param {import('../TypedData.js').TypedData<typeof import('../uploadEntrySchema.js').uploadEntrySchema>} entry
139
139
  */
140
140
  private _runFileValidatorsForEntry;
141
141
  /**
@@ -145,6 +145,6 @@ export class ValidationManager {
145
145
  */
146
146
  _addCustomTypeToValidators<T>(validators: T[]): T[];
147
147
  }
148
- export type FuncFileValidator = (outputEntry: import("../types").OutputFileEntry, api: import("./UploaderPublicApi.js").UploaderPublicApi) => undefined | import("../types").OutputErrorFile;
149
- export type FuncCollectionValidator = (collection: ReturnType<typeof import("./buildOutputCollectionState.js").buildOutputCollectionState<import("../types").OutputCollectionStatus>>, api: import("./UploaderPublicApi.js").UploaderPublicApi) => undefined | import("../types").OutputErrorCollection;
148
+ export type FuncFileValidator = (outputEntry: import("../../types/index.js").OutputFileEntry, api: import("../UploaderPublicApi.js").UploaderPublicApi) => undefined | import("../../types/index.js").OutputErrorFile;
149
+ export type FuncCollectionValidator = (collection: ReturnType<typeof import("../buildOutputCollectionState.js").buildOutputCollectionState<import("../../types/index.js").OutputCollectionStatus>>, api: import("../UploaderPublicApi.js").UploaderPublicApi) => undefined | import("../../types/index.js").OutputErrorCollection;
150
150
  //# sourceMappingURL=ValidationManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationManager.d.ts","sourceRoot":"","sources":["ValidationManager.js"],"names":[],"mappings":"AAkCA;IAaE,wEAAwE;IACxE,2BADY,OAAO,oBAAoB,EAAE,aAAa,EAiBrD;IA7BD;;;OAGG;IACH,uBAAe;IAEf,kCAAkC;IAClC,iBADW,iBAAiB,EAAE,CACmE;IAEjG,wCAAwC;IACxC,uBADW,uBAAuB,EAAE,CACsC;IAMxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAA6D;IAe/D,mCAAmC;IACnC,6BADY,MAAM,EAAE,QASnB;IAED,gCAqCC;IAED;;;OAGG;IACH,mCAyBC;IAED;;;;OAIG;IACH,2BAJa,CAAC,cACH,CAAC,EAAE,GACD,CAAC,EAAE,CAUf;CACF;gCAtJY,CACR,WAAW,EAAE,OAAO,UAAU,EAAE,eAAe,EAC/C,GAAG,EAAE,OAAO,wBAAwB,EAAE,iBAAiB,KACpD,SAAS,GAAG,OAAO,UAAU,EAAE,eAAe;sCAIzC,CACR,UAAU,EAAE,UAAU,CAC1B,cAAoB,iCAAiC,EAAE,0BAA0B,CACjF,OAAe,UAAU,EAAE,sBAAsB,CAC1C,CACF,EACD,GAAG,EAAE,OAAO,wBAAwB,EAAE,iBAAiB,KACpD,SAAS,GAAG,OAAO,UAAU,EAAE,qBAAqB"}
1
+ {"version":3,"file":"ValidationManager.d.ts","sourceRoot":"","sources":["ValidationManager.js"],"names":[],"mappings":"AAkCA;IAaE,yEAAyE;IACzE,2BADY,OAAO,qBAAqB,EAAE,aAAa,EAiBtD;IA7BD;;;OAGG;IACH,uBAAe;IAEf,kCAAkC;IAClC,iBADW,iBAAiB,EAAE,CACmE;IAEjG,wCAAwC;IACxC,uBADW,uBAAuB,EAAE,CACsC;IAMxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAA6D;IAe/D,mCAAmC;IACnC,6BADY,MAAM,EAAE,QASnB;IAED,gCAqCC;IAED;;;OAGG;IACH,mCAyBC;IAED;;;;OAIG;IACH,2BAJa,CAAC,cACH,CAAC,EAAE,GACD,CAAC,EAAE,CAUf;CACF;gCAtJY,CACR,WAAW,EAAE,OAAO,sBAAsB,EAAE,eAAe,EAC3D,GAAG,EAAE,OAAO,yBAAyB,EAAE,iBAAiB,KACrD,SAAS,GAAG,OAAO,sBAAsB,EAAE,eAAe;sCAIrD,CACR,UAAU,EAAE,UAAU,CAC1B,cAAoB,kCAAkC,EAAE,0BAA0B,CAClF,OAAe,sBAAsB,EAAE,sBAAsB,CACtD,CACF,EACD,GAAG,EAAE,OAAO,yBAAyB,EAAE,iBAAiB,KACrD,SAAS,GAAG,OAAO,sBAAsB,EAAE,qBAAqB"}
@@ -1,29 +1,29 @@
1
1
  // @ts-check
2
- import { EventType } from '../blocks/UploadCtxProvider/EventEmitter.js';
2
+ import { EventType } from '../../blocks/UploadCtxProvider/EventEmitter.js';
3
3
  import {
4
4
  validateIsImage,
5
5
  validateFileType,
6
6
  validateMaxSizeLimit,
7
7
  validateUploadError,
8
- } from '../utils/validators/file/index.js';
9
- import { validateMultiple, validateCollectionUploadError } from '../utils/validators/collection/index.js';
8
+ } from '../../utils/validators/file/index.js';
9
+ import { validateMultiple, validateCollectionUploadError } from '../../utils/validators/collection/index.js';
10
10
 
11
11
  /**
12
12
  * @typedef {(
13
- * outputEntry: import('../types').OutputFileEntry,
14
- * api: import('./UploaderPublicApi.js').UploaderPublicApi,
15
- * ) => undefined | import('../types').OutputErrorFile} FuncFileValidator
13
+ * outputEntry: import('../../types/index.js').OutputFileEntry,
14
+ * api: import('../UploaderPublicApi.js').UploaderPublicApi,
15
+ * ) => undefined | import('../../types/index.js').OutputErrorFile} FuncFileValidator
16
16
  */
17
17
 
18
18
  /**
19
19
  * @typedef {(
20
20
  * collection: ReturnType<
21
- * typeof import('./buildOutputCollectionState.js').buildOutputCollectionState<
22
- * import('../types').OutputCollectionStatus
21
+ * typeof import('../buildOutputCollectionState.js').buildOutputCollectionState<
22
+ * import('../../types/index.js').OutputCollectionStatus
23
23
  * >
24
24
  * >,
25
- * api: import('./UploaderPublicApi.js').UploaderPublicApi,
26
- * ) => undefined | import('../types').OutputErrorCollection} FuncCollectionValidator
25
+ * api: import('../UploaderPublicApi.js').UploaderPublicApi,
26
+ * ) => undefined | import('../../types/index.js').OutputErrorCollection} FuncCollectionValidator
27
27
  */
28
28
 
29
29
  const LOGGER = {
@@ -35,7 +35,7 @@ const LOGGER = {
35
35
  export class ValidationManager {
36
36
  /**
37
37
  * @private
38
- * @type {import('./UploaderBlock.js').UploaderBlock}
38
+ * @type {import('../UploaderBlock.js').UploaderBlock}
39
39
  */
40
40
  _blockInstance;
41
41
 
@@ -45,7 +45,7 @@ export class ValidationManager {
45
45
  /** @type {FuncCollectionValidator[]} */
46
46
  _collectionValidators = [validateMultiple, validateCollectionUploadError];
47
47
 
48
- /** @param {import('./UploaderBlock.js').UploaderBlock} blockInstance */
48
+ /** @param {import('../UploaderBlock.js').UploaderBlock} blockInstance */
49
49
  constructor(blockInstance) {
50
50
  this._blockInstance = blockInstance;
51
51
 
@@ -106,7 +106,7 @@ export class ValidationManager {
106
106
  this._blockInstance.emit(
107
107
  EventType.COMMON_UPLOAD_FAILED,
108
108
  () =>
109
- /** @type {import('../types').OutputCollectionState<'failed'>} */ (
109
+ /** @type {import('../../types/index.js').OutputCollectionState<'failed'>} */ (
110
110
  this._blockInstance.api.getOutputCollectionState()
111
111
  ),
112
112
  { debounce: true },
@@ -116,7 +116,7 @@ export class ValidationManager {
116
116
 
117
117
  /**
118
118
  * @private
119
- * @param {import('./TypedData.js').TypedData<typeof import('./uploadEntrySchema.js').uploadEntrySchema>} entry
119
+ * @param {import('../TypedData.js').TypedData<typeof import('../uploadEntrySchema.js').uploadEntrySchema>} entry
120
120
  */
121
121
  _runFileValidatorsForEntry(entry) {
122
122
  const outputEntry = this._blockInstance.api.getOutputItem(entry.uid);
@@ -9,8 +9,8 @@ export class A11y {
9
9
  * @type {ScopedMinimalWindow}
10
10
  */
11
11
  private _scopedWindow;
12
- /** @param {import('./Block.js').Block} scope */
13
- registerBlock(scope: import("./Block.js").Block): void;
12
+ /** @param {import('../Block.js').Block} scope */
13
+ registerBlock(scope: import("../Block.js").Block): void;
14
14
  destroy(): void;
15
15
  }
16
16
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["a11y.js"],"names":[],"mappings":"AAqFA;IACE;;;OAGG;IACH,sBAAc;IAEd;;;OAGG;IACH,sBAAc;IAYd,iDAAiD;IACjD,qBADY,OAAO,aAAa,EAAE,KAAK,QAGtC;IAED,gBAGC;CACF;;;;4BA/GY,UAAU,CAAC,OAAO,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC"}
@@ -106,7 +106,7 @@ export class A11y {
106
106
  ]);
107
107
  }
108
108
 
109
- /** @param {import('./Block.js').Block} scope */
109
+ /** @param {import('../Block.js').Block} scope */
110
110
  registerBlock(scope) {
111
111
  this._scopedWindow.registerScope(scope);
112
112
  }
@@ -68,7 +68,7 @@ export class CameraSource extends UploaderBlock {
68
68
  '*collectionState': import("../../index.js").OutputCollectionState | null;
69
69
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
70
70
  '*uploadTrigger': Set<string>;
71
- '*secureUploadsManager': import("../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
71
+ '*secureUploadsManager': import("../../abstract/managers/SecureUploadsManager.js").SecureUploadsManager | null;
72
72
  '*currentActivity': null;
73
73
  '*currentActivityParams': {};
74
74
  '*history': never[];
@@ -1 +1 @@
1
- {"version":3,"file":"EditorCropButtonControl.d.ts","sourceRoot":"","sources":["EditorCropButtonControl.js"],"names":[],"mappings":"AAkBA;IASM,eAAe;IACf,mBAA2B;CAehC;oCA3CmC,0BAA0B"}
1
+ {"version":3,"file":"EditorCropButtonControl.d.ts","sourceRoot":"","sources":["EditorCropButtonControl.js"],"names":[],"mappings":"AAkBA;IASM,eAAe;IACf,mBAA2B;CAsBhC;oCAlDmC,0BAA0B"}
@@ -35,9 +35,16 @@ export class EditorCropButtonControl extends EditorButtonControl {
35
35
  );
36
36
  });
37
37
 
38
- this.$['on.click'] = () => {
38
+ this.$['on.click'] = (e) => {
39
39
  let prev = this.$['*cropperEl'].getValue(this._operation);
40
40
  let next = nextValue(this._operation, prev);
41
+
42
+ this.telemetryManager.sendEventCloudImageEditor(e, this.$['*tabId'], {
43
+ operation: this._operation,
44
+ next,
45
+ prev,
46
+ });
47
+
41
48
  this.$['*cropperEl'].setValue(this._operation, next);
42
49
  };
43
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EditorFilterControl.d.ts","sourceRoot":"","sources":["EditorFilterControl.js"],"names":[],"mappings":"AAOA;IAeE,sBA2BC;IAED;;;OAGG;IACH,2BAHW,yBAAyB,EAAE,YAC3B,oBAAoB,iBAuB9B;IAfG,yCAA4B;IAoC1B,+BAA0B;IAC1B,4BAAqB;IAYzB,4CAEE;IAGF,kBAA+B;CAgDlC;;;;oCAjKmC,0BAA0B"}
1
+ {"version":3,"file":"EditorFilterControl.d.ts","sourceRoot":"","sources":["EditorFilterControl.js"],"names":[],"mappings":"AAQA;IAeE,sBA2BC;IAED;;;OAGG;IACH,2BAHW,yBAAyB,EAAE,YAC3B,oBAAoB,iBAuB9B;IAfG,yCAA4B;IAyC1B,+BAA0B;IAC1B,4BAAqB;IAYzB,4CAEE;IAGF,kBAA+B;CAgDlC;;;;oCAvKmC,0BAA0B"}
@@ -4,6 +4,7 @@ import { EditorButtonControl } from './EditorButtonControl.js';
4
4
  import { FAKE_ORIGINAL_FILTER } from './EditorSlider.js';
5
5
  import { COMMON_OPERATIONS, transformationsToOperations } from './lib/transformationUtils.js';
6
6
  import { preloadImage } from '../../utils/preloadImage.js';
7
+ import { parseFilterValue } from './utils/parseFilterValue.js';
7
8
 
8
9
  export class EditorFilterControl extends EditorButtonControl {
9
10
  constructor() {
@@ -79,7 +80,8 @@ export class EditorFilterControl extends EditorButtonControl {
79
80
  initCallback() {
80
81
  super.initCallback();
81
82
 
82
- this.$['on.click'] = () => {
83
+ /** @param {MouseEvent} e */
84
+ this.$['on.click'] = (e) => {
83
85
  if (!this.$.active) {
84
86
  this.$['*sliderEl'].setOperation(this._operation, this._filter);
85
87
  this.$['*sliderEl'].apply();
@@ -88,6 +90,10 @@ export class EditorFilterControl extends EditorButtonControl {
88
90
  this.$['*showSlider'] = true;
89
91
  }
90
92
 
93
+ this.telemetryManager.sendEventCloudImageEditor(e, this.$['*tabId'], {
94
+ operation: parseFilterValue(this.$['*operationTooltip']),
95
+ });
96
+
91
97
  this.$['*currentFilter'] = this._filter;
92
98
  };
93
99
 
@@ -1,7 +1,7 @@
1
1
  export class EditorOperationControl extends EditorButtonControl {
2
2
  /**
3
3
  * @private
4
- * @type {String}
4
+ * @type {import('./toolbar-constants.js').ColorOperation | ''}
5
5
  */
6
6
  private _operation;
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EditorOperationControl.d.ts","sourceRoot":"","sources":["EditorOperationControl.js"],"names":[],"mappings":"AAGA;IACE;;;OAGG;IACH,mBAAgB;CAmCjB;oCA3CmC,0BAA0B"}
1
+ {"version":3,"file":"EditorOperationControl.d.ts","sourceRoot":"","sources":["EditorOperationControl.js"],"names":[],"mappings":"AAKA;IACE;;;OAGG;IACH,mBAAgB;CAuCjB;oCAhDmC,0BAA0B"}
@@ -1,23 +1,29 @@
1
+ //@ts-check
1
2
  import { EditorButtonControl } from './EditorButtonControl.js';
2
3
  import { COLOR_OPERATIONS_CONFIG } from './toolbar-constants.js';
4
+ import { parseFilterValue } from './utils/parseFilterValue.js';
3
5
 
4
6
  export class EditorOperationControl extends EditorButtonControl {
5
7
  /**
6
8
  * @private
7
- * @type {String}
9
+ * @type {import('./toolbar-constants.js').ColorOperation | ''}
8
10
  */
9
11
  _operation = '';
10
12
 
11
13
  initCallback() {
12
14
  super.initCallback();
13
15
 
14
- this.$['on.click'] = (e) => {
16
+ this.$['on.click'] = (/** @type {MouseEvent} */ e) => {
15
17
  this.$['*sliderEl'].setOperation(this._operation);
16
18
  this.$['*showSlider'] = true;
17
19
  this.$['*currentOperation'] = this._operation;
20
+
21
+ this.telemetryManager.sendEventCloudImageEditor(e, this.$['*tabId'], {
22
+ operation: parseFilterValue(this.$['*operationTooltip']),
23
+ });
18
24
  };
19
25
 
20
- this.defineAccessor('operation', (operation) => {
26
+ this.defineAccessor('operation', (/** @type {import('./toolbar-constants.js').ColorOperation} */ operation) => {
21
27
  if (operation) {
22
28
  this._operation = operation;
23
29
  this.$['icon'] = operation;
@@ -40,10 +40,14 @@ export class EditorToolbar extends Block {
40
40
  hidden: string;
41
41
  visible: string;
42
42
  };
43
- 'on.cancel': () => void;
44
- 'on.apply': () => void;
45
- 'on.applySlider': () => void;
46
- 'on.cancelSlider': () => void;
43
+ /** @param {MouseEvent} e */
44
+ 'on.cancel': (e: MouseEvent) => void;
45
+ /** @param {MouseEvent} e */
46
+ 'on.apply': (e: MouseEvent) => void;
47
+ /** @param {MouseEvent} e */
48
+ 'on.applySlider': (e: MouseEvent) => void;
49
+ /** @param {MouseEvent} e */
50
+ 'on.cancelSlider': (e: MouseEvent) => void;
47
51
  /** @param {MouseEvent} e */
48
52
  'on.clickTab': (e: MouseEvent) => void;
49
53
  tab_role: string;
@@ -1 +1 @@
1
- {"version":3,"file":"EditorToolbar.d.ts","sourceRoot":"","sources":["EditorToolbar.js"],"names":[],"mappings":"AA2DA;IAII;;QAGE,qDAAqD;8BAA1C,OAAO,YAAY,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuDjD,4BAA4B;2BAAhB,UAAU;;;;;;;MAgBvB;IAED,eAAe;IAEf,6BAAsE;IAGxE,eAAe;IACf,uBAKC;IAED;;;OAGG;IACH,gCAKC;IAED;;;OAGG;IACH,6BAKC;IAED;;;OAGG;IACH,6BAKC;IAED;;;OAGG;IACH,4BAoCC;IAED;;;;OAIG;IACH,qBAyBC;IAED;;;OAGG;IACH,4BAKC;IAED,eAAe;IACf,0BAIC;IAED,eAAe;IACf,4BAWC;IALG,oBAGC;IAIL;;;OAGG;IACH,oBAEC;IAED;;MAwBM;CAqFP;;;;sBAtZqB,4BAA4B"}
1
+ {"version":3,"file":"EditorToolbar.d.ts","sourceRoot":"","sources":["EditorToolbar.js"],"names":[],"mappings":"AA4DA;IAII;;QAGE,qDAAqD;8BAA1C,OAAO,YAAY,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwCjD,4BAA4B;yBAAhB,UAAU;QAStB,4BAA4B;wBAAhB,UAAU;QAOtB,4BAA4B;8BAAhB,UAAU;QAStB,4BAA4B;+BAAhB,UAAU;QAQtB,4BAA4B;2BAAhB,UAAU;;;;;;;MAiBvB;IAED,eAAe;IAEf,6BAAsE;IAGxE,eAAe;IACf,uBAKC;IAED;;;OAGG;IACH,gCAKC;IAED;;;OAGG;IACH,6BAKC;IAED;;;OAGG;IACH,6BAKC;IAED;;;OAGG;IACH,4BAoCC;IAED;;;;OAIG;IACH,qBAyBC;IAED;;;OAGG;IACH,4BAKC;IAED,eAAe;IACf,0BAIC;IAED,eAAe;IACf,4BAWC;IALG,oBAGC;IAIL;;;OAGG;IACH,oBAEC;IAED;;MAwBM;CAqFP;;;;sBA1aqB,4BAA4B"}
@@ -15,6 +15,7 @@ import {
15
15
  TabId,
16
16
  } from './toolbar-constants.js';
17
17
  import { viewerImageSrc } from './util.js';
18
+ import { parseFilterValue } from './utils/parseFilterValue.js';
18
19
 
19
20
  /** @param {String} id */
20
21
  function renderTabToggle(id) {
@@ -104,18 +105,36 @@ export class EditorToolbar extends Block {
104
105
  hidden: 'uc-tab-toggles--hidden',
105
106
  visible: 'uc-tab-toggles--visible',
106
107
  },
107
- 'on.cancel': () => {
108
+ /** @param {MouseEvent} e */
109
+ 'on.cancel': (e) => {
110
+ this.telemetryManager.sendEventCloudImageEditor(e, this.$['*tabId'], {
111
+ action: 'cancel',
112
+ });
113
+
108
114
  this._cancelPreload?.();
109
115
  this.$['*on.cancel']();
110
116
  },
111
- 'on.apply': () => {
117
+ /** @param {MouseEvent} e */
118
+ 'on.apply': (e) => {
119
+ this.telemetryManager.sendEventCloudImageEditor(e, this.$['*tabId'], {
120
+ action: 'apply',
121
+ });
112
122
  this.$['*on.apply'](this.$['*editorTransformations']);
113
123
  },
114
- 'on.applySlider': () => {
124
+ /** @param {MouseEvent} e */
125
+ 'on.applySlider': (e) => {
126
+ this.telemetryManager.sendEventCloudImageEditor(e, this.$['*tabId'], {
127
+ action: 'apply-slider',
128
+ operation: parseFilterValue(this.$['*operationTooltip']),
129
+ });
115
130
  this.ref['slider-el'].apply();
116
131
  this._onSliderClose();
117
132
  },
118
- 'on.cancelSlider': () => {
133
+ /** @param {MouseEvent} e */
134
+ 'on.cancelSlider': (e) => {
135
+ this.telemetryManager.sendEventCloudImageEditor(e, this.$['*tabId'], {
136
+ action: 'cancel-slider',
137
+ });
119
138
  this.ref['slider-el'].cancel();
120
139
  this._onSliderClose();
121
140
  },
@@ -123,6 +142,7 @@ export class EditorToolbar extends Block {
123
142
  'on.clickTab': (e) => {
124
143
  const id = /** @type {HTMLElement} */ (e.currentTarget).getAttribute('data-id');
125
144
  if (id) {
145
+ this.telemetryManager.sendEventCloudImageEditor(e, id);
126
146
  this._activateTab(id, { fromViewer: false });
127
147
  }
128
148
  },
@@ -55,4 +55,5 @@ export const COLOR_OPERATIONS_CONFIG: Readonly<{
55
55
  keypointsNumber: number;
56
56
  };
57
57
  }>;
58
+ export type ColorOperation = keyof typeof COLOR_OPERATIONS_CONFIG;
58
59
  //# sourceMappingURL=toolbar-constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar-constants.d.ts","sourceRoot":"","sources":["toolbar-constants.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,yDAAkE;AAElE,4CASE;AAEF,mCAyCE;AAEF,2CAAgE;AAEhE,iGAAiG;AACjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG"}
1
+ {"version":3,"file":"toolbar-constants.d.ts","sourceRoot":"","sources":["toolbar-constants.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,yDAAkE;AAElE,4CASE;AAEF,mCAyCE;AAEF,2CAAgE;AAEhE,iGAAiG;AACjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;6BAEW,MAAM,OAAO,uBAAuB"}
@@ -112,3 +112,5 @@ export const COLOR_OPERATIONS_CONFIG = Object.freeze({
112
112
  keypointsNumber: 1,
113
113
  },
114
114
  });
115
+
116
+ /** @typedef {keyof typeof COLOR_OPERATIONS_CONFIG} ColorOperation */
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Parses a string like "iothari 100" into an object { filter: "iothari", value: 100 }
3
+ *
4
+ * @param {string} str
5
+ * @returns {{ filter: string; value: number } | null}
6
+ */
7
+ export function parseFilterValue(str: string): {
8
+ filter: string;
9
+ value: number;
10
+ } | null;
11
+ //# sourceMappingURL=parseFilterValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseFilterValue.d.ts","sourceRoot":"","sources":["parseFilterValue.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sCAHW,MAAM,GACJ;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAMpD"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Parses a string like "iothari 100" into an object { filter: "iothari", value: 100 }
3
+ *
4
+ * @param {string} str
5
+ * @returns {{ filter: string; value: number } | null}
6
+ */
7
+ export function parseFilterValue(str) {
8
+ const match = str.match(/^(\w+)\s+(\d+)$/);
9
+ if (!match) return null;
10
+ return { filter: match[1], value: Number(match[2]) };
11
+ }
@@ -23,7 +23,6 @@ export const initialConfig = {
23
23
  cameraMirror: false,
24
24
  cameraCapture: '',
25
25
  sourceList: 'local, url, camera, dropbox, gdrive',
26
- topLevelOrigin: '',
27
26
  cloudImageEditorTabs: serializeCsv(ALL_TABS),
28
27
  maxLocalFileSizeBytes: 0,
29
28
  thumbSize: 76,
@@ -47,7 +46,6 @@ export const initialConfig = {
47
46
  secureExpire: '',
48
47
  secureDeliveryProxy: '',
49
48
  retryThrottledRequestMaxTimes: 10,
50
- retryNetworkErrorMaxTimes: 3,
51
49
  multipartMinFileSize: 26214400,
52
50
  multipartChunkSize: 5242880,
53
51
  maxConcurrentRequests: 10,
@@ -84,4 +82,6 @@ export const initialConfig = {
84
82
  cloudImageEditorMaskHref: null,
85
83
 
86
84
  testMode: false,
85
+
86
+ qualityInsights: true,
87
87
  };
@@ -38,7 +38,6 @@ const mapping = {
38
38
  cameraMirror: asBoolean,
39
39
  cameraCapture: asCameraCapture,
40
40
  sourceList: asString,
41
- topLevelOrigin: asString,
42
41
  maxLocalFileSizeBytes: asNumber,
43
42
  thumbSize: asNumber,
44
43
  showEmptyList: asBoolean,
@@ -62,7 +61,6 @@ const mapping = {
62
61
  secureExpire: asString,
63
62
  secureDeliveryProxy: asString,
64
63
  retryThrottledRequestMaxTimes: asNumber,
65
- retryNetworkErrorMaxTimes: asNumber,
66
64
  multipartMinFileSize: asNumber,
67
65
  multipartChunkSize: asNumber,
68
66
  maxConcurrentRequests: asNumber,
@@ -102,6 +100,8 @@ const mapping = {
102
100
  cloudImageEditorMaskHref: asString,
103
101
 
104
102
  testMode: asBoolean,
103
+
104
+ qualityInsights: asBoolean,
105
105
  };
106
106
 
107
107
  /**