robindoc 0.0.0-experimental-6e5a594 → 0.0.0-experimental-dc26dca
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/lib/components/blocks/code-section/index.js +1 -1
- package/lib/components/blocks/code-section/index.js.map +1 -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/utils.d.ts.map +1 -1
- package/lib/components/elements/article/utils.js +1 -1
- package/lib/components/elements/article/utils.js.map +1 -1
- package/lib/styles.css +337 -332
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{CodeBlock as c}from"../../ui/code-block/index.js";import{CopyButton as t}from"../../ui/copy-button/index.js";import{CopyText as o}from"../../ui/copy-text/index.js";const r=({filename:r,code:a,...m})=>e.createElement("div",{className:"r-code-section"},r?e.createElement("div",{className:"r-code-section-header"},e.createElement(o,{className:"r-code-section-filename",text:r}),e.createElement(t,{raw:a})):e.createElement(t,{raw:a,className:"r-code-section-copy"}),e.createElement(c,{className:"r-code-section-block",code:a,...m}));export{r as CodeSection};
|
|
1
|
+
import e from"react";import{CodeBlock as c}from"../../ui/code-block/index.js";import{CopyButton as t}from"../../ui/copy-button/index.js";import{CopyText as o}from"../../ui/copy-text/index.js";const r=({filename:r,code:a,...m})=>e.createElement("div",{className:"r-code-section"},r?e.createElement("div",{className:"r-code-section-header"},e.createElement(o,{className:"r-code-section-filename",text:r}),e.createElement(t,{raw:a})):e.createElement(t,{raw:a,className:"r-code-section-copy"}),e.createElement(c,{className:"r-code-section-block"+(r?"":" _space-right"),code:a,...m}));export{r as CodeSection};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/code-section/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { CodeBlock, type CodeBlockProps } from \"@src/components/ui/code-block\";\nimport { CopyButton, type CopyButtonProps } from \"@src/components/ui/copy-button\";\nimport { CopyText, type CopyTextProps } from \"../../ui/copy-text\";\n\nimport \"./code-section.scss\";\n\nexport interface CodeSectionProps extends CodeBlockProps {\n filename?: string;\n translations?: CopyButtonProps[\"translations\"] & CopyTextProps[\"translations\"];\n}\n\nexport const CodeSection: React.FC<CodeSectionProps> = ({ filename, code, ...props }) => (\n <div className=\"r-code-section\">\n {filename ? (\n <div className=\"r-code-section-header\">\n <CopyText className=\"r-code-section-filename\" text={filename} />\n <CopyButton raw={code} />\n </div>\n ) : (\n <CopyButton raw={code} className=\"r-code-section-copy\" />\n )}\n <CodeBlock className
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/blocks/code-section/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { CodeBlock, type CodeBlockProps } from \"@src/components/ui/code-block\";\nimport { CopyButton, type CopyButtonProps } from \"@src/components/ui/copy-button\";\nimport { CopyText, type CopyTextProps } from \"../../ui/copy-text\";\n\nimport \"./code-section.scss\";\n\nexport interface CodeSectionProps extends CodeBlockProps {\n filename?: string;\n translations?: CopyButtonProps[\"translations\"] & CopyTextProps[\"translations\"];\n}\n\nexport const CodeSection: React.FC<CodeSectionProps> = ({ filename, code, ...props }) => (\n <div className=\"r-code-section\">\n {filename ? (\n <div className=\"r-code-section-header\">\n <CopyText className=\"r-code-section-filename\" text={filename} />\n <CopyButton raw={code} />\n </div>\n ) : (\n <CopyButton raw={code} className=\"r-code-section-copy\" />\n )}\n <CodeBlock className={`r-code-section-block${filename ? \"\" : \" _space-right\"}`} code={code} {...props} />\n </div>\n);\n"],"names":["CodeSection","filename","code","props","React","createElement","className","CopyText","text","CopyButton","raw","CodeBlock"],"mappings":"sMAYaA,EAA0C,EAAGC,WAAUC,UAASC,KACzEC,EAAAC,cAAA,MAAA,CAAKC,UAAU,kBACVL,EACGG,EAAAC,cAAA,MAAA,CAAKC,UAAU,yBACXF,EAAAC,cAACE,GAASD,UAAU,0BAA0BE,KAAMP,IACpDG,EAAAC,cAACI,GAAWC,IAAKR,KAGrBE,EAAAC,cAACI,EAAU,CAACC,IAAKR,EAAMI,UAAU,wBAErCF,EAAAC,cAACM,EAAS,CAACL,UAAW,wBAAuBL,EAAW,GAAK,iBAAmBC,KAAMA,KAAUC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../src/components/elements/article/document.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,YAAY,EAAE,qCAAiC;AAC7D,OAAO,EAAE,KAAK,UAAU,EAAmB,oCAAgC;AAE3E,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAQH,KAAK,UAAU,EAClB,MAAM,SAAS,CAAC;AAEjB,UAAU,gBAAiB,SAAQ,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,UAAU,CAAC;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA4ClD,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,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,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../src/components/elements/article/document.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,YAAY,EAAE,qCAAiC;AAC7D,OAAO,EAAE,KAAK,UAAU,EAAmB,oCAAgC;AAE3E,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAQH,KAAK,UAAU,EAClB,MAAM,SAAS,CAAC;AAEjB,UAAU,gBAAiB,SAAQ,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,UAAU,CAAC;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA4ClD,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,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,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA2T3C,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{AnchorHeading as e}from"../../blocks/anchor-heading/index.js";import{CodeSection as t}from"../../blocks/code-section/index.js";import{NavContentLink as n}from"../../blocks/nav-content-link/index.js";import{Block as r}from"../../ui/block/index.js";import{Blockquote as o}from"../../ui/blockquote/index.js";import{CodeBlock as a}from"../../ui/code-block/index.js";import{CodeSpan as s}from"../../ui/code-span/index.js";import{Del as i}from"../../ui/del/index.js";import{Em as l}from"../../ui/em/index.js";import{Heading as m}from"../../ui/heading/index.js";import{Hr as c}from"../../ui/hr/index.js";import{Img as u}from"../../ui/img/index.js";import{ListItem as p}from"../../ui/list/list-item/index.js";import{OrderedList as d}from"../../ui/list/ordered-list/index.js";import{UnorderedList as k}from"../../ui/list/unordered-list/index.js";import{Paragraph as f}from"../../ui/paragraph/index.js";import{Strong as
|
|
1
|
+
import{AnchorHeading as e}from"../../blocks/anchor-heading/index.js";import{CodeSection as t}from"../../blocks/code-section/index.js";import{NavContentLink as n}from"../../blocks/nav-content-link/index.js";import{Block as r}from"../../ui/block/index.js";import{Blockquote as o}from"../../ui/blockquote/index.js";import{CodeBlock as a}from"../../ui/code-block/index.js";import{CodeSpan as s}from"../../ui/code-span/index.js";import{Del as i}from"../../ui/del/index.js";import{Em as l}from"../../ui/em/index.js";import{Heading as m}from"../../ui/heading/index.js";import{Hr as c}from"../../ui/hr/index.js";import{Img as u}from"../../ui/img/index.js";import{ListItem as p}from"../../ui/list/list-item/index.js";import{OrderedList as d}from"../../ui/list/ordered-list/index.js";import{UnorderedList as k}from"../../ui/list/unordered-list/index.js";import{Paragraph as f}from"../../ui/paragraph/index.js";import{Strong as E}from"../../ui/strong/index.js";import{Table as h}from"../../ui/table/table/index.js";import{Tbody as x}from"../../ui/table/tbody/index.js";import{Td as y}from"../../ui/table/td/index.js";import{Th as b}from"../../ui/table/th/index.js";import{Thead as w}from"../../ui/table/thead/index.js";import{Tr as g}from"../../ui/table/tr/index.js";import{Tabs as j}from"../../ui/tabs/index.js";import{TaskListItem as $}from"../../ui/task-list/task-list-item/index.js";import{TaskOrderedList as v}from"../../ui/task-list/task-ordered-list/index.js";import{TaskUnorderedList as A}from"../../ui/task-list/task-unordered-list/index.js";import N,{Text as T,domToReact as C,attributesToProps as U}from"html-react-parser";import D from"react";import{isNewCodeToken as F,validateComponentName as P,parseCodeLang as S,formatId as W,parseBlockqoute as q,formatLinkHref as z,parseMarkdown as I}from"./utils.js";const K=({raw:e,components:t,...r})=>{const o={replace(e){if(e instanceof T&&e.data){const{headings:n,tokens:o}=I(e.data);return D.createElement(O,{headings:n,tokens:o,components:t,subtree:!0,...r})}if(!("name"in e))return D.createElement(D.Fragment,null);if("a"===e.name&&"attribs"in e){const{href:t,external:a}=z(e.attribs.href,r.pathname,r.pages);return""===t?C(e.children,o):D.createElement(n,{...U(e.attribs),href:t,external:a},C(e.children,o))}if(!P(e.name))return e;if(!t||!(e.name in t))return console.warn(`Unknown component: "${e.name}"`),D.createElement(D.Fragment,null);const a="attribs"in e?U(e.attribs):{},s=t[e.name],i="children"in e?e.children:null;return D.createElement(s,{...a},i?C(i,o):null)},htmlparser2:{lowerCaseTags:!1,lowerCaseAttributeNames:!1}};return N(e,o)},O=({pathname:N,components:T,uri:C,targetProvider:U,tokens:I,headings:O,config:R={},subtree:Z,pages:B})=>{const{publicDirs:G}=R;let H=null,J={};const L=[],M=({token:I})=>{if(!I)return null;if(F(I,J)){const e=J;J={};const t=Object.keys(e).sort().join("-"),n=L.includes(t);return n||L.push(t),D.createElement(D.Fragment,null,D.createElement(j,{type:"code",tabsData:e,insertStyles:!n,blockKey:t}),D.createElement(M,{token:I}))}if(H){if(Array.isArray(I)||"html"!==I.type||"\x3c!---/robin--\x3e"!==I.raw.trim())return"dummy"===H.type||(Array.isArray(I)?H.childTokens.push(...I):H.childTokens.push(I)),null;{if("dummy"===H.type)return H=null,null;const{componentName:e,childTokens:t,props:n}=H,r=T[e];return H=null,D.createElement(r,{...n},D.createElement(M,{token:t}))}}if(Array.isArray(I))return I.map((e,t)=>D.createElement(M,{token:e,key:e.raw+t}));switch(I.type){case"heading":const j=`h${I.depth}`,F=O.find(e=>e.token===I);return F?.id?D.createElement(e,{component:j,id:F.id},I.tokens?D.createElement(M,{token:I.tokens}):I.raw):D.createElement(m,{component:j,id:1===I.depth?"main-content":void 0},I.tokens?D.createElement(M,{token:I.tokens}):I.raw);case"table":return D.createElement(r,null,D.createElement(h,null,D.createElement(w,null,D.createElement(g,null,I.header.map((e,t)=>D.createElement(b,{key:e.text+t},e.tokens?D.createElement(M,{token:e.tokens}):e.text)))),D.createElement(x,null,I.rows.map((e,t)=>D.createElement(g,{key:t},e.map((e,t)=>D.createElement(y,{key:e.text+t},e.tokens?D.createElement(M,{token:e.tokens}):e.text)))))));case"link":const{href:L,external:Q}=z(I.href,N,B);return""===L?I.tokens?D.createElement(M,{token:I.tokens}):I.raw:D.createElement(n,{href:L,external:Q},I.tokens?D.createElement(M,{token:I.tokens}):I.raw);case"space":case"def":case"br":return null;case"hr":return D.createElement(c,null);case"image":return D.createElement(u,{src:I.href,publicDirs:G,provider:U,uri:C,alt:I.title||""});case"paragraph":return Z?I.tokens?D.createElement(M,{token:I.tokens}):I.raw:I.tokens?.some(e=>"html"===e.type)&&I.tokens?.every(e=>"html"===e.type||"text"===e.type||"\n"===e.raw)?D.createElement(M,{token:{...I,type:"html"}}):D.createElement(f,null,I.tokens?D.createElement(M,{token:I.tokens}):I.raw);case"strong":return D.createElement(E,null,I.tokens?D.createElement(M,{token:I.tokens}):I.raw);case"del":return D.createElement(i,null,I.tokens?D.createElement(M,{token:I.tokens}):I.raw);case"em":return D.createElement(l,null,I.tokens?D.createElement(M,{token:I.tokens}):I.raw);case"blockquote":const{token:V,type:X}=q(I);return D.createElement(o,{type:X},V.tokens?D.createElement(M,{token:V.tokens}):V.raw);case"codespan":const Y=I.raw.replace(/^`|`$/g,""),_=Y.match(/(.+){:([a-zA-Z]+)}$/);if(_){const[,e,t]=_;return D.createElement(a,{code:e,lang:t,inline:!0})}return D.createElement(s,{code:Y});case"code":const{lang:ee,configuration:te}=S(I.lang);if(te.switcher&&ee){const e="string"==typeof te.tab?W(te.tab):ee;if(J[e]={tabName:(te.tab||ee).toString(),element:D.createElement(t,{lang:ee,code:I.text,...te})},"string"==typeof te.clone){te.clone.split(",").forEach(e=>{const[n,r,o]=e.split("|"),a="string"==typeof r?W(r):n;J[a]={tabName:(r||n).toString(),element:D.createElement(t,{lang:n,code:I.text,...te,filename:o||te.filename})}})}return null}return D.createElement(t,{lang:ee,code:I.text,...te});case"escape":return I.text;case"list":if(I.items.every(e=>e.task)){const e=I.ordered?v:A;return D.createElement(e,{start:I.start},I.items.map((e,t)=>D.createElement($,{key:e.raw+t,defaultChecked:e.checked},e.tokens?D.createElement(M,{token:e.tokens}):e.raw)))}const ne=I.ordered?d:k;return D.createElement(ne,{start:I.start},I.items.map((e,t)=>D.createElement(p,{key:e.raw+t},e.tokens?D.createElement(M,{token:e.tokens}):e.raw)));case"html":const re=I.raw.trim();if(re.startsWith("\x3c!---robin")&&re.endsWith("--\x3e")){const e=re.endsWith("/--\x3e"),t=re.match(/<!---robin ([\w]+)/)?.[1];if(!t)return e||(H={type:"dummy"}),null;if(!P(t))return console.warn(`"${t}" is using incorrect casing. Use PascalCase for Robin components`),e||(H={type:"dummy"}),null;if(!T||!(t in T))return console.warn(`Unknown component: "${t}"`),e||(H={type:"dummy"}),null;const n=re.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(e){const e=T[t];return D.createElement(e,{...n})}return H={props:n,componentName:t,childTokens:[],type:"base"},null}return D.createElement(K,{raw:I.raw,components:T,config:R,targetProvider:U,pathname:N,uri:C,pages:B});case"text":return"tokens"in I?D.createElement(M,{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:""}),D.createElement(M,{token:I})};export{O as Document,K as DocumentJSX};
|
|
2
2
|
//# sourceMappingURL=document.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sources":["../../../../src/components/elements/article/document.tsx"],"sourcesContent":["import { AnchorHeading } from \"@src/components/blocks/anchor-heading\";\nimport { CodeSection } from \"@src/components/blocks/code-section\";\nimport { NavContentLink } from \"@src/components/blocks/nav-content-link\";\nimport { Block } from \"@src/components/ui/block\";\nimport { Blockquote } from \"@src/components/ui/blockquote\";\nimport { CodeBlock } from \"@src/components/ui/code-block\";\nimport { CodeSpan } from \"@src/components/ui/code-span\";\nimport { Del } from \"@src/components/ui/del\";\nimport { Em } from \"@src/components/ui/em\";\nimport { Heading } from \"@src/components/ui/heading\";\nimport { Hr } from \"@src/components/ui/hr\";\nimport { Img } from \"@src/components/ui/img\";\nimport { ListItem, OrderedList, UnorderedList } from \"@src/components/ui/list\";\nimport { Paragraph } from \"@src/components/ui/paragraph\";\nimport { Strong } from \"@src/components/ui/strong\";\nimport { Table, Tbody, Td, Th, Thead, Tr } from \"@src/components/ui/table\";\nimport { Tabs } from \"@src/components/ui/tabs\";\nimport { TaskListItem, TaskOrderedList, TaskUnorderedList } from \"@src/components/ui/task-list\";\nimport { type BaseProvider } from \"@src/core/providers/base\";\nimport { type Components, type RobinProps } from \"@src/core/types/content\";\nimport parse, { attributesToProps, DOMNode, domToReact, HTMLReactParserOptions, Text } from \"html-react-parser\";\nimport { type Token, type Tokens, type TokensList } from \"marked\";\nimport React from \"react\";\nimport { type BundledLanguage } from \"shiki\";\n\nimport { type PagesType } from \"./types\";\nimport {\n formatId,\n formatLinkHref,\n isNewCodeToken,\n parseBlockqoute,\n parseCodeLang,\n parseMarkdown,\n validateComponentName,\n type AnchorData,\n} from \"./utils\";\n\ninterface DocumentJSXProps extends Omit<ContentProps, \"tokens\" | \"headings\"> {\n raw: string;\n pages?: PagesType;\n}\n\nexport const DocumentJSX: React.FC<DocumentJSXProps> = ({ raw, components, ...baseProps }) => {\n const parseOptions: HTMLReactParserOptions = {\n replace(domNode) {\n if (domNode instanceof Text && domNode.data) {\n const { headings, tokens } = parseMarkdown(domNode.data);\n\n return <Document headings={headings} tokens={tokens} components={components} subtree {...baseProps} />;\n }\n\n if (!(\"name\" in domNode)) return <></>;\n\n if (domNode.name === \"a\" && \"attribs\" in domNode) {\n const { href, external } = formatLinkHref(domNode.attribs.href, baseProps.pathname, baseProps.pages);\n\n if (href === \"\") return domToReact(domNode.children as DOMNode[], parseOptions);\n\n return (\n <NavContentLink {...attributesToProps(domNode.attribs)} href={href} external={external}>\n {domToReact(domNode.children as DOMNode[], parseOptions)}\n </NavContentLink>\n );\n }\n\n if (!validateComponentName(domNode.name)) return domNode;\n\n if (!components || !(domNode.name in components)) {\n console.warn(`Unknown component: \"${domNode.name}\"`);\n return <></>;\n }\n\n const props = \"attribs\" in domNode ? attributesToProps(domNode.attribs) : {};\n const Component = components[domNode.name];\n const children = \"children\" in domNode ? domNode.children : null;\n\n return (\n <Component {...props}>{children ? domToReact(children as DOMNode[], parseOptions) : null}</Component>\n );\n },\n htmlparser2: {\n lowerCaseTags: false,\n lowerCaseAttributeNames: false,\n },\n };\n return parse(raw, parseOptions);\n};\n\nexport type ContentProps = {\n pathname: string;\n components?: Components;\n config?: {\n publicDirs?: string[];\n };\n uri?: string;\n targetProvider?: BaseProvider | null;\n tokens: TokensList;\n headings: AnchorData[];\n subtree?: boolean;\n pages?: PagesType;\n};\n\nexport const Document: React.FC<ContentProps> = ({\n pathname,\n components,\n uri,\n targetProvider,\n tokens,\n headings,\n config = {},\n subtree,\n pages,\n}) => {\n const { publicDirs } = config;\n\n let robin:\n | null\n | { props: RobinProps; childTokens: Token[]; componentName: string; type: \"base\" }\n | { type: \"dummy\" } = null;\n let codeQueue: { [lang: string]: { element: React.ReactNode; tabName: string } } = {};\n const insertedCodeKeys: string[] = [];\n const DocumentToken: React.FC<{ token: Token | Token[] }> = ({ token }) => {\n if (!token) return null;\n\n if (isNewCodeToken(token, codeQueue)) {\n const tabsData = codeQueue;\n codeQueue = {};\n const tabsKey = Object.keys(tabsData).sort().join(\"-\");\n const isInsertedKey = insertedCodeKeys.includes(tabsKey);\n if (!isInsertedKey) insertedCodeKeys.push(tabsKey);\n\n return (\n <>\n <Tabs type=\"code\" tabsData={tabsData} insertStyles={!isInsertedKey} blockKey={tabsKey} />\n <DocumentToken token={token} />\n </>\n );\n }\n\n if (robin) {\n if (!Array.isArray(token) && token.type === \"html\" && token.raw.trim() === \"<!---/robin-->\") {\n if (robin.type === \"dummy\") {\n robin = null;\n return null;\n }\n\n const { componentName, childTokens, props } = robin;\n const RobinComponent = components![componentName];\n robin = null;\n return (\n <RobinComponent {...props}>\n <DocumentToken token={childTokens} />\n </RobinComponent>\n );\n } else {\n if (robin.type === \"dummy\") return null;\n\n if (Array.isArray(token)) {\n robin.childTokens.push(...token);\n } else {\n robin.childTokens.push(token);\n }\n return null;\n }\n }\n\n if (Array.isArray(token)) {\n return token.map((t, index) => <DocumentToken token={t} key={(t as Tokens.Text).raw + index} />);\n }\n\n switch (token.type) {\n case \"heading\":\n const Component = `h${token.depth}` as \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n const predefinedData = headings.find((heading) => heading.token === token);\n if (predefinedData?.id) {\n return (\n <AnchorHeading component={Component} id={predefinedData.id}>\n {token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}\n </AnchorHeading>\n );\n } else {\n return (\n <Heading component={Component} id={token.depth === 1 ? \"main-content\" : undefined}>\n {token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}\n </Heading>\n );\n }\n case \"table\":\n return (\n <Block>\n <Table>\n <Thead>\n <Tr>\n {token.header.map((t: Tokens.Text, index: number) => (\n <Th key={t.text + index}>\n {t.tokens ? <DocumentToken token={t.tokens} /> : t.text}\n </Th>\n ))}\n </Tr>\n </Thead>\n <Tbody>\n {token.rows.map((row: Tokens.Text[], rowIndex: number) => (\n <Tr key={rowIndex}>\n {row.map((elem, elemIndex) => (\n <Td key={elem.text + elemIndex}>\n {elem.tokens ? <DocumentToken token={elem.tokens} /> : elem.text}\n </Td>\n ))}\n </Tr>\n ))}\n </Tbody>\n </Table>\n </Block>\n );\n case \"link\":\n const { href, external } = formatLinkHref(token.href, pathname, pages);\n\n if (href === \"\") return token.tokens ? <DocumentToken token={token.tokens} /> : token.raw;\n\n return (\n <NavContentLink href={href} external={external}>\n {token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}\n </NavContentLink>\n );\n case \"space\":\n return null;\n case \"hr\":\n return <Hr />;\n case \"image\":\n return (\n <Img\n src={token.href}\n publicDirs={publicDirs}\n provider={targetProvider}\n uri={uri}\n alt={token.title || \"\"}\n />\n );\n case \"paragraph\":\n if (subtree) return token.tokens ? <DocumentToken token={token.tokens} /> : token.raw;\n if (\n token.tokens?.some((t) => t.type === \"html\") &&\n token.tokens?.every((t) => t.type === \"html\" || t.type === \"text\" || t.raw === \"\\n\")\n ) {\n return <DocumentToken token={{ ...token, type: \"html\" }} />;\n }\n\n return <Paragraph>{token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}</Paragraph>;\n case \"strong\":\n return <Strong>{token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}</Strong>;\n case \"del\":\n return <Del>{token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}</Del>;\n case \"em\":\n return <Em>{token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}</Em>;\n case \"blockquote\":\n const { token: blockquoteToken, type } = parseBlockqoute(token);\n\n return (\n <Blockquote type={type}>\n {blockquoteToken.tokens ? (\n <DocumentToken token={blockquoteToken.tokens} />\n ) : (\n blockquoteToken.raw\n )}\n </Blockquote>\n );\n case \"codespan\":\n const inlineCode = token.raw.replace(/^`|`$/g, \"\");\n const hightlightMatch = inlineCode.match(/(.+){:([a-zA-Z]+)}$/);\n if (hightlightMatch) {\n const [, raw, lang] = hightlightMatch;\n return <CodeBlock code={raw} lang={lang as BundledLanguage} inline />;\n }\n\n return <CodeSpan code={inlineCode} />;\n case \"code\":\n const { lang, configuration } = parseCodeLang(token.lang);\n if (configuration.switcher && lang) {\n const tabKey = typeof configuration.tab === \"string\" ? formatId(configuration.tab) : lang;\n codeQueue[tabKey] = {\n tabName: (configuration.tab || lang).toString(),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n element: <CodeSection lang={lang as any} code={token.text} {...configuration} />,\n };\n\n if (typeof configuration.clone === \"string\") {\n const copies = configuration.clone.split(\",\");\n\n copies.forEach((copy) => {\n const [copyLang, copyTab, copyFileName] = copy.split(\"|\");\n const copyTabKey = typeof copyTab === \"string\" ? formatId(copyTab) : copyLang;\n\n codeQueue[copyTabKey] = {\n tabName: (copyTab || copyLang).toString(),\n element: (\n <CodeSection\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n lang={copyLang as any}\n code={token.text}\n {...configuration}\n filename={copyFileName || (configuration.filename as string)}\n />\n ),\n };\n });\n }\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return <CodeSection lang={lang as any} code={token.text} {...configuration} />;\n case \"escape\":\n return token.text;\n case \"list\":\n const isTaskList = token.items.every((i: Tokens.ListItem) => i.task);\n if (isTaskList) {\n const ListComponent = token.ordered ? TaskOrderedList : TaskUnorderedList;\n return (\n <ListComponent start={token.start}>\n {token.items.map((elem: Tokens.ListItem, index: number) => {\n const childTokens =\n elem.tokens?.length === 1 && elem.tokens[0].type === \"paragraph\"\n ? elem.tokens[0].tokens\n : elem.tokens;\n\n return (\n <TaskListItem key={elem.raw + index} defaultChecked={elem.checked}>\n {childTokens ? <DocumentToken token={childTokens} /> : elem.raw}\n </TaskListItem>\n );\n })}\n </ListComponent>\n );\n }\n\n const ListComponent = token.ordered ? OrderedList : UnorderedList;\n return (\n <ListComponent start={token.start}>\n {token.items.map((elem: Tokens.ListItem, index: number) => {\n const childTokens =\n elem.tokens?.length === 1 && elem.tokens[0].type === \"paragraph\"\n ? elem.tokens[0].tokens\n : elem.tokens;\n return (\n <ListItem key={elem.raw + index}>\n {childTokens ? <DocumentToken token={childTokens} /> : elem.raw}\n </ListItem>\n );\n })}\n </ListComponent>\n );\n case \"html\":\n const text = token.raw.trim();\n\n if (text.startsWith(\"<!---robin\") && text.endsWith(\"-->\")) {\n const selfClosed = text.endsWith(\"/-->\");\n const componentName = text.match(/<!---robin ([\\w]+)/)?.[1];\n\n if (!componentName) {\n if (!selfClosed) robin = { type: \"dummy\" };\n return null;\n }\n\n if (!validateComponentName(componentName)) {\n console.warn(\n `\"${componentName}\" is using incorrect casing. Use PascalCase for Robin components`,\n );\n if (!selfClosed) robin = { type: \"dummy\" };\n return null;\n }\n\n if (!components || !(componentName in components)) {\n console.warn(`Unknown component: \"${componentName}\"`);\n if (!selfClosed) robin = { type: \"dummy\" };\n return null;\n }\n const propRows = text.split(/\\r?\\n/).slice(1, -1);\n const props = propRows.reduce<{ [key: string]: string | true }>((acc, cur) => {\n const [_match, key, value] = cur.match(/^([\\w]+)(?:=\"(.+)\")?$/) || [];\n\n if (!_match) {\n console.warn(`Invalid component attribute: \"${cur}\"`);\n return acc;\n }\n\n acc[key] = value ?? true;\n return acc;\n }, {});\n\n if (selfClosed) {\n const Component = components[componentName as keyof typeof components];\n return <Component {...props} />;\n }\n\n robin = { props, componentName, childTokens: [], type: \"base\" };\n return null;\n }\n\n return (\n <DocumentJSX\n raw={token.raw}\n components={components}\n config={config}\n targetProvider={targetProvider}\n pathname={pathname}\n uri={uri}\n pages={pages}\n />\n );\n case \"text\":\n if (\"tokens\" in token) {\n return <DocumentToken token={token.tokens || []} />;\n }\n return token.raw;\n // Definitions should not be rendered, they are used only as comments or meta data\n case \"def\":\n return null;\n // br are inserted between elements. In our case, sufficient indentation is set everywhere, so we ignore them\n case \"br\":\n return null;\n default:\n if (!token.type && \"raw\" in token) return token.raw;\n\n console.warn(`Unknown token ${token.type}`, token);\n return null;\n }\n };\n\n tokens.push({ type: \"text\", raw: \"\" });\n return <DocumentToken token={tokens} />;\n};\n"],"names":["DocumentJSX","raw","components","baseProps","parseOptions","replace","domNode","Text","data","headings","tokens","parseMarkdown","React","Document","subtree","name","href","external","formatLinkHref","attribs","pathname","pages","domToReact","children","createElement","NavContentLink","attributesToProps","validateComponentName","console","warn","props","Component","htmlparser2","lowerCaseTags","lowerCaseAttributeNames","parse","uri","targetProvider","config","publicDirs","robin","codeQueue","insertedCodeKeys","DocumentToken","token","isNewCodeToken","tabsData","tabsKey","Object","keys","sort","join","isInsertedKey","includes","push","Fragment","Tabs","type","insertStyles","blockKey","Array","isArray","trim","childTokens","componentName","RobinComponent","map","t","index","key","depth","predefinedData","find","heading","id","AnchorHeading","component","Heading","undefined","Block","Table","Thead","Tr","header","Th","text","Tbody","rows","row","rowIndex","elem","elemIndex","Td","Hr","Img","src","provider","alt","title","some","every","Paragraph","Strong","Del","Em","blockquoteToken","parseBlockqoute","Blockquote","inlineCode","hightlightMatch","match","lang","CodeBlock","code","inline","CodeSpan","configuration","parseCodeLang","switcher","tabKey","tab","formatId","tabName","toString","element","CodeSection","clone","split","forEach","copy","copyLang","copyTab","copyFileName","copyTabKey","filename","items","i","task","ListComponent","ordered","TaskOrderedList","TaskUnorderedList","start","length","TaskListItem","defaultChecked","checked","OrderedList","UnorderedList","ListItem","startsWith","endsWith","selfClosed","slice","reduce","acc","cur","_match","value"],"mappings":"gxDA0CO,MAAMA,EAA0C,EAAGC,MAAKC,gBAAeC,MAC1E,MAAMC,EAAuC,CACzC,OAAAC,CAAQC,GACJ,GAAIA,aAAmBC,GAAQD,EAAQE,KAAM,CACzC,MAAMC,SAAEA,EAAQC,OAAEA,GAAWC,EAAcL,EAAQE,MAEnD,OAAOI,gBAACC,EAAQ,CAACJ,SAAUA,EAAUC,OAAQA,EAAQR,WAAYA,EAAYY,SAAO,KAAKX,GAC7F,CAEA,KAAM,SAAUG,GAAU,OAAOM,iCAEjC,GAAqB,MAAjBN,EAAQS,MAAgB,YAAaT,EAAS,CAC9C,MAAMU,KAAEA,EAAIC,SAAEA,G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D,IACX,CAEA,OACI7C,EAAAY,cAACxB,EAAW,CACRC,IAAK2C,EAAM3C,IACXC,WAAYA,EACZoC,OAAQA,EACRD,eAAgBA,EAChBjB,SAAUA,EACVgB,IAAKA,EACLf,MAAOA,IAGnB,IAAK,OACD,MAAI,WAAYuB,EACLhC,EAAAY,cAACmB,EAAa,CAACC,MAAOA,EAAMlC,QAAU,KAE1CkC,EAAM3C,IAOjB,QACI,OAAK2C,EAAMa,MAAQ,QAASb,EAAcA,EAAM3C,KAEhD2B,QAAQC,KAAK,iBAAiBe,EAAMa,OAAQb,GACrC,QAKnB,OADAlC,EAAO4C,KAAK,CAAEG,KAAM,OAAQxD,IAAK,KAC1BW,gBAAC+B,EAAa,CAACC,MAAOlC"}
|
|
1
|
+
{"version":3,"file":"document.js","sources":["../../../../src/components/elements/article/document.tsx"],"sourcesContent":["import { AnchorHeading } from \"@src/components/blocks/anchor-heading\";\nimport { CodeSection } from \"@src/components/blocks/code-section\";\nimport { NavContentLink } from \"@src/components/blocks/nav-content-link\";\nimport { Block } from \"@src/components/ui/block\";\nimport { Blockquote } from \"@src/components/ui/blockquote\";\nimport { CodeBlock } from \"@src/components/ui/code-block\";\nimport { CodeSpan } from \"@src/components/ui/code-span\";\nimport { Del } from \"@src/components/ui/del\";\nimport { Em } from \"@src/components/ui/em\";\nimport { Heading } from \"@src/components/ui/heading\";\nimport { Hr } from \"@src/components/ui/hr\";\nimport { Img } from \"@src/components/ui/img\";\nimport { ListItem, OrderedList, UnorderedList } from \"@src/components/ui/list\";\nimport { Paragraph } from \"@src/components/ui/paragraph\";\nimport { Strong } from \"@src/components/ui/strong\";\nimport { Table, Tbody, Td, Th, Thead, Tr } from \"@src/components/ui/table\";\nimport { Tabs } from \"@src/components/ui/tabs\";\nimport { TaskListItem, TaskOrderedList, TaskUnorderedList } from \"@src/components/ui/task-list\";\nimport { type BaseProvider } from \"@src/core/providers/base\";\nimport { type Components, type RobinProps } from \"@src/core/types/content\";\nimport parse, { attributesToProps, DOMNode, domToReact, HTMLReactParserOptions, Text } from \"html-react-parser\";\nimport { type Token, type Tokens, type TokensList } from \"marked\";\nimport React from \"react\";\nimport { type BundledLanguage } from \"shiki\";\n\nimport { type PagesType } from \"./types\";\nimport {\n formatId,\n formatLinkHref,\n isNewCodeToken,\n parseBlockqoute,\n parseCodeLang,\n parseMarkdown,\n validateComponentName,\n type AnchorData,\n} from \"./utils\";\n\ninterface DocumentJSXProps extends Omit<ContentProps, \"tokens\" | \"headings\"> {\n raw: string;\n pages?: PagesType;\n}\n\nexport const DocumentJSX: React.FC<DocumentJSXProps> = ({ raw, components, ...baseProps }) => {\n const parseOptions: HTMLReactParserOptions = {\n replace(domNode) {\n if (domNode instanceof Text && domNode.data) {\n const { headings, tokens } = parseMarkdown(domNode.data);\n\n return <Document headings={headings} tokens={tokens} components={components} subtree {...baseProps} />;\n }\n\n if (!(\"name\" in domNode)) return <></>;\n\n if (domNode.name === \"a\" && \"attribs\" in domNode) {\n const { href, external } = formatLinkHref(domNode.attribs.href, baseProps.pathname, baseProps.pages);\n\n if (href === \"\") return domToReact(domNode.children as DOMNode[], parseOptions);\n\n return (\n <NavContentLink {...attributesToProps(domNode.attribs)} href={href} external={external}>\n {domToReact(domNode.children as DOMNode[], parseOptions)}\n </NavContentLink>\n );\n }\n\n if (!validateComponentName(domNode.name)) return domNode;\n\n if (!components || !(domNode.name in components)) {\n console.warn(`Unknown component: \"${domNode.name}\"`);\n return <></>;\n }\n\n const props = \"attribs\" in domNode ? attributesToProps(domNode.attribs) : {};\n const Component = components[domNode.name];\n const children = \"children\" in domNode ? domNode.children : null;\n\n return (\n <Component {...props}>{children ? domToReact(children as DOMNode[], parseOptions) : null}</Component>\n );\n },\n htmlparser2: {\n lowerCaseTags: false,\n lowerCaseAttributeNames: false,\n },\n };\n return parse(raw, parseOptions);\n};\n\nexport type ContentProps = {\n pathname: string;\n components?: Components;\n config?: {\n publicDirs?: string[];\n };\n uri?: string;\n targetProvider?: BaseProvider | null;\n tokens: TokensList;\n headings: AnchorData[];\n subtree?: boolean;\n pages?: PagesType;\n};\n\nexport const Document: React.FC<ContentProps> = ({\n pathname,\n components,\n uri,\n targetProvider,\n tokens,\n headings,\n config = {},\n subtree,\n pages,\n}) => {\n const { publicDirs } = config;\n\n let robin:\n | null\n | { props: RobinProps; childTokens: Token[]; componentName: string; type: \"base\" }\n | { type: \"dummy\" } = null;\n let codeQueue: { [lang: string]: { element: React.ReactNode; tabName: string } } = {};\n const insertedCodeKeys: string[] = [];\n const DocumentToken: React.FC<{ token: Token | Token[] }> = ({ token }) => {\n if (!token) return null;\n\n if (isNewCodeToken(token, codeQueue)) {\n const tabsData = codeQueue;\n codeQueue = {};\n const tabsKey = Object.keys(tabsData).sort().join(\"-\");\n const isInsertedKey = insertedCodeKeys.includes(tabsKey);\n if (!isInsertedKey) insertedCodeKeys.push(tabsKey);\n\n return (\n <>\n <Tabs type=\"code\" tabsData={tabsData} insertStyles={!isInsertedKey} blockKey={tabsKey} />\n <DocumentToken token={token} />\n </>\n );\n }\n\n if (robin) {\n if (!Array.isArray(token) && token.type === \"html\" && token.raw.trim() === \"<!---/robin-->\") {\n if (robin.type === \"dummy\") {\n robin = null;\n return null;\n }\n\n const { componentName, childTokens, props } = robin;\n const RobinComponent = components![componentName];\n robin = null;\n return (\n <RobinComponent {...props}>\n <DocumentToken token={childTokens} />\n </RobinComponent>\n );\n } else {\n if (robin.type === \"dummy\") return null;\n\n if (Array.isArray(token)) {\n robin.childTokens.push(...token);\n } else {\n robin.childTokens.push(token);\n }\n return null;\n }\n }\n\n if (Array.isArray(token)) {\n return token.map((t, index) => <DocumentToken token={t} key={(t as Tokens.Text).raw + index} />);\n }\n\n switch (token.type) {\n case \"heading\":\n const Component = `h${token.depth}` as \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n const predefinedData = headings.find((heading) => heading.token === token);\n if (predefinedData?.id) {\n return (\n <AnchorHeading component={Component} id={predefinedData.id}>\n {token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}\n </AnchorHeading>\n );\n } else {\n return (\n <Heading component={Component} id={token.depth === 1 ? \"main-content\" : undefined}>\n {token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}\n </Heading>\n );\n }\n case \"table\":\n return (\n <Block>\n <Table>\n <Thead>\n <Tr>\n {token.header.map((t: Tokens.Text, index: number) => (\n <Th key={t.text + index}>\n {t.tokens ? <DocumentToken token={t.tokens} /> : t.text}\n </Th>\n ))}\n </Tr>\n </Thead>\n <Tbody>\n {token.rows.map((row: Tokens.Text[], rowIndex: number) => (\n <Tr key={rowIndex}>\n {row.map((elem, elemIndex) => (\n <Td key={elem.text + elemIndex}>\n {elem.tokens ? <DocumentToken token={elem.tokens} /> : elem.text}\n </Td>\n ))}\n </Tr>\n ))}\n </Tbody>\n </Table>\n </Block>\n );\n case \"link\":\n const { href, external } = formatLinkHref(token.href, pathname, pages);\n\n if (href === \"\") return token.tokens ? <DocumentToken token={token.tokens} /> : token.raw;\n\n return (\n <NavContentLink href={href} external={external}>\n {token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}\n </NavContentLink>\n );\n case \"space\":\n return null;\n case \"hr\":\n return <Hr />;\n case \"image\":\n return (\n <Img\n src={token.href}\n publicDirs={publicDirs}\n provider={targetProvider}\n uri={uri}\n alt={token.title || \"\"}\n />\n );\n case \"paragraph\":\n if (subtree) return token.tokens ? <DocumentToken token={token.tokens} /> : token.raw;\n if (\n token.tokens?.some((t) => t.type === \"html\") &&\n token.tokens?.every((t) => t.type === \"html\" || t.type === \"text\" || t.raw === \"\\n\")\n ) {\n return <DocumentToken token={{ ...token, type: \"html\" }} />;\n }\n\n return <Paragraph>{token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}</Paragraph>;\n case \"strong\":\n return <Strong>{token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}</Strong>;\n case \"del\":\n return <Del>{token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}</Del>;\n case \"em\":\n return <Em>{token.tokens ? <DocumentToken token={token.tokens} /> : token.raw}</Em>;\n case \"blockquote\":\n const { token: blockquoteToken, type } = parseBlockqoute(token);\n\n return (\n <Blockquote type={type}>\n {blockquoteToken.tokens ? (\n <DocumentToken token={blockquoteToken.tokens} />\n ) : (\n blockquoteToken.raw\n )}\n </Blockquote>\n );\n case \"codespan\":\n const inlineCode = token.raw.replace(/^`|`$/g, \"\");\n const hightlightMatch = inlineCode.match(/(.+){:([a-zA-Z]+)}$/);\n if (hightlightMatch) {\n const [, raw, lang] = hightlightMatch;\n return <CodeBlock code={raw} lang={lang as BundledLanguage} inline />;\n }\n\n return <CodeSpan code={inlineCode} />;\n case \"code\":\n const { lang, configuration } = parseCodeLang(token.lang);\n if (configuration.switcher && lang) {\n const tabKey = typeof configuration.tab === \"string\" ? formatId(configuration.tab) : lang;\n codeQueue[tabKey] = {\n tabName: (configuration.tab || lang).toString(),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n element: <CodeSection lang={lang as any} code={token.text} {...configuration} />,\n };\n\n if (typeof configuration.clone === \"string\") {\n const copies = configuration.clone.split(\",\");\n\n copies.forEach((copy) => {\n const [copyLang, copyTab, copyFileName] = copy.split(\"|\");\n const copyTabKey = typeof copyTab === \"string\" ? formatId(copyTab) : copyLang;\n\n codeQueue[copyTabKey] = {\n tabName: (copyTab || copyLang).toString(),\n element: (\n <CodeSection\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n lang={copyLang as any}\n code={token.text}\n {...configuration}\n filename={copyFileName || (configuration.filename as string)}\n />\n ),\n };\n });\n }\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return <CodeSection lang={lang as any} code={token.text} {...configuration} />;\n case \"escape\":\n return token.text;\n case \"list\":\n const isTaskList = token.items.every((i: Tokens.ListItem) => i.task);\n if (isTaskList) {\n const ListComponent = token.ordered ? TaskOrderedList : TaskUnorderedList;\n return (\n <ListComponent start={token.start}>\n {token.items.map((elem: Tokens.ListItem, index: number) => (\n <TaskListItem key={elem.raw + index} defaultChecked={elem.checked}>\n {elem.tokens ? <DocumentToken token={elem.tokens} /> : elem.raw}\n </TaskListItem>\n ))}\n </ListComponent>\n );\n }\n\n const ListComponent = token.ordered ? OrderedList : UnorderedList;\n return (\n <ListComponent start={token.start}>\n {token.items.map((elem: Tokens.ListItem, index: number) => (\n <ListItem key={elem.raw + index}>\n {elem.tokens ? <DocumentToken token={elem.tokens} /> : elem.raw}\n </ListItem>\n ))}\n </ListComponent>\n );\n case \"html\":\n const text = token.raw.trim();\n\n if (text.startsWith(\"<!---robin\") && text.endsWith(\"-->\")) {\n const selfClosed = text.endsWith(\"/-->\");\n const componentName = text.match(/<!---robin ([\\w]+)/)?.[1];\n\n if (!componentName) {\n if (!selfClosed) robin = { type: \"dummy\" };\n return null;\n }\n\n if (!validateComponentName(componentName)) {\n console.warn(\n `\"${componentName}\" is using incorrect casing. Use PascalCase for Robin components`,\n );\n if (!selfClosed) robin = { type: \"dummy\" };\n return null;\n }\n\n if (!components || !(componentName in components)) {\n console.warn(`Unknown component: \"${componentName}\"`);\n if (!selfClosed) robin = { type: \"dummy\" };\n return null;\n }\n const propRows = text.split(/\\r?\\n/).slice(1, -1);\n const props = propRows.reduce<{ [key: string]: string | true }>((acc, cur) => {\n const [_match, key, value] = cur.match(/^([\\w]+)(?:=\"(.+)\")?$/) || [];\n\n if (!_match) {\n console.warn(`Invalid component attribute: \"${cur}\"`);\n return acc;\n }\n\n acc[key] = value ?? true;\n return acc;\n }, {});\n\n if (selfClosed) {\n const Component = components[componentName as keyof typeof components];\n return <Component {...props} />;\n }\n\n robin = { props, componentName, childTokens: [], type: \"base\" };\n return null;\n }\n\n return (\n <DocumentJSX\n raw={token.raw}\n components={components}\n config={config}\n targetProvider={targetProvider}\n pathname={pathname}\n uri={uri}\n pages={pages}\n />\n );\n case \"text\":\n if (\"tokens\" in token) {\n return <DocumentToken token={token.tokens || []} />;\n }\n return token.raw;\n // Definitions should not be rendered, they are used only as comments or meta data\n case \"def\":\n return null;\n // br are inserted between elements. In our case, sufficient indentation is set everywhere, so we ignore them\n case \"br\":\n return null;\n default:\n if (!token.type && \"raw\" in token) return token.raw;\n\n console.warn(`Unknown token ${token.type}`, token);\n return null;\n }\n };\n\n tokens.push({ type: \"text\", raw: \"\" });\n return <DocumentToken token={tokens} />;\n};\n"],"names":["DocumentJSX","raw","components","baseProps","parseOptions","replace","domNode","Text","data","headings","tokens","parseMarkdown","React","Document","subtree","name","href","external","formatLinkHref","attribs","pathname","pages","domToReact","children","createElement","NavContentLink","attributesToProps","validateComponentName","console","warn","props","Component","htmlparser2","lowerCaseTags","lowerCaseAttributeNames","parse","uri","targetProvider","config","publicDirs","robin","codeQueue","insertedCodeKeys","DocumentToken","token","isNewCodeToken","tabsData","tabsKey","Object","keys","sort","join","isInsertedKey","includes","push","Fragment","Tabs","type","insertStyles","blockKey","Array","isArray","trim","childTokens","componentName","RobinComponent","map","t","index","key","depth","predefinedData","find","heading","id","AnchorHeading","component","Heading","undefined","Block","Table","Thead","Tr","header","Th","text","Tbody","rows","row","rowIndex","elem","elemIndex","Td","Hr","Img","src","provider","alt","title","some","every","Paragraph","Strong","Del","Em","blockquoteToken","parseBlockqoute","Blockquote","inlineCode","hightlightMatch","match","lang","CodeBlock","code","inline","CodeSpan","configuration","parseCodeLang","switcher","tabKey","tab","formatId","tabName","toString","element","CodeSection","clone","split","forEach","copy","copyLang","copyTab","copyFileName","copyTabKey","filename","items","i","task","ListComponent","ordered","TaskOrderedList","TaskUnorderedList","start","TaskListItem","defaultChecked","checked","OrderedList","UnorderedList","ListItem","startsWith","endsWith","selfClosed","slice","reduce","acc","cur","_match","value"],"mappings":"gxDA0CO,MAAMA,EAA0C,EAAGC,MAAKC,gBAAeC,MAC1E,MAAMC,EAAuC,CACzC,OAAAC,CAAQC,GACJ,GAAIA,aAAmBC,GAAQD,EAAQE,KAAM,CACzC,MAAMC,SAAEA,EAAQC,OAAEA,GAAWC,EAAcL,EAAQE,MAEnD,O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;;;;;;;;;;UAoBjC,cAAc;;;;CAKrD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"github-slugger";import e from"gray-matter";import{lexer as r}from"marked";import{join as n,dirname as o}from"path";import{parseTokenText as s}from"../../../core/utils/content-tools.js";const a=n=>{const{content:o}=e(n),a=r(o.trim()),i=new t,c=a.reduce((t,e)=>{if("heading"===e.type&&(2===e.depth||3===e.depth)){const r=s(e);t.push({title:r,id:i.slug(r),token:e,nested:3===e.depth})}return t},[]);return{tokens:a,headings:c}},i=t=>t.toLowerCase().replace(/\W/g,"_").replace(/_+/g,"_"),c=t=>/^[A-Z][a-zA-Z0-9]+$/.test(t),g=t=>{let e={},r=t;const n=t.match(/[a-z]+=("[^"]+"|'[^']+'|[^ ]+)|[a-z]+/g);if(Array.isArray(n)){const[t,...o]=n;r=t,e=o.reduce((t,e)=>{const[r,...n]=e.split("=");return t[r]=!n||(0===n.length||n.join("=").replace(/(^["']|['"]$)/g,"")),t},{})}return{lang:r,configuration:e}},l=(t,e)=>{if(Array.isArray(t)||!Object.keys(e).length)return!1;if("code"===t.type){const{lang:r,configuration:n}=g(t.lang);if(e["string"==typeof n.tab?i(n.tab):r]||!n.switcher)return!0}return"space"!==t.type&&"code"!==t.type},
|
|
1
|
+
import t from"github-slugger";import e from"gray-matter";import{lexer as r}from"marked";import{join as n,dirname as o}from"path";import{parseTokenText as s}from"../../../core/utils/content-tools.js";const a=n=>{const{content:o}=e(n),a=r(o.trim()),i=new t,c=a.reduce((t,e)=>{if("heading"===e.type&&(2===e.depth||3===e.depth)){const r=s(e);t.push({title:r,id:i.slug(r),token:e,nested:3===e.depth})}return t},[]);return{tokens:a,headings:c}},i=t=>t.toLowerCase().replace(/\W/g,"_").replace(/_+/g,"_"),c=t=>/^[A-Z][a-zA-Z0-9]+$/.test(t),g=t=>{let e={},r=t;const n=t.match(/[a-z]+=("[^"]+"|'[^']+'|[^ ]+)|[a-z]+/g);if(Array.isArray(n)){const[t,...o]=n;r=t,e=o.reduce((t,e)=>{const[r,...n]=e.split("=");return t[r]=!n||(0===n.length||n.join("=").replace(/(^["']|['"]$)/g,"")),t},{})}return{lang:r,configuration:e}},l=(t,e)=>{if(Array.isArray(t)||!Object.keys(e).length)return!1;if("code"===t.type){const{lang:r,configuration:n}=g(t.lang);if(e["string"==typeof n.tab?i(n.tab):r]||!n.switcher)return!0}return"space"!==t.type&&"code"!==t.type},h=(t,e,r)=>{let s=t;const a=/^(https?:\/\/|\/)/.test(t);if(s.startsWith("#"))return{href:t,external:!1};if(r&&!a){const a=r.find(t=>t.clientPath===e);if(!a)throw new Error("Can not find requested page in parsed data");{const[,e,i]=t.match(/^([^?#]+)([?#].+)?/)||[t,t],c=n(o(a.origPath),e).replace(/\\/g,"/"),g=r.find(t=>t.origPath===c);g?s=g.clientPath+(i||""):(console.error(`Can not find link to internal file: "${t}"`),s="")}}return{href:s,external:a}},p=t=>{const e=t.raw.match(/^> \[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\n/);if(e){const[r,n]=e,o={...t,raw:t.raw.substring(r.length)};if(o.tokens){const t={...o.tokens[0]};if(t.raw=t.raw.substring(n.length+4),t.text=t.text.substring(n.length+4),t.tokens[0]){const e={...t.tokens[0]};e.raw=e.raw.substring(n.length+4),e.text=e.text.substring(n.length+4),t.tokens[0]=e}o.tokens[0]=t}return{token:o,type:n.toLowerCase()}}return{token:t,type:null}};export{i as formatId,h as formatLinkHref,l as isNewCodeToken,p as parseBlockqoute,g as parseCodeLang,a as parseMarkdown,c as validateComponentName};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/components/elements/article/utils.ts"],"sourcesContent":["import GithubSlugger from \"github-slugger\";\nimport matter from \"gray-matter\";\nimport { lexer, type Tokens, type Token } from \"marked\";\nimport { dirname, join } from \"path\";\n\nimport { type BlockquoteType } from \"@src/components/ui/blockquote\";\nimport { parseTokenText } from \"@src/core/utils/content-tools\";\n\nimport { type PagesType } from \"./types\";\n\nexport type AnchorData = {\n title: string;\n id: string;\n nested: boolean;\n token: Token;\n};\n\nexport const parseMarkdown = (content: string) => {\n const { content: matterContent } = matter(content);\n const tokens = lexer(matterContent.trim());\n\n const slugger = new GithubSlugger();\n const headings = tokens.reduce<AnchorData[]>((acc, token) => {\n if (token.type === \"heading\" && (token.depth === 2 || token.depth === 3)) {\n const title = parseTokenText(token);\n acc.push({\n title,\n id: slugger.slug(title),\n token,\n nested: token.depth === 3,\n });\n }\n return acc;\n }, []);\n\n return { tokens, headings };\n};\n\nexport const formatId = (raw: string) => {\n return raw.toLowerCase().replace(/\\W/g, \"_\").replace(/_+/g, \"_\");\n};\n\nexport const validateComponentName = (name: string) => {\n return /^[A-Z][a-zA-Z0-9]+$/.test(name);\n};\n\nexport const parseCodeLang = (raw: string) => {\n let configuration: { [key: string]: string | boolean } = {};\n let lang: string = raw;\n\n const match = raw.match(/[a-z]+=(\"[^\"]+\"|'[^']+'|[^ ]+)|[a-z]+/g);\n if (Array.isArray(match)) {\n const [language, ...modifiers] = match as string[];\n lang = language;\n configuration = modifiers.reduce<{ [key: string]: string | boolean }>((acc, cur) => {\n const [key, ...value] = cur.split(\"=\");\n if (value) {\n acc[key] = value.length === 0 ? true : value.join(\"=\").replace(/(^[\"']|['\"]$)/g, \"\");\n } else {\n acc[key] = true;\n }\n return acc;\n }, {});\n }\n return { lang, configuration };\n};\n\nexport const isNewCodeToken = (\n token: Token | Token[],\n codeQueue: { [lang: string]: { element: React.ReactNode; tabName: string } },\n) => {\n if (Array.isArray(token) || !Object.keys(codeQueue).length) return false;\n\n if (token.type === \"code\") {\n const { lang, configuration } = parseCodeLang(token.lang);\n const tabKey = typeof configuration.tab === \"string\" ? formatId(configuration.tab) : lang;\n if (codeQueue[tabKey] || !configuration.switcher) return true;\n }\n\n if (token.type !== \"space\" && token.type !== \"code\") return true;\n\n return false;\n};\n\nexport const formatLinkHref = (href: string, currentPathname: string, pages?: PagesType) => {\n let finalHref: string = href;\n const external = /^(https?:\\/\\/|\\/)/.test(href);\n\n if (pages && !external) {\n const currentPageData = pages.find((item) => item.clientPath === currentPathname);\n\n if (currentPageData) {\n const [, linkMain, linkAdditional] = href.match(/^([^?#]+)([?#].+)?/) || [href, href];\n const linkOrigPath = join(dirname(currentPageData.origPath), linkMain).replace(/\\\\/g, \"/\");\n const linkData = pages.find((item) => item.origPath === linkOrigPath);\n\n if (linkData) {\n finalHref = linkData.clientPath + (linkAdditional || \"\");\n } else {\n console.error(`Can not find link to internal file: \"${href}\"`);\n finalHref = \"\";\n }\n } else {\n throw new Error(\"Can not find requested page in parsed data\");\n }\n }\n return { href: finalHref, external };\n};\n\nexport const parseBlockqoute = (token: Tokens.Blockquote | Tokens.Generic) => {\n const typeMatch = token.raw.match(/^> \\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\\]\\n/);\n if (typeMatch) {\n const [raw, type] = typeMatch;\n const newToken = { ...token, raw: token.raw.substring(raw.length) };\n if (newToken.tokens) {\n const firstToken = { ...newToken.tokens[0] } as Tokens.Paragraph;\n firstToken.raw = firstToken.raw.substring(type.length + 4);\n firstToken.text = firstToken.text.substring(type.length + 4);\n if (firstToken.tokens[0]) {\n const firstSubtoken = { ...firstToken.tokens[0] } as Tokens.Paragraph;\n firstSubtoken.raw = firstSubtoken.raw.substring(type.length + 4);\n firstSubtoken.text = firstSubtoken.text.substring(type.length + 4);\n firstToken.tokens[0] = firstSubtoken;\n }\n newToken.tokens[0] = firstToken;\n }\n\n return {\n token: newToken,\n type: type.toLowerCase() as BlockquoteType,\n };\n }\n\n return { token, type: null };\n};\n"],"names":["parseMarkdown","content","matterContent","matter","tokens","lexer","trim","slugger","GithubSlugger","headings","reduce","acc","token","type","depth","title","parseTokenText","push","id","slug","nested","formatId","raw","toLowerCase","replace","validateComponentName","name","test","parseCodeLang","configuration","lang","match","Array","isArray","language","modifiers","cur","key","value","split","length","join","isNewCodeToken","codeQueue","Object","keys","tab","switcher","formatLinkHref","href","currentPathname","pages","finalHref","external","currentPageData","find","item","clientPath","Error","linkMain","linkAdditional","linkOrigPath","dirname","origPath","linkData","console","error","parseBlockqoute","typeMatch","newToken","substring","firstToken","text","firstSubtoken"],"mappings":"uMAiBO,MAAMA,EAAiBC,IAC1B,MAAQA,QAASC,GAAkBC,EAAOF,GACpCG,EAASC,EAAMH,EAAcI,QAE7BC,EAAU,IAAIC,EACdC,EAAWL,EAAOM,OAAqB,CAACC,EAAKC,KAC/C,GAAmB,YAAfA,EAAMC,OAAuC,IAAhBD,EAAME,OAA+B,IAAhBF,EAAME,OAAc,CACtE,MAAMC,EAAQC,EAAeJ,GAC7BD,EAAIM,KAAK,CACLF,QACAG,GAAIX,EAAQY,KAAKJ,GACjBH,QACAQ,OAAwB,IAAhBR,EAAME,OAEtB,CACA,OAAOH,GACR,IAEH,MAAO,CAAEP,SAAQK,aAGRY,EAAYC,GACdA,EAAIC,cAAcC,QAAQ,MAAO,KAAKA,QAAQ,MAAO,KAGnDC,EAAyBC,GAC3B,sBAAsBC,KAAKD,GAGzBE,EAAiBN,IAC1B,IAAIO,EAAqD,CAAA,EACrDC,EAAeR,EAEnB,MAAMS,EAAQT,EAAIS,MAAM,0CACxB,GAAIC,MAAMC,QAAQF,GAAQ,CACtB,MAAOG,KAAaC,GAAaJ,EACjCD,EAAOI,EACPL,EAAgBM,EAAUzB,OAA4C,CAACC,EAAKyB,KACxE,MAAOC,KAAQC,GAASF,EAAIG,MAAM,KAMlC,OAJI5B,EAAI0B,IADJC,IAC4B,IAAjBA,EAAME,QAAsBF,EAAMG,KAAK,KAAKjB,QAAQ,iBAAkB,KAI9Eb,GACR,CAAA,EACP,CACA,MAAO,CAAEmB,OAAMD,kBAGNa,EAAiB,CAC1B9B,EACA+B,KAEA,GAAIX,MAAMC,QAAQrB,KAAWgC,OAAOC,KAAKF,GAAWH,OAAQ,OAAO,EAEnE,GAAmB,SAAf5B,EAAMC,KAAiB,CACvB,MAAMiB,KAAEA,EAAID,cAAEA,GAAkBD,EAAchB,EAAMkB,MAEpD,GAAIa,EADwC,iBAAtBd,EAAciB,IAAmBzB,EAASQ,EAAciB,KAAOhB,KAC3DD,EAAckB,SAAU,OAAO,CAC7D,CAEA,MAAmB,UAAfnC,EAAMC,MAAmC,SAAfD,EAAMC,MAK3BmC,EAAiB,CAACC,EAAcC,EAAyBC,KAClE,IAAIC,EAAoBH,EACxB,MAAMI,EAAW,oBAAoB1B,KAAKsB,GAE1C,
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/components/elements/article/utils.ts"],"sourcesContent":["import GithubSlugger from \"github-slugger\";\nimport matter from \"gray-matter\";\nimport { lexer, type Tokens, type Token } from \"marked\";\nimport { dirname, join } from \"path\";\n\nimport { type BlockquoteType } from \"@src/components/ui/blockquote\";\nimport { parseTokenText } from \"@src/core/utils/content-tools\";\n\nimport { type PagesType } from \"./types\";\n\nexport type AnchorData = {\n title: string;\n id: string;\n nested: boolean;\n token: Token;\n};\n\nexport const parseMarkdown = (content: string) => {\n const { content: matterContent } = matter(content);\n const tokens = lexer(matterContent.trim());\n\n const slugger = new GithubSlugger();\n const headings = tokens.reduce<AnchorData[]>((acc, token) => {\n if (token.type === \"heading\" && (token.depth === 2 || token.depth === 3)) {\n const title = parseTokenText(token);\n acc.push({\n title,\n id: slugger.slug(title),\n token,\n nested: token.depth === 3,\n });\n }\n return acc;\n }, []);\n\n return { tokens, headings };\n};\n\nexport const formatId = (raw: string) => {\n return raw.toLowerCase().replace(/\\W/g, \"_\").replace(/_+/g, \"_\");\n};\n\nexport const validateComponentName = (name: string) => {\n return /^[A-Z][a-zA-Z0-9]+$/.test(name);\n};\n\nexport const parseCodeLang = (raw: string) => {\n let configuration: { [key: string]: string | boolean } = {};\n let lang: string = raw;\n\n const match = raw.match(/[a-z]+=(\"[^\"]+\"|'[^']+'|[^ ]+)|[a-z]+/g);\n if (Array.isArray(match)) {\n const [language, ...modifiers] = match as string[];\n lang = language;\n configuration = modifiers.reduce<{ [key: string]: string | boolean }>((acc, cur) => {\n const [key, ...value] = cur.split(\"=\");\n if (value) {\n acc[key] = value.length === 0 ? true : value.join(\"=\").replace(/(^[\"']|['\"]$)/g, \"\");\n } else {\n acc[key] = true;\n }\n return acc;\n }, {});\n }\n return { lang, configuration };\n};\n\nexport const isNewCodeToken = (\n token: Token | Token[],\n codeQueue: { [lang: string]: { element: React.ReactNode; tabName: string } },\n) => {\n if (Array.isArray(token) || !Object.keys(codeQueue).length) return false;\n\n if (token.type === \"code\") {\n const { lang, configuration } = parseCodeLang(token.lang);\n const tabKey = typeof configuration.tab === \"string\" ? formatId(configuration.tab) : lang;\n if (codeQueue[tabKey] || !configuration.switcher) return true;\n }\n\n if (token.type !== \"space\" && token.type !== \"code\") return true;\n\n return false;\n};\n\nexport const formatLinkHref = (href: string, currentPathname: string, pages?: PagesType) => {\n let finalHref: string = href;\n const external = /^(https?:\\/\\/|\\/)/.test(href);\n\n if (finalHref.startsWith(\"#\")) return { href, external: false };\n\n if (pages && !external) {\n const currentPageData = pages.find((item) => item.clientPath === currentPathname);\n\n if (currentPageData) {\n const [, linkMain, linkAdditional] = href.match(/^([^?#]+)([?#].+)?/) || [href, href];\n const linkOrigPath = join(dirname(currentPageData.origPath), linkMain).replace(/\\\\/g, \"/\");\n const linkData = pages.find((item) => item.origPath === linkOrigPath);\n\n if (linkData) {\n finalHref = linkData.clientPath + (linkAdditional || \"\");\n } else {\n console.error(`Can not find link to internal file: \"${href}\"`);\n finalHref = \"\";\n }\n } else {\n throw new Error(\"Can not find requested page in parsed data\");\n }\n }\n return { href: finalHref, external };\n};\n\nexport const parseBlockqoute = (token: Tokens.Blockquote | Tokens.Generic) => {\n const typeMatch = token.raw.match(/^> \\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\\]\\n/);\n if (typeMatch) {\n const [raw, type] = typeMatch;\n const newToken = { ...token, raw: token.raw.substring(raw.length) };\n if (newToken.tokens) {\n const firstToken = { ...newToken.tokens[0] } as Tokens.Paragraph;\n firstToken.raw = firstToken.raw.substring(type.length + 4);\n firstToken.text = firstToken.text.substring(type.length + 4);\n if (firstToken.tokens[0]) {\n const firstSubtoken = { ...firstToken.tokens[0] } as Tokens.Paragraph;\n firstSubtoken.raw = firstSubtoken.raw.substring(type.length + 4);\n firstSubtoken.text = firstSubtoken.text.substring(type.length + 4);\n firstToken.tokens[0] = firstSubtoken;\n }\n newToken.tokens[0] = firstToken;\n }\n\n return {\n token: newToken,\n type: type.toLowerCase() as BlockquoteType,\n };\n }\n\n return { token, type: null };\n};\n"],"names":["parseMarkdown","content","matterContent","matter","tokens","lexer","trim","slugger","GithubSlugger","headings","reduce","acc","token","type","depth","title","parseTokenText","push","id","slug","nested","formatId","raw","toLowerCase","replace","validateComponentName","name","test","parseCodeLang","configuration","lang","match","Array","isArray","language","modifiers","cur","key","value","split","length","join","isNewCodeToken","codeQueue","Object","keys","tab","switcher","formatLinkHref","href","currentPathname","pages","finalHref","external","startsWith","currentPageData","find","item","clientPath","Error","linkMain","linkAdditional","linkOrigPath","dirname","origPath","linkData","console","error","parseBlockqoute","typeMatch","newToken","substring","firstToken","text","firstSubtoken"],"mappings":"uMAiBO,MAAMA,EAAiBC,IAC1B,MAAQA,QAASC,GAAkBC,EAAOF,GACpCG,EAASC,EAAMH,EAAcI,QAE7BC,EAAU,IAAIC,EACdC,EAAWL,EAAOM,OAAqB,CAACC,EAAKC,KAC/C,GAAmB,YAAfA,EAAMC,OAAuC,IAAhBD,EAAME,OAA+B,IAAhBF,EAAME,OAAc,CACtE,MAAMC,EAAQC,EAAeJ,GAC7BD,EAAIM,KAAK,CACLF,QACAG,GAAIX,EAAQY,KAAKJ,GACjBH,QACAQ,OAAwB,IAAhBR,EAAME,OAEtB,CACA,OAAOH,GACR,IAEH,MAAO,CAAEP,SAAQK,aAGRY,EAAYC,GACdA,EAAIC,cAAcC,QAAQ,MAAO,KAAKA,QAAQ,MAAO,KAGnDC,EAAyBC,GAC3B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MK,KAAMC,GAASA,EAAKO,WAAaF,GAEpDG,EACAb,EAAYa,EAASP,YAAcG,GAAkB,KAErDK,QAAQC,MAAM,wCAAwClB,MACtDG,EAAY,GAEpB,CAGJ,CACA,MAAO,CAAEH,KAAMG,EAAWC,aAGjBe,EAAmBxD,IAC5B,MAAMyD,EAAYzD,EAAMU,IAAIS,MAAM,kDAClC,GAAIsC,EAAW,CACX,MAAO/C,EAAKT,GAAQwD,EACdC,EAAW,IAAK1D,EAAOU,IAAKV,EAAMU,IAAIiD,UAAUjD,EAAIkB,SAC1D,GAAI8B,EAASlE,OAAQ,CACjB,MAAMoE,EAAa,IAAKF,EAASlE,OAAO,IAGxC,GAFAoE,EAAWlD,IAAMkD,EAAWlD,IAAIiD,UAAU1D,EAAK2B,OAAS,GACxDgC,EAAWC,KAAOD,EAAWC,KAAKF,UAAU1D,EAAK2B,OAAS,GACtDgC,EAAWpE,OAAO,GAAI,CACtB,MAAMsE,EAAgB,IAAKF,EAAWpE,OAAO,IAC7CsE,EAAcpD,IAAMoD,EAAcpD,IAAIiD,UAAU1D,EAAK2B,OAAS,GAC9DkC,EAAcD,KAAOC,EAAcD,KAAKF,UAAU1D,EAAK2B,OAAS,GAChEgC,EAAWpE,OAAO,GAAKsE,CAC3B,CACAJ,EAASlE,OAAO,GAAKoE,CACzB,CAEA,MAAO,CACH5D,MAAO0D,EACPzD,KAAMA,EAAKU,cAEnB,CAEA,MAAO,CAAEX,QAAOC,KAAM"}
|
package/lib/styles.css
CHANGED
|
@@ -1,93 +1,4 @@
|
|
|
1
|
-
.r-
|
|
2
|
-
position: sticky;
|
|
3
|
-
background-color: var(--r-main-50);
|
|
4
|
-
top: 0;
|
|
5
|
-
border-bottom: 1px solid var(--r-main-300);
|
|
6
|
-
height: 60px;
|
|
7
|
-
z-index: 1000;
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.r-header-body {
|
|
12
|
-
height: 100%;
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
align-items: center;
|
|
16
|
-
gap: 24px;
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.r-header-logo {
|
|
21
|
-
display: block;
|
|
22
|
-
margin-right: 24px;
|
|
23
|
-
color: var(--r-main-700);
|
|
24
|
-
transition: color 0.2s;
|
|
25
|
-
box-sizing: border-box;
|
|
26
|
-
}
|
|
27
|
-
.r-header-logo:hover, .r-header-logo:focus {
|
|
28
|
-
color: var(--r-main-950);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.r-header-nav {
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
gap: 12px 16px;
|
|
35
|
-
}
|
|
36
|
-
@media screen and (width >= 1024px) {
|
|
37
|
-
.r-header-nav {
|
|
38
|
-
flex-direction: row;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.r-header-link {
|
|
43
|
-
color: var(--r-main-600);
|
|
44
|
-
text-decoration: none;
|
|
45
|
-
padding: 4px 0;
|
|
46
|
-
transition: color 0.2s;
|
|
47
|
-
box-sizing: border-box;
|
|
48
|
-
}
|
|
49
|
-
.r-header-link:hover, .r-header-link:focus-visible {
|
|
50
|
-
color: var(--r-main-950);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.r-header-link._target {
|
|
54
|
-
color: var(--r-primary-800);
|
|
55
|
-
}
|
|
56
|
-
.r-header-link._target:hover, .r-header-link._target:focus-visible {
|
|
57
|
-
color: var(--r-primary-700);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.r-header-actions {
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column-reverse;
|
|
63
|
-
gap: 16px;
|
|
64
|
-
align-items: stretch;
|
|
65
|
-
}
|
|
66
|
-
@media screen and (width >= 1024px) {
|
|
67
|
-
.r-header-actions {
|
|
68
|
-
flex-direction: row;
|
|
69
|
-
align-items: center;
|
|
70
|
-
gap: 28px;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.r-header-sections {
|
|
75
|
-
display: flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
gap: 12px;
|
|
78
|
-
}
|
|
79
|
-
@media screen and (width < 768px) {
|
|
80
|
-
.r-header-sections .r-dropdown {
|
|
81
|
-
flex: 1;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
@media screen and (width < 768px) {
|
|
85
|
-
.r-header-sections .r-dropdown-drop {
|
|
86
|
-
max-width: none;
|
|
87
|
-
width: 100%;
|
|
88
|
-
left: 0;
|
|
89
|
-
}
|
|
90
|
-
}.r-footer {
|
|
1
|
+
.r-footer {
|
|
91
2
|
border-top: 1px solid var(--r-main-300);
|
|
92
3
|
padding-top: 16px;
|
|
93
4
|
padding-bottom: 16px;
|
|
@@ -122,6 +33,28 @@
|
|
|
122
33
|
}
|
|
123
34
|
.r-powered-link:hover {
|
|
124
35
|
color: var(--r-primary-900);
|
|
36
|
+
}.r-docs-container {
|
|
37
|
+
min-height: calc(100dvh - var(--r-header-height));
|
|
38
|
+
overflow-wrap: break-word;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
@media screen and (width >= 768px) {
|
|
42
|
+
.r-docs-container {
|
|
43
|
+
display: grid;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
column-gap: 32px;
|
|
46
|
+
grid-template-areas: "sidebar breadcrumbs" "sidebar contents" "sidebar content" "sidebar pagination";
|
|
47
|
+
grid-template-columns: 1fr calc(100% - 248px);
|
|
48
|
+
grid-template-rows: auto auto 1fr auto;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
@media screen and (width >= 1180px) {
|
|
52
|
+
.r-docs-container {
|
|
53
|
+
column-gap: 40px;
|
|
54
|
+
grid-template-areas: "sidebar breadcrumbs contents" "sidebar content contents" "sidebar pagination contents";
|
|
55
|
+
grid-template-columns: 1fr 640px 1fr;
|
|
56
|
+
grid-template-rows: auto 1fr auto;
|
|
57
|
+
}
|
|
125
58
|
}.r-root {
|
|
126
59
|
--r-header-height: 60px;
|
|
127
60
|
position: relative;
|
|
@@ -354,37 +287,95 @@
|
|
|
354
287
|
--r-cl-60: #86181d;
|
|
355
288
|
--r-cl-61: #144620;
|
|
356
289
|
--r-cl-62: #c24e00;
|
|
357
|
-
}.r-
|
|
358
|
-
|
|
359
|
-
|
|
290
|
+
}.r-header {
|
|
291
|
+
position: sticky;
|
|
292
|
+
background-color: var(--r-main-50);
|
|
293
|
+
top: 0;
|
|
294
|
+
border-bottom: 1px solid var(--r-main-300);
|
|
295
|
+
height: 60px;
|
|
296
|
+
z-index: 1000;
|
|
360
297
|
box-sizing: border-box;
|
|
361
298
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
299
|
+
|
|
300
|
+
.r-header-body {
|
|
301
|
+
height: 100%;
|
|
302
|
+
display: flex;
|
|
303
|
+
justify-content: space-between;
|
|
304
|
+
align-items: center;
|
|
305
|
+
gap: 24px;
|
|
306
|
+
box-sizing: border-box;
|
|
371
307
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
308
|
+
|
|
309
|
+
.r-header-logo {
|
|
310
|
+
display: block;
|
|
311
|
+
margin-right: 24px;
|
|
312
|
+
color: var(--r-main-700);
|
|
313
|
+
transition: color 0.2s;
|
|
314
|
+
box-sizing: border-box;
|
|
315
|
+
}
|
|
316
|
+
.r-header-logo:hover, .r-header-logo:focus {
|
|
317
|
+
color: var(--r-main-950);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.r-header-nav {
|
|
321
|
+
display: flex;
|
|
322
|
+
flex-direction: column;
|
|
323
|
+
gap: 12px 16px;
|
|
324
|
+
}
|
|
325
|
+
@media screen and (width >= 1024px) {
|
|
326
|
+
.r-header-nav {
|
|
327
|
+
flex-direction: row;
|
|
378
328
|
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.r-header-link {
|
|
332
|
+
color: var(--r-main-600);
|
|
333
|
+
text-decoration: none;
|
|
334
|
+
padding: 4px 0;
|
|
335
|
+
transition: color 0.2s;
|
|
382
336
|
box-sizing: border-box;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
337
|
+
}
|
|
338
|
+
.r-header-link:hover, .r-header-link:focus-visible {
|
|
339
|
+
color: var(--r-main-950);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.r-header-link._target {
|
|
343
|
+
color: var(--r-primary-800);
|
|
344
|
+
}
|
|
345
|
+
.r-header-link._target:hover, .r-header-link._target:focus-visible {
|
|
346
|
+
color: var(--r-primary-700);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.r-header-actions {
|
|
350
|
+
display: flex;
|
|
351
|
+
flex-direction: column-reverse;
|
|
352
|
+
gap: 16px;
|
|
353
|
+
align-items: stretch;
|
|
354
|
+
}
|
|
355
|
+
@media screen and (width >= 1024px) {
|
|
356
|
+
.r-header-actions {
|
|
357
|
+
flex-direction: row;
|
|
358
|
+
align-items: center;
|
|
359
|
+
gap: 28px;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.r-header-sections {
|
|
364
|
+
display: flex;
|
|
365
|
+
align-items: center;
|
|
366
|
+
gap: 12px;
|
|
367
|
+
}
|
|
368
|
+
@media screen and (width < 768px) {
|
|
369
|
+
.r-header-sections .r-dropdown {
|
|
370
|
+
flex: 1;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
@media screen and (width < 768px) {
|
|
374
|
+
.r-header-sections .r-dropdown-drop {
|
|
375
|
+
max-width: none;
|
|
376
|
+
width: 100%;
|
|
377
|
+
left: 0;
|
|
378
|
+
}
|
|
388
379
|
}.r-blog-container {
|
|
389
380
|
min-height: calc(100dvh - var(--r-header-height));
|
|
390
381
|
overflow-wrap: break-word;
|
|
@@ -399,58 +390,15 @@
|
|
|
399
390
|
grid-template-columns: 760px 220px;
|
|
400
391
|
grid-template-rows: auto 1fr auto;
|
|
401
392
|
}
|
|
402
|
-
}.r-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
@media screen and (width >= 1180px) {
|
|
407
|
-
.r-article {
|
|
408
|
-
padding: 32px 0 40px;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
.r-article > *:first-child {
|
|
412
|
-
margin-top: 0;
|
|
413
|
-
}
|
|
414
|
-
.r-article > *:last-child {
|
|
415
|
-
margin-bottom: 0;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
.r-checkbox {
|
|
419
|
-
cursor: pointer;
|
|
420
|
-
width: 20px;
|
|
421
|
-
height: 20px;
|
|
422
|
-
margin: 4px;
|
|
423
|
-
vertical-align: middle;
|
|
424
|
-
box-sizing: border-box;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.r-label {
|
|
428
|
-
cursor: pointer;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.r-task-ol,
|
|
432
|
-
.r-task-ul {
|
|
433
|
-
list-style: none;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.r-task-label {
|
|
437
|
-
display: block;
|
|
438
|
-
width: 100%;
|
|
439
|
-
padding-top: 2px;
|
|
440
|
-
padding-bottom: 2px;
|
|
393
|
+
}.r-page-container {
|
|
394
|
+
min-height: calc(100dvh - var(--r-header-height));
|
|
395
|
+
overflow-wrap: break-word;
|
|
441
396
|
box-sizing: border-box;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
.r-task-li.r-task-li {
|
|
448
|
-
margin-block-start: 2px;
|
|
449
|
-
margin-block-end: 2px;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.r-label-text {
|
|
453
|
-
vertical-align: middle;
|
|
397
|
+
}.keylink-to-content {
|
|
398
|
+
position: absolute !important;
|
|
399
|
+
top: 8px;
|
|
400
|
+
left: 12px;
|
|
401
|
+
z-index: 1001;
|
|
454
402
|
}.r-keylink.keylink-to-navigation:focus {
|
|
455
403
|
margin-top: -40px;
|
|
456
404
|
}.r-sidebar {
|
|
@@ -725,6 +673,136 @@
|
|
|
725
673
|
|
|
726
674
|
.r-sidebar-drop[open] > .r-sidebar-drop-btn > .r-sidebar-drop-icon {
|
|
727
675
|
transform: rotate(90deg);
|
|
676
|
+
}.r-article {
|
|
677
|
+
padding: 20px 0 40px;
|
|
678
|
+
grid-area: content;
|
|
679
|
+
}
|
|
680
|
+
@media screen and (width >= 1180px) {
|
|
681
|
+
.r-article {
|
|
682
|
+
padding: 32px 0 40px;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
.r-article > *:first-child {
|
|
686
|
+
margin-top: 0;
|
|
687
|
+
}
|
|
688
|
+
.r-article > *:last-child {
|
|
689
|
+
margin-bottom: 0;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.r-checkbox {
|
|
693
|
+
cursor: pointer;
|
|
694
|
+
width: 20px;
|
|
695
|
+
height: 20px;
|
|
696
|
+
margin: 4px;
|
|
697
|
+
vertical-align: middle;
|
|
698
|
+
box-sizing: border-box;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.r-label {
|
|
702
|
+
cursor: pointer;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.r-task-ol,
|
|
706
|
+
.r-task-ul {
|
|
707
|
+
list-style: none;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
.r-task-label {
|
|
711
|
+
display: block;
|
|
712
|
+
width: 100%;
|
|
713
|
+
padding-top: 2px;
|
|
714
|
+
padding-bottom: 2px;
|
|
715
|
+
box-sizing: border-box;
|
|
716
|
+
}
|
|
717
|
+
.r-task-label:hover .r-checkbox {
|
|
718
|
+
filter: brightness(0.8);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.r-task-li.r-task-li {
|
|
722
|
+
margin-block-start: 2px;
|
|
723
|
+
margin-block-end: 2px;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.r-label-text {
|
|
727
|
+
vertical-align: middle;
|
|
728
|
+
}.r-theme-switcher {
|
|
729
|
+
position: relative;
|
|
730
|
+
display: flex;
|
|
731
|
+
gap: 4px;
|
|
732
|
+
width: 108px;
|
|
733
|
+
height: 36px;
|
|
734
|
+
padding: 2px;
|
|
735
|
+
background-color: var(--r-main-950);
|
|
736
|
+
border-radius: 14px;
|
|
737
|
+
box-sizing: border-box;
|
|
738
|
+
}
|
|
739
|
+
.r-theme-switcher::before {
|
|
740
|
+
content: "";
|
|
741
|
+
position: absolute;
|
|
742
|
+
display: block;
|
|
743
|
+
height: 32px;
|
|
744
|
+
width: 32px;
|
|
745
|
+
top: 2px;
|
|
746
|
+
left: 2px;
|
|
747
|
+
background-color: var(--r-main-50);
|
|
748
|
+
border-radius: 12px;
|
|
749
|
+
transition: left 0.2s;
|
|
750
|
+
box-sizing: border-box;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.r-theme-switcher-btn {
|
|
754
|
+
padding: 8px;
|
|
755
|
+
background: none;
|
|
756
|
+
border: 0;
|
|
757
|
+
border-radius: 12px;
|
|
758
|
+
cursor: pointer;
|
|
759
|
+
color: var(--r-main-50);
|
|
760
|
+
fill: var(--r-main-950);
|
|
761
|
+
z-index: 1;
|
|
762
|
+
transition: color 0.2s 0.1s, fill 0.2s;
|
|
763
|
+
}
|
|
764
|
+
.r-theme-switcher-btn:hover {
|
|
765
|
+
color: var(--r-main-50);
|
|
766
|
+
fill: var(--r-main-50);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.r-theme-dark:not(.r-theme-system) .r-theme-switcher::before {
|
|
770
|
+
left: 2px;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
.r-theme-dark:not(.r-theme-system) .r-theme-switcher-btn__dark {
|
|
774
|
+
color: var(--r-main-950);
|
|
775
|
+
pointer-events: none;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
.r-theme-switcher::before,
|
|
779
|
+
.r-theme-system .r-theme-switcher::before {
|
|
780
|
+
left: 38px;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
.r-theme-system .r-theme-switcher-btn__system {
|
|
784
|
+
color: var(--r-main-950);
|
|
785
|
+
pointer-events: none;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.r-theme-light:not(.r-theme-system) .r-theme-switcher::before {
|
|
789
|
+
left: 74px;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.r-theme-light:not(.r-theme-system) .r-theme-switcher-btn__light {
|
|
793
|
+
color: var(--r-main-950);
|
|
794
|
+
pointer-events: none;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.r-theme-switcher-svg {
|
|
798
|
+
display: block;
|
|
799
|
+
}.r-container {
|
|
800
|
+
max-width: 1180px;
|
|
801
|
+
padding-right: 12px;
|
|
802
|
+
padding-left: 12px;
|
|
803
|
+
margin-right: auto;
|
|
804
|
+
margin-left: auto;
|
|
805
|
+
box-sizing: border-box;
|
|
728
806
|
}.r-header-menu {
|
|
729
807
|
display: flex;
|
|
730
808
|
justify-content: flex-end;
|
|
@@ -1026,84 +1104,6 @@
|
|
|
1026
1104
|
}
|
|
1027
1105
|
.r-header-social-git:hover, .r-header-social-git:focus {
|
|
1028
1106
|
color: var(--r-main-950);
|
|
1029
|
-
}.r-container {
|
|
1030
|
-
max-width: 1180px;
|
|
1031
|
-
padding-right: 12px;
|
|
1032
|
-
padding-left: 12px;
|
|
1033
|
-
margin-right: auto;
|
|
1034
|
-
margin-left: auto;
|
|
1035
|
-
box-sizing: border-box;
|
|
1036
|
-
}.r-theme-switcher {
|
|
1037
|
-
position: relative;
|
|
1038
|
-
display: flex;
|
|
1039
|
-
gap: 4px;
|
|
1040
|
-
width: 108px;
|
|
1041
|
-
height: 36px;
|
|
1042
|
-
padding: 2px;
|
|
1043
|
-
background-color: var(--r-main-950);
|
|
1044
|
-
border-radius: 14px;
|
|
1045
|
-
box-sizing: border-box;
|
|
1046
|
-
}
|
|
1047
|
-
.r-theme-switcher::before {
|
|
1048
|
-
content: "";
|
|
1049
|
-
position: absolute;
|
|
1050
|
-
display: block;
|
|
1051
|
-
height: 32px;
|
|
1052
|
-
width: 32px;
|
|
1053
|
-
top: 2px;
|
|
1054
|
-
left: 2px;
|
|
1055
|
-
background-color: var(--r-main-50);
|
|
1056
|
-
border-radius: 12px;
|
|
1057
|
-
transition: left 0.2s;
|
|
1058
|
-
box-sizing: border-box;
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
.r-theme-switcher-btn {
|
|
1062
|
-
padding: 8px;
|
|
1063
|
-
background: none;
|
|
1064
|
-
border: 0;
|
|
1065
|
-
border-radius: 12px;
|
|
1066
|
-
cursor: pointer;
|
|
1067
|
-
color: var(--r-main-50);
|
|
1068
|
-
fill: var(--r-main-950);
|
|
1069
|
-
z-index: 1;
|
|
1070
|
-
transition: color 0.2s 0.1s, fill 0.2s;
|
|
1071
|
-
}
|
|
1072
|
-
.r-theme-switcher-btn:hover {
|
|
1073
|
-
color: var(--r-main-50);
|
|
1074
|
-
fill: var(--r-main-50);
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
.r-theme-dark:not(.r-theme-system) .r-theme-switcher::before {
|
|
1078
|
-
left: 2px;
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
.r-theme-dark:not(.r-theme-system) .r-theme-switcher-btn__dark {
|
|
1082
|
-
color: var(--r-main-950);
|
|
1083
|
-
pointer-events: none;
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
.r-theme-switcher::before,
|
|
1087
|
-
.r-theme-system .r-theme-switcher::before {
|
|
1088
|
-
left: 38px;
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
.r-theme-system .r-theme-switcher-btn__system {
|
|
1092
|
-
color: var(--r-main-950);
|
|
1093
|
-
pointer-events: none;
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
.r-theme-light:not(.r-theme-system) .r-theme-switcher::before {
|
|
1097
|
-
left: 74px;
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
.r-theme-light:not(.r-theme-system) .r-theme-switcher-btn__light {
|
|
1101
|
-
color: var(--r-main-950);
|
|
1102
|
-
pointer-events: none;
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
.r-theme-switcher-svg {
|
|
1106
|
-
display: block;
|
|
1107
1107
|
}.r-keylink {
|
|
1108
1108
|
display: block;
|
|
1109
1109
|
position: relative;
|
|
@@ -1525,14 +1525,6 @@
|
|
|
1525
1525
|
}
|
|
1526
1526
|
.r-anchor-heading-link::after {
|
|
1527
1527
|
content: "#";
|
|
1528
|
-
}.r-block {
|
|
1529
|
-
width: 100%;
|
|
1530
|
-
overflow: auto;
|
|
1531
|
-
margin-block-start: 12px;
|
|
1532
|
-
margin-block-end: 12px;
|
|
1533
|
-
scrollbar-width: thin;
|
|
1534
|
-
scrollbar-color: var(--r-main-200) transparent;
|
|
1535
|
-
box-sizing: border-box;
|
|
1536
1528
|
}.r-code-section {
|
|
1537
1529
|
position: relative;
|
|
1538
1530
|
margin-block-start: 1.5em;
|
|
@@ -1554,6 +1546,10 @@
|
|
|
1554
1546
|
color: var(--r-main-700);
|
|
1555
1547
|
}
|
|
1556
1548
|
|
|
1549
|
+
.r-code-section-block._space-right {
|
|
1550
|
+
padding-right: 3rem;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1557
1553
|
.r-code-section-header + .r-code-section-block {
|
|
1558
1554
|
border: 0;
|
|
1559
1555
|
margin-block-start: 0;
|
|
@@ -1569,6 +1565,9 @@
|
|
|
1569
1565
|
right: 9px;
|
|
1570
1566
|
top: 9px;
|
|
1571
1567
|
opacity: 0;
|
|
1568
|
+
background: color-mix(in oklab, var(--r-main-100) 90%, transparent);
|
|
1569
|
+
border: 2px solid var(--r-main-50);
|
|
1570
|
+
backdrop-filter: blur(2px);
|
|
1572
1571
|
transition: opacity 0.2s, color 0.2s, background-color 0.2s;
|
|
1573
1572
|
}
|
|
1574
1573
|
.r-code-section-copy.r-code-section-copy:hover, .r-code-section-copy.r-code-section-copy._active {
|
|
@@ -1577,6 +1576,14 @@
|
|
|
1577
1576
|
|
|
1578
1577
|
.r-code-section-filename {
|
|
1579
1578
|
font-family: var(--monospace-font, monospace, monospace);
|
|
1579
|
+
}.r-block {
|
|
1580
|
+
width: 100%;
|
|
1581
|
+
overflow: auto;
|
|
1582
|
+
margin-block-start: 12px;
|
|
1583
|
+
margin-block-end: 12px;
|
|
1584
|
+
scrollbar-width: thin;
|
|
1585
|
+
scrollbar-color: var(--r-main-200) transparent;
|
|
1586
|
+
box-sizing: border-box;
|
|
1580
1587
|
}.r-blockquote {
|
|
1581
1588
|
background-color: var(--r-main-100);
|
|
1582
1589
|
padding: 8px 12px 8px 20px;
|
|
@@ -1633,19 +1640,6 @@
|
|
|
1633
1640
|
}
|
|
1634
1641
|
.r-blockquote-caution .r-blockquote-title {
|
|
1635
1642
|
color: var(--r-caution);
|
|
1636
|
-
}.r-code-block {
|
|
1637
|
-
font-family: var(--monospace-font, monospace, monospace);
|
|
1638
|
-
font-size: 16px;
|
|
1639
|
-
line-height: 1.33;
|
|
1640
|
-
border-radius: 6px;
|
|
1641
|
-
padding: 16px 20px;
|
|
1642
|
-
margin: 0;
|
|
1643
|
-
color: var(--r-primary-800);
|
|
1644
|
-
background-color: var(--r-main-50);
|
|
1645
|
-
overflow-x: auto;
|
|
1646
|
-
scrollbar-width: thin;
|
|
1647
|
-
scrollbar-color: var(--r-main-200) transparent;
|
|
1648
|
-
box-sizing: border-box;
|
|
1649
1643
|
}.r-code-span {
|
|
1650
1644
|
font-family: var(--monospace-font, monospace, monospace);
|
|
1651
1645
|
background-color: var(--r-main-100);
|
|
@@ -1653,13 +1647,29 @@
|
|
|
1653
1647
|
color: var(--r-main-950);
|
|
1654
1648
|
border-radius: 4px;
|
|
1655
1649
|
padding: 2px 6px;
|
|
1656
|
-
font-size:
|
|
1650
|
+
font-size: inherit;
|
|
1657
1651
|
font-weight: 500;
|
|
1658
1652
|
letter-spacing: 0.5px;
|
|
1659
1653
|
}
|
|
1660
1654
|
|
|
1661
1655
|
.r-code-span + .r-content-link-external {
|
|
1662
1656
|
margin-left: -12px;
|
|
1657
|
+
}.r-code-block {
|
|
1658
|
+
font-family: var(--monospace-font, monospace, monospace);
|
|
1659
|
+
font-size: 16px;
|
|
1660
|
+
line-height: 1.33;
|
|
1661
|
+
border-radius: 6px;
|
|
1662
|
+
padding: 16px 20px;
|
|
1663
|
+
margin: 0;
|
|
1664
|
+
color: var(--r-primary-800);
|
|
1665
|
+
background-color: var(--r-main-50);
|
|
1666
|
+
overflow-x: auto;
|
|
1667
|
+
scrollbar-width: thin;
|
|
1668
|
+
scrollbar-color: var(--r-main-200) transparent;
|
|
1669
|
+
box-sizing: border-box;
|
|
1670
|
+
}.r-img {
|
|
1671
|
+
max-width: 100%;
|
|
1672
|
+
box-sizing: border-box;
|
|
1663
1673
|
}.r-h1 {
|
|
1664
1674
|
font-size: 32px;
|
|
1665
1675
|
line-height: 1.4;
|
|
@@ -1700,9 +1710,6 @@
|
|
|
1700
1710
|
line-height: 1.4;
|
|
1701
1711
|
margin-block-start: 1.8em;
|
|
1702
1712
|
margin-block-end: 1.8em;
|
|
1703
|
-
}.r-img {
|
|
1704
|
-
max-width: 100%;
|
|
1705
|
-
box-sizing: border-box;
|
|
1706
1713
|
}.r-p {
|
|
1707
1714
|
line-height: 1.8;
|
|
1708
1715
|
margin-block-start: 1em;
|
|
@@ -1799,55 +1806,6 @@
|
|
|
1799
1806
|
min-width: 24px;
|
|
1800
1807
|
text-align: center;
|
|
1801
1808
|
box-sizing: border-box;
|
|
1802
|
-
}.r-content-link {
|
|
1803
|
-
text-decoration: none;
|
|
1804
|
-
color: inherit;
|
|
1805
|
-
text-decoration: underline;
|
|
1806
|
-
text-decoration-color: var(--r-primary-500);
|
|
1807
|
-
text-underline-offset: 3px;
|
|
1808
|
-
transition: text-decoration-offset 0.2s ease;
|
|
1809
|
-
}
|
|
1810
|
-
.r-content-link:hover {
|
|
1811
|
-
color: var(--r-main-700);
|
|
1812
|
-
text-decoration-color: var(--r-primary-400);
|
|
1813
|
-
text-underline-offset: 2px;
|
|
1814
|
-
text-decoration-thickness: 2px;
|
|
1815
|
-
}
|
|
1816
|
-
.r-content-link:active {
|
|
1817
|
-
color: var(--r-primary-600);
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
.r-content-link-external {
|
|
1821
|
-
position: relative;
|
|
1822
|
-
vertical-align: text-top;
|
|
1823
|
-
display: inline-block;
|
|
1824
|
-
margin-left: -4px;
|
|
1825
|
-
margin-right: 2px;
|
|
1826
|
-
width: 6px;
|
|
1827
|
-
height: 6px;
|
|
1828
|
-
box-sizing: border-box;
|
|
1829
|
-
}
|
|
1830
|
-
.r-content-link-external::after {
|
|
1831
|
-
content: "";
|
|
1832
|
-
position: absolute;
|
|
1833
|
-
top: 0;
|
|
1834
|
-
right: 0;
|
|
1835
|
-
width: 100%;
|
|
1836
|
-
height: 100%;
|
|
1837
|
-
border-top: 1px solid currentColor;
|
|
1838
|
-
border-right: 1px solid currentColor;
|
|
1839
|
-
box-sizing: border-box;
|
|
1840
|
-
}
|
|
1841
|
-
.r-content-link-external::before {
|
|
1842
|
-
content: "";
|
|
1843
|
-
position: absolute;
|
|
1844
|
-
top: 0;
|
|
1845
|
-
right: 0;
|
|
1846
|
-
width: 3px;
|
|
1847
|
-
height: 3px;
|
|
1848
|
-
background-color: currentColor;
|
|
1849
|
-
border-radius: 0 0 0 4px;
|
|
1850
|
-
box-sizing: border-box;
|
|
1851
1809
|
}.r-copy-button {
|
|
1852
1810
|
position: relative;
|
|
1853
1811
|
padding: 6px;
|
|
@@ -1919,6 +1877,59 @@
|
|
|
1919
1877
|
.r-copy-text:active,
|
|
1920
1878
|
.r-copy-text._active {
|
|
1921
1879
|
color: var(--r-success);
|
|
1880
|
+
}.r-content-link {
|
|
1881
|
+
text-decoration: none;
|
|
1882
|
+
color: inherit;
|
|
1883
|
+
text-decoration: underline;
|
|
1884
|
+
text-decoration-color: var(--r-primary-500);
|
|
1885
|
+
text-underline-offset: 3px;
|
|
1886
|
+
transition: text-decoration-offset 0.2s ease;
|
|
1887
|
+
}
|
|
1888
|
+
.r-content-link:hover {
|
|
1889
|
+
color: var(--r-main-700);
|
|
1890
|
+
text-decoration-color: var(--r-primary-400);
|
|
1891
|
+
text-underline-offset: 2px;
|
|
1892
|
+
text-decoration-thickness: 2px;
|
|
1893
|
+
}
|
|
1894
|
+
.r-content-link:active {
|
|
1895
|
+
color: var(--r-primary-600);
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
.r-content-link-external {
|
|
1899
|
+
position: relative;
|
|
1900
|
+
vertical-align: text-top;
|
|
1901
|
+
display: inline-block;
|
|
1902
|
+
margin-left: -4px;
|
|
1903
|
+
margin-right: 2px;
|
|
1904
|
+
width: 6px;
|
|
1905
|
+
height: 6px;
|
|
1906
|
+
box-sizing: border-box;
|
|
1907
|
+
}
|
|
1908
|
+
.r-content-link-external::after {
|
|
1909
|
+
content: "";
|
|
1910
|
+
position: absolute;
|
|
1911
|
+
top: 0;
|
|
1912
|
+
right: 0;
|
|
1913
|
+
width: 100%;
|
|
1914
|
+
height: 100%;
|
|
1915
|
+
border-top: 1px solid currentColor;
|
|
1916
|
+
border-right: 1px solid currentColor;
|
|
1917
|
+
box-sizing: border-box;
|
|
1918
|
+
}
|
|
1919
|
+
.r-content-link-external::before {
|
|
1920
|
+
content: "";
|
|
1921
|
+
position: absolute;
|
|
1922
|
+
top: 0;
|
|
1923
|
+
right: 0;
|
|
1924
|
+
width: 3px;
|
|
1925
|
+
height: 3px;
|
|
1926
|
+
background-color: currentColor;
|
|
1927
|
+
border-radius: 0 0 0 4px;
|
|
1928
|
+
box-sizing: border-box;
|
|
1929
|
+
}.r-ul {
|
|
1930
|
+
padding-inline-start: 2rem;
|
|
1931
|
+
margin-block-start: 1em;
|
|
1932
|
+
margin-block-end: 1em;
|
|
1922
1933
|
}.r-li {
|
|
1923
1934
|
line-height: 1.8;
|
|
1924
1935
|
margin-block-start: 6px;
|
|
@@ -1931,24 +1942,18 @@
|
|
|
1931
1942
|
margin-block-start: 6px;
|
|
1932
1943
|
margin-block-end: 6px;
|
|
1933
1944
|
}.r-ol {
|
|
1934
|
-
padding-inline-start:
|
|
1935
|
-
list-style-position: inside;
|
|
1936
|
-
margin-block-start: 1em;
|
|
1937
|
-
margin-block-end: 1em;
|
|
1938
|
-
}.r-ul {
|
|
1939
|
-
padding-inline-start: 0;
|
|
1940
|
-
list-style-position: inside;
|
|
1945
|
+
padding-inline-start: 2rem;
|
|
1941
1946
|
margin-block-start: 1em;
|
|
1942
1947
|
margin-block-end: 1em;
|
|
1948
|
+
}.r-td {
|
|
1949
|
+
padding: 6px 12px;
|
|
1950
|
+
border-bottom: 1px solid var(--r-main-400);
|
|
1951
|
+
border-collapse: collapse;
|
|
1943
1952
|
}.r-table {
|
|
1944
1953
|
min-width: 100%;
|
|
1945
1954
|
text-align: left;
|
|
1946
1955
|
border-collapse: collapse;
|
|
1947
1956
|
box-sizing: border-box;
|
|
1948
|
-
}.r-td {
|
|
1949
|
-
padding: 6px 12px;
|
|
1950
|
-
border-bottom: 1px solid var(--r-main-400);
|
|
1951
|
-
border-collapse: collapse;
|
|
1952
1957
|
}.r-th {
|
|
1953
1958
|
padding: 6px 12px;
|
|
1954
1959
|
border-top: 1px solid var(--r-main-500);
|
|
@@ -1956,6 +1961,8 @@
|
|
|
1956
1961
|
border-collapse: collapse;
|
|
1957
1962
|
}.r-thead {
|
|
1958
1963
|
background-color: var(--r-main-100);
|
|
1964
|
+
}.r-task-ol {
|
|
1965
|
+
list-style: none;
|
|
1959
1966
|
}.r-task-li.r-task-li {
|
|
1960
1967
|
margin-block-start: 2px;
|
|
1961
1968
|
margin-block-end: 2px;
|
|
@@ -1985,8 +1992,6 @@
|
|
|
1985
1992
|
|
|
1986
1993
|
.r-task-label-text {
|
|
1987
1994
|
vertical-align: middle;
|
|
1988
|
-
}.r-task-ol {
|
|
1989
|
-
list-style: none;
|
|
1990
1995
|
}.r-task-ul {
|
|
1991
1996
|
list-style: none;
|
|
1992
1997
|
}.r-backdrop {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "robindoc",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-dc26dca",
|
|
4
4
|
"description": "Robindoc is a framework for automatically creating documentation websites based on markdown files, built on React.js Server Components",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"scripts": {
|