@immediately-run/sandpack-react 2.20.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 (582) hide show
  1. package/README.md +60 -0
  2. package/dist/.ir-build-stamp.json +6 -0
  3. package/dist/index.d.ts +1771 -0
  4. package/dist/index.js +5544 -0
  5. package/dist/index.mjs +5440 -0
  6. package/dist/src/components/CodeEditor/CodeMirror.d.ts +50 -0
  7. package/dist/src/components/CodeEditor/CodeMirror.d.ts.map +1 -0
  8. package/dist/src/components/CodeEditor/highlightDecorators.d.ts +4 -0
  9. package/dist/src/components/CodeEditor/highlightDecorators.d.ts.map +1 -0
  10. package/dist/src/components/CodeEditor/highlightInlineError.d.ts +3 -0
  11. package/dist/src/components/CodeEditor/highlightInlineError.d.ts.map +1 -0
  12. package/dist/src/components/CodeEditor/index.d.ts +50 -0
  13. package/dist/src/components/CodeEditor/index.d.ts.map +1 -0
  14. package/dist/src/components/CodeEditor/languages-mocks.d.ts +9 -0
  15. package/dist/src/components/CodeEditor/languages-mocks.d.ts.map +1 -0
  16. package/dist/src/components/CodeEditor/styles.css.d.ts +6 -0
  17. package/dist/src/components/CodeEditor/styles.css.d.ts.map +1 -0
  18. package/dist/src/components/CodeEditor/useSyntaxHighlight.d.ts +7 -0
  19. package/dist/src/components/CodeEditor/useSyntaxHighlight.d.ts.map +1 -0
  20. package/dist/src/components/CodeEditor/utils.d.ts +16 -0
  21. package/dist/src/components/CodeEditor/utils.d.ts.map +1 -0
  22. package/dist/src/components/CodeViewer/index.d.ts +28 -0
  23. package/dist/src/components/CodeViewer/index.d.ts.map +1 -0
  24. package/dist/src/components/Console/ConsoleList.css.d.ts +29 -0
  25. package/dist/src/components/Console/ConsoleList.css.d.ts.map +1 -0
  26. package/dist/src/components/Console/ConsoleList.d.ts +6 -0
  27. package/dist/src/components/Console/ConsoleList.d.ts.map +1 -0
  28. package/dist/src/components/Console/Header.css.d.ts +5 -0
  29. package/dist/src/components/Console/Header.css.d.ts.map +1 -0
  30. package/dist/src/components/Console/Header.d.ts +7 -0
  31. package/dist/src/components/Console/Header.d.ts.map +1 -0
  32. package/dist/src/components/Console/SandpackConsole.css.d.ts +4 -0
  33. package/dist/src/components/Console/SandpackConsole.css.d.ts.map +1 -0
  34. package/dist/src/components/Console/SandpackConsole.d.ts +27 -0
  35. package/dist/src/components/Console/SandpackConsole.d.ts.map +1 -0
  36. package/dist/src/components/Console/StdoutList.css.d.ts +2 -0
  37. package/dist/src/components/Console/StdoutList.css.d.ts.map +1 -0
  38. package/dist/src/components/Console/StdoutList.d.ts +8 -0
  39. package/dist/src/components/Console/StdoutList.d.ts.map +1 -0
  40. package/dist/src/components/Console/index.d.ts +3 -0
  41. package/dist/src/components/Console/index.d.ts.map +1 -0
  42. package/dist/src/components/Console/useSandpackConsole.d.ts +16 -0
  43. package/dist/src/components/Console/useSandpackConsole.d.ts.map +1 -0
  44. package/dist/src/components/Console/utils/constraints.d.ts +14 -0
  45. package/dist/src/components/Console/utils/constraints.d.ts.map +1 -0
  46. package/dist/src/components/Console/utils/fromConsoleToString.d.ts +13 -0
  47. package/dist/src/components/Console/utils/fromConsoleToString.d.ts.map +1 -0
  48. package/dist/src/components/Console/utils/getType.d.ts +8 -0
  49. package/dist/src/components/Console/utils/getType.d.ts.map +1 -0
  50. package/dist/src/components/Console/utils/transformers.d.ts +5 -0
  51. package/dist/src/components/Console/utils/transformers.d.ts.map +1 -0
  52. package/dist/src/components/FileExplorer/File.css.d.ts +2 -0
  53. package/dist/src/components/FileExplorer/File.css.d.ts.map +1 -0
  54. package/dist/src/components/FileExplorer/File.d.ts +11 -0
  55. package/dist/src/components/FileExplorer/File.d.ts.map +1 -0
  56. package/dist/src/components/FileExplorer/FileExplorer.css.d.ts +2 -0
  57. package/dist/src/components/FileExplorer/FileExplorer.css.d.ts.map +1 -0
  58. package/dist/src/components/FileExplorer/ModuleList.d.ts +25 -0
  59. package/dist/src/components/FileExplorer/ModuleList.d.ts.map +1 -0
  60. package/dist/src/components/FileExplorer/index.d.ts +13 -0
  61. package/dist/src/components/FileExplorer/index.d.ts.map +1 -0
  62. package/dist/src/components/FileExplorer/utils.d.ts +17 -0
  63. package/dist/src/components/FileExplorer/utils.d.ts.map +1 -0
  64. package/dist/src/components/FileTabs/FileTabs.css.d.ts +6 -0
  65. package/dist/src/components/FileTabs/FileTabs.css.d.ts.map +1 -0
  66. package/dist/src/components/FileTabs/index.d.ts +19 -0
  67. package/dist/src/components/FileTabs/index.d.ts.map +1 -0
  68. package/dist/src/components/Navigator/Navigator.css.d.ts +4 -0
  69. package/dist/src/components/Navigator/Navigator.css.d.ts.map +1 -0
  70. package/dist/src/components/Navigator/index.d.ts +8 -0
  71. package/dist/src/components/Navigator/index.d.ts.map +1 -0
  72. package/dist/src/components/Navigator/utils.d.ts +2 -0
  73. package/dist/src/components/Navigator/utils.d.ts.map +1 -0
  74. package/dist/src/components/Preview/Preview.css.d.ts +4 -0
  75. package/dist/src/components/Preview/Preview.css.d.ts.map +1 -0
  76. package/dist/src/components/Preview/index.d.ts +31 -0
  77. package/dist/src/components/Preview/index.d.ts.map +1 -0
  78. package/dist/src/components/ReactDevTools/ReactDevTools.css.d.ts +2 -0
  79. package/dist/src/components/ReactDevTools/ReactDevTools.css.d.ts.map +1 -0
  80. package/dist/src/components/ReactDevTools/index.d.ts +8 -0
  81. package/dist/src/components/ReactDevTools/index.d.ts.map +1 -0
  82. package/dist/src/components/Tests/Describes.css.d.ts +3 -0
  83. package/dist/src/components/Tests/Describes.css.d.ts.map +1 -0
  84. package/dist/src/components/Tests/Describes.d.ts +11 -0
  85. package/dist/src/components/Tests/Describes.d.ts.map +1 -0
  86. package/dist/src/components/Tests/FormattedError.css.d.ts +2 -0
  87. package/dist/src/components/Tests/FormattedError.css.d.ts.map +1 -0
  88. package/dist/src/components/Tests/FormattedError.d.ts +9 -0
  89. package/dist/src/components/Tests/FormattedError.d.ts.map +1 -0
  90. package/dist/src/components/Tests/Header.css.d.ts +5 -0
  91. package/dist/src/components/Tests/Header.css.d.ts.map +1 -0
  92. package/dist/src/components/Tests/Header.d.ts +18 -0
  93. package/dist/src/components/Tests/Header.d.ts.map +1 -0
  94. package/dist/src/components/Tests/RunButton.d.ts +5 -0
  95. package/dist/src/components/Tests/RunButton.d.ts.map +1 -0
  96. package/dist/src/components/Tests/SandpackTests.css.d.ts +4 -0
  97. package/dist/src/components/Tests/SandpackTests.css.d.ts.map +1 -0
  98. package/dist/src/components/Tests/SandpackTests.d.ts +18 -0
  99. package/dist/src/components/Tests/SandpackTests.d.ts.map +1 -0
  100. package/dist/src/components/Tests/Specs.css.d.ts +9 -0
  101. package/dist/src/components/Tests/Specs.css.d.ts.map +1 -0
  102. package/dist/src/components/Tests/Specs.d.ts +17 -0
  103. package/dist/src/components/Tests/Specs.d.ts.map +1 -0
  104. package/dist/src/components/Tests/Summary.css.d.ts +4 -0
  105. package/dist/src/components/Tests/Summary.css.d.ts.map +1 -0
  106. package/dist/src/components/Tests/Summary.d.ts +20 -0
  107. package/dist/src/components/Tests/Summary.d.ts.map +1 -0
  108. package/dist/src/components/Tests/Tests.css.d.ts +6 -0
  109. package/dist/src/components/Tests/Tests.css.d.ts.map +1 -0
  110. package/dist/src/components/Tests/Tests.d.ts +17 -0
  111. package/dist/src/components/Tests/Tests.d.ts.map +1 -0
  112. package/dist/src/components/Tests/index.d.ts +2 -0
  113. package/dist/src/components/Tests/index.d.ts.map +1 -0
  114. package/dist/src/components/Tests/style.css.d.ts +8 -0
  115. package/dist/src/components/Tests/style.css.d.ts.map +1 -0
  116. package/dist/src/components/Tests/style.d.ts +3 -0
  117. package/dist/src/components/Tests/style.d.ts.map +1 -0
  118. package/dist/src/components/Tests/utils.d.ts +14 -0
  119. package/dist/src/components/Tests/utils.d.ts.map +1 -0
  120. package/dist/src/components/TranspiledCode/TranspiledCode.css.d.ts +2 -0
  121. package/dist/src/components/TranspiledCode/TranspiledCode.css.d.ts.map +1 -0
  122. package/dist/src/components/TranspiledCode/index.d.ts +4 -0
  123. package/dist/src/components/TranspiledCode/index.d.ts.map +1 -0
  124. package/dist/src/components/common/DependenciesProgress.css.d.ts +2 -0
  125. package/dist/src/components/common/DependenciesProgress.css.d.ts.map +1 -0
  126. package/dist/src/components/common/DependenciesProgress.d.ts +4 -0
  127. package/dist/src/components/common/DependenciesProgress.d.ts.map +1 -0
  128. package/dist/src/components/common/ErrorOverlay.d.ts +6 -0
  129. package/dist/src/components/common/ErrorOverlay.d.ts.map +1 -0
  130. package/dist/src/components/common/Layout.css.d.ts +2 -0
  131. package/dist/src/components/common/Layout.css.d.ts.map +1 -0
  132. package/dist/src/components/common/Layout.d.ts +8 -0
  133. package/dist/src/components/common/Layout.d.ts.map +1 -0
  134. package/dist/src/components/common/Loading.css.d.ts +4 -0
  135. package/dist/src/components/common/Loading.css.d.ts.map +1 -0
  136. package/dist/src/components/common/Loading.d.ts +5 -0
  137. package/dist/src/components/common/Loading.d.ts.map +1 -0
  138. package/dist/src/components/common/LoadingOverlay.css.d.ts +5 -0
  139. package/dist/src/components/common/LoadingOverlay.css.d.ts.map +1 -0
  140. package/dist/src/components/common/LoadingOverlay.d.ts +12 -0
  141. package/dist/src/components/common/LoadingOverlay.d.ts.map +1 -0
  142. package/dist/src/components/common/OpenInCodeSandboxButton/OpenInCodeSandboxButton.d.ts +3 -0
  143. package/dist/src/components/common/OpenInCodeSandboxButton/OpenInCodeSandboxButton.d.ts.map +1 -0
  144. package/dist/src/components/common/OpenInCodeSandboxButton/UnstyledOpenInCodeSandboxButton.d.ts +7 -0
  145. package/dist/src/components/common/OpenInCodeSandboxButton/UnstyledOpenInCodeSandboxButton.d.ts.map +1 -0
  146. package/dist/src/components/common/OpenInCodeSandboxButton/index.d.ts +3 -0
  147. package/dist/src/components/common/OpenInCodeSandboxButton/index.d.ts.map +1 -0
  148. package/dist/src/components/common/RoundedButton.d.ts +3 -0
  149. package/dist/src/components/common/RoundedButton.d.ts.map +1 -0
  150. package/dist/src/components/common/RunButton.css.d.ts +2 -0
  151. package/dist/src/components/common/RunButton.css.d.ts.map +1 -0
  152. package/dist/src/components/common/RunButton.d.ts +3 -0
  153. package/dist/src/components/common/RunButton.d.ts.map +1 -0
  154. package/dist/src/components/common/Stack.css.d.ts +2 -0
  155. package/dist/src/components/common/Stack.css.d.ts.map +1 -0
  156. package/dist/src/components/common/Stack.d.ts +7 -0
  157. package/dist/src/components/common/Stack.d.ts.map +1 -0
  158. package/dist/src/components/common/index.d.ts +9 -0
  159. package/dist/src/components/common/index.d.ts.map +1 -0
  160. package/dist/src/components/icons/index.d.ts +16 -0
  161. package/dist/src/components/icons/index.d.ts.map +1 -0
  162. package/dist/src/components/index.d.ts +10 -0
  163. package/dist/src/components/index.d.ts.map +1 -0
  164. package/dist/src/contexts/sandpackContext.d.ts +11 -0
  165. package/dist/src/contexts/sandpackContext.d.ts.map +1 -0
  166. package/dist/src/contexts/utils/testHelpers.d.ts +9 -0
  167. package/dist/src/contexts/utils/testHelpers.d.ts.map +1 -0
  168. package/dist/src/contexts/utils/useAppState.d.ts +15 -0
  169. package/dist/src/contexts/utils/useAppState.d.ts.map +1 -0
  170. package/dist/src/contexts/utils/useClient.d.ts +32 -0
  171. package/dist/src/contexts/utils/useClient.d.ts.map +1 -0
  172. package/dist/src/contexts/utils/useFiles.d.ts +41 -0
  173. package/dist/src/contexts/utils/useFiles.d.ts.map +1 -0
  174. package/dist/src/hooks/index.d.ts +12 -0
  175. package/dist/src/hooks/index.d.ts.map +1 -0
  176. package/dist/src/hooks/useActiveCode.d.ts +21 -0
  177. package/dist/src/hooks/useActiveCode.d.ts.map +1 -0
  178. package/dist/src/hooks/useErrorMessage.d.ts +5 -0
  179. package/dist/src/hooks/useErrorMessage.d.ts.map +1 -0
  180. package/dist/src/hooks/useLoadingOverlayState.d.ts +7 -0
  181. package/dist/src/hooks/useLoadingOverlayState.d.ts.map +1 -0
  182. package/dist/src/hooks/useSandpack.d.ts +14 -0
  183. package/dist/src/hooks/useSandpack.d.ts.map +1 -0
  184. package/dist/src/hooks/useSandpackClient.d.ts +23 -0
  185. package/dist/src/hooks/useSandpackClient.d.ts.map +1 -0
  186. package/dist/src/hooks/useSandpackNavigation.d.ts +9 -0
  187. package/dist/src/hooks/useSandpackNavigation.d.ts.map +1 -0
  188. package/dist/src/hooks/useSandpackPreviewProgress.d.ts +5 -0
  189. package/dist/src/hooks/useSandpackPreviewProgress.d.ts.map +1 -0
  190. package/dist/src/hooks/useSandpackShell.d.ts +8 -0
  191. package/dist/src/hooks/useSandpackShell.d.ts.map +1 -0
  192. package/dist/src/hooks/useSandpackShellStdout.d.ts +12 -0
  193. package/dist/src/hooks/useSandpackShellStdout.d.ts.map +1 -0
  194. package/dist/src/hooks/useSandpackTheme.d.ts +10 -0
  195. package/dist/src/hooks/useSandpackTheme.d.ts.map +1 -0
  196. package/dist/src/hooks/useTranspiledCode.d.ts +5 -0
  197. package/dist/src/hooks/useTranspiledCode.d.ts.map +1 -0
  198. package/dist/src/index.d.ts +15 -0
  199. package/dist/src/index.d.ts.map +1 -0
  200. package/dist/src/presets/Sandpack.css.d.ts +20 -0
  201. package/dist/src/presets/Sandpack.css.d.ts.map +1 -0
  202. package/dist/src/presets/Sandpack.d.ts +3 -0
  203. package/dist/src/presets/Sandpack.d.ts.map +1 -0
  204. package/dist/src/presets/index.d.ts +2 -0
  205. package/dist/src/presets/index.d.ts.map +1 -0
  206. package/dist/src/setup.jest.d.ts +2 -0
  207. package/dist/src/setup.jest.d.ts.map +1 -0
  208. package/dist/src/styles/__generated__/cssText.d.ts +7 -0
  209. package/dist/src/styles/__generated__/cssText.d.ts.map +1 -0
  210. package/dist/src/styles/constants.d.ts +10 -0
  211. package/dist/src/styles/constants.d.ts.map +1 -0
  212. package/dist/src/styles/getSandpackCssText.d.ts +16 -0
  213. package/dist/src/styles/getSandpackCssText.d.ts.map +1 -0
  214. package/dist/src/styles/index.d.ts +65 -0
  215. package/dist/src/styles/index.d.ts.map +1 -0
  216. package/dist/src/styles/shared.css.d.ts +22 -0
  217. package/dist/src/styles/shared.css.d.ts.map +1 -0
  218. package/dist/src/styles/themeContext.css.d.ts +17 -0
  219. package/dist/src/styles/themeContext.css.d.ts.map +1 -0
  220. package/dist/src/styles/themeContext.d.ts +21 -0
  221. package/dist/src/styles/themeContext.d.ts.map +1 -0
  222. package/dist/src/styles/vars.css.d.ts +98 -0
  223. package/dist/src/styles/vars.css.d.ts.map +1 -0
  224. package/dist/src/templates/common.d.ts +6 -0
  225. package/dist/src/templates/common.d.ts.map +1 -0
  226. package/dist/src/templates/index.d.ts +549 -0
  227. package/dist/src/templates/index.d.ts.map +1 -0
  228. package/dist/src/templates/node/astro.d.ts +22 -0
  229. package/dist/src/templates/node/astro.d.ts.map +1 -0
  230. package/dist/src/templates/node/nexjs.d.ts +22 -0
  231. package/dist/src/templates/node/nexjs.d.ts.map +1 -0
  232. package/dist/src/templates/node/node.d.ts +13 -0
  233. package/dist/src/templates/node/node.d.ts.map +1 -0
  234. package/dist/src/templates/node/vite-preact-ts.d.ts +34 -0
  235. package/dist/src/templates/node/vite-preact-ts.d.ts.map +1 -0
  236. package/dist/src/templates/node/vite-preact.d.ts +25 -0
  237. package/dist/src/templates/node/vite-preact.d.ts.map +1 -0
  238. package/dist/src/templates/node/vite-react-ts.d.ts +34 -0
  239. package/dist/src/templates/node/vite-react-ts.d.ts.map +1 -0
  240. package/dist/src/templates/node/vite-react.d.ts +25 -0
  241. package/dist/src/templates/node/vite-react.d.ts.map +1 -0
  242. package/dist/src/templates/node/vite-svelte-ts.d.ts +37 -0
  243. package/dist/src/templates/node/vite-svelte-ts.d.ts.map +1 -0
  244. package/dist/src/templates/node/vite-svelte.d.ts +25 -0
  245. package/dist/src/templates/node/vite-svelte.d.ts.map +1 -0
  246. package/dist/src/templates/node/vite-vue-ts.d.ts +34 -0
  247. package/dist/src/templates/node/vite-vue-ts.d.ts.map +1 -0
  248. package/dist/src/templates/node/vite-vue.d.ts +25 -0
  249. package/dist/src/templates/node/vite-vue.d.ts.map +1 -0
  250. package/dist/src/templates/node/vite.d.ts +19 -0
  251. package/dist/src/templates/node/vite.d.ts.map +1 -0
  252. package/dist/src/templates/runtime/angular.d.ts +31 -0
  253. package/dist/src/templates/runtime/angular.d.ts.map +1 -0
  254. package/dist/src/templates/runtime/react-typescript.d.ts +25 -0
  255. package/dist/src/templates/runtime/react-typescript.d.ts.map +1 -0
  256. package/dist/src/templates/runtime/react.d.ts +22 -0
  257. package/dist/src/templates/runtime/react.d.ts.map +1 -0
  258. package/dist/src/templates/runtime/solid.d.ts +22 -0
  259. package/dist/src/templates/runtime/solid.d.ts.map +1 -0
  260. package/dist/src/templates/runtime/svelte.d.ts +22 -0
  261. package/dist/src/templates/runtime/svelte.d.ts.map +1 -0
  262. package/dist/src/templates/runtime/tests-ts.d.ts +20 -0
  263. package/dist/src/templates/runtime/tests-ts.d.ts.map +1 -0
  264. package/dist/src/templates/runtime/vanilla-typescript.d.ts +22 -0
  265. package/dist/src/templates/runtime/vanilla-typescript.d.ts.map +1 -0
  266. package/dist/src/templates/runtime/vanilla.d.ts +19 -0
  267. package/dist/src/templates/runtime/vanilla.d.ts.map +1 -0
  268. package/dist/src/templates/runtime/vue-ts.d.ts +26 -0
  269. package/dist/src/templates/runtime/vue-ts.d.ts.map +1 -0
  270. package/dist/src/templates/runtime/vue.d.ts +22 -0
  271. package/dist/src/templates/runtime/vue.d.ts.map +1 -0
  272. package/dist/src/templates/static.d.ts +16 -0
  273. package/dist/src/templates/static.d.ts.map +1 -0
  274. package/dist/src/themes/index.d.ts +14 -0
  275. package/dist/src/themes/index.d.ts.map +1 -0
  276. package/dist/src/types.d.ts +477 -0
  277. package/dist/src/types.d.ts.map +1 -0
  278. package/dist/src/utils/ansi-to-react.d.ts +13 -0
  279. package/dist/src/utils/ansi-to-react.d.ts.map +1 -0
  280. package/dist/src/utils/array.d.ts +2 -0
  281. package/dist/src/utils/array.d.ts.map +1 -0
  282. package/dist/src/utils/classNames.d.ts +6 -0
  283. package/dist/src/utils/classNames.d.ts.map +1 -0
  284. package/dist/src/utils/createSandpackFS.d.ts +35 -0
  285. package/dist/src/utils/createSandpackFS.d.ts.map +1 -0
  286. package/dist/src/utils/storyHelpers.d.ts +9 -0
  287. package/dist/src/utils/storyHelpers.d.ts.map +1 -0
  288. package/dist/src/utils/stringUtils.d.ts +10 -0
  289. package/dist/src/utils/stringUtils.d.ts.map +1 -0
  290. package/dist/src/utils/useAsyncSandpackId.d.ts +9 -0
  291. package/dist/src/utils/useAsyncSandpackId.d.ts.map +1 -0
  292. package/dist/styles.css +890 -0
  293. package/dist/unstyled/index.js +5942 -0
  294. package/dist/unstyled/index.mjs +5838 -0
  295. package/dist/unstyled/src/components/CodeEditor/CodeMirror.d.ts +50 -0
  296. package/dist/unstyled/src/components/CodeEditor/CodeMirror.d.ts.map +1 -0
  297. package/dist/unstyled/src/components/CodeEditor/highlightDecorators.d.ts +4 -0
  298. package/dist/unstyled/src/components/CodeEditor/highlightDecorators.d.ts.map +1 -0
  299. package/dist/unstyled/src/components/CodeEditor/highlightInlineError.d.ts +3 -0
  300. package/dist/unstyled/src/components/CodeEditor/highlightInlineError.d.ts.map +1 -0
  301. package/dist/unstyled/src/components/CodeEditor/index.d.ts +50 -0
  302. package/dist/unstyled/src/components/CodeEditor/index.d.ts.map +1 -0
  303. package/dist/unstyled/src/components/CodeEditor/languages-mocks.d.ts +9 -0
  304. package/dist/unstyled/src/components/CodeEditor/languages-mocks.d.ts.map +1 -0
  305. package/dist/unstyled/src/components/CodeEditor/styles.css.d.ts +6 -0
  306. package/dist/unstyled/src/components/CodeEditor/styles.css.d.ts.map +1 -0
  307. package/dist/unstyled/src/components/CodeEditor/useSyntaxHighlight.d.ts +7 -0
  308. package/dist/unstyled/src/components/CodeEditor/useSyntaxHighlight.d.ts.map +1 -0
  309. package/dist/unstyled/src/components/CodeEditor/utils.d.ts +16 -0
  310. package/dist/unstyled/src/components/CodeEditor/utils.d.ts.map +1 -0
  311. package/dist/unstyled/src/components/CodeViewer/index.d.ts +28 -0
  312. package/dist/unstyled/src/components/CodeViewer/index.d.ts.map +1 -0
  313. package/dist/unstyled/src/components/Console/ConsoleList.css.d.ts +29 -0
  314. package/dist/unstyled/src/components/Console/ConsoleList.css.d.ts.map +1 -0
  315. package/dist/unstyled/src/components/Console/ConsoleList.d.ts +6 -0
  316. package/dist/unstyled/src/components/Console/ConsoleList.d.ts.map +1 -0
  317. package/dist/unstyled/src/components/Console/Header.css.d.ts +5 -0
  318. package/dist/unstyled/src/components/Console/Header.css.d.ts.map +1 -0
  319. package/dist/unstyled/src/components/Console/Header.d.ts +7 -0
  320. package/dist/unstyled/src/components/Console/Header.d.ts.map +1 -0
  321. package/dist/unstyled/src/components/Console/SandpackConsole.css.d.ts +4 -0
  322. package/dist/unstyled/src/components/Console/SandpackConsole.css.d.ts.map +1 -0
  323. package/dist/unstyled/src/components/Console/SandpackConsole.d.ts +27 -0
  324. package/dist/unstyled/src/components/Console/SandpackConsole.d.ts.map +1 -0
  325. package/dist/unstyled/src/components/Console/StdoutList.css.d.ts +2 -0
  326. package/dist/unstyled/src/components/Console/StdoutList.css.d.ts.map +1 -0
  327. package/dist/unstyled/src/components/Console/StdoutList.d.ts +8 -0
  328. package/dist/unstyled/src/components/Console/StdoutList.d.ts.map +1 -0
  329. package/dist/unstyled/src/components/Console/index.d.ts +3 -0
  330. package/dist/unstyled/src/components/Console/index.d.ts.map +1 -0
  331. package/dist/unstyled/src/components/Console/useSandpackConsole.d.ts +16 -0
  332. package/dist/unstyled/src/components/Console/useSandpackConsole.d.ts.map +1 -0
  333. package/dist/unstyled/src/components/Console/utils/constraints.d.ts +14 -0
  334. package/dist/unstyled/src/components/Console/utils/constraints.d.ts.map +1 -0
  335. package/dist/unstyled/src/components/Console/utils/fromConsoleToString.d.ts +13 -0
  336. package/dist/unstyled/src/components/Console/utils/fromConsoleToString.d.ts.map +1 -0
  337. package/dist/unstyled/src/components/Console/utils/getType.d.ts +8 -0
  338. package/dist/unstyled/src/components/Console/utils/getType.d.ts.map +1 -0
  339. package/dist/unstyled/src/components/Console/utils/transformers.d.ts +5 -0
  340. package/dist/unstyled/src/components/Console/utils/transformers.d.ts.map +1 -0
  341. package/dist/unstyled/src/components/FileExplorer/File.css.d.ts +2 -0
  342. package/dist/unstyled/src/components/FileExplorer/File.css.d.ts.map +1 -0
  343. package/dist/unstyled/src/components/FileExplorer/File.d.ts +11 -0
  344. package/dist/unstyled/src/components/FileExplorer/File.d.ts.map +1 -0
  345. package/dist/unstyled/src/components/FileExplorer/FileExplorer.css.d.ts +2 -0
  346. package/dist/unstyled/src/components/FileExplorer/FileExplorer.css.d.ts.map +1 -0
  347. package/dist/unstyled/src/components/FileExplorer/ModuleList.d.ts +25 -0
  348. package/dist/unstyled/src/components/FileExplorer/ModuleList.d.ts.map +1 -0
  349. package/dist/unstyled/src/components/FileExplorer/index.d.ts +13 -0
  350. package/dist/unstyled/src/components/FileExplorer/index.d.ts.map +1 -0
  351. package/dist/unstyled/src/components/FileExplorer/utils.d.ts +17 -0
  352. package/dist/unstyled/src/components/FileExplorer/utils.d.ts.map +1 -0
  353. package/dist/unstyled/src/components/FileTabs/FileTabs.css.d.ts +6 -0
  354. package/dist/unstyled/src/components/FileTabs/FileTabs.css.d.ts.map +1 -0
  355. package/dist/unstyled/src/components/FileTabs/index.d.ts +19 -0
  356. package/dist/unstyled/src/components/FileTabs/index.d.ts.map +1 -0
  357. package/dist/unstyled/src/components/Navigator/Navigator.css.d.ts +4 -0
  358. package/dist/unstyled/src/components/Navigator/Navigator.css.d.ts.map +1 -0
  359. package/dist/unstyled/src/components/Navigator/index.d.ts +8 -0
  360. package/dist/unstyled/src/components/Navigator/index.d.ts.map +1 -0
  361. package/dist/unstyled/src/components/Navigator/utils.d.ts +2 -0
  362. package/dist/unstyled/src/components/Navigator/utils.d.ts.map +1 -0
  363. package/dist/unstyled/src/components/Preview/Preview.css.d.ts +4 -0
  364. package/dist/unstyled/src/components/Preview/Preview.css.d.ts.map +1 -0
  365. package/dist/unstyled/src/components/Preview/index.d.ts +31 -0
  366. package/dist/unstyled/src/components/Preview/index.d.ts.map +1 -0
  367. package/dist/unstyled/src/components/ReactDevTools/ReactDevTools.css.d.ts +2 -0
  368. package/dist/unstyled/src/components/ReactDevTools/ReactDevTools.css.d.ts.map +1 -0
  369. package/dist/unstyled/src/components/ReactDevTools/index.d.ts +8 -0
  370. package/dist/unstyled/src/components/ReactDevTools/index.d.ts.map +1 -0
  371. package/dist/unstyled/src/components/Tests/Describes.css.d.ts +3 -0
  372. package/dist/unstyled/src/components/Tests/Describes.css.d.ts.map +1 -0
  373. package/dist/unstyled/src/components/Tests/Describes.d.ts +11 -0
  374. package/dist/unstyled/src/components/Tests/Describes.d.ts.map +1 -0
  375. package/dist/unstyled/src/components/Tests/FormattedError.css.d.ts +2 -0
  376. package/dist/unstyled/src/components/Tests/FormattedError.css.d.ts.map +1 -0
  377. package/dist/unstyled/src/components/Tests/FormattedError.d.ts +9 -0
  378. package/dist/unstyled/src/components/Tests/FormattedError.d.ts.map +1 -0
  379. package/dist/unstyled/src/components/Tests/Header.css.d.ts +5 -0
  380. package/dist/unstyled/src/components/Tests/Header.css.d.ts.map +1 -0
  381. package/dist/unstyled/src/components/Tests/Header.d.ts +18 -0
  382. package/dist/unstyled/src/components/Tests/Header.d.ts.map +1 -0
  383. package/dist/unstyled/src/components/Tests/RunButton.d.ts +5 -0
  384. package/dist/unstyled/src/components/Tests/RunButton.d.ts.map +1 -0
  385. package/dist/unstyled/src/components/Tests/SandpackTests.css.d.ts +4 -0
  386. package/dist/unstyled/src/components/Tests/SandpackTests.css.d.ts.map +1 -0
  387. package/dist/unstyled/src/components/Tests/SandpackTests.d.ts +18 -0
  388. package/dist/unstyled/src/components/Tests/SandpackTests.d.ts.map +1 -0
  389. package/dist/unstyled/src/components/Tests/Specs.css.d.ts +9 -0
  390. package/dist/unstyled/src/components/Tests/Specs.css.d.ts.map +1 -0
  391. package/dist/unstyled/src/components/Tests/Specs.d.ts +17 -0
  392. package/dist/unstyled/src/components/Tests/Specs.d.ts.map +1 -0
  393. package/dist/unstyled/src/components/Tests/Summary.css.d.ts +4 -0
  394. package/dist/unstyled/src/components/Tests/Summary.css.d.ts.map +1 -0
  395. package/dist/unstyled/src/components/Tests/Summary.d.ts +20 -0
  396. package/dist/unstyled/src/components/Tests/Summary.d.ts.map +1 -0
  397. package/dist/unstyled/src/components/Tests/Tests.css.d.ts +6 -0
  398. package/dist/unstyled/src/components/Tests/Tests.css.d.ts.map +1 -0
  399. package/dist/unstyled/src/components/Tests/Tests.d.ts +17 -0
  400. package/dist/unstyled/src/components/Tests/Tests.d.ts.map +1 -0
  401. package/dist/unstyled/src/components/Tests/index.d.ts +2 -0
  402. package/dist/unstyled/src/components/Tests/index.d.ts.map +1 -0
  403. package/dist/unstyled/src/components/Tests/style.css.d.ts +8 -0
  404. package/dist/unstyled/src/components/Tests/style.css.d.ts.map +1 -0
  405. package/dist/unstyled/src/components/Tests/style.d.ts +3 -0
  406. package/dist/unstyled/src/components/Tests/style.d.ts.map +1 -0
  407. package/dist/unstyled/src/components/Tests/utils.d.ts +14 -0
  408. package/dist/unstyled/src/components/Tests/utils.d.ts.map +1 -0
  409. package/dist/unstyled/src/components/TranspiledCode/TranspiledCode.css.d.ts +2 -0
  410. package/dist/unstyled/src/components/TranspiledCode/TranspiledCode.css.d.ts.map +1 -0
  411. package/dist/unstyled/src/components/TranspiledCode/index.d.ts +4 -0
  412. package/dist/unstyled/src/components/TranspiledCode/index.d.ts.map +1 -0
  413. package/dist/unstyled/src/components/common/DependenciesProgress.css.d.ts +2 -0
  414. package/dist/unstyled/src/components/common/DependenciesProgress.css.d.ts.map +1 -0
  415. package/dist/unstyled/src/components/common/DependenciesProgress.d.ts +4 -0
  416. package/dist/unstyled/src/components/common/DependenciesProgress.d.ts.map +1 -0
  417. package/dist/unstyled/src/components/common/ErrorOverlay.d.ts +6 -0
  418. package/dist/unstyled/src/components/common/ErrorOverlay.d.ts.map +1 -0
  419. package/dist/unstyled/src/components/common/Layout.css.d.ts +2 -0
  420. package/dist/unstyled/src/components/common/Layout.css.d.ts.map +1 -0
  421. package/dist/unstyled/src/components/common/Layout.d.ts +8 -0
  422. package/dist/unstyled/src/components/common/Layout.d.ts.map +1 -0
  423. package/dist/unstyled/src/components/common/Loading.css.d.ts +4 -0
  424. package/dist/unstyled/src/components/common/Loading.css.d.ts.map +1 -0
  425. package/dist/unstyled/src/components/common/Loading.d.ts +5 -0
  426. package/dist/unstyled/src/components/common/Loading.d.ts.map +1 -0
  427. package/dist/unstyled/src/components/common/LoadingOverlay.css.d.ts +5 -0
  428. package/dist/unstyled/src/components/common/LoadingOverlay.css.d.ts.map +1 -0
  429. package/dist/unstyled/src/components/common/LoadingOverlay.d.ts +12 -0
  430. package/dist/unstyled/src/components/common/LoadingOverlay.d.ts.map +1 -0
  431. package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/OpenInCodeSandboxButton.d.ts +3 -0
  432. package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/OpenInCodeSandboxButton.d.ts.map +1 -0
  433. package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/UnstyledOpenInCodeSandboxButton.d.ts +7 -0
  434. package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/UnstyledOpenInCodeSandboxButton.d.ts.map +1 -0
  435. package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/index.d.ts +3 -0
  436. package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/index.d.ts.map +1 -0
  437. package/dist/unstyled/src/components/common/RoundedButton.d.ts +3 -0
  438. package/dist/unstyled/src/components/common/RoundedButton.d.ts.map +1 -0
  439. package/dist/unstyled/src/components/common/RunButton.css.d.ts +2 -0
  440. package/dist/unstyled/src/components/common/RunButton.css.d.ts.map +1 -0
  441. package/dist/unstyled/src/components/common/RunButton.d.ts +3 -0
  442. package/dist/unstyled/src/components/common/RunButton.d.ts.map +1 -0
  443. package/dist/unstyled/src/components/common/Stack.css.d.ts +2 -0
  444. package/dist/unstyled/src/components/common/Stack.css.d.ts.map +1 -0
  445. package/dist/unstyled/src/components/common/Stack.d.ts +7 -0
  446. package/dist/unstyled/src/components/common/Stack.d.ts.map +1 -0
  447. package/dist/unstyled/src/components/common/index.d.ts +9 -0
  448. package/dist/unstyled/src/components/common/index.d.ts.map +1 -0
  449. package/dist/unstyled/src/components/icons/index.d.ts +16 -0
  450. package/dist/unstyled/src/components/icons/index.d.ts.map +1 -0
  451. package/dist/unstyled/src/components/index.d.ts +10 -0
  452. package/dist/unstyled/src/components/index.d.ts.map +1 -0
  453. package/dist/unstyled/src/contexts/sandpackContext.d.ts +11 -0
  454. package/dist/unstyled/src/contexts/sandpackContext.d.ts.map +1 -0
  455. package/dist/unstyled/src/contexts/utils/testHelpers.d.ts +9 -0
  456. package/dist/unstyled/src/contexts/utils/testHelpers.d.ts.map +1 -0
  457. package/dist/unstyled/src/contexts/utils/useAppState.d.ts +15 -0
  458. package/dist/unstyled/src/contexts/utils/useAppState.d.ts.map +1 -0
  459. package/dist/unstyled/src/contexts/utils/useClient.d.ts +32 -0
  460. package/dist/unstyled/src/contexts/utils/useClient.d.ts.map +1 -0
  461. package/dist/unstyled/src/contexts/utils/useFiles.d.ts +41 -0
  462. package/dist/unstyled/src/contexts/utils/useFiles.d.ts.map +1 -0
  463. package/dist/unstyled/src/hooks/index.d.ts +12 -0
  464. package/dist/unstyled/src/hooks/index.d.ts.map +1 -0
  465. package/dist/unstyled/src/hooks/useActiveCode.d.ts +21 -0
  466. package/dist/unstyled/src/hooks/useActiveCode.d.ts.map +1 -0
  467. package/dist/unstyled/src/hooks/useErrorMessage.d.ts +5 -0
  468. package/dist/unstyled/src/hooks/useErrorMessage.d.ts.map +1 -0
  469. package/dist/unstyled/src/hooks/useLoadingOverlayState.d.ts +7 -0
  470. package/dist/unstyled/src/hooks/useLoadingOverlayState.d.ts.map +1 -0
  471. package/dist/unstyled/src/hooks/useSandpack.d.ts +14 -0
  472. package/dist/unstyled/src/hooks/useSandpack.d.ts.map +1 -0
  473. package/dist/unstyled/src/hooks/useSandpackClient.d.ts +23 -0
  474. package/dist/unstyled/src/hooks/useSandpackClient.d.ts.map +1 -0
  475. package/dist/unstyled/src/hooks/useSandpackNavigation.d.ts +9 -0
  476. package/dist/unstyled/src/hooks/useSandpackNavigation.d.ts.map +1 -0
  477. package/dist/unstyled/src/hooks/useSandpackPreviewProgress.d.ts +5 -0
  478. package/dist/unstyled/src/hooks/useSandpackPreviewProgress.d.ts.map +1 -0
  479. package/dist/unstyled/src/hooks/useSandpackShell.d.ts +8 -0
  480. package/dist/unstyled/src/hooks/useSandpackShell.d.ts.map +1 -0
  481. package/dist/unstyled/src/hooks/useSandpackShellStdout.d.ts +12 -0
  482. package/dist/unstyled/src/hooks/useSandpackShellStdout.d.ts.map +1 -0
  483. package/dist/unstyled/src/hooks/useSandpackTheme.d.ts +10 -0
  484. package/dist/unstyled/src/hooks/useSandpackTheme.d.ts.map +1 -0
  485. package/dist/unstyled/src/hooks/useTranspiledCode.d.ts +5 -0
  486. package/dist/unstyled/src/hooks/useTranspiledCode.d.ts.map +1 -0
  487. package/dist/unstyled/src/index.d.ts +15 -0
  488. package/dist/unstyled/src/index.d.ts.map +1 -0
  489. package/dist/unstyled/src/presets/Sandpack.css.d.ts +20 -0
  490. package/dist/unstyled/src/presets/Sandpack.css.d.ts.map +1 -0
  491. package/dist/unstyled/src/presets/Sandpack.d.ts +3 -0
  492. package/dist/unstyled/src/presets/Sandpack.d.ts.map +1 -0
  493. package/dist/unstyled/src/presets/index.d.ts +2 -0
  494. package/dist/unstyled/src/presets/index.d.ts.map +1 -0
  495. package/dist/unstyled/src/setup.jest.d.ts +2 -0
  496. package/dist/unstyled/src/setup.jest.d.ts.map +1 -0
  497. package/dist/unstyled/src/styles/__generated__/cssText.d.ts +7 -0
  498. package/dist/unstyled/src/styles/__generated__/cssText.d.ts.map +1 -0
  499. package/dist/unstyled/src/styles/constants.d.ts +10 -0
  500. package/dist/unstyled/src/styles/constants.d.ts.map +1 -0
  501. package/dist/unstyled/src/styles/getSandpackCssText.d.ts +16 -0
  502. package/dist/unstyled/src/styles/getSandpackCssText.d.ts.map +1 -0
  503. package/dist/unstyled/src/styles/index.d.ts +65 -0
  504. package/dist/unstyled/src/styles/index.d.ts.map +1 -0
  505. package/dist/unstyled/src/styles/shared.css.d.ts +22 -0
  506. package/dist/unstyled/src/styles/shared.css.d.ts.map +1 -0
  507. package/dist/unstyled/src/styles/themeContext.css.d.ts +17 -0
  508. package/dist/unstyled/src/styles/themeContext.css.d.ts.map +1 -0
  509. package/dist/unstyled/src/styles/themeContext.d.ts +21 -0
  510. package/dist/unstyled/src/styles/themeContext.d.ts.map +1 -0
  511. package/dist/unstyled/src/styles/vars.css.d.ts +98 -0
  512. package/dist/unstyled/src/styles/vars.css.d.ts.map +1 -0
  513. package/dist/unstyled/src/templates/common.d.ts +6 -0
  514. package/dist/unstyled/src/templates/common.d.ts.map +1 -0
  515. package/dist/unstyled/src/templates/index.d.ts +549 -0
  516. package/dist/unstyled/src/templates/index.d.ts.map +1 -0
  517. package/dist/unstyled/src/templates/node/astro.d.ts +22 -0
  518. package/dist/unstyled/src/templates/node/astro.d.ts.map +1 -0
  519. package/dist/unstyled/src/templates/node/nexjs.d.ts +22 -0
  520. package/dist/unstyled/src/templates/node/nexjs.d.ts.map +1 -0
  521. package/dist/unstyled/src/templates/node/node.d.ts +13 -0
  522. package/dist/unstyled/src/templates/node/node.d.ts.map +1 -0
  523. package/dist/unstyled/src/templates/node/vite-preact-ts.d.ts +34 -0
  524. package/dist/unstyled/src/templates/node/vite-preact-ts.d.ts.map +1 -0
  525. package/dist/unstyled/src/templates/node/vite-preact.d.ts +25 -0
  526. package/dist/unstyled/src/templates/node/vite-preact.d.ts.map +1 -0
  527. package/dist/unstyled/src/templates/node/vite-react-ts.d.ts +34 -0
  528. package/dist/unstyled/src/templates/node/vite-react-ts.d.ts.map +1 -0
  529. package/dist/unstyled/src/templates/node/vite-react.d.ts +25 -0
  530. package/dist/unstyled/src/templates/node/vite-react.d.ts.map +1 -0
  531. package/dist/unstyled/src/templates/node/vite-svelte-ts.d.ts +37 -0
  532. package/dist/unstyled/src/templates/node/vite-svelte-ts.d.ts.map +1 -0
  533. package/dist/unstyled/src/templates/node/vite-svelte.d.ts +25 -0
  534. package/dist/unstyled/src/templates/node/vite-svelte.d.ts.map +1 -0
  535. package/dist/unstyled/src/templates/node/vite-vue-ts.d.ts +34 -0
  536. package/dist/unstyled/src/templates/node/vite-vue-ts.d.ts.map +1 -0
  537. package/dist/unstyled/src/templates/node/vite-vue.d.ts +25 -0
  538. package/dist/unstyled/src/templates/node/vite-vue.d.ts.map +1 -0
  539. package/dist/unstyled/src/templates/node/vite.d.ts +19 -0
  540. package/dist/unstyled/src/templates/node/vite.d.ts.map +1 -0
  541. package/dist/unstyled/src/templates/runtime/angular.d.ts +31 -0
  542. package/dist/unstyled/src/templates/runtime/angular.d.ts.map +1 -0
  543. package/dist/unstyled/src/templates/runtime/react-typescript.d.ts +25 -0
  544. package/dist/unstyled/src/templates/runtime/react-typescript.d.ts.map +1 -0
  545. package/dist/unstyled/src/templates/runtime/react.d.ts +22 -0
  546. package/dist/unstyled/src/templates/runtime/react.d.ts.map +1 -0
  547. package/dist/unstyled/src/templates/runtime/solid.d.ts +22 -0
  548. package/dist/unstyled/src/templates/runtime/solid.d.ts.map +1 -0
  549. package/dist/unstyled/src/templates/runtime/svelte.d.ts +22 -0
  550. package/dist/unstyled/src/templates/runtime/svelte.d.ts.map +1 -0
  551. package/dist/unstyled/src/templates/runtime/tests-ts.d.ts +20 -0
  552. package/dist/unstyled/src/templates/runtime/tests-ts.d.ts.map +1 -0
  553. package/dist/unstyled/src/templates/runtime/vanilla-typescript.d.ts +22 -0
  554. package/dist/unstyled/src/templates/runtime/vanilla-typescript.d.ts.map +1 -0
  555. package/dist/unstyled/src/templates/runtime/vanilla.d.ts +19 -0
  556. package/dist/unstyled/src/templates/runtime/vanilla.d.ts.map +1 -0
  557. package/dist/unstyled/src/templates/runtime/vue-ts.d.ts +26 -0
  558. package/dist/unstyled/src/templates/runtime/vue-ts.d.ts.map +1 -0
  559. package/dist/unstyled/src/templates/runtime/vue.d.ts +22 -0
  560. package/dist/unstyled/src/templates/runtime/vue.d.ts.map +1 -0
  561. package/dist/unstyled/src/templates/static.d.ts +16 -0
  562. package/dist/unstyled/src/templates/static.d.ts.map +1 -0
  563. package/dist/unstyled/src/themes/index.d.ts +14 -0
  564. package/dist/unstyled/src/themes/index.d.ts.map +1 -0
  565. package/dist/unstyled/src/types.d.ts +477 -0
  566. package/dist/unstyled/src/types.d.ts.map +1 -0
  567. package/dist/unstyled/src/utils/ansi-to-react.d.ts +13 -0
  568. package/dist/unstyled/src/utils/ansi-to-react.d.ts.map +1 -0
  569. package/dist/unstyled/src/utils/array.d.ts +2 -0
  570. package/dist/unstyled/src/utils/array.d.ts.map +1 -0
  571. package/dist/unstyled/src/utils/classNames.d.ts +6 -0
  572. package/dist/unstyled/src/utils/classNames.d.ts.map +1 -0
  573. package/dist/unstyled/src/utils/createSandpackFS.d.ts +35 -0
  574. package/dist/unstyled/src/utils/createSandpackFS.d.ts.map +1 -0
  575. package/dist/unstyled/src/utils/storyHelpers.d.ts +9 -0
  576. package/dist/unstyled/src/utils/storyHelpers.d.ts.map +1 -0
  577. package/dist/unstyled/src/utils/stringUtils.d.ts +10 -0
  578. package/dist/unstyled/src/utils/stringUtils.d.ts.map +1 -0
  579. package/dist/unstyled/src/utils/useAsyncSandpackId.d.ts +9 -0
  580. package/dist/unstyled/src/utils/useAsyncSandpackId.d.ts.map +1 -0
  581. package/dist/unstyled.d.ts +1 -0
  582. package/package.json +108 -0
