impact-ui 4.0.1-alpha.21 → 4.0.1-alpha.22

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 (261) hide show
  1. package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
  2. package/dist/components/Breadcrumbs/index.js +3 -1
  3. package/dist/components/Chart/index.d.ts.map +1 -1
  4. package/dist/components/Chart/index.js +23 -27
  5. package/dist/components/Chatbot/bookMarkPanel.d.ts.map +1 -1
  6. package/dist/components/Chatbot/bookMarkPanel.js +8 -6
  7. package/dist/components/Chatbot/chatInput.d.ts.map +1 -1
  8. package/dist/components/Chatbot/chatInput.js +4 -2
  9. package/dist/components/Chatbot/chatbotModuleMenu.d.ts.map +1 -1
  10. package/dist/components/Chatbot/chatbotModuleMenu.js +5 -3
  11. package/dist/components/Chatbot/conversationScreen.d.ts.map +1 -1
  12. package/dist/components/Chatbot/conversationScreen.js +5 -3
  13. package/dist/components/Chatbot/historyPanel.d.ts.map +1 -1
  14. package/dist/components/Chatbot/historyPanel.js +18 -9
  15. package/dist/components/Chatbot/index.d.ts.map +1 -1
  16. package/dist/components/Chatbot/index.js +28 -11
  17. package/dist/components/Chatbot/newChatComponent.d.ts.map +1 -1
  18. package/dist/components/Chatbot/newChatComponent.js +11 -9
  19. package/dist/components/Chatbot/utils.d.ts +3 -1
  20. package/dist/components/Chatbot/utils.d.ts.map +1 -1
  21. package/dist/components/Chatbot/utils.js +4 -4
  22. package/dist/components/CommentsPanel/CommentsContext.d.ts.map +1 -1
  23. package/dist/components/CommentsPanel/CommentsContext.js +18 -15
  24. package/dist/components/CommentsPanel/CommentsPanel.impl.d.ts.map +1 -1
  25. package/dist/components/CommentsPanel/CommentsPanel.impl.js +25 -24
  26. package/dist/components/CreateItemFlow/index.d.ts.map +1 -1
  27. package/dist/components/CreateItemFlow/index.js +23 -8
  28. package/dist/components/DatePicker/datePickerFooter.d.ts.map +1 -1
  29. package/dist/components/DatePicker/datePickerFooter.js +5 -3
  30. package/dist/components/DatePicker/datePickerInput.d.ts.map +1 -1
  31. package/dist/components/DatePicker/datePickerInput.js +4 -2
  32. package/dist/components/DateRangePicker/dateRangePickerCustom.d.ts.map +1 -1
  33. package/dist/components/DateRangePicker/dateRangePickerCustom.js +5 -3
  34. package/dist/components/DateRangePicker/dateRangePickerFooter.d.ts.map +1 -1
  35. package/dist/components/DateRangePicker/dateRangePickerFooter.js +8 -8
  36. package/dist/components/DateRangePicker/dateRangePickerInput.d.ts.map +1 -1
  37. package/dist/components/DateRangePicker/dateRangePickerInput.js +4 -2
  38. package/dist/components/DateRangePicker/index.js +1 -1
  39. package/dist/components/DateRangePicker/showMonthYearSelect.d.ts.map +1 -1
  40. package/dist/components/DateRangePicker/showMonthYearSelect.js +4 -2
  41. package/dist/components/DateRangePicker/utils.d.ts +5 -0
  42. package/dist/components/DateRangePicker/utils.d.ts.map +1 -1
  43. package/dist/components/DateRangePicker/utils.js +13 -0
  44. package/dist/components/FileUpload/TemplatePreview.d.ts.map +1 -1
  45. package/dist/components/FileUpload/TemplatePreview.js +3 -1
  46. package/dist/components/FileUpload/index.d.ts.map +1 -1
  47. package/dist/components/FileUpload/index.js +26 -21
  48. package/dist/components/FiltersStrip/AppliedFilters.d.ts.map +1 -1
  49. package/dist/components/FiltersStrip/AppliedFilters.js +9 -7
  50. package/dist/components/FiltersStrip/FilterDropDown.d.ts.map +1 -1
  51. package/dist/components/FiltersStrip/FilterDropDown.js +6 -3
  52. package/dist/components/FiltersStrip/index.d.ts.map +1 -1
  53. package/dist/components/FiltersStrip/index.js +6 -3
  54. package/dist/components/Header/Header.types.d.ts +7 -0
  55. package/dist/components/Header/Header.types.d.ts.map +1 -1
  56. package/dist/components/Header/index.d.ts +1 -1
  57. package/dist/components/Header/index.d.ts.map +1 -1
  58. package/dist/components/Header/index.js +93 -5
  59. package/dist/components/HomePage/index.d.ts.map +1 -1
  60. package/dist/components/HomePage/index.js +44 -34
  61. package/dist/components/KeyboardShortCuts/ShortcutLandingPage.d.ts.map +1 -1
  62. package/dist/components/KeyboardShortCuts/ShortcutLandingPage.js +36 -28
  63. package/dist/components/KeyboardShortCuts/ShortcutModal.d.ts.map +1 -1
  64. package/dist/components/KeyboardShortCuts/ShortcutModal.js +4 -2
  65. package/dist/components/KeyboardShortCuts/allSetBox.d.ts.map +1 -1
  66. package/dist/components/KeyboardShortCuts/allSetBox.js +8 -2
  67. package/dist/components/KeyboardShortCuts/index.d.ts.map +1 -1
  68. package/dist/components/KeyboardShortCuts/index.js +7 -5
  69. package/dist/components/KeyboardShortCuts/screen2.d.ts.map +1 -1
  70. package/dist/components/KeyboardShortCuts/screen2.js +4 -2
  71. package/dist/components/KeyboardShortCuts/screen3.d.ts.map +1 -1
  72. package/dist/components/KeyboardShortCuts/screen3.js +4 -2
  73. package/dist/components/KeyboardShortCuts/tutorial.d.ts.map +1 -1
  74. package/dist/components/KeyboardShortCuts/tutorial.js +14 -12
  75. package/dist/components/Loader/index.d.ts.map +1 -1
  76. package/dist/components/Loader/index.js +5 -2
  77. package/dist/components/Menu/MenuHeaderInfo.d.ts.map +1 -1
  78. package/dist/components/Menu/MenuHeaderInfo.js +6 -4
  79. package/dist/components/Menu/index.d.ts.map +1 -1
  80. package/dist/components/Menu/index.js +18 -8
  81. package/dist/components/Modal/index.d.ts.map +1 -1
  82. package/dist/components/Modal/index.js +5 -3
  83. package/dist/components/MonthPicker/index.d.ts.map +1 -1
  84. package/dist/components/MonthPicker/index.js +17 -14
  85. package/dist/components/MonthRangePicker/index.d.ts +1 -1
  86. package/dist/components/MonthRangePicker/index.d.ts.map +1 -1
  87. package/dist/components/MonthRangePicker/index.js +17 -14
  88. package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.d.ts.map +1 -1
  89. package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.js +14 -10
  90. package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts.map +1 -1
  91. package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.js +28 -17
  92. package/dist/components/Notification/NotificationBody/NotificationPanelContent.d.ts.map +1 -1
  93. package/dist/components/Notification/NotificationBody/NotificationPanelContent.js +1 -1
  94. package/dist/components/Notification/NotificationBody/NotificationTaskList.d.ts.map +1 -1
  95. package/dist/components/Notification/NotificationBody/NotificationTaskList.js +7 -5
  96. package/dist/components/Notification/NotificationBody/index.d.ts.map +1 -1
  97. package/dist/components/Notification/NotificationBody/index.js +3 -1
  98. package/dist/components/Notification/index.d.ts.map +1 -1
  99. package/dist/components/Notification/index.js +1 -1
  100. package/dist/components/Select/SearchFilter.d.ts.map +1 -1
  101. package/dist/components/Select/SearchFilter.js +6 -4
  102. package/dist/components/Select/index.d.ts.map +1 -1
  103. package/dist/components/Select/index.js +14 -10
  104. package/dist/components/Select/menuList.d.ts.map +1 -1
  105. package/dist/components/Select/menuList.js +31 -20
  106. package/dist/components/Select/utils.d.ts +1 -1
  107. package/dist/components/Select/utils.d.ts.map +1 -1
  108. package/dist/components/Select/utils.js +2 -2
  109. package/dist/components/Sidebar/SidebarActions.d.ts.map +1 -1
  110. package/dist/components/Sidebar/SidebarActions.js +6 -3
  111. package/dist/components/Sidebar/SidebarMenus.d.ts.map +1 -1
  112. package/dist/components/Sidebar/SidebarMenus.js +3 -4
  113. package/dist/components/Sidebar/index.d.ts.map +1 -1
  114. package/dist/components/Sidebar/index.js +6 -4
  115. package/dist/components/Table/AdvanceSearchModalItem.d.ts.map +1 -1
  116. package/dist/components/Table/AdvanceSearchModalItem.js +7 -5
  117. package/dist/components/Table/AdvanceSortModal.d.ts.map +1 -1
  118. package/dist/components/Table/AdvanceSortModal.js +34 -30
  119. package/dist/components/Table/AgGridHeader.d.ts.map +1 -1
  120. package/dist/components/Table/AgGridHeader.js +5 -3
  121. package/dist/components/Table/CommentsPortal.d.ts +3 -5
  122. package/dist/components/Table/CommentsPortal.d.ts.map +1 -1
  123. package/dist/components/Table/CommentsPortal.js +8 -5
  124. package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModal.d.ts.map +1 -1
  125. package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModal.js +11 -9
  126. package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModalItem.d.ts.map +1 -1
  127. package/dist/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModalItem.js +11 -6
  128. package/dist/components/Table/NoComments.d.ts.map +1 -1
  129. package/dist/components/Table/NoComments.js +5 -3
  130. package/dist/components/Table/actionBar.d.ts.map +1 -1
  131. package/dist/components/Table/actionBar.js +5 -1
  132. package/dist/components/Table/advanceSearchModal.d.ts.map +1 -1
  133. package/dist/components/Table/advanceSearchModal.js +14 -12
  134. package/dist/components/Table/index.d.ts.map +1 -1
  135. package/dist/components/Table/index.js +29 -21
  136. package/dist/components/Table/tableFunctions.d.ts +10 -12
  137. package/dist/components/Table/tableFunctions.d.ts.map +1 -1
  138. package/dist/components/Table/tableFunctions.js +59 -53
  139. package/dist/components/Table/tableHeader.d.ts.map +1 -1
  140. package/dist/components/Table/tableHeader.js +22 -13
  141. package/dist/components/Table/tableMoreOptions.d.ts.map +1 -1
  142. package/dist/components/Table/tableMoreOptions.js +10 -8
  143. package/dist/components/Table/tablePagination.d.ts.map +1 -1
  144. package/dist/components/Table/tablePagination.js +16 -6
  145. package/dist/components/Table/tableSettings.d.ts +1 -1
  146. package/dist/components/Table/tableSettings.d.ts.map +1 -1
  147. package/dist/components/Table/tableSettings.js +17 -14
  148. package/dist/components/Table/withCommentIcon.d.ts.map +1 -1
  149. package/dist/components/Table/withCommentIcon.js +5 -1
  150. package/dist/components/TableChat/TableChatSidePanel.d.ts.map +1 -1
  151. package/dist/components/TableChat/TableChatSidePanel.js +22 -22
  152. package/dist/components/TableChat/components/SkeletonList.d.ts +1 -1
  153. package/dist/components/TableChat/components/SkeletonList.d.ts.map +1 -1
  154. package/dist/components/TableChat/components/SkeletonList.js +6 -1
  155. package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.d.ts +2 -1
  156. package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.d.ts.map +1 -1
  157. package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +37 -29
  158. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts +3 -1
  159. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts.map +1 -1
  160. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.js +25 -27
  161. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelList.d.ts.map +1 -1
  162. package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelList.js +45 -3
  163. package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderButton/ChatHeaderButton.d.ts +1 -1
  164. package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderButton/ChatHeaderButton.d.ts.map +1 -1
  165. package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderButton/ChatHeaderButton.js +4 -2
  166. package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.d.ts +1 -3
  167. package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.d.ts.map +1 -1
  168. package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.js +5 -3
  169. package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.d.ts +1 -1
  170. package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.d.ts.map +1 -1
  171. package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +6 -3
  172. package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.d.ts.map +1 -1
  173. package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +13 -4
  174. package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.d.ts.map +1 -1
  175. package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +14 -5
  176. package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.d.ts.map +1 -1
  177. package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +3 -1
  178. package/dist/components/TableChat/components/TableChatRightSection/ChatEditedMessageType /ChatEditedMessageType.d.ts.map +1 -1
  179. package/dist/components/TableChat/components/TableChatRightSection/ChatEditedMessageType /ChatEditedMessageType.js +6 -1
  180. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.d.ts.map +1 -1
  181. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +7 -5
  182. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.d.ts.map +1 -1
  183. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.js +6 -2
  184. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts.map +1 -1
  185. package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.js +3 -1
  186. package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts +2 -2
  187. package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts.map +1 -1
  188. package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +27 -22
  189. package/dist/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.d.ts.map +1 -1
  190. package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.d.ts.map +1 -1
  191. package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +9 -7
  192. package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.d.ts.map +1 -1
  193. package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +18 -20
  194. package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.d.ts.map +1 -1
  195. package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.js +5 -3
  196. package/dist/components/TableChat/components/TableChatRightSection/FileUploader/FileUploader.d.ts +1 -1
  197. package/dist/components/TableChat/components/TableChatRightSection/FileUploader/FileUploader.d.ts.map +1 -1
  198. package/dist/components/TableChat/components/TableChatRightSection/FileUploader/FileUploader.js +26 -7
  199. package/dist/components/TableChat/components/TableChatRightSection/ImageUploader/ImageUploader.d.ts.map +1 -1
  200. package/dist/components/TableChat/components/TableChatRightSection/ImageUploader/ImageUploader.js +30 -4
  201. package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.d.ts.map +1 -1
  202. package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.js +13 -7
  203. package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts +2 -2
  204. package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts.map +1 -1
  205. package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.d.ts.map +1 -1
  206. package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +25 -23
  207. package/dist/components/TableChat/components/TextEditor/EditorToolbar.d.ts.map +1 -1
  208. package/dist/components/TableChat/components/TextEditor/EditorToolbar.js +19 -17
  209. package/dist/components/TableChat/components/TextEditor/Mention.d.ts +1 -2
  210. package/dist/components/TableChat/components/TextEditor/Mention.d.ts.map +1 -1
  211. package/dist/components/TableChat/components/TextEditor/Mention.js +6 -3
  212. package/dist/components/TableChat/components/TextEditor/MentionList.d.ts +1 -2
  213. package/dist/components/TableChat/components/TextEditor/MentionList.d.ts.map +1 -1
  214. package/dist/components/TableChat/components/TextEditor/MentionList.js +4 -2
  215. package/dist/components/TableOld/AgGridHeader.d.ts.map +1 -1
  216. package/dist/components/TableOld/AgGridHeader.js +5 -3
  217. package/dist/components/TableOld/actionBar.d.ts.map +1 -1
  218. package/dist/components/TableOld/actionBar.js +5 -1
  219. package/dist/components/TableOld/index.d.ts +1 -2
  220. package/dist/components/TableOld/index.d.ts.map +1 -1
  221. package/dist/components/TableOld/index.js +14 -8
  222. package/dist/components/TableOld/tableFunctions.d.ts +10 -12
  223. package/dist/components/TableOld/tableFunctions.d.ts.map +1 -1
  224. package/dist/components/TableOld/tableFunctions.js +65 -57
  225. package/dist/components/TableOld/tableHeader.d.ts.map +1 -1
  226. package/dist/components/TableOld/tableHeader.js +4 -2
  227. package/dist/components/TableOld/tablePagination.d.ts.map +1 -1
  228. package/dist/components/TableOld/tablePagination.js +17 -5
  229. package/dist/components/TableOld/tableSettings.d.ts.map +1 -1
  230. package/dist/components/index.d.ts +2 -0
  231. package/dist/components/index.d.ts.map +1 -1
  232. package/dist/components/index.js +18 -1
  233. package/dist/i18n/I18nContext.d.ts +23 -0
  234. package/dist/i18n/I18nContext.d.ts.map +1 -0
  235. package/dist/i18n/I18nContext.js +58 -0
  236. package/dist/i18n/index.d.ts +9 -0
  237. package/dist/i18n/index.d.ts.map +1 -0
  238. package/dist/i18n/translate.d.ts +15 -0
  239. package/dist/i18n/translate.d.ts.map +1 -0
  240. package/dist/i18n/translate.js +22 -0
  241. package/dist/i18n/types.d.ts +18 -0
  242. package/dist/i18n/types.d.ts.map +1 -0
  243. package/dist/i18n/useI18n.d.ts +10 -0
  244. package/dist/i18n/useI18n.d.ts.map +1 -0
  245. package/dist/i18n/useI18n.js +28 -0
  246. package/dist/i18n/useTranslation.d.ts +15 -0
  247. package/dist/i18n/useTranslation.d.ts.map +1 -0
  248. package/dist/i18n/useTranslation.js +8 -0
  249. package/dist/locales/de-DE.json.d.ts +559 -0
  250. package/dist/locales/de-DE.json.js +503 -0
  251. package/dist/locales/en-US.json.d.ts +554 -0
  252. package/dist/locales/en-US.json.js +500 -0
  253. package/dist/locales/index.d.ts +24 -0
  254. package/dist/locales/index.d.ts.map +1 -0
  255. package/dist/locales/index.js +32 -0
  256. package/dist/mcp-component-registry.json +1 -1
  257. package/dist/node_modules/moment/dist/locale/de.js +75 -0
  258. package/dist/node_modules/moment/dist/moment.js +3986 -0
  259. package/dist/stories/i18nDemo.d.ts +7 -0
  260. package/dist/stories/i18nDemo.d.ts.map +1 -0
  261. package/package.json +2 -1
