react-cheminfo 0.38.0 → 0.39.1
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/lib/chart/ui/Axes.d.ts +19 -0
- package/lib/chart/ui/Axes.d.ts.map +1 -1
- package/lib/chart/ui/Axes.js +25 -5
- package/lib/chart/ui/Axes.js.map +1 -1
- package/lib/chrome/ui/NavMenuButton.d.ts.map +1 -1
- package/lib/chrome/ui/NavMenuButton.js +41 -11
- package/lib/chrome/ui/NavMenuButton.js.map +1 -1
- package/lib/chrome/ui/SiteHeader.js +24 -1
- package/lib/chrome/ui/SiteHeader.js.map +1 -1
- package/lib/chrome/ui/navItem.d.ts +7 -0
- package/lib/chrome/ui/navItem.d.ts.map +1 -1
- package/lib/chrome/ui/navItem.js.map +1 -1
- package/lib/citation/ui/entries.d.ts.map +1 -1
- package/lib/citation/ui/entries.js +6 -1
- package/lib/citation/ui/entries.js.map +1 -1
- package/lib/clipboard/ui/ClickToCopy.d.ts +11 -0
- package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -1
- package/lib/clipboard/ui/ClickToCopy.js +28 -10
- package/lib/clipboard/ui/ClickToCopy.js.map +1 -1
- package/lib/clipboard/ui/CopyButton.d.ts +2 -1
- package/lib/clipboard/ui/CopyButton.d.ts.map +1 -1
- package/lib/clipboard/ui/CopyButton.js +2 -1
- package/lib/clipboard/ui/CopyButton.js.map +1 -1
- package/lib/clipboard/ui/CopyableValue.d.ts +24 -4
- package/lib/clipboard/ui/CopyableValue.d.ts.map +1 -1
- package/lib/clipboard/ui/CopyableValue.js +35 -3
- package/lib/clipboard/ui/CopyableValue.js.map +1 -1
- package/lib/clipboard/ui/index.d.ts +1 -1
- package/lib/clipboard/ui/index.d.ts.map +1 -1
- package/lib/clipboard/ui/index.js.map +1 -1
- package/lib/confirm/ui/ConfirmButton.d.ts.map +1 -1
- package/lib/confirm/ui/ConfirmButton.js +2 -1
- package/lib/confirm/ui/ConfirmButton.js.map +1 -1
- package/lib/delimited/ui/TableDataButton.d.ts.map +1 -1
- package/lib/delimited/ui/TableDataButton.js +2 -1
- package/lib/delimited/ui/TableDataButton.js.map +1 -1
- package/lib/download/core/figureSvg.d.ts.map +1 -1
- package/lib/download/core/figureSvg.js +37 -12
- package/lib/download/core/figureSvg.js.map +1 -1
- package/lib/help/ui/HelpToolbarButton.d.ts.map +1 -1
- package/lib/help/ui/HelpToolbarButton.js +2 -1
- package/lib/help/ui/HelpToolbarButton.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/locales/de.json +39 -4
- package/lib/locales/en.json +39 -4
- package/lib/locales/es.json +39 -4
- package/lib/locales/fr.json +39 -4
- package/lib/locales/it.json +39 -4
- package/lib/number/ui/NumberInput.js +1 -1
- package/lib/number/ui/NumberInput.js.map +1 -1
- package/lib/overlay/ui/OverlayIconButton.d.ts.map +1 -1
- package/lib/overlay/ui/OverlayIconButton.js +1 -1
- package/lib/overlay/ui/OverlayIconButton.js.map +1 -1
- package/lib/panel/ui/ClearButton.d.ts.map +1 -1
- package/lib/panel/ui/ClearButton.js +1 -1
- package/lib/panel/ui/ClearButton.js.map +1 -1
- package/lib/pedagogy/core/inlineMarks.d.ts +9 -5
- package/lib/pedagogy/core/inlineMarks.d.ts.map +1 -1
- package/lib/pedagogy/core/inlineMarks.js +14 -6
- package/lib/pedagogy/core/inlineMarks.js.map +1 -1
- package/lib/pedagogy/ui/GlossaryDefinition.d.ts +4 -10
- package/lib/pedagogy/ui/GlossaryDefinition.d.ts.map +1 -1
- package/lib/pedagogy/ui/GlossaryDefinition.js +7 -7
- package/lib/pedagogy/ui/GlossaryDefinition.js.map +1 -1
- package/lib/pedagogy/ui/GlossaryIndex.d.ts.map +1 -1
- package/lib/pedagogy/ui/GlossaryIndex.js +1 -1
- package/lib/pedagogy/ui/GlossaryIndex.js.map +1 -1
- package/lib/pedagogy/ui/GlossaryProvider.d.ts +7 -0
- package/lib/pedagogy/ui/GlossaryProvider.d.ts.map +1 -1
- package/lib/pedagogy/ui/GlossaryProvider.js +3 -2
- package/lib/pedagogy/ui/GlossaryProvider.js.map +1 -1
- package/lib/pedagogy/ui/GlossaryText.d.ts +7 -2
- package/lib/pedagogy/ui/GlossaryText.d.ts.map +1 -1
- package/lib/pedagogy/ui/GlossaryText.js +3 -2
- package/lib/pedagogy/ui/GlossaryText.js.map +1 -1
- package/lib/pedagogy/ui/InlineText.d.ts +8 -2
- package/lib/pedagogy/ui/InlineText.d.ts.map +1 -1
- package/lib/pedagogy/ui/InlineText.js +7 -2
- package/lib/pedagogy/ui/InlineText.js.map +1 -1
- package/lib/pedagogy/ui/ReferenceSectionBlock.d.ts +4 -1
- package/lib/pedagogy/ui/ReferenceSectionBlock.d.ts.map +1 -1
- package/lib/pedagogy/ui/ReferenceSectionBlock.js +2 -1
- package/lib/pedagogy/ui/ReferenceSectionBlock.js.map +1 -1
- package/lib/pedagogy/ui/SyntaxTooltip.d.ts.map +1 -1
- package/lib/pedagogy/ui/SyntaxTooltip.js +11 -10
- package/lib/pedagogy/ui/SyntaxTooltip.js.map +1 -1
- package/lib/pedagogy/ui/TutorialStepStrip.d.ts.map +1 -1
- package/lib/pedagogy/ui/TutorialStepStrip.js +18 -4
- package/lib/pedagogy/ui/TutorialStepStrip.js.map +1 -1
- package/lib/pedagogy/ui/glossaryContext.d.ts +7 -0
- package/lib/pedagogy/ui/glossaryContext.d.ts.map +1 -1
- package/lib/pedagogy/ui/glossaryContext.js.map +1 -1
- package/lib/pedagogy/ui/index.d.ts +1 -1
- package/lib/pedagogy/ui/index.d.ts.map +1 -1
- package/lib/pedagogy/ui/inlineSegments.d.ts +5 -0
- package/lib/pedagogy/ui/inlineSegments.d.ts.map +1 -1
- package/lib/pedagogy/ui/inlineSegments.js +2 -0
- package/lib/pedagogy/ui/inlineSegments.js.map +1 -1
- package/lib/pedagogy/ui/pedagogyStyle.d.ts +8 -9
- package/lib/pedagogy/ui/pedagogyStyle.d.ts.map +1 -1
- package/lib/pedagogy/ui/pedagogyStyle.js +10 -18
- package/lib/pedagogy/ui/pedagogyStyle.js.map +1 -1
- package/lib/seo/core/plainDescription.d.ts +2 -2
- package/lib/seo/core/plainDescription.js +5 -2
- package/lib/seo/core/plainDescription.js.map +1 -1
- package/lib/share/core/devices.d.ts +41 -0
- package/lib/share/core/devices.d.ts.map +1 -0
- package/lib/share/core/devices.js +58 -0
- package/lib/share/core/devices.js.map +1 -0
- package/lib/share/core/index.d.ts +4 -0
- package/lib/share/core/index.d.ts.map +1 -1
- package/lib/share/core/index.js +2 -0
- package/lib/share/core/index.js.map +1 -1
- package/lib/share/core/regions.d.ts +43 -0
- package/lib/share/core/regions.d.ts.map +1 -0
- package/lib/share/core/regions.js +71 -0
- package/lib/share/core/regions.js.map +1 -0
- package/lib/share/ui/HiddenPartsProvider.d.ts.map +1 -1
- package/lib/share/ui/HiddenPartsProvider.js +4 -1
- package/lib/share/ui/HiddenPartsProvider.js.map +1 -1
- package/lib/share/ui/PagePart.d.ts.map +1 -1
- package/lib/share/ui/PagePart.js +10 -1
- package/lib/share/ui/PagePart.js.map +1 -1
- package/lib/share/ui/ShareButton.d.ts.map +1 -1
- package/lib/share/ui/ShareButton.js +3 -4
- package/lib/share/ui/ShareButton.js.map +1 -1
- package/lib/share/ui/ShareConfigOptions.d.ts +6 -1
- package/lib/share/ui/ShareConfigOptions.d.ts.map +1 -1
- package/lib/share/ui/ShareConfigOptions.js +6 -13
- package/lib/share/ui/ShareConfigOptions.js.map +1 -1
- package/lib/share/ui/ShareDialog.d.ts +14 -0
- package/lib/share/ui/ShareDialog.d.ts.map +1 -1
- package/lib/share/ui/ShareDialog.js +3 -3
- package/lib/share/ui/ShareDialog.js.map +1 -1
- package/lib/share/ui/ShareDialogContent.d.ts +2 -2
- package/lib/share/ui/ShareDialogContent.d.ts.map +1 -1
- package/lib/share/ui/ShareDialogContent.js +36 -30
- package/lib/share/ui/ShareDialogContent.js.map +1 -1
- package/lib/share/ui/ShareLinkBar.d.ts +21 -0
- package/lib/share/ui/ShareLinkBar.d.ts.map +1 -0
- package/lib/share/ui/ShareLinkBar.js +32 -0
- package/lib/share/ui/ShareLinkBar.js.map +1 -0
- package/lib/share/ui/SharePanes.d.ts +17 -0
- package/lib/share/ui/SharePanes.d.ts.map +1 -0
- package/lib/share/ui/SharePanes.js +27 -0
- package/lib/share/ui/SharePanes.js.map +1 -0
- package/lib/share/ui/SharePartOptions.d.ts +9 -3
- package/lib/share/ui/SharePartOptions.d.ts.map +1 -1
- package/lib/share/ui/SharePartOptions.js +12 -16
- package/lib/share/ui/SharePartOptions.js.map +1 -1
- package/lib/share/ui/SharePartRow.d.ts +37 -0
- package/lib/share/ui/SharePartRow.d.ts.map +1 -0
- package/lib/share/ui/SharePartRow.js +25 -0
- package/lib/share/ui/SharePartRow.js.map +1 -0
- package/lib/share/ui/SharePresetTabs.d.ts +10 -7
- package/lib/share/ui/SharePresetTabs.d.ts.map +1 -1
- package/lib/share/ui/SharePresetTabs.js +17 -17
- package/lib/share/ui/SharePresetTabs.js.map +1 -1
- package/lib/share/ui/SharePreview.d.ts +32 -0
- package/lib/share/ui/SharePreview.d.ts.map +1 -0
- package/lib/share/ui/SharePreview.js +129 -0
- package/lib/share/ui/SharePreview.js.map +1 -0
- package/lib/share/ui/SharePreviewDevices.d.ts +20 -0
- package/lib/share/ui/SharePreviewDevices.d.ts.map +1 -0
- package/lib/share/ui/SharePreviewDevices.js +40 -0
- package/lib/share/ui/SharePreviewDevices.js.map +1 -0
- package/lib/share/ui/index.d.ts +1 -0
- package/lib/share/ui/index.d.ts.map +1 -1
- package/lib/share/ui/index.js.map +1 -1
- package/lib/share/ui/shareMarking.d.ts +14 -0
- package/lib/share/ui/shareMarking.d.ts.map +1 -0
- package/lib/share/ui/shareMarking.js +17 -0
- package/lib/share/ui/shareMarking.js.map +1 -0
- package/lib/share/ui/useShareRegionReports.d.ts +12 -0
- package/lib/share/ui/useShareRegionReports.d.ts.map +1 -0
- package/lib/share/ui/useShareRegionReports.js +102 -0
- package/lib/share/ui/useShareRegionReports.js.map +1 -0
- package/lib/shared/ui/ActionTooltip.d.ts +42 -0
- package/lib/shared/ui/ActionTooltip.d.ts.map +1 -0
- package/lib/shared/ui/ActionTooltip.js +21 -0
- package/lib/shared/ui/ActionTooltip.js.map +1 -0
- package/lib/shared/ui/index.d.ts +4 -0
- package/lib/shared/ui/index.d.ts.map +1 -1
- package/lib/shared/ui/index.js +2 -0
- package/lib/shared/ui/index.js.map +1 -1
- package/lib/shared/ui/useActionTooltip.d.ts +48 -0
- package/lib/shared/ui/useActionTooltip.d.ts.map +1 -0
- package/lib/shared/ui/useActionTooltip.js +78 -0
- package/lib/shared/ui/useActionTooltip.js.map +1 -0
- package/lib/structure/core/index.d.ts +2 -0
- package/lib/structure/core/index.d.ts.map +1 -1
- package/lib/structure/core/index.js +1 -0
- package/lib/structure/core/index.js.map +1 -1
- package/lib/structure/core/sourceMolecule.d.ts +18 -0
- package/lib/structure/core/sourceMolecule.d.ts.map +1 -0
- package/lib/structure/core/sourceMolecule.js +26 -0
- package/lib/structure/core/sourceMolecule.js.map +1 -0
- package/lib/structure/core/structureNotations.d.ts +57 -0
- package/lib/structure/core/structureNotations.d.ts.map +1 -0
- package/lib/structure/core/structureNotations.js +74 -0
- package/lib/structure/core/structureNotations.js.map +1 -0
- package/lib/structure/core/structurePicture.d.ts +49 -0
- package/lib/structure/core/structurePicture.d.ts.map +1 -0
- package/lib/structure/core/structurePicture.js +83 -0
- package/lib/structure/core/structurePicture.js.map +1 -0
- package/lib/structure/ui/EditorExportButton.d.ts +23 -0
- package/lib/structure/ui/EditorExportButton.d.ts.map +1 -0
- package/lib/structure/ui/EditorExportButton.js +23 -0
- package/lib/structure/ui/EditorExportButton.js.map +1 -0
- package/lib/structure/ui/EditorHelpButton.d.ts +5 -2
- package/lib/structure/ui/EditorHelpButton.d.ts.map +1 -1
- package/lib/structure/ui/EditorHelpButton.js +8 -9
- package/lib/structure/ui/EditorHelpButton.js.map +1 -1
- package/lib/structure/ui/StructureEditor.d.ts +8 -0
- package/lib/structure/ui/StructureEditor.d.ts.map +1 -1
- package/lib/structure/ui/StructureEditor.js +26 -3
- package/lib/structure/ui/StructureEditor.js.map +1 -1
- package/lib/structure/ui/StructureExportDialog.d.ts +34 -0
- package/lib/structure/ui/StructureExportDialog.d.ts.map +1 -0
- package/lib/structure/ui/StructureExportDialog.js +43 -0
- package/lib/structure/ui/StructureExportDialog.js.map +1 -0
- package/lib/structure/ui/StructureExportPanel.d.ts +37 -0
- package/lib/structure/ui/StructureExportPanel.d.ts.map +1 -0
- package/lib/structure/ui/StructureExportPanel.js +75 -0
- package/lib/structure/ui/StructureExportPanel.js.map +1 -0
- package/lib/structure/ui/StructureNotationRow.d.ts +22 -0
- package/lib/structure/ui/StructureNotationRow.d.ts.map +1 -0
- package/lib/structure/ui/StructureNotationRow.js +34 -0
- package/lib/structure/ui/StructureNotationRow.js.map +1 -0
- package/lib/structure/ui/StructurePicturePane.d.ts +23 -0
- package/lib/structure/ui/StructurePicturePane.d.ts.map +1 -0
- package/lib/structure/ui/StructurePicturePane.js +113 -0
- package/lib/structure/ui/StructurePicturePane.js.map +1 -0
- package/lib/structure/ui/StructureSvg.d.ts.map +1 -1
- package/lib/structure/ui/StructureSvg.js +2 -18
- package/lib/structure/ui/StructureSvg.js.map +1 -1
- package/lib/structure/ui/ToolbarTooltip.d.ts.map +1 -1
- package/lib/structure/ui/ToolbarTooltip.js +1 -2
- package/lib/structure/ui/ToolbarTooltip.js.map +1 -1
- package/lib/structure/ui/index.d.ts +7 -3
- package/lib/structure/ui/index.d.ts.map +1 -1
- package/lib/structure/ui/index.js +5 -3
- package/lib/structure/ui/index.js.map +1 -1
- package/lib/structure/ui/structureNotationText.d.ts +23 -0
- package/lib/structure/ui/structureNotationText.d.ts.map +1 -0
- package/lib/structure/ui/structureNotationText.js +42 -0
- package/lib/structure/ui/structureNotationText.js.map +1 -0
- package/lib/structure/ui/useEditorStructure.d.ts +37 -0
- package/lib/structure/ui/useEditorStructure.d.ts.map +1 -0
- package/lib/structure/ui/useEditorStructure.js +70 -0
- package/lib/structure/ui/useEditorStructure.js.map +1 -0
- package/package.json +1 -1
- package/src/chart/ui/Axes.tsx +53 -5
- package/src/chrome/ui/NavMenuButton.tsx +61 -18
- package/src/chrome/ui/SiteHeader.tsx +37 -1
- package/src/chrome/ui/navItem.ts +7 -0
- package/src/citation/ui/entries.tsx +10 -2
- package/src/clipboard/ui/ClickToCopy.tsx +47 -13
- package/src/clipboard/ui/CopyButton.tsx +4 -2
- package/src/clipboard/ui/CopyableValue.tsx +88 -13
- package/src/clipboard/ui/index.ts +5 -1
- package/src/confirm/ui/ConfirmButton.tsx +2 -0
- package/src/delimited/ui/TableDataButton.tsx +2 -1
- package/src/download/core/figureSvg.ts +42 -10
- package/src/help/ui/HelpToolbarButton.tsx +2 -1
- package/src/locales/de.json +39 -4
- package/src/locales/en.json +39 -4
- package/src/locales/es.json +39 -4
- package/src/locales/fr.json +39 -4
- package/src/locales/it.json +39 -4
- package/src/number/ui/NumberInput.tsx +1 -1
- package/src/overlay/ui/OverlayIconButton.tsx +1 -0
- package/src/panel/ui/ClearButton.tsx +1 -0
- package/src/pedagogy/core/inlineMarks.ts +15 -7
- package/src/pedagogy/ui/GlossaryDefinition.tsx +8 -18
- package/src/pedagogy/ui/GlossaryIndex.tsx +0 -1
- package/src/pedagogy/ui/GlossaryProvider.tsx +10 -2
- package/src/pedagogy/ui/GlossaryText.tsx +10 -2
- package/src/pedagogy/ui/InlineText.tsx +21 -4
- package/src/pedagogy/ui/ReferenceSectionBlock.tsx +8 -2
- package/src/pedagogy/ui/SyntaxTooltip.tsx +11 -9
- package/src/pedagogy/ui/TutorialStepStrip.tsx +50 -18
- package/src/pedagogy/ui/glossaryContext.ts +7 -0
- package/src/pedagogy/ui/index.ts +1 -1
- package/src/pedagogy/ui/inlineSegments.tsx +7 -0
- package/src/pedagogy/ui/pedagogyStyle.ts +12 -24
- package/src/seo/core/plainDescription.ts +4 -2
- package/src/share/core/devices.ts +80 -0
- package/src/share/core/index.ts +14 -0
- package/src/share/core/regions.ts +87 -0
- package/src/share/ui/HiddenPartsProvider.tsx +6 -1
- package/src/share/ui/PagePart.tsx +12 -1
- package/src/share/ui/ShareButton.tsx +3 -6
- package/src/share/ui/ShareConfigOptions.tsx +25 -16
- package/src/share/ui/ShareDialog.tsx +17 -3
- package/src/share/ui/ShareDialogContent.tsx +80 -77
- package/src/share/ui/ShareLinkBar.tsx +70 -0
- package/src/share/ui/SharePanes.tsx +62 -0
- package/src/share/ui/SharePartOptions.tsx +25 -26
- package/src/share/ui/SharePartRow.tsx +78 -0
- package/src/share/ui/SharePresetTabs.tsx +36 -43
- package/src/share/ui/SharePreview.tsx +235 -0
- package/src/share/ui/SharePreviewDevices.tsx +70 -0
- package/src/share/ui/index.ts +1 -0
- package/src/share/ui/shareMarking.ts +18 -0
- package/src/share/ui/useShareRegionReports.ts +108 -0
- package/src/shared/ui/ActionTooltip.tsx +70 -0
- package/src/shared/ui/index.ts +7 -0
- package/src/shared/ui/useActionTooltip.ts +103 -0
- package/src/structure/core/index.ts +5 -0
- package/src/structure/core/sourceMolecule.ts +26 -0
- package/src/structure/core/structureNotations.ts +125 -0
- package/src/structure/core/structurePicture.ts +119 -0
- package/src/structure/ui/EditorExportButton.tsx +62 -0
- package/src/structure/ui/EditorHelpButton.tsx +26 -30
- package/src/structure/ui/StructureEditor.tsx +51 -5
- package/src/structure/ui/StructureExportDialog.tsx +90 -0
- package/src/structure/ui/StructureExportPanel.tsx +156 -0
- package/src/structure/ui/StructureNotationRow.tsx +74 -0
- package/src/structure/ui/StructurePicturePane.tsx +208 -0
- package/src/structure/ui/StructureSvg.tsx +3 -12
- package/src/structure/ui/ToolbarTooltip.tsx +1 -1
- package/src/structure/ui/index.ts +7 -3
- package/src/structure/ui/structureNotationText.ts +56 -0
- package/src/structure/ui/useEditorStructure.ts +119 -0
- package/styles/chrome.css +414 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structureNotations.js","sourceRoot":"","sources":["../../../src/structure/core/structureNotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA8C5C,6DAA6D;AAC7D,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAkB;IACnD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;IACnD,OAAO;QACL;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;YACjD,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,KAAK;SACb;QACD;YACE,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;YAC5C,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE;YACpE,KAAK,EAAE,IAAI;SACZ;QACD;YACE,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YAC1C,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE;YACpE,KAAK,EAAE,IAAI;SACZ;QACD,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;QAChE;YACE,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAClB,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC,CAC1D;YACD,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,KAAK;SACb;QACD;YACE,IAAI,EAAE,wBAAwB;YAC9B,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAClB,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CACnE;YACD,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,KAAK;SACb;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,OAAO,CAAC,KAAmB;IAClC,IAAI,CAAC;QACH,OAAO,KAAK,EAAE,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A structure as a picture, drawn at the size it is saved at.
|
|
3
|
+
*
|
|
4
|
+
* The resolution is a bond length rather than a canvas: OpenChemLib caps the
|
|
5
|
+
* bond it draws at 24 pixels whatever box it is given, so asking for a canvas
|
|
6
|
+
* four times larger produces the same small drawing with more white around it
|
|
7
|
+
* — a resolution control that changes the file and not the picture. Lifting
|
|
8
|
+
* the cap and cropping to the structure is what makes `4×` genuinely four
|
|
9
|
+
* times the drawing.
|
|
10
|
+
*/
|
|
11
|
+
import type { Molecule } from 'openchemlib';
|
|
12
|
+
import type { FigurePixels } from '../../download/core/figureScale.ts';
|
|
13
|
+
/** How the picture is drawn. */
|
|
14
|
+
export interface StructurePictureOptions {
|
|
15
|
+
/**
|
|
16
|
+
* The longest bond drawn, in pixels, which is what sets the size of
|
|
17
|
+
* everything else — the picture is cropped to the structure afterwards.
|
|
18
|
+
* @default 60
|
|
19
|
+
*/
|
|
20
|
+
bondLength?: number;
|
|
21
|
+
/**
|
|
22
|
+
* What is painted behind the structure. An SVG left unpainted opens
|
|
23
|
+
* transparent, and a structure is drawn in black, so it disappears in
|
|
24
|
+
* anything with a dark background — a slide, a reader in dark mode.
|
|
25
|
+
* @default '#ffffff'
|
|
26
|
+
*/
|
|
27
|
+
background?: string;
|
|
28
|
+
}
|
|
29
|
+
/** A structure drawn, and how big it came out. */
|
|
30
|
+
export interface StructurePicture extends FigurePixels {
|
|
31
|
+
/** The SVG document, ready to be saved or rasterized. */
|
|
32
|
+
markup: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The bond length a picture is drawn at before the resolution multiplies it.
|
|
36
|
+
*
|
|
37
|
+
* Chosen so a drug-sized molecule comes out around 300 pixels wide, which is
|
|
38
|
+
* what a note or a chat window wants; two or three times that is a slide, and
|
|
39
|
+
* four is print.
|
|
40
|
+
*/
|
|
41
|
+
export declare const STRUCTURE_BOND_LENGTH = 60;
|
|
42
|
+
/**
|
|
43
|
+
* Draw a structure as a standalone SVG document, cropped to the structure.
|
|
44
|
+
* @param molecule - The structure. Not modified.
|
|
45
|
+
* @param options - How large to draw it, and what to paint behind it.
|
|
46
|
+
* @returns The document and the size it came out at.
|
|
47
|
+
*/
|
|
48
|
+
export declare function structurePicture(molecule: Molecule, options?: StructurePictureOptions): StructurePicture;
|
|
49
|
+
//# sourceMappingURL=structurePicture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structurePicture.d.ts","sourceRoot":"","sources":["../../../src/structure/core/structurePicture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEvE,gCAAgC;AAChC,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,kDAAkD;AAClD,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAgBxC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,uBAA4B,GACpC,gBAAgB,CAUlB"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A structure as a picture, drawn at the size it is saved at.
|
|
3
|
+
*
|
|
4
|
+
* The resolution is a bond length rather than a canvas: OpenChemLib caps the
|
|
5
|
+
* bond it draws at 24 pixels whatever box it is given, so asking for a canvas
|
|
6
|
+
* four times larger produces the same small drawing with more white around it
|
|
7
|
+
* — a resolution control that changes the file and not the picture. Lifting
|
|
8
|
+
* the cap and cropping to the structure is what makes `4×` genuinely four
|
|
9
|
+
* times the drawing.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The bond length a picture is drawn at before the resolution multiplies it.
|
|
13
|
+
*
|
|
14
|
+
* Chosen so a drug-sized molecule comes out around 300 pixels wide, which is
|
|
15
|
+
* what a note or a chat window wants; two or three times that is a slide, and
|
|
16
|
+
* four is print.
|
|
17
|
+
*/
|
|
18
|
+
export const STRUCTURE_BOND_LENGTH = 60;
|
|
19
|
+
/**
|
|
20
|
+
* The canvas the structure is laid out in before it is cropped out of it.
|
|
21
|
+
*
|
|
22
|
+
* Only a ceiling: past it the box, rather than the bond length, would decide
|
|
23
|
+
* the size, and it is far beyond what a browser will paint anyway.
|
|
24
|
+
*/
|
|
25
|
+
const CANVAS = 20_000;
|
|
26
|
+
/** Where the opening `<svg …>` tag ends, so the background goes after it. */
|
|
27
|
+
const OPEN_TAG = /<svg\b[^>]*>/u;
|
|
28
|
+
/** The size OpenChemLib wrote on the document it produced. */
|
|
29
|
+
const SIDE = /\b(?<side>width|height)="(?<pixels>\d+)px"/gu;
|
|
30
|
+
/**
|
|
31
|
+
* Draw a structure as a standalone SVG document, cropped to the structure.
|
|
32
|
+
* @param molecule - The structure. Not modified.
|
|
33
|
+
* @param options - How large to draw it, and what to paint behind it.
|
|
34
|
+
* @returns The document and the size it came out at.
|
|
35
|
+
*/
|
|
36
|
+
export function structurePicture(molecule, options = {}) {
|
|
37
|
+
const { bondLength = STRUCTURE_BOND_LENGTH, background = '#ffffff' } = options;
|
|
38
|
+
const markup = molecule.toSVG(CANVAS, CANVAS, undefined, {
|
|
39
|
+
autoCrop: true,
|
|
40
|
+
autoCropMargin: Math.max(2, Math.round(bondLength / 6)),
|
|
41
|
+
maxAVBL: Math.max(1, Math.round(bondLength)),
|
|
42
|
+
});
|
|
43
|
+
return { markup: painted(markup, background), ...sizeOf(markup) };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Paint a background into the document, so the file does not open
|
|
47
|
+
* transparent.
|
|
48
|
+
* @param markup - The document as OpenChemLib wrote it.
|
|
49
|
+
* @param background - What to paint, or `transparent` to paint nothing.
|
|
50
|
+
* @returns The document.
|
|
51
|
+
*/
|
|
52
|
+
function painted(markup, background) {
|
|
53
|
+
if (background === 'transparent')
|
|
54
|
+
return markup;
|
|
55
|
+
const open = OPEN_TAG.exec(markup);
|
|
56
|
+
// A document whose opening tag cannot be found is handed back unpainted
|
|
57
|
+
// rather than corrupted by an insertion at a guessed offset.
|
|
58
|
+
if (open === null)
|
|
59
|
+
return markup;
|
|
60
|
+
const end = open.index + open[0].length;
|
|
61
|
+
return `${markup.slice(0, end)}<rect width="100%" height="100%" fill="${background}" />${markup.slice(end)}`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* How big the cropped document came out.
|
|
65
|
+
*
|
|
66
|
+
* Read off the document rather than computed, because the crop is the
|
|
67
|
+
* structure's own shape: two molecules asked for at the same bond length come
|
|
68
|
+
* out at different sizes, and the size is what the reader is shown.
|
|
69
|
+
* @param markup - The document as OpenChemLib wrote it.
|
|
70
|
+
* @returns Its size in pixels.
|
|
71
|
+
*/
|
|
72
|
+
function sizeOf(markup) {
|
|
73
|
+
const sides = {};
|
|
74
|
+
SIDE.lastIndex = 0;
|
|
75
|
+
for (const match of markup.matchAll(SIDE)) {
|
|
76
|
+
const { side, pixels } = match.groups ?? {};
|
|
77
|
+
if (side !== undefined && pixels !== undefined && !(side in sides)) {
|
|
78
|
+
sides[side] = Number(pixels);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return { width: sides.width ?? CANVAS, height: sides.height ?? CANVAS };
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=structurePicture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structurePicture.js","sourceRoot":"","sources":["../../../src/structure/core/structurePicture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA6BH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC;;;;;GAKG;AACH,MAAM,MAAM,GAAG,MAAM,CAAC;AAEtB,6EAA6E;AAC7E,MAAM,QAAQ,GAAG,eAAe,CAAC;AAEjC,8DAA8D;AAC9D,MAAM,IAAI,GAAG,8CAA8C,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAAkB,EAClB,UAAmC,EAAE;IAErC,MAAM,EAAE,UAAU,GAAG,qBAAqB,EAAE,UAAU,GAAG,SAAS,EAAE,GAClE,OAAO,CAAC;IACV,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE;QACvD,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QACvD,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,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AAM,EAAE,KAAK,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { StructureSourceInput } from '../core/structureSource.ts';
|
|
3
|
+
/** What {@link EditorExportButton} needs. */
|
|
4
|
+
export interface EditorExportButtonProps {
|
|
5
|
+
/** Reads what is drawn, called the moment the dialog is opened. */
|
|
6
|
+
source: () => StructureSourceInput;
|
|
7
|
+
/** Whether the editor draws a query fragment. */
|
|
8
|
+
fragment: boolean;
|
|
9
|
+
/** Whether the canvas holds nothing to export. */
|
|
10
|
+
empty: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The editor's export button, beside the help one, opening every notation of
|
|
14
|
+
* the drawing and the picture of it.
|
|
15
|
+
*
|
|
16
|
+
* The structure is read when the button is pressed rather than kept beside the
|
|
17
|
+
* canvas, so the dialog opens on what is drawn now and the editor is not
|
|
18
|
+
* re-rendered on every stroke to keep a copy in step.
|
|
19
|
+
* @param props - See {@link EditorExportButtonProps}.
|
|
20
|
+
* @returns The button and its dialog.
|
|
21
|
+
*/
|
|
22
|
+
export declare function EditorExportButton(props: EditorExportButtonProps): ReactElement;
|
|
23
|
+
//# sourceMappingURL=EditorExportButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorExportButton.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/EditorExportButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIvE,6CAA6C;AAC7C,MAAM,WAAW,uBAAuB;IACtC,mEAAmE;IACnE,MAAM,EAAE,MAAM,oBAAoB,CAAC;IACnC,iDAAiD;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,uBAAuB,GAC7B,YAAY,CA6Bd"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@blueprintjs/core';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
5
|
+
import { ActionTooltip } from "../../shared/ui/ActionTooltip.js";
|
|
6
|
+
import { StructureExportDialog } from "./StructureExportDialog.js";
|
|
7
|
+
/**
|
|
8
|
+
* The editor's export button, beside the help one, opening every notation of
|
|
9
|
+
* the drawing and the picture of it.
|
|
10
|
+
*
|
|
11
|
+
* The structure is read when the button is pressed rather than kept beside the
|
|
12
|
+
* canvas, so the dialog opens on what is drawn now and the editor is not
|
|
13
|
+
* re-rendered on every stroke to keep a copy in step.
|
|
14
|
+
* @param props - See {@link EditorExportButtonProps}.
|
|
15
|
+
* @returns The button and its dialog.
|
|
16
|
+
*/
|
|
17
|
+
export function EditorExportButton(props) {
|
|
18
|
+
const { source, fragment, empty } = props;
|
|
19
|
+
const t = useChromeT();
|
|
20
|
+
const [opened, setOpened] = useState(null);
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx(ActionTooltip, { content: t('structure.export.open'), placement: "left", opened: opened !== null, children: _jsx(Button, { variant: "minimal", size: "small", icon: "export", disabled: empty, "aria-label": t('structure.export.open'), onClick: () => setOpened(source()) }) }), _jsx(StructureExportDialog, { ...opened, isOpen: opened !== null, fragment: fragment, onClose: () => setOpened(null) })] }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=EditorExportButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorExportButton.js","sourceRoot":"","sources":["../../../src/structure/ui/EditorExportButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAmC,CAAC;AAGlE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA6B,CAAC;AAYpE;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAA8B;IAE9B,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC1C,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAA8B,IAAI,CAAC,CAAC;IAExE,OAAO,CACL,8BACE,KAAC,aAAa,IACZ,OAAO,EAAE,CAAC,CAAC,uBAAuB,CAAC,EACnC,SAAS,EAAC,MAAM,EAChB,MAAM,EAAE,MAAM,KAAK,IAAI,YAEvB,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,KAAK,gBACH,CAAC,CAAC,uBAAuB,CAAC,EACtC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,GAClC,GACY,EAChB,KAAC,qBAAqB,OAChB,MAAM,EACV,MAAM,EAAE,MAAM,KAAK,IAAI,EACvB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,GAC9B,IACD,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -10,8 +10,11 @@ export interface EditorHelpButtonProps {
|
|
|
10
10
|
fragment: boolean;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* The editor's help button,
|
|
14
|
-
*
|
|
13
|
+
* The editor's help button, opening the guide to the mouse and the keyboard.
|
|
14
|
+
*
|
|
15
|
+
* It is placed by whoever renders it — the editor puts it in the corner of the
|
|
16
|
+
* drawing, next to the export button — so the two read as one group rather
|
|
17
|
+
* than as two controls that happen to overlap.
|
|
15
18
|
*
|
|
16
19
|
* F1 opens it too: openchemlib binds that key to a help dialog it does not
|
|
17
20
|
* implement on the web.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorHelpButton.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/EditorHelpButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"EditorHelpButton.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/EditorHelpButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,2CAA2C;AAC3C,MAAM,WAAW,qBAAqB;IACpC,oEAAoE;IACpE,YAAY,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC5C,6CAA6C;IAC7C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,iDAAiD;IACjD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,CAsC3E"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button, PopoverNext
|
|
2
|
+
import { Button, PopoverNext } from '@blueprintjs/core';
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
5
|
+
import { ActionTooltip } from "../../shared/ui/ActionTooltip.js";
|
|
5
6
|
import { StructureEditorHelp } from "./StructureEditorHelp.js";
|
|
6
7
|
/**
|
|
7
|
-
* The editor's help button,
|
|
8
|
-
*
|
|
8
|
+
* The editor's help button, opening the guide to the mouse and the keyboard.
|
|
9
|
+
*
|
|
10
|
+
* It is placed by whoever renders it — the editor puts it in the corner of the
|
|
11
|
+
* drawing, next to the export button — so the two read as one group rather
|
|
12
|
+
* than as two controls that happen to overlap.
|
|
9
13
|
*
|
|
10
14
|
* F1 opens it too: openchemlib binds that key to a help dialog it does not
|
|
11
15
|
* implement on the web.
|
|
@@ -29,11 +33,6 @@ export function EditorHelpButton(props) {
|
|
|
29
33
|
container.addEventListener('keydown', onKeyDown);
|
|
30
34
|
return () => container.removeEventListener('keydown', onKeyDown);
|
|
31
35
|
}, [containerRef]);
|
|
32
|
-
return (_jsx(
|
|
36
|
+
return (_jsx(PopoverNext, { isOpen: isOpen, onInteraction: setIsOpen, placement: "left-start", content: _jsx(StructureEditorHelp, { mode: mode, fragment: fragment }), children: _jsx(ActionTooltip, { content: t('structure.mouseAndKeyboard'), placement: "left", opened: isOpen, children: _jsx(Button, { variant: "minimal", size: "small", icon: "help", "aria-label": t('structure.mouseAndKeyboard') }) }) }));
|
|
33
37
|
}
|
|
34
|
-
const CORNER_STYLE = {
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
top: 4,
|
|
37
|
-
right: 4,
|
|
38
|
-
};
|
|
39
38
|
//# sourceMappingURL=EditorHelpButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorHelpButton.js","sourceRoot":"","sources":["../../../src/structure/ui/EditorHelpButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"EditorHelpButton.js","sourceRoot":"","sources":["../../../src/structure/ui/EditorHelpButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,UA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,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,MAAM,gBACC,CAAC,CAAC,4BAA4B,CAAC,GAC3C,GACY,GACJ,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -67,6 +67,14 @@ export interface StructureEditorProps {
|
|
|
67
67
|
* @default true
|
|
68
68
|
*/
|
|
69
69
|
help?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Put a button in the corner that opens every notation of the drawing — its
|
|
72
|
+
* SMILES, its molfiles, its canonical identifiers — and the picture of it,
|
|
73
|
+
* ready to copy or to save. A reaction has none of those, so it is never
|
|
74
|
+
* offered one.
|
|
75
|
+
* @default true
|
|
76
|
+
*/
|
|
77
|
+
exportable?: boolean;
|
|
70
78
|
/**
|
|
71
79
|
* Class the container carries, so a site can reach it from its stylesheet.
|
|
72
80
|
* @default undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StructureEditor.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/StructureEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AASzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAQzD,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"StructureEditor.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/StructureEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AASzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAQzD,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAc3B,0CAA0C;AAC1C,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAClD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAuEzE"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense, lazy, useCallback, useEffect, useRef, useState, } from 'react';
|
|
3
3
|
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
4
4
|
import { TOKEN } from "../../tokens/core/familyTokens.js";
|
|
5
5
|
import { createPendingCall } from "../core/pendingCall.js";
|
|
6
6
|
import { EditorHelpButton } from "./EditorHelpButton.js";
|
|
7
7
|
import { ToolbarTooltip } from "./ToolbarTooltip.js";
|
|
8
|
+
import { useEditorStructure } from "./useEditorStructure.js";
|
|
8
9
|
import { useToolbarFloor } from "./useToolbarFloor.js";
|
|
10
|
+
const EditorExportButton = lazy(async () => {
|
|
11
|
+
const module = await import("./EditorExportButton.js");
|
|
12
|
+
return { default: module.EditorExportButton };
|
|
13
|
+
});
|
|
9
14
|
const EditorCanvas = lazy(async () => {
|
|
10
15
|
const module = await import("./EditorCanvas.js");
|
|
11
16
|
return { default: module.EditorCanvas };
|
|
@@ -18,11 +23,18 @@ const EditorCanvas = lazy(async () => {
|
|
|
18
23
|
* @returns The editor.
|
|
19
24
|
*/
|
|
20
25
|
export function StructureEditor(props) {
|
|
21
|
-
const { onChange, fragment = false, inputFormat = 'idcode', value = '', revision = 0, debounce = 300, minHeight = 320, mode = 'molecule', help = true, className, style, } = props;
|
|
26
|
+
const { onChange, fragment = false, inputFormat = 'idcode', value = '', revision = 0, debounce = 300, minHeight = 320, mode = 'molecule', help = true, exportable = true, className, style, } = props;
|
|
22
27
|
const t = useChromeT();
|
|
23
28
|
const containerRef = useToolbarFloor({ minHeight, revision });
|
|
24
29
|
const handleChange = useDebounced(onChange, debounce, revision);
|
|
25
|
-
|
|
30
|
+
const drawing = useEditorStructure({ value, inputFormat, revision });
|
|
31
|
+
const handleEdit = useCallback((change) => {
|
|
32
|
+
// Tapped undebounced, so a button beside the canvas reads the structure
|
|
33
|
+
// as it stands rather than as it stood before the last burst.
|
|
34
|
+
drawing.track(change);
|
|
35
|
+
handleChange(change);
|
|
36
|
+
}, [drawing, handleChange]);
|
|
37
|
+
return (_jsx("div", { ref: containerRef, className: className, style: { ...ROOT_STYLE, minHeight, ...style }, children: _jsxs(Suspense, { fallback: _jsx("div", { style: LOADING_STYLE, children: t('structure.loadingEditor') }), children: [_jsx(EditorCanvas, { onChange: handleEdit, fragment: fragment, inputFormat: inputFormat, value: value, mode: mode }, revision), help ? (_jsx(ToolbarTooltip, { containerRef: containerRef, mode: mode })) : null, _jsxs("div", { style: CORNER_STYLE, children: [exportable && mode === 'molecule' ? (_jsx(EditorExportButton, { source: drawing.source, fragment: fragment, empty: drawing.empty })) : null, help ? (_jsx(EditorHelpButton, { containerRef: containerRef, mode: mode, fragment: fragment })) : null] })] }) }));
|
|
26
38
|
}
|
|
27
39
|
/**
|
|
28
40
|
* Report the last edit of a burst rather than every one of them.
|
|
@@ -66,6 +78,17 @@ const ROOT_STYLE = {
|
|
|
66
78
|
borderRadius: 6,
|
|
67
79
|
background: '#fff',
|
|
68
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* The corner the editor's own buttons sit in: export first, then help, so the
|
|
83
|
+
* one that does something to the drawing is the nearer of the two to it.
|
|
84
|
+
*/
|
|
85
|
+
const CORNER_STYLE = {
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
top: 4,
|
|
88
|
+
right: 4,
|
|
89
|
+
display: 'flex',
|
|
90
|
+
gap: 2,
|
|
91
|
+
};
|
|
69
92
|
/** The box the canvas will fill, so its arrival moves nothing. */
|
|
70
93
|
const LOADING_STYLE = {
|
|
71
94
|
position: 'absolute',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StructureEditor.js","sourceRoot":"","sources":["../../../src/structure/ui/StructureEditor.tsx"],"names":[],"mappings":";AAUA,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AAKtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE;IACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,mBAAoB,CAAC,CAAC;IAClD,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,YAAY,E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QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,YAAY;IACvB,MAAM,EAAE,aAAa,KAAK,CAAC,MAAM,EAAE;IACnC,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,MAAM;CACnB,CAAC;AAEF;;;GAGG;AACH,MAAM,YAAY,GAAkB;IAClC,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,CAAC;CACP,CAAC;AAEF,kEAAkE;AAClE,MAAM,aAAa,GAAkB;IACnC,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IACxB,KAAK,EAAE,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;CACb,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dialog that hands a drawn structure over.
|
|
3
|
+
*
|
|
4
|
+
* The shell is here and the body is behind `React.lazy`, for the same reason
|
|
5
|
+
* `Structure` keeps its depiction there: this file must stay free of
|
|
6
|
+
* `openchemlib` so a site importing `react-cheminfo/structure` for the editor
|
|
7
|
+
* does not also download the notations nobody has asked for yet.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactElement } from 'react';
|
|
10
|
+
import type { StructureExportPanelProps } from './StructureExportPanel.tsx';
|
|
11
|
+
/** What {@link StructureExportDialog} needs. */
|
|
12
|
+
export interface StructureExportDialogProps extends StructureExportPanelProps {
|
|
13
|
+
/** Whether the dialog is on screen. */
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
/** Called when the dialog is dismissed. */
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the dialog is rendered through a portal on `document.body`.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
usePortal?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Take a structure off the page: as a notation, or as a picture.
|
|
25
|
+
*
|
|
26
|
+
* One dialog rather than a menu of downloads, because the question is never
|
|
27
|
+
* only "which format" — a reader comparing a SMILES against an idCode, or
|
|
28
|
+
* checking that the hash they are about to paste belongs to the molecule in
|
|
29
|
+
* front of them, needs to see the structure and the strings together.
|
|
30
|
+
* @param props - See {@link StructureExportDialogProps}.
|
|
31
|
+
* @returns The dialog.
|
|
32
|
+
*/
|
|
33
|
+
export declare function StructureExportDialog(props: StructureExportDialogProps): ReactElement;
|
|
34
|
+
//# sourceMappingURL=StructureExportDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StructureExportDialog.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/StructureExportDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAMzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAO5E,gDAAgD;AAChD,MAAM,WAAW,0BAA2B,SAAQ,yBAAyB;IAC3E,uCAAuC;IACvC,MAAM,EAAE,OAAO,CAAC;IAChB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,0BAA0B,GAChC,YAAY,CA6Bd"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The dialog that hands a drawn structure over.
|
|
4
|
+
*
|
|
5
|
+
* The shell is here and the body is behind `React.lazy`, for the same reason
|
|
6
|
+
* `Structure` keeps its depiction there: this file must stay free of
|
|
7
|
+
* `openchemlib` so a site importing `react-cheminfo/structure` for the editor
|
|
8
|
+
* does not also download the notations nobody has asked for yet.
|
|
9
|
+
*/
|
|
10
|
+
import { Dialog, DialogBody } from '@blueprintjs/core';
|
|
11
|
+
import { Suspense, lazy } from 'react';
|
|
12
|
+
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
13
|
+
import { TOKEN } from "../../tokens/core/familyTokens.js";
|
|
14
|
+
const StructureExportPanel = lazy(async () => {
|
|
15
|
+
const module = await import("./StructureExportPanel.js");
|
|
16
|
+
return { default: module.StructureExportPanel };
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Take a structure off the page: as a notation, or as a picture.
|
|
20
|
+
*
|
|
21
|
+
* One dialog rather than a menu of downloads, because the question is never
|
|
22
|
+
* only "which format" — a reader comparing a SMILES against an idCode, or
|
|
23
|
+
* checking that the hash they are about to paste belongs to the molecule in
|
|
24
|
+
* front of them, needs to see the structure and the strings together.
|
|
25
|
+
* @param props - See {@link StructureExportDialogProps}.
|
|
26
|
+
* @returns The dialog.
|
|
27
|
+
*/
|
|
28
|
+
export function StructureExportDialog(props) {
|
|
29
|
+
const { isOpen, onClose, usePortal = true, ...panel } = props;
|
|
30
|
+
const t = useChromeT();
|
|
31
|
+
return (_jsx(Dialog, { isOpen: isOpen, onClose: onClose, usePortal: usePortal, title: t('structure.export.title'), icon: "export", className: "structure-export", style: DIALOG_STYLE, children: _jsx(DialogBody, { className: "structure-export__body", children: isOpen ? (_jsx(Suspense, { fallback: _jsx("p", { style: LOADING_STYLE, children: t('structure.export.loading') }), children: _jsx(StructureExportPanel, { ...panel }) })) : null }) }));
|
|
32
|
+
}
|
|
33
|
+
const DIALOG_STYLE = {
|
|
34
|
+
width: 'min(980px, 94vw)',
|
|
35
|
+
};
|
|
36
|
+
const LOADING_STYLE = {
|
|
37
|
+
margin: 0,
|
|
38
|
+
padding: '2rem 0',
|
|
39
|
+
color: TOKEN.textFaint,
|
|
40
|
+
fontSize: 13,
|
|
41
|
+
textAlign: 'center',
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=StructureExportDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StructureExportDialog.js","sourceRoot":"","sources":["../../../src/structure/ui/StructureExportDialog.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAI1D,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE;IAC3C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,2BAA4B,CAAC,CAAC;IAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,oBAAoB,EAAE,CAAC;AAClD,CAAC,CAAC,CAAC;AAeH;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAiC;IAEjC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAC9D,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IAEvB,OAAO,CACL,KAAC,MAAM,IACL,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,CAAC,CAAC,wBAAwB,CAAC,EAClC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,YAAY,YAEnB,KAAC,UAAU,IAAC,SAAS,EAAC,wBAAwB,YAG3C,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,QAAQ,IACP,QAAQ,EACN,YAAG,KAAK,EAAE,aAAa,YAAG,CAAC,CAAC,0BAA0B,CAAC,GAAK,YAG9D,KAAC,oBAAoB,OAAK,KAAK,GAAI,GAC1B,CACZ,CAAC,CAAC,CAAC,IAAI,GACG,GACN,CACV,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,kBAAkB;CACO,CAAC;AAEnC,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,QAAQ;CACa,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The body of the export dialog, which is the half that reads the structure.
|
|
3
|
+
*
|
|
4
|
+
* It value-imports `openchemlib`, through the notations and the parser, so the
|
|
5
|
+
* dialog holds it behind `React.lazy`: a page carrying an editor downloads
|
|
6
|
+
* this only when somebody asks to export something.
|
|
7
|
+
*/
|
|
8
|
+
import type { ReactElement } from 'react';
|
|
9
|
+
import type { StructureSourceInput } from '../core/structureSource.ts';
|
|
10
|
+
/** What {@link StructureExportPanel} is handed. */
|
|
11
|
+
export interface StructureExportPanelProps extends StructureSourceInput {
|
|
12
|
+
/**
|
|
13
|
+
* Base name of every file saved from here, extension excluded.
|
|
14
|
+
* @default 'structure'
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the structure is a query fragment, which is what a substructure
|
|
19
|
+
* filter draws. A fragment's idCode is not a molecule's, so this has to be
|
|
20
|
+
* said when the notation handed over does not already carry it.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
fragment?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Every notation of a drawn structure, and the picture of it.
|
|
27
|
+
*
|
|
28
|
+
* The notations come first and in the order a chemist reaches for them — the
|
|
29
|
+
* SMILES, then the two molfiles — with the canonical identifiers folded away
|
|
30
|
+
* underneath: they answer a database question rather than a drawing one, so
|
|
31
|
+
* they are there for whoever came for them and out of the way of everyone
|
|
32
|
+
* else.
|
|
33
|
+
* @param props - See {@link StructureExportPanelProps}.
|
|
34
|
+
* @returns The panel.
|
|
35
|
+
*/
|
|
36
|
+
export declare function StructureExportPanel(props: StructureExportPanelProps): ReactElement;
|
|
37
|
+
//# sourceMappingURL=StructureExportPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StructureExportPanel.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/StructureExportPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAUzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMvE,mDAAmD;AACnD,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;IACrE;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,yBAAyB,GAC/B,YAAY,CAqDd"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { CollapsibleSection } from "../../disclosure/ui/CollapsibleSection.js";
|
|
4
|
+
import { sanitizeFileName } from "../../download/core/sanitizeFileName.js";
|
|
5
|
+
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
6
|
+
import { TOKEN } from "../../tokens/core/familyTokens.js";
|
|
7
|
+
import { sourceMolecule } from "../core/sourceMolecule.js";
|
|
8
|
+
import { structureError } from "../core/structureError.js";
|
|
9
|
+
import { structureNotations } from "../core/structureNotations.js";
|
|
10
|
+
import { structureSource } from "../core/structureSource.js";
|
|
11
|
+
import { StructureNotationRow } from "./StructureNotationRow.js";
|
|
12
|
+
import { StructurePicturePane } from "./StructurePicturePane.js";
|
|
13
|
+
/**
|
|
14
|
+
* Every notation of a drawn structure, and the picture of it.
|
|
15
|
+
*
|
|
16
|
+
* The notations come first and in the order a chemist reaches for them — the
|
|
17
|
+
* SMILES, then the two molfiles — with the canonical identifiers folded away
|
|
18
|
+
* underneath: they answer a database question rather than a drawing one, so
|
|
19
|
+
* they are there for whoever came for them and out of the way of everyone
|
|
20
|
+
* else.
|
|
21
|
+
* @param props - See {@link StructureExportPanelProps}.
|
|
22
|
+
* @returns The panel.
|
|
23
|
+
*/
|
|
24
|
+
export function StructureExportPanel(props) {
|
|
25
|
+
const { idCode, coordinates, molfile, smiles } = props;
|
|
26
|
+
const { name = 'structure', fragment = false } = props;
|
|
27
|
+
const t = useChromeT();
|
|
28
|
+
const read = useMemo(() => readStructure({ idCode, coordinates, molfile, smiles }, fragment), [idCode, coordinates, molfile, smiles, fragment]);
|
|
29
|
+
if (read.kind !== 'read') {
|
|
30
|
+
return (_jsx("p", { style: EMPTY_STYLE, children: read.kind === 'empty' ? t('structure.export.nothing') : read.message }));
|
|
31
|
+
}
|
|
32
|
+
const fileName = sanitizeFileName(name, 'structure');
|
|
33
|
+
const notations = read.notations;
|
|
34
|
+
const common = notations.filter((notation) => !notation.canonical);
|
|
35
|
+
const identifiers = notations.filter((notation) => notation.canonical);
|
|
36
|
+
return (_jsxs("div", { className: "structure-export__panes", children: [_jsx(StructurePicturePane, { molecule: read.molecule, fileName: fileName }), _jsxs("div", { className: "structure-export__notations", children: [common.map((notation) => (_jsx(StructureNotationRow, { notation: notation, fileName: fileName }, notation.kind))), _jsx(CollapsibleSection, { className: "structure-export__identifiers", title: t('structure.export.identifiers'), defaultOpen: false, children: identifiers.map((notation) => (_jsx(StructureNotationRow, { notation: notation, fileName: fileName }, notation.kind))) }), _jsx("p", { style: FOOT_STYLE, children: t('overlay.hoverAName') })] })] }));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Read the notation the caller handed over, and write every other one from it.
|
|
40
|
+
* @param input - Whatever notations the caller has.
|
|
41
|
+
* @param fragment - Whether the structure is a query fragment.
|
|
42
|
+
* @returns The molecule and its notations, or why there are none.
|
|
43
|
+
*/
|
|
44
|
+
function readStructure(input, fragment) {
|
|
45
|
+
const source = structureSource(input);
|
|
46
|
+
if (source.kind === 'empty')
|
|
47
|
+
return { kind: 'empty' };
|
|
48
|
+
try {
|
|
49
|
+
const molecule = sourceMolecule(source);
|
|
50
|
+
// Only ever set, never cleared: an idCode written by a query editor
|
|
51
|
+
// already carries the flag, and clearing it would export a different
|
|
52
|
+
// structure from the one that was drawn.
|
|
53
|
+
if (fragment)
|
|
54
|
+
molecule.setFragment(true);
|
|
55
|
+
if (molecule.getAllAtoms() === 0)
|
|
56
|
+
return { kind: 'empty' };
|
|
57
|
+
return { kind: 'read', molecule, notations: structureNotations(molecule) };
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return { kind: 'error', message: structureError(error).message };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const EMPTY_STYLE = {
|
|
64
|
+
margin: 0,
|
|
65
|
+
padding: '2rem 0',
|
|
66
|
+
color: TOKEN.textMuted,
|
|
67
|
+
fontSize: 13,
|
|
68
|
+
textAlign: 'center',
|
|
69
|
+
};
|
|
70
|
+
const FOOT_STYLE = {
|
|
71
|
+
margin: 0,
|
|
72
|
+
color: TOKEN.textFaint,
|
|
73
|
+
fontSize: 11,
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=StructureExportPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StructureExportPanel.js","sourceRoot":"","sources":["../../../src/structure/ui/StructureExportPanel.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC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AAC;IACtD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACxC,oEAAoE;QACpE,qEAAqE;QACrE,yCAAyC;QACzC,IAAI,QAAQ;YAAE,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC7E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;IACnE,CAAC;AACH,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,QAAQ;CACa,CAAC;AAEnC,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;CACoB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { StructureNotation } from '../core/structureNotations.ts';
|
|
3
|
+
/** What {@link StructureNotationRow} shows. */
|
|
4
|
+
export interface StructureNotationRowProps {
|
|
5
|
+
/** The notation, as `structureNotations` wrote it. */
|
|
6
|
+
notation: StructureNotation;
|
|
7
|
+
/** Base name of the file this notation is saved as, extension excluded. */
|
|
8
|
+
fileName: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* One notation: its name, the text, and the two ways of taking it away.
|
|
12
|
+
*
|
|
13
|
+
* The text is the button that copies it — a notation is only ever wanted
|
|
14
|
+
* somewhere else — and a notation that is also a file carries a save button on
|
|
15
|
+
* its name's line, where it cannot be hit while reaching for the text. The
|
|
16
|
+
* name explains itself on hover, dotted-underlined to say so, so the row needs
|
|
17
|
+
* no glyph of its own.
|
|
18
|
+
* @param props - See {@link StructureNotationRowProps}.
|
|
19
|
+
* @returns The row.
|
|
20
|
+
*/
|
|
21
|
+
export declare function StructureNotationRow(props: StructureNotationRowProps): ReactElement;
|
|
22
|
+
//# sourceMappingURL=StructureNotationRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StructureNotationRow.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/StructureNotationRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAIvE,+CAA+C;AAC/C,MAAM,WAAW,yBAAyB;IACxC,sDAAsD;IACtD,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,yBAAyB,GAC/B,YAAY,CAkCd"}
|