@xpufx/paseo-top 0.4.3 → 0.4.5
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/OVERVIEW.md +17 -0
- package/client/host-ui.tsx +184 -0
- package/client/multi-host-view.tsx +57 -43
- package/client/multi-host.ts +36 -13
- package/client/pill-labels.ts +124 -7
- package/client/pill.tsx +724 -669
- package/client/resources-query.ts +1 -1
- package/client/settings-events.ts +33 -0
- package/client/settings-ui.tsx +86 -9
- package/client/surface.tsx +310 -274
- package/client/telemetry-copy.ts +8 -2
- package/client/telemetry.tsx +372 -321
- package/client/turn-panel.tsx +126 -104
- package/client/vendor/paseo-plugin-helper/{host.ts → core/host.ts} +21 -61
- package/client/vendor/paseo-plugin-helper/core/index.ts +76 -0
- package/client/vendor/paseo-plugin-helper/core/plugin-load-count.ts +89 -0
- package/client/vendor/paseo-plugin-helper/{query-refresh.ts → core/query-refresh.ts} +2 -2
- package/client/vendor/paseo-plugin-helper/{query.ts → core/query.ts} +2 -2
- package/client/vendor/paseo-plugin-helper/{settings.ts → core/settings.ts} +1 -1
- package/client/vendor/paseo-plugin-helper/{shared-settings.ts → core/shared-settings.ts} +2 -2
- package/client/vendor/paseo-plugin-helper/{utils → lifecycle}/clipboard.ts +2 -2
- package/client/vendor/paseo-plugin-helper/lifecycle/flair.ts +26 -0
- package/client/vendor/paseo-plugin-helper/{theme/color-utils.ts → lifecycle/host-color.ts} +95 -38
- package/client/vendor/paseo-plugin-helper/lifecycle/host-theme.tsx +109 -0
- package/client/vendor/paseo-plugin-helper/lifecycle/index.ts +23 -0
- package/client/vendor/paseo-plugin-helper/lifecycle/multi-host.ts +66 -0
- package/client/vendor/paseo-plugin-helper/{panel.tsx → lifecycle/panel.tsx} +7 -7
- package/client/vendor/paseo-plugin-helper/{pill.tsx → lifecycle/pill.tsx} +118 -338
- package/client/vendor/paseo-plugin-helper/lifecycle/providers.tsx +46 -0
- package/client/vendor/paseo-plugin-helper/lifecycle/scroll-owner.ts +26 -0
- package/client/vendor/paseo-plugin-helper/lifecycle/surface.tsx +140 -0
- package/client/vendor/paseo-plugin-helper/ui/color.ts +1 -0
- package/client/vendor/paseo-plugin-helper/ui/content.tsx +1326 -0
- package/client/vendor/paseo-plugin-helper/ui/controls.tsx +1018 -0
- package/client/vendor/paseo-plugin-helper/{components/DataTable.tsx → ui/data.tsx} +55 -47
- package/client/vendor/paseo-plugin-helper/ui/index.ts +44 -0
- package/client/vendor/paseo-plugin-helper/ui/layout.tsx +263 -0
- package/client/vendor/paseo-plugin-helper/ui/modal.tsx +111 -0
- package/client/vendor/paseo-plugin-helper/ui/plugin-reload-banner.tsx +119 -0
- package/client/vendor/paseo-plugin-helper/{settings-screen.tsx → ui/settings-screen.tsx} +3 -3
- package/client/vendor/paseo-plugin-helper/ui/settings.ts +36 -0
- package/client/vendor/paseo-plugin-helper/ui/text.tsx +821 -0
- package/client/vendor/paseo-plugin-helper/ui/theme.tsx +1 -0
- package/client/vendor/permission-audit/client.tsx +706 -0
- package/client/vendor/permission-audit/index.tsx +1 -0
- package/index.client.tsx +58 -37
- package/index.server.ts +256 -227
- package/package.json +14 -2
- package/paseo-plugin.json +2 -0
- package/screenshots/1-paseo-top-modal-system.jpg +0 -0
- package/screenshots/2-paseo-top-modal-workspace.jpg +0 -0
- package/screenshots/3-paseo-top-modal-settings.jpg +0 -0
- package/screenshots/4-paseo-top-modal-about.jpg +0 -0
- package/screenshots/paseo-top-dashboard.jpg +0 -0
- package/screenshots/paseo-top-general-view.jpg +0 -0
- package/server/resources.ts +98 -0
- package/server/vendor/paseo-plugin-helper/custom-pills.ts +70 -0
- package/server/vendor/paseo-plugin-helper/index.ts +4 -0
- package/server/vendor/paseo-plugin-helper/logger.ts +5 -16
- package/server/vendor/paseo-plugin-helper/mcp-injection.ts +20 -2
- package/server/vendor/paseo-plugin-helper/plugins.ts +184 -19
- package/server/vendor/paseo-plugin-helper/rpc-guard.ts +2 -2
- package/server/vendor/paseo-plugin-helper/storage-guard.ts +294 -0
- package/server/vendor/paseo-plugin-helper/storage.ts +36 -2
- package/server/vendor/paseo-plugin-helper/telemetry.ts +486 -0
- package/server/vendor/paseo-plugin-helper/tickets.ts +1232 -0
- package/server/vendor/permission-audit/index.ts +1 -0
- package/server/vendor/permission-audit/server.ts +839 -0
- package/shared/helper-version.ts +20 -0
- package/shared/multi-host.ts +156 -155
- package/shared/resources.ts +146 -1
- package/shared/vendor/paseo-plugin-helper/async.ts +14 -7
- package/shared/vendor/paseo-plugin-helper/features.ts +244 -0
- package/shared/vendor/paseo-plugin-helper/forge.ts +27 -0
- package/shared/vendor/paseo-plugin-helper/index.ts +2 -0
- package/shared/vendor/paseo-plugin-helper/tickets.ts +1104 -0
- package/shared/vendor/permission-audit/filter.ts +61 -0
- package/shared/vendor/permission-audit/index.ts +2 -0
- package/shared/vendor/permission-audit/shared.ts +119 -0
- package/shared/version.ts +1 -1
- package/client/vendor/paseo-plugin-helper/components/AboutSection.tsx +0 -493
- package/client/vendor/paseo-plugin-helper/components/AttentionBeacon.tsx +0 -250
- package/client/vendor/paseo-plugin-helper/components/Badge.tsx +0 -156
- package/client/vendor/paseo-plugin-helper/components/Button.tsx +0 -184
- package/client/vendor/paseo-plugin-helper/components/Card.tsx +0 -225
- package/client/vendor/paseo-plugin-helper/components/CodeBlock.tsx +0 -196
- package/client/vendor/paseo-plugin-helper/components/Collapsible.tsx +0 -277
- package/client/vendor/paseo-plugin-helper/components/CommandBox.tsx +0 -172
- package/client/vendor/paseo-plugin-helper/components/CopyButton.tsx +0 -180
- package/client/vendor/paseo-plugin-helper/components/EmptyState.tsx +0 -97
- package/client/vendor/paseo-plugin-helper/components/HighlightedText.tsx +0 -70
- package/client/vendor/paseo-plugin-helper/components/InlineButton.tsx +0 -75
- package/client/vendor/paseo-plugin-helper/components/KeyValue.tsx +0 -446
- package/client/vendor/paseo-plugin-helper/components/MetricGauge.tsx +0 -247
- package/client/vendor/paseo-plugin-helper/components/ProgressBar.tsx +0 -117
- package/client/vendor/paseo-plugin-helper/components/Responsive.tsx +0 -53
- package/client/vendor/paseo-plugin-helper/components/SearchInput.tsx +0 -118
- package/client/vendor/paseo-plugin-helper/components/SectionHeader.tsx +0 -80
- package/client/vendor/paseo-plugin-helper/components/Select.tsx +0 -215
- package/client/vendor/paseo-plugin-helper/components/StatusDot.tsx +0 -80
- package/client/vendor/paseo-plugin-helper/components/Tabs.tsx +0 -319
- package/client/vendor/paseo-plugin-helper/components/TextInput.tsx +0 -150
- package/client/vendor/paseo-plugin-helper/components/Toggle.tsx +0 -163
- package/client/vendor/paseo-plugin-helper/components/TruncatedText.tsx +0 -157
- package/client/vendor/paseo-plugin-helper/components/index.ts +0 -25
- package/client/vendor/paseo-plugin-helper/custom-pills.tsx +0 -224
- package/client/vendor/paseo-plugin-helper/forge-icon.tsx +0 -79
- package/client/vendor/paseo-plugin-helper/icon.tsx +0 -39
- package/client/vendor/paseo-plugin-helper/index.ts +0 -29
- package/client/vendor/paseo-plugin-helper/layout/ActionBar.tsx +0 -49
- package/client/vendor/paseo-plugin-helper/layout/FormRow.tsx +0 -103
- package/client/vendor/paseo-plugin-helper/layout/Grid.tsx +0 -65
- package/client/vendor/paseo-plugin-helper/layout/ModalBody.tsx +0 -378
- package/client/vendor/paseo-plugin-helper/layout/ModalContent.tsx +0 -51
- package/client/vendor/paseo-plugin-helper/layout/Row.tsx +0 -39
- package/client/vendor/paseo-plugin-helper/layout/Stack.tsx +0 -39
- package/client/vendor/paseo-plugin-helper/layout/index.ts +0 -7
- package/client/vendor/paseo-plugin-helper/styles/index.ts +0 -1
- package/client/vendor/paseo-plugin-helper/styles/recipes.ts +0 -550
- package/client/vendor/paseo-plugin-helper/surface.tsx +0 -80
- package/client/vendor/paseo-plugin-helper/theme/flair.ts +0 -76
- package/client/vendor/paseo-plugin-helper/theme/host-variables.ts +0 -121
- package/client/vendor/paseo-plugin-helper/theme/index.ts +0 -7
- package/client/vendor/paseo-plugin-helper/theme/provider.tsx +0 -178
- package/client/vendor/paseo-plugin-helper/theme/responsive.ts +0 -213
- package/client/vendor/paseo-plugin-helper/theme/tokens.ts +0 -200
- package/client/vendor/paseo-plugin-helper/theme/useResponsive.ts +0 -57
- /package/client/vendor/paseo-plugin-helper/{command-center.ts → core/command-center.ts} +0 -0
- /package/client/vendor/paseo-plugin-helper/{snapshot.ts → core/snapshot.ts} +0 -0
- /package/client/vendor/paseo-plugin-helper/{utils → lifecycle}/haptics.ts +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { type ComponentType, type ReactNode } from "react";
|
|
2
|
+
import type { PluginTheme } from "../../../../shared/vendor/paseo-plugin-helper/types";
|
|
3
|
+
import type { HostLayout } from "../core/host";
|
|
4
|
+
import type { VisualFlair } from "./flair";
|
|
5
|
+
import { HostThemeProvider } from "./host-theme";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Presentational seam for the lifecycle registration engines.
|
|
9
|
+
*
|
|
10
|
+
* The bespoke `client/` design system was removed (#938), so no installer
|
|
11
|
+
* remains: `RegistrarThemeScope` mounts only `HostThemeProvider` (the host
|
|
12
|
+
* `theme` prop drives every ui/ adapter). The legacy-provider hook stays for
|
|
13
|
+
* callers that mounted their own theme provider before the removal.
|
|
14
|
+
*/
|
|
15
|
+
export interface RegistrarThemeProps {
|
|
16
|
+
theme: PluginTheme;
|
|
17
|
+
layout?: HostLayout;
|
|
18
|
+
flair?: Partial<VisualFlair>;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type RegistrarLegacyThemeProvider = ComponentType<RegistrarThemeProps>;
|
|
23
|
+
|
|
24
|
+
let legacyThemeProvider: RegistrarLegacyThemeProvider | undefined;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Installed once by a legacy theme shim. Keeping it out of the `lifecycle/`
|
|
28
|
+
* entry's runtime imports is what lets that entry stay free of any UI kit.
|
|
29
|
+
*/
|
|
30
|
+
export function setRegistrarLegacyThemeProvider(
|
|
31
|
+
provider: RegistrarLegacyThemeProvider | undefined,
|
|
32
|
+
): void {
|
|
33
|
+
legacyThemeProvider = provider;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Mounts the host theme (always) and the legacy provider (when installed). */
|
|
37
|
+
export function RegistrarThemeScope({ theme, layout, flair, children }: RegistrarThemeProps) {
|
|
38
|
+
const hostTheme = <HostThemeProvider theme={theme}>{children}</HostThemeProvider>;
|
|
39
|
+
const Legacy = legacyThemeProvider;
|
|
40
|
+
if (!Legacy) return hostTheme;
|
|
41
|
+
return (
|
|
42
|
+
<Legacy theme={theme} layout={layout} flair={flair}>
|
|
43
|
+
{hostTheme}
|
|
44
|
+
</Legacy>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Scroll-ownership signal emitted by the lifecycle registration engines.
|
|
5
|
+
*
|
|
6
|
+
* - `"helper"` — the default; the content owns its own scrolling.
|
|
7
|
+
* - `"host"` — an ancestor host view already provides the one scroller
|
|
8
|
+
* (0.8 composer popovers), so the content renders plain.
|
|
9
|
+
* - `"required"` — the ancestor has NO host scroller and the content is
|
|
10
|
+
* host-sized, so it MUST own the scroll on every surface. Set by
|
|
11
|
+
* `registerSidebarSurface` (a plugin surface is a full host page whose body
|
|
12
|
+
* is not wrapped in a host scroller).
|
|
13
|
+
* - `"popover"` — the host anchored-popover already supplies the sole scroller.
|
|
14
|
+
*
|
|
15
|
+
* The context lives in `lifecycle/` so the registration engines can mark the
|
|
16
|
+
* subtrees they render without importing any UI kit. It survived the removal of
|
|
17
|
+
* the bespoke `ModalBody` reader (#938) as a signal plugins and the host can
|
|
18
|
+
* still consume.
|
|
19
|
+
*/
|
|
20
|
+
export type ModalBodyScrollOwner = "helper" | "host" | "required" | "popover";
|
|
21
|
+
|
|
22
|
+
const SCROLL_OWNER_CONTEXT_KEY = Symbol.for("paseo.modalBodyScrollOwnerContext");
|
|
23
|
+
|
|
24
|
+
export const ModalBodyScrollOwnerContext: React.Context<ModalBodyScrollOwner> =
|
|
25
|
+
((globalThis as any)[SCROLL_OWNER_CONTEXT_KEY] ??= createContext<ModalBodyScrollOwner>("helper"));
|
|
26
|
+
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import React, { type ComponentType } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import type { HostSurfaceProps as PluginSurfaceProps } from "../core/host";
|
|
4
|
+
import type { VisualFlair } from "./flair";
|
|
5
|
+
import { ModalBodyScrollOwnerContext } from "./scroll-owner";
|
|
6
|
+
import { RegistrarThemeScope } from "./providers";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Structural registrar interface satisfied by both Paseo v0.7 PluginContext
|
|
10
|
+
* and Paseo v0.8 PluginClientContext.
|
|
11
|
+
*/
|
|
12
|
+
export interface SidebarSurfaceRegistrar {
|
|
13
|
+
addSurface(surfaceId: string, Component: ComponentType<PluginSurfaceProps>): any;
|
|
14
|
+
addSidebarItem(contribution: any): any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface RegisterSidebarSurfaceOptions {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
icon: string;
|
|
21
|
+
Component: ComponentType<PluginSurfaceProps>;
|
|
22
|
+
flair?: VisualFlair;
|
|
23
|
+
/**
|
|
24
|
+
* Upper bound (px) on the surface's content column, for readability on very
|
|
25
|
+
* wide viewports. `false` opts out entirely, for surfaces that are genuinely
|
|
26
|
+
* canvas-shaped — graph visualisers, wide tables, timeline views — where a
|
|
27
|
+
* centred column would fight the content rather than help it.
|
|
28
|
+
*
|
|
29
|
+
* Defaults to {@link DEFAULT_SIDEBAR_MAX_CONTENT_WIDTH} rather than being
|
|
30
|
+
* per-call opt-in. Ten call sites already pass a `maxContentWidth` to
|
|
31
|
+
* `ModalBody` and ignore it in ten others, so making the cap opt-in would
|
|
32
|
+
* reproduce exactly the inconsistency it is meant to remove — a guard that
|
|
33
|
+
* only fires where someone remembered it.
|
|
34
|
+
*/
|
|
35
|
+
maxContentWidth?: number | false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Default ceiling for a sidebar surface's content column.
|
|
40
|
+
*
|
|
41
|
+
* A sidebar surface is a full host page, so on a wide monitor it stretches
|
|
42
|
+
* edge to edge and line lengths become unreadable. This is a ceiling, not a
|
|
43
|
+
* target: the column stays fluid below it and is centred above it, exactly as
|
|
44
|
+
* `ModalBody`'s own `maxContentWidth` behaves. 1280 is a common wide-viewport
|
|
45
|
+
* breakpoint rather than a number derived from any plugin's content.
|
|
46
|
+
*/
|
|
47
|
+
export const DEFAULT_SIDEBAR_MAX_CONTENT_WIDTH = 1280;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Caps a surface's content column without dictating its width.
|
|
51
|
+
*
|
|
52
|
+
* `width: "100%"` keeps the column fluid *below* the cap, so a narrow window
|
|
53
|
+
* behaves exactly as it did before this existed. `alignSelf: "center"` only
|
|
54
|
+
* has an effect once the column is capped, and it is the same mechanism
|
|
55
|
+
* `ModalBody` uses — see the comment at ModalBody.tsx:173 for why auto side
|
|
56
|
+
* margins are preferred there and why this is safe here: outside a ScrollView
|
|
57
|
+
* content container there is nothing to stop the column stretching.
|
|
58
|
+
*/
|
|
59
|
+
const SurfaceContentColumn = ({
|
|
60
|
+
maxContentWidth,
|
|
61
|
+
children,
|
|
62
|
+
}: {
|
|
63
|
+
maxContentWidth: number;
|
|
64
|
+
children: React.ReactNode;
|
|
65
|
+
}) => (
|
|
66
|
+
<View style={{ width: "100%", maxWidth: maxContentWidth, alignSelf: "center", flex: 1 }}>
|
|
67
|
+
{children}
|
|
68
|
+
</View>
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Registers a sidebar icon and corresponding full-page surface in a single call,
|
|
73
|
+
* automatically injecting `<PluginThemeProvider>` with custom visual flair.
|
|
74
|
+
* Works with both Paseo v0.7 PluginContext and Paseo v0.8 PluginClientContext.
|
|
75
|
+
*
|
|
76
|
+
* A sidebar surface is a full host page: Paseo routes to it directly and does
|
|
77
|
+
* NOT wrap the surface body in a host scroller (unlike `<Modal.Content>`, which
|
|
78
|
+
* bounds the dialog and supplies the outer scroll). Any `ModalBody` in the
|
|
79
|
+
* subtree would therefore pick the plain, non-scrolling branch on a
|
|
80
|
+
* non-compact desktop and clip overflowing content — the recurring
|
|
81
|
+
* "plugin page does not scroll" bug. Marking the subtree with the
|
|
82
|
+
* `"required"` scroll-owner context makes every `ModalBody` inside own the
|
|
83
|
+
* scroll on every surface, so plugins inherit working scroll with no
|
|
84
|
+
* per-plugin workaround.
|
|
85
|
+
*
|
|
86
|
+
* Returns an idempotent disposer that removes both the surface and the sidebar
|
|
87
|
+
* item, matching every other helper `add*` registration. Existing callers that
|
|
88
|
+
* ignore the return value are unaffected.
|
|
89
|
+
*/
|
|
90
|
+
export function registerSidebarSurface(
|
|
91
|
+
plugin: SidebarSurfaceRegistrar,
|
|
92
|
+
options: RegisterSidebarSurfaceOptions,
|
|
93
|
+
): () => void {
|
|
94
|
+
const {
|
|
95
|
+
id,
|
|
96
|
+
title,
|
|
97
|
+
icon,
|
|
98
|
+
Component,
|
|
99
|
+
flair,
|
|
100
|
+
maxContentWidth = DEFAULT_SIDEBAR_MAX_CONTENT_WIDTH,
|
|
101
|
+
} = options;
|
|
102
|
+
|
|
103
|
+
const WrappedComponent: ComponentType<PluginSurfaceProps> = (props) => (
|
|
104
|
+
<RegistrarThemeScope theme={props.theme} layout={props.layout} flair={flair}>
|
|
105
|
+
<ModalBodyScrollOwnerContext.Provider value="required">
|
|
106
|
+
{maxContentWidth === false ? (
|
|
107
|
+
<Component {...props} />
|
|
108
|
+
) : (
|
|
109
|
+
<SurfaceContentColumn maxContentWidth={maxContentWidth}>
|
|
110
|
+
<Component {...props} />
|
|
111
|
+
</SurfaceContentColumn>
|
|
112
|
+
)}
|
|
113
|
+
</ModalBodyScrollOwnerContext.Provider>
|
|
114
|
+
</RegistrarThemeScope>
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const surfaceRegistration = plugin.addSurface(id, WrappedComponent);
|
|
118
|
+
const itemRegistration = plugin.addSidebarItem({
|
|
119
|
+
id,
|
|
120
|
+
title,
|
|
121
|
+
icon,
|
|
122
|
+
surface: id,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
let disposed = false;
|
|
126
|
+
return () => {
|
|
127
|
+
if (disposed) return;
|
|
128
|
+
disposed = true;
|
|
129
|
+
// Host registrations expose `remove()`; tolerate hosts that return a bare
|
|
130
|
+
// function or nothing so cleanup never throws.
|
|
131
|
+
for (const registration of [itemRegistration, surfaceRegistration]) {
|
|
132
|
+
if (!registration) continue;
|
|
133
|
+
if (typeof registration === "function") {
|
|
134
|
+
(registration as () => void)();
|
|
135
|
+
} else if (typeof registration.remove === "function") {
|
|
136
|
+
registration.remove();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../lifecycle/host-color";
|