@teambit/docs 1.0.424 → 1.0.426
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/static/css/teambit.docs/{docs-preview.8222dee7.css → docs-preview.148c85e5.css} +12 -12
- package/artifacts/preview/teambit_docs_docs-preview.js +6 -6
- package/artifacts/schema.json +108 -108
- package/dist/default-doc-reader.js.map +1 -1
- package/dist/docs.main.runtime.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/{preview-1728098619529.js → preview-1728236174539.js} +2 -2
- package/docs.ui.runtime.tsx +4 -1
- package/events/click-inside-an-iframe.ts +4 -1
- package/package.json +20 -20
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","data","require","_docsEntities","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DefaultDocReader","constructor","pkg","compiler","workspace","read","path","contents","component","packageName","getPackageName","distPath","getDistPathBySrcPath","docsModule","resolve","Doc","from","labels","default","description","abstract","displayName","componentDisplayName","isFormatSupported","format","supportedExtensions","includes","exports"],"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
|
1
|
+
{"version":3,"names":["_path","data","require","_docsEntities","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DefaultDocReader","constructor","pkg","compiler","workspace","read","path","contents","component","packageName","getPackageName","distPath","getDistPathBySrcPath","docsModule","resolve","Doc","from","labels","default","description","abstract","displayName","componentDisplayName","isFormatSupported","format","supportedExtensions","includes","exports"],"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(\n private pkg: PkgMain,\n private compiler: CompilerMain,\n private workspace: Workspace\n ) {}\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,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAE,cAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiD,SAAAG,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAA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AED,MAAM;MACvDE,WAAW,EAAEN,UAAU,CAACO,QAAQ,IAAIP,UAAU,CAACK,OAAO,EAAEE,QAAQ,IAAIP,UAAU,CAACM,WAAW;MAC1FE,WAAW,EAAER,UAAU,CAACQ,WAAW,IAAIR,UAAU,CAACK,OAAO,EAAEI;IAC7D,CAAC,CAAC;EACJ;EAIAC,iBAAiBA,CAACC,MAAc,EAAE;IAChC,OAAO,IAAI,CAACC,mBAAmB,CAACC,QAAQ,CAACF,MAAM,CAAC;EAClD;AACF;AAACG,OAAA,CAAA3B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_harmony","data","require","_cli","_logger","_compiler","_component","_scope","_pkg","_graphql","_preview","_devFiles","_workspace","_docsEntities","_lodash","_envs","_docs","_docs2","_docs3","_defaultDocReader","_exceptions","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DocsMain","constructor","patterns","preview","pkg","compiler","workspace","logger","devFiles","envs","docPropSlot","docReaderSlot","getDocsMap","components","ComponentMap","as","component","getDocsFiles","getDevFiles","docFiles","get","DocsAspect","id","state","filesystem","files","filter","file","includes","relative","getDescription","componentDoc","getDoc","desc","description","getTemplate","env","getDocsTemplate","isFunction","undefined","getDocReader","extension","values","find","docReader","isFormatSupported","computeDoc","length","docFile","extname","FileExtensionNotSupported","doc","read","contents","err","debug","message","docData","Doc","filePath","DocPropList","props","getPatterns","getComponentDevPatterns","calculateEnv","skipWarnings","inInstallContext","componentEnvDocsDevPatterns","getDocsDevPatterns","componentPatterns","concat","name","pattern","getDevPatternToRegister","bind","registerDocReader","register","provider","graphql","loggerAspect","scope","config","createLogger","docs","DefaultDocReader","registerDevPattern","computeDocsOnLoad","opts","loadDocs","toObject","registerOnComponentLoad","registerOnCompAspectReCalc","docsSchema","registerDefinition","DocsPreviewDefinition","exports","Slot","withType","MainRuntime","PreviewAspect","GraphqlAspect","WorkspaceAspect","PkgAspect","CompilerAspect","LoggerAspect","DevFilesAspect","EnvsAspect","ScopeAspect","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, IComponent } from '@teambit/component';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\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 { ComponentLoadOptions } from '@teambit/legacy/dist/consumer/component/component-loader';\nimport { AbstractVinyl } from '@teambit/component.sources';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { Doc, DocPropList } from '@teambit/docs.entities.doc';\nimport { isFunction } from 'lodash';\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.getDevFiles(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 return desc || '';\n }\n\n async getTemplate(env: Environment): Promise<string | undefined> {\n if (env.getDocsTemplate && isFunction(env.getDocsTemplate)) {\n return env.getDocsTemplate();\n }\n return undefined;\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 // it's ok to fail here.\n this.logger.debug(`docs.main.runtime.computeDoc caught an error: ${err.message}`);\n return null;\n }\n }\n\n return null;\n }\n\n getDoc(component: IComponent) {\n const docData = component.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, { skipWarnings: !!this.workspace?.inInstallContext }).env;\n const componentEnvDocsDevPatterns: string[] = env.getDocsDevPatterns ? env.getDocsDevPatterns(component) : [];\n const componentPatterns = componentEnvDocsDevPatterns.concat(this.getPatterns());\n return { name: 'docs', pattern: 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 ScopeAspect,\n ];\n\n static defaultConfig = {\n patterns: ['**/*.docs.*'],\n };\n\n static async provider(\n [preview, graphql, workspace, pkg, compiler, loggerAspect, devFiles, envs, scope]: [\n PreviewMain,\n GraphqlMain,\n Workspace,\n PkgMain,\n CompilerMain,\n LoggerMain,\n DevFilesMain,\n EnvsMain,\n ScopeMain\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 preview,\n pkg,\n compiler,\n workspace,\n logger,\n devFiles,\n envs,\n docPropSlot,\n docReaderSlot\n );\n docs.registerDocReader(new DefaultDocReader(pkg, compiler, workspace));\n devFiles.registerDevPattern(docs.getDevPatternToRegister());\n\n const computeDocsOnLoad = async (component: Component, opts?: ComponentLoadOptions) => {\n if (opts?.loadDocs === false) return undefined;\n // const docFiles = await docs.computeDocs(component);\n const doc = await docs.computeDoc(component);\n\n return {\n doc: doc?.toObject(),\n // docFiles\n };\n };\n\n if (workspace) {\n workspace.registerOnComponentLoad(computeDocsOnLoad);\n }\n if (scope) {\n scope.registerOnCompAspectReCalc(computeDocsOnLoad);\n }\n\n graphql.register(docsSchema(docs));\n\n preview.registerDefinition(new DocsPrevi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+
{"version":3,"names":["_harmony","data","require","_cli","_logger","_compiler","_component","_scope","_pkg","_graphql","_preview","_devFiles","_workspace","_docsEntities","_lodash","_envs","_docs","_docs2","_docs3","_defaultDocReader","_exceptions","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DocsMain","constructor","patterns","preview","pkg","compiler","workspace","logger","devFiles","envs","docPropSlot","docReaderSlot","getDocsMap","components","ComponentMap","as","component","getDocsFiles","getDevFiles","docFiles","get","DocsAspect","id","state","filesystem","files","filter","file","includes","relative","getDescription","componentDoc","getDoc","desc","description","getTemplate","env","getDocsTemplate","isFunction","undefined","getDocReader","extension","values","find","docReader","isFormatSupported","computeDoc","length","docFile","extname","FileExtensionNotSupported","doc","read","contents","err","debug","message","docData","Doc","filePath","DocPropList","props","getPatterns","getComponentDevPatterns","calculateEnv","skipWarnings","inInstallContext","componentEnvDocsDevPatterns","getDocsDevPatterns","componentPatterns","concat","name","pattern","getDevPatternToRegister","bind","registerDocReader","register","provider","graphql","loggerAspect","scope","config","createLogger","docs","DefaultDocReader","registerDevPattern","computeDocsOnLoad","opts","loadDocs","toObject","registerOnComponentLoad","registerOnCompAspectReCalc","docsSchema","registerDefinition","DocsPreviewDefinition","exports","Slot","withType","MainRuntime","PreviewAspect","GraphqlAspect","WorkspaceAspect","PkgAspect","CompilerAspect","LoggerAspect","DevFilesAspect","EnvsAspect","ScopeAspect","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, IComponent } from '@teambit/component';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\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 { ComponentLoadOptions } from '@teambit/legacy/dist/consumer/component/component-loader';\nimport { AbstractVinyl } from '@teambit/component.sources';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { Doc, DocPropList } from '@teambit/docs.entities.doc';\nimport { isFunction } from 'lodash';\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.getDevFiles(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 return desc || '';\n }\n\n async getTemplate(env: Environment): Promise<string | undefined> {\n if (env.getDocsTemplate && isFunction(env.getDocsTemplate)) {\n return env.getDocsTemplate();\n }\n return undefined;\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 // it's ok to fail here.\n this.logger.debug(`docs.main.runtime.computeDoc caught an error: ${err.message}`);\n return null;\n }\n }\n\n return null;\n }\n\n getDoc(component: IComponent) {\n const docData = component.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, { skipWarnings: !!this.workspace?.inInstallContext }).env;\n const componentEnvDocsDevPatterns: string[] = env.getDocsDevPatterns ? env.getDocsDevPatterns(component) : [];\n const componentPatterns = componentEnvDocsDevPatterns.concat(this.getPatterns());\n return { name: 'docs', pattern: 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 ScopeAspect,\n ];\n\n static defaultConfig = {\n patterns: ['**/*.docs.*'],\n };\n\n static async provider(\n [preview, graphql, workspace, pkg, compiler, loggerAspect, devFiles, envs, scope]: [\n PreviewMain,\n GraphqlMain,\n Workspace,\n PkgMain,\n CompilerMain,\n LoggerMain,\n DevFilesMain,\n EnvsMain,\n ScopeMain,\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 preview,\n pkg,\n compiler,\n workspace,\n logger,\n devFiles,\n envs,\n docPropSlot,\n docReaderSlot\n );\n docs.registerDocReader(new DefaultDocReader(pkg, compiler, workspace));\n devFiles.registerDevPattern(docs.getDevPatternToRegister());\n\n const computeDocsOnLoad = async (component: Component, opts?: ComponentLoadOptions) => {\n if (opts?.loadDocs === false) return undefined;\n // const docFiles = await docs.computeDocs(component);\n const doc = await docs.computeDoc(component);\n\n return {\n doc: doc?.toObject(),\n // docFiles\n };\n };\n\n if (workspace) {\n workspace.registerOnComponentLoad(computeDocsOnLoad);\n }\n if (scope) {\n scope.registerOnCompAspectReCalc(computeDocsOnLoad);\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,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CA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,CAACoF,uBAAuB,CAACJ,iBAAiB,CAAC;IACtD;IACA,IAAIN,KAAK,EAAE;MACTA,KAAK,CAACW,0BAA0B,CAACL,iBAAiB,CAAC;IACrD;IAEAR,OAAO,CAACF,QAAQ,CAAC,IAAAgB,mBAAU,EAACT,IAAI,CAAC,CAAC;IAElChF,OAAO,CAAC0F,kBAAkB,CAAC,KAAIC,8BAAqB,EAACX,IAAI,CAAC,CAAC;IAC3D,OAAOA,IAAI;EACb;AACF;AAACY,OAAA,CAAA/F,QAAA,GAAAA,QAAA;AAAAnB,eAAA,CA1LYmB,QAAQ,WAiHJ,CAACgG,eAAI,CAACC,QAAQ,CAAU,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAY,CAAC,CAAC;AAAApH,eAAA,CAjH1DmB,QAAQ,aAmHFkG,kBAAW;AAAArH,eAAA,CAnHjBmB,QAAQ,kBAoHG,CACpBmG,wBAAa,EACbC,wBAAa,EACbC,4BAAe,EACfC,gBAAS,EACTC,0BAAc,EACdC,sBAAY,EACZC,0BAAc,EACdC,kBAAU,EACVC,oBAAW,CACZ;AAAA9H,eAAA,CA9HUmB,QAAQ,mBAgII;EACrBE,QAAQ,EAAE,CAAC,aAAa;AAC1B,CAAC;AA0DHmB,kBAAU,CAACuF,UAAU,CAAC5G,QAAQ,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_lodash","_component","_harmony","_ui","_componentCompare","_docsUi","_docsUi2","_apiReference","_docs","_overview","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DocsUI","constructor","titleBadgeSlot","overviewOptionsSlot","registerTitleBadge","titleBadges","badges","Array","isArray","register","listTitleBadges","flatten","values","registerEmptyState","emptyState","_emptyState","getEmptyState","getDocsCompare","createElement","OverviewCompare","overviewOptions","registerOverviewOptions","options","provider","component","componentCompare","apiRef","config","docs","section","OverviewSection","compareSection","OverviewCompareSection","registerRoute","route","registerNavigation","navigationLink","order","registerRoutes","exports","ComponentAspect","ComponentCompareAspect","APIReferenceAspect","UIRuntime","Slot","withType","_default","DocsAspect","addRuntime"],"sources":["docs.ui.runtime.tsx"],"sourcesContent":["import React, { ComponentType } from 'react';\nimport { flatten } from 'lodash';\nimport { ComponentAspect, ComponentUI } from '@teambit/component';\nimport { Slot } from '@teambit/harmony';\nimport { UIRuntime } from '@teambit/ui';\nimport { ComponentCompareAspect, ComponentCompareUI } from '@teambit/component-compare';\nimport { OverviewCompare } from '@teambit/docs.ui.overview-compare';\nimport { OverviewCompareSection } from '@teambit/docs.ui.overview-compare-section';\nimport { APIReferenceAspect, APIReferenceUI } from '@teambit/api-reference';\nimport { DocsAspect } from './docs.aspect';\nimport { OverviewSection } from './overview.section';\nimport type { TitleBadgeSlot, TitleBadge, OverviewOptionsSlot, OverviewOptions } from './overview';\n\nexport class DocsUI {\n constructor(readonly titleBadgeSlot: TitleBadgeSlot
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_lodash","_component","_harmony","_ui","_componentCompare","_docsUi","_docsUi2","_apiReference","_docs","_overview","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DocsUI","constructor","titleBadgeSlot","overviewOptionsSlot","registerTitleBadge","titleBadges","badges","Array","isArray","register","listTitleBadges","flatten","values","registerEmptyState","emptyState","_emptyState","getEmptyState","getDocsCompare","createElement","OverviewCompare","overviewOptions","registerOverviewOptions","options","provider","component","componentCompare","apiRef","config","docs","section","OverviewSection","compareSection","OverviewCompareSection","registerRoute","route","registerNavigation","navigationLink","order","registerRoutes","exports","ComponentAspect","ComponentCompareAspect","APIReferenceAspect","UIRuntime","Slot","withType","_default","DocsAspect","addRuntime"],"sources":["docs.ui.runtime.tsx"],"sourcesContent":["import React, { ComponentType } from 'react';\nimport { flatten } from 'lodash';\nimport { ComponentAspect, ComponentUI } from '@teambit/component';\nimport { Slot } from '@teambit/harmony';\nimport { UIRuntime } from '@teambit/ui';\nimport { ComponentCompareAspect, ComponentCompareUI } from '@teambit/component-compare';\nimport { OverviewCompare } from '@teambit/docs.ui.overview-compare';\nimport { OverviewCompareSection } from '@teambit/docs.ui.overview-compare-section';\nimport { APIReferenceAspect, APIReferenceUI } from '@teambit/api-reference';\nimport { DocsAspect } from './docs.aspect';\nimport { OverviewSection } from './overview.section';\nimport type { TitleBadgeSlot, TitleBadge, OverviewOptionsSlot, OverviewOptions } from './overview';\n\nexport class DocsUI {\n constructor(\n readonly titleBadgeSlot: TitleBadgeSlot,\n readonly overviewOptionsSlot: OverviewOptionsSlot\n ) {}\n\n /**\n * register a new title badge into the overview section of a component.\n */\n registerTitleBadge(titleBadges: TitleBadge | TitleBadge[]) {\n const badges = Array.isArray(titleBadges) ? titleBadges : [titleBadges];\n this.titleBadgeSlot.register(badges);\n return this;\n }\n\n /**\n * list all title badges registered.\n */\n listTitleBadges() {\n return flatten(this.titleBadgeSlot.values());\n }\n\n private _emptyState?: ComponentType;\n\n registerEmptyState(emptyState: ComponentType) {\n return (this._emptyState = emptyState);\n }\n\n getEmptyState() {\n return this._emptyState;\n }\n\n getDocsCompare() {\n return <OverviewCompare titleBadges={this.titleBadgeSlot} overviewOptions={this.overviewOptionsSlot} />;\n }\n\n registerOverviewOptions(options: OverviewOptions) {\n this.overviewOptionsSlot.register(options);\n }\n\n static dependencies = [ComponentAspect, ComponentCompareAspect, APIReferenceAspect];\n\n static runtime = UIRuntime;\n\n static slots = [Slot.withType<TitleBadge>(), Slot.withType<OverviewOptions>()];\n\n static async provider(\n [component, componentCompare, apiRef]: [ComponentUI, ComponentCompareUI, APIReferenceUI],\n config,\n [titleBadgeSlot, overviewOptionsSlot]: [TitleBadgeSlot, OverviewOptionsSlot]\n ) {\n const docs = new DocsUI(titleBadgeSlot, overviewOptionsSlot);\n const section = new OverviewSection(titleBadgeSlot, overviewOptionsSlot, docs, apiRef);\n const compareSection = new OverviewCompareSection(docs);\n\n component.registerRoute(section.route);\n component.registerNavigation(section.navigationLink, section.order);\n componentCompare.registerNavigation(compareSection);\n componentCompare.registerRoutes([compareSection.route]);\n return docs;\n }\n}\n\nexport default DocsUI;\n\nDocsAspect.addRuntime(DocsUI);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,IAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,GAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,kBAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,iBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,QAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,SAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,QAAA,YAAAA,CAAA;IAA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AAG,KAAIC,2BAAe,EAAC5B,cAAc,EAAEC,mBAAmB,EAAEyB,IAAI,EAAEF,MAAM,CAAC;IACtF,MAAMK,cAAc,GAAG,KAAIC,iCAAsB,EAACJ,IAAI,CAAC;IAEvDJ,SAAS,CAACS,aAAa,CAACJ,OAAO,CAACK,KAAK,CAAC;IACtCV,SAAS,CAACW,kBAAkB,CAACN,OAAO,CAACO,cAAc,EAAEP,OAAO,CAACQ,KAAK,CAAC;IACnEZ,gBAAgB,CAACU,kBAAkB,CAACJ,cAAc,CAAC;IACnDN,gBAAgB,CAACa,cAAc,CAAC,CAACP,cAAc,CAACG,KAAK,CAAC,CAAC;IACvD,OAAON,IAAI;EACb;AACF;AAACW,OAAA,CAAAvC,MAAA,GAAAA,MAAA;AAAAlB,eAAA,CA7DYkB,MAAM,kBAwCK,CAACwC,4BAAe,EAAEC,0CAAsB,EAAEC,kCAAkB,CAAC;AAAA5D,eAAA,CAxCxEkB,MAAM,aA0CA2C,eAAS;AAAA7D,eAAA,CA1CfkB,MAAM,WA4CF,CAAC4C,eAAI,CAACC,QAAQ,CAAa,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAkB,CAAC,CAAC;AAAA,IAAAC,QAAA,GAAAP,OAAA,CAAA1D,OAAA,GAmBjEmB,MAAM;AAErB+C,kBAAU,CAACC,UAAU,CAAChD,MAAM,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_pubsub","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ClickInsideAnIframeEventData","constructor","clickEvent","ClickInsideAnIframeEvent","BitBaseEvent","timestamp","Date","now","TYPE","exports"],"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()
|
1
|
+
{"version":3,"names":["_pubsub","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ClickInsideAnIframeEventData","constructor","clickEvent","ClickInsideAnIframeEvent","BitBaseEvent","timestamp","Date","now","TYPE","exports"],"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(\n readonly timestamp = Date.now(),\n readonly clickEvent\n ) {\n super(ClickInsideAnIframeEvent.TYPE, '0.0.1', timestamp, new ClickInsideAnIframeEventData(clickEvent));\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA,KAD/C;AAGA,MAAMgB,4BAA4B,CAAC;EACjCC,WAAWA,CAASC,UAAe,EAAE;IAAA,KAAjBA,UAAe,GAAfA,UAAe;EAAG;AACxC;AAEO,MAAMC,wBAAwB,SAASC,sBAAY,CAA+B;EAGvFH,WAAWA,CACAI,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EACtBL,UAAU,EACnB;IACA,KAAK,CAACC,wBAAwB,CAACK,IAAI,EAAE,OAAO,EAAEH,SAAS,EAAE,IAAIL,4BAA4B,CAACE,UAAU,CAAC,CAAC;IAAC,KAH9FG,SAAS,GAATA,SAAS;IAAA,KACTH,UAAU,GAAVA,UAAU;EAGrB;AACF;AAACO,OAAA,CAAAN,wBAAA,GAAAA,wBAAA;AAAAtB,eAAA,CATYsB,wBAAwB,UACZ,wBAAwB","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.426/dist/docs.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.426/dist/docs.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/docs.ui.runtime.tsx
CHANGED
@@ -12,7 +12,10 @@ import { OverviewSection } from './overview.section';
|
|
12
12
|
import type { TitleBadgeSlot, TitleBadge, OverviewOptionsSlot, OverviewOptions } from './overview';
|
13
13
|
|
14
14
|
export class DocsUI {
|
15
|
-
constructor(
|
15
|
+
constructor(
|
16
|
+
readonly titleBadgeSlot: TitleBadgeSlot,
|
17
|
+
readonly overviewOptionsSlot: OverviewOptionsSlot
|
18
|
+
) {}
|
16
19
|
|
17
20
|
/**
|
18
21
|
* register a new title badge into the overview section of a component.
|
@@ -8,7 +8,10 @@ class ClickInsideAnIframeEventData {
|
|
8
8
|
export class ClickInsideAnIframeEvent extends BitBaseEvent<ClickInsideAnIframeEventData> {
|
9
9
|
static readonly TYPE = 'click-inside-an-iframe';
|
10
10
|
|
11
|
-
constructor(
|
11
|
+
constructor(
|
12
|
+
readonly timestamp = Date.now(),
|
13
|
+
readonly clickEvent
|
14
|
+
) {
|
12
15
|
super(ClickInsideAnIframeEvent.TYPE, '0.0.1', timestamp, new ClickInsideAnIframeEventData(clickEvent));
|
13
16
|
}
|
14
17
|
}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/docs",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.426",
|
4
4
|
"homepage": "https://bit.cloud/teambit/docs/docs",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.docs",
|
8
8
|
"name": "docs",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.426"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"graphql-tag": "2.12.1",
|
@@ -19,24 +19,24 @@
|
|
19
19
|
"@teambit/base-react.themes.theme-switcher": "1.0.2",
|
20
20
|
"@teambit/component.ui.component-meta": "0.0.358",
|
21
21
|
"@teambit/base-ui.loaders.skeleton": "1.0.1",
|
22
|
-
"@teambit/compiler": "1.0.
|
23
|
-
"@teambit/component": "1.0.
|
24
|
-
"@teambit/pkg": "1.0.
|
25
|
-
"@teambit/workspace": "1.0.
|
26
|
-
"@teambit/cli": "0.0.
|
27
|
-
"@teambit/component.sources": "0.0.
|
28
|
-
"@teambit/dev-files": "1.0.
|
29
|
-
"@teambit/envs": "1.0.
|
30
|
-
"@teambit/graphql": "1.0.
|
31
|
-
"@teambit/logger": "0.0.
|
32
|
-
"@teambit/preview": "1.0.
|
33
|
-
"@teambit/scope": "1.0.
|
34
|
-
"@teambit/api-reference": "1.0.
|
35
|
-
"@teambit/component-compare": "1.0.
|
36
|
-
"@teambit/ui": "1.0.
|
37
|
-
"@teambit/
|
38
|
-
"@teambit/
|
39
|
-
"@teambit/
|
22
|
+
"@teambit/compiler": "1.0.426",
|
23
|
+
"@teambit/component": "1.0.426",
|
24
|
+
"@teambit/pkg": "1.0.426",
|
25
|
+
"@teambit/workspace": "1.0.426",
|
26
|
+
"@teambit/cli": "0.0.1003",
|
27
|
+
"@teambit/component.sources": "0.0.34",
|
28
|
+
"@teambit/dev-files": "1.0.426",
|
29
|
+
"@teambit/envs": "1.0.426",
|
30
|
+
"@teambit/graphql": "1.0.426",
|
31
|
+
"@teambit/logger": "0.0.1096",
|
32
|
+
"@teambit/preview": "1.0.426",
|
33
|
+
"@teambit/scope": "1.0.426",
|
34
|
+
"@teambit/api-reference": "1.0.426",
|
35
|
+
"@teambit/component-compare": "1.0.426",
|
36
|
+
"@teambit/ui": "1.0.426",
|
37
|
+
"@teambit/pubsub": "1.0.426",
|
38
|
+
"@teambit/compositions.panels.composition-gallery": "0.0.213",
|
39
|
+
"@teambit/preview.ui.component-preview": "1.0.16"
|
40
40
|
},
|
41
41
|
"devDependencies": {
|
42
42
|
"@types/lodash": "4.14.165",
|