@tai42/studio-sdk 30.0.0 → 31.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/README.md +98 -10
- package/dist/components/agent-picker.d.ts +1 -1
- package/dist/components/agent-picker.d.ts.map +1 -1
- package/dist/components/agent-picker.js +1 -0
- package/dist/components/agent-picker.js.map +1 -1
- package/dist/components/channel-picker.d.ts +1 -1
- package/dist/components/channel-picker.d.ts.map +1 -1
- package/dist/components/channel-picker.js +1 -0
- package/dist/components/channel-picker.js.map +1 -1
- package/dist/components/combo-draft-editor.d.ts +31 -0
- package/dist/components/combo-draft-editor.d.ts.map +1 -0
- package/dist/components/combo-draft-editor.js +16 -0
- package/dist/components/combo-draft-editor.js.map +1 -0
- package/dist/components/committed-combo-list.d.ts +17 -0
- package/dist/components/committed-combo-list.d.ts.map +1 -0
- package/dist/components/{extension-combo-parts.js → committed-combo-list.js} +2 -22
- package/dist/components/committed-combo-list.js.map +1 -0
- package/dist/components/components.css +53 -0
- package/dist/components/explorer-body.d.ts +1 -0
- package/dist/components/explorer-body.d.ts.map +1 -1
- package/dist/components/explorer-body.js +6 -4
- package/dist/components/explorer-body.js.map +1 -1
- package/dist/components/explorer-view.d.ts +16 -7
- package/dist/components/explorer-view.d.ts.map +1 -1
- package/dist/components/explorer-view.js +27 -13
- package/dist/components/explorer-view.js.map +1 -1
- package/dist/components/extension-combo-builder.d.ts +4 -4
- package/dist/components/extension-combo-builder.js +3 -2
- package/dist/components/extension-combo-builder.js.map +1 -1
- package/dist/components/extension-config-editor.js.map +1 -1
- package/dist/components/field.d.ts +6 -0
- package/dist/components/field.d.ts.map +1 -1
- package/dist/components/field.js +15 -2
- package/dist/components/field.js.map +1 -1
- package/dist/components/folder-actions.d.ts +51 -0
- package/dist/components/folder-actions.d.ts.map +1 -0
- package/dist/components/folder-actions.js +173 -0
- package/dist/components/folder-actions.js.map +1 -0
- package/dist/components/folder-filing.d.ts +32 -0
- package/dist/components/folder-filing.d.ts.map +1 -0
- package/dist/components/folder-filing.js +51 -0
- package/dist/components/folder-filing.js.map +1 -0
- package/dist/components/folder-nav.d.ts +9 -4
- package/dist/components/folder-nav.d.ts.map +1 -1
- package/dist/components/folder-nav.js +18 -22
- package/dist/components/folder-nav.js.map +1 -1
- package/dist/components/folder-occupancy.d.ts +27 -0
- package/dist/components/folder-occupancy.d.ts.map +1 -0
- package/dist/components/folder-occupancy.js +54 -0
- package/dist/components/folder-occupancy.js.map +1 -0
- package/dist/components/named-list-picker.d.ts +5 -3
- package/dist/components/named-list-picker.d.ts.map +1 -1
- package/dist/components/named-list-picker.js +7 -7
- package/dist/components/named-list-picker.js.map +1 -1
- package/dist/components/primitives.d.ts +2 -1
- package/dist/components/primitives.d.ts.map +1 -1
- package/dist/components/primitives.js +2 -1
- package/dist/components/primitives.js.map +1 -1
- package/dist/components/searchable-select-model.d.ts +40 -0
- package/dist/components/searchable-select-model.d.ts.map +1 -0
- package/dist/components/searchable-select-model.js +69 -0
- package/dist/components/searchable-select-model.js.map +1 -0
- package/dist/components/searchable-select.d.ts +38 -0
- package/dist/components/searchable-select.d.ts.map +1 -0
- package/dist/components/searchable-select.js +200 -0
- package/dist/components/searchable-select.js.map +1 -0
- package/dist/components/selected-tool-badges.d.ts +13 -0
- package/dist/components/selected-tool-badges.d.ts.map +1 -0
- package/dist/components/selected-tool-badges.js +14 -0
- package/dist/components/selected-tool-badges.js.map +1 -0
- package/dist/components/subject-section.d.ts.map +1 -1
- package/dist/components/subject-section.js +2 -2
- package/dist/components/subject-section.js.map +1 -1
- package/dist/components/table.d.ts +7 -1
- package/dist/components/table.d.ts.map +1 -1
- package/dist/components/table.js +2 -2
- package/dist/components/table.js.map +1 -1
- package/dist/components/tag-filter-field.d.ts +11 -0
- package/dist/components/tag-filter-field.d.ts.map +1 -0
- package/dist/components/tag-filter-field.js +15 -0
- package/dist/components/tag-filter-field.js.map +1 -0
- package/dist/components/tool-meta-access.d.ts +28 -0
- package/dist/components/tool-meta-access.d.ts.map +1 -0
- package/dist/components/tool-meta-access.js +65 -0
- package/dist/components/tool-meta-access.js.map +1 -0
- package/dist/components/tool-name-entry.d.ts +26 -0
- package/dist/components/tool-name-entry.d.ts.map +1 -0
- package/dist/components/tool-name-entry.js +43 -0
- package/dist/components/tool-name-entry.js.map +1 -0
- package/dist/components/tool-picker.d.ts +24 -19
- package/dist/components/tool-picker.d.ts.map +1 -1
- package/dist/components/tool-picker.js +55 -35
- package/dist/components/tool-picker.js.map +1 -1
- package/dist/components/tool-select.d.ts +26 -0
- package/dist/components/tool-select.d.ts.map +1 -0
- package/dist/components/tool-select.js +82 -0
- package/dist/components/tool-select.js.map +1 -0
- package/dist/extension-combos.d.ts +6 -1
- package/dist/extension-combos.d.ts.map +1 -1
- package/dist/extension-combos.js +8 -0
- package/dist/extension-combos.js.map +1 -1
- package/dist/hooks/useApi.d.ts +1 -0
- package/dist/hooks/useApi.d.ts.map +1 -1
- package/dist/hooks/useSystemKinds.d.ts +27 -12
- package/dist/hooks/useSystemKinds.d.ts.map +1 -1
- package/dist/hooks/useSystemKinds.js +56 -16
- package/dist/hooks/useSystemKinds.js.map +1 -1
- package/dist/index.d.ts +51 -49
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -26
- package/dist/index.js.map +1 -1
- package/dist/marketplace-install/use-mount-install.d.ts +6 -6
- package/dist/plugin/version.d.ts +1 -1
- package/dist/plugin/version.js +1 -1
- package/dist/schema-editor/SchemaEditor.d.ts +7 -2
- package/dist/schema-editor/SchemaEditor.d.ts.map +1 -1
- package/dist/schema-editor/SchemaEditor.js +1 -1
- package/dist/schema-editor/SchemaEditor.js.map +1 -1
- package/dist/schema-editor/index.d.ts +2 -2
- package/dist/schema-editor/index.d.ts.map +1 -1
- package/dist/schema-form/array-field.d.ts.map +1 -1
- package/dist/schema-form/array-field.js +6 -2
- package/dist/schema-form/array-field.js.map +1 -1
- package/dist/schema-form/classify.d.ts +4 -1
- package/dist/schema-form/classify.d.ts.map +1 -1
- package/dist/schema-form/classify.js +36 -15
- package/dist/schema-form/classify.js.map +1 -1
- package/dist/schema-form/collapsed-object-field.d.ts +20 -0
- package/dist/schema-form/collapsed-object-field.d.ts.map +1 -0
- package/dist/schema-form/collapsed-object-field.js +14 -0
- package/dist/schema-form/collapsed-object-field.js.map +1 -0
- package/dist/schema-form/context.d.ts +27 -1
- package/dist/schema-form/context.d.ts.map +1 -1
- package/dist/schema-form/context.js +14 -0
- package/dist/schema-form/context.js.map +1 -1
- package/dist/schema-form/default-value.d.ts +21 -6
- package/dist/schema-form/default-value.d.ts.map +1 -1
- package/dist/schema-form/default-value.js +74 -15
- package/dist/schema-form/default-value.js.map +1 -1
- package/dist/schema-form/expression-field.d.ts +48 -0
- package/dist/schema-form/expression-field.d.ts.map +1 -0
- package/dist/schema-form/expression-field.js +88 -0
- package/dist/schema-form/expression-field.js.map +1 -0
- package/dist/schema-form/field-model.d.ts +23 -4
- package/dist/schema-form/field-model.d.ts.map +1 -1
- package/dist/schema-form/field-node.d.ts.map +1 -1
- package/dist/schema-form/field-node.js +16 -3
- package/dist/schema-form/field-node.js.map +1 -1
- package/dist/schema-form/index.d.ts +3 -3
- package/dist/schema-form/index.d.ts.map +1 -1
- package/dist/schema-form/index.js +2 -2
- package/dist/schema-form/index.js.map +1 -1
- package/dist/schema-form/object-fields.d.ts +6 -3
- package/dist/schema-form/object-fields.d.ts.map +1 -1
- package/dist/schema-form/object-fields.js +14 -3
- package/dist/schema-form/object-fields.js.map +1 -1
- package/dist/schema-form/record-field.d.ts.map +1 -1
- package/dist/schema-form/record-field.js +6 -2
- package/dist/schema-form/record-field.js.map +1 -1
- package/dist/schema-form/seeding-action.d.ts +15 -0
- package/dist/schema-form/seeding-action.d.ts.map +1 -0
- package/dist/schema-form/seeding-action.js +35 -0
- package/dist/schema-form/seeding-action.js.map +1 -0
- package/dist/schema-form/string-annotations.d.ts +22 -8
- package/dist/schema-form/string-annotations.d.ts.map +1 -1
- package/dist/schema-form/string-annotations.js +39 -14
- package/dist/schema-form/string-annotations.js.map +1 -1
- package/dist/schema-form/string-field.js +2 -84
- package/dist/schema-form/string-field.js.map +1 -1
- package/dist/schema-form/templated-field.d.ts +13 -0
- package/dist/schema-form/templated-field.d.ts.map +1 -0
- package/dist/schema-form/templated-field.js +43 -0
- package/dist/schema-form/templated-field.js.map +1 -0
- package/dist/schema-form/union-field.d.ts.map +1 -1
- package/dist/schema-form/union-field.js +6 -2
- package/dist/schema-form/union-field.js.map +1 -1
- package/dist/schema-form/union.d.ts +4 -4
- package/dist/schema-form/union.d.ts.map +1 -1
- package/dist/schema-form/union.js +8 -1
- package/dist/schema-form/union.js.map +1 -1
- package/dist/schema-form/validate.d.ts.map +1 -1
- package/dist/schema-form/validate.js +28 -0
- package/dist/schema-form/validate.js.map +1 -1
- package/dist/search-match.d.ts +29 -0
- package/dist/search-match.d.ts.map +1 -0
- package/dist/search-match.js +38 -0
- package/dist/search-match.js.map +1 -0
- package/dist/tool-organization.d.ts +15 -0
- package/dist/tool-organization.d.ts.map +1 -0
- package/dist/tool-organization.js +6 -0
- package/dist/tool-organization.js.map +1 -0
- package/package.json +3 -2
- package/src/components/agent-picker.tsx +2 -1
- package/src/components/channel-picker.tsx +2 -1
- package/src/components/combo-draft-editor.tsx +96 -0
- package/src/components/{extension-combo-parts.tsx → committed-combo-list.tsx} +4 -105
- package/src/components/components.css +53 -0
- package/src/components/explorer-body.tsx +29 -5
- package/src/components/explorer-view.tsx +48 -17
- package/src/components/extension-combo-builder.tsx +10 -10
- package/src/components/extension-config-editor.tsx +3 -3
- package/src/components/field.tsx +18 -2
- package/src/components/folder-actions.tsx +341 -0
- package/src/components/folder-filing.tsx +109 -0
- package/src/components/folder-nav.tsx +26 -10
- package/src/components/folder-occupancy.ts +83 -0
- package/src/components/named-list-picker.tsx +11 -7
- package/src/components/primitives.tsx +2 -1
- package/src/components/searchable-select-model.ts +105 -0
- package/src/components/searchable-select.tsx +432 -0
- package/src/components/selected-tool-badges.tsx +41 -0
- package/src/components/subject-section.tsx +3 -2
- package/src/components/table.tsx +12 -2
- package/src/components/tag-filter-field.tsx +37 -0
- package/src/components/tool-meta-access.tsx +101 -0
- package/src/components/tool-name-entry.tsx +77 -0
- package/src/components/tool-picker.tsx +87 -52
- package/src/components/tool-select.tsx +136 -0
- package/src/extension-combos.ts +15 -1
- package/src/hooks/useSystemKinds.tsx +77 -17
- package/src/index.ts +98 -94
- package/src/plugin/version.ts +1 -1
- package/src/schema-editor/SchemaEditor.tsx +9 -3
- package/src/schema-editor/index.ts +2 -2
- package/src/schema-form/array-field.tsx +10 -2
- package/src/schema-form/classify.ts +41 -15
- package/src/schema-form/collapsed-object-field.tsx +56 -0
- package/src/schema-form/context.ts +33 -1
- package/src/schema-form/default-value.ts +89 -15
- package/src/schema-form/expression-field.tsx +162 -0
- package/src/schema-form/field-model.ts +27 -4
- package/src/schema-form/field-node.tsx +41 -2
- package/src/schema-form/index.ts +3 -2
- package/src/schema-form/object-fields.tsx +11 -4
- package/src/schema-form/record-field.tsx +10 -2
- package/src/schema-form/seeding-action.ts +44 -0
- package/src/schema-form/string-annotations.ts +40 -14
- package/src/schema-form/string-field.tsx +2 -147
- package/src/schema-form/templated-field.tsx +124 -0
- package/src/schema-form/union-field.tsx +11 -2
- package/src/schema-form/union.ts +12 -5
- package/src/schema-form/validate.ts +28 -0
- package/src/search-match.ts +41 -0
- package/src/tool-organization.ts +34 -0
- package/dist/components/extension-combo-parts.d.ts +0 -46
- package/dist/components/extension-combo-parts.d.ts.map +0 -1
- package/dist/components/extension-combo-parts.js.map +0 -1
- package/dist/components/tool-picker-parts.d.ts +0 -43
- package/dist/components/tool-picker-parts.d.ts.map +0 -1
- package/dist/components/tool-picker-parts.js +0 -89
- package/dist/components/tool-picker-parts.js.map +0 -1
- package/src/components/tool-picker-parts.tsx +0 -195
package/src/index.ts
CHANGED
|
@@ -190,17 +190,39 @@ export { effectiveHidden, hiddenToolNames } from './tool-visibility';
|
|
|
190
190
|
// -- Tool declared-badge merge (native ∪ overlay) ----------------------------
|
|
191
191
|
export { mergeToolBadges, toolBadgesByName } from './tool-badges';
|
|
192
192
|
|
|
193
|
+
// -- Text search shared by pickers and filterable lists ----------------------
|
|
194
|
+
export { isBlankSearch, matchesSearch } from './search-match';
|
|
195
|
+
|
|
193
196
|
// -- Design system -----------------------------------------------------------
|
|
194
197
|
export type { ActionMenuItem, ActionMenuProps } from './components/action-menu';
|
|
195
198
|
export { ActionMenu } from './components/action-menu';
|
|
199
|
+
export type { AgentListQuery, AgentPickerProps } from './components/agent-picker';
|
|
200
|
+
export { AgentPicker } from './components/agent-picker';
|
|
196
201
|
export type { BadgeProps } from './components/badge';
|
|
197
202
|
export { Badge } from './components/badge';
|
|
203
|
+
export type { ChannelListQuery, ChannelPickerProps } from './components/channel-picker';
|
|
204
|
+
export { channelIdentityHint, ChannelPicker } from './components/channel-picker';
|
|
198
205
|
export type { CheckboxProps } from './components/checkbox';
|
|
199
206
|
export { Checkbox } from './components/checkbox';
|
|
200
207
|
export type { ChipGroupProps, ChipOption } from './components/chip-group';
|
|
201
208
|
export { ChipGroup } from './components/chip-group';
|
|
209
|
+
export type { CodeBlockProps } from './components/code-block';
|
|
210
|
+
export { CodeBlock } from './components/code-block';
|
|
202
211
|
export type { ConfirmDialogProps } from './components/confirm-dialog';
|
|
203
212
|
export { ConfirmDialog } from './components/confirm-dialog';
|
|
213
|
+
export type { CopyFieldProps } from './components/copy-field';
|
|
214
|
+
export { CopyField } from './components/copy-field';
|
|
215
|
+
export type {
|
|
216
|
+
DateRangePickerProps,
|
|
217
|
+
DateRangePreset,
|
|
218
|
+
DateRangeValue,
|
|
219
|
+
} from './components/date-range-picker';
|
|
220
|
+
export {
|
|
221
|
+
DateRangePicker,
|
|
222
|
+
DEFAULT_DATE_RANGE_PRESETS,
|
|
223
|
+
formatRangeLabel,
|
|
224
|
+
normalizeCustomRange,
|
|
225
|
+
} from './components/date-range-picker';
|
|
204
226
|
export type { DialogProps } from './components/dialog';
|
|
205
227
|
export { Dialog } from './components/dialog';
|
|
206
228
|
export { DirtyGuardBoundary, GuardedTabs, useRegisterDirty } from './components/dirty-guard';
|
|
@@ -210,6 +232,12 @@ export type { EntityCardGridProps } from './components/entity-card-grid';
|
|
|
210
232
|
export { EntityCardGrid } from './components/entity-card-grid';
|
|
211
233
|
export type { ErrorBoundaryProps } from './components/error-boundary';
|
|
212
234
|
export { ErrorBoundary } from './components/error-boundary';
|
|
235
|
+
export type { ExecutionKeyPickerProps, ExecutionKeyQuery } from './components/execution-key-picker';
|
|
236
|
+
export {
|
|
237
|
+
canHoldExecutionKey,
|
|
238
|
+
ExecutionKeyPicker,
|
|
239
|
+
isExecutionKeyListEmpty,
|
|
240
|
+
} from './components/execution-key-picker';
|
|
213
241
|
export type {
|
|
214
242
|
ExplorerColumn,
|
|
215
243
|
ExplorerEmptyState,
|
|
@@ -225,16 +253,37 @@ export {
|
|
|
225
253
|
matchesSelectedTags,
|
|
226
254
|
UNTAGGED_TOKEN,
|
|
227
255
|
} from './components/explorer-view';
|
|
256
|
+
export type { ExtensionComboBuilderProps } from './components/extension-combo-builder';
|
|
257
|
+
export { ExtensionComboBuilder } from './components/extension-combo-builder';
|
|
258
|
+
export type { ExtensionKindGroup } from './components/extension-grouping';
|
|
259
|
+
export { groupByKind } from './components/extension-grouping';
|
|
260
|
+
export type { ExtensionPickerProps } from './components/extension-picker';
|
|
261
|
+
export { ExtensionPicker } from './components/extension-picker';
|
|
262
|
+
export type { ExternalLinkButtonProps } from './components/external-link';
|
|
263
|
+
export { ExternalLinkButton, isSafeHttpUrl } from './components/external-link';
|
|
228
264
|
export type { FieldControlProps, FieldProps } from './components/field';
|
|
229
265
|
export { Field, useFieldControl } from './components/field';
|
|
266
|
+
export type { FleetReportProps } from './components/fleet-report';
|
|
267
|
+
export { FleetReport } from './components/fleet-report';
|
|
230
268
|
export type { FormDialogProps } from './components/form-dialog';
|
|
231
269
|
export { FormDialog } from './components/form-dialog';
|
|
270
|
+
export type {
|
|
271
|
+
HolderHref,
|
|
272
|
+
HolderListProps,
|
|
273
|
+
HolderPreviewProps,
|
|
274
|
+
HolderPreviewState,
|
|
275
|
+
} from './components/holder-list';
|
|
276
|
+
export { HolderList, HolderPreview, previewHolders, useHolderHref } from './components/holder-list';
|
|
232
277
|
export type { NumberInputProps, TextareaProps, TextInputProps } from './components/inputs';
|
|
233
278
|
export { NumberInput, Textarea, TextInput } from './components/inputs';
|
|
234
279
|
export type { JsonDiffProps, JsonDiffRow } from './components/json-diff';
|
|
235
280
|
export { diffJson, JsonDiff } from './components/json-diff';
|
|
236
281
|
export type { JsonTreeProps } from './components/json-tree';
|
|
237
282
|
export { JsonTree } from './components/json-tree';
|
|
283
|
+
export type { HeadingLevel, MarkdownBlock, MarkdownProps } from './components/markdown';
|
|
284
|
+
export { Markdown, parseMarkdown } from './components/markdown';
|
|
285
|
+
export type { OpenTargetOptions, OpenTargetProps } from './components/open-target';
|
|
286
|
+
export { openTargetProps } from './components/open-target';
|
|
238
287
|
export type {
|
|
239
288
|
OverlayDetails,
|
|
240
289
|
OverlayDetailsFieldsProps,
|
|
@@ -254,8 +303,13 @@ export type {
|
|
|
254
303
|
SpinnerProps,
|
|
255
304
|
} from './components/primitives';
|
|
256
305
|
export { Button, Card, EmptyState, ErrorState, Skeleton, Spinner } from './components/primitives';
|
|
306
|
+
export { safeHttpUrl } from './components/primitives';
|
|
257
307
|
export type { RadioGroupProps, RadioOption } from './components/radio-group';
|
|
258
308
|
export { RadioGroup } from './components/radio-group';
|
|
309
|
+
export type { RecycleRollSectionProps } from './components/recycle-roll';
|
|
310
|
+
export { RecycleRollSection } from './components/recycle-roll';
|
|
311
|
+
export type { RevealInputProps } from './components/reveal-input';
|
|
312
|
+
export { RevealInput } from './components/reveal-input';
|
|
259
313
|
export type {
|
|
260
314
|
OverflowAxis,
|
|
261
315
|
OverflowRegionAttributes,
|
|
@@ -263,6 +317,11 @@ export type {
|
|
|
263
317
|
ScrollRegionProps,
|
|
264
318
|
} from './components/scroll-region';
|
|
265
319
|
export { ScrollRegion, useOverflowRegion, useProseScrollRegions } from './components/scroll-region';
|
|
320
|
+
export type {
|
|
321
|
+
SearchableSelectGroupsProps,
|
|
322
|
+
SearchableSelectProps,
|
|
323
|
+
} from './components/searchable-select';
|
|
324
|
+
export { SearchableSelect } from './components/searchable-select';
|
|
266
325
|
export type {
|
|
267
326
|
SelectGroup,
|
|
268
327
|
SelectGroupsProps,
|
|
@@ -270,73 +329,6 @@ export type {
|
|
|
270
329
|
SelectProps,
|
|
271
330
|
} from './components/select';
|
|
272
331
|
export { Select } from './components/select';
|
|
273
|
-
export type {
|
|
274
|
-
NumericColumnProps,
|
|
275
|
-
TableProps,
|
|
276
|
-
TableRowProps,
|
|
277
|
-
TableSectionProps,
|
|
278
|
-
TDProps,
|
|
279
|
-
THProps,
|
|
280
|
-
} from './components/table';
|
|
281
|
-
export { Table, TBody, TD, TH, THead, TR } from './components/table';
|
|
282
|
-
export type { TabItem, TabsProps } from './components/tabs';
|
|
283
|
-
export { Tabs } from './components/tabs';
|
|
284
|
-
export type { TagChipsProps, TagsInputProps } from './components/tags';
|
|
285
|
-
export { TagChips, TagsInput } from './components/tags';
|
|
286
|
-
export type {
|
|
287
|
-
TemplatedTextFieldProps,
|
|
288
|
-
TemplatedTextInlineProps,
|
|
289
|
-
TemplatedTextTemplateOption,
|
|
290
|
-
} from './components/templated-text-field';
|
|
291
|
-
export { TemplatedTextField, templatedTextSummary } from './components/templated-text-field';
|
|
292
|
-
export type { TooltipProps } from './components/tooltip';
|
|
293
|
-
export { Tooltip } from './components/tooltip';
|
|
294
|
-
export type { ViewMode, ViewToggleProps } from './components/view-toggle';
|
|
295
|
-
export { useViewMode, ViewToggle } from './components/view-toggle';
|
|
296
|
-
// The canonical whole-row/whole-card "open" affordance: one helper every
|
|
297
|
-
// navigable list surface spreads onto its entry (see the module doc).
|
|
298
|
-
export type { CodeBlockProps } from './components/code-block';
|
|
299
|
-
export { CodeBlock } from './components/code-block';
|
|
300
|
-
export type {
|
|
301
|
-
DateRangePickerProps,
|
|
302
|
-
DateRangePreset,
|
|
303
|
-
DateRangeValue,
|
|
304
|
-
} from './components/date-range-picker';
|
|
305
|
-
export {
|
|
306
|
-
DateRangePicker,
|
|
307
|
-
DEFAULT_DATE_RANGE_PRESETS,
|
|
308
|
-
formatRangeLabel,
|
|
309
|
-
normalizeCustomRange,
|
|
310
|
-
} from './components/date-range-picker';
|
|
311
|
-
export { ExternalLinkButton, isSafeHttpUrl } from './components/external-link';
|
|
312
|
-
export type { FleetReportProps } from './components/fleet-report';
|
|
313
|
-
export { FleetReport } from './components/fleet-report';
|
|
314
|
-
export type {
|
|
315
|
-
Folder,
|
|
316
|
-
FolderBreadcrumbProps,
|
|
317
|
-
FolderPickerProps,
|
|
318
|
-
FolderRowProps,
|
|
319
|
-
} from './components/folder-nav';
|
|
320
|
-
export {
|
|
321
|
-
childFolders,
|
|
322
|
-
FolderBreadcrumb,
|
|
323
|
-
folderPathTo,
|
|
324
|
-
FolderPicker,
|
|
325
|
-
FolderRow,
|
|
326
|
-
} from './components/folder-nav';
|
|
327
|
-
export type {
|
|
328
|
-
HolderHref,
|
|
329
|
-
HolderListProps,
|
|
330
|
-
HolderPreviewProps,
|
|
331
|
-
HolderPreviewState,
|
|
332
|
-
} from './components/holder-list';
|
|
333
|
-
export { HolderList, HolderPreview, previewHolders, useHolderHref } from './components/holder-list';
|
|
334
|
-
export type { HeadingLevel, MarkdownBlock, MarkdownProps } from './components/markdown';
|
|
335
|
-
export { Markdown, parseMarkdown } from './components/markdown';
|
|
336
|
-
export type { OpenTargetOptions, OpenTargetProps } from './components/open-target';
|
|
337
|
-
export { openTargetProps } from './components/open-target';
|
|
338
|
-
export type { RecycleRollSectionProps } from './components/recycle-roll';
|
|
339
|
-
export { RecycleRollSection } from './components/recycle-roll';
|
|
340
332
|
export type {
|
|
341
333
|
MediaDocumentProps,
|
|
342
334
|
MediaImageProps,
|
|
@@ -353,32 +345,6 @@ export {
|
|
|
353
345
|
} from './components/served-media';
|
|
354
346
|
export type { StepperProps, StepperStatus, StepperStep } from './components/stepper';
|
|
355
347
|
export { Stepper } from './components/stepper';
|
|
356
|
-
// The marketplace install UI; its directory index lists the published names.
|
|
357
|
-
export * from './marketplace-install';
|
|
358
|
-
// The URL half of the link-safety pair: `isSafeHttpUrl` answers yes/no, this one
|
|
359
|
-
// hands back the parsed URL, so a caller that needs the URL does not re-parse it.
|
|
360
|
-
export type { AgentListQuery, AgentPickerProps } from './components/agent-picker';
|
|
361
|
-
export { AgentPicker } from './components/agent-picker';
|
|
362
|
-
export type { ChannelListQuery, ChannelPickerProps } from './components/channel-picker';
|
|
363
|
-
export { channelIdentityHint, ChannelPicker } from './components/channel-picker';
|
|
364
|
-
export type { CopyFieldProps } from './components/copy-field';
|
|
365
|
-
export { CopyField } from './components/copy-field';
|
|
366
|
-
export type { ExecutionKeyPickerProps, ExecutionKeyQuery } from './components/execution-key-picker';
|
|
367
|
-
export {
|
|
368
|
-
canHoldExecutionKey,
|
|
369
|
-
ExecutionKeyPicker,
|
|
370
|
-
isExecutionKeyListEmpty,
|
|
371
|
-
} from './components/execution-key-picker';
|
|
372
|
-
export type { ExtensionComboBuilderProps } from './components/extension-combo-builder';
|
|
373
|
-
export { ExtensionComboBuilder } from './components/extension-combo-builder';
|
|
374
|
-
export type { ExtensionKindGroup } from './components/extension-grouping';
|
|
375
|
-
export { groupByKind } from './components/extension-grouping';
|
|
376
|
-
export type { ExtensionPickerProps } from './components/extension-picker';
|
|
377
|
-
export { ExtensionPicker } from './components/extension-picker';
|
|
378
|
-
export type { ExternalLinkButtonProps } from './components/external-link';
|
|
379
|
-
export { safeHttpUrl } from './components/primitives';
|
|
380
|
-
export type { RevealInputProps } from './components/reveal-input';
|
|
381
|
-
export { RevealInput } from './components/reveal-input';
|
|
382
348
|
export type { SubjectSectionProps, SubjectTargetOption } from './components/subject-section';
|
|
383
349
|
export {
|
|
384
350
|
buildSubject,
|
|
@@ -387,16 +353,43 @@ export {
|
|
|
387
353
|
toSubjectTargetOptions,
|
|
388
354
|
useSubjectFields,
|
|
389
355
|
} from './components/subject-section';
|
|
356
|
+
export type {
|
|
357
|
+
NumericColumnProps,
|
|
358
|
+
TableProps,
|
|
359
|
+
TableRowProps,
|
|
360
|
+
TableSectionProps,
|
|
361
|
+
TDProps,
|
|
362
|
+
THProps,
|
|
363
|
+
} from './components/table';
|
|
364
|
+
export { Table, TBody, TD, TH, THead, TR } from './components/table';
|
|
365
|
+
export type { TabItem, TabsProps } from './components/tabs';
|
|
366
|
+
export { Tabs } from './components/tabs';
|
|
367
|
+
export type { TagChipsProps, TagsInputProps } from './components/tags';
|
|
368
|
+
export { TagChips, TagsInput } from './components/tags';
|
|
369
|
+
export type {
|
|
370
|
+
TemplatedTextFieldProps,
|
|
371
|
+
TemplatedTextInlineProps,
|
|
372
|
+
TemplatedTextTemplateOption,
|
|
373
|
+
} from './components/templated-text-field';
|
|
374
|
+
export { TemplatedTextField, templatedTextSummary } from './components/templated-text-field';
|
|
390
375
|
export type { TokenName } from './components/tokens';
|
|
391
376
|
export { TOKEN_NAMES } from './components/tokens';
|
|
392
377
|
export type { ToolListQuery, ToolPickerProps } from './components/tool-picker';
|
|
393
378
|
export { BADGES_NOTE, ToolPicker } from './components/tool-picker';
|
|
379
|
+
export type { TooltipProps } from './components/tooltip';
|
|
380
|
+
export { Tooltip } from './components/tooltip';
|
|
394
381
|
export type {
|
|
395
382
|
VersionHistoryEntry,
|
|
396
383
|
VersionHistoryPanelProps,
|
|
397
384
|
} from './components/version-history-panel';
|
|
398
385
|
export { VersionHistoryPanel } from './components/version-history-panel';
|
|
386
|
+
export type { ViewMode, ViewToggleProps } from './components/view-toggle';
|
|
387
|
+
export { useViewMode, ViewToggle } from './components/view-toggle';
|
|
399
388
|
|
|
389
|
+
// -- Whole-module re-exports (each module's own index lists its published names) --
|
|
390
|
+
// The marketplace install UI and the tool-organization folder tree.
|
|
391
|
+
export * from './marketplace-install';
|
|
392
|
+
export * from './tool-organization';
|
|
400
393
|
// -- Iconography (the only sanctioned marks; Unicode glyphs are banned) -------
|
|
401
394
|
export type { IconComponent, IconProps } from './components/icons';
|
|
402
395
|
export {
|
|
@@ -472,6 +465,7 @@ export type {
|
|
|
472
465
|
SchemaFormProps,
|
|
473
466
|
SecretRef,
|
|
474
467
|
SecretRefFieldProps,
|
|
468
|
+
UseTemplatedTextCatalog,
|
|
475
469
|
} from './schema-form';
|
|
476
470
|
export {
|
|
477
471
|
dateRangePairs,
|
|
@@ -485,15 +479,25 @@ export {
|
|
|
485
479
|
ExpressionFieldContext,
|
|
486
480
|
fieldDrawingOrder,
|
|
487
481
|
isFieldVisible,
|
|
482
|
+
NoFiniteValueError,
|
|
488
483
|
RecordEntryRendererContext,
|
|
489
484
|
resolveRef,
|
|
490
485
|
SchemaForm,
|
|
491
486
|
SecretRefField,
|
|
487
|
+
// The stored-template source for schema-built templated-text fields: a host
|
|
488
|
+
// mounts a hook here that returns the template catalog, so those fields offer
|
|
489
|
+
// stored templates beside inline content.
|
|
490
|
+
TemplatedTextCatalogContext,
|
|
492
491
|
validateAgainstSchema,
|
|
493
492
|
} from './schema-form';
|
|
494
493
|
|
|
495
494
|
// -- Schema-editor (validated JSON-Schema authoring control) -----------------
|
|
496
|
-
export type {
|
|
495
|
+
export type {
|
|
496
|
+
SchemaEditorChange,
|
|
497
|
+
SchemaEditorDraft,
|
|
498
|
+
SchemaEditorProps,
|
|
499
|
+
SchemaLintResult,
|
|
500
|
+
} from './schema-editor';
|
|
497
501
|
export { lintSchemaText, SchemaEditor } from './schema-editor';
|
|
498
502
|
|
|
499
503
|
// -- State-binding editor (the one binding shape every door authors, plugin doors included) --
|
package/src/plugin/version.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* authoring docs state it: stylesheet injection is a host capability, so a
|
|
27
27
|
* deployment pairs the Studio host with plugins built for it.
|
|
28
28
|
*/
|
|
29
|
-
export const STUDIO_PLUGIN_API_VERSION =
|
|
29
|
+
export const STUDIO_PLUGIN_API_VERSION = 3;
|
|
30
30
|
|
|
31
31
|
export interface VersionGateResult {
|
|
32
32
|
readonly ok: boolean;
|
|
@@ -31,14 +31,20 @@ import { SchemaForm } from '../schema-form/SchemaForm';
|
|
|
31
31
|
import type { JsonSchema } from '../schema-form/types';
|
|
32
32
|
import { lintSchemaText } from './lint';
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
export interface
|
|
34
|
+
/** The parsed schema and its validity: what a host keeps of a {@link SchemaEditor}. */
|
|
35
|
+
export interface SchemaEditorDraft {
|
|
36
36
|
/** The authored schema dict when valid and non-empty; `null` when the editor is empty. */
|
|
37
37
|
readonly schema: Record<string, unknown> | null;
|
|
38
38
|
/** False when the text is non-empty but unparseable or failing lint — gate submit on this. */
|
|
39
39
|
readonly valid: boolean;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
/** What {@link SchemaEditor} reports up on every edit. */
|
|
43
|
+
export interface SchemaEditorChange extends SchemaEditorDraft {
|
|
44
|
+
/** The editor's text as typed, so a host can hold a draft the editor rejects. */
|
|
45
|
+
readonly text: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
42
48
|
export interface SchemaEditorProps {
|
|
43
49
|
/** The schema dict to seed the editor with, or `null` for an empty editor. */
|
|
44
50
|
readonly value: Record<string, unknown> | null;
|
|
@@ -162,7 +168,7 @@ export function SchemaEditor({
|
|
|
162
168
|
const emit = (nextText: string): void => {
|
|
163
169
|
setText(nextText);
|
|
164
170
|
const next = lintSchemaText(nextText, requireTitle);
|
|
165
|
-
onChange({ schema: next.valid ? next.schema : null, valid: next.valid });
|
|
171
|
+
onChange({ schema: next.valid ? next.schema : null, valid: next.valid, text: nextText });
|
|
166
172
|
};
|
|
167
173
|
|
|
168
174
|
return (
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Schema-editor — the shared, validated JSON-Schema authoring control. Public
|
|
3
|
-
* surface: the `SchemaEditor` component, its change
|
|
3
|
+
* surface: the `SchemaEditor` component, its change and draft types, and the pure lint helper
|
|
4
4
|
* consumers reuse to pre-check a stored schema.
|
|
5
5
|
*/
|
|
6
6
|
export type { SchemaLintResult } from './lint';
|
|
7
7
|
export { lintSchemaText } from './lint';
|
|
8
|
-
export type { SchemaEditorChange, SchemaEditorProps } from './SchemaEditor';
|
|
8
|
+
export type { SchemaEditorChange, SchemaEditorDraft, SchemaEditorProps } from './SchemaEditor';
|
|
9
9
|
export { SchemaEditor } from './SchemaEditor';
|
|
@@ -18,6 +18,7 @@ import { defaultValueForSchema } from './default-value';
|
|
|
18
18
|
import { FieldGroup } from './field-group';
|
|
19
19
|
import { FieldNode } from './field-node';
|
|
20
20
|
import { useKeyedCallbacks } from './keyed-callbacks';
|
|
21
|
+
import { useSeedingAction } from './seeding-action';
|
|
21
22
|
import type { FieldWords, JsonSchema, SchemaFormErrors } from './types';
|
|
22
23
|
|
|
23
24
|
export function ArrayField({
|
|
@@ -49,8 +50,10 @@ export function ArrayField({
|
|
|
49
50
|
const itemLabel = (index: number): string =>
|
|
50
51
|
(words?.itemLabel ?? 'Item {n}').split('{n}').join(String(index + 1));
|
|
51
52
|
const list = Array.isArray(value) ? (value as unknown[]) : [];
|
|
53
|
+
const add = useSeedingAction(items);
|
|
52
54
|
const addItem = (): void => {
|
|
53
|
-
|
|
55
|
+
const item = add.seed(() => newItemValue(items, root));
|
|
56
|
+
if (item.ok) onChange([...list, item.value]);
|
|
54
57
|
};
|
|
55
58
|
const removeItem = (index: number): void => {
|
|
56
59
|
onChange(list.filter((_, position) => position !== index));
|
|
@@ -61,7 +64,12 @@ export function ArrayField({
|
|
|
61
64
|
const changeFor = useKeyedCallbacks<number, unknown>(setItem, list.keys());
|
|
62
65
|
|
|
63
66
|
return (
|
|
64
|
-
<FieldGroup
|
|
67
|
+
<FieldGroup
|
|
68
|
+
heading={heading}
|
|
69
|
+
description={description}
|
|
70
|
+
error={add.failure ?? error}
|
|
71
|
+
atRoot={false}
|
|
72
|
+
>
|
|
65
73
|
{list.length === 0 ? (
|
|
66
74
|
<span className="tai-field-hint">{words?.noItems ?? 'No items'}</span>
|
|
67
75
|
) : null}
|
|
@@ -18,7 +18,12 @@ import {
|
|
|
18
18
|
variantLabel,
|
|
19
19
|
variantTag,
|
|
20
20
|
} from './resolve';
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
expressionAnnotation,
|
|
23
|
+
isTemplatedText,
|
|
24
|
+
mediaUpload,
|
|
25
|
+
withSiteExpression,
|
|
26
|
+
} from './string-annotations';
|
|
22
27
|
import type { FormControl, FormInputMode, JsonSchema } from './types';
|
|
23
28
|
|
|
24
29
|
function firstString(...values: readonly unknown[]): string | undefined {
|
|
@@ -103,7 +108,8 @@ function classifyEnum(
|
|
|
103
108
|
};
|
|
104
109
|
}
|
|
105
110
|
|
|
106
|
-
// anyOf/oneOf union normalization.
|
|
111
|
+
// anyOf/oneOf union normalization. The wrapper is the property site, so its
|
|
112
|
+
// expression annotation is carried onto every member before the members classify.
|
|
107
113
|
function classifyUnion(
|
|
108
114
|
resolved: JsonSchema,
|
|
109
115
|
members: readonly JsonSchema[],
|
|
@@ -111,7 +117,9 @@ function classifyUnion(
|
|
|
111
117
|
title: string | undefined,
|
|
112
118
|
description: string | undefined,
|
|
113
119
|
): ClassifiedField {
|
|
114
|
-
const nonNull = members
|
|
120
|
+
const nonNull = members
|
|
121
|
+
.filter((member) => !isNullSchema(resolveRef(member, root)))
|
|
122
|
+
.map((member) => withSiteExpression(member, resolved));
|
|
115
123
|
const nullable = nonNull.length !== members.length;
|
|
116
124
|
const soleNonNull = nonNull[0];
|
|
117
125
|
if (soleNonNull === undefined) {
|
|
@@ -135,7 +143,7 @@ function classifyUnion(
|
|
|
135
143
|
return { label: variantLabel(member, index, tag, root), tag, schema: member };
|
|
136
144
|
});
|
|
137
145
|
return {
|
|
138
|
-
model: { kind: 'union', variants, discriminator },
|
|
146
|
+
model: { kind: 'union', variants, discriminator, members },
|
|
139
147
|
nullable,
|
|
140
148
|
schema: resolved,
|
|
141
149
|
title,
|
|
@@ -157,16 +165,10 @@ function classifySoleUnionMember(
|
|
|
157
165
|
// that land on the OUTER null-union wrapper of an OPTIONAL field would
|
|
158
166
|
// otherwise be lost when delegating to the inner string member, silently
|
|
159
167
|
// degrading an optional upload field to a plain text box. Re-detect them on
|
|
160
|
-
// the wrapper and attach to the inner string model.
|
|
161
|
-
// annotation gets the same treatment for the same reason: an optional
|
|
162
|
-
// annotated field must keep its editor door.
|
|
168
|
+
// the wrapper and attach to the inner string model.
|
|
163
169
|
const model =
|
|
164
170
|
inner.model.kind === 'string'
|
|
165
|
-
? {
|
|
166
|
-
...inner.model,
|
|
167
|
-
media: inner.model.media ?? mediaUpload(resolved),
|
|
168
|
-
expression: inner.model.expression ?? expressionAnnotation(resolved),
|
|
169
|
-
}
|
|
171
|
+
? { ...inner.model, media: inner.model.media ?? mediaUpload(resolved) }
|
|
170
172
|
: inner.model;
|
|
171
173
|
return {
|
|
172
174
|
model,
|
|
@@ -373,7 +375,7 @@ function classifyObject(
|
|
|
373
375
|
const properties: (readonly [string, JsonSchema])[] = Object.entries(resolved.properties);
|
|
374
376
|
const required = new Set(resolved.required ?? []);
|
|
375
377
|
return {
|
|
376
|
-
model: { kind: 'object', properties, required },
|
|
378
|
+
model: { kind: 'object', properties, required, shape: resolved.properties },
|
|
377
379
|
nullable,
|
|
378
380
|
schema: resolved,
|
|
379
381
|
title,
|
|
@@ -462,13 +464,37 @@ function classifyByType(
|
|
|
462
464
|
}
|
|
463
465
|
}
|
|
464
466
|
|
|
467
|
+
/**
|
|
468
|
+
* A property typed as the platform's templated text. A node carrying the type's
|
|
469
|
+
* `x-tai42-templated-text` mark IS the type's schema, so its title and description
|
|
470
|
+
* name the TYPE, never the field: only a property site apart from it — the `$ref`
|
|
471
|
+
* pointing at the type, or a union wrapper (the union path keeps the wrapper's
|
|
472
|
+
* words) — labels the field. An inlined type node is therefore word-less here, and
|
|
473
|
+
* the field falls back to its property key. The expression annotation is read off the
|
|
474
|
+
* resolved node, which carries the property site's annotation (see {@link classifySchema}).
|
|
475
|
+
*/
|
|
476
|
+
function classifyTemplatedText(raw: JsonSchema, resolved: JsonSchema): ClassifiedField {
|
|
477
|
+
const site = isTemplatedText(raw) ? undefined : raw;
|
|
478
|
+
return {
|
|
479
|
+
model: { kind: 'templated-text', expression: expressionAnnotation(resolved) },
|
|
480
|
+
nullable: false,
|
|
481
|
+
schema: resolved,
|
|
482
|
+
title: firstString(site?.title),
|
|
483
|
+
description: firstString(site?.description),
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
|
|
465
487
|
/**
|
|
466
488
|
* Classify a schema node (resolving `$ref` first). `wrapper` metadata (a
|
|
467
489
|
* ref-site title/description) is threaded down so a `{ $ref, title }` or a
|
|
468
|
-
* null-union wrapper keeps its property-level label.
|
|
490
|
+
* null-union wrapper keeps its property-level label. The `x-tai42-expression`
|
|
491
|
+
* annotation beside a `$ref` is a property-site key that `$ref` resolution would
|
|
492
|
+
* drop, so it is carried onto the resolved node; a referenced definition that
|
|
493
|
+
* carries its own annotation keeps it.
|
|
469
494
|
*/
|
|
470
495
|
export function classifySchema(raw: JsonSchema, root: JsonSchema): ClassifiedField {
|
|
471
|
-
const resolved = resolveRef(raw, root);
|
|
496
|
+
const resolved = withSiteExpression(resolveRef(raw, root), raw);
|
|
497
|
+
if (isTemplatedText(resolved)) return classifyTemplatedText(raw, resolved);
|
|
472
498
|
const title = firstString(raw.title, resolved.title);
|
|
473
499
|
const description = firstString(raw.description, resolved.description);
|
|
474
500
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A level of a self-referencing definition that the value does not hold: the
|
|
3
|
+
* field's labelled group with one Add button, which seeds the definition's value
|
|
4
|
+
* for that level. Drawn instead of the level's fields so the nesting stops at the
|
|
5
|
+
* data (see `ExpandedShapesContext`).
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
|
|
9
|
+
import { Button } from '../components/primitives';
|
|
10
|
+
import { defaultValueForSchema } from './default-value';
|
|
11
|
+
import { FieldGroup } from './field-group';
|
|
12
|
+
import { useSeedingAction } from './seeding-action';
|
|
13
|
+
import type { JsonSchema } from './types';
|
|
14
|
+
|
|
15
|
+
export function CollapsedObjectField({
|
|
16
|
+
heading,
|
|
17
|
+
description,
|
|
18
|
+
error,
|
|
19
|
+
definition,
|
|
20
|
+
shape,
|
|
21
|
+
root,
|
|
22
|
+
onChange,
|
|
23
|
+
}: {
|
|
24
|
+
heading: string;
|
|
25
|
+
description: string | undefined;
|
|
26
|
+
error: string | undefined;
|
|
27
|
+
/** The ref-resolved object schema the Add button seeds. */
|
|
28
|
+
definition: JsonSchema;
|
|
29
|
+
/** The level's object model `shape`, the identity a failure belongs to. */
|
|
30
|
+
shape: object;
|
|
31
|
+
root: JsonSchema;
|
|
32
|
+
onChange: (value: unknown) => void;
|
|
33
|
+
}): ReactNode {
|
|
34
|
+
const add = useSeedingAction(shape);
|
|
35
|
+
return (
|
|
36
|
+
<FieldGroup
|
|
37
|
+
heading={heading}
|
|
38
|
+
description={description}
|
|
39
|
+
error={add.failure ?? error}
|
|
40
|
+
atRoot={false}
|
|
41
|
+
>
|
|
42
|
+
<div>
|
|
43
|
+
<Button
|
|
44
|
+
type="button"
|
|
45
|
+
variant="secondary"
|
|
46
|
+
onClick={() => {
|
|
47
|
+
const level = add.seed(() => defaultValueForSchema(definition, root));
|
|
48
|
+
if (level.ok) onChange(level.value);
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
Add
|
|
52
|
+
</Button>
|
|
53
|
+
</div>
|
|
54
|
+
</FieldGroup>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Ambient React contexts for the schema-form tree: the optional argument
|
|
3
3
|
* completion provider, the default media-upload byte cap, the record-entry value
|
|
4
|
-
* renderer,
|
|
4
|
+
* renderer, the expression-field door, and the object shapes being drawn above a
|
|
5
|
+
* field. A field deep in the tree reads these
|
|
5
6
|
* here rather than every intermediate node drilling the prop.
|
|
6
7
|
*/
|
|
7
8
|
import type { ComponentType, ReactNode } from 'react';
|
|
8
9
|
import { createContext } from 'react';
|
|
9
10
|
|
|
11
|
+
import type { TemplatedTextCatalog } from '../state-binding/types';
|
|
10
12
|
import { DEFAULT_MAX_UPLOAD_BYTES } from './media';
|
|
11
13
|
import type { CompletionProvider } from './SchemaForm';
|
|
12
14
|
import type { JsonSchema } from './types';
|
|
@@ -15,6 +17,14 @@ import type { JsonSchema } from './types';
|
|
|
15
17
|
// tree reads it here rather than every intermediate node drilling the prop.
|
|
16
18
|
export const CompletionProviderContext = createContext<CompletionProvider | undefined>(undefined);
|
|
17
19
|
|
|
20
|
+
/**
|
|
21
|
+
* The object shapes (an object model's `shape`) being drawn by the fields above
|
|
22
|
+
* this one. An object field whose shape is already here is a definition nested
|
|
23
|
+
* inside itself; it draws its fields only when its value holds that level, so a
|
|
24
|
+
* self-referencing schema draws to the depth of its data rather than forever.
|
|
25
|
+
*/
|
|
26
|
+
export const ExpandedShapesContext = createContext<ReadonlySet<object>>(new Set());
|
|
27
|
+
|
|
18
28
|
// Ambient default upload cap for the whole form; a media field reads it here so
|
|
19
29
|
// intermediate object/array nodes never drill the prop.
|
|
20
30
|
export const MaxUploadBytesContext = createContext<number>(DEFAULT_MAX_UPLOAD_BYTES);
|
|
@@ -147,3 +157,25 @@ export type ExpressionFieldComponent = ComponentType<ExpressionFieldProps>;
|
|
|
147
157
|
export const ExpressionFieldContext = createContext<ExpressionFieldComponent | undefined>(
|
|
148
158
|
undefined,
|
|
149
159
|
);
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The hook a host supplies so a form's templated-text fields can offer stored
|
|
163
|
+
* templates: it returns the catalog (the template ids plus the storage-presence and
|
|
164
|
+
* fetch state) the field's stored-template picker reads. The form holds no data edge,
|
|
165
|
+
* so the host owns the fetch; a field calls the hook only when it renders, so a form
|
|
166
|
+
* without a templated-text field never fetches the catalog.
|
|
167
|
+
*
|
|
168
|
+
* It is a HOOK, called on every render of a templated-text field, so the injected
|
|
169
|
+
* reference must be stable (a module-level function).
|
|
170
|
+
*/
|
|
171
|
+
export type UseTemplatedTextCatalog = () => TemplatedTextCatalog | undefined;
|
|
172
|
+
|
|
173
|
+
const useNoTemplatedTextCatalog: UseTemplatedTextCatalog = () => undefined;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The ambient stored-template source for the whole form. Absent (the default), a
|
|
177
|
+
* templated-text field gets no catalog, as every `TemplatedTextField` given none:
|
|
178
|
+
* the stored source offers no templates and inline content is authored as usual.
|
|
179
|
+
*/
|
|
180
|
+
export const TemplatedTextCatalogContext =
|
|
181
|
+
createContext<UseTemplatedTextCatalog>(useNoTemplatedTextCatalog);
|