Skip to content

Commit 786046c

Browse files
Merge pull request #333 from eccenca/feature/prepareFinalNext-CMEM-6943
Prepare final next major (CMEM-6943)
2 parents 1195f6c + 0775022 commit 786046c

54 files changed

Lines changed: 299 additions & 1092 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,27 @@ This is a major release, and it might be not compatible with your current usage
5353

5454
### Removed
5555

56-
- removed direct replacements for legacy components (imported via @eccenca/gui-elements/src/legacy-replacements or LegacyReplacements)
56+
- removed direct replacements for legacy components (imported via `@eccenca/gui-elements/src/legacy-replacements` or `LegacyReplacements`)
5757
- `<AffirmativeButton />`, `<Button />`, `<DismissiveButton />`, `<DisruptiveButton />`, `<Checkbox />`, `<RadioButton />`, `<Tabs />`, `<TextField />`
58+
- `<Button />`, `<FieldItem />`, `<FieldSet />`, `<MultiSuggestField />`
59+
- removed support for old state properties `hasStatePrimary`, `hasStateSuccess`, `hasStateWarning` and `hasStateDanger`
60+
- `<Notification />`
61+
- removed support for old state properties `neutral`, `success`, `warning` and `danger`
62+
- `<Icon />`
63+
- removed `description` and `iconTitle` properties
64+
- `<OverviewItemList />`
65+
- `densityHigh` property was removed
66+
- `<CodeEditor />`
67+
- static fallback for test id `codemirror-wrapper` was removed, add `data-test-id` (or your test id data attribute) always directly to `CodeEditor`.
68+
- `nodeTypes` and `edgeTypes` exports were removed
69+
- use `<ReactFlow/` with `configuration`, or define it yourself
70+
- SCSS variables `$eccgui-color-application-text` and `$eccgui-color-application-background` were removed
71+
- use `$eccgui-color-workspace-text` and `$eccgui-color-workspace-background`
5872
- support for React Flow v10 was completely removed
5973
- `<EdgeDefault />`
6074
- removed `inversePath` property, can be replaced with `arrowDirection: "inversed"` property
75+
- `<Spinner />`
76+
- `description` property was removed because it was defined but not implemented for a very long time, but we plan to add that type of caption later
6177

6278
### Fixed
6379

@@ -72,6 +88,10 @@ This is a major release, and it might be not compatible with your current usage
7288
- support now v9 and v12 of react flow
7389
- `<ReactFlowExtended />`
7490
- use `<EdgeNew />` by default for new connection lines, you can overwrite it by setting `connectionLineComponent` to `undefined`
91+
- `<Spinner />`
92+
- `color` property does not accept `intent` values anymore
93+
- `<OverflowText />`
94+
- beside explicitly specified properties it allows only basic HTML element properties and testing IDs
7595
- overrite the native SCSS `rgba()` function, so it now works for SCSS color values and CSS custom properties
7696
- `getColorConfiguration()` works with CSS custom properties
7797

@@ -302,6 +322,8 @@ If you use Jest then you can use the same aliases for the `moduleNameMapper` con
302322
- use always `<Label/>` component for `label` value
303323
- `<StickyNoteNode />`
304324
- Refactored data structure position and dimension (breaking change)
325+
- `<MiniMap />`
326+
- component supports now React Flow v9 and v12
305327

306328
### Deprecated
307329

@@ -501,8 +523,6 @@ This is a major release, and it might be not compatible with your current usage
501523
- `<MultiSuggestField />`
502524
- Updated the interface with the ability to use either `selectedItems` or `prePopulateWithItems` properties, which is more logical.
503525
- Fixed deferred `selectedItems` setting.
504-
- `<StickyNoteModal/>`
505-
- static test id `data-test-id="sticky-note-modal"` will be removed with next major version
506526
- `<BreadcrumbsList />`
507527
- `onItemClick` handler is only executed if breadcrumb has `href` set because this is one callback parameter and the handler would not have any information otherwise
508528
- `<Depiction />`
@@ -529,6 +549,8 @@ This is a major release, and it might be not compatible with your current usage
529549

