@teambit/docs 0.0.737 → 0.0.740
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/dist/default-doc-reader.js.map +1 -1
- package/dist/doc-module.js.map +1 -1
- package/dist/doc-reader.js.map +1 -1
- package/dist/docs-store.js.map +1 -1
- package/dist/docs.aspect.js.map +1 -1
- package/dist/docs.composition.js.map +1 -1
- package/dist/docs.data.js.map +1 -1
- package/dist/docs.graphql.js.map +1 -1
- package/dist/docs.js.map +1 -1
- package/dist/docs.main.runtime.js.map +1 -1
- package/dist/docs.preview-definition.js.map +1 -1
- package/dist/docs.preview.runtime.js.map +1 -1
- package/dist/docs.service.js.map +1 -1
- package/dist/docs.ui.runtime.js.map +1 -1
- package/dist/events/click-inside-an-iframe.js.map +1 -1
- package/dist/events/index.js.map +1 -1
- package/dist/exceptions/doc-read-error.js.map +1 -1
- package/dist/exceptions/file-extension-not-supported.js.map +1 -1
- package/dist/exceptions/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/overview/index.js.map +1 -1
- package/dist/overview/overview.js.map +1 -1
- package/dist/overview.section.js.map +1 -1
- package/package-tar/teambit-docs-0.0.740.tgz +0 -0
- package/package.json +18 -18
- package/{preview-1652930732694.js → preview-1653449228788.js} +2 -2
- package/package-tar/teambit-docs-0.0.737.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DefaultDocReader","constructor","pkg","compiler","workspace","read","path","contents","component","packageName","getPackageName","distPath","getDistPathBySrcPath","docsModule","require","resolve","Doc","from","labels","default","description","abstract","displayName","componentDisplayName","isFormatSupported","format","supportedExtensions","includes"],"sources":["default-doc-reader.ts"],"sourcesContent":["import { resolve } from 'path';\nimport type { PkgMain } from '@teambit/pkg';\nimport type { Component } from '@teambit/component';\nimport type { CompilerMain } from '@teambit/compiler';\nimport type { Workspace } from '@teambit/workspace';\nimport { Doc } from '@teambit/docs.entities.doc';\nimport { DocReader } from './doc-reader';\n\nexport class DefaultDocReader implements DocReader {\n constructor(private pkg: PkgMain, private compiler: CompilerMain, private workspace: Workspace) {}\n\n async read(path: string, contents: Buffer, component: Component) {\n const packageName = this.pkg.getPackageName(component);\n const distPath = this.compiler.getDistPathBySrcPath(component, path);\n // eslint-disable-next-line\n const docsModule = require(resolve(`${this.workspace.path}/node_modules/${packageName}/${distPath}`));\n return Doc.from(path, {\n labels: docsModule.labels || docsModule.default?.labels,\n description: docsModule.abstract || docsModule.default?.abstract || docsModule.description,\n displayName: docsModule.displayName || docsModule.default?.componentDisplayName,\n });\n }\n\n readonly supportedExtensions = ['.ts', '.js', '.jsx', '.tsx'];\n\n isFormatSupported(format: string) {\n return this.supportedExtensions.includes(format);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,gBAAN,CAA4C;EACjDC,WAAW,CAASC,GAAT,EAA+BC,QAA/B,EAA+DC,SAA/D,EAAqF;IAAA,KAA5EF,GAA4E,GAA5EA,GAA4E;IAAA,KAAtDC,QAAsD,GAAtDA,QAAsD;IAAA,KAAtBC,SAAsB,GAAtBA,SAAsB;IAAA,6DAcjE,CAAC,KAAD,EAAQ,KAAR,EAAe,MAAf,EAAuB,MAAvB,CAdiE;EAAE;;EAExF,MAAJC,IAAI,CAACC,IAAD,EAAeC,QAAf,EAAiCC,SAAjC,EAAuD;IAAA;;IAC/D,MAAMC,WAAW,GAAG,KAAKP,GAAL,CAASQ,cAAT,CAAwBF,SAAxB,CAApB;IACA,MAAMG,QAAQ,GAAG,KAAKR,QAAL,CAAcS,oBAAd,CAAmCJ,SAAnC,EAA8CF,IAA9C,CAAjB,CAF+D,CAG/D;;IACA,MAAMO,UAAU,GAAGC,OAAO,CAAC,IAAAC,eAAA,EAAS,GAAE,KAAKX,SAAL,CAAeE,IAAK,iBAAgBG,WAAY,IAAGE,QAAS,EAAvE,CAAD,CAA1B;;IACA,OAAOK,mBAAA,CAAIC,IAAJ,CAASX,IAAT,EAAe;MACpBY,MAAM,EAAEL,UAAU,CAACK,MAAX,4BAAqBL,UAAU,CAACM,OAAhC,wDAAqB,oBAAoBD,MAAzC,CADY;MAEpBE,WAAW,EAAEP,UAAU,CAACQ,QAAX,6BAAuBR,UAAU,CAACM,OAAlC,yDAAuB,qBAAoBE,QAA3C,KAAuDR,UAAU,CAACO,WAF3D;MAGpBE,WAAW,EAAET,UAAU,CAACS,WAAX,6BAA0BT,UAAU,CAACM,OAArC,yDAA0B,qBAAoBI,oBAA9C;IAHO,CAAf,CAAP;EAKD;;EAIDC,iBAAiB,CAACC,MAAD,EAAiB;IAChC,OAAO,KAAKC,mBAAL,CAAyBC,QAAzB,CAAkCF,MAAlC,CAAP;EACD;;AAnBgD"}
|
package/dist/doc-module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DocModule","constructor","path","module","abstract","default"],"sources":["doc-module.ts"],"sourcesContent":["export class DocModule {\n constructor(\n readonly path: string,\n\n /**\n * original doc module.\n */\n readonly module: any\n ) {}\n\n /**\n * get the abstract.\n */\n get abstract() {\n return this.module.abstract || this.module.default?.abstract;\n }\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,SAAN,CAAgB;EACrBC,WAAW,CACAC,IADA;EAGT;AACJ;AACA;EACaC,MANA,EAOT;IAAA,KANSD,IAMT,GANSA,IAMT;IAAA,KADSC,MACT,GADSA,MACT;EAAE;EAEJ;AACF;AACA;;;EACc,IAARC,QAAQ,GAAG;IAAA;;IACb,OAAO,KAAKD,MAAL,CAAYC,QAAZ,6BAAwB,KAAKD,MAAL,CAAYE,OAApC,yDAAwB,qBAAqBD,QAA7C,CAAP;EACD;;AAfoB"}
|
package/dist/doc-reader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["doc-reader.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\nimport { Doc } from '@teambit/docs.entities.doc';\n\nexport interface DocReader {\n /**\n * read a component doc.\n * @TODO refactor to virtual-file component after @david completes.\n */\n read(path: string, contents: Buffer, component: Component): Promise<Doc>;\n\n /**\n * determine which file formats are supported by the doc reader.\n */\n isFormatSupported(ext: string): boolean;\n}\n"],"mappings":""}
|
package/dist/docs-store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["addDocs","docs","Doc","ReactDOM","render","document","getElementById"],"sources":["docs-store.tsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\n\n// let docs = [];\n\nexport function addDocs(docs: any[]) {\n const Doc = docs[0];\n ReactDOM.render(<Doc />, document.getElementById('root'));\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;AAEO,SAASA,OAAT,CAAiBC,IAAjB,EAA8B;EACnC,MAAMC,GAAG,GAAGD,IAAI,CAAC,CAAD,CAAhB;;EACAE,mBAAA,CAASC,MAAT,eAAgB,+BAAC,GAAD,OAAhB,EAAyBC,QAAQ,CAACC,cAAT,CAAwB,MAAxB,CAAzB;AACD"}
|
package/dist/docs.aspect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DocsAspect","Aspect","create","id","dependencies","defaultConfig"],"sources":["docs.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const DocsAspect = Aspect.create({\n id: 'teambit.docs/docs',\n dependencies: [],\n defaultConfig: {},\n});\n\nexport default DocsAspect;\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,UAAU,GAAGC,iBAAA,CAAOC,MAAP,CAAc;EACtCC,EAAE,EAAE,mBADkC;EAEtCC,YAAY,EAAE,EAFwB;EAGtCC,aAAa,EAAE;AAHuB,CAAd,CAAnB;;;eAMQL,U"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["docs.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/docs.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAV;IAAkBC,OAAO,EAAE,MAA3B;IAAmCC,cAAc,EAAE;EAAnD;AAAZ,gBACE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAT,CAAZ;EAA2B,GAAG,EAAC;AAA/B,EADF,CADK"}
|
package/dist/docs.data.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["docsMock","title","subTitle","labels","installMethods","content"],"sources":["docs.data.tsx"],"sourcesContent":["export const docsMock = {\n title: 'Radio',\n subTitle:\n 'Radio Buttons are graphical interface elements that allow user to choose only one of a predefined set of mutually exclusive options.',\n labels: ['chart', 'graph', 'ui-components', 'react'],\n installMethods: [\n { title: 'install package', content: '@google.material-ui/radio' },\n {\n title: 'Import from CDN',\n content: 'https://esm.bit.dev/@google/material-ui/radio/',\n },\n ],\n};\n"],"mappings":";;;;;;AAAO,MAAMA,QAAQ,GAAG;EACtBC,KAAK,EAAE,OADe;EAEtBC,QAAQ,EACN,sIAHoB;EAItBC,MAAM,EAAE,CAAC,OAAD,EAAU,OAAV,EAAmB,eAAnB,EAAoC,OAApC,CAJc;EAKtBC,cAAc,EAAE,CACd;IAAEH,KAAK,EAAE,iBAAT;IAA4BI,OAAO,EAAE;EAArC,CADc,EAEd;IACEJ,KAAK,EAAE,iBADT;IAEEI,OAAO,EAAE;EAFX,CAFc;AALM,CAAjB"}
|
package/dist/docs.graphql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["docsSchema","docs","typeDefs","gql","resolvers","Component","description","component","getDescription","labels","doc","getDoc"],"sources":["docs.graphql.ts"],"sourcesContent":["import gql from 'graphql-tag';\nimport { Component } from '@teambit/component';\nimport { DocsMain } from './docs.main.runtime';\n\nexport function docsSchema(docs: DocsMain) {\n return {\n typeDefs: gql`\n extend type Component {\n description: String\n labels: [String]\n }\n `,\n resolvers: {\n Component: {\n description: (component: Component) => {\n return docs.getDescription(component);\n },\n\n labels: (component: Component) => {\n const doc = docs.getDoc(component);\n return doc?.labels || [];\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIO,SAASA,UAAT,CAAoBC,IAApB,EAAoC;EACzC,OAAO;IACLC,QAAQ,EAAE,IAAAC,qBAAA,CAAI;AAClB;AACA;AACA;AACA;AACA,KANS;IAOLC,SAAS,EAAE;MACTC,SAAS,EAAE;QACTC,WAAW,EAAGC,SAAD,IAA0B;UACrC,OAAON,IAAI,CAACO,cAAL,CAAoBD,SAApB,CAAP;QACD,CAHQ;QAKTE,MAAM,EAAGF,SAAD,IAA0B;UAChC,MAAMG,GAAG,GAAGT,IAAI,CAACU,MAAL,CAAYJ,SAAZ,CAAZ;UACA,OAAO,CAAAG,GAAG,SAAH,IAAAA,GAAG,WAAH,YAAAA,GAAG,CAAED,MAAL,KAAe,EAAtB;QACD;MARQ;IADF;EAPN,CAAP;AAoBD"}
|
package/dist/docs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["docs.ts"],"sourcesContent":["import React from 'react';\n\nexport type Docs = {\n /**\n * default is the docs content.\n */\n default: React.ComponentType;\n\n /**\n * component abstract.\n */\n abstract: string;\n\n /**\n * array of labels.\n */\n labels: string[];\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["docs.main.runtime.ts"],"names":["DocsMain","constructor","patterns","preview","pkg","compiler","workspace","logger","devFiles","envs","docPropSlot","docReaderSlot","getDocsMap","components","ComponentMap","as","component","getDocsFiles","computeDevFiles","docFiles","get","DocsAspect","id","state","filesystem","files","filter","file","includes","relative","getDescription","componentDoc","getDoc","desc","description","consumerComponent","_consumer","fromJsDocs","docs","find","doc","getTemplate","env","getDocsTemplate","getDocReader","extension","values","docReader","isFormatSupported","computeDoc","length","docFile","extname","FileExtensionNotSupported","read","contents","err","error","docData","aspects","data","Doc","filePath","DocPropList","props","getPatterns","getComponentDevPatterns","calculateEnv","componentEnvDocsDevPatterns","getDocsDevPatterns","componentPatterns","concat","getDevPatternToRegister","bind","registerDocReader","register","provider","graphql","loggerAspect","config","createLogger","DefaultDocReader","registerDevPattern","onComponentLoad","toObject","registerDefinition","DocsPreviewDefinition","Slot","withType","MainRuntime","PreviewAspect","GraphqlAspect","WorkspaceAspect","PkgAspect","CompilerAspect","LoggerAspect","DevFilesAspect","EnvsAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AA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AAO;AACLwB,UAAAA,GAAG,EAAEA,GAAF,aAAEA,GAAF,uBAAEA,GAAG,CAAE4C,QAAL;AADA,SAAP;AAGD,OAND;AAOD;;AAEDP,IAAAA,OAAO,CAACF,QAAR,CAAiB,yBAAWrC,IAAX,CAAjB;AAEAnC,IAAAA,OAAO,CAACkF,kBAAR,CAA2B,KAAIC,8BAAJ,EAA0BhD,IAA1B,CAA3B;AACA,WAAOA,IAAP;AACD;;AAxLmB;;;gCAATtC,Q,WAiHI,CAACuF,gBAAKC,QAAL,EAAD,EAA2BD,gBAAKC,QAAL,EAA3B,C;gCAjHJxF,Q,aAmHMyF,kB;gCAnHNzF,Q,kBAoHW,CACpB0F,wBADoB,EAEpBC,wBAFoB,EAGpBC,4BAHoB,EAIpBC,gBAJoB,EAKpBC,0BALoB,EAMpBC,sBANoB,EAOpBC,mBAPoB,EAQpBC,kBARoB,C;gCApHXjG,Q,mBA+HY;AACrBE,EAAAA,QAAQ,EAAE,CAAC,aAAD;AADW,C;;AA4DzBmB,mBAAW6E,UAAX,CAAsBlG,QAAtB","sourcesContent":["import { Slot, SlotRegistry } from '@teambit/harmony';\nimport { MainRuntime } from '@teambit/cli';\nimport { LoggerAspect, LoggerMain, Logger } from '@teambit/logger';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { Component, ComponentMap } from '@teambit/component';\nimport { PkgAspect, PkgMain } from '@teambit/pkg';\nimport type { Environment } from '@teambit/envs';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { PreviewAspect, PreviewMain } from '@teambit/preview';\nimport DevFilesAspect, { DevFilesMain } from '@teambit/dev-files';\nimport { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { Doc, DocPropList } from '@teambit/docs.entities.doc';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { DocsAspect } from './docs.aspect';\nimport { DocsPreviewDefinition } from './docs.preview-definition';\nimport { docsSchema } from './docs.graphql';\nimport { DocReader } from './doc-reader';\nimport { DefaultDocReader } from './default-doc-reader';\nimport { FileExtensionNotSupported } from './exceptions';\n\nexport type ComponentDocs = {\n files: string[];\n component: Component;\n};\n\nexport type DocProp = {};\n\nexport type DocPropSlot = SlotRegistry<DocProp>;\n\nexport type DocReaderSlot = SlotRegistry<DocReader>;\n\nexport type DocsConfig = {\n /**\n * glob patterns to identify doc files.\n */\n patterns: string[];\n};\n\n/**\n * the component documentation extension.\n */\nexport class DocsMain {\n constructor(\n private patterns: string[],\n /**\n * envs extension.\n */\n private preview: PreviewMain,\n\n private pkg: PkgMain,\n\n private compiler: CompilerMain,\n\n private workspace: Workspace,\n\n private logger: Logger,\n\n private devFiles: DevFilesMain,\n\n private envs: EnvsMain,\n\n private docPropSlot: DocPropSlot,\n\n private docReaderSlot: DocReaderSlot\n ) {}\n\n /**\n * returns an array of doc file paths for a set of components.\n */\n getDocsMap(components: Component[]): ComponentMap<AbstractVinyl[]> {\n return ComponentMap.as<AbstractVinyl[]>(components, (component) => {\n return this.getDocsFiles(component);\n });\n }\n\n getDocsFiles(component: Component): AbstractVinyl[] {\n const devFiles = this.devFiles.computeDevFiles(component);\n const docFiles = devFiles.get(DocsAspect.id);\n return component.state.filesystem.files.filter((file) => docFiles.includes(file.relative));\n }\n\n /**\n * compute the description of the component from its source code and docs file.\n */\n async getDescription(component: Component): Promise<string> {\n const componentDoc = this.getDoc(component);\n const desc = componentDoc?.description;\n if (desc) return desc;\n const consumerComponent: ConsumerComponent = component.state._consumer;\n const fromJsDocs = consumerComponent.docs?.find((doc) => doc.description);\n\n return fromJsDocs?.description || '';\n }\n\n async getTemplate(env: Environment) {\n return env.getDocsTemplate();\n }\n\n getDocReader(extension: string) {\n return this.docReaderSlot.values().find((docReader) => docReader.isFormatSupported(extension));\n }\n\n /**\n * compute a doc for a component.\n */\n async computeDoc(component: Component) {\n const docFiles = this.getDocsFiles(component);\n if (docFiles.length) {\n // currently taking the the first docs file found with an abstract. (we support only one)\n const docFile = docFiles[0];\n\n try {\n const docReader = this.getDocReader(docFile.extname);\n if (!docReader) throw new FileExtensionNotSupported(docFile.relative, docFile.extname);\n const doc = await docReader.read(docFile.relative, docFile.contents, component);\n return doc;\n } catch (err: any) {\n this.logger.error('docs.main.runtime.computeDoc caught an error', err);\n return null;\n }\n }\n\n return null;\n }\n\n getDoc(component: Component) {\n const docData = component.state.aspects.get(DocsAspect.id)?.data?.doc;\n if (!docData) return null;\n return new Doc(docData.filePath, new DocPropList(docData.props));\n }\n\n getPatterns() {\n return this.patterns;\n }\n\n getComponentDevPatterns(component: Component) {\n const env = this.envs.calculateEnv(component).env;\n const componentEnvDocsDevPatterns: string[] = env.getDocsDevPatterns ? env.getDocsDevPatterns(component) : [];\n const componentPatterns = componentEnvDocsDevPatterns.concat(this.getPatterns());\n return componentPatterns;\n }\n\n getDevPatternToRegister() {\n return this.getComponentDevPatterns.bind(this);\n }\n /**\n * register a new doc reader. this allows to support further\n * documentation file formats.\n */\n registerDocReader(docReader: DocReader) {\n this.docReaderSlot.register(docReader);\n return this;\n }\n\n static slots = [Slot.withType<DocProp>(), Slot.withType<DocReader>()];\n\n static runtime = MainRuntime;\n static dependencies = [\n PreviewAspect,\n GraphqlAspect,\n WorkspaceAspect,\n PkgAspect,\n CompilerAspect,\n LoggerAspect,\n DevFilesAspect,\n EnvsAspect,\n ];\n\n static defaultConfig = {\n patterns: ['**/*.docs.*'],\n };\n\n static async provider(\n [preview, graphql, workspace, pkg, compiler, loggerAspect, devFiles, envs]: [\n PreviewMain,\n GraphqlMain,\n Workspace,\n PkgMain,\n CompilerMain,\n LoggerMain,\n DevFilesMain,\n EnvsMain\n ],\n config: DocsConfig,\n [docPropSlot, docReaderSlot]: [DocPropSlot, DocReaderSlot]\n ) {\n const logger = loggerAspect.createLogger(DocsAspect.id);\n const docs = new DocsMain(\n config.patterns,\n\n preview,\n\n pkg,\n\n compiler,\n\n workspace,\n\n logger,\n\n devFiles,\n\n envs,\n\n docPropSlot,\n\n docReaderSlot\n );\n docs.registerDocReader(new DefaultDocReader(pkg, compiler, workspace));\n devFiles.registerDevPattern(docs.getDevPatternToRegister());\n\n if (workspace) {\n workspace.onComponentLoad(async (component) => {\n const doc = await docs.computeDoc(component);\n\n return {\n doc: doc?.toObject(),\n };\n });\n }\n\n graphql.register(docsSchema(docs));\n\n preview.registerDefinition(new DocsPreviewDefinition(docs));\n return docs;\n }\n}\n\nDocsAspect.addRuntime(DocsMain);\n"]}
|
|
1
|
+
{"version":3,"names":["DocsMain","constructor","patterns","preview","pkg","compiler","workspace","logger","devFiles","envs","docPropSlot","docReaderSlot","getDocsMap","components","ComponentMap","as","component","getDocsFiles","computeDevFiles","docFiles","get","DocsAspect","id","state","filesystem","files","filter","file","includes","relative","getDescription","componentDoc","getDoc","desc","description","consumerComponent","_consumer","fromJsDocs","docs","find","doc","getTemplate","env","getDocsTemplate","getDocReader","extension","values","docReader","isFormatSupported","computeDoc","length","docFile","extname","FileExtensionNotSupported","read","contents","err","error","docData","aspects","data","Doc","filePath","DocPropList","props","getPatterns","getComponentDevPatterns","calculateEnv","componentEnvDocsDevPatterns","getDocsDevPatterns","componentPatterns","concat","getDevPatternToRegister","bind","registerDocReader","register","provider","graphql","loggerAspect","config","createLogger","DefaultDocReader","registerDevPattern","onComponentLoad","toObject","docsSchema","registerDefinition","DocsPreviewDefinition","Slot","withType","MainRuntime","PreviewAspect","GraphqlAspect","WorkspaceAspect","PkgAspect","CompilerAspect","LoggerAspect","DevFilesAspect","EnvsAspect","addRuntime"],"sources":["docs.main.runtime.ts"],"sourcesContent":["import { Slot, SlotRegistry } from '@teambit/harmony';\nimport { MainRuntime } from '@teambit/cli';\nimport { LoggerAspect, LoggerMain, Logger } from '@teambit/logger';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { Component, ComponentMap } from '@teambit/component';\nimport { PkgAspect, PkgMain } from '@teambit/pkg';\nimport type { Environment } from '@teambit/envs';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { PreviewAspect, PreviewMain } from '@teambit/preview';\nimport DevFilesAspect, { DevFilesMain } from '@teambit/dev-files';\nimport { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { Doc, DocPropList } from '@teambit/docs.entities.doc';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { DocsAspect } from './docs.aspect';\nimport { DocsPreviewDefinition } from './docs.preview-definition';\nimport { docsSchema } from './docs.graphql';\nimport { DocReader } from './doc-reader';\nimport { DefaultDocReader } from './default-doc-reader';\nimport { FileExtensionNotSupported } from './exceptions';\n\nexport type ComponentDocs = {\n files: string[];\n component: Component;\n};\n\nexport type DocProp = {};\n\nexport type DocPropSlot = SlotRegistry<DocProp>;\n\nexport type DocReaderSlot = SlotRegistry<DocReader>;\n\nexport type DocsConfig = {\n /**\n * glob patterns to identify doc files.\n */\n patterns: string[];\n};\n\n/**\n * the component documentation extension.\n */\nexport class DocsMain {\n constructor(\n private patterns: string[],\n /**\n * envs extension.\n */\n private preview: PreviewMain,\n\n private pkg: PkgMain,\n\n private compiler: CompilerMain,\n\n private workspace: Workspace,\n\n private logger: Logger,\n\n private devFiles: DevFilesMain,\n\n private envs: EnvsMain,\n\n private docPropSlot: DocPropSlot,\n\n private docReaderSlot: DocReaderSlot\n ) {}\n\n /**\n * returns an array of doc file paths for a set of components.\n */\n getDocsMap(components: Component[]): ComponentMap<AbstractVinyl[]> {\n return ComponentMap.as<AbstractVinyl[]>(components, (component) => {\n return this.getDocsFiles(component);\n });\n }\n\n getDocsFiles(component: Component): AbstractVinyl[] {\n const devFiles = this.devFiles.computeDevFiles(component);\n const docFiles = devFiles.get(DocsAspect.id);\n return component.state.filesystem.files.filter((file) => docFiles.includes(file.relative));\n }\n\n /**\n * compute the description of the component from its source code and docs file.\n */\n async getDescription(component: Component): Promise<string> {\n const componentDoc = this.getDoc(component);\n const desc = componentDoc?.description;\n if (desc) return desc;\n const consumerComponent: ConsumerComponent = component.state._consumer;\n const fromJsDocs = consumerComponent.docs?.find((doc) => doc.description);\n\n return fromJsDocs?.description || '';\n }\n\n async getTemplate(env: Environment) {\n return env.getDocsTemplate();\n }\n\n getDocReader(extension: string) {\n return this.docReaderSlot.values().find((docReader) => docReader.isFormatSupported(extension));\n }\n\n /**\n * compute a doc for a component.\n */\n async computeDoc(component: Component) {\n const docFiles = this.getDocsFiles(component);\n if (docFiles.length) {\n // currently taking the the first docs file found with an abstract. (we support only one)\n const docFile = docFiles[0];\n\n try {\n const docReader = this.getDocReader(docFile.extname);\n if (!docReader) throw new FileExtensionNotSupported(docFile.relative, docFile.extname);\n const doc = await docReader.read(docFile.relative, docFile.contents, component);\n return doc;\n } catch (err: any) {\n this.logger.error('docs.main.runtime.computeDoc caught an error', err);\n return null;\n }\n }\n\n return null;\n }\n\n getDoc(component: Component) {\n const docData = component.state.aspects.get(DocsAspect.id)?.data?.doc;\n if (!docData) return null;\n return new Doc(docData.filePath, new DocPropList(docData.props));\n }\n\n getPatterns() {\n return this.patterns;\n }\n\n getComponentDevPatterns(component: Component) {\n const env = this.envs.calculateEnv(component).env;\n const componentEnvDocsDevPatterns: string[] = env.getDocsDevPatterns ? env.getDocsDevPatterns(component) : [];\n const componentPatterns = componentEnvDocsDevPatterns.concat(this.getPatterns());\n return componentPatterns;\n }\n\n getDevPatternToRegister() {\n return this.getComponentDevPatterns.bind(this);\n }\n /**\n * register a new doc reader. this allows to support further\n * documentation file formats.\n */\n registerDocReader(docReader: DocReader) {\n this.docReaderSlot.register(docReader);\n return this;\n }\n\n static slots = [Slot.withType<DocProp>(), Slot.withType<DocReader>()];\n\n static runtime = MainRuntime;\n static dependencies = [\n PreviewAspect,\n GraphqlAspect,\n WorkspaceAspect,\n PkgAspect,\n CompilerAspect,\n LoggerAspect,\n DevFilesAspect,\n EnvsAspect,\n ];\n\n static defaultConfig = {\n patterns: ['**/*.docs.*'],\n };\n\n static async provider(\n [preview, graphql, workspace, pkg, compiler, loggerAspect, devFiles, envs]: [\n PreviewMain,\n GraphqlMain,\n Workspace,\n PkgMain,\n CompilerMain,\n LoggerMain,\n DevFilesMain,\n EnvsMain\n ],\n config: DocsConfig,\n [docPropSlot, docReaderSlot]: [DocPropSlot, DocReaderSlot]\n ) {\n const logger = loggerAspect.createLogger(DocsAspect.id);\n const docs = new DocsMain(\n config.patterns,\n\n preview,\n\n pkg,\n\n compiler,\n\n workspace,\n\n logger,\n\n devFiles,\n\n envs,\n\n docPropSlot,\n\n docReaderSlot\n );\n docs.registerDocReader(new DefaultDocReader(pkg, compiler, workspace));\n devFiles.registerDevPattern(docs.getDevPatternToRegister());\n\n if (workspace) {\n workspace.onComponentLoad(async (component) => {\n const doc = await docs.computeDoc(component);\n\n return {\n doc: doc?.toObject(),\n };\n });\n }\n\n graphql.register(docsSchema(docs));\n\n preview.registerDefinition(new DocsPreviewDefinition(docs));\n return docs;\n }\n}\n\nDocsAspect.addRuntime(DocsMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;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AA1B,CAA3B;IACA,OAAOA,IAAP;EACD;;AAxLmB;;;gCAATtC,Q,WAiHI,CAACwF,eAAA,CAAKC,QAAL,EAAD,EAA2BD,eAAA,CAAKC,QAAL,EAA3B,C;gCAjHJzF,Q,aAmHM0F,kB;gCAnHN1F,Q,kBAoHW,CACpB2F,wBADoB,EAEpBC,wBAFoB,EAGpBC,4BAHoB,EAIpBC,gBAJoB,EAKpBC,0BALoB,EAMpBC,sBANoB,EAOpBC,mBAPoB,EAQpBC,kBARoB,C;gCApHXlG,Q,mBA+HY;EACrBE,QAAQ,EAAE,CAAC,aAAD;AADW,C;;AA4DzBmB,kBAAA,CAAW8E,UAAX,CAAsBnG,QAAtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DocsPreviewDefinition","constructor","docs","renderTemplatePath","context","renderTemplatePathByEnv","env","getTemplate","getModuleMap","components","map","getDocsMap","filter","value","length"],"sources":["docs.preview-definition.ts"],"sourcesContent":["import { Component, ComponentMap } from '@teambit/component';\nimport type { Environment, ExecutionContext } from '@teambit/envs';\nimport { PreviewDefinition } from '@teambit/preview';\nimport { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\n\nimport { DocsMain } from './docs.main.runtime';\n\nexport class DocsPreviewDefinition implements PreviewDefinition {\n readonly prefix = 'overview';\n readonly include = ['compositions'];\n readonly includePeers = true;\n\n constructor(\n /**\n * docs extension.\n */\n private docs: DocsMain\n ) {}\n\n /**\n * application root\n */\n async renderTemplatePath(context: ExecutionContext): Promise<string> {\n return this.renderTemplatePathByEnv(context.env);\n }\n\n async renderTemplatePathByEnv(env: Environment) {\n return this.docs.getTemplate(env);\n }\n\n /**\n * files to load.\n */\n async getModuleMap(components: Component[]): Promise<ComponentMap<AbstractVinyl[]>> {\n const map = this.docs.getDocsMap(components);\n return map.filter((value) => value.length !== 0);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOO,MAAMA,qBAAN,CAAyD;EAK9DC,WAAW;EACT;AACJ;AACA;EACYC,IAJC,EAKT;IAAA,KADQA,IACR,GADQA,IACR;IAAA,gDATgB,UAShB;IAAA,iDARiB,CAAC,cAAD,CAQjB;IAAA,sDAPsB,IAOtB;EAAE;EAEJ;AACF;AACA;;;EAC0B,MAAlBC,kBAAkB,CAACC,OAAD,EAA6C;IACnE,OAAO,KAAKC,uBAAL,CAA6BD,OAAO,CAACE,GAArC,CAAP;EACD;;EAE4B,MAAvBD,uBAAuB,CAACC,GAAD,EAAmB;IAC9C,OAAO,KAAKJ,IAAL,CAAUK,WAAV,CAAsBD,GAAtB,CAAP;EACD;EAED;AACF;AACA;;;EACoB,MAAZE,YAAY,CAACC,UAAD,EAAkE;IAClF,MAAMC,GAAG,GAAG,KAAKR,IAAL,CAAUS,UAAV,CAAqBF,UAArB,CAAZ;IACA,OAAOC,GAAG,CAACE,MAAJ,CAAYC,KAAD,IAAWA,KAAK,CAACC,MAAN,KAAiB,CAAvC,CAAP;EACD;;AA7B6D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DocsPreview","constructor","preview","componentId","modules","compositions","context","docsModule","selectPreviewModel","fullName","mainModule","default","NoopProvider","toString","relevant","componentMap","undefined","provider","docsPreview","registerPreview","name","render","bind","include","PreviewRuntime","PreviewAspect","DocsAspect","addRuntime","children"],"sources":["docs.preview.runtime.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { PreviewAspect, RenderingContext, PreviewPreview, PreviewRuntime, PreviewModule } from '@teambit/preview';\nimport { ComponentID } from '@teambit/component-id';\n\nimport { DocsAspect } from './docs.aspect';\n\nexport class DocsPreview {\n constructor(\n /**\n * preview extension.\n */\n private preview: PreviewPreview\n ) {}\n\n render = (componentId: ComponentID, modules: PreviewModule, [compositions]: [any], context: RenderingContext) => {\n const docsModule = this.selectPreviewModel(componentId.fullName, modules);\n\n modules.mainModule.default(NoopProvider, componentId.toString(), docsModule, compositions, context);\n };\n\n selectPreviewModel(componentId: string, modules: PreviewModule) {\n const relevant = modules.componentMap[componentId];\n if (!relevant) return undefined;\n\n // only one doc file is supported.\n return relevant[0];\n }\n\n static runtime = PreviewRuntime;\n static dependencies = [PreviewAspect];\n\n static async provider([preview]: [PreviewPreview]) {\n const docsPreview = new DocsPreview(preview);\n preview.registerPreview({\n name: 'overview',\n render: docsPreview.render.bind(docsPreview),\n selectPreviewModel: docsPreview.selectPreviewModel.bind(docsPreview),\n include: ['compositions'],\n });\n\n return docsPreview;\n }\n}\n\nDocsAspect.addRuntime(DocsPreview);\n\nfunction NoopProvider({ children }: { children: ReactNode }) {\n return <>{children}</>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,WAAN,CAAkB;EACvBC,WAAW;EACT;AACJ;AACA;EACYC,OAJC,EAKT;IAAA,KADQA,OACR,GADQA,OACR;IAAA,gDAEO,CAACC,WAAD,EAA2BC,OAA3B,EAAmD,CAACC,YAAD,CAAnD,EAA0EC,OAA1E,KAAwG;MAC/G,MAAMC,UAAU,GAAG,KAAKC,kBAAL,CAAwBL,WAAW,CAACM,QAApC,EAA8CL,OAA9C,CAAnB;MAEAA,OAAO,CAACM,UAAR,CAAmBC,OAAnB,CAA2BC,YAA3B,EAAyCT,WAAW,CAACU,QAAZ,EAAzC,EAAiEN,UAAjE,EAA6EF,YAA7E,EAA2FC,OAA3F;IACD,CANC;EAAE;;EAQJE,kBAAkB,CAACL,WAAD,EAAsBC,OAAtB,EAA8C;IAC9D,MAAMU,QAAQ,GAAGV,OAAO,CAACW,YAAR,CAAqBZ,WAArB,CAAjB;IACA,IAAI,CAACW,QAAL,EAAe,OAAOE,SAAP,CAF+C,CAI9D;;IACA,OAAOF,QAAQ,CAAC,CAAD,CAAf;EACD;;EAKoB,aAARG,QAAQ,CAAC,CAACf,OAAD,CAAD,EAA8B;IACjD,MAAMgB,WAAW,GAAG,IAAIlB,WAAJ,CAAgBE,OAAhB,CAApB;IACAA,OAAO,CAACiB,eAAR,CAAwB;MACtBC,IAAI,EAAE,UADgB;MAEtBC,MAAM,EAAEH,WAAW,CAACG,MAAZ,CAAmBC,IAAnB,CAAwBJ,WAAxB,CAFc;MAGtBV,kBAAkB,EAAEU,WAAW,CAACV,kBAAZ,CAA+Bc,IAA/B,CAAoCJ,WAApC,CAHE;MAItBK,OAAO,EAAE,CAAC,cAAD;IAJa,CAAxB;IAOA,OAAOL,WAAP;EACD;;AAnCsB;;;gCAAZlB,W,aAsBMwB,yB;gCAtBNxB,W,kBAuBW,CAACyB,wBAAD,C;;AAexBC,kBAAA,CAAWC,UAAX,CAAsB3B,WAAtB;;AAEA,SAASY,YAAT,CAAsB;EAAEgB;AAAF,CAAtB,EAA6D;EAC3D,oBAAO,gEAAGA,QAAH,CAAP;AACD"}
|
package/dist/docs.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DocsService","run","context","env","getDocsTemplate"],"sources":["docs.service.ts"],"sourcesContent":["import { EnvService, ExecutionContext } from '@teambit/envs';\n\nexport class DocsService implements EnvService<any> {\n name = 'docs';\n\n async run(context: ExecutionContext) {\n return context.env.getDocsTemplate();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,WAAN,CAA6C;EAAA;IAAA,8CAC3C,MAD2C;EAAA;;EAGzC,MAAHC,GAAG,CAACC,OAAD,EAA4B;IACnC,OAAOA,OAAO,CAACC,GAAR,CAAYC,eAAZ,EAAP;EACD;;AALiD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DocsUI","constructor","titleBadgeSlot","registerTitleBadge","titleBadge","register","listTitleBadges","provider","component","config","docs","section","OverviewSection","registerRoute","route","registerNavigation","navigationLink","order","ComponentAspect","UIRuntime","Slot","withType","DocsAspect","addRuntime"],"sources":["docs.ui.runtime.tsx"],"sourcesContent":["import { ComponentAspect, ComponentUI } from '@teambit/component';\nimport { Slot } from '@teambit/harmony';\nimport type { TitleBadge } from '@teambit/component.ui.component-meta';\nimport { UIRuntime } from '@teambit/ui';\n\nimport { DocsAspect } from './docs.aspect';\nimport { OverviewSection } from './overview.section';\nimport { TitleBadgeSlot } from './overview';\n\nexport class DocsUI {\n constructor(readonly titleBadgeSlot: TitleBadgeSlot) {}\n\n /**\n * register a new title badge into the overview section of a component.\n */\n registerTitleBadge(...titleBadge: TitleBadge[]) {\n this.titleBadgeSlot.register(titleBadge);\n return this;\n }\n\n /**\n * list all title badges registered.\n */\n listTitleBadges() {\n return this.titleBadgeSlot;\n }\n\n static dependencies = [ComponentAspect];\n\n static runtime = UIRuntime;\n\n static slots = [Slot.withType<TitleBadge>()];\n\n static async provider([component]: [ComponentUI], config, [titleBadgeSlot]: [TitleBadgeSlot]) {\n const docs = new DocsUI(titleBadgeSlot);\n const section = new OverviewSection(docs);\n\n component.registerRoute(section.route);\n component.registerNavigation(section.navigationLink, section.order);\n\n return docs;\n }\n}\n\nexport default DocsUI;\n\nDocsAspect.addRuntime(DocsUI);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,MAAN,CAAa;EAClBC,WAAW,CAAUC,cAAV,EAA0C;IAAA,KAAhCA,cAAgC,GAAhCA,cAAgC;EAAE;EAEvD;AACF;AACA;;;EACEC,kBAAkB,CAAC,GAAGC,UAAJ,EAA8B;IAC9C,KAAKF,cAAL,CAAoBG,QAApB,CAA6BD,UAA7B;IACA,OAAO,IAAP;EACD;EAED;AACF;AACA;;;EACEE,eAAe,GAAG;IAChB,OAAO,KAAKJ,cAAZ;EACD;;EAQoB,aAARK,QAAQ,CAAC,CAACC,SAAD,CAAD,EAA6BC,MAA7B,EAAqC,CAACP,cAAD,CAArC,EAAyE;IAC5F,MAAMQ,IAAI,GAAG,IAAIV,MAAJ,CAAWE,cAAX,CAAb;IACA,MAAMS,OAAO,GAAG,KAAIC,2BAAJ,EAAoBF,IAApB,CAAhB;IAEAF,SAAS,CAACK,aAAV,CAAwBF,OAAO,CAACG,KAAhC;IACAN,SAAS,CAACO,kBAAV,CAA6BJ,OAAO,CAACK,cAArC,EAAqDL,OAAO,CAACM,KAA7D;IAEA,OAAOP,IAAP;EACD;;AAhCiB;;;gCAAPV,M,kBAkBW,CAACkB,4BAAD,C;gCAlBXlB,M,aAoBMmB,e;gCApBNnB,M,WAsBI,CAACoB,eAAA,CAAKC,QAAL,EAAD,C;eAaFrB,M;;;AAEfsB,kBAAA,CAAWC,UAAX,CAAsBvB,MAAtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["ClickInsideAnIframeEventData","constructor","clickEvent","ClickInsideAnIframeEvent","BitBaseEvent","timestamp","Date","now","TYPE"],"sources":["click-inside-an-iframe.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { BitBaseEvent } from '@teambit/pubsub';\n\nclass ClickInsideAnIframeEventData {\n constructor(private clickEvent: any) {}\n}\n\nexport class ClickInsideAnIframeEvent extends BitBaseEvent<ClickInsideAnIframeEventData> {\n static readonly TYPE = 'click-inside-an-iframe';\n\n constructor(readonly timestamp = Date.now(), readonly clickEvent) {\n super(ClickInsideAnIframeEvent.TYPE, '0.0.1', timestamp, new ClickInsideAnIframeEventData(clickEvent));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AADA;AAGA,MAAMA,4BAAN,CAAmC;EACjCC,WAAW,CAASC,UAAT,EAA0B;IAAA,KAAjBA,UAAiB,GAAjBA,UAAiB;EAAE;;AADN;;AAI5B,MAAMC,wBAAN,SAAuCC,sBAAvC,CAAkF;EAGvFH,WAAW,CAAUI,SAAS,GAAGC,IAAI,CAACC,GAAL,EAAtB,EAA2CL,UAA3C,EAAuD;IAChE,MAAMC,wBAAwB,CAACK,IAA/B,EAAqC,OAArC,EAA8CH,SAA9C,EAAyD,IAAIL,4BAAJ,CAAiCE,UAAjC,CAAzD;IADgE,KAA7CG,SAA6C,GAA7CA,SAA6C;IAAA,KAAZH,UAAY,GAAZA,UAAY;EAEjE;;AALsF;;;gCAA5EC,wB,UACY,wB"}
|
package/dist/events/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './click-inside-an-iframe';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DocReadError","Error","constructor","filePath","error"],"sources":["doc-read-error.ts"],"sourcesContent":["export class DocReadError extends Error {\n constructor(filePath: string, error: Error) {\n super(`failed reading doc in file path: ${filePath} with error: ${error}`);\n }\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,YAAN,SAA2BC,KAA3B,CAAiC;EACtCC,WAAW,CAACC,QAAD,EAAmBC,KAAnB,EAAiC;IAC1C,MAAO,oCAAmCD,QAAS,gBAAeC,KAAM,EAAxE;EACD;;AAHqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["FileExtensionNotSupported","Error","constructor","filePath","extension"],"sources":["file-extension-not-supported.ts"],"sourcesContent":["export class FileExtensionNotSupported extends Error {\n constructor(filePath: string, extension: string) {\n super(`failed reading doc file: ${filePath} as file extension ${extension} is not supported\nby any of registered component doc readers. To register a doc reader please use the 'registerDocReader' API of the teambit.docs/docs.`);\n }\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,yBAAN,SAAwCC,KAAxC,CAA8C;EACnDC,WAAW,CAACC,QAAD,EAAmBC,SAAnB,EAAsC;IAC/C,MAAO,4BAA2BD,QAAS,sBAAqBC,SAAU;AAC9E,sIADI;EAED;;AAJkD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { FileExtensionNotSupported } from './file-extension-not-supported';\nexport { DocReadError } from './doc-read-error';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DocsAspect"],"sources":["index.ts"],"sourcesContent":["import { DocsAspect } from './docs.aspect';\n\n/**\n * Doc entity.\n * @deprecated - please dont use this. use directly from @teambit/docs.entities.doc.\n */\nexport { Doc, DocProp, DocPropList } from '@teambit/docs.entities.doc';\n\nexport type { DocsMain } from './docs.main.runtime';\nexport type { DocsUI } from './docs.ui.runtime';\nexport type { DocsPreview } from './docs.preview.runtime';\nexport type { DocReader } from './doc-reader';\n\nexport type { TitleBadgeSlot } from './overview';\n\nexport { DocsAspect };\nexport default DocsAspect;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAMA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAJA;AACA;AACA;AACA;eAWeA,kB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { Overview } from './overview';\nexport type { TitleBadgeSlot } from './overview';\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["ENV_LIST_WITH_DOCS_TEMPLATE","ENV_ASPECT_NAME","Overview","titleBadges","component","useContext","ComponentContext","componentDescriptor","useComponentDescriptor","lanesModel","useLanesContext","currentLane","viewedLane","envType","get","type","showHeaderOutsideIframe","preview","includesEnvTemplate","includes","buildStatus","host","margin","badges","flatten","values","styles","overviewWrapper","componentOverviewBlock","displayName","version","description","labels","packageName","deprecation","width","height"],"sources":["overview.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport flatten from 'lodash.flatten';\nimport { ComponentContext, useComponentDescriptor } from '@teambit/component';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { ComponentPreview } from '@teambit/preview.ui.component-preview';\nimport { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';\nimport { ComponentOverview, TitleBadge } from '@teambit/component.ui.component-meta';\nimport { LaneBreadcrumb, useLanesContext } from '@teambit/lanes.ui.lanes';\nimport { Separator } from '@teambit/design.ui.separator';\nimport styles from './overview.module.scss';\n\nconst ENV_LIST_WITH_DOCS_TEMPLATE = ['react', 'env', 'aspect', 'lit', 'html', 'node', 'mdx', 'react-native', 'readme']; // envs using react based docs\n\nconst ENV_ASPECT_NAME = 'teambit.envs/envs';\n\nexport type TitleBadgeSlot = SlotRegistry<TitleBadge[]>;\n\nexport type OverviewProps = {\n titleBadges: TitleBadgeSlot;\n};\n\nexport function Overview({ titleBadges }: OverviewProps) {\n const component = useContext(ComponentContext);\n const componentDescriptor = useComponentDescriptor();\n const lanesModel = useLanesContext();\n const currentLane = lanesModel?.viewedLane;\n\n const envType: string = componentDescriptor?.get<any>(ENV_ASPECT_NAME)?.type;\n const showHeaderOutsideIframe =\n component?.preview?.includesEnvTemplate === false || !ENV_LIST_WITH_DOCS_TEMPLATE.includes(envType);\n\n if (component?.buildStatus === 'pending' && component?.host === 'teambit.scope/scope')\n return (\n <StatusMessageCard style={{ margin: 'auto' }} status=\"PROCESSING\" title=\"component preview pending\">\n this might take some time\n </StatusMessageCard>\n );\n if (component?.buildStatus === 'failed' && component?.host === 'teambit.scope/scope')\n return (\n <StatusMessageCard\n style={{ margin: 'auto' }}\n status=\"FAILURE\"\n title=\"failed to get component preview \"\n ></StatusMessageCard>\n );\n\n if (showHeaderOutsideIframe) {\n const badges = flatten(titleBadges.values());\n\n return (\n <div className={styles.overviewWrapper}>\n <LaneBreadcrumb lane={currentLane} />\n <Separator isPresentational />\n <ComponentOverview\n className={styles.componentOverviewBlock}\n displayName={component.displayName}\n version={component.version}\n abstract={component.description}\n labels={component.labels}\n packageName={component.packageName}\n titleBadges={badges}\n componentDescriptor={componentDescriptor}\n deprecation={component.deprecation}\n />\n <ComponentPreview\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"overview\"\n fullContentHeight\n scrolling=\"no\"\n />\n </div>\n );\n }\n\n return currentLane ? (\n <div className={styles.overviewWrapper}>\n <LaneBreadcrumb lane={currentLane} />\n <Separator isPresentational />\n <ComponentPreview\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"overview\"\n fullContentHeight\n scrolling=\"no\"\n />\n </div>\n ) : (\n <ComponentPreview\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"overview\"\n fullContentHeight\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EA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D;;EAED,OAAOzB,WAAW,gBAChB;IAAK,SAAS,EAAEe,yBAAA,CAAOC;EAAvB,gBACE,+BAAC,yBAAD;IAAgB,IAAI,EAAEhB;EAAtB,EADF,eAEE,+BAAC,qBAAD;IAAW,gBAAgB;EAA3B,EAFF,eAGE,+BAAC,6BAAD;IACE,SAAS,EAAEP,SADb;IAEE,KAAK,EAAE;MAAE+B,KAAK,EAAE,MAAT;MAAiBC,MAAM,EAAE;IAAzB,CAFT;IAGE,WAAW,EAAC,UAHd;IAIE,iBAAiB,MAJnB;IAKE,SAAS,EAAC;EALZ,EAHF,CADgB,gBAahB,+BAAC,6BAAD;IACE,SAAS,EAAEhC,SADb;IAEE,KAAK,EAAE;MAAE+B,KAAK,EAAE,MAAT;MAAiBC,MAAM,EAAE;IAAzB,CAFT;IAGE,WAAW,EAAC,UAHd;IAIE,iBAAiB;EAJnB,EAbF;AAoBD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["OverviewSection","constructor","docs","href","exact","children","path","titleBadgeSlot"],"sources":["overview.section.tsx"],"sourcesContent":["import { Section } from '@teambit/component';\nimport React from 'react';\n\nimport { DocsUI } from './docs.ui.runtime';\nimport { Overview } from './overview';\n\nexport class OverviewSection implements Section {\n constructor(\n /**\n * docs ui extension.\n */\n private docs: DocsUI\n ) {}\n\n navigationLink = {\n href: '',\n exact: true,\n children: 'Overview',\n };\n\n route = {\n path: '',\n exact: true,\n children: <Overview titleBadges={this.docs.titleBadgeSlot} />,\n };\n\n order = 10;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,eAAN,CAAyC;EAC9CC,WAAW;EACT;AACJ;AACA;EACYC,IAJC,EAKT;IAAA,KADQA,IACR,GADQA,IACR;IAAA,wDAEe;MACfC,IAAI,EAAE,EADS;MAEfC,KAAK,EAAE,IAFQ;MAGfC,QAAQ,EAAE;IAHK,CAFf;IAAA,+CAQM;MACNC,IAAI,EAAE,EADA;MAENF,KAAK,EAAE,IAFD;MAGNC,QAAQ,eAAE,+BAAC,oBAAD;QAAU,WAAW,EAAE,KAAKH,IAAL,CAAUK;MAAjC;IAHJ,CARN;IAAA,+CAcM,EAdN;EAAE;;AAN0C"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/docs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.740",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/docs/docs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.docs",
|
|
8
8
|
"name": "docs",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.740"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
@@ -14,24 +14,24 @@
|
|
|
14
14
|
"@babel/runtime": "7.12.18",
|
|
15
15
|
"core-js": "^3.0.0",
|
|
16
16
|
"@teambit/harmony": "0.3.3",
|
|
17
|
-
"@teambit/compiler": "0.0.
|
|
18
|
-
"@teambit/component": "0.0.
|
|
17
|
+
"@teambit/compiler": "0.0.740",
|
|
18
|
+
"@teambit/component": "0.0.740",
|
|
19
19
|
"@teambit/docs.entities.doc": "0.0.3",
|
|
20
|
-
"@teambit/pkg": "0.0.
|
|
21
|
-
"@teambit/workspace": "0.0.
|
|
22
|
-
"@teambit/cli": "0.0.
|
|
23
|
-
"@teambit/dev-files": "0.0.
|
|
24
|
-
"@teambit/envs": "0.0.
|
|
25
|
-
"@teambit/graphql": "0.0.
|
|
26
|
-
"@teambit/logger": "0.0.
|
|
27
|
-
"@teambit/preview": "0.0.
|
|
20
|
+
"@teambit/pkg": "0.0.740",
|
|
21
|
+
"@teambit/workspace": "0.0.740",
|
|
22
|
+
"@teambit/cli": "0.0.492",
|
|
23
|
+
"@teambit/dev-files": "0.0.740",
|
|
24
|
+
"@teambit/envs": "0.0.740",
|
|
25
|
+
"@teambit/graphql": "0.0.740",
|
|
26
|
+
"@teambit/logger": "0.0.584",
|
|
27
|
+
"@teambit/preview": "0.0.740",
|
|
28
28
|
"@teambit/component-id": "0.0.402",
|
|
29
|
-
"@teambit/component.ui.component-meta": "0.0.
|
|
30
|
-
"@teambit/ui": "0.0.
|
|
31
|
-
"@teambit/pubsub": "0.0.
|
|
29
|
+
"@teambit/component.ui.component-meta": "0.0.51",
|
|
30
|
+
"@teambit/ui": "0.0.740",
|
|
31
|
+
"@teambit/pubsub": "0.0.740",
|
|
32
32
|
"@teambit/design.ui.separator": "0.0.354",
|
|
33
33
|
"@teambit/design.ui.surfaces.status-message-card": "0.0.7",
|
|
34
|
-
"@teambit/lanes.ui.lanes": "0.0.
|
|
34
|
+
"@teambit/lanes.ui.lanes": "0.0.58",
|
|
35
35
|
"@teambit/preview.ui.component-preview": "0.0.493"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@teambit/docs.content.docs-overview": "1.95.9"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@teambit/legacy": "1.0.
|
|
48
|
+
"@teambit/legacy": "1.0.272",
|
|
49
49
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
50
50
|
"react": "^16.8.0 || ^17.0.0"
|
|
51
51
|
},
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"react": "-"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@teambit/legacy": "1.0.
|
|
76
|
+
"@teambit/legacy": "1.0.272",
|
|
77
77
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
78
78
|
"react": "^16.8.0 || ^17.0.0"
|
|
79
79
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@0.0.740/dist/docs.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@0.0.740/dist/docs.docs.mdx')]
|
|
Binary file
|