react-cheminfo 0.30.0 → 0.31.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 (80) hide show
  1. package/README.md +20 -0
  2. package/lib/download/core/downloadFigure.d.ts +7 -5
  3. package/lib/download/core/downloadFigure.d.ts.map +1 -1
  4. package/lib/download/core/downloadFigure.js +7 -6
  5. package/lib/download/core/downloadFigure.js.map +1 -1
  6. package/lib/download/core/figureLayout.d.ts +55 -0
  7. package/lib/download/core/figureLayout.d.ts.map +1 -0
  8. package/lib/download/core/figureLayout.js +89 -0
  9. package/lib/download/core/figureLayout.js.map +1 -0
  10. package/lib/download/core/figureScale.d.ts +9 -0
  11. package/lib/download/core/figureScale.d.ts.map +1 -1
  12. package/lib/download/core/figureScale.js +10 -0
  13. package/lib/download/core/figureScale.js.map +1 -1
  14. package/lib/download/core/figureSettle.d.ts +51 -0
  15. package/lib/download/core/figureSettle.d.ts.map +1 -0
  16. package/lib/download/core/figureSettle.js +81 -0
  17. package/lib/download/core/figureSettle.js.map +1 -0
  18. package/lib/download/core/figureSvg.d.ts +7 -1
  19. package/lib/download/core/figureSvg.d.ts.map +1 -1
  20. package/lib/download/core/figureSvg.js +1 -0
  21. package/lib/download/core/figureSvg.js.map +1 -1
  22. package/lib/download/core/figureSvgDocument.d.ts +7 -0
  23. package/lib/download/core/figureSvgDocument.d.ts.map +1 -1
  24. package/lib/download/core/figureSvgDocument.js +11 -2
  25. package/lib/download/core/figureSvgDocument.js.map +1 -1
  26. package/lib/download/core/index.d.ts +5 -1
  27. package/lib/download/core/index.d.ts.map +1 -1
  28. package/lib/download/core/index.js +3 -1
  29. package/lib/download/core/index.js.map +1 -1
  30. package/lib/download/ui/FigureDownload.d.ts +18 -4
  31. package/lib/download/ui/FigureDownload.d.ts.map +1 -1
  32. package/lib/download/ui/FigureDownload.js +35 -9
  33. package/lib/download/ui/FigureDownload.js.map +1 -1
  34. package/lib/download/ui/FigureDownloadPanel.d.ts +17 -7
  35. package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
  36. package/lib/download/ui/FigureDownloadPanel.js +30 -22
  37. package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
  38. package/lib/download/ui/FigureSizeField.d.ts +27 -0
  39. package/lib/download/ui/FigureSizeField.d.ts.map +1 -0
  40. package/lib/download/ui/FigureSizeField.js +87 -0
  41. package/lib/download/ui/FigureSizeField.js.map +1 -0
  42. package/lib/download/ui/FigureSizeRows.d.ts +34 -0
  43. package/lib/download/ui/FigureSizeRows.d.ts.map +1 -0
  44. package/lib/download/ui/FigureSizeRows.js +54 -0
  45. package/lib/download/ui/FigureSizeRows.js.map +1 -0
  46. package/lib/download/ui/index.d.ts +2 -0
  47. package/lib/download/ui/index.d.ts.map +1 -1
  48. package/lib/download/ui/index.js.map +1 -1
  49. package/lib/download/ui/useFigureRedraw.d.ts +27 -0
  50. package/lib/download/ui/useFigureRedraw.d.ts.map +1 -0
  51. package/lib/download/ui/useFigureRedraw.js +78 -0
  52. package/lib/download/ui/useFigureRedraw.js.map +1 -0
  53. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  54. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  55. package/lib/locales/de.json +10 -2
  56. package/lib/locales/en.json +10 -2
  57. package/lib/locales/es.json +10 -2
  58. package/lib/locales/fr.json +10 -2
  59. package/lib/overlay/ui/OverlayValueMenu.d.ts.map +1 -1
  60. package/lib/overlay/ui/OverlayValueMenu.js +7 -1
  61. package/lib/overlay/ui/OverlayValueMenu.js.map +1 -1
  62. package/package.json +1 -1
  63. package/src/download/core/downloadFigure.ts +12 -9
  64. package/src/download/core/figureLayout.ts +114 -0
  65. package/src/download/core/figureScale.ts +13 -0
  66. package/src/download/core/figureSettle.ts +112 -0
  67. package/src/download/core/figureSvg.ts +8 -1
  68. package/src/download/core/figureSvgDocument.ts +19 -2
  69. package/src/download/core/index.ts +13 -0
  70. package/src/download/ui/FigureDownload.tsx +88 -35
  71. package/src/download/ui/FigureDownloadPanel.tsx +45 -22
  72. package/src/download/ui/FigureSizeField.tsx +153 -0
  73. package/src/download/ui/FigureSizeRows.tsx +108 -0
  74. package/src/download/ui/index.ts +2 -0
  75. package/src/download/ui/useFigureRedraw.tsx +115 -0
  76. package/src/locales/de.json +10 -2
  77. package/src/locales/en.json +10 -2
  78. package/src/locales/es.json +10 -2
  79. package/src/locales/fr.json +10 -2
  80. package/src/overlay/ui/OverlayValueMenu.tsx +7 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/download/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAGhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AAExD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA4B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/download/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAKhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AAExD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA4B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FigurePixels } from '../core/figureScale.ts';
