@depict-ai/utilishared 1.0.43 → 1.0.45

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/ES10/index.cjs CHANGED
@@ -279,7 +279,7 @@ $parcel$export(module.exports, "add_to_version_info", () => $045fb30107c9eecc$ex
279
279
  $parcel$export(module.exports, "edit_current_page_meta_tags", () => $0126fdc29a9f7f2d$export$ef73ea4f975745ba);
280
280
  $parcel$export(module.exports, "sync_el_content_with_accessor", () => $84d13ab567309a50$export$c3f56a35e076f139);
281
281
  $parcel$export(module.exports, "use_href_accessor", () => $59b7011b96010a8e$export$e35115e6d0715f77);
282
- const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "1.0.43";
282
+ const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "1.0.45";
283
283
  const $9e9538f4aff6f83c$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
284
284
  const $7f95f77417d06249$var$browser_prefix_styling = "color: #fff;";
285
285
  let $7f95f77417d06249$var$browser_prefix = "[Depict]";
@@ -1716,7 +1716,7 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
1716
1716
  });
1717
1717
  $523564fcfb9c3bb9$var$_classPrivateFieldInitSpec(this, $523564fcfb9c3bb9$var$_territories, {
1718
1718
  writable: true,
1719
- value: [document.documentElement]
1719
+ value: typeof document === "object" ? [document.documentElement] : []
1720
1720
  });
1721
1721
  $523564fcfb9c3bb9$var$_classPrivateFieldInitSpec(this, $523564fcfb9c3bb9$var$_listeners, {
1722
1722
  writable: true,
@@ -1735,6 +1735,7 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
1735
1735
  const territories = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_territories);
1736
1736
  $523564fcfb9c3bb9$var$_classPrivateMethodGet(this, $523564fcfb9c3bb9$var$_check_observer_args, $523564fcfb9c3bb9$var$_check_observer_args2).call(this, selector, callback, true);
1737
1737
  if (typeof document === "undefined") return; // SSR
1738
+ const our_set = (_classPrivateFieldGet2 = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_attribute_attribution_map_object))[_ref = selector] || (_classPrivateFieldGet2[_ref] = new WeakSet());
1738
1739
  if (selector instanceof Node) {
1739
1740
  let node_is_contained = false;
1740
1741
  for (let i = 0; i < territories.length; i++) {
@@ -1742,7 +1743,8 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
1742
1743
  node_is_contained = true;
1743
1744
  break;
1744
1745
  }
1745
- if (node_is_contained)
1746
+ if (node_is_contained) {
1747
+ our_set.add(selector); // Add element to set, so we don't dispatch two onexists events for it if it matches the selector and an attribute changes in the same go
1746
1748
  // When the selector is a node the selector and the element are the same, dunno how we could reflect that in the typing though
1747
1749
  $523564fcfb9c3bb9$var$_classPrivateMethodGet(this, $523564fcfb9c3bb9$var$_call_callbacks, $523564fcfb9c3bb9$var$_call_callbacks2).call(this, [callback], callback_ => ({
1748
1750
  element_: selector,
@@ -1754,9 +1756,9 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
1754
1756
  callback_: callback_
1755
1757
  })
1756
1758
  }));
1759
+ }
1757
1760
  return;
1758
1761
  }
