@h-rig/cli 0.0.6-alpha.89 → 0.0.6-alpha.90
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/bin/build-rig-binaries.js +8 -40
- package/dist/bin/rig.js +12519 -26675
- package/dist/src/app/board.js +74 -693
- package/dist/src/app/drone-ui.js +1 -1
- package/dist/src/app/theme.js +0 -1
- package/dist/src/commands/_async-ui.js +1 -1
- package/dist/src/commands/_authority-runs.d.ts +1 -1
- package/dist/src/commands/_authority-runs.js +12 -2
- package/dist/src/commands/_cli-format.d.ts +1 -10
- package/dist/src/commands/_cli-format.js +2 -5
- package/dist/src/commands/_connection-state.d.ts +1 -11
- package/dist/src/commands/_connection-state.js +5 -50
- package/dist/src/commands/_doctor-checks.js +40 -501
- package/dist/src/commands/_help-catalog.js +17 -99
- package/dist/src/commands/_json-output.js +0 -4
- package/dist/src/commands/_operator-view.js +54 -575
- package/dist/src/commands/_pi-frontend.d.ts +0 -27
- package/dist/src/commands/_pi-frontend.js +52 -576
- package/dist/src/commands/_preflight.js +66 -553
- package/dist/src/commands/_server-client.d.ts +0 -33
- package/dist/src/commands/_server-client.js +46 -541
- package/dist/src/commands/_snapshot-upload.js +42 -503
- package/dist/src/commands/_spinner.js +1 -1
- package/dist/src/commands/agent.js +12 -2
- package/dist/src/commands/browser.js +1 -1
- package/dist/src/commands/connect.js +15 -626
- package/dist/src/commands/doctor.js +41 -502
- package/dist/src/commands/github.js +51 -584
- package/dist/src/commands/inbox.js +41 -502
- package/dist/src/commands/init.js +74 -561
- package/dist/src/commands/inspect.js +41 -502
- package/dist/src/commands/run.js +54 -578
- package/dist/src/commands/server.js +163 -692
- package/dist/src/commands/setup.js +46 -507
- package/dist/src/commands/stats.js +58 -601
- package/dist/src/commands/task-run-driver.js +58 -509
- package/dist/src/commands/task.js +110 -729
- package/dist/src/commands.js +237 -1112
- package/dist/src/index.js +244 -1123
- package/dist/src/launcher.js +0 -4
- package/package.json +9 -13
- package/dist/src/app-opentui/adapters/command.d.ts +0 -2
- package/dist/src/app-opentui/adapters/command.js +0 -329
- package/dist/src/app-opentui/adapters/common.d.ts +0 -56
- package/dist/src/app-opentui/adapters/common.js +0 -153
- package/dist/src/app-opentui/adapters/doctor.d.ts +0 -9
- package/dist/src/app-opentui/adapters/doctor.js +0 -1217
- package/dist/src/app-opentui/adapters/family.d.ts +0 -62
- package/dist/src/app-opentui/adapters/family.js +0 -14855
- package/dist/src/app-opentui/adapters/fleet.d.ts +0 -14
- package/dist/src/app-opentui/adapters/fleet.js +0 -1335
- package/dist/src/app-opentui/adapters/inbox.d.ts +0 -43
- package/dist/src/app-opentui/adapters/inbox.js +0 -1944
- package/dist/src/app-opentui/adapters/init.d.ts +0 -11
- package/dist/src/app-opentui/adapters/init.js +0 -2818
- package/dist/src/app-opentui/adapters/inspect.d.ts +0 -52
- package/dist/src/app-opentui/adapters/inspect.js +0 -1455
- package/dist/src/app-opentui/adapters/pi-attach.d.ts +0 -32
- package/dist/src/app-opentui/adapters/pi-attach.js +0 -2101
- package/dist/src/app-opentui/adapters/pi.d.ts +0 -23
- package/dist/src/app-opentui/adapters/pi.js +0 -363
- package/dist/src/app-opentui/adapters/plugin.d.ts +0 -84
- package/dist/src/app-opentui/adapters/plugin.js +0 -544
- package/dist/src/app-opentui/adapters/repo.d.ts +0 -37
- package/dist/src/app-opentui/adapters/repo.js +0 -186
- package/dist/src/app-opentui/adapters/run-detail.d.ts +0 -27
- package/dist/src/app-opentui/adapters/run-detail.js +0 -1441
- package/dist/src/app-opentui/adapters/server.d.ts +0 -48
- package/dist/src/app-opentui/adapters/server.js +0 -1561
- package/dist/src/app-opentui/adapters/tasks.d.ts +0 -64
- package/dist/src/app-opentui/adapters/tasks.js +0 -4524
- package/dist/src/app-opentui/adapters/workspace.d.ts +0 -49
- package/dist/src/app-opentui/adapters/workspace.js +0 -333
- package/dist/src/app-opentui/autocomplete.d.ts +0 -20
- package/dist/src/app-opentui/autocomplete.js +0 -578
- package/dist/src/app-opentui/bootstrap.d.ts +0 -11
- package/dist/src/app-opentui/bootstrap.js +0 -27833
- package/dist/src/app-opentui/command-palette.d.ts +0 -3
- package/dist/src/app-opentui/command-palette.js +0 -1038
- package/dist/src/app-opentui/command-pty-host.d.ts +0 -62
- package/dist/src/app-opentui/command-pty-host.js +0 -248
- package/dist/src/app-opentui/drone.d.ts +0 -12
- package/dist/src/app-opentui/drone.js +0 -230
- package/dist/src/app-opentui/events.d.ts +0 -7
- package/dist/src/app-opentui/events.js +0 -28
- package/dist/src/app-opentui/fleet-stats.d.ts +0 -32
- package/dist/src/app-opentui/fleet-stats.js +0 -114
- package/dist/src/app-opentui/focus-manager.d.ts +0 -14
- package/dist/src/app-opentui/focus-manager.js +0 -24
- package/dist/src/app-opentui/index.d.ts +0 -8
- package/dist/src/app-opentui/index.js +0 -5260
- package/dist/src/app-opentui/intent.d.ts +0 -3
- package/dist/src/app-opentui/intent.js +0 -365
- package/dist/src/app-opentui/keymap.d.ts +0 -21
- package/dist/src/app-opentui/keymap.js +0 -1377
- package/dist/src/app-opentui/launch-routing.d.ts +0 -16
- package/dist/src/app-opentui/launch-routing.js +0 -55
- package/dist/src/app-opentui/layout.d.ts +0 -22
- package/dist/src/app-opentui/layout.js +0 -51
- package/dist/src/app-opentui/list-search.d.ts +0 -36
- package/dist/src/app-opentui/list-search.js +0 -130
- package/dist/src/app-opentui/pi-host-child.d.ts +0 -2
- package/dist/src/app-opentui/pi-host-child.js +0 -1299
- package/dist/src/app-opentui/pi-pty-host.d.ts +0 -28
- package/dist/src/app-opentui/pi-pty-host.js +0 -10
- package/dist/src/app-opentui/react/App.d.ts +0 -9
- package/dist/src/app-opentui/react/App.js +0 -3866
- package/dist/src/app-opentui/react/Backdrop.d.ts +0 -5
- package/dist/src/app-opentui/react/Backdrop.js +0 -823
- package/dist/src/app-opentui/react/ChromeHost.d.ts +0 -5
- package/dist/src/app-opentui/react/ChromeHost.js +0 -1539
- package/dist/src/app-opentui/react/SceneFrameView.d.ts +0 -7
- package/dist/src/app-opentui/react/SceneFrameView.js +0 -579
- package/dist/src/app-opentui/react/context.d.ts +0 -17
- package/dist/src/app-opentui/react/context.js +0 -37
- package/dist/src/app-opentui/react/launch.d.ts +0 -2
- package/dist/src/app-opentui/react/launch.js +0 -4897
- package/dist/src/app-opentui/react/nav.d.ts +0 -18
- package/dist/src/app-opentui/react/nav.js +0 -54
- package/dist/src/app-opentui/react/scroll.d.ts +0 -12
- package/dist/src/app-opentui/react/scroll.js +0 -21
- package/dist/src/app-opentui/react/syntax.d.ts +0 -2
- package/dist/src/app-opentui/react/syntax.js +0 -65
- package/dist/src/app-opentui/registry.d.ts +0 -4
- package/dist/src/app-opentui/registry.js +0 -22876
- package/dist/src/app-opentui/remote-link.d.ts +0 -10
- package/dist/src/app-opentui/remote-link.js +0 -47
- package/dist/src/app-opentui/render/ascii-fleet.d.ts +0 -15
- package/dist/src/app-opentui/render/ascii-fleet.js +0 -82
- package/dist/src/app-opentui/render/constants.d.ts +0 -30
- package/dist/src/app-opentui/render/constants.js +0 -64
- package/dist/src/app-opentui/render/graphics.d.ts +0 -40
- package/dist/src/app-opentui/render/graphics.js +0 -713
- package/dist/src/app-opentui/render/hover.d.ts +0 -11
- package/dist/src/app-opentui/render/hover.js +0 -34
- package/dist/src/app-opentui/render/native-host.d.ts +0 -37
- package/dist/src/app-opentui/render/native-host.js +0 -180
- package/dist/src/app-opentui/render/panel-layout.d.ts +0 -38
- package/dist/src/app-opentui/render/panel-layout.js +0 -48
- package/dist/src/app-opentui/render/panels.d.ts +0 -12
- package/dist/src/app-opentui/render/panels.js +0 -288
- package/dist/src/app-opentui/render/preloader.d.ts +0 -10
- package/dist/src/app-opentui/render/preloader.js +0 -166
- package/dist/src/app-opentui/render/scene.d.ts +0 -68
- package/dist/src/app-opentui/render/scene.js +0 -300
- package/dist/src/app-opentui/render/terminal-handoff.d.ts +0 -16
- package/dist/src/app-opentui/render/terminal-handoff.js +0 -14
- package/dist/src/app-opentui/render/text.d.ts +0 -29
- package/dist/src/app-opentui/render/text.js +0 -177
- package/dist/src/app-opentui/render/type-bar.d.ts +0 -15
- package/dist/src/app-opentui/render/type-bar.js +0 -212
- package/dist/src/app-opentui/runtime-resources.d.ts +0 -16
- package/dist/src/app-opentui/runtime-resources.js +0 -62
- package/dist/src/app-opentui/runtime.d.ts +0 -45
- package/dist/src/app-opentui/runtime.js +0 -5232
- package/dist/src/app-opentui/scenes/command.d.ts +0 -3
- package/dist/src/app-opentui/scenes/command.js +0 -118
- package/dist/src/app-opentui/scenes/doctor.d.ts +0 -3
- package/dist/src/app-opentui/scenes/doctor.js +0 -296
- package/dist/src/app-opentui/scenes/error.d.ts +0 -2
- package/dist/src/app-opentui/scenes/error.js +0 -277
- package/dist/src/app-opentui/scenes/family-domains/agent.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/agent.js +0 -349
- package/dist/src/app-opentui/scenes/family-domains/browser.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/browser.js +0 -196
- package/dist/src/app-opentui/scenes/family-domains/dist.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/dist.js +0 -244
- package/dist/src/app-opentui/scenes/family-domains/git.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/git.js +0 -196
- package/dist/src/app-opentui/scenes/family-domains/github.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/github.js +0 -275
- package/dist/src/app-opentui/scenes/family-domains/harness.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/harness.js +0 -153
- package/dist/src/app-opentui/scenes/family-domains/index.d.ts +0 -4
- package/dist/src/app-opentui/scenes/family-domains/index.js +0 -1680
- package/dist/src/app-opentui/scenes/family-domains/kit.d.ts +0 -76
- package/dist/src/app-opentui/scenes/family-domains/kit.js +0 -306
- package/dist/src/app-opentui/scenes/family-domains/profile.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/profile.js +0 -213
- package/dist/src/app-opentui/scenes/family-domains/queue.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/queue.js +0 -147
- package/dist/src/app-opentui/scenes/family-domains/remote.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/remote.js +0 -519
- package/dist/src/app-opentui/scenes/family-domains/review.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/review.js +0 -281
- package/dist/src/app-opentui/scenes/family-domains/setup.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/setup.js +0 -268
- package/dist/src/app-opentui/scenes/family-domains/stats.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/stats.js +0 -371
- package/dist/src/app-opentui/scenes/family.d.ts +0 -3
- package/dist/src/app-opentui/scenes/family.js +0 -2199
- package/dist/src/app-opentui/scenes/fleet.d.ts +0 -3
- package/dist/src/app-opentui/scenes/fleet.js +0 -766
- package/dist/src/app-opentui/scenes/handoff.d.ts +0 -2
- package/dist/src/app-opentui/scenes/handoff.js +0 -455
- package/dist/src/app-opentui/scenes/help.d.ts +0 -3
- package/dist/src/app-opentui/scenes/help.js +0 -725
- package/dist/src/app-opentui/scenes/inbox.d.ts +0 -3
- package/dist/src/app-opentui/scenes/inbox.js +0 -427
- package/dist/src/app-opentui/scenes/init.d.ts +0 -3
- package/dist/src/app-opentui/scenes/init.js +0 -181
- package/dist/src/app-opentui/scenes/inspect.d.ts +0 -3
- package/dist/src/app-opentui/scenes/inspect.js +0 -794
- package/dist/src/app-opentui/scenes/main.d.ts +0 -3
- package/dist/src/app-opentui/scenes/main.js +0 -332
- package/dist/src/app-opentui/scenes/pi.d.ts +0 -3
- package/dist/src/app-opentui/scenes/pi.js +0 -509
- package/dist/src/app-opentui/scenes/plugin.d.ts +0 -3
- package/dist/src/app-opentui/scenes/plugin.js +0 -487
- package/dist/src/app-opentui/scenes/repo.d.ts +0 -3
- package/dist/src/app-opentui/scenes/repo.js +0 -425
- package/dist/src/app-opentui/scenes/run-detail.d.ts +0 -3
- package/dist/src/app-opentui/scenes/run-detail.js +0 -467
- package/dist/src/app-opentui/scenes/server.d.ts +0 -3
- package/dist/src/app-opentui/scenes/server.js +0 -378
- package/dist/src/app-opentui/scenes/tasks.d.ts +0 -3
- package/dist/src/app-opentui/scenes/tasks.js +0 -768
- package/dist/src/app-opentui/scenes/workspace.d.ts +0 -3
- package/dist/src/app-opentui/scenes/workspace.js +0 -427
- package/dist/src/app-opentui/selectable.d.ts +0 -19
- package/dist/src/app-opentui/selectable.js +0 -80
- package/dist/src/app-opentui/state.d.ts +0 -4
- package/dist/src/app-opentui/state.js +0 -399
- package/dist/src/app-opentui/surface-catalog.d.ts +0 -20
- package/dist/src/app-opentui/surface-catalog.js +0 -542
- package/dist/src/app-opentui/theme.d.ts +0 -59
- package/dist/src/app-opentui/theme.js +0 -142
- package/dist/src/app-opentui/types.d.ts +0 -313
- package/dist/src/app-opentui/types.js +0 -1
- package/dist/src/commands/_server-events.d.ts +0 -26
- package/dist/src/commands/_server-events.js +0 -715
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare function getHoveredSelectableId(): string | undefined;
|
|
2
|
-
export declare function isHovered(id: string | undefined): boolean;
|
|
3
|
-
/** Set the hovered row (or clear with `undefined`). No-ops when unchanged so we
|
|
4
|
-
* don't churn renders on every mouse-move event within the same row. */
|
|
5
|
-
export declare function setHoveredSelectableId(id: string | undefined): void;
|
|
6
|
-
/** Clear the hover only if `id` is the currently-hovered row — guards against a
|
|
7
|
-
* stale mouseout (from a row we already left) wiping a newer hover. */
|
|
8
|
-
export declare function clearHoveredSelectableId(id: string | undefined): void;
|
|
9
|
-
/** Subscribe to hover changes. Legacy shell passes its render scheduler; the
|
|
10
|
-
* react shell bridges this into a re-render. Returns an unsubscribe fn. */
|
|
11
|
-
export declare function subscribeHover(listener: () => void): () => void;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// packages/cli/src/app-opentui/render/hover.ts
|
|
3
|
-
var hoveredId;
|
|
4
|
-
var listeners = new Set;
|
|
5
|
-
function getHoveredSelectableId() {
|
|
6
|
-
return hoveredId;
|
|
7
|
-
}
|
|
8
|
-
function isHovered(id) {
|
|
9
|
-
return id !== undefined && id === hoveredId;
|
|
10
|
-
}
|
|
11
|
-
function setHoveredSelectableId(id) {
|
|
12
|
-
if (hoveredId === id)
|
|
13
|
-
return;
|
|
14
|
-
hoveredId = id;
|
|
15
|
-
for (const listener of listeners)
|
|
16
|
-
listener();
|
|
17
|
-
}
|
|
18
|
-
function clearHoveredSelectableId(id) {
|
|
19
|
-
if (id !== undefined && hoveredId === id)
|
|
20
|
-
setHoveredSelectableId(undefined);
|
|
21
|
-
}
|
|
22
|
-
function subscribeHover(listener) {
|
|
23
|
-
listeners.add(listener);
|
|
24
|
-
return () => {
|
|
25
|
-
listeners.delete(listener);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
subscribeHover,
|
|
30
|
-
setHoveredSelectableId,
|
|
31
|
-
isHovered,
|
|
32
|
-
getHoveredSelectableId,
|
|
33
|
-
clearHoveredSelectableId
|
|
34
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { BoxRenderable, CodeRenderable, DiffRenderable, ScrollBoxRenderable, TextRenderable, TextTableRenderable, type CliRenderer } from "@opentui/core";
|
|
2
|
-
import type { StageLayout } from "../layout";
|
|
3
|
-
export type NativeMountKind = "code" | "diff" | "markdown" | "table";
|
|
4
|
-
/** A scene's request to render native content in a rectangle of its panel. */
|
|
5
|
-
export type NativeMount = {
|
|
6
|
-
readonly kind: NativeMountKind;
|
|
7
|
-
/** Source/markdown/diff text. */
|
|
8
|
-
readonly content: string;
|
|
9
|
-
/** Rows for `kind: "table"` — first row is the header. */
|
|
10
|
-
readonly rows?: readonly (readonly string[])[];
|
|
11
|
-
/** Tree-sitter filetype for `kind: "code"` (e.g. "typescript", "json"). */
|
|
12
|
-
readonly filetype?: string;
|
|
13
|
-
/** Cell rectangle to occupy (defaults to the centered content area). */
|
|
14
|
-
readonly top?: number;
|
|
15
|
-
readonly left?: number;
|
|
16
|
-
readonly width?: number;
|
|
17
|
-
readonly height?: number;
|
|
18
|
-
/** Pin to the bottom (log/diff tails). */
|
|
19
|
-
readonly stickyBottom?: boolean;
|
|
20
|
-
};
|
|
21
|
-
export type NativeHost = {
|
|
22
|
-
readonly scrollBox: ScrollBoxRenderable;
|
|
23
|
-
code: CodeRenderable | null;
|
|
24
|
-
diff: DiffRenderable | null;
|
|
25
|
-
table: TextTableRenderable | null;
|
|
26
|
-
active: NativeMountKind | null;
|
|
27
|
-
lastKey: string;
|
|
28
|
-
};
|
|
29
|
-
export declare function createNativeHost(renderer: CliRenderer): NativeHost | null;
|
|
30
|
-
export declare function hideNativeHost(host: NativeHost | null): void;
|
|
31
|
-
/** Position + populate the native host for a scene's mount request. Returns true
|
|
32
|
-
* if it rendered natively; false means the caller should fall back to lines. */
|
|
33
|
-
export declare function applyNativeHost(host: NativeHost | null, mount: NativeMount, layout: StageLayout): boolean;
|
|
34
|
-
export declare function destroyNativeHost(host: NativeHost | null): void;
|
|
35
|
-
/** A tiny title bar the scene can keep above the native host (line-rendered). */
|
|
36
|
-
export declare function nativeTitleBar(renderer: CliRenderer, id: string): TextRenderable;
|
|
37
|
-
export { BoxRenderable };
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// packages/cli/src/app-opentui/render/native-host.ts
|
|
3
|
-
import {
|
|
4
|
-
BoxRenderable,
|
|
5
|
-
CodeRenderable,
|
|
6
|
-
DiffRenderable,
|
|
7
|
-
RGBA,
|
|
8
|
-
ScrollBoxRenderable,
|
|
9
|
-
SyntaxStyle,
|
|
10
|
-
TextRenderable,
|
|
11
|
-
TextTableRenderable
|
|
12
|
-
} from "@opentui/core";
|
|
13
|
-
|
|
14
|
-
// packages/cli/src/app-opentui/theme.ts
|
|
15
|
-
import {
|
|
16
|
-
bold as otuiBold,
|
|
17
|
-
dim as otuiDim,
|
|
18
|
-
fg as otuiFg,
|
|
19
|
-
t,
|
|
20
|
-
TextAttributes
|
|
21
|
-
} from "@opentui/core";
|
|
22
|
-
var RIG_UI = {
|
|
23
|
-
bg: "#070809",
|
|
24
|
-
bg2: "#0b0c0e",
|
|
25
|
-
panel: "#101115",
|
|
26
|
-
panel2: "#14161b",
|
|
27
|
-
hover: "#181b24",
|
|
28
|
-
glass: "#1e2230",
|
|
29
|
-
border: "#2a2e3a",
|
|
30
|
-
ink: "#f4f5f8",
|
|
31
|
-
ink2: "#c7c9d3",
|
|
32
|
-
ink3: "#9aa0ae",
|
|
33
|
-
ink4: "#787b86",
|
|
34
|
-
lime: "#ccff4d",
|
|
35
|
-
limeDim: "#a9d63f",
|
|
36
|
-
cyan: "#56d8ff",
|
|
37
|
-
cyanDim: "#3f9fbd",
|
|
38
|
-
red: "#ff5d5d",
|
|
39
|
-
yellow: "#ffd24d",
|
|
40
|
-
magenta: "#ff79b0"
|
|
41
|
-
};
|
|
42
|
-
var styles = {
|
|
43
|
-
ink: otuiFg(RIG_UI.ink),
|
|
44
|
-
ink2: otuiFg(RIG_UI.ink2),
|
|
45
|
-
ink3: otuiFg(RIG_UI.ink3),
|
|
46
|
-
ink4: otuiFg(RIG_UI.ink4),
|
|
47
|
-
lime: otuiFg(RIG_UI.lime),
|
|
48
|
-
limeDim: otuiFg(RIG_UI.limeDim),
|
|
49
|
-
cyan: otuiFg(RIG_UI.cyan),
|
|
50
|
-
red: otuiFg(RIG_UI.red),
|
|
51
|
-
yellow: otuiFg(RIG_UI.yellow),
|
|
52
|
-
magenta: otuiFg(RIG_UI.magenta)
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// packages/cli/src/app-opentui/render/native-host.ts
|
|
56
|
-
var syntaxStyle = null;
|
|
57
|
-
function rigSyntaxStyle() {
|
|
58
|
-
if (syntaxStyle)
|
|
59
|
-
return syntaxStyle;
|
|
60
|
-
syntaxStyle = SyntaxStyle.fromStyles({
|
|
61
|
-
keyword: { fg: RGBA.fromHex(RIG_UI.magenta), bold: true },
|
|
62
|
-
string: { fg: RGBA.fromHex(RIG_UI.lime) },
|
|
63
|
-
number: { fg: RGBA.fromHex(RIG_UI.cyan) },
|
|
64
|
-
comment: { fg: RGBA.fromHex(RIG_UI.ink4), italic: true },
|
|
65
|
-
function: { fg: RGBA.fromHex(RIG_UI.cyan) },
|
|
66
|
-
type: { fg: RGBA.fromHex(RIG_UI.limeDim) },
|
|
67
|
-
constant: { fg: RGBA.fromHex(RIG_UI.yellow) },
|
|
68
|
-
default: { fg: RGBA.fromHex(RIG_UI.ink2) }
|
|
69
|
-
});
|
|
70
|
-
return syntaxStyle;
|
|
71
|
-
}
|
|
72
|
-
function tableContent(rows) {
|
|
73
|
-
return rows.map((row, rowIndex) => row.map((cell) => [{ __isChunk: true, text: cell, fg: RGBA.fromHex(rowIndex === 0 ? RIG_UI.ink3 : RIG_UI.ink2) }]));
|
|
74
|
-
}
|
|
75
|
-
function createNativeHost(renderer) {
|
|
76
|
-
try {
|
|
77
|
-
const scrollBox = new ScrollBoxRenderable(renderer, {
|
|
78
|
-
id: "rig-native-scrollbox",
|
|
79
|
-
position: "absolute",
|
|
80
|
-
left: 0,
|
|
81
|
-
top: 0,
|
|
82
|
-
width: 1,
|
|
83
|
-
height: 1,
|
|
84
|
-
scrollY: true,
|
|
85
|
-
zIndex: 9,
|
|
86
|
-
visible: false
|
|
87
|
-
});
|
|
88
|
-
renderer.root.add(scrollBox);
|
|
89
|
-
return { scrollBox, code: null, diff: null, table: null, active: null, lastKey: "" };
|
|
90
|
-
} catch {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function hideAllChildren(host) {
|
|
95
|
-
if (host.code)
|
|
96
|
-
host.code.visible = false;
|
|
97
|
-
if (host.diff)
|
|
98
|
-
host.diff.visible = false;
|
|
99
|
-
if (host.table)
|
|
100
|
-
host.table.visible = false;
|
|
101
|
-
}
|
|
102
|
-
function hideNativeHost(host) {
|
|
103
|
-
if (!host)
|
|
104
|
-
return;
|
|
105
|
-
host.scrollBox.visible = false;
|
|
106
|
-
hideAllChildren(host);
|
|
107
|
-
host.active = null;
|
|
108
|
-
}
|
|
109
|
-
function applyNativeHost(host, mount, layout) {
|
|
110
|
-
if (!host)
|
|
111
|
-
return false;
|
|
112
|
-
try {
|
|
113
|
-
const left = mount.left ?? layout.centerLeft;
|
|
114
|
-
const top = mount.top ?? layout.centerTop;
|
|
115
|
-
const width = Math.max(8, mount.width ?? layout.centerWidth);
|
|
116
|
-
const height = Math.max(3, mount.height ?? layout.centerHeight);
|
|
117
|
-
host.scrollBox.left = left;
|
|
118
|
-
host.scrollBox.top = top;
|
|
119
|
-
host.scrollBox.width = width;
|
|
120
|
-
host.scrollBox.height = height;
|
|
121
|
-
host.scrollBox.visible = true;
|
|
122
|
-
hideAllChildren(host);
|
|
123
|
-
const rowCount = mount.rows?.length ?? 0;
|
|
124
|
-
const key = `${mount.kind}:${width}x${height}:${mount.content.length}:${mount.filetype ?? ""}:${rowCount}`;
|
|
125
|
-
if (mount.kind === "table") {
|
|
126
|
-
if (!host.table) {
|
|
127
|
-
host.table = new TextTableRenderable(host.scrollBox.ctx, { id: "rig-native-table", content: [], width: "100%", showBorders: true, columnWidthMode: "full", borderColor: RIG_UI.ink4 });
|
|
128
|
-
host.scrollBox.add(host.table);
|
|
129
|
-
}
|
|
130
|
-
if (host.lastKey !== key)
|
|
131
|
-
host.table.content = tableContent(mount.rows ?? []);
|
|
132
|
-
host.table.visible = true;
|
|
133
|
-
} else if (mount.kind === "diff") {
|
|
134
|
-
if (!host.diff) {
|
|
135
|
-
host.diff = new DiffRenderable(host.scrollBox.ctx, { id: "rig-native-diff", diff: "", width: "100%" });
|
|
136
|
-
host.scrollBox.add(host.diff);
|
|
137
|
-
}
|
|
138
|
-
if (host.lastKey !== key)
|
|
139
|
-
host.diff.diff = mount.content;
|
|
140
|
-
host.diff.visible = true;
|
|
141
|
-
} else {
|
|
142
|
-
const filetype = mount.kind === "markdown" ? "markdown" : mount.filetype ?? "text";
|
|
143
|
-
if (!host.code) {
|
|
144
|
-
host.code = new CodeRenderable(host.scrollBox.ctx, { id: "rig-native-code", content: "", filetype, syntaxStyle: rigSyntaxStyle(), width: "100%" });
|
|
145
|
-
host.scrollBox.add(host.code);
|
|
146
|
-
}
|
|
147
|
-
if (host.lastKey !== key) {
|
|
148
|
-
host.code.filetype = filetype;
|
|
149
|
-
host.code.content = mount.content;
|
|
150
|
-
}
|
|
151
|
-
host.code.visible = true;
|
|
152
|
-
}
|
|
153
|
-
host.active = mount.kind;
|
|
154
|
-
host.lastKey = key;
|
|
155
|
-
if (mount.stickyBottom)
|
|
156
|
-
host.scrollBox.scrollTo?.({ x: 0, y: Number.MAX_SAFE_INTEGER });
|
|
157
|
-
return true;
|
|
158
|
-
} catch {
|
|
159
|
-
hideNativeHost(host);
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
function destroyNativeHost(host) {
|
|
164
|
-
if (!host)
|
|
165
|
-
return;
|
|
166
|
-
try {
|
|
167
|
-
host.scrollBox.destroy?.();
|
|
168
|
-
} catch {}
|
|
169
|
-
}
|
|
170
|
-
function nativeTitleBar(renderer, id) {
|
|
171
|
-
return new TextRenderable(renderer, { id, content: "", position: "absolute", left: 0, top: 0, fg: RIG_UI.ink3, zIndex: 10, visible: false });
|
|
172
|
-
}
|
|
173
|
-
export {
|
|
174
|
-
nativeTitleBar,
|
|
175
|
-
hideNativeHost,
|
|
176
|
-
destroyNativeHost,
|
|
177
|
-
createNativeHost,
|
|
178
|
-
applyNativeHost,
|
|
179
|
-
BoxRenderable
|
|
180
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { StageLayout } from "../layout";
|
|
2
|
-
import type { AppScenePanel } from "../types";
|
|
3
|
-
export type PanelCellRect = {
|
|
4
|
-
readonly left: number;
|
|
5
|
-
readonly top: number;
|
|
6
|
-
readonly width: number;
|
|
7
|
-
readonly height: number;
|
|
8
|
-
readonly right: number;
|
|
9
|
-
readonly bottom: number;
|
|
10
|
-
readonly headerHeight: number;
|
|
11
|
-
readonly dividerY: number;
|
|
12
|
-
};
|
|
13
|
-
export type PanelContentRect = {
|
|
14
|
-
readonly left: number;
|
|
15
|
-
readonly top: number;
|
|
16
|
-
readonly width: number;
|
|
17
|
-
readonly height: number;
|
|
18
|
-
readonly paddingX: number;
|
|
19
|
-
readonly paddingY: number;
|
|
20
|
-
readonly contentWidth: number;
|
|
21
|
-
};
|
|
22
|
-
export type PanelPixelSize = {
|
|
23
|
-
readonly width: number;
|
|
24
|
-
readonly height: number;
|
|
25
|
-
};
|
|
26
|
-
export type PanelPixelPlacement = {
|
|
27
|
-
readonly left: number;
|
|
28
|
-
readonly top: number;
|
|
29
|
-
readonly width: number;
|
|
30
|
-
readonly height: number;
|
|
31
|
-
readonly leftCells: number;
|
|
32
|
-
readonly topCells: number;
|
|
33
|
-
readonly widthCells: number;
|
|
34
|
-
readonly heightCells: number;
|
|
35
|
-
};
|
|
36
|
-
export declare function panelCellRect(layout: StageLayout, panel: AppScenePanel): PanelCellRect | null;
|
|
37
|
-
export declare function panelContentRect(layout: StageLayout, panel: AppScenePanel): PanelContentRect | null;
|
|
38
|
-
export declare function panelPixelPlacement(layout: StageLayout, panel: AppScenePanel, size: PanelPixelSize, minPixels?: number): PanelPixelPlacement | null;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// packages/cli/src/app-opentui/render/panel-layout.ts
|
|
3
|
-
function panelCellRect(layout, panel) {
|
|
4
|
-
const left = Math.max(0, Math.min(layout.width - 1, layout.centerLeft + (panel.left ?? 0)));
|
|
5
|
-
const desiredWidth = panel.width ?? layout.centerWidth;
|
|
6
|
-
const width = Math.max(1, Math.min(layout.width - left, desiredWidth));
|
|
7
|
-
const top = Math.max(0, Math.min(layout.height - 1, layout.centerTop + panel.top));
|
|
8
|
-
const height = Math.max(1, Math.min(layout.height - top, panel.height));
|
|
9
|
-
if (width <= 3 || height <= 3)
|
|
10
|
-
return null;
|
|
11
|
-
const right = left + width - 1;
|
|
12
|
-
const bottom = top + height - 1;
|
|
13
|
-
const headerHeight = panel.chrome === "ad-terminal" ? Math.max(3, Math.min(height - 2, panel.headerHeight ?? 3)) : 0;
|
|
14
|
-
const dividerY = headerHeight ? Math.min(bottom - 1, top + headerHeight) : top;
|
|
15
|
-
return { left, top, width, height, right, bottom, headerHeight, dividerY };
|
|
16
|
-
}
|
|
17
|
-
function panelContentRect(layout, panel) {
|
|
18
|
-
const rect = panelCellRect(layout, panel);
|
|
19
|
-
if (!rect)
|
|
20
|
-
return null;
|
|
21
|
-
const chromeInset = panel.chrome === "ad-terminal" ? 1 : 0;
|
|
22
|
-
const left = rect.left + chromeInset;
|
|
23
|
-
const top = rect.top + rect.headerHeight + chromeInset;
|
|
24
|
-
const width = Math.max(1, Math.min(layout.width - left, rect.width - chromeInset * 2));
|
|
25
|
-
const height = Math.max(1, Math.min(layout.height - top, rect.height - rect.headerHeight - chromeInset * 2));
|
|
26
|
-
const paddingX = panel.paddingX ?? (panel.chrome === "ad-terminal" ? 5 : 2);
|
|
27
|
-
const paddingY = panel.paddingY ?? (panel.chrome === "ad-terminal" ? 2 : 1);
|
|
28
|
-
const contentWidth = Math.max(1, width - paddingX * 2 - 1);
|
|
29
|
-
return { left, top, width, height, paddingX, paddingY, contentWidth };
|
|
30
|
-
}
|
|
31
|
-
function panelPixelPlacement(layout, panel, size, minPixels = 8) {
|
|
32
|
-
const cellW = size.width / layout.width;
|
|
33
|
-
const cellH = size.height / layout.height;
|
|
34
|
-
const leftCells = layout.centerLeft + (panel.left ?? 0);
|
|
35
|
-
const topCells = layout.centerTop + panel.top;
|
|
36
|
-
const widthCells = panel.width ?? layout.centerWidth;
|
|
37
|
-
const heightCells = panel.height;
|
|
38
|
-
const left = Math.round(leftCells * cellW);
|
|
39
|
-
const top = Math.round(topCells * cellH);
|
|
40
|
-
const width = Math.round(widthCells * cellW);
|
|
41
|
-
const height = Math.round(heightCells * cellH);
|
|
42
|
-
return width > minPixels && height > minPixels ? { left, top, width, height, leftCells, topCells, widthCells, heightCells } : null;
|
|
43
|
-
}
|
|
44
|
-
export {
|
|
45
|
-
panelPixelPlacement,
|
|
46
|
-
panelContentRect,
|
|
47
|
-
panelCellRect
|
|
48
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ScrollBoxRenderable, type CliRenderer, type MouseEvent } from "@opentui/core";
|
|
2
|
-
import type { StageLayout } from "../layout";
|
|
3
|
-
import type { AppSceneLine, AppScenePanel } from "../types";
|
|
4
|
-
import { type TextLineRenderable } from "./text";
|
|
5
|
-
export type ScrollPanelRenderable = ScrollBoxRenderable & {
|
|
6
|
-
__rigTextLines: TextLineRenderable[];
|
|
7
|
-
__rigRenderer: CliRenderer;
|
|
8
|
-
__rigOnLineMouseDown?: (line: AppSceneLine, event: MouseEvent) => void;
|
|
9
|
-
__rigPanelId?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare function createScrollPanelLayer(renderer: CliRenderer, id: string, onLineMouseDown?: (line: AppSceneLine, event: MouseEvent) => void): ScrollPanelRenderable;
|
|
12
|
-
export declare function applyScrollPanels(panels: readonly ScrollPanelRenderable[], layout: StageLayout, scenePanels: readonly AppScenePanel[]): void;
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// packages/cli/src/app-opentui/render/panels.ts
|
|
3
|
-
import { RGBA as RGBA2, ScrollBoxRenderable } from "@opentui/core";
|
|
4
|
-
|
|
5
|
-
// packages/cli/src/app-opentui/theme.ts
|
|
6
|
-
import {
|
|
7
|
-
bold as otuiBold,
|
|
8
|
-
dim as otuiDim,
|
|
9
|
-
fg as otuiFg,
|
|
10
|
-
t,
|
|
11
|
-
TextAttributes
|
|
12
|
-
} from "@opentui/core";
|
|
13
|
-
var RIG_UI = {
|
|
14
|
-
bg: "#070809",
|
|
15
|
-
bg2: "#0b0c0e",
|
|
16
|
-
panel: "#101115",
|
|
17
|
-
panel2: "#14161b",
|
|
18
|
-
hover: "#181b24",
|
|
19
|
-
glass: "#1e2230",
|
|
20
|
-
border: "#2a2e3a",
|
|
21
|
-
ink: "#f4f5f8",
|
|
22
|
-
ink2: "#c7c9d3",
|
|
23
|
-
ink3: "#9aa0ae",
|
|
24
|
-
ink4: "#787b86",
|
|
25
|
-
lime: "#ccff4d",
|
|
26
|
-
limeDim: "#a9d63f",
|
|
27
|
-
cyan: "#56d8ff",
|
|
28
|
-
cyanDim: "#3f9fbd",
|
|
29
|
-
red: "#ff5d5d",
|
|
30
|
-
yellow: "#ffd24d",
|
|
31
|
-
magenta: "#ff79b0"
|
|
32
|
-
};
|
|
33
|
-
var styles = {
|
|
34
|
-
ink: otuiFg(RIG_UI.ink),
|
|
35
|
-
ink2: otuiFg(RIG_UI.ink2),
|
|
36
|
-
ink3: otuiFg(RIG_UI.ink3),
|
|
37
|
-
ink4: otuiFg(RIG_UI.ink4),
|
|
38
|
-
lime: otuiFg(RIG_UI.lime),
|
|
39
|
-
limeDim: otuiFg(RIG_UI.limeDim),
|
|
40
|
-
cyan: otuiFg(RIG_UI.cyan),
|
|
41
|
-
red: otuiFg(RIG_UI.red),
|
|
42
|
-
yellow: otuiFg(RIG_UI.yellow),
|
|
43
|
-
magenta: otuiFg(RIG_UI.magenta)
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// packages/cli/src/app-opentui/render/panel-layout.ts
|
|
47
|
-
function panelCellRect(layout, panel) {
|
|
48
|
-
const left = Math.max(0, Math.min(layout.width - 1, layout.centerLeft + (panel.left ?? 0)));
|
|
49
|
-
const desiredWidth = panel.width ?? layout.centerWidth;
|
|
50
|
-
const width = Math.max(1, Math.min(layout.width - left, desiredWidth));
|
|
51
|
-
const top = Math.max(0, Math.min(layout.height - 1, layout.centerTop + panel.top));
|
|
52
|
-
const height = Math.max(1, Math.min(layout.height - top, panel.height));
|
|
53
|
-
if (width <= 3 || height <= 3)
|
|
54
|
-
return null;
|
|
55
|
-
const right = left + width - 1;
|
|
56
|
-
const bottom = top + height - 1;
|
|
57
|
-
const headerHeight = panel.chrome === "ad-terminal" ? Math.max(3, Math.min(height - 2, panel.headerHeight ?? 3)) : 0;
|
|
58
|
-
const dividerY = headerHeight ? Math.min(bottom - 1, top + headerHeight) : top;
|
|
59
|
-
return { left, top, width, height, right, bottom, headerHeight, dividerY };
|
|
60
|
-
}
|
|
61
|
-
function panelContentRect(layout, panel) {
|
|
62
|
-
const rect = panelCellRect(layout, panel);
|
|
63
|
-
if (!rect)
|
|
64
|
-
return null;
|
|
65
|
-
const chromeInset = panel.chrome === "ad-terminal" ? 1 : 0;
|
|
66
|
-
const left = rect.left + chromeInset;
|
|
67
|
-
const top = rect.top + rect.headerHeight + chromeInset;
|
|
68
|
-
const width = Math.max(1, Math.min(layout.width - left, rect.width - chromeInset * 2));
|
|
69
|
-
const height = Math.max(1, Math.min(layout.height - top, rect.height - rect.headerHeight - chromeInset * 2));
|
|
70
|
-
const paddingX = panel.paddingX ?? (panel.chrome === "ad-terminal" ? 5 : 2);
|
|
71
|
-
const paddingY = panel.paddingY ?? (panel.chrome === "ad-terminal" ? 2 : 1);
|
|
72
|
-
const contentWidth = Math.max(1, width - paddingX * 2 - 1);
|
|
73
|
-
return { left, top, width, height, paddingX, paddingY, contentWidth };
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// packages/cli/src/app-opentui/render/text.ts
|
|
77
|
-
import { RGBA, TextAttributes as TextAttributes2, TextRenderable } from "@opentui/core";
|
|
78
|
-
|
|
79
|
-
// packages/cli/src/app-opentui/render/hover.ts
|
|
80
|
-
var hoveredId;
|
|
81
|
-
var listeners = new Set;
|
|
82
|
-
function isHovered(id) {
|
|
83
|
-
return id !== undefined && id === hoveredId;
|
|
84
|
-
}
|
|
85
|
-
function setHoveredSelectableId(id) {
|
|
86
|
-
if (hoveredId === id)
|
|
87
|
-
return;
|
|
88
|
-
hoveredId = id;
|
|
89
|
-
for (const listener of listeners)
|
|
90
|
-
listener();
|
|
91
|
-
}
|
|
92
|
-
function clearHoveredSelectableId(id) {
|
|
93
|
-
if (id !== undefined && hoveredId === id)
|
|
94
|
-
setHoveredSelectableId(undefined);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// packages/cli/src/app-opentui/render/text.ts
|
|
98
|
-
var TRANSPARENT = RGBA.fromInts(0, 0, 0, 0);
|
|
99
|
-
var HOVER_BG = RGBA.fromHex(RIG_UI.hover);
|
|
100
|
-
function lineIsClickable(line) {
|
|
101
|
-
return line?.selectable !== undefined || line?.selectableIndex !== undefined;
|
|
102
|
-
}
|
|
103
|
-
function lineSelectableId(line) {
|
|
104
|
-
return line?.selectable?.id ?? line?.selectableId;
|
|
105
|
-
}
|
|
106
|
-
function lineBackground(line) {
|
|
107
|
-
if (line?.bg)
|
|
108
|
-
return RGBA.fromHex(line.bg);
|
|
109
|
-
const id = lineSelectableId(line);
|
|
110
|
-
if (id !== undefined && isHovered(id))
|
|
111
|
-
return HOVER_BG;
|
|
112
|
-
return TRANSPARENT;
|
|
113
|
-
}
|
|
114
|
-
function selectableMouseHandler(currentLineRef, onLineMouseDown) {
|
|
115
|
-
return (event) => {
|
|
116
|
-
const currentLine = currentLineRef();
|
|
117
|
-
if (!lineIsClickable(currentLine))
|
|
118
|
-
return;
|
|
119
|
-
onLineMouseDown?.(currentLine, event);
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
function hoverHandlers(currentLineRef) {
|
|
123
|
-
return {
|
|
124
|
-
onMouseOver: () => {
|
|
125
|
-
const id = lineSelectableId(currentLineRef());
|
|
126
|
-
if (id !== undefined)
|
|
127
|
-
setHoveredSelectableId(id);
|
|
128
|
-
},
|
|
129
|
-
onMouseOut: () => clearHoveredSelectableId(lineSelectableId(currentLineRef()))
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
function createFlowTextLine(renderer, id, onLineMouseDown) {
|
|
133
|
-
let currentLine;
|
|
134
|
-
const renderable = new TextRenderable(renderer, {
|
|
135
|
-
id,
|
|
136
|
-
content: "",
|
|
137
|
-
width: "100%",
|
|
138
|
-
height: 1,
|
|
139
|
-
flexShrink: 0,
|
|
140
|
-
fg: RIG_UI.ink2,
|
|
141
|
-
selectable: true,
|
|
142
|
-
onMouseDown: selectableMouseHandler(() => currentLine, onLineMouseDown),
|
|
143
|
-
...hoverHandlers(() => currentLine)
|
|
144
|
-
});
|
|
145
|
-
renderable.setRigSceneLine = (line) => {
|
|
146
|
-
currentLine = line;
|
|
147
|
-
};
|
|
148
|
-
return renderable;
|
|
149
|
-
}
|
|
150
|
-
function applyFlowTextLine(renderable, line, width) {
|
|
151
|
-
renderable.setRigSceneLine?.(line);
|
|
152
|
-
renderable.visible = Boolean(line);
|
|
153
|
-
renderable.height = line ? 1 : 0;
|
|
154
|
-
renderable.width = Math.max(1, width);
|
|
155
|
-
renderable.content = line?.styledText ?? line?.text ?? "";
|
|
156
|
-
renderable.fg = line?.fg ?? RIG_UI.ink2;
|
|
157
|
-
renderable.bg = lineBackground(line);
|
|
158
|
-
renderable.attributes = line?.bold ? TextAttributes2.BOLD : line?.dim ? TextAttributes2.DIM : 0;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// packages/cli/src/app-opentui/render/panels.ts
|
|
162
|
-
var TRANSPARENT2 = RGBA2.fromInts(0, 0, 0, 0);
|
|
163
|
-
var MAX_PANEL_LINES = 420;
|
|
164
|
-
var PANEL_OPAQUE_ALPHA = 255;
|
|
165
|
-
var PANEL_BORDER = hexToRgba(RIG_UI.border, 255);
|
|
166
|
-
function hexToRgba(hex, alpha) {
|
|
167
|
-
const clean = hex.replace(/^#/, "");
|
|
168
|
-
const full = clean.length === 3 ? clean.split("").map((part) => `${part}${part}`).join("") : clean;
|
|
169
|
-
const value = Number.parseInt(full, 16);
|
|
170
|
-
if (!Number.isFinite(value))
|
|
171
|
-
return RGBA2.fromInts(14, 15, 17, alpha);
|
|
172
|
-
return RGBA2.fromInts(value >> 16 & 255, value >> 8 & 255, value & 255, alpha);
|
|
173
|
-
}
|
|
174
|
-
function panelBackground(panel) {
|
|
175
|
-
return hexToRgba(panel.backgroundColor ?? RIG_UI.panel, PANEL_OPAQUE_ALPHA);
|
|
176
|
-
}
|
|
177
|
-
function panelBorder(panel) {
|
|
178
|
-
if (panel.borderColor)
|
|
179
|
-
return hexToRgba(panel.borderColor, panel.borderAlpha ?? 255);
|
|
180
|
-
return PANEL_BORDER;
|
|
181
|
-
}
|
|
182
|
-
function createScrollPanelLayer(renderer, id, onLineMouseDown) {
|
|
183
|
-
const panel = new ScrollBoxRenderable(renderer, {
|
|
184
|
-
id,
|
|
185
|
-
position: "absolute",
|
|
186
|
-
left: 0,
|
|
187
|
-
top: -2,
|
|
188
|
-
width: 1,
|
|
189
|
-
height: 1,
|
|
190
|
-
backgroundColor: TRANSPARENT2,
|
|
191
|
-
border: false,
|
|
192
|
-
shouldFill: true,
|
|
193
|
-
opacity: 1,
|
|
194
|
-
zIndex: 6,
|
|
195
|
-
scrollY: true,
|
|
196
|
-
scrollX: false,
|
|
197
|
-
stickyScroll: false,
|
|
198
|
-
viewportCulling: true,
|
|
199
|
-
paddingX: 2,
|
|
200
|
-
paddingY: 1,
|
|
201
|
-
verticalScrollbarOptions: {
|
|
202
|
-
showArrows: false,
|
|
203
|
-
visible: false,
|
|
204
|
-
width: 1,
|
|
205
|
-
trackOptions: {
|
|
206
|
-
backgroundColor: TRANSPARENT2,
|
|
207
|
-
foregroundColor: hexToRgba(RIG_UI.ink4, 84)
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
horizontalScrollbarOptions: {
|
|
211
|
-
height: 0,
|
|
212
|
-
visible: false,
|
|
213
|
-
trackOptions: {
|
|
214
|
-
backgroundColor: TRANSPARENT2,
|
|
215
|
-
foregroundColor: TRANSPARENT2
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
panel.__rigTextLines = [];
|
|
220
|
-
panel.__rigRenderer = renderer;
|
|
221
|
-
panel.__rigOnLineMouseDown = onLineMouseDown;
|
|
222
|
-
return panel;
|
|
223
|
-
}
|
|
224
|
-
function ensurePanelLineCount(panel, desiredCount) {
|
|
225
|
-
const target = Math.min(MAX_PANEL_LINES, Math.max(0, desiredCount));
|
|
226
|
-
while (panel.__rigTextLines.length < target) {
|
|
227
|
-
const index = panel.__rigTextLines.length;
|
|
228
|
-
const line = createFlowTextLine(panel.__rigRenderer, `${panel.id}-line-${index}`, panel.__rigOnLineMouseDown);
|
|
229
|
-
panel.__rigTextLines.push(line);
|
|
230
|
-
panel.add(line);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
function hidePanel(panel) {
|
|
234
|
-
panel.visible = false;
|
|
235
|
-
panel.top = -2;
|
|
236
|
-
panel.left = 0;
|
|
237
|
-
panel.width = 1;
|
|
238
|
-
panel.height = 1;
|
|
239
|
-
panel.backgroundColor = TRANSPARENT2;
|
|
240
|
-
panel.border = false;
|
|
241
|
-
panel.__rigPanelId = undefined;
|
|
242
|
-
panel.__rigTextLines.forEach((line) => applyFlowTextLine(line, undefined, 1));
|
|
243
|
-
}
|
|
244
|
-
function applyScrollPanels(panels, layout, scenePanels) {
|
|
245
|
-
panels.forEach((renderable, index) => {
|
|
246
|
-
const panel = scenePanels[index];
|
|
247
|
-
if (!panel || panel.height <= 0) {
|
|
248
|
-
hidePanel(renderable);
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
const contentRect = panelContentRect(layout, panel);
|
|
252
|
-
if (!contentRect) {
|
|
253
|
-
hidePanel(renderable);
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
const { left, top, width, height, paddingX, paddingY, contentWidth } = contentRect;
|
|
257
|
-
renderable.visible = true;
|
|
258
|
-
renderable.left = left;
|
|
259
|
-
renderable.top = top;
|
|
260
|
-
renderable.width = width;
|
|
261
|
-
renderable.height = height;
|
|
262
|
-
renderable.zIndex = panel.zIndex ?? 6;
|
|
263
|
-
renderable.opacity = panel.opacity ?? 1;
|
|
264
|
-
const adTerminal = panel.chrome === "ad-terminal";
|
|
265
|
-
renderable.backgroundColor = adTerminal ? TRANSPARENT2 : panelBackground(panel);
|
|
266
|
-
renderable.border = adTerminal ? false : true;
|
|
267
|
-
renderable.borderColor = adTerminal ? TRANSPARENT2 : panelBorder(panel);
|
|
268
|
-
renderable.paddingX = paddingX;
|
|
269
|
-
renderable.paddingY = paddingY;
|
|
270
|
-
renderable.stickyScroll = panel.stickyScroll ?? false;
|
|
271
|
-
renderable.stickyStart = panel.stickyStart;
|
|
272
|
-
renderable.verticalScrollBar.visible = false;
|
|
273
|
-
renderable.horizontalScrollBar.visible = false;
|
|
274
|
-
if (renderable.__rigPanelId !== panel.id) {
|
|
275
|
-
renderable.__rigPanelId = panel.id;
|
|
276
|
-
renderable.scrollTo(0);
|
|
277
|
-
}
|
|
278
|
-
const lineCount = Math.min(panel.lines.length, MAX_PANEL_LINES);
|
|
279
|
-
ensurePanelLineCount(renderable, lineCount);
|
|
280
|
-
renderable.__rigTextLines.forEach((line, lineIndex) => {
|
|
281
|
-
applyFlowTextLine(line, lineIndex < lineCount ? panel.lines[lineIndex] : undefined, contentWidth);
|
|
282
|
-
});
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
export {
|
|
286
|
-
createScrollPanelLayer,
|
|
287
|
-
applyScrollPanels
|
|
288
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StageLayout } from "../layout";
|
|
2
|
-
import type { AppSceneFrame, AppSceneId } from "../types";
|
|
3
|
-
export type PreloaderTransitionState = {
|
|
4
|
-
scene: AppSceneId | null;
|
|
5
|
-
startedAtMs: number;
|
|
6
|
-
minUntilMs: number;
|
|
7
|
-
};
|
|
8
|
-
export declare function maybeStartPreloaderTransition(transition: PreloaderTransitionState, scene: AppSceneId, now?: number): void;
|
|
9
|
-
export declare function isPreloaderActive(transition: PreloaderTransitionState, targetReady: boolean, now?: number): boolean;
|
|
10
|
-
export declare function renderAsciiPreloaderFrame(scene: AppSceneId, layout: StageLayout, tick: number): AppSceneFrame;
|