sia-reactor 0.0.44 → 0.0.46
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/{TimeTravelConsole-Ck3GwvXR.d.cts → TimeTravelConsole-CFwqDhnh.d.cts} +2 -2
- package/dist/{TimeTravelConsole-BwHB0LsE.d.ts → TimeTravelConsole-FgH7tE4N.d.ts} +2 -2
- package/dist/adapters/react.cjs +45 -42
- package/dist/adapters/react.cjs.map +1 -0
- package/dist/adapters/react.d.cts +3 -3
- package/dist/adapters/react.d.ts +3 -3
- package/dist/adapters/react.js +5 -4
- package/dist/adapters/react.js.map +1 -0
- package/dist/adapters/vanilla.cjs +45 -42
- package/dist/adapters/vanilla.cjs.map +1 -0
- package/dist/adapters/vanilla.d.cts +18 -4
- package/dist/adapters/vanilla.d.ts +18 -4
- package/dist/adapters/vanilla.js +5 -4
- package/dist/adapters/vanilla.js.map +1 -0
- package/dist/{chunk-BOBAOEKS.js → chunk-C6VOBKMK.js} +3 -2
- package/dist/chunk-C6VOBKMK.js.map +1 -0
- package/dist/{chunk-4U7VB3JS.js → chunk-F3Y3BAZ2.js} +10 -9
- package/dist/chunk-F3Y3BAZ2.js.map +1 -0
- package/dist/{chunk-RGLU7GF7.js → chunk-G2WKPDNU.js} +1 -0
- package/dist/chunk-G2WKPDNU.js.map +1 -0
- package/dist/{chunk-JGEI2Q4M.js → chunk-IZK2TOJP.js} +1 -0
- package/dist/chunk-IZK2TOJP.js.map +1 -0
- package/dist/{chunk-4SGW3Y6X.js → chunk-U4SR3CZF.js} +38 -32
- package/dist/chunk-U4SR3CZF.js.map +1 -0
- package/dist/{chunk-GH5QAGIC.js → chunk-V2BMGJFQ.js} +15 -14
- package/dist/chunk-V2BMGJFQ.js.map +1 -0
- package/dist/{obj-CM05g1eW.d.cts → consts-Bq1B4lOB.d.cts} +290 -358
- package/dist/{obj-CM05g1eW.d.ts → consts-Bq1B4lOB.d.ts} +290 -358
- package/dist/{index-FMuvzRw_.d.cts → index-DApQ-Emc.d.ts} +5 -2
- package/dist/{index-K1TE7RnF.d.ts → index-D_5wXk_Q.d.cts} +5 -2
- package/dist/index.cjs +9 -8
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -107
- package/dist/index.d.ts +3 -107
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -0
- package/dist/modules.cjs +22 -21
- package/dist/modules.cjs.map +1 -0
- package/dist/modules.d.cts +379 -3
- package/dist/modules.d.ts +379 -3
- package/dist/modules.js +17 -16
- package/dist/modules.js.map +1 -0
- package/dist/super.d.ts +2292 -0
- package/dist/super.global.js +68 -62
- package/dist/super.global.js.map +1 -0
- package/dist/utils.cjs +57 -48
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +212 -2
- package/dist/utils.d.ts +212 -2
- package/dist/utils.js +14 -7
- package/dist/utils.js.map +1 -0
- package/package.json +7 -3
- package/dist/modules-D7XeXgBN.d.ts +0 -431
- package/dist/modules-DdCv43H3.d.cts +0 -431
- package/dist/utils-09Fwruxy.d.cts +0 -260
- package/dist/utils-EAjy2rsz.d.ts +0 -260
- package/dist/vanilla-Bs-5iI0s.d.cts +0 -25
- package/dist/vanilla-KGPkYjU_.d.ts +0 -25
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { g as TimeTravelModule } from './index-
|
|
1
|
+
import { W as Reactive } from './consts-Bq1B4lOB.cjs';
|
|
2
|
+
import { g as TimeTravelModule } from './index-D_5wXk_Q.cjs';
|
|
3
3
|
|
|
4
4
|
/** Reactive options for the TimeTravel overlay instance. */
|
|
5
5
|
interface TimeTravelConsoleConfig {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { g as TimeTravelModule } from './index-
|
|
1
|
+
import { W as Reactive } from './consts-Bq1B4lOB.js';
|
|
2
|
+
import { g as TimeTravelModule } from './index-DApQ-Emc.js';
|
|
3
3
|
|
|
4
4
|
/** Reactive options for the TimeTravel overlay instance. */
|
|
5
5
|
interface TimeTravelConsoleConfig {
|
package/dist/adapters/react.cjs
CHANGED
|
@@ -55,7 +55,7 @@ var NOOP = () => {
|
|
|
55
55
|
};
|
|
56
56
|
var isDevEnv = false;
|
|
57
57
|
try {
|
|
58
|
-
isDevEnv =
|
|
58
|
+
isDevEnv = false;
|
|
59
59
|
} catch (e) {
|
|
60
60
|
}
|
|
61
61
|
var CTX_BUILD = {
|
|
@@ -213,24 +213,24 @@ var ReactorEvent = class _ReactorEvent {
|
|
|
213
213
|
eventPhase = _ReactorEvent.NONE;
|
|
214
214
|
/** Current event type for the active propagation path, use immediately if async */
|
|
215
215
|
type;
|
|
216
|
-
/** Current target context for the active propagation path, use immediately if async. Also use to survive future object shape changes from nesting for a path callback. */
|
|
217
216
|
currentTarget;
|
|
218
|
-
/**
|
|
217
|
+
/** Current target context for the active propagation path, use immediately if async. Also survives future shape changes from nesting for a path callback. */
|
|
219
218
|
target;
|
|
220
|
-
/**
|
|
219
|
+
/** Original event target context. */
|
|
221
220
|
root;
|
|
222
|
-
/**
|
|
221
|
+
/** Root reactive object for this event instance wave. */
|
|
223
222
|
reactor;
|
|
223
|
+
/** The `Reactor` instance that dispatched this event instance. */
|
|
224
224
|
/** Whether resolve/reject intent semantics are allowed for this event instance. */
|
|
225
225
|
rejectable;
|
|
226
226
|
/** Original event type before propagation remapping. */
|
|
227
227
|
staticType;
|
|
228
|
-
/** Original target path for this event instance wave. */
|
|
229
228
|
path;
|
|
230
|
-
/**
|
|
229
|
+
/** Original target path for this event instance wave. */
|
|
231
230
|
value;
|
|
232
|
-
/**
|
|
231
|
+
/** Current value at the event target path. */
|
|
233
232
|
oldValue;
|
|
233
|
+
/** Previous value at the event target path. */
|
|
234
234
|
/** Whether this event instance wave can bubble back up to ancestors or just capture down. */
|
|
235
235
|
bubbles = false;
|
|
236
236
|
/** Whether this event instance wave can capture down to descendants or just bubble up. */
|
|
@@ -1166,47 +1166,46 @@ function getActiveEl(root, noBody = true) {
|
|
|
1166
1166
|
|
|
1167
1167
|
// src/ts/utils/keys.ts
|
|
1168
1168
|
var KEYS_BLOCKS = ["Ctrl+Tab", "Ctrl+Shift+Tab", "Ctrl+PageUp", "Ctrl+PageDown", "Cmd+Option+ArrowRight", "Cmd+Option+ArrowLeft", "Ctrl+1", "Ctrl+2", "Ctrl+3", "Ctrl+4", "Ctrl+5", "Ctrl+6", "Ctrl+7", "Ctrl+8", "Ctrl+9", "Cmd+1", "Cmd+2", "Cmd+3", "Cmd+4", "Cmd+5", "Cmd+6", "Cmd+7", "Cmd+8", "Cmd+9", "Alt+ArrowLeft", "Alt+ArrowRight", "Cmd+ArrowLeft", "Cmd+ArrowRight", "Ctrl+r", "Ctrl+Shift+r", "F5", "Shift+F5", "Cmd+r", "Cmd+Shift+r", "Ctrl+h", "Ctrl+j", "Ctrl+d", "Ctrl+f", "Cmd+y", "Cmd+Option+b", "Cmd+d", "Cmd+f", "Ctrl+Shift+i", "Ctrl+Shift+j", "Ctrl+Shift+c", "Ctrl+u", "F12", "Cmd+Option+i", "Cmd+Option+j", "Cmd+Option+c", "Cmd+Option+u", "Ctrl+=", "Ctrl+-", "Ctrl+0", "Cmd+=", "Cmd+-", "Cmd+0", "Ctrl+p", "Ctrl+s", "Ctrl+o", "Cmd+p", "Cmd+s", "Cmd+o"];
|
|
1169
|
+
var KEYS_MODS = ["ctrl", "shift", "alt", "meta"];
|
|
1170
|
+
var KEYS_CMODS = ["ctrl", "alt", "meta"];
|
|
1171
|
+
var KEYS_ALIAS = { cmd: "meta", space: " " };
|
|
1169
1172
|
function stringifyKeyEvent(e) {
|
|
1170
1173
|
const parts = [];
|
|
1171
|
-
|
|
1172
|
-
if (e.altKey) parts.push("alt");
|
|
1173
|
-
if (e.shiftKey) parts.push("shift");
|
|
1174
|
-
if (e.metaKey) parts.push("meta");
|
|
1175
|
-
parts.push(e.key?.toLowerCase() ?? "");
|
|
1174
|
+
e.ctrlKey && parts.push("ctrl"), e.altKey && parts.push("alt"), e.shiftKey && parts.push("shift"), e.metaKey && parts.push("meta"), parts.push(e.key?.toLowerCase() ?? "");
|
|
1176
1175
|
return parts.join("+");
|
|
1177
1176
|
}
|
|
1178
|
-
function cleanKeyCombo(combo) {
|
|
1177
|
+
function cleanKeyCombo(combo, mods = KEYS_MODS) {
|
|
1179
1178
|
const clean = (combo2) => {
|
|
1180
|
-
const m = ["ctrl", "alt", "shift", "meta"], alias = { cmd: "meta", space: " " };
|
|
1181
1179
|
if (combo2 === " " || combo2 === "+") return combo2;
|
|
1182
1180
|
combo2 = combo2.replace(/\+\s*\+$/, "+plus");
|
|
1183
|
-
const p = combo2.toLowerCase().split("+").filter((k) => k !== "").map((k) =>
|
|
1184
|
-
return [...p.filter((k) =>
|
|
1181
|
+
const p = combo2.toLowerCase().split("+").filter((k) => k !== "").map((k, _, __, tk = k.trim()) => KEYS_ALIAS[tk] || (tk === "plus" ? "+" : tk || " "));
|
|
1182
|
+
return [...p.filter((k) => mods.includes(k)).sort((a, b) => mods.indexOf(a) - mods.indexOf(b)), ...p.filter((k) => !mods.includes(k)) || ""].join("+");
|
|
1185
1183
|
};
|
|
1186
1184
|
return Array.isArray(combo) ? combo.map(clean) : clean(combo);
|
|
1187
1185
|
}
|
|
1188
|
-
function matchKeys(required, actual, strict = false,
|
|
1189
|
-
if (
|
|
1190
|
-
const match = (
|
|
1191
|
-
|
|
1192
|
-
if (strict) return
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1186
|
+
function matchKeys(required, actual, strict = false, clean = true) {
|
|
1187
|
+
if (clean) actual = cleanKeyCombo(actual);
|
|
1188
|
+
const match = (req, actual2) => {
|
|
1189
|
+
req = cleanKeyCombo(req);
|
|
1190
|
+
if (strict) return req === actual2;
|
|
1191
|
+
const reqs = req.split("+"), reals = actual2.split("+");
|
|
1192
|
+
for (const mod of KEYS_CMODS) if (reals.includes(mod) && !reqs.includes(mod)) return false;
|
|
1193
|
+
return reqs.every((k) => reals.includes(k));
|
|
1195
1194
|
};
|
|
1196
|
-
return Array.isArray(required) ? required.some((
|
|
1195
|
+
return Array.isArray(required) ? required.some((req) => match(req, actual)) : match(required, actual);
|
|
1197
1196
|
}
|
|
1198
1197
|
function getTermsForKey(combo, settings) {
|
|
1199
|
-
const terms = { override: false, block: false, whitelisted: false, action: null }, { overrides = [], shortcuts = {}, blocks = [], strictMatch:
|
|
1198
|
+
const terms = { override: false, block: false, whitelisted: false, action: null }, { overrides = [], shortcuts = {}, blocks = [], strictMatch: stm = false, rankedMatch: ram = true, whitelist = [] } = settings || {};
|
|
1200
1199
|
combo = cleanKeyCombo(combo);
|
|
1201
|
-
if (matchKeys(overrides, combo,
|
|
1202
|
-
if (matchKeys(blocks, combo,
|
|
1203
|
-
if (matchKeys(whitelist, combo)) terms.whitelisted = true;
|
|
1204
|
-
if (!
|
|
1200
|
+
if (matchKeys(overrides, combo, stm, false)) terms.override = true;
|
|
1201
|
+
if (matchKeys(blocks, combo, stm, false)) terms.block = true;
|
|
1202
|
+
if (matchKeys(whitelist, combo, false)) terms.whitelisted = true;
|
|
1203
|
+
if (!ram) return terms.action = Object.keys(shortcuts).find((id) => shortcuts[id] && matchKeys(shortcuts[id], combo, stm, false)) || null, terms;
|
|
1205
1204
|
let bestA = null, bestE = false, bestL = 0;
|
|
1206
|
-
for (const
|
|
1207
|
-
for (const c of Array.isArray(shortcuts[
|
|
1208
|
-
const
|
|
1209
|
-
if (matchKeys(
|
|
1205
|
+
for (const id of Object.keys(shortcuts))
|
|
1206
|
+
for (const c of Array.isArray(shortcuts[id]) ? shortcuts[id] : [shortcuts[id]]) {
|
|
1207
|
+
const req = c && cleanKeyCombo(c), isE = req === combo, len = req ? req.split("+").length : 0;
|
|
1208
|
+
if (c && matchKeys(req, combo, stm, false) && (!bestA || isE && !bestE || isE === bestE && len > bestL)) bestA = id, bestE = isE, bestL = len;
|
|
1210
1209
|
}
|
|
1211
1210
|
return terms.action = bestA, terms;
|
|
1212
1211
|
}
|
|
@@ -1222,10 +1221,13 @@ function keyEventAllowed(e, settings) {
|
|
|
1222
1221
|
if (whitelisted) return e.key.toLowerCase();
|
|
1223
1222
|
return false;
|
|
1224
1223
|
}
|
|
1225
|
-
var
|
|
1226
|
-
|
|
1224
|
+
var formatKeyTooltip = (combo = "", keyFn = (c = "") => cleanKeyCombo(c).replace(" ", "space")) => {
|
|
1225
|
+
const combined = combo?.length ? Array.isArray(combo) ? combo.map(keyFn).join(" or ") : keyFn(combo) : "";
|
|
1226
|
+
return combined ? ` (${combined})` : "";
|
|
1227
|
+
};
|
|
1228
|
+
function parseForARIAKS(s = "", format = true) {
|
|
1227
1229
|
const m = { ctrl: "Control", cmd: "Meta", space: "Space", plus: "+" };
|
|
1228
|
-
return (
|
|
1230
|
+
return (!format && !Array.isArray(s) ? s : formatKeyTooltip(s)).toLowerCase().replace(/[()]/g, "").replace(/\bor\b/g, " ").replace(/\w+/g, (k) => m[k] || k).replace(/\s+/g, " ").trim();
|
|
1229
1231
|
}
|
|
1230
1232
|
|
|
1231
1233
|
// src/ts/adapters/vanilla/effect.ts
|
|
@@ -1245,7 +1247,7 @@ function effect(callback, options = NIL) {
|
|
|
1245
1247
|
var keys = {
|
|
1246
1248
|
blocks: KEYS_BLOCKS,
|
|
1247
1249
|
overrides: ["Ctrl+z", "Cmd+z", "Ctrl+y", "Cmd+y", "Ctrl+Shift+z", "Cmd+Shift+z", "Home", "End", "ArrowLeft", "ArrowRight", "Space", "Alt+Space", "Escape", "Delete"],
|
|
1248
|
-
shortcuts: { undo: ["Ctrl+z", "Cmd+z"], redo: ["Ctrl+y", "Cmd+y", "Ctrl+Shift+z", "Cmd+Shift+z"], genesis: "Home", trackUntrack: "t", ending: "End", prevFrame: ",", nextFrame: ".",
|
|
1250
|
+
shortcuts: { undo: ["Ctrl+z", "Cmd+z"], redo: ["Ctrl+y", "Cmd+y", "Ctrl+Shift+z", "Cmd+Shift+z"], genesis: "Home", trackUntrack: "t", ending: "End", prevFrame: ",", nextFrame: ".", playPause: "Space", rewind: "Alt+Space", closeOverlay: "Escape", clrHistory: "Delete", export: "e", import: "i", clear: "c" }
|
|
1249
1251
|
};
|
|
1250
1252
|
var TimeTravelConsole = class _TimeTravelConsole {
|
|
1251
1253
|
static count = 0;
|
|
@@ -1266,13 +1268,13 @@ var TimeTravelConsole = class _TimeTravelConsole {
|
|
|
1266
1268
|
this.config = reactive({ title: `Time Travel Console ${this.index = ++_TimeTravelConsole.count}`, ...build });
|
|
1267
1269
|
this.state.open = !!this.config.startOpen;
|
|
1268
1270
|
let wlLive = false, blLive = false;
|
|
1269
|
-
const s = this.time.state, host = this.host = createEl("div", { className: "sia-tt-console-host" }), toggle = createEl("button", { className: "sia-tt-console-toggle", type: "button", onclick: () => this.state.open = !this.state.open }), panel = createEl("aside", { className: "sia-tt-console", ariaLabel: "time travel overlay" }), title = createEl("div", { className: "title" }), frame = createEl("span", { className: "muted" }), clrHistory = createEl("button", { textContent: `Clear History${
|
|
1271
|
+
const s = this.time.state, host = this.host = createEl("div", { className: "sia-tt-console-host" }), toggle = createEl("button", { className: "sia-tt-console-toggle", type: "button", onclick: () => this.state.open = !this.state.open }), panel = createEl("aside", { className: "sia-tt-console", ariaLabel: "time travel overlay" }), title = createEl("div", { className: "title" }), frame = createEl("span", { className: "muted" }), clrHistory = createEl("button", { textContent: `Clear History${formatKeyTooltip(keys.shortcuts.clrHistory)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clrHistory), onclick: () => (this.time.clear(), this.state.import = "") }), undo = createEl("button", { textContent: `Undo${formatKeyTooltip(keys.shortcuts.undo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.undo), onclick: () => this.time.undo(this.state.stride) }), redo = createEl("button", { textContent: `Redo${formatKeyTooltip(keys.shortcuts.redo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.redo), onclick: () => this.time.redo(this.state.stride) }), genesis = createEl("button", { textContent: `Genesis${formatKeyTooltip(keys.shortcuts.genesis)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.genesis), onclick: () => this.time.jumpTo(0) }), playPause = createEl("button", { onclick: () => this.time[s.paused ? "play" : "pause"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.playPause) }), rewind = createEl("button", { textContent: `Rewind${formatKeyTooltip(keys.shortcuts.rewind)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.rewind), onclick: this.time.rewind }), trackUntrack = createEl("button", { onclick: () => this.time[s.tracking ? "untrack" : "track"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.trackUntrack) }), range = createEl("input", { type: "range", min: "0", title: "time travel frame", ariaLabel: "time travel frame", oninput: () => this.time.jumpTo(Number(range.value)) }), exp = createEl("button", { textContent: `Export${formatKeyTooltip(keys.shortcuts.export)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.export), onclick: () => this.state.import = this.time.export(null, 2) }), imp = createEl("button", { textContent: `Import${formatKeyTooltip(keys.shortcuts.import)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.import), onclick: () => this.state.import.trim().length && this.time.import(this.state.import) }), clr = createEl("button", { textContent: `Clear${formatKeyTooltip(keys.shortcuts.clear)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clear), onclick: () => this.state.import = "" }), payload = createEl("textarea", { className: "sia-tt-io", readOnly: true, placeholder: "current payload json", title: "Current History Entry" }), io = createEl("textarea", { className: "sia-tt-io", placeholder: "timeline payload json", title: "Time History", oninput: () => this.state.import = io.value }), foot = createEl("p", { className: "sia-tt-footnote", innerHTML: "<span>Try this in your app? </span>" }), link = createEl("a", { target: "_blank", rel: "noreferrer noopener", textContent: "sia-reactor", href: "https://www.npmjs.com/package/sia-reactor" }), box = createEl("div", { className: "sia-tt-status-box" }), status = createEl("div", { className: "sia-tt-status-row" }), filters = createEl("div", { className: "sia-tt-status-row" }), filterBox = createEl("div", { className: "sia-tt-status-box" }), whitelistLabel = createEl("span", { className: "muted", textContent: "Whitelist:" }), blacklistLabel = createEl("span", { className: "muted", textContent: "Blacklist:" }), whitelist = createEl("input", { className: "sia-tt-filter-input sia-tt-io", placeholder: 'a.b, c.d or {"0":["a.b"]}', title: "Whitelist paths", onfocus: () => wlLive = true, onblur: () => (wlLive = false, whitelist.value = formatPaths(this.time.config.whitelist, "*")), oninput: (_, parsed = parsePaths(whitelist.value)) => parsed !== null && (this.time.config.whitelist = parsed) }), blacklist = createEl("input", { className: "sia-tt-filter-input sia-tt-io", placeholder: 'a.b, c.d or {"0":["a.b"]}', title: "Blacklist paths", onfocus: () => blLive = true, onblur: () => (blLive = false, blacklist.value = formatPaths(this.time.config.blacklist, "")), oninput: (_, parsed = parsePaths(blacklist.value, true)) => parsed !== null && (this.time.config.blacklist = parsed) }), speed = createEl("select", { className: "sia-tt-speed", title: "Playback Speed", onchange: () => this.time.config.playbackRate = Number(speed.value) }), stride = createEl("input", { className: "sia-tt-stride sia-tt-button sia-tt-mini-input", type: "number", min: "1", title: "Skip Stride i.e. how many steps count as one unit", oninput: () => this.state.stride = Math.max(1, Number(stride.value) || 1) }), stats = createEl("span", { className: "sia-tt-stats" }), limit = createEl("input", { className: "sia-tt-limit sia-tt-mini-input sia-tt-button", type: "number", min: "1", title: "Maximum number of history entries kept in memory before older entries are discarded.", oninput: () => this.time.config.limit = Math.max(1, Number(limit.value) || 1) }), delay = createEl("input", { className: "sia-tt-delay sia-tt-mini-input sia-tt-button", type: "number", min: "0", step: "50", title: "Maximum playback delay between timeline frames in milliseconds.", oninput: () => this.time.config.maxPlaybackDelay = Math.max(0, Number(delay.value) || 0) }), read = createEl("label", { className: "sia-tt-check", title: "When recording intent mutations, read previous values from the matching state path instead of the intent path. Useful for accurate undo reconstruction of intent-driven flows." }), readBox = createEl("input", { type: "checkbox", checked: !!this.time.config.mirrorReads, onchange: () => this.time.config.mirrorReads = readBox.checked }), write = createEl("label", { className: "sia-tt-check", title: "During playback and teleportation, mirror state writes into matching intent paths to re-enact the recorded history. Useful for accurate reconstruction of the whole session." }), writeBox = createEl("input", { type: "checkbox", checked: !!this.time.config.mirrorWrites, onchange: () => this.time.config.mirrorWrites = writeBox.checked }), filterRow1 = createEl("div", { className: "sia-tt-filter-row" }), filterRow2 = createEl("div", { className: "sia-tt-filter-row" }), row1 = createEl("div", { className: "sia-tt-row" }), row2 = createEl("div", { className: "sia-tt-row" }), row3 = createEl("div", { className: "sia-tt-row" }), row4 = createEl("div", { className: "sia-tt-row" }), row5 = createEl("div", { className: "sia-tt-row sia-tt-config-row" });
|
|
1270
1272
|
speed.append(...[0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 4, 8, 16, 32].map((v) => createEl("option", { value: String(v), textContent: `${v}x` })));
|
|
1271
1273
|
status.append((box.append(frame), box), clrHistory);
|
|
1272
1274
|
filters.append((filterBox.append((filterRow1.append(whitelistLabel, whitelist), filterRow1), (filterRow2.append(blacklistLabel, blacklist), filterRow2)), filterBox));
|
|
1273
1275
|
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));
|
|
1274
1276
|
this.host.append(toggle, panel);
|
|
1275
|
-
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 === "prevFrame" ? this.time.step(this.state.stride, false) : a === "nextFrame" ? this.time.step(this.state.stride, true) : a === "
|
|
1277
|
+
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 === "prevFrame" ? this.time.step(this.state.stride, false) : a === "nextFrame" ? this.time.step(this.state.stride, true) : 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() : a === "import" ? this.state.import.trim().length && this.time.import(this.state.import) : a === "clear" && (this.state.import = ""));
|
|
1276
1278
|
this.keyup = (e, can = this.state.open && (this.config.devOnly ? CTX.isDevEnv : true), a = can && keyEventAllowed(e, keys)) => a && e.stopImmediatePropagation();
|
|
1277
1279
|
window.addEventListener("keydown", this.keydown), window.addEventListener("keyup", this.keyup);
|
|
1278
1280
|
const sync = [
|
|
@@ -1283,8 +1285,8 @@ var TimeTravelConsole = class _TimeTravelConsole {
|
|
|
1283
1285
|
if (host.parentNode !== dock) dock.appendChild(host);
|
|
1284
1286
|
}),
|
|
1285
1287
|
effect(() => toggle.textContent = `${(panel.hidden = !this.state.open) ? "Show" : "Hide"} ${title.textContent = this.config.title ?? ""}`),
|
|
1286
|
-
effect(() => playPause.textContent = `${s.paused ? "Play" : "Pause"}${
|
|
1287
|
-
effect(() => trackUntrack.textContent = `${s.tracking ? "Untrack" : "Track"}${
|
|
1288
|
+
effect(() => playPause.textContent = `${s.paused ? "Play" : "Pause"}${formatKeyTooltip(keys.shortcuts.playPause)}`),
|
|
1289
|
+
effect(() => trackUntrack.textContent = `${s.tracking ? "Untrack" : "Track"}${formatKeyTooltip(keys.shortcuts.trackUntrack)}`),
|
|
1288
1290
|
effect((sets = 0, txs = 0) => {
|
|
1289
1291
|
range.max = String(s.history.length);
|
|
1290
1292
|
range.disabled = clrHistory.disabled = !s.history.length;
|
|
@@ -1369,3 +1371,4 @@ function TimeTravelConsole2(props) {
|
|
|
1369
1371
|
useSelector,
|
|
1370
1372
|
useSelectorSnapshot
|
|
1371
1373
|
});
|
|
1374
|
+
//# sourceMappingURL=react.cjs.map
|