@sixbell-telco/sdk 4.2.0 → 4.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.
Files changed (251) hide show
  1. package/CHANGELOG.md +81 -1
  2. package/README.md +98 -66
  3. package/_index.css +2 -1586
  4. package/components/accordion/accordion-item/accordion-item.component.d.ts +1 -1
  5. package/components/alert/README.md +27 -0
  6. package/components/alert/index.d.ts +5 -0
  7. package/components/alert/public-api.d.ts +1 -0
  8. package/components/alert/src/alert.component.d.ts +85 -0
  9. package/components/audio-player/audio-timeline/audio-timeline.component.d.ts +1 -1
  10. package/components/audio-player/button-play/button-play.component.d.ts +7 -7
  11. package/components/audio-player/src/audio-player.component.d.ts +2 -2
  12. package/components/audio-player/volume-control/volume-control.component.d.ts +1 -1
  13. package/components/avatar/README.md +1 -0
  14. package/components/avatar/src/avatar.component.d.ts +2 -2
  15. package/components/badge/src/badge.component.d.ts +4 -4
  16. package/components/button/README.md +5 -4
  17. package/components/button/src/button.component.d.ts +38 -16
  18. package/components/card/README.md +2 -0
  19. package/components/card/card-footer/card-footer.component.d.ts +37 -2
  20. package/components/card/card-section-group/card-section-group.component.d.ts +1 -1
  21. package/components/card/src/card.component.d.ts +6 -6
  22. package/components/countdown/src/countdown.component.d.ts +4 -4
  23. package/components/data-table/README.md +26 -0
  24. package/components/data-table/expandable/expandable.component.d.ts +4 -4
  25. package/components/data-table/sortable-header/sortable-header.component.d.ts +1 -1
  26. package/components/data-table/src/data-table.component.d.ts +15 -8
  27. package/components/data-table/sub-component-toggle/sub-component-toggle.component.d.ts +1 -1
  28. package/components/description-list/README.md +27 -0
  29. package/components/description-list/index.d.ts +5 -0
  30. package/components/description-list/public-api.d.ts +1 -0
  31. package/components/description-list/src/description-list.component.d.ts +90 -0
  32. package/components/dialog/README.md +10 -6
  33. package/components/dialog/dialog-actions/dialog-actions.component.d.ts +4 -0
  34. package/components/dialog/src/dialog.component.d.ts +27 -6
  35. package/components/dialog/src/fullscreen-block-scroll-strategy.d.ts +31 -0
  36. package/components/divider/src/divider.component.d.ts +1 -1
  37. package/components/dropdown/README.md +1 -1
  38. package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +1 -1
  39. package/components/dropdown/dropdown-item/dropdown-item.component.d.ts +4 -4
  40. package/components/dropdown/dropdown-item-checkbox/dropdown-item-checkbox.component.d.ts +5 -5
  41. package/components/dropdown/dropdown-item-radio/dropdown-item-radio.component.d.ts +5 -5
  42. package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +1 -1
  43. package/components/dropdown-menu/README.md +1 -1
  44. package/components/dropdown-menu/bar/dropdown-menu-bar/dropdown-menu-bar.component.d.ts +1 -1
  45. package/components/dropdown-menu/bar/dropdown-menu-bar-content/dropdown-menu-bar-content.component.d.ts +1 -1
  46. package/components/dropdown-menu/bar/dropdown-menu-bar-item/dropdown-menu-bar-item.component.d.ts +3 -3
  47. package/components/dropdown-menu/bar/dropdown-menu-bar-item-checkbox/dropdown-menu-bar-item-checkbox.component.d.ts +4 -4
  48. package/components/dropdown-menu/bar/dropdown-menu-bar-item-radio/dropdown-menu-bar-item-radio.component.d.ts +4 -4
  49. package/components/dropdown-menu/bar/dropdown-menu-bar-sub-trigger/dropdown-menu-bar-sub-trigger.component.d.ts +1 -1
  50. package/components/dropdown-menu/bar/dropdown-menu-bar-trigger/dropdown-menu-bar-trigger.component.d.ts +1 -1
  51. package/components/dropdown-menu/context/dropdown-context-menu-trigger/dropdown-context-menu-trigger.component.d.ts +1 -1
  52. package/components/dropdown-menu/dropdown-menu-chevron/dropdown-menu-chevron.component.d.ts +1 -1
  53. package/components/dropdown-menu/src/dropdown-menu-item/dropdown-menu-item.component.d.ts +3 -3
  54. package/components/dropdown-menu/src/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.component.d.ts +1 -1
  55. package/components/empty-state/README.md +40 -0
  56. package/components/empty-state/index.d.ts +5 -0
  57. package/components/empty-state/public-api.d.ts +1 -0
  58. package/components/empty-state/src/empty-state.component.d.ts +73 -0
  59. package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +4 -4
  60. package/components/file-upload/file-uploader/file-uploader.component.d.ts +2 -2
  61. package/components/forms/checkbox/src/checkbox.component.d.ts +1 -1
  62. package/components/forms/combobox/README.md +1 -0
  63. package/components/forms/combobox/src/combobox.component.d.ts +21 -7
  64. package/components/forms/date-picker/src/date-picker.component.d.ts +16 -9
  65. package/components/forms/form-hint/README.md +29 -0
  66. package/components/forms/form-hint/index.d.ts +5 -0
  67. package/components/forms/form-hint/public-api.d.ts +1 -0
  68. package/components/forms/form-hint/src/form-hint.component.d.ts +38 -0
  69. package/components/forms/form-item/src/form-item.component.d.ts +45 -1
  70. package/components/forms/input/src/input.component.d.ts +15 -8
  71. package/components/forms/radio/src/radio.component.d.ts +1 -1
  72. package/components/forms/range/src/range.component.d.ts +18 -4
  73. package/components/forms/select/README.md +1 -0
  74. package/components/forms/select/src/select.component.d.ts +20 -5
  75. package/components/forms/switch/src/switch.component.d.ts +1 -1
  76. package/components/forms/textarea/src/textarea.component.d.ts +12 -5
  77. package/components/forms/toggle/src/toggle.component.d.ts +1 -1
  78. package/components/notification/src/notification.component.d.ts +1 -1
  79. package/components/overlay/README.md +1 -1
  80. package/components/overlay/overlay-trigger/overlay-trigger.component.d.ts +1 -1
  81. package/components/overlay/src/overlay.component.d.ts +1 -1
  82. package/components/paginator/components/pagination-item/pagination-item.component.d.ts +3 -3
  83. package/components/progress/src/progress.component.d.ts +1 -1
  84. package/components/segmented-button/README.md +57 -0
  85. package/components/segmented-button/index.d.ts +5 -0
  86. package/components/segmented-button/public-api.d.ts +1 -0
  87. package/components/segmented-button/src/segmented-button.component.d.ts +110 -0
  88. package/components/sonner/toaster/src/toaster.component.d.ts +3 -3
  89. package/components/tab/src/tab.component.d.ts +2 -2
  90. package/components/table/README.md +51 -3
  91. package/components/table/public-api.d.ts +1 -0
  92. package/components/table/src/table.component.d.ts +20 -13
  93. package/components/table/table-action/table-action.component.d.ts +14 -3
  94. package/components/table/table-actions/table-actions.component.d.ts +12 -1
  95. package/components/table/tokens/README.md +7 -0
  96. package/components/table/tokens/index.d.ts +5 -0
  97. package/components/table/tokens/public-api.d.ts +1 -0
  98. package/components/table/tokens/table-empty-state.d.ts +6 -0
  99. package/components/tooltip/README.md +22 -5
  100. package/components/tooltip/src/tooltip.component.d.ts +36 -4
  101. package/components/tree/README.md +73 -0
  102. package/components/tree/index.d.ts +5 -0
  103. package/components/tree/public-api.d.ts +1 -0
  104. package/components/tree/src/tree.component.d.ts +180 -0
  105. package/components/wizard/README.md +9 -0
  106. package/components/wizard/wizard-content/wizard-content.component.d.ts +1 -1
  107. package/components/wizard/wizard-wrapper/wizard-wrapper.component.d.ts +15 -6
  108. package/directives/auto-focus/src/auto-focus.directive.d.ts +1 -1
  109. package/directives/only-numbers/src/only-numbers.directive.d.ts +1 -1
  110. package/directives/truncate/README.md +49 -0
  111. package/directives/truncate/index.d.ts +5 -0
  112. package/directives/truncate/public-api.d.ts +1 -0
  113. package/directives/truncate/src/truncate-popover.component.d.ts +11 -0
  114. package/directives/truncate/src/truncate.directive.d.ts +96 -0
  115. package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +2 -2
  116. package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
  117. package/fesm2022/sixbell-telco-sdk-components-alert.mjs +152 -0
  118. package/fesm2022/sixbell-telco-sdk-components-alert.mjs.map +1 -0
  119. package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +15 -15
  120. package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
  121. package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +4 -4
  122. package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
  123. package/fesm2022/sixbell-telco-sdk-components-badge.mjs +5 -5
  124. package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
  125. package/fesm2022/sixbell-telco-sdk-components-button.mjs +53 -19
  126. package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
  127. package/fesm2022/sixbell-telco-sdk-components-card.mjs +61 -14
  128. package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
  129. package/fesm2022/sixbell-telco-sdk-components-countdown.mjs +5 -5
  130. package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
  131. package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +3 -3
  132. package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -1
  133. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +34 -33
  134. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
  135. package/fesm2022/sixbell-telco-sdk-components-description-list.mjs +200 -0
  136. package/fesm2022/sixbell-telco-sdk-components-description-list.mjs.map +1 -0
  137. package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +128 -17
  138. package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
  139. package/fesm2022/sixbell-telco-sdk-components-divider.mjs +2 -2
  140. package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -1
  141. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +16 -16
  142. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
  143. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs +2 -2
  144. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs.map +1 -1
  145. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +6 -6
  146. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
  147. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +17 -17
  148. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
  149. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +1 -1
  150. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
  151. package/fesm2022/sixbell-telco-sdk-components-empty-state.mjs +131 -0
  152. package/fesm2022/sixbell-telco-sdk-components-empty-state.mjs.map +1 -0
  153. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +9 -9
  154. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
  155. package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +2 -2
  156. package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
  157. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +71 -25
  158. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
  159. package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +23 -12
  160. package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
  161. package/fesm2022/sixbell-telco-sdk-components-forms-form-hint.mjs +81 -0
  162. package/fesm2022/sixbell-telco-sdk-components-forms-form-hint.mjs.map +1 -0
  163. package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs +45 -3
  164. package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs.map +1 -1
  165. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +27 -13
  166. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
  167. package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +2 -2
  168. package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
  169. package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +29 -7
  170. package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
  171. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +51 -15
  172. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
  173. package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
  174. package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
  175. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +27 -22
  176. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
  177. package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +2 -2
  178. package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
  179. package/fesm2022/sixbell-telco-sdk-components-notification.mjs +2 -2
  180. package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
  181. package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +3 -3
  182. package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
  183. package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +4 -4
  184. package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
  185. package/fesm2022/sixbell-telco-sdk-components-progress.mjs +2 -2
  186. package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
  187. package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs +329 -0
  188. package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs.map +1 -0
  189. package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +4 -4
  190. package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -1
  191. package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +4 -4
  192. package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -1
  193. package/fesm2022/sixbell-telco-sdk-components-tab.mjs +3 -3
  194. package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
  195. package/fesm2022/sixbell-telco-sdk-components-table-tokens.mjs +14 -0
  196. package/fesm2022/sixbell-telco-sdk-components-table-tokens.mjs.map +1 -0
  197. package/fesm2022/sixbell-telco-sdk-components-table.mjs +63 -32
  198. package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
  199. package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +156 -25
  200. package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
  201. package/fesm2022/sixbell-telco-sdk-components-tree.mjs +478 -0
  202. package/fesm2022/sixbell-telco-sdk-components-tree.mjs.map +1 -0
  203. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +18 -9
  204. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
  205. package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs +2 -2
  206. package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs.map +1 -1
  207. package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +2 -2
  208. package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
  209. package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs +339 -0
  210. package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs.map +1 -0
  211. package/fesm2022/sixbell-telco-sdk-layouts.mjs +43 -35
  212. package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
  213. package/fesm2022/sixbell-telco-sdk-utils-date.mjs +15 -2
  214. package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -1
  215. package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs +87 -2
  216. package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs.map +1 -1
  217. package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +234 -4
  218. package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
  219. package/fesm2022/sixbell-telco-sdk-utils-translation-testing.mjs +203 -0
  220. package/fesm2022/sixbell-telco-sdk-utils-translation-testing.mjs.map +1 -0
  221. package/fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs +150 -0
  222. package/fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs.map +1 -0
  223. package/i18n/sdk/en.json +224 -0
  224. package/i18n/sdk/es.json +224 -0
  225. package/i18n/sdk/pt.json +224 -0
  226. package/layouts/README.md +11 -10
  227. package/layouts/src/app-layout/app-layout.component.d.ts +11 -8
  228. package/layouts/src/layout.config.d.ts +1 -1
  229. package/layouts/src/navbar/navbar.component.d.ts +5 -5
  230. package/layouts/src/page-banner/page-banner.component.d.ts +6 -1
  231. package/layouts/src/side-menu/side-menu.component.d.ts +2 -2
  232. package/layouts/src/user-menu/user-menu.component.d.ts +5 -5
  233. package/package.json +51 -11
  234. package/src/_index.css +1616 -0
  235. package/utils/mfe/README.md +1 -0
  236. package/utils/mfe/src/hoist-property-rules.d.ts +13 -0
  237. package/utils/mfe/src/mfe-shadow-shell.component.d.ts +3 -0
  238. package/utils/theme/README.md +94 -1
  239. package/utils/theme/public-api.d.ts +2 -1
  240. package/utils/theme/src/models/theme.d.ts +32 -0
  241. package/utils/theme/src/overlay/theme-overlay.d.ts +33 -0
  242. package/utils/theme/src/providers/theme.provider.types.d.ts +7 -0
  243. package/utils/translation/README.md +61 -0
  244. package/utils/translation/testing/index.d.ts +5 -0
  245. package/utils/translation/testing/public-api.d.ts +2 -0
  246. package/utils/translation/testing/src/translation-testing.d.ts +96 -0
  247. package/utils/unsaved-changes/README.md +33 -0
  248. package/utils/unsaved-changes/index.d.ts +5 -0
  249. package/utils/unsaved-changes/public-api.d.ts +1 -0
  250. package/utils/unsaved-changes/src/unsaved-changes-dialog.component.d.ts +24 -0
  251. package/utils/unsaved-changes/src/unsaved-changes.d.ts +50 -0
