@signalsafe/tree-spec-editor 0.3.7 → 0.4.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 +1 -0
- package/dist/panels/InspectorPanel.d.ts +1 -1
- package/dist/panels/InspectorPanel.d.ts.map +1 -1
- package/dist/panels/InspectorPanel.js +2 -2
- package/dist/panels/inspector/ChoiceEditorCard.d.ts +4 -1
- package/dist/panels/inspector/ChoiceEditorCard.d.ts.map +1 -1
- package/dist/panels/inspector/ChoiceEditorCard.js +5 -3
- package/dist/panels/inspector/ChoiceEditorList.d.ts +2 -1
- package/dist/panels/inspector/ChoiceEditorList.d.ts.map +1 -1
- package/dist/panels/inspector/ChoiceEditorList.js +7 -3
- package/dist/panels/inspector/types.d.ts +5 -0
- package/dist/panels/inspector/types.d.ts.map +1 -1
- package/dist/ui/editorClasses.d.ts +1 -0
- package/dist/ui/editorClasses.d.ts.map +1 -1
- package/dist/ui/editorClasses.js +1 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -689,6 +689,7 @@ function RightRail({
|
|
|
689
689
|
- `onMoveChoice`: when set, shows up/down icon actions to reorder choices within the node.
|
|
690
690
|
- `onFocusChoice`: invoked when the user focuses any control inside a choice card; use to sync canvas/node-list highlighting.
|
|
691
691
|
- `renderExtraNodeFields({ tree, node, isPublished, onUpdateNode })`: render extra UI below the Prompt textarea, scoped to the currently-selected node. Use for project-specific node metadata (render hints, scoring, classification, etc.).
|
|
692
|
+
- `collapsibleChoices`: render each choice as a collapsible card with a label toggle; one card is open at a time and all start collapsed (pair with `@signalsafe/tree-spec-editor-theme-bootstrap` >= 0.3.4 for toggle styling).
|
|
692
693
|
- `renderExtraChoiceFields({ tree, node, choice, transition, isPublished, onUpdateNode })`: render extra UI below each choice card (after Next/Outcome). Use for project-specific per-choice metadata.
|
|
693
694
|
- `onDeleteSelectedNode`: when set, shows a delete-node icon in the Required card header; wire to `useTreeSpecEditor().actions.deleteSelectedNode` (or equivalent). Disabled automatically when `isPublished` is true.
|
|
694
695
|
- `title`: Required card header text (default `"Required"`).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type InspectorPanelProps } from './inspector/types.js';
|
|
2
2
|
export { DEFAULT_OUTCOME_OPTIONS, type ChoiceTypeOption, type InspectorChoiceRenderContext, type InspectorNodeRenderContext, type InspectorPanelProps, } from './inspector/types.js';
|
|
3
|
-
export default function InspectorPanel({ tree, selectedNode, focusChoiceId, isPublished, onUpdateSelectedNode, onAddChoice, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, outcomeOptions, hideOutcomeField, renderPromptField, renderExtraNodeFields, renderExtraChoiceFields, choiceTypes, onSetChoiceType, title, emptyStateText, typeHelperText, onDeleteSelectedNode, onFocusChoice, }: Readonly<InspectorPanelProps>): import("react").JSX.Element;
|
|
3
|
+
export default function InspectorPanel({ tree, selectedNode, focusChoiceId, isPublished, onUpdateSelectedNode, onAddChoice, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, outcomeOptions, hideOutcomeField, renderPromptField, renderExtraNodeFields, renderExtraChoiceFields, choiceTypes, onSetChoiceType, title, emptyStateText, typeHelperText, onDeleteSelectedNode, onFocusChoice, collapsibleChoices, }: Readonly<InspectorPanelProps>): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=InspectorPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InspectorPanel.d.ts","sourceRoot":"","sources":["../../src/panels/InspectorPanel.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAGH,KAAK,mBAAmB,EAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACnC,IAAI,EACJ,YAAY,EACZ,aAAoB,EACpB,WAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,cAAwC,EACxC,gBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,KAAkB,EAClB,cAA4C,EAC5C,cAAyC,EACzC,oBAAoB,EACpB,aAAa,
|
|
1
|
+
{"version":3,"file":"InspectorPanel.d.ts","sourceRoot":"","sources":["../../src/panels/InspectorPanel.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAGH,KAAK,mBAAmB,EAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACnC,IAAI,EACJ,YAAY,EACZ,aAAoB,EACpB,WAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,cAAwC,EACxC,gBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,KAAkB,EAClB,cAA4C,EAC5C,cAAyC,EACzC,oBAAoB,EACpB,aAAa,EACb,kBAAkB,GACrB,EAAE,QAAQ,CAAC,mBAAmB,CAAC,+BAyC/B"}
|
|
@@ -20,6 +20,6 @@ import RequiredNodeCard from './inspector/RequiredNodeCard.js';
|
|
|
20
20
|
import { EDITOR_EMPTY_STATE, EDITOR_MUTED, joinClasses } from '../ui/editorClasses.js';
|
|
21
21
|
import { DEFAULT_OUTCOME_OPTIONS, DEFAULT_TYPE_HELPER_TEXT, } from './inspector/types.js';
|
|
22
22
|
export { DEFAULT_OUTCOME_OPTIONS, } from './inspector/types.js';
|
|
23
|
-
export default function InspectorPanel({ tree, selectedNode, focusChoiceId = null, isPublished = false, onUpdateSelectedNode, onAddChoice, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, outcomeOptions = DEFAULT_OUTCOME_OPTIONS, hideOutcomeField = false, renderPromptField, renderExtraNodeFields, renderExtraChoiceFields, choiceTypes, onSetChoiceType, title = 'Required', emptyStateText = 'Select a node to edit it.', typeHelperText = DEFAULT_TYPE_HELPER_TEXT, onDeleteSelectedNode, onFocusChoice, }) {
|
|
24
|
-
return (_jsx("div", { children: selectedNode ? (_jsxs(_Fragment, { children: [_jsx(RequiredNodeCard, { tree: tree, selectedNode: selectedNode, isPublished: isPublished, title: title, typeHelperText: typeHelperText, onUpdateSelectedNode: onUpdateSelectedNode, onDeleteSelectedNode: onDeleteSelectedNode, renderPromptField: renderPromptField, renderExtraNodeFields: renderExtraNodeFields }), _jsx(ChoiceEditorList, { tree: tree, selectedNode: selectedNode, focusChoiceId: focusChoiceId, isPublished: isPublished, onAddChoice: onAddChoice, onUpdateSelectedNode: onUpdateSelectedNode, onDeleteChoice: onDeleteChoice, onMoveChoice: onMoveChoice, onSetChoiceTarget: onSetChoiceTarget, onSetChoiceOutcome: onSetChoiceOutcome, outcomeOptions: outcomeOptions, hideOutcomeField: hideOutcomeField, renderExtraChoiceFields: renderExtraChoiceFields, choiceTypes: choiceTypes, onSetChoiceType: onSetChoiceType, onFocusChoice: onFocusChoice })] })) : (_jsx("div", { className: joinClasses(EDITOR_MUTED, EDITOR_EMPTY_STATE), children: _jsx("em", { children: emptyStateText }) })) }));
|
|
23
|
+
export default function InspectorPanel({ tree, selectedNode, focusChoiceId = null, isPublished = false, onUpdateSelectedNode, onAddChoice, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, outcomeOptions = DEFAULT_OUTCOME_OPTIONS, hideOutcomeField = false, renderPromptField, renderExtraNodeFields, renderExtraChoiceFields, choiceTypes, onSetChoiceType, title = 'Required', emptyStateText = 'Select a node to edit it.', typeHelperText = DEFAULT_TYPE_HELPER_TEXT, onDeleteSelectedNode, onFocusChoice, collapsibleChoices, }) {
|
|
24
|
+
return (_jsx("div", { children: selectedNode ? (_jsxs(_Fragment, { children: [_jsx(RequiredNodeCard, { tree: tree, selectedNode: selectedNode, isPublished: isPublished, title: title, typeHelperText: typeHelperText, onUpdateSelectedNode: onUpdateSelectedNode, onDeleteSelectedNode: onDeleteSelectedNode, renderPromptField: renderPromptField, renderExtraNodeFields: renderExtraNodeFields }), _jsx(ChoiceEditorList, { tree: tree, selectedNode: selectedNode, focusChoiceId: focusChoiceId, isPublished: isPublished, onAddChoice: onAddChoice, onUpdateSelectedNode: onUpdateSelectedNode, onDeleteChoice: onDeleteChoice, onMoveChoice: onMoveChoice, onSetChoiceTarget: onSetChoiceTarget, onSetChoiceOutcome: onSetChoiceOutcome, outcomeOptions: outcomeOptions, hideOutcomeField: hideOutcomeField, renderExtraChoiceFields: renderExtraChoiceFields, choiceTypes: choiceTypes, onSetChoiceType: onSetChoiceType, onFocusChoice: onFocusChoice, collapsibleChoices: collapsibleChoices })] })) : (_jsx("div", { className: joinClasses(EDITOR_MUTED, EDITOR_EMPTY_STATE), children: _jsx("em", { children: emptyStateText }) })) }));
|
|
25
25
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type EditorChoice, type EditorNode, type EditorTree } from '@signalsafe/tree-spec-editor-core';
|
|
3
3
|
import type { ChoiceTypeOption, InspectorChoiceRenderContext } from './types.js';
|
|
4
|
-
export default function ChoiceEditorCard({ choice, tree, selectedNode, focusChoiceId, isPublished, canMoveUp, canMoveDown, usedChoiceTypeIds, onUpdateSelectedNode, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, onSetChoiceType, choiceTypes, outcomeOptions, hideOutcomeField, renderExtraChoiceFields, onFocusChoice, }: Readonly<{
|
|
4
|
+
export default function ChoiceEditorCard({ choice, tree, selectedNode, focusChoiceId, isPublished, canMoveUp, canMoveDown, usedChoiceTypeIds, onUpdateSelectedNode, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, onSetChoiceType, choiceTypes, outcomeOptions, hideOutcomeField, renderExtraChoiceFields, onFocusChoice, collapsible, expanded, onToggleExpanded, }: Readonly<{
|
|
5
5
|
choice: EditorChoice;
|
|
6
6
|
tree: EditorTree;
|
|
7
7
|
selectedNode: EditorNode;
|
|
@@ -24,5 +24,8 @@ export default function ChoiceEditorCard({ choice, tree, selectedNode, focusChoi
|
|
|
24
24
|
hideOutcomeField: boolean;
|
|
25
25
|
renderExtraChoiceFields?: (ctx: InspectorChoiceRenderContext) => ReactNode;
|
|
26
26
|
onFocusChoice?: (choiceId: string) => void;
|
|
27
|
+
collapsible?: boolean;
|
|
28
|
+
expanded?: boolean;
|
|
29
|
+
onToggleExpanded?: () => void;
|
|
27
30
|
}>): import("react").JSX.Element;
|
|
28
31
|
//# sourceMappingURL=ChoiceEditorCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceEditorCard.d.ts","sourceRoot":"","sources":["../../../src/panels/inspector/ChoiceEditorCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAGH,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,UAAU,EAClB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"ChoiceEditorCard.d.ts","sourceRoot":"","sources":["../../../src/panels/inspector/ChoiceEditorCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAGH,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,UAAU,EAClB,MAAM,mCAAmC,CAAC;AA4B3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM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C9C,cAAc,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,gBAAgB,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,CAAC,GAAG,EAAE,4BAA4B,KAAK,SAAS,CAAC;IAC3E,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC,CAAC,+BA4LD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { END_NODE_ID, getTransition, } from '@signalsafe/tree-spec-editor-core';
|
|
3
3
|
import { LIST_SELECTION_CLASS, LIST_SELECTION_TEXT_CLASS } from '../../lib/selectionStyles.js';
|
|
4
|
-
import { EDITOR_CHOICE_INSPECTOR_ACTIONS, EDITOR_CHOICE_INSPECTOR_HEADER, EDITOR_FLEX_BETWEEN, EDITOR_FLEX_FILL, EDITOR_FLEX_GROW_1, EDITOR_FLEX_ROW, EDITOR_LIST_ITEM, EDITOR_LIST_ITEM_CHOICE_INSPECTOR, EDITOR_MIN_W_0, EDITOR_SPACING_MB_0, EDITOR_SPACING_MB_1, EDITOR_SPACING_MB_2, EDITOR_SPACING_MT_0, EDITOR_SPACING_MT_2, joinClasses, } from '../../ui/editorClasses.js';
|
|
4
|
+
import { EDITOR_CHOICE_INSPECTOR_ACTIONS, EDITOR_CHOICE_TOGGLE, EDITOR_CHOICE_INSPECTOR_HEADER, EDITOR_FLEX_BETWEEN, EDITOR_FLEX_FILL, EDITOR_FLEX_GROW_1, EDITOR_FLEX_ROW, EDITOR_LIST_ITEM, EDITOR_LIST_ITEM_CHOICE_INSPECTOR, EDITOR_MIN_W_0, EDITOR_SPACING_MB_0, EDITOR_SPACING_MB_1, EDITOR_SPACING_MB_2, EDITOR_SPACING_MT_0, EDITOR_SPACING_MT_2, joinClasses, } from '../../ui/editorClasses.js';
|
|
5
5
|
import { EditorField, EditorInput, EditorLabel, EditorSelect, } from '../../ui/primitives.js';
|
|
6
6
|
import { choiceActionIconProps } from './choiceActionIconProps.js';
|
|
7
|
-
export default function ChoiceEditorCard({ choice, tree, selectedNode, focusChoiceId, isPublished, canMoveUp, canMoveDown, usedChoiceTypeIds, onUpdateSelectedNode, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, onSetChoiceType, choiceTypes, outcomeOptions, hideOutcomeField, renderExtraChoiceFields, onFocusChoice, }) {
|
|
7
|
+
export default function ChoiceEditorCard({ choice, tree, selectedNode, focusChoiceId, isPublished, canMoveUp, canMoveDown, usedChoiceTypeIds, onUpdateSelectedNode, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, onSetChoiceType, choiceTypes, outcomeOptions, hideOutcomeField, renderExtraChoiceFields, onFocusChoice, collapsible = false, expanded = true, onToggleExpanded, }) {
|
|
8
8
|
const transition = getTransition(tree, selectedNode.id, choice.id);
|
|
9
9
|
const targetNodeId = transition?.toNodeId ?? '';
|
|
10
10
|
const outcomeValue = transition?.outcome ?? outcomeOptions[0]?.value ?? '';
|
|
@@ -13,7 +13,8 @@ export default function ChoiceEditorCard({ choice, tree, selectedNode, focusChoi
|
|
|
13
13
|
const knownTypeIds = new Set((choiceTypes ?? []).map((type) => type.id));
|
|
14
14
|
const showTypeSelect = Boolean(choiceTypes?.length && onSetChoiceType);
|
|
15
15
|
const isCustomType = showTypeSelect && !knownTypeIds.has(choice.id);
|
|
16
|
-
|
|
16
|
+
const bodyId = `choice-editor-body-${selectedNode.id}-${choice.id}`;
|
|
17
|
+
const body = (_jsxs(_Fragment, { children: [_jsxs("div", { className: joinClasses(EDITOR_CHOICE_INSPECTOR_HEADER, EDITOR_FLEX_BETWEEN, EDITOR_SPACING_MB_2), children: [_jsxs("div", { className: joinClasses(EDITOR_FLEX_ROW, EDITOR_FLEX_GROW_1, EDITOR_MIN_W_0, 'graph-editor-flex--gap'), children: [showTypeSelect ? (_jsxs(EditorField, { className: joinClasses(EDITOR_SPACING_MB_0, EDITOR_FLEX_FILL, EDITOR_MIN_W_0), children: [_jsx(EditorLabel, { className: EDITOR_SPACING_MB_1, children: "Type" }), _jsxs(EditorSelect, { value: isCustomType ? '__custom__' : choice.id, disabled: isPublished, "aria-label": `Choice type for ${choice.id}`, onChange: (event) => {
|
|
17
18
|
const nextTypeId = event.target.value;
|
|
18
19
|
if (nextTypeId && nextTypeId !== '__custom__') {
|
|
19
20
|
const type = choiceTypes.find((item) => item.id === nextTypeId);
|
|
@@ -34,4 +35,5 @@ export default function ChoiceEditorCard({ choice, tree, selectedNode, focusChoi
|
|
|
34
35
|
onUpdateNode: onUpdateSelectedNode,
|
|
35
36
|
})
|
|
36
37
|
: null] }));
|
|
38
|
+
return (_jsx("div", { id: `choice-editor-${selectedNode.id}-${choice.id}`, className: joinClasses(EDITOR_LIST_ITEM, EDITOR_LIST_ITEM_CHOICE_INSPECTOR, isFocused && LIST_SELECTION_CLASS, isFocused && LIST_SELECTION_TEXT_CLASS), onFocusCapture: () => onFocusChoice?.(choice.id), children: collapsible ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: EDITOR_CHOICE_TOGGLE, "aria-expanded": expanded, "aria-controls": bodyId, onClick: onToggleExpanded, children: choice.label || choice.id }), _jsx("div", { id: bodyId, hidden: !expanded, children: body })] })) : (body) }));
|
|
37
39
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { EditorNode, EditorTree } from '@signalsafe/tree-spec-editor-core';
|
|
3
3
|
import type { ChoiceTypeOption, InspectorChoiceRenderContext } from './types.js';
|
|
4
|
-
export default function ChoiceEditorList({ tree, selectedNode, focusChoiceId, isPublished, onAddChoice, onUpdateSelectedNode, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, onSetChoiceType, choiceTypes, outcomeOptions, hideOutcomeField, renderExtraChoiceFields, onFocusChoice, }: Readonly<{
|
|
4
|
+
export default function ChoiceEditorList({ tree, selectedNode, focusChoiceId, isPublished, onAddChoice, onUpdateSelectedNode, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, onSetChoiceType, choiceTypes, outcomeOptions, hideOutcomeField, renderExtraChoiceFields, onFocusChoice, collapsibleChoices, }: Readonly<{
|
|
5
5
|
tree: EditorTree;
|
|
6
6
|
selectedNode: EditorNode;
|
|
7
7
|
focusChoiceId: string | null;
|
|
@@ -21,5 +21,6 @@ export default function ChoiceEditorList({ tree, selectedNode, focusChoiceId, is
|
|
|
21
21
|
hideOutcomeField: boolean;
|
|
22
22
|
renderExtraChoiceFields?: (ctx: InspectorChoiceRenderContext) => ReactNode;
|
|
23
23
|
onFocusChoice?: (choiceId: string) => void;
|
|
24
|
+
collapsibleChoices?: boolean;
|
|
24
25
|
}>): import("react").JSX.Element;
|
|
25
26
|
//# sourceMappingURL=ChoiceEditorList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceEditorList.d.ts","sourceRoot":"","sources":["../../../src/panels/inspector/ChoiceEditorList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAwBhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAEjF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACrC,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,kBA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AM,KAAK,IAAI,CAAC;IAChE,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpF,WAAW,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC9C,cAAc,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,gBAAgB,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,CAAC,GAAG,EAAE,4BAA4B,KAAK,SAAS,CAAC;IAC3E,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC,+BAgFD"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
3
|
import PanelHeaderCollapseCarets from '../../lib/PanelHeaderCollapseCarets.js';
|
|
4
4
|
import { EDITOR_CARD, EDITOR_CARD_BODY, EDITOR_CARD_HEADER, EDITOR_FLEX_BETWEEN, EDITOR_FLEX_ROW, EDITOR_FLEX_SHRINK_0, EDITOR_HIDDEN, EDITOR_BTN_PANEL_ADD_CHOICE, EDITOR_EMPTY_STATE, EDITOR_LIST, EDITOR_MIN_W_0, EDITOR_MUTED, EDITOR_SCROLL, EDITOR_SPACING_MT_3, EDITOR_SPACING_PX_3, EDITOR_SPACING_PY_3, joinClasses, } from '../../ui/editorClasses.js';
|
|
5
5
|
import { EditorIconButton } from '../../ui/primitives.js';
|
|
6
6
|
import ChoiceEditorCard from './ChoiceEditorCard.js';
|
|
7
|
-
export default function ChoiceEditorList({ tree, selectedNode, focusChoiceId, isPublished, onAddChoice, onUpdateSelectedNode, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, onSetChoiceType, choiceTypes, outcomeOptions, hideOutcomeField, renderExtraChoiceFields, onFocusChoice, }) {
|
|
7
|
+
export default function ChoiceEditorList({ tree, selectedNode, focusChoiceId, isPublished, onAddChoice, onUpdateSelectedNode, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, onSetChoiceType, choiceTypes, outcomeOptions, hideOutcomeField, renderExtraChoiceFields, onFocusChoice, collapsibleChoices = false, }) {
|
|
8
8
|
const choices = selectedNode.choices ?? [];
|
|
9
9
|
const [choicesExpanded, setChoicesExpanded] = useState(true);
|
|
10
10
|
const usedChoiceTypeIds = new Set(choices.map((choice) => choice.id));
|
|
11
|
-
|
|
11
|
+
const [expandedChoiceId, setExpandedChoiceId] = useState(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setExpandedChoiceId(null);
|
|
14
|
+
}, [selectedNode.id]);
|
|
15
|
+
return (_jsxs("div", { className: joinClasses(EDITOR_CARD, EDITOR_SPACING_MT_3), children: [_jsxs("div", { className: joinClasses(EDITOR_CARD_HEADER, EDITOR_FLEX_BETWEEN), children: [_jsxs("div", { className: joinClasses(EDITOR_FLEX_ROW, EDITOR_MIN_W_0), children: [_jsx("span", { className: "graph-editor-text--semibold", children: "Choices" }), _jsx(PanelHeaderCollapseCarets, { expanded: choicesExpanded, onToggle: () => setChoicesExpanded((v) => !v) })] }), _jsx("div", { className: joinClasses(EDITOR_FLEX_ROW, EDITOR_FLEX_SHRINK_0), children: _jsx(EditorIconButton, { className: joinClasses(EDITOR_FLEX_SHRINK_0, EDITOR_BTN_PANEL_ADD_CHOICE, isPublished ? 'graph-editor-btn--disabled' : 'graph-editor-btn--primary'), "aria-label": "Add choice", title: "Add choice", disabled: isPublished, onClick: onAddChoice, children: "+" }) })] }), _jsx("div", { className: joinClasses(EDITOR_CARD_BODY, 'graph-editor-card__body--flush', !choicesExpanded && EDITOR_HIDDEN), "aria-hidden": !choicesExpanded, children: choices.length === 0 ? (_jsx("div", { className: joinClasses(EDITOR_MUTED, EDITOR_EMPTY_STATE, 'graph-editor-text--sm', EDITOR_SPACING_PY_3, EDITOR_SPACING_PX_3), children: _jsx("em", { children: "No choices" }) })) : (_jsx("div", { className: joinClasses(EDITOR_LIST, EDITOR_SCROLL, 'overflow-auto-max-h-320'), children: choices.map((choice, index) => (_jsx(ChoiceEditorCard, { choice: choice, tree: tree, selectedNode: selectedNode, focusChoiceId: focusChoiceId, isPublished: isPublished, canMoveUp: index > 0, canMoveDown: index < choices.length - 1, usedChoiceTypeIds: usedChoiceTypeIds, onUpdateSelectedNode: onUpdateSelectedNode, onDeleteChoice: onDeleteChoice, onMoveChoice: onMoveChoice, onSetChoiceTarget: onSetChoiceTarget, onSetChoiceOutcome: onSetChoiceOutcome, onSetChoiceType: onSetChoiceType, choiceTypes: choiceTypes, outcomeOptions: outcomeOptions, hideOutcomeField: hideOutcomeField, renderExtraChoiceFields: renderExtraChoiceFields, onFocusChoice: onFocusChoice, collapsible: collapsibleChoices, expanded: expandedChoiceId === choice.id, onToggleExpanded: () => setExpandedChoiceId((current) => (current === choice.id ? null : choice.id)) }, choice.id))) })) })] }));
|
|
12
16
|
}
|
|
@@ -61,6 +61,11 @@ export interface InspectorPanelProps {
|
|
|
61
61
|
renderExtraNodeFields?: (ctx: InspectorNodeRenderContext) => ReactNode;
|
|
62
62
|
/** Render extra UI below each choice card (after Next/Outcome). */
|
|
63
63
|
renderExtraChoiceFields?: (ctx: InspectorChoiceRenderContext) => ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* Render each choice as a collapsible card with a label toggle; at most one is open
|
|
66
|
+
* at a time and all start collapsed when the selected node changes. Defaults to always expanded.
|
|
67
|
+
*/
|
|
68
|
+
collapsibleChoices?: boolean;
|
|
64
69
|
/** Host-defined choice types (stable ids) for the Type selector on each choice. */
|
|
65
70
|
choiceTypes?: ReadonlyArray<ChoiceTypeOption>;
|
|
66
71
|
onSetChoiceType?: (choiceId: string, typeId: string, defaultLabel?: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/panels/inspector/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EACR,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,UAAU,EACb,MAAM,mCAAmC,CAAC;AAE3C,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAInF,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,4BAA4B;IACzC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACzC,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,4EAA4E;IAC5E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C,CAAC;IAC9C,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpF;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAElC,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,wBAAwB,sFACkD,CAAC"}
|
|
@@ -26,6 +26,7 @@ export declare const EDITOR_LIST_ITEM_WITH_DELETE = "graph-editor-list__item--wi
|
|
|
26
26
|
export declare const EDITOR_LIST_ITEM_CHOICE_INSPECTOR = "graph-editor-list__item--choice-inspector";
|
|
27
27
|
export declare const EDITOR_CHOICE_INSPECTOR_HEADER = "graph-editor-choice-inspector-header";
|
|
28
28
|
export declare const EDITOR_CHOICE_INSPECTOR_ACTIONS = "graph-editor-choice-inspector-actions";
|
|
29
|
+
export declare const EDITOR_CHOICE_TOGGLE = "graph-editor-choice-toggle";
|
|
29
30
|
export declare const EDITOR_BADGE = "graph-editor-badge";
|
|
30
31
|
export declare const EDITOR_MODAL = "graph-editor-modal";
|
|
31
32
|
export declare const EDITOR_MODAL_DIALOG = "graph-editor-modal__dialog";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorClasses.d.ts","sourceRoot":"","sources":["../../src/ui/editorClasses.ts"],"names":[],"mappings":"AAAA,wFAAwF;AAExF,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAC/C,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAC9D,eAAO,MAAM,gBAAgB,4BAA4B,CAAC;AAC1D,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAC/C,eAAO,MAAM,gBAAg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C;AAChE,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAC9D,eAAO,MAAM,YAAY,uBAAuB,CAAC;AACjD,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAC/C,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,aAAa,wBAAwB,CAAC;AAEnD,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAG7D;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAEpE;AAgBD,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,MAAM,CAEtF"}
|
package/dist/ui/editorClasses.js
CHANGED
|
@@ -26,6 +26,7 @@ export const EDITOR_LIST_ITEM_WITH_DELETE = 'graph-editor-list__item--with-delet
|
|
|
26
26
|
export const EDITOR_LIST_ITEM_CHOICE_INSPECTOR = 'graph-editor-list__item--choice-inspector';
|
|
27
27
|
export const EDITOR_CHOICE_INSPECTOR_HEADER = 'graph-editor-choice-inspector-header';
|
|
28
28
|
export const EDITOR_CHOICE_INSPECTOR_ACTIONS = 'graph-editor-choice-inspector-actions';
|
|
29
|
+
export const EDITOR_CHOICE_TOGGLE = 'graph-editor-choice-toggle';
|
|
29
30
|
export const EDITOR_BADGE = 'graph-editor-badge';
|
|
30
31
|
export const EDITOR_MODAL = 'graph-editor-modal';
|
|
31
32
|
export const EDITOR_MODAL_DIALOG = 'graph-editor-modal__dialog';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalsafe/tree-spec-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "UI-kit agnostic TreeSpec graph editor shell (React Flow canvas, panels, modals, toolbar).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"test:monorepo": "cd ../../frontend && yarn vitest run --config vitest.tree-spec-editor.config.ts"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@signalsafe/tree-spec": "^0.
|
|
69
|
-
"@signalsafe/tree-spec-editor-core": "^0.2.
|
|
70
|
-
"@signalsafe/tree-spec-editor-react": "^0.3.
|
|
68
|
+
"@signalsafe/tree-spec": "^0.4.1",
|
|
69
|
+
"@signalsafe/tree-spec-editor-core": "^0.2.2",
|
|
70
|
+
"@signalsafe/tree-spec-editor-react": "^0.3.2"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": "^18.0.0",
|