@teambit/code 1.0.186 → 1.0.188

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.component/code@1.0.186" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.component/code@1.0.188" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.component/code-preview"]=t():e["teambit.component/code-preview"]=t()}(self,(()=>(()=>{"use strict";var e={51985:(e,t,o)=>{var n={id:"teambit.component/code@1.0.186",homepage:"https://bit.cloud/teambit/component/code",exported:!0};function r(){const e=i(o(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,i.__bit_component=n;const c=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/code.svg"}));c.__bit_component=n,t.Logo=c},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{compositions:()=>u,compositions_metadata:()=>l,overview:()=>f});var e={};o.r(e),o.d(e,{default:()=>d});var t=o(51985);o(41594);const r=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var c=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},p.apply(this,arguments)}var a={},s="wrapper";function d(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,c);return(0,r.mdx)(s,p({},a,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const u=[t],f=[e],l={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.component/code-preview"]=t():e["teambit.component/code-preview"]=t()}(self,(()=>(()=>{"use strict";var e={59747:(e,t,o)=>{var n={id:"teambit.component/code@1.0.188",homepage:"https://bit.cloud/teambit/component/code",exported:!0};function r(){const e=i(o(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,i.__bit_component=n;const c=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/code.svg"}));c.__bit_component=n,t.Logo=c},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{compositions:()=>u,compositions_metadata:()=>l,overview:()=>f});var e={};o.r(e),o.d(e,{default:()=>d});var t=o(59747);o(41594);const r=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var c=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},p.apply(this,arguments)}var a={},s="wrapper";function d(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,c);return(0,r.mdx)(s,p({},a,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const u=[t],f=[e],l={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ComponentAspect, ComponentUI } from '@teambit/component';
3
3
  import { UIRuntime } from '@teambit/ui';
4
- import { CodeCompare, CodeCompareEditorProvider, CodeCompareProps } from '@teambit/code.ui.code-compare';
4
+ import { CodeCompare, CodeCompareEditorProvider, type CodeCompareProps } from '@teambit/code.ui.code-compare';
5
5
  import { Harmony, SlotRegistry, Slot } from '@teambit/harmony';
6
6
  import type { FileIconMatch } from '@teambit/code.ui.utils.get-file-icon';
7
7
  import { staticStorageUrl } from '@teambit/base-ui.constants.storage';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ComponentUI } from '@teambit/component';
3
- import { CodeCompareProps } from '@teambit/code.ui.code-compare';
3
+ import { type CodeCompareProps } from '@teambit/code.ui.code-compare';
4
4
  import { Harmony, SlotRegistry } from '@teambit/harmony';
5
5
  import type { FileIconMatch } from '@teambit/code.ui.utils.get-file-icon';
6
6
  import { CodePageProps } from '@teambit/code.ui.code-tab-page';
