@w6w/ui 0.2.62 → 0.2.63
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/{CodeBlock-CPKXSNEs.js → CodeBlock-Bp0SGY1m.js} +82 -57
- package/dist/{CodeBlock-CPKXSNEs.js.map → CodeBlock-Bp0SGY1m.js.map} +1 -1
- package/dist/{CodeBlock-BSX1pi6W.cjs → CodeBlock-a2aIm-0b.cjs} +5 -5
- package/dist/{CodeBlock-BSX1pi6W.cjs.map → CodeBlock-a2aIm-0b.cjs.map} +1 -1
- package/dist/EditConnectionModal.d.ts +1 -1
- package/dist/code.cjs +1 -1
- package/dist/code.mjs +1 -1
- package/dist/components/CallableBindingSetup.d.ts +15 -0
- package/dist/components/ConnectionList.d.ts +1 -1
- package/dist/components/DataStoreList.d.ts +1 -1
- package/dist/components/DataTable.d.ts +6 -0
- package/dist/components/IconButton.d.ts +4 -0
- package/dist/components/RunCallable.d.ts +52 -0
- package/dist/components/expression-authoring.d.ts +3 -2
- package/dist/components/expression-dom.d.ts +30 -0
- package/dist/components/icons.d.ts +1 -1
- package/dist/{connection-app-meta-CIfXp2O-.js → connection-app-meta-HBKXI0nk.js} +2720 -2659
- package/dist/connection-app-meta-HBKXI0nk.js.map +1 -0
- package/dist/connection-app-meta-pnATcKeZ.cjs +26 -0
- package/dist/connection-app-meta-pnATcKeZ.cjs.map +1 -0
- package/dist/flow.cjs +1 -1
- package/dist/flow.mjs +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +1696 -1284
- package/dist/index.mjs.map +1 -1
- package/dist/provider.d.ts +29 -0
- package/dist/run-callable.d.ts +50 -0
- package/dist/types.d.ts +4 -0
- package/package.json +2 -2
- package/src/styles/_connections.scss +1 -0
- package/src/styles/_data-stores.scss +26 -3
- package/src/styles/_data-table.scss +38 -1
- package/src/styles.css +74 -4
- package/dist/connection-app-meta-CIfXp2O-.js.map +0 -1
- package/dist/connection-app-meta-Cn39S3ED.cjs +0 -24
- package/dist/connection-app-meta-Cn39S3ED.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectionSummary, ThemeMode } from './types.ts';
|
|
2
2
|
export interface EditConnectionModalProps {
|
|
3
3
|
/** The row being edited. `builtIn` rows have nothing to edit: the modal shows a notice only. */
|
|
4
|
-
connection: Pick<ConnectionSummary, "id" | "appId" | "authKey" | "displayName" | "builtIn" | "credentialId" | "lastTestOk">;
|
|
4
|
+
connection: Pick<ConnectionSummary, "id" | "appId" | "authKey" | "displayName" | "builtIn" | "credentialId" | "lastTestOk" | "accessScope">;
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
/** Fired after all changes are saved. The typed credential is cleared before this runs. */
|
|
7
7
|
onSaved: (updated: ConnectionSummary) => void;
|
package/dist/code.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./CodeBlock-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./CodeBlock-a2aIm-0b.cjs");exports.CodeBlock=e.CodeBlock;exports.Copyable=e.Copyable;
|
|
2
2
|
//# sourceMappingURL=code.cjs.map
|
package/dist/code.mjs
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CallableBinding } from '../provider.tsx';
|
|
2
|
+
export interface CallableBindingSetupProps {
|
|
3
|
+
/** The host-supplied key the binding is stored under, e.g. `order-details.confirm`. */
|
|
4
|
+
hostKey: string;
|
|
5
|
+
/** Narrow the pickable callables to a tag prefix. Default: every callable. */
|
|
6
|
+
tag?: string;
|
|
7
|
+
onSaved?: (binding: CallableBinding) => void;
|
|
8
|
+
onError?: (error: Error) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Explicit binding setup: pick a callable, then (for a workflow with more than one manual
|
|
12
|
+
* trigger) the trigger, then the field that receives the host data, and save it under `hostKey`.
|
|
13
|
+
* A `RunCallableButton` with `bindingKey={hostKey}` then runs it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function CallableBindingSetup({ hostKey, tag, onSaved, onError, }: CallableBindingSetupProps): import("react").JSX.Element;
|
|
@@ -34,7 +34,7 @@ export interface ConnectionListProps {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* A presentational list of connections: rows in, callbacks out; it needs no provider. Rows render
|
|
37
|
-
* through {@link DataTable} (name/app
|
|
37
|
+
* through {@link DataTable} (name/app with status, and an Edit/Delete column that is never a link).
|
|
38
38
|
*
|
|
39
39
|
* A `builtIn` row (the server's synthetic "no credential" entry) is a plain non-interactive item:
|
|
40
40
|
* no link, no `onOpen`, no Edit, no Delete, because the server 404s get/test/delete on its id.
|
|
@@ -27,7 +27,7 @@ export interface DataStoreListProps {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* A presentational list of Data stores: rows in, callbacks out; it needs no provider. Rows render
|
|
30
|
-
* through {@link DataTable} (name, kind, entry count, size,
|
|
30
|
+
* through {@link DataTable} (name, kind, entry count, size, and an Edit/Archive column
|
|
31
31
|
* that is never a link).
|
|
32
32
|
*/
|
|
33
33
|
export declare function DataStoreList({ stores, loading, error, onOpen, getHref, onEdit, onArchive, busy, formatSize, slots, }: DataStoreListProps): import("react").JSX.Element;
|
|
@@ -8,6 +8,12 @@ export interface DataTableColumn<Row> {
|
|
|
8
8
|
align?: "left" | "right" | "center";
|
|
9
9
|
/** With `getRowHref`, wrap this column's cells in an anchor. Default true. */
|
|
10
10
|
link?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* This column holds a row's controls (icon buttons). Its `<th>`/`<td>` get
|
|
13
|
+
* `w6w-data-table-actions` (shrink-to-content, nowrap, right-aligned) and the cell content sits in
|
|
14
|
+
* a `w6w-data-table-actions-row` flex row, so the host writes no inline flex/width of its own.
|
|
15
|
+
*/
|
|
16
|
+
actions?: boolean;
|
|
11
17
|
}
|
|
12
18
|
export interface DataTableProps<Row> {
|
|
13
19
|
columns: readonly DataTableColumn<Row>[];
|
|
@@ -29,7 +29,11 @@ export interface IconButtonProps {
|
|
|
29
29
|
"aria-expanded"?: boolean;
|
|
30
30
|
/** Passed straight through, for a disclosure button naming the region it controls. */
|
|
31
31
|
"aria-controls"?: string;
|
|
32
|
+
/** Passed straight through, for a button that opens a dialog or menu. */
|
|
33
|
+
"aria-haspopup"?: "dialog" | "menu" | "listbox" | "true";
|
|
32
34
|
"data-testid"?: string;
|
|
35
|
+
/** Any other `data-*` attribute is passed straight through (e.g. a grid's `data-row`). */
|
|
36
|
+
[dataAttribute: `data-${string}`]: string | undefined;
|
|
33
37
|
}
|
|
34
38
|
/**
|
|
35
39
|
* The primitive icon-only button: a caller-supplied glyph, a required
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { CallableRef } from '../provider.tsx';
|
|
2
|
+
/** Common callbacks every surface takes. */
|
|
3
|
+
interface RunCallbacks {
|
|
4
|
+
/** Receives the callable's output on success. */
|
|
5
|
+
onResult?: (output: unknown) => void;
|
|
6
|
+
/** Receives the failure (including "unsupported" / "stale" setup errors). */
|
|
7
|
+
onError?: (error: Error) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface RunCallableModalProps extends RunCallbacks {
|
|
10
|
+
/** Tag mode: the callable to run. Ignored when `bindingKey` is set. */
|
|
11
|
+
callable?: CallableRef;
|
|
12
|
+
/** Explicit mode: run whatever the host key is bound to. */
|
|
13
|
+
bindingKey?: string;
|
|
14
|
+
/** Host page data, sent as `{[prop]: data}` (tag mode) or `{[field]: data}` (explicit). */
|
|
15
|
+
data: unknown;
|
|
16
|
+
/** Property name for tag mode (see `tagProp`). */
|
|
17
|
+
prop?: string;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
onSetup?: () => void;
|
|
20
|
+
title?: string;
|
|
21
|
+
}
|
|
22
|
+
/** Confirm → (optional extra inputs) → result, for one callable run. */
|
|
23
|
+
export declare function RunCallableModal({ callable, bindingKey, data, prop, onClose, onSetup, onResult, onError, title, }: RunCallableModalProps): import("react").JSX.Element;
|
|
24
|
+
interface SurfaceProps extends RunCallbacks {
|
|
25
|
+
/** Host page data handed to the callable. */
|
|
26
|
+
data: unknown;
|
|
27
|
+
/** Property name override; default is the tag prefix's last segment. */
|
|
28
|
+
as?: string;
|
|
29
|
+
/** Open a confirm/inputs/result modal instead of running straight away. */
|
|
30
|
+
confirm?: boolean;
|
|
31
|
+
label?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface RunCallableButtonProps extends SurfaceProps {
|
|
34
|
+
/** Tag mode: the tag prefix; the callable tagged `<tag>.<defaultAction>` runs. */
|
|
35
|
+
tag?: string;
|
|
36
|
+
/** Explicit mode: the host key a `CallableBindingSetup` saved. Wins over `tag`. */
|
|
37
|
+
bindingKey?: string;
|
|
38
|
+
/** Default `"send_confirmation"`. */
|
|
39
|
+
defaultAction?: string;
|
|
40
|
+
/** Offered beside a stale/unbound error. */
|
|
41
|
+
onSetup?: () => void;
|
|
42
|
+
}
|
|
43
|
+
/** One button that runs the default callable (tag mode) or the bound one (explicit mode). */
|
|
44
|
+
export declare function RunCallableButton({ tag, bindingKey, defaultAction, data, as, confirm, label, onSetup, onResult, onError, }: RunCallableButtonProps): import("react").JSX.Element;
|
|
45
|
+
export interface RunCallablesProps extends SurfaceProps {
|
|
46
|
+
/** Tag prefix; every callable carrying it (or a dotted descendant) is listed. */
|
|
47
|
+
tag: string;
|
|
48
|
+
defaultAction?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Dropdown of the callables under a tag prefix, the default preselected, plus a run button. */
|
|
51
|
+
export declare function RunCallables({ tag, defaultAction, data, as, confirm, label, onResult, onError, }: RunCallablesProps): import("react").JSX.Element;
|
|
52
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export declare function compileAuthoredParts(original: ExprPart[], options: Expr
|
|
|
8
8
|
};
|
|
9
9
|
/** Sample fields include those inside comparisons, not just standalone reference chips. */
|
|
10
10
|
export declare function authoredReferences(parts: ExprPart[]): string[];
|
|
11
|
-
/** Evaluate
|
|
12
|
-
*
|
|
11
|
+
/** Evaluate every JSONLogic expr (readable conditions and `{{ =<jsonlogic> }}` chips alike) with
|
|
12
|
+
* the same evaluator as workflow execution; text and references keep their template preview.
|
|
13
|
+
* Explicit samples preserve JSON types. */
|
|
13
14
|
export declare function previewAuthoredParts(parts: ExprPart[], seeds?: Record<string, unknown>, overrides?: Record<string, string>): string;
|
|
@@ -55,6 +55,22 @@ export declare function outputFieldTree<F extends {
|
|
|
55
55
|
field: F;
|
|
56
56
|
depth: number;
|
|
57
57
|
name: string;
|
|
58
|
+
parent: string | null;
|
|
59
|
+
}[];
|
|
60
|
+
/**
|
|
61
|
+
* The rows of {@link outputFieldTree} a COLLAPSED rail shows: a top-level field always; a nested
|
|
62
|
+
* one only while every listed ancestor is open (`isOpen(ancestorKey)`) — one level per click, so
|
|
63
|
+
* a deep output (`order › created › day …`) is never one endless list. `children` is each row's
|
|
64
|
+
* count of direct children, for its "N fields ›" toggle (0 = a leaf).
|
|
65
|
+
*/
|
|
66
|
+
export declare function visibleFieldTree<F extends {
|
|
67
|
+
key: string;
|
|
68
|
+
path?: boolean;
|
|
69
|
+
}>(fields: F[], isOpen: (key: string) => boolean): {
|
|
70
|
+
field: F;
|
|
71
|
+
depth: number;
|
|
72
|
+
name: string;
|
|
73
|
+
children: number;
|
|
58
74
|
}[];
|
|
59
75
|
/**
|
|
60
76
|
* Build the non-editable inline chip (tag) DOM node for a part.
|
|
@@ -132,6 +148,20 @@ export declare function paintParts(el: HTMLElement, parts: ExprPart[], opts?: {
|
|
|
132
148
|
export declare function placeCaretAtEnd(el: HTMLElement): void;
|
|
133
149
|
/** Insert a node at the caret (or at the end if the caret isn't in the editor). */
|
|
134
150
|
export declare function insertNodeAtCaret(editor: HTMLElement, node: Node): void;
|
|
151
|
+
/**
|
|
152
|
+
* Insert pasted plain text at the caret — the one paste path for both editors. Rooted `{{ }}`
|
|
153
|
+
* markers become chips through the same root-anchored parse as every other commit path (so a
|
|
154
|
+
* `{{ =<jsonlogic> }}` lands as one ƒ chip), the rest stays text, each piece placed with
|
|
155
|
+
* {@link insertNodeAtCaret} so the caret follows the paste.
|
|
156
|
+
*
|
|
157
|
+
* A SINGLE-LINE field drops line breaks, as a native `<input>` does: there Enter never inserts
|
|
158
|
+
* one, so a break in the clipboard is only where the source happened to wrap (a terminal, a
|
|
159
|
+
* chat window), and inside a JSONLogic string it would corrupt the rule. A multi-line field
|
|
160
|
+
* keeps them — a real line break the author copied is content.
|
|
161
|
+
*/
|
|
162
|
+
export declare function insertPastedText(editor: HTMLElement, text: string, opts?: {
|
|
163
|
+
renderToggle?: boolean;
|
|
164
|
+
}): void;
|
|
135
165
|
/**
|
|
136
166
|
* D-3 (binding): promote a just-closed `{{ … }}` marker to a chip at the
|
|
137
167
|
* keystroke that closes it — the caret-safe surgery an `onInput` handler can
|
|
@@ -4,7 +4,7 @@ import { ReactNode } from 'react';
|
|
|
4
4
|
* never for the studio component that happened to draw it, so a caller asks for
|
|
5
5
|
* `icon="history"` rather than `icon="history-icon-tsx"`.
|
|
6
6
|
*/
|
|
7
|
-
export type IconName = "edit" | "edit-2" | "delete" | "copy" | "check" | "close" | "history" | "info" | "clock" | "json" | "code" | "sync" | "cloud-download" | "eye" | "play" | "stop" | "warning" | "file-text" | "settings" | "github" | "user" | "bot" | "users" | "logout" | "id-card" | "dashboard" | "pulse" | "workflow" | "globe" | "lambda" | "sliders" | "file" | "plug" | "grid" | "folder" | "git-branch" | "coin" | "building" | "server" | "price-tag" | "lang-node" | "terminal" | "lang-python" | "lang-curl" | "sun" | "moon" | "circle-half" | "layout" | "run" | "pause" | "ban" | "trash" | "maximize" | "form" | "braces" | "settings-2" | "sticky-note" | "frame" | "bold" | "grip" | "chevron-down" | "database";
|
|
7
|
+
export type IconName = "edit" | "edit-2" | "delete" | "copy" | "check" | "close" | "history" | "info" | "clock" | "json" | "code" | "sync" | "cloud-download" | "eye" | "play" | "stop" | "warning" | "file-text" | "settings" | "github" | "user" | "bot" | "users" | "logout" | "id-card" | "dashboard" | "pulse" | "workflow" | "globe" | "lambda" | "sliders" | "file" | "plug" | "grid" | "folder" | "git-branch" | "coin" | "building" | "server" | "price-tag" | "lang-node" | "terminal" | "lang-python" | "lang-curl" | "sun" | "moon" | "circle-half" | "layout" | "run" | "pause" | "ban" | "trash" | "maximize" | "form" | "braces" | "settings-2" | "sticky-note" | "frame" | "bold" | "grip" | "chevron-down" | "database" | "archive" | "eye-off";
|
|
8
8
|
/**
|
|
9
9
|
* Which attributes the shared `<svg>` root carries — i.e. how the glyph is
|
|
10
10
|
* painted. The sources are not uniform, and forcing them into one shape would
|