Skip to content

Commit eaacde2

Browse files
committed
Merge branch 'staging/4.0' into feat/tools/knobs
2 parents 3aa5be5 + a486b90 commit eaacde2

File tree

148 files changed

+5520
-6513
lines changed

Some content is hidden

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

148 files changed

+5520
-6513
lines changed

.changeset/clever-places-happen.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@patternfly/eslint-config": patch
3+
"@patternfly/create-element": patch
4+
"@patternfly/pfe-core": patch
5+
"@patternfly/pfe-tools": patch
6+
"@patternfly/elements": patch
7+
---
8+
updated dependencies

.changeset/free-ideas-fry.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/pfe-core": patch
3+
---
4+
`InternalsController`: corrected the types for aria IDL list attributes

.changeset/mighty-pigs-check.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/pfe-tools": patch
3+
---
4+
5+
Windows compatibility for various tools packages

.changeset/weak-turtles-act.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/pfe-tools": patch
3+
---
4+
**Test Runner Config**: import the production version of Lit for tests, reducing
5+
console chatter during test runs

.changeset/wide-guests-speak.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/eslint-config-elements": major
3+
---
4+
Require `@typescript-eslint` ^8.0.0

.github/workflows/tests.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
name: SSR Tests (Playwright)
9696
runs-on: ubuntu-latest
9797
container:
98-
image: mcr.microsoft.com/playwright:v1.44.0-jammy
98+
image: mcr.microsoft.com/playwright:v1.45.1-jammy
9999
steps:
100100
- uses: actions/checkout@v4
101101
- uses: actions/setup-node@v4
@@ -265,5 +265,27 @@ jobs:
265265
close-previous: true
266266
title: "🧪 Tests are failing on main"
267267
body: "It looks like the build is currently failing on the main branch. See failed [action results](https://github.com/patternfly/patternfly-elements/actions/runs/${{ github.run_id }}) for more details."
268+
269+
build-windows:
270+
name: Verify that build runs on Windows
271+
runs-on: windows-latest
272+
steps:
273+
- name: Checkout repository
274+
uses: actions/checkout@v3
275+
276+
# Configures the node version used on GitHub-hosted runners
277+
- name: Configure node version
278+
uses: actions/setup-node@v3
279+
with:
280+
node-version: 20
281+
cache: npm
282+
283+
- name: Install dependencies
284+
run: npm ci --prefer-offline
285+
286+
- name: Build
287+
id: build
288+
run: npm run build
289+
268290

269291

@types/colorjs.io/index.d.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

core/pfe-core/controllers/cascade-controller.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@ import { debounce } from '../functions/debounce.js';
55
import { Logger } from './logger.js';
66

77
/**
8-
* @deprecated: use context, especially via `@patternfly/pfe-core/functions/context.js`;
8+
* @deprecated use context, especially via `@patternfly/pfe-core/functions/context.js`;
99
*/
1010
export interface Options<E extends ReactiveElement> {
1111
properties: Partial<Record<keyof E, string | string[]>>;
1212
prefix?: string;
1313
}
1414

