react-cosmos-renderer 7.2.1-canary.e6e39db.0 → 7.3.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.
Files changed (64) hide show
  1. package/dist/fixture/FixtureCapture/FixtureCapture.d.ts +1 -1
  2. package/dist/fixture/FixtureCapture/FixtureCapture.js +1 -0
  3. package/dist/fixture/FixtureCapture/classState/decorateFixtureRefs/index.d.ts +2 -2
  4. package/dist/fixture/FixtureCapture/classState/decorateFixtureRefs/index.js +1 -1
  5. package/dist/fixture/FixtureCapture/classState/index.d.ts +1 -1
  6. package/dist/fixture/FixtureCapture/classState/shared.d.ts +2 -1
  7. package/dist/fixture/FixtureCapture/classState/shared.js +1 -0
  8. package/dist/fixture/FixtureCapture/classState/useFixtureClassState.d.ts +3 -3
  9. package/dist/fixture/FixtureCapture/classState/useFixtureClassState.js +2 -2
  10. package/dist/fixture/FixtureCapture/classState/useReadClassState.d.ts +3 -3
  11. package/dist/fixture/FixtureCapture/props/index.d.ts +2 -2
  12. package/dist/fixture/FixtureCapture/props/useFixtureProps.d.ts +1 -1
  13. package/dist/fixture/FixtureCapture/shared/findRelevantElementPaths.js +1 -0
  14. package/dist/fixture/FixtureCapture/shared/nodeTree/findElementPaths.js +1 -1
  15. package/dist/fixture/FixtureCapture/shared/nodeTree/getElementAtPath.d.ts +2 -2
  16. package/dist/fixture/FixtureCapture/shared/nodeTree/getElementAtPath.js +1 -1
  17. package/dist/fixture/FixtureCapture/shared/nodeTree/setElementAtPath.d.ts +2 -2
  18. package/dist/fixture/FixtureContext.d.ts +1 -1
  19. package/dist/fixture/Viewport.d.ts +0 -1
  20. package/dist/fixture/useCosmosNotification/useCosmosNotification.d.ts +1 -1
  21. package/dist/fixture/useFixtureInput/useFixtureInput.d.ts +1 -1
  22. package/dist/fixture/useFixtureInput/useInputFixtureState.js +1 -1
  23. package/dist/fixture/useFixtureInput/useSetInputValue.d.ts +1 -1
  24. package/dist/fixture/useFixtureInput/useSetInputValue.js +1 -1
  25. package/dist/fixture/useFixtureInput/useValue.d.ts +1 -1
  26. package/dist/fixture/useFixtureSelect/shared.d.ts +1 -1
  27. package/dist/fixture/useFixtureSelect/useCurrentSelectValue.d.ts +1 -1
  28. package/dist/fixture/useFixtureSelect/useFixtureSelect.d.ts +1 -1
  29. package/dist/fixture/useFixtureSelect/useSelect.d.ts +1 -1
  30. package/dist/fixture/useFixtureSelect/useSelectFixtureState.d.ts +1 -1
  31. package/dist/fixture/useFixtureSelect/useSetSelectValue.d.ts +1 -1
  32. package/dist/fixture/useFixtureState.d.ts +1 -1
  33. package/dist/fixture/useFixtureState.js +1 -1
  34. package/dist/fixtureLoaders/ClientFixtureLoader.d.ts +2 -2
  35. package/dist/fixtureLoaders/FixtureLoaderConnect.d.ts +3 -3
  36. package/dist/fixtureLoaders/FixtureLoaderConnect.js +1 -1
  37. package/dist/fixtureLoaders/RendererSync.d.ts +1 -1
  38. package/dist/fixtureLoaders/SelectedFixture.d.ts +1 -1
  39. package/dist/fixtureLoaders/ServerFixtureLoader.d.ts +3 -3
  40. package/dist/fixtureLoaders/ServerFixtureLoader.js +1 -5
  41. package/dist/fixtureModule/DecoratedFixture.d.ts +2 -2
  42. package/dist/fixtureModule/FixtureModule.d.ts +2 -2
  43. package/dist/fixtureModule/FixtureProvider.d.ts +1 -1
  44. package/dist/fixtureModule/FixtureProvider.js +1 -1
  45. package/dist/fixtureModule/createFixtureNode.d.ts +10 -1
  46. package/dist/fixtureModule/decorateFixture.d.ts +1 -1
  47. package/dist/moduleLoaders/AsyncModuleLoader.d.ts +2 -2
  48. package/dist/moduleLoaders/AsyncModuleLoader.js +2 -1
  49. package/dist/moduleLoaders/LazyModuleLoader.d.ts +2 -2
  50. package/dist/moduleLoaders/LazyModuleLoader.js +1 -1
  51. package/dist/moduleLoaders/StaticModuleLoader.d.ts +2 -2
  52. package/dist/moduleLoaders/StaticModuleLoader.js +1 -1
  53. package/dist/moduleLoaders/importLazyFixtureModules.d.ts +1 -1
  54. package/dist/rendererConnect/RendererContext.d.ts +2 -2
  55. package/dist/rendererConnect/RendererProvider.d.ts +2 -2
  56. package/dist/rendererConnect/StatefulRendererProvider.d.ts +1 -1
  57. package/dist/rendererConnect/createNoopRendererConnect.d.ts +1 -1
  58. package/dist/rendererConnect/createPostMessageConnect.d.ts +1 -1
  59. package/dist/rendererConnect/createPostMessageConnect.js +1 -1
  60. package/dist/rendererConnect/createWebSocketsConnect.d.ts +1 -1
  61. package/dist/rendererConnect/createWebSocketsConnect.js +1 -1
  62. package/package.json +3 -3
  63. package/tsconfig.build.tsbuildinfo +1 -0
  64. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FixtureDecoratorId } from 'react-cosmos-core';
