@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import { useStore } from 'zustand';
|
|
3
3
|
import { Variable } from '@kiberon-labs/behave-graph';
|
|
4
|
-
import {
|
|
4
|
+
import { useActiveGraph } from '@/system/provider';
|
|
5
5
|
import {
|
|
6
6
|
VscodeButton,
|
|
7
7
|
VscodeTextfield,
|
|
@@ -18,8 +18,8 @@ type Props = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export function CreateVariableScreen({ onBack, onCancel, onCreated }: Props) {
|
|
21
|
-
const system =
|
|
22
|
-
const registry = useStore(system.registry);
|
|
21
|
+
const system = useActiveGraph()!;
|
|
22
|
+
const registry = useStore(system.editor.registry);
|
|
23
23
|
const setVariable = useStore(system.variableStore, (x) => x.setVariable);
|
|
24
24
|
const controls = useStore(system.controlStore, (x) => x.controls);
|
|
25
25
|
const defaultControl = useStore(system.controlStore, (x) => x.defaultControl);
|
|
@@ -8,9 +8,10 @@ import {
|
|
|
8
8
|
} from '@vscode-elements/react-elements';
|
|
9
9
|
import { Plus, TrashSolid } from 'iconoir-react';
|
|
10
10
|
import styles from './styles.module.css';
|
|
11
|
-
import {
|
|
11
|
+
import { useActiveGraph } from '@/system';
|
|
12
12
|
import { useStore } from 'zustand';
|
|
13
13
|
import { Icon } from '@/components/primitives/icon';
|
|
14
|
+
import { PanelHeader } from '../common/PanelHeader';
|
|
14
15
|
|
|
15
16
|
type ValueControlProps = {
|
|
16
17
|
value: any;
|
|
@@ -43,8 +44,8 @@ export function ManageVariablesScreen({
|
|
|
43
44
|
SelectedVarControlComponent,
|
|
44
45
|
onUpdateVariable
|
|
45
46
|
}: Props) {
|
|
46
|
-
const system =
|
|
47
|
-
const icons = useStore(system.legendStore, (x) => x.icons);
|
|
47
|
+
const system = useActiveGraph()!;
|
|
48
|
+
const icons = useStore(system.editor.legendStore, (x) => x.icons);
|
|
48
49
|
const variables = useStore(system.variableStore, (x) => x.variables);
|
|
49
50
|
|
|
50
51
|
const handleTreeSelect = (ev: unknown) => {
|
|
@@ -62,12 +63,14 @@ export function ManageVariablesScreen({
|
|
|
62
63
|
|
|
63
64
|
return (
|
|
64
65
|
<div className={styles.root}>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
<PanelHeader
|
|
67
|
+
title="Variables"
|
|
68
|
+
actions={
|
|
69
|
+
<Icon title="New variable" onClick={onNewVariable}>
|
|
70
|
+
<Plus />
|
|
71
|
+
</Icon>
|
|
72
|
+
}
|
|
73
|
+
/>
|
|
71
74
|
<VscodeDivider />
|
|
72
75
|
|
|
73
76
|
<div className={styles.variableList}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useActiveGraph } from '@/system/provider';
|
|
3
3
|
import { useStore } from 'zustand';
|
|
4
4
|
import { CreateVariableScreen } from './CreateVariableScreen';
|
|
5
5
|
import { ManageVariablesScreen } from './ManageVariablesScreen';
|
|
@@ -8,7 +8,7 @@ import { BasePanel } from '../base';
|
|
|
8
8
|
type VariablesPanelScreen = 'manage' | 'create';
|
|
9
9
|
|
|
10
10
|
export function VariablesPanel() {
|
|
11
|
-
const system =
|
|
11
|
+
const system = useActiveGraph()!;
|
|
12
12
|
const variables = useStore(system.variableStore, (x) => x.variables);
|
|
13
13
|
const setVariable = useStore(system.variableStore, (x) => x.setVariable);
|
|
14
14
|
const removeVariable = useStore(
|
|
@@ -7,30 +7,12 @@
|
|
|
7
7
|
overflow: hidden;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.header {
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: space-between;
|
|
14
|
-
padding: 12px 16px;
|
|
15
|
-
background: var(--vscode-sideBar-background, var(--colors-bgPanel));
|
|
16
|
-
flex-shrink: 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.headerTitle {
|
|
20
|
-
font-size: 1.1em;
|
|
21
|
-
font-weight: bold;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
10
|
.headerRow {
|
|
25
11
|
display: flex;
|
|
26
12
|
align-items: center;
|
|
27
13
|
justify-content: space-between;
|
|
28
14
|
}
|
|
29
15
|
|
|
30
|
-
.headerRowPadded {
|
|
31
|
-
padding: 0.25em;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
16
|
.section {
|
|
35
17
|
display: flex;
|
|
36
18
|
flex-direction: column;
|
|
@@ -79,23 +61,6 @@
|
|
|
79
61
|
gap: 0.25em;
|
|
80
62
|
}
|
|
81
63
|
|
|
82
|
-
.list {
|
|
83
|
-
display: flex;
|
|
84
|
-
flex-direction: column;
|
|
85
|
-
gap: 0.25em;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.listItem {
|
|
89
|
-
display: flex;
|
|
90
|
-
gap: 0.25em;
|
|
91
|
-
align-items: center;
|
|
92
|
-
padding: 0.25em;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.listItemContent {
|
|
96
|
-
flex: 1;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
64
|
.tree {
|
|
100
65
|
display: block;
|
|
101
66
|
}
|
|
@@ -127,70 +92,18 @@
|
|
|
127
92
|
flex: 1;
|
|
128
93
|
}
|
|
129
94
|
|
|
130
|
-
.treeItemName {
|
|
131
|
-
font-size: 13px;
|
|
132
|
-
font-weight: 500;
|
|
133
|
-
line-height: 1.4;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.treeItemMeta {
|
|
137
|
-
font-size: 11px;
|
|
138
|
-
opacity: 0.6;
|
|
139
|
-
line-height: 1.2;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
.treeItemRow {
|
|
145
|
-
display: flex;
|
|
146
|
-
align-items: center;
|
|
147
|
-
gap: 12px;
|
|
148
|
-
width: 100%;
|
|
149
|
-
padding: 8px 12px;
|
|
150
|
-
min-height: 44px;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.treeItemText {
|
|
154
|
-
flex: 1;
|
|
155
|
-
min-width: 0;
|
|
156
|
-
display: flex;
|
|
157
|
-
flex-direction: column;
|
|
158
|
-
gap: 4px;
|
|
159
|
-
justify-content: center;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.treeItemTitle {
|
|
163
|
-
font-weight: 500;
|
|
164
|
-
font-size: 13px;
|
|
165
|
-
line-height: 1.3;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.treeItemID {
|
|
169
|
-
font-size: 0.8em;
|
|
170
|
-
opacity: 0.7;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.treeItemSub {
|
|
174
|
-
font-size: 11px;
|
|
175
|
-
opacity: 0.6;
|
|
176
|
-
line-height: 1.2;
|
|
177
|
-
white-space: nowrap;
|
|
178
|
-
overflow: hidden;
|
|
179
|
-
text-overflow: ellipsis;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
95
|
.selectedEditor {
|
|
183
96
|
display: flex;
|
|
184
97
|
flex-direction: column;
|
|
185
98
|
gap: 0;
|
|
186
|
-
border-top: 1px solid var(--
|
|
187
|
-
background: var(--
|
|
99
|
+
border-top: 1px solid var(--ds-panel-border, rgba(255, 255, 255, 0.1));
|
|
100
|
+
background: var(--ds-sidebar-bg, var(--colors-bgPanel));
|
|
188
101
|
flex-shrink: 0;
|
|
189
102
|
}
|
|
190
103
|
|
|
191
104
|
.editorHeader {
|
|
192
105
|
padding: 12px 16px;
|
|
193
|
-
border-bottom: 1px solid var(--
|
|
106
|
+
border-bottom: 1px solid var(--ds-panel-border, rgba(255, 255, 255, 0.08));
|
|
194
107
|
}
|
|
195
108
|
|
|
196
109
|
.editorTitle {
|
|
@@ -232,5 +145,5 @@
|
|
|
232
145
|
justify-content: end;
|
|
233
146
|
gap: 0.5em;
|
|
234
147
|
padding: 12px 16px;
|
|
235
|
-
border-top: 1px solid var(--
|
|
148
|
+
border-top: 1px solid var(--ds-panel-border, rgba(255, 255, 255, 0.08));
|
|
236
149
|
}
|
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
background: transparent;
|
|
6
6
|
border: none;
|
|
7
7
|
cursor: pointer;
|
|
8
|
-
color: var(--
|
|
8
|
+
color: var(--ds-icon-fg, #cccccc);
|
|
9
9
|
padding: 0;
|
|
10
10
|
border-radius: 5px;
|
|
11
11
|
transition: background-color 0.1s ease;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.icon:hover:not(.disabled) {
|
|
15
|
-
background-color: var(--
|
|
15
|
+
background-color: var(--ds-toolbar-hover-bg);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.icon:active:not(.disabled) {
|
|
19
|
-
background-color: var(--
|
|
19
|
+
background-color: var(--ds-toolbar-active-bg);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.icon:focus-visible {
|
|
23
|
-
outline: 1px solid var(--
|
|
23
|
+
outline: 1px solid var(--ds-focus-border);
|
|
24
24
|
outline-offset: -1px;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -19,6 +19,7 @@ export type InputSocketProps = {
|
|
|
19
19
|
hideName?: boolean;
|
|
20
20
|
connected: boolean;
|
|
21
21
|
value: any | undefined;
|
|
22
|
+
label?: string;
|
|
22
23
|
onChange: (key: string, value: any) => void;
|
|
23
24
|
specJSON: NodeSpecJSON[];
|
|
24
25
|
} & InputSocketSpecJSON;
|
|
@@ -28,12 +29,15 @@ const InputSocket: React.FC<InputSocketProps> = ({
|
|
|
28
29
|
specJSON,
|
|
29
30
|
hideName,
|
|
30
31
|
hide,
|
|
32
|
+
label,
|
|
31
33
|
...rest
|
|
32
34
|
}) => {
|
|
33
35
|
const { name, valueType } = rest;
|
|
34
36
|
const instance = useReactFlow();
|
|
35
37
|
const sys = useSystem();
|
|
36
38
|
const { valueTypeColors, icons, defaultIcon } = useStore(sys.legendStore);
|
|
39
|
+
const autoConvert = useStore(sys.systemSettings, (s) => s.autoConvert);
|
|
40
|
+
const conversions = useStore(sys.conversionStore, (s) => s.conversions);
|
|
37
41
|
const Icon = icons[valueType] ?? defaultIcon;
|
|
38
42
|
|
|
39
43
|
const isFlowSocket = valueType === 'flow';
|
|
@@ -48,7 +52,7 @@ const InputSocket: React.FC<InputSocketProps> = ({
|
|
|
48
52
|
return (
|
|
49
53
|
<div className={cx(styles.row, hide ? styles.hidden : undefined)}>
|
|
50
54
|
{isFlowSocket && <NavArrowRightSolid />}
|
|
51
|
-
{showName && <div className={styles.name}>{name}</div>}
|
|
55
|
+
{showName && <div className={styles.name}>{label ?? name}</div>}
|
|
52
56
|
|
|
53
57
|
<Handle
|
|
54
58
|
id={name}
|
|
@@ -64,7 +68,10 @@ const InputSocket: React.FC<InputSocketProps> = ({
|
|
|
64
68
|
connected ? undefined : styles.disconnected
|
|
65
69
|
)}
|
|
66
70
|
isValidConnection={(connection: Connection) =>
|
|
67
|
-
isValidConnection(connection, instance, specJSON
|
|
71
|
+
isValidConnection(connection, instance, specJSON, {
|
|
72
|
+
autoConvert,
|
|
73
|
+
conversions
|
|
74
|
+
})
|
|
68
75
|
}
|
|
69
76
|
>
|
|
70
77
|
<Icon />
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
flex-grow: 1;
|
|
4
4
|
align-items: center;
|
|
5
5
|
justify-content: flex-start;
|
|
6
|
-
height: 1.
|
|
6
|
+
height: 1.375rem;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.hidden {
|
|
@@ -22,6 +22,5 @@
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.disconnected {
|
|
25
|
-
|
|
26
|
-
background: #333 !important;
|
|
25
|
+
background: var(--ds-widget-bg, #333) !important;
|
|
27
26
|
}
|
|
@@ -13,6 +13,7 @@ import styles from './styles.module.css';
|
|
|
13
13
|
export type OutputSocketProps = {
|
|
14
14
|
connected: boolean;
|
|
15
15
|
hide?: boolean;
|
|
16
|
+
label?: string;
|
|
16
17
|
specJSON: NodeSpecJSON[];
|
|
17
18
|
} & OutputSocketSpecJSON;
|
|
18
19
|
|
|
@@ -21,11 +22,14 @@ export default function OutputSocket({
|
|
|
21
22
|
connected,
|
|
22
23
|
hide,
|
|
23
24
|
valueType,
|
|
24
|
-
name
|
|
25
|
+
name,
|
|
26
|
+
label
|
|
25
27
|
}: OutputSocketProps) {
|
|
26
28
|
const instance = useReactFlow();
|
|
27
29
|
const sys = useSystem();
|
|
28
30
|
const { valueTypeColors, icons, defaultIcon } = useStore(sys.legendStore);
|
|
31
|
+
const autoConvert = useStore(sys.systemSettings, (s) => s.autoConvert);
|
|
32
|
+
const conversions = useStore(sys.conversionStore, (s) => s.conversions);
|
|
29
33
|
const Icon = icons[valueType] ?? defaultIcon;
|
|
30
34
|
|
|
31
35
|
const isFlowSocket = valueType === 'flow';
|
|
@@ -38,7 +42,7 @@ export default function OutputSocket({
|
|
|
38
42
|
|
|
39
43
|
return (
|
|
40
44
|
<div className={cx(styles.row, hide ? styles.hidden : undefined)}>
|
|
41
|
-
{showName && <div className={styles.name}>{name}</div>}
|
|
45
|
+
{showName && <div className={styles.name}>{label ?? name}</div>}
|
|
42
46
|
{isFlowSocket && <NavArrowRightSolid />}
|
|
43
47
|
|
|
44
48
|
<Handle
|
|
@@ -51,7 +55,10 @@ export default function OutputSocket({
|
|
|
51
55
|
}}
|
|
52
56
|
className={cx(styles.socket)}
|
|
53
57
|
isValidConnection={(connection: Connection) =>
|
|
54
|
-
isValidConnection(connection, instance, specJSON
|
|
58
|
+
isValidConnection(connection, instance, specJSON, {
|
|
59
|
+
autoConvert,
|
|
60
|
+
conversions
|
|
61
|
+
})
|
|
55
62
|
}
|
|
56
63
|
>
|
|
57
64
|
<Icon />
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
flex-grow: 1;
|
|
4
4
|
align-items: center;
|
|
5
5
|
justify-content: flex-end;
|
|
6
|
-
height: 1.
|
|
6
|
+
height: 1.375rem;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.hidden {
|
|
@@ -19,9 +19,4 @@
|
|
|
19
19
|
|
|
20
20
|
.socket svg {
|
|
21
21
|
stroke: currentColor;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.disconnected {
|
|
25
|
-
/* Tailwind `bg-gray-800` equivalent */
|
|
26
|
-
background: #333 !important;
|
|
27
22
|
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Markdown note nodes (notes plugin). Global classes rather than a CSS module:
|
|
3
|
+
* the note component is lazy-loaded, and the bundler emits a lazy chunk's CSS
|
|
4
|
+
* module into a separate dist asset that hosts never load — only the entry CSS
|
|
5
|
+
* (dist/index.css) ships. Rich-text content styling comes from the shared
|
|
6
|
+
* .ProseMirror rules in prosemirror.css.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
.notes-node-root {
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
min-width: 160px;
|
|
14
|
+
min-height: 80px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.notes-node {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
background: var(--ds-editor-bg);
|
|
21
|
+
color: var(--ds-editor-fg);
|
|
22
|
+
border: 1px solid var(--ds-blockquote-border);
|
|
23
|
+
border-radius: 2px;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.notes-node__header {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: 6px;
|
|
33
|
+
padding: 2px 8px;
|
|
34
|
+
background: var(--colors-bgSurface);
|
|
35
|
+
border-bottom: 1px solid var(--ds-border-subtle);
|
|
36
|
+
color: var(--ds-fg);
|
|
37
|
+
cursor: grab;
|
|
38
|
+
user-select: none;
|
|
39
|
+
font-size: 10px;
|
|
40
|
+
letter-spacing: 0.08em;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.notes-node__grip {
|
|
45
|
+
opacity: 0.6;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.notes-node__editor {
|
|
49
|
+
flex: 1;
|
|
50
|
+
padding: 4px 10px;
|
|
51
|
+
cursor: text;
|
|
52
|
+
overflow: auto;
|
|
53
|
+
color: var(--ds-editor-fg);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.notes-node__editor .ProseMirror {
|
|
57
|
+
outline: none;
|
|
58
|
+
min-height: 100%;
|
|
59
|
+
caret-color: var(--ds-editor-fg);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.notes-node__editor .ProseMirror blockquote {
|
|
63
|
+
border-left: 3px solid var(--ds-blockquote-border);
|
|
64
|
+
padding-left: 1em;
|
|
65
|
+
margin: 0.5em 0;
|
|
66
|
+
font-style: italic;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Embedded videos (tiptap youtube extension) scale to the note width. */
|
|
70
|
+
.notes-node__editor .ProseMirror div[data-youtube-video] {
|
|
71
|
+
margin: 0.5em 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.notes-node__editor .ProseMirror div[data-youtube-video] iframe {
|
|
75
|
+
display: block;
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: auto;
|
|
78
|
+
aspect-ratio: 16 / 9;
|
|
79
|
+
border: 0;
|
|
80
|
+
border-radius: 3px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.notes-toolbar {
|
|
84
|
+
position: absolute;
|
|
85
|
+
bottom: calc(100% + 8px);
|
|
86
|
+
left: 50%;
|
|
87
|
+
transform: translateX(-50%);
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
gap: 4px;
|
|
91
|
+
background: var(--ds-widget-bg);
|
|
92
|
+
border: 1px solid var(--ds-border-subtle);
|
|
93
|
+
border-radius: 4px;
|
|
94
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
95
|
+
padding: 4px;
|
|
96
|
+
z-index: 1000;
|
|
97
|
+
animation: notes-toolbar-fade-in 0.15s ease;
|
|
98
|
+
pointer-events: auto;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.notes-toolbar__row {
|
|
102
|
+
display: flex;
|
|
103
|
+
gap: 2px;
|
|
104
|
+
align-items: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.notes-toolbar__embed {
|
|
108
|
+
display: flex;
|
|
109
|
+
gap: 4px;
|
|
110
|
+
align-items: center;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.notes-toolbar__embed vscode-textfield {
|
|
114
|
+
flex: 1;
|
|
115
|
+
min-width: 220px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@keyframes notes-toolbar-fade-in {
|
|
119
|
+
from {
|
|
120
|
+
opacity: 0;
|
|
121
|
+
transform: translateX(-50%) translateY(-5px);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
to {
|
|
125
|
+
opacity: 1;
|
|
126
|
+
transform: translateX(-50%) translateY(0);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.notes-toolbar__separator {
|
|
131
|
+
width: 1px;
|
|
132
|
+
height: 20px;
|
|
133
|
+
background: var(--ds-border-subtle);
|
|
134
|
+
margin: 0 4px;
|
|
135
|
+
}
|
package/src/css/prosemirror.css
CHANGED
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
code {
|
|
31
|
-
background: var(--
|
|
31
|
+
background: var(--ds-code-bg);
|
|
32
32
|
padding: 0.125em 0.25em;
|
|
33
33
|
border-radius: 3px;
|
|
34
|
-
font-family: var(--
|
|
34
|
+
font-family: var(--ds-font-mono);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
pre {
|
|
38
|
-
background: var(--
|
|
38
|
+
background: var(--ds-code-bg);
|
|
39
39
|
padding: 0.75em;
|
|
40
40
|
border-radius: 4px;
|
|
41
41
|
overflow-x: auto;
|