@teambit/docs 1.0.208 → 1.0.210
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.3779069d.css → docs-preview.b332800a.css} +5 -5
- package/artifacts/preview/teambit_docs_docs-preview.js +6 -6
- package/artifacts/schema.json +1 -1
- package/dist/default-doc-reader.js +1 -1
- package/dist/default-doc-reader.js.map +1 -1
- package/dist/docs.main.runtime.js +1 -1
- package/dist/docs.main.runtime.js.map +1 -1
- package/dist/docs.preview-definition.js +1 -1
- package/dist/docs.preview.runtime.js +1 -1
- package/dist/docs.preview.runtime.js.map +1 -1
- package/dist/docs.service.js +1 -1
- package/dist/docs.ui.runtime.js +1 -1
- package/dist/docs.ui.runtime.js.map +1 -1
- package/dist/events/click-inside-an-iframe.js +1 -1
- package/dist/events/click-inside-an-iframe.js.map +1 -1
- package/dist/overview/overview.js +1 -1
- package/dist/overview/overview.js.map +1 -1
- package/dist/overview.section.js +1 -1
- package/dist/overview.section.js.map +1 -1
- package/dist/{preview-1711458141302.js → preview-1711617900376.js} +2 -2
- package/package.json +15 -15
package/artifacts/schema.json
CHANGED
@@ -19,7 +19,7 @@ function _docsEntities() {
|
|
19
19
|
return data;
|
20
20
|
}
|
21
21
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
23
23
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
24
24
|
class DefaultDocReader {
|
25
25
|
constructor(pkg, compiler, workspace) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","data","require","_docsEntities","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_path","data","require","_docsEntities","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","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, 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,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,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AI,CAACP,GAAG,CAACQ,cAAc,CAACF,SAAS,CAAC;IACtD,MAAMG,QAAQ,GAAG,IAAI,CAACR,QAAQ,CAACS,oBAAoB,CAACJ,SAAS,EAAEF,IAAI,CAAC;IACpE;IACA,MAAMO,UAAU,GAAGpC,OAAO,CAAC,IAAAqC,eAAO,EAAE,GAAE,IAAI,CAACV,SAAS,CAACE,IAAK,iBAAgBG,WAAY,IAAGE,QAAS,EAAC,CAAC,CAAC;IACrG,OAAOI,mBAAG,CAACC,IAAI,CAACV,IAAI,EAAE;MACpBW,MAAM,EAAEJ,UAAU,CAACI,MAAM,IAAIJ,UAAU,CAACK,OAAO,EAAED,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":[]}
|
@@ -138,7 +138,7 @@ function _exceptions() {
|
|
138
138
|
return data;
|
139
139
|
}
|
140
140
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
141
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
141
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
142
142
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
143
143
|
/**
|
144
144
|
* the component documentation extension.
|
@@ -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","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","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;IAA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U,CAAC9B,SAAS,CAAC;MAE5C,OAAO;QACLmC,GAAG,EAAEA,GAAG,EAAEsC,QAAQ,CAAC;QACnB;MACF,CAAC;IACH,CAAC;IAED,IAAInF,SAAS,EAAE;MACbA,SAAS,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;AAAArB,eAAA,CA1LYqB,QAAQ,WAiHJ,CAACgG,eAAI,CAACC,QAAQ,CAAU,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAY,CAAC,CAAC;AAAAtH,eAAA,CAjH1DqB,QAAQ,aAmHFkG,kBAAW;AAAAvH,eAAA,CAnHjBqB,QAAQ,kBAoHG,CACpBmG,wBAAa,EACbC,wBAAa,EACbC,4BAAe,EACfC,gBAAS,EACTC,0BAAc,EACdC,sBAAY,EACZC,0BAAc,EACdC,kBAAU,EACVC,oBAAW,CACZ;AAAAhI,eAAA,CA9HUqB,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","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","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;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CAAC,KAAIC,8BAAqB,EAACX,IAAI,CAAC,CAAC;IAC3D,OAAOA,IAAI;EACb;AACF;AAACY,OAAA,CAAA/F,QAAA,GAAAA,QAAA;AAAArB,eAAA,CA1LYqB,QAAQ,WAiHJ,CAACgG,eAAI,CAACC,QAAQ,CAAU,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAY,CAAC,CAAC;AAAAtH,eAAA,CAjH1DqB,QAAQ,aAmHFkG,kBAAW;AAAAvH,eAAA,CAnHjBqB,QAAQ,kBAoHG,CACpBmG,wBAAa,EACbC,wBAAa,EACbC,4BAAe,EACfC,gBAAS,EACTC,0BAAc,EACdC,sBAAY,EACZC,0BAAc,EACdC,kBAAU,EACVC,oBAAW,CACZ;AAAAhI,eAAA,CA9HUqB,QAAQ,mBAgII;EACrBE,QAAQ,EAAE,CAAC,aAAa;AAC1B,CAAC;AA0DHmB,kBAAU,CAACuF,UAAU,CAAC5G,QAAQ,CAAC","ignoreList":[]}
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.DocsPreviewDefinition = void 0;
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
9
9
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
10
10
|
class DocsPreviewDefinition {
|
11
11
|
constructor(
|
@@ -27,7 +27,7 @@ function _docs() {
|
|
27
27
|
}
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
29
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
30
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
30
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
31
31
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
32
32
|
class DocsPreview {
|
33
33
|
constructor(
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_preview","_docs","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_preview","_docs","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","DocsPreview","constructor","preview","componentId","envId","modules","compositions","context","docsModule","selectPreviewModel","fullName","mainModule","modulesMap","defaultExports","isObject","apiObject","docsPropsArray","NoopProvider","toString","docsProps","Provider","docs","relevant","componentMap","undefined","provider","docsPreview","registerPreview","name","render","bind","include","exports","PreviewRuntime","PreviewAspect","DocsAspect","addRuntime","children","createElement","Fragment"],"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';\nimport type { Docs } from './docs';\n\nexport type DocsRootProps = {\n Provider: React.ComponentType | undefined;\n componentId: string;\n docs: Docs | undefined;\n compositions: any;\n context: RenderingContext;\n};\n\nexport class DocsPreview {\n constructor(\n /**\n * preview extension.\n */\n private preview: PreviewPreview\n ) {}\n\n render = (\n componentId: ComponentID,\n envId: string,\n modules: PreviewModule,\n [compositions]: [any],\n context: RenderingContext\n ) => {\n const docsModule = this.selectPreviewModel(componentId.fullName, modules);\n\n const mainModule = modules.modulesMap[envId] || modules.modulesMap.default;\n let defaultExports = mainModule.default;\n // Sometime when using ESM (package.json with type:\"module\") the default export is nested under \"default\"\n if (typeof defaultExports !== 'function' && defaultExports.default) {\n defaultExports = defaultExports.default;\n }\n // @ts-ignore Gilad - to fix.\n const isObject = !!defaultExports.apiObject;\n\n /**\n * for backwards compatibility - can be removed end of 2022\n */\n if (!isObject) {\n const docsPropsArray = [\n NoopProvider as React.ComponentType,\n componentId.toString(),\n docsModule as Docs,\n compositions,\n context,\n ];\n // @ts-ignore Gilad - to fix. it happens because defaultExports might be a func or an object (handled above)\n defaultExports(...docsPropsArray);\n return;\n }\n\n const docsProps: DocsRootProps = {\n Provider: NoopProvider as React.ComponentType,\n componentId: componentId.toString(),\n docs: docsModule as Docs,\n compositions,\n context,\n };\n // @ts-ignore Gilad - to fix. it happens because defaultExports might be a func or an object (handled above)\n defaultExports(docsProps);\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 }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AC;IAClD,IAAI,CAACmB,QAAQ,EAAE,OAAOE,SAAS;;IAE/B;IACA,OAAOF,QAAQ,CAAC,CAAC,CAAC;EACpB;EAKA,aAAaG,QAAQA,CAAC,CAACvB,OAAO,CAAmB,EAAE;IACjD,MAAMwB,WAAW,GAAG,IAAI1B,WAAW,CAACE,OAAO,CAAC;IAC5CA,OAAO,CAACyB,eAAe,CAAC;MACtBC,IAAI,EAAE,UAAU;MAChBC,MAAM,EAAEH,WAAW,CAACG,MAAM,CAACC,IAAI,CAACJ,WAAW,CAAC;MAC5CjB,kBAAkB,EAAEiB,WAAW,CAACjB,kBAAkB,CAACqB,IAAI,CAACJ,WAAW,CAAC;MACpEK,OAAO,EAAE,CAAC,cAAc;IAC1B,CAAC,CAAC;IAEF,OAAOL,WAAW;EACpB;AACF;AAACM,OAAA,CAAAhC,WAAA,GAAAA,WAAA;AAAApB,eAAA,CA3EYoB,WAAW,aA6DLiC,yBAAc;AAAArD,eAAA,CA7DpBoB,WAAW,kBA8DA,CAACkC,wBAAa,CAAC;AAevCC,kBAAU,CAACC,UAAU,CAACpC,WAAW,CAAC;AAElC,SAASiB,YAAYA,CAAC;EAAEoB;AAAkC,CAAC,EAAE;EAC3D,oBAAOlE,MAAA,GAAAQ,OAAA,CAAA2D,aAAA,CAAAnE,MAAA,GAAAQ,OAAA,CAAA4D,QAAA,QAAGF,QAAW,CAAC;AACxB","ignoreList":[]}
|
package/dist/docs.service.js
CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.DocsService = void 0;
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
9
9
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
10
10
|
class DocsService {
|
11
11
|
constructor() {
|
package/dist/docs.ui.runtime.js
CHANGED
@@ -83,7 +83,7 @@ function _overview() {
|
|
83
83
|
}
|
84
84
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
85
85
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
86
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
86
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
87
87
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
88
88
|
class DocsUI {
|
89
89
|
constructor(titleBadgeSlot, overviewOptionsSlot) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_lodash","_component","_harmony","_ui","_componentCompare","_docsUi","_docsUi2","_apiReference","_docs","_overview","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_lodash","_component","_harmony","_ui","_componentCompare","_docsUi","_docsUi2","_apiReference","_docs","_overview","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","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, readonly overviewOptionsSlot: OverviewOptionsSlot) {}\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,YA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AAChD,MAAM,CAAC","ignoreList":[]}
|
@@ -12,7 +12,7 @@ function _pubsub() {
|
|
12
12
|
return data;
|
13
13
|
}
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
16
16
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable max-classes-per-file */
|
17
17
|
class ClickInsideAnIframeEventData {
|
18
18
|
constructor(clickEvent) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","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(), readonly clickEvent) {\n super(ClickInsideAnIframeEvent.TYPE, '0.0.1',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AU,CAAC,CAAC;IAAC,KADpFG,SAAS,GAATA,SAAS;IAAA,KAAwBH,UAAU,GAAVA,UAAU;EAEhE;AACF;AAACO,OAAA,CAAAN,wBAAA,GAAAA,wBAAA;AAAAxB,eAAA,CANYwB,wBAAwB,UACZ,wBAAwB","ignoreList":[]}
|
@@ -80,7 +80,7 @@ const _excluded = ["onLoad", "style"]; // import { Icon } from '@teambit/design.
|
|
80
80
|
// import { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';
|
81
81
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
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
|
-
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 &&
|
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() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
85
85
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
86
86
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_lodash","_component","_previewUi","_componentUi","_compositionsPanels","_baseReactThemes","_readmeSkeleton","_overviewModule","_excluded","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","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","styles","overviewWrapper","ComponentOverview","classNames","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 className={styles.overviewWrapper} key={`${component.id.toString()}`}>\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,IAAA;AAAA;AAEA,SAAAQ,aAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,YAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,oBAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,mBAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAU,iBAAA;EAAA,MAAAV,IAAA,GAAAE,OAAA;EAAAQ,gBAAA,YAAAA,CAAA;IAAA,OAAAV,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAW,gBAAA;EAAA,MAAAX,IAA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1C,MAAA,GAAAiB,OAAA,CAAAyF,aAAA,CAAClG,UAAA,GAAAuH,gBAAgB,EAAA1F,QAAA;IACf4D,MAAM,EAAEG,aAAc;IACtB4B,WAAW,EAAC,UAAU;IACtBC,MAAM,EAAE,IAAK;IACbC,WAAW,EAAE,CAACxC,iBAAiB,EAAEI,WAAW,EAAED,mBAAmB,EAAEqC,WAAW,IAAI,EAAE,CAAE;IACtFC,QAAQ,EAAE,IAAK;IACfC,iBAAiB;IACjBC,aAAa,EAAE;EAAK,GAChBlC,IAAI;IACRpC,SAAS,EAAEA,SAAU;IACrBmC,KAAK,EAAE;MAAEoC,KAAK,EAAE,MAAM;MAAEC,MAAM,EAAE,MAAM;MAAEC,SAAS,EAAE,CAACvD,SAAS,GAAG,GAAG,GAAGwD;IAAU;EAAE,EACnF,CAAC,EACD1E,SAAS,CAACW,OAAO,EAAEiB,YAAY,IAAI,CAACJ,SAAS,iBAAIvF,MAAA,GAAAiB,OAAA,CAAAyF,aAAA,CAAChG,mBAAA,GAAAgI,kBAAkB;IAAC3E,SAAS,EAAEA;EAAU,CAAE,CAAC,EAC7FA,SAAS,CAACW,OAAO,EAAEiB,YAAY,IAAI,CAACJ,SAAS,IAAIzB,SAAS,iBACzD9D,MAAA,GAAAiB,OAAA,CAAAyF,aAAA,CAAC5C,SAAS;IAAC6E,WAAW,EAAE5E,SAAS,CAACyC,EAAE,CAACC,QAAQ,CAAC;EAAE,CAAE,CAEjD,CACN,EACA5B,WAAW,IAAID,UAAU,iBAAI5E,MAAA,GAAAiB,OAAA,CAAAyF,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","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","prototype","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","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","styles","overviewWrapper","ComponentOverview","classNames","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 className={styles.overviewWrapper} key={`${component.id.toString()}`}>\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,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I,kBAAkB;IAAC3E,SAAS,EAAEA;EAAU,CAAE,CAAC,EAC7FA,SAAS,CAACW,OAAO,EAAEiB,YAAY,IAAI,CAACJ,SAAS,IAAIzB,SAAS,iBACzD9D,MAAA,GAAAiB,OAAA,CAAAyF,aAAA,CAAC5C,SAAS;IAAC6E,WAAW,EAAE5E,SAAS,CAACyC,EAAE,CAACC,QAAQ,CAAC;EAAE,CAAE,CAEjD,CACN,EACA5B,WAAW,IAAID,UAAU,iBAAI5E,MAAA,GAAAiB,OAAA,CAAAyF,aAAA,CAAC9B,UAAU,MAAE,CACxC,CAAC;AAEV","ignoreList":[]}
|
package/dist/overview.section.js
CHANGED
@@ -20,7 +20,7 @@ function _overview() {
|
|
20
20
|
}
|
21
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
22
22
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
23
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
24
24
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
25
25
|
class OverviewSection {
|
26
26
|
constructor(
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_overview","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_overview","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","OverviewSection","constructor","titleBadgeSlot","overviewOptionsSlot","docs","apiRef","href","exact","children","index","element","createElement","Overview","titleBadges","overviewOptions","getEmptyState","bind","TaggedAPI","TaggedAPIPage","exports"],"sources":["overview.section.tsx"],"sourcesContent":["import React from 'react';\nimport { Section } from '@teambit/component';\nimport { APIReferenceUI } from '@teambit/api-reference';\nimport { Overview, TitleBadgeSlot, OverviewOptionsSlot } from './overview';\nimport { DocsUI } from './docs.ui.runtime';\n\nexport class OverviewSection implements Section {\n constructor(\n /**\n * title badge slot.\n */\n private titleBadgeSlot: TitleBadgeSlot,\n private overviewOptionsSlot: OverviewOptionsSlot,\n private docs: DocsUI,\n private apiRef: APIReferenceUI\n ) {}\n\n navigationLink = {\n href: '.',\n exact: true,\n children: 'Overview',\n };\n\n route = {\n index: true,\n element: (\n <Overview\n titleBadges={this.titleBadgeSlot}\n overviewOptions={this.overviewOptionsSlot}\n getEmptyState={this.docs.getEmptyState.bind(this.docs)}\n TaggedAPI={this.apiRef.TaggedAPIPage}\n />\n ),\n };\n\n order = 10;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2E,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MA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Z,IAAI,CAAE;QACvDa,SAAS,EAAE,IAAI,CAACZ,MAAM,CAACa;MAAc,CACtC;IAEL,CAAC;IAAAtC,eAAA,gBAEO,EAAE;EApBP;AAqBL;AAACuC,OAAA,CAAAnB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@1.0.210/dist/docs.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.docs_docs@1.0.210/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.210",
|
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.210"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"graphql-tag": "2.12.1",
|
@@ -19,21 +19,21 @@
|
|
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.
|
22
|
+
"@teambit/compiler": "1.0.210",
|
23
|
+
"@teambit/component": "1.0.210",
|
24
|
+
"@teambit/pkg": "1.0.210",
|
25
|
+
"@teambit/workspace": "1.0.210",
|
26
26
|
"@teambit/cli": "0.0.858",
|
27
|
-
"@teambit/dev-files": "1.0.
|
28
|
-
"@teambit/envs": "1.0.
|
29
|
-
"@teambit/graphql": "1.0.
|
27
|
+
"@teambit/dev-files": "1.0.210",
|
28
|
+
"@teambit/envs": "1.0.210",
|
29
|
+
"@teambit/graphql": "1.0.210",
|
30
30
|
"@teambit/logger": "0.0.951",
|
31
|
-
"@teambit/preview": "1.0.
|
32
|
-
"@teambit/scope": "1.0.
|
33
|
-
"@teambit/api-reference": "1.0.
|
34
|
-
"@teambit/component-compare": "1.0.
|
35
|
-
"@teambit/ui": "1.0.
|
36
|
-
"@teambit/pubsub": "1.0.
|
31
|
+
"@teambit/preview": "1.0.210",
|
32
|
+
"@teambit/scope": "1.0.210",
|
33
|
+
"@teambit/api-reference": "1.0.210",
|
34
|
+
"@teambit/component-compare": "1.0.210",
|
35
|
+
"@teambit/ui": "1.0.210",
|
36
|
+
"@teambit/pubsub": "1.0.210",
|
37
37
|
"@teambit/compositions.panels.composition-gallery": "0.0.211",
|
38
38
|
"@teambit/preview.ui.component-preview": "1.0.5"
|
39
39
|
},
|