@@ -53,11 +53,13 @@ import { Select } from "./Select/index.js";
53
53
  import { MonthPicker } from "./MonthPicker/index.js";
54
54
  import { MonthRangePicker } from "./MonthRangePicker/index.js";
55
55
  import { KeyboardShortcuts } from "./KeyboardShortCuts/index.js";
56
+ import { AGLocaleMap, BASE_LOCALE, LOCALE_REGISTRY, ourDictionaries } from "../locales/index.js";
56
57
  import { AppliedFilters } from "./FiltersStrip/AppliedFilters.js";
57
58
  import { CommentsContext, CommentsProvider, useComments } from "./CommentsPanel/CommentsContext.js";
58
59
  import { FilterDropDown } from "./FiltersStrip/FilterDropDown.js";
59
60
  import { FilterPanelHeader } from "./FilterPanel/FilterPanelHeader.js";
60
61
  import { FilterSlider } from "./FiltersStrip/FilterSlider.js";
62
+ import { I18nContext, I18nProvider } from "../i18n/I18nContext.js";
61
63
  import { MenuHeaderInfo } from "./Menu/MenuHeaderInfo.js";
62
64
  import { PanelFooter } from "./FilterPanel/PanelFooter.js";
63
65
  import { PanelSidebar } from "./FilterPanel/PanelSidebar.js";
