react-cosmos-ui 6.0.0-alpha.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/LICENSE +21 -0
- package/dist/components/BaseSvg.d.ts +9 -0
- package/dist/components/BaseSvg.js +8 -0
- package/dist/components/Icon.d.ts +7 -0
- package/dist/components/Icon.js +5 -0
- package/dist/components/Illustration.d.ts +8 -0
- package/dist/components/Illustration.js +5 -0
- package/dist/components/KeyBox.d.ts +9 -0
- package/dist/components/KeyBox.js +28 -0
- package/dist/components/SidePanel.d.ts +10 -0
- package/dist/components/SidePanel.js +52 -0
- package/dist/components/Space.d.ts +7 -0
- package/dist/components/Space.js +8 -0
- package/dist/components/TreeView.d.ts +19 -0
- package/dist/components/TreeView.js +26 -0
- package/dist/components/ValueInputTree/ExpandCollapseValues.d.ts +9 -0
- package/dist/components/ValueInputTree/ExpandCollapseValues.js +11 -0
- package/dist/components/ValueInputTree/ValueInput/BooleanValueInput.d.ts +8 -0
- package/dist/components/ValueInputTree/ValueInput/BooleanValueInput.js +32 -0
- package/dist/components/ValueInputTree/ValueInput/NullValueInput.d.ts +5 -0
- package/dist/components/ValueInputTree/ValueInput/NullValueInput.js +9 -0
- package/dist/components/ValueInputTree/ValueInput/NumberValueInput.d.ts +8 -0
- package/dist/components/ValueInputTree/ValueInput/NumberValueInput.js +14 -0
- package/dist/components/ValueInputTree/ValueInput/StringValueInput.d.ts +8 -0
- package/dist/components/ValueInputTree/ValueInput/StringValueInput.js +18 -0
- package/dist/components/ValueInputTree/ValueInput/UndefinedValueInput.d.ts +5 -0
- package/dist/components/ValueInputTree/ValueInput/UndefinedValueInput.js +9 -0
- package/dist/components/ValueInputTree/ValueInput/UnserializableValueInput.d.ts +6 -0
- package/dist/components/ValueInputTree/ValueInput/UnserializableValueInput.js +11 -0
- package/dist/components/ValueInputTree/ValueInput/ValueInput.d.ts +11 -0
- package/dist/components/ValueInputTree/ValueInput/ValueInput.js +30 -0
- package/dist/components/ValueInputTree/ValueInput/shared.d.ts +6 -0
- package/dist/components/ValueInputTree/ValueInput/shared.js +41 -0
- package/dist/components/ValueInputTree/ValueInputDir.d.ts +9 -0
- package/dist/components/ValueInputTree/ValueInputDir.js +68 -0
- package/dist/components/ValueInputTree/ValueInputTree.d.ts +12 -0
- package/dist/components/ValueInputTree/ValueInputTree.js +32 -0
- package/dist/components/ValueInputTree/index.d.ts +4 -0
- package/dist/components/ValueInputTree/index.js +4 -0
- package/dist/components/ValueInputTree/shared.d.ts +16 -0
- package/dist/components/ValueInputTree/shared.js +15 -0
- package/dist/components/ValueInputTree/valueGroups.d.ts +8 -0
- package/dist/components/ValueInputTree/valueGroups.js +10 -0
- package/dist/components/ValueInputTree/valueTree.d.ts +3 -0
- package/dist/components/ValueInputTree/valueTree.js +20 -0
- package/dist/components/ValueInputTree/valueTreeExpansion.d.ts +7 -0
- package/dist/components/ValueInputTree/valueTreeExpansion.js +16 -0
- package/dist/components/buttons/Button32.d.ts +11 -0
- package/dist/components/buttons/Button32.js +8 -0
- package/dist/components/buttons/Button8.d.ts +11 -0
- package/dist/components/buttons/Button8.js +8 -0
- package/dist/components/buttons/IconButton32.d.ts +10 -0
- package/dist/components/buttons/IconButton32.js +7 -0
- package/dist/components/buttons/IconButton8.d.ts +10 -0
- package/dist/components/buttons/IconButton8.js +7 -0
- package/dist/components/buttons/index.d.ts +4 -0
- package/dist/components/buttons/index.js +4 -0
- package/dist/components/buttons/shared.d.ts +15 -0
- package/dist/components/buttons/shared.js +52 -0
- package/dist/components/icons/index.d.ts +33 -0
- package/dist/components/icons/index.js +107 -0
- package/dist/components/illustrations/ArtificialIntelligence.d.ts +3 -0
- package/dist/components/illustrations/ArtificialIntelligence.js +123 -0
- package/dist/components/illustrations/Astronaut.d.ts +3 -0
- package/dist/components/illustrations/Astronaut.js +72 -0
- package/dist/components/illustrations/BlankCanvas.d.ts +3 -0
- package/dist/components/illustrations/BlankCanvas.js +75 -0
- package/dist/components/inputs/NumberInput.d.ts +15 -0
- package/dist/components/inputs/NumberInput.js +79 -0
- package/dist/components/inputs/Select.d.ts +16 -0
- package/dist/components/inputs/Select.js +69 -0
- package/dist/components/inputs/shared.d.ts +14 -0
- package/dist/components/inputs/shared.js +43 -0
- package/dist/cosmos.decorator.d.ts +5 -0
- package/dist/cosmos.decorator.js +6 -0
- package/dist/cosmos.loadPlugins.d.ts +1 -0
- package/dist/cosmos.loadPlugins.js +17 -0
- package/dist/hooks/useDrag.d.ts +14 -0
- package/dist/hooks/useDrag.js +58 -0
- package/dist/hooks/useFocus.d.ts +5 -0
- package/dist/hooks/useFocus.js +7 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +36 -0
- package/dist/playground.bundle.js +1358 -0
- package/dist/playground.bundle.js.LICENSE.txt +64 -0
- package/dist/playground.bundle.js.map +1 -0
- package/dist/playground.d.ts +11 -0
- package/dist/playground.js +36 -0
- package/dist/playgroundConfig.d.ts +10 -0
- package/dist/playgroundConfig.js +1 -0
- package/dist/plugins/BuildNotifications/index.d.ts +2 -0
- package/dist/plugins/BuildNotifications/index.js +35 -0
- package/dist/plugins/BuildNotifications/spec.d.ts +3 -0
- package/dist/plugins/BuildNotifications/spec.js +1 -0
- package/dist/plugins/ClassStatePanel/ClassStatePanel/ComponentClassState.d.ts +10 -0
- package/dist/plugins/ClassStatePanel/ClassStatePanel/ComponentClassState.js +36 -0
- package/dist/plugins/ClassStatePanel/ClassStatePanel/index.d.ts +11 -0
- package/dist/plugins/ClassStatePanel/ClassStatePanel/index.js +13 -0
- package/dist/plugins/ClassStatePanel/ClassStatePanel/shared.d.ts +2 -0
- package/dist/plugins/ClassStatePanel/ClassStatePanel/shared.js +16 -0
- package/dist/plugins/ClassStatePanel/index.d.ts +2 -0
- package/dist/plugins/ClassStatePanel/index.js +30 -0
- package/dist/plugins/ClassStatePanel/shared.d.ts +1 -0
- package/dist/plugins/ClassStatePanel/shared.js +1 -0
- package/dist/plugins/ClassStatePanel/spec.d.ts +3 -0
- package/dist/plugins/ClassStatePanel/spec.js +1 -0
- package/dist/plugins/ContentOverlay/ContentOverlay.d.ts +13 -0
- package/dist/plugins/ContentOverlay/ContentOverlay.js +34 -0
- package/dist/plugins/ContentOverlay/KeyShortcut.d.ts +6 -0
- package/dist/plugins/ContentOverlay/KeyShortcut.js +30 -0
- package/dist/plugins/ContentOverlay/NoFixtureSelected.d.ts +5 -0
- package/dist/plugins/ContentOverlay/NoFixtureSelected.js +34 -0
- package/dist/plugins/ContentOverlay/RendererNotResponding.d.ts +1 -0
- package/dist/plugins/ContentOverlay/RendererNotResponding.js +109 -0
- package/dist/plugins/ContentOverlay/WelcomeCosmos.d.ts +5 -0
- package/dist/plugins/ContentOverlay/WelcomeCosmos.js +158 -0
- package/dist/plugins/ContentOverlay/cosmos.decorator.d.ts +5 -0
- package/dist/plugins/ContentOverlay/cosmos.decorator.js +13 -0
- package/dist/plugins/ContentOverlay/index.d.ts +2 -0
- package/dist/plugins/ContentOverlay/index.js +19 -0
- package/dist/plugins/ContentOverlay/shared.d.ts +9 -0
- package/dist/plugins/ContentOverlay/shared.js +75 -0
- package/dist/plugins/ContentOverlay/spec.d.ts +3 -0
- package/dist/plugins/ContentOverlay/spec.js +1 -0
- package/dist/plugins/ContentOverlay/welcomeDismiss.d.ts +7 -0
- package/dist/plugins/ContentOverlay/welcomeDismiss.js +17 -0
- package/dist/plugins/ControlPanel/ControlPanel.d.ts +8 -0
- package/dist/plugins/ControlPanel/ControlPanel.js +37 -0
- package/dist/plugins/ControlPanel/index.d.ts +2 -0
- package/dist/plugins/ControlPanel/index.js +17 -0
- package/dist/plugins/ControlPanel/spec.d.ts +6 -0
- package/dist/plugins/ControlPanel/spec.js +1 -0
- package/dist/plugins/ControlSelect/SelectValueInput.d.ts +8 -0
- package/dist/plugins/ControlSelect/SelectValueInput.js +15 -0
- package/dist/plugins/ControlSelect/index.d.ts +2 -0
- package/dist/plugins/ControlSelect/index.js +22 -0
- package/dist/plugins/ControlSelect/spec.d.ts +3 -0
- package/dist/plugins/ControlSelect/spec.js +1 -0
- package/dist/plugins/Core/index.d.ts +2 -0
- package/dist/plugins/Core/index.js +68 -0
- package/dist/plugins/Core/spec.d.ts +25 -0
- package/dist/plugins/Core/spec.js +1 -0
- package/dist/plugins/FixtureBookmark/BookmarkFixtureButton.d.ts +6 -0
- package/dist/plugins/FixtureBookmark/BookmarkFixtureButton.js +6 -0
- package/dist/plugins/FixtureBookmark/FixtureBookmarks.d.ts +10 -0
- package/dist/plugins/FixtureBookmark/FixtureBookmarks.js +123 -0
- package/dist/plugins/FixtureBookmark/index.d.ts +2 -0
- package/dist/plugins/FixtureBookmark/index.js +46 -0
- package/dist/plugins/FixtureBookmark/spec.d.ts +3 -0
- package/dist/plugins/FixtureBookmark/spec.js +1 -0
- package/dist/plugins/FixtureSearch/FixtureSearchHeader.d.ts +7 -0
- package/dist/plugins/FixtureSearch/FixtureSearchHeader.js +66 -0
- package/dist/plugins/FixtureSearch/FixtureSearchOverlay.d.ts +13 -0
- package/dist/plugins/FixtureSearch/FixtureSearchOverlay.js +312 -0
- package/dist/plugins/FixtureSearch/FixtureSearchResult.d.ts +9 -0
- package/dist/plugins/FixtureSearch/FixtureSearchResult.js +48 -0
- package/dist/plugins/FixtureSearch/FixtureSearchShortcuts.d.ts +1 -0
- package/dist/plugins/FixtureSearch/FixtureSearchShortcuts.js +60 -0
- package/dist/plugins/FixtureSearch/index.d.ts +2 -0
- package/dist/plugins/FixtureSearch/index.js +72 -0
- package/dist/plugins/FixtureSearch/spec.d.ts +7 -0
- package/dist/plugins/FixtureSearch/spec.js +1 -0
- package/dist/plugins/FixtureTree/BlankState.d.ts +8 -0
- package/dist/plugins/FixtureTree/BlankState.js +75 -0
- package/dist/plugins/FixtureTree/FixtureTree/FixtureButton.d.ts +12 -0
- package/dist/plugins/FixtureTree/FixtureTree/FixtureButton.js +16 -0
- package/dist/plugins/FixtureTree/FixtureTree/FixtureDir.d.ts +9 -0
- package/dist/plugins/FixtureTree/FixtureTree/FixtureDir.js +46 -0
- package/dist/plugins/FixtureTree/FixtureTree/FixtureLink.d.ts +9 -0
- package/dist/plugins/FixtureTree/FixtureTree/FixtureLink.js +34 -0
- package/dist/plugins/FixtureTree/FixtureTree/FixtureTree.d.ts +13 -0
- package/dist/plugins/FixtureTree/FixtureTree/FixtureTree.js +37 -0
- package/dist/plugins/FixtureTree/FixtureTree/FixtureTreeItem.d.ts +6 -0
- package/dist/plugins/FixtureTree/FixtureTree/FixtureTreeItem.js +24 -0
- package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureButton.d.ts +13 -0
- package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureButton.js +46 -0
- package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureChildButton.d.ts +12 -0
- package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureChildButton.js +26 -0
- package/dist/plugins/FixtureTree/FixtureTreeContainer.d.ts +14 -0
- package/dist/plugins/FixtureTree/FixtureTreeContainer.js +28 -0
- package/dist/plugins/FixtureTree/FixtureTreeHeader.d.ts +11 -0
- package/dist/plugins/FixtureTree/FixtureTreeHeader.js +33 -0
- package/dist/plugins/FixtureTree/index.d.ts +2 -0
- package/dist/plugins/FixtureTree/index.js +25 -0
- package/dist/plugins/FixtureTree/revealFixture.d.ts +3 -0
- package/dist/plugins/FixtureTree/revealFixture.js +48 -0
- package/dist/plugins/FixtureTree/shared.d.ts +7 -0
- package/dist/plugins/FixtureTree/shared.js +8 -0
- package/dist/plugins/FixtureTree/spec.d.ts +7 -0
- package/dist/plugins/FixtureTree/spec.js +1 -0
- package/dist/plugins/FixtureTree/useScrollToSelected.d.ts +6 -0
- package/dist/plugins/FixtureTree/useScrollToSelected.js +18 -0
- package/dist/plugins/FullScreenButton/FullScreenButton.d.ts +5 -0
- package/dist/plugins/FullScreenButton/FullScreenButton.js +6 -0
- package/dist/plugins/FullScreenButton/index.d.ts +2 -0
- package/dist/plugins/FullScreenButton/index.js +25 -0
- package/dist/plugins/FullScreenButton/spec.d.ts +3 -0
- package/dist/plugins/FullScreenButton/spec.js +1 -0
- package/dist/plugins/MessageHandler/index.d.ts +2 -0
- package/dist/plugins/MessageHandler/index.js +12 -0
- package/dist/plugins/MessageHandler/shared.d.ts +3 -0
- package/dist/plugins/MessageHandler/shared.js +1 -0
- package/dist/plugins/MessageHandler/socket.d.ts +4 -0
- package/dist/plugins/MessageHandler/socket.js +45 -0
- package/dist/plugins/MessageHandler/spec.d.ts +11 -0
- package/dist/plugins/MessageHandler/spec.js +1 -0
- package/dist/plugins/Notifications/Notifications.d.ts +6 -0
- package/dist/plugins/Notifications/Notifications.js +75 -0
- package/dist/plugins/Notifications/index.d.ts +2 -0
- package/dist/plugins/Notifications/index.js +36 -0
- package/dist/plugins/Notifications/pushNotification.d.ts +6 -0
- package/dist/plugins/Notifications/pushNotification.js +40 -0
- package/dist/plugins/Notifications/shared.d.ts +3 -0
- package/dist/plugins/Notifications/shared.js +1 -0
- package/dist/plugins/Notifications/spec.d.ts +22 -0
- package/dist/plugins/Notifications/spec.js +1 -0
- package/dist/plugins/PluginList/PluginList.d.ts +10 -0
- package/dist/plugins/PluginList/PluginList.js +38 -0
- package/dist/plugins/PluginList/index.d.ts +2 -0
- package/dist/plugins/PluginList/index.js +12 -0
- package/dist/plugins/PluginList/spec.d.ts +3 -0
- package/dist/plugins/PluginList/spec.js +1 -0
- package/dist/plugins/PropsPanel/BlankState.d.ts +3 -0
- package/dist/plugins/PropsPanel/BlankState.js +47 -0
- package/dist/plugins/PropsPanel/PropsPanel/ComponentProps.d.ts +10 -0
- package/dist/plugins/PropsPanel/PropsPanel/ComponentProps.js +40 -0
- package/dist/plugins/PropsPanel/PropsPanel/index.d.ts +11 -0
- package/dist/plugins/PropsPanel/PropsPanel/index.js +13 -0
- package/dist/plugins/PropsPanel/PropsPanel/shared.d.ts +2 -0
- package/dist/plugins/PropsPanel/PropsPanel/shared.js +16 -0
- package/dist/plugins/PropsPanel/index.d.ts +2 -0
- package/dist/plugins/PropsPanel/index.js +55 -0
- package/dist/plugins/PropsPanel/shared.d.ts +1 -0
- package/dist/plugins/PropsPanel/shared.js +1 -0
- package/dist/plugins/PropsPanel/spec.d.ts +3 -0
- package/dist/plugins/PropsPanel/spec.js +1 -0
- package/dist/plugins/RemoteRenderer/RemoteButton/copyToClipboard.d.ts +1 -0
- package/dist/plugins/RemoteRenderer/RemoteButton/copyToClipboard.js +24 -0
- package/dist/plugins/RemoteRenderer/RemoteButton/index.d.ts +8 -0
- package/dist/plugins/RemoteRenderer/RemoteButton/index.js +37 -0
- package/dist/plugins/RemoteRenderer/index.d.ts +2 -0
- package/dist/plugins/RemoteRenderer/index.js +36 -0
- package/dist/plugins/RemoteRenderer/shared.d.ts +3 -0
- package/dist/plugins/RemoteRenderer/shared.js +1 -0
- package/dist/plugins/RemoteRenderer/spec.d.ts +3 -0
- package/dist/plugins/RemoteRenderer/spec.js +1 -0
- package/dist/plugins/RendererCore/index.d.ts +2 -0
- package/dist/plugins/RendererCore/index.js +47 -0
- package/dist/plugins/RendererCore/isValidFixtureSelected.d.ts +2 -0
- package/dist/plugins/RendererCore/isValidFixtureSelected.js +16 -0
- package/dist/plugins/RendererCore/onRouterFixtureChange.d.ts +3 -0
- package/dist/plugins/RendererCore/onRouterFixtureChange.js +18 -0
- package/dist/plugins/RendererCore/receiveResponse/fixtureListUpdate.d.ts +3 -0
- package/dist/plugins/RendererCore/receiveResponse/fixtureListUpdate.js +11 -0
- package/dist/plugins/RendererCore/receiveResponse/fixtureStateChange.d.ts +3 -0
- package/dist/plugins/RendererCore/receiveResponse/fixtureStateChange.js +30 -0
- package/dist/plugins/RendererCore/receiveResponse/index.d.ts +3 -0
- package/dist/plugins/RendererCore/receiveResponse/index.js +20 -0
- package/dist/plugins/RendererCore/receiveResponse/playgroundCommand.d.ts +3 -0
- package/dist/plugins/RendererCore/receiveResponse/playgroundCommand.js +5 -0
- package/dist/plugins/RendererCore/receiveResponse/rendererReady.d.ts +3 -0
- package/dist/plugins/RendererCore/receiveResponse/rendererReady.js +49 -0
- package/dist/plugins/RendererCore/setFixtureState.d.ts +3 -0
- package/dist/plugins/RendererCore/setFixtureState.js +22 -0
- package/dist/plugins/RendererCore/shared/index.d.ts +4 -0
- package/dist/plugins/RendererCore/shared/index.js +1 -0
- package/dist/plugins/RendererCore/shared/postRequest.d.ts +5 -0
- package/dist/plugins/RendererCore/shared/postRequest.js +31 -0
- package/dist/plugins/RendererCore/shared/router.d.ts +2 -0
- package/dist/plugins/RendererCore/shared/router.js +3 -0
- package/dist/plugins/RendererCore/spec.d.ts +25 -0
- package/dist/plugins/RendererCore/spec.js +1 -0
- package/dist/plugins/RendererPreview/RendererPreview.d.ts +8 -0
- package/dist/plugins/RendererPreview/RendererPreview.js +25 -0
- package/dist/plugins/RendererPreview/checkRendererStatus.d.ts +2 -0
- package/dist/plugins/RendererPreview/checkRendererStatus.js +31 -0
- package/dist/plugins/RendererPreview/handleRendererRequests.d.ts +6 -0
- package/dist/plugins/RendererPreview/handleRendererRequests.js +76 -0
- package/dist/plugins/RendererPreview/handleWindowMessages.d.ts +2 -0
- package/dist/plugins/RendererPreview/handleWindowMessages.js +56 -0
- package/dist/plugins/RendererPreview/index.d.ts +2 -0
- package/dist/plugins/RendererPreview/index.js +49 -0
- package/dist/plugins/RendererPreview/shared.d.ts +9 -0
- package/dist/plugins/RendererPreview/shared.js +1 -0
- package/dist/plugins/RendererPreview/spec.d.ts +13 -0
- package/dist/plugins/RendererPreview/spec.js +1 -0
- package/dist/plugins/RendererSelect/index.d.ts +2 -0
- package/dist/plugins/RendererSelect/index.js +27 -0
- package/dist/plugins/RendererSelect/spec.d.ts +3 -0
- package/dist/plugins/RendererSelect/spec.js +1 -0
- package/dist/plugins/ResponsivePreview/ResponsivePreview/Header.d.ts +13 -0
- package/dist/plugins/ResponsivePreview/ResponsivePreview/Header.js +97 -0
- package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsivePreview.d.ts +14 -0
- package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsivePreview.js +152 -0
- package/dist/plugins/ResponsivePreview/ResponsivePreview/style.d.ts +45 -0
- package/dist/plugins/ResponsivePreview/ResponsivePreview/style.js +79 -0
- package/dist/plugins/ResponsivePreview/ToggleButton/index.d.ts +6 -0
- package/dist/plugins/ResponsivePreview/ToggleButton/index.js +6 -0
- package/dist/plugins/ResponsivePreview/index.d.ts +2 -0
- package/dist/plugins/ResponsivePreview/index.js +79 -0
- package/dist/plugins/ResponsivePreview/shared.d.ts +21 -0
- package/dist/plugins/ResponsivePreview/shared.js +19 -0
- package/dist/plugins/ResponsivePreview/spec.d.ts +13 -0
- package/dist/plugins/ResponsivePreview/spec.js +1 -0
- package/dist/plugins/Root/GlobalHeader.d.ts +9 -0
- package/dist/plugins/Root/GlobalHeader.js +59 -0
- package/dist/plugins/Root/RendererHeader.d.ts +16 -0
- package/dist/plugins/Root/RendererHeader.js +79 -0
- package/dist/plugins/Root/Root.d.ts +28 -0
- package/dist/plugins/Root/Root.js +120 -0
- package/dist/plugins/Root/SidePanel.d.ts +10 -0
- package/dist/plugins/Root/SidePanel.js +26 -0
- package/dist/plugins/Root/ToggleNavButton.d.ts +7 -0
- package/dist/plugins/Root/ToggleNavButton.js +6 -0
- package/dist/plugins/Root/index.d.ts +2 -0
- package/dist/plugins/Root/index.js +73 -0
- package/dist/plugins/Root/navOpen.d.ts +4 -0
- package/dist/plugins/Root/navOpen.js +11 -0
- package/dist/plugins/Root/navWidth.d.ts +5 -0
- package/dist/plugins/Root/navWidth.js +14 -0
- package/dist/plugins/Root/panelOpen.d.ts +4 -0
- package/dist/plugins/Root/panelOpen.js +16 -0
- package/dist/plugins/Root/panelWidth.d.ts +5 -0
- package/dist/plugins/Root/panelWidth.js +14 -0
- package/dist/plugins/Root/shared.d.ts +3 -0
- package/dist/plugins/Root/shared.js +1 -0
- package/dist/plugins/Root/spec.d.ts +14 -0
- package/dist/plugins/Root/spec.js +1 -0
- package/dist/plugins/Router/index.d.ts +2 -0
- package/dist/plugins/Router/index.js +56 -0
- package/dist/plugins/Router/spec.d.ts +15 -0
- package/dist/plugins/Router/spec.js +1 -0
- package/dist/plugins/StandardControl/index.d.ts +2 -0
- package/dist/plugins/StandardControl/index.js +43 -0
- package/dist/plugins/StandardControl/spec.d.ts +3 -0
- package/dist/plugins/StandardControl/spec.js +1 -0
- package/dist/plugins/StandardControl/storage.d.ts +7 -0
- package/dist/plugins/StandardControl/storage.js +10 -0
- package/dist/plugins/Storage/index.d.ts +2 -0
- package/dist/plugins/Storage/index.js +40 -0
- package/dist/plugins/Storage/spec.d.ts +18 -0
- package/dist/plugins/Storage/spec.js +1 -0
- package/dist/plugins/pluginEntry.d.ts +23 -0
- package/dist/plugins/pluginEntry.js +29 -0
- package/dist/shared/defaultPluginConfig.d.ts +13 -0
- package/dist/shared/defaultPluginConfig.js +13 -0
- package/dist/shared/fixtureTree.d.ts +3 -0
- package/dist/shared/fixtureTree.js +12 -0
- package/dist/shared/treeExpansion.d.ts +7 -0
- package/dist/shared/treeExpansion.js +24 -0
- package/dist/shared/url.d.ts +5 -0
- package/dist/shared/url.js +33 -0
- package/dist/slots/ControlActionSlot.d.ts +10 -0
- package/dist/slots/ControlActionSlot.js +5 -0
- package/dist/slots/ControlSlot.d.ts +11 -0
- package/dist/slots/ControlSlot.js +5 -0
- package/dist/slots/FixtureActionSlot.d.ts +10 -0
- package/dist/slots/FixtureActionSlot.js +5 -0
- package/dist/slots/NavRowSlot.d.ts +9 -0
- package/dist/slots/NavRowSlot.js +5 -0
- package/dist/slots/RendererActionSlot.d.ts +10 -0
- package/dist/slots/RendererActionSlot.js +5 -0
- package/dist/slots/SidePanelRowSlot.d.ts +12 -0
- package/dist/slots/SidePanelRowSlot.js +5 -0
- package/dist/slots/ValueInputSlot.d.ts +16 -0
- package/dist/slots/ValueInputSlot.js +5 -0
- package/dist/style/colors.d.ts +37 -0
- package/dist/style/colors.js +43 -0
- package/dist/style/globalStyle.d.ts +2 -0
- package/dist/style/globalStyle.js +49 -0
- package/dist/style/vars.d.ts +2 -0
- package/dist/style/vars.js +2 -0
- package/dist/testHelpers/pluginHelpers.d.ts +5 -0
- package/dist/testHelpers/pluginHelpers.js +25 -0
- package/dist/testHelpers/pluginMocks.d.ts +116 -0
- package/dist/testHelpers/pluginMocks.js +139 -0
- package/package.json +24 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FixtureId } from 'react-cosmos-core';
|
|
2
|
+
export type RendererActionSlotProps = {
|
|
3
|
+
fixtureId: FixtureId;
|
|
4
|
+
};
|
|
5
|
+
type Props = {
|
|
6
|
+
slotProps: RendererActionSlotProps;
|
|
7
|
+
plugOrder: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare function RendererActionSlot({ slotProps, plugOrder }: Props): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FixtureId, FixtureState, StateUpdater } from 'react-cosmos-core';
|
|
2
|
+
export type SidePanelRowSlotProps = {
|
|
3
|
+
fixtureId: FixtureId;
|
|
4
|
+
fixtureState: FixtureState;
|
|
5
|
+
onFixtureStateChange: (stateUpdater: StateUpdater<FixtureState>) => void;
|
|
6
|
+
};
|
|
7
|
+
type Props = {
|
|
8
|
+
slotProps: SidePanelRowSlotProps;
|
|
9
|
+
plugOrder: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare function SidePanelRowSlot({ slotProps, plugOrder }: Props): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FixtureStatePrimitiveValue, FixtureStateUnserializableValue, PrimitiveData } from 'react-cosmos-core';
|
|
3
|
+
type LeafValue = FixtureStatePrimitiveValue | FixtureStateUnserializableValue;
|
|
4
|
+
export type ValueInputSlotProps = {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
value: LeafValue;
|
|
8
|
+
indentLevel: number;
|
|
9
|
+
onChange: (data: PrimitiveData) => unknown;
|
|
10
|
+
};
|
|
11
|
+
type Props = {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
slotProps: ValueInputSlotProps;
|
|
14
|
+
};
|
|
15
|
+
export declare function ValueInputSlot({ children, slotProps }: Props): JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const grey8: string;
|
|
2
|
+
export declare const grey24: string;
|
|
3
|
+
export declare const grey32: string;
|
|
4
|
+
export declare const grey64: string;
|
|
5
|
+
export declare const grey96: string;
|
|
6
|
+
export declare const grey128: string;
|
|
7
|
+
export declare const grey160: string;
|
|
8
|
+
export declare const grey144: string;
|
|
9
|
+
export declare const grey176: string;
|
|
10
|
+
export declare const grey192: string;
|
|
11
|
+
export declare const grey208: string;
|
|
12
|
+
export declare const grey216: string;
|
|
13
|
+
export declare const grey224: string;
|
|
14
|
+
export declare const grey248: string;
|
|
15
|
+
export declare const black60: string;
|
|
16
|
+
export declare const white3: string;
|
|
17
|
+
export declare const white10: string;
|
|
18
|
+
export declare const white20: string;
|
|
19
|
+
export declare const white95: string;
|
|
20
|
+
export declare const blue = "#3182ce";
|
|
21
|
+
export declare const lightBlue = "#63b3ed";
|
|
22
|
+
export declare const screenGrey1 = "hsl(230, 17%, 22%)";
|
|
23
|
+
export declare const screenGrey2 = "hsl(230, 19%, 33%)";
|
|
24
|
+
export declare const screenGrey3 = "hsl(230, 22%, 49%)";
|
|
25
|
+
export declare const screenGrey4 = "hsl(230, 25%, 74%)";
|
|
26
|
+
export declare const screenGrey5 = "hsl(230, 28%, 85%)";
|
|
27
|
+
export declare const screenGrey6 = "hsl(230, 32%, 93%)";
|
|
28
|
+
export declare const screenPrimary1 = "hsl(230, 48%, 32%)";
|
|
29
|
+
export declare const screenPrimary2 = "hsl(230, 51%, 43%)";
|
|
30
|
+
export declare const screenPrimary3 = "hsl(230, 65%, 61%)";
|
|
31
|
+
export declare function selectedColors(defaultColor: string, selectedColor: string): (props: {
|
|
32
|
+
selected?: boolean;
|
|
33
|
+
}) => string;
|
|
34
|
+
export declare function disabledColors(defaultColor: string, disabledColor: string): (props: {
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
}) => string;
|
|
37
|
+
export declare function createGreyColor(intensity: number, alpha?: number): string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Chrome colors (neutral)
|
|
2
|
+
export const grey8 = createGreyColor(8);
|
|
3
|
+
export const grey24 = createGreyColor(24);
|
|
4
|
+
export const grey32 = createGreyColor(32);
|
|
5
|
+
export const grey64 = createGreyColor(64);
|
|
6
|
+
export const grey96 = createGreyColor(96);
|
|
7
|
+
export const grey128 = createGreyColor(128);
|
|
8
|
+
export const grey160 = createGreyColor(160);
|
|
9
|
+
export const grey144 = createGreyColor(144);
|
|
10
|
+
export const grey176 = createGreyColor(176);
|
|
11
|
+
export const grey192 = createGreyColor(192);
|
|
12
|
+
export const grey208 = createGreyColor(208);
|
|
13
|
+
export const grey216 = createGreyColor(216);
|
|
14
|
+
export const grey224 = createGreyColor(224);
|
|
15
|
+
export const grey248 = createGreyColor(248);
|
|
16
|
+
export const black60 = createGreyColor(0, 0.6);
|
|
17
|
+
export const white3 = createGreyColor(255, 0.03);
|
|
18
|
+
export const white10 = createGreyColor(255, 0.1);
|
|
19
|
+
export const white20 = createGreyColor(255, 0.2);
|
|
20
|
+
export const white95 = createGreyColor(255, 0.95);
|
|
21
|
+
export const blue = '#3182ce';
|
|
22
|
+
export const lightBlue = '#63b3ed';
|
|
23
|
+
// Screen colors
|
|
24
|
+
export const screenGrey1 = 'hsl(230, 17%, 22%)';
|
|
25
|
+
export const screenGrey2 = 'hsl(230, 19%, 33%)';
|
|
26
|
+
export const screenGrey3 = 'hsl(230, 22%, 49%)';
|
|
27
|
+
export const screenGrey4 = 'hsl(230, 25%, 74%)';
|
|
28
|
+
export const screenGrey5 = 'hsl(230, 28%, 85%)';
|
|
29
|
+
export const screenGrey6 = 'hsl(230, 32%, 93%)';
|
|
30
|
+
export const screenPrimary1 = 'hsl(230, 48%, 32%)';
|
|
31
|
+
export const screenPrimary2 = 'hsl(230, 51%, 43%)';
|
|
32
|
+
export const screenPrimary3 = 'hsl(230, 65%, 61%)';
|
|
33
|
+
export function selectedColors(defaultColor, selectedColor) {
|
|
34
|
+
return (props) => props.selected ? selectedColor : defaultColor;
|
|
35
|
+
}
|
|
36
|
+
export function disabledColors(defaultColor, disabledColor) {
|
|
37
|
+
return (props) => props.disabled ? disabledColor : defaultColor;
|
|
38
|
+
}
|
|
39
|
+
export function createGreyColor(intensity, alpha = 1) {
|
|
40
|
+
return alpha !== 1
|
|
41
|
+
? `rgba(${intensity}, ${intensity}, ${intensity}, ${alpha})`
|
|
42
|
+
: `rgb(${intensity}, ${intensity}, ${intensity})`;
|
|
43
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createGlobalStyle } from 'styled-components';
|
|
2
|
+
import { grey8, white3 } from './colors.js';
|
|
3
|
+
import { fontFamily } from './vars.js';
|
|
4
|
+
export const GlobalStyle = createGlobalStyle `
|
|
5
|
+
html {
|
|
6
|
+
font-family: ${fontFamily};
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
-webkit-font-smoothing: antialiased;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
body, p, ul, ol, li, h1, h2, h3, button, input, textarea, select {
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
input, textarea, button {
|
|
17
|
+
font-family: ${fontFamily};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
input, textarea, button {
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
a {}
|
|
25
|
+
`;
|
|
26
|
+
export const CosmosGlobalStyle = createGlobalStyle `
|
|
27
|
+
body {
|
|
28
|
+
background-color: ${grey8};
|
|
29
|
+
/* Black checkerboard effect on background */
|
|
30
|
+
background-image: linear-gradient(
|
|
31
|
+
45deg,
|
|
32
|
+
${white3} 25%,
|
|
33
|
+
transparent 25%,
|
|
34
|
+
transparent 75%,
|
|
35
|
+
${white3} 75%,
|
|
36
|
+
${white3} 100%
|
|
37
|
+
),
|
|
38
|
+
linear-gradient(
|
|
39
|
+
45deg,
|
|
40
|
+
${white3} 25%,
|
|
41
|
+
transparent 25%,
|
|
42
|
+
transparent 75%,
|
|
43
|
+
${white3} 75%,
|
|
44
|
+
${white3} 100%
|
|
45
|
+
);
|
|
46
|
+
background-size: 32px 32px;
|
|
47
|
+
background-position: 0 0, 16px 16px;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PlugComponentType, PluginEventHandlers, PluginMethodHandlers, PluginSpec, PluginWithEvents, PluginWithMethods } from 'react-plugin';
|
|
2
|
+
export declare function getMethodsOf<Spec extends PluginSpec>(pluginName: Spec['name']): Spec["methods"] extends import("ui-plugin/dist/types/PluginSpec").PluginMethods ? Spec["methods"] : never;
|
|
3
|
+
export declare function on<Spec extends PluginWithEvents>(pluginName: Spec['name'], handlers: PluginEventHandlers<any, Spec>): void;
|
|
4
|
+
export declare function mockMethodsOf<Spec extends PluginWithMethods>(pluginName: Spec['name'], methods: PluginMethodHandlers<Spec>): void;
|
|
5
|
+
export declare function mockPlug<SlotProps extends {} = {}>(slotName: string, component: PlugComponentType<any, any>): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createPlugin, getPluginContext, } from 'react-plugin';
|
|
2
|
+
export function getMethodsOf(pluginName) {
|
|
3
|
+
const name = getNewPluginName();
|
|
4
|
+
createPlugin({ name }).register();
|
|
5
|
+
return getPluginContext(name).getMethodsOf(pluginName);
|
|
6
|
+
}
|
|
7
|
+
export function on(pluginName, handlers) {
|
|
8
|
+
const name = getNewPluginName();
|
|
9
|
+
const testPlugin = createPlugin({ name });
|
|
10
|
+
testPlugin.on(pluginName, handlers);
|
|
11
|
+
testPlugin.register();
|
|
12
|
+
}
|
|
13
|
+
export function mockMethodsOf(pluginName, methods) {
|
|
14
|
+
createPlugin({ name: pluginName, methods }).register();
|
|
15
|
+
}
|
|
16
|
+
export function mockPlug(slotName, component) {
|
|
17
|
+
const name = getNewPluginName();
|
|
18
|
+
const testPlugin = createPlugin({ name });
|
|
19
|
+
testPlugin.plug(slotName, component);
|
|
20
|
+
testPlugin.register();
|
|
21
|
+
}
|
|
22
|
+
let pluginId = 0;
|
|
23
|
+
function getNewPluginName() {
|
|
24
|
+
return `test${pluginId++}`;
|
|
25
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { PluginEventHandlers, PluginMethodHandlers, PluginWithEvents, PluginWithMethods } from 'react-plugin';
|
|
3
|
+
import { CoreSpec } from '../plugins/Core/spec.js';
|
|
4
|
+
import { FixtureTreeSpec } from '../plugins/FixtureTree/spec.js';
|
|
5
|
+
import { MessageHandlerSpec } from '../plugins/MessageHandler/spec.js';
|
|
6
|
+
import { NotificationsSpec } from '../plugins/Notifications/spec.js';
|
|
7
|
+
import { RendererCoreSpec } from '../plugins/RendererCore/spec.js';
|
|
8
|
+
import { RendererPreviewSpec } from '../plugins/RendererPreview/spec.js';
|
|
9
|
+
import { RouterSpec } from '../plugins/Router/spec.js';
|
|
10
|
+
import { StorageSpec } from '../plugins/Storage/spec.js';
|
|
11
|
+
type MethodsOf<Spec extends PluginWithMethods> = Partial<PluginMethodHandlers<Spec>>;
|
|
12
|
+
type EventsOf<Spec extends PluginWithEvents> = PluginEventHandlers<any, Spec>;
|
|
13
|
+
export declare function getRouterContext(): import("react-plugin").PluginContext<RouterSpec>;
|
|
14
|
+
export declare function getMessageHandlerContext(): import("react-plugin").PluginContext<MessageHandlerSpec>;
|
|
15
|
+
export declare function getRendererCoreContext(): import("react-plugin").PluginContext<RendererCoreSpec>;
|
|
16
|
+
export declare function getRouterMethods(): {
|
|
17
|
+
getSelectedFixtureId(): import("react-cosmos-core").FixtureId | null;
|
|
18
|
+
selectFixture(fixtureId: import("react-cosmos-core").FixtureId): void;
|
|
19
|
+
unselectFixture(): void;
|
|
20
|
+
};
|
|
21
|
+
export declare function getMessageHandlerMethods(): {
|
|
22
|
+
postRendererRequest(msg: import("react-cosmos-core").MessageType): unknown;
|
|
23
|
+
};
|
|
24
|
+
export declare function getCoreMethods(): {
|
|
25
|
+
registerCommands(commands: import("../plugins/Core/spec.js").Commands): () => void;
|
|
26
|
+
runCommand(name: string): unknown;
|
|
27
|
+
getProjectId(): string;
|
|
28
|
+
getFixtureFileVars(): {
|
|
29
|
+
fixturesDir: string;
|
|
30
|
+
fixtureFileSuffix: string;
|
|
31
|
+
};
|
|
32
|
+
isDevServerOn(): boolean;
|
|
33
|
+
getWebRendererUrl(): string | null;
|
|
34
|
+
};
|
|
35
|
+
export declare function getRendererCoreMethods(): {
|
|
36
|
+
getConnectedRendererIds(): string[];
|
|
37
|
+
getPrimaryRendererId(): string | null;
|
|
38
|
+
getFixtures(): import("react-cosmos-core").FixtureList;
|
|
39
|
+
getFixtureState(): import("react-cosmos-core").FixtureState;
|
|
40
|
+
isRendererConnected(): boolean;
|
|
41
|
+
isValidFixtureSelected(): boolean;
|
|
42
|
+
setFixtureState(stateUpdater: import("react-cosmos-core").StateUpdater<import("react-cosmos-core").FixtureState>): void;
|
|
43
|
+
selectPrimaryRenderer(primaryRendererId: string): void;
|
|
44
|
+
receiveResponse(msg: import("react-cosmos-core").MessageType): void;
|
|
45
|
+
};
|
|
46
|
+
export declare function getNotificationsMethods(): {
|
|
47
|
+
pushStickyNotification(notification: import("../plugins/Notifications/spec.js").NotificationItem): void;
|
|
48
|
+
removeStickyNotification(notificationId: string): void;
|
|
49
|
+
pushTimedNotification(notification: import("../plugins/Notifications/spec.js").NotificationItem): void;
|
|
50
|
+
};
|
|
51
|
+
export declare function getRendererPreviewMethods(): {
|
|
52
|
+
getUrlStatus(): import("../plugins/RendererPreview/spec.js").UrlStatus;
|
|
53
|
+
getRuntimeStatus(): import("../plugins/RendererPreview/spec.js").RuntimeStatus;
|
|
54
|
+
};
|
|
55
|
+
export declare function mockStorage(methods?: MethodsOf<StorageSpec>): {
|
|
56
|
+
loadCache: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<StorageSpec>, projectId: string) => Promise<unknown>);
|
|
57
|
+
getItem: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<StorageSpec>, key: string) => unknown);
|
|
58
|
+
setItem: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<StorageSpec>, key: string, value: unknown) => void);
|
|
59
|
+
};
|
|
60
|
+
export declare function mockRouter(methods?: MethodsOf<RouterSpec>): {
|
|
61
|
+
getSelectedFixtureId: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RouterSpec>) => import("react-cosmos-core").FixtureId | null);
|
|
62
|
+
selectFixture: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RouterSpec>, fixtureId: import("react-cosmos-core").FixtureId) => void);
|
|
63
|
+
unselectFixture: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RouterSpec>) => void);
|
|
64
|
+
};
|
|
65
|
+
export declare function mockCore(methods?: MethodsOf<CoreSpec>): {
|
|
66
|
+
registerCommands: (() => jest.Mock<any, any, any>) | ((context: import("react-plugin").PluginContext<CoreSpec>, commands: import("../plugins/Core/spec.js").Commands) => () => void);
|
|
67
|
+
runCommand: (context: import("react-plugin").PluginContext<CoreSpec>, name: string) => unknown;
|
|
68
|
+
getProjectId: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<CoreSpec>) => string);
|
|
69
|
+
getFixtureFileVars: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<CoreSpec>) => {
|
|
70
|
+
fixturesDir: string;
|
|
71
|
+
fixtureFileSuffix: string;
|
|
72
|
+
});
|
|
73
|
+
isDevServerOn: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<CoreSpec>) => boolean);
|
|
74
|
+
getWebRendererUrl: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<CoreSpec>) => string | null);
|
|
75
|
+
};
|
|
76
|
+
export declare function mockMessageHandler(methods?: MethodsOf<MessageHandlerSpec>): {
|
|
77
|
+
postRendererRequest: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<MessageHandlerSpec>, msg: import("react-cosmos-core").MessageType) => unknown);
|
|
78
|
+
};
|
|
79
|
+
export declare function mockRendererCore(methods?: MethodsOf<RendererCoreSpec>): {
|
|
80
|
+
getConnectedRendererIds: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererCoreSpec>) => string[]);
|
|
81
|
+
getPrimaryRendererId: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererCoreSpec>) => string | null);
|
|
82
|
+
getFixtures: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererCoreSpec>) => import("react-cosmos-core").FixtureList);
|
|
83
|
+
getFixtureState: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererCoreSpec>) => import("react-cosmos-core").FixtureState);
|
|
84
|
+
isRendererConnected: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererCoreSpec>) => boolean);
|
|
85
|
+
isValidFixtureSelected: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererCoreSpec>) => boolean);
|
|
86
|
+
setFixtureState: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererCoreSpec>, stateUpdater: import("react-cosmos-core").StateUpdater<import("react-cosmos-core").FixtureState>) => void);
|
|
87
|
+
selectPrimaryRenderer: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererCoreSpec>, primaryRendererId: string) => void);
|
|
88
|
+
receiveResponse: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererCoreSpec>, msg: import("react-cosmos-core").MessageType) => void);
|
|
89
|
+
};
|
|
90
|
+
export declare function mockRendererPreview(methods?: MethodsOf<RendererPreviewSpec>): {
|
|
91
|
+
getUrlStatus: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererPreviewSpec>) => import("../plugins/RendererPreview/spec.js").UrlStatus);
|
|
92
|
+
getRuntimeStatus: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<RendererPreviewSpec>) => import("../plugins/RendererPreview/spec.js").RuntimeStatus);
|
|
93
|
+
};
|
|
94
|
+
export declare function mockNotifications(methods?: MethodsOf<NotificationsSpec>): {
|
|
95
|
+
pushStickyNotification: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<NotificationsSpec>, notification: import("../plugins/Notifications/spec.js").NotificationItem) => void);
|
|
96
|
+
removeStickyNotification: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<NotificationsSpec>, notificationId: string) => void);
|
|
97
|
+
pushTimedNotification: jest.Mock<any, any, any> | ((context: import("react-plugin").PluginContext<NotificationsSpec>, notification: import("../plugins/Notifications/spec.js").NotificationItem) => void);
|
|
98
|
+
};
|
|
99
|
+
export declare function mockFixtureTree(methods?: MethodsOf<FixtureTreeSpec>): {
|
|
100
|
+
revealFixture: jest.Mock<any, any, any> | ((context: {
|
|
101
|
+
pluginName: "fixtureTree";
|
|
102
|
+
getMethodsOf: <T extends import("react-plugin").PluginSpec>(pluginName: T["name"]) => T["methods"] extends import("ui-plugin/dist/types/PluginSpec.js").PluginMethods ? T["methods"] : never;
|
|
103
|
+
}, fixtureId: import("react-cosmos-core").FixtureId) => unknown);
|
|
104
|
+
};
|
|
105
|
+
export declare function onRouter(events?: EventsOf<RouterSpec>): {
|
|
106
|
+
fixtureChange: jest.Mock<any, any, any> | import("ui-plugin/dist/types/PluginContextHandlers.js").PluginEventHandler<any, [fixtureId: import("react-cosmos-core").FixtureId | null]>;
|
|
107
|
+
};
|
|
108
|
+
export declare function onMessageHandler(events?: EventsOf<MessageHandlerSpec>): {
|
|
109
|
+
serverMessage: jest.Mock<any, any, any> | import("ui-plugin/dist/types/PluginContextHandlers.js").PluginEventHandler<any, [msg: import("react-cosmos-core").MessageType]>;
|
|
110
|
+
rendererResponse: jest.Mock<any, any, any> | import("ui-plugin/dist/types/PluginContextHandlers.js").PluginEventHandler<any, [msg: import("react-cosmos-core").MessageType]>;
|
|
111
|
+
};
|
|
112
|
+
export declare function onRendererCore(events?: EventsOf<RendererCoreSpec>): {
|
|
113
|
+
request: jest.Mock<any, any, any> | import("ui-plugin/dist/types/PluginContextHandlers.js").PluginEventHandler<any, [msg: import("react-cosmos-core").MessageType]>;
|
|
114
|
+
response: jest.Mock<any, any, any> | import("ui-plugin/dist/types/PluginContextHandlers.js").PluginEventHandler<any, [msg: import("react-cosmos-core").MessageType]>;
|
|
115
|
+
};
|
|
116
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { getPluginContext, } from 'react-plugin';
|
|
2
|
+
import { getMethodsOf, mockMethodsOf, on } from './pluginHelpers.js';
|
|
3
|
+
export function getRouterContext() {
|
|
4
|
+
return getPluginContext('router');
|
|
5
|
+
}
|
|
6
|
+
export function getMessageHandlerContext() {
|
|
7
|
+
return getPluginContext('messageHandler');
|
|
8
|
+
}
|
|
9
|
+
export function getRendererCoreContext() {
|
|
10
|
+
return getPluginContext('rendererCore');
|
|
11
|
+
}
|
|
12
|
+
export function getRouterMethods() {
|
|
13
|
+
return getMethodsOf('router');
|
|
14
|
+
}
|
|
15
|
+
export function getMessageHandlerMethods() {
|
|
16
|
+
return getMethodsOf('messageHandler');
|
|
17
|
+
}
|
|
18
|
+
export function getCoreMethods() {
|
|
19
|
+
return getMethodsOf('core');
|
|
20
|
+
}
|
|
21
|
+
export function getRendererCoreMethods() {
|
|
22
|
+
return getMethodsOf('rendererCore');
|
|
23
|
+
}
|
|
24
|
+
export function getNotificationsMethods() {
|
|
25
|
+
return getMethodsOf('notifications');
|
|
26
|
+
}
|
|
27
|
+
export function getRendererPreviewMethods() {
|
|
28
|
+
return getMethodsOf('rendererPreview');
|
|
29
|
+
}
|
|
30
|
+
export function mockStorage(methods = {}) {
|
|
31
|
+
const allMethods = {
|
|
32
|
+
loadCache: jest.fn(),
|
|
33
|
+
getItem: jest.fn(),
|
|
34
|
+
setItem: jest.fn(),
|
|
35
|
+
...methods,
|
|
36
|
+
};
|
|
37
|
+
mockMethodsOf('storage', allMethods);
|
|
38
|
+
return allMethods;
|
|
39
|
+
}
|
|
40
|
+
export function mockRouter(methods = {}) {
|
|
41
|
+
const allMethods = {
|
|
42
|
+
getSelectedFixtureId: jest.fn(),
|
|
43
|
+
selectFixture: jest.fn(),
|
|
44
|
+
unselectFixture: jest.fn(),
|
|
45
|
+
...methods,
|
|
46
|
+
};
|
|
47
|
+
mockMethodsOf('router', allMethods);
|
|
48
|
+
return allMethods;
|
|
49
|
+
}
|
|
50
|
+
export function mockCore(methods = {}) {
|
|
51
|
+
const allMethods = {
|
|
52
|
+
registerCommands: () => jest.fn(),
|
|
53
|
+
runCommand: () => jest.fn(),
|
|
54
|
+
getProjectId: jest.fn(),
|
|
55
|
+
getFixtureFileVars: jest.fn(),
|
|
56
|
+
isDevServerOn: jest.fn(),
|
|
57
|
+
getWebRendererUrl: jest.fn(),
|
|
58
|
+
...methods,
|
|
59
|
+
};
|
|
60
|
+
mockMethodsOf('core', allMethods);
|
|
61
|
+
return allMethods;
|
|
62
|
+
}
|
|
63
|
+
export function mockMessageHandler(methods = {}) {
|
|
64
|
+
const allMethods = {
|
|
65
|
+
postRendererRequest: jest.fn(),
|
|
66
|
+
...methods,
|
|
67
|
+
};
|
|
68
|
+
mockMethodsOf('messageHandler', allMethods);
|
|
69
|
+
return allMethods;
|
|
70
|
+
}
|
|
71
|
+
export function mockRendererCore(methods = {}) {
|
|
72
|
+
const allMethods = {
|
|
73
|
+
getConnectedRendererIds: jest.fn(),
|
|
74
|
+
getPrimaryRendererId: jest.fn(),
|
|
75
|
+
getFixtures: jest.fn(),
|
|
76
|
+
getFixtureState: jest.fn(),
|
|
77
|
+
isRendererConnected: jest.fn(),
|
|
78
|
+
isValidFixtureSelected: jest.fn(),
|
|
79
|
+
setFixtureState: jest.fn(),
|
|
80
|
+
selectPrimaryRenderer: jest.fn(),
|
|
81
|
+
receiveResponse: jest.fn(),
|
|
82
|
+
...methods,
|
|
83
|
+
};
|
|
84
|
+
mockMethodsOf('rendererCore', allMethods);
|
|
85
|
+
return allMethods;
|
|
86
|
+
}
|
|
87
|
+
export function mockRendererPreview(methods = {}) {
|
|
88
|
+
const allMethods = {
|
|
89
|
+
getUrlStatus: jest.fn(),
|
|
90
|
+
getRuntimeStatus: jest.fn(),
|
|
91
|
+
...methods,
|
|
92
|
+
};
|
|
93
|
+
mockMethodsOf('rendererPreview', allMethods);
|
|
94
|
+
return allMethods;
|
|
95
|
+
}
|
|
96
|
+
export function mockNotifications(methods = {}) {
|
|
97
|
+
const allMethods = {
|
|
98
|
+
pushStickyNotification: jest.fn(),
|
|
99
|
+
removeStickyNotification: jest.fn(),
|
|
100
|
+
pushTimedNotification: jest.fn(),
|
|
101
|
+
...methods,
|
|
102
|
+
};
|
|
103
|
+
mockMethodsOf('notifications', allMethods);
|
|
104
|
+
return allMethods;
|
|
105
|
+
}
|
|
106
|
+
export function mockFixtureTree(methods = {}) {
|
|
107
|
+
const allMethods = {
|
|
108
|
+
revealFixture: jest.fn(),
|
|
109
|
+
...methods,
|
|
110
|
+
};
|
|
111
|
+
mockMethodsOf('fixtureTree', allMethods);
|
|
112
|
+
return allMethods;
|
|
113
|
+
}
|
|
114
|
+
export function onRouter(events = {}) {
|
|
115
|
+
const allEvents = {
|
|
116
|
+
fixtureChange: jest.fn(),
|
|
117
|
+
...events,
|
|
118
|
+
};
|
|
119
|
+
on('router', allEvents);
|
|
120
|
+
return allEvents;
|
|
121
|
+
}
|
|
122
|
+
export function onMessageHandler(events = {}) {
|
|
123
|
+
const allEvents = {
|
|
124
|
+
serverMessage: jest.fn(),
|
|
125
|
+
rendererResponse: jest.fn(),
|
|
126
|
+
...events,
|
|
127
|
+
};
|
|
128
|
+
on('messageHandler', allEvents);
|
|
129
|
+
return allEvents;
|
|
130
|
+
}
|
|
131
|
+
export function onRendererCore(events = {}) {
|
|
132
|
+
const allEvents = {
|
|
133
|
+
request: jest.fn(),
|
|
134
|
+
response: jest.fn(),
|
|
135
|
+
...events,
|
|
136
|
+
};
|
|
137
|
+
on('rendererCore', allEvents);
|
|
138
|
+
return allEvents;
|
|
139
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-cosmos-ui",
|
|
3
|
+
"version": "6.0.0-alpha.0",
|
|
4
|
+
"description": "React Cosmos UI",
|
|
5
|
+
"repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos-ui",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"sideEffects": [
|
|
10
|
+
"./dist/plugins/pluginEntry.js",
|
|
11
|
+
"./dist/plugins/*/index.js"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"lodash-es": "^4.17.21",
|
|
15
|
+
"react-cosmos-core": "^6.0.0-alpha.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"fuzzaldrin-plus": "^0.6.0",
|
|
19
|
+
"localforage": "^1.10.0",
|
|
20
|
+
"react-plugin": "^3.0.0-alpha.4",
|
|
21
|
+
"styled-components": "^5.3.6"
|
|
22
|
+
},
|
|
23
|
+
"gitHead": "b021231584639f3028fe08deacd418f0ec4cc002"
|
|
24
|
+
}
|