3
+ /** Draws a figure at the size asked for, for a file. */
4
+ export type FigureRenderer = (size: FigurePixels) => ReactNode;
5
+ /** What {@link useFigureRedraw} hands back. */
6
+ export interface FigureRedraw {
7
+ /**
8
+ * Draw the figure off the page at a size, wait for it to settle, and hand
9
+ * the box it was drawn in to `save`.
10
+ */
11
+ redraw: (targetId: string, size: FigurePixels, save: (box: Element) => Promise<void>) => Promise<void>;
12
+ /** The copy being drawn, to be rendered anywhere in the caller's tree. */
13
+ portal: ReactNode;
14
+ }
15
+ /**
16
+ * A second copy of a figure, drawn at another size for as long as it takes to
17
+ * save it.
18
+ *
19
+ * The copy is rendered through a portal, so it sees every provider the figure
20
+ * on the page sees, and the portal's box is placed next to the figure's own,
21
+ * so it inherits the same tokens and the same type. It sits far to the left of
22
+ * the page, out of sight, and is taken away once the file is written.
23
+ * @param render - Draws the figure at a size.
24
+ * @returns See {@link FigureRedraw}.
25
+ */
26
+ export declare function useFigureRedraw(render?: FigureRenderer): FigureRedraw;
27
+ //# sourceMappingURL=useFigureRedraw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFigureRedraw.d.ts","sourceRoot":"","sources":["../../../src/download/ui/useFigureRedraw.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,SAAS,CAAC;AAE/D,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,MAAM,EAAE,CACN,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,KAClC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,0EAA0E;IAC1E,MAAM,EAAE,SAAS,CAAC;CACnB;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,YAAY,CA+BrE"}
@@ -0,0 +1,78 @@
1
+ import { useEffect, useRef, useState } from 'react';
2
+ import { createPortal } from 'react-dom';
3
+ import { whenFigureSettles } from "../core/figureSettle.js";
4
+ import { figureElement } from "../core/figureTarget.js";
5
+ /**
6
+ * A second copy of a figure, drawn at another size for as long as it takes to
7
+ * save it.
8
+ *
9
+ * The copy is rendered through a portal, so it sees every provider the figure
10
+ * on the page sees, and the portal's box is placed next to the figure's own,
11
+ * so it inherits the same tokens and the same type. It sits far to the left of
12
+ * the page, out of sight, and is taken away once the file is written.
13
+ * @param render - Draws the figure at a size.
14
+ * @returns See {@link FigureRedraw}.
15
+ */
16
+ export function useFigureRedraw(render) {
17
+ const [job, setJob] = useState(null);
18
+ const controllerRef = useRef(null);
19
+ useEffect(() => () => controllerRef.current?.abort(), []);
20
+ async function redraw(targetId, size, save) {
21
+ const box = mountRedrawBox(figureElement(targetId), size);
22
+ const controller = new AbortController();
23
+ controllerRef.current = controller;
24
+ setJob({ box, size });
25
+ try {
26
+ await whenFigureSettles(box, { signal: controller.signal });
27
+ await save(box);
28
+ }
29
+ finally {
30
+ controllerRef.current = null;
31
+ setJob(null);
32
+ box.remove();
33
+ }
34
+ }
35
+ const portal = job === null || render === undefined
36
+ ? null
37
+ : createPortal(render(job.size), job.box);
38
+ return { redraw, portal };
39
+ }
40
+ /**
41
+ * The box the copy is drawn in, beside the figure it copies.
42
+ *
43
+ * Its type is copied from the figure's box, since a chart inherits its labels'
44
+ * size from wherever it is mounted and the copy is mounted one level up.
45
+ * @param target - The box the figure on the page is mounted in.
46
+ * @param size - The size the copy is drawn at.
47
+ * @returns The box, already in the document.
48
+ */
49
+ function mountRedrawBox(target, size) {
50
+ const box = document.createElement('div');
51
+ box.setAttribute('aria-hidden', 'true');
52
+ box.inert = true;
53
+ const type = window.getComputedStyle(target);
54
+ Object.assign(box.style, {
55
+ position: 'absolute',
56
+ top: '0',
57
+ left: '-100000px',
58
+ width: `${size.width}px`,
59
+ height: `${size.height}px`,
60
+ pointerEvents: 'none',
61
+ fontFamily: type.fontFamily,
62
+ fontSize: type.fontSize,
63
+ lineHeight: type.lineHeight,
64
+ color: type.color,
65
+ });
66
+ if (target instanceof HTMLElement) {
67
+ target.after(box);
68
+ return box;
69
+ }
70
+ // A figure named by its `<svg>` gets the box beside the nearest element
71
+ // that may hold a `<div>`.
72
+ let host = target;
73
+ while (host instanceof SVGElement)
74
+ host = host.parentElement;
75
+ (host ?? document.body).append(box);
76
+ return box;
77
+ }
78
+ //# sourceMappingURL=useFigureRedraw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFigureRedraw.js","sourceRoot":"","sources":["../../../src/download/ui/useFigureRedraw.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA2BxD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,MAAuB;IACrD,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAmB,IAAI,CAAC,CAAC;IACvD,MAAM,aAAa,GAAG,MAAM,CAAyB,IAAI,CAAC,CAAC;IAE3D,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAE1D,KAAK,UAAU,MAAM,CACnB,QAAgB,EAChB,IAAkB,EAClB,IAAqC;QAErC,MAAM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AAE,GAAG,IAAI,CAAC,KAAK,IAAI;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI;QAC1B,aAAa,EAAE,MAAM;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;KAClB,CAAC,CAAC;IAEH,IAAI,MAAM,YAAY,WAAW,EAAE,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,wEAAwE;IACxE,2BAA2B;IAC3B,IAAI,IAAI,GAAmB,MAAM,CAAC;IAClC,OAAO,IAAI,YAAY,UAAU;QAAE,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC;IAC7D,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -17,5 +17,5 @@ export type ChromeKey = keyof typeof en;
17
17
  * missing message falls back to; the other three arrive as a chunk of their
18
18
  * own, so a site read only in English downloads none of them.
19
19
  */
