@uploadcare/file-uploader 1.6.0-alpha.0 → 1.7.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 (115) hide show
  1. package/abstract/UploaderBlock.d.ts +4 -1
  2. package/abstract/UploaderBlock.d.ts.map +1 -1
  3. package/abstract/UploaderBlock.js +11 -18
  4. package/blocks/CloudImageEditor/src/css/common.css +33 -9
  5. package/blocks/CloudImageEditor/src/elements/slider/SliderUi.js +1 -1
  6. package/blocks/DropArea/DropArea.js +1 -1
  7. package/blocks/DropArea/drop-area.css +22 -11
  8. package/blocks/FileItem/FileItem.d.ts +2 -1
  9. package/blocks/FileItem/FileItem.d.ts.map +1 -1
  10. package/blocks/FileItem/FileItem.js +11 -6
  11. package/blocks/FileItem/file-item.css +5 -1
  12. package/blocks/Modal/modal.css +4 -0
  13. package/blocks/SourceBtn/SourceBtn.d.ts.map +1 -1
  14. package/blocks/SourceBtn/SourceBtn.js +5 -4
  15. package/blocks/SourceBtn/source-btn.css +9 -1
  16. package/blocks/UploadList/UploadList.js +1 -1
  17. package/blocks/UrlSource/UrlSource.js +1 -1
  18. package/blocks/themes/uc-basic/common.css +4 -0
  19. package/blocks/themes/uc-basic/theme.css +27 -10
  20. package/blocks/utils/UploadSource.d.ts +27 -1
  21. package/blocks/utils/UploadSource.d.ts.map +1 -1
  22. package/blocks/utils/UploadSource.js +20 -1
  23. package/env.d.ts +1 -1
  24. package/env.js +1 -1
  25. package/index.d.ts +1 -0
  26. package/index.js +1 -0
  27. package/index.ssr.d.ts +97 -14
  28. package/index.ssr.d.ts.map +1 -1
  29. package/index.ssr.js +88 -16
  30. package/locales/file-uploader/ar.d.ts +5 -0
  31. package/locales/file-uploader/ar.js +5 -0
  32. package/locales/file-uploader/az.d.ts +5 -0
  33. package/locales/file-uploader/az.js +5 -0
  34. package/locales/file-uploader/ca.d.ts +5 -0
  35. package/locales/file-uploader/ca.js +5 -0
  36. package/locales/file-uploader/cs.d.ts +5 -0
  37. package/locales/file-uploader/cs.js +5 -0
  38. package/locales/file-uploader/da.d.ts +5 -0
  39. package/locales/file-uploader/da.js +5 -0
  40. package/locales/file-uploader/de.d.ts +5 -0
  41. package/locales/file-uploader/de.js +5 -0
  42. package/locales/file-uploader/el.d.ts +5 -0
  43. package/locales/file-uploader/el.js +5 -0
  44. package/locales/file-uploader/en.d.ts +5 -0
  45. package/locales/file-uploader/en.js +5 -0
  46. package/locales/file-uploader/es.d.ts +5 -0
  47. package/locales/file-uploader/es.js +5 -0
  48. package/locales/file-uploader/et.d.ts +5 -0
  49. package/locales/file-uploader/et.js +5 -0
  50. package/locales/file-uploader/fr.d.ts +5 -0
  51. package/locales/file-uploader/fr.js +5 -0
  52. package/locales/file-uploader/he.d.ts +5 -0
  53. package/locales/file-uploader/he.js +5 -0
  54. package/locales/file-uploader/hy.d.ts +5 -0
  55. package/locales/file-uploader/hy.js +5 -0
  56. package/locales/file-uploader/is.d.ts +5 -0
  57. package/locales/file-uploader/is.js +5 -0
  58. package/locales/file-uploader/it.d.ts +5 -0
  59. package/locales/file-uploader/it.js +5 -0
  60. package/locales/file-uploader/ja.d.ts +5 -0
  61. package/locales/file-uploader/ja.js +5 -0
  62. package/locales/file-uploader/ka.d.ts +5 -0
  63. package/locales/file-uploader/ka.js +5 -0
  64. package/locales/file-uploader/kk.d.ts +5 -0
  65. package/locales/file-uploader/kk.js +5 -0
  66. package/locales/file-uploader/ko.d.ts +5 -0
  67. package/locales/file-uploader/ko.js +5 -0
  68. package/locales/file-uploader/lv.d.ts +5 -0
  69. package/locales/file-uploader/lv.js +5 -0
  70. package/locales/file-uploader/nb.d.ts +5 -0
  71. package/locales/file-uploader/nb.js +5 -0
  72. package/locales/file-uploader/nl.d.ts +5 -0
  73. package/locales/file-uploader/nl.js +5 -0
  74. package/locales/file-uploader/pl.d.ts +5 -0
  75. package/locales/file-uploader/pl.js +5 -0
  76. package/locales/file-uploader/pt.d.ts +5 -0
  77. package/locales/file-uploader/pt.js +5 -0
  78. package/locales/file-uploader/ro.d.ts +5 -0
  79. package/locales/file-uploader/ro.js +5 -0
  80. package/locales/file-uploader/ru.d.ts +5 -0
  81. package/locales/file-uploader/ru.js +5 -0
  82. package/locales/file-uploader/sk.d.ts +5 -0
  83. package/locales/file-uploader/sk.js +5 -0
  84. package/locales/file-uploader/sr.d.ts +5 -0
  85. package/locales/file-uploader/sr.js +5 -0
  86. package/locales/file-uploader/sv.d.ts +5 -0
  87. package/locales/file-uploader/sv.js +5 -0
  88. package/locales/file-uploader/tr.d.ts +5 -0
  89. package/locales/file-uploader/tr.js +5 -0
  90. package/locales/file-uploader/uk.d.ts +5 -0
  91. package/locales/file-uploader/uk.js +5 -0
  92. package/locales/file-uploader/vi.d.ts +5 -0
  93. package/locales/file-uploader/vi.js +5 -0
  94. package/locales/file-uploader/zh-TW.d.ts +5 -0
  95. package/locales/file-uploader/zh-TW.js +5 -0
  96. package/locales/file-uploader/zh.d.ts +5 -0
  97. package/locales/file-uploader/zh.js +5 -0
  98. package/package.json +1 -1
  99. package/solutions/file-uploader/minimal/index.css +4 -0
  100. package/types/exported.d.ts +2 -0
  101. package/web/file-uploader.iife.min.js +4 -4
  102. package/web/file-uploader.min.js +4 -4
  103. package/web/uc-basic.min.css +1 -1
  104. package/web/uc-cloud-image-editor.min.css +1 -1
  105. package/web/uc-cloud-image-editor.min.js +1 -1
  106. package/web/uc-file-uploader-inline.min.css +1 -1
  107. package/web/uc-file-uploader-inline.min.js +4 -4
  108. package/web/uc-file-uploader-minimal.min.css +1 -1
  109. package/web/uc-file-uploader-minimal.min.js +3 -3
  110. package/web/uc-file-uploader-regular.min.css +1 -1
  111. package/web/uc-file-uploader-regular.min.js +4 -4
  112. package/web/uc-img.min.js +1 -1
  113. package/blocks/EditorFilerobotImage/EditorFilerobotImage.d.ts +0 -13
  114. package/blocks/EditorFilerobotImage/EditorFilerobotImage.d.ts.map +0 -1
  115. package/blocks/EditorFilerobotImage/EditorFilerobotImage.js +0 -59
