react-cheminfo 0.34.0 → 0.36.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 (225) hide show
  1. package/README.md +28 -28
  2. package/bin/check-seo.mjs +333 -0
  3. package/lib/about/core/about.d.ts +1 -30
  4. package/lib/about/core/about.d.ts.map +1 -1
  5. package/lib/about/core/about.js +0 -16
  6. package/lib/about/core/about.js.map +1 -1
  7. package/lib/about/core/index.d.ts +0 -1
  8. package/lib/about/core/index.d.ts.map +1 -1
  9. package/lib/about/core/index.js +0 -1
  10. package/lib/about/core/index.js.map +1 -1
  11. package/lib/about/ui/AboutBuild.d.ts +2 -5
  12. package/lib/about/ui/AboutBuild.d.ts.map +1 -1
  13. package/lib/about/ui/AboutBuild.js +7 -19
  14. package/lib/about/ui/AboutBuild.js.map +1 -1
  15. package/lib/about/ui/AboutPage.d.ts +2 -2
  16. package/lib/about/ui/AboutPage.d.ts.map +1 -1
  17. package/lib/about/ui/AboutPage.js +3 -14
  18. package/lib/about/ui/AboutPage.js.map +1 -1
  19. package/lib/about/ui/AboutVersion.d.ts +0 -4
  20. package/lib/about/ui/AboutVersion.d.ts.map +1 -1
  21. package/lib/about/ui/AboutVersion.js +3 -31
  22. package/lib/about/ui/AboutVersion.js.map +1 -1
  23. package/lib/download/core/index.d.ts +0 -5
  24. package/lib/download/core/index.d.ts.map +1 -1
  25. package/lib/download/core/index.js +0 -3
  26. package/lib/download/core/index.js.map +1 -1
  27. package/lib/download/ui/FigureDownload.d.ts +4 -55
  28. package/lib/download/ui/FigureDownload.d.ts.map +1 -1
  29. package/lib/download/ui/FigureDownload.js +6 -66
  30. package/lib/download/ui/FigureDownload.js.map +1 -1
  31. package/lib/download/ui/FigureDownloadPanel.d.ts +16 -2
  32. package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
  33. package/lib/download/ui/FigureDownloadPanel.js +11 -30
  34. package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
  35. package/lib/download/ui/figureDownloadHint.d.ts +30 -0
  36. package/lib/download/ui/figureDownloadHint.d.ts.map +1 -0
  37. package/lib/download/ui/figureDownloadHint.js +33 -0
  38. package/lib/download/ui/figureDownloadHint.js.map +1 -0
  39. package/lib/download/ui/index.d.ts +3 -10
  40. package/lib/download/ui/index.d.ts.map +1 -1
  41. package/lib/download/ui/index.js +1 -5
  42. package/lib/download/ui/index.js.map +1 -1
  43. package/lib/download/ui/useFigureActions.d.ts +50 -0
  44. package/lib/download/ui/useFigureActions.d.ts.map +1 -0
  45. package/lib/download/ui/useFigureActions.js +58 -0
  46. package/lib/download/ui/useFigureActions.js.map +1 -0
  47. package/lib/download/ui/useFigureDownload.d.ts +85 -0
  48. package/lib/download/ui/useFigureDownload.d.ts.map +1 -0
  49. package/lib/download/ui/useFigureDownload.js +75 -0
  50. package/lib/download/ui/useFigureDownload.js.map +1 -0
  51. package/lib/ecosystem/core/sites.d.ts.map +1 -1
  52. package/lib/ecosystem/core/sites.js +0 -40
  53. package/lib/ecosystem/core/sites.js.map +1 -1
  54. package/lib/ecosystem/core/types.d.ts +0 -10
  55. package/lib/ecosystem/core/types.d.ts.map +1 -1
  56. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  57. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  58. package/lib/ir/core/irCommands.d.ts +2 -2
  59. package/lib/ir/core/irCommands.js +2 -2
  60. package/lib/ir/core/irCommands.js.map +1 -1
  61. package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -1
  62. package/lib/ir/ui/IrAboutDialog.js +1 -1
  63. package/lib/ir/ui/IrAboutDialog.js.map +1 -1
  64. package/lib/ir/ui/IrCanvas.d.ts +6 -0
  65. package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
  66. package/lib/ir/ui/IrCanvas.js +2 -2
  67. package/lib/ir/ui/IrCanvas.js.map +1 -1
  68. package/lib/ir/ui/IrShell.d.ts.map +1 -1
  69. package/lib/ir/ui/IrShell.js +16 -11
  70. package/lib/ir/ui/IrShell.js.map +1 -1
  71. package/lib/ir/ui/IrToolbar.d.ts +11 -1
  72. package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
  73. package/lib/ir/ui/IrToolbar.js +12 -2
  74. package/lib/ir/ui/IrToolbar.js.map +1 -1
  75. package/lib/ir/ui/index.d.ts +1 -0
  76. package/lib/ir/ui/index.d.ts.map +1 -1
  77. package/lib/ir/ui/index.js.map +1 -1
  78. package/lib/language/core/index.d.ts +2 -0
  79. package/lib/language/core/index.d.ts.map +1 -1
  80. package/lib/language/core/index.js +1 -0
  81. package/lib/language/core/index.js.map +1 -1
  82. package/lib/language/core/languagePath.d.ts +52 -0
  83. package/lib/language/core/languagePath.d.ts.map +1 -0
  84. package/lib/language/core/languagePath.js +65 -0
  85. package/lib/language/core/languagePath.js.map +1 -0
  86. package/lib/locales/de.json +2 -4
  87. package/lib/locales/en.json +2 -4
  88. package/lib/locales/es.json +2 -4
  89. package/lib/locales/fr.json +2 -4
  90. package/lib/locales/it.json +2 -4
  91. package/lib/overlay/ui/OverlayPanel.d.ts +6 -0
  92. package/lib/overlay/ui/OverlayPanel.d.ts.map +1 -1
  93. package/lib/overlay/ui/OverlayPanel.js +2 -2
  94. package/lib/overlay/ui/OverlayPanel.js.map +1 -1
  95. package/lib/overlay/ui/overlayPanelStyles.d.ts +2 -1
  96. package/lib/overlay/ui/overlayPanelStyles.d.ts.map +1 -1
  97. package/lib/overlay/ui/overlayPanelStyles.js +3 -1
  98. package/lib/overlay/ui/overlayPanelStyles.js.map +1 -1
  99. package/lib/periodic/ui/ElementCell.d.ts +0 -6
  100. package/lib/periodic/ui/ElementCell.d.ts.map +1 -1
  101. package/lib/periodic/ui/ElementCell.js +34 -30
  102. package/lib/periodic/ui/ElementCell.js.map +1 -1
  103. package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -1
  104. package/lib/periodic/ui/PeriodicTable.js +12 -15
  105. package/lib/periodic/ui/PeriodicTable.js.map +1 -1
  106. package/lib/seo/core/alternates.d.ts +40 -0
  107. package/lib/seo/core/alternates.d.ts.map +1 -0
  108. package/lib/seo/core/alternates.js +42 -0
  109. package/lib/seo/core/alternates.js.map +1 -0
  110. package/lib/seo/core/index.d.ts +3 -0
  111. package/lib/seo/core/index.d.ts.map +1 -1
  112. package/lib/seo/core/index.js +2 -0
  113. package/lib/seo/core/index.js.map +1 -1
  114. package/lib/seo/core/noscript.d.ts +9 -0
  115. package/lib/seo/core/noscript.d.ts.map +1 -1
  116. package/lib/seo/core/noscript.js +7 -2
  117. package/lib/seo/core/noscript.js.map +1 -1
  118. package/lib/seo/core/pageMeta.d.ts +23 -0
  119. package/lib/seo/core/pageMeta.d.ts.map +1 -1
  120. package/lib/seo/core/pageMeta.js +52 -3
  121. package/lib/seo/core/pageMeta.js.map +1 -1
  122. package/lib/seo/core/pageProse.d.ts +76 -0
  123. package/lib/seo/core/pageProse.d.ts.map +1 -0
  124. package/lib/seo/core/pageProse.js +92 -0
  125. package/lib/seo/core/pageProse.js.map +1 -0
  126. package/lib/seo/core/routeProblems.d.ts +33 -0
  127. package/lib/seo/core/routeProblems.d.ts.map +1 -0
  128. package/lib/seo/core/routeProblems.js +89 -0
  129. package/lib/seo/core/routeProblems.js.map +1 -0
  130. package/lib/seo/core/routes.d.ts +14 -0
  131. package/lib/seo/core/routes.d.ts.map +1 -1
  132. package/lib/seo/core/routes.js.map +1 -1
  133. package/lib/seo/core/siteFiles.d.ts.map +1 -1
  134. package/lib/seo/core/siteFiles.js +2 -1
  135. package/lib/seo/core/siteFiles.js.map +1 -1
  136. package/lib/seo/vite/prerender.d.ts +13 -0
  137. package/lib/seo/vite/prerender.d.ts.map +1 -1
  138. package/lib/seo/vite/prerender.js +17 -10
  139. package/lib/seo/vite/prerender.js.map +1 -1
  140. package/package.json +2 -1
  141. package/src/about/core/about.ts +1 -51
  142. package/src/about/core/index.ts +0 -1
  143. package/src/about/ui/AboutBuild.tsx +8 -37
  144. package/src/about/ui/AboutPage.tsx +8 -64
  145. package/src/about/ui/AboutVersion.tsx +5 -45
  146. package/src/download/core/index.ts +0 -25
  147. package/src/download/ui/FigureDownload.tsx +11 -148
  148. package/src/download/ui/FigureDownloadPanel.tsx +46 -45
  149. package/src/download/ui/figureDownloadHint.ts +52 -0
  150. package/src/download/ui/index.ts +6 -10
  151. package/src/download/ui/useFigureActions.ts +113 -0
  152. package/src/download/ui/useFigureDownload.tsx +191 -0
  153. package/src/ecosystem/core/sites.ts +0 -40
  154. package/src/ecosystem/core/types.ts +0 -10
  155. package/src/ir/core/irCommands.ts +2 -2
  156. package/src/ir/ui/IrAboutDialog.tsx +0 -13
  157. package/src/ir/ui/IrCanvas.tsx +8 -2
  158. package/src/ir/ui/IrShell.tsx +23 -25
  159. package/src/ir/ui/IrToolbar.tsx +36 -6
  160. package/src/ir/ui/index.ts +1 -0
  161. package/src/language/core/index.ts +2 -0
  162. package/src/language/core/languagePath.ts +78 -0
  163. package/src/locales/de.json +2 -4
  164. package/src/locales/en.json +2 -4
  165. package/src/locales/es.json +2 -4
  166. package/src/locales/fr.json +2 -4
  167. package/src/locales/it.json +2 -4
  168. package/src/overlay/ui/OverlayPanel.tsx +8 -2
  169. package/src/overlay/ui/overlayPanelStyles.ts +3 -0
  170. package/src/periodic/ui/ElementCell.tsx +34 -37
  171. package/src/periodic/ui/PeriodicTable.tsx +12 -17
  172. package/src/seo/core/alternates.ts +65 -0
  173. package/src/seo/core/index.ts +3 -0
  174. package/src/seo/core/noscript.ts +18 -2
  175. package/src/seo/core/pageMeta.ts +74 -3
  176. package/src/seo/core/pageProse.ts +146 -0
  177. package/src/seo/core/routeProblems.ts +111 -0
  178. package/src/seo/core/routes.ts +14 -0
  179. package/src/seo/core/siteFiles.ts +2 -1
  180. package/src/seo/vite/prerender.ts +30 -11
  181. package/lib/about/core/repository.d.ts +0 -14
  182. package/lib/about/core/repository.d.ts.map +0 -1
  183. package/lib/about/core/repository.js +0 -21
  184. package/lib/about/core/repository.js.map +0 -1
  185. package/lib/download/core/exportStyles.d.ts +0 -22
  186. package/lib/download/core/exportStyles.d.ts.map +0 -1
  187. package/lib/download/core/exportStyles.js +0 -19
  188. package/lib/download/core/exportStyles.js.map +0 -1
  189. package/lib/download/core/imageResolution.d.ts +0 -88
  190. package/lib/download/core/imageResolution.d.ts.map +0 -1
  191. package/lib/download/core/imageResolution.js +0 -77
  192. package/lib/download/core/imageResolution.js.map +0 -1
  193. package/lib/download/core/pictureExport.d.ts +0 -93
  194. package/lib/download/core/pictureExport.d.ts.map +0 -1
  195. package/lib/download/core/pictureExport.js +0 -116
  196. package/lib/download/core/pictureExport.js.map +0 -1
  197. package/lib/download/ui/ExportDialogFrame.d.ts +0 -46
  198. package/lib/download/ui/ExportDialogFrame.d.ts.map +0 -1
  199. package/lib/download/ui/ExportDialogFrame.js +0 -24
  200. package/lib/download/ui/ExportDialogFrame.js.map +0 -1
  201. package/lib/download/ui/ExportImageDialog.d.ts +0 -47
  202. package/lib/download/ui/ExportImageDialog.d.ts.map +0 -1
  203. package/lib/download/ui/ExportImageDialog.js +0 -25
  204. package/lib/download/ui/ExportImageDialog.js.map +0 -1
  205. package/lib/download/ui/ExportNameField.d.ts +0 -29
  206. package/lib/download/ui/ExportNameField.d.ts.map +0 -1
  207. package/lib/download/ui/ExportNameField.js +0 -99
  208. package/lib/download/ui/ExportNameField.js.map +0 -1
  209. package/lib/download/ui/ExportPictureSection.d.ts +0 -38
  210. package/lib/download/ui/ExportPictureSection.d.ts.map +0 -1
  211. package/lib/download/ui/ExportPictureSection.js +0 -48
  212. package/lib/download/ui/ExportPictureSection.js.map +0 -1
  213. package/lib/download/ui/useDrawingBox.d.ts +0 -23
  214. package/lib/download/ui/useDrawingBox.d.ts.map +0 -1
  215. package/lib/download/ui/useDrawingBox.js +0 -21
  216. package/lib/download/ui/useDrawingBox.js.map +0 -1
  217. package/src/about/core/repository.ts +0 -22
  218. package/src/download/core/exportStyles.ts +0 -20
  219. package/src/download/core/imageResolution.ts +0 -118
  220. package/src/download/core/pictureExport.ts +0 -207
  221. package/src/download/ui/ExportDialogFrame.tsx +0 -86
  222. package/src/download/ui/ExportImageDialog.tsx +0 -91
  223. package/src/download/ui/ExportNameField.tsx +0 -148
  224. package/src/download/ui/ExportPictureSection.tsx +0 -142
  225. package/src/download/ui/useDrawingBox.ts +0 -37
