@easygov/web-components 0.2.0 → 0.3.0
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/dist/chunk-QXJ6UAPW.js +27 -0
- package/dist/chunk-QXJ6UAPW.js.map +1 -0
- package/dist/header.js +1 -1
- package/dist/header.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-MPITA5PQ.js +0 -27
- package/dist/chunk-MPITA5PQ.js.map +0 -1
package/dist/header.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e}from"./chunk-QXJ6UAPW.js";import{a as o,b as r}from"./chunk-4YTFOHWE.js";import"./chunk-O3IXHDLE.js";var m=r(o(e,{shadow:"open"}));customElements.define("eg-easygov-header",m);
|
|
2
2
|
//# sourceMappingURL=header.js.map
|
package/dist/header.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/elements/easygov-header.ts"],"sourcesContent":["import r2wc from '@r2wc/react-to-web-component';\nimport { EasygovHeader } from '@easygov/react-components';\nimport { withSharedStyles } from '../shadow-styles';\nimport '../inject-fonts';\n\n// No props are mapped.\n//\n// `locale` is gone as of EGOV-1451: the DisplayLanguage is no longer owned by the header. It\n// resolves from the `eg-display-language` cookie shared across every EasyGov subdomain, then the\n// browser language, then \"de\" — so a `locale` attribute here would have been a second, conflicting\n// source of truth for a value the whole page already agrees on.\n//\n// onLanguageChange, onNavigate and onContextChange are NOT mapped either — EasygovHeader\n// dispatches 'languagechange', 'navigate' and 'contextchange' CustomEvents directly, and function\n// props can't cross an HTML attribute boundary anyway. Web Component consumers must use\n// addEventListener for all three.\nconst EgEasygovHeader = withSharedStyles(\n r2wc(EasygovHeader, {\n shadow: 'open',\n }),\n);\n\ncustomElements.define('eg-easygov-header', EgEasygovHeader);\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/elements/easygov-header.ts"],"sourcesContent":["import r2wc from '@r2wc/react-to-web-component';\nimport { EasygovHeader } from '@easygov/react-components';\nimport { withSharedStyles } from '../shadow-styles';\nimport '../inject-fonts';\n\n// No props are mapped.\n//\n// `locale` is gone as of EGOV-1451: the DisplayLanguage is no longer owned by the header. It\n// resolves from the `eg-display-language` cookie shared across every EasyGov subdomain, then the\n// browser language, then \"de\" — so a `locale` attribute here would have been a second, conflicting\n// source of truth for a value the whole page already agrees on.\n//\n// onLanguageChange, onNavigate and onContextChange are NOT mapped either — EasygovHeader\n// dispatches 'languagechange', 'navigate' and 'contextchange' CustomEvents directly, and function\n// props can't cross an HTML attribute boundary anyway. Web Component consumers must use\n// addEventListener for all three.\nconst EgEasygovHeader = withSharedStyles(\n r2wc(EasygovHeader, {\n shadow: 'open',\n }),\n);\n\ncustomElements.define('eg-easygov-header', EgEasygovHeader);\n"],"mappings":"8GAgBA,IAAMA,EAAkBC,EACtBC,EAAKC,EAAe,CAClB,OAAQ,MACV,CAAC,CACH,EAEA,eAAe,OAAO,oBAAqBH,CAAe","names":["EgEasygovHeader","withSharedStyles","s","EasygovHeader"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare function getDisplayLanguage(): string;
|
|
2
2
|
declare function setDisplayLanguage(locale: string): void;
|
|
3
3
|
declare function subscribeDisplayLanguage(listener: () => void): () => void;
|
|
4
|
+
declare function setBusinessModuleVersion(version: string): void;
|
|
4
5
|
|
|
5
|
-
export { getDisplayLanguage, setDisplayLanguage, subscribeDisplayLanguage };
|
|
6
|
+
export { getDisplayLanguage, setBusinessModuleVersion, setDisplayLanguage, subscribeDisplayLanguage };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,b as
|
|
1
|
+
import{a as e,b as a,c as i,d as g}from"./chunk-QXJ6UAPW.js";import"./chunk-O3IXHDLE.js";function o(){return a()}function t(s){i(s)}function r(s){return g(s)}function u(s){e(s)}export{o as getDisplayLanguage,u as setBusinessModuleVersion,t as setDisplayLanguage,r as subscribeDisplayLanguage};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// No side-effecting element registration here. Consumers that need\n// <eg-easygov-header>/<eg-easygov-footer> registered import '@easygov/web-components/header'\n// and/or '@easygov/web-components/footer' directly, so an app using only one element doesn't\n// pull in the other.\n//\n// This entry exposes only the DisplayLanguage API (wrapped in local functions, not re-exported\n// directly) — deliberately not the raw React components (EasygovHeader/EasygovFooter) either.\n// @easygov/react-components' exports point at its JSX .tsx source (see CLAUDE.md), so any live\n// `from '@easygov/react-components'` type specifier here — a component re-export or a bare\n// `export { ... } from` for these functions — would force every consumer's compiler to resolve\n// that source, breaking non-React/non-JSX consumers like Angular. Wrapping locally keeps the\n// emitted .d.ts self-contained; `locale` is widened to `string` for the same reason, decoupling\n// our public types from react-components' internal `Locale` union. A React app that wants the\n// component directly should depend on @easygov/react-components itself.\n//\n// This bundle inlines its own copy of @easygov/react-components, so a web-component consumer\n// that separately npm-imported @easygov/react-components directly would be talking to a\n// *different* store instance — this package's own export is the supported surface here.\nimport {\n getEasygovDisplayLanguage,\n setEasygovDisplayLanguage,\n subscribeEasygovDisplayLanguage,\n} from '@easygov/react-components';\n\nexport function getDisplayLanguage(): string {\n return getEasygovDisplayLanguage();\n}\n\n// No runtime validation here, matching setEasygovDisplayLanguage itself (it writes the cookie\n// unconditionally with no isSupportedLocale check) and this package's previous public contract\n// (the CDN global's setDisplayLanguage(locale: string) was equally unchecked). isSupportedLocale\n// is not part of @easygov/react-components' public exports, so this package has no way to guard\n// the value before the cast even if it wanted to; an invalid locale ends up handled the same way\n// t() already handles one — falling back to \"en\"/the raw key — not a new failure mode.\nexport function setDisplayLanguage(locale: string): void {\n setEasygovDisplayLanguage(locale as Parameters<typeof setEasygovDisplayLanguage>[0]);\n}\n\nexport function subscribeDisplayLanguage(listener: () => void): () => void {\n return subscribeEasygovDisplayLanguage(listener);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// No side-effecting element registration here. Consumers that need\n// <eg-easygov-header>/<eg-easygov-footer> registered import '@easygov/web-components/header'\n// and/or '@easygov/web-components/footer' directly, so an app using only one element doesn't\n// pull in the other.\n//\n// This entry exposes only the DisplayLanguage API (wrapped in local functions, not re-exported\n// directly) — deliberately not the raw React components (EasygovHeader/EasygovFooter) either.\n// @easygov/react-components' exports point at its JSX .tsx source (see CLAUDE.md), so any live\n// `from '@easygov/react-components'` type specifier here — a component re-export or a bare\n// `export { ... } from` for these functions — would force every consumer's compiler to resolve\n// that source, breaking non-React/non-JSX consumers like Angular. Wrapping locally keeps the\n// emitted .d.ts self-contained; `locale` is widened to `string` for the same reason, decoupling\n// our public types from react-components' internal `Locale` union. A React app that wants the\n// component directly should depend on @easygov/react-components itself.\n//\n// This bundle inlines its own copy of @easygov/react-components, so a web-component consumer\n// that separately npm-imported @easygov/react-components directly would be talking to a\n// *different* store instance — this package's own export is the supported surface here.\nimport {\n getEasygovDisplayLanguage,\n setEasygovDisplayLanguage,\n setEasygovBusinessModuleVersion,\n subscribeEasygovDisplayLanguage,\n} from '@easygov/react-components';\n\nexport function getDisplayLanguage(): string {\n return getEasygovDisplayLanguage();\n}\n\n// No runtime validation here, matching setEasygovDisplayLanguage itself (it writes the cookie\n// unconditionally with no isSupportedLocale check) and this package's previous public contract\n// (the CDN global's setDisplayLanguage(locale: string) was equally unchecked). isSupportedLocale\n// is not part of @easygov/react-components' public exports, so this package has no way to guard\n// the value before the cast even if it wanted to; an invalid locale ends up handled the same way\n// t() already handles one — falling back to \"en\"/the raw key — not a new failure mode.\nexport function setDisplayLanguage(locale: string): void {\n setEasygovDisplayLanguage(locale as Parameters<typeof setEasygovDisplayLanguage>[0]);\n}\n\nexport function subscribeDisplayLanguage(listener: () => void): () => void {\n return subscribeEasygovDisplayLanguage(listener);\n}\n\nexport function setBusinessModuleVersion(version: string): void {\n setEasygovBusinessModuleVersion(version);\n}\n"],"mappings":"yFAyBO,SAASA,GAA6B,CAC3C,OAAOC,EAA0B,CACnC,CAQO,SAASC,EAAmBC,EAAsB,CACvDC,EAA0BD,CAAyD,CACrF,CAEO,SAASE,EAAyBC,EAAkC,CACzE,OAAOC,EAAgCD,CAAQ,CACjD,CAEO,SAASE,EAAyBC,EAAuB,CAC9DC,EAAgCD,CAAO,CACzC","names":["getDisplayLanguage","getEasygovDisplayLanguage","setDisplayLanguage","locale","setEasygovDisplayLanguage","subscribeDisplayLanguage","listener","subscribeEasygovDisplayLanguage","setBusinessModuleVersion","version","setEasygovBusinessModuleVersion"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easygov/web-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Framework-agnostic custom elements for EasyGov, wrapping @easygov/react-components as a self-contained browser bundle.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@easygov/eslint-config": "0.0.0",
|
|
46
|
-
"@easygov/react-components": "0.
|
|
46
|
+
"@easygov/react-components": "0.10.0",
|
|
47
47
|
"@easygov/typescript-config": "0.0.0",
|
|
48
48
|
"@types/node": "^24.0.0",
|
|
49
49
|
"@types/react": "19.3.0",
|