robindoc 1.2.4 → 2.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 +3 -3
- package/lib/components/blocks/breadcrumbs/index.d.ts +0 -1
- package/lib/components/blocks/breadcrumbs/index.d.ts.map +1 -1
- package/lib/components/blocks/breadcrumbs/index.js +1 -1
- package/lib/components/blocks/breadcrumbs/index.js.map +1 -1
- package/lib/components/blocks/nav-content-link/index.d.ts +1 -3
- package/lib/components/blocks/nav-content-link/index.d.ts.map +1 -1
- package/lib/components/blocks/nav-content-link/index.js.map +1 -1
- package/lib/components/blocks/nav-link/index.d.ts +17 -5
- package/lib/components/blocks/nav-link/index.d.ts.map +1 -1
- package/lib/components/blocks/nav-link/index.js +1 -1
- package/lib/components/blocks/nav-link/index.js.map +1 -1
- package/lib/components/blocks/pagination/index.d.ts +0 -1
- package/lib/components/blocks/pagination/index.d.ts.map +1 -1
- package/lib/components/blocks/pagination/index.js +1 -1
- package/lib/components/blocks/pagination/index.js.map +1 -1
- package/lib/components/blocks/search/index.d.ts +0 -1
- package/lib/components/blocks/search/index.d.ts.map +1 -1
- package/lib/components/blocks/search/index.js +1 -1
- package/lib/components/blocks/search/index.js.map +1 -1
- package/lib/components/blocks/search/search-modal/index.d.ts +0 -1
- package/lib/components/blocks/search/search-modal/index.d.ts.map +1 -1
- package/lib/components/blocks/search/search-modal/index.js +1 -1
- package/lib/components/blocks/search/search-modal/index.js.map +1 -1
- package/lib/components/blocks/section-dropdown/index.d.ts +0 -1
- package/lib/components/blocks/section-dropdown/index.d.ts.map +1 -1
- package/lib/components/blocks/section-dropdown/index.js +1 -1
- package/lib/components/blocks/section-dropdown/index.js.map +1 -1
- package/lib/components/elements/article/document.d.ts +0 -1
- package/lib/components/elements/article/document.d.ts.map +1 -1
- package/lib/components/elements/article/document.js +1 -1
- package/lib/components/elements/article/document.js.map +1 -1
- package/lib/components/elements/article/index.d.ts +0 -1
- package/lib/components/elements/article/index.d.ts.map +1 -1
- package/lib/components/elements/article/index.js +1 -1
- package/lib/components/elements/article/index.js.map +1 -1
- package/lib/components/elements/header/index.d.ts +0 -1
- package/lib/components/elements/header/index.d.ts.map +1 -1
- package/lib/components/elements/header/index.js +1 -1
- package/lib/components/elements/header/index.js.map +1 -1
- package/lib/components/elements/robin-provider/index.d.ts.map +1 -1
- package/lib/components/elements/robin-provider/index.js +1 -1
- package/lib/components/elements/robin-provider/index.js.map +1 -1
- package/lib/components/elements/sidebar/index.d.ts +0 -4
- package/lib/components/elements/sidebar/index.d.ts.map +1 -1
- package/lib/components/elements/sidebar/index.js +1 -1
- package/lib/components/elements/sidebar/index.js.map +1 -1
- package/lib/components/elements/sidebar/sidebar-drop/index.d.ts +1 -0
- package/lib/components/elements/sidebar/sidebar-drop/index.d.ts.map +1 -1
- package/lib/components/elements/sidebar/sidebar-drop/index.js +1 -1
- package/lib/components/elements/sidebar/sidebar-drop/index.js.map +1 -1
- package/lib/components/elements/sidebar/sidebar-link/index.d.ts +3 -3
- package/lib/components/elements/sidebar/sidebar-link/index.d.ts.map +1 -1
- package/lib/components/elements/sidebar/sidebar-link/index.js +1 -1
- package/lib/components/elements/sidebar/sidebar-link/index.js.map +1 -1
- package/lib/components/elements/sidebar/tools.d.ts +4 -1
- package/lib/components/elements/sidebar/tools.d.ts.map +1 -1
- package/lib/components/elements/sidebar/tools.js +1 -1
- package/lib/components/elements/sidebar/tools.js.map +1 -1
- package/lib/components/ui/content-link/index.d.ts +2 -2
- package/lib/components/ui/content-link/index.d.ts.map +1 -1
- package/lib/components/ui/content-link/index.js +1 -1
- package/lib/components/ui/content-link/index.js.map +1 -1
- package/lib/core/utils/initialize-robindoc.d.ts.map +1 -1
- package/lib/core/utils/initialize-robindoc.js +1 -1
- package/lib/core/utils/initialize-robindoc.js.map +1 -1
- package/lib/styles.css +1 -1
- package/lib/styles.css.map +1 -1
- package/package.json +3 -1
- package/lib/components/contexts/sidebar/context.d.ts +0 -3
- package/lib/components/contexts/sidebar/context.d.ts.map +0 -1
- package/lib/components/contexts/sidebar/context.js +0 -2
- package/lib/components/contexts/sidebar/context.js.map +0 -1
- package/lib/components/contexts/sidebar/provider.d.ts +0 -3
- package/lib/components/contexts/sidebar/provider.d.ts.map +0 -1
- package/lib/components/contexts/sidebar/provider.js +0 -3
- package/lib/components/contexts/sidebar/provider.js.map +0 -1
- package/lib/components/contexts/sidebar/use-sidebar-store.d.ts +0 -6
- package/lib/components/contexts/sidebar/use-sidebar-store.d.ts.map +0 -1
- package/lib/components/contexts/sidebar/use-sidebar-store.js +0 -3
- package/lib/components/contexts/sidebar/use-sidebar-store.js.map +0 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Read the documentation in a convenient interface at [robindoc.com/docs](https://
|
|
|
13
13
|
|
|
14
14
|
Robindoc is a framework for automatically creating documentation websites based on markdown files, built on React.js Server Components.
|
|
15
15
|
|
|
16
|
-
```tsx
|
|
16
|
+
```tsx filename="/docs/page.tsx"
|
|
17
17
|
export const Documentation = () => {
|
|
18
18
|
return (
|
|
19
19
|
<RobinProvider>
|
|
@@ -34,8 +34,8 @@ No additional configuration is needed, while preserving the accessibility and cl
|
|
|
34
34
|
|
|
35
35
|
## Advantages
|
|
36
36
|
|
|
37
|
-
- Works on React.js Server Components (RSC).
|
|
38
|
-
-
|
|
37
|
+
- Works on React.js Server Components (RSC). More details in the section "[App Organization](./docs/01-getting-started/04-app-organization.md)";
|
|
38
|
+
- Zero configuration of the project, bundler, or markdown documents. More details in the section "[Customization](./docs/03-customization/README.md)";
|
|
39
39
|
- Supports loading content from various sources, including GitHub. More details in the section "[Data Source](./docs/02-structure/03-data-source.md)";
|
|
40
40
|
- Supports fully automatic documentation generation, as well as custom generation. More details in the section "[Structure](./docs/02-structure/README.md)";
|
|
41
41
|
- Supports JSX/HTML and special Robin components for all sources. More details in the section "[Writing MD](./docs/01-getting-started/02-writing-md.md)";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/breadcrumbs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,WAAW,IAAI,eAAe,EAAE,oCAAgC;AAG9E,OAAO,oBAAoB,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/breadcrumbs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,WAAW,IAAI,eAAe,EAAE,oCAAgC;AAG9E,OAAO,oBAAoB,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,eAAe,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAelD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{NavLink as r}from"../nav-link/index.js";const a=async({title:a,breadcrumbs:t
|
|
1
|
+
import e from"react";import{NavLink as r}from"../nav-link/index.js";const a=async({title:a,breadcrumbs:t})=>e.createElement("ul",{className:"r-breadcrumbs"},t.map((a=>e.createElement("li",{key:a.pathname,className:"r-breadcrumb _previous"},e.createElement(r,{href:a.pathname,className:"r-breadcrumb-link"},a.title)))),e.createElement("li",{className:"r-breadcrumb _target"},e.createElement("p",{className:"r-breadcrumb-title"},a)));export{a as Breadcrumbs};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/breadcrumbs/index.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { type Breadcrumbs as BreadcrumbsType } from \"@src/core/types/content\";\nimport { NavLink } from \"../nav-link\";\n\nimport \"./breadcrumbs.scss\";\n\nexport type BreadcrumbsProps = {\n title: string;\n breadcrumbs: BreadcrumbsType;\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/breadcrumbs/index.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { type Breadcrumbs as BreadcrumbsType } from \"@src/core/types/content\";\nimport { NavLink } from \"../nav-link\";\n\nimport \"./breadcrumbs.scss\";\n\nexport type BreadcrumbsProps = {\n title: string;\n breadcrumbs: BreadcrumbsType;\n};\n\nexport const Breadcrumbs: React.FC<BreadcrumbsProps> = async ({ title, breadcrumbs }) => {\n return (\n <ul className=\"r-breadcrumbs\">\n {breadcrumbs.map((breadcrumb) => (\n <li key={breadcrumb.pathname} className=\"r-breadcrumb _previous\">\n <NavLink href={breadcrumb.pathname} className=\"r-breadcrumb-link\">\n {breadcrumb.title}\n </NavLink>\n </li>\n ))}\n <li className=\"r-breadcrumb _target\">\n <p className=\"r-breadcrumb-title\">{title}</p>\n </li>\n </ul>\n );\n};\n"],"names":["Breadcrumbs","async","title","breadcrumbs","React","createElement","className","map","breadcrumb","key","pathname","NavLink","href"],"mappings":"oEAYO,MAAMA,EAA0CC,OAASC,QAAOC,iBAE/DC,EAAAC,cAAA,KAAA,CAAIC,UAAU,iBACTH,EAAYI,KAAKC,GACdJ,EAAIC,cAAA,KAAA,CAAAI,IAAKD,EAAWE,SAAUJ,UAAU,0BACpCF,EAAAC,cAACM,EAAQ,CAAAC,KAAMJ,EAAWE,SAAUJ,UAAU,qBACzCE,EAAWN,UAIxBE,EAAIC,cAAA,KAAA,CAAAC,UAAU,wBACVF,EAAGC,cAAA,IAAA,CAAAC,UAAU,sBAAsBJ"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type ContentLinkProps } from "../../ui/content-link";
|
|
3
|
-
|
|
4
|
-
link?: React.ElementType;
|
|
5
|
-
}
|
|
3
|
+
type NavContentLinkProps = ContentLinkProps;
|
|
6
4
|
export declare const NavContentLink: React.FC<NavContentLinkProps>;
|
|
7
5
|
export {};
|
|
8
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/nav-content-link/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAe,KAAK,gBAAgB,EAAE,8BAAwC;AAErF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/nav-content-link/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAe,KAAK,gBAAgB,EAAE,8BAAwC;AAErF,KAAK,mBAAmB,GAAG,gBAAgB,CAAC;AAE5C,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CASxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/nav-content-link/index.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\n\nimport { useNavigate } from \"@src/components/contexts/navigate/use-navigate\";\nimport { ContentLink, type ContentLinkProps } from \"@src/components/ui/content-link\";\n\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/nav-content-link/index.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\n\nimport { useNavigate } from \"@src/components/contexts/navigate/use-navigate\";\nimport { ContentLink, type ContentLinkProps } from \"@src/components/ui/content-link\";\n\ntype NavContentLinkProps = ContentLinkProps;\n\nexport const NavContentLink: React.FC<NavContentLinkProps> = ({ onClick, ...props }) => {\n const { listeners } = useNavigate();\n\n const clickHandler = (e: React.MouseEvent<HTMLAnchorElement>) => {\n [...listeners].forEach((el) => el.listener());\n if (onClick) onClick(e);\n };\n\n return <ContentLink onClick={clickHandler} {...props} />;\n};\n"],"names":["NavContentLink","onClick","props","listeners","useNavigate","React","createElement","ContentLink","e","forEach","el","listener"],"mappings":";wJASO,CAAMA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAgD,CAAGC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAYC,CACxE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAEA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAcC,IAOtB,CAAOC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAC,CAACC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAY,CAAAN,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CALEO,CAClB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAIL,GAAWM,CAASC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAOA,CAAGC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAC9BV,CAASA,CAAAA,CAAAA,CAAAA,CAAQO,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAGoBN,GAAS"}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export declare const NavLink: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
4
|
+
href: string | import("url").UrlObject;
|
|
5
|
+
as?: (string | import("url").UrlObject) | undefined;
|
|
6
|
+
replace?: boolean | undefined;
|
|
7
|
+
scroll?: boolean | undefined;
|
|
8
|
+
shallow?: boolean | undefined;
|
|
9
|
+
passHref?: boolean | undefined;
|
|
10
|
+
prefetch?: boolean | null | undefined;
|
|
11
|
+
locale?: string | false | undefined;
|
|
12
|
+
legacyBehavior?: boolean | undefined;
|
|
13
|
+
onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
14
|
+
onTouchStart?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
15
|
+
onClick?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
7
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/nav-link/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/nav-link/index.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAO1C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;2CASlB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import e,{forwardRef as t}from"react";import{useNavigate as
|
|
2
|
+
import e,{forwardRef as t}from"react";import r from"next/link";import{useNavigate as n}from"../../contexts/navigate/use-navigate.js";const o=t((({onClick:t,...o},i)=>{const{listeners:c}=n();return e.createElement(r,{ref:i,onClick:e=>{[...c].forEach((e=>e.listener())),t&&t(e)},...o})}));export{o as NavLink};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/nav-link/index.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { forwardRef } from \"react\";\n\nimport { useNavigate } from \"@src/components/contexts/navigate/use-navigate\";\n\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/nav-link/index.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { forwardRef } from \"react\";\nimport Link, { LinkProps } from \"next/link\";\n\nimport { useNavigate } from \"@src/components/contexts/navigate/use-navigate\";\n\ntype NavLinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & React.PropsWithChildren<LinkProps>;\n\nexport const NavLink = forwardRef<HTMLAnchorElement, NavLinkProps>(({ onClick, ...props }, ref) => {\n const { listeners } = useNavigate();\n\n const clickHandler = (e: React.MouseEvent<HTMLAnchorElement>) => {\n [...listeners].forEach((el) => el.listener());\n if (onClick) onClick(e);\n };\n\n return <Link ref={ref} onClick={clickHandler} {...props} />;\n});\n"],"names":["NavLink","forwardRef","onClick","props","ref","listeners","useNavigate","React","createElement","Link","e","forEach","el","listener"],"mappings":";qIASa,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAUC,CAA4C,CAAA,CAAA,CAAA,CAAGC,aAAYC,CAASC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CACvF,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAEA,GAAcC,CAOtB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAOC,CAACC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAC,EAAK,CAAAL,CAAAA,CAAAA,CAAAA,CAAKA,CAAKF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CALDQ,IAClB,CAAIL,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAWM,CAASC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAOA,EAAGC,CAC9BX,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAASA,EAAQQ,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAGuBP,GAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/pagination/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,mBAAmB,CAAC;AAE3B,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/pagination/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,mBAAmB,CAAC;AAE3B,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,YAAY,CAAC,EAAE;QACX,eAAe;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACL,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyDhD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{NavLink as t}from"../nav-link/index.js";const n=async({prev:n,next:a,
|
|
1
|
+
import e from"react";import{NavLink as t}from"../nav-link/index.js";const n=async({prev:n,next:a,translations:r})=>{const{previous:l="Previous",next:i="Next"}=r||{};return e.createElement("div",{className:"r-pagination"},n?e.createElement(t,{href:n.pathname,className:"r-pagination-item _prev"},e.createElement("span",{className:"r-pagination-icon _prev"},e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("path",{d:"m15 18-6-6 6-6"}))),e.createElement("span",{className:"r-pagination-text"},e.createElement("span",null,l),e.createElement("br",null),e.createElement("span",{className:"r-pagination-title"},n.title))):e.createElement("span",null),a?e.createElement(t,{href:a.pathname,className:"r-pagination-item _next"},e.createElement("span",{className:"r-pagination-icon _next"},e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("path",{d:"m9 18 6-6-6-6"}))),e.createElement("span",{className:"r-pagination-text"},e.createElement("span",null,i),e.createElement("br",null),e.createElement("span",{className:"r-pagination-title"},a.title))):e.createElement("span",null))};export{n as Pagination};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/pagination/index.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { NavLink } from \"../nav-link\";\n\nimport \"./pagination.scss\";\n\nexport type PaginationProps = {\n prev?: { title: string; pathname: string };\n next?: { title: string; pathname: string };\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/pagination/index.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { NavLink } from \"../nav-link\";\n\nimport \"./pagination.scss\";\n\nexport type PaginationProps = {\n prev?: { title: string; pathname: string };\n next?: { title: string; pathname: string };\n translations?: {\n /** Previous */\n previous?: string;\n /** Next */\n next?: string;\n };\n};\n\nexport const Pagination: React.FC<PaginationProps> = async ({ prev, next, translations }) => {\n const { previous = \"Previous\", next: nextTranslation = \"Next\" } = translations || {};\n\n return (\n <div className=\"r-pagination\">\n {prev ? (\n <NavLink href={prev.pathname} className=\"r-pagination-item _prev\">\n <span className=\"r-pagination-icon _prev\">\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </span>\n <span className=\"r-pagination-text\">\n <span>{previous}</span>\n <br />\n <span className=\"r-pagination-title\">{prev.title}</span>\n </span>\n </NavLink>\n ) : (\n <span />\n )}\n {next ? (\n <NavLink href={next.pathname} className=\"r-pagination-item _next\">\n <span className=\"r-pagination-icon _next\">\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </span>\n <span className=\"r-pagination-text\">\n <span>{nextTranslation}</span>\n <br />\n <span className=\"r-pagination-title\">{next.title}</span>\n </span>\n </NavLink>\n ) : (\n <span />\n )}\n </div>\n );\n};\n"],"names":["Pagination","async","prev","next","translations","previous","nextTranslation","React","createElement","className","NavLink","href","pathname","width","height","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","d","title"],"mappings":"oEAiBO,MAAMA,EAAwCC,OAASC,OAAMC,OAAMC,mBACtE,MAAMC,SAAEA,EAAW,WAAYF,KAAMG,EAAkB,QAAWF,GAAgB,GAElF,OACIG,EAAAC,cAAA,MAAA,CAAKC,UAAU,gBACVP,EACGK,gBAACG,EAAO,CAACC,KAAMT,EAAKU,SAAUH,UAAU,2BACpCF,EAAMC,cAAA,OAAA,CAAAC,UAAU,2BACZF,EAAAC,cAAA,MAAA,CACIK,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,OAAO,eACPC,YAAY,IACZC,cAAc,QACdC,eAAe,SAEfb,EAAAC,cAAA,OAAA,CAAMa,EAAE,qBAGhBd,EAAMC,cAAA,OAAA,CAAAC,UAAU,qBACZF,EAAAC,cAAA,OAAA,KAAOH,GACPE,EAAMC,cAAA,KAAA,MACND,EAAAC,cAAA,OAAA,CAAMC,UAAU,sBAAsBP,EAAKoB,SAInDf,6BAEHJ,EACGI,gBAACG,EAAO,CAACC,KAAMR,EAAKS,SAAUH,UAAU,2BACpCF,EAAMC,cAAA,OAAA,CAAAC,UAAU,2BACZF,EAAAC,cAAA,MAAA,CACIK,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,OAAO,eACPC,YAAY,IACZC,cAAc,QACdC,eAAe,SAEfb,EAAAC,cAAA,OAAA,CAAMa,EAAE,oBAGhBd,EAAMC,cAAA,OAAA,CAAAC,UAAU,qBACZF,EAAAC,cAAA,OAAA,KAAOF,GACPC,EAAMC,cAAA,KAAA,MACND,EAAAC,cAAA,OAAA,CAAMC,UAAU,sBAAsBN,EAAKmB,SAInDf,6BAGV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/search/index.tsx"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKpE,MAAM,WAAW,WAAW;IACxB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/search/index.tsx"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKpE,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACvC,YAAY,CAAC,EAAE;QACX,gBAAgB;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsDxC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import e,{useRef as
|
|
2
|
+
import e,{useRef as r,useEffect as t}from"react";import{SearchModal as n}from"./search-modal/index.js";import{useSystemType as o}from"../../../core/hooks/use-system-type.js";import{KbdContainer as a}from"../../ui/kbd/kbd-container/index.js";import{KbdKey as s}from"../../ui/kbd/kbd-key/index.js";import{useModal as l}from"../../ui/modal/use-modal.js";const c=({searcher:c,translations:m})=>{const{search:i="Search...",...d}=m||{},p=r(null),{opened:u,closeHandler:k,openHandler:y}=l(),h=o();t((()=>{const e=e=>{"k"===e.key.toLowerCase()&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),y())};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}}),[]);return e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"r-search-btn",onClick:y,onKeyDown:e=>{1===e.key.length&&"Space"!==e.code&&y()}},e.createElement("span",{className:"r-search-title",ref:p},i),h&&e.createElement(a,{className:"r-search-kbd"},e.createElement(s,null,"apple"===h?"⌘":"CTRL"),e.createElement(s,null,"K"))),e.createElement(n,{open:u,translations:d,searcher:c,onClose:k,onInput:e=>{p.current&&(p.current.innerText=e||i)}}))};export{c as Search};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/search/index.tsx"],"sourcesContent":["\"use client\";\n\nimport \"./search.scss\";\n\nimport React, { useEffect, useRef } from \"react\";\n\nimport { SearchModal, type SearchModalProps } from \"./search-modal\";\nimport { useSystemType } from \"@src/core/hooks/use-system-type\";\nimport { KbdContainer, KbdKey } from \"@src/components/ui/kbd\";\nimport { useModal } from \"@src/components/ui/modal/use-modal\";\n\nexport interface SearchProps {\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/search/index.tsx"],"sourcesContent":["\"use client\";\n\nimport \"./search.scss\";\n\nimport React, { useEffect, useRef } from \"react\";\n\nimport { SearchModal, type SearchModalProps } from \"./search-modal\";\nimport { useSystemType } from \"@src/core/hooks/use-system-type\";\nimport { KbdContainer, KbdKey } from \"@src/components/ui/kbd\";\nimport { useModal } from \"@src/components/ui/modal/use-modal\";\n\nexport interface SearchProps {\n searcher: SearchModalProps[\"searcher\"];\n translations?: {\n /** Search... */\n search?: string;\n } & SearchModalProps[\"translations\"];\n}\n\nexport const Search: React.FC<SearchProps> = ({ searcher, translations }) => {\n const { search = \"Search...\", ...modalTranslations } = translations || {};\n const titleRef = useRef<HTMLSpanElement>(null);\n const { opened, closeHandler, openHandler } = useModal();\n const system = useSystemType();\n\n const keyDownHandler = (e: React.KeyboardEvent<HTMLElement>) => {\n if (e.key.length === 1 && e.code !== \"Space\") {\n openHandler();\n }\n };\n\n useEffect(() => {\n const keyDown = (e: KeyboardEvent) => {\n if (e.key.toLowerCase() === \"k\" && (e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n openHandler();\n }\n };\n window.addEventListener(\"keydown\", keyDown);\n\n return () => {\n window.removeEventListener(\"keydown\", keyDown);\n };\n }, []);\n\n const inputHandler = (text: string) => {\n if (titleRef.current) {\n titleRef.current.innerText = text || search;\n }\n };\n\n return (\n <>\n <button type=\"button\" className=\"r-search-btn\" onClick={openHandler} onKeyDown={keyDownHandler}>\n <span className=\"r-search-title\" ref={titleRef}>\n {search}\n </span>\n {system && (\n <KbdContainer className=\"r-search-kbd\">\n <KbdKey>{system === \"apple\" ? \"⌘\" : \"CTRL\"}</KbdKey>\n <KbdKey>K</KbdKey>\n </KbdContainer>\n )}\n </button>\n <SearchModal\n open={opened}\n translations={modalTranslations}\n searcher={searcher}\n onClose={closeHandler}\n onInput={inputHandler}\n />\n </>\n );\n};\n"],"names":["Search","searcher","translations","search","modalTranslations","titleRef","useRef","opened","closeHandler","openHandler","useModal","system","useSystemType","useEffect","keyDown","e","key","toLowerCase","metaKey","ctrlKey","preventDefault","window","addEventListener","removeEventListener","React","createElement","Fragment","type","className","onClick","onKeyDown","length","code","ref","KbdContainer","KbdKey","SearchModal","open","onClose","onInput","text","current","innerText"],"mappings":";+VAmBa,MAAAA,CAAgC,CAAA,CAAA,CAAGC,CAAUC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CACtD,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAEA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgBC,GAAsBF,CAAgB,CAAA,CAAA,EACjEG,CAAAA,CAAAA,CAAWC,EAAwB,CACnCC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAEA,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAA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CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAW,EACG,CAAAC,CAAAA,CAAAA,CAAAA,CAAAA,CAAM9B,CACNL,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAcE,CACdH,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAUA,CACVqC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAS9B,EACT+B,CAxBUC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CACdnC,CAASoC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CACTpC,EAASoC,CAAQC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAYF,CAAQrC,CAAAA,CAAAA,CAAAA,CACzC,IAwBH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/blocks/search/search-modal/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,KAAK,QAAQ,EAAmB,sCAA+B;AAOxE,MAAM,WAAW,gBAAgB;IAC7B,OAAO,IAAI,IAAI,CAAC;IAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/blocks/search/search-modal/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,KAAK,QAAQ,EAAmB,sCAA+B;AAOxE,MAAM,WAAW,gBAAgB;IAC7B,OAAO,IAAI,IAAI,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE;QACX,wBAAwB;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,oBAAoB;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACL;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwDlD,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import e,{useRef as r,useState as t,useMemo as n,useEffect as a}from"react";import{createBaseSearcher as s}from"../../../../core/utils/create-base-searcher.js";import{NavLink as
|
|
2
|
+
import e,{useRef as r,useState as t,useMemo as n,useEffect as a}from"react";import{createBaseSearcher as s}from"../../../../core/utils/create-base-searcher.js";import{NavLink as o}from"../../nav-link/index.js";import{useDebouncer as c}from"../../../../core/hooks/use-debouncer.js";import{KbdContainer as l}from"../../../ui/kbd/kbd-container/index.js";import{KbdKey as m}from"../../../ui/kbd/kbd-key/index.js";import{Modal as i}from"../../../ui/modal/index.js";const p=({translations:p,searcher:h,open:u,onClose:d,onInput:f})=>{const{typeSomething:k="Type something...",nothingFound:E="Nothing found"}=p||{},b=r(null),[g,N]=t(null),y=n((()=>"string"==typeof h?s(h):h),[h]),{handler:j}=c((async(e,r)=>{const t=r.target.value;f(t);let n=null;t&&(n=await y(t,e)),N(n)}));return a((()=>{u&&b.current?.focus()}),[u]),e.createElement(i,{open:u,onClose:d},e.createElement("div",{className:"r-search-popup-header"},e.createElement("input",{type:"text",name:"search",placeholder:k,className:"r-search-input",onChange:j,ref:b}),e.createElement(l,{className:"r-search-kbd r-search-popup-kbd",onClick:d},e.createElement(m,null,"ESC"))),g&&e.createElement("ul",{className:"r-search-results"},g.length>0?g.map((r=>e.createElement("li",{key:r.href},e.createElement(o,{href:r.href,onClick:d,className:"r-search-item"},e.createElement("p",{className:"r-search-item-title"},r.title),r.description&&e.createElement("p",{className:"r-search-item-desc"},r.description))))):e.createElement("p",null,E)))};export{p as SearchModal};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/blocks/search/search-modal/index.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { type Searcher, type SearchItem } from \"@src/core/types/search\";\nimport { createBaseSearcher } from \"@src/core/utils/create-base-searcher\";\nimport { NavLink } from \"@src/components/blocks/nav-link\";\nimport { useDebouncer } from \"@src/core/hooks/use-debouncer\";\nimport { KbdContainer, KbdKey } from \"@src/components/ui/kbd\";\nimport { Modal } from \"@src/components/ui/modal\";\n\nexport interface SearchModalProps {\n onClose(): void;\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/blocks/search/search-modal/index.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { type Searcher, type SearchItem } from \"@src/core/types/search\";\nimport { createBaseSearcher } from \"@src/core/utils/create-base-searcher\";\nimport { NavLink } from \"@src/components/blocks/nav-link\";\nimport { useDebouncer } from \"@src/core/hooks/use-debouncer\";\nimport { KbdContainer, KbdKey } from \"@src/components/ui/kbd\";\nimport { Modal } from \"@src/components/ui/modal\";\n\nexport interface SearchModalProps {\n onClose(): void;\n open: boolean;\n onInput(text: string): void;\n searcher: Searcher | string;\n translations?: {\n /** Type something... */\n typeSomething?: string;\n /** Nothing found */\n nothingFound?: string;\n };\n}\n\nexport const SearchModal: React.FC<SearchModalProps> = ({ translations, searcher, open, onClose, onInput }) => {\n const { typeSomething = \"Type something...\", nothingFound = \"Nothing found\" } = translations || {};\n const inputRef = useRef<HTMLInputElement | null>(null);\n const [results, setResults] = useState<SearchItem[] | null>(null);\n const targetSearcher = useMemo(\n () => (typeof searcher === \"string\" ? createBaseSearcher(searcher) : searcher),\n [searcher],\n );\n\n const { handler } = useDebouncer(async (abortController, e: React.ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value;\n onInput(value);\n let newResults = null;\n if (value) {\n newResults = await targetSearcher(value, abortController);\n }\n setResults(newResults);\n });\n\n useEffect(() => {\n if (open) inputRef.current?.focus();\n }, [open]);\n\n return (\n <Modal open={open} onClose={onClose}>\n <div className=\"r-search-popup-header\">\n <input\n type=\"text\"\n name=\"search\"\n placeholder={typeSomething}\n className=\"r-search-input\"\n onChange={handler}\n ref={inputRef}\n />\n <KbdContainer className=\"r-search-kbd r-search-popup-kbd\" onClick={onClose}>\n <KbdKey>ESC</KbdKey>\n </KbdContainer>\n </div>\n {results && (\n <ul className=\"r-search-results\">\n {results.length > 0 ? (\n results.map((item) => (\n <li key={item.href}>\n <NavLink href={item.href} onClick={onClose} className=\"r-search-item\">\n <p className=\"r-search-item-title\">{item.title}</p>\n {item.description && <p className=\"r-search-item-desc\">{item.description}</p>}\n </NavLink>\n </li>\n ))\n ) : (\n <p>{nothingFound}</p>\n )}\n </ul>\n )}\n </Modal>\n );\n};\n"],"names":["SearchModal","translations","searcher","open","onClose","onInput","typeSomething","nothingFound","inputRef","useRef","results","setResults","useState","targetSearcher","useMemo","createBaseSearcher","handler","useDebouncer","async","abortController","e","value","target","newResults","useEffect","current","focus","React","createElement","Modal","className","type","name","placeholder","onChange","ref","KbdContainer","onClick","KbdKey","length","map","item","key","href","NavLink","title","description"],"mappings":";gbAwBa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAA,EAA0C,CAAGC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA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.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,yBAAyB,CAAC;AAEjC,KAAK,qBAAqB,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,qBAAqB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/blocks/section-dropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,yBAAyB,CAAC;AAEjC,KAAK,qBAAqB,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuC1D,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import t from"clsx";import{NavLink as r}from"../nav-link/index.js";const o=({defaultOption:o,options:n
|
|
1
|
+
import e from"react";import t from"clsx";import{NavLink as r}from"../nav-link/index.js";const o=({defaultOption:o,options:n})=>{const a=n.find((e=>e.key===o));if(!a)throw new Error("Invalid default option");return e.createElement("div",{className:"r-dropdown"},e.createElement("button",{className:"r-dropdown-summary"},e.createElement("span",null,a.shortTitle||a.title),e.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"r-dropdown-chevron"},e.createElement("path",{d:"m6 9 6 6 6-6"}))),e.createElement("ul",{className:"r-dropdown-drop"},n.map((n=>e.createElement("li",{key:n.key},e.createElement(r,{href:n.href,className:t("r-dropdown-link",n.key===o&&"_active")},n.title))))))};export{o as SectionDropdown};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/section-dropdown/index.tsx"],"sourcesContent":["import React from \"react\";\nimport clsx from \"clsx\";\n\nimport { NavLink } from \"../nav-link\";\n\nimport \"./section-dropdown.scss\";\n\ntype SectionDropdownOption = {\n key: string;\n href: string;\n title: string;\n shortTitle?: string;\n};\n\nexport type SectionDropdownProps = {\n defaultOption: string;\n options: SectionDropdownOption[];\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/section-dropdown/index.tsx"],"sourcesContent":["import React from \"react\";\nimport clsx from \"clsx\";\n\nimport { NavLink } from \"../nav-link\";\n\nimport \"./section-dropdown.scss\";\n\ntype SectionDropdownOption = {\n key: string;\n href: string;\n title: string;\n shortTitle?: string;\n};\n\nexport type SectionDropdownProps = {\n defaultOption: string;\n options: SectionDropdownOption[];\n};\n\nexport const SectionDropdown: React.FC<SectionDropdownProps> = ({ defaultOption, options }) => {\n const defaultOptionDetailed = options.find((option) => option.key === defaultOption);\n\n if (!defaultOptionDetailed) {\n throw new Error(\"Invalid default option\");\n }\n\n return (\n <div className=\"r-dropdown\">\n <button className=\"r-dropdown-summary\">\n <span>{defaultOptionDetailed.shortTitle || defaultOptionDetailed.title}</span>\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"r-dropdown-chevron\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n <ul className=\"r-dropdown-drop\">\n {options.map((option) => (\n <li key={option.key}>\n <NavLink\n href={option.href}\n className={clsx(\"r-dropdown-link\", option.key === defaultOption && \"_active\")}\n >\n {option.title}\n </NavLink>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"],"names":["SectionDropdown","defaultOption","options","defaultOptionDetailed","find","option","key","Error","React","createElement","className","shortTitle","title","width","height","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","d","map","NavLink","href","clsx"],"mappings":"wFAmBa,MAAAA,EAAkD,EAAGC,gBAAeC,cAC7E,MAAMC,EAAwBD,EAAQE,MAAMC,GAAWA,EAAOC,MAAQL,IAEtE,IAAKE,EACD,MAAM,IAAII,MAAM,0BAGpB,OACIC,EAAAC,cAAA,MAAA,CAAKC,UAAU,cACXF,EAAQC,cAAA,SAAA,CAAAC,UAAU,sBACdF,EAAAC,cAAA,OAAA,KAAON,EAAsBQ,YAAcR,EAAsBS,OACjEJ,EAAAC,cAAA,MAAA,CACII,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,OAAO,eACPC,YAAY,IACZC,cAAc,QACdC,eAAe,QACfV,UAAU,sBAEVF,EAAAC,cAAA,OAAA,CAAMY,EAAE,mBAGhBb,EAAAC,cAAA,KAAA,CAAIC,UAAU,mBACTR,EAAQoB,KAAKjB,GACVG,EAAAC,cAAA,KAAA,CAAIH,IAAKD,EAAOC,KACZE,EAAAC,cAACc,EAAO,CACJC,KAAMnB,EAAOmB,KACbd,UAAWe,EAAK,kBAAmBpB,EAAOC,MAAQL,GAAiB,YAElEI,EAAOO,WAM9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../src/components/elements/article/document.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,UAAU,EAA2B,MAAM,QAAQ,CAAC;AAClE,OAAO,EAAmB,KAA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,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE;QACL,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC;IACF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAsR3C,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{join as t,dirname as n}from"path";import r,{Text as o,attributesToProps as a,domToReact as s}from"html-react-parser";import{NavContentLink as i}from"../../blocks/nav-content-link/index.js";import{AnchorHeading as l}from"../../blocks/anchor-heading/index.js";import{CodeSection as m}from"../../blocks/code-section/index.js";import{Table as c}from"../../ui/table/table/index.js";import{Tbody as u}from"../../ui/table/tbody/index.js";import{Td as p}from"../../ui/table/td/index.js";import{Th as d}from"../../ui/table/th/index.js";import{Thead as k}from"../../ui/table/thead/index.js";import{Tr as f}from"../../ui/table/tr/index.js";import{CodeSpan as h}from"../../ui/code-span/index.js";import{Img as E}from"../../ui/img/index.js";import{Block as x}from"../../ui/block/index.js";import{Blockquote as w}from"../../ui/blockquote/index.js";import{Paragraph as y}from"../../ui/paragraph/index.js";import{Strong as b}from"../../ui/strong/index.js";import{Del as g}from"../../ui/del/index.js";import{Em as j}from"../../ui/em/index.js";import{Hr as v}from"../../ui/hr/index.js";import{Heading as $}from"../../ui/heading/index.js";import{Tabs as A}from"../../ui/tabs/index.js";import{ListItem as P}from"../../ui/list/list-item/index.js";import{OrderedList as T}from"../../ui/list/ordered-list/index.js";import{UnorderedList as C}from"../../ui/list/unordered-list/index.js";import{TaskListItem as U}from"../../ui/task-list/task-list-item/index.js";import{TaskOrderedList as D}from"../../ui/task-list/task-ordered-list/index.js";import{TaskUnorderedList as F}from"../../ui/task-list/task-unordered-list/index.js";import{isNewCodeToken as N,validateComponentName as W,parseCodeLang as q,parseMarkdown as I}from"./utils.js";const K=({raw:t,components:n,...i})=>{const l={replace(t){if(t instanceof o&&t.data){const{headings:r,tokens:o}=I(t.data);return e.createElement(O,{headings:r,tokens:o,components:n,subtree:!0,...i})}if(!("name"in t))return e.createElement(e.Fragment,null);if(!W(t.name))return t;if(!n||!(t.name in n))return console.warn(`Unknown component: "${t.name}"`),e.createElement(e.Fragment,null);const r="attribs"in t?a(t.attribs):{},m=n[t.name],c="children"in t?t.children:null;return e.createElement(m,{...r},c?s(c,l):null)},htmlparser2:{lowerCaseTags:!1,lowerCaseAttributeNames:!1}};return r(t,l)},O=({pathname:r,components:o,uri:a,targetProvider:s,tokens:I,headings:O,config:R={},subtree:S,
|
|
1
|
+
import e from"react";import{join as t,dirname as n}from"path";import r,{Text as o,attributesToProps as a,domToReact as s}from"html-react-parser";import{NavContentLink as i}from"../../blocks/nav-content-link/index.js";import{AnchorHeading as l}from"../../blocks/anchor-heading/index.js";import{CodeSection as m}from"../../blocks/code-section/index.js";import{Table as c}from"../../ui/table/table/index.js";import{Tbody as u}from"../../ui/table/tbody/index.js";import{Td as p}from"../../ui/table/td/index.js";import{Th as d}from"../../ui/table/th/index.js";import{Thead as k}from"../../ui/table/thead/index.js";import{Tr as f}from"../../ui/table/tr/index.js";import{CodeSpan as h}from"../../ui/code-span/index.js";import{Img as E}from"../../ui/img/index.js";import{Block as x}from"../../ui/block/index.js";import{Blockquote as w}from"../../ui/blockquote/index.js";import{Paragraph as y}from"../../ui/paragraph/index.js";import{Strong as b}from"../../ui/strong/index.js";import{Del as g}from"../../ui/del/index.js";import{Em as j}from"../../ui/em/index.js";import{Hr as v}from"../../ui/hr/index.js";import{Heading as $}from"../../ui/heading/index.js";import{Tabs as A}from"../../ui/tabs/index.js";import{ListItem as P}from"../../ui/list/list-item/index.js";import{OrderedList as T}from"../../ui/list/ordered-list/index.js";import{UnorderedList as C}from"../../ui/list/unordered-list/index.js";import{TaskListItem as U}from"../../ui/task-list/task-list-item/index.js";import{TaskOrderedList as D}from"../../ui/task-list/task-ordered-list/index.js";import{TaskUnorderedList as F}from"../../ui/task-list/task-unordered-list/index.js";import{isNewCodeToken as N,validateComponentName as W,parseCodeLang as q,parseMarkdown as I}from"./utils.js";const K=({raw:t,components:n,...i})=>{const l={replace(t){if(t instanceof o&&t.data){const{headings:r,tokens:o}=I(t.data);return e.createElement(O,{headings:r,tokens:o,components:n,subtree:!0,...i})}if(!("name"in t))return e.createElement(e.Fragment,null);if(!W(t.name))return t;if(!n||!(t.name in n))return console.warn(`Unknown component: "${t.name}"`),e.createElement(e.Fragment,null);const r="attribs"in t?a(t.attribs):{},m=n[t.name],c="children"in t?t.children:null;return e.createElement(m,{...r},c?s(c,l):null)},htmlparser2:{lowerCaseTags:!1,lowerCaseAttributeNames:!1}};return r(t,l)},O=({pathname:r,components:o,uri:a,targetProvider:s,tokens:I,headings:O,config:R={},subtree:S,pages:z})=>{const{publicDirs:B}=R;let G=null,H={};const J=[],L=({token:I})=>{if(!I)return null;if(N(I,H)){const t=H;H={};const n=Object.keys(t).sort().join("-"),r=J.includes(n);return r||J.push(n),e.createElement(e.Fragment,null,e.createElement(A,{tabsData:t,insertStyles:!r,blockKey:n}),e.createElement(L,{token:I}))}if(G){if(Array.isArray(I)||"html"!==I.type||"\x3c!---/robin--\x3e"!==I.raw.trim())return"dummy"===G.type||(Array.isArray(I)?G.childTokens.push(...I):G.childTokens.push(I)),null;{if("dummy"===G.type)return G=null,null;const{componentName:t,childTokens:n,props:r}=G,a=o[t];return G=null,e.createElement(a,{...r},e.createElement(L,{token:n}))}}if(Array.isArray(I))return I.map(((t,n)=>e.createElement(L,{token:t,key:t.raw||n})));switch(I.type){case"heading":const A=`h${I.depth}`,N=O.find((e=>e.token===I));return N?.id?e.createElement(l,{component:A,id:N.id},I.tokens?e.createElement(L,{token:I.tokens}):I.raw):e.createElement($,{component:A,id:1===I.depth?"main-content":void 0},I.tokens?e.createElement(L,{token:I.tokens}):I.raw);case"table":return e.createElement(x,null,e.createElement(c,null,e.createElement(k,null,e.createElement(f,null,I.header.map(((t,n)=>e.createElement(d,{key:t.text+n},t.tokens?e.createElement(L,{token:t.tokens}):t.text))))),e.createElement(u,null,I.rows.map(((t,n)=>e.createElement(f,{key:n},t.map(((t,n)=>e.createElement(p,{key:t.text+n},t.tokens?e.createElement(L,{token:t.tokens}):t.text)))))))));case"link":let J=I.href;const M=/^(https?:\/\/|\/)/.test(I.href);if(z&&!M){const e=z.find((e=>e.clientPath===r));if(e){const r=t(n(e.origPath),I.href).replace(/\\/g,"/"),o=z.find((e=>e.origPath===r));o&&(J=o?.clientPath)}}return e.createElement(i,{href:J,external:M},I.tokens?e.createElement(L,{token:I.tokens}):I.raw);case"space":return null;case"hr":return e.createElement(v,null);case"image":return e.createElement(E,{src:I.href,publicDirs:B,provider:s,uri:a,alt:I.title||""});case"paragraph":return S?I.tokens?e.createElement(L,{token:I.tokens}):I.raw:I.tokens?.some((e=>"html"===e.type))&&I.tokens?.every((e=>"html"===e.type||"\n"===e.raw))?e.createElement(L,{token:{...I,type:"html"}}):e.createElement(y,null,I.tokens?e.createElement(L,{token:I.tokens}):I.raw);case"strong":return e.createElement(b,null,I.tokens?e.createElement(L,{token:I.tokens}):I.raw);case"del":return e.createElement(g,null,I.tokens?e.createElement(L,{token:I.tokens}):I.raw);case"em":return e.createElement(j,null,I.tokens?e.createElement(L,{token:I.tokens}):I.raw);case"blockquote":return e.createElement(w,null,I.tokens?e.createElement(L,{token:I.tokens}):I.raw);case"codespan":return e.createElement(h,null,I.raw.replace(/^`|`$/g,""));case"code":const{lang:Q,configuration:V}=q(I.lang);if(V.switcher){const t="string"==typeof V.tab?V.tab:Q;return H[t]=e.createElement(m,{lang:Q,code:I.text,...V}),null}return e.createElement(m,{lang:Q,code:I.text,...V});case"escape":return I.text;case"list":if(I.items.every((e=>e.task))){const t=I.ordered?D:F;return e.createElement(t,{start:I.start},I.items.map(((t,n)=>e.createElement(U,{key:t.raw+n,defaultChecked:t.checked},t.tokens?e.createElement(L,{token:t.tokens}):t.raw))))}const X=I.ordered?T:C;return e.createElement(X,{start:I.start},I.items.map(((t,n)=>e.createElement(P,{key:t.raw+n},t.tokens?e.createElement(L,{token:t.tokens}):t.raw))));case"html":const Y=I.raw.trim();if(Y.startsWith("\x3c!---robin")&&Y.endsWith("--\x3e")){const t=Y.endsWith("/--\x3e"),n=Y.match(/<!---robin ([\w]+)/)?.[1];if(!n)return t||(G={type:"dummy"}),null;if(!W(n))return console.warn(`"${n}" is using incorrect casing. Use PascalCase for Robin components`),t||(G={type:"dummy"}),null;if(!o||!(n in o))return console.warn(`Unknown component: "${n}"`),t||(G={type:"dummy"}),null;const r=Y.split(/\r?\n/).slice(1,-1).reduce(((e,t)=>{const[n,r,o]=t.match(/^([\w]+)(?:="(.+)")?$/)||[];return n?(e[r]=o??!0,e):(console.warn(`Invalid component attribute: "${t}"`),e)}),{});if(t){const t=o[n];return e.createElement(t,{...r})}return G={props:r,componentName:n,childTokens:[],type:"base"},null}return e.createElement(K,{raw:I.raw,components:o,config:R,targetProvider:s,pathname:r,uri:a});case"text":return"tokens"in I?e.createElement(L,{token:I.tokens||[]}):I.raw;default:return!I.type&&"raw"in I?I.raw:(console.warn(`Unknown token ${I.type}`,I),null)}};return I.push({type:"text",raw:""}),e.createElement(L,{token:I})};export{O as Document,K as DocumentJSX};
|
|
2
2
|
//# sourceMappingURL=document.js.map
|