@masters-union/union-stack 0.3.14 → 0.3.16
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.
- package/dist/cdn/loader.v1.global.js +2 -2
- package/dist/cdn/loader.v1.global.js.map +1 -1
- package/dist/{chunk-P32VSH6B.cjs → chunk-3FCZBKNN.cjs} +8 -7
- package/dist/chunk-3FCZBKNN.cjs.map +1 -0
- package/dist/{chunk-LOOZO22K.js → chunk-7NJTA5ZD.js} +10 -47
- package/dist/chunk-7NJTA5ZD.js.map +1 -0
- package/dist/{chunk-24FXFOLY.cjs → chunk-EBE7EIOZ.cjs} +18 -56
- package/dist/chunk-EBE7EIOZ.cjs.map +1 -0
- package/dist/chunk-GTE65IAM.cjs +58 -0
- package/dist/chunk-GTE65IAM.cjs.map +1 -0
- package/dist/{chunk-A6QABSM5.js → chunk-OZGVTEMZ.js} +4 -3
- package/dist/chunk-OZGVTEMZ.js.map +1 -0
- package/dist/chunk-XBQENFBZ.js +54 -0
- package/dist/chunk-XBQENFBZ.js.map +1 -0
- package/dist/{client-C0qMOfb3.d.ts → client-BCLIIiX2.d.ts} +1 -1
- package/dist/{client-DOTa3Mai.d.cts → client-CSZ-4GVl.d.cts} +1 -1
- package/dist/index.cjs +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/node.cjs +8 -7
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.js +2 -1
- package/dist/node.js.map +1 -1
- package/dist/picker.cjs +22 -1
- package/dist/picker.cjs.map +1 -1
- package/dist/picker.d.cts +3 -3
- package/dist/picker.d.ts +3 -3
- package/dist/picker.js +22 -1
- package/dist/picker.js.map +1 -1
- package/dist/react.cjs +4 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +3 -2
- package/dist/react.js.map +1 -1
- package/dist/{types-ZCfjNZls.d.cts → types-BWs1slkL.d.cts} +1 -1
- package/dist/{types-ZCfjNZls.d.ts → types-BWs1slkL.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-24FXFOLY.cjs.map +0 -1
- package/dist/chunk-A6QABSM5.js.map +0 -1
- package/dist/chunk-LOOZO22K.js.map +0 -1
- package/dist/chunk-P32VSH6B.cjs.map +0 -1
package/dist/picker.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { U as UnionStackClient, P as PickerOptions, a as PickerHandle } from './client-
|
|
2
|
-
export { b as PickerBranding, c as PickerTheme } from './client-
|
|
3
|
-
import { P as PickResponse } from './types-
|
|
1
|
+
import { U as UnionStackClient, P as PickerOptions, a as PickerHandle } from './client-CSZ-4GVl.cjs';
|
|
2
|
+
export { b as PickerBranding, c as PickerTheme } from './client-CSZ-4GVl.cjs';
|
|
3
|
+
import { P as PickResponse } from './types-BWs1slkL.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Single-shot file picker modal. Built imperatively (no framework) so it can
|
package/dist/picker.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { U as UnionStackClient, P as PickerOptions, a as PickerHandle } from './client-
|
|
2
|
-
export { b as PickerBranding, c as PickerTheme } from './client-
|
|
3
|
-
import { P as PickResponse } from './types-
|
|
1
|
+
import { U as UnionStackClient, P as PickerOptions, a as PickerHandle } from './client-BCLIIiX2.js';
|
|
2
|
+
export { b as PickerBranding, c as PickerTheme } from './client-BCLIIiX2.js';
|
|
3
|
+
import { P as PickResponse } from './types-BWs1slkL.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Single-shot file picker modal. Built imperatively (no framework) so it can
|
package/dist/picker.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EMPTY_FILE_MESSAGE } from './chunk-XBQENFBZ.js';
|
|
2
|
+
|
|
1
3
|
// src/picker/styles.ts
|
|
2
4
|
var STYLE_ID = "unionstack-picker-styles";
|
|
3
5
|
var FONT_ID = "unionstack-picker-fonts";
|
|
@@ -1697,8 +1699,25 @@ var Picker = class {
|
|
|
1697
1699
|
const notices = [];
|
|
1698
1700
|
if (rejectedType > 0) notices.push(`${rejectedType} file${rejectedType > 1 ? "s" : ""} skipped \u2014 unsupported type`);
|
|
1699
1701
|
if (overCap > 0) notices.push(`${overCap} file${overCap > 1 ? "s" : ""} skipped \u2014 max ${cap} allowed`);
|
|
1702
|
+
const emptyCount = chosen.filter((f) => f.size === 0).length;
|
|
1703
|
+
if (emptyCount > 0) notices.push(`${emptyCount} empty file${emptyCount > 1 ? "s" : ""} skipped \u2014 open it in iCloud/Drive to download first`);
|
|
1700
1704
|
if (notices.length) this.flashNotice(notices.join(" \xB7 "));
|
|
1701
1705
|
for (const file of chosen) {
|
|
1706
|
+
if (file.size === 0) {
|
|
1707
|
+
const item2 = {
|
|
1708
|
+
uploadId: cryptoId(),
|
|
1709
|
+
file,
|
|
1710
|
+
originalFile: file,
|
|
1711
|
+
edited: false,
|
|
1712
|
+
state: "failed",
|
|
1713
|
+
progress: 0,
|
|
1714
|
+
error: EMPTY_FILE_MESSAGE,
|
|
1715
|
+
errorCode: "EMPTY_FILE"
|
|
1716
|
+
};
|
|
1717
|
+
this.items.push(item2);
|
|
1718
|
+
this.renderItem(item2);
|
|
1719
|
+
continue;
|
|
1720
|
+
}
|
|
1702
1721
|
if (this.opts.maxFileSize && file.size > this.opts.maxFileSize) {
|
|
1703
1722
|
const item2 = {
|
|
1704
1723
|
uploadId: cryptoId(),
|
|
@@ -2090,8 +2109,10 @@ var Picker = class {
|
|
|
2090
2109
|
const item = itemByUploadId.get(p.uploadId);
|
|
2091
2110
|
if (item) {
|
|
2092
2111
|
item.error = err.message;
|
|
2112
|
+
item.errorCode = err.code;
|
|
2093
2113
|
this.setItemState(item, "failed");
|
|
2094
2114
|
}
|
|
2115
|
+
if (err.code === "EMPTY_FILE") this.flashNotice(EMPTY_FILE_MESSAGE);
|
|
2095
2116
|
this.opts.onFileUploadFailed?.(p, err);
|
|
2096
2117
|
},
|
|
2097
2118
|
onUploadDone: (r) => {
|
|
@@ -2126,7 +2147,7 @@ var Picker = class {
|
|
|
2126
2147
|
source: "local"
|
|
2127
2148
|
},
|
|
2128
2149
|
error: {
|
|
2129
|
-
code: "VALIDATION",
|
|
2150
|
+
code: i.errorCode || "VALIDATION",
|
|
2130
2151
|
message: i.error || "failed",
|
|
2131
2152
|
retryable: false
|
|
2132
2153
|
}
|