Skip to content

Commit 690b552

Browse files
authored
Merge pull request #407 from eccenca/release/v26.1.0
Release v26.1.0 into main branch
2 parents fcf4b05 + b6aff9b commit 690b552

15 files changed

Lines changed: 553 additions & 182 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,42 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
66

77
## [Unreleased]
88

9+
### Added
10+
11+
- `utils`
12+
- `useComputedStyleFallback` option for `CssCustomProperties`: if the CSSOM does not provide any property name for the used selector, e.g. because the declarations are part of a constructed and adopted stylesheet, then the names are read from the computed style of the matching element; disabled by default because the computed style also contains all inherited custom properties
13+
14+
### Changed
15+
16+
- `<CodeEditor />`
17+
- `shouldHaveMinimalSetup`: even if set to `false`, the edit history feature is still enabled explicitly
18+
- `<PropertyValuePair />`
19+
- the two-column display is only used if the container is wide enough, this way property name columns do not get too small
20+
- in narrower containers, property name and value are displayed as stacked rows
21+
- make the breakpoint configurable via SCSS (`$eccgui-propertyvalue-size-column-breakpoint-small`)
22+
- `utils`
23+
- values of CSS custom properties are resolved via the computed style of a matching element now, so they always represent what the browser really applies, e.g. references to other custom properties are already replaced
24+
25+
### Fixed
26+
27+
- `<Tooltip />`
28+
- inline `code` markup was hardly readable because of low contrast
29+
- `<PropertyName />`
30+
- fix width if it contains a `<Label />` with `<OverflowText />` children
31+
- the label tooltip is displayed correctly inside the container
32+
- `<HandleDefault />`
33+
- default handle class names were removed as soon as an `intent` was given
34+
- fix runtime error if the element holding the handle tools is not available
35+
- `utils`
36+
- CSS custom properties are also found if their rule is nested inside a cascade layer (`@layer`) or another grouping rule like `@media`, `@supports` or `@container`; this affects `textToColorHash()`, `getEnabledColorsFromPalette()`, `getEnabledColorPropertiesFromPalette()` and `getColorConfiguration()`
37+
- CSS custom properties are also found if the given selector is only one part of the selector list of a rule, e.g. `:root, :host`
38+
- stylesheets that are loaded from another origin do not break the collection of CSS custom properties anymore
39+
- collecting CSS custom properties does not throw an error anymore in test environments where the style declaration of a CSS rule is not an iterable object, e.g. in jsdom
40+
- empty results are not cached anymore, this way they are read again if the stylesheets are loaded later on
41+
- `minimalColorDistance` is part of the cache key of `getEnabledColorsFromPalette()` and `getEnabledColorPropertiesFromPalette()` now
42+
43+
## [26.0.0] - 2026-07-08
44+
945
This is a major release, and it might not be compatible with your current usage of our library. Please read about the necessary changes in the migration section below.
1046

1147
### Migration from v25 to v26

‎package.json‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@eccenca/gui-elements",
33
"description": "GUI elements based on other libraries, usable in React application, written in Typescript.",
4-
"version": "26.0.0",
4+
"version": "26.1.0",
55
"license": "Apache-2.0",
66
"homepage": "https://github.com/eccenca/gui-elements",
77
"bugs": "https://github.com/eccenca/gui-elements/issues",
@@ -180,12 +180,21 @@
180180
},
181181
"resolutions": {
182182
"**/@blueprintjs/core": "6.8.1",
183-
"node-sass-package-importer/**/postcss": "^8.5.10",
183+
"node-sass-package-importer/**/postcss": "^8.5.18",
184+
"stylelint-order/**/postcss": "^8.5.12",
185+
"stylelint/**/postcss": "^8.5.18",
184186
"hast-util-from-parse5": "8.0.0",
185187
"**/lodash": "^4.18.1",
186188
"**/minimatch": "^3.1.4",
187189
"**/serialize-javascript": "^7.0.5",
188-
"**/ws": "^8.21.0"
190+
"**/ws": "^8.21.0",
191+
"babel-jest/**/js-yaml": "^3.15.1",
192+
"stylelint/**/js-yaml": "^4.3.1",
193+
"@eslint/eslintrc/**/js-yaml": "^4.3.1",
194+
"**/nanoid": "^3.3.18",
195+
"**/fast-uri": "^3.1.3",
196+
"sass/**/immutable": "^5.1.8",
197+
"**/brace-expansion": "^1.1.18"
189198
},
190199
"husky": {
191200
"hooks": {
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import CssCustomProperties from "./CssCustomProperties";
2+
3+
describe("CssCustomProperties in jsdom", () => {
4+
beforeEach(() => {
5+
const style = document.createElement("style");
6+
style.textContent = `
7+
:root { --eccgui-color-palette-blue-500: #1c6ecb; }
8+
.config { --note-yellow: #ffde8f; }
9+
`;
10+
document.head.appendChild(style);
11+
});
12+
13+
it("reads property names of a style rule without iterating the declaration", () => {
14+
expect(
15+
CssCustomProperties.listLocalCssStyleRuleProperties({
16+
selectorText: ":root",
17+
propertyType: "custom",
18+
}),
19+
).toEqual([["--eccgui-color-palette-blue-500", "#1c6ecb"]]);
20+
});
21+
22+
it("does not throw for scoped selectors", () => {
23+
expect(() =>
24+
new CssCustomProperties({ selectorText: ".config", returnObject: false }).customProperties(),
25+
).not.toThrow();
26+
});
27+
28+
describe("useComputedStyleFallback", () => {
29+
beforeEach(() => {
30+
// the property is not part of any stylesheet, so the CSSOM does not know its name
31+
const element = document.createElement("div");
32+
element.classList.add("without-stylesheet");
33+
element.style.setProperty("--only-computed", "#c0ffee");
34+
document.body.appendChild(element);
35+
});
36+
37+
it("is disabled by default", () => {
38+
expect(
39+
new CssCustomProperties({
40+
selectorText: ".without-stylesheet",
41+
}).customProperties(),
42+
).toEqual({});
43+
});
44+
45+
it("reads the names from the computed style if the CSSOM does not provide any", () => {
46+
expect(
47+
new CssCustomProperties({
48+
selectorText: ".without-stylesheet",
49+
useComputedStyleFallback: true,
50+
}).customProperties(),
51+
).toEqual({ "only-computed": "#c0ffee" });
52+
});
53+
54+
it("is not used if the CSSOM provides names", () => {
55+
expect(
56+
new CssCustomProperties({
57+
selectorText: ".config",
58+
useComputedStyleFallback: true,
59+
}).customProperties(),
60+
).toEqual({ "note-yellow": "#ffde8f" });
61+
});
62+
});
63+
});

0 commit comments

Comments
 (0)