myst-to-react 0.1.22 → 0.1.24
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/cjs/admonitions.d.ts.map +1 -1
- package/dist/cjs/admonitions.js +14 -8
- package/dist/cjs/basic.d.ts.map +1 -1
- package/dist/cjs/basic.js +6 -2
- package/dist/cjs/components/CopyIcon.d.ts.map +1 -1
- package/dist/cjs/components/CopyIcon.js +3 -5
- package/dist/cjs/dropdown.d.ts +6 -0
- package/dist/cjs/dropdown.d.ts.map +1 -1
- package/dist/cjs/dropdown.js +3 -2
- package/dist/cjs/heading.d.ts +5 -2
- package/dist/cjs/heading.d.ts.map +1 -1
- package/dist/cjs/heading.js +8 -6
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/math.d.ts.map +1 -1
- package/dist/cjs/math.js +1 -1
- package/dist/types/admonitions.d.ts.map +1 -1
- package/dist/types/basic.d.ts.map +1 -1
- package/dist/types/components/CopyIcon.d.ts.map +1 -1
- package/dist/types/dropdown.d.ts +6 -0
- package/dist/types/dropdown.d.ts.map +1 -1
- package/dist/types/heading.d.ts +5 -2
- package/dist/types/heading.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/math.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admonitions.d.ts","sourceRoot":"","sources":["../../src/admonitions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"admonitions.d.ts","sourceRoot":"","sources":["../../src/admonitions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAoB1D,oBAAY,cAAc;IACxB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,OAAO,YAAY;CACpB;AAED,KAAK,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAuEjD,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,IAAI,CAAC,eAAe,CAE9D,CAAC;AA4BF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,eA4CA;AAED,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAoB5D,CAAC;AAEF,QAAA,MAAM,oBAAoB;;;CAGzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
package/dist/cjs/admonitions.js
CHANGED
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AdmonitionRenderer = exports.Admonition = exports.AdmonitionTitle = exports.AdmonitionKind = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
8
|
const outline_1 = require("@heroicons/react/24/outline");
|
|
10
9
|
const solid_1 = require("@heroicons/react/24/solid");
|
|
11
10
|
const classnames_1 = __importDefault(require("classnames"));
|
|
@@ -63,7 +62,7 @@ function getFirstKind({ kind, classes = [], }) {
|
|
|
63
62
|
}
|
|
64
63
|
return { kind: AdmonitionKind.note, color: 'blue' };
|
|
65
64
|
}
|
|
66
|
-
const iconClass = 'h-8 w-8 inline-block pl-2 mr-2 -
|
|
65
|
+
const iconClass = 'h-8 w-8 inline-block pl-2 mr-2 self-center flex-none';
|
|
67
66
|
function AdmonitionIcon({ kind }) {
|
|
68
67
|
if (kind === AdmonitionKind.note)
|
|
69
68
|
return (0, jsx_runtime_1.jsx)(outline_1.InformationCircleIcon, { className: iconClass });
|
|
@@ -91,22 +90,29 @@ const AdmonitionTitle = (node, children) => {
|
|
|
91
90
|
return children;
|
|
92
91
|
};
|
|
93
92
|
exports.AdmonitionTitle = AdmonitionTitle;
|
|
93
|
+
const WrapperElement = ({ dropdown, className, children, }) => {
|
|
94
|
+
if (dropdown)
|
|
95
|
+
return (0, jsx_runtime_1.jsx)("details", Object.assign({ className: className }, { children: children }));
|
|
96
|
+
return (0, jsx_runtime_1.jsx)("aside", Object.assign({ className: className }, { children: children }));
|
|
97
|
+
};
|
|
98
|
+
const HeaderElement = ({ dropdown, className, children, }) => {
|
|
99
|
+
if (dropdown)
|
|
100
|
+
return (0, jsx_runtime_1.jsx)("summary", Object.assign({ className: className }, { children: children }));
|
|
101
|
+
return (0, jsx_runtime_1.jsx)("div", Object.assign({ className: className }, { children: children }));
|
|
102
|
+
};
|
|
94
103
|
function Admonition({ title, kind, color, dropdown, children, }) {
|
|
95
|
-
|
|
96
|
-
return ((0, jsx_runtime_1.jsxs)("aside", Object.assign({ className: (0, classnames_1.default)('admonition rounded-md my-4 border-l-4 shadow-md dark:shadow-2xl dark:shadow-neutral-900', {
|
|
104
|
+
return ((0, jsx_runtime_1.jsxs)(WrapperElement, Object.assign({ dropdown: dropdown, className: (0, classnames_1.default)('admonition rounded-md my-4 border-l-4 shadow-md dark:shadow-2xl dark:shadow-neutral-900', 'bg-gray-50 dark:bg-stone-800', 'overflow-hidden', {
|
|
97
105
|
'border-blue-500': !color || color === 'blue',
|
|
98
106
|
'border-green-600': color === 'green',
|
|
99
107
|
'border-amber-600': color === 'yellow',
|
|
100
108
|
'border-red-600': color === 'red',
|
|
101
|
-
}) }, { children: [title && ((0, jsx_runtime_1.jsxs)(
|
|
109
|
+
}) }, { children: [title && ((0, jsx_runtime_1.jsxs)(HeaderElement, Object.assign({ dropdown: dropdown, className: (0, classnames_1.default)('admonition-header m-0 text-lg font-medium py-1 flex min-w-0', {
|
|
102
110
|
'text-blue-600 bg-blue-50 dark:bg-slate-900': !color || color === 'blue',
|
|
103
111
|
'text-green-600 bg-green-50 dark:bg-slate-900': color === 'green',
|
|
104
112
|
'text-amber-600 bg-amber-50 dark:bg-slate-900': color === 'yellow',
|
|
105
113
|
'text-red-600 bg-red-50 dark:bg-slate-900': color === 'red',
|
|
106
114
|
'cursor-pointer hover:shadow-[inset_0_0_0px_20px_#00000003] dark:hover:shadow-[inset_0_0_0px_20px_#FFFFFF03]': dropdown,
|
|
107
|
-
})
|
|
108
|
-
'rotate-90 -translate-y-[5px]': open,
|
|
109
|
-
}) })] }))), title] }))] }))), (!dropdown || open) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "px-4 py-1 bg-gray-50 dark:bg-stone-800" }, { children: children })))] })));
|
|
115
|
+
}) }, { children: [(0, jsx_runtime_1.jsx)(AdmonitionIcon, { kind: kind !== null && kind !== void 0 ? kind : AdmonitionKind.note }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-neutral-900 dark:text-white grow self-center overflow-hidden break-words" }, { children: title })), dropdown && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "font-thin text-sm text-neutral-700 dark:text-neutral-200 self-center flex-none" }, { children: (0, jsx_runtime_1.jsx)(solid_1.ChevronRightIcon, { className: (0, classnames_1.default)(iconClass, 'transition-transform details-toggle') }) })))] }))), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "px-4 py-1 details-body" }, { children: children }))] })));
|
|
110
116
|
}
|
|
111
117
|
exports.Admonition = Admonition;
|
|
112
118
|
const AdmonitionRenderer = (node, children) => {
|
package/dist/cjs/basic.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../src/basic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../src/basic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,KAAK,SAAS,GAAG;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,gBAAgB,CAAC;CACxB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,gBAAgB,CAAC;CACxB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,uBAAuB,CAAC;CAC/B,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxC,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1C,aAAa,EAAE,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAChD,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxC,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5C,YAAY,EAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAE9C,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAEpD,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpC,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAExC,aAAa,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;IAC3C,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC7B,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACnC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAEnC,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7C,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7C,qBAAqB,EAAE,YAAY,CAAC,qBAAqB,CAAC,CAAC;CAC5D,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,kBA2JtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/cjs/basic.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
7
|
const heading_1 = require("./heading");
|
|
8
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
5
9
|
const BASIC_RENDERERS = {
|
|
6
10
|
delete(node, children) {
|
|
7
11
|
return (0, jsx_runtime_1.jsx)("del", { children: children }, node.key);
|
|
@@ -43,7 +47,7 @@ const BASIC_RENDERERS = {
|
|
|
43
47
|
return (0, jsx_runtime_1.jsx)("li", { children: children }, node.key);
|
|
44
48
|
},
|
|
45
49
|
container(node, children) {
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)("figure", Object.assign({ id: node.html_id || node.identifier || node.key, className: node.kind }, { children: children }), node.key));
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)("figure", Object.assign({ id: node.html_id || node.identifier || node.key, className: (0, classnames_1.default)(node.kind, node.class) }, { children: children }), node.key));
|
|
47
51
|
},
|
|
48
52
|
caption(node, children) {
|
|
49
53
|
return ((0, jsx_runtime_1.jsx)("figcaption", Object.assign({ className: "group" }, { children: children }), node.key));
|
|
@@ -63,7 +67,7 @@ const BASIC_RENDERERS = {
|
|
|
63
67
|
}
|
|
64
68
|
const label = typeof children === 'string' ? backwardsCompatibleLabel(children, node.kind) : children;
|
|
65
69
|
const id = node.html_id || node.identifier || node.key;
|
|
66
|
-
return ((0, jsx_runtime_1.
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(heading_1.HashLink, Object.assign({ id: id, kind: node.kind, className: "mr-1 text-inherit font-semibold" }, { children: label }), node.key));
|
|
67
71
|
},
|
|
68
72
|
table(node, children) {
|
|
69
73
|
// TODO: actually render the tbody on the server if it isn't included here.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyIcon.d.ts","sourceRoot":"","sources":["../../../src/components/CopyIcon.tsx"],"names":[],"mappings":";AAIA,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"CopyIcon.d.ts","sourceRoot":"","sources":["../../../src/components/CopyIcon.tsx"],"names":[],"mappings":";AAIA,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,eA+BlD"}
|
|
@@ -18,11 +18,9 @@ function CopyIcon({ text }) {
|
|
|
18
18
|
setTimeout(() => setCopied(false), 3000);
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)("button", Object.assign({ title: copied ? 'Copied!!' : 'Copy to Clipboard',
|
|
22
|
-
|
|
23
|
-
'
|
|
24
|
-
'text-primary-500 border-primary-500': !copied,
|
|
25
|
-
'text-success border-success ': copied,
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)("button", Object.assign({ title: copied ? 'Copied!!' : 'Copy to Clipboard', className: (0, classnames_1.default)('inline-flex items-center opacity-60 hover:opacity-100 active:opacity-40 cursor-pointer ml-2', 'transition-color duration-200 ease-in-out', {
|
|
22
|
+
'text-blue-500 border-blue-500': !copied,
|
|
23
|
+
'text-green-500 border-green-500 ': copied,
|
|
26
24
|
}), onClick: onClick, "aria-pressed": copied ? 'true' : 'false', "aria-label": "Copy code to clipboard" }, { children: copied ? ((0, jsx_runtime_1.jsx)(outline_1.CheckIcon, { className: "w-[24px] h-[24px] text-success" })) : ((0, jsx_runtime_1.jsx)(outline_1.DocumentDuplicateIcon, { className: "w-[24px] h-[24px]" })) })));
|
|
27
25
|
}
|
|
28
26
|
exports.CopyIcon = CopyIcon;
|
package/dist/cjs/dropdown.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { NodeRenderer } from '@myst-theme/providers';
|
|
2
3
|
type DropdownSpec = {
|
|
3
4
|
type: 'details';
|
|
@@ -7,6 +8,11 @@ type SummarySpec = {
|
|
|
7
8
|
type: 'summary';
|
|
8
9
|
};
|
|
9
10
|
export declare const SummaryTitle: NodeRenderer<SummarySpec>;
|
|
11
|
+
export declare function Details({ title, children, open, }: {
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
open?: boolean;
|
|
15
|
+
}): JSX.Element;
|
|
10
16
|
export declare const DetailsRenderer: NodeRenderer<DropdownSpec>;
|
|
11
17
|
declare const DROPDOWN_RENDERERS: {
|
|
12
18
|
details: NodeRenderer<DropdownSpec>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/dropdown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AACF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAElD,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,IAAI,GACL,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,eA4BA;AAED,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,YAAY,CAOtD,CAAC;AAEF,QAAA,MAAM,kBAAkB;;;CAGvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
package/dist/cjs/dropdown.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DetailsRenderer = exports.SummaryTitle = void 0;
|
|
6
|
+
exports.DetailsRenderer = exports.Details = exports.SummaryTitle = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const solid_1 = require("@heroicons/react/24/solid");
|
|
9
9
|
const classnames_1 = __importDefault(require("classnames"));
|
|
@@ -13,8 +13,9 @@ const SummaryTitle = (node, children) => {
|
|
|
13
13
|
};
|
|
14
14
|
exports.SummaryTitle = SummaryTitle;
|
|
15
15
|
function Details({ title, children, open, }) {
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)("details", Object.assign({ className: (0, classnames_1.default)('rounded-md my-4 shadow dark:shadow-2xl dark:shadow-neutral-900 overflow-hidden'), open: open }, { children: [(0, jsx_runtime_1.jsx)("summary", Object.assign({ className: (0, classnames_1.default)('m-0 text-lg font-medium py-1 min-h-[2em] pl-3', 'cursor-pointer hover:shadow-[inset_0_0_0px_20px_#00000003] dark:hover:shadow-[inset_0_0_0px_20px_#FFFFFF03]', 'bg-gray-100 dark:bg-slate-900') }, { children: (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-neutral-900 dark:text-white" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "block float-right font-thin text-sm text-neutral-700 dark:text-neutral-200" }, { children: (0, jsx_runtime_1.jsx)(solid_1.ChevronRightIcon, { className: (0, classnames_1.default)(iconClass, 'transition-transform') }) })), title] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "px-4 py-1
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)("details", Object.assign({ className: (0, classnames_1.default)('rounded-md my-4 shadow dark:shadow-2xl dark:shadow-neutral-900 overflow-hidden', 'bg-gray-50 dark:bg-stone-800'), open: open }, { children: [(0, jsx_runtime_1.jsx)("summary", Object.assign({ className: (0, classnames_1.default)('m-0 text-lg font-medium py-1 min-h-[2em] pl-3', 'cursor-pointer hover:shadow-[inset_0_0_0px_20px_#00000003] dark:hover:shadow-[inset_0_0_0px_20px_#FFFFFF03]', 'bg-gray-100 dark:bg-slate-900') }, { children: (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-neutral-900 dark:text-white" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "block float-right font-thin text-sm text-neutral-700 dark:text-neutral-200" }, { children: (0, jsx_runtime_1.jsx)(solid_1.ChevronRightIcon, { className: (0, classnames_1.default)(iconClass, 'details-toggle', 'transition-transform') }) })), title] })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "px-4 py-1 details-body" }, { children: children }))] })));
|
|
17
17
|
}
|
|
18
|
+
exports.Details = Details;
|
|
18
19
|
const DetailsRenderer = (node, children) => {
|
|
19
20
|
const [title, ...rest] = children;
|
|
20
21
|
return ((0, jsx_runtime_1.jsx)(Details, Object.assign({ title: title, open: node.open }, { children: rest }), node.key));
|
package/dist/cjs/heading.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Heading } from 'myst-spec';
|
|
3
3
|
import type { NodeRenderer } from '@myst-theme/providers';
|
|
4
|
-
export declare function HashLink({ id, kind, align, }: {
|
|
4
|
+
export declare function HashLink({ id, kind, align, children, hover, className, }: {
|
|
5
5
|
id: string;
|
|
6
6
|
kind: string;
|
|
7
|
-
|
|
7
|
+
hover?: boolean;
|
|
8
|
+
align?: 'inline' | 'left' | 'right';
|
|
9
|
+
children?: '#' | '¶' | React.ReactNode;
|
|
10
|
+
className?: string;
|
|
8
11
|
}): JSX.Element | null;
|
|
9
12
|
declare const Heading: NodeRenderer<Heading>;
|
|
10
13
|
declare const HEADING_RENDERERS: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/heading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAS1D,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/heading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAS1D,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,IAAI,EACJ,KAAgB,EAChB,QAAc,EACd,KAAK,EACL,SAAyB,GAC1B,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAoBA;AAED,QAAA,MAAM,OAAO,EAAE,YAAY,CAAC,OAAO,CAoBlC,CAAC;AAEF,QAAA,MAAM,iBAAiB;;CAEtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
package/dist/cjs/heading.js
CHANGED
|
@@ -11,22 +11,24 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
11
11
|
function getHelpHashText(kind) {
|
|
12
12
|
return `Link to this ${kind}`;
|
|
13
13
|
}
|
|
14
|
-
function HashLink({ id, kind, align = '
|
|
14
|
+
function HashLink({ id, kind, align = 'inline', children = '#', hover, className = 'font-normal', }) {
|
|
15
15
|
const { inCrossRef } = (0, providers_1.useXRefState)();
|
|
16
16
|
// If we are in a cross-reference popout, hide the hash links
|
|
17
17
|
if (inCrossRef)
|
|
18
18
|
return null;
|
|
19
19
|
const helpText = getHelpHashText(kind);
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ className: (0, classnames_1.default)('select-none
|
|
21
|
-
'left-0 -translate-x-[100%] pr-3': align === 'left',
|
|
22
|
-
'right-0 translate-x-[100%] pl-3': align === 'right',
|
|
23
|
-
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ className: (0, classnames_1.default)('select-none no-underline', className, {
|
|
21
|
+
'absolute top-0 left-0 -translate-x-[100%] pr-3': align === 'left',
|
|
22
|
+
'absolute top-0 right-0 translate-x-[100%] pl-3': align === 'right',
|
|
23
|
+
'transition-opacity opacity-0 group-hover:opacity-70': hover,
|
|
24
|
+
'hover:underline': !hover,
|
|
25
|
+
}), href: `#${id}`, title: helpText, "aria-label": helpText }, { children: children })));
|
|
24
26
|
}
|
|
25
27
|
exports.HashLink = HashLink;
|
|
26
28
|
const Heading = (node, children) => {
|
|
27
29
|
const { enumerator, depth, key, identifier, html_id } = node;
|
|
28
30
|
const id = html_id || identifier || key;
|
|
29
|
-
const textContent = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(
|
|
31
|
+
const textContent = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [enumerator && (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "select-none mr-3" }, { children: enumerator })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "heading-text" }, { children: children })), (0, jsx_runtime_1.jsx)(HashLink, { id: id, align: "inline", kind: "Section", className: "px-2 font-normal", hover: true })] }));
|
|
30
32
|
// The `heading-text` class is picked up in the Outline to select without the enumerator and "#" link
|
|
31
33
|
return (0, react_1.createElement)(`h${depth}`, {
|
|
32
34
|
key: node.key,
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { GenericParent } from 'myst-common';
|
|
|
4
4
|
export { CopyIcon } from './components/CopyIcon';
|
|
5
5
|
export { CodeBlock } from './code';
|
|
6
6
|
export { Admonition, AdmonitionKind } from './admonitions';
|
|
7
|
+
export { Details } from './dropdown';
|
|
7
8
|
export { TabSet, TabItem } from './tabs';
|
|
8
9
|
export declare const DEFAULT_RENDERERS: Record<string, NodeRenderer>;
|
|
9
10
|
export declare function useParse(node: GenericParent | null, renderers?: Record<string, NodeRenderer>): import("react").ReactNode;
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoBjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEzC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAkB1D,CAAC;AAEF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,aAAa,GAAG,IAAI,EAC1B,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAqB,6BAU5D"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoBjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEzC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAkB1D,CAAC;AAEF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,aAAa,GAAG,IAAI,EAC1B,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAqB,6BAU5D"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useParse = exports.DEFAULT_RENDERERS = exports.TabItem = exports.TabSet = exports.AdmonitionKind = exports.Admonition = exports.CodeBlock = exports.CopyIcon = void 0;
|
|
6
|
+
exports.useParse = exports.DEFAULT_RENDERERS = exports.TabItem = exports.TabSet = exports.Details = exports.AdmonitionKind = exports.Admonition = exports.CodeBlock = exports.CopyIcon = void 0;
|
|
7
7
|
const convertToReact_1 = require("./convertToReact");
|
|
8
8
|
const basic_1 = __importDefault(require("./basic"));
|
|
9
9
|
const admonitions_1 = __importDefault(require("./admonitions"));
|
|
@@ -29,6 +29,8 @@ Object.defineProperty(exports, "CodeBlock", { enumerable: true, get: function ()
|
|
|
29
29
|
var admonitions_2 = require("./admonitions");
|
|
30
30
|
Object.defineProperty(exports, "Admonition", { enumerable: true, get: function () { return admonitions_2.Admonition; } });
|
|
31
31
|
Object.defineProperty(exports, "AdmonitionKind", { enumerable: true, get: function () { return admonitions_2.AdmonitionKind; } });
|
|
32
|
+
var dropdown_2 = require("./dropdown");
|
|
33
|
+
Object.defineProperty(exports, "Details", { enumerable: true, get: function () { return dropdown_2.Details; } });
|
|
32
34
|
var tabs_2 = require("./tabs");
|
|
33
35
|
Object.defineProperty(exports, "TabSet", { enumerable: true, get: function () { return tabs_2.TabSet; } });
|
|
34
36
|
Object.defineProperty(exports, "TabItem", { enumerable: true, get: function () { return tabs_2.TabItem; } });
|
package/dist/cjs/math.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/math.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AA2B1D,KAAK,QAAQ,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/math.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AA2B1D,KAAK,QAAQ,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAwCF,QAAA,MAAM,cAAc;;;CAGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/dist/cjs/math.js
CHANGED
|
@@ -14,7 +14,7 @@ const mathRenderer = (node) => {
|
|
|
14
14
|
return ((0, jsx_runtime_1.jsxs)("pre", Object.assign({ title: node.message }, { children: [(0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-red-500" }, { children: [(0, jsx_runtime_1.jsx)(outline_1.ExclamationCircleIcon, { className: "inline h-[1em] mr-1" }), node.message, '\n\n'] })), node.value] }), node.key));
|
|
15
15
|
}
|
|
16
16
|
const id = node.html_id || node.identifier || node.key;
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ id: id, className: (0, classnames_1.default)('flex group') }, { children: [(0, jsx_runtime_1.jsx)("div", { dangerouslySetInnerHTML: { __html: node.html }, className: "overflow-x-auto flex-grow" }), node.enumerator && ((0, jsx_runtime_1.
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ id: id, className: (0, classnames_1.default)('flex group') }, { children: [(0, jsx_runtime_1.jsx)("div", { dangerouslySetInnerHTML: { __html: node.html }, className: "overflow-x-auto flex-grow" }), node.enumerator && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex-none text-right m-0 pl-2 self-center relative select-none" }, { children: (0, jsx_runtime_1.jsxs)(heading_1.HashLink, Object.assign({ id: id, align: "inline", kind: "Equation" }, { children: ["(", node.enumerator, ")"] })) })))] }), node.key));
|
|
18
18
|
}
|
|
19
19
|
if (node.error || !node.html) {
|
|
20
20
|
return (0, jsx_runtime_1.jsx)(inlineError_1.InlineError, { value: node.value, message: node.message }, node.key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admonitions.d.ts","sourceRoot":"","sources":["../../src/admonitions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"admonitions.d.ts","sourceRoot":"","sources":["../../src/admonitions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAoB1D,oBAAY,cAAc;IACxB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,OAAO,YAAY;CACpB;AAED,KAAK,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAuEjD,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,IAAI,CAAC,eAAe,CAE9D,CAAC;AA4BF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,eA4CA;AAED,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAoB5D,CAAC;AAEF,QAAA,MAAM,oBAAoB;;;CAGzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../src/basic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../src/basic.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyIcon.d.ts","sourceRoot":"","sources":["../../../src/components/CopyIcon.tsx"],"names":[],"mappings":";AAIA,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"CopyIcon.d.ts","sourceRoot":"","sources":["../../../src/components/CopyIcon.tsx"],"names":[],"mappings":";AAIA,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,eA+BlD"}
|
package/dist/types/dropdown.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { NodeRenderer } from '@myst-theme/providers';
|
|
2
3
|
type DropdownSpec = {
|
|
3
4
|
type: 'details';
|
|
@@ -7,6 +8,11 @@ type SummarySpec = {
|
|
|
7
8
|
type: 'summary';
|
|
8
9
|
};
|
|
9
10
|
export declare const SummaryTitle: NodeRenderer<SummarySpec>;
|
|
11
|
+
export declare function Details({ title, children, open, }: {
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
open?: boolean;
|
|
15
|
+
}): JSX.Element;
|
|
10
16
|
export declare const DetailsRenderer: NodeRenderer<DropdownSpec>;
|
|
11
17
|
declare const DROPDOWN_RENDERERS: {
|
|
12
18
|
details: NodeRenderer<DropdownSpec>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/dropdown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AACF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAElD,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,IAAI,GACL,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,eA4BA;AAED,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,YAAY,CAOtD,CAAC;AAEF,QAAA,MAAM,kBAAkB;;;CAGvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
package/dist/types/heading.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Heading } from 'myst-spec';
|
|
3
3
|
import type { NodeRenderer } from '@myst-theme/providers';
|
|
4
|
-
export declare function HashLink({ id, kind, align, }: {
|
|
4
|
+
export declare function HashLink({ id, kind, align, children, hover, className, }: {
|
|
5
5
|
id: string;
|
|
6
6
|
kind: string;
|
|
7
|
-
|
|
7
|
+
hover?: boolean;
|
|
8
|
+
align?: 'inline' | 'left' | 'right';
|
|
9
|
+
children?: '#' | '¶' | React.ReactNode;
|
|
10
|
+
className?: string;
|
|
8
11
|
}): JSX.Element | null;
|
|
9
12
|
declare const Heading: NodeRenderer<Heading>;
|
|
10
13
|
declare const HEADING_RENDERERS: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/heading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAS1D,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/heading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAS1D,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,IAAI,EACJ,KAAgB,EAChB,QAAc,EACd,KAAK,EACL,SAAyB,GAC1B,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAoBA;AAED,QAAA,MAAM,OAAO,EAAE,YAAY,CAAC,OAAO,CAoBlC,CAAC;AAEF,QAAA,MAAM,iBAAiB;;CAEtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { GenericParent } from 'myst-common';
|
|
|
4
4
|
export { CopyIcon } from './components/CopyIcon';
|
|
5
5
|
export { CodeBlock } from './code';
|
|
6
6
|
export { Admonition, AdmonitionKind } from './admonitions';
|
|
7
|
+
export { Details } from './dropdown';
|
|
7
8
|
export { TabSet, TabItem } from './tabs';
|
|
8
9
|
export declare const DEFAULT_RENDERERS: Record<string, NodeRenderer>;
|
|
9
10
|
export declare function useParse(node: GenericParent | null, renderers?: Record<string, NodeRenderer>): import("react").ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoBjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEzC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAkB1D,CAAC;AAEF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,aAAa,GAAG,IAAI,EAC1B,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAqB,6BAU5D"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoBjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEzC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAkB1D,CAAC;AAEF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,aAAa,GAAG,IAAI,EAC1B,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAqB,6BAU5D"}
|
package/dist/types/math.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/math.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AA2B1D,KAAK,QAAQ,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/math.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AA2B1D,KAAK,QAAQ,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAwCF,QAAA,MAAM,cAAc;;;CAGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "myst-to-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"types": "dist/types/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"build": "npm-run-all -l clean -p build:cjs build:types"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@myst-theme/providers": "^0.1.
|
|
20
|
+
"@myst-theme/providers": "^0.1.24",
|
|
21
21
|
"@headlessui/react": "^1.7.7",
|
|
22
22
|
"@heroicons/react": "^2.0.13",
|
|
23
23
|
"@popperjs/core": "^2.11.6",
|
|
24
24
|
"buffer": "^6.0.3",
|
|
25
25
|
"classnames": "^2.3.2",
|
|
26
26
|
"myst-common": "^0.0.12",
|
|
27
|
-
"myst-config": "^0.0.
|
|
27
|
+
"myst-config": "^0.0.9",
|
|
28
28
|
"myst-spec": "^0.0.4",
|
|
29
29
|
"nanoid": "^4.0.0",
|
|
30
30
|
"react-popper": "^2.3.0",
|