@peers-app/peers-ui 0.33.24 → 0.34.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/command-palette/command-palette.js +4 -2
- package/dist/components/router.d.ts +1 -0
- package/dist/components/router.js +4 -1
- package/dist/host-shell/host-shell-consumer.js +8 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -1
- package/dist/isolated-screens/config.d.ts +51 -0
- package/dist/isolated-screens/config.js +73 -0
- package/dist/isolated-screens/frame-autostart.d.ts +1 -0
- package/dist/isolated-screens/frame-autostart.js +18 -0
- package/dist/isolated-screens/frame-bridge.d.ts +30 -0
- package/dist/isolated-screens/frame-bridge.js +113 -0
- package/dist/isolated-screens/frame-component.d.ts +6 -0
- package/dist/isolated-screens/frame-component.js +20 -0
- package/dist/isolated-screens/frame-document.d.ts +26 -0
- package/dist/isolated-screens/frame-document.js +69 -0
- package/dist/isolated-screens/frame-policy.d.ts +17 -0
- package/dist/isolated-screens/frame-policy.js +230 -0
- package/dist/isolated-screens/frame-protocol.d.ts +185 -0
- package/dist/isolated-screens/frame-protocol.js +139 -0
- package/dist/isolated-screens/frame-pvars.d.ts +33 -0
- package/dist/isolated-screens/frame-pvars.js +152 -0
- package/dist/isolated-screens/frame-realm.d.ts +12 -0
- package/dist/isolated-screens/frame-realm.js +31 -0
- package/dist/isolated-screens/frame-runtime.d.ts +5 -0
- package/dist/isolated-screens/frame-runtime.js +416 -0
- package/dist/isolated-screens/frame-storage.d.ts +43 -0
- package/dist/isolated-screens/frame-storage.js +85 -0
- package/dist/isolated-screens/index.d.ts +3 -0
- package/dist/isolated-screens/index.js +13 -0
- package/dist/isolated-screens/isolated-screen.d.ts +191 -0
- package/dist/isolated-screens/isolated-screen.js +684 -0
- package/dist/isolated-screens/piece-frames.d.ts +27 -0
- package/dist/isolated-screens/piece-frames.js +311 -0
- package/dist/isolated-screens/piece-reach.d.ts +11 -0
- package/dist/isolated-screens/piece-reach.js +56 -0
- package/dist/isolated-screens/port-channel.d.ts +47 -0
- package/dist/isolated-screens/port-channel.js +153 -0
- package/dist/isolated-screens/routes-sandbox.d.ts +8 -0
- package/dist/isolated-screens/routes-sandbox.js +130 -0
- package/dist/isolated-screens/screen-tab-context.d.ts +4 -0
- package/dist/isolated-screens/screen-tab-context.js +6 -0
- package/dist/isolated-screens/test-ports.d.ts +3 -0
- package/dist/isolated-screens/test-ports.js +21 -0
- package/dist/mentions/mentions-client.js +9 -0
- package/dist/notifications/index.js +9 -5
- package/dist/operator-console/console-copy.d.ts +15 -0
- package/dist/operator-console/console-copy.js +97 -0
- package/dist/operator-console/console-header.d.ts +33 -0
- package/dist/operator-console/console-header.js +67 -0
- package/dist/operator-console/console-input.d.ts +20 -0
- package/dist/operator-console/console-input.js +313 -0
- package/dist/operator-console/console-repl.d.ts +7 -0
- package/dist/operator-console/console-repl.js +108 -0
- package/dist/operator-console/console-scope.d.ts +45 -0
- package/dist/operator-console/console-scope.js +174 -0
- package/dist/operator-console/console-screen.d.ts +8 -0
- package/dist/operator-console/console-screen.js +32 -0
- package/dist/operator-console/console-session.d.ts +106 -0
- package/dist/operator-console/console-session.js +567 -0
- package/dist/operator-console/console-test-host.d.ts +21 -0
- package/dist/operator-console/console-test-host.js +114 -0
- package/dist/operator-console/console-theme.d.ts +41 -0
- package/dist/operator-console/console-theme.js +55 -0
- package/dist/operator-console/console-value.d.ts +27 -0
- package/dist/operator-console/console-value.js +291 -0
- package/dist/operator-console/operator-console-state.js +3 -1
- package/dist/operator-console/operator-console.d.ts +8 -21
- package/dist/operator-console/operator-console.js +8 -61
- package/dist/root-layout/app-shell-height.d.ts +16 -3
- package/dist/root-layout/app-shell-height.js +17 -4
- package/dist/root-layout/host-app-menu.d.ts +17 -0
- package/dist/root-layout/host-app-menu.js +22 -0
- package/dist/root-layout/layouts/full-screen-layout.js +4 -2
- package/dist/system-apps/console.app.d.ts +15 -0
- package/dist/system-apps/console.app.js +25 -0
- package/dist/system-apps/index.d.ts +1 -0
- package/dist/system-apps/index.js +6 -1
- package/dist/tabs-layout/tabs-layout.js +12 -20
- package/dist/tabs-layout/tabs-state.js +39 -16
- package/dist/theme.css +32 -5
- package/dist/ui-contracts/piece-height.d.ts +18 -0
- package/dist/ui-contracts/piece-height.js +15 -0
- package/dist/ui-contracts/piece-host.d.ts +24 -1
- package/dist/ui-contracts/piece-host.js +53 -2
- package/dist/ui-contracts/piece-props.d.ts +16 -0
- package/dist/ui-contracts/piece-props.js +39 -0
- package/dist/ui-contracts/piece-resolution.d.ts +5 -0
- package/dist/ui-contracts/piece-resolution.js +38 -2
- package/dist/ui-contracts/piece.d.ts +2 -7
- package/dist/ui-contracts/piece.js +22 -37
- package/dist/ui-contracts/popover-surface.d.ts +14 -0
- package/dist/ui-contracts/popover-surface.js +32 -3
- package/dist/ui-inspection/dom-actions.d.ts +23 -0
- package/dist/ui-inspection/dom-actions.js +169 -0
- package/dist/ui-inspection/dom-inspector.d.ts +20 -0
- package/dist/ui-inspection/dom-inspector.js +184 -0
- package/dist/ui-inspection/index.d.ts +73 -0
- package/dist/ui-inspection/index.js +147 -0
- package/dist/ui-router/find-route.d.ts +6 -0
- package/dist/ui-router/find-route.js +22 -0
- package/dist/ui-router/routes-loader.js +23 -4
- package/dist/ui-router/runnable-version.js +3 -0
- package/dist/ui-router/ui-loader.d.ts +6 -1
- package/dist/ui-router/ui-loader.js +102 -26
- package/package.json +3 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConsoleScreen = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const console_app_1 = require("../system-apps/console.app");
|
|
6
|
+
const ui_loader_1 = require("../ui-router/ui-loader");
|
|
7
|
+
const console_header_1 = require("./console-header");
|
|
8
|
+
const console_repl_1 = require("./console-repl");
|
|
9
|
+
const console_theme_1 = require("./console-theme");
|
|
10
|
+
/** The Console as a screen: its header over its REPL, filling the tab. */
|
|
11
|
+
const ConsoleScreen = () => {
|
|
12
|
+
const theme = (0, console_theme_1.useConsoleTheme)();
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
14
|
+
height: "100%",
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
backgroundColor: theme.bg,
|
|
18
|
+
color: theme.text,
|
|
19
|
+
overflow: "hidden",
|
|
20
|
+
}, children: [(0, jsx_runtime_1.jsx)(console_header_1.ConsoleHeader, {}), (0, jsx_runtime_1.jsx)("div", { style: { flex: "1 1 auto", minHeight: 0 }, children: (0, jsx_runtime_1.jsx)(console_repl_1.ConsoleRepl, {}) })] }));
|
|
21
|
+
};
|
|
22
|
+
exports.ConsoleScreen = ConsoleScreen;
|
|
23
|
+
(0, ui_loader_1.registerInternalPeersUI)({
|
|
24
|
+
component: exports.ConsoleScreen,
|
|
25
|
+
routes: [
|
|
26
|
+
{
|
|
27
|
+
isMatch: (_props, context) => context.path === console_app_1.CONSOLE_APP_PATH,
|
|
28
|
+
uiCategory: "screen",
|
|
29
|
+
priority: 0,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Console's REPL session: the contracts of one data context as globals, the entries the
|
|
3
|
+
* person runs, and what they print. Module state, so collapsing the panel (which unmounts it)
|
|
4
|
+
* keeps the output, the variables and the group.
|
|
5
|
+
*
|
|
6
|
+
* Built on `@peers-app/peers-sdk/repl`, the module `peers repl` uses, so the Console and the CLI
|
|
7
|
+
* have the same names, helpers and hints. Shared by the Tabs + Console layout's panel and the
|
|
8
|
+
* Console app.
|
|
9
|
+
*/
|
|
10
|
+
import { ConsoleScope } from "./console-scope";
|
|
11
|
+
/** An error an entry threw, as the Console shows it. */
|
|
12
|
+
export interface IConsoleError {
|
|
13
|
+
/** `TypeError: …`, or just the message for a plain Error. */
|
|
14
|
+
message: string;
|
|
15
|
+
/** What a name that isn't defined might mean: `Did you mean Tasks?`. */
|
|
16
|
+
hint?: string;
|
|
17
|
+
/** Where it was thrown, without the Console's own frames. */
|
|
18
|
+
stack?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Code the person ran, and what it gave. */
|
|
21
|
+
export interface IConsoleEntry {
|
|
22
|
+
id: string;
|
|
23
|
+
type: "entry";
|
|
24
|
+
code: string;
|
|
25
|
+
/** The data context's name when it ran: "personal", or a group's. */
|
|
26
|
+
context: string;
|
|
27
|
+
/** "stopped": let go with stop waiting; with `ms` once it had started, without if it never ran. */
|
|
28
|
+
status: "running" | "done" | "failed" | "stopped";
|
|
29
|
+
value?: unknown;
|
|
30
|
+
error?: IConsoleError;
|
|
31
|
+
/** How long it took, once it's finished. */
|
|
32
|
+
ms?: number;
|
|
33
|
+
/** What it printed while it ran, shown above its result. */
|
|
34
|
+
prints?: IConsolePrint[];
|
|
35
|
+
}
|
|
36
|
+
/** What `print`, `console.log` or a subscription with no handler printed. */
|
|
37
|
+
export interface IConsolePrint {
|
|
38
|
+
id: string;
|
|
39
|
+
type: "print";
|
|
40
|
+
values: unknown[];
|
|
41
|
+
level: "log" | "warn" | "error";
|
|
42
|
+
}
|
|
43
|
+
/** A line from the Console itself: where the session is, or why it couldn't start. */
|
|
44
|
+
export interface IConsoleInfo {
|
|
45
|
+
id: string;
|
|
46
|
+
type: "info";
|
|
47
|
+
text: string;
|
|
48
|
+
tone?: "error";
|
|
49
|
+
}
|
|
50
|
+
/** One block of the Console's output. */
|
|
51
|
+
export type ConsoleBlock = IConsoleEntry | IConsolePrint | IConsoleInfo;
|
|
52
|
+
/** The Console's output, oldest first. */
|
|
53
|
+
export declare const consoleBlocks: import("@peers-app/peers-sdk").Observable<ConsoleBlock[]>;
|
|
54
|
+
/** The data context the Console's calls run in, by name: "personal", or a group's. */
|
|
55
|
+
export declare const consoleContext: import("@peers-app/peers-sdk").Observable<string>;
|
|
56
|
+
/** What's typed in the Console's input and not yet run, kept while the panel is closed. */
|
|
57
|
+
export declare const consoleDraft: import("@peers-app/peers-sdk").Observable<string>;
|
|
58
|
+
/** Whether the session has its contracts yet. */
|
|
59
|
+
export declare const consoleReady: import("@peers-app/peers-sdk").Observable<boolean>;
|
|
60
|
+
/** What the person ran on this device, oldest first; empty until the Console has started. */
|
|
61
|
+
export declare function consoleHistory(): readonly string[];
|
|
62
|
+
/** The names code at the Console sees. */
|
|
63
|
+
export declare const consoleScope: ConsoleScope;
|
|
64
|
+
/** Print values in the Console's output. */
|
|
65
|
+
export declare function consolePrint(...values: unknown[]): void;
|
|
66
|
+
/**
|
|
67
|
+
* Empty the output, except entries still running or waiting to run, whose results would
|
|
68
|
+
* otherwise have nowhere to show.
|
|
69
|
+
*
|
|
70
|
+
* @param except An entry to remove even so: the `clear()` that's running.
|
|
71
|
+
*/
|
|
72
|
+
export declare function clearConsole(except?: string): void;
|
|
73
|
+
/**
|
|
74
|
+
* Reload the contracts when the session's group serves a different set than it loaded: one
|
|
75
|
+
* `listContracts` call, and a reload only on a difference, so a package restart that changes
|
|
76
|
+
* nothing keeps the person's handles and subscriptions. On a host without `listContracts`, it
|
|
77
|
+
* changes and shows nothing. It's let go after `waitMs`, and a reply that comes later changes
|
|
78
|
+
* nothing.
|
|
79
|
+
*
|
|
80
|
+
* @param waitMs How long to wait for the host before letting the look go.
|
|
81
|
+
* @returns When it's done or let go; a failure is shown in the output.
|
|
82
|
+
*/
|
|
83
|
+
export declare function refreshConsoleContracts(waitMs?: number): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Start the Console's session, once: wait for the host, load personal's contracts, and reload
|
|
86
|
+
* them in the same group when the host connection is replaced.
|
|
87
|
+
*
|
|
88
|
+
* @returns When the contracts are loaded. A failure is shown in the output, and the next call
|
|
89
|
+
* tries again.
|
|
90
|
+
*/
|
|
91
|
+
export declare function startConsole(): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Run code at the Console. Entries run one after another, as at Node's REPL; one that's waiting
|
|
94
|
+
* can be let go with {@link stopWaiting}.
|
|
95
|
+
*
|
|
96
|
+
* @param code What the person typed.
|
|
97
|
+
*/
|
|
98
|
+
export declare function runInConsole(code: string): void;
|
|
99
|
+
/**
|
|
100
|
+
* Stop waiting for an entry, so the next one can run. Its calls may still finish on the host.
|
|
101
|
+
*
|
|
102
|
+
* @param id The entry's id.
|
|
103
|
+
*/
|
|
104
|
+
export declare function stopWaiting(id: string): void;
|
|
105
|
+
/** End the session and forget everything: for tests. */
|
|
106
|
+
export declare function resetConsoleForTests(): void;
|