sia-reactor 0.0.35 → 0.0.36

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.
Files changed (36) hide show
  1. package/README.md +1 -1
  2. package/dist/{TimeTravelConsole-BLDKZ0U1.d.ts → TimeTravelConsole-BpS9Fsqz.d.ts} +2 -2
  3. package/dist/{TimeTravelConsole-zvu8eqTZ.d.cts → TimeTravelConsole-C3w0XcIv.d.cts} +2 -2
  4. package/dist/adapters/react.cjs +44 -30
  5. package/dist/adapters/react.d.cts +3 -3
  6. package/dist/adapters/react.d.ts +3 -3
  7. package/dist/adapters/react.js +5 -5
  8. package/dist/adapters/vanilla.cjs +44 -30
  9. package/dist/adapters/vanilla.d.cts +4 -4
  10. package/dist/adapters/vanilla.d.ts +4 -4
  11. package/dist/adapters/vanilla.js +5 -5
  12. package/dist/{chunk-4S44OX5N.js → chunk-LZZ4AHVE.js} +17 -14
  13. package/dist/{chunk-243U74PP.js → chunk-ORK3EGB6.js} +13 -7
  14. package/dist/{chunk-OTBKVZ4L.js → chunk-PTNZ442E.js} +13 -13
  15. package/dist/{chunk-2ZYYYSZ4.js → chunk-SHWIAQD2.js} +36 -6
  16. package/dist/{chunk-A3ZCYWWM.js → chunk-SPVWCBIV.js} +16 -9
  17. package/dist/{index-CuLuFYu3.d.cts → index-BH-xZx9q.d.cts} +1 -1
  18. package/dist/{index-rWwvrfdn.d.cts → index-CTfsGm3B.d.cts} +21 -5
  19. package/dist/{index-rWwvrfdn.d.ts → index-CTfsGm3B.d.ts} +21 -5
  20. package/dist/{index-D_U8Nai1.d.ts → index-Ck9UPQ6r.d.ts} +1 -1
  21. package/dist/index.cjs +20 -15
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +2 -2
  25. package/dist/modules.cjs +35 -22
  26. package/dist/modules.d.cts +4 -4
  27. package/dist/modules.d.ts +4 -4
  28. package/dist/modules.js +4 -4
  29. package/dist/styles/time-travel-console.css +2 -0
  30. package/dist/super.d.ts +26 -8
  31. package/dist/super.global.js +86 -39
  32. package/dist/utils.cjs +50 -12
  33. package/dist/utils.d.cts +4 -4
  34. package/dist/utils.d.ts +4 -4
  35. package/dist/utils.js +6 -2
  36. package/package.json +2 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # sia-reactor
2
2
 
3
- > The Programmable Data DOM. A high-performance State & Intent Architecture (S.I.A.) Engine featuring zero-allocation loops, DOM-style event propagation, microtask batching, and structural sharing.
3
+ > The Programmable Data DOM. A high-performance State & Intent Architecture (S.I.A.) engine that gives your data transactional mutation routing and multi-phase state observation.
4
4
 
