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.
Files changed (377) hide show
  1. package/LICENSE +21 -0
  2. package/dist/components/BaseSvg.d.ts +9 -0
  3. package/dist/components/BaseSvg.js +8 -0
  4. package/dist/components/Icon.d.ts +7 -0
  5. package/dist/components/Icon.js +5 -0
  6. package/dist/components/Illustration.d.ts +8 -0
  7. package/dist/components/Illustration.js +5 -0
  8. package/dist/components/KeyBox.d.ts +9 -0
  9. package/dist/components/KeyBox.js +28 -0
  10. package/dist/components/SidePanel.d.ts +10 -0
  11. package/dist/components/SidePanel.js +52 -0
  12. package/dist/components/Space.d.ts +7 -0
  13. package/dist/components/Space.js +8 -0
  14. package/dist/components/TreeView.d.ts +19 -0
  15. package/dist/components/TreeView.js +26 -0
  16. package/dist/components/ValueInputTree/ExpandCollapseValues.d.ts +9 -0
  17. package/dist/components/ValueInputTree/ExpandCollapseValues.js +11 -0
  18. package/dist/components/ValueInputTree/ValueInput/BooleanValueInput.d.ts +8 -0
  19. package/dist/components/ValueInputTree/ValueInput/BooleanValueInput.js +32 -0
  20. package/dist/components/ValueInputTree/ValueInput/NullValueInput.d.ts +5 -0
  21. package/dist/components/ValueInputTree/ValueInput/NullValueInput.js +9 -0
  22. package/dist/components/ValueInputTree/ValueInput/NumberValueInput.d.ts +8 -0
  23. package/dist/components/ValueInputTree/ValueInput/NumberValueInput.js +14 -0
  24. package/dist/components/ValueInputTree/ValueInput/StringValueInput.d.ts +8 -0
  25. package/dist/components/ValueInputTree/ValueInput/StringValueInput.js +18 -0
  26. package/dist/components/ValueInputTree/ValueInput/UndefinedValueInput.d.ts +5 -0
  27. package/dist/components/ValueInputTree/ValueInput/UndefinedValueInput.js +9 -0
  28. package/dist/components/ValueInputTree/ValueInput/UnserializableValueInput.d.ts +6 -0
  29. package/dist/components/ValueInputTree/ValueInput/UnserializableValueInput.js +11 -0
  30. package/dist/components/ValueInputTree/ValueInput/ValueInput.d.ts +11 -0
  31. package/dist/components/ValueInputTree/ValueInput/ValueInput.js +30 -0
  32. package/dist/components/ValueInputTree/ValueInput/shared.d.ts +6 -0
  33. package/dist/components/ValueInputTree/ValueInput/shared.js +41 -0
  34. package/dist/components/ValueInputTree/ValueInputDir.d.ts +9 -0
  35. package/dist/components/ValueInputTree/ValueInputDir.js +68 -0
  36. package/dist/components/ValueInputTree/ValueInputTree.d.ts +12 -0
  37. package/dist/components/ValueInputTree/ValueInputTree.js +32 -0
  38. package/dist/components/ValueInputTree/index.d.ts +4 -0
  39. package/dist/components/ValueInputTree/index.js +4 -0
  40. package/dist/components/ValueInputTree/shared.d.ts +16 -0
  41. package/dist/components/ValueInputTree/shared.js +15 -0
  42. package/dist/components/ValueInputTree/valueGroups.d.ts +8 -0
  43. package/dist/components/ValueInputTree/valueGroups.js +10 -0
  44. package/dist/components/ValueInputTree/valueTree.d.ts +3 -0
  45. package/dist/components/ValueInputTree/valueTree.js +20 -0
  46. package/dist/components/ValueInputTree/valueTreeExpansion.d.ts +7 -0
  47. package/dist/components/ValueInputTree/valueTreeExpansion.js +16 -0
  48. package/dist/components/buttons/Button32.d.ts +11 -0
  49. package/dist/components/buttons/Button32.js +8 -0
  50. package/dist/components/buttons/Button8.d.ts +11 -0
  51. package/dist/components/buttons/Button8.js +8 -0
  52. package/dist/components/buttons/IconButton32.d.ts +10 -0
  53. package/dist/components/buttons/IconButton32.js +7 -0
  54. package/dist/components/buttons/IconButton8.d.ts +10 -0
  55. package/dist/components/buttons/IconButton8.js +7 -0
  56. package/dist/components/buttons/index.d.ts +4 -0
  57. package/dist/components/buttons/index.js +4 -0
  58. package/dist/components/buttons/shared.d.ts +15 -0
  59. package/dist/components/buttons/shared.js +52 -0
  60. package/dist/components/icons/index.d.ts +33 -0
  61. package/dist/components/icons/index.js +107 -0
  62. package/dist/components/illustrations/ArtificialIntelligence.d.ts +3 -0
  63. package/dist/components/illustrations/ArtificialIntelligence.js +123 -0
  64. package/dist/components/illustrations/Astronaut.d.ts +3 -0
  65. package/dist/components/illustrations/Astronaut.js +72 -0
  66. package/dist/components/illustrations/BlankCanvas.d.ts +3 -0
  67. package/dist/components/illustrations/BlankCanvas.js +75 -0
  68. package/dist/components/inputs/NumberInput.d.ts +15 -0
  69. package/dist/components/inputs/NumberInput.js +79 -0
  70. package/dist/components/inputs/Select.d.ts +16 -0
  71. package/dist/components/inputs/Select.js +69 -0
  72. package/dist/components/inputs/shared.d.ts +14 -0
  73. package/dist/components/inputs/shared.js +43 -0
  74. package/dist/cosmos.decorator.d.ts +5 -0
  75. package/dist/cosmos.decorator.js +6 -0
  76. package/dist/cosmos.loadPlugins.d.ts +1 -0
  77. package/dist/cosmos.loadPlugins.js +17 -0
  78. package/dist/hooks/useDrag.d.ts +14 -0
  79. package/dist/hooks/useDrag.js +58 -0
  80. package/dist/hooks/useFocus.d.ts +5 -0
  81. package/dist/hooks/useFocus.js +7 -0
  82. package/dist/index.d.ts +36 -0
  83. package/dist/index.js +36 -0
  84. package/dist/playground.bundle.js +1358 -0
  85. package/dist/playground.bundle.js.LICENSE.txt +64 -0
  86. package/dist/playground.bundle.js.map +1 -0
  87. package/dist/playground.d.ts +11 -0
  88. package/dist/playground.js +36 -0
  89. package/dist/playgroundConfig.d.ts +10 -0
  90. package/dist/playgroundConfig.js +1 -0
  91. package/dist/plugins/BuildNotifications/index.d.ts +2 -0
  92. package/dist/plugins/BuildNotifications/index.js +35 -0
  93. package/dist/plugins/BuildNotifications/spec.d.ts +3 -0
  94. package/dist/plugins/BuildNotifications/spec.js +1 -0
  95. package/dist/plugins/ClassStatePanel/ClassStatePanel/ComponentClassState.d.ts +10 -0
  96. package/dist/plugins/ClassStatePanel/ClassStatePanel/ComponentClassState.js +36 -0
  97. package/dist/plugins/ClassStatePanel/ClassStatePanel/index.d.ts +11 -0
  98. package/dist/plugins/ClassStatePanel/ClassStatePanel/index.js +13 -0
  99. package/dist/plugins/ClassStatePanel/ClassStatePanel/shared.d.ts +2 -0
  100. package/dist/plugins/ClassStatePanel/ClassStatePanel/shared.js +16 -0
  101. package/dist/plugins/ClassStatePanel/index.d.ts +2 -0
  102. package/dist/plugins/ClassStatePanel/index.js +30 -0
  103. package/dist/plugins/ClassStatePanel/shared.d.ts +1 -0
  104. package/dist/plugins/ClassStatePanel/shared.js +1 -0
  105. package/dist/plugins/ClassStatePanel/spec.d.ts +3 -0
  106. package/dist/plugins/ClassStatePanel/spec.js +1 -0
  107. package/dist/plugins/ContentOverlay/ContentOverlay.d.ts +13 -0
  108. package/dist/plugins/ContentOverlay/ContentOverlay.js +34 -0
  109. package/dist/plugins/ContentOverlay/KeyShortcut.d.ts +6 -0
  110. package/dist/plugins/ContentOverlay/KeyShortcut.js +30 -0
  111. package/dist/plugins/ContentOverlay/NoFixtureSelected.d.ts +5 -0
  112. package/dist/plugins/ContentOverlay/NoFixtureSelected.js +34 -0
  113. package/dist/plugins/ContentOverlay/RendererNotResponding.d.ts +1 -0
  114. package/dist/plugins/ContentOverlay/RendererNotResponding.js +109 -0
  115. package/dist/plugins/ContentOverlay/WelcomeCosmos.d.ts +5 -0
  116. package/dist/plugins/ContentOverlay/WelcomeCosmos.js +158 -0
  117. package/dist/plugins/ContentOverlay/cosmos.decorator.d.ts +5 -0
  118. package/dist/plugins/ContentOverlay/cosmos.decorator.js +13 -0
  119. package/dist/plugins/ContentOverlay/index.d.ts +2 -0
  120. package/dist/plugins/ContentOverlay/index.js +19 -0
  121. package/dist/plugins/ContentOverlay/shared.d.ts +9 -0
  122. package/dist/plugins/ContentOverlay/shared.js +75 -0
  123. package/dist/plugins/ContentOverlay/spec.d.ts +3 -0
  124. package/dist/plugins/ContentOverlay/spec.js +1 -0
  125. package/dist/plugins/ContentOverlay/welcomeDismiss.d.ts +7 -0
  126. package/dist/plugins/ContentOverlay/welcomeDismiss.js +17 -0
  127. package/dist/plugins/ControlPanel/ControlPanel.d.ts +8 -0
  128. package/dist/plugins/ControlPanel/ControlPanel.js +37 -0
  129. package/dist/plugins/ControlPanel/index.d.ts +2 -0
  130. package/dist/plugins/ControlPanel/index.js +17 -0
  131. package/dist/plugins/ControlPanel/spec.d.ts +6 -0
  132. package/dist/plugins/ControlPanel/spec.js +1 -0
  133. package/dist/plugins/ControlSelect/SelectValueInput.d.ts +8 -0
  134. package/dist/plugins/ControlSelect/SelectValueInput.js +15 -0
  135. package/dist/plugins/ControlSelect/index.d.ts +2 -0
  136. package/dist/plugins/ControlSelect/index.js +22 -0
  137. package/dist/plugins/ControlSelect/spec.d.ts +3 -0
  138. package/dist/plugins/ControlSelect/spec.js +1 -0
  139. package/dist/plugins/Core/index.d.ts +2 -0
  140. package/dist/plugins/Core/index.js +68 -0
  141. package/dist/plugins/Core/spec.d.ts +25 -0
  142. package/dist/plugins/Core/spec.js +1 -0
  143. package/dist/plugins/FixtureBookmark/BookmarkFixtureButton.d.ts +6 -0
  144. package/dist/plugins/FixtureBookmark/BookmarkFixtureButton.js +6 -0
  145. package/dist/plugins/FixtureBookmark/FixtureBookmarks.d.ts +10 -0
  146. package/dist/plugins/FixtureBookmark/FixtureBookmarks.js +123 -0
  147. package/dist/plugins/FixtureBookmark/index.d.ts +2 -0
  148. package/dist/plugins/FixtureBookmark/index.js +46 -0
  149. package/dist/plugins/FixtureBookmark/spec.d.ts +3 -0
  150. package/dist/plugins/FixtureBookmark/spec.js +1 -0
  151. package/dist/plugins/FixtureSearch/FixtureSearchHeader.d.ts +7 -0
  152. package/dist/plugins/FixtureSearch/FixtureSearchHeader.js +66 -0
  153. package/dist/plugins/FixtureSearch/FixtureSearchOverlay.d.ts +13 -0
  154. package/dist/plugins/FixtureSearch/FixtureSearchOverlay.js +312 -0
  155. package/dist/plugins/FixtureSearch/FixtureSearchResult.d.ts +9 -0
  156. package/dist/plugins/FixtureSearch/FixtureSearchResult.js +48 -0
  157. package/dist/plugins/FixtureSearch/FixtureSearchShortcuts.d.ts +1 -0
  158. package/dist/plugins/FixtureSearch/FixtureSearchShortcuts.js +60 -0
  159. package/dist/plugins/FixtureSearch/index.d.ts +2 -0
  160. package/dist/plugins/FixtureSearch/index.js +72 -0
  161. package/dist/plugins/FixtureSearch/spec.d.ts +7 -0
  162. package/dist/plugins/FixtureSearch/spec.js +1 -0
  163. package/dist/plugins/FixtureTree/BlankState.d.ts +8 -0
  164. package/dist/plugins/FixtureTree/BlankState.js +75 -0
  165. package/dist/plugins/FixtureTree/FixtureTree/FixtureButton.d.ts +12 -0
  166. package/dist/plugins/FixtureTree/FixtureTree/FixtureButton.js +16 -0
  167. package/dist/plugins/FixtureTree/FixtureTree/FixtureDir.d.ts +9 -0
  168. package/dist/plugins/FixtureTree/FixtureTree/FixtureDir.js +46 -0
  169. package/dist/plugins/FixtureTree/FixtureTree/FixtureLink.d.ts +9 -0
  170. package/dist/plugins/FixtureTree/FixtureTree/FixtureLink.js +34 -0
  171. package/dist/plugins/FixtureTree/FixtureTree/FixtureTree.d.ts +13 -0
  172. package/dist/plugins/FixtureTree/FixtureTree/FixtureTree.js +37 -0
  173. package/dist/plugins/FixtureTree/FixtureTree/FixtureTreeItem.d.ts +6 -0
  174. package/dist/plugins/FixtureTree/FixtureTree/FixtureTreeItem.js +24 -0
  175. package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureButton.d.ts +13 -0
  176. package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureButton.js +46 -0
  177. package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureChildButton.d.ts +12 -0
  178. package/dist/plugins/FixtureTree/FixtureTree/MultiFixtureChildButton.js +26 -0
  179. package/dist/plugins/FixtureTree/FixtureTreeContainer.d.ts +14 -0
  180. package/dist/plugins/FixtureTree/FixtureTreeContainer.js +28 -0
  181. package/dist/plugins/FixtureTree/FixtureTreeHeader.d.ts +11 -0
  182. package/dist/plugins/FixtureTree/FixtureTreeHeader.js +33 -0
  183. package/dist/plugins/FixtureTree/index.d.ts +2 -0
  184. package/dist/plugins/FixtureTree/index.js +25 -0
  185. package/dist/plugins/FixtureTree/revealFixture.d.ts +3 -0
  186. package/dist/plugins/FixtureTree/revealFixture.js +48 -0
  187. package/dist/plugins/FixtureTree/shared.d.ts +7 -0
  188. package/dist/plugins/FixtureTree/shared.js +8 -0
  189. package/dist/plugins/FixtureTree/spec.d.ts +7 -0
  190. package/dist/plugins/FixtureTree/spec.js +1 -0
  191. package/dist/plugins/FixtureTree/useScrollToSelected.d.ts +6 -0
  192. package/dist/plugins/FixtureTree/useScrollToSelected.js +18 -0
  193. package/dist/plugins/FullScreenButton/FullScreenButton.d.ts +5 -0
  194. package/dist/plugins/FullScreenButton/FullScreenButton.js +6 -0
  195. package/dist/plugins/FullScreenButton/index.d.ts +2 -0
  196. package/dist/plugins/FullScreenButton/index.js +25 -0
  197. package/dist/plugins/FullScreenButton/spec.d.ts +3 -0
  198. package/dist/plugins/FullScreenButton/spec.js +1 -0
  199. package/dist/plugins/MessageHandler/index.d.ts +2 -0
  200. package/dist/plugins/MessageHandler/index.js +12 -0
  201. package/dist/plugins/MessageHandler/shared.d.ts +3 -0
  202. package/dist/plugins/MessageHandler/shared.js +1 -0
  203. package/dist/plugins/MessageHandler/socket.d.ts +4 -0
  204. package/dist/plugins/MessageHandler/socket.js +45 -0
  205. package/dist/plugins/MessageHandler/spec.d.ts +11 -0
  206. package/dist/plugins/MessageHandler/spec.js +1 -0
  207. package/dist/plugins/Notifications/Notifications.d.ts +6 -0
  208. package/dist/plugins/Notifications/Notifications.js +75 -0
  209. package/dist/plugins/Notifications/index.d.ts +2 -0
  210. package/dist/plugins/Notifications/index.js +36 -0
  211. package/dist/plugins/Notifications/pushNotification.d.ts +6 -0
  212. package/dist/plugins/Notifications/pushNotification.js +40 -0
  213. package/dist/plugins/Notifications/shared.d.ts +3 -0
  214. package/dist/plugins/Notifications/shared.js +1 -0
  215. package/dist/plugins/Notifications/spec.d.ts +22 -0
  216. package/dist/plugins/Notifications/spec.js +1 -0
  217. package/dist/plugins/PluginList/PluginList.d.ts +10 -0
  218. package/dist/plugins/PluginList/PluginList.js +38 -0
  219. package/dist/plugins/PluginList/index.d.ts +2 -0
  220. package/dist/plugins/PluginList/index.js +12 -0
  221. package/dist/plugins/PluginList/spec.d.ts +3 -0
  222. package/dist/plugins/PluginList/spec.js +1 -0
  223. package/dist/plugins/PropsPanel/BlankState.d.ts +3 -0
  224. package/dist/plugins/PropsPanel/BlankState.js +47 -0
  225. package/dist/plugins/PropsPanel/PropsPanel/ComponentProps.d.ts +10 -0
  226. package/dist/plugins/PropsPanel/PropsPanel/ComponentProps.js +40 -0
  227. package/dist/plugins/PropsPanel/PropsPanel/index.d.ts +11 -0
  228. package/dist/plugins/PropsPanel/PropsPanel/index.js +13 -0
  229. package/dist/plugins/PropsPanel/PropsPanel/shared.d.ts +2 -0
  230. package/dist/plugins/PropsPanel/PropsPanel/shared.js +16 -0
  231. package/dist/plugins/PropsPanel/index.d.ts +2 -0
  232. package/dist/plugins/PropsPanel/index.js +55 -0
  233. package/dist/plugins/PropsPanel/shared.d.ts +1 -0
  234. package/dist/plugins/PropsPanel/shared.js +1 -0
  235. package/dist/plugins/PropsPanel/spec.d.ts +3 -0
  236. package/dist/plugins/PropsPanel/spec.js +1 -0
  237. package/dist/plugins/RemoteRenderer/RemoteButton/copyToClipboard.d.ts +1 -0
  238. package/dist/plugins/RemoteRenderer/RemoteButton/copyToClipboard.js +24 -0
  239. package/dist/plugins/RemoteRenderer/RemoteButton/index.d.ts +8 -0
  240. package/dist/plugins/RemoteRenderer/RemoteButton/index.js +37 -0
  241. package/dist/plugins/RemoteRenderer/index.d.ts +2 -0
  242. package/dist/plugins/RemoteRenderer/index.js +36 -0
  243. package/dist/plugins/RemoteRenderer/shared.d.ts +3 -0
  244. package/dist/plugins/RemoteRenderer/shared.js +1 -0
  245. package/dist/plugins/RemoteRenderer/spec.d.ts +3 -0
  246. package/dist/plugins/RemoteRenderer/spec.js +1 -0
  247. package/dist/plugins/RendererCore/index.d.ts +2 -0
  248. package/dist/plugins/RendererCore/index.js +47 -0
  249. package/dist/plugins/RendererCore/isValidFixtureSelected.d.ts +2 -0
  250. package/dist/plugins/RendererCore/isValidFixtureSelected.js +16 -0
  251. package/dist/plugins/RendererCore/onRouterFixtureChange.d.ts +3 -0
  252. package/dist/plugins/RendererCore/onRouterFixtureChange.js +18 -0
  253. package/dist/plugins/RendererCore/receiveResponse/fixtureListUpdate.d.ts +3 -0
  254. package/dist/plugins/RendererCore/receiveResponse/fixtureListUpdate.js +11 -0
  255. package/dist/plugins/RendererCore/receiveResponse/fixtureStateChange.d.ts +3 -0
  256. package/dist/plugins/RendererCore/receiveResponse/fixtureStateChange.js +30 -0
  257. package/dist/plugins/RendererCore/receiveResponse/index.d.ts +3 -0
  258. package/dist/plugins/RendererCore/receiveResponse/index.js +20 -0
  259. package/dist/plugins/RendererCore/receiveResponse/playgroundCommand.d.ts +3 -0
  260. package/dist/plugins/RendererCore/receiveResponse/playgroundCommand.js +5 -0
  261. package/dist/plugins/RendererCore/receiveResponse/rendererReady.d.ts +3 -0
  262. package/dist/plugins/RendererCore/receiveResponse/rendererReady.js +49 -0
  263. package/dist/plugins/RendererCore/setFixtureState.d.ts +3 -0
  264. package/dist/plugins/RendererCore/setFixtureState.js +22 -0
  265. package/dist/plugins/RendererCore/shared/index.d.ts +4 -0
  266. package/dist/plugins/RendererCore/shared/index.js +1 -0
  267. package/dist/plugins/RendererCore/shared/postRequest.d.ts +5 -0
  268. package/dist/plugins/RendererCore/shared/postRequest.js +31 -0
  269. package/dist/plugins/RendererCore/shared/router.d.ts +2 -0
  270. package/dist/plugins/RendererCore/shared/router.js +3 -0
  271. package/dist/plugins/RendererCore/spec.d.ts +25 -0
  272. package/dist/plugins/RendererCore/spec.js +1 -0
  273. package/dist/plugins/RendererPreview/RendererPreview.d.ts +8 -0
  274. package/dist/plugins/RendererPreview/RendererPreview.js +25 -0
  275. package/dist/plugins/RendererPreview/checkRendererStatus.d.ts +2 -0
  276. package/dist/plugins/RendererPreview/checkRendererStatus.js +31 -0
  277. package/dist/plugins/RendererPreview/handleRendererRequests.d.ts +6 -0
  278. package/dist/plugins/RendererPreview/handleRendererRequests.js +76 -0
  279. package/dist/plugins/RendererPreview/handleWindowMessages.d.ts +2 -0
  280. package/dist/plugins/RendererPreview/handleWindowMessages.js +56 -0
  281. package/dist/plugins/RendererPreview/index.d.ts +2 -0
  282. package/dist/plugins/RendererPreview/index.js +49 -0
  283. package/dist/plugins/RendererPreview/shared.d.ts +9 -0
  284. package/dist/plugins/RendererPreview/shared.js +1 -0
  285. package/dist/plugins/RendererPreview/spec.d.ts +13 -0
  286. package/dist/plugins/RendererPreview/spec.js +1 -0
  287. package/dist/plugins/RendererSelect/index.d.ts +2 -0
  288. package/dist/plugins/RendererSelect/index.js +27 -0
  289. package/dist/plugins/RendererSelect/spec.d.ts +3 -0
  290. package/dist/plugins/RendererSelect/spec.js +1 -0
  291. package/dist/plugins/ResponsivePreview/ResponsivePreview/Header.d.ts +13 -0
  292. package/dist/plugins/ResponsivePreview/ResponsivePreview/Header.js +97 -0
  293. package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsivePreview.d.ts +14 -0
  294. package/dist/plugins/ResponsivePreview/ResponsivePreview/ResponsivePreview.js +152 -0
  295. package/dist/plugins/ResponsivePreview/ResponsivePreview/style.d.ts +45 -0
  296. package/dist/plugins/ResponsivePreview/ResponsivePreview/style.js +79 -0
  297. package/dist/plugins/ResponsivePreview/ToggleButton/index.d.ts +6 -0
  298. package/dist/plugins/ResponsivePreview/ToggleButton/index.js +6 -0
  299. package/dist/plugins/ResponsivePreview/index.d.ts +2 -0
  300. package/dist/plugins/ResponsivePreview/index.js +79 -0
  301. package/dist/plugins/ResponsivePreview/shared.d.ts +21 -0
  302. package/dist/plugins/ResponsivePreview/shared.js +19 -0
  303. package/dist/plugins/ResponsivePreview/spec.d.ts +13 -0
  304. package/dist/plugins/ResponsivePreview/spec.js +1 -0
  305. package/dist/plugins/Root/GlobalHeader.d.ts +9 -0
  306. package/dist/plugins/Root/GlobalHeader.js +59 -0
  307. package/dist/plugins/Root/RendererHeader.d.ts +16 -0
  308. package/dist/plugins/Root/RendererHeader.js +79 -0
  309. package/dist/plugins/Root/Root.d.ts +28 -0
  310. package/dist/plugins/Root/Root.js +120 -0
  311. package/dist/plugins/Root/SidePanel.d.ts +10 -0
  312. package/dist/plugins/Root/SidePanel.js +26 -0
  313. package/dist/plugins/Root/ToggleNavButton.d.ts +7 -0
  314. package/dist/plugins/Root/ToggleNavButton.js +6 -0
  315. package/dist/plugins/Root/index.d.ts +2 -0
  316. package/dist/plugins/Root/index.js +73 -0
  317. package/dist/plugins/Root/navOpen.d.ts +4 -0
  318. package/dist/plugins/Root/navOpen.js +11 -0
  319. package/dist/plugins/Root/navWidth.d.ts +5 -0
  320. package/dist/plugins/Root/navWidth.js +14 -0
  321. package/dist/plugins/Root/panelOpen.d.ts +4 -0
  322. package/dist/plugins/Root/panelOpen.js +16 -0
  323. package/dist/plugins/Root/panelWidth.d.ts +5 -0
  324. package/dist/plugins/Root/panelWidth.js +14 -0
  325. package/dist/plugins/Root/shared.d.ts +3 -0
  326. package/dist/plugins/Root/shared.js +1 -0
  327. package/dist/plugins/Root/spec.d.ts +14 -0
  328. package/dist/plugins/Root/spec.js +1 -0
  329. package/dist/plugins/Router/index.d.ts +2 -0
  330. package/dist/plugins/Router/index.js +56 -0
  331. package/dist/plugins/Router/spec.d.ts +15 -0
  332. package/dist/plugins/Router/spec.js +1 -0
  333. package/dist/plugins/StandardControl/index.d.ts +2 -0
  334. package/dist/plugins/StandardControl/index.js +43 -0
  335. package/dist/plugins/StandardControl/spec.d.ts +3 -0
  336. package/dist/plugins/StandardControl/spec.js +1 -0
  337. package/dist/plugins/StandardControl/storage.d.ts +7 -0
  338. package/dist/plugins/StandardControl/storage.js +10 -0
  339. package/dist/plugins/Storage/index.d.ts +2 -0
  340. package/dist/plugins/Storage/index.js +40 -0
  341. package/dist/plugins/Storage/spec.d.ts +18 -0
  342. package/dist/plugins/Storage/spec.js +1 -0
  343. package/dist/plugins/pluginEntry.d.ts +23 -0
  344. package/dist/plugins/pluginEntry.js +29 -0
  345. package/dist/shared/defaultPluginConfig.d.ts +13 -0
  346. package/dist/shared/defaultPluginConfig.js +13 -0
  347. package/dist/shared/fixtureTree.d.ts +3 -0
  348. package/dist/shared/fixtureTree.js +12 -0
  349. package/dist/shared/treeExpansion.d.ts +7 -0
  350. package/dist/shared/treeExpansion.js +24 -0
  351. package/dist/shared/url.d.ts +5 -0
  352. package/dist/shared/url.js +33 -0
  353. package/dist/slots/ControlActionSlot.d.ts +10 -0
  354. package/dist/slots/ControlActionSlot.js +5 -0
  355. package/dist/slots/ControlSlot.d.ts +11 -0
  356. package/dist/slots/ControlSlot.js +5 -0
  357. package/dist/slots/FixtureActionSlot.d.ts +10 -0
  358. package/dist/slots/FixtureActionSlot.js +5 -0
  359. package/dist/slots/NavRowSlot.d.ts +9 -0
  360. package/dist/slots/NavRowSlot.js +5 -0
  361. package/dist/slots/RendererActionSlot.d.ts +10 -0
  362. package/dist/slots/RendererActionSlot.js +5 -0
  363. package/dist/slots/SidePanelRowSlot.d.ts +12 -0
  364. package/dist/slots/SidePanelRowSlot.js +5 -0
  365. package/dist/slots/ValueInputSlot.d.ts +16 -0
  366. package/dist/slots/ValueInputSlot.js +5 -0
  367. package/dist/style/colors.d.ts +37 -0
  368. package/dist/style/colors.js +43 -0
  369. package/dist/style/globalStyle.d.ts +2 -0
  370. package/dist/style/globalStyle.js +49 -0
  371. package/dist/style/vars.d.ts +2 -0
  372. package/dist/style/vars.js +2 -0
  373. package/dist/testHelpers/pluginHelpers.d.ts +5 -0
  374. package/dist/testHelpers/pluginHelpers.js +25 -0
  375. package/dist/testHelpers/pluginMocks.d.ts +116 -0
  376. package/dist/testHelpers/pluginMocks.js +139 -0
  377. package/package.json +24 -0
