react-cheminfo 0.28.0 → 0.30.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 +79 -26
- package/lib/chart/core/axisLabels.d.ts +82 -0
- package/lib/chart/core/axisLabels.d.ts.map +1 -0
- package/lib/chart/core/axisLabels.js +111 -0
- package/lib/chart/core/axisLabels.js.map +1 -0
- package/lib/chart/core/boxLayout.d.ts +53 -0
- package/lib/chart/core/boxLayout.d.ts.map +1 -0
- package/lib/chart/core/boxLayout.js +112 -0
- package/lib/chart/core/boxLayout.js.map +1 -0
- package/lib/chart/core/chartAxisScale.d.ts +23 -2
- package/lib/chart/core/chartAxisScale.d.ts.map +1 -1
- package/lib/chart/core/chartAxisScale.js +64 -13
- package/lib/chart/core/chartAxisScale.js.map +1 -1
- package/lib/chart/core/chartDomain.d.ts +160 -0
- package/lib/chart/core/chartDomain.d.ts.map +1 -0
- package/lib/chart/core/chartDomain.js +46 -0
- package/lib/chart/core/chartDomain.js.map +1 -0
- package/lib/chart/core/chartGeometry.d.ts +131 -0
- package/lib/chart/core/chartGeometry.d.ts.map +1 -0
- package/lib/chart/core/chartGeometry.js +101 -0
- package/lib/chart/core/chartGeometry.js.map +1 -0
- package/lib/chart/core/chartPane.d.ts +11 -0
- package/lib/chart/core/chartPane.d.ts.map +1 -0
- package/lib/chart/core/chartPane.js +11 -0
- package/lib/chart/core/chartPane.js.map +1 -0
- package/lib/chart/core/chartScale.d.ts +4 -1
- package/lib/chart/core/chartScale.d.ts.map +1 -1
- package/lib/chart/core/chartScale.js +8 -4
- package/lib/chart/core/chartScale.js.map +1 -1
- package/lib/chart/core/chartTheme.d.ts +156 -0
- package/lib/chart/core/chartTheme.d.ts.map +1 -0
- package/lib/chart/core/chartTheme.js +156 -0
- package/lib/chart/core/chartTheme.js.map +1 -0
- package/lib/chart/core/chartViewport.d.ts +32 -5
- package/lib/chart/core/chartViewport.d.ts.map +1 -1
- package/lib/chart/core/chartViewport.js +40 -11
- package/lib/chart/core/chartViewport.js.map +1 -1
- package/lib/chart/core/guidePlacement.d.ts +52 -0
- package/lib/chart/core/guidePlacement.d.ts.map +1 -0
- package/lib/chart/core/guidePlacement.js +52 -0
- package/lib/chart/core/guidePlacement.js.map +1 -0
- package/lib/chart/core/index.d.ts +29 -2
- package/lib/chart/core/index.d.ts.map +1 -1
- package/lib/chart/core/index.js +19 -2
- package/lib/chart/core/index.js.map +1 -1
- package/lib/chart/core/labelStack.d.ts +27 -0
- package/lib/chart/core/labelStack.d.ts.map +1 -0
- package/lib/chart/core/labelStack.js +62 -0
- package/lib/chart/core/labelStack.js.map +1 -0
- package/lib/chart/core/legendBox.d.ts +152 -0
- package/lib/chart/core/legendBox.d.ts.map +1 -0
- package/lib/chart/core/legendBox.js +169 -0
- package/lib/chart/core/legendBox.js.map +1 -0
- package/lib/chart/core/selectionGeometry.d.ts +45 -0
- package/lib/chart/core/selectionGeometry.d.ts.map +1 -0
- package/lib/chart/core/selectionGeometry.js +49 -0
- package/lib/chart/core/selectionGeometry.js.map +1 -0
- package/lib/chart/core/spectrumColor.d.ts +80 -0
- package/lib/chart/core/spectrumColor.d.ts.map +1 -0
- package/lib/chart/core/spectrumColor.js +120 -0
- package/lib/chart/core/spectrumColor.js.map +1 -0
- package/lib/chart/core/stackCapacity.d.ts +136 -0
- package/lib/chart/core/stackCapacity.d.ts.map +1 -0
- package/lib/chart/core/stackCapacity.js +153 -0
- package/lib/chart/core/stackCapacity.js.map +1 -0
- package/lib/chart/core/svgPoint.d.ts +62 -0
- package/lib/chart/core/svgPoint.d.ts.map +1 -0
- package/lib/chart/core/svgPoint.js +43 -0
- package/lib/chart/core/svgPoint.js.map +1 -0
- package/lib/chart/core/tracePath.d.ts +94 -0
- package/lib/chart/core/tracePath.d.ts.map +1 -0
- package/lib/chart/core/tracePath.js +191 -0
- package/lib/chart/core/tracePath.js.map +1 -0
- package/lib/chart/core/trackerReadout.d.ts +55 -0
- package/lib/chart/core/trackerReadout.d.ts.map +1 -0
- package/lib/chart/core/trackerReadout.js +53 -0
- package/lib/chart/core/trackerReadout.js.map +1 -0
- package/lib/chart/core/viewTransform.d.ts +167 -0
- package/lib/chart/core/viewTransform.d.ts.map +1 -0
- package/lib/chart/core/viewTransform.js +188 -0
- package/lib/chart/core/viewTransform.js.map +1 -0
- package/lib/chart/core/zoomDomain.d.ts +127 -0
- package/lib/chart/core/zoomDomain.d.ts.map +1 -0
- package/lib/chart/core/zoomDomain.js +175 -0
- package/lib/chart/core/zoomDomain.js.map +1 -0
- package/lib/chart/ui/Axes.d.ts +104 -0
- package/lib/chart/ui/Axes.d.ts.map +1 -0
- package/lib/chart/ui/Axes.js +155 -0
- package/lib/chart/ui/Axes.js.map +1 -0
- package/lib/chart/ui/AxisGuide.d.ts +60 -0
- package/lib/chart/ui/AxisGuide.d.ts.map +1 -0
- package/lib/chart/ui/AxisGuide.js +111 -0
- package/lib/chart/ui/AxisGuide.js.map +1 -0
- package/lib/chart/ui/ChartStack.d.ts +81 -0
- package/lib/chart/ui/ChartStack.d.ts.map +1 -0
- package/lib/chart/ui/ChartStack.js +42 -0
- package/lib/chart/ui/ChartStack.js.map +1 -0
- package/lib/chart/ui/ChartTracker.d.ts +36 -0
- package/lib/chart/ui/ChartTracker.d.ts.map +1 -0
- package/lib/chart/ui/ChartTracker.js +27 -0
- package/lib/chart/ui/ChartTracker.js.map +1 -0
- package/lib/chart/ui/PlotCaption.d.ts +44 -0
- package/lib/chart/ui/PlotCaption.d.ts.map +1 -0
- package/lib/chart/ui/PlotCaption.js +68 -0
- package/lib/chart/ui/PlotCaption.js.map +1 -0
- package/lib/chart/ui/SelectionRect.d.ts +27 -0
- package/lib/chart/ui/SelectionRect.d.ts.map +1 -0
- package/lib/chart/ui/SelectionRect.js +31 -0
- package/lib/chart/ui/SelectionRect.js.map +1 -0
- package/lib/chart/ui/TraceLegend.d.ts +99 -0
- package/lib/chart/ui/TraceLegend.d.ts.map +1 -0
- package/lib/chart/ui/TraceLegend.js +45 -0
- package/lib/chart/ui/TraceLegend.js.map +1 -0
- package/lib/chart/ui/chartGestures.d.ts +158 -0
- package/lib/chart/ui/chartGestures.d.ts.map +1 -0
- package/lib/chart/ui/chartGestures.js +145 -0
- package/lib/chart/ui/chartGestures.js.map +1 -0
- package/lib/chart/ui/chartStackLevel.d.ts +115 -0
- package/lib/chart/ui/chartStackLevel.d.ts.map +1 -0
- package/lib/chart/ui/chartStackLevel.js +96 -0
- package/lib/chart/ui/chartStackLevel.js.map +1 -0
- package/lib/chart/ui/chartSurface.d.ts +35 -0
- package/lib/chart/ui/chartSurface.d.ts.map +1 -0
- package/lib/chart/ui/chartSurface.js +58 -0
- package/lib/chart/ui/chartSurface.js.map +1 -0
- package/lib/chart/ui/index.d.ts +24 -0
- package/lib/chart/ui/index.d.ts.map +1 -1
- package/lib/chart/ui/index.js +13 -0
- package/lib/chart/ui/index.js.map +1 -1
- package/lib/chart/ui/useChartPointer.d.ts +124 -0
- package/lib/chart/ui/useChartPointer.d.ts.map +1 -0
- package/lib/chart/ui/useChartPointer.js +152 -0
- package/lib/chart/ui/useChartPointer.js.map +1 -0
- package/lib/chart/ui/useChartSize.d.ts +49 -0
- package/lib/chart/ui/useChartSize.d.ts.map +1 -0
- package/lib/chart/ui/useChartSize.js +91 -0
- package/lib/chart/ui/useChartSize.js.map +1 -0
- package/lib/chart/ui/useChartWindow.d.ts +147 -0
- package/lib/chart/ui/useChartWindow.d.ts.map +1 -0
- package/lib/chart/ui/useChartWindow.js +135 -0
- package/lib/chart/ui/useChartWindow.js.map +1 -0
- package/lib/chart/ui/useChartZoom.d.ts +88 -0
- package/lib/chart/ui/useChartZoom.d.ts.map +1 -0
- package/lib/chart/ui/useChartZoom.js +142 -0
- package/lib/chart/ui/useChartZoom.js.map +1 -0
- package/lib/chart/ui/useWheelListener.d.ts +30 -0
- package/lib/chart/ui/useWheelListener.d.ts.map +1 -0
- package/lib/chart/ui/useWheelListener.js +57 -0
- package/lib/chart/ui/useWheelListener.js.map +1 -0
- package/lib/chrome/ui/AccountButton.d.ts +76 -0
- package/lib/chrome/ui/AccountButton.d.ts.map +1 -0
- package/lib/chrome/ui/AccountButton.js +66 -0
- package/lib/chrome/ui/AccountButton.js.map +1 -0
- package/lib/chrome/ui/index.d.ts +2 -0
- package/lib/chrome/ui/index.d.ts.map +1 -1
- package/lib/chrome/ui/index.js +1 -0
- package/lib/chrome/ui/index.js.map +1 -1
- package/lib/clipboard/core/copyPng.d.ts +13 -0
- package/lib/clipboard/core/copyPng.d.ts.map +1 -0
- package/lib/clipboard/core/copyPng.js +19 -0
- package/lib/clipboard/core/copyPng.js.map +1 -0
- package/lib/clipboard/core/index.d.ts +1 -0
- package/lib/clipboard/core/index.d.ts.map +1 -1
- package/lib/clipboard/core/index.js +1 -0
- package/lib/clipboard/core/index.js.map +1 -1
- package/lib/clipboard/ui/ClickToCopy.d.ts +6 -0
- package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -1
- package/lib/clipboard/ui/ClickToCopy.js +3 -3
- package/lib/clipboard/ui/ClickToCopy.js.map +1 -1
- 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/download/core/exportStyles.d.ts +22 -0
- package/lib/download/core/exportStyles.d.ts.map +1 -0
- package/lib/download/core/exportStyles.js +19 -0
- package/lib/download/core/exportStyles.js.map +1 -0
- package/lib/download/core/imageResolution.d.ts +88 -0
- package/lib/download/core/imageResolution.d.ts.map +1 -0
- package/lib/download/core/imageResolution.js +77 -0
- package/lib/download/core/imageResolution.js.map +1 -0
- package/lib/download/core/index.d.ts +13 -0
- package/lib/download/core/index.d.ts.map +1 -1
- package/lib/download/core/index.js +8 -0
- package/lib/download/core/index.js.map +1 -1
- package/lib/download/core/pictureExport.d.ts +93 -0
- package/lib/download/core/pictureExport.d.ts.map +1 -0
- package/lib/download/core/pictureExport.js +116 -0
- package/lib/download/core/pictureExport.js.map +1 -0
- package/lib/download/core/stackedDrawing.d.ts +36 -0
- package/lib/download/core/stackedDrawing.d.ts.map +1 -0
- package/lib/download/core/stackedDrawing.js +98 -0
- package/lib/download/core/stackedDrawing.js.map +1 -0
- package/lib/download/core/svgBounds.d.ts +44 -0
- package/lib/download/core/svgBounds.d.ts.map +1 -0
- package/lib/download/core/svgBounds.js +69 -0
- package/lib/download/core/svgBounds.js.map +1 -0
- package/lib/download/core/svgNamespace.d.ts +9 -0
- package/lib/download/core/svgNamespace.d.ts.map +1 -0
- package/lib/download/core/svgNamespace.js +10 -0
- package/lib/download/core/svgNamespace.js.map +1 -0
- package/lib/download/core/svgToPng.d.ts +43 -0
- package/lib/download/core/svgToPng.d.ts.map +1 -0
- package/lib/download/core/svgToPng.js +79 -0
- package/lib/download/core/svgToPng.js.map +1 -0
- package/lib/download/core/svgToString.d.ts +45 -0
- package/lib/download/core/svgToString.d.ts.map +1 -0
- package/lib/download/core/svgToString.js +58 -0
- package/lib/download/core/svgToString.js.map +1 -0
- package/lib/download/ui/ExportDialogFrame.d.ts +46 -0
- package/lib/download/ui/ExportDialogFrame.d.ts.map +1 -0
- package/lib/download/ui/ExportDialogFrame.js +24 -0
- package/lib/download/ui/ExportDialogFrame.js.map +1 -0
- package/lib/download/ui/ExportImageDialog.d.ts +47 -0
- package/lib/download/ui/ExportImageDialog.d.ts.map +1 -0
- package/lib/download/ui/ExportImageDialog.js +25 -0
- package/lib/download/ui/ExportImageDialog.js.map +1 -0
- package/lib/download/ui/ExportNameField.d.ts +29 -0
- package/lib/download/ui/ExportNameField.d.ts.map +1 -0
- package/lib/download/ui/ExportNameField.js +99 -0
- package/lib/download/ui/ExportNameField.js.map +1 -0
- package/lib/download/ui/ExportPictureSection.d.ts +38 -0
- package/lib/download/ui/ExportPictureSection.d.ts.map +1 -0
- package/lib/download/ui/ExportPictureSection.js +48 -0
- package/lib/download/ui/ExportPictureSection.js.map +1 -0
- package/lib/download/ui/index.d.ts +10 -0
- package/lib/download/ui/index.d.ts.map +1 -1
- package/lib/download/ui/index.js +5 -0
- package/lib/download/ui/index.js.map +1 -1
- package/lib/download/ui/useDrawingBox.d.ts +23 -0
- package/lib/download/ui/useDrawingBox.d.ts.map +1 -0
- package/lib/download/ui/useDrawingBox.js +21 -0
- package/lib/download/ui/useDrawingBox.js.map +1 -0
- package/lib/error/core/describeSource.d.ts +17 -0
- package/lib/error/core/describeSource.d.ts.map +1 -0
- package/lib/error/core/describeSource.js +19 -0
- package/lib/error/core/describeSource.js.map +1 -0
- package/lib/error/core/index.d.ts +1 -0
- package/lib/error/core/index.d.ts.map +1 -1
- package/lib/error/core/index.js +1 -0
- package/lib/error/core/index.js.map +1 -1
- package/lib/help/ui/HelpBody.d.ts +10 -1
- package/lib/help/ui/HelpBody.d.ts.map +1 -1
- package/lib/help/ui/HelpBody.js +24 -1
- package/lib/help/ui/HelpBody.js.map +1 -1
- package/lib/help/ui/index.d.ts +1 -1
- package/lib/help/ui/index.d.ts.map +1 -1
- package/lib/help/ui/index.js.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/analysisSpectra.d.ts +46 -0
- package/lib/ir/core/analysisSpectra.d.ts.map +1 -0
- package/lib/ir/core/analysisSpectra.js +187 -0
- package/lib/ir/core/analysisSpectra.js.map +1 -0
- package/lib/ir/core/assignBands.d.ts +83 -0
- package/lib/ir/core/assignBands.d.ts.map +1 -0
- package/lib/ir/core/assignBands.js +83 -0
- package/lib/ir/core/assignBands.js.map +1 -0
- package/lib/ir/core/bandAssignments.d.ts +47 -0
- package/lib/ir/core/bandAssignments.d.ts.map +1 -0
- package/lib/ir/core/bandAssignments.js +305 -0
- package/lib/ir/core/bandAssignments.js.map +1 -0
- package/lib/ir/core/bandLabelPlan.d.ts +93 -0
- package/lib/ir/core/bandLabelPlan.d.ts.map +1 -0
- package/lib/ir/core/bandLabelPlan.js +104 -0
- package/lib/ir/core/bandLabelPlan.js.map +1 -0
- package/lib/ir/core/detectIrFormat.d.ts +23 -0
- package/lib/ir/core/detectIrFormat.d.ts.map +1 -0
- package/lib/ir/core/detectIrFormat.js +133 -0
- package/lib/ir/core/detectIrFormat.js.map +1 -0
- package/lib/ir/core/downloadSpectra.d.ts +26 -0
- package/lib/ir/core/downloadSpectra.d.ts.map +1 -0
- package/lib/ir/core/downloadSpectra.js +37 -0
- package/lib/ir/core/downloadSpectra.js.map +1 -0
- package/lib/ir/core/fromJcamp.d.ts +35 -0
- package/lib/ir/core/fromJcamp.d.ts.map +1 -0
- package/lib/ir/core/fromJcamp.js +48 -0
- package/lib/ir/core/fromJcamp.js.map +1 -0
- package/lib/ir/core/fromSpc.d.ts +30 -0
- package/lib/ir/core/fromSpc.d.ts.map +1 -0
- package/lib/ir/core/fromSpc.js +40 -0
- package/lib/ir/core/fromSpc.js.map +1 -0
- package/lib/ir/core/index.d.ts +51 -0
- package/lib/ir/core/index.d.ts.map +1 -0
- package/lib/ir/core/index.js +35 -0
- package/lib/ir/core/index.js.map +1 -0
- package/lib/ir/core/irBand.d.ts +45 -0
- package/lib/ir/core/irBand.d.ts.map +1 -0
- package/lib/ir/core/irBand.js +30 -0
- package/lib/ir/core/irBand.js.map +1 -0
- package/lib/ir/core/irCommands.d.ts +168 -0
- package/lib/ir/core/irCommands.d.ts.map +1 -0
- package/lib/ir/core/irCommands.js +94 -0
- package/lib/ir/core/irCommands.js.map +1 -0
- package/lib/ir/core/irDomain.d.ts +63 -0
- package/lib/ir/core/irDomain.d.ts.map +1 -0
- package/lib/ir/core/irDomain.js +136 -0
- package/lib/ir/core/irDomain.js.map +1 -0
- package/lib/ir/core/irEditorApi.d.ts +42 -0
- package/lib/ir/core/irEditorApi.d.ts.map +1 -0
- package/lib/ir/core/irEditorApi.js +10 -0
- package/lib/ir/core/irEditorApi.js.map +1 -0
- package/lib/ir/core/irFormat.d.ts +42 -0
- package/lib/ir/core/irFormat.d.ts.map +1 -0
- package/lib/ir/core/irFormat.js +51 -0
- package/lib/ir/core/irFormat.js.map +1 -0
- package/lib/ir/core/irMode.d.ts +160 -0
- package/lib/ir/core/irMode.d.ts.map +1 -0
- package/lib/ir/core/irMode.js +175 -0
- package/lib/ir/core/irMode.js.map +1 -0
- package/lib/ir/core/irReducer.d.ts +101 -0
- package/lib/ir/core/irReducer.d.ts.map +1 -0
- package/lib/ir/core/irReducer.js +207 -0
- package/lib/ir/core/irReducer.js.map +1 -0
- package/lib/ir/core/irSidePanels.d.ts +22 -0
- package/lib/ir/core/irSidePanels.d.ts.map +1 -0
- package/lib/ir/core/irSidePanels.js +12 -0
- package/lib/ir/core/irSidePanels.js.map +1 -0
- package/lib/ir/core/irSpectrum.d.ts +140 -0
- package/lib/ir/core/irSpectrum.d.ts.map +1 -0
- package/lib/ir/core/irSpectrum.js +34 -0
- package/lib/ir/core/irSpectrum.js.map +1 -0
- package/lib/ir/core/irState.d.ts +119 -0
- package/lib/ir/core/irState.d.ts.map +1 -0
- package/lib/ir/core/irState.js +92 -0
- package/lib/ir/core/irState.js.map +1 -0
- package/lib/ir/core/loadIrSpectra.d.ts +36 -0
- package/lib/ir/core/loadIrSpectra.d.ts.map +1 -0
- package/lib/ir/core/loadIrSpectra.js +44 -0
- package/lib/ir/core/loadIrSpectra.js.map +1 -0
- package/lib/ir/core/nearestBand.d.ts +35 -0
- package/lib/ir/core/nearestBand.d.ts.map +1 -0
- package/lib/ir/core/nearestBand.js +47 -0
- package/lib/ir/core/nearestBand.js.map +1 -0
- package/lib/ir/core/pickBands.d.ts +70 -0
- package/lib/ir/core/pickBands.d.ts.map +1 -0
- package/lib/ir/core/pickBands.js +125 -0
- package/lib/ir/core/pickBands.js.map +1 -0
- package/lib/ir/core/spectrumJcamp.d.ts +58 -0
- package/lib/ir/core/spectrumJcamp.d.ts.map +1 -0
- package/lib/ir/core/spectrumJcamp.js +156 -0
- package/lib/ir/core/spectrumJcamp.js.map +1 -0
- package/lib/ir/core/toIrSpectrum.d.ts +59 -0
- package/lib/ir/core/toIrSpectrum.d.ts.map +1 -0
- package/lib/ir/core/toIrSpectrum.js +56 -0
- package/lib/ir/core/toIrSpectrum.js.map +1 -0
- package/lib/ir/ui/BandMarks.d.ts +52 -0
- package/lib/ir/ui/BandMarks.d.ts.map +1 -0
- package/lib/ir/ui/BandMarks.js +71 -0
- package/lib/ir/ui/BandMarks.js.map +1 -0
- package/lib/ir/ui/BandsPanel.d.ts +31 -0
- package/lib/ir/ui/BandsPanel.d.ts.map +1 -0
- package/lib/ir/ui/BandsPanel.js +94 -0
- package/lib/ir/ui/BandsPanel.js.map +1 -0
- package/lib/ir/ui/IrAboutDialog.d.ts +18 -0
- package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -0
- package/lib/ir/ui/IrAboutDialog.js +32 -0
- package/lib/ir/ui/IrAboutDialog.js.map +1 -0
- package/lib/ir/ui/IrCanvas.d.ts +38 -0
- package/lib/ir/ui/IrCanvas.d.ts.map +1 -0
- package/lib/ir/ui/IrCanvas.js +41 -0
- package/lib/ir/ui/IrCanvas.js.map +1 -0
- package/lib/ir/ui/IrChart.d.ts +28 -0
- package/lib/ir/ui/IrChart.d.ts.map +1 -0
- package/lib/ir/ui/IrChart.js +114 -0
- package/lib/ir/ui/IrChart.js.map +1 -0
- package/lib/ir/ui/IrCommandProvider.d.ts +15 -0
- package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -0
- package/lib/ir/ui/IrCommandProvider.js +14 -0
- package/lib/ir/ui/IrCommandProvider.js.map +1 -0
- package/lib/ir/ui/IrCommandTooltip.d.ts +16 -0
- package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -0
- package/lib/ir/ui/IrCommandTooltip.js +22 -0
- package/lib/ir/ui/IrCommandTooltip.js.map +1 -0
- package/lib/ir/ui/IrDocumentationDialog.d.ts +18 -0
- package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -0
- package/lib/ir/ui/IrDocumentationDialog.js +68 -0
- package/lib/ir/ui/IrDocumentationDialog.js.map +1 -0
- package/lib/ir/ui/IrEditor.d.ts +60 -0
- package/lib/ir/ui/IrEditor.d.ts.map +1 -0
- package/lib/ir/ui/IrEditor.js +42 -0
- package/lib/ir/ui/IrEditor.js.map +1 -0
- package/lib/ir/ui/IrHeader.d.ts +13 -0
- package/lib/ir/ui/IrHeader.d.ts.map +1 -0
- package/lib/ir/ui/IrHeader.js +21 -0
- package/lib/ir/ui/IrHeader.js.map +1 -0
- package/lib/ir/ui/IrLogo.d.ts +20 -0
- package/lib/ir/ui/IrLogo.d.ts.map +1 -0
- package/lib/ir/ui/IrLogo.js +17 -0
- package/lib/ir/ui/IrLogo.js.map +1 -0
- package/lib/ir/ui/IrPointerTracker.d.ts +29 -0
- package/lib/ir/ui/IrPointerTracker.d.ts.map +1 -0
- package/lib/ir/ui/IrPointerTracker.js +47 -0
- package/lib/ir/ui/IrPointerTracker.js.map +1 -0
- package/lib/ir/ui/IrShell.d.ts +25 -0
- package/lib/ir/ui/IrShell.d.ts.map +1 -0
- package/lib/ir/ui/IrShell.js +178 -0
- package/lib/ir/ui/IrShell.js.map +1 -0
- package/lib/ir/ui/IrSidePanel.d.ts +26 -0
- package/lib/ir/ui/IrSidePanel.d.ts.map +1 -0
- package/lib/ir/ui/IrSidePanel.js +39 -0
- package/lib/ir/ui/IrSidePanel.js.map +1 -0
- package/lib/ir/ui/IrStateProvider.d.ts +19 -0
- package/lib/ir/ui/IrStateProvider.d.ts.map +1 -0
- package/lib/ir/ui/IrStateProvider.js +16 -0
- package/lib/ir/ui/IrStateProvider.js.map +1 -0
- package/lib/ir/ui/IrStatusBar.d.ts +14 -0
- package/lib/ir/ui/IrStatusBar.d.ts.map +1 -0
- package/lib/ir/ui/IrStatusBar.js +48 -0
- package/lib/ir/ui/IrStatusBar.js.map +1 -0
- package/lib/ir/ui/IrToolbar.d.ts +18 -0
- package/lib/ir/ui/IrToolbar.d.ts.map +1 -0
- package/lib/ir/ui/IrToolbar.js +32 -0
- package/lib/ir/ui/IrToolbar.js.map +1 -0
- package/lib/ir/ui/IrTraces.d.ts +63 -0
- package/lib/ir/ui/IrTraces.d.ts.map +1 -0
- package/lib/ir/ui/IrTraces.js +72 -0
- package/lib/ir/ui/IrTraces.js.map +1 -0
- package/lib/ir/ui/MetadataPanel.d.ts +15 -0
- package/lib/ir/ui/MetadataPanel.d.ts.map +1 -0
- package/lib/ir/ui/MetadataPanel.js +49 -0
- package/lib/ir/ui/MetadataPanel.js.map +1 -0
- package/lib/ir/ui/SpectraPanel.d.ts +20 -0
- package/lib/ir/ui/SpectraPanel.d.ts.map +1 -0
- package/lib/ir/ui/SpectraPanel.js +42 -0
- package/lib/ir/ui/SpectraPanel.js.map +1 -0
- package/lib/ir/ui/SpectrumRow.d.ts +26 -0
- package/lib/ir/ui/SpectrumRow.d.ts.map +1 -0
- package/lib/ir/ui/SpectrumRow.js +41 -0
- package/lib/ir/ui/SpectrumRow.js.map +1 -0
- package/lib/ir/ui/index.d.ts +56 -0
- package/lib/ir/ui/index.d.ts.map +1 -0
- package/lib/ir/ui/index.js +36 -0
- package/lib/ir/ui/index.js.map +1 -0
- package/lib/ir/ui/irActions.d.ts +52 -0
- package/lib/ir/ui/irActions.d.ts.map +1 -0
- package/lib/ir/ui/irActions.js +62 -0
- package/lib/ir/ui/irActions.js.map +1 -0
- package/lib/ir/ui/irChartProps.d.ts +116 -0
- package/lib/ir/ui/irChartProps.d.ts.map +1 -0
- package/lib/ir/ui/irChartProps.js +14 -0
- package/lib/ir/ui/irChartProps.js.map +1 -0
- package/lib/ir/ui/irCommandContext.d.ts +35 -0
- package/lib/ir/ui/irCommandContext.d.ts.map +1 -0
- package/lib/ir/ui/irCommandContext.js +44 -0
- package/lib/ir/ui/irCommandContext.js.map +1 -0
- package/lib/ir/ui/irStateContext.d.ts +26 -0
- package/lib/ir/ui/irStateContext.d.ts.map +1 -0
- package/lib/ir/ui/irStateContext.js +37 -0
- package/lib/ir/ui/irStateContext.js.map +1 -0
- package/lib/ir/ui/useIrEditor.d.ts +51 -0
- package/lib/ir/ui/useIrEditor.d.ts.map +1 -0
- package/lib/ir/ui/useIrEditor.js +88 -0
- package/lib/ir/ui/useIrEditor.js.map +1 -0
- package/lib/ir/ui/useIrPointer.d.ts +66 -0
- package/lib/ir/ui/useIrPointer.d.ts.map +1 -0
- package/lib/ir/ui/useIrPointer.js +53 -0
- package/lib/ir/ui/useIrPointer.js.map +1 -0
- package/lib/ir/ui/useIrShortcuts.d.ts +24 -0
- package/lib/ir/ui/useIrShortcuts.d.ts.map +1 -0
- package/lib/ir/ui/useIrShortcuts.js +73 -0
- package/lib/ir/ui/useIrShortcuts.js.map +1 -0
- package/lib/ir/ui/useIrZoom.d.ts +51 -0
- package/lib/ir/ui/useIrZoom.d.ts.map +1 -0
- package/lib/ir/ui/useIrZoom.js +46 -0
- package/lib/ir/ui/useIrZoom.js.map +1 -0
- package/lib/ir.d.ts +13 -0
- package/lib/ir.d.ts.map +1 -0
- package/lib/ir.js +13 -0
- package/lib/ir.js.map +1 -0
- package/lib/locales/de.json +3 -0
- package/lib/locales/en.json +3 -0
- package/lib/locales/es.json +3 -0
- package/lib/locales/fr.json +3 -0
- package/lib/panel/core/dialogStyles.d.ts +13 -0
- package/lib/panel/core/dialogStyles.d.ts.map +1 -0
- package/lib/panel/core/dialogStyles.js +11 -0
- package/lib/panel/core/dialogStyles.js.map +1 -0
- package/lib/panel/core/index.d.ts +19 -0
- package/lib/panel/core/index.d.ts.map +1 -0
- package/lib/panel/core/index.js +18 -0
- package/lib/panel/core/index.js.map +1 -0
- package/lib/panel/core/isEditingField.d.ts +17 -0
- package/lib/panel/core/isEditingField.d.ts.map +1 -0
- package/lib/panel/core/isEditingField.js +25 -0
- package/lib/panel/core/isEditingField.js.map +1 -0
- package/lib/panel/core/panelStyles.d.ts +242 -0
- package/lib/panel/core/panelStyles.d.ts.map +1 -0
- package/lib/panel/core/panelStyles.js +228 -0
- package/lib/panel/core/panelStyles.js.map +1 -0
- package/lib/panel/core/rowSpacers.d.ts +38 -0
- package/lib/panel/core/rowSpacers.d.ts.map +1 -0
- package/lib/panel/core/rowSpacers.js +31 -0
- package/lib/panel/core/rowSpacers.js.map +1 -0
- package/lib/panel/core/statusBar.d.ts +44 -0
- package/lib/panel/core/statusBar.d.ts.map +1 -0
- package/lib/panel/core/statusBar.js +40 -0
- package/lib/panel/core/statusBar.js.map +1 -0
- package/lib/panel/core/textFilter.d.ts +22 -0
- package/lib/panel/core/textFilter.d.ts.map +1 -0
- package/lib/panel/core/textFilter.js +32 -0
- package/lib/panel/core/textFilter.js.map +1 -0
- package/lib/panel/core/yieldToPainting.d.ts +17 -0
- package/lib/panel/core/yieldToPainting.d.ts.map +1 -0
- package/lib/panel/core/yieldToPainting.js +21 -0
- package/lib/panel/core/yieldToPainting.js.map +1 -0
- package/lib/panel/ui/AboutDialogFrame.d.ts +36 -0
- package/lib/panel/ui/AboutDialogFrame.d.ts.map +1 -0
- package/lib/panel/ui/AboutDialogFrame.js +43 -0
- package/lib/panel/ui/AboutDialogFrame.js.map +1 -0
- package/lib/panel/ui/ClearButton.d.ts +28 -0
- package/lib/panel/ui/ClearButton.d.ts.map +1 -0
- package/lib/panel/ui/ClearButton.js +23 -0
- package/lib/panel/ui/ClearButton.js.map +1 -0
- package/lib/panel/ui/DocumentationDialogFrame.d.ts +39 -0
- package/lib/panel/ui/DocumentationDialogFrame.d.ts.map +1 -0
- package/lib/panel/ui/DocumentationDialogFrame.js +29 -0
- package/lib/panel/ui/DocumentationDialogFrame.js.map +1 -0
- package/lib/panel/ui/FilterInput.d.ts +31 -0
- package/lib/panel/ui/FilterInput.d.ts.map +1 -0
- package/lib/panel/ui/FilterInput.js +23 -0
- package/lib/panel/ui/FilterInput.js.map +1 -0
- package/lib/panel/ui/HelpLabel.d.ts +24 -0
- package/lib/panel/ui/HelpLabel.d.ts.map +1 -0
- package/lib/panel/ui/HelpLabel.js +23 -0
- package/lib/panel/ui/HelpLabel.js.map +1 -0
- package/lib/panel/ui/PanelMessage.d.ts +41 -0
- package/lib/panel/ui/PanelMessage.d.ts.map +1 -0
- package/lib/panel/ui/PanelMessage.js +30 -0
- package/lib/panel/ui/PanelMessage.js.map +1 -0
- package/lib/panel/ui/PanelRail.d.ts +41 -0
- package/lib/panel/ui/PanelRail.d.ts.map +1 -0
- package/lib/panel/ui/PanelRail.js +12 -0
- package/lib/panel/ui/PanelRail.js.map +1 -0
- package/lib/panel/ui/Section.d.ts +25 -0
- package/lib/panel/ui/Section.d.ts.map +1 -0
- package/lib/panel/ui/Section.js +41 -0
- package/lib/panel/ui/Section.js.map +1 -0
- package/lib/panel/ui/SidePanelStack.d.ts +62 -0
- package/lib/panel/ui/SidePanelStack.d.ts.map +1 -0
- package/lib/panel/ui/SidePanelStack.js +40 -0
- package/lib/panel/ui/SidePanelStack.js.map +1 -0
- package/lib/panel/ui/SpectrumColorSwatch.d.ts +33 -0
- package/lib/panel/ui/SpectrumColorSwatch.d.ts.map +1 -0
- package/lib/panel/ui/SpectrumColorSwatch.js +76 -0
- package/lib/panel/ui/SpectrumColorSwatch.js.map +1 -0
- package/lib/panel/ui/index.d.ts +37 -0
- package/lib/panel/ui/index.d.ts.map +1 -0
- package/lib/panel/ui/index.js +24 -0
- package/lib/panel/ui/index.js.map +1 -0
- package/lib/panel/ui/useConfirmOnEnter.d.ts +19 -0
- package/lib/panel/ui/useConfirmOnEnter.d.ts.map +1 -0
- package/lib/panel/ui/useConfirmOnEnter.js +64 -0
- package/lib/panel/ui/useConfirmOnEnter.js.map +1 -0
- package/lib/panel/ui/useFilterBox.d.ts +23 -0
- package/lib/panel/ui/useFilterBox.d.ts.map +1 -0
- package/lib/panel/ui/useFilterBox.js +22 -0
- package/lib/panel/ui/useFilterBox.js.map +1 -0
- package/lib/panel/ui/useVirtualRows.d.ts +46 -0
- package/lib/panel/ui/useVirtualRows.d.ts.map +1 -0
- package/lib/panel/ui/useVirtualRows.js +56 -0
- package/lib/panel/ui/useVirtualRows.js.map +1 -0
- package/lib/panel/ui/useVirtualWindowRows.d.ts +40 -0
- package/lib/panel/ui/useVirtualWindowRows.d.ts.map +1 -0
- package/lib/panel/ui/useVirtualWindowRows.js +65 -0
- package/lib/panel/ui/useVirtualWindowRows.js.map +1 -0
- package/lib/structure/core/conformerBoltzmann.d.ts +56 -0
- package/lib/structure/core/conformerBoltzmann.d.ts.map +1 -0
- package/lib/structure/core/conformerBoltzmann.js +96 -0
- package/lib/structure/core/conformerBoltzmann.js.map +1 -0
- package/lib/structure/core/conformerEnergy.d.ts +69 -0
- package/lib/structure/core/conformerEnergy.d.ts.map +1 -0
- package/lib/structure/core/conformerEnergy.js +47 -0
- package/lib/structure/core/conformerEnergy.js.map +1 -0
- package/lib/structure/core/index.d.ts +3 -0
- package/lib/structure/core/index.d.ts.map +1 -1
- package/lib/structure/core/index.js +2 -0
- package/lib/structure/core/index.js.map +1 -1
- package/lib/structure/ui/ConformerTable.d.ts +73 -0
- package/lib/structure/ui/ConformerTable.d.ts.map +1 -0
- package/lib/structure/ui/ConformerTable.js +259 -0
- package/lib/structure/ui/ConformerTable.js.map +1 -0
- package/lib/structure/ui/conformerColumns.d.ts +30 -0
- package/lib/structure/ui/conformerColumns.d.ts.map +1 -0
- package/lib/structure/ui/conformerColumns.js +37 -0
- package/lib/structure/ui/conformerColumns.js.map +1 -0
- package/lib/ui.d.ts +5 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +3 -0
- package/lib/ui.js.map +1 -1
- package/package.json +8 -1
- package/src/chart/core/axisLabels.ts +117 -0
- package/src/chart/core/boxLayout.ts +126 -0
- package/src/chart/core/chartAxisScale.ts +92 -10
- package/src/chart/core/chartDomain.ts +185 -0
- package/src/chart/core/chartGeometry.ts +159 -0
- package/src/chart/core/chartPane.ts +10 -0
- package/src/chart/core/chartScale.ts +7 -4
- package/src/chart/core/chartTheme.ts +161 -0
- package/src/chart/core/chartViewport.ts +40 -13
- package/src/chart/core/guidePlacement.ts +66 -0
- package/src/chart/core/index.ts +121 -2
- package/src/chart/core/labelStack.ts +72 -0
- package/src/chart/core/legendBox.ts +263 -0
- package/src/chart/core/selectionGeometry.ts +68 -0
- package/src/chart/core/spectrumColor.ts +129 -0
- package/src/chart/core/stackCapacity.ts +162 -0
- package/src/chart/core/svgPoint.ts +77 -0
- package/src/chart/core/tracePath.ts +228 -0
- package/src/chart/core/trackerReadout.ts +78 -0
- package/src/chart/core/viewTransform.ts +287 -0
- package/src/chart/core/zoomDomain.ts +235 -0
- package/src/chart/ui/Axes.tsx +361 -0
- package/src/chart/ui/AxisGuide.tsx +187 -0
- package/src/chart/ui/ChartStack.tsx +130 -0
- package/src/chart/ui/ChartTracker.tsx +101 -0
- package/src/chart/ui/PlotCaption.tsx +108 -0
- package/src/chart/ui/SelectionRect.tsx +52 -0
- package/src/chart/ui/TraceLegend.tsx +193 -0
- package/src/chart/ui/chartGestures.ts +270 -0
- package/src/chart/ui/chartStackLevel.tsx +210 -0
- package/src/chart/ui/chartSurface.ts +66 -0
- package/src/chart/ui/index.ts +35 -0
- package/src/chart/ui/useChartPointer.ts +223 -0
- package/src/chart/ui/useChartSize.ts +115 -0
- package/src/chart/ui/useChartWindow.ts +240 -0
- package/src/chart/ui/useChartZoom.ts +255 -0
- package/src/chart/ui/useWheelListener.ts +62 -0
- package/src/chrome/ui/AccountButton.tsx +185 -0
- package/src/chrome/ui/index.ts +2 -0
- package/src/clipboard/core/copyPng.ts +20 -0
- package/src/clipboard/core/index.ts +1 -0
- package/src/clipboard/ui/ClickToCopy.tsx +9 -1
- package/src/core.ts +1 -0
- package/src/download/core/exportStyles.ts +20 -0
- package/src/download/core/imageResolution.ts +118 -0
- package/src/download/core/index.ts +34 -0
- package/src/download/core/pictureExport.ts +207 -0
- package/src/download/core/stackedDrawing.ts +108 -0
- package/src/download/core/svgBounds.ts +80 -0
- package/src/download/core/svgNamespace.ts +9 -0
- package/src/download/core/svgToPng.ts +121 -0
- package/src/download/core/svgToString.ts +95 -0
- package/src/download/ui/ExportDialogFrame.tsx +86 -0
- package/src/download/ui/ExportImageDialog.tsx +91 -0
- package/src/download/ui/ExportNameField.tsx +148 -0
- package/src/download/ui/ExportPictureSection.tsx +142 -0
- package/src/download/ui/index.ts +11 -0
- package/src/download/ui/useDrawingBox.ts +37 -0
- package/src/error/core/describeSource.ts +18 -0
- package/src/error/core/index.ts +1 -0
- package/src/help/ui/HelpBody.tsx +41 -2
- package/src/help/ui/index.ts +6 -1
- package/src/ir/core/analysisSpectra.ts +231 -0
- package/src/ir/core/assignBands.ts +144 -0
- package/src/ir/core/bandAssignments.ts +329 -0
- package/src/ir/core/bandLabelPlan.ts +194 -0
- package/src/ir/core/detectIrFormat.ts +139 -0
- package/src/ir/core/downloadSpectra.ts +57 -0
- package/src/ir/core/fromJcamp.ts +70 -0
- package/src/ir/core/fromSpc.ts +61 -0
- package/src/ir/core/index.ts +113 -0
- package/src/ir/core/irBand.ts +57 -0
- package/src/ir/core/irCommands.ts +154 -0
- package/src/ir/core/irDomain.ts +163 -0
- package/src/ir/core/irEditorApi.ts +44 -0
- package/src/ir/core/irFormat.ts +57 -0
- package/src/ir/core/irMode.ts +203 -0
- package/src/ir/core/irReducer.ts +273 -0
- package/src/ir/core/irSidePanels.ts +20 -0
- package/src/ir/core/irSpectrum.ts +155 -0
- package/src/ir/core/irState.ts +173 -0
- package/src/ir/core/loadIrSpectra.ts +79 -0
- package/src/ir/core/nearestBand.ts +57 -0
- package/src/ir/core/pickBands.ts +181 -0
- package/src/ir/core/spectrumJcamp.ts +178 -0
- package/src/ir/core/toIrSpectrum.ts +102 -0
- package/src/ir/ui/BandMarks.tsx +166 -0
- package/src/ir/ui/BandsPanel.tsx +271 -0
- package/src/ir/ui/IrAboutDialog.tsx +121 -0
- package/src/ir/ui/IrCanvas.tsx +91 -0
- package/src/ir/ui/IrChart.tsx +215 -0
- package/src/ir/ui/IrCommandProvider.tsx +32 -0
- package/src/ir/ui/IrCommandTooltip.tsx +36 -0
- package/src/ir/ui/IrDocumentationDialog.tsx +174 -0
- package/src/ir/ui/IrEditor.tsx +99 -0
- package/src/ir/ui/IrHeader.tsx +39 -0
- package/src/ir/ui/IrLogo.tsx +49 -0
- package/src/ir/ui/IrPointerTracker.tsx +102 -0
- package/src/ir/ui/IrShell.tsx +285 -0
- package/src/ir/ui/IrSidePanel.tsx +78 -0
- package/src/ir/ui/IrStateProvider.tsx +32 -0
- package/src/ir/ui/IrStatusBar.tsx +97 -0
- package/src/ir/ui/IrToolbar.tsx +102 -0
- package/src/ir/ui/IrTraces.tsx +134 -0
- package/src/ir/ui/MetadataPanel.tsx +88 -0
- package/src/ir/ui/SpectraPanel.tsx +114 -0
- package/src/ir/ui/SpectrumRow.tsx +127 -0
- package/src/ir/ui/index.ts +56 -0
- package/src/ir/ui/irActions.ts +103 -0
- package/src/ir/ui/irChartProps.ts +118 -0
- package/src/ir/ui/irCommandContext.tsx +62 -0
- package/src/ir/ui/irStateContext.ts +48 -0
- package/src/ir/ui/useIrEditor.ts +139 -0
- package/src/ir/ui/useIrPointer.ts +109 -0
- package/src/ir/ui/useIrShortcuts.ts +95 -0
- package/src/ir/ui/useIrZoom.ts +86 -0
- package/src/ir.ts +13 -0
- package/src/locales/de.json +3 -0
- package/src/locales/en.json +3 -0
- package/src/locales/es.json +3 -0
- package/src/locales/fr.json +3 -0
- package/src/panel/core/dialogStyles.ts +11 -0
- package/src/panel/core/index.ts +47 -0
- package/src/panel/core/isEditingField.ts +23 -0
- package/src/panel/core/panelStyles.ts +248 -0
- package/src/panel/core/rowSpacers.ts +50 -0
- package/src/panel/core/statusBar.ts +48 -0
- package/src/panel/core/textFilter.ts +33 -0
- package/src/panel/core/yieldToPainting.ts +20 -0
- package/src/panel/ui/AboutDialogFrame.tsx +100 -0
- package/src/panel/ui/ClearButton.tsx +42 -0
- package/src/panel/ui/DocumentationDialogFrame.tsx +86 -0
- package/src/panel/ui/FilterInput.tsx +60 -0
- package/src/panel/ui/HelpLabel.tsx +43 -0
- package/src/panel/ui/PanelMessage.tsx +64 -0
- package/src/panel/ui/PanelRail.tsx +64 -0
- package/src/panel/ui/Section.tsx +66 -0
- package/src/panel/ui/SidePanelStack.tsx +109 -0
- package/src/panel/ui/SpectrumColorSwatch.tsx +119 -0
- package/src/panel/ui/index.ts +47 -0
- package/src/panel/ui/useConfirmOnEnter.ts +68 -0
- package/src/panel/ui/useFilterBox.ts +35 -0
- package/src/panel/ui/useVirtualRows.ts +82 -0
- package/src/panel/ui/useVirtualWindowRows.ts +86 -0
- package/src/structure/core/conformerBoltzmann.ts +102 -0
- package/src/structure/core/conformerEnergy.ts +97 -0
- package/src/structure/core/index.ts +15 -0
- package/src/structure/ui/ConformerTable.tsx +429 -0
- package/src/structure/ui/conformerColumns.ts +55 -0
- package/src/ui.ts +13 -0
- package/styles/chrome.css +55 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The gestures that move the window a chart is showing.
|
|
3
|
+
*
|
|
4
|
+
* A drag zooms the x axis, because that is the axis a chemist reads: the
|
|
5
|
+
* question is nearly always "what is between 366 and 372", never "what is
|
|
6
|
+
* between forty and sixty percent". The y axis comes along only when the drag is
|
|
7
|
+
* released past the baseline, a gesture that cannot be made by accident and one
|
|
8
|
+
* the preview rectangle announces before the button is let go. The wheel scales
|
|
9
|
+
* the y axis on its own, bringing up the small features being asked about far
|
|
10
|
+
* more often than any box around them, and a double click puts the window back.
|
|
11
|
+
*
|
|
12
|
+
* Which of them a chart answers is `ZoomGestures`, and a viewer is free to offer
|
|
13
|
+
* fewer: a drag can be the rectangle it sweeps out, and the wheel can be left to
|
|
14
|
+
* the page. Neither is a preference to be toggled — it is what the measurement
|
|
15
|
+
* makes worth doing, and `chartDomain.ts` says why.
|
|
16
|
+
*
|
|
17
|
+
* Not every gesture moves the window. A drag can be asked to report the range it
|
|
18
|
+
* swept out, a press that went nowhere is a click, and a host can refuse a press
|
|
19
|
+
* outright so that a handle drawn on the chart keeps the gesture aimed at it;
|
|
20
|
+
* `chartGestures.ts` holds all three, and `zoomDomain.ts` holds what a gesture
|
|
21
|
+
* does to a window. Neither knows anything of React, which is what lets the
|
|
22
|
+
* answer to a gesture be read without a chart on screen.
|
|
23
|
+
*
|
|
24
|
+
* What the window is fitted *to* is handed in rather than worked out here, and
|
|
25
|
+
* that is what makes one hook serve every kind of spectrum: fitting reads the
|
|
26
|
+
* traces, and a mass spectrum's are two per spectrum where an infrared
|
|
27
|
+
* spectrum's are one in either of two units. `useChartWindow` then holds the
|
|
28
|
+
* answer each viewer hands over.
|
|
29
|
+
*/
|
|
30
|
+
import type { RefObject } from 'react';
|
|
31
|
+
import type { ChartDomain, YAxisRules, ZoomGestures } from '../core/chartDomain.ts';
|
|
32
|
+
import type { ChartScale } from '../core/chartScale.ts';
|
|
33
|
+
import type { ZoomSelection } from '../core/zoomDomain.ts';
|
|
34
|
+
import type { ChartGestureReports, ChartZoomHandlers } from './chartGestures.ts';
|
|
35
|
+
import type { ChartWindowOptions } from './useChartWindow.ts';
|
|
36
|
+
/** The chart, what it is fitted to, and which gestures it answers. */
|
|
37
|
+
export interface ChartZoomOptions extends ChartWindowOptions, ChartGestureReports {
|
|
38
|
+
/** The SVG the gestures are made on, as it was handed to its `ref`. */
|
|
39
|
+
svgRef: RefObject<SVGSVGElement | null>;
|
|
40
|
+
/**
|
|
41
|
+
* How the y axis behaves under a gesture — where its baseline is, and whether
|
|
42
|
+
* that baseline is held in the window.
|
|
43
|
+
* @default a stick spectrum's: a baseline of zero, always kept
|
|
44
|
+
*/
|
|
45
|
+
yAxis?: YAxisRules;
|
|
46
|
+
/**
|
|
47
|
+
* Which gestures the chart answers: what a drag asks for, and whether the
|
|
48
|
+
* wheel scales the value axis at all.
|
|
49
|
+
*
|
|
50
|
+
* Both together rather than one at a time, because they are one decision. A
|
|
51
|
+
* viewer that reads its data in more than one way — an infrared spectrum is
|
|
52
|
+
* read as absorbance or as percent transmittance — settles the whole set from
|
|
53
|
+
* whatever it is currently reading, and hands it over as it stands.
|
|
54
|
+
* @default every gesture: a drag along the horizontal axis, and the wheel
|
|
55
|
+
*/
|
|
56
|
+
gestures?: ZoomGestures;
|
|
57
|
+
}
|
|
58
|
+
/** The window, the drag being made in it, and how to work both. */
|
|
59
|
+
export interface ChartZoom {
|
|
60
|
+
/** What the chart is showing. */
|
|
61
|
+
domain: ChartDomain;
|
|
62
|
+
/**
|
|
63
|
+
* The horizontal axis, as every gesture was measured against it: **draw with
|
|
64
|
+
* this rather than building one**, since a second scale beside it is a second
|
|
65
|
+
* chance to get a reversed axis the wrong way round.
|
|
66
|
+
*/
|
|
67
|
+
xScale: ChartScale;
|
|
68
|
+
/** The vertical axis, likewise. */
|
|
69
|
+
yScale: ChartScale;
|
|
70
|
+
/** The drag being made, `null` when none is. */
|
|
71
|
+
selection: ZoomSelection | null;
|
|
72
|
+
/** Put the window back to everything that is drawn. */
|
|
73
|
+
reset: () => void;
|
|
74
|
+
/** Put on the SVG. */
|
|
75
|
+
handlers: ChartZoomHandlers;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Zoom a chart by dragging it, by the wheel and by double clicking it.
|
|
79
|
+
*
|
|
80
|
+
* Which window is on screen — the fit, the one a gesture arrived at, or the one
|
|
81
|
+
* a host imposes — is `useChartWindow`. What is here is what a gesture *is*: the
|
|
82
|
+
* drag as it is made, the rules it is read under, and the answer it comes to.
|
|
83
|
+
* @param options - The chart, the fit and how its y axis behaves.
|
|
84
|
+
* @returns The window and the gestures that move it.
|
|
85
|
+
*/
|
|
86
|
+
export declare function useChartZoom(options: ChartZoomOptions): ChartZoom;
|
|
87
|
+
export { type ChartZoomHandlers } from './chartGestures.ts';
|
|
88
|
+
//# sourceMappingURL=useChartZoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChartZoom.d.ts","sourceRoot":"","sources":["../../../src/chart/ui/useChartZoom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAqC,SAAS,EAAE,MAAM,OAAO,CAAC;AAG1E,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,YAAY,EAEb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9D,sEAAsE;AACtE,MAAM,WAAW,gBACf,SAAQ,kBAAkB,EAAE,mBAAmB;IAC/C,uEAAuE;IACvE,MAAM,EAAE,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IACxC;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,mEAAmE;AACnE,MAAM,WAAW,SAAS;IACxB,iCAAiC;IACjC,MAAM,EAAE,WAAW,CAAC;IACpB;;;;OAIG;IACH,MAAM,EAAE,UAAU,CAAC;IACnB,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,gDAAgD;IAChD,SAAS,EAAE,aAAa,GAAG,IAAI,CAAC;IAChC,uDAAuD;IACvD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,sBAAsB;IACtB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CA2IjE;AAED,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The gestures that move the window a chart is showing.
|
|
3
|
+
*
|
|
4
|
+
* A drag zooms the x axis, because that is the axis a chemist reads: the
|
|
5
|
+
* question is nearly always "what is between 366 and 372", never "what is
|
|
6
|
+
* between forty and sixty percent". The y axis comes along only when the drag is
|
|
7
|
+
* released past the baseline, a gesture that cannot be made by accident and one
|
|
8
|
+
* the preview rectangle announces before the button is let go. The wheel scales
|
|
9
|
+
* the y axis on its own, bringing up the small features being asked about far
|
|
10
|
+
* more often than any box around them, and a double click puts the window back.
|
|
11
|
+
*
|
|
12
|
+
* Which of them a chart answers is `ZoomGestures`, and a viewer is free to offer
|
|
13
|
+
* fewer: a drag can be the rectangle it sweeps out, and the wheel can be left to
|
|
14
|
+
* the page. Neither is a preference to be toggled — it is what the measurement
|
|
15
|
+
* makes worth doing, and `chartDomain.ts` says why.
|
|
16
|
+
*
|
|
17
|
+
* Not every gesture moves the window. A drag can be asked to report the range it
|
|
18
|
+
* swept out, a press that went nowhere is a click, and a host can refuse a press
|
|
19
|
+
* outright so that a handle drawn on the chart keeps the gesture aimed at it;
|
|
20
|
+
* `chartGestures.ts` holds all three, and `zoomDomain.ts` holds what a gesture
|
|
21
|
+
* does to a window. Neither knows anything of React, which is what lets the
|
|
22
|
+
* answer to a gesture be read without a chart on screen.
|
|
23
|
+
*
|
|
24
|
+
* What the window is fitted *to* is handed in rather than worked out here, and
|
|
25
|
+
* that is what makes one hook serve every kind of spectrum: fitting reads the
|
|
26
|
+
* traces, and a mass spectrum's are two per spectrum where an infrared
|
|
27
|
+
* spectrum's are one in either of two units. `useChartWindow` then holds the
|
|
28
|
+
* answer each viewer hands over.
|
|
29
|
+
*/
|
|
30
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
31
|
+
import { DEFAULT_ZOOM_GESTURES } from "../core/chartDomain.js";
|
|
32
|
+
import { chartWheelFactor } from "../core/chartViewport.js";
|
|
33
|
+
import { scaledYAxis, zoomSelection } from "../core/zoomDomain.js";
|
|
34
|
+
import { answeredRelease, draggedTo, releaseDrag, startedDrag, } from "./chartGestures.js";
|
|
35
|
+
import { useChartWindow } from "./useChartWindow.js";
|
|
36
|
+
import { useWheelListener } from "./useWheelListener.js";
|
|
37
|
+
/**
|
|
38
|
+
* Zoom a chart by dragging it, by the wheel and by double clicking it.
|
|
39
|
+
*
|
|
40
|
+
* Which window is on screen — the fit, the one a gesture arrived at, or the one
|
|
41
|
+
* a host imposes — is `useChartWindow`. What is here is what a gesture *is*: the
|
|
42
|
+
* drag as it is made, the rules it is read under, and the answer it comes to.
|
|
43
|
+
* @param options - The chart, the fit and how its y axis behaves.
|
|
44
|
+
* @returns The window and the gestures that move it.
|
|
45
|
+
*/
|
|
46
|
+
export function useChartZoom(options) {
|
|
47
|
+
const { fitted, fitKey, yFitKey, svgRef, plot, yAxis, gestures, reverseX = false, domain: imposed = null, onSelectRange, onClick, shouldStartDrag, } = options;
|
|
48
|
+
const { domain, xScale, yScale, show, reset } = useChartWindow({
|
|
49
|
+
fitted,
|
|
50
|
+
fitKey,
|
|
51
|
+
...(yFitKey === undefined ? {} : { yFitKey }),
|
|
52
|
+
plot,
|
|
53
|
+
domain: imposed,
|
|
54
|
+
reverseX,
|
|
55
|
+
});
|
|
56
|
+
// Taken apart field by field rather than depending on the object, so a viewer
|
|
57
|
+
// rebuilding an equal `yAxis` or `gestures` on every render does not rebuild
|
|
58
|
+
// the rules and every callback hanging off them. Every field has to be listed
|
|
59
|
+
// here: one left out silently falls back to its default, which is how a
|
|
60
|
+
// transmittance chart came to answer a mass spectrum's question about its own
|
|
61
|
+
// baseline.
|
|
62
|
+
const baseline = yAxis?.baseline;
|
|
63
|
+
const keepBaseline = yAxis?.keepBaseline;
|
|
64
|
+
const pointsDown = yAxis?.pointsDown;
|
|
65
|
+
const dragMode = gestures?.drag ?? DEFAULT_ZOOM_GESTURES.drag;
|
|
66
|
+
const wheel = gestures?.wheel ?? DEFAULT_ZOOM_GESTURES.wheel;
|
|
67
|
+
const rules = useMemo(() => ({ baseline, keepBaseline, pointsDown, drag: dragMode }), [baseline, keepBaseline, pointsDown, dragMode]);
|
|
68
|
+
const [drag, setDrag] = useState(null);
|
|
69
|
+
const onWheel = useCallback((event) => {
|
|
70
|
+
// Refused before the event is touched, so a chart that does not answer the
|
|
71
|
+
// wheel scrolls the page under the pointer exactly as the rest of it does.
|
|
72
|
+
// Swallowing the gesture and doing nothing with it would be the one
|
|
73
|
+
// outcome nobody asked for.
|
|
74
|
+
if (!wheel)
|
|
75
|
+
return;
|
|
76
|
+
const factor = chartWheelFactor(event.deltaY, event.deltaMode);
|
|
77
|
+
if (factor === 1)
|
|
78
|
+
return;
|
|
79
|
+
// Heard non-passively for exactly this: without the refusal the chart
|
|
80
|
+
// zooms and the page scrolls out from under it at the same time.
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
show(scaledYAxis(domain, factor, rules.baseline));
|
|
83
|
+
}, [domain, rules.baseline, wheel, show]);
|
|
84
|
+
useWheelListener(svgRef, onWheel);
|
|
85
|
+
const onPointerDown = useCallback((event) => {
|
|
86
|
+
const started = startedDrag(event, svgRef.current, shouldStartDrag);
|
|
87
|
+
if (started !== null)
|
|
88
|
+
setDrag(started);
|
|
89
|
+
}, [svgRef, shouldStartDrag]);
|
|
90
|
+
const onPointerMove = useCallback((event) => {
|
|
91
|
+
const moved = draggedTo(drag, event, svgRef.current);
|
|
92
|
+
if (moved !== null)
|
|
93
|
+
setDrag(moved);
|
|
94
|
+
}, [drag, svgRef]);
|
|
95
|
+
const onPointerUp = useCallback((event) => {
|
|
96
|
+
if (drag?.pointerId !== event.pointerId)
|
|
97
|
+
return;
|
|
98
|
+
releaseDrag(event);
|
|
99
|
+
setDrag(null);
|
|
100
|
+
const released = draggedTo(drag, event, svgRef.current) ?? drag;
|
|
101
|
+
const next = answeredRelease(domain, released, plot, xScale, yScale, rules, { onSelectRange, onClick },
|
|
102
|
+
// Read off the release rather than off the press, because that is where
|
|
103
|
+
// the reader was looking and what `reportClick` already inverts.
|
|
104
|
+
{ shift: event.shiftKey, alt: event.altKey });
|
|
105
|
+
if (next !== null)
|
|
106
|
+
show(next);
|
|
107
|
+
}, [
|
|
108
|
+
drag,
|
|
109
|
+
domain,
|
|
110
|
+
plot,
|
|
111
|
+
xScale,
|
|
112
|
+
yScale,
|
|
113
|
+
svgRef,
|
|
114
|
+
rules,
|
|
115
|
+
onSelectRange,
|
|
116
|
+
onClick,
|
|
117
|
+
show,
|
|
118
|
+
]);
|
|
119
|
+
const onPointerCancel = useCallback((event) => {
|
|
120
|
+
if (drag?.pointerId !== event.pointerId)
|
|
121
|
+
return;
|
|
122
|
+
releaseDrag(event);
|
|
123
|
+
setDrag(null);
|
|
124
|
+
}, [drag]);
|
|
125
|
+
const selection = useMemo(() => zoomSelection(drag, yScale, rules), [drag, yScale, rules]);
|
|
126
|
+
return {
|
|
127
|
+
domain,
|
|
128
|
+
xScale,
|
|
129
|
+
yScale,
|
|
130
|
+
selection,
|
|
131
|
+
reset,
|
|
132
|
+
handlers: {
|
|
133
|
+
onPointerDown,
|
|
134
|
+
onPointerMove,
|
|
135
|
+
onPointerUp,
|
|
136
|
+
onPointerCancel,
|
|
137
|
+
onDoubleClick: reset,
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export {} from "./chartGestures.js";
|
|
142
|
+
//# sourceMappingURL=useChartZoom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChartZoom.js","sourceRoot":"","sources":["../../../src/chart/ui/useChartZoom.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wheel over an element, heard loudly enough to refuse the page its
|
|
3
|
+
* scroll.
|
|
4
|
+
*
|
|
5
|
+
* React's `onWheel` is registered passively — the browser is told in advance
|
|
6
|
+
* that the page may scroll before the handler has had its say — so calling
|
|
7
|
+
* `preventDefault` inside it does nothing at all: the chart zooms and the page
|
|
8
|
+
* scrolls out from under it at the same time. The only way to be heard is to
|
|
9
|
+
* register the listener on the element directly with `{ passive: false }`,
|
|
10
|
+
* which is what this hook exists to do; nothing else about the gesture belongs
|
|
11
|
+
* here.
|
|
12
|
+
*
|
|
13
|
+
* The listener is attached once and reads the handler through a ref refreshed
|
|
14
|
+
* on every commit. Both halves are needed: attaching once is what keeps a
|
|
15
|
+
* pointer resting over the chart from re-registering a listener sixty times a
|
|
16
|
+
* second, and reading the handler live is what stops that one listener from
|
|
17
|
+
* zooming the window as it stood when the chart was mounted.
|
|
18
|
+
*/
|
|
19
|
+
import type { RefObject } from 'react';
|
|
20
|
+
/**
|
|
21
|
+
* Hear the wheel over an element.
|
|
22
|
+
* @param ref - The element, as it was handed to its `ref`.
|
|
23
|
+
* @param handler - What to do with the wheel; free to be an inline arrow, since
|
|
24
|
+
* it is read at the moment the wheel turns rather than closed over when the
|
|
25
|
+
* listener is attached. It is the handler's own business to call
|
|
26
|
+
* `preventDefault` — the listener is registered so that the call is honoured,
|
|
27
|
+
* not so that it is made.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useWheelListener<T extends Element>(ref: RefObject<T | null>, handler: (event: WheelEvent) => void): void;
|
|
30
|
+
//# sourceMappingURL=useWheelListener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWheelListener.d.ts","sourceRoot":"","sources":["../../../src/chart/ui/useWheelListener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,OAAO,EAChD,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,EACxB,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GACnC,IAAI,CAmBN"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wheel over an element, heard loudly enough to refuse the page its
|
|
3
|
+
* scroll.
|
|
4
|
+
*
|
|
5
|
+
* React's `onWheel` is registered passively — the browser is told in advance
|
|
6
|
+
* that the page may scroll before the handler has had its say — so calling
|
|
7
|
+
* `preventDefault` inside it does nothing at all: the chart zooms and the page
|
|
8
|
+
* scrolls out from under it at the same time. The only way to be heard is to
|
|
9
|
+
* register the listener on the element directly with `{ passive: false }`,
|
|
10
|
+
* which is what this hook exists to do; nothing else about the gesture belongs
|
|
11
|
+
* here.
|
|
12
|
+
*
|
|
13
|
+
* The listener is attached once and reads the handler through a ref refreshed
|
|
14
|
+
* on every commit. Both halves are needed: attaching once is what keeps a
|
|
15
|
+
* pointer resting over the chart from re-registering a listener sixty times a
|
|
16
|
+
* second, and reading the handler live is what stops that one listener from
|
|
17
|
+
* zooming the window as it stood when the chart was mounted.
|
|
18
|
+
*/
|
|
19
|
+
import { useEffect, useLayoutEffect, useRef } from 'react';
|
|
20
|
+
/**
|
|
21
|
+
* Hear the wheel over an element.
|
|
22
|
+
* @param ref - The element, as it was handed to its `ref`.
|
|
23
|
+
* @param handler - What to do with the wheel; free to be an inline arrow, since
|
|
24
|
+
* it is read at the moment the wheel turns rather than closed over when the
|
|
25
|
+
* listener is attached. It is the handler's own business to call
|
|
26
|
+
* `preventDefault` — the listener is registered so that the call is honoured,
|
|
27
|
+
* not so that it is made.
|
|
28
|
+
*/
|
|
29
|
+
export function useWheelListener(ref, handler) {
|
|
30
|
+
const latest = useRef(handler);
|
|
31
|
+
useLayoutEffect(() => {
|
|
32
|
+
latest.current = handler;
|
|
33
|
+
});
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const element = ref.current;
|
|
36
|
+
if (element === null)
|
|
37
|
+
return;
|
|
38
|
+
// Typed as the plain `Event` the element's own listener map hands it: an
|
|
39
|
+
// `Element` is not known to carry a wheel, so the narrowing is done here.
|
|
40
|
+
function onWheel(event) {
|
|
41
|
+
if (event instanceof WheelEvent)
|
|
42
|
+
latest.current(event);
|
|
43
|
+
}
|
|
44
|
+
element.addEventListener('wheel', onWheel, WHEEL_LISTENER);
|
|
45
|
+
return () => {
|
|
46
|
+
element.removeEventListener('wheel', onWheel);
|
|
47
|
+
};
|
|
48
|
+
}, [ref]);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Registered non-passively, which is the whole reason this hook exists. Nothing
|
|
52
|
+
* is passed back on removal: a listener is matched on its type, its function
|
|
53
|
+
* and its capture flag alone, and passing the options object there is a type
|
|
54
|
+
* error rather than a courtesy.
|
|
55
|
+
*/
|
|
56
|
+
const WHEEL_LISTENER = { passive: false };
|
|
57
|
+
//# sourceMappingURL=useWheelListener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWheelListener.js","sourceRoot":"","sources":["../../../src/chart/ui/useWheelListener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,GAAwB,EACxB,OAAoC;IAEpC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,eAAe,CAAC,GAAG,EAAE;QACnB,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC5B,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO;QAC7B,yEAAyE;QACzE,0EAA0E;QAC1E,SAAS,OAAO,CAAC,KAAY;YAC3B,IAAI,KAAK,YAAY,UAAU;gBAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QAC3D,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAChD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACZ,CAAC;AAED;;;;;GAKG;AACH,MAAM,cAAc,GAAG,EAAE,OAAO,EAAE,KAAK,EAAW,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { NavItem } from './navItem.ts';
|
|
3
|
+
/** Who the site is answering to. */
|
|
4
|
+
export interface AccountIdentity {
|
|
5
|
+
/** What the person is called on screen. */
|
|
6
|
+
name: string;
|
|
7
|
+
/**
|
|
8
|
+
* What tells the account apart under that name — the address it is held at,
|
|
9
|
+
* the handle it was opened with.
|
|
10
|
+
* @default undefined
|
|
11
|
+
*/
|
|
12
|
+
detail?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The letters the mark is drawn with.
|
|
15
|
+
* @default the first letter of each of the first two words of `name`
|
|
16
|
+
*/
|
|
17
|
+
initials?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AccountButtonProps {
|
|
20
|
+
/** Who is signed in, or `null` when nobody is. */
|
|
21
|
+
identity: AccountIdentity | null;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the site has not heard back yet. Neither state is drawn until it
|
|
24
|
+
* has: a bar that offers to sign in and then turns into a name has told the
|
|
25
|
+
* visitor something false, and it is the state they act on first.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The address signing in happens at, for a site with a page of its own for
|
|
31
|
+
* it. Writing it keeps the entry a real link, so a middle click opens a tab.
|
|
32
|
+
* @default undefined
|
|
33
|
+
*/
|
|
34
|
+
signInHref?: string;
|
|
35
|
+
/**
|
|
36
|
+
* What the site does when the invitation is picked — route to that page, or
|
|
37
|
+
* open a credentials dialog for a site that has no page.
|
|
38
|
+
* @default undefined
|
|
39
|
+
*/
|
|
40
|
+
onSignIn?: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* What the site does when Sign out is picked.
|
|
43
|
+
* @default undefined
|
|
44
|
+
*/
|
|
45
|
+
onSignOut?: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* What the invitation reads, for a site whose accounts are for one kind of
|
|
48
|
+
* person — "Teacher sign in". Two words: it is written out in the bar rather
|
|
49
|
+
* than folded into a glyph.
|
|
50
|
+
* @default the chrome's own word for it, in the language of the page
|
|
51
|
+
*/
|
|
52
|
+
signInLabel?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The account's own pages, listed above Sign out — a profile, a settings
|
|
55
|
+
* page.
|
|
56
|
+
* @default undefined
|
|
57
|
+
*/
|
|
58
|
+
items?: readonly NavItem[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The one utility of the bar that says who the site is answering to: an
|
|
62
|
+
* invitation when nobody is signed in, and the account's mark when somebody is.
|
|
63
|
+
*
|
|
64
|
+
* The two states are told apart by whether an identity is on screen, never by
|
|
65
|
+
* the direction of an arrow. Blueprint's `log-in` and `log-out` are the same
|
|
66
|
+
* arrow either side of the same door, and at 14 px among four other monochrome
|
|
67
|
+
* glyphs nobody reads which side it is on — a site drawing one reports the
|
|
68
|
+
* visitor as signed in while they are signed out. So the invitation is the
|
|
69
|
+
* words `Sign in`, which no mark can be mistaken for, and being signed in is
|
|
70
|
+
* the person's own initials.
|
|
71
|
+
* @param props - Who is signed in, what signing in and out do, and the pages
|
|
72
|
+
* the account's menu lists.
|
|
73
|
+
* @returns The entry, or nothing while the site is still asking.
|
|
74
|
+
*/
|
|
75
|
+
export declare function AccountButton(props: AccountButtonProps): ReactElement | null;
|
|
76
|
+
//# sourceMappingURL=AccountButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountButton.d.ts","sourceRoot":"","sources":["../../../src/chrome/ui/AccountButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IACjC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CAC5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,GAAG,IAAI,CAgF5E"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Menu, MenuDivider, MenuItem, PopoverNext } from '@blueprintjs/core';
|
|
3
|
+
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
4
|
+
import { NavLink } from "./NavLink.js";
|
|
5
|
+
import { isModifiedClick } from "./navItem.js";
|
|
6
|
+
/**
|
|
7
|
+
* The one utility of the bar that says who the site is answering to: an
|
|
8
|
+
* invitation when nobody is signed in, and the account's mark when somebody is.
|
|
9
|
+
*
|
|
10
|
+
* The two states are told apart by whether an identity is on screen, never by
|
|
11
|
+
* the direction of an arrow. Blueprint's `log-in` and `log-out` are the same
|
|
12
|
+
* arrow either side of the same door, and at 14 px among four other monochrome
|
|
13
|
+
* glyphs nobody reads which side it is on — a site drawing one reports the
|
|
14
|
+
* visitor as signed in while they are signed out. So the invitation is the
|
|
15
|
+
* words `Sign in`, which no mark can be mistaken for, and being signed in is
|
|
16
|
+
* the person's own initials.
|
|
17
|
+
* @param props - Who is signed in, what signing in and out do, and the pages
|
|
18
|
+
* the account's menu lists.
|
|
19
|
+
* @returns The entry, or nothing while the site is still asking.
|
|
20
|
+
*/
|
|
21
|
+
export function AccountButton(props) {
|
|
22
|
+
const { identity, loading = false, signInHref, onSignIn, onSignOut, signInLabel, items = [], } = props;
|
|
23
|
+
const t = useChromeT();
|
|
24
|
+
if (loading) {
|
|
25
|
+
// The width of the mark, so the bar does not jump when the answer lands.
|
|
26
|
+
return _jsx("span", { className: "account-button__pending", "aria-hidden": "true" });
|
|
27
|
+
}
|
|
28
|
+
if (identity === null) {
|
|
29
|
+
return (_jsx(NavLink, { className: "account-button account-button--out", item: {
|
|
30
|
+
id: 'account',
|
|
31
|
+
label: signInLabel ?? t('account.signIn'),
|
|
32
|
+
href: signInHref,
|
|
33
|
+
onSelect: onSignIn,
|
|
34
|
+
} }));
|
|
35
|
+
}
|
|
36
|
+
const { name, detail, initials = initialsOf(name) } = identity;
|
|
37
|
+
return (_jsx(PopoverNext, { placement: "bottom-end", content: _jsxs(Menu, { className: "nav-menu account-menu", children: [_jsxs("li", { className: "account-menu__identity", children: [_jsx("span", { className: "account-menu__name", children: name }), detail === undefined ? null : (_jsx("span", { className: "account-menu__detail", children: detail }))] }), _jsx(MenuDivider, {}), items.map((item) => (_jsx(MenuItem, { icon: item.icon, text: item.label, href: item.href, target: item.external ? '_blank' : undefined, onClick: (event) => {
|
|
38
|
+
if (item.onSelect === undefined || isModifiedClick(event)) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
item.onSelect();
|
|
43
|
+
} }, item.id))), items.length === 0 ? null : _jsx(MenuDivider, {}), _jsx(MenuItem, { icon: "log-out", text: t('account.signOut'), onClick: onSignOut })] }), children: _jsx("button", { type: "button", className: "nav-link nav-link--icon account-button account-button--in", title: t('account.signedInAs', { name }), "aria-label": t('account.signedInAs', { name }), children: _jsx("span", { className: "account-mark", children: initials }) }) }));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The letters a name is marked with: the first of each of its first two words,
|
|
47
|
+
* or the first two letters of a name written as one word.
|
|
48
|
+
* @param name - What the person is called.
|
|
49
|
+
* @returns One or two letters, in capitals.
|
|
50
|
+
*/
|
|
51
|
+
function initialsOf(name) {
|
|
52
|
+
const [first, second] = name.split(/\s+/).filter((word) => word !== '');
|
|
53
|
+
if (first === undefined)
|
|
54
|
+
return '?';
|
|
55
|
+
if (second === undefined)
|
|
56
|
+
return firstWordInitials(first);
|
|
57
|
+
return `${first.charAt(0)}${second.charAt(0)}`.toUpperCase();
|
|
58
|
+
}
|
|
59
|
+
// A single word is usually a handle or an address, where the two letters say
|
|
60
|
+
// more than one does — but never the part after the `@`, which every account
|
|
61
|
+
// on the same domain would share.
|
|
62
|
+
function firstWordInitials(word) {
|
|
63
|
+
const [local = ''] = word.split('@');
|
|
64
|
+
return (local === '' ? word : local).slice(0, 2).toUpperCase();
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=AccountButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountButton.js","sourceRoot":"","sources":["../../../src/chrome/ui/AccountButton.tsx"],"names":[],"mappings":"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"}
|
package/lib/chrome/ui/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export type { AccountButtonProps, AccountIdentity } from './AccountButton.tsx';
|
|
2
|
+
export { AccountButton } from './AccountButton.tsx';
|
|
1
3
|
export type { HeaderToggleOption, HeaderToggleProps } from './HeaderToggle.tsx';
|
|
2
4
|
export { HeaderToggle } from './HeaderToggle.tsx';
|
|
3
5
|
export type { NavItem } from './navItem.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chrome/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chrome/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/lib/chrome/ui/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/chrome/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAElD,+EAA+E;AAC/E,sEAAsE;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/chrome/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAElD,+EAA+E;AAC/E,sEAAsE;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Put a PNG on the clipboard.
|
|
3
|
+
*
|
|
4
|
+
* The image is handed over as a promise rather than as a blob on purpose:
|
|
5
|
+
* Safari only allows a clipboard write that the click itself started, so the
|
|
6
|
+
* item has to be built while the handler is still running and the
|
|
7
|
+
* rasterization awaited by the clipboard rather than before it.
|
|
8
|
+
* @param png - The image being rasterized.
|
|
9
|
+
* @returns Whether it was copied. `false` outside a secure context, and in a
|
|
10
|
+
* browser whose clipboard takes text only.
|
|
11
|
+
*/
|
|
12
|
+
export declare function writeImageToClipboard(png: Promise<Blob>): Promise<boolean>;
|
|
13
|
+
//# sourceMappingURL=copyPng.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyPng.d.ts","sourceRoot":"","sources":["../../../src/clipboard/core/copyPng.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,GACjB,OAAO,CAAC,OAAO,CAAC,CAMlB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Put a PNG on the clipboard.
|
|
3
|
+
*
|
|
4
|
+
* The image is handed over as a promise rather than as a blob on purpose:
|
|
5
|
+
* Safari only allows a clipboard write that the click itself started, so the
|
|
6
|
+
* item has to be built while the handler is still running and the
|
|
7
|
+
* rasterization awaited by the clipboard rather than before it.
|
|
8
|
+
* @param png - The image being rasterized.
|
|
9
|
+
* @returns Whether it was copied. `false` outside a secure context, and in a
|
|
10
|
+
* browser whose clipboard takes text only.
|
|
11
|
+
*/
|
|
12
|
+
export async function writeImageToClipboard(png) {
|
|
13
|
+
if (typeof ClipboardItem === 'undefined' || !navigator.clipboard?.write) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
await navigator.clipboard.write([new ClipboardItem({ 'image/png': png })]);
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=copyPng.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyPng.js","sourceRoot":"","sources":["../../../src/clipboard/core/copyPng.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,GAAkB;IAElB,IAAI,OAAO,aAAa,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC;QACxE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,aAAa,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { writeImageToClipboard } from './copyPng.ts';
|
|
1
2
|
export type { WriteBlobToClipboardOptions } from './writeBlobToClipboard.ts';
|
|
2
3
|
export { writeBlobToClipboard } from './writeBlobToClipboard.ts';
|
|
3
4
|
export type { ClipboardContent, ClipboardText } from './writeToClipboard.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/clipboard/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/clipboard/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/clipboard/core/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/clipboard/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -53,6 +53,12 @@ export interface ClickToCopyProps {
|
|
|
53
53
|
* @default undefined
|
|
54
54
|
*/
|
|
55
55
|
style?: CSSProperties;
|
|
56
|
+
/**
|
|
57
|
+
* `data-testid` the element carries, so an end-to-end suite can select the
|
|
58
|
+
* value without depending on the text inside it.
|
|
59
|
+
* @default undefined
|
|
60
|
+
*/
|
|
61
|
+
testId?: string;
|
|
56
62
|
}
|
|
57
63
|
/**
|
|
58
64
|
* A value that is copied by clicking it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClickToCopy.d.ts","sourceRoot":"","sources":["../../../src/clipboard/ui/ClickToCopy.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EAGb,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAKpE,oFAAoF;AACpF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvE,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,EAAE,gBAAgB,GAAG,CAAC,MAAM,gBAAgB,CAAC,CAAC;IACnD,iEAAiE;IACjE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,EAAE,CAAC,EAAE,kBAAkB,CAAC;IACxB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ClickToCopy.d.ts","sourceRoot":"","sources":["../../../src/clipboard/ui/ClickToCopy.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EAGb,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAKpE,oFAAoF;AACpF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvE,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,EAAE,gBAAgB,GAAG,CAAC,MAAM,gBAAgB,CAAC,CAAC;IACnD,iEAAiE;IACjE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,EAAE,CAAC,EAAE,kBAAkB,CAAC;IACxB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CA2EjE"}
|