@xpufx/paseo-top 0.4.3 → 0.4.4

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.
Files changed (33) hide show
  1. package/client/pill-labels.ts +30 -6
  2. package/client/pill.tsx +40 -61
  3. package/client/settings-events.ts +33 -0
  4. package/client/surface.tsx +6 -2
  5. package/client/vendor/paseo-plugin-helper/components/Badge.tsx +12 -0
  6. package/client/vendor/paseo-plugin-helper/components/Button.tsx +22 -2
  7. package/client/vendor/paseo-plugin-helper/components/Card.tsx +32 -0
  8. package/client/vendor/paseo-plugin-helper/components/DataTable.tsx +17 -1
  9. package/client/vendor/paseo-plugin-helper/components/InlineButton.tsx +14 -1
  10. package/client/vendor/paseo-plugin-helper/components/InteractiveRow.tsx +142 -0
  11. package/client/vendor/paseo-plugin-helper/components/SearchInput.tsx +16 -2
  12. package/client/vendor/paseo-plugin-helper/components/SectionHeader.tsx +7 -0
  13. package/client/vendor/paseo-plugin-helper/components/Select.tsx +131 -63
  14. package/client/vendor/paseo-plugin-helper/components/index.ts +1 -0
  15. package/client/vendor/paseo-plugin-helper/custom-pills.tsx +4 -3
  16. package/client/vendor/paseo-plugin-helper/host.ts +12 -58
  17. package/client/vendor/paseo-plugin-helper/index.ts +1 -0
  18. package/client/vendor/paseo-plugin-helper/layout/ModalBody.tsx +17 -27
  19. package/client/vendor/paseo-plugin-helper/pill.tsx +68 -321
  20. package/client/vendor/paseo-plugin-helper/surface.tsx +62 -2
  21. package/client/vendor/paseo-plugin-helper/tickets.tsx +766 -0
  22. package/index.server.ts +7 -0
  23. package/package.json +11 -2
  24. package/server/vendor/paseo-plugin-helper/index.ts +2 -0
  25. package/server/vendor/paseo-plugin-helper/mcp-injection.ts +20 -2
  26. package/server/vendor/paseo-plugin-helper/plugins.ts +184 -19
  27. package/server/vendor/paseo-plugin-helper/tickets.ts +1281 -0
  28. package/shared/helper-version.ts +20 -0
  29. package/shared/multi-host.ts +11 -4
  30. package/shared/resources.ts +1 -1
  31. package/shared/vendor/paseo-plugin-helper/index.ts +1 -0
  32. package/shared/vendor/paseo-plugin-helper/tickets.ts +1010 -0
  33. package/shared/version.ts +1 -1
@@ -1,4 +1,5 @@
1
1
  import React, { type ComponentType } from "react";
2
+ import { View } from "react-native";
2
3
  import type { HostSurfaceProps as PluginSurfaceProps } from "./host";
3
4
  import { PluginThemeProvider } from "./theme/provider";
4
5
  import { ModalBodyScrollOwnerContext } from "./layout/ModalBody";
@@ -19,8 +20,54 @@ export interface RegisterSidebarSurfaceOptions {
19
20
  icon: string;
20
21
  Component: ComponentType<PluginSurfaceProps>;
21
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;
22
36
  }
23
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
+
24
71
  /**
25
72
  * Registers a sidebar icon and corresponding full-page surface in a single call,
26
73
  * automatically injecting `<PluginThemeProvider>` with custom visual flair.
@@ -44,12 +91,25 @@ export function registerSidebarSurface(
44
91
  plugin: SidebarSurfaceRegistrar,
45
92
  options: RegisterSidebarSurfaceOptions,
46
93
  ): () => void {
47
- const { id, title, icon, Component, flair } = options;
94
+ const {
95
+ id,
96
+ title,
97
+ icon,
98
+ Component,
99
+ flair,
100
+ maxContentWidth = DEFAULT_SIDEBAR_MAX_CONTENT_WIDTH,
101
+ } = options;
48
102
 
49
103
  const WrappedComponent: ComponentType<PluginSurfaceProps> = (props) => (
50
104
  <PluginThemeProvider theme={props.theme} layout={props.layout} flair={flair}>
51
105
  <ModalBodyScrollOwnerContext.Provider value="required">
52
- <Component {...props} />
106
+ {maxContentWidth === false ? (
107
+ <Component {...props} />
108
+ ) : (
109
+ <SurfaceContentColumn maxContentWidth={maxContentWidth}>
110
+ <Component {...props} />
111
+ </SurfaceContentColumn>
112
+ )}
53
113
  </ModalBodyScrollOwnerContext.Provider>
54
114
  </PluginThemeProvider>
55
115
  );