robindoc 0.0.0-experimental-0477e0c → 0.0.0-experimental-5d28895
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/core/utils/parse-structure.d.ts +1 -1
- package/lib/core/utils/parse-structure.d.ts.map +1 -1
- package/lib/core/utils/parse-structure.js +1 -1
- package/lib/core/utils/parse-structure.js.map +1 -1
- package/lib/core/utils/structure-tools.d.ts +26 -0
- package/lib/core/utils/structure-tools.d.ts.map +1 -0
- package/lib/core/utils/structure-tools.js +2 -0
- package/lib/core/utils/structure-tools.js.map +1 -0
- package/lib/styles.css +213 -213
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DocItem } from "../types/structure";
|
|
2
2
|
import { type Pages, type Crumbs, type Configuration } from "../types/content";
|
|
3
3
|
import { type TreeItem } from "../../components/elements/sidebar/types";
|
|
4
|
-
export declare const parseStructure: (items: DocItem[] | "auto",
|
|
4
|
+
export declare const parseStructure: (items: DocItem[] | "auto", configuration?: Configuration, crumbs?: Crumbs, pathname?: string) => Promise<{
|
|
5
5
|
pages: Pages;
|
|
6
6
|
tree: TreeItem[];
|
|
7
7
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-structure.d.ts","sourceRoot":"","sources":["../../../src/core/utils/parse-structure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"parse-structure.d.ts","sourceRoot":"","sources":["../../../src/core/utils/parse-structure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAwKxE,eAAO,MAAM,cAAc,GACvB,OAAO,OAAO,EAAE,GAAG,MAAM,EACzB,gBAAe,aAAkB,EACjC,SAAQ,MAAW,EACnB,WAAU,MAAW;;;EAOxB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getConfiguration as t}from"./get-configuration.js";import{getMetadata as e}from"./get-metadata.js";import{
|
|
1
|
+
import{getConfiguration as t}from"./get-configuration.js";import{getMetadata as e}from"./get-metadata.js";import{normalizePathname as r,mergePathname as s,generatePseudoTitle as a,checkIsLinkExternal as i}from"./path-tools.js";import{loadContent as o}from"./load-content.js";import{createPage as n,shouldSpread as p,createTreeItem as c}from"./structure-tools.js";const u=async(t,i,f)=>{if(!t.provider)return{pages:{},tree:[]};const l=await(async(t,e,a)=>{if(!t.provider)return null;const i=`${e}/structure.json`;if(!(await t.provider.filesPromise).structures.includes(i))return null;const p=await o(i,t.provider);let f;try{f=JSON.parse(p.data)}catch{throw new Error(`Can't parse structure "${i}"`)}const l={},h=[];for(const i in f){const{title:o}=f[i],p=r("index"===i?e:`${e}/${i}`),g=r(s(t.basePath,p)),d=await n(g,p,o,t,a);let m;if(d&&(l[d.pathname]=d.page),"index"!==i){const e=await u(t,d?[...a,g]:a,p);m=e.tree,Object.assign(l,e.pages)}h.push(c(o,g,"row",m))}return{pages:l,tree:h}})(t,f,i);if(l)return l;const h={},g=[],d=f.split("/"),m=d.length,w=await t.provider.filesPromise;for await(const{clientPath:o}of w.docs){const l=o.split("/").length===d.length+1,w=o.startsWith(f);if(!l||!w)continue;const j=r(s(t.basePath,o)),v=(await e({provider:t.provider,uri:o})).title||a(j),y=await n(j,o,v,t,i);y&&(h[y.pathname]=y.page);const b=await u(t,y?[...i,j]:i,o),P=m<=1?"heading":"row";p(m,t.spreadedLevel)?g.push(c(v,j,P),...b.tree):g.push(c(v,j,P,b.tree)),Object.assign(h,b.pages)}return{pages:h,tree:g}},f=async(e,o={},l=[],h="")=>"auto"===e?u(o,l,h):(async(e,o,u,l)=>{const h={},g=[],d=l.split("/").length;for await(const m of e){if("string"==typeof m){const t=await f(m,o,u,l);Object.assign(h,t.pages),g.push(...t.tree);continue}if("separator"===m.type){g.push({type:"separator"});continue}const e=t(m.configuration||{},o),w=m.href||"",j=r(s(e.basePath,w));let v=u;if(w&&!i(j)){const t=await n(j,w,m.title||"",e,u);t&&(h[t.pathname]=t.page,v=[...u,j])}let y=[];if(m.items){const t=await f(m.items,e,v,m.href||"");y=t.tree,Object.assign(h,t.pages)}if(m.hidden)continue;const b=m.title||a(j),P=m.href?j:void 0;p(d,o.spreadedLevel)?g.push(c(b,P,m.type),...y):g.push(c(b,P,m.type,y))}return{pages:h,tree:g}})(e,o,l,h);export{f as parseStructure};
|
|
2
2
|
//# sourceMappingURL=parse-structure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-structure.js","sources":["../../../src/core/utils/parse-structure.ts"],"sourcesContent":["import { type DocItem } from \"../types/structure\";\nimport { type Pages, type Crumbs, type Configuration } from \"../types/content\";\nimport { type TreeItem } from \"../../components/elements/sidebar/types\";\nimport { getConfiguration } from \"./get-configuration\";\nimport { getMetadata } from \"./get-metadata\";\nimport { generatePseudoTitle, checkIsLinkExternal, mergePathname, normalizePathname } from \"./path-tools\";\nimport { loadContent } from \"./load-content\";\n\nconst parseJSONStructure = async (\n parentConfiguration: Configuration = {},\n parentPathname = \"\",\n crumbs: Crumbs = [],\n nestingLevel: number,\n) => {\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n\n if (!parentConfiguration.provider) return { pages, tree };\n\n const branchFiles = await parentConfiguration.provider.filesPromise;\n\n if (branchFiles.structures.includes(`${parentPathname}/structure.json`)) {\n const content = await loadContent(`${parentPathname}/structure.json`, parentConfiguration.provider);\n try {\n const structure: { [segment: string]: { title: string } } = JSON.parse(content.data);\n for (const segment in structure) {\n const data = structure[segment];\n const clientPath = normalizePathname(\n segment === \"index\" ? parentPathname : parentPathname + \"/\" + segment,\n );\n const pathname = mergePathname(parentConfiguration.basePath, clientPath);\n const pathnameNormalized = normalizePathname(pathname);\n\n if (!checkIsLinkExternal(pathnameNormalized)) {\n const origPath = await parentConfiguration.provider?.getPageSourcePathname(\n clientPath,\n pathnameNormalized,\n );\n if (origPath) {\n pages[pathnameNormalized] = {\n title: data.title,\n uri: clientPath,\n configuration: parentConfiguration,\n origPath,\n crumbs,\n };\n }\n }\n\n let subTree: TreeItem[] | undefined;\n if (segment !== \"index\") {\n const subItemsData = await parseAutoStructure(\n parentConfiguration,\n [...crumbs, pathnameNormalized],\n clientPath,\n nestingLevel + 1,\n );\n subTree = subItemsData.tree;\n Object.assign(pages, subItemsData.pages);\n }\n\n tree.push({\n title: data.title,\n href: pathnameNormalized,\n items: subTree,\n type: \"row\",\n });\n }\n } catch {\n throw new Error(`Can't parse structure \"${parentPathname}/structure.json\"`);\n }\n return { pages, tree };\n }\n};\n\nconst parseAutoStructure = async (\n parentConfiguration: Configuration = {},\n crumbs: Crumbs = [],\n parentPathname = \"\",\n nestingLevel: number,\n) => {\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n\n if (!parentConfiguration.provider) return { pages, tree };\n\n const branchFiles = await parentConfiguration.provider.filesPromise;\n\n if (branchFiles.structures.includes(`${parentPathname}/structure.json`)) {\n const jsonStructureData = await parseJSONStructure(\n parentConfiguration,\n parentPathname,\n crumbs,\n nestingLevel + 1,\n );\n if (jsonStructureData) {\n return jsonStructureData;\n }\n }\n\n for await (const generatedItem of branchFiles.docs) {\n const linkLevel = generatedItem.clientPath.split(\"/\").filter(Boolean).length;\n const topLevelLink = linkLevel < 2;\n\n if (\n (!parentPathname && !topLevelLink) ||\n (parentPathname &&\n !generatedItem.clientPath.match(new RegExp(`^${parentPathname.replace(/\\/$/, \"\")}/[^/]+$`)))\n ) {\n continue;\n }\n\n const { clientPath } = generatedItem;\n const pathname = mergePathname(parentConfiguration.basePath, clientPath);\n const pathnameNormalized = normalizePathname(pathname);\n\n const metadata = await getMetadata({ provider: parentConfiguration.provider, uri: clientPath });\n const title = metadata.title || generatePseudoTitle(pathnameNormalized);\n const origPath = await parentConfiguration.provider?.getPageSourcePathname(clientPath, pathnameNormalized);\n if (origPath) {\n pages[pathnameNormalized] = {\n title,\n uri: clientPath,\n configuration: parentConfiguration,\n origPath,\n crumbs,\n };\n }\n\n const subItemsData = await parseAutoStructure(\n parentConfiguration,\n [...crumbs, pathnameNormalized],\n clientPath,\n nestingLevel + 1,\n );\n Object.assign(pages, subItemsData.pages);\n\n if (nestingLevel < (parentConfiguration.spreadedLevel || 1)) {\n tree.push(\n {\n title,\n href: pathnameNormalized,\n type: nestingLevel === 0 ? \"heading\" : \"row\",\n },\n ...subItemsData.tree,\n );\n } else {\n tree.push({\n title,\n href: pathnameNormalized,\n items: subItemsData.tree,\n type: nestingLevel === 0 ? \"heading\" : \"row\",\n });\n }\n }\n\n return { pages, tree };\n};\n\nconst parseStaticStructure = async (\n items: DocItem[],\n parentConfiguration: Configuration = {},\n crumbs: Crumbs = [],\n parentPathname: string,\n nestingLevel: number,\n): Promise<{\n pages: Pages;\n tree: TreeItem[];\n}> => {\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n\n for await (const item of items) {\n if (typeof item === \"string\") {\n const subItemsData = await parseStructure(item, parentConfiguration, crumbs, parentPathname, nestingLevel);\n Object.assign(pages, subItemsData.pages);\n tree.push(...subItemsData.tree);\n continue;\n }\n if (item.type === \"separator\") {\n tree.push({ type: \"separator\" });\n\n continue;\n }\n let subCrumbs = crumbs;\n const configuration = getConfiguration(item.configuration || {}, parentConfiguration);\n const clientPath = item.href;\n const pathname = mergePathname(configuration.basePath, clientPath);\n const pathnameNormalized = normalizePathname(pathname);\n\n if (!checkIsLinkExternal(pathnameNormalized) && clientPath) {\n const origPath = await configuration.provider?.getPageSourcePathname(clientPath, pathnameNormalized);\n\n if (origPath) {\n pages[pathnameNormalized] = {\n title: item.title || \"\",\n uri: clientPath,\n configuration,\n origPath,\n crumbs,\n };\n subCrumbs = [...crumbs, pathnameNormalized];\n }\n }\n\n let subTree: TreeItem[] = [];\n if (item.items) {\n const subItemsData = await parseStructure(\n item.items,\n configuration,\n subCrumbs,\n item.href,\n nestingLevel + 1,\n );\n subTree = subItemsData.tree;\n Object.assign(pages, subItemsData.pages);\n }\n\n if (!item.hidden) {\n if (nestingLevel < (parentConfiguration.spreadedLevel || 1)) {\n tree.push(\n {\n title: item.title || generatePseudoTitle(pathnameNormalized),\n href: item.href ? pathnameNormalized : undefined,\n type: item.type,\n },\n ...subTree,\n );\n } else {\n tree.push({\n title: item.title || generatePseudoTitle(pathnameNormalized),\n href: item.href ? pathnameNormalized : undefined,\n items: subTree,\n type: item.type,\n });\n }\n }\n }\n\n return { pages, tree };\n};\n\nexport const parseStructure = async (\n items: DocItem[] | \"auto\",\n parentConfiguration: Configuration = {},\n crumbs: Crumbs = [],\n pathname: string = \"\",\n nestingLevel: number = 0,\n) => {\n if (items === \"auto\") {\n const structureParsed = await parseAutoStructure(parentConfiguration, crumbs, pathname, nestingLevel);\n return structureParsed;\n }\n\n const structureParsed = await parseStaticStructure(items, parentConfiguration, crumbs, pathname, nestingLevel);\n return structureParsed;\n};\n"],"names":["parseAutoStructure","async","parentConfiguration","crumbs","parentPathname","nestingLevel","pages","tree","provider","branchFiles","filesPromise","structures","includes","jsonStructureData","content","loadContent","structure","JSON","parse","data","segment","clientPath","normalizePathname","pathname","mergePathname","basePath","pathnameNormalized","checkIsLinkExternal","origPath","getPageSourcePathname","title","uri","configuration","subTree","subItemsData","Object","assign","push","href","items","type","Error","parseJSONStructure","generatedItem","docs","linkLevel","split","filter","Boolean","length","match","RegExp","replace","getMetadata","generatePseudoTitle","spreadedLevel","parseStructure","structureParsed","item","subCrumbs","getConfiguration","hidden","undefined","parseSta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,SAEZP,GAGP1B,EAAK8B,KAAK,CACNP,MAAO4B,EAAK5B,OAASwB,EAAoB5B,GACzCY,KAAMoB,EAAKpB,KAAOZ,OAAqBoC,EACvCvB,MAAON,EACPO,KAAMkB,EAAKlB,OAI3B,CAEA,MAAO,CAAElC,QAAOC,SAecwD,CAAqBxB,EAAOrC,EAAqBC,EAAQoB,EAAUlB,GACjG,OAAOoD"}
|
|
1
|
+
{"version":3,"file":"parse-structure.js","sources":["../../../src/core/utils/parse-structure.ts"],"sourcesContent":["import { type DocItem } from \"../types/structure\";\nimport { type Pages, type Crumbs, type Configuration } from \"../types/content\";\nimport { type TreeItem } from \"../../components/elements/sidebar/types\";\nimport { getConfiguration } from \"./get-configuration\";\nimport { getMetadata } from \"./get-metadata\";\nimport { generatePseudoTitle, checkIsLinkExternal, mergePathname, normalizePathname } from \"./path-tools\";\nimport { loadContent } from \"./load-content\";\nimport { createPage, createTreeItem, shouldSpread } from \"./structure-tools\";\n\nconst parseJSONStructure = async (configuration: Configuration, parentPathname: string, crumbs: Crumbs) => {\n if (!configuration.provider) return null;\n\n const branchFiles = await configuration.provider.filesPromise;\n const structurePath = `${parentPathname}/structure.json`;\n\n if (!branchFiles.structures.includes(structurePath)) return null;\n\n const content = await loadContent(structurePath, configuration.provider);\n let structure: { [segment: string]: { title: string } };\n\n try {\n structure = JSON.parse(content.data);\n } catch {\n throw new Error(`Can't parse structure \"${structurePath}\"`);\n }\n\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n\n for (const segment in structure) {\n const { title } = structure[segment];\n const clientPath = normalizePathname(segment === \"index\" ? parentPathname : `${parentPathname}/${segment}`);\n const pathnameNormalized = normalizePathname(mergePathname(configuration.basePath, clientPath));\n\n const pageData = await createPage(pathnameNormalized, clientPath, title, configuration, crumbs);\n if (pageData) {\n pages[pageData.pathname] = pageData.page;\n }\n\n let subTree: TreeItem[] | undefined;\n if (segment !== \"index\") {\n const subResult = await parseAutoStructure(\n configuration,\n pageData ? [...crumbs, pathnameNormalized] : crumbs,\n clientPath,\n );\n subTree = subResult.tree;\n Object.assign(pages, subResult.pages);\n }\n\n tree.push(createTreeItem(title, pathnameNormalized, \"row\", subTree));\n }\n\n return { pages, tree };\n};\n\nconst parseAutoStructure = async (configuration: Configuration, crumbs: Crumbs, parentPathname: string) => {\n if (!configuration.provider) return { pages: {}, tree: [] };\n\n const jsonResult = await parseJSONStructure(configuration, parentPathname, crumbs);\n if (jsonResult) return jsonResult;\n\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n const parentSegments = parentPathname.split(\"/\");\n const nestingLevel = parentSegments.length;\n\n const branchFiles = await configuration.provider.filesPromise;\n\n for await (const { clientPath } of branchFiles.docs) {\n const segments = clientPath.split(\"/\");\n const isDirectChild = segments.length === parentSegments.length + 1;\n const isUnderParent = clientPath.startsWith(parentPathname);\n\n if (!isDirectChild || !isUnderParent) {\n continue;\n }\n\n const pathnameNormalized = normalizePathname(mergePathname(configuration.basePath, clientPath));\n const metadata = await getMetadata({ provider: configuration.provider, uri: clientPath });\n const title = metadata.title || generatePseudoTitle(pathnameNormalized);\n\n const pageData = await createPage(pathnameNormalized, clientPath, title, configuration, crumbs);\n if (pageData) {\n pages[pageData.pathname] = pageData.page;\n }\n\n const subResult = await parseAutoStructure(\n configuration,\n pageData ? [...crumbs, pathnameNormalized] : crumbs,\n clientPath,\n );\n const itemType = nestingLevel <= 1 ? \"heading\" : \"row\";\n\n if (shouldSpread(nestingLevel, configuration.spreadedLevel)) {\n tree.push(createTreeItem(title, pathnameNormalized, itemType), ...subResult.tree);\n } else {\n tree.push(createTreeItem(title, pathnameNormalized, itemType, subResult.tree));\n }\n\n Object.assign(pages, subResult.pages);\n }\n\n return { pages, tree };\n};\n\nconst parseStaticStructure = async (\n items: DocItem[],\n configuration: Configuration,\n crumbs: Crumbs,\n parentPathname: string,\n) => {\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n const nestingLevel = parentPathname.split(\"/\").length;\n\n for await (const item of items) {\n if (typeof item === \"string\") {\n const result = await parseStructure(item, configuration, crumbs, parentPathname);\n Object.assign(pages, result.pages);\n tree.push(...result.tree);\n continue;\n }\n\n if (item.type === \"separator\") {\n tree.push({ type: \"separator\" });\n continue;\n }\n\n const itemConfiguration = getConfiguration(item.configuration || {}, configuration);\n const clientPath = item.href || \"\";\n const pathnameNormalized = normalizePathname(mergePathname(itemConfiguration.basePath, clientPath));\n\n let subCrumbs = crumbs;\n if (clientPath && !checkIsLinkExternal(pathnameNormalized)) {\n const pageData = await createPage(\n pathnameNormalized,\n clientPath,\n item.title || \"\",\n itemConfiguration,\n crumbs,\n );\n if (pageData) {\n pages[pageData.pathname] = pageData.page;\n subCrumbs = [...crumbs, pathnameNormalized];\n }\n }\n\n let subTree: TreeItem[] = [];\n if (item.items) {\n const result = await parseStructure(item.items, itemConfiguration, subCrumbs, item.href || \"\");\n subTree = result.tree;\n Object.assign(pages, result.pages);\n }\n\n if (item.hidden) continue;\n\n const title = item.title || generatePseudoTitle(pathnameNormalized);\n const href = item.href ? pathnameNormalized : undefined;\n\n if (shouldSpread(nestingLevel, configuration.spreadedLevel)) {\n tree.push(createTreeItem(title, href, item.type), ...subTree);\n } else {\n tree.push(createTreeItem(title, href, item.type, subTree));\n }\n }\n\n return { pages, tree };\n};\n\nexport const parseStructure = async (\n items: DocItem[] | \"auto\",\n configuration: Configuration = {},\n crumbs: Crumbs = [],\n pathname: string = \"\",\n) => {\n if (items === \"auto\") {\n return parseAutoStructure(configuration, crumbs, pathname);\n }\n\n return parseStaticStructure(items, configuration, crumbs, pathname);\n};\n"],"names":["parseAutoStructure","async","configuration","crumbs","parentPathname","provider","pages","tree","jsonResult","structurePath","filesPromise","structures","includes","content","loadContent","structure","JSON","parse","data","Error","segment","title","clientPath","normalizePathname","pathnameNormalized","mergePathname","basePath","pageData","createPage","subTree","pathname","page","subResult","Object","assign","push","createTreeItem","parseJSONStructure","parentSegments","split","nestingLevel","length","branchFiles","docs","isDirectChild","isUnderParent","startsWith","getMetadata","uri","generatePseudoTitle","itemType","shouldSpread","spreadedLevel","parseStructure","items","item","result","type","itemConfiguration","getConfiguration","href","subCrumbs","checkIsLinkExternal","hidden","undefined","parseStaticStructure"],"mappings":"2WASA,MA+CMA,EAAqBC,MAAOC,EAA8BC,EAAgBC,KAC5E,IAAKF,EAAcG,SAAU,MAAO,CAAEC,MAAO,GAAIC,KAAM,IAEvD,MAAMC,OAlDiBP,OAAOC,EAA8BE,EAAwBD,KACpF,IAAKD,EAAcG,SAAU,OAAO,KAEpC,MACMI,EAAgB,GAAGL,mBAEzB,WAH0BF,EAAcG,SAASK,cAGhCC,WAAWC,SAASH,GAAgB,OAAO,KAE5D,MAAMI,QAAgBC,EAAYL,EAAeP,EAAcG,UAC/D,IAAIU,EAEJ,IACIA,EAAYC,KAAKC,MAAMJ,EAAQK,KACnC,CAAE,MACE,MAAM,IAAIC,MAAM,0BAA0BV,KAC9C,CAEA,MAAMH,EAAe,CAAA,EACfC,EAAmB,GAEzB,IAAK,MAAMa,KAAWL,EAAW,CAC7B,MAAMM,MAAEA,GAAUN,EAAUK,GACtBE,EAAaC,EAA8B,UAAZH,EAAsBhB,EAAiB,GAAGA,KAAkBgB,KAC3FI,EAAqBD,EAAkBE,EAAcvB,EAAcwB,SAAUJ,IAE7EK,QAAiBC,EAAWJ,EAAoBF,EAAYD,EAAOnB,EAAeC,GAKxF,IAAI0B,EACJ,GALIF,IACArB,EAAMqB,EAASG,UAAYH,EAASI,MAIxB,UAAZX,EAAqB,CACrB,MAAMY,QAAkBhC,EACpBE,EACAyB,EAAW,IAAIxB,EAAQqB,GAAsBrB,EAC7CmB,GAEJO,EAAUG,EAAUzB,KACpB0B,OAAOC,OAAO5B,EAAO0B,EAAU1B,MACnC,CAEAC,EAAK4B,KAAKC,EAAef,EAAOG,EAAoB,MAAOK,GAC/D,CAEA,MAAO,CAAEvB,QAAOC,SAMS8B,CAAmBnC,EAAeE,EAAgBD,GAC3E,GAAIK,EAAY,OAAOA,EAEvB,MAAMF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6B,OAAOC,OAAO5B,EAAOkD,EAAOlD,OAC5BC,EAAK4B,QAAQqB,EAAOjD,MACpB,QACJ,CAEA,GAAkB,cAAdgD,EAAKE,KAAsB,CAC3BlD,EAAK4B,KAAK,CAAEsB,KAAM,cAClB,QACJ,CAEA,MAAMC,EAAoBC,EAAiBJ,EAAKrD,eAAiB,CAAA,EAAIA,GAC/DoB,EAAaiC,EAAKK,MAAQ,GAC1BpC,EAAqBD,EAAkBE,EAAciC,EAAkBhC,SAAUJ,IAEvF,IAAIuC,EAAY1D,EAChB,GAAImB,IAAewC,EAAoBtC,GAAqB,CACxD,MAAMG,QAAiBC,EACnBJ,EACAF,EACAiC,EAAKlC,OAAS,GACdqC,EACAvD,GAEAwB,IACArB,EAAMqB,EAASG,UAAYH,EAASI,KACpC8B,EAAY,IAAI1D,EAAQqB,GAEhC,CAEA,IAAIK,EAAsB,GAC1B,GAAI0B,EAAKD,MAAO,CACZ,MAAME,QAAeH,EAAeE,EAAKD,MAAOI,EAAmBG,EAAWN,EAAKK,MAAQ,IAC3F/B,EAAU2B,EAAOjD,KACjB0B,OAAOC,OAAO5B,EAAOkD,EAAOlD,MAChC,CAEA,GAAIiD,EAAKQ,OAAQ,SAEjB,MAAM1C,EAAQkC,EAAKlC,OAAS4B,EAAoBzB,GAC1CoC,EAAOL,EAAKK,KAAOpC,OAAqBwC,EAE1Cb,EAAaX,EAActC,EAAckD,eACzC7C,EAAK4B,KAAKC,EAAef,EAAOuC,EAAML,EAAKE,SAAU5B,GAErDtB,EAAK4B,KAAKC,EAAef,EAAOuC,EAAML,EAAKE,KAAM5B,GAEzD,CAEA,MAAO,CAAEvB,QAAOC,SAaT0D,CAAqBX,EAAOpD,EAAeC,EAAQ2B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Configuration } from "../types/content";
|
|
2
|
+
import { type Crumbs } from "../types/content";
|
|
3
|
+
import { type TreeItem } from "../../components/elements/sidebar/types";
|
|
4
|
+
export declare const createPage: (pathnameNormalized: string, clientPath: string, title: string, configuration: Configuration, crumbs: Crumbs) => Promise<{
|
|
5
|
+
pathname: string;
|
|
6
|
+
page: {
|
|
7
|
+
title: string;
|
|
8
|
+
uri: string;
|
|
9
|
+
configuration: Configuration;
|
|
10
|
+
origPath: string;
|
|
11
|
+
crumbs: Crumbs;
|
|
12
|
+
};
|
|
13
|
+
} | null>;
|
|
14
|
+
export declare const createTreeItem: (title: string, href: string | undefined, type: "heading" | "row" | undefined, items?: TreeItem[]) => {
|
|
15
|
+
title: string;
|
|
16
|
+
href: string | undefined;
|
|
17
|
+
type: "heading" | "row" | undefined;
|
|
18
|
+
items: TreeItem[];
|
|
19
|
+
} | {
|
|
20
|
+
title: string;
|
|
21
|
+
href: string | undefined;
|
|
22
|
+
type: "heading" | "row" | undefined;
|
|
23
|
+
items?: undefined;
|
|
24
|
+
};
|
|
25
|
+
export declare const shouldSpread: (nestingLevel: number, spreadedLevel?: number) => boolean;
|
|
26
|
+
//# sourceMappingURL=structure-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure-tools.d.ts","sourceRoot":"","sources":["../../../src/core/utils/structure-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAGxE,eAAO,MAAM,UAAU,GACnB,oBAAoB,MAAM,EAC1B,YAAY,MAAM,EAClB,OAAO,MAAM,EACb,eAAe,aAAa,EAC5B,QAAQ,MAAM;;;;;;;;;SAWjB,CAAC;AAEF,eAAO,MAAM,cAAc,GACvB,OAAO,MAAM,EACb,MAAM,MAAM,GAAG,SAAS,EACxB,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,EACnC,QAAQ,QAAQ,EAAE;;;;;;;;;;CAGrB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,cAAc,MAAM,EAAE,gBAAe,MAAU,YAE3E,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{checkIsLinkExternal as t}from"./path-tools.js";const e=async(e,r,a,i,o)=>{if(t(e))return null;const n=await(i.provider?.getPageSourcePathname(r,e));return n?{pathname:e,page:{title:a,uri:r,configuration:i,origPath:n,crumbs:o}}:null},r=(t,e,r,a)=>a?{title:t,href:e,type:r,items:a}:{title:t,href:e,type:r},a=(t,e=2)=>t<e;export{e as createPage,r as createTreeItem,a as shouldSpread};
|
|
2
|
+
//# sourceMappingURL=structure-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure-tools.js","sources":["../../../src/core/utils/structure-tools.ts"],"sourcesContent":["import { type Configuration } from \"../types/content\";\nimport { type Crumbs } from \"../types/content\";\nimport { type TreeItem } from \"../../components/elements/sidebar/types\";\nimport { checkIsLinkExternal } from \"./path-tools\";\n\nexport const createPage = async (\n pathnameNormalized: string,\n clientPath: string,\n title: string,\n configuration: Configuration,\n crumbs: Crumbs,\n) => {\n if (checkIsLinkExternal(pathnameNormalized)) return null;\n\n const origPath = await configuration.provider?.getPageSourcePathname(clientPath, pathnameNormalized);\n if (!origPath) return null;\n\n return {\n pathname: pathnameNormalized,\n page: { title, uri: clientPath, configuration, origPath, crumbs },\n };\n};\n\nexport const createTreeItem = (\n title: string,\n href: string | undefined,\n type: \"heading\" | \"row\" | undefined,\n items?: TreeItem[],\n) => {\n return items ? { title, href, type, items } : { title, href, type };\n};\n\nexport const shouldSpread = (nestingLevel: number, spreadedLevel: number = 2) => {\n return nestingLevel < spreadedLevel;\n};\n"],"names":["createPage","async","pathnameNormalized","clientPath","title","configuration","crumbs","checkIsLinkExternal","origPath","provider","getPageSourcePathname","pathname","page","uri","createTreeItem","href","type","items","shouldSpread","nestingLevel","spreadedLevel"],"mappings":"sDAKO,MAAMA,EAAaC,MACtBC,EACAC,EACAC,EACAC,EACAC,KAEA,GAAIC,EAAoBL,GAAqB,OAAO,KAEpD,MAAMM,QAAiBH,EAAcI,UAAUC,sBAAsBP,EAAYD,IACjF,OAAKM,EAEE,CACHG,SAAUT,EACVU,KAAM,CAAER,QAAOS,IAAKV,EAAYE,gBAAeG,WAAUF,WAJvC,MAQbQ,EAAiB,CAC1BV,EACAW,EACAC,EACAC,IAEOA,EAAQ,CAAEb,QAAOW,OAAMC,OAAMC,SAAU,CAAEb,QAAOW,OAAMC,QAGpDE,EAAe,CAACC,EAAsBC,EAAwB,IAChED,EAAeC"}
|
package/lib/styles.css
CHANGED
|
@@ -377,10 +377,6 @@
|
|
|
377
377
|
grid-template-columns: 200px 640px 1fr;
|
|
378
378
|
grid-template-rows: auto 1fr auto;
|
|
379
379
|
}
|
|
380
|
-
}.r-page-container {
|
|
381
|
-
min-height: calc(100dvh - var(--r-header-height));
|
|
382
|
-
overflow-wrap: break-word;
|
|
383
|
-
box-sizing: border-box;
|
|
384
380
|
}.r-blog-container {
|
|
385
381
|
min-height: calc(100dvh - var(--r-header-height));
|
|
386
382
|
overflow-wrap: break-word;
|
|
@@ -395,6 +391,10 @@
|
|
|
395
391
|
grid-template-columns: 760px 220px;
|
|
396
392
|
grid-template-rows: auto 1fr auto;
|
|
397
393
|
}
|
|
394
|
+
}.r-page-container {
|
|
395
|
+
min-height: calc(100dvh - var(--r-header-height));
|
|
396
|
+
overflow-wrap: break-word;
|
|
397
|
+
box-sizing: border-box;
|
|
398
398
|
}.keylink-to-content {
|
|
399
399
|
position: absolute !important;
|
|
400
400
|
top: 8px;
|
|
@@ -814,92 +814,6 @@
|
|
|
814
814
|
.r-header-input:checked ~ .r-header-burger .r-burger-line._bottom {
|
|
815
815
|
transform: translateY(0) rotate(-45deg);
|
|
816
816
|
margin-top: 0;
|
|
817
|
-
}.r-dropdown {
|
|
818
|
-
position: relative;
|
|
819
|
-
color: var(--r-main-600);
|
|
820
|
-
transition: color 0.2s 0.1s;
|
|
821
|
-
}
|
|
822
|
-
.r-dropdown:hover, .r-dropdown:focus-within {
|
|
823
|
-
color: var(--r-main-950);
|
|
824
|
-
}
|
|
825
|
-
.r-dropdown:hover .r-dropdown-drop, .r-dropdown:focus-within .r-dropdown-drop {
|
|
826
|
-
visibility: visible;
|
|
827
|
-
pointer-events: all;
|
|
828
|
-
transform: translateY(20px);
|
|
829
|
-
opacity: 1;
|
|
830
|
-
}
|
|
831
|
-
.r-dropdown:hover .r-dropdown-chevron, .r-dropdown:focus-within .r-dropdown-chevron {
|
|
832
|
-
transform: rotate(180deg);
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
.r-dropdown-summary {
|
|
836
|
-
display: flex;
|
|
837
|
-
justify-content: space-between;
|
|
838
|
-
align-items: center;
|
|
839
|
-
width: 100%;
|
|
840
|
-
position: relative;
|
|
841
|
-
color: inherit;
|
|
842
|
-
cursor: pointer;
|
|
843
|
-
padding: 10px 4px;
|
|
844
|
-
font-size: 16px;
|
|
845
|
-
border: 0;
|
|
846
|
-
background: none;
|
|
847
|
-
z-index: 1;
|
|
848
|
-
box-sizing: border-box;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
.r-dropdown-chevron {
|
|
852
|
-
display: block;
|
|
853
|
-
margin-left: 6px;
|
|
854
|
-
transition: transform 0.3s 0.1s;
|
|
855
|
-
box-sizing: border-box;
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
.r-dropdown-drop {
|
|
859
|
-
list-style: none;
|
|
860
|
-
position: absolute;
|
|
861
|
-
top: 16px;
|
|
862
|
-
left: -12px;
|
|
863
|
-
visibility: hidden;
|
|
864
|
-
pointer-events: none;
|
|
865
|
-
opacity: 0;
|
|
866
|
-
transition: transform 0.3s 0.1s, opacity 0.3s 0.1s, visibility 0.3s 0.1s;
|
|
867
|
-
background-color: var(--r-main-50);
|
|
868
|
-
border: 1px solid var(--r-main-100);
|
|
869
|
-
border-radius: 8px;
|
|
870
|
-
margin: 0;
|
|
871
|
-
padding: 2px 6px;
|
|
872
|
-
min-width: 120px;
|
|
873
|
-
max-width: 180px;
|
|
874
|
-
box-sizing: border-box;
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
.r-dropdown-link {
|
|
878
|
-
display: block;
|
|
879
|
-
width: 100%;
|
|
880
|
-
text-decoration: none;
|
|
881
|
-
color: var(--r-main-700);
|
|
882
|
-
padding: 4px 8px;
|
|
883
|
-
margin-top: 4px;
|
|
884
|
-
margin-bottom: 4px;
|
|
885
|
-
border-radius: 4px;
|
|
886
|
-
transition: background-color 0.2s;
|
|
887
|
-
box-sizing: border-box;
|
|
888
|
-
}
|
|
889
|
-
.r-dropdown-link:hover {
|
|
890
|
-
color: var(--r-main-900);
|
|
891
|
-
background-color: var(--r-main-100);
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
.r-dropdown-link._active {
|
|
895
|
-
color: var(--r-primary-700);
|
|
896
|
-
}.r-container {
|
|
897
|
-
max-width: 1180px;
|
|
898
|
-
padding-right: 12px;
|
|
899
|
-
padding-left: 12px;
|
|
900
|
-
margin-right: auto;
|
|
901
|
-
margin-left: auto;
|
|
902
|
-
box-sizing: border-box;
|
|
903
817
|
}.r-search-btn {
|
|
904
818
|
position: relative;
|
|
905
819
|
border-radius: 6px;
|
|
@@ -1083,6 +997,92 @@
|
|
|
1083
997
|
font-size: 14px;
|
|
1084
998
|
color: var(--r-main-600);
|
|
1085
999
|
margin: 12px 0 0;
|
|
1000
|
+
}.r-container {
|
|
1001
|
+
max-width: 1180px;
|
|
1002
|
+
padding-right: 12px;
|
|
1003
|
+
padding-left: 12px;
|
|
1004
|
+
margin-right: auto;
|
|
1005
|
+
margin-left: auto;
|
|
1006
|
+
box-sizing: border-box;
|
|
1007
|
+
}.r-dropdown {
|
|
1008
|
+
position: relative;
|
|
1009
|
+
color: var(--r-main-600);
|
|
1010
|
+
transition: color 0.2s 0.1s;
|
|
1011
|
+
}
|
|
1012
|
+
.r-dropdown:hover, .r-dropdown:focus-within {
|
|
1013
|
+
color: var(--r-main-950);
|
|
1014
|
+
}
|
|
1015
|
+
.r-dropdown:hover .r-dropdown-drop, .r-dropdown:focus-within .r-dropdown-drop {
|
|
1016
|
+
visibility: visible;
|
|
1017
|
+
pointer-events: all;
|
|
1018
|
+
transform: translateY(20px);
|
|
1019
|
+
opacity: 1;
|
|
1020
|
+
}
|
|
1021
|
+
.r-dropdown:hover .r-dropdown-chevron, .r-dropdown:focus-within .r-dropdown-chevron {
|
|
1022
|
+
transform: rotate(180deg);
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
.r-dropdown-summary {
|
|
1026
|
+
display: flex;
|
|
1027
|
+
justify-content: space-between;
|
|
1028
|
+
align-items: center;
|
|
1029
|
+
width: 100%;
|
|
1030
|
+
position: relative;
|
|
1031
|
+
color: inherit;
|
|
1032
|
+
cursor: pointer;
|
|
1033
|
+
padding: 10px 4px;
|
|
1034
|
+
font-size: 16px;
|
|
1035
|
+
border: 0;
|
|
1036
|
+
background: none;
|
|
1037
|
+
z-index: 1;
|
|
1038
|
+
box-sizing: border-box;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
.r-dropdown-chevron {
|
|
1042
|
+
display: block;
|
|
1043
|
+
margin-left: 6px;
|
|
1044
|
+
transition: transform 0.3s 0.1s;
|
|
1045
|
+
box-sizing: border-box;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
.r-dropdown-drop {
|
|
1049
|
+
list-style: none;
|
|
1050
|
+
position: absolute;
|
|
1051
|
+
top: 16px;
|
|
1052
|
+
left: -12px;
|
|
1053
|
+
visibility: hidden;
|
|
1054
|
+
pointer-events: none;
|
|
1055
|
+
opacity: 0;
|
|
1056
|
+
transition: transform 0.3s 0.1s, opacity 0.3s 0.1s, visibility 0.3s 0.1s;
|
|
1057
|
+
background-color: var(--r-main-50);
|
|
1058
|
+
border: 1px solid var(--r-main-100);
|
|
1059
|
+
border-radius: 8px;
|
|
1060
|
+
margin: 0;
|
|
1061
|
+
padding: 2px 6px;
|
|
1062
|
+
min-width: 120px;
|
|
1063
|
+
max-width: 180px;
|
|
1064
|
+
box-sizing: border-box;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
.r-dropdown-link {
|
|
1068
|
+
display: block;
|
|
1069
|
+
width: 100%;
|
|
1070
|
+
text-decoration: none;
|
|
1071
|
+
color: var(--r-main-700);
|
|
1072
|
+
padding: 4px 8px;
|
|
1073
|
+
margin-top: 4px;
|
|
1074
|
+
margin-bottom: 4px;
|
|
1075
|
+
border-radius: 4px;
|
|
1076
|
+
transition: background-color 0.2s;
|
|
1077
|
+
box-sizing: border-box;
|
|
1078
|
+
}
|
|
1079
|
+
.r-dropdown-link:hover {
|
|
1080
|
+
color: var(--r-main-900);
|
|
1081
|
+
background-color: var(--r-main-100);
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
.r-dropdown-link._active {
|
|
1085
|
+
color: var(--r-primary-700);
|
|
1086
1086
|
}.r-header-social {
|
|
1087
1087
|
display: flex;
|
|
1088
1088
|
flex: 1;
|
|
@@ -1228,78 +1228,6 @@
|
|
|
1228
1228
|
.r-breadcrumb-title {
|
|
1229
1229
|
color: var(--r-main-950);
|
|
1230
1230
|
font-weight: 600;
|
|
1231
|
-
}.r-pagination {
|
|
1232
|
-
grid-area: pagination;
|
|
1233
|
-
display: grid;
|
|
1234
|
-
grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
|
|
1235
|
-
gap: 16px;
|
|
1236
|
-
margin-bottom: 40px;
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
.r-pagination-item {
|
|
1240
|
-
position: relative;
|
|
1241
|
-
padding-top: 8px;
|
|
1242
|
-
padding-bottom: 8px;
|
|
1243
|
-
text-decoration: none;
|
|
1244
|
-
font-size: 14px;
|
|
1245
|
-
color: var(--r-main-800);
|
|
1246
|
-
}
|
|
1247
|
-
.r-pagination-item:hover {
|
|
1248
|
-
color: var(--r-main-950);
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
.r-pagination-item._prev {
|
|
1252
|
-
padding-left: 28px;
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
.r-pagination-item._next {
|
|
1256
|
-
text-align: right;
|
|
1257
|
-
padding-right: 28px;
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
.r-pagination-text {
|
|
1261
|
-
display: block;
|
|
1262
|
-
line-height: 2;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
.r-pagination-title {
|
|
1266
|
-
font-weight: 600;
|
|
1267
|
-
font-size: 16px;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
.r-pagination-icon {
|
|
1271
|
-
position: absolute;
|
|
1272
|
-
top: 50%;
|
|
1273
|
-
transform: translateY(-50%);
|
|
1274
|
-
transition: transform 0.2s;
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
.r-pagination-icon._prev {
|
|
1278
|
-
left: 0;
|
|
1279
|
-
}
|
|
1280
|
-
.r-pagination-item:hover .r-pagination-icon._prev {
|
|
1281
|
-
transform: translate(-4px, -50%);
|
|
1282
|
-
}
|
|
1283
|
-
@media screen and (width >= 1180px) {
|
|
1284
|
-
.r-pagination-item:hover .r-pagination-icon._prev {
|
|
1285
|
-
transform: translate(-8px, -50%);
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
.r-pagination-icon._next {
|
|
1290
|
-
right: 0;
|
|
1291
|
-
}
|
|
1292
|
-
.r-pagination-item:hover .r-pagination-icon._next {
|
|
1293
|
-
transform: translate(4px, -50%);
|
|
1294
|
-
}
|
|
1295
|
-
@media screen and (width >= 1180px) {
|
|
1296
|
-
.r-pagination-item:hover .r-pagination-icon._next {
|
|
1297
|
-
transform: translate(8px, -50%);
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
.r-pagination-svg {
|
|
1302
|
-
display: block;
|
|
1303
1231
|
}.r-contents {
|
|
1304
1232
|
grid-area: contents;
|
|
1305
1233
|
}
|
|
@@ -1533,6 +1461,78 @@
|
|
|
1533
1461
|
}
|
|
1534
1462
|
.r-contents-git:hover {
|
|
1535
1463
|
color: var(--r-main-900);
|
|
1464
|
+
}.r-pagination {
|
|
1465
|
+
grid-area: pagination;
|
|
1466
|
+
display: grid;
|
|
1467
|
+
grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
|
|
1468
|
+
gap: 16px;
|
|
1469
|
+
margin-bottom: 40px;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
.r-pagination-item {
|
|
1473
|
+
position: relative;
|
|
1474
|
+
padding-top: 8px;
|
|
1475
|
+
padding-bottom: 8px;
|
|
1476
|
+
text-decoration: none;
|
|
1477
|
+
font-size: 14px;
|
|
1478
|
+
color: var(--r-main-800);
|
|
1479
|
+
}
|
|
1480
|
+
.r-pagination-item:hover {
|
|
1481
|
+
color: var(--r-main-950);
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
.r-pagination-item._prev {
|
|
1485
|
+
padding-left: 28px;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
.r-pagination-item._next {
|
|
1489
|
+
text-align: right;
|
|
1490
|
+
padding-right: 28px;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
.r-pagination-text {
|
|
1494
|
+
display: block;
|
|
1495
|
+
line-height: 2;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
.r-pagination-title {
|
|
1499
|
+
font-weight: 600;
|
|
1500
|
+
font-size: 16px;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
.r-pagination-icon {
|
|
1504
|
+
position: absolute;
|
|
1505
|
+
top: 50%;
|
|
1506
|
+
transform: translateY(-50%);
|
|
1507
|
+
transition: transform 0.2s;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
.r-pagination-icon._prev {
|
|
1511
|
+
left: 0;
|
|
1512
|
+
}
|
|
1513
|
+
.r-pagination-item:hover .r-pagination-icon._prev {
|
|
1514
|
+
transform: translate(-4px, -50%);
|
|
1515
|
+
}
|
|
1516
|
+
@media screen and (width >= 1180px) {
|
|
1517
|
+
.r-pagination-item:hover .r-pagination-icon._prev {
|
|
1518
|
+
transform: translate(-8px, -50%);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
.r-pagination-icon._next {
|
|
1523
|
+
right: 0;
|
|
1524
|
+
}
|
|
1525
|
+
.r-pagination-item:hover .r-pagination-icon._next {
|
|
1526
|
+
transform: translate(4px, -50%);
|
|
1527
|
+
}
|
|
1528
|
+
@media screen and (width >= 1180px) {
|
|
1529
|
+
.r-pagination-item:hover .r-pagination-icon._next {
|
|
1530
|
+
transform: translate(8px, -50%);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
.r-pagination-svg {
|
|
1535
|
+
display: block;
|
|
1536
1536
|
}.r-last-modified {
|
|
1537
1537
|
color: var(--r-main-700);
|
|
1538
1538
|
margin-block-start: 16px;
|
|
@@ -1552,6 +1552,8 @@
|
|
|
1552
1552
|
opacity: 1;
|
|
1553
1553
|
visibility: visible;
|
|
1554
1554
|
pointer-events: all;
|
|
1555
|
+
}.r-git-logo {
|
|
1556
|
+
display: block;
|
|
1555
1557
|
}.r-external-mark {
|
|
1556
1558
|
position: relative;
|
|
1557
1559
|
vertical-align: text-top;
|
|
@@ -1583,8 +1585,6 @@
|
|
|
1583
1585
|
background-color: currentColor;
|
|
1584
1586
|
border-radius: 0 0 0 4px;
|
|
1585
1587
|
box-sizing: border-box;
|
|
1586
|
-
}.r-git-logo {
|
|
1587
|
-
display: block;
|
|
1588
1588
|
}.r-anchor-heading:hover .r-anchor-heading-link {
|
|
1589
1589
|
visibility: visible;
|
|
1590
1590
|
opacity: 1;
|
|
@@ -1663,20 +1663,6 @@
|
|
|
1663
1663
|
scrollbar-width: thin;
|
|
1664
1664
|
scrollbar-color: var(--r-main-200) transparent;
|
|
1665
1665
|
box-sizing: border-box;
|
|
1666
|
-
}.r-code-span {
|
|
1667
|
-
font-family: var(--monospace-font, monospace, monospace);
|
|
1668
|
-
background-color: var(--r-main-100);
|
|
1669
|
-
border: 1px solid var(--r-main-200);
|
|
1670
|
-
color: var(--r-main-950);
|
|
1671
|
-
border-radius: 4px;
|
|
1672
|
-
padding: 2px 6px;
|
|
1673
|
-
font-size: inherit;
|
|
1674
|
-
font-weight: 500;
|
|
1675
|
-
letter-spacing: 0.5px;
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
.r-code-span + .r-content-link-external {
|
|
1679
|
-
margin-left: -12px;
|
|
1680
1666
|
}.r-blockquote {
|
|
1681
1667
|
background-color: var(--r-main-100);
|
|
1682
1668
|
padding: 8px 12px 8px 20px;
|
|
@@ -1733,6 +1719,20 @@
|
|
|
1733
1719
|
}
|
|
1734
1720
|
.r-blockquote-caution .r-blockquote-title {
|
|
1735
1721
|
color: var(--r-caution);
|
|
1722
|
+
}.r-code-span {
|
|
1723
|
+
font-family: var(--monospace-font, monospace, monospace);
|
|
1724
|
+
background-color: var(--r-main-100);
|
|
1725
|
+
border: 1px solid var(--r-main-200);
|
|
1726
|
+
color: var(--r-main-950);
|
|
1727
|
+
border-radius: 4px;
|
|
1728
|
+
padding: 2px 6px;
|
|
1729
|
+
font-size: inherit;
|
|
1730
|
+
font-weight: 500;
|
|
1731
|
+
letter-spacing: 0.5px;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
.r-code-span + .r-content-link-external {
|
|
1735
|
+
margin-left: -12px;
|
|
1736
1736
|
}.r-code-block {
|
|
1737
1737
|
font-family: var(--monospace-font, monospace, monospace);
|
|
1738
1738
|
font-size: 16px;
|
|
@@ -1746,6 +1746,9 @@
|
|
|
1746
1746
|
scrollbar-width: thin;
|
|
1747
1747
|
scrollbar-color: var(--r-main-200) transparent;
|
|
1748
1748
|
box-sizing: border-box;
|
|
1749
|
+
}.r-img {
|
|
1750
|
+
max-width: 100%;
|
|
1751
|
+
box-sizing: border-box;
|
|
1749
1752
|
}.r-h1 {
|
|
1750
1753
|
font-size: 32px;
|
|
1751
1754
|
line-height: 1.4;
|
|
@@ -1786,9 +1789,6 @@
|
|
|
1786
1789
|
line-height: 1.4;
|
|
1787
1790
|
margin-block-start: 1.8em;
|
|
1788
1791
|
margin-block-end: 1.8em;
|
|
1789
|
-
}.r-img {
|
|
1790
|
-
max-width: 100%;
|
|
1791
|
-
box-sizing: border-box;
|
|
1792
1792
|
}.r-p {
|
|
1793
1793
|
line-height: 1.8;
|
|
1794
1794
|
margin-block-start: 1em;
|
|
@@ -1893,34 +1893,6 @@
|
|
|
1893
1893
|
|
|
1894
1894
|
.r-copy-button-svg {
|
|
1895
1895
|
display: block;
|
|
1896
|
-
}.r-copy-text {
|
|
1897
|
-
position: relative;
|
|
1898
|
-
cursor: pointer;
|
|
1899
|
-
background: none;
|
|
1900
|
-
border: 0;
|
|
1901
|
-
padding: 0;
|
|
1902
|
-
font: inherit;
|
|
1903
|
-
padding: 6px 0;
|
|
1904
|
-
}
|
|
1905
|
-
.r-copy-text:hover {
|
|
1906
|
-
color: var(--r-main-950);
|
|
1907
|
-
}
|
|
1908
|
-
.r-copy-text::before {
|
|
1909
|
-
content: "";
|
|
1910
|
-
position: absolute;
|
|
1911
|
-
bottom: 0;
|
|
1912
|
-
left: 0;
|
|
1913
|
-
width: 100%;
|
|
1914
|
-
height: 1px;
|
|
1915
|
-
background: linear-gradient(to right, currentColor 30%, transparent 0%, transparent 80%, currentColor 80%) repeat-x 0px/8px;
|
|
1916
|
-
transition: background 0.2s;
|
|
1917
|
-
box-sizing: border-box;
|
|
1918
|
-
opacity: 0.6;
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
.r-copy-text:active,
|
|
1922
|
-
.r-copy-text._active {
|
|
1923
|
-
color: var(--r-success);
|
|
1924
1896
|
}.r-content-link {
|
|
1925
1897
|
text-decoration: none;
|
|
1926
1898
|
color: inherit;
|
|
@@ -1970,6 +1942,34 @@
|
|
|
1970
1942
|
background-color: currentColor;
|
|
1971
1943
|
border-radius: 0 0 0 4px;
|
|
1972
1944
|
box-sizing: border-box;
|
|
1945
|
+
}.r-copy-text {
|
|
1946
|
+
position: relative;
|
|
1947
|
+
cursor: pointer;
|
|
1948
|
+
background: none;
|
|
1949
|
+
border: 0;
|
|
1950
|
+
padding: 0;
|
|
1951
|
+
font: inherit;
|
|
1952
|
+
padding: 6px 0;
|
|
1953
|
+
}
|
|
1954
|
+
.r-copy-text:hover {
|
|
1955
|
+
color: var(--r-main-950);
|
|
1956
|
+
}
|
|
1957
|
+
.r-copy-text::before {
|
|
1958
|
+
content: "";
|
|
1959
|
+
position: absolute;
|
|
1960
|
+
bottom: 0;
|
|
1961
|
+
left: 0;
|
|
1962
|
+
width: 100%;
|
|
1963
|
+
height: 1px;
|
|
1964
|
+
background: linear-gradient(to right, currentColor 30%, transparent 0%, transparent 80%, currentColor 80%) repeat-x 0px/8px;
|
|
1965
|
+
transition: background 0.2s;
|
|
1966
|
+
box-sizing: border-box;
|
|
1967
|
+
opacity: 0.6;
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
.r-copy-text:active,
|
|
1971
|
+
.r-copy-text._active {
|
|
1972
|
+
color: var(--r-success);
|
|
1973
1973
|
}.r-li {
|
|
1974
1974
|
line-height: 1.8;
|
|
1975
1975
|
margin-block-start: 6px;
|
|
@@ -1981,11 +1981,11 @@
|
|
|
1981
1981
|
padding-inline-start: 20px;
|
|
1982
1982
|
margin-block-start: 6px;
|
|
1983
1983
|
margin-block-end: 6px;
|
|
1984
|
-
}.r-
|
|
1984
|
+
}.r-ul {
|
|
1985
1985
|
padding-inline-start: 2rem;
|
|
1986
1986
|
margin-block-start: 1em;
|
|
1987
1987
|
margin-block-end: 1em;
|
|
1988
|
-
}.r-
|
|
1988
|
+
}.r-ol {
|
|
1989
1989
|
padding-inline-start: 2rem;
|
|
1990
1990
|
margin-block-start: 1em;
|
|
1991
1991
|
margin-block-end: 1em;
|
|
@@ -2034,10 +2034,10 @@
|
|
|
2034
2034
|
|
|
2035
2035
|
.r-task-label-text {
|
|
2036
2036
|
vertical-align: middle;
|
|
2037
|
-
}.r-task-ul {
|
|
2038
|
-
list-style: none;
|
|
2039
2037
|
}.r-task-ol {
|
|
2040
2038
|
list-style: none;
|
|
2039
|
+
}.r-task-ul {
|
|
2040
|
+
list-style: none;
|
|
2041
2041
|
}.r-tooltip {
|
|
2042
2042
|
font-family: var(--monospace-font, monospace, monospace);
|
|
2043
2043
|
display: none;
|
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-5d28895",
|
|
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": {
|