react-cosmos-dom
Advanced tools
Comparing version 6.0.0-canary.6d9c90c.0 to 6.0.0-canary.6f7532d.0
@@ -1,12 +0,9 @@ | ||
import { ReactDecorators, ReactFixtureWrappers } from 'react-cosmos-core'; | ||
import { UserModuleWrappers } from 'react-cosmos-core'; | ||
type Props = { | ||
fixtures: ReactFixtureWrappers; | ||
decorators: ReactDecorators; | ||
moduleWrappers: UserModuleWrappers; | ||
playgroundUrl: string; | ||
onErrorReset?: () => unknown; | ||
}; | ||
export declare function DomFixtureLoader({ fixtures, decorators, playgroundUrl, onErrorReset, }: Props): JSX.Element; | ||
export declare function renderDomMessage({ msg }: { | ||
msg: string; | ||
}): JSX.Element; | ||
export declare function DomFixtureLoader(props: Props): JSX.Element; | ||
export declare function renderDomMessage(msg: string): JSX.Element; | ||
export {}; |
import React, { useEffect, useMemo } from 'react'; | ||
import { FixtureLoader, } from 'react-cosmos-core'; | ||
import { FixtureConnect } from 'react-cosmos-core'; | ||
import { createDomRendererConnect } from './domRendererConnect.js'; | ||
@@ -7,3 +7,4 @@ import { domRendererId } from './domRendererId.js'; | ||
import { selectedFixtureId } from './selectedFixtureId.js'; | ||
export function DomFixtureLoader({ fixtures, decorators, playgroundUrl, onErrorReset, }) { | ||
export function DomFixtureLoader(props) { | ||
const { moduleWrappers, playgroundUrl, onErrorReset } = props; | ||
const domRendererConnect = useMemo(() => createDomRendererConnect(playgroundUrl), [playgroundUrl]); | ||
@@ -26,4 +27,5 @@ useEffect(() => { | ||
}, [domRendererConnect]); | ||
return (React.createElement(FixtureLoader, { rendererId: domRendererId, rendererConnect: domRendererConnect, fixtures: fixtures, selectedFixtureId: selectedFixtureId, systemDecorators: [ErrorCatch], userDecorators: decorators, renderMessage: renderDomMessage, onErrorReset: onErrorReset })); | ||
return (React.createElement(FixtureConnect, { rendererId: domRendererId, rendererConnect: domRendererConnect, moduleWrappers: moduleWrappers, systemDecorators: systemDecorators, selectedFixtureId: selectedFixtureId, renderMessage: renderDomMessage, onErrorReset: onErrorReset })); | ||
} | ||
const systemDecorators = [ErrorCatch]; | ||
const containerStyle = { | ||
@@ -41,4 +43,4 @@ position: 'absolute', | ||
}; | ||
export function renderDomMessage({ msg }) { | ||
export function renderDomMessage(msg) { | ||
return React.createElement("div", { style: containerStyle }, msg); | ||
} |
@@ -1,10 +0,9 @@ | ||
import { ReactDecorators, ReactFixtureWrappers } from 'react-cosmos-core'; | ||
import { UserModuleWrappers } from 'react-cosmos-core'; | ||
import { DomRendererConfig } from './types.js'; | ||
type Args = { | ||
rendererConfig: DomRendererConfig; | ||
fixtures: ReactFixtureWrappers; | ||
decorators: ReactDecorators; | ||
moduleWrappers: UserModuleWrappers; | ||
onErrorReset?: () => unknown; | ||
}; | ||
export declare function mountDomRenderer({ rendererConfig, fixtures, decorators, onErrorReset, }: Args): void; | ||
export declare function mountDomRenderer({ rendererConfig, moduleWrappers, onErrorReset, }: Args): void; | ||
export {}; |
@@ -6,3 +6,3 @@ import React from 'react'; | ||
let cachedRoot = null; | ||
export function mountDomRenderer({ rendererConfig, fixtures, decorators, onErrorReset, }) { | ||
export function mountDomRenderer({ rendererConfig, moduleWrappers, onErrorReset, }) { | ||
const domContainer = getDomContainer(rendererConfig.containerQuerySelector); | ||
@@ -13,3 +13,3 @@ if (!cachedRoot || cachedRoot.domContainer !== domContainer) { | ||
} | ||
cachedRoot.reactRoot.render(React.createElement(DomFixtureLoader, { fixtures: fixtures, decorators: decorators, playgroundUrl: rendererConfig.playgroundUrl, onErrorReset: onErrorReset })); | ||
cachedRoot.reactRoot.render(React.createElement(DomFixtureLoader, { moduleWrappers: moduleWrappers, playgroundUrl: rendererConfig.playgroundUrl, onErrorReset: onErrorReset })); | ||
} |
{ | ||
"name": "react-cosmos-dom", | ||
"version": "6.0.0-canary.6d9c90c.0+6d9c90c", | ||
"version": "6.0.0-canary.6f7532d.0+6f7532d", | ||
"description": "React Cosmos DOM", | ||
@@ -11,5 +11,5 @@ "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.6d9c90c.0+6d9c90c" | ||
"react-cosmos-core": "6.0.0-canary.6f7532d.0+6f7532d" | ||
}, | ||
"gitHead": "6d9c90c0d4eed8f2dd73759bfd64547e4fdbfac0" | ||
"gitHead": "6f7532d89534db7898bbea8586ab89d0516c9140" | ||
} |
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
11762
240
- Removedjs-base64@3.7.7(transitive)
- Removedreact-cosmos-core@6.2.0(transitive)
- Removedreact-is@18.3.1(transitive)