@w6w/ui 0.1.1 → 0.2.11

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 (87) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +7 -5
  3. package/dist/AppPicker.d.ts +48 -2
  4. package/dist/CanvasLayer.d.ts +38 -0
  5. package/dist/{CodeBlock-Dot3Pd7P.js → CodeBlock-BqXDA35P.js} +2 -2
  6. package/dist/{CodeBlock-Dot3Pd7P.js.map → CodeBlock-BqXDA35P.js.map} +1 -1
  7. package/dist/{CodeBlock-CZu4TFSi.cjs → CodeBlock-CulfbnZD.cjs} +2 -2
  8. package/dist/{CodeBlock-CZu4TFSi.cjs.map → CodeBlock-CulfbnZD.cjs.map} +1 -1
  9. package/dist/ConfirmModal-Ln99S9NT.js +7919 -0
  10. package/dist/ConfirmModal-Ln99S9NT.js.map +1 -0
  11. package/dist/ConfirmModal-fjHW5rN-.cjs +14 -0
  12. package/dist/ConfirmModal-fjHW5rN-.cjs.map +1 -0
  13. package/dist/ConnectionHeader.d.ts +19 -0
  14. package/dist/Copyable-DA6eiU7w.cjs +2 -0
  15. package/dist/Copyable-DA6eiU7w.cjs.map +1 -0
  16. package/dist/{Copyable-1niV9gUa.js → Copyable-F4NTaG77.js} +91 -15
  17. package/dist/Copyable-F4NTaG77.js.map +1 -0
  18. package/dist/EditConnectionModal.d.ts +26 -0
  19. package/dist/JsonEditor.d.ts +8 -0
  20. package/dist/Markdown.d.ts +25 -0
  21. package/dist/ParamsForm.d.ts +7 -1
  22. package/dist/StepBuilderModal.d.ts +23 -5
  23. package/dist/WorkflowFlowEditor.d.ts +14 -3
  24. package/dist/app-pages.d.ts +5 -0
  25. package/dist/canvas-types.d.ts +36 -0
  26. package/dist/canvas-utils.d.ts +44 -0
  27. package/dist/code.cjs +1 -1
  28. package/dist/code.mjs +2 -2
  29. package/dist/components/AuthFieldsForm.d.ts +19 -1
  30. package/dist/components/BudgetMeter.d.ts +15 -0
  31. package/dist/components/CallableList.d.ts +58 -0
  32. package/dist/components/Combobox.d.ts +8 -1
  33. package/dist/components/ConnectionList.d.ts +43 -0
  34. package/dist/components/CredentialPicker.d.ts +35 -0
  35. package/dist/components/DataTable.d.ts +27 -0
  36. package/dist/components/EmptyState.d.ts +9 -0
  37. package/dist/components/ListItem.d.ts +16 -6
  38. package/dist/components/ReliabilityChart.d.ts +10 -0
  39. package/dist/components/ReliabilityList.d.ts +47 -0
  40. package/dist/components/icons.d.ts +1 -1
  41. package/dist/connection-app-meta.d.ts +32 -0
  42. package/dist/dynamic-fields.d.ts +60 -0
  43. package/dist/editor-theme.d.ts +24 -0
  44. package/dist/flow-fanout.d.ts +2 -2
  45. package/dist/flow-types.d.ts +18 -1
  46. package/dist/flow-utils.d.ts +10 -3
  47. package/dist/flow.cjs +2 -2
  48. package/dist/flow.cjs.map +1 -1
  49. package/dist/flow.d.ts +9 -0
  50. package/dist/flow.mjs +1519 -1138
  51. package/dist/flow.mjs.map +1 -1
  52. package/dist/index.cjs +1 -1
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.d.ts +30 -2
  55. package/dist/index.mjs +2053 -1005
  56. package/dist/index.mjs.map +1 -1
  57. package/dist/note-markdown.d.ts +22 -0
  58. package/dist/provider.d.ts +73 -5
  59. package/dist/reliability-board-layout.d.ts +121 -0
  60. package/dist/resolve-params.d.ts +5 -0
  61. package/dist/run-visuals.d.ts +4 -1
  62. package/dist/step-problems.d.ts +34 -0
  63. package/dist/types.d.ts +117 -3
  64. package/dist/use-dynamic-fields.d.ts +23 -0
  65. package/package.json +5 -3
  66. package/src/styles/_budget-meter.scss +46 -0
  67. package/src/styles/_callable-list.scss +69 -0
  68. package/src/styles/_canvas.scss +318 -0
  69. package/src/styles/_connections.scss +88 -0
  70. package/src/styles/_data-table.scss +55 -0
  71. package/src/styles/_empty-state.scss +21 -0
  72. package/src/styles/_flow.scss +11 -0
  73. package/src/styles/_fx.scss +23 -0
  74. package/src/styles/_layout.scss +10 -0
  75. package/src/styles/_lists.scss +4 -0
  76. package/src/styles/_markdown.scss +20 -0
  77. package/src/styles/_reliability.scss +339 -0
  78. package/src/styles/_tester.scss +1 -14
  79. package/src/styles.css +1142 -17
  80. package/src/styles.scss +8 -0
  81. package/dist/ConfirmModal-8avl9Nv8.cjs +0 -11
  82. package/dist/ConfirmModal-8avl9Nv8.cjs.map +0 -1
  83. package/dist/ConfirmModal-CD-P8mhN.js +0 -6335
  84. package/dist/ConfirmModal-CD-P8mhN.js.map +0 -1
  85. package/dist/Copyable-1niV9gUa.js.map +0 -1
  86. package/dist/Copyable-CYZU1o4X.cjs +0 -2
  87. package/dist/Copyable-CYZU1o4X.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -9,6 +9,33 @@ repo's git history for exact dates and commits.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ - `WorkflowFlowEditor` takes an optional `stepProblems` map (`StepProblems`, exported from `./flow`)
