@tai42/studio-sdk 13.2.2 → 14.0.0
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/components/icons.d.ts +2 -0
- package/dist/components/icons.d.ts.map +1 -1
- package/dist/components/icons.js +2 -0
- package/dist/components/icons.js.map +1 -1
- package/dist/hooks/useApi.d.ts +199 -24
- package/dist/hooks/useApi.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/navigation/types.d.ts +2 -1
- package/dist/navigation/types.d.ts.map +1 -1
- package/dist/query-keys.d.ts +13 -0
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +13 -0
- package/dist/query-keys.js.map +1 -1
- package/dist/state-binding/AdapterMapping.d.ts +33 -0
- package/dist/state-binding/AdapterMapping.d.ts.map +1 -0
- package/dist/state-binding/AdapterMapping.js +205 -0
- package/dist/state-binding/AdapterMapping.js.map +1 -0
- package/dist/state-binding/BindingJqField.d.ts +36 -0
- package/dist/state-binding/BindingJqField.d.ts.map +1 -0
- package/dist/state-binding/BindingJqField.js +54 -0
- package/dist/state-binding/BindingJqField.js.map +1 -0
- package/dist/state-binding/InputInjectionRow.d.ts +17 -0
- package/dist/state-binding/InputInjectionRow.d.ts.map +1 -0
- package/dist/state-binding/InputInjectionRow.js +55 -0
- package/dist/state-binding/InputInjectionRow.js.map +1 -0
- package/dist/state-binding/StateAttachRow.d.ts +25 -0
- package/dist/state-binding/StateAttachRow.d.ts.map +1 -0
- package/dist/state-binding/StateAttachRow.js +101 -0
- package/dist/state-binding/StateAttachRow.js.map +1 -0
- package/dist/state-binding/StateBindingEditor.d.ts +35 -0
- package/dist/state-binding/StateBindingEditor.d.ts.map +1 -0
- package/dist/state-binding/StateBindingEditor.js +52 -0
- package/dist/state-binding/StateBindingEditor.js.map +1 -0
- package/dist/state-binding/StateBindingSection.d.ts +14 -0
- package/dist/state-binding/StateBindingSection.d.ts.map +1 -0
- package/dist/state-binding/StateBindingSection.js +17 -0
- package/dist/state-binding/StateBindingSection.js.map +1 -0
- package/dist/state-binding/SubjectScopeFields.d.ts +17 -0
- package/dist/state-binding/SubjectScopeFields.d.ts.map +1 -0
- package/dist/state-binding/SubjectScopeFields.js +8 -0
- package/dist/state-binding/SubjectScopeFields.js.map +1 -0
- package/dist/state-binding/UpdateRow.d.ts +19 -0
- package/dist/state-binding/UpdateRow.d.ts.map +1 -0
- package/dist/state-binding/UpdateRow.js +76 -0
- package/dist/state-binding/UpdateRow.js.map +1 -0
- package/dist/state-binding/adapter.d.ts +93 -0
- package/dist/state-binding/adapter.d.ts.map +1 -0
- package/dist/state-binding/adapter.js +251 -0
- package/dist/state-binding/adapter.js.map +1 -0
- package/dist/state-binding/build-catalog.d.ts +19 -0
- package/dist/state-binding/build-catalog.d.ts.map +1 -0
- package/dist/state-binding/build-catalog.js +43 -0
- package/dist/state-binding/build-catalog.js.map +1 -0
- package/dist/state-binding/catalog.d.ts +26 -0
- package/dist/state-binding/catalog.d.ts.map +1 -0
- package/dist/state-binding/catalog.js +71 -0
- package/dist/state-binding/catalog.js.map +1 -0
- package/dist/state-binding/index.d.ts +29 -0
- package/dist/state-binding/index.d.ts.map +1 -0
- package/dist/state-binding/index.js +18 -0
- package/dist/state-binding/index.js.map +1 -0
- package/dist/state-binding/types.d.ts +57 -0
- package/dist/state-binding/types.d.ts.map +1 -0
- package/dist/state-binding/types.js +2 -0
- package/dist/state-binding/types.js.map +1 -0
- package/package.json +5 -5
- package/src/components/icons.tsx +8 -0
- package/src/index.ts +63 -1
- package/src/navigation/types.ts +4 -1
- package/src/query-keys.ts +15 -0
- package/src/state-binding/AdapterMapping.tsx +468 -0
- package/src/state-binding/BindingJqField.tsx +134 -0
- package/src/state-binding/InputInjectionRow.tsx +148 -0
- package/src/state-binding/README.md +46 -0
- package/src/state-binding/StateAttachRow.tsx +281 -0
- package/src/state-binding/StateBindingEditor.tsx +158 -0
- package/src/state-binding/StateBindingSection.tsx +37 -0
- package/src/state-binding/SubjectScopeFields.tsx +49 -0
- package/src/state-binding/UpdateRow.tsx +194 -0
- package/src/state-binding/adapter.ts +276 -0
- package/src/state-binding/build-catalog.ts +59 -0
- package/src/state-binding/catalog.ts +87 -0
- package/src/state-binding/index.ts +61 -0
- package/src/state-binding/types.ts +62 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigation/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7B,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9B,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAM7B,MAAM,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigation/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7B,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,C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AE,YAAY,KAClB,MAAM,CAAC;IACZ;;;;;;;;;;;;;;;;;OAiBG;IACH,yBAAyB,CAAC,EAAE,CAC1B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,qBAAqB,KAC5B,IAAI,CAAC;IACV;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACrE;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/query-keys.d.ts
CHANGED
|
@@ -28,4 +28,17 @@ export declare const extensionsQueryKey: readonly ["extensions"];
|
|
|
28
28
|
export declare const subMcpKey: readonly ["sub-mcp"];
|
|
29
29
|
/** The api-key payloads; read by settings AND the hooks execution-key picker. */
|
|
30
30
|
export declare const tokensPayloadKey: readonly ["auth-tokens-payload"];
|
|
31
|
+
/**
|
|
32
|
+
* The state catalog (`GET /api/states`). The states feature owns it, and every door
|
|
33
|
+
* screen that hosts the state-binding editor (a preset, a route, a hook, a schedule)
|
|
34
|
+
* reads the same catalog to populate the binding's state picker — so both key the one
|
|
35
|
+
* authoritative tuple and a single fetch serves both.
|
|
36
|
+
*/
|
|
37
|
+
export declare const statesListKey: readonly ["states", "list"];
|
|
38
|
+
/**
|
|
39
|
+
* The state-template document catalog (`GET /api/state-templates`). Read by the states
|
|
40
|
+
* feature AND every state-binding door screen (the templates a binding attaches),
|
|
41
|
+
* keyed here so the two never fetch the same catalog under diverging tuples.
|
|
42
|
+
*/
|
|
43
|
+
export declare const stateTemplatesKey: readonly ["states", "state-templates"];
|
|
31
44
|
//# sourceMappingURL=query-keys.d.ts.map
|
package/dist/query-keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,0DAA0D;AAC1D,eAAO,MAAM,YAAY,oBAAqB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,yBAA0B,CAAC;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,sBAAuB,CAAC;AAE9C,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,kCAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,0DAA0D;AAC1D,eAAO,MAAM,YAAY,oBAAqB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,yBAA0B,CAAC;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,sBAAuB,CAAC;AAE9C,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,kCAAmC,CAAC;AAEjE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,6BAA8B,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,wCAAyC,CAAC"}
|
package/dist/query-keys.js
CHANGED
|
@@ -28,4 +28,17 @@ export const extensionsQueryKey = ['extensions'];
|
|
|
28
28
|
export const subMcpKey = ['sub-mcp'];
|
|
29
29
|
/** The api-key payloads; read by settings AND the hooks execution-key picker. */
|
|
30
30
|
export const tokensPayloadKey = ['auth-tokens-payload'];
|
|
31
|
+
/**
|
|
32
|
+
* The state catalog (`GET /api/states`). The states feature owns it, and every door
|
|
33
|
+
* screen that hosts the state-binding editor (a preset, a route, a hook, a schedule)
|
|
34
|
+
* reads the same catalog to populate the binding's state picker — so both key the one
|
|
35
|
+
* authoritative tuple and a single fetch serves both.
|
|
36
|
+
*/
|
|
37
|
+
export const statesListKey = ['states', 'list'];
|
|
38
|
+
/**
|
|
39
|
+
* The state-template document catalog (`GET /api/state-templates`). Read by the states
|
|
40
|
+
* feature AND every state-binding door screen (the templates a binding attaches),
|
|
41
|
+
* keyed here so the two never fetch the same catalog under diverging tuples.
|
|
42
|
+
*/
|
|
43
|
+
export const stateTemplatesKey = ['states', 'state-templates'];
|
|
31
44
|
//# sourceMappingURL=query-keys.js.map
|
package/dist/query-keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.js","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,CAAU,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,YAAY,CAAU,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAS,CAAU,CAAC;AAE9C,iFAAiF;AACjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,qBAAqB,CAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"query-keys.js","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,CAAU,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,YAAY,CAAU,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAS,CAAU,CAAC;AAE9C,iFAAiF;AACjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,qBAAqB,CAAU,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAU,CAAC;AAEzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,iBAAiB,CAAU,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The adapter mapping form for a NAMED update. It renders one row per declared
|
|
3
|
+
* input key of the update jq; each row picks ONE of three value sources — a picked
|
|
4
|
+
* field (from the run's output / input schema, when a schema is known), a hardcoded
|
|
5
|
+
* literal, or a jq expression — and the whole form compiles into ONE adapter jq over
|
|
6
|
+
* `{ output, input }` that constructs the update jq's declared input object. Each
|
|
7
|
+
* row shows its own jq on demand, and the whole compiled adapter is shown on demand.
|
|
8
|
+
*
|
|
9
|
+
* A raw-jq escape hatch (`Write jq`) authors the adapter directly when the mapping needs
|
|
10
|
+
* more than the row form expresses. An update that declares NO input needs no adapter, so
|
|
11
|
+
* it shows a tool-output passthrough and stores `null` (the escape hatch stays available).
|
|
12
|
+
*
|
|
13
|
+
* The stored value always equals what the form shows (WYSIWYG): an accepted default is
|
|
14
|
+
* emitted on mount, so it is never left as the empty string the platform's save refuses.
|
|
15
|
+
* The emitted adapter is a non-empty jq or `null`, never `''`.
|
|
16
|
+
*/
|
|
17
|
+
import { type ReactNode } from 'react';
|
|
18
|
+
import { type TemplateJqSuggestion } from './BindingJqField';
|
|
19
|
+
import type { BindingSourceSchemas } from './types';
|
|
20
|
+
export interface AdapterMappingProps {
|
|
21
|
+
/** The declared input keys of the update jq — one row each. Empty ⇒ raw jq only. */
|
|
22
|
+
readonly declaredInput: readonly string[];
|
|
23
|
+
/** The current adapter jq (compiled or authored) stored on the update; `''` ⇒ none stored. */
|
|
24
|
+
readonly value: string;
|
|
25
|
+
/** Emits the adapter to store: a non-empty jq, or `null` for no adapter (never `''`). */
|
|
26
|
+
readonly onChange: (adapterJq: string | null) => void;
|
|
27
|
+
/** The output / input field paths a picker offers. */
|
|
28
|
+
readonly sources?: BindingSourceSchemas;
|
|
29
|
+
/** Template jq offered as `tjq_<name>({…})` inserts in the jq escape hatch. */
|
|
30
|
+
readonly suggestions?: readonly TemplateJqSuggestion[];
|
|
31
|
+
}
|
|
32
|
+
export declare function AdapterMapping({ declaredInput, value, onChange, sources, suggestions, }: AdapterMappingProps): ReactNode;
|
|
33
|
+
//# sourceMappingURL=AdapterMapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdapterMapping.d.ts","sourceRoot":"","sources":["../../src/state-binding/AdapterMapping.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO5D,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAS7E,OAAO,KAAK,EAAE,oBAAoB,EAAmB,MAAM,SAAS,CAAC;AAarE,MAAM,WAAW,mBAAmB;IAClC,oFAAoF;IACpF,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,8FAA8F;IAC9F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACtD,sDAAsD;IACtD,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IACxC,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACxD;AAuND,wBAAgB,cAAc,CAAC,EAC7B,aAAa,EACb,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,GACZ,EAAE,mBAAmB,GAAG,SAAS,CA8LjC"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The adapter mapping form for a NAMED update. It renders one row per declared
|
|
4
|
+
* input key of the update jq; each row picks ONE of three value sources — a picked
|
|
5
|
+
* field (from the run's output / input schema, when a schema is known), a hardcoded
|
|
6
|
+
* literal, or a jq expression — and the whole form compiles into ONE adapter jq over
|
|
7
|
+
* `{ output, input }` that constructs the update jq's declared input object. Each
|
|
8
|
+
* row shows its own jq on demand, and the whole compiled adapter is shown on demand.
|
|
9
|
+
*
|
|
10
|
+
* A raw-jq escape hatch (`Write jq`) authors the adapter directly when the mapping needs
|
|
11
|
+
* more than the row form expresses. An update that declares NO input needs no adapter, so
|
|
12
|
+
* it shows a tool-output passthrough and stores `null` (the escape hatch stays available).
|
|
13
|
+
*
|
|
14
|
+
* The stored value always equals what the form shows (WYSIWYG): an accepted default is
|
|
15
|
+
* emitted on mount, so it is never left as the empty string the platform's save refuses.
|
|
16
|
+
* The emitted adapter is a non-empty jq or `null`, never `''`.
|
|
17
|
+
*/
|
|
18
|
+
import { useEffect, useState } from 'react';
|
|
19
|
+
import { Badge } from '../components/badge';
|
|
20
|
+
import { Button, Skeleton } from '../components/primitives';
|
|
21
|
+
import { Field } from '../components/field';
|
|
22
|
+
import { Select } from '../components/select';
|
|
23
|
+
import { TextInput } from '../components/inputs';
|
|
24
|
+
import { BindingJqField } from './BindingJqField';
|
|
25
|
+
import { compileAdapter, parseAdapter, rowValueJq, } from './adapter';
|
|
26
|
+
const ROOT_OPTIONS = [
|
|
27
|
+
{ value: 'output', label: 'Run output' },
|
|
28
|
+
{ value: 'input', label: 'Run input' },
|
|
29
|
+
];
|
|
30
|
+
const SOURCE_OPTIONS = [
|
|
31
|
+
{ value: 'field', label: 'Field' },
|
|
32
|
+
{ value: 'literal', label: 'Literal' },
|
|
33
|
+
{ value: 'jq', label: 'Jq' },
|
|
34
|
+
];
|
|
35
|
+
function fieldsFor(root, sources) {
|
|
36
|
+
if (root === 'output')
|
|
37
|
+
return sources?.output ?? [];
|
|
38
|
+
return sources?.input ?? [];
|
|
39
|
+
}
|
|
40
|
+
/** The value control for one row's picked-field source: a Select where a schema is known, else a path input. */
|
|
41
|
+
function FieldSourceControl({ root, path, onRootChange, onPathChange, fields, loading = false, error, }) {
|
|
42
|
+
const pathInput = (_jsx(TextInput, { "aria-label": "Field path", placeholder: "path.into.value", value: path.join('.'), onChange: (event) => {
|
|
43
|
+
const text = event.target.value.trim();
|
|
44
|
+
onPathChange(text === '' ? [] : text.split('.'));
|
|
45
|
+
} }));
|
|
46
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 'var(--tai-space-1)' }, children: [_jsxs("div", { style: { display: 'flex', gap: 'var(--tai-space-2)', flexWrap: 'wrap' }, children: [_jsx(Field, { label: "Field root", hideLabel: true, children: _jsx(Select, { value: root, onValueChange: (next) => {
|
|
47
|
+
onRootChange(next);
|
|
48
|
+
}, options: ROOT_OPTIONS.map((option) => ({ value: option.value, label: option.label })) }) }), loading ? (_jsx(Skeleton, { height: 32, width: 220 })) : fields.length > 0 ? (_jsx(Field, { label: "Field", hideLabel: true, children: _jsx(Select, { placeholder: "Choose a field", value: path.length === 0 ? '' : JSON.stringify(path), onValueChange: (next) => {
|
|
49
|
+
onPathChange(next === '' ? [] : JSON.parse(next));
|
|
50
|
+
}, options: [
|
|
51
|
+
{ value: '', label: '(whole value)' },
|
|
52
|
+
...fields.map((field) => ({
|
|
53
|
+
value: JSON.stringify(field.path),
|
|
54
|
+
label: field.label,
|
|
55
|
+
})),
|
|
56
|
+
] }) })) : (pathInput)] }), error !== undefined && !loading ? (_jsx("span", { role: "status", style: { color: 'var(--tai-color-text-muted)', fontSize: 'var(--tai-text-sm)' }, children: error })) : null] }));
|
|
57
|
+
}
|
|
58
|
+
/** One row per declared input key, each defaulting to the whole run output. */
|
|
59
|
+
function defaultRows(declaredInput) {
|
|
60
|
+
return declaredInput.map((target) => ({
|
|
61
|
+
target,
|
|
62
|
+
source: { kind: 'field', root: 'output', path: [] },
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
function MappingRowEditor({ row, onChange, sources, suggestions, }) {
|
|
66
|
+
const [showJq, setShowJq] = useState(false);
|
|
67
|
+
const source = row.source;
|
|
68
|
+
const preview = rowValueJq(source);
|
|
69
|
+
const setSource = (next) => {
|
|
70
|
+
onChange({ ...row, source: next });
|
|
71
|
+
};
|
|
72
|
+
const changeKind = (kind) => {
|
|
73
|
+
if (kind === 'field')
|
|
74
|
+
setSource({ kind: 'field', root: 'output', path: [] });
|
|
75
|
+
else if (kind === 'literal')
|
|
76
|
+
setSource({ kind: 'literal', json: '' });
|
|
77
|
+
else
|
|
78
|
+
setSource({ kind: 'jq', expr: '' });
|
|
79
|
+
};
|
|
80
|
+
return (_jsxs("div", { "data-testid": `adapter-row-${row.target}`, style: {
|
|
81
|
+
display: 'flex',
|
|
82
|
+
flexDirection: 'column',
|
|
83
|
+
gap: 'var(--tai-space-1)',
|
|
84
|
+
padding: 'var(--tai-space-2)',
|
|
85
|
+
border: '1px solid var(--tai-color-border)',
|
|
86
|
+
borderRadius: 'var(--tai-radius-md)',
|
|
87
|
+
}, children: [_jsxs("div", { style: {
|
|
88
|
+
display: 'flex',
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
gap: 'var(--tai-space-2)',
|
|
91
|
+
flexWrap: 'wrap',
|
|
92
|
+
}, children: [_jsx(Badge, { variant: "neutral", children: row.target }), _jsx(Field, { label: `Source for ${row.target}`, hideLabel: true, children: _jsx(Select, { "aria-label": `Source for ${row.target}`, value: source.kind, onValueChange: changeKind, options: SOURCE_OPTIONS }) })] }), source.kind === 'field' ? (_jsx(FieldSourceControl, { root: source.root, path: source.path, fields: fieldsFor(source.root, sources), loading: sources?.loading, error: sources?.error, onRootChange: (nextRoot) => {
|
|
93
|
+
setSource({ kind: 'field', root: nextRoot, path: [] });
|
|
94
|
+
}, onPathChange: (nextPath) => {
|
|
95
|
+
setSource({ kind: 'field', root: source.root, path: nextPath });
|
|
96
|
+
} })) : source.kind === 'literal' ? (_jsx(Field, { label: `Literal for ${row.target}`, hideLabel: true, error: preview.ok ? undefined : preview.error, children: _jsx(TextInput, { "aria-label": `Literal for ${row.target}`, placeholder: '"a string", 42, true, or {"k":1}', value: source.json, onChange: (event) => {
|
|
97
|
+
setSource({ kind: 'literal', json: event.target.value });
|
|
98
|
+
} }) })) : (_jsx(BindingJqField, { label: `Jq for ${row.target}`, value: source.expr, onChange: (next) => {
|
|
99
|
+
setSource({ kind: 'jq', expr: next });
|
|
100
|
+
}, error: preview.ok ? undefined : preview.error, suggestions: suggestions })), _jsxs("div", { children: [_jsx(Button, { type: "button", variant: "ghost", "aria-expanded": showJq, onClick: () => {
|
|
101
|
+
setShowJq((open) => !open);
|
|
102
|
+
}, children: showJq ? 'Hide jq' : 'Show jq' }), showJq ? (_jsx("pre", { "data-testid": `adapter-row-jq-${row.target}`, style: { margin: 0, fontFamily: 'var(--tai-font-mono)', whiteSpace: 'pre-wrap' }, children: preview.ok ? preview.jq : preview.error })) : null] })] }));
|
|
103
|
+
}
|
|
104
|
+
export function AdapterMapping({ declaredInput, value, onChange, sources, suggestions, }) {
|
|
105
|
+
const canMap = declaredInput.length > 0;
|
|
106
|
+
// Rebuild the form from STORED data: a stored adapter that parses back to rows reopens
|
|
107
|
+
// as the mapping form; anything else opens in the raw-jq escape hatch. With no declared
|
|
108
|
+
// input the update needs no adapter, so it opens on the tool-output passthrough (a
|
|
109
|
+
// stored jq still reopens the escape hatch).
|
|
110
|
+
const recovered = value.trim() === '' ? null : parseAdapter(value);
|
|
111
|
+
const [mode, setMode] = useState(() => {
|
|
112
|
+
if (value.trim() === '')
|
|
113
|
+
return 'fields';
|
|
114
|
+
return canMap && recovered !== null ? 'fields' : 'jq';
|
|
115
|
+
});
|
|
116
|
+
const [rows, setRows] = useState(() => recovered ?? defaultRows(declaredInput));
|
|
117
|
+
// Set when a toggle to fields mode finds a jq the row form cannot represent: the
|
|
118
|
+
// note explains why the view stayed on the raw jq (see `toFields`).
|
|
119
|
+
const [unmappable, setUnmappable] = useState(false);
|
|
120
|
+
const emit = (nextRows) => {
|
|
121
|
+
// WYSIWYG: store exactly what the form shows. A compile failure has no valid adapter,
|
|
122
|
+
// so emit `null` (no adapter) — never the empty string the platform's save refuses.
|
|
123
|
+
const compiled = compileAdapter(nextRows);
|
|
124
|
+
onChange(compiled.ok ? compiled.jq : null);
|
|
125
|
+
};
|
|
126
|
+
// WYSIWYG on mount: with no stored value the form shows a default — the compiled
|
|
127
|
+
// declared-input rows when mappable, else the tool-output passthrough — so store it AT
|
|
128
|
+
// ONCE. An operator who accepts the shown default must not leave an empty adapter the
|
|
129
|
+
// platform's save-time compile check refuses. Re-runs when the declared input changes
|
|
130
|
+
// the shown default; the guard preserves a stored/authored value untouched.
|
|
131
|
+
const declaredKey = declaredInput.join('');
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
if (mode !== 'fields' || value.trim() !== '')
|
|
134
|
+
return;
|
|
135
|
+
const seeded = canMap ? compileAdapter(defaultRows(declaredInput)) : null;
|
|
136
|
+
onChange(seeded?.ok ? seeded.jq : null);
|
|
137
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
138
|
+
}, [declaredKey]);
|
|
139
|
+
// Toggle to the row form by re-deriving rows from the CURRENT stored jq, never from
|
|
140
|
+
// the rows held since mount (those go stale while the user edits the raw jq, so
|
|
141
|
+
// compiling them would silently overwrite the authored jq). A non-empty jq the row
|
|
142
|
+
// form cannot represent keeps the raw view and surfaces a note instead of clobbering
|
|
143
|
+
// it; a clean round-trip re-emits nothing, so an authored jq is preserved byte-for-byte.
|
|
144
|
+
// With no declared input there is nothing to map — the toggle returns to the passthrough.
|
|
145
|
+
const toFields = () => {
|
|
146
|
+
if (!canMap) {
|
|
147
|
+
setMode('fields');
|
|
148
|
+
setUnmappable(false);
|
|
149
|
+
onChange(null);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const parsed = value.trim() === '' ? null : parseAdapter(value);
|
|
153
|
+
if (value.trim() !== '' && parsed === null) {
|
|
154
|
+
setUnmappable(true);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const nextRows = parsed ?? defaultRows(declaredInput);
|
|
158
|
+
setRows(nextRows);
|
|
159
|
+
setMode('fields');
|
|
160
|
+
setUnmappable(false);
|
|
161
|
+
const compiled = compileAdapter(nextRows);
|
|
162
|
+
if (compiled.ok && compiled.jq !== value)
|
|
163
|
+
onChange(compiled.jq);
|
|
164
|
+
};
|
|
165
|
+
// The raw-jq edit path clears a stale unmappable note so a re-mapping attempt sees the
|
|
166
|
+
// edited jq, then forwards the edit — normalizing an empty/whitespace box to `null` (no
|
|
167
|
+
// adapter) so the empty string is never stored.
|
|
168
|
+
const onJqChange = (next) => {
|
|
169
|
+
if (unmappable)
|
|
170
|
+
setUnmappable(false);
|
|
171
|
+
onChange(next.trim() === '' ? null : next);
|
|
172
|
+
};
|
|
173
|
+
const setRow = (index, next) => {
|
|
174
|
+
const nextRows = rows.map((row, position) => (position === index ? next : row));
|
|
175
|
+
setRows(nextRows);
|
|
176
|
+
emit(nextRows);
|
|
177
|
+
};
|
|
178
|
+
const compiled = compileAdapter(rows);
|
|
179
|
+
const [showCompiled, setShowCompiled] = useState(false);
|
|
180
|
+
// An adapter is refused empty ONLY when the update declares inputs to fill; a
|
|
181
|
+
// no-declared-input update legitimately stores no adapter (the passthrough).
|
|
182
|
+
const rawError = canMap && mode === 'jq' && value.trim() === ''
|
|
183
|
+
? 'Map the declared inputs or write an adapter jq — an empty adapter is refused.'
|
|
184
|
+
: undefined;
|
|
185
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 'var(--tai-space-2)' }, children: [_jsxs("div", { style: { display: 'flex', gap: 'var(--tai-space-2)' }, children: [_jsx(Button, { type: "button", variant: mode === 'fields' ? 'primary' : 'ghost', "aria-pressed": mode === 'fields', onClick: toFields, children: canMap ? 'Map fields' : 'Use tool output' }), _jsx(Button, { type: "button", variant: mode === 'jq' ? 'primary' : 'ghost', "aria-pressed": mode === 'jq', onClick: () => {
|
|
186
|
+
// Seed the escape hatch with the compiled adapter so nothing is lost — only
|
|
187
|
+
// when there are rows to compile; a no-declared-input update opens empty.
|
|
188
|
+
if (canMap && value.trim() === '' && compiled.ok)
|
|
189
|
+
onChange(compiled.jq);
|
|
190
|
+
setMode('jq');
|
|
191
|
+
}, children: "Write jq" })] }), unmappable ? (_jsx("p", { role: "status", style: {
|
|
192
|
+
margin: 0,
|
|
193
|
+
color: 'var(--tai-color-text-muted)',
|
|
194
|
+
fontSize: 'var(--tai-text-sm)',
|
|
195
|
+
}, children: "This adapter jq cannot be shown as fields. Edit it here." })) : null, mode === 'fields' ? (canMap ? (_jsxs(_Fragment, { children: [rows.map((row, index) => (_jsx(MappingRowEditor, { row: row, sources: sources, suggestions: suggestions, onChange: (next) => {
|
|
196
|
+
setRow(index, next);
|
|
197
|
+
} }, row.target))), !compiled.ok ? (_jsx("p", { role: "alert", style: { margin: 0, color: 'var(--tai-color-err-text)' }, children: compiled.error })) : null, _jsxs("div", { children: [_jsx(Button, { type: "button", variant: "ghost", "aria-expanded": showCompiled, onClick: () => {
|
|
198
|
+
setShowCompiled((open) => !open);
|
|
199
|
+
}, children: showCompiled ? 'Hide adapter jq' : 'Show adapter jq' }), showCompiled ? (_jsx("pre", { "data-testid": "adapter-compiled-jq", style: { margin: 0, fontFamily: 'var(--tai-font-mono)', whiteSpace: 'pre-wrap' }, children: compiled.ok ? compiled.jq : compiled.error })) : null] })] })) : (_jsx("p", { role: "status", style: {
|
|
200
|
+
margin: 0,
|
|
201
|
+
color: 'var(--tai-color-text-muted)',
|
|
202
|
+
fontSize: 'var(--tai-text-sm)',
|
|
203
|
+
}, children: "This update runs with the tool output as its input." }))) : (_jsx(BindingJqField, { label: "Adapter", description: "Maps the run's output into what this update expects as `.input`.", value: value, onChange: onJqChange, suggestions: suggestions, placeholder: "{ total: .output.total }", error: rawError }))] }));
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=AdapterMapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdapterMapping.js","sourceRoot":"","sources":["../../src/state-binding/AdapterMapping.tsx"],"names":[],"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renders through — the Subject/Scope
|
|
3
|
+
* expressions, a custom injection or update jq, an adapter escape hatch, an op-id.
|
|
4
|
+
*
|
|
5
|
+
* It reuses the form door pattern: when a host has injected an expression editor
|
|
6
|
+
* through {@link ExpressionFieldContext} (the visual jq editor from
|
|
7
|
+
* `@tai42/jq-studio`), that door renders here; with no door it falls back to a
|
|
8
|
+
* plain multiline textarea, so this package keeps NO edge to the jq subgraph.
|
|
9
|
+
*
|
|
10
|
+
* The attached templates' template jq are offered as an autocomplete source: an
|
|
11
|
+
* `Insert` control per jq name appends the call `tjq_<name>({…})` to the
|
|
12
|
+
* expression — the attachment-qualified `tjq_<attachment>__<name>` form when a name is
|
|
13
|
+
* ambiguous across attachments.
|
|
14
|
+
*/
|
|
15
|
+
import { type ReactNode } from 'react';
|
|
16
|
+
/** One template jq offered as an insertable autocomplete entry. */
|
|
17
|
+
export interface TemplateJqSuggestion {
|
|
18
|
+
/** The jq reference, e.g. `active` or the attachment-qualified `tally.bump`. */
|
|
19
|
+
readonly ref: string;
|
|
20
|
+
readonly purpose: 'input' | 'update';
|
|
21
|
+
readonly description?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface BindingJqFieldProps {
|
|
24
|
+
readonly label: string;
|
|
25
|
+
readonly value: string;
|
|
26
|
+
readonly onChange: (value: string) => void;
|
|
27
|
+
readonly description?: ReactNode;
|
|
28
|
+
readonly error?: string;
|
|
29
|
+
readonly placeholder?: string;
|
|
30
|
+
/** Template jq offered as `tjq_<name>({…})` inserts under the field. */
|
|
31
|
+
readonly suggestions?: readonly TemplateJqSuggestion[];
|
|
32
|
+
}
|
|
33
|
+
/** Append a `tjq_<name>({…})` template call to the current expression (space-separated when non-empty). */
|
|
34
|
+
export declare function appendTjq(current: string, ref: string): string;
|
|
35
|
+
export declare function BindingJqField({ label, value, onChange, description, error, placeholder, suggestions, }: BindingJqFieldProps): ReactNode;
|
|
36
|
+
//# sourceMappingURL=BindingJqField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BindingJqField.d.ts","sourceRoot":"","sources":["../../src/state-binding/BindingJqField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AASnD,mEAAmE;AACnE,MAAM,WAAW,oBAAoB;IACnC,gFAAgF;IAChF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,wEAAwE;IACxE,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACxD;AAED,2GAA2G;AAC3G,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAI9D;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,WAAW,EACX,KAAK,EACL,WAAW,EACX,WAAgB,GACjB,EAAE,mBAAmB,GAAG,SAAS,CA4EjC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The jq input every field a binding owns renders through — the Subject/Scope
|
|
4
|
+
* expressions, a custom injection or update jq, an adapter escape hatch, an op-id.
|
|
5
|
+
*
|
|
6
|
+
* It reuses the form door pattern: when a host has injected an expression editor
|
|
7
|
+
* through {@link ExpressionFieldContext} (the visual jq editor from
|
|
8
|
+
* `@tai42/jq-studio`), that door renders here; with no door it falls back to a
|
|
9
|
+
* plain multiline textarea, so this package keeps NO edge to the jq subgraph.
|
|
10
|
+
*
|
|
11
|
+
* The attached templates' template jq are offered as an autocomplete source: an
|
|
12
|
+
* `Insert` control per jq name appends the call `tjq_<name>({…})` to the
|
|
13
|
+
* expression — the attachment-qualified `tjq_<attachment>__<name>` form when a name is
|
|
14
|
+
* ambiguous across attachments.
|
|
15
|
+
*/
|
|
16
|
+
import { useContext } from 'react';
|
|
17
|
+
import { Button } from '../components/primitives';
|
|
18
|
+
import { PlusIcon } from '../components/icons';
|
|
19
|
+
import { Field } from '../components/field';
|
|
20
|
+
import { Textarea } from '../components/inputs';
|
|
21
|
+
import { ExpressionFieldContext } from '../schema-form/context';
|
|
22
|
+
import { generateTemplateCall } from './adapter';
|
|
23
|
+
/** Append a `tjq_<name>({…})` template call to the current expression (space-separated when non-empty). */
|
|
24
|
+
export function appendTjq(current, ref) {
|
|
25
|
+
const call = generateTemplateCall(ref, []);
|
|
26
|
+
const trimmed = current.trim();
|
|
27
|
+
return trimmed === '' ? call : `${trimmed} ${call}`;
|
|
28
|
+
}
|
|
29
|
+
export function BindingJqField({ label, value, onChange, description, error, placeholder, suggestions = [], }) {
|
|
30
|
+
const Door = useContext(ExpressionFieldContext);
|
|
31
|
+
// A stable hook for e2e: the injected jq editor owns its own DOM, so the wrapper
|
|
32
|
+
// carries the field's identity (`binding-jq-<label>`) for the driver to locate.
|
|
33
|
+
const testId = `binding-jq-${label.trim().replace(/\s+/g, '-').toLowerCase()}`;
|
|
34
|
+
// Only `input`-purpose jq are callable from an expression; an `update` jq returns an
|
|
35
|
+
// op batch and is picked solely by an update's own select — never offered as an insert.
|
|
36
|
+
const inputSuggestions = suggestions.filter((suggestion) => suggestion.purpose === 'input');
|
|
37
|
+
return (_jsxs("div", { "data-testid": testId, style: { display: 'flex', flexDirection: 'column', gap: 'var(--tai-space-1)' }, children: [Door !== undefined ? (_jsx(Door, { label: label, value: value, onChange: onChange, description: description, error: error, multiline: true })) : (_jsx(Field, { label: label, description: typeof description === 'string' ? description : undefined, error: error, children: _jsx(Textarea, { value: value, placeholder: placeholder, onChange: (event) => {
|
|
38
|
+
onChange(event.target.value);
|
|
39
|
+
}, "aria-invalid": error !== undefined ? true : undefined }) })), inputSuggestions.length > 0 ? (_jsx("div", { role: "group", "aria-label": `Insert template jq into ${label}`, style: { display: 'flex', flexWrap: 'wrap', gap: 'var(--tai-space-1)' }, children: inputSuggestions.map((suggestion) => (_jsxs(Button, { type: "button", variant: "secondary",
|
|
40
|
+
// A compact outlined pill: the leading plus reads it as an insert
|
|
41
|
+
// affordance so the monospace call text is a control, not stray code.
|
|
42
|
+
style: {
|
|
43
|
+
minHeight: 'auto',
|
|
44
|
+
padding: 'var(--tai-space-1) var(--tai-space-2)',
|
|
45
|
+
borderRadius: 'var(--tai-radius-full)',
|
|
46
|
+
fontFamily: 'var(--tai-font-mono)',
|
|
47
|
+
fontSize: 'var(--tai-text-sm)',
|
|
48
|
+
}, title: suggestion.description !== undefined && suggestion.description !== ''
|
|
49
|
+
? `${suggestion.purpose} — ${suggestion.description}`
|
|
50
|
+
: suggestion.purpose, onClick: () => {
|
|
51
|
+
onChange(appendTjq(value, suggestion.ref));
|
|
52
|
+
}, children: [_jsx(PlusIcon, {}), generateTemplateCall(suggestion.ref, [])] }, suggestion.ref))) })) : null] }));
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=BindingJqField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BindingJqField.js","sourceRoot":"","sources":["../../src/state-binding/BindingJqField.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAEnD,OAA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SAAS,IAAI,UAAU,CAAC,WAAW,KAAK,EAAE;wBACnE,CAAC,CAAC,GAAG,UAAU,CAAC,OAAO,MAAM,UAAU,CAAC,WAAW,EAAE;wBACrD,CAAC,CAAC,UAAU,CAAC,OAAO,EAExB,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;oBAC7C,CAAC,aAED,KAAC,QAAQ,KAAG,EACX,oBAAoB,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,KAtBpC,UAAU,CAAC,GAAG,CAuBZ,CACV,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The input-injection list of one attached state. Each row injects a value into the
|
|
3
|
+
* run input BEFORE the run: either a template `input` jq (picked by name) or a
|
|
4
|
+
* custom jq over the record, placed under the `into` run-input field.
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactNode } from 'react';
|
|
7
|
+
import { type TemplateJqSuggestion } from './BindingJqField';
|
|
8
|
+
import type { ResolvedTemplateJq } from './catalog';
|
|
9
|
+
import type { StateInjection } from './types';
|
|
10
|
+
export interface InjectionListProps {
|
|
11
|
+
readonly injections: readonly StateInjection[];
|
|
12
|
+
readonly onChange: (injections: readonly StateInjection[]) => void;
|
|
13
|
+
readonly inputJq: readonly ResolvedTemplateJq[];
|
|
14
|
+
readonly suggestions?: readonly TemplateJqSuggestion[];
|
|
15
|
+
}
|
|
16
|
+
export declare function InjectionList({ injections, onChange, inputJq, suggestions, }: InjectionListProps): ReactNode;
|
|
17
|
+
//# sourceMappingURL=InputInjectionRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputInjectionRow.d.ts","sourceRoot":"","sources":["../../src/state-binding/InputInjectionRow.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAsF9C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,KAAK,IAAI,CAAC;IACnE,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACxD;AAED,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,QAAQ,EACR,OAAO,EACP,WAAW,GACZ,EAAE,kBAAkB,GAAG,SAAS,CAmChC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../components/primitives';
|
|
3
|
+
import { Field } from '../components/field';
|
|
4
|
+
import { Select } from '../components/select';
|
|
5
|
+
import { TextInput } from '../components/inputs';
|
|
6
|
+
import { CloseIcon } from '../components/icons';
|
|
7
|
+
import { BindingJqField } from './BindingJqField';
|
|
8
|
+
function optionLabel(entry) {
|
|
9
|
+
return entry.description !== undefined && entry.description !== ''
|
|
10
|
+
? `${entry.ref} — ${entry.description}`
|
|
11
|
+
: entry.ref;
|
|
12
|
+
}
|
|
13
|
+
const CUSTOM = '__custom__';
|
|
14
|
+
function InjectionRow({ injection, index, inputJq, suggestions, onChange, onRemove, }) {
|
|
15
|
+
const isCustom = injection.jq !== null;
|
|
16
|
+
const selectValue = isCustom ? CUSTOM : (injection.template_jq ?? '');
|
|
17
|
+
return (_jsxs("div", { "data-testid": `injection-row-${String(index)}`, style: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
gap: 'var(--tai-space-2)',
|
|
20
|
+
alignItems: 'flex-start',
|
|
21
|
+
flexWrap: 'wrap',
|
|
22
|
+
}, children: [_jsx(Field, { label: `Injection source ${String(index + 1)}`, hideLabel: true, children: _jsx(Select, { placeholder: "Choose a template jq", value: selectValue, onValueChange: (next) => {
|
|
23
|
+
if (next === CUSTOM)
|
|
24
|
+
onChange({ template_jq: null, jq: '', into: injection.into });
|
|
25
|
+
else
|
|
26
|
+
onChange({ template_jq: next, jq: null, into: injection.into });
|
|
27
|
+
}, groups: [
|
|
28
|
+
{
|
|
29
|
+
label: 'Template jq',
|
|
30
|
+
options: inputJq.map((entry) => ({ value: entry.ref, label: optionLabel(entry) })),
|
|
31
|
+
},
|
|
32
|
+
{ label: 'Custom', options: [{ value: CUSTOM, label: 'Custom jq' }] },
|
|
33
|
+
] }) }), isCustom ? (_jsx(BindingJqField, { label: `Custom injection jq ${String(index + 1)}`, value: injection.jq ?? '', onChange: (next) => {
|
|
34
|
+
onChange({ template_jq: null, jq: next, into: injection.into });
|
|
35
|
+
}, suggestions: suggestions })) : null, _jsx(Field, { label: `Into field ${String(index + 1)}`, hideLabel: true, children: _jsx(TextInput, { placeholder: "Input field", value: injection.into, onChange: (event) => {
|
|
36
|
+
onChange({ ...injection, into: event.target.value });
|
|
37
|
+
} }) }), _jsx(Button, { type: "button", variant: "ghost", "aria-label": `Remove input ${String(index + 1)}`, onClick: onRemove, children: _jsx(CloseIcon, { "aria-hidden": "true" }) })] }));
|
|
38
|
+
}
|
|
39
|
+
export function InjectionList({ injections, onChange, inputJq, suggestions, }) {
|
|
40
|
+
const add = () => {
|
|
41
|
+
const first = inputJq[0];
|
|
42
|
+
const next = first !== undefined
|
|
43
|
+
? { template_jq: first.ref, jq: null, into: '' }
|
|
44
|
+
: { template_jq: null, jq: '', into: '' };
|
|
45
|
+
onChange([...injections, next]);
|
|
46
|
+
};
|
|
47
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 'var(--tai-space-2)' }, children: [injections.map((injection, index) => (_jsx(InjectionRow
|
|
48
|
+
// Rows are positional; the index is their stable identity within a save.
|
|
49
|
+
, { injection: injection, index: index, inputJq: inputJq, suggestions: suggestions, onChange: (next) => {
|
|
50
|
+
onChange(injections.map((current, position) => (position === index ? next : current)));
|
|
51
|
+
}, onRemove: () => {
|
|
52
|
+
onChange(injections.filter((_, position) => position !== index));
|
|
53
|
+
} }, index))), _jsx("div", { children: _jsx(Button, { type: "button", variant: "ghost", onClick: add, children: "Add input" }) })] }));
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=InputInjectionRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputInjectionRow.js","sourceRoot":"","sources":["../../src/state-binding/InputInjectionRow.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,cAAc,EAA6B,MAAM,kBAAkB,CAAC;AAI7E,SAAS,WAAW,CAAC,KAAyB;IAC5C,OAAO,KAAK,CAAC,WAAW,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,KAAK,EAAE;QAChE,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE;QACvC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;AAChB,CAAC;AAED,MAAM,MAAM,GAAG,YAAY,CAAC;AAE5B,SAAS,YAAY,CAAC,EACpB,SAAS,EACT,KAAK,EACL,OAAO,EACP,WAAW,EACX,QA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state selector, the templates it attaches
|
|
3
|
+
* (attach-on-use — a not-yet-attached pick shows the "attached on save" hint), the subject
|
|
4
|
+
* and scope expressions, the input injections, and the updates.
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactNode } from 'react';
|
|
7
|
+
import type { BindingSourceSchemas, BindingStateOption, BindingTemplateOption, StateAttach } from './types';
|
|
8
|
+
/** The subject/scope of the target's own (inherited) binding for a state this one also names. */
|
|
9
|
+
export interface InheritedSubject {
|
|
10
|
+
readonly subject_expr: string;
|
|
11
|
+
readonly scope_expr: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface StateAttachRowProps {
|
|
14
|
+
readonly attach: StateAttach;
|
|
15
|
+
readonly onChange: (attach: StateAttach) => void;
|
|
16
|
+
readonly onRemove: () => void;
|
|
17
|
+
readonly statesCatalog: readonly BindingStateOption[];
|
|
18
|
+
readonly templatesCatalog: readonly BindingTemplateOption[];
|
|
19
|
+
readonly sources?: BindingSourceSchemas;
|
|
20
|
+
readonly subjectError?: string;
|
|
21
|
+
/** The target's own binding subject for this state, when it also binds it (precedence). */
|
|
22
|
+
readonly inherited?: InheritedSubject;
|
|
23
|
+
}
|
|
24
|
+
export declare function StateAttachRow({ attach, onChange, onRemove, statesCatalog, templatesCatalog, sources, subjectError, inherited, }: StateAttachRowProps): ReactNode;
|
|
25
|
+
//# sourceMappingURL=StateAttachRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateAttachRow.d.ts","sourceRoot":"","sources":["../../src/state-binding/StateAttachRow.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAahD,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACZ,MAAM,SAAS,CAAC;AAIjB,iGAAiG;AACjG,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAqBD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACtD,QAAQ,CAAC,gBAAgB,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC5D,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,2FAA2F;IAC3F,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAED,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,SAAS,GACV,EAAE,mBAAmB,GAAG,SAAS,CA+MjC"}
|