myio-js-library 0.1.91 → 0.1.93

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
@@ -1914,17 +1914,32 @@ init_template_card();
1914
1914
  var MyIOSelectionStoreClass = class {
1915
1915
  constructor() {
1916
1916
  console.log("[SelectionStore] \u{1F50D} Constructor called - checking for existing instance...");
1917
- console.log("[SelectionStore] typeof window:", typeof window);
1918
- console.log("[SelectionStore] window === globalThis.window:", typeof window !== "undefined" && window === globalThis?.window);
1919
- console.log("[SelectionStore] window.__MyIOSelectionStore_INSTANCE__:", !!window?.__MyIOSelectionStore_INSTANCE__);
1917
+ console.log("[SelectionStore] typeof document:", typeof document);
1920
1918
  if (typeof window !== "undefined") {
1921
- const myioProps = Object.getOwnPropertyNames(window).filter((key) => key.startsWith("__MyIO"));
1922
- console.log("[SelectionStore] All __MyIO* properties on window:", myioProps);
1919
+ console.log("[SelectionStore] window.top === window:", window.top === window);
1920
+ console.log("[SelectionStore] document location:", window.location.href);
1921
+ console.log("[SelectionStore] Is in iframe:", window !== window.top);
1923
1922
  }
1924
- if (typeof window !== "undefined" && window.__MyIOSelectionStore_INSTANCE__) {
1923
+ console.log("[SelectionStore] document.__MyIOSelectionStore_INSTANCE__:", !!document?.__MyIOSelectionStore_INSTANCE__);
1924
+ if (typeof document !== "undefined") {
1925
+ const myioProps = Object.getOwnPropertyNames(document).filter((key) => key.startsWith("__MyIO"));
1926
+ console.log("[SelectionStore] All __MyIO* properties on document:", myioProps);
1927
+ }
1928
+ let existingInstance = null;
1929
+ try {
1930
+ const targetWindow = typeof window !== "undefined" && window.top ? window.top : window;
1931
+ existingInstance = targetWindow?.__MyIOSelectionStore_INSTANCE__;
1932
+ console.log("[SelectionStore] Checking window.top.__MyIOSelectionStore_INSTANCE__:", !!existingInstance);
1933
+ } catch (e) {
1934
+ console.warn("[SelectionStore] Cannot access window.top:", e.message);
1935
+ }
1936
+ if (!existingInstance) {
1937
+ existingInstance = typeof document !== "undefined" && document.__MyIOSelectionStore_INSTANCE__ || typeof window !== "undefined" && window.__MyIOSelectionStore_INSTANCE__;
1938
+ }
1939
+ if (existingInstance) {
1925
1940
  console.warn("[SelectionStore] \u26A0\uFE0F Constructor called but instance already exists! Returning existing instance.");
1926
- console.log("[SelectionStore] Existing instance has listeners:", window.__MyIOSelectionStore_INSTANCE__.eventListeners.get("selection:change")?.length || 0);
1927
- return window.__MyIOSelectionStore_INSTANCE__;
1941
+ console.log("[SelectionStore] Existing instance has listeners:", existingInstance.eventListeners.get("selection:change")?.length || 0);
1942
+ return existingInstance;
1928
1943
  }
1929
1944
  console.log("[SelectionStore] \u{1F3D7}\uFE0F NEW INSTANCE CREATED at:", (/* @__PURE__ */ new Date()).toISOString());
1930
1945
  console.trace("[SelectionStore] Constructor called from:");
@@ -1939,10 +1954,20 @@ var MyIOSelectionStoreClass = class {
1939
1954
  this.eventListeners.set("selection:totals", []);
1940
1955
  this.eventListeners.set("comparison:open", []);
1941
1956
  this.eventListeners.set("comparison:too_many", []);
1942
- if (typeof window !== "undefined") {
1943
- console.log("[SelectionStore] \u{1F4BE} Storing instance in window.__MyIOSelectionStore_INSTANCE__");
1944
- window.__MyIOSelectionStore_INSTANCE__ = this;
1945
- console.log("[SelectionStore] \u2705 Stored! Verify:", !!window.__MyIOSelectionStore_INSTANCE__);
1957
+ try {
1958
+ const targetWindow = typeof window !== "undefined" && window.top ? window.top : window;
1959
+ if (targetWindow) {
1960
+ console.log("[SelectionStore] \u{1F4BE} Storing instance in window.top.__MyIOSelectionStore_INSTANCE__");
1961
+ targetWindow.__MyIOSelectionStore_INSTANCE__ = this;
1962
+ console.log("[SelectionStore] \u2705 Stored in top window! Verify:", !!targetWindow.__MyIOSelectionStore_INSTANCE__);
1963
+ }
1964
+ } catch (e) {
1965
+ console.warn("[SelectionStore] \u26A0\uFE0F Cannot access window.top (cross-origin iframe):", e.message);
1966
+ if (typeof document !== "undefined") {
1967
+ console.log("[SelectionStore] \u{1F4BE} Storing instance in document.__MyIOSelectionStore_INSTANCE__ (fallback)");
1968
+ document.__MyIOSelectionStore_INSTANCE__ = this;
1969
+ console.log("[SelectionStore] \u2705 Stored! Verify:", !!document.__MyIOSelectionStore_INSTANCE__);
1970
+ }
1946
1971
  }
1947
1972
  }
1948
1973
  // Core Selection Methods
@@ -2264,10 +2289,22 @@ var MyIOSelectionStore;
2264
2289
  var _singletonInstance = null;
2265
2290
  if (typeof globalThis !== "undefined" && typeof globalThis.window !== "undefined") {
2266
2291
  console.log("[SelectionStore] \u{1F527} Module initialization - checking for existing instance...");
2267
- console.log("[SelectionStore] globalThis.window.__MyIOSelectionStore_INSTANCE__:", !!globalThis.window.__MyIOSelectionStore_INSTANCE__);
2268
- if (globalThis.window.__MyIOSelectionStore_INSTANCE__) {
2292
+ let existingInstance = null;
2293
+ try {
2294
+ const targetWindow = globalThis.window.top ? globalThis.window.top : globalThis.window;
2295
+ existingInstance = targetWindow.__MyIOSelectionStore_INSTANCE__;
2296
+ console.log("[SelectionStore] window.top.__MyIOSelectionStore_INSTANCE__:", !!existingInstance);
2297
+ } catch (e) {
2298
+ console.warn("[SelectionStore] Cannot access window.top during module init:", e.message);
2299
+ }
2300
+ if (!existingInstance) {
2301
+ existingInstance = typeof document !== "undefined" && document.__MyIOSelectionStore_INSTANCE__ || globalThis.window.__MyIOSelectionStore_INSTANCE__;
2302
+ console.log("[SelectionStore] document.__MyIOSelectionStore_INSTANCE__:", !!(typeof document !== "undefined" && document.__MyIOSelectionStore_INSTANCE__));
2303
+ console.log("[SelectionStore] window.__MyIOSelectionStore_INSTANCE__:", !!globalThis.window.__MyIOSelectionStore_INSTANCE__);
2304
+ }
2305
+ if (existingInstance) {
2269
2306
  console.log("[SelectionStore] \u{1F504} REUSING constructor-created instance from __MyIOSelectionStore_INSTANCE__");
2270
- _singletonInstance = globalThis.window.__MyIOSelectionStore_INSTANCE__;
2307
+ _singletonInstance = existingInstance;
2271
2308
  MyIOSelectionStore = _singletonInstance;
2272
2309
  } else if (Object.getOwnPropertyDescriptor(globalThis.window, "MyIOSelectionStore")?.get) {
2273
2310
  console.log("[SelectionStore] \u{1F504} REUSING protected global instance via getter");
package/dist/index.js CHANGED
@@ -1826,17 +1826,32 @@ init_template_card();
1826
1826
  var MyIOSelectionStoreClass = class {
1827
1827
  constructor() {
1828
1828
  console.log("[SelectionStore] \u{1F50D} Constructor called - checking for existing instance...");
1829
- console.log("[SelectionStore] typeof window:", typeof window);
1830
- console.log("[SelectionStore] window === globalThis.window:", typeof window !== "undefined" && window === globalThis?.window);
1831
- console.log("[SelectionStore] window.__MyIOSelectionStore_INSTANCE__:", !!window?.__MyIOSelectionStore_INSTANCE__);
1829
+ console.log("[SelectionStore] typeof document:", typeof document);
1832
1830
  if (typeof window !== "undefined") {
1833
- const myioProps = Object.getOwnPropertyNames(window).filter((key) => key.startsWith("__MyIO"));
1834
- console.log("[SelectionStore] All __MyIO* properties on window:", myioProps);
1831
+ console.log("[SelectionStore] window.top === window:", window.top === window);
1832
+ console.log("[SelectionStore] document location:", window.location.href);
1833
+ console.log("[SelectionStore] Is in iframe:", window !== window.top);
1835
1834
  }
1836
- if (typeof window !== "undefined" && window.__MyIOSelectionStore_INSTANCE__) {
1835
+ console.log("[SelectionStore] document.__MyIOSelectionStore_INSTANCE__:", !!document?.__MyIOSelectionStore_INSTANCE__);
1836
+ if (typeof document !== "undefined") {
1837
+ const myioProps = Object.getOwnPropertyNames(document).filter((key) => key.startsWith("__MyIO"));
1838
+ console.log("[SelectionStore] All __MyIO* properties on document:", myioProps);
1839
+ }
1840
+ let existingInstance = null;
1841
+ try {
1842
+ const targetWindow = typeof window !== "undefined" && window.top ? window.top : window;
1843
+ existingInstance = targetWindow?.__MyIOSelectionStore_INSTANCE__;
1844
+ console.log("[SelectionStore] Checking window.top.__MyIOSelectionStore_INSTANCE__:", !!existingInstance);
1845
+ } catch (e) {
1846
+ console.warn("[SelectionStore] Cannot access window.top:", e.message);
1847
+ }
1848
+ if (!existingInstance) {
1849
+ existingInstance = typeof document !== "undefined" && document.__MyIOSelectionStore_INSTANCE__ || typeof window !== "undefined" && window.__MyIOSelectionStore_INSTANCE__;
1850
+ }
1851
+ if (existingInstance) {
1837
1852
  console.warn("[SelectionStore] \u26A0\uFE0F Constructor called but instance already exists! Returning existing instance.");
1838
- console.log("[SelectionStore] Existing instance has listeners:", window.__MyIOSelectionStore_INSTANCE__.eventListeners.get("selection:change")?.length || 0);
1839
- return window.__MyIOSelectionStore_INSTANCE__;
1853
+ console.log("[SelectionStore] Existing instance has listeners:", existingInstance.eventListeners.get("selection:change")?.length || 0);
1854
+ return existingInstance;
1840
1855
  }
1841
1856
  console.log("[SelectionStore] \u{1F3D7}\uFE0F NEW INSTANCE CREATED at:", (/* @__PURE__ */ new Date()).toISOString());
1842
1857
  console.trace("[SelectionStore] Constructor called from:");
@@ -1851,10 +1866,20 @@ var MyIOSelectionStoreClass = class {
1851
1866
  this.eventListeners.set("selection:totals", []);
1852
1867
  this.eventListeners.set("comparison:open", []);
1853
1868
  this.eventListeners.set("comparison:too_many", []);
1854
- if (typeof window !== "undefined") {
1855
- console.log("[SelectionStore] \u{1F4BE} Storing instance in window.__MyIOSelectionStore_INSTANCE__");
1856
- window.__MyIOSelectionStore_INSTANCE__ = this;
1857
- console.log("[SelectionStore] \u2705 Stored! Verify:", !!window.__MyIOSelectionStore_INSTANCE__);
1869
+ try {
1870
+ const targetWindow = typeof window !== "undefined" && window.top ? window.top : window;
1871
+ if (targetWindow) {
1872
+ console.log("[SelectionStore] \u{1F4BE} Storing instance in window.top.__MyIOSelectionStore_INSTANCE__");
1873
+ targetWindow.__MyIOSelectionStore_INSTANCE__ = this;
1874
+ console.log("[SelectionStore] \u2705 Stored in top window! Verify:", !!targetWindow.__MyIOSelectionStore_INSTANCE__);
1875
+ }
1876
+ } catch (e) {
1877
+ console.warn("[SelectionStore] \u26A0\uFE0F Cannot access window.top (cross-origin iframe):", e.message);
1878
+ if (typeof document !== "undefined") {
1879
+ console.log("[SelectionStore] \u{1F4BE} Storing instance in document.__MyIOSelectionStore_INSTANCE__ (fallback)");
1880
+ document.__MyIOSelectionStore_INSTANCE__ = this;
1881
+ console.log("[SelectionStore] \u2705 Stored! Verify:", !!document.__MyIOSelectionStore_INSTANCE__);
1882
+ }
1858
1883
  }
1859
1884
  }
1860
1885
  // Core Selection Methods
@@ -2176,10 +2201,22 @@ var MyIOSelectionStore;
2176
2201
  var _singletonInstance = null;
2177
2202
  if (typeof globalThis !== "undefined" && typeof globalThis.window !== "undefined") {
2178
2203
  console.log("[SelectionStore] \u{1F527} Module initialization - checking for existing instance...");
2179
- console.log("[SelectionStore] globalThis.window.__MyIOSelectionStore_INSTANCE__:", !!globalThis.window.__MyIOSelectionStore_INSTANCE__);
2180
- if (globalThis.window.__MyIOSelectionStore_INSTANCE__) {
2204
+ let existingInstance = null;
2205
+ try {
2206
+ const targetWindow = globalThis.window.top ? globalThis.window.top : globalThis.window;
2207
+ existingInstance = targetWindow.__MyIOSelectionStore_INSTANCE__;
2208
+ console.log("[SelectionStore] window.top.__MyIOSelectionStore_INSTANCE__:", !!existingInstance);
2209
+ } catch (e) {
2210
+ console.warn("[SelectionStore] Cannot access window.top during module init:", e.message);
2211
+ }
2212
+ if (!existingInstance) {
2213
+ existingInstance = typeof document !== "undefined" && document.__MyIOSelectionStore_INSTANCE__ || globalThis.window.__MyIOSelectionStore_INSTANCE__;
2214
+ console.log("[SelectionStore] document.__MyIOSelectionStore_INSTANCE__:", !!(typeof document !== "undefined" && document.__MyIOSelectionStore_INSTANCE__));
2215
+ console.log("[SelectionStore] window.__MyIOSelectionStore_INSTANCE__:", !!globalThis.window.__MyIOSelectionStore_INSTANCE__);
2216
+ }
2217
+ if (existingInstance) {
2181
2218
  console.log("[SelectionStore] \u{1F504} REUSING constructor-created instance from __MyIOSelectionStore_INSTANCE__");
2182
- _singletonInstance = globalThis.window.__MyIOSelectionStore_INSTANCE__;
2219
+ _singletonInstance = existingInstance;
2183
2220
  MyIOSelectionStore = _singletonInstance;
2184
2221
  } else if (Object.getOwnPropertyDescriptor(globalThis.window, "MyIOSelectionStore")?.get) {
2185
2222
  console.log("[SelectionStore] \u{1F504} REUSING protected global instance via getter");
@@ -1832,17 +1832,32 @@
1832
1832
  var MyIOSelectionStoreClass = class {
1833
1833
  constructor() {
1834
1834
  console.log("[SelectionStore] \u{1F50D} Constructor called - checking for existing instance...");
1835
- console.log("[SelectionStore] typeof window:", typeof window);
1836
- console.log("[SelectionStore] window === globalThis.window:", typeof window !== "undefined" && window === globalThis?.window);
1837
- console.log("[SelectionStore] window.__MyIOSelectionStore_INSTANCE__:", !!window?.__MyIOSelectionStore_INSTANCE__);
1835
+ console.log("[SelectionStore] typeof document:", typeof document);
1838
1836
  if (typeof window !== "undefined") {
1839
- const myioProps = Object.getOwnPropertyNames(window).filter((key) => key.startsWith("__MyIO"));
1840
- console.log("[SelectionStore] All __MyIO* properties on window:", myioProps);
1837
+ console.log("[SelectionStore] window.top === window:", window.top === window);
1838
+ console.log("[SelectionStore] document location:", window.location.href);
1839
+ console.log("[SelectionStore] Is in iframe:", window !== window.top);
1841
1840
  }
1842
- if (typeof window !== "undefined" && window.__MyIOSelectionStore_INSTANCE__) {
1841
+ console.log("[SelectionStore] document.__MyIOSelectionStore_INSTANCE__:", !!document?.__MyIOSelectionStore_INSTANCE__);
1842
+ if (typeof document !== "undefined") {
1843
+ const myioProps = Object.getOwnPropertyNames(document).filter((key) => key.startsWith("__MyIO"));
1844
+ console.log("[SelectionStore] All __MyIO* properties on document:", myioProps);
1845
+ }
1846
+ let existingInstance = null;
1847
+ try {
1848
+ const targetWindow = typeof window !== "undefined" && window.top ? window.top : window;
1849
+ existingInstance = targetWindow?.__MyIOSelectionStore_INSTANCE__;
1850
+ console.log("[SelectionStore] Checking window.top.__MyIOSelectionStore_INSTANCE__:", !!existingInstance);
1851
+ } catch (e) {
1852
+ console.warn("[SelectionStore] Cannot access window.top:", e.message);
1853
+ }
1854
+ if (!existingInstance) {
1855
+ existingInstance = typeof document !== "undefined" && document.__MyIOSelectionStore_INSTANCE__ || typeof window !== "undefined" && window.__MyIOSelectionStore_INSTANCE__;
1856
+ }
1857
+ if (existingInstance) {
1843
1858
  console.warn("[SelectionStore] \u26A0\uFE0F Constructor called but instance already exists! Returning existing instance.");
1844
- console.log("[SelectionStore] Existing instance has listeners:", window.__MyIOSelectionStore_INSTANCE__.eventListeners.get("selection:change")?.length || 0);
1845
- return window.__MyIOSelectionStore_INSTANCE__;
1859
+ console.log("[SelectionStore] Existing instance has listeners:", existingInstance.eventListeners.get("selection:change")?.length || 0);
1860
+ return existingInstance;
1846
1861
  }
1847
1862
  console.log("[SelectionStore] \u{1F3D7}\uFE0F NEW INSTANCE CREATED at:", (/* @__PURE__ */ new Date()).toISOString());
1848
1863
  console.trace("[SelectionStore] Constructor called from:");
@@ -1857,10 +1872,20 @@
1857
1872
  this.eventListeners.set("selection:totals", []);
1858
1873
  this.eventListeners.set("comparison:open", []);
1859
1874
  this.eventListeners.set("comparison:too_many", []);
1860
- if (typeof window !== "undefined") {
1861
- console.log("[SelectionStore] \u{1F4BE} Storing instance in window.__MyIOSelectionStore_INSTANCE__");
1862
- window.__MyIOSelectionStore_INSTANCE__ = this;
1863
- console.log("[SelectionStore] \u2705 Stored! Verify:", !!window.__MyIOSelectionStore_INSTANCE__);
1875
+ try {
1876
+ const targetWindow = typeof window !== "undefined" && window.top ? window.top : window;
1877
+ if (targetWindow) {
1878
+ console.log("[SelectionStore] \u{1F4BE} Storing instance in window.top.__MyIOSelectionStore_INSTANCE__");
1879
+ targetWindow.__MyIOSelectionStore_INSTANCE__ = this;
1880
+ console.log("[SelectionStore] \u2705 Stored in top window! Verify:", !!targetWindow.__MyIOSelectionStore_INSTANCE__);
1881
+ }
1882
+ } catch (e) {
1883
+ console.warn("[SelectionStore] \u26A0\uFE0F Cannot access window.top (cross-origin iframe):", e.message);
1884
+ if (typeof document !== "undefined") {
1885
+ console.log("[SelectionStore] \u{1F4BE} Storing instance in document.__MyIOSelectionStore_INSTANCE__ (fallback)");
1886
+ document.__MyIOSelectionStore_INSTANCE__ = this;
1887
+ console.log("[SelectionStore] \u2705 Stored! Verify:", !!document.__MyIOSelectionStore_INSTANCE__);
1888
+ }
1864
1889
  }
1865
1890
  }
1866
1891
  // Core Selection Methods
@@ -2182,10 +2207,22 @@
2182
2207
  var _singletonInstance = null;
2183
2208
  if (typeof globalThis !== "undefined" && typeof globalThis.window !== "undefined") {
2184
2209
  console.log("[SelectionStore] \u{1F527} Module initialization - checking for existing instance...");
2185
- console.log("[SelectionStore] globalThis.window.__MyIOSelectionStore_INSTANCE__:", !!globalThis.window.__MyIOSelectionStore_INSTANCE__);
2186
- if (globalThis.window.__MyIOSelectionStore_INSTANCE__) {
2210
+ let existingInstance = null;
2211
+ try {
2212
+ const targetWindow = globalThis.window.top ? globalThis.window.top : globalThis.window;
2213
+ existingInstance = targetWindow.__MyIOSelectionStore_INSTANCE__;
2214
+ console.log("[SelectionStore] window.top.__MyIOSelectionStore_INSTANCE__:", !!existingInstance);
2215
+ } catch (e) {
2216
+ console.warn("[SelectionStore] Cannot access window.top during module init:", e.message);
2217
+ }
2218
+ if (!existingInstance) {
2219
+ existingInstance = typeof document !== "undefined" && document.__MyIOSelectionStore_INSTANCE__ || globalThis.window.__MyIOSelectionStore_INSTANCE__;
2220
+ console.log("[SelectionStore] document.__MyIOSelectionStore_INSTANCE__:", !!(typeof document !== "undefined" && document.__MyIOSelectionStore_INSTANCE__));
2221
+ console.log("[SelectionStore] window.__MyIOSelectionStore_INSTANCE__:", !!globalThis.window.__MyIOSelectionStore_INSTANCE__);
2222
+ }
2223
+ if (existingInstance) {
2187
2224
  console.log("[SelectionStore] \u{1F504} REUSING constructor-created instance from __MyIOSelectionStore_INSTANCE__");
2188
- _singletonInstance = globalThis.window.__MyIOSelectionStore_INSTANCE__;
2225
+ _singletonInstance = existingInstance;
2189
2226
  exports.MyIOSelectionStore = _singletonInstance;
2190
2227
  } else if (Object.getOwnPropertyDescriptor(globalThis.window, "MyIOSelectionStore")?.get) {
2191
2228
  console.log("[SelectionStore] \u{1F504} REUSING protected global instance via getter");