@@ -1,43 +1,32 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { formatBuiltAt, shortCommit } from "../../build/core/buildInfo.js";
3
3
  import { useChromeT } from "../../i18n/ui/useT.js";
4
- import { githubSources } from "../core/repository.js";
5
4
  /**
6
5
  * The one line that says when the build a visitor has open was made.
7
6
  *
8
7
  * A report of something going wrong is worth answering only when we know what
9
8
  * was running. The version itself is in the hero, where a reader is asked to
10
- * quote it from; this line carries the rest, and the commit links into the
11
- * repository, so the change that caused a problem is one click from the page
12
- * that shows it.
9
+ * quote it from; this line carries the rest, so a report can name the exact
10
+ * build the problem was seen on.
13
11
  * @param props - See {@link AboutBuildProps}.
14
12
  * @returns The line.
15
13
  */
16
14
  export function AboutBuild(props) {
17
- const { build, repository } = props;
15
+ const { build } = props;
18
16
  const t = useChromeT();
19
- const sources = githubSources(repository);
20
17
  const builtAt = formatBuiltAt(build.builtAt);
21
18
  if (build.commit === undefined) {
22
19
  return _jsx("p", { style: PARAGRAPH_STYLE, children: t('about.built', { builtAt }) });
23
20
  }
24
- // The commit is a link inside a sentence whose word order is the
25
- // translator's, so the message is split where it names it.
21
+ // The commit sits inside a sentence whose word order is the translator's,
22
+ // so the message names where it goes and is split there.
26
23
  const [before = '', after = ''] = t('about.builtFromCommit', {
27
24
  builtAt,
28
25
  }).split('{commit}');
29
- return (_jsxs("p", { style: PARAGRAPH_STYLE, children: [before, _jsx(Reference, { href: sources === undefined
30
- ? undefined
31
- : `${sources}/commit/${build.commit}`, children: shortCommit(build.commit) }), after] }));
32
- }
33
- function Reference(props) {
34
- const { href, children } = props;
35
- if (href === undefined)
36
- return _jsx("code", { style: CODE_STYLE, children: children });
37
- return (_jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer", style: LINK_STYLE, children: _jsx("code", { style: CODE_STYLE, children: children }) }));
26
+ return (_jsxs("p", { style: PARAGRAPH_STYLE, children: [before, _jsx("code", { style: CODE_STYLE, children: shortCommit(build.commit) }), after] }));
38
27
  }
39
28
  const PARAGRAPH_STYLE = {
40
- margin: '8px 0 0',
29
+ margin: 0,
41
30
  color: 'var(--text-muted)',
42
31
  fontSize: 13,
43
32
  };
@@ -45,5 +34,4 @@ const CODE_STYLE = {
45
34
  fontFamily: 'var(--font-mono, ui-monospace, monospace)',
46
35
  fontSize: 13,
47
36
  };
48
- const LINK_STYLE = { color: 'var(--accent)' };
49
37
  //# sourceMappingURL=AboutBuild.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AboutBuild.js","sourceRoot":"","sources":["../../../src/about/ui/AboutBuild.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAStD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,YAAG,KAAK,EAAE,eAAe,YAAG,CAAC,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,GAAK,CAAC;IACxE,CAAC;IAED,iEAAiE;IACjE,2DAA2D;IA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E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAOnD;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,YAAG,KAAK,EAAE,eAAe,YAAG,CAAC,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,GAAK,CAAC;IACxE,CAAC;IAED,0EAA0E;IAC1E,yDAAyD;IACzD,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,uBAAuB,EAAE;QAC3D,OAAO;KACR,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAErB,OAAO,CACL,aAAG,KAAK,EAAE,eAAe,aACtB,MAAM,EACP,eAAM,KAAK,EAAE,UAAU,YAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,GAAQ,EAC1D,KAAK,IACJ,CACL,CAAC;AACJ,CAAC;AAED,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,EAAE;CACoB,CAAC;AAEnC,MAAM,UAAU,GAAG;IACjB,UAAU,EAAE,2CAA2C;IACvD,QAAQ,EAAE,EAAE;CACoB,CAAC"}
@@ -33,8 +33,8 @@ export interface AboutPageProps {
33
33
  }
34
34
  /**
35
35
  * The About page of a site of the family: what the tool is, who provides it,
36
- * what a visitor can do with it, what it is built on, how to cite it, and where
37
- * to report a problem — always in that order.
36
+ * what a visitor can do with it, what it is built on, and how to cite it —
37
+ * always in that order.
38
38
  *
39
39
  * The order is the point. A reader who has read one of our About pages knows
40
40
  * where the credits are on the other thirteen, and a site that writes its own
@@ -1 +1 @@
1
- {"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,OAAO,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAmH7D"}
1
+ {"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,OAAO,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAkF7D"}
@@ -11,8 +11,8 @@ import { AboutSection } from "./AboutSection.js";
11
11
  import { AboutVersion } from "./AboutVersion.js";
12
12
  /**
13
13
  * The About page of a site of the family: what the tool is, who provides it,
14
- * what a visitor can do with it, what it is built on, how to cite it, and where
15
- * to report a problem — always in that order.
14
+ * what a visitor can do with it, what it is built on, and how to cite it —
15
+ * always in that order.
16
16
  *
17
17
  * The order is the point. A reader who has read one of our About pages knows
18
18
  * where the credits are on the other thirteen, and a site that writes its own
@@ -28,17 +28,7 @@ export function AboutPage(props) {
28
28
  const site = about.site;
29
29
  return (_jsxs("div", { className: className === undefined ? 'about-page' : `about-page ${className}`, style: PAGE_STYLE, children: [_jsxs("header", { className: "about-hero", style: HERO_STYLE, children: [logo === undefined
30
30
  ? (mark ?? _jsx(SiteMark, { site: site, size: 56 }))
31
- : null, _jsxs("div", { style: HERO_BODY_STYLE, children: [_jsx("h1", { style: logo === undefined ? NAME_STYLE : LOGO_NAME_STYLE, children: logo ?? _jsx(Wordmark, { site: site, size: 26 }) }), _jsx("p", { style: TAGLINE_STYLE, children: t.or(`site.${site.id}.tagline`, site.tagline) }), _jsx("p", { style: WHAT_STYLE, children: about.what })] }), _jsx(AboutVersion, { build: about.build, repository: about.repository, publicRepository: about.publicRepository })] }), about.people.length === 0 && about.providedBy.length === 0 ? null : (_jsx(AboutSection, { title: t('about.providedBy'), className: "about-provided-by", children: _jsx(AboutProvidedBy, { people: about.people, providers: about.providedBy }) })), _jsx(AboutSection, { title: t('about.whatYouCanDo'), className: "about-can", children: _jsx("ul", { style: CAN_LIST_STYLE, children: about.can.map((line) => (_jsx("li", { children: line }, line))) }) }), about.paragraphs.length === 0 ? null : (_jsx(AboutSection, { className: "about-context", children: about.paragraphs.map((paragraph, index) => (_jsx("p", { style: index === 0 ? FIRST_PARAGRAPH_STYLE : PARAGRAPH_STYLE, children: paragraph }, paragraph))) })), children, _jsx(AboutSection, { title: t('about.builtOn'), className: "about-credits", children: _jsx(CreditsList, { entries: about.credits }) }), about.cite.length === 0 ? null : (_jsx(AboutSection, { title: t('about.howToCite'), className: "about-cite", children: _jsx(AboutCitations, { works: about.cite }) })), !about.publicRepository ? null : (_jsxs(AboutSection, { title: t('about.licenceAndSource'), className: "about-licence", children: [_jsx("p", { style: FIRST_PARAGRAPH_STYLE, children: around(t('about.licence', { license: about.license }), 'sources', _jsx(ExternalLink, { href: about.repository }, "sources")) }), about.build === undefined ? null : (_jsx(AboutBuild, { build: about.build, repository: about.repository }))] })), about.issues === undefined ? null : (_jsx(AboutSection, { title: t('about.foundAProblem'), className: "about-issues", children: _jsx("p", { style: FIRST_PARAGRAPH_STYLE, children: around(t('about.reportIt'), 'tracker', _jsx(ExternalLink, { href: about.issues }, "tracker")) }) }))] }));
32
- }
33
- // A link sits inside a sentence whose word order is the translator's, so the
34
- // message names where it goes with a placeholder and is split there.
35
- function around(message, placeholder, link) {
36
- const [before = '', after = ''] = message.split(`{${placeholder}}`);
37
- return [before, link, after];
38
- }
39
- function ExternalLink(props) {
40
- const { href } = props;
41
- return (_jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer", style: LINK_STYLE, children: href.replace(/^https?:\/\//, '') }));
31
+ : null, _jsxs("div", { style: HERO_BODY_STYLE, children: [_jsx("h1", { style: logo === undefined ? NAME_STYLE : LOGO_NAME_STYLE, children: logo ?? _jsx(Wordmark, { site: site, size: 26 }) }), _jsx("p", { style: TAGLINE_STYLE, children: t.or(`site.${site.id}.tagline`, site.tagline) }), _jsx("p", { style: WHAT_STYLE, children: about.what })] }), _jsx(AboutVersion, { build: about.build })] }), about.people.length === 0 && about.providedBy.length === 0 ? null : (_jsx(AboutSection, { title: t('about.providedBy'), className: "about-provided-by", children: _jsx(AboutProvidedBy, { people: about.people, providers: about.providedBy }) })), _jsx(AboutSection, { title: t('about.whatYouCanDo'), className: "about-can", children: _jsx("ul", { style: CAN_LIST_STYLE, children: about.can.map((line) => (_jsx("li", { children: line }, line))) }) }), about.paragraphs.length === 0 ? null : (_jsx(AboutSection, { className: "about-context", children: about.paragraphs.map((paragraph, index) => (_jsx("p", { style: index === 0 ? FIRST_PARAGRAPH_STYLE : PARAGRAPH_STYLE, children: paragraph }, paragraph))) })), children, _jsx(AboutSection, { title: t('about.builtOn'), className: "about-credits", children: _jsx(CreditsList, { entries: about.credits }) }), about.cite.length === 0 ? null : (_jsx(AboutSection, { title: t('about.howToCite'), className: "about-cite", children: _jsx(AboutCitations, { works: about.cite }) })), about.build === undefined ? null : (_jsx(AboutSection, { className: "about-build", children: _jsx(AboutBuild, { build: about.build }) }))] }));
42
32
  }
43
33
  const PAGE_STYLE = {
44
34
  display: 'flex',
@@ -86,5 +76,4 @@ const FIRST_PARAGRAPH_STYLE = {
86
76
  const PARAGRAPH_STYLE = {
87
77
  margin: '8px 0 0',
88
78
  };
89
- const LINK_STYLE = { color: 'var(--accent)' };
90
79
  //# sourceMappingURL=AboutPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AboutPage.js","sourceRoot":"","sources":["../../../src/about/ui/AboutPage.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAkC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAiC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA8B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAkClD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EAAE,OAAO,EAAE,SAAS,EA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AChB,QAAQ,EAAE,CAAC;CACqB,CAAC;AAEnC,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,yBAAyB;IACjC,YAAY,EAAE,eAAe;IAC7B,UAAU,EAAE,gBAAgB;IAC5B,GAAG,EAAE,EAAE;IACP,UAAU,EAAE,IAAI;CACgB,CAAC;AAEnC,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,GAAG;CACiB,CAAC;AAEnC,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,SAAS;CACe,CAAC;AAEnC,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,WAAW;IACnB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,EAAE;CACoB,CAAC;AAEnC,MAAM,UAAU,GAAG,EAAE,MAAM,EAAE,CAAC,EAAmC,CAAC;AAElE,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,CAAC;IACT,WAAW,EAAE,EAAE;CACiB,CAAC;AAEnC,MAAM,qBAAqB,GAAG;IAC5B,MAAM,EAAE,CAAC;CACuB,CAAC;AAEnC,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,SAAS;CACe,CAAC"}
@@ -11,10 +11,6 @@ import type { BuildInfo } from '../../build/core/buildInfo.ts';
11
11
  export interface AboutVersionProps {
12
12
  /** What the build published about itself, or `undefined` when it published none. */
13
13
  build: BuildInfo | undefined;
14
- /** Where the sources live, which is what the badge links into. */
15
- repository: string;
16
- /** Whether a visitor can open that repository, and so whether it is linked. */
17
- publicRepository: boolean;
18
14
  }
