sia-reactor 0.0.37 → 0.0.39
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-B1du_ohf.d.ts → TimeTravelConsole-DSifvt2z.d.ts} +2 -2
- package/dist/{TimeTravelConsole-C9eSXGTz.d.cts → TimeTravelConsole-nYAqg57U.d.cts} +2 -2
- package/dist/adapters/react.cjs +5 -4
- package/dist/adapters/react.d.cts +3 -3
- package/dist/adapters/react.d.ts +3 -3
- package/dist/adapters/react.js +3 -3
- package/dist/adapters/vanilla.cjs +5 -4
- package/dist/adapters/vanilla.d.cts +4 -4
- package/dist/adapters/vanilla.d.ts +4 -4
- package/dist/adapters/vanilla.js +3 -3
- package/dist/{chunk-OFH4X3QD.js → chunk-56H5BKHJ.js} +5 -5
- package/dist/{chunk-WYSENFHG.js → chunk-DCUPDG7B.js} +2 -1
- package/dist/{chunk-EA3LQVCI.js → chunk-FOD32N6J.js} +1 -1
- package/dist/{index-D0NxfxUv.d.cts → index-BsH8KkqG.d.cts} +3 -2
- package/dist/{index-D0NxfxUv.d.ts → index-BsH8KkqG.d.ts} +3 -2
- package/dist/{index-lo6ft5Zu.d.ts → index-D4DGBS2N.d.ts} +1 -1
- package/dist/{index-CQNn1GIg.d.cts → index-DBx4TIVW.d.cts} +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/modules.cjs +2 -1
- package/dist/modules.d.cts +4 -4
- package/dist/modules.d.ts +4 -4
- package/dist/modules.js +2 -2
- package/dist/styles/time-travel-console.css +271 -271
- package/dist/super.d.ts +3 -2
- package/dist/super.global.js +5 -4
- package/dist/utils.cjs +2 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as Reactive } from './index-
|
|
2
|
-
import { T as TimeTravelModule } from './index-
|
|
1
|
+
import { R as Reactive } from './index-BsH8KkqG.js';
|
|
2
|
+
import { T as TimeTravelModule } from './index-D4DGBS2N.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-
|
|
2
|
-
import { T as TimeTravelModule } from './index-
|
|
1
|
+
import { R as Reactive } from './index-BsH8KkqG.cjs';
|
|
2
|
+
import { T as TimeTravelModule } from './index-DBx4TIVW.cjs';
|
|
3
3
|
|
|
4
4
|
/** Reactive options for the TimeTravel overlay instance. */
|
|
5
5
|
interface TimeTravelConsoleConfig {
|
package/dist/adapters/react.cjs
CHANGED
|
@@ -58,7 +58,7 @@ try {
|
|
|
58
58
|
isDevEnv = process.env.NODE_ENV !== "production";
|
|
59
59
|
} catch (e) {
|
|
60
60
|
}
|
|
61
|
-
var
|
|
61
|
+
var CTX_BUILD = {
|
|
62
62
|
/** Flag indicating whether the application is running in development mode. */
|
|
63
63
|
isDevEnv,
|
|
64
64
|
/** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
|
|
@@ -79,6 +79,7 @@ var CTX = {
|
|
|
79
79
|
batchingFunction: RTR_BATCH
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
+
var CTX = globalThis[/* @__PURE__ */ Symbol.for("S.I.A_CTX")] ??= CTX_BUILD;
|
|
82
83
|
|
|
83
84
|
// src/ts/utils/obj.ts
|
|
84
85
|
var arrRegex = /^([^\[\]]+)\[(\d+)\]$/;
|
|
@@ -1259,7 +1260,7 @@ var TimeTravelConsole = class _TimeTravelConsole {
|
|
|
1259
1260
|
this.config = reactive({ title: `Time Travel Console ${this.index = ++_TimeTravelConsole.count}`, ...build });
|
|
1260
1261
|
this.state.open = !!this.config.startOpen;
|
|
1261
1262
|
let wlLive = false, blLive = false;
|
|
1262
|
-
const s = this.time.state, host = this.host = createEl("div", { className: "tt-console-host" }), toggle = createEl("button", { className: "tt-console-toggle", type: "button", onclick: () => this.state.open = !this.state.open }), panel = createEl("aside", { className: "tt-console", ariaLabel: "time travel overlay" }), title = createEl("div", { className: "title" }), frame = createEl("span", { className: "muted" }), clrHistory = createEl("button", { textContent: `Clear History${formatKeyForDisplay(keys.shortcuts.clrHistory)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clrHistory, false), onclick: () => (this.time.clear(), this.state.import = "") }), undo = createEl("button", { textContent: `Undo${formatKeyForDisplay(keys.shortcuts.undo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.undo, false), onclick: () => this.time.undo(this.state.stride) }), redo = createEl("button", { textContent: `Redo${formatKeyForDisplay(keys.shortcuts.redo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.redo, false), onclick: () => this.time.redo(this.state.stride) }), genesis = createEl("button", { textContent: `Genesis${formatKeyForDisplay(keys.shortcuts.genesis)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.genesis, false), onclick: () => this.time.jumpTo(0) }), playPause = createEl("button", { onclick: () => this.time[s.paused ? "play" : "pause"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.playPause, false) }), rewind = createEl("button", { textContent: `Rewind${formatKeyForDisplay(keys.shortcuts.rewind)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.rewind, false), onclick: this.time.rewind }), trackUntrack = createEl("button", { onclick: () => this.time[s.tracking ? "untrack" : "track"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.trackUntrack, false) }), 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${formatKeyForDisplay(keys.shortcuts.export)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.export, false), onclick: () => this.state.import = this.time.export(null, 2) }), imp = createEl("button", { textContent: `Import${formatKeyForDisplay(keys.shortcuts.import)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.import, false), onclick: () => this.state.import.trim().length && this.time.import(this.state.import) }), clr = createEl("button", { textContent: `Clear${formatKeyForDisplay(keys.shortcuts.clear)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clear, false), onclick: () => this.state.import = "" }), payload = createEl("textarea", { className: "tt-io", readOnly: true, placeholder: "current payload json", title: "Current History Entry" }), io = createEl("textarea", { className: "tt-io", placeholder: "timeline payload json", title: "Time History", oninput: () => this.state.import = io.value }), foot = createEl("p", { className: "tt-footnote", innerHTML: "<span>Want 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: "tt-status-box" }), status = createEl("div", { className: "tt-status-row" }), filters = createEl("div", { className: "tt-status-row" }), filterBox = createEl("div", { className: "tt-status-box" }), whitelistLabel = createEl("span", { className: "muted", textContent: "Whitelist:" }), blacklistLabel = createEl("span", { className: "muted", textContent: "Blacklist:" }), whitelist = createEl("input", { className: "tt-filter-input 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: "tt-filter-input 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: "tt-speed", title: "Playback Speed", onchange: () => this.time.config.playbackRate = Number(speed.value) }), stride = createEl("input", { className: "tt-stride tt-button 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: "tt-stats" }), limit = createEl("input", { className: "tt-limit tt-mini-input 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: "tt-delay tt-mini-input 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: "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: "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: "tt-filter-row" }), filterRow2 = createEl("div", { className: "tt-filter-row" }), row1 = createEl("div", { className: "tt-row" }), row2 = createEl("div", { className: "tt-row" }), row3 = createEl("div", { className: "tt-row" }), row4 = createEl("div", { className: "tt-row" }), row5 = createEl("div", { className: "tt-row tt-config-row" });
|
|
1263
|
+
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${formatKeyForDisplay(keys.shortcuts.clrHistory)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clrHistory, false), onclick: () => (this.time.clear(), this.state.import = "") }), undo = createEl("button", { textContent: `Undo${formatKeyForDisplay(keys.shortcuts.undo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.undo, false), onclick: () => this.time.undo(this.state.stride) }), redo = createEl("button", { textContent: `Redo${formatKeyForDisplay(keys.shortcuts.redo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.redo, false), onclick: () => this.time.redo(this.state.stride) }), genesis = createEl("button", { textContent: `Genesis${formatKeyForDisplay(keys.shortcuts.genesis)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.genesis, false), onclick: () => this.time.jumpTo(0) }), playPause = createEl("button", { onclick: () => this.time[s.paused ? "play" : "pause"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.playPause, false) }), rewind = createEl("button", { textContent: `Rewind${formatKeyForDisplay(keys.shortcuts.rewind)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.rewind, false), onclick: this.time.rewind }), trackUntrack = createEl("button", { onclick: () => this.time[s.tracking ? "untrack" : "track"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.trackUntrack, false) }), 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${formatKeyForDisplay(keys.shortcuts.export)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.export, false), onclick: () => this.state.import = this.time.export(null, 2) }), imp = createEl("button", { textContent: `Import${formatKeyForDisplay(keys.shortcuts.import)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.import, false), onclick: () => this.state.import.trim().length && this.time.import(this.state.import) }), clr = createEl("button", { textContent: `Clear${formatKeyForDisplay(keys.shortcuts.clear)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clear, false), 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>Want 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" });
|
|
1263
1264
|
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` })));
|
|
1264
1265
|
status.append((box.append(frame), box), clrHistory);
|
|
1265
1266
|
filters.append((filterBox.append((filterRow1.append(whitelistLabel, whitelist), filterRow1), (filterRow2.append(blacklistLabel, blacklist), filterRow2)), filterBox));
|
|
@@ -1318,9 +1319,9 @@ var TimeTravelConsole = class _TimeTravelConsole {
|
|
|
1318
1319
|
function getDock(container) {
|
|
1319
1320
|
const host = container && container !== document.documentElement ? container : document.body;
|
|
1320
1321
|
if (host !== document.body && getComputedStyle(host).position === "static") host.style.position = "relative";
|
|
1321
|
-
const layer = host.querySelector(":scope > .tt-console-layer") || createEl("div", { className: "tt-console-layer" }, void 0, { position: host === document.body ? "fixed" : "absolute" });
|
|
1322
|
+
const layer = host.querySelector(":scope > .sia-tt-console-layer") || createEl("div", { className: "sia-tt-console-layer" }, void 0, { position: host === document.body ? "fixed" : "absolute" });
|
|
1322
1323
|
if (layer.parentElement !== host) host.appendChild(layer);
|
|
1323
|
-
const dock = layer.querySelector(":scope > .tt-console-dock") || createEl("div", { className: "tt-console-dock" });
|
|
1324
|
+
const dock = layer.querySelector(":scope > .sia-tt-console-dock") || createEl("div", { className: "sia-tt-console-dock" });
|
|
1324
1325
|
return dock.parentElement !== layer && layer.appendChild(dock), dock;
|
|
1325
1326
|
}
|
|
1326
1327
|
function formatPaths(paths, emptyText) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as EffectOptions, d as Reactor, R as Reactive, J as ReactorBuild, K as DeepReadonly, W as WildPaths, a as PathValue } from '../index-
|
|
1
|
+
import { E as EffectOptions, d as Reactor, R as Reactive, J as ReactorBuild, K as DeepReadonly, W as WildPaths, a as PathValue } from '../index-BsH8KkqG.cjs';
|
|
2
2
|
import { useLayoutEffect } from 'react';
|
|
3
|
-
import { T as TimeTravelModule } from '../index-
|
|
4
|
-
import { a as TimeTravelConsoleConfig } from '../TimeTravelConsole-
|
|
3
|
+
import { T as TimeTravelModule } from '../index-DBx4TIVW.cjs';
|
|
4
|
+
import { a as TimeTravelConsoleConfig } from '../TimeTravelConsole-nYAqg57U.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Subscribes a component to desired Reactor state and returns it.
|
package/dist/adapters/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as EffectOptions, d as Reactor, R as Reactive, J as ReactorBuild, K as DeepReadonly, W as WildPaths, a as PathValue } from '../index-
|
|
1
|
+
import { E as EffectOptions, d as Reactor, R as Reactive, J as ReactorBuild, K as DeepReadonly, W as WildPaths, a as PathValue } from '../index-BsH8KkqG.js';
|
|
2
2
|
import { useLayoutEffect } from 'react';
|
|
3
|
-
import { T as TimeTravelModule } from '../index-
|
|
4
|
-
import { a as TimeTravelConsoleConfig } from '../TimeTravelConsole-
|
|
3
|
+
import { T as TimeTravelModule } from '../index-D4DGBS2N.js';
|
|
4
|
+
import { a as TimeTravelConsoleConfig } from '../TimeTravelConsole-DSifvt2z.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Subscribes a component to desired Reactor state and returns it.
|
package/dist/adapters/react.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
Autotracker,
|
|
3
3
|
TimeTravelConsole,
|
|
4
4
|
withTracker
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-56H5BKHJ.js";
|
|
6
|
+
import "../chunk-FOD32N6J.js";
|
|
7
7
|
import "../chunk-ORK3EGB6.js";
|
|
8
8
|
import {
|
|
9
9
|
CTX,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
NOOP,
|
|
12
12
|
getPath,
|
|
13
13
|
getReactor
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-DCUPDG7B.js";
|
|
15
15
|
|
|
16
16
|
// src/ts/adapters/react/hooks/useReactor.ts
|
|
17
17
|
import { useRef, useCallback, useSyncExternalStore, useMemo } from "react";
|
|
@@ -46,7 +46,7 @@ try {
|
|
|
46
46
|
isDevEnv = process.env.NODE_ENV !== "production";
|
|
47
47
|
} catch (e) {
|
|
48
48
|
}
|
|
49
|
-
var
|
|
49
|
+
var CTX_BUILD = {
|
|
50
50
|
/** Flag indicating whether the application is running in development mode. */
|
|
51
51
|
isDevEnv,
|
|
52
52
|
/** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
|
|
@@ -67,6 +67,7 @@ var CTX = {
|
|
|
67
67
|
batchingFunction: RTR_BATCH
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
+
var CTX = globalThis[/* @__PURE__ */ Symbol.for("S.I.A_CTX")] ??= CTX_BUILD;
|
|
70
71
|
|
|
71
72
|
// src/ts/core/event.ts
|
|
72
73
|
var ReactorEvent = class _ReactorEvent {
|
|
@@ -1166,7 +1167,7 @@ var TimeTravelConsole = class _TimeTravelConsole {
|
|
|
1166
1167
|
this.config = reactive({ title: `Time Travel Console ${this.index = ++_TimeTravelConsole.count}`, ...build });
|
|
1167
1168
|
this.state.open = !!this.config.startOpen;
|
|
1168
1169
|
let wlLive = false, blLive = false;
|
|
1169
|
-
const s = this.time.state, host = this.host = createEl("div", { className: "tt-console-host" }), toggle = createEl("button", { className: "tt-console-toggle", type: "button", onclick: () => this.state.open = !this.state.open }), panel = createEl("aside", { className: "tt-console", ariaLabel: "time travel overlay" }), title = createEl("div", { className: "title" }), frame = createEl("span", { className: "muted" }), clrHistory = createEl("button", { textContent: `Clear History${formatKeyForDisplay(keys.shortcuts.clrHistory)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clrHistory, false), onclick: () => (this.time.clear(), this.state.import = "") }), undo = createEl("button", { textContent: `Undo${formatKeyForDisplay(keys.shortcuts.undo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.undo, false), onclick: () => this.time.undo(this.state.stride) }), redo = createEl("button", { textContent: `Redo${formatKeyForDisplay(keys.shortcuts.redo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.redo, false), onclick: () => this.time.redo(this.state.stride) }), genesis = createEl("button", { textContent: `Genesis${formatKeyForDisplay(keys.shortcuts.genesis)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.genesis, false), onclick: () => this.time.jumpTo(0) }), playPause = createEl("button", { onclick: () => this.time[s.paused ? "play" : "pause"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.playPause, false) }), rewind = createEl("button", { textContent: `Rewind${formatKeyForDisplay(keys.shortcuts.rewind)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.rewind, false), onclick: this.time.rewind }), trackUntrack = createEl("button", { onclick: () => this.time[s.tracking ? "untrack" : "track"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.trackUntrack, false) }), 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${formatKeyForDisplay(keys.shortcuts.export)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.export, false), onclick: () => this.state.import = this.time.export(null, 2) }), imp = createEl("button", { textContent: `Import${formatKeyForDisplay(keys.shortcuts.import)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.import, false), onclick: () => this.state.import.trim().length && this.time.import(this.state.import) }), clr = createEl("button", { textContent: `Clear${formatKeyForDisplay(keys.shortcuts.clear)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clear, false), onclick: () => this.state.import = "" }), payload = createEl("textarea", { className: "tt-io", readOnly: true, placeholder: "current payload json", title: "Current History Entry" }), io = createEl("textarea", { className: "tt-io", placeholder: "timeline payload json", title: "Time History", oninput: () => this.state.import = io.value }), foot = createEl("p", { className: "tt-footnote", innerHTML: "<span>Want 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: "tt-status-box" }), status = createEl("div", { className: "tt-status-row" }), filters = createEl("div", { className: "tt-status-row" }), filterBox = createEl("div", { className: "tt-status-box" }), whitelistLabel = createEl("span", { className: "muted", textContent: "Whitelist:" }), blacklistLabel = createEl("span", { className: "muted", textContent: "Blacklist:" }), whitelist = createEl("input", { className: "tt-filter-input 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: "tt-filter-input 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: "tt-speed", title: "Playback Speed", onchange: () => this.time.config.playbackRate = Number(speed.value) }), stride = createEl("input", { className: "tt-stride tt-button 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: "tt-stats" }), limit = createEl("input", { className: "tt-limit tt-mini-input 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: "tt-delay tt-mini-input 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: "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: "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: "tt-filter-row" }), filterRow2 = createEl("div", { className: "tt-filter-row" }), row1 = createEl("div", { className: "tt-row" }), row2 = createEl("div", { className: "tt-row" }), row3 = createEl("div", { className: "tt-row" }), row4 = createEl("div", { className: "tt-row" }), row5 = createEl("div", { className: "tt-row tt-config-row" });
|
|
1170
|
+
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${formatKeyForDisplay(keys.shortcuts.clrHistory)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clrHistory, false), onclick: () => (this.time.clear(), this.state.import = "") }), undo = createEl("button", { textContent: `Undo${formatKeyForDisplay(keys.shortcuts.undo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.undo, false), onclick: () => this.time.undo(this.state.stride) }), redo = createEl("button", { textContent: `Redo${formatKeyForDisplay(keys.shortcuts.redo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.redo, false), onclick: () => this.time.redo(this.state.stride) }), genesis = createEl("button", { textContent: `Genesis${formatKeyForDisplay(keys.shortcuts.genesis)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.genesis, false), onclick: () => this.time.jumpTo(0) }), playPause = createEl("button", { onclick: () => this.time[s.paused ? "play" : "pause"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.playPause, false) }), rewind = createEl("button", { textContent: `Rewind${formatKeyForDisplay(keys.shortcuts.rewind)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.rewind, false), onclick: this.time.rewind }), trackUntrack = createEl("button", { onclick: () => this.time[s.tracking ? "untrack" : "track"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.trackUntrack, false) }), 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${formatKeyForDisplay(keys.shortcuts.export)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.export, false), onclick: () => this.state.import = this.time.export(null, 2) }), imp = createEl("button", { textContent: `Import${formatKeyForDisplay(keys.shortcuts.import)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.import, false), onclick: () => this.state.import.trim().length && this.time.import(this.state.import) }), clr = createEl("button", { textContent: `Clear${formatKeyForDisplay(keys.shortcuts.clear)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clear, false), 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>Want 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" });
|
|
1170
1171
|
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` })));
|
|
1171
1172
|
status.append((box.append(frame), box), clrHistory);
|
|
1172
1173
|
filters.append((filterBox.append((filterRow1.append(whitelistLabel, whitelist), filterRow1), (filterRow2.append(blacklistLabel, blacklist), filterRow2)), filterBox));
|
|
@@ -1225,9 +1226,9 @@ var TimeTravelConsole = class _TimeTravelConsole {
|
|
|
1225
1226
|
function getDock(container) {
|
|
1226
1227
|
const host = container && container !== document.documentElement ? container : document.body;
|
|
1227
1228
|
if (host !== document.body && getComputedStyle(host).position === "static") host.style.position = "relative";
|
|
1228
|
-
const layer = host.querySelector(":scope > .tt-console-layer") || createEl("div", { className: "tt-console-layer" }, void 0, { position: host === document.body ? "fixed" : "absolute" });
|
|
1229
|
+
const layer = host.querySelector(":scope > .sia-tt-console-layer") || createEl("div", { className: "sia-tt-console-layer" }, void 0, { position: host === document.body ? "fixed" : "absolute" });
|
|
1229
1230
|
if (layer.parentElement !== host) host.appendChild(layer);
|
|
1230
|
-
const dock = layer.querySelector(":scope > .tt-console-dock") || createEl("div", { className: "tt-console-dock" });
|
|
1231
|
+
const dock = layer.querySelector(":scope > .sia-tt-console-dock") || createEl("div", { className: "sia-tt-console-dock" });
|
|
1231
1232
|
return dock.parentElement !== layer && layer.appendChild(dock), dock;
|
|
1232
1233
|
}
|
|
1233
1234
|
function formatPaths(paths, emptyText) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as EffectOptions } from '../index-
|
|
2
|
-
export { A as Autotracker, w as withTracker } from '../index-
|
|
3
|
-
export { T as TimeTravelConsole, a as TimeTravelConsoleConfig } from '../TimeTravelConsole-
|
|
4
|
-
import '../index-
|
|
1
|
+
import { E as EffectOptions } from '../index-BsH8KkqG.cjs';
|
|
2
|
+
export { A as Autotracker, w as withTracker } from '../index-BsH8KkqG.cjs';
|
|
3
|
+
export { T as TimeTravelConsole, a as TimeTravelConsoleConfig } from '../TimeTravelConsole-nYAqg57U.cjs';
|
|
4
|
+
import '../index-DBx4TIVW.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-
|
|
2
|
-
export { A as Autotracker, w as withTracker } from '../index-
|
|
3
|
-
export { T as TimeTravelConsole, a as TimeTravelConsoleConfig } from '../TimeTravelConsole-
|
|
4
|
-
import '../index-
|
|
1
|
+
import { E as EffectOptions } from '../index-BsH8KkqG.js';
|
|
2
|
+
export { A as Autotracker, w as withTracker } from '../index-BsH8KkqG.js';
|
|
3
|
+
export { T as TimeTravelConsole, a as TimeTravelConsoleConfig } from '../TimeTravelConsole-DSifvt2z.js';
|
|
4
|
+
import '../index-D4DGBS2N.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Runs a reactive side effect in vanilla JavaScript.
|
package/dist/adapters/vanilla.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
TimeTravelConsole,
|
|
4
4
|
effect,
|
|
5
5
|
withTracker
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-56H5BKHJ.js";
|
|
7
|
+
import "../chunk-FOD32N6J.js";
|
|
8
8
|
import "../chunk-ORK3EGB6.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-DCUPDG7B.js";
|
|
10
10
|
export {
|
|
11
11
|
Autotracker,
|
|
12
12
|
TimeTravelConsole,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
wpArr
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FOD32N6J.js";
|
|
4
4
|
import {
|
|
5
5
|
KEYS_BLOCKS,
|
|
6
6
|
createEl,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
canHandle,
|
|
16
16
|
nuke,
|
|
17
17
|
reactive
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-DCUPDG7B.js";
|
|
19
19
|
|
|
20
20
|
// src/ts/adapters/autotracker.ts
|
|
21
21
|
var Autotracker = class {
|
|
@@ -200,7 +200,7 @@ var TimeTravelConsole = class _TimeTravelConsole {
|
|
|
200
200
|
this.config = reactive({ title: `Time Travel Console ${this.index = ++_TimeTravelConsole.count}`, ...build });
|
|
201
201
|
this.state.open = !!this.config.startOpen;
|
|
202
202
|
let wlLive = false, blLive = false;
|
|
203
|
-
const s = this.time.state, host = this.host = createEl("div", { className: "tt-console-host" }), toggle = createEl("button", { className: "tt-console-toggle", type: "button", onclick: () => this.state.open = !this.state.open }), panel = createEl("aside", { className: "tt-console", ariaLabel: "time travel overlay" }), title = createEl("div", { className: "title" }), frame = createEl("span", { className: "muted" }), clrHistory = createEl("button", { textContent: `Clear History${formatKeyForDisplay(keys.shortcuts.clrHistory)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clrHistory, false), onclick: () => (this.time.clear(), this.state.import = "") }), undo = createEl("button", { textContent: `Undo${formatKeyForDisplay(keys.shortcuts.undo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.undo, false), onclick: () => this.time.undo(this.state.stride) }), redo = createEl("button", { textContent: `Redo${formatKeyForDisplay(keys.shortcuts.redo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.redo, false), onclick: () => this.time.redo(this.state.stride) }), genesis = createEl("button", { textContent: `Genesis${formatKeyForDisplay(keys.shortcuts.genesis)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.genesis, false), onclick: () => this.time.jumpTo(0) }), playPause = createEl("button", { onclick: () => this.time[s.paused ? "play" : "pause"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.playPause, false) }), rewind = createEl("button", { textContent: `Rewind${formatKeyForDisplay(keys.shortcuts.rewind)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.rewind, false), onclick: this.time.rewind }), trackUntrack = createEl("button", { onclick: () => this.time[s.tracking ? "untrack" : "track"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.trackUntrack, false) }), 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${formatKeyForDisplay(keys.shortcuts.export)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.export, false), onclick: () => this.state.import = this.time.export(null, 2) }), imp = createEl("button", { textContent: `Import${formatKeyForDisplay(keys.shortcuts.import)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.import, false), onclick: () => this.state.import.trim().length && this.time.import(this.state.import) }), clr = createEl("button", { textContent: `Clear${formatKeyForDisplay(keys.shortcuts.clear)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clear, false), onclick: () => this.state.import = "" }), payload = createEl("textarea", { className: "tt-io", readOnly: true, placeholder: "current payload json", title: "Current History Entry" }), io = createEl("textarea", { className: "tt-io", placeholder: "timeline payload json", title: "Time History", oninput: () => this.state.import = io.value }), foot = createEl("p", { className: "tt-footnote", innerHTML: "<span>Want 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: "tt-status-box" }), status = createEl("div", { className: "tt-status-row" }), filters = createEl("div", { className: "tt-status-row" }), filterBox = createEl("div", { className: "tt-status-box" }), whitelistLabel = createEl("span", { className: "muted", textContent: "Whitelist:" }), blacklistLabel = createEl("span", { className: "muted", textContent: "Blacklist:" }), whitelist = createEl("input", { className: "tt-filter-input 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: "tt-filter-input 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: "tt-speed", title: "Playback Speed", onchange: () => this.time.config.playbackRate = Number(speed.value) }), stride = createEl("input", { className: "tt-stride tt-button 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: "tt-stats" }), limit = createEl("input", { className: "tt-limit tt-mini-input 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: "tt-delay tt-mini-input 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: "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: "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: "tt-filter-row" }), filterRow2 = createEl("div", { className: "tt-filter-row" }), row1 = createEl("div", { className: "tt-row" }), row2 = createEl("div", { className: "tt-row" }), row3 = createEl("div", { className: "tt-row" }), row4 = createEl("div", { className: "tt-row" }), row5 = createEl("div", { className: "tt-row tt-config-row" });
|
|
203
|
+
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${formatKeyForDisplay(keys.shortcuts.clrHistory)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clrHistory, false), onclick: () => (this.time.clear(), this.state.import = "") }), undo = createEl("button", { textContent: `Undo${formatKeyForDisplay(keys.shortcuts.undo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.undo, false), onclick: () => this.time.undo(this.state.stride) }), redo = createEl("button", { textContent: `Redo${formatKeyForDisplay(keys.shortcuts.redo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.redo, false), onclick: () => this.time.redo(this.state.stride) }), genesis = createEl("button", { textContent: `Genesis${formatKeyForDisplay(keys.shortcuts.genesis)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.genesis, false), onclick: () => this.time.jumpTo(0) }), playPause = createEl("button", { onclick: () => this.time[s.paused ? "play" : "pause"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.playPause, false) }), rewind = createEl("button", { textContent: `Rewind${formatKeyForDisplay(keys.shortcuts.rewind)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.rewind, false), onclick: this.time.rewind }), trackUntrack = createEl("button", { onclick: () => this.time[s.tracking ? "untrack" : "track"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.trackUntrack, false) }), 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${formatKeyForDisplay(keys.shortcuts.export)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.export, false), onclick: () => this.state.import = this.time.export(null, 2) }), imp = createEl("button", { textContent: `Import${formatKeyForDisplay(keys.shortcuts.import)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.import, false), onclick: () => this.state.import.trim().length && this.time.import(this.state.import) }), clr = createEl("button", { textContent: `Clear${formatKeyForDisplay(keys.shortcuts.clear)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clear, false), 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>Want 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" });
|
|
204
204
|
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` })));
|
|
205
205
|
status.append((box.append(frame), box), clrHistory);
|
|
206
206
|
filters.append((filterBox.append((filterRow1.append(whitelistLabel, whitelist), filterRow1), (filterRow2.append(blacklistLabel, blacklist), filterRow2)), filterBox));
|
|
@@ -259,9 +259,9 @@ var TimeTravelConsole = class _TimeTravelConsole {
|
|
|
259
259
|
function getDock(container) {
|
|
260
260
|
const host = container && container !== document.documentElement ? container : document.body;
|
|
261
261
|
if (host !== document.body && getComputedStyle(host).position === "static") host.style.position = "relative";
|
|
262
|
-
const layer = host.querySelector(":scope > .tt-console-layer") || createEl("div", { className: "tt-console-layer" }, void 0, { position: host === document.body ? "fixed" : "absolute" });
|
|
262
|
+
const layer = host.querySelector(":scope > .sia-tt-console-layer") || createEl("div", { className: "sia-tt-console-layer" }, void 0, { position: host === document.body ? "fixed" : "absolute" });
|
|
263
263
|
if (layer.parentElement !== host) host.appendChild(layer);
|
|
264
|
-
const dock = layer.querySelector(":scope > .tt-console-dock") || createEl("div", { className: "tt-console-dock" });
|
|
264
|
+
const dock = layer.querySelector(":scope > .sia-tt-console-dock") || createEl("div", { className: "sia-tt-console-dock" });
|
|
265
265
|
return dock.parentElement !== layer && layer.appendChild(dock), dock;
|
|
266
266
|
}
|
|
267
267
|
function formatPaths(paths, emptyText) {
|
|
@@ -17,7 +17,7 @@ try {
|
|
|
17
17
|
isDevEnv = process.env.NODE_ENV !== "production";
|
|
18
18
|
} catch (e) {
|
|
19
19
|
}
|
|
20
|
-
var
|
|
20
|
+
var CTX_BUILD = {
|
|
21
21
|
/** Flag indicating whether the application is running in development mode. */
|
|
22
22
|
isDevEnv,
|
|
23
23
|
/** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
|
|
@@ -38,6 +38,7 @@ var CTX = {
|
|
|
38
38
|
batchingFunction: RTR_BATCH
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
+
var CTX = globalThis[/* @__PURE__ */ Symbol.for("S.I.A_CTX")] ??= CTX_BUILD;
|
|
41
42
|
|
|
42
43
|
// src/ts/modules/timeTravel/transaction.ts
|
|
43
44
|
var txId = 0;
|
|
@@ -1344,8 +1344,7 @@ declare const EVT_OPTS: {
|
|
|
1344
1344
|
declare const NIL: any;
|
|
1345
1345
|
/** Shared no-operation function. */
|
|
1346
1346
|
declare const NOOP: () => void;
|
|
1347
|
-
|
|
1348
|
-
declare const CTX: {
|
|
1347
|
+
declare const CTX_BUILD: {
|
|
1349
1348
|
/** Flag indicating whether the application is running in development mode. */
|
|
1350
1349
|
isDevEnv: boolean;
|
|
1351
1350
|
/** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
|
|
@@ -1357,5 +1356,7 @@ declare const CTX: {
|
|
|
1357
1356
|
/** Default configuration for new `Reactor` instances and also fallback for utils that need and are called without these options. */
|
|
1358
1357
|
defaults: Partial<ReactorBuild<any>>;
|
|
1359
1358
|
};
|
|
1359
|
+
/** Global context object for sharing state across the reactor runtime. */
|
|
1360
|
+
declare const CTX: typeof CTX_BUILD;
|
|
1360
1361
|
|
|
1361
1362
|
export { type DeepMerge as $, Autotracker as A, BaseReactorModule as B, parseEvtOpts as C, parsePathObj as D, type EffectOptions as E, type FanoutOptionsTuple as F, resetMeta as G, setPath as H, withMeta as I, type ReactorBuild as J, type DeepReadonly as K, type Inert as L, type ModulePaths as M, type ReactorModuleConstructor as N, endTx as O, type Paths as P, startTx as Q, type Reactive as R, transaction as S, type Transaction as T, txId as U, type APIKey as V, type WildPaths as W, type AddDepth as X, CTX as Y, type ChildPaths as Z, type DeepKeys as _, type PathValue as a, live as a$, type DeepPartial as a0, type DeepRequired as a1, type Deleter as a2, type DeleterRecord as a3, type DepthConfig as a4, type DirectPayload as a5, EVT_OPTS as a6, type Getter as a7, type GetterRecord as a8, INDIFFABLE as a9, SSVERSION as aA, type Setter as aB, type SetterRecord as aC, type Stable as aD, type State as aE, type StrictPathKey as aF, type SubtractDepth as aG, type SyncOptions as aH, type SyncOptionsTuple as aI, TERMINATOR as aJ, type Target as aK, type Unflatten as aL, type UnionToIntersection as aM, type UpdatePayload as aN, VERSION as aO, type Volatile as aP, type Watcher as aQ, type WatcherRecord as aR, getRaw as aS, getReactor as aT, getSnapshotVersion as aU, getVersion as aV, inert as aW, intent as aX, isInert as aY, isIntent as aZ, isVolatile as a_, INERTIA as aa, type Intent as ab, type Listener as ac, type ListenerOptions as ad, type ListenerOptionsTuple as ae, type ListenerRecord as af, type Live as ag, type MaxDepth as ah, NIL as ai, NOOP as aj, type NextDepth as ak, type NoTraverse as al, type PathBranch as am, type PathBranchValue as an, type PathDepth as ao, type PathKey as ap, type PathLeaf as aq, type PrevDepth as ar, type Primitive as as, type Pure as at, RAW as au, REJECTABLE as av, RTR_BATCH as aw, RTR_LOG as ax, type ReactivePreferences as ay, ReactorEvent as az, type ReactorModuleId as b, methods as b0, reactive as b1, stable as b2, state as b3, volatile as b4, type ReactorModulePathConfig as c, Reactor as d, type REvent as e, type Payload as f, arrRegex as g, canHandle as h, createReactorSync as i, deepClone as j, deletePath as k, fanout as l, fanoutOptsArr as m, force as n, getDepth as o, getPath as p, getPaths as q, getTrailRecords as r, hasPath as s, isLeafPath as t, isObj as u, isPOJO as v, withTracker as w, matchPaths as x, mergeObjs as y, nuke as z };
|
|
@@ -1344,8 +1344,7 @@ declare const EVT_OPTS: {
|
|
|
1344
1344
|
declare const NIL: any;
|
|
1345
1345
|
/** Shared no-operation function. */
|
|
1346
1346
|
declare const NOOP: () => void;
|
|
1347
|
-
|
|
1348
|
-
declare const CTX: {
|
|
1347
|
+
declare const CTX_BUILD: {
|
|
1349
1348
|
/** Flag indicating whether the application is running in development mode. */
|
|
1350
1349
|
isDevEnv: boolean;
|
|
1351
1350
|
/** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
|
|
@@ -1357,5 +1356,7 @@ declare const CTX: {
|
|
|
1357
1356
|
/** Default configuration for new `Reactor` instances and also fallback for utils that need and are called without these options. */
|
|
1358
1357
|
defaults: Partial<ReactorBuild<any>>;
|
|
1359
1358
|
};
|
|
1359
|
+
/** Global context object for sharing state across the reactor runtime. */
|
|
1360
|
+
declare const CTX: typeof CTX_BUILD;
|
|
1360
1361
|
|
|
1361
1362
|
export { type DeepMerge as $, Autotracker as A, BaseReactorModule as B, parseEvtOpts as C, parsePathObj as D, type EffectOptions as E, type FanoutOptionsTuple as F, resetMeta as G, setPath as H, withMeta as I, type ReactorBuild as J, type DeepReadonly as K, type Inert as L, type ModulePaths as M, type ReactorModuleConstructor as N, endTx as O, type Paths as P, startTx as Q, type Reactive as R, transaction as S, type Transaction as T, txId as U, type APIKey as V, type WildPaths as W, type AddDepth as X, CTX as Y, type ChildPaths as Z, type DeepKeys as _, type PathValue as a, live as a$, type DeepPartial as a0, type DeepRequired as a1, type Deleter as a2, type DeleterRecord as a3, type DepthConfig as a4, type DirectPayload as a5, EVT_OPTS as a6, type Getter as a7, type GetterRecord as a8, INDIFFABLE as a9, SSVERSION as aA, type Setter as aB, type SetterRecord as aC, type Stable as aD, type State as aE, type StrictPathKey as aF, type SubtractDepth as aG, type SyncOptions as aH, type SyncOptionsTuple as aI, TERMINATOR as aJ, type Target as aK, type Unflatten as aL, type UnionToIntersection as aM, type UpdatePayload as aN, VERSION as aO, type Volatile as aP, type Watcher as aQ, type WatcherRecord as aR, getRaw as aS, getReactor as aT, getSnapshotVersion as aU, getVersion as aV, inert as aW, intent as aX, isInert as aY, isIntent as aZ, isVolatile as a_, INERTIA as aa, type Intent as ab, type Listener as ac, type ListenerOptions as ad, type ListenerOptionsTuple as ae, type ListenerRecord as af, type Live as ag, type MaxDepth as ah, NIL as ai, NOOP as aj, type NextDepth as ak, type NoTraverse as al, type PathBranch as am, type PathBranchValue as an, type PathDepth as ao, type PathKey as ap, type PathLeaf as aq, type PrevDepth as ar, type Primitive as as, type Pure as at, RAW as au, REJECTABLE as av, RTR_BATCH as aw, RTR_LOG as ax, type ReactivePreferences as ay, ReactorEvent as az, type ReactorModuleId as b, methods as b0, reactive as b1, stable as b2, state as b3, volatile as b4, type ReactorModulePathConfig as c, Reactor as d, type REvent as e, type Payload as f, arrRegex as g, canHandle as h, createReactorSync as i, deepClone as j, deletePath as k, fanout as l, fanoutOptsArr as m, force as n, getDepth as o, getPath as p, getPaths as q, getTrailRecords as r, hasPath as s, isLeafPath as t, isObj as u, isPOJO as v, withTracker as w, matchPaths as x, mergeObjs as y, nuke as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Paths, a as PathValue, b as ReactorModuleId, c as ReactorModulePathConfig, B as BaseReactorModule, T as Transaction, d as Reactor, e as REvent, f as Payload } from './index-
|
|
1
|
+
import { P as Paths, a as PathValue, b as ReactorModuleId, c as ReactorModulePathConfig, B as BaseReactorModule, T as Transaction, d as Reactor, e as REvent, f as Payload } from './index-BsH8KkqG.js';
|
|
2
2
|
|
|
3
3
|
interface StorageAdapterConstructor<Config extends StorageAdapterConfig = StorageAdapterConfig> {
|
|
4
4
|
new (config?: Partial<Config>): StorageAdapter<any, Config>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Paths, a as PathValue, b as ReactorModuleId, c as ReactorModulePathConfig, B as BaseReactorModule, T as Transaction, d as Reactor, e as REvent, f as Payload } from './index-
|
|
1
|
+
import { P as Paths, a as PathValue, b as ReactorModuleId, c as ReactorModulePathConfig, B as BaseReactorModule, T as Transaction, d as Reactor, e as REvent, f as Payload } from './index-BsH8KkqG.cjs';
|
|
2
2
|
|
|
3
3
|
interface StorageAdapterConstructor<Config extends StorageAdapterConfig = StorageAdapterConfig> {
|
|
4
4
|
new (config?: Partial<Config>): StorageAdapter<any, Config>;
|
package/dist/index.cjs
CHANGED
|
@@ -72,7 +72,7 @@ try {
|
|
|
72
72
|
isDevEnv = process.env.NODE_ENV !== "production";
|
|
73
73
|
} catch (e) {
|
|
74
74
|
}
|
|
75
|
-
var
|
|
75
|
+
var CTX_BUILD = {
|
|
76
76
|
/** Flag indicating whether the application is running in development mode. */
|
|
77
77
|
isDevEnv,
|
|
78
78
|
/** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
|
|
@@ -93,6 +93,7 @@ var CTX = {
|
|
|
93
93
|
batchingFunction: RTR_BATCH
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
+
var CTX = globalThis[/* @__PURE__ */ Symbol.for("S.I.A_CTX")] ??= CTX_BUILD;
|
|
96
97
|
|
|
97
98
|
// src/ts/core/mixins.ts
|
|
98
99
|
var methods = ["tick", "stall", "nostall", "get", "gonce", "noget", "set", "sonce", "noset", "delete", "donce", "nodelete", "watch", "wonce", "nowatch", "on", "once", "off", "snapshot", "use", "reset", "destroy"];
|
package/dist/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { V as APIKey, X as AddDepth, Y as CTX, Z as ChildPaths, _ as DeepKeys, $ as DeepMerge, a0 as DeepPartial, K as DeepReadonly, a1 as DeepRequired, a2 as Deleter, a3 as DeleterRecord, a4 as DepthConfig, a5 as DirectPayload, a6 as EVT_OPTS, E as EffectOptions, a7 as Getter, a8 as GetterRecord, a9 as INDIFFABLE, aa as INERTIA, L as Inert, ab as Intent, ac as Listener, ad as ListenerOptions, ae as ListenerOptionsTuple, af as ListenerRecord, ag as Live, ah as MaxDepth, ai as NIL, aj as NOOP, ak as NextDepth, al as NoTraverse, am as PathBranch, an as PathBranchValue, ao as PathDepth, ap as PathKey, aq as PathLeaf, a as PathValue, P as Paths, f as Payload, ar as PrevDepth, as as Primitive, at as Pure, au as RAW, av as REJECTABLE, e as REvent, aw as RTR_BATCH, ax as RTR_LOG, R as Reactive, ay as ReactivePreferences, d as Reactor, J as ReactorBuild, az as ReactorEvent, aA as SSVERSION, aB as Setter, aC as SetterRecord, aD as Stable, aE as State, aF as StrictPathKey, aG as SubtractDepth, aH as SyncOptions, aI as SyncOptionsTuple, aJ as TERMINATOR, aK as Target, aL as Unflatten, aM as UnionToIntersection, aN as UpdatePayload, aO as VERSION, aP as Volatile, aQ as Watcher, aR as WatcherRecord, W as WildPaths, aS as getRaw, aT as getReactor, aU as getSnapshotVersion, aV as getVersion, aW as inert, aX as intent, aY as isInert, aZ as isIntent, a_ as isVolatile, a$ as live, b0 as methods, b1 as reactive, b2 as stable, b3 as state, b4 as volatile } from './index-
|
|
1
|
+
export { V as APIKey, X as AddDepth, Y as CTX, Z as ChildPaths, _ as DeepKeys, $ as DeepMerge, a0 as DeepPartial, K as DeepReadonly, a1 as DeepRequired, a2 as Deleter, a3 as DeleterRecord, a4 as DepthConfig, a5 as DirectPayload, a6 as EVT_OPTS, E as EffectOptions, a7 as Getter, a8 as GetterRecord, a9 as INDIFFABLE, aa as INERTIA, L as Inert, ab as Intent, ac as Listener, ad as ListenerOptions, ae as ListenerOptionsTuple, af as ListenerRecord, ag as Live, ah as MaxDepth, ai as NIL, aj as NOOP, ak as NextDepth, al as NoTraverse, am as PathBranch, an as PathBranchValue, ao as PathDepth, ap as PathKey, aq as PathLeaf, a as PathValue, P as Paths, f as Payload, ar as PrevDepth, as as Primitive, at as Pure, au as RAW, av as REJECTABLE, e as REvent, aw as RTR_BATCH, ax as RTR_LOG, R as Reactive, ay as ReactivePreferences, d as Reactor, J as ReactorBuild, az as ReactorEvent, aA as SSVERSION, aB as Setter, aC as SetterRecord, aD as Stable, aE as State, aF as StrictPathKey, aG as SubtractDepth, aH as SyncOptions, aI as SyncOptionsTuple, aJ as TERMINATOR, aK as Target, aL as Unflatten, aM as UnionToIntersection, aN as UpdatePayload, aO as VERSION, aP as Volatile, aQ as Watcher, aR as WatcherRecord, W as WildPaths, aS as getRaw, aT as getReactor, aU as getSnapshotVersion, aV as getVersion, aW as inert, aX as intent, aY as isInert, aZ as isIntent, a_ as isVolatile, a$ as live, b0 as methods, b1 as reactive, b2 as stable, b3 as state, b4 as volatile } from './index-BsH8KkqG.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { V as APIKey, X as AddDepth, Y as CTX, Z as ChildPaths, _ as DeepKeys, $ as DeepMerge, a0 as DeepPartial, K as DeepReadonly, a1 as DeepRequired, a2 as Deleter, a3 as DeleterRecord, a4 as DepthConfig, a5 as DirectPayload, a6 as EVT_OPTS, E as EffectOptions, a7 as Getter, a8 as GetterRecord, a9 as INDIFFABLE, aa as INERTIA, L as Inert, ab as Intent, ac as Listener, ad as ListenerOptions, ae as ListenerOptionsTuple, af as ListenerRecord, ag as Live, ah as MaxDepth, ai as NIL, aj as NOOP, ak as NextDepth, al as NoTraverse, am as PathBranch, an as PathBranchValue, ao as PathDepth, ap as PathKey, aq as PathLeaf, a as PathValue, P as Paths, f as Payload, ar as PrevDepth, as as Primitive, at as Pure, au as RAW, av as REJECTABLE, e as REvent, aw as RTR_BATCH, ax as RTR_LOG, R as Reactive, ay as ReactivePreferences, d as Reactor, J as ReactorBuild, az as ReactorEvent, aA as SSVERSION, aB as Setter, aC as SetterRecord, aD as Stable, aE as State, aF as StrictPathKey, aG as SubtractDepth, aH as SyncOptions, aI as SyncOptionsTuple, aJ as TERMINATOR, aK as Target, aL as Unflatten, aM as UnionToIntersection, aN as UpdatePayload, aO as VERSION, aP as Volatile, aQ as Watcher, aR as WatcherRecord, W as WildPaths, aS as getRaw, aT as getReactor, aU as getSnapshotVersion, aV as getVersion, aW as inert, aX as intent, aY as isInert, aZ as isIntent, a_ as isVolatile, a$ as live, b0 as methods, b1 as reactive, b2 as stable, b3 as state, b4 as volatile } from './index-
|
|
1
|
+
export { V as APIKey, X as AddDepth, Y as CTX, Z as ChildPaths, _ as DeepKeys, $ as DeepMerge, a0 as DeepPartial, K as DeepReadonly, a1 as DeepRequired, a2 as Deleter, a3 as DeleterRecord, a4 as DepthConfig, a5 as DirectPayload, a6 as EVT_OPTS, E as EffectOptions, a7 as Getter, a8 as GetterRecord, a9 as INDIFFABLE, aa as INERTIA, L as Inert, ab as Intent, ac as Listener, ad as ListenerOptions, ae as ListenerOptionsTuple, af as ListenerRecord, ag as Live, ah as MaxDepth, ai as NIL, aj as NOOP, ak as NextDepth, al as NoTraverse, am as PathBranch, an as PathBranchValue, ao as PathDepth, ap as PathKey, aq as PathLeaf, a as PathValue, P as Paths, f as Payload, ar as PrevDepth, as as Primitive, at as Pure, au as RAW, av as REJECTABLE, e as REvent, aw as RTR_BATCH, ax as RTR_LOG, R as Reactive, ay as ReactivePreferences, d as Reactor, J as ReactorBuild, az as ReactorEvent, aA as SSVERSION, aB as Setter, aC as SetterRecord, aD as Stable, aE as State, aF as StrictPathKey, aG as SubtractDepth, aH as SyncOptions, aI as SyncOptionsTuple, aJ as TERMINATOR, aK as Target, aL as Unflatten, aM as UnionToIntersection, aN as UpdatePayload, aO as VERSION, aP as Volatile, aQ as Watcher, aR as WatcherRecord, W as WildPaths, aS as getRaw, aT as getReactor, aU as getSnapshotVersion, aV as getVersion, aW as inert, aX as intent, aY as isInert, aZ as isIntent, a_ as isVolatile, a$ as live, b0 as methods, b1 as reactive, b2 as stable, b3 as state, b4 as volatile } from './index-BsH8KkqG.js';
|
package/dist/index.js
CHANGED
package/dist/modules.cjs
CHANGED
|
@@ -66,7 +66,7 @@ try {
|
|
|
66
66
|
isDevEnv = process.env.NODE_ENV !== "production";
|
|
67
67
|
} catch (e) {
|
|
68
68
|
}
|
|
69
|
-
var
|
|
69
|
+
var CTX_BUILD = {
|
|
70
70
|
/** Flag indicating whether the application is running in development mode. */
|
|
71
71
|
isDevEnv,
|
|
72
72
|
/** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
|
|
@@ -87,6 +87,7 @@ var CTX = {
|
|
|
87
87
|
batchingFunction: RTR_BATCH
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
+
var CTX = globalThis[/* @__PURE__ */ Symbol.for("S.I.A_CTX")] ??= CTX_BUILD;
|
|
90
91
|
|
|
91
92
|
// src/ts/modules/timeTravel/transaction.ts
|
|
92
93
|
var txId = 0;
|
package/dist/modules.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as Paths, c as ReactorModulePathConfig, L as Inert, F as FanoutOptionsTuple, B as BaseReactorModule, b as ReactorModuleId, d as Reactor, e as REvent } from './index-
|
|
2
|
-
export { M as ModulePaths, N as ReactorModuleConstructor, T as Transaction, O as endTx, Q as startTx, S as transaction, U as txId } from './index-
|
|
3
|
-
import { S as StorageAdapterConfig, a as StorageAdapter, J as JSONReviver, b as JSONReplacer, A as AsyncStorageAdapter, c as StorageAdapterConstructor, d as AsyncStorageAdapterConstructor, e as TimeTravelConfig, H as HistoryEntry, f as HistoryNode } from './index-
|
|
4
|
-
export { B as BaseStorageAdapter, g as HistoryTransaction, T as TimeTravelModule, h as TimeTravelState } from './index-
|
|
1
|
+
import { P as Paths, c as ReactorModulePathConfig, L as Inert, F as FanoutOptionsTuple, B as BaseReactorModule, b as ReactorModuleId, d as Reactor, e as REvent } from './index-BsH8KkqG.cjs';
|
|
2
|
+
export { M as ModulePaths, N as ReactorModuleConstructor, T as Transaction, O as endTx, Q as startTx, S as transaction, U as txId } from './index-BsH8KkqG.cjs';
|
|
3
|
+
import { S as StorageAdapterConfig, a as StorageAdapter, J as JSONReviver, b as JSONReplacer, A as AsyncStorageAdapter, c as StorageAdapterConstructor, d as AsyncStorageAdapterConstructor, e as TimeTravelConfig, H as HistoryEntry, f as HistoryNode } from './index-DBx4TIVW.cjs';
|
|
4
|
+
export { B as BaseStorageAdapter, g as HistoryTransaction, T as TimeTravelModule, h as TimeTravelState } from './index-DBx4TIVW.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* - The LocalStorage Adapter (~5MB per origin, browser-dependent).
|
package/dist/modules.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as Paths, c as ReactorModulePathConfig, L as Inert, F as FanoutOptionsTuple, B as BaseReactorModule, b as ReactorModuleId, d as Reactor, e as REvent } from './index-
|
|
2
|
-
export { M as ModulePaths, N as ReactorModuleConstructor, T as Transaction, O as endTx, Q as startTx, S as transaction, U as txId } from './index-
|
|
3
|
-
import { S as StorageAdapterConfig, a as StorageAdapter, J as JSONReviver, b as JSONReplacer, A as AsyncStorageAdapter, c as StorageAdapterConstructor, d as AsyncStorageAdapterConstructor, e as TimeTravelConfig, H as HistoryEntry, f as HistoryNode } from './index-
|
|
4
|
-
export { B as BaseStorageAdapter, g as HistoryTransaction, T as TimeTravelModule, h as TimeTravelState } from './index-
|
|
1
|
+
import { P as Paths, c as ReactorModulePathConfig, L as Inert, F as FanoutOptionsTuple, B as BaseReactorModule, b as ReactorModuleId, d as Reactor, e as REvent } from './index-BsH8KkqG.js';
|
|
2
|
+
export { M as ModulePaths, N as ReactorModuleConstructor, T as Transaction, O as endTx, Q as startTx, S as transaction, U as txId } from './index-BsH8KkqG.js';
|
|
3
|
+
import { S as StorageAdapterConfig, a as StorageAdapter, J as JSONReviver, b as JSONReplacer, A as AsyncStorageAdapter, c as StorageAdapterConstructor, d as AsyncStorageAdapterConstructor, e as TimeTravelConfig, H as HistoryEntry, f as HistoryNode } from './index-D4DGBS2N.js';
|
|
4
|
+
export { B as BaseStorageAdapter, g as HistoryTransaction, T as TimeTravelModule, h as TimeTravelState } from './index-D4DGBS2N.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* - The LocalStorage Adapter (~5MB per origin, browser-dependent).
|
package/dist/modules.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-JGEI2Q4M.js";
|
|
6
6
|
import {
|
|
7
7
|
BaseReactorModule
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FOD32N6J.js";
|
|
9
9
|
import "./chunk-ORK3EGB6.js";
|
|
10
10
|
import {
|
|
11
11
|
CTX,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
transaction,
|
|
28
28
|
txId,
|
|
29
29
|
withMeta
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-DCUPDG7B.js";
|
|
31
31
|
|
|
32
32
|
// src/ts/modules/persist/storage/base/index.ts
|
|
33
33
|
var BaseStorageAdapter = class {
|
|
@@ -1,271 +1,271 @@
|
|
|
1
|
-
.tt-console-host {
|
|
2
|
-
--sia-tt-color: #e26e02;
|
|
3
|
-
--sia-brand-color: rgb(from var(--sia-tt-color) r g b / 1);
|
|
4
|
-
--sia-tt-bg: rgb(from var(--sia-brand-color) calc((r * 0.09) + 6) calc((g * 0.08) + 7) calc((b * 0.1) + 10) / 0.66);
|
|
5
|
-
--sia-tt-bg-soft: rgb(from var(--sia-brand-color) calc((r * 0.11) + 9) calc((g * 0.1) + 9) calc((b * 0.12) + 12) / 0.64);
|
|
6
|
-
--sia-tt-line: hsl(from var(--sia-brand-color) h calc(s * 0.1) 24% / 0.6);
|
|
7
|
-
--sia-tt-text: rgb(from var(--sia-brand-color) calc((r * 0.2) + 218) calc((g * 0.11) + 214) calc((b * 0.09) + 214));
|
|
8
|
-
--sia-tt-muted: rgb(from var(--sia-brand-color) calc((r * 0.24) + 150) calc((g * 0.14) + 146) calc((b * 0.12) + 146));
|
|
9
|
-
--sia-tt-input-bg: rgb(from var(--sia-brand-color) calc((r * 0.08) + 8) calc((g * 0.07) + 8) calc((b * 0.09) + 10) / 0.66);
|
|
10
|
-
position: relative;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.tt-console-host *,
|
|
14
|
-
.tt-console-host *::before,
|
|
15
|
-
.tt-console-host *::after {
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
scrollbar-width: thin;
|
|
18
|
-
scrollbar-color: var(--sia-brand-color) transparent;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:where(.tt-console-host) *,
|
|
22
|
-
:where(.tt-console-host) *::after,
|
|
23
|
-
:where(.tt-console-host) *::before {
|
|
24
|
-
padding: 0;
|
|
25
|
-
margin: 0;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.tt-console-host *::selection {
|
|
29
|
-
color: currentColor;
|
|
30
|
-
background-color: rgb(from var(--sia-brand-color) r g b / 0.25);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.tt-console-host :is(*:focus-visible, #o#o#o#o#o) {
|
|
34
|
-
outline: 1.5px dashed var(--sia-brand-color);
|
|
35
|
-
outline-offset: 1px;
|
|
36
|
-
transition: none;
|
|
37
|
-
}
|
|
38
|
-
.tt-console input[type="range"]:focus-visible {
|
|
39
|
-
outline-offset: 1px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.tt-console-layer {
|
|
43
|
-
inset: 0;
|
|
44
|
-
z-index: 2147483647;
|
|
45
|
-
pointer-events: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.tt-console-dock {
|
|
49
|
-
position: absolute;
|
|
50
|
-
right: 18px;
|
|
51
|
-
bottom: 18px;
|
|
52
|
-
display: flex;
|
|
53
|
-
gap: 8px;
|
|
54
|
-
justify-content: flex-end;
|
|
55
|
-
pointer-events: auto;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.tt-console-toggle {
|
|
59
|
-
position: relative;
|
|
60
|
-
color: var(--sia-tt-text);
|
|
61
|
-
background: var(--sia-tt-bg-soft);
|
|
62
|
-
border: 1px solid var(--sia-tt-line);
|
|
63
|
-
border-radius: 8px;
|
|
64
|
-
font-size: 0.75rem;
|
|
65
|
-
line-height: 1.1;
|
|
66
|
-
padding: 5px 8px;
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
pointer-events: auto;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.tt-console {
|
|
72
|
-
position: absolute;
|
|
73
|
-
right: 0;
|
|
74
|
-
bottom: calc(100% + 8px);
|
|
75
|
-
width: min(360px, calc(100vw - 50px));
|
|
76
|
-
max-height:
|
|
77
|
-
background: var(--sia-tt-bg);
|
|
78
|
-
border: 1px solid var(--sia-tt-line);
|
|
79
|
-
border-radius: 12px;
|
|
80
|
-
padding: 12px;
|
|
81
|
-
display: grid;
|
|
82
|
-
gap: 8px;
|
|
83
|
-
color: var(--sia-tt-text);
|
|
84
|
-
-webkit-backdrop-filter: blur(6px);
|
|
85
|
-
backdrop-filter: blur(6px);
|
|
86
|
-
pointer-events: auto;
|
|
87
|
-
opacity: 1;
|
|
88
|
-
overflow-y: auto;
|
|
89
|
-
transform: translateY(0) scale(1);
|
|
90
|
-
transform-origin: right bottom;
|
|
91
|
-
visibility: visible;
|
|
92
|
-
transition: opacity 160ms ease, transform 180ms ease, visibility 0ms linear;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.tt-console[hidden] {
|
|
96
|
-
opacity: 0;
|
|
97
|
-
transform: translateY(6px) scale(0.985);
|
|
98
|
-
visibility: hidden;
|
|
99
|
-
pointer-events: none;
|
|
100
|
-
transition: opacity 140ms ease, transform 160ms ease, visibility 0ms linear 160ms;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@media (prefers-reduced-motion: reduce) {
|
|
104
|
-
.tt-console,
|
|
105
|
-
.tt-console[hidden] {
|
|
106
|
-
transition: none;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.tt-console .title {
|
|
111
|
-
color: var(--sia-brand-color);
|
|
112
|
-
font-weight: bold;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.tt-console :is(button, .tt-button) {
|
|
116
|
-
border: 1px solid var(--sia-tt-line);
|
|
117
|
-
background: var(--sia-tt-bg-soft);
|
|
118
|
-
color: var(--sia-tt-text);
|
|
119
|
-
border-radius: 8px;
|
|
120
|
-
padding: 5px 8px;
|
|
121
|
-
font-size: 0.75rem;
|
|
122
|
-
line-height: 1.1;
|
|
123
|
-
cursor: pointer;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.tt-console :is(button, .tt-button):hover {
|
|
127
|
-
border-color: hsl(from var(--sia-brand-color) h calc(s * 0.35) 40% / 0.9);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.tt-console :is(button, .tt-button):disabled {
|
|
131
|
-
opacity: 0.7;
|
|
132
|
-
cursor: not-allowed;
|
|
133
|
-
color: var(--sia-tt-muted);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.tt-status-row {
|
|
137
|
-
display: flex;
|
|
138
|
-
align-items: start;
|
|
139
|
-
gap: 8px;
|
|
140
|
-
justify-content: space-between;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.tt-status-row > :is(button, .tt-button) {
|
|
144
|
-
white-space: nowrap;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.tt-status-box {
|
|
148
|
-
display: grid;
|
|
149
|
-
gap: 4px;
|
|
150
|
-
flex: 1;
|
|
151
|
-
min-width: 0;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.tt-status-box .muted {
|
|
155
|
-
margin: 0;
|
|
156
|
-
font-size: 0.75rem;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.tt-filter-row {
|
|
160
|
-
display: flex;
|
|
161
|
-
align-items: center;
|
|
162
|
-
gap: 8px;
|
|
163
|
-
min-width: 0;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.tt-filter-row .muted,
|
|
167
|
-
.tt-speed {
|
|
168
|
-
min-width: 50px;
|
|
169
|
-
white-space: nowrap;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.tt-row {
|
|
173
|
-
display: flex;
|
|
174
|
-
gap: 8px;
|
|
175
|
-
justify-content: center;
|
|
176
|
-
align-items: center;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.tt-console input {
|
|
180
|
-
accent-color: var(--sia-brand-color);
|
|
181
|
-
}
|
|
182
|
-
.tt-console input[type="range"] {
|
|
183
|
-
width: 100%;
|
|
184
|
-
height: 5px;
|
|
185
|
-
border-radius: 8px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.tt-speed {
|
|
189
|
-
background-color: var(--sia-brand-color);
|
|
190
|
-
border-radius: 8px;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.tt-mini-input {
|
|
194
|
-
min-width: 45px;
|
|
195
|
-
max-width: 100px;
|
|
196
|
-
field-sizing: content;
|
|
197
|
-
}
|
|
198
|
-
@supports not (field-sizing: content) {
|
|
199
|
-
.tt-mini-input {
|
|
200
|
-
width: 45px;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.tt-io {
|
|
205
|
-
min-height: 84px;
|
|
206
|
-
max-height: calc((100vh - 318px) / 2);
|
|
207
|
-
resize: vertical;
|
|
208
|
-
border: 1px solid var(--sia-tt-line);
|
|
209
|
-
background: var(--sia-tt-input-bg);
|
|
210
|
-
color: var(--sia-tt-text);
|
|
211
|
-
font-size: 0.75rem;
|
|
212
|
-
border-radius: 8px;
|
|
213
|
-
padding: 8px;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.tt-filter-input.tt-io {
|
|
217
|
-
min-height: 30px;
|
|
218
|
-
height: 30px;
|
|
219
|
-
max-height: 30px;
|
|
220
|
-
resize: none;
|
|
221
|
-
width: 100%;
|
|
222
|
-
flex: 1 1 auto;
|
|
223
|
-
padding-block: 6px;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.tt-filter-input.tt-io::-webkit-scrollbar {
|
|
227
|
-
display: none;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.tt-io::placeholder {
|
|
231
|
-
color: var(--sia-tt-muted);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.tt-config-row:not(:has(:focus)) > :is(#o, *) {
|
|
235
|
-
color: var(--sia-tt-muted);
|
|
236
|
-
opacity: 0.5;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.tt-check {
|
|
240
|
-
display: flex;
|
|
241
|
-
align-items: center;
|
|
242
|
-
gap: 0.35rem;
|
|
243
|
-
font-size: 0.7rem;
|
|
244
|
-
}
|
|
245
|
-
.tt-check input[type="checkbox"] {
|
|
246
|
-
width: 0.65rem;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.tt-footnote {
|
|
250
|
-
margin: 2px 2px 0;
|
|
251
|
-
font-size: 0.72rem;
|
|
252
|
-
line-height: 1.35;
|
|
253
|
-
color: var(--sia-tt-muted);
|
|
254
|
-
text-align: right;
|
|
255
|
-
white-space: nowrap;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.tt-stats {
|
|
259
|
-
float: left;
|
|
260
|
-
margin-right: auto;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.tt-footnote a {
|
|
264
|
-
color: var(--sia-brand-color);
|
|
265
|
-
text-decoration: none;
|
|
266
|
-
border-bottom: 1px solid var(--sia-tt-line);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.tt-footnote a:hover {
|
|
270
|
-
text-decoration: underline;
|
|
271
|
-
}
|
|
1
|
+
.sia-tt-console-host {
|
|
2
|
+
--sia-tt-color: #e26e02;
|
|
3
|
+
--sia-brand-color: rgb(from var(--sia-tt-color) r g b / 1);
|
|
4
|
+
--sia-tt-bg: rgb(from var(--sia-brand-color) calc((r * 0.09) + 6) calc((g * 0.08) + 7) calc((b * 0.1) + 10) / 0.66);
|
|
5
|
+
--sia-tt-bg-soft: rgb(from var(--sia-brand-color) calc((r * 0.11) + 9) calc((g * 0.1) + 9) calc((b * 0.12) + 12) / 0.64);
|
|
6
|
+
--sia-tt-line: hsl(from var(--sia-brand-color) h calc(s * 0.1) 24% / 0.6);
|
|
7
|
+
--sia-tt-text: rgb(from var(--sia-brand-color) calc((r * 0.2) + 218) calc((g * 0.11) + 214) calc((b * 0.09) + 214));
|
|
8
|
+
--sia-tt-muted: rgb(from var(--sia-brand-color) calc((r * 0.24) + 150) calc((g * 0.14) + 146) calc((b * 0.12) + 146));
|
|
9
|
+
--sia-tt-input-bg: rgb(from var(--sia-brand-color) calc((r * 0.08) + 8) calc((g * 0.07) + 8) calc((b * 0.09) + 10) / 0.66);
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.sia-tt-console-host *,
|
|
14
|
+
.sia-tt-console-host *::before,
|
|
15
|
+
.sia-tt-console-host *::after {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
scrollbar-width: thin;
|
|
18
|
+
scrollbar-color: var(--sia-brand-color) transparent;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:where(.sia-tt-console-host) *,
|
|
22
|
+
:where(.sia-tt-console-host) *::after,
|
|
23
|
+
:where(.sia-tt-console-host) *::before {
|
|
24
|
+
padding: 0;
|
|
25
|
+
margin: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.sia-tt-console-host *::selection {
|
|
29
|
+
color: currentColor;
|
|
30
|
+
background-color: rgb(from var(--sia-brand-color) r g b / 0.25);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.sia-tt-console-host :is(*:focus-visible, #o#o#o#o#o) {
|
|
34
|
+
outline: 1.5px dashed var(--sia-brand-color);
|
|
35
|
+
outline-offset: 1px;
|
|
36
|
+
transition: none;
|
|
37
|
+
}
|
|
38
|
+
.sia-tt-console input[type="range"]:focus-visible {
|
|
39
|
+
outline-offset: 1px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sia-tt-console-layer {
|
|
43
|
+
inset: 0;
|
|
44
|
+
z-index: 2147483647;
|
|
45
|
+
pointer-events: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.sia-tt-console-dock {
|
|
49
|
+
position: absolute;
|
|
50
|
+
right: 18px;
|
|
51
|
+
bottom: 18px;
|
|
52
|
+
display: flex;
|
|
53
|
+
gap: 8px;
|
|
54
|
+
justify-content: flex-end;
|
|
55
|
+
pointer-events: auto;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.sia-tt-console-toggle {
|
|
59
|
+
position: relative;
|
|
60
|
+
color: var(--sia-tt-text);
|
|
61
|
+
background: var(--sia-tt-bg-soft);
|
|
62
|
+
border: 1px solid var(--sia-tt-line);
|
|
63
|
+
border-radius: 8px;
|
|
64
|
+
font-size: 0.75rem;
|
|
65
|
+
line-height: 1.1;
|
|
66
|
+
padding: 5px 8px;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
pointer-events: auto;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.sia-tt-console {
|
|
72
|
+
position: absolute;
|
|
73
|
+
right: 0;
|
|
74
|
+
bottom: calc(100% + 8px);
|
|
75
|
+
width: min(360px, calc(100vw - 50px));
|
|
76
|
+
max-height: calc(100vh - 50px);
|
|
77
|
+
background: var(--sia-tt-bg);
|
|
78
|
+
border: 1px solid var(--sia-tt-line);
|
|
79
|
+
border-radius: 12px;
|
|
80
|
+
padding: 12px;
|
|
81
|
+
display: grid;
|
|
82
|
+
gap: 8px;
|
|
83
|
+
color: var(--sia-tt-text);
|
|
84
|
+
-webkit-backdrop-filter: blur(6px);
|
|
85
|
+
backdrop-filter: blur(6px);
|
|
86
|
+
pointer-events: auto;
|
|
87
|
+
opacity: 1;
|
|
88
|
+
overflow-y: auto;
|
|
89
|
+
transform: translateY(0) scale(1);
|
|
90
|
+
transform-origin: right bottom;
|
|
91
|
+
visibility: visible;
|
|
92
|
+
transition: opacity 160ms ease, transform 180ms ease, visibility 0ms linear;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.sia-tt-console[hidden] {
|
|
96
|
+
opacity: 0;
|
|
97
|
+
transform: translateY(6px) scale(0.985);
|
|
98
|
+
visibility: hidden;
|
|
99
|
+
pointer-events: none;
|
|
100
|
+
transition: opacity 140ms ease, transform 160ms ease, visibility 0ms linear 160ms;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (prefers-reduced-motion: reduce) {
|
|
104
|
+
.sia-tt-console,
|
|
105
|
+
.sia-tt-console[hidden] {
|
|
106
|
+
transition: none;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.sia-tt-console .title {
|
|
111
|
+
color: var(--sia-brand-color);
|
|
112
|
+
font-weight: bold;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.sia-tt-console :is(button, .sia-tt-button) {
|
|
116
|
+
border: 1px solid var(--sia-tt-line);
|
|
117
|
+
background: var(--sia-tt-bg-soft);
|
|
118
|
+
color: var(--sia-tt-text);
|
|
119
|
+
border-radius: 8px;
|
|
120
|
+
padding: 5px 8px;
|
|
121
|
+
font-size: 0.75rem;
|
|
122
|
+
line-height: 1.1;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.sia-tt-console :is(button, .sia-tt-button):hover {
|
|
127
|
+
border-color: hsl(from var(--sia-brand-color) h calc(s * 0.35) 40% / 0.9);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.sia-tt-console :is(button, .sia-tt-button):disabled {
|
|
131
|
+
opacity: 0.7;
|
|
132
|
+
cursor: not-allowed;
|
|
133
|
+
color: var(--sia-tt-muted);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.sia-tt-status-row {
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: start;
|
|
139
|
+
gap: 8px;
|
|
140
|
+
justify-content: space-between;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.sia-tt-status-row > :is(button, .sia-tt-button) {
|
|
144
|
+
white-space: nowrap;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.sia-tt-status-box {
|
|
148
|
+
display: grid;
|
|
149
|
+
gap: 4px;
|
|
150
|
+
flex: 1;
|
|
151
|
+
min-width: 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.sia-tt-status-box .muted {
|
|
155
|
+
margin: 0;
|
|
156
|
+
font-size: 0.75rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.sia-tt-filter-row {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
gap: 8px;
|
|
163
|
+
min-width: 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.sia-tt-filter-row .muted,
|
|
167
|
+
.sia-tt-speed {
|
|
168
|
+
min-width: 50px;
|
|
169
|
+
white-space: nowrap;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.sia-tt-row {
|
|
173
|
+
display: flex;
|
|
174
|
+
gap: 8px;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
align-items: center;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.sia-tt-console input {
|
|
180
|
+
accent-color: var(--sia-brand-color);
|
|
181
|
+
}
|
|
182
|
+
.sia-tt-console input[type="range"] {
|
|
183
|
+
width: 100%;
|
|
184
|
+
height: 5px;
|
|
185
|
+
border-radius: 8px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.sia-tt-speed {
|
|
189
|
+
background-color: var(--sia-brand-color);
|
|
190
|
+
border-radius: 8px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.sia-tt-mini-input {
|
|
194
|
+
min-width: 45px;
|
|
195
|
+
max-width: 100px;
|
|
196
|
+
field-sizing: content;
|
|
197
|
+
}
|
|
198
|
+
@supports not (field-sizing: content) {
|
|
199
|
+
.sia-tt-mini-input {
|
|
200
|
+
width: 45px;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.sia-tt-io {
|
|
205
|
+
min-height: 84px;
|
|
206
|
+
max-height: calc((100vh - 318px) / 2);
|
|
207
|
+
resize: vertical;
|
|
208
|
+
border: 1px solid var(--sia-tt-line);
|
|
209
|
+
background: var(--sia-tt-input-bg);
|
|
210
|
+
color: var(--sia-tt-text);
|
|
211
|
+
font-size: 0.75rem;
|
|
212
|
+
border-radius: 8px;
|
|
213
|
+
padding: 8px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.sia-tt-filter-input.sia-tt-io {
|
|
217
|
+
min-height: 30px;
|
|
218
|
+
height: 30px;
|
|
219
|
+
max-height: 30px;
|
|
220
|
+
resize: none;
|
|
221
|
+
width: 100%;
|
|
222
|
+
flex: 1 1 auto;
|
|
223
|
+
padding-block: 6px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.sia-tt-filter-input.sia-tt-io::-webkit-scrollbar {
|
|
227
|
+
display: none;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.sia-tt-io::placeholder {
|
|
231
|
+
color: var(--sia-tt-muted);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.sia-tt-config-row:not(:has(:focus)) > :is(#o, *) {
|
|
235
|
+
color: var(--sia-tt-muted);
|
|
236
|
+
opacity: 0.5;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.sia-tt-check {
|
|
240
|
+
display: flex;
|
|
241
|
+
align-items: center;
|
|
242
|
+
gap: 0.35rem;
|
|
243
|
+
font-size: 0.7rem;
|
|
244
|
+
}
|
|
245
|
+
.sia-tt-check input[type="checkbox"] {
|
|
246
|
+
width: 0.65rem;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.sia-tt-footnote {
|
|
250
|
+
margin: 2px 2px 0;
|
|
251
|
+
font-size: 0.72rem;
|
|
252
|
+
line-height: 1.35;
|
|
253
|
+
color: var(--sia-tt-muted);
|
|
254
|
+
text-align: right;
|
|
255
|
+
white-space: nowrap;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.sia-tt-stats {
|
|
259
|
+
float: left;
|
|
260
|
+
margin-right: auto;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.sia-tt-footnote a {
|
|
264
|
+
color: var(--sia-brand-color);
|
|
265
|
+
text-decoration: none;
|
|
266
|
+
border-bottom: 1px solid var(--sia-tt-line);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.sia-tt-footnote a:hover {
|
|
270
|
+
text-decoration: underline;
|
|
271
|
+
}
|
package/dist/super.d.ts
CHANGED
|
@@ -1344,8 +1344,7 @@ declare const EVT_OPTS: {
|
|
|
1344
1344
|
declare const NIL: any;
|
|
1345
1345
|
/** Shared no-operation function. */
|
|
1346
1346
|
declare const NOOP: () => void;
|
|
1347
|
-
|
|
1348
|
-
declare const CTX: {
|
|
1347
|
+
declare const CTX_BUILD: {
|
|
1349
1348
|
/** Flag indicating whether the application is running in development mode. */
|
|
1350
1349
|
isDevEnv: boolean;
|
|
1351
1350
|
/** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
|
|
@@ -1357,6 +1356,8 @@ declare const CTX: {
|
|
|
1357
1356
|
/** Default configuration for new `Reactor` instances and also fallback for utils that need and are called without these options. */
|
|
1358
1357
|
defaults: Partial<ReactorBuild<any>>;
|
|
1359
1358
|
};
|
|
1359
|
+
/** Global context object for sharing state across the reactor runtime. */
|
|
1360
|
+
declare const CTX: typeof CTX_BUILD;
|
|
1360
1361
|
|
|
1361
1362
|
declare function clamp(min: number | undefined, val: number, max?: number): number;
|
|
1362
1363
|
|
package/dist/super.global.js
CHANGED
|
@@ -75,7 +75,7 @@ var sia = (() => {
|
|
|
75
75
|
isDevEnv = process.env.NODE_ENV !== "production";
|
|
76
76
|
} catch (e) {
|
|
77
77
|
}
|
|
78
|
-
var
|
|
78
|
+
var CTX_BUILD = {
|
|
79
79
|
/** Flag indicating whether the application is running in development mode. */
|
|
80
80
|
isDevEnv,
|
|
81
81
|
/** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
|
|
@@ -96,6 +96,7 @@ var sia = (() => {
|
|
|
96
96
|
batchingFunction: RTR_BATCH
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
+
var CTX = globalThis[/* @__PURE__ */ Symbol.for("S.I.A_CTX")] ??= CTX_BUILD;
|
|
99
100
|
|
|
100
101
|
// src/ts/core/mixins.ts
|
|
101
102
|
var methods = ["tick", "stall", "nostall", "get", "gonce", "noget", "set", "sonce", "noset", "delete", "donce", "nodelete", "watch", "wonce", "nowatch", "on", "once", "off", "snapshot", "use", "reset", "destroy"];
|
|
@@ -2436,7 +2437,7 @@ var sia = (() => {
|
|
|
2436
2437
|
this.config = reactive({ title: `Time Travel Console ${this.index = ++_TimeTravelConsole.count}`, ...build });
|
|
2437
2438
|
this.state.open = !!this.config.startOpen;
|
|
2438
2439
|
let wlLive = false, blLive = false;
|
|
2439
|
-
const s = this.time.state, host = this.host = createEl("div", { className: "tt-console-host" }), toggle = createEl("button", { className: "tt-console-toggle", type: "button", onclick: () => this.state.open = !this.state.open }), panel = createEl("aside", { className: "tt-console", ariaLabel: "time travel overlay" }), title = createEl("div", { className: "title" }), frame = createEl("span", { className: "muted" }), clrHistory = createEl("button", { textContent: `Clear History${formatKeyForDisplay(keys.shortcuts.clrHistory)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clrHistory, false), onclick: () => (this.time.clear(), this.state.import = "") }), undo = createEl("button", { textContent: `Undo${formatKeyForDisplay(keys.shortcuts.undo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.undo, false), onclick: () => this.time.undo(this.state.stride) }), redo = createEl("button", { textContent: `Redo${formatKeyForDisplay(keys.shortcuts.redo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.redo, false), onclick: () => this.time.redo(this.state.stride) }), genesis = createEl("button", { textContent: `Genesis${formatKeyForDisplay(keys.shortcuts.genesis)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.genesis, false), onclick: () => this.time.jumpTo(0) }), playPause = createEl("button", { onclick: () => this.time[s.paused ? "play" : "pause"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.playPause, false) }), rewind = createEl("button", { textContent: `Rewind${formatKeyForDisplay(keys.shortcuts.rewind)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.rewind, false), onclick: this.time.rewind }), trackUntrack = createEl("button", { onclick: () => this.time[s.tracking ? "untrack" : "track"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.trackUntrack, false) }), 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${formatKeyForDisplay(keys.shortcuts.export)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.export, false), onclick: () => this.state.import = this.time.export(null, 2) }), imp = createEl("button", { textContent: `Import${formatKeyForDisplay(keys.shortcuts.import)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.import, false), onclick: () => this.state.import.trim().length && this.time.import(this.state.import) }), clr = createEl("button", { textContent: `Clear${formatKeyForDisplay(keys.shortcuts.clear)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clear, false), onclick: () => this.state.import = "" }), payload = createEl("textarea", { className: "tt-io", readOnly: true, placeholder: "current payload json", title: "Current History Entry" }), io = createEl("textarea", { className: "tt-io", placeholder: "timeline payload json", title: "Time History", oninput: () => this.state.import = io.value }), foot = createEl("p", { className: "tt-footnote", innerHTML: "<span>Want 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: "tt-status-box" }), status = createEl("div", { className: "tt-status-row" }), filters = createEl("div", { className: "tt-status-row" }), filterBox = createEl("div", { className: "tt-status-box" }), whitelistLabel = createEl("span", { className: "muted", textContent: "Whitelist:" }), blacklistLabel = createEl("span", { className: "muted", textContent: "Blacklist:" }), whitelist = createEl("input", { className: "tt-filter-input 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: "tt-filter-input 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: "tt-speed", title: "Playback Speed", onchange: () => this.time.config.playbackRate = Number(speed.value) }), stride = createEl("input", { className: "tt-stride tt-button 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: "tt-stats" }), limit = createEl("input", { className: "tt-limit tt-mini-input 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: "tt-delay tt-mini-input 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: "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: "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: "tt-filter-row" }), filterRow2 = createEl("div", { className: "tt-filter-row" }), row1 = createEl("div", { className: "tt-row" }), row2 = createEl("div", { className: "tt-row" }), row3 = createEl("div", { className: "tt-row" }), row4 = createEl("div", { className: "tt-row" }), row5 = createEl("div", { className: "tt-row tt-config-row" });
|
|
2440
|
+
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${formatKeyForDisplay(keys.shortcuts.clrHistory)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clrHistory, false), onclick: () => (this.time.clear(), this.state.import = "") }), undo = createEl("button", { textContent: `Undo${formatKeyForDisplay(keys.shortcuts.undo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.undo, false), onclick: () => this.time.undo(this.state.stride) }), redo = createEl("button", { textContent: `Redo${formatKeyForDisplay(keys.shortcuts.redo[0])}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.redo, false), onclick: () => this.time.redo(this.state.stride) }), genesis = createEl("button", { textContent: `Genesis${formatKeyForDisplay(keys.shortcuts.genesis)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.genesis, false), onclick: () => this.time.jumpTo(0) }), playPause = createEl("button", { onclick: () => this.time[s.paused ? "play" : "pause"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.playPause, false) }), rewind = createEl("button", { textContent: `Rewind${formatKeyForDisplay(keys.shortcuts.rewind)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.rewind, false), onclick: this.time.rewind }), trackUntrack = createEl("button", { onclick: () => this.time[s.tracking ? "untrack" : "track"](), ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.trackUntrack, false) }), 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${formatKeyForDisplay(keys.shortcuts.export)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.export, false), onclick: () => this.state.import = this.time.export(null, 2) }), imp = createEl("button", { textContent: `Import${formatKeyForDisplay(keys.shortcuts.import)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.import, false), onclick: () => this.state.import.trim().length && this.time.import(this.state.import) }), clr = createEl("button", { textContent: `Clear${formatKeyForDisplay(keys.shortcuts.clear)}`, ariaKeyShortcuts: parseForARIAKS(keys.shortcuts.clear, false), 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>Want 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" });
|
|
2440
2441
|
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` })));
|
|
2441
2442
|
status.append((box.append(frame), box), clrHistory);
|
|
2442
2443
|
filters.append((filterBox.append((filterRow1.append(whitelistLabel, whitelist), filterRow1), (filterRow2.append(blacklistLabel, blacklist), filterRow2)), filterBox));
|
|
@@ -2495,9 +2496,9 @@ var sia = (() => {
|
|
|
2495
2496
|
function getDock(container) {
|
|
2496
2497
|
const host = container && container !== document.documentElement ? container : document.body;
|
|
2497
2498
|
if (host !== document.body && getComputedStyle(host).position === "static") host.style.position = "relative";
|
|
2498
|
-
const layer = host.querySelector(":scope > .tt-console-layer") || createEl("div", { className: "tt-console-layer" }, void 0, { position: host === document.body ? "fixed" : "absolute" });
|
|
2499
|
+
const layer = host.querySelector(":scope > .sia-tt-console-layer") || createEl("div", { className: "sia-tt-console-layer" }, void 0, { position: host === document.body ? "fixed" : "absolute" });
|
|
2499
2500
|
if (layer.parentElement !== host) host.appendChild(layer);
|
|
2500
|
-
const dock = layer.querySelector(":scope > .tt-console-dock") || createEl("div", { className: "tt-console-dock" });
|
|
2501
|
+
const dock = layer.querySelector(":scope > .sia-tt-console-dock") || createEl("div", { className: "sia-tt-console-dock" });
|
|
2501
2502
|
return dock.parentElement !== layer && layer.appendChild(dock), dock;
|
|
2502
2503
|
}
|
|
2503
2504
|
function formatPaths(paths, emptyText) {
|
package/dist/utils.cjs
CHANGED
|
@@ -87,7 +87,7 @@ try {
|
|
|
87
87
|
isDevEnv = process.env.NODE_ENV !== "production";
|
|
88
88
|
} catch (e) {
|
|
89
89
|
}
|
|
90
|
-
var
|
|
90
|
+
var CTX_BUILD = {
|
|
91
91
|
/** Flag indicating whether the application is running in development mode. */
|
|
92
92
|
isDevEnv,
|
|
93
93
|
/** Flag indicating whether an operation is bypassing checks so reactors can allow all writes. */
|
|
@@ -108,6 +108,7 @@ var CTX = {
|
|
|
108
108
|
batchingFunction: RTR_BATCH
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
+
var CTX = globalThis[/* @__PURE__ */ Symbol.for("S.I.A_CTX")] ??= CTX_BUILD;
|
|
111
112
|
|
|
112
113
|
// src/ts/core/event.ts
|
|
113
114
|
var ReactorEvent = class _ReactorEvent {
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as FanoutOptionsTuple, g as arrRegex, h as canHandle, i as createReactorSync, j as deepClone, k as deletePath, l as fanout, m as fanoutOptsArr, n as force, o as getDepth, p as getPath, q as getPaths, r as getTrailRecords, s as hasPath, t as isLeafPath, u as isObj, v as isPOJO, x as matchPaths, y as mergeObjs, z as nuke, C as parseEvtOpts, D as parsePathObj, G as resetMeta, H as setPath, I as withMeta } from './index-
|
|
1
|
+
export { F as FanoutOptionsTuple, g as arrRegex, h as canHandle, i as createReactorSync, j as deepClone, k as deletePath, l as fanout, m as fanoutOptsArr, n as force, o as getDepth, p as getPath, q as getPaths, r as getTrailRecords, s as hasPath, t as isLeafPath, u as isObj, v as isPOJO, x as matchPaths, y as mergeObjs, z as nuke, C as parseEvtOpts, D as parsePathObj, G as resetMeta, H as setPath, I as withMeta } from './index-BsH8KkqG.cjs';
|
|
2
2
|
|
|
3
3
|
declare function clamp(min: number | undefined, val: number, max?: number): number;
|
|
4
4
|
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as FanoutOptionsTuple, g as arrRegex, h as canHandle, i as createReactorSync, j as deepClone, k as deletePath, l as fanout, m as fanoutOptsArr, n as force, o as getDepth, p as getPath, q as getPaths, r as getTrailRecords, s as hasPath, t as isLeafPath, u as isObj, v as isPOJO, x as matchPaths, y as mergeObjs, z as nuke, C as parseEvtOpts, D as parsePathObj, G as resetMeta, H as setPath, I as withMeta } from './index-
|
|
1
|
+
export { F as FanoutOptionsTuple, g as arrRegex, h as canHandle, i as createReactorSync, j as deepClone, k as deletePath, l as fanout, m as fanoutOptsArr, n as force, o as getDepth, p as getPath, q as getPaths, r as getTrailRecords, s as hasPath, t as isLeafPath, u as isObj, v as isPOJO, x as matchPaths, y as mergeObjs, z as nuke, C as parseEvtOpts, D as parsePathObj, G as resetMeta, H as setPath, I as withMeta } from './index-BsH8KkqG.js';
|
|
2
2
|
|
|
3
3
|
declare function clamp(min: number | undefined, val: number, max?: number): number;
|
|
4
4
|
|
package/dist/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sia-reactor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"description": "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.",
|
|
5
5
|
"author": "Oketade Oluwatobiloba <tobioketade007@gmail.com>",
|
|
6
6
|
"license": "MIT",
|