@eccenca/gui-elements 23.2.0 → 23.3.0-rc.1
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 +53 -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/common/index.js +5 -2
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/common/utils/globalVars.js +21 -0
- package/dist/cjs/common/utils/globalVars.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 +35 -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/Table/TableExpandHeader.js +7 -8
- package/dist/cjs/components/Table/TableExpandHeader.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/edges/EdgeLabel.js +10 -9
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js +4 -4
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +56 -6
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js +41 -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 +42 -13
- 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/common/index.js +5 -2
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/common/utils/globalVars.js +16 -0
- package/dist/esm/common/utils/globalVars.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 +36 -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/Table/TableExpandHeader.js +7 -8
- package/dist/esm/components/Table/TableExpandHeader.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/edges/EdgeLabel.js +10 -9
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.js +16 -5
- package/dist/esm/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +75 -9
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleTools.js +61 -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 +49 -20
- 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/common/index.d.ts +4 -0
- package/dist/types/common/utils/globalVars.d.ts +2 -0
- package/dist/types/components/Application/ApplicationHeader.d.ts +1 -2
- package/dist/types/components/Dialog/Modal.d.ts +22 -7
- 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/Table/TableExpandHeader.d.ts +5 -1
- 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/edges/EdgeLabel.d.ts +7 -3
- package/dist/types/extensions/react-flow/handles/HandleContent.d.ts +7 -2
- package/dist/types/extensions/react-flow/handles/HandleDefault.d.ts +15 -6
- package/dist/types/extensions/react-flow/handles/HandleTools.d.ts +7 -0
- package/dist/types/extensions/react-flow/index.d.ts +2 -0
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +24 -8
- package/package.json +19 -17
- 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/common/index.ts +6 -3
- package/src/common/utils/globalVars.ts +18 -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/Application/application.scss +8 -6
- 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 +96 -39
- package/src/components/Dialog/SimpleDialog.tsx +19 -1
- package/src/components/Dialog/dialog.scss +33 -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/PropertyValuePair/propertyvalue.scss +1 -0
- package/src/components/Separation/Spacing.tsx +12 -8
- package/src/components/Table/TableExpandHeader.tsx +21 -18
- 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/EdgeLabel.tsx +78 -81
- package/src/extensions/react-flow/edges/_edges.scss +62 -67
- package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +43 -44
- package/src/extensions/react-flow/handles/HandleContent.tsx +14 -13
- package/src/extensions/react-flow/handles/HandleDefault.tsx +121 -44
- package/src/extensions/react-flow/handles/HandleTools.tsx +46 -0
- package/src/extensions/react-flow/handles/_handles.scss +135 -50
- package/src/extensions/react-flow/handles/stories/HandleDefault.stories.tsx +69 -25
- package/src/extensions/react-flow/index.ts +2 -0
- package/src/extensions/react-flow/nodes/NodeContent.tsx +97 -32
- package/src/extensions/react-flow/nodes/_nodes.scss +170 -110
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +75 -52
- package/src/extensions/react-flow/nodes/stories/NodeDefault.stories.tsx +34 -36
- package/src/extensions/react-flow/nodes/stories/nodeTypes.ts +11 -0
|
@@ -16,21 +16,17 @@ import { NodeContentExtensionProps } from "./NodeContentExtension";
|
|
|
16
16
|
import { NodeProps } from "./NodeDefault";
|
|
17
17
|
import { HighlightingState, NodeHighlightColor } from "./sharedTypes";
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
export type { HighlightingState };
|
|
19
|
+
type NodeContentHandleLegacyProps = HandleProps;
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
category?: "configuration";
|
|
24
|
-
}
|
|
21
|
+
type NodeContentHandleNextProps = HandleNextProps;
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
export type IHandleProps = NodeContentHandleLegacyProps;
|
|
23
|
+
export type NodeContentHandleProps = NodeContentHandleLegacyProps | NodeContentHandleNextProps;
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
25
|
+
// @deprecated use `NodeContentProps<any>['highlightedState']` (or import from `src/extensions/react-flow/nodes/sharedTypes`)
|
|
26
|
+
export type { HighlightingState };
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
// @deprecated use `HandleDefaultProps`
|
|
29
|
+
export type IHandleProps = NodeContentHandleLegacyProps;
|
|
34
30
|
|
|
35
31
|
// @deprecated use `NodeContentProps<any>['nodeDimensions']`
|
|
36
32
|
export type NodeDimensions = {
|
|
@@ -38,6 +34,23 @@ export type NodeDimensions = {
|
|
|
38
34
|
height: number;
|
|
39
35
|
};
|
|
40
36
|
|
|
37
|
+
type IntroductionTime = {
|
|
38
|
+
/**
|
|
39
|
+
* The delay time in ms before the introduction animation is displayed.
|
|
40
|
+
* Until the animation starts the node is invisible.
|
|
41
|
+
*/
|
|
42
|
+
delay?: number;
|
|
43
|
+
/**
|
|
44
|
+
* The time in ms the introdcution animation runs.
|
|
45
|
+
*/
|
|
46
|
+
run: number;
|
|
47
|
+
/**
|
|
48
|
+
* Animation used for the visual introduction.
|
|
49
|
+
* `outline` is used as default animation.
|
|
50
|
+
*/
|
|
51
|
+
animation?: "landing" | "outline";
|
|
52
|
+
};
|
|
53
|
+
|
|
41
54
|
interface NodeContentData<CONTENT_PROPS = any> {
|
|
42
55
|
/**
|
|
43
56
|
* Name of icon that should be displayed before the node label.
|
|
@@ -167,6 +180,10 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
|
|
|
167
180
|
* The node is displayed with some animated shadow for highlighting purposes.
|
|
168
181
|
*/
|
|
169
182
|
animated?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Time in ms used for a short animation of the node to visualize it was added or updated.
|
|
185
|
+
*/
|
|
186
|
+
introductionTime?: number | IntroductionTime;
|
|
170
187
|
|
|
171
188
|
/** Additional data stored in the node. */
|
|
172
189
|
businessData?: NODE_DATA;
|
|
@@ -253,22 +270,18 @@ const addHandles = (
|
|
|
253
270
|
flowVersion: any = "legacy"
|
|
254
271
|
) => {
|
|
255
272
|
return handles[position].map((handle: any, idx: any) => {
|
|
256
|
-
const {
|
|
273
|
+
const { style = {}, ...otherHandleProps } = handle;
|
|
257
274
|
const styleAdditions: { [key: string]: string } = {
|
|
258
275
|
color: nodeStyle.borderColor ?? undefined,
|
|
259
276
|
};
|
|
260
277
|
styleAdditions[posDirection] = (100 / (handles[position].length + 1)) * (idx + 1) + "%";
|
|
261
278
|
const handleProperties = {
|
|
262
|
-
...
|
|
279
|
+
...otherHandleProps,
|
|
263
280
|
...{
|
|
264
281
|
position: handle.position ?? position,
|
|
265
282
|
style: { ...style, ...styleAdditions },
|
|
266
283
|
posdirection: posDirection,
|
|
267
284
|
isConnectable: typeof handle.isConnectable !== "undefined" ? handle.isConnectable : isConnectable,
|
|
268
|
-
className: category
|
|
269
|
-
? (className ? className + " " : "") +
|
|
270
|
-
gethighlightedStateClasses(category, `${eccgui}-graphviz__handle`)
|
|
271
|
-
: className,
|
|
272
285
|
},
|
|
273
286
|
};
|
|
274
287
|
return <MemoHandler flowVersion={flowVersion} {...handleProperties} key={"handle" + idx} />;
|
|
@@ -286,7 +299,10 @@ const MemoHandler = React.memo(
|
|
|
286
299
|
return (
|
|
287
300
|
// we only test a few properties to control re-rendering
|
|
288
301
|
// need to be extended if also other properties need to be changed late
|
|
289
|
-
prev.style[prev.posdirection] === next.style[next.posdirection] &&
|
|
302
|
+
prev.style[prev.posdirection] === next.style[next.posdirection] &&
|
|
303
|
+
prev.isConnectable === next.isConnectable &&
|
|
304
|
+
prev.intent === next.intent &&
|
|
305
|
+
prev.category === next.category
|
|
290
306
|
);
|
|
291
307
|
}
|
|
292
308
|
);
|
|
@@ -324,6 +340,7 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
324
340
|
style = {},
|
|
325
341
|
showUnconnectableHandles = false,
|
|
326
342
|
animated = false,
|
|
343
|
+
introductionTime = 0,
|
|
327
344
|
onNodeResize,
|
|
328
345
|
nodeDimensions,
|
|
329
346
|
// forwarded props
|
|
@@ -386,7 +403,7 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
386
403
|
}
|
|
387
404
|
}, [nodeContentRef, onNodeResize, minimalShape, nodeDimensions]);
|
|
388
405
|
|
|
389
|
-
//update node dimensions when resized
|
|
406
|
+
// update node dimensions when resized
|
|
390
407
|
React.useEffect(() => {
|
|
391
408
|
if (nodeDimensions) {
|
|
392
409
|
setWidth(nodeDimensions.width);
|
|
@@ -394,21 +411,51 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
394
411
|
}
|
|
395
412
|
}, [nodeDimensions]);
|
|
396
413
|
|
|
414
|
+
// remove introduction class
|
|
415
|
+
React.useEffect(() => {
|
|
416
|
+
if (nodeContentRef && introductionTime) {
|
|
417
|
+
const timeDelay = typeof introductionTime === "object" ? introductionTime.delay ?? 0 : 0;
|
|
418
|
+
const timeRun = typeof introductionTime === "object" ? introductionTime.run : introductionTime;
|
|
419
|
+
setTimeout(() => {
|
|
420
|
+
nodeContentRef.current.className = nodeContentRef.current.className.replace(
|
|
421
|
+
`${eccgui}-graphviz__node--introduction`,
|
|
422
|
+
`${eccgui}-graphviz__node--introduction-runs`
|
|
423
|
+
);
|
|
424
|
+
}, timeDelay);
|
|
425
|
+
setTimeout(() => {
|
|
426
|
+
nodeContentRef.current.className = nodeContentRef.current.className.replace(
|
|
427
|
+
`${eccgui}-graphviz__node--introduction-runs`,
|
|
428
|
+
""
|
|
429
|
+
);
|
|
430
|
+
}, timeDelay + timeRun);
|
|
431
|
+
}
|
|
432
|
+
}, [nodeContentRef, introductionTime]);
|
|
433
|
+
|
|
397
434
|
if (handles.length > 0) {
|
|
398
|
-
handles
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
handleStack[Position.Top].push(handle);
|
|
403
|
-
} else {
|
|
404
|
-
if (handle.type === "target") {
|
|
405
|
-
handleStack[targetPosition].push(handle);
|
|
435
|
+
handles
|
|
436
|
+
.sort((a, b) => {
|
|
437
|
+
if (a.category === "dependency") {
|
|
438
|
+
return 1;
|
|
406
439
|
}
|
|
407
|
-
if (
|
|
408
|
-
|
|
440
|
+
if (b.category === "dependency") {
|
|
441
|
+
return -1;
|
|
409
442
|
}
|
|
410
|
-
|
|
411
|
-
|
|
443
|
+
return 0;
|
|
444
|
+
})
|
|
445
|
+
.forEach((handle) => {
|
|
446
|
+
if (handle.position) {
|
|
447
|
+
handleStack[handle.position].push(handle);
|
|
448
|
+
} else if (handle.category === "configuration") {
|
|
449
|
+
handleStack[Position.Top].push(handle);
|
|
450
|
+
} else {
|
|
451
|
+
if (handle.type === "target") {
|
|
452
|
+
handleStack[targetPosition].push(handle);
|
|
453
|
+
}
|
|
454
|
+
if (handle.type === "source") {
|
|
455
|
+
handleStack[sourcePosition].push(handle);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
});
|
|
412
459
|
}
|
|
413
460
|
const styleExpandDimensions: { [key: string]: string | number } = Object.create(null);
|
|
414
461
|
if (
|
|
@@ -430,12 +477,26 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
430
477
|
|
|
431
478
|
const resizableStyles =
|
|
432
479
|
!!onNodeResize === true && minimalShape === "none" && width + height > 0 ? { width, height } : {};
|
|
480
|
+
|
|
481
|
+
const introductionStyles = introductionTime
|
|
482
|
+
? ({
|
|
483
|
+
"--node-introduction-time": `${
|
|
484
|
+
typeof introductionTime === "object" ? introductionTime.run : introductionTime
|
|
485
|
+
}ms`,
|
|
486
|
+
} as React.CSSProperties)
|
|
487
|
+
: {};
|
|
433
488
|
const nodeContent = (
|
|
434
489
|
<>
|
|
435
490
|
<section
|
|
436
491
|
ref={nodeContentRef}
|
|
437
492
|
{...otherProps}
|
|
438
|
-
style={{
|
|
493
|
+
style={{
|
|
494
|
+
...style,
|
|
495
|
+
...highlightCustomPropertySettings,
|
|
496
|
+
...styleExpandDimensions,
|
|
497
|
+
...resizableStyles,
|
|
498
|
+
...introductionStyles,
|
|
499
|
+
}}
|
|
439
500
|
className={
|
|
440
501
|
`${eccgui}-graphviz__node` +
|
|
441
502
|
` ${eccgui}-graphviz__node--${size}` +
|
|
@@ -452,9 +513,13 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
452
513
|
? " " + gethighlightedStateClasses(highlightedState, `${eccgui}-graphviz__node`)
|
|
453
514
|
: "") +
|
|
454
515
|
(animated ? ` ${eccgui}-graphviz__node--animated` : "") +
|
|
516
|
+
(introductionTime ? ` ${eccgui}-graphviz__node--introduction` : "") +
|
|
455
517
|
(showUnconnectableHandles === false ? ` ${eccgui}-graphviz__node--hidehandles` : "") +
|
|
456
518
|
(letPassWheelEvents === false ? ` nowheel` : "")
|
|
457
519
|
}
|
|
520
|
+
data-introduction-animation={
|
|
521
|
+
typeof introductionTime === "object" ? introductionTime.animation : undefined
|
|
522
|
+
}
|
|
458
523
|
>
|
|
459
524
|
<header
|
|
460
525
|
className={
|