@agent-native/core 0.75.5 → 0.76.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 (427) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +7 -0
  3. package/corpus/core/docs/AGENTS.md +1 -0
  4. package/corpus/core/docs/content/client.md +15 -0
  5. package/corpus/core/docs/content/internationalization.md +145 -0
  6. package/corpus/core/docs/content/locales/ar-SA/internationalization.md +102 -0
  7. package/corpus/core/docs/content/locales/de-DE/internationalization.md +102 -0
  8. package/corpus/core/docs/content/locales/es-ES/internationalization.md +102 -0
  9. package/corpus/core/docs/content/locales/fr-FR/internationalization.md +102 -0
  10. package/corpus/core/docs/content/locales/hi-IN/internationalization.md +102 -0
  11. package/corpus/core/docs/content/locales/ja-JP/internationalization.md +114 -0
  12. package/corpus/core/docs/content/locales/ko-KR/internationalization.md +102 -0
  13. package/corpus/core/docs/content/locales/pt-BR/internationalization.md +102 -0
  14. package/corpus/core/docs/content/locales/zh-CN/internationalization.md +102 -0
  15. package/corpus/core/docs/content/skills-guide.md +19 -18
  16. package/corpus/core/package.json +7 -1
  17. package/corpus/core/src/client/CommandMenu.tsx +16 -0
  18. package/corpus/core/src/client/app-providers.tsx +26 -1
  19. package/corpus/core/src/client/i18n.tsx +605 -0
  20. package/corpus/core/src/client/index.ts +28 -0
  21. package/corpus/core/src/index.browser.ts +25 -0
  22. package/corpus/core/src/localization/actions/get-localization-preference.ts +23 -0
  23. package/corpus/core/src/localization/actions/set-localization-preference.ts +30 -0
  24. package/corpus/core/src/localization/index.ts +2 -0
  25. package/corpus/core/src/localization/server.ts +131 -0
  26. package/corpus/core/src/localization/shared.ts +163 -0
  27. package/corpus/core/src/server/action-discovery.ts +8 -0
  28. package/corpus/core/src/server/index.ts +8 -0
  29. package/corpus/core/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +5 -0
  30. package/corpus/core/src/templates/default/.agents/skills/internationalization/SKILL.md +77 -0
  31. package/corpus/core/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +6 -0
  32. package/corpus/core/src/templates/default/AGENTS.md +16 -15
  33. package/corpus/core/src/templates/default/app/i18n/en-US.ts +29 -0
  34. package/corpus/core/src/templates/default/app/i18n/index.ts +13 -0
  35. package/corpus/core/src/templates/default/app/root.tsx +20 -1
  36. package/corpus/core/src/templates/default/app/routes/_index.tsx +24 -9
  37. package/corpus/core/src/templates/default/app/routes/settings.tsx +67 -0
  38. package/corpus/core/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +5 -0
  39. package/corpus/core/src/templates/workspace-core/.agents/skills/internationalization/SKILL.md +77 -0
  40. package/corpus/core/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +6 -0
  41. package/corpus/core/src/vite/action-types-plugin.ts +10 -0
  42. package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +6 -0
  43. package/corpus/templates/analytics/app/components/layout/Header.tsx +18 -15
  44. package/corpus/templates/analytics/app/components/layout/Layout.tsx +7 -5
  45. package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +9 -3
  46. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +5 -3
  47. package/corpus/templates/analytics/app/i18n/ar-SA.ts +3 -0
  48. package/corpus/templates/analytics/app/i18n/de-DE.ts +3 -0
  49. package/corpus/templates/analytics/app/i18n/en-US.ts +3 -0
  50. package/corpus/templates/analytics/app/i18n/es-ES.ts +3 -0
  51. package/corpus/templates/analytics/app/i18n/fr-FR.ts +3 -0
  52. package/corpus/templates/analytics/app/i18n/hi-IN.ts +3 -0
  53. package/corpus/templates/analytics/app/i18n/index.ts +31 -0
  54. package/corpus/templates/analytics/app/i18n/ja-JP.ts +3 -0
  55. package/corpus/templates/analytics/app/i18n/ko-KR.ts +3 -0
  56. package/corpus/templates/analytics/app/i18n/pt-BR.ts +3 -0
  57. package/corpus/templates/analytics/app/i18n/zh-CN.ts +3 -0
  58. package/corpus/templates/analytics/app/i18n-data.ts +433 -0
  59. package/corpus/templates/analytics/app/pages/Settings.tsx +50 -16
  60. package/corpus/templates/analytics/app/root.tsx +14 -1
  61. package/corpus/templates/analytics/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  62. package/corpus/templates/analytics/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
  63. package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +6 -0
  64. package/corpus/templates/assets/app/components/layout/Header.tsx +17 -8
  65. package/corpus/templates/assets/app/components/layout/Layout.tsx +10 -6
  66. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +40 -23
  67. package/corpus/templates/assets/app/i18n/ar-SA.ts +3 -0
  68. package/corpus/templates/assets/app/i18n/de-DE.ts +3 -0
  69. package/corpus/templates/assets/app/i18n/en-US.ts +3 -0
  70. package/corpus/templates/assets/app/i18n/es-ES.ts +3 -0
  71. package/corpus/templates/assets/app/i18n/fr-FR.ts +3 -0
  72. package/corpus/templates/assets/app/i18n/hi-IN.ts +3 -0
  73. package/corpus/templates/assets/app/i18n/index.ts +31 -0
  74. package/corpus/templates/assets/app/i18n/ja-JP.ts +3 -0
  75. package/corpus/templates/assets/app/i18n/ko-KR.ts +3 -0
  76. package/corpus/templates/assets/app/i18n/pt-BR.ts +3 -0
  77. package/corpus/templates/assets/app/i18n/zh-CN.ts +3 -0
  78. package/corpus/templates/assets/app/i18n-data.ts +668 -0
  79. package/corpus/templates/assets/app/root.tsx +40 -15
  80. package/corpus/templates/assets/app/routes/_index.tsx +9 -10
  81. package/corpus/templates/assets/app/routes/settings.tsx +37 -6
  82. package/corpus/templates/assets/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  83. package/corpus/templates/assets/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
  84. package/corpus/templates/brain/.agents/skills/adding-a-feature/SKILL.md +5 -0
  85. package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +6 -0
  86. package/corpus/templates/brain/app/components/layout/Layout.tsx +12 -8
  87. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +23 -12
  88. package/corpus/templates/brain/app/i18n/ar-SA.ts +3 -0
  89. package/corpus/templates/brain/app/i18n/de-DE.ts +3 -0
  90. package/corpus/templates/brain/app/i18n/en-US.ts +3 -0
  91. package/corpus/templates/brain/app/i18n/es-ES.ts +3 -0
  92. package/corpus/templates/brain/app/i18n/fr-FR.ts +3 -0
  93. package/corpus/templates/brain/app/i18n/hi-IN.ts +3 -0
  94. package/corpus/templates/brain/app/i18n/index.ts +31 -0
  95. package/corpus/templates/brain/app/i18n/ja-JP.ts +3 -0
  96. package/corpus/templates/brain/app/i18n/ko-KR.ts +3 -0
  97. package/corpus/templates/brain/app/i18n/pt-BR.ts +3 -0
  98. package/corpus/templates/brain/app/i18n/zh-CN.ts +3 -0
  99. package/corpus/templates/brain/app/i18n-data.ts +624 -0
  100. package/corpus/templates/brain/app/root.tsx +27 -12
  101. package/corpus/templates/brain/app/routes/settings.tsx +45 -8
  102. package/corpus/templates/brain/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  103. package/corpus/templates/brain/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
  104. package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +6 -0
  105. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +2 -0
  106. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +16 -9
  107. package/corpus/templates/calendar/app/i18n/ar-SA.ts +57 -0
  108. package/corpus/templates/calendar/app/i18n/de-DE.ts +58 -0
  109. package/corpus/templates/calendar/app/i18n/en-US.ts +57 -0
  110. package/corpus/templates/calendar/app/i18n/es-ES.ts +58 -0
  111. package/corpus/templates/calendar/app/i18n/fr-FR.ts +58 -0
  112. package/corpus/templates/calendar/app/i18n/hi-IN.ts +57 -0
  113. package/corpus/templates/calendar/app/i18n/index.ts +31 -0
  114. package/corpus/templates/calendar/app/i18n/ja-JP.ts +58 -0
  115. package/corpus/templates/calendar/app/i18n/ko-KR.ts +57 -0
  116. package/corpus/templates/calendar/app/i18n/pt-BR.ts +57 -0
  117. package/corpus/templates/calendar/app/i18n/zh-CN.ts +57 -0
  118. package/corpus/templates/calendar/app/i18n-data.ts +516 -0
  119. package/corpus/templates/calendar/app/pages/CalendarView.tsx +2 -0
  120. package/corpus/templates/calendar/app/pages/Settings.tsx +63 -28
  121. package/corpus/templates/calendar/app/root.tsx +78 -7
  122. package/corpus/templates/calendar/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  123. package/corpus/templates/calendar/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
  124. package/corpus/templates/chat/.agents/skills/adding-a-feature/SKILL.md +5 -0
  125. package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +6 -0
  126. package/corpus/templates/chat/app/components/layout/Header.tsx +17 -11
  127. package/corpus/templates/chat/app/components/layout/Layout.tsx +12 -8
  128. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +47 -18
  129. package/corpus/templates/chat/app/i18n/ar-SA.ts +62 -0
  130. package/corpus/templates/chat/app/i18n/de-DE.ts +63 -0
  131. package/corpus/templates/chat/app/i18n/en-US.ts +63 -0
  132. package/corpus/templates/chat/app/i18n/es-ES.ts +63 -0
  133. package/corpus/templates/chat/app/i18n/fr-FR.ts +63 -0
  134. package/corpus/templates/chat/app/i18n/hi-IN.ts +63 -0
  135. package/corpus/templates/chat/app/i18n/index.ts +31 -0
  136. package/corpus/templates/chat/app/i18n/ja-JP.ts +63 -0
  137. package/corpus/templates/chat/app/i18n/ko-KR.ts +63 -0
  138. package/corpus/templates/chat/app/i18n/pt-BR.ts +63 -0
  139. package/corpus/templates/chat/app/i18n/zh-CN.ts +61 -0
  140. package/corpus/templates/chat/app/i18n-data.ts +475 -0
  141. package/corpus/templates/chat/app/root.tsx +18 -5
  142. package/corpus/templates/chat/app/routes/_index.tsx +9 -8
  143. package/corpus/templates/chat/app/routes/settings.tsx +86 -0
  144. package/corpus/templates/chat/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
  145. package/corpus/templates/chat/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  146. package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +6 -0
  147. package/corpus/templates/clips/app/components/layout/Header.tsx +23 -17
  148. package/corpus/templates/clips/app/components/library/empty-state.tsx +10 -34
  149. package/corpus/templates/clips/app/components/library/library-layout.tsx +45 -34
  150. package/corpus/templates/clips/app/i18n/ar-SA.ts +182 -0
  151. package/corpus/templates/clips/app/i18n/de-DE.ts +184 -0
  152. package/corpus/templates/clips/app/i18n/en-US.ts +179 -0
  153. package/corpus/templates/clips/app/i18n/es-ES.ts +183 -0
  154. package/corpus/templates/clips/app/i18n/fr-FR.ts +184 -0
  155. package/corpus/templates/clips/app/i18n/hi-IN.ts +180 -0
  156. package/corpus/templates/clips/app/i18n/index.ts +41 -0
  157. package/corpus/templates/clips/app/i18n/ja-JP.ts +180 -0
  158. package/corpus/templates/clips/app/i18n/ko-KR.ts +178 -0
  159. package/corpus/templates/clips/app/i18n/pt-BR.ts +183 -0
  160. package/corpus/templates/clips/app/i18n/zh-CN.ts +173 -0
  161. package/corpus/templates/clips/app/root.tsx +104 -10
  162. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +154 -95
  163. package/corpus/templates/clips/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  164. package/corpus/templates/clips/changelog/2026-06-24-clips-now-includes-a-language-picker-and-simplified-chinese-ui.md +6 -0
  165. package/corpus/templates/clips/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
  166. package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +6 -0
  167. package/corpus/templates/content/app/components/EmptyState.tsx +7 -5
  168. package/corpus/templates/content/app/components/ThemeToggle.tsx +4 -2
  169. package/corpus/templates/content/app/components/layout/Header.tsx +2 -0
  170. package/corpus/templates/content/app/components/layout/Layout.tsx +8 -7
  171. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +41 -1
  172. package/corpus/templates/content/app/i18n/ar-SA.ts +3 -0
  173. package/corpus/templates/content/app/i18n/de-DE.ts +3 -0
  174. package/corpus/templates/content/app/i18n/en-US.ts +3 -0
  175. package/corpus/templates/content/app/i18n/es-ES.ts +3 -0
  176. package/corpus/templates/content/app/i18n/fr-FR.ts +3 -0
  177. package/corpus/templates/content/app/i18n/hi-IN.ts +3 -0
  178. package/corpus/templates/content/app/i18n/index.ts +31 -0
  179. package/corpus/templates/content/app/i18n/ja-JP.ts +3 -0
  180. package/corpus/templates/content/app/i18n/ko-KR.ts +3 -0
  181. package/corpus/templates/content/app/i18n/pt-BR.ts +3 -0
  182. package/corpus/templates/content/app/i18n/zh-CN.ts +3 -0
  183. package/corpus/templates/content/app/i18n-data.ts +490 -0
  184. package/corpus/templates/content/app/root.tsx +110 -23
  185. package/corpus/templates/content/app/routes/_app.settings.tsx +84 -0
  186. package/corpus/templates/content/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
  187. package/corpus/templates/content/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  188. package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +6 -0
  189. package/corpus/templates/design/app/components/layout/Header.tsx +16 -8
  190. package/corpus/templates/design/app/components/layout/Layout.tsx +8 -6
  191. package/corpus/templates/design/app/components/layout/Sidebar.tsx +25 -9
  192. package/corpus/templates/design/app/i18n/ar-SA.ts +3 -0
  193. package/corpus/templates/design/app/i18n/de-DE.ts +3 -0
  194. package/corpus/templates/design/app/i18n/en-US.ts +3 -0
  195. package/corpus/templates/design/app/i18n/es-ES.ts +3 -0
  196. package/corpus/templates/design/app/i18n/fr-FR.ts +3 -0
  197. package/corpus/templates/design/app/i18n/hi-IN.ts +3 -0
  198. package/corpus/templates/design/app/i18n/index.ts +31 -0
  199. package/corpus/templates/design/app/i18n/ja-JP.ts +3 -0
  200. package/corpus/templates/design/app/i18n/ko-KR.ts +3 -0
  201. package/corpus/templates/design/app/i18n/pt-BR.ts +3 -0
  202. package/corpus/templates/design/app/i18n/zh-CN.ts +3 -0
  203. package/corpus/templates/design/app/i18n-data.ts +350 -0
  204. package/corpus/templates/design/app/root.tsx +40 -15
  205. package/corpus/templates/design/app/routes/settings.tsx +43 -0
  206. package/corpus/templates/design/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  207. package/corpus/templates/design/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
  208. package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +6 -0
  209. package/corpus/templates/dispatch/app/i18n/ar-SA.ts +3 -0
  210. package/corpus/templates/dispatch/app/i18n/de-DE.ts +3 -0
  211. package/corpus/templates/dispatch/app/i18n/en-US.ts +3 -0
  212. package/corpus/templates/dispatch/app/i18n/es-ES.ts +3 -0
  213. package/corpus/templates/dispatch/app/i18n/fr-FR.ts +3 -0
  214. package/corpus/templates/dispatch/app/i18n/hi-IN.ts +3 -0
  215. package/corpus/templates/dispatch/app/i18n/index.ts +31 -0
  216. package/corpus/templates/dispatch/app/i18n/ja-JP.ts +3 -0
  217. package/corpus/templates/dispatch/app/i18n/ko-KR.ts +3 -0
  218. package/corpus/templates/dispatch/app/i18n/pt-BR.ts +3 -0
  219. package/corpus/templates/dispatch/app/i18n/zh-CN.ts +3 -0
  220. package/corpus/templates/dispatch/app/i18n-data.ts +267 -0
  221. package/corpus/templates/dispatch/app/root.tsx +18 -4
  222. package/corpus/templates/dispatch/app/routes/settings.tsx +86 -0
  223. package/corpus/templates/dispatch/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
  224. package/corpus/templates/dispatch/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  225. package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +6 -0
  226. package/corpus/templates/forms/app/components/layout/Header.tsx +16 -9
  227. package/corpus/templates/forms/app/components/layout/Layout.tsx +6 -4
  228. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +34 -17
  229. package/corpus/templates/forms/app/i18n/ar-SA.ts +58 -0
  230. package/corpus/templates/forms/app/i18n/de-DE.ts +59 -0
  231. package/corpus/templates/forms/app/i18n/en-US.ts +59 -0
  232. package/corpus/templates/forms/app/i18n/es-ES.ts +59 -0
  233. package/corpus/templates/forms/app/i18n/fr-FR.ts +59 -0
  234. package/corpus/templates/forms/app/i18n/hi-IN.ts +59 -0
  235. package/corpus/templates/forms/app/i18n/index.ts +31 -0
  236. package/corpus/templates/forms/app/i18n/ja-JP.ts +59 -0
  237. package/corpus/templates/forms/app/i18n/ko-KR.ts +59 -0
  238. package/corpus/templates/forms/app/i18n/pt-BR.ts +59 -0
  239. package/corpus/templates/forms/app/i18n/zh-CN.ts +56 -0
  240. package/corpus/templates/forms/app/root.tsx +65 -16
  241. package/corpus/templates/forms/app/routes/_app.settings.tsx +85 -0
  242. package/corpus/templates/forms/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
  243. package/corpus/templates/forms/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  244. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +29 -17
  245. package/corpus/templates/macros/app/components/layout/Header.tsx +16 -10
  246. package/corpus/templates/macros/app/i18n/ar-SA.ts +54 -0
  247. package/corpus/templates/macros/app/i18n/de-DE.ts +55 -0
  248. package/corpus/templates/macros/app/i18n/en-US.ts +55 -0
  249. package/corpus/templates/macros/app/i18n/es-ES.ts +55 -0
  250. package/corpus/templates/macros/app/i18n/fr-FR.ts +55 -0
  251. package/corpus/templates/macros/app/i18n/hi-IN.ts +55 -0
  252. package/corpus/templates/macros/app/i18n/index.ts +31 -0
  253. package/corpus/templates/macros/app/i18n/ja-JP.ts +55 -0
  254. package/corpus/templates/macros/app/i18n/ko-KR.ts +55 -0
  255. package/corpus/templates/macros/app/i18n/pt-BR.ts +55 -0
  256. package/corpus/templates/macros/app/i18n/zh-CN.ts +53 -0
  257. package/corpus/templates/macros/app/root.tsx +65 -15
  258. package/corpus/templates/macros/app/routes/settings.tsx +85 -0
  259. package/corpus/templates/macros/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
  260. package/corpus/templates/macros/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  261. package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +6 -0
  262. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +9 -4
  263. package/corpus/templates/mail/app/i18n/ar-SA.ts +33 -0
  264. package/corpus/templates/mail/app/i18n/de-DE.ts +33 -0
  265. package/corpus/templates/mail/app/i18n/en-US.ts +32 -0
  266. package/corpus/templates/mail/app/i18n/es-ES.ts +33 -0
  267. package/corpus/templates/mail/app/i18n/fr-FR.ts +33 -0
  268. package/corpus/templates/mail/app/i18n/hi-IN.ts +32 -0
  269. package/corpus/templates/mail/app/i18n/index.ts +31 -0
  270. package/corpus/templates/mail/app/i18n/ja-JP.ts +32 -0
  271. package/corpus/templates/mail/app/i18n/ko-KR.ts +33 -0
  272. package/corpus/templates/mail/app/i18n/pt-BR.ts +34 -0
  273. package/corpus/templates/mail/app/i18n/zh-CN.ts +32 -0
  274. package/corpus/templates/mail/app/pages/SettingsPage.tsx +67 -13
  275. package/corpus/templates/mail/app/root.tsx +20 -0
  276. package/corpus/templates/mail/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  277. package/corpus/templates/mail/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
  278. package/corpus/templates/plan/.agents/skills/adding-a-feature/SKILL.md +5 -0
  279. package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +6 -0
  280. package/corpus/templates/plan/app/components/layout/Header.tsx +19 -12
  281. package/corpus/templates/plan/app/components/layout/Layout.tsx +11 -7
  282. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +41 -28
  283. package/corpus/templates/plan/app/i18n/ar-SA.ts +77 -0
  284. package/corpus/templates/plan/app/i18n/de-DE.ts +78 -0
  285. package/corpus/templates/plan/app/i18n/en-US.ts +78 -0
  286. package/corpus/templates/plan/app/i18n/es-ES.ts +78 -0
  287. package/corpus/templates/plan/app/i18n/fr-FR.ts +78 -0
  288. package/corpus/templates/plan/app/i18n/hi-IN.ts +78 -0
  289. package/corpus/templates/plan/app/i18n/index.ts +31 -0
  290. package/corpus/templates/plan/app/i18n/ja-JP.ts +79 -0
  291. package/corpus/templates/plan/app/i18n/ko-KR.ts +77 -0
  292. package/corpus/templates/plan/app/i18n/pt-BR.ts +78 -0
  293. package/corpus/templates/plan/app/i18n/zh-CN.ts +74 -0
  294. package/corpus/templates/plan/app/root.tsx +45 -8
  295. package/corpus/templates/plan/app/routes/settings.tsx +86 -0
  296. package/corpus/templates/plan/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
  297. package/corpus/templates/plan/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  298. package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +6 -0
  299. package/corpus/templates/slides/app/components/layout/Header.tsx +23 -11
  300. package/corpus/templates/slides/app/components/layout/Layout.tsx +7 -6
  301. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +23 -11
  302. package/corpus/templates/slides/app/i18n/ar-SA.ts +54 -0
  303. package/corpus/templates/slides/app/i18n/de-DE.ts +56 -0
  304. package/corpus/templates/slides/app/i18n/en-US.ts +55 -0
  305. package/corpus/templates/slides/app/i18n/es-ES.ts +55 -0
  306. package/corpus/templates/slides/app/i18n/fr-FR.ts +55 -0
  307. package/corpus/templates/slides/app/i18n/hi-IN.ts +55 -0
  308. package/corpus/templates/slides/app/i18n/index.ts +31 -0
  309. package/corpus/templates/slides/app/i18n/ja-JP.ts +55 -0
  310. package/corpus/templates/slides/app/i18n/ko-KR.ts +55 -0
  311. package/corpus/templates/slides/app/i18n/pt-BR.ts +55 -0
  312. package/corpus/templates/slides/app/i18n/zh-CN.ts +53 -0
  313. package/corpus/templates/slides/app/root.tsx +50 -8
  314. package/corpus/templates/slides/app/routes/settings.tsx +85 -0
  315. package/corpus/templates/slides/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
  316. package/corpus/templates/slides/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  317. package/corpus/templates/videos/.agents/skills/self-modifying-code/SKILL.md +6 -0
  318. package/corpus/templates/videos/app/components/NewCompositionPopover.tsx +14 -9
  319. package/corpus/templates/videos/app/components/Sidebar.tsx +16 -9
  320. package/corpus/templates/videos/app/components/StudioHeader.tsx +12 -8
  321. package/corpus/templates/videos/app/components/layout/Header.tsx +21 -15
  322. package/corpus/templates/videos/app/components/layout/Layout.tsx +10 -7
  323. package/corpus/templates/videos/app/components/layout/NavSidebar.tsx +21 -6
  324. package/corpus/templates/videos/app/i18n/ar-SA.ts +73 -0
  325. package/corpus/templates/videos/app/i18n/de-DE.ts +75 -0
  326. package/corpus/templates/videos/app/i18n/en-US.ts +74 -0
  327. package/corpus/templates/videos/app/i18n/es-ES.ts +75 -0
  328. package/corpus/templates/videos/app/i18n/fr-FR.ts +75 -0
  329. package/corpus/templates/videos/app/i18n/hi-IN.ts +74 -0
  330. package/corpus/templates/videos/app/i18n/index.ts +31 -0
  331. package/corpus/templates/videos/app/i18n/ja-JP.ts +74 -0
  332. package/corpus/templates/videos/app/i18n/ko-KR.ts +74 -0
  333. package/corpus/templates/videos/app/i18n/pt-BR.ts +75 -0
  334. package/corpus/templates/videos/app/i18n/zh-CN.ts +72 -0
  335. package/corpus/templates/videos/app/pages/Index.tsx +11 -9
  336. package/corpus/templates/videos/app/root.tsx +45 -7
  337. package/corpus/templates/videos/app/routes/settings.tsx +85 -0
  338. package/corpus/templates/videos/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
  339. package/corpus/templates/videos/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  340. package/dist/client/CommandMenu.d.ts +3 -0
  341. package/dist/client/CommandMenu.d.ts.map +1 -1
  342. package/dist/client/CommandMenu.js +9 -0
  343. package/dist/client/CommandMenu.js.map +1 -1
  344. package/dist/client/app-providers.d.ts +8 -1
  345. package/dist/client/app-providers.d.ts.map +1 -1
  346. package/dist/client/app-providers.js +7 -5
  347. package/dist/client/app-providers.js.map +1 -1
  348. package/dist/client/i18n.d.ts +54 -0
  349. package/dist/client/i18n.d.ts.map +1 -0
  350. package/dist/client/i18n.js +354 -0
  351. package/dist/client/i18n.js.map +1 -0
  352. package/dist/client/index.d.ts +2 -1
  353. package/dist/client/index.d.ts.map +1 -1
  354. package/dist/client/index.js +2 -1
  355. package/dist/client/index.js.map +1 -1
  356. package/dist/index.browser.d.ts +1 -1
  357. package/dist/index.browser.d.ts.map +1 -1
  358. package/dist/index.browser.js +1 -1
  359. package/dist/index.browser.js.map +1 -1
  360. package/dist/localization/actions/get-localization-preference.d.ts +4 -0
  361. package/dist/localization/actions/get-localization-preference.d.ts.map +1 -0
  362. package/dist/localization/actions/get-localization-preference.js +16 -0
  363. package/dist/localization/actions/get-localization-preference.js.map +1 -0
  364. package/dist/localization/actions/set-localization-preference.d.ts +6 -0
  365. package/dist/localization/actions/set-localization-preference.d.ts.map +1 -0
  366. package/dist/localization/actions/set-localization-preference.js +24 -0
  367. package/dist/localization/actions/set-localization-preference.js.map +1 -0
  368. package/dist/localization/index.d.ts +3 -0
  369. package/dist/localization/index.d.ts.map +1 -0
  370. package/dist/localization/index.js +3 -0
  371. package/dist/localization/index.js.map +1 -0
  372. package/dist/localization/server.d.ts +25 -0
  373. package/dist/localization/server.d.ts.map +1 -0
  374. package/dist/localization/server.js +69 -0
  375. package/dist/localization/server.js.map +1 -0
  376. package/dist/localization/shared.d.ts +25 -0
  377. package/dist/localization/shared.d.ts.map +1 -0
  378. package/dist/localization/shared.js +134 -0
  379. package/dist/localization/shared.js.map +1 -0
  380. package/dist/server/action-discovery.d.ts.map +1 -1
  381. package/dist/server/action-discovery.js +8 -0
  382. package/dist/server/action-discovery.js.map +1 -1
  383. package/dist/server/index.d.ts +1 -0
  384. package/dist/server/index.d.ts.map +1 -1
  385. package/dist/server/index.js +1 -0
  386. package/dist/server/index.js.map +1 -1
  387. package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +5 -0
  388. package/dist/templates/default/.agents/skills/internationalization/SKILL.md +77 -0
  389. package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +6 -0
  390. package/dist/templates/default/AGENTS.md +16 -15
  391. package/dist/templates/default/app/i18n/en-US.ts +29 -0
  392. package/dist/templates/default/app/i18n/index.ts +13 -0
  393. package/dist/templates/default/app/root.tsx +20 -1
  394. package/dist/templates/default/app/routes/_index.tsx +24 -9
  395. package/dist/templates/default/app/routes/settings.tsx +67 -0
  396. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +5 -0
  397. package/dist/templates/workspace-core/.agents/skills/internationalization/SKILL.md +77 -0
  398. package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +6 -0
  399. package/dist/vite/action-types-plugin.d.ts.map +1 -1
  400. package/dist/vite/action-types-plugin.js +8 -0
  401. package/dist/vite/action-types-plugin.js.map +1 -1
  402. package/docs/AGENTS.md +1 -0
  403. package/docs/content/client.md +15 -0
  404. package/docs/content/internationalization.md +145 -0
  405. package/docs/content/locales/ar-SA/internationalization.md +102 -0
  406. package/docs/content/locales/de-DE/internationalization.md +102 -0
  407. package/docs/content/locales/es-ES/internationalization.md +102 -0
  408. package/docs/content/locales/fr-FR/internationalization.md +102 -0
  409. package/docs/content/locales/hi-IN/internationalization.md +102 -0
  410. package/docs/content/locales/ja-JP/internationalization.md +114 -0
  411. package/docs/content/locales/ko-KR/internationalization.md +102 -0
  412. package/docs/content/locales/pt-BR/internationalization.md +102 -0
  413. package/docs/content/locales/zh-CN/internationalization.md +102 -0
  414. package/docs/content/skills-guide.md +19 -18
  415. package/package.json +7 -1
  416. package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +5 -0
  417. package/src/templates/default/.agents/skills/internationalization/SKILL.md +77 -0
  418. package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +6 -0
  419. package/src/templates/default/AGENTS.md +16 -15
  420. package/src/templates/default/app/i18n/en-US.ts +29 -0
  421. package/src/templates/default/app/i18n/index.ts +13 -0
  422. package/src/templates/default/app/root.tsx +20 -1
  423. package/src/templates/default/app/routes/_index.tsx +24 -9
  424. package/src/templates/default/app/routes/settings.tsx +67 -0
  425. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +5 -0
  426. package/src/templates/workspace-core/.agents/skills/internationalization/SKILL.md +77 -0
  427. package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +6 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CommandMenu.js","sourceRoot":"","sources":["../../src/client/CommandMenu.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AACf,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,E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features:\n * - Anchored to top of viewport (not centered)\n * - Falls back to agent chat when no command matches\n * - Opens agent sidebar automatically when sending prompts\n * - Customizable commands via children\n *\n * Usage:\n * <CommandMenu open={open} onOpenChange={setOpen}>\n * <CommandMenu.Group heading=\"Actions\">\n * <CommandMenu.Item onSelect={() => doThing()}>Do thing</CommandMenu.Item>\n * </CommandMenu.Group>\n * </CommandMenu>\n */\n\nimport React, {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\nimport {\n IconBook2,\n IconExternalLink,\n IconSearch,\n IconMessage,\n IconHistory,\n} from \"@tabler/icons-react\";\nimport { sendToAgentChat } from \"./agent-chat.js\";\nimport { cn } from \"./utils.js\";\nimport { ChangelogDialog, useChangelogSeen } from \"./changelog/Changelog.js\";\nimport { parseChangelog } from \"../changelog/parse.js\";\n\n// ─── Context ────────────────────────────────────────────────────────────────\n\ninterface CommandMenuContextValue {\n search: string;\n onOpenChange: (open: boolean) => void;\n containerRef: React.RefObject<HTMLDivElement | null>;\n setSelectedIndex: (index: number) => void;\n}\n\nconst CommandMenuContext = createContext<CommandMenuContextValue | null>(null);\n\nfunction useCommandMenuContext() {\n const ctx = useContext(CommandMenuContext);\n if (!ctx) throw new Error(\"CommandMenu.* must be used inside <CommandMenu>\");\n return ctx;\n}\n\n// ─── Hooks ──────────────────────────────────────────────────────────────────\n\n/**\n * Opens the agent sidebar (dispatches event that AgentSidebar listens for)\n */\nexport function openAgentSidebar() {\n window.dispatchEvent(new Event(\"agent-panel:open\"));\n}\n\nexport function focusAgentChat() {\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:set-mode\", {\n detail: { mode: \"chat\" },\n }),\n );\n openAgentSidebar();\n}\n\n/**\n * Sends a prompt to the agent and opens the sidebar\n */\nexport function submitToAgent(message: string) {\n focusAgentChat();\n sendToAgentChat({ message, submit: true });\n}\n\n// ─── Sub-components ─────────────────────────────────────────────────────────\n\ninterface CommandGroupProps {\n heading?: string;\n children: ReactNode;\n}\n\nfunction CommandGroup({ heading, children }: CommandGroupProps) {\n return (\n <div className=\"overflow-hidden p-1 text-foreground\">\n {heading && (\n <div className=\"px-2 py-1.5 text-xs font-medium text-muted-foreground\">\n {heading}\n </div>\n )}\n {children}\n </div>\n );\n}\n\ninterface CommandItemProps {\n onSelect: () => void;\n children: ReactNode;\n keywords?: string[];\n className?: string;\n deferSelect?: boolean;\n}\n\nfunction CommandItem({\n onSelect,\n children,\n keywords: _keywords,\n className,\n deferSelect = true,\n}: CommandItemProps) {\n const { onOpenChange, containerRef, setSelectedIndex } =\n useCommandMenuContext();\n const itemRef = useRef<HTMLDivElement>(null);\n\n const handleSelect = () => {\n if (!deferSelect) {\n onSelect();\n onOpenChange(false);\n return;\n }\n\n onOpenChange(false);\n // Small delay to let dialog close animation start\n setTimeout(onSelect, 50);\n };\n\n const handleMouseEnter = () => {\n if (!containerRef.current || !itemRef.current) return;\n const items = containerRef.current.querySelectorAll('[role=\"option\"]');\n const index = Array.from(items).indexOf(itemRef.current);\n if (index >= 0) setSelectedIndex(index);\n };\n\n return (\n <div\n ref={itemRef}\n className={cn(\n \"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none\",\n className,\n )}\n onClick={handleSelect}\n onMouseEnter={handleMouseEnter}\n role=\"option\"\n >\n {children}\n </div>\n );\n}\n\ninterface CommandShortcutProps {\n children: ReactNode;\n className?: string;\n}\n\nfunction CommandShortcut({ children, className }: CommandShortcutProps) {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className,\n )}\n >\n {children}\n </span>\n );\n}\n\nfunction CommandSeparator({ className }: { className?: string }) {\n return <div className={cn(\"-mx-1 my-1 h-px bg-border\", className)} />;\n}\n\nexport interface CommandMenuDoc {\n title: string;\n href: string;\n description?: string;\n keywords?: string[];\n}\n\ninterface CommandDocsGroupProps {\n docs: CommandMenuDoc[];\n heading?: string;\n}\n\nfunction commandDocSearchText(doc: CommandMenuDoc): string {\n return [doc.title, doc.description, ...(doc.keywords ?? [])]\n .filter(Boolean)\n .join(\" \")\n .toLowerCase();\n}\n\nfunction filterCommandDocs(docs: CommandMenuDoc[], search: string) {\n const searchLower = search.trim().toLowerCase();\n if (!searchLower) return docs;\n return docs.filter((doc) => commandDocSearchText(doc).includes(searchLower));\n}\n\nfunction openDocsHref(href: string) {\n if (/^https?:\\/\\//i.test(href)) {\n window.open(href, \"_blank\", \"noopener,noreferrer\");\n return;\n }\n window.location.assign(href);\n}\n\nfunction CommandDocsGroup({ docs, heading = \"Docs\" }: CommandDocsGroupProps) {\n if (docs.length === 0) return null;\n\n return (\n <CommandGroup heading={heading}>\n {docs.map((doc) => (\n <CommandItem\n key={doc.href}\n onSelect={() => openDocsHref(doc.href)}\n keywords={[doc.title, doc.description ?? \"\", ...(doc.keywords ?? [])]}\n deferSelect={false}\n className=\"items-start py-2\"\n >\n <IconBook2 className=\"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">{doc.title}</span>\n {doc.description ? (\n <span className=\"mt-0.5 block line-clamp-2 text-xs leading-snug text-muted-foreground\">\n {doc.description}\n </span>\n ) : null}\n </span>\n <IconExternalLink className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n </CommandItem>\n ))}\n </CommandGroup>\n );\n}\n\n// ─── Main Component ─────────────────────────────────────────────────────────\n\nexport interface CommandMenuProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n children: ReactNode;\n /** Placeholder text for the search input */\n placeholder?: string;\n /** Text shown when no results match (before showing agent fallback) */\n emptyText?: string;\n /** Whether to show the \"Ask AI\" fallback when no commands match. Default: true */\n showAgentFallback?: boolean;\n /** Custom class for the dialog content */\n className?: string;\n /**\n * Raw CHANGELOG.md contents. When provided, the menu shows a built-in\n * \"What's new\" entry that opens an in-app changelog dialog (with an unseen\n * dot for new releases). Pass your app's own file:\n * import changelog from \"../CHANGELOG.md?raw\";\n * <CommandMenu ... changelog={changelog} />\n */\n changelog?: string;\n /** Label for the built-in changelog entry. Default: \"What's new\". */\n changelogLabel?: string;\n /**\n * Stable key used to remember which release a user has already seen (for the\n * unseen dot). Defaults to the document title's host app; set explicitly when\n * multiple apps share an origin.\n */\n changelogKey?: string;\n}\n\nexport function CommandMenu({\n open,\n onOpenChange,\n children,\n placeholder = \"Type a command or ask AI...\",\n emptyText: _emptyText = \"No commands found.\",\n showAgentFallback = true,\n className,\n changelog,\n changelogLabel = \"What's new\",\n changelogKey,\n}: CommandMenuProps) {\n const [search, setSearch] = useState(\"\");\n const [selectedIndex, setSelectedIndex] = useState(0);\n const inputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Built-in \"What's new\" changelog surface (only active when `changelog` is\n // passed). The dialog is rendered alongside the menu so it survives the menu\n // closing; the unseen dot persists per browser via localStorage.\n const [changelogOpen, setChangelogOpen] = useState(false);\n const hasChangelog =\n typeof changelog === \"string\" && changelog.trim().length > 0;\n const changelogEntries = useMemo(\n () => (hasChangelog ? parseChangelog(changelog as string) : []),\n [hasChangelog, changelog],\n );\n const latestChangelogId = changelogEntries[0]?.id;\n const { unseen: changelogUnseen, markSeen: markChangelogSeen } =\n useChangelogSeen(changelogKey ?? \"app\", latestChangelogId);\n\n const openChangelog = useCallback(() => {\n onOpenChange(false);\n markChangelogSeen();\n // Let the menu close before the dialog opens (avoids overlay flicker).\n setTimeout(() => setChangelogOpen(true), 50);\n }, [onOpenChange, markChangelogSeen]);\n\n // Focus input when opening\n useEffect(() => {\n if (open) {\n setSearch(\"\");\n setSelectedIndex(0);\n // Wait for render then focus\n requestAnimationFrame(() => {\n inputRef.current?.focus();\n });\n }\n }, [open]);\n\n // Reset selection when search changes\n useEffect(() => {\n setSelectedIndex(0);\n }, [search]);\n\n // Keep selected item scrolled into view\n useEffect(() => {\n const items = containerRef.current?.querySelectorAll('[role=\"option\"]');\n if (items && items[selectedIndex]) {\n items[selectedIndex].scrollIntoView({ block: \"nearest\" });\n }\n }, [selectedIndex]);\n\n // Apply selected styling directly (can't rely on Tailwind scanning core package)\n useEffect(() => {\n const items = containerRef.current?.querySelectorAll('[role=\"option\"]');\n if (!items) return;\n items.forEach((item, i) => {\n const el = item as HTMLElement;\n if (i === selectedIndex) {\n el.style.backgroundColor = \"hsl(var(--accent))\";\n el.style.color = \"hsl(var(--accent-foreground))\";\n } else {\n el.style.backgroundColor = \"\";\n el.style.color = \"\";\n }\n });\n });\n\n // Close on escape\n useEffect(() => {\n if (!open) return;\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n e.preventDefault();\n onOpenChange(false);\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [open, onOpenChange]);\n\n // Close on click outside\n useEffect(() => {\n if (!open) return;\n const handleClick = (e: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(e.target as Node)\n ) {\n onOpenChange(false);\n }\n };\n // Use capture to handle clicks before they bubble\n document.addEventListener(\"mousedown\", handleClick, true);\n return () => document.removeEventListener(\"mousedown\", handleClick, true);\n }, [open, onOpenChange]);\n\n const handleSubmitToAgent = useCallback(() => {\n onOpenChange(false);\n if (!search.trim()) {\n focusAgentChat();\n return;\n }\n submitToAgent(search.trim());\n }, [search, onOpenChange]);\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n const items = containerRef.current?.querySelectorAll('[role=\"option\"]');\n const itemCount = items?.length ?? 0;\n\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setSelectedIndex((prev) => (prev + 1) % itemCount || 0);\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setSelectedIndex((prev) => (prev - 1 + itemCount) % itemCount || 0);\n } else if (e.key === \"Enter\") {\n e.preventDefault();\n if (items && items[selectedIndex]) {\n (items[selectedIndex] as HTMLElement).click();\n }\n }\n };\n\n // The built-in \"What's new\" row matches changelog-ish search terms.\n const changelogRowMatches =\n !search ||\n [\n changelogLabel,\n \"changelog\",\n \"what's new\",\n \"whats new\",\n \"updates\",\n \"release notes\",\n \"changes\",\n ]\n .join(\" \")\n .toLowerCase()\n .includes(search.toLowerCase());\n const showChangelogRow = hasChangelog && changelogRowMatches;\n\n // Filter children based on search\n const filterChildren = (nodes: ReactNode): ReactNode => {\n return React.Children.map(nodes, (child) => {\n if (!React.isValidElement(child)) return child;\n const props = child.props as Record<string, unknown>;\n\n // If it's a CommandGroup, filter its children\n if (child.type === CommandGroup) {\n const groupChildren = filterChildren(props.children as ReactNode);\n const hasChildren = React.Children.count(groupChildren) > 0;\n if (!hasChildren) return null;\n return React.cloneElement(child, {\n ...props,\n children: groupChildren,\n } as Record<string, unknown>);\n }\n\n if (child.type === CommandDocsGroup) {\n const docs = Array.isArray(props.docs)\n ? (props.docs as CommandMenuDoc[])\n : [];\n const filteredDocs = filterCommandDocs(docs, search);\n if (filteredDocs.length === 0) return null;\n return React.cloneElement(child, {\n ...props,\n docs: filteredDocs,\n } as Record<string, unknown>);\n }\n\n // If it's a CommandItem, check if it matches search\n if (child.type === CommandItem) {\n if (!search) return child;\n const text = getTextContent(props.children as ReactNode).toLowerCase();\n const keywords = ((props.keywords as string[]) || [])\n .join(\" \")\n .toLowerCase();\n const searchLower = search.toLowerCase();\n if (text.includes(searchLower) || keywords.includes(searchLower)) {\n return child;\n }\n return null;\n }\n\n // If it's a separator, keep it (will be cleaned up later if needed)\n if (child.type === CommandSeparator) {\n return search ? null : child; // Hide separators when searching\n }\n\n return child;\n });\n };\n\n const filteredChildren = filterChildren(children);\n const hasResults = React.Children.toArray(filteredChildren).some(\n (child) =>\n React.isValidElement(child) &&\n (child.type === CommandGroup || child.type === CommandDocsGroup),\n );\n\n return (\n <>\n {open && (\n <div className=\"fixed inset-0 z-50 bg-black/50\">\n <div\n ref={containerRef}\n className={cn(\n \"fixed left-1/2 top-[15vh] -translate-x-1/2 w-full max-w-lg\",\n \"rounded-lg border border-border bg-popover text-popover-foreground shadow-lg\",\n className,\n )}\n >\n <CommandMenuContext.Provider\n value={{ search, onOpenChange, containerRef, setSelectedIndex }}\n >\n {/* Search input */}\n <div className=\"flex items-center border-b px-3\">\n <IconSearch className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <input\n ref={inputRef}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n className=\"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n />\n </div>\n\n {/* Command list */}\n <div className=\"max-h-[300px] overflow-y-auto overflow-x-hidden\">\n {hasResults && filteredChildren}\n\n {/* What's new — built-in changelog entry */}\n {showChangelogRow && (\n <>\n {hasResults && <CommandSeparator />}\n <div className=\"p-1\">\n <div\n className=\"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2 text-sm outline-none\"\n onClick={openChangelog}\n onMouseEnter={(e) => {\n const items =\n containerRef.current?.querySelectorAll(\n '[role=\"option\"]',\n );\n if (!items) return;\n const index = Array.from(items).indexOf(\n e.currentTarget,\n );\n if (index >= 0) setSelectedIndex(index);\n }}\n role=\"option\"\n >\n <IconHistory className=\"h-4 w-4 text-muted-foreground\" />\n <span>{changelogLabel}</span>\n {changelogUnseen && (\n <span\n className=\"ml-auto h-2 w-2 rounded-full bg-primary\"\n aria-label=\"New updates available\"\n />\n )}\n </div>\n </div>\n </>\n )}\n\n {/* Ask AI — always visible at the bottom */}\n {showAgentFallback && (\n <>\n {(hasResults || showChangelogRow) && <CommandSeparator />}\n <div className=\"p-1\">\n <div\n className=\"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2 text-sm outline-none\"\n onClick={handleSubmitToAgent}\n onMouseEnter={(e) => {\n const items =\n containerRef.current?.querySelectorAll(\n '[role=\"option\"]',\n );\n if (!items) return;\n const index = Array.from(items).indexOf(\n e.currentTarget,\n );\n if (index >= 0) setSelectedIndex(index);\n }}\n role=\"option\"\n >\n <IconMessage className=\"h-4 w-4 text-muted-foreground\" />\n <span>\n {search.trim() ? (\n <>\n Ask AI:{\" \"}\n <span className=\"text-muted-foreground\">\n \"{search}\"\n </span>\n </>\n ) : (\n <span className=\"text-muted-foreground\">\n Ask AI anything...\n </span>\n )}\n </span>\n {search.trim() && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n ↵\n </span>\n )}\n </div>\n </div>\n </>\n )}\n </div>\n </CommandMenuContext.Provider>\n </div>\n </div>\n )}\n\n {hasChangelog && (\n <ChangelogDialog\n open={changelogOpen}\n onOpenChange={setChangelogOpen}\n markdown={changelog as string}\n title={changelogLabel}\n />\n )}\n </>\n );\n}\n\n// Helper to extract text content from React children\nfunction getTextContent(children: ReactNode): string {\n if (typeof children === \"string\") return children;\n if (typeof children === \"number\") return String(children);\n if (!children) return \"\";\n if (Array.isArray(children)) {\n return children.map(getTextContent).join(\" \");\n }\n if (\n React.isValidElement(children) &&\n (children.props as Record<string, unknown>).children\n ) {\n return getTextContent(\n (children.props as Record<string, unknown>).children as ReactNode,\n );\n }\n return \"\";\n}\n\n// Attach sub-components\nCommandMenu.Group = CommandGroup;\nCommandMenu.Item = CommandItem;\nCommandMenu.DocsGroup = CommandDocsGroup;\nCommandMenu.Shortcut = CommandShortcut;\nCommandMenu.Separator = CommandSeparator;\n\n// ─── Keyboard Hook ──────────────────────────────────────────────────────────\n\n/**\n * Hook to handle Cmd+K (or Ctrl+K) to open the command menu\n */\nexport function useCommandMenuShortcut(onOpen: () => void) {\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key === \"k\") {\n // Don't trigger if user is typing in an input/textarea\n const target = e.target as HTMLElement;\n if (\n target.tagName === \"INPUT\" ||\n target.tagName === \"TEXTAREA\" ||\n target.isContentEditable\n ) {\n return;\n }\n e.preventDefault();\n onOpen();\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [onOpen]);\n}\n\nexport type {\n CommandDocsGroupProps,\n CommandGroupProps,\n CommandItemProps,\n CommandShortcutProps,\n};\n"]}
