Skip to content

Commit

Permalink
Support customizing shadow root attachment mode (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
eligrey authored Jun 11, 2024
1 parent 23797d1 commit cdf3fb8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/transcend-io/consent-manager-ui.git"
},
"homepage": "https://github.com/transcend-io/consent-manager-ui",
"version": "4.14.4",
"version": "4.15.0",
"license": "MIT",
"main": "build/ui",
"files": [
Expand Down Expand Up @@ -44,7 +44,7 @@
},
"devDependencies": {
"@monaco-editor/react": "^4.4.5",
"@transcend-io/airgap.js-types": "^10.12.4",
"@transcend-io/airgap.js-types": "^10.12.5",
"@transcend-io/type-utils": "^1.0.7",
"@types/node": "^17.0.21",
"@typescript-eslint/eslint-plugin": "^5.12.1",
Expand Down
9 changes: 8 additions & 1 deletion src/consent-manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ export const injectConsentManagerApp = async (

try {
const shadowRoot =
consentManager?.attachShadow?.({ mode: 'closed' }) || consentManager;
consentManager?.attachShadow?.({
mode:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(mergedConfig.config.uiShadowRoot as any as
| undefined
| 'closed'
| 'open') || 'closed',
}) || consentManager;

// Create an inner div for event listeners
appContainer ??= createHTMLElement('div');
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1155,14 +1155,14 @@ __metadata:
languageName: node
linkType: hard

"@transcend-io/airgap.js-types@npm:^10.12.4":
version: 10.12.4
resolution: "@transcend-io/airgap.js-types@npm:10.12.4"
"@transcend-io/airgap.js-types@npm:^10.12.5":
version: 10.12.5
resolution: "@transcend-io/airgap.js-types@npm:10.12.5"
dependencies:
"@transcend-io/type-utils": ^1.2.0
fp-ts: ^2.16.1
io-ts: ^2.2.21
checksum: 3f0e23c9e1f8cd50f6d2f98854e60260fd50689153767b58f48a1feb8db05d00d9b7237b5b2cc3feda7a2772ea0aab0beaff082cd012bc1374c29eaecc3f1efb
checksum: a9a327f5909e847734b6fd54761aad4e4a73e8d3bd16ca57d370f9f20cdfce5221006a4a1b3e0ad7ec4d3d144b5f962d12b7429e17c2328008170da9fe22740e
languageName: node
linkType: hard

Expand All @@ -1183,7 +1183,7 @@ __metadata:
resolution: "@transcend-io/consent-manager-ui@workspace:."
dependencies:
"@monaco-editor/react": ^4.4.5
"@transcend-io/airgap.js-types": ^10.12.4
"@transcend-io/airgap.js-types": ^10.12.5
"@transcend-io/internationalization": ^1.6.0
"@transcend-io/logger": ^1.1.0
"@transcend-io/type-utils": ^1.0.7
Expand Down

0 comments on commit cdf3fb8

Please sign in to comment.