@masters-union/union-stack 0.3.13 → 0.3.15

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/picker.js CHANGED
@@ -1144,6 +1144,7 @@ var ImageEditor = class {
1144
1144
  // ---- apply --------------------------------------------------------------
1145
1145
  async applyAndClose() {
1146
1146
  this.applyBtn.disabled = true;
1147
+ if (this.mode === "crop") this.applyCrop();
1147
1148
  try {
1148
1149
  const file = await this.exportFile();
1149
1150
  this.opts.onApply(file);
@@ -1402,10 +1403,10 @@ var Picker = class {
1402
1403
  this.$urlSource = this.renderUrlSource();
1403
1404
  body.appendChild(this.$urlSource);
1404
1405
  }
1405
- this.activateSource(sources[0] ?? "device");
1406
1406
  this.$list = el2("div", "us-file-list");
1407
1407
  body.appendChild(this.$list);
1408
1408
  panel.appendChild(body);
1409
+ this.activateSource(sources[0] ?? "device");
1409
1410
  const autoUpload = this.opts.autoUpload === true;
1410
1411
  const actions = el2("div", "us-actions");
1411
1412
  this.$summary = el2("div", "us-actions-summary", "");
@@ -1698,6 +1699,20 @@ var Picker = class {
1698
1699
  if (overCap > 0) notices.push(`${overCap} file${overCap > 1 ? "s" : ""} skipped \u2014 max ${cap} allowed`);
1699
1700
  if (notices.length) this.flashNotice(notices.join(" \xB7 "));
1700
1701
  for (const file of chosen) {
1702
+ if (file.size === 0) {
1703
+ const item2 = {
1704
+ uploadId: cryptoId(),
1705
+ file,
1706
+ originalFile: file,
1707
+ edited: false,
1708
+ state: "failed",
1709
+ 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"
1711
+ };
1712
+ this.items.push(item2);
1713
+ this.renderItem(item2);
1714
+ continue;
1715
+ }
1701
1716
  if (this.opts.maxFileSize && file.size > this.opts.maxFileSize) {
1702
1717
  const item2 = {
1703
1718
  uploadId: cryptoId(),