@masters-union/union-stack 0.3.15 → 0.3.17

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 (47) hide show
  1. package/dist/cdn/loader.v1.global.js +2 -2
  2. package/dist/cdn/loader.v1.global.js.map +1 -1
  3. package/dist/{chunk-WQ5VYKST.cjs → chunk-4645KBSE.cjs} +8 -7
  4. package/dist/chunk-4645KBSE.cjs.map +1 -0
  5. package/dist/chunk-G2H5WZDV.js +56 -0
  6. package/dist/chunk-G2H5WZDV.js.map +1 -0
  7. package/dist/{chunk-ZOJLHPVE.cjs → chunk-PVM2ZX45.cjs} +14 -64
  8. package/dist/chunk-PVM2ZX45.cjs.map +1 -0
  9. package/dist/{chunk-IX6AZKPO.js → chunk-QQFNG3ZF.js} +4 -3
  10. package/dist/chunk-QQFNG3ZF.js.map +1 -0
  11. package/dist/{chunk-U5MLTERT.js → chunk-RYS4MXXL.js} +6 -55
  12. package/dist/chunk-RYS4MXXL.js.map +1 -0
  13. package/dist/chunk-TQDC5KIC.cjs +60 -0
  14. package/dist/chunk-TQDC5KIC.cjs.map +1 -0
  15. package/dist/{client-C0qMOfb3.d.ts → client-BofkorBV.d.ts} +1 -1
  16. package/dist/{client-DOTa3Mai.d.cts → client-C_pEvbZS.d.cts} +1 -1
  17. package/dist/index.cjs +5 -4
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +3 -3
  20. package/dist/index.d.ts +3 -3
  21. package/dist/index.js +4 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/node.cjs +8 -7
  24. package/dist/node.cjs.map +1 -1
  25. package/dist/node.d.cts +2 -2
  26. package/dist/node.d.ts +2 -2
  27. package/dist/node.js +2 -1
  28. package/dist/node.js.map +1 -1
  29. package/dist/picker.cjs +9 -2
  30. package/dist/picker.cjs.map +1 -1
  31. package/dist/picker.d.cts +3 -3
  32. package/dist/picker.d.ts +3 -3
  33. package/dist/picker.js +9 -2
  34. package/dist/picker.js.map +1 -1
  35. package/dist/react.cjs +4 -3
  36. package/dist/react.cjs.map +1 -1
  37. package/dist/react.d.cts +4 -4
  38. package/dist/react.d.ts +4 -4
  39. package/dist/react.js +3 -2
  40. package/dist/react.js.map +1 -1
  41. package/dist/{types-ZCfjNZls.d.ts → types-BsGu9Oi3.d.cts} +3 -1
  42. package/dist/{types-ZCfjNZls.d.cts → types-BsGu9Oi3.d.ts} +3 -1
  43. package/package.json +1 -1
  44. package/dist/chunk-IX6AZKPO.js.map +0 -1
  45. package/dist/chunk-U5MLTERT.js.map +0 -1
  46. package/dist/chunk-WQ5VYKST.cjs.map +0 -1
  47. package/dist/chunk-ZOJLHPVE.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-DOTa3Mai.cjs';
2
- export { b as PickerBranding, c as PickerTheme } from './client-DOTa3Mai.cjs';
3
- import { P as PickResponse } from './types-ZCfjNZls.cjs';
1
+ import { U as UnionStackClient, P as PickerOptions, a as PickerHandle } from './client-C_pEvbZS.cjs';
2
+ export { b as PickerBranding, c as PickerTheme } from './client-C_pEvbZS.cjs';
3
+ import { P as PickResponse } from './types-BsGu9Oi3.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-C0qMOfb3.js';
2
- export { b as PickerBranding, c as PickerTheme } from './client-C0qMOfb3.js';
3
- import { P as PickResponse } from './types-ZCfjNZls.js';
1
+ import { U as UnionStackClient, P as PickerOptions, a as PickerHandle } from './client-BofkorBV.js';
2
+ export { b as PickerBranding, c as PickerTheme } from './client-BofkorBV.js';
3
+ import { P as PickResponse } from './types-BsGu9Oi3.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-G2H5WZDV.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,6 +1699,8 @@ 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) {
1702
1706
  if (file.size === 0) {
@@ -1707,7 +1711,8 @@ var Picker = class {
1707
1711
  edited: false,
1708
1712
  state: "failed",
1709
1713
  progress: 0,
1710
- error: "File is empty (0 bytes) \u2014 if it lives in iCloud/Drive, open it once to download it, then re-add"
1714
+ error: EMPTY_FILE_MESSAGE,
1715
+ errorCode: "EMPTY_FILE"
1711
1716
  };
1712
1717
  this.items.push(item2);
1713
1718
  this.renderItem(item2);
@@ -2104,8 +2109,10 @@ var Picker = class {
2104
2109
  const item = itemByUploadId.get(p.uploadId);
2105
2110
  if (item) {
2106
2111
  item.error = err.message;
2112
+ item.errorCode = err.code;
2107
2113
  this.setItemState(item, "failed");
2108
2114
  }
2115
+ if (err.code === "EMPTY_FILE") this.flashNotice(EMPTY_FILE_MESSAGE);
2109
2116
  this.opts.onFileUploadFailed?.(p, err);
2110
2117
  },
2111
2118
  onUploadDone: (r) => {
@@ -2140,7 +2147,7 @@ var Picker = class {
2140
2147
  source: "local"
2141
2148
  },
2142
2149
  error: {
2143
- code: "VALIDATION",
2150
+ code: i.errorCode || "VALIDATION",
2144
2151
  message: i.error || "failed",
2145
2152
  retryable: false
2146
2153
  }