20
- export declare const CHROME_CATALOG: MessageCatalog<"language.label" | "chrome.pages" | "account.signIn" | "account.signOut" | "account.signedInAs" | "ecosystem.tools" | "ecosystem.menuHeading" | "ecosystem.otherTools" | "ecosystem.youAreHere" | "ecosystem.group.basics.label" | "ecosystem.group.basics.blurb" | "ecosystem.group.practice.label" | "ecosystem.group.practice.blurb" | "ecosystem.group.structures.label" | "ecosystem.group.structures.blurb" | "ecosystem.group.spectra.label" | "ecosystem.group.spectra.blurb" | "ecosystem.group.research.label" | "ecosystem.group.research.blurb" | "ecosystem.group.computing.label" | "ecosystem.group.computing.blurb" | "site.learn.tagline" | "site.inchi.tagline" | "site.vcl.tagline" | "site.smiles.tagline" | "site.openbabel.tagline" | "site.chemcalc.tagline" | "site.dbe.tagline" | "site.nmrium.tagline" | "site.metabo.tagline" | "site.derepflow.tagline" | "site.surge.tagline" | "site.tex.tagline" | "site.lcao.tagline" | "site.regexp.tagline" | "site.pdb.tagline" | "site.elucidation.tagline" | "site.equilibrium.tagline" | "site.polycarp.tagline" | "site.3d.tagline" | "site.periodic-table.tagline" | "site.database.tagline" | "site.symmetry.tagline" | "site.osiris.tagline" | "site.atoms.tagline" | "site.moles.tagline" | "site.inorganic.tagline" | "share.button" | "share.buttonTitle" | "share.dialogTitle" | "share.lead" | "share.layout" | "share.embed" | "share.embedHint" | "share.showOnPage" | "share.custom" | "share.link" | "share.copyLink" | "share.openInNewTab" | "share.iframe" | "share.copyIframe" | "share.done" | "cite.button" | "cite.copyReferenceAs" | "cite.pleaseCiteBoth" | "cite.pleaseCiteEvery" | "cite.copyBothAs" | "cite.copyEveryAs" | "cite.importIntoManager" | "cite.openArticle" | "cite.copyThisAs" | "cite.importThis" | "cite.copied" | "cite.copyFailed" | "cite.format.doi" | "cite.download.ris" | "cite.download.bibtex" | "clipboard.copied" | "clipboard.failed" | "clipboard.copy" | "clipboard.copyThe" | "clipboard.copyValue" | "clipboard.copyToClipboard" | "about.providedBy" | "about.whatYouCanDo" | "about.builtOn" | "about.howToCite" | "about.licenceAndSource" | "about.licence" | "about.foundAProblem" | "about.reportIt" | "about.citeWork" | "about.built" | "about.builtFromCommit" | "about.nameList" | "credits.openbabel.description" | "credits.openchemlib.description" | "credits.openchemlib-utils.description" | "credits.osiris-property-explorer.description" | "credits.react-ocl.description" | "credits.react-mf.description" | "credits.mass-tools.description" | "credits.chem-equilibrium.description" | "credits.ml-matrix.description" | "credits.ml-xsadd.description" | "credits.cif-to-json.description" | "credits.ml-spectra-processing.description" | "credits.occ.description" | "credits.xtb-wasm.description" | "credits.molstar.description" | "credits.blueprint.description" | "credits.react-science.description" | "credits.react-cheminfo.description" | "credits.cheminfo-font.description" | "credits.nivo.description" | "credits.mathjax.description" | "credits.lexical.description" | "credits.katex.description" | "credits.dnd-kit.description" | "credits.react-roi.description" | "credits.file-collection.description" | "credits.zip-js.description" | "credits.preact-signals.description" | "credits.fastify.description" | "credits.sqlite.description" | "credits.sqlite-wasm.description" | "credits.pouchdb.description" | "credits.chemexper.description" | "credits.react.description" | "credits.vite.description" | "help.label" | "help.learnMore" | "help.on" | "confirm.delete" | "confirm.cancel" | "error.title" | "error.tryAgain" | "error.noMessage" | "capsule.filter" | "color.scales" | "color.done" | "color.custom" | "color.customEllipsis" | "color.inUse" | "color.colourScale" | "color.legendLabel" | "color.scaleBeingEdited" | "color.anchorColour" | "color.anchorPosition" | "color.removeAnchor" | "color.addColour" | "color.path" | "color.interpolation.rgb" | "color.interpolation.hsv" | "color.interpolation.hsv-long" | "color.kind.sequential" | "color.kind.diverging" | "color.kind.cyclic" | "color.scale.viridis.label" | "color.scale.viridis.description" | "color.scale.plasma.label" | "color.scale.plasma.description" | "color.scale.magma.label" | "color.scale.magma.description" | "color.scale.inferno.label" | "color.scale.inferno.description" | "color.scale.cividis.label" | "color.scale.cividis.description" | "color.scale.turbo.label" | "color.scale.turbo.description" | "color.scale.greys.label" | "color.scale.greys.description" | "color.scale.cool-warm.label" | "color.scale.cool-warm.description" | "color.scale.blue-red.label" | "color.scale.blue-red.description" | "color.scale.rainbow.label" | "color.scale.rainbow.description" | "download.save" | "download.saveFigure" | "download.saveThisFigure" | "download.format" | "download.formatHelp" | "download.resolution" | "download.resolutionHelp" | "download.resolutionExample" | "download.noFigure" | "download.hintRasterSvg" | "download.hintSvg" | "download.hintPng" | "pedagogy.check" | "pedagogy.revealHint" | "pedagogy.revealHintCount" | "pedagogy.revealHintLadder" | "pedagogy.hideSolution" | "pedagogy.revealSolution" | "pedagogy.reset" | "pedagogy.hints" | "pedagogy.solvedCount" | "pedagogy.clearAll" | "pedagogy.keepAnswers" | "pedagogy.clearEverything" | "pedagogy.clearWarning" | "pedagogy.filterTerms" | "pedagogy.noTermDefined" | "pedagogy.noTermMatches" | "pedagogy.example" | "pedagogy.input" | "pedagogy.previous" | "pedagogy.next" | "pedagogy.stepOf" | "slides.exit" | "slides.previousSlide" | "slides.nextSlide" | "slides.toggleFullscreen" | "slides.backToSlides" | "slides.backToSlide" | "slides.noAddress" | "slides.liveDemos" | "slides.noTalkYet" | "overlay.options" | "overlay.whatAmILookingAt" | "overlay.reset" | "overlay.hoverAName" | "overlay.dismiss" | "delimited.copyTable" | "delimited.close" | "delimited.separator" | "delimited.save" | "delimited.copy" | "delimited.tableAsText" | "chart.measurement" | "chart.measurements" | "delimited.descriptionOne" | "delimited.descriptionMany" | "structure.guide.atom.title" | "structure.guide.atom.element" | "structure.guide.atom.group" | "structure.guide.atom.applyOrForget" | "structure.guide.atom.chain" | "structure.guide.atom.charge" | "structure.guide.atom.radical" | "structure.guide.atom.spin" | "structure.guide.atom.attachment" | "structure.guide.atom.query" | "structure.guide.atom.halogen" | "structure.guide.atom.delete" | "structure.guide.atom.note" | "structure.guide.bond.title" | "structure.guide.bond.order" | "structure.guide.bond.zeroOrder" | "structure.guide.bond.stereo" | "structure.guide.bond.unknownGeometry" | "structure.guide.bond.threeRing" | "structure.guide.bond.ring" | "structure.guide.bond.benzene" | "structure.guide.bond.query" | "structure.guide.bond.delete" | "structure.guide.anywhere.title" | "structure.guide.anywhere.undo" | "structure.guide.anywhere.copy" | "structure.guide.anywhere.paste" | "structure.guide.anywhere.deleteSelection" | "structure.guide.anywhere.flip" | "structure.guide.anywhere.help" | "structure.guide.anywhere.note" | "structure.guide.selecting.title" | "structure.guide.selecting.lasso" | "structure.guide.selecting.rectangle" | "structure.guide.selecting.add" | "structure.guide.selecting.move" | "structure.guide.selecting.duplicate" | "structure.guide.selecting.queryFeatures" | "structure.guide.selecting.note" | "structure.guide.stereochemistry.title" | "structure.guide.stereochemistry.note" | "structure.input.type" | "structure.input.or" | "structure.input.drag" | "structure.input.plusDrag" | "structure.input.dragSelection" | "structure.input.plusDragSelection" | "structure.input.doubleClick" | "structure.docs.toolsAndKeys" | "structure.docs.atomProperties" | "structure.docs.stereochemistry" | "structure.help.hoverToolbar" | "structure.help.learnMore" | "structure.mouseAndKeyboard" | "structure.tool.clear.name" | "structure.tool.clear.description" | "structure.tool.cleanUp.name" | "structure.tool.cleanUp.description" | "structure.tool.select.name" | "structure.tool.select.description" | "structure.tool.unknownConfiguration.name" | "structure.tool.unknownConfiguration.description" | "structure.tool.delete.name" | "structure.tool.delete.description" | "structure.tool.singleBond.name" | "structure.tool.singleBond.description" | "structure.tool.upBond.name" | "structure.tool.upBond.description" | "structure.tool.positiveCharge.name" | "structure.tool.positiveCharge.description" | "structure.tool.undo.name" | "structure.tool.undo.description" | "structure.tool.zoomAndRotate.name" | "structure.tool.zoomAndRotate.description" | "structure.tool.atomMapping.name" | "structure.tool.atomMapping.description" | "structure.tool.enhancedStereo.name" | "structure.tool.enhancedStereo.description" | "structure.tool.text.name" | "structure.tool.text.description" | "structure.tool.chain.name" | "structure.tool.chain.description" | "structure.tool.downBond.name" | "structure.tool.downBond.description" | "structure.tool.negativeCharge.name" | "structure.tool.negativeCharge.description" | "structure.tool.anyAtom.name" | "structure.tool.anyAtom.description" | "structure.tool.ring3.name" | "structure.tool.ring3.description" | "structure.tool.ring5.name" | "structure.tool.ring5.description" | "structure.tool.ring7.name" | "structure.tool.ring7.description" | "structure.tool.ring4.name" | "structure.tool.ring4.description" | "structure.tool.ring6.name" | "structure.tool.ring6.description" | "structure.tool.benzene.name" | "structure.tool.benzene.description" | "structure.tool.carbon.name" | "structure.tool.carbon.description" | "structure.tool.nitrogen.name" | "structure.tool.nitrogen.description" | "structure.tool.oxygen.name" | "structure.tool.oxygen.description" | "structure.tool.fluorine.name" | "structure.tool.fluorine.description" | "structure.tool.bromine.name" | "structure.tool.bromine.description" | "structure.tool.hydrogen.name" | "structure.tool.hydrogen.description" | "structure.tool.silicon.name" | "structure.tool.silicon.description" | "structure.tool.phosphorus.name" | "structure.tool.phosphorus.description" | "structure.tool.sulfur.name" | "structure.tool.sulfur.description" | "structure.tool.chlorine.name" | "structure.tool.chlorine.description" | "structure.tool.iodine.name" | "structure.tool.iodine.description" | "structure.tool.reactionOnly" | "structure.tool.unavailable" | "structure.loadingEditor" | "periodic.table" | "periodic.group" | "periodic.period" | "periodic.cellLabel" | "periodic.category.alkali-metal" | "periodic.category.alkaline-earth-metal" | "periodic.category.transition-metal" | "periodic.category.post-transition-metal" | "periodic.category.metalloid" | "periodic.category.nonmetal" | "periodic.category.halogen" | "periodic.category.noble-gas" | "periodic.category.lanthanoid" | "periodic.category.actinoid" | "molecule3d.view" | "molecule3d.resetView" | "molecule3d.spin" | "molecule3d.surface" | "molecule3d.molecularSurface" | "molecule3d.displayOptions" | "molecule3d.exportImage" | "molecule3d.measure" | "molecule3d.clearMeasurements" | "molecule3d.measurement.distance" | "molecule3d.measurement.angle" | "molecule3d.measurement.dihedral" | "molecule3d.measurementTooltip" | "molecule3d.representation.ball-and-stick" | "molecule3d.representation.spacefill" | "molecule3d.representation.stick" | "molecule3d.size" | "molecule3d.surfaceOpacity" | "molecule3d.solventProbe" | "molecule3d.solventProbeHelp" | "molecule3d.surfaceColour" | "molecule3d.colour" | "molecule3d.coloring.uniform" | "molecule3d.coloring.element" | "molecule3d.coloring.polarity" | "molecule3d.neutral" | "molecule3d.tpsaHelp" | "molecule3d.loadingViewer" | "molecule3d.couldNotDraw" | "molecule3d.gesture.rotate" | "molecule3d.gesture.rollDrag" | "molecule3d.gesture.rollKeys" | "molecule3d.gesture.moveDrag" | "molecule3d.gesture.moveCtrl" | "molecule3d.gesture.zoom" | "molecule3d.gesture.clip" | "molecule3d.gesture.centreAtom" | "molecule3d.gesture.centreMolecule" | "molecule3d.input.drag" | "molecule3d.input.plus" | "molecule3d.input.plusDrag" | "molecule3d.input.plusScroll" | "molecule3d.input.or" | "molecule3d.input.rightDrag" | "molecule3d.input.scroll" | "molecule3d.input.clickAtom" | "molecule3d.input.clickBackground" | "molecule3d.helpNote" | "orbital.couldNotDraw" | "orbital.sampling" | "orbital.showAxes" | "orbital.axesTitle" | "orbital.axesBody" | "orbital.axesExample" | "orbital.resetTitle" | "orbital.resetBody" | "viewer.capability.noWindow" | "viewer.capability.noContext" | "viewer.capability.noFloatTextures" | "viewer.capability.ready" | "conformers.strategy.adaptive-random" | "conformers.strategy.likely-random" | "conformers.strategy.pure-random" | "conformers.strategy.likely-systematic" | "conformers.strategyDetail.adaptive-random" | "conformers.strategyDetail.likely-random" | "conformers.strategyDetail.pure-random" | "conformers.strategyDetail.likely-systematic" | "conformers.minimisation.none">;
20
+ export declare const CHROME_CATALOG: MessageCatalog<"language.label" | "chrome.pages" | "account.signIn" | "account.signOut" | "account.signedInAs" | "ecosystem.tools" | "ecosystem.menuHeading" | "ecosystem.otherTools" | "ecosystem.youAreHere" | "ecosystem.group.basics.label" | "ecosystem.group.basics.blurb" | "ecosystem.group.practice.label" | "ecosystem.group.practice.blurb" | "ecosystem.group.structures.label" | "ecosystem.group.structures.blurb" | "ecosystem.group.spectra.label" | "ecosystem.group.spectra.blurb" | "ecosystem.group.research.label" | "ecosystem.group.research.blurb" | "ecosystem.group.computing.label" | "ecosystem.group.computing.blurb" | "site.learn.tagline" | "site.inchi.tagline" | "site.vcl.tagline" | "site.smiles.tagline" | "site.openbabel.tagline" | "site.chemcalc.tagline" | "site.dbe.tagline" | "site.nmrium.tagline" | "site.metabo.tagline" | "site.derepflow.tagline" | "site.surge.tagline" | "site.tex.tagline" | "site.lcao.tagline" | "site.regexp.tagline" | "site.pdb.tagline" | "site.elucidation.tagline" | "site.equilibrium.tagline" | "site.polycarp.tagline" | "site.3d.tagline" | "site.periodic-table.tagline" | "site.database.tagline" | "site.symmetry.tagline" | "site.osiris.tagline" | "site.atoms.tagline" | "site.moles.tagline" | "site.inorganic.tagline" | "share.button" | "share.buttonTitle" | "share.dialogTitle" | "share.lead" | "share.layout" | "share.embed" | "share.embedHint" | "share.showOnPage" | "share.custom" | "share.link" | "share.copyLink" | "share.openInNewTab" | "share.iframe" | "share.copyIframe" | "share.done" | "cite.button" | "cite.copyReferenceAs" | "cite.pleaseCiteBoth" | "cite.pleaseCiteEvery" | "cite.copyBothAs" | "cite.copyEveryAs" | "cite.importIntoManager" | "cite.openArticle" | "cite.copyThisAs" | "cite.importThis" | "cite.copied" | "cite.copyFailed" | "cite.format.doi" | "cite.download.ris" | "cite.download.bibtex" | "clipboard.copied" | "clipboard.failed" | "clipboard.copy" | "clipboard.copyThe" | "clipboard.copyValue" | "clipboard.copyToClipboard" | "about.providedBy" | "about.whatYouCanDo" | "about.builtOn" | "about.howToCite" | "about.licenceAndSource" | "about.licence" | "about.foundAProblem" | "about.reportIt" | "about.citeWork" | "about.built" | "about.builtFromCommit" | "about.nameList" | "credits.openbabel.description" | "credits.openchemlib.description" | "credits.openchemlib-utils.description" | "credits.osiris-property-explorer.description" | "credits.react-ocl.description" | "credits.react-mf.description" | "credits.mass-tools.description" | "credits.chem-equilibrium.description" | "credits.ml-matrix.description" | "credits.ml-xsadd.description" | "credits.cif-to-json.description" | "credits.ml-spectra-processing.description" | "credits.occ.description" | "credits.xtb-wasm.description" | "credits.molstar.description" | "credits.blueprint.description" | "credits.react-science.description" | "credits.react-cheminfo.description" | "credits.cheminfo-font.description" | "credits.nivo.description" | "credits.mathjax.description" | "credits.lexical.description" | "credits.katex.description" | "credits.dnd-kit.description" | "credits.react-roi.description" | "credits.file-collection.description" | "credits.zip-js.description" | "credits.preact-signals.description" | "credits.fastify.description" | "credits.sqlite.description" | "credits.sqlite-wasm.description" | "credits.pouchdb.description" | "credits.chemexper.description" | "credits.react.description" | "credits.vite.description" | "help.label" | "help.learnMore" | "help.on" | "confirm.delete" | "confirm.cancel" | "error.title" | "error.tryAgain" | "error.noMessage" | "capsule.filter" | "color.scales" | "color.done" | "color.custom" | "color.customEllipsis" | "color.inUse" | "color.colourScale" | "color.legendLabel" | "color.scaleBeingEdited" | "color.anchorColour" | "color.anchorPosition" | "color.removeAnchor" | "color.addColour" | "color.path" | "color.interpolation.rgb" | "color.interpolation.hsv" | "color.interpolation.hsv-long" | "color.kind.sequential" | "color.kind.diverging" | "color.kind.cyclic" | "color.scale.viridis.label" | "color.scale.viridis.description" | "color.scale.plasma.label" | "color.scale.plasma.description" | "color.scale.magma.label" | "color.scale.magma.description" | "color.scale.inferno.label" | "color.scale.inferno.description" | "color.scale.cividis.label" | "color.scale.cividis.description" | "color.scale.turbo.label" | "color.scale.turbo.description" | "color.scale.greys.label" | "color.scale.greys.description" | "color.scale.cool-warm.label" | "color.scale.cool-warm.description" | "color.scale.blue-red.label" | "color.scale.blue-red.description" | "color.scale.rainbow.label" | "color.scale.rainbow.description" | "download.save" | "download.saveFigure" | "download.saveThisFigure" | "download.format" | "download.formatHelp" | "download.resolution" | "download.resolutionHelp" | "download.resolutionExample" | "download.noFigure" | "download.hintRasterSvg" | "download.hintSvg" | "download.hintPng" | "download.size" | "download.sizeHelp" | "download.sizeScreen" | "download.sizeColumn" | "download.sizeCustom" | "download.customSize" | "download.width" | "download.height" | "pedagogy.check" | "pedagogy.revealHint" | "pedagogy.revealHintCount" | "pedagogy.revealHintLadder" | "pedagogy.hideSolution" | "pedagogy.revealSolution" | "pedagogy.reset" | "pedagogy.hints" | "pedagogy.solvedCount" | "pedagogy.clearAll" | "pedagogy.keepAnswers" | "pedagogy.clearEverything" | "pedagogy.clearWarning" | "pedagogy.filterTerms" | "pedagogy.noTermDefined" | "pedagogy.noTermMatches" | "pedagogy.example" | "pedagogy.input" | "pedagogy.previous" | "pedagogy.next" | "pedagogy.stepOf" | "slides.exit" | "slides.previousSlide" | "slides.nextSlide" | "slides.toggleFullscreen" | "slides.backToSlides" | "slides.backToSlide" | "slides.noAddress" | "slides.liveDemos" | "slides.noTalkYet" | "overlay.options" | "overlay.whatAmILookingAt" | "overlay.reset" | "overlay.hoverAName" | "overlay.dismiss" | "delimited.copyTable" | "delimited.close" | "delimited.separator" | "delimited.save" | "delimited.copy" | "delimited.tableAsText" | "chart.measurement" | "chart.measurements" | "delimited.descriptionOne" | "delimited.descriptionMany" | "structure.guide.atom.title" | "structure.guide.atom.element" | "structure.guide.atom.group" | "structure.guide.atom.applyOrForget" | "structure.guide.atom.chain" | "structure.guide.atom.charge" | "structure.guide.atom.radical" | "structure.guide.atom.spin" | "structure.guide.atom.attachment" | "structure.guide.atom.query" | "structure.guide.atom.halogen" | "structure.guide.atom.delete" | "structure.guide.atom.note" | "structure.guide.bond.title" | "structure.guide.bond.order" | "structure.guide.bond.zeroOrder" | "structure.guide.bond.stereo" | "structure.guide.bond.unknownGeometry" | "structure.guide.bond.threeRing" | "structure.guide.bond.ring" | "structure.guide.bond.benzene" | "structure.guide.bond.query" | "structure.guide.bond.delete" | "structure.guide.anywhere.title" | "structure.guide.anywhere.undo" | "structure.guide.anywhere.copy" | "structure.guide.anywhere.paste" | "structure.guide.anywhere.deleteSelection" | "structure.guide.anywhere.flip" | "structure.guide.anywhere.help" | "structure.guide.anywhere.note" | "structure.guide.selecting.title" | "structure.guide.selecting.lasso" | "structure.guide.selecting.rectangle" | "structure.guide.selecting.add" | "structure.guide.selecting.move" | "structure.guide.selecting.duplicate" | "structure.guide.selecting.queryFeatures" | "structure.guide.selecting.note" | "structure.guide.stereochemistry.title" | "structure.guide.stereochemistry.note" | "structure.input.type" | "structure.input.or" | "structure.input.drag" | "structure.input.plusDrag" | "structure.input.dragSelection" | "structure.input.plusDragSelection" | "structure.input.doubleClick" | "structure.docs.toolsAndKeys" | "structure.docs.atomProperties" | "structure.docs.stereochemistry" | "structure.help.hoverToolbar" | "structure.help.learnMore" | "structure.mouseAndKeyboard" | "structure.tool.clear.name" | "structure.tool.clear.description" | "structure.tool.cleanUp.name" | "structure.tool.cleanUp.description" | "structure.tool.select.name" | "structure.tool.select.description" | "structure.tool.unknownConfiguration.name" | "structure.tool.unknownConfiguration.description" | "structure.tool.delete.name" | "structure.tool.delete.description" | "structure.tool.singleBond.name" | "structure.tool.singleBond.description" | "structure.tool.upBond.name" | "structure.tool.upBond.description" | "structure.tool.positiveCharge.name" | "structure.tool.positiveCharge.description" | "structure.tool.undo.name" | "structure.tool.undo.description" | "structure.tool.zoomAndRotate.name" | "structure.tool.zoomAndRotate.description" | "structure.tool.atomMapping.name" | "structure.tool.atomMapping.description" | "structure.tool.enhancedStereo.name" | "structure.tool.enhancedStereo.description" | "structure.tool.text.name" | "structure.tool.text.description" | "structure.tool.chain.name" | "structure.tool.chain.description" | "structure.tool.downBond.name" | "structure.tool.downBond.description" | "structure.tool.negativeCharge.name" | "structure.tool.negativeCharge.description" | "structure.tool.anyAtom.name" | "structure.tool.anyAtom.description" | "structure.tool.ring3.name" | "structure.tool.ring3.description" | "structure.tool.ring5.name" | "structure.tool.ring5.description" | "structure.tool.ring7.name" | "structure.tool.ring7.description" | "structure.tool.ring4.name" | "structure.tool.ring4.description" | "structure.tool.ring6.name" | "structure.tool.ring6.description" | "structure.tool.benzene.name" | "structure.tool.benzene.description" | "structure.tool.carbon.name" | "structure.tool.carbon.description" | "structure.tool.nitrogen.name" | "structure.tool.nitrogen.description" | "structure.tool.oxygen.name" | "structure.tool.oxygen.description" | "structure.tool.fluorine.name" | "structure.tool.fluorine.description" | "structure.tool.bromine.name" | "structure.tool.bromine.description" | "structure.tool.hydrogen.name" | "structure.tool.hydrogen.description" | "structure.tool.silicon.name" | "structure.tool.silicon.description" | "structure.tool.phosphorus.name" | "structure.tool.phosphorus.description" | "structure.tool.sulfur.name" | "structure.tool.sulfur.description" | "structure.tool.chlorine.name" | "structure.tool.chlorine.description" | "structure.tool.iodine.name" | "structure.tool.iodine.description" | "structure.tool.reactionOnly" | "structure.tool.unavailable" | "structure.loadingEditor" | "periodic.table" | "periodic.group" | "periodic.period" | "periodic.cellLabel" | "periodic.category.alkali-metal" | "periodic.category.alkaline-earth-metal" | "periodic.category.transition-metal" | "periodic.category.post-transition-metal" | "periodic.category.metalloid" | "periodic.category.nonmetal" | "periodic.category.halogen" | "periodic.category.noble-gas" | "periodic.category.lanthanoid" | "periodic.category.actinoid" | "molecule3d.view" | "molecule3d.resetView" | "molecule3d.spin" | "molecule3d.surface" | "molecule3d.molecularSurface" | "molecule3d.displayOptions" | "molecule3d.exportImage" | "molecule3d.measure" | "molecule3d.clearMeasurements" | "molecule3d.measurement.distance" | "molecule3d.measurement.angle" | "molecule3d.measurement.dihedral" | "molecule3d.measurementTooltip" | "molecule3d.representation.ball-and-stick" | "molecule3d.representation.spacefill" | "molecule3d.representation.stick" | "molecule3d.size" | "molecule3d.surfaceOpacity" | "molecule3d.solventProbe" | "molecule3d.solventProbeHelp" | "molecule3d.surfaceColour" | "molecule3d.colour" | "molecule3d.coloring.uniform" | "molecule3d.coloring.element" | "molecule3d.coloring.polarity" | "molecule3d.neutral" | "molecule3d.tpsaHelp" | "molecule3d.loadingViewer" | "molecule3d.couldNotDraw" | "molecule3d.gesture.rotate" | "molecule3d.gesture.rollDrag" | "molecule3d.gesture.rollKeys" | "molecule3d.gesture.moveDrag" | "molecule3d.gesture.moveCtrl" | "molecule3d.gesture.zoom" | "molecule3d.gesture.clip" | "molecule3d.gesture.centreAtom" | "molecule3d.gesture.centreMolecule" | "molecule3d.input.drag" | "molecule3d.input.plus" | "molecule3d.input.plusDrag" | "molecule3d.input.plusScroll" | "molecule3d.input.or" | "molecule3d.input.rightDrag" | "molecule3d.input.scroll" | "molecule3d.input.clickAtom" | "molecule3d.input.clickBackground" | "molecule3d.helpNote" | "orbital.couldNotDraw" | "orbital.sampling" | "orbital.showAxes" | "orbital.axesTitle" | "orbital.axesBody" | "orbital.axesExample" | "orbital.resetTitle" | "orbital.resetBody" | "viewer.capability.noWindow" | "viewer.capability.noContext" | "viewer.capability.noFloatTextures" | "viewer.capability.ready" | "conformers.strategy.adaptive-random" | "conformers.strategy.likely-random" | "conformers.strategy.pure-random" | "conformers.strategy.likely-systematic" | "conformers.strategyDetail.adaptive-random" | "conformers.strategyDetail.likely-random" | "conformers.strategyDetail.pure-random" | "conformers.strategyDetail.likely-systematic" | "conformers.minimisation.none">;
21
21
  //# sourceMappingURL=chromeCatalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chromeCatalog.d.ts","sourceRoot":"","sources":["../../../src/i18n/core/chromeCatalog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,uBAAuB,CAAuB;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAElD,qCAAqC;AACrC,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,EAAE,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,cAAc,iqZAUzB,CAAC"}
