@easygov/react-components 0.9.0 → 0.10.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/README.md CHANGED
@@ -187,6 +187,34 @@ defines.
187
187
  the language now — read it with `useEasygovDisplayLanguage()`, set it with
188
188
  `setEasygovDisplayLanguage()`.
189
189
 
190
+ ### Publishing the business module's version
191
+
192
+ A business module frontend embedding `EasygovHeader` can publish its own version number so it
193
+ appears in the environment badge's tooltip alongside the library and backend versions:
194
+
195
+ ```ts
196
+ import { setEasygovBusinessModuleVersion } from '@easygov/react-components';
197
+
198
+ setEasygovBusinessModuleVersion('2.4.1');
199
+ ```
200
+
201
+ Call it whenever your app knows its own version — at startup is typical. It can be called
202
+ before or after any `EasygovHeader` has mounted, and calling it again later (e.g. after a
203
+ version changes) simply updates the tooltip. Until it is called, the tooltip shows only the
204
+ existing `UI-Version` and `Backend-Version` lines, exactly as it did before this API existed.
205
+
206
+ Outside React — including `<eg-easygov-header>` — call the same setter on the web-components
207
+ global instead:
208
+
209
+ ```js
210
+ window.easygov.setBusinessModuleVersion('2.4.1');
211
+ ```
212
+
213
+ **A page using `<eg-easygov-header>` must call `window.easygov.setBusinessModuleVersion`, not
214
+ the npm function.** That bundle inlines its own copy of this library, so the npm function
215
+ would write into a different store instance than the one the element reads from — the same
216
+ caveat that already applies to `useEasygovDisplayLanguage` in that context (see above).
217
+
190
218
  ## License
191
219
 
192
220
  MIT
@@ -450,7 +450,22 @@ interface EasygovVersionInfo {
450
450
  * unresolved origin, malformed body) — there is no retry.
451
451
  */
452
452
  backendVersion: string | null;
453
+ /**
454
+ * The embedding business module's own version, published via `setEasygovFunctionModuleVersion`.
455
+ * Null until a consumer calls the setter — EasygovHeader itself never sets this and has no
456
+ * way to discover it on its own, unlike backendVersion.
457
+ */
458
+ businessModuleVersion: string | null;
453
459
  }
460
+ /**
461
+ * Publishes the embedding business module's own version into the store, so EasygovHeader's version
462
+ * tooltip can show it alongside the library and backend versions. Safe to call at any time —
463
+ * before or after any EasygovHeader mounts — and safe to call more than once; each call
464
+ * overwrites the previous value and notifies subscribers. There is no corresponding fetch:
465
+ * EasygovHeader has no way to discover a business module's version on its own, so this is the only
466
+ * way the field is ever set.
467
+ */
468
+ declare function setEasygovBusinessModuleVersion(version: string): void;
454
469
 
