sia-reactor 0.0.53 → 0.0.55

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 (35) hide show
  1. package/dist/{TimeTravelConsole-oCB-dzn3.d.ts → TimeTravelConsole-BWRXxYp0.d.ts} +0 -1
  2. package/dist/{TimeTravelConsole-mDsH7cya.d.cts → TimeTravelConsole-Dt-W-sLq.d.cts} +0 -1
  3. package/dist/adapters/react.cjs +14 -7
  4. package/dist/adapters/react.cjs.map +1 -1
  5. package/dist/adapters/react.d.cts +1 -1
  6. package/dist/adapters/react.d.ts +1 -1
  7. package/dist/adapters/react.js +3 -3
  8. package/dist/adapters/vanilla.cjs +14 -7
  9. package/dist/adapters/vanilla.cjs.map +1 -1
  10. package/dist/adapters/vanilla.d.cts +1 -1
  11. package/dist/adapters/vanilla.d.ts +1 -1
  12. package/dist/adapters/vanilla.js +3 -3
  13. package/dist/{chunk-ZRAWD566.js → chunk-GG7PDKIM.js} +3 -3
  14. package/dist/chunk-GG7PDKIM.js.map +1 -0
  15. package/dist/{chunk-63SVVG24.js → chunk-L7NMQHXQ.js} +11 -2
  16. package/dist/chunk-L7NMQHXQ.js.map +1 -0
  17. package/dist/{chunk-3YY3EK6I.js → chunk-TVXV5YVU.js} +7 -9
  18. package/dist/chunk-TVXV5YVU.js.map +1 -0
  19. package/dist/{chunk-AKQF46E6.js → chunk-VS7CTLQH.js} +2 -2
  20. package/dist/modules.cjs +1 -1
  21. package/dist/modules.cjs.map +1 -1
  22. package/dist/modules.js +3 -3
  23. package/dist/super.d.ts +6 -5
  24. package/dist/super.global.js +16 -9
  25. package/dist/super.global.js.map +1 -1
  26. package/dist/utils.cjs +12 -3
  27. package/dist/utils.cjs.map +1 -1
  28. package/dist/utils.d.cts +6 -4
  29. package/dist/utils.d.ts +6 -4
  30. package/dist/utils.js +2 -2
  31. package/package.json +1 -1
  32. package/dist/chunk-3YY3EK6I.js.map +0 -1
  33. package/dist/chunk-63SVVG24.js.map +0 -1
  34. package/dist/chunk-ZRAWD566.js.map +0 -1
  35. /package/dist/{chunk-AKQF46E6.js.map → chunk-VS7CTLQH.js.map} +0 -0
