@uploadcare/file-uploader 1.15.0-alpha.6 → 1.15.0-alpha.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["FileItem.js"],"names":[],"mappings":"AAoBA;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BC;IAGH,eASC;IAED;;;OAGG;IACH,0BAcC;IAXC,wCAA0C;IAa5C,eAAe;IACf,wBAgBC;IAED,eAAe;IACf,2BAuCC;IAED;;;;OAIG;IACH,kBAUC;IAED;;MAaQ;IAER;;;OAGG;IACH,uBAmDC;IA+CD,wEAAwE;IACxE,oBADY,CAAC,oBAAoB,CAAC,CAAC,MAAM,oBAAoB,CAAC,QA0B7D;IAaC,eAAe;IACf,kBAEE;IAWJ;;;MAEC;IAED;;;OAGG;IACH,uBAEC;IAED,wBAsFC;CACF;;;;;8BApc6B,iCAAiC;AAS/D;;;;;GAKG"}
1
+ {"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["FileItem.js"],"names":[],"mappings":"AAoBA;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BC;IAGH,eASC;IAED;;;OAGG;IACH,0BAeC;IAXC,wCAA0C;IAa5C,eAAe;IACf,wBAgBC;IAED,eAAe;IACf,2BAuCC;IAED;;;;OAIG;IACH,kBAUC;IAED;;MAaQ;IAER;;;OAGG;IACH,uBAmDC;IA+CD,wEAAwE;IACxE,oBADY,CAAC,oBAAoB,CAAC,CAAC,MAAM,oBAAoB,CAAC,QA0B7D;IAaC,eAAe;IACf,kBAEE;IAWJ;;;MAEC;IAED;;;OAGG;IACH,uBAEC;IAED,wBAsFC;CACF;;;;;8BArc6B,iCAAiC;AAS/D;;;;;GAKG"}
@@ -93,6 +93,7 @@ export class FileItem extends UploaderBlock {
93
93
  */
94
94
  _observerCallback(entries) {
95
95
  let [entry] = entries;
96
+
96
97
  this._isIntersecting = entry.isIntersecting;
97
98
  this._thumbRect = entry.boundingClientRect;
98
99
 
@@ -134,7 +135,11 @@ export class FileItem extends UploaderBlock {
134
135
  let entry = this._entry;
135
136
 
136
137
  if (entry.getValue('fileInfo') && entry.getValue('isImage')) {
137
- let size = this.cfg.thumbSize;
138
+ let size = Math.max(
139
+ parseInt(String(this?._thumbRect?.height || 0)),
140
+ parseInt(String(this?._thumbRect?.width || 0)),
141
+ this.cfg.thumbSize,
142
+ );
138
143
 
139
144
  let thumbUrl = await this.proxyUrl(
140
145
  createCdnUrl(
@@ -150,10 +155,6 @@ export class FileItem extends UploaderBlock {
150
155
  return;
151
156
  }
152
157
 
153
- if (entry.getValue('thumbUrl')) {
154
- return;
155
- }
156
-
157
158
  if (entry.getValue('file')?.type.includes('image')) {
158
159
  try {
159
160
  let thumbUrl = await generateThumb(entry.getValue('file'), this.cfg.thumbSize);
@@ -2,6 +2,7 @@ export class Thumb extends UploaderBlock {
2
2
  init$: {
3
3
  thumbUrl: string;
4
4
  badgeIcon: string;
5
+ uid: string;
5
6
  '*commonProgress': number;
6
7
  '*uploadList': never[];
7
8
  '*uploadQueue': import("@uploadcare/upload-client").Queue;
@@ -1 +1 @@
1
- {"version":3,"file":"Thumb.d.ts","sourceRoot":"","sources":["Thumb.js"],"names":[],"mappings":"AAIA;IAII;;;;;;;;;;;;;;;;MAIC;CAeJ;;;;8BAzB6B,iCAAiC"}
1
+ {"version":3,"file":"Thumb.d.ts","sourceRoot":"","sources":["Thumb.js"],"names":[],"mappings":"AAIA;IAII;;;;;;;;;;;;;;;;;MAKC;CAeJ;;;;8BA1B6B,iCAAiC"}
@@ -10,6 +10,7 @@ export class Thumb extends UploaderBlock {
10
10
  ...this.init$,
11
11
  thumbUrl: '',
12
12
  badgeIcon: '',
13
+ uid: '',
13
14
  };
14
15
  }
15
16
 
@@ -42,4 +43,6 @@ Thumb.bindAttributes({
42
43
  thumbUrl: null,
43
44
  // @ts-expect-error TODO: fix types inside symbiote
44
45
  badgeIcon: null,
46
+ // @ts-expect-error TODO: fix types inside symbiote
47
+ id: null,
45
48
  });
package/index.ssr.js CHANGED
@@ -1299,7 +1299,7 @@ export const Thumb = class {
1299
1299
  </div>
1300
1300
  </slot>
1301
1301
  `;
1302
- static observedAttributes = ["thumbUrl", "badgeIcon"];
1302
+ static observedAttributes = ["thumbUrl", "badgeIcon", "id"];
1303
1303
  static extSrcList = {
1304
1304
  FACEBOOK: "facebook",
1305
1305
  DROPBOX: "dropbox",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/file-uploader",
3
- "version": "1.15.0-alpha.6",
3
+ "version": "1.15.0-alpha.8",
4
4
  "description": "Building blocks for Uploadcare products integration",
5
5
  "keywords": [
6
6
  "web components",
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploaderMinimal.d.ts","sourceRoot":"","sources":["FileUploaderMinimal.js"],"names":[],"mappings":"AAQA;IAMI;;;;;;;;;;;;;;;;;;MAMC;CA0FJ;;;;8BA5G6B,oCAAoC"}
1
+ {"version":3,"file":"FileUploaderMinimal.d.ts","sourceRoot":"","sources":["FileUploaderMinimal.js"],"names":[],"mappings":"AAQA;IAMI;;;;;;;;;;;;;;;;;;MAMC;CA+FJ;;;;8BAjH6B,oCAAoC"}
@@ -58,16 +58,21 @@ export class FileUploaderMinimal extends SolutionBlock {
58
58
 
59
59
  this.subConfigValue('filesViewMode', (mode) => {
60
60
  this.setAttribute('mode', mode);
61
- });
62
61
 
63
- this.subConfigValue('multiple', (multiple) => {
64
- if (multiple) {
65
- this.style.removeProperty('--uc-grid-col');
66
- } else {
67
- this.style.setProperty('--uc-grid-col', '1');
68
- }
69
-
70
- this.$.singleUpload = !multiple;
62
+ this.subConfigValue('multiple', (multiple) => {
63
+ if (mode === 'grid') {
64
+ if (multiple) {
65
+ this.style.removeProperty('--uc-grid-col');
66
+ } else {
67
+ this.style.setProperty('--uc-grid-col', '1');
68
+ }
69
+
70
+ this.$.singleUpload = !multiple;
71
+ } else {
72
+ this.style.removeProperty('--uc-grid-col');
73
+ this.$.singleUpload = false;
74
+ }
75
+ });
71
76
  });
72
77
 
73
78
  this.modalManager.subscribe(ModalEvents.OPEN, () => {