@uploadcare/file-uploader 1.7.0 → 1.9.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 (36) hide show
  1. package/README.md +37 -62
  2. package/abstract/ActivityBlock.d.ts +1 -0
  3. package/abstract/ActivityBlock.d.ts.map +1 -1
  4. package/abstract/ActivityBlock.js +1 -0
  5. package/blocks/CloudImageEditor/src/CropFrame.d.ts +16 -11
  6. package/blocks/CloudImageEditor/src/CropFrame.d.ts.map +1 -1
  7. package/blocks/CloudImageEditor/src/CropFrame.js +42 -34
  8. package/blocks/CloudImageEditor/src/types.d.ts +56 -0
  9. package/blocks/CloudImageEditor/src/types.d.ts.map +1 -1
  10. package/blocks/CloudImageEditor/src/types.js +11 -0
  11. package/blocks/FileItem/FileItem.d.ts.map +1 -1
  12. package/blocks/FileItem/FileItem.js +7 -4
  13. package/blocks/LocalEditorImage/LocalEditorImage.d.ts +22 -0
  14. package/blocks/LocalEditorImage/LocalEditorImage.d.ts.map +1 -0
  15. package/blocks/LocalEditorImage/LocalEditorImage.js +139 -0
  16. package/blocks/LocalEditorImage/localEditorImage.css +19 -0
  17. package/blocks/themes/uc-basic/index.css +1 -0
  18. package/env.d.ts +1 -1
  19. package/env.js +1 -1
  20. package/index.d.ts +1 -0
  21. package/index.js +1 -0
  22. package/index.ssr.d.ts +68 -1
  23. package/index.ssr.d.ts.map +1 -1
  24. package/index.ssr.js +67 -1
  25. package/package.json +7 -3
  26. package/solutions/file-uploader/regular/FileUploaderRegular.js +1 -0
  27. package/web/file-uploader.iife.min.js +392 -29
  28. package/web/file-uploader.min.js +392 -29
  29. package/web/uc-basic.min.css +1 -1
  30. package/web/uc-cloud-image-editor.min.js +4 -4
  31. package/web/uc-file-uploader-inline.min.css +1 -1
  32. package/web/uc-file-uploader-inline.min.js +392 -29
  33. package/web/uc-file-uploader-minimal.min.js +2 -2
  34. package/web/uc-file-uploader-regular.min.css +1 -1
  35. package/web/uc-file-uploader-regular.min.js +392 -29
  36. package/web/uc-img.min.js +1 -1