1515
/**
16-
* @deprecated: use context, especially via `@patternfly/pfe-core/functions/context.js`;
16+
* @deprecated use context, especially via `@patternfly/pfe-core/functions/context.js`;
1717
*/
1818
export class CascadeController<E extends ReactiveElement> implements ReactiveController {
1919
private class: typeof ReactiveElement;
2020

2121
private logger: Logger;
2222

23-
static instances = new WeakMap<ReactiveElement, CascadeController<ReactiveElement>>();
23+
static instances: WeakMap<ReactiveElement, CascadeController<ReactiveElement>> =
24+
new WeakMap<ReactiveElement, CascadeController<ReactiveElement>>();
2425

25-
mo = new MutationObserver(this.parse);
26+
mo: MutationObserver = new MutationObserver(this.parse);
2627

27-
cache = new Map<string, string[]>();
28+
cache: Map<string, string[]> = new Map<string, string[]>();
2829

29-
constructor(public host: E, public options?: Options<E>) {
30+
constructor(public host: E, public options?: Options<E> | undefined) {
3031
this.class = host.constructor as typeof ReactiveElement;
3132
this.logger = new Logger(this.host);
3233
CascadeController.instances.set(host, this);
@@ -38,24 +39,25 @@ export class CascadeController<E extends ReactiveElement> implements ReactiveCon
3839
this.cascadeProperties = debounce(this.cascadeProperties, 1);
3940
}
4041

41-
hostUpdated() {
42+
hostUpdated(): void {
4243
this.cascadeProperties();
4344
}
4445

45-
hostConnected() {
46+
hostConnected(): void {
4647
this.mo.observe(this.host, { attributes: true, childList: true });
4748
this.cascadeProperties();
4849
}
4950

50-
hostDisconnected() {
51+
hostDisconnected(): void {
5152
this.mo.disconnect();
5253
}
5354

5455
/**
5556
* Handles the cascading of properties to nested components when new elements are added
5657
* Attribute updates/additions are handled by the attribute callback
58+
* @param [nodeList=this.host.children]
5759
*/
58-
cascadeProperties(nodeList: HTMLCollection | NodeList = this.host.children) {
60+
cascadeProperties(nodeList: HTMLCollection | NodeList = this.host.children): void {
5961
if (this.host.isConnected) {
6062
const selectors = this.cache.keys();
6163

@@ -89,8 +91,10 @@ export class CascadeController<E extends ReactiveElement> implements ReactiveCon
8991
* Gets the configured attribute name for the decorated property,
9092
* falling back to the lowercased property name, and caches the attribute name
9193
* with it's designated child selectors for value-propagation on change
94+
* @param propName
95+
* @param cascade
9296
*/
93-
initProp(propName: string, cascade: string | string[]) {
97+
initProp(propName: string, cascade: string | string[]): void {
9498
for (const nodeItem of [cascade].flat(Infinity).filter(Boolean) as string[]) {
9599
const { attribute } = this.class.getPropertyOptions(propName);
96100

@@ -122,6 +126,8 @@ export class CascadeController<E extends ReactiveElement> implements ReactiveCon
122126

123127
/**
124128
* Copy the named attribute to a target element.
129+
* @param name attr name
130+
* @param el element
125131
*/
126132
private async _copyAttribute(name: string, el: Element) {
127133
this.logger.log(`copying ${name} to ${el}`);

core/pfe-core/controllers/css-variable-controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ export class CssVariableController implements ReactiveController {
88
}
99

1010
private parseProperty(name: string) {
11-
return name.substr(0, 2) !== '--' ? `--${name}` : name;
11+
return name.substring(0, 2) !== '--' ? `--${name}` : name;
1212
}
1313

14-
getVariable(name: string) {
14+
getVariable(name: string): string | null {
1515
return this.style.getPropertyValue(this.parseProperty(name)).trim() || null;
1616
}
1717

core/pfe-core/controllers/floating-dom-controller.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,19 @@ export class FloatingDOMController implements ReactiveController {
6464
}
6565

6666
/** The crosswise alignment of the invoker on which to display the floating DOM */
67-
get alignment() {
67+
get alignment(): Alignment {
6868
return this.#alignment ?? 'center';
6969
}
7070

7171
/** The side of the invoker on which to display the floating DOM */
72-
get anchor() {
72+
get anchor(): Anchor {
7373
return this.#anchor ?? '';
7474
}
7575

7676
/**
7777
* When true, the floating DOM is visible
7878
*/
79-
get open() {
79+
get open(): boolean {
8080
return this.#open;
8181
}
8282

@@ -106,7 +106,7 @@ export class FloatingDOMController implements ReactiveController {
106106
};
107107
}
108108

109-
hostDisconnected() {
109+
hostDisconnected(): void {
110110
this.#cleanup?.();
111111
}
112112

@@ -167,8 +167,15 @@ export class FloatingDOMController implements ReactiveController {
167167
this.host.requestUpdate();
168168
}
169169

170-
/** Show the floating DOM */
171-
async show({ offset, placement, flip, fallbackPlacements }: ShowOptions = {}) {
170+
/**
171+
* Show the floating DOM
172+
* @param [options={}]
173+
* @param options.offset
174+
* @param options.placement
175+
* @param options.flip
176+
* @param options.fallbackPlacements
177+
* */
178+
async show({ offset, placement, flip, fallbackPlacements }: ShowOptions = {}): Promise<void> {
172179
const invoker = this.#invoker;
173180
const content = this.#content;
174181
if (!invoker || !content) {
@@ -187,7 +194,7 @@ export class FloatingDOMController implements ReactiveController {
187194
}
188195

189196
/** Hide the floating DOM */
190-
async hide() {
197+
async hide(): Promise<void> {
191198
await this.host.updateComplete;
192199
while (this.#opening && !this.open) {
193200
await new Promise(requestAnimationFrame);

0 commit comments

Comments
 (0)