react-cosmos-dom
Advanced tools
Comparing version 6.0.0-canary.86644b2.0 to 6.0.0-canary.90db9bd.0
@@ -1,2 +0,2 @@ | ||
/// <reference types="react" /> | ||
import React from 'react'; | ||
import { RendererConfig, UserModuleWrappers } from 'react-cosmos-core'; | ||
@@ -7,3 +7,3 @@ type Props = { | ||
}; | ||
export declare function DomFixtureLoader({ rendererConfig, moduleWrappers }: Props): JSX.Element; | ||
export declare function DomFixtureLoader({ rendererConfig, moduleWrappers }: Props): React.JSX.Element; | ||
export {}; |
@@ -7,3 +7,3 @@ import React from 'react'; | ||
}; | ||
export declare function DomRendererProvider({ children, rendererConfig }: Props): JSX.Element; | ||
export declare function DomRendererProvider({ children, rendererConfig }: Props): React.JSX.Element; | ||
export {}; |
@@ -11,3 +11,3 @@ 'use client'; | ||
const rendererId = useDomRendererId(); | ||
const rendererConnect = useDomRendererConnect(rendererConfig); | ||
const rendererConnect = useDomRendererConnect(rendererConfig.playgroundUrl); | ||
const { locked = false, fixtureId = null } = React.useMemo(() => parseRendererQueryString(location.search), []); | ||
@@ -14,0 +14,0 @@ return (React.createElement(StatefulRendererProvider, { rendererId: rendererId, rendererConnect: rendererConnect, locked: locked, selectedFixtureId: fixtureId, reloadRenderer: reloadDomRenderer }, |
@@ -20,5 +20,5 @@ import React from 'react'; | ||
componentDidUpdate(prevProps: Props): void; | ||
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined; | ||
renderError(error: string): JSX.Element; | ||
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined; | ||
renderError(error: string): React.JSX.Element; | ||
} | ||
export {}; |
@@ -1,2 +0,1 @@ | ||
import { RendererConfig } from 'react-cosmos-core'; | ||
export declare function useDomRendererConnect(rendererConfig: RendererConfig): import("react-cosmos-core").RendererConnect; | ||
export declare function useDomRendererConnect(playgroundUrl: string): import("react-cosmos-core").RendererConnect; |
@@ -5,4 +5,5 @@ 'use client'; | ||
import { createNoopRendererConnect, createPostMessageConnect, createWebSocketsConnect, } from 'react-cosmos-renderer'; | ||
export function useDomRendererConnect(rendererConfig) { | ||
return React.useMemo(() => createDomRendererConnect(rendererConfig.playgroundUrl), [rendererConfig.playgroundUrl]); | ||
import { createWebSocketsUrl } from './createWebSocketsUrl.js'; | ||
export function useDomRendererConnect(playgroundUrl) { | ||
return React.useMemo(() => createDomRendererConnect(playgroundUrl), [playgroundUrl]); | ||
} | ||
@@ -17,7 +18,4 @@ function createDomRendererConnect(playgroundUrl) { | ||
? createPostMessageConnect() | ||
: createWebSocketsConnect(getWebSocketsUrl(playgroundUrl)); | ||
: createWebSocketsConnect(createWebSocketsUrl(playgroundUrl)); | ||
} | ||
} | ||
function getWebSocketsUrl(playgroundUrl) { | ||
return playgroundUrl.replace(/^https?:/, 'ws:'); | ||
} |
{ | ||
"name": "react-cosmos-dom", | ||
"version": "6.0.0-canary.86644b2.0+86644b2", | ||
"version": "6.0.0-canary.90db9bd.0+90db9bd", | ||
"description": "React Cosmos DOM", | ||
@@ -11,6 +11,6 @@ "repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos-dom", | ||
"lodash-es": "^4.17.21", | ||
"react-cosmos-core": "6.0.0-canary.86644b2.0+86644b2", | ||
"react-cosmos-renderer": "6.0.0-canary.86644b2.0+86644b2" | ||
"react-cosmos-core": "6.0.0-canary.90db9bd.0+90db9bd", | ||
"react-cosmos-renderer": "6.0.0-canary.90db9bd.0+90db9bd" | ||
}, | ||
"gitHead": "86644b27e838006a0b58c8e917fa1b10e92c956b" | ||
"gitHead": "90db9bd91b7b1c6739b804921e8e2398d4841ce5" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
12428
26
264