13
+ and paints a missing-connection error ring and tooltip on each affected app step, repainting live
14
+ when the map changes. The host owns detection; omitted, the canvas renders as before.
15
+ - The step panel's Setup tab labels a connection that is absent from the loaded list "Missing
16
+ connection — choose another", and a failed connections fetch "Couldn't load connections" instead
17
+ of treating it as missing.
18
+
19
+ ## [0.2.0]
20
+
21
+ - New presentational lists, props in and callbacks out, so a host can compose its own pages:
22
+ `CallableList` (Functions and Endpoints rows, with a ui-owned row view-model),
23
+ `ReliabilityList` and `ReliabilityChart` (health of first- and third-party APIs, router-free),
24
+ and `ConnectionList`, `ConnectionHeader` (B-1u, E-1u, D-12u).
25
+ - `ListItem` takes an optional `href`. With it the row renders as a real `<a href>` (middle-click,
26
+ copy link, new tab); the click still reaches `onClick`, and `ListItem` never calls
27
+ `preventDefault`.
28
+ - `EditConnectionModal`: rename a connection and replace part of its credential; blank fields keep
29
+ the stored value. It is the sixth component that reads the `W6WUIProvider` client.
30
+ - `W6WApi` gains an optional `updateConnection(id, body)` (`PATCH /connections/:id`), implemented by
31
+ `createW6WApi`. Without it `EditConnectionModal` shows no Save button, so existing custom clients
32
+ keep compiling.
33
+ - `AuthFieldsForm` takes `mode?: "create" | "edit"` (default `"create"`, unchanged behaviour).
34
+ - `listApps` (the `createW6WApi` client the pickers use) walks ONE pinned snapshot of the catalog: the
35
+ first page pins it and every later page reads that same snapshot. If the snapshot expires mid-walk,
36
+ the walk restarts once from the first page. `AppPicker` shows "N of M" and restarts on expiry. This
37
+ was prepared as 0.1.2, which was never published, so it ships first in 0.2.0.
38
+
12
39
  ## [0.1.1]