@@ -100,8 +100,11 @@ export namespace UploaderBlock {
100
100
  ONEDRIVE: "onedrive";
101
101
  HUDDLE: "huddle";
102
102
  LOCAL: "local";
103
- URL: "url";
103
+ DROP_AREA: "drop-area";
104
104
  CAMERA: "camera";
105
+ EXTERNAL: "external";
106
+ API: "js-api";
107
+ URL: "url";
105
108
  DRAW: "draw";
106
109
  }>;
107
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UploaderBlock.d.ts","sourceRoot":"","sources":["UploaderBlock.js"],"names":[],"mappings":"AAkBA;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BApa6B,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,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"}
@@ -15,6 +15,7 @@ import { TypedCollection } from './TypedCollection.js';
15
15
  import { UploaderPublicApi } from './UploaderPublicApi.js';
16
16
  import { ValidationManager } from './ValidationManager.js';
17
17
  import { uploadEntrySchema } from './uploadEntrySchema.js';
18
+ import { ExternalUploadSource, UploadSource } from '../blocks/utils/UploadSource.js';
18
19
 
19
20
  export class UploaderBlock extends ActivityBlock {
20
21
  /** @protected */
@@ -421,26 +422,18 @@ export class UploaderBlock extends ActivityBlock {
421
422
  }
422
423
  }
423
424
 
424
- /** @enum {String} */
425
+ /**
426
+ * @deprecated Use list sources ExternalUploadSource from from blocks/utils/UploadSource.js
427
+ * @enum {String}
428
+ */
425
429
  UploaderBlock.extSrcList = Object.freeze({
426
- FACEBOOK: 'facebook',
427
- DROPBOX: 'dropbox',
428
- GDRIVE: 'gdrive',
429
- GPHOTOS: 'gphotos',
430
- INSTAGRAM: 'instagram',
431
- FLICKR: 'flickr',
432
- VK: 'vk',
433
- EVERNOTE: 'evernote',
434
- BOX: 'box',
435
- ONEDRIVE: 'onedrive',
436
- HUDDLE: 'huddle',
430
+ ...ExternalUploadSource,
437
431
  });
438
432
 
439
- /** @enum {String} */
433
+ /**
434
+ * @deprecated Use list sources UploadSource from from blocks/utils/UploadSource.js
435
+ * @enum {String}
436
+ */
440
437
  UploaderBlock.sourceTypes = Object.freeze({
441
- LOCAL: 'local',
442
- URL: 'url',
443
- CAMERA: 'camera',
444
- DRAW: 'draw',
445
- ...UploaderBlock.extSrcList,
438
+ ...UploadSource,
446
439
  });
@@ -348,6 +348,8 @@ uc-editor-operation-control {
348
348
  --down-opacity: 1;
349
349
  --down-filter: 0.6;
350
350
  --down-background: var(--uc-secondary);
351
+
352
+ border-radius: var(--uc-radius);
351
353
  }