1759
- const our_set = (_classPrivateFieldGet2 = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_attribute_attribution_map_object))[_ref = selector] || (_classPrivateFieldGet2[_ref] = new WeakSet());
1760
1762
  for (let i = 0; i < territories.length; i++) {
1761
1763
  const found = $c64b3d92c99cdd73$export$33f937d741e49339(territories[i], selector);
1762
1764
  if (!found) continue;
package/ES10/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference path="../jsx.d.ts" />
2
2
  import { EUnavailabilityType } from "@depict-ai/types/api/TrackV2Request";
3
3
  import { Accessor } from "solid-js";
4
- export const version = "1.0.43";
4
+ export const version = "1.0.45";
5
5
  export const is_debug: boolean;
6
6
  /**
7
7
  * Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
package/ES10/index.js CHANGED
@@ -15,7 +15,7 @@ function $parcel$export(e, n, v, s) {
15
15
  function $parcel$interopDefault(a) {
16
16
  return a && a.__esModule ? a.default : a;
17
17
  }
18
- const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "1.0.43";
18
+ const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "1.0.45";
19
19
  const $a5a2bdb4ae93374b$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
20
20
  const $241f2f02cc612a49$var$browser_prefix_styling = "color: #fff;";
21
21
  let $241f2f02cc612a49$var$browser_prefix = "[Depict]";
@@ -1452,7 +1452,7 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
1452
1452
  });
1453
1453
  $7d82513db34b5d27$var$_classPrivateFieldInitSpec(this, $7d82513db34b5d27$var$_territories, {
1454
1454
  writable: true,
1455
- value: [document.documentElement]
1455
+ value: typeof document === "object" ? [document.documentElement] : []
1456
1456
  });
1457
1457
  $7d82513db34b5d27$var$_classPrivateFieldInitSpec(this, $7d82513db34b5d27$var$_listeners, {
1458
1458
  writable: true,
@@ -1471,6 +1471,7 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
1471
1471
  const territories = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_territories);
1472
1472
  $7d82513db34b5d27$var$_classPrivateMethodGet(this, $7d82513db34b5d27$var$_check_observer_args, $7d82513db34b5d27$var$_check_observer_args2).call(this, selector, callback, true);
1473
1473
  if (typeof document === "undefined") return; // SSR
1474
+ const our_set = (_classPrivateFieldGet2 = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_attribute_attribution_map_object))[_ref = selector] || (_classPrivateFieldGet2[_ref] = new WeakSet());
1474
1475
  if (selector instanceof Node) {
1475
1476
  let node_is_contained = false;
1476
1477
  for (let i = 0; i < territories.length; i++) {
@@ -1478,7 +1479,8 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
1478
1479
  node_is_contained = true;
1479
1480
  break;
1480
1481
  }
1481
- if (node_is_contained)
1482
+ if (node_is_contained) {
1483
+ our_set.add(selector); // Add element to set, so we don't dispatch two onexists events for it if it matches the selector and an attribute changes in the same go
1482
1484
  // When the selector is a node the selector and the element are the same, dunno how we could reflect that in the typing though
1483
1485
  $7d82513db34b5d27$var$_classPrivateMethodGet(this, $7d82513db34b5d27$var$_call_callbacks, $7d82513db34b5d27$var$_call_callbacks2).call(this, [callback], callback_ => ({
1484
1486
  element_: selector,
@@ -1490,9 +1492,9 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
1490
1492
  callback_: callback_
1491
1493
  })
1492
1494
  }));
1495
+ }
1493
1496
  return;
1494
1497
  }
1495
- const our_set = (_classPrivateFieldGet2 = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_attribute_attribution_map_object))[_ref = selector] || (_classPrivateFieldGet2[_ref] = new WeakSet());
1496
1498
  for (let i = 0; i < territories.length; i++) {
1497
1499
  const found = $914c6f35222c820d$export$33f937d741e49339(territories[i], selector);
1498
1500
  if (!found) continue;
package/latest/index.cjs CHANGED
@@ -276,7 +276,7 @@ $parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$ex
276
276
  $parcel$export(module.exports, "edit_current_page_meta_tags", () => $8838e3e61b748a8b$export$ef73ea4f975745ba);
277
277
  $parcel$export(module.exports, "sync_el_content_with_accessor", () => $35303d72263038db$export$c3f56a35e076f139);
278
278
  $parcel$export(module.exports, "use_href_accessor", () => $da35c7e27be2a442$export$e35115e6d0715f77);
279
- const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.43";
279
+ const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.45";
280
280
  const $7b5e577a60b81e60$export$55fe61489d2c7417 = /*@__PURE__*/(() => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
281
281
  const $e6c6e7929ea385ae$var$browser_prefix_styling = "color: #fff;";
282
282
  let $e6c6e7929ea385ae$var$browser_prefix = "[Depict]";
@@ -1486,7 +1486,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
1486
1486
  #observer_callback_running = false;
1487
1487
  #execute_after_callback_ran = [];
1488
1488
  #attribute_attribution_map_object = {};
1489
- #territories = [document.documentElement];
1489
+ #territories = typeof document === "object" ? [document.documentElement] : [];
1490
1490
  #listeners = ["exists", "creation", "removed", "change"];
1491
1491
  #weakref_finalization_registry = typeof FinalizationRegistry === "function" && new FinalizationRegistry($268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#finalization_registry_callback.bind(this)));
1492
1492
  #verbs = {
@@ -1495,6 +1495,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
1495
1495
  const territories = this.#territories;
1496
1496
  this.#check_observer_args(selector, callback, true);
1497
1497
  if (typeof document === "undefined") return; // SSR
1498
+ const our_set = this.#attribute_attribution_map_object[selector] ||= new WeakSet();
1498
1499
  if (selector instanceof Node) {
1499
1500
  let node_is_contained = false;
1500
1501
  for (let i = 0; i < territories.length; i++) {
@@ -1502,7 +1503,8 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
1502
1503
  node_is_contained = true;
1503
1504
  break;
1504
1505
  }
1505
- if (node_is_contained)
1506
+ if (node_is_contained) {
1507
+ our_set.add(selector); // Add element to set, so we don't dispatch two onexists events for it if it matches the selector and an attribute changes in the same go
1506
1508
  // When the selector is a node the selector and the element are the same, dunno how we could reflect that in the typing though
1507
1509
  this.#call_callbacks([callback], callback_ => ({
1508
1510
  element_: selector,
@@ -1514,9 +1516,9 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
1514
1516
  callback_: callback_
1515
1517
  })
1516
1518
  }));
