@teambit/docs 1.0.332 → 1.0.334
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.38d8ab42.css → docs-preview.94348e22.css} +6 -6
- package/artifacts/preview/teambit_docs_docs-preview.js +6 -6
- package/artifacts/schema.json +1 -1
- package/dist/docs.main.runtime.d.ts +1 -1
- package/dist/docs.main.runtime.js.map +1 -1
- package/dist/docs.preview-definition.d.ts +1 -1
- package/dist/docs.preview-definition.js.map +1 -1
- package/dist/overview/overview.js +2 -2
- package/dist/overview/overview.js.map +1 -1
- package/dist/{preview-1720690103747.js → preview-1720840825010.js} +2 -2
- package/package.json +18 -17
package/artifacts/schema.json
CHANGED
@@ -8,7 +8,7 @@ import type { Environment } from '@teambit/envs';
|
|
8
8
|
import { GraphqlMain } from '@teambit/graphql';
|
9
9
|
import { PreviewMain } from '@teambit/preview';
|
10
10
|
import { DevFilesMain } from '@teambit/dev-files';
|
11
|
-
import { AbstractVinyl } from '@teambit/
|
11
|
+
import { AbstractVinyl } from '@teambit/component.sources';
|
12
12
|
import { Workspace } from '@teambit/workspace';
|
13
13
|
import { Doc } from '@teambit/docs.entities.doc';
|
14
14
|
import { EnvsMain } from '@teambit/envs';
|
@@ -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/legacy/dist/consumer/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,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;E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C,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
|
+
{"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.register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List":[]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Component, ComponentMap } from '@teambit/component';
|
2
2
|
import type { Environment, ExecutionContext } from '@teambit/envs';
|
3
3
|
import { PreviewDefinition } from '@teambit/preview';
|
4
|
-
import { AbstractVinyl } from '@teambit/
|
4
|
+
import { AbstractVinyl } from '@teambit/component.sources';
|
5
5
|
import { DocsMain } from './docs.main.runtime';
|
6
6
|
export declare class DocsPreviewDefinition implements PreviewDefinition {
|
7
7
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["DocsPreviewDefinition","constructor","docs","_defineProperty","renderTemplatePath","context","renderTemplatePathByEnv","env","getTemplate","getModuleMap","components","map","getDocsMap","exports"],"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/
|
1
|
+
{"version":3,"names":["DocsPreviewDefinition","constructor","docs","_defineProperty","renderTemplatePath","context","renderTemplatePathByEnv","env","getTemplate","getModuleMap","components","map","getDocsMap","exports"],"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/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 | undefined> {\n return this.renderTemplatePathByEnv(context.env);\n }\n\n async renderTemplatePathByEnv(env: Environment): Promise<string | undefined> {\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;\n }\n}\n"],"mappings":";;;;;;;;;AAOO,MAAMA,qBAAqB,CAA8B;EAK9DC,WAAWA;EACT;AACJ;AACA;EACYC,IAAc,EACtB;IAAA,KADQA,IAAc,GAAdA,IAAc;IAAAC,eAAA,iBARN,UAAU;IAAAA,eAAA,kBACT,CAAC,cAAc,CAAC;IAAAA,eAAA,uBACX,IAAI;EAOzB;;EAEH;AACF;AACA;EACE,MAAMC,kBAAkBA,CAACC,OAAyB,EAA+B;IAC/E,OAAO,IAAI,CAACC,uBAAuB,CAACD,OAAO,CAACE,GAAG,CAAC;EAClD;EAEA,MAAMD,uBAAuBA,CAACC,GAAgB,EAA+B;IAC3E,OAAO,IAAI,CAACL,IAAI,CAACM,WAAW,CAACD,GAAG,CAAC;EACnC;;EAEA;AACF;AACA;EACE,MAAME,YAAYA,CAACC,UAAuB,EAA0C;IAClF,MAAMC,GAAG,GAAG,IAAI,CAACT,IAAI,CAACU,UAAU,CAACF,UAAU,CAAC;IAC5C,OAAOC,GAAG;EACZ;AACF;AAACE,OAAA,CAAAb,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
@@ -82,8 +82,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
82
82
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
83
83
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
84
84
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
85
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
86
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
85
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
86
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
87
87
|
let BadgePosition = exports.BadgePosition = /*#__PURE__*/function (BadgePosition) {
|
88
88
|
BadgePosition[BadgePosition["Title"] = 0] = "Title";
|
89
89
|
BadgePosition[BadgePosition["SubTitle"] = 1] = "SubTitle";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_lodash","_component","_previewUi","_componentUi","_compositionsPanels","_baseReactThemes","_readmeSkeleton","_overviewModule","_excluded","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","BadgePosition","exports","Overview","titleBadges","overviewOptions","previewProps","getEmptyState","TaggedAPI","component","useContext","ComponentContext","componentDescriptor","useComponentDescriptor","current","useThemePicker","overviewProps","flatten","values","showHeader","preview","legacyHeader","EmptyState","buildFailed","buildStatus","toLowerCase","host","isScaling","Boolean","includesEnvTemplate","defaultLoadingState","React","useMemo","isLoading","setLoading","useState","iframeQueryParams","onlyOverview","skipIncludes","overviewPropsValues","themeParams","themeName","_ref","onLoad","style","rest","onPreviewLoad","useCallback","props","useEffect","id","toString","createElement","className","classNames","styles","overviewWrapper","noOverflow","key","ComponentOverview","componentOverviewBlock","legacyPreview","displayName","version","abstract","description","labels","packageName","readme","ReadmeSkeleton","CompositionGallerySkeleton","compositionsLength","Math","min","compositions","ComponentPreview","previewName","pubsub","queryParams","viewport","fullContentHeight","disableScroll","width","height","minHeight","undefined","CompositionGallery","componentId"],"sources":["overview.tsx"],"sourcesContent":["import React, { useContext, ComponentType, useState } from 'react';\nimport classNames from 'classnames';\nimport { flatten } from 'lodash';\n// import { Icon } from '@teambit/design.elements.icon';\n// import { LinkedHeading } from '@teambit/documenter.ui.linked-heading';\nimport { ComponentContext, useComponentDescriptor } from '@teambit/component';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.component-preview';\n// import { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';\nimport { ComponentOverview } from '@teambit/component.ui.component-meta';\nimport { CompositionGallery, CompositionGallerySkeleton } from '@teambit/compositions.panels.composition-gallery';\nimport { useThemePicker } from '@teambit/base-react.themes.theme-switcher';\nimport { ReadmeSkeleton } from './readme-skeleton';\nimport styles from './overview.module.scss';\n\nexport enum BadgePosition {\n Title,\n SubTitle,\n Labels,\n Package,\n}\n\nexport type TitleBadge = {\n component: ComponentType<any>;\n weight?: number;\n position?: BadgePosition;\n};\n\nexport type TitleBadgeSlot = SlotRegistry<TitleBadge[]>;\n\nexport type OverviewOptions = () => { queryParams?: string };\n\nexport type OverviewOptionsSlot = SlotRegistry<OverviewOptions>;\n\nexport type OverviewProps = {\n titleBadges: TitleBadgeSlot;\n overviewOptions: OverviewOptionsSlot;\n previewProps?: Partial<ComponentPreviewProps>;\n getEmptyState?: () => ComponentType | undefined;\n TaggedAPI?: React.ComponentType<{ componentId: string }>;\n};\n\nexport function Overview({ titleBadges, overviewOptions, previewProps, getEmptyState, TaggedAPI }: OverviewProps) {\n const component = useContext(ComponentContext);\n const componentDescriptor = useComponentDescriptor();\n const { current } = useThemePicker();\n const overviewProps = flatten(overviewOptions.values())[0];\n const showHeader = !component.preview?.legacyHeader;\n const EmptyState = getEmptyState && getEmptyState();\n const buildFailed = component.buildStatus?.toLowerCase() !== 'succeed' && component?.host === 'teambit.scope/scope';\n const isScaling = Boolean(component.preview?.isScaling);\n const includesEnvTemplate = Boolean(component.preview?.includesEnvTemplate);\n const defaultLoadingState = React.useMemo(() => {\n return isScaling && !includesEnvTemplate;\n }, [isScaling, includesEnvTemplate]);\n\n const [isLoading, setLoading] = useState(defaultLoadingState);\n\n const iframeQueryParams = `onlyOverview=${component.preview?.onlyOverview || 'false'}&skipIncludes=${\n component.preview?.skipIncludes || component.preview?.onlyOverview\n }`;\n\n const overviewPropsValues = overviewProps && overviewProps();\n\n const themeParams = current?.themeName ? `theme=${current?.themeName}` : '';\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onLoad, style, ...rest } = previewProps || {};\n\n const onPreviewLoad = React.useCallback(\n (e, props) => {\n setLoading(false);\n onLoad?.(e, props);\n },\n [onLoad]\n );\n\n React.useEffect(() => {\n if (!isLoading && defaultLoadingState) setLoading(true);\n if (isLoading && !defaultLoadingState) setLoading(false);\n }, [component.id.toString(), defaultLoadingState]);\n\n return (\n <div\n className={classNames(styles.overviewWrapper, isLoading && styles.noOverflow)}\n key={`${component.id.toString()}`}\n >\n {showHeader && (\n <ComponentOverview\n className={classNames(styles.componentOverviewBlock, !isScaling && styles.legacyPreview)}\n displayName={component.displayName}\n version={component.version}\n abstract={component.description}\n labels={component.labels}\n packageName={component.packageName}\n titleBadges={flatten(titleBadges.values())}\n componentDescriptor={componentDescriptor}\n component={component}\n />\n )}\n {!buildFailed && (\n <div className={styles.readme}>\n {isLoading && (\n <ReadmeSkeleton>\n <CompositionGallerySkeleton compositionsLength={Math.min(component.compositions.length, 3)} />\n </ReadmeSkeleton>\n )}\n <ComponentPreview\n onLoad={onPreviewLoad}\n previewName=\"overview\"\n pubsub={true}\n queryParams={[iframeQueryParams, themeParams, overviewPropsValues?.queryParams || '']}\n viewport={null}\n fullContentHeight\n disableScroll={true}\n {...rest}\n component={component}\n style={{ width: '100%', height: '100%', minHeight: !isScaling ? 500 : undefined }}\n />\n {component.preview?.onlyOverview && !isLoading && <CompositionGallery component={component} />}\n {component.preview?.onlyOverview && !isLoading && TaggedAPI && (\n <TaggedAPI componentId={component.id.toString()} />\n )}\n </div>\n )}\n {buildFailed && EmptyState && <EmptyState />}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IA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,IAAID,UAAU,iBAAIpE,MAAA,GAAAiB,OAAA,CAAAiF,aAAA,CAAC9B,UAAU,MAAE,CACxC,CAAC;AAEV","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_lodash","_component","_previewUi","_componentUi","_compositionsPanels","_baseReactThemes","_readmeSkeleton","_overviewModule","_excluded","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","s","includes","propertyIsEnumerable","BadgePosition","exports","Overview","titleBadges","overviewOptions","previewProps","getEmptyState","TaggedAPI","component","useContext","ComponentContext","componentDescriptor","useComponentDescriptor","current","useThemePicker","overviewProps","flatten","values","showHeader","preview","legacyHeader","EmptyState","buildFailed","buildStatus","toLowerCase","host","isScaling","Boolean","includesEnvTemplate","defaultLoadingState","React","useMemo","isLoading","setLoading","useState","iframeQueryParams","onlyOverview","skipIncludes","overviewPropsValues","themeParams","themeName","_ref","onLoad","style","rest","onPreviewLoad","useCallback","props","useEffect","id","toString","createElement","className","classNames","styles","overviewWrapper","noOverflow","key","ComponentOverview","componentOverviewBlock","legacyPreview","displayName","version","abstract","description","labels","packageName","readme","ReadmeSkeleton","CompositionGallerySkeleton","compositionsLength","Math","min","compositions","ComponentPreview","previewName","pubsub","queryParams","viewport","fullContentHeight","disableScroll","width","height","minHeight","undefined","CompositionGallery","componentId"],"sources":["overview.tsx"],"sourcesContent":["import React, { useContext, ComponentType, useState } from 'react';\nimport classNames from 'classnames';\nimport { flatten } from 'lodash';\n// import { Icon } from '@teambit/design.elements.icon';\n// import { LinkedHeading } from '@teambit/documenter.ui.linked-heading';\nimport { ComponentContext, useComponentDescriptor } from '@teambit/component';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.component-preview';\n// import { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';\nimport { ComponentOverview } from '@teambit/component.ui.component-meta';\nimport { CompositionGallery, CompositionGallerySkeleton } from '@teambit/compositions.panels.composition-gallery';\nimport { useThemePicker } from '@teambit/base-react.themes.theme-switcher';\nimport { ReadmeSkeleton } from './readme-skeleton';\nimport styles from './overview.module.scss';\n\nexport enum BadgePosition {\n Title,\n SubTitle,\n Labels,\n Package,\n}\n\nexport type TitleBadge = {\n component: ComponentType<any>;\n weight?: number;\n position?: BadgePosition;\n};\n\nexport type TitleBadgeSlot = SlotRegistry<TitleBadge[]>;\n\nexport type OverviewOptions = () => { queryParams?: string };\n\nexport type OverviewOptionsSlot = SlotRegistry<OverviewOptions>;\n\nexport type OverviewProps = {\n titleBadges: TitleBadgeSlot;\n overviewOptions: OverviewOptionsSlot;\n previewProps?: Partial<ComponentPreviewProps>;\n getEmptyState?: () => ComponentType | undefined;\n TaggedAPI?: React.ComponentType<{ componentId: string }>;\n};\n\nexport function Overview({ titleBadges, overviewOptions, previewProps, getEmptyState, TaggedAPI }: OverviewProps) {\n const component = useContext(ComponentContext);\n const componentDescriptor = useComponentDescriptor();\n const { current } = useThemePicker();\n const overviewProps = flatten(overviewOptions.values())[0];\n const showHeader = !component.preview?.legacyHeader;\n const EmptyState = getEmptyState && getEmptyState();\n const buildFailed = component.buildStatus?.toLowerCase() !== 'succeed' && component?.host === 'teambit.scope/scope';\n const isScaling = Boolean(component.preview?.isScaling);\n const includesEnvTemplate = Boolean(component.preview?.includesEnvTemplate);\n const defaultLoadingState = React.useMemo(() => {\n return isScaling && !includesEnvTemplate;\n }, [isScaling, includesEnvTemplate]);\n\n const [isLoading, setLoading] = useState(defaultLoadingState);\n\n const iframeQueryParams = `onlyOverview=${component.preview?.onlyOverview || 'false'}&skipIncludes=${\n component.preview?.skipIncludes || component.preview?.onlyOverview\n }`;\n\n const overviewPropsValues = overviewProps && overviewProps();\n\n const themeParams = current?.themeName ? `theme=${current?.themeName}` : '';\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onLoad, style, ...rest } = previewProps || {};\n\n const onPreviewLoad = React.useCallback(\n (e, props) => {\n setLoading(false);\n onLoad?.(e, props);\n },\n [onLoad]\n );\n\n React.useEffect(() => {\n if (!isLoading && defaultLoadingState) setLoading(true);\n if (isLoading && !defaultLoadingState) setLoading(false);\n }, [component.id.toString(), defaultLoadingState]);\n\n return (\n <div\n className={classNames(styles.overviewWrapper, isLoading && styles.noOverflow)}\n key={`${component.id.toString()}`}\n >\n {showHeader && (\n <ComponentOverview\n className={classNames(styles.componentOverviewBlock, !isScaling && styles.legacyPreview)}\n displayName={component.displayName}\n version={component.version}\n abstract={component.description}\n labels={component.labels}\n packageName={component.packageName}\n titleBadges={flatten(titleBadges.values())}\n componentDescriptor={componentDescriptor}\n component={component}\n />\n )}\n {!buildFailed && (\n <div className={styles.readme}>\n {isLoading && (\n <ReadmeSkeleton>\n <CompositionGallerySkeleton compositionsLength={Math.min(component.compositions.length, 3)} />\n </ReadmeSkeleton>\n )}\n <ComponentPreview\n onLoad={onPreviewLoad}\n previewName=\"overview\"\n pubsub={true}\n queryParams={[iframeQueryParams, themeParams, overviewPropsValues?.queryParams || '']}\n viewport={null}\n fullContentHeight\n disableScroll={true}\n {...rest}\n component={component}\n style={{ width: '100%', height: '100%', minHeight: !isScaling ? 500 : undefined }}\n />\n {component.preview?.onlyOverview && !isLoading && <CompositionGallery component={component} />}\n {component.preview?.onlyOverview && !isLoading && TaggedAPI && (\n <TaggedAPI componentId={component.id.toString()} />\n )}\n </div>\n )}\n {buildFailed && EmptyState && <EmptyState />}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA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AM,EAAE,MAAM;MAAEC,SAAS,EAAE,CAACzD,SAAS,GAAG,GAAG,GAAG0D;IAAU;EAAE,EACnF,CAAC,EACD5E,SAAS,CAACW,OAAO,EAAEiB,YAAY,IAAI,CAACJ,SAAS,iBAAIhF,MAAA,GAAAiB,OAAA,CAAAkF,aAAA,CAACzF,mBAAA,GAAA2H,kBAAkB;IAAC7E,SAAS,EAAEA;EAAU,CAAE,CAAC,EAC7FA,SAAS,CAACW,OAAO,EAAEiB,YAAY,IAAI,CAACJ,SAAS,IAAIzB,SAAS,iBACzDvD,MAAA,GAAAiB,OAAA,CAAAkF,aAAA,CAAC5C,SAAS;IAAC+E,WAAW,EAAE9E,SAAS,CAACyC,EAAE,CAACC,QAAQ,CAAC;EAAE,CAAE,CAEjD,CACN,EACA5B,WAAW,IAAID,UAAU,iBAAIrE,MAAA,GAAAiB,OAAA,CAAAkF,aAAA,CAAC9B,UAAU,MAAE,CACxC,CAAC;AAEV","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.334/dist/docs.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.334/dist/docs.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/docs",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.334",
|
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.334"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"graphql-tag": "2.12.1",
|
@@ -19,21 +19,22 @@
|
|
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/
|
28
|
-
"@teambit/
|
29
|
-
"@teambit/
|
30
|
-
"@teambit/
|
31
|
-
"@teambit/
|
32
|
-
"@teambit/
|
33
|
-
"@teambit/
|
34
|
-
"@teambit/
|
35
|
-
"@teambit/
|
36
|
-
"@teambit/
|
22
|
+
"@teambit/compiler": "1.0.334",
|
23
|
+
"@teambit/component": "1.0.334",
|
24
|
+
"@teambit/pkg": "1.0.334",
|
25
|
+
"@teambit/workspace": "1.0.334",
|
26
|
+
"@teambit/cli": "0.0.911",
|
27
|
+
"@teambit/component.sources": "0.0.3",
|
28
|
+
"@teambit/dev-files": "1.0.334",
|
29
|
+
"@teambit/envs": "1.0.334",
|
30
|
+
"@teambit/graphql": "1.0.334",
|
31
|
+
"@teambit/logger": "0.0.1004",
|
32
|
+
"@teambit/preview": "1.0.334",
|
33
|
+
"@teambit/scope": "1.0.334",
|
34
|
+
"@teambit/api-reference": "1.0.334",
|
35
|
+
"@teambit/component-compare": "1.0.334",
|
36
|
+
"@teambit/ui": "1.0.334",
|
37
|
+
"@teambit/pubsub": "1.0.334",
|
37
38
|
"@teambit/compositions.panels.composition-gallery": "0.0.211",
|
38
39
|
"@teambit/preview.ui.component-preview": "1.0.12"
|
39
40
|
},
|