react-cheminfo 0.139.0 → 0.140.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/lib/credits/core/credits.d.ts +12 -0
- package/lib/credits/core/credits.d.ts.map +1 -1
- package/lib/credits/core/credits.js +16 -0
- package/lib/credits/core/credits.js.map +1 -1
- package/lib/crystal3d/ui/CrystalCanvas3D.d.ts +1 -1
- package/lib/crystal3d/ui/CrystalCanvas3D.d.ts.map +1 -1
- package/lib/crystal3d/ui/CrystalViewer3D.d.ts +1 -1
- package/lib/crystal3d/ui/CrystalViewer3D.d.ts.map +1 -1
- package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts +1 -1
- package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.d.ts +17 -3
- package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.js +1 -1
- package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
- package/lib/download/ui/FigureQuickActions.d.ts +10 -4
- package/lib/download/ui/FigureQuickActions.d.ts.map +1 -1
- package/lib/download/ui/FigureQuickActions.js +12 -6
- package/lib/download/ui/FigureQuickActions.js.map +1 -1
- package/lib/ecosystem/core/home.d.ts +19 -0
- package/lib/ecosystem/core/home.d.ts.map +1 -0
- package/lib/ecosystem/core/home.js +23 -0
- package/lib/ecosystem/core/home.js.map +1 -0
- package/lib/ecosystem/core/index.d.ts +3 -0
- package/lib/ecosystem/core/index.d.ts.map +1 -1
- package/lib/ecosystem/core/index.js +2 -0
- package/lib/ecosystem/core/index.js.map +1 -1
- package/lib/ecosystem/core/searchSites.d.ts +39 -0
- package/lib/ecosystem/core/searchSites.d.ts.map +1 -0
- package/lib/ecosystem/core/searchSites.js +77 -0
- package/lib/ecosystem/core/searchSites.js.map +1 -0
- package/lib/ecosystem/core/types.d.ts +1 -1
- package/lib/ecosystem/core/types.d.ts.map +1 -1
- package/lib/ecosystem/core/unlistedSites.d.ts.map +1 -1
- package/lib/ecosystem/core/unlistedSites.js +14 -0
- package/lib/ecosystem/core/unlistedSites.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemButton.d.ts +6 -0
- package/lib/ecosystem/ui/EcosystemButton.d.ts.map +1 -1
- package/lib/ecosystem/ui/EcosystemButton.js +2 -2
- package/lib/ecosystem/ui/EcosystemButton.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.d.ts +13 -4
- package/lib/ecosystem/ui/EcosystemMenu.d.ts.map +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.js +56 -6
- package/lib/ecosystem/ui/EcosystemMenu.js.map +1 -1
- package/lib/ecosystem/ui/SiteGroupGrid.d.ts +12 -0
- package/lib/ecosystem/ui/SiteGroupGrid.d.ts.map +1 -1
- package/lib/ecosystem/ui/SiteGroupGrid.js +15 -2
- package/lib/ecosystem/ui/SiteGroupGrid.js.map +1 -1
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.js +4 -0
- package/lib/ecosystem/ui/glyphs.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 +10 -0
- package/lib/locales/en.json +10 -0
- package/lib/locales/es.json +10 -0
- package/lib/locales/fr.json +10 -0
- package/lib/locales/it.json +10 -0
- package/lib/molecule3d/core/bondNeighbours.d.ts +30 -0
- package/lib/molecule3d/core/bondNeighbours.d.ts.map +1 -0
- package/lib/molecule3d/core/bondNeighbours.js +108 -0
- package/lib/molecule3d/core/bondNeighbours.js.map +1 -0
- package/lib/molecule3d/core/file.d.ts +15 -4
- package/lib/molecule3d/core/file.d.ts.map +1 -1
- package/lib/molecule3d/core/file.js +10 -1
- package/lib/molecule3d/core/file.js.map +1 -1
- package/lib/molecule3d/core/index.d.ts +11 -2
- package/lib/molecule3d/core/index.d.ts.map +1 -1
- package/lib/molecule3d/core/index.js +6 -1
- package/lib/molecule3d/core/index.js.map +1 -1
- package/lib/molecule3d/core/partialBondMode.d.ts +34 -0
- package/lib/molecule3d/core/partialBondMode.d.ts.map +1 -0
- package/lib/molecule3d/core/partialBondMode.js +39 -0
- package/lib/molecule3d/core/partialBondMode.js.map +1 -0
- package/lib/molecule3d/core/partialBondRanges.d.ts +61 -0
- package/lib/molecule3d/core/partialBondRanges.d.ts.map +1 -0
- package/lib/molecule3d/core/partialBondRanges.js +89 -0
- package/lib/molecule3d/core/partialBondRanges.js.map +1 -0
- package/lib/molecule3d/core/partialBonds.d.ts +61 -0
- package/lib/molecule3d/core/partialBonds.d.ts.map +1 -0
- package/lib/molecule3d/core/partialBonds.js +115 -0
- package/lib/molecule3d/core/partialBonds.js.map +1 -0
- package/lib/molecule3d/core/settings.d.ts +13 -35
- package/lib/molecule3d/core/settings.d.ts.map +1 -1
- package/lib/molecule3d/core/settings.js +17 -25
- package/lib/molecule3d/core/settings.js.map +1 -1
- package/lib/molecule3d/core/tools.d.ts +36 -0
- package/lib/molecule3d/core/tools.d.ts.map +1 -0
- package/lib/molecule3d/core/tools.js +24 -0
- package/lib/molecule3d/core/tools.js.map +1 -0
- package/lib/molecule3d/ui/Molecule3DExport.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DExport.js +19 -2
- package/lib/molecule3d/ui/Molecule3DExport.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DOptions.d.ts +5 -2
- package/lib/molecule3d/ui/Molecule3DOptions.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DOptions.js +6 -4
- package/lib/molecule3d/ui/Molecule3DOptions.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DPartialBonds.d.ts +22 -0
- package/lib/molecule3d/ui/Molecule3DPartialBonds.d.ts.map +1 -0
- package/lib/molecule3d/ui/Molecule3DPartialBonds.js +53 -0
- package/lib/molecule3d/ui/Molecule3DPartialBonds.js.map +1 -0
- package/lib/molecule3d/ui/Molecule3DToolbar.d.ts +1 -1
- package/lib/molecule3d/ui/Molecule3DToolbar.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DToolbar.js +1 -1
- package/lib/molecule3d/ui/Molecule3DToolbar.js.map +1 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.js +3 -2
- package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
- package/lib/molecule3d/ui/drawScene.d.ts +4 -3
- package/lib/molecule3d/ui/drawScene.d.ts.map +1 -1
- package/lib/molecule3d/ui/drawScene.js +12 -2
- package/lib/molecule3d/ui/drawScene.js.map +1 -1
- package/lib/molecule3d/ui/moleculeFileFormats.d.ts +3 -2
- package/lib/molecule3d/ui/moleculeFileFormats.d.ts.map +1 -1
- package/lib/molecule3d/ui/moleculeFileFormats.js +5 -3
- package/lib/molecule3d/ui/moleculeFileFormats.js.map +1 -1
- package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts +2 -1
- package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts.map +1 -1
- package/lib/molecule3d/ui/partialBondShapes.d.ts +117 -0
- package/lib/molecule3d/ui/partialBondShapes.d.ts.map +1 -0
- package/lib/molecule3d/ui/partialBondShapes.js +164 -0
- package/lib/molecule3d/ui/partialBondShapes.js.map +1 -0
- package/lib/molecule3d/ui/renderMolecule.d.ts +9 -0
- package/lib/molecule3d/ui/renderMolecule.d.ts.map +1 -1
- package/lib/molecule3d/ui/renderMolecule.js +17 -0
- package/lib/molecule3d/ui/renderMolecule.js.map +1 -1
- package/lib/molecule3d/ui/renderPartialBonds.d.ts +19 -0
- package/lib/molecule3d/ui/renderPartialBonds.d.ts.map +1 -0
- package/lib/molecule3d/ui/renderPartialBonds.js +90 -0
- package/lib/molecule3d/ui/renderPartialBonds.js.map +1 -0
- package/lib/molecule3d/ui/structureGeometry.d.ts +22 -0
- package/lib/molecule3d/ui/structureGeometry.d.ts.map +1 -0
- package/lib/molecule3d/ui/structureGeometry.js +63 -0
- package/lib/molecule3d/ui/structureGeometry.js.map +1 -0
- package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts +2 -2
- package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts.map +1 -1
- package/lib/molecule3d/ui/usePolarSurfaceArea.js +5 -4
- package/lib/molecule3d/ui/usePolarSurfaceArea.js.map +1 -1
- package/lib/molecule3d/ui/viewer.d.ts +8 -1
- package/lib/molecule3d/ui/viewer.d.ts.map +1 -1
- package/lib/molecule3d/ui/viewer.js +10 -0
- package/lib/molecule3d/ui/viewer.js.map +1 -1
- package/lib/molecule3d/ui/viewerTypes.d.ts +18 -0
- package/lib/molecule3d/ui/viewerTypes.d.ts.map +1 -1
- package/lib/panel/ui/FilterInput.d.ts +11 -0
- package/lib/panel/ui/FilterInput.d.ts.map +1 -1
- package/lib/panel/ui/FilterInput.js +10 -1
- package/lib/panel/ui/FilterInput.js.map +1 -1
- package/lib/shell/ui/ShellFrame.d.ts.map +1 -1
- package/lib/shell/ui/ShellFrame.js +3 -2
- package/lib/shell/ui/ShellFrame.js.map +1 -1
- package/package.json +1 -1
- package/src/credits/core/credits.ts +16 -0
- package/src/crystal3d/ui/CrystalCanvas3D.tsx +1 -1
- package/src/crystal3d/ui/CrystalViewer3D.tsx +1 -1
- package/src/crystal3d/ui/crystalStructureViewerProps.ts +1 -1
- package/src/download/ui/FigureDownloadPanel.tsx +20 -4
- package/src/download/ui/FigureQuickActions.tsx +18 -6
- package/src/ecosystem/core/home.ts +27 -0
- package/src/ecosystem/core/index.ts +7 -0
- package/src/ecosystem/core/searchSites.ts +102 -0
- package/src/ecosystem/core/types.ts +1 -0
- package/src/ecosystem/core/unlistedSites.ts +15 -0
- package/src/ecosystem/ui/EcosystemButton.tsx +8 -2
- package/src/ecosystem/ui/EcosystemMenu.tsx +103 -7
- package/src/ecosystem/ui/SiteGroupGrid.tsx +28 -3
- package/src/ecosystem/ui/glyphs.tsx +14 -0
- package/src/locales/de.json +10 -0
- package/src/locales/en.json +10 -0
- package/src/locales/es.json +10 -0
- package/src/locales/fr.json +10 -0
- package/src/locales/it.json +10 -0
- package/src/molecule3d/core/bondNeighbours.ts +108 -0
- package/src/molecule3d/core/file.ts +18 -4
- package/src/molecule3d/core/index.ts +17 -3
- package/src/molecule3d/core/partialBondMode.ts +48 -0
- package/src/molecule3d/core/partialBondRanges.ts +120 -0
- package/src/molecule3d/core/partialBonds.ts +180 -0
- package/src/molecule3d/core/settings.ts +29 -52
- package/src/molecule3d/core/tools.ts +51 -0
- package/src/molecule3d/ui/Molecule3DExport.tsx +17 -2
- package/src/molecule3d/ui/Molecule3DOptions.tsx +16 -3
- package/src/molecule3d/ui/Molecule3DPartialBonds.tsx +100 -0
- package/src/molecule3d/ui/Molecule3DToolbar.tsx +2 -2
- package/src/molecule3d/ui/MoleculeCanvas3D.tsx +3 -4
- package/src/molecule3d/ui/drawScene.ts +15 -2
- package/src/molecule3d/ui/moleculeFileFormats.ts +5 -3
- package/src/molecule3d/ui/moleculeViewer3DProps.ts +2 -1
- package/src/molecule3d/ui/partialBondShapes.ts +246 -0
- package/src/molecule3d/ui/renderMolecule.ts +20 -0
- package/src/molecule3d/ui/renderPartialBonds.ts +122 -0
- package/src/molecule3d/ui/structureGeometry.ts +73 -0
- package/src/molecule3d/ui/usePolarSurfaceArea.ts +5 -4
- package/src/molecule3d/ui/viewer.ts +12 -0
- package/src/molecule3d/ui/viewerTypes.ts +19 -0
- package/src/panel/ui/FilterInput.tsx +24 -0
- package/src/shell/ui/ShellFrame.tsx +7 -1
|
@@ -37,6 +37,24 @@ export interface MoleculeStyle {
|
|
|
37
37
|
*/
|
|
38
38
|
sizeFactor?: number;
|
|
39
39
|
}
|
|
40
|
+
/** How to draw the partial bonds, sized after the model they are drawn over. */
|
|
41
|
+
export interface PartialBondStyle {
|
|
42
|
+
/**
|
|
43
|
+
* The representation of the model.
|
|
44
|
+
* @default 'ball-and-stick'
|
|
45
|
+
*/
|
|
46
|
+
representation?: RepresentationId;
|
|
47
|
+
/**
|
|
48
|
+
* The model's radius multiplier.
|
|
49
|
+
* @default 1
|
|
50
|
+
*/
|
|
51
|
+
sizeFactor?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Whether each is labelled with its length.
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
lengths?: boolean;
|
|
57
|
+
}
|
|
40
58
|
/** How to draw the molecular surface. */
|
|
41
59
|
export interface SurfaceStyle {
|
|
42
60
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewerTypes.d.ts","sourceRoot":"","sources":["../../../src/molecule3d/ui/viewerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE/E,+CAA+C;AAC/C,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD;AAED,6BAA6B;AAC7B,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,yCAAyC;AACzC,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
1
|
+
{"version":3,"file":"viewerTypes.d.ts","sourceRoot":"","sources":["../../../src/molecule3d/ui/viewerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE/E,+CAA+C;AAC/C,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD;AAED,6BAA6B;AAC7B,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yCAAyC;AACzC,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -11,6 +11,17 @@ export interface FilterInputProps {
|
|
|
11
11
|
* @default false
|
|
12
12
|
*/
|
|
13
13
|
autoFocus?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* What a screen reader calls the box.
|
|
16
|
+
* @default undefined — the placeholder names it
|
|
17
|
+
*/
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Called when Enter is pressed in the box, to open the entry the filter
|
|
21
|
+
* leads to.
|
|
22
|
+
* @default undefined — Enter does nothing
|
|
23
|
+
*/
|
|
24
|
+
onEnter?: () => void;
|
|
14
25
|
}
|
|
15
26
|
/**
|
|
16
27
|
* The box a list is filtered through, with a cross to empty it again.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterInput.d.ts","sourceRoot":"","sources":["../../../src/panel/ui/FilterInput.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterInput.d.ts","sourceRoot":"","sources":["../../../src/panel/ui/FilterInput.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAuClD"}
|
|
@@ -19,7 +19,16 @@ import { ClearButton } from "./ClearButton.js";
|
|
|
19
19
|
*/
|
|
20
20
|
export function FilterInput(props) {
|
|
21
21
|
const { value, onValueChange, placeholder, autoFocus = false } = props;
|
|
22
|
+
const { ariaLabel, onEnter } = props;
|
|
22
23
|
const t = useChromeT();
|
|
23
|
-
return (_jsx(InputGroup, { autoFocus: autoFocus, leftIcon: "search", size: "small", value: value, placeholder: placeholder, spellCheck: false, autoCapitalize: "off", autoCorrect: "off", autoComplete: "off", rightElement: value.length > 0 ? (_jsx(ClearButton, { label: t('panel.clearFilter'), onClick: () => onValueChange('') })) : undefined, onValueChange: onValueChange
|
|
24
|
+
return (_jsx(InputGroup, { autoFocus: autoFocus, leftIcon: "search", size: "small", value: value, placeholder: placeholder, "aria-label": ariaLabel, spellCheck: false, autoCapitalize: "off", autoCorrect: "off", autoComplete: "off", rightElement: value.length > 0 ? (_jsx(ClearButton, { label: t('panel.clearFilter'), onClick: () => onValueChange('') })) : undefined, onValueChange: onValueChange, onKeyDown: onEnter === undefined
|
|
25
|
+
? undefined
|
|
26
|
+
: (event) => {
|
|
27
|
+
if (event.key !== 'Enter' || event.nativeEvent.isComposing) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
onEnter();
|
|
32
|
+
} }));
|
|
24
33
|
}
|
|
25
34
|
//# sourceMappingURL=FilterInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterInput.js","sourceRoot":"","sources":["../../../src/panel/ui/FilterInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterInput.js","sourceRoot":"","sources":["../../../src/panel/ui/FilterInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB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1
|
-
{"version":3,"file":"ShellFrame.d.ts","sourceRoot":"","sources":["../../../src/shell/ui/ShellFrame.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ShellFrame.d.ts","sourceRoot":"","sources":["../../../src/shell/ui/ShellFrame.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAYrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAKlE,OAAO,KAAK,EAAa,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,SAAS,gBAAgB,EAAE,GAAG,SAAS,MAAM,EAC5E,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,GACjC,YAAY,CA2Fd"}
|
|
@@ -6,6 +6,7 @@ import { SiteFooter } from "../../chrome/ui/SiteFooter.js";
|
|
|
6
6
|
import { SiteHeader } from "../../chrome/ui/SiteHeader.js";
|
|
7
7
|
import { useCompactHeader } from "../../chrome/ui/useCompactHeader.js";
|
|
8
8
|
import { CiteButton } from "../../citation/ui/CiteButton.js";
|
|
9
|
+
import { isEcosystemHome } from "../../ecosystem/core/home.js";
|
|
9
10
|
import { EcosystemButton } from "../../ecosystem/ui/EcosystemButton.js";
|
|
10
11
|
import { SiteTheme } from "../../ecosystem/ui/SiteTheme.js";
|
|
11
12
|
import { HiddenPartsProvider } from "../../share/ui/HiddenPartsProvider.js";
|
|
@@ -27,9 +28,9 @@ export function ShellFrame(props) {
|
|
|
27
28
|
return hidden === undefined ? (page) : (_jsx(HiddenPartsProvider, { hidden: hidden, children: page }));
|
|
28
29
|
}
|
|
29
30
|
function ShellActions(props) {
|
|
30
|
-
const { siteId, about = false, cite, ecosystem = true, actionsBeforeAbout, actionsAfterAbout, actionsAfterCite, actions, language, compact, } = props;
|
|
31
|
+
const { siteId, site, about = false, cite, ecosystem = true, actionsBeforeAbout, actionsAfterAbout, actionsAfterCite, actions, language, compact, } = props;
|
|
31
32
|
const works = cite ?? (about === false ? [] : (about.content.cite ?? []));
|
|
32
|
-
return (_jsxs(_Fragment, { children: [fill(actionsBeforeAbout, compact), about === false ? null : (_jsx(AboutButton, { id: about.id, href: about.href ?? '/about', active: about.active, onSelect: about.onSelect, label: about.label, title: about.title })), fill(actionsAfterAbout, compact), works === false || works.length === 0 ? null : (_jsx(CiteButton, { works: works, compact: compact })), fill(actionsAfterCite, compact), ecosystem ? (_jsx(EcosystemButton, { currentSiteId: siteId, compact: compact })) : null, fill(actions, compact), fill(language, compact)] }));
|
|
33
|
+
return (_jsxs(_Fragment, { children: [fill(actionsBeforeAbout, compact), about === false ? null : (_jsx(AboutButton, { id: about.id, href: about.href ?? '/about', active: about.active, onSelect: about.onSelect, label: about.label, title: about.title })), fill(actionsAfterAbout, compact), works === false || works.length === 0 ? null : (_jsx(CiteButton, { works: works, compact: compact })), fill(actionsAfterCite, compact), ecosystem ? (_jsx(EcosystemButton, { currentSiteId: siteId, atHome: isEcosystemHome(site?.host), compact: compact })) : null, fill(actions, compact), fill(language, compact)] }));
|
|
33
34
|
}
|
|
34
35
|
function ShellShare(props) {
|
|
35
36
|
const { share, siteId, compact } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShellFrame.js","sourceRoot":"","sources":["../../../src/shell/ui/ShellFrame.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA8B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAiC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAAgC,CAAC;AAC5D,OAAO,E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AAC,eAAe,IACd,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,EACnC,OAAO,EAAE,OAAO,GAChB,CACH,CAAC,CAAC,CAAC,IAAI,EACP,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,EACtB,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,IACvB,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CACjB,KAA+B;IAE/B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACzC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,cAAc,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,KAAC,YAAY,IAAS,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAM,KAAK,GAAI,CAAC;AAC/E,CAAC;AAED,SAAS,IAAI,CAAC,IAAe,EAAE,OAAgB;IAC7C,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cheminfo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.140.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React components, hooks and framework-free helpers shared by the cheminfo sites: site chrome, citations, sharing, routing, pedagogy, charts, and the structure, orbital and 3D molecule viewers",
|
|
6
6
|
"author": "Luc Patiny",
|
|
@@ -496,6 +496,22 @@ export const CREDITS = [
|
|
|
496
496
|
description: 'the ZIP archives that are read and written in the browser.',
|
|
497
497
|
license: 'BSD-3-Clause',
|
|
498
498
|
},
|
|
499
|
+
{
|
|
500
|
+
// By Volodymyr Baydalka, published from his docxjs repository.
|
|
501
|
+
id: 'docx-preview',
|
|
502
|
+
name: 'docx-preview',
|
|
503
|
+
href: 'https://github.com/VolodymyrBaydalka/docxjs',
|
|
504
|
+
description: 'shows a Word document in the page, laid out as it prints.',
|
|
505
|
+
license: 'Apache-2.0',
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
// By catamphetamine.
|
|
509
|
+
id: 'read-excel-file',
|
|
510
|
+
name: 'read-excel-file',
|
|
511
|
+
href: 'https://gitlab.com/catamphetamine/read-excel-file',
|
|
512
|
+
description: 'reads the sheets of an Excel workbook into rows.',
|
|
513
|
+
license: 'MIT',
|
|
514
|
+
},
|
|
499
515
|
{
|
|
500
516
|
id: 'preact-signals',
|
|
501
517
|
name: 'Preact Signals',
|
|
@@ -14,7 +14,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
14
14
|
|
|
15
15
|
import type { Molecule3DCamera } from '../../molecule3d/core/camera.ts';
|
|
16
16
|
import type { Measurement } from '../../molecule3d/core/measurement.ts';
|
|
17
|
-
import type { Molecule3DTools } from '../../molecule3d/core/
|
|
17
|
+
import type { Molecule3DTools } from '../../molecule3d/core/tools.ts';
|
|
18
18
|
import { Molecule3DStage } from '../../molecule3d/ui/Molecule3DStage.tsx';
|
|
19
19
|
import { useImageExport } from '../../molecule3d/ui/useImageExport.ts';
|
|
20
20
|
import { MolstarToolbar } from '../../molstar/ui/MolstarToolbar.tsx';
|
|
@@ -20,7 +20,7 @@ import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
|
20
20
|
import { Suspense, lazy, useState } from 'react';
|
|
21
21
|
|
|
22
22
|
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
23
|
-
import type { Molecule3DTools } from '../../molecule3d/core/
|
|
23
|
+
import type { Molecule3DTools } from '../../molecule3d/core/tools.ts';
|
|
24
24
|
// Deep import on purpose: the probe imports nothing, while a barrel would pull
|
|
25
25
|
// molstar in — which is exactly what asking first exists to avoid.
|
|
26
26
|
import { probeViewerCapability } from '../../orbital/ui/capability.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Molecule3DTools } from '../../molecule3d/core/
|
|
1
|
+
import type { Molecule3DTools } from '../../molecule3d/core/tools.ts';
|
|
2
2
|
import type { CrystalViewSettings } from '../core/crystalView.ts';
|
|
3
3
|
|
|
4
4
|
import type { CrystalViewHandle } from './crystalScene.ts';
|
|
@@ -34,6 +34,20 @@ export interface FigureFileChoice<TFile extends string> {
|
|
|
34
34
|
onChange: (value: TFile | null) => void;
|
|
35
35
|
/** The line at the foot of the panel while one is picked. */
|
|
36
36
|
hint: string;
|
|
37
|
+
/**
|
|
38
|
+
* What Copy says while one is picked, for a file Copy takes in place of the
|
|
39
|
+
* picture, such as a molfile pasted into an editor.
|
|
40
|
+
* @default undefined — Copy takes the picture whatever is picked
|
|
41
|
+
*/
|
|
42
|
+
copy?: FigureFileCopy;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** What Copy says while it takes a file rather than the picture. */
|
|
46
|
+
export interface FigureFileCopy {
|
|
47
|
+
/** Said beside Copy before it is pressed. */
|
|
48
|
+
ready: string;
|
|
49
|
+
/** Said once it has copied. */
|
|
50
|
+
copied: string;
|
|
37
51
|
}
|
|
38
52
|
|
|
39
53
|
/** What {@link FigureDownloadPanel} is drawn from. */
|
|
@@ -43,8 +57,9 @@ export interface FigureDownloadPanelProps<TFile extends string = never> {
|
|
|
43
57
|
/** Which picture the reader is about to write. */
|
|
44
58
|
format: FigureFormat;
|
|
45
59
|
/**
|
|
46
|
-
* Files of another kind on offer, saved instead of a picture
|
|
47
|
-
* still
|
|
60
|
+
* Files of another kind on offer, saved instead of a picture, and copied
|
|
61
|
+
* instead of it when the choice says what Copy takes; Send still takes the
|
|
62
|
+
* picture.
|
|
48
63
|
* @default undefined — only pictures are offered
|
|
49
64
|
*/
|
|
50
65
|
file?: FigureFileChoice<TFile>;
|
|
@@ -81,7 +96,7 @@ export interface FigureDownloadPanelProps<TFile extends string = never> {
|
|
|
81
96
|
/**
|
|
82
97
|
* Called when they press copy, which puts the figure on the clipboard as a
|
|
83
98
|
* PNG and, where the browser takes one, an SVG, at the width and the
|
|
84
|
-
* resolution picked
|
|
99
|
+
* resolution picked — or the file picked, when its choice has a `copy`.
|
|
85
100
|
*/
|
|
86
101
|
onCopy: () => void;
|
|
87
102
|
/**
|
|
@@ -179,9 +194,10 @@ export function FigureDownloadPanel<TFile extends string = never>(
|
|
|
179
194
|
<p style={overlayPanelHintStyle(metrics)}>{pictureHintOf(hint, t)}</p>
|
|
180
195
|
<OverlayGroup label={t('download.copyOrSend')}>
|
|
181
196
|
<FigureQuickActions
|
|
182
|
-
disabled={size === null}
|
|
197
|
+
disabled={size === null && picked?.copy === undefined}
|
|
183
198
|
busy={saving}
|
|
184
199
|
notice={notice}
|
|
200
|
+
fileCopy={picked?.copy}
|
|
185
201
|
onCopy={onCopy}
|
|
186
202
|
onSend={onSend}
|
|
187
203
|
/>
|
|
@@ -14,6 +14,8 @@ import { SVG_CLIPBOARD_TYPE } from '../core/copySvg.ts';
|
|
|
14
14
|
import { FIGURE_PNG_TYPE } from '../core/figurePng.ts';
|
|
15
15
|
import { canShareFile } from '../core/shareFile.ts';
|
|
16
16
|
|
|
17
|
+
import type { FigureFileCopy } from './FigureDownloadPanel.tsx';
|
|
18
|
+
|
|
17
19
|
/** What {@link FigureQuickActions} needs. */
|
|
18
20
|
export interface FigureQuickActionsProps {
|
|
19
21
|
/** Whether there is a figure to copy or send. */
|
|
@@ -22,7 +24,12 @@ export interface FigureQuickActionsProps {
|
|
|
22
24
|
busy: boolean;
|
|
23
25
|
/** What the last copy or send came to. */
|
|
24
26
|
notice: FigureNotice | null;
|
|
25
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* What Copy says while it takes a file rather than the picture.
|
|
29
|
+
* @default undefined — Copy takes the picture
|
|
30
|
+
*/
|
|
31
|
+
fileCopy?: FigureFileCopy;
|
|
32
|
+
/** Copies the figure, or the file picked when `fileCopy` is given. */
|
|
26
33
|
onCopy: () => void;
|
|
27
34
|
/**
|
|
28
35
|
* Sends a PNG of the figure through the share sheet.
|
|
@@ -32,9 +39,9 @@ export interface FigureQuickActionsProps {
|
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
/**
|
|
35
|
-
* Copy and Send, which take the size picked and
|
|
36
|
-
*
|
|
37
|
-
*
|
|
42
|
+
* Copy and Send, which take the size picked, and the words beside them: what a
|
|
43
|
+
* copy puts on the clipboard, or what the last copy or send did. Copy takes the
|
|
44
|
+
* file picked instead of the picture when that file says what it copies. A row of its own rather than two panel rows, since a
|
|
38
45
|
* button needs no name column beside it.
|
|
39
46
|
* @param props - See {@link FigureQuickActionsProps}.
|
|
40
47
|
* @returns The buttons and their words.
|
|
@@ -42,7 +49,7 @@ export interface FigureQuickActionsProps {
|
|
|
42
49
|
export function FigureQuickActions(
|
|
43
50
|
props: FigureQuickActionsProps,
|
|
44
51
|
): ReactElement {
|
|
45
|
-
const { disabled, busy, notice, onCopy, onSend } = props;
|
|
52
|
+
const { disabled, busy, notice, fileCopy, onCopy, onSend } = props;
|
|
46
53
|
const t = useChromeT();
|
|
47
54
|
const { metrics } = useOverlaySurface();
|
|
48
55
|
const button = (text: string, icon: IconName, onClick: () => void) => (
|
|
@@ -63,7 +70,7 @@ export function FigureQuickActions(
|
|
|
63
70
|
? button(t('download.send'), 'send-message', onSend)
|
|
64
71
|
: null}
|
|
65
72
|
<span style={noteStyle(metrics)}>
|
|
66
|
-
{quickNote(notice, clipboardSupports(SVG_CLIPBOARD_TYPE), t)}
|
|
73
|
+
{quickNote(notice, clipboardSupports(SVG_CLIPBOARD_TYPE), t, fileCopy)}
|
|
67
74
|
</span>
|
|
68
75
|
</div>
|
|
69
76
|
);
|
|
@@ -86,7 +93,12 @@ function quickNote(
|
|
|
86
93
|
notice: FigureNotice | null,
|
|
87
94
|
svg: boolean,
|
|
88
95
|
t: Translate<ChromeKey>,
|
|
96
|
+
fileCopy: FigureFileCopy | undefined,
|
|
89
97
|
): string {
|
|
98
|
+
if (fileCopy !== undefined) {
|
|
99
|
+
if (notice === null) return fileCopy.ready;
|
|
100
|
+
if (notice === 'copied') return fileCopy.copied;
|
|
101
|
+
}
|
|
90
102
|
if (notice === 'copyUnsupported') return t('download.copyUnsupported');
|
|
91
103
|
if (notice === 'copied') {
|
|
92
104
|
return t(svg ? 'download.copiedPngSvg' : 'download.copiedPng');
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { withLanguageParam } from '../../language/core/languageParam.ts';
|
|
2
|
+
|
|
3
|
+
import type { SiteUrlOptions } from './sites.ts';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Where the family is entered: every tool by topic, and what is new on them.
|
|
7
|
+
*/
|
|
8
|
+
export const ECOSYSTEM_HOME_HOST = 'www.cheminfo.org';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The address of the family's entrance.
|
|
12
|
+
* @param options - See {@link SiteUrlOptions}.
|
|
13
|
+
* @returns The URL to open.
|
|
14
|
+
*/
|
|
15
|
+
export function ecosystemHomeUrl(options: SiteUrlOptions = {}): string {
|
|
16
|
+
return withLanguageParam(`https://${ECOSYSTEM_HOME_HOST}/`, options.language);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Whether a site is the family's entrance itself, whose menu has no reason to
|
|
21
|
+
* link back to it.
|
|
22
|
+
* @param host - The site's host, as its record writes it.
|
|
23
|
+
* @returns Whether it is the entrance.
|
|
24
|
+
*/
|
|
25
|
+
export function isEcosystemHome(host: string | undefined): boolean {
|
|
26
|
+
return host?.trim().toLowerCase() === ECOSYSTEM_HOME_HOST;
|
|
27
|
+
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export type { SiteGroup, SiteGroupId } from './groups.ts';
|
|
2
2
|
export { SITE_GROUPS } from './groups.ts';
|
|
3
|
+
export {
|
|
4
|
+
ECOSYSTEM_HOME_HOST,
|
|
5
|
+
ecosystemHomeUrl,
|
|
6
|
+
isEcosystemHome,
|
|
7
|
+
} from './home.ts';
|
|
3
8
|
export type { GroupedSites } from './lookup.ts';
|
|
4
9
|
export {
|
|
5
10
|
findSiteByHost,
|
|
@@ -13,6 +18,8 @@ export {
|
|
|
13
18
|
} from './lookup.ts';
|
|
14
19
|
export type { SiteNameColors, SiteNameColorsOptions } from './nameColors.ts';
|
|
15
20
|
export { siteNameColors } from './nameColors.ts';
|
|
21
|
+
export type { SiteSearchOptions } from './searchSites.ts';
|
|
22
|
+
export { searchSites, searchWords } from './searchSites.ts';
|
|
16
23
|
export type {
|
|
17
24
|
EcosystemSite,
|
|
18
25
|
SiteId,
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { SITE_GROUPS } from './groups.ts';
|
|
2
|
+
import { ECOSYSTEM_SITES } from './sites.ts';
|
|
3
|
+
import type { EcosystemSite } from './types.ts';
|
|
4
|
+
|
|
5
|
+
/** How {@link searchSites} reads the sites. */
|
|
6
|
+
export interface SiteSearchOptions {
|
|
7
|
+
/**
|
|
8
|
+
* More text each site answers to, such as its tagline and its topic in the
|
|
9
|
+
* language of the page, searched beside the English record.
|
|
10
|
+
* @default undefined — the English record alone
|
|
11
|
+
*/
|
|
12
|
+
texts?: (site: EcosystemSite) => readonly string[];
|
|
13
|
+
/**
|
|
14
|
+
* The sites searched.
|
|
15
|
+
* @default ECOSYSTEM_SITES — every site the Tools menu lists
|
|
16
|
+
*/
|
|
17
|
+
sites?: readonly EcosystemSite[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The sites of the family that answer what was typed, best first.
|
|
22
|
+
*
|
|
23
|
+
* Every word typed has to be found somewhere a site is known by — its name,
|
|
24
|
+
* its address, a name it had before, its tagline or its topic — with case and
|
|
25
|
+
* accents ignored, so `equilibre` finds the page that writes `équilibre`. A
|
|
26
|
+
* word the name or the address starts with ranks a site first, then a word
|
|
27
|
+
* inside the name, then one found anywhere else; ties keep the order of the
|
|
28
|
+
* catalogue.
|
|
29
|
+
* @param query - What was typed.
|
|
30
|
+
* @param options - See {@link SiteSearchOptions}.
|
|
31
|
+
* @returns The sites found, best first; none for a query with no word in it.
|
|
32
|
+
* @example
|
|
33
|
+
* searchSites('nmr')[0]?.id; // 'nmr'
|
|
34
|
+
*/
|
|
35
|
+
export function searchSites(
|
|
36
|
+
query: string,
|
|
37
|
+
options: SiteSearchOptions = {},
|
|
38
|
+
): EcosystemSite[] {
|
|
39
|
+
const words = searchWords(query);
|
|
40
|
+
if (words.length === 0) return [];
|
|
41
|
+
const { texts, sites = ECOSYSTEM_SITES } = options;
|
|
42
|
+
|
|
43
|
+
const found: Array<{ site: EcosystemSite; score: number; at: number }> = [];
|
|
44
|
+
for (let at = 0; at < sites.length; at++) {
|
|
45
|
+
const site = sites[at];
|
|
46
|
+
if (site === undefined) continue;
|
|
47
|
+
const score = siteScore(site, words, texts?.(site) ?? []);
|
|
48
|
+
if (score > 0) found.push({ site, score, at });
|
|
49
|
+
}
|
|
50
|
+
return found
|
|
51
|
+
.toSorted(
|
|
52
|
+
(first, second) => second.score - first.score || first.at - second.at,
|
|
53
|
+
)
|
|
54
|
+
.map((entry) => entry.site);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The words a query is made of, as they are compared: lowercased, without
|
|
59
|
+
* accents.
|
|
60
|
+
* @param query - What was typed.
|
|
61
|
+
* @returns Its words, none for a blank query.
|
|
62
|
+
*/
|
|
63
|
+
export function searchWords(query: string): string[] {
|
|
64
|
+
return foldText(query)
|
|
65
|
+
.split(/\s+/u)
|
|
66
|
+
.filter((word) => word !== '');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function siteScore(
|
|
70
|
+
site: EcosystemSite,
|
|
71
|
+
words: readonly string[],
|
|
72
|
+
extra: readonly string[],
|
|
73
|
+
): number {
|
|
74
|
+
const name = foldText(`${site.name.lead}${site.name.alt}`);
|
|
75
|
+
const host = foldText(site.host);
|
|
76
|
+
const text = foldText(
|
|
77
|
+
[
|
|
78
|
+
site.id,
|
|
79
|
+
site.name.lead,
|
|
80
|
+
site.name.alt,
|
|
81
|
+
site.host,
|
|
82
|
+
...(site.formerIds ?? []),
|
|
83
|
+
...(site.formerHosts ?? []),
|
|
84
|
+
site.tagline,
|
|
85
|
+
SITE_GROUPS.find((group) => group.id === site.group)?.label ?? '',
|
|
86
|
+
...extra,
|
|
87
|
+
].join(' '),
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
let score = 0;
|
|
91
|
+
for (const word of words) {
|
|
92
|
+
if (!text.includes(word) && !name.includes(word)) return 0;
|
|
93
|
+
if (name.startsWith(word) || host.startsWith(word)) score += 3;
|
|
94
|
+
else if (name.includes(word)) score += 2;
|
|
95
|
+
else score += 1;
|
|
96
|
+
}
|
|
97
|
+
return score;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function foldText(text: string): string {
|
|
101
|
+
return text.normalize('NFD').replaceAll(/\p{M}/gu, '').toLowerCase();
|
|
102
|
+
}
|
|
@@ -51,4 +51,19 @@ export const UNLISTED_SITES: readonly EcosystemSite[] = [
|
|
|
51
51
|
},
|
|
52
52
|
],
|
|
53
53
|
},
|
|
54
|
+
{
|
|
55
|
+
id: 'fair',
|
|
56
|
+
name: { lead: 'fair', alt: 'cheminfo', dot: true },
|
|
57
|
+
host: 'fair.cheminfo.org',
|
|
58
|
+
tagline:
|
|
59
|
+
'Explore published chemistry datasets: compounds, spectra and documents.',
|
|
60
|
+
group: 'research',
|
|
61
|
+
// A deep olive leads at 7.08:1 on white, darker than metabo's olive so the
|
|
62
|
+
// two read apart, and an ocean blue answers at 5.93:1.
|
|
63
|
+
brand: '#3f6212',
|
|
64
|
+
brandAlt: '#0369a1',
|
|
65
|
+
// The mark takes the light form of that blue, 4.24:1 on the olive plate:
|
|
66
|
+
// the dark form sits at 1.19:1 there and vanishes at 16 px.
|
|
67
|
+
mark: { plate: '#3f6212', accent: '#7dd3fc' },
|
|
68
|
+
},
|
|
54
69
|
];
|
|
@@ -15,6 +15,12 @@ export interface EcosystemButtonProps extends HeaderButtonProps {
|
|
|
15
15
|
* @default undefined
|
|
16
16
|
*/
|
|
17
17
|
currentSiteId?: SiteId;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the button sits on the family's entrance, www.cheminfo.org, which
|
|
20
|
+
* its menu then does not link back to.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
atHome?: boolean;
|
|
18
24
|
/**
|
|
19
25
|
* Text of the button. In a compact bar it is not written, but it stays what
|
|
20
26
|
* the pointer and a screen reader are told.
|
|
@@ -35,7 +41,7 @@ export interface EcosystemButtonProps extends HeaderButtonProps {
|
|
|
35
41
|
* @returns The button and its menu.
|
|
36
42
|
*/
|
|
37
43
|
export function EcosystemButton(props: EcosystemButtonProps): ReactElement {
|
|
38
|
-
const { currentSiteId, label, className, ...rest } = props;
|
|
44
|
+
const { currentSiteId, atHome, label, className, ...rest } = props;
|
|
39
45
|
const t = useChromeT();
|
|
40
46
|
|
|
41
47
|
return (
|
|
@@ -44,7 +50,7 @@ export function EcosystemButton(props: EcosystemButtonProps): ReactElement {
|
|
|
44
50
|
className={joinClassNames('ecosystem-button', className)}
|
|
45
51
|
icon="grid-view"
|
|
46
52
|
label={label ?? t('ecosystem.tools')}
|
|
47
|
-
menu={<EcosystemMenu currentSiteId={currentSiteId} />}
|
|
53
|
+
menu={<EcosystemMenu currentSiteId={currentSiteId} atHome={atHome} />}
|
|
48
54
|
/>
|
|
49
55
|
);
|
|
50
56
|
}
|