455
470
  declare const dictionaries: {
456
471
  de: {
@@ -650,4 +665,4 @@ declare function getEasygovDisplayLanguage(): Locale;
650
665
  declare function setEasygovDisplayLanguage(locale: Locale): void;
651
666
  declare function subscribeEasygovDisplayLanguage(listener: () => void): () => void;
652
667
 
653
- export { type AuthStatus, BrandBase, BrandEasygov, BrandFacebook, BrandKdk, BrandLinkedin, type BrandProps, BrandSeg, BrandSgv, BrandSsv, BrandSwiss, BrandXing, BrandYoutube, Button, type ButtonProps, type DesktopSpan, Dropdown, DropdownChip, DropdownChipsOverflow, type DropdownChipsOverflowProps, DropdownChipsTrigger, type DropdownChipsTriggerProps, DropdownCollection, DropdownEmpty, DropdownGroup, DropdownGroupLabel, DropdownHelperText, type DropdownHelperTextProps, DropdownInput, DropdownItem, type DropdownItemProps, DropdownItemText, DropdownLabel, type DropdownLabelProps, DropdownList, DropdownPopup, type DropdownPopupProps, DropdownSeparator, DropdownToggle, DropdownTrigger, type DropdownTriggerProps, DropdownValue, EasygovFooter, EasygovHeader, type EasygovHeaderContext, type EasygovHeaderProps, type EasygovSession, type EasygovVersionInfo, ErrorDialog, type ErrorDialogProps, Grid, GridItem, type GridItemProps, type GridProps, type AccountVerificationStatus as HeaderContextAccountVerificationStatus, type HeaderContextClaims, type IndividualAccount as HeaderContextIndividualAccount, type ManagementRole as HeaderContextManagementRole, type ManagementRoleStatus as HeaderContextManagementRoleStatus, type ManagementRoleType as HeaderContextManagementRoleType, type OrganizationAccount as HeaderContextOrganizationAccount, type ProcessStatus as HeaderContextProcessStatus, type UserProfile as HeaderContextUserProfile, Heading, type HeadingProps, Input, type InputProps, type Locale, type MobileSpan, NavigationMenu, NavigationMenuAnchor, type NavigationMenuAnchorProps, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, RequireCustomerAccount, type RequireCustomerAccountProps, RequireSession, type RequireSessionProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, SelectHelperText, type SelectHelperTextProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, type SelectedCustomerAccount, type SelectedProcess, type SessionUser, type TabletSpan, Text, TextLink, type TextLinkProps, type TextProps, buttonVariants, getAuthStatus, getEasygovDisplayLanguage, headingVariants, requireSession, setEasygovDisplayLanguage, subscribeEasygovDisplayLanguage, textLinkVariants, textVariants, useEasygovAuthStatus, useEasygovDisplayLanguage, useEasygovHeaderContext, useEasygovSession, useEasygovVersionInfo, useRequireCustomerAccount };
668
+ export { type AuthStatus, BrandBase, BrandEasygov, BrandFacebook, BrandKdk, BrandLinkedin, type BrandProps, BrandSeg, BrandSgv, BrandSsv, BrandSwiss, BrandXing, BrandYoutube, Button, type ButtonProps, type DesktopSpan, Dropdown, DropdownChip, DropdownChipsOverflow, type DropdownChipsOverflowProps, DropdownChipsTrigger, type DropdownChipsTriggerProps, DropdownCollection, DropdownEmpty, DropdownGroup, DropdownGroupLabel, DropdownHelperText, type DropdownHelperTextProps, DropdownInput, DropdownItem, type DropdownItemProps, DropdownItemText, DropdownLabel, type DropdownLabelProps, DropdownList, DropdownPopup, type DropdownPopupProps, DropdownSeparator, DropdownToggle, DropdownTrigger, type DropdownTriggerProps, DropdownValue, EasygovFooter, EasygovHeader, type EasygovHeaderContext, type EasygovHeaderProps, type EasygovSession, type EasygovVersionInfo, ErrorDialog, type ErrorDialogProps, Grid, GridItem, type GridItemProps, type GridProps, type AccountVerificationStatus as HeaderContextAccountVerificationStatus, type HeaderContextClaims, type IndividualAccount as HeaderContextIndividualAccount, type ManagementRole as HeaderContextManagementRole, type ManagementRoleStatus as HeaderContextManagementRoleStatus, type ManagementRoleType as HeaderContextManagementRoleType, type OrganizationAccount as HeaderContextOrganizationAccount, type ProcessStatus as HeaderContextProcessStatus, type UserProfile as HeaderContextUserProfile, Heading, type HeadingProps, Input, type InputProps, type Locale, type MobileSpan, NavigationMenu, NavigationMenuAnchor, type NavigationMenuAnchorProps, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, RequireCustomerAccount, type RequireCustomerAccountProps, RequireSession, type RequireSessionProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, SelectHelperText, type SelectHelperTextProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, type SelectedCustomerAccount, type SelectedProcess, type SessionUser, type TabletSpan, Text, TextLink, type TextLinkProps, type TextProps, buttonVariants, getAuthStatus, getEasygovDisplayLanguage, headingVariants, requireSession, setEasygovBusinessModuleVersion, setEasygovDisplayLanguage, subscribeEasygovDisplayLanguage, textLinkVariants, textVariants, useEasygovAuthStatus, useEasygovDisplayLanguage, useEasygovHeaderContext, useEasygovSession, useEasygovVersionInfo, useRequireCustomerAccount };