react-cheminfo 0.30.0 → 0.32.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 (127) hide show
  1. package/README.md +21 -0
  2. package/lib/core.d.ts +1 -0
  3. package/lib/core.d.ts.map +1 -1
  4. package/lib/core.js +1 -0
  5. package/lib/core.js.map +1 -1
  6. package/lib/download/core/downloadFigure.d.ts +7 -5
  7. package/lib/download/core/downloadFigure.d.ts.map +1 -1
  8. package/lib/download/core/downloadFigure.js +7 -6
  9. package/lib/download/core/downloadFigure.js.map +1 -1
  10. package/lib/download/core/figureLayout.d.ts +55 -0
  11. package/lib/download/core/figureLayout.d.ts.map +1 -0
  12. package/lib/download/core/figureLayout.js +89 -0
  13. package/lib/download/core/figureLayout.js.map +1 -0
  14. package/lib/download/core/figureScale.d.ts +9 -0
  15. package/lib/download/core/figureScale.d.ts.map +1 -1
  16. package/lib/download/core/figureScale.js +10 -0
  17. package/lib/download/core/figureScale.js.map +1 -1
  18. package/lib/download/core/figureSettle.d.ts +51 -0
  19. package/lib/download/core/figureSettle.d.ts.map +1 -0
  20. package/lib/download/core/figureSettle.js +81 -0
  21. package/lib/download/core/figureSettle.js.map +1 -0
  22. package/lib/download/core/figureSvg.d.ts +7 -1
  23. package/lib/download/core/figureSvg.d.ts.map +1 -1
  24. package/lib/download/core/figureSvg.js +1 -0
  25. package/lib/download/core/figureSvg.js.map +1 -1
  26. package/lib/download/core/figureSvgDocument.d.ts +7 -0
  27. package/lib/download/core/figureSvgDocument.d.ts.map +1 -1
  28. package/lib/download/core/figureSvgDocument.js +11 -2
  29. package/lib/download/core/figureSvgDocument.js.map +1 -1
  30. package/lib/download/core/index.d.ts +5 -1
  31. package/lib/download/core/index.d.ts.map +1 -1
  32. package/lib/download/core/index.js +3 -1
  33. package/lib/download/core/index.js.map +1 -1
  34. package/lib/download/ui/FigureDownload.d.ts +18 -4
  35. package/lib/download/ui/FigureDownload.d.ts.map +1 -1
  36. package/lib/download/ui/FigureDownload.js +35 -9
  37. package/lib/download/ui/FigureDownload.js.map +1 -1
  38. package/lib/download/ui/FigureDownloadPanel.d.ts +17 -7
  39. package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
  40. package/lib/download/ui/FigureDownloadPanel.js +30 -22
  41. package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
  42. package/lib/download/ui/FigureSizeField.d.ts +27 -0
  43. package/lib/download/ui/FigureSizeField.d.ts.map +1 -0
  44. package/lib/download/ui/FigureSizeField.js +87 -0
  45. package/lib/download/ui/FigureSizeField.js.map +1 -0
  46. package/lib/download/ui/FigureSizeRows.d.ts +34 -0
  47. package/lib/download/ui/FigureSizeRows.d.ts.map +1 -0
  48. package/lib/download/ui/FigureSizeRows.js +54 -0
  49. package/lib/download/ui/FigureSizeRows.js.map +1 -0
  50. package/lib/download/ui/index.d.ts +2 -0
  51. package/lib/download/ui/index.d.ts.map +1 -1
  52. package/lib/download/ui/index.js.map +1 -1
  53. package/lib/download/ui/useFigureRedraw.d.ts +27 -0
  54. package/lib/download/ui/useFigureRedraw.d.ts.map +1 -0
  55. package/lib/download/ui/useFigureRedraw.js +78 -0
  56. package/lib/download/ui/useFigureRedraw.js.map +1 -0
  57. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  58. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  59. package/lib/locales/de.json +13 -3
  60. package/lib/locales/en.json +13 -3
  61. package/lib/locales/es.json +13 -3
  62. package/lib/locales/fr.json +13 -3
  63. package/lib/number/core/index.d.ts +2 -0
  64. package/lib/number/core/index.d.ts.map +1 -0
  65. package/lib/number/core/index.js +2 -0
  66. package/lib/number/core/index.js.map +1 -0
  67. package/lib/number/core/numberText.d.ts +46 -0
  68. package/lib/number/core/numberText.d.ts.map +1 -0
  69. package/lib/number/core/numberText.js +88 -0
  70. package/lib/number/core/numberText.js.map +1 -0
  71. package/lib/number/ui/NumberInput.d.ts +113 -0
  72. package/lib/number/ui/NumberInput.d.ts.map +1 -0
  73. package/lib/number/ui/NumberInput.js +100 -0
  74. package/lib/number/ui/NumberInput.js.map +1 -0
  75. package/lib/number/ui/index.d.ts +3 -0
  76. package/lib/number/ui/index.d.ts.map +1 -0
  77. package/lib/number/ui/index.js +2 -0
  78. package/lib/number/ui/index.js.map +1 -0
  79. package/lib/overlay/ui/OverlayValueMenu.d.ts.map +1 -1
  80. package/lib/overlay/ui/OverlayValueMenu.js +7 -1
  81. package/lib/overlay/ui/OverlayValueMenu.js.map +1 -1
  82. package/lib/periodic/ui/ElementCell.d.ts +10 -0
  83. package/lib/periodic/ui/ElementCell.d.ts.map +1 -1
  84. package/lib/periodic/ui/ElementCell.js +124 -14
  85. package/lib/periodic/ui/ElementCell.js.map +1 -1
  86. package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -1
  87. package/lib/periodic/ui/PeriodicTable.js +46 -19
  88. package/lib/periodic/ui/PeriodicTable.js.map +1 -1
  89. package/lib/periodic/ui/PeriodicTableChrome.js +2 -2
  90. package/lib/periodic/ui/PeriodicTableChrome.js.map +1 -1
  91. package/lib/spectra/ui/NumberField.d.ts +2 -5
  92. package/lib/spectra/ui/NumberField.d.ts.map +1 -1
  93. package/lib/spectra/ui/NumberField.js +4 -54
  94. package/lib/spectra/ui/NumberField.js.map +1 -1
  95. package/lib/ui.d.ts +1 -0
  96. package/lib/ui.d.ts.map +1 -1
  97. package/lib/ui.js +1 -0
  98. package/lib/ui.js.map +1 -1
  99. package/package.json +1 -1
  100. package/src/core.ts +1 -0
  101. package/src/download/core/downloadFigure.ts +12 -9
  102. package/src/download/core/figureLayout.ts +114 -0
  103. package/src/download/core/figureScale.ts +13 -0
  104. package/src/download/core/figureSettle.ts +112 -0
  105. package/src/download/core/figureSvg.ts +8 -1
  106. package/src/download/core/figureSvgDocument.ts +19 -2
  107. package/src/download/core/index.ts +13 -0
  108. package/src/download/ui/FigureDownload.tsx +88 -35
  109. package/src/download/ui/FigureDownloadPanel.tsx +45 -22
  110. package/src/download/ui/FigureSizeField.tsx +153 -0
  111. package/src/download/ui/FigureSizeRows.tsx +108 -0
  112. package/src/download/ui/index.ts +2 -0
  113. package/src/download/ui/useFigureRedraw.tsx +115 -0
  114. package/src/locales/de.json +13 -3
  115. package/src/locales/en.json +13 -3
  116. package/src/locales/es.json +13 -3
  117. package/src/locales/fr.json +13 -3
  118. package/src/number/core/index.ts +6 -0
  119. package/src/number/core/numberText.ts +91 -0
  120. package/src/number/ui/NumberInput.tsx +300 -0
  121. package/src/number/ui/index.ts +7 -0
  122. package/src/overlay/ui/OverlayValueMenu.tsx +7 -1
  123. package/src/periodic/ui/ElementCell.tsx +153 -14
  124. package/src/periodic/ui/PeriodicTable.tsx +51 -22
  125. package/src/periodic/ui/PeriodicTableChrome.tsx +2 -2
  126. package/src/spectra/ui/NumberField.tsx +11 -58
  127. package/src/ui.ts +1 -0
@@ -0,0 +1,54 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useChromeT } from "../../i18n/ui/useT.js";
3
+ import { OverlaySelect } from "../../overlay/ui/OverlaySelect.js";
4
+ import { FIGURE_LAYOUTS, figureLayoutSize } from "../core/figureLayout.js";
5
+ import { formatFigurePixels } from "../core/figureScale.js";
6
+ import { FigureSizeField } from "./FigureSizeField.js";
7
+ /**
8
+ * The shape the figure is drawn at, and the two sides of a custom one.
9
+ *
10
+ * Each shape says the pixels it would produce, so choosing `16:9` for a figure
11
+ * already close to it is visibly a choice that changes little.
12
+ * @param props - See {@link FigureSizeRowsProps}.
13
+ * @returns The rows.
14
+ */
15
+ export function FigureSizeRows(props) {
16
+ const { sizing, size } = props;
17
+ const { layout, custom, onLayoutChange, onCustomChange } = sizing;
18
+ const t = useChromeT();
19
+ const options = [];
20
+ for (const shape of FIGURE_LAYOUTS) {
21
+ options.push({
22
+ value: shape,
23
+ label: layoutLabel(shape, t),
24
+ title: size === null
25
+ ? undefined
26
+ : formatFigurePixels(figureLayoutSize(shape, size, custom ?? size)),
27
+ });
28
+ }
29
+ return (_jsxs(_Fragment, { children: [_jsx(OverlaySelect, { label: t('download.size'), help: { title: t('download.size'), body: t('download.sizeHelp') }, value: layout, options: options, disabled: size === null, onChange: onLayoutChange }), layout === 'custom' && size !== null ? (_jsx(FigureSizeField, { label: t('download.customSize'), widthLabel: t('download.width'), heightLabel: t('download.height'), value: figureLayoutSize('custom', size, custom ?? size), onChange: onCustomChange })) : null] }));
30
+ }
31
+ /**
32
+ * What a shape reads in the picker. A ratio is written as a ratio in every
33
+ * language.
34
+ * @param layout - The shape.
35
+ * @param t - The chrome's formatter.
36
+ * @returns Its label.
37
+ */
38
+ function layoutLabel(layout, t) {
39
+ switch (layout) {
40
+ case 'standard':
41
+ return '4:3';
42
+ case 'wide':
43
+ return '16:9';
44
+ case 'column':
45
+ return t('download.sizeColumn');
46
+ case 'custom':
47
+ return t('download.sizeCustom');
48
+ case 'screen':
49
+ return t('download.sizeScreen');
50
+ default:
51
+ throw new Error(`unknown figure layout: ${String(layout)}`);
52
+ }
53
+ }
54
+ //# sourceMappingURL=FigureSizeRows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FigureSizeRows.js","sourceRoot":"","sources":["../../../src/download/ui/FigureSizeRows.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAoC,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AAyBxD;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,MAAM,EAA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Q,MAAM,EAAE,CAAC;QACf,KAAK,UAAU;YACb,OAAO,KAAK,CAAC;QACf,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,qBAAqB,CAAC,CAAC;QAClC,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,qBAAqB,CAAC,CAAC;QAClC,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,qBAAqB,CAAC,CAAC;QAClC;YACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC;AACH,CAAC"}
@@ -10,6 +10,8 @@ export type { FigureDownloadProps } from './FigureDownload.tsx';
10
10
  export { FigureDownload } from './FigureDownload.tsx';
11
11
  export type { FigureDownloadPanelProps } from './FigureDownloadPanel.tsx';
12
12
  export { FigureDownloadPanel } from './FigureDownloadPanel.tsx';
13
+ export type { FigureSizing } from './FigureSizeRows.tsx';
14
+ export type { FigureRenderer } from './useFigureRedraw.tsx';
13
15
  export type { ExportDialogFrameProps } from './ExportDialogFrame.tsx';
14
16
  export { ExportDialogFrame } from './ExportDialogFrame.tsx';
15
17
  export type { ExportImageDialogProps } from './ExportImageDialog.tsx';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/download/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,sBAAsB,EAAE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EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -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,GAAG,GAAG,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC;QAC1D,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,aAAa,CAAC,OAAO,GAAG,UAAU,CAAC;QACnC,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,C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AAU;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" | "number.increment" | "number.decrement">;
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,03ZAUzB,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})",
@@ -441,5 +449,7 @@
441
449
  "molecule3d.input.scroll": "Scrollen",
442
450
  "molecule3d.input.clickAtom": "Ein Atom anklicken",
443
451
  "molecule3d.input.clickBackground": "Den Hintergrund anklicken",
444
- "molecule3d.helpNote": "Die Tasten wirken, solange der Zeiger über dem Molekül ist. Auf dem Mac ist Ctrl die Control-Taste, nicht ⌘. Bei eingeschaltetem Messwerkzeug wählt ein Klick ein Atom."
452
+ "molecule3d.helpNote": "Die Tasten wirken, solange der Zeiger über dem Molekül ist. Auf dem Mac ist Ctrl die Control-Taste, nicht ⌘. Bei eingeschaltetem Messwerkzeug wählt ein Klick ein Atom.",
453
+ "number.increment": "Erhöhen",
454
+ "number.decrement": "Verringern"
445
455
  }
@@ -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})",
@@ -441,5 +449,7 @@
441
449
  "conformers.strategyDetail.likely-random": "Draws torsions at random from the torsion database, weighted by how often each angle is seen in crystal structures.",
442
450
  "conformers.strategyDetail.pure-random": "Draws every torsion uniformly at random, ignoring how likely the angle is — the widest spread and the least realistic set.",
443
451
  "conformers.strategyDetail.likely-systematic": "Walks the torsion combinations in decreasing likelihood, so the first conformers are the most probable ones and the set is reproducible.",
444
- "conformers.minimisation.none": "None (no energies)"
452
+ "conformers.minimisation.none": "None (no energies)",
453
+ "number.increment": "Increase",
454
+ "number.decrement": "Decrease"
445
455
  }
@@ -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})",
@@ -441,5 +449,7 @@
441
449
  "molecule3d.input.scroll": "Rueda",
442
450
  "molecule3d.input.clickAtom": "Hacer clic en un átomo",
443
451
  "molecule3d.input.clickBackground": "Hacer clic en el fondo",
444
- "molecule3d.helpNote": "Las teclas actúan mientras el puntero está sobre la molécula. En un Mac, Ctrl es la tecla Control, no ⌘. Con una herramienta de medida activa, un clic elige un átomo."
452
+ "molecule3d.helpNote": "Las teclas actúan mientras el puntero está sobre la molécula. En un Mac, Ctrl es la tecla Control, no ⌘. Con una herramienta de medida activa, un clic elige un átomo.",
453
+ "number.increment": "Aumentar",
454
+ "number.decrement": "Disminuir"
445
455
  }
@@ -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})",
@@ -441,5 +449,7 @@
441
449
  "molecule3d.input.scroll": "Molette",
442
450
  "molecule3d.input.clickAtom": "Cliquer un atome",
443
451
  "molecule3d.input.clickBackground": "Cliquer le fond",
