@signalsafe/tree-spec-editor 0.2.2 → 0.3.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 +132 -33
- package/dist/index.d.ts +39 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -26
- package/dist/lib/PanelHeaderCollapseCarets.d.ts.map +1 -1
- package/dist/lib/PanelHeaderCollapseCarets.js +2 -1
- package/dist/lib/panelHelpers.d.ts +8 -1
- package/dist/lib/panelHelpers.d.ts.map +1 -1
- package/dist/lib/panelHelpers.js +14 -6
- package/dist/lib/panelNodeLink.d.ts.map +1 -1
- package/dist/lib/panelNodeLink.js +2 -1
- package/dist/lib/selectionStyles.d.ts +6 -6
- package/dist/lib/selectionStyles.d.ts.map +1 -1
- package/dist/lib/selectionStyles.js +6 -6
- package/dist/modals/AuditLogModal.d.ts +0 -6
- package/dist/modals/AuditLogModal.d.ts.map +1 -1
- package/dist/modals/AuditLogModal.js +6 -5
- package/dist/modals/DraftHistoryModal.d.ts +0 -10
- package/dist/modals/DraftHistoryModal.d.ts.map +1 -1
- package/dist/modals/DraftHistoryModal.js +6 -5
- package/dist/modals/PublishReviewModal.d.ts.map +1 -1
- package/dist/modals/PublishReviewModal.js +3 -2
- package/dist/panels/AdvancedJsonPanel.d.ts +1 -1
- package/dist/panels/AdvancedJsonPanel.d.ts.map +1 -1
- package/dist/panels/AdvancedJsonPanel.js +4 -4
- package/dist/panels/AppearancePanel.d.ts +1 -1
- package/dist/panels/AppearancePanel.d.ts.map +1 -1
- package/dist/panels/AppearancePanel.js +9 -11
- package/dist/panels/ChoiceEdgeAppearanceFields.d.ts.map +1 -1
- package/dist/panels/ChoiceEdgeAppearanceFields.js +4 -3
- package/dist/panels/ChoiceTemplatesPanel.d.ts.map +1 -1
- package/dist/panels/ChoiceTemplatesPanel.js +4 -3
- package/dist/panels/GraphEditorInfoPanel.d.ts.map +1 -1
- package/dist/panels/GraphEditorInfoPanel.js +6 -5
- package/dist/panels/InspectorPanel.d.ts +2 -2
- package/dist/panels/InspectorPanel.d.ts.map +1 -1
- package/dist/panels/InspectorPanel.js +5 -5
- package/dist/panels/IssuesPanel.d.ts.map +1 -1
- package/dist/panels/IssuesPanel.js +7 -8
- package/dist/panels/NodesPanel.d.ts.map +1 -1
- package/dist/panels/NodesPanel.js +9 -8
- package/dist/panels/SelectedEdgePanel.d.ts +2 -2
- package/dist/panels/SelectedEdgePanel.d.ts.map +1 -1
- package/dist/panels/SelectedEdgePanel.js +4 -3
- package/dist/panels/ToolbarPanel.d.ts +6 -18
- package/dist/panels/ToolbarPanel.d.ts.map +1 -1
- package/dist/panels/ToolbarPanel.js +10 -24
- package/dist/panels/inspector/ChoiceEditorCard.d.ts +1 -1
- package/dist/panels/inspector/ChoiceEditorCard.d.ts.map +1 -1
- package/dist/panels/inspector/ChoiceEditorCard.js +7 -6
- package/dist/panels/inspector/ChoiceEditorList.d.ts +1 -1
- package/dist/panels/inspector/ChoiceEditorList.d.ts.map +1 -1
- package/dist/panels/inspector/ChoiceEditorList.js +5 -3
- package/dist/panels/inspector/NodeTypeField.d.ts.map +1 -1
- package/dist/panels/inspector/NodeTypeField.js +4 -3
- package/dist/panels/inspector/RequiredNodeCard.d.ts +1 -1
- package/dist/panels/inspector/RequiredNodeCard.d.ts.map +1 -1
- package/dist/panels/inspector/RequiredNodeCard.js +5 -4
- package/dist/panels/inspector/choiceActionIconProps.d.ts +3 -2
- package/dist/panels/inspector/choiceActionIconProps.d.ts.map +1 -1
- package/dist/panels/inspector/choiceActionIconProps.js +4 -2
- package/dist/ui/editorClasses.d.ts +66 -0
- package/dist/ui/editorClasses.d.ts.map +1 -0
- package/dist/ui/editorClasses.js +89 -0
- package/dist/ui/primitives.d.ts +23 -0
- package/dist/ui/primitives.d.ts.map +1 -0
- package/dist/ui/primitives.js +32 -0
- package/docs/UI_KIT_AGNOSTIC_REFACTOR.md +186 -0
- package/docs/UI_KIT_AGNOSTIC_USAGE.md +129 -0
- package/package.json +11 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export const LIST_SELECTION_CLASS = '
|
|
3
|
-
/**
|
|
4
|
-
export const LIST_SELECTION_TEXT_CLASS = 'graph-editor-
|
|
1
|
+
/** List row selection highlight (sidebar Nodes / Issues). */
|
|
2
|
+
export const LIST_SELECTION_CLASS = 'graph-editor-list__item--selected';
|
|
3
|
+
/** Readable text on selected sidebar rows. */
|
|
4
|
+
export const LIST_SELECTION_TEXT_CLASS = 'graph-editor-list__item-text--selected';
|
|
5
5
|
/** Canvas / card selection highlight matching list selection. */
|
|
6
|
-
export const CANVAS_SELECTION_CLASS = '
|
|
7
|
-
/**
|
|
6
|
+
export const CANVAS_SELECTION_CLASS = 'graph-editor-canvas__selected';
|
|
7
|
+
/** Readable text on selected canvas nodes. */
|
|
8
8
|
export const CANVAS_SELECTION_TEXT_CLASS = 'graph-editor-canvas-selected';
|
|
@@ -4,17 +4,11 @@ export interface AuditLogModalProps {
|
|
|
4
4
|
loadingAudit: boolean;
|
|
5
5
|
auditEvents: TreeSpecAuditEventItem[];
|
|
6
6
|
onClose: () => void;
|
|
7
|
-
/** Override the modal title (default "Audit log"). */
|
|
8
7
|
title?: string;
|
|
9
|
-
/** Override the muted subtitle below the title. */
|
|
10
8
|
subtitle?: string;
|
|
11
|
-
/** Override the loading state text. */
|
|
12
9
|
loadingText?: string;
|
|
13
|
-
/** Override the empty-state text (when there are zero events). */
|
|
14
10
|
emptyStateText?: string;
|
|
15
|
-
/** Override the "Actor ID:" label prefix shown for events that have an actor. */
|
|
16
11
|
actorLabel?: string;
|
|
17
|
-
/** Override the Close button label in the footer. */
|
|
18
12
|
closeLabel?: string;
|
|
19
13
|
}
|
|
20
14
|
export default function AuditLogModal({ show, loadingAudit, auditEvents, onClose, title, subtitle, loadingText, emptyStateText, actorLabel, closeLabel, }: Readonly<AuditLogModalProps>): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLogModal.d.ts","sourceRoot":"","sources":["../../src/modals/AuditLogModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuditLogModal.d.ts","sourceRoot":"","sources":["../../src/modals/AuditLogModal.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAqBhF,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AASD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAClC,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,OAAO,EACP,KAAqB,EACrB,QAA2B,EAC3B,WAAkC,EAClC,cAAyC,EACzC,UAAgC,EAChC,UAAgC,GACnC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,sCA8D9B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { EDITOR_BADGE, EDITOR_FLEX_BETWEEN, EDITOR_MODAL, EDITOR_MODAL_BODY, EDITOR_MODAL_CONTENT, EDITOR_MODAL_DIALOG, EDITOR_MODAL_FOOTER, EDITOR_MODAL_HEADER, EDITOR_MODAL_TITLE, EDITOR_MONO, EDITOR_MUTED, EDITOR_SCROLL, EDITOR_SPACING_MB_0, EDITOR_SPACING_MT_1, joinClasses, } from '../ui/editorClasses.js';
|
|
3
|
+
import { EditorButton, EditorCloseButton } from '../ui/primitives.js';
|
|
3
4
|
const DEFAULT_TITLE = 'Audit log';
|
|
4
5
|
const DEFAULT_SUBTITLE = 'Authoring actions for this tree_spec version.';
|
|
5
6
|
const DEFAULT_LOADING_TEXT = 'Loading…';
|
|
@@ -11,13 +12,13 @@ export default function AuditLogModal({ show, loadingAudit, auditEvents, onClose
|
|
|
11
12
|
return null;
|
|
12
13
|
let auditContent;
|
|
13
14
|
if (loadingAudit) {
|
|
14
|
-
auditContent = _jsx("div", { className:
|
|
15
|
+
auditContent = _jsx("div", { className: EDITOR_MUTED, children: loadingText });
|
|
15
16
|
}
|
|
16
17
|
else if (auditEvents.length === 0) {
|
|
17
|
-
auditContent = (_jsx("div", { className:
|
|
18
|
+
auditContent = (_jsx("div", { className: EDITOR_MUTED, children: _jsx("em", { children: emptyStateText }) }));
|
|
18
19
|
}
|
|
19
20
|
else {
|
|
20
|
-
auditContent = (_jsx("ul", { className:
|
|
21
|
+
auditContent = (_jsx("ul", { className: joinClasses('graph-editor-list--plain', EDITOR_SCROLL, EDITOR_SPACING_MB_0), children: auditEvents.map((e) => (_jsxs("li", { className: "graph-editor-list__plain-item", children: [_jsxs("div", { className: EDITOR_FLEX_BETWEEN, children: [_jsx("span", { className: joinClasses(EDITOR_BADGE, 'graph-editor-badge--neutral'), children: e.action }), _jsx("span", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm'), children: new Date(e.created_on).toLocaleString() })] }), e.actor == null ? null : (_jsxs("span", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm'), children: [actorLabel, " ", e.actor] })), e.detail && Object.keys(e.detail).length > 0 ? (_jsx("pre", { className: joinClasses(EDITOR_MONO, EDITOR_MUTED, 'graph-editor-text--sm', EDITOR_SPACING_MB_0, EDITOR_SPACING_MT_1), children: JSON.stringify(e.detail) })) : null] }, e.id))) }));
|
|
21
22
|
}
|
|
22
|
-
return (_jsx("dialog", { className:
|
|
23
|
+
return (_jsx("dialog", { className: joinClasses(EDITOR_MODAL, 'graph-editor-modal--open'), open: true, children: _jsx("div", { className: joinClasses(EDITOR_MODAL_DIALOG, 'graph-editor-modal__dialog--lg'), children: _jsxs("div", { className: EDITOR_MODAL_CONTENT, children: [_jsxs("div", { className: EDITOR_MODAL_HEADER, children: [_jsx("h2", { className: EDITOR_MODAL_TITLE, children: title }), _jsx(EditorCloseButton, { onClick: onClose })] }), _jsxs("div", { className: EDITOR_MODAL_BODY, children: [_jsx("p", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm'), children: subtitle }), auditContent] }), _jsx("div", { className: EDITOR_MODAL_FOOTER, children: _jsx(EditorButton, { tone: "neutral", onClick: onClose, children: closeLabel }) })] }) }) }));
|
|
23
24
|
}
|
|
@@ -9,25 +9,15 @@ export interface DraftHistoryModalProps {
|
|
|
9
9
|
onClose: () => void;
|
|
10
10
|
onCreateSnapshot: () => void;
|
|
11
11
|
onRestoreSnapshot: (snapshotId: string) => void;
|
|
12
|
-
/** Override the modal title (default "Draft history"). */
|
|
13
12
|
title?: string;
|
|
14
|
-
/** Override the muted subtitle below the title. */
|
|
15
13
|
subtitle?: string;
|
|
16
|
-
/** Override the "Snapshots (newest first)" caption above the list. */
|
|
17
14
|
listCaption?: string;
|
|
18
|
-
/** Override the "Create snapshot" button label. */
|
|
19
15
|
createSnapshotLabel?: string;
|
|
20
|
-
/** Override the "Creating\u2026" label while a create is in flight. */
|
|
21
16
|
creatingSnapshotLabel?: string;
|
|
22
|
-
/** Override the "Restore" button label. */
|
|
23
17
|
restoreLabel?: string;
|
|
24
|
-
/** Override the "Restoring\u2026" button label while a restore is in flight. */
|
|
25
18
|
restoringLabel?: string;
|
|
26
|
-
/** Override the loading state text. */
|
|
27
19
|
loadingText?: string;
|
|
28
|
-
/** Override the empty-state text (when there are zero snapshots). */
|
|
29
20
|
emptyStateText?: string;
|
|
30
|
-
/** Override the Close button label in the footer. */
|
|
31
21
|
closeLabel?: string;
|
|
32
22
|
}
|
|
33
23
|
export default function DraftHistoryModal({ show, loadingSnapshots, snapshots, restoringSnapshotId, creatingSnapshot, tree, onClose, onCreateSnapshot, onRestoreSnapshot, title, subtitle, listCaption, createSnapshotLabel, creatingSnapshotLabel, restoreLabel, restoringLabel, loadingText, emptyStateText, closeLabel, }: Readonly<DraftHistoryModalProps>): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraftHistoryModal.d.ts","sourceRoot":"","sources":["../../src/modals/DraftHistoryModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DraftHistoryModal.d.ts","sourceRoot":"","sources":["../../src/modals/DraftHistoryModal.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAmB1F,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,oBAAoB,EAAE,CAAC;IAClC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,iBAAiB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAcD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACtC,IAAI,EACJ,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,IAAI,EACJ,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,KAAqB,EACrB,QAA2B,EAC3B,WAAkC,EAClC,mBAA0C,EAC1C,qBAA8C,EAC9C,YAAoC,EACpC,cAAwC,EACxC,WAAkC,EAClC,cAAyC,EACzC,UAAgC,GACnC,EAAE,QAAQ,CAAC,sBAAsB,CAAC,sCAsElC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { EDITOR_FLEX_BETWEEN, EDITOR_MODAL, EDITOR_MODAL_BODY, EDITOR_MODAL_CONTENT, EDITOR_MODAL_DIALOG, EDITOR_MODAL_FOOTER, EDITOR_MODAL_HEADER, EDITOR_MODAL_TITLE, EDITOR_MUTED, EDITOR_SCROLL, EDITOR_SPACING_MB_0, EDITOR_SPACING_MB_3, joinClasses, } from '../ui/editorClasses.js';
|
|
3
|
+
import { EditorButton, EditorCloseButton } from '../ui/primitives.js';
|
|
3
4
|
const DEFAULT_TITLE = 'Draft history';
|
|
4
5
|
const DEFAULT_SUBTITLE = 'Restore an earlier snapshot into the current draft. Creating a snapshot saves the current graph state.';
|
|
5
6
|
const DEFAULT_LIST_CAPTION = 'Snapshots (newest first)';
|
|
@@ -15,13 +16,13 @@ export default function DraftHistoryModal({ show, loadingSnapshots, snapshots, r
|
|
|
15
16
|
return null;
|
|
16
17
|
let snapshotsContent;
|
|
17
18
|
if (loadingSnapshots) {
|
|
18
|
-
snapshotsContent = _jsx("div", { className:
|
|
19
|
+
snapshotsContent = _jsx("div", { className: EDITOR_MUTED, children: loadingText });
|
|
19
20
|
}
|
|
20
21
|
else if (snapshots.length === 0) {
|
|
21
|
-
snapshotsContent = (_jsx("div", { className:
|
|
22
|
+
snapshotsContent = (_jsx("div", { className: EDITOR_MUTED, children: _jsx("em", { children: emptyStateText }) }));
|
|
22
23
|
}
|
|
23
24
|
else {
|
|
24
|
-
snapshotsContent = (_jsx("ul", { className:
|
|
25
|
+
snapshotsContent = (_jsx("ul", { className: joinClasses('graph-editor-list--plain', EDITOR_SCROLL, EDITOR_SPACING_MB_0), children: snapshots.map((s) => (_jsxs("li", { className: joinClasses(EDITOR_FLEX_BETWEEN, 'graph-editor-list__plain-item'), children: [_jsxs("div", { children: [_jsx("span", { className: EDITOR_MUTED, children: new Date(s.created_on).toLocaleString() }), s.label ? _jsx("span", { className: "graph-editor-inline-gap", children: s.label }) : null, s.spec_hash ? (_jsxs("span", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm'), children: [s.spec_hash.slice(0, 8), "\u2026"] })) : null] }), _jsx(EditorButton, { tone: "warning", onClick: () => onRestoreSnapshot(s.id), disabled: restoringSnapshotId !== null, children: restoringSnapshotId === s.id ? restoringLabel : restoreLabel })] }, s.id))) }));
|
|
25
26
|
}
|
|
26
|
-
return (_jsx("dialog", { className:
|
|
27
|
+
return (_jsx("dialog", { className: joinClasses(EDITOR_MODAL, 'graph-editor-modal--open'), open: true, children: _jsx("div", { className: joinClasses(EDITOR_MODAL_DIALOG, 'graph-editor-modal__dialog--lg'), children: _jsxs("div", { className: EDITOR_MODAL_CONTENT, children: [_jsxs("div", { className: EDITOR_MODAL_HEADER, children: [_jsx("h2", { className: EDITOR_MODAL_TITLE, children: title }), _jsx(EditorCloseButton, { onClick: onClose })] }), _jsxs("div", { className: EDITOR_MODAL_BODY, children: [_jsx("p", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm'), children: subtitle }), _jsxs("div", { className: joinClasses(EDITOR_FLEX_BETWEEN, EDITOR_SPACING_MB_3), children: [_jsx("span", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm'), children: listCaption }), _jsx(EditorButton, { tone: "primary", onClick: onCreateSnapshot, disabled: !tree || creatingSnapshot, children: creatingSnapshot ? creatingSnapshotLabel : createSnapshotLabel })] }), snapshotsContent] }), _jsx("div", { className: EDITOR_MODAL_FOOTER, children: _jsx(EditorButton, { tone: "neutral", onClick: onClose, children: closeLabel }) })] }) }) }));
|
|
27
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublishReviewModal.d.ts","sourceRoot":"","sources":["../../src/modals/PublishReviewModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"PublishReviewModal.d.ts","sourceRoot":"","sources":["../../src/modals/PublishReviewModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAErF,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAexF,MAAM,WAAW,uBAAuB;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,kBAAkB,EAAE,CAChB,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,KAAK,EAAE,UAAU,KAChB;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC;IAE9C,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAUD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACvC,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,KAAqB,EACrB,WAAkC,EAClC,cAAyC,EACzC,WAAkC,EAClC,YAAoC,EACpC,eAA0C,GAC7C,EAAE,QAAQ,CAAC,uBAAuB,CAAC,sCA2CnC"}
|
|
@@ -8,8 +8,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
* host-specific diff logic.
|
|
9
9
|
*/
|
|
10
10
|
import { TREE_SPEC_ISSUE_SEVERITY } from '@signalsafe/tree-spec';
|
|
11
|
-
import { Button, CloseButton } from 'react-bootstrap';
|
|
12
11
|
import { buildStableEntries } from '@signalsafe/tree-spec-editor-core';
|
|
12
|
+
import { EDITOR_MODAL, EDITOR_MODAL_BODY, EDITOR_MODAL_CONTENT, EDITOR_MODAL_DIALOG, EDITOR_MODAL_FOOTER, EDITOR_MODAL_HEADER, EDITOR_MODAL_TITLE, editorAlertToneClass, joinClasses, } from '../ui/editorClasses.js';
|
|
13
|
+
import { EditorButton, EditorCloseButton } from '../ui/primitives.js';
|
|
13
14
|
const DEFAULT_TITLE = 'Review changes before publishing';
|
|
14
15
|
const DEFAULT_SUMMARY_TEXT = 'Publishing is immutable. This summary compares the loaded version spec to your current graph.';
|
|
15
16
|
const DEFAULT_ERROR_ALERT_TEXT = 'Validation errors exist. Fix them before publishing.';
|
|
@@ -21,5 +22,5 @@ export default function PublishReviewModal({ show, tree, baselineTree, issues, p
|
|
|
21
22
|
return null;
|
|
22
23
|
const hasErrors = issues.some((i) => i.severity === TREE_SPEC_ISSUE_SEVERITY.ERROR);
|
|
23
24
|
const diffLineEntries = buildStableEntries(tree ? computeDiffSummary(baselineTree, tree).lines : [], (line) => line);
|
|
24
|
-
return (_jsx("dialog", { className:
|
|
25
|
+
return (_jsx("dialog", { className: joinClasses(EDITOR_MODAL, 'graph-editor-modal--open'), open: true, children: _jsx("div", { className: joinClasses(EDITOR_MODAL_DIALOG, 'graph-editor-modal__dialog--lg'), children: _jsxs("div", { className: EDITOR_MODAL_CONTENT, children: [_jsxs("div", { className: EDITOR_MODAL_HEADER, children: [_jsx("h2", { className: EDITOR_MODAL_TITLE, children: title }), _jsx(EditorCloseButton, { onClick: onClose })] }), _jsxs("div", { className: EDITOR_MODAL_BODY, children: [_jsx("div", { className: editorAlertToneClass('info'), children: summaryText }), _jsx("ul", { children: diffLineEntries.map(({ item: line, key }) => (_jsx("li", { children: line }, key))) }), hasErrors ? (_jsx("div", { className: editorAlertToneClass('danger'), children: errorAlertText })) : null] }), _jsxs("div", { className: EDITOR_MODAL_FOOTER, children: [_jsx(EditorButton, { tone: "neutral", onClick: onClose, children: cancelLabel }), _jsx(EditorButton, { tone: "success", disabled: publishing || hasErrors, onClick: onPublish, children: publishing ? publishingLabel : publishLabel })] })] }) }) }));
|
|
25
26
|
}
|
|
@@ -20,7 +20,7 @@ export interface AdvancedJsonPanelProps {
|
|
|
20
20
|
expandAllLabel?: string;
|
|
21
21
|
/** Optional override for the collapse button label (default "Compress all"). */
|
|
22
22
|
collapseAllLabel?: string;
|
|
23
|
-
/** Optional extra class names applied to the outer
|
|
23
|
+
/** Optional extra class names applied to the outer card element. */
|
|
24
24
|
className?: string;
|
|
25
25
|
}
|
|
26
26
|
export default function AdvancedJsonPanel({ children, title, subtitle, onExpandAll, onCollapseAll, expandAllLabel, collapseAllLabel, className, }: Readonly<AdvancedJsonPanelProps>): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdvancedJsonPanel.d.ts","sourceRoot":"","sources":["../../src/panels/AdvancedJsonPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AdvancedJsonPanel.d.ts","sourceRoot":"","sources":["../../src/panels/AdvancedJsonPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAsBvC,MAAM,WAAW,sBAAsB;IACnC,uEAAuE;IACvE,QAAQ,EAAE,SAAS,CAAC;IACpB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACtC,QAAQ,EACR,KAAqB,EACrB,QAAQ,EACR,WAAW,EACX,aAAa,EACb,cAA6B,EAC7B,gBAAiC,EACjC,SAAS,GACZ,EAAE,QAAQ,CAAC,sBAAsB,CAAC,+BAwClC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import PanelHeaderCollapseCarets from '../lib/PanelHeaderCollapseCarets.js';
|
|
4
|
+
import { EDITOR_CARD, EDITOR_CARD_BODY, EDITOR_CARD_HEADER, EDITOR_FLEX_BETWEEN, EDITOR_FLEX_ROW, EDITOR_FLEX_SHRINK_0, EDITOR_FLEX_WRAP, EDITOR_HIDDEN, EDITOR_MIN_W_0, EDITOR_MUTED, EDITOR_SPACING_MS_AUTO, EDITOR_SPACING_MT_3, joinClasses, } from '../ui/editorClasses.js';
|
|
5
|
+
import { EditorButton } from '../ui/primitives.js';
|
|
5
6
|
const DEFAULT_TITLE = 'Advanced JSON (read-only)';
|
|
6
7
|
export default function AdvancedJsonPanel({ children, title = DEFAULT_TITLE, subtitle, onExpandAll, onCollapseAll, expandAllLabel = 'Expand all', collapseAllLabel = 'Compress all', className, }) {
|
|
7
8
|
const [expanded, setExpanded] = useState(true);
|
|
8
9
|
const hasButtons = Boolean(onExpandAll) || Boolean(onCollapseAll);
|
|
9
|
-
|
|
10
|
-
return (_jsxs("div", { className: cardClassName, children: [_jsxs("div", { className: "card-header d-flex justify-content-between align-items-start gap-2 flex-wrap bg-body-secondary py-2 px-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "d-flex align-items-center flex-wrap gap-1", children: [_jsx("span", { className: "fw-bold", children: title }), _jsx(PanelHeaderCollapseCarets, { expanded: expanded, onToggle: () => setExpanded((v) => !v) })] }), subtitle ? _jsx("div", { className: "text-muted font-size-12", children: subtitle }) : null] }), hasButtons ? (_jsxs("div", { className: "btn-group btn-group-sm flex-shrink-0 ms-auto", children: [onExpandAll ? (_jsx(Button, { type: "button", variant: "outline-secondary", onClick: onExpandAll, children: expandAllLabel })) : null, onCollapseAll ? (_jsx(Button, { type: "button", variant: "outline-secondary", onClick: onCollapseAll, children: collapseAllLabel })) : null] })) : null] }), _jsx("div", { className: `card-body p-0${expanded ? '' : ' d-none'}`, "aria-hidden": !expanded, children: children })] }));
|
|
10
|
+
return (_jsxs("div", { className: joinClasses(EDITOR_CARD, EDITOR_SPACING_MT_3, className), children: [_jsxs("div", { className: joinClasses(EDITOR_CARD_HEADER, EDITOR_FLEX_BETWEEN, EDITOR_FLEX_WRAP), children: [_jsxs("div", { className: EDITOR_MIN_W_0, children: [_jsxs("div", { className: joinClasses(EDITOR_FLEX_ROW, EDITOR_FLEX_WRAP), children: [_jsx("span", { className: "graph-editor-text--bold", children: title }), _jsx(PanelHeaderCollapseCarets, { expanded: expanded, onToggle: () => setExpanded((v) => !v) })] }), subtitle ? _jsx("div", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm'), children: subtitle }) : null] }), hasButtons ? (_jsxs("div", { className: joinClasses(EDITOR_FLEX_ROW, EDITOR_FLEX_SHRINK_0, EDITOR_SPACING_MS_AUTO, 'graph-editor-btn-group'), children: [onExpandAll ? (_jsx(EditorButton, { tone: "neutral", onClick: onExpandAll, children: expandAllLabel })) : null, onCollapseAll ? (_jsx(EditorButton, { tone: "neutral", onClick: onCollapseAll, children: collapseAllLabel })) : null] })) : null] }), _jsx("div", { className: joinClasses(EDITOR_CARD_BODY, 'graph-editor-card__body--flush', !expanded && EDITOR_HIDDEN), "aria-hidden": !expanded, children: children })] }));
|
|
11
11
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { ReactNode } from 'react';
|
|
6
6
|
import { type ChoiceEdgeHints, type EditorNode, type EditorTransition, type EditorTree } from '@signalsafe/tree-spec-editor-core';
|
|
7
|
-
import type { InspectorNodeRenderContext } from './InspectorPanel';
|
|
7
|
+
import type { InspectorNodeRenderContext } from './InspectorPanel.js';
|
|
8
8
|
export interface AppearancePanelProps {
|
|
9
9
|
tree: EditorTree;
|
|
10
10
|
selectedNode: EditorNode | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppearancePanel.d.ts","sourceRoot":"","sources":["../../src/panels/AppearancePanel.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAEH,KAAK,eAAe,EAEpB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAClB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"AppearancePanel.d.ts","sourceRoot":"","sources":["../../src/panels/AppearancePanel.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAEH,KAAK,eAAe,EAEpB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAClB,MAAM,mCAAmC,CAAC;AAkB3C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oBAAoB,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC3D,yFAAyF;IACzF,sBAAsB,EAAE,CAAC,GAAG,EAAE,0BAA0B,KAAK,SAAS,CAAC;IACvE,uBAAuB,CAAC,EAAE,CACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,KAC9B,IAAI,CAAC;IACV,0DAA0D;IAC1D,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAgID,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACpC,IAAI,EACJ,YAAY,EACZ,YAAmB,EACnB,aAAoB,EACpB,WAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,YAAY,EACZ,KAAoB,EACpB,cAA4D,EAC5D,UAAkE,GACrE,EAAE,QAAQ,CAAC,oBAAoB,CAAC,+BA0EhC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { getTransition, } from '@signalsafe/tree-spec-editor-core';
|
|
4
|
-
import PanelHeaderCollapseCarets from '../lib/PanelHeaderCollapseCarets';
|
|
5
|
-
import { PanelNodeLink } from '../lib/panelNodeLink';
|
|
6
|
-
import
|
|
4
|
+
import PanelHeaderCollapseCarets from '../lib/PanelHeaderCollapseCarets.js';
|
|
5
|
+
import { PanelNodeLink } from '../lib/panelNodeLink.js';
|
|
6
|
+
import { EDITOR_CARD, EDITOR_CARD_BODY, EDITOR_CARD_HEADER, EDITOR_FLEX_ROW, EDITOR_HIDDEN, EDITOR_MIN_W_0, EDITOR_MUTED, EDITOR_SPACING_MB_2, EDITOR_SPACING_MB_3, EDITOR_SPACING_MT_3, joinClasses, } from '../ui/editorClasses.js';
|
|
7
|
+
import ChoiceEdgeAppearanceFields from './ChoiceEdgeAppearanceFields.js';
|
|
7
8
|
function resolveActiveChoiceId(choices, selectedEdge, focusChoiceId) {
|
|
8
9
|
if (selectedEdge)
|
|
9
10
|
return selectedEdge.fromChoiceId;
|
|
@@ -14,16 +15,13 @@ function resolveActiveChoiceId(choices, selectedEdge, focusChoiceId) {
|
|
|
14
15
|
}
|
|
15
16
|
const EDGE_APPEARANCE_HELPER = 'Canvas only (not shown in preview or training)';
|
|
16
17
|
function EdgeContextBreadcrumb({ fromNodeId, choiceId, toNodeId, onNodeSelect, }) {
|
|
17
|
-
return (_jsxs("div", { className:
|
|
18
|
+
return (_jsxs("div", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm', EDITOR_SPACING_MB_3), children: [_jsx(PanelNodeLink, { nodeId: fromNodeId, onNodeSelect: onNodeSelect }), ' · ', choiceId, ' → ', toNodeId ? _jsx(PanelNodeLink, { nodeId: toNodeId, onNodeSelect: onNodeSelect }) : '(not connected)'] }));
|
|
18
19
|
}
|
|
19
20
|
function EdgeAppearanceSection({ choice, isPublished, onPatch, }) {
|
|
20
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className:
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm', EDITOR_SPACING_MB_2), children: EDGE_APPEARANCE_HELPER }), _jsx("div", { className: joinClasses('graph-editor-text--sm', 'graph-editor-text--semibold', EDITOR_SPACING_MB_2), children: "Edge appearance" }), _jsx(ChoiceEdgeAppearanceFields, { variant: "embedded", choice: choice, isPublished: isPublished, onPatch: onPatch })] }));
|
|
21
22
|
}
|
|
22
23
|
function appearancePanelBodyClassName(hasSelection, expanded) {
|
|
23
|
-
|
|
24
|
-
return 'card-body d-none';
|
|
25
|
-
}
|
|
26
|
-
return 'card-body';
|
|
24
|
+
return joinClasses(EDITOR_CARD_BODY, hasSelection && !expanded && EDITOR_HIDDEN);
|
|
27
25
|
}
|
|
28
26
|
function deriveAppearancePanelViewState({ tree, selectedNode, selectedEdge, focusChoiceId, onUpdateChoiceEdgeHints, }) {
|
|
29
27
|
const edgeFocused = Boolean(selectedEdge);
|
|
@@ -67,10 +65,10 @@ export default function AppearancePanel({ tree, selectedNode, selectedEdge = nul
|
|
|
67
65
|
focusChoiceId,
|
|
68
66
|
onUpdateChoiceEdgeHints,
|
|
69
67
|
});
|
|
70
|
-
return (_jsxs("div", { className:
|
|
68
|
+
return (_jsxs("div", { className: joinClasses(EDITOR_CARD, EDITOR_SPACING_MT_3), children: [_jsxs("div", { className: joinClasses(EDITOR_CARD_HEADER, EDITOR_FLEX_ROW, EDITOR_MIN_W_0), children: [_jsx("span", { className: "graph-editor-text--semibold", children: title }), hasSelection ? (_jsx(PanelHeaderCollapseCarets, { expanded: expanded, onToggle: () => setExpanded((v) => !v) })) : null] }), _jsx("div", { className: appearancePanelBodyClassName(hasSelection, expanded), "aria-hidden": Boolean(hasSelection && !expanded), children: hasSelection && contextNode ? (_jsxs(_Fragment, { children: [showNodeAppearance ? (_jsxs(_Fragment, { children: [_jsx("div", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm', EDITOR_SPACING_MB_2), children: helperText }), renderAppearanceFields({
|
|
71
69
|
tree,
|
|
72
70
|
node: contextNode,
|
|
73
71
|
isPublished,
|
|
74
72
|
onUpdateNode: onUpdateSelectedNode,
|
|
75
|
-
})] })) : null, showEdgeAppearance && edgeFromNodeId && activeChoiceId && activeChoice ? (_jsxs(_Fragment, { children: [_jsx(EdgeContextBreadcrumb, { fromNodeId: edgeFromNodeId, choiceId: activeChoiceId, toNodeId: edgeToNodeId, onNodeSelect: onNodeSelect }), _jsx(EdgeAppearanceSection, { choice: activeChoice, isPublished: isPublished, onPatch: (patch) => onUpdateChoiceEdgeHints(contextNode.id, activeChoice.id, patch) })] })) : null] })) : (_jsx("div", { className:
|
|
73
|
+
})] })) : null, showEdgeAppearance && edgeFromNodeId && activeChoiceId && activeChoice ? (_jsxs(_Fragment, { children: [_jsx(EdgeContextBreadcrumb, { fromNodeId: edgeFromNodeId, choiceId: activeChoiceId, toNodeId: edgeToNodeId, onNodeSelect: onNodeSelect }), _jsx(EdgeAppearanceSection, { choice: activeChoice, isPublished: isPublished, onPatch: (patch) => onUpdateChoiceEdgeHints(contextNode.id, activeChoice.id, patch) })] })) : null] })) : (_jsx("div", { className: EDITOR_MUTED, children: _jsx("em", { children: emptyStateText }) })) })] }));
|
|
76
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceEdgeAppearanceFields.d.ts","sourceRoot":"","sources":["../../src/panels/ChoiceEdgeAppearanceFields.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChoiceEdgeAppearanceFields.d.ts","sourceRoot":"","sources":["../../src/panels/ChoiceEdgeAppearanceFields.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,eAAe,EACpB,KAAK,YAAY,EACpB,MAAM,mCAAmC,CAAC;AAoB3C,MAAM,WAAW,+BAA+B;IAC5C,MAAM,EAAE,YAAY,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACnD,+EAA+E;IAC/E,OAAO,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACvC;AAED,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EAC/C,MAAM,EACN,WAAmB,EACnB,OAAO,EACP,OAAsB,GACzB,EAAE,QAAQ,CAAC,+BAA+B,CAAC,+BAqE3C"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Form } from 'react-bootstrap';
|
|
3
2
|
import { EDITOR_EDGE_TYPE_OPTIONS, getChoiceEdgeHints, resolveEdgeStrokeColorForDisplay, } from '@signalsafe/tree-spec-editor-core';
|
|
3
|
+
import { EDITOR_FLEX_ROW, EDITOR_SPACING_MB_0, EDITOR_SPACING_MB_1, EDITOR_SPACING_MB_2, EDITOR_SPACING_MT_3, EDITOR_SPACING_PT_2, joinClasses, } from '../ui/editorClasses.js';
|
|
4
|
+
import { EditorButton, EditorField, EditorInput, EditorLabel, EditorSelect, EditorSwitch, } from '../ui/primitives.js';
|
|
4
5
|
export default function ChoiceEdgeAppearanceFields({ choice, isPublished = false, onPatch, variant = 'standalone', }) {
|
|
5
6
|
const hints = getChoiceEdgeHints(choice);
|
|
6
|
-
const fields = (_jsxs(_Fragment, { children: [_jsx(
|
|
7
|
+
const fields = (_jsxs(_Fragment, { children: [_jsx(EditorSwitch, { id: `choice-edge-show-label-${choice.id}`, className: EDITOR_SPACING_MB_2, label: "Show label on canvas", checked: hints.showLabel !== false, disabled: isPublished, onChange: (event) => onPatch({ showLabel: event.target.checked }) }), _jsxs(EditorField, { className: EDITOR_SPACING_MB_2, children: [_jsx(EditorLabel, { className: joinClasses('graph-editor-text--sm', EDITOR_SPACING_MB_1), children: "Stroke color" }), _jsxs("div", { className: joinClasses(EDITOR_FLEX_ROW, 'graph-editor-flex--gap'), children: [_jsx(EditorInput, { type: "color", className: "graph-editor-appearance-color-input", value: resolveEdgeStrokeColorForDisplay(choice), disabled: isPublished, onChange: (event) => onPatch({ strokeColor: event.target.value }) }), _jsx(EditorButton, { tone: "neutral", disabled: isPublished || hints.strokeColor === undefined, onClick: () => onPatch({ strokeColor: undefined }), children: "Reset" })] })] }), _jsxs(EditorField, { className: EDITOR_SPACING_MB_0, children: [_jsx(EditorLabel, { className: joinClasses('graph-editor-text--sm', EDITOR_SPACING_MB_1), children: "Edge type" }), _jsx(EditorSelect, { value: hints.edgeType ?? 'default', disabled: isPublished, onChange: (event) => onPatch({
|
|
7
8
|
edgeType: event.target.value,
|
|
8
9
|
}), children: EDITOR_EDGE_TYPE_OPTIONS.map((option) => (_jsx("option", { value: option.value ?? 'default', children: option.label }, option.value ?? 'default'))) })] })] }));
|
|
9
10
|
if (variant === 'embedded') {
|
|
10
11
|
return fields;
|
|
11
12
|
}
|
|
12
|
-
return (_jsxs("div", { className:
|
|
13
|
+
return (_jsxs("div", { className: joinClasses('graph-editor-card__section', 'graph-editor-card__section--border-top', EDITOR_SPACING_MT_3, EDITOR_SPACING_PT_2), children: [_jsx("div", { className: joinClasses('graph-editor-text--sm', 'graph-editor-text--semibold', EDITOR_SPACING_MB_2), children: "Edge appearance (canvas only)" }), fields] }));
|
|
13
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceTemplatesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/ChoiceTemplatesPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChoiceTemplatesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/ChoiceTemplatesPanel.tsx"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,2EAA2E;AAC3E,MAAM,MAAM,kBAAkB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACtC,SAAS,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC7C,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC3D;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EACzC,SAAS,EACT,cAAc,EACd,WAAmB,EACnB,eAAe,GAClB,EAAE,QAAQ,CAAC,yBAAyB,CAAC,+BAoCrC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import PanelHeaderCollapseCarets from '../lib/PanelHeaderCollapseCarets.js';
|
|
4
|
+
import { EDITOR_CARD, EDITOR_CARD_BODY, EDITOR_CARD_HEADER, EDITOR_FLEX_BETWEEN, EDITOR_FLEX_ROW, EDITOR_FLEX_WRAP, EDITOR_HIDDEN, EDITOR_MUTED, EDITOR_SPACING_MB_0, EDITOR_SPACING_MB_3, EDITOR_SPACING_PY_2, joinClasses, } from '../ui/editorClasses.js';
|
|
5
|
+
import { EditorButton } from '../ui/primitives.js';
|
|
5
6
|
export default function ChoiceTemplatesPanel({ templates, selectedNodeId, isPublished = false, onApplyTemplate, }) {
|
|
6
7
|
const [expanded, setExpanded] = useState(true);
|
|
7
8
|
const disabled = isPublished || !selectedNodeId;
|
|
8
|
-
return (_jsxs(
|
|
9
|
+
return (_jsxs("div", { className: joinClasses(EDITOR_CARD, EDITOR_SPACING_MB_3), children: [_jsxs("div", { className: joinClasses(EDITOR_CARD_HEADER, EDITOR_FLEX_BETWEEN), children: [_jsx("span", { className: "graph-editor-text--semibold", children: "Choice templates" }), _jsx(PanelHeaderCollapseCarets, { expanded: expanded, onToggle: () => setExpanded((value) => !value) })] }), _jsx("div", { className: joinClasses(EDITOR_CARD_BODY, EDITOR_SPACING_PY_2, !expanded && EDITOR_HIDDEN), "aria-hidden": !expanded, children: selectedNodeId ? (_jsx("div", { className: joinClasses(EDITOR_FLEX_ROW, EDITOR_FLEX_WRAP, 'graph-editor-flex--gap'), children: templates.map((template) => (_jsx(EditorButton, { tone: "neutral", disabled: disabled, title: template.choices.map((choice) => choice.label).join(' · '), onClick: () => onApplyTemplate(template), children: template.label }, template.id))) })) : (_jsx("p", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm', EDITOR_SPACING_MB_0), children: "Select a node to add preset choices." })) })] }));
|
|
9
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphEditorInfoPanel.d.ts","sourceRoot":"","sources":["../../src/panels/GraphEditorInfoPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GraphEditorInfoPanel.d.ts","sourceRoot":"","sources":["../../src/panels/GraphEditorInfoPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGH,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAC3B,MAAM,mCAAmC,CAAC;AAyB3C,MAAM,WAAW,yBAAyB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,kEAAkE;IAClE,WAAW,EAAE,OAAO,CAAC;IACrB,2DAA2D;IAC3D,cAAc,EAAE,cAAc,CAAC;IAC/B,gFAAgF;IAChF,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,sEAAsE;IACtE,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACrE;AA0BD,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EACzC,UAAU,EACV,SAAS,EACT,IAAI,EACJ,SAAS,EACT,SAAS,EACT,WAAW,EACX,cAAc,EACd,eAAe,EACf,KAAc,EACd,eAAwC,EACxC,eAA8B,EAC9B,uBAAuB,GAC1B,EAAE,QAAQ,CAAC,yBAAyB,CAAC,+BAyFrC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import PanelHeaderCollapseCarets from '../lib/PanelHeaderCollapseCarets';
|
|
3
|
+
import PanelHeaderCollapseCarets from '../lib/PanelHeaderCollapseCarets.js';
|
|
5
4
|
import { EDITOR_EDGE_TYPE_OPTIONS, getAutosaveStatusLabel, } from '@signalsafe/tree-spec-editor-core';
|
|
5
|
+
import { EDITOR_CARD, EDITOR_CARD_BODY, EDITOR_CARD_HEADER, EDITOR_ALIGN_TOP, EDITOR_FLEX_ROW, EDITOR_FLEX_WRAP, EDITOR_HIDDEN, EDITOR_MONO, EDITOR_MUTED, EDITOR_SPACING_M_0, EDITOR_SPACING_MB_0, EDITOR_SPACING_MB_1, EDITOR_SPACING_MB_2, EDITOR_SPACING_MB_3, EDITOR_SPACING_MT_1, EDITOR_TABLE, EDITOR_TEXT_BREAK, editorBadgeToneClass, joinClasses, } from '../ui/editorClasses.js';
|
|
6
|
+
import { EditorField, EditorLabel, EditorSelect } from '../ui/primitives.js';
|
|
6
7
|
function defaultFormatTimestamp(iso) {
|
|
7
8
|
return new Date(iso).toLocaleString();
|
|
8
9
|
}
|
|
9
10
|
function PropertyRow({ label, value }) {
|
|
10
|
-
return (_jsxs("tr", { children: [_jsx("td", { className:
|
|
11
|
+
return (_jsxs("tr", { children: [_jsx("td", { className: EDITOR_ALIGN_TOP, children: _jsx("strong", { children: label }) }), _jsx("td", { children: value })] }));
|
|
11
12
|
}
|
|
12
13
|
const STATUS_DRAFT = 'Draft';
|
|
13
14
|
const STATUS_PUBLISHED = 'Published (read-only)';
|
|
@@ -19,7 +20,7 @@ function autosaveDisplay(isPublished, status) {
|
|
|
19
20
|
}
|
|
20
21
|
export default function GraphEditorInfoPanel({ scenarioId, versionId, name, createdAt, updatedAt, isPublished, autosaveStatus, lastValidatedAt, title = 'Info', formatTimestamp = defaultFormatTimestamp, defaultEdgeType = 'smoothstep', onUpdateDefaultEdgeType, }) {
|
|
21
22
|
const [expanded, setExpanded] = useState(true);
|
|
22
|
-
return (_jsxs("div", { className:
|
|
23
|
+
return (_jsxs("div", { className: joinClasses(EDITOR_CARD, EDITOR_SPACING_MB_3), children: [_jsx("div", { className: EDITOR_CARD_HEADER, children: _jsxs("div", { className: joinClasses(EDITOR_FLEX_ROW, EDITOR_FLEX_WRAP), children: [_jsx("h5", { className: EDITOR_SPACING_MB_0, children: title }), _jsx(PanelHeaderCollapseCarets, { expanded: expanded, onToggle: () => setExpanded((v) => !v) })] }) }), _jsxs("div", { className: joinClasses(EDITOR_CARD_BODY, 'graph-editor-card__body--flush', !expanded && EDITOR_HIDDEN), "aria-hidden": !expanded, children: [_jsx("table", { className: joinClasses(EDITOR_TABLE, EDITOR_SPACING_M_0), children: _jsxs("tbody", { children: [_jsx(PropertyRow, { label: "Name", value: name }), _jsx(PropertyRow, { label: "Status", value: _jsx("span", { className: editorBadgeToneClass(isPublished ? 'success' : 'secondary'), children: isPublished ? STATUS_PUBLISHED : STATUS_DRAFT }) }), _jsx(PropertyRow, { label: "Save state", value: _jsx("span", { className: EDITOR_MUTED, children: autosaveDisplay(isPublished, autosaveStatus) }) }), _jsx(PropertyRow, { label: "Validated", value: _jsx("span", { className: EDITOR_MUTED, children: lastValidatedAt
|
|
23
24
|
? `Validated ${formatTimestamp(lastValidatedAt)}`
|
|
24
|
-
: 'Not validated' }) }), _jsx(PropertyRow, { label: "Scenario ID", value: _jsx("span", { className:
|
|
25
|
+
: 'Not validated' }) }), _jsx(PropertyRow, { label: "Scenario ID", value: _jsx("span", { className: joinClasses(EDITOR_MONO, 'graph-editor-text--sm', EDITOR_TEXT_BREAK), children: scenarioId }) }), _jsx(PropertyRow, { label: "Version ID", value: _jsx("span", { className: joinClasses(EDITOR_MONO, 'graph-editor-text--sm', EDITOR_TEXT_BREAK), children: versionId }) }), _jsx(PropertyRow, { label: "Created", value: createdAt ? formatTimestamp(createdAt) : '—' }), _jsx(PropertyRow, { label: "Updated", value: updatedAt ? formatTimestamp(updatedAt) : '—' })] }) }), onUpdateDefaultEdgeType ? (_jsxs("div", { className: "graph-editor-card__section graph-editor-card__section--border-top", children: [_jsx("div", { className: joinClasses('graph-editor-text--sm', 'graph-editor-text--semibold', EDITOR_SPACING_MB_2), children: "Global" }), _jsxs(EditorField, { className: EDITOR_SPACING_MB_0, children: [_jsx(EditorLabel, { className: joinClasses('graph-editor-text--sm', EDITOR_SPACING_MB_1), children: "Scenario default edge type" }), _jsx(EditorSelect, { value: defaultEdgeType, disabled: isPublished, onChange: (event) => onUpdateDefaultEdgeType(event.target.value), children: EDITOR_EDGE_TYPE_OPTIONS.filter((option) => option.value !== 'default').map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value))) }), _jsx("div", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm', EDITOR_SPACING_MT_1), children: "Used when a choice edge type is set to Default." })] })] })) : null] })] }));
|
|
25
26
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type InspectorPanelProps } from './inspector/types';
|
|
2
|
-
export { DEFAULT_OUTCOME_OPTIONS, type ChoiceTypeOption, type InspectorChoiceRenderContext, type InspectorNodeRenderContext, type InspectorPanelProps, } from './inspector/types';
|
|
1
|
+
import { type InspectorPanelProps } from './inspector/types.js';
|
|
2
|
+
export { DEFAULT_OUTCOME_OPTIONS, type ChoiceTypeOption, type InspectorChoiceRenderContext, type InspectorNodeRenderContext, type InspectorPanelProps, } from './inspector/types.js';
|
|
3
3
|
export default function InspectorPanel({ tree, selectedNode, focusChoiceId, isPublished, onUpdateSelectedNode, onAddChoice, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, outcomeOptions, hideOutcomeField, renderExtraNodeFields, renderExtraChoiceFields, choiceTypes, onSetChoiceType, title, emptyStateText, typeHelperText, onDeleteSelectedNode, onFocusChoice, }: 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":"AAiBA,OAAO,EAGH,KAAK,mBAAmB,EAC3B,MAAM,
|
|
1
|
+
{"version":3,"file":"InspectorPanel.d.ts","sourceRoot":"","sources":["../../src/panels/InspectorPanel.tsx"],"names":[],"mappings":"AAiBA,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,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,KAAkB,EAClB,cAA4C,EAC5C,cAAyC,EACzC,oBAAoB,EACpB,aAAa,GAChB,EAAE,QAAQ,CAAC,mBAAmB,CAAC,+BAuC/B"}
|
|
@@ -14,10 +14,10 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
14
14
|
* - `renderExtraChoiceFields`: render additional UI below each choice card.
|
|
15
15
|
* - `choiceTypes` / `onSetChoiceType`: host-defined choice type catalog (stable ids).
|
|
16
16
|
*/
|
|
17
|
-
import ChoiceEditorList from './inspector/ChoiceEditorList';
|
|
18
|
-
import RequiredNodeCard from './inspector/RequiredNodeCard';
|
|
19
|
-
import { DEFAULT_OUTCOME_OPTIONS, DEFAULT_TYPE_HELPER_TEXT, } from './inspector/types';
|
|
20
|
-
export { DEFAULT_OUTCOME_OPTIONS, } from './inspector/types';
|
|
17
|
+
import ChoiceEditorList from './inspector/ChoiceEditorList.js';
|
|
18
|
+
import RequiredNodeCard from './inspector/RequiredNodeCard.js';
|
|
19
|
+
import { DEFAULT_OUTCOME_OPTIONS, DEFAULT_TYPE_HELPER_TEXT, } from './inspector/types.js';
|
|
20
|
+
export { DEFAULT_OUTCOME_OPTIONS, } from './inspector/types.js';
|
|
21
21
|
export default function InspectorPanel({ tree, selectedNode, focusChoiceId = null, isPublished = false, onUpdateSelectedNode, onAddChoice, onDeleteChoice, onMoveChoice, onSetChoiceTarget, onSetChoiceOutcome, outcomeOptions = DEFAULT_OUTCOME_OPTIONS, hideOutcomeField = false, renderExtraNodeFields, renderExtraChoiceFields, choiceTypes, onSetChoiceType, title = 'Required', emptyStateText = 'Select a node to edit it.', typeHelperText = DEFAULT_TYPE_HELPER_TEXT, onDeleteSelectedNode, onFocusChoice, }) {
|
|
22
|
-
return (_jsx("div", { children: selectedNode ? (_jsxs(_Fragment, { children: [_jsx(RequiredNodeCard, { tree: tree, selectedNode: selectedNode, isPublished: isPublished, title: title, typeHelperText: typeHelperText, onUpdateSelectedNode: onUpdateSelectedNode, onDeleteSelectedNode: onDeleteSelectedNode, 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: "
|
|
22
|
+
return (_jsx("div", { children: selectedNode ? (_jsxs(_Fragment, { children: [_jsx(RequiredNodeCard, { tree: tree, selectedNode: selectedNode, isPublished: isPublished, title: title, typeHelperText: typeHelperText, onUpdateSelectedNode: onUpdateSelectedNode, onDeleteSelectedNode: onDeleteSelectedNode, 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: "graph-editor-muted", children: _jsx("em", { children: emptyStateText }) })) }));
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IssuesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/IssuesPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IssuesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/IssuesPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAGH,KAAK,UAAU,EACf,KAAK,cAAc,EACtB,MAAM,mCAAmC,CAAC;AA4B3C,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,wEAAwE;IACxE,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uGAAuG;IACvG,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C;;;;OAIG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAC;CAC3C;AAwCD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAChC,MAAM,EACN,eAAe,EACf,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,IAAI,EACJ,SAAS,EACT,aAAoB,EACpB,KAAgB,EAChB,iBAAyC,EACzC,eAAwC,EACxC,6BAAoC,GACvC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,+BAuI5B"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from 'react';
|
|
3
|
-
import { Form } from 'react-bootstrap';
|
|
4
3
|
import { buildStableEntries, GRAPH_SELECTION_KIND, } from '@signalsafe/tree-spec-editor-core';
|
|
5
|
-
import { getIssueSeverityBadgeClass } from '../lib/panelHelpers';
|
|
6
|
-
import PanelHeaderCollapseCarets from '../lib/PanelHeaderCollapseCarets';
|
|
7
|
-
import { LIST_SELECTION_CLASS, LIST_SELECTION_TEXT_CLASS } from '../lib/selectionStyles';
|
|
4
|
+
import { getIssueSeverityBadgeClass } from '../lib/panelHelpers.js';
|
|
5
|
+
import PanelHeaderCollapseCarets from '../lib/PanelHeaderCollapseCarets.js';
|
|
6
|
+
import { LIST_SELECTION_CLASS, LIST_SELECTION_TEXT_CLASS } from '../lib/selectionStyles.js';
|
|
7
|
+
import { EDITOR_CARD, EDITOR_CARD_BODY, EDITOR_CARD_HEADER, EDITOR_FLEX_BETWEEN, EDITOR_FLEX_GROW_1, EDITOR_FLEX_ROW, EDITOR_FLEX_SHRINK_0, EDITOR_HIDDEN, EDITOR_LIST, EDITOR_LIST_ITEM, EDITOR_MIN_W_0, EDITOR_MONO, EDITOR_MUTED, EDITOR_SCROLL, EDITOR_SPACING_MB_1, EDITOR_TEXT_BREAK, EDITOR_TEXT_END, EDITOR_TEXT_START, joinClasses, } from '../ui/editorClasses.js';
|
|
8
|
+
import { EditorInput } from '../ui/primitives.js';
|
|
8
9
|
function defaultFormatTimestamp(iso) {
|
|
9
10
|
return new Date(iso).toLocaleString();
|
|
10
11
|
}
|
|
@@ -42,12 +43,10 @@ export default function IssuesPanel({ issues, lastValidatedAt, onSelectIssue, is
|
|
|
42
43
|
const qLower = issueSearch.trim().toLowerCase();
|
|
43
44
|
const filteredIssues = useMemo(() => issues.filter((issue) => issueMatchesQuery(issue, qLower, tree)), [issues, qLower, tree]);
|
|
44
45
|
const issueEntries = buildStableEntries(filteredIssues, (issue) => `${issue.severity}-${issue.node_id ?? ''}-${issue.message}`);
|
|
45
|
-
return (_jsxs("div", { className:
|
|
46
|
+
return (_jsxs("div", { className: EDITOR_CARD, 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: title }), _jsx(PanelHeaderCollapseCarets, { expanded: expanded, onToggle: () => setExpanded((v) => !v) })] }), showValidationSummaryInHeader ? (_jsx("span", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm', EDITOR_TEXT_END, EDITOR_FLEX_SHRINK_0), children: lastValidatedAt ? `Validated ${formatTimestamp(lastValidatedAt)}` : 'Not validated' })) : null] }), _jsx("div", { className: joinClasses(EDITOR_CARD_BODY, 'graph-editor-card__body--flush', !expanded && EDITOR_HIDDEN), "aria-hidden": !expanded, children: issues.length === 0 ? (_jsx("div", { className: EDITOR_LIST, children: _jsx("div", { className: joinClasses(EDITOR_LIST_ITEM, EDITOR_MUTED, 'graph-editor-text--sm'), children: _jsx("em", { children: "No issues" }) }) })) : (_jsxs(_Fragment, { children: [_jsx(EditorInput, { className: "graph-editor-input--list-search", placeholder: searchPlaceholder, value: issueSearch, onChange: (e) => onIssueSearchChange(e.target.value) }), _jsx("div", { className: joinClasses(EDITOR_SCROLL, 'overflow-auto-max-h-320'), children: issueEntries.length === 0 ? (_jsx("div", { className: EDITOR_LIST, children: _jsx("div", { className: joinClasses(EDITOR_LIST_ITEM, EDITOR_MUTED, 'graph-editor-text--sm'), children: _jsx("em", { children: "No matching issues." }) }) })) : (_jsx("div", { className: EDITOR_LIST, children: issueEntries.map(({ item: issue, key }) => {
|
|
46
47
|
const typeLabel = nodeTypeLabel(tree, issue.node_id);
|
|
47
48
|
const headerTitle = issueHeaderTitle(issue, typeLabel);
|
|
48
49
|
const isSelected = isIssueRowSelected(issue, selection, focusChoiceId);
|
|
49
|
-
return (_jsxs("button", { type: "button", className:
|
|
50
|
-
? ` ${LIST_SELECTION_CLASS} ${LIST_SELECTION_TEXT_CLASS}`
|
|
51
|
-
: ''}`, "aria-current": isSelected ? 'true' : undefined, onClick: () => onSelectIssue(issue), children: [_jsxs("div", { className: "d-flex w-100 justify-content-between align-items-start gap-2 mb-1 min-w-0", children: [_jsxs("div", { className: "min-w-0 flex-grow-1 text-break text-start", title: headerTitle, children: [_jsx("span", { className: "fs-6 fw-semibold text-uppercase", children: issue.node_id ?? '—' }), _jsx("span", { className: `fs-6 text-uppercase${isSelected ? '' : ' text-body-secondary'}`, children: `, ${typeLabel}` })] }), _jsx("span", { className: `badge flex-shrink-0 text-uppercase ${getIssueSeverityBadgeClass(issue.severity)}`, children: issue.severity })] }), _jsx("p", { className: `mb-1 small text-break font-monospace${isSelected ? '' : ' text-body-secondary'}`, children: issue.message }), issue.choice_id ? (_jsx("small", { className: `text-break${isSelected ? '' : ' text-body-secondary'}`, children: issue.choice_id })) : null] }, key));
|
|
50
|
+
return (_jsxs("button", { type: "button", className: joinClasses(EDITOR_LIST_ITEM, 'graph-editor-list__item--button', isSelected && LIST_SELECTION_CLASS, isSelected && LIST_SELECTION_TEXT_CLASS), "aria-current": isSelected ? 'true' : undefined, onClick: () => onSelectIssue(issue), children: [_jsxs("div", { className: joinClasses(EDITOR_FLEX_BETWEEN, EDITOR_SPACING_MB_1, EDITOR_MIN_W_0), children: [_jsxs("div", { className: joinClasses(EDITOR_MIN_W_0, EDITOR_FLEX_GROW_1, EDITOR_TEXT_BREAK, EDITOR_TEXT_START), title: headerTitle, children: [_jsx("span", { className: "graph-editor-text--uppercase graph-editor-text--semibold", children: issue.node_id ?? '—' }), _jsx("span", { className: joinClasses('graph-editor-text--uppercase', !isSelected && EDITOR_MUTED), children: `, ${typeLabel}` })] }), _jsx("span", { className: joinClasses(getIssueSeverityBadgeClass(issue.severity), EDITOR_FLEX_SHRINK_0, 'graph-editor-text--uppercase'), children: issue.severity })] }), _jsx("p", { className: joinClasses(EDITOR_MONO, 'graph-editor-text--sm', EDITOR_TEXT_BREAK, EDITOR_SPACING_MB_1, !isSelected && EDITOR_MUTED), children: issue.message }), issue.choice_id ? (_jsx("small", { className: joinClasses(EDITOR_TEXT_BREAK, !isSelected && EDITOR_MUTED), children: issue.choice_id })) : null] }, key));
|
|
52
51
|
}) })) })] })) })] }));
|
|
53
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/NodesPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodesPanel.d.ts","sourceRoot":"","sources":["../../src/panels/NodesPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAIH,KAAK,UAAU,EACf,KAAK,cAAc,EACtB,MAAM,mCAAmC,CAAC;AA2B3C,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,cAAc,CAAC;IAC1B,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,mBAAmB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,sDAAsD;IACtD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,mFAAmF;IACnF,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAmCD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAC/B,IAAI,EACJ,UAAU,EACV,SAAS,EACT,WAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,iBAAwC,EACxC,OAA0B,EAC1B,SAAS,EACT,YAAY,EACZ,WAAmB,GACtB,EAAE,QAAQ,CAAC,eAAe,CAAC,+BA+J3B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { Form } from 'react-bootstrap';
|
|
4
3
|
import { GRAPH_SELECTION_KIND, TREE_SPEC_NODE_TYPE_PRESETS, } from '@signalsafe/tree-spec-editor-core';
|
|
5
|
-
import PanelHeaderCollapseCarets from '../lib/PanelHeaderCollapseCarets';
|
|
6
|
-
import { LIST_SELECTION_CLASS, LIST_SELECTION_TEXT_CLASS } from '../lib/selectionStyles';
|
|
4
|
+
import PanelHeaderCollapseCarets from '../lib/PanelHeaderCollapseCarets.js';
|
|
5
|
+
import { LIST_SELECTION_CLASS, LIST_SELECTION_TEXT_CLASS } from '../lib/selectionStyles.js';
|
|
6
|
+
import { EDITOR_CARD, EDITOR_CARD_FOOTER, EDITOR_CARD_HEADER, EDITOR_FLEX_BETWEEN, EDITOR_FLEX_GROW_1, EDITOR_FLEX_ROW, EDITOR_FLEX_SHRINK_0, EDITOR_HIDDEN, EDITOR_LIST, EDITOR_LIST_ITEM, EDITOR_MIN_W_0, EDITOR_MUTED, EDITOR_SCROLL, EDITOR_SPACING_MB_1, EDITOR_SPACING_ME_2, EDITOR_SPACING_MT_3, EDITOR_TEXT_BREAK, EDITOR_TEXT_START, joinClasses, } from '../ui/editorClasses.js';
|
|
7
|
+
import { EditorIconButton, EditorInput, EditorSwitch } from '../ui/primitives.js';
|
|
7
8
|
const DEFAULT_TIP_TEXT = 'Tip: connect choices by dragging the blue dots. Shortcuts: \u2318S save, \u2318\u21E7V validate, \u2318D duplicate, Del delete.';
|
|
8
9
|
const TYPE_SORT_ORDER = new Map(TREE_SPEC_NODE_TYPE_PRESETS.map((t, i) => [t, i]));
|
|
9
10
|
function choiceLine(n) {
|
|
@@ -44,11 +45,11 @@ export default function NodesPanel({ tree, nodeSearch, selection, focusNodeId =
|
|
|
44
45
|
return hitPrompt || hitId || hitType || hitChoices;
|
|
45
46
|
})
|
|
46
47
|
.sort(compareNodesByTypeThenId);
|
|
47
|
-
return (_jsxs("div", { className:
|
|
48
|
+
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: "Nodes" }), _jsx(PanelHeaderCollapseCarets, { expanded: expanded, onToggle: () => setExpanded((v) => !v) })] }), onAddNode ? (_jsx(EditorIconButton, { className: joinClasses(EDITOR_FLEX_SHRINK_0, 'graph-editor-btn--primary'), "aria-label": "Add node", title: "Add node", onClick: onAddNode, children: "+" })) : null] }), _jsxs("div", { className: !expanded ? EDITOR_HIDDEN : undefined, "aria-hidden": !expanded, children: [_jsx(EditorInput, { className: "graph-editor-input--list-search", placeholder: searchPlaceholder, value: nodeSearch, onChange: (e) => onNodeSearchChange(e.target.value) }), _jsx("div", { className: joinClasses(EDITOR_SCROLL, 'overflow-auto-max-h-320'), children: filteredNodes.length === 0 ? (_jsx("div", { className: EDITOR_LIST, children: _jsx("div", { className: joinClasses(EDITOR_LIST_ITEM, EDITOR_MUTED, 'graph-editor-text--sm'), children: "No matching nodes." }) })) : (_jsx("div", { className: EDITOR_LIST, children: filteredNodes.map((n) => {
|
|
48
49
|
const isSelected = isNodeRowSelected(n.id, selection, focusNodeId);
|
|
49
50
|
const typeLabel = n.type || 'unknown';
|
|
50
|
-
return (_jsx("div", { className:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}) })) }), _jsx("div", { className:
|
|
51
|
+
return (_jsx("div", { className: joinClasses(EDITOR_LIST_ITEM, isSelected && LIST_SELECTION_CLASS, isSelected && LIST_SELECTION_TEXT_CLASS), "aria-current": isSelected ? 'true' : undefined, children: _jsxs("div", { className: joinClasses(EDITOR_FLEX_BETWEEN, EDITOR_MIN_W_0), children: [_jsxs("button", { type: "button", className: joinClasses('graph-editor-list__item-action', EDITOR_FLEX_GROW_1, EDITOR_TEXT_START, EDITOR_MIN_W_0), onClick: () => onNodeSelect(n.id), children: [_jsx("div", { className: joinClasses(EDITOR_FLEX_BETWEEN, EDITOR_SPACING_MB_1, EDITOR_MIN_W_0), children: _jsxs("div", { className: joinClasses(EDITOR_MIN_W_0, EDITOR_FLEX_GROW_1, EDITOR_TEXT_BREAK, EDITOR_TEXT_START), title: `${n.id}, ${typeLabel}`, children: [_jsx("span", { className: joinClasses('graph-editor-text--uppercase', 'graph-editor-text--semibold', !isSelected && EDITOR_MUTED), children: n.id }), _jsx("span", { className: joinClasses('graph-editor-text--uppercase', !isSelected && EDITOR_MUTED), children: `, ${typeLabel}` })] }) }), _jsx("p", { className: joinClasses('graph-editor-text--sm', EDITOR_TEXT_BREAK, EDITOR_SPACING_MB_1, !isSelected && EDITOR_MUTED), children: n.prompt || '(empty)' }), _jsx("small", { className: !isSelected ? EDITOR_MUTED : undefined, children: choiceLine(n) })] }), onDeleteNode ? (_jsx(EditorIconButton, { className: joinClasses(EDITOR_FLEX_SHRINK_0, isPublished
|
|
52
|
+
? 'graph-editor-btn--disabled'
|
|
53
|
+
: 'graph-editor-btn--danger'), "aria-label": `Delete node ${n.id}`, title: "Delete node", disabled: isPublished, onClick: () => onDeleteNode(n.id), children: "\uD83D\uDDD1" })) : null] }) }, n.id));
|
|
54
|
+
}) })) }), _jsx("div", { className: joinClasses(EDITOR_CARD_FOOTER, 'graph-editor-card__footer--border-top'), children: _jsxs("div", { className: EDITOR_FLEX_BETWEEN, children: [_jsx("div", { className: joinClasses(EDITOR_MUTED, 'graph-editor-text--sm', EDITOR_TEXT_BREAK, EDITOR_MIN_W_0, EDITOR_FLEX_GROW_1, EDITOR_SPACING_ME_2), children: tipText }), _jsx(EditorSwitch, { id: "showMiniMapToggle", label: "Mini-map", checked: showMiniMap, onChange: (e) => onShowMiniMapChange(e.target.checked), className: "graph-editor-text--sm" })] }) })] })] }));
|
|
54
55
|
}
|