react-cosmos-renderer 7.2.1-canary.e6e39db.0 → 7.3.1-canary.238df28.0
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/fixture/FixtureCapture/FixtureCapture.d.ts +1 -1
- package/dist/fixture/FixtureCapture/FixtureCapture.js +1 -0
- package/dist/fixture/FixtureCapture/classState/decorateFixtureRefs/index.d.ts +2 -2
- package/dist/fixture/FixtureCapture/classState/decorateFixtureRefs/index.js +1 -1
- package/dist/fixture/FixtureCapture/classState/index.d.ts +1 -1
- package/dist/fixture/FixtureCapture/classState/shared.d.ts +2 -1
- package/dist/fixture/FixtureCapture/classState/shared.js +1 -0
- package/dist/fixture/FixtureCapture/classState/useFixtureClassState.d.ts +3 -3
- package/dist/fixture/FixtureCapture/classState/useFixtureClassState.js +2 -2
- package/dist/fixture/FixtureCapture/classState/useReadClassState.d.ts +3 -3
- package/dist/fixture/FixtureCapture/props/index.d.ts +2 -2
- package/dist/fixture/FixtureCapture/props/useFixtureProps.d.ts +1 -1
- package/dist/fixture/FixtureCapture/shared/findRelevantElementPaths.js +1 -0
- package/dist/fixture/FixtureCapture/shared/nodeTree/findElementPaths.js +1 -1
- package/dist/fixture/FixtureCapture/shared/nodeTree/getElementAtPath.d.ts +2 -2
- package/dist/fixture/FixtureCapture/shared/nodeTree/getElementAtPath.js +1 -1
- package/dist/fixture/FixtureCapture/shared/nodeTree/setElementAtPath.d.ts +2 -2
- package/dist/fixture/FixtureContext.d.ts +1 -1
- package/dist/fixture/Viewport.d.ts +0 -1
- package/dist/fixture/useCosmosNotification/useCosmosNotification.d.ts +1 -1
- package/dist/fixture/useFixtureInput/useFixtureInput.d.ts +1 -1
- package/dist/fixture/useFixtureInput/useInputFixtureState.js +1 -1
- package/dist/fixture/useFixtureInput/useSetInputValue.d.ts +1 -1
- package/dist/fixture/useFixtureInput/useSetInputValue.js +1 -1
- package/dist/fixture/useFixtureInput/useValue.d.ts +1 -1
- package/dist/fixture/useFixtureSelect/shared.d.ts +1 -1
- package/dist/fixture/useFixtureSelect/useCurrentSelectValue.d.ts +1 -1
- package/dist/fixture/useFixtureSelect/useFixtureSelect.d.ts +1 -1
- package/dist/fixture/useFixtureSelect/useSelect.d.ts +1 -1
- package/dist/fixture/useFixtureSelect/useSelectFixtureState.d.ts +1 -1
- package/dist/fixture/useFixtureSelect/useSetSelectValue.d.ts +1 -1
- package/dist/fixture/useFixtureState.d.ts +1 -1
- package/dist/fixture/useFixtureState.js +1 -1
- package/dist/fixtureLoaders/ClientFixtureLoader.d.ts +2 -2
- package/dist/fixtureLoaders/FixtureLoaderConnect.d.ts +3 -3
- package/dist/fixtureLoaders/FixtureLoaderConnect.js +1 -1
- package/dist/fixtureLoaders/RendererSync.d.ts +1 -1
- package/dist/fixtureLoaders/SelectedFixture.d.ts +1 -1
- package/dist/fixtureLoaders/ServerFixtureLoader.d.ts +3 -3
- package/dist/fixtureLoaders/ServerFixtureLoader.js +1 -5
- package/dist/fixtureModule/DecoratedFixture.d.ts +2 -2
- package/dist/fixtureModule/FixtureModule.d.ts +2 -2
- package/dist/fixtureModule/FixtureProvider.d.ts +1 -1
- package/dist/fixtureModule/FixtureProvider.js +1 -1
- package/dist/fixtureModule/createFixtureNode.d.ts +10 -1
- package/dist/fixtureModule/decorateFixture.d.ts +1 -1
- package/dist/moduleLoaders/AsyncModuleLoader.d.ts +2 -2
- package/dist/moduleLoaders/AsyncModuleLoader.js +2 -1
- package/dist/moduleLoaders/LazyModuleLoader.d.ts +2 -2
- package/dist/moduleLoaders/LazyModuleLoader.js +1 -1
- package/dist/moduleLoaders/StaticModuleLoader.d.ts +2 -2
- package/dist/moduleLoaders/StaticModuleLoader.js +1 -1
- package/dist/moduleLoaders/importLazyFixtureModules.d.ts +1 -1
- package/dist/rendererConnect/RendererContext.d.ts +2 -2
- package/dist/rendererConnect/RendererProvider.d.ts +2 -2
- package/dist/rendererConnect/StatefulRendererProvider.d.ts +1 -1
- package/dist/rendererConnect/createNoopRendererConnect.d.ts +1 -1
- package/dist/rendererConnect/createPostMessageConnect.d.ts +1 -1
- package/dist/rendererConnect/createPostMessageConnect.js +1 -1
- package/dist/rendererConnect/createWebSocketsConnect.d.ts +1 -1
- package/dist/rendererConnect/createWebSocketsConnect.js +1 -1
- package/package.json +3 -3
- package/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// 1. Props of client side components used in server fixtures.
|
|
7
7
|
// 2. Props of native elements rendered by server components (eg. div, p, etc.)
|
|
8
8
|
'use client';
|
|
9
|
+
import React from 'react';
|
|
9
10
|
import { useClassStateCapture } from './classState/index.js';
|
|
10
11
|
import { usePropsCapture } from './props/index.js';
|
|
11
12
|
export function FixtureCapture({ children, decoratorId }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component, ReactNode } from 'react';
|
|
2
|
-
import { CachedRefHandlers } from '../shared.js';
|
|
1
|
+
import type { Component, ReactNode } from 'react';
|
|
2
|
+
import type { CachedRefHandlers } from '../shared.js';
|
|
3
3
|
type SpyRef = (elPath: string, elRef: null | Component) => unknown;
|
|
4
4
|
export declare function decorateFixtureRefs(fixture: ReactNode, spyRef: SpyRef, cachedRefHandlers: CachedRefHandlers): ReactNode;
|
|
5
5
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cloneElement
|
|
1
|
+
import { cloneElement } from 'react';
|
|
2
2
|
import { findRelevantElementPaths } from '../../shared/findRelevantElementPaths.js';
|
|
3
3
|
import { setElementAtPath } from '../../shared/nodeTree/index.js';
|
|
4
4
|
import { isRefSupported } from './isRefSupported.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, RefObject } from 'react';
|
|
2
|
-
import { FixtureDecoratorId } from 'react-cosmos-core';
|
|
3
|
-
import { ElRefs } from './shared.js';
|
|
1
|
+
import type { ReactNode, RefObject } from 'react';
|
|
2
|
+
import type { FixtureDecoratorId } from 'react-cosmos-core';
|
|
3
|
+
import type { ElRefs } from './shared.js';
|
|
4
4
|
export declare function useFixtureClassState(fixture: ReactNode, decoratorId: FixtureDecoratorId, elRefs: RefObject<ElRefs>): ReactNode;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useEffect, useRef
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
2
|
import { isEqual } from 'react-cosmos-core';
|
|
3
3
|
import { createClassStateFixtureStateItem, createValues, extendWithValues, filterClassStateFixtureState, findClassStateFixtureStateItem, getComponentName, removeClassStateFixtureStateItem, } from 'react-cosmos-core';
|
|
4
4
|
import { useFixtureState } from '../../useFixtureState.js';
|
|
5
5
|
import { findRelevantElementPaths } from '../shared/findRelevantElementPaths.js';
|
|
6
6
|
import { decorateFixtureRefs } from './decorateFixtureRefs/index.js';
|
|
7
|
-
import { replaceState
|
|
7
|
+
import { replaceState } from './shared.js';
|
|
8
8
|
export function useFixtureClassState(fixture, decoratorId, elRefs) {
|
|
9
9
|
const elPaths = findRelevantElementPaths(fixture);
|
|
10
10
|
const [classStateFs, setClassStateFs] = useFixtureState('classState');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, RefObject } from 'react';
|
|
2
|
-
import { FixtureDecoratorId } from 'react-cosmos-core';
|
|
3
|
-
import { ElRefs } from './shared.js';
|
|
1
|
+
import type { ReactNode, RefObject } from 'react';
|
|
2
|
+
import type { FixtureDecoratorId } from 'react-cosmos-core';
|
|
3
|
+
import type { ElRefs } from './shared.js';
|
|
4
4
|
export declare function useReadClassState(fixture: ReactNode, decoratorId: FixtureDecoratorId, elRefs: RefObject<ElRefs>): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { FixtureDecoratorId } from 'react-cosmos-core';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FixtureDecoratorId } from 'react-cosmos-core';
|
|
3
3
|
export declare function usePropsCapture(fixture: ReactNode, decoratorId: FixtureDecoratorId): ReactNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FixtureDecoratorId, PropsFixtureState } from 'react-cosmos-core';
|
|
2
|
+
import type { FixtureDecoratorId, PropsFixtureState } from 'react-cosmos-core';
|
|
3
3
|
export declare function useFixtureProps(fixture: React.ReactNode, propsFs: PropsFixtureState | undefined, decoratorId: FixtureDecoratorId): React.ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ReactElementWithChildren } from 'react-cosmos-core';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ReactElementWithChildren } from 'react-cosmos-core';
|
|
3
3
|
export declare function getElementAtPath(node: ReactNode, elPath: string): null | ReactElementWithChildren;
|
|
4
4
|
export declare function getExpectedElementAtPath(node: ReactNode, elPath: string): ReactElementWithChildren;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getByPath, isReactElement
|
|
1
|
+
import { getByPath, isReactElement } from 'react-cosmos-core';
|
|
2
2
|
import { isRootPath } from './elPath.js';
|
|
3
3
|
// Why be silent about trying to fetch a node that isn't an element?
|
|
4
4
|
// Because users of this utility only care about elements. Whether the child
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ReactElementWithChildren } from 'react-cosmos-core';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ReactElementWithChildren } from 'react-cosmos-core';
|
|
3
3
|
export declare function setElementAtPath(node: ReactNode, elPath: string, updater: (el: ReactElementWithChildren) => ReactElementWithChildren): ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FixtureState, SetFixtureState } from 'react-cosmos-core';
|
|
2
|
+
import type { FixtureState, SetFixtureState } from 'react-cosmos-core';
|
|
3
3
|
export type FixtureContextValue = {
|
|
4
4
|
fixtureState: FixtureState;
|
|
5
5
|
setFixtureState: SetFixtureState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NotificationItem, TimedNotificationItem } from 'react-cosmos-core';
|
|
1
|
+
import type { NotificationItem, TimedNotificationItem } from 'react-cosmos-core';
|
|
2
2
|
type UseCosmosNotificationReturn = {
|
|
3
3
|
pushSticky(notification: NotificationItem): void;
|
|
4
4
|
removeSticky(notificationId: string): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react-cosmos-core';
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react-cosmos-core';
|
|
2
2
|
export declare function useFixtureInput<T>(inputName: string, defaultValue: T): [T, Dispatch<SetStateAction<T>>];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { createValue, extendWithValue, isEqual
|
|
2
|
+
import { createValue, extendWithValue, isEqual } from 'react-cosmos-core';
|
|
3
3
|
import { useFixtureState } from '../useFixtureState.js';
|
|
4
4
|
export function useInputFixtureState(inputName, defaultValue) {
|
|
5
5
|
const [, setFixtureState] = useFixtureState('inputs');
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react-cosmos-core';
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react-cosmos-core';
|
|
2
2
|
export declare function useSetInputValue<T>(inputName: string, defaultValue: T): Dispatch<SetStateAction<T>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { createValue, extendWithValue
|
|
2
|
+
import { createValue, extendWithValue } from 'react-cosmos-core';
|
|
3
3
|
import { useFixtureState } from '../useFixtureState.js';
|
|
4
4
|
export function useSetInputValue(inputName, defaultValue) {
|
|
5
5
|
const [, setFixtureState] = useFixtureState('inputs');
|
|
@@ -7,5 +7,5 @@ export type UseSelectArgs<Option extends string> = {
|
|
|
7
7
|
defaultValue?: Option;
|
|
8
8
|
};
|
|
9
9
|
export type SetSelectValue<Option extends string> = (value: Option) => void;
|
|
10
|
-
export declare function getDefaultSelectValue<Option extends string>({ options, defaultValue
|
|
10
|
+
export declare function getDefaultSelectValue<Option extends string>({ options, defaultValue }: UseSelectArgs<Option>): Option;
|
|
11
11
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UseSelectArgs } from './shared.js';
|
|
1
|
+
import type { UseSelectArgs } from './shared.js';
|
|
2
2
|
export declare function useCurrentSelectValue<Option extends string>(selectName: string, args: UseSelectArgs<Option>): Option;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SetSelectValue, UseSelectArgs } from './shared.js';
|
|
1
|
+
import type { SetSelectValue, UseSelectArgs } from './shared.js';
|
|
2
2
|
export declare function useFixtureSelect<Option extends string>(selectName: string, args: UseSelectArgs<Option>): [Option, SetSelectValue<Option>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SetSelectValue, UseSelectArgs } from './shared.js';
|
|
1
|
+
import type { SetSelectValue, UseSelectArgs } from './shared.js';
|
|
2
2
|
export declare function useSelect<Option extends string>(selectName: string, args: UseSelectArgs<Option>): [Option, SetSelectValue<Option>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UseSelectArgs } from './shared.js';
|
|
1
|
+
import type { UseSelectArgs } from './shared.js';
|
|
2
2
|
export declare function useSelectFixtureState<Option extends string>(selectName: string, args: UseSelectArgs<Option>): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SetSelectValue } from './shared.js';
|
|
1
|
+
import type { SetSelectValue } from './shared.js';
|
|
2
2
|
export declare function useSetSelectValue<Option extends string>(selectName: string): SetSelectValue<Option>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FixtureStateChange } from 'react-cosmos-core';
|
|
1
|
+
import type { FixtureStateChange } from 'react-cosmos-core';
|
|
2
2
|
export declare function useFixtureState<T>(name: string): readonly [T | undefined, (change: FixtureStateChange<T>) => void];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useContext } from 'react';
|
|
2
|
-
import { fixtureStateByName, updateFixtureState
|
|
2
|
+
import { fixtureStateByName, updateFixtureState } from 'react-cosmos-core';
|
|
3
3
|
import { FixtureContext } from './FixtureContext.js';
|
|
4
4
|
export function useFixtureState(name) {
|
|
5
5
|
const { fixtureState, setFixtureState } = useContext(FixtureContext);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ReactDecorator, UserModuleWrappers } from 'react-cosmos-core';
|
|
2
|
+
import type { ReactDecorator, UserModuleWrappers } from 'react-cosmos-core';
|
|
3
3
|
type Props = {
|
|
4
4
|
moduleWrappers: UserModuleWrappers;
|
|
5
5
|
globalDecorators?: ReactDecorator[];
|
|
6
6
|
renderMessage?: (msg: string) => React.ReactNode;
|
|
7
7
|
};
|
|
8
|
-
export declare function ClientFixtureLoader({ moduleWrappers, globalDecorators, renderMessage
|
|
8
|
+
export declare function ClientFixtureLoader({ moduleWrappers, globalDecorators, renderMessage }: Props): React.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { UserModuleWrappers } from 'react-cosmos-core';
|
|
3
|
-
import { SelectedFixture } from './SelectedFixture.js';
|
|
2
|
+
import type { UserModuleWrappers } from 'react-cosmos-core';
|
|
3
|
+
import type { SelectedFixture } from './SelectedFixture.js';
|
|
4
4
|
type Props = {
|
|
5
5
|
moduleWrappers: UserModuleWrappers;
|
|
6
6
|
selectedFixture: SelectedFixture | null;
|
|
7
7
|
renderMessage: (msg: string) => React.ReactNode;
|
|
8
8
|
renderFixture: (selected: SelectedFixture) => React.ReactNode;
|
|
9
9
|
};
|
|
10
|
-
export declare function FixtureLoaderConnect({ moduleWrappers, selectedFixture, renderMessage, renderFixture
|
|
10
|
+
export declare function FixtureLoaderConnect({ moduleWrappers, selectedFixture, renderMessage, renderFixture }: Props): React.JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DelayRender, getFixtureListFromWrappers
|
|
2
|
+
import { DelayRender, getFixtureListFromWrappers } from 'react-cosmos-core';
|
|
3
3
|
import { RendererSync } from './RendererSync.js';
|
|
4
4
|
export function FixtureLoaderConnect({ moduleWrappers, selectedFixture, renderMessage, renderFixture, }) {
|
|
5
5
|
const fixtures = React.useMemo(() => getFixtureListFromWrappers(moduleWrappers), [moduleWrappers]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ReactDecorator, UserModuleWrappers } from 'react-cosmos-core';
|
|
3
|
-
import { SelectedFixture } from './SelectedFixture.js';
|
|
2
|
+
import type { ReactDecorator, UserModuleWrappers } from 'react-cosmos-core';
|
|
3
|
+
import type { SelectedFixture } from './SelectedFixture.js';
|
|
4
4
|
type Props = {
|
|
5
5
|
moduleWrappers: UserModuleWrappers;
|
|
6
6
|
globalDecorators?: ReactDecorator[];
|
|
@@ -8,5 +8,5 @@ type Props = {
|
|
|
8
8
|
selectedFixture: SelectedFixture | null;
|
|
9
9
|
fixtureProps?: Record<string, unknown>;
|
|
10
10
|
};
|
|
11
|
-
export declare function ServerFixtureLoader({ moduleWrappers, globalDecorators, renderMessage, selectedFixture, fixtureProps
|
|
11
|
+
export declare function ServerFixtureLoader({ moduleWrappers, globalDecorators, renderMessage, selectedFixture, fixtureProps }: Props): React.JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -6,9 +6,5 @@ import { AsyncModuleLoader } from '../moduleLoaders/AsyncModuleLoader.js';
|
|
|
6
6
|
import { defaultRenderMessage } from './defaultRenderMessage.js';
|
|
7
7
|
import { FixtureLoaderConnect } from './FixtureLoaderConnect.js';
|
|
8
8
|
export function ServerFixtureLoader({ moduleWrappers, globalDecorators, renderMessage = defaultRenderMessage, selectedFixture, fixtureProps, }) {
|
|
9
|
-
return (React.createElement(FixtureLoaderConnect, { moduleWrappers: moduleWrappers, selectedFixture: selectedFixture, renderMessage: renderMessage, renderFixture: selected => (
|
|
10
|
-
// The suspense boundary allows the rendererReady response to be sent
|
|
11
|
-
// before loading the fixture modules.
|
|
12
|
-
React.createElement(Suspense, null,
|
|
13
|
-
React.createElement(AsyncModuleLoader, { moduleWrappers: moduleWrappers, fixturePath: selected.fixtureId.path, renderModules: modules => (React.createElement(FixtureModule, { ...modules, ...selected, globalDecorators: globalDecorators, fixtureProps: fixtureProps, lazy: moduleWrappers.lazy, renderMessage: renderMessage })) }))) }));
|
|
9
|
+
return (React.createElement(FixtureLoaderConnect, { moduleWrappers: moduleWrappers, selectedFixture: selectedFixture, renderMessage: renderMessage, renderFixture: selected => (React.createElement(Suspense, null, React.createElement(AsyncModuleLoader, { moduleWrappers: moduleWrappers, fixturePath: selected.fixtureId.path, renderModules: modules => (React.createElement(FixtureModule, { ...modules, ...selected, globalDecorators: globalDecorators, fixtureProps: fixtureProps, lazy: moduleWrappers.lazy, renderMessage: renderMessage })) }))) }));
|
|
14
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ReactDecorator, ReactDecoratorModule, ReactFixture } from 'react-cosmos-core';
|
|
2
|
+
import type { ReactDecorator, ReactDecoratorModule, ReactFixture } from 'react-cosmos-core';
|
|
3
3
|
type Props = {
|
|
4
4
|
fixture: ReactFixture;
|
|
5
5
|
fixtureOptions: {};
|
|
@@ -7,5 +7,5 @@ type Props = {
|
|
|
7
7
|
userDecoratorModules: ReactDecoratorModule[];
|
|
8
8
|
globalDecorators?: ReactDecorator[];
|
|
9
9
|
};
|
|
10
|
-
export declare function DecoratedFixture({ fixture, fixtureOptions, fixtureProps, userDecoratorModules, globalDecorators
|
|
10
|
+
export declare function DecoratedFixture({ fixture, fixtureOptions, fixtureProps, userDecoratorModules, globalDecorators }: Props): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
11
11
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FixtureId, FixtureState, ReactDecorator, ReactDecoratorModule, ReactFixtureModule } from 'react-cosmos-core';
|
|
2
|
+
import type { FixtureId, FixtureState, ReactDecorator, ReactDecoratorModule, ReactFixtureModule } from 'react-cosmos-core';
|
|
3
3
|
type Props = {
|
|
4
4
|
fixtureModule: ReactFixtureModule;
|
|
5
5
|
decoratorModules: ReactDecoratorModule[];
|
|
@@ -11,5 +11,5 @@ type Props = {
|
|
|
11
11
|
lazy: boolean;
|
|
12
12
|
renderMessage: (msg: string) => React.ReactNode;
|
|
13
13
|
};
|
|
14
|
-
export declare function FixtureModule({ fixtureModule, decoratorModules, globalDecorators, fixtureId, initialFixtureState, fixtureProps, renderKey, lazy, renderMessage
|
|
14
|
+
export declare function FixtureModule({ fixtureModule, decoratorModules, globalDecorators, fixtureId, initialFixtureState, fixtureProps, renderKey, lazy, renderMessage }: Props): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | Iterable<React.ReactNode> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | null | undefined;
|
|
15
15
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { isEqual
|
|
3
|
+
import { isEqual } from 'react-cosmos-core';
|
|
4
4
|
import { FixtureContext } from '../fixture/FixtureContext.js';
|
|
5
5
|
import { RendererContext } from '../rendererConnect/RendererContext.js';
|
|
6
6
|
export function FixtureProvider(props) {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { ReactFixture } from 'react-cosmos-core';
|
|
3
|
+
import type { ReactFixture } from 'react-cosmos-core';
|
|
3
4
|
export declare function createFixtureNode(fixture: ReactFixture, fixtureProps?: Record<string, unknown>): React.ReactNode;
|
|
5
|
+
declare function FixtureElement({ Component, fixtureProps }: {
|
|
6
|
+
Component: ComponentType;
|
|
7
|
+
fixtureProps?: Record<string, unknown>;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare namespace FixtureElement {
|
|
10
|
+
var cosmosCapture: boolean;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ReactDecorator } from 'react-cosmos-core';
|
|
2
|
+
import type { ReactDecorator } from 'react-cosmos-core';
|
|
3
3
|
export declare function decorateFixture(fixtureNode: React.ReactNode, fixtureOptions: {}, decorators: ReactDecorator[]): React.ReactElement;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FixtureModules, UserModuleWrappers } from 'react-cosmos-core';
|
|
2
|
+
import type { FixtureModules, UserModuleWrappers } from 'react-cosmos-core';
|
|
3
3
|
type Props = {
|
|
4
4
|
moduleWrappers: UserModuleWrappers;
|
|
5
5
|
fixturePath: string;
|
|
6
6
|
renderModules: (modules: FixtureModules) => React.ReactElement;
|
|
7
7
|
};
|
|
8
|
-
export declare function AsyncModuleLoader({ moduleWrappers, fixturePath, renderModules
|
|
8
|
+
export declare function AsyncModuleLoader({ moduleWrappers, fixturePath, renderModules }: Props): Promise<React.ReactElement<unknown, string | React.JSXElementConstructor<any>>>;
|
|
9
9
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getSortedDecoratorsForFixturePath } from 'react-cosmos-core';
|
|
2
3
|
import { importLazyFixtureModules } from './importLazyFixtureModules.js';
|
|
3
4
|
export async function AsyncModuleLoader({ moduleWrappers, fixturePath, renderModules, }) {
|
|
4
5
|
return renderModules(await getModules(moduleWrappers, fixturePath));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ByPath, FixtureModules, LazyReactDecoratorWrapper, LazyReactFixtureWrapper } from 'react-cosmos-core';
|
|
2
|
+
import type { ByPath, FixtureModules, LazyReactDecoratorWrapper, LazyReactFixtureWrapper } from 'react-cosmos-core';
|
|
3
3
|
type Props = {
|
|
4
4
|
fixtureWrapper: LazyReactFixtureWrapper;
|
|
5
5
|
decorators: ByPath<LazyReactDecoratorWrapper>;
|
|
6
6
|
fixturePath: string;
|
|
7
7
|
renderModules: (modules: FixtureModules) => React.ReactElement;
|
|
8
8
|
};
|
|
9
|
-
export declare function LazyModuleLoader({ fixtureWrapper, decorators, fixturePath, renderModules
|
|
9
|
+
export declare function LazyModuleLoader({ fixtureWrapper, decorators, fixturePath, renderModules }: Props): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
|
|
10
10
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getSortedDecoratorsForFixturePath
|
|
2
|
+
import { getSortedDecoratorsForFixturePath } from 'react-cosmos-core';
|
|
3
3
|
import { importLazyFixtureModules } from './importLazyFixtureModules.js';
|
|
4
4
|
export function LazyModuleLoader({ fixtureWrapper, decorators, fixturePath, renderModules, }) {
|
|
5
5
|
const modules = useLazyFixtureModules(fixturePath, fixtureWrapper, decorators);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ByPath, FixtureModules, ReactDecoratorWrapper, ReactFixtureWrapper } from 'react-cosmos-core';
|
|
2
|
+
import type { ByPath, FixtureModules, ReactDecoratorWrapper, ReactFixtureWrapper } from 'react-cosmos-core';
|
|
3
3
|
type Props = {
|
|
4
4
|
fixtureWrapper: ReactFixtureWrapper;
|
|
5
5
|
decorators: ByPath<ReactDecoratorWrapper>;
|
|
6
6
|
fixturePath: string;
|
|
7
7
|
renderModules: (modules: FixtureModules) => React.ReactElement;
|
|
8
8
|
};
|
|
9
|
-
export declare function StaticModuleLoader({ fixtureWrapper, decorators, fixturePath, renderModules
|
|
9
|
+
export declare function StaticModuleLoader({ fixtureWrapper, decorators, fixturePath, renderModules }: Props): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
10
10
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getSortedDecoratorsForFixturePath
|
|
2
|
+
import { getSortedDecoratorsForFixturePath } from 'react-cosmos-core';
|
|
3
3
|
export function StaticModuleLoader({ fixtureWrapper, decorators, fixturePath, renderModules, }) {
|
|
4
4
|
return renderModules(React.useMemo(() => ({
|
|
5
5
|
fixtureModule: fixtureWrapper.module,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LazyReactDecoratorWrapper, LazyReactFixtureWrapper } from 'react-cosmos-core';
|
|
1
|
+
import type { LazyReactDecoratorWrapper, LazyReactFixtureWrapper } from 'react-cosmos-core';
|
|
2
2
|
export declare function importLazyFixtureModules(fixtureWrapper: LazyReactFixtureWrapper, decoratorWrappers: LazyReactDecoratorWrapper[]): Promise<{
|
|
3
3
|
fixtureModule: import("react-cosmos-core").ReactFixtureModule;
|
|
4
4
|
decoratorModules: import("react-cosmos-core").ReactDecoratorModule[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FixtureId, FixtureList, FixtureState, RendererConnect } from 'react-cosmos-core';
|
|
3
|
-
import { SelectedFixture } from '../fixtureLoaders/SelectedFixture.js';
|
|
2
|
+
import type { FixtureId, FixtureList, FixtureState, RendererConnect } from 'react-cosmos-core';
|
|
3
|
+
import type { SelectedFixture } from '../fixtureLoaders/SelectedFixture.js';
|
|
4
4
|
export type RendererContextValue = {
|
|
5
5
|
rendererId: string;
|
|
6
6
|
rendererConnect: RendererConnect;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FixtureId, FixtureState, RendererConnect } from 'react-cosmos-core';
|
|
3
|
-
import { SelectedFixture } from '../fixtureLoaders/SelectedFixture.js';
|
|
2
|
+
import type { FixtureId, FixtureState, RendererConnect } from 'react-cosmos-core';
|
|
3
|
+
import type { SelectedFixture } from '../fixtureLoaders/SelectedFixture.js';
|
|
4
4
|
type Props = {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
rendererId: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RendererConnect } from 'react-cosmos-core';
|
|
1
|
+
import type { RendererConnect } from 'react-cosmos-core';
|
|
2
2
|
export declare function createNoopRendererConnect(): RendererConnect;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RendererConnect } from 'react-cosmos-core';
|
|
1
|
+
import type { RendererConnect } from 'react-cosmos-core';
|
|
2
2
|
export declare function createPostMessageConnect(): RendererConnect;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RendererConnect } from 'react-cosmos-core';
|
|
1
|
+
import type { RendererConnect } from 'react-cosmos-core';
|
|
2
2
|
export declare function createWebSocketsConnect(url: string): RendererConnect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cosmos-renderer",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.1-canary.238df28.0+238df28",
|
|
4
4
|
"description": "React Cosmos Renderer",
|
|
5
5
|
"repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos-renderer",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"./client": "./client.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"react-cosmos-core": "7.
|
|
14
|
+
"react-cosmos-core": "7.3.1-canary.238df28.0+238df28"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": ">=18"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "238df28f25a685b1715cee8829fbdb64b094b45c"
|
|
20
20
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"7.0.0-dev.20260417.1","root":["./src/client.ts","./src/index.ts","./src/wrapSetTimeoutAct.ts","./src/fixture/ClassStateMock.tsx","./src/fixture/FixtureContext.ts","./src/fixture/Viewport.tsx","./src/fixture/useFixtureState.ts","./src/fixture/FixtureCapture/FixtureCapture.tsx","./src/fixture/FixtureCapture/classState/index.ts","./src/fixture/FixtureCapture/classState/shared.ts","./src/fixture/FixtureCapture/classState/useFixtureClassState.ts","./src/fixture/FixtureCapture/classState/useReadClassState.ts","./src/fixture/FixtureCapture/classState/decorateFixtureRefs/index.ts","./src/fixture/FixtureCapture/classState/decorateFixtureRefs/isRefSupported.ts","./src/fixture/FixtureCapture/props/index.ts","./src/fixture/FixtureCapture/props/useFixtureProps.ts","./src/fixture/FixtureCapture/shared/findRelevantElementPaths.ts","./src/fixture/FixtureCapture/shared/nodeTree/elPath.ts","./src/fixture/FixtureCapture/shared/nodeTree/findElementPaths.ts","./src/fixture/FixtureCapture/shared/nodeTree/getElementAtPath.ts","./src/fixture/FixtureCapture/shared/nodeTree/index.ts","./src/fixture/FixtureCapture/shared/nodeTree/setElementAtPath.ts","./src/fixture/useCosmosNotification/useCosmosNotification.ts","./src/fixture/useFixtureInput/useCurrentInputValue.ts","./src/fixture/useFixtureInput/useFixtureInput.ts","./src/fixture/useFixtureInput/useInputFixtureState.ts","./src/fixture/useFixtureInput/useSetInputValue.ts","./src/fixture/useFixtureInput/useValue.ts","./src/fixture/useFixtureSelect/shared.ts","./src/fixture/useFixtureSelect/useCurrentSelectValue.ts","./src/fixture/useFixtureSelect/useFixtureSelect.ts","./src/fixture/useFixtureSelect/useSelect.ts","./src/fixture/useFixtureSelect/useSelectFixtureState.ts","./src/fixture/useFixtureSelect/useSetSelectValue.ts","./src/fixtureLoaders/ClientFixtureLoader.tsx","./src/fixtureLoaders/FixtureLoaderConnect.tsx","./src/fixtureLoaders/RendererSync.tsx","./src/fixtureLoaders/SelectedFixture.ts","./src/fixtureLoaders/ServerFixtureLoader.tsx","./src/fixtureLoaders/defaultRenderMessage.tsx","./src/fixtureModule/DecoratedFixture.tsx","./src/fixtureModule/FixtureModule.tsx","./src/fixtureModule/FixtureProvider.tsx","./src/fixtureModule/createFixtureNode.tsx","./src/fixtureModule/decorateFixture.tsx","./src/moduleLoaders/AsyncModuleLoader.tsx","./src/moduleLoaders/LazyModuleLoader.tsx","./src/moduleLoaders/StaticModuleLoader.tsx","./src/moduleLoaders/importLazyFixtureModules.ts","./src/rendererConnect/RendererContext.ts","./src/rendererConnect/RendererProvider.tsx","./src/rendererConnect/StatefulRendererProvider.tsx","./src/rendererConnect/createNoopRendererConnect.ts","./src/rendererConnect/createPostMessageConnect.ts","./src/rendererConnect/createWebSocketsConnect.ts","./src/rendererConnect/globals.d.ts"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"root":["../src/client.ts","../src/index.ts","../src/wrapSetTimeoutAct.ts","../src/fixture/ClassStateMock.tsx","../src/fixture/FixtureContext.ts","../src/fixture/Viewport.tsx","../src/fixture/useFixtureState.ts","../src/fixture/FixtureCapture/FixtureCapture.tsx","../src/fixture/FixtureCapture/classState/index.ts","../src/fixture/FixtureCapture/classState/shared.ts","../src/fixture/FixtureCapture/classState/useFixtureClassState.ts","../src/fixture/FixtureCapture/classState/useReadClassState.ts","../src/fixture/FixtureCapture/classState/decorateFixtureRefs/index.ts","../src/fixture/FixtureCapture/classState/decorateFixtureRefs/isRefSupported.ts","../src/fixture/FixtureCapture/props/index.ts","../src/fixture/FixtureCapture/props/useFixtureProps.ts","../src/fixture/FixtureCapture/shared/findRelevantElementPaths.ts","../src/fixture/FixtureCapture/shared/nodeTree/elPath.ts","../src/fixture/FixtureCapture/shared/nodeTree/findElementPaths.ts","../src/fixture/FixtureCapture/shared/nodeTree/getElementAtPath.ts","../src/fixture/FixtureCapture/shared/nodeTree/index.ts","../src/fixture/FixtureCapture/shared/nodeTree/setElementAtPath.ts","../src/fixture/useCosmosNotification/useCosmosNotification.ts","../src/fixture/useFixtureInput/useCurrentInputValue.ts","../src/fixture/useFixtureInput/useFixtureInput.ts","../src/fixture/useFixtureInput/useInputFixtureState.ts","../src/fixture/useFixtureInput/useSetInputValue.ts","../src/fixture/useFixtureInput/useValue.ts","../src/fixture/useFixtureSelect/shared.ts","../src/fixture/useFixtureSelect/useCurrentSelectValue.ts","../src/fixture/useFixtureSelect/useFixtureSelect.ts","../src/fixture/useFixtureSelect/useSelect.ts","../src/fixture/useFixtureSelect/useSelectFixtureState.ts","../src/fixture/useFixtureSelect/useSetSelectValue.ts","../src/fixtureLoaders/ClientFixtureLoader.tsx","../src/fixtureLoaders/FixtureLoaderConnect.tsx","../src/fixtureLoaders/RendererSync.tsx","../src/fixtureLoaders/SelectedFixture.ts","../src/fixtureLoaders/ServerFixtureLoader.tsx","../src/fixtureLoaders/defaultRenderMessage.tsx","../src/fixtureModule/DecoratedFixture.tsx","../src/fixtureModule/FixtureModule.tsx","../src/fixtureModule/FixtureProvider.tsx","../src/fixtureModule/createFixtureNode.tsx","../src/fixtureModule/decorateFixture.tsx","../src/moduleLoaders/AsyncModuleLoader.tsx","../src/moduleLoaders/LazyModuleLoader.tsx","../src/moduleLoaders/StaticModuleLoader.tsx","../src/moduleLoaders/importLazyFixtureModules.ts","../src/rendererConnect/RendererContext.ts","../src/rendererConnect/RendererProvider.tsx","../src/rendererConnect/StatefulRendererProvider.tsx","../src/rendererConnect/createNoopRendererConnect.ts","../src/rendererConnect/createPostMessageConnect.ts","../src/rendererConnect/createWebSocketsConnect.ts","../src/rendererConnect/globals.d.ts"],"version":"5.9.3"}
|