530550
- `<TextArea />`
531551
- `hasStatePrimary`, `hasStateSuccess`, `hasStateWarning` and `hasStateDanger` properties: use the `intent` property instead.
552+
- `<StickyNoteModal/>`
553+
- static test id `data-test-id="sticky-note-modal"` will be removed with next major version
532554

533555
## [23.6.0] - 2024-04-17
534556

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@
7373
"@blueprintjs/select": "^5.3.19",
7474
"@carbon/icons": "^11.58.0",
7575
"@carbon/react": "^1.80.1",
76+
"@codemirror/lang-html": "^6.4.9",
7677
"@codemirror/lang-javascript": "^6.2.3",
7778
"@codemirror/lang-json": "^6.0.1",
7879
"@codemirror/lang-markdown": "^6.3.2",
7980
"@codemirror/lang-sql": "^6.8.0",
8081
"@codemirror/lang-xml": "^6.1.0",
8182
"@codemirror/lang-yaml": "^6.1.2",
82-
"@codemirror/lang-html": "^6.4.9",
8383
"@codemirror/legacy-modes": "^6.5.0",
8484
"@mavrin/remark-typograf": "^2.2.0",
8585
"@xyflow/react": "^12.6.0",
@@ -97,7 +97,6 @@
9797
"react-inlinesvg": "^3.0.3",
9898
"react-is": "^16.13.1",
9999
"react-markdown": "^10.1.0",
100-
"react-markdown-deprecated": "npm:react-markdown@^8.0.7",
101100
"react-syntax-highlighter": "^15.6.1",
102101
"rehype-external-links": "^3.0.0",
103102
"rehype-raw": "^7.0.0",

src/cmem/markdown/Markdown.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
import React from "react";
22
import ReactMarkdown from "react-markdown";
3-
/**
4-
* Recreate the old type to provide support until next major
5-
*/
6-
import { PluggableList as PluggableListDeprecated } from "react-markdown-deprecated/lib/react-markdown";
73
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
84
// @ts-ignore: No declaration file for module (TODO: should be @ts-expect-error but GUI elements is used inside project with `noImplicitAny=false`)
95
import remarkTypograf from "@mavrin/remark-typograf";
106
import rehypeExternalLinks from "rehype-external-links";
117
import rehypeRaw from "rehype-raw";
128
import { remarkDefinitionList } from "remark-definition-list";
139
import remarkGfm from "remark-gfm";
14-
import { PluggableList as PluggableListUnified } from "unified";
10+
import { PluggableList } from "unified";
1511

1612
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
1713
import { HtmlContentBlock, HtmlContentBlockProps, TestableComponent } from "../../index";
18-
type PluggableList = PluggableListUnified | PluggableListDeprecated;
1914

