@teambit/react 0.0.576 → 0.0.580

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.
@@ -3,7 +3,7 @@ import { Composer } from '@teambit/base-ui.utils.composer';
3
3
  import { StandaloneNotFoundPage } from '@teambit/design.ui.pages.standalone-not-found-page';
4
4
  import { RenderingContext } from '@teambit/preview';
5
5
  import { ErrorFallback } from '@teambit/react.ui.error-fallback';
6
- import { LoaderFallback } from '@teambit/react.ui.loader-fallback';
6
+ import { useFallback } from '@teambit/react.ui.loader-fallback';
7
7
  import { ErrorBoundary } from 'react-error-boundary';
8
8
  import { ReactAspect } from './react.aspect';
9
9
 
@@ -20,11 +20,13 @@ export function CompositionsApp({
20
20
  const reactContext = previewContext.get(ReactAspect.id);
21
21
  const providers = reactContext?.providers || [];
22
22
 
23
+ const safeComposition = useFallback(Composition && <Composition />, <StandaloneNotFoundPage />);
24
+
23
25
  return (
24
26
  <ErrorBoundary FallbackComponent={ErrorFallback} resetKeys={[Composition]}>
25
27
  <Composer components={providers}>
26
28
  <style>{hideScrollbars}</style>
27
- <LoaderFallback Target={Composition} DefaultComponent={StandaloneNotFoundPage} />
29
+ {safeComposition}
28
30
  </Composer>
29
31
  </ErrorBoundary>
30
32
  );
@@ -86,15 +86,13 @@ function CompositionsApp({
86
86
  }) {
87
87
  const reactContext = previewContext.get(_react2().ReactAspect.id);
88
88
  const providers = (reactContext === null || reactContext === void 0 ? void 0 : reactContext.providers) || [];
89
+ const safeComposition = (0, _reactUi2().useFallback)(Composition && /*#__PURE__*/_react().default.createElement(Composition, null), /*#__PURE__*/_react().default.createElement(_designUiPages().StandaloneNotFoundPage, null));
89
90
  return /*#__PURE__*/_react().default.createElement(_reactErrorBoundary().ErrorBoundary, {
90
91
  FallbackComponent: _reactUi().ErrorFallback,
91
92
  resetKeys: [Composition]
92
93
  }, /*#__PURE__*/_react().default.createElement(_baseUiUtils().Composer, {
93
94
  components: providers
94
- }, /*#__PURE__*/_react().default.createElement("style", null, hideScrollbars), /*#__PURE__*/_react().default.createElement(_reactUi2().LoaderFallback, {
95
- Target: Composition,
96
- DefaultComponent: _designUiPages().StandaloneNotFoundPage
97
- })));
95
+ }, /*#__PURE__*/_react().default.createElement("style", null, hideScrollbars), safeComposition));
98
96
  }
99
97
 
100
98
  //# sourceMappingURL=compositions-app.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["compositions-app.tsx"],"names":["hideScrollbars","CompositionsApp","Composition","previewContext","reactContext","get","ReactAspect","id","providers","ErrorFallback","StandaloneNotFoundPage"],"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;;AAEA;AACA,MAAMA,cAAc,GAAG,0CAAvB;;AAEO,SAASC,eAAT,CAAyB;AAC9BC,EAAAA,WAD8B;AAE9BC,EAAAA;AAF8B,CAAzB,EAMJ;AACD,QAAMC,YAAY,GAAGD,cAAc,CAACE,GAAf,CAAmBC,sBAAYC,EAA/B,CAArB;AACA,QAAMC,SAAS,GAAG,CAAAJ,YAAY,SAAZ,IAAAA,YAAY,WAAZ,YAAAA,YAAY,CAAEI,SAAd,KAA2B,EAA7C;AAEA,sBACE,+BAAC,mCAAD;AAAe,IAAA,iBAAiB,EAAEC,wBAAlC;AAAiD,IAAA,SAAS,EAAE,CAACP,WAAD;AAA5D,kBACE,+BAAC,uBAAD;AAAU,IAAA,UAAU,EAAEM;AAAtB,kBACE,8CAAQR,cAAR,CADF,eAEE,+BAAC,0BAAD;AAAgB,IAAA,MAAM,EAAEE,WAAxB;AAAqC,IAAA,gBAAgB,EAAEQ;AAAvD,IAFF,CADF,CADF;AAQD","sourcesContent":["import React from 'react';\nimport { Composer } from '@teambit/base-ui.utils.composer';\nimport { StandaloneNotFoundPage } from '@teambit/design.ui.pages.standalone-not-found-page';\nimport { RenderingContext } from '@teambit/preview';\nimport { ErrorFallback } from '@teambit/react.ui.error-fallback';\nimport { LoaderFallback } from '@teambit/react.ui.loader-fallback';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { ReactAspect } from './react.aspect';\n\n// hide scrollbars so they won't be visible in the preview at the component card (and it's ok not to show them in the compositions page)\nconst hideScrollbars = 'body::-webkit-scrollbar {display: none;}';\n\nexport function CompositionsApp({\n Composition,\n previewContext,\n}: {\n Composition?: React.ComponentType;\n previewContext: RenderingContext;\n}) {\n const reactContext = previewContext.get(ReactAspect.id);\n const providers = reactContext?.providers || [];\n\n return (\n <ErrorBoundary FallbackComponent={ErrorFallback} resetKeys={[Composition]}>\n <Composer components={providers}>\n <style>{hideScrollbars}</style>\n <LoaderFallback Target={Composition} DefaultComponent={StandaloneNotFoundPage} />\n </Composer>\n </ErrorBoundary>\n );\n}\n"]}
