Skip to content

Commit 031ed91

Browse files
committed
Added Trusted Types to iconSVG
Expanded the type of iconSVG in a drawers plugin to support trusted types.
1 parent 63a2564 commit 031ed91

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@
7171
"@types/jest": "^27.5.1",
7272
"@types/lodash": "^4.14.176",
7373
"@types/node": "^18.18.5",
74-
"@types/react": "^16.14.20",
74+
"@types/react": "^16.14.40",
7575
"@types/react-dom": "^16.9.14",
7676
"@types/react-resizable": "^1.7.4",
7777
"@types/react-router": "^5.1.18",
7878
"@types/react-router-dom": "^5.3.2",
7979
"@types/react-transition-group": "^4.4.4",
80+
"@types/trusted-types": "^2.0.7",
8081
"@types/webpack-env": "^1.16.3",
8182
"@typescript-eslint/eslint-plugin": "^5.45.0",
8283
"@typescript-eslint/parser": "^5.45.0",

src/internal/plugins/controllers/drawers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3+
import type { TrustedHTML } from 'trusted-types/lib';
4+
35
import debounce from '../../debounce';
46
import { NonCancelableEventHandler } from '../../events';
57

@@ -18,7 +20,7 @@ export interface DrawerConfig {
1820
orderPriority?: number;
1921
defaultActive?: boolean;
2022
trigger: {
21-
iconSvg: string;
23+
iconSvg: string | TrustedHTML;
2224
};
2325
mountContent: (container: HTMLElement) => void;
2426
unmountContent: (container: HTMLElement) => void;

0 commit comments

Comments
 (0)