@w6w/ui 0.2.54 → 0.2.55

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.
@@ -1,11 +1,59 @@
1
1
  import { FlowStep, FlowWorkflow } from './flow-types.ts';
2
- import { AuthDef, ConnectionSummary } from './types.ts';
2
+ import { AppSummary, AuthDef, ConnectionSummary } from './types.ts';
3
3
  export type FlowConnections = Record<string, {
4
4
  app: string;
5
5
  connection: string | null;
6
6
  }>;
7
+ export type ConnectionResourceEdit = {
8
+ type: "add";
9
+ name: string;
10
+ app: string;
11
+ connection: string;
12
+ } | {
13
+ type: "update";
14
+ ref: string;
15
+ name: string;
16
+ connection: string;
17
+ nodeIds?: string[];
18
+ } | {
19
+ type: "replace";
20
+ ref: string;
21
+ connection: string;
22
+ } | {
23
+ type: "rename";
24
+ ref: string;
25
+ name: string;
26
+ } | {
27
+ type: "remove";
28
+ ref: string;
29
+ } | {
30
+ type: "assign";
31
+ ref: string;
32
+ nodeIds: string[];
33
+ };
34
+ export interface WorkflowConnectionResources {
35
+ workflowId: string;
36
+ nodes: Pick<FlowStep, "id" | "uses">[];
37
+ connections: FlowConnections;
38
+ /** App identity already resolved for the canvas; reuse it in the connections rail. */
39
+ apps?: ReadonlyMap<string, AppSummary>;
40
+ readOnly?: boolean;
41
+ /** Select and reveal a consuming node on the canvas. Available in read-only views too. */
42
+ focusNode?: (nodeId: string) => void;
43
+ /** Temporary canvas emphasis, without changing selection or the saved workflow. */
44
+ highlightNode?: (nodeId: string | null) => void;
45
+ /** Stable callback against the current canvas, including edits made since the panel opened. */
46
+ edit: (edit: ConnectionResourceEdit) => void;
47
+ }
48
+ /** Edit references and their consumers together, so one undo restores the whole change. */
49
+ export declare function editConnectionResources(nodes: FlowStep[], connections: FlowConnections, edit: ConnectionResourceEdit): {
50
+ nodes: FlowStep[];
51
+ connections: FlowConnections;
52
+ };
7
53
  /** Missing/foreign bindings stay unresolved in the editor; the server rejects invalid references. */
8
54
  export declare function connectionIdFor(step: FlowStep, connections?: FlowConnections): string | undefined;
55
+ /** A workflow-owned name, independent of the first node or the account's display name. */
56
+ export declare function nextWorkflowConnectionName(appId: string, connections: FlowConnections): string;
9
57
  /** Lift old inline IDs on the next editor save. Independent bindings remain independent. */
10
58
  export declare function centralizeConnections<T extends Pick<FlowWorkflow, "connections" | "nodes">>(workflow: T): T;
11
59
  /** Drop only unreferenced aliases when serializing the complete workflow. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w6w/ui",
3
- "version": "0.2.54",
3
+ "version": "0.2.55",
4
4
  "description": "React components for w6w — central API management. Build plugins, apps and integrations on them.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://w6w.io",
@@ -86,3 +86,67 @@
86
86
  .w6w-connection-id-copy:focus-within .w6w-copyable-btn {
87
87
  opacity: 1;
88
88
  }
89
+
90
+ /* Identify workflow connections and their consuming canvas nodes. */
91
+ .w6w-connection-app-heading {
92
+ display: flex;
93
+ align-items: center;
94
+ gap: var(--w6w-sp-2);
95
+ }
96
+ .w6w-connection-node-list {
97
+ display: flex;
98
+ flex-direction: column;
99
+ gap: var(--w6w-sp-2);
100
+ list-style: none;
101
+ margin: 0;
102
+ padding: 0;
103
+ }
104
+ .w6w-connection-node-list .w6w-btn {
105
+ display: flex;
106
+ align-items: center;
107
+ gap: var(--w6w-sp-2);
108
+ text-align: left;
109
+ width: 100%;
110
+ overflow-wrap: anywhere;
111
+ white-space: normal;
112
+ }
113
+
114
+ .w6w-connection-node-label {
115
+ display: flex;
116
+ flex-direction: column;
117
+ min-width: 0;
118
+ }
119
+
120
+ .w6w-workflow-connections-heading {
121
+ display: flex;
122
+ align-items: center;
123
+ justify-content: space-between;
124
+ gap: var(--w6w-sp-2);
125
+ }
126
+ .w6w-workflow-connections-heading h3 { margin: 0; font-size: inherit; }
127
+ .w6w-workflow-connection {
128
+ display: flex;
129
+ flex-direction: column;
130
+ gap: var(--w6w-sp-2);
131
+ padding-bottom: var(--w6w-sp-3);
132
+ border-bottom: 1px solid var(--w6w-border);
133
+ }
134
+ .w6w-connection-summary {
135
+ display: flex;
136
+ flex-direction: column;
137
+ flex: 1;
138
+ min-width: 0;
139
+ overflow-wrap: anywhere;
140
+ }
141
+ .w6w-connection-consumers summary { cursor: pointer; }
142
+ .w6w-connection-consumers[open] summary { margin-bottom: var(--w6w-sp-2); }
143
+ .w6w-connection-scope { display: flex; align-items: flex-start; gap: var(--w6w-sp-2); }
144
+ .w6w-connection-remove { border-top: 1px solid var(--w6w-border); padding-top: var(--w6w-sp-3); }
145
+
146
+ .w6w-connection-node-kind {
147
+ display: inline-flex;
148
+ align-items: center;
149
+ justify-content: center;
150
+ flex-shrink: 0;
151
+ color: var(--w6w-accent);
152
+ }
@@ -386,3 +386,9 @@
386
386
  .w6w-state-map-add {
387
387
  align-self: flex-start;
388
388
  }