1
+ {"version":3,"sources":["compositions-app.tsx"],"names":["hideScrollbars","CompositionsApp","Composition","previewContext","reactContext","get","ReactAspect","id","providers","safeComposition","ErrorFallback"],"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;;AAEA;AACA,MAAMA,cAAc,GAAG,0CAAvB;;AAEO,SAASC,eAAT,CAAyB;AAC9BC,EAAAA,WAD8B;AAE9BC,EAAAA;AAF8B,CAAzB,EAMJ;AACD,QAAMC,YAAY,GAAGD,cAAc,CAACE,GAAf,CAAmBC,sBAAYC,EAA/B,CAArB;AACA,QAAMC,SAAS,GAAG,CAAAJ,YAAY,SAAZ,IAAAA,YAAY,WAAZ,YAAAA,YAAY,CAAEI,SAAd,KAA2B,EAA7C;AAEA,QAAMC,eAAe,GAAG,6BAAYP,WAAW,iBAAI,+BAAC,WAAD,OAA3B,eAA4C,+BAAC,uCAAD,OAA5C,CAAxB;AAEA,sBACE,+BAAC,mCAAD;AAAe,IAAA,iBAAiB,EAAEQ,wBAAlC;AAAiD,IAAA,SAAS,EAAE,CAACR,WAAD;AAA5D,kBACE,+BAAC,uBAAD;AAAU,IAAA,UAAU,EAAEM;AAAtB,kBACE,8CAAQR,cAAR,CADF,EAEGS,eAFH,CADF,CADF;AAQD","sourcesContent":["import React from 'react';\nimport { Composer } from '@teambit/base-ui.utils.composer';\nimport { StandaloneNotFoundPage } from '@teambit/design.ui.pages.standalone-not-found-page';\nimport { RenderingContext } from '@teambit/preview';\nimport { ErrorFallback } from '@teambit/react.ui.error-fallback';\nimport { useFallback } from '@teambit/react.ui.loader-fallback';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { ReactAspect } from './react.aspect';\n\n// hide scrollbars so they won't be visible in the preview at the component card (and it's ok not to show them in the compositions page)\nconst hideScrollbars = 'body::-webkit-scrollbar {display: none;}';\n\nexport function CompositionsApp({\n Composition,\n previewContext,\n}: {\n Composition?: React.ComponentType;\n previewContext: RenderingContext;\n}) {\n const reactContext = previewContext.get(ReactAspect.id);\n const providers = reactContext?.providers || [];\n\n const safeComposition = useFallback(Composition && <Composition />, <StandaloneNotFoundPage />);\n\n return (\n <ErrorBoundary FallbackComponent={ErrorFallback} resetKeys={[Composition]}>\n <Composer components={providers}>\n <style>{hideScrollbars}</style>\n {safeComposition}\n </Composer>\n </ErrorBoundary>\n );\n}\n"]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/react",
3
- "version": "0.0.576",
3
+ "version": "0.0.580",
4
4
  "homepage": "https://bit.dev/teambit/react/react",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.react",
8
8
  "name": "react",
9
- "version": "0.0.576"
9
+ "version": "0.0.580"
10
10
  },
