react-cosmos-dom 6.0.0-beta.1 → 6.0.0-beta.11
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.
- package/dist/DomFixtureLoader.d.ts +2 -2
- package/dist/DomRendererProvider.d.ts +1 -1
- package/dist/ErrorCatch.d.ts +2 -2
- package/dist/ErrorCatch.js +1 -2
- package/dist/createWebSocketsUrl.d.ts +1 -0
- package/dist/createWebSocketsUrl.js +3 -0
- package/dist/useDomRendererConnect.js +2 -4
- package/package.json +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { RendererConfig, UserModuleWrappers } from 'react-cosmos-core';
|
|
3
3
|
type Props = {
|
|
4
4
|
rendererConfig: RendererConfig;
|
|
5
5
|
moduleWrappers: UserModuleWrappers;
|
|
6
6
|
};
|
|
7
|
-
export declare function DomFixtureLoader({ rendererConfig, moduleWrappers }: Props): JSX.Element;
|
|
7
|
+
export declare function DomFixtureLoader({ rendererConfig, moduleWrappers }: Props): React.JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -4,5 +4,5 @@ type Props = {
|
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
rendererConfig: RendererConfig;
|
|
6
6
|
};
|
|
7
|
-
export declare function DomRendererProvider({ children, rendererConfig }: Props): JSX.Element;
|
|
7
|
+
export declare function DomRendererProvider({ children, rendererConfig }: Props): React.JSX.Element;
|
|
8
8
|
export {};
|
package/dist/ErrorCatch.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare class ErrorCatch extends React.Component<Props, State> {
|
|
|
17
17
|
}): void;
|
|
18
18
|
componentDidMount(): void;
|
|
19
19
|
componentDidUpdate(prevProps: Props): void;
|
|
20
|
-
render(): string | number | boolean | React.
|
|
21
|
-
renderError(error: string): JSX.Element;
|
|
20
|
+
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
21
|
+
renderError(error: string): React.JSX.Element;
|
|
22
22
|
}
|
|
23
23
|
export {};
|
package/dist/ErrorCatch.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isEqual } from 'lodash-es';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { areNodesEqual } from 'react-cosmos-core';
|
|
4
4
|
import { FixtureContext, } from 'react-cosmos-renderer/client';
|
|
5
|
-
class ErrorCatch extends React.Component {
|
|
5
|
+
export class ErrorCatch extends React.Component {
|
|
6
6
|
static contextType = FixtureContext;
|
|
7
7
|
static prevContext = null;
|
|
8
8
|
state = {
|
|
@@ -40,7 +40,6 @@ class ErrorCatch extends React.Component {
|
|
|
40
40
|
React.createElement("p", null, "Check console for more info.")));
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
export { ErrorCatch };
|
|
44
43
|
function fixtureChanged(f1, f2) {
|
|
45
44
|
return !areNodesEqual(f1, f2, true);
|
|
46
45
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createWebSocketsUrl(playgroundUrl: string): string;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { isInsideWindowIframe } from 'react-cosmos-core';
|
|
4
4
|
import { createNoopRendererConnect, createPostMessageConnect, createWebSocketsConnect, } from 'react-cosmos-renderer';
|
|
5
|
+
import { createWebSocketsUrl } from './createWebSocketsUrl.js';
|
|
5
6
|
export function useDomRendererConnect(playgroundUrl) {
|
|
6
7
|
return React.useMemo(() => createDomRendererConnect(playgroundUrl), [playgroundUrl]);
|
|
7
8
|
}
|
|
@@ -13,9 +14,6 @@ function createDomRendererConnect(playgroundUrl) {
|
|
|
13
14
|
else {
|
|
14
15
|
return isInsideWindowIframe()
|
|
15
16
|
? createPostMessageConnect()
|
|
16
|
-
: createWebSocketsConnect(
|
|
17
|
+
: createWebSocketsConnect(createWebSocketsUrl(playgroundUrl));
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
function getWebSocketsUrl(playgroundUrl) {
|
|
20
|
-
return playgroundUrl.replace(/^https?:/, 'ws:');
|
|
21
|
-
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cosmos-dom",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.11",
|
|
4
4
|
"description": "React Cosmos DOM",
|
|
5
5
|
"repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos-dom",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"lodash-es": "
|
|
11
|
-
"react-cosmos-core": "6.0.0-beta.
|
|
12
|
-
"react-cosmos-renderer": "6.0.0-beta.
|
|
10
|
+
"lodash-es": "4.17.21",
|
|
11
|
+
"react-cosmos-core": "6.0.0-beta.11",
|
|
12
|
+
"react-cosmos-renderer": "6.0.0-beta.11"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "53cb725c41af2e513a6f76eac2b0a4027d2afaea"
|
|
15
15
|
}
|