@myst-theme/landing-pages 0.0.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/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # @myst-theme/landing-pages
2
+
3
+ [![myst-demo on npm](https://img.shields.io/npm/v/@myst-theme/landing-pages.svg)](https://www.npmjs.com/package/@myst-theme/landing-pages)
4
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/curvenote/curvenote/blob/main/LICENSE)
5
+
6
+ A set of landing-page components for MyST
@@ -0,0 +1,10 @@
1
+ import type { GenericParent } from 'myst-common';
2
+ import React from 'react';
3
+ export declare function BlockHeading({ node, className }: {
4
+ node: GenericParent;
5
+ className?: string;
6
+ }): React.ReactElement<{
7
+ className: string;
8
+ id: any;
9
+ }, string | React.JSXElementConstructor<any>>;
10
+ //# sourceMappingURL=BlockHeading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockHeading.d.ts","sourceRoot":"","sources":["../src/BlockHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;;;8CAkB5F"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { MyST, HashLink } from 'myst-to-react';
3
+ import classNames from 'classnames';
4
+ import { createElement as e } from 'react';
5
+ export function BlockHeading({ node, className }) {
6
+ const { enumerator, depth, key, identifier, html_id } = node;
7
+ const id = html_id || identifier || key;
8
+ return e(`h${depth}`, {
9
+ className: classNames(node.class, className, 'group'),
10
+ id: id,
11
+ }, _jsxs(_Fragment, { children: [enumerator && _jsx("span", { className: "mr-3 select-none", children: enumerator }), _jsx("span", { className: "heading-text", children: _jsx(MyST, { ast: node.children }) }), _jsx(HashLink, { id: id, kind: "Section", className: "px-2 font-normal", hover: true, hideInPopup: true })] }));
12
+ }
@@ -0,0 +1,6 @@
1
+ import type { NodeRenderers } from '@myst-theme/providers';
2
+ import { type LandingBlockProps } from './LandingBlock.js';
3
+ export declare function CenteredBlock(props: Omit<LandingBlockProps, 'children'>): import("react/jsx-runtime").JSX.Element;
4
+ declare const CENTERED_RENDERERS: NodeRenderers;
5
+ export default CENTERED_RENDERERS;
6
+ //# sourceMappingURL=CenteredBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CenteredBlock.d.ts","sourceRoot":"","sources":["../src/CenteredBlock.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK3D,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,2CAuDvE;AAED,QAAA,MAAM,kBAAkB,EAAE,aAIzB,CAAC;AACF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { MyST } from 'myst-to-react';
4
+ import { select, selectAll, matches } from 'unist-util-select';
5
+ import { filter } from 'unist-util-filter';
6
+ import { InvalidBlock } from './InvalidBlock.js';
7
+ import { BlockHeading } from './BlockHeading.js';
8
+ import { splitByHeader } from './utils.js';
9
+ import { LandingBlock } from './LandingBlock.js';
10
+ export function CenteredBlock(props) {
11
+ const { node } = props;
12
+ const { body, links, subtitle, heading } = useMemo(() => {
13
+ var _a, _b;
14
+ const { head, body: rawBody } = splitByHeader(node);
15
+ const linksNode = selectAll('link[class*=button], crossReference[class*=button]', rawBody);
16
+ const subtitleNode = select('paragraph', head);
17
+ const headingNode = select('heading', head);
18
+ const bodyNodes = (_b = (_a = filter(rawBody, (otherNode) => !matches('link[class*=button], crossReference[class*=button]', otherNode))) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];
19
+ return {
20
+ body: bodyNodes,
21
+ links: linksNode,
22
+ subtitle: subtitleNode,
23
+ heading: headingNode,
24
+ };
25
+ }, [node]);
26
+ if (!body) {
27
+ return _jsx(InvalidBlock, Object.assign({}, props, { blockName: "centered" }));
28
+ }
29
+ return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsx("div", { className: "relative text-center", children: _jsxs("div", { className: "py-20 sm:py-28", children: [subtitle && (_jsx("p", { className: "font-semibold text-indigo-400 uppercase my-0", children: _jsx(MyST, { ast: subtitle.children }) })), heading && (_jsx(BlockHeading, { node: heading, className: "text-5xl font-semibold tracking-tight mt-2 mb-0" })), body && (_jsx("div", { className: "mt-6", children: _jsx(MyST, { ast: body }) })), links && (_jsx("div", { className: "mt-8 flex gap-4 items-center justify-center", children: _jsx(MyST, { ast: links }) }))] }) }) })));
30
+ }
31
+ const CENTERED_RENDERERS = {
32
+ block: {
33
+ 'block[kind=centered]': CenteredBlock,
34
+ },
35
+ };
36
+ export default CENTERED_RENDERERS;
@@ -0,0 +1,5 @@
1
+ import { type LandingBlockProps } from './LandingBlock.js';
2
+ export declare function InvalidBlock(props: Omit<LandingBlockProps, 'children'> & {
3
+ blockName: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=InvalidBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvalidBlock.d.ts","sourceRoot":"","sources":["../src/InvalidBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,2CAoB9F"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { MyST } from 'myst-to-react';
3
+ import { LandingBlock } from './LandingBlock.js';
4
+ export function InvalidBlock(props) {
5
+ const { node, blockName } = props;
6
+ return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "relative", role: "alert", children: [_jsxs("div", { className: "bg-red-500 text-white font-bold rounded-t px-4 py-2", children: ["Invalid block ", _jsx("span", { className: "font-mono", children: blockName })] }), _jsxs("div", { className: "border border-t-0 border-red-400 rounded-b ", children: [_jsx("div", { className: "bg-red-100 text-red-700 px-4 py-3", children: _jsxs("p", { children: ["This '", blockName, "' block does not conform to the expected AST structure."] }) }), _jsx("div", { className: "px-4 py-3", children: _jsx(MyST, { ast: node.children }) })] })] }) })));
7
+ }
@@ -0,0 +1,6 @@
1
+ import type { NodeRenderers } from '@myst-theme/providers';
2
+ import { type LandingBlockProps } from './LandingBlock.js';
3
+ export declare function JustifiedBlock(props: Omit<LandingBlockProps, 'children'>): import("react/jsx-runtime").JSX.Element;
4
+ declare const JUSTIFIED_RENDERERS: NodeRenderers;
5
+ export default JUSTIFIED_RENDERERS;
6
+ //# sourceMappingURL=JustifiedBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JustifiedBlock.d.ts","sourceRoot":"","sources":["../src/JustifiedBlock.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK3D,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,2CA4DxE;AAED,QAAA,MAAM,mBAAmB,EAAE,aAI1B,CAAC;AACF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { MyST } from 'myst-to-react';
4
+ import { select, selectAll, matches } from 'unist-util-select';
5
+ import { filter } from 'unist-util-filter';
6
+ import { InvalidBlock } from './InvalidBlock.js';
7
+ import { BlockHeading } from './BlockHeading.js';
8
+ import { splitByHeader } from './utils.js';
9
+ import { LandingBlock } from './LandingBlock.js';
10
+ export function JustifiedBlock(props) {
11
+ const { node } = props;
12
+ const { body, links, subtitle, heading } = useMemo(() => {
13
+ var _a, _b;
14
+ const { head, body: rawBody } = splitByHeader(node);
15
+ const linksNode = selectAll('link[class*=button], crossReference[class*=button]', rawBody);
16
+ const subtitleNode = select('paragraph', head);
17
+ const headingNode = select('heading', head);
18
+ const bodyNodes = (_b = (_a = filter(rawBody, (otherNode) => !matches('link[class*=button], crossReference[class*=button]', otherNode))) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];
19
+ return {
20
+ body: bodyNodes,
21
+ links: linksNode,
22
+ subtitle: subtitleNode,
23
+ heading: headingNode,
24
+ };
25
+ }, [node]);
26
+ if (!body) {
27
+ return _jsx(InvalidBlock, Object.assign({}, props, { blockName: "justified" }));
28
+ }
29
+ return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "py-20 sm:py-28 lg:px-8", children: [subtitle && (_jsx("p", { className: "font-semibold text-indigo-400 uppercase my-0", children: _jsx(MyST, { ast: subtitle.children }) })), _jsxs("div", { className: "flex flex-col lg:content-center lg:justify-between lg:flex-row", children: [_jsxs("div", { className: "flex flex-col", children: [heading && (_jsx(BlockHeading, { node: heading, className: "text-5xl font-semibold tracking-tight mt-2 mb-0" })), body && (_jsx("div", { className: "mt-6", children: _jsx(MyST, { ast: body }) }))] }), _jsx("div", { className: "flex flex-col mt-8 lg:mt-0", children: links && (_jsx("div", { className: "flex flex-row gap-4 items-center", children: _jsx(MyST, { ast: links }) })) })] })] }) })));
30
+ }
31
+ const JUSTIFIED_RENDERERS = {
32
+ block: {
33
+ 'block[kind=justified]': JustifiedBlock,
34
+ },
35
+ };
36
+ export default JUSTIFIED_RENDERERS;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { GenericParent } from 'myst-common';
3
+ export type LandingBlockProps = {
4
+ node: GenericParent;
5
+ className?: string;
6
+ children: React.ReactNode;
7
+ };
8
+ export declare function LandingBlock({ node, className, children }: LandingBlockProps): import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=LandingBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LandingBlock.d.ts","sourceRoot":"","sources":["../src/LandingBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAsB5E"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useGridSystemProvider } from '@myst-theme/providers';
3
+ import classNames from 'classnames';
4
+ export function LandingBlock({ node, className, children }) {
5
+ var _a, _b;
6
+ const grid = useGridSystemProvider();
7
+ const { key } = node;
8
+ const subGrid = node.visibility === 'hide' ? '' : `${grid} subgrid-gap col-page [&>*]:col-page`;
9
+ const dataClassName = typeof ((_a = node.data) === null || _a === void 0 ? void 0 : _a.class) === 'string' ? (_b = node.data) === null || _b === void 0 ? void 0 : _b.class : undefined;
10
+ // Hide the subgrid if either the dataClass or the className exists and includes `col-`
11
+ const noSubGrid = (dataClassName && dataClassName.includes('col-')) || (className && className.includes('col-'));
12
+ return (_jsx("div", { id: key, className: classNames('relative group/block py-6', className, dataClassName, {
13
+ [subGrid]: !noSubGrid,
14
+ hidden: node.visibility === 'remove',
15
+ }), children: children }, `block-${key}`));
16
+ }
@@ -0,0 +1,6 @@
1
+ import type { NodeRenderers } from '@myst-theme/providers';
2
+ import { type LandingBlockProps } from './LandingBlock.js';
3
+ export declare function LogoCloudBlock(props: Omit<LandingBlockProps, 'children'>): import("react/jsx-runtime").JSX.Element;
4
+ declare const LOGO_CLOUD_RENDERERS: NodeRenderers;
5
+ export default LOGO_CLOUD_RENDERERS;
6
+ //# sourceMappingURL=LogoCloudBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogoCloudBlock.d.ts","sourceRoot":"","sources":["../src/LogoCloudBlock.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAM3D,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,2CAwCxE;AAED,QAAA,MAAM,oBAAoB,EAAE,aAI3B,CAAC;AACF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { MyST } from 'myst-to-react';
4
+ import { select, selectAll, matches } from 'unist-util-select';
5
+ import { filter } from 'unist-util-filter';
6
+ import { InvalidBlock } from './InvalidBlock.js';
7
+ import { LandingBlock } from './LandingBlock.js';
8
+ export function LogoCloudBlock(props) {
9
+ const { node } = props;
10
+ const { grid, body, links } = useMemo(() => {
11
+ var _a, _b;
12
+ const gridNode = select('grid', node);
13
+ const rawBodyNode = filter(node, (child) => child.type !== 'grid');
14
+ const linksNode = selectAll('link[class*=button], crossReference[class*=button]', rawBodyNode);
15
+ const bodyNodes = (_b = (_a = filter(rawBodyNode, (otherNode) => !matches('link[class*=button], crossReference[class*=button]', otherNode))) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];
16
+ return {
17
+ body: bodyNodes,
18
+ grid: gridNode,
19
+ links: linksNode,
20
+ };
21
+ }, [node]);
22
+ if (!grid) {
23
+ return _jsx(InvalidBlock, Object.assign({}, props, { blockName: "logo-cloud" }));
24
+ }
25
+ return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "text-center py-20 sm:py-28", children: [_jsx("div", { className: "font-semibold", children: _jsx(MyST, { ast: body }) }), grid && _jsx(MyST, { ast: grid }), links && (_jsx("div", { className: "mt-8 flex gap-4 items-center justify-center", children: _jsx(MyST, { ast: links }) }))] }) })));
26
+ }
27
+ const LOGO_CLOUD_RENDERERS = {
28
+ block: {
29
+ 'block[kind=logo-cloud]': LogoCloudBlock,
30
+ },
31
+ };
32
+ export default LOGO_CLOUD_RENDERERS;
@@ -0,0 +1,6 @@
1
+ import type { NodeRenderers } from '@myst-theme/providers';
2
+ import { type LandingBlockProps } from './LandingBlock.js';
3
+ export declare function SplitImageBlock(props: Omit<LandingBlockProps, 'children'>): import("react/jsx-runtime").JSX.Element;
4
+ declare const SPLIT_IMAGE_RENDERERS: NodeRenderers;
5
+ export default SPLIT_IMAGE_RENDERERS;
6
+ //# sourceMappingURL=SplitImageBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SplitImageBlock.d.ts","sourceRoot":"","sources":["../src/SplitImageBlock.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK3D,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,2CA6DzE;AAED,QAAA,MAAM,qBAAqB,EAAE,aAI5B,CAAC;AACF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { MyST } from 'myst-to-react';
4
+ import { select, selectAll, matches } from 'unist-util-select';
5
+ import { filter } from 'unist-util-filter';
6
+ import { InvalidBlock } from './InvalidBlock.js';
7
+ import { BlockHeading } from './BlockHeading.js';
8
+ import { splitByHeader } from './utils.js';
9
+ import { LandingBlock } from './LandingBlock.js';
10
+ export function SplitImageBlock(props) {
11
+ const { node } = props;
12
+ const { image, body, links, subtitle, heading } = useMemo(() => {
13
+ var _a, _b;
14
+ const { head, body: rawBody } = splitByHeader(node);
15
+ const linksNode = selectAll('link,crossReference', rawBody);
16
+ const subtitleNode = select('paragraph', head);
17
+ const headingNode = select('heading', head);
18
+ const imageNode = select('image', rawBody);
19
+ const bodyNodes = (_b = (_a = filter(rawBody, (otherNode) => !matches('link[class*=button], crossReference[class*=button], image', otherNode))) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];
20
+ return {
21
+ body: bodyNodes,
22
+ image: imageNode,
23
+ links: linksNode,
24
+ subtitle: subtitleNode,
25
+ heading: headingNode,
26
+ };
27
+ }, [node]);
28
+ if (!image || !body) {
29
+ return _jsx(InvalidBlock, Object.assign({}, props, { blockName: "split-image" }));
30
+ }
31
+ return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "relative bg-stone-900 dark:bg-stone-800 rounded-md", children: [_jsx("div", { className: "lg:absolute lg:h-full lg:w-[calc(50%)] md:absolute md:h-full md:w-[calc(100%/3)] h-80 relative [&_img]:h-full [&_img]:w-full [&_img]:object-cover [&_img]:m-0 [&_picture]:m-0 [&_picture]:inline", children: _jsx(MyST, { ast: image }) }), _jsx("div", { className: "relative py-24", children: _jsxs("div", { className: "lg:ml-auto lg:w-[calc(50%)] lg:p-8 lg:pl-24 md:ml-auto md:w-[calc(2*100%/3)] md:pl-16 md:p-8 px-6", children: [subtitle && (_jsx("p", { className: " prose prose-invert font-semibold text-indigo-400 uppercase my-0", children: _jsx(MyST, { ast: subtitle.children }) })), heading && (_jsx(BlockHeading, { node: heading, className: "text-white text-5xl font-semibold tracking-tight mt-2 mb-0" })), _jsx("div", { className: "mt-6", children: _jsx(MyST, { ast: body, className: "prose prose-invert" }) }), links && (_jsx("div", { className: "mt-8 flex gap-4 items-center", children: _jsx(MyST, { ast: links, className: "prose prose-invert" }) }))] }) })] }) })));
32
+ }
33
+ const SPLIT_IMAGE_RENDERERS = {
34
+ block: {
35
+ 'block[kind=split-image]': SplitImageBlock,
36
+ },
37
+ };
38
+ export default SPLIT_IMAGE_RENDERERS;
@@ -0,0 +1,5 @@
1
+ import { type LandingBlockProps } from './LandingBlock.js';
2
+ export declare function UnknownBlock(props: Omit<LandingBlockProps, 'children'> & {
3
+ blockName: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=UnknownBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnknownBlock.d.ts","sourceRoot":"","sources":["../src/UnknownBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,2CAc9F"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { MyST } from 'myst-to-react';
3
+ import { LandingBlock } from './LandingBlock.js';
4
+ export function UnknownBlock(props) {
5
+ const { node, blockName } = props;
6
+ return (_jsx(LandingBlock, Object.assign({}, props, { children: _jsxs("div", { className: "relative", role: "alert", children: [_jsxs("div", { className: "bg-red-500 text-white font-bold rounded-t px-4 py-2", children: ["Unknown block ", _jsx("span", { className: "font-mono", children: blockName })] }), _jsx("div", { className: "border border-t-0 border-red-400 rounded-b px-4 py-3", children: _jsx(MyST, { ast: node }) })] }) })));
7
+ }
@@ -0,0 +1,8 @@
1
+ import type { NodeRenderers } from '@myst-theme/providers';
2
+ export * from './SplitImageBlock.js';
3
+ export * from './CenteredBlock.js';
4
+ export * from './JustifiedBlock.js';
5
+ export * from './LogoCloudBlock.js';
6
+ declare const BLOCK_RENDERERS: NodeRenderers;
7
+ export default BLOCK_RENDERERS;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAO3D,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AAEpC,QAAA,MAAM,eAAe,EAAE,aAKrB,CAAC;AACH,eAAe,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ import SPLIT_IMAGE_RENDERERS from './SplitImageBlock.js';
2
+ import CENTERED_RENDERERS from './CenteredBlock.js';
3
+ import JUSTIFIED_RENDERERS from './JustifiedBlock.js';
4
+ import LOGO_CLOUD_RENDERERS from './LogoCloudBlock.js';
5
+ import { mergeRenderers } from '@myst-theme/providers';
6
+ export * from './SplitImageBlock.js';
7
+ export * from './CenteredBlock.js';
8
+ export * from './JustifiedBlock.js';
9
+ export * from './LogoCloudBlock.js';
10
+ const BLOCK_RENDERERS = mergeRenderers([
11
+ SPLIT_IMAGE_RENDERERS,
12
+ CENTERED_RENDERERS,
13
+ JUSTIFIED_RENDERERS,
14
+ LOGO_CLOUD_RENDERERS,
15
+ ]);
16
+ export default BLOCK_RENDERERS;
@@ -0,0 +1,6 @@
1
+ import type { GenericParent } from 'myst-common';
2
+ export declare function splitByHeader(mdast: GenericParent, depth?: number | undefined): {
3
+ head: GenericParent | undefined;
4
+ body: GenericParent;
5
+ };
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,aAAa,EACpB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GACzB;IACD,IAAI,EAAE,aAAa,GAAG,SAAS,CAAC;IAChC,IAAI,EAAE,aAAa,CAAC;CACrB,CAmBA"}
package/dist/utils.js ADDED
@@ -0,0 +1,21 @@
1
+ export function splitByHeader(mdast, depth) {
2
+ let i;
3
+ for (i = 0; i < mdast.children.length; i++) {
4
+ const node = mdast.children[i];
5
+ if (node.type === 'heading' && (depth === undefined || node.depth === depth)) {
6
+ break;
7
+ }
8
+ }
9
+ if (i === mdast.children.length) {
10
+ return {
11
+ head: undefined,
12
+ body: { type: 'block', children: mdast.children },
13
+ };
14
+ }
15
+ else {
16
+ return {
17
+ head: { type: 'block', children: mdast.children.slice(0, i + 1) },
18
+ body: { type: 'block', children: mdast.children.slice(i + 1) },
19
+ };
20
+ }
21
+ }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@myst-theme/landing-pages",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "exports": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "engines": {
11
+ "node": ">=16"
12
+ },
13
+ "license": "MIT",
14
+ "scripts": {
15
+ "clean": "rimraf dist",
16
+ "lint": "eslint \"src/**/*.ts*\" \"src/**/*.tsx\" -c ./.eslintrc.cjs",
17
+ "lint:format": "prettier --check \"src/**/*.{ts,tsx,md}\"",
18
+ "dev": "npm-run-all --parallel \"build:* -- --watch\"",
19
+ "build:esm": "tsc",
20
+ "build": "npm-run-all -l clean -p build:esm"
21
+ },
22
+ "dependencies": {
23
+ "@myst-theme/providers": "^0.14.1",
24
+ "classnames": "^2.5.1",
25
+ "myst-common": "^1.7.8",
26
+ "myst-config": "^1.7.8",
27
+ "myst-frontmatter": "^1.7.8",
28
+ "myst-spec": "^0.0.5",
29
+ "myst-spec-ext": "^1.7.8",
30
+ "myst-to-react": "^0.14.1",
31
+ "unist-util-select": "^4.0.3",
32
+ "unist-util-filter": "^4.0.0"
33
+ },
34
+ "peerDependencies": {
35
+ "@types/react": "^16.8 || ^17.0 || ^18.0",
36
+ "@types/react-dom": "^16.8 || ^17.0 || ^18.0",
37
+ "react": "^16.8 || ^17.0 || ^18.0",
38
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
39
+ }
40
+ }