@w6w/ui 0.2.0 → 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 (78) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/AppPicker.d.ts +47 -2
  3. package/dist/CanvasLayer.d.ts +38 -0
  4. package/dist/{CodeBlock-Dot3Pd7P.js → CodeBlock-BqXDA35P.js} +2 -2
  5. package/dist/{CodeBlock-Dot3Pd7P.js.map → CodeBlock-BqXDA35P.js.map} +1 -1
  6. package/dist/{CodeBlock-CZu4TFSi.cjs → CodeBlock-CulfbnZD.cjs} +2 -2
  7. package/dist/{CodeBlock-CZu4TFSi.cjs.map → CodeBlock-CulfbnZD.cjs.map} +1 -1
  8. package/dist/ConfirmModal-Ln99S9NT.js +7919 -0
  9. package/dist/ConfirmModal-Ln99S9NT.js.map +1 -0
  10. package/dist/ConfirmModal-fjHW5rN-.cjs +14 -0
  11. package/dist/ConfirmModal-fjHW5rN-.cjs.map +1 -0
  12. package/dist/Copyable-DA6eiU7w.cjs +2 -0
  13. package/dist/Copyable-DA6eiU7w.cjs.map +1 -0
  14. package/dist/{Copyable-1niV9gUa.js → Copyable-F4NTaG77.js} +91 -15
  15. package/dist/Copyable-F4NTaG77.js.map +1 -0
  16. package/dist/EditConnectionModal.d.ts +6 -1
  17. package/dist/JsonEditor.d.ts +8 -0
  18. package/dist/Markdown.d.ts +25 -0
  19. package/dist/ParamsForm.d.ts +7 -1
  20. package/dist/StepBuilderModal.d.ts +23 -5
  21. package/dist/WorkflowFlowEditor.d.ts +14 -3
  22. package/dist/app-pages.d.ts +2 -0
  23. package/dist/canvas-types.d.ts +36 -0
  24. package/dist/canvas-utils.d.ts +44 -0
  25. package/dist/code.cjs +1 -1
  26. package/dist/code.mjs +2 -2
  27. package/dist/components/AuthFieldsForm.d.ts +11 -0
  28. package/dist/components/BudgetMeter.d.ts +15 -0
  29. package/dist/components/CallableList.d.ts +3 -2
  30. package/dist/components/Combobox.d.ts +8 -1
  31. package/dist/components/ConnectionList.d.ts +2 -3
  32. package/dist/components/CredentialPicker.d.ts +35 -0
  33. package/dist/components/DataTable.d.ts +27 -0
  34. package/dist/components/EmptyState.d.ts +9 -0
  35. package/dist/components/icons.d.ts +1 -1
  36. package/dist/dynamic-fields.d.ts +60 -0
  37. package/dist/editor-theme.d.ts +24 -0
  38. package/dist/flow-fanout.d.ts +2 -2
  39. package/dist/flow-types.d.ts +18 -1
  40. package/dist/flow-utils.d.ts +10 -3
  41. package/dist/flow.cjs +2 -2
  42. package/dist/flow.cjs.map +1 -1
  43. package/dist/flow.d.ts +9 -0
  44. package/dist/flow.mjs +1519 -1138
  45. package/dist/flow.mjs.map +1 -1
  46. package/dist/index.cjs +1 -1
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.ts +14 -2
  49. package/dist/index.mjs +1362 -1123
  50. package/dist/index.mjs.map +1 -1
  51. package/dist/note-markdown.d.ts +22 -0
  52. package/dist/provider.d.ts +56 -7
  53. package/dist/resolve-params.d.ts +5 -0
  54. package/dist/run-visuals.d.ts +4 -1
  55. package/dist/step-problems.d.ts +34 -0
  56. package/dist/types.d.ts +109 -3
  57. package/dist/use-dynamic-fields.d.ts +23 -0
  58. package/package.json +4 -2
  59. package/src/styles/_budget-meter.scss +46 -0
  60. package/src/styles/_callable-list.scss +15 -6
  61. package/src/styles/_canvas.scss +318 -0
  62. package/src/styles/_connections.scss +2 -14
  63. package/src/styles/_data-table.scss +55 -0
  64. package/src/styles/_empty-state.scss +21 -0
  65. package/src/styles/_flow.scss +11 -0
  66. package/src/styles/_fx.scss +23 -0
  67. package/src/styles/_layout.scss +10 -0
  68. package/src/styles/_markdown.scss +20 -0
  69. package/src/styles/_tester.scss +1 -14
  70. package/src/styles.css +572 -39
  71. package/src/styles.scss +5 -0
  72. package/dist/ConfirmModal-ChoiGy2K.cjs +0 -11
  73. package/dist/ConfirmModal-ChoiGy2K.cjs.map +0 -1
  74. package/dist/ConfirmModal-Wx3i8F1n.js +0 -6359
  75. package/dist/ConfirmModal-Wx3i8F1n.js.map +0 -1
  76. package/dist/Copyable-1niV9gUa.js.map +0 -1
  77. package/dist/Copyable-CYZU1o4X.cjs +0 -2
  78. package/dist/Copyable-CYZU1o4X.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -9,6 +9,13 @@ 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
+
12
19
  ## [0.2.0]
13
20
 
14
21
  - New presentational lists, props in and callbacks out, so a host can compose its own pages:
@@ -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,6 +99,7 @@ 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[];
@@ -81,4 +126,4 @@ export interface AppPickerProps {
81
126
  * with neither `listAppsPage` nor `listApps` settles into this same
82
127
  * mode's existing empty state — no request, no throw.
83
128
  */
84
- 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