@@ -0,0 +1,11 @@
1
+ import { PlaygroundMountArgs } from './playgroundConfig.js';
2
+ import './plugins/pluginEntry.js';
3
+ declare global {
4
+ interface Window {
5
+ ReactPlugin: any;
6
+ React: any;
7
+ ReactDom: any;
8
+ StyledComponents: any;
9
+ }
10
+ }
11
+ export default function mount({ playgroundConfig, pluginConfigs, }: PlaygroundMountArgs): Promise<void>;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import ReactDom from 'react-dom/client';
3
+ import * as ReactPlugin from 'react-plugin';
4
+ import styled from 'styled-components';
5
+ import './plugins/pluginEntry.js';
6
+ import { DEFAULT_PLUGIN_CONFIG } from './shared/defaultPluginConfig.js';
7
+ import { GlobalStyle } from './style/globalStyle.js';
8
+ // Enable external plugins to use a shared copy of react-plugin. Also enable
9
+ // fiddling with plugins from browser console :D.
10
+ window.ReactPlugin = ReactPlugin;
11
+ window.React = React;
12
+ window.ReactDom = ReactDom;
13
+ window.StyledComponents = styled;
14
+ export default async function mount({ playgroundConfig, pluginConfigs, }) {
15
+ const { loadPlugins, Slot } = ReactPlugin;
16
+ const config = { ...DEFAULT_PLUGIN_CONFIG, ...playgroundConfig };
17
+ loadPlugins({ config });
18
+ // We can make plugin loading unblocking if react-plugin exports the
19
+ // reloadPlugins method.
20
+ await Promise.all(pluginConfigs.map(async (pluginConfig) => {
21
+ if (pluginConfig.ui)
22
+ await loadPluginScript(pluginConfig.ui);
23
+ }));
24
+ const root = ReactDom.createRoot(document.getElementById('root'));
25
+ root.render(React.createElement(React.Fragment, null,
26
+ React.createElement(GlobalStyle, null),
27
+ React.createElement(Slot, { name: "root" })));
28
+ }
29
+ async function loadPluginScript(scriptPath) {
30
+ console.log(`[Cosmos] Loading plugin script at ${scriptPath}`);
31
+ // Handle both absolute (dev server) and relative paths (static export)
32
+ const normalizedPath = scriptPath.startsWith('/')
33
+ ? scriptPath
34
+ : `/${scriptPath}`;
35
+ await import(/* webpackIgnore: true */ `./_plugin${normalizedPath}`);
36
+ }
@@ -0,0 +1,10 @@
1
+ import { CosmosPluginConfig } from 'react-cosmos-core';
2
+ import { CoreSpec } from './plugins/Core/spec.js';
3
+ export type PlaygroundConfig = {
4
+ core: CoreSpec['config'];
5
+ [pluginName: string]: {};
6
+ };
7
+ export type PlaygroundMountArgs = {
8
+ playgroundConfig: PlaygroundConfig;
9
+ pluginConfigs: CosmosPluginConfig[];
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const register: () => void;
2
+ export { register };
@@ -0,0 +1,35 @@
1
+ import { createPlugin } from 'react-plugin';
2
+ const { on, register } = createPlugin({
3
+ name: 'buildNotifications',
4
+ });
5
+ on('messageHandler', {
6
+ serverMessage: onServerMessage,
7
+ });
8
+ export { register };
9
+ if (process.env.NODE_ENV !== 'test')
10
+ register();
11
+ function onServerMessage(context, msg) {
12
+ const { getMethodsOf } = context;
13
+ const notifications = getMethodsOf('notifications');
14
+ const serverMessage = msg;
15
+ switch (serverMessage.type) {
16
+ case 'buildStart':
17
+ return notifications.pushStickyNotification({
18
+ id: 'build',
19
+ type: 'loading',
20
+ title: 'Rebuilding...',
21
+ info: 'Your code is updating.',
22
+ });
23
+ case 'buildError':
24
+ return notifications.pushStickyNotification({
25
+ id: 'build',
26
+ type: 'error',
27
+ title: 'Build failed',
28
+ info: 'Check your terminal for more information.',
29
+ });
30
+ case 'buildDone':
31
+ return notifications.removeStickyNotification('build');
32
+ default:
33
+ // Nada
34
+ }
35
+ }
@@ -0,0 +1,3 @@
1
+ export type BuildNotificationsSpec = {
2
+ name: 'buildNotifications';
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { FixtureState, FixtureStateClassState, StateUpdater } from 'react-cosmos-core';
2
+ import { FixtureExpansion, OnElementExpansionChange } from '../../../components/ValueInputTree/index.js';
3
+ type Props = {
4
+ fsClassState: FixtureStateClassState;
5
+ fixtureExpansion: FixtureExpansion;
6
+ onFixtureStateChange: (stateUpdater: StateUpdater<FixtureState>) => void;
7
+ onElementExpansionChange: OnElementExpansionChange;
8
+ };
9
+ export declare function ComponentClassState({ fsClassState, fixtureExpansion, onFixtureStateChange, onElementExpansionChange, }: Props): JSX.Element;
10
+ export {};
@@ -0,0 +1,36 @@
1
+ import { isEqual } from 'lodash-es';
2
+ import React, { useCallback } from 'react';
3
+ import { updateFixtureStateClassState, } from 'react-cosmos-core';
4
+ import { IconButton32 } from '../../../components/buttons/index.js';
5
+ import { RotateCcwIcon } from '../../../components/icons/index.js';
6
+ import { SidePanelActions, SidePanelBody, SidePanelContainer, SidePanelHeader, SidePanelTitle, } from '../../../components/SidePanel.js';
7
+ import { ExpandCollapseValues } from '../../../components/ValueInputTree/ExpandCollapseValues.js';
8
+ import { stringifyElementId, ValueInputTree, } from '../../../components/ValueInputTree/index.js';
9
+ import { createClassStateFsUpdater } from './shared.js';
10
+ export function ComponentClassState({ fsClassState, fixtureExpansion, onFixtureStateChange, onElementExpansionChange, }) {
11
+ const { componentName, elementId, values } = fsClassState;
12
+ const [initialValues] = React.useState(() => values);
13
+ const handleValuesReset = React.useCallback(() => onFixtureStateChange(createClassStateFsUpdater(elementId, prevFs => updateFixtureStateClassState({
14
+ fixtureState: prevFs,
15
+ elementId,
16
+ values: initialValues,
17
+ }))), [elementId, initialValues, onFixtureStateChange]);
18
+ const handleValueChange = React.useCallback((newValues) => {
19
+ onFixtureStateChange(createClassStateFsUpdater(elementId, prevFs => updateFixtureStateClassState({
20
+ fixtureState: prevFs,
21
+ elementId,
22
+ values: newValues,
23
+ })));
24
+ }, [elementId, onFixtureStateChange]);
25
+ const strElementId = stringifyElementId(elementId);
26
+ const expansion = fixtureExpansion[strElementId] || {};
27
+ const setExpansion = useCallback((newExpansion) => onElementExpansionChange(elementId, newExpansion), [elementId, onElementExpansionChange]);
28
+ return (React.createElement(SidePanelContainer, null,
29
+ React.createElement(SidePanelHeader, null,
30
+ React.createElement(SidePanelTitle, { label: "Class State", componentName: componentName }),
31
+ React.createElement(SidePanelActions, null,
32
+ React.createElement(IconButton32, { title: "Reset to initial values", icon: React.createElement(RotateCcwIcon, null), disabled: isEqual(values, initialValues), onClick: handleValuesReset }),
33
+ React.createElement(ExpandCollapseValues, { values: values, expansion: expansion, setExpansion: setExpansion }))),
34
+ React.createElement(SidePanelBody, null,
35
+ React.createElement(ValueInputTree, { id: strElementId, values: values, expansion: expansion, onValueChange: handleValueChange, setExpansion: setExpansion }))));
36
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { FixtureState, StateUpdater } from 'react-cosmos-core';
3
+ import { FixtureExpansion, OnElementExpansionChange } from '../../../components/ValueInputTree/index.js';
4
+ type Props = {
5
+ fixtureState: FixtureState;
6
+ fixtureExpansion: FixtureExpansion;
7
+ onFixtureStateChange: (stateUpdater: StateUpdater<FixtureState>) => void;
8
+ onElementExpansionChange: OnElementExpansionChange;
9
+ };
10
+ export declare const ClassStatePanel: React.NamedExoticComponent<Props>;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { hasFsValues, sortFsValueGroups, stringifyElementId, } from '../../../components/ValueInputTree/index.js';
3
+ import { ComponentClassState } from './ComponentClassState.js';
4
+ export const ClassStatePanel = React.memo(function ClassStatePanel({ fixtureState, fixtureExpansion, onFixtureStateChange, onElementExpansionChange, }) {
5
+ if (!fixtureState.classState) {
6
+ return null;
7
+ }
8
+ const classStateWithValues = fixtureState.classState.filter(hasFsValues);
9
+ return (React.createElement(React.Fragment, null, sortFsValueGroups(classStateWithValues).map(fsClassState => {
10
+ const strElementId = stringifyElementId(fsClassState.elementId);
11
+ return (React.createElement(ComponentClassState, { key: strElementId, fsClassState: fsClassState, fixtureExpansion: fixtureExpansion, onFixtureStateChange: onFixtureStateChange, onElementExpansionChange: onElementExpansionChange }));
12
+ })));
13
+ });
@@ -0,0 +1,2 @@
1
+ import { FixtureElementId, FixtureState, FixtureStateClassState, StateUpdater } from 'react-cosmos-core';
2
+ export declare function createClassStateFsUpdater(elementId: FixtureElementId, cb: (prevFs: FixtureState) => FixtureStateClassState[]): StateUpdater<FixtureState>;
@@ -0,0 +1,16 @@
1
+ import { findFixtureStateClassState, } from 'react-cosmos-core';
2
+ import { stringifyElementId } from '../../../components/ValueInputTree/index.js';
3
+ export function createClassStateFsUpdater(elementId, cb) {
4
+ return prevFs => {
5
+ const fsClassState = findFixtureStateClassState(prevFs, elementId);
6
+ if (!fsClassState) {
7
+ const elId = stringifyElementId(elementId);
8
+ console.warn(`Trying to update missing element with ID: ${elId}`);
9
+ return prevFs;
10
+ }
11
+ return {
12
+ ...prevFs,
13
+ classState: cb(prevFs),
14
+ };
15
+ };
16
+ }
@@ -0,0 +1,2 @@
1
+ declare const register: () => void;
2
+ export { register };
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { createPlugin } from 'react-plugin';
3
+ import { getFixtureExpansion, updateElementExpansion, } from '../../components/ValueInputTree/index.js';
4
+ import { ClassStatePanel } from './ClassStatePanel/index.js';
5
+ import { CLASS_STATE_TREE_EXPANSION_STORAGE_KEY } from './shared.js';
6
+ const { namedPlug, register } = createPlugin({
7
+ name: 'classStatePanel',
8
+ });
9
+ namedPlug('sidePanelRow', 'classState', ({ pluginContext, slotProps }) => {
10
+ const { fixtureId, fixtureState, onFixtureStateChange } = slotProps;
11
+ const { fixtureExpansion, onElementExpansionChange } = useFixtureExpansion(pluginContext, fixtureId);
12
+ return (React.createElement(ClassStatePanel, { fixtureState: fixtureState, fixtureExpansion: fixtureExpansion, onFixtureStateChange: onFixtureStateChange, onElementExpansionChange: onElementExpansionChange }));
13
+ });
14
+ export { register };
15
+ if (process.env.NODE_ENV !== 'test')
16
+ register();
17
+ const DEFAULT_TREE_EXPANSION = {};
18
+ function useFixtureExpansion(context, fixtureId) {
19
+ const { getMethodsOf } = context;
20
+ const storage = getMethodsOf('storage');
21
+ const classStateExpansion = storage.getItem(CLASS_STATE_TREE_EXPANSION_STORAGE_KEY) || DEFAULT_TREE_EXPANSION;
22
+ const fixtureExpansion = getFixtureExpansion(classStateExpansion, fixtureId);
23
+ const onElementExpansionChange = React.useCallback((elementId, treeExpansion) => {
24
+ storage.setItem(CLASS_STATE_TREE_EXPANSION_STORAGE_KEY, updateElementExpansion(classStateExpansion, fixtureId, elementId, treeExpansion));
25
+ }, [storage, classStateExpansion, fixtureId]);
26
+ return {
27
+ fixtureExpansion,
28
+ onElementExpansionChange,
29
+ };
30
+ }
@@ -0,0 +1 @@
1
+ export declare const CLASS_STATE_TREE_EXPANSION_STORAGE_KEY = "classStateTreeExpansion";
@@ -0,0 +1 @@
1
+ export const CLASS_STATE_TREE_EXPANSION_STORAGE_KEY = 'classStateTreeExpansion';
@@ -0,0 +1,3 @@
1
+ export type ClassStatePanelSpec = {
2
+ name: 'classStatePanel';
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { RuntimeStatus, UrlStatus } from '../RendererPreview/shared.js';
2
+ type Props = {
3
+ fixtureSelected: boolean;
4
+ validFixtureSelected: boolean;
5
+ rendererConnected: boolean;
6
+ rendererPreviewUrlStatus: UrlStatus;
7
+ rendererPreviewRuntimeStatus: RuntimeStatus;
8
+ welcomeDismissed: boolean;
9
+ onDismissWelcome: () => unknown;
10
+ onShowWelcome: () => unknown;
11
+ };
12
+ export declare function ContentOverlay({ fixtureSelected, validFixtureSelected, rendererConnected, rendererPreviewUrlStatus, rendererPreviewRuntimeStatus, welcomeDismissed, onDismissWelcome, onShowWelcome, }: Props): JSX.Element | null;
13
+ export {};
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { NoFixtureSelected } from './NoFixtureSelected.js';
3
+ import { RendererNotResponding } from './RendererNotResponding.js';
4
+ import { ContentContainer, OverlayContainer } from './shared.js';
5
+ import { WelcomeCosmos } from './WelcomeCosmos.js';
6
+ export function ContentOverlay({ fixtureSelected, validFixtureSelected, rendererConnected, rendererPreviewUrlStatus, rendererPreviewRuntimeStatus, welcomeDismissed, onDismissWelcome, onShowWelcome, }) {
7
+ if (rendererPreviewUrlStatus === 'error') {
8
+ return (React.createElement(OverlayContainer, { "data-testid": "rendererNotResponding" },
9
+ React.createElement(RendererNotResponding, null)));
10
+ }
11
+ if (validFixtureSelected || rendererPreviewRuntimeStatus === 'error') {
12
+ // Usually the content overlay is only hidden when a valid fixture is
13
+ // selected. However, when the renderer is in error state, we also hide the
14
+ // content overlay to avoid showing a blank screen and to uncover the error
15
+ // message.
16
+ return null;
17
+ }
18
+ if (!rendererConnected) {
19
+ // Delay "waiting for renderer" state to avoid rapidly changing visual
20
+ // states when renderer is already compiled and will respond immediately
21
+ return (React.createElement(OverlayContainer, { "data-testid": "waiting" },
22
+ React.createElement(ContentContainer, null)));
23
+ }
24
+ if (fixtureSelected) {
25
+ return (React.createElement(OverlayContainer, { "data-testid": "notFound" },
26
+ React.createElement(ContentContainer, null)));
27
+ }
28
+ if (welcomeDismissed) {
29
+ return (React.createElement(OverlayContainer, { "data-testid": "blank" },
30
+ React.createElement(NoFixtureSelected, { onShowWelcome: onShowWelcome })));
31
+ }
32
+ return (React.createElement(OverlayContainer, { "data-testid": "welcome" },
33
+ React.createElement(WelcomeCosmos, { onDismissWelcome: onDismissWelcome })));
34
+ }
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ keys: string[];
3
+ label: string;
4
+ };
5
+ export declare function KeyShortcut({ keys, label }: Props): JSX.Element;
6
+ export {};
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { KeyBox } from '../../components/KeyBox.js';
4
+ import { screenGrey1, screenGrey5 } from '../../style/colors.js';
5
+ export function KeyShortcut({ keys, label }) {
6
+ return (React.createElement(Container, null,
7
+ React.createElement(Keys, null, keys.map(key => (React.createElement(KeyBox, { key: key, value: key, bgColor: screenGrey5, textColor: screenGrey1, size: 26, fontSize: 16 })))),
8
+ React.createElement(Label, null, label)));
9
+ }
10
+ const Container = styled.div `
11
+ display: flex;
12
+ flex-direction: row;
13
+ height: 26px;
14
+ margin: 0 0 16px 0;
15
+ line-height: 26px;
16
+
17
+ :last-child {
18
+ margin-bottom: 0;
19
+ }
20
+ `;
21
+ const Keys = styled.div `
22
+ flex: 1;
23
+ display: flex;
24
+ flex-direction: row;
25
+ justify-content: flex-end;
26
+ `;
27
+ const Label = styled.div `
28
+ flex: 1.4;
29
+ text-indent: 10px;
30
+ `;
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ onShowWelcome: () => unknown;
3
+ };
4
+ export declare function NoFixtureSelected({ onShowWelcome }: Props): JSX.Element;
5
+ export {};
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { BlankCanvasIllustration } from '../../components/illustrations/BlankCanvas.js';
4
+ import { screenGrey3 } from '../../style/colors.js';
5
+ import { KeyShortcut } from './KeyShortcut.js';
6
+ import { ContentContainer, IllustrationContainer, SecondaryButton, TextContainer, } from './shared.js';
7
+ export function NoFixtureSelected({ onShowWelcome }) {
8
+ return (React.createElement(React.Fragment, null,
9
+ React.createElement(ContentContainer, null,
10
+ React.createElement(TextContainer, null,
11
+ React.createElement(KeyShortcut, { keys: ['⌘', 'P'], label: "Search fixtures" }),
12
+ React.createElement(Subtitle, null, "FIXTURE SELECTED"),
13
+ React.createElement(KeyShortcut, { keys: ['⌘', '⇧', 'L'], label: "Toggle fixture list" }),
14
+ React.createElement(KeyShortcut, { keys: ['⌘', '⇧', 'K'], label: "Toggle control panel" }),
15
+ React.createElement(KeyShortcut, { keys: ['⌘', '⇧', 'E'], label: "Edit fixture" }),
16
+ React.createElement(KeyShortcut, { keys: ['⌘', '⇧', 'F'], label: "Go full screen" })),
17
+ React.createElement(IllustrationContainer, null,
18
+ React.createElement(BlankCanvasIllustration, { title: "blank state" }))),
19
+ React.createElement(ShowWelcomeButton, { onClick: onShowWelcome }, "show welcome screen")));
20
+ }
21
+ const Subtitle = styled.div `
22
+ margin: 40px 0 24px 0;
23
+ color: ${screenGrey3};
24
+ font-size: 14px;
25
+ font-weight: 500;
26
+ line-height: 14px;
27
+ text-align: center;
28
+ letter-spacing: 0.5px;
29
+ `;
30
+ const ShowWelcomeButton = styled(SecondaryButton) `
31
+ position: absolute;
32
+ bottom: 8px;
33
+ right: 8px;
34
+ `;
@@ -0,0 +1 @@
1
+ export declare function RendererNotResponding(): JSX.Element;
@@ -0,0 +1,109 @@
1
+ import React from 'react';
2
+ import { Slot } from 'react-plugin';
3
+ import styled from 'styled-components';
4
+ import { ArtificialIntelligenceIllustration } from '../../components/illustrations/ArtificialIntelligence.js';
5
+ import { screenGrey3, screenGrey5, screenPrimary2, screenPrimary3, } from '../../style/colors.js';
6
+ import { ContentContainer, IllustrationContainer, NoWrap, TextContainer, } from './shared.js';
7
+ export function RendererNotResponding() {
8
+ return (React.createElement(ContentContainer, null,
9
+ React.createElement(TextContainer, null,
10
+ React.createElement(Header, null,
11
+ "Renderer ",
12
+ React.createElement(NoWrap, null, "not responding")),
13
+ React.createElement(Paragraph, null, `It's usually one of the following...`),
14
+ React.createElement(List, null,
15
+ React.createElement("li", null,
16
+ React.createElement(No, null, "1"),
17
+ React.createElement("span", null,
18
+ React.createElement("strong", null, "Please check your terminal for errors."),
19
+ React.createElement("br", null),
20
+ "Your build might be broken.")),
21
+ React.createElement("li", null,
22
+ React.createElement(No, null, "2"),
23
+ React.createElement("span", null,
24
+ React.createElement(Slot, { name: "rendererError" },
25
+ "If you use a bundler plugin,",
26
+ ' ',
27
+ React.createElement("strong", null,
28
+ "make sure",
29
+ React.createElement("br", null),
30
+ "your build is generating an index.html page."))))),
31
+ React.createElement(Paragraph, null,
32
+ React.createElement(ActionLink, { href: "https://react-cosmos.slack.com/join/shared_invite/zt-g9rsalqq-clCoV7DWttVvzO5FAAmVAw", rel: "noopener noreferrer", target: "_blank" }, "ask for help"))),
33
+ React.createElement(IllustrationContainer, null,
34
+ React.createElement(ArtificialIntelligenceIllustration, { title: "robot" }))));
35
+ }
36
+ const Header = styled.h1 `
37
+ position: relative;
38
+ margin: 0 0 64px 0;
39
+ color: ${screenPrimary2};
40
+ font-size: 30px;
41
+ font-weight: 700;
42
+ line-height: 1.2em;
43
+ text-transform: uppercase;
44
+ letter-spacing: 0.015em;
45
+
46
+ ::after {
47
+ content: '';
48
+ position: absolute;
49
+ bottom: -12px;
50
+ left: 0;
51
+ width: 64px;
52
+ height: 3px;
53
+ background: ${screenPrimary2};
54
+ }
55
+ `;
56
+ const Paragraph = styled.p `
57
+ margin: 16px 0;
58
+
59
+ :last-child {
60
+ margin-bottom: 0;
61
+ }
62
+ `;
63
+ const List = styled.ul `
64
+ margin: 0 0 48px 0;
65
+ padding: 0;
66
+ list-style: none;
67
+
68
+ li {
69
+ display: flex;
70
+ flex-direction: row;
71
+ align-items: flex-start;
72
+ margin-bottom: 12px;
73
+ }
74
+ `;
75
+ const No = styled.span `
76
+ flex-shrink: 0;
77
+ display: flex;
78
+ align-items: center;
79
+ justify-content: flex-end;
80
+ box-sizing: border-box;
81
+ width: 32px;
82
+ height: 32px;
83
+ margin: 6px 16px 0 0;
84
+ padding: 0 6px 0 0;
85
+ border-radius: 100%;
86
+ font-size: 18px;
87
+ font-weight: 600;
88
+ background: ${screenGrey5};
89
+ color: ${screenGrey3};
90
+
91
+ ::after {
92
+ content: '.';
93
+ }
94
+ `;
95
+ const actionLinkHeight = 36;
96
+ const ActionLink = styled.a `
97
+ display: inline-block;
98
+ height: ${actionLinkHeight}px;
99
+ padding: 0 16px;
100
+ background: ${screenPrimary3};
101
+ color: #fff;
102
+ border-radius: 5px;
103
+ font-size: 12px;
104
+ font-weight: 700;
105
+ line-height: ${actionLinkHeight}px;
106
+ text-transform: uppercase;
107
+ letter-spacing: 0.1em;
108
+ text-decoration: none;
109
+ `;
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ onDismissWelcome: () => unknown;
3
+ };
4
+ export declare function WelcomeCosmos({ onDismissWelcome }: Props): JSX.Element;
5
+ export {};