@uploadcare/file-uploader 1.14.0 → 1.15.0-alpha.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 (67) hide show
  1. package/abstract/ActivityBlock.d.ts.map +1 -1
  2. package/abstract/ActivityBlock.js +10 -15
  3. package/abstract/Block.d.ts +6 -0
  4. package/abstract/Block.d.ts.map +1 -1
  5. package/abstract/Block.js +15 -0
  6. package/abstract/CTX.d.ts.map +1 -1
  7. package/abstract/CTX.js +3 -1
  8. package/abstract/ModalManager.d.ts +113 -0
  9. package/abstract/ModalManager.d.ts.map +1 -0
  10. package/abstract/ModalManager.js +220 -0
  11. package/abstract/UploaderBlock.d.ts.map +1 -1
  12. package/abstract/UploaderBlock.js +1 -8
  13. package/abstract/UploaderPublicApi.d.ts.map +1 -1
  14. package/abstract/UploaderPublicApi.js +12 -7
  15. package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  16. package/blocks/CameraSource/CameraSource.js +1 -0
  17. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts.map +1 -1
  18. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.js +2 -0
  19. package/blocks/Config/Config.d.ts +1 -1
  20. package/blocks/Config/Config.d.ts.map +1 -1
  21. package/blocks/Config/initialConfig.d.ts.map +1 -1
  22. package/blocks/Config/initialConfig.js +3 -0
  23. package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
  24. package/blocks/Config/normalizeConfigValue.js +4 -0
  25. package/blocks/DropArea/DropArea.d.ts.map +1 -1
  26. package/blocks/DropArea/DropArea.js +2 -1
  27. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  28. package/blocks/ExternalSource/ExternalSource.js +3 -1
  29. package/blocks/FileItem/FileItem.d.ts +2 -0
  30. package/blocks/FileItem/FileItem.d.ts.map +1 -1
  31. package/blocks/FileItem/FileItem.js +18 -3
  32. package/blocks/FileItem/file-item.css +60 -0
  33. package/blocks/Modal/Modal.d.ts.map +1 -1
  34. package/blocks/Modal/Modal.js +28 -17
  35. package/blocks/SourceBtn/SourceBtn.d.ts +4 -1
  36. package/blocks/SourceBtn/SourceBtn.d.ts.map +1 -1
  37. package/blocks/SourceBtn/SourceBtn.js +5 -1
  38. package/blocks/StartFrom/StartFrom.js +1 -1
  39. package/blocks/UploadList/UploadList.d.ts.map +1 -1
  40. package/blocks/UploadList/UploadList.js +14 -1
  41. package/blocks/UploadList/upload-list.css +22 -0
  42. package/blocks/UrlSource/UrlSource.d.ts.map +1 -1
  43. package/blocks/UrlSource/UrlSource.js +1 -0
  44. package/blocks/themes/uc-basic/theme.css +13 -0
  45. package/index.ssr.d.ts.map +1 -1
  46. package/index.ssr.js +16 -3
  47. package/package.json +4 -2
  48. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -1
  49. package/solutions/file-uploader/minimal/FileUploaderMinimal.js +23 -0
  50. package/solutions/file-uploader/minimal/index.css +20 -1
  51. package/solutions/file-uploader/minimal/index.d.ts +3 -0
  52. package/solutions/file-uploader/minimal/index.js +5 -0
  53. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +2 -2
  54. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -1
  55. package/solutions/file-uploader/regular/FileUploaderRegular.js +16 -1
  56. package/types/exported.d.ts +4 -0
  57. package/web/file-uploader.iife.min.js +4 -4
  58. package/web/file-uploader.min.js +4 -4
  59. package/web/uc-basic.min.css +1 -1
  60. package/web/uc-cloud-image-editor.min.css +1 -1
  61. package/web/uc-cloud-image-editor.min.js +4 -4
  62. package/web/uc-file-uploader-inline.min.css +1 -1
  63. package/web/uc-file-uploader-inline.min.js +4 -4
  64. package/web/uc-file-uploader-minimal.min.css +1 -1
  65. package/web/uc-file-uploader-minimal.min.js +4 -3
  66. package/web/uc-file-uploader-regular.min.css +1 -1
  67. package/web/uc-file-uploader-regular.min.js +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"ActivityBlock.d.ts","sourceRoot":"","sources":["ActivityBlock.js"],"names":[],"mappings":"AASA;;;;;GAKG;AAEH;IA4FE;;;;;;OAMG;IACH,kCAAsC;IAlGtC,iBAAiB;IACjB,kCAAuB;IAEvB;;;;;;MAA+B;IAE/B;;MAAqE;IAErE,eAAe;IACf,oBAKC;IAED,eAAe;IACf,kBAaC;IA2CD,eAAe;IACf,sBAWC;IAED,eAAe;IACf,8BAEC;IAWD,4CAEC;IAED,iCAEC;IAED;;;;;;;OAOG;IACH;4BAHiB,IAAI;8BACJ,IAAI;yBAQpB;IAED,2BAKC;IAoBD,0BAEC;IAED,yDAAyD;IACzD,oLAEC;IAED,qBAAqB;IACrB,2BAEC;IAED,qBAAqB;IACrB,2BAEC;IAED,oBAoBC;IAlLC,8CAAyB;CAmL5B;;;;;;;;;;;;gCApMY;IACZ,kBAAsB,EAAE,OAAO,gEAAgE,EAAE,cAAc,CAAC;IAChH,UAAc,OAAO,4CAA4C,EAAE,cAAc,CAAC;CAC/E;qCA6MU,CAAC,oBAAoB,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,YAAY,CAAC,CAAC;2BAChF,sBAAsB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,IAAI;sBAxNrC,YAAY"}
