@myst-theme/site 0.9.0 → 0.9.2

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.9.0",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -17,19 +17,19 @@
17
17
  "dependencies": {
18
18
  "@headlessui/react": "^1.7.15",
19
19
  "@heroicons/react": "^2.0.18",
20
- "@myst-theme/common": "^0.9.0",
21
- "@myst-theme/diagrams": "^0.9.0",
22
- "@myst-theme/frontmatter": "^0.9.0",
23
- "@myst-theme/jupyter": "^0.9.0",
24
- "@myst-theme/providers": "^0.9.0",
20
+ "@myst-theme/common": "^0.9.2",
21
+ "@myst-theme/diagrams": "^0.9.2",
22
+ "@myst-theme/frontmatter": "^0.9.2",
23
+ "@myst-theme/jupyter": "^0.9.2",
24
+ "@myst-theme/providers": "^0.9.2",
25
25
  "@radix-ui/react-collapsible": "^1.0.3",
26
26
  "classnames": "^2.3.2",
27
27
  "lodash.throttle": "^4.1.1",
28
- "myst-common": "^1.3.0",
29
- "myst-config": "^1.3.0",
30
- "myst-demo": "^0.9.0",
31
- "myst-spec-ext": "^1.3.0",
32
- "myst-to-react": "^0.9.0",
28
+ "myst-common": "^1.4.0",
29
+ "myst-config": "^1.4.0",
30
+ "myst-demo": "^0.9.2",
31
+ "myst-spec-ext": "^1.4.0",
32
+ "myst-to-react": "^0.9.2",
33
33
  "nbtx": "^0.2.3",
34
34
  "node-cache": "^5.1.2",
35
35
  "node-fetch": "^2.6.11",
@@ -143,7 +143,10 @@ const NestedToc = ({ heading }: { heading: NestedHeading }) => {
143
143
  onClick={() => setOpen(heading.path ? true : !open)}
144
144
  />
145
145
  <Collapsible.Trigger asChild>
146
- <button className="self-center flex-none rounded-md group hover:bg-slate-300/30 focus:outline outline-blue-200 outline-2">
146
+ <button
147
+ className="self-center flex-none rounded-md group hover:bg-slate-300/30 focus:outline outline-blue-200 outline-2"
148
+ aria-label="Open Folder"
149
+ >
147
150
  <ChevronRightIcon
148
151
  className="transition-transform duration-300 group-data-[state=open]:rotate-90 text-text-slate-700 dark:text-slate-100"
149
152
  height="1.5rem"
package/src/index.ts CHANGED
@@ -3,3 +3,4 @@ export * from './loaders/index.js';
3
3
  export * from './components/index.js';
4
4
  export * from './pages/index.js';
5
5
  export * from './seo/index.js';
6
+ export * from './themeCSS.js';
@@ -0,0 +1,33 @@
1
+ export type ThemeCssOptions = {
2
+ numbered_references?: boolean;
3
+ };
4
+
5
+ type MystThemeVariables = {
6
+ 'cite-group-open'?: '(' | '[' | string;
7
+ 'cite-group-close'?: ')' | ']' | string;
8
+ };
9
+
10
+ function variables(vars: MystThemeVariables) {
11
+ const css = Object.entries(vars)
12
+ .map(([name, value]) => `--${name}: '${value}';`)
13
+ .join('\n ');
14
+ if (!css) return '';
15
+ return `:root {\n ${css}}`;
16
+ }
17
+
18
+ export function themeCSS(options?: ThemeCssOptions) {
19
+ const numbered_references = !!options?.numbered_references;
20
+ const citationCss = numbered_references
21
+ ? { 'cite-group-open': '[', 'cite-group-close': ']' }
22
+ : {};
23
+ return variables({ ...citationCss });
24
+ }
25
+
26
+ export function cssResponse(css: string): Response {
27
+ return new Response(css, {
28
+ headers: {
29
+ 'Content-Type': 'text/css',
30
+ 'Cache-Control': 'no-cache',
31
+ },
32
+ });
33
+ }