352
354
 
353
355
  uc-editor-button-control > button,
@@ -384,11 +386,11 @@ uc-editor-button-control.uc-active,
384
386
  uc-editor-operation-control.uc-active,
385
387
  uc-editor-crop-button-control.uc-active,
386
388
  uc-editor-filter-control.uc-active {
387
- --idle-color-rgb: var(--uc-primary);
388
- --idle-background: var(--uc-primary-transparent);
389
- --idle-opacity: 0.9;
390
- --hover-color-rgb: var(--uc-primary);
391
- --hover-background: var(--uc-primary-transparent);
389
+ --idle-color-rgb: var(--uc-primary-foreground);
390
+ --idle-background: var(--uc-primary);
391
+ --idle-opacity: 1;
392
+ --hover-color-rgb: var(--uc-primary-foreground);
393
+ --hover-background: var(--uc-primary);
392
394
  --hover-opacity: 1;
393
395
  }
394
396
 
@@ -407,6 +409,17 @@ uc-editor-filter-control.uc-not_active {
407
409
  --idle-color-rgb: var(--uc-secondary-foreground);
408
410
  }
409
411
 
412
+ :where(.uc-contrast) uc-editor-button-control.uc-not_active,
413
+ :where(.uc-contrast) uc-editor-operation-control.uc-not_active,
414
+ :where(.uc-contrast) uc-editor-crop-button-control.uc-not_active,
415
+ :where(.uc-contrast) uc-editor-filter-control.uc-not_active {
416
+ --idle-background: transparent;
417
+ --hover-background: var(--uc-secondary);
418
+
419
+ outline: 1px solid var(--uc-border);
420
+ outline-offset: -1px;
421
+ }
422
+
410
423
  uc-editor-button-control > button::before,
411
424
  uc-editor-operation-control > button::before,
412
425
  uc-editor-crop-button-control > button::before,
@@ -973,6 +986,10 @@ uc-btn-ui.uc-secondary > button {
973
986
  --active-background: transparent;
974
987
  }
975
988
 