1
+ {"version":3,"file":"ActivityBlock.d.ts","sourceRoot":"","sources":["ActivityBlock.js"],"names":[],"mappings":"AASA;;;;;GAKG;AAEH;IA+EE;;;;;;OAMG;IACH,kCAAsC;IArFtC,iBAAiB;IACjB,kCAAuB;IAEvB;;;;;;MAA+B;IAE/B;;MAAqE;IAErE,eAAe;IACf,oBAKC;IAED,eAAe;IACf,kBAaC;IA8BD,eAAe;IACf,sBAWC;IAED,eAAe;IACf,8BAEC;IAWD,4CAEC;IAED,iCAEC;IAED;;;;;;;OAOG;IACH;4BAHiB,IAAI;8BACJ,IAAI;yBAQpB;IAED,2BAKC;IAoBD,0BAEC;IAED,yDAAyD;IACzD,oLAEC;IAED,qBAAqB;IACrB,2BAEC;IAED,qBAAqB;IACrB,2BAEC;IAED,oBA4BC;IA7KC,8CAAyB;CA8K5B;;;;;;;;;;;;gCA/LY;IACZ,kBAAsB,EAAE,OAAO,gEAAgE,EAAE,cAAc,CAAC;IAChH,UAAc,OAAO,4CAA4C,EAAE,cAAc,CAAC;CAC/E;qCAwMU,CAAC,oBAAoB,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,YAAY,CAAC,CAAC;2BAChF,sBAAsB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,IAAI;sBAnNrC,YAAY"}
@@ -49,11 +49,6 @@ export class ActivityBlock extends Block {
49
49
  /** @protected */
50
50
  initCallback() {
51
51
  super.initCallback();
52
- if (this.hasAttribute('current-activity')) {
53
- this.sub('*currentActivity', (/** @type {String} */ val) => {
54
- this.setAttribute('current-activity', val);
55
- });
56
- }
57
52
 
58
53
  // TODO: rename activityType to activityId
59
54
  if (this.activityType) {
@@ -76,14 +71,6 @@ export class ActivityBlock extends Block {
76
71
  this.$['*history'] = [];
77
72
  }
78
73
  });
79
-
80
- if (this.has('*modalActive')) {
81
- this.sub('*modalActive', (modalActive) => {
82
- if (!modalActive && this.activityType === this.$['*currentActivity']) {
83
- this.$['*currentActivity'] = null;
84
- }
85
- });
86
- }
87
74
  }
88
75
  }
89
76
 
@@ -160,7 +147,7 @@ export class ActivityBlock extends Block {
160
147
 
161
148
  if (!hasCurrentActivityInCtx) {
162
149
  this.$['*currentActivity'] = null;
163
- this.setOrAddState('*modalActive', false);
150
+ // this.setOrAddState('*modalActive', false);
164
151
  }
165
152
  }
166
153
 
