@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,33 @@
|
|
|
1
|
+
import { shouldEmitSnapshotUpdate } from "./vendor/paseo-plugin-helper/core/index";
|
|
2
|
+
import type { TopSettings } from "../shared/resources";
|
|
3
|
+
|
|
4
|
+
export type SettingsListener = (settings: TopSettings) => void;
|
|
5
|
+
const settingsListeners = new Set<SettingsListener>();
|
|
6
|
+
let lastNotifiedSettings: TopSettings | null = null;
|
|
7
|
+
|
|
8
|
+
export function addSettingsListener(listener: SettingsListener): void {
|
|
9
|
+
settingsListeners.add(listener);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function removeSettingsListener(listener: SettingsListener): void {
|
|
13
|
+
settingsListeners.delete(listener);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function notifySettingsChanged(settings: TopSettings): void {
|
|
17
|
+
if (
|
|
18
|
+
!shouldEmitSnapshotUpdate(
|
|
19
|
+
lastNotifiedSettings as unknown as Record<string, unknown> | null,
|
|
20
|
+
settings as unknown as Record<string, unknown>,
|
|
21
|
+
)
|
|
22
|
+
) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
lastNotifiedSettings = settings;
|
|
26
|
+
for (const listener of settingsListeners) {
|
|
27
|
+
try {
|
|
28
|
+
listener(settings);
|
|
29
|
+
} catch {
|
|
30
|
+
// Ignore listener errors
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/client/settings-ui.tsx
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Text } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
HostButton,
|
|
5
|
+
HostRow,
|
|
6
|
+
HostStack,
|
|
7
|
+
useHostTheme,
|
|
8
|
+
} from "./host-ui";
|
|
4
9
|
|
|
5
10
|
export interface ChipOption<T extends string | number> {
|
|
6
11
|
id: T;
|
|
7
12
|
label: string;
|
|
13
|
+
icon?: string | React.ReactNode;
|
|
8
14
|
description?: string;
|
|
15
|
+
disabled?: boolean;
|
|
9
16
|
}
|
|
10
17
|
|
|
11
18
|
export interface ChoiceChipsProps<T extends string | number> {
|
|
@@ -18,8 +25,8 @@ export interface ChoiceChipsProps<T extends string | number> {
|
|
|
18
25
|
|
|
19
26
|
/**
|
|
20
27
|
* Single-select chip row shared by every Top settings surface. Built from the
|
|
21
|
-
*
|
|
22
|
-
*
|
|
28
|
+
* `ui/` Host primitives so the modal and the sidebar dashboard cannot drift
|
|
29
|
+
* into two hand-rolled chip systems.
|
|
23
30
|
*/
|
|
24
31
|
export function ChoiceChips<T extends string | number>({
|
|
25
32
|
options,
|
|
@@ -27,24 +34,94 @@ export function ChoiceChips<T extends string | number>({
|
|
|
27
34
|
onChange,
|
|
28
35
|
showActiveDescription = false,
|
|
29
36
|
}: ChoiceChipsProps<T>) {
|
|
30
|
-
const { colors } =
|
|
37
|
+
const { colors } = useHostTheme();
|
|
31
38
|
const selected = options.find((option) => option.id === value);
|
|
32
39
|
return (
|
|
33
|
-
<
|
|
34
|
-
<
|
|
40
|
+
<HostStack gap={6}>
|
|
41
|
+
<HostRow wrap gap={6}>
|
|
35
42
|
{options.map((option) => (
|
|
36
|
-
<
|
|
43
|
+
<HostButton
|
|
37
44
|
key={String(option.id)}
|
|
38
45
|
label={option.label}
|
|
46
|
+
icon={option.icon}
|
|
39
47
|
size="sm"
|
|
40
48
|
variant={option.id === value ? "primary" : "ghost"}
|
|
49
|
+
disabled={option.disabled}
|
|
41
50
|
onPress={() => onChange(option.id)}
|
|
42
51
|
/>
|
|
43
52
|
))}
|
|
44
|
-
</
|
|
53
|
+
</HostRow>
|
|
45
54
|
{showActiveDescription && selected?.description ? (
|
|
46
55
|
<Text style={{ fontSize: 9, color: colors.foregroundMuted }}>{selected.description}</Text>
|
|
47
56
|
) : null}
|
|
48
|
-
</
|
|
57
|
+
</HostStack>
|
|
49
58
|
);
|
|
50
59
|
}
|
|
60
|
+
|
|
61
|
+
export interface MultiChoiceChipsProps<T extends string | number> {
|
|
62
|
+
options: ChipOption<T>[];
|
|
63
|
+
selected: T[];
|
|
64
|
+
onToggle: (id: T) => void;
|
|
65
|
+
/** Inactive button variant, defaults to "secondary". */
|
|
66
|
+
inactiveVariant?: "secondary" | "ghost";
|
|
67
|
+
/** Optional select-all callback to render a helper button. */
|
|
68
|
+
onSelectAll?: () => void;
|
|
69
|
+
/** Optional clear-all callback to render a helper button. */
|
|
70
|
+
onClearAll?: () => void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Multi-select chip grid shared by Top settings surfaces for compact pill and
|
|
75
|
+
* timeline metric selection. Wraps fluidly without vertical runaway.
|
|
76
|
+
*/
|
|
77
|
+
export function MultiChoiceChips<T extends string | number>({
|
|
78
|
+
options,
|
|
79
|
+
selected,
|
|
80
|
+
onToggle,
|
|
81
|
+
inactiveVariant = "secondary",
|
|
82
|
+
onSelectAll,
|
|
83
|
+
onClearAll,
|
|
84
|
+
}: MultiChoiceChipsProps<T>) {
|
|
85
|
+
const selectedSet = new Set(selected);
|
|
86
|
+
return (
|
|
87
|
+
<HostStack gap={6}>
|
|
88
|
+
{(onSelectAll || onClearAll) && (
|
|
89
|
+
<HostRow gap={6} justify="end">
|
|
90
|
+
{onSelectAll && (
|
|
91
|
+
<HostButton
|
|
92
|
+
label="All"
|
|
93
|
+
size="sm"
|
|
94
|
+
variant="ghost"
|
|
95
|
+
onPress={onSelectAll}
|
|
96
|
+
/>
|
|
97
|
+
)}
|
|
98
|
+
{onClearAll && (
|
|
99
|
+
<HostButton
|
|
100
|
+
label="None"
|
|
101
|
+
size="sm"
|
|
102
|
+
variant="ghost"
|
|
103
|
+
onPress={onClearAll}
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
106
|
+
</HostRow>
|
|
107
|
+
)}
|
|
108
|
+
<HostRow wrap gap={6}>
|
|
109
|
+
{options.map((option) => {
|
|
110
|
+
const isSelected = selectedSet.has(option.id);
|
|
111
|
+
return (
|
|
112
|
+
<HostButton
|
|
113
|
+
key={String(option.id)}
|
|
114
|
+
label={option.label}
|
|
115
|
+
icon={option.icon}
|
|
116
|
+
size="sm"
|
|
117
|
+
variant={isSelected ? "primary" : inactiveVariant}
|
|
118
|
+
disabled={option.disabled}
|
|
119
|
+
onPress={() => onToggle(option.id)}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
})}
|
|
123
|
+
</HostRow>
|
|
124
|
+
</HostStack>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|