@kiberon-labs/behave-graph-flow 2.0.0 → 3.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/.storybook/manager.ts +6 -0
- package/.storybook/preview.ts +49 -1
- package/.storybook/styles.css +9 -3
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +368 -0
- package/dist/AnyControlImpl-Ds-CShIB.js +20 -0
- package/dist/AnyControlImpl-Ds-CShIB.js.map +1 -0
- package/dist/DocumentationBrowserPanelImpl-deZNzFX8.js +166 -0
- package/dist/DocumentationBrowserPanelImpl-deZNzFX8.js.map +1 -0
- package/dist/index.css +36 -33
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1865 -550
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14357 -11221
- package/dist/index.js.map +1 -1
- package/dist/noteImpl-KkrrWgJd.js +242 -0
- package/dist/noteImpl-KkrrWgJd.js.map +1 -0
- package/dist/styles.module-CvmpDkZj.css +3 -0
- package/dist/styles.module-CvmpDkZj.css.map +1 -0
- package/dist/styles.module-DZxg8aW9.js +271 -0
- package/dist/styles.module-DZxg8aW9.js.map +1 -0
- package/dist/useChangeNodeData-ChQGK7AI.js +23 -0
- package/dist/useChangeNodeData-ChQGK7AI.js.map +1 -0
- package/docs/protocol.md +43 -20
- package/package.json +5 -9
- package/src/components/FloatingToolbar/index.module.css +5 -13
- package/src/components/FloatingToolbar/index.tsx +9 -9
- package/src/components/Flow.tsx +34 -23
- package/src/components/contextMenus/DynamicContextMenu.tsx +85 -0
- package/src/components/contextMenus/NodePicker.module.css +13 -13
- package/src/components/contextMenus/edge.tsx +9 -95
- package/src/components/contextMenus/node.tsx +9 -149
- package/src/components/contextMenus/selection.tsx +5 -71
- package/src/components/controls/any/AnyControlImpl.tsx +14 -0
- package/src/components/controls/any/index.tsx +13 -2
- package/src/components/edges/index.tsx +75 -69
- package/src/components/layoutController/index.module.css +3 -0
- package/src/components/layoutController/index.tsx +24 -1
- package/src/components/layoutController/utils.ts +46 -3
- package/src/components/menubar/defaults.tsx +55 -19
- package/src/components/menubar/menuItem.module.css +18 -3
- package/src/components/menubar/menuItem.tsx +34 -1
- package/src/components/nodes/behave/NodeContainer.module.css +26 -25
- package/src/components/nodes/group/index.tsx +3 -3
- package/src/components/nodes/wrapper/styles.module.css +6 -32
- package/src/components/panels/alignment/index.module.css +0 -10
- package/src/components/panels/alignment/index.tsx +4 -4
- package/src/components/panels/base/styles.module.css +2 -2
- package/src/components/panels/common/PanelHeader.module.css +24 -0
- package/src/components/panels/common/PanelHeader.tsx +22 -0
- package/src/components/panels/common/SectionTitle.module.css +13 -0
- package/src/components/panels/common/SectionTitle.tsx +10 -0
- package/src/components/panels/events/EditEventPanel.tsx +14 -5
- package/src/components/panels/events/ManageEventsPanel.tsx +11 -8
- package/src/components/panels/events/styles.module.css +6 -64
- package/src/components/panels/graphProperties/index.tsx +125 -0
- package/src/components/panels/history/index.tsx +2 -2
- package/src/components/panels/history/styles.module.css +0 -9
- package/src/components/panels/keymaps/index.module.css +3 -13
- package/src/components/panels/keymaps/index.tsx +1 -2
- package/src/components/panels/layers/index.tsx +20 -15
- package/src/components/panels/layers/styles.module.css +9 -12
- package/src/components/panels/legend/index.tsx +1 -1
- package/src/components/panels/logs/index.module.css +25 -19
- package/src/components/panels/logs/index.tsx +7 -7
- package/src/components/panels/nodeInputs/InputsGroup.tsx +1 -0
- package/src/components/panels/nodeInputs/NodeSettings.tsx +2 -2
- package/src/components/panels/nodeInputs/NodeTitleEditor.tsx +1 -1
- package/src/components/panels/nodeInputs/OutputsGroup.tsx +2 -12
- package/src/components/panels/nodeInputs/index.module.css +99 -75
- package/src/components/panels/nodeInputs/index.tsx +21 -11
- package/src/components/panels/nodeInputs/useNodeHandlers.ts +2 -2
- package/src/components/panels/nodeInputs/useNodeInputsData.ts +23 -43
- package/src/components/panels/nodePicker/index.tsx +8 -8
- package/src/components/panels/panel/index.module.css +7 -7
- package/src/components/panels/search/index.module.css +0 -50
- package/src/components/panels/search/index.tsx +2 -2
- package/src/components/panels/systemSettings/ConversionsSettings.tsx +203 -0
- package/src/components/panels/systemSettings/index.tsx +221 -176
- package/src/components/panels/systemSettings/styles.module.css +135 -8
- package/src/components/panels/traces/GridLines.tsx +1 -1
- package/src/components/panels/traces/TimeGrid.tsx +3 -3
- package/src/components/panels/traces/TraceLane.tsx +1 -1
- package/src/components/panels/traces/index.module.css +1 -8
- package/src/components/panels/traces/index.tsx +8 -4
- package/src/components/panels/traces/useDerivedSpans.ts +241 -146
- package/src/components/panels/traces/utils.ts +8 -0
- package/src/components/panels/variables/CreateVariableScreen.tsx +3 -3
- package/src/components/panels/variables/ManageVariablesScreen.tsx +12 -9
- package/src/components/panels/variables/index.tsx +2 -2
- package/src/components/panels/variables/styles.module.css +4 -91
- package/src/components/primitives/icon.module.css +4 -4
- package/src/components/sockets/input/index.tsx +9 -2
- package/src/components/sockets/input/styles.module.css +2 -3
- package/src/components/sockets/output/index.tsx +10 -3
- package/src/components/sockets/output/styles.module.css +1 -6
- package/src/css/notes.css +135 -0
- package/src/css/prosemirror.css +3 -3
- package/src/css/rc-dock.css +143 -43
- package/src/css/rc-menu.css +56 -55
- package/src/css/themes/kiberon.css +127 -0
- package/src/css/vars.css +197 -13
- package/src/css/vscode-elements.css +124 -0
- package/src/generators/CallSubgraphGenerator.tsx +136 -0
- package/src/generators/CustomEventOnTriggeredGenerator.tsx +2 -2
- package/src/generators/GraphBoundaryGenerator.module.css +32 -0
- package/src/generators/GraphBoundaryGenerator.tsx +193 -0
- package/src/generators/SequenceGenerator.tsx +2 -2
- package/src/generators/SwitchOnIntegerGenerator.tsx +2 -2
- package/src/generators/SwitchOnStringGenerator.tsx +2 -2
- package/src/generators/callSubgraphSync.ts +126 -0
- package/src/generators/registerDefaultGenerators.ts +21 -0
- package/src/generators/registerDefaults.ts +26 -0
- package/src/hooks/useBehaveGraphFlow.ts +2 -2
- package/src/hooks/useFlowHandlers.ts +47 -9
- package/src/hooks/useWasdPan.ts +26 -4
- package/src/index.css +4 -16
- package/src/index.ts +17 -0
- package/src/manifest/contributionRegistry.ts +93 -0
- package/src/manifest/index.ts +4 -0
- package/src/manifest/loadManifest.ts +82 -0
- package/src/manifest/manifestPlugin.ts +29 -0
- package/src/manifest/passthroughValueType.ts +40 -0
- package/src/plugin/alignment/index.ts +22 -12
- package/src/plugin/autosave/controller.ts +366 -0
- package/src/plugin/autosave/index.tsx +114 -0
- package/src/plugin/autosave/panel/BackupPanel.tsx +141 -0
- package/src/plugin/autosave/panel/index.tsx +1 -0
- package/src/plugin/autosave/panel/styles.module.css +56 -0
- package/src/plugin/autosave/settings.ts +65 -0
- package/src/plugin/autosave/storage.ts +147 -0
- package/src/plugin/docs/index.tsx +2 -4
- package/src/plugin/docs/panel/DocumentationBrowserPanelImpl.tsx +200 -0
- package/src/plugin/docs/panel/index.tsx +15 -194
- package/src/plugin/docs/panel/styles.module.css +8 -8
- package/src/plugin/graphrunner/actions.ts +258 -185
- package/src/plugin/graphrunner/buttons.tsx +34 -26
- package/src/plugin/graphrunner/client.ts +4 -1
- package/src/plugin/graphrunner/index.tsx +29 -100
- package/src/plugin/graphrunner/panel.tsx +2 -2
- package/src/plugin/graphrunner/runController.ts +283 -0
- package/src/plugin/graphrunner/runner.ts +21 -192
- package/src/plugin/graphrunner/store.ts +14 -24
- package/src/plugin/graphrunner/styles.module.css +17 -57
- package/src/plugin/graphrunner/transport.ts +26 -0
- package/src/plugin/graphrunner/types.ts +21 -0
- package/src/plugin/graphrunner-local/execution-utils.ts +260 -80
- package/src/plugin/graphrunner-local/index.tsx +8 -2
- package/src/plugin/graphrunner-local/panel.tsx +131 -175
- package/src/plugin/graphrunner-local/styles.module.css +57 -76
- package/src/plugin/graphrunner-local/transport.ts +151 -184
- package/src/plugin/graphrunner-webworker/graph-executor.worker.ts +2 -0
- package/src/plugin/graphrunner-webworker/index.tsx +4 -10
- package/src/plugin/graphrunner-webworker/store.ts +9 -0
- package/src/plugin/kitchen-sink/index.ts +38 -0
- package/src/{layout/dagre.tsx → plugin/layout/dagre.ts} +17 -5
- package/src/{layout → plugin/layout}/elk.ts +22 -6
- package/src/plugin/layout/index.ts +80 -0
- package/src/plugin/notes/FormatToolbar.tsx +200 -0
- package/src/plugin/notes/index.tsx +191 -0
- package/src/plugin/notes/nodeActions.ts +100 -0
- package/src/plugin/notes/note.tsx +20 -0
- package/src/plugin/notes/noteImpl.tsx +89 -0
- package/src/plugin/realtime/realtimeRunner.ts +58 -4
- package/src/specifics/CustomEventOnTriggeredSpecific.tsx +2 -2
- package/src/specifics/CustomEventTriggerSpecific.tsx +2 -2
- package/src/specifics/VariableGetSpecific.tsx +2 -2
- package/src/specifics/VariableSetSpecific.tsx +2 -2
- package/src/store/actions.tsx +5 -5
- package/src/store/commands.ts +278 -0
- package/src/store/contextMenu.ts +192 -0
- package/src/store/conversions.ts +47 -0
- package/src/store/flow.tsx +23 -38
- package/src/store/graphMeta.ts +39 -0
- package/src/store/hotKeys.tsx +301 -260
- package/src/store/layers.ts +3 -3
- package/src/store/registry.ts +12 -4
- package/src/store/selection.ts +3 -3
- package/src/store/settings.ts +82 -82
- package/src/store/settingsSchema.ts +210 -0
- package/src/store/tabs.ts +5 -1
- package/src/store/traces.ts +3 -3
- package/src/system/graph.ts +11 -14
- package/src/system/graphSession.ts +172 -0
- package/src/system/index.ts +3 -0
- package/src/system/notifications.ts +13 -0
- package/src/system/persistence.ts +82 -0
- package/src/system/plugin.ts +28 -0
- package/src/system/provider.tsx +64 -0
- package/src/system/system.ts +518 -88
- package/src/system/tabLoader.tsx +70 -32
- package/src/system/undoRedo.ts +1 -1
- package/src/transformers/Uigraph.ts +5 -4
- package/src/transformers/contract.ts +87 -0
- package/src/transformers/flowToBehave.ts +13 -5
- package/src/types/nodes.ts +8 -3
- package/src/types.ts +2 -0
- package/src/util/autoConvert.ts +200 -0
- package/src/util/isValidConnection.ts +23 -2
- package/stories/defaults/defaultStoryProvider.tsx +17 -14
- package/stories/defaults/systemGenerator.ts +6 -1
- package/stories/{components/nodes/comment.stories.tsx → plugins/notes.stories.tsx} +24 -30
- package/tests/autoConvert.test.ts +329 -0
- package/tests/autosavePlugin.test.ts +204 -0
- package/tests/callSubgraphSync.test.ts +148 -0
- package/tests/commandRegistry.test.ts +137 -0
- package/tests/contract.test.ts +51 -0
- package/tests/contractSerialize.test.ts +62 -0
- package/tests/deriveSpans.test.ts +71 -0
- package/tests/flowToBehave.test.ts +2 -1
- package/tests/hotkeys.test.ts +79 -0
- package/tests/keepAliveLifecycle.test.ts +167 -0
- package/tests/loadManifest.test.ts +113 -0
- package/tests/noteMarkdown.test.ts +65 -0
- package/tests/notesPlugin.test.ts +162 -0
- package/tests/persistence.test.ts +51 -0
- package/tests/saveLoad.test.ts +7 -6
- package/tests/settings.test.ts +178 -0
- package/tests/traceStore.test.ts +46 -0
- package/tests/visual/README.md +2 -2
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-conversation-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-events-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-history-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-keymaps-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-layers-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-legend-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-localGraphRunner-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-logs-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-nodeInputs-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-nodePicker-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-panel-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-search-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-systemSettings-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-variables-chromium-win32.png +0 -0
- package/tests/visual/panels.visual.test.tsx +3 -3
- package/tests/wasdPan.test.ts +71 -0
- package/vitest.config.ts +1 -1
- package/vitest.visual.config.ts +7 -0
- package/.storybook/vscode.css +0 -814
- package/src/components/nodes/comment/FormatToolbar.tsx +0 -118
- package/src/components/nodes/comment/comment.tsx +0 -103
- package/src/components/nodes/comment/styles.module.css +0 -150
- package/src/components/panels/conversation/index.module.css +0 -151
- package/src/components/panels/conversation/index.tsx +0 -162
- package/src/components/panels/events/CustomEventsEditor.tsx +0 -384
- package/src/css/vscode.css +0 -13
- package/src/hooks/useDetachNodes.ts +0 -39
- package/src/plugin/graphrunner-webworker/types.ts +0 -17
- package/src/specifics/registerDefaultSpecifics.ts +0 -5
- package/src/store/chat.ts +0 -73
- package/src/store/graphRunnerClient.ts +0 -110
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { SettingDescriptor } from '@/store/settingsSchema';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Setting keys owned by the autosave plugin. Namespaced (`autosave.*`) so they
|
|
5
|
+
* never collide with the built-in flat setting keys.
|
|
6
|
+
*/
|
|
7
|
+
export const AUTOSAVE_ENABLED = 'autosave.enabled';
|
|
8
|
+
export const AUTOSAVE_INTERVAL_SECONDS = 'autosave.intervalSeconds';
|
|
9
|
+
export const AUTOSAVE_MAX_COPIES = 'autosave.maxCopies';
|
|
10
|
+
|
|
11
|
+
/** Shipped defaults, also used by the controller when a value is missing. */
|
|
12
|
+
export const AUTOSAVE_DEFAULTS = {
|
|
13
|
+
enabled: false,
|
|
14
|
+
intervalSeconds: 60,
|
|
15
|
+
maxCopies: 20
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
/** Lower bound on the timer so a typo can't spin the loop every frame. */
|
|
19
|
+
export const MIN_INTERVAL_SECONDS = 5;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The Settings-panel rows this plugin contributes. Registered via
|
|
23
|
+
* `system.registerSettings(...)`, which also seeds each default into the value
|
|
24
|
+
* store, so `system.getSetting(AUTOSAVE_*)` is populated the moment the plugin
|
|
25
|
+
* loads.
|
|
26
|
+
*/
|
|
27
|
+
export const AUTOSAVE_SETTINGS: SettingDescriptor[] = [
|
|
28
|
+
{
|
|
29
|
+
key: AUTOSAVE_ENABLED,
|
|
30
|
+
section: 'Autosave',
|
|
31
|
+
order: 0,
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
default: AUTOSAVE_DEFAULTS.enabled,
|
|
34
|
+
title: 'Enable local backups',
|
|
35
|
+
description:
|
|
36
|
+
'Periodically snapshot open graphs into local storage so a crash or a bad edit is recoverable. Purely client-side; nothing leaves the browser.'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: AUTOSAVE_INTERVAL_SECONDS,
|
|
40
|
+
section: 'Autosave',
|
|
41
|
+
order: 1,
|
|
42
|
+
type: 'number',
|
|
43
|
+
default: AUTOSAVE_DEFAULTS.intervalSeconds,
|
|
44
|
+
min: MIN_INTERVAL_SECONDS,
|
|
45
|
+
step: 5,
|
|
46
|
+
title: 'Backup frequency (seconds)',
|
|
47
|
+
description:
|
|
48
|
+
'How often a snapshot is taken. A copy is only written when the graph has actually changed and is in a consistent state.',
|
|
49
|
+
when: (values) => values[AUTOSAVE_ENABLED] === true
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: AUTOSAVE_MAX_COPIES,
|
|
53
|
+
section: 'Autosave',
|
|
54
|
+
order: 2,
|
|
55
|
+
type: 'number',
|
|
56
|
+
default: AUTOSAVE_DEFAULTS.maxCopies,
|
|
57
|
+
min: 1,
|
|
58
|
+
max: 200,
|
|
59
|
+
step: 1,
|
|
60
|
+
title: 'Copies to keep per graph',
|
|
61
|
+
description:
|
|
62
|
+
'The oldest snapshots are discarded once a graph has this many. Higher values use more local storage.',
|
|
63
|
+
when: (values) => values[AUTOSAVE_ENABLED] === true
|
|
64
|
+
}
|
|
65
|
+
];
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { UIGraphJSON } from '@/types/graph';
|
|
2
|
+
import type { SettingsStorage } from '@/system/system';
|
|
3
|
+
|
|
4
|
+
/** Single local-storage key holding every graph's backup ring. */
|
|
5
|
+
export const AUTOSAVE_STORAGE_KEY = 'behave-graph:autosave';
|
|
6
|
+
|
|
7
|
+
/** A single point-in-time copy of one graph. */
|
|
8
|
+
export type BackupSnapshot = {
|
|
9
|
+
/** Unique id for this snapshot (used by the panel to restore/delete). */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Session id of the graph this snapshot came from. */
|
|
12
|
+
graphId: string;
|
|
13
|
+
/** Graph display name captured at snapshot time (for the panel list). */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Epoch milliseconds when the snapshot was taken. */
|
|
16
|
+
timestamp: number;
|
|
17
|
+
/** Node count, shown in the panel without deserializing the whole graph. */
|
|
18
|
+
nodeCount: number;
|
|
19
|
+
/** The full, restorable graph document. */
|
|
20
|
+
graph: UIGraphJSON;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Per-graph ring buffer of snapshots, newest last. */
|
|
24
|
+
type GraphBackups = {
|
|
25
|
+
name: string;
|
|
26
|
+
snapshots: BackupSnapshot[];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** The persisted shape: graph id -> its backups. */
|
|
30
|
+
type BackupStore = Record<string, GraphBackups>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* localStorage-or-nothing accessor. The whole backup set lives under a single
|
|
34
|
+
* key as a JSON object, so a plain get/set storage adapter (the same shape the
|
|
35
|
+
* settings persistence uses) is all we need , no `key(i)`/`length` scanning.
|
|
36
|
+
*/
|
|
37
|
+
const defaultStorage = (): SettingsStorage | undefined => {
|
|
38
|
+
try {
|
|
39
|
+
if (typeof localStorage !== 'undefined') return localStorage;
|
|
40
|
+
} catch {
|
|
41
|
+
// localStorage can throw in sandboxed / SSR contexts.
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const readStore = (storage: SettingsStorage): BackupStore => {
|
|
47
|
+
try {
|
|
48
|
+
const raw = storage.getItem(AUTOSAVE_STORAGE_KEY);
|
|
49
|
+
if (!raw) return {};
|
|
50
|
+
const parsed = JSON.parse(raw);
|
|
51
|
+
return parsed && typeof parsed === 'object' ? (parsed as BackupStore) : {};
|
|
52
|
+
} catch {
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const writeStore = (storage: SettingsStorage, store: BackupStore): void => {
|
|
58
|
+
try {
|
|
59
|
+
storage.setItem(AUTOSAVE_STORAGE_KEY, JSON.stringify(store));
|
|
60
|
+
} catch {
|
|
61
|
+
// Quota exceeded / serialization error: drop this write rather than throw.
|
|
62
|
+
// The next successful snapshot will re-establish the ring.
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Thin persistence wrapper over the single backup key. Kept storage-agnostic
|
|
68
|
+
* (any get/set adapter) so hosts can back it with something other than
|
|
69
|
+
* localStorage and tests can inject an in-memory map.
|
|
70
|
+
*/
|
|
71
|
+
export class BackupStorage {
|
|
72
|
+
private readonly storage: SettingsStorage | undefined;
|
|
73
|
+
|
|
74
|
+
constructor(storage: SettingsStorage | undefined = defaultStorage()) {
|
|
75
|
+
this.storage = storage;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Whether a backing store is available (false in SSR / sandboxed contexts). */
|
|
79
|
+
get available(): boolean {
|
|
80
|
+
return this.storage !== undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** All snapshots across every graph, newest first. */
|
|
84
|
+
listAll(): BackupSnapshot[] {
|
|
85
|
+
if (!this.storage) return [];
|
|
86
|
+
const store = readStore(this.storage);
|
|
87
|
+
return Object.values(store)
|
|
88
|
+
.flatMap((g) => g.snapshots)
|
|
89
|
+
.sort((a, b) => b.timestamp - a.timestamp);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Find one snapshot by id (across all graphs). */
|
|
93
|
+
find(id: string): BackupSnapshot | undefined {
|
|
94
|
+
return this.listAll().find((s) => s.id === id);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Append a snapshot to its graph's ring and trim to `maxCopies` (oldest
|
|
99
|
+
* dropped). `name` refreshes the stored graph label so the panel tracks
|
|
100
|
+
* renames.
|
|
101
|
+
*/
|
|
102
|
+
append(snapshot: BackupSnapshot, maxCopies: number): void {
|
|
103
|
+
if (!this.storage) return;
|
|
104
|
+
const store = readStore(this.storage);
|
|
105
|
+
const entry = store[snapshot.graphId] ?? {
|
|
106
|
+
name: snapshot.name,
|
|
107
|
+
snapshots: []
|
|
108
|
+
};
|
|
109
|
+
entry.name = snapshot.name;
|
|
110
|
+
entry.snapshots = [...entry.snapshots, snapshot];
|
|
111
|
+
const limit = Math.max(1, Math.floor(maxCopies));
|
|
112
|
+
if (entry.snapshots.length > limit) {
|
|
113
|
+
entry.snapshots = entry.snapshots.slice(entry.snapshots.length - limit);
|
|
114
|
+
}
|
|
115
|
+
store[snapshot.graphId] = entry;
|
|
116
|
+
writeStore(this.storage, store);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Remove a single snapshot; prunes the graph entry once it is empty. */
|
|
120
|
+
remove(id: string): void {
|
|
121
|
+
if (!this.storage) return;
|
|
122
|
+
const store = readStore(this.storage);
|
|
123
|
+
for (const [graphId, entry] of Object.entries(store)) {
|
|
124
|
+
const next = entry.snapshots.filter((s) => s.id !== id);
|
|
125
|
+
if (next.length === entry.snapshots.length) continue;
|
|
126
|
+
if (next.length === 0) delete store[graphId];
|
|
127
|
+
else store[graphId] = { ...entry, snapshots: next };
|
|
128
|
+
writeStore(this.storage, store);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Drop every snapshot for a single graph. */
|
|
134
|
+
removeGraph(graphId: string): void {
|
|
135
|
+
if (!this.storage) return;
|
|
136
|
+
const store = readStore(this.storage);
|
|
137
|
+
if (!(graphId in store)) return;
|
|
138
|
+
delete store[graphId];
|
|
139
|
+
writeStore(this.storage, store);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Wipe all backups. */
|
|
143
|
+
clear(): void {
|
|
144
|
+
if (!this.storage) return;
|
|
145
|
+
writeStore(this.storage, {});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type System } from '@/system/system';
|
|
2
2
|
import type { NodeDocumentation } from '@/store/documentation';
|
|
3
|
-
import { BounceRight, Flash, PauseWindow } from 'iconoir-react';
|
|
3
|
+
import { BounceRight, Flash, GitFork, PauseWindow } from 'iconoir-react';
|
|
4
4
|
import { DocumentationBrowserPanel } from './panel';
|
|
5
5
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
6
6
|
import { MenuItemElement } from '../../components/menubar/menuItem';
|
|
@@ -84,9 +84,7 @@ Documentation: The description field serves as inline documentation of assumptio
|
|
|
84
84
|
},
|
|
85
85
|
|
|
86
86
|
{
|
|
87
|
-
icon:
|
|
88
|
-
<img src="https://imgs.search.brave.com/I24-hRYZL3tBnj1vmcr525tMOtlP-GFWPoS1qr7tMdo/rs:fit:860:0:0:0/g:ce/aHR0cHM6Ly9pbWcu/aWNvbnM4LmNvbS9l/eHRlcm5hbC1mbGF0/aWNvbnMtbGluZWFs/LWNvbG9yLWZsYXQt/aWNvbnMvMTIwMC9l/eHRlcm5hbC1kZWJ1/Zy1tb2JpbGUtYXBw/LWRldmVsb3BtZW50/LWZsYXRpY29ucy1s/aW5lYWwtY29sb3It/ZmxhdC1pY29ucy5q/cGc" />
|
|
89
|
-
),
|
|
87
|
+
icon: <GitFork />,
|
|
90
88
|
type: 'flow/branch',
|
|
91
89
|
shortDescription: 'Execute different flows based on a boolean condition',
|
|
92
90
|
tags: ['flow', 'conditional', 'control'],
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { useMemo, useCallback, type ComponentType } from 'react';
|
|
2
|
+
import { useEditor, EditorContent } from '@tiptap/react';
|
|
3
|
+
import StarterKit from '@tiptap/starter-kit';
|
|
4
|
+
import { useSystem } from '@/system/provider';
|
|
5
|
+
import { Markdown } from 'tiptap-markdown';
|
|
6
|
+
import { useStore } from 'zustand';
|
|
7
|
+
import type { ExtendedNodeSpecJSON } from '@/components/contextMenus/NodePicker';
|
|
8
|
+
import { useOnPressKey } from '@/hooks/useOnPressKey';
|
|
9
|
+
import { removeTabFromLayout } from '@/components/layoutController/utils';
|
|
10
|
+
import styles from './styles.module.css';
|
|
11
|
+
|
|
12
|
+
/** One named socket (name + value type) rendered in a documentation section. */
|
|
13
|
+
interface DocSocket {
|
|
14
|
+
name: string;
|
|
15
|
+
valueType: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface SocketSectionProps {
|
|
19
|
+
title: string;
|
|
20
|
+
sockets: DocSocket[] | undefined;
|
|
21
|
+
getIconForType: (valueType: string) => ComponentType;
|
|
22
|
+
getColorForType: (valueType: string) => string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A titled list of node sockets (Inputs / Outputs / Configuration). Renders
|
|
27
|
+
* nothing when the socket list is empty so callers can drop it in
|
|
28
|
+
* unconditionally.
|
|
29
|
+
*/
|
|
30
|
+
function SocketSection({
|
|
31
|
+
title,
|
|
32
|
+
sockets,
|
|
33
|
+
getIconForType,
|
|
34
|
+
getColorForType
|
|
35
|
+
}: SocketSectionProps) {
|
|
36
|
+
if (!sockets || sockets.length === 0) return null;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className={styles.section}>
|
|
40
|
+
<h3 className={styles.sectionTitle}>{title}</h3>
|
|
41
|
+
<div className={styles.socketList}>
|
|
42
|
+
{sockets.map((socket, index) => {
|
|
43
|
+
const IconComponent = getIconForType(socket.valueType);
|
|
44
|
+
const color = getColorForType(socket.valueType);
|
|
45
|
+
return (
|
|
46
|
+
<div key={index} className={styles.socketItem}>
|
|
47
|
+
<div className={styles.socketIcon} style={{ color }}>
|
|
48
|
+
<IconComponent />
|
|
49
|
+
</div>
|
|
50
|
+
<div className={styles.socketName}>{socket.name}</div>
|
|
51
|
+
<div className={styles.socketType} style={{ color }}>
|
|
52
|
+
{socket.valueType}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
})}
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function DocumentationBrowserPanelImpl() {
|
|
63
|
+
const sys = useSystem();
|
|
64
|
+
const selectedNodeType = useStore(
|
|
65
|
+
sys.refStore,
|
|
66
|
+
(x) => x.refs.selectedDocumentationType
|
|
67
|
+
);
|
|
68
|
+
const documentation = useStore(sys.documentationStore, (x) => x.docs);
|
|
69
|
+
const specs = useStore(sys.specStore, (x) => x.specs);
|
|
70
|
+
const icons = useStore(sys.legendStore, (x) => x.icons);
|
|
71
|
+
const defaultIcon = useStore(sys.legendStore, (x) => x.defaultIcon);
|
|
72
|
+
const valueTypeColors = useStore(sys.legendStore, (x) => x.valueTypeColors);
|
|
73
|
+
|
|
74
|
+
const nodeSpec = useMemo((): ExtendedNodeSpecJSON | null => {
|
|
75
|
+
if (!selectedNodeType) return null;
|
|
76
|
+
return specs.find((s) => s.type === selectedNodeType) ?? null;
|
|
77
|
+
}, [selectedNodeType, specs]);
|
|
78
|
+
|
|
79
|
+
const getIconForType = useCallback(
|
|
80
|
+
(valueType: string): ComponentType => {
|
|
81
|
+
const IconComponent = icons[valueType] || defaultIcon;
|
|
82
|
+
return IconComponent;
|
|
83
|
+
},
|
|
84
|
+
[icons, defaultIcon]
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const getColorForType = useCallback(
|
|
88
|
+
(valueType: string) => {
|
|
89
|
+
return valueTypeColors[valueType] || '#6c727e';
|
|
90
|
+
},
|
|
91
|
+
[valueTypeColors]
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
const nodeDoc = useMemo(() => {
|
|
95
|
+
if (!selectedNodeType) return null;
|
|
96
|
+
return documentation.get(selectedNodeType);
|
|
97
|
+
}, [selectedNodeType, documentation]);
|
|
98
|
+
|
|
99
|
+
const editor = useEditor(
|
|
100
|
+
{
|
|
101
|
+
extensions: [StarterKit, Markdown],
|
|
102
|
+
content: nodeDoc?.markdownDescription || '',
|
|
103
|
+
editable: false
|
|
104
|
+
},
|
|
105
|
+
[nodeDoc?.markdownDescription]
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const closePanel = useCallback(() => {
|
|
109
|
+
const currentLayout = sys.tabStore.getState().layout;
|
|
110
|
+
const newLayout = removeTabFromLayout(currentLayout, 'docbrowser');
|
|
111
|
+
sys.tabStore.getState().setLayout(newLayout);
|
|
112
|
+
}, [sys]);
|
|
113
|
+
|
|
114
|
+
useOnPressKey('Escape', closePanel);
|
|
115
|
+
|
|
116
|
+
if (!selectedNodeType) {
|
|
117
|
+
return (
|
|
118
|
+
<div className={styles.container}>
|
|
119
|
+
<div className={styles.empty}>
|
|
120
|
+
<div className={styles.emptyIcon}>📚</div>
|
|
121
|
+
<div className={styles.emptyText}>No documentation selected</div>
|
|
122
|
+
<div className={styles.emptySub}>
|
|
123
|
+
Click the info icon on a node to view its documentation
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const hasMarkdown = nodeDoc?.markdownDescription;
|
|
131
|
+
const hasShortDescription =
|
|
132
|
+
nodeDoc?.shortDescription || nodeSpec?.description;
|
|
133
|
+
const hasTags = nodeDoc?.tags && nodeDoc.tags.length > 0;
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<div className={styles.container}>
|
|
137
|
+
<div className={styles.header}>
|
|
138
|
+
<div className={styles.titleSection}>
|
|
139
|
+
{nodeDoc?.icon && (
|
|
140
|
+
<div className={styles.iconLarge}>{nodeDoc.icon}</div>
|
|
141
|
+
)}
|
|
142
|
+
<div>
|
|
143
|
+
<h2 className={styles.title}>
|
|
144
|
+
{nodeSpec?.label || selectedNodeType}
|
|
145
|
+
</h2>
|
|
146
|
+
<div className={styles.nodeType}>{selectedNodeType}</div>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
{hasTags && nodeDoc?.tags && (
|
|
150
|
+
<div className={styles.tags}>
|
|
151
|
+
{nodeDoc.tags.map((tag, index) => (
|
|
152
|
+
<span key={index} className={styles.tag}>
|
|
153
|
+
{tag}
|
|
154
|
+
</span>
|
|
155
|
+
))}
|
|
156
|
+
</div>
|
|
157
|
+
)}
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<div className={styles.content}>
|
|
161
|
+
{hasShortDescription && (
|
|
162
|
+
<div className={styles.description}>
|
|
163
|
+
{nodeDoc?.shortDescription || nodeSpec?.description}
|
|
164
|
+
</div>
|
|
165
|
+
)}
|
|
166
|
+
|
|
167
|
+
{hasMarkdown && nodeDoc?.markdownDescription ? (
|
|
168
|
+
<EditorContent editor={editor} />
|
|
169
|
+
) : (
|
|
170
|
+
<div className={styles.noContent}>
|
|
171
|
+
<p>No detailed documentation available for this node.</p>
|
|
172
|
+
</div>
|
|
173
|
+
)}
|
|
174
|
+
|
|
175
|
+
{nodeSpec && (
|
|
176
|
+
<>
|
|
177
|
+
<SocketSection
|
|
178
|
+
title="Inputs"
|
|
179
|
+
sockets={nodeSpec.inputs}
|
|
180
|
+
getIconForType={getIconForType}
|
|
181
|
+
getColorForType={getColorForType}
|
|
182
|
+
/>
|
|
183
|
+
<SocketSection
|
|
184
|
+
title="Outputs"
|
|
185
|
+
sockets={nodeSpec.outputs}
|
|
186
|
+
getIconForType={getIconForType}
|
|
187
|
+
getColorForType={getColorForType}
|
|
188
|
+
/>
|
|
189
|
+
<SocketSection
|
|
190
|
+
title="Configuration"
|
|
191
|
+
sockets={nodeSpec.configuration}
|
|
192
|
+
getIconForType={getIconForType}
|
|
193
|
+
getColorForType={getColorForType}
|
|
194
|
+
/>
|
|
195
|
+
</>
|
|
196
|
+
)}
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
@@ -1,200 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEditor, EditorContent } from '@tiptap/react';
|
|
3
|
-
import StarterKit from '@tiptap/starter-kit';
|
|
4
|
-
import { useSystem } from '@/system/provider';
|
|
5
|
-
import { Markdown } from 'tiptap-markdown';
|
|
6
|
-
import { useStore } from 'zustand';
|
|
7
|
-
import type { ExtendedNodeSpecJSON } from '@/components/contextMenus/NodePicker';
|
|
8
|
-
import { useOnPressKey } from '@/hooks/useOnPressKey';
|
|
9
|
-
import { removeTabFromLayout } from '@/components/layoutController/utils';
|
|
1
|
+
import { lazy, Suspense } from 'react';
|
|
10
2
|
import styles from './styles.module.css';
|
|
11
3
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const valueTypeColors = useStore(sys.legendStore, (x) => x.valueTypeColors);
|
|
23
|
-
|
|
24
|
-
const nodeSpec = useMemo((): ExtendedNodeSpecJSON | null => {
|
|
25
|
-
if (!selectedNodeType) return null;
|
|
26
|
-
return specs.find((s) => s.type === selectedNodeType) ?? null;
|
|
27
|
-
}, [selectedNodeType, specs]);
|
|
28
|
-
|
|
29
|
-
const getIconForType = useCallback(
|
|
30
|
-
(valueType: string) => {
|
|
31
|
-
const IconComponent = icons[valueType] || defaultIcon;
|
|
32
|
-
return IconComponent;
|
|
33
|
-
},
|
|
34
|
-
[icons, defaultIcon]
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
const getColorForType = useCallback(
|
|
38
|
-
(valueType: string) => {
|
|
39
|
-
return valueTypeColors[valueType] || '#6c727e';
|
|
40
|
-
},
|
|
41
|
-
[valueTypeColors]
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const nodeDoc = useMemo(() => {
|
|
45
|
-
if (!selectedNodeType) return null;
|
|
46
|
-
return documentation.get(selectedNodeType);
|
|
47
|
-
}, [selectedNodeType, documentation]);
|
|
48
|
-
|
|
49
|
-
const editor = useEditor(
|
|
50
|
-
{
|
|
51
|
-
extensions: [StarterKit, Markdown],
|
|
52
|
-
content: nodeDoc?.markdownDescription || '',
|
|
53
|
-
editable: false
|
|
54
|
-
},
|
|
55
|
-
[nodeDoc?.markdownDescription]
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
const closePanel = useCallback(() => {
|
|
59
|
-
const currentLayout = sys.tabStore.getState().layout;
|
|
60
|
-
const newLayout = removeTabFromLayout(currentLayout, 'docbrowser');
|
|
61
|
-
sys.tabStore.getState().setLayout(newLayout);
|
|
62
|
-
}, [sys]);
|
|
63
|
-
|
|
64
|
-
useOnPressKey('Escape', closePanel);
|
|
65
|
-
|
|
66
|
-
if (!selectedNodeType) {
|
|
67
|
-
return (
|
|
68
|
-
<div className={styles.container}>
|
|
69
|
-
<div className={styles.empty}>
|
|
70
|
-
<div className={styles.emptyIcon}>📚</div>
|
|
71
|
-
<div className={styles.emptyText}>No documentation selected</div>
|
|
72
|
-
<div className={styles.emptySub}>
|
|
73
|
-
Click the info icon on a node to view its documentation
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const hasMarkdown = nodeDoc?.markdownDescription;
|
|
81
|
-
const hasShortDescription =
|
|
82
|
-
nodeDoc?.shortDescription || nodeSpec?.description;
|
|
83
|
-
const hasTags = nodeDoc?.tags && nodeDoc.tags.length > 0;
|
|
4
|
+
/**
|
|
5
|
+
* The documentation panel embeds a tiptap/prosemirror editor (~320 KB) to render
|
|
6
|
+
* node markdown. Load it lazily so that weight only enters the bundle when the
|
|
7
|
+
* panel is actually opened.
|
|
8
|
+
*/
|
|
9
|
+
const LazyPanel = lazy(() =>
|
|
10
|
+
import('./DocumentationBrowserPanelImpl').then((m) => ({
|
|
11
|
+
default: m.DocumentationBrowserPanelImpl
|
|
12
|
+
}))
|
|
13
|
+
);
|
|
84
14
|
|
|
15
|
+
export function DocumentationBrowserPanel() {
|
|
85
16
|
return (
|
|
86
|
-
<div className={styles.container}>
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
{nodeDoc?.icon && (
|
|
90
|
-
<div className={styles.iconLarge}>{nodeDoc.icon}</div>
|
|
91
|
-
)}
|
|
92
|
-
<div>
|
|
93
|
-
<h2 className={styles.title}>
|
|
94
|
-
{nodeSpec?.label || selectedNodeType}
|
|
95
|
-
</h2>
|
|
96
|
-
<div className={styles.nodeType}>{selectedNodeType}</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
{hasTags && nodeDoc?.tags && (
|
|
100
|
-
<div className={styles.tags}>
|
|
101
|
-
{nodeDoc.tags.map((tag, index) => (
|
|
102
|
-
<span key={index} className={styles.tag}>
|
|
103
|
-
{tag}
|
|
104
|
-
</span>
|
|
105
|
-
))}
|
|
106
|
-
</div>
|
|
107
|
-
)}
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
<div className={styles.content}>
|
|
111
|
-
{hasShortDescription && (
|
|
112
|
-
<div className={styles.description}>
|
|
113
|
-
{nodeDoc?.shortDescription || nodeSpec?.description}
|
|
114
|
-
</div>
|
|
115
|
-
)}
|
|
116
|
-
|
|
117
|
-
{hasMarkdown && nodeDoc?.markdownDescription ? (
|
|
118
|
-
<EditorContent editor={editor} />
|
|
119
|
-
) : (
|
|
120
|
-
<div className={styles.noContent}>
|
|
121
|
-
<p>No detailed documentation available for this node.</p>
|
|
122
|
-
</div>
|
|
123
|
-
)}
|
|
124
|
-
|
|
125
|
-
{nodeSpec && (
|
|
126
|
-
<>
|
|
127
|
-
{nodeSpec.inputs && nodeSpec.inputs.length > 0 && (
|
|
128
|
-
<div className={styles.section}>
|
|
129
|
-
<h3 className={styles.sectionTitle}>Inputs</h3>
|
|
130
|
-
<div className={styles.socketList}>
|
|
131
|
-
{nodeSpec.inputs.map((input, index) => {
|
|
132
|
-
const IconComponent = getIconForType(input.valueType);
|
|
133
|
-
const color = getColorForType(input.valueType);
|
|
134
|
-
return (
|
|
135
|
-
<div key={index} className={styles.socketItem}>
|
|
136
|
-
<div className={styles.socketIcon} style={{ color }}>
|
|
137
|
-
<IconComponent />
|
|
138
|
-
</div>
|
|
139
|
-
<div className={styles.socketName}>{input.name}</div>
|
|
140
|
-
<div className={styles.socketType} style={{ color }}>
|
|
141
|
-
{input.valueType}
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
);
|
|
145
|
-
})}
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
148
|
-
)}
|
|
149
|
-
|
|
150
|
-
{nodeSpec.outputs && nodeSpec.outputs.length > 0 && (
|
|
151
|
-
<div className={styles.section}>
|
|
152
|
-
<h3 className={styles.sectionTitle}>Outputs</h3>
|
|
153
|
-
<div className={styles.socketList}>
|
|
154
|
-
{nodeSpec.outputs.map((output, index) => {
|
|
155
|
-
const IconComponent = getIconForType(output.valueType);
|
|
156
|
-
const color = getColorForType(output.valueType);
|
|
157
|
-
return (
|
|
158
|
-
<div key={index} className={styles.socketItem}>
|
|
159
|
-
<div className={styles.socketIcon} style={{ color }}>
|
|
160
|
-
<IconComponent />
|
|
161
|
-
</div>
|
|
162
|
-
<div className={styles.socketName}>{output.name}</div>
|
|
163
|
-
<div className={styles.socketType} style={{ color }}>
|
|
164
|
-
{output.valueType}
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
);
|
|
168
|
-
})}
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
171
|
-
)}
|
|
172
|
-
|
|
173
|
-
{nodeSpec.configuration && nodeSpec.configuration.length > 0 && (
|
|
174
|
-
<div className={styles.section}>
|
|
175
|
-
<h3 className={styles.sectionTitle}>Configuration</h3>
|
|
176
|
-
<div className={styles.socketList}>
|
|
177
|
-
{nodeSpec.configuration.map((config, index) => {
|
|
178
|
-
const IconComponent = getIconForType(config.valueType);
|
|
179
|
-
const color = getColorForType(config.valueType);
|
|
180
|
-
return (
|
|
181
|
-
<div key={index} className={styles.socketItem}>
|
|
182
|
-
<div className={styles.socketIcon} style={{ color }}>
|
|
183
|
-
<IconComponent />
|
|
184
|
-
</div>
|
|
185
|
-
<div className={styles.socketName}>{config.name}</div>
|
|
186
|
-
<div className={styles.socketType} style={{ color }}>
|
|
187
|
-
{config.valueType}
|
|
188
|
-
</div>
|
|
189
|
-
</div>
|
|
190
|
-
);
|
|
191
|
-
})}
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
)}
|
|
195
|
-
</>
|
|
196
|
-
)}
|
|
197
|
-
</div>
|
|
198
|
-
</div>
|
|
17
|
+
<Suspense fallback={<div className={styles.container} />}>
|
|
18
|
+
<LazyPanel />
|
|
19
|
+
</Suspense>
|
|
199
20
|
);
|
|
200
21
|
}
|