Skip to content

Commit a65c4a8

Browse files
Merge branch 'change/upgradedToReact18-CMEM-6639' into feature/replaceDeprecatedGuiComponents-CMEM-4905
# Conflicts: # CHANGELOG.md # src/cmem/ActivityControl/ActivityControlWidget.tsx # src/components/MultiSelect/MultiSelect.tsx
2 parents 8b792d5 + bb7b621 commit a65c4a8

64 files changed

Lines changed: 2176 additions & 309 deletions

File tree

Some content is hidden

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

.storybook/preview.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ export const decorators = [
1919
];
2020

2121
export const parameters = {
22-
actions: { argTypesRegex: "^on[A-Z].*" },
22+
options: {
23+
storySort: {
24+
order: ["Configuration", "Components", "Forms", "Extensions", "CMEM", "*"],
25+
},
26+
},
27+
actions: {
28+
argTypesRegex: "^on[A-Z].*",
29+
},
2330
controls: {
2431
matchers: {
2532
color: /(background|color)$/i,

.typescript/tsbuild-esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./../tsconfig.json",
33
"compilerOptions": {
4-
"lib": ["dom", "dom.iterable", "es2015", "es2020", "es2021", "es2015.collection", "es2015.iterable"],
4+
"lib": ["dom", "dom.iterable", "es2015", "es2020", "es2021", "es2022.intl", "es2015.collection", "es2015.iterable"],
55
"module": "es2015",
66
"target": "es5",
77
"noEmit": false,

CHANGELOG.md

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,35 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
88

99
### Added
1010

11+
- `<ActivityControlWidget />`
12+
- Add parameter `active` to activity control action to set the `active` state of its button.
13+
- action now can have a `active` and `notification` property
1114
- `<ApplicationViewability />`
1215
- component for hiding elements in specific media
1316
- `<InlineText />`
1417
- force children to get displayed as inline content
15-
- `<NotAvailable />`
16-
- simple placeholder element that can be used to display info about missing data
18+
- `<DecoupledOverlay />`
19+
- similar to `ContextOverlay` component but not directly linked to a React element, it specifies the target in the DOM to get connected lazy
1720
- `<StringPreviewContentBlobToggler />`
1821
- `useOnly` property: specify if only parts of the content should be used for the shortened preview, this property replaces `firstNonEmptyLineOnly`
22+
- `<ContextOverlay />`
23+
- `paddingSize` property to add easily some white space
24+
- `<CodeEditor />`
25+
- toolbar in `markdown` mode provides a user config menu for the editor appearance
26+
- `<RadioButton />`
27+
- `hideIndicator` property: hide the radio inout indicator but click on children can be processed via `onChange` event
28+
- `<ColorField />`
29+
- input component for colors
30+
- uses a subset from the configured color palette by default, but it also allows to enter custom colors
31+
- CSS custom properties
32+
- beside the color palette we now mirror the most important layout configuration variables as CSS custom properties
33+
- new icons:
34+
- `state-confirmed-all`
35+
- `state-declined-all`
36+
- `<MultiSuggestField />`
37+
- `MultiSuggestFieldSelectionProps` provides `newlyRemoved` for callbacks set when removing a selected item
38+
- `<NotAvailable />`
39+
- simple placeholder element that can be used to display info about missing data
1940
- `<ContentBlobToggler />`
2041
- `forceInline` property: force inline rendering
2142
- `<ContextMenu />`
@@ -25,20 +46,50 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
2546
- Following optional BlueprintJs properties are forwarded now to override default behaviour: `noResults`, `createNewItemRenderer` and `itemRenderer`
2647
- `isValidNewOption` property: Checks if an input string is or can be turned into a valid new option.
2748

49+
2850
### Fixed
2951

3052
- `<Tag />`
3153
- create more whitespace inside `small` tag
3254
- reduce visual impact of border
3355
- `<StringPreviewContentBlobToggler />`
3456
- take Markdown rendering into account before testing the maximum preview length
57+
- `<CodeEditor />`
58+
- fix `disabled` property update
59+
- `<VisualTour />`
60+
- fix color of buttons to move to previous/next step
61+
- take Markdown rendering into account before testing the maximum preview length
3562
- `<NodeContent />`
3663
- header-menu items are vertically centered now
64+
- `<Link />`
65+
- stabilize font size for on hover state
66+
- use correct font sizes when `size` property is set
67+
- `Typography`
68+
- adjust displaying fallback symbols in different browsers
69+
- `<CodeMirror />`
70+
- use the latest provided `onChange` function
71+
- `<TextField />`, `<TextArea />`
72+
- fix emoji false-positives in invisible character detection
73+
- `<MultiSuggestField />`
74+
- `onSelection` now sets `newlySelected` only for add actions and no longer sets it to the last element
75+
- border of the BlueprintJS `Tag` elements were fixed
76+
- `<Button />`
77+
- badge is correctly displayed when `badge={0}`
78+
- Focus outlines
79+
- we use again bold focus outlines for input elements
80+
- they are also used for clickable elements that are focused via keyboard (tab navigation)
3781
- `<MultiSelect />`:
3882
- border of the BlueprintJS `Tag` elements were fixed
3983

4084
### Changed
4185

86+
- `<MultiSelect />`:
87+
- Change default filter predicate to match multi-word queries.
88+
- `<EdgeDefault />`
89+
- reduce stroke width to only 1px
90+
- `<CodeMirror />`
91+
- `wrapLines` and `preventLineNumber` do not use `false` default value but if not set then it will be interpreted as `false`
92+
- in this way it can be overwritten by new user config for the markdown mode
4293
- automatically hide user interaction elements in print view
4394
- all application header components except `<WorkspaceHeader />`
4495
- `<CardActions />` and `<CardOptions />`
@@ -59,7 +110,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
59110
- `<ContextMenu />`
60111
- `togglerLarge`: replaced by the more versatile `togglerSize` property
61112
- `<MultiSelect />`
62-
- `searchPreficate`: replaced by the, in some cases, more efficient `searchListPredicate`
113+
- `searchPredicate`: replaced by the, in some cases, more efficient `searchListPredicate`
63114

64115
## [25.0.0] - 2025-12-01
65116

src/_shame.scss

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
11
// Add stuff to test fast and dirty.
22
// This file should not contain any styles.
33

4-
.#{$prefix}--assistive-text,
5-
.#{$prefix}--visually-hidden {
6-
/*
7-
TODO: move to better place, originally from ~@carbon/styles/scss/css--helpers
8-
but we cannot use it directly because of other included rules there.
9-
*/
10-
position: absolute;
11-
width: 1px;
12-
height: 1px;
13-
padding: 0;
14-
margin: -1px;
15-
overflow: hidden;
16-
clip: rect(0, 0, 0, 0);
17-
white-space: nowrap;
18-
visibility: inherit;
19-
border: 0;
20-
}
21-
224
/*
235
WORKAROUND: thinner scrollbars
246
*/
257

268
* {
27-
scrollbar-width: thin;
289
scrollbar-color: #bbb transparent;
10+
scrollbar-width: thin;
2911

3012
&::-webkit-scrollbar {
3113
width: 0.25rem;
@@ -38,19 +20,3 @@
3820
border-radius: 0.125rem;
3921
}
4022
}
41-
42-
/*
43-
CHANGE: default focus behaviour
44-
*/
45-
46-
:focus,
47-
input:focus-visible,
48-
textarea:focus-visible {
49-
outline: none;
50-
outline-offset: 0;
51-
}
52-
53-
:focus-visible {
54-
outline: eccgui-color-rgba($eccgui-color-accent, $eccgui-opacity-muted) solid 2px;
55-
outline-offset: 1px;
56-
}

src/cmem/ActivityControl/ActivityControlWidget.tsx

Lines changed: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import React from "react";
33
import {
44
Card,
55
ContextMenu,
6+
DecoupledOverlay,
67
IconButton,
78
MenuItem,
9+
Notification,
10+
NotificationProps,
811
OverflowText,
912
OverviewItem,
1013
OverviewItemActions,
@@ -97,14 +100,24 @@ interface IActivityContextMenu extends TestableComponent {
97100
export interface ActivityControlWidgetAction extends TestableComponent {
98101
// The action that should be triggered
99102
action: () => void;
100-
// The tooltip that should be shown over the action icon
103+
// The tooltip that should be shown over the action icon on hover
101104
tooltip?: string;
102105
// The icon of the action button
103106
icon: ValidIconName | React.ReactElement<TestIconProps>;
104107
// Action is currently disabled (but shown)
105108
disabled?: boolean;
106109
// Warning state
107110
hasStateWarning?: boolean;
111+
// Active state
112+
active?: boolean
113+
/** A notification that is shown in an overlay pointing at the activity action button. */
114+
notification?: {
115+
message: string
116+
onClose: () => void
117+
intent?: NotificationProps["intent"]
118+
// Timeout in ms before notification is closed. Default: none
119+
timeout?: number
120+
}
108121
}
109122

110123
interface IActivityMenuAction extends ActivityControlWidgetAction {
@@ -209,24 +222,11 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
209222
data-test-id={dataTestIdLegacy ? `${dataTestIdLegacy}-actions` : undefined}
210223
>
211224
{activityActions &&
212-
activityActions.map((action, idx) => {
213-
return (
214-
<IconButton
215-
key={idx}
216-
data-test-id={action["data-test-id"]}
217-
data-testid={action["data-testid"]}
218-
name={action.icon}
219-
text={action.tooltip}
220-
onClick={action.action}
221-
disabled={action.disabled}
222-
intent={action.hasStateWarning ? "warning" : undefined}
223-
tooltipProps={{
224-
hoverOpenDelay: 200,
225-
placement: "bottom",
226-
}}
227-
/>
228-
);
229-
})}
225+
activityActions.map((action, idx) => <ActivityActionButton
226+
key={idx}
227+
action={action}
228+
/>
229+
)}
230230
{additionalActions}
231231
{activityContextMenu && activityContextMenu.menuItems.length > 0 && (
232232
<ContextMenu
@@ -259,3 +259,44 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
259259
<div className={classname}>{widget}</div>
260260
);
261261
}
262+
263+
interface ActivityActionButtonProps {
264+
action: ActivityControlWidgetAction
265+
}
266+
267+
const ActivityActionButton = ({action}: ActivityActionButtonProps) => {
268+
const actionButtonRef = React.useRef(null);
269+
const ActionButton = () => (
270+
<IconButton
271+
data-test-id={action["data-test-id"]}
272+
data-testid={action["data-testid"]}
273+
name={action.icon}
274+
text={action.tooltip}
275+
onClick={action.action}
276+
disabled={action.disabled}
277+
intent={action.hasStateWarning ? "warning" : undefined}
278+
tooltipProps={{
279+
hoverOpenDelay: 200,
280+
placement: "bottom"
281+
}}
282+
active={action.active}
283+
/>
284+
)
285+
return action.notification ?
286+
<>
287+
<span ref={actionButtonRef}>
288+
<ActionButton/>
289+
</span>
290+
{actionButtonRef.current && (
291+
<DecoupledOverlay targetSelectorOrElement={actionButtonRef.current} paddingSize={"small"}>
292+
<Notification
293+
message={action.notification.message}
294+
intent={action.notification.intent ?? "neutral"}
295+
onDismiss={action.notification.onClose}
296+
timeout={action.notification.timeout}
297+
/>
298+
</DecoupledOverlay>
299+
)}
300+
</> :
301+
<ActionButton/>
302+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const StickyNoteModal: React.FC<StickyNoteModalProps> = React.memo(
130130
name={translate("noteLabel")}
131131
id={"sticky-note-input"}
132132
mode="markdown"
133-
preventLineNumbers
133+
useToolbar
134134
onChange={(value) => {
135135
refNote.current = value;
136136
}}

src/common/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { decode } from "he";
33
import { invisibleZeroWidthCharacters } from "./utils/characters";
44
import { colorCalculateDistance } from "./utils/colorCalculateDistance";
55
import decideContrastColorValue from "./utils/colorDecideContrastvalue";
6-
import { getEnabledColorsFromPalette, textToColorHash } from "./utils/colorHash";
6+
import { getEnabledColorPropertiesFromPalette, getEnabledColorsFromPalette, textToColorHash } from "./utils/colorHash";
77
import getColorConfiguration from "./utils/getColorConfiguration";
88
import { getScrollParent } from "./utils/getScrollParent";
99
import { getGlobalVar, setGlobalVar } from "./utils/globalVars";
@@ -22,6 +22,7 @@ export const utils = {
2222
setGlobalVar,
2323
getScrollParent,
2424
getEnabledColorsFromPalette,
25+
getEnabledColorPropertiesFromPalette,
2526
textToColorHash,
2627
reduceToText,
2728
decodeHtmlEntities: decode,

0 commit comments

Comments
 (0)