@@ -186,21 +173,29 @@ export class ActivityBlock extends Block {
186
173
  historyBack() {
187
174
  /** @type {String[]} */
188
175
  let history = this.$['*history'];
176
+
189
177
  if (history) {
190
178
  let nextActivity = history.pop();
179
+
191
180
  while (nextActivity === this.activityType) {
192
181
  nextActivity = history.pop();
193
182
  }
183
+
194
184
  let couldOpenActivity = !!nextActivity;
195
185
  if (nextActivity) {
196
186
  const nextActivityBlock = [...this.blocksRegistry].find((block) => block.activityType === nextActivity);
197
187
  couldOpenActivity = /** @type {ActivityBlock} */ (nextActivityBlock)?.couldOpenActivity ?? false;
198
188
  }
189
+
199
190
  nextActivity = couldOpenActivity ? nextActivity : undefined;
191
+
192
+ if (nextActivity) this.modalManager.open(nextActivity);
193
+
200
194
  this.$['*currentActivity'] = nextActivity;
201
195
  this.$['*history'] = history;
196
+
202
197
  if (!nextActivity) {
203
- this.setOrAddState('*modalActive', false);
198
+ this.modalManager.closeAll();
204
199
  }
205
200
  }
206
201
  }
@@ -58,6 +58,11 @@ export class Block extends BaseComponent<any> {
58
58
  * @param {any} newVal
59
59
  */
60
60
  setOrAddState(prop: string, newVal: any): void;
61
+ /**
62
+ * @returns {ModalManager}
63
+ * @public
64
+ */
65
+ public get modalManager(): ModalManager;
61
66
  /**
62
67
  * @private
63
68
  * @returns {LocaleManager | null}
@@ -97,5 +102,6 @@ export class Block extends BaseComponent<any> {
97
102
  }
98
103
  export { BaseComponent };
99
104
  import { BaseComponent } from '@symbiotejs/symbiote';
105
+ import { ModalManager } from './ModalManager.js';
100
106
  import { A11y } from './a11y.js';
101
107
  //# sourceMappingURL=Block.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Block.d.ts","sourceRoot":"","sources":["Block.js"],"names":[],"mappings":"AAmBA;IACE,4BAA4B;IAC5B,2BADW,MAAM,GAAG,IAAI,CACS;IAEjC,uBAAuB;IACvB,mBADW,MAAM,EAAE,CACI;IAsTvB,6BAA6B;IAC7B,4CAQC;IA3QD,cAMC;IAxDD,iBAAiB;IACjB,kCAAuB;IAEvB,wDAAwD;IACxD,cADW,OAAO,oBAAoB,EAAE,YAAY,CAChC;IAEpB,UAAmB;IAEnB;;;;OAIG;IACH;;eAcC;IAED;;;;;OAKG;IACH,kBAIC;IAED;;;;OAIG;IACH,wBAJW,MAAM,YACN,MAAM,IAAI,QAKpB;I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qBAAuF,CAAC,CAAC,YACzF;;qBAAuF,CAAC,CAAC,QASnG;IAED;;;OAGG;IACH,gCAHmB,KAAK,KAAK,OAAO,WAUnC;IAED;;;OAGG;IACH,oCAFW,GAAG,QASb;IAsED;;;OAGG;IACH,wCAEC;IAED;;;OAGG;IACH,4BAEC;IAED;;;OAGG;IACH,kCAEC;IAED,yBAAyB;IACzB,iCAEC;IAwBD;;;;OAIG;IACH,qCAMC;IAED;;;;OAIG;IACH,iCAHa,eAAe,CA6B3B;IAED,iDAAiD;IACjD,yCA8BC;IA3BG,eAAe;IACf,mBAuBE;IAKN;;;;OAIG;IACH,6HAFwD,IAAI,QAQ3D;IAED,8BAA8B;IAC9B,oBADY,OAAO,EAAE,QAWpB;CAYF;;8BAtWmC,sBAAsB;6BAc7B,mBAAmB;qBAD3B,WAAW"}
package/abstract/Block.js CHANGED
@@ -13,6 +13,7 @@ import { LocaleManager, localeStateKey } from './LocaleManager.js';
13
13
  import { l10nProcessor } from './l10nProcessor.js';
14
14
  import { sharedConfigKey } from './sharedConfigKey.js';
15
15
  import { A11y } from './a11y.js';
16
+ import { ModalManager } from './ModalManager.js';
16
17
 
17
18
  const TAG_PREFIX = 'uc-';
18
19
 
@@ -180,12 +181,24 @@ export class Block extends BaseComponent {
180
181
  this.add('*a11y', new A11y());
181
182
  }
182
183
 
184
+ if (!this.has('*modalManager')) {
185
+ this.add('*modalManager', new ModalManager(this));
186
+ }
187
+
183
188
  this.sub(localeStateKey('locale-id'), (localeId) => {
184
189
  const direction = getLocaleDirection(localeId);
185
190
  this.style.direction = direction === 'ltr' ? '' : direction;
186
191
  });
187
192
  }
188
193
 
194
+ /**
195
+ * @returns {ModalManager}
196
+ * @public
197
+ */
198
+ get modalManager() {
199
+ return this.has('*modalManager') && this.$['*modalManager'];
200
+ }
201
+
189
202
  /**
190
203
  * @private
191
204
  * @returns {LocaleManager | null}
@@ -238,6 +251,8 @@ export class Block extends BaseComponent {
238
251
  Data.deleteCtx(this.ctxName);
239
252
 
240
253
  this.localeManager?.destroy();
254
+
255
+ this.modalManager?.destroy();
241
256
  }
242
257
 
243
258
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CTX.d.ts","sourceRoot":"","sources":["CTX.js"],"names":[],"mappings":"AAGO,+BAA2B;AAG3B,wCADK,OAAO,SAAS,EAAE,KAAK;;;;;;EAajC;AAGK,wCADK,OAAO,SAAS,EAAE,KAAK;;;;IAMjC,qEAAqE;yBAA1D,WAAW,OAAO,UAAU,EAAE,qBAAqB,CAAC,EAAE;IAEjE,8DAA8D;wBAAnD,OAAO,UAAU,EAAE,qBAAqB,GAAG,IAAI;IAE1D,yEAAyE;kBAA9D,OAAO,2BAA2B,EAAE,eAAe,GAAG,IAAI;IAErE,0BAA0B;sBAAf,IAAI,MAAM,CAAC;IAEtB,8EAA8E;6BAAnE,OAAO,2BAA2B,EAAE,oBAAoB,GAAG,IAAI;;;;;;EAE1E;sBAnCoB,2BAA2B"}
1
+ {"version":3,"file":"CTX.d.ts","sourceRoot":"","sources":["CTX.js"],"names":[],"mappings":"AAGO,+BAA2B;AAG3B,wCADK,OAAO,SAAS,EAAE,KAAK;;;;;;EAejC;AAGK,wCADK,OAAO,SAAS,EAAE,KAAK;;;;IAMjC,qEAAqE;yBAA1D,WAAW,OAAO,UAAU,EAAE,qBAAqB,CAAC,EAAE;IAEjE,8DAA8D;wBAAnD,OAAO,UAAU,EAAE,qBAAqB,GAAG,IAAI;IAE1D,yEAAyE;kBAA9D,OAAO,2BAA2B,EAAE,eAAe,GAAG,IAAI;IAErE,0BAA0B;sBAAf,IAAI,MAAM,CAAC;IAEtB,8EAA8E;6BAAnE,OAAO,2BAA2B,EAAE,oBAAoB,GAAG,IAAI;;;;;;EAE1E;sBArCoB,2BAA2B"}
package/abstract/CTX.js CHANGED
@@ -8,12 +8,14 @@ export const activityBlockCtx = (fnCtx) => ({
8
8
  ...blockCtx(),
9
9
  '*currentActivity': null,
10
10
  '*currentActivityParams': {},
11
+
11
12
  '*history': [],
12
13
  '*historyBack': null,
13
14
  '*closeModal': () => {
15
+ fnCtx.modalManager.closeAll();
16
+
14
17
  fnCtx.set$({
15
18
  '*currentActivity': null,
16
- '*modalActive': false,
17
19
  });
18
20
  },
19
21
  });
@@ -0,0 +1,113 @@
1
+ /** @typedef {string} ModalId */
2
+ /** @typedef {import('../blocks/Modal/Modal.js').Modal} ModalNode */
3
+ export const ModalEvents: Readonly<{
4
+ ADD: "modal:add";
5
+ DELETE: "modal:delete";
6
+ OPEN: "modal:open";
7
+ CLOSE: "modal:close";
8
+ CLOSE_ALL: "modal:closeAll";
9
+ DESTROY: "modal:destroy";
10
+ }>;
11
+ export class ModalManager {
12
+ /** @param {import('./Block.js').Block} block */
13
+ constructor(block: import('./Block.js').Block);
14
+ /**
15
+ * @private
16
+ * @type {Map<ModalId, ModalNode>}
17
+ */
18
+ private _modals;
19
+ /**
20
+ * @private
21
+ * @type {Set<ModalId>}
22
+ */
23
+ private _activeModals;
24
+ _subscribers: Map<any, any>;
25
+ _block: import("./Block.js").Block;
26
+ /**
27
+ * @private
28
+ * @param {unknown[]} args
29
+ */
30
+ private _debugPrint;
31
+ /**
32
+ * Register a modal with the manager
33
+ *
34
+ * @param {ModalId} id - Unique identifier for the modal
35
+ * @param {ModalNode} modal - Modal component instance
36
+ */
37
+ registerModal(id: ModalId, modal: ModalNode): void;
38
+ /** @param {ModalId} id - Unique identifier for the modal */
39
+ deleteModal(id: ModalId): boolean;
40
+ /**
41
+ * Open a modal by its ID
42
+ *
43
+ * @param {ModalId} id - The ID of the modal to open
44
+ * @returns {boolean} - Success status
45
+ */
46
+ open(id: ModalId): boolean;
47
+ /**
48
+ * Close a specific modal by ID
49
+ *
50
+ * @param {ModalId} id - The ID of the modal to close
51
+ * @returns {boolean} - Success status
52
+ */
53
+ close(id: ModalId): boolean;
54
+ /**
55
+ * Toggle a modal - open if closed, close if open
56
+ *
57
+ * @param {ModalId} id - The ID of the modal to toggle
58
+ * @returns {boolean} - Success status
59
+ */
60
+ toggle(id: ModalId): boolean;
61
+ /**
62
+ * Check if any modals are currently active/open
63
+ *
64
+ * @returns {boolean} - True if there are any active modals
65
+ */
66
+ get hasActiveModals(): boolean;
67
+ /**
68
+ * Close the most recently opened modal and return to the previous one
69
+ *
70
+ * @returns {boolean} - Success status
71
+ */
72
+ back(): boolean;
73
+ /**
74
+ * Close all open modals
75
+ *
76
+ * @returns {number} - Number of modals closed
77
+ */
78
+ closeAll(): number;
79
+ /**
80
+ * Subscribe to modal events
81
+ *
82
+ * @param {string} event
83
+ * @param {() => void} callback
84
+ * @returns {() => void}
85
+ */
86
+ subscribe(event: string, callback: () => void): () => void;
87
+ /**
88
+ * Unsubscribe from modal events
89
+ *
90
+ * @param {string} event
91
+ * @param {() => void} callback
92
+ */
93
+ unsubscribe(event: string, callback: () => void): void;
94
+ /**
95
+ * Notify all subscribers of a modal event
96
+ *
97
+ * @private
98
+ * @param {string} event - Event name
99
+ * @param {{
100
+ * id?: ModalId | ModalId[];
101
+ * modal?: ModalNode | ModalNode[];
102
+ * }
103
+ * | {
104
+ * modalIds: ModalId[];
105
+ * }} data
106
+ */
107
+ private _notify;
108
+ /** Destroy the modal manager, clean up resources */
109
+ destroy(): void;
110
+ }
111
+ export type ModalId = string;
112
+ export type ModalNode = import('../blocks/Modal/Modal.js').Modal;
113
+ //# sourceMappingURL=ModalManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalManager.d.ts","sourceRoot":"","sources":["ModalManager.js"],"names":[],"mappings":"AAEA,gCAAgC;AAEhC,oEAAoE;AAEpE;;;;;;;GAOG;AAEH;IAeE,gDAAgD;IAChD,mBADY,OAAO,YAAY,EAAE,KAAK,EAGrC;IAjBD;;;OAGG;IACH,gBAAoB;IAEpB;;;OAGG;IACH,sBAA0B;IAE1B,4BAAyB;IAIvB,mCAAmB;IAGrB;;;OAGG;IACH,oBAEC;IAED;;;;;OAKG;IACH,kBAHW,OAAO,SACP,SAAS,QAInB;IAED,4DAA4D;IAC5D,gBADY,OAAO,WASlB;IAED;;;;;OAKG;IACH,SAHW,OAAO,GACL,OAAO,CAanB;IAED;;;;;OAKG;IACH,UAHW,OAAO,GACL,OAAO,CAanB;IAED;;;;;OAKG;IACH,WAHW,OAAO,GACL,OAAO,CAanB;IAED;;;;OAIG;IACH,+BAEC;IAED;;;;OAIG;IACH,QAFa,OAAO,CAWnB;IAED;;;;OAIG;IACH,YAFa,MAAM,CAQlB;IAED;;;;;;OAMG;IACH,iBAJW,MAAM,YACN,MAAM,IAAI,GACR,MAAM,IAAI,CAStB;IAED;;;;;OAKG;IACH,mBAHW,MAAM,YACN,MAAM,IAAI,QAMpB;IAED;;;;;;;;;;;;OAYG;IACH,gBAUC;IAED,oDAAoD;IACpD,gBAKC;CACF;sBAzNa,MAAM;wBAEN,OAAO,0BAA0B,EAAE,KAAK"}
@@ -0,0 +1,220 @@
1
+ //@ts-check
2
+
3
+ /** @typedef {string} ModalId */
4
+
5
+ /** @typedef {import('../blocks/Modal/Modal.js').Modal} ModalNode */
6
+
7
+ export const ModalEvents = Object.freeze({
8
+ ADD: 'modal:add',
9
+ DELETE: 'modal:delete',
10
+ OPEN: 'modal:open',
11
+ CLOSE: 'modal:close',
12
+ CLOSE_ALL: 'modal:closeAll',
13
+ DESTROY: 'modal:destroy',
14
+ });
15
+
16
+ export class ModalManager {
17
+ /**
18
+ * @private
19
+ * @type {Map<ModalId, ModalNode>}
20
+ */
21
+ _modals = new Map();
22
+
23
+ /**
24
+ * @private
25
+ * @type {Set<ModalId>}
26
+ */
27
+ _activeModals = new Set();
28
+
29
+ _subscribers = new Map();
30
+
31
+ /** @param {import('./Block.js').Block} block */
32
+ constructor(block) {
33
+ this._block = block;
34
+ }
35
+
36
+ /**
37
+ * @private
38
+ * @param {unknown[]} args
39
+ */
40
+ _debugPrint(...args) {
41
+ this._block.debugPrint('[modal-manager]', ...args);
42
+ }
43
+
44
+ /**
45
+ * Register a modal with the manager
46
+ *
47
+ * @param {ModalId} id - Unique identifier for the modal
48
+ * @param {ModalNode} modal - Modal component instance
49
+ */
50
+ registerModal(id, modal) {
51
+ this._modals.set(id, modal);
52
+ }
53
+
54
+ /** @param {ModalId} id - Unique identifier for the modal */
55
+ deleteModal(id) {
56
+ if (!this._modals.has(id)) return false;
57
+
58
+ const modal = this._modals.get(id);
59
+ this._modals.delete(id);
60
+ this._activeModals.delete(id);
61
+ this._notify(ModalEvents.DELETE, { id, modal });
62
+ return true;
63
+ }
64
+
65
+ /**
66
+ * Open a modal by its ID
67
+ *
68
+ * @param {ModalId} id - The ID of the modal to open
69
+ * @returns {boolean} - Success status
70
+ */
71
+ open(id) {
72
+ if (!this._modals.has(id)) {
73
+ this._debugPrint(`Modal with ID "${id}" not found`);
74
+ return false;
75
+ }
76
+
77
+ const modal = this._modals.get(id);
78
+
79
+ this._activeModals.add(id);
80
+ this._notify(ModalEvents.OPEN, { modal, id });
81
+ return true;
82
+ }
83
+
84
+ /**
85
+ * Close a specific modal by ID
86
+ *
87
+ * @param {ModalId} id - The ID of the modal to close
88
+ * @returns {boolean} - Success status
89
+ */
90
+ close(id) {
91
+ if (!this._modals.has(id) || !this._activeModals.has(id)) {
92
+ this._debugPrint(`Modal with ID "${id}" not found or not active`);
93
+ return false;
94
+ }
95
+
96
+ const modal = this._modals.get(id);
97
+
98
+ this._activeModals.delete(id);
99
+ this._notify(ModalEvents.CLOSE, { id, modal });
100
+ return true;
101
+ }
102
+
103
+ /**
104
+ * Toggle a modal - open if closed, close if open
105
+ *
106
+ * @param {ModalId} id - The ID of the modal to toggle
107
+ * @returns {boolean} - Success status
108
+ */
109
+ toggle(id) {
110
+ if (!this._modals.has(id)) {
111
+ this._debugPrint(`Modal with ID "${id}" not found`);
112
+ return false;
113
+ }
114
+
115
+ if (this._activeModals.has(id)) {
116
+ return this.close(id);
117
+ } else {
118
+ return this.open(id);
119
+ }
120
+ }
121
+
122
+ /**
123
+ * Check if any modals are currently active/open
124
+ *
125
+ * @returns {boolean} - True if there are any active modals
126
+ */
127
+ get hasActiveModals() {
128
+ return this._activeModals.size > 0;
129
+ }
130
+
131
+ /**
132
+ * Close the most recently opened modal and return to the previous one
133
+ *
134
+ * @returns {boolean} - Success status
135
+ */
136
+ back() {
137
+ if (this._activeModals.size === 0) {
138
+ this._debugPrint('No active modals to go back from');
139
+ return false;
140
+ }
141
+
142
+ // Get the last opened modal
143
+ const lastModalId = Array.from(this._activeModals).pop();
144
+ return this.close(/** @type {string} */ (lastModalId));
145
+ }
146
+
147
+ /**
148
+ * Close all open modals
149
+ *
150
+ * @returns {number} - Number of modals closed
151
+ */
152
+ closeAll() {
153
+ const count = this._activeModals.size;
154
+
155
+ this._activeModals.clear();
156
+ this._notify(ModalEvents.CLOSE_ALL, {});
157
+ return count;
158
+ }
159
+
160
+ /**
161
+ * Subscribe to modal events
162
+ *
163
+ * @param {string} event
164
+ * @param {() => void} callback
165
+ * @returns {() => void}
166
+ */
167
+ subscribe(event, callback) {
168
+ if (!this._subscribers.has(event)) {
169
+ this._subscribers.set(event, new Set());
170
+ }
171
+ this._subscribers.get(event).add(callback);
172
+
173
+ return () => this.unsubscribe(event, callback);
174
+ }
175
+
176
+ /**
177
+ * Unsubscribe from modal events
178
+ *
179
+ * @param {string} event
180
+ * @param {() => void} callback
181
+ */
182
+ unsubscribe(event, callback) {
183
+ if (this._subscribers.has(event)) {
184
+ this._subscribers.get(event).delete(callback);
185
+ }
186
+ }
187
+
188
+ /**
189
+ * Notify all subscribers of a modal event
190
+ *
191
+ * @private
192
+ * @param {string} event - Event name
193
+ * @param {{
194
+ * id?: ModalId | ModalId[];
195
+ * modal?: ModalNode | ModalNode[];
196
+ * }
197
+ * | {
198
+ * modalIds: ModalId[];
199
+ * }} data
200
+ */
201
+ _notify(event, data) {
202
+ if (this._subscribers.has(event)) {
203
+ for (const callback of this._subscribers.get(event)) {
204
+ try {
205
+ callback(data);
206
+ } catch (error) {
207
+ this._debugPrint('Error in modal subscriber:', error);
208
+ }
209
+ }
210
+ }
211
+ }
212
+
213
+ /** Destroy the modal manager, clean up resources */
214
+ destroy() {
215
+ this.closeAll();
216
+ this._modals.clear();
217
+ this._subscribers.clear();
218
+ this._notify(ModalEvents.DESTROY, {});
219
+ }
220
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"UploaderBlock.d.ts","sourceRoot":"","sources":["UploaderBlock.js"],"names":[],"mappings":"AAmBA;IACE,iBAAiB;IACjB,mCAAwB;IAExB,eAAe;IACf,mBAAmB;IAEnB;;;;;;;;;;;;;;MAA+B;IAE/B,eAAe;IACf,0BAOC;IA2BD;;;OAGG;IACH,qDAKC;IAED,mCAAmC;IACnC,6BAKC;IAED,4BAEC;IAED,iCAAiC;IACjC,wCAKC;IAYD,eAAe;IACf,qBA0BC;IAvBC,eAAe;IACf,6BAAiG;IAEjG,eAAe;IACf,uCAEC;IAmBH;;;OAGG;IACH,qBAkBC;IAED,eAAe;IACf,0BAYQ;IAER;;;;OAIG;IACH,gCAiCE;IAEF;;;OAGG;IACH,0CAyFE;IAEF,eAAe;IACf,mCAoBE;IAEF,eAAe;IACf,uBAuCC;IAED;;;OAGG;IACH,kCAHW,MAAM,qEAWhB;IAED;;;OAGG;IACH,oCAHa,QAAQ,OAAO,2BAA2B,EAAE,eAAe,CAAC,CA2BxE;IAED,kEAAkE;IAClE,iBADc,OAAO,sBAAsB,EAAE,eAAe,EAAE,CAK7D;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAra6B,oBAAoB;qCAWb,2BAA2B;kCAG9B,wBAAwB;kCADxB,wBAAwB;gCAD1B,sBAAsB"}
1
+ {"version":3,"file":"UploaderBlock.d.ts","sourceRoot":"","sources":["UploaderBlock.js"],"names":[],"mappings":"AAmBA;IACE,iBAAiB;IACjB,mCAAwB;IAExB,eAAe;IACf,mBAAmB;IAEnB;;;;;;;;;;;;;;MAA+B;IAE/B,eAAe;IACf,0BAOC;IA2BD;;;OAGG;IACH,qDAKC;IAED,mCAAmC;IACnC,6BAKC;IAED,4BAEC;IAED,iCAAiC;IACjC,wCAKC;IAYD,eAAe;IACf,qBAkBC;IAfC,eAAe;IACf,6BAAiG;IAEjG,eAAe;IACf,uCAEC;IAWH;;;OAGG;IACH,qBAkBC;IAED,eAAe;IACf,0BAYQ;IAER;;;;OAIG;IACH,gCAiCE;IAEF;;;OAGG;IACH,0CAyFE;IAEF,eAAe;IACf,mCAoBE;IAEF,eAAe;IACf,uBAwCC;IAED;;;OAGG;IACH,kCAHW,MAAM,qEAWhB;IAED;;;OAGG;IACH,oCAHa,QAAQ,OAAO,2BAA2B,EAAE,eAAe,CAAC,CA2BxE;IAED,kEAAkE;IAClE,iBADc,OAAO,sBAAsB,EAAE,eAAe,EAAE,CAK7D;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA9Z6B,oBAAoB;qCAWb,2BAA2B;kCAG9B,wBAAwB;kCADxB,wBAAwB;gCAD1B,sBAAsB"}
@@ -121,14 +121,6 @@ export class UploaderBlock extends ActivityBlock {
121
121
  if (!this.$['*secureUploadsManager']) {
122
122
  this.$['*secureUploadsManager'] = new SecureUploadsManager(this);
123
123
  }
124
-
125
- if (this.has('*modalActive')) {
126
- this.sub('*modalActive', (modalActive) => {
127
- if (modalActive && !this.$['*currentActivity']) {
128
- this.$['*modalActive'] = false;
129
- }
130
- });
131
- }
132
124
  }
133
125
 
134
126
  /**
@@ -364,6 +356,7 @@ export class UploaderBlock extends ActivityBlock {
364
356
  this.$['*currentActivityParams'] = {
365
357
  internalId: entry.uid,
366
358
  };
359
+ this.modalManager.open(ActivityBlock.activities.CLOUD_IMG_EDIT);
367
360
  this.$['*currentActivity'] = ActivityBlock.activities.CLOUD_IMG_EDIT;
368
361
  }
369
362
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UploaderPublicApi.d.ts","sourceRoot":"","sources":["UploaderPublicApi.js"],"names":[],"mappings":"AAeA;IAOE,8DAA8D;IAC9D,iBADY,OAAO,oBAAoB,EAAE,aAAa,EAGrD;I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AE,eAAe,CAAC,MAAM,CAAC,CAUrD;IAEF;;;;OAIG;IACH,wBAJW,MAAM;;;;sBAEJ,OAAO,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,CAUrD;IAEF;;;;OAIG;IACH,4BAJW,MAAM;;;;sBAEJ,OAAO,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,CAgBrD;IAEF;;;;OAIG;IACH,0BAJW,IAAI;;;;;sBAEF,OAAO,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,CAcrD;IAEF,iCAAiC;IACjC,qCADY,MAAM,UAMhB;IAEF,uBAEC;IAED,sBAeE;IAEF,8HAA8H;IAC9H,6BADY;QAAE,aAAa,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,qCAAqC,EAAE,cAAc,CAAA;KAAE,UAyDhH;IAEF;;;;OAIG;IACH,8EAHW,MAAM,iDA8Cf;IAEF,oEAAoE;IACpE,oKAIE;IAEF,+BAA+B;IAC/B,gDA6DE;IAEF,qBAQE;IAEF;;;;;;;;;OASG;IACH,uTAFQ,IAAI,CAWV;IAEF,2DAA2D;IAC3D,0BADc,OAAO,oBAAoB,EAAE,YAAY,CAGrD;IAEF,8BAA8B;IAC9B,wBADY,OAAO,UAYjB;IAEF;;;OAGG;IACH,0BAOC;CACF"}
@@ -179,8 +179,8 @@ export class UploaderPublicApi {
179
179
  this.addFileFromObject(file, { source: options.captureCamera ? UploadSource.CAMERA : UploadSource.LOCAL }),
180
180
  );
181
181
  // To call uploadTrigger UploadList should draw file items first:
182
+ this._ctx.modalManager.open(ActivityBlock.activities.UPLOAD_LIST);
182
183
  this._ctx.$['*currentActivity'] = ActivityBlock.activities.UPLOAD_LIST;
183
- this._ctx.setOrAddState('*modalActive', true);
184
184
  fileInput.remove();
185
185
  },
186
186
  {
@@ -258,10 +258,10 @@ export class UploaderPublicApi {
258
258
  /** @param {Boolean} [force] */
259
259
  initFlow = (force = false) => {
260
260
  if (this._uploadCollection.size > 0 && !force) {
261
+ this._ctx.modalManager?.open(ActivityBlock.activities.UPLOAD_LIST);
261
262
  this._ctx.set$({
262
263
  '*currentActivity': ActivityBlock.activities.UPLOAD_LIST,
263
264
  });
264
- this._ctx.setOrAddState('*modalActive', true);
265
265
  } else {
266
266
  if (this._sourceList?.length === 1) {
267
267
  const srcKey = this._sourceList[0];
@@ -280,7 +280,6 @@ export class UploaderPublicApi {
280
280
  this._ctx.set$({
281
281
  '*currentActivity': ActivityBlock.activities.START_FROM,
282
282
  });
283
- this._ctx.setOrAddState('*modalActive', true);
284
283
  return;
285
284
  } else if (isPhotoEnabled || isVideoRecordingEnabled) {
286
285
  this.openSystemDialog({
@@ -306,15 +305,16 @@ export class UploaderPublicApi {
306
305
  const sourceBtnBlock = [...blocksRegistry].find(isSourceBtn);
307
306
  // TODO: This is weird that we have this logic inside UI component, we should consider to move it somewhere else
308
307
  sourceBtnBlock?.activate();
308
+
309
309
  if (this._ctx.$['*currentActivity']) {
310
- this._ctx.setOrAddState('*modalActive', true);
310
+ this._ctx.modalManager?.open(this._ctx.$['*currentActivity']);
311
311
  }
312
312
  } else {
313
313
  // Multiple sources case:
314
+ this._ctx.modalManager?.open(ActivityBlock.activities.START_FROM);
314
315
  this._ctx.set$({
315
316
  '*currentActivity': ActivityBlock.activities.START_FROM,
316
317
  });
317
- this._ctx.setOrAddState('*modalActive', true);
318
318
  }
319
319
  }
320
320
  };
@@ -325,7 +325,7 @@ export class UploaderPublicApi {
325
325
  '*history': this._ctx.doneActivity ? [this._ctx.doneActivity] : [],
326
326
  });
327
327
  if (!this._ctx.$['*currentActivity']) {
328
- this._ctx.setOrAddState('*modalActive', false);
328
+ this._ctx.modalManager.closeAll();
329
329
  }
330
330
  };
331
331
 
@@ -361,7 +361,12 @@ export class UploaderPublicApi {
361
361
  console.warn(`Can't open modal without current activity. Please use "setCurrentActivity" method first.`);
362
362
  return;
363
363
  }
364
- this._ctx.setOrAddState('*modalActive', opened);
364
+
365
+ if (opened) {
366
+ this._ctx.modalManager?.open(this._ctx.$['*currentActivity']);
367
+ } else {
368
+ this._ctx.modalManager?.close(this._ctx.$['*currentActivity']);
369
+ }
365
370
  };
366
371
 
367
372
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CameraSource.d.ts","sourceRoot":"","sources":["CameraSource.js"],"names":[],"mappings":"AAyCA,8CAA8C;AAE9C,kGAAkG;AAElG;IAEE,uBAA+C;IAE/C,eAAe;IACf,0BAAyB;IAEzB,yBAAyB;IACzB,SADW,QAAQ,EAAE,CACR;IAEb,mCAAmC;IACnC,gBADW,aAAa,GAAG,IAAI,CACT;IAEtB,iCAAiC;IACjC,SADW,WAAW,GAAG,IAAI,CACd;IAEf,4BAA4B;IAC5B,kBADW,MAAM,GAAG,IAAI,CACA;IAExB,4BAA4B;IAC5B,mBADW,MAAM,GAAG,IAAI,CACC;IAKvB;;;;;;;;;;;;;;;;;;;;;;;;QAiCE,qBAAqB;;QAErB,qBAAqB;;;;QAMrB,uBAAuB;kCAAX,KAAK;QAMjB,uBAAuB;iCAAX,KAAK;;;;QAcjB,iDAAiD;;;;;;;;QAejD,4BAA4B;wBAAhB,UAAU;;;;;;;;;;;;;;MAKvB;IAGH,oCAaE;IAEF,yBAkBE;IADA,sCAAiE;IAGnE,wBAKE;IAEF,uBAEE;IAEF,2BAOE;IAEF,0BAEE;IAEF,4BAiCE;IA9BE;;;;;kBAEC;IA8BL,eAAe;IACf,uBAWE;IAEF,2DAA2D;IAC3D,6BAQE;IAEF,+BAOE;IAEF;;;;OAIG;IACH,sBA6BE;IAEF,oBAUE;IAEF,oBAoBE;IAEF,mCAAmC;IACnC,uBADY,YAAY,UAqBtB;IAEF,mCAAmC;IACnC,uBADY,YAAY,UAwCtB;IAEF;;;OAGG;IACH,wBAmBE;IAEF,eAAe;IACf,cAoBC;IAjBC,uCAA+C;IAC/C,kDAAyC;IAkB3C;;;OAGG;IACH,yBAwBE;IADA,mCAAuB;IAGzB;;;;;OAKG;IACH,oBALW,QAAQ,GA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AGnE,wBAKE;IAEF,uBAEE;IAEF,2BAOE;IAEF,0BAEE;IAEF,4BAiCE;IA9BE;;;;;kBAEC;IA8BL,eAAe;IACf,uBAWE;IAEF,2DAA2D;IAC3D,6BAQE;IAEF,+BAOE;IAEF;;;;OAIG;IACH,sBA6BE;IAEF,oBAUE;IAEF,oBAoBE;IAEF,mCAAmC;IACnC,uBADY,YAAY,UAqBtB;IAEF,mCAAmC;IACnC,uBADY,YAAY,UAwCtB;IAEF;;;OAGG;IACH,wBAmBE;IAEF,eAAe;IACf,cAoBC;IAjBC,uCAA+C;IAC/C,kDAAyC;IAkB3C;;;OAGG;IACH,yBAwBE;IADA,mCAAuB;IAGzB;;;;;OAKG;IACH,oBALW,QAAQ,GAAG,OAAO,OAClB,MAAM,GAAG,MAAM,wBAEf,IAAI,UAYb;IAEF,uCAAuC;IACvC,4BADY,SAAS,SAAS,OAmC7B;IAED;;;;OAIG;IACH,gBAFW,IAAI,UAQb;IAEF,eAAe;IACf,2BAEC;IAED;;;OAGG;IACH,6BA+CQ;IAER,6CAQE;IAEF,yBAWE;IAFE,gCAAuB;IAI3B,8BAyCE;IAEF,qCAEE;IAEF,uCAYE;IAEF,2BAA0B;IAE1B,0CASE;IAEF,iCAsCE;IAlCE;;;oBAKK;IAEL;;;oBAOO;IAsBX,iCAME;IAEF,mCAYE;IAEF,wCAAwC;IACxC,kCADY,UAAU,EAAE,UAStB;IAyBF,iBAMC;IAED,iCAIC;CACF;;;;yBAlxBa,OAAO,GAAG,OAAO;2BAEjB,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ;8BAzCnD,iCAAiC"}
@@ -558,6 +558,7 @@ export class CameraSource extends UploaderBlock {
558
558
  this.set$({
559
559
  '*currentActivity': ActivityBlock.activities.UPLOAD_LIST,
560
560
  });
561
+ this.modalManager.open(ActivityBlock.activities.UPLOAD_LIST);
561
562
  };
562
563
 
563
564
  /** @private */
@@ -1 +1 @@
1
- {"version":3,"file":"CloudImageEditorActivity.d.ts","sourceRoot":"","sources":["CloudImageEditorActivity.js"],"names":[],"mappings":"AAKA,uDAAuD;AAEvD;IAEE,iCAAuD;IAEvD;;;OAGG;IACH,eAAO;IAEP;;;OAGG;IACH,kBAAU;IAEV,6BAA6B;IAC7B,qCAMC;IAuBD,qFAAqF;IACrF,eADY,YAAY,OAAO,kCAAkC,EAAE,WAAW,CAAC,QAW9E;IAED,qBAEC;IAED,oBA4CC;IAED,sBAIC;CACF;6BApHa;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE;8BAHN,iCAAiC"}
1
+ {"version":3,"file":"CloudImageEditorActivity.d.ts","sourceRoot":"","sources":["CloudImageEditorActivity.js"],"names":[],"mappings":"AAKA,uDAAuD;AAEvD;IAEE,iCAAuD;IAEvD;;;OAGG;IACH,eAAO;IAEP;;;OAGG;IACH,kBAAU;IAEV,6BAA6B;IAC7B,qCAMC;IAuBD,qFAAqF;IACrF,eADY,YAAY,OAAO,kCAAkC,EAAE,WAAW,CAAC,QAY9E;IAED,qBAGC;IAED,oBA4CC;IAED,sBAIC;CACF;6BAtHa;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE;8BAHN,iCAAiC"}
@@ -61,10 +61,12 @@ export class CloudImageEditorActivity extends UploaderBlock {
61
61
  cdnUrl: result.cdnUrl,
62
62
  cdnUrlModifiers: result.cdnUrlModifiers,
63
63
  });
64
+ this.modalManager.close(ActivityBlock.activities.CLOUD_IMG_EDIT);
64
65
  this.historyBack();
65
66
  }
66
67
 
67
68
  handleCancel() {
69
+ this.modalManager.close(ActivityBlock.activities.CLOUD_IMG_EDIT);
68
70
  this.historyBack();
69
71
  }
70
72
 
@@ -64,6 +64,6 @@ declare class ConfigClass extends Block {
64
64
  }
65
65
  import { Block } from '../../abstract/Block.js';
66
66
  /** Mapping of attribute names to state */
67
- declare const attrStateMapping: Record<"accept" | "pubkey" | "multiple" | "store" | "debug" | "crop-preset" | "secure-expire" | "max-local-file-size-bytes" | "multiple-min" | "multiple-max" | "confirm-upload" | "img-only" | "external-sources-preferred-types" | "external-sources-embed-css" | "camera-mirror" | "camera-capture" | "source-list" | "thumb-size" | "show-empty-list" | "use-local-image-editor" | "use-cloud-image-editor" | "cloud-image-editor-tabs" | "remove-copyright" | "image-shrink" | "modal-scroll-lock" | "modal-backdrop-strokes" | "source-list-wrap" | "remote-tab-session-key" | "cdn-cname" | "base-url" | "social-base-url" | "secure-signature" | "secure-delivery-proxy" | "retry-throttled-request-max-times" | "multipart-min-file-size" | "multipart-chunk-size" | "max-concurrent-requests" | "multipart-max-concurrent-requests" | "multipart-max-attempts" | "check-for-url-duplicates" | "save-url-for-recurrent-uploads" | "group-output" | "user-agent-integration" | "locale-name" | "secure-uploads-expire-threshold" | "camera-modes" | "default-camera-mode" | "enable-audio-recording" | "enable-video-recording" | "max-video-recording-duration" | "secureexpire" | "croppreset" | "maxlocalfilesizebytes" | "multiplemin" | "multiplemax" | "confirmupload" | "imgonly" | "externalsourcespreferredtypes" | "externalsourcesembedcss" | "cameramirror" | "cameracapture" | "sourcelist" | "thumbsize" | "showemptylist" | "uselocalimageeditor" | "usecloudimageeditor" | "cloudimageeditortabs" | "removecopyright" | "imageshrink" | "modalscrolllock" | "modalbackdropstrokes" | "sourcelistwrap" | "remotetabsessionkey" | "cdncname" | "baseurl" | "socialbaseurl" | "securesignature" | "securedeliveryproxy" | "retrythrottledrequestmaxtimes" | "multipartminfilesize" | "multipartchunksize" | "maxconcurrentrequests" | "multipartmaxconcurrentrequests" | "multipartmaxattempts" | "checkforurlduplicates" | "saveurlforrecurrentuploads" | "groupoutput" | "useragentintegration" | "localename" | "secureuploadsexpirethreshold" | "cameramodes" | "defaultcameramode" | "enableaudiorecording" | "enablevideorecording" | "maxvideorecordingduration", string>;
67
+ declare const attrStateMapping: Record<"accept" | "pubkey" | "multiple" | "store" | "debug" | "crop-preset" | "secure-expire" | "max-local-file-size-bytes" | "multiple-min" | "multiple-max" | "confirm-upload" | "img-only" | "external-sources-preferred-types" | "external-sources-embed-css" | "camera-mirror" | "camera-capture" | "source-list" | "thumb-size" | "show-empty-list" | "use-local-image-editor" | "use-cloud-image-editor" | "cloud-image-editor-tabs" | "remove-copyright" | "image-shrink" | "modal-scroll-lock" | "modal-backdrop-strokes" | "source-list-wrap" | "remote-tab-session-key" | "cdn-cname" | "base-url" | "social-base-url" | "secure-signature" | "secure-delivery-proxy" | "retry-throttled-request-max-times" | "multipart-min-file-size" | "multipart-chunk-size" | "max-concurrent-requests" | "multipart-max-concurrent-requests" | "multipart-max-attempts" | "check-for-url-duplicates" | "save-url-for-recurrent-uploads" | "group-output" | "user-agent-integration" | "locale-name" | "secure-uploads-expire-threshold" | "camera-modes" | "default-camera-mode" | "enable-audio-recording" | "enable-video-recording" | "max-video-recording-duration" | "display-upload-list" | "enable-file-name" | "secureexpire" | "croppreset" | "maxlocalfilesizebytes" | "multiplemin" | "multiplemax" | "confirmupload" | "imgonly" | "externalsourcespreferredtypes" | "externalsourcesembedcss" | "cameramirror" | "cameracapture" | "sourcelist" | "thumbsize" | "showemptylist" | "uselocalimageeditor" | "usecloudimageeditor" | "cloudimageeditortabs" | "removecopyright" | "imageshrink" | "modalscrolllock" | "modalbackdropstrokes" | "sourcelistwrap" | "remotetabsessionkey" | "cdncname" | "baseurl" | "socialbaseurl" | "securesignature" | "securedeliveryproxy" | "retrythrottledrequestmaxtimes" | "multipartminfilesize" | "multipartchunksize" | "maxconcurrentrequests" | "multipartmaxconcurrentrequests" | "multipartmaxattempts" | "checkforurlduplicates" | "saveurlforrecurrentuploads" | "groupoutput" | "useragentintegration" | "localename" | "secureuploadsexpirethreshold" | "cameramodes" | "defaultcameramode" | "enableaudiorecording" | "enablevideorecording" | "maxvideorecordingduration" | "displayuploadlist" | "enablefilename", string>;
68
68
  export {};
69
69
  //# sourceMappingURL=Config.d.ts.map