@wippy-fe/webcomponent-core 0.0.20 → 0.0.21
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/README.md +6 -7
- package/package.json +4 -4
- package/src/css-loader.ts +0 -1
- package/src/types.ts +2 -3
package/README.md
CHANGED
|
@@ -46,7 +46,6 @@ Shared **platform CSS** loaded at runtime from the Wippy host into the shadow ro
|
|
|
46
46
|
|
|
47
47
|
| Key | What it provides | When to include |
|
|
48
48
|
|-----|-----------------|-----------------|
|
|
49
|
-
| `fontCssUrl` | Platform font definitions | Almost always — skip only if using fully custom fonts |
|
|
50
49
|
| `themeConfigUrl` | CSS custom properties (color scales, spacing, radii, etc.) matching the host theme | **Recommended for all components.** This is what makes your component look consistent with the host. At dev time, a local `theme-config.css` provides fallback values; at runtime the host injects the real theme. |
|
|
51
50
|
| `primeVueCssUrl` | PrimeVue component classes (`p-button`, `p-input`, etc.) in unstyled mode, styled to match the host | **Include if using any PrimeVue components** (buttons, forms, tables, etc.). Skip only for fully custom UI with zero PrimeVue usage. |
|
|
52
51
|
| `markdownCssUrl` | Styles for rendered markdown blocks | **Include only if rendering markdown.** |
|
|
@@ -56,19 +55,19 @@ Shared **platform CSS** loaded at runtime from the Wippy host into the shadow ro
|
|
|
56
55
|
|
|
57
56
|
```ts
|
|
58
57
|
// Standard component using PrimeVue UI (most common)
|
|
59
|
-
hostCssKeys: ['
|
|
58
|
+
hostCssKeys: ['themeConfigUrl', 'primeVueCssUrl', 'iframeCssUrl']
|
|
60
59
|
|
|
61
60
|
// Also renders markdown content
|
|
62
|
-
hostCssKeys: ['
|
|
61
|
+
hostCssKeys: ['themeConfigUrl', 'primeVueCssUrl', 'markdownCssUrl', 'iframeCssUrl']
|
|
63
62
|
|
|
64
63
|
// Minimal: just theme variables, no PrimeVue
|
|
65
|
-
hostCssKeys: ['
|
|
64
|
+
hostCssKeys: ['themeConfigUrl', 'iframeCssUrl']
|
|
66
65
|
|
|
67
66
|
// Fully self-styled, no host inheritance
|
|
68
67
|
hostCssKeys: []
|
|
69
68
|
```
|
|
70
69
|
|
|
71
|
-
Default (when omitted): all
|
|
70
|
+
Default (when omitted): all four keys.
|
|
72
71
|
|
|
73
72
|
> **Note on dev-time duplication:** Your component's `styles.css` may import `theme-config.css` for local dev (so Tailwind/PostCSS can resolve theme variables). At runtime, the host provides the real theme via `themeConfigUrl`. This duplication is a known trade-off — the host's runtime values take precedence.
|
|
74
73
|
|
|
@@ -173,7 +172,7 @@ interface WippyPropDefinition {
|
|
|
173
172
|
items?: { type: string }
|
|
174
173
|
}
|
|
175
174
|
|
|
176
|
-
type HostCssKey = '
|
|
175
|
+
type HostCssKey = 'themeConfigUrl' | 'primeVueCssUrl' | 'markdownCssUrl' | 'iframeCssUrl'
|
|
177
176
|
```
|
|
178
177
|
|
|
179
178
|
## Migration from monolithic pattern
|
|
@@ -191,7 +190,7 @@ class MyElement extends WippyElement {
|
|
|
191
190
|
static get wippyConfig() {
|
|
192
191
|
return {
|
|
193
192
|
propsSchema: pkg.wippy.props,
|
|
194
|
-
hostCssKeys: ['
|
|
193
|
+
hostCssKeys: ['themeConfigUrl', 'primeVueCssUrl', 'iframeCssUrl'],
|
|
195
194
|
containerClasses: ['h-full'],
|
|
196
195
|
inlineCss: stylesText,
|
|
197
196
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wippy-fe/webcomponent-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "Framework-agnostic base class for Wippy web components — shadow DOM, CSS loading, schema-driven prop parsing, and lifecycle management.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"package.json"
|
|
11
11
|
],
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@
|
|
14
|
-
"@
|
|
13
|
+
"@iconify/vue": "^5.0.0",
|
|
14
|
+
"@wippy-fe/proxy": "0.0.21"
|
|
15
15
|
},
|
|
16
16
|
"license": "UNLICENSED"
|
|
17
|
-
}
|
|
17
|
+
}
|
package/src/css-loader.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface WippyPropsSchema {
|
|
|
31
31
|
* Keys that map to CSS URLs exposed by `@wippy-fe/proxy`'s `hostCss` object.
|
|
32
32
|
* Pass a subset to `hostCssKeys` in config to load only what you need.
|
|
33
33
|
*/
|
|
34
|
-
export type HostCssKey = '
|
|
34
|
+
export type HostCssKey = 'themeConfigUrl' | 'primeVueCssUrl' | 'markdownCssUrl' | 'iframeCssUrl'
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Configuration object returned by `static get wippyConfig()`.
|
|
@@ -57,7 +57,6 @@ export interface WippyElementConfig<Props = Record<string, unknown>> {
|
|
|
57
57
|
* The host app provides these CSS assets at runtime via `@wippy-fe/proxy`.
|
|
58
58
|
*
|
|
59
59
|
* Available keys:
|
|
60
|
-
* - `fontCssUrl` — Platform font definitions. Include unless using fully custom fonts.
|
|
61
60
|
* - `themeConfigUrl` — CSS custom properties (color scales, spacing, etc.) matching the
|
|
62
61
|
* host theme. **Recommended for all components** — gives your component the same look
|
|
63
62
|
* as the host app. At dev time, a local copy (`theme-config.css`) provides fallback
|
|
@@ -71,7 +70,7 @@ export interface WippyElementConfig<Props = Record<string, unknown>> {
|
|
|
71
70
|
* components** so scrollbars look identical to the host app.
|
|
72
71
|
*
|
|
73
72
|
* Pass `[]` to skip host CSS entirely (fully self-styled component).
|
|
74
|
-
* Defaults to `['
|
|
73
|
+
* Defaults to `['themeConfigUrl', 'primeVueCssUrl', 'markdownCssUrl', 'iframeCssUrl']`.
|
|
75
74
|
*/
|
|
76
75
|
hostCssKeys?: HostCssKey[]
|
|
77
76
|
/**
|