Skip to content

Commit 8dfffcd

Browse files
deps: adapt HTMLElement to HTMLStencilElement due to recent changes
1 parent 35cdd85 commit 8dfffcd

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

packages/drop-in/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"@stencil/core": "^4.0.0"
5959
},
6060
"devDependencies": {
61-
"@stencil/core": "4.37.1",
61+
"@stencil/core": "4.38.2",
6262
"@stencil/sass": "^3.2.2",
6363
"@types/iframe-resizer": "^4.0.0",
6464
"@types/jest": "^29.5.14",
@@ -71,7 +71,7 @@
7171
"puppeteer": "24.26.1",
7272
"sass": "^1.93.2",
7373
"ts-jest": "^29.4.5",
74-
"typescript": "^5.9.3"
74+
"typescript": "5.9.3"
7575
},
7676
"license": "MIT",
7777
"engines": {

packages/drop-in/src/components.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export namespace Components {
8181
* Open the minicart and set the opener so that the minicart can be closed by focusing on the opener. (available _only_ when the `cl-cart` component is used as _minicart_).
8282
* @param opener The opener of the minicart.
8383
*/
84-
"openMinicart": (opener: HTMLElement) => Promise<void>;
84+
"openMinicart": (opener: Pick<HTMLElement, "focus">) => Promise<void>;
8585
/**
8686
* If `true` the minicart automatically opens as soon as an item is added to the shopping cart (available _only_ when the `cl-cart` component is used as _minicart_).
8787
* @default false

packages/drop-in/src/components/cl-cart/cl-cart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class ClCart {
8282
/**
8383
* The opener of the minicart.
8484
*/
85-
@State() opener: HTMLElement | null = null
85+
@State() opener: Pick<HTMLElement, "focus"> | null = null
8686

8787
/**
8888
* Used for:
@@ -161,7 +161,7 @@ export class ClCart {
161161
* @param opener The opener of the minicart.
162162
*/
163163
@Method()
164-
async openMinicart(opener: HTMLElement): Promise<void> {
164+
async openMinicart(opener: Pick<HTMLElement, "focus">): Promise<void> {
165165
this.opener = opener
166166
this.open = true
167167
}

packages/drop-in/src/components/cl-cart/readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616

1717
## Methods
1818

19-
### `openMinicart(opener: HTMLElement) => Promise<void>`
19+
### `openMinicart(opener: Pick<HTMLElement, "focus">) => Promise<void>`
2020

2121
Open the minicart and set the opener so that the minicart can be closed by focusing on the opener.
2222
(available _only_ when the `cl-cart` component is used as _minicart_).
2323

2424
#### Parameters
2525

26-
| Name | Type | Description |
27-
| -------- | ------------- | --------------------------- |
28-
| `opener` | `HTMLElement` | The opener of the minicart. |
26+
| Name | Type | Description |
27+
| -------- | ----------------------------------------------------------- | --------------------------- |
28+
| `opener` | `{ focus: (options?: FocusOptions \| undefined) => void; }` | The opener of the minicart. |
2929

3030
#### Returns
3131

packages/drop-in/src/utils/validation-helpers.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ export function isValidCode(code: string | undefined): code is string {
44
return typeof code === "string" && code !== ""
55
}
66

7-
export function logCode(host: HTMLElement, code: string | undefined): void {
7+
export function logCode(
8+
host: Omit<HTMLElement, "autocorrect">,
9+
code: string | undefined,
10+
): void {
811
if (!isValidCode(code)) {
912
log("warn", '"code" attribute should be a not empty string.', host)
1013
}
@@ -22,7 +25,7 @@ export function isValidUnion<T extends string | undefined>(
2225
}
2326

2427
export function logUnion<T extends string | undefined>(
25-
host: HTMLElement,
28+
host: Omit<HTMLElement, "autocorrect">,
2629
attributeName: string,
2730
attributeValue: T,
2831
validValues: ReadonlyArray<NonNullable<T>>,

pnpm-lock.yaml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)