@@ -0,0 +1,139 @@
1
+ // @ts-check
2
+ import { ActivityBlock } from '../../abstract/ActivityBlock.js';
3
+ import { UploaderBlock } from '../../abstract/UploaderBlock.js';
4
+
5
+ import 'tui-color-picker';
6
+ import 'tui-image-editor';
7
+
8
+ var rImageType = /data:(image\/.+);base64,/;
9
+
10
+ /**
11
+ *
12
+ * @param {*} data
13
+ * @returns
14
+ */
15
+ function base64ToBlob(data) {
16
+ var mimeString = '';
17
+ var raw, uInt8Array, i, rawLength;
18
+
19
+ // @ts-ignore
20
+ raw = data.replace(rImageType, function (header, imageType) {
21
+ mimeString = imageType;
22
+
23
+ return '';
24
+ });
25
+
26
+ raw = atob(raw);
27
+ rawLength = raw.length;
28
+ uInt8Array = new Uint8Array(rawLength); // eslint-disable-line
29
+
30
+ for (i = 0; i < rawLength; i += 1) {
31
+ uInt8Array[i] = raw.charCodeAt(i);
32
+ }
33
+
34
+ return new Blob([uInt8Array], { type: mimeString });
35
+ }
36
+
37
+ export class LocalEditorImage extends UploaderBlock {
38
+ couldBeCtxOwner = true;
39
+ static styleAttrs = ['uc-editor-image'];
40
+ activityType = ActivityBlock.activities.LOCAL_IMAGE_EDITOR;
41
+
42
+ /**
43
+ * @private
44
+ * @type {import('../../abstract/TypedData.js').TypedData | undefined}
45
+ */
46
+ _entry;
47
+
48
+ /**
49
+ * @private
50
+ * @type {undefined}
51
+ */
52
+ _instance;
53
+
54
+ get activityParams() {
55
+ const params = super.activityParams;
56
+ if ('internalId' in params) {
57
+ return params;
58
+ }
59
+ throw new Error(`Cloud Image Editor activity params not found`);
60
+ }
61
+
62
+ initCallback() {
63
+ super.initCallback();
64
+
65
+ this.registerActivity(this.activityType, {
66
+ onActivate: () => this.mounted(),
67
+ onDeactivate: () => this.unmounted(),
68
+ });
69
+
70
+ }
71
+
72
+ mounted() {
73
+ const { internalId } = this.activityParams;
74
+ this._entry = this.uploadCollection.read(internalId);
75
+
76
+ if (!this._entry) {
77
+ throw new Error(`Entry with internalId "${internalId}" not found`);
78
+ }
79
+
80
+ const file = this._entry.getValue('file');
81
+ const cdnUrl = this._entry.getValue('cdnUrl');
82
+
83
+ // @ts-ignore
84
+ const instance = new tui.ImageEditor(document.querySelector('#tui-image-editor-container'), {
85
+ includeUI: {
86
+ loadImage: {
87
+ path: cdnUrl ? cdnUrl : URL.createObjectURL(file),
88
+ name: file?.name ?? "cdnUrl",
89
+ }
90
+ },
91
+ cssMaxWidth: 600,
92
+ cssMaxHeight: 300,
93
+ usageStatistics: false,
94
+ });
95
+
96
+ this._applyButton()
97
+
98
+ this._instance = instance;
99
+ }
100
+
101
+ _applyButton () {
102
+ const button = document.createElement('button');
103
+ button.setAttribute('class', 'tui-image-editor-download-btn-save');
104
+ button.textContent = 'Save'
105
+
106
+ document.querySelector('.tui-image-editor-header-buttons')?.appendChild(button);
107
+
108
+ button.addEventListener('click', async (event) => {
109
+ event.preventDefault()
110
+ event.stopPropagation()
111
+
112
+ if (!this._entry) {
113
+ return;
114
+ }
115
+
116
+ // @ts-ignore
117
+ const dataURL = this._instance.toDataURL();
118
+ const blob = base64ToBlob(dataURL);
119
+
120
+ this._entry.setMultipleValues({
121
+ file: new File([blob], 'image.jpeg', {
122
+ lastModified: new Date().getTime(),
123
+ type: blob.type,
124
+ })
125
+ })
126
+
127
+ this.historyBack();
128
+ });
129
+ }
130
+
131
+ unmounted() {
132
+ this._instance = undefined;
133
+ this._entry = undefined;
134
+ // @ts-ignore
135
+ document.querySelector('#tui-image-editor-container').innerHTML = '';
136
+ }
137
+ }
138
+
139
+ LocalEditorImage.template = `<div id="tui-image-editor-container"></div>`;
@@ -0,0 +1,19 @@
1
+ uc-local-editor-image {
2
+ width: 100%;
3
+ height: 648px;
4
+ min-width: 780px;
5
+ max-width: 1060px;
6
+ display: block;
7
+ }
8
+
9
+ uc-local-editor-image > #tui-image-editor-container {
10
+
11
+ }
12
+
13
+ :where(uc-local-editor-image) > #tui-image-editor-container .tui-image-editor-header-logo {
14
+ display: none;
15
+ }
16
+
17
+ :where(uc-local-editor-image) > #tui-image-editor-container .tui-image-editor-header-buttons > *:not(.tui-image-editor-download-btn-save) {
18
+ display: none;
19
+ }
@@ -30,6 +30,7 @@
30
30
  @import url('../../CloudImageEditor/index.css');
31
31
  @import url('../../CloudImageEditorActivity/index.css');
32
32
  @import url('../../Select/select.css');
33
+ @import url('../../LocalEditorImage/localEditorImage.css');
33
34
 
34
35
  /* POST RESET */
