@myst-theme/site 1.0.1 → 1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myst-theme/site",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -25,11 +25,11 @@
25
25
  "dependencies": {
26
26
  "@headlessui/react": "^1.7.15",
27
27
  "@heroicons/react": "^2.0.18",
28
- "@myst-theme/common": "^1.0.1",
29
- "@myst-theme/diagrams": "^1.0.1",
30
- "@myst-theme/frontmatter": "^1.0.1",
31
- "@myst-theme/providers": "^1.0.1",
32
- "@myst-theme/search": "^1.0.1",
28
+ "@myst-theme/common": "^1.1.0",
29
+ "@myst-theme/diagrams": "^1.1.0",
30
+ "@myst-theme/frontmatter": "^1.1.0",
31
+ "@myst-theme/providers": "^1.1.0",
32
+ "@myst-theme/search": "^1.1.0",
33
33
  "@radix-ui/react-collapsible": "^1.0.3",
34
34
  "@radix-ui/react-dialog": "^1.0.3",
35
35
  "@radix-ui/react-visually-hidden": "^1.1.0",
@@ -37,9 +37,9 @@
37
37
  "lodash.throttle": "^4.1.1",
38
38
  "myst-common": "^1.8.1",
39
39
  "myst-config": "^1.7.9",
40
- "myst-demo": "^1.0.1",
40
+ "myst-demo": "^1.1.0",
41
41
  "myst-spec-ext": "^1.8.1",
42
- "myst-to-react": "^1.0.1",
42
+ "myst-to-react": "^1.1.0",
43
43
  "nbtx": "^0.2.3",
44
44
  "node-cache": "^5.1.2",
45
45
  "node-fetch": "^2.6.11",
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { useLinkProvider, useNavLinkProvider } from '@myst-theme/providers';
2
+ import { isExternalUrl, useLinkProvider, useNavLinkProvider } from '@myst-theme/providers';
3
3
 
4
4
  export function ExternalOrInternalLink({
5
5
  to,
@@ -19,7 +19,7 @@ export function ExternalOrInternalLink({
19
19
  const Link = useLinkProvider();
20
20
  const NavLink = useNavLinkProvider();
21
21
  const staticClass = typeof className === 'function' ? className({ isActive: false }) : className;
22
- if (to.startsWith('http') || to.startsWith('mailto:')) {
22
+ if (isExternalUrl(to)) {
23
23
  return (
24
24
  <a
25
25
  href={to}
@@ -172,7 +172,7 @@ const NestedToc = ({ heading }: { heading: NestedHeading }) => {
172
172
  <Collapsible.Root className="w-full" open={open} onOpenChange={setOpen}>
173
173
  <div
174
174
  className={classNames(
175
- 'myst-toc-item flex flex-row w-full gap-2 px-2 my-1 text-left rounded-lg outline-none',
175
+ 'myst-toc-item flex flex-row w-full gap-2 pl-2 my-1 text-left rounded-lg outline-none',
176
176
  {
177
177
  'myst-toc-item-exact bg-blue-300/30': exact,
178
178
  'hover:bg-slate-300/30': !exact,
@@ -189,7 +189,7 @@ const NestedToc = ({ heading }: { heading: NestedHeading }) => {
189
189
  />
190
190
  <Collapsible.Trigger asChild>
191
191
  <button
192
- className="self-center flex-none rounded-md group hover:bg-slate-300/30 focus:outline outline-blue-200 outline-2"
192
+ className="self-stretch flex items-center flex-none px-1 rounded-l-md group hover:bg-slate-300/30 focus-visible:outline outline-blue-200 outline-2"
193
193
  aria-label="Open Folder"
194
194
  >
195
195
  <ChevronRightIcon