@uploadcare/file-uploader 1.25.0-alpha.0 → 1.25.0-alpha.2

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/env.js CHANGED
@@ -25,7 +25,7 @@
25
25
  */
26
26
 
27
27
  // package.json
28
- var version = "1.25.0-alpha.0";
28
+ var version = "1.25.0-alpha.2";
29
29
 
30
30
  // src/env.ts
31
31
  var PACKAGE_NAME = "blocks";
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { PubSub } from '@symbiotejs/symbiote';
2
2
  export { PubSub as Data, PubSub, UID } from '@symbiotejs/symbiote';
3
3
  export { loadFileUploaderFrom } from './abstract/loadFileUploaderFrom.js';
4
4
  import * as lit_html from 'lit-html';
5
+ import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
5
6
  import { nothing, LitElement, PropertyValues, TemplateResult } from 'lit';
6
7
  import { TelemetryRequest } from '@uploadcare/quality-insights';
7
8
  import * as _uploadcare_upload_client from '@uploadcare/upload-client';
@@ -1348,7 +1349,7 @@ declare class LitBlock extends LitBlockBase {
1348
1349
  declare class Modal extends LitBlock {
1349
1350
  static styleAttrs: string[];
1350
1351
  private _mouseDownTarget;
1351
- private dialogEl;
1352
+ protected dialogEl: lit_html_directives_ref_js.Ref<HTMLDialogElement>;
1352
1353
  handleModalOpen: ModalCb;
1353
1354
  handleModalClose: ModalCb;
1354
1355
  handleModalCloseAll: ModalCb;
package/dist/index.js CHANGED
@@ -1050,7 +1050,7 @@ var config = {
1050
1050
  var initialConfig = Object.freeze(config);
1051
1051
 
1052
1052
  // package.json
1053
- var version = "1.25.0-alpha.0";
1053
+ var version = "1.25.0-alpha.2";
1054
1054
 
1055
1055
  // src/env.ts
1056
1056
  var PACKAGE_NAME = "blocks";
@@ -1531,6 +1531,7 @@ function SymbioteMixin(ctor) {
1531
1531
  this._ctxNameProvider = void 0;
1532
1532
  this._warnedAboutLocalState = false;
1533
1533
  this._pendingSharedAdds = /* @__PURE__ */ new Map();
1534
+ this._symbioteSubscriptions = /* @__PURE__ */ new Set();
1534
1535
  // Symbiote-style initial values declaration
1535
1536
  this.init$ = {};
1536
1537
  this.ctxOwner = false;
@@ -1725,8 +1726,22 @@ function SymbioteMixin(ctor) {
1725
1726
  sub(key, callback, init = true) {
1726
1727
  const sharedKey = this._requireSharedKey(key);
1727
1728
  const subscription = this._requireSharedPubSub().sub(sharedKey, callback, init);
1728
- return subscription ? subscription.remove : () => {
1729
+ if (!subscription || typeof subscription.remove !== "function") {
1730
+ return () => {
1731
+ };
1732
+ }
1733
+ const removeFn = subscription.remove.bind(subscription);
1734
+ let removed = false;
1735
+ const trackedRemove = () => {
1736
+ if (removed) {
1737
+ return;
1738
+ }
1739
+ removed = true;
1740
+ removeFn();
1741
+ this._symbioteSubscriptions.delete(trackedRemove);
1729
1742
  };
1743
+ this._symbioteSubscriptions.add(trackedRemove);
1744
+ return trackedRemove;
1730
1745
  }
1731
1746
  pub(key, value) {
1732
1747
  const sharedKey = this._requireSharedKey(key);
@@ -1827,11 +1842,21 @@ function SymbioteMixin(ctor) {
1827
1842
  }
1828
1843
  }
1829
1844
  disconnectedCallback() {
1845
+ this._cleanupSymbioteSubscriptions();
1830
1846
  super.disconnectedCallback();
1831
1847
  if (this._symbioteFirstUpdated) {
1832
1848
  this._needsReconnectInit = true;
1833
1849
  }
1834
1850
  }
1851
+ _cleanupSymbioteSubscriptions() {
1852
+ if (this._symbioteSubscriptions.size === 0) {
1853
+ return;
1854
+ }
1855
+ for (const unsubscribe of [...this._symbioteSubscriptions]) {
1856
+ unsubscribe();
1857
+ }
1858
+ this._symbioteSubscriptions.clear();
1859
+ }
1835
1860
  initCallback() {
1836
1861
  }
1837
1862
  }
@@ -13055,6 +13080,9 @@ __decorateClass([
13055
13080
  __decorateClass([
13056
13081
  state22()
13057
13082
  ], UploadList.prototype, "hasFiles", 2);
13083
+ __decorateClass([
13084
+ state22()
13085
+ ], UploadList.prototype, "_latestSummary", 2);
13058
13086
 
13059
13087
  // src/blocks/UrlSource/UrlSource.ts
13060
13088
  import { html as html32 } from "lit";
package/dist/index.ssr.js CHANGED
@@ -892,7 +892,7 @@ export const ModalEvents = {
892
892
  DESTROY: "modal:destroy",
893
893
  };
894
894
  export const PACKAGE_NAME = `blocks`;
895
- export const PACKAGE_VERSION = `1.25.0-alpha.0`;
895
+ export const PACKAGE_VERSION = `1.25.0-alpha.2`;
896
896
  export const PresenceToggle = class {
897
897
  static elementProperties = {};
898
898
  static styleAttrs = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/file-uploader",
3
- "version": "1.25.0-alpha.0",
3
+ "version": "1.25.0-alpha.2",
4
4
  "description": "Building blocks for Uploadcare products integration",
5
5
  "keywords": [
6
6
  "web components",
@@ -55,7 +55,6 @@
55
55
  "default": "./dist/index.layered.css"
56
56
  },
57
57
  "./abstract/loadFileUploaderFrom.js": "./dist/abstract/loadFileUploaderFrom.js",
58
- "./lit": "./dist/lit.js",
59
58
  "./env": "./dist/env.js",
60
59
  "./web/*": "./web/*",
61
60
  "./types/jsx": "./types/jsx.d.ts",
@@ -1,6 +1,7 @@
1
1
  import { PubSub } from '@symbiotejs/symbiote';
2
2
  export { PubSub as Data, PubSub, UID } from '@symbiotejs/symbiote';
3
3
  import * as lit_html from 'lit-html';
4
+ import * as lit_html_directives_ref_js from 'lit-html/directives/ref.js';
4
5
  import { nothing, LitElement, PropertyValues, TemplateResult } from 'lit';
5
6
  import { TelemetryRequest } from '@uploadcare/quality-insights';
6
7
  import * as _uploadcare_upload_client from '@uploadcare/upload-client';
@@ -1359,7 +1360,7 @@ declare class LitBlock extends LitBlockBase {
1359
1360
  declare class Modal extends LitBlock {
1360
1361
  static styleAttrs: string[];
1361
1362
  private _mouseDownTarget;
1362
- private dialogEl;
1363
+ protected dialogEl: lit_html_directives_ref_js.Ref<HTMLDialogElement>;
1363
1364
  handleModalOpen: ModalCb;
1364
1365
  handleModalClose: ModalCb;
1365
1366
  handleModalCloseAll: ModalCb;