2
+ import type { FixtureDecoratorId } from 'react-cosmos-core';
3
3
  type Props = {
4
4
  children: React.ReactNode;
5
5
  decoratorId: FixtureDecoratorId;
@@ -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, } from 'react';
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,3 +1,3 @@
1
1
  import React from 'react';
2
- import { FixtureDecoratorId } from 'react-cosmos-core';
2
+ import type { FixtureDecoratorId } from 'react-cosmos-core';
3
3
  export declare function useClassStateCapture(fixture: React.ReactNode, decoratorId: FixtureDecoratorId): React.ReactNode;
@@ -1,4 +1,5 @@
1
- import React, { RefCallback } from 'react';
1
+ import type { RefCallback } from 'react';
2
+ import React from 'react';
2
3
  export type ElRefs = {
3
4
  [elPath: string]: React.Component;
4
5
  };
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { isEqual } from 'react-cosmos-core';
2
3
  // We need to do this because React doesn't provide a replaceState method
3
4
  // (anymore) https://reactjs.org/docs/react-component.html#setstate
@@ -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, } from 'react';
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, } from './shared.js';
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,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { findElementPaths, getExpectedElementAtPath, } from './nodeTree/index.js';
2
3
  export function findRelevantElementPaths(node) {
3
4
  const elPaths = findElementPaths(node);
@@ -1,4 +1,4 @@
1
- import { Fragment } from 'react';
1
+ import React, { Fragment } from 'react';
2
2
  import { isReactElement } from 'react-cosmos-core';
3
3
  import { getChildrenPath } from './elPath.js';
4
4
  export function findElementPaths(node, curPath = '') {
@@ -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, } from 'react-cosmos-core';
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;
@@ -8,4 +8,3 @@ export declare function Viewport({ children, width, height }: Props): React.Reac
8
8
  export declare namespace Viewport {
9
9
  var cosmosCapture: boolean;
10
10
  }
11
- export {};
@@ -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, } from 'react-cosmos-core';
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, } from 'react-cosmos-core';
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');
@@ -1,4 +1,4 @@
1
- import { Dispatch, SetStateAction } from 'react-cosmos-core';
1
+ import type { Dispatch, SetStateAction } from 'react-cosmos-core';
2
2
  type Opts<T> = {
3
3
  defaultValue: T;
4
4
  };
@@ -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, }: UseSelectArgs<Option>): Option;
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, } from 'react-cosmos-core';
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, }: Props): React.JSX.Element;
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, }: Props): React.JSX.Element;
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, } from 'react-cosmos-core';
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,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FixtureList } from 'react-cosmos-core';
2
+ import type { FixtureList } from 'react-cosmos-core';
3
3
  type Props = {
4
4
  children: React.ReactNode;
5
5
  fixtures: FixtureList;
@@ -1,4 +1,4 @@
1
- import { FixtureId, FixtureState } from 'react-cosmos-core';
1
+ import type { FixtureId, FixtureState } from 'react-cosmos-core';
2
2
  export type SelectedFixture = {
3
3
  fixtureId: FixtureId;
4
4
  initialFixtureState: FixtureState;
@@ -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, }: Props): React.JSX.Element;
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, }: Props): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
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, }: Props): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
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,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FixtureId, FixtureListItem, FixtureState } from 'react-cosmos-core';
2
+ import type { FixtureId, FixtureListItem, FixtureState } from 'react-cosmos-core';
3
3
  type Props = {
4
4
  children: React.ReactNode;
5
5
  fixtureId: FixtureId;
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import React from 'react';
3
- import { isEqual, } from 'react-cosmos-core';
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, }: Props): Promise<React.ReactElement<unknown, string | React.JSXElementConstructor<any>>>;
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 { getSortedDecoratorsForFixturePath, } from 'react-cosmos-core';
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, }: Props): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
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, } from 'react-cosmos-core';
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, }: Props): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
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, } from 'react-cosmos-core';
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,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FixtureId, RendererConnect } from 'react-cosmos-core';
2
+ import type { FixtureId, RendererConnect } from 'react-cosmos-core';
3
3
  type Props = {
4
4
  children: React.ReactNode;
5
5
  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,4 +1,4 @@
1
- import { registerPlaygroundShortcuts, } from 'react-cosmos-core';
1
+ import { registerPlaygroundShortcuts } from 'react-cosmos-core';
2
2
  export function createPostMessageConnect() {
3
3
  function postMessage(msg) {
4
4
  parent.postMessage(msg, '*');
@@ -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;
@@ -1,4 +1,4 @@
1
- import { rendererSocketMessage, } from 'react-cosmos-core';
1
+ import { rendererSocketMessage } from 'react-cosmos-core';
2
2
  export function createWebSocketsConnect(url) {
3
3
  let pendingMessages = [];
4
4
  const socket = new WebSocket(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-cosmos-renderer",
3
- "version": "7.2.1-canary.e6e39db.0+e6e39db",
3
+ "version": "7.3.0",
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.2.1-canary.e6e39db.0+e6e39db"
14
+ "react-cosmos-core": "^7.3.0"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "react": ">=18"
18
18
  },
19
- "gitHead": "e6e39db08377aa14bf0ef75b44096c403c0e560f"
19
+ "gitHead": "883eba284c16f2696967bc45ea2c64a3f083ad0f"
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"}