thunderous 2.0.4 → 2.0.5

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/index.cjs CHANGED
@@ -608,7 +608,6 @@ var customElement = (render, options) => {
608
608
  #formResetCallbackFns = /* @__PURE__ */ new Set();
609
609
  #formStateRestoreCallbackFns = /* @__PURE__ */ new Set();
610
610
  #clientOnlyCallbackFns = /* @__PURE__ */ new Set();
611
- __customCallbackFns = /* @__PURE__ */ new Map();
612
611
  #shadowRoot = attachShadow ? this.attachShadow(shadowRootOptions) : null;
613
612
  #internals = this.attachInternals();
614
613
  #observer = options?.observedAttributes !== void 0 ? null : new MutationObserver((mutations) => {
@@ -648,7 +647,7 @@ var customElement = (render, options) => {
648
647
  },
649
648
  customCallback: (fn) => {
650
649
  const key = crypto.randomUUID();
651
- this.__customCallbackFns.set(key, fn);
650
+ this.__customCallbackFns?.set(key, fn);
652
651
  return `this.getRootNode().host.__customCallbackFns.get('${key}')(event)`;
653
652
  },
654
653
  attrSignals: new Proxy(
@@ -752,6 +751,9 @@ You must set an initial value before calling a property signal's getter.
752
751
  }
753
752
  constructor() {
754
753
  super();
754
+ if (Object.prototype.hasOwnProperty.call(this, "__customCallbackFns")) {
755
+ this.__customCallbackFns = /* @__PURE__ */ new Map();
756
+ }
755
757
  for (const [attrName, attr] of this.#attributesAsPropertiesMap) {
756
758
  this.#attrSignals[attrName] = createSignal(null);
757
759
  Object.defineProperty(this, attr.prop, {
package/dist/index.js CHANGED
@@ -573,7 +573,6 @@ var customElement = (render, options) => {
573
573
  #formResetCallbackFns = /* @__PURE__ */ new Set();
574
574
  #formStateRestoreCallbackFns = /* @__PURE__ */ new Set();
575
575
  #clientOnlyCallbackFns = /* @__PURE__ */ new Set();
576
- __customCallbackFns = /* @__PURE__ */ new Map();
577
576
  #shadowRoot = attachShadow ? this.attachShadow(shadowRootOptions) : null;
578
577
  #internals = this.attachInternals();
579
578
  #observer = options?.observedAttributes !== void 0 ? null : new MutationObserver((mutations) => {
@@ -613,7 +612,7 @@ var customElement = (render, options) => {
613
612
  },
614
613
  customCallback: (fn) => {
615
614
  const key = crypto.randomUUID();
616
- this.__customCallbackFns.set(key, fn);
615
+ this.__customCallbackFns?.set(key, fn);
617
616
  return `this.getRootNode().host.__customCallbackFns.get('${key}')(event)`;
618
617
  },
619
618
  attrSignals: new Proxy(
@@ -717,6 +716,9 @@ You must set an initial value before calling a property signal's getter.
717
716
  }
718
717
  constructor() {
719
718
  super();
719
+ if (Object.prototype.hasOwnProperty.call(this, "__customCallbackFns")) {
720
+ this.__customCallbackFns = /* @__PURE__ */ new Map();
721
+ }
720
722
  for (const [attrName, attr] of this.#attributesAsPropertiesMap) {
721
723
  this.#attrSignals[attrName] = createSignal(null);
722
724
  Object.defineProperty(this, attr.prop, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thunderous",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",