react-cheminfo 0.25.0 → 0.27.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 (436) hide show
  1. package/README.md +73 -2
  2. package/bin/check-deploy.mjs +14 -4
  3. package/bin/check-messages.mjs +229 -0
  4. package/lib/about/ui/AboutBuild.d.ts.map +1 -1
  5. package/lib/about/ui/AboutBuild.js +15 -4
  6. package/lib/about/ui/AboutBuild.js.map +1 -1
  7. package/lib/about/ui/AboutCitations.d.ts.map +1 -1
  8. package/lib/about/ui/AboutCitations.js +3 -1
  9. package/lib/about/ui/AboutCitations.js.map +1 -1
  10. package/lib/about/ui/AboutPage.d.ts.map +1 -1
  11. package/lib/about/ui/AboutPage.js +9 -1
  12. package/lib/about/ui/AboutPage.js.map +1 -1
  13. package/lib/about/ui/AboutProvidedBy.d.ts.map +1 -1
  14. package/lib/about/ui/AboutProvidedBy.js +8 -3
  15. package/lib/about/ui/AboutProvidedBy.js.map +1 -1
  16. package/lib/capsule/ui/Capsule.d.ts +30 -0
  17. package/lib/capsule/ui/Capsule.d.ts.map +1 -0
  18. package/lib/capsule/ui/Capsule.js +12 -0
  19. package/lib/capsule/ui/Capsule.js.map +1 -0
  20. package/lib/capsule/ui/CapsuleFilter.d.ts +19 -3
  21. package/lib/capsule/ui/CapsuleFilter.d.ts.map +1 -1
  22. package/lib/capsule/ui/CapsuleFilter.js +14 -44
  23. package/lib/capsule/ui/CapsuleFilter.js.map +1 -1
  24. package/lib/capsule/ui/capsuleFilterCapsules.d.ts +15 -0
  25. package/lib/capsule/ui/capsuleFilterCapsules.d.ts.map +1 -0
  26. package/lib/capsule/ui/capsuleFilterCapsules.js +47 -0
  27. package/lib/capsule/ui/capsuleFilterCapsules.js.map +1 -0
  28. package/lib/chart/ui/ChartTrackingLayer.d.ts.map +1 -1
  29. package/lib/chart/ui/ChartTrackingLayer.js +4 -2
  30. package/lib/chart/ui/ChartTrackingLayer.js.map +1 -1
  31. package/lib/chrome/ui/SiteHeader.d.ts +1 -1
  32. package/lib/chrome/ui/SiteHeader.d.ts.map +1 -1
  33. package/lib/chrome/ui/SiteHeader.js +4 -2
  34. package/lib/chrome/ui/SiteHeader.js.map +1 -1
  35. package/lib/citation/ui/CitationMenu.d.ts +1 -1
  36. package/lib/citation/ui/CitationMenu.d.ts.map +1 -1
  37. package/lib/citation/ui/CitationMenu.js +7 -3
  38. package/lib/citation/ui/CitationMenu.js.map +1 -1
  39. package/lib/citation/ui/CiteButton.d.ts +1 -1
  40. package/lib/citation/ui/CiteButton.d.ts.map +1 -1
  41. package/lib/citation/ui/CiteButton.js +3 -1
  42. package/lib/citation/ui/CiteButton.js.map +1 -1
  43. package/lib/citation/ui/CopyFormatEntries.d.ts.map +1 -1
  44. package/lib/citation/ui/CopyFormatEntries.js +3 -1
  45. package/lib/citation/ui/CopyFormatEntries.js.map +1 -1
  46. package/lib/citation/ui/WorkEntry.d.ts.map +1 -1
  47. package/lib/citation/ui/WorkEntry.js +3 -1
  48. package/lib/citation/ui/WorkEntry.js.map +1 -1
  49. package/lib/citation/ui/entries.d.ts.map +1 -1
  50. package/lib/citation/ui/entries.js +8 -2
  51. package/lib/citation/ui/entries.js.map +1 -1
  52. package/lib/citation/ui/useCopyFeedback.d.ts.map +1 -1
  53. package/lib/citation/ui/useCopyFeedback.js +9 -4
  54. package/lib/citation/ui/useCopyFeedback.js.map +1 -1
  55. package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -1
  56. package/lib/clipboard/ui/ClickToCopy.js +12 -6
  57. package/lib/clipboard/ui/ClickToCopy.js.map +1 -1
  58. package/lib/clipboard/ui/CopyButton.d.ts +3 -3
  59. package/lib/clipboard/ui/CopyButton.d.ts.map +1 -1
  60. package/lib/clipboard/ui/CopyButton.js +7 -4
  61. package/lib/clipboard/ui/CopyButton.js.map +1 -1
  62. package/lib/color/ui/ColorScaleEditor.d.ts.map +1 -1
  63. package/lib/color/ui/ColorScaleEditor.js +15 -10
  64. package/lib/color/ui/ColorScaleEditor.js.map +1 -1
  65. package/lib/color/ui/ColorScaleEntry.d.ts.map +1 -1
  66. package/lib/color/ui/ColorScaleEntry.js +4 -2
  67. package/lib/color/ui/ColorScaleEntry.js.map +1 -1
  68. package/lib/color/ui/ColorScaleLegend.d.ts.map +1 -1
  69. package/lib/color/ui/ColorScaleLegend.js +7 -1
  70. package/lib/color/ui/ColorScaleLegend.js.map +1 -1
  71. package/lib/color/ui/ColorScaleSelect.d.ts.map +1 -1
  72. package/lib/color/ui/ColorScaleSelect.js +8 -4
  73. package/lib/color/ui/ColorScaleSelect.js.map +1 -1
  74. package/lib/confirm/ui/ConfirmButton.d.ts +2 -2
  75. package/lib/confirm/ui/ConfirmButton.d.ts.map +1 -1
  76. package/lib/confirm/ui/ConfirmButton.js +4 -2
  77. package/lib/confirm/ui/ConfirmButton.js.map +1 -1
  78. package/lib/core.d.ts +1 -0
  79. package/lib/core.d.ts.map +1 -1
  80. package/lib/core.js +1 -0
  81. package/lib/core.js.map +1 -1
  82. package/lib/credits/ui/CreditsList.d.ts.map +1 -1
  83. package/lib/credits/ui/CreditsList.js +3 -1
  84. package/lib/credits/ui/CreditsList.js.map +1 -1
  85. package/lib/delimited/ui/DelimitedTextDialog.d.ts.map +1 -1
  86. package/lib/delimited/ui/DelimitedTextDialog.js +5 -2
  87. package/lib/delimited/ui/DelimitedTextDialog.js.map +1 -1
  88. package/lib/delimited/ui/DelimitedTextPanel.d.ts.map +1 -1
  89. package/lib/delimited/ui/DelimitedTextPanel.js +8 -8
  90. package/lib/delimited/ui/DelimitedTextPanel.js.map +1 -1
  91. package/lib/deploy/core/checkDeploy.d.ts +3 -1
  92. package/lib/deploy/core/checkDeploy.d.ts.map +1 -1
  93. package/lib/deploy/core/checkDeploy.js +7 -1
  94. package/lib/deploy/core/checkDeploy.js.map +1 -1
  95. package/lib/deploy/core/index.d.ts +1 -0
  96. package/lib/deploy/core/index.d.ts.map +1 -1
  97. package/lib/deploy/core/index.js +1 -0
  98. package/lib/deploy/core/index.js.map +1 -1
  99. package/lib/deploy/core/pageCache.d.ts +24 -0
  100. package/lib/deploy/core/pageCache.d.ts.map +1 -0
  101. package/lib/deploy/core/pageCache.js +91 -0
  102. package/lib/deploy/core/pageCache.js.map +1 -0
  103. package/lib/deploy/core/types.d.ts +1 -1
  104. package/lib/deploy/core/types.d.ts.map +1 -1
  105. package/lib/deploy/core/types.js.map +1 -1
  106. package/lib/download/ui/FigureDownload.d.ts +2 -2
  107. package/lib/download/ui/FigureDownload.d.ts.map +1 -1
  108. package/lib/download/ui/FigureDownload.js +4 -2
  109. package/lib/download/ui/FigureDownload.js.map +1 -1
  110. package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
  111. package/lib/download/ui/FigureDownloadPanel.js +24 -18
  112. package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
  113. package/lib/ecosystem/ui/EcosystemButton.d.ts +1 -1
  114. package/lib/ecosystem/ui/EcosystemButton.d.ts.map +1 -1
  115. package/lib/ecosystem/ui/EcosystemButton.js +4 -2
  116. package/lib/ecosystem/ui/EcosystemButton.js.map +1 -1
  117. package/lib/ecosystem/ui/EcosystemLinks.d.ts +1 -1
  118. package/lib/ecosystem/ui/EcosystemLinks.d.ts.map +1 -1
  119. package/lib/ecosystem/ui/EcosystemLinks.js +5 -2
  120. package/lib/ecosystem/ui/EcosystemLinks.js.map +1 -1
  121. package/lib/ecosystem/ui/EcosystemMenu.d.ts.map +1 -1
  122. package/lib/ecosystem/ui/EcosystemMenu.js +3 -1
  123. package/lib/ecosystem/ui/EcosystemMenu.js.map +1 -1
  124. package/lib/ecosystem/ui/SiteGroupSection.d.ts.map +1 -1
  125. package/lib/ecosystem/ui/SiteGroupSection.js +3 -1
  126. package/lib/ecosystem/ui/SiteGroupSection.js.map +1 -1
  127. package/lib/ecosystem/ui/SiteTile.d.ts.map +1 -1
  128. package/lib/ecosystem/ui/SiteTile.js +3 -1
  129. package/lib/ecosystem/ui/SiteTile.js.map +1 -1
  130. package/lib/error/ui/ErrorFallback.d.ts +2 -2
  131. package/lib/error/ui/ErrorFallback.d.ts.map +1 -1
  132. package/lib/error/ui/ErrorFallback.js +4 -2
  133. package/lib/error/ui/ErrorFallback.js.map +1 -1
  134. package/lib/help/ui/HelpBody.d.ts.map +1 -1
  135. package/lib/help/ui/HelpBody.js +3 -1
  136. package/lib/help/ui/HelpBody.js.map +1 -1
  137. package/lib/help/ui/HelpIcon.d.ts +2 -1
  138. package/lib/help/ui/HelpIcon.d.ts.map +1 -1
  139. package/lib/help/ui/HelpIcon.js +4 -2
  140. package/lib/help/ui/HelpIcon.js.map +1 -1
  141. package/lib/help/ui/HelpToolbarButton.d.ts.map +1 -1
  142. package/lib/help/ui/HelpToolbarButton.js +3 -1
  143. package/lib/help/ui/HelpToolbarButton.js.map +1 -1
  144. package/lib/help/ui/helpName.d.ts +5 -1
  145. package/lib/help/ui/helpName.d.ts.map +1 -1
  146. package/lib/help/ui/helpName.js +4 -2
  147. package/lib/help/ui/helpName.js.map +1 -1
  148. package/lib/i18n/core/chromeCatalog.d.ts +21 -0
  149. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -0
  150. package/lib/i18n/core/chromeCatalog.js +29 -0
  151. package/lib/i18n/core/chromeCatalog.js.map +1 -0
  152. package/lib/i18n/core/index.d.ts +12 -0
  153. package/lib/i18n/core/index.d.ts.map +1 -0
  154. package/lib/i18n/core/index.js +6 -0
  155. package/lib/i18n/core/index.js.map +1 -0
  156. package/lib/i18n/core/languages.d.ts +32 -0
  157. package/lib/i18n/core/languages.d.ts.map +1 -0
  158. package/lib/i18n/core/languages.js +41 -0
  159. package/lib/i18n/core/languages.js.map +1 -0
  160. package/lib/i18n/core/messageCatalog.d.ts +113 -0
  161. package/lib/i18n/core/messageCatalog.d.ts.map +1 -0
  162. package/lib/i18n/core/messageCatalog.js +135 -0
  163. package/lib/i18n/core/messageCatalog.js.map +1 -0
  164. package/lib/i18n/core/messageValues.d.ts +3 -0
  165. package/lib/i18n/core/messageValues.d.ts.map +1 -0
  166. package/lib/i18n/core/messageValues.js +2 -0
  167. package/lib/i18n/core/messageValues.js.map +1 -0
  168. package/lib/i18n/core/session.d.ts +51 -0
  169. package/lib/i18n/core/session.d.ts.map +1 -0
  170. package/lib/i18n/core/session.js +64 -0
  171. package/lib/i18n/core/session.js.map +1 -0
  172. package/lib/i18n/core/translateSetup.d.ts +28 -0
  173. package/lib/i18n/core/translateSetup.d.ts.map +1 -0
  174. package/lib/i18n/core/translateSetup.js +30 -0
  175. package/lib/i18n/core/translateSetup.js.map +1 -0
  176. package/lib/i18n/ui/LanguageSelect.d.ts +37 -0
  177. package/lib/i18n/ui/LanguageSelect.d.ts.map +1 -0
  178. package/lib/i18n/ui/LanguageSelect.js +27 -0
  179. package/lib/i18n/ui/LanguageSelect.js.map +1 -0
  180. package/lib/i18n/ui/index.d.ts +6 -0
  181. package/lib/i18n/ui/index.d.ts.map +1 -0
  182. package/lib/i18n/ui/index.js +4 -0
  183. package/lib/i18n/ui/index.js.map +1 -0
  184. package/lib/i18n/ui/useLanguage.d.ts +23 -0
  185. package/lib/i18n/ui/useLanguage.d.ts.map +1 -0
  186. package/lib/i18n/ui/useLanguage.js +36 -0
  187. package/lib/i18n/ui/useLanguage.js.map +1 -0
  188. package/lib/i18n/ui/useT.d.ts +47 -0
  189. package/lib/i18n/ui/useT.d.ts.map +1 -0
  190. package/lib/i18n/ui/useT.js +51 -0
  191. package/lib/i18n/ui/useT.js.map +1 -0
  192. package/lib/locales/de.json +442 -0
  193. package/lib/locales/en.json +442 -0
  194. package/lib/locales/es.json +442 -0
  195. package/lib/locales/fr.json +442 -0
  196. package/lib/molecule3d/core/gestures.d.ts +10 -0
  197. package/lib/molecule3d/core/gestures.d.ts.map +1 -1
  198. package/lib/molecule3d/core/gestures.js +39 -7
  199. package/lib/molecule3d/core/gestures.js.map +1 -1
  200. package/lib/molecule3d/ui/Molecule3DExport.d.ts.map +1 -1
  201. package/lib/molecule3d/ui/Molecule3DExport.js +3 -1
  202. package/lib/molecule3d/ui/Molecule3DExport.js.map +1 -1
  203. package/lib/molecule3d/ui/Molecule3DHelp.d.ts.map +1 -1
  204. package/lib/molecule3d/ui/Molecule3DHelp.js +7 -2
  205. package/lib/molecule3d/ui/Molecule3DHelp.js.map +1 -1
  206. package/lib/molecule3d/ui/Molecule3DOptions.d.ts.map +1 -1
  207. package/lib/molecule3d/ui/Molecule3DOptions.js +9 -9
  208. package/lib/molecule3d/ui/Molecule3DOptions.js.map +1 -1
  209. package/lib/molecule3d/ui/Molecule3DSurfaceColors.d.ts.map +1 -1
  210. package/lib/molecule3d/ui/Molecule3DSurfaceColors.js +8 -8
  211. package/lib/molecule3d/ui/Molecule3DSurfaceColors.js.map +1 -1
  212. package/lib/molecule3d/ui/Molecule3DToolbar.d.ts.map +1 -1
  213. package/lib/molecule3d/ui/Molecule3DToolbar.js +15 -10
  214. package/lib/molecule3d/ui/Molecule3DToolbar.js.map +1 -1
  215. package/lib/molecule3d/ui/MoleculeViewer3D.d.ts.map +1 -1
  216. package/lib/molecule3d/ui/MoleculeViewer3D.js +6 -3
  217. package/lib/molecule3d/ui/MoleculeViewer3D.js.map +1 -1
  218. package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts.map +1 -1
  219. package/lib/orbital/ui/AtomicOrbitalCanvas.js +3 -1
  220. package/lib/orbital/ui/AtomicOrbitalCanvas.js.map +1 -1
  221. package/lib/orbital/ui/AtomicOrbitalControls.d.ts.map +1 -1
  222. package/lib/orbital/ui/AtomicOrbitalControls.js +12 -15
  223. package/lib/orbital/ui/AtomicOrbitalControls.js.map +1 -1
  224. package/lib/orbital/ui/AtomicOrbitalViewer.d.ts.map +1 -1
  225. package/lib/orbital/ui/AtomicOrbitalViewer.js +6 -3
  226. package/lib/orbital/ui/AtomicOrbitalViewer.js.map +1 -1
  227. package/lib/orbital/ui/capability.d.ts +4 -0
  228. package/lib/orbital/ui/capability.d.ts.map +1 -1
  229. package/lib/orbital/ui/capability.js +4 -0
  230. package/lib/orbital/ui/capability.js.map +1 -1
  231. package/lib/overlay/ui/OverlayBar.d.ts +1 -1
  232. package/lib/overlay/ui/OverlayBar.d.ts.map +1 -1
  233. package/lib/overlay/ui/OverlayBar.js +6 -3
  234. package/lib/overlay/ui/OverlayBar.js.map +1 -1
  235. package/lib/overlay/ui/OverlayInfo.d.ts +1 -1
  236. package/lib/overlay/ui/OverlayInfo.d.ts.map +1 -1
  237. package/lib/overlay/ui/OverlayInfo.js +5 -2
  238. package/lib/overlay/ui/OverlayInfo.js.map +1 -1
  239. package/lib/overlay/ui/OverlayPanel.d.ts +9 -2
  240. package/lib/overlay/ui/OverlayPanel.d.ts.map +1 -1
  241. package/lib/overlay/ui/OverlayPanel.js +5 -11
  242. package/lib/overlay/ui/OverlayPanel.js.map +1 -1
  243. package/lib/overlay/ui/OverlayReadout.d.ts.map +1 -1
  244. package/lib/overlay/ui/OverlayReadout.js +3 -1
  245. package/lib/overlay/ui/OverlayReadout.js.map +1 -1
  246. package/lib/pedagogy/ui/ExerciseActions.d.ts +1 -1
  247. package/lib/pedagogy/ui/ExerciseActions.d.ts.map +1 -1
  248. package/lib/pedagogy/ui/ExerciseActions.js +9 -2
  249. package/lib/pedagogy/ui/ExerciseActions.js.map +1 -1
  250. package/lib/pedagogy/ui/ExerciseProgressHeader.d.ts +1 -1
  251. package/lib/pedagogy/ui/ExerciseProgressHeader.d.ts.map +1 -1
  252. package/lib/pedagogy/ui/ExerciseProgressHeader.js +9 -5
  253. package/lib/pedagogy/ui/ExerciseProgressHeader.js.map +1 -1
  254. package/lib/pedagogy/ui/GlossaryIndex.d.ts +1 -1
  255. package/lib/pedagogy/ui/GlossaryIndex.d.ts.map +1 -1
  256. package/lib/pedagogy/ui/GlossaryIndex.js +6 -8
  257. package/lib/pedagogy/ui/GlossaryIndex.js.map +1 -1
  258. package/lib/pedagogy/ui/HintLadder.d.ts +2 -2
  259. package/lib/pedagogy/ui/HintLadder.d.ts.map +1 -1
  260. package/lib/pedagogy/ui/HintLadder.js +8 -2
  261. package/lib/pedagogy/ui/HintLadder.js.map +1 -1
  262. package/lib/pedagogy/ui/SyntaxTooltip.d.ts +4 -4
  263. package/lib/pedagogy/ui/SyntaxTooltip.d.ts.map +1 -1
  264. package/lib/pedagogy/ui/SyntaxTooltip.js +4 -2
  265. package/lib/pedagogy/ui/SyntaxTooltip.js.map +1 -1
  266. package/lib/pedagogy/ui/TutorialStepStrip.d.ts.map +1 -1
  267. package/lib/pedagogy/ui/TutorialStepStrip.js +7 -2
  268. package/lib/pedagogy/ui/TutorialStepStrip.js.map +1 -1
  269. package/lib/periodic/ui/CategoryLegend.d.ts.map +1 -1
  270. package/lib/periodic/ui/CategoryLegend.js +3 -1
  271. package/lib/periodic/ui/CategoryLegend.js.map +1 -1
  272. package/lib/periodic/ui/ElementCell.d.ts.map +1 -1
  273. package/lib/periodic/ui/ElementCell.js +7 -1
  274. package/lib/periodic/ui/ElementCell.js.map +1 -1
  275. package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -1
  276. package/lib/periodic/ui/PeriodicTable.js +3 -1
  277. package/lib/periodic/ui/PeriodicTable.js.map +1 -1
  278. package/lib/periodic/ui/PeriodicTableChrome.d.ts.map +1 -1
  279. package/lib/periodic/ui/PeriodicTableChrome.js +4 -2
  280. package/lib/periodic/ui/PeriodicTableChrome.js.map +1 -1
  281. package/lib/share/ui/ShareButton.d.ts +2 -2
  282. package/lib/share/ui/ShareButton.d.ts.map +1 -1
  283. package/lib/share/ui/ShareButton.js +5 -2
  284. package/lib/share/ui/ShareButton.js.map +1 -1
  285. package/lib/share/ui/ShareConfigOptions.d.ts.map +1 -1
  286. package/lib/share/ui/ShareConfigOptions.js +4 -2
  287. package/lib/share/ui/ShareConfigOptions.js.map +1 -1
  288. package/lib/share/ui/ShareDialog.d.ts.map +1 -1
  289. package/lib/share/ui/ShareDialog.js +3 -1
  290. package/lib/share/ui/ShareDialog.js.map +1 -1
  291. package/lib/share/ui/ShareDialogContent.d.ts.map +1 -1
  292. package/lib/share/ui/ShareDialogContent.js +10 -1
  293. package/lib/share/ui/ShareDialogContent.js.map +1 -1
  294. package/lib/share/ui/SharePresetTabs.d.ts.map +1 -1
  295. package/lib/share/ui/SharePresetTabs.js +3 -1
  296. package/lib/share/ui/SharePresetTabs.js.map +1 -1
  297. package/lib/slides/ui/BackToSlides.d.ts.map +1 -1
  298. package/lib/slides/ui/BackToSlides.js +4 -2
  299. package/lib/slides/ui/BackToSlides.js.map +1 -1
  300. package/lib/slides/ui/EmbedSlide.d.ts.map +1 -1
  301. package/lib/slides/ui/EmbedSlide.js +3 -1
  302. package/lib/slides/ui/EmbedSlide.js.map +1 -1
  303. package/lib/slides/ui/Slide.d.ts.map +1 -1
  304. package/lib/slides/ui/Slide.js +3 -1
  305. package/lib/slides/ui/Slide.js.map +1 -1
  306. package/lib/slides/ui/SlideshowBar.d.ts.map +1 -1
  307. package/lib/slides/ui/SlideshowBar.js +5 -3
  308. package/lib/slides/ui/SlideshowBar.js.map +1 -1
  309. package/lib/slides/ui/TalkList.d.ts +1 -1
  310. package/lib/slides/ui/TalkList.d.ts.map +1 -1
  311. package/lib/slides/ui/TalkList.js +4 -2
  312. package/lib/slides/ui/TalkList.js.map +1 -1
  313. package/lib/structure/core/editorGuide.d.ts +14 -0
  314. package/lib/structure/core/editorGuide.d.ts.map +1 -1
  315. package/lib/structure/core/editorGuide.js +117 -19
  316. package/lib/structure/core/editorGuide.js.map +1 -1
  317. package/lib/structure/core/editorToolbar.d.ts +3 -1
  318. package/lib/structure/core/editorToolbar.d.ts.map +1 -1
  319. package/lib/structure/core/editorToolbar.js +44 -23
  320. package/lib/structure/core/editorToolbar.js.map +1 -1
  321. package/lib/structure/ui/EditorHelpButton.d.ts.map +1 -1
  322. package/lib/structure/ui/EditorHelpButton.js +3 -2
  323. package/lib/structure/ui/EditorHelpButton.js.map +1 -1
  324. package/lib/structure/ui/StructureEditor.d.ts.map +1 -1
  325. package/lib/structure/ui/StructureEditor.js +3 -1
  326. package/lib/structure/ui/StructureEditor.js.map +1 -1
  327. package/lib/structure/ui/StructureEditorHelp.d.ts.map +1 -1
  328. package/lib/structure/ui/StructureEditorHelp.js +12 -3
  329. package/lib/structure/ui/StructureEditorHelp.js.map +1 -1
  330. package/lib/structure/ui/ToolbarTooltip.d.ts.map +1 -1
  331. package/lib/structure/ui/ToolbarTooltip.js +5 -3
  332. package/lib/structure/ui/ToolbarTooltip.js.map +1 -1
  333. package/lib/ui.d.ts +1 -0
  334. package/lib/ui.d.ts.map +1 -1
  335. package/lib/ui.js +1 -0
  336. package/lib/ui.js.map +1 -1
  337. package/package.json +4 -2
  338. package/src/about/ui/AboutBuild.tsx +23 -16
  339. package/src/about/ui/AboutCitations.tsx +3 -1
  340. package/src/about/ui/AboutPage.tsx +38 -12
  341. package/src/about/ui/AboutProvidedBy.tsx +13 -3
  342. package/src/capsule/ui/Capsule.tsx +48 -0
  343. package/src/capsule/ui/CapsuleFilter.tsx +38 -114
  344. package/src/capsule/ui/capsuleFilterCapsules.tsx +110 -0
  345. package/src/chart/ui/ChartTrackingLayer.tsx +4 -2
  346. package/src/chrome/ui/SiteHeader.tsx +5 -3
  347. package/src/citation/ui/CitationMenu.tsx +9 -5
  348. package/src/citation/ui/CiteButton.tsx +4 -2
  349. package/src/citation/ui/CopyFormatEntries.tsx +3 -1
  350. package/src/citation/ui/WorkEntry.tsx +5 -3
  351. package/src/citation/ui/entries.tsx +9 -2
  352. package/src/citation/ui/useCopyFeedback.ts +11 -4
  353. package/src/clipboard/ui/ClickToCopy.tsx +15 -5
  354. package/src/clipboard/ui/CopyButton.tsx +14 -10
  355. package/src/color/ui/ColorScaleEditor.tsx +17 -15
  356. package/src/color/ui/ColorScaleEntry.tsx +7 -3
  357. package/src/color/ui/ColorScaleLegend.tsx +7 -1
  358. package/src/color/ui/ColorScaleSelect.tsx +12 -6
  359. package/src/confirm/ui/ConfirmButton.tsx +9 -11
  360. package/src/core.ts +1 -0
  361. package/src/credits/ui/CreditsList.tsx +5 -1
  362. package/src/delimited/ui/DelimitedTextDialog.tsx +10 -10
  363. package/src/delimited/ui/DelimitedTextPanel.tsx +19 -12
  364. package/src/deploy/core/checkDeploy.ts +7 -1
  365. package/src/deploy/core/index.ts +1 -0
  366. package/src/deploy/core/pageCache.ts +120 -0
  367. package/src/deploy/core/types.ts +2 -1
  368. package/src/download/ui/FigureDownload.tsx +7 -5
  369. package/src/download/ui/FigureDownloadPanel.tsx +31 -25
  370. package/src/ecosystem/ui/EcosystemButton.tsx +5 -3
  371. package/src/ecosystem/ui/EcosystemLinks.tsx +10 -10
  372. package/src/ecosystem/ui/EcosystemMenu.tsx +3 -1
  373. package/src/ecosystem/ui/SiteGroupSection.tsx +6 -2
  374. package/src/ecosystem/ui/SiteTile.tsx +6 -2
  375. package/src/error/ui/ErrorFallback.tsx +13 -12
  376. package/src/help/ui/HelpBody.tsx +4 -2
  377. package/src/help/ui/HelpIcon.tsx +6 -3
  378. package/src/help/ui/HelpToolbarButton.tsx +4 -1
  379. package/src/help/ui/helpName.ts +10 -2
  380. package/src/i18n/core/chromeCatalog.ts +35 -0
  381. package/src/i18n/core/index.ts +26 -0
  382. package/src/i18n/core/languages.ts +46 -0
  383. package/src/i18n/core/messageCatalog.ts +202 -0
  384. package/src/i18n/core/messageValues.ts +2 -0
  385. package/src/i18n/core/session.ts +82 -0
  386. package/src/i18n/core/translateSetup.ts +47 -0
  387. package/src/i18n/ui/LanguageSelect.tsx +72 -0
  388. package/src/i18n/ui/index.ts +9 -0
  389. package/src/i18n/ui/useLanguage.ts +48 -0
  390. package/src/i18n/ui/useT.ts +90 -0
  391. package/src/locales/de.json +442 -0
  392. package/src/locales/en.json +442 -0
  393. package/src/locales/es.json +442 -0
  394. package/src/locales/fr.json +442 -0
  395. package/src/molecule3d/core/gestures.ts +44 -7
  396. package/src/molecule3d/ui/Molecule3DExport.tsx +3 -1
  397. package/src/molecule3d/ui/Molecule3DHelp.tsx +17 -6
  398. package/src/molecule3d/ui/Molecule3DOptions.tsx +13 -13
  399. package/src/molecule3d/ui/Molecule3DSurfaceColors.tsx +16 -13
  400. package/src/molecule3d/ui/Molecule3DToolbar.tsx +29 -18
  401. package/src/molecule3d/ui/MoleculeViewer3D.tsx +13 -8
  402. package/src/orbital/ui/AtomicOrbitalCanvas.tsx +3 -1
  403. package/src/orbital/ui/AtomicOrbitalControls.tsx +15 -20
  404. package/src/orbital/ui/AtomicOrbitalViewer.tsx +13 -13
  405. package/src/orbital/ui/capability.ts +10 -0
  406. package/src/overlay/ui/OverlayBar.tsx +7 -4
  407. package/src/overlay/ui/OverlayInfo.tsx +6 -3
  408. package/src/overlay/ui/OverlayPanel.tsx +10 -7
  409. package/src/overlay/ui/OverlayReadout.tsx +3 -1
  410. package/src/pedagogy/ui/ExerciseActions.tsx +16 -6
  411. package/src/pedagogy/ui/ExerciseProgressHeader.tsx +13 -11
  412. package/src/pedagogy/ui/GlossaryIndex.tsx +11 -12
  413. package/src/pedagogy/ui/HintLadder.tsx +15 -12
  414. package/src/pedagogy/ui/SyntaxTooltip.tsx +9 -7
  415. package/src/pedagogy/ui/TutorialStepStrip.tsx +8 -3
  416. package/src/periodic/ui/CategoryLegend.tsx +6 -1
  417. package/src/periodic/ui/ElementCell.tsx +7 -1
  418. package/src/periodic/ui/PeriodicTable.tsx +3 -1
  419. package/src/periodic/ui/PeriodicTableChrome.tsx +4 -2
  420. package/src/share/ui/ShareButton.tsx +8 -5
  421. package/src/share/ui/ShareConfigOptions.tsx +6 -7
  422. package/src/share/ui/ShareDialog.tsx +3 -1
  423. package/src/share/ui/ShareDialogContent.tsx +20 -10
  424. package/src/share/ui/SharePresetTabs.tsx +3 -1
  425. package/src/slides/ui/BackToSlides.tsx +4 -2
  426. package/src/slides/ui/EmbedSlide.tsx +3 -3
  427. package/src/slides/ui/Slide.tsx +3 -1
  428. package/src/slides/ui/SlideshowBar.tsx +12 -4
  429. package/src/slides/ui/TalkList.tsx +8 -10
  430. package/src/structure/core/editorGuide.ts +126 -19
  431. package/src/structure/core/editorToolbar.ts +52 -24
  432. package/src/structure/ui/EditorHelpButton.tsx +9 -4
  433. package/src/structure/ui/StructureEditor.tsx +7 -1
  434. package/src/structure/ui/StructureEditorHelp.tsx +34 -11
  435. package/src/structure/ui/ToolbarTooltip.tsx +8 -4
  436. package/src/ui.ts +1 -0
