Skip to content

Commit 7b093dd

Browse files
Merge branch 'develop' into change/upgradedToReact18-CMEM-6639
# Conflicts: # src/extensions/codemirror/CodeMirror.tsx
2 parents c0daf9a + 8480c5c commit 7b093dd

65 files changed

Lines changed: 2196 additions & 329 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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,75 @@ 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 />`
14-
- force children to get displayed as inline content
17+
- force children to get displayed as inline content
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
1520
- `<StringPreviewContentBlobToggler />`
16-
- `useOnly` property: specify if only parts of the content should be used for the shortened preview, this property replaces `firstNonEmptyLineOnly`
21+
- `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
1738

1839
### Fixed
1940

2041
- `<Tag />`
2142
- create more whitespace inside `small` tag
2243
- reduce visual impact of border
2344
- `<StringPreviewContentBlobToggler />`
24-
- take Markdown rendering into account before testing the maximum preview length
45+
- take Markdown rendering into account before testing the maximum preview length
46+
- `<CodeEditor />`
47+
- fix `disabled` property update
48+
- `<VisualTour />`
49+
- fix color of buttons to move to previous/next step
50+
- take Markdown rendering into account before testing the maximum preview length
2551
- `<NodeContent />`
2652
- header-menu items are vertically centered now
53+
- `<Link />`
54+
- stabilize font size for on hover state
55+
- use correct font sizes when `size` property is set
56+
- `Typography`
57+
- adjust displaying fallback symbols in different browsers
58+
- `<CodeMirror />`
59+
- use the latest provided `onChange` function
60+
- `<TextField />`, `<TextArea />`
61+
- fix emoji false-positives in invisible character detection
62+
- `<MultiSuggestField />`
63+
- `onSelection` now sets `newlySelected` only for add actions and no longer sets it to the last element
64+
- border of the BlueprintJS `Tag` elements were fixed
65+
- `<Button />`
66+
- badge is correctly displayed when `badge={0}`
67+
- Focus outlines
68+
- we use again bold focus outlines for input elements
69+
- they are also used for clickable elements that are focused via keyboard (tab navigation)
2770

2871
### Changed
2972

73+
- `<MultiSelect />`:
74+
- Change default filter predicate to match multi-word queries.
75+
- `<EdgeDefault />`
76+
- reduce stroke width to only 1px
77+
- `<CodeMirror />`
78+
- `wrapLines` and `preventLineNumber` do not use `false` default value but if not set then it will be interpreted as `false`
79+
- in this way it can be overwritten by new user config for the markdown mode
3080
- automatically hide user interaction elements in print view
3181
- all application header components except `<WorkspaceHeader />`
3282
- `<CardActions />` and `<CardOptions />`
@@ -41,7 +91,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
4191
### Deprecated
4292

4393
- `<StringPreviewContentBlobToggler />`
44-
- `firstNonEmptyLineOnly` will be removed, is replaced by `useOnly="firstNonEmptyLine"`
94+
- `firstNonEmptyLineOnly` will be removed, is replaced by `useOnly="firstNonEmptyLine"`
4595

4696
## [25.0.0] - 2025-12-01
4797

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: 68 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
import React from "react";
22

3-
import { ValidIconName } from "../../components/Icon/canonicalIconNames";
4-
import { IconProps } from "../../components/Icon/Icon";
5-
import { TestIconProps } from "../../components/Icon/TestIcon";
6-
import { TestableComponent } from "../../components/interfaces";
7-
import { ProgressBarProps } from "../../components/ProgressBar/ProgressBar";
8-
import { SpinnerProps } from "../../components/Spinner/Spinner";
9-
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
3+
import {ValidIconName} from "../../components/Icon/canonicalIconNames";
4+
import {IconProps} from "../../components/Icon/Icon";
5+
import {TestIconProps} from "../../components/Icon/TestIcon";
6+
import {TestableComponent} from "../../components/interfaces";
7+
import {ProgressBarProps} from "../../components/ProgressBar/ProgressBar";
8+
import {SpinnerProps} from "../../components/Spinner/Spinner";
9+
import {CLASSPREFIX as eccgui} from "../../configuration/constants";
1010
import {
1111
Card,
1212
ContextMenu,
13+
DecoupledOverlay,
1314
IconButton,
1415
MenuItem,
16+
Notification,
17+
NotificationProps,
1518
OverflowText,
1619
OverviewItem,
1720
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,28 +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={
216-
typeof action.icon === "string"
217-
? action.icon
218-
: action["data-test-id"] ?? action["data-testid"] ?? idx
219-
}
220-
data-test-id={action["data-test-id"]}
221-
data-testid={action["data-testid"]}
222-
name={action.icon}
223-
text={action.tooltip}
224-
onClick={action.action}
225-
disabled={action.disabled}
226-
intent={action.hasStateWarning ? "warning" : undefined}
227-
tooltipProps={{
228-
hoverOpenDelay: 200,
229-
placement: "bottom",
230-
}}
231-
/>
232-
);
233-
})}
225+
activityActions.map((action, idx) => <ActivityActionButton
226+
key={idx}
227+
action={action}
228+
/>
229+
)}
234230
{additionalActions}
235231
{activityContextMenu && activityContextMenu.menuItems.length > 0 && (
236232
<ContextMenu
@@ -241,11 +237,7 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
241237
return (
242238
<MenuItem
243239
icon={menuAction.icon}
244-
key={
245-
typeof menuAction.icon === "string"
246-
? menuAction.icon
247-
: menuAction["data-test-id"] ?? idx
248-
}
240+
key={idx}
249241
onClick={menuAction.action}
250242
text={menuAction.tooltip}
251243
/>
@@ -267,3 +259,44 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
267259
<div className={classname}>{widget}</div>
268260
);
269261
}
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)