2015
export interface MarkdownProps extends TestableComponent {
2116
children: string;
@@ -41,7 +36,6 @@ export interface MarkdownProps extends TestableComponent {
4136
/**
4237
* Additional reHype plugins to execute.
4338
* @see https://github.com/remarkjs/react-markdown#architecture
44-
* @deprecated (v25) this property won't support `PluggableList` from "react-markdown/lib/react-markdown" with the next major version, only the one from `unified` will be supported then.
4539
*/
4640
reHypePlugins?: PluggableList;
4741
/**
@@ -61,9 +55,9 @@ const configDefault = {
6155
@see https://github.com/remarkjs/react-markdown#api
6256
*/
6357
// @see https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins
64-
remarkPlugins: [remarkGfm, remarkTypograf, remarkDefinitionList] as PluggableListUnified,
58+
remarkPlugins: [remarkGfm, remarkTypograf, remarkDefinitionList] as PluggableList,
6559
// @see https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins
66-
rehypePlugins: [] as PluggableListUnified,
60+
rehypePlugins: [] as PluggableList,
6761
allowedElements: [
6862
// default markdown
6963
"a",
@@ -173,9 +167,7 @@ export const Markdown = ({
173167
};
174168

175169
if (reHypePlugins) {
176-
reactMarkdownProperties.rehypePlugins = reactMarkdownProperties.rehypePlugins.concat(
177-
reHypePlugins as PluggableListUnified
178-
);
170+
reactMarkdownProperties.rehypePlugins = reactMarkdownProperties.rehypePlugins.concat(reHypePlugins);
179171
}
180172

181173
const markdownDisplay = <ReactMarkdown {...reactMarkdownProperties} />;

src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
ApplicationContainer,
2222
EdgeTools,
2323
MiniMap,
24-
MiniMapV12,
2524
NodeTools,
2625
ReactFlowExtended,
2726
ReactFlowExtendedProps,
@@ -459,8 +458,12 @@ const ReactFlowExampleV9: FC<ReactFlowExtendedProps> = (args) => {
459458
[reactflowInstance]
460459
);
461460

461+
const { style, ...otherProps } = args;
462+
const { height, width, ...otherStyles } = style ?? {};
463+
462464
const reactFlowExtendedProps = {
463-
...args,
465+
...otherProps,
466+
style: otherStyles,
464467
defaultZoom: 1,
465468
elements,
466469
onLoad,
@@ -470,10 +473,12 @@ const ReactFlowExampleV9: FC<ReactFlowExtendedProps> = (args) => {
470473

471474
return (
472475
<ApplicationContainer monitorDropzonesFor={args.dropzoneFor} style={{ background: "white" }}>
473-
<ReactFlowExtended {...reactFlowExtendedProps}>
474-
<MiniMap flowInstance={reactflowInstance} enableNavigation={true} />
475-
<BackgroundV9 variant={BackgroundVariantV9.Lines} gap={16} />
476-
</ReactFlowExtended>
476+
<div style={{ height, width }}>
477+
<ReactFlowExtended {...reactFlowExtendedProps}>
478+
<MiniMap flowInstance={reactflowInstance} enableNavigation={true} />
479+
<BackgroundV9 variant={BackgroundVariantV9.Dots} gap={16} />
480+
</ReactFlowExtended>
481+
</div>
477482
{edgeTools}
478483
</ApplicationContainer>
479484
);
@@ -498,8 +503,8 @@ const ReactFlowExampleV12: FC<ReactFlowExtendedProps> = (args) => {
498503
<ApplicationContainer monitorDropzonesFor={args.dropzoneFor} style={{ background: "white" }}>
499504
<div style={{ height, width }}>
500505
<ReactFlowExtended {...reactFlowExtendedProps}>
501-
<MiniMapV12 enableNavigation />
502-
<BackgroundV12 variant={BackgroundVariantV12.Lines} gap={16} />
506+
<MiniMap enableNavigation />
507+
<BackgroundV12 variant={BackgroundVariantV12.Dots} gap={16} />
503508
</ReactFlowExtended>
504509
</div>
505510
</ApplicationContainer>

src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export const StickyNoteModal: React.FC<StickyNoteModalProps> = React.memo(
118118
</Button>,
119119
]}
120120
{...simpleDialogProps}
121-
data-test-id={(simpleDialogProps ?? {})["data-test-id"] ?? "sticky-note-modal"} // @deprecated (v25) we remove this automatically set testid
122121
>
123122
<FieldItem
124123
key="note"

src/common/scss/_color-functions.scss

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,39 @@
8686
* Created to replace them easily for CSS custom properties.
8787
*/
8888
@function eccgui-color-rgba($color, $alpha) {
89-
@return eccgui-color-mix($color 100% * $alpha, transparent);
89+
@if $alpha > 0 {
90+
@return eccgui-color-mix($color 100% * $alpha, transparent);
91+
} @else {
92+
// workaround: we need to prevent `0%` because it will reduced to `0` by some CSS minifiers and leads to invalid color-mix values
93+
@return eccgui-color-mix($color, transparent 100%);
94+
}
95+
}
96+
97+
$debug-rgba-values: "yes";
98+
99+
/**
100+
* Split between rgba(red, green, blue, alpha) and rgba(color, alpha).
101+
*/
102+
@function rgba($r, $g, $b: "undefined", $a: 1) {
103+
// check if old notation is used
104+
@if meta.variable-exists("r") and meta.variable-exists("g") and $b == "undefined" {
105+
// rgba(color, alpha) was used
106+
// forward to our color check splitter
107+
@return rgba-extended($r, $g);
108+
} @else {
109+
// rgba(r, g, b, a) is used -> rgb(r g b / a)
110+
// @see https://developer.mozilla.org/de/docs/Web/CSS/color_value/rgb
111+
$color-new-notation: rgb(#{$r} #{$g} #{$b} / #{$a});
112+
113+
@return $color-new-notation;
114+
}
90115
}
91116

92117
/**
93118
* Overwrite SCSS built-in rgba function to support colors by custom properties and CSS color methods.
94119
* TODO: we need to check if this is future proof, maybe this bahaviour is not planned by Dart Sass library.
95120
*/
96-
@function rgba($color, $alpha) {
121+
@function rgba-extended($color, $alpha) {
97122
@if meta.type-of($color) == "color" {
98123
// value is SASS color value, we use SASS color functionality
99124
$alphacolor: color.change($color, $alpha: $alpha);
@@ -102,7 +127,10 @@
102127
$alphacolor: transparent;
103128
}
104129

105-
@debug "Color value $color is not defined by CSS custom property: rgba(#{$color}, #{$alpha}) -> #{$alphacolor}";
130+
@if $debug-rgba-values == "yes" {
131+
@warn "Color value $color is not defined by CSS custom property: rgba(#{$color}, #{$alpha}) -> #{$alphacolor}";
132+
}
133+
106134
@return $alphacolor;
107135
} @else {
108136
// value is not a SASS color value, we use CSS color method

src/components/Application/stories/ColorPalettes.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ const ColorPaletteConfigurator = ({
435435
togglerElement={
436436
<IconButton
437437
name="state-warning"
438-
hasStateWarning
438+
intent="warning"
439439
badge={warningsDistance.length + warningsContrast.length}
440440
badgeProps={{
441441
intent: "warning",

src/components/AutoSuggestion/AutoSuggestion.tsx

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ export interface CodeAutocompleteFieldSuggestionBase {
3434
description?: string;
3535
}
3636

37-
/** @deprecated (v25) use CodeAutocompleteFieldSuggestionBase */
38-
export type ISuggestionBase = CodeAutocompleteFieldSuggestionBase;
39-
4037
/** Same as CodeAutocompleteFieldSuggestionBase, but with the query that was used to fetch this suggestion. */
4138
export interface CodeAutocompleteFieldSuggestionWithReplacementInfo extends CodeAutocompleteFieldSuggestionBase {
4239
// The query this result was filtered by
@@ -47,9 +44,6 @@ export interface CodeAutocompleteFieldSuggestionWithReplacementInfo extends Code
4744
length: number;
4845
}
4946

50-
/** @deprecated (v25) use CodeAutocompleteFieldSuggestionWithReplacementInfo */
51-
export type ISuggestionWithReplacementInfo = CodeAutocompleteFieldSuggestionWithReplacementInfo;
52-
5347
/** The suggestions for a specific substring of the given input string. */
5448
export interface CodeAutocompleteFieldReplacementResult {
5549
// The range of the input string that should be replaced
@@ -63,9 +57,6 @@ export interface CodeAutocompleteFieldReplacementResult {
6357
replacements: CodeAutocompleteFieldSuggestionBase[];
6458
}
6559

66-
/** @deprecated (v25) use CodeAutocompleteFieldReplacementResult */
67-
export type IReplacementResult = CodeAutocompleteFieldReplacementResult;
68-
6960
export interface CodeAutocompleteFieldPartialAutoCompleteResult {
7061
// Repeats the input string from the corresponding request
7162
inputString: string;
@@ -74,9 +65,6 @@ export interface CodeAutocompleteFieldPartialAutoCompleteResult {
7465
replacementResults: CodeAutocompleteFieldReplacementResult[];
7566
}
7667

77-
/** @deprecated (v25) use CodeAutocompleteFieldPartialAutoCompleteResult */
78-
export type IPartialAutoCompleteResult = CodeAutocompleteFieldPartialAutoCompleteResult;
79-
8068
/** Validation result */
8169
export interface CodeAutocompleteFieldValidationResult {
8270
// If the input value is valid or not
@@ -91,13 +79,7 @@ export interface CodeAutocompleteFieldValidationResult {
9179
};
9280
}
9381

94-
/** @deprecated (v25) use CodeAutocompleteFieldValidationResult */
95-
export type IValidationResult = CodeAutocompleteFieldValidationResult;
96-
97-
/**
98-
* @deprecated (v25) use `CodeAutocompleteFieldProps` instead.
99-
*/
100-
export interface AutoSuggestionProps {
82+
export interface CodeAutocompleteFieldProps {
10183
/** Additional class name.
10284
*/
10385
className?: string;
@@ -180,9 +162,12 @@ interface RequestMetaData {
180162
}
181163

182164
/**
183-
* @deprecated (support already removed) use `CodeAutocompleteField` as replacement.
165+
* Input component that allows partial, fine-grained auto-completion, i.e. of sub-strings of the input string.
166+
* This is comparable to a one line code editor.
167+
*
168+
* Example usage: input of a path string offering auto-completion for each single part of the path.
184169
*/
185-
const AutoSuggestion = ({
170+
export const CodeAutocompleteField = ({
186171
className,
187172
label,
188173
initialValue,
@@ -206,8 +191,8 @@ const AutoSuggestion = ({
206191
reInitOnInitialValueChange = false,
207192
height,
208193
readOnly,
209-
outerDivAttributes
210-
}: AutoSuggestionProps) => {
194+
outerDivAttributes,
195+
}: CodeAutocompleteFieldProps) => {
211196
const value = React.useRef<string>(initialValue);
212197
const cursorPosition = React.useRef(0);
213198
const dropdownXYoffset = React.useRef<{ x: number; y: number }>({ x: 0, y: 0 });
@@ -625,7 +610,7 @@ const AutoSuggestion = ({
625610
handleEscapePressed();
626611
break;
627612
default:
628-
//do nothing
613+
//do nothing
629614
closeDropDown();
630615
}
631616
}
@@ -675,15 +660,15 @@ const AutoSuggestion = ({
675660
showScrollBar,
676661
multiline,
677662
handleInputMouseDown,
678-
readOnly
663+
readOnly,
679664
]);
680665

681666
const hasError = !!value.current && !pathIsValid && !pathValidationPending;
682667
const autoSuggestionInput = (
683668
<div
684669
id={id}
685670
ref={autoSuggestionDivRef}
686-
className={`${eccgui}-autosuggestion` + (className ? ` ${className}` : "")}
671+
className={`${eccgui}-codeautocompletefield ${eccgui}-autosuggestion` + (className ? ` ${className}` : "")}
687672
{...outerDivAttributes}
688673
>
689674
<div
@@ -750,12 +735,12 @@ const AutoSuggestion = ({
750735
{label}
751736
&nbsp;
752737
{(pathValidationPending || suggestionsPending) && (
753-
<Spinner size="tiny" position="inline" description="Validating value path" />
738+
<Spinner size="tiny" position="inline" />
754739
)}
755740
</>
756741
),
757742
}}
758-
hasStateDanger={hasError}
743+
intent={hasError ? "danger" : undefined}
759744
messageText={hasError ? validationErrorText : undefined}
760745
>
761746
{withRightElement}
@@ -765,4 +750,4 @@ const AutoSuggestion = ({
765750
);
766751
};
767752

768-
export default AutoSuggestion;
753+
export default CodeAutocompleteField;

0 commit comments

Comments
 (0)