@@ -32,7 +32,6 @@ declare class TimeTravelConsole {
32
32
  readonly host: HTMLElement;
33
33
  private clups;
34
34
  private keydown;
35
- private keyup;
36
35
  /** Creates a docked TimeTravel overlay bound to a module instance.
37
36
  * @param time TimeTravel module instance that owns timeline operations.
38
37
  * @param build Optional initial overlay config overrides.
@@ -32,7 +32,6 @@ declare class TimeTravelConsole {
32
32
  readonly host: HTMLElement;
33
33
  private clups;
34
34
  private keydown;
35
- private keyup;
36
35
  /** Creates a docked TimeTravel overlay bound to a module instance.
37
36
  * @param time TimeTravel module instance that owns timeline operations.
38
37
  * @param build Optional initial overlay config overrides.
@@ -1213,9 +1213,17 @@ function getTermsForKey(combo, settings) {
1213
1213
  }
1214
1214
  function keyEventAllowed(e, settings) {
1215
1215
  if (settings.disabled) return false;
1216
+ if (settings.linkedPhase) {
1217
+ if (e.type === "keydown") downKeys.set(e.code, e);
1218
+ else if (e.type === "keyup") {
1219
+ const down = downKeys.get(e.code);
1220
+ setTimeout(() => downKeys.delete(e.code), 0);
1221
+ if (!down || down.cancelBubble) return false;
1222
+ }
1223
+ }
1216
1224
  const activeEl = getActiveEl(e.target?.ownerDocument);
1217
1225
  if ((e.key === " " || e.key === "Enter") && activeEl?.matches("button,input[type='button'],input[type='submit']")) return false;
1218
- if (e.currentTarget !== activeEl && activeEl?.matches("input,textarea,[contenteditable],[role]") && !(e.key === "Escape" && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey)) return false;
1226
+ if (e.currentTarget !== activeEl && activeEl?.matches("input,textarea,[contenteditable]") && !(e.key === "Escape" && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey)) return false;
1219
1227
  const combo = stringifyKeyEvent(e), { override, block, action, whitelisted } = getTermsForKey(combo, settings);
1220
1228
  if (block) return false;
1221
1229
  if (override) e.preventDefault();
@@ -1223,6 +1231,7 @@ function keyEventAllowed(e, settings) {
1223
1231
  if (whitelisted) return e.key.toLowerCase();
1224
1232
  return false;
1225
1233
  }
1234
+ var downKeys = /* @__PURE__ */ new Map();
1226
1235
  var formatKeyTooltip = (combo = "", keyFn = (c = "") => cleanKeyCombo(c).replace(" ", "space")) => {
1227
1236
  const combined = combo?.length ? Array.isArray(combo) ? combo.map(keyFn).join(" or ") : keyFn(combo) : "";
1228
1237
  return combined ? ` (${combined})` : "";
@@ -1248,7 +1257,7 @@ function effect(callback, options = NIL) {
1248
1257
  // src/ts/adapters/vanilla/TimeTravelConsole.ts
1249
1258
  var keys = {
1250
1259
  blocks: KEYS_BLOCKS,
1251
- overrides: ["Space", "Home", "End", "Escape", "Delete"],
1260
+ // overrides: ["Space", "Home", "End", "Escape", "Delete"], // Playing "God"
1252
1261
  shortcuts: { undo: ["Ctrl+z", "Cmd+z"], redo: ["Ctrl+y", "Ctrl+Shift+z", "Cmd+Shift+z"], genesis: "Home", trackUntrack: "t", ending: "End", playPause: "Space", rewind: "Shift+Space", closeOverlay: "Escape", clrHistory: "Delete", export: "e", import: "i", clear: "c" }
1253
1262
  };
1254
1263
  var TimeTravelConsole = class _TimeTravelConsole {
@@ -1260,7 +1269,6 @@ var TimeTravelConsole = class _TimeTravelConsole {
1260
1269
  host;
1261
1270
  clups = [];
1262
1271
  keydown;
1263
- keyup;
1264
1272
  /** Creates a docked TimeTravel overlay bound to a module instance.
1265
1273
  * @param time TimeTravel module instance that owns timeline operations.
1266
1274
  * @param build Optional initial overlay config overrides.
@@ -1276,9 +1284,8 @@ var TimeTravelConsole = class _TimeTravelConsole {
1276
1284
  filters.append((filterBox.append((filterRow1.append(whitelistLabel, whitelist), filterRow1), (filterRow2.append(blacklistLabel, blacklist), filterRow2)), filterBox));
1277
1285
  panel.append(title, status, (row1.append(playPause, rewind, genesis), row1), (row2.append(undo, redo, trackUntrack, stride), row2), payload, (row3.append(speed, range), row3), filters, (row4.append(exp, imp, clr), row4), io, (row5.append(delay, limit, (read.append(readBox, " Read Mirror"), read), (write.append(writeBox, " Write Mirror"), write)), row5), (foot.prepend(stats), foot.append(link), foot));
1278
1286
  this.host.append(toggle, panel);
1279
- this.keydown = (e, can = this.state.open && (this.config.devOnly ? CTX.isDevEnv : true), a = can && keyEventAllowed(e, keys)) => (a && e.stopImmediatePropagation(), a === "undo" ? this.time.undo(this.state.stride) : a === "redo" ? this.time.redo(this.state.stride) : a === "genesis" ? this.time.jumpTo(0) : a === "trackUntrack" ? this.time[s.tracking ? "untrack" : "track"]() : a === "ending" ? this.time.jumpTo(s.history.length) : a === "rewind" ? this.time.rewind() : a === "playPause" ? this.time[s.paused ? "play" : "pause"]() : a === "clrHistory" ? this.time.clear() : a === "closeOverlay" ? this.state.open = false : a === "export" ? this.state.import = this.time.export(null, 2) : a === "import" ? this.state.import.trim().length && this.time.import(this.state.import) : a === "clear" && (this.state.import = ""));
1280
- this.keyup = (e, can = this.state.open && (this.config.devOnly ? CTX.isDevEnv : true), a = can && keyEventAllowed(e, keys)) => a && e.stopImmediatePropagation();
1281
- window.addEventListener("keydown", this.keydown), window.addEventListener("keyup", this.keyup);
1287
+ this.keydown = (e, can = this.state.open && (this.config.devOnly ? CTX.isDevEnv : true), a = can && keyEventAllowed(e, keys)) => (a && (e.preventDefault(), e.stopImmediatePropagation()), a === "undo" ? this.time.undo(this.state.stride) : a === "redo" ? this.time.redo(this.state.stride) : a === "genesis" ? this.time.jumpTo(0) : a === "trackUntrack" ? this.time[s.tracking ? "untrack" : "track"]() : a === "ending" ? this.time.jumpTo(s.history.length) : a === "rewind" ? this.time.rewind() : a === "playPause" ? this.time[s.paused ? "play" : "pause"]() : a === "clrHistory" ? this.time.clear() : a === "closeOverlay" ? this.state.open = false : a === "export" ? this.state.import = this.time.export(null, 2) : a === "import" ? this.state.import.trim().length && this.time.import(this.state.import) : a === "clear" && (this.state.import = ""));
1288
+ window.addEventListener("keydown", this.keydown, { capture: true });
1282
1289
  const sync = [
1283
1290
  effect(() => this.config.color ? host.style.setProperty("--sia-tt-color", this.config.color) : host.style.removeProperty("--sia-tt-color")),
1284
1291
  effect(() => {
@@ -1322,7 +1329,7 @@ var TimeTravelConsole = class _TimeTravelConsole {
1322
1329
  }
1323
1330
  destroy() {
1324
1331
  for (const clup of this.clups) clup();
1325
- window.removeEventListener("keydown", this.keydown), window.removeEventListener("keyup", this.keyup);
1332
+ window.removeEventListener("keydown", this.keydown, { capture: true });
1326
1333
  this.host.remove(), nuke(this), --_TimeTravelConsole.count;
1327
1334
  }
1328
1335
  };