@capybara-hq/plugin-client 0.1.0-rc.1 → 0.1.0-rc.2

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/define.d.ts CHANGED
@@ -4,10 +4,17 @@ import type { BaseComponentProps, CapybaraEventOf, CapybaraEventType, ClientApi,
4
4
  /** Bumped only on an incompatible change of the client API. */
5
5
  export declare const CLIENT_API_VERSION = 1;
6
6
  export type ComponentProps<S extends ComponentSlotId> = BaseComponentProps & SlotComponentProps[S];
7
- export interface ClientComponent<S extends ComponentSlotId = ComponentSlotId> {
8
- readonly slot: S;
9
- readonly render: ComponentType<ComponentProps<S>>;
10
- }
7
+ /**
8
+ * A component bound to one slot: `render` takes that slot's props. Without a type argument (or
9
+ * with a union of slots) it is the union of the single-slot bindings, so a `components` map may
10
+ * hold components of different slots while each keeps its own slot's props.
11
+ */
12
+ export type ClientComponent<S extends ComponentSlotId = ComponentSlotId> = {
13
+ [K in S]: {
14
+ readonly slot: K;
15
+ readonly render: ComponentType<ComponentProps<K>>;
16
+ };
17
+ }[S];
11
18
  /** Binds a component to the slot it is written for; the host checks it against the manifest. */
12
19
  export declare function defineComponent<S extends ComponentSlotId>(slot: S, render: ComponentType<ComponentProps<S>>): ClientComponent<S>;
13
20
  export interface ClientExtensionDefinition {
package/dist/types.d.ts CHANGED
@@ -95,8 +95,12 @@ export interface SlotComponentProps {
95
95
  "org.settings.section": Record<string, never>;
96
96
  "platform.page": Record<string, never>;
97
97
  "shell.brand": {
98
+ /** The built-in brand (the Logo, its wordmark only in the full sidebar and the drawer). */
98
99
  builtin: ReactNode;
100
+ /** The sidebar is the rail. */
99
101
  collapsed: boolean;
102
+ /** The sidebar panel this node is drawn in; the host renders the brand once per drawn panel. */
103
+ panel: "full" | "rail" | "drawer";
100
104
  };
101
105
  "shell.overlay": Record<string, never>;
102
106
  "conversation.empty": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capybara-hq/plugin-client",
3
- "version": "0.1.0-rc.1",
3
+ "version": "0.1.0-rc.2",
4
4
  "description": "Capybara plugin client SDK: the types, hooks and design re-exports a plugin's client entry is written against",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {