react-cheminfo 0.33.0 → 0.35.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.
- package/README.md +28 -28
- package/lib/about/core/about.d.ts +1 -30
- package/lib/about/core/about.d.ts.map +1 -1
- package/lib/about/core/about.js +0 -16
- package/lib/about/core/about.js.map +1 -1
- package/lib/about/core/index.d.ts +0 -1
- package/lib/about/core/index.d.ts.map +1 -1
- package/lib/about/core/index.js +0 -1
- package/lib/about/core/index.js.map +1 -1
- package/lib/about/ui/AboutBuild.d.ts +2 -5
- package/lib/about/ui/AboutBuild.d.ts.map +1 -1
- package/lib/about/ui/AboutBuild.js +7 -19
- package/lib/about/ui/AboutBuild.js.map +1 -1
- package/lib/about/ui/AboutPage.d.ts +2 -2
- package/lib/about/ui/AboutPage.d.ts.map +1 -1
- package/lib/about/ui/AboutPage.js +3 -14
- package/lib/about/ui/AboutPage.js.map +1 -1
- package/lib/about/ui/AboutVersion.d.ts +0 -4
- package/lib/about/ui/AboutVersion.d.ts.map +1 -1
- package/lib/about/ui/AboutVersion.js +3 -31
- package/lib/about/ui/AboutVersion.js.map +1 -1
- package/lib/axis/core/axisMarks.d.ts +54 -0
- package/lib/axis/core/axisMarks.d.ts.map +1 -0
- package/lib/axis/core/axisMarks.js +69 -0
- package/lib/axis/core/axisMarks.js.map +1 -0
- package/lib/axis/core/axisScale.d.ts +31 -0
- package/lib/axis/core/axisScale.d.ts.map +1 -0
- package/lib/axis/core/axisScale.js +31 -0
- package/lib/axis/core/axisScale.js.map +1 -0
- package/lib/axis/core/index.d.ts +16 -0
- package/lib/axis/core/index.d.ts.map +1 -0
- package/lib/axis/core/index.js +13 -0
- package/lib/axis/core/index.js.map +1 -0
- package/lib/axis/core/logAxisBounds.d.ts +78 -0
- package/lib/axis/core/logAxisBounds.d.ts.map +1 -0
- package/lib/axis/core/logAxisBounds.js +129 -0
- package/lib/axis/core/logAxisBounds.js.map +1 -0
- package/lib/axis/ui/AxisScaleControl.d.ts +66 -0
- package/lib/axis/ui/AxisScaleControl.d.ts.map +1 -0
- package/lib/axis/ui/AxisScaleControl.js +26 -0
- package/lib/axis/ui/AxisScaleControl.js.map +1 -0
- package/lib/axis/ui/index.d.ts +6 -0
- package/lib/axis/ui/index.d.ts.map +1 -0
- package/lib/axis/ui/index.js +5 -0
- package/lib/axis/ui/index.js.map +1 -0
- package/lib/core.d.ts +1 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +1 -0
- package/lib/core.js.map +1 -1
- package/lib/delimited/core/index.d.ts +2 -0
- package/lib/delimited/core/index.d.ts.map +1 -1
- package/lib/delimited/core/index.js +1 -0
- package/lib/delimited/core/index.js.map +1 -1
- package/lib/delimited/core/tableRows.d.ts +49 -0
- package/lib/delimited/core/tableRows.d.ts.map +1 -0
- package/lib/delimited/core/tableRows.js +63 -0
- package/lib/delimited/core/tableRows.js.map +1 -0
- package/lib/delimited/ui/DelimitedTextPanel.d.ts +9 -0
- package/lib/delimited/ui/DelimitedTextPanel.d.ts.map +1 -1
- package/lib/delimited/ui/DelimitedTextPanel.js +3 -2
- package/lib/delimited/ui/DelimitedTextPanel.js.map +1 -1
- package/lib/delimited/ui/TableDataButton.d.ts +96 -0
- package/lib/delimited/ui/TableDataButton.d.ts.map +1 -0
- package/lib/delimited/ui/TableDataButton.js +39 -0
- package/lib/delimited/ui/TableDataButton.js.map +1 -0
- package/lib/delimited/ui/index.d.ts +2 -0
- package/lib/delimited/ui/index.d.ts.map +1 -1
- package/lib/delimited/ui/index.js +1 -0
- package/lib/delimited/ui/index.js.map +1 -1
- package/lib/download/core/index.d.ts +0 -5
- package/lib/download/core/index.d.ts.map +1 -1
- package/lib/download/core/index.js +0 -3
- package/lib/download/core/index.js.map +1 -1
- package/lib/download/ui/FigureDownload.d.ts +4 -55
- package/lib/download/ui/FigureDownload.d.ts.map +1 -1
- package/lib/download/ui/FigureDownload.js +6 -66
- package/lib/download/ui/FigureDownload.js.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.d.ts +16 -2
- package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.js +11 -30
- package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
- package/lib/download/ui/figureDownloadHint.d.ts +30 -0
- package/lib/download/ui/figureDownloadHint.d.ts.map +1 -0
- package/lib/download/ui/figureDownloadHint.js +33 -0
- package/lib/download/ui/figureDownloadHint.js.map +1 -0
- package/lib/download/ui/index.d.ts +3 -10
- package/lib/download/ui/index.d.ts.map +1 -1
- package/lib/download/ui/index.js +1 -5
- package/lib/download/ui/index.js.map +1 -1
- package/lib/download/ui/useFigureActions.d.ts +50 -0
- package/lib/download/ui/useFigureActions.d.ts.map +1 -0
- package/lib/download/ui/useFigureActions.js +58 -0
- package/lib/download/ui/useFigureActions.js.map +1 -0
- package/lib/download/ui/useFigureDownload.d.ts +85 -0
- package/lib/download/ui/useFigureDownload.d.ts.map +1 -0
- package/lib/download/ui/useFigureDownload.js +75 -0
- package/lib/download/ui/useFigureDownload.js.map +1 -0
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +0 -40
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/core/types.d.ts +0 -10
- package/lib/ecosystem/core/types.d.ts.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/ir/core/irCommands.d.ts +2 -2
- package/lib/ir/core/irCommands.js +2 -2
- package/lib/ir/core/irCommands.js.map +1 -1
- package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -1
- package/lib/ir/ui/IrAboutDialog.js +1 -1
- package/lib/ir/ui/IrAboutDialog.js.map +1 -1
- package/lib/ir/ui/IrCanvas.d.ts +6 -0
- package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
- package/lib/ir/ui/IrCanvas.js +2 -2
- package/lib/ir/ui/IrCanvas.js.map +1 -1
- package/lib/ir/ui/IrShell.d.ts.map +1 -1
- package/lib/ir/ui/IrShell.js +16 -11
- package/lib/ir/ui/IrShell.js.map +1 -1
- package/lib/ir/ui/IrToolbar.d.ts +11 -1
- package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
- package/lib/ir/ui/IrToolbar.js +12 -2
- package/lib/ir/ui/IrToolbar.js.map +1 -1
- package/lib/ir/ui/index.d.ts +1 -0
- package/lib/ir/ui/index.d.ts.map +1 -1
- package/lib/ir/ui/index.js.map +1 -1
- package/lib/locales/de.json +8 -4
- package/lib/locales/en.json +8 -4
- package/lib/locales/es.json +8 -4
- package/lib/locales/fr.json +8 -4
- package/lib/locales/it.json +8 -4
- package/lib/overlay/ui/OverlayPanel.d.ts +6 -0
- package/lib/overlay/ui/OverlayPanel.d.ts.map +1 -1
- package/lib/overlay/ui/OverlayPanel.js +2 -2
- package/lib/overlay/ui/OverlayPanel.js.map +1 -1
- package/lib/overlay/ui/overlayPanelStyles.d.ts +2 -1
- package/lib/overlay/ui/overlayPanelStyles.d.ts.map +1 -1
- package/lib/overlay/ui/overlayPanelStyles.js +3 -1
- package/lib/overlay/ui/overlayPanelStyles.js.map +1 -1
- package/lib/periodic/core/index.d.ts +1 -1
- package/lib/periodic/core/index.d.ts.map +1 -1
- package/lib/periodic/core/index.js +1 -1
- package/lib/periodic/core/index.js.map +1 -1
- package/lib/periodic/core/layout.d.ts +18 -0
- package/lib/periodic/core/layout.d.ts.map +1 -1
- package/lib/periodic/core/layout.js +9 -0
- package/lib/periodic/core/layout.js.map +1 -1
- package/lib/periodic/ui/ElementCell.d.ts +0 -6
- package/lib/periodic/ui/ElementCell.d.ts.map +1 -1
- package/lib/periodic/ui/ElementCell.js +35 -19
- package/lib/periodic/ui/ElementCell.js.map +1 -1
- package/lib/periodic/ui/PeriodicTable.d.ts +12 -1
- package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTable.js +34 -15
- package/lib/periodic/ui/PeriodicTable.js.map +1 -1
- package/lib/ui.d.ts +1 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +1 -0
- package/lib/ui.js.map +1 -1
- package/package.json +1 -1
- package/src/about/core/about.ts +1 -51
- package/src/about/core/index.ts +0 -1
- package/src/about/ui/AboutBuild.tsx +8 -37
- package/src/about/ui/AboutPage.tsx +8 -64
- package/src/about/ui/AboutVersion.tsx +5 -45
- package/src/axis/core/axisMarks.ts +114 -0
- package/src/axis/core/axisScale.ts +41 -0
- package/src/axis/core/index.ts +20 -0
- package/src/axis/core/logAxisBounds.ts +198 -0
- package/src/axis/ui/AxisScaleControl.tsx +103 -0
- package/src/axis/ui/index.ts +9 -0
- package/src/core.ts +1 -0
- package/src/delimited/core/index.ts +2 -0
- package/src/delimited/core/tableRows.ts +93 -0
- package/src/delimited/ui/DelimitedTextPanel.tsx +25 -9
- package/src/delimited/ui/TableDataButton.tsx +162 -0
- package/src/delimited/ui/index.ts +2 -0
- package/src/download/core/index.ts +0 -25
- package/src/download/ui/FigureDownload.tsx +11 -148
- package/src/download/ui/FigureDownloadPanel.tsx +46 -45
- package/src/download/ui/figureDownloadHint.ts +52 -0
- package/src/download/ui/index.ts +6 -10
- package/src/download/ui/useFigureActions.ts +113 -0
- package/src/download/ui/useFigureDownload.tsx +191 -0
- package/src/ecosystem/core/sites.ts +0 -40
- package/src/ecosystem/core/types.ts +0 -10
- package/src/ir/core/irCommands.ts +2 -2
- package/src/ir/ui/IrAboutDialog.tsx +0 -13
- package/src/ir/ui/IrCanvas.tsx +8 -2
- package/src/ir/ui/IrShell.tsx +23 -25
- package/src/ir/ui/IrToolbar.tsx +36 -6
- package/src/ir/ui/index.ts +1 -0
- package/src/locales/de.json +8 -4
- package/src/locales/en.json +8 -4
- package/src/locales/es.json +8 -4
- package/src/locales/fr.json +8 -4
- package/src/locales/it.json +8 -4
- package/src/overlay/ui/OverlayPanel.tsx +8 -2
- package/src/overlay/ui/overlayPanelStyles.ts +3 -0
- package/src/periodic/core/index.ts +1 -0
- package/src/periodic/core/layout.ts +19 -0
- package/src/periodic/ui/ElementCell.tsx +35 -26
- package/src/periodic/ui/PeriodicTable.tsx +55 -16
- package/src/ui.ts +1 -0
- package/styles/chrome.css +71 -0
- package/lib/about/core/repository.d.ts +0 -14
- package/lib/about/core/repository.d.ts.map +0 -1
- package/lib/about/core/repository.js +0 -21
- package/lib/about/core/repository.js.map +0 -1
- package/lib/download/core/exportStyles.d.ts +0 -22
- package/lib/download/core/exportStyles.d.ts.map +0 -1
- package/lib/download/core/exportStyles.js +0 -19
- package/lib/download/core/exportStyles.js.map +0 -1
- package/lib/download/core/imageResolution.d.ts +0 -88
- package/lib/download/core/imageResolution.d.ts.map +0 -1
- package/lib/download/core/imageResolution.js +0 -77
- package/lib/download/core/imageResolution.js.map +0 -1
- package/lib/download/core/pictureExport.d.ts +0 -93
- package/lib/download/core/pictureExport.d.ts.map +0 -1
- package/lib/download/core/pictureExport.js +0 -116
- package/lib/download/core/pictureExport.js.map +0 -1
- package/lib/download/ui/ExportDialogFrame.d.ts +0 -46
- package/lib/download/ui/ExportDialogFrame.d.ts.map +0 -1
- package/lib/download/ui/ExportDialogFrame.js +0 -24
- package/lib/download/ui/ExportDialogFrame.js.map +0 -1
- package/lib/download/ui/ExportImageDialog.d.ts +0 -47
- package/lib/download/ui/ExportImageDialog.d.ts.map +0 -1
- package/lib/download/ui/ExportImageDialog.js +0 -25
- package/lib/download/ui/ExportImageDialog.js.map +0 -1
- package/lib/download/ui/ExportNameField.d.ts +0 -29
- package/lib/download/ui/ExportNameField.d.ts.map +0 -1
- package/lib/download/ui/ExportNameField.js +0 -99
- package/lib/download/ui/ExportNameField.js.map +0 -1
- package/lib/download/ui/ExportPictureSection.d.ts +0 -38
- package/lib/download/ui/ExportPictureSection.d.ts.map +0 -1
- package/lib/download/ui/ExportPictureSection.js +0 -48
- package/lib/download/ui/ExportPictureSection.js.map +0 -1
- package/lib/download/ui/useDrawingBox.d.ts +0 -23
- package/lib/download/ui/useDrawingBox.d.ts.map +0 -1
- package/lib/download/ui/useDrawingBox.js +0 -21
- package/lib/download/ui/useDrawingBox.js.map +0 -1
- package/src/about/core/repository.ts +0 -22
- package/src/download/core/exportStyles.ts +0 -20
- package/src/download/core/imageResolution.ts +0 -118
- package/src/download/core/pictureExport.ts +0 -207
- package/src/download/ui/ExportDialogFrame.tsx +0 -86
- package/src/download/ui/ExportImageDialog.tsx +0 -91
- package/src/download/ui/ExportNameField.tsx +0 -148
- package/src/download/ui/ExportPictureSection.tsx +0 -142
- package/src/download/ui/useDrawingBox.ts +0 -37
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
3
3
|
import { OverlayAction } from "../../overlay/ui/OverlayAction.js";
|
|
4
4
|
import { OverlayPanel } from "../../overlay/ui/OverlayPanel.js";
|
|
@@ -6,8 +6,10 @@ import { OverlaySegmented } from "../../overlay/ui/OverlaySegmented.js";
|
|
|
6
6
|
import { figureLayoutSize } from "../core/figureLayout.js";
|
|
7
7
|
import { figurePixels, figureScaleFits, figureScaleLabel, formatFigurePixels, } from "../core/figureScale.js";
|
|
8
8
|
import { FigureSizeRows } from "./FigureSizeRows.js";
|
|
9
|
+
import { hintOf } from "./figureDownloadHint.js";
|
|
9
10
|
/**
|
|
10
|
-
* The choices behind the save glyph, and the
|
|
11
|
+
* The choices behind the save glyph, and the buttons that write the file and
|
|
12
|
+
* copy the picture.
|
|
11
13
|
*
|
|
12
14
|
* The resolution applies to both formats, and means what the reader needs it
|
|
13
15
|
* to: a PNG is painted with that many more pixels, and an SVG, drawn the same,
|
|
@@ -27,14 +29,14 @@ import { FigureSizeRows } from "./FigureSizeRows.js";
|
|
|
27
29
|
export function FigureDownloadPanel(props) {
|
|
28
30
|
const { title, format, scale, scales, size, failure, saving } = props;
|
|
29
31
|
const { onFormatChange, onScaleChange, onSave, rasterSvg = false } = props;
|
|
30
|
-
const { sizing } = props;
|
|
32
|
+
const { sizing, onCopy, notice = null } = props;
|
|
31
33
|
const t = useChromeT();
|
|
32
34
|
// What the file is drawn at: the figure on screen, or the shape picked.
|
|
33
35
|
const drawn = size === null || sizing === undefined
|
|
34
36
|
? size
|
|
35
37
|
: figureLayoutSize(sizing.layout, size, sizing.custom ?? size);
|
|
36
38
|
const painted = format === 'png' || rasterSvg;
|
|
37
|
-
return (_jsxs(OverlayPanel, { title: title, hint: hintOf(format, drawn, scale, failure, rasterSvg, t), actions: _jsx(OverlayAction, { text: t('download.save'), icon: "download", intent: "primary", disabled: saving || size === null, onClick: onSave }), children: [_jsx(OverlaySegmented, { label: t('download.format'), help: {
|
|
39
|
+
return (_jsxs(OverlayPanel, { title: title, width: PANEL_WIDTH, hint: hintOf({ format, size: drawn, scale, failure, notice, rasterSvg }, t), actions: _jsxs(_Fragment, { children: [_jsx(OverlayAction, { text: t('download.save'), icon: "download", intent: "primary", disabled: saving || size === null, onClick: onSave }), onCopy === undefined ? null : (_jsx(OverlayAction, { text: t('clipboard.copy'), icon: "clipboard", disabled: saving || size === null, onClick: onCopy }))] }), children: [_jsx(OverlaySegmented, { label: t('download.format'), help: {
|
|
38
40
|
title: t('download.format'),
|
|
39
41
|
body: t('download.formatHelp'),
|
|
40
42
|
}, value: format, options: FORMAT_CHOICES, onChange: onFormatChange }), sizing === undefined ? null : (_jsx(FigureSizeRows, { sizing: sizing, size: size })), _jsx(OverlaySegmented, { label: t('download.resolution'), help: {
|
|
@@ -46,6 +48,11 @@ export function FigureDownloadPanel(props) {
|
|
|
46
48
|
},
|
|
47
49
|
}, value: String(scale), options: scaleChoices(scales, drawn, painted), onChange: (picked) => onScaleChange(Number(picked)) })] }));
|
|
48
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Wide enough for the longest hint on one line in English, so switching
|
|
53
|
+
* between PNG and SVG — whose hints differ in length — never resizes the panel.
|
|
54
|
+
*/
|
|
55
|
+
const PANEL_WIDTH = '27em';
|
|
49
56
|
/** The two files a figure can leave the page as. */
|
|
50
57
|
const FORMAT_CHOICES = [
|
|
51
58
|
{ value: 'png', label: 'PNG' },
|
|
@@ -75,30 +82,4 @@ function scaleChoices(scales, size, painted) {
|
|
|
75
82
|
}
|
|
76
83
|
return choices;
|
|
77
84
|
}
|
|
78
|
-
/**
|
|
79
|
-
* The line at the foot of the panel: what pressing save is about to do.
|
|
80
|
-
* @param format - Which file the reader is about to write.
|
|
81
|
-
* @param size - How big the figure is drawn for the file.
|
|
82
|
-
* @param scale - The multiple it is saved at.
|
|
83
|
-
* @param failure - What went wrong last time, if anything.
|
|
84
|
-
* @param rasterSvg - Whether the SVG embeds a rendered picture.
|
|
85
|
-
* @param t - The chrome's formatter, so the sentence is in the language of
|
|
86
|
-
* the page.
|
|
87
|
-
* @returns The sentence.
|
|
88
|
-
*/
|
|
89
|
-
function hintOf(format, size, scale, failure, rasterSvg, t) {
|
|
90
|
-
if (failure !== null)
|
|
91
|
-
return failure;
|
|
92
|
-
if (size === null)
|
|
93
|
-
return t('download.noFigure');
|
|
94
|
-
if (format === 'svg' && rasterSvg) {
|
|
95
|
-
return t('download.hintRasterSvg', {
|
|
96
|
-
pixels: formatFigurePixels(figurePixels(size, scale)),
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
const pixels = formatFigurePixels(figurePixels(size, scale));
|
|
100
|
-
return format === 'svg'
|
|
101
|
-
? t('download.hintSvg', { pixels })
|
|
102
|
-
: t('download.hintPng', { pixels });
|
|
103
|
-
}
|
|
104
85
|
//# sourceMappingURL=FigureDownloadPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FigureDownloadPanel.js","sourceRoot":"","sources":["../../../src/download/ui/FigureDownloadPanel.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FigureDownloadPanel.js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,0 +1,30 @@
|
|
|
1
|
+
import type { ChromeKey } from '../../i18n/core/chromeCatalog.ts';
|
|
2
|
+
import type { Translate } from '../../i18n/ui/useT.ts';
|
|
3
|
+
import type { FigureFormat } from '../core/downloadFigure.ts';
|
|
4
|
+
import type { FigurePixels } from '../core/figureScale.ts';
|
|
5
|
+
import type { FigureNotice } from './useFigureActions.ts';
|
|
6
|
+
/** What the line at the foot of the panel is written from. */
|
|
7
|
+
export interface HintState {
|
|
8
|
+
/** Which file the reader is about to write. */
|
|
9
|
+
format: FigureFormat;
|
|
10
|
+
/** How big the figure is drawn for the file. */
|
|
11
|
+
size: FigurePixels | null;
|
|
12
|
+
/** The multiple it is saved at. */
|
|
13
|
+
scale: number;
|
|
14
|
+
/** What went wrong last time, if anything. */
|
|
15
|
+
failure: string | null;
|
|
16
|
+
/** What the last copy came to, if anything. */
|
|
17
|
+
notice: FigureNotice | null;
|
|
18
|
+
/** Whether the SVG embeds a rendered picture. */
|
|
19
|
+
rasterSvg: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The line at the foot of the panel: what pressing save is about to do, or
|
|
23
|
+
* what the last copy did.
|
|
24
|
+
* @param state - See {@link HintState}.
|
|
25
|
+
* @param t - The chrome's formatter, so the sentence is in the language of
|
|
26
|
+
* the page.
|
|
27
|
+
* @returns The sentence.
|
|
28
|
+
*/
|
|
29
|
+
export declare function hintOf(state: HintState, t: Translate<ChromeKey>): string;
|
|
30
|
+
//# sourceMappingURL=figureDownloadHint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figureDownloadHint.d.ts","sourceRoot":"","sources":["../../../src/download/ui/figureDownloadHint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,8DAA8D;AAC9D,MAAM,WAAW,SAAS;IACxB,+CAA+C;IAC/C,MAAM,EAAE,YAAY,CAAC;IACrB,gDAAgD;IAChD,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,+CAA+C;IAC/C,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,iDAAiD;IACjD,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,MAAM,CAmBxE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { figurePixels, formatFigurePixels } from "../core/figureScale.js";
|
|
2
|
+
/**
|
|
3
|
+
* The line at the foot of the panel: what pressing save is about to do, or
|
|
4
|
+
* what the last copy did.
|
|
5
|
+
* @param state - See {@link HintState}.
|
|
6
|
+
* @param t - The chrome's formatter, so the sentence is in the language of
|
|
7
|
+
* the page.
|
|
8
|
+
* @returns The sentence.
|
|
9
|
+
*/
|
|
10
|
+
export function hintOf(state, t) {
|
|
11
|
+
const { format, size, scale, failure, notice, rasterSvg } = state;
|
|
12
|
+
if (failure !== null)
|
|
13
|
+
return failure;
|
|
14
|
+
if (size === null)
|
|
15
|
+
return t('download.noFigure');
|
|
16
|
+
if (notice === 'copyUnsupported')
|
|
17
|
+
return t('download.copyUnsupported');
|
|
18
|
+
if (notice === 'copied') {
|
|
19
|
+
return t('download.hintCopied', {
|
|
20
|
+
pixels: formatFigurePixels(figurePixels(size, scale)),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
if (format === 'svg' && rasterSvg) {
|
|
24
|
+
return t('download.hintRasterSvg', {
|
|
25
|
+
pixels: formatFigurePixels(figurePixels(size, scale)),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const pixels = formatFigurePixels(figurePixels(size, scale));
|
|
29
|
+
return format === 'svg'
|
|
30
|
+
? t('download.hintSvg', { pixels })
|
|
31
|
+
: t('download.hintPng', { pixels });
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=figureDownloadHint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figureDownloadHint.js","sourceRoot":"","sources":["../../../src/download/ui/figureDownloadHint.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAoB1E;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CAAC,KAAgB,EAAE,CAAuB;IAC9D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAClE,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC;IACrC,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAAC;IACjD,IAAI,MAAM,KAAK,iBAAiB;QAAE,OAAO,CAAC,CAAC,0BAA0B,CAAC,CAAC;IACvE,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,OAAO,CAAC,CAAC,qBAAqB,EAAE;YAC9B,MAAM,EAAE,kBAAkB,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;IACD,IAAI,MAAM,KAAK,KAAK,IAAI,SAAS,EAAE,CAAC;QAClC,OAAO,CAAC,CAAC,wBAAwB,EAAE;YACjC,MAAM,EAAE,kBAAkB,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;IACD,MAAM,MAAM,GAAG,kBAAkB,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC7D,OAAO,MAAM,KAAK,KAAK;QACrB,CAAC,CAAC,CAAC,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -12,14 +12,7 @@ export type { FigureDownloadPanelProps } from './FigureDownloadPanel.tsx';
|
|
|
12
12
|
export { FigureDownloadPanel } from './FigureDownloadPanel.tsx';
|
|
13
13
|
export type { FigureSizing } from './FigureSizeRows.tsx';
|
|
14
14
|
export type { FigureRenderer } from './useFigureRedraw.tsx';
|
|
15
|
-
export type {
|
|
16
|
-
export {
|
|
17
|
-
export type {
|
|
18
|
-
export { ExportImageDialog } from './ExportImageDialog.tsx';
|
|
19
|
-
export type { ExportNameFieldProps } from './ExportNameField.tsx';
|
|
20
|
-
export { ExportNameField } from './ExportNameField.tsx';
|
|
21
|
-
export type { ExportPictureSectionProps } from './ExportPictureSection.tsx';
|
|
22
|
-
export { ExportPictureSection } from './ExportPictureSection.tsx';
|
|
23
|
-
export type { DrawingBox } from './useDrawingBox.ts';
|
|
24
|
-
export { useDrawingBox } from './useDrawingBox.ts';
|
|
15
|
+
export type { FigureDownloadOptions, FigureDownloadState, } from './useFigureDownload.tsx';
|
|
16
|
+
export { useFigureDownload } from './useFigureDownload.tsx';
|
|
17
|
+
export type { FigureNotice } from './useFigureActions.ts';
|
|
25
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;AAChE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,YAAY,
|
|
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;AAChE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,YAAY,EACV,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
|
package/lib/download/ui/index.js
CHANGED
|
@@ -8,9 +8,5 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { FigureDownload } from "./FigureDownload.js";
|
|
10
10
|
export { FigureDownloadPanel } from "./FigureDownloadPanel.js";
|
|
11
|
-
export {
|
|
12
|
-
export { ExportImageDialog } from "./ExportImageDialog.js";
|
|
13
|
-
export { ExportNameField } from "./ExportNameField.js";
|
|
14
|
-
export { ExportPictureSection } from "./ExportPictureSection.js";
|
|
15
|
-
export { useDrawingBox } from "./useDrawingBox.js";
|
|
11
|
+
export { useFigureDownload } from "./useFigureDownload.js";
|
|
16
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -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;
|
|
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;AAQhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { FigureFormat } from '../core/downloadFigure.ts';
|
|
2
|
+
import type { FigurePixels } from '../core/figureScale.ts';
|
|
3
|
+
import type { FigureRedraw } from './useFigureRedraw.tsx';
|
|
4
|
+
/** What the last copy came to, when it is worth a line of its own. */
|
|
5
|
+
export type FigureNotice = 'copied' | 'copyUnsupported';
|
|
6
|
+
/** What {@link useFigureActions} works from. */
|
|
7
|
+
export interface FigureActionsOptions {
|
|
8
|
+
/** The `id` of the box the figure is mounted in. */
|
|
9
|
+
targetId: string;
|
|
10
|
+
/** Which file save writes. */
|
|
11
|
+
format: FigureFormat;
|
|
12
|
+
/** The multiple of the figure on screen it is painted at. */
|
|
13
|
+
scale: number;
|
|
14
|
+
/** What the saved file is called, without its extension. */
|
|
15
|
+
fileName?: string;
|
|
16
|
+
/** What is painted under the figure. */
|
|
17
|
+
background?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The size the figure is drawn again at, off the page, or `null` to take
|
|
20
|
+
* the figure as it is on screen.
|
|
21
|
+
*/
|
|
22
|
+
redrawAt: FigurePixels | null;
|
|
23
|
+
/** Draws the figure again, from {@link FigureRedraw}. */
|
|
24
|
+
redraw: FigureRedraw['redraw'];
|
|
25
|
+
}
|
|
26
|
+
/** What {@link useFigureActions} hands back. */
|
|
27
|
+
export interface FigureActions {
|
|
28
|
+
/** Write the figure to a file, in the format picked. */
|
|
29
|
+
save: () => void;
|
|
30
|
+
/** Put the figure on the clipboard, as a PNG at the resolution picked. */
|
|
31
|
+
copy: () => void;
|
|
32
|
+
/** Whether a file or a copy is being written right now. */
|
|
33
|
+
busy: boolean;
|
|
34
|
+
/** What went wrong the last time, if anything. */
|
|
35
|
+
failure: string | null;
|
|
36
|
+
/** What the last copy came to, if it is still what the panel describes. */
|
|
37
|
+
notice: FigureNotice | null;
|
|
38
|
+
/** Forget the last outcome, once the choices it answered have changed. */
|
|
39
|
+
clear: () => void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The two things the figure panel does: save the figure, and copy it.
|
|
43
|
+
*
|
|
44
|
+
* A copy is always a PNG, whatever format save is set to: a clipboard carries
|
|
45
|
+
* a picture, and the one every slide, chat window and issue accepts is a PNG.
|
|
46
|
+
* @param options - See {@link FigureActionsOptions}.
|
|
47
|
+
* @returns See {@link FigureActions}.
|
|
48
|
+
*/
|
|
49
|
+
export declare function useFigureActions(options: FigureActionsOptions): FigureActions;
|
|
50
|
+
//# sourceMappingURL=useFigureActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFigureActions.d.ts","sourceRoot":"","sources":["../../../src/download/ui/useFigureActions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,iBAAiB,CAAC;AAExD,gDAAgD;AAChD,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,yDAAyD;IACzD,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;CAChC;AAED,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,0EAA0E;IAC1E,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,2DAA2D;IAC3D,IAAI,EAAE,OAAO,CAAC;IACd,kDAAkD;IAClD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2EAA2E;IAC3E,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAqD7E"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
import { writeImageToClipboard } from "../../clipboard/core/copyPng.js";
|
|
3
|
+
import { downloadFigure } from "../core/downloadFigure.js";
|
|
4
|
+
import { figurePng } from "../core/figurePng.js";
|
|
5
|
+
import { figureSvg } from "../core/figureSvg.js";
|
|
6
|
+
/**
|
|
7
|
+
* The two things the figure panel does: save the figure, and copy it.
|
|
8
|
+
*
|
|
9
|
+
* A copy is always a PNG, whatever format save is set to: a clipboard carries
|
|
10
|
+
* a picture, and the one every slide, chat window and issue accepts is a PNG.
|
|
11
|
+
* @param options - See {@link FigureActionsOptions}.
|
|
12
|
+
* @returns See {@link FigureActions}.
|
|
13
|
+
*/
|
|
14
|
+
export function useFigureActions(options) {
|
|
15
|
+
const { targetId, format, scale, fileName, background } = options;
|
|
16
|
+
const { redrawAt, redraw } = options;
|
|
17
|
+
const [busy, setBusy] = useState(false);
|
|
18
|
+
const [failure, setFailure] = useState(null);
|
|
19
|
+
const [notice, setNotice] = useState(null);
|
|
20
|
+
function withFigure(write) {
|
|
21
|
+
return redrawAt === null
|
|
22
|
+
? write(targetId)
|
|
23
|
+
: redraw(targetId, redrawAt, write);
|
|
24
|
+
}
|
|
25
|
+
function run(task) {
|
|
26
|
+
setBusy(true);
|
|
27
|
+
setFailure(null);
|
|
28
|
+
setNotice(null);
|
|
29
|
+
void task
|
|
30
|
+
.then(setNotice, (error) => {
|
|
31
|
+
setFailure(error instanceof Error ? error.message : String(error));
|
|
32
|
+
})
|
|
33
|
+
.finally(() => setBusy(false));
|
|
34
|
+
}
|
|
35
|
+
function save() {
|
|
36
|
+
const options = { format, scale, fileName, background };
|
|
37
|
+
run(withFigure((box) => downloadFigure(box, options)).then(() => null));
|
|
38
|
+
}
|
|
39
|
+
function copy() {
|
|
40
|
+
// The clipboard is written before anything is awaited, with the picture
|
|
41
|
+
// still being painted: Safari only allows a write the click itself started.
|
|
42
|
+
const png = new Promise((resolve, reject) => {
|
|
43
|
+
withFigure(async (box) => {
|
|
44
|
+
resolve(await figurePng(figureSvg(box, { background }), scale));
|
|
45
|
+
}).catch(reject);
|
|
46
|
+
});
|
|
47
|
+
// A browser whose clipboard takes text only never reads the picture, so
|
|
48
|
+
// its failure would otherwise go unhandled.
|
|
49
|
+
png.catch(() => undefined);
|
|
50
|
+
run(writeImageToClipboard(png).then((copied) => copied ? 'copied' : 'copyUnsupported'));
|
|
51
|
+
}
|
|
52
|
+
const clear = useCallback(() => {
|
|
53
|
+
setFailure(null);
|
|
54
|
+
setNotice(null);
|
|
55
|
+
}, []);
|
|
56
|
+
return { save, copy, busy, failure, notice, clear };
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=useFigureActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFigureActions.js","sourceRoot":"","sources":["../../../src/download/ui/useFigureActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA4CjD;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAA6B;IAC5D,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAClE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACrC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAC5D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAsB,IAAI,CAAC,CAAC;IAEhE,SAAS,UAAU,CAAC,KAA+C;QACjE,OAAO,QAAQ,KAAK,IAAI;YACtB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;YACjB,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,GAAG,CAAC,IAAkC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC;QACd,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,SAAS,CAAC,IAAI,CAAC,CAA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K,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,SAAS,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { FigureFormat } from '../core/downloadFigure.ts';
|
|
3
|
+
import type { FigureRenderer } from './useFigureRedraw.tsx';
|
|
4
|
+
/** What the "Save figure" panel is set up with. */
|
|
5
|
+
export interface FigureDownloadOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The `id` of the box the figure is mounted in. Everything drawn inside it
|
|
8
|
+
* is saved — sixteen charts of a pair grid as readily as one scatter plot —
|
|
9
|
+
* and the controls floating over it are left behind.
|
|
10
|
+
*/
|
|
11
|
+
targetId: string;
|
|
12
|
+
/**
|
|
13
|
+
* What the saved file is called, without its extension. Name it after the
|
|
14
|
+
* data rather than after the tool: a reader with four of these in a
|
|
15
|
+
* downloads folder cannot tell four `figure.png` apart.
|
|
16
|
+
* @default 'figure'
|
|
17
|
+
*/
|
|
18
|
+
fileName?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The format it opens on.
|
|
21
|
+
* @default 'png'
|
|
22
|
+
*/
|
|
23
|
+
defaultFormat?: FigureFormat;
|
|
24
|
+
/**
|
|
25
|
+
* The resolution a PNG opens on, as a multiple of the figure on screen. An
|
|
26
|
+
* SVG opens at 1×, the size it has on screen, and each format keeps the
|
|
27
|
+
* multiple the reader last picked for it.
|
|
28
|
+
* @default 2
|
|
29
|
+
*/
|
|
30
|
+
defaultScale?: number;
|
|
31
|
+
/**
|
|
32
|
+
* The resolutions offered.
|
|
33
|
+
* @default [1, 2, 3, 4]
|
|
34
|
+
*/
|
|
35
|
+
scales?: readonly number[];
|
|
36
|
+
/**
|
|
37
|
+
* What is painted under the figure. `transparent` leaves it unpainted, for a
|
|
38
|
+
* figure going onto a coloured slide.
|
|
39
|
+
* @default the surface the figure is drawn on
|
|
40
|
+
*/
|
|
41
|
+
background?: string;
|
|
42
|
+
/**
|
|
43
|
+
* What the panel is called.
|
|
44
|
+
* @default the chrome's own line, in the language of the page
|
|
45
|
+
*/
|
|
46
|
+
title?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Draws the figure at a size, for a file. When it is given the panel offers
|
|
49
|
+
* a size — as shown, 4:3, 16:9, a journal column, or typed — and a figure
|
|
50
|
+
* saved at a size other than its own is drawn again at that size, off the
|
|
51
|
+
* page, so its axes and labels are laid out for the new shape rather than
|
|
52
|
+
* stretched into it. Draw exactly what is on screen, with the same data,
|
|
53
|
+
* zoom and colours; only the box changes.
|
|
54
|
+
* @default undefined — the figure is saved at the size it has on screen
|
|
55
|
+
*/
|
|
56
|
+
renderFigure?: FigureRenderer;
|
|
57
|
+
}
|
|
58
|
+
/** What {@link useFigureDownload} hands back. */
|
|
59
|
+
export interface FigureDownloadState {
|
|
60
|
+
/** Whether the panel is showing. */
|
|
61
|
+
isOpen: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Show or hide the panel. Showing it measures the figure, so hand this to
|
|
64
|
+
* the popover's `onInteraction` rather than a setter of your own.
|
|
65
|
+
*/
|
|
66
|
+
setOpen: (open: boolean) => void;
|
|
67
|
+
/** The panel, for the popover's `content`. */
|
|
68
|
+
panel: ReactElement;
|
|
69
|
+
/** The format picked, for a trigger that shows it. */
|
|
70
|
+
format: FigureFormat;
|
|
71
|
+
/**
|
|
72
|
+
* The copy drawn off the page while a figure is saved at another size, to
|
|
73
|
+
* be rendered anywhere in the caller's tree.
|
|
74
|
+
*/
|
|
75
|
+
portal: ReactNode;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The "Save figure" panel — save as PNG or SVG, or copy as PNG — for a caller
|
|
79
|
+
* that brings its own trigger, such as a button in an editor's toolbar.
|
|
80
|
+
* `FigureDownload` is the same panel behind the family's own glyph.
|
|
81
|
+
* @param options - See {@link FigureDownloadOptions}.
|
|
82
|
+
* @returns See {@link FigureDownloadState}.
|
|
83
|
+
*/
|
|
84
|
+
export declare function useFigureDownload(options: FigureDownloadOptions): FigureDownloadState;
|
|
85
|
+
//# sourceMappingURL=useFigureDownload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFigureDownload.d.ts","sourceRoot":"","sources":["../../../src/download/ui/useFigureDownload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAa9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,mDAAmD;AACnD,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC;CAC/B;AAED,iDAAiD;AACjD,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,8CAA8C;IAC9C,KAAK,EAAE,YAAY,CAAC;IACpB,sDAAsD;IACtD,MAAM,EAAE,YAAY,CAAC;IACrB;;;OAGG;IACH,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,qBAAqB,GAC7B,mBAAmB,CAsFrB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
4
|
+
import { figureLayoutRedraws, figureLayoutSize } from "../core/figureLayout.js";
|
|
5
|
+
import { DEFAULT_FIGURE_SCALE, FIGURE_SCALES, defaultFigureScale, } from "../core/figureScale.js";
|
|
6
|
+
import { figureSize } from "../core/figureTarget.js";
|
|
7
|
+
import { FigureDownloadPanel } from "./FigureDownloadPanel.js";
|
|
8
|
+
import { useFigureActions } from "./useFigureActions.js";
|
|
9
|
+
import { useFigureRedraw } from "./useFigureRedraw.js";
|
|
10
|
+
/**
|
|
11
|
+
* The "Save figure" panel — save as PNG or SVG, or copy as PNG — for a caller
|
|
12
|
+
* that brings its own trigger, such as a button in an editor's toolbar.
|
|
13
|
+
* `FigureDownload` is the same panel behind the family's own glyph.
|
|
14
|
+
* @param options - See {@link FigureDownloadOptions}.
|
|
15
|
+
* @returns See {@link FigureDownloadState}.
|
|
16
|
+
*/
|
|
17
|
+
export function useFigureDownload(options) {
|
|
18
|
+
const { targetId, fileName, background, scales = FIGURE_SCALES } = options;
|
|
19
|
+
const { defaultFormat = 'png', defaultScale = DEFAULT_FIGURE_SCALE } = options;
|
|
20
|
+
const { title, renderFigure } = options;
|
|
21
|
+
const t = useChromeT();
|
|
22
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
23
|
+
const [format, setFormat] = useState(defaultFormat);
|
|
24
|
+
const [picked, setPicked] = useState(() => ({
|
|
25
|
+
png: defaultScale,
|
|
26
|
+
svg: defaultFigureScale('svg'),
|
|
27
|
+
}));
|
|
28
|
+
const scale = picked[format];
|
|
29
|
+
const [size, setSize] = useState(null);
|
|
30
|
+
const [layout, setLayout] = useState('screen');
|
|
31
|
+
const [custom, setCustom] = useState(null);
|
|
32
|
+
const { redraw, portal } = useFigureRedraw(renderFigure);
|
|
33
|
+
const redrawAt = renderFigure !== undefined &&
|
|
34
|
+
size !== null &&
|
|
35
|
+
figureLayoutRedraws(layout, size, custom ?? size)
|
|
36
|
+
? figureLayoutSize(layout, size, custom ?? size)
|
|
37
|
+
: null;
|
|
38
|
+
const { save, copy, busy, failure, notice, clear } = useFigureActions({
|
|
39
|
+
targetId,
|
|
40
|
+
format,
|
|
41
|
+
scale,
|
|
42
|
+
fileName,
|
|
43
|
+
background,
|
|
44
|
+
redrawAt,
|
|
45
|
+
redraw,
|
|
46
|
+
});
|
|
47
|
+
// The panel is held open from here rather than left to itself, because the
|
|
48
|
+
// figure has to be measured at the moment it opens: its size is what the
|
|
49
|
+
// panel writes out, and reading a bounding box on every render would cost a
|
|
50
|
+
// layout pass on a bar that is re-rendered on every pointer move.
|
|
51
|
+
const setOpen = useCallback((next) => {
|
|
52
|
+
setIsOpen(next);
|
|
53
|
+
if (!next)
|
|
54
|
+
return;
|
|
55
|
+
setSize(figureSize(targetId));
|
|
56
|
+
clear();
|
|
57
|
+
}, [targetId, clear]);
|
|
58
|
+
// What the last copy came to only describes the choices it was made with.
|
|
59
|
+
function changed(apply) {
|
|
60
|
+
return (value) => {
|
|
61
|
+
clear();
|
|
62
|
+
apply(value);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const panel = (_jsx(FigureDownloadPanel, { title: title ?? t('download.saveFigure'), format: format, scale: scale, scales: scales, size: size, failure: failure, notice: notice, saving: busy, onFormatChange: changed(setFormat), onScaleChange: changed((next) => setPicked((current) => ({ ...current, [format]: next }))), onSave: save, onCopy: copy, sizing: renderFigure === undefined
|
|
66
|
+
? undefined
|
|
67
|
+
: {
|
|
68
|
+
layout,
|
|
69
|
+
custom,
|
|
70
|
+
onLayoutChange: changed(setLayout),
|
|
71
|
+
onCustomChange: changed(setCustom),
|
|
72
|
+
} }));
|
|
73
|
+
return { isOpen, setOpen, panel, format, portal };
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=useFigureDownload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFigureDownload.js","sourceRoot":"","sources":["../../../src/download/ui/useFigureDownload.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AA6ExD;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAA8B;IAE9B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC;IAC3E,MAAM,EAAE,aAAa,GAAG,KAAK,EAAE,YAAY,GAAG,oBAAoB,EAAE,GAClE,OAAO,CAAC;IACV,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAExC,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,G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","sources":["../../../src/ecosystem/core/sites.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE5D,YAAY,EACV,aAAa,EACb,MAAM,EACN,cAAc,EACd,QAAQ,EACR,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,
|
|
1
|
+
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../../src/ecosystem/core/sites.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE5D,YAAY,EACV,aAAa,EACb,MAAM,EACN,cAAc,EACd,QAAQ,EACR,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAuRnD,CAAC;AAEF,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,UAAU,EAChB,OAAO,GAAE,cAAmB,GAC3B,MAAM,CAER"}
|