1
+ {"version":3,"file":"chromeCatalog.d.ts","sourceRoot":"","sources":["../../../src/i18n/core/chromeCatalog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,uBAAuB,CAAuB;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAElD,qCAAqC;AACrC,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,EAAE,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,cAAc,g1ZAUzB,CAAC"}
@@ -183,12 +183,20 @@
183
183
  "download.format": "Format",
184
184
  "download.formatHelp": "Ein PNG ist ein Bild der Abbildung, und das ist es, was eine Folie, ein Chatfenster oder ein Ticket annimmt. Ein SVG ist die Abbildung selbst: jede Linie bleibt scharf, wie weit man sie auch vergrößert, und sie lässt sich nachträglich bearbeiten.",
185
185
  "download.resolution": "Auflösung",
186
- "download.resolutionHelp": "Wie viele Pixel für jedes Pixel der Abbildung auf dem Bildschirm gemalt werden. Zwei passt für eine Folie, drei oder vier für den Druck. Ein SVG hat keine eigene Auflösung und wird daher in jeder Größe scharf gespeichert.",
186
+ "download.resolutionHelp": "Wie viele Male größer als die Abbildung auf dem Bildschirm die Datei ist. Ein PNG bekommt entsprechend mehr Pixel: zwei passt für eine Folie, drei oder vier für den Druck. Ein SVG bleibt in jeder Größe scharf und öffnet sich entsprechend größer.",
187
187
  "download.resolutionExample": "Eine auf dem Bildschirm 640 Pixel breite Abbildung wird 1280 Pixel breit gespeichert.",
188
188
  "download.noFigure": "Auf der Seite gibt es noch keine Abbildung zum Speichern.",
189
189
  "download.hintRasterSvg": "Ein SVG, das ein Bild von {pixels} enthält: eine 3D-Szene hat keine Vektorform.",
190
- "download.hintSvg": "Ein SVG bleibt in jeder Größe scharf, die Auflösung gilt also nicht. Gezeichnet {pixels}.",
190
+ "download.hintSvg": "Öffnet sich mit {pixels} und bleibt in jeder Größe scharf.",
191
191
  "download.hintPng": "Gespeichert {pixels}.",
192
+ "download.size": "Größe",
193
+ "download.sizeHelp": "Die Form, in der die Abbildung für die Datei gezeichnet wird. Sie wird neu gesetzt, sodass Achsen und Beschriftungen in diese Form passen, statt hineingedehnt zu werden. Eine Zeitschriftenspalte ist 8,5 cm breit, und ihr Text wird in der Größe gedruckt, in der er auf dem Bildschirm steht.",
194
+ "download.sizeScreen": "Wie angezeigt",
195
+ "download.sizeColumn": "Zeitschriftenspalte",
196
+ "download.sizeCustom": "Eigene",
197
+ "download.customSize": "Breite × Höhe",
198
+ "download.width": "Breite",
199
+ "download.height": "Höhe",
192
200
  "pedagogy.check": "Prüfen",
193
201
  "pedagogy.revealHint": "Hinweis zeigen",
194
202
  "pedagogy.revealHintCount": "Hinweis zeigen ({revealed}/{total})",
@@ -183,12 +183,20 @@
183
183
  "download.format": "Format",
184
184
  "download.formatHelp": "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.",
185
185
  "download.resolution": "Resolution",
186
- "download.resolutionHelp": "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.",
186
+ "download.resolutionHelp": "How many times the figure on screen the file is. A PNG gets that many more pixels: two is right for a slide, three or four for print. An SVG stays sharp at any size, and opens that many times larger.",
187
187
  "download.resolutionExample": "A figure 640 pixels wide on screen is saved 1280 pixels wide.",
188
188
  "download.noFigure": "There is no figure on the page to save yet.",
189
189
  "download.hintRasterSvg": "An SVG holding a picture of {pixels}: a 3D scene has no vector form.",
190
- "download.hintSvg": "An SVG stays sharp at any size, so the resolution does not apply. Drawn {pixels}.",
190
+ "download.hintSvg": "Opens at {pixels}, and stays sharp at any size.",
191
191
  "download.hintPng": "Saved {pixels}.",
192
+ "download.size": "Size",
193
+ "download.sizeHelp": "The shape the figure is drawn at for the file. It is laid out again, so the axes and labels fit that shape instead of being stretched into it. A journal column is 8.5 cm wide, and its text prints at the size it reads on screen.",
194
+ "download.sizeScreen": "As shown",
195
+ "download.sizeColumn": "Journal column",
196
+ "download.sizeCustom": "Custom",
197
+ "download.customSize": "Width × height",
198
+ "download.width": "Width",
199
+ "download.height": "Height",
192
200
  "pedagogy.check": "Check",
193
201
  "pedagogy.revealHint": "Reveal hint",
194
202
  "pedagogy.revealHintCount": "Reveal hint ({revealed}/{total})",
@@ -183,12 +183,20 @@
183
183
  "download.format": "Formato",
184
184
  "download.formatHelp": "Un PNG es una imagen de la figura, que es lo que aceptan una diapositiva, una ventana de chat o una incidencia. Un SVG es la figura misma: cada línea sigue nítida por mucho que se amplíe, y todavía puede editarse después.",
185
185
  "download.resolution": "Resolución",
186
- "download.resolutionHelp": "Cuántos píxeles se pintan por cada píxel de la figura en pantalla. Dos va bien para una diapositiva, tres o cuatro para imprimir. Un SVG no tiene resolución propia, así que se guarda nítido a cualquier tamaño.",
186
+ "download.resolutionHelp": "Cuántas veces la figura en pantalla mide el archivo. Un PNG recibe tantos píxeles más: dos sirve para una diapositiva, tres o cuatro para imprimir. Un SVG se mantiene nítido a cualquier tamaño, y se abre tantas veces más grande.",
187
187
  "download.resolutionExample": "Una figura de 640 píxeles de ancho en pantalla se guarda con 1280 píxeles de ancho.",
188
188
  "download.noFigure": "Todavía no hay ninguna figura en la página que guardar.",
189
189
  "download.hintRasterSvg": "Un SVG que contiene una imagen de {pixels}: una escena 3D no tiene forma vectorial.",
190
- "download.hintSvg": "Un SVG sigue nítido a cualquier tamaño, de modo que la resolución no se aplica. Dibujado {pixels}.",
190
+ "download.hintSvg": "Se abre a {pixels}, y se mantiene nítido a cualquier tamaño.",
191
191
  "download.hintPng": "Guardado {pixels}.",
192
+ "download.size": "Tamaño",
193
+ "download.sizeHelp": "La forma con la que se dibuja la figura para el archivo. Se vuelve a maquetar, de modo que los ejes y las etiquetas se ajustan a esa forma en lugar de estirarse. Una columna de revista mide 8,5 cm, y su texto se imprime al tamaño con que se lee en pantalla.",
194
+ "download.sizeScreen": "Como se muestra",
195
+ "download.sizeColumn": "Columna de revista",
196
+ "download.sizeCustom": "Personalizado",
197
+ "download.customSize": "Ancho × alto",
198
+ "download.width": "Ancho",
199
+ "download.height": "Alto",
192
200
  "pedagogy.check": "Comprobar",
193
201
  "pedagogy.revealHint": "Mostrar una pista",
194
202
  "pedagogy.revealHintCount": "Mostrar una pista ({revealed}/{total})",
@@ -183,12 +183,20 @@
183
183
  "download.format": "Format",
184
184
  "download.formatHelp": "Un PNG est une image de la figure, ce qu'acceptent une diapositive, une fenêtre de discussion ou un ticket. Un SVG est la figure elle-même : chaque trait reste net quel que soit l'agrandissement, et il reste modifiable ensuite.",
185
185
  "download.resolution": "Résolution",
186
- "download.resolutionHelp": "Combien de pixels sont peints pour chaque pixel de la figure à l'écran. Deux convient pour une diapositive, trois ou quatre pour l'impression. Un SVG n'a pas de résolution propre : il est enregistré net à toute taille.",
186
+ "download.resolutionHelp": "Combien de fois la figure à l'écran mesure le fichier. Un PNG reçoit d'autant plus de pixels : deux convient pour une diapositive, trois ou quatre pour l'impression. Un SVG reste net à toute taille, et s'ouvre d'autant plus grand.",
187
187
  "download.resolutionExample": "Une figure large de 640 pixels à l'écran est enregistrée large de 1280 pixels.",
188
188
  "download.noFigure": "Il n'y a encore aucune figure à enregistrer sur la page.",
189
189
  "download.hintRasterSvg": "Un SVG contenant une image de {pixels} : une scène 3D n'a pas de forme vectorielle.",
190
- "download.hintSvg": "Un SVG reste net à toute taille, la résolution ne s'applique donc pas. Dessiné {pixels}.",
190
+ "download.hintSvg": "S'ouvre à {pixels}, et reste net à toute taille.",
191
191
  "download.hintPng": "Enregistré {pixels}.",
192
+ "download.size": "Taille",
193
+ "download.sizeHelp": "La forme à laquelle la figure est dessinée pour le fichier. Elle est remise en page, si bien que les axes et les étiquettes s'ajustent à cette forme au lieu d'y être étirés. Une colonne de revue mesure 8,5 cm, et son texte s'imprime à la taille où il se lit à l'écran.",
194
+ "download.sizeScreen": "Comme affichée",
195
+ "download.sizeColumn": "Colonne de revue",
196
+ "download.sizeCustom": "Personnalisée",
197
+ "download.customSize": "Largeur × hauteur",
198
+ "download.width": "Largeur",
199
+ "download.height": "Hauteur",
192
200
  "pedagogy.check": "Vérifier",
193
201
  "pedagogy.revealHint": "Révéler un indice",
194
202
  "pedagogy.revealHintCount": "Révéler un indice ({revealed}/{total})",
@@ -1 +1 @@
1
- {"version":3,"file":"OverlayValueMenu.d.ts","sourceRoot":"","sources":["../../../src/overlay/ui/OverlayValueMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,2CAA2C;AAC3C,MAAM,WAAW,qBAAqB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM;IACnE;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,kCAAkC;IAClC,QAAQ,EAAE,CAAC,KAAK,EA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AAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,EAC7D,KAAK,EAAE,qBAAqB,CAAC,MAAM,CAAC,GACnC,YAAY,CA6Dd"}
@@ -26,7 +26,13 @@ export function OverlayValueMenu(props) {
26
26
  if (option.value === value)
27
27
  written = option.label;
28
28
  }
29
- return (_jsx(PopoverNext, { isOpen: open, disabled: disabled, placement: placement, onInteraction: (next) => setOpen(next), content: _jsxs(Menu, { role: "listbox", "aria-labelledby": headingId, size: metrics.blueprintSize, style: OVERLAY_VALUE_MENU_STYLE, children: [_jsx(MenuDivider, { title: label, titleId: headingId }), options.map((option) => (_jsx(MenuItem, { roleStructure: "listoption", selected: option.value === value, text: option.label, htmlTitle: option.title, disabled: option.disabled, onClick: () => onChange(option.value) }, option.value)))] }), children: _jsx(OverlayValueButton, { label: label, value: written, keyWord: keyWord, showKey: showKey, swatches: swatches, active: open, disabled: disabled, disabledReason: disabledReason, testId: testId, opensMenu: true }) }));
29
+ return (_jsx(PopoverNext, { isOpen: open, disabled: disabled, placement: placement, onInteraction: (next) => setOpen(next), content: _jsxs(Menu, { role: "listbox", "aria-labelledby": headingId, size: metrics.blueprintSize, style: OVERLAY_VALUE_MENU_STYLE, children: [_jsx(MenuDivider, { title: label, titleId: headingId }), options.map((option) => (_jsx(MenuItem, { roleStructure: "listoption", selected: option.value === value, text: option.label, htmlTitle: option.title, disabled: option.disabled,
30
+ // A menu opened from inside a panel would otherwise dismiss the
31
+ // panel too, taking the reader's other settings away mid-choice.
32
+ shouldDismissPopover: false, onClick: () => {
33
+ onChange(option.value);
34
+ setOpen(false);
35
+ } }, option.value)))] }), children: _jsx(OverlayValueButton, { label: label, value: written, keyWord: keyWord, showKey: showKey, swatches: swatches, active: open, disabled: disabled, disabledReason: disabledReason, testId: testId, opensMenu: true }) }));
30
36
  }
31
37
  /**
32
38
  * The menu the value opens.
@@ -1 +1 @@
1
- {"version":3,"file":"OverlayValueMenu.js","sourceRoot":"","sources":["../../../src/overlay/ui/OverlayValueMenu.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAuDxD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAoC;IAEpC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACpE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAC7D,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACnD,MAAM,EAAE,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAAC;IACxC,MAAM,SAAS,GAAG,KAAK,EAAE,CAAC;IAC1B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExC,IAAI,OAAO,GAAW,KAAK,CAAC;IAC5B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,KAAK,KA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qBACG,SAAS,EAC1B,IAAI,EAAE,OAAO,CAAC,aAAa,EAC3B,KAAK,EAAE,wBAAwB,aAE/B,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,GAAI,EAChD,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,KAAC,QAAQ,IAEP,aAAa,EAAC,YAAY,EAC1B,QAAQ,EAAE,MAAM,CAAC,KAAK,KAAK,KAAK,EAChC,IAAI,EAAE,MAAM,CAAC,KAAK,EAClB,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;oBACzB,gEAAgE;oBAChE,iEAAiE;oBACjE,oBAAoB,EAAE,KAAK,EAC3B,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;wBACvB,OAAO,CAAC,KAAK,CAAC,CAAC;oBACjB,CAAC,IAZI,MAAM,CAAC,KAAK,CAajB,CACH,CAAC,IACG,YAGT,KAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,EACd,SAAS,SACT,GACU,CACf,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,wBAAwB,GAAkB;IAC9C,QAAQ,EAAE,GAAG;CACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-cheminfo",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "license": "MIT",
5
5
  "description": "React components, hooks and framework-free helpers shared by the cheminfo sites: site chrome, citations, sharing, routing, pedagogy, charts, and the structure, orbital and 3D molecule viewers",
6
6
  "author": "Luc Patiny",
@@ -4,13 +4,13 @@
4
4
  * Which of the two formats a reader wants is not a question the figure can
5
5
  * answer for them: an SVG is the one to put in a paper, where it stays sharp
6
6
  * at any size and can still be edited, and a PNG is the one every chat window,
7
- * slide deck and issue tracker actually accepts. So both are offered, and the
8
- * resolution goes with the second.
7
+ * slide deck and issue tracker actually accepts. So both are offered. The
8
+ * resolution paints a PNG with more pixels, and makes an SVG open larger.
9
9
  */
10
10
 
11
11
  import { downloadBlob } from './downloadBlob.ts';
12
12
  import { figurePng } from './figurePng.ts';
13
- import { DEFAULT_FIGURE_SCALE } from './figureScale.ts';
13
+ import { defaultFigureScale } from './figureScale.ts';
14
14
  import type { FigureSvgOptions } from './figureSvg.ts';
15
15
  import { FIGURE_SVG_TYPE, figureSvg } from './figureSvg.ts';
16
16
  import { sanitizeFileName } from './sanitizeFileName.ts';
@@ -26,9 +26,11 @@ export interface DownloadFigureOptions extends FigureSvgOptions {
26
26
  */
27
27
  format?: FigureFormat;
28
28
  /**
29
- * How many pixels are painted per pixel on screen. An SVG ignores it: it
30
- * carries no resolution of its own.
31
- * @default 2
29
+ * How many pixels are painted per pixel on screen. An SVG is drawn the same
30
+ * and opens this many times larger, which is the size a slide or a word
31
+ * processor places it at.
32
+ * @default 2 for a PNG, 1 for an SVG — which then opens at the size it has
33
+ * on screen
32
34
  */
33
35
  scale?: number;
34
36
  /**
@@ -51,16 +53,17 @@ export async function downloadFigure(
51
53
  target: string | Element,
52
54
  options: DownloadFigureOptions = {},
53
55
  ): Promise<void> {
54
- const { format = 'png', scale = DEFAULT_FIGURE_SCALE } = options;
55
- const { fileName = DEFAULT_FILE_NAME, background } = options;
56
+ const { format = 'png', fileName = DEFAULT_FILE_NAME, background } = options;
57
+ const scale = options.scale ?? defaultFigureScale(format);
56
58
 
57
- const figure = figureSvg(target, { background });
58
59
  const name = sanitizeFileName(fileName, DEFAULT_FILE_NAME);
59
60
 
60
61
  if (format === 'svg') {
62
+ const figure = figureSvg(target, { background, scale });
61
63
  const blob = new Blob([figure.markup], { type: FIGURE_SVG_TYPE });
62
64
  downloadBlob(blob, `${name}.svg`);
63
65
  return;
64
66
  }
67
+ const figure = figureSvg(target, { background });
65
68
  downloadBlob(await figurePng(figure, scale), `${name}.png`);
66
69
  }
@@ -0,0 +1,114 @@
1
+ /**
2
+ * The shape a figure is drawn at before it is saved.
3
+ *
4
+ * A saved figure is the drawing the reader is looking at, so its proportions
5
+ * are the proportions of the box it sits in. The resolution scales that
6
+ * drawing — more pixels for a PNG, a larger page for an SVG — but leaves its
7
+ * shape, and the size of its words against its axes, exactly as they were. A
8
+ * figure for a slide or for a journal column wants another shape, and the only
9
+ * way to give it one is to draw it again at that size, so its axes and labels
10
+ * are laid out for the new box rather than stretched into it.
11
+ */
12
+
13
+ import type { FigurePixels } from './figureScale.ts';
14
+
15
+ /** The shapes a figure can be drawn at for a file. */
16
+ export type FigureLayout = 'screen' | 'standard' | 'wide' | 'column' | 'custom';
17
+
18
+ /** The shapes, in the order they are offered. */
19
+ export const FIGURE_LAYOUTS = [
20
+ 'screen',
21
+ 'standard',
22
+ 'wide',
23
+ 'column',
24
+ 'custom',
25
+ ] as const satisfies readonly FigureLayout[];
26
+
27
+ /**
28
+ * How wide a journal's single column is, in CSS pixels: 8.5 cm at 96 pixels
29
+ * per inch. A figure laid out at that width prints its text at the size it is
30
+ * read at on screen, a 12 px label becoming a 9 pt one.
31
+ */
32
+ export const FIGURE_COLUMN_WIDTH = 321;
33
+
34
+ /** The narrowest side a figure is drawn at, below which no chart has room for its axes. */
35
+ export const FIGURE_LAYOUT_MIN = 120;
36
+
37
+ /** The widest side a figure is drawn at: past it the page would be laying out a poster. */
38
+ export const FIGURE_LAYOUT_MAX = 4096;
39
+
40
+ /**
41
+ * The size a figure is drawn at, in the shape the reader picked.
42
+ *
43
+ * The two slide shapes keep the width of the figure on screen and change its
44
+ * height, since the width is what a page already gave it. The journal column
45
+ * does the reverse: its width is fixed by the journal, and the figure keeps
46
+ * the proportions it has on screen.
47
+ * @param layout - The shape picked.
48
+ * @param screen - The figure as it is drawn on the page.
49
+ * @param custom - The size typed in, read only for `custom`. Defaults to the
50
+ * figure on screen.
51
+ * @returns The size to draw it at, in whole pixels.
52
+ */
53
+ export function figureLayoutSize(
54
+ layout: FigureLayout,
55
+ screen: FigurePixels,
56
+ custom: FigurePixels = screen,
57
+ ): FigurePixels {
58
+ switch (layout) {
59
+ case 'standard':
60
+ return sized(screen.width, (screen.width * 3) / 4);
61
+ case 'wide':
62
+ return sized(screen.width, (screen.width * 9) / 16);
63
+ case 'column':
64
+ return sized(
65
+ FIGURE_COLUMN_WIDTH,
66
+ (FIGURE_COLUMN_WIDTH * screen.height) / Math.max(screen.width, 1),
67
+ );
68
+ case 'custom':
69
+ return sized(custom.width, custom.height);
70
+ case 'screen':
71
+ return { width: screen.width, height: screen.height };
72
+ default:
73
+ throw new Error(`unknown figure layout: ${String(layout)}`);
74
+ }
75
+ }
76
+
77
+ /**
78
+ * One side, held to the range a figure can be drawn at.
79
+ * @param value - What was asked for, typed or computed.
80
+ * @returns A whole number of pixels, inside the range.
81
+ */
82
+ export function figureLayoutSide(value: number): number {
83
+ if (!Number.isFinite(value)) return FIGURE_LAYOUT_MIN;
84
+ return Math.min(
85
+ FIGURE_LAYOUT_MAX,
86
+ Math.max(FIGURE_LAYOUT_MIN, Math.round(value)),
87
+ );
88
+ }
89
+
90
+ /**
91
+ * Whether a figure is drawn again for the file, rather than copied as it is.
92
+ * @param layout - The shape picked.
93
+ * @param screen - The figure as it is drawn on the page.
94
+ * @param custom - The size typed in.
95
+ * @returns Whether the size differs from the one on screen.
96
+ */
97
+ export function figureLayoutRedraws(
98
+ layout: FigureLayout,
99
+ screen: FigurePixels,
100
+ custom?: FigurePixels,
101
+ ): boolean {
102
+ const drawn = figureLayoutSize(layout, screen, custom);
103
+ return drawn.width !== screen.width || drawn.height !== screen.height;
104
+ }
105
+
106
+ /**
107
+ * A size, both sides held to the range.
108
+ * @param width - The width asked for.
109
+ * @param height - The height asked for.
110
+ * @returns The size.
111
+ */
112
+ function sized(width: number, height: number): FigurePixels {
113
+ return { width: figureLayoutSide(width), height: figureLayoutSide(height) };
114
+ }
@@ -8,6 +8,8 @@
8
8
  * to work it out.
9
9
  */
10
10
 
11
+ import type { FigureFormat } from './downloadFigure.ts';
12
+
11
13
  /** The size of a saved figure, in pixels. */
12
14
  export interface FigurePixels {
13
15
  /** Its width. */
@@ -28,6 +30,17 @@ export const FIGURE_SCALES: readonly number[] = [1, 2, 3, 4];
28
30
  */
29
31
  export const DEFAULT_FIGURE_SCALE = 2;
30
32
 
33
+ /**
34
+ * The multiple a figure is saved at in this format unless the reader says
35
+ * otherwise. An SVG stays sharp however large it is shown, so it opens at the
36
+ * size it has on screen; a PNG is painted twice over, for a slide.
37
+ * @param format - The file being written.
38
+ * @returns The multiple.
39
+ */
40
+ export function defaultFigureScale(format: FigureFormat): number {
41
+ return format === 'svg' ? 1 : DEFAULT_FIGURE_SCALE;
42
+ }
43
+
31
44
  /**
32
45
  * The longest side a browser will paint into one canvas.
33
46
  *