robindoc 0.0.0-experimental-5d28895 → 0.0.0-experimental-20026cc
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.js +1 -1
- package/lib/core/utils/structure-tools.js.map +1 -1
- package/lib/styles.css +169 -169
- 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", configuration?: Configuration, crumbs?: Crumbs, pathname?: string) => Promise<{
|
|
4
|
+
export declare const parseStructure: (items: DocItem[] | "auto", configuration?: Configuration, crumbs?: Crumbs, pathname?: string, nestingLevel?: number) => 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;AAyLxE,eAAO,MAAM,cAAc,GACvB,OAAO,OAAO,EAAE,GAAG,MAAM,EACzB,gBAAe,aAAkB,EACjC,SAAQ,MAAW,EACnB,WAAU,MAAW,EACrB,eAAc,MAAU;;;EAO3B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getConfiguration as t}from"./get-configuration.js";import{getMetadata as e}from"./get-metadata.js";import{normalizePathname as r,mergePathname as
|
|
1
|
+
import{getConfiguration as t}from"./get-configuration.js";import{getMetadata as e}from"./get-metadata.js";import{normalizePathname as r,mergePathname as a,generatePseudoTitle as s,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,h)=>{if(!t.provider)return{pages:{},tree:[]};const l=await(async(t,e,s,i)=>{if(!t.provider)return null;const p=`${e}/structure.json`;if(!(await t.provider.filesPromise).structures.includes(p))return null;const f=await o(p,t.provider);let h;try{h=JSON.parse(f.data)}catch{throw new Error(`Can't parse structure "${p}"`)}const l={},g=[];for(const o in h){const{title:p}=h[o],f=r("index"===o?e:`${e}/${o}`),d=r(a(t.basePath,f)),m=await n(d,f,p,t,s);let w;if(m&&(l[m.pathname]=m.page),"index"!==o){const e=await u(t,m?[...s,d]:s,f,i+1);w=e.tree,Object.assign(l,e.pages)}g.push(c(p,d,"row",w))}return{pages:l,tree:g}})(t,f,i,h+1);if(l)return l;const g={},d=[],m=f.split("/"),w=await t.provider.filesPromise;for await(const{clientPath:o}of w.docs){const l=o.split("/").length===m.length+1,w=o.startsWith(f);if(!l||!w)continue;const j=r(a(t.basePath,o)),v=(await e({provider:t.provider,uri:o})).title||s(j),y=await n(j,o,v,t,i);y&&(g[y.pathname]=y.page);const b=await u(t,y?[...i,j]:i,o,h+1),P=0===h?"heading":"row";p(h,t.spreadedLevel)?d.push(c(v,j,P),...b.tree):d.push(c(v,j,P,b.tree)),Object.assign(g,b.pages)}return{pages:g,tree:d}},f=async(e,o={},h=[],l="",g=0)=>"auto"===e?u(o,h,l,g):(async(e,o,u,h,l)=>{const g={},d=[];for await(const m of e){if("string"==typeof m){const t=await f(m,o,u,h,l);Object.assign(g,t.pages),d.push(...t.tree);continue}if("separator"===m.type){d.push({type:"separator"});continue}const e=t(m.configuration||{},o),w=m.href||"",j=r(a(e.basePath,w));let v=u;if(w&&!i(j)){const t=await n(j,w,m.title||"",e,u);t&&(g[t.pathname]=t.page,v=[...u,j])}let y=[];if(m.items){const t=await f(m.items,e,v,m.href||"",l+1);y=t.tree,Object.assign(g,t.pages)}if(m.hidden)continue;const b=m.title||s(j),P=m.href?j:void 0;p(l,o.spreadedLevel)?d.push(c(b,P,m.type),...y):d.push(c(b,P,m.type,y))}return{pages:g,tree:d}})(e,o,h,l,g);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\";\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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,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"}
|
|
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 (\n configuration: Configuration,\n parentPathname: string,\n crumbs: Crumbs,\n nestingLevel: number,\n) => {\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 nestingLevel + 1,\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 (\n configuration: Configuration,\n crumbs: Crumbs,\n parentPathname: string,\n nestingLevel: number,\n) => {\n if (!configuration.provider) return { pages: {}, tree: [] };\n\n const jsonResult = await parseJSONStructure(configuration, parentPathname, crumbs, nestingLevel + 1);\n if (jsonResult) return jsonResult;\n\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n const parentSegments = parentPathname.split(\"/\");\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 nestingLevel + 1,\n );\n const itemType = nestingLevel === 0 ? \"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 nestingLevel: number,\n) => {\n const pages: Pages = {};\n const tree: TreeItem[] = [];\n\n for await (const item of items) {\n if (typeof item === \"string\") {\n const result = await parseStructure(item, configuration, crumbs, parentPathname, nestingLevel);\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(\n item.items,\n itemConfiguration,\n subCrumbs,\n item.href || \"\",\n nestingLevel + 1,\n );\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 nestingLevel: number = 0,\n) => {\n if (items === \"auto\") {\n return parseAutoStructure(configuration, crumbs, pathname, nestingLevel);\n }\n\n return parseStaticStructure(items, configuration, crumbs, pathname, nestingLevel);\n};\n"],"names":["parseAutoStructure","async","configuration","crumbs","parentPathname","nestingLevel","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","branchFiles","docs","isDirectChild","length","isUnderParent","startsWith","getMetadata","uri","generatePseudoTitle","itemType","shouldSpread","spreadedLevel","parseStructure","items","item","result","type","itemConfiguration","getConfiguration","href","subCrumbs","checkIsLinkExternal","hidden","undefined","parseStaticStructure"],"mappings":"2WASA,MAqDMA,EAAqBC,MACvBC,EACAC,EACAC,EACAC,KAEA,IAAKH,EAAcI,SAAU,MAAO,CAAEC,MAAO,GAAIC,KAAM,IAEvD,MAAMC,OA7DiBR,OACvBC,EACAE,EACAD,EACAE,KAEA,IAAKH,EAAcI,SAAU,OAAO,KAEpC,MACMI,EAAgB,GAAGN,mBAEzB,WAH0BF,EAAcI,SAASK,cAGhCC,WAAWC,SAASH,GAAgB,OAAO,KAE5D,MAAMI,QAAgBC,EAAYL,EAAeR,EAAcI,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,EAAsBjB,EAAiB,GAAGA,KAAkBiB,KAC3FI,EAAqBD,EAAkBE,EAAcxB,EAAcyB,SAAUJ,IAE7EK,QAAiBC,EAAWJ,EAAoBF,EAAYD,EAAOpB,EAAeC,GAKxF,IAAI2B,EACJ,GALIF,IACArB,EAAMqB,EAASG,UAAYH,EAASI,MAIxB,UAAZX,EAAqB,CACrB,MAAMY,QAAkBjC,EACpBE,EACA0B,EAAW,IAAIzB,EAAQsB,GAAsBtB,EAC7CoB,EACAlB,EAAe,GAEnByB,EAAUG,EAAUzB,KACpB0B,OAAOC,OAAO5B,EAAO0B,EAAU1B,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OpD,EAAeC,EAAQ4B,EAAU1B"}
|
|
@@ -1,2 +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=
|
|
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=1)=>t<e;export{e as createPage,r as createTreeItem,a as shouldSpread};
|
|
2
2
|
//# sourceMappingURL=structure-tools.js.map
|
|
@@ -1 +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 =
|
|
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 = 1) => {\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
|
@@ -402,58 +402,6 @@
|
|
|
402
402
|
z-index: 1001;
|
|
403
403
|
}.r-keylink.keylink-to-navigation:focus {
|
|
404
404
|
margin-top: -40px;
|
|
405
|
-
}.r-article {
|
|
406
|
-
padding: 20px 0 40px;
|
|
407
|
-
grid-area: content;
|
|
408
|
-
}
|
|
409
|
-
@media screen and (width >= 1180px) {
|
|
410
|
-
.r-article {
|
|
411
|
-
padding: 32px 0 40px;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
.r-article > *:first-child {
|
|
415
|
-
margin-top: 0;
|
|
416
|
-
}
|
|
417
|
-
.r-article > *:last-child {
|
|
418
|
-
margin-bottom: 0;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
.r-checkbox {
|
|
422
|
-
cursor: pointer;
|
|
423
|
-
width: 20px;
|
|
424
|
-
height: 20px;
|
|
425
|
-
margin: 4px;
|
|
426
|
-
vertical-align: middle;
|
|
427
|
-
box-sizing: border-box;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
.r-label {
|
|
431
|
-
cursor: pointer;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
.r-task-ol,
|
|
435
|
-
.r-task-ul {
|
|
436
|
-
list-style: none;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
.r-task-label {
|
|
440
|
-
display: block;
|
|
441
|
-
width: 100%;
|
|
442
|
-
padding-top: 2px;
|
|
443
|
-
padding-bottom: 2px;
|
|
444
|
-
box-sizing: border-box;
|
|
445
|
-
}
|
|
446
|
-
.r-task-label:hover .r-checkbox {
|
|
447
|
-
filter: brightness(0.8);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
.r-task-li.r-task-li {
|
|
451
|
-
margin-block-start: 2px;
|
|
452
|
-
margin-block-end: 2px;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
.r-label-text {
|
|
456
|
-
vertical-align: middle;
|
|
457
405
|
}.r-sidebar {
|
|
458
406
|
grid-area: sidebar;
|
|
459
407
|
box-sizing: border-box;
|
|
@@ -726,6 +674,137 @@
|
|
|
726
674
|
|
|
727
675
|
.r-sidebar-drop[open] > .r-sidebar-drop-btn > .r-sidebar-drop-icon {
|
|
728
676
|
transform: rotate(90deg);
|
|
677
|
+
}.r-article {
|
|
678
|
+
padding: 20px 0 40px;
|
|
679
|
+
grid-area: content;
|
|
680
|
+
}
|
|
681
|
+
@media screen and (width >= 1180px) {
|
|
682
|
+
.r-article {
|
|
683
|
+
padding: 32px 0 40px;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
.r-article > *:first-child {
|
|
687
|
+
margin-top: 0;
|
|
688
|
+
}
|
|
689
|
+
.r-article > *:last-child {
|
|
690
|
+
margin-bottom: 0;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.r-checkbox {
|
|
694
|
+
cursor: pointer;
|
|
695
|
+
width: 20px;
|
|
696
|
+
height: 20px;
|
|
697
|
+
margin: 4px;
|
|
698
|
+
vertical-align: middle;
|
|
699
|
+
box-sizing: border-box;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.r-label {
|
|
703
|
+
cursor: pointer;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.r-task-ol,
|
|
707
|
+
.r-task-ul {
|
|
708
|
+
list-style: none;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.r-task-label {
|
|
712
|
+
display: block;
|
|
713
|
+
width: 100%;
|
|
714
|
+
padding-top: 2px;
|
|
715
|
+
padding-bottom: 2px;
|
|
716
|
+
box-sizing: border-box;
|
|
717
|
+
}
|
|
718
|
+
.r-task-label:hover .r-checkbox {
|
|
719
|
+
filter: brightness(0.8);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.r-task-li.r-task-li {
|
|
723
|
+
margin-block-start: 2px;
|
|
724
|
+
margin-block-end: 2px;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.r-label-text {
|
|
728
|
+
vertical-align: middle;
|
|
729
|
+
}.r-dropdown {
|
|
730
|
+
position: relative;
|
|
731
|
+
color: var(--r-main-600);
|
|
732
|
+
transition: color 0.2s 0.1s;
|
|
733
|
+
}
|
|
734
|
+
.r-dropdown:hover, .r-dropdown:focus-within {
|
|
735
|
+
color: var(--r-main-950);
|
|
736
|
+
}
|
|
737
|
+
.r-dropdown:hover .r-dropdown-drop, .r-dropdown:focus-within .r-dropdown-drop {
|
|
738
|
+
visibility: visible;
|
|
739
|
+
pointer-events: all;
|
|
740
|
+
transform: translateY(20px);
|
|
741
|
+
opacity: 1;
|
|
742
|
+
}
|
|
743
|
+
.r-dropdown:hover .r-dropdown-chevron, .r-dropdown:focus-within .r-dropdown-chevron {
|
|
744
|
+
transform: rotate(180deg);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
.r-dropdown-summary {
|
|
748
|
+
display: flex;
|
|
749
|
+
justify-content: space-between;
|
|
750
|
+
align-items: center;
|
|
751
|
+
width: 100%;
|
|
752
|
+
position: relative;
|
|
753
|
+
color: inherit;
|
|
754
|
+
cursor: pointer;
|
|
755
|
+
padding: 10px 4px;
|
|
756
|
+
font-size: 16px;
|
|
757
|
+
border: 0;
|
|
758
|
+
background: none;
|
|
759
|
+
z-index: 1;
|
|
760
|
+
box-sizing: border-box;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.r-dropdown-chevron {
|
|
764
|
+
display: block;
|
|
765
|
+
margin-left: 6px;
|
|
766
|
+
transition: transform 0.3s 0.1s;
|
|
767
|
+
box-sizing: border-box;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.r-dropdown-drop {
|
|
771
|
+
list-style: none;
|
|
772
|
+
position: absolute;
|
|
773
|
+
top: 16px;
|
|
774
|
+
left: -12px;
|
|
775
|
+
visibility: hidden;
|
|
776
|
+
pointer-events: none;
|
|
777
|
+
opacity: 0;
|
|
778
|
+
transition: transform 0.3s 0.1s, opacity 0.3s 0.1s, visibility 0.3s 0.1s;
|
|
779
|
+
background-color: var(--r-main-50);
|
|
780
|
+
border: 1px solid var(--r-main-100);
|
|
781
|
+
border-radius: 8px;
|
|
782
|
+
margin: 0;
|
|
783
|
+
padding: 2px 6px;
|
|
784
|
+
min-width: 120px;
|
|
785
|
+
max-width: 180px;
|
|
786
|
+
box-sizing: border-box;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.r-dropdown-link {
|
|
790
|
+
display: block;
|
|
791
|
+
width: 100%;
|
|
792
|
+
text-decoration: none;
|
|
793
|
+
color: var(--r-main-700);
|
|
794
|
+
padding: 4px 8px;
|
|
795
|
+
margin-top: 4px;
|
|
796
|
+
margin-bottom: 4px;
|
|
797
|
+
border-radius: 4px;
|
|
798
|
+
transition: background-color 0.2s;
|
|
799
|
+
box-sizing: border-box;
|
|
800
|
+
}
|
|
801
|
+
.r-dropdown-link:hover {
|
|
802
|
+
color: var(--r-main-900);
|
|
803
|
+
background-color: var(--r-main-100);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
.r-dropdown-link._active {
|
|
807
|
+
color: var(--r-primary-700);
|
|
729
808
|
}.r-header-menu {
|
|
730
809
|
display: flex;
|
|
731
810
|
justify-content: flex-end;
|
|
@@ -997,92 +1076,6 @@
|
|
|
997
1076
|
font-size: 14px;
|
|
998
1077
|
color: var(--r-main-600);
|
|
999
1078
|
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
1079
|
}.r-header-social {
|
|
1087
1080
|
display: flex;
|
|
1088
1081
|
flex: 1;
|
|
@@ -1101,6 +1094,13 @@
|
|
|
1101
1094
|
}
|
|
1102
1095
|
.r-header-social-git:hover, .r-header-social-git:focus {
|
|
1103
1096
|
color: var(--r-main-950);
|
|
1097
|
+
}.r-container {
|
|
1098
|
+
max-width: 1180px;
|
|
1099
|
+
padding-right: 12px;
|
|
1100
|
+
padding-left: 12px;
|
|
1101
|
+
margin-right: auto;
|
|
1102
|
+
margin-left: auto;
|
|
1103
|
+
box-sizing: border-box;
|
|
1104
1104
|
}.r-theme-switcher {
|
|
1105
1105
|
position: relative;
|
|
1106
1106
|
display: flex;
|
|
@@ -1746,9 +1746,6 @@
|
|
|
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;
|
|
1752
1749
|
}.r-h1 {
|
|
1753
1750
|
font-size: 32px;
|
|
1754
1751
|
line-height: 1.4;
|
|
@@ -1789,6 +1786,9 @@
|
|
|
1789
1786
|
line-height: 1.4;
|
|
1790
1787
|
margin-block-start: 1.8em;
|
|
1791
1788
|
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,6 +1893,34 @@
|
|
|
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);
|
|
1896
1924
|
}.r-content-link {
|
|
1897
1925
|
text-decoration: none;
|
|
1898
1926
|
color: inherit;
|
|
@@ -1942,34 +1970,6 @@
|
|
|
1942
1970
|
background-color: currentColor;
|
|
1943
1971
|
border-radius: 0 0 0 4px;
|
|
1944
1972
|
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;
|
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-20026cc",
|
|
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": {
|