myst-to-react 0.1.22 → 0.1.23

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.
@@ -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,KAAmB,MAAM,OAAO,CAAC;AACxC,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;AAEF,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,eAgDA;AAED,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAoB5D,CAAC;AAEF,QAAA,MAAM,oBAAoB;;;CAGzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
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"}
@@ -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 -translate-y-[1px]';
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
- const [open, setOpen] = (0, react_1.useState)(false);
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)("p", Object.assign({ className: (0, classnames_1.default)('admonition-header m-0 text-lg font-medium py-1', {
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
- }), onClick: dropdown ? () => setOpen(!open) : undefined }, { children: [(0, jsx_runtime_1.jsx)(AdmonitionIcon, { kind: kind !== null && kind !== void 0 ? kind : AdmonitionKind.note }), (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-neutral-900 dark:text-white" }, { children: [dropdown && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "block float-right font-thin text-sm text-neutral-700 dark:text-neutral-200" }, { children: [!open && 'Click to show', (0, jsx_runtime_1.jsx)(solid_1.ChevronRightIcon, { className: (0, classnames_1.default)(iconClass, 'transition-transform', {
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) => {
@@ -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,eAkClD"}
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,9 +18,7 @@ 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', suppressHydrationWarning: true, 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
- // This is hidden if on the server or no clipboard access
23
- 'sr-only hidden': typeof document === 'undefined' || !navigator.clipboard,
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', {
24
22
  'text-primary-500 border-primary-500': !copied,
25
23
  'text-success border-success ': 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]" })) })));
@@ -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":"AACA,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;AAqCF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,YAAY,CAOtD,CAAC;AAEF,QAAA,MAAM,kBAAkB;;;CAGvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
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"}
@@ -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 bg-gray-50 dark:bg-stone-800" }, { children: children }))] })));
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));
@@ -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/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; } });
@@ -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,KAAmB,MAAM,OAAO,CAAC;AACxC,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;AAEF,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,eAgDA;AAED,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAoB5D,CAAC;AAEF,QAAA,MAAM,oBAAoB;;;CAGzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
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":"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,eAkClD"}
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"}
@@ -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":"AACA,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;AAqCF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,YAAY,CAOtD,CAAC;AAEF,QAAA,MAAM,kBAAkB;;;CAGvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
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"}
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myst-to-react",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
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.22",
20
+ "@myst-theme/providers": "^0.1.23",
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.7",
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",