35
36
  @import url('post-reset.css');
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.7.0";
3
+ export const PACKAGE_VERSION: "1.8.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.7.0';
3
+ export const PACKAGE_VERSION = '1.8.0';
package/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export { FormInput } from "./blocks/FormInput/FormInput.js";
27
27
  export { ActivityHeader } from "./blocks/ActivityHeader/ActivityHeader.js";
28
28
  export { Select } from "./blocks/Select/Select.js";
29
29
  export { Copyright } from "./blocks/Copyright/Copyright.js";
30
+ export { LocalEditorImage } from "./blocks/LocalEditorImage/LocalEditorImage.js";
30
31
  export { FileUploaderRegular } from "./solutions/file-uploader/regular/FileUploaderRegular.js";
31
32
  export { FileUploaderMinimal } from "./solutions/file-uploader/minimal/FileUploaderMinimal.js";
32
33
  export { FileUploaderInline } from "./solutions/file-uploader/inline/FileUploaderInline.js";
package/index.js CHANGED
@@ -32,6 +32,7 @@ export { FormInput } from './blocks/FormInput/FormInput.js';
32
32
  export { ActivityHeader } from './blocks/ActivityHeader/ActivityHeader.js';
33
33
  export { Select } from './blocks/Select/Select.js';
34
34
  export { Copyright } from './blocks/Copyright/Copyright.js';
35
+ export { LocalEditorImage } from './blocks/LocalEditorImage/LocalEditorImage.js';
35
36
 
36
37
  // Solutions:
37
38
  export { FileUploaderRegular } from './solutions/file-uploader/regular/FileUploaderRegular.js';
package/index.ssr.d.ts CHANGED
@@ -8,6 +8,7 @@ export const ActivityBlock: {
8
8
  URL: string;
9
9
  CLOUD_IMG_EDIT: string;
10
10
  EXTERNAL: string;
11
+ LOCAL_IMAGE_EDITOR: string;
11
12
  };
12
13
  reg: () => void;
13
14
  styleAttrs: any[];
@@ -24,6 +25,7 @@ export const ActivityHeader: {
24
25
  URL: string;
25
26
  CLOUD_IMG_EDIT: string;
26
27
  EXTERNAL: string;
28
+ LOCAL_IMAGE_EDITOR: string;
27
29
  };
28
30
  reg: () => void;
29
31
  styleAttrs: any[];
@@ -96,6 +98,7 @@ export const CameraSource: {
96
98
  URL: string;
97
99
  CLOUD_IMG_EDIT: string;
98
100
  EXTERNAL: string;
101
+ LOCAL_IMAGE_EDITOR: string;
99
102
  };
100
103
  reg: () => void;
101
104
  styleAttrs: any[];
@@ -154,6 +157,7 @@ export const CloudImageEditorActivity: {
154
157
  URL: string;
155
158
  CLOUD_IMG_EDIT: string;
156
159
  EXTERNAL: string;
160
+ LOCAL_IMAGE_EDITOR: string;
157
161
  };
158
162
  reg: () => void;
159
163
  styleAttrs: any[];
@@ -256,6 +260,7 @@ export const DropArea: {
256
260
  URL: string;
257
261
  CLOUD_IMG_EDIT: string;
258
262
  EXTERNAL: string;
263
+ LOCAL_IMAGE_EDITOR: string;
259
264
  };
260
265
  reg: () => void;
261
266
  is: string;
@@ -368,6 +373,7 @@ export const ExternalSource: {
368
373
  URL: string;
369
374
  CLOUD_IMG_EDIT: string;
370
375
  EXTERNAL: string;
376
+ LOCAL_IMAGE_EDITOR: string;
371
377
  };
372
378
  reg: () => void;
373
379
  styleAttrs: any[];
@@ -432,6 +438,7 @@ export const FileItem: {
432
438
  URL: string;
433
439
  CLOUD_IMG_EDIT: string;
434
440
  EXTERNAL: string;
441
+ LOCAL_IMAGE_EDITOR: string;
435
442
  };
436
443
  reg: () => void;
437
444
  styleAttrs: any[];
@@ -503,6 +510,7 @@ export const FormInput: {
503
510
  URL: string;
504
511
  CLOUD_IMG_EDIT: string;
505
512
  EXTERNAL: string;
513
+ LOCAL_IMAGE_EDITOR: string;
506
514
  };
