@teambit/react 0.0.578 → 0.0.579

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.578",
3
+ "version": "0.0.579",
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.578"
9
+ "version": "0.0.579"
10
10
  },
11
11
  "dependencies": {
12
12
  "react-error-boundary": "^3.0.0",
@@ -79,40 +79,40 @@
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.578",
82
+ "@teambit/preview": "0.0.579",
83
83
  "@teambit/react.ui.error-fallback": "0.0.100",
84
- "@teambit/react.ui.loader-fallback": "0.0.78",
84
+ "@teambit/react.ui.loader-fallback": "0.0.79",
85
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.220",
89
- "@teambit/bundler": "0.0.578",
90
- "@teambit/builder": "0.0.578",
91
- "@teambit/isolator": "0.0.578",
88
+ "@teambit/application": "0.0.221",
89
+ "@teambit/bundler": "0.0.579",
90
+ "@teambit/builder": "0.0.579",
91
+ "@teambit/isolator": "0.0.579",
92
92
  "@teambit/toolbox.network.get-port": "0.0.103",
93
- "@teambit/compiler": "0.0.578",
93
+ "@teambit/compiler": "0.0.579",
94
94
  "@teambit/component.modules.component-url": "0.0.110",
95
- "@teambit/component": "0.0.578",
96
- "@teambit/envs": "0.0.578",
97
- "@teambit/eslint": "0.0.578",
98
- "@teambit/formatter": "0.0.129",
99
- "@teambit/jest": "0.0.578",
100
- "@teambit/linter": "0.0.578",
101
- "@teambit/pkg": "0.0.578",
102
- "@teambit/prettier": "0.0.129",
95
+ "@teambit/component": "0.0.579",
96
+ "@teambit/envs": "0.0.579",
97
+ "@teambit/eslint": "0.0.579",
98
+ "@teambit/formatter": "0.0.130",
99
+ "@teambit/jest": "0.0.579",
100
+ "@teambit/linter": "0.0.579",
101
+ "@teambit/pkg": "0.0.579",
102
+ "@teambit/prettier": "0.0.130",
103
103
  "@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.10",
104
- "@teambit/schema": "0.0.578",
105
- "@teambit/tester": "0.0.578",
106
- "@teambit/typescript": "0.0.578",
107
- "@teambit/webpack": "0.0.578",
108
- "@teambit/workspace": "0.0.578",
104
+ "@teambit/schema": "0.0.579",
105
+ "@teambit/tester": "0.0.579",
106
+ "@teambit/typescript": "0.0.579",
107
+ "@teambit/webpack": "0.0.579",
108
+ "@teambit/workspace": "0.0.579",
109
109
  "@teambit/cli": "0.0.399",
110
- "@teambit/dependency-resolver": "0.0.578",
111
- "@teambit/generator": "0.0.578",
112
- "@teambit/graphql": "0.0.578",
110
+ "@teambit/dependency-resolver": "0.0.579",
111
+ "@teambit/generator": "0.0.579",
112
+ "@teambit/graphql": "0.0.579",
113
113
  "@teambit/react.ui.highlighter-provider": "0.0.166",
114
- "@teambit/compositions": "0.0.578",
115
- "@teambit/ui": "0.0.578",
114
+ "@teambit/compositions": "0.0.579",
115
+ "@teambit/ui": "0.0.579",
116
116
  "@teambit/react.eslint-config-bit-react": "0.0.477",
117
117
  "@teambit/mdx.modules.mdx-loader": "0.0.477",
118
118
  "@teambit/react.babel.bit-react-transformer": "0.0.484",