1519
+ }
1517
1520
  return;
1518
1521
  }
1519
- const our_set = this.#attribute_attribution_map_object[selector] ||= new WeakSet();
1520
1522
  for (let i = 0; i < territories.length; i++) {
1521
1523
  const found = $7599647868f98022$export$33f937d741e49339(territories[i], selector);
1522
1524
  if (!found) continue;
package/latest/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference path="../jsx.d.ts" />
2
2
  import { EUnavailabilityType } from "@depict-ai/types/api/TrackV2Request";
3
3
  import { Accessor } from "solid-js";
4
- export const version = "1.0.43";
4
+ export const version = "1.0.45";
5
5
  export const is_debug: boolean;
6
6
  /**
7
7
  * Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
package/latest/index.js CHANGED
@@ -12,7 +12,7 @@ function $parcel$export(e, n, v, s) {
12
12
  function $parcel$interopDefault(a) {
13
13
  return a && a.__esModule ? a.default : a;
14
14
  }
15
- const $0766c85d387a9765$export$83d89fbfd8236492 = "1.0.43";
15
+ const $0766c85d387a9765$export$83d89fbfd8236492 = "1.0.45";
16
16
  const $571bce04eb920cd8$export$55fe61489d2c7417 = /*@__PURE__*/(() => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
17
17
  const $649f456f663da9fc$var$browser_prefix_styling = "color: #fff;";
18
18
  let $649f456f663da9fc$var$browser_prefix = "[Depict]";
@@ -1222,7 +1222,7 @@ class $cdca9fea6eb103e5$export$12e07a2a9f87578a {
1222
1222
  #observer_callback_running = false;
1223
1223
  #execute_after_callback_ran = [];
1224
1224
  #attribute_attribution_map_object = {};
1225
- #territories = [document.documentElement];
1225
+ #territories = typeof document === "object" ? [document.documentElement] : [];
1226
1226
  #listeners = ["exists", "creation", "removed", "change"];
1227
1227
  #weakref_finalization_registry = typeof FinalizationRegistry === "function" && new FinalizationRegistry($b04e44fad5ea42c7$export$b3bbfd758f11cfa9(this.#finalization_registry_callback.bind(this)));
1228
1228
  #verbs = {
@@ -1231,6 +1231,7 @@ class $cdca9fea6eb103e5$export$12e07a2a9f87578a {
1231
1231
  const territories = this.#territories;
1232
1232
  this.#check_observer_args(selector, callback, true);
1233
1233
  if (typeof document === "undefined") return; // SSR
1234
+ const our_set = this.#attribute_attribution_map_object[selector] ||= new WeakSet();
1234
1235
  if (selector instanceof Node) {
1235
1236
  let node_is_contained = false;
1236
1237
  for (let i = 0; i < territories.length; i++) {
@@ -1238,7 +1239,8 @@ class $cdca9fea6eb103e5$export$12e07a2a9f87578a {
1238
1239
  node_is_contained = true;
1239
1240
  break;
1240
1241
  }
1241
- if (node_is_contained)
1242
+ if (node_is_contained) {
1243
+ our_set.add(selector); // Add element to set, so we don't dispatch two onexists events for it if it matches the selector and an attribute changes in the same go
1242
1244
  // When the selector is a node the selector and the element are the same, dunno how we could reflect that in the typing though
1243
1245
  this.#call_callbacks([callback], callback_ => ({
1244
1246
  element_: selector,
@@ -1250,9 +1252,9 @@ class $cdca9fea6eb103e5$export$12e07a2a9f87578a {
1250
1252
  callback_: callback_
1251
1253
  })
1252
1254
  }));
1255
+ }
1253
1256
  return;
1254
1257
  }
1255
- const our_set = this.#attribute_attribution_map_object[selector] ||= new WeakSet();
1256
1258
  for (let i = 0; i < territories.length; i++) {
1257
1259
  const found = $39ef887981612535$export$33f937d741e49339(territories[i], selector);
1258
1260
  if (!found) continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/utilishared",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "types": "ES10/index.d.ts",