@tai42/studio-sdk 14.0.0 → 15.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/components.css +19 -0
- package/dist/components/templated-text-field.d.ts +98 -0
- package/dist/components/templated-text-field.d.ts.map +1 -0
- package/dist/components/templated-text-field.js +217 -0
- package/dist/components/templated-text-field.js.map +1 -0
- package/dist/hooks/useApi.d.ts +310 -83
- 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 +2 -1
- package/dist/index.js.map +1 -1
- package/dist/state-binding/BindingJqField.d.ts +8 -1
- package/dist/state-binding/BindingJqField.d.ts.map +1 -1
- package/dist/state-binding/BindingJqField.js +5 -2
- package/dist/state-binding/BindingJqField.js.map +1 -1
- package/dist/state-binding/BindingTemplatedJqField.d.ts +24 -0
- package/dist/state-binding/BindingTemplatedJqField.d.ts.map +1 -0
- package/dist/state-binding/BindingTemplatedJqField.js +7 -0
- package/dist/state-binding/BindingTemplatedJqField.js.map +1 -0
- package/dist/state-binding/InputInjectionRow.d.ts +4 -3
- package/dist/state-binding/InputInjectionRow.d.ts.map +1 -1
- package/dist/state-binding/InputInjectionRow.js +9 -9
- package/dist/state-binding/InputInjectionRow.js.map +1 -1
- package/dist/state-binding/StateAttachRow.d.ts +6 -4
- package/dist/state-binding/StateAttachRow.d.ts.map +1 -1
- package/dist/state-binding/StateAttachRow.js +13 -12
- package/dist/state-binding/StateAttachRow.js.map +1 -1
- package/dist/state-binding/StateBindingEditor.d.ts +4 -2
- package/dist/state-binding/StateBindingEditor.d.ts.map +1 -1
- package/dist/state-binding/StateBindingEditor.js +10 -8
- package/dist/state-binding/StateBindingEditor.js.map +1 -1
- package/dist/state-binding/SubjectScopeFields.d.ts +12 -9
- package/dist/state-binding/SubjectScopeFields.d.ts.map +1 -1
- package/dist/state-binding/SubjectScopeFields.js +5 -5
- package/dist/state-binding/SubjectScopeFields.js.map +1 -1
- package/dist/state-binding/UpdateRow.d.ts +4 -3
- package/dist/state-binding/UpdateRow.d.ts.map +1 -1
- package/dist/state-binding/UpdateRow.js +29 -16
- package/dist/state-binding/UpdateRow.js.map +1 -1
- package/dist/state-binding/index.d.ts +5 -1
- package/dist/state-binding/index.d.ts.map +1 -1
- package/dist/state-binding/index.js +2 -0
- package/dist/state-binding/index.js.map +1 -1
- package/dist/state-binding/templated-text-catalog.d.ts +21 -0
- package/dist/state-binding/templated-text-catalog.d.ts.map +1 -0
- package/dist/state-binding/templated-text-catalog.js +48 -0
- package/dist/state-binding/templated-text-catalog.js.map +1 -0
- package/dist/state-binding/types.d.ts +23 -2
- package/dist/state-binding/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/components.css +19 -0
- package/src/components/templated-text-field.tsx +508 -0
- package/src/index.ts +13 -0
- package/src/state-binding/BindingJqField.tsx +12 -0
- package/src/state-binding/BindingTemplatedJqField.tsx +73 -0
- package/src/state-binding/InputInjectionRow.tsx +16 -7
- package/src/state-binding/StateAttachRow.tsx +19 -11
- package/src/state-binding/StateBindingEditor.tsx +14 -6
- package/src/state-binding/SubjectScopeFields.tsx +23 -15
- package/src/state-binding/UpdateRow.tsx +57 -24
- package/src/state-binding/index.ts +6 -0
- package/src/state-binding/templated-text-catalog.ts +69 -0
- package/src/state-binding/types.ts +31 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
export function SubjectScopeFields({ subjectExpr, scopeExpr, onSubjectChange, onScopeChange, subjectError, suggestions, }) {
|
|
4
|
-
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 'var(--tai-space-2)' }, children: [_jsx(
|
|
5
|
-
|
|
6
|
-
}, suggestions: suggestions })] }));
|
|
2
|
+
import { BindingTemplatedJqField } from './BindingTemplatedJqField';
|
|
3
|
+
export function SubjectScopeFields({ subjectExpr, scopeExpr, onSubjectChange, onScopeChange, subjectError, suggestions, templates, }) {
|
|
4
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 'var(--tai-space-2)' }, children: [_jsx(BindingTemplatedJqField, { label: "Subject", required: true, description: "The record key this binding reads and updates: a key string, or a full subject object.", value: subjectExpr, error: subjectError, suggestions: suggestions, templates: templates, placeholder: ".subject_id", onChange: (next) => {
|
|
5
|
+
onSubjectChange(next ?? { content: '' });
|
|
6
|
+
} }), _jsx(BindingTemplatedJqField, { label: "Scope", description: "Optional. A jq condition; when it is false this state is skipped for the run.", value: scopeExpr, suggestions: suggestions, templates: templates, onChange: onScopeChange })] }));
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=SubjectScopeFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubjectScopeFields.js","sourceRoot":"","sources":["../../src/state-binding/SubjectScopeFields.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SubjectScopeFields.js","sourceRoot":"","sources":["../../src/state-binding/SubjectScopeFields.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAcpE,MAAM,UAAU,kBAAkB,CAAC,EACjC,WAAW,EACX,SAAS,EACT,eAAe,EACf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,SAAS,GACe;IACxB,OAAO,CACL,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,oBAAoB,EAAE,aACjF,KAAC,uBAAuB,IACtB,KAAK,EAAC,SAAS,EACf,QAAQ,QACR,WAAW,EAAC,wFAAwF,EACpG,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAC,aAAa,EACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;oBACjB,eAAe,CAAC,IAAI,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC3C,CAAC,GACD,EACF,KAAC,uBAAuB,IACtB,KAAK,EAAC,OAAO,EACb,WAAW,EAAC,+EAA+E,EAC3F,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,aAAa,GACvB,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
* the whole op batch itself. An optional op-id expression carries idempotency.
|
|
6
6
|
*/
|
|
7
7
|
import type { ReactNode } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import type { TemplateJqSuggestion } from './BindingJqField';
|
|
9
9
|
import { type ResolvedTemplateJq } from './catalog';
|
|
10
|
-
import type { BindingSourceSchemas, StateUpdate } from './types';
|
|
10
|
+
import type { BindingSourceSchemas, StateUpdate, TemplatedTextCatalog } from './types';
|
|
11
11
|
export interface UpdateListProps {
|
|
12
12
|
readonly updates: readonly StateUpdate[];
|
|
13
13
|
readonly onChange: (updates: readonly StateUpdate[]) => void;
|
|
14
14
|
readonly updateJq: readonly ResolvedTemplateJq[];
|
|
15
15
|
readonly sources?: BindingSourceSchemas;
|
|
16
16
|
readonly suggestions?: readonly TemplateJqSuggestion[];
|
|
17
|
+
readonly templates?: TemplatedTextCatalog;
|
|
17
18
|
}
|
|
18
|
-
export declare function UpdateList({ updates, onChange, updateJq, sources, suggestions, }: UpdateListProps): ReactNode;
|
|
19
|
+
export declare function UpdateList({ updates, onChange, updateJq, sources, suggestions, templates, }: UpdateListProps): ReactNode;
|
|
19
20
|
//# sourceMappingURL=UpdateRow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateRow.d.ts","sourceRoot":"","sources":["../../src/state-binding/UpdateRow.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UpdateRow.d.ts","sourceRoot":"","sources":["../../src/state-binding/UpdateRow.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAa,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AA2JvF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvD,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAC3C;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,SAAS,GACV,EAAE,eAAe,GAAG,SAAS,CAqC7B"}
|
|
@@ -3,9 +3,10 @@ import { Badge } from '../components/badge';
|
|
|
3
3
|
import { Button } from '../components/primitives';
|
|
4
4
|
import { Field } from '../components/field';
|
|
5
5
|
import { Select } from '../components/select';
|
|
6
|
+
import { TemplatedTextField } from '../components/templated-text-field';
|
|
6
7
|
import { CloseIcon } from '../components/icons';
|
|
7
8
|
import { AdapterMapping } from './AdapterMapping';
|
|
8
|
-
import {
|
|
9
|
+
import { BindingTemplatedJqField } from './BindingTemplatedJqField';
|
|
9
10
|
import { findByRef } from './catalog';
|
|
10
11
|
const CUSTOM = '__custom__';
|
|
11
12
|
function optionLabel(entry) {
|
|
@@ -18,7 +19,7 @@ function writesLabel(entry) {
|
|
|
18
19
|
return null;
|
|
19
20
|
return entry.writes.map((path) => path.join('.')).join(', ');
|
|
20
21
|
}
|
|
21
|
-
function UpdateRowEditor({ update, index, updateJq, sources, suggestions, onChange, onRemove, }) {
|
|
22
|
+
function UpdateRowEditor({ update, index, updateJq, sources, suggestions, templates, onChange, onRemove, }) {
|
|
22
23
|
const isCustom = update.jq !== null;
|
|
23
24
|
const selectValue = isCustom ? CUSTOM : (update.template_jq ?? '');
|
|
24
25
|
const resolved = update.template_jq !== null ? findByRef(update.template_jq, updateJq) : undefined;
|
|
@@ -37,7 +38,12 @@ function UpdateRowEditor({ update, index, updateJq, sources, suggestions, onChan
|
|
|
37
38
|
flexWrap: 'wrap',
|
|
38
39
|
}, children: [_jsx(Field, { label: `Update source ${String(index + 1)}`, hideLabel: true, children: _jsx(Select, { placeholder: "Choose a template jq", value: selectValue, onValueChange: (next) => {
|
|
39
40
|
if (next === CUSTOM)
|
|
40
|
-
onChange({
|
|
41
|
+
onChange({
|
|
42
|
+
template_jq: null,
|
|
43
|
+
jq: { content: '' },
|
|
44
|
+
adapter: null,
|
|
45
|
+
op_id: update.op_id,
|
|
46
|
+
});
|
|
41
47
|
else
|
|
42
48
|
onChange({ template_jq: next, jq: null, adapter: null, op_id: update.op_id });
|
|
43
49
|
}, groups: [
|
|
@@ -46,28 +52,35 @@ function UpdateRowEditor({ update, index, updateJq, sources, suggestions, onChan
|
|
|
46
52
|
options: updateJq.map((entry) => ({ value: entry.ref, label: optionLabel(entry) })),
|
|
47
53
|
},
|
|
48
54
|
{ label: 'Custom', options: [{ value: CUSTOM, label: 'Custom jq' }] },
|
|
49
|
-
] }) }), writes !== null ? _jsx(Badge, { variant: "neutral", children: `writes: ${writes}` }) : null, _jsx(Button, { type: "button", variant: "ghost", "aria-label": `Remove update ${String(index + 1)}`, onClick: onRemove, children: _jsx(CloseIcon, { "aria-hidden": "true" }) })] }), isCustom ? (_jsx(
|
|
50
|
-
onChange({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
] }) }), writes !== null ? _jsx(Badge, { variant: "neutral", children: `writes: ${writes}` }) : null, _jsx(Button, { type: "button", variant: "ghost", "aria-label": `Remove update ${String(index + 1)}`, onClick: onRemove, children: _jsx(CloseIcon, { "aria-hidden": "true" }) })] }), isCustom ? (_jsx(BindingTemplatedJqField, { label: `Custom update jq ${String(index + 1)}`, required: true, description: "A jq over `{ record, output, input }` returning a template-relative op batch.", value: update.jq, onChange: (next) => {
|
|
56
|
+
onChange({
|
|
57
|
+
template_jq: null,
|
|
58
|
+
jq: next ?? { content: '' },
|
|
59
|
+
adapter: null,
|
|
60
|
+
op_id: update.op_id,
|
|
61
|
+
});
|
|
62
|
+
}, suggestions: suggestions, templates: templates })) : (_jsx(TemplatedTextField
|
|
63
|
+
// Remount on a template change so the mapping rebuilds from the newly
|
|
64
|
+
// declared input (and re-seeds its shown default) instead of stale rows.
|
|
65
|
+
, { label: "Adapter", value: update.adapter, templates: templates?.templates, templatesLoading: templates?.loading, templatesError: templates?.error, onTemplatesRetry: templates?.onRetry, storageAbsent: templates?.storageAbsent, storagePresenceLoading: templates?.storagePresenceLoading, onChange: (next) => {
|
|
66
|
+
onChange({ ...update, adapter: next });
|
|
67
|
+
}, renderInline: ({ value: inlineValue, onChange: onInline }) => (_jsx(AdapterMapping, { declaredInput: resolved?.params ?? [], value: inlineValue, sources: sources, suggestions: suggestions, onChange: (adapterJq) => {
|
|
68
|
+
onInline(adapterJq ?? '');
|
|
69
|
+
} })) }, resolved?.ref ?? '__none__')), _jsx(BindingTemplatedJqField, { label: "Op id", description: "Optional \u2014 an idempotency-key expression.", value: update.op_id, onChange: (next) => {
|
|
70
|
+
onChange({ ...update, op_id: next });
|
|
71
|
+
}, suggestions: suggestions, templates: templates })] }));
|
|
59
72
|
}
|
|
60
|
-
export function UpdateList({ updates, onChange, updateJq, sources, suggestions, }) {
|
|
73
|
+
export function UpdateList({ updates, onChange, updateJq, sources, suggestions, templates, }) {
|
|
61
74
|
const add = () => {
|
|
62
75
|
const first = updateJq[0];
|
|
63
76
|
const next = first !== undefined
|
|
64
77
|
? { template_jq: first.ref, jq: null, adapter: null, op_id: null }
|
|
65
|
-
: { template_jq: null, jq: '', adapter: null, op_id: null };
|
|
78
|
+
: { template_jq: null, jq: { content: '' }, adapter: null, op_id: null };
|
|
66
79
|
onChange([...updates, next]);
|
|
67
80
|
};
|
|
68
81
|
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 'var(--tai-space-2)' }, children: [updates.map((update, index) => (_jsx(UpdateRowEditor
|
|
69
82
|
// Rows are positional; the index is their stable identity within a save.
|
|
70
|
-
, { update: update, index: index, updateJq: updateJq, sources: sources, suggestions: suggestions, onChange: (next) => {
|
|
83
|
+
, { update: update, index: index, updateJq: updateJq, sources: sources, suggestions: suggestions, templates: templates, onChange: (next) => {
|
|
71
84
|
onChange(updates.map((current, position) => (position === index ? next : current)));
|
|
72
85
|
}, onRemove: () => {
|
|
73
86
|
onChange(updates.filter((_, position) => position !== index));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateRow.js","sourceRoot":"","sources":["../../src/state-binding/UpdateRow.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,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,qBAAqB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;A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KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBACtF,CAAC,EACD,QAAQ,EAAE,GAAG,EAAE;oBACb,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC;gBAChE,CAAC,IAZI,KAAK,CAaV,CACH,CAAC,EACF,wBACE,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,OAAO,EAAC,OAAO,EAAE,GAAG,2BAEzC,GACL,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -20,10 +20,14 @@ export { SubjectScopeFields } from './SubjectScopeFields';
|
|
|
20
20
|
export type { SubjectScopeFieldsProps } from './SubjectScopeFields';
|
|
21
21
|
export { BindingJqField, appendTjq } from './BindingJqField';
|
|
22
22
|
export type { BindingJqFieldProps, TemplateJqSuggestion } from './BindingJqField';
|
|
23
|
+
export { BindingTemplatedJqField } from './BindingTemplatedJqField';
|
|
24
|
+
export type { BindingTemplatedJqFieldProps } from './BindingTemplatedJqField';
|
|
23
25
|
export { resolveTemplateJq, findByRef, resolveCallName } from './catalog';
|
|
24
26
|
export type { ResolvedTemplateJq } from './catalog';
|
|
27
|
+
export { templatedTextCatalog } from './templated-text-catalog';
|
|
28
|
+
export type { StoragePresenceQueryLike, TemplateNamesQueryLike } from './templated-text-catalog';
|
|
25
29
|
export { templatesCatalogFromList, statesCatalogFromList, fieldPathsFromSchema, } from './build-catalog';
|
|
26
30
|
export { compileAdapter, rowValueJq, fieldPathToJq, jqKey, defaultRowsForInput, parseAdapter, parseFieldPath, generateTemplateCall, parseTemplateCall, encodeTemplateSegment, } from './adapter';
|
|
27
31
|
export type { MappingRow, MappingSource, FieldSource, LiteralSource, JqSource, FieldRoot, AdapterCompileResult, } from './adapter';
|
|
28
|
-
export type { BindingStateOption, BindingTemplateOption, BindingTemplateJqOption, BindingSourceSchemas, SchemaFieldPath, StateBinding, StateAttach, StateInjection, StateUpdate, } from './types';
|
|
32
|
+
export type { BindingStateOption, BindingTemplateOption, BindingTemplateJqOption, BindingSourceSchemas, SchemaFieldPath, StateBinding, StateAttach, StateInjection, StateUpdate, TemplatedText, TemplatedTextCatalog, } from './types';
|
|
29
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state-binding/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,KAAK,EACL,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,QAAQ,EACR,SAAS,EACT,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state-binding/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,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AAC"}
|
|
@@ -12,7 +12,9 @@ export { UpdateList } from './UpdateRow';
|
|
|
12
12
|
export { AdapterMapping } from './AdapterMapping';
|
|
13
13
|
export { SubjectScopeFields } from './SubjectScopeFields';
|
|
14
14
|
export { BindingJqField, appendTjq } from './BindingJqField';
|
|
15
|
+
export { BindingTemplatedJqField } from './BindingTemplatedJqField';
|
|
15
16
|
export { resolveTemplateJq, findByRef, resolveCallName } from './catalog';
|
|
17
|
+
export { templatedTextCatalog } from './templated-text-catalog';
|
|
16
18
|
export { templatesCatalogFromList, statesCatalogFromList, fieldPathsFromSchema, } from './build-catalog';
|
|
17
19
|
export { compileAdapter, rowValueJq, fieldPathToJq, jqKey, defaultRowsForInput, parseAdapter, parseFieldPath, generateTemplateCall, parseTemplateCall, encodeTemplateSegment, } from './adapter';
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state-binding/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE1E,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,KAAK,EACL,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/state-binding/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,KAAK,EACL,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TemplatedTextCatalog } from './types';
|
|
2
|
+
/** The storage-presence query result (`GET /api/storage`) fields this helper reads. */
|
|
3
|
+
export interface StoragePresenceQueryLike {
|
|
4
|
+
readonly data?: {
|
|
5
|
+
readonly present: boolean;
|
|
6
|
+
};
|
|
7
|
+
readonly isPending: boolean;
|
|
8
|
+
readonly isError: boolean;
|
|
9
|
+
readonly error: unknown;
|
|
10
|
+
readonly refetch: () => unknown;
|
|
11
|
+
}
|
|
12
|
+
/** The stored-template-names query result (`GET /api/templates`) fields this helper reads. */
|
|
13
|
+
export interface TemplateNamesQueryLike {
|
|
14
|
+
readonly data?: readonly string[];
|
|
15
|
+
readonly isPending: boolean;
|
|
16
|
+
readonly isError: boolean;
|
|
17
|
+
readonly error: unknown;
|
|
18
|
+
readonly refetch: () => unknown;
|
|
19
|
+
}
|
|
20
|
+
export declare function templatedTextCatalog(storage: StoragePresenceQueryLike, templates: TemplateNamesQueryLike): TemplatedTextCatalog;
|
|
21
|
+
//# sourceMappingURL=templated-text-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templated-text-catalog.d.ts","sourceRoot":"","sources":["../../src/state-binding/templated-text-catalog.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,uFAAuF;AACvF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;CACjC;AAED,8FAA8F;AAC9F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;CACjC;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,wBAAwB,EACjC,SAAS,EAAE,sBAAsB,GAChC,oBAAoB,CA0BtB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the {@link TemplatedTextCatalog} a door form feeds its templated-text
|
|
3
|
+
* fields, from the two queries every such form already runs: the storage-presence
|
|
4
|
+
* signal (`GET /api/storage`) and the stored-template name list (`GET /api/templates`).
|
|
5
|
+
*
|
|
6
|
+
* Storage is dead by default — a deployment with no storage backend is supported —
|
|
7
|
+
* and the template list door cannot answer without one. So the CALLER gates its
|
|
8
|
+
* template-names query on presence (`enabled: storage.data?.present === true`), and
|
|
9
|
+
* this helper maps the two query states onto the catalog the field reads: when
|
|
10
|
+
* storage is absent it exposes no templates and marks the field absent (the field
|
|
11
|
+
* then offers no stored source); when present it exposes the fetched names. A
|
|
12
|
+
* presence-fetch failure surfaces ahead of a template-fetch failure, since presence
|
|
13
|
+
* is the prerequisite.
|
|
14
|
+
*
|
|
15
|
+
* It takes the query RESULTS structurally (the fields it reads), so this module adds
|
|
16
|
+
* no data-layer dependency to the SDK.
|
|
17
|
+
*/
|
|
18
|
+
import { errorMessage } from '../errors';
|
|
19
|
+
export function templatedTextCatalog(storage, templates) {
|
|
20
|
+
const presenceKnown = storage.data !== undefined;
|
|
21
|
+
const present = storage.data?.present === true;
|
|
22
|
+
// A presence failure matters only until presence is first known: once it is in
|
|
23
|
+
// hand, a later background-refetch failure must not blow away a field already
|
|
24
|
+
// working from it. Presence is the prerequisite of the catalog, so its failure
|
|
25
|
+
// surfaces ahead of a catalog-fetch failure.
|
|
26
|
+
const presenceFailed = storage.isError && !presenceKnown;
|
|
27
|
+
return {
|
|
28
|
+
// Never expose template names while storage is absent or unknown — the caller's
|
|
29
|
+
// gate keeps the list query from firing there, and its pending/stale data must
|
|
30
|
+
// not leak into a picker the field will not show.
|
|
31
|
+
templates: present ? (templates.data ?? []).map((id) => ({ id })) : [],
|
|
32
|
+
loading: present && templates.isPending,
|
|
33
|
+
error: presenceFailed
|
|
34
|
+
? errorMessage(storage.error)
|
|
35
|
+
: templates.isError
|
|
36
|
+
? errorMessage(templates.error)
|
|
37
|
+
: undefined,
|
|
38
|
+
onRetry: () => {
|
|
39
|
+
if (presenceFailed)
|
|
40
|
+
void storage.refetch();
|
|
41
|
+
else
|
|
42
|
+
void templates.refetch();
|
|
43
|
+
},
|
|
44
|
+
storageAbsent: storage.data?.present === false,
|
|
45
|
+
storagePresenceLoading: !presenceKnown && storage.isPending,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=templated-text-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templated-text-catalog.js","sourceRoot":"","sources":["../../src/state-binding/templated-text-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAsBzC,MAAM,UAAU,oBAAoB,CAClC,OAAiC,EACjC,SAAiC;IAEjC,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,+EAA+E;IAC/E,8EAA8E;IAC9E,+EAA+E;IAC/E,6CAA6C;IAC7C,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC;IACzD,OAAO;QACL,gFAAgF;QAChF,+EAA+E;QAC/E,kDAAkD;QAClD,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACtE,OAAO,EAAE,OAAO,IAAI,SAAS,CAAC,SAAS;QACvC,KAAK,EAAE,cAAc;YACnB,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC;YAC7B,CAAC,CAAC,SAAS,CAAC,OAAO;gBACjB,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC;gBAC/B,CAAC,CAAC,SAAS;QACf,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,cAAc;gBAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC;;gBACtC,KAAK,SAAS,CAAC,OAAO,EAAE,CAAC;QAChC,CAAC;QACD,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,KAAK,KAAK;QAC9C,sBAAsB,EAAE,CAAC,aAAa,IAAI,OAAO,CAAC,SAAS;KAC5D,CAAC;AACJ,CAAC"}
|
|
@@ -7,8 +7,29 @@
|
|
|
7
7
|
* the states it may bind, the templates each may attach, and — when a schema is
|
|
8
8
|
* known — the fields a picker offers.
|
|
9
9
|
*/
|
|
10
|
-
import type { StateBinding, StateAttach, StateInjection, StateUpdate } from '@tai42/api-client';
|
|
11
|
-
|
|
10
|
+
import type { StateBinding, StateAttach, StateInjection, StateUpdate, TemplatedText } from '@tai42/api-client';
|
|
11
|
+
import type { TemplatedTextTemplateOption } from '../components/templated-text-field';
|
|
12
|
+
export type { StateBinding, StateAttach, StateInjection, StateUpdate, TemplatedText };
|
|
13
|
+
/**
|
|
14
|
+
* The stored templates a {@link TemplatedText} field's id picker offers, with the
|
|
15
|
+
* fetch's loading/error state — resolved by the door screen and passed to the
|
|
16
|
+
* editor, which holds no data edge of its own. Absent leaves every templated-text
|
|
17
|
+
* field with the inline source only.
|
|
18
|
+
*/
|
|
19
|
+
export interface TemplatedTextCatalog {
|
|
20
|
+
readonly templates?: readonly TemplatedTextTemplateOption[];
|
|
21
|
+
readonly loading?: boolean;
|
|
22
|
+
readonly error?: string;
|
|
23
|
+
readonly onRetry?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Storage is registered absent (`GET /api/storage` → `present: false`), so the
|
|
26
|
+
* catalog was not fetched and the stored source is not offered on the fields this
|
|
27
|
+
* catalog feeds; an already-stored id is shown read-only.
|
|
28
|
+
*/
|
|
29
|
+
readonly storageAbsent?: boolean;
|
|
30
|
+
/** Storage presence is not yet known — the fields render a placeholder, not a toggle. */
|
|
31
|
+
readonly storagePresenceLoading?: boolean;
|
|
32
|
+
}
|
|
12
33
|
/** One selectable field of a schema: the record path + a human label. */
|
|
13
34
|
export interface SchemaFieldPath {
|
|
14
35
|
readonly path: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state-binding/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state-binding/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAEtF,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AAEtF;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAC5D,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,E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QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAC5C,iEAAiE;IACjE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,sFAAsF;IACtF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tai42/studio-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "The Studio plugin contract, shared UI components, and hooks that every feature builds on.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "tai42 <oss@tai42.ai>",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@radix-ui/react-select": "^2.3.2",
|
|
97
97
|
"@radix-ui/react-tabs": "^1.1.21",
|
|
98
98
|
"@radix-ui/react-tooltip": "^1.2.11",
|
|
99
|
-
"@tai42/api-client": "
|
|
99
|
+
"@tai42/api-client": "15.0.0"
|
|
100
100
|
},
|
|
101
101
|
"scripts": {
|
|
102
102
|
"build": "tsc -b tsconfig.build.json && node scripts/copy-assets.mjs",
|
|
@@ -1953,6 +1953,25 @@
|
|
|
1953
1953
|
border: 0;
|
|
1954
1954
|
}
|
|
1955
1955
|
|
|
1956
|
+
/* A `TemplatedTextField` renders its label as a group header above the source
|
|
1957
|
+
toggle, so an inline jq editor placed under that header (`@tai42/jq-studio`'s
|
|
1958
|
+
`JqField`, the direct child of this wrapper) hides its OWN visible label — the
|
|
1959
|
+
header is the single visible label. The label element stays in the DOM, so its
|
|
1960
|
+
`<label for>` keeps naming the control and the visual-editor door keeps its
|
|
1961
|
+
accessible name; only the paint is dropped. Scoped to a direct child so a
|
|
1962
|
+
mapping editor's nested field labels are untouched. */
|
|
1963
|
+
.tai-templated-inline--grouped > .jqs-field > .jqs-field__label {
|
|
1964
|
+
position: absolute;
|
|
1965
|
+
width: 1px;
|
|
1966
|
+
height: 1px;
|
|
1967
|
+
margin: -1px;
|
|
1968
|
+
padding: 0;
|
|
1969
|
+
overflow: hidden;
|
|
1970
|
+
clip-path: inset(50%);
|
|
1971
|
+
white-space: nowrap;
|
|
1972
|
+
border: 0;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1956
1975
|
/* -- Shell -----------------------------------------------------------------------
|
|
1957
1976
|
The application frame: a fixed-width sidebar beside a scrolling main
|
|
1958
1977
|
column at >=1024, a 72 px labelled icon rail from 640, and a sticky top bar
|