989
+ :where(.uc-contrast) uc-btn-ui.uc-secondary > button {
990
+ border: 1px solid var(--uc-border);
991
+ }
992
+
976
993
  uc-btn-ui.uc-secondary-icon > button {
977
994
  --idle-color-rgb: var(--uc-secondary-foreground);
978
995
  --idle-brightness: 1;
@@ -1036,6 +1053,13 @@ uc-btn-ui.uc-default > button {
1036
1053
  --active-background: var(--uc-primary-transparent);
1037
1054
  }
1038
1055
 
1056
+ :where(.uc-contrast) uc-btn-ui.uc-default > button {
1057
+ --idle-background: transparent;
1058
+ --hover-background: var(--uc-secondary);
1059
+ --active-background: var(--uc-foreground);
1060
+ --active-color-rgb: var(--uc-background);
1061
+ }
1062
+
1039
1063
  uc-line-loader-ui {
1040
1064
  position: absolute;
1041
1065
  top: 0px;
@@ -1107,16 +1131,16 @@ uc-slider-ui .uc-steps {
1107
1131
  uc-slider-ui .uc-border-step {
1108
1132
  width: 0px;
1109
1133
  height: 10px;
1110
- border-right: 1px solid var(--l-color);
1111
- opacity: 0.6;
1134
+ border-right: 1px solid var(--uc-foreground);
1135
+ opacity: 1;
1112
1136
  transition: border-color var(--transition-duration-2);
1113
1137
  }
1114
1138
 
1115
1139
  uc-slider-ui .uc-minor-step {
1116
1140
  width: 0px;
1117
1141
  height: 4px;
1118
- border-right: 1px solid var(--l-color);
1119
- opacity: 0.2;
1142
+ border-right: 1px solid var(--uc-foreground);
1143
+ opacity: 0.6;
1120
1144
  transition: border-color var(--transition-duration-2);
1121
1145
  }
1122
1146
 
@@ -114,7 +114,7 @@ export class SliderUi extends Block {
114
114
  if (value === this._zero) {
115
115
  this._zeroDotEl.style.opacity = '0';
116
116
  } else {
117
- this._zeroDotEl.style.opacity = '0.2';
117
+ this._zeroDotEl.style.opacity = '1';
118
118
  }
119
119
  let { width } = this.getBoundingClientRect();
120
120
  let slope = 100 / (this.$.max - this.$.min);
@@ -151,7 +151,7 @@ export class DropArea extends UploaderBlock {
151
151
  this.subConfigValue('sourceList', (value) => {
152
152
  const list = stringToArray(value);
153
153
  // Enable drop area if local files are allowed
154
- this.$.isEnabled = list.includes(UploaderBlock.sourceTypes.LOCAL);
154
+ this.$.isEnabled = list.includes(UploadSource.LOCAL);
155
155
  // Show drop area if it's enabled or default slot is overrided
156
156
  this.$.isVisible = this.$.isEnabled || !this.querySelector('[data-default-slot]');
157
157
  });
@@ -32,18 +32,19 @@
32
32
  background: var(--uc-background);
33
33
  }
34
34
 
35
- :where([uc-drop-area])[with-icon]
36
- > .uc-content-wrapper:is([drag-state='active'], [drag-state='near'], [drag-state='over'])
37
- :is(.uc-text, .uc-icon-container) {
38
- color: var(--uc-primary);
39
- }
40
-
41
35
  :where([uc-drop-area]):is([drag-state='active'], [drag-state='near'], [drag-state='over'], :hover) {
42
- color: var(--uc-primary);
43
36
  background: var(--uc-primary-transparent);
44
37
  border-color: var(--uc-primary-transparent);
45
38
  }
46
39
 
40
+ :where(.uc-contrast) :where([uc-drop-area]):is([drag-state='active'], [drag-state='near'], [drag-state='over'], :hover) {
41
+ color: var(--uc-foreground);
42
+ background: transparent;
43
+ border-color: var(--uc-foreground);
44
+ border-width: 2px;
45
+ border-style: solid;
46
+ }
47
+
47
48
  :where([uc-drop-area]):is([drag-state='active'], [drag-state='near']) {
48
49
  opacity: 1;
49
50
  }
@@ -95,15 +96,19 @@
95
96
  transform: translateY(48px);
96
97
  }
97
98
 
98
- :where([uc-drop-area])[with-icon]:hover .uc-icon-container,
99
- :where([uc-drop-area])[with-icon]:hover .uc-text {
100
- color: var(--uc-primary);
99
+ :where(.uc-contrast) :where([uc-drop-area])[with-icon]:hover .uc-icon-container,
100
+ :where(.uc-contrast) :where([uc-drop-area])[with-icon]:hover .uc-text {
101
+ color: var(--uc-foreground);
101
102
  }
102
103
 
103
104
  :where([uc-drop-area])[with-icon]:hover .uc-icon-container {
104
105
  background-color: var(--uc-primary-transparent);
105
106
  }
106
107
 
108
+ :where(.uc-contrast) :where([uc-drop-area])[with-icon]:hover .uc-icon-container {
109
+ background-color: var(--uc-muted);
110
+ }
111
+
107
112
  :where([uc-drop-area])[with-icon]
108
113
  > .uc-content-wrapper:is([drag-state='active'], [drag-state='near'], [drag-state='over'])
109
114
  .uc-icon-container {
@@ -114,7 +119,13 @@
114
119
  :where([uc-drop-area])[with-icon]
115
120
  > .uc-content-wrapper:is([drag-state='active'], [drag-state='near'], [drag-state='over'])
116
121
  .uc-text {
117
- color: var(--uc-primary);
122
+ color: var(--uc-foreground);
123
+ }
124
+
125
+ :where(.uc-contrast) :where([uc-drop-area])[with-icon]
126
+ > .uc-content-wrapper:is([drag-state='active'], [drag-state='near'], [drag-state='over'])
127
+ .uc-text {
128
+ color: var(--uc-foreground);
118
129
  }
119
130
 
120
131
  :where([uc-drop-area])[with-icon]
@@ -28,6 +28,7 @@ export class FileItem extends UploaderBlock {
28
28
  isFocused: boolean;
29
29
  isEditable: boolean;
30
30
  state: symbol;
31
+ ariaLabelStatusFile: string;
31
32
  onEdit: () => void;
32
33
  onRemove: () => void;
33
34
  onUpload: () => void;
@@ -35,7 +36,7 @@ export class FileItem extends UploaderBlock {
35
36
  '*uploadList': never[];
36
37
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
37
38
  '*collectionErrors': any[];
38
- '*collectionState': import("../../index.js").OutputCollectionState<import("../../index.js").OutputCollectionStatus, "maybe-has-group"> | null; /** @private */
39
+ '*collectionState': import("../../index.js").OutputCollectionState<import("../../index.js").OutputCollectionStatus, "maybe-has-group"> | null;
39
40
  '*groupInfo': import("@uploadcare/upload-client").UploadcareGroup | null;
40
41
  '*uploadTrigger': Set<string>;
41
42
  '*secureUploadsManager': import("../../abstract/SecureUploadsManager.js").SecureUploadsManager | null;
@@ -1 +1 @@
1
- {"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["FileItem.js"],"names":[],"mappings":"AAkBA;IAIE,eAAe;IACf,mBAAuB;IACvB;;;OAGG;IACH,eAAc;IACd,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,gCAA4E;IAC5E,eAAe;IACf,iCAA0E;IAE1E,eAAe;IACf,sBAAsB;IAKpB;;;;;;;;;;;;;;;;;;;;;uJApBF,eAAe;;;;;;;;;MA+CZ;IAGH,eASC;IAED;;;OAGG;IACH,0BAaC;IAED,eAAe;IACf,wBAgBC;IAED,eAAe;IACf,2BAsCC;IAED;;;;OAIG;IACH,kBAUC;IAED;;;OAGG;IACH,uBAkDC;IAsCD,wEAAwE;IACxE,oBADY,CAAC,oBAAoB,CAAC,CAAC,MAAM,oBAAoB,CAAC,QAsB7D;IAaC,eAAe;IACf,kBAEE;IAWJ;;;MAEC;IAED;;;OAGG;IACH,uBAEC;IAED,wBAsFC;CACF;;;;;8BA/Z6B,iCAAiC;AAO/D;;;;;GAKG"}
1
+ {"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["FileItem.js"],"names":[],"mappings":"AAkBA;IAIE,eAAe;IACf,mBAAuB;IACvB;;;OAGG;IACH,eAAc;IACd,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,gCAA4E;IAC5E,eAAe;IACf,iCAA0E;IAE1E,eAAe;IACf,sBAAsB;IAKpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA4BC;IAGH,eASC;IAED;;;OAGG;IACH,0BAaC;IAED,eAAe;IACf,wBAgBC;IAED,eAAe;IACf,2BAsCC;IAED;;;;OAIG;IACH,kBAUC;IAED;;;OAGG;IACH,uBAkDC;IAsCD,wEAAwE;IACxE,oBADY,CAAC,oBAAoB,CAAC,CAAC,MAAM,oBAAoB,CAAC,QA0B7D;IAaC,eAAe;IACf,kBAEE;IAWJ;;;MAEC;IAED;;;OAGG;IACH,uBAEC;IAED,wBAsFC;CACF;;;;;8BApa6B,iCAAiC;AAO/D;;;;;GAKG"}
@@ -10,10 +10,10 @@ import { generateThumb } from '../utils/resizeImage.js';
10
10
  import { parseShrink } from '../../utils/parseShrink.js';
11
11
 
12
12
  const FileItemState = Object.freeze({
13
- FINISHED: Symbol(0),
14
- FAILED: Symbol(1),
15
- UPLOADING: Symbol(2),
16
- IDLE: Symbol(3),
13
+ FINISHED: Symbol('FINISHED'),
14
+ FAILED: Symbol('FAILED'),
15
+ UPLOADING: Symbol('UPLOADING'),
16
+ IDLE: Symbol('IDLE'),
17
17
  });
18
18
 
19
19
  export class FileItem extends UploaderBlock {
@@ -55,6 +55,7 @@ export class FileItem extends UploaderBlock {
55
55
  isFocused: false,
56
56
  isEditable: false,
57
57
  state: FileItemState.IDLE,
58
+ ariaLabelStatusFile: '',
58
59
  onEdit: () => {
59
60
  this.$['*currentActivityParams'] = {
60
61
  internalId: this._entry.uid,
@@ -290,6 +291,10 @@ export class FileItem extends UploaderBlock {
290
291
  progressVisible: state === FileItemState.UPLOADING,
291
292
  isEditable: this.cfg.useCloudImageEditor && this._entry?.getValue('isImage') && this._entry?.getValue('cdnUrl'),
292
293
  errorText: this._entry.getValue('errors')?.[0]?.message,
294
+ ariaLabelStatusFile: this.l10n('a11y-file-item-status', {
295
+ fileName: this._entry?.getValue('fileName'),
296
+ status: this.l10n(state?.description?.toLocaleLowerCase() ?? '').toLocaleLowerCase(),
297
+ }),
293
298
  });
294
299
  }
295
300
 
@@ -392,7 +397,7 @@ export class FileItem extends UploaderBlock {
392
397
  cdnUrl: entry.getValue('cdnUrl') ?? fileInfo.cdnUrl,
393
398
  cdnUrlModifiers: entry.getValue('cdnUrlModifiers') ?? '',
394
399
  uploadProgress: 100,
395
- source: entry.getValue('source') ?? '',
400
+ source: entry.getValue('source') ?? null,
396
401
  });
397
402
 
398
403
  if (entry === this._entry) {
@@ -426,7 +431,7 @@ FileItem.template = /* HTML */ `
426
431
  <uc-icon set="@name: badgeIcon"></uc-icon>
427
432
  </div>
428
433
  </div>
429
- <div class="uc-file-name-wrapper">
434
+ <div aria-live="polite" class="uc-file-name-wrapper" set="@aria-label:ariaLabelStatusFile;">
430
435
  <span class="uc-file-name" set="@title: itemName">{{itemName}}</span>
431
436
  <span class="uc-file-error" set="@hidden: !errorText">{{errorText}}</span>
432
437
  </div>
@@ -127,11 +127,15 @@ uc-file-item .uc-badge uc-icon svg {
127
127
  }
128
128
 
129
129
  uc-file-item .uc-progress-bar {
130
- opacity: 0.5;
130
+ opacity: 0.7;
131
131
  top: calc(100% - 2px);
132
132
  height: 2px;
133
133
  }
134
134
 
135
+ :where(.uc-contrast) uc-file-item .uc-progress-bar {
136
+ opacity: 1;
137
+ }
138
+
135
139
  uc-file-item .uc-file-actions {
136
140
  display: flex;
137
141
  gap: 2px;
@@ -85,6 +85,10 @@
85
85
  opacity 0.4s ease;
86
86
  }
87
87
 
88
+ :where(.uc-contrast) :where([uc-modal]) > dialog {
89
+ outline: 1px solid var(--uc-border);
90
+ }
91
+
88
92
  @media only screen and (max-width: 430px), only screen and (max-height: 600px) {
89
93
  :where([uc-modal]) > dialog > .uc-content {
90
94
  height: var(--modal-max-content-height);
@@ -1 +1 @@
1
- {"version":3,"file":"SourceBtn.d.ts","sourceRoot":"","sources":["SourceBtn.js"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AAEH;IAEE,iCAAiC;IACjC,MADW,MAAM,GAAG,SAAS,CACZ;IACjB;;;OAGG;IACH,yBAAsB;IAKpB;;;;;;;;;;;;;;;;MAIC;IAGH,kBAuCC;IAkBD,kCAAkC;IAClC,yBADY,OAAO,QAGlB;IAED,2BAA2B;IAC3B,cADY,MAAM,WAGjB;IAED,iBAYC;IAED,2BAA2B;IAC3B,gBADY,MAAM,QAcjB;CACF;;;;sBA9HY;IACZ,IAAQ,EAAE,MAAM,CAAC;IACjB,QAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAY,CAAC,EAAE,MAAM,OAAO,CAAC;IAC7B,cAAkB,CAAC,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;8BAb0B,iCAAiC"}
1
+ {"version":3,"file":"SourceBtn.d.ts","sourceRoot":"","sources":["SourceBtn.js"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AAEH;IAEE,iCAAiC;IACjC,MADW,MAAM,GAAG,SAAS,CACZ;IACjB;;;OAGG;IACH,yBAAsB;IAKpB;;;;;;;;;;;;;;;;MAIC;IAGH,kBAuCC;IAkBD,kCAAkC;IAClC,yBADY,OAAO,QAGlB;IAED,2BAA2B;IAC3B,cADY,MAAM,WAGjB;IAED,iBAYC;IAED,2BAA2B;IAC3B,gBADY,MAAM,QAcjB;CACF;;;;sBA9HY;IACZ,IAAQ,EAAE,MAAM,CAAC;IACjB,QAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAY,CAAC,EAAE,MAAM,OAAO,CAAC;IAC7B,cAAkB,CAAC,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;8BAd0B,iCAAiC"}
@@ -1,6 +1,7 @@
1
1
  // @ts-check
2
2
  import { UploaderBlock } from '../../abstract/UploaderBlock.js';
3
3
  import { ActivityBlock } from '../../abstract/ActivityBlock.js';
4
+ import { ExternalUploadSource, UploadSource } from '../utils/UploadSource.js';
4
5
 
5
6
  const L10N_PREFIX = 'src-type-';
6
7
 
@@ -37,19 +38,19 @@ export class SourceBtn extends UploaderBlock {
37
38
 
38
39
  initTypes() {
39
40
  this.registerType({
40
- type: UploaderBlock.sourceTypes.LOCAL,
41
+ type: UploadSource.LOCAL,
41
42
  activate: () => {
42
43
  this.api.openSystemDialog();
43
44
  return false;
44
45
  },
45
46
  });
46
47
  this.registerType({
47
- type: UploaderBlock.sourceTypes.URL,
48
+ type: UploadSource.URL,
48
49
  activity: ActivityBlock.activities.URL,
49
50
  textKey: 'from-url',
50
51
  });
51
52
  this.registerType({
52
- type: UploaderBlock.sourceTypes.CAMERA,
53
+ type: UploadSource.CAMERA,
53
54
  activity: ActivityBlock.activities.CAMERA,
54
55
  activate: () => {
55
56
  const supportsCapture = 'capture' in document.createElement('input');
@@ -65,7 +66,7 @@ export class SourceBtn extends UploaderBlock {
65
66
  icon: 'edit-draw',
66
67
  });
67
68
 
68
- for (let externalSourceType of Object.values(UploaderBlock.extSrcList)) {
69
+ for (let externalSourceType of Object.values(ExternalUploadSource)) {
69
70
  this.registerType({
70
71
  type: externalSourceType,
71
72
  activity: ActivityBlock.activities.EXTERNAL,
@@ -20,10 +20,14 @@ uc-source-btn:last-child > button {
20
20
  }
21
21
 
22
22
  uc-source-btn > button:hover {
23
- color: var(--uc-primary);
24
23
  background-color: var(--uc-primary-transparent);
25
24
  }
26
25
 
26
+ :where(.uc-contrast) uc-source-btn > button:hover {
27
+ background-color: var(--uc-secondary);
28
+ color: var(--uc-foreground);
29
+ }
30
+
27
31
  uc-source-btn uc-icon {
28
32
  display: inline-flex;
29
33
  flex-grow: 1;
@@ -33,6 +37,10 @@ uc-source-btn uc-icon {
33
37
  opacity: 0.8;
34
38
  }
35
39
 
40
+ :where(.uc-contrast) uc-source-btn uc-icon {
41
+ opacity: 1;
42
+ }
43
+
36
44
  uc-source-btn .uc-txt {
37
45
  display: flex;
38
46
  align-items: center;
@@ -201,7 +201,7 @@ export class UploadList extends UploaderBlock {
201
201
 
202
202
  UploadList.template = /* HTML */ `
203
203
  <uc-activity-header>
204
- <span class="uc-header-text">{{headerText}}</span>
204
+ <span aria-live="polite" class="uc-header-text">{{headerText}}</span>
205
205
  <button
206
206
  type="button"
207
207
  class="uc-mini-btn uc-close-btn"
@@ -13,7 +13,7 @@ export class UrlSource extends UploaderBlock {
13
13
  e.preventDefault();
14
14
 
15
15
  let url = this.ref.input['value'];
16
- this.api.addFileFromUrl(url, { source: UploadSource.URL_TAB });
16
+ this.api.addFileFromUrl(url, { source: UploadSource.URL });
17
17
  this.$['*currentActivity'] = ActivityBlock.activities.UPLOAD_LIST;
18
18
  },
19
19
  onCancel: () => {
@@ -56,6 +56,10 @@
56
56
  background-color: var(--uc-secondary-hover);
57
57
  }
58
58
 
59
+ :where([uc-wgt-common].uc-contrast) button.uc-secondary-btn {
60
+ border: 1px solid var(--uc-border);
61
+ }
62
+
59
63
  :where([uc-wgt-common]) button.uc-mini-btn {
60
64
  height: var(--uc-button-size);
61
65
  padding: 0;
@@ -41,7 +41,7 @@
41
41
  @supports not (color: oklch(0% 0 0)) {
42
42
  :where([uc-wgt-common]) {
43
43
  /* Light colors RGB fallback */
44
- --uc-primary-rgb-light: 54 112 253;
44
+ --uc-primary-rgb-light: 23 75 215;
45
45
  --uc-primary-light: rgb(var(--uc-primary-rgb-light));
46
46
  --uc-primary-hover-light: rgb(var(--uc-primary-rgb-light) / 90%);
47
47
  --uc-primary-transparent-light: rgb(var(--uc-primary-rgb-light) / 10%);
@@ -87,10 +87,10 @@
87
87
  @supports (color: oklch(0% 0 0)) {
88
88
  :where([uc-wgt-common]) {
89
89
  /* Light colors OKLCH */
90
- --uc-primary-oklch-light: 59% 0.22 264; /* Quick customization: change this value to your brand color */
90
+ --uc-primary-oklch-light: 47% 0.22 264; /* Quick customization: change this value to your brand color */
91
91
  --uc-primary-light: oklch(var(--uc-primary-oklch-light));
92
92
  --uc-primary-hover-light: oklch(var(--uc-primary-oklch-light) / 90%);
93
- --uc-primary-transparent-light: oklch(var(--uc-primary-oklch-light) / 10%);
93
+ --uc-primary-transparent-light: oklch(var(--uc-primary-oklch-light) / 7%);
94
94
  --uc-background-light: oklch(100% 0 0);
95
95
  --uc-foreground-light: oklch(21% 0 0);
96
96
  --uc-primary-foreground-light: oklch(100% 0 0);
@@ -98,7 +98,7 @@
98
98
  --uc-secondary-hover-light: oklch(21% 0 0 / 0.08);
99
99
  --uc-secondary-foreground-light: oklch(21% 0 0);
100
100
  --uc-muted-light: oklch(97% 0 0);
101
- --uc-muted-foreground-light: oklch(55% 0 0);
101
+ --uc-muted-foreground-light: oklch(40% 0 0);
102
102
  --uc-destructive-light: oklch(59% 0.235 28.5 / 0.05);
103
103
  --uc-destructive-foreground-light: oklch(59% 0.235 28.5);
104
104
  --uc-border-light: oklch(92% 0 0);
@@ -232,27 +232,27 @@
232
232
  }
233
233
 
234
234
  :where(.uc-purple) {
235
- --uc-primary-oklch-light: 59% 0.22 300;
235
+ --uc-primary-oklch-light: 47% 0.22 300;
236
236
  --uc-primary-oklch-dark: 69% 0.1768 300;
237
237
  }
238
238
 
239
239
  :where(.uc-red) {
240
- --uc-primary-oklch-light: 59% 0.22 21;
241
- --uc-primary-oklch-dark: 69% 0.1768 21;
240
+ --uc-primary-oklch-light: 47% 0.21 21;
241
+ --uc-primary-oklch-dark: 71% 0.1768 21;
242
242
  }
243
243
 
244
244
  :where(.uc-orange) {
245
- --uc-primary-oklch-light: 59% 0.1724 51.88;
245
+ --uc-primary-oklch-light: 47% 0.1376 51.88;
246
246
  --uc-primary-oklch-dark: 69% 0.1768 51.88;
247
247
  }
248
248
 
249
249
  :where(.uc-green) {
250
- --uc-primary-oklch-light: 59% 0.1724 130;
250
+ --uc-primary-oklch-light: 45% 0.14 130;
251
251
  --uc-primary-oklch-dark: 69% 0.1768 130;
252
252
  }
253
253
 
254
254
  :where(.uc-turquoise) {
255
- --uc-primary-oklch-light: 59% 0.1523 174;
255
+ --uc-primary-oklch-light: 45% 0.0854 174;
256
256
  --uc-primary-oklch-dark: 69% 0.1768 174;
257
257
  }
258
258
 
@@ -260,3 +260,20 @@
260
260
  --uc-primary-oklch-light: 10% 0 0;
261
261
  --uc-primary-oklch-dark: 97% 0 0;
262
262
  }
263
+
264
+ :where(.uc-contrast) {
265
+ --uc-border-light: oklch(50% 0 0);
266
+ --uc-border-dark: oklch(50% 0 0);
267
+
268
+ --uc-muted-light: oklch(98% 0 0);
269
+ --uc-muted-dark: oklch(16% 0 0);
270
+
271
+ --uc-muted-foreground-light: oklch(20% 0 0);
272
+ --uc-muted-foreground-dark: oklch(80% 0 0);
273
+
274
+ --uc-background-light: oklch(100% 0 0);
275
+ --uc-foreground-light: oklch(0% 0 0);
276
+
277
+ --uc-background-dark: oklch(10% 0 0);
278
+ --uc-foreground-dark: oklch(100% 0 0);
279
+ }
@@ -1,9 +1,35 @@
1
+ export const ExternalUploadSource: Readonly<{
2
+ FACEBOOK: "facebook";
3
+ DROPBOX: "dropbox";
4
+ GDRIVE: "gdrive";
5
+ GPHOTOS: "gphotos";
6
+ INSTAGRAM: "instagram";
7
+ FLICKR: "flickr";
8
+ VK: "vk";
9
+ EVERNOTE: "evernote";
10
+ BOX: "box";
11
+ ONEDRIVE: "onedrive";
12
+ HUDDLE: "huddle";
13
+ }>;
1
14
  export const UploadSource: Readonly<{
15
+ FACEBOOK: "facebook";
16
+ DROPBOX: "dropbox";
17
+ GDRIVE: "gdrive";
18
+ GPHOTOS: "gphotos";
19
+ INSTAGRAM: "instagram";
20
+ FLICKR: "flickr";
21
+ VK: "vk";
22
+ EVERNOTE: "evernote";
23
+ BOX: "box";
24
+ ONEDRIVE: "onedrive";
25
+ HUDDLE: "huddle";
2
26
  LOCAL: "local";
3
27
  DROP_AREA: "drop-area";
4
- URL_TAB: "url-tab";
5
28
  CAMERA: "camera";
6
29
  EXTERNAL: "external";
7
30
  API: "js-api";
31
+ URL: "url";
32
+ DRAW: "draw";
8
33
  }>;
34
+ export type SourceTypes = (typeof UploadSource)[keyof typeof UploadSource];
9
35
  //# sourceMappingURL=UploadSource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UploadSource.d.ts","sourceRoot":"","sources":["UploadSource.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
1
+ {"version":3,"file":"UploadSource.d.ts","sourceRoot":"","sources":["UploadSource.js"],"names":[],"mappings":"AACA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;;;;GASG;0BAEW,CAAC,mBAAmB,CAAC,CAAC,MAAM,mBAAmB,CAAC"}
@@ -1,8 +1,27 @@
1
+ // @ts-check
2
+ export const ExternalUploadSource = Object.freeze({
3
+ FACEBOOK: 'facebook',
4
+ DROPBOX: 'dropbox',
5
+ GDRIVE: 'gdrive',
6
+ GPHOTOS: 'gphotos',
7
+ INSTAGRAM: 'instagram',
8
+ FLICKR: 'flickr',
9
+ VK: 'vk',
10
+ EVERNOTE: 'evernote',
11
+ BOX: 'box',
12
+ ONEDRIVE: 'onedrive',
13
+ HUDDLE: 'huddle',
14
+ });
15
+
1
16
  export const UploadSource = Object.freeze({
2
17
  LOCAL: 'local',
3
18
  DROP_AREA: 'drop-area',
4
- URL_TAB: 'url-tab',
5
19
  CAMERA: 'camera',
6
20
  EXTERNAL: 'external',
7
21
  API: 'js-api',
22
+ URL: 'url',
23
+ DRAW: 'draw',
24
+ ...ExternalUploadSource,
8
25
  });
26
+
27
+ /** @typedef {(typeof UploadSource)[keyof typeof UploadSource]} SourceTypes */
package/env.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /** Do not edit this file manually. It's generated during build process. */
2
2
  export const PACKAGE_NAME: "blocks";
3
- export const PACKAGE_VERSION: "1.5.2";
3
+ export const PACKAGE_VERSION: "1.7.0";
4
4
  //# sourceMappingURL=env.d.ts.map
package/env.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Do not edit this file manually. It's generated during build process. */
2
2
  export const PACKAGE_NAME = 'blocks';
3
- export const PACKAGE_VERSION = '1.5.2';
3
+ export const PACKAGE_VERSION = '1.7.0';
package/index.d.ts CHANGED
@@ -36,4 +36,5 @@ export { defineLocale } from "./abstract/localeRegistry.js";
36
36
  export { loadFileUploaderFrom } from "./abstract/loadFileUploaderFrom.js";
37
37
  export { toKebabCase } from "./utils/toKebabCase.js";
38
38
  export { BaseComponent, Data, UID } from "@symbiotejs/symbiote";
39
+ export { UploadSource, ExternalUploadSource } from "./blocks/utils/UploadSource.js";
39
40
  //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -44,6 +44,7 @@ export { defineComponents } from './abstract/defineComponents.js';
44
44
  export { defineLocale } from './abstract/localeRegistry.js';
45
45
  export { loadFileUploaderFrom } from './abstract/loadFileUploaderFrom.js';
46
46
  export { toKebabCase } from './utils/toKebabCase.js';
47
+ export { UploadSource, ExternalUploadSource } from './blocks/utils/UploadSource.js';
47
48
 
48
49
  export * from './env.js';
49
50