@eccenca/gui-elements 23.2.0 → 23.3.0-rc.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/CHANGELOG.md +38 -0
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +5 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +9 -11
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/cjs/cmem/react-flow/extensions/ReactFlowHotkeyContext.js +12 -0
- package/dist/cjs/cmem/react-flow/extensions/ReactFlowHotkeyContext.js.map +1 -0
- package/dist/cjs/components/Application/ApplicationHeader.js +2 -3
- package/dist/cjs/components/Application/ApplicationHeader.js.map +1 -1
- package/dist/cjs/components/Dialog/Modal.js +17 -8
- package/dist/cjs/components/Dialog/Modal.js.map +1 -1
- package/dist/cjs/components/Dialog/SimpleDialog.js +15 -2
- package/dist/cjs/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/cjs/components/Icon/IconButton.js +1 -1
- package/dist/cjs/components/Icon/IconButton.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +1 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js +3 -6
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/cjs/components/PropertyValuePair/PropertyName.js +3 -3
- package/dist/cjs/components/PropertyValuePair/PropertyName.js.map +1 -1
- package/dist/cjs/components/Separation/Spacing.js +18 -4
- package/dist/cjs/components/Separation/Spacing.js.map +1 -1
- package/dist/cjs/components/TextField/TextField.js +23 -3
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +39 -7
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +26 -5
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js +27 -0
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js.map +1 -0
- package/dist/cjs/extensions/react-flow/index.js +2 -0
- package/dist/cjs/extensions/react-flow/index.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +25 -5
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/esm/cmem/markdown/Markdown.js +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +5 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +9 -11
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/esm/cmem/react-flow/extensions/ReactFlowHotkeyContext.js +6 -0
- package/dist/esm/cmem/react-flow/extensions/ReactFlowHotkeyContext.js.map +1 -0
- package/dist/esm/components/Application/ApplicationHeader.js +2 -3
- package/dist/esm/components/Application/ApplicationHeader.js.map +1 -1
- package/dist/esm/components/Dialog/Modal.js +18 -9
- package/dist/esm/components/Dialog/Modal.js.map +1 -1
- package/dist/esm/components/Dialog/SimpleDialog.js +14 -1
- package/dist/esm/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/esm/components/Icon/IconButton.js +1 -1
- package/dist/esm/components/Icon/IconButton.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +1 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js +3 -6
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/esm/components/PropertyValuePair/PropertyName.js +3 -3
- package/dist/esm/components/PropertyValuePair/PropertyName.js.map +1 -1
- package/dist/esm/components/Separation/Spacing.js +28 -4
- package/dist/esm/components/Separation/Spacing.js.map +1 -1
- package/dist/esm/components/TextField/TextField.js +25 -5
- package/dist/esm/components/TextField/TextField.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +49 -6
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +45 -8
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleTools.js +31 -0
- package/dist/esm/extensions/react-flow/handles/HandleTools.js.map +1 -0
- package/dist/esm/extensions/react-flow/index.js +2 -0
- package/dist/esm/extensions/react-flow/index.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js +32 -12
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/types/cmem/react-flow/extensions/ReactFlowHotkeyContext.d.ts +8 -0
- package/dist/types/components/Application/ApplicationHeader.d.ts +1 -2
- package/dist/types/components/Dialog/Modal.d.ts +13 -6
- package/dist/types/components/Dialog/SimpleDialog.d.ts +12 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/components/PropertyValuePair/PropertyName.d.ts +7 -1
- package/dist/types/components/Separation/Spacing.d.ts +2 -2
- package/dist/types/components/TextField/TextField.d.ts +4 -2
- package/dist/types/extensions/codemirror/CodeMirror.d.ts +17 -3
- package/dist/types/extensions/react-flow/handles/HandleDefault.d.ts +2 -2
- package/dist/types/extensions/react-flow/handles/HandleTools.d.ts +6 -0
- package/dist/types/extensions/react-flow/index.d.ts +2 -0
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +21 -1
- package/package.json +14 -12
- package/scripts/compile-sass.ts +1 -1
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +10 -0
- package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +10 -12
- package/src/cmem/react-flow/extensions/ReactFlowHotkeyContext.ts +14 -0
- package/src/components/Application/ApplicationHeader.tsx +8 -13
- package/src/components/Application/_header.scss +17 -17
- package/src/components/Application/_toolbar.scss +22 -33
- package/src/components/AutoSuggestion/tests/AutoSuggestion.test.tsx +34 -21
- package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +20 -9
- package/src/components/Dialog/Modal.tsx +62 -37
- package/src/components/Dialog/SimpleDialog.tsx +19 -1
- package/src/components/Dialog/dialog.scss +29 -17
- package/src/components/Icon/IconButton.tsx +1 -1
- package/src/components/Icon/canonicalIconNames.tsx +2 -0
- package/src/components/OverviewItem/OverviewItemDepiction.tsx +8 -16
- package/src/components/PropertyValuePair/PropertyName.tsx +15 -4
- package/src/components/Separation/Spacing.tsx +12 -8
- package/src/components/TextField/TextField.tsx +32 -6
- package/src/components/Tooltip/tooltip.scss +15 -1
- package/src/extensions/codemirror/CodeMirror.tsx +62 -8
- package/src/extensions/codemirror/_codemirror.scss +53 -8
- package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +43 -44
- package/src/extensions/react-flow/handles/HandleDefault.tsx +40 -33
- package/src/extensions/react-flow/handles/HandleTools.tsx +22 -0
- package/src/extensions/react-flow/handles/_handles.scss +64 -44
- package/src/extensions/react-flow/handles/stories/HandleDefault.stories.tsx +33 -27
- package/src/extensions/react-flow/index.ts +2 -0
- package/src/extensions/react-flow/nodes/NodeContent.tsx +62 -2
- package/src/extensions/react-flow/nodes/_nodes.scss +170 -110
- package/src/extensions/react-flow/nodes/stories/NodeDefault.stories.tsx +32 -34
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Elements } from 'react-flow-renderer';
|
|
1
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { Elements } from "react-flow-renderer";
|
|
3
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
5
4
|
|
|
6
|
-
import {
|
|
5
|
+
import { ReactFlow } from "./../../../../cmem";
|
|
7
6
|
import { NodeContent } from "./../NodeContent";
|
|
7
|
+
import { NodeDefault } from "./../NodeDefault";
|
|
8
8
|
import { nodeTypes } from "./../nodeTypes";
|
|
9
9
|
import { Default as NodeContentExample } from "./NodeContent.stories";
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
|
-
title: "Extensions/React Flow/
|
|
12
|
+
title: "Extensions/React Flow/Node",
|
|
13
13
|
component: NodeDefault,
|
|
14
14
|
subcomponents: { NodeContent },
|
|
15
15
|
argTypes: {
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
type: { required: true },
|
|
22
22
|
description: "Position on React-Flow canvas.",
|
|
23
23
|
table: {
|
|
24
|
-
type: { summary: "XYPosition" }
|
|
24
|
+
type: { summary: "XYPosition" },
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
type: {
|
|
@@ -29,34 +29,34 @@ export default {
|
|
|
29
29
|
description: "Key of the imported and connected `nodeTypes` to specify what node implementation is used.",
|
|
30
30
|
table: {
|
|
31
31
|
type: { summary: "string" },
|
|
32
|
-
defaultValue: { summary: "default" }
|
|
32
|
+
defaultValue: { summary: "default" },
|
|
33
33
|
},
|
|
34
34
|
options: Object.keys(nodeTypes),
|
|
35
|
-
mapping: Object.fromEntries(Object.keys(nodeTypes).map(type => [type, type])),
|
|
35
|
+
mapping: Object.fromEntries(Object.keys(nodeTypes).map((type) => [type, type])),
|
|
36
36
|
},
|
|
37
37
|
style: {
|
|
38
38
|
control: "object",
|
|
39
39
|
description: "css properties",
|
|
40
40
|
table: {
|
|
41
|
-
type: { summary: "React.CSSProperties" }
|
|
41
|
+
type: { summary: "React.CSSProperties" },
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
className: {
|
|
45
45
|
control: "text",
|
|
46
|
-
description: "additional class name"
|
|
46
|
+
description: "additional class name",
|
|
47
47
|
},
|
|
48
48
|
targetPosition: {
|
|
49
49
|
description: "'left' | 'right' | 'top' | 'bottom' handle position",
|
|
50
50
|
table: {
|
|
51
51
|
type: { summary: "Position" },
|
|
52
|
-
defaultValue: { summary: "Position.Left" }
|
|
52
|
+
defaultValue: { summary: "Position.Left" },
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
sourcePosition: {
|
|
56
56
|
description: "'left' | 'right' | 'top' | 'bottom' handle position",
|
|
57
57
|
table: {
|
|
58
58
|
type: { summary: "Position" },
|
|
59
|
-
defaultValue: { summary: "Position.Right" }
|
|
59
|
+
defaultValue: { summary: "Position.Right" },
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
62
|
isHidden: {
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
64
64
|
description: "if true, the node will not be rendered",
|
|
65
65
|
table: {
|
|
66
66
|
type: { summary: "boolean" },
|
|
67
|
-
defaultValue: { summary: "false" }
|
|
67
|
+
defaultValue: { summary: "false" },
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
draggable: {
|
|
@@ -72,7 +72,7 @@ export default {
|
|
|
72
72
|
description: "if option is not set, the node is draggable (overwrites general nodesDraggable option)",
|
|
73
73
|
table: {
|
|
74
74
|
type: { summary: "boolean" },
|
|
75
|
-
defaultValue: { summary: "true" }
|
|
75
|
+
defaultValue: { summary: "true" },
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
78
|
connectable: {
|
|
@@ -80,7 +80,7 @@ export default {
|
|
|
80
80
|
description: "if option is not set, the node is connectable (overwrites general nodesConnectable option)",
|
|
81
81
|
table: {
|
|
82
82
|
type: { summary: "boolean" },
|
|
83
|
-
defaultValue: { summary: "true" }
|
|
83
|
+
defaultValue: { summary: "true" },
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
86
|
selectable: {
|
|
@@ -88,12 +88,12 @@ export default {
|
|
|
88
88
|
description: "if option is not set, the node is selectable (overwrites general elementsSelectable option)",
|
|
89
89
|
table: {
|
|
90
90
|
type: { summary: "boolean" },
|
|
91
|
-
defaultValue: { summary: "true" }
|
|
91
|
+
defaultValue: { summary: "true" },
|
|
92
92
|
},
|
|
93
93
|
},
|
|
94
94
|
dragHandle: {
|
|
95
95
|
control: "text",
|
|
96
|
-
description: "selector for specifying an element as a drag handle"
|
|
96
|
+
description: "selector for specifying an element as a drag handle",
|
|
97
97
|
},
|
|
98
98
|
},
|
|
99
99
|
} as ComponentMeta<typeof NodeDefault>;
|
|
@@ -104,9 +104,7 @@ const NodeDefaultExample = (args: any) => {
|
|
|
104
104
|
//const [edgeTools, setEdgeTools] = useState<JSX.Element>(<></>);
|
|
105
105
|
|
|
106
106
|
useEffect(() => {
|
|
107
|
-
setElements([
|
|
108
|
-
args
|
|
109
|
-
] as Elements);
|
|
107
|
+
setElements([args] as Elements);
|
|
110
108
|
}, [args]);
|
|
111
109
|
|
|
112
110
|
const onLoad = useCallback(
|
|
@@ -118,23 +116,23 @@ const NodeDefaultExample = (args: any) => {
|
|
|
118
116
|
[reactflowInstance]
|
|
119
117
|
);
|
|
120
118
|
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
return (
|
|
120
|
+
<ReactFlow
|
|
121
|
+
elements={elements}
|
|
122
|
+
style={{ height: "400px" }}
|
|
123
|
+
onLoad={onLoad}
|
|
124
|
+
nodeTypes={nodeTypes}
|
|
125
|
+
defaultZoom={1}
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
129
|
|
|
130
|
-
const Template: ComponentStory<typeof NodeDefault> = (args) =>
|
|
131
|
-
<NodeDefaultExample {...args} /*some comment*/ />
|
|
132
|
-
);
|
|
130
|
+
const Template: ComponentStory<typeof NodeDefault> = (args) => <NodeDefaultExample {...args} /*some comment*/ />;
|
|
133
131
|
|
|
134
132
|
export const Default = Template.bind({});
|
|
135
133
|
Default.args = {
|
|
136
|
-
id:
|
|
137
|
-
type:
|
|
134
|
+
id: "1",
|
|
135
|
+
type: "default",
|
|
138
136
|
data: NodeContentExample.args,
|
|
139
137
|
position: { x: 50, y: 50 },
|
|
140
138
|
};
|