13
40
 
14
41
  - `styles.css` now carries React Flow's base rules (`.react-flow{`, handles, controls), so
package/README.md CHANGED
@@ -62,8 +62,8 @@ and the `test/` rigs). Vite needs nothing extra; a few setups do — see the
62
62
 
63
63
  ## Usage
64
64
 
65
- Five components call your W6W server themselves — `AppPicker`, `AddConnectionModal`,
66
- `ActionTestForm`, `StepBuilderModal` and `WorkflowFlowEditor`. They read one API client from
65
+ Six components call your W6W server themselves — `AppPicker`, `AddConnectionModal`,
66
+ `EditConnectionModal`, `ActionTestForm`, `StepBuilderModal` and `WorkflowFlowEditor`. They read one API client from
67
67
  `W6WUIProvider`. Every other component is props in, callbacks out.
68
68
 
69
69
  ```tsx
@@ -196,23 +196,25 @@ not pulled in automatically.
196
196
 
197
197
  ## Components
198
198
 
199
- 42 exported components (the count `pnpm coverage:stories` checks), grouped as in the docs:
199
+ 50 exported components (the count `pnpm coverage:stories` checks), grouped as in the docs:
200
200
 
201
201
  - **Providers**: `W6WUIProvider`, `ExpressionOptionsProvider` (plus `createW6WApi`, `useW6WApi`,
202
202
  `useExpressionOptions`, `startOAuthPopup`, `useEnterSubmit`).
203
203
  - **Buttons and icons**: `IconButton`, `Icon`, `EditButton`, `DeleteButton`.
204
- - **Data display**: `AppIcon`, `ListItem`, `Copyable`, `CopyableText`.
204
+ - **Data display**: `AppIcon`, `ListItem`, `CallableList`, `Copyable`, `CopyableText`.
205
205
  - **Forms**: `AppPicker`, `ActionTestForm`, `ParamsForm`, `PropertyEntryForm`, `AuthFieldsForm`,
206
206
  `ExpressionInput`, `NodeConfigForm`, `RetryPolicyFields`.
207
207
  - **Editors**: `CodeBlock`, `CodeEditor`, `JsonEditor`, `YamlEditor`.
208
208
  - **Workflow canvas**: `WorkflowFlowEditor` (from `@w6w/ui/flow`).
209
209
  - **Modals**: `Modal`, `ConfirmModal`, `AddConnectionModal`, `StepBuilderModal`.
210
210
  - **Status and health**: `HealthStatusPill`, `StepStatusPill`, `UptimeStrip`, `HistoryTimeline`,
211
- `RepoSyncIndicator`.
211
+ `RepoSyncIndicator`, `ReliabilityList`, `ReliabilityChart`.
212
212
  - **Executions**: `ExecutionList`, `ExecutionFilters`, `ExecutionStats`, `ExecutionDetail`,
213
213
  `ExecutionLogPanel`, `ApiCallsPanel`.
214
214
  - **Server resources**: `ServerResourcesCard`, `ServerResourcesCardSmall`, `ServerResourcesRail`,
215
215
  `ServerResourcesBadge`.
216
+ - **Connections**: `ConnectionList`, `ConnectionHeader`, `EditConnectionModal` (provider; needs
217
+ the optional `updateConnection` on the API client).
216
218
 
217
219
  Everything is exported from `@w6w/ui` except `WorkflowFlowEditor`, which is only in `@w6w/ui/flow`
218
220
  (alongside a re-export of `ExpressionOptionsProvider`). `@w6w/ui/code` re-exports `CodeBlock` and
@@ -1,10 +1,24 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { AppSummary, ThemeMode } from './types.ts';
3
+ /**
4
+ * The app's declared model-provider designation, or `null` when it declares
5
+ * none (A01). PRESENCE of `modelProvider` is the ONLY test — this never
6
+ * consults `categories`, so a category-`ai` app without a designation is not
7
+ * a provider and must never be surfaced as one.
8
+ */
9
+ export declare function modelProviderOf(app: AppSummary): NonNullable<AppSummary["modelProvider"]> | null;
3
10
  export interface AppPickerProps {
4
11
  /** Fired when the user picks an app card. */
5
12
  onSelectApp: (app: AppSummary) => void;
6
13
  theme?: ThemeMode;
7
- /** Optional pre-filter over the app list (e.g. only connectable apps). Applied CLIENT-side, on top of whatever page/list was fetched — never widens a fetch, only narrows what's shown. */
14
+ /**
15
+ * Optional pre-filter over the app list (e.g. only connectable apps).
16
+ * Applied CLIENT-side, on top of whatever page/list was fetched — never
17
+ * widens a fetch, only narrows what's shown. Because the server counted the
18
+ * apps this filter may then hide, a narrowing filter also removes the paged
19
+ * footer's denominator: the count reads `N apps`, never `N of total`.
20
+ * Prefer {@link ids} / {@link category} when the server can do the narrowing.
21
+ */
8
22
  filter?: (app: AppSummary) => boolean;
9
23
  /** Search-box placeholder. Defaults to "Search apps…". */
10
24
  searchPlaceholder?: string;
@@ -35,12 +49,42 @@ export interface AppPickerProps {
35
49
  * would be redundant.
36
50
  */
37
51
  categoryFilter?: boolean;
52
+ /**
53
+ * Render an opt-in model-provider filter BESIDE the category chips (crit 1,
54
+ * A01/A02): one toggle that narrows the list to apps carrying a
55
+ * `modelProvider` designation. It filters on the PRESENCE of `modelProvider`
56
+ * only — never on categories — so an undesignated category-`ai` app is never
57
+ * surfaced by it. Defaults to `false`, so no existing call site's behavior
58
+ * changes; the toggle itself is hidden when nothing in the visible catalog
59
+ * declares a provider (no dead-end filter, same rule as the category chips).
60
+ */
61
+ providerFilter?: boolean;
62
+ /**
63
+ * Opt-in bridge-support lookup, keyed by app id — the HOST passes this in,
64
+ * because this package never fetches (`GET /models/providers` carries
65
+ * `operations.complete` support and its `reasons`, and the host already
66
+ * holds that descriptor). Presence of an entry adds a chip beside the
67
+ * model-provider badge: "Bridge supported" when `supported`, else an
68
+ * "unsupported" chip carrying the entry's `reason` as both its text and its
69
+ * `title`. Omitting the prop (or an app having no entry) renders no chip at
70
+ * all, so every existing call site and snapshot is unchanged.
71
+ */
72
+ bridgeSupport?: ReadonlyMap<string, {
73
+ supported: boolean;
74
+ reason?: string;
75
+ }>;
38
76
  /**
39
77
  * Server-side `category` param for the bounded paged fetch (e.g. `"ai"` for
40
78
  * the AI tab) — sent to `W6WApi.listAppsPage`, never applied client-side.
41
79
  * Ignored when `apps` is supplied or the host has no `listAppsPage`.
42
80
  */
43
81
  category?: string;
82
+ /**
83
+ * Server-side id allow-list (`GET /apps?ids=a,b&paged=true`) for the bounded
84
+ * paged fetch: the page `total` is the FILTERED total, so the footer reads
85
+ * `N of N`. Sent to `listAppsPage`/`loadPage`; ignored when `apps` is supplied.
86
+ */
87
+ ids?: string[];
44
88
  /** Bounded page size for the paged fetch. Defaults to {@link DEFAULT_PAGE_LIMIT} (60). */
45
89
  pageLimit?: number;
46
90
  /**
@@ -55,10 +99,12 @@ export interface AppPickerProps {
55
99
  q?: string;
56
100
  cursor?: string;
57
101
  limit: number;
102
+ ids?: string[];
58
103
  signal: AbortSignal;
59
104
  }) => Promise<{
60
105
  apps: AppSummary[];
61
106
  nextCursor?: string;
107
+ total?: number;
62
108
  }>;
63
109
  }
64
110
  /**
@@ -80,4 +126,4 @@ export interface AppPickerProps {
80
126
  * with neither `listAppsPage` nor `listApps` settles into this same
81
127
  * mode's existing empty state — no request, no throw.
82
128
  */
83
- export declare function AppPicker({ onSelectApp, theme, filter, searchPlaceholder, emptyMessage, search, emptyAction, apps: providedApps, categoryFilter, category, pageLimit, loadPage, }: AppPickerProps): import("react").JSX.Element;
129
+ export declare function AppPicker({ onSelectApp, theme, filter, searchPlaceholder, emptyMessage, search, emptyAction, apps: providedApps, categoryFilter, providerFilter, bridgeSupport, category, ids, pageLimit, loadPage, }: AppPickerProps): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { FlowCanvas } from './canvas-types.ts';
2
+ export interface CanvasLayerProps {
3
+ canvas: FlowCanvas;
4
+ savePosition?: boolean;
5
+ /** Fired ONCE per finished edit (drop / blur / colour pick / format), never per frame. */
6
+ onChange?: (canvas: FlowCanvas) => void;
7
+ /**
8
+ * Fired once when a section is dropped after a drag, so the host can move the members by the
9
+ * same delta. When omitted, only the section's own position changes (via `onChange`).
10
+ */
11
+ onSectionDrop?: (id: string, delta: {
12
+ dx: number;
13
+ dy: number;
14
+ }) => void;
15
+ /** Ask the host to confirm-then-delete a note or section (the layer never deletes itself). */
16
+ onRequestDelete?: (kind: "note" | "section", id: string) => void;
17
+ /** Hides every control and disables drag. */
18
+ readOnly?: boolean;
19
+ /** Flow zoom, to turn screen-pixel drags into flow units. Resolved from the store in a flow. */
20
+ zoom?: number;
21
+ className?: string;
22
+ /**
23
+ * The element to portal into. Omit inside a React Flow: the enclosing flow's
24
+ * `.react-flow__viewport` is resolved from its DOM ref. Pass explicitly (tests, stories).
25
+ */
26
+ viewport?: Element | null;
27
+ }
28
+ export declare const SECTIONS_Z_INDEX = -2;
29
+ export declare const NOTES_Z_INDEX = -1;
30
+ /** The selected note's or section's toolbar sits above nodes and edges, unlike the box itself. */
31
+ export declare const NOTE_TOOLBAR_Z_INDEX = 1000;
32
+ /** The note colour palette offered by the toolbar (a custom colour is still accepted). */
33
+ export declare const NOTE_COLORS: string[];
34
+ /**
35
+ * Sections (z -2) and notes (z -1) rendered behind edges/nodes, inside the flow viewport; the
36
+ * selected note's or section's toolbar floats above everything.
37
+ */
38
+ export declare function CanvasLayer(props: CanvasLayerProps): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as $ } from "react/jsx-runtime";
2
2
  import { createElement as K, useCallback as V, useMemo as ge } from "react";
3
- import { C as de } from "./Copyable-1niV9gUa.js";
3
+ import { C as de } from "./Copyable-F4NTaG77.js";
4
4
  function re(e) {
5
5
  var t, a, l = "";
6
6
  if (typeof e == "string" || typeof e == "number") l += e;
@@ -2886,4 +2886,4 @@ function At(e) {
2886
2886
  export {
2887
2887
  At as C
2888
2888
  };
2889
- //# sourceMappingURL=CodeBlock-Dot3Pd7P.js.map
2889
+ //# sourceMappingURL=CodeBlock-BqXDA35P.js.map