@@ -31,5 +31,6 @@ The shell:
31
31
  - attaches the child's compiled stylesheet there and keeps the content hidden until it loads (or `revealTimeoutMs`, default 1500 ms);
32
32
  - resolves the hashed stylesheet name from `<basePath><stylesheetHrefModule>` (default `assets/stylesheet-href.js`, export `stylesheetHref`), falling back to `<basePath>styles.css`, and preloads it once per page;
33
33
  - scopes CDK `OverlayContainer`, `Overlay` and `Dialog` to the route, so dialogs, menus and popovers opened by the child render inside the shadow root and keep its styles. Without a shell (the standalone dev harness) overlays stay on the document body.
34
+ - hoists the stylesheet's `@property` rules to the document once per stylesheet. Browsers ignore `@property` inside a shadow root, and Tailwind v4 needs them for `--tw-*` initial values, so without this `border`, `shadow-*`, `ring-*`, `translate-*` and similar utilities render as if absent in the child's content and overlays. Registration is global and the first one wins, so properties the document already registers are skipped: a child built with another Tailwind version cannot change the host's initial values. A cross-origin stylesheet served without CORS cannot be read; the shell then skips the hoist and, in dev mode, warns through `LoggerService` with the stylesheet href.
34
35
 
35
36
  Theme tokens are not copied: they inherit from the host through the shadow boundary.