19
15
  /**
20
16
  * The build badge: the release a site is serving, or the commit it was built
@@ -1 +1 @@
1
- {"version":3,"file":"AboutVersion.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAS/D,MAAM,WAAW,iBAAiB;IAChC,oFAAoF;IACpF,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI,CA6B1E"}
1
+ {"version":3,"file":"AboutVersion.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAO/D,MAAM,WAAW,iBAAiB;IAChC,oFAAoF;IACpF,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI,CAiB1E"}
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { buildLabel, buildStamp, buildSummary, releasedVersion, } from "../../build/core/buildInfo.js";
3
- import { githubSources } from "../core/repository.js";
2
+ import { buildLabel, buildStamp, buildSummary, } from "../../build/core/buildInfo.js";
4
3
  /**
5
4
  * The build badge: the release a site is serving, or the commit it was built
6
5
  * from while it has no release yet, and when it was made.
@@ -8,37 +7,14 @@ import { githubSources } from "../core/repository.js";
8
7
  * @returns The badge, or `null` when the build says nothing worth showing.
9
8
  */
10
9
  export function AboutVersion(props) {
11
- const { build, repository, publicRepository } = props;
10
+ const { build } = props;
12
11
  const label = buildLabel(build);
13
12
  if (build === undefined || label === undefined)
14
13
  return null;
15
- const href = publicRepository ? addressOf(build, repository) : undefined;
16
- const summary = buildSummary(build);
17
14
  // The instant belongs on the badge rather than in its hover: a version
18
15
  // nobody can date says nothing about how old the page they read is.
19
16
  const badge = `${label} · ${buildStamp(build.builtAt)}`;
20
- if (href === undefined) {
21
- return (_jsx("span", { style: BADGE_STYLE, className: "about-version", title: summary, children: badge }));
22
- }
23
- return (_jsx("a", { className: "about-version", href: href, title: summary, target: "_blank", rel: "noopener noreferrer", style: LINK_BADGE_STYLE, children: badge }));
24
- }
25
- /**
26
- * What the badge opens: the release it names, or the commit it was built from.
27
- * @param build - What the build published about itself.
28
- * @param repository - Where the sources live.
29
- * @returns The address, or `undefined` when nothing inside the repository can
30
- * be addressed.
31
- */
32
- function addressOf(build, repository) {
33
- const sources = githubSources(repository);
34
- if (sources === undefined)
35
- return undefined;
36
- const version = releasedVersion(build);
37
- if (version !== undefined)
38
- return `${sources}/releases/tag/v${version}`;
39
- return build.commit === undefined
40
- ? undefined
41
- : `${sources}/commit/${build.commit}`;
17
+ return (_jsx("span", { style: BADGE_STYLE, className: "about-version", title: buildSummary(build), children: badge }));
42
18
  }