1
+ {"version":3,"file":"CommandMenu.js","sourceRoot":"","sources":["../../src/client/CommandMenu.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AACf,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAWvD,MAAM,kBAAkB,GAAG,aAAa,CAAiC,IAAI,CAAC,CAAC;AAE/E,SAAS,qBAAqB;IAC5B,MAAM,GAAG,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC3C,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC7E,OAAO,GAAG,CAAC;AACb,CAAC;AAED,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,OAA8C;IAE9C,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAE1C,MAAM,iBAAiB,GACrB,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,C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OAAO,EAAE,CAAC;AACZ,CAAC;AAED,wBAAwB;AACxB,WAAW,CAAC,KAAK,GAAG,YAAY,CAAC;AACjC,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC;AAC/B,WAAW,CAAC,SAAS,GAAG,gBAAgB,CAAC;AACzC,WAAW,CAAC,QAAQ,GAAG,eAAe,CAAC;AACvC,WAAW,CAAC,SAAS,GAAG,gBAAgB,CAAC;AAEzC,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAkB;IACvD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,aAAa,GAAG,CAAC,CAAgB,EAAE,EAAE;YACzC,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;gBAC9C,uDAAuD;gBACvD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAqB,CAAC;gBACvC,IACE,MAAM,CAAC,OAAO,KAAK,OAAO;oBAC1B,MAAM,CAAC,OAAO,KAAK,UAAU;oBAC7B,MAAM,CAAC,iBAAiB,EACxB,CAAC;oBACD,OAAO;gBACT,CAAC;gBACD,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,MAAM,EAAE,CAAC;YACX,CAAC;QACH,CAAC,CAAC;QACF,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QACpD,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AACf,CAAC","sourcesContent":["/**\n * CommandMenu — reusable command palette with agent chat fallback.\n *\n * Features:\n * - Anchored to top of viewport (not centered)\n * - Falls back to agent chat when no command matches\n * - Opens agent sidebar automatically when sending prompts\n * - Customizable commands via children\n *\n * Usage:\n * <CommandMenu open={open} onOpenChange={setOpen}>\n * <CommandMenu.Group heading=\"Actions\">\n * <CommandMenu.Item onSelect={() => doThing()}>Do thing</CommandMenu.Item>\n * </CommandMenu.Group>\n * </CommandMenu>\n */\n\nimport React, {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\nimport {\n IconBook2,\n IconExternalLink,\n IconSearch,\n IconMessage,\n IconHistory,\n} from \"@tabler/icons-react\";\nimport { sendToAgentChat } from \"./agent-chat.js\";\nimport { cn } from \"./utils.js\";\nimport { ChangelogDialog, useChangelogSeen } from \"./changelog/Changelog.js\";\nimport { parseChangelog } from \"../changelog/parse.js\";\n\n// ─── Context ────────────────────────────────────────────────────────────────\n\ninterface CommandMenuContextValue {\n search: string;\n onOpenChange: (open: boolean) => void;\n containerRef: React.RefObject<HTMLDivElement | null>;\n setSelectedIndex: (index: number) => void;\n}\n\nconst CommandMenuContext = createContext<CommandMenuContextValue | null>(null);\n\nfunction useCommandMenuContext() {\n const ctx = useContext(CommandMenuContext);\n if (!ctx) throw new Error(\"CommandMenu.* must be used inside <CommandMenu>\");\n return ctx;\n}\n\n// ─── Hooks ──────────────────────────────────────────────────────────────────\n\n/**\n * Opens the agent sidebar (dispatches event that AgentSidebar listens for)\n */\nexport function openAgentSidebar() {\n window.dispatchEvent(new Event(\"agent-panel:open\"));\n}\n\nexport function openAgentSettings(\n section?: string | { section?: string | null },\n) {\n if (typeof window === \"undefined\") return;\n\n const normalizedSection =\n typeof section === \"string\" ? section : section?.section;\n\n openAgentSidebar();\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:open-settings\", {\n detail: normalizedSection ? { section: normalizedSection } : undefined,\n }),\n );\n}\n\nexport function focusAgentChat() {\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:set-mode\", {\n detail: { mode: \"chat\" },\n }),\n );\n openAgentSidebar();\n}\n\n/**\n * Sends a prompt to the agent and opens the sidebar\n */\nexport function submitToAgent(message: string) {\n focusAgentChat();\n sendToAgentChat({ message, submit: true });\n}\n\n// ─── Sub-components ─────────────────────────────────────────────────────────\n\ninterface CommandGroupProps {\n heading?: string;\n children: ReactNode;\n}\n\nfunction CommandGroup({ heading, children }: CommandGroupProps) {\n return (\n <div className=\"overflow-hidden p-1 text-foreground\">\n {heading && (\n <div className=\"px-2 py-1.5 text-xs font-medium text-muted-foreground\">\n {heading}\n </div>\n )}\n {children}\n </div>\n );\n}\n\ninterface CommandItemProps {\n onSelect: () => void;\n children: ReactNode;\n keywords?: string[];\n className?: string;\n deferSelect?: boolean;\n}\n\nfunction CommandItem({\n onSelect,\n children,\n keywords: _keywords,\n className,\n deferSelect = true,\n}: CommandItemProps) {\n const { onOpenChange, containerRef, setSelectedIndex } =\n useCommandMenuContext();\n const itemRef = useRef<HTMLDivElement>(null);\n\n const handleSelect = () => {\n if (!deferSelect) {\n onSelect();\n onOpenChange(false);\n return;\n }\n\n onOpenChange(false);\n // Small delay to let dialog close animation start\n setTimeout(onSelect, 50);\n };\n\n const handleMouseEnter = () => {\n if (!containerRef.current || !itemRef.current) return;\n const items = containerRef.current.querySelectorAll('[role=\"option\"]');\n const index = Array.from(items).indexOf(itemRef.current);\n if (index >= 0) setSelectedIndex(index);\n };\n\n return (\n <div\n ref={itemRef}\n className={cn(\n \"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none\",\n className,\n )}\n onClick={handleSelect}\n onMouseEnter={handleMouseEnter}\n role=\"option\"\n >\n {children}\n </div>\n );\n}\n\ninterface CommandShortcutProps {\n children: ReactNode;\n className?: string;\n}\n\nfunction CommandShortcut({ children, className }: CommandShortcutProps) {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className,\n )}\n >\n {children}\n </span>\n );\n}\n\nfunction CommandSeparator({ className }: { className?: string }) {\n return <div className={cn(\"-mx-1 my-1 h-px bg-border\", className)} />;\n}\n\nexport interface CommandMenuDoc {\n title: string;\n href: string;\n description?: string;\n keywords?: string[];\n}\n\ninterface CommandDocsGroupProps {\n docs: CommandMenuDoc[];\n heading?: string;\n}\n\nfunction commandDocSearchText(doc: CommandMenuDoc): string {\n return [doc.title, doc.description, ...(doc.keywords ?? [])]\n .filter(Boolean)\n .join(\" \")\n .toLowerCase();\n}\n\nfunction filterCommandDocs(docs: CommandMenuDoc[], search: string) {\n const searchLower = search.trim().toLowerCase();\n if (!searchLower) return docs;\n return docs.filter((doc) => commandDocSearchText(doc).includes(searchLower));\n}\n\nfunction openDocsHref(href: string) {\n if (/^https?:\\/\\//i.test(href)) {\n window.open(href, \"_blank\", \"noopener,noreferrer\");\n return;\n }\n window.location.assign(href);\n}\n\nfunction CommandDocsGroup({ docs, heading = \"Docs\" }: CommandDocsGroupProps) {\n if (docs.length === 0) return null;\n\n return (\n <CommandGroup heading={heading}>\n {docs.map((doc) => (\n <CommandItem\n key={doc.href}\n onSelect={() => openDocsHref(doc.href)}\n keywords={[doc.title, doc.description ?? \"\", ...(doc.keywords ?? [])]}\n deferSelect={false}\n className=\"items-start py-2\"\n >\n <IconBook2 className=\"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">{doc.title}</span>\n {doc.description ? (\n <span className=\"mt-0.5 block line-clamp-2 text-xs leading-snug text-muted-foreground\">\n {doc.description}\n </span>\n ) : null}\n </span>\n <IconExternalLink className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n </CommandItem>\n ))}\n </CommandGroup>\n );\n}\n\n// ─── Main Component ─────────────────────────────────────────────────────────\n\nexport interface CommandMenuProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n children: ReactNode;\n /** Placeholder text for the search input */\n placeholder?: string;\n /** Text shown when no results match (before showing agent fallback) */\n emptyText?: string;\n /** Whether to show the \"Ask AI\" fallback when no commands match. Default: true */\n showAgentFallback?: boolean;\n /** Custom class for the dialog content */\n className?: string;\n /**\n * Raw CHANGELOG.md contents. When provided, the menu shows a built-in\n * \"What's new\" entry that opens an in-app changelog dialog (with an unseen\n * dot for new releases). Pass your app's own file:\n * import changelog from \"../CHANGELOG.md?raw\";\n * <CommandMenu ... changelog={changelog} />\n */\n changelog?: string;\n /** Label for the built-in changelog entry. Default: \"What's new\". */\n changelogLabel?: string;\n /**\n * Stable key used to remember which release a user has already seen (for the\n * unseen dot). Defaults to the document title's host app; set explicitly when\n * multiple apps share an origin.\n */\n changelogKey?: string;\n}\n\nexport function CommandMenu({\n open,\n onOpenChange,\n children,\n placeholder = \"Type a command or ask AI...\",\n emptyText: _emptyText = \"No commands found.\",\n showAgentFallback = true,\n className,\n changelog,\n changelogLabel = \"What's new\",\n changelogKey,\n}: CommandMenuProps) {\n const [search, setSearch] = useState(\"\");\n const [selectedIndex, setSelectedIndex] = useState(0);\n const inputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Built-in \"What's new\" changelog surface (only active when `changelog` is\n // passed). The dialog is rendered alongside the menu so it survives the menu\n // closing; the unseen dot persists per browser via localStorage.\n const [changelogOpen, setChangelogOpen] = useState(false);\n const hasChangelog =\n typeof changelog === \"string\" && changelog.trim().length > 0;\n const changelogEntries = useMemo(\n () => (hasChangelog ? parseChangelog(changelog as string) : []),\n [hasChangelog, changelog],\n );\n const latestChangelogId = changelogEntries[0]?.id;\n const { unseen: changelogUnseen, markSeen: markChangelogSeen } =\n useChangelogSeen(changelogKey ?? \"app\", latestChangelogId);\n\n const openChangelog = useCallback(() => {\n onOpenChange(false);\n markChangelogSeen();\n // Let the menu close before the dialog opens (avoids overlay flicker).\n setTimeout(() => setChangelogOpen(true), 50);\n }, [onOpenChange, markChangelogSeen]);\n\n // Focus input when opening\n useEffect(() => {\n if (open) {\n setSearch(\"\");\n setSelectedIndex(0);\n // Wait for render then focus\n requestAnimationFrame(() => {\n inputRef.current?.focus();\n });\n }\n }, [open]);\n\n // Reset selection when search changes\n useEffect(() => {\n setSelectedIndex(0);\n }, [search]);\n\n // Keep selected item scrolled into view\n useEffect(() => {\n const items = containerRef.current?.querySelectorAll('[role=\"option\"]');\n if (items && items[selectedIndex]) {\n items[selectedIndex].scrollIntoView({ block: \"nearest\" });\n }\n }, [selectedIndex]);\n\n // Apply selected styling directly (can't rely on Tailwind scanning core package)\n useEffect(() => {\n const items = containerRef.current?.querySelectorAll('[role=\"option\"]');\n if (!items) return;\n items.forEach((item, i) => {\n const el = item as HTMLElement;\n if (i === selectedIndex) {\n el.style.backgroundColor = \"hsl(var(--accent))\";\n el.style.color = \"hsl(var(--accent-foreground))\";\n } else {\n el.style.backgroundColor = \"\";\n el.style.color = \"\";\n }\n });\n });\n\n // Close on escape\n useEffect(() => {\n if (!open) return;\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n e.preventDefault();\n onOpenChange(false);\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [open, onOpenChange]);\n\n // Close on click outside\n useEffect(() => {\n if (!open) return;\n const handleClick = (e: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(e.target as Node)\n ) {\n onOpenChange(false);\n }\n };\n // Use capture to handle clicks before they bubble\n document.addEventListener(\"mousedown\", handleClick, true);\n return () => document.removeEventListener(\"mousedown\", handleClick, true);\n }, [open, onOpenChange]);\n\n const handleSubmitToAgent = useCallback(() => {\n onOpenChange(false);\n if (!search.trim()) {\n focusAgentChat();\n return;\n }\n submitToAgent(search.trim());\n }, [search, onOpenChange]);\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n const items = containerRef.current?.querySelectorAll('[role=\"option\"]');\n const itemCount = items?.length ?? 0;\n\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setSelectedIndex((prev) => (prev + 1) % itemCount || 0);\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setSelectedIndex((prev) => (prev - 1 + itemCount) % itemCount || 0);\n } else if (e.key === \"Enter\") {\n e.preventDefault();\n if (items && items[selectedIndex]) {\n (items[selectedIndex] as HTMLElement).click();\n }\n }\n };\n\n // The built-in \"What's new\" row matches changelog-ish search terms.\n const changelogRowMatches =\n !search ||\n [\n changelogLabel,\n \"changelog\",\n \"what's new\",\n \"whats new\",\n \"updates\",\n \"release notes\",\n \"changes\",\n ]\n .join(\" \")\n .toLowerCase()\n .includes(search.toLowerCase());\n const showChangelogRow = hasChangelog && changelogRowMatches;\n\n // Filter children based on search\n const filterChildren = (nodes: ReactNode): ReactNode => {\n return React.Children.map(nodes, (child) => {\n if (!React.isValidElement(child)) return child;\n const props = child.props as Record<string, unknown>;\n\n // If it's a CommandGroup, filter its children\n if (child.type === CommandGroup) {\n const groupChildren = filterChildren(props.children as ReactNode);\n const hasChildren = React.Children.count(groupChildren) > 0;\n if (!hasChildren) return null;\n return React.cloneElement(child, {\n ...props,\n children: groupChildren,\n } as Record<string, unknown>);\n }\n\n if (child.type === CommandDocsGroup) {\n const docs = Array.isArray(props.docs)\n ? (props.docs as CommandMenuDoc[])\n : [];\n const filteredDocs = filterCommandDocs(docs, search);\n if (filteredDocs.length === 0) return null;\n return React.cloneElement(child, {\n ...props,\n docs: filteredDocs,\n } as Record<string, unknown>);\n }\n\n // If it's a CommandItem, check if it matches search\n if (child.type === CommandItem) {\n if (!search) return child;\n const text = getTextContent(props.children as ReactNode).toLowerCase();\n const keywords = ((props.keywords as string[]) || [])\n .join(\" \")\n .toLowerCase();\n const searchLower = search.toLowerCase();\n if (text.includes(searchLower) || keywords.includes(searchLower)) {\n return child;\n }\n return null;\n }\n\n // If it's a separator, keep it (will be cleaned up later if needed)\n if (child.type === CommandSeparator) {\n return search ? null : child; // Hide separators when searching\n }\n\n return child;\n });\n };\n\n const filteredChildren = filterChildren(children);\n const hasResults = React.Children.toArray(filteredChildren).some(\n (child) =>\n React.isValidElement(child) &&\n (child.type === CommandGroup || child.type === CommandDocsGroup),\n );\n\n return (\n <>\n {open && (\n <div className=\"fixed inset-0 z-50 bg-black/50\">\n <div\n ref={containerRef}\n className={cn(\n \"fixed left-1/2 top-[15vh] -translate-x-1/2 w-full max-w-lg\",\n \"rounded-lg border border-border bg-popover text-popover-foreground shadow-lg\",\n className,\n )}\n >\n <CommandMenuContext.Provider\n value={{ search, onOpenChange, containerRef, setSelectedIndex }}\n >\n {/* Search input */}\n <div className=\"flex items-center border-b px-3\">\n <IconSearch className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <input\n ref={inputRef}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n className=\"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n />\n </div>\n\n {/* Command list */}\n <div className=\"max-h-[300px] overflow-y-auto overflow-x-hidden\">\n {hasResults && filteredChildren}\n\n {/* What's new — built-in changelog entry */}\n {showChangelogRow && (\n <>\n {hasResults && <CommandSeparator />}\n <div className=\"p-1\">\n <div\n className=\"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2 text-sm outline-none\"\n onClick={openChangelog}\n onMouseEnter={(e) => {\n const items =\n containerRef.current?.querySelectorAll(\n '[role=\"option\"]',\n );\n if (!items) return;\n const index = Array.from(items).indexOf(\n e.currentTarget,\n );\n if (index >= 0) setSelectedIndex(index);\n }}\n role=\"option\"\n >\n <IconHistory className=\"h-4 w-4 text-muted-foreground\" />\n <span>{changelogLabel}</span>\n {changelogUnseen && (\n <span\n className=\"ml-auto h-2 w-2 rounded-full bg-primary\"\n aria-label=\"New updates available\"\n />\n )}\n </div>\n </div>\n </>\n )}\n\n {/* Ask AI — always visible at the bottom */}\n {showAgentFallback && (\n <>\n {(hasResults || showChangelogRow) && <CommandSeparator />}\n <div className=\"p-1\">\n <div\n className=\"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2 text-sm outline-none\"\n onClick={handleSubmitToAgent}\n onMouseEnter={(e) => {\n const items =\n containerRef.current?.querySelectorAll(\n '[role=\"option\"]',\n );\n if (!items) return;\n const index = Array.from(items).indexOf(\n e.currentTarget,\n );\n if (index >= 0) setSelectedIndex(index);\n }}\n role=\"option\"\n >\n <IconMessage className=\"h-4 w-4 text-muted-foreground\" />\n <span>\n {search.trim() ? (\n <>\n Ask AI:{\" \"}\n <span className=\"text-muted-foreground\">\n \"{search}\"\n </span>\n </>\n ) : (\n <span className=\"text-muted-foreground\">\n Ask AI anything...\n </span>\n )}\n </span>\n {search.trim() && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n ↵\n </span>\n )}\n </div>\n </div>\n </>\n )}\n </div>\n </CommandMenuContext.Provider>\n </div>\n </div>\n )}\n\n {hasChangelog && (\n <ChangelogDialog\n open={changelogOpen}\n onOpenChange={setChangelogOpen}\n markdown={changelog as string}\n title={changelogLabel}\n />\n )}\n </>\n );\n}\n\n// Helper to extract text content from React children\nfunction getTextContent(children: ReactNode): string {\n if (typeof children === \"string\") return children;\n if (typeof children === \"number\") return String(children);\n if (!children) return \"\";\n if (Array.isArray(children)) {\n return children.map(getTextContent).join(\" \");\n }\n if (\n React.isValidElement(children) &&\n (children.props as Record<string, unknown>).children\n ) {\n return getTextContent(\n (children.props as Record<string, unknown>).children as ReactNode,\n );\n }\n return \"\";\n}\n\n// Attach sub-components\nCommandMenu.Group = CommandGroup;\nCommandMenu.Item = CommandItem;\nCommandMenu.DocsGroup = CommandDocsGroup;\nCommandMenu.Shortcut = CommandShortcut;\nCommandMenu.Separator = CommandSeparator;\n\n// ─── Keyboard Hook ──────────────────────────────────────────────────────────\n\n/**\n * Hook to handle Cmd+K (or Ctrl+K) to open the command menu\n */\nexport function useCommandMenuShortcut(onOpen: () => void) {\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key === \"k\") {\n // Don't trigger if user is typing in an input/textarea\n const target = e.target as HTMLElement;\n if (\n target.tagName === \"INPUT\" ||\n target.tagName === \"TEXTAREA\" ||\n target.isContentEditable\n ) {\n return;\n }\n e.preventDefault();\n onOpen();\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [onOpen]);\n}\n\nexport type {\n CommandDocsGroupProps,\n CommandGroupProps,\n CommandItemProps,\n CommandShortcutProps,\n};\n"]}
@@ -48,6 +48,7 @@
48
48
  import React from "react";
49
49
  import { type QueryClient } from "@tanstack/react-query";
50
50
  import { type Attribute } from "next-themes";
51
+ import { type AgentNativeI18nProviderProps } from "./i18n.js";
51
52
  export interface AppProvidersProps {
52
53
  /** QueryClient instance — create with `createAgentNativeQueryClient()`. */
53
54
  queryClient: QueryClient;
@@ -82,6 +83,12 @@ export interface AppProvidersProps {
82
83
  * animates theme changes (e.g. content's 3-way theme cycle).
83
84
  */
84
85
  disableThemeTransitions?: boolean;
86
+ /**
87
+ * Optional localization runtime configuration. When omitted, AppProviders
88
+ * still mounts the i18n provider with an English fallback so templates can
89
+ * call useT/useLocale before they add catalogs. Pass false to opt out.
90
+ */
91
+ i18n?: Omit<AgentNativeI18nProviderProps, "children"> | false;
85
92
  /**
86
93
  * When true the providers render without a `<ClientOnly>` gate so SSR
87
94
  * streams real markup for public/unauthenticated paths.
@@ -95,5 +102,5 @@ export interface AppProvidersProps {
95
102
  clientOnlyFallback?: React.ReactNode;
96
103
  children: React.ReactNode;
97
104
  }
98
- export declare function AppProviders({ queryClient, isPublicPath, clientOnlyFallback, defaultTheme, themeAttribute, tooltipDelayDuration, toaster, disableThemeTransitions, children, }: AppProvidersProps): import("react/jsx-runtime").JSX.Element;
105
+ export declare function AppProviders({ queryClient, isPublicPath, clientOnlyFallback, defaultTheme, themeAttribute, tooltipDelayDuration, toaster, disableThemeTransitions, i18n, children, }: AppProvidersProps): import("react/jsx-runtime").JSX.Element;
99
106
  //# sourceMappingURL=app-providers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-providers.d.ts","sourceRoot":"","sources":["../../src/client/app-providers.tsx"],"names":[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aAAa,CAAC;AAK5D,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,WAAW,EAAE,WAAW,CAAC;IAEzB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,cAAc,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAEzC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;IAEjC;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC,4BAA4B,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC;IAE9D;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAErC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAiDD,wBAAgB,YAAY,CAAC,EAC3B,WAAW,EACX,YAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,OAAO,EACP,uBAAuB,EACvB,IAAI,EACJ,QAAQ,GACT,EAAE,iBAAiB,2CAkCnB"}
@@ -5,15 +5,17 @@ import { TooltipProvider } from "@radix-ui/react-tooltip";
5
5
  import { Toaster } from "sonner";
6
6
  import { ClientOnly } from "./ClientOnly.js";
7
7
  import { DefaultSpinner } from "./DefaultSpinner.js";
8
+ import { AgentNativeI18nProvider, } from "./i18n.js";
8
9
  const DEFAULT_TOASTER = _jsx(Toaster, { richColors: true, position: "bottom-left" });
9
- function ProvidersInner({ queryClient, defaultTheme = "system", themeAttribute = "class", tooltipDelayDuration, toaster = DEFAULT_TOASTER, disableThemeTransitions = true, children, }) {
10
- return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThemeProvider, { attribute: themeAttribute, defaultTheme: defaultTheme, enableSystem: true, disableTransitionOnChange: disableThemeTransitions, children: _jsxs(TooltipProvider, { delayDuration: tooltipDelayDuration, children: [children, toaster] }) }) }));
10
+ function ProvidersInner({ queryClient, defaultTheme = "system", themeAttribute = "class", tooltipDelayDuration, toaster = DEFAULT_TOASTER, disableThemeTransitions = true, i18n, children, }) {
11
+ const localizedChildren = i18n === false ? (children) : (_jsx(AgentNativeI18nProvider, { ...(i18n ?? {}), children: children }));
12
+ return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThemeProvider, { attribute: themeAttribute, defaultTheme: defaultTheme, enableSystem: true, disableTransitionOnChange: disableThemeTransitions, children: _jsxs(TooltipProvider, { delayDuration: tooltipDelayDuration, children: [localizedChildren, toaster] }) }) }));
11
13
  }
12
- export function AppProviders({ queryClient, isPublicPath = false, clientOnlyFallback, defaultTheme, themeAttribute, tooltipDelayDuration, toaster, disableThemeTransitions, children, }) {
14
+ export function AppProviders({ queryClient, isPublicPath = false, clientOnlyFallback, defaultTheme, themeAttribute, tooltipDelayDuration, toaster, disableThemeTransitions, i18n, children, }) {
13
15
  const fallback = clientOnlyFallback ?? _jsx(DefaultSpinner, {});
14
16
  if (isPublicPath) {
15
- return (_jsx(ProvidersInner, { queryClient: queryClient, defaultTheme: defaultTheme, themeAttribute: themeAttribute, tooltipDelayDuration: tooltipDelayDuration, toaster: toaster, disableThemeTransitions: disableThemeTransitions, children: children }));
17
+ return (_jsx(ProvidersInner, { queryClient: queryClient, defaultTheme: defaultTheme, themeAttribute: themeAttribute, tooltipDelayDuration: tooltipDelayDuration, toaster: toaster, disableThemeTransitions: disableThemeTransitions, i18n: i18n, children: children }));
16
18
  }
17
- return (_jsx(ClientOnly, { fallback: fallback, children: _jsx(ProvidersInner, { queryClient: queryClient, defaultTheme: defaultTheme, themeAttribute: themeAttribute, tooltipDelayDuration: tooltipDelayDuration, toaster: toaster, disableThemeTransitions: disableThemeTransitions, children: children }) }));
19
+ return (_jsx(ClientOnly, { fallback: fallback, children: _jsx(ProvidersInner, { queryClient: queryClient, defaultTheme: defaultTheme, themeAttribute: themeAttribute, tooltipDelayDuration: tooltipDelayDuration, toaster: toaster, disableThemeTransitions: disableThemeTransitions, i18n: i18n, children: children }) }));
18
20
  }
19
21
  //# sourceMappingURL=app-providers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-providers.js","sourceRoot":"","sources":["../../src/client/app-providers.tsx"],"names":[],"mappings":";AAiDA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA0DrD,MAAM,eAAe,GAAG,KAAC,OAAO,IAAC,UAAU,QAAC,QAAQ,EAAC,aAAa,GAAG,CAAC;AAEtE,SAAS,cAAc,CAAC,EACtB,WAAW,EACX,YAAY,GAAG,QAAQ,EACvB,cAAc,GAAG,OAAO,EACxB,oBAAoB,EACpB,OAAO,GAAG,eAAe,EACzB,uBAAuB,GAAG,IAAI,EAC9B,QAAQ,GAST;IACC,OAAO,CACL,KAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW,YACtC,KAAC,aAAa,IACZ,SAAS,EAAE,cAAc,EACzB,YAAY,EAAE,YAAY,EAC1B,YAAY,QACZ,yBAAyB,EAAE,uBAAuB,YAElD,MAAC,eAAe,IAAC,aAAa,EAAE,oBAAoB,aACjD,QAAQ,EACR,OAAO,IACQ,GACJ,GACI,CACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAC3B,WAAW,EACX,YAAY,GAAG,KAAK,EACpB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,OAAO,EACP,uBAAuB,EACvB,QAAQ,GACU;IAClB,MAAM,QAAQ,GAAG,kBAAkB,IAAI,KAAC,cAAc,KAAG,CAAC;IAE1D,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CACL,KAAC,cAAc,IACb,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,oBAAoB,EAAE,oBAAoB,EAC1C,OAAO,EAAE,OAAO,EAChB,uBAAuB,EAAE,uBAAuB,YAE/C,QAAQ,GACM,CAClB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,UAAU,IAAC,QAAQ,EAAE,QAAQ,YAC5B,KAAC,cAAc,IACb,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,oBAAoB,EAAE,oBAAoB,EAC1C,OAAO,EAAE,OAAO,EAChB,uBAAuB,EAAE,uBAAuB,YAE/C,QAAQ,GACM,GACN,CACd,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Shared provider shell for agent-native template roots.\n *\n * Composes the providers every template needs:\n * QueryClientProvider → ThemeProvider → TooltipProvider → Toaster\n *\n * Templates keep their own `createAgentNativeQueryClient(overrides)` call and\n * pass the result in as `queryClient`. AppProviders never creates a client\n * internally so each template can apply its own query defaults (e.g. calendar's\n * `refetchOnWindowFocus: true`, mail's focus-refresh throttle).\n *\n * Public-path SSR pattern (calendar/clips/content):\n * Some templates have routes that must SSR real content for first-visit\n * signed-out users and crawlers, bypassing the `<ClientOnly>` gate.\n * Pass `isPublicPath` and `clientOnlyFallback` to activate this branch:\n *\n * <AppProviders\n * queryClient={queryClient}\n * isPublicPath={isPublicBookingPath(location.pathname)}\n * clientOnlyFallback={<DefaultSpinner />}\n * >\n * ...\n * </AppProviders>\n *\n * When `isPublicPath` is true the providers render without `<ClientOnly>`,\n * streaming real markup to the client. When false (the default) the standard\n * `<ClientOnly fallback={clientOnlyFallback}>` gate wraps everything.\n * When `clientOnlyFallback` is omitted, `<DefaultSpinner />` is used.\n *\n * Customisation props:\n * themeAttribute — passed to next-themes ThemeProvider `attribute`.\n * Defaults to \"class\". Use [\"class\", \"data-theme\"]\n * when CSS variables are also keyed off a data-theme\n * attribute (mail template).\n * tooltipDelayDuration — passed to Radix TooltipProvider `delayDuration`\n * (ms). Omit to use the Radix default (700 ms).\n * toaster — custom Toaster element rendered after children.\n * Pass `null` to suppress the built-in Toaster when\n * children already include a styled one.\n * Defaults to `<Toaster richColors position=\"bottom-left\" />`.\n * disableThemeTransitions — passed to next-themes ThemeProvider\n * `disableTransitionOnChange`. Defaults to `true`\n * (suppresses CSS transitions during theme switches,\n * which is the shadcn recommendation and avoids\n * flash artefacts). Set to `false` when the template\n * intentionally animates theme changes (e.g. content).\n */\n\nimport React from \"react\";\nimport { QueryClientProvider, type QueryClient } from \"@tanstack/react-query\";\nimport { ThemeProvider, type Attribute } from \"next-themes\";\nimport { TooltipProvider } from \"@radix-ui/react-tooltip\";\nimport { Toaster } from \"sonner\";\nimport { ClientOnly } from \"./ClientOnly.js\";\nimport { DefaultSpinner } from \"./DefaultSpinner.js\";\n\nexport interface AppProvidersProps {\n /** QueryClient instance — create with `createAgentNativeQueryClient()`. */\n queryClient: QueryClient;\n\n /**\n * Default theme passed to next-themes `ThemeProvider`.\n * Defaults to `\"system\"`. Dark-first templates (videos, slides, macros,\n * analytics) pass `\"dark\"`.\n */\n defaultTheme?: string;\n\n /**\n * Passed to next-themes ThemeProvider `attribute`.\n * Defaults to \"class\". Pass [\"class\", \"data-theme\"] when your CSS variables\n * are also keyed off a data-theme attribute (mail template).\n */\n themeAttribute?: Attribute | Attribute[];\n\n /**\n * Passed to Radix TooltipProvider `delayDuration` (ms).\n * Omit to use the Radix default (700 ms).\n */\n tooltipDelayDuration?: number;\n\n /**\n * Custom Toaster element rendered after children inside TooltipProvider.\n * Pass `null` to suppress the built-in Toaster when children already\n * include a styled one.\n * Defaults to `<Toaster richColors position=\"bottom-left\" />`.\n */\n toaster?: React.ReactNode | null;\n\n /**\n * Passed to next-themes ThemeProvider `disableTransitionOnChange`.\n * Defaults to `true` (suppresses CSS transitions on theme switch, per the\n * shadcn recommendation). Set to `false` when the template intentionally\n * animates theme changes (e.g. content's 3-way theme cycle).\n */\n disableThemeTransitions?: boolean;\n\n /**\n * When true the providers render without a `<ClientOnly>` gate so SSR\n * streams real markup for public/unauthenticated paths.\n * Defaults to false (authenticated app shell, ClientOnly-gated).\n */\n isPublicPath?: boolean;\n\n /**\n * Fallback rendered by `<ClientOnly>` while JS hydrates on private paths.\n * Defaults to `<DefaultSpinner />`.\n */\n clientOnlyFallback?: React.ReactNode;\n\n children: React.ReactNode;\n}\n\nconst DEFAULT_TOASTER = <Toaster richColors position=\"bottom-left\" />;\n\nfunction ProvidersInner({\n queryClient,\n defaultTheme = \"system\",\n themeAttribute = \"class\",\n tooltipDelayDuration,\n toaster = DEFAULT_TOASTER,\n disableThemeTransitions = true,\n children,\n}: {\n queryClient: QueryClient;\n defaultTheme?: string;\n themeAttribute?: Attribute | Attribute[];\n tooltipDelayDuration?: number;\n toaster?: React.ReactNode | null;\n disableThemeTransitions?: boolean;\n children: React.ReactNode;\n}) {\n return (\n <QueryClientProvider client={queryClient}>\n <ThemeProvider\n attribute={themeAttribute}\n defaultTheme={defaultTheme}\n enableSystem\n disableTransitionOnChange={disableThemeTransitions}\n >\n <TooltipProvider delayDuration={tooltipDelayDuration}>\n {children}\n {toaster}\n </TooltipProvider>\n </ThemeProvider>\n </QueryClientProvider>\n );\n}\n\nexport function AppProviders({\n queryClient,\n isPublicPath = false,\n clientOnlyFallback,\n defaultTheme,\n themeAttribute,\n tooltipDelayDuration,\n toaster,\n disableThemeTransitions,\n children,\n}: AppProvidersProps) {\n const fallback = clientOnlyFallback ?? <DefaultSpinner />;\n\n if (isPublicPath) {\n return (\n <ProvidersInner\n queryClient={queryClient}\n defaultTheme={defaultTheme}\n themeAttribute={themeAttribute}\n tooltipDelayDuration={tooltipDelayDuration}\n toaster={toaster}\n disableThemeTransitions={disableThemeTransitions}\n >\n {children}\n </ProvidersInner>\n );\n }\n\n return (\n <ClientOnly fallback={fallback}>\n <ProvidersInner\n queryClient={queryClient}\n defaultTheme={defaultTheme}\n themeAttribute={themeAttribute}\n tooltipDelayDuration={tooltipDelayDuration}\n toaster={toaster}\n disableThemeTransitions={disableThemeTransitions}\n >\n {children}\n </ProvidersInner>\n </ClientOnly>\n );\n}\n"]}
1
+ {"version":3,"file":"app-providers.js","sourceRoot":"","sources":["../../src/client/app-providers.tsx"],"names":[],"mappings":";AAiDA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,uBAAuB,GAExB,MAAM,WAAW,CAAC;AAiEnB,MAAM,eAAe,GAAG,KAAC,OAAO,IAAC,UAAU,QAAC,QAAQ,EAAC,aAAa,GAAG,CAAC;AAEtE,SAAS,cAAc,CAAC,EACtB,WAAW,EACX,YAAY,GAAG,QAAQ,EACvB,cAAc,GAAG,OAAO,EACxB,oBAAoB,EACpB,OAAO,GAAG,eAAe,EACzB,uBAAuB,GAAG,IAAI,EAC9B,IAAI,EACJ,QAAQ,GAUT;IACC,MAAM,iBAAiB,GACrB,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CACf,QAAQ,CACT,CAAC,CAAC,CAAC,CACF,KAAC,uBAAuB,OAAK,CAAC,IAAI,IAAI,EAAE,CAAC,YACtC,QAAQ,GACe,CAC3B,CAAC;IAEJ,OAAO,CACL,KAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW,YACtC,KAAC,aAAa,IACZ,SAAS,EAAE,cAAc,EACzB,YAAY,EAAE,YAAY,EAC1B,YAAY,QACZ,yBAAyB,EAAE,uBAAuB,YAElD,MAAC,eAAe,IAAC,aAAa,EAAE,oBAAoB,aACjD,iBAAiB,EACjB,OAAO,IACQ,GACJ,GACI,CACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAC3B,WAAW,EACX,YAAY,GAAG,KAAK,EACpB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,OAAO,EACP,uBAAuB,EACvB,IAAI,EACJ,QAAQ,GACU;IAClB,MAAM,QAAQ,GAAG,kBAAkB,IAAI,KAAC,cAAc,KAAG,CAAC;IAE1D,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CACL,KAAC,cAAc,IACb,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,oBAAoB,EAAE,oBAAoB,EAC1C,OAAO,EAAE,OAAO,EAChB,uBAAuB,EAAE,uBAAuB,EAChD,IAAI,EAAE,IAAI,YAET,QAAQ,GACM,CAClB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,UAAU,IAAC,QAAQ,EAAE,QAAQ,YAC5B,KAAC,cAAc,IACb,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,oBAAoB,EAAE,oBAAoB,EAC1C,OAAO,EAAE,OAAO,EAChB,uBAAuB,EAAE,uBAAuB,EAChD,IAAI,EAAE,IAAI,YAET,QAAQ,GACM,GACN,CACd,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Shared provider shell for agent-native template roots.\n *\n * Composes the providers every template needs:\n * QueryClientProvider → ThemeProvider → TooltipProvider → Toaster\n *\n * Templates keep their own `createAgentNativeQueryClient(overrides)` call and\n * pass the result in as `queryClient`. AppProviders never creates a client\n * internally so each template can apply its own query defaults (e.g. calendar's\n * `refetchOnWindowFocus: true`, mail's focus-refresh throttle).\n *\n * Public-path SSR pattern (calendar/clips/content):\n * Some templates have routes that must SSR real content for first-visit\n * signed-out users and crawlers, bypassing the `<ClientOnly>` gate.\n * Pass `isPublicPath` and `clientOnlyFallback` to activate this branch:\n *\n * <AppProviders\n * queryClient={queryClient}\n * isPublicPath={isPublicBookingPath(location.pathname)}\n * clientOnlyFallback={<DefaultSpinner />}\n * >\n * ...\n * </AppProviders>\n *\n * When `isPublicPath` is true the providers render without `<ClientOnly>`,\n * streaming real markup to the client. When false (the default) the standard\n * `<ClientOnly fallback={clientOnlyFallback}>` gate wraps everything.\n * When `clientOnlyFallback` is omitted, `<DefaultSpinner />` is used.\n *\n * Customisation props:\n * themeAttribute — passed to next-themes ThemeProvider `attribute`.\n * Defaults to \"class\". Use [\"class\", \"data-theme\"]\n * when CSS variables are also keyed off a data-theme\n * attribute (mail template).\n * tooltipDelayDuration — passed to Radix TooltipProvider `delayDuration`\n * (ms). Omit to use the Radix default (700 ms).\n * toaster — custom Toaster element rendered after children.\n * Pass `null` to suppress the built-in Toaster when\n * children already include a styled one.\n * Defaults to `<Toaster richColors position=\"bottom-left\" />`.\n * disableThemeTransitions — passed to next-themes ThemeProvider\n * `disableTransitionOnChange`. Defaults to `true`\n * (suppresses CSS transitions during theme switches,\n * which is the shadcn recommendation and avoids\n * flash artefacts). Set to `false` when the template\n * intentionally animates theme changes (e.g. content).\n */\n\nimport React from \"react\";\nimport { QueryClientProvider, type QueryClient } from \"@tanstack/react-query\";\nimport { ThemeProvider, type Attribute } from \"next-themes\";\nimport { TooltipProvider } from \"@radix-ui/react-tooltip\";\nimport { Toaster } from \"sonner\";\nimport { ClientOnly } from \"./ClientOnly.js\";\nimport { DefaultSpinner } from \"./DefaultSpinner.js\";\nimport {\n AgentNativeI18nProvider,\n type AgentNativeI18nProviderProps,\n} from \"./i18n.js\";\n\nexport interface AppProvidersProps {\n /** QueryClient instance — create with `createAgentNativeQueryClient()`. */\n queryClient: QueryClient;\n\n /**\n * Default theme passed to next-themes `ThemeProvider`.\n * Defaults to `\"system\"`. Dark-first templates (videos, slides, macros,\n * analytics) pass `\"dark\"`.\n */\n defaultTheme?: string;\n\n /**\n * Passed to next-themes ThemeProvider `attribute`.\n * Defaults to \"class\". Pass [\"class\", \"data-theme\"] when your CSS variables\n * are also keyed off a data-theme attribute (mail template).\n */\n themeAttribute?: Attribute | Attribute[];\n\n /**\n * Passed to Radix TooltipProvider `delayDuration` (ms).\n * Omit to use the Radix default (700 ms).\n */\n tooltipDelayDuration?: number;\n\n /**\n * Custom Toaster element rendered after children inside TooltipProvider.\n * Pass `null` to suppress the built-in Toaster when children already\n * include a styled one.\n * Defaults to `<Toaster richColors position=\"bottom-left\" />`.\n */\n toaster?: React.ReactNode | null;\n\n /**\n * Passed to next-themes ThemeProvider `disableTransitionOnChange`.\n * Defaults to `true` (suppresses CSS transitions on theme switch, per the\n * shadcn recommendation). Set to `false` when the template intentionally\n * animates theme changes (e.g. content's 3-way theme cycle).\n */\n disableThemeTransitions?: boolean;\n\n /**\n * Optional localization runtime configuration. When omitted, AppProviders\n * still mounts the i18n provider with an English fallback so templates can\n * call useT/useLocale before they add catalogs. Pass false to opt out.\n */\n i18n?: Omit<AgentNativeI18nProviderProps, \"children\"> | false;\n\n /**\n * When true the providers render without a `<ClientOnly>` gate so SSR\n * streams real markup for public/unauthenticated paths.\n * Defaults to false (authenticated app shell, ClientOnly-gated).\n */\n isPublicPath?: boolean;\n\n /**\n * Fallback rendered by `<ClientOnly>` while JS hydrates on private paths.\n * Defaults to `<DefaultSpinner />`.\n */\n clientOnlyFallback?: React.ReactNode;\n\n children: React.ReactNode;\n}\n\nconst DEFAULT_TOASTER = <Toaster richColors position=\"bottom-left\" />;\n\nfunction ProvidersInner({\n queryClient,\n defaultTheme = \"system\",\n themeAttribute = \"class\",\n tooltipDelayDuration,\n toaster = DEFAULT_TOASTER,\n disableThemeTransitions = true,\n i18n,\n children,\n}: {\n queryClient: QueryClient;\n defaultTheme?: string;\n themeAttribute?: Attribute | Attribute[];\n tooltipDelayDuration?: number;\n toaster?: React.ReactNode | null;\n disableThemeTransitions?: boolean;\n i18n?: Omit<AgentNativeI18nProviderProps, \"children\"> | false;\n children: React.ReactNode;\n}) {\n const localizedChildren =\n i18n === false ? (\n children\n ) : (\n <AgentNativeI18nProvider {...(i18n ?? {})}>\n {children}\n </AgentNativeI18nProvider>\n );\n\n return (\n <QueryClientProvider client={queryClient}>\n <ThemeProvider\n attribute={themeAttribute}\n defaultTheme={defaultTheme}\n enableSystem\n disableTransitionOnChange={disableThemeTransitions}\n >\n <TooltipProvider delayDuration={tooltipDelayDuration}>\n {localizedChildren}\n {toaster}\n </TooltipProvider>\n </ThemeProvider>\n </QueryClientProvider>\n );\n}\n\nexport function AppProviders({\n queryClient,\n isPublicPath = false,\n clientOnlyFallback,\n defaultTheme,\n themeAttribute,\n tooltipDelayDuration,\n toaster,\n disableThemeTransitions,\n i18n,\n children,\n}: AppProvidersProps) {\n const fallback = clientOnlyFallback ?? <DefaultSpinner />;\n\n if (isPublicPath) {\n return (\n <ProvidersInner\n queryClient={queryClient}\n defaultTheme={defaultTheme}\n themeAttribute={themeAttribute}\n tooltipDelayDuration={tooltipDelayDuration}\n toaster={toaster}\n disableThemeTransitions={disableThemeTransitions}\n i18n={i18n}\n >\n {children}\n </ProvidersInner>\n );\n }\n\n return (\n <ClientOnly fallback={fallback}>\n <ProvidersInner\n queryClient={queryClient}\n defaultTheme={defaultTheme}\n themeAttribute={themeAttribute}\n tooltipDelayDuration={tooltipDelayDuration}\n toaster={toaster}\n disableThemeTransitions={disableThemeTransitions}\n i18n={i18n}\n >\n {children}\n </ProvidersInner>\n </ClientOnly>\n );\n}\n"]}
@@ -0,0 +1,54 @@
1
+ import React from "react";
2
+ import { type LocaleCode, type LocaleMetadata, type LocalePreference, type LocalizationPreference } from "../localization/shared.js";
3
+ export { DEFAULT_LOCALE, LOCALE_HYDRATION_GLOBAL, LOCALE_METADATA, LOCALE_STORAGE_KEY, SUPPORTED_LOCALES, localeDirection, normalizeLocaleCode, normalizeLocalePreference, normalizeLocalizationPreference, resolveLocaleFromCandidates, resolveLocaleFromPreference, type LocaleCode, type LocaleMetadata, type LocalePreference, type LocalizationPreference, } from "../localization/shared.js";
4
+ export { getLocaleInitScript } from "../localization/server.js";
5
+ export type LocaleMessages = Record<string, unknown>;
6
+ export interface LocaleHydrationPayload {
7
+ locale?: LocaleCode;
8
+ preference?: LocalizationPreference;
9
+ dir?: "ltr" | "rtl";
10
+ messages?: LocaleMessages;
11
+ }
12
+ export interface AgentNativeI18nCatalog {
13
+ namespace?: string;
14
+ sourceLocale?: LocaleCode;
15
+ messages?: LocaleMessages;
16
+ loadMessages?: (locale: LocaleCode) => Promise<LocaleMessages | null>;
17
+ }
18
+ export interface AgentNativeI18nProviderProps {
19
+ children: React.ReactNode;
20
+ catalog?: AgentNativeI18nCatalog;
21
+ initialLocale?: LocaleCode;
22
+ initialPreference?: LocalizationPreference | LocalePreference;
23
+ initialMessages?: LocaleMessages | null;
24
+ persistPreference?: boolean;
25
+ }
26
+ interface LocaleContextValue {
27
+ locale: LocaleCode;
28
+ preference: LocalePreference;
29
+ dir: "ltr" | "rtl";
30
+ metadata: LocaleMetadata;
31
+ setPreference: (preference: LocalePreference) => Promise<void>;
32
+ loading: boolean;
33
+ }
34
+ declare global {
35
+ interface Window {
36
+ __AGENT_NATIVE_LOCALE__?: LocaleHydrationPayload;
37
+ }
38
+ }
39
+ export declare function AgentNativeI18nProvider({ children, catalog, initialLocale, initialPreference, initialMessages, persistPreference, }: AgentNativeI18nProviderProps): import("react/jsx-runtime").JSX.Element;
40
+ export declare function useLocale(): LocaleContextValue;
41
+ export declare function useT(): import("i18next").TFunction<"translation", undefined>;
42
+ export declare function useFormatters(): {
43
+ formatDate(value: Date | number | string, options?: Intl.DateTimeFormatOptions): string;
44
+ formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
45
+ formatRelativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, options?: Intl.RelativeTimeFormatOptions): string;
46
+ formatList(value: string[], options?: Intl.ListFormatOptions): string;
47
+ };
48
+ export declare function LanguagePicker({ className, includeSystem, label, variant, }: {
49
+ className?: string;
50
+ includeSystem?: boolean;
51
+ label?: string;
52
+ variant?: "select" | "icon";
53
+ }): import("react/jsx-runtime").JSX.Element;
54
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/client/i18n.tsx"],"names":[],"mappings":"AAGA,OAAO,KAQN,MAAM,OAAO,CAAC;AAQf,OAAO,EAUL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC5B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,+BAA+B,EAC/B,2BAA2B,EAC3B,2BAA2B,EAC3B,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,CA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