@@ -1 +1 @@
1
- {"version":3,"names":["_react","data","_interopRequireDefault","require","_component","_ui","_codeUi","_harmony","_baseUiConstants","_codeUi2","_componentCompare","_codeUi3","_codeUi4","_code","_code2","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","t","_toPrimitive","String","r","e","Symbol","toPrimitive","TypeError","Number","isTsx","CodeUI","constructor","host","fileIconSlot","props","createElement","CodePage","CodeCompareEditorProvider","CodeCompare","CodeEditorProvider","registerEnvFileIcon","icons","register","provider","component","componentCompare","_","harmony","config","get","ui","section","CodeSection","fileName","test","staticStorageUrl","undefined","registerRoute","route","registerWidget","navigationLink","order","codeCompare","CodeCompareSection","registerNavigation","registerRoutes","exports","ComponentAspect","ComponentCompareAspect","UIRuntime","Slot","withType","CodeAspect","addRuntime"],"sources":["code.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { ComponentAspect, ComponentUI } from '@teambit/component';\nimport { UIRuntime } from '@teambit/ui';\nimport { CodeCompare, CodeCompareEditorProvider, CodeCompareProps } from '@teambit/code.ui.code-compare';\nimport { Harmony, SlotRegistry, Slot } from '@teambit/harmony';\nimport type { FileIconMatch } from '@teambit/code.ui.utils.get-file-icon';\nimport { staticStorageUrl } from '@teambit/base-ui.constants.storage';\nimport { CodePage, CodePageProps } from '@teambit/code.ui.code-tab-page';\nimport { ComponentCompareUI, ComponentCompareAspect } from '@teambit/component-compare';\nimport { CodeEditorProvider } from '@teambit/code.ui.code-editor';\nimport { CodeCompareSection } from '@teambit/code.ui.code-compare-section';\nimport { CodeAspect } from './code.aspect';\nimport { CodeSection } from './code.section';\n\nconst isTsx = /\\.tsx$/;\n\nexport type FileIconSlot = SlotRegistry<FileIconMatch[]>;\n\n/**\n * Component code tab aspect. Presents the code tab page and allows to control the code tab and register specific icons for each file type.\n * @example CodeUI.registerEnvFileIcon([(fileName) => (/your-regexp/.test(fileName) ? 'your.icon.url' : undefined)])\n */\nexport class CodeUI {\n constructor(\n /**\n * register an icon for a specific file type. pass icon and a match method/regexp\n */\n private host: string,\n private fileIconSlot?: FileIconSlot\n ) {}\n\n getCodePage = (props?: Partial<CodePageProps>) => {\n return <CodePage {...(props || {})} fileIconSlot={this.fileIconSlot} host={this.host} />;\n };\n\n getCodeCompare = (props?: Partial<CodeCompareProps>) => {\n return (\n <CodeCompareEditorProvider>\n <CodeCompare {...(props || {})} fileIconSlot={this.fileIconSlot} />\n </CodeCompareEditorProvider>\n );\n };\n\n getCodeEditorProvider = () => CodeEditorProvider;\n getCodeDiffEditorProvider = () => CodeCompareEditorProvider;\n\n registerEnvFileIcon(icons: FileIconMatch[]) {\n this.fileIconSlot?.register(icons);\n return this;\n }\n\n static dependencies = [ComponentAspect, ComponentCompareAspect];\n\n static runtime = UIRuntime;\n\n static slots = [Slot.withType<string>()];\n\n static async provider(\n [component, componentCompare]: [ComponentUI, ComponentCompareUI],\n _,\n [fileIconSlot]: [FileIconSlot],\n harmony: Harmony\n ) {\n const { config } = harmony;\n const host = String(config.get('teambit.harmony/bit'));\n const ui = new CodeUI(host, fileIconSlot);\n const section = new CodeSection(ui);\n\n // overrides the default tsx react icon with the typescript icon\n ui.registerEnvFileIcon([\n (fileName) => (isTsx.test(fileName) ? `${staticStorageUrl}/file-icons/file_type_typescript.svg` : undefined),\n ]);\n component.registerRoute([section.route]);\n component.registerWidget(section.navigationLink, section.order);\n const codeCompare = new CodeCompareSection(ui);\n componentCompare.registerNavigation(codeCompare);\n componentCompare.registerRoutes([codeCompare.route]);\n return ui;\n }\n}\n\nCodeAspect.addRuntime(CodeUI);\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,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,IAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,GAAA,YAAAA,CAAA;IAAA,OAAAJ,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;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,iBAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,gBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,kBAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,iBAAA,YAAAA,CAAA;IAAA,OAAAT,IAA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E;EACX;AACF;AAACgB,OAAA,CAAApC,MAAA,GAAAA,MAAA;AAAAjB,eAAA,CAzDYiB,MAAM,kBA6BK,CAACqC,4BAAe,EAAEC,0CAAsB,CAAC;AAAAvD,eAAA,CA7BpDiB,MAAM,aA+BAuC,eAAS;AAAAxD,eAAA,CA/BfiB,MAAM,WAiCF,CAACwC,eAAI,CAACC,QAAQ,CAAS,CAAC,CAAC;AA0B1CC,kBAAU,CAACC,UAAU,CAAC3C,MAAM,CAAC"}
1
+ {"version":3,"names":["_react","data","_interopRequireDefault","require","_component","_ui","_codeUi","_harmony","_baseUiConstants","_codeUi2","_componentCompare","_codeUi3","_codeUi4","_code","_code2","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","t","_toPrimitive","String","r","e","Symbol","toPrimitive","TypeError","Number","isTsx","CodeUI","constructor","host","fileIconSlot","props","createElement","CodePage","CodeCompareEditorProvider","CodeCompare","CodeEditorProvider","registerEnvFileIcon","icons","register","provider","component","componentCompare","_","harmony","config","get","ui","section","CodeSection","fileName","test","staticStorageUrl","undefined","registerRoute","route","registerWidget","navigationLink","order","codeCompare","CodeCompareSection","registerNavigation","registerRoutes","exports","ComponentAspect","ComponentCompareAspect","UIRuntime","Slot","withType","CodeAspect","addRuntime"],"sources":["code.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { ComponentAspect, ComponentUI } from '@teambit/component';\nimport { UIRuntime } from '@teambit/ui';\nimport { CodeCompare, CodeCompareEditorProvider, type CodeCompareProps } from '@teambit/code.ui.code-compare';\nimport { Harmony, SlotRegistry, Slot } from '@teambit/harmony';\nimport type { FileIconMatch } from '@teambit/code.ui.utils.get-file-icon';\nimport { staticStorageUrl } from '@teambit/base-ui.constants.storage';\nimport { CodePage, CodePageProps } from '@teambit/code.ui.code-tab-page';\nimport { ComponentCompareUI, ComponentCompareAspect } from '@teambit/component-compare';\nimport { CodeEditorProvider } from '@teambit/code.ui.code-editor';\nimport { CodeCompareSection } from '@teambit/code.ui.code-compare-section';\nimport { CodeAspect } from './code.aspect';\nimport { CodeSection } from './code.section';\n\nconst isTsx = /\\.tsx$/;\n\nexport type FileIconSlot = SlotRegistry<FileIconMatch[]>;\n\n/**\n * Component code tab aspect. Presents the code tab page and allows to control the code tab and register specific icons for each file type.\n * @example CodeUI.registerEnvFileIcon([(fileName) => (/your-regexp/.test(fileName) ? 'your.icon.url' : undefined)])\n */\nexport class CodeUI {\n constructor(\n /**\n * register an icon for a specific file type. pass icon and a match method/regexp\n */\n private host: string,\n private fileIconSlot?: FileIconSlot\n ) {}\n\n getCodePage = (props?: Partial<CodePageProps>) => {\n return <CodePage {...(props || {})} fileIconSlot={this.fileIconSlot} host={this.host} />;\n };\n\n getCodeCompare = (props?: Partial<CodeCompareProps>) => {\n return (\n <CodeCompareEditorProvider>\n <CodeCompare {...(props || {})} fileIconSlot={this.fileIconSlot} />\n </CodeCompareEditorProvider>\n );\n };\n\n getCodeEditorProvider = () => CodeEditorProvider;\n getCodeDiffEditorProvider = () => CodeCompareEditorProvider;\n\n registerEnvFileIcon(icons: FileIconMatch[]) {\n this.fileIconSlot?.register(icons);\n return this;\n }\n\n static dependencies = [ComponentAspect, ComponentCompareAspect];\n\n static runtime = UIRuntime;\n\n static slots = [Slot.withType<string>()];\n\n static async provider(\n [component, componentCompare]: [ComponentUI, ComponentCompareUI],\n _,\n [fileIconSlot]: [FileIconSlot],\n harmony: Harmony\n ) {\n const { config } = harmony;\n const host = String(config.get('teambit.harmony/bit'));\n const ui = new CodeUI(host, fileIconSlot);\n const section = new CodeSection(ui);\n\n // overrides the default tsx react icon with the typescript icon\n ui.registerEnvFileIcon([\n (fileName) => (isTsx.test(fileName) ? `${staticStorageUrl}/file-icons/file_type_typescript.svg` : undefined),\n ]);\n component.registerRoute([section.route]);\n component.registerWidget(section.navigationLink, section.order);\n const codeCompare = new CodeCompareSection(ui);\n componentCompare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AAsB,CAAC;AAAAvD,eAAA,CA7BpDiB,MAAM,aA+BAuC,eAAS;AAAAxD,eAAA,CA/BfiB,MAAM,WAiCF,CAACwC,eAAI,CAACC,QAAQ,CAAS,CAAC,CAAC;AA0B1CC,kBAAU,CAACC,UAAU,CAAC3C,MAAM,CAAC"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_code@1.0.186/dist/code.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_code@1.0.186/dist/code.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_code@1.0.188/dist/code.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_code@1.0.188/dist/code.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/code",
3
- "version": "1.0.186",
3
+ "version": "1.0.188",
4
4
  "homepage": "https://bit.cloud/teambit/component/code",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "code",
9
- "version": "1.0.186"
9
+ "version": "1.0.188"
10
10
  },
11
11
  "dependencies": {
12
12
  "@teambit/harmony": "0.4.6",
@@ -15,11 +15,11 @@
15
15
  "@teambit/code.ui.code-compare-section": "0.0.5",
16
16
  "@teambit/code.ui.code-editor": "0.0.8",
17
17
  "@teambit/code.ui.utils.get-file-icon": "0.0.495",
18
- "@teambit/component": "1.0.186",
18
+ "@teambit/component": "1.0.188",
19
19
  "@teambit/code.ui.code-compare": "0.0.291",
20
- "@teambit/code.ui.code-tab-page": "0.0.638",
21
- "@teambit/component-compare": "1.0.186",
22
- "@teambit/ui": "1.0.186"
20
+ "@teambit/code.ui.code-tab-page": "0.0.639",
21
+ "@teambit/component-compare": "1.0.188",
22
+ "@teambit/ui": "1.0.188"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/mocha": "9.1.0",
@@ -1,1098 +0,0 @@
1
- {
2
- "__schema": "APISchema",
3
- "location": {
4
- "filePath": "index.ts",
5
- "line": 1,
6
- "character": 1
7
- },
8
- "module": {
9
- "__schema": "ModuleSchema",
10
- "location": {
11
- "filePath": "index.ts",
12
- "line": 1,
13
- "character": 1
14
- },
15
- "exports": [
16
- {
17
- "__schema": "ClassSchema",
18
- "location": {
19
- "filePath": "code.ui.runtime.tsx",
20
- "line": 23,
21
- "character": 1
22
- },
23
- "doc": {
24
- "__schema": "DocSchema",
25
- "location": {
26
- "filePath": "code.ui.runtime.tsx",
27
- "line": 19,
28
- "character": 1
29
- },
30
- "raw": "/**\n * Component code tab aspect. Presents the code tab page and allows to control the code tab and register specific icons for each file type.\n * @example CodeUI.registerEnvFileIcon([(fileName) => (/your-regexp/.test(fileName) ? 'your.icon.url' : undefined)])\n */",
31
- "comment": "Component code tab aspect. Presents the code tab page and allows to control the code tab and register specific icons for each file type.",
32
- "tags": [
33
- {
34
- "__schema": "TagSchema",
35
- "location": {
36
- "filePath": "code.ui.runtime.tsx",
37
- "line": 21,
38
- "character": 5
39
- },
40
- "tagName": "example",
41
- "comment": "CodeUI.registerEnvFileIcon([\n (fileName) => (/your-regexp/.test(fileName) ? 'your.icon.url' : undefined),\n]);\n"
42
- }
43
- ]
44
- },
45
- "signature": "class CodeUI",
46
- "name": "CodeUI",
47
- "members": [
48
- {
49
- "__schema": "ConstructorSchema",
50
- "location": {
51
- "filePath": "code.ui.runtime.tsx",
52
- "line": 24,
53
- "character": 3
54
- },
55
- "signature": "constructor CodeUI(host: string, fileIconSlot?: FileIconSlot): CodeUI",
56
- "name": "constructor",
57
- "params": [
58
- {
59
- "__schema": "ParameterSchema",
60
- "location": {
61
- "filePath": "code.ui.runtime.tsx",
62
- "line": 28,
63
- "character": 5
64
- },
65
- "name": "host",
66
- "type": {
67
- "__schema": "KeywordTypeSchema",
68
- "location": {
69
- "filePath": "code.ui.runtime.tsx",
70
- "line": 28,
71
- "character": 19
72
- },
73
- "name": "string"
74
- },
75
- "isOptional": false,
76
- "isSpread": false
77
- },
78
- {
79
- "__schema": "ParameterSchema",
80
- "location": {
81
- "filePath": "code.ui.runtime.tsx",
82
- "line": 29,
83
- "character": 5
84
- },
85
- "name": "fileIconSlot",
86
- "type": {
87
- "__schema": "TypeRefSchema",
88
- "location": {
89
- "filePath": "code.ui.runtime.tsx",
90
- "line": 29,
91
- "character": 28
92
- },
93
- "name": "FileIconSlot"
94
- },
95
- "isOptional": true,
96
- "isSpread": false
97
- }
98
- ],
99
- "returnType": {
100
- "__schema": "ThisTypeSchema",
101
- "location": {
102
- "filePath": "code.ui.runtime.tsx",
103
- "line": 23,
104
- "character": 1
105
- },
106
- "name": "CodeUI"
107
- },
108
- "modifiers": []
109
- },
110
- {
111
- "__schema": "VariableLikeSchema",
112
- "location": {
113
- "filePath": "code.ui.runtime.tsx",
114
- "line": 32,
115
- "character": 3
116
- },
117
- "signature": "(property) CodeUI.getCodePage: (props?: Partial<CodePageProps>) => React.JSX.Element",
118
- "name": "getCodePage",
119
- "type": {
120
- "__schema": "InferenceTypeSchema",
121
- "location": {
122
- "filePath": "code.ui.runtime.tsx",
123
- "line": 32,
124
- "character": 3
125
- },
126
- "type": "(props?: Partial<CodePageProps>) => React.JSX.Element"
127
- },
128
- "isOptional": true,
129
- "defaultValue": "(props?: Partial<CodePageProps>) => {\n return <CodePage {...(props || {})} fileIconSlot={this.fileIconSlot} host={this.host} />;\n }"
130
- },
131
- {
132
- "__schema": "VariableLikeSchema",
133
- "location": {
134
- "filePath": "code.ui.runtime.tsx",
135
- "line": 36,
136
- "character": 3
137
- },
138
- "signature": "(property) CodeUI.getCodeCompare: (props?: Partial<CodeCompareProps>) => React.JSX.Element",
139
- "name": "getCodeCompare",
140
- "type": {
141
- "__schema": "InferenceTypeSchema",
142
- "location": {
143
- "filePath": "code.ui.runtime.tsx",
144
- "line": 36,
145
- "character": 3
146
- },
147
- "type": "(props?: Partial<CodeCompareProps>) => React.JSX.Element"
148
- },
149
- "isOptional": true,
150
- "defaultValue": "(props?: Partial<CodeCompareProps>) => {\n return (\n <CodeCompareEditorProvider>\n <CodeCompare {...(props || {})} fileIconSlot={this.fileIconSlot} />\n </CodeCompareEditorProvider>\n );\n }"
151
- },
152
- {
153
- "__schema": "VariableLikeSchema",
154
- "location": {
155
- "filePath": "code.ui.runtime.tsx",
156
- "line": 44,
157
- "character": 3
158
- },
159
- "signature": "(property) CodeUI.getCodeEditorProvider: () => React.FC<CodeEditorProviderProps>",
160
- "name": "getCodeEditorProvider",
161
- "type": {
162
- "__schema": "InferenceTypeSchema",
163
- "location": {
164
- "filePath": "code.ui.runtime.tsx",
165
- "line": 44,
166
- "character": 3
167
- },
168
- "type": "() => React.FC<CodeEditorProviderProps>"
169
- },
170
- "isOptional": true,
171
- "defaultValue": "() => CodeEditorProvider"
172
- },
173
- {
174
- "__schema": "VariableLikeSchema",
175
- "location": {
176
- "filePath": "code.ui.runtime.tsx",
177
- "line": 45,
178
- "character": 3
179
- },
180
- "signature": "(property) CodeUI.getCodeDiffEditorProvider: () => React.FC<CodeCompareEditorProviderProps>",
181
- "name": "getCodeDiffEditorProvider",
182
- "type": {
183
- "__schema": "InferenceTypeSchema",
184
- "location": {
185
- "filePath": "code.ui.runtime.tsx",
186
- "line": 45,
187
- "character": 3
188
- },
189
- "type": "() => React.FC<CodeCompareEditorProviderProps>"
190
- },
191
- "isOptional": true,
192
- "defaultValue": "() => CodeCompareEditorProvider"
193
- },
194
- {
195
- "__schema": "FunctionLikeSchema",
196
- "location": {
197
- "filePath": "code.ui.runtime.tsx",
198
- "line": 47,
199
- "character": 3
200
- },
201
- "signature": "(method) CodeUI.registerEnvFileIcon(icons: FileIconMatch[]): this",
202
- "name": "registerEnvFileIcon",
203
- "params": [
204
- {
205
- "__schema": "ParameterSchema",
206
- "location": {
207
- "filePath": "code.ui.runtime.tsx",
208
- "line": 47,
209
- "character": 23
210
- },
211
- "name": "icons",
212
- "type": {
213
- "__schema": "TypeArraySchema",
214
- "location": {
215
- "filePath": "code.ui.runtime.tsx",
216
- "line": 47,
217
- "character": 30
218
- },
219
- "type": {
220
- "__schema": "TypeRefSchema",
221
- "location": {
222
- "filePath": "code.ui.runtime.tsx",
223
- "line": 47,
224
- "character": 30
225
- },
226
- "name": "FileIconMatch"
227
- }
228
- },
229
- "isOptional": false,
230
- "isSpread": false
231
- }
232
- ],
233
- "returnType": {
234
- "__schema": "TypeRefSchema",
235
- "location": {
236
- "filePath": "code.ui.runtime.tsx",
237
- "line": 47,
238
- "character": 3
239
- },
240
- "name": "CodeUI"
241
- },
242
- "modifiers": []
243
- },
244
- {
245
- "__schema": "VariableLikeSchema",
246
- "location": {
247
- "filePath": "code.ui.runtime.tsx",
248
- "line": 52,
249
- "character": 3
250
- },
251
- "signature": "(property) CodeUI.dependencies: Aspect[]",
252
- "name": "dependencies",
253
- "type": {
254
- "__schema": "InferenceTypeSchema",
255
- "location": {
256
- "filePath": "code.ui.runtime.tsx",
257
- "line": 52,
258
- "character": 3
259
- },
260
- "type": "Aspect[]"
261
- },
262
- "isOptional": true,
263
- "defaultValue": "[ComponentAspect, ComponentCompareAspect]"
264
- },
265
- {
266
- "__schema": "VariableLikeSchema",
267
- "location": {
268
- "filePath": "code.ui.runtime.tsx",
269
- "line": 54,
270
- "character": 3
271
- },
272
- "signature": "(property) CodeUI.runtime: RuntimeDefinition",
273
- "name": "runtime",
274
- "type": {
275
- "__schema": "InferenceTypeSchema",
276
- "location": {
277
- "filePath": "code.ui.runtime.tsx",
278
- "line": 54,
279
- "character": 3
280
- },
281
- "type": "RuntimeDefinition"
282
- },
283
- "isOptional": true,
284
- "defaultValue": "UIRuntime"
285
- },
286
- {
287
- "__schema": "VariableLikeSchema",
288
- "location": {
289
- "filePath": "code.ui.runtime.tsx",
290
- "line": 56,
291
- "character": 3
292
- },
293
- "signature": "(property) CodeUI.slots: ((registerFn: () => string) => SlotRegistry<string>)[]",
294
- "name": "slots",
295
- "type": {
296
- "__schema": "InferenceTypeSchema",
297
- "location": {
298
- "filePath": "code.ui.runtime.tsx",
299
- "line": 56,
300
- "character": 3
301
- },
302
- "type": "((registerFn: () => string) => SlotRegistry<string>)[]"
303
- },
304
- "isOptional": true,
305
- "defaultValue": "[Slot.withType<string>()]"
306
- },
307
- {
308
- "__schema": "FunctionLikeSchema",
309
- "location": {
310
- "filePath": "code.ui.runtime.tsx",
311
- "line": 58,
312
- "character": 3
313
- },
314
- "signature": "(method) CodeUI.provider([component, componentCompare]: [ComponentUI, ComponentCompareUI], _: any, [fileIconSlot]: [FileIconSlot], harmony: Harmony): Promise<CodeUI>",
315
- "name": "provider",
316
- "params": [
317
- {
318
- "__schema": "ParameterSchema",
319
- "location": {
320
- "filePath": "code.ui.runtime.tsx",
321
- "line": 59,
322
- "character": 5
323
- },
324
- "name": "[ component, componentCompare ]",
325
- "type": {
326
- "__schema": "TupleTypeSchema",
327
- "location": {
328
- "filePath": "code.ui.runtime.tsx",
329
- "line": 59,
330
- "character": 36
331
- },
332
- "elements": [
333
- {
334
- "__schema": "TypeRefSchema",
335
- "location": {
336
- "filePath": "code.ui.runtime.tsx",
337
- "line": 59,
338
- "character": 37
339
- },
340
- "name": "ComponentUI"
341
- },
342
- {
343
- "__schema": "TypeRefSchema",
344
- "location": {
345
- "filePath": "code.ui.runtime.tsx",
346
- "line": 59,
347
- "character": 50
348
- },
349
- "name": "ComponentCompareUI"
350
- }
351
- ]
352
- },
353
- "isOptional": false,
354
- "isSpread": false
355
- },
356
- {
357
- "__schema": "ParameterSchema",
358
- "location": {
359
- "filePath": "code.ui.runtime.tsx",
360
- "line": 60,
361
- "character": 5
362
- },
363
- "name": "_",
364
- "type": {
365
- "__schema": "InferenceTypeSchema",
366
- "location": {
367
- "filePath": "code.ui.runtime.tsx",
368
- "line": 60,
369
- "character": 5
370
- },
371
- "type": "any"
372
- },
373
- "isOptional": false,
374
- "isSpread": false
375
- },
376
- {
377
- "__schema": "ParameterSchema",
378
- "location": {
379
- "filePath": "code.ui.runtime.tsx",
380
- "line": 61,
381
- "character": 5
382
- },
383
- "name": "[ fileIconSlot ]",
384
- "type": {
385
- "__schema": "TupleTypeSchema",
386
- "location": {
387
- "filePath": "code.ui.runtime.tsx",
388
- "line": 61,
389
- "character": 21
390
- },
391
- "elements": [
392
- {
393
- "__schema": "TypeRefSchema",
394
- "location": {
395
- "filePath": "code.ui.runtime.tsx",
396
- "line": 61,
397
- "character": 22
398
- },
399
- "name": "FileIconSlot"
400
- }
401
- ]
402
- },
403
- "isOptional": false,
404
- "isSpread": false
405
- },
406
- {
407
- "__schema": "ParameterSchema",
408
- "location": {
409
- "filePath": "code.ui.runtime.tsx",
410
- "line": 62,
411
- "character": 5
412
- },
413
- "name": "harmony",
414
- "type": {
415
- "__schema": "TypeRefSchema",
416
- "location": {
417
- "filePath": "code.ui.runtime.tsx",
418
- "line": 62,
419
- "character": 14
420
- },
421
- "name": "Harmony"
422
- },
423
- "isOptional": false,
424
- "isSpread": false
425
- }
426
- ],
427
- "returnType": {
428
- "__schema": "InferenceTypeSchema",
429
- "location": {
430
- "filePath": "code.ui.runtime.tsx",
431
- "line": 58,
432
- "character": 3
433
- },
434
- "type": "Promise<CodeUI>"
435
- },
436
- "modifiers": [
437
- "static",
438
- "async"
439
- ]
440
- }
441
- ],
442
- "extendsNodes": [],
443
- "implementNodes": []
444
- },
445
- {
446
- "__schema": "TypeSchema",
447
- "location": {
448
- "filePath": "code.ui.runtime.tsx",
449
- "line": 17,
450
- "character": 1
451
- },
452
- "signature": "type FileIconSlot = SlotRegistry<FileIconMatch[]>",
453
- "name": "FileIconSlot",
454
- "type": {
455
- "__schema": "TypeRefSchema",
456
- "location": {
457
- "filePath": "code.ui.runtime.tsx",
458
- "line": 17,
459
- "character": 28
460
- },
461
- "name": "SlotRegistry",
462
- "typeArgs": [
463
- {
464
- "__schema": "TypeArraySchema",
465
- "location": {
466
- "filePath": "code.ui.runtime.tsx",
467
- "line": 17,
468
- "character": 41
469
- },
470
- "type": {
471
- "__schema": "TypeRefSchema",
472
- "location": {
473
- "filePath": "code.ui.runtime.tsx",
474
- "line": 17,
475
- "character": 41
476
- },
477
- "name": "FileIconMatch"
478
- }
479
- }
480
- ]
481
- }
482
- },
483
- {
484
- "__schema": "VariableLikeSchema",
485
- "location": {
486
- "filePath": "code.aspect.ts",
487
- "line": 3,
488
- "character": 14
489
- },
490
- "signature": "const CodeAspect: Aspect",
491
- "name": "CodeAspect",
492
- "type": {
493
- "__schema": "TypeRefSchema",
494
- "location": {
495
- "filePath": "code.aspect.ts",
496
- "line": 3,
497
- "character": 14
498
- },
499
- "name": "Aspect",
500
- "componentId": {
501
- "scope": "teambit.harmony",
502
- "name": "harmony",
503
- "version": "0.4.6"
504
- }
505
- },
506
- "isOptional": false,
507
- "defaultValue": "Aspect.create({\n id: 'teambit.component/code',\n dependencies: [],\n defaultConfig: {},\n})"
508
- },
509
- {
510
- "__schema": "UnImplementedSchema",
511
- "location": {
512
- "filePath": "index.ts",
513
- "line": 5,
514
- "character": 16
515
- },
516
- "name": "CodeAspect",
517
- "type": "Identifier"
518
- }
519
- ],
520
- "internals": []
521
- },
522
- "internals": [
523
- {
524
- "__schema": "ModuleSchema",
525
- "location": {
526
- "filePath": "code.ui.runtime.tsx",
527
- "line": 1,
528
- "character": 1
529
- },
530
- "exports": [
531
- {
532
- "__schema": "TypeSchema",
533
- "location": {
534
- "filePath": "code.ui.runtime.tsx",
535
- "line": 17,
536
- "character": 1
537
- },
538
- "signature": "type FileIconSlot = SlotRegistry<FileIconMatch[]>",
539
- "name": "FileIconSlot",
540
- "type": {
541
- "__schema": "TypeRefSchema",
542
- "location": {
543
- "filePath": "code.ui.runtime.tsx",
544
- "line": 17,
545
- "character": 28
546
- },
547
- "name": "SlotRegistry",
548
- "typeArgs": [
549
- {
550
- "__schema": "TypeArraySchema",
551
- "location": {
552
- "filePath": "code.ui.runtime.tsx",
553
- "line": 17,
554
- "character": 41
555
- },
556
- "type": {
557
- "__schema": "TypeRefSchema",
558
- "location": {
559
- "filePath": "code.ui.runtime.tsx",
560
- "line": 17,
561
- "character": 41
562
- },
563
- "name": "FileIconMatch"
564
- }
565
- }
566
- ]
567
- }
568
- },
569
- {
570
- "__schema": "ClassSchema",
571
- "location": {
572
- "filePath": "code.ui.runtime.tsx",
573
- "line": 23,
574
- "character": 1
575
- },
576
- "doc": {
577
- "__schema": "DocSchema",
578
- "location": {
579
- "filePath": "code.ui.runtime.tsx",
580
- "line": 19,
581
- "character": 1
582
- },
583
- "raw": "/**\n * Component code tab aspect. Presents the code tab page and allows to control the code tab and register specific icons for each file type.\n * @example CodeUI.registerEnvFileIcon([(fileName) => (/your-regexp/.test(fileName) ? 'your.icon.url' : undefined)])\n */",
584
- "comment": "Component code tab aspect. Presents the code tab page and allows to control the code tab and register specific icons for each file type.",
585
- "tags": [
586
- {
587
- "__schema": "TagSchema",
588
- "location": {
589
- "filePath": "code.ui.runtime.tsx",
590
- "line": 21,
591
- "character": 5
592
- },
593
- "tagName": "example",
594
- "comment": "CodeUI.registerEnvFileIcon([\n (fileName) => (/your-regexp/.test(fileName) ? 'your.icon.url' : undefined),\n]);\n"
595
- }
596
- ]
597
- },
598
- "signature": "class CodeUI",
599
- "name": "CodeUI",
600
- "members": [
601
- {
602
- "__schema": "ConstructorSchema",
603
- "location": {
604
- "filePath": "code.ui.runtime.tsx",
605
- "line": 24,
606
- "character": 3
607
- },
608
- "signature": "constructor CodeUI(host: string, fileIconSlot?: FileIconSlot): CodeUI",
609
- "name": "constructor",
610
- "params": [
611
- {
612
- "__schema": "ParameterSchema",
613
- "location": {
614
- "filePath": "code.ui.runtime.tsx",
615
- "line": 28,
616
- "character": 5
617
- },
618
- "name": "host",
619
- "type": {
620
- "__schema": "KeywordTypeSchema",
621
- "location": {
622
- "filePath": "code.ui.runtime.tsx",
623
- "line": 28,
624
- "character": 19
625
- },
626
- "name": "string"
627
- },
628
- "isOptional": false,
629
- "isSpread": false
630
- },
631
- {
632
- "__schema": "ParameterSchema",
633
- "location": {
634
- "filePath": "code.ui.runtime.tsx",
635
- "line": 29,
636
- "character": 5
637
- },
638
- "name": "fileIconSlot",
639
- "type": {
640
- "__schema": "TypeRefSchema",
641
- "location": {
642
- "filePath": "code.ui.runtime.tsx",
643
- "line": 29,
644
- "character": 28
645
- },
646
- "name": "FileIconSlot"
647
- },
648
- "isOptional": true,
649
- "isSpread": false
650
- }
651
- ],
652
- "returnType": {
653
- "__schema": "ThisTypeSchema",
654
- "location": {
655
- "filePath": "code.ui.runtime.tsx",
656
- "line": 23,
657
- "character": 1
658
- },
659
- "name": "CodeUI"
660
- },
661
- "modifiers": []
662
- },
663
- {
664
- "__schema": "VariableLikeSchema",
665
- "location": {
666
- "filePath": "code.ui.runtime.tsx",
667
- "line": 32,
668
- "character": 3
669
- },
670
- "signature": "(property) CodeUI.getCodePage: (props?: Partial<CodePageProps>) => React.JSX.Element",
671
- "name": "getCodePage",
672
- "type": {
673
- "__schema": "InferenceTypeSchema",
674
- "location": {
675
- "filePath": "code.ui.runtime.tsx",
676
- "line": 32,
677
- "character": 3
678
- },
679
- "type": "(props?: Partial<CodePageProps>) => React.JSX.Element"
680
- },
681
- "isOptional": true,
682
- "defaultValue": "(props?: Partial<CodePageProps>) => {\n return <CodePage {...(props || {})} fileIconSlot={this.fileIconSlot} host={this.host} />;\n }"
683
- },
684
- {
685
- "__schema": "VariableLikeSchema",
686
- "location": {
687
- "filePath": "code.ui.runtime.tsx",
688
- "line": 36,
689
- "character": 3
690
- },
691
- "signature": "(property) CodeUI.getCodeCompare: (props?: Partial<CodeCompareProps>) => React.JSX.Element",
692
- "name": "getCodeCompare",
693
- "type": {
694
- "__schema": "InferenceTypeSchema",
695
- "location": {
696
- "filePath": "code.ui.runtime.tsx",
697
- "line": 36,
698
- "character": 3
699
- },
700
- "type": "(props?: Partial<CodeCompareProps>) => React.JSX.Element"
701
- },
702
- "isOptional": true,
703
- "defaultValue": "(props?: Partial<CodeCompareProps>) => {\n return (\n <CodeCompareEditorProvider>\n <CodeCompare {...(props || {})} fileIconSlot={this.fileIconSlot} />\n </CodeCompareEditorProvider>\n );\n }"
704
- },
705
- {
706
- "__schema": "VariableLikeSchema",
707
- "location": {
708
- "filePath": "code.ui.runtime.tsx",
709
- "line": 44,
710
- "character": 3
711
- },
712
- "signature": "(property) CodeUI.getCodeEditorProvider: () => React.FC<CodeEditorProviderProps>",
713
- "name": "getCodeEditorProvider",
714
- "type": {
715
- "__schema": "InferenceTypeSchema",
716
- "location": {
717
- "filePath": "code.ui.runtime.tsx",
718
- "line": 44,
719
- "character": 3
720
- },
721
- "type": "() => React.FC<CodeEditorProviderProps>"
722
- },
723
- "isOptional": true,
724
- "defaultValue": "() => CodeEditorProvider"
725
- },
726
- {
727
- "__schema": "VariableLikeSchema",
728
- "location": {
729
- "filePath": "code.ui.runtime.tsx",
730
- "line": 45,
731
- "character": 3
732
- },
733
- "signature": "(property) CodeUI.getCodeDiffEditorProvider: () => React.FC<CodeCompareEditorProviderProps>",
734
- "name": "getCodeDiffEditorProvider",
735
- "type": {
736
- "__schema": "InferenceTypeSchema",
737
- "location": {
738
- "filePath": "code.ui.runtime.tsx",
739
- "line": 45,
740
- "character": 3
741
- },
742
- "type": "() => React.FC<CodeCompareEditorProviderProps>"
743
- },
744
- "isOptional": true,
745
- "defaultValue": "() => CodeCompareEditorProvider"
746
- },
747
- {
748
- "__schema": "FunctionLikeSchema",
749
- "location": {
750
- "filePath": "code.ui.runtime.tsx",
751
- "line": 47,
752
- "character": 3
753
- },
754
- "signature": "(method) CodeUI.registerEnvFileIcon(icons: FileIconMatch[]): this",
755
- "name": "registerEnvFileIcon",
756
- "params": [
757
- {
758
- "__schema": "ParameterSchema",
759
- "location": {
760
- "filePath": "code.ui.runtime.tsx",
761
- "line": 47,
762
- "character": 23
763
- },
764
- "name": "icons",
765
- "type": {
766
- "__schema": "TypeArraySchema",
767
- "location": {
768
- "filePath": "code.ui.runtime.tsx",
769
- "line": 47,
770
- "character": 30
771
- },
772
- "type": {
773
- "__schema": "TypeRefSchema",
774
- "location": {
775
- "filePath": "code.ui.runtime.tsx",
776
- "line": 47,
777
- "character": 30
778
- },
779
- "name": "FileIconMatch"
780
- }
781
- },
782
- "isOptional": false,
783
- "isSpread": false
784
- }
785
- ],
786
- "returnType": {
787
- "__schema": "TypeRefSchema",
788
- "location": {
789
- "filePath": "code.ui.runtime.tsx",
790
- "line": 47,
791
- "character": 3
792
- },
793
- "name": "CodeUI"
794
- },
795
- "modifiers": []
796
- },
797
- {
798
- "__schema": "VariableLikeSchema",
799
- "location": {
800
- "filePath": "code.ui.runtime.tsx",
801
- "line": 52,
802
- "character": 3
803
- },
804
- "signature": "(property) CodeUI.dependencies: Aspect[]",
805
- "name": "dependencies",
806
- "type": {
807
- "__schema": "InferenceTypeSchema",
808
- "location": {
809
- "filePath": "code.ui.runtime.tsx",
810
- "line": 52,
811
- "character": 3
812
- },
813
- "type": "Aspect[]"
814
- },
815
- "isOptional": true,
816
- "defaultValue": "[ComponentAspect, ComponentCompareAspect]"
817
- },
818
- {
819
- "__schema": "VariableLikeSchema",
820
- "location": {
821
- "filePath": "code.ui.runtime.tsx",
822
- "line": 54,
823
- "character": 3
824
- },
825
- "signature": "(property) CodeUI.runtime: RuntimeDefinition",
826
- "name": "runtime",
827
- "type": {
828
- "__schema": "InferenceTypeSchema",
829
- "location": {
830
- "filePath": "code.ui.runtime.tsx",
831
- "line": 54,
832
- "character": 3
833
- },
834
- "type": "RuntimeDefinition"
835
- },
836
- "isOptional": true,
837
- "defaultValue": "UIRuntime"
838
- },
839
- {
840
- "__schema": "VariableLikeSchema",
841
- "location": {
842
- "filePath": "code.ui.runtime.tsx",
843
- "line": 56,
844
- "character": 3
845
- },
846
- "signature": "(property) CodeUI.slots: ((registerFn: () => string) => SlotRegistry<string>)[]",
847
- "name": "slots",
848
- "type": {
849
- "__schema": "InferenceTypeSchema",
850
- "location": {
851
- "filePath": "code.ui.runtime.tsx",
852
- "line": 56,
853
- "character": 3
854
- },
855
- "type": "((registerFn: () => string) => SlotRegistry<string>)[]"
856
- },
857
- "isOptional": true,
858
- "defaultValue": "[Slot.withType<string>()]"
859
- },
860
- {
861
- "__schema": "FunctionLikeSchema",
862
- "location": {
863
- "filePath": "code.ui.runtime.tsx",
864
- "line": 58,
865
- "character": 3
866
- },
867
- "signature": "(method) CodeUI.provider([component, componentCompare]: [ComponentUI, ComponentCompareUI], _: any, [fileIconSlot]: [FileIconSlot], harmony: Harmony): Promise<CodeUI>",
868
- "name": "provider",
869
- "params": [
870
- {
871
- "__schema": "ParameterSchema",
872
- "location": {
873
- "filePath": "code.ui.runtime.tsx",
874
- "line": 59,
875
- "character": 5
876
- },
877
- "name": "[ component, componentCompare ]",
878
- "type": {
879
- "__schema": "TupleTypeSchema",
880
- "location": {
881
- "filePath": "code.ui.runtime.tsx",
882
- "line": 59,
883
- "character": 36
884
- },
885
- "elements": [
886
- {
887
- "__schema": "TypeRefSchema",
888
- "location": {
889
- "filePath": "code.ui.runtime.tsx",
890
- "line": 59,
891
- "character": 37
892
- },
893
- "name": "ComponentUI"
894
- },
895
- {
896
- "__schema": "TypeRefSchema",
897
- "location": {
898
- "filePath": "code.ui.runtime.tsx",
899
- "line": 59,
900
- "character": 50
901
- },
902
- "name": "ComponentCompareUI"
903
- }
904
- ]
905
- },
906
- "isOptional": false,
907
- "isSpread": false
908
- },
909
- {
910
- "__schema": "ParameterSchema",
911
- "location": {
912
- "filePath": "code.ui.runtime.tsx",
913
- "line": 60,
914
- "character": 5
915
- },
916
- "name": "_",
917
- "type": {
918
- "__schema": "InferenceTypeSchema",
919
- "location": {
920
- "filePath": "code.ui.runtime.tsx",
921
- "line": 60,
922
- "character": 5
923
- },
924
- "type": "any"
925
- },
926
- "isOptional": false,
927
- "isSpread": false
928
- },
929
- {
930
- "__schema": "ParameterSchema",
931
- "location": {
932
- "filePath": "code.ui.runtime.tsx",
933
- "line": 61,
934
- "character": 5
935
- },
936
- "name": "[ fileIconSlot ]",
937
- "type": {
938
- "__schema": "TupleTypeSchema",
939
- "location": {
940
- "filePath": "code.ui.runtime.tsx",
941
- "line": 61,
942
- "character": 21
943
- },
944
- "elements": [
945
- {
946
- "__schema": "TypeRefSchema",
947
- "location": {
948
- "filePath": "code.ui.runtime.tsx",
949
- "line": 61,
950
- "character": 22
951
- },
952
- "name": "FileIconSlot"
953
- }
954
- ]
955
- },
956
- "isOptional": false,
957
- "isSpread": false
958
- },
959
- {
960
- "__schema": "ParameterSchema",
961
- "location": {
962
- "filePath": "code.ui.runtime.tsx",
963
- "line": 62,
964
- "character": 5
965
- },
966
- "name": "harmony",
967
- "type": {
968
- "__schema": "TypeRefSchema",
969
- "location": {
970
- "filePath": "code.ui.runtime.tsx",
971
- "line": 62,
972
- "character": 14
973
- },
974
- "name": "Harmony"
975
- },
976
- "isOptional": false,
977
- "isSpread": false
978
- }
979
- ],
980
- "returnType": {
981
- "__schema": "InferenceTypeSchema",
982
- "location": {
983
- "filePath": "code.ui.runtime.tsx",
984
- "line": 58,
985
- "character": 3
986
- },
987
- "type": "Promise<CodeUI>"
988
- },
989
- "modifiers": [
990
- "static",
991
- "async"
992
- ]
993
- }
994
- ],
995
- "extendsNodes": [],
996
- "implementNodes": []
997
- }
998
- ],
999
- "internals": [
1000
- {
1001
- "__schema": "ModuleSchema",
1002
- "location": {
1003
- "filePath": "code.ui.runtime.tsx",
1004
- "line": 15,
1005
- "character": 1
1006
- },
1007
- "exports": [
1008
- {
1009
- "__schema": "VariableLikeSchema",
1010
- "location": {
1011
- "filePath": "code.ui.runtime.tsx",
1012
- "line": 15,
1013
- "character": 7
1014
- },
1015
- "signature": "const isTsx: RegExp",
1016
- "name": "isTsx",
1017
- "type": {
1018
- "__schema": "InferenceTypeSchema",
1019
- "location": {
1020
- "filePath": "code.ui.runtime.tsx",
1021
- "line": 15,
1022
- "character": 7
1023
- },
1024
- "type": "RegExp"
1025
- },
1026
- "isOptional": false,
1027
- "defaultValue": "/\\.tsx$/"
1028
- }
1029
- ],
1030
- "internals": []
1031
- },
1032
- {
1033
- "__schema": "UnImplementedSchema",
1034
- "location": {
1035
- "filePath": "code.ui.runtime.tsx",
1036
- "line": 82,
1037
- "character": 1
1038
- },
1039
- "name": "CodeAspect.addRuntime(CodeUI);",
1040
- "type": "ExpressionStatement"
1041
- }
1042
- ]
1043
- },
1044
- {
1045
- "__schema": "ModuleSchema",
1046
- "location": {
1047
- "filePath": "code.aspect.ts",
1048
- "line": 1,
1049
- "character": 1
1050
- },
1051
- "exports": [
1052
- {
1053
- "__schema": "VariableLikeSchema",
1054
- "location": {
1055
- "filePath": "code.aspect.ts",
1056
- "line": 3,
1057
- "character": 14
1058
- },
1059
- "signature": "const CodeAspect: Aspect",
1060
- "name": "CodeAspect",
1061
- "type": {
1062
- "__schema": "TypeRefSchema",
1063
- "location": {
1064
- "filePath": "code.aspect.ts",
1065
- "line": 3,
1066
- "character": 14
1067
- },
1068
- "name": "Aspect",
1069
- "componentId": {
1070
- "scope": "teambit.harmony",
1071
- "name": "harmony",
1072
- "version": "0.4.6"
1073
- }
1074
- },
1075
- "isOptional": false,
1076
- "defaultValue": "Aspect.create({\n id: 'teambit.component/code',\n dependencies: [],\n defaultConfig: {},\n})"
1077
- },
1078
- {
1079
- "__schema": "UnImplementedSchema",
1080
- "location": {
1081
- "filePath": "code.aspect.ts",
1082
- "line": 9,
1083
- "character": 16
1084
- },
1085
- "name": "CodeAspect",
1086
- "type": "Identifier"
1087
- }
1088
- ],
1089
- "internals": []
1090
- }
1091
- ],
1092
- "componentId": {
1093
- "scope": "teambit.component",
1094
- "name": "code",
1095
- "version": "1.0.186"
1096
- },
1097
- "taggedModuleExports": []
1098
- }