@curvenote/theme-ui 2.0.1 → 2.1.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/dist/components/index.d.ts +4 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -3
- package/dist/components/layout/app-layout.d.ts +3 -3
- package/dist/components/layout/app-layout.d.ts.map +1 -1
- package/dist/components/layout/app-layout.js +26 -16
- package/dist/components/layout/app-sidebar.d.ts +2 -1
- package/dist/components/layout/app-sidebar.d.ts.map +1 -1
- package/dist/components/layout/app-sidebar.js +8 -8
- package/dist/components/layout/article-layout.d.ts +3 -3
- package/dist/components/layout/article-layout.d.ts.map +1 -1
- package/dist/components/layout/article-layout.js +17 -10
- package/dist/components/layout/grid.d.ts +1 -1
- package/dist/components/layout/grid.d.ts.map +1 -1
- package/dist/components/layout/header.d.ts +5 -3
- package/dist/components/layout/header.d.ts.map +1 -1
- package/dist/components/layout/header.js +6 -3
- package/dist/components/layout/index.d.ts +7 -7
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +7 -7
- package/dist/components/layout/layout-header.d.ts +9 -0
- package/dist/components/layout/layout-header.d.ts.map +1 -0
- package/dist/components/layout/layout-header.js +13 -0
- package/dist/components/layout/loading-bar.d.ts +1 -1
- package/dist/components/layout/loading-bar.d.ts.map +1 -1
- package/dist/components/layout/loading-bar.js +1 -1
- package/dist/components/layout/site-header.d.ts +1 -1
- package/dist/components/layout/site-header.d.ts.map +1 -1
- package/dist/components/layout/site-header.js +21 -9
- package/dist/components/layout/types.d.ts +11 -0
- package/dist/components/layout/types.d.ts.map +1 -1
- package/dist/components/providers/analytics-boundary.d.ts +1 -1
- package/dist/components/providers/analytics-boundary.d.ts.map +1 -1
- package/dist/components/providers/analytics-boundary.js +3 -3
- package/dist/components/providers/analytics-dev-tray.d.ts +1 -1
- package/dist/components/providers/analytics-dev-tray.d.ts.map +1 -1
- package/dist/components/providers/analytics-dev-tray.js +3 -3
- package/dist/components/providers/article-versions-provider.d.ts +1 -1
- package/dist/components/providers/article-versions-provider.d.ts.map +1 -1
- package/dist/components/providers/compute.d.ts +1 -1
- package/dist/components/providers/compute.d.ts.map +1 -1
- package/dist/components/providers/curvenote-providers.d.ts +28 -19
- package/dist/components/providers/curvenote-providers.d.ts.map +1 -1
- package/dist/components/providers/curvenote-providers.js +28 -14
- package/dist/components/providers/design.d.ts +1 -1
- package/dist/components/providers/design.d.ts.map +1 -1
- package/dist/components/providers/design.js +2 -1
- package/dist/components/providers/index.d.ts +11 -11
- package/dist/components/providers/index.d.ts.map +1 -1
- package/dist/components/providers/index.js +11 -11
- package/dist/components/providers/lightbox-provider.d.ts +1 -1
- package/dist/components/providers/lightbox-provider.d.ts.map +1 -1
- package/dist/components/providers/myst-providers.d.ts +1 -1
- package/dist/components/providers/myst-providers.d.ts.map +1 -1
- package/dist/components/providers/overlay-depth.d.ts +1 -1
- package/dist/components/providers/overlay-depth.d.ts.map +1 -1
- package/dist/components/providers/page-providers.d.ts +2 -2
- package/dist/components/providers/page-providers.d.ts.map +1 -1
- package/dist/components/providers/ping-boundary.d.ts +1 -1
- package/dist/components/providers/ping-boundary.d.ts.map +1 -1
- package/dist/components/providers/platform-providers.d.ts +1 -1
- package/dist/components/providers/platform-providers.d.ts.map +1 -1
- package/dist/components/site-renderers/host-import-map-script.d.ts +8 -0
- package/dist/components/site-renderers/host-import-map-script.d.ts.map +1 -0
- package/dist/components/site-renderers/host-import-map-script.js +30 -0
- package/dist/components/site-renderers/host-import-map.d.ts +40 -0
- package/dist/components/site-renderers/host-import-map.d.ts.map +1 -0
- package/dist/components/site-renderers/host-import-map.js +136 -0
- package/dist/components/site-renderers/host-react-modules.d.ts +15 -0
- package/dist/components/site-renderers/host-react-modules.d.ts.map +1 -0
- package/dist/components/site-renderers/host-react-modules.js +17 -0
- package/dist/components/site-renderers/index.d.ts +6 -0
- package/dist/components/site-renderers/index.d.ts.map +1 -0
- package/dist/components/site-renderers/index.js +7 -0
- package/dist/components/site-renderers/site-myst-providers.d.ts +8 -0
- package/dist/components/site-renderers/site-myst-providers.d.ts.map +1 -0
- package/dist/components/site-renderers/site-myst-providers.js +40 -0
- package/dist/components/site-renderers/site-renderers.d.ts +23 -0
- package/dist/components/site-renderers/site-renderers.d.ts.map +1 -0
- package/dist/components/site-renderers/site-renderers.js +48 -0
- package/dist/components/ui/Callout.d.ts +1 -1
- package/dist/components/ui/Callout.d.ts.map +1 -1
- package/dist/components/ui/Callout.js +1 -1
- package/dist/components/ui/PageCards.d.ts +2 -1
- package/dist/components/ui/PageCards.d.ts.map +1 -1
- package/dist/components/ui/abbreviations.d.ts +2 -1
- package/dist/components/ui/abbreviations.d.ts.map +1 -1
- package/dist/components/ui/abbreviations.js +7 -14
- package/dist/components/ui/abstract.d.ts +1 -1
- package/dist/components/ui/abstract.d.ts.map +1 -1
- package/dist/components/ui/accessibility-skip-to.d.ts +3 -3
- package/dist/components/ui/accessibility-skip-to.d.ts.map +1 -1
- package/dist/components/ui/accessibility-skip-to.js +1 -1
- package/dist/components/ui/acknowledgements.d.ts +1 -1
- package/dist/components/ui/acknowledgements.d.ts.map +1 -1
- package/dist/components/ui/acknowledgements.js +4 -4
- package/dist/components/ui/arrow.d.ts +3 -3
- package/dist/components/ui/arrow.d.ts.map +1 -1
- package/dist/components/ui/article-actions-downloads.d.ts +24 -3
- package/dist/components/ui/article-actions-downloads.d.ts.map +1 -1
- package/dist/components/ui/article-actions-downloads.js +58 -16
- package/dist/components/ui/article-actions-dropdown.d.ts +1 -1
- package/dist/components/ui/article-actions-dropdown.d.ts.map +1 -1
- package/dist/components/ui/article-actions-dropdown.js +9 -9
- package/dist/components/ui/article-actions-share.d.ts +1 -1
- package/dist/components/ui/article-actions-share.d.ts.map +1 -1
- package/dist/components/ui/article-actions-share.js +2 -2
- package/dist/components/ui/article-actions.d.ts +1 -1
- package/dist/components/ui/article-actions.d.ts.map +1 -1
- package/dist/components/ui/article-actions.js +29 -8
- package/dist/components/ui/article-bar.d.ts +16 -3
- package/dist/components/ui/article-bar.d.ts.map +1 -1
- package/dist/components/ui/article-bar.js +9 -7
- package/dist/components/ui/article-card.d.ts +1 -1
- package/dist/components/ui/article-card.d.ts.map +1 -1
- package/dist/components/ui/article-card.js +9 -4
- package/dist/components/ui/article-footer.d.ts +1 -1
- package/dist/components/ui/article-footer.d.ts.map +1 -1
- package/dist/components/ui/article-footer.js +1 -1
- package/dist/components/ui/author-popover.d.ts +1 -1
- package/dist/components/ui/author-popover.d.ts.map +1 -1
- package/dist/components/ui/author-popover.js +3 -3
- package/dist/components/ui/backmatter.d.ts +41 -3
- package/dist/components/ui/backmatter.d.ts.map +1 -1
- package/dist/components/ui/backmatter.js +117 -34
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +1 -1
- package/dist/components/ui/banner.d.ts +22 -1
- package/dist/components/ui/banner.d.ts.map +1 -1
- package/dist/components/ui/banner.js +44 -3
- package/dist/components/ui/bibliography.d.ts +1 -1
- package/dist/components/ui/bibliography.d.ts.map +1 -1
- package/dist/components/ui/bibliography.js +3 -3
- package/dist/components/ui/breadcrumb.d.ts +7 -7
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/calendar.d.ts +1 -1
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/citation.d.ts +2 -2
- package/dist/components/ui/citation.d.ts.map +1 -1
- package/dist/components/ui/citation.js +5 -5
- package/dist/components/ui/collapsible-backmatter-section.d.ts +2 -2
- package/dist/components/ui/collapsible-backmatter-section.d.ts.map +1 -1
- package/dist/components/ui/collapsible-backmatter-section.js +3 -3
- package/dist/components/ui/collapsible.d.ts +3 -3
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/cookie-banner.d.ts +2 -1
- package/dist/components/ui/cookie-banner.d.ts.map +1 -1
- package/dist/components/ui/cookie-banner.js +4 -4
- package/dist/components/ui/data-availability.d.ts +1 -1
- package/dist/components/ui/data-availability.d.ts.map +1 -1
- package/dist/components/ui/data-availability.js +4 -4
- package/dist/components/ui/dhr-cta-buttons.d.ts +30 -0
- package/dist/components/ui/dhr-cta-buttons.d.ts.map +1 -0
- package/dist/components/ui/dhr-cta-buttons.js +40 -0
- package/dist/components/ui/dialog.d.ts +10 -10
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/document-outline.d.ts +11 -2
- package/dist/components/ui/document-outline.d.ts.map +1 -1
- package/dist/components/ui/document-outline.js +101 -54
- package/dist/components/ui/dropdown-menu.d.ts +15 -15
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/error-page.d.ts +1 -1
- package/dist/components/ui/error-page.d.ts.map +1 -1
- package/dist/components/ui/error-page.js +1 -1
- package/dist/components/ui/font-styles.d.ts +23 -0
- package/dist/components/ui/font-styles.d.ts.map +1 -0
- package/dist/components/ui/font-styles.js +39 -0
- package/dist/components/ui/footer-links.d.ts +1 -1
- package/dist/components/ui/footer-links.d.ts.map +1 -1
- package/dist/components/ui/footer-links.js +2 -2
- package/dist/components/ui/footnotes.d.ts +1 -1
- package/dist/components/ui/footnotes.d.ts.map +1 -1
- package/dist/components/ui/footnotes.js +3 -2
- package/dist/components/ui/frontmatter-badges.d.ts +7 -7
- package/dist/components/ui/frontmatter-badges.d.ts.map +1 -1
- package/dist/components/ui/frontmatter-badges.js +5 -5
- package/dist/components/ui/frontmatter.d.ts +1 -1
- package/dist/components/ui/frontmatter.d.ts.map +1 -1
- package/dist/components/ui/frontmatter.js +1 -1
- package/dist/components/ui/hash-link.d.ts.map +1 -1
- package/dist/components/ui/hash-link.js +2 -1
- package/dist/components/ui/image.d.ts +2 -2
- package/dist/components/ui/image.d.ts.map +1 -1
- package/dist/components/ui/image.js +3 -3
- package/dist/components/ui/index.d.ts +62 -57
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +59 -56
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/keywords.d.ts +1 -1
- package/dist/components/ui/keywords.d.ts.map +1 -1
- package/dist/components/ui/keywords.js +3 -3
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/license-description.d.ts +1 -1
- package/dist/components/ui/license-description.d.ts.map +1 -1
- package/dist/components/ui/license-description.js +3 -3
- package/dist/components/ui/license-frontmatter.d.ts +2 -2
- package/dist/components/ui/license-frontmatter.d.ts.map +1 -1
- package/dist/components/ui/license-frontmatter.js +4 -4
- package/dist/components/ui/lightbox-container.d.ts +2 -2
- package/dist/components/ui/lightbox-container.d.ts.map +1 -1
- package/dist/components/ui/lightbox-container.js +2 -2
- package/dist/components/ui/lightbox.d.ts +3 -2
- package/dist/components/ui/lightbox.d.ts.map +1 -1
- package/dist/components/ui/lightbox.js +6 -6
- package/dist/components/ui/link-card.d.ts +1 -1
- package/dist/components/ui/link-card.d.ts.map +1 -1
- package/dist/components/ui/link-card.js +1 -1
- package/dist/components/ui/pagination.d.ts +7 -7
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +1 -1
- package/dist/components/ui/popover.d.ts +4 -4
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/search.d.ts +1 -1
- package/dist/components/ui/search.d.ts.map +1 -1
- package/dist/components/ui/search.js +2 -2
- package/dist/components/ui/select.d.ts +10 -10
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/separator.d.ts +1 -1
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/sheet.d.ts +8 -8
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/sidebar.d.ts +23 -23
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +3 -3
- package/dist/components/ui/site-color-styles.d.ts +8 -0
- package/dist/components/ui/site-color-styles.d.ts.map +1 -0
- package/dist/components/ui/site-color-styles.js +16 -0
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/sonner.d.ts +1 -1
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/theme-button.d.ts +1 -1
- package/dist/components/ui/theme-button.d.ts.map +1 -1
- package/dist/components/ui/theme-button.js +3 -3
- package/dist/components/ui/tooltip.d.ts +4 -4
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +2 -2
- package/dist/components/ui/types.d.ts +1 -0
- package/dist/components/ui/types.d.ts.map +1 -1
- package/dist/components/ui/types.js +1 -0
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/use-theme.d.ts +1 -1
- package/dist/hooks/use-theme.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/dedupeAbbreviations.d.ts +11 -0
- package/dist/lib/dedupeAbbreviations.d.ts.map +1 -1
- package/dist/lib/dedupeAbbreviations.js +17 -0
- package/dist/lib/fonts.d.ts +29 -0
- package/dist/lib/fonts.d.ts.map +1 -0
- package/dist/lib/fonts.js +148 -0
- package/dist/lib/index.d.ts +6 -5
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +6 -5
- package/dist/lib/site-colors.d.ts +10 -0
- package/dist/lib/site-colors.d.ts.map +1 -0
- package/dist/lib/site-colors.js +20 -0
- package/package.json +22 -4
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as ReactNamespace from 'react';
|
|
2
|
+
import * as ReactDOMNamespace from 'react-dom';
|
|
3
|
+
import * as ReactDOMClientNamespace from 'react-dom/client';
|
|
4
|
+
import * as JsxRuntime from 'react/jsx-runtime';
|
|
5
|
+
import * as JsxDevRuntime from 'react/jsx-dev-runtime';
|
|
6
|
+
import { registerHostModules } from './host-import-map.js';
|
|
7
|
+
/** Runtime namespaces corresponding exactly to the supported host import-map specifiers. */
|
|
8
|
+
export const HOST_REACT_MODULES = {
|
|
9
|
+
react: ReactNamespace,
|
|
10
|
+
'react/jsx-runtime': JsxRuntime,
|
|
11
|
+
'react/jsx-dev-runtime': JsxDevRuntime,
|
|
12
|
+
'react-dom': ReactDOMNamespace,
|
|
13
|
+
'react-dom/client': ReactDOMClientNamespace,
|
|
14
|
+
};
|
|
15
|
+
export function registerReactHostModules() {
|
|
16
|
+
registerHostModules(HOST_REACT_MODULES);
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { SiteMystProviders } from './site-myst-providers.js';
|
|
2
|
+
export { HostImportMap, HOST_REACT_MODULES } from './host-import-map-script.js';
|
|
3
|
+
export { registerReactHostModules } from './host-react-modules.js';
|
|
4
|
+
export * from './host-import-map.js';
|
|
5
|
+
export * from './site-renderers.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/site-renderers/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Site render plugins: renderer modules a site lists in its config (`renderers`), loaded at
|
|
2
|
+
// runtime, plus the host import map that lets those modules share the theme's React.
|
|
3
|
+
export { SiteMystProviders } from './site-myst-providers.js';
|
|
4
|
+
export { HostImportMap, HOST_REACT_MODULES } from './host-import-map-script.js';
|
|
5
|
+
export { registerReactHostModules } from './host-react-modules.js';
|
|
6
|
+
export * from './host-import-map.js';
|
|
7
|
+
export * from './site-renderers.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { NodeRenderers } from '@myst-theme/providers';
|
|
4
|
+
export declare function SiteMystProviders({ children, renderers: baseRenderers, }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
renderers: NodeRenderers;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=site-myst-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-myst-providers.d.ts","sourceRoot":"","sources":["../../../src/components/site-renderers/site-myst-providers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAW3D,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,SAAS,EAAE,aAAa,GACzB,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,EAAE,aAAa,CAAC;CAC1B,qBAsCA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { MyST } from 'myst-to-react';
|
|
5
|
+
import { MystProviders } from '../providers/myst-providers.js';
|
|
6
|
+
import { usePlatformConfig } from '../providers/platform-providers.js';
|
|
7
|
+
import { getSiteRendererUrls, loadSiteRenderers, mergeBaseWithSitePlugins, siteRendererUrlsKey, } from './site-renderers.js';
|
|
8
|
+
export function SiteMystProviders({ children, renderers: baseRenderers, }) {
|
|
9
|
+
const config = usePlatformConfig();
|
|
10
|
+
const [renderers, setRenderers] = useState(baseRenderers);
|
|
11
|
+
const pluginsRef = useRef([]);
|
|
12
|
+
const baseRenderersRef = useRef(baseRenderers);
|
|
13
|
+
baseRenderersRef.current = baseRenderers;
|
|
14
|
+
const urls = getSiteRendererUrls(config.renderers);
|
|
15
|
+
const rendererUrlsKey = siteRendererUrlsKey(urls);
|
|
16
|
+
// Re-merge when base renderers change without clearing loaded plugins.
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
setRenderers(mergeBaseWithSitePlugins(baseRenderers, pluginsRef.current));
|
|
19
|
+
}, [baseRenderers]);
|
|
20
|
+
// Reload plugins only when the renderer URL list actually changes.
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!urls.length) {
|
|
23
|
+
pluginsRef.current = [];
|
|
24
|
+
setRenderers(baseRenderersRef.current);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
let cancelled = false;
|
|
28
|
+
void loadSiteRenderers(urls, { React, ASTComponent: MyST }).then((plugins) => {
|
|
29
|
+
if (cancelled)
|
|
30
|
+
return;
|
|
31
|
+
pluginsRef.current = plugins;
|
|
32
|
+
setRenderers(mergeBaseWithSitePlugins(baseRenderersRef.current, plugins));
|
|
33
|
+
});
|
|
34
|
+
return () => {
|
|
35
|
+
cancelled = true;
|
|
36
|
+
};
|
|
37
|
+
// urls is derived from rendererUrlsKey; depend on the stable key only.
|
|
38
|
+
}, [rendererUrlsKey]);
|
|
39
|
+
return _jsx(MystProviders, { renderers: renderers, children: children });
|
|
40
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as ReactNamespace from 'react';
|
|
2
|
+
import { type NodeRenderers } from '@myst-theme/providers';
|
|
3
|
+
import type { GenericNode } from 'myst-common';
|
|
4
|
+
export type ASTComponentProps = {
|
|
5
|
+
ast?: GenericNode | GenericNode[];
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export type ASTRendererContext = {
|
|
9
|
+
React: typeof ReactNamespace;
|
|
10
|
+
ASTComponent: ReactNamespace.ComponentType<ASTComponentProps>;
|
|
11
|
+
};
|
|
12
|
+
export type ASTRenderer = (ctx: ASTRendererContext) => NodeRenderers;
|
|
13
|
+
export type SiteRendererRef = string | {
|
|
14
|
+
url: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function getSiteRendererUrls(renderers: SiteRendererRef[] | undefined | null): string[];
|
|
18
|
+
/** Stable effect dependency when renderer URL lists are equal by value. */
|
|
19
|
+
export declare function siteRendererUrlsKey(urls: string[]): string;
|
|
20
|
+
/** Merge base renderers with loaded plugins, or return base when plugins are empty. */
|
|
21
|
+
export declare function mergeBaseWithSitePlugins(baseRenderers: NodeRenderers, plugins: NodeRenderers[]): NodeRenderers;
|
|
22
|
+
export declare function loadSiteRenderers(urls: string[], ctx: ASTRendererContext): Promise<NodeRenderers[]>;
|
|
23
|
+
//# sourceMappingURL=site-renderers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-renderers.d.ts","sourceRoot":"","sources":["../../../src/components/site-renderers/site-renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,OAAO,cAAc,CAAC;IAC7B,YAAY,EAAE,cAAc,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,kBAAkB,KAAK,aAAa,CAAC;AAErE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,EAAE,CAK7F;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAE1D;AAED,uFAAuF;AACvF,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,aAAa,EAAE,GACvB,aAAa,CAGf;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,kBAAkB,GACtB,OAAO,CAAC,aAAa,EAAE,CAAC,CAiC1B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { mergeRenderers } from '@myst-theme/providers';
|
|
2
|
+
import { isImportMapResolutionError } from './host-import-map.js';
|
|
3
|
+
import { registerReactHostModules } from './host-react-modules.js';
|
|
4
|
+
export function getSiteRendererUrls(renderers) {
|
|
5
|
+
if (!renderers?.length)
|
|
6
|
+
return [];
|
|
7
|
+
return renderers
|
|
8
|
+
.map((entry) => (typeof entry === 'string' ? entry : entry?.url))
|
|
9
|
+
.filter((url) => typeof url === 'string' && url.length > 0);
|
|
10
|
+
}
|
|
11
|
+
/** Stable effect dependency when renderer URL lists are equal by value. */
|
|
12
|
+
export function siteRendererUrlsKey(urls) {
|
|
13
|
+
return urls.join('\0');
|
|
14
|
+
}
|
|
15
|
+
/** Merge base renderers with loaded plugins, or return base when plugins are empty. */
|
|
16
|
+
export function mergeBaseWithSitePlugins(baseRenderers, plugins) {
|
|
17
|
+
if (!plugins.length)
|
|
18
|
+
return baseRenderers;
|
|
19
|
+
return mergeRenderers([baseRenderers, ...plugins]);
|
|
20
|
+
}
|
|
21
|
+
export async function loadSiteRenderers(urls, ctx) {
|
|
22
|
+
// Ensure namespaces are registered even if HostImportMap has not evaluated yet.
|
|
23
|
+
registerReactHostModules();
|
|
24
|
+
const results = await Promise.all(urls.map(async (url) => {
|
|
25
|
+
try {
|
|
26
|
+
const mod = await import(/* @vite-ignore */ url);
|
|
27
|
+
const exported = mod.default ?? mod.renderers;
|
|
28
|
+
if (typeof exported === 'function') {
|
|
29
|
+
return exported(ctx);
|
|
30
|
+
}
|
|
31
|
+
if (exported && typeof exported === 'object') {
|
|
32
|
+
return exported;
|
|
33
|
+
}
|
|
34
|
+
console.warn(`Site renderer at ${url} must default-export a NodeRenderers map or an ASTRenderer (ctx) => NodeRenderers`);
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (isImportMapResolutionError(error)) {
|
|
39
|
+
console.warn(`Failed to load site renderer (host import map missing or applied too late for bare specifiers): ${url}`, error);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
console.warn(`Failed to load site renderer: ${url}`, error);
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
return results.filter((result) => result != null);
|
|
48
|
+
}
|
|
@@ -5,6 +5,6 @@ interface CalloutProps {
|
|
|
5
5
|
button?: React.ReactNode;
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function Callout({ title, description, button, className }: CalloutProps):
|
|
8
|
+
export declare function Callout({ title, description, button, className }: CalloutProps): React.JSX.Element;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=Callout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Callout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,YAAY;IACpB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Callout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,YAAY;IACpB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,YAAY,qBAkB9E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Info } from 'lucide-react';
|
|
4
|
-
import { cn } from '../../lib/utils';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
5
|
export function Callout({ title, description, button, className }) {
|
|
6
6
|
return (_jsxs("div", { className: cn('flex flex-col lg:flex-row items-center justify-between bg-muted/50 rounded p-4 my-4 gap-3', className), children: [_jsxs("div", { className: "flex items-start gap-2 grow self-start", children: [_jsx(Info, { className: "text-sky-500 mt-0.5", size: 18 }), _jsxs("div", { children: [_jsx("div", { className: "font-semibold text-sm", children: title }), description && _jsx("div", { className: "text-sm text-muted-foreground mt-0.5", children: description })] })] }), button && _jsx("div", { className: "ml-4 self-end lg:self-center", children: button })] }));
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageCards.d.ts","sourceRoot":"","sources":["../../../src/components/ui/PageCards.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PageCards.d.ts","sourceRoot":"","sources":["../../../src/components/ui/PageCards.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,wBAAgB,SAAS,sBAyCxB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export declare function Abbreviations({ sorted, className, hideManyAbbreviations, }: {
|
|
2
3
|
sorted?: boolean;
|
|
3
4
|
className?: string;
|
|
4
5
|
/** When truthy, initially show only this many abbreviations with a "Show All" option. Pass a number or true. */
|
|
5
6
|
hideManyAbbreviations?: boolean | number;
|
|
6
|
-
}):
|
|
7
|
+
}): React.JSX.Element | null;
|
|
7
8
|
//# sourceMappingURL=abbreviations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abbreviations.d.ts","sourceRoot":"","sources":["../../../src/components/ui/abbreviations.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abbreviations.d.ts","sourceRoot":"","sources":["../../../src/components/ui/abbreviations.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,wBAAgB,aAAa,CAAC,EAC5B,MAAa,EACb,SAAS,EACT,qBAAkD,GACnD,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gHAAgH;IAChH,qBAAqB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC1C,4BAsDA"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useFrontmatter, useReferences } from '@myst-theme/providers';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useCollapsibleBackmatter, CollapsibleBackmatterHeader, CollapsibleBackmatterFooterButton, } from './collapsible-backmatter-section';
|
|
9
|
-
import { dedupeAbbreviationEntries } from '../../lib/dedupeAbbreviations';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
import { PART_IDS } from './types.js';
|
|
6
|
+
import { useCollapsibleBackmatter, CollapsibleBackmatterHeader, CollapsibleBackmatterFooterButton, } from './collapsible-backmatter-section.js';
|
|
7
|
+
import { selectAbbreviationEntries } from '../../lib/dedupeAbbreviations.js';
|
|
10
8
|
const DEFAULT_MANY_ABBREVIATIONS = 5;
|
|
11
9
|
function useAbbreviations() {
|
|
12
10
|
const frontmatter = useFrontmatter();
|
|
13
11
|
const references = useReferences();
|
|
14
12
|
const page = references?.article;
|
|
15
|
-
const parts = Object.values(frontmatter?.parts ?? {})
|
|
16
|
-
|
|
17
|
-
.filter(Boolean);
|
|
18
|
-
const fullTree = { type: 'page', children: [page, ...parts].filter(Boolean) };
|
|
19
|
-
const inTextAbbreviations = selectAll('abbreviation', fullTree);
|
|
20
|
-
const entries = inTextAbbreviations.map((node) => [toText(node), node.title]);
|
|
21
|
-
const deduped = dedupeAbbreviationEntries(entries, frontmatter?.abbreviations);
|
|
13
|
+
const parts = Object.values(frontmatter?.parts ?? {}).map((part) => part.mdast);
|
|
14
|
+
const deduped = selectAbbreviationEntries([page, ...parts], frontmatter?.abbreviations);
|
|
22
15
|
if (deduped.length === 0)
|
|
23
16
|
return undefined;
|
|
24
17
|
return Object.fromEntries(deduped);
|
|
@@ -34,5 +27,5 @@ export function Abbreviations({ sorted = true, className, hideManyAbbreviations
|
|
|
34
27
|
: Object.entries(abbreviations);
|
|
35
28
|
const { hidden, toggle, displayedCount, isCollapsible } = useCollapsibleBackmatter(sortedAbbreviations.length, hideManyAbbreviations, DEFAULT_MANY_ABBREVIATIONS);
|
|
36
29
|
const displayed = sortedAbbreviations.slice(0, displayedCount);
|
|
37
|
-
return (_jsxs("section", { id: PART_IDS.abbreviations, className: cn('min-w-full prose dark:prose-invert prose-sm', className), children: [_jsx(CollapsibleBackmatterHeader, { id: PART_IDS.abbreviations, title: "Abbreviations", linkTitle: "Link to Abbreviations", hidden: hidden, onToggle: toggle, isCollapsible: isCollapsible }), _jsxs("div", { className: cn('pl-3 mb-8 text-xs text-stone-500 dark:text-stone-300'), children: [_jsx("dl", { className: "grid grid-cols-[auto_1fr] gap-x-6 gap-y-2", children: displayed.map(([abbreviation, description]) => (_jsxs(React.Fragment, { children: [_jsx("dt", { className: "py-1 pt-0 m-0 mt-0 font-medium text-stone-900 dark:text-white", children: abbreviation }), _jsx("dd", { className: "flex items-center py-1 pt-0 m-0 mt-0 text-center text-stone-600 dark:text-stone-400", children: description })] }, abbreviation))) }), isCollapsible && (_jsx(CollapsibleBackmatterFooterButton, { hidden: hidden, onToggle: toggle, totalCount: sortedAbbreviations.length, itemLabel: "abbreviations", sectionId: PART_IDS.abbreviations, className: "flex justify-center pt-2", as: "div" }))] })] }));
|
|
30
|
+
return (_jsxs("section", { id: PART_IDS.abbreviations, className: cn('min-w-full prose dark:prose-invert prose-sm font-small', className), children: [_jsx(CollapsibleBackmatterHeader, { id: PART_IDS.abbreviations, title: "Abbreviations", linkTitle: "Link to Abbreviations", hidden: hidden, onToggle: toggle, isCollapsible: isCollapsible }), _jsxs("div", { className: cn('pl-3 mb-8 text-xs text-stone-500 dark:text-stone-300'), children: [_jsx("dl", { className: "grid grid-cols-[auto_1fr] gap-x-6 gap-y-2", children: displayed.map(([abbreviation, description]) => (_jsxs(React.Fragment, { children: [_jsx("dt", { className: "py-1 pt-0 m-0 mt-0 font-medium text-stone-900 dark:text-white", children: abbreviation }), _jsx("dd", { className: "flex items-center py-1 pt-0 m-0 mt-0 text-center text-stone-600 dark:text-stone-400", children: description })] }, abbreviation))) }), isCollapsible && (_jsx(CollapsibleBackmatterFooterButton, { hidden: hidden, onToggle: toggle, totalCount: sortedAbbreviations.length, itemLabel: "abbreviations", sectionId: PART_IDS.abbreviations, className: "flex justify-center pt-2", as: "div" }))] })] }));
|
|
38
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract.d.ts","sourceRoot":"","sources":["../../../src/components/ui/abstract.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,aAAa,CAAC;AAI9D,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,KAAkB,EAClB,EAAe,EACf,SAAS,GACV,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,
|
|
1
|
+
{"version":3,"file":"abstract.d.ts","sourceRoot":"","sources":["../../../src/components/ui/abstract.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,aAAa,CAAC;AAI9D,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,KAAkB,EAClB,EAAe,EACf,SAAS,GACV,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sCAcA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PART_IDS } from './types';
|
|
2
|
+
import { PART_IDS } from './types.js';
|
|
3
3
|
export declare function createSkipToTargets(): ({
|
|
4
4
|
id: "skip-to-content";
|
|
5
5
|
title: string;
|
|
@@ -18,8 +18,8 @@ export declare const SkipTo: React.MemoExoticComponent<({ targets }: {
|
|
|
18
18
|
id: string;
|
|
19
19
|
title: string;
|
|
20
20
|
}[];
|
|
21
|
-
}) =>
|
|
21
|
+
}) => React.JSX.Element>;
|
|
22
22
|
export declare function SkipToAnchor({ id }: {
|
|
23
23
|
id: (typeof PART_IDS)[keyof typeof PART_IDS];
|
|
24
|
-
}):
|
|
24
|
+
}): React.JSX.Element;
|
|
25
25
|
//# sourceMappingURL=accessibility-skip-to.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessibility-skip-to.d.ts","sourceRoot":"","sources":["../../../src/components/ui/accessibility-skip-to.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"accessibility-skip-to.d.ts","sourceRoot":"","sources":["../../../src/components/ui/accessibility-skip-to.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAgBtC,wBAAgB,mBAAmB;;;;;;;;;KAMlC;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,0CAA4B;IAAE,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,uBAkBzF,CAAC;AAEH,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAA;CAAE,qBAEpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acknowledgements.d.ts","sourceRoot":"","sources":["../../../src/components/ui/acknowledgements.tsx"],"names":[],"mappings":"AAeA,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"acknowledgements.d.ts","sourceRoot":"","sources":["../../../src/components/ui/acknowledgements.tsx"],"names":[],"mappings":"AAeA,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,sCAuBrE"}
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useFrontmatter, useReferences } from '@myst-theme/providers';
|
|
3
3
|
import { copyNode } from 'myst-common';
|
|
4
4
|
import { MyST, HashLink } from 'myst-to-react';
|
|
5
|
-
import { cn } from '../../lib/utils';
|
|
6
|
-
import { extractKnownParts } from '../../lib/knownParts';
|
|
7
|
-
import { PART_IDS } from './types';
|
|
5
|
+
import { cn } from '../../lib/utils.js';
|
|
6
|
+
import { extractKnownParts } from '../../lib/knownParts.js';
|
|
7
|
+
import { PART_IDS } from './types.js';
|
|
8
8
|
function useAcknowledgements() {
|
|
9
9
|
const frontmatter = useFrontmatter();
|
|
10
10
|
const references = useReferences();
|
|
@@ -16,5 +16,5 @@ export function Acknowledgements({ className }) {
|
|
|
16
16
|
const acknowledgements = useAcknowledgements();
|
|
17
17
|
if (!acknowledgements)
|
|
18
18
|
return null;
|
|
19
|
-
return (_jsxs("section", { id: PART_IDS.acknowledgements, className: cn('min-w-full prose dark:prose-invert prose-sm', className), children: [_jsxs("header", { className: "text-lg font-semibold text-stone-900 dark:text-white group", children: ["Acknowledgements", _jsx(HashLink, { id: PART_IDS.acknowledgements, title: "Link to Acknowledgements", hover: true, className: "ml-2" })] }), _jsx("div", { className: cn('pl-3 mb-8 text-sm text-stone-500 dark:text-stone-300'), children: _jsx(MyST, { ast: acknowledgements }) })] }));
|
|
19
|
+
return (_jsxs("section", { id: PART_IDS.acknowledgements, className: cn('min-w-full prose dark:prose-invert prose-sm font-small', className), children: [_jsxs("header", { className: "text-lg font-semibold text-stone-900 dark:text-white group", children: ["Acknowledgements", _jsx(HashLink, { id: PART_IDS.acknowledgements, title: "Link to Acknowledgements", hover: true, className: "ml-2" })] }), _jsx("div", { className: cn('pl-3 mb-8 text-sm text-stone-500 dark:text-stone-300'), children: _jsx(MyST, { ast: acknowledgements }) })] }));
|
|
20
20
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { LinkProps } from 'react-router';
|
|
3
|
-
export declare function Arrow():
|
|
4
|
-
export declare function LongArrowIcon({ className, ...props }: React.SVGProps<SVGSVGElement>):
|
|
5
|
-
export declare function ArrowLink({ children, className, ...props }: LinkProps):
|
|
3
|
+
export declare function Arrow(): React.JSX.Element;
|
|
4
|
+
export declare function LongArrowIcon({ className, ...props }: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
5
|
+
export declare function ArrowLink({ children, className, ...props }: LinkProps): React.JSX.Element | null;
|
|
6
6
|
//# sourceMappingURL=arrow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../src/components/ui/arrow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,wBAAgB,KAAK,
|
|
1
|
+
{"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../src/components/ui/arrow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,wBAAgB,KAAK,sBASpB;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,qBAiBnF;AAED,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,4BAerE"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { FileText } from 'lucide-react';
|
|
1
2
|
import type { SiteAction, SiteExport } from 'myst-config';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { type AnalyticsCaptureFn } from '../providers/index.js';
|
|
2
5
|
/**
|
|
3
6
|
* triggerDirectDownload - aims to trigger a direct download for the
|
|
4
7
|
*
|
|
@@ -17,10 +20,28 @@ export declare function triggerDirectDownload(url: string, filename?: string): P
|
|
|
17
20
|
export declare function triggerBlobDownload(blob: Blob, filename?: string): Promise<any>;
|
|
18
21
|
export declare function useDownloads(): {
|
|
19
22
|
projectExports: SiteExport[];
|
|
20
|
-
projectDownloads: SiteAction[];
|
|
23
|
+
projectDownloads: (SiteAction | SiteExport)[];
|
|
21
24
|
articleExports: SiteExport[];
|
|
22
25
|
articleDownloads: SiteAction[];
|
|
23
26
|
};
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
type DownloadEventContext = {
|
|
28
|
+
category: 'download' | 'export';
|
|
29
|
+
scope: 'project' | 'article';
|
|
30
|
+
surface: string;
|
|
31
|
+
};
|
|
32
|
+
export declare function handleDownload(download: SiteAction | SiteExport, capture: AnalyticsCaptureFn, ctx: DownloadEventContext): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* getExtension - lowercased extension of a file name or path, without the leading dot
|
|
35
|
+
*
|
|
36
|
+
* Compound extensions (e.g. `tar.gz`) are returned in full. A leading dot marks a
|
|
37
|
+
* hidden file rather than an extension, so `.gitignore` has no extension.
|
|
38
|
+
*
|
|
39
|
+
* @param filename - file name, path or url pathname
|
|
40
|
+
* @returns the extension, or undefined if there is none
|
|
41
|
+
*/
|
|
42
|
+
export declare function getExtension(filename?: string): string | undefined;
|
|
43
|
+
export declare function getIconForFormat(format?: string, filename?: string): typeof FileText;
|
|
44
|
+
export declare function ArticleDownloadItems(): React.JSX.Element | null;
|
|
45
|
+
export declare function ArticleExportItems(): React.JSX.Element | null;
|
|
46
|
+
export {};
|
|
26
47
|
//# sourceMappingURL=article-actions-downloads.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article-actions-downloads.d.ts","sourceRoot":"","sources":["../../../src/components/ui/article-actions-downloads.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"article-actions-downloads.d.ts","sourceRoot":"","sources":["../../../src/components/ui/article-actions-downloads.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,QAAQ,EAUT,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAA2B,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEzF;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,gBAKzE;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,gBA0BtE;AAsCD,wBAAgB,YAAY,IAAI;IAC9B,cAAc,EAAE,UAAU,EAAE,CAAC;IAC7B,gBAAgB,EAAE,CAAC,UAAU,GAAG,UAAU,CAAC,EAAE,CAAC;IAC9C,cAAc,EAAE,UAAU,EAAE,CAAC;IAC7B,gBAAgB,EAAE,UAAU,EAAE,CAAC;CAChC,CAaA;AAED,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,UAAU,GAAG,QAAQ,CAAC;IAChC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAeF,wBAAsB,cAAc,CAClC,QAAQ,EAAE,UAAU,GAAG,UAAU,EACjC,OAAO,EAAE,kBAAkB,EAC3B,GAAG,EAAE,oBAAoB,iBAmB1B;AA+BD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASlE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,QAAQ,CAWpF;AAyDD,wBAAgB,oBAAoB,6BA8CnC;AAED,wBAAgB,kBAAkB,6BAgDjC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { DropdownMenuItem, DropdownMenuSeparator, DropdownMenuLabel } from '.';
|
|
2
|
+
import { DropdownMenuItem, DropdownMenuSeparator, DropdownMenuLabel } from './index.js';
|
|
3
3
|
import { useFrontmatter, useProjectManifest, useSiteManifest } from '@myst-theme/providers';
|
|
4
4
|
import { toast } from 'sonner';
|
|
5
|
-
import { File, FileText, FileCode, FileArchive, ScrollText, FileVolume } from 'lucide-react';
|
|
5
|
+
import { File, FileText, FileCode, FileArchive, ScrollText, FileVolume, FileSpreadsheet, Presentation, FileVideo, FileCode2, FileBox, } from 'lucide-react';
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import { BibTeXCitationMenuItem, useShowCitation } from './citation';
|
|
8
|
-
import { useAnalytics, useDesign } from '../providers';
|
|
7
|
+
import { BibTeXCitationMenuItem, useShowCitation } from './citation.js';
|
|
8
|
+
import { useAnalytics, useDesign } from '../providers/index.js';
|
|
9
9
|
/**
|
|
10
10
|
* triggerDirectDownload - aims to trigger a direct download for the
|
|
11
11
|
*
|
|
@@ -106,7 +106,7 @@ function buildDownloadAnalyticsProps(download, ctx) {
|
|
|
106
106
|
downloadTitle: download.title,
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
async function handleDownload(download, capture, ctx) {
|
|
109
|
+
export async function handleDownload(download, capture, ctx) {
|
|
110
110
|
const baseProps = buildDownloadAnalyticsProps(download, ctx);
|
|
111
111
|
capture('article_download', { action: 'clicked', ...baseProps });
|
|
112
112
|
toast.success(_jsxs(_Fragment, { children: ["Download starting... ", _jsx("br", {}), _jsx("code", { children: download.filename })] }));
|
|
@@ -124,26 +124,68 @@ const formatIconMap = {
|
|
|
124
124
|
pdf: FileText,
|
|
125
125
|
xml: FileCode,
|
|
126
126
|
jats: FileCode,
|
|
127
|
-
meca:
|
|
128
|
-
omex:
|
|
127
|
+
meca: FileBox,
|
|
128
|
+
omex: FileBox,
|
|
129
|
+
zip: FileArchive,
|
|
130
|
+
'tar.gz': FileArchive,
|
|
129
131
|
tex: ScrollText,
|
|
130
132
|
typst: ScrollText,
|
|
131
133
|
mp3: FileVolume,
|
|
134
|
+
mp4: FileVideo,
|
|
135
|
+
avi: FileVideo,
|
|
136
|
+
mov: FileVideo,
|
|
137
|
+
csv: FileSpreadsheet,
|
|
138
|
+
xlsx: FileSpreadsheet,
|
|
139
|
+
xls: FileSpreadsheet,
|
|
140
|
+
pptx: Presentation,
|
|
141
|
+
ppt: Presentation,
|
|
142
|
+
key: Presentation,
|
|
143
|
+
py: FileCode2,
|
|
144
|
+
r: FileCode2,
|
|
145
|
+
html: FileCode2,
|
|
146
|
+
ipynb: FileCode2,
|
|
132
147
|
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
148
|
+
/** Multi-part extensions that should be returned whole, rather than as their final segment */
|
|
149
|
+
const COMPOUND_EXTENSIONS = ['tar.gz', 'tar.bz2', 'tar.xz', 'tar.zst', 'tar.lz4'];
|
|
150
|
+
/**
|
|
151
|
+
* getExtension - lowercased extension of a file name or path, without the leading dot
|
|
152
|
+
*
|
|
153
|
+
* Compound extensions (e.g. `tar.gz`) are returned in full. A leading dot marks a
|
|
154
|
+
* hidden file rather than an extension, so `.gitignore` has no extension.
|
|
155
|
+
*
|
|
156
|
+
* @param filename - file name, path or url pathname
|
|
157
|
+
* @returns the extension, or undefined if there is none
|
|
158
|
+
*/
|
|
159
|
+
export function getExtension(filename) {
|
|
160
|
+
if (!filename)
|
|
161
|
+
return undefined;
|
|
162
|
+
const base = filename.split(/[\\/]/).pop()?.replace(/^\.+/, '').toLowerCase();
|
|
163
|
+
if (!base)
|
|
164
|
+
return undefined;
|
|
165
|
+
const compound = COMPOUND_EXTENSIONS.find((ext) => base.endsWith(`.${ext}`));
|
|
166
|
+
if (compound)
|
|
167
|
+
return compound;
|
|
168
|
+
const lastDot = base.lastIndexOf('.');
|
|
169
|
+
if (lastDot < 1)
|
|
170
|
+
return undefined;
|
|
171
|
+
return base.slice(lastDot + 1) || undefined;
|
|
172
|
+
}
|
|
173
|
+
export function getIconForFormat(format, filename) {
|
|
174
|
+
if (format) {
|
|
175
|
+
const lowerFormat = format.toLowerCase();
|
|
176
|
+
for (const [key, icon] of Object.entries(formatIconMap)) {
|
|
177
|
+
if (lowerFormat.includes(key)) {
|
|
178
|
+
return icon;
|
|
179
|
+
}
|
|
138
180
|
}
|
|
139
181
|
}
|
|
140
|
-
|
|
182
|
+
const extension = getExtension(filename);
|
|
183
|
+
return (extension && formatIconMap[extension]) || File;
|
|
141
184
|
}
|
|
142
185
|
function formatFromUrl(url) {
|
|
143
186
|
try {
|
|
144
187
|
const urlObj = new URL(url);
|
|
145
|
-
const
|
|
146
|
-
const format = pathname.split('.').pop()?.toLowerCase();
|
|
188
|
+
const format = getExtension(urlObj.pathname);
|
|
147
189
|
if (format && format.length <= 6) {
|
|
148
190
|
return format;
|
|
149
191
|
}
|
|
@@ -157,7 +199,7 @@ function renderDownloadItems(downloads, capture, ctx, options = {}) {
|
|
|
157
199
|
return downloads.map((download, index) => {
|
|
158
200
|
const format = download.format || formatFromUrl(download.url) || 'unknown';
|
|
159
201
|
const downloadName = download.title || getFormatDisplayName(format);
|
|
160
|
-
const icon = getIconForFormat(format);
|
|
202
|
+
const icon = getIconForFormat(format, download.filename);
|
|
161
203
|
if (options.linkMode) {
|
|
162
204
|
return (_jsx(DropdownMenuItem, { asChild: true, children: _jsxs("a", { href: download.url, download: download.filename, target: "_blank", rel: "noopener noreferrer", onClick: () => capture('article_download', {
|
|
163
205
|
action: 'clicked',
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
export declare function ArticleActionsDropdown({ children, onOpenChange, }: {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
onOpenChange?: (open: boolean) => void;
|
|
5
|
-
}):
|
|
5
|
+
}): React.JSX.Element;
|
|
6
6
|
//# sourceMappingURL=article-actions-dropdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article-actions-dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/ui/article-actions-dropdown.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuF1B,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,YAAY,GACb,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,
|
|
1
|
+
{"version":3,"file":"article-actions-dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/ui/article-actions-dropdown.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuF1B,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,YAAY,GACb,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,qBA4TA"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, Badge, } from '.';
|
|
3
|
-
import { Citation } from './citation';
|
|
2
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, Badge, } from './index.js';
|
|
3
|
+
import { Citation } from './citation.js';
|
|
4
4
|
import { useFrontmatter, useProjectManifest } from '@myst-theme/providers';
|
|
5
5
|
import { toast } from 'sonner';
|
|
6
6
|
import { doi } from 'doi-utils';
|
|
7
7
|
import { Download, Quote, Copy, Pencil, Clock, BlocksIcon, Share, Sun, Moon, Monitor, FolderCode, FileText, Scale, } from 'lucide-react';
|
|
8
|
-
import { ArticleDownloadItems, ArticleExportItems, useDownloads, triggerDirectDownload, } from './article-actions-downloads';
|
|
8
|
+
import { ArticleDownloadItems, ArticleExportItems, useDownloads, triggerDirectDownload, } from './article-actions-downloads.js';
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import { ArticleActionsShare, useVisibleShareOptions } from './article-actions-share';
|
|
10
|
+
import { ArticleActionsShare, useVisibleShareOptions } from './article-actions-share.js';
|
|
11
11
|
import { useTheme } from 'next-themes';
|
|
12
|
-
import { useAnalytics, useDesign } from '../providers';
|
|
13
|
-
import { useArticleVersions } from '../providers/article-versions-provider';
|
|
14
|
-
import { HashLink } from './hash-link';
|
|
15
|
-
import { PART_IDS } from './types';
|
|
12
|
+
import { useAnalytics, useDesign } from '../providers/index.js';
|
|
13
|
+
import { useArticleVersions } from '../providers/article-versions-provider.js';
|
|
14
|
+
import { HashLink } from './hash-link.js';
|
|
15
|
+
import { PART_IDS } from './types.js';
|
|
16
16
|
function formatDate(dateStr) {
|
|
17
17
|
return new Date(dateStr).toLocaleDateString('en-US', {
|
|
18
18
|
month: 'short',
|
|
@@ -107,7 +107,7 @@ export function ArticleActionsDropdown({ children, onOpenChange, }) {
|
|
|
107
107
|
article?.license ||
|
|
108
108
|
article?.open_access ||
|
|
109
109
|
article?.copyright);
|
|
110
|
-
return (_jsxs(DropdownMenu, { onOpenChange: onOpenChange, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: children }), _jsxs(DropdownMenuContent, { className: "w-56", align: "end", children: [_jsx(DropdownMenuLabel, { children: "Article Actions" }), _jsx(DropdownMenuSeparator, {}), hasSinglePdfDownload && singlePdfDownload ? (link_downloads ? (_jsx(DropdownMenuItem, { asChild: true, children: _jsxs("a", { href: singlePdfDownload.url, download: singlePdfDownload.filename, target: "_blank", rel: "noopener noreferrer", onClick: () => capture('article_download', {
|
|
110
|
+
return (_jsxs(DropdownMenu, { onOpenChange: onOpenChange, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: children }), _jsxs(DropdownMenuContent, { className: "w-56 font-ui", align: "end", children: [_jsx(DropdownMenuLabel, { children: "Article Actions" }), _jsx(DropdownMenuSeparator, {}), hasSinglePdfDownload && singlePdfDownload ? (link_downloads ? (_jsx(DropdownMenuItem, { asChild: true, children: _jsxs("a", { href: singlePdfDownload.url, download: singlePdfDownload.filename, target: "_blank", rel: "noopener noreferrer", onClick: () => capture('article_download', {
|
|
111
111
|
action: 'clicked',
|
|
112
112
|
category: 'download',
|
|
113
113
|
format: 'pdf',
|
|
@@ -18,6 +18,6 @@ export declare function useVisibleShareOptions(): {
|
|
|
18
18
|
export declare function ArticleActionsShare({ url, title }: {
|
|
19
19
|
url?: string;
|
|
20
20
|
title: string;
|
|
21
|
-
}):
|
|
21
|
+
}): React.JSX.Element;
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=article-actions-share.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article-actions-share.d.ts","sourceRoot":"","sources":["../../../src/components/ui/article-actions-share.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAavD,KAAK,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,GAAG,GAAG,OAAO,CAAC;AAoE1E;;;;GAIG;AACH,wBAAgB,sBAAsB;UAtE9B,MAAM;iBACC,gBAAgB;aACpB,MAAM,aAAa;UACtB,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;YACzC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM;IAsE/C;AAED,wBAAgB,mBAAmB,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"article-actions-share.d.ts","sourceRoot":"","sources":["../../../src/components/ui/article-actions-share.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAavD,KAAK,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,GAAG,GAAG,OAAO,CAAC;AAoE1E;;;;GAIG;AACH,wBAAgB,sBAAsB;UAtE9B,MAAM;iBACC,gBAAgB;aACpB,MAAM,aAAa;UACtB,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;YACzC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM;IAsE/C;AAED,wBAAgB,mBAAmB,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,qBAqClF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import { DropdownMenuItem } from '.';
|
|
3
|
+
import { DropdownMenuItem } from './index.js';
|
|
4
4
|
import { BlueskyIcon,
|
|
5
5
|
// RedditIcon,
|
|
6
6
|
// FacebookIcon,
|
|
7
7
|
LinkedinIcon, XIcon, EmailIcon, SembleIcon, } from '@scienceicons/react/24/solid';
|
|
8
|
-
import { useAnalytics, useDesign } from '../providers';
|
|
8
|
+
import { useAnalytics, useDesign } from '../providers/index.js';
|
|
9
9
|
const SHARE_OPTIONS = [
|
|
10
10
|
{
|
|
11
11
|
name: 'Bluesky',
|