@wippy-fe/webcomponent-core 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -17
- package/src/css-loader.ts +3 -3
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@wippy-fe/webcomponent-core",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Framework-agnostic base class for Wippy web components — shadow DOM, CSS loading, schema-driven prop parsing, and lifecycle management.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "src/index.ts",
|
|
7
|
-
"types": "src/index.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"src/",
|
|
10
|
-
"package.json"
|
|
11
|
-
],
|
|
12
|
-
"peerDependencies": {
|
|
13
|
-
"@wippy-fe/proxy": "^0.0.
|
|
14
|
-
"@iconify/vue": "^5.0.0"
|
|
15
|
-
},
|
|
16
|
-
"license": "UNLICENSED"
|
|
17
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@wippy-fe/webcomponent-core",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"description": "Framework-agnostic base class for Wippy web components — shadow DOM, CSS loading, schema-driven prop parsing, and lifecycle management.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"src/",
|
|
10
|
+
"package.json"
|
|
11
|
+
],
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"@wippy-fe/proxy": "^0.0.8",
|
|
14
|
+
"@iconify/vue": "^5.0.0"
|
|
15
|
+
},
|
|
16
|
+
"license": "UNLICENSED"
|
|
17
|
+
}
|
package/src/css-loader.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { hostCss, loadCss } from '@wippy-fe/proxy'
|
|
2
1
|
import type { HostCssKey } from './types.ts'
|
|
2
|
+
import { hostCss, loadCss } from '@wippy-fe/proxy'
|
|
3
3
|
|
|
4
4
|
const DEFAULT_HOST_CSS_KEYS: HostCssKey[] = [
|
|
5
5
|
'fontCssUrl',
|
|
@@ -16,12 +16,12 @@ const DEFAULT_HOST_CSS_KEYS: HostCssKey[] = [
|
|
|
16
16
|
export function loadHostCss(shadow: ShadowRoot, keys?: HostCssKey[]): Promise<void> {
|
|
17
17
|
const cssKeys = keys ?? DEFAULT_HOST_CSS_KEYS
|
|
18
18
|
return Promise.all(
|
|
19
|
-
cssKeys.map(
|
|
19
|
+
cssKeys.map(key => loadCss(hostCss[key])),
|
|
20
20
|
).then((cssChunks) => {
|
|
21
21
|
for (const css of cssChunks) {
|
|
22
22
|
const style = document.createElement('style')
|
|
23
23
|
style.textContent = css
|
|
24
|
-
style.setAttribute('role', '@wippy/host-css')
|
|
24
|
+
style.setAttribute('role', '@wippy-fe/host-css')
|
|
25
25
|
shadow.appendChild(style)
|
|
26
26
|
}
|
|
27
27
|
}).catch((err) => {
|