444
- "molecule3d.helpNote": "Les touches agissent tant que le pointeur est sur la molécule. Sur un Mac, Ctrl est la touche Contrôle, pas ⌘. Avec un outil de mesure actif, un clic choisit un atome."
452
+ "molecule3d.helpNote": "Les touches agissent tant que le pointeur est sur la molécule. Sur un Mac, Ctrl est la touche Contrôle, pas ⌘. Avec un outil de mesure actif, un clic choisit un atome.",
453
+ "number.increment": "Augmenter",
454
+ "number.decrement": "Diminuer"
445
455
  }
@@ -0,0 +1,2 @@
1
+ export { isPartialNumber, numberText, readNumber, stepNumber, } from './numberText.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/number/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,GACX,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { isPartialNumber, numberText, readNumber, stepNumber, } from "./numberText.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/number/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,GACX,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The number a box of text reads as, and the text a number is shown with.
3
+ *
4
+ * A box that hands its text straight to `Number` is a box nobody can type a
5
+ * decimal into: `0.` reads as `0`, and a control rendered from that number
6
+ * writes `0` back over the dot before the next keystroke arrives. So the text
7
+ * and the number are two values here, and the text is the one the reader owns.
8
+ */
9
+ /**
10
+ * The number some text reads as.
11
+ *
12
+ * A decimal comma is read as a decimal point, because a keyboard laid out for
13
+ * French or German puts a comma where the number pad's decimal key is and a
14
+ * reader typing `0,2` means two tenths.
15
+ * @param text - What is in the box.
16
+ * @param integer - Whether only whole numbers are wanted. Defaults to `false`.
17
+ * @returns The number, or undefined while the text does not read as one.
18
+ */
19
+ export declare function readNumber(text: string, integer?: boolean): number | undefined;
20
+ /**
21
+ * Whether the text can still become a number as more is typed.
22
+ *
23
+ * `0.`, `-` and `1e-` are all on the way to a number and must not be reported
24
+ * as mistakes; `0.2x` is not, and a box may say so while it is being typed.
25
+ * @param text - What is in the box.
26
+ * @returns Whether anything typed so far rules a number out.
27
+ */
28
+ export declare function isPartialNumber(text: string): boolean;
29
+ /**
30
+ * The text a number is shown with.
31
+ * @param value - The number, or nothing when the box is empty.
32
+ * @returns Its text, empty when there is no number.
33
+ */
34
+ export declare function numberText(value: number | undefined): string;
35
+ /**
36
+ * A number moved by one press of an arrow key or a stepper button.
37
+ *
38
+ * The result is rounded to the decimals the two operands carry, so stepping
39
+ * `0.1` up by `0.2` lands on `0.3` rather than on `0.30000000000000004` — a
40
+ * value that is then shown, shared in a link and stored in full.
41
+ * @param value - Where the box is now.
42
+ * @param delta - What the press adds; negative going down.
43
+ * @returns The number the box moves to.
44
+ */
45
+ export declare function stepNumber(value: number, delta: number): number;
46
+ //# sourceMappingURL=numberText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numberText.d.ts","sourceRoot":"","sources":["../../../src/number/core/numberText.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,MAAM,GAAG,SAAS,CAO5E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGrD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM/D"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * The number a box of text reads as, and the text a number is shown with.
3
+ *
4
+ * A box that hands its text straight to `Number` is a box nobody can type a
5
+ * decimal into: `0.` reads as `0`, and a control rendered from that number
6
+ * writes `0` back over the dot before the next keystroke arrives. So the text
7
+ * and the number are two values here, and the text is the one the reader owns.
8
+ */
9
+ /** Text that reads as a finite number, comma or dot. */
10
+ const NUMBER = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
11
+ /** Text a reader is partway through: `-`, `0.`, `1e`, `1e-`, or empty. */
12
+ const PARTIAL = /^[+-]?(?:\d+(?:\.\d*)?|\.\d*)(?:e[+-]?\d*)?$/i;
13
+ /** A sign on its own, which is where typing a negative number starts. */
14
+ const SIGN = /^[+-]?$/;
15
+ /** Decimals `roundTo` can keep, and the most a step is rounded to. */
16
+ const MAXIMUM_DECIMALS = 15;
17
+ /**
18
+ * The number some text reads as.
19
+ *
20
+ * A decimal comma is read as a decimal point, because a keyboard laid out for
21
+ * French or German puts a comma where the number pad's decimal key is and a
22
+ * reader typing `0,2` means two tenths.
23
+ * @param text - What is in the box.
24
+ * @param integer - Whether only whole numbers are wanted. Defaults to `false`.
25
+ * @returns The number, or undefined while the text does not read as one.
26
+ */
27
+ export function readNumber(text, integer = false) {
28
+ const trimmed = text.trim().replace(',', '.');
29
+ if (!NUMBER.test(trimmed))
30
+ return undefined;
31
+ const parsed = Number(trimmed);
32
+ if (!Number.isFinite(parsed))
33
+ return undefined;
34
+ if (integer && !Number.isInteger(parsed))
35
+ return undefined;
36
+ return parsed;
37
+ }
38
+ /**
39
+ * Whether the text can still become a number as more is typed.
40
+ *
41
+ * `0.`, `-` and `1e-` are all on the way to a number and must not be reported
42
+ * as mistakes; `0.2x` is not, and a box may say so while it is being typed.
43
+ * @param text - What is in the box.
44
+ * @returns Whether anything typed so far rules a number out.
45
+ */
46
+ export function isPartialNumber(text) {
47
+ const trimmed = text.trim().replace(',', '.');
48
+ return SIGN.test(trimmed) || PARTIAL.test(trimmed);
49
+ }
50
+ /**
51
+ * The text a number is shown with.
52
+ * @param value - The number, or nothing when the box is empty.
53
+ * @returns Its text, empty when there is no number.
54
+ */
55
+ export function numberText(value) {
56
+ return value === undefined || !Number.isFinite(value) ? '' : String(value);
57
+ }
58
+ /**
59
+ * A number moved by one press of an arrow key or a stepper button.
60
+ *
61
+ * The result is rounded to the decimals the two operands carry, so stepping
62
+ * `0.1` up by `0.2` lands on `0.3` rather than on `0.30000000000000004` — a
63
+ * value that is then shown, shared in a link and stored in full.
64
+ * @param value - Where the box is now.
65
+ * @param delta - What the press adds; negative going down.
66
+ * @returns The number the box moves to.
67
+ */
68
+ export function stepNumber(value, delta) {
69
+ const decimals = Math.max(decimalsOf(value), decimalsOf(delta));
70
+ const moved = value + delta;
71
+ if (decimals === 0)
72
+ return moved;
73
+ const factor = 10 ** decimals;
74
+ return Math.round(moved * factor) / factor;
75
+ }
76
+ /**
77
+ * How many decimals a number is written with.
78
+ * @param value - The number.
79
+ * @returns Its count of decimals, `0` for anything written in exponent form.
80
+ */
81
+ function decimalsOf(value) {
82
+ const text = String(Math.abs(value));
83
+ const dot = text.indexOf('.');
84
+ if (dot === -1 || text.includes('e'))
85
+ return 0;
86
+ return Math.min(text.length - dot - 1, MAXIMUM_DECIMALS);
87
+ }
88
+ //# sourceMappingURL=numberText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numberText.js","sourceRoot":"","sources":["../../../src/number/core/numberText.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wDAAwD;AACxD,MAAM,MAAM,GAAG,+CAA+C,CAAC;AAE/D,0EAA0E;AAC1E,MAAM,OAAO,GAAG,+CAA+C,CAAC;AAEhE,yEAAyE;AACzE,MAAM,IAAI,GAAG,SAAS,CAAC;AAEvB,sEAAsE;AACtE,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,OAAO,GAAG,KAAK;IACtD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/C,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACrD,CAAC;A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