@myst-theme/site 0.2.5 → 0.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myst-theme/site",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "main": "./src/index.ts",
5
5
  "types": "./src/index.ts",
6
6
  "files": [
@@ -16,16 +16,16 @@
16
16
  "dependencies": {
17
17
  "@headlessui/react": "^1.7.13",
18
18
  "@heroicons/react": "^2.0.14",
19
- "@myst-theme/diagrams": "^0.2.5",
20
- "@myst-theme/frontmatter": "^0.2.5",
21
- "@myst-theme/jupyter": "^0.2.5",
22
- "@myst-theme/providers": "^0.2.5",
19
+ "@myst-theme/diagrams": "^0.2.6",
20
+ "@myst-theme/frontmatter": "^0.2.6",
21
+ "@myst-theme/jupyter": "^0.2.6",
22
+ "@myst-theme/providers": "^0.2.6",
23
23
  "classnames": "^2.3.2",
24
24
  "lodash.throttle": "^4.1.1",
25
25
  "myst-common": "^0.0.16",
26
26
  "myst-config": "^0.0.14",
27
- "myst-demo": "^0.2.5",
28
- "myst-to-react": "^0.2.5",
27
+ "myst-demo": "^0.2.6",
28
+ "myst-to-react": "^0.2.6",
29
29
  "nbtx": "^0.2.3",
30
30
  "node-cache": "^5.1.2",
31
31
  "node-fetch": "^2.6.7",
@@ -28,7 +28,7 @@ function Block({
28
28
  }) {
29
29
  const renderers = useNodeRenderers() ?? DEFAULT_RENDERERS;
30
30
  const children = useParse(node, renderers);
31
- const subGrid = 'article-grid article-subgrid-gap col-screen';
31
+ const subGrid = 'article-grid article-subgrid-gap col-screen mb-10';
32
32
  const dataClassName = typeof node.data?.class === 'string' ? node.data?.class : undefined;
33
33
  // Hide the subgrid if either the dataClass or the className exists and includes `col-`
34
34
  const noSubGrid =
@@ -109,7 +109,7 @@ const Headings = ({ folder, headings, sections }: Props) => {
109
109
  );
110
110
  };
111
111
 
112
- export function useTocHeight<T extends HTMLElement = HTMLElement>(top?: number) {
112
+ export function useTocHeight<T extends HTMLElement = HTMLElement>(top = 0, inset = 0) {
113
113
  const container = useRef<T>(null);
114
114
  const toc = useRef<HTMLDivElement>(null);
115
115
  const transitionState = useNavigation().state;
@@ -117,8 +117,7 @@ export function useTocHeight<T extends HTMLElement = HTMLElement>(top?: number)
117
117
  if (!container.current || !toc.current) return;
118
118
  const height = container.current.offsetHeight - window.scrollY;
119
119
  const div = toc.current.firstChild as HTMLDivElement;
120
- const MAGIC_PADDING = 16; // I dunno, just go with it ...
121
- if (div) div.style.height = `min(calc(100vh - ${top ?? 0}px), ${height + MAGIC_PADDING}px)`;
120
+ if (div) div.style.height = `min(calc(100vh - ${top}px), ${height + inset}px)`;
122
121
  const nav = toc.current.querySelector('nav');
123
122
  if (nav) nav.style.opacity = height > 150 ? '1' : '0';
124
123
  };