@@ -0,0 +1,1771 @@
1
+ import * as React$1 from 'react';
2
+ import React__default, { JSX } from 'react';
3
+ import { Extension } from '@codemirror/state';
4
+ import { KeyBinding, EditorView } from '@codemirror/view';
5
+ import { LanguageSupport } from '@codemirror/language';
6
+ import { NpmRegistry, SandpackFS, SandpackLogLevel, SdkIntegrity, FsSnapshot, SandpackMessage, ListenerFunction, UnsubscribeFunction, BundlerState, SandpackError, FileMetaMap, SandpackClient, ReactDevToolsMode, TestError, SandpackMessageConsoleMethods, SandpackFilesInput } from '@immediately-run/sandpack-client';
7
+ export { SandpackFS } from '@immediately-run/sandpack-client';
8
+ import { BoundContext } from '@zenfs/core';
9
+
10
+ declare const SignInIcon: () => React$1.ReactElement;
11
+ declare const SignOutIcon: () => React$1.ReactElement;
12
+ declare const RestartIcon: () => React$1.ReactElement;
13
+ declare const RunIcon: () => React$1.ReactElement;
14
+ declare const BackwardIcon: () => React$1.ReactElement;
15
+ declare const ForwardIcon: () => React$1.ReactElement;
16
+ declare const RefreshIcon: () => React$1.ReactElement;
17
+ declare const CleanIcon: () => React$1.ReactElement;
18
+ declare const ExportIcon: () => React$1.ReactElement;
19
+ declare const DirectoryIconOpen: () => React$1.ReactElement;
20
+ declare const DirectoryIconClosed: () => React$1.ReactElement;
21
+ declare const FileIcon: () => React$1.ReactElement;
22
+ declare const CloseIcon: () => React$1.ReactElement;
23
+ declare const ConsoleIcon: () => React$1.ReactElement;
24
+
25
+ interface ClientPropsOverride {
26
+ startRoute?: string;
27
+ }
28
+
29
+ /**
30
+ * @hidden
31
+ */
32
+ declare const ASTRO_TEMPLATE: {
33
+ files: {
34
+ "/src/styles.css": {
35
+ code: string;
36
+ };
37
+ "/src/pages/index.astro": {
38
+ code: string;
39
+ };
40
+ ".env": {
41
+ code: string;
42
+ };
43
+ "/package.json": {
44
+ code: string;
45
+ };
46
+ };
47
+ main: string;
48
+ environment: string;
49
+ };
50
+
51
+ declare const ANGULAR_TEMPLATE: {
52
+ files: {
53
+ "/src/app/app.component.css": {
54
+ code: string;
55
+ };
56
+ "/src/app/app.component.html": {
57
+ code: string;
58
+ };
59
+ "/src/app/app.component.ts": {
60
+ code: string;
61
+ };
62
+ "/src/app/app.module.ts": {
63
+ code: string;
64
+ };
65
+ "/src/index.html": {
66
+ code: string;
67
+ };
68
+ "/src/main.ts": {
69
+ code: string;
70
+ };
71
+ "/src/polyfills.ts": {
72
+ code: string;
73
+ };
74
+ "/package.json": {
75
+ code: string;
76
+ };
77
+ };
78
+ main: string;
79
+ environment: string;
80
+ };
81
+
82
+ declare const REACT_TEMPLATE: {
83
+ files: {
84
+ "/App.js": {
85
+ code: string;
86
+ };
87
+ "/index.js": {
88
+ code: string;
89
+ };
90
+ "/public/index.html": {
91
+ code: string;
92
+ };
93
+ "/package.json": {
94
+ code: string;
95
+ };
96
+ "/styles.css": {
97
+ code: string;
98
+ };
99
+ };
100
+ main: string;
101
+ environment: string;
102
+ };
103
+
104
+ declare const REACT_TYPESCRIPT_TEMPLATE: {
105
+ files: {
106
+ "tsconfig.json": {
107
+ code: string;
108
+ };
109
+ "/App.tsx": {
110
+ code: string;
111
+ };
112
+ "/index.tsx": {
113
+ code: string;
114
+ };
115
+ "/public/index.html": {
116
+ code: string;
117
+ };
118
+ "/package.json": {
119
+ code: string;
120
+ };
121
+ "/styles.css": {
122
+ code: string;
123
+ };
124
+ };
125
+ main: string;
126
+ environment: string;
127
+ };
128
+
129
+ declare const SOLID_TEMPLATE: {
130
+ files: {
131
+ "/App.tsx": {
132
+ code: string;
133
+ };
134
+ "/index.tsx": {
135
+ code: string;
136
+ };
137
+ "/index.html": {
138
+ code: string;
139
+ };
140
+ "/package.json": {
141
+ code: string;
142
+ };
143
+ "/styles.css": {
144
+ code: string;
145
+ };
146
+ };
147
+ main: string;
148
+ environment: string;
149
+ };
150
+
151
+ declare const SVELTE_TEMPLATE: {
152
+ files: {
153
+ "/App.svelte": {
154
+ code: string;
155
+ };
156
+ "/index.js": {
157
+ code: string;
158
+ };
159
+ "/public/index.html": {
160
+ code: string;
161
+ };
162
+ "/package.json": {
163
+ code: string;
164
+ };
165
+ "/styles.css": {
166
+ code: string;
167
+ };
168
+ };
169
+ main: string;
170
+ environment: string;
171
+ };
172
+
173
+ declare const TEST_TYPESCRIPT_TEMPLATE: {
174
+ files: {
175
+ "tsconfig.json": {
176
+ code: string;
177
+ };
178
+ "/add.ts": {
179
+ code: string;
180
+ };
181
+ "/add.test.ts": {
182
+ code: string;
183
+ };
184
+ "package.json": {
185
+ code: string;
186
+ };
187
+ };
188
+ main: string;
189
+ environment: string;
190
+ mode: string;
191
+ };
192
+
193
+ declare const VANILLA_TEMPLATE: {
194
+ files: {
195
+ "/index.js": {
196
+ code: string;
197
+ };
198
+ "/index.html": {
199
+ code: string;
200
+ };
201
+ "/package.json": {
202
+ code: string;
203
+ };
204
+ "/styles.css": {
205
+ code: string;
206
+ };
207
+ };
208
+ main: string;
209
+ environment: string;
210
+ };
211
+
212
+ declare const VANILLA_TYPESCRIPT_TEMPLATE: {
213
+ files: {
214
+ "tsconfig.json": {
215
+ code: string;
216
+ };
217
+ "/index.ts": {
218
+ code: string;
219
+ };
220
+ "/index.html": {
221
+ code: string;
222
+ };
223
+ "/package.json": {
224
+ code: string;
225
+ };
226
+ "/styles.css": {
227
+ code: string;
228
+ };
229
+ };
230
+ main: string;
231
+ environment: string;
232
+ };
233
+
234
+ declare const VUE_TEMPLATE: {
235
+ files: {
236
+ "/src/styles.css": {
237
+ code: string;
238
+ };
239
+ "/src/App.vue": {
240
+ code: string;
241
+ };
242
+ "/src/main.js": {
243
+ code: string;
244
+ };
245
+ "/public/index.html": {
246
+ code: string;
247
+ };
248
+ "/package.json": {
249
+ code: string;
250
+ };
251
+ };
252
+ main: string;
253
+ environment: string;
254
+ };
255
+
256
+ declare const SANDBOX_TEMPLATES: {
257
+ static: {
258
+ files: {
259
+ "/index.html": {
260
+ code: string;
261
+ };
262
+ "/package.json": {
263
+ code: string;
264
+ };
265
+ "/styles.css": {
266
+ code: string;
267
+ };
268
+ };
269
+ main: string;
270
+ environment: string;
271
+ };
272
+ angular: {
273
+ files: {
274
+ "/src/app/app.component.css": {
275
+ code: string;
276
+ };
277
+ "/src/app/app.component.html": {
278
+ code: string;
279
+ };
280
+ "/src/app/app.component.ts": {
281
+ code: string;
282
+ };
283
+ "/src/app/app.module.ts": {
284
+ code: string;
285
+ };
286
+ "/src/index.html": {
287
+ code: string;
288
+ };
289
+ "/src/main.ts": {
290
+ code: string;
291
+ };
292
+ "/src/polyfills.ts": {
293
+ code: string;
294
+ };
295
+ "/package.json": {
296
+ code: string;
297
+ };
298
+ };
299
+ main: string;
300
+ environment: string;
301
+ };
302
+ react: {
303
+ files: {
304
+ "/App.js": {
305
+ code: string;
306
+ };
307
+ "/index.js": {
308
+ code: string;
309
+ };
310
+ "/public/index.html": {
311
+ code: string;
312
+ };
313
+ "/package.json": {
314
+ code: string;
315
+ };
316
+ "/styles.css": {
317
+ code: string;
318
+ };
319
+ };
320
+ main: string;
321
+ environment: string;
322
+ };
323
+ "react-ts": {
324
+ files: {
325
+ "tsconfig.json": {
326
+ code: string;
327
+ };
328
+ "/App.tsx": {
329
+ code: string;
330
+ };
331
+ "/index.tsx": {
332
+ code: string;
333
+ };
334
+ "/public/index.html": {
335
+ code: string;
336
+ };
337
+ "/package.json": {
338
+ code: string;
339
+ };
340
+ "/styles.css": {
341
+ code: string;
342
+ };
343
+ };
344
+ main: string;
345
+ environment: string;
346
+ };
347
+ solid: {
348
+ files: {
349
+ "/App.tsx": {
350
+ code: string;
351
+ };
352
+ "/index.tsx": {
353
+ code: string;
354
+ };
355
+ "/index.html": {
356
+ code: string;
357
+ };
358
+ "/package.json": {
359
+ code: string;
360
+ };
361
+ "/styles.css": {
362
+ code: string;
363
+ };
364
+ };
365
+ main: string;
366
+ environment: string;
367
+ };
368
+ svelte: {
369
+ files: {
370
+ "/App.svelte": {
371
+ code: string;
372
+ };
373
+ "/index.js": {
374
+ code: string;
375
+ };
376
+ "/public/index.html": {
377
+ code: string;
378
+ };
379
+ "/package.json": {
380
+ code: string;
381
+ };
382
+ "/styles.css": {
383
+ code: string;
384
+ };
385
+ };
386
+ main: string;
387
+ environment: string;
388
+ };
389
+ "test-ts": {
390
+ files: {
391
+ "tsconfig.json": {
392
+ code: string;
393
+ };
394
+ "/add.ts": {
395
+ code: string;
396
+ };
397
+ "/add.test.ts": {
398
+ code: string;
399
+ };
400
+ "package.json": {
401
+ code: string;
402
+ };
403
+ };
404
+ main: string;
405
+ environment: string;
406
+ mode: string;
407
+ };
408
+ "vanilla-ts": {
409
+ files: {
410
+ "tsconfig.json": {
411
+ code: string;
412
+ };
413
+ "/index.ts": {
414
+ code: string;
415
+ };
416
+ "/index.html": {
417
+ code: string;
418
+ };
419
+ "/package.json": {
420
+ code: string;
421
+ };
422
+ "/styles.css": {
423
+ code: string;
424
+ };
425
+ };
426
+ main: string;
427
+ environment: string;
428
+ };
429
+ vanilla: {
430
+ files: {
431
+ "/index.js": {
432
+ code: string;
433
+ };
434
+ "/index.html": {
435
+ code: string;
436
+ };
437
+ "/package.json": {
438
+ code: string;
439
+ };
440
+ "/styles.css": {
441
+ code: string;
442
+ };
443
+ };
444
+ main: string;
445
+ environment: string;
446
+ };
447
+ vue: {
448
+ files: {
449
+ "/src/styles.css": {
450
+ code: string;
451
+ };
452
+ "/src/App.vue": {
453
+ code: string;
454
+ };
455
+ "/src/main.js": {
456
+ code: string;
457
+ };
458
+ "/public/index.html": {
459
+ code: string;
460
+ };
461
+ "/package.json": {
462
+ code: string;
463
+ };
464
+ };
465
+ main: string;
466
+ environment: string;
467
+ };
468
+ "vue-ts": {
469
+ files: {
470
+ "/src/styles.css": {
471
+ code: string;
472
+ };
473
+ "/src/App.vue": {
474
+ code: string;
475
+ };
476
+ "/src/main.ts": {
477
+ code: string;
478
+ };
479
+ "/src/shims-vue.d.ts": string;
480
+ "/public/index.html": {
481
+ code: string;
482
+ };
483
+ "/package.json": {
484
+ code: string;
485
+ };
486
+ "/tsconfig.json": {
487
+ code: string;
488
+ };
489
+ };
490
+ main: string;
491
+ environment: string;
492
+ };
493
+ node: {
494
+ files: {
495
+ "/index.js": {
496
+ code: string;
497
+ };
498
+ "/package.json": {
499
+ code: string;
500
+ };
501
+ };
502
+ main: string;
503
+ environment: string;
504
+ };
505
+ nextjs: {
506
+ files: {
507
+ "/pages/_app.js": {
508
+ code: string;
509
+ };
510
+ "/pages/index.js": {
511
+ code: string;
512
+ };
513
+ "/next.config.js": {
514
+ code: string;
515
+ };
516
+ "/package.json": {
517
+ code: string;
518
+ };
519
+ "/styles.css": {
520
+ code: string;
521
+ };
522
+ };
523
+ main: string;
524
+ environment: string;
525
+ };
526
+ vite: {
527
+ files: {
528
+ "/index.js": {
529
+ code: string;
530
+ };
531
+ "/index.html": {
532
+ code: string;
533
+ };
534
+ "/package.json": {
535
+ code: string;
536
+ };
537
+ "/styles.css": {
538
+ code: string;
539
+ };
540
+ };
541
+ main: string;
542
+ environment: string;
543
+ };
544
+ "vite-react": {
545
+ files: {
546
+ "/App.jsx": {
547
+ code: string;
548
+ };
549
+ "/index.jsx": {
550
+ code: string;
551
+ };
552
+ "/index.html": {
553
+ code: string;
554
+ };
555
+ "/package.json": {
556
+ code: string;
557
+ };
558
+ "/vite.config.js": {
559
+ code: string;
560
+ };
561
+ "/styles.css": {
562
+ code: string;
563
+ };
564
+ };
565
+ main: string;
566
+ environment: string;
567
+ };
568
+ "vite-react-ts": {
569
+ files: {
570
+ "/App.tsx": {
571
+ code: string;
572
+ };
573
+ "/index.tsx": {
574
+ code: string;
575
+ };
576
+ "/index.html": {
577
+ code: string;
578
+ };
579
+ "/tsconfig.json": {
580
+ code: string;
581
+ };
582
+ "/tsconfig.node.json": {
583
+ code: string;
584
+ };
585
+ "/package.json": {
586
+ code: string;
587
+ };
588
+ "/vite-env.d.ts": {
589
+ code: string;
590
+ };
591
+ "/vite.config.ts": {
592
+ code: string;
593
+ };
594
+ "/styles.css": {
595
+ code: string;
596
+ };
597
+ };
598
+ main: string;
599
+ environment: string;
600
+ };
601
+ "vite-preact": {
602
+ files: {
603
+ "/App.jsx": {
604
+ code: string;
605
+ };
606
+ "/index.jsx": {
607
+ code: string;
608
+ };
609
+ "/index.html": {
610
+ code: string;
611
+ };
612
+ "/package.json": {
613
+ code: string;
614
+ };
615
+ "/vite.config.js": {
616
+ code: string;
617
+ };
618
+ "/styles.css": {
619
+ code: string;
620
+ };
621
+ };
622
+ main: string;
623
+ environment: string;
624
+ };
625
+ "vite-preact-ts": {
626
+ files: {
627
+ "/App.tsx": {
628
+ code: string;
629
+ };
630
+ "/index.tsx": {
631
+ code: string;
632
+ };
633
+ "/index.html": {
634
+ code: string;
635
+ };
636
+ "/tsconfig.json": {
637
+ code: string;
638
+ };
639
+ "/tsconfig.node.json": {
640
+ code: string;
641
+ };
642
+ "/package.json": {
643
+ code: string;
644
+ };
645
+ "/vite-env.d.ts": {
646
+ code: string;
647
+ };
648
+ "/vite.config.ts": {
649
+ code: string;
650
+ };
651
+ "/styles.css": {
652
+ code: string;
653
+ };
654
+ };
655
+ main: string;
656
+ environment: string;
657
+ };
658
+ "vite-vue": {
659
+ files: {
660
+ "/src/styles.css": {
661
+ code: string;
662
+ };
663
+ "/src/App.vue": {
664
+ code: string;
665
+ };
666
+ "/src/main.js": {
667
+ code: string;
668
+ };
669
+ "/index.html": {
670
+ code: string;
671
+ };
672
+ "/vite.config.js": {
673
+ code: string;
674
+ };
675
+ "/package.json": {
676
+ code: string;
677
+ };
678
+ };
679
+ main: string;
680
+ environment: string;
681
+ };
682
+ "vite-vue-ts": {
683
+ files: {
684
+ "/src/styles.css": {
685
+ code: string;
686
+ };
687
+ "/src/App.vue": {
688
+ code: string;
689
+ };
690
+ "/src/main.ts": {
691
+ code: string;
692
+ };
693
+ "/index.html": {
694
+ code: string;
695
+ };
696
+ "/vite-env.d.ts": {
697
+ code: string;
698
+ };
699
+ "/vite.config.ts": {
700
+ code: string;
701
+ };
702
+ "tsconfig.json": {
703
+ code: string;
704
+ };
705
+ "tsconfig.node.json": {
706
+ code: string;
707
+ };
708
+ "/package.json": {
709
+ code: string;
710
+ };
711
+ };
712
+ main: string;
713
+ environment: string;
714
+ };
715
+ "vite-svelte": {
716
+ files: {
717
+ "/src/styles.css": {
718
+ code: string;
719
+ };
720
+ "/src/App.svelte": {
721
+ code: string;
722
+ };
723
+ "/src/main.js": {
724
+ code: string;
725
+ };
726
+ "/index.html": {
727
+ code: string;
728
+ };
729
+ "/vite.config.js": {
730
+ code: string;
731
+ };
732
+ "/package.json": {
733
+ code: string;
734
+ };
735
+ };
736
+ main: string;
737
+ environment: string;
738
+ };
739
+ "vite-svelte-ts": {
740
+ files: {
741
+ "/src/styles.css": {
742
+ code: string;
743
+ };
744
+ "/src/App.svelte": {
745
+ code: string;
746
+ };
747
+ "/src/main.ts": {
748
+ code: string;
749
+ };
750
+ "/index.html": {
751
+ code: string;
752
+ };
753
+ "/vite-env.d.ts": {
754
+ code: string;
755
+ };
756
+ "svelte.config.js": {
757
+ code: string;
758
+ };
759
+ "/vite.config.ts": {
760
+ code: string;
761
+ };
762
+ "tsconfig.json": {
763
+ code: string;
764
+ };
765
+ "tsconfig.node.json": {
766
+ code: string;
767
+ };
768
+ "/package.json": {
769
+ code: string;
770
+ };
771
+ };
772
+ main: string;
773
+ environment: string;
774
+ };
775
+ astro: {
776
+ files: {
777
+ "/src/styles.css": {
778
+ code: string;
779
+ };
780
+ "/src/pages/index.astro": {
781
+ code: string;
782
+ };
783
+ ".env": {
784
+ code: string;
785
+ };
786
+ "/package.json": {
787
+ code: string;
788
+ };
789
+ };
790
+ main: string;
791
+ environment: string;
792
+ };
793
+ };
794
+
795
+ /**
796
+ * ------------------------ Public documentation ------------------------
797
+ *
798
+ * From this section on, all types are artificially created and maintained
799
+ * for public documentation purposes. So, this might not reflect precisely
800
+ * the component behavior, but it still needs to be reliable and clear for
801
+ * general usage.
802
+ */
803
+ interface SandpackExportOptions {
804
+ /**
805
+ * Workspace API key from codesandbox.io/t/permissions.
806
+ * When set, the sandbox will be created inside the given workspace id.
807
+ */
808
+ apiToken: string;
809
+ /**
810
+ * The default visibility of the new sandboxes inside the workspace.
811
+ *
812
+ * @note Use `private` if there is a private registry or private NPM
813
+ * configured in your workspace.
814
+ */
815
+ privacy: "private" | "public";
816
+ }
817
+ interface SandpackProps {
818
+ /**
819
+ * The fully-initialized filesystem to use as the source of truth.
820
+ * Create one with {@link createSandpackFS}.
821
+ */
822
+ fs: SandpackFS;
823
+ /**
824
+ * The theme specifies the color set of the components, syntax highlight,
825
+ * and typography. Use this prop in order to match the design aspect of your website.
826
+ *
827
+ * Set as `auto` to turn it color scheme sensitive
828
+ */
829
+ theme?: SandpackThemeProp;
830
+ /**
831
+ * Pass custom properties to customize the interface and the behavior
832
+ * of the sandbox, such as initialization mode, recompile mode, etc.
833
+ */
834
+ options?: SandpackOptions;
835
+ /**
836
+ * CodeSandbox team id: with this information, bundler can connect to CodeSandbox
837
+ * and unlock a few capabilities, like private dependencies.
838
+ */
839
+ teamId?: string;
840
+ /**
841
+ * Options for exporting the sandbox to CodeSandbox.
842
+ */
843
+ exportOptions?: SandpackExportOptions;
844
+ /**
845
+ * Custom npm registry configuration.
846
+ */
847
+ npmRegistries?: NpmRegistry[];
848
+ }
849
+ /**
850
+ * @category Setup
851
+ */
852
+ interface SandpackOptions {
853
+ /**
854
+ * List of files that will be visible for the user interacts with.
855
+ * It defaults to the non-hidden files from the filesystem.
856
+ */
857
+ visibleFiles?: string[];
858
+ /**
859
+ * Use this to set a file as active by default in the editor component.
860
+ * It defaults to the first visible file.
861
+ */
862
+ activeFile?: string;
863
+ editorWidthPercentage?: number;
864
+ editorHeight?: React__default.CSSProperties["height"];
865
+ classes?: Record<string, string>;
866
+ /**
867
+ * right to left layout
868
+ * @default false
869
+ */
870
+ rtl?: boolean;
871
+ showNavigator?: boolean;
872
+ showLineNumbers?: boolean;
873
+ showInlineErrors?: boolean;
874
+ showRefreshButton?: boolean;
875
+ showTabs?: boolean;
876
+ showConsoleButton?: boolean;
877
+ showConsole?: boolean;
878
+ closableTabs?: boolean;
879
+ wrapContent?: boolean;
880
+ resizablePanels?: boolean;
881
+ codeEditor?: SandpackCodeOptions;
882
+ /**
883
+ * This disables editing of content by the user in all files.
884
+ */
885
+ readOnly?: boolean;
886
+ /**
887
+ * Controls the visibility of Read-only label, which will only
888
+ * appears when `readOnly` is `true`
889
+ */
890
+ showReadOnly?: boolean;
891
+ layout?: "preview" | "tests" | "console";
892
+ /**
893
+ * This provides a way to control how some components are going to
894
+ * be initialized on the page. The CodeEditor and the Preview components
895
+ * are quite expensive and might overload the memory usage, so this gives
896
+ * a certain control of when to initialize them.
897
+ */
898
+ initMode?: SandpackInitMode;
899
+ initModeObserverOptions?: IntersectionObserverInit;
900
+ /**
901
+ * Determines whether or not the bundling process should start automatically.
902
+ */
903
+ autorun?: boolean;
904
+ /**
905
+ * Determines whether or not the component should automatically reload when
906
+ * changes are made to the code.
907
+ */
908
+ autoReload?: boolean;
909
+ recompileMode?: "immediate" | "delayed";
910
+ recompileDelay?: number;
911
+ /**
912
+ * By default, Sandpack generates a random value to use as an id.
913
+ * Use this to override this value if you need predictable values.
914
+ */
915
+ id?: string;
916
+ logLevel?: SandpackLogLevel;
917
+ bundlerURL?: string;
918
+ babelWorkerURL?: string;
919
+ startRoute?: string;
920
+ skipEval?: boolean;
921
+ externalResources?: string[];
922
+ }
923
+ /**
924
+ * @category Setup
925
+ */
926
+ interface SandpackSetup {
927
+ dependencies?: Record<string, string>;
928
+ devDependencies?: Record<string, string>;
929
+ entry?: string;
930
+ environment?: SandboxEnvironment;
931
+ npmRegistries?: NpmRegistry[];
932
+ exportOptions?: SandpackExportOptions;
933
+ }
934
+ /**
935
+ * @category Setup
936
+ */
937
+ type SandboxEnvironment = "angular-cli" | "create-react-app" | "create-react-app-typescript" | "svelte" | "parcel" | "vue-cli" | "static" | "solid" | "node";
938
+ /**
939
+ * @category Setup
940
+ */
941
+ type SandpackPredefinedTemplate = keyof typeof SANDBOX_TEMPLATES;
942
+ /**
943
+ * @category Setup
944
+ */
945
+ interface SandpackFile {
946
+ code: string;
947
+ hidden?: boolean;
948
+ active?: boolean;
949
+ readOnly?: boolean;
950
+ }
951
+ type SandpackFiles = Record<string, string | SandpackFile>;
952
+ /**
953
+ * `immediate`: It immediately mounts all components, such as the code-editor
954
+ * and the preview - this option might overload the memory usage
955
+ * and resource from the browser on a page with multiple instances;
956
+ *
957
+ * `lazy`: Only initialize the components when the user is about to scroll
958
+ * them to the viewport and keep these components mounted until the user
959
+ * leaves the page - this is the default value;
960
+ *
961
+ * `user-visible`: Only initialize the components when the user is about
962
+ * to scroll them to the viewport, but differently from lazy, this option
963
+ * unmounts those components once it's no longer in the viewport.
964
+ *
965
+ * @category Setup
966
+ */
967
+ type SandpackInitMode = "immediate" | "lazy" | "user-visible";
968
+ /**
969
+ * @category Setup
970
+ */
971
+ interface CustomLanguage {
972
+ name: string;
973
+ extensions: string[];
974
+ language: LanguageSupport;
975
+ }
976
+ /**
977
+ * @category Theme
978
+ */
979
+ type SandpackPredefinedTheme = "light" | "dark" | "auto";
980
+ /**
981
+ * @category Theme
982
+ */
983
+ interface SandpackTheme {
984
+ colors: {
985
+ surface1: string;
986
+ surface2: string;
987
+ surface3: string;
988
+ disabled: string;
989
+ base: string;
990
+ clickable: string;
991
+ hover: string;
992
+ accent: string;
993
+ error?: string;
994
+ errorSurface?: string;
995
+ warning?: string;
996
+ warningSurface?: string;
997
+ };
998
+ syntax: {
999
+ plain: string | SandpackSyntaxStyle;
1000
+ comment: string | SandpackSyntaxStyle;
1001
+ keyword: string | SandpackSyntaxStyle;
1002
+ definition: string | SandpackSyntaxStyle;
1003
+ punctuation: string | SandpackSyntaxStyle;
1004
+ property: string | SandpackSyntaxStyle;
1005
+ tag: string | SandpackSyntaxStyle;
1006
+ static: string | SandpackSyntaxStyle;
1007
+ string?: string | SandpackSyntaxStyle;
1008
+ };
1009
+ font: {
1010
+ body: string;
1011
+ mono: string;
1012
+ size: string;
1013
+ lineHeight: string;
1014
+ };
1015
+ }
1016
+ /**
1017
+ * @category Theme
1018
+ */
1019
+ interface SandpackSyntaxStyle {
1020
+ color?: string;
1021
+ fontStyle?: "normal" | "italic";
1022
+ fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
1023
+ textDecoration?: "none" | "underline" | "line-through" | "underline line-through";
1024
+ }
1025
+ /**
1026
+ * @category Theme
1027
+ */
1028
+ type SandpackThemeProp = SandpackPredefinedTheme | DeepPartial<SandpackTheme>;
1029
+ /**
1030
+ *
1031
+ * ------------------------ Internal types ---------------------------
1032
+ *
1033
+ * From this section on, all types are hidden because most of them are
1034
+ * strictly related to the internal typing system, and they are not
1035
+ * helpful for public documentation.
1036
+ *
1037
+ * For public purpose use SandpackProps instead.
1038
+ */
1039
+ interface SandpackInternal {
1040
+ (props: SandpackInternalProps): React__default.ReactElement;
1041
+ }
1042
+ interface SandpackInternalProvider {
1043
+ (props: React__default.PropsWithChildren<SandpackProviderProps>): React__default.ReactElement<SandpackProviderProps, React__default.Provider<SandpackProviderState>> | null;
1044
+ }
1045
+ interface SandpackRootProps {
1046
+ fs: SandpackFS;
1047
+ theme?: SandpackThemeProp;
1048
+ teamId?: string;
1049
+ sandboxId?: string;
1050
+ exportOptions?: SandpackExportOptions;
1051
+ npmRegistries?: NpmRegistry[];
1052
+ }
1053
+ interface SandpackInternalOptions {
1054
+ visibleFiles?: string[];
1055
+ activeFile?: string;
1056
+ initMode?: SandpackInitMode;
1057
+ initModeObserverOptions?: IntersectionObserverInit;
1058
+ autorun?: boolean;
1059
+ autoReload?: boolean;
1060
+ recompileMode?: "immediate" | "delayed";
1061
+ recompileDelay?: number;
1062
+ id?: string;
1063
+ logLevel?: SandpackLogLevel;
1064
+ bundlerURL?: string;
1065
+ babelWorkerURL?: string;
1066
+ bundlerTimeOut?: number;
1067
+ startRoute?: string;
1068
+ skipEval?: boolean;
1069
+ externalResources?: string[];
1070
+ classes?: Record<string, string>;
1071
+ experimental_enableServiceWorker?: boolean;
1072
+ experimental_enableStableServiceWorkerId?: boolean;
1073
+ /**
1074
+ * Host-pinned SDK artifact integrity hashes (SDK_PACKAGING_SPEC §5.2),
1075
+ * forwarded to the runtime client and on to the bundler for verify-before-
1076
+ * evaluate. Absent ⇒ verification skipped.
1077
+ */
1078
+ sdkIntegrity?: SdkIntegrity;
1079
+ /**
1080
+ * The dirty set (PRETRANSPILED_ARTIFACTS_SPEC §5.2): repo-relative paths in the
1081
+ * COW writable layer + the journal's deleted set, forwarded to the runtime
1082
+ * client and on to the bundler so seeding skips artifacts for paths edited in a
1083
+ * previous session. Absent ⇒ nothing dirty.
1084
+ */
1085
+ dirtyPaths?: string[];
1086
+ /**
1087
+ * R3-49b ZenFS batch hydration: a bulk snapshot of the mounted tree, forwarded to
1088
+ * the runtime client and on to the bundler, which hydrates its read caches before
1089
+ * the first compile so reads come from memory instead of per-file Port round-trips.
1090
+ * Absent ⇒ reads cross the Port as before.
1091
+ */
1092
+ fsSnapshot?: FsSnapshot;
1093
+ /**
1094
+ * The chrome region this app instance occupies, e.g. `"panel.agent"` or
1095
+ * `"stage.conversation"` (R3-114). Forwarded to the runtime client and on to the
1096
+ * bundler, which surfaces it on the `__immediatelyRun__` runtime global for the
1097
+ * SDK's `getRegion()`/`useRegion()`. Descriptive only — grants and gates nothing.
1098
+ * Absent ⇒ the app reads no region.
1099
+ */
1100
+ region?: string;
1101
+ }
1102
+ interface SandpackInternalProps extends SandpackRootProps {
1103
+ options?: SandpackInternalOptions & {
1104
+ editorWidthPercentage?: number;
1105
+ editorHeight?: React__default.CSSProperties["height"];
1106
+ /**
1107
+ * right to left layout
1108
+ * @default false
1109
+ */
1110
+ rtl?: boolean;
1111
+ showNavigator?: boolean;
1112
+ showLineNumbers?: boolean;
1113
+ showInlineErrors?: boolean;
1114
+ showRefreshButton?: boolean;
1115
+ showTabs?: boolean;
1116
+ showConsoleButton?: boolean;
1117
+ showConsole?: boolean;
1118
+ closableTabs?: boolean;
1119
+ wrapContent?: boolean;
1120
+ resizablePanels?: boolean;
1121
+ codeEditor?: SandpackCodeOptions;
1122
+ /**
1123
+ * This disables editing of content by the user in all files.
1124
+ */
1125
+ readOnly?: boolean;
1126
+ /**
1127
+ * Controls the visibility of Read-only label, which will only
1128
+ * appears when `readOnly` is `true`
1129
+ */
1130
+ showReadOnly?: boolean;
1131
+ layout?: "preview" | "tests" | "console";
1132
+ };
1133
+ }
1134
+ interface SandpackProviderProps extends SandpackRootProps, React__default.HTMLAttributes<HTMLDivElement> {
1135
+ options?: SandpackInternalOptions;
1136
+ children?: React__default.ReactNode;
1137
+ }
1138
+ type SandpackClientDispatch = (msg: SandpackMessage, clientId?: string) => void;
1139
+ type SandpackClientListen = (listener: ListenerFunction, clientId?: string) => UnsubscribeFunction;
1140
+ type SandpackContext = SandpackState & {
1141
+ dispatch: SandpackClientDispatch;
1142
+ listen: SandpackClientListen;
1143
+ };
1144
+ interface SandpackState {
1145
+ bundlerState: BundlerState | undefined;
1146
+ /**
1147
+ * List the file path listed in the file tab,
1148
+ * which will allow the user to interact with.
1149
+ */
1150
+ visibleFiles: string[];
1151
+ /**
1152
+ * List the file path listed in the file tab,
1153
+ * Can only be changed through the properties of SandpackProvider (fs/options)
1154
+ *
1155
+ * @internal
1156
+ */
1157
+ visibleFilesFromProps: string[];
1158
+ /**
1159
+ * Path to the file will be open in the code editor
1160
+ * when the component mounts
1161
+ */
1162
+ activeFile: string;
1163
+ startRoute?: string;
1164
+ autoReload: boolean;
1165
+ /**
1166
+ * Returns the current state of the editor, meaning that any
1167
+ * changes from the original `files` must return a `dirty` value;
1168
+ * otherwise, it'll return `pristine`
1169
+ */
1170
+ editorState: EditorState;
1171
+ teamId?: string;
1172
+ exportOptions?: SandpackExportOptions;
1173
+ error: SandpackError | null;
1174
+ /**
1175
+ * The filesystem backing all files rendered inside Sandpack. Use this for
1176
+ * async `readFile`/`writeFile`/`list` access.
1177
+ */
1178
+ fs: SandpackFS;
1179
+ /**
1180
+ * Snapshot of every file path known to {@link fs}, updated whenever the
1181
+ * filesystem mutates.
1182
+ */
1183
+ fileList: string[];
1184
+ /**
1185
+ * Snapshot of the per-file UI metadata (`hidden`, `active`, `readOnly`)
1186
+ * stored in the filesystem sidecar, updated whenever metadata changes.
1187
+ */
1188
+ fileMeta: FileMetaMap;
1189
+ environment?: SandboxEnvironment;
1190
+ status: SandpackStatus;
1191
+ /**
1192
+ * True while the async initialization of the filesystem is in flight.
1193
+ * Consumers should treat `fileList` and `fileMeta` as not yet
1194
+ * available while this is `true`.
1195
+ */
1196
+ isLoading: boolean;
1197
+ initMode: SandpackInitMode;
1198
+ clients: Record<string, InstanceType<typeof SandpackClient>>;
1199
+ runSandpack: () => Promise<void>;
1200
+ registerBundler: (iframe: HTMLIFrameElement, clientId: string, clientPropsOverride?: ClientPropsOverride) => Promise<void>;
1201
+ unregisterBundler: (clientId: string) => void;
1202
+ updateFile: (path: string, code: string, shouldUpdatePreview?: boolean) => Promise<void>;
1203
+ addFile: (path: string, code: string, shouldUpdatePreview?: boolean) => Promise<void>;
1204
+ updateCurrentFile: (newCode: string, shouldUpdatePreview?: boolean) => Promise<void>;
1205
+ openFile: (path: string) => void;
1206
+ closeFile: (path: string) => void;
1207
+ deleteFile: (path: string, shouldUpdatePreview?: boolean) => Promise<void>;
1208
+ setActiveFile: (path: string) => void;
1209
+ resetFile: (path: string) => Promise<void>;
1210
+ resetAllFiles: () => Promise<void>;
1211
+ registerReactDevTools: (value: ReactDevToolsMode) => void;
1212
+ /**
1213
+ * Element refs
1214
+ * Different components inside the SandpackProvider might register certain elements of interest for sandpack
1215
+ * eg: lazy anchor - if no component registers this, then the sandpack runs on mount, without lazy mode
1216
+ */
1217
+ lazyAnchorRef: React__default.RefObject<HTMLDivElement | null>;
1218
+ unsubscribeClientListenersRef: React__default.MutableRefObject<Record<string, Record<string, UnsubscribeFunction>>>;
1219
+ queuedListenersRef: React__default.MutableRefObject<Record<string, Record<string, ListenerFunction>>>;
1220
+ }
1221
+ type SandpackStatus = "initial" | "idle" | "running" | "timeout" | "done";
1222
+ type EditorState = "pristine" | "dirty";
1223
+ /**
1224
+ * Custom properties to be used in the SandpackCodeEditor component,
1225
+ * some of which are exclusive to customize the CodeMirror instance.
1226
+ * @hidden
1227
+ */
1228
+ interface SandpackCodeOptions {
1229
+ /**
1230
+ * CodeMirror extensions for the editor state, which can
1231
+ * provide extra features and functionalities to the editor component.
1232
+ */
1233
+ extensions?: CodeEditorProps["extensions"];
1234
+ /**
1235
+ * Property to register CodeMirror extension keymap.
1236
+ */
1237
+ extensionsKeymap?: CodeEditorProps["extensionsKeymap"];
1238
+ /**
1239
+ * Provides a way to add custom language modes by supplying a language
1240
+ * type, applicable file extensions, and a LanguageSupport instance
1241
+ * for that syntax mode
1242
+ */
1243
+ additionalLanguages?: CodeEditorProps["additionalLanguages"];
1244
+ }
1245
+ type DeepPartial<Type> = {
1246
+ [Property in keyof Type]?: DeepPartial<Type[Property]>;
1247
+ };
1248
+ interface SandpackProviderState {
1249
+ fs: SandpackFS;
1250
+ fileList: string[];
1251
+ fileMeta: FileMetaMap;
1252
+ environment?: SandboxEnvironment;
1253
+ visibleFiles: string[];
1254
+ visibleFilesFromProps: string[];
1255
+ activeFile: string;
1256
+ startRoute?: string;
1257
+ initMode: SandpackInitMode;
1258
+ bundlerState?: BundlerState;
1259
+ error: SandpackError | null;
1260
+ sandpackStatus: SandpackStatus;
1261
+ editorState: EditorState;
1262
+ reactDevTools?: ReactDevToolsMode;
1263
+ }
1264
+
1265
+ type Decorators = Array<{
1266
+ className?: string;
1267
+ line: number;
1268
+ startColumn?: number;
1269
+ endColumn?: number;
1270
+ elementAttributes?: Record<string, string>;
1271
+ }>;
1272
+ interface CodeMirrorProps {
1273
+ code: string;
1274
+ filePath?: string;
1275
+ fileType?: string;
1276
+ onCodeUpdate?: (newCode: string) => void;
1277
+ showLineNumbers?: boolean;
1278
+ showInlineErrors?: boolean;
1279
+ wrapContent?: boolean;
1280
+ editorState?: EditorState;
1281
+ /**
1282
+ * This disables editing of content by the user in all files.
1283
+ */
1284
+ readOnly?: boolean;
1285
+ /**
1286
+ * Controls the visibility of Read-only label, which will only
1287
+ * appears when `readOnly` is `true`
1288
+ */
1289
+ showReadOnly?: boolean;
1290
+ /**
1291
+ * Provides a way to draw or style a piece of the content.
1292
+ */
1293
+ decorators?: Decorators;
1294
+ initMode: SandpackInitMode;
1295
+ extensions?: Extension[];
1296
+ extensionsKeymap?: KeyBinding[];
1297
+ /**
1298
+ * Provides a way to add custom language modes by supplying a language
1299
+ * type, applicable file extensions, and a LanguageSupport instance
1300
+ * for that syntax mode
1301
+ */
1302
+ additionalLanguages?: CustomLanguage[];
1303
+ }
1304
+ interface CodeMirrorRef {
1305
+ getCodemirror: () => EditorView | undefined;
1306
+ }
1307
+ declare const CodeMirror: React$1.ForwardRefExoticComponent<CodeMirrorProps & React$1.RefAttributes<CodeMirrorRef>>;
1308
+
1309
+ type CodeEditorRef = CodeMirrorRef;
1310
+ interface CodeEditorProps {
1311
+ style?: React.CSSProperties;
1312
+ className?: string;
1313
+ showTabs?: boolean;
1314
+ showLineNumbers?: boolean;
1315
+ showInlineErrors?: boolean;
1316
+ showRunButton?: boolean;
1317
+ wrapContent?: boolean;
1318
+ closableTabs?: boolean;
1319
+ /**
1320
+ * This provides a way to control how some components are going to
1321
+ * be initialized on the page. The CodeEditor and the Preview components
1322
+ * are quite expensive and might overload the memory usage, so this gives
1323
+ * a certain control of when to initialize them.
1324
+ */
1325
+ initMode?: SandpackInitMode;
1326
+ /**
1327
+ * CodeMirror extensions for the editor state, which can
1328
+ * provide extra features and functionalities to the editor component.
1329
+ */
1330
+ extensions?: Extension[];
1331
+ /**
1332
+ * Property to register CodeMirror extension keymap.
1333
+ */
1334
+ extensionsKeymap?: KeyBinding[];
1335
+ /**
1336
+ * This disables editing of the editor content by the user.
1337
+ */
1338
+ readOnly?: boolean;
1339
+ /**
1340
+ * Controls the visibility of Read-only label, which will only
1341
+ * appears when `readOnly` is `true`
1342
+ */
1343
+ showReadOnly?: boolean;
1344
+ /**
1345
+ * Provides a way to add custom language modes by supplying a language
1346
+ * type, applicable file extensions, and a LanguageSupport instance
1347
+ * for that syntax mode
1348
+ */
1349
+ additionalLanguages?: CustomLanguage[];
1350
+ }
1351
+
1352
+ declare const SandpackCodeEditor: React$1.ForwardRefExoticComponent<CodeEditorProps & React$1.RefAttributes<CodeMirrorRef>>;
1353
+
1354
+ interface CodeViewerProps {
1355
+ showTabs?: boolean;
1356
+ showLineNumbers?: boolean;
1357
+ /**
1358
+ * Provides a way to draw or style a piece of the content.
1359
+ */
1360
+ decorators?: Decorators;
1361
+ code?: string;
1362
+ wrapContent?: boolean;
1363
+ /**
1364
+ * This provides a way to control how some components are going to
1365
+ * be initialized on the page. The CodeEditor and the Preview components
1366
+ * are quite expensive and might overload the memory usage, so this gives
1367
+ * a certain control of when to initialize them.
1368
+ */
1369
+ initMode?: SandpackInitMode;
1370
+ /**
1371
+ * Provides a way to add custom language modes by supplying a language
1372
+ * type, applicable file extensions, and a LanguageSupport instance
1373
+ * for that syntax mode
1374
+ */
1375
+ additionalLanguages?: CustomLanguage[];
1376
+ }
1377
+ declare const SandpackCodeViewer: React$1.ForwardRefExoticComponent<CodeViewerProps & React$1.RefAttributes<CodeMirrorRef>>;
1378
+
1379
+ interface SandpackFileExplorerProp {
1380
+ /**
1381
+ * enable auto hidden file in file explorer
1382
+ *
1383
+ * @description set with hidden property in files property
1384
+ * @default false
1385
+ */
1386
+ autoHiddenFiles?: boolean;
1387
+ initialCollapsedFolder?: string[];
1388
+ }
1389
+ declare const SandpackFileExplorer: ({ className, autoHiddenFiles, initialCollapsedFolder, ...props }: SandpackFileExplorerProp & React$1.HTMLAttributes<HTMLDivElement>) => React$1.JSX.Element | null;
1390
+
1391
+ declare const tabButton: string;
1392
+
1393
+ interface FileTabsProps {
1394
+ /**
1395
+ * This adds a close button next to each file with a unique trigger to close it.
1396
+ */
1397
+ closableTabs?: boolean;
1398
+ /**
1399
+ * unique id appended with active files. This is
1400
+ * used in aria-controls value along the combination of activeFile
1401
+ */
1402
+ activeFileUniqueId?: string;
1403
+ }
1404
+ /**
1405
+ * FileTabs is a list of all open files, the active file, and its state.
1406
+ */
1407
+ declare const FileTabs: ({ closableTabs, className, activeFileUniqueId, ...props }: FileTabsProps & React$1.HTMLAttributes<HTMLDivElement>) => React$1.JSX.Element;
1408
+
1409
+ interface NavigatorProps {
1410
+ clientId: string;
1411
+ onURLChange?: (newURL: string) => void;
1412
+ startRoute?: string;
1413
+ }
1414
+ declare const Navigator: ({ clientId, onURLChange, className, startRoute, ...props }: NavigatorProps & React$1.HTMLAttributes<HTMLDivElement>) => React$1.JSX.Element;
1415
+
1416
+ interface PreviewProps {
1417
+ style?: React$1.CSSProperties;
1418
+ showNavigator?: boolean;
1419
+ showOpenInCodeSandbox?: boolean;
1420
+ showRefreshButton?: boolean;
1421
+ showRestartButton?: boolean;
1422
+ /**
1423
+ * Whether to show the `<ErrorOverlay>` component on top of
1424
+ * the preview, if a runtime error happens.
1425
+ */
1426
+ showSandpackErrorOverlay?: boolean;
1427
+ showOpenNewtab?: boolean;
1428
+ actionsChildren?: React$1.JSX.Element;
1429
+ children?: React$1.JSX.Element;
1430
+ startRoute?: string;
1431
+ }
1432
+ interface SandpackPreviewRef {
1433
+ /**
1434
+ * Retrieve the current Sandpack client instance from preview
1435
+ */
1436
+ getClient: () => InstanceType<typeof SandpackClient> | null;
1437
+ /**
1438
+ * Returns the client id, which will be used to
1439
+ * initialize a client in the main Sandpack context
1440
+ */
1441
+ clientId: string;
1442
+ }
1443
+ declare const SandpackPreview: React$1.ForwardRefExoticComponent<PreviewProps & React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<SandpackPreviewRef>>;
1444
+
1445
+ declare const SandpackTranspiledCode: ({ className, ...props }: CodeViewerProps & React$1.HTMLAttributes<HTMLDivElement>) => React$1.JSX.Element;
1446
+
1447
+ type TestStatus = "idle" | "running" | "pass" | "fail";
1448
+ interface Test {
1449
+ name: string;
1450
+ blocks: string[];
1451
+ status: TestStatus;
1452
+ path: string;
1453
+ errors: TestError[];
1454
+ duration?: number | undefined;
1455
+ }
1456
+
1457
+ interface Describe {
1458
+ name: string;
1459
+ tests: Record<string, Test>;
1460
+ describes: Record<string, Describe>;
1461
+ }
1462
+
1463
+ type Spec = {
1464
+ error?: TestError;
1465
+ } & Describe;
1466
+
1467
+ declare const SandpackTests: React$1.FC<{
1468
+ verbose?: boolean;
1469
+ watchMode?: boolean;
1470
+ onComplete?: (specs: Record<string, Spec>) => void;
1471
+ actionsChildren?: React$1.JSX.Element;
1472
+ showVerboseButton?: boolean;
1473
+ showWatchButton?: boolean;
1474
+ /**
1475
+ * Hide the tests and supress logs
1476
+ * If `true` the tests will be hidden and the logs will be supressed. This is useful when you want to run tests in the background and don't want to show the tests to the user.
1477
+ * @default false
1478
+ */
1479
+ hideTestsAndSupressLogs?: boolean;
1480
+ } & React$1.HtmlHTMLAttributes<HTMLDivElement>>;
1481
+
1482
+ type SandpackConsoleData = Array<{
1483
+ data: Array<string | Record<string, string>> | undefined;
1484
+ id: string;
1485
+ method: SandpackMessageConsoleMethods;
1486
+ }>;
1487
+
1488
+ interface SandpackConsoleProps {
1489
+ clientId?: string;
1490
+ showHeader?: boolean;
1491
+ showSyntaxError?: boolean;
1492
+ showSetupProgress?: boolean;
1493
+ showRestartButton?: boolean;
1494
+ showResetConsoleButton?: boolean;
1495
+ maxMessageCount?: number;
1496
+ onLogsChange?: (logs: SandpackConsoleData) => void;
1497
+ resetOnPreviewRestart?: boolean;
1498
+ standalone?: boolean;
1499
+ actionsChildren?: React$1.JSX.Element;
1500
+ }
1501
+ interface SandpackConsoleRef {
1502
+ reset: () => void;
1503
+ }
1504
+ /**
1505
+ * `SandpackConsole` is a Sandpack devtool that allows printing
1506
+ * the console logs from a Sandpack client. It is designed to be
1507
+ * a light version of a browser console, which means that it's
1508
+ * limited to a set of common use cases you may encounter when coding.
1509
+ */
1510
+ declare const SandpackConsole: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & SandpackConsoleProps & React$1.RefAttributes<SandpackConsoleRef>>;
1511
+
1512
+ /**
1513
+ * It provides an interface to consume the logs from a sandpack client.
1514
+ *
1515
+ * @category Hooks
1516
+ */
1517
+ declare const useSandpackConsole: ({ clientId, maxMessageCount, showSyntaxError, resetOnPreviewRestart, }: {
1518
+ clientId?: string;
1519
+ maxMessageCount?: number;
1520
+ showSyntaxError?: boolean;
1521
+ resetOnPreviewRestart: boolean;
1522
+ }) => {
1523
+ logs: SandpackConsoleData;
1524
+ reset: () => void;
1525
+ };
1526
+
1527
+ declare const layoutClassName: string;
1528
+
1529
+ interface SandpackLayoutProps extends React$1.HtmlHTMLAttributes<unknown> {
1530
+ children?: React$1.ReactNode;
1531
+ }
1532
+ declare const SandpackLayout: React$1.ForwardRefExoticComponent<SandpackLayoutProps & React$1.RefAttributes<HTMLDivElement>>;
1533
+
1534
+ declare const stackClassName: string;
1535
+
1536
+ declare const SandpackStack: React$1.FC<React$1.HTMLAttributes<HTMLDivElement> & {
1537
+ children?: React$1.ReactNode;
1538
+ }>;
1539
+
1540
+ type ErrorOverlayProps = React$1.HTMLAttributes<HTMLDivElement> & {
1541
+ children?: React$1.ReactNode;
1542
+ };
1543
+ declare const ErrorOverlay: React$1.FC<ErrorOverlayProps>;
1544
+
1545
+ interface LoadingOverlayProps {
1546
+ clientId?: string;
1547
+ /**
1548
+ * It enforces keeping the loading state visible,
1549
+ * which is helpful for external loading states.
1550
+ */
1551
+ loading?: boolean;
1552
+ showOpenInCodeSandbox: boolean;
1553
+ }
1554
+ declare const LoadingOverlay: React$1.FC<LoadingOverlayProps & React$1.HTMLAttributes<HTMLDivElement>>;
1555
+
1556
+ declare const OpenInCodeSandboxButton: () => JSX.Element | null;
1557
+
1558
+ declare const UnstyledOpenInCodeSandboxButton: React$1.FC<React$1.HtmlHTMLAttributes<unknown>>;
1559
+
1560
+ declare const RunButton: React$1.FC<React$1.PropsWithChildren & React$1.ButtonHTMLAttributes<unknown>>;
1561
+
1562
+ declare const RoundedButton: React__default.FC<React__default.PropsWithChildren & React__default.ButtonHTMLAttributes<unknown>>;
1563
+
1564
+ declare const DependenciesProgress: React.FC<{
1565
+ clientId?: string;
1566
+ }>;
1567
+
1568
+ /**
1569
+ * Returns the current contents of the active file together with helpers to
1570
+ * edit it. Content is fetched asynchronously from the backing
1571
+ * {@link import("@immediately-run/sandpack-client").SandpackFS} so
1572
+ * `code` is `undefined` until the first read resolves (reflected via
1573
+ * `isLoading`).
1574
+ *
1575
+ * The editor owns the active file's buffer: `code` is loaded once per file and
1576
+ * re-read only when the file is changed *externally* (i.e. by code running in
1577
+ * the child iframe). The editor's own edits are never read back — that's what
1578
+ * keeps typing free of echo/clobber.
1579
+ *
1580
+ * @category Hooks
1581
+ */
1582
+ declare const useActiveCode: () => {
1583
+ code: string;
1584
+ readOnly: boolean;
1585
+ isLoading: boolean;
1586
+ updateCode: (newCode: string, shouldUpdatePreview?: boolean) => Promise<void>;
1587
+ };
1588
+
1589
+ /**
1590
+ * @category Hooks
1591
+ */
1592
+ declare const useErrorMessage: () => string | null;
1593
+
1594
+ type LoadingOverlayState = "LOADING" | "PRE_FADING" | "FADING" | "HIDDEN" | "TIMEOUT";
1595
+ declare const FADE_ANIMATION_DURATION = 200;
1596
+ /**
1597
+ * @category Hooks
1598
+ */
1599
+ declare const useLoadingOverlayState: (clientId?: string, externalLoading?: boolean) => LoadingOverlayState;
1600
+
1601
+ /**
1602
+ * @category Hooks
1603
+ */
1604
+ interface UseSandpack {
1605
+ sandpack: SandpackState;
1606
+ dispatch: SandpackClientDispatch;
1607
+ listen: SandpackClientListen;
1608
+ }
1609
+ /**
1610
+ * @category Hooks
1611
+ */
1612
+ declare function useSandpack(): UseSandpack;
1613
+
1614
+ /**
1615
+ * @category Hooks
1616
+ */
1617
+ declare const useSandpackNavigation: (clientId?: string) => {
1618
+ refresh: () => void;
1619
+ back: () => void;
1620
+ forward: () => void;
1621
+ };
1622
+
1623
+ /**
1624
+ * @category Hooks
1625
+ */
1626
+ declare const useSandpackTheme: () => {
1627
+ theme: SandpackTheme;
1628
+ themeId: string;
1629
+ themeMode: "dark" | "light" | "auto";
1630
+ };
1631
+
1632
+ /**
1633
+ * @category Hooks
1634
+ */
1635
+ declare const useTranspiledCode: () => string | null;
1636
+
1637
+ interface UseSandpackClient {
1638
+ sandpack: SandpackState;
1639
+ getClient: () => InstanceType<typeof SandpackClient> | null;
1640
+ iframe: React$1.MutableRefObject<HTMLIFrameElement | null>;
1641
+ listen: (listener: ListenerFunction) => UnsubscribeFunction;
1642
+ dispatch: (message: SandpackMessage) => void;
1643
+ clientId: string;
1644
+ }
1645
+ /**
1646
+ * It registers a new sandpack client and returns its instance,
1647
+ * listeners, and dispatch function. Using it when creating a custom
1648
+ * component to interact directly with the client is recommended.
1649
+ * For other cases, use `useSandpack` instead.
1650
+ *
1651
+ * @category Hooks
1652
+ */
1653
+ declare const useSandpackClient: (clientPropsOverride?: ClientPropsOverride) => UseSandpackClient;
1654
+
1655
+ /**
1656
+ * @category Hooks
1657
+ */
1658
+ declare const useSandpackShell: (clientId?: string) => {
1659
+ restart: () => void;
1660
+ openPreview: () => void;
1661
+ };
1662
+
1663
+ declare const useSandpackPreviewProgress: (props: {
1664
+ timeout?: number;
1665
+ clientId?: string;
1666
+ } | undefined) => string | null;
1667
+
1668
+ declare const useSandpackShellStdout: ({ clientId, maxMessageCount, resetOnPreviewRestart: _resetOnPreviewRestart, }: {
1669
+ clientId?: string;
1670
+ maxMessageCount?: number;
1671
+ resetOnPreviewRestart?: boolean;
1672
+ }) => {
1673
+ logs: Array<{
1674
+ id: string;
1675
+ data: string;
1676
+ }>;
1677
+ reset: () => void;
1678
+ };
1679
+
1680
+ declare const useClassNames: () => (customClassName: string, allClassNames?: any[]) => string;
1681
+
1682
+ /**
1683
+ * Returns the full Sandpack stylesheet as a string.
1684
+ *
1685
+ * Useful for SSR scenarios where you want to inline the CSS into the HTML
1686
+ * `<style>` tag instead of relying on a separate stylesheet request. The text
1687
+ * is generated at build time from every vanilla-extract `*.css.ts` file shipped
1688
+ * with `@immediately-run/sandpack-react`.
1689
+ *
1690
+ * @category Theme
1691
+ *
1692
+ * Tip: in environments that allow it, prefer importing the stylesheet directly
1693
+ * (`import "@immediately-run/sandpack-react/styles.css"`); it lets the browser
1694
+ * cache the CSS independently from the HTML payload.
1695
+ */
1696
+ declare const getSandpackCssText: () => string;
1697
+
1698
+ declare const SandpackThemeContext: React$1.Context<{
1699
+ theme: SandpackTheme;
1700
+ id: string;
1701
+ mode: "dark" | "light" | "auto";
1702
+ }>;
1703
+ /**
1704
+ * @category Theme
1705
+ */
1706
+ declare const SandpackThemeProvider: React$1.FC<React$1.HTMLAttributes<HTMLDivElement> & {
1707
+ theme?: SandpackThemeProp;
1708
+ children?: React$1.ReactNode;
1709
+ }>;
1710
+ declare const SandpackThemeConsumer: React$1.Consumer<{
1711
+ theme: SandpackTheme;
1712
+ id: string;
1713
+ mode: "dark" | "light" | "auto";
1714
+ }>;
1715
+
1716
+ declare const Sandpack$1: React$1.Context<SandpackContext | null>;
1717
+
1718
+ declare const SandpackProvider: React$1.FC<SandpackProviderProps>;
1719
+ /**
1720
+ * @category Provider
1721
+ */
1722
+ declare const SandpackConsumer: React$1.Consumer<SandpackContext | null>;
1723
+
1724
+ declare const Sandpack: SandpackInternal;
1725
+
1726
+ /**
1727
+ * @category Theme
1728
+ */
1729
+ declare const defaultLight: SandpackTheme;
1730
+ /**
1731
+ * @category Theme
1732
+ */
1733
+ declare const defaultDark: SandpackTheme;
1734
+ /**
1735
+ * @category Theme
1736
+ */
1737
+ declare const SANDPACK_THEMES: Record<SandpackPredefinedTheme, SandpackTheme>;
1738
+
1739
+ interface SandboxTemplate {
1740
+ files: SandpackFilesInput;
1741
+ dependencies: Record<string, string>;
1742
+ devDependencies?: Record<string, string>;
1743
+ entry?: string;
1744
+ main: string;
1745
+ environment: SandboxEnvironment;
1746
+ mode?: string;
1747
+ }
1748
+ interface CreateSandpackFSOptions {
1749
+ template?: SandpackPredefinedTemplate;
1750
+ customSetup?: SandpackSetup;
1751
+ files?: SandpackFiles;
1752
+ }
1753
+ /**
1754
+ * Resolve a file path against a file map, trying various JS extensions.
1755
+ * Returns the normalized path if found, or null.
1756
+ */
1757
+ declare const resolveFile: (path: string, files: Record<string, unknown>) => string | null;
1758
+ declare const createSandpackFromFS: (fsContext: BoundContext, remotePortFactory: (onRemoteChange: (path: string) => void) => Promise<MessagePort>, onWrite?: (path: string) => void) => Promise<SandpackFS>;
1759
+ /**
1760
+ * Build a fully-initialized {@link SandpackFS} from the JS-object convenience
1761
+ * inputs (template, customSetup, files). Consumers call this once and pass the
1762
+ * result as the `fs` prop to `SandpackProvider`.
1763
+ *
1764
+ * `remotePortFactory` is supplied by the host app (it owns the port handoff to
1765
+ * the preview iframe, e.g. site-main's `exportZenFS`), mirroring
1766
+ * {@link createSandpackFromFS}.
1767
+ */
1768
+ declare const createSandpackFS: (options: CreateSandpackFSOptions | undefined, remotePortFactory: (onRemoteChange: (path: string) => void) => Promise<MessagePort>) => Promise<SandpackFS>;
1769
+
1770
+ export { ANGULAR_TEMPLATE, ASTRO_TEMPLATE, BackwardIcon, CleanIcon, CloseIcon, CodeMirror as CodeEditor, ConsoleIcon, DependenciesProgress, DirectoryIconClosed, DirectoryIconOpen, ErrorOverlay, ExportIcon, FADE_ANIMATION_DURATION, FileIcon, FileTabs, ForwardIcon, LoadingOverlay, Navigator, OpenInCodeSandboxButton, REACT_TEMPLATE, REACT_TYPESCRIPT_TEMPLATE, RefreshIcon, RestartIcon, RoundedButton, RunButton, RunIcon, SANDBOX_TEMPLATES, SANDPACK_THEMES, SOLID_TEMPLATE, SVELTE_TEMPLATE, Sandpack, SandpackCodeEditor, SandpackCodeViewer, SandpackConsole, SandpackConsumer, SandpackFileExplorer, SandpackLayout, SandpackPreview, SandpackProvider, Sandpack$1 as SandpackReactContext, SandpackStack, SandpackTests, SandpackThemeConsumer, SandpackThemeContext, SandpackThemeProvider, SandpackTranspiledCode, SignInIcon, SignOutIcon, TEST_TYPESCRIPT_TEMPLATE, UnstyledOpenInCodeSandboxButton, VANILLA_TEMPLATE, VANILLA_TYPESCRIPT_TEMPLATE, VUE_TEMPLATE, createSandpackFS, createSandpackFromFS, defaultDark, defaultLight, getSandpackCssText, layoutClassName, resolveFile, stackClassName, tabButton, useActiveCode, useClassNames, useErrorMessage, useLoadingOverlayState, useSandpack, useSandpackClient, useSandpackConsole, useSandpackNavigation, useSandpackPreviewProgress, useSandpackShell, useSandpackShellStdout, useSandpackTheme, useTranspiledCode };
1771
+ export type { CodeEditorProps, CodeEditorRef, CodeViewerProps, CreateSandpackFSOptions, CustomLanguage, DeepPartial, EditorState, ErrorOverlayProps, FileTabsProps, LoadingOverlayProps, LoadingOverlayState, NavigatorProps, PreviewProps, SandboxEnvironment, SandboxTemplate, SandpackClientDispatch, SandpackClientListen, SandpackCodeOptions, SandpackContext, SandpackExportOptions, SandpackFile, SandpackFileExplorerProp, SandpackFiles, SandpackInitMode, SandpackInternal, SandpackInternalOptions, SandpackInternalProvider, SandpackLayoutProps, SandpackOptions, SandpackPredefinedTemplate, SandpackPredefinedTheme, SandpackPreviewRef, SandpackProps, SandpackProviderProps, SandpackProviderState, SandpackSetup, SandpackState, SandpackStatus, SandpackTheme, SandpackThemeProp, UseSandpack };