@@ -0,0 +1,13 @@
1
+ /** Outcome of {@link hoistMfePropertyRules}. */
2
+ export type MfePropertyHoistResult = 'hoisted' | 'nothing-to-hoist' | 'already-hoisted' | 'unreadable';
3
+ /**
4
+ * Registers a child stylesheet's `@property` rules at document level, once per `source`.
5
+ *
6
+ * Browsers ignore `@property` inside a shadow root, and Tailwind v4 relies on it for the initial values of
7
+ * `--tw-*` variables (`border`, `shadow-*`, `ring-*`, `translate-*`, gradients...). Registration is global
8
+ * and the first one wins, so properties the document already registers are skipped: a child built with a
9
+ * different Tailwind version never changes the host's initial values.
10
+ *
11
+ * Returns `'unreadable'` when the sheet's rules cannot be read (a cross-origin sheet served without CORS).
12
+ */
13
+ export declare function hoistMfePropertyRules(sheet: CSSStyleSheet | null, source: string, document: Document): MfePropertyHoistResult;
@@ -3,6 +3,7 @@ import * as i0 from "@angular/core";
3
3
  * Route component that mounts a federated child inside its own shadow root: it attaches the child's
4
4
  * compiled stylesheet there, hides the content until it loads (no unstyled flash), and registers the
5
5
  * shadow root so CDK overlays opened by the child render inside it. Theme tokens inherit from the host.
6
+ * Its Tailwind `@property` registrations the document lacks are hoisted to it, where browsers honour them.
6
7
  * Configure it with `provideMfeShadowShell` on the same route.
7
8
  */
