robindoc 0.0.0-experimental-e502245 → 0.0.0-experimental-8087dfb
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/contexts/contents/provider.d.ts.map +1 -1
- package/lib/components/contexts/contents/provider.js +1 -1
- package/lib/components/contexts/contents/provider.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 +171 -171
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/components/contexts/contents/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/components/contexts/contents/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAkD9D,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import e,{useState as t,useRef as n,useCallback as r,useEffect as o}from"react";import{HeadingsContext as c,CurrentHeadingContext as i}from"./context.js";const d=({children:d})=>{const[u
|
|
2
|
+
import e,{useState as t,useRef as n,useCallback as r,useEffect as o}from"react";import{HeadingsContext as c,CurrentHeadingContext as i}from"./context.js";const d=({children:d})=>{const[l,u]=t({from:0,to:0}),m=n([]),s=r(()=>{const e=m.current.findLastIndex(e=>e.getBoundingClientRect().top<40),t=e+1,n=m.current.slice(t).findIndex(e=>e.getBoundingClientRect().top<window.innerHeight)+t,r=-1===n?m.current.length:n;u(t=>t.from!==e||t.to!==r?{from:e,to:r}:t)},[]);return o(()=>{let e=!1;const t=document.querySelector(".r-root");if(!t)return;const n=t===document.documentElement?window:t,r=()=>{!e&&window.innerWidth>1080&&(e=!0,setTimeout(()=>{s(),e=!1},100))};return s(),n.addEventListener("scroll",r),()=>{n.removeEventListener("scroll",r)}},[]),e.createElement(c.Provider,{value:m.current},e.createElement(i.Provider,{value:l},d))};export{d as ContentsProvider};
|
|
3
3
|
//# sourceMappingURL=provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sources":["../../../../src/components/contexts/contents/provider.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { CurrentHeadingContext, HeadingsContext } from \"./context\";\n\nexport const ContentsProvider: React.FC<React.PropsWithChildren> = ({ children }) => {\n const [activeIndex, setActiveIndex] = useState<{ from: number; to: number }>({ from: 0, to: 0 });\n const headings = useRef<HTMLHeadingElement[]>([]);\n\n const updateTargetSection = useCallback(() => {\n const fromIndex = headings.current.findLastIndex((el) => el.getBoundingClientRect().top < 40);\n const
|
|
1
|
+
{"version":3,"file":"provider.js","sources":["../../../../src/components/contexts/contents/provider.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { CurrentHeadingContext, HeadingsContext } from \"./context\";\n\nexport const ContentsProvider: React.FC<React.PropsWithChildren> = ({ children }) => {\n const [activeIndex, setActiveIndex] = useState<{ from: number; to: number }>({ from: 0, to: 0 });\n const headings = useRef<HTMLHeadingElement[]>([]);\n\n const updateTargetSection = useCallback(() => {\n const fromIndex = headings.current.findLastIndex((el) => el.getBoundingClientRect().top < 40);\n const searchToStartIndex = fromIndex + 1;\n const toIndex =\n headings.current\n .slice(searchToStartIndex)\n .findIndex((el) => el.getBoundingClientRect().top < window.innerHeight) + searchToStartIndex;\n\n const finalToIndex = toIndex === -1 ? headings.current.length : toIndex;\n\n setActiveIndex((prev) =>\n prev.from !== fromIndex || prev.to !== finalToIndex ? { from: fromIndex, to: finalToIndex } : prev,\n );\n }, []);\n\n useEffect(() => {\n let scheduledAnimationFrame = false;\n const rootElement = document.querySelector<HTMLElement>(\".r-root\");\n\n if (!rootElement) return;\n\n const scrollElement = rootElement === document.documentElement ? window : rootElement;\n\n const scrollHandler = () => {\n if (!scheduledAnimationFrame && window.innerWidth > 1080) {\n scheduledAnimationFrame = true;\n setTimeout(() => {\n updateTargetSection();\n scheduledAnimationFrame = false;\n }, 100);\n }\n };\n\n updateTargetSection();\n scrollElement.addEventListener(\"scroll\", scrollHandler);\n\n return () => {\n scrollElement.removeEventListener(\"scroll\", scrollHandler);\n };\n }, []);\n\n return (\n <HeadingsContext.Provider value={headings.current}>\n <CurrentHeadingContext.Provider value={activeIndex}>{children}</CurrentHeadingContext.Provider>\n </HeadingsContext.Provider>\n );\n};\n"],"names":["ContentsProvider","children","activeIndex","setActiveIndex","useState","from","to","headings","useRef","updateTargetSection","useCallback","fromIndex","current","findLastIndex","el","getBoundingClientRect","top","searchToStartIndex","toIndex","slice","findIndex","window","innerHeight","finalToIndex","length","prev","useEffect","scheduledAnimationFrame","rootElement","document","querySelector","scrollElement","documentElement","scrollHandler","innerWidth","setTimeout","addEventListener","removeEventListener","React","createElement","HeadingsContext","Provider","value","CurrentHeadingContext"],"mappings":";gKAKaA,CAAAA,CAAsD,CAAA,CAAGC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAClE,MAAOC,CAAAA,CAAaC,CAAAA,CAAAA,CAAkBC,CAAAA,CAAuC,CAAEC,CAAAA,CAAAA,CAAAA,CAAAA,CAAM,CAAA,CAAGC,CAAAA,CAAAA,CAAI,CAAA,CAAA,CAAA,CACtFC,EAAWC,CAAAA,CAA6B,CAAA,CAAA,CAAA,CAExCC,CAAAA,CAAsBC,CAAAA,CAAY,CAAA,CAAA,CAAA,CAAA,CACpC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,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAQ,CAACC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAOxC,GAAcD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/elements/article/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAGxD,OAAO,EAAE,KAAK,cAAc,EAAE,4BAAsC;AAGpE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM;;;CAmB5C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,WAEnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,YAEjD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM;;;;;CAmBxC,CAAC;AAEF,eAAO,MAAM,cAAc,GACvB,OAAO,KAAK,GAAG,KAAK,EAAE,EACtB,WAAW;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,YAa/E,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,iBAAiB,MAAM,EAAE,QAAQ,SAAS;;;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/elements/article/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAGxD,OAAO,EAAE,KAAK,cAAc,EAAE,4BAAsC;AAGpE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM;;;CAmB5C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,WAEnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,YAEjD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM;;;;;CAmBxC,CAAC;AAEF,eAAO,MAAM,cAAc,GACvB,OAAO,KAAK,GAAG,KAAK,EAAE,EACtB,WAAW;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,YAa/E,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,iBAAiB,MAAM,EAAE,QAAQ,SAAS;;;CAyBtF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO;;;;;;;;;;;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,E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C,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,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,K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IsC,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
|
@@ -394,13 +394,13 @@
|
|
|
394
394
|
min-height: calc(100dvh - var(--r-header-height));
|
|
395
395
|
overflow-wrap: break-word;
|
|
396
396
|
box-sizing: border-box;
|
|
397
|
+
}.r-keylink.keylink-to-navigation:focus {
|
|
398
|
+
margin-top: -40px;
|
|
397
399
|
}.keylink-to-content {
|
|
398
400
|
position: absolute !important;
|
|
399
401
|
top: 8px;
|
|
400
402
|
left: 12px;
|
|
401
403
|
z-index: 1001;
|
|
402
|
-
}.r-keylink.keylink-to-navigation:focus {
|
|
403
|
-
margin-top: -40px;
|
|
404
404
|
}.r-article {
|
|
405
405
|
padding: 20px 0 40px;
|
|
406
406
|
grid-area: content;
|
|
@@ -725,94 +725,6 @@
|
|
|
725
725
|
|
|
726
726
|
.r-sidebar-drop[open] > .r-sidebar-drop-btn > .r-sidebar-drop-icon {
|
|
727
727
|
transform: rotate(90deg);
|
|
728
|
-
}.r-header-menu {
|
|
729
|
-
display: flex;
|
|
730
|
-
justify-content: flex-end;
|
|
731
|
-
order: 1;
|
|
732
|
-
}
|
|
733
|
-
@media screen and (width >= 1024px) {
|
|
734
|
-
.r-header-menu {
|
|
735
|
-
flex: 1;
|
|
736
|
-
order: unset;
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
.r-header-input:checked ~ .r-header-burger ~ .r-header-responsive {
|
|
741
|
-
display: flex;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
.r-header-responsive {
|
|
745
|
-
display: none;
|
|
746
|
-
justify-content: flex-end;
|
|
747
|
-
flex: 1;
|
|
748
|
-
gap: 24px;
|
|
749
|
-
z-index: 1;
|
|
750
|
-
}
|
|
751
|
-
@media screen and (width < 1024px) {
|
|
752
|
-
.r-header-responsive {
|
|
753
|
-
flex-direction: column-reverse;
|
|
754
|
-
padding: 12px;
|
|
755
|
-
background-color: var(--r-main-50);
|
|
756
|
-
position: fixed;
|
|
757
|
-
top: 60px;
|
|
758
|
-
right: 0;
|
|
759
|
-
bottom: 0;
|
|
760
|
-
left: 0;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
@media screen and (width >= 1024px) {
|
|
764
|
-
.r-header-responsive {
|
|
765
|
-
display: flex;
|
|
766
|
-
justify-content: space-between;
|
|
767
|
-
align-items: center;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
.r-header-burger {
|
|
772
|
-
position: relative;
|
|
773
|
-
display: flex;
|
|
774
|
-
align-items: center;
|
|
775
|
-
justify-content: center;
|
|
776
|
-
height: 32px;
|
|
777
|
-
width: 32px;
|
|
778
|
-
cursor: pointer;
|
|
779
|
-
background: none;
|
|
780
|
-
border: none;
|
|
781
|
-
box-sizing: border-box;
|
|
782
|
-
}
|
|
783
|
-
@media screen and (width >= 1024px) {
|
|
784
|
-
.r-header-burger {
|
|
785
|
-
display: none;
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
.r-burger-line {
|
|
790
|
-
display: block;
|
|
791
|
-
width: 20px;
|
|
792
|
-
height: 1.5px;
|
|
793
|
-
position: absolute;
|
|
794
|
-
background-color: var(--r-main-700);
|
|
795
|
-
margin: auto;
|
|
796
|
-
transition: transform 0.3s;
|
|
797
|
-
box-sizing: border-box;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
.r-burger-line._top {
|
|
801
|
-
transform: translateY(-3px);
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
.r-header-input:checked ~ .r-header-burger .r-burger-line._top {
|
|
805
|
-
transform: translateY(0) rotate(45deg);
|
|
806
|
-
margin-top: 0;
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
.r-burger-line._bottom {
|
|
810
|
-
transform: translateY(3px);
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
.r-header-input:checked ~ .r-header-burger .r-burger-line._bottom {
|
|
814
|
-
transform: translateY(0) rotate(-45deg);
|
|
815
|
-
margin-top: 0;
|
|
816
728
|
}.r-search-btn {
|
|
817
729
|
position: relative;
|
|
818
730
|
border-radius: 6px;
|
|
@@ -929,6 +841,112 @@
|
|
|
929
841
|
font-size: 14px;
|
|
930
842
|
color: var(--r-main-600);
|
|
931
843
|
margin: 12px 0 0;
|
|
844
|
+
}.r-header-menu {
|
|
845
|
+
display: flex;
|
|
846
|
+
justify-content: flex-end;
|
|
847
|
+
order: 1;
|
|
848
|
+
}
|
|
849
|
+
@media screen and (width >= 1024px) {
|
|
850
|
+
.r-header-menu {
|
|
851
|
+
flex: 1;
|
|
852
|
+
order: unset;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.r-header-input:checked ~ .r-header-burger ~ .r-header-responsive {
|
|
857
|
+
display: flex;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
.r-header-responsive {
|
|
861
|
+
display: none;
|
|
862
|
+
justify-content: flex-end;
|
|
863
|
+
flex: 1;
|
|
864
|
+
gap: 24px;
|
|
865
|
+
z-index: 1;
|
|
866
|
+
}
|
|
867
|
+
@media screen and (width < 1024px) {
|
|
868
|
+
.r-header-responsive {
|
|
869
|
+
flex-direction: column-reverse;
|
|
870
|
+
padding: 12px;
|
|
871
|
+
background-color: var(--r-main-50);
|
|
872
|
+
position: fixed;
|
|
873
|
+
top: 60px;
|
|
874
|
+
right: 0;
|
|
875
|
+
bottom: 0;
|
|
876
|
+
left: 0;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
@media screen and (width >= 1024px) {
|
|
880
|
+
.r-header-responsive {
|
|
881
|
+
display: flex;
|
|
882
|
+
justify-content: space-between;
|
|
883
|
+
align-items: center;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.r-header-burger {
|
|
888
|
+
position: relative;
|
|
889
|
+
display: flex;
|
|
890
|
+
align-items: center;
|
|
891
|
+
justify-content: center;
|
|
892
|
+
height: 32px;
|
|
893
|
+
width: 32px;
|
|
894
|
+
cursor: pointer;
|
|
895
|
+
background: none;
|
|
896
|
+
border: none;
|
|
897
|
+
box-sizing: border-box;
|
|
898
|
+
}
|
|
899
|
+
@media screen and (width >= 1024px) {
|
|
900
|
+
.r-header-burger {
|
|
901
|
+
display: none;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
.r-burger-line {
|
|
906
|
+
display: block;
|
|
907
|
+
width: 20px;
|
|
908
|
+
height: 1.5px;
|
|
909
|
+
position: absolute;
|
|
910
|
+
background-color: var(--r-main-700);
|
|
911
|
+
margin: auto;
|
|
912
|
+
transition: transform 0.3s;
|
|
913
|
+
box-sizing: border-box;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
.r-burger-line._top {
|
|
917
|
+
transform: translateY(-3px);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
.r-header-input:checked ~ .r-header-burger .r-burger-line._top {
|
|
921
|
+
transform: translateY(0) rotate(45deg);
|
|
922
|
+
margin-top: 0;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
.r-burger-line._bottom {
|
|
926
|
+
transform: translateY(3px);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.r-header-input:checked ~ .r-header-burger .r-burger-line._bottom {
|
|
930
|
+
transform: translateY(0) rotate(-45deg);
|
|
931
|
+
margin-top: 0;
|
|
932
|
+
}.r-header-social {
|
|
933
|
+
display: flex;
|
|
934
|
+
flex: 1;
|
|
935
|
+
justify-content: flex-end;
|
|
936
|
+
}
|
|
937
|
+
@media screen and (width >= 1024px) {
|
|
938
|
+
.r-header-social {
|
|
939
|
+
flex: none;
|
|
940
|
+
justify-content: unset;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
.r-header-social-git {
|
|
945
|
+
color: var(--r-main-700);
|
|
946
|
+
transition: color 0.2s;
|
|
947
|
+
}
|
|
948
|
+
.r-header-social-git:hover, .r-header-social-git:focus {
|
|
949
|
+
color: var(--r-main-950);
|
|
932
950
|
}.r-dropdown {
|
|
933
951
|
position: relative;
|
|
934
952
|
color: var(--r-main-600);
|
|
@@ -1008,24 +1026,6 @@
|
|
|
1008
1026
|
|
|
1009
1027
|
.r-dropdown-link._active {
|
|
1010
1028
|
color: var(--r-primary-700);
|
|
1011
|
-
}.r-header-social {
|
|
1012
|
-
display: flex;
|
|
1013
|
-
flex: 1;
|
|
1014
|
-
justify-content: flex-end;
|
|
1015
|
-
}
|
|
1016
|
-
@media screen and (width >= 1024px) {
|
|
1017
|
-
.r-header-social {
|
|
1018
|
-
flex: none;
|
|
1019
|
-
justify-content: unset;
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
.r-header-social-git {
|
|
1024
|
-
color: var(--r-main-700);
|
|
1025
|
-
transition: color 0.2s;
|
|
1026
|
-
}
|
|
1027
|
-
.r-header-social-git:hover, .r-header-social-git:focus {
|
|
1028
|
-
color: var(--r-main-950);
|
|
1029
1029
|
}.r-container {
|
|
1030
1030
|
max-width: 1180px;
|
|
1031
1031
|
padding-right: 12px;
|
|
@@ -1124,6 +1124,47 @@
|
|
|
1124
1124
|
user-select: none;
|
|
1125
1125
|
pointer-events: none;
|
|
1126
1126
|
box-sizing: border-box;
|
|
1127
|
+
}.r-breadcrumbs {
|
|
1128
|
+
grid-area: breadcrumbs;
|
|
1129
|
+
list-style: none;
|
|
1130
|
+
margin: 0;
|
|
1131
|
+
padding: 20px 0 0;
|
|
1132
|
+
line-height: 2;
|
|
1133
|
+
}
|
|
1134
|
+
@media screen and (width >= 768px) {
|
|
1135
|
+
.r-breadcrumbs {
|
|
1136
|
+
padding: 32px 0 0;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
.r-breadcrumb {
|
|
1141
|
+
display: inline;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
.r-breadcrumb._previous::after {
|
|
1145
|
+
content: "/";
|
|
1146
|
+
font-weight: 600;
|
|
1147
|
+
margin-inline: 8px;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
.r-breadcrumb-link {
|
|
1151
|
+
color: var(--r-main-700);
|
|
1152
|
+
text-decoration: none;
|
|
1153
|
+
}
|
|
1154
|
+
.r-breadcrumb-link:hover {
|
|
1155
|
+
color: var(--r-primary-800);
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
.r-breadcrumb-link,
|
|
1159
|
+
.r-breadcrumb-title {
|
|
1160
|
+
display: inline;
|
|
1161
|
+
padding: 6px 0;
|
|
1162
|
+
margin: 0;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
.r-breadcrumb-title {
|
|
1166
|
+
color: var(--r-main-950);
|
|
1167
|
+
font-weight: 600;
|
|
1127
1168
|
}.r-contents {
|
|
1128
1169
|
grid-area: contents;
|
|
1129
1170
|
}
|
|
@@ -1357,47 +1398,6 @@
|
|
|
1357
1398
|
}
|
|
1358
1399
|
.r-contents-git:hover {
|
|
1359
1400
|
color: var(--r-main-900);
|
|
1360
|
-
}.r-breadcrumbs {
|
|
1361
|
-
grid-area: breadcrumbs;
|
|
1362
|
-
list-style: none;
|
|
1363
|
-
margin: 0;
|
|
1364
|
-
padding: 20px 0 0;
|
|
1365
|
-
line-height: 2;
|
|
1366
|
-
}
|
|
1367
|
-
@media screen and (width >= 768px) {
|
|
1368
|
-
.r-breadcrumbs {
|
|
1369
|
-
padding: 32px 0 0;
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
.r-breadcrumb {
|
|
1374
|
-
display: inline;
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
|
-
.r-breadcrumb._previous::after {
|
|
1378
|
-
content: "/";
|
|
1379
|
-
font-weight: 600;
|
|
1380
|
-
margin-inline: 8px;
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
.r-breadcrumb-link {
|
|
1384
|
-
color: var(--r-main-700);
|
|
1385
|
-
text-decoration: none;
|
|
1386
|
-
}
|
|
1387
|
-
.r-breadcrumb-link:hover {
|
|
1388
|
-
color: var(--r-primary-800);
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
.r-breadcrumb-link,
|
|
1392
|
-
.r-breadcrumb-title {
|
|
1393
|
-
display: inline;
|
|
1394
|
-
padding: 6px 0;
|
|
1395
|
-
margin: 0;
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
.r-breadcrumb-title {
|
|
1399
|
-
color: var(--r-main-950);
|
|
1400
|
-
font-weight: 600;
|
|
1401
1401
|
}.r-pagination {
|
|
1402
1402
|
grid-area: pagination;
|
|
1403
1403
|
display: grid;
|
|
@@ -1640,6 +1640,19 @@
|
|
|
1640
1640
|
}
|
|
1641
1641
|
.r-blockquote-caution .r-blockquote-title {
|
|
1642
1642
|
color: var(--r-caution);
|
|
1643
|
+
}.r-code-block {
|
|
1644
|
+
font-family: var(--monospace-font, monospace, monospace);
|
|
1645
|
+
font-size: 16px;
|
|
1646
|
+
line-height: 1.33;
|
|
1647
|
+
border-radius: 6px;
|
|
1648
|
+
padding: 16px 20px;
|
|
1649
|
+
margin: 0;
|
|
1650
|
+
color: var(--r-primary-800);
|
|
1651
|
+
background-color: var(--r-main-50);
|
|
1652
|
+
overflow-x: auto;
|
|
1653
|
+
scrollbar-width: thin;
|
|
1654
|
+
scrollbar-color: var(--r-main-200) transparent;
|
|
1655
|
+
box-sizing: border-box;
|
|
1643
1656
|
}.r-code-span {
|
|
1644
1657
|
font-family: var(--monospace-font, monospace, monospace);
|
|
1645
1658
|
background-color: var(--r-main-100);
|
|
@@ -1654,19 +1667,6 @@
|
|
|
1654
1667
|
|
|
1655
1668
|
.r-code-span + .r-content-link-external {
|
|
1656
1669
|
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
1670
|
}.r-h1 {
|
|
1671
1671
|
font-size: 32px;
|
|
1672
1672
|
line-height: 1.4;
|
|
@@ -1945,20 +1945,15 @@
|
|
|
1945
1945
|
padding-inline-start: 2rem;
|
|
1946
1946
|
margin-block-start: 1em;
|
|
1947
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;
|
|
1948
1952
|
}.r-table {
|
|
1949
1953
|
min-width: 100%;
|
|
1950
1954
|
text-align: left;
|
|
1951
1955
|
border-collapse: collapse;
|
|
1952
1956
|
box-sizing: border-box;
|
|
1953
|
-
}.r-th {
|
|
1954
|
-
padding: 6px 12px;
|
|
1955
|
-
border-top: 1px solid var(--r-main-500);
|
|
1956
|
-
border-bottom: 1px solid var(--r-main-500);
|
|
1957
|
-
border-collapse: collapse;
|
|
1958
|
-
}.r-td {
|
|
1959
|
-
padding: 6px 12px;
|
|
1960
|
-
border-bottom: 1px solid var(--r-main-400);
|
|
1961
|
-
border-collapse: collapse;
|
|
1962
1957
|
}.r-thead {
|
|
1963
1958
|
background-color: var(--r-main-100);
|
|
1964
1959
|
}.r-task-li.r-task-li {
|
|
@@ -1990,6 +1985,11 @@
|
|
|
1990
1985
|
|
|
1991
1986
|
.r-task-label-text {
|
|
1992
1987
|
vertical-align: middle;
|
|
1988
|
+
}.r-th {
|
|
1989
|
+
padding: 6px 12px;
|
|
1990
|
+
border-top: 1px solid var(--r-main-500);
|
|
1991
|
+
border-bottom: 1px solid var(--r-main-500);
|
|
1992
|
+
border-collapse: collapse;
|
|
1993
1993
|
}.r-task-ol {
|
|
1994
1994
|
list-style: none;
|
|
1995
1995
|
}.r-task-ul {
|
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-8087dfb",
|
|
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": {
|