@reticlehq/browser 2.13.1 → 3.1.0
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/actions/actions-dom.d.ts +8 -20
- package/dist/actions/actions-dom.js +70 -69
- package/dist/actions/actions-press.d.ts +14 -0
- package/dist/actions/actions-press.js +123 -0
- package/dist/actions/actions.d.ts +1 -89
- package/dist/actions/actions.js +64 -365
- package/dist/actions/appeared-text.d.ts +0 -20
- package/dist/actions/appeared-text.js +6 -36
- package/dist/actions/danger-context.d.ts +3 -0
- package/dist/actions/danger-context.js +39 -0
- package/dist/actions/scroll.d.ts +8 -10
- package/dist/actions/scroll.js +28 -17
- package/dist/actions/synthetic/synthetic-input.d.ts +2 -0
- package/dist/actions/synthetic/synthetic-input.js +13 -0
- package/dist/actions/value-input.d.ts +0 -30
- package/dist/actions/value-input.js +0 -33
- package/dist/commands/commands.d.ts +0 -2
- package/dist/commands/commands.js +10 -70
- package/dist/connect-options.d.ts +2 -96
- package/dist/dom/a11y.d.ts +0 -29
- package/dist/dom/a11y.js +3 -90
- package/dist/dom/addressing/auto-anchor.d.ts +25 -0
- package/dist/dom/addressing/auto-anchor.js +41 -0
- package/dist/dom/addressing/refs.d.ts +14 -0
- package/dist/dom/addressing/refs.js +114 -0
- package/dist/dom/addressing/source.d.ts +9 -0
- package/dist/dom/addressing/source.js +29 -0
- package/dist/dom/chart.d.ts +0 -61
- package/dist/dom/chart.js +0 -60
- package/dist/dom/desktop-capture.d.ts +0 -30
- package/dist/dom/desktop-capture.js +1 -73
- package/dist/dom/dom-ignore.d.ts +0 -30
- package/dist/dom/dom-ignore.js +1 -48
- package/dist/dom/occlusion.d.ts +0 -7
- package/dist/dom/occlusion.js +31 -12
- package/dist/dom/paint-context.d.ts +6 -0
- package/dist/dom/paint-context.js +38 -0
- package/dist/dom/query.d.ts +0 -14
- package/dist/dom/query.js +50 -216
- package/dist/dom/realm.d.ts +0 -20
- package/dist/dom/realm.js +0 -28
- package/dist/dom/shadow-registry.d.ts +0 -33
- package/dist/dom/shadow-registry.js +2 -72
- package/dist/dom/snapshot.d.ts +2 -43
- package/dist/dom/snapshot.js +27 -152
- package/dist/dom/theme.d.ts +0 -37
- package/dist/dom/theme.js +2 -52
- package/dist/dom/virtualized.d.ts +0 -17
- package/dist/dom/virtualized.js +0 -27
- package/dist/edit-epoch.d.ts +1 -23
- package/dist/edit-epoch.js +1 -53
- package/dist/index.d.ts +4 -5
- package/dist/index.js +4 -28
- package/dist/observers/animation.d.ts +0 -1
- package/dist/observers/animation.js +1 -4
- package/dist/observers/blind-spots.d.ts +0 -26
- package/dist/observers/blind-spots.js +3 -62
- package/dist/observers/console.d.ts +1 -2
- package/dist/observers/console.js +41 -30
- package/dist/observers/context-open.d.ts +1 -11
- package/dist/observers/context-open.js +10 -14
- package/dist/observers/departure.d.ts +3 -0
- package/dist/observers/departure.js +52 -0
- package/dist/observers/dialogs.d.ts +2 -0
- package/dist/observers/dialogs.js +39 -0
- package/dist/observers/dom.js +28 -52
- package/dist/observers/download.d.ts +1 -2
- package/dist/observers/download.js +39 -56
- package/dist/observers/focus.d.ts +0 -6
- package/dist/observers/focus.js +0 -7
- package/dist/observers/frames.d.ts +0 -9
- package/dist/observers/frames.js +1 -28
- package/dist/observers/health.d.ts +0 -5
- package/dist/observers/health.js +2 -34
- package/dist/observers/install-all.d.ts +2 -0
- package/dist/observers/install-all.js +26 -27
- package/dist/observers/ipc.d.ts +0 -25
- package/dist/observers/ipc.js +0 -65
- package/dist/observers/navigation.d.ts +2 -0
- package/dist/observers/navigation.js +33 -0
- package/dist/observers/net-detail/network-body.d.ts +12 -0
- package/dist/observers/net-detail/network-body.js +71 -0
- package/dist/observers/net-detail/network-redact.d.ts +1 -0
- package/dist/observers/net-detail/network-redact.js +1 -0
- package/dist/observers/network-stream.d.ts +0 -21
- package/dist/observers/network-stream.js +3 -46
- package/dist/observers/network.d.ts +3 -27
- package/dist/observers/network.js +178 -295
- package/dist/observers/perf.d.ts +0 -10
- package/dist/observers/perf.js +0 -16
- package/dist/observers/route.d.ts +1 -2
- package/dist/observers/route.js +13 -19
- package/dist/observers/scroll.d.ts +0 -1
- package/dist/observers/scroll.js +2 -11
- package/dist/observers/sdk-failure.d.ts +1 -9
- package/dist/observers/sdk-failure.js +1 -30
- package/dist/observers/state.d.ts +1 -11
- package/dist/observers/state.js +13 -41
- package/dist/observers/storage.d.ts +0 -14
- package/dist/observers/storage.js +10 -34
- package/dist/observers/types.d.ts +0 -15
- package/dist/observers/types.js +0 -14
- package/dist/patching/capture-method.d.ts +0 -24
- package/dist/patching/capture-method.js +0 -26
- package/dist/presenter/chrome/layers.d.ts +2 -0
- package/dist/presenter/chrome/layers.js +2 -0
- package/dist/presenter/chrome/log-kinds.d.ts +12 -0
- package/dist/presenter/chrome/log-kinds.js +7 -0
- package/dist/presenter/{overlay.d.ts → chrome/overlay.d.ts} +0 -1
- package/dist/presenter/{overlay.js → chrome/overlay.js} +0 -1
- package/dist/presenter/chrome/presenter-brand.d.ts +3 -0
- package/dist/presenter/{presenter-brand.js → chrome/presenter-brand.js} +0 -21
- package/dist/presenter/chrome/presenter-effects.d.ts +4 -0
- package/dist/presenter/{presenter-effects.js → chrome/presenter-effects.js} +1 -10
- package/dist/presenter/chrome/presenter-hud-chrome.d.ts +7 -0
- package/dist/presenter/{presenter-hud-chrome.js → chrome/presenter-hud-chrome.js} +0 -10
- package/dist/presenter/chrome/presenter-log.d.ts +17 -0
- package/dist/presenter/{presenter-log.js → chrome/presenter-log.js} +5 -54
- package/dist/presenter/chrome/presenter-report-copy.d.ts +51 -0
- package/dist/presenter/chrome/presenter-report-copy.js +95 -0
- package/dist/presenter/chrome/presenter-safe-html.d.ts +2 -0
- package/dist/presenter/chrome/presenter-safe-html.js +16 -0
- package/dist/presenter/{presenter-tally.d.ts → chrome/presenter-tally.d.ts} +0 -5
- package/dist/presenter/{presenter-tally.js → chrome/presenter-tally.js} +1 -5
- package/dist/presenter/{presenter-verbs.js → chrome/presenter-verbs.js} +0 -7
- package/dist/presenter/{presenter-heroicons-data.d.ts → icons/presenter-heroicons-data.d.ts} +1 -8
- package/dist/presenter/{presenter-heroicons-data.js → icons/presenter-heroicons-data.js} +1 -8
- package/dist/presenter/{presenter-icons.d.ts → icons/presenter-icons.d.ts} +1 -6
- package/dist/presenter/{presenter-icons.js → icons/presenter-icons.js} +1 -6
- package/dist/presenter/presenter-account-styles.d.ts +1 -0
- package/dist/presenter/presenter-account-styles.js +99 -0
- package/dist/presenter/presenter-account.d.ts +40 -0
- package/dist/presenter/presenter-account.js +178 -0
- package/dist/presenter/presenter-config.d.ts +10 -107
- package/dist/presenter/presenter-config.js +5 -92
- package/dist/presenter/presenter-controls.d.ts +1 -35
- package/dist/presenter/presenter-controls.js +10 -133
- package/dist/presenter/presenter-dock-layout.d.ts +0 -3
- package/dist/presenter/presenter-dock-layout.js +1 -5
- package/dist/presenter/presenter-drag.d.ts +2 -42
- package/dist/presenter/presenter-drag.js +3 -76
- package/dist/presenter/presenter-glow.d.ts +0 -21
- package/dist/presenter/presenter-glow.js +2 -28
- package/dist/presenter/presenter-hud-position.d.ts +18 -0
- package/dist/presenter/presenter-hud-position.js +50 -0
- package/dist/presenter/presenter-report-styles.d.ts +0 -6
- package/dist/presenter/presenter-report-styles.js +22 -7
- package/dist/presenter/presenter-report.d.ts +5 -7
- package/dist/presenter/presenter-report.js +44 -95
- package/dist/presenter/presenter-run-state.d.ts +1 -8
- package/dist/presenter/presenter-run-state.js +1 -6
- package/dist/presenter/presenter-settings-styles.d.ts +0 -1
- package/dist/presenter/presenter-settings-styles.js +2 -2
- package/dist/presenter/presenter-settings.d.ts +5 -23
- package/dist/presenter/presenter-settings.js +21 -33
- package/dist/presenter/presenter-shell-styles.js +23 -20
- package/dist/presenter/presenter-shell.d.ts +6 -18
- package/dist/presenter/presenter-shell.js +26 -77
- package/dist/presenter/presenter-styles.d.ts +2 -10
- package/dist/presenter/presenter-styles.js +6 -12
- package/dist/presenter/presenter-workspace.d.ts +4 -4
- package/dist/presenter/presenter-workspace.js +30 -10
- package/dist/presenter/presenter.d.ts +3 -63
- package/dist/presenter/presenter.js +29 -132
- package/dist/presenter/tour/tour-view.d.ts +33 -0
- package/dist/presenter/tour/tour-view.js +188 -0
- package/dist/presenter/tour/tour.d.ts +25 -0
- package/dist/presenter/tour/tour.js +245 -0
- package/dist/recorder/recorder-styles.d.ts +0 -6
- package/dist/recorder/recorder-styles.js +0 -6
- package/dist/recorder/recorder.d.ts +0 -34
- package/dist/recorder/recorder.js +6 -49
- package/dist/registry/auto-testids.d.ts +0 -19
- package/dist/registry/auto-testids.js +1 -21
- package/dist/registry/capabilities.d.ts +0 -31
- package/dist/registry/capabilities.js +1 -46
- package/dist/registry/commit-and-signal.d.ts +0 -6
- package/dist/registry/commit-and-signal.js +1 -7
- package/dist/registry/declared-channels.d.ts +2 -0
- package/dist/registry/declared-channels.js +14 -0
- package/dist/registry/declared-platform.d.ts +4 -0
- package/dist/registry/declared-platform.js +34 -0
- package/dist/registry/domains.d.ts +0 -8
- package/dist/registry/domains.js +0 -7
- package/dist/registry/emitter.d.ts +0 -14
- package/dist/registry/emitter.js +1 -11
- package/dist/registry/store-adapters.d.ts +0 -186
- package/dist/registry/store-adapters.js +1 -164
- package/dist/registry/{adapters.d.ts → stores/adapters.d.ts} +0 -10
- package/dist/registry/{adapters.js → stores/adapters.js} +0 -10
- package/dist/registry/stores.d.ts +0 -33
- package/dist/registry/stores.js +1 -60
- package/dist/reticle-presenter-helpers.d.ts +0 -13
- package/dist/reticle-presenter-helpers.js +10 -20
- package/dist/reticle-singleton.d.ts +2 -0
- package/dist/reticle-singleton.js +3 -0
- package/dist/reticle.d.ts +1 -52
- package/dist/reticle.js +115 -180
- package/dist/review/annotator-styles.js +1 -8
- package/dist/review/annotator.d.ts +2 -13
- package/dist/review/annotator.js +2 -42
- package/dist/review/mark-anchor.d.ts +0 -11
- package/dist/review/mark-anchor.js +3 -11
- package/dist/security/serialization.d.ts +0 -20
- package/dist/security/serialization.js +1 -66
- package/dist/session-continuity.d.ts +0 -16
- package/dist/session-continuity.js +1 -20
- package/dist/timers/clock.d.ts +1 -14
- package/dist/timers/clock.js +59 -60
- package/dist/timers/console/native-console.js +5 -0
- package/dist/timers/native/native-timers.d.ts +11 -0
- package/dist/timers/native/native-timers.js +48 -0
- package/dist/transport/transport.d.ts +0 -51
- package/dist/transport/transport.js +5 -131
- package/dist/transport/unreachable-message.d.ts +0 -17
- package/dist/transport/unreachable-message.js +0 -17
- package/dist/util/captured-method.d.ts +0 -35
- package/dist/util/captured-method.js +0 -35
- package/package.json +5 -4
- package/dist/actions/synthetic-input.d.ts +0 -9
- package/dist/actions/synthetic-input.js +0 -40
- package/dist/dom/auto-anchor.d.ts +0 -65
- package/dist/dom/auto-anchor.js +0 -74
- package/dist/dom/refs.d.ts +0 -90
- package/dist/dom/refs.js +0 -245
- package/dist/dom/source.d.ts +0 -53
- package/dist/dom/source.js +0 -74
- package/dist/observers/network-body.d.ts +0 -35
- package/dist/observers/network-body.js +0 -168
- package/dist/observers/network-redact.d.ts +0 -20
- package/dist/observers/network-redact.js +0 -80
- package/dist/presenter/presenter-brand.d.ts +0 -22
- package/dist/presenter/presenter-effects.d.ts +0 -13
- package/dist/presenter/presenter-hud-chrome.d.ts +0 -17
- package/dist/presenter/presenter-log.d.ts +0 -64
- package/dist/presenter/presenter-report-copy.d.ts +0 -112
- package/dist/presenter/presenter-report-copy.js +0 -156
- package/dist/presenter/presenter-test-helpers.d.ts +0 -16
- package/dist/presenter/presenter-test-helpers.js +0 -41
- package/dist/timers/native-console.js +0 -9
- package/dist/timers/native-timers.d.ts +0 -36
- package/dist/timers/native-timers.js +0 -78
- /package/dist/presenter/{presenter-verbs.d.ts → chrome/presenter-verbs.d.ts} +0 -0
- /package/dist/timers/{native-console.d.ts → console/native-console.d.ts} +0 -0
|
@@ -12,7 +12,6 @@ const STYLE = [
|
|
|
12
12
|
'pointer-events:none',
|
|
13
13
|
'opacity:0.85',
|
|
14
14
|
].join(';');
|
|
15
|
-
/** A tiny in-page status chip: connection + event count. Off by default. */
|
|
16
15
|
export function installOverlay() {
|
|
17
16
|
const el = document.createElement('div');
|
|
18
17
|
el.setAttribute('data-reticle-overlay', '');
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The artwork constants are annotated `: string` deliberately.
|
|
3
|
-
*
|
|
4
|
-
* Without the annotation TypeScript infers a literal type, and every one of these SVG and HTML
|
|
5
|
-
* strings is copied verbatim into the emitted `.d.ts` as its own type. That duplicated the artwork
|
|
6
|
-
* into the published package twice over: this file's declarations alone were 16KB of a 900KB
|
|
7
|
-
* budget, carrying type information nobody can use - no caller cares about the literal type of a
|
|
8
|
-
* `<path d=...>`.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Brand marks, inlined. The SDK is bundled into someone else's page: it cannot read
|
|
12
|
-
* `assets/logo/*.svg` from disk at runtime and must never fetch from our own domain, so the mark
|
|
13
|
-
* lives here as a string (same precedent as SEND_ICON in presenter-controls.ts).
|
|
14
|
-
* Minified - editor metadata, clip paths, masks and sub-0.01 precision stripped - and painted
|
|
15
|
-
* with `currentColor` so the mark tracks --reticle-fg instead of hardcoding the export's #FAFAFA.
|
|
16
|
-
*/
|
|
17
|
-
/** Accessible name of the HUD. */
|
|
18
1
|
export const BRAND_NAME = 'Reticle';
|
|
19
|
-
/** The two glyph paths of the mark. */
|
|
20
2
|
const MARK_PATHS = `<path d="M92.82 92.16C93.07 93.4 91.77 94.4 90.63 93.83C89.62 93.33 88.62 92.82 87.63 92.3C71.14 83.78 54.79 72.27 39.61 57.96C39.09 57.49 38.57 56.98 38.06 56.49C22.45 41.52 9.78 25.14 .33 8.52C0.29 8.45 .25 8.38 .2 8.31C-0.44 7.2 .51 5.84 1.79 6.05L24.07 9.71C43.06 12.83 60.63 11.75 75.55 6.53L93.95 .09C95.15-0.33 96.31 .78 95.93 1.98L90.1 20.49C85.37 35.48 84.9 52.97 88.69 71.73L92.83 92.16H92.82Z"/><path d="M58.72 89.23L6.15 92.8C5.24 92.86 4.48 92.13 4.51 91.22L6.56 30.39C6.61 28.91 8.51 28.36 9.35 29.57C16.23 39.43 24.98 52.35 33.01 61.26C41.05 70.17 50.6 78.72 59.62 86.56C60.65 87.45 60.08 89.13 58.72 89.23Z"/>`;
|
|
21
|
-
/** Mark alone (shown in the FAB and compact toolbar). */
|
|
22
3
|
export const MARK_SVG = `<svg class="reticle-mark" viewBox="0 0 96 94" fill="currentColor" aria-hidden="true">${MARK_PATHS}</svg>`;
|
|
23
|
-
/** FAB-sized mark for the collapsed circular control. */
|
|
24
4
|
const FAB_MARK_SVG = `<svg class="reticle-fab-mark" viewBox="0 0 96 94" fill="currentColor" aria-hidden="true">${MARK_PATHS}</svg>`;
|
|
25
|
-
/** Collapsed FAB control - Reticle mark only. */
|
|
26
5
|
export const FAB_TOGGLE_HTML = `<button type="button" class="reticle-fab" data-reticle-fab aria-label="Start ${BRAND_NAME}" aria-expanded="false">${FAB_MARK_SVG}<span class="reticle-fab-pulse" aria-hidden="true"></span><span data-reticle-mark-count class="reticle-fab-badge" hidden>0</span></button>`;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function moveCursor(cursor: HTMLElement | undefined, x: number, y: number): void;
|
|
2
|
+
export declare function ringAround(ring: HTMLElement | undefined, rect: DOMRect): void;
|
|
3
|
+
export declare function spawnRipple(root: HTMLElement | undefined, x: number, y: number): void;
|
|
4
|
+
export declare function pace(ms: number): Promise<void>;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { nativeSetTimeout } from '
|
|
2
|
-
/**
|
|
3
|
-
* Synthetic-cursor + click effects - the visible "the agent is acting here" motion. Pure DOM helpers
|
|
4
|
-
* extracted from presenter.ts so the controller stays under the size cap; each is a no-op when its
|
|
5
|
-
* element is absent (the panel may not be mounted). Behavior is unchanged from the inlined methods.
|
|
6
|
-
*/
|
|
7
|
-
/** Fly the synthetic cursor to a viewport point and show it. */
|
|
1
|
+
import { nativeSetTimeout } from '../../timers/native/native-timers.js';
|
|
8
2
|
export function moveCursor(cursor, x, y) {
|
|
9
3
|
if (cursor === undefined)
|
|
10
4
|
return;
|
|
11
5
|
cursor.setAttribute('data-on', '1');
|
|
12
6
|
cursor.style.transform = `translate(${String(x)}px, ${String(y)}px)`;
|
|
13
7
|
}
|
|
14
|
-
/** Briefly draw the green focus ring around an element's box, then fade it. */
|
|
15
8
|
export function ringAround(ring, rect) {
|
|
16
9
|
if (ring === undefined)
|
|
17
10
|
return;
|
|
@@ -22,7 +15,6 @@ export function ringAround(ring, rect) {
|
|
|
22
15
|
ring.setAttribute('data-on', '1');
|
|
23
16
|
nativeSetTimeout(() => ring.setAttribute('data-on', '0'), 700);
|
|
24
17
|
}
|
|
25
|
-
/** Spawn a one-shot click ripple at a viewport point (self-removing). */
|
|
26
18
|
export function spawnRipple(root, x, y) {
|
|
27
19
|
if (root === undefined)
|
|
28
20
|
return;
|
|
@@ -33,7 +25,6 @@ export function spawnRipple(root, x, y) {
|
|
|
33
25
|
root.appendChild(r);
|
|
34
26
|
nativeSetTimeout(() => r.remove(), 520);
|
|
35
27
|
}
|
|
36
|
-
/** Pace for the human so an action is watchable, not instant. */
|
|
37
28
|
export function pace(ms) {
|
|
38
29
|
return new Promise((res) => nativeSetTimeout(res, ms));
|
|
39
30
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const HUD_SURFACE_CLASS = "reticle-hud-surface";
|
|
2
|
+
export declare const HUD_SURFACE_FILL: string;
|
|
3
|
+
export declare const HUD_SURFACE_PAINT: string;
|
|
4
|
+
export declare const HUD_DROP_SHADOW: string;
|
|
5
|
+
export declare const HUD_CHROME_CSS: string;
|
|
6
|
+
export declare const HUD_LOG_WELL_CLASS = "reticle-hud-log-well";
|
|
7
|
+
export declare const HUD_LOG_WELL_CSS: string;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/** Shared polished-black surfaces used across HUD chrome panels. */
|
|
2
1
|
export const HUD_SURFACE_CLASS = 'reticle-hud-surface';
|
|
3
|
-
/** Layered near-black base — no embedded image assets. */
|
|
4
2
|
export const HUD_SURFACE_FILL = `linear-gradient(165deg,#121218 0%,#09090c 42%,#000 100%)`;
|
|
5
3
|
export const HUD_SURFACE_PAINT = `background:${HUD_SURFACE_FILL};box-shadow:inset 0 1px 0 rgba(255,255,255,.09),0 0 0 1px rgba(255,255,255,.09);`;
|
|
6
4
|
export const HUD_DROP_SHADOW = '0 16px 40px rgba(0,0,0,.58),0 0 0 1px rgba(255,255,255,.08)';
|
|
@@ -18,15 +16,7 @@ export const HUD_CHROME_CSS = `
|
|
|
18
16
|
linear-gradient(180deg,rgba(255,255,255,.035) 0%,transparent 36%,rgba(0,0,0,.12) 100%);
|
|
19
17
|
}
|
|
20
18
|
.${HUD_SURFACE_CLASS} > *{position:relative;z-index:2;}`;
|
|
21
|
-
/** Inset well for the activity log — sits inside the chat card. */
|
|
22
19
|
export const HUD_LOG_WELL_CLASS = 'reticle-hud-log-well';
|
|
23
|
-
/**
|
|
24
|
-
* The activity feed sits ON the panel, not in a black box cut out of it.
|
|
25
|
-
*
|
|
26
|
-
* The inset well was a second surface inside a surface - two borders, two backgrounds - and it made
|
|
27
|
-
* the panel read as a container rather than as one card. It also grew and shrank with its content,
|
|
28
|
-
* so the panel resized on every row; the height is fixed now and the feed scrolls inside it.
|
|
29
|
-
*/
|
|
30
20
|
export const HUD_LOG_WELL_CSS = `
|
|
31
21
|
.${HUD_LOG_WELL_CLASS}{
|
|
32
22
|
/* A settled height, but still allowed to shrink: pinned with flex:none it pushed the composer
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PresenterMode } from '@reticlehq/core';
|
|
2
|
+
import { LOG_KIND, LOG_RESULT, type LogKind, type LogResult } from './log-kinds.js';
|
|
3
|
+
export { LOG_KIND, LOG_RESULT };
|
|
4
|
+
export type { LogKind, LogResult };
|
|
5
|
+
export declare const CHIP_LABEL: Record<PresenterMode, string>;
|
|
6
|
+
export declare const DATA_RETICLE_LOG = "data-reticle-log";
|
|
7
|
+
export declare const LOG_TIME_ATTR = "data-reticle-log-time";
|
|
8
|
+
export declare const LOG_CSS: string;
|
|
9
|
+
export declare function scrollLogToLatest(container: HTMLElement): void;
|
|
10
|
+
export declare function settleLogAtLatest(container: HTMLElement): void;
|
|
11
|
+
export interface LogHandle {
|
|
12
|
+
result(r: LogResult): void;
|
|
13
|
+
}
|
|
14
|
+
export declare function clampLogMax(n: number | undefined): number;
|
|
15
|
+
export declare function humanDuration(ms: number): string;
|
|
16
|
+
export declare function formatElapsed(ms: number): string;
|
|
17
|
+
export declare function appendLogRow(container: HTMLElement, kind: LogKind, text: string, ts: string, logMax: number): LogHandle;
|
|
@@ -1,33 +1,19 @@
|
|
|
1
1
|
import { PresenterMode } from '@reticlehq/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
// every read/act/narration. All strings here are presenter-only UI (chips, glyphs, attrs) - they
|
|
6
|
-
// never cross the browser↔bridge↔agent wire, so they stay as named consts (not protocol consts).
|
|
7
|
-
// All nodes carry data-reticle-* attrs so they're excluded from snapshots (see dom-ignore.ts).
|
|
8
|
-
/** Default cap on accumulated activity-log rows (bounds DOM). Presenter-local UI tunable. */
|
|
2
|
+
import { LOG_KIND, LOG_RESULT } from './log-kinds.js';
|
|
3
|
+
import { nativeSetTimeout } from '../../timers/native/native-timers.js';
|
|
4
|
+
import { PresenterIcon, PRESENTER_ICON_SIZE, hiIcon, } from '../icons/presenter-icons.js';
|
|
9
5
|
const DEFAULT_LOG_MAX = 50;
|
|
10
|
-
|
|
11
|
-
export const LOG_KIND = {
|
|
12
|
-
READ: 'read',
|
|
13
|
-
ACT: 'act',
|
|
14
|
-
NARRATION: 'narration',
|
|
15
|
-
HUMAN: 'human',
|
|
16
|
-
};
|
|
17
|
-
/** Act-row outcome glyph keys (presenter-only UI). */
|
|
18
|
-
export const LOG_RESULT = { PASS: 'pass', FAIL: 'fail' };
|
|
6
|
+
export { LOG_KIND, LOG_RESULT };
|
|
19
7
|
const LOG_CHIP = { read: 'READ', act: 'ACT', narration: '', human: '' };
|
|
20
8
|
const LOG_CHIP_ICON = {
|
|
21
9
|
read: PresenterIcon.VIEW,
|
|
22
10
|
act: PresenterIcon.POINTER,
|
|
23
11
|
};
|
|
24
|
-
/** HUD chip copy keyed by presenter mode (UI text, browser-local - not a wire string). */
|
|
25
12
|
export const CHIP_LABEL = {
|
|
26
13
|
[PresenterMode.IDLE]: '',
|
|
27
14
|
[PresenterMode.READING]: 'READING',
|
|
28
15
|
[PresenterMode.ACTING]: 'ACTING',
|
|
29
16
|
};
|
|
30
|
-
/** Map a log kind to the data-mode that styles its chip (narration/human show no chip). */
|
|
31
17
|
const LOG_CHIP_MODE = {
|
|
32
18
|
read: PresenterMode.READING,
|
|
33
19
|
act: PresenterMode.ACTING,
|
|
@@ -38,21 +24,13 @@ const RESULT_GLYPH = { pass: '', fail: 'Fail' };
|
|
|
38
24
|
const RESULT_CLASS = { pass: 'reticle-pass', fail: 'reticle-fail' };
|
|
39
25
|
export const DATA_RETICLE_LOG = 'data-reticle-log';
|
|
40
26
|
const DATA_RETICLE_LOG_ROW = 'data-reticle-log-row';
|
|
41
|
-
/**
|
|
42
|
-
* The attribute on ONE log line's timestamp. Deliberately not `data-reticle-log-ts`: that name is
|
|
43
|
-
* the overlay-level SETTING (show timestamps y/n) and the overlay root carries it, so a bare
|
|
44
|
-
* `[data-reticle-log-ts]{opacity:.85}` here matched the overlay itself and made the entire HUD -
|
|
45
|
-
* chat panel included - 85% transparent, with the page legible straight through it.
|
|
46
|
-
*/
|
|
47
27
|
export const LOG_TIME_ATTR = 'data-reticle-log-time';
|
|
48
28
|
const DATA_KIND = 'data-kind';
|
|
49
29
|
const LOG_TEXT_CLASS = 'reticle-log-text';
|
|
50
30
|
const LOG_RES_CLASS = 'reticle-res';
|
|
51
31
|
const LOG_CHIP_CLASS = 'reticle-chip';
|
|
52
32
|
const LOG_EMPTY_HINT = 'Agent activity will appear here';
|
|
53
|
-
/** How long to keep re-pinning the feed after the panel opens, while rows render their real size. */
|
|
54
33
|
const LOG_SETTLE_MS = 160;
|
|
55
|
-
/** CSS for the log feed (injected with the rest of the presenter stylesheet; vars inherit from the card). */
|
|
56
34
|
export const LOG_CSS = `
|
|
57
35
|
[data-reticle-log]{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;pointer-events:auto;touch-action:pan-y;
|
|
58
36
|
display:flex;flex-direction:column;
|
|
@@ -92,24 +70,9 @@ export const LOG_CSS = `
|
|
|
92
70
|
border-radius:16px 16px 4px 16px;box-shadow:inset 0 1px 0 rgba(255,255,255,.08);}
|
|
93
71
|
[data-reticle-log-row][data-kind="human"] .reticle-log-text{color:var(--reticle-fg);font-size:12px;line-height:1.45;}
|
|
94
72
|
`;
|
|
95
|
-
/**
|
|
96
|
-
* Pin the feed to its newest row.
|
|
97
|
-
*
|
|
98
|
-
* Called on append AND when the chat is opened, because a hidden panel has no layout: rows added
|
|
99
|
-
* while it was minimised could not scroll it, so opening it showed the OLDEST row and the latest
|
|
100
|
-
* activity - the reason to open it - was somewhere below the fold.
|
|
101
|
-
*/
|
|
102
73
|
export function scrollLogToLatest(container) {
|
|
103
74
|
container.scrollTop = container.scrollHeight;
|
|
104
75
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Pin the feed to its newest row once the panel has actually laid out.
|
|
107
|
-
*
|
|
108
|
-
* A single frame is not enough on open: the rows carry `content-visibility:auto`, so their real
|
|
109
|
-
* heights arrive after the first paint and `scrollHeight` keeps growing under a scroll that has
|
|
110
|
-
* already happened - the feed landed a third of the way down instead of at the end. Two frames
|
|
111
|
-
* plus one settle pass costs nothing and lands on the last row.
|
|
112
|
-
*/
|
|
113
76
|
export function settleLogAtLatest(container) {
|
|
114
77
|
scrollLogToLatest(container);
|
|
115
78
|
requestAnimationFrame(() => {
|
|
@@ -118,17 +81,11 @@ export function settleLogAtLatest(container) {
|
|
|
118
81
|
});
|
|
119
82
|
nativeSetTimeout(() => scrollLogToLatest(container), LOG_SETTLE_MS);
|
|
120
83
|
}
|
|
121
|
-
/** Clamp a logMax option to a sane positive integer, falling back to the default. */
|
|
122
84
|
export function clampLogMax(n) {
|
|
123
85
|
if (n === undefined || !Number.isFinite(n) || n <= 0)
|
|
124
86
|
return DEFAULT_LOG_MAX;
|
|
125
87
|
return Math.floor(n);
|
|
126
88
|
}
|
|
127
|
-
/**
|
|
128
|
-
* Pure, human-readable duration ("3s", "47s", "2m", "1h 4m") - no clock read, so it stays
|
|
129
|
-
* deterministic in tests. Used for both the per-row timestamp (time since session start) and the
|
|
130
|
-
* live "idle · {duration} since last action" heartbeat. Sub-second reads as "0s".
|
|
131
|
-
*/
|
|
132
89
|
export function humanDuration(ms) {
|
|
133
90
|
const s = Math.max(0, Math.floor(ms / 1000));
|
|
134
91
|
if (s < 60)
|
|
@@ -139,19 +96,13 @@ export function humanDuration(ms) {
|
|
|
139
96
|
const h = Math.floor(m / 60);
|
|
140
97
|
return 0 === m % 60 ? `${h}h` : `${h}h ${m % 60}m`;
|
|
141
98
|
}
|
|
142
|
-
/** Per-row timestamp: time since the session's first row, human-readable (e.g. "2m", not "+132.4s"). */
|
|
143
99
|
export function formatElapsed(ms) {
|
|
144
100
|
return humanDuration(ms);
|
|
145
101
|
}
|
|
146
|
-
/**
|
|
147
|
-
* Build a log row from text (already trimmed) + a +elapsed timestamp, append it to the container,
|
|
148
|
-
* prune to logMax, auto-scroll to newest, and return a handle to stamp the outcome glyph later.
|
|
149
|
-
* Uses createElement/textContent (never innerHTML) so arbitrary narration text can't inject markup.
|
|
150
|
-
*/
|
|
151
102
|
export function appendLogRow(container, kind, text, ts, logMax) {
|
|
152
103
|
const row = document.createElement('div');
|
|
153
104
|
row.setAttribute(DATA_RETICLE_LOG_ROW, '');
|
|
154
|
-
row.setAttribute(DATA_KIND, kind);
|
|
105
|
+
row.setAttribute(DATA_KIND, kind);
|
|
155
106
|
const tsEl = document.createElement('span');
|
|
156
107
|
tsEl.setAttribute(LOG_TIME_ATTR, '');
|
|
157
108
|
tsEl.textContent = ts;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ImpactScope, type ImpactSnapshot } from '@reticlehq/core';
|
|
2
|
+
export declare const REPORT_LINKS: {
|
|
3
|
+
readonly DOCS: "https://docs.reticle.sh";
|
|
4
|
+
readonly SITE: "https://reticle.sh";
|
|
5
|
+
readonly GITHUB: "https://github.com/reticlehq/reticle";
|
|
6
|
+
readonly DISCORD: "https://discord.gg/BwAbzv9ZRz";
|
|
7
|
+
};
|
|
8
|
+
export declare const SHARE_VIA_HANDLE = "";
|
|
9
|
+
export declare const REPORT_TEXT: {
|
|
10
|
+
readonly TITLE: "Impact";
|
|
11
|
+
readonly PROJECT: "This project";
|
|
12
|
+
readonly GLOBAL: "Everything on this machine";
|
|
13
|
+
readonly HERO_DEFECTS: "checks Reticle refused to pass";
|
|
14
|
+
readonly VERDICTS: "Verdicts";
|
|
15
|
+
readonly PASSED: "passed";
|
|
16
|
+
readonly FAILED: "failed";
|
|
17
|
+
readonly UNKNOWN: "unknown";
|
|
18
|
+
readonly UNKNOWN_HELP: "Reticle drove the app and could not tell what happened. Not a pass - shown, not hidden.";
|
|
19
|
+
readonly CALLS: "Tool calls";
|
|
20
|
+
readonly TOKENS: "Tokens returned";
|
|
21
|
+
readonly DRIVING: "Time driving";
|
|
22
|
+
readonly SESSIONS: "Sessions";
|
|
23
|
+
readonly STREAK: "day streak";
|
|
24
|
+
readonly LONGEST: "Longest run";
|
|
25
|
+
readonly SAVED_TOKENS: "Tokens saved";
|
|
26
|
+
readonly SAVED_MINUTES: "Time saved";
|
|
27
|
+
readonly ESTIMATE_TAG: "estimate";
|
|
28
|
+
readonly CHART: "Verdicts, last 30 days";
|
|
29
|
+
readonly DEFECTS: "What broke";
|
|
30
|
+
readonly DEFECTS_MORE: "Manage all of them on the dashboard — triage, assign, and push to GitHub";
|
|
31
|
+
readonly DEFECT_LINK_TITLE: "Open on the dashboard to triage or push to GitHub";
|
|
32
|
+
readonly LOCAL_ONLY: "This record stops at this machine.";
|
|
33
|
+
readonly LOCAL_ONLY_ACTION: "reticle login";
|
|
34
|
+
readonly LOCAL_ONLY_TAIL: "keeps it, and lets a team see it.";
|
|
35
|
+
readonly UNLINKED: "Signed in, but this repo is not linked.";
|
|
36
|
+
readonly UNLINKED_ACTION: "reticle link";
|
|
37
|
+
readonly UNLINKED_TAIL: "sends this record to your workspace.";
|
|
38
|
+
readonly DEFECTS_NONE: "Nothing has failed a declared consequence yet.";
|
|
39
|
+
readonly EMPTY: "Nothing recorded yet. Drive the app once and this fills in.";
|
|
40
|
+
readonly SHARE: "Share";
|
|
41
|
+
readonly COPY: "Copy";
|
|
42
|
+
readonly COPIED: "Copied";
|
|
43
|
+
readonly REFER: "Send to a friend";
|
|
44
|
+
};
|
|
45
|
+
export declare function compactNumber(n: number): string;
|
|
46
|
+
export declare function compactDuration(ms: number): string;
|
|
47
|
+
export declare function buildShareText(scope: ImpactScope, projectName?: string): string;
|
|
48
|
+
export declare function buildXShareUrl(text: string): string;
|
|
49
|
+
export declare function buildLinkedInShareUrl(): string;
|
|
50
|
+
export declare function buildReferralText(): string;
|
|
51
|
+
export declare function parseImpactSnapshot(value: unknown): ImpactSnapshot | undefined;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ImpactSnapshotSchema } from '@reticlehq/core';
|
|
2
|
+
export const REPORT_LINKS = {
|
|
3
|
+
DOCS: 'https://docs.reticle.sh',
|
|
4
|
+
SITE: 'https://reticle.sh',
|
|
5
|
+
GITHUB: 'https://github.com/reticlehq/reticle',
|
|
6
|
+
DISCORD: 'https://discord.gg/BwAbzv9ZRz',
|
|
7
|
+
};
|
|
8
|
+
export const SHARE_VIA_HANDLE = '';
|
|
9
|
+
export const REPORT_TEXT = {
|
|
10
|
+
TITLE: 'Impact',
|
|
11
|
+
PROJECT: 'This project',
|
|
12
|
+
GLOBAL: 'Everything on this machine',
|
|
13
|
+
HERO_DEFECTS: 'checks Reticle refused to pass',
|
|
14
|
+
VERDICTS: 'Verdicts',
|
|
15
|
+
PASSED: 'passed',
|
|
16
|
+
FAILED: 'failed',
|
|
17
|
+
UNKNOWN: 'unknown',
|
|
18
|
+
UNKNOWN_HELP: 'Reticle drove the app and could not tell what happened. Not a pass - shown, not hidden.',
|
|
19
|
+
CALLS: 'Tool calls',
|
|
20
|
+
TOKENS: 'Tokens returned',
|
|
21
|
+
DRIVING: 'Time driving',
|
|
22
|
+
SESSIONS: 'Sessions',
|
|
23
|
+
STREAK: 'day streak',
|
|
24
|
+
LONGEST: 'Longest run',
|
|
25
|
+
SAVED_TOKENS: 'Tokens saved',
|
|
26
|
+
SAVED_MINUTES: 'Time saved',
|
|
27
|
+
ESTIMATE_TAG: 'estimate',
|
|
28
|
+
CHART: 'Verdicts, last 30 days',
|
|
29
|
+
DEFECTS: 'What broke',
|
|
30
|
+
DEFECTS_MORE: 'Manage all of them on the dashboard — triage, assign, and push to GitHub',
|
|
31
|
+
DEFECT_LINK_TITLE: 'Open on the dashboard to triage or push to GitHub',
|
|
32
|
+
LOCAL_ONLY: 'This record stops at this machine.',
|
|
33
|
+
LOCAL_ONLY_ACTION: 'reticle login',
|
|
34
|
+
LOCAL_ONLY_TAIL: 'keeps it, and lets a team see it.',
|
|
35
|
+
UNLINKED: 'Signed in, but this repo is not linked.',
|
|
36
|
+
UNLINKED_ACTION: 'reticle link',
|
|
37
|
+
UNLINKED_TAIL: 'sends this record to your workspace.',
|
|
38
|
+
DEFECTS_NONE: 'Nothing has failed a declared consequence yet.',
|
|
39
|
+
EMPTY: 'Nothing recorded yet. Drive the app once and this fills in.',
|
|
40
|
+
SHARE: 'Share',
|
|
41
|
+
COPY: 'Copy',
|
|
42
|
+
COPIED: 'Copied',
|
|
43
|
+
REFER: 'Send to a friend',
|
|
44
|
+
};
|
|
45
|
+
export function compactNumber(n) {
|
|
46
|
+
if (n < 1000)
|
|
47
|
+
return String(Math.round(n));
|
|
48
|
+
if (n < 1_000_000)
|
|
49
|
+
return `${trim(n / 1000)}k`;
|
|
50
|
+
return `${trim(n / 1_000_000)}M`;
|
|
51
|
+
}
|
|
52
|
+
function trim(n) {
|
|
53
|
+
return n >= 10 ? String(Math.round(n)) : String(Math.round(n * 10) / 10);
|
|
54
|
+
}
|
|
55
|
+
export function compactDuration(ms) {
|
|
56
|
+
const s = Math.floor(ms / 1000);
|
|
57
|
+
if (s < 60)
|
|
58
|
+
return `${String(s)}s`;
|
|
59
|
+
const m = Math.floor(s / 60);
|
|
60
|
+
if (m < 60)
|
|
61
|
+
return `${String(m)}m`;
|
|
62
|
+
const h = Math.floor(m / 60);
|
|
63
|
+
return 0 === m % 60 ? `${String(h)}h` : `${String(h)}h ${String(m % 60)}m`;
|
|
64
|
+
}
|
|
65
|
+
export function buildShareText(scope, projectName) {
|
|
66
|
+
const c = scope.counts;
|
|
67
|
+
const where = projectName !== undefined && projectName.length > 0 ? ` on ${projectName}` : '';
|
|
68
|
+
const lines = [
|
|
69
|
+
`My agent verified its own work ${String(c.verdicts)} times${where}.`,
|
|
70
|
+
`${String(c.failed)} checks it refused to pass before I looked at any of them.`,
|
|
71
|
+
];
|
|
72
|
+
if (c.unknown > 0) {
|
|
73
|
+
lines.push(`${String(c.unknown)} came back "unknown" - it drove the app and could not tell. That is the number I watch.`);
|
|
74
|
+
}
|
|
75
|
+
if (scope.records.longestRunMs > 0) {
|
|
76
|
+
lines.push(`Longest unattended run: ${compactDuration(scope.records.longestRunMs)}.`);
|
|
77
|
+
}
|
|
78
|
+
return lines.join('\n');
|
|
79
|
+
}
|
|
80
|
+
export function buildXShareUrl(text) {
|
|
81
|
+
const params = new URLSearchParams({ text, url: REPORT_LINKS.SITE });
|
|
82
|
+
if (SHARE_VIA_HANDLE.length > 0)
|
|
83
|
+
params.set('via', SHARE_VIA_HANDLE);
|
|
84
|
+
return `https://twitter.com/intent/tweet?${params.toString()}`;
|
|
85
|
+
}
|
|
86
|
+
export function buildLinkedInShareUrl() {
|
|
87
|
+
return `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(REPORT_LINKS.SITE)}`;
|
|
88
|
+
}
|
|
89
|
+
export function buildReferralText() {
|
|
90
|
+
return `I have been verifying my agent's work from inside the running app with Reticle - it returns pass/fail with the file:line to fix. ${REPORT_LINKS.SITE}`;
|
|
91
|
+
}
|
|
92
|
+
export function parseImpactSnapshot(value) {
|
|
93
|
+
const parsed = ImpactSnapshotSchema.safeParse(value);
|
|
94
|
+
return parsed.success ? parsed.data : undefined;
|
|
95
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function esc(value) {
|
|
2
|
+
return value
|
|
3
|
+
.replace(/&/g, '&')
|
|
4
|
+
.replace(/</g, '<')
|
|
5
|
+
.replace(/>/g, '>')
|
|
6
|
+
.replace(/"/g, '"');
|
|
7
|
+
}
|
|
8
|
+
export function isSafeDashboardUrl(raw) {
|
|
9
|
+
try {
|
|
10
|
+
const scheme = new URL(raw).protocol;
|
|
11
|
+
return 'https:' === scheme || 'http:' === scheme;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { type LogResult } from './presenter-log.js';
|
|
2
|
-
/**
|
|
3
|
-
* Paint the live verdict tally into a YouTube-style segmented pill (pass | fail).
|
|
4
|
-
*/
|
|
5
2
|
export declare function renderTally(el: HTMLElement | undefined, runLog: {
|
|
6
3
|
result?: LogResult;
|
|
7
4
|
}[], prev: TallyCounts): TallyCounts;
|
|
8
|
-
/** Running verdict counts the header tally shows - the testing score the human watches grow. */
|
|
9
5
|
export interface TallyCounts {
|
|
10
6
|
passes: number;
|
|
11
7
|
fails: number;
|
|
12
8
|
}
|
|
13
|
-
/** Count pass/fail verdicts across the run log. Pure - no DOM, unit-testable. */
|
|
14
9
|
export declare function countVerdicts(runLog: {
|
|
15
10
|
result?: LogResult;
|
|
16
11
|
}[]): TallyCounts;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { LOG_RESULT } from './presenter-log.js';
|
|
2
|
-
import { PresenterIcon, PRESENTER_ICON_SIZE, hiIcon } from '
|
|
3
|
-
/**
|
|
4
|
-
* Paint the live verdict tally into a YouTube-style segmented pill (pass | fail).
|
|
5
|
-
*/
|
|
2
|
+
import { PresenterIcon, PRESENTER_ICON_SIZE, hiIcon } from '../icons/presenter-icons.js';
|
|
6
3
|
export function renderTally(el, runLog, prev) {
|
|
7
4
|
const next = countVerdicts(runLog);
|
|
8
5
|
if (el === undefined)
|
|
@@ -48,7 +45,6 @@ export function renderTally(el, runLog, prev) {
|
|
|
48
45
|
el.append(pass, sep, fail);
|
|
49
46
|
return next;
|
|
50
47
|
}
|
|
51
|
-
/** Count pass/fail verdicts across the run log. Pure - no DOM, unit-testable. */
|
|
52
48
|
export function countVerdicts(runLog) {
|
|
53
49
|
let passes = 0;
|
|
54
50
|
let fails = 0;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
// Present-tense verb for an action label in the presenter HUD (cursor status + act-log row).
|
|
2
|
-
// Presenter-only UI copy - never a wire string. Shared by presenter.ts (cursor) and reticle.ts
|
|
3
|
-
// (act-log row) so the two stay in lockstep.
|
|
4
|
-
//
|
|
5
|
-
// The CASES are wire values though, and they are core's ActionType. Spelled as free strings here,
|
|
6
|
-
// a rename in core left this switch silently falling through to `default` - which returns the raw
|
|
7
|
-
// action name, so the HUD degrades to "webmcp Save" instead of a verb and nothing fails.
|
|
8
1
|
import { ActionType } from '@reticlehq/core';
|
|
9
2
|
export function actionVerb(action) {
|
|
10
3
|
switch (action) {
|
package/dist/presenter/{presenter-heroicons-data.d.ts → icons/presenter-heroicons-data.d.ts}
RENAMED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** Generated by scripts/embed-heroicons.mjs - do not edit by hand. */
|
|
2
|
-
/** Heroicons outline - MIT, https://heroicons.com */
|
|
3
1
|
declare const BODIES: {
|
|
4
2
|
view: string;
|
|
5
3
|
pointer: string;
|
|
@@ -20,15 +18,10 @@ declare const BODIES: {
|
|
|
20
18
|
help: string;
|
|
21
19
|
'caret-right': string;
|
|
22
20
|
annotate: string;
|
|
21
|
+
sync: string;
|
|
23
22
|
};
|
|
24
|
-
/**
|
|
25
|
-
* No `as const` on the values: it would inline every icon's path data into the emitted `.d.ts` as a
|
|
26
|
-
* literal type, publishing the whole icon set twice for type information no caller can use. The KEYS
|
|
27
|
-
* are still literal, which is the part `HeroIconBodyKey` needs.
|
|
28
|
-
*/
|
|
29
23
|
export declare const HERO_ICON_BODIES: Record<keyof typeof BODIES, string>;
|
|
30
24
|
export type HeroIconBodyKey = keyof typeof BODIES;
|
|
31
|
-
/** Solid variants for toolbar toggles - shown when data-active="1". */
|
|
32
25
|
declare const SOLID_BODIES: {
|
|
33
26
|
chart: string;
|
|
34
27
|
annotate: string;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** Generated by scripts/embed-heroicons.mjs - do not edit by hand. */
|
|
2
|
-
/** Heroicons outline - MIT, https://heroicons.com */
|
|
3
1
|
const BODIES = {
|
|
4
2
|
view: '<g><path d="M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0"/><path d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7s-8.268-2.943-9.542-7"/></g>',
|
|
5
3
|
pointer: '<path d="M15.042 21.672L13.684 16.6m0 0l-2.51 2.225l.569-9.47l5.227 7.917l-3.286-.672ZM12 2.25V4.5m5.834.166l-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243l-1.59-1.59"/>',
|
|
@@ -20,14 +18,9 @@ const BODIES = {
|
|
|
20
18
|
help: '<path d="M8.228 9c.549-1.165 2.03-2 3.772-2c2.21 0 4 1.343 4 3c0 1.4-1.278 2.575-3.006 2.907c-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0"/>',
|
|
21
19
|
'caret-right': '<path d="m9 5l7 7l-7 7"/>',
|
|
22
20
|
annotate: '<path d="m16.862 4.487l1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"/>',
|
|
21
|
+
sync: '<path d="M4.5 12c0-1.232.046-2.453.138-3.662a4.006 4.006 0 0 1 3.7-3.7a48.678 48.678 0 0 1 7.324 0a4.006 4.006 0 0 1 3.7 3.7c.017.22.032.441.046.662M4.5 12l-3-3m3 3l3-3m12 3c0 1.232-.046 2.453-.138 3.662a4.006 4.006 0 0 1-3.7 3.7a48.657 48.657 0 0 1-7.324 0a4.006 4.006 0 0 1-3.7-3.7c-.017-.22-.032-.441-.046-.662M19.5 12l-3 3m3-3l3 3"/>',
|
|
23
22
|
};
|
|
24
|
-
/**
|
|
25
|
-
* No `as const` on the values: it would inline every icon's path data into the emitted `.d.ts` as a
|
|
26
|
-
* literal type, publishing the whole icon set twice for type information no caller can use. The KEYS
|
|
27
|
-
* are still literal, which is the part `HeroIconBodyKey` needs.
|
|
28
|
-
*/
|
|
29
23
|
export const HERO_ICON_BODIES = BODIES;
|
|
30
|
-
/** Solid variants for toolbar toggles - shown when data-active="1". */
|
|
31
24
|
const SOLID_BODIES = {
|
|
32
25
|
chart: '<path fill="currentColor" d="M2 11a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1zm6-4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1zm6-3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z"/>',
|
|
33
26
|
annotate: '<path fill="currentColor" fill-rule="evenodd" d="m5.433 13.916l1.262-3.154a4 4 0 0 1 .885-1.343L14.5 2.5a2.121 2.121 0 1 1 3 3l-6.92 6.919c-.383.383-.84.684-1.343.885l-3.154 1.262a.5.5 0 0 1-.65-.65ZM2.5 5.75c0-.69.56-1.25 1.25-1.25H10A.75.75 0 0 0 10 3H3.75A2.75 2.75 0 0 0 1 5.75v10.5A2.75 2.75 0 0 0 3.75 19h10.5A2.75 2.75 0 0 0 17 16.25V10a.75.75 0 0 0-1.5 0v6.25c0 .69-.56 1.25-1.25 1.25H3.75c-.69 0-1.25-.56-1.25-1.25V5.75Z" clip-rule="evenodd"/>',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type HeroIconBodyKey, type HeroIconSolidBodyKey } from './presenter-heroicons-data.js';
|
|
2
|
-
/** Presenter icon keys used by the HUD. */
|
|
3
2
|
export declare const PresenterIcon: {
|
|
4
3
|
readonly VIEW: "view";
|
|
5
4
|
readonly POINTER: "pointer";
|
|
@@ -20,9 +19,9 @@ export declare const PresenterIcon: {
|
|
|
20
19
|
readonly HELP: "help";
|
|
21
20
|
readonly CARET_RIGHT: "caret-right";
|
|
22
21
|
readonly ANNOTATE: "annotate";
|
|
22
|
+
readonly SYNC: "sync";
|
|
23
23
|
};
|
|
24
24
|
export type PresenterIconName = (typeof PresenterIcon)[keyof typeof PresenterIcon];
|
|
25
|
-
/** Shared HUD icon sizes (px) - one knob for visual density. */
|
|
26
25
|
export declare const PRESENTER_ICON_SIZE: {
|
|
27
26
|
readonly CHIP: 11;
|
|
28
27
|
readonly LOG: 11;
|
|
@@ -34,11 +33,7 @@ export declare const PRESENTER_ICON_SIZE: {
|
|
|
34
33
|
readonly TOOLBAR: 18;
|
|
35
34
|
readonly FAB: 22;
|
|
36
35
|
};
|
|
37
|
-
/** Create an inline Heroicons outline SVG (24px grid, currentColor stroke). */
|
|
38
36
|
export declare function hiIcon(name: HeroIconBodyKey, sizePx?: number): HTMLSpanElement;
|
|
39
|
-
/** Replace a parent's children with a Heroicon. */
|
|
40
37
|
export declare function setHiIcon(parent: HTMLElement, name: HeroIconBodyKey, sizePx?: number): void;
|
|
41
|
-
/** Inline SVG markup for static HUD templates - survives mount order and dep-cache staleness. */
|
|
42
38
|
export declare function hiIconHtml(name: HeroIconBodyKey, sizePx?: number): string;
|
|
43
|
-
/** Outline + solid pair for toolbar toggles - solid layer shows when the button is active. */
|
|
44
39
|
export declare function hiToggleIconHtml(name: HeroIconSolidBodyKey, sizePx?: number): string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HERO_ICON_BODIES, HERO_ICON_SOLID_BODIES, } from './presenter-heroicons-data.js';
|
|
2
|
-
/** Presenter icon keys used by the HUD. */
|
|
3
2
|
export const PresenterIcon = {
|
|
4
3
|
VIEW: 'view',
|
|
5
4
|
POINTER: 'pointer',
|
|
@@ -20,8 +19,8 @@ export const PresenterIcon = {
|
|
|
20
19
|
HELP: 'help',
|
|
21
20
|
CARET_RIGHT: 'caret-right',
|
|
22
21
|
ANNOTATE: 'annotate',
|
|
22
|
+
SYNC: 'sync',
|
|
23
23
|
};
|
|
24
|
-
/** Shared HUD icon sizes (px) - one knob for visual density. */
|
|
25
24
|
export const PRESENTER_ICON_SIZE = {
|
|
26
25
|
CHIP: 11,
|
|
27
26
|
LOG: 11,
|
|
@@ -61,7 +60,6 @@ function buildSvg(name, sizePx) {
|
|
|
61
60
|
svgCache.set(cacheKey, svg);
|
|
62
61
|
return document.importNode(svg, true);
|
|
63
62
|
}
|
|
64
|
-
/** Create an inline Heroicons outline SVG (24px grid, currentColor stroke). */
|
|
65
63
|
export function hiIcon(name, sizePx = 16) {
|
|
66
64
|
const wrap = document.createElement('span');
|
|
67
65
|
wrap.className = 'reticle-hi-icon';
|
|
@@ -71,11 +69,9 @@ export function hiIcon(name, sizePx = 16) {
|
|
|
71
69
|
wrap.appendChild(buildSvg(name, sizePx));
|
|
72
70
|
return wrap;
|
|
73
71
|
}
|
|
74
|
-
/** Replace a parent's children with a Heroicon. */
|
|
75
72
|
export function setHiIcon(parent, name, sizePx = 16) {
|
|
76
73
|
parent.replaceChildren(hiIcon(name, sizePx));
|
|
77
74
|
}
|
|
78
|
-
/** Inline SVG markup for static HUD templates - survives mount order and dep-cache staleness. */
|
|
79
75
|
export function hiIconHtml(name, sizePx = 16) {
|
|
80
76
|
const body = HERO_ICON_BODIES[name];
|
|
81
77
|
if (body === undefined) {
|
|
@@ -83,7 +79,6 @@ export function hiIconHtml(name, sizePx = 16) {
|
|
|
83
79
|
}
|
|
84
80
|
return `<span class="reticle-hi-icon" aria-hidden="true" style="width:${String(sizePx)}px;height:${String(sizePx)}px"><svg xmlns="${SVG_NS}" viewBox="${HERO_VIEWBOX}" width="${String(sizePx)}" height="${String(sizePx)}" fill="none">${body}</svg></span>`;
|
|
85
81
|
}
|
|
86
|
-
/** Outline + solid pair for toolbar toggles - solid layer shows when the button is active. */
|
|
87
82
|
export function hiToggleIconHtml(name, sizePx = 16) {
|
|
88
83
|
const outline = HERO_ICON_BODIES[name];
|
|
89
84
|
const solid = HERO_ICON_SOLID_BODIES[name];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ACCOUNT_CSS: string;
|