@astrojs/lit
Advanced tools
Comparing version 1.2.0 to 1.2.1
# @astrojs/lit | ||
## 1.2.1 | ||
### Patch Changes | ||
- [#6351](https://github.com/withastro/astro/pull/6351) [`26bf12ef3`](https://github.com/withastro/astro/commit/26bf12ef3c7ab874a23ac753f841f7bb329c9361) Thanks [@hrmcdonald](https://github.com/hrmcdonald)! - Render DSD attributes based on `shadowRootOptions` | ||
## 1.2.0 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@astrojs/lit", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Use Lit components within Astro", | ||
@@ -35,4 +35,4 @@ "type": "module", | ||
"devDependencies": { | ||
"astro": "2.0.7", | ||
"astro-scripts": "0.0.10", | ||
"astro": "2.0.16", | ||
"astro-scripts": "0.0.12", | ||
"chai": "^4.3.6", | ||
@@ -39,0 +39,0 @@ "cheerio": "^1.0.0-rc.11", |
@@ -65,3 +65,7 @@ import './server-shim.js'; | ||
if (shadowContents !== undefined) { | ||
yield '<template shadowroot="open" shadowrootmode="open">'; | ||
const { mode = 'open', delegatesFocus } = instance.shadowRootOptions ?? {}; | ||
// `delegatesFocus` is intentionally allowed to coerce to boolean to | ||
// match web platform behavior. | ||
const delegatesfocusAttr = delegatesFocus ? ' shadowrootdelegatesfocus' : ''; | ||
yield `<template shadowroot="${mode}" shadowrootmode="${mode}"${delegatesfocusAttr}>`; | ||
yield* shadowContents; | ||
@@ -68,0 +72,0 @@ yield '</template>'; |
@@ -86,2 +86,16 @@ import { expect } from 'chai'; | ||
}); | ||
it('should render DSD attributes based on shadowRootOptions', async () => { | ||
const tagName = 'lit-component'; | ||
customElements.define( | ||
tagName, | ||
class extends LitElement { | ||
static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true }; | ||
} | ||
); | ||
const render = await renderToStaticMarkup(tagName); | ||
expect(render).to.deep.equal({ | ||
html: `<${tagName}><template shadowroot=\"open\" shadowrootmode=\"open\" shadowrootdelegatesfocus><!--lit-part--><!--/lit-part--></template></${tagName}>`, | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37577
554