@@ -67,18 +69,24 @@ import { ShortcutModal } from "./KeyboardShortCuts/ShortcutModal.js";
67
69
  import { ShortcutScope } from "./Shortcuts/ShortcutScope.js";
68
70
  import { ShortcutsConfigContext } from "./Shortcuts/ShortcutsConfigContext.js";
69
71
  import { ShortcutsProvider } from "./Shortcuts/ShortcutsProvider.js";
72
+ import { buildMessages, translate } from "../i18n/translate.js";
73
+ import { default as default3 } from "../locales/en-US.json.js";
70
74
  import { formatShortcutDisplay } from "../utils/shortcuts/format.js";
71
75
  import { isMac } from "../utils/shortcuts/platform.js";
72
76
  import { normalizeKey } from "../utils/shortcuts/match.js";
73
77
  import { normalizeShortcutString, parseShortcutString } from "../utils/shortcuts/parse.js";
78
+ import { useI18n } from "../i18n/useI18n.js";
74
79
  import { useShortcut } from "./Shortcuts/useShortcut.js";
75
80
  import { useShortcutScope } from "./Shortcuts/useShortcutScope.js";
81
+ import { useTranslation } from "../i18n/useTranslation.js";
76
82
  export {
83
+ AGLocaleMap,
77
84
  Accordion,
78
85
  AccordionModern,
79
86
  Alert,
80
87
  AppliedFilters,
81
88
  Avatar,
89
+ BASE_LOCALE,
82
90
  Badge,
83
91
  BottomSheet,
84
92
  Breadcrumbs,
@@ -107,8 +115,11 @@ export {
107
115
  Header,
108
116
  HelperText,
109
117
  HomePage,
118
+ I18nContext,
119
+ I18nProvider,
110
120
  Input,
111
121
  KeyboardShortcuts,
122
+ LOCALE_REGISTRY,
112
123
  Loader,
113
124
  Menu,
114
125
  MenuHeaderInfo,
@@ -144,13 +155,19 @@ export {
144
155
  TextArea,
145
156
  Toast,
146
157
  Tooltip,
158
+ buildMessages,
159
+ default3 as enUS,
147
160
  formatShortcutDisplay,
148
161
  getAssetUrl,
149
162
  isMac,
150
163
  normalizeKey,
151
164
  normalizeShortcutString,
165
+ ourDictionaries,
152
166
  parseShortcutString,
167
+ translate,
153
168
  useComments,
169
+ useI18n,
154
170
  useShortcut,
155
- useShortcutScope
171
+ useShortcutScope,
172
+ useTranslation
156
173
  };
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ import { I18nContextValue, Locale, LoadMessages } from './types';
3
+
4
+ /**
5
+ * Context shape:
6
+ * locale - current active locale string (e.g. "en-US")
7
+ * messages - resolved 3-layer message map for the active locale
8
+ * loading - true while a locale switch is resolving loadMessages()
9
+ * setLocale - async (code) => void; switches the active locale
10
+ * t - (key, vars) => string; translation lookup + interpolation
11
+ */
12
+ export declare const I18nContext: import('react').Context<I18nContextValue | null>;
13
+ export interface I18nProviderProps {
14
+ /** initial active locale */
15
+ defaultLocale?: Locale;
16
+ /** (code) => messages | Promise<messages>; host overrides / extra languages */
17
+ loadMessages?: LoadMessages;
18
+ /** when true, `t()` returns the raw message key instead of the translation */
19
+ debugKeys?: boolean;
20
+ children: ReactNode;
21
+ }
22
+ export declare function I18nProvider({ defaultLocale, loadMessages, debugKeys, children, }: I18nProviderProps): import("react/jsx-runtime").JSX.Element;
23
+ //# sourceMappingURL=I18nContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"I18nContext.d.ts","sourceRoot":"","sources":["../../src/i18n/I18nContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAA2B,MAAM,SAAS,CAAC;AAE/F;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,kDAA+C,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,8EAA8E;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,EAC3B,aAA2B,EAC3B,YAAyB,EACzB,SAAiB,EACjB,QAAQ,GACT,EAAE,iBAAiB,2CA4DnB"}
@@ -0,0 +1,58 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { createContext, useState, useRef, useEffect, useCallback, useMemo } from "react";
3
+ import moment from "moment";
4
+ import "../node_modules/moment/dist/locale/de.js";
5
+ import { BASE_LOCALE } from "../locales/index.js";
6
+ import { buildMessages, translate } from "./translate.js";
7
+ const I18nContext = createContext(null);
8
+ function I18nProvider({
9
+ defaultLocale = BASE_LOCALE,
10
+ loadMessages = () => ({}),
11
+ debugKeys = false,
12
+ children
13
+ }) {
14
+ const [locale, setLocaleState] = useState(defaultLocale);
15
+ const [hostMessages, setHostMessages] = useState({});
16
+ const [loading, setLoading] = useState(false);
17
+ const requestIdRef = useRef(0);
18
+ const loadMessagesRef = useRef(loadMessages);
19
+ useEffect(() => {
20
+ loadMessagesRef.current = loadMessages;
21
+ }, [loadMessages]);
22
+ const setLocale = useCallback(async (code) => {
23
+ const requestId = ++requestIdRef.current;
24
+ setLoading(true);
25
+ try {
26
+ const host = await loadMessagesRef.current(code);
27
+ if (requestId !== requestIdRef.current) return;
28
+ setHostMessages(host);
29
+ setLocaleState(code);
30
+ } catch {
31
+ if (requestId !== requestIdRef.current) return;
32
+ setHostMessages({});
33
+ setLocaleState(code);
34
+ } finally {
35
+ if (requestId === requestIdRef.current) setLoading(false);
36
+ }
37
+ }, []);
38
+ useEffect(() => {
39
+ void setLocale(defaultLocale);
40
+ }, []);
41
+ useEffect(() => {
42
+ moment.locale(locale);
43
+ }, [locale]);
44
+ const messages = useMemo(() => buildMessages(locale, hostMessages), [locale, hostMessages]);
45
+ const t = useCallback(
46
+ (key, vars) => debugKeys ? key : translate(messages, key, vars),
47
+ [messages, debugKeys]
48
+ );
49
+ const value = useMemo(
50
+ () => ({ locale, messages, loading, setLocale, t, debugKeys }),
51
+ [locale, messages, loading, setLocale, t, debugKeys]
52
+ );
53
+ return /* @__PURE__ */ jsx(I18nContext.Provider, { value, children });
54
+ }
55
+ export {
56
+ I18nContext,
57
+ I18nProvider
58
+ };
@@ -0,0 +1,9 @@
1
+ export { I18nProvider, I18nContext } from './I18nContext';
2
+ export type { I18nProviderProps } from './I18nContext';
3
+ export { useI18n } from './useI18n';
4
+ export { useTranslation } from './useTranslation';
5
+ export { buildMessages, translate } from './translate';
6
+ export { ourDictionaries, enUS, BASE_LOCALE, AGLocaleMap, LOCALE_REGISTRY } from '../locales';
7
+ export type { LocaleRegistryEntry } from '../locales';
8
+ export type { Locale, Messages, TranslateVars, TFunction, LoadMessages, I18nContextValue, } from './types';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9F,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,YAAY,EACV,MAAM,EACN,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Locale, Messages, TranslateVars } from './types';
2
+
3
+ /**
4
+ * Build the effective message map for a locale using the 3-layer merge:
5
+ * 1. enUS -> guaranteed-complete base (never blank)
6
+ * 2. ourDictionaries[locale] -> impact-ui's translation for this locale
7
+ * 3. hostMessages -> consumer overrides / their own keys (win)
8
+ */
9
+ export declare function buildMessages(locale: Locale, hostMessages?: Messages): Messages;
10
+ /**
11
+ * Look up a key and interpolate {placeholder} tokens.
12
+ * Falls back to the key itself if it is missing (so nothing renders blank).
13
+ */
14
+ export declare function translate(messages: Messages, key: string, vars?: TranslateVars): string;
15
+ //# sourceMappingURL=translate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/i18n/translate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,GAAE,QAAa,GAAG,QAAQ,CAMnF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM,CAQvF"}
@@ -0,0 +1,22 @@
1
+ import { ourDictionaries, BASE_LOCALE } from "../locales/index.js";
2
+ import enUS from "../locales/en-US.json.js";
3
+ function buildMessages(locale, hostMessages = {}) {
4
+ return {
5
+ ...enUS,
6
+ ...ourDictionaries[locale] ?? ourDictionaries[BASE_LOCALE] ?? {},
7
+ ...hostMessages
8
+ };
9
+ }
10
+ function translate(messages, key, vars) {
11
+ let text = messages[key] ?? key;
12
+ if (vars) {
13
+ Object.keys(vars).forEach((name) => {
14
+ text = text.replace(new RegExp(`\\{${name}\\}`, "g"), String(vars[name]));
15
+ });
16
+ }
17
+ return text;
18
+ }
19
+ export {
20
+ buildMessages,
21
+ translate
22
+ };
@@ -0,0 +1,18 @@
1
+ export type Locale = string;
2
+ export type Messages = Record<string, string>;
3
+ export type TranslateVars = Record<string, string | number>;
4
+ export type TFunction = (key: string, vars?: TranslateVars) => string;
5
+ /**
6
+ * Host hook to supply consumer overrides / extra languages for a locale.
7
+ * May be sync or async.
8
+ */
9
+ export type LoadMessages = (code: Locale) => Messages | Promise<Messages>;
10
+ export interface I18nContextValue {
11
+ locale: Locale;
12
+ messages: Messages;
13
+ loading: boolean;
14
+ setLocale: (code: Locale) => Promise<void>;
15
+ t: TFunction;
16
+ debugKeys: boolean;
17
+ }
18
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE5D,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,aAAa,KAAK,MAAM,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC,EAAE,SAAS,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,10 @@
1
+ import { I18nContextValue } from './types';
2
+
3
+ /**
4
+ * Access the full i18n context: { locale, messages, loading, setLocale, t }.
5
+ *
6
+ * Safe to use outside an I18nProvider: it degrades to the base locale
7
+ * so library components never crash when a consumer forgets the provider.
8
+ */
9
+ export declare function useI18n(): I18nContextValue;
10
+ //# sourceMappingURL=useI18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../src/i18n/useI18n.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,SAAS,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,OAAO,IAAI,gBAAgB,CAsB1C"}
@@ -0,0 +1,28 @@
1
+ import { useContext } from "react";
2
+ import { I18nContext } from "./I18nContext.js";
3
+ import { buildMessages } from "./translate.js";
4
+ import { BASE_LOCALE } from "../locales/index.js";
5
+ function useI18n() {
6
+ const ctx = useContext(I18nContext);
7
+ if (ctx) return ctx;
8
+ const messages = buildMessages(BASE_LOCALE, {});
9
+ return {
10
+ locale: BASE_LOCALE,
11
+ messages,
12
+ loading: false,
13
+ setLocale: () => Promise.resolve(),
14
+ t: (key, vars) => {
15
+ let text = messages[key] ?? key;
16
+ if (vars) {
17
+ Object.keys(vars).forEach((name) => {
18
+ text = text.replace(new RegExp(`\\{${name}\\}`, "g"), String(vars[name]));
19
+ });
20
+ }
21
+ return text;
22
+ },
23
+ debugKeys: false
24
+ };
25
+ }
26
+ export {
27
+ useI18n
28
+ };
@@ -0,0 +1,15 @@
1
+ import { Locale, TFunction } from './types';
2
+
3
+ /**
4
+ * Convenience hook for components that only need the translation function.
5
+ *
6
+ * Usage:
7
+ * const { t } = useTranslation();
8
+ * <Button>{t("common.apply")}</Button>
9
+ * <span>{t("monthPicker.placeholder", { format: "MM/YYYY" })}</span>
10
+ */
11
+ export declare function useTranslation(): {
12
+ t: TFunction;
13
+ locale: Locale;
14
+ };
15
+ //# sourceMappingURL=useTranslation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../src/i18n/useTranslation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,cAAc,IAAI;IAAE,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAGjE"}
@@ -0,0 +1,8 @@
1
+ import { useI18n } from "./useI18n.js";
2
+ function useTranslation() {
3
+ const { t, locale } = useI18n();
4
+ return { t, locale };
5
+ }
6
+ export {
7
+ useTranslation
8
+ };