@teambit/docs 0.0.669 → 0.0.670

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.
@@ -71,16 +71,6 @@ function _componentUi() {
71
71
  return data;
72
72
  }
73
73
 
74
- function _componentUiHooks() {
75
- const data = require("@teambit/component.ui.hooks.use-fetch-docs");
76
-
77
- _componentUiHooks = function () {
78
- return data;
79
- };
80
-
81
- return data;
82
- }
83
-
84
74
  function _lanesUi() {
85
75
  const data = require("@teambit/lanes.ui.lanes");
86
76
 
@@ -115,19 +105,21 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
115
105
 
116
106
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
117
107
 
108
+ const ENV_LIST_WITH_DOCS_TEMPLATE = ['react', 'env', 'aspect', 'lit', 'html', 'node', 'mdx', 'react-native']; // envs using react based docs
109
+
110
+ const ENV_ASPECT_NAME = 'teambit.envs/envs';
111
+
118
112
  function Overview({
119
113
  titleBadges
120
114
  }) {
121
- var _component$preview;
115
+ var _componentDescriptor$, _component$preview;
122
116
 
123
117
  const component = (0, _react().useContext)(_component().ComponentContext);
124
118
  const componentDescriptor = (0, _component().useComponentDescriptor)();
125
119
  const lanesModel = (0, _lanesUi().useLanesContext)();
126
120
  const currentLane = lanesModel === null || lanesModel === void 0 ? void 0 : lanesModel.currentLane;
127
- const {
128
- data
129
- } = (0, _componentUiHooks().useFetchDocs)(component.id.toString());
130
- const fetchComponent = data === null || data === void 0 ? void 0 : data.component;
121
+ const envType = componentDescriptor === null || componentDescriptor === void 0 ? void 0 : (_componentDescriptor$ = componentDescriptor.get(ENV_ASPECT_NAME)) === null || _componentDescriptor$ === void 0 ? void 0 : _componentDescriptor$.type;
122
+ const showHeaderOutsideIframe = (component === null || component === void 0 ? void 0 : (_component$preview = component.preview) === null || _component$preview === void 0 ? void 0 : _component$preview.includesEnvTemplate) === false || !ENV_LIST_WITH_DOCS_TEMPLATE.includes(envType);
131
123
  if ((component === null || component === void 0 ? void 0 : component.buildStatus) === 'pending' && (component === null || component === void 0 ? void 0 : component.host) === 'teambit.scope/scope') return /*#__PURE__*/_react().default.createElement(_designUiSurfaces().StatusMessageCard, {
132
124
  style: {
133
125
  margin: 'auto'
@@ -143,8 +135,7 @@ function Overview({
143
135
  title: "failed to get component preview "
144
136
  });
145
137
 
146
- if (((_component$preview = component.preview) === null || _component$preview === void 0 ? void 0 : _component$preview.includesEnvTemplate) === false) {
147
- const labels = component.labels.length > 0 ? component.labels : fetchComponent === null || fetchComponent === void 0 ? void 0 : fetchComponent.labels;
138
+ if (showHeaderOutsideIframe) {
148
139
  const badges = (0, _lodash().default)(titleBadges.values());
149
140
  return /*#__PURE__*/_react().default.createElement("div", {
150
141
  className: _overviewModule().default.overviewWrapper
@@ -156,8 +147,8 @@ function Overview({
156
147
  className: _overviewModule().default.componentOverviewBlock,
157
148
  displayName: component.displayName,
158
149
  version: component.version,
159
- abstract: component.description || (fetchComponent === null || fetchComponent === void 0 ? void 0 : fetchComponent.description),
160
- labels: labels || [],
150
+ abstract: component.description,
151
+ labels: component.labels,
161
152
  packageName: component.packageName,
162
153
  titleBadges: badges,
163
154
  componentDescriptor: componentDescriptor
@@ -1 +1 @@
1
- {"version":3,"sources":["overview.tsx"],"names":["Overview","titleBadges","component","ComponentContext","componentDescriptor","lanesModel","currentLane","data","id","toString","fetchComponent","buildStatus","host","margin","preview","includesEnvTemplate","labels","length","badges","values","styles","overviewWrapper","componentOverviewBlock","displayName","version","description","packageName","width","height"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAQO,SAASA,QAAT,CAAkB;AAAEC,EAAAA;AAAF,CAAlB,EAAkD;AAAA;;AACvD,QAAMC,SAAS,GAAG,yBAAWC,6BAAX,CAAlB;AACA,QAAMC,mBAAmB,GAAG,0CAA5B;AACA,QAAMC,UAAU,GAAG,iCAAnB;AACA,QAAMC,WAAW,GAAGD,UAAH,aAAGA,UAAH,uBAAGA,UAAU,CAAEC,WAAhC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAW,sCAAaL,SAAS,CAACM,EAAV,CAAaC,QAAb,EAAb,CAAjB;AACA,QAAMC,cAAc,GAAGH,IAAH,aAAGA,IAAH,uBAAGA,IAAI,CAAEL,SAA7B;AACA,MAAI,CAAAA,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAES,WAAX,MAA2B,SAA3B,IAAwC,CAAAT,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAEU,IAAX,MAAoB,qBAAhE,EACE,oBACE,+BAAC,qCAAD;AAAmB,IAAA,KAAK,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ME,MAAA,WAAW,EAAEd,SAAS,CAACwB,WANzB;AAOE,MAAA,WAAW,EAAER,MAPf;AAQE,MAAA,mBAAmB,EAAEd;AARvB,MAHF,eAaE,+BAAC,6BAAD;AACE,MAAA,SAAS,EAAEF,SADb;AAEE,MAAA,KAAK,EAAE;AAAEyB,QAAAA,KAAK,EAAE,MAAT;AAAiBC,QAAAA,MAAM,EAAE;AAAzB,OAFT;AAGE,MAAA,WAAW,EAAC,UAHd;AAIE,MAAA,iBAAiB,MAJnB;AAKE,MAAA,SAAS,EAAC;AALZ,MAbF,CADF;AAuBD;;AAED,SAAOtB,WAAW,gBAChB;AAAK,IAAA,SAAS,EAAEc,0BAAOC;AAAvB,kBACE,+BAAC,yBAAD;AAAgB,IAAA,IAAI,EAAEf;AAAtB,IADF,eAEE,+BAAC,qBAAD;AAAW,IAAA,gBAAgB;AAA3B,IAFF,eAGE,+BAAC,6BAAD;AACE,IAAA,SAAS,EAAEJ,SADb;AAEE,IAAA,KAAK,EAAE;AAAEyB,MAAAA,KAAK,EAAE,MAAT;AAAiBC,MAAAA,MAAM,EAAE;AAAzB,KAFT;AAGE,IAAA,WAAW,EAAC,UAHd;AAIE,IAAA,iBAAiB,MAJnB;AAKE,IAAA,SAAS,EAAC;AALZ,IAHF,CADgB,gBAahB,+BAAC,6BAAD;AACE,IAAA,SAAS,EAAE1B,SADb;AAEE,IAAA,KAAK,EAAE;AAAEyB,MAAAA,KAAK,EAAE,MAAT;AAAiBC,MAAAA,MAAM,EAAE;AAAzB,KAFT;AAGE,IAAA,WAAW,EAAC,UAHd;AAIE,IAAA,iBAAiB;AAJnB,IAbF;AAoBD","sourcesContent":["import React, { useContext } from 'react';\nimport flatten from 'lodash.flatten';\nimport { ComponentContext, useComponentDescriptor } from '@teambit/component';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { ComponentPreview } from '@teambit/preview.ui.component-preview';\nimport { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';\nimport { ComponentOverview, TitleBadge } from '@teambit/component.ui.component-meta';\nimport { useFetchDocs } from '@teambit/component.ui.hooks.use-fetch-docs';\nimport { LaneBreadcrumb, useLanesContext } from '@teambit/lanes.ui.lanes';\nimport { Separator } from '@teambit/design.ui.separator';\nimport styles from './overview.module.scss';\n\nexport type TitleBadgeSlot = SlotRegistry<TitleBadge[]>;\n\nexport type OverviewProps = {\n titleBadges: TitleBadgeSlot;\n};\n\nexport function Overview({ titleBadges }: OverviewProps) {\n const component = useContext(ComponentContext);\n const componentDescriptor = useComponentDescriptor()\n const lanesModel = useLanesContext();\n const currentLane = lanesModel?.currentLane;\n const { data } = useFetchDocs(component.id.toString());\n const fetchComponent = data?.component;\n if (component?.buildStatus === 'pending' && component?.host === 'teambit.scope/scope')\n return (\n <StatusMessageCard style={{ margin: 'auto' }} status=\"PROCESSING\" title=\"component preview pending\">\n this might take some time\n </StatusMessageCard>\n );\n if (component?.buildStatus === 'failed' && component?.host === 'teambit.scope/scope')\n return (\n <StatusMessageCard\n style={{ margin: 'auto' }}\n status=\"FAILURE\"\n title=\"failed to get component preview \"\n ></StatusMessageCard>\n );\n\n if (component.preview?.includesEnvTemplate === false) {\n const labels = component.labels.length > 0 ? component.labels : fetchComponent?.labels;\n const badges = flatten(titleBadges.values());\n\n return (\n <div className={styles.overviewWrapper}>\n <LaneBreadcrumb lane={currentLane} />\n <Separator isPresentational />\n <ComponentOverview\n className={styles.componentOverviewBlock}\n displayName={component.displayName}\n version={component.version}\n abstract={component.description || fetchComponent?.description}\n labels={labels || []}\n packageName={component.packageName}\n titleBadges={badges}\n componentDescriptor={componentDescriptor}\n />\n <ComponentPreview\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"overview\"\n fullContentHeight\n scrolling=\"no\"\n />\n </div>\n );\n }\n\n return currentLane ? (\n <div className={styles.overviewWrapper}>\n <LaneBreadcrumb lane={currentLane} />\n <Separator isPresentational />\n <ComponentPreview\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"overview\"\n fullContentHeight\n scrolling=\"no\"\n />\n </div>\n ) : (\n <ComponentPreview\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"overview\"\n fullContentHeight\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["overview.tsx"],"names":["ENV_LIST_WITH_DOCS_TEMPLATE","ENV_ASPECT_NAME","Overview","titleBadges","component","ComponentContext","componentDescriptor","lanesModel","currentLane","envType","get","type","showHeaderOutsideIframe","preview","includesEnvTemplate","includes","buildStatus","host","margin","badges","values","styles","overviewWrapper","componentOverviewBlock","displayName","version","description","labels","packageName","width","height"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAEA,MAAMA,2BAA2B,GAAG,CAAC,OAAD,EAAU,KAAV,EAAiB,QAAjB,EAA2B,KAA3B,EAAkC,MAAlC,EAA0C,MAA1C,EAAkD,KAAlD,EAAyD,cAAzD,CAApC,C,CAA8G;;AAE9G,MAAMC,eAAe,GAAG,mBAAxB;;AAQO,SAASC,QAAT,CAAkB;AAAEC,EAAAA;AAAF,CAAlB,EAAkD;AAAA;;AACvD,QAAMC,SAAS,GAAG,yBAAWC,6BAAX,CAAlB;AACA,QAAMC,mBAAmB,GAAG,0CAA5B;AACA,QAAMC,UAAU,GAAG,iCAAnB;AACA,QAAMC,WAAW,GAAGD,UAAH,aAAGA,UAAH,uBAAGA,UAAU,CAAEC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AC,UAHd;AAIE,IAAA,iBAAiB;AAJnB,IAbF;AAoBD","sourcesContent":["import React, { useContext } from 'react';\nimport flatten from 'lodash.flatten';\nimport { ComponentContext, useComponentDescriptor } from '@teambit/component';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { ComponentPreview } from '@teambit/preview.ui.component-preview';\nimport { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';\nimport { ComponentOverview, TitleBadge } from '@teambit/component.ui.component-meta';\nimport { LaneBreadcrumb, useLanesContext } from '@teambit/lanes.ui.lanes';\nimport { Separator } from '@teambit/design.ui.separator';\nimport styles from './overview.module.scss';\n\nconst ENV_LIST_WITH_DOCS_TEMPLATE = ['react', 'env', 'aspect', 'lit', 'html', 'node', 'mdx', 'react-native']; // envs using react based docs\n\nconst ENV_ASPECT_NAME = 'teambit.envs/envs';\n\nexport type TitleBadgeSlot = SlotRegistry<TitleBadge[]>;\n\nexport type OverviewProps = {\n titleBadges: TitleBadgeSlot;\n};\n\nexport function Overview({ titleBadges }: OverviewProps) {\n const component = useContext(ComponentContext);\n const componentDescriptor = useComponentDescriptor();\n const lanesModel = useLanesContext();\n const currentLane = lanesModel?.currentLane;\n\n const envType: string = componentDescriptor?.get<any>(ENV_ASPECT_NAME)?.type;\n const showHeaderOutsideIframe =\n component?.preview?.includesEnvTemplate === false || !ENV_LIST_WITH_DOCS_TEMPLATE.includes(envType);\n\n if (component?.buildStatus === 'pending' && component?.host === 'teambit.scope/scope')\n return (\n <StatusMessageCard style={{ margin: 'auto' }} status=\"PROCESSING\" title=\"component preview pending\">\n this might take some time\n </StatusMessageCard>\n );\n if (component?.buildStatus === 'failed' && component?.host === 'teambit.scope/scope')\n return (\n <StatusMessageCard\n style={{ margin: 'auto' }}\n status=\"FAILURE\"\n title=\"failed to get component preview \"\n ></StatusMessageCard>\n );\n\n if (showHeaderOutsideIframe) {\n const badges = flatten(titleBadges.values());\n\n return (\n <div className={styles.overviewWrapper}>\n <LaneBreadcrumb lane={currentLane} />\n <Separator isPresentational />\n <ComponentOverview\n className={styles.componentOverviewBlock}\n displayName={component.displayName}\n version={component.version}\n abstract={component.description}\n labels={component.labels}\n packageName={component.packageName}\n titleBadges={badges}\n componentDescriptor={componentDescriptor}\n />\n <ComponentPreview\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"overview\"\n fullContentHeight\n scrolling=\"no\"\n />\n </div>\n );\n }\n\n return currentLane ? (\n <div className={styles.overviewWrapper}>\n <LaneBreadcrumb lane={currentLane} />\n <Separator isPresentational />\n <ComponentPreview\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"overview\"\n fullContentHeight\n scrolling=\"no\"\n />\n </div>\n ) : (\n <ComponentPreview\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"overview\"\n fullContentHeight\n />\n );\n}\n"]}
@@ -5,11 +5,14 @@ import type { SlotRegistry } from '@teambit/harmony';
5
5
  import { ComponentPreview } from '@teambit/preview.ui.component-preview';
6
6
  import { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';
7
7
  import { ComponentOverview, TitleBadge } from '@teambit/component.ui.component-meta';
8
- import { useFetchDocs } from '@teambit/component.ui.hooks.use-fetch-docs';
9
8
  import { LaneBreadcrumb, useLanesContext } from '@teambit/lanes.ui.lanes';
10
9
  import { Separator } from '@teambit/design.ui.separator';
11
10
  import styles from './overview.module.scss';
12
11
 
12
+ const ENV_LIST_WITH_DOCS_TEMPLATE = ['react', 'env', 'aspect', 'lit', 'html', 'node', 'mdx', 'react-native']; // envs using react based docs
13
+
14
+ const ENV_ASPECT_NAME = 'teambit.envs/envs';
15
+
13
16
  export type TitleBadgeSlot = SlotRegistry<TitleBadge[]>;
14
17
 
15
18
  export type OverviewProps = {
@@ -18,11 +21,14 @@ export type OverviewProps = {
18
21
 
19
22
  export function Overview({ titleBadges }: OverviewProps) {
20
23
  const component = useContext(ComponentContext);
21
- const componentDescriptor = useComponentDescriptor()
24
+ const componentDescriptor = useComponentDescriptor();
22
25
  const lanesModel = useLanesContext();
23
26
  const currentLane = lanesModel?.currentLane;
24
- const { data } = useFetchDocs(component.id.toString());
25
- const fetchComponent = data?.component;
27
+
28
+ const envType: string = componentDescriptor?.get<any>(ENV_ASPECT_NAME)?.type;
29
+ const showHeaderOutsideIframe =
30
+ component?.preview?.includesEnvTemplate === false || !ENV_LIST_WITH_DOCS_TEMPLATE.includes(envType);
31
+
26
32
  if (component?.buildStatus === 'pending' && component?.host === 'teambit.scope/scope')
27
33
  return (
28
34
  <StatusMessageCard style={{ margin: 'auto' }} status="PROCESSING" title="component preview pending">
@@ -38,8 +44,7 @@ export function Overview({ titleBadges }: OverviewProps) {
38
44
  ></StatusMessageCard>
39
45
  );
40
46
 
41
- if (component.preview?.includesEnvTemplate === false) {
42
- const labels = component.labels.length > 0 ? component.labels : fetchComponent?.labels;
47
+ if (showHeaderOutsideIframe) {
43
48
  const badges = flatten(titleBadges.values());
44
49
 
45
50
  return (
@@ -50,8 +55,8 @@ export function Overview({ titleBadges }: OverviewProps) {
50
55
  className={styles.componentOverviewBlock}
51
56
  displayName={component.displayName}
52
57
  version={component.version}
53
- abstract={component.description || fetchComponent?.description}
54
- labels={labels || []}
58
+ abstract={component.description}
59
+ labels={component.labels}
55
60
  packageName={component.packageName}
56
61
  titleBadges={badges}
57
62
  componentDescriptor={componentDescriptor}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/docs",
3
- "version": "0.0.669",
3
+ "version": "0.0.670",
4
4
  "homepage": "https://bit.dev/teambit/docs/docs",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.docs",
8
8
  "name": "docs",
9
- "version": "0.0.669"
9
+ "version": "0.0.670"
10
10
  },
11
11
  "dependencies": {
12
12
  "@teambit/harmony": "0.2.11",
@@ -14,25 +14,24 @@
14
14
  "lodash.flatten": "4.4.0",
15
15
  "@babel/runtime": "7.12.18",
16
16
  "core-js": "^3.0.0",
17
- "@teambit/compiler": "0.0.669",
18
- "@teambit/component": "0.0.669",
17
+ "@teambit/compiler": "0.0.670",
18
+ "@teambit/component": "0.0.670",
19
19
  "@teambit/docs.entities.doc": "0.0.2",
20
- "@teambit/pkg": "0.0.669",
21
- "@teambit/workspace": "0.0.669",
22
- "@teambit/cli": "0.0.451",
23
- "@teambit/dev-files": "0.0.669",
24
- "@teambit/envs": "0.0.669",
25
- "@teambit/graphql": "0.0.669",
26
- "@teambit/logger": "0.0.541",
27
- "@teambit/preview": "0.0.669",
20
+ "@teambit/pkg": "0.0.670",
21
+ "@teambit/workspace": "0.0.670",
22
+ "@teambit/cli": "0.0.452",
23
+ "@teambit/dev-files": "0.0.670",
24
+ "@teambit/envs": "0.0.670",
25
+ "@teambit/graphql": "0.0.670",
26
+ "@teambit/logger": "0.0.542",
27
+ "@teambit/preview": "0.0.670",
28
28
  "@teambit/component-id": "0.0.401",
29
- "@teambit/component.ui.component-meta": "0.0.9",
30
- "@teambit/ui": "0.0.669",
31
- "@teambit/pubsub": "0.0.669",
32
- "@teambit/component.ui.hooks.use-fetch-docs": "0.0.3",
29
+ "@teambit/component.ui.component-meta": "0.0.10",
30
+ "@teambit/ui": "0.0.670",
31
+ "@teambit/pubsub": "0.0.670",
33
32
  "@teambit/design.ui.separator": "0.0.351",
34
33
  "@teambit/design.ui.surfaces.status-message-card": "0.0.7",
35
- "@teambit/lanes.ui.lanes": "0.0.11",
34
+ "@teambit/lanes.ui.lanes": "0.0.12",
36
35
  "@teambit/preview.ui.component-preview": "0.0.492"
37
36
  },
38
37
  "devDependencies": {
@@ -45,7 +44,7 @@
45
44
  "@types/node": "12.20.4"
46
45
  },
47
46
  "peerDependencies": {
48
- "@teambit/legacy": "1.0.230",
47
+ "@teambit/legacy": "1.0.231",
49
48
  "react-dom": "^16.8.0 || ^17.0.0",
50
49
  "react": "^16.8.0 || ^17.0.0"
51
50
  },
@@ -73,7 +72,7 @@
73
72
  "react": "-"
74
73
  },
75
74
  "peerDependencies": {
76
- "@teambit/legacy": "1.0.230",
75
+ "@teambit/legacy": "1.0.231",
77
76
  "react-dom": "^16.8.0 || ^17.0.0",
78
77
  "react": "^16.8.0 || ^17.0.0"
79
78
  }