8
9
  export declare class MfeShadowShellComponent {
@@ -11,10 +12,12 @@ export declare class MfeShadowShellComponent {
11
12
  private readonly document;
12
13
  private readonly host;
13
14
  private readonly destroyRef;
15
+ private readonly logger;
14
16
  private readonly stylesReady;
15
17
  protected readonly visibility: import("@angular/core").Signal<"visible" | "hidden">;
16
18
  constructor();
17
19
  private attachStylesheet;
20
+ private hoistPropertyRules;
18
21
  static ɵfac: i0.ɵɵFactoryDeclaration<MfeShadowShellComponent, never>;
19
22
  static ɵcmp: i0.ɵɵComponentDeclaration<MfeShadowShellComponent, "st-mfe-shadow-shell", never, {}, {}, never, never, true, never>;
20
23
  }
@@ -124,6 +124,7 @@ Config rules:
124
124
  - `excludeThemes` hides themes at runtime without deleting files.
125
125
  - `meta.schemaVersion` is required and used to invalidate old cache entries.
126
126
  - `meta.hash` is required and used for update detection.
127
+ - `overlays` is optional: product overlay paths layered on the loaded themes. See [Product Theme Overlays](#product-theme-overlays).
127
128
 
128
129
  ### 2) Per-Theme Runtime Config (`<theme>.json`)
129
130
 
@@ -406,6 +407,92 @@ themeService.setScheme('dark');
406
407
 
407
408
  ---
408
409
 
410
+ ## Product Theme Overlays
411
+
412
+ A product can add its own tokens to the shared `enghouse_networks` catalog without forking the catalog file. It keeps them in a repo-owned **overlay** file, and the runtime layers the overlay on the catalog for both schemes before it injects the theme CSS. The synced catalog and `themes.json` stay untouched, so the template sync can keep replacing them.
413
+
414
+ ### Overlay file
415
+
416
+ Put the overlay in its own folder **outside** `assets/themes/`, for example `src/assets/theme-overlays/irp.json`. Deployments often mount the synced theme files over `assets/themes/` (IRP's compose bind-mounts its `themes/` folder there), which would hide a bundled overlay, so it would 404 and the tokens would silently fall back to the catalog values. Its `themes` block has the same shape as a catalog's, but every category is optional:
417
+
418
+ ```json
419
+ {
420
+ "meta": {
421
+ "name": "irp",
422
+ "updatedAt": "2026-10-14T00:00:00Z",
423
+ "hash": "irp-theme-overlay-20261014",
424
+ "schemaVersion": "3"
425
+ },
426
+ "target": "enghouse_networks",
427
+ "themes": {
428
+ "light": {
429
+ "variables": {
430
+ "colors": {
431
+ "--color-counters-input": "oklch(62% 0.105 205)",
432
+ "--color-irp-map-route": "oklch(55% 0.14 250)"
433
+ }
434
+ }
435
+ },
436
+ "dark": {
437
+ "variables": {
438
+ "colors": {
439
+ "--color-counters-input": "oklch(66% 0.105 200)",
440
+ "--color-irp-map-route": "oklch(70% 0.12 250)"
441
+ }
442
+ }
443
+ }
444
+ }
445
+ }
446
+ ```
447
+
448
+ Rules, enforced by `validateThemeOverlay()` / `validateThemeOverlayFor()` and the `theme:test` contract:
449
+
450
+ - `meta.name`, `meta.hash` and `meta.updatedAt` are required, and `meta.schemaVersion` is `"3"`. Change `meta.hash` whenever you edit the file, so cached copies refresh.
451
+ - `target` is the `meta.name` of the catalog the overlay extends. Without `target`, the overlay applies to every loaded theme.
452
+ - `light` and `dark` must set exactly the same tokens.
453
+ - Token names are lowercase custom properties (`--color-irp-map-route`). Values are single CSS values, with no `;`, braces or comments.
454
+ - An overlay may **add** tokens the catalog does not define.
455
+ - It may **override** a catalog token only when the token starts with an overridable prefix (`THEME_OVERLAY_OVERRIDABLE_PREFIXES`: `--color-counters-`, `--color-metrics-`).
456
+ - It may **never** set a DaisyUI core token (`THEME_OVERLAY_CORE_TOKENS`: `--color-base-*`, `--color-primary`, the other DaisyUI semantic colors and their `-content`, `--radius-selector|field|box`, `--size-selector|field`, `--border`, `--depth` or `--noise`), or any other catalog token. Product identity comes from the shared catalog.
457
+
458
+ When a kit release adds one of your overlay's new tokens to the shared catalog, remove that token from the overlay: it is now catalog-owned, and the whole overlay would be rejected. Run `validateThemeOverlayFor()` against the synced catalog whenever you sync it (see [Validate in the product repository](#validate-in-the-product-repository)) to catch this.
459
+
460
+ At runtime an overlay with any error is skipped whole, so a scheme never gets half an overlay, and the provider logs `Theme overlay rejected` with every error. Overlays apply in order: overlays listed in `themes.json` first, then those from the provider option.
461
+
462
+ ### Register the overlay
463
+
464
+ Pass the overlay from the app's own config, so the synced `themes.json` keeps its canonical content:
465
+
466
+ ```typescript
467
+ provideRuntimeTheme('/assets/themes/themes.json', {
468
+ overlays: ['/assets/theme-overlays/irp.json'],
469
+ });
470
+ ```
471
+
472
+ A runtime config server that owns its `themes.json` can list the files there instead, with `"overlays": ["/assets/theme-overlays/irp.json"]`.
473
+
474
+ - **Every runtime mode.** An app that picks its `provideRuntimeTheme()` call by runtime mode (static assets, polling, stream, SSE) passes the same `overlays` to each call; see [Showcase runtime mode wiring](#showcase-runtime-mode-wiring).
475
+ - **Federated MFEs.** Overlays belong to the `provideRuntimeTheme()` that runs. A child MFE's overlay applies only when the child runs standalone; when it is federated into a host, the host's `provideRuntimeTheme()` and its overlays decide the tokens. Products whose children need overlay tokens register the overlay in the host.
476
+ - **Refresh.** Overlays are cached like theme files. They reload with everything else when the `themes.json` hash changes, and on the next app load each overlay is checked against its own `meta.hash`, so a change to only the overlay file (with a new `meta.hash`) is picked up at the next load, not live.
477
+
478
+ ### Use the tokens
479
+
480
+ The runtime sets overlay tokens on the theme selector like any catalog token. For Tailwind utilities such as `bg-counters-input` or `text-irp-map-route`, register the tokens in the app's `@theme` block (see [Tailwind Token Registration](#tailwind-token-registration-required-for-new-variables)); otherwise read them with `var(--color-irp-map-route)` at a layout boundary.
481
+
482
+ ### Validate in the product repository
483
+
484
+ Validate the overlay against the catalog in a spec or a Node check:
485
+
486
+ ```typescript
487
+ import { RuntimeThemeConfig, validateThemeOverlayFor } from '@sixbell-telco/sdk/utils/theme';
488
+ import catalog from '../assets/themes/catalog/enghouse_networks.json';
489
+ import overlay from '../assets/theme-overlays/irp.json';
490
+
491
+ expect(validateThemeOverlayFor(overlay, catalog as RuntimeThemeConfig)).toEqual([]);
492
+ ```
493
+
494
+ ---
495
+
409
496
  ## Examples
410
497
 
411
498
  ### Minimal Bootstrap
@@ -434,17 +521,23 @@ bootstrapApplication(AppComponent, {
434
521
  The showcase switches between static assets, polling, and SSE in `projects/showcase/src/app/app.config.ts`:
435
522
 
436
523
  ```ts
437
- provideRuntimeTheme('/assets/themes/themes.json');
524
+ const SHOWCASE_THEME_OVERLAYS = ['/assets/theme-overlays/showcase.json'];
525
+
526
+ provideRuntimeTheme('/assets/themes/themes.json', { overlays: SHOWCASE_THEME_OVERLAYS });
438
527
 
439
528
  provideRuntimeTheme(`${environment.runtime.apiBaseUrl}/api/runtime/theme/config`, {
440
529
  updateStream: runtimeUpdateStream$,
530
+ overlays: SHOWCASE_THEME_OVERLAYS,
441
531
  });
442
532
 
443
533
  provideRuntimeTheme(`${environment.runtime.apiBaseUrl}/api/runtime/theme/config`, {
444
534
  sse: { url: `${environment.runtime.apiBaseUrl}/api/runtime/updates?resource=theme`, eventType: 'message' },
535
+ overlays: SHOWCASE_THEME_OVERLAYS,
445
536
  });
446
537
  ```
447
538
 
539
+ Register the product overlays in every runtime mode (static assets, polling, stream and SSE). An overlay is an option of the `provideRuntimeTheme()` call that runs, so a mode that omits `overlays` silently loses the product tokens.
540
+
448
541
  ### React to Update Availability
449
542
 
450
543
  ```ts
@@ -1,5 +1,6 @@
1
1
  export { DEFAULT_BASE_THEME, DEFAULT_SCHEME, FALLBACK_RUNTIME_THEME_CONFIG, THEME_SCHEMA_VERSION, VALID_SCHEMES } from './src/constants';
2
- export type { FontDefinition, FontFaceDefinition, FontFaceFormat, FontWeightRange, ResolvedThemeScheme, RuntimeThemeConfig, RuntimeThemeConfigFile, ThemeAsset, ThemeAssetTone, ThemeAssetTones, ThemeAssets, ThemeScheme, ThemeStyleDefinition, ThemeVariants, } from './src/models/theme';
2
+ export type { FontDefinition, FontFaceDefinition, FontFaceFormat, FontWeightRange, ResolvedThemeScheme, RuntimeThemeConfig, RuntimeThemeConfigFile, ThemeAsset, ThemeAssetTone, ThemeAssetTones, ThemeAssets, ThemeOverlay, ThemeOverlayVariables, ThemeScheme, ThemeStyleDefinition, ThemeVariablesByCategory, ThemeVariants, } from './src/models/theme';
3
+ export { THEME_OVERLAY_CORE_TOKENS, THEME_OVERLAY_OVERRIDABLE_PREFIXES, THEME_OVERLAY_SCHEMA_VERSION, applyThemeOverlays, mergeThemeOverlay, themeOverlayAppliesTo, validateThemeOverlay, validateThemeOverlayFor, } from './src/overlay/theme-overlay';
3
4
  export { provideRuntimeTheme } from './src/providers/theme.provider';
4
5
  export { SCHEME_FAVICON_CONFIG, SchemeFaviconService, provideSchemeFavicon } from './src/scheme-favicon/scheme-favicon';
5
6
  export type { SchemeFaviconConfig } from './src/scheme-favicon/scheme-favicon';
@@ -18,6 +18,11 @@ export interface RuntimeThemeConfigFile {
18
18
  defaultTheme?: string;
19
19
  defaultScheme?: ThemeScheme;
20
20
  excludeThemes?: string[];
21
+ /**
22
+ * Product overlay files layered on the loaded themes, in order. See `ThemeOverlay`.
23
+ * @example ["/assets/theme-overlays/irp.json"]
24
+ */
25
+ overlays?: string[];
21
26
  }
22
27
  /**
23
28
  * Font face style options
@@ -185,3 +190,30 @@ export interface ThemeStateConfig {
185
190
  */
186
191
  defaultScheme: ThemeScheme;
187
192
  }
193
+ /**
194
+ * Tokens of one scheme in a theme overlay. Categories are optional; each holds custom properties.
195
+ */
196
+ export type ThemeOverlayVariables = Partial<ThemeVariablesByCategory>;
197
+ /**
198
+ * A repo-owned product overlay layered on a shared theme catalog, listed in `themes.json` under `overlays`.
199
+ * It may add custom properties and override catalog tokens with an overridable prefix
200
+ * (`THEME_OVERLAY_OVERRIDABLE_PREFIXES`), never DaisyUI core tokens. `light` and `dark` must set the same tokens.
201
+ */
202
+ export interface ThemeOverlay {
203
+ meta: {
204
+ name: string;
205
+ updatedAt: string;
206
+ hash: string;
207
+ schemaVersion: string;
208
+ };
209
+ /** Theme the overlay extends (`meta.name` of a catalog). Omit to extend every loaded theme. */
210
+ target?: string;
211
+ themes: {
212
+ light: {
213
+ variables: ThemeOverlayVariables;
214
+ };
215
+ dark: {
216
+ variables: ThemeOverlayVariables;
217
+ };
218
+ };
219
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Product theme overlays: a repo-owned file that layers product tokens on top of a shared theme catalog
3
+ * for both schemes, without forking the catalog. Pure functions with type-only imports, so Node contract
4
+ * checks can load this file directly.
5
+ */
6
+ import type { RuntimeThemeConfig, ThemeOverlay } from '../models/theme';
7
+ export declare const THEME_OVERLAY_SCHEMA_VERSION = "3";
8
+ /** DaisyUI core tokens. Overlays can never set them; product looks come from the shared catalog. */
9
+ export declare const THEME_OVERLAY_CORE_TOKENS: readonly string[];
10
+ /** Prefixes of catalog tokens a product overlay may override. Any other catalog token is owned by the catalog. */
11
+ export declare const THEME_OVERLAY_OVERRIDABLE_PREFIXES: readonly string[];
12
+ /**
13
+ * Validates an overlay file on its own: shape, schema version, token names and values, no DaisyUI core tokens,
14
+ * and the same tokens in `light` and `dark`. Returns the errors; an empty array means valid.
15
+ */
16
+ export declare function validateThemeOverlay(value: unknown): string[];
17
+ /** True when the overlay applies to `themeName`: it names that theme, or names none. */
18
+ export declare function themeOverlayAppliesTo(overlay: ThemeOverlay, themeName: string): boolean;
19
+ /**
20
+ * Validates an overlay against the catalog it extends: it may add tokens the catalog lacks and override catalog
21
+ * tokens whose names start with one of `THEME_OVERLAY_OVERRIDABLE_PREFIXES`.
22
+ */
23
+ export declare function validateThemeOverlayFor(overlay: unknown, theme: RuntimeThemeConfig): string[];
24
+ /** Returns a copy of `theme` with the overlay's tokens set for both schemes. Validate first. */
25
+ export declare function mergeThemeOverlay(theme: RuntimeThemeConfig, overlay: ThemeOverlay): RuntimeThemeConfig;
26
+ /**
27
+ * Layers every overlay that targets `theme` on top of it, in order. An overlay with any error is skipped whole,
28
+ * so a scheme never gets half an overlay; its errors are returned for logging.
29
+ */
30
+ export declare function applyThemeOverlays(theme: RuntimeThemeConfig, overlays: readonly unknown[]): {
31
+ config: RuntimeThemeConfig;
32
+ errors: string[];
33
+ };
@@ -6,6 +6,7 @@ import type { Observable } from 'rxjs';
6
6
  * @property appId - Optional namespace to avoid cache collisions across MFEs
7
7
  * @property sse - Optional SSE config for runtime update checks (disabled by default)
8
8
  * @property updateStream - Optional Observable for runtime update checks (disabled by default)
9
+ * @property overlays - Optional product overlay files layered on the loaded themes, after any `overlays` in the config file
9
10
  *
10
11
  * @example
11
12
  * ```typescript
@@ -16,6 +17,11 @@ import type { Observable } from 'rxjs';
16
17
  * provideRuntimeTheme('assets/themes/config.json', {
17
18
  * sse: { url: '/api/updates' }
18
19
  * })
20
+ *
21
+ * // Product overlay kept in the app repo, outside the synced themes.json
22
+ * provideRuntimeTheme('assets/themes/themes.json', {
23
+ * overlays: ['/assets/theme-overlays/irp.json']
24
+ * })
19
25
  * ```
20
26
  */
21
27
  export interface RuntimeThemeProviderOptions {
@@ -27,4 +33,5 @@ export interface RuntimeThemeProviderOptions {
27
33
  transform?: (event: MessageEvent) => RuntimeUpdateEvent | null;
28
34
  };
29
35
  updateStream?: Observable<RuntimeUpdateEvent>;
36
+ overlays?: string[];
30
37
  }
@@ -43,6 +43,67 @@ export class LanguageStatusComponent {
43
43
  }
44
44
  ```
45
45
 
46
+ ### SDK translation bundles
47
+
48
+ The package ships the SDK's own labels at `@sixbell-telco/sdk/i18n/sdk/{en,es,pt}.json`. Serve them from `node_modules` with an asset glob in `angular.json`, and keep `"/assets/i18n/sdk/"` in `translationPaths`:
49
+
50
+ ```json
51
+ { "glob": "**/*.json", "input": "node_modules/@sixbell-telco/sdk/i18n/sdk", "output": "assets/i18n/sdk" }
52
+ ```
53
+
54
+ Do not keep copies of these files in the app; an SDK upgrade then brings its new labels with it.
55
+
56
+ ---
57
+
58
+ ## Testing
59
+
60
+ `@sixbell-telco/sdk/utils/translation/testing` provides in-memory translations for specs. It is a separate entry point with no side effects, so production bundles never include it.
61
+
62
+ `provideTranslationTesting()` registers the real ngx-translate `TranslateService` with an in-memory loader, and `FakeTranslationService` (the full public `TranslationService` API) for `TranslationService`. Because the real `TranslateService` does the work:
63
+
64
+ - `instant()` reads the active language when it is called, so stale labels show up in specs;
65
+ - `use()` / `setLanguage()` switch synchronously and emit `onLangChange`;
66
+ - `get()`, `stream()`, the `translate` pipe and `injectLabelTranslator()` behave as in the app;
67
+ - `{{param}}` placeholders are interpolated, and missing keys fall back to `fallbackLang`.
68
+
69
+ ```typescript
70
+ import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';
71
+ import { TestBed } from '@angular/core/testing';
72
+ import { TranslatePipe } from '@ngx-translate/core';
73
+ import { TranslationService } from '@sixbell-telco/sdk/utils/translation';
74
+ import { provideTranslationTesting } from '@sixbell-telco/sdk/utils/translation/testing';
75
+
76
+ @Component({
77
+ selector: 'app-greeting',
78
+ imports: [TranslatePipe],
79
+ changeDetection: ChangeDetectionStrategy.OnPush,
80
+ template: `<h1>{{ 'greet' | translate: { name: 'Ana' } }}</h1>`,
81
+ })
82
+ class GreetingComponent {}
83
+
84
+ it('re-renders the label when the language changes', () => {
85
+ TestBed.configureTestingModule({
86
+ imports: [GreetingComponent],
87
+ providers: [
88
+ provideTranslationTesting({
89
+ translations: { en: { greet: 'Hello {{name}}' }, es: { greet: 'Hola {{name}}' } },
90
+ lang: 'en',
91
+ }),
92
+ ],
93
+ });
94
+ const fixture = TestBed.createComponent(GreetingComponent);
95
+ fixture.detectChanges();
96
+ expect(fixture.nativeElement.textContent).toContain('Hello Ana');
97
+
98
+ TestBed.inject(TranslationService).setLanguage('es');
99
+ fixture.detectChanges();
100
+
101
+ expect(fixture.nativeElement.textContent).toContain('Hola Ana');
102
+ });
103
+ ```
104
+
105
+ Options: `translations` (per language, required), `lang` (start language; defaults to the first in `translations`), `fallbackLang` (defaults to `lang`), `languages` (what `TranslationService` reports as available) and `locale` (for `resolveLocale()` and `currentLocale()`). Runtime-config methods such as `applyRuntimeConfig()` and `refreshTranslation()` work without network access. To test with the SDK's real labels, import the bundle JSON and pass it under its language.
106
+
46
107
  ---
47
108
 
48
109
  ## Runtime Model Overview
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@sixbell-telco/sdk/utils/translation/testing" />
5
+ export * from './public-api';
@@ -0,0 +1,2 @@
1
+ export { FakeTranslationService, InMemoryTranslateLoader, TRANSLATION_TESTING_OPTIONS, provideTranslationTesting } from './src/translation-testing';
2
+ export type { TranslationTestingBundles, TranslationTestingOptions } from './src/translation-testing';
@@ -0,0 +1,96 @@
1
+ import { InjectionToken, Provider } from '@angular/core';
2
+ import { TranslateLoader, TranslationObject } from '@ngx-translate/core';
3
+ import type { RuntimeConfigLoader, RuntimeConfigLoadResult, RuntimeUpdateEvent } from '@sixbell-telco/sdk/utils/runtime-config';
4
+ import { LanguageDefinition, TranslationConfig, TranslationLocaleConfig, TranslationService } from '@sixbell-telco/sdk/utils/translation';
5
+ import { Observable } from 'rxjs';
6
+ import * as i0 from "@angular/core";
7
+ /** Translations per language code, for example `{ en: { sdk: { close: 'Close' } }, es: { sdk: { close: 'Cerrar' } } }`. */
8
+ export type TranslationTestingBundles = Record<string, TranslationObject>;
9
+ export interface TranslationTestingOptions {
10
+ /** In-memory translations per language. */
11
+ translations: TranslationTestingBundles;
12
+ /** Active language at start. Defaults to the first language in `translations`, or `en`. */
13
+ lang?: string;
14
+ /** Language used for keys missing in the active one. Defaults to `lang`. */
15
+ fallbackLang?: string;
16
+ /** Languages `TranslationService` reports as available. Defaults to the languages in `translations`. */
17
+ languages?: LanguageDefinition[];
18
+ /** Locale mapping returned by `TranslationService.resolveLocale()`. */
19
+ locale?: TranslationLocaleConfig;
20
+ }
21
+ export declare const TRANSLATION_TESTING_OPTIONS: InjectionToken<TranslationTestingOptions>;
22
+ /** Serves translations from memory, synchronously, so `use()` switches language within the same tick. */
23
+ export declare class InMemoryTranslateLoader implements TranslateLoader {
24
+ private readonly translations;
25
+ constructor(translations: TranslationTestingBundles);
26
+ getTranslation(lang: string): Observable<TranslationObject>;
27
+ }
28
+ type TranslationServiceApi = {
29
+ [K in keyof TranslationService]: TranslationService[K];
30
+ };
31
+ /**
32
+ * Test double for the SDK `TranslationService` with its full public API. It delegates to the real ngx-translate
33
+ * `TranslateService`, so `instant()` reads the active language when it is called, `{{param}}` placeholders are
34
+ * interpolated, and switching language emits `onLangChange`. Runtime-config methods resolve without network access.
35
+ */
36
+ export declare class FakeTranslationService implements TranslationServiceApi {
37
+ private readonly translate;
38
+ private readonly options;
39
+ private readonly translationTick;
40
+ private languages;
41
+ private defaultLanguage;
42
+ private readonly localeConfig;
43
+ readonly updateAvailable: import("@angular/core").WritableSignal<boolean>;
44
+ readonly lastRefreshFailed: import("@angular/core").WritableSignal<boolean>;
45
+ readonly currentLanguage: import("@angular/core").WritableSignal<string>;
46
+ readonly currentLocale: import("@angular/core").Signal<string>;
47
+ readonly onLanguageChange$: Observable<import("@ngx-translate/core").LangChangeEvent>;
48
+ readonly onLanguageChange: import("@angular/core").WritableSignal<number>;
49
+ readonly ready: import("@angular/core").WritableSignal<boolean>;
50
+ readonly changes: import("@angular/core").Signal<number>;
51
+ constructor();
52
+ configure(config: TranslationConfig): void;
53
+ setRuntimeConfig(config: TranslationConfig): Promise<void>;
54
+ enablePrefetch(): void;
55
+ refreshInactiveLanguages(): Promise<void>;
56
+ setLanguage(lang: string): void;
57
+ getCurrentLanguage(): string;
58
+ getCurrentLocale(): string;
59
+ getLocaleConfig(): TranslationLocaleConfig;
60
+ resolveLocale(language?: string | null): string;
61
+ getAvailableLanguages(): string[];
62
+ getDefaultLanguage(): string;
63
+ instant(key: string, params?: object): string;
64
+ get(key: string, params?: object): Observable<any>;
65
+ stream(key: string, params?: object): Observable<any>;
66
+ getAvailableLanguagesConfig(): LanguageDefinition[];
67
+ getAvailableLanguageCodes(): string[];
68
+ getLanguageByCode(code: string): LanguageDefinition | undefined;
69
+ getLanguageDisplayName(code: string): string;
70
+ getLocalizedLanguageName(code: string): string;
71
+ isReady(): import("@angular/core").Signal<boolean>;
72
+ waitForTranslations(): Promise<void>;
73
+ init(): void;
74
+ applyRuntimeConfig(result: RuntimeConfigLoadResult<TranslationConfig>): Promise<void>;
75
+ setRuntimeLoader(): void;
76
+ checkForTranslationUpdates(_loader: RuntimeConfigLoader<TranslationConfig>, event?: RuntimeUpdateEvent): Promise<void>;
77
+ refreshTranslation(): Promise<void>;
78
+ withTranslationsReady<T>(fn: () => T): T | undefined;
79
+ createTranslateLoader(): TranslateLoader;
80
+ static ɵfac: i0.ɵɵFactoryDeclaration<FakeTranslationService, never>;
81
+ static ɵprov: i0.ɵɵInjectableDeclaration<FakeTranslationService>;
82
+ }
83
+ /**
84
+ * Providers for specs: the real ngx-translate `TranslateService` fed from memory, and `FakeTranslationService`
85
+ * for the SDK `TranslationService`. Switch language with either service and assert the re-rendered labels.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * TestBed.configureTestingModule({
90
+ * providers: [provideTranslationTesting({ translations: { en: { greet: 'Hi {{name}}' }, es: { greet: 'Hola {{name}}' } } })],
91
+ * });
92
+ * TestBed.inject(TranslationService).setLanguage('es');
93
+ * ```
94
+ */
95
+ export declare function provideTranslationTesting(options: TranslationTestingOptions): Provider[];
96
+ export {};
@@ -0,0 +1,33 @@
1
+ # Unsaved Changes
2
+
3
+ Import: `@sixbell-telco/sdk/utils/unsaved-changes`
4
+
5
+ `canDeactivate` guard and `beforeunload` helper for create/edit pages.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ // routes (host or child MFE)
11
+ { path: 'services/:id/edit', component: ServiceEditPage, canDeactivate: [unsavedChangesGuard] }
12
+
13
+ // page
14
+ export class ServiceEditPage implements HasUnsavedChanges {
15
+ readonly form = inject(NonNullableFormBuilder).group({ name: [''] });
16
+
17
+ hasUnsavedChanges(): boolean {
18
+ return this.form.dirty;
19
+ }
20
+
21
+ constructor() {
22
+ injectBeforeUnloadGuard(() => this.hasUnsavedChanges());
23
+ }
24
+ }
25
+ ```
26
+
27
+ ## Notes
28
+
29
+ - `unsavedChangesGuard: CanDeactivateFn<HasUnsavedChanges>` leaves at once when `hasUnsavedChanges()` is false; otherwise it opens the kit confirm dialog and leaves only on "Discard".
30
+ - The dialog is `st-dialog` width `lg`, title `sdk.unsavedChanges.title` ("¿Descartar cambios?"), right-aligned "Seguir editando" (`secondary`) then "Descartar" (`error`). Escape, the close button and the backdrop keep editing.
31
+ - `UnsavedChangesService.confirmDiscard()` opens the same dialog for in-page "Cancel" buttons.
32
+ - `injectBeforeUnloadGuard(fn)` asks the browser to confirm reloads and tab closes while `fn()` is true; the listener is removed with the component.
33
+ - Mark the form pristine after a successful save, before navigating away.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@sixbell-telco/sdk/utils/unsaved-changes" />
5
+ export * from './public-api';
@@ -0,0 +1 @@
1
+ export * from './src/unsaved-changes';
@@ -0,0 +1,24 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * @internal
4
+ * Confirm dialog opened by `unsavedChangesGuard`: width `lg`, a centered card on phones (not full-screen), right-aligned
5
+ * "Keep editing" (`secondary`) then "Discard" (`error`). Closing it any other way keeps editing.
6
+ */
7
+ export declare class UnsavedChangesDialogComponent {
8
+ private readonly translateLabel;
9
+ /** Whether the dialog is open */
10
+ opened: import("@angular/core").ModelSignal<boolean>;
11
+ /** `true` to discard the changes and leave, `false` to stay */
12
+ decided: import("@angular/core").OutputEmitterRef<boolean>;
13
+ /** @internal */
14
+ protected readonly labels: import("@angular/core").Signal<{
15
+ title: string;
16
+ message: string;
17
+ keepEditing: string;
18
+ discard: string;
19
+ }>;
20
+ /** @internal */
21
+ choose(discard: boolean): void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<UnsavedChangesDialogComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<UnsavedChangesDialogComponent, "st-unsaved-changes-dialog", never, { "opened": { "alias": "opened"; "required": false; "isSignal": true; }; }, { "opened": "openedChange"; "decided": "decided"; }, never, never, true, never>;
24
+ }
@@ -0,0 +1,50 @@
1
+ import { CanDeactivateFn } from '@angular/router';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * A routed component that can hold unsaved edits. A `computed()` signal satisfies it too:
5
+ * `hasUnsavedChanges = computed(() => this.form.dirty && !this.saving())`.
6
+ */
7
+ export interface HasUnsavedChanges {
8
+ hasUnsavedChanges(): boolean;
9
+ }
10
+ /**
11
+ * Opens the kit's "Discard changes?" confirm dialog.
12
+ * Resolves `true` when the user discards, `false` when they keep editing or close the dialog.
13
+ */
14
+ export declare class UnsavedChangesService {
15
+ private readonly appRef;
16
+ private readonly injector;
17
+ private readonly document;
18
+ private pending;
19
+ /** Opens the confirm dialog. A second call while it is open returns the same answer. */
20
+ confirmDiscard(): Promise<boolean>;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<UnsavedChangesService, never>;
22
+ static ɵprov: i0.ɵɵInjectableDeclaration<UnsavedChangesService>;
23
+ }
24
+ /**
25
+ * `canDeactivate` guard for create/edit routes. When the component reports unsaved changes it asks
26
+ * "Discard changes?" and only leaves when the user picks "Discard".
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * { path: 'services/:id/edit', component: ServiceEditPage, canDeactivate: [unsavedChangesGuard] }
31
+ * ```
32
+ */
33
+ export declare const unsavedChangesGuard: CanDeactivateFn<HasUnsavedChanges>;
34
+ /**
35
+ * Asks the browser to confirm reloads, tab closes and external navigation while `hasUnsavedChanges()`
36
+ * is true (the native `beforeunload` prompt). Call it in the component's injection context; the
37
+ * listener is removed when the component is destroyed.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * export class ServiceEditPage implements HasUnsavedChanges {
42
+ * readonly form = inject(FormBuilder).group({ name: [''] });
43
+ * hasUnsavedChanges = () => this.form.dirty;
44
+ * constructor() {
45
+ * injectBeforeUnloadGuard(() => this.hasUnsavedChanges());
46
+ * }
47
+ * }
48
+ * ```
49
+ */
50
+ export declare function injectBeforeUnloadGuard(hasUnsavedChanges: () => boolean): void;