@eccenca/gui-elements 24.0.0-rc.4 → 24.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/CHANGELOG.md +50 -28
- package/dist/cjs/cmem/markdown/Markdown.js +2 -2
- package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
- package/dist/cjs/components/Application/helper.js +25 -2
- package/dist/cjs/components/Application/helper.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +21 -11
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/extensions/markText.js +2 -2
- package/dist/cjs/components/AutoSuggestion/extensions/markText.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +3 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Typography/HtmlContentBlock.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +18 -20
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js +4 -3
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js.map +1 -1
- package/dist/esm/cmem/markdown/Markdown.js +2 -2
- package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
- package/dist/esm/components/Application/helper.js +25 -2
- package/dist/esm/components/Application/helper.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +32 -22
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/extensions/markText.js +2 -2
- package/dist/esm/components/AutoSuggestion/extensions/markText.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +3 -1
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Typography/HtmlContentBlock.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.js +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +18 -20
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleTools.js +4 -3
- package/dist/esm/extensions/react-flow/handles/HandleTools.js.map +1 -1
- package/dist/types/cmem/markdown/Markdown.d.ts +8 -3
- package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +4 -1
- package/dist/types/components/CodeAutocompleteField/CodeAutocompleteField.d.ts +2 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +3 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/types/components/Typography/HtmlContentBlock.d.ts +16 -4
- package/package.json +5 -2
- package/src/cmem/markdown/Markdown.tsx +14 -4
- package/src/components/Application/helper.ts +30 -2
- package/src/components/Application/stories/Application.stories.tsx +11 -1
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +44 -26
- package/src/components/AutoSuggestion/extensions/markText.ts +1 -2
- package/src/components/CodeAutocompleteField/CodeAutocompleteField.tsx +1 -1
- package/src/components/Depiction/stories/Depiction.stories.tsx +18 -1
- package/src/components/Icon/canonicalIconNames.tsx +3 -1
- package/src/components/OverviewItem/overviewitem.scss +18 -7
- package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +1 -1
- package/src/components/OverviewItem/stories/OverviewItemDepiction.stories.tsx +25 -7
- package/src/components/Pagination/pagination.scss +1 -0
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/Typography/HtmlContentBlock.tsx +16 -4
- package/src/components/Typography/stories/HtmlContentBlock.stories.tsx +50 -0
- package/src/components/Typography/stories/WhiteSpaceContainer.stories.tsx +15 -30
- package/src/extensions/react-flow/handles/HandleContent.tsx +1 -1
- package/src/extensions/react-flow/handles/HandleDefault.tsx +21 -33
- package/src/extensions/react-flow/handles/HandleTools.tsx +4 -3
- package/src/extensions/react-flow/handles/_handles.scss +2 -1
- package/src/extensions/react-flow/handles/stories/HandleDefault.stories.tsx +12 -9
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { loremIpsum } from "react-lorem-ipsum";
|
|
3
2
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
3
|
|
|
5
|
-
import { WhiteSpaceContainer
|
|
4
|
+
import { WhiteSpaceContainer } from "../../../index";
|
|
5
|
+
|
|
6
|
+
import { Default as HtmlContentBlockStrory } from "./HtmlContentBlock.stories";
|
|
6
7
|
|
|
7
8
|
const whiteSpaceSizeOptions = {
|
|
8
|
-
control: "select",
|
|
9
|
-
options:
|
|
9
|
+
control: { type: "select" },
|
|
10
|
+
options: ["not set", "tiny", "small", "regular", "large", "xlarge"],
|
|
11
|
+
mapping: {
|
|
10
12
|
"not set": undefined,
|
|
11
|
-
tiny: "tiny",
|
|
12
|
-
small: "small",
|
|
13
|
-
regular: "regular",
|
|
14
|
-
large: "large",
|
|
15
|
-
xlarge: "xlarge",
|
|
16
13
|
},
|
|
17
14
|
};
|
|
18
15
|
|
|
19
16
|
export default {
|
|
20
|
-
title: "Components/Typography",
|
|
21
|
-
component:
|
|
17
|
+
title: "Components/Typography/WhiteSpaceContainer",
|
|
18
|
+
component: WhiteSpaceContainer,
|
|
22
19
|
argTypes: {
|
|
23
|
-
children: { control:
|
|
20
|
+
children: { control: false },
|
|
24
21
|
marginTop: { ...whiteSpaceSizeOptions },
|
|
25
22
|
marginRight: { ...whiteSpaceSizeOptions },
|
|
26
23
|
marginBottom: { ...whiteSpaceSizeOptions },
|
|
@@ -30,27 +27,15 @@ export default {
|
|
|
30
27
|
paddingBottom: { ...whiteSpaceSizeOptions },
|
|
31
28
|
paddingLeft: { ...whiteSpaceSizeOptions },
|
|
32
29
|
},
|
|
33
|
-
} as Meta<typeof
|
|
30
|
+
} as Meta<typeof WhiteSpaceContainer>;
|
|
34
31
|
|
|
35
|
-
const Template: StoryFn<typeof
|
|
36
|
-
<
|
|
32
|
+
const Template: StoryFn<typeof WhiteSpaceContainer> = (args) => (
|
|
33
|
+
<WhiteSpaceContainer {...args} style={{ background: "#eee" }} />
|
|
37
34
|
);
|
|
38
35
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
random: false,
|
|
43
|
-
}).toString();
|
|
44
|
-
|
|
45
|
-
export const WhiteSpaceContainer = Template.bind({});
|
|
46
|
-
WhiteSpaceContainer.args = {
|
|
47
|
-
children: [
|
|
48
|
-
<p>{testContent}</p>,
|
|
49
|
-
<p>
|
|
50
|
-
<strong>{testContent.replaceAll(" ", "")}</strong>
|
|
51
|
-
</p>,
|
|
52
|
-
<p>{testContent}</p>,
|
|
53
|
-
],
|
|
36
|
+
export const Default = Template.bind({});
|
|
37
|
+
Default.args = {
|
|
38
|
+
children: HtmlContentBlockStrory.args.children,
|
|
54
39
|
paddingTop: "tiny",
|
|
55
40
|
paddingRight: "small",
|
|
56
41
|
paddingBottom: "regular",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { memo } from "react";
|
|
2
2
|
import { Handle as HandleLegacy, HandleProps as ReactFlowHandleLegacyProps } from "react-flow-renderer";
|
|
3
3
|
import { Handle as HandleNext, HandleProps as ReactFlowHandleNextProps } from "react-flow-renderer-lts";
|
|
4
|
+
import { Classes as BlueprintClasses } from "@blueprintjs/core";
|
|
4
5
|
|
|
5
6
|
import { intentClassName, IntentTypes } from "../../../common/Intent";
|
|
6
7
|
import { CLASSPREFIX as eccgui } from "../../../configuration/constants";
|
|
@@ -44,34 +45,11 @@ export const HandleDefault = memo(
|
|
|
44
45
|
const flowVersionCheck = flowVersion || evaluateFlowVersion;
|
|
45
46
|
const handleDefaultRef = React.useRef<any>();
|
|
46
47
|
const [extendedTooltipDisplayed, setExtendedTooltipDisplayed] = React.useState<boolean>(false);
|
|
47
|
-
const [handleToolsDisplayed, setHandleToolsDisplayed] = React.useState<boolean>(false);
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
(e: Event) => {
|
|
51
|
-
const toolsTarget = handleDefaultRef.current.getElementsByClassName(
|
|
52
|
-
`${eccgui}-graphviz__handletools-target`
|
|
53
|
-
);
|
|
54
|
-
if (toolsTarget.length > 0 && e.target === handleDefaultRef.current) {
|
|
55
|
-
setHandleToolsDisplayed(true);
|
|
56
|
-
setExtendedTooltipDisplayed(false);
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
[handleDefaultRef]
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
React.useEffect(() => {
|
|
63
|
-
const toolsTarget = handleDefaultRef.current.getElementsByClassName(
|
|
64
|
-
`${eccgui}-graphviz__handletools-target`
|
|
65
|
-
);
|
|
66
|
-
if (toolsTarget && toolsTarget[0] && handleToolsDisplayed) {
|
|
67
|
-
toolsTarget[0].click();
|
|
68
|
-
}
|
|
69
|
-
}, [handleToolsDisplayed]);
|
|
49
|
+
let toolsTarget: HTMLElement[];
|
|
70
50
|
|
|
71
51
|
React.useEffect(() => {
|
|
72
|
-
|
|
73
|
-
`${eccgui}-graphviz__handletools-target`
|
|
74
|
-
);
|
|
52
|
+
toolsTarget = handleDefaultRef.current.getElementsByClassName(`${eccgui}-graphviz__handletools-target`);
|
|
75
53
|
if (toolsTarget && toolsTarget[0]) {
|
|
76
54
|
// Polyfill for FF that does not support the `:has()` pseudo selector until at least version 119 or 120
|
|
77
55
|
// need to be re-evaluated then
|
|
@@ -97,7 +75,7 @@ export const HandleDefault = memo(
|
|
|
97
75
|
},
|
|
98
76
|
intent: intent,
|
|
99
77
|
className: `${eccgui}-graphviz__handle__tooltip-target`,
|
|
100
|
-
isOpen: extendedTooltipDisplayed
|
|
78
|
+
isOpen: extendedTooltipDisplayed,
|
|
101
79
|
};
|
|
102
80
|
|
|
103
81
|
const handleContentProps = {
|
|
@@ -111,6 +89,8 @@ export const HandleDefault = memo(
|
|
|
111
89
|
const handleContent = <HandleContent {...handleContentProps}>{children}</HandleContent>;
|
|
112
90
|
|
|
113
91
|
let switchTooltipTimerOn: ReturnType<typeof setTimeout>;
|
|
92
|
+
let switchToolsTimerOff: ReturnType<typeof setTimeout>;
|
|
93
|
+
|
|
114
94
|
const handleConfig = {
|
|
115
95
|
...handleProps,
|
|
116
96
|
...tooltipTitle,
|
|
@@ -119,18 +99,26 @@ export const HandleDefault = memo(
|
|
|
119
99
|
if (handleProps.onClick) {
|
|
120
100
|
handleProps.onClick(e);
|
|
121
101
|
}
|
|
122
|
-
|
|
102
|
+
if (toolsTarget.length > 0 && e.target === handleDefaultRef.current) {
|
|
103
|
+
setExtendedTooltipDisplayed(false);
|
|
104
|
+
toolsTarget[0].click();
|
|
105
|
+
}
|
|
123
106
|
},
|
|
124
107
|
"data-category": category,
|
|
125
|
-
onMouseEnter: () => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
108
|
+
onMouseEnter: (e: any) => {
|
|
109
|
+
if (switchToolsTimerOff) clearTimeout(switchToolsTimerOff);
|
|
110
|
+
if (e.target === handleDefaultRef.current) {
|
|
111
|
+
switchTooltipTimerOn = setTimeout(
|
|
112
|
+
() => setExtendedTooltipDisplayed(true),
|
|
113
|
+
data?.tooltipProps?.hoverOpenDelay ?? 500
|
|
114
|
+
);
|
|
115
|
+
}
|
|
131
116
|
},
|
|
132
117
|
onMouseLeave: () => {
|
|
133
118
|
if (switchTooltipTimerOn) clearTimeout(switchTooltipTimerOn);
|
|
119
|
+
if (toolsTarget.length > 0 && toolsTarget[0].classList.contains(BlueprintClasses.POPOVER_OPEN)) {
|
|
120
|
+
switchToolsTimerOff = setTimeout(() => toolsTarget[0].click(), 500);
|
|
121
|
+
}
|
|
134
122
|
setExtendedTooltipDisplayed(false);
|
|
135
123
|
},
|
|
136
124
|
};
|
|
@@ -18,8 +18,9 @@ export const HandleTools = ({ children, ...otherContextOverlayProps }: HandleToo
|
|
|
18
18
|
const configToolsDisplayed = toolsDisplayed
|
|
19
19
|
? {
|
|
20
20
|
defaultIsOpen: true,
|
|
21
|
-
autoFocus:
|
|
22
|
-
interactionKind: BlueprintPopoverInteractionKind.
|
|
21
|
+
autoFocus: false,
|
|
22
|
+
interactionKind: BlueprintPopoverInteractionKind.CLICK,
|
|
23
|
+
openOnTargetFocus: true,
|
|
23
24
|
onClosing: () => setToolsDisplayed(false),
|
|
24
25
|
}
|
|
25
26
|
: {
|
|
@@ -38,7 +39,7 @@ export const HandleTools = ({ children, ...otherContextOverlayProps }: HandleToo
|
|
|
38
39
|
popoverClassName={`${eccgui}-graphviz__handletools-overlay`}
|
|
39
40
|
>
|
|
40
41
|
<div
|
|
41
|
-
className={`${eccgui}-graphviz__handletools-
|
|
42
|
+
className={`${eccgui}-graphviz__handletools-placeholder`}
|
|
42
43
|
data-test-id={otherContextOverlayProps["data-test-id"]}
|
|
43
44
|
data-testid={otherContextOverlayProps["data-testid"]}
|
|
44
45
|
/>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useState } from "react";
|
|
2
2
|
import { Elements, ReactFlowProvider } from "react-flow-renderer";
|
|
3
|
+
import { OverlaysProvider } from "@blueprintjs/core";
|
|
3
4
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
5
|
|
|
5
6
|
import { Definitions } from "../../../../common/Intent";
|
|
@@ -63,15 +64,17 @@ const HandleDefaultExample = (args: any) => {
|
|
|
63
64
|
);
|
|
64
65
|
|
|
65
66
|
return (
|
|
66
|
-
<
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
<OverlaysProvider>
|
|
68
|
+
<ReactFlowProvider>
|
|
69
|
+
<ReactFlow
|
|
70
|
+
elements={elements}
|
|
71
|
+
style={{ height: "400px" }}
|
|
72
|
+
onLoad={onLoad}
|
|
73
|
+
edgeTypes={edgeTypes}
|
|
74
|
+
defaultZoom={1}
|
|
75
|
+
/>
|
|
76
|
+
</ReactFlowProvider>
|
|
77
|
+
</OverlaysProvider>
|
|
75
78
|
);
|
|
76
79
|
};
|
|
77
80
|
|