@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.
- package/README.md +60 -0
- package/dist/.ir-build-stamp.json +6 -0
- package/dist/index.d.ts +1771 -0
- package/dist/index.js +5544 -0
- package/dist/index.mjs +5440 -0
- package/dist/src/components/CodeEditor/CodeMirror.d.ts +50 -0
- package/dist/src/components/CodeEditor/CodeMirror.d.ts.map +1 -0
- package/dist/src/components/CodeEditor/highlightDecorators.d.ts +4 -0
- package/dist/src/components/CodeEditor/highlightDecorators.d.ts.map +1 -0
- package/dist/src/components/CodeEditor/highlightInlineError.d.ts +3 -0
- package/dist/src/components/CodeEditor/highlightInlineError.d.ts.map +1 -0
- package/dist/src/components/CodeEditor/index.d.ts +50 -0
- package/dist/src/components/CodeEditor/index.d.ts.map +1 -0
- package/dist/src/components/CodeEditor/languages-mocks.d.ts +9 -0
- package/dist/src/components/CodeEditor/languages-mocks.d.ts.map +1 -0
- package/dist/src/components/CodeEditor/styles.css.d.ts +6 -0
- package/dist/src/components/CodeEditor/styles.css.d.ts.map +1 -0
- package/dist/src/components/CodeEditor/useSyntaxHighlight.d.ts +7 -0
- package/dist/src/components/CodeEditor/useSyntaxHighlight.d.ts.map +1 -0
- package/dist/src/components/CodeEditor/utils.d.ts +16 -0
- package/dist/src/components/CodeEditor/utils.d.ts.map +1 -0
- package/dist/src/components/CodeViewer/index.d.ts +28 -0
- package/dist/src/components/CodeViewer/index.d.ts.map +1 -0
- package/dist/src/components/Console/ConsoleList.css.d.ts +29 -0
- package/dist/src/components/Console/ConsoleList.css.d.ts.map +1 -0
- package/dist/src/components/Console/ConsoleList.d.ts +6 -0
- package/dist/src/components/Console/ConsoleList.d.ts.map +1 -0
- package/dist/src/components/Console/Header.css.d.ts +5 -0
- package/dist/src/components/Console/Header.css.d.ts.map +1 -0
- package/dist/src/components/Console/Header.d.ts +7 -0
- package/dist/src/components/Console/Header.d.ts.map +1 -0
- package/dist/src/components/Console/SandpackConsole.css.d.ts +4 -0
- package/dist/src/components/Console/SandpackConsole.css.d.ts.map +1 -0
- package/dist/src/components/Console/SandpackConsole.d.ts +27 -0
- package/dist/src/components/Console/SandpackConsole.d.ts.map +1 -0
- package/dist/src/components/Console/StdoutList.css.d.ts +2 -0
- package/dist/src/components/Console/StdoutList.css.d.ts.map +1 -0
- package/dist/src/components/Console/StdoutList.d.ts +8 -0
- package/dist/src/components/Console/StdoutList.d.ts.map +1 -0
- package/dist/src/components/Console/index.d.ts +3 -0
- package/dist/src/components/Console/index.d.ts.map +1 -0
- package/dist/src/components/Console/useSandpackConsole.d.ts +16 -0
- package/dist/src/components/Console/useSandpackConsole.d.ts.map +1 -0
- package/dist/src/components/Console/utils/constraints.d.ts +14 -0
- package/dist/src/components/Console/utils/constraints.d.ts.map +1 -0
- package/dist/src/components/Console/utils/fromConsoleToString.d.ts +13 -0
- package/dist/src/components/Console/utils/fromConsoleToString.d.ts.map +1 -0
- package/dist/src/components/Console/utils/getType.d.ts +8 -0
- package/dist/src/components/Console/utils/getType.d.ts.map +1 -0
- package/dist/src/components/Console/utils/transformers.d.ts +5 -0
- package/dist/src/components/Console/utils/transformers.d.ts.map +1 -0
- package/dist/src/components/FileExplorer/File.css.d.ts +2 -0
- package/dist/src/components/FileExplorer/File.css.d.ts.map +1 -0
- package/dist/src/components/FileExplorer/File.d.ts +11 -0
- package/dist/src/components/FileExplorer/File.d.ts.map +1 -0
- package/dist/src/components/FileExplorer/FileExplorer.css.d.ts +2 -0
- package/dist/src/components/FileExplorer/FileExplorer.css.d.ts.map +1 -0
- package/dist/src/components/FileExplorer/ModuleList.d.ts +25 -0
- package/dist/src/components/FileExplorer/ModuleList.d.ts.map +1 -0
- package/dist/src/components/FileExplorer/index.d.ts +13 -0
- package/dist/src/components/FileExplorer/index.d.ts.map +1 -0
- package/dist/src/components/FileExplorer/utils.d.ts +17 -0
- package/dist/src/components/FileExplorer/utils.d.ts.map +1 -0
- package/dist/src/components/FileTabs/FileTabs.css.d.ts +6 -0
- package/dist/src/components/FileTabs/FileTabs.css.d.ts.map +1 -0
- package/dist/src/components/FileTabs/index.d.ts +19 -0
- package/dist/src/components/FileTabs/index.d.ts.map +1 -0
- package/dist/src/components/Navigator/Navigator.css.d.ts +4 -0
- package/dist/src/components/Navigator/Navigator.css.d.ts.map +1 -0
- package/dist/src/components/Navigator/index.d.ts +8 -0
- package/dist/src/components/Navigator/index.d.ts.map +1 -0
- package/dist/src/components/Navigator/utils.d.ts +2 -0
- package/dist/src/components/Navigator/utils.d.ts.map +1 -0
- package/dist/src/components/Preview/Preview.css.d.ts +4 -0
- package/dist/src/components/Preview/Preview.css.d.ts.map +1 -0
- package/dist/src/components/Preview/index.d.ts +31 -0
- package/dist/src/components/Preview/index.d.ts.map +1 -0
- package/dist/src/components/ReactDevTools/ReactDevTools.css.d.ts +2 -0
- package/dist/src/components/ReactDevTools/ReactDevTools.css.d.ts.map +1 -0
- package/dist/src/components/ReactDevTools/index.d.ts +8 -0
- package/dist/src/components/ReactDevTools/index.d.ts.map +1 -0
- package/dist/src/components/Tests/Describes.css.d.ts +3 -0
- package/dist/src/components/Tests/Describes.css.d.ts.map +1 -0
- package/dist/src/components/Tests/Describes.d.ts +11 -0
- package/dist/src/components/Tests/Describes.d.ts.map +1 -0
- package/dist/src/components/Tests/FormattedError.css.d.ts +2 -0
- package/dist/src/components/Tests/FormattedError.css.d.ts.map +1 -0
- package/dist/src/components/Tests/FormattedError.d.ts +9 -0
- package/dist/src/components/Tests/FormattedError.d.ts.map +1 -0
- package/dist/src/components/Tests/Header.css.d.ts +5 -0
- package/dist/src/components/Tests/Header.css.d.ts.map +1 -0
- package/dist/src/components/Tests/Header.d.ts +18 -0
- package/dist/src/components/Tests/Header.d.ts.map +1 -0
- package/dist/src/components/Tests/RunButton.d.ts +5 -0
- package/dist/src/components/Tests/RunButton.d.ts.map +1 -0
- package/dist/src/components/Tests/SandpackTests.css.d.ts +4 -0
- package/dist/src/components/Tests/SandpackTests.css.d.ts.map +1 -0
- package/dist/src/components/Tests/SandpackTests.d.ts +18 -0
- package/dist/src/components/Tests/SandpackTests.d.ts.map +1 -0
- package/dist/src/components/Tests/Specs.css.d.ts +9 -0
- package/dist/src/components/Tests/Specs.css.d.ts.map +1 -0
- package/dist/src/components/Tests/Specs.d.ts +17 -0
- package/dist/src/components/Tests/Specs.d.ts.map +1 -0
- package/dist/src/components/Tests/Summary.css.d.ts +4 -0
- package/dist/src/components/Tests/Summary.css.d.ts.map +1 -0
- package/dist/src/components/Tests/Summary.d.ts +20 -0
- package/dist/src/components/Tests/Summary.d.ts.map +1 -0
- package/dist/src/components/Tests/Tests.css.d.ts +6 -0
- package/dist/src/components/Tests/Tests.css.d.ts.map +1 -0
- package/dist/src/components/Tests/Tests.d.ts +17 -0
- package/dist/src/components/Tests/Tests.d.ts.map +1 -0
- package/dist/src/components/Tests/index.d.ts +2 -0
- package/dist/src/components/Tests/index.d.ts.map +1 -0
- package/dist/src/components/Tests/style.css.d.ts +8 -0
- package/dist/src/components/Tests/style.css.d.ts.map +1 -0
- package/dist/src/components/Tests/style.d.ts +3 -0
- package/dist/src/components/Tests/style.d.ts.map +1 -0
- package/dist/src/components/Tests/utils.d.ts +14 -0
- package/dist/src/components/Tests/utils.d.ts.map +1 -0
- package/dist/src/components/TranspiledCode/TranspiledCode.css.d.ts +2 -0
- package/dist/src/components/TranspiledCode/TranspiledCode.css.d.ts.map +1 -0
- package/dist/src/components/TranspiledCode/index.d.ts +4 -0
- package/dist/src/components/TranspiledCode/index.d.ts.map +1 -0
- package/dist/src/components/common/DependenciesProgress.css.d.ts +2 -0
- package/dist/src/components/common/DependenciesProgress.css.d.ts.map +1 -0
- package/dist/src/components/common/DependenciesProgress.d.ts +4 -0
- package/dist/src/components/common/DependenciesProgress.d.ts.map +1 -0
- package/dist/src/components/common/ErrorOverlay.d.ts +6 -0
- package/dist/src/components/common/ErrorOverlay.d.ts.map +1 -0
- package/dist/src/components/common/Layout.css.d.ts +2 -0
- package/dist/src/components/common/Layout.css.d.ts.map +1 -0
- package/dist/src/components/common/Layout.d.ts +8 -0
- package/dist/src/components/common/Layout.d.ts.map +1 -0
- package/dist/src/components/common/Loading.css.d.ts +4 -0
- package/dist/src/components/common/Loading.css.d.ts.map +1 -0
- package/dist/src/components/common/Loading.d.ts +5 -0
- package/dist/src/components/common/Loading.d.ts.map +1 -0
- package/dist/src/components/common/LoadingOverlay.css.d.ts +5 -0
- package/dist/src/components/common/LoadingOverlay.css.d.ts.map +1 -0
- package/dist/src/components/common/LoadingOverlay.d.ts +12 -0
- package/dist/src/components/common/LoadingOverlay.d.ts.map +1 -0
- package/dist/src/components/common/OpenInCodeSandboxButton/OpenInCodeSandboxButton.d.ts +3 -0
- package/dist/src/components/common/OpenInCodeSandboxButton/OpenInCodeSandboxButton.d.ts.map +1 -0
- package/dist/src/components/common/OpenInCodeSandboxButton/UnstyledOpenInCodeSandboxButton.d.ts +7 -0
- package/dist/src/components/common/OpenInCodeSandboxButton/UnstyledOpenInCodeSandboxButton.d.ts.map +1 -0
- package/dist/src/components/common/OpenInCodeSandboxButton/index.d.ts +3 -0
- package/dist/src/components/common/OpenInCodeSandboxButton/index.d.ts.map +1 -0
- package/dist/src/components/common/RoundedButton.d.ts +3 -0
- package/dist/src/components/common/RoundedButton.d.ts.map +1 -0
- package/dist/src/components/common/RunButton.css.d.ts +2 -0
- package/dist/src/components/common/RunButton.css.d.ts.map +1 -0
- package/dist/src/components/common/RunButton.d.ts +3 -0
- package/dist/src/components/common/RunButton.d.ts.map +1 -0
- package/dist/src/components/common/Stack.css.d.ts +2 -0
- package/dist/src/components/common/Stack.css.d.ts.map +1 -0
- package/dist/src/components/common/Stack.d.ts +7 -0
- package/dist/src/components/common/Stack.d.ts.map +1 -0
- package/dist/src/components/common/index.d.ts +9 -0
- package/dist/src/components/common/index.d.ts.map +1 -0
- package/dist/src/components/icons/index.d.ts +16 -0
- package/dist/src/components/icons/index.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +10 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/contexts/sandpackContext.d.ts +11 -0
- package/dist/src/contexts/sandpackContext.d.ts.map +1 -0
- package/dist/src/contexts/utils/testHelpers.d.ts +9 -0
- package/dist/src/contexts/utils/testHelpers.d.ts.map +1 -0
- package/dist/src/contexts/utils/useAppState.d.ts +15 -0
- package/dist/src/contexts/utils/useAppState.d.ts.map +1 -0
- package/dist/src/contexts/utils/useClient.d.ts +32 -0
- package/dist/src/contexts/utils/useClient.d.ts.map +1 -0
- package/dist/src/contexts/utils/useFiles.d.ts +41 -0
- package/dist/src/contexts/utils/useFiles.d.ts.map +1 -0
- package/dist/src/hooks/index.d.ts +12 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/useActiveCode.d.ts +21 -0
- package/dist/src/hooks/useActiveCode.d.ts.map +1 -0
- package/dist/src/hooks/useErrorMessage.d.ts +5 -0
- package/dist/src/hooks/useErrorMessage.d.ts.map +1 -0
- package/dist/src/hooks/useLoadingOverlayState.d.ts +7 -0
- package/dist/src/hooks/useLoadingOverlayState.d.ts.map +1 -0
- package/dist/src/hooks/useSandpack.d.ts +14 -0
- package/dist/src/hooks/useSandpack.d.ts.map +1 -0
- package/dist/src/hooks/useSandpackClient.d.ts +23 -0
- package/dist/src/hooks/useSandpackClient.d.ts.map +1 -0
- package/dist/src/hooks/useSandpackNavigation.d.ts +9 -0
- package/dist/src/hooks/useSandpackNavigation.d.ts.map +1 -0
- package/dist/src/hooks/useSandpackPreviewProgress.d.ts +5 -0
- package/dist/src/hooks/useSandpackPreviewProgress.d.ts.map +1 -0
- package/dist/src/hooks/useSandpackShell.d.ts +8 -0
- package/dist/src/hooks/useSandpackShell.d.ts.map +1 -0
- package/dist/src/hooks/useSandpackShellStdout.d.ts +12 -0
- package/dist/src/hooks/useSandpackShellStdout.d.ts.map +1 -0
- package/dist/src/hooks/useSandpackTheme.d.ts +10 -0
- package/dist/src/hooks/useSandpackTheme.d.ts.map +1 -0
- package/dist/src/hooks/useTranspiledCode.d.ts +5 -0
- package/dist/src/hooks/useTranspiledCode.d.ts.map +1 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/presets/Sandpack.css.d.ts +20 -0
- package/dist/src/presets/Sandpack.css.d.ts.map +1 -0
- package/dist/src/presets/Sandpack.d.ts +3 -0
- package/dist/src/presets/Sandpack.d.ts.map +1 -0
- package/dist/src/presets/index.d.ts +2 -0
- package/dist/src/presets/index.d.ts.map +1 -0
- package/dist/src/setup.jest.d.ts +2 -0
- package/dist/src/setup.jest.d.ts.map +1 -0
- package/dist/src/styles/__generated__/cssText.d.ts +7 -0
- package/dist/src/styles/__generated__/cssText.d.ts.map +1 -0
- package/dist/src/styles/constants.d.ts +10 -0
- package/dist/src/styles/constants.d.ts.map +1 -0
- package/dist/src/styles/getSandpackCssText.d.ts +16 -0
- package/dist/src/styles/getSandpackCssText.d.ts.map +1 -0
- package/dist/src/styles/index.d.ts +65 -0
- package/dist/src/styles/index.d.ts.map +1 -0
- package/dist/src/styles/shared.css.d.ts +22 -0
- package/dist/src/styles/shared.css.d.ts.map +1 -0
- package/dist/src/styles/themeContext.css.d.ts +17 -0
- package/dist/src/styles/themeContext.css.d.ts.map +1 -0
- package/dist/src/styles/themeContext.d.ts +21 -0
- package/dist/src/styles/themeContext.d.ts.map +1 -0
- package/dist/src/styles/vars.css.d.ts +98 -0
- package/dist/src/styles/vars.css.d.ts.map +1 -0
- package/dist/src/templates/common.d.ts +6 -0
- package/dist/src/templates/common.d.ts.map +1 -0
- package/dist/src/templates/index.d.ts +549 -0
- package/dist/src/templates/index.d.ts.map +1 -0
- package/dist/src/templates/node/astro.d.ts +22 -0
- package/dist/src/templates/node/astro.d.ts.map +1 -0
- package/dist/src/templates/node/nexjs.d.ts +22 -0
- package/dist/src/templates/node/nexjs.d.ts.map +1 -0
- package/dist/src/templates/node/node.d.ts +13 -0
- package/dist/src/templates/node/node.d.ts.map +1 -0
- package/dist/src/templates/node/vite-preact-ts.d.ts +34 -0
- package/dist/src/templates/node/vite-preact-ts.d.ts.map +1 -0
- package/dist/src/templates/node/vite-preact.d.ts +25 -0
- package/dist/src/templates/node/vite-preact.d.ts.map +1 -0
- package/dist/src/templates/node/vite-react-ts.d.ts +34 -0
- package/dist/src/templates/node/vite-react-ts.d.ts.map +1 -0
- package/dist/src/templates/node/vite-react.d.ts +25 -0
- package/dist/src/templates/node/vite-react.d.ts.map +1 -0
- package/dist/src/templates/node/vite-svelte-ts.d.ts +37 -0
- package/dist/src/templates/node/vite-svelte-ts.d.ts.map +1 -0
- package/dist/src/templates/node/vite-svelte.d.ts +25 -0
- package/dist/src/templates/node/vite-svelte.d.ts.map +1 -0
- package/dist/src/templates/node/vite-vue-ts.d.ts +34 -0
- package/dist/src/templates/node/vite-vue-ts.d.ts.map +1 -0
- package/dist/src/templates/node/vite-vue.d.ts +25 -0
- package/dist/src/templates/node/vite-vue.d.ts.map +1 -0
- package/dist/src/templates/node/vite.d.ts +19 -0
- package/dist/src/templates/node/vite.d.ts.map +1 -0
- package/dist/src/templates/runtime/angular.d.ts +31 -0
- package/dist/src/templates/runtime/angular.d.ts.map +1 -0
- package/dist/src/templates/runtime/react-typescript.d.ts +25 -0
- package/dist/src/templates/runtime/react-typescript.d.ts.map +1 -0
- package/dist/src/templates/runtime/react.d.ts +22 -0
- package/dist/src/templates/runtime/react.d.ts.map +1 -0
- package/dist/src/templates/runtime/solid.d.ts +22 -0
- package/dist/src/templates/runtime/solid.d.ts.map +1 -0
- package/dist/src/templates/runtime/svelte.d.ts +22 -0
- package/dist/src/templates/runtime/svelte.d.ts.map +1 -0
- package/dist/src/templates/runtime/tests-ts.d.ts +20 -0
- package/dist/src/templates/runtime/tests-ts.d.ts.map +1 -0
- package/dist/src/templates/runtime/vanilla-typescript.d.ts +22 -0
- package/dist/src/templates/runtime/vanilla-typescript.d.ts.map +1 -0
- package/dist/src/templates/runtime/vanilla.d.ts +19 -0
- package/dist/src/templates/runtime/vanilla.d.ts.map +1 -0
- package/dist/src/templates/runtime/vue-ts.d.ts +26 -0
- package/dist/src/templates/runtime/vue-ts.d.ts.map +1 -0
- package/dist/src/templates/runtime/vue.d.ts +22 -0
- package/dist/src/templates/runtime/vue.d.ts.map +1 -0
- package/dist/src/templates/static.d.ts +16 -0
- package/dist/src/templates/static.d.ts.map +1 -0
- package/dist/src/themes/index.d.ts +14 -0
- package/dist/src/themes/index.d.ts.map +1 -0
- package/dist/src/types.d.ts +477 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/utils/ansi-to-react.d.ts +13 -0
- package/dist/src/utils/ansi-to-react.d.ts.map +1 -0
- package/dist/src/utils/array.d.ts +2 -0
- package/dist/src/utils/array.d.ts.map +1 -0
- package/dist/src/utils/classNames.d.ts +6 -0
- package/dist/src/utils/classNames.d.ts.map +1 -0
- package/dist/src/utils/createSandpackFS.d.ts +35 -0
- package/dist/src/utils/createSandpackFS.d.ts.map +1 -0
- package/dist/src/utils/storyHelpers.d.ts +9 -0
- package/dist/src/utils/storyHelpers.d.ts.map +1 -0
- package/dist/src/utils/stringUtils.d.ts +10 -0
- package/dist/src/utils/stringUtils.d.ts.map +1 -0
- package/dist/src/utils/useAsyncSandpackId.d.ts +9 -0
- package/dist/src/utils/useAsyncSandpackId.d.ts.map +1 -0
- package/dist/styles.css +890 -0
- package/dist/unstyled/index.js +5942 -0
- package/dist/unstyled/index.mjs +5838 -0
- package/dist/unstyled/src/components/CodeEditor/CodeMirror.d.ts +50 -0
- package/dist/unstyled/src/components/CodeEditor/CodeMirror.d.ts.map +1 -0
- package/dist/unstyled/src/components/CodeEditor/highlightDecorators.d.ts +4 -0
- package/dist/unstyled/src/components/CodeEditor/highlightDecorators.d.ts.map +1 -0
- package/dist/unstyled/src/components/CodeEditor/highlightInlineError.d.ts +3 -0
- package/dist/unstyled/src/components/CodeEditor/highlightInlineError.d.ts.map +1 -0
- package/dist/unstyled/src/components/CodeEditor/index.d.ts +50 -0
- package/dist/unstyled/src/components/CodeEditor/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/CodeEditor/languages-mocks.d.ts +9 -0
- package/dist/unstyled/src/components/CodeEditor/languages-mocks.d.ts.map +1 -0
- package/dist/unstyled/src/components/CodeEditor/styles.css.d.ts +6 -0
- package/dist/unstyled/src/components/CodeEditor/styles.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/CodeEditor/useSyntaxHighlight.d.ts +7 -0
- package/dist/unstyled/src/components/CodeEditor/useSyntaxHighlight.d.ts.map +1 -0
- package/dist/unstyled/src/components/CodeEditor/utils.d.ts +16 -0
- package/dist/unstyled/src/components/CodeEditor/utils.d.ts.map +1 -0
- package/dist/unstyled/src/components/CodeViewer/index.d.ts +28 -0
- package/dist/unstyled/src/components/CodeViewer/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/ConsoleList.css.d.ts +29 -0
- package/dist/unstyled/src/components/Console/ConsoleList.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/ConsoleList.d.ts +6 -0
- package/dist/unstyled/src/components/Console/ConsoleList.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/Header.css.d.ts +5 -0
- package/dist/unstyled/src/components/Console/Header.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/Header.d.ts +7 -0
- package/dist/unstyled/src/components/Console/Header.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/SandpackConsole.css.d.ts +4 -0
- package/dist/unstyled/src/components/Console/SandpackConsole.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/SandpackConsole.d.ts +27 -0
- package/dist/unstyled/src/components/Console/SandpackConsole.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/StdoutList.css.d.ts +2 -0
- package/dist/unstyled/src/components/Console/StdoutList.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/StdoutList.d.ts +8 -0
- package/dist/unstyled/src/components/Console/StdoutList.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/index.d.ts +3 -0
- package/dist/unstyled/src/components/Console/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/useSandpackConsole.d.ts +16 -0
- package/dist/unstyled/src/components/Console/useSandpackConsole.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/utils/constraints.d.ts +14 -0
- package/dist/unstyled/src/components/Console/utils/constraints.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/utils/fromConsoleToString.d.ts +13 -0
- package/dist/unstyled/src/components/Console/utils/fromConsoleToString.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/utils/getType.d.ts +8 -0
- package/dist/unstyled/src/components/Console/utils/getType.d.ts.map +1 -0
- package/dist/unstyled/src/components/Console/utils/transformers.d.ts +5 -0
- package/dist/unstyled/src/components/Console/utils/transformers.d.ts.map +1 -0
- package/dist/unstyled/src/components/FileExplorer/File.css.d.ts +2 -0
- package/dist/unstyled/src/components/FileExplorer/File.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/FileExplorer/File.d.ts +11 -0
- package/dist/unstyled/src/components/FileExplorer/File.d.ts.map +1 -0
- package/dist/unstyled/src/components/FileExplorer/FileExplorer.css.d.ts +2 -0
- package/dist/unstyled/src/components/FileExplorer/FileExplorer.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/FileExplorer/ModuleList.d.ts +25 -0
- package/dist/unstyled/src/components/FileExplorer/ModuleList.d.ts.map +1 -0
- package/dist/unstyled/src/components/FileExplorer/index.d.ts +13 -0
- package/dist/unstyled/src/components/FileExplorer/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/FileExplorer/utils.d.ts +17 -0
- package/dist/unstyled/src/components/FileExplorer/utils.d.ts.map +1 -0
- package/dist/unstyled/src/components/FileTabs/FileTabs.css.d.ts +6 -0
- package/dist/unstyled/src/components/FileTabs/FileTabs.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/FileTabs/index.d.ts +19 -0
- package/dist/unstyled/src/components/FileTabs/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/Navigator/Navigator.css.d.ts +4 -0
- package/dist/unstyled/src/components/Navigator/Navigator.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Navigator/index.d.ts +8 -0
- package/dist/unstyled/src/components/Navigator/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/Navigator/utils.d.ts +2 -0
- package/dist/unstyled/src/components/Navigator/utils.d.ts.map +1 -0
- package/dist/unstyled/src/components/Preview/Preview.css.d.ts +4 -0
- package/dist/unstyled/src/components/Preview/Preview.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Preview/index.d.ts +31 -0
- package/dist/unstyled/src/components/Preview/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/ReactDevTools/ReactDevTools.css.d.ts +2 -0
- package/dist/unstyled/src/components/ReactDevTools/ReactDevTools.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/ReactDevTools/index.d.ts +8 -0
- package/dist/unstyled/src/components/ReactDevTools/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/Describes.css.d.ts +3 -0
- package/dist/unstyled/src/components/Tests/Describes.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/Describes.d.ts +11 -0
- package/dist/unstyled/src/components/Tests/Describes.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/FormattedError.css.d.ts +2 -0
- package/dist/unstyled/src/components/Tests/FormattedError.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/FormattedError.d.ts +9 -0
- package/dist/unstyled/src/components/Tests/FormattedError.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/Header.css.d.ts +5 -0
- package/dist/unstyled/src/components/Tests/Header.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/Header.d.ts +18 -0
- package/dist/unstyled/src/components/Tests/Header.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/RunButton.d.ts +5 -0
- package/dist/unstyled/src/components/Tests/RunButton.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/SandpackTests.css.d.ts +4 -0
- package/dist/unstyled/src/components/Tests/SandpackTests.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/SandpackTests.d.ts +18 -0
- package/dist/unstyled/src/components/Tests/SandpackTests.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/Specs.css.d.ts +9 -0
- package/dist/unstyled/src/components/Tests/Specs.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/Specs.d.ts +17 -0
- package/dist/unstyled/src/components/Tests/Specs.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/Summary.css.d.ts +4 -0
- package/dist/unstyled/src/components/Tests/Summary.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/Summary.d.ts +20 -0
- package/dist/unstyled/src/components/Tests/Summary.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/Tests.css.d.ts +6 -0
- package/dist/unstyled/src/components/Tests/Tests.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/Tests.d.ts +17 -0
- package/dist/unstyled/src/components/Tests/Tests.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/index.d.ts +2 -0
- package/dist/unstyled/src/components/Tests/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/style.css.d.ts +8 -0
- package/dist/unstyled/src/components/Tests/style.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/style.d.ts +3 -0
- package/dist/unstyled/src/components/Tests/style.d.ts.map +1 -0
- package/dist/unstyled/src/components/Tests/utils.d.ts +14 -0
- package/dist/unstyled/src/components/Tests/utils.d.ts.map +1 -0
- package/dist/unstyled/src/components/TranspiledCode/TranspiledCode.css.d.ts +2 -0
- package/dist/unstyled/src/components/TranspiledCode/TranspiledCode.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/TranspiledCode/index.d.ts +4 -0
- package/dist/unstyled/src/components/TranspiledCode/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/DependenciesProgress.css.d.ts +2 -0
- package/dist/unstyled/src/components/common/DependenciesProgress.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/DependenciesProgress.d.ts +4 -0
- package/dist/unstyled/src/components/common/DependenciesProgress.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/ErrorOverlay.d.ts +6 -0
- package/dist/unstyled/src/components/common/ErrorOverlay.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/Layout.css.d.ts +2 -0
- package/dist/unstyled/src/components/common/Layout.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/Layout.d.ts +8 -0
- package/dist/unstyled/src/components/common/Layout.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/Loading.css.d.ts +4 -0
- package/dist/unstyled/src/components/common/Loading.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/Loading.d.ts +5 -0
- package/dist/unstyled/src/components/common/Loading.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/LoadingOverlay.css.d.ts +5 -0
- package/dist/unstyled/src/components/common/LoadingOverlay.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/LoadingOverlay.d.ts +12 -0
- package/dist/unstyled/src/components/common/LoadingOverlay.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/OpenInCodeSandboxButton.d.ts +3 -0
- package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/OpenInCodeSandboxButton.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/UnstyledOpenInCodeSandboxButton.d.ts +7 -0
- package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/UnstyledOpenInCodeSandboxButton.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/index.d.ts +3 -0
- package/dist/unstyled/src/components/common/OpenInCodeSandboxButton/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/RoundedButton.d.ts +3 -0
- package/dist/unstyled/src/components/common/RoundedButton.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/RunButton.css.d.ts +2 -0
- package/dist/unstyled/src/components/common/RunButton.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/RunButton.d.ts +3 -0
- package/dist/unstyled/src/components/common/RunButton.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/Stack.css.d.ts +2 -0
- package/dist/unstyled/src/components/common/Stack.css.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/Stack.d.ts +7 -0
- package/dist/unstyled/src/components/common/Stack.d.ts.map +1 -0
- package/dist/unstyled/src/components/common/index.d.ts +9 -0
- package/dist/unstyled/src/components/common/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/icons/index.d.ts +16 -0
- package/dist/unstyled/src/components/icons/index.d.ts.map +1 -0
- package/dist/unstyled/src/components/index.d.ts +10 -0
- package/dist/unstyled/src/components/index.d.ts.map +1 -0
- package/dist/unstyled/src/contexts/sandpackContext.d.ts +11 -0
- package/dist/unstyled/src/contexts/sandpackContext.d.ts.map +1 -0
- package/dist/unstyled/src/contexts/utils/testHelpers.d.ts +9 -0
- package/dist/unstyled/src/contexts/utils/testHelpers.d.ts.map +1 -0
- package/dist/unstyled/src/contexts/utils/useAppState.d.ts +15 -0
- package/dist/unstyled/src/contexts/utils/useAppState.d.ts.map +1 -0
- package/dist/unstyled/src/contexts/utils/useClient.d.ts +32 -0
- package/dist/unstyled/src/contexts/utils/useClient.d.ts.map +1 -0
- package/dist/unstyled/src/contexts/utils/useFiles.d.ts +41 -0
- package/dist/unstyled/src/contexts/utils/useFiles.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/index.d.ts +12 -0
- package/dist/unstyled/src/hooks/index.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useActiveCode.d.ts +21 -0
- package/dist/unstyled/src/hooks/useActiveCode.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useErrorMessage.d.ts +5 -0
- package/dist/unstyled/src/hooks/useErrorMessage.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useLoadingOverlayState.d.ts +7 -0
- package/dist/unstyled/src/hooks/useLoadingOverlayState.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useSandpack.d.ts +14 -0
- package/dist/unstyled/src/hooks/useSandpack.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useSandpackClient.d.ts +23 -0
- package/dist/unstyled/src/hooks/useSandpackClient.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useSandpackNavigation.d.ts +9 -0
- package/dist/unstyled/src/hooks/useSandpackNavigation.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useSandpackPreviewProgress.d.ts +5 -0
- package/dist/unstyled/src/hooks/useSandpackPreviewProgress.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useSandpackShell.d.ts +8 -0
- package/dist/unstyled/src/hooks/useSandpackShell.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useSandpackShellStdout.d.ts +12 -0
- package/dist/unstyled/src/hooks/useSandpackShellStdout.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useSandpackTheme.d.ts +10 -0
- package/dist/unstyled/src/hooks/useSandpackTheme.d.ts.map +1 -0
- package/dist/unstyled/src/hooks/useTranspiledCode.d.ts +5 -0
- package/dist/unstyled/src/hooks/useTranspiledCode.d.ts.map +1 -0
- package/dist/unstyled/src/index.d.ts +15 -0
- package/dist/unstyled/src/index.d.ts.map +1 -0
- package/dist/unstyled/src/presets/Sandpack.css.d.ts +20 -0
- package/dist/unstyled/src/presets/Sandpack.css.d.ts.map +1 -0
- package/dist/unstyled/src/presets/Sandpack.d.ts +3 -0
- package/dist/unstyled/src/presets/Sandpack.d.ts.map +1 -0
- package/dist/unstyled/src/presets/index.d.ts +2 -0
- package/dist/unstyled/src/presets/index.d.ts.map +1 -0
- package/dist/unstyled/src/setup.jest.d.ts +2 -0
- package/dist/unstyled/src/setup.jest.d.ts.map +1 -0
- package/dist/unstyled/src/styles/__generated__/cssText.d.ts +7 -0
- package/dist/unstyled/src/styles/__generated__/cssText.d.ts.map +1 -0
- package/dist/unstyled/src/styles/constants.d.ts +10 -0
- package/dist/unstyled/src/styles/constants.d.ts.map +1 -0
- package/dist/unstyled/src/styles/getSandpackCssText.d.ts +16 -0
- package/dist/unstyled/src/styles/getSandpackCssText.d.ts.map +1 -0
- package/dist/unstyled/src/styles/index.d.ts +65 -0
- package/dist/unstyled/src/styles/index.d.ts.map +1 -0
- package/dist/unstyled/src/styles/shared.css.d.ts +22 -0
- package/dist/unstyled/src/styles/shared.css.d.ts.map +1 -0
- package/dist/unstyled/src/styles/themeContext.css.d.ts +17 -0
- package/dist/unstyled/src/styles/themeContext.css.d.ts.map +1 -0
- package/dist/unstyled/src/styles/themeContext.d.ts +21 -0
- package/dist/unstyled/src/styles/themeContext.d.ts.map +1 -0
- package/dist/unstyled/src/styles/vars.css.d.ts +98 -0
- package/dist/unstyled/src/styles/vars.css.d.ts.map +1 -0
- package/dist/unstyled/src/templates/common.d.ts +6 -0
- package/dist/unstyled/src/templates/common.d.ts.map +1 -0
- package/dist/unstyled/src/templates/index.d.ts +549 -0
- package/dist/unstyled/src/templates/index.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/astro.d.ts +22 -0
- package/dist/unstyled/src/templates/node/astro.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/nexjs.d.ts +22 -0
- package/dist/unstyled/src/templates/node/nexjs.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/node.d.ts +13 -0
- package/dist/unstyled/src/templates/node/node.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/vite-preact-ts.d.ts +34 -0
- package/dist/unstyled/src/templates/node/vite-preact-ts.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/vite-preact.d.ts +25 -0
- package/dist/unstyled/src/templates/node/vite-preact.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/vite-react-ts.d.ts +34 -0
- package/dist/unstyled/src/templates/node/vite-react-ts.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/vite-react.d.ts +25 -0
- package/dist/unstyled/src/templates/node/vite-react.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/vite-svelte-ts.d.ts +37 -0
- package/dist/unstyled/src/templates/node/vite-svelte-ts.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/vite-svelte.d.ts +25 -0
- package/dist/unstyled/src/templates/node/vite-svelte.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/vite-vue-ts.d.ts +34 -0
- package/dist/unstyled/src/templates/node/vite-vue-ts.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/vite-vue.d.ts +25 -0
- package/dist/unstyled/src/templates/node/vite-vue.d.ts.map +1 -0
- package/dist/unstyled/src/templates/node/vite.d.ts +19 -0
- package/dist/unstyled/src/templates/node/vite.d.ts.map +1 -0
- package/dist/unstyled/src/templates/runtime/angular.d.ts +31 -0
- package/dist/unstyled/src/templates/runtime/angular.d.ts.map +1 -0
- package/dist/unstyled/src/templates/runtime/react-typescript.d.ts +25 -0
- package/dist/unstyled/src/templates/runtime/react-typescript.d.ts.map +1 -0
- package/dist/unstyled/src/templates/runtime/react.d.ts +22 -0
- package/dist/unstyled/src/templates/runtime/react.d.ts.map +1 -0
- package/dist/unstyled/src/templates/runtime/solid.d.ts +22 -0
- package/dist/unstyled/src/templates/runtime/solid.d.ts.map +1 -0
- package/dist/unstyled/src/templates/runtime/svelte.d.ts +22 -0
- package/dist/unstyled/src/templates/runtime/svelte.d.ts.map +1 -0
- package/dist/unstyled/src/templates/runtime/tests-ts.d.ts +20 -0
- package/dist/unstyled/src/templates/runtime/tests-ts.d.ts.map +1 -0
- package/dist/unstyled/src/templates/runtime/vanilla-typescript.d.ts +22 -0
- package/dist/unstyled/src/templates/runtime/vanilla-typescript.d.ts.map +1 -0
- package/dist/unstyled/src/templates/runtime/vanilla.d.ts +19 -0
- package/dist/unstyled/src/templates/runtime/vanilla.d.ts.map +1 -0
- package/dist/unstyled/src/templates/runtime/vue-ts.d.ts +26 -0
- package/dist/unstyled/src/templates/runtime/vue-ts.d.ts.map +1 -0
- package/dist/unstyled/src/templates/runtime/vue.d.ts +22 -0
- package/dist/unstyled/src/templates/runtime/vue.d.ts.map +1 -0
- package/dist/unstyled/src/templates/static.d.ts +16 -0
- package/dist/unstyled/src/templates/static.d.ts.map +1 -0
- package/dist/unstyled/src/themes/index.d.ts +14 -0
- package/dist/unstyled/src/themes/index.d.ts.map +1 -0
- package/dist/unstyled/src/types.d.ts +477 -0
- package/dist/unstyled/src/types.d.ts.map +1 -0
- package/dist/unstyled/src/utils/ansi-to-react.d.ts +13 -0
- package/dist/unstyled/src/utils/ansi-to-react.d.ts.map +1 -0
- package/dist/unstyled/src/utils/array.d.ts +2 -0
- package/dist/unstyled/src/utils/array.d.ts.map +1 -0
- package/dist/unstyled/src/utils/classNames.d.ts +6 -0
- package/dist/unstyled/src/utils/classNames.d.ts.map +1 -0
- package/dist/unstyled/src/utils/createSandpackFS.d.ts +35 -0
- package/dist/unstyled/src/utils/createSandpackFS.d.ts.map +1 -0
- package/dist/unstyled/src/utils/storyHelpers.d.ts +9 -0
- package/dist/unstyled/src/utils/storyHelpers.d.ts.map +1 -0
- package/dist/unstyled/src/utils/stringUtils.d.ts +10 -0
- package/dist/unstyled/src/utils/stringUtils.d.ts.map +1 -0
- package/dist/unstyled/src/utils/useAsyncSandpackId.d.ts +9 -0
- package/dist/unstyled/src/utils/useAsyncSandpackId.d.ts.map +1 -0
- package/dist/unstyled.d.ts +1 -0
- package/package.json +108 -0
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<img style="width:100%" src="https://user-images.githubusercontent.com/4838076/143581035-ebee5ba2-9cb1-4fe8-a05b-2f44bd69bb4b.gif" alt="Component toolkit for live running code editing experiences" />
|
|
2
|
+
|
|
3
|
+
# Sandpack React
|
|
4
|
+
|
|
5
|
+
React components that give you the power of editable sandboxes that run in the browser.
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { Sandpack } from "@codesandbox/sandpack-react";
|
|
9
|
+
|
|
10
|
+
<Sandpack template="react" />;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
[Read more](https://sandpack.codesandbox.io/)
|
|
14
|
+
|
|
15
|
+
## Documentation
|
|
16
|
+
|
|
17
|
+
For full documentation, visit [https://sandpack.codesandbox.io/docs/](https://sandpack.codesandbox.io/docs/)
|
|
18
|
+
|
|
19
|
+
## Migration: from `files` map to `SandpackFS`
|
|
20
|
+
|
|
21
|
+
Sandpack now stores file content inside a ZenFS-backed filesystem
|
|
22
|
+
(`SandpackFS`) instead of a synchronous `Record<string, string>` map. Most of
|
|
23
|
+
the existing APIs still accept the familiar `files` prop and materialize it
|
|
24
|
+
for you, but a few things changed that you should know about:
|
|
25
|
+
|
|
26
|
+
- **`sandpack.files` is gone.** Use `sandpack.fileList` (ordered array of
|
|
27
|
+
paths), `sandpack.fileMeta` (per-file `hidden` / `active` / `readOnly`), and
|
|
28
|
+
`sandpack.fs` (a `SandpackFS` instance) to read content:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
const { sandpack } = useSandpack();
|
|
32
|
+
const code = await sandpack.fs.readFile(sandpack.activeFile);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- **File mutations are asynchronous.** `updateFile`, `addFile`,
|
|
36
|
+
`deleteFile`, `resetFile`, `resetAllFiles`, and `updateCurrentFile` all
|
|
37
|
+
return `Promise<void>` now. `useActiveCode` exposes an `isLoading` flag for
|
|
38
|
+
the initial read.
|
|
39
|
+
|
|
40
|
+
- **`options.fileResolver` was removed.** Hand Sandpack a fully-formed
|
|
41
|
+
filesystem via the new `fs` prop on `SandpackProvider` (or seed it via
|
|
42
|
+
`files`) instead of providing a resolver callback.
|
|
43
|
+
|
|
44
|
+
- **`SandpackBundlerFiles` is deprecated.** It remains exported as a type
|
|
45
|
+
alias for the `{code, ...meta}` snapshot shape that the bundler iframe
|
|
46
|
+
protocol still consumes, but new code should use `SandpackFilesInput` (the
|
|
47
|
+
input to `SandpackFS.fromFiles`) or operate on `SandpackFS` directly.
|
|
48
|
+
|
|
49
|
+
You can also pass a pre-built `SandpackFS` to `SandpackProvider`:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { SandpackFS } from "@codesandbox/sandpack-client";
|
|
53
|
+
|
|
54
|
+
const fs = await SandpackFS.fromFiles({
|
|
55
|
+
"/index.js": { code: "console.log('hi')" },
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
<SandpackProvider fs={fs}>{/* ... */}</SandpackProvider>;
|
|
59
|
+
```
|
|
60
|
+
|