@@ -9,7 +9,8 @@ export type DeployProblemKind =
9
9
  | 'floating-sidecar'
10
10
  | 'missing-healthcheck'
11
11
  | 'missing-env-example'
12
- | 'missing-deploy-ignore';
12
+ | 'missing-deploy-ignore'
13
+ | 'cacheable-page';
13
14
 
14
15
  /** One way a repository would fail, or silently mis-deploy, on the server. */
15
16
  export interface DeployProblem {
@@ -3,6 +3,7 @@ import { PopoverNext } from '@blueprintjs/core';
3
3
  import type { ReactElement } from 'react';
4
4
  import { useState } from 'react';
5
5
 
6
+ import { useChromeT } from '../../i18n/ui/useT.ts';
6
7
  import { OverlayIconButton } from '../../overlay/ui/OverlayIconButton.tsx';
7
8
  import type { FigureFormat } from '../core/downloadFigure.ts';
8
9
  import { downloadFigure } from '../core/downloadFigure.ts';
@@ -50,12 +51,12 @@ export interface FigureDownloadProps {
50
51
  background?: string;
51
52
  /**
52
53
  * What the glyph is called, for the pointer and for a screen reader.
53
- * @default 'Save this figure'
54
+ * @default the chrome's own line, in the language of the page
54
55
  */
55
56
  label?: string;
56
57
  /**
57
58
  * What the panel behind it is called.
58
- * @default 'Save figure'
59
+ * @default the chrome's own line, in the language of the page
59
60
  */
60
61
  title?: string;
61
62
  /**
@@ -92,9 +93,10 @@ export interface FigureDownloadProps {
92
93
  export function FigureDownload(props: FigureDownloadProps): ReactElement {
93
94
  const { targetId, fileName, background, scales = FIGURE_SCALES } = props;
94
95
  const { defaultFormat = 'png', defaultScale = DEFAULT_FIGURE_SCALE } = props;
95
- const { label = 'Save this figure', title = 'Save figure' } = props;
96
+ const { label, title } = props;
96
97
  const { icon = 'download', testId } = props;
97
98
 
99
+ const t = useChromeT();
98
100
  const [open, setOpen] = useState(false);
99
101
  const [format, setFormat] = useState<FigureFormat>(defaultFormat);
100
102
  const [scale, setScale] = useState(defaultScale);
@@ -132,7 +134,7 @@ export function FigureDownload(props: FigureDownloadProps): ReactElement {
132
134
  onInteraction={interact}
133
135
  content={
134
136
  <FigureDownloadPanel
135
- title={title}
137
+ title={title ?? t('download.saveFigure')}
136
138
  format={format}
137
139
  scale={scale}
138
140
  scales={scales}
@@ -147,7 +149,7 @@ export function FigureDownload(props: FigureDownloadProps): ReactElement {
147
149
  >
148
150
  <OverlayIconButton
149
151
  icon={icon}
150
- label={label}
152
+ label={label ?? t('download.saveThisFigure')}
151
153
  value={format.toUpperCase()}
152
154
  active={open}
153
155
  testId={testId}
@@ -1,6 +1,8 @@
1
1
  import type { ReactElement } from 'react';
2
2
 
3
- import type { HelpContent } from '../../help/ui/HelpBody.tsx';
3
+ import type { ChromeKey } from '../../i18n/core/chromeCatalog.ts';
4
+ import type { Translate } from '../../i18n/ui/useT.ts';
5
+ import { useChromeT } from '../../i18n/ui/useT.ts';
4
6
  import { OverlayAction } from '../../overlay/ui/OverlayAction.tsx';
5
7
  import { OverlayPanel } from '../../overlay/ui/OverlayPanel.tsx';
6
8
  import type { OverlayOption } from '../../overlay/ui/OverlayRow.tsx';
@@ -66,16 +68,17 @@ export function FigureDownloadPanel(
66
68
  ): ReactElement {
67
69
  const { title, format, scale, scales, size, failure, saving } = props;
68
70
  const { onFormatChange, onScaleChange, onSave, rasterSvg = false } = props;
71
+ const t = useChromeT();
69
72
 
70
73
  const vector = format === 'svg' && !rasterSvg;
71
74
 
72
75
  return (
73
76
  <OverlayPanel
74
77
  title={title}
75
- hint={hintOf(format, size, scale, failure, rasterSvg)}
78
+ hint={hintOf(format, size, scale, failure, rasterSvg, t)}
76
79
  actions={
77
80
  <OverlayAction
78
- text="Save"
81
+ text={t('download.save')}
79
82
  icon="download"
80
83
  intent="primary"
81
84
  disabled={saving || size === null}
@@ -84,15 +87,25 @@ export function FigureDownloadPanel(
84
87
  }
85
88
  >
86
89
  <OverlaySegmented<FigureFormat>
87
- label="Format"
88
- help={FORMAT_HELP}
90
+ label={t('download.format')}
91
+ help={{
92
+ title: t('download.format'),
93
+ body: t('download.formatHelp'),
94
+ }}
89
95
  value={format}
90
96
  options={FORMAT_CHOICES}
91
97
  onChange={onFormatChange}
92
98
  />
93
99
  <OverlaySegmented
94
- label="Resolution"
95
- help={RESOLUTION_HELP}
100
+ label={t('download.resolution')}
101
+ help={{
102
+ title: t('download.resolution'),
103
+ body: t('download.resolutionHelp'),
104
+ example: {
105
+ code: '2×',
106
+ note: t('download.resolutionExample'),
107
+ },
108
+ }}
96
109
  value={String(scale)}
97
110
  options={scaleChoices(scales, size)}
98
111
  disabled={vector}
@@ -108,20 +121,6 @@ const FORMAT_CHOICES: ReadonlyArray<OverlayOption<FigureFormat>> = [
108
121
  { value: 'svg', label: 'SVG' },
109
122
  ];
110
123
 
111
- const FORMAT_HELP: HelpContent = {
112
- title: 'Format',
113
- body: 'A PNG is a picture of the figure, which is what a slide, a chat window or an issue accepts. An SVG is the figure itself: every line stays sharp however far it is enlarged, and it can still be edited afterwards.',
114
- };
115
-
116
- const RESOLUTION_HELP: HelpContent = {
117
- title: 'Resolution',
118
- body: 'How many pixels are painted for each pixel of the figure on screen. Two is right for a slide, three or four for print. An SVG carries no resolution of its own, so it is saved sharp at every size.',
119
- example: {
120
- code: '2×',
121
- note: 'A figure 640 pixels wide on screen is saved 1280 pixels wide.',
122
- },
123
- };
124
-
125
124
  /**
126
125
  * The multiples offered, each saying what it would actually produce.
127
126
  *
@@ -155,6 +154,8 @@ function scaleChoices(
155
154
  * @param scale - The multiple it is painted at.
156
155
  * @param failure - What went wrong last time, if anything.
157
156
  * @param rasterSvg - Whether the SVG embeds a rendered picture.
157
+ * @param t - The chrome's formatter, so the sentence is in the language of
158
+ * the page.
158
159
  * @returns The sentence.
159
160
  */
160
161
  function hintOf(
@@ -163,14 +164,19 @@ function hintOf(
163
164
  scale: number,
164
165
  failure: string | null,
165
166
  rasterSvg: boolean,
167
+ t: Translate<ChromeKey>,
166
168
  ): string {
167
169
  if (failure !== null) return failure;
168
- if (size === null) return 'There is no figure on the page to save yet.';
170
+ if (size === null) return t('download.noFigure');
169
171
  if (format === 'svg' && rasterSvg) {
170
- return `An SVG holding a picture of ${formatFigurePixels(figurePixels(size, scale))}: a 3D scene has no vector form.`;
172
+ return t('download.hintRasterSvg', {
173
+ pixels: formatFigurePixels(figurePixels(size, scale)),
174
+ });
171
175
  }
172
176
  if (format === 'svg') {
173
- return `An SVG stays sharp at any size, so the resolution does not apply. Drawn ${formatFigurePixels(size)}.`;
177
+ return t('download.hintSvg', { pixels: formatFigurePixels(size) });
174
178
  }
175
- return `Saved ${formatFigurePixels(figurePixels(size, scale))}.`;
179
+ return t('download.hintPng', {
180
+ pixels: formatFigurePixels(figurePixels(size, scale)),
181
+ });
176
182
  }
@@ -1,5 +1,6 @@
1
1
  import type { ReactElement } from 'react';
2
2
 
3
+ import { useChromeT } from '../../i18n/ui/useT.ts';
3
4
  import type { HeaderButtonProps } from '../../shared/ui/MenuButton.tsx';
4
5
  import { MenuButton } from '../../shared/ui/MenuButton.tsx';
5
6
  import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
@@ -17,7 +18,7 @@ export interface EcosystemButtonProps extends HeaderButtonProps {
17
18
  /**
18
19
  * Text of the button. In a compact bar it is not written, but it stays what
19
20
  * the pointer and a screen reader are told.
20
- * @default 'Tools'
21
+ * @default the chrome's own word for it, in the language of the page
21
22
  */
22
23
  label?: string;
23
24
  /**
@@ -34,14 +35,15 @@ export interface EcosystemButtonProps extends HeaderButtonProps {
34
35
  * @returns The button and its menu.
35
36
  */
36
37
  export function EcosystemButton(props: EcosystemButtonProps): ReactElement {
37
- const { currentSiteId, label = 'Tools', className, ...rest } = props;
38
+ const { currentSiteId, label, className, ...rest } = props;
39
+ const t = useChromeT();
38
40
 
39
41
  return (
40
42
  <MenuButton
41
43
  {...rest}
42
44
  className={joinClassNames('ecosystem-button', className)}
43
45
  icon="grid-view"
44
- label={label}
46
+ label={label ?? t('ecosystem.tools')}
45
47
  menu={<EcosystemMenu currentSiteId={currentSiteId} />}
46
48
  />
47
49
  );
@@ -1,5 +1,6 @@
1
1
  import type { CSSProperties, ReactElement } from 'react';
2
2
 
3
+ import { useChromeT } from '../../i18n/ui/useT.ts';
3
4
  import { useSiteLanguage } from '../../language/ui/siteLanguageContext.ts';
4
5
  import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
5
6
  import { TOKEN } from '../../tokens/core/familyTokens.ts';
@@ -60,7 +61,7 @@ export interface EcosystemLinksProps {
60
61
  currentSiteId?: SiteId;
61
62
  /**
62
63
  * What introduces the section.
63
- * @default 'Our other tools'
64
+ * @default the chrome's own line, in the language of the page
64
65
  */
65
66
  heading?: string;
66
67
  /**
@@ -89,27 +90,26 @@ export interface EcosystemLinksProps {
89
90
  */
90
91
  export function EcosystemLinks(props: EcosystemLinksProps): ReactElement {
91
92
  const language = useSiteLanguage();
92
- const {
93
- className,
94
- currentSiteId,
95
- heading = 'Our other tools',
96
- layout = 'grid',
97
- } = props;
93
+ const { className, currentSiteId, heading, layout = 'grid' } = props;
94
+ const t = useChromeT();
95
+ const title = heading ?? t('ecosystem.otherTools');
98
96
 
99
97
  return (
100
98
  <nav
101
99
  className={joinClassNames('ecosystem-links', className)}
102
100
  style={SECTION_STYLE}
103
- aria-label={heading}
101
+ aria-label={title}
104
102
  >
105
- <h2 style={ECOSYSTEM_HEADING_STYLE}>{heading}</h2>
103
+ <h2 style={ECOSYSTEM_HEADING_STYLE}>{title}</h2>
106
104
  {layout === 'grid' ? (
107
105
  <SiteGroupGrid currentSiteId={currentSiteId} />
108
106
  ) : (
109
107
  <div style={ROWS_STYLE}>
110
108
  {groupedSites().map(({ group, sites }) => (
111
109
  <div key={group.id} style={ROW_STYLE}>
112
- <span style={ROW_LABEL_STYLE}>{group.label}</span>
110
+ <span style={ROW_LABEL_STYLE}>
111
+ {t.or(`ecosystem.group.${group.id}.label`, group.label)}
112
+ </span>
113
113
  {sites.map((site) =>
114
114
  site.id === currentSiteId ? (
115
115
  <span key={site.id} style={CURRENT_STYLE}>
@@ -1,5 +1,6 @@
1
1
  import type { CSSProperties, ReactElement } from 'react';
2
2
 
3
+ import { useChromeT } from '../../i18n/ui/useT.ts';
3
4
  import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
4
5
  import type { SiteId } from '../core/sites.ts';
5
6
 
@@ -44,13 +45,14 @@ export interface EcosystemMenuProps {
44
45
  */
45
46
  export function EcosystemMenu(props: EcosystemMenuProps): ReactElement {
46
47
  const { className, currentSiteId } = props;
48
+ const t = useChromeT();
47
49
 
48
50
  return (
49
51
  <div
50
52
  className={joinClassNames('ecosystem-menu', className)}
51
53
  style={PANEL_STYLE}
52
54
  >
53
- <div style={ECOSYSTEM_HEADING_STYLE}>Our tools, all in the browser</div>
55
+ <div style={ECOSYSTEM_HEADING_STYLE}>{t('ecosystem.menuHeading')}</div>
54
56
  <SiteGroupGrid currentSiteId={currentSiteId} lit newTab />
55
57
  </div>
56
58
  );
@@ -1,6 +1,7 @@
1
1
  import type { CSSProperties, ReactElement, ReactNode } from 'react';
2
2
  import { useId } from 'react';
3
3
 
4
+ import { useChromeT } from '../../i18n/ui/useT.ts';
4
5
  import { TOKEN } from '../../tokens/core/familyTokens.ts';
5
6
  import type { SiteGroup } from '../core/groups.ts';
6
7
 
@@ -50,14 +51,17 @@ interface SiteGroupSectionProps {
50
51
  */
51
52
  export function SiteGroupSection(props: SiteGroupSectionProps): ReactElement {
52
53
  const { group, children } = props;
54
+ const t = useChromeT();
53
55
  const headingId = `${useId()}ecosystem-${group.id}`;
54
56
 
55
57
  return (
56
58
  <section style={SECTION_STYLE} aria-labelledby={headingId}>
57
59
  <h3 id={headingId} style={LABEL_STYLE}>
58
- {group.label}
60
+ {t.or(`ecosystem.group.${group.id}.label`, group.label)}
59
61
  </h3>
60
- <p style={BLURB_STYLE}>{group.blurb}</p>
62
+ <p style={BLURB_STYLE}>
63
+ {t.or(`ecosystem.group.${group.id}.blurb`, group.blurb)}
64
+ </p>
61
65
  <div style={BODY_STYLE}>{children}</div>
62
66
  </section>
63
67
  );
@@ -1,5 +1,6 @@
1
1
  import type { CSSProperties, ReactElement } from 'react';
2
2
 
3
+ import { useChromeT } from '../../i18n/ui/useT.ts';
3
4
  import { useSiteLanguage } from '../../language/ui/siteLanguageContext.ts';
4
5
  import { TOKEN } from '../../tokens/core/familyTokens.ts';
5
6
  import { siteNameColors } from '../core/nameColors.ts';
@@ -95,6 +96,7 @@ export function SiteTile(props: SiteTileProps): ReactElement {
95
96
  onHover,
96
97
  newTab = false,
97
98
  } = props;
99
+ const t = useChromeT();
98
100
  const lit = isHovered && !isCurrent;
99
101
  const colors = siteNameColors(site);
100
102
 
@@ -119,11 +121,13 @@ export function SiteTile(props: SiteTileProps): ReactElement {
119
121
  </span>
120
122
  {isCurrent ? (
121
123
  <span style={{ ...HERE_STYLE, color: site.brandAlt }}>
122
- you are here
124
+ {t('ecosystem.youAreHere')}
123
125
  </span>
124
126
  ) : null}
125
127
  </div>
126
- <div style={TAGLINE_STYLE}>{site.tagline}</div>
128
+ <div style={TAGLINE_STYLE}>
129
+ {t.or(`site.${site.id}.tagline`, site.tagline)}
130
+ </div>
127
131
  </div>
128
132
  </>
129
133
  );
@@ -1,6 +1,8 @@
1
1
  import { Button, NonIdealState } from '@blueprintjs/core';
2
2
  import type { ReactElement } from 'react';
3
3
 
4
+ import { useChromeT } from '../../i18n/ui/useT.ts';
5
+
4
6
  /** What the page shows in place of the part that failed. */
5
7
  export interface ErrorFallbackProps {
6
8
  /** What was thrown, whose message is what the visitor is told. */
@@ -13,12 +15,12 @@ export interface ErrorFallbackProps {
13
15
  onRetry?: () => void;
14
16
  /**
15
17
  * First line, above the message.
16
- * @default 'Something went wrong'
18
+ * @default the chrome's own line, in the language of the page
17
19
  */
18
20
  title?: string;
19
21
  /**
20
22
  * Text of the retry button.
21
- * @default 'Try again'
23
+ * @default the chrome's own words for it, in the language of the page
22
24
  */
23
25
  retryLabel?: string;
24
26
  /**
@@ -38,27 +40,26 @@ export interface ErrorFallbackProps {
38
40
  * @returns The non-ideal state.
39
41
  */
40
42
  export function ErrorFallback(props: ErrorFallbackProps): ReactElement {
41
- const {
42
- error,
43
- onRetry,
44
- title = 'Something went wrong',
45
- retryLabel = 'Try again',
46
- className,
47
- } = props;
43
+ const { error, onRetry, title, retryLabel, className } = props;
44
+ const t = useChromeT();
48
45
 
49
46
  return (
50
47
  <NonIdealState
51
48
  className={className}
52
49
  icon="error"
53
- title={title}
50
+ title={title ?? t('error.title')}
54
51
  description={
55
52
  <span className="error-fallback__message">
56
- {error.message === '' ? 'No message was given.' : error.message}
53
+ {error.message === '' ? t('error.noMessage') : error.message}
57
54
  </span>
58
55
  }
59
56
  action={
60
57
  onRetry === undefined ? undefined : (
61
- <Button icon="refresh" text={retryLabel} onClick={onRetry} />
58
+ <Button
59
+ icon="refresh"
60
+ text={retryLabel ?? t('error.tryAgain')}
61
+ onClick={onRetry}
62
+ />
62
63
  )
63
64
  }
64
65
  />
@@ -1,5 +1,6 @@
1
1
  import type { CSSProperties, ReactElement, ReactNode } from 'react';
2
2
 
3
+ import { useChromeT } from '../../i18n/ui/useT.ts';
3
4
  import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
4
5
 
5
6
  /** A worked example under a piece of help: the construct, and what it does. */
@@ -72,6 +73,7 @@ export interface HelpBodyProps {
72
73
  */
73
74
  export function HelpBody(props: HelpBodyProps): ReactElement {
74
75
  const { className, content, width = DEFAULT_WIDTH } = props;
76
+ const t = useChromeT();
75
77
  const { title, body, example, link } = content;
76
78
 
77
79
  return (
@@ -86,7 +88,7 @@ export function HelpBody(props: HelpBodyProps): ReactElement {
86
88
  <code style={CODE_STYLE}>{item.code}</code>
87
89
  {item.input === undefined ? null : (
88
90
  <div style={INPUT_STYLE}>
89
- on <code style={CODE_STYLE}>{item.input}</code>
91
+ {t('help.on')} <code style={CODE_STYLE}>{item.input}</code>
90
92
  </div>
91
93
  )}
92
94
  {item.note === undefined ? null : (
@@ -101,7 +103,7 @@ export function HelpBody(props: HelpBodyProps): ReactElement {
101
103
  rel="noopener noreferrer"
102
104
  style={LINK_STYLE}
103
105
  >
104
- Learn more
106
+ {t('help.learnMore')}
105
107
  </a>
106
108
  )}
107
109
  </div>
@@ -2,6 +2,7 @@ import type { IconName } from '@blueprintjs/core';
2
2
  import { Icon } from '@blueprintjs/core';
3
3
  import type { ReactElement } from 'react';
4
4
 
5
+ import { useChromeT } from '../../i18n/ui/useT.ts';
5
6
  import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
6
7
 
7
8
  import type { HelpContent } from './HelpBody.tsx';
@@ -17,7 +18,8 @@ export interface HelpIconProps {
17
18
  content: HelpContent;
18
19
  /**
19
20
  * What a screen reader calls the glyph.
20
- * @default the help's title, or `'Help'` when it has none
21
+ * @default the help's title, or the chrome's own word for help when it has
22
+ * none
21
23
  */
22
24
  label?: string;
23
25
  /**
@@ -54,12 +56,13 @@ export interface HelpIconProps {
54
56
  export function HelpIcon(props: HelpIconProps): ReactElement {
55
57
  const {
56
58
  content,
57
- label = helpName(content),
59
+ label,
58
60
  icon = 'help',
59
61
  size = 13,
60
62
  placement = 'right',
61
63
  className,
62
64
  } = props;
65
+ const t = useChromeT();
63
66
 
64
67
  return (
65
68
  <HelpTooltip content={content} placement={placement}>
@@ -67,7 +70,7 @@ export function HelpIcon(props: HelpIconProps): ReactElement {
67
70
  icon={icon}
68
71
  size={size}
69
72
  tabIndex={0}
70
- aria-label={label}
73
+ aria-label={label ?? helpName(content, t)}
71
74
  className={joinClassNames('help-icon', className)}
72
75
  />
73
76
  </HelpTooltip>
@@ -2,6 +2,8 @@ import type { IconName } from '@blueprintjs/core';
2
2
  import { Button } from '@blueprintjs/core';
3
3
  import type { ReactElement } from 'react';
4
4
 
5
+ import { useChromeT } from '../../i18n/ui/useT.ts';
6
+
5
7
  import type { HelpContent } from './HelpBody.tsx';
6
8
  import { HelpTooltip } from './HelpTooltip.tsx';
7
9
  import { helpName } from './helpName.ts';
@@ -56,6 +58,7 @@ export function HelpToolbarButton(props: HelpToolbarButtonProps): ReactElement {
56
58
  small = false,
57
59
  className,
58
60
  } = props;
61
+ const t = useChromeT();
59
62
 
60
63
  return (
61
64
  <HelpTooltip content={content} placement="bottom">
@@ -64,7 +67,7 @@ export function HelpToolbarButton(props: HelpToolbarButtonProps): ReactElement {
64
67
  size={small ? 'small' : 'medium'}
65
68
  icon={icon}
66
69
  text={label}
67
- aria-label={label ?? helpName(content)}
70
+ aria-label={label ?? helpName(content, t)}
68
71
  className={className}
69
72
  onClick={onClick}
70
73
  />
@@ -1,11 +1,19 @@
1
+ import type { ChromeKey } from '../../i18n/core/chromeCatalog.ts';
2
+ import type { Translate } from '../../i18n/ui/useT.ts';
3
+
1
4
  import type { HelpContent } from './HelpBody.tsx';
2
5
 
3
6
  /**
4
7
  * The name a glyph or a button carries for a screen reader: the help's own
5
8
  * title, or a plain "Help" when the help has none.
6
9
  * @param content - The help being named.
10
+ * @param t - The chrome's formatter, so the plain name is in the language of
11
+ * the page.
7
12
  * @returns The accessible name.
8
13
  */
9
- export function helpName(content: HelpContent): string {
10
- return content.title ?? 'Help';
14
+ export function helpName(
15
+ content: HelpContent,
16
+ t: Translate<ChromeKey>,
17
+ ): string {
18
+ return content.title ?? t('help.label');
11
19
  }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The text this library puts on the page.
3
+ *
4
+ * Every site of the family shows the same header, footer, Tools menu, Cite
5
+ * menu, share dialog and About page, so those words are translated once here
6
+ * rather than re-typed into eighteen catalogs of their own: one merged pull
7
+ * request writes every site in a new language.
8
+ */
9
+
10
+ import en from '../../locales/en.json' with { type: 'json' };
11
+
12
+ import { MessageCatalog } from './messageCatalog.ts';
13
+
14
+ /** The name the page knows the chrome's own catalog by. */
15
+ export const CHROME_CATALOG_ID = 'react-cheminfo';
16
+
17
+ /** Every key the chrome declares. */
18
+ export type ChromeKey = keyof typeof en;
19
+
20
+ /**
21
+ * The chrome's messages. English is part of the page because it is what a
22
+ * missing message falls back to; the other three arrive as a chunk of their
23
+ * own, so a site read only in English downloads none of them.
24
+ */
25
+ export const CHROME_CATALOG = new MessageCatalog<ChromeKey>({
26
+ id: CHROME_CATALOG_ID,
27
+ repository: 'cheminfo/react-cheminfo',
28
+ directory: 'src/locales',
29
+ source: en,
30
+ translations: {
31
+ fr: () => import('../../locales/fr.json', { with: { type: 'json' } }),
32
+ de: () => import('../../locales/de.json', { with: { type: 'json' } }),
33
+ es: () => import('../../locales/es.json', { with: { type: 'json' } }),
34
+ },
35
+ });
@@ -0,0 +1,26 @@
1
+ export type { ChromeKey } from './chromeCatalog.ts';
2
+ export { CHROME_CATALOG, CHROME_CATALOG_ID } from './chromeCatalog.ts';
3
+ export type { Language } from './languages.ts';
4
+ export {
5
+ DEFAULT_LANGUAGE,
6
+ LANGUAGES,
7
+ LANGUAGE_LABELS,
8
+ isLanguage,
9
+ } from './languages.ts';
10
+ export type {
11
+ LooseKey,
12
+ MessageCatalogOptions,
13
+ MessagesLoader,
14
+ TranslateOptions,
15
+ } from './messageCatalog.ts';
16
+ export { MessageCatalog } from './messageCatalog.ts';
17
+ export type { MessageValues } from './messageValues.ts';
18
+ export type { MessageSession } from './session.ts';
19
+ export {
20
+ messageSession,
21
+ messagesVersion,
22
+ setMessageSession,
23
+ subscribeToMessages,
24
+ } from './session.ts';
25
+ export type { LoadedCatalogs } from './translateSetup.ts';
26
+ export { loadCatalogs } from './translateSetup.ts';
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The languages the family speaks.
3
+ *
4
+ * Four, decided together rather than site by site: a visitor who switches to
5
+ * German on one tool and follows a link to the next must land in German there
6
+ * too, and a list that differs between two sites makes that impossible.
7
+ */
8
+
9
+ /** Every language a site of the family is written in. */
10
+ export const LANGUAGES = ['en', 'fr', 'de', 'es'] as const;
11
+
12
+ /** One of {@link LANGUAGES}. */
13
+ export type Language = (typeof LANGUAGES)[number];
14
+
15
+ /**
16
+ * The language the catalogs are written in first, and the one every site opens
17
+ * in: an address naming it carries nothing, and a message a translation does
18
+ * not hold falls back to it.
19
+ */
20
+ export const DEFAULT_LANGUAGE: Language = 'en';
21
+
22
+ /**
23
+ * What a language switch writes behind each entry.
24
+ *
25
+ * A language names itself, in its own words: `Deutsch`, never `German`. A
26
+ * reader looking for their own language recognises it written their way, and
27
+ * would have to know English to find it written the other.
28
+ */
29
+ export const LANGUAGE_LABELS: Record<Language, string> = {
30
+ en: 'English',
31
+ fr: 'Français',
32
+ de: 'Deutsch',
33
+ es: 'Español',
34
+ };
35
+
36
+ /**
37
+ * Whether a string is one of the languages the family speaks.
38
+ * @param value - Candidate tag, typically read off an address.
39
+ * @returns True when a catalog can be written in it.
40
+ */
41
+ export function isLanguage(value: string): value is Language {
42
+ for (const language of LANGUAGES) {
43
+ if (language === value) return true;
44
+ }
45
+ return false;
46
+ }