507
515
  reg: () => void;
508
516
  styleAttrs: any[];
@@ -533,6 +541,57 @@ export const LineLoaderUi: {
533
541
  is: string;
534
542
  bindAttributes: () => void;
535
543
  };
544
+ export const LocalEditorImage: {
545
+ new (): {};
546
+ styleAttrs: any[];
547
+ template: string;
548
+ extSrcList: {
549
+ FACEBOOK: string;
550
+ DROPBOX: string;
551
+ GDRIVE: string;
552
+ GPHOTOS: string;
553
+ INSTAGRAM: string;
554
+ FLICKR: string;
555
+ VK: string;
556
+ EVERNOTE: string;
557
+ BOX: string;
558
+ ONEDRIVE: string;
559
+ HUDDLE: string;
560
+ };
561
+ sourceTypes: {
562
+ LOCAL: string;
563
+ DROP_AREA: string;
564
+ CAMERA: string;
565
+ EXTERNAL: string;
566
+ API: string;
567
+ URL: string;
568
+ DRAW: string;
569
+ FACEBOOK: string;
570
+ DROPBOX: string;
571
+ GDRIVE: string;
572
+ GPHOTOS: string;
573
+ INSTAGRAM: string;
574
+ FLICKR: string;
575
+ VK: string;
576
+ EVERNOTE: string;
577
+ BOX: string;
578
+ ONEDRIVE: string;
579
+ HUDDLE: string;
580
+ };
581
+ activities: {
582
+ START_FROM: string;
583
+ CAMERA: string;
584
+ DRAW: string;
585
+ UPLOAD_LIST: string;
586
+ URL: string;
587
+ CLOUD_IMG_EDIT: string;
588
+ EXTERNAL: string;
589
+ LOCAL_IMAGE_EDITOR: string;
590
+ };
591
+ reg: () => void;
592
+ is: string;
593
+ bindAttributes: () => void;
594
+ };
536
595
  export const Modal: {
537
596
  new (): {};
538
597
  styleAttrs: any[];
@@ -543,7 +602,7 @@ export const Modal: {
543
602
  bindAttributes: () => void;
544
603
  };
545
604
  export const PACKAGE_NAME: "blocks";
546
- export const PACKAGE_VERSION: "1.7.0";
605
+ export const PACKAGE_VERSION: "1.8.0";
547
606
  export const PresenceToggle: {
548
607
  new (): {};
549
608
  template: string;
@@ -604,6 +663,7 @@ export const ProgressBarCommon: {
604
663
  URL: string;
605
664
  CLOUD_IMG_EDIT: string;
606
665
  EXTERNAL: string;
666
+ LOCAL_IMAGE_EDITOR: string;
607
667
  };
608
668
  reg: () => void;
609
669
  styleAttrs: any[];
@@ -664,6 +724,7 @@ export const SimpleBtn: {
664
724
  URL: string;
665
725
  CLOUD_IMG_EDIT: string;
666
726
  EXTERNAL: string;
727
+ LOCAL_IMAGE_EDITOR: string;
667
728
  };
668
729
  reg: () => void;
669
730
  is: string;
@@ -729,6 +790,7 @@ export const SourceBtn: {
729
790
  URL: string;
730
791
  CLOUD_IMG_EDIT: string;
731
792
  EXTERNAL: string;
793
+ LOCAL_IMAGE_EDITOR: string;
732
794
  };
733
795
  reg: () => void;
734
796
  styleAttrs: any[];
@@ -753,6 +815,7 @@ export const StartFrom: {
753
815
  URL: string;
754
816
  CLOUD_IMG_EDIT: string;
755
817
  EXTERNAL: string;
818
+ LOCAL_IMAGE_EDITOR: string;
756
819
  };
757
820
  reg: () => void;
758
821
  styleAttrs: any[];
@@ -835,6 +898,7 @@ export const UploadCtxProvider: {
835
898
  URL: string;
836
899
  CLOUD_IMG_EDIT: string;
837
900
  EXTERNAL: string;
901
+ LOCAL_IMAGE_EDITOR: string;
838
902
  };
839
903
  reg: () => void;
840
904
  styleAttrs: any[];
@@ -885,6 +949,7 @@ export const UploadList: {
885
949
  URL: string;
886
950
  CLOUD_IMG_EDIT: string;
887
951
  EXTERNAL: string;
952
+ LOCAL_IMAGE_EDITOR: string;
888
953
  };
889
954
  reg: () => void;
890
955
  styleAttrs: any[];
@@ -965,6 +1030,7 @@ export const UploaderBlock: {
965
1030
  URL: string;
966
1031
  CLOUD_IMG_EDIT: string;
967
1032
  EXTERNAL: string;
1033
+ LOCAL_IMAGE_EDITOR: string;
968
1034
  };
969
1035
  reg: () => void;
970
1036
  styleAttrs: any[];
@@ -1015,6 +1081,7 @@ export const UrlSource: {
1015
1081
  URL: string;
1016
1082
  CLOUD_IMG_EDIT: string;
1017
1083
  EXTERNAL: string;
1084
+ LOCAL_IMAGE_EDITOR: string;
1018
1085
  };
1019
1086
  reg: () => void;
1020
1087
  styleAttrs: any[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.ssr.d.ts","sourceRoot":"","sources":["index.ssr.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;EAcE;AACF;;;;;;;;;;;;;;;EAcE;AACF;;;;;EAIE;AACF;;;;;;EAKE;AACF;;;;;;;;EAYE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqFE;AACF;;;;;;;;EAuCE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CE;AACF;;;;;;;;EAuCE;AACF;;;;;;;EA0FE;AACF;;;;;;;EAaE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;EAeE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEE;AACF;;;;;;;EAWE;AACF;;;;;;;EAWE;AACF;;;;;;;EASE;AACF;;;;;;EAKE;AACF;;;;;;;EAWE;AACF;;;;;;;EAME;AACF;;;;;;;EAWE;AACF;;;;;;;EA2IE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EE;;;;;;;;;;;;;;AAcF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmFE;AACF;;;;;;EAKE;AACF;;;;;;EAKE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CE;AACF;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+FE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuEE;AACK,yCAAiC;AACjC,qCAA6B;AAC7B,6CAAqC;AACrC,oCAA4B"}
package/index.ssr.js CHANGED
@@ -7,6 +7,7 @@ export const ActivityBlock = class {
7
7
  URL: "url",
8
8
  CLOUD_IMG_EDIT: "cloud-image-edit",
9
9
  EXTERNAL: "external",
10
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
10
11
  };
11
12
  static reg = () => {};
12
13
  static styleAttrs = [];
@@ -22,6 +23,7 @@ export const ActivityHeader = class {
22
23
  URL: "url",
23
24
  CLOUD_IMG_EDIT: "cloud-image-edit",
24
25
  EXTERNAL: "external",
26
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
25
27
  };
26
28
  static reg = () => {};
27
29
  static styleAttrs = [];
@@ -132,6 +134,7 @@ export const CameraSource = class {
132
134
  URL: "url",
133
135
  CLOUD_IMG_EDIT: "cloud-image-edit",
134
136
  EXTERNAL: "external",
137
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
135
138
  };
136
139
  static reg = () => {};
137
140
  static styleAttrs = [];
@@ -220,6 +223,7 @@ export const CloudImageEditorActivity = class {
220
223
  URL: "url",
221
224
  CLOUD_IMG_EDIT: "cloud-image-edit",
222
225
  EXTERNAL: "external",
226
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
223
227
  };
224
228
  static reg = () => {};
225
229
  static styleAttrs = [];
@@ -456,6 +460,7 @@ export const DropArea = class {
456
460
  URL: "url",
457
461
  CLOUD_IMG_EDIT: "cloud-image-edit",
458
462
  EXTERNAL: "external",
463
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
459
464
  };
460
465
  static reg = () => {};
461
466
  static is = `sym-1`;
@@ -742,6 +747,7 @@ export const ExternalSource = class {
742
747
  URL: "url",
743
748
  CLOUD_IMG_EDIT: "cloud-image-edit",
744
749
  EXTERNAL: "external",
750
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
745
751
  };
746
752
  static reg = () => {};
747
753
  static styleAttrs = [];
@@ -839,6 +845,7 @@ export const FileItem = class {
839
845
  URL: "url",
840
846
  CLOUD_IMG_EDIT: "cloud-image-edit",
841
847
  EXTERNAL: "external",
848
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
842
849
  };
843
850
  static reg = () => {};
844
851
  static styleAttrs = [];
@@ -906,6 +913,7 @@ export const FormInput = class {
906
913
  URL: "url",
907
914
  CLOUD_IMG_EDIT: "cloud-image-edit",
908
915
  EXTERNAL: "external",
916
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
909
917
  };
910
918
  static reg = () => {};
911
919
  static styleAttrs = [];
@@ -961,6 +969,56 @@ export const LineLoaderUi = class {
961
969
  static is = `sym-1`;
962
970
  static bindAttributes = () => {};
963
971
  };
972
+ export const LocalEditorImage = class {
973
+ static styleAttrs = [];
974
+ static template = `<div id="tui-image-editor-container"></div>`;
975
+ static extSrcList = {
976
+ FACEBOOK: "facebook",
977
+ DROPBOX: "dropbox",
978
+ GDRIVE: "gdrive",
979
+ GPHOTOS: "gphotos",
980
+ INSTAGRAM: "instagram",
981
+ FLICKR: "flickr",
982
+ VK: "vk",
983
+ EVERNOTE: "evernote",
984
+ BOX: "box",
985
+ ONEDRIVE: "onedrive",
986
+ HUDDLE: "huddle",
987
+ };
988
+ static sourceTypes = {
989
+ LOCAL: "local",
990
+ DROP_AREA: "drop-area",
991
+ CAMERA: "camera",
992
+ EXTERNAL: "external",
993
+ API: "js-api",
994
+ URL: "url",
995
+ DRAW: "draw",
996
+ FACEBOOK: "facebook",
997
+ DROPBOX: "dropbox",
998
+ GDRIVE: "gdrive",
999
+ GPHOTOS: "gphotos",
1000
+ INSTAGRAM: "instagram",
1001
+ FLICKR: "flickr",
1002
+ VK: "vk",
1003
+ EVERNOTE: "evernote",
1004
+ BOX: "box",
1005
+ ONEDRIVE: "onedrive",
1006
+ HUDDLE: "huddle",
1007
+ };
1008
+ static activities = {
1009
+ START_FROM: "start-from",
1010
+ CAMERA: "camera",
1011
+ DRAW: "draw",
1012
+ UPLOAD_LIST: "upload-list",
1013
+ URL: "url",
1014
+ CLOUD_IMG_EDIT: "cloud-image-edit",
1015
+ EXTERNAL: "external",
1016
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
1017
+ };
1018
+ static reg = () => {};
1019
+ static is = `sym-1`;
1020
+ static bindAttributes = () => {};
1021
+ };
964
1022
  export const Modal = class {
965
1023
  static styleAttrs = [];
966
1024
  static StateConsumerScope = `modal`;
@@ -974,7 +1032,7 @@ export const Modal = class {
974
1032
  static bindAttributes = () => {};
975
1033
  };
976
1034
  export const PACKAGE_NAME = `blocks`;
977
- export const PACKAGE_VERSION = `1.7.0`;
1035
+ export const PACKAGE_VERSION = `1.8.0`;
978
1036
  export const PresenceToggle = class {
979
1037
  static template = `<slot></slot> `;
980
1038
  static reg = () => {};
@@ -1032,6 +1090,7 @@ export const ProgressBarCommon = class {
1032
1090
  URL: "url",
1033
1091
  CLOUD_IMG_EDIT: "cloud-image-edit",
1034
1092
  EXTERNAL: "external",
1093
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
1035
1094
  };
1036
1095
  static reg = () => {};
1037
1096
  static styleAttrs = [];
@@ -1099,6 +1158,7 @@ export const SimpleBtn = class {
1099
1158
  URL: "url",
1100
1159
  CLOUD_IMG_EDIT: "cloud-image-edit",
1101
1160
  EXTERNAL: "external",
1161
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
1102
1162
  };
1103
1163
  static reg = () => {};
1104
1164
  static is = `sym-1`;
@@ -1175,6 +1235,7 @@ export const SourceBtn = class {
1175
1235
  URL: "url",
1176
1236
  CLOUD_IMG_EDIT: "cloud-image-edit",
1177
1237
  EXTERNAL: "external",
1238
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
1178
1239
  };
1179
1240
  static reg = () => {};
1180
1241
  static styleAttrs = [];
@@ -1197,6 +1258,7 @@ export const StartFrom = class {
1197
1258
  URL: "url",
1198
1259
  CLOUD_IMG_EDIT: "cloud-image-edit",
1199
1260
  EXTERNAL: "external",
1261
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
1200
1262
  };
1201
1263
  static reg = () => {};
1202
1264
  static styleAttrs = [];
@@ -1277,6 +1339,7 @@ export const UploadCtxProvider = class {
1277
1339
  URL: "url",
1278
1340
  CLOUD_IMG_EDIT: "cloud-image-edit",
1279
1341
  EXTERNAL: "external",
1342
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
1280
1343
  };
1281
1344
  static reg = () => {};
1282
1345
  static styleAttrs = [];
@@ -1372,6 +1435,7 @@ export const UploadList = class {
1372
1435
  URL: "url",
1373
1436
  CLOUD_IMG_EDIT: "cloud-image-edit",
1374
1437
  EXTERNAL: "external",
1438
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
1375
1439
  };
1376
1440
  static reg = () => {};
1377
1441
  static styleAttrs = [];
@@ -1440,6 +1504,7 @@ export const UploaderBlock = class {
1440
1504
  URL: "url",
1441
1505
  CLOUD_IMG_EDIT: "cloud-image-edit",
1442
1506
  EXTERNAL: "external",
1507
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
1443
1508
  };
1444
1509
  static reg = () => {};
1445
1510
  static styleAttrs = [];
@@ -1511,6 +1576,7 @@ export const UrlSource = class {
1511
1576
  URL: "url",
1512
1577
  CLOUD_IMG_EDIT: "cloud-image-edit",
1513
1578
  EXTERNAL: "external",
1579
+ LOCAL_IMAGE_EDITOR: "local-image-editor",
1514
1580
  };
1515
1581
  static reg = () => {};
1516
1582
  static styleAttrs = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/file-uploader",
3
- "version": "1.7.0",
3
+ "version": "1.9.0-alpha.0",
4
4
  "description": "Building blocks for Uploadcare products integration",
5
5
  "keywords": [
6
6
  "web components",
@@ -35,7 +35,9 @@
35
35
  "MIT"
36
36
  ],
37
37
  "type": "module",
38
- "sideEffects": ["*.css"],
38
+ "sideEffects": [
39
+ "*.css"
40
+ ],
39
41
  "module": "./index.js",
40
42
  "exports": {
41
43
  ".": {
@@ -51,6 +53,7 @@
51
53
  "./locales/*": "./locales/*"
52
54
  },
53
55
  "repository": "https://github.com/uploadcare/file-uploader/",
56
+ "homepage": "https://uploadcare.com/",
54
57
  "files": [
55
58
  "{abstract,blocks,solutions,web,utils,types,locales}/**/*.{js,css,d.ts,d.ts.map}",
56
59
  "index.{js,d.ts,d.ts.map}",
@@ -137,6 +140,7 @@
137
140
  "@symbiotejs/symbiote": "^1.11.7",
138
141
  "@uploadcare/image-shrink": "^6.14.1",
139
142
  "@uploadcare/upload-client": "^6.14.1",
140
- "keyux": "^0.7.1"
143
+ "keyux": "^0.7.1",
144
+ "tui-image-editor": "^3.15.3"
141
145
  }
142
146
  }
@@ -55,6 +55,7 @@ FileUploaderRegular.template = /* HTML */ `
55
55
  <uc-url-source></uc-url-source>
56
56
  <uc-external-source></uc-external-source>
57
57
  <uc-cloud-image-editor-activity></uc-cloud-image-editor-activity>
58
+ <uc-local-editor-image></uc-local-editor-image>
58
59
  </uc-modal>
59
60
  `;
60
61