43
19
  const BADGE_STYLE = {
44
20
  flex: '0 0 auto',
@@ -47,8 +23,4 @@ const BADGE_STYLE = {
47
23
  color: 'var(--text-muted)',
48
24
  whiteSpace: 'nowrap',
49
25
  };
50
- const LINK_BADGE_STYLE = {
51
- ...BADGE_STYLE,
52
- color: 'var(--accent)',
53
- };
54
26
  //# sourceMappingURL=AboutVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AboutVersion.js","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":";AAYA,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAWtD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;I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,CAAC,SAAS;QACX,CAAC,CAAC,GAAG,OAAO,WAAW,KAAK,CAAC,MAAM,EAAE,CAAC;AAC1C,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,UAAU;IAChB,UAAU,EAAE,2CAA2C;IACvD,QAAQ,EAAE,EAAE;IACZ,KAAK,EAAE,mBAAmB;IAC1B,UAAU,EAAE,QAAQ;CACY,CAAC;AAEnC,MAAM,gBAAgB,GAAG;IACvB,GAAG,WAAW;IACd,KAAK,EAAE,eAAe;CACU,CAAC"}
1
+ {"version":3,"file":"AboutVersion.js","sourceRoot":"","sources":["../../../src/about/ui/AboutVersion.tsx"],"names":[],"mappings":";AAYA,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,+BAA+B,CAAC;AAOvC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5D,uEAAuE;IACvE,oEAAoE;IACpE,MAAM,KAAK,GAAG,GAAG,KAAK,MAAM,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;IAExD,OAAO,CACL,eACE,KAAK,EAAE,WAAW,EAClB,SAAS,EAAC,eAAe,EACzB,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,YAEzB,KAAK,GACD,CACR,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,UAAU;IAChB,UAAU,EAAE,2CAA2C;IACvD,QAAQ,EAAE,EAAE;IACZ,KAAK,EAAE,mBAAmB;IAC1B,UAAU,EAAE,QAAQ;CACY,CAAC"}
@@ -19,11 +19,6 @@ export { figureLegendMarkup } from './figureLegend.ts';
19
19
  export type { FigureBounds } from './figureTarget.ts';
20
20
  export { figureBounds, figureDrawings, figureElement, figureLegends, figureSize, } from './figureTarget.ts';
21
21
  export { sanitizeFileName } from './sanitizeFileName.ts';
22
- export { exportButtonsStyle, exportNoteStyle, exportSectionStyle, } from './exportStyles.ts';
23
- export type { ImageResolution, ImageResolutionId, ImageSize, } from './imageResolution.ts';
24
- export { DEFAULT_IMAGE_RESOLUTION, IMAGE_RESOLUTIONS, formatImageSize, imageResolution, imageSize, } from './imageResolution.ts';
25
- export type { PictureFrame, PictureOptions } from './pictureExport.ts';
26
- export { PICTURE_PADDING, copyPicture, pictureSize, savePngPicture, saveSvgPicture, } from './pictureExport.ts';
27
22
  export { drawingIn, stackDrawings } from './stackedDrawing.ts';
28
23
  export type { SvgBox } from './svgBounds.ts';
29
24
  export { CONTENT_ATTRIBUTE, contentBox, elementBox } from './svgBounds.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/download/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,M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";
12
12
  export { figureBounds, figureDrawings, figureElement, figureLegends, figureSize, } from "./figureTarget.js";
13
13
  export { sanitizeFileName } from "./sanitizeFileName.js";
14
- export { exportButtonsStyle, exportNoteStyle, exportSectionStyle, } from "./exportStyles.js";
15
- export { DEFAULT_IMAGE_RESOLUTION, IMAGE_RESOLUTIONS, formatImageSize, imageResolution, imageSize, } from "./imageResolution.js";
16
- export { PICTURE_PADDING, copyPicture, pictureSize, savePngPicture, saveSvgPicture, } from "./pictureExport.js";
17
14
  export { drawingIn, stackDrawings } from "./stackedDrawing.js";
18
15
  export { CONTENT_ATTRIBUTE, contentBox, elementBox } from "./svgBounds.js";
19
16
  export { SVG_NAMESPACE } from "./svgNamespace.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/download/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK5D,OAAO,EAAE,iBAAiB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,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAO3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,55 +1,13 @@
1
1
  import type { IconName } from '@blueprintjs/core';
2
2
  import type { ReactElement } from 'react';
3
- import type { FigureFormat } from '../core/downloadFigure.ts';
4
- import type { FigureRenderer } from './useFigureRedraw.tsx';
3
+ import type { FigureDownloadOptions } from './useFigureDownload.tsx';
5
4
  /** What {@link FigureDownload} needs. */
6
- export interface FigureDownloadProps {
7
- /**
8
- * The `id` of the box the figure is mounted in. Everything drawn inside it
9
- * is saved — sixteen charts of a pair grid as readily as one scatter plot —
10
- * and the controls floating over it are left behind.
11
- */
12
- targetId: string;
13
- /**
14
- * What the saved file is called, without its extension. Name it after the
15
- * data rather than after the tool: a reader with four of these in a
16
- * downloads folder cannot tell four `figure.png` apart.
17
- * @default 'figure'
18
- */
19
- fileName?: string;
20
- /**
21
- * The format it opens on.
22
- * @default 'png'
23
- */
24
- defaultFormat?: FigureFormat;
25
- /**
26
- * The resolution a PNG opens on, as a multiple of the figure on screen. An
27
- * SVG opens at 1×, the size it has on screen, and each format keeps the
28
- * multiple the reader last picked for it.
29
- * @default 2
30
- */
31
- defaultScale?: number;
32
- /**
33
- * The resolutions offered.
34
- * @default [1, 2, 3, 4]
35
- */
36
- scales?: readonly number[];
37
- /**
38
- * What is painted under the figure. `transparent` leaves it unpainted, for a
39
- * figure going onto a coloured slide.
40
- * @default the surface the figure is drawn on
41
- */
42
- background?: string;
5
+ export interface FigureDownloadProps extends FigureDownloadOptions {
43
6
  /**
44
7
  * What the glyph is called, for the pointer and for a screen reader.
45
8
  * @default the chrome's own line, in the language of the page
46
9
  */
47
10
  label?: string;
48
- /**
49
- * What the panel behind it is called.
50
- * @default the chrome's own line, in the language of the page
51
- */
52
- title?: string;
53
11
  /**
54
12
  * Its glyph.
55
13
  * @default 'download'
@@ -60,19 +18,10 @@ export interface FigureDownloadProps {
60
18
  * @default undefined
61
19
  */
62
20
  testId?: string;
63
- /**
64
- * Draws the figure at a size, for a file. When it is given the panel offers
65
- * a size — as shown, 4:3, 16:9, a journal column, or typed — and a figure
66
- * saved at a size other than its own is drawn again at that size, off the
67
- * page, so its axes and labels are laid out for the new shape rather than
68
- * stretched into it. Draw exactly what is on screen, with the same data,
69
- * zoom and colours; only the box changes.
70
- * @default undefined — the figure is saved at the size it has on screen
71
- */
72
- renderFigure?: FigureRenderer;
73
21
  }
74
22
  /**
75
- * The glyph that takes the figure off the page as a file.
23
+ * The glyph that takes the figure off the page, as a file or onto the
24
+ * clipboard.
76
25
  *
77
26
  * It works from the `id` of the box the figure is mounted in rather than from
78
27
  * the figure itself, so the control is free to sit in the bar above the
@@ -1 +1 @@
1
- {"version":3,"file":"FigureDownload.d.ts","sourceRoot":"","sources":["../../../src/download/ui/FigureDownload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAa9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,yCAAyC;AACzC,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAmGvE"}
1
+ {"version":3,"file":"FigureDownload.d.ts","sourceRoot":"","sources":["../../../src/download/ui/FigureDownload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGrE,yCAAyC;AACzC,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAChE;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAyBvE"}
@@ -1,16 +1,11 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { PopoverNext } from '@blueprintjs/core';
3
- import { useState } from 'react';
4
3
  import { useChromeT } from "../../i18n/ui/useT.js";
5
4
  import { OverlayIconButton } from "../../overlay/ui/OverlayIconButton.js";
6
- import { downloadFigure } from "../core/downloadFigure.js";
7
- import { figureLayoutRedraws, figureLayoutSize } from "../core/figureLayout.js";
8
- import { DEFAULT_FIGURE_SCALE, FIGURE_SCALES, defaultFigureScale, } from "../core/figureScale.js";
9
- import { figureSize } from "../core/figureTarget.js";
10
- import { FigureDownloadPanel } from "./FigureDownloadPanel.js";
11
- import { useFigureRedraw } from "./useFigureRedraw.js";
5
+ import { useFigureDownload } from "./useFigureDownload.js";
12
6
  /**
13
- * The glyph that takes the figure off the page as a file.
7
+ * The glyph that takes the figure off the page, as a file or onto the
8
+ * clipboard.
14
9
  *
15
10
  * It works from the `id` of the box the figure is mounted in rather than from
16
11
  * the figure itself, so the control is free to sit in the bar above the
@@ -30,64 +25,9 @@ import { useFigureRedraw } from "./useFigureRedraw.js";
30
25
  * @returns The glyph and its panel.
31
26
  */
32
27
  export function FigureDownload(props) {
33
- const { targetId, fileName, background, scales = FIGURE_SCALES } = props;
34
- const { defaultFormat = 'png', defaultScale = DEFAULT_FIGURE_SCALE } = props;
35
- const { label, title } = props;
36
- const { icon = 'download', testId, renderFigure } = props;
28
+ const { label, icon = 'download', testId, ...options } = props;
37
29
  const t = useChromeT();
38
- const [open, setOpen] = useState(false);
39
- const [format, setFormat] = useState(defaultFormat);
40
- const [picked, setPicked] = useState(() => ({
41
- png: defaultScale,
42
- svg: defaultFigureScale('svg'),
43
- }));
44
- const scale = picked[format];
45
- const [size, setSize] = useState(null);
46
- const [failure, setFailure] = useState(null);
47
- const [saving, setSaving] = useState(false);
48
- const [layout, setLayout] = useState('screen');
49
- const [custom, setCustom] = useState(null);
50
- const { redraw, portal } = useFigureRedraw(renderFigure);
51
- // The panel is held open from here rather than left to itself, because the
52
- // figure has to be measured at the moment it opens: its size is what the
53
- // panel writes out, and reading a bounding box on every render would cost a
54
- // layout pass on a bar that is re-rendered on every pointer move.
55
- function interact(next) {
56
- setOpen(next);
57
- if (!next)
58
- return;
59
- setSize(figureSize(targetId));
60
- setFailure(null);
61
- }
62
- async function save() {
63
- setSaving(true);
64
- try {
65
- const options = { format, scale, fileName, background };
66
- if (renderFigure !== undefined &&
67
- size !== null &&
68
- figureLayoutRedraws(layout, size, custom ?? size)) {
69
- const drawn = figureLayoutSize(layout, size, custom ?? size);
70
- await redraw(targetId, drawn, (box) => downloadFigure(box, options));
71
- }
72
- else {
73
- await downloadFigure(targetId, options);
74
- }
75
- setFailure(null);
76
- }
77
- catch (error) {
78
- setFailure(error instanceof Error ? error.message : String(error));
79
- }
80
- finally {
81
- setSaving(false);
82
- }
83
- }
84
- return (_jsxs(_Fragment, { children: [_jsx(PopoverNext, { isOpen: open, placement: "bottom-end", onInteraction: interact, content: _jsx(FigureDownloadPanel, { title: title ?? t('download.saveFigure'), format: format, scale: scale, scales: scales, size: size, failure: failure, saving: saving, onFormatChange: setFormat, onScaleChange: (next) => setPicked((current) => ({ ...current, [format]: next })), onSave: () => void save(), sizing: renderFigure === undefined
85
- ? undefined
86
- : {
87
- layout,
88
- custom,
89
- onLayoutChange: setLayout,
90
- onCustomChange: setCustom,
91
- } }), children: _jsx(OverlayIconButton, { icon: icon, label: label ?? t('download.saveThisFigure'), value: format.toUpperCase(), active: open, testId: testId, opensMenu: true }) }), portal] }));
30
+ const { isOpen, setOpen, panel, format, portal } = useFigureDownload(options);
31
+ return (_jsxs(_Fragment, { children: [_jsx(PopoverNext, { isOpen: isOpen, placement: "bottom-end", onInteraction: setOpen, content: panel, children: _jsx(OverlayIconButton, { icon: icon, label: label ?? t('download.saveThisFigure'), value: format.toUpperCase(), active: isOpen, testId: testId, opensMenu: true }) }), portal] }));
92
32
  }
93
33
  //# sourceMappingURL=FigureDownload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FigureDownload.js","sourceRoot":"","sources":["../../../src/download/ui/FigureDownload.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAwC,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AAwExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,KAAK,CAAC;IACzE,MAAM,EAAE,aAAa,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AAE,IAAI,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;IAC/D,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE9E,OAAO,CACL,8BACE,KAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,SAAS,EAAC,YAAY,EACtB,aAAa,EAAE,OAAO,EACtB,OAAO,EAAE,KAAK,YAEd,KAAC,iBAAiB,IAChB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,IAAI,CAAC,CAAC,yBAAyB,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,EAC3B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,SACT,GACU,EACb,MAAM,IACN,CACJ,CAAC;AACJ,CAAC"}
@@ -2,6 +2,7 @@ import type { ReactElement } from 'react';
2
2
  import type { FigureFormat } from '../core/downloadFigure.ts';
3
3
  import type { FigurePixels } from '../core/figureScale.ts';
4
4
  import type { FigureSizing } from './FigureSizeRows.tsx';
5
+ import type { FigureNotice } from './useFigureActions.ts';
5
6
  /** What {@link FigureDownloadPanel} is drawn from. */
6
7
  export interface FigureDownloadPanelProps {
7
8
  /** What the panel is called. */
@@ -16,7 +17,13 @@ export interface FigureDownloadPanelProps {
16
17
  size: FigurePixels | null;
17
18
  /** What went wrong the last time save was pressed, if anything. */
18
19
  failure: string | null;
19
- /** Whether a file is being written right now. */
20
+ /**
21
+ * What the last copy came to, while the choices it was made with still
22
+ * stand.
23
+ * @default null
24
+ */
25
+ notice?: FigureNotice | null;
26
+ /** Whether a file or a copy is being written right now. */
20
27
  saving: boolean;
21
28
  /** Called with the format the reader picked. */
22
29
  onFormatChange: (format: FigureFormat) => void;
@@ -24,6 +31,12 @@ export interface FigureDownloadPanelProps {
24
31
  onScaleChange: (scale: number) => void;
25
32
  /** Called when they press save. */
26
33
  onSave: () => void;
34
+ /**
35
+ * Called when they press copy, which puts a PNG at the resolution picked on
36
+ * the clipboard.
37
+ * @default undefined — no copy is offered
38
+ */
39
+ onCopy?: () => void;
27
40
  /**
28
41
  * Whether the SVG holds a rendered picture rather than vector drawings, as
29
42
  * for a WebGL scene: its resolution is then the pixels of that picture, it
@@ -40,7 +53,8 @@ export interface FigureDownloadPanelProps {
40
53
  sizing?: FigureSizing;
41
54
  }
42
55
  /**
43
- * The choices behind the save glyph, and the button that writes the file.
56
+ * The choices behind the save glyph, and the buttons that write the file and
57
+ * copy the picture.
44
58
  *
45
59
  * The resolution applies to both formats, and means what the reader needs it
46
60
  * to: a PNG is painted with that many more pixels, and an SVG, drawn the same,
@@ -1 +1 @@
1
- {"version":3,"file":"FigureDownloadPanel.d.ts","sourceRoot":"","sources":["../../../src/download/ui/FigureDownloadPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAS1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAQ3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,sDAAsD;AACtD,MAAM,WAAW,wBAAwB;IACvC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,MAAM,EAAE,YAAY,CAAC;IACrB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,wEAAwE;IACxE,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1B,mEAAmE;IACnE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,iDAAiD;IACjD,MAAM,EAAE,OAAO,CAAC;I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AM,EAAE,OAAO,CAAC;IAChB,gDAAgD;IAChD,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/C,4CAA4C;IAC5C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,mCAAmC;IACnC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,YAAY,CAuEd"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useChromeT } from "../../i18n/ui/useT.js";
3
3
  import { OverlayAction } from "../../overlay/ui/OverlayAction.js";
4
4
  import { OverlayPanel } from "../../overlay/ui/OverlayPanel.js";
@@ -6,8 +6,10 @@ import { OverlaySegmented } from "../../overlay/ui/OverlaySegmented.js";
6
6
  import { figureLayoutSize } from "../core/figureLayout.js";
7
7
  import { figurePixels, figureScaleFits, figureScaleLabel, formatFigurePixels, } from "../core/figureScale.js";
8
8
  import { FigureSizeRows } from "./FigureSizeRows.js";
9
+ import { hintOf } from "./figureDownloadHint.js";
9
10
  /**
10
- * The choices behind the save glyph, and the button that writes the file.
11
+ * The choices behind the save glyph, and the buttons that write the file and
12
+ * copy the picture.
11
13
  *
12
14
  * The resolution applies to both formats, and means what the reader needs it
13
15
  * to: a PNG is painted with that many more pixels, and an SVG, drawn the same,
@@ -27,14 +29,14 @@ import { FigureSizeRows } from "./FigureSizeRows.js";
27
29
  export function FigureDownloadPanel(props) {
28
30
  const { title, format, scale, scales, size, failure, saving } = props;
29
31
  const { onFormatChange, onScaleChange, onSave, rasterSvg = false } = props;
30
- const { sizing } = props;
32
+ const { sizing, onCopy, notice = null } = props;
31
33
  const t = useChromeT();
32
34
  // What the file is drawn at: the figure on screen, or the shape picked.
33
35
  const drawn = size === null || sizing === undefined
34
36
  ? size
35
37
  : figureLayoutSize(sizing.layout, size, sizing.custom ?? size);
36
38
  const painted = format === 'png' || rasterSvg;
37
- return (_jsxs(OverlayPanel, { title: title, hint: hintOf(format, drawn, scale, failure, rasterSvg, t), actions: _jsx(OverlayAction, { text: t('download.save'), icon: "download", intent: "primary", disabled: saving || size === null, onClick: onSave }), children: [_jsx(OverlaySegmented, { label: t('download.format'), help: {
39
+ return (_jsxs(OverlayPanel, { title: title, width: PANEL_WIDTH, hint: hintOf({ format, size: drawn, scale, failure, notice, rasterSvg }, t), actions: _jsxs(_Fragment, { children: [_jsx(OverlayAction, { text: t('download.save'), icon: "download", intent: "primary", disabled: saving || size === null, onClick: onSave }), onCopy === undefined ? null : (_jsx(OverlayAction, { text: t('clipboard.copy'), icon: "clipboard", disabled: saving || size === null, onClick: onCopy }))] }), children: [_jsx(OverlaySegmented, { label: t('download.format'), help: {
38
40
  title: t('download.format'),
39
41
  body: t('download.formatHelp'),
40
42
  }, value: format, options: FORMAT_CHOICES, onChange: onFormatChange }), sizing === undefined ? null : (_jsx(FigureSizeRows, { sizing: sizing, size: size })), _jsx(OverlaySegmented, { label: t('download.resolution'), help: {
@@ -46,6 +48,11 @@ export function FigureDownloadPanel(props) {
46
48
  },
47
49
  }, value: String(scale), options: scaleChoices(scales, drawn, painted), onChange: (picked) => onScaleChange(Number(picked)) })] }));
48
50
  }
51
+ /**
52
+ * Wide enough for the longest hint on one line in English, so switching
53
+ * between PNG and SVG — whose hints differ in length — never resizes the panel.
54
+ */
55
+ const PANEL_WIDTH = '27em';
49
56
  /** The two files a figure can leave the page as. */
50
57
  const FORMAT_CHOICES = [
51
58
  { value: 'png', label: 'PNG' },
@@ -75,30 +82,4 @@ function scaleChoices(scales, size, painted) {
75
82
  }
76
83
  return choices;
77
84
  }
78
- /**
79
- * The line at the foot of the panel: what pressing save is about to do.
80
- * @param format - Which file the reader is about to write.
81
- * @param size - How big the figure is drawn for the file.
82
- * @param scale - The multiple it is saved at.
83
- * @param failure - What went wrong last time, if anything.
84
- * @param rasterSvg - Whether the SVG embeds a rendered picture.
85
- * @param t - The chrome's formatter, so the sentence is in the language of
86
- * the page.
87
- * @returns The sentence.
88
- */
89
- function hintOf(format, size, scale, failure, rasterSvg, t) {
90
- if (failure !== null)
91
- return failure;
92
- if (size === null)
93
- return t('download.noFigure');
94
- if (format === 'svg' && rasterSvg) {
95
- return t('download.hintRasterSvg', {
96
- pixels: formatFigurePixels(figurePixels(size, scale)),
97
- });
98
- }
99
- const pixels = formatFigurePixels(figurePixels(size, scale));
100
- return format === 'svg'
101
- ? t('download.hintSvg', { pixels })
102
- : t('download.hintPng', { pixels });
103
- }
104
85
  //# sourceMappingURL=FigureDownloadPanel.js.map