@teambit/code 0.0.951 → 0.0.953

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.
@@ -65,10 +65,7 @@ export class CodeUI {
65
65
  component.registerRoute([section.route]);
66
66
  component.registerWidget(section.navigationLink, section.order);
67
67
  const codeCompare = new CodeCompareSection(ui);
68
- componentCompare.registerNavigation({
69
- props: codeCompare.navigationLink,
70
- order: codeCompare.navigationLink.order,
71
- });
68
+ componentCompare.registerNavigation(codeCompare);
72
69
  componentCompare.registerRoutes([codeCompare.route]);
73
70
  return ui;
74
71
  }
@@ -134,10 +134,7 @@ class CodeUI {
134
134
  component.registerRoute([section.route]);
135
135
  component.registerWidget(section.navigationLink, section.order);
136
136
  const codeCompare = new (_codeUi3().CodeCompareSection)(ui);
137
- componentCompare.registerNavigation({
138
- props: codeCompare.navigationLink,
139
- order: codeCompare.navigationLink.order
140
- });
137
+ componentCompare.registerNavigation(codeCompare);
141
138
  componentCompare.registerRoutes([codeCompare.route]);
142
139
  return ui;
143
140
  }
@@ -1 +1 @@
1
- {"version":3,"names":["isTsx","CodeUI","constructor","host","fileIconSlot","registerEnvFileIcon","icons","register","provider","component","componentCompare","_","harmony","config","String","get","ui","section","CodeSection","fileName","test","staticStorageUrl","undefined","registerRoute","route","registerWidget","navigationLink","order","codeCompare","CodeCompareSection","registerNavigation","props","registerRoutes","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 } 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 } from '@teambit/code.ui.code-tab-page';\nimport { ComponentCompareUI, ComponentCompareAspect } from '@teambit/component-compare';\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 = () => {\n return <CodePage fileIconSlot={this.fileIconSlot} host={this.host} />;\n };\n\n getCodeCompare = () => {\n return <CodeCompare fileIconSlot={this.fileIconSlot} />;\n };\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({\n props: codeCompare.navigationLink,\n order: codeCompare.navigationLink.order,\n });\n componentCompare.registerRoutes([codeCompare.route]);\n return ui;\n }\n}\n\nCodeAspect.addRuntime(CodeUI);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA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AAG,CAAC,qBAAqB,CAAC,CAAC;IACtD,MAAMC,EAAE,GAAG,IAAIf,MAAM,CAACE,IAAI,EAAEC,YAAY,CAAC;IACzC,MAAMa,OAAO,GAAG,KAAIC,oBAAW,EAACF,EAAE,CAAC;;IAEnC;IACAA,EAAE,CAACX,mBAAmB,CAAC,CACpBc,QAAQ,IAAMnB,KAAK,CAACoB,IAAI,CAACD,QAAQ,CAAC,GAAI,GAAEE,mCAAiB,sCAAqC,GAAGC,SAAU,CAC7G,CAAC;IACFb,SAAS,CAACc,aAAa,CAAC,CAACN,OAAO,CAACO,KAAK,CAAC,CAAC;IACxCf,SAAS,CAACgB,cAAc,CAACR,OAAO,CAACS,cAAc,EAAET,OAAO,CAACU,KAAK,CAAC;IAC/D,MAAMC,WAAW,GAAG,KAAIC,6BAAkB,EAACb,EAAE,CAAC;IAC9CN,gBAAgB,CAACoB,kBAAkB,CAAC;MAClCC,KAAK,EAAEH,WAAW,CAACF,cAAc;MACjCC,KAAK,EAAEC,WAAW,CAACF,cAAc,CAACC;IACpC,CAAC,CAAC;IACFjB,gBAAgB,CAACsB,cAAc,CAAC,CAACJ,WAAW,CAACJ,KAAK,CAAC,CAAC;IACpD,OAAOR,EAAE;EACX;AACF;AAAC;AAAA,gCArDYf,MAAM,kBAsBK,CAACgC,4BAAe,EAAEC,0CAAsB,CAAC;AAAA,gCAtBpDjC,MAAM,aAwBAkC,eAAS;AAAA,gCAxBflC,MAAM,WA0BF,CAACmC,eAAI,CAACC,QAAQ,EAAU,CAAC;AA6B1CC,kBAAU,CAACC,UAAU,CAACtC,MAAM,CAAC"}
1
+ {"version":3,"names":["isTsx","CodeUI","constructor","host","fileIconSlot","registerEnvFileIcon","icons","register","provider","component","componentCompare","_","harmony","config","String","get","ui","section","CodeSection","fileName","test","staticStorageUrl","undefined","registerRoute","route","registerWidget","navigationLink","order","codeCompare","CodeCompareSection","registerNavigation","registerRoutes","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 } 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 } from '@teambit/code.ui.code-tab-page';\nimport { ComponentCompareUI, ComponentCompareAspect } from '@teambit/component-compare';\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 = () => {\n return <CodePage fileIconSlot={this.fileIconSlot} host={this.host} />;\n };\n\n getCodeCompare = () => {\n return <CodeCompare fileIconSlot={this.fileIconSlot} />;\n };\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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,KAAK,GAAG,QAAQ;AAItB;AACA;AACA;AACA;AACO,MAAMC,MAAM,CAAC;EAClBC,WAAW;EACT;AACJ;AACA;EACYC,IAAY,EACZC,YAA2B,EACnC;IAAA,KAFQD,IAAY,GAAZA,IAAY;IAAA,KACZC,YAA2B,GAA3BA,YAA2B;IAAA,qDAGvB,MAAM;MAClB,oBAAO,+BAAC,mBAAQ;QAAC,YAAY,EAAE,IAAI,CAACA,YAAa;QAAC,IAAI,EAAE,IAAI,CAACD;MAAK,EAAG;IACvE,CAAC;IAAA,wDAEgB,MAAM;MACrB,oBAAO,+BAAC,qBAAW;QAAC,YAAY,EAAE,IAAI,CAACC;MAAa,EAAG;IACzD,CAAC;EARE;EAUHC,mBAAmB,CAACC,KAAsB,EAAE;IAAA;IAC1C,0BAAI,CAACF,YAAY,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/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_code@0.0.951/dist/code.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_code@0.0.951/dist/code.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_code@0.0.953/dist/code.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_code@0.0.953/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,26 +1,26 @@
1
1
  {
2
2
  "name": "@teambit/code",
3
- "version": "0.0.951",
3
+ "version": "0.0.953",
4
4
  "homepage": "https://bit.dev/teambit/component/code",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "code",
9
- "version": "0.0.951"
9
+ "version": "0.0.953"
10
10
  },
11
11
  "dependencies": {
12
12
  "core-js": "^3.0.0",
13
13
  "@babel/runtime": "7.20.0",
14
14
  "@teambit/harmony": "0.4.6",
15
15
  "@teambit/base-ui.constants.storage": "1.0.0",
16
- "@teambit/component": "0.0.951",
16
+ "@teambit/component": "0.0.953",
17
17
  "@teambit/ui-foundation.ui.menu-widget-icon": "0.0.497",
18
- "@teambit/code.ui.code-compare-section": "0.0.1",
19
- "@teambit/code.ui.code-compare": "0.0.156",
18
+ "@teambit/code.ui.code-compare-section": "0.0.2",
19
+ "@teambit/code.ui.code-compare": "0.0.157",
20
20
  "@teambit/code.ui.code-tab-page": "0.0.605",
21
21
  "@teambit/code.ui.utils.get-file-icon": "0.0.495",
22
- "@teambit/component-compare": "0.0.199",
23
- "@teambit/ui": "0.0.951"
22
+ "@teambit/component-compare": "0.0.201",
23
+ "@teambit/ui": "0.0.953"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/react": "^17.0.8",
@@ -31,7 +31,7 @@
31
31
  "@types/testing-library__jest-dom": "5.9.5"
32
32
  },
33
33
  "peerDependencies": {
34
- "@teambit/legacy": "1.0.418",
34
+ "@teambit/legacy": "1.0.419",
35
35
  "react": "^16.8.0 || ^17.0.0",
36
36
  "react-dom": "^16.8.0 || ^17.0.0"
37
37
  },