5
5
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
6
  [![NPM Version](https://img.shields.io/npm/v/sia-reactor.svg)](https://www.npmjs.com/package/sia-reactor)
@@ -1,5 +1,5 @@
1
- import { R as Reactive } from './index-rWwvrfdn.js';
2
- import { T as TimeTravelModule } from './index-D_U8Nai1.js';
1
+ import { R as Reactive } from './index-CTfsGm3B.js';
2
+ import { T as TimeTravelModule } from './index-Ck9UPQ6r.js';
3
3
 
4
4
  /** Reactive options for the TimeTravel overlay instance. */
5
5
  interface TimeTravelConsoleConfig {
@@ -1,5 +1,5 @@
1
- import { R as Reactive } from './index-rWwvrfdn.cjs';
2
- import { T as TimeTravelModule } from './index-CuLuFYu3.cjs';
1
+ import { R as Reactive } from './index-CTfsGm3B.cjs';
2
+ import { T as TimeTravelModule } from './index-BH-xZx9q.cjs';
3
3
 
4
4
  /** Reactive options for the TimeTravel overlay instance. */
5
5
  interface TimeTravelConsoleConfig {
@@ -53,9 +53,14 @@ var EVT_OPTS = { LISTENER: ["capture", "depth", "once", "signal", "init"], MEDIA
53
53
  var NIL = Object.freeze({});
54
54
  var NOOP = () => {
55
55
  };
56
+ var isDevEnv = false;
57
+ try {
58
+ isDevEnv = process.env.NODE_ENV !== "production";
59
+ } catch (e) {
60
+ }
56
61
  var CTX = {
57
62
  /** Flag indicating whether the application is running in development mode. */
58
- isDevEnv: "undefined" !== typeof process ? process.env.NODE_ENV !== "production" : true,
63
+ isDevEnv,
59
64
  /** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
60
65
  usingForce: false,
61
66
  /** Active `Autotracker` instance, override for automatic dependency collection on `Reactor` traps. */
@@ -97,10 +102,10 @@ function getPath(source, key, separator = ".", keyFunc) {
97
102
  const key2 = keyFunc ? keyFunc(keys2[i]) : keys2[i], match = key2.includes("[") && key2.match(arrRegex);
98
103
  if (match) {
99
104
  const [, key3, iStr] = match;
100
- if (!Array.isArray(currObj[key3]) || !(key3 in currObj)) return void 0;
105
+ if (!Array.isArray(currObj[key3]) || !(key3 in currObj)) return currObj[key3];
101
106
  currObj = currObj[key3][Number(iStr)];
102
107
  } else {
103
- if (!isObj(currObj) || !(key2 in currObj)) return void 0;
108
+ if (!isObj(currObj) || !(key2 in currObj)) return currObj[key2];
104
109
  currObj = currObj[key2];
105
110
  }
106
111
  }
@@ -354,10 +359,10 @@ var Reactor = class {
354
359
  const proxy = new Proxy(target, {
355
360
  // Robust Proxy handler
356
361
  get: (object, key2, receiver) => {
357
- if (key2 === RAW) return this.log(`\u{1F440} [Reactor \`get\` Trap] Peeked at ${object}`), object;
362
+ if (key2 === RAW) return this.log(`\u{1F440} [\`get\` Trap] Peeked at ${object}`), object;
358
363
  let value = !this.config.preserveContext ? object[key2] : Reflect.get(object, key2, receiver);
359
364
  const keyStr = String(key2), fullPath = path ? path + "." + keyStr : keyStr, paths = this.config.lineageTracing ? this.trace(object, keyStr) : fullPath;
360
- this.log(`\u{1F50D} [Reactor \`get\` Trap] Initiated for "${keyStr}" on "${paths}"`), CTX.autotracker?.track(fullPath, this);
365
+ this.log(`\u{1F50D} [\`get\` Trap] Initiated for "${keyStr}" on [${paths}]`), CTX.autotracker?.track(fullPath, this);
361
366
  if (this.config.get) value = this.config.get(object, key2, value, receiver, paths);
362
367
  if (this.getters) {
363
368
  const wildcords = this.getters.get("*");
@@ -376,13 +381,13 @@ var Reactor = class {
376
381
  set: (object, key2, value, receiver) => {
377
382
  let unchanged, safeValue, safeOldValue, terminated = false;
378
383
  const keyStr = String(key2), fullPath = path ? path + "." + keyStr : keyStr, paths = this.config.lineageTracing ? this.trace(object, keyStr) : fullPath, loopLen = this.config.lineageTracing ? paths.length : 1, oldValue = !this.config.preserveContext ? object[key2] : Reflect.get(object, key2, receiver), hadKey = !this.config.preserveContext ? key2 in object : Reflect.has(object, key2);
379
- this.log(`\u270F\uFE0F [Reactor \`set\` Trap] Initiated for "${keyStr}" on "${paths}"`), CTX.autotracker?.track(fullPath, this, true);
384
+ this.log(`\u270F\uFE0F [\`set\` Trap] Initiated for "${keyStr}" on [${paths}]`), CTX.autotracker?.track(fullPath, this, true);
380
385
  if (this.config.referenceTracking || !indiffable) {
381
386
  safeOldValue = oldValue?.[RAW] || oldValue;
382
387
  safeValue = value?.[RAW] || value;
383
388
  unchanged = this.config.equalityFunction(safeValue, safeOldValue);
384
389
  }
385
- if (!indiffable && unchanged && !CTX.usingForce && keyStr !== "length") return this.log(`\u{1F504} [Reactor \`set\` Trap] Unchanged for "${keyStr}" on "${paths}"`), true;
390
+ if (!indiffable && unchanged && !CTX.usingForce && keyStr !== "length") return this.log(`\u{1F504} [\`set\` Trap] Unchanged for "${keyStr}" on [${paths}]`), true;
386
391
  if (this.config.set) terminated = (value = this.config.set(object, key2, value, oldValue, receiver, paths)) === TERMINATOR;
387
392
  if (this.setters) {
388
393
  const wildcords = this.setters.get("*");
@@ -400,9 +405,9 @@ var Reactor = class {
400
405
  if (!(terminated ||= payload.terminated)) value = result;
401
406
  }
402
407
  }
403
- if (terminated) return this.log(`\u{1F6E1}\uFE0F [Reactor \`set\` Trap] Terminated for "${keyStr}" on "${paths}"`), true;
408
+ if (terminated) return this.log(`\u{1F6E1}\uFE0F [\`set\` Trap] Terminated for "${keyStr}" on [${paths}]`), true;
404
409
  const success = !this.config.preserveContext ? (object[key2] = value, true) : Reflect.set(object, key2, value, receiver);
405
- if (!success) return this.log(`\u274C [Reactor \`set\` Trap] Failed for "${keyStr}" on "${paths}"`), false;
410
+ if (!success) return this.log(`\u274C [\`set\` Trap] Failed for "${keyStr}" on [${paths}]`), false;
406
411
  if (this.config.referenceTracking && !unchanged) this.config.smartCloning && this.stamp(object), this.unlink(safeOldValue, object, keyStr), this.link(safeValue, object, keyStr);
407
412
  if (this.watchers || this.listeners)
408
413
  for (let i = 0; i < loopLen; i++) {
@@ -414,7 +419,7 @@ var Reactor = class {
414
419
  deleteProperty: (object, key2) => {
415
420
  let value, receiver = this.proxyCache.get(object), terminated = false;
416
421
  const keyStr = String(key2), fullPath = path ? path + "." + keyStr : keyStr, paths = this.config.lineageTracing ? this.trace(object, keyStr) : fullPath, loopLen = this.config.lineageTracing ? paths.length : 1, oldValue = !this.config.preserveContext ? object[key2] : Reflect.get(object, key2, receiver), hadKey = !this.config.preserveContext ? key2 in object : Reflect.has(object, key2);
417
- this.log(`\u{1F5D1}\uFE0F [Reactor \`deleteProperty\` Trap] Initiated for "${keyStr}" on "${paths}"`), CTX.autotracker?.track(fullPath, this, true);
422
+ this.log(`\u{1F5D1}\uFE0F [\`deleteProperty\` Trap] Initiated for "${keyStr}" on [${paths}]`), CTX.autotracker?.track(fullPath, this, true);
418
423
  if (this.config.deleteProperty) terminated = (value = this.config.deleteProperty(object, key2, oldValue, receiver, paths)) === TERMINATOR;
419
424
  if (this.deleters) {
420
425
  const wildcords = this.deleters.get("*");
@@ -431,9 +436,9 @@ var Reactor = class {
431
436
  if (!(terminated ||= payload.terminated)) value = result;
432
437
  }
433
438
  }
434
- if (terminated) return this.log(`\u{1F6E1}\uFE0F [Reactor \`deleteProperty\` Trap] Terminated for "${keyStr}" on "${paths}"`), true;
439
+ if (terminated) return this.log(`\u{1F6E1}\uFE0F [\`deleteProperty\` Trap] Terminated for "${keyStr}" on [${paths}]`), true;
435
440
  const success = !this.config.preserveContext ? delete object[key2] : Reflect.deleteProperty(object, key2);
436
- if (!success) return this.log(`\u274C [Reactor \`deleteProperty\` Trap] Failed for "${keyStr}" on "${paths}"`), false;
441
+ if (!success) return this.log(`\u274C [\`deleteProperty\` Trap] Failed for "${keyStr}" on [${paths}]`), false;
437
442
  if (this.config.referenceTracking) this.config.smartCloning && this.stamp(object), this.unlink(oldValue?.[RAW] || oldValue, object, keyStr);
438
443
  if (this.watchers || this.listeners)
439
444
  for (let i = 0; i < loopLen; i++) {
@@ -445,21 +450,21 @@ var Reactor = class {
445
450
  has: (object, key2) => {
446
451
  let has = !this.config.preserveContext ? key2 in object : Reflect.has(object, key2);
447
452
  const keyStr = String(key2), fullPath = path ? path + "." + keyStr : keyStr;
448
- this.log(`\u2753 [Reactor \`has\` Trap] Initiated for "${keyStr}" on "${fullPath}"`), CTX.autotracker?.track(fullPath, this);
453
+ this.log(`\u2753 [\`has\` Trap] Initiated for "${keyStr}" on '${fullPath}'`), CTX.autotracker?.track(fullPath, this);
449
454
  if (this.config.has) has = this.config.has(object, key2, has, this.proxyCache.get(object), fullPath);
450
455
  return has;
451
456
  },
452
457
  getOwnPropertyDescriptor: (object, key2) => {
453
458
  let descriptor = !this.config.preserveContext ? Object.getOwnPropertyDescriptor(object, key2) : Reflect.getOwnPropertyDescriptor(object, key2);
454
459
  const keyStr = String(key2), fullPath = path ? path + "." + keyStr : keyStr;
455
- this.log(`\u{1F4CB} [Reactor \`getOwnPropertyDescriptor\` Trap] Initiated for "${keyStr}" on "${fullPath}"`), CTX.autotracker?.track(fullPath, this);
460
+ this.log(`\u{1F4CB} [\`getOwnPropertyDescriptor\` Trap] Initiated for "${keyStr}" on '${fullPath}'`), CTX.autotracker?.track(fullPath, this);
456
461
  if (this.config.getOwnPropertyDescriptor) descriptor = this.config.getOwnPropertyDescriptor(object, key2, descriptor, this.proxyCache.get(object), this.config.lineageTracing ? this.trace(object, keyStr) : fullPath);
457
462
  return descriptor;
458
463
  },
459
464
  ownKeys: (object) => {
460
465
  let ownKeys = Reflect.ownKeys(object);
461
466
  const safePath = path || "*";
462
- this.log(`\u{1F511} [Reactor \`ownKeys\` Trap] Initiated on "${safePath}"`), CTX.autotracker?.track(safePath, this);
467
+ this.log(`\u{1F511} [\`ownKeys\` Trap] Initiated on "${safePath}"`), CTX.autotracker?.track(safePath, this);
463
468
  if (this.config.ownKeys) ownKeys = this.config.ownKeys(object, ownKeys, this.proxyCache.get(object), safePath);
464
469
  return ownKeys;
465
470
  }
@@ -938,41 +943,44 @@ var Autotracker = class {
938
943
  get: (object, key, receiver) => {
939
944
  if (key === RAW) return this.rtr.log(`\u{1F440} [AutoTracker \`get\` Trap] Peeked at ${object}`), object;
940
945
  const keyStr = String(key), fullPath = path ? `${path}.${keyStr}` : keyStr;
941
- return this.rtr.log(`\u{1F50D} [AutoTracker \`get\` Trap] Initiated for "${keyStr}" on "${path}"`), this.track(fullPath), this.proxied(!this.rtr.config.preserveContext ? object[key] : Reflect.get(object, key, receiver), fullPath);
946
+ return this.rtr.log(`\u{1F50D} [AutoTracker \`get\` Trap] Initiated for "${keyStr}" on '${path}'`), this.track(fullPath), this.proxied(!this.rtr.config.preserveContext ? object[key] : Reflect.get(object, key, receiver), fullPath);
942
947
  },
943
948
  has: (object, key) => {
944
949
  const keyStr = String(key), fullPath = path ? `${path}.${keyStr}` : keyStr;
945
- return this.rtr.log(`\u2753 [AutoTracker \`has\` Trap] Initiated for "${keyStr}" on "${path}"`), this.track(fullPath), !this.rtr.config.preserveContext ? key in object : Reflect.has(object, key);
950
+ return this.rtr.log(`\u2753 [AutoTracker \`has\` Trap] Initiated for "${keyStr}" on '${path}'`), this.track(fullPath), !this.rtr.config.preserveContext ? key in object : Reflect.has(object, key);
946
951
  },
947
952
  getOwnPropertyDescriptor: (object, key) => {
948
953
  const keyStr = String(key), fullPath = path ? `${path}.${keyStr}` : keyStr;
949
- return this.rtr.log(`\u{1F4CB} [AutoTracker \`getOwnPropertyDescriptor\` Trap] Initiated for "${keyStr}" on "${path}"`), this.track(fullPath), !this.rtr.config.preserveContext ? Object.getOwnPropertyDescriptor(object, key) : Reflect.getOwnPropertyDescriptor(object, key);
954
+ return this.rtr.log(`\u{1F4CB} [AutoTracker \`getOwnPropertyDescriptor\` Trap] Initiated for "${keyStr}" on '${path}'`), this.track(fullPath), !this.rtr.config.preserveContext ? Object.getOwnPropertyDescriptor(object, key) : Reflect.getOwnPropertyDescriptor(object, key);
950
955
  },
951
956
  ownKeys: (object) => {
952
957
  const safePath = path || "*";
953
958
  return this.rtr.log(`\u{1F511} [AutoTracker \`ownKeys\` Trap] Initiated on "${safePath}"`), this.track(safePath), Reflect.ownKeys(object);
954
959
  },
955
960
  set: (_, key) => {
956
- throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`set\` Trap] Blocked for "${String(key)}" on "${path}"`);
961
+ throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`set\` Trap] Blocked for "${String(key)}" on '${path}'`);
957
962
  },
958
963
  deleteProperty: (_, key) => {
959
- throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`deleteProperty\` Trap] Blocked for "${String(key)}" on "${path}"`);
964
+ throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`deleteProperty\` Trap] Blocked for "${String(key)}" on '${path}'`);
960
965
  },
961
966
  defineProperty: (_, key) => {
962
- throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`defineProperty\` Trap] Blocked for "${String(key)}" on "${path}"`);
967
+ throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`defineProperty\` Trap] Blocked for "${String(key)}" on '${path}'`);
963
968
  },
964
969
  setPrototypeOf: (_, key) => {
965
- throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`setPrototypeOf\` Trap] Blocked for "${String(key)}" on "${path}"`);
970
+ throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`setPrototypeOf\` Trap] Blocked for "${String(key)}" on '${path}'`);
966
971
  }
967
972
  });
968
973
  return this.proxyCache.set(obj, proxy), proxy;
969
974
  }
970
975
  /** Adds a path to the tracking set. */
971
- track(path, rtr = this.rtr, prune = false) {
976
+ track(path, rtr = this.rtr, prune = false, strict = false) {
972
977
  if (!this.isTracking || !path || this.autortr && this.autortr !== rtr) return path;
973
978
  let paths = this.deps.get(rtr);
974
979
  if (!prune && !paths) paths = (this.deps.set(rtr, paths = /* @__PURE__ */ new Set()), paths);
975
- if (path.startsWith(this.lastPath + ".")) paths.delete(this.lastPath);
980
+ if (path.startsWith(this.lastPath + ".")) {
981
+ const child = path.slice(this.lastPath.length + 1);
982
+ (strict || !child.includes("Symbol(") && child !== "length" && !/^\d+$/.test(child)) && paths.delete(this.lastPath);
983
+ }
976
984
  return !prune && paths.add(this.lastPath = path), path;
977
985
  }
978
986
  /** Removes a path from the tracking set. */
@@ -1131,16 +1139,22 @@ var wpArr = ["*"];
1131
1139
  function createEl(tag, props, dataset, styles, el = tag ? document?.createElement(tag) : null) {
1132
1140
  return assignEl(el, props, dataset, styles);
1133
1141
  }
1134
- function assignEl(el, props, dataset, styles) {
1142
+ function assignEl(el, props, dataset, styles, nodiff = true) {
1135
1143
  if (!el) return null;
1136
1144
  if (props) {
1137
- for (const k of Object.keys(props)) if (props[k] !== void 0) el[k] = props[k];
1145
+ for (const k of Object.keys(props)) if (props[k] !== void 0) {
1146
+ if (nodiff || el[k] !== props[k]) el[k] = props[k];
1147
+ }
1138
1148
  }
1139
1149
  if (dataset) {
1140
- for (const k of Object.keys(dataset)) if (dataset[k] !== void 0) el.dataset[k] = String(dataset[k]);
1150
+ for (const k of Object.keys(dataset)) if (dataset[k] !== void 0) {
1151
+ if (nodiff || el.dataset[k] !== dataset[k]) el.dataset[k] = String(dataset[k]);
1152
+ }
1141
1153
  }
1142
1154
  if (styles) {
1143
- for (const k of Object.keys(styles)) if (styles[k] !== void 0) el.style[k] = styles[k];
1155
+ for (const k of Object.keys(styles)) if (styles[k] !== void 0) {
1156
+ if (nodiff || el.style[k] !== styles[k]) el.style[k] = styles[k];
1157
+ }
1144
1158
  }
1145
1159
  return el;
1146
1160
  }
@@ -1193,7 +1207,7 @@ function keyEventAllowed(e, settings) {
1193
1207
  if (settings.disabled) return false;
1194
1208
  const activeEl = getActiveEl(e.target?.ownerDocument);
1195
1209
  if ((e.key === " " || e.key === "Enter") && activeEl?.matches("button,input[type='button'],input[type='submit']")) return false;
1196
- if (e.currentTarget !== activeEl && activeEl?.matches("input,textarea,[contenteditable]") && !(e.key === "Escape" && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey)) return false;
1210
+ if (e.currentTarget !== activeEl && activeEl?.matches("input,textarea,[contenteditable],[role]") && !(e.key === "Escape" && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey)) return false;
1197
1211
  const combo = stringifyKeyEvent(e), { override, block, action, whitelisted } = getTermsForKey(combo, settings);
1198
1212
  if (block) return false;
1199
1213
  if (override) e.preventDefault();
@@ -1240,7 +1254,7 @@ var TimeTravelConsole = class _TimeTravelConsole {
1240
1254
  * @param time TimeTravel module instance that owns timeline operations.
1241
1255
  * @param build Optional initial overlay config overrides.
1242
1256
  */
1243
- constructor(time, build = {}) {
1257
+ constructor(time, build = { devOnly: true }) {
1244
1258
  this.time = time;
1245
1259
  this.config = reactive({ title: `Time Travel Console ${this.index = ++_TimeTravelConsole.count}`, ...build });
1246
1260
  this.state.open = !!this.config.startOpen;
@@ -1,7 +1,7 @@
1
- import { E as EffectOptions, d as Reactor, R as Reactive, G as ReactorBuild, H as DeepReadonly, W as WildPaths, a as PathValue } from '../index-rWwvrfdn.cjs';
1
+ import { E as EffectOptions, d as Reactor, R as Reactive, I as ReactorBuild, J as DeepReadonly, W as WildPaths, a as PathValue } from '../index-CTfsGm3B.cjs';
2
2
  import { useLayoutEffect } from 'react';
3
- import { T as TimeTravelModule } from '../index-CuLuFYu3.cjs';
4
- import { a as TimeTravelConsoleConfig } from '../TimeTravelConsole-zvu8eqTZ.cjs';
3
+ import { T as TimeTravelModule } from '../index-BH-xZx9q.cjs';
4
+ import { a as TimeTravelConsoleConfig } from '../TimeTravelConsole-C3w0XcIv.cjs';
5
5
 
6
6
  /**
7
7
  * Subscribes a component to desired Reactor state and returns it.
@@ -1,7 +1,7 @@
1
- import { E as EffectOptions, d as Reactor, R as Reactive, G as ReactorBuild, H as DeepReadonly, W as WildPaths, a as PathValue } from '../index-rWwvrfdn.js';
1
+ import { E as EffectOptions, d as Reactor, R as Reactive, I as ReactorBuild, J as DeepReadonly, W as WildPaths, a as PathValue } from '../index-CTfsGm3B.js';
2
2
  import { useLayoutEffect } from 'react';
3
- import { T as TimeTravelModule } from '../index-D_U8Nai1.js';
4
- import { a as TimeTravelConsoleConfig } from '../TimeTravelConsole-BLDKZ0U1.js';
3
+ import { T as TimeTravelModule } from '../index-Ck9UPQ6r.js';
4
+ import { a as TimeTravelConsoleConfig } from '../TimeTravelConsole-BpS9Fsqz.js';
5
5
 
6
6
  /**
7
7
  * Subscribes a component to desired Reactor state and returns it.
@@ -2,18 +2,18 @@ import {
2
2
  Autotracker,
3
3
  TimeTravelConsole,
4
4
  withTracker
5
- } from "../chunk-4S44OX5N.js";
6
- import "../chunk-A3ZCYWWM.js";
5
+ } from "../chunk-LZZ4AHVE.js";
6
+ import "../chunk-SPVWCBIV.js";
7
7
  import {
8
8
  getReactor
9
- } from "../chunk-OTBKVZ4L.js";
10
- import "../chunk-243U74PP.js";
9
+ } from "../chunk-PTNZ442E.js";
10
+ import "../chunk-ORK3EGB6.js";
11
11
  import {
12
12
  CTX,
13
13
  NIL,
14
14
  NOOP,
15
15
  getPath
16
- } from "../chunk-2ZYYYSZ4.js";
16
+ } from "../chunk-SHWIAQD2.js";
17
17
 
18
18
  // src/ts/adapters/react/hooks/useReactor.ts
19
19
  import { useRef, useCallback, useSyncExternalStore, useMemo } from "react";
@@ -41,9 +41,14 @@ var EVT_OPTS = { LISTENER: ["capture", "depth", "once", "signal", "init"], MEDIA
41
41
  var NIL = Object.freeze({});
42
42
  var NOOP = () => {
43
43
  };
44
+ var isDevEnv = false;
45
+ try {
46
+ isDevEnv = process.env.NODE_ENV !== "production";
47
+ } catch (e) {
48
+ }
44
49
  var CTX = {
45
50
  /** Flag indicating whether the application is running in development mode. */
46
- isDevEnv: "undefined" !== typeof process ? process.env.NODE_ENV !== "production" : true,
51
+ isDevEnv,
47
52
  /** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
48
53
  usingForce: false,
49
54
  /** Active `Autotracker` instance, override for automatic dependency collection on `Reactor` traps. */
@@ -85,10 +90,10 @@ function getPath(source, key, separator = ".", keyFunc) {
85
90
  const key2 = keyFunc ? keyFunc(keys2[i]) : keys2[i], match = key2.includes("[") && key2.match(arrRegex);
86
91
  if (match) {
87
92
  const [, key3, iStr] = match;
88
- if (!Array.isArray(currObj[key3]) || !(key3 in currObj)) return void 0;
93
+ if (!Array.isArray(currObj[key3]) || !(key3 in currObj)) return currObj[key3];
89
94
  currObj = currObj[key3][Number(iStr)];
90
95
  } else {
91
- if (!isObj(currObj) || !(key2 in currObj)) return void 0;
96
+ if (!isObj(currObj) || !(key2 in currObj)) return currObj[key2];
92
97
  currObj = currObj[key2];
93
98
  }
94
99
  }
@@ -218,41 +223,44 @@ var Autotracker = class {
218
223
  get: (object, key, receiver) => {
219
224
  if (key === RAW) return this.rtr.log(`\u{1F440} [AutoTracker \`get\` Trap] Peeked at ${object}`), object;
220
225
  const keyStr = String(key), fullPath = path ? `${path}.${keyStr}` : keyStr;
221
- return this.rtr.log(`\u{1F50D} [AutoTracker \`get\` Trap] Initiated for "${keyStr}" on "${path}"`), this.track(fullPath), this.proxied(!this.rtr.config.preserveContext ? object[key] : Reflect.get(object, key, receiver), fullPath);
226
+ return this.rtr.log(`\u{1F50D} [AutoTracker \`get\` Trap] Initiated for "${keyStr}" on '${path}'`), this.track(fullPath), this.proxied(!this.rtr.config.preserveContext ? object[key] : Reflect.get(object, key, receiver), fullPath);
222
227
  },
223
228
  has: (object, key) => {
224
229
  const keyStr = String(key), fullPath = path ? `${path}.${keyStr}` : keyStr;
225
- return this.rtr.log(`\u2753 [AutoTracker \`has\` Trap] Initiated for "${keyStr}" on "${path}"`), this.track(fullPath), !this.rtr.config.preserveContext ? key in object : Reflect.has(object, key);
230
+ return this.rtr.log(`\u2753 [AutoTracker \`has\` Trap] Initiated for "${keyStr}" on '${path}'`), this.track(fullPath), !this.rtr.config.preserveContext ? key in object : Reflect.has(object, key);
226
231
  },
227
232
  getOwnPropertyDescriptor: (object, key) => {
228
233
  const keyStr = String(key), fullPath = path ? `${path}.${keyStr}` : keyStr;
229
- return this.rtr.log(`\u{1F4CB} [AutoTracker \`getOwnPropertyDescriptor\` Trap] Initiated for "${keyStr}" on "${path}"`), this.track(fullPath), !this.rtr.config.preserveContext ? Object.getOwnPropertyDescriptor(object, key) : Reflect.getOwnPropertyDescriptor(object, key);
234
+ return this.rtr.log(`\u{1F4CB} [AutoTracker \`getOwnPropertyDescriptor\` Trap] Initiated for "${keyStr}" on '${path}'`), this.track(fullPath), !this.rtr.config.preserveContext ? Object.getOwnPropertyDescriptor(object, key) : Reflect.getOwnPropertyDescriptor(object, key);
230
235
  },
231
236
  ownKeys: (object) => {
232
237
  const safePath = path || "*";
233
238
  return this.rtr.log(`\u{1F511} [AutoTracker \`ownKeys\` Trap] Initiated on "${safePath}"`), this.track(safePath), Reflect.ownKeys(object);
234
239
  },
235
240
  set: (_, key) => {
236
- throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`set\` Trap] Blocked for "${String(key)}" on "${path}"`);
241
+ throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`set\` Trap] Blocked for "${String(key)}" on '${path}'`);
237
242
  },
238
243
  deleteProperty: (_, key) => {
239
- throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`deleteProperty\` Trap] Blocked for "${String(key)}" on "${path}"`);
244
+ throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`deleteProperty\` Trap] Blocked for "${String(key)}" on '${path}'`);
240
245
  },
241
246
  defineProperty: (_, key) => {
242
- throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`defineProperty\` Trap] Blocked for "${String(key)}" on "${path}"`);
247
+ throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`defineProperty\` Trap] Blocked for "${String(key)}" on '${path}'`);
243
248
  },
244
249
  setPrototypeOf: (_, key) => {
245
- throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`setPrototypeOf\` Trap] Blocked for "${String(key)}" on "${path}"`);
250
+ throw new Error(`\u{1F6E1}\uFE0F [AutoTracker \`setPrototypeOf\` Trap] Blocked for "${String(key)}" on '${path}'`);
246
251
  }
247
252
  });
248
253
  return this.proxyCache.set(obj, proxy), proxy;
249
254
  }
250
255
  /** Adds a path to the tracking set. */
251
- track(path, rtr = this.rtr, prune = false) {
256
+ track(path, rtr = this.rtr, prune = false, strict = false) {
252
257
  if (!this.isTracking || !path || this.autortr && this.autortr !== rtr) return path;
253
258
  let paths = this.deps.get(rtr);
254
259
  if (!prune && !paths) paths = (this.deps.set(rtr, paths = /* @__PURE__ */ new Set()), paths);
255
- if (path.startsWith(this.lastPath + ".")) paths.delete(this.lastPath);
260
+ if (path.startsWith(this.lastPath + ".")) {
261
+ const child = path.slice(this.lastPath.length + 1);
262
+ (strict || !child.includes("Symbol(") && child !== "length" && !/^\d+$/.test(child)) && paths.delete(this.lastPath);
263
+ }
256
264
  return !prune && paths.add(this.lastPath = path), path;
257
265
  }
258
266
  /** Removes a path from the tracking set. */
@@ -497,10 +505,10 @@ var Reactor = class {
497
505
  const proxy = new Proxy(target, {
498
506
  // Robust Proxy handler
499
507
  get: (object, key2, receiver) => {
500
- if (key2 === RAW) return this.log(`\u{1F440} [Reactor \`get\` Trap] Peeked at ${object}`), object;
508
+ if (key2 === RAW) return this.log(`\u{1F440} [\`get\` Trap] Peeked at ${object}`), object;
501
509
  let value = !this.config.preserveContext ? object[key2] : Reflect.get(object, key2, receiver);
502
510
  const keyStr = String(key2), fullPath = path ? path + "." + keyStr : keyStr, paths = this.config.lineageTracing ? this.trace(object, keyStr) : fullPath;
503
- this.log(`\u{1F50D} [Reactor \`get\` Trap] Initiated for "${keyStr}" on "${paths}"`), CTX.autotracker?.track(fullPath, this);
511
+ this.log(`\u{1F50D} [\`get\` Trap] Initiated for "${keyStr}" on [${paths}]`), CTX.autotracker?.track(fullPath, this);
504
512
  if (this.config.get) value = this.config.get(object, key2, value, receiver, paths);
505
513
  if (this.getters) {
506
514
  const wildcords = this.getters.get("*");
@@ -519,13 +527,13 @@ var Reactor = class {
519
527
  set: (object, key2, value, receiver) => {
520
528
  let unchanged, safeValue, safeOldValue, terminated = false;
521
529
  const keyStr = String(key2), fullPath = path ? path + "." + keyStr : keyStr, paths = this.config.lineageTracing ? this.trace(object, keyStr) : fullPath, loopLen = this.config.lineageTracing ? paths.length : 1, oldValue = !this.config.preserveContext ? object[key2] : Reflect.get(object, key2, receiver), hadKey = !this.config.preserveContext ? key2 in object : Reflect.has(object, key2);
522
- this.log(`\u270F\uFE0F [Reactor \`set\` Trap] Initiated for "${keyStr}" on "${paths}"`), CTX.autotracker?.track(fullPath, this, true);
530
+ this.log(`\u270F\uFE0F [\`set\` Trap] Initiated for "${keyStr}" on [${paths}]`), CTX.autotracker?.track(fullPath, this, true);
523
531
  if (this.config.referenceTracking || !indiffable) {
524
532
  safeOldValue = oldValue?.[RAW] || oldValue;
525
533
  safeValue = value?.[RAW] || value;
526
534
  unchanged = this.config.equalityFunction(safeValue, safeOldValue);
527
535
  }
528
- if (!indiffable && unchanged && !CTX.usingForce && keyStr !== "length") return this.log(`\u{1F504} [Reactor \`set\` Trap] Unchanged for "${keyStr}" on "${paths}"`), true;
536
+ if (!indiffable && unchanged && !CTX.usingForce && keyStr !== "length") return this.log(`\u{1F504} [\`set\` Trap] Unchanged for "${keyStr}" on [${paths}]`), true;
529
537
  if (this.config.set) terminated = (value = this.config.set(object, key2, value, oldValue, receiver, paths)) === TERMINATOR;
530
538
  if (this.setters) {
531
539
  const wildcords = this.setters.get("*");
@@ -543,9 +551,9 @@ var Reactor = class {
543
551
  if (!(terminated ||= payload.terminated)) value = result;
544
552
  }
545
553
  }
546
- if (terminated) return this.log(`\u{1F6E1}\uFE0F [Reactor \`set\` Trap] Terminated for "${keyStr}" on "${paths}"`), true;
554
+ if (terminated) return this.log(`\u{1F6E1}\uFE0F [\`set\` Trap] Terminated for "${keyStr}" on [${paths}]`), true;
547
555
  const success = !this.config.preserveContext ? (object[key2] = value, true) : Reflect.set(object, key2, value, receiver);
548
- if (!success) return this.log(`\u274C [Reactor \`set\` Trap] Failed for "${keyStr}" on "${paths}"`), false;
556
+ if (!success) return this.log(`\u274C [\`set\` Trap] Failed for "${keyStr}" on [${paths}]`), false;
549
557
  if (this.config.referenceTracking && !unchanged) this.config.smartCloning && this.stamp(object), this.unlink(safeOldValue, object, keyStr), this.link(safeValue, object, keyStr);
550
558
  if (this.watchers || this.listeners)
551
559
  for (let i = 0; i < loopLen; i++) {
@@ -557,7 +565,7 @@ var Reactor = class {
557
565
  deleteProperty: (object, key2) => {
558
566
  let value, receiver = this.proxyCache.get(object), terminated = false;
559
567
  const keyStr = String(key2), fullPath = path ? path + "." + keyStr : keyStr, paths = this.config.lineageTracing ? this.trace(object, keyStr) : fullPath, loopLen = this.config.lineageTracing ? paths.length : 1, oldValue = !this.config.preserveContext ? object[key2] : Reflect.get(object, key2, receiver), hadKey = !this.config.preserveContext ? key2 in object : Reflect.has(object, key2);
560
- this.log(`\u{1F5D1}\uFE0F [Reactor \`deleteProperty\` Trap] Initiated for "${keyStr}" on "${paths}"`), CTX.autotracker?.track(fullPath, this, true);
568
+ this.log(`\u{1F5D1}\uFE0F [\`deleteProperty\` Trap] Initiated for "${keyStr}" on [${paths}]`), CTX.autotracker?.track(fullPath, this, true);
561
569
  if (this.config.deleteProperty) terminated = (value = this.config.deleteProperty(object, key2, oldValue, receiver, paths)) === TERMINATOR;
562
570
  if (this.deleters) {
563
571
  const wildcords = this.deleters.get("*");
@@ -574,9 +582,9 @@ var Reactor = class {
574
582
  if (!(terminated ||= payload.terminated)) value = result;
575
583
  }
576
584
  }
577
- if (terminated) return this.log(`\u{1F6E1}\uFE0F [Reactor \`deleteProperty\` Trap] Terminated for "${keyStr}" on "${paths}"`), true;
585
+ if (terminated) return this.log(`\u{1F6E1}\uFE0F [\`deleteProperty\` Trap] Terminated for "${keyStr}" on [${paths}]`), true;
578
586
  const success = !this.config.preserveContext ? delete object[key2] : Reflect.deleteProperty(object, key2);
579
- if (!success) return this.log(`\u274C [Reactor \`deleteProperty\` Trap] Failed for "${keyStr}" on "${paths}"`), false;
587
+ if (!success) return this.log(`\u274C [\`deleteProperty\` Trap] Failed for "${keyStr}" on [${paths}]`), false;
580
588
  if (this.config.referenceTracking) this.config.smartCloning && this.stamp(object), this.unlink(oldValue?.[RAW] || oldValue, object, keyStr);
581
589
  if (this.watchers || this.listeners)
582
590
  for (let i = 0; i < loopLen; i++) {
@@ -588,21 +596,21 @@ var Reactor = class {
588
596
  has: (object, key2) => {
589
597
  let has = !this.config.preserveContext ? key2 in object : Reflect.has(object, key2);
590
598
  const keyStr = String(key2), fullPath = path ? path + "." + keyStr : keyStr;
591
- this.log(`\u2753 [Reactor \`has\` Trap] Initiated for "${keyStr}" on "${fullPath}"`), CTX.autotracker?.track(fullPath, this);
599
+ this.log(`\u2753 [\`has\` Trap] Initiated for "${keyStr}" on '${fullPath}'`), CTX.autotracker?.track(fullPath, this);
592
600
  if (this.config.has) has = this.config.has(object, key2, has, this.proxyCache.get(object), fullPath);
593
601
  return has;
594
602
  },
595
603
  getOwnPropertyDescriptor: (object, key2) => {
596
604
  let descriptor = !this.config.preserveContext ? Object.getOwnPropertyDescriptor(object, key2) : Reflect.getOwnPropertyDescriptor(object, key2);
597
605
  const keyStr = String(key2), fullPath = path ? path + "." + keyStr : keyStr;
598
- this.log(`\u{1F4CB} [Reactor \`getOwnPropertyDescriptor\` Trap] Initiated for "${keyStr}" on "${fullPath}"`), CTX.autotracker?.track(fullPath, this);
606
+ this.log(`\u{1F4CB} [\`getOwnPropertyDescriptor\` Trap] Initiated for "${keyStr}" on '${fullPath}'`), CTX.autotracker?.track(fullPath, this);
599
607
  if (this.config.getOwnPropertyDescriptor) descriptor = this.config.getOwnPropertyDescriptor(object, key2, descriptor, this.proxyCache.get(object), this.config.lineageTracing ? this.trace(object, keyStr) : fullPath);
600
608
  return descriptor;
601
609
  },
602
610
  ownKeys: (object) => {
603
611
  let ownKeys = Reflect.ownKeys(object);
604
612
  const safePath = path || "*";
605
- this.log(`\u{1F511} [Reactor \`ownKeys\` Trap] Initiated on "${safePath}"`), CTX.autotracker?.track(safePath, this);
613
+ this.log(`\u{1F511} [\`ownKeys\` Trap] Initiated on "${safePath}"`), CTX.autotracker?.track(safePath, this);
606
614
  if (this.config.ownKeys) ownKeys = this.config.ownKeys(object, ownKeys, this.proxyCache.get(object), safePath);
607
615
  return ownKeys;
608
616
  }
@@ -1051,16 +1059,22 @@ var wpArr = ["*"];
1051
1059
  function createEl(tag, props, dataset, styles, el = tag ? document?.createElement(tag) : null) {
1052
1060
  return assignEl(el, props, dataset, styles);
1053
1061
  }
1054
- function assignEl(el, props, dataset, styles) {
1062
+ function assignEl(el, props, dataset, styles, nodiff = true) {
1055
1063
  if (!el) return null;
1056
1064
  if (props) {
1057
- for (const k of Object.keys(props)) if (props[k] !== void 0) el[k] = props[k];
1065
+ for (const k of Object.keys(props)) if (props[k] !== void 0) {
1066
+ if (nodiff || el[k] !== props[k]) el[k] = props[k];
1067
+ }
1058
1068
  }
1059
1069
  if (dataset) {
1060
- for (const k of Object.keys(dataset)) if (dataset[k] !== void 0) el.dataset[k] = String(dataset[k]);
1070
+ for (const k of Object.keys(dataset)) if (dataset[k] !== void 0) {
1071
+ if (nodiff || el.dataset[k] !== dataset[k]) el.dataset[k] = String(dataset[k]);
1072
+ }
1061
1073
  }
1062
1074
  if (styles) {
1063
- for (const k of Object.keys(styles)) if (styles[k] !== void 0) el.style[k] = styles[k];
1075
+ for (const k of Object.keys(styles)) if (styles[k] !== void 0) {
1076
+ if (nodiff || el.style[k] !== styles[k]) el.style[k] = styles[k];
1077
+ }
1064
1078
  }
1065
1079
  return el;
1066
1080
  }
@@ -1113,7 +1127,7 @@ function keyEventAllowed(e, settings) {
1113
1127
  if (settings.disabled) return false;
1114
1128
  const activeEl = getActiveEl(e.target?.ownerDocument);
1115
1129
  if ((e.key === " " || e.key === "Enter") && activeEl?.matches("button,input[type='button'],input[type='submit']")) return false;
1116
- if (e.currentTarget !== activeEl && activeEl?.matches("input,textarea,[contenteditable]") && !(e.key === "Escape" && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey)) return false;
1130
+ if (e.currentTarget !== activeEl && activeEl?.matches("input,textarea,[contenteditable],[role]") && !(e.key === "Escape" && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey)) return false;
1117
1131
  const combo = stringifyKeyEvent(e), { override, block, action, whitelisted } = getTermsForKey(combo, settings);
1118
1132
  if (block) return false;
1119
1133
  if (override) e.preventDefault();
@@ -1147,7 +1161,7 @@ var TimeTravelConsole = class _TimeTravelConsole {
1147
1161
  * @param time TimeTravel module instance that owns timeline operations.
1148
1162
  * @param build Optional initial overlay config overrides.
1149
1163
  */
1150
- constructor(time, build = {}) {
1164
+ constructor(time, build = { devOnly: true }) {
1151
1165
  this.time = time;
1152
1166
  this.config = reactive({ title: `Time Travel Console ${this.index = ++_TimeTravelConsole.count}`, ...build });
1153
1167
  this.state.open = !!this.config.startOpen;
@@ -1,7 +1,7 @@
1
- import { E as EffectOptions } from '../index-rWwvrfdn.cjs';
2
- export { A as Autotracker, w as withTracker } from '../index-rWwvrfdn.cjs';
3
- export { T as TimeTravelConsole, a as TimeTravelConsoleConfig } from '../TimeTravelConsole-zvu8eqTZ.cjs';
4
- import '../index-CuLuFYu3.cjs';
1
+ import { E as EffectOptions } from '../index-CTfsGm3B.cjs';
2
+ export { A as Autotracker, w as withTracker } from '../index-CTfsGm3B.cjs';
3
+ export { T as TimeTravelConsole, a as TimeTravelConsoleConfig } from '../TimeTravelConsole-C3w0XcIv.cjs';
4
+ import '../index-BH-xZx9q.cjs';
5
5
 
6
6
  /**
7
7
  * Runs a reactive side effect in vanilla JavaScript.
@@ -1,7 +1,7 @@
1
- import { E as EffectOptions } from '../index-rWwvrfdn.js';
2
- export { A as Autotracker, w as withTracker } from '../index-rWwvrfdn.js';
3
- export { T as TimeTravelConsole, a as TimeTravelConsoleConfig } from '../TimeTravelConsole-BLDKZ0U1.js';
4
- import '../index-D_U8Nai1.js';
1
+ import { E as EffectOptions } from '../index-CTfsGm3B.js';
2
+ export { A as Autotracker, w as withTracker } from '../index-CTfsGm3B.js';
3
+ export { T as TimeTravelConsole, a as TimeTravelConsoleConfig } from '../TimeTravelConsole-BpS9Fsqz.js';
4
+ import '../index-Ck9UPQ6r.js';
5
5
 
6
6
  /**
7
7
  * Runs a reactive side effect in vanilla JavaScript.
@@ -3,11 +3,11 @@ import {
3
3
  TimeTravelConsole,
4
4
  effect,
5
5
  withTracker
6
- } from "../chunk-4S44OX5N.js";
7
- import "../chunk-A3ZCYWWM.js";
8
- import "../chunk-OTBKVZ4L.js";
9
- import "../chunk-243U74PP.js";
10
- import "../chunk-2ZYYYSZ4.js";
6
+ } from "../chunk-LZZ4AHVE.js";
7
+ import "../chunk-SPVWCBIV.js";
8
+ import "../chunk-PTNZ442E.js";
9
+ import "../chunk-ORK3EGB6.js";
10
+ import "../chunk-SHWIAQD2.js";
11
11
  export {
12
12
  Autotracker,
13
13
  TimeTravelConsole,