389
+
390
+ /* Hover/focus in the connections rail: ephemeral emphasis, separate from selection/run status. */
391
+ .w6w-flow .react-flow__node.w6w-connection-highlight [data-run-status] {
392
+ outline: 3px solid var(--w6w-accent);
393
+ outline-offset: 4px;
394
+ }
package/src/styles.css CHANGED
@@ -4260,6 +4260,12 @@ dialog.w6w-modal.w6w-modal-fullscreen .w6w-modal-header {
4260
4260
  align-self: flex-start;
4261
4261
  }
4262
4262
 
4263
+ /* Hover/focus in the connections rail: ephemeral emphasis, separate from selection/run status. */
4264
+ .w6w-flow .react-flow__node.w6w-connection-highlight [data-run-status] {
4265
+ outline: 3px solid var(--w6w-accent);
4266
+ outline-offset: 4px;
4267
+ }
4268
+
4263
4269
  .w6w-section {
4264
4270
  border: 1px solid var(--w6w-border);
4265
4271
  border-radius: 8px;
@@ -6592,6 +6598,93 @@ button.w6w-rel-open:focus-visible strong {
6592
6598
  opacity: 1;
6593
6599
  }
6594
6600
 
6601
+ /* Identify workflow connections and their consuming canvas nodes. */
6602
+ .w6w-connection-app-heading {
6603
+ display: flex;
6604
+ align-items: center;
6605
+ gap: var(--w6w-sp-2);
6606
+ }
6607
+
6608
+ .w6w-connection-node-list {
6609
+ display: flex;
6610
+ flex-direction: column;
6611
+ gap: var(--w6w-sp-2);
6612
+ list-style: none;
6613
+ margin: 0;
6614
+ padding: 0;
6615
+ }
6616
+
6617
+ .w6w-connection-node-list .w6w-btn {
6618
+ display: flex;
6619
+ align-items: center;
6620
+ gap: var(--w6w-sp-2);
6621
+ text-align: left;
6622
+ width: 100%;
6623
+ overflow-wrap: anywhere;
6624
+ white-space: normal;
6625
+ }
6626
+
6627
+ .w6w-connection-node-label {
6628
+ display: flex;
6629
+ flex-direction: column;
6630
+ min-width: 0;
6631
+ }
6632
+
6633
+ .w6w-workflow-connections-heading {
6634
+ display: flex;
6635
+ align-items: center;
6636
+ justify-content: space-between;
6637
+ gap: var(--w6w-sp-2);
6638
+ }
6639
+
6640
+ .w6w-workflow-connections-heading h3 {
6641
+ margin: 0;
6642
+ font-size: inherit;
6643
+ }
6644
+
6645
+ .w6w-workflow-connection {
6646
+ display: flex;
6647
+ flex-direction: column;
6648
+ gap: var(--w6w-sp-2);
6649
+ padding-bottom: var(--w6w-sp-3);
6650
+ border-bottom: 1px solid var(--w6w-border);
6651
+ }
6652
+
6653
+ .w6w-connection-summary {
6654
+ display: flex;
6655
+ flex-direction: column;
6656
+ flex: 1;
6657
+ min-width: 0;
6658
+ overflow-wrap: anywhere;
6659
+ }
6660
+
6661
+ .w6w-connection-consumers summary {
6662
+ cursor: pointer;
6663
+ }
6664
+
6665
+ .w6w-connection-consumers[open] summary {
6666
+ margin-bottom: var(--w6w-sp-2);
6667
+ }
6668
+
6669
+ .w6w-connection-scope {
6670
+ display: flex;
6671
+ align-items: flex-start;
6672
+ gap: var(--w6w-sp-2);
6673
+ }
6674
+
6675
+ .w6w-connection-remove {
6676
+ border-top: 1px solid var(--w6w-border);
6677
+ padding-top: var(--w6w-sp-3);
6678
+ }
6679
+
6680
+ .w6w-connection-node-kind {
6681
+ display: inline-flex;
6682
+ align-items: center;
6683
+ justify-content: center;
6684
+ flex-shrink: 0;
6685
+ color: var(--w6w-accent);
6686
+ }
6687
+
6595
6688
  /* Data stores (F-2): DataStoreList, ColumnsEditor, CsvPanel and the data-grid/entry rules ported from Studio's Data store detail page. */
6596
6689
  .w6w-data-store-list {
6597
6690
  display: flex;