11
11
  "dependencies": {
12
12
  "react-error-boundary": "^3.0.0",
@@ -79,47 +79,47 @@
79
79
  "@teambit/react.instructions.react.adding-compositions": "0.0.6",
80
80
  "@teambit/react.instructions.react.adding-tests": "0.0.6",
81
81
  "@teambit/design.ui.pages.standalone-not-found-page": "0.0.354",
82
- "@teambit/preview": "0.0.576",
83
- "@teambit/react.ui.error-fallback": "0.0.99",
84
- "@teambit/react.ui.loader-fallback": "0.0.77",
85
- "@teambit/compositions.ui.hooks.use-composition": "0.0.152",
82
+ "@teambit/preview": "0.0.580",
83
+ "@teambit/react.ui.error-fallback": "0.0.100",
84
+ "@teambit/react.ui.loader-fallback": "0.0.79",
85
+ "@teambit/compositions.ui.hooks.use-composition": "0.0.153",
86
86
  "@teambit/design.ui.input.option-button": "0.0.26",
87
87
  "@teambit/design.ui.tooltip": "0.0.352",
88
- "@teambit/application": "0.0.218",
89
- "@teambit/bundler": "0.0.576",
90
- "@teambit/builder": "0.0.576",
91
- "@teambit/isolator": "0.0.576",
92
- "@teambit/toolbox.network.get-port": "0.0.102",
93
- "@teambit/compiler": "0.0.576",
94
- "@teambit/component.modules.component-url": "0.0.109",
95
- "@teambit/component": "0.0.576",
96
- "@teambit/envs": "0.0.576",
97
- "@teambit/eslint": "0.0.576",
98
- "@teambit/formatter": "0.0.127",
99
- "@teambit/jest": "0.0.576",
100
- "@teambit/linter": "0.0.576",
101
- "@teambit/pkg": "0.0.576",
102
- "@teambit/prettier": "0.0.127",
103
- "@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.9",
104
- "@teambit/schema": "0.0.576",
105
- "@teambit/tester": "0.0.576",
106
- "@teambit/typescript": "0.0.576",
107
- "@teambit/webpack": "0.0.576",
108
- "@teambit/workspace": "0.0.576",
109
- "@teambit/cli": "0.0.398",
110
- "@teambit/dependency-resolver": "0.0.576",
111
- "@teambit/generator": "0.0.576",
112
- "@teambit/graphql": "0.0.576",
113
- "@teambit/react.ui.highlighter-provider": "0.0.164",
114
- "@teambit/compositions": "0.0.576",
115
- "@teambit/ui": "0.0.576",
116
- "@teambit/react.eslint-config-bit-react": "0.0.476",
117
- "@teambit/mdx.modules.mdx-loader": "0.0.476",
118
- "@teambit/react.babel.bit-react-transformer": "0.0.483",
119
- "@teambit/webpack.modules.generate-style-loaders": "0.0.92",
120
- "@teambit/webpack.modules.style-regexps": "0.0.121",
121
- "@teambit/component-id": "0.0.388",
122
- "@teambit/config": "0.0.410"
88
+ "@teambit/application": "0.0.222",
89
+ "@teambit/bundler": "0.0.580",
90
+ "@teambit/builder": "0.0.580",
91
+ "@teambit/isolator": "0.0.580",
92
+ "@teambit/toolbox.network.get-port": "0.0.103",
93
+ "@teambit/compiler": "0.0.580",
94
+ "@teambit/component.modules.component-url": "0.0.110",
95
+ "@teambit/component": "0.0.580",
96
+ "@teambit/envs": "0.0.580",
97
+ "@teambit/eslint": "0.0.580",
98
+ "@teambit/formatter": "0.0.131",
99
+ "@teambit/jest": "0.0.580",
100
+ "@teambit/linter": "0.0.580",
101
+ "@teambit/pkg": "0.0.580",
102
+ "@teambit/prettier": "0.0.131",
103
+ "@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.11",
104
+ "@teambit/schema": "0.0.580",
105
+ "@teambit/tester": "0.0.580",
106
+ "@teambit/typescript": "0.0.580",
107
+ "@teambit/webpack": "0.0.580",
108
+ "@teambit/workspace": "0.0.580",
109
+ "@teambit/cli": "0.0.399",
110
+ "@teambit/dependency-resolver": "0.0.580",
111
+ "@teambit/generator": "0.0.580",
112
+ "@teambit/graphql": "0.0.580",
113
+ "@teambit/react.ui.highlighter-provider": "0.0.167",
114
+ "@teambit/compositions": "0.0.580",
115
+ "@teambit/ui": "0.0.580",
116
+ "@teambit/react.eslint-config-bit-react": "0.0.477",
117
+ "@teambit/mdx.modules.mdx-loader": "0.0.477",
118
+ "@teambit/react.babel.bit-react-transformer": "0.0.485",
119
+ "@teambit/webpack.modules.generate-style-loaders": "0.0.93",
120
+ "@teambit/webpack.modules.style-regexps": "0.0.122",
121
+ "@teambit/component-id": "0.0.389",
122
+ "@teambit/config": "0.0.411"
123
123
  },
124
124
  "devDependencies": {
125
125
  "@types/react": "^17.0.8",
@@ -134,10 +134,10 @@
134
134
  "@types/mocha": "5.2.7",
135
135
  "@types/testing-library__jest-dom": "5.9.5",
136
136
  "@types/jest": "^26.0.0",
137
- "@teambit/react.aspect-docs.react": "0.0.120"
137
+ "@teambit/react.aspect-docs.react": "0.0.121"
138
138
  },
139
139
  "peerDependencies": {
140
- "@teambit/legacy": "1.0.184",
140
+ "@teambit/legacy": "1.0.185",
141
141
  "react-dom": "^16.8.0 || ^17.0.0",
142
142
  "react": "^16.8.0 || ^17.0.0"
143
143
  },
@@ -199,7 +199,7 @@
199
199
  "@types/jest": "^26.0.0"
200
200
  },
201
201
  "peerDependencies": {
202
- "@teambit/legacy": "1.0.184",
202
+ "@teambit/legacy": "1.0.185",
203
203
  "react-dom": "^16.8.0 || ^17.0.0",
204
204
  "react": "^16.8.0 || ^17.0.0"
205
205
  }