Browse Source

[beta] upgrade sandpack and refactor sandpack.css (#4843)

* upgrade sandpack and address breaking changes

* remove unnecessaries fixes

* use Sandpack components instead reimplementing them

* refactor: sandpack.css

* fixes

* fix: sticky and syntax-highlight

Co-authored-by: dan <dan.abramov@gmail.com>
main
Danilo Woznica 2 years ago
committed by GitHub
parent
commit
537e0a354d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      beta/package.json
  2. 37
      beta/patches/@codesandbox+sandpack-react+0.19.8-experimental.4.patch
  3. 19
      beta/src/components/MDX/CodeBlock/CodeBlock.tsx
  4. 35
      beta/src/components/MDX/Sandpack/CustomPreset.tsx
  5. 10
      beta/src/components/MDX/Sandpack/FilesDropdown.tsx
  6. 8
      beta/src/components/MDX/Sandpack/NavigationBar.tsx
  7. 20
      beta/src/components/MDX/Sandpack/Preview.tsx
  8. 20
      beta/src/components/MDX/Sandpack/SandpackRoot.tsx
  9. 51
      beta/src/components/MDX/Sandpack/Themes.tsx
  10. 2
      beta/src/components/MDX/Sandpack/index.tsx
  11. 1
      beta/src/pages/_app.tsx
  12. 2
      beta/src/pages/_document.tsx
  13. 2
      beta/src/pages/learn/index.md
  14. 493
      beta/src/styles/sandpack.css
  15. 149
      beta/yarn.lock

2
beta/package.json

@ -22,7 +22,7 @@
"check-all": "npm-run-all prettier lint:fix tsc" "check-all": "npm-run-all prettier lint:fix tsc"
}, },
"dependencies": { "dependencies": {
"@codesandbox/sandpack-react": "v0.19.8-experimental.7", "@codesandbox/sandpack-react": "1.3.3",
"@docsearch/css": "3.0.0-alpha.41", "@docsearch/css": "3.0.0-alpha.41",
"@docsearch/react": "3.0.0-alpha.41", "@docsearch/react": "3.0.0-alpha.41",
"@headlessui/react": "^1.3.0", "@headlessui/react": "^1.3.0",

37
beta/patches/@codesandbox+sandpack-react+0.19.8-experimental.4.patch

@ -1,37 +0,0 @@
diff --git a/node_modules/@codesandbox/sandpack-react/dist/esm/index.js b/node_modules/@codesandbox/sandpack-react/dist/esm/index.js
index ced9bd3..7e5e366 100644
--- a/node_modules/@codesandbox/sandpack-react/dist/esm/index.js
+++ b/node_modules/@codesandbox/sandpack-react/dist/esm/index.js
@@ -566,17 +566,16 @@ var REACT_TEMPLATE = {
},
"/index.js": {
code: `import React, { StrictMode } from "react";
-import ReactDOM from "react-dom";
+import { createRoot } from "react-dom/client";
import "./styles.css";
import App from "./App";
-const rootElement = document.getElementById("root");
-ReactDOM.render(
+const root = createRoot(document.getElementById("root"));
+root.render(
<StrictMode>
<App />
- </StrictMode>,
- rootElement
+ </StrictMode>
);`
},
"/styles.css": {
@@ -611,8 +610,8 @@ h1 {
}
},
dependencies: {
- react: "^17.0.0",
- "react-dom": "^17.0.0",
+ react: "^18.0.0",
+ "react-dom": "^18.0.0",
"react-scripts": "^4.0.0"
},
entry: "/index.js",

19
beta/src/components/MDX/CodeBlock/CodeBlock.tsx

@ -6,7 +6,6 @@ import cn from 'classnames';
import { import {
SandpackCodeViewer, SandpackCodeViewer,
SandpackProvider, SandpackProvider,
SandpackThemeProvider,
} from '@codesandbox/sandpack-react'; } from '@codesandbox/sandpack-react';
import rangeParser from 'parse-numeric-range'; import rangeParser from 'parse-numeric-range';
import {CustomTheme} from '../Sandpack/Themes'; import {CustomTheme} from '../Sandpack/Themes';
@ -68,27 +67,29 @@ const CodeBlock = function CodeBlock({
const decorators = getDecoratedLineInfo(); const decorators = getDecoratedLineInfo();
return ( return (
<div <div
translate="no"
className={cn( className={cn(
'sandpack sandpack--codeblock',
'rounded-lg h-full w-full overflow-x-auto flex items-center bg-wash dark:bg-gray-95 shadow-lg', 'rounded-lg h-full w-full overflow-x-auto flex items-center bg-wash dark:bg-gray-95 shadow-lg',
!noMargin && 'my-8' !noMargin && 'my-8'
)}> )}>
<SandpackProvider <SandpackProvider
customSetup={{ files={{
entry: filename,
files: {
[filename]: { [filename]: {
code: children.trimEnd(), code: children.trimEnd(),
}, },
}, }}
}}> customSetup={{
<SandpackThemeProvider theme={CustomTheme}> entry: filename,
}}
options={{
initMode: 'immediate',
}}
theme={CustomTheme}>
<SandpackCodeViewer <SandpackCodeViewer
key={children.trimEnd()} key={children.trimEnd()}
showLineNumbers={false} showLineNumbers={false}
decorators={decorators} decorators={decorators}
/> />
</SandpackThemeProvider>
</SandpackProvider> </SandpackProvider>
</div> </div>
); );

35
beta/src/components/MDX/Sandpack/CustomPreset.tsx

@ -8,8 +8,8 @@ import {
useSandpack, useSandpack,
useActiveCode, useActiveCode,
SandpackCodeEditor, SandpackCodeEditor,
SandpackThemeProvider, // SandpackReactDevTools,
SandpackReactDevTools, SandpackLayout,
} from '@codesandbox/sandpack-react'; } from '@codesandbox/sandpack-react';
import scrollIntoView from 'scroll-into-view-if-needed'; import scrollIntoView from 'scroll-into-view-if-needed';
import cn from 'classnames'; import cn from 'classnames';
@ -17,11 +17,8 @@ import cn from 'classnames';
import {IconChevron} from 'components/Icon/IconChevron'; import {IconChevron} from 'components/Icon/IconChevron';
import {NavigationBar} from './NavigationBar'; import {NavigationBar} from './NavigationBar';
import {Preview} from './Preview'; import {Preview} from './Preview';
import {CustomTheme} from './Themes';
import {useSandpackLint} from './useSandpackLint';
// Workaround for https://github.com/reactjs/reactjs.org/issues/4686#issuecomment-1137402613. import {useSandpackLint} from './useSandpackLint';
const emptyArray: Array<any> = [];
export function CustomPreset({ export function CustomPreset({
isSingleFile, isSingleFile,
@ -41,11 +38,11 @@ export function CustomPreset({
const {code} = useActiveCode(); const {code} = useActiveCode();
const [isExpanded, setIsExpanded] = React.useState(false); const [isExpanded, setIsExpanded] = React.useState(false);
const {activePath} = sandpack; const {activeFile} = sandpack;
if (!lineCountRef.current[activePath]) { if (!lineCountRef.current[activeFile]) {
lineCountRef.current[activePath] = code.split('\n').length; lineCountRef.current[activeFile] = code.split('\n').length;
} }
const lineCount = lineCountRef.current[activePath]; const lineCount = lineCountRef.current[activeFile];
const isExpandable = lineCount > 16 || isExpanded; const isExpandable = lineCount > 16 || isExpanded;
return ( return (
@ -54,12 +51,11 @@ export function CustomPreset({
className="shadow-lg dark:shadow-lg-dark rounded-lg" className="shadow-lg dark:shadow-lg-dark rounded-lg"
ref={containerRef}> ref={containerRef}>
<NavigationBar showDownload={isSingleFile} /> <NavigationBar showDownload={isSingleFile} />
<SandpackThemeProvider theme={CustomTheme}>
<div <SandpackLayout
ref={sandpack.lazyAnchorRef}
className={cn( className={cn(
'sp-layout sp-custom-layout',
showDevTools && devToolsLoaded && 'sp-layout-devtools', showDevTools && devToolsLoaded && 'sp-layout-devtools',
!isExpandable && 'rounded-b-lg overflow-hidden',
isExpanded && 'sp-layout-expanded' isExpanded && 'sp-layout-expanded'
)}> )}>
<SandpackCodeEditor <SandpackCodeEditor
@ -68,7 +64,6 @@ export function CustomPreset({
showTabs={false} showTabs={false}
showRunButton={false} showRunButton={false}
extensions={lintExtensions} extensions={lintExtensions}
extensionsKeymap={emptyArray}
/> />
<Preview <Preview
className="order-last xl:order-2" className="order-last xl:order-2"
@ -78,7 +73,7 @@ export function CustomPreset({
{isExpandable && ( {isExpandable && (
<button <button
translate="yes" translate="yes"
className="flex text-base justify-between dark:border-card-dark bg-wash dark:bg-card-dark items-center z-10 rounded-t-none p-1 w-full order-2 xl:order-last border-b-1 relative top-0" className="sandpack-expand flex text-base justify-between dark:border-card-dark bg-wash dark:bg-card-dark items-center z-10 p-1 w-full order-2 xl:order-last border-b-1 relative top-0"
onClick={() => { onClick={() => {
const nextIsExpanded = !isExpanded; const nextIsExpanded = !isExpanded;
flushSync(() => { flushSync(() => {
@ -101,12 +96,12 @@ export function CustomPreset({
</span> </span>
</button> </button>
)} )}
</div> </SandpackLayout>
{showDevTools && ( {/* {showDevTools && (
// @ts-ignore TODO(@danilowoz): support devtools
<SandpackReactDevTools onLoadModule={onDevToolsLoad} /> <SandpackReactDevTools onLoadModule={onDevToolsLoad} />
)} )} */}
</SandpackThemeProvider>
</div> </div>
</> </>
); );

10
beta/src/components/MDX/Sandpack/FilesDropdown.tsx

@ -15,9 +15,9 @@ const getFileName = (filePath: string): string => {
export function FilesDropdown() { export function FilesDropdown() {
const {sandpack} = useSandpack(); const {sandpack} = useSandpack();
const {openPaths, setActiveFile, activePath} = sandpack; const {visibleFiles, setActiveFile, activeFile} = sandpack;
return ( return (
<Listbox value={activePath} onChange={setActiveFile}> <Listbox value={activeFile} onChange={setActiveFile}>
<Listbox.Button> <Listbox.Button>
{({open}) => ( {({open}) => (
<span <span
@ -25,7 +25,7 @@ export function FilesDropdown() {
'h-full py-2 px-1 mt-px -mb-px flex border-b-2 text-link dark:text-link-dark border-link dark:border-link-dark items-center text-md leading-tight truncate' 'h-full py-2 px-1 mt-px -mb-px flex border-b-2 text-link dark:text-link-dark border-link dark:border-link-dark items-center text-md leading-tight truncate'
)} )}
style={{maxWidth: '160px'}}> style={{maxWidth: '160px'}}>
{getFileName(activePath)} {getFileName(activeFile)}
<span className="ml-2"> <span className="ml-2">
<IconChevron displayDirection={open ? 'up' : 'down'} /> <IconChevron displayDirection={open ? 'up' : 'down'} />
</span> </span>
@ -33,13 +33,13 @@ export function FilesDropdown() {
)} )}
</Listbox.Button> </Listbox.Button>
<Listbox.Options className="absolute mt-0.5 bg-card dark:bg-card-dark px-2 left-0 right-0 mx-0 rounded-b-lg border-1 border-border dark:border-border-dark rounded-sm shadow-md"> <Listbox.Options className="absolute mt-0.5 bg-card dark:bg-card-dark px-2 left-0 right-0 mx-0 rounded-b-lg border-1 border-border dark:border-border-dark rounded-sm shadow-md">
{openPaths.map((filePath: string) => ( {visibleFiles.map((filePath: string) => (
<Listbox.Option <Listbox.Option
key={filePath} key={filePath}
value={filePath} value={filePath}
className={cn( className={cn(
'text-md mx-2 my-4 cursor-pointer', 'text-md mx-2 my-4 cursor-pointer',
filePath === activePath && 'text-link dark:text-link-dark' filePath === activeFile && 'text-link dark:text-link-dark'
)}> )}>
{getFileName(filePath)} {getFileName(filePath)}
</Listbox.Option> </Listbox.Option>

8
beta/src/components/MDX/Sandpack/NavigationBar.tsx

@ -16,7 +16,7 @@ import {FilesDropdown} from './FilesDropdown';
export function NavigationBar({showDownload}: {showDownload: boolean}) { export function NavigationBar({showDownload}: {showDownload: boolean}) {
const {sandpack} = useSandpack(); const {sandpack} = useSandpack();
const [dropdownActive, setDropdownActive] = React.useState(false); const [dropdownActive, setDropdownActive] = React.useState(false);
const {openPaths, clients} = sandpack; const {visibleFiles, clients} = sandpack;
const clientId = Object.keys(clients)[0]; const clientId = Object.keys(clients)[0];
const {refresh} = useSandpackNavigation(clientId); const {refresh} = useSandpackNavigation(clientId);
@ -31,7 +31,7 @@ export function NavigationBar({showDownload}: {showDownload: boolean}) {
}, [dropdownActive]); }, [dropdownActive]);
React.useEffect(() => { React.useEffect(() => {
if (openPaths.length > 1) { if (visibleFiles.length > 1) {
resizeHandler(); resizeHandler();
window.addEventListener('resize', resizeHandler); window.addEventListener('resize', resizeHandler);
return () => { return () => {
@ -39,7 +39,7 @@ export function NavigationBar({showDownload}: {showDownload: boolean}) {
}; };
} }
return; return;
}, [openPaths.length, resizeHandler]); }, [visibleFiles.length, resizeHandler]);
const handleReset = () => { const handleReset = () => {
sandpack.resetAllFiles(); sandpack.resetAllFiles();
@ -47,7 +47,7 @@ export function NavigationBar({showDownload}: {showDownload: boolean}) {
}; };
return ( return (
<div className="bg-wash dark:bg-card-dark flex justify-between items-center relative z-10 border-b border-border dark:border-border-dark rounded-t-lg rounded-b-none"> <div className="bg-wash dark:bg-card-dark flex justify-between items-center relative z-10 border-b border-border dark:border-border-dark rounded-t-lg text-lg">
<div className="px-4 lg:px-6"> <div className="px-4 lg:px-6">
{dropdownActive ? <FilesDropdown /> : <FileTabs />} {dropdownActive ? <FilesDropdown /> : <FileTabs />}
</div> </div>

20
beta/src/components/MDX/Sandpack/Preview.tsx

@ -4,12 +4,19 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import * as React from 'react'; import * as React from 'react';
import {useSandpack, LoadingOverlay} from '@codesandbox/sandpack-react'; import {
useSandpack,
LoadingOverlay,
SandpackStack,
} from '@codesandbox/sandpack-react';
import cn from 'classnames'; import cn from 'classnames';
import {Error} from './Error'; import {Error} from './Error';
import {SandpackConsole} from './Console'; import {SandpackConsole} from './Console';
import type {LintDiagnostic} from './useSandpackLint'; import type {LintDiagnostic} from './useSandpackLint';
/**
* TODO: can we use React.useId?
*/
const generateRandomId = (): string => const generateRandomId = (): string =>
Math.floor(Math.random() * 10000).toString(); Math.floor(Math.random() * 10000).toString();
@ -149,8 +156,8 @@ export function Preview({
// The best way to test it is to actually go through some challenges. // The best way to test it is to actually go through some challenges.
return ( return (
<div <SandpackStack
className={cn('sp-stack', className)} className={className}
style={{ style={{
// TODO: clean up this mess. // TODO: clean up this mess.
...customStyle, ...customStyle,
@ -158,7 +165,7 @@ export function Preview({
}}> }}>
<div <div
className={cn( className={cn(
'p-0 sm:p-2 md:p-4 lg:p-8 md:bg-card md:dark:bg-wash-dark h-full relative md:rounded-b-lg lg:rounded-b-none', 'p-0 sm:p-2 md:p-4 lg:p-8 bg-card dark:bg-wash-dark h-full relative md:rounded-b-lg lg:rounded-b-none',
// Allow content to be scrolled if it's too high to fit. // Allow content to be scrolled if it's too high to fit.
// Note we don't want this in the expanded state // Note we don't want this in the expanded state
// because it breaks position: sticky (and isn't needed anyway). // because it breaks position: sticky (and isn't needed anyway).
@ -172,7 +179,7 @@ export function Preview({
: isExpanded : isExpanded
? 'sticky' ? 'sticky'
: undefined, : undefined,
top: isExpanded ? '2rem' : undefined, top: isExpanded ? '4rem' : undefined,
}}> }}>
<iframe <iframe
ref={iframeRef} ref={iframeRef}
@ -206,11 +213,12 @@ export function Preview({
</div> </div>
)} )}
<LoadingOverlay <LoadingOverlay
showOpenInCodeSandbox
clientId={clientId.current} clientId={clientId.current}
loading={!isReady && iframeComputedHeight === null} loading={!isReady && iframeComputedHeight === null}
/> />
</div> </div>
{!error && <SandpackConsole />} {!error && <SandpackConsole />}
</div> </SandpackStack>
); );
} }

20
beta/src/components/MDX/Sandpack/SandpackRoot.tsx

@ -7,7 +7,7 @@ import {SandpackProvider} from '@codesandbox/sandpack-react';
import {SandpackLogLevel} from '@codesandbox/sandpack-client'; import {SandpackLogLevel} from '@codesandbox/sandpack-client';
import {CustomPreset} from './CustomPreset'; import {CustomPreset} from './CustomPreset';
import {createFileMap} from './createFileMap'; import {createFileMap} from './createFileMap';
import {CustomTheme} from './Themes';
import type {SandpackSetup} from '@codesandbox/sandpack-react'; import type {SandpackSetup} from '@codesandbox/sandpack-react';
type SandpackProps = { type SandpackProps = {
@ -77,15 +77,19 @@ function SandpackRoot(props: SandpackProps) {
}; };
return ( return (
<div className="sandpack-container my-8" translate="no"> <div className="sandpack sandpack--playground sandbox my-8">
<SandpackProvider <SandpackProvider
template="react" template="react"
customSetup={{...setup, files: files}} files={files}
autorun={autorun} customSetup={setup}
initMode="user-visible" theme={CustomTheme}
initModeObserverOptions={{rootMargin: '1400px 0px'}} options={{
bundlerURL="https://6b760a26.sandpack-bundler.pages.dev" autorun,
logLevel={SandpackLogLevel.None}> initMode: 'user-visible',
initModeObserverOptions: {rootMargin: '1400px 0px'},
bundlerURL: 'https://6b760a26.sandpack-bundler.pages.dev',
logLevel: SandpackLogLevel.None,
}}>
<CustomPreset <CustomPreset
isSingleFile={isSingleFile} isSingleFile={isSingleFile}
showDevTools={showDevTools} showDevTools={showDevTools}

51
beta/src/components/MDX/Sandpack/Themes.tsx

@ -5,32 +5,39 @@
import tailwindConfig from '../../../../tailwind.config'; import tailwindConfig from '../../../../tailwind.config';
export const CustomTheme = { export const CustomTheme = {
palette: { colors: {
activeText: 'inherit',
defaultText: 'inherit',
inactiveText: 'inherit',
activeBackground: 'inherit',
defaultBackground: 'inherit',
inputBackground: 'inherit',
accent: 'inherit', accent: 'inherit',
errorBackground: 'inherit', base: 'inherit',
errorForeground: 'inherit', clickable: 'inherit',
disabled: 'inherit',
error: 'inherit',
errorSurface: 'inherit',
hover: 'inherit',
surface1: 'inherit',
surface2: 'inherit',
surface3: 'inherit',
warning: 'inherit',
warningSurface: 'inherit',
}, },
syntax: { syntax: {
plain: 'var(--theme-plain)', plain: 'inherit',
comment: 'var(--theme-comment)', comment: 'inherit',
keyword: 'var(--theme-keyword)', keyword: 'inherit',
tag: 'var(--theme-tag)', tag: 'inherit',
punctuation: 'var(--theme-punctuation)', punctuation: 'inherit',
definition: 'var(--theme-definition)', definition: 'inherit',
property: 'var(--theme-property)', property: 'inherit',
static: 'var(--theme-static)', static: 'inherit',
string: 'var(--theme-string)', string: 'inherit',
}, },
typography: { font: {
bodyFont: tailwindConfig.theme.extend.fontFamily.sans.join(', '), body: tailwindConfig.theme.extend.fontFamily.sans
monoFont: tailwindConfig.theme.extend.fontFamily.mono.join(', '), .join(', ')
fontSize: tailwindConfig.theme.extend.fontSize.code, .replace(/"/gm, ''),
mono: tailwindConfig.theme.extend.fontFamily.mono
.join(', ')
.replace(/"/gm, ''),
size: tailwindConfig.theme.extend.fontSize.code,
lineHeight: '24px', lineHeight: '24px',
}, },
}; };

2
beta/src/components/MDX/Sandpack/index.tsx

@ -8,7 +8,7 @@ import {createFileMap} from './createFileMap';
const SandpackRoot = React.lazy(() => import('./SandpackRoot')); const SandpackRoot = React.lazy(() => import('./SandpackRoot'));
const SandpackGlimmer = ({code}: {code: string}) => ( const SandpackGlimmer = ({code}: {code: string}) => (
<div className="sandpack-container my-8"> <div className="sandpack my-8">
<div className="shadow-lg dark:shadow-lg-dark rounded-lg"> <div className="shadow-lg dark:shadow-lg-dark rounded-lg">
<div className="bg-wash h-10 dark:bg-card-dark flex justify-between items-center relative z-10 border-b border-border dark:border-border-dark rounded-t-lg rounded-b-none"> <div className="bg-wash h-10 dark:bg-card-dark flex justify-between items-center relative z-10 border-b border-border dark:border-border-dark rounded-t-lg rounded-b-none">
<div className="px-4 lg:px-6"> <div className="px-4 lg:px-6">

1
beta/src/pages/_app.tsx

@ -10,7 +10,6 @@ import '@docsearch/css';
import '../styles/algolia.css'; import '../styles/algolia.css';
import '../styles/index.css'; import '../styles/index.css';
import '../styles/sandpack.css'; import '../styles/sandpack.css';
import '@codesandbox/sandpack-react/dist/index.css';
const EmptyAppShell = ({children}: {children: React.ReactNode}) => ( const EmptyAppShell = ({children}: {children: React.ReactNode}) => (
<>{children}</> <>{children}</>

2
beta/src/pages/_document.tsx

@ -4,6 +4,7 @@
import * as React from 'react'; import * as React from 'react';
import {Html, Head, Main, NextScript} from 'next/document'; import {Html, Head, Main, NextScript} from 'next/document';
import {getSandpackCssText} from '@codesandbox/sandpack-react';
const MyDocument = () => { const MyDocument = () => {
// @todo specify language in HTML? // @todo specify language in HTML?
@ -11,6 +12,7 @@ const MyDocument = () => {
<Html lang="en"> <Html lang="en">
<Head /> <Head />
<body className="font-sans antialiased text-lg bg-wash dark:bg-wash-dark text-secondary dark:text-secondary-dark leading-base"> <body className="font-sans antialiased text-lg bg-wash dark:bg-wash-dark text-secondary dark:text-secondary-dark leading-base">
<style id="sandpack">{getSandpackCssText()}</style>
<script <script
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: ` __html: `

2
beta/src/pages/learn/index.md

@ -304,7 +304,7 @@ Often, you'll want your component to "remember" some information and display it.
First, import [`useState`](/apis/react/useState) from React: First, import [`useState`](/apis/react/useState) from React:
```js {1,4} ```js
import { useState } from 'react'; import { useState } from 'react';
``` ```

493
beta/src/styles/sandpack.css

@ -2,282 +2,258 @@
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Facebook, Inc. and its affiliates.
*/ */
/**
* Theme
*/
html .sp-wrapper { html .sp-wrapper {
color-scheme: inherit; color-scheme: inherit;
-webkit-font-smoothing: antialiased;
--sp-colors-accent: #087ea4;
--sp-colors-clickable: #959da5;
--sp-colors-disabled: #24292e;
--sp-colors-error: #811e18;
--sp-colors-error-surface: #ffcdca;
--sp-colors-surface1: #fff;
--sp-colors-surface2: #e4e7eb;
/* palette */ --sp-syntax-color-plain: #24292e;
--sp-colors-fg-active: #24292e !important; --sp-syntax-color-comment: #6a737d;
--sp-colors-fg-default: #959da5 !important; --sp-syntax-color-keyword: #d73a49;
--sp-colors-fg-inactive: #e4e7eb !important; --sp-syntax-color-tag: #22863a;
--sp-colors-bg-active: #e4e7eb !important; --sp-syntax-color-punctuation: #24292e;
--sp-colors-bg-default: #ffffff !important; --sp-syntax-color-definition: #6f42c1;
--sp-colors-bg-default-overlay: #ffffff !important; --sp-syntax-color-property: #005cc5;
--sp-colors-bg-input: #ffffff !important; --sp-syntax-color-static: #032f62;
--sp-colors-accent: #c8c8fa !important; --sp-syntax-color-string: #032f62;
--sp-colors-bg-error: #ffcdca !important;
--sp-colors-fg-error: #811e18 !important;
/* syntax */
--theme-plain: #24292e;
--theme-comment: #6a737d;
--theme-keyword: #d73a49;
--theme-tag: #22863a;
--theme-punctuation: #24292e;
--theme-definition: #6f42c1;
--theme-property: #005cc5;
--theme-static: #032f62;
--theme-string: #032f62;
} }
html.dark .sp-wrapper { html.dark .sp-wrapper {
--sp-colors-fg-active: #ffffff !important; --sp-colors-accent: #149eca;
--sp-colors-fg-default: #999999 !important; --sp-colors-clickable: #999;
--sp-colors-fg-inactive: #343434 !important; --sp-colors-disabled: #fff;
--sp-colors-bg-active: #343434 !important; --sp-colors-error: #811e18;
--sp-colors-bg-default: #16181d !important; --sp-colors-error-surface: #ffcdca;
--sp-colors-bg-default-overlay: #16181d !important; --sp-colors-surface1: #16181d;
--sp-colors-bg-input: #242424 !important; --sp-colors-surface2: #343a46;
--sp-colors-accent: #6caedd !important;
--sp-colors-bg-error: #ffcdca !important; --sp-syntax-color-plain: #ffffff;
--sp-colors-fg-error: #811e18 !important; --sp-syntax-color-comment: #757575;
/* syntax */ --sp-syntax-color-keyword: #77b7d7;
--theme-plain: #ffffff; --sp-syntax-color-tag: #dfab5c;
--theme-comment: #757575; --sp-syntax-color-punctuation: #ffffff;
--theme-keyword: #77b7d7; --sp-syntax-color-definition: #86d9ca;
--theme-tag: #dfab5c; --sp-syntax-color-property: #77b7d7;
--theme-punctuation: #ffffff; --sp-syntax-color-static: #c64640;
--theme-definition: #86d9ca; --sp-syntax-color-string: #977cdc;
--theme-property: #77b7d7; }
--theme-static: #c64640;
--theme-string: #977cdc; /**
} * Reset
*/
.sp-tabs, .sandpack--playground .sp-layout,
.sp-tab-button:hover { .sandpack--playground .sp-tabs,
background: none !important; .sandpack--playground .cm-activeLine,
.sandpack .cm-editor,
.sandpack--playground .cm-editor .cm-matchingBracket {
border: none;
background-color: transparent;
}
.sandpack--playground .cm-content {
caret-color: initial;
}
/**
* Layout
*/
.sandpack .sp-wrapper {
width: 100%;
}
.sandpack .sp-layout {
overflow: visible;
-webkit-mask-image: -webkit-radial-gradient(
var(--sp-colors-surface1),
var(--sp-colors-surface1)
); /* safest way to make all corner rounded */
border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
}
.sandpack .sp-layout > .sp-stack {
flex: 1 1 0px;
height: var(--sp-layout-height);
}
.sandpack .sp-layout > :not(:first-child) {
border-left: 1px solid var(--sp-colors-surface2);
border-top: 1px solid var(--sp-colors-surface2);
margin-left: -1px;
margin-top: -1px;
position: relative;
}
.sandpack .sp-cm {
padding-left: 8px;
}
/**
* Focus ring
*/
.sandpack--playground .sp-tab-button {
transition: none;
}
.sandpack--playground .sp-tab-button:focus {
outline: revert;
}
.sandpack--playground .sp-tab-button:focus-visible {
box-shadow: none;
}
.sandpack .sp-cm:focus-visible {
box-shadow: inset 0 0 0 4px rgba(20, 158, 202, 0.4);
}
/**
* Navigation
*/
.sandpack--playground .sp-tabs-scrollable-container {
padding: 0;
} }
.sp-tabs .sp-tab-button { .sp-tabs .sp-tab-button {
color: #087ea4;
padding: 0 4px; padding: 0 4px;
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
} }
html.dark .sp-tabs .sp-tab-button { @media (min-width: 768px) {
color: #149eca; .sp-tabs .sp-tab-button {
margin: 0 12px 0 0;
}
} }
.sp-tabs .sp-tab-button:hover { .sp-tabs .sp-tab-button,
color: #087ea4; .sp-tabs .sp-tab-button:hover:not(:disabled, [data-active='true']),
.sp-tabs .sp-tab-button[data-active='true'] {
color: var(--sp-colors-accent);
} }
html.dark .sp-tabs .sp-tab-button:hover { .sp-tabs .sp-tab-button[data-active='true'] {
color: #149eca; border-bottom: 2px solid var(--sp-colors-accent);
} }
.sp-tabs .sp-tab-button[data-active='true'] { /**
color: #087ea4; * Editor
border-bottom: 2px solid #087ea4; */
.sandpack .sp-code-editor .cm-content,
.sandpack .sp-code-editor .cm-gutters,
.sandpack .sp-code-editor .cm-gutterElement {
padding: 0;
-webkit-font-smoothing: auto; /* Improve the legibility */
} }
html.dark .sp-tabs .sp-tab-button[data-active='true'] { .sandpack--playground .sp-code-editor .cm-line {
color: #149eca; padding: 0 var(--sp-space-3);
border-bottom: 2px solid #149eca;
} }
.sp-stack .sp-code-editor, .sandpack--playground .sp-code-editor .cm-lineNumbers {
.sp-tabs .sp-tabs-scrollable-container { padding-left: var(--sp-space-1);
overflow: hidden; padding-right: var(--sp-space-1);
font-size: 13.6px;
} }
.sp-code-editor .cm-errorLine { .sandpack--playground .sp-code-editor .cm-line.cm-errorLine {
background-color: rgba(255, 107, 99, 0.1); @apply bg-red-400;
--tw-bg-opacity: 0.1; /* Background tweak: base color + opacity */
position: relative; position: relative;
padding-right: 2em !important; padding-right: 2em;
display: inline-block; display: inline-block;
min-width: 100%; min-width: 100%;
} }
.sp-code-editor .cm-errorLine:after { .sp-code-editor .cm-errorLine:after {
@apply text-red-500;
position: absolute; position: absolute;
right: 8px; right: 8px;
top: 0; top: 0;
content: '\26A0'; content: '\26A0';
font-size: 22px; font-size: 22px;
line-height: 20px; line-height: 20px;
color: #ff3d3d;
} }
.sp-code-editor .cm-tooltip { .sp-code-editor .cm-tooltip {
border: 0; border: 0;
max-width: 200px; max-width: 200px;
} }
html.dark .sp-code-editor .cm-diagnostic {
color: var(--sp-colors-bg-default);
}
.sp-code-editor .cm-diagnostic-error { .sp-code-editor .cm-diagnostic-error {
@apply border-red-40; @apply border-red-40;
} }
.sp-code-editor .cm-diagnostic-warning {
border-left: 5px solid orange; .sp-code-editor .sp-cm .cm-scroller {
overflow: auto;
padding: 18px 0;
} }
/* /**
* These are manually adjusted to match the final * Loading component
* rendered version without any layout shifts.
* Note this affects both sandboxes and code blocks.
*
* There are probably more maintainable ways to do this.
* However, as long as there are kind people paying close
* attention to these subtler details, I shall sleep in peace.
*
* If you know a better way to keep them from diverging, send a PR.
*/ */
.sp-cm { .sandpack--playground .sp-cube-wrapper {
-webkit-text-size-adjust: none !important; background-color: var(--sp-colors-surface1);
padding: 0 !important;
}
.cm-wrap {
background: transparent !important;
}
.sp-pre-placeholder {
display: block !important;
margin-top: 0px !important;
margin-bottom: 0px !important;
padding: 18px var(--sp-space-3) !important;
@apply font-mono !important;
font-size: 13.6px !important;
line-height: 24px !important;
height: 100%;
}
.text-xl .sp-pre-placeholder {
font-size: 16px !important;
line-height: 24px !important;
}
.sp-cm .cm-scroller {
overflow: auto !important;
padding: 18px 0 !important;
} }
.console .sp-cm, .sandpack--playground .sp-overlay {
.console .sp-cm .cm-scroller, @apply bg-card;
.console .sp-cm .cm-line {
padding: 0px !important;
} }
.sp-cm .cm-gutters { html.dark .sandpack--playground .sp-overlay {
background-color: var(--sp-colors-bg-default); @apply bg-wash-dark;
z-index: 1;
}
.sp-wrapper {
width: 100% !important;
}
.sp-wrapper .sp-custom-layout {
overflow: initial;
border: 0px solid transparent;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
}
.sp-wrapper .sp-layout-devtools {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
html.dark .sp-layout > :not(:first-child) {
border-color: #343a46;
}
html.dark .sp-layout {
background-color: #343a46;
}
html .sp-loading {
background-color: transparent;
}
html.dark .sp-loading {
background-color: #23272f;
} }
@media (min-width: 768px) { /**
.sp-tabs .sp-tab-button { * CodeBlock
margin: 0 12px 0 0; */
} .sandpack--codeblock .cm-content {
padding: 0;
} }
/* Devtools */ .sandpack--codeblock .cm-content.cm-readonly .cm-line {
.sp-devtools { padding: 0 var(--sp-space-3);
border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
overflow: hidden;
} }
.sp-devtools > div {
--color-background: var(--sp-colors-bg-default) !important;
--color-background-inactive: var(--sp-colors-fg-inactive) !important;
--color-background-selected: #087ea4 !important;
--color-background-hover: transparent !important;
--color-modal-background: #ffffffd2 !important;
--color-tab-selected-border: #087ea4 !important;
--color-component-name: var(--theme-definition) !important; /**
--color-attribute-name: var(--theme-property) !important; * Placeholder
--color-attribute-value: var(--theme-string) !important; */
--color-attribute-editable-value: var(--theme-property) !important; .sandpack .sp-code-editor .sp-pre-placeholder {
--color-attribute-name-not-editable: var(--sp-colors-fg-default) !important; @apply font-mono;
--color-button-background-focus: var(--sp-colors-fg-inactive) !important; font-size: 13.6px;
line-height: 24px;
--color-button-active: #087ea4 !important; padding: 18px 0;
--color-button-background: transparent !important;
--color-button: var(--sp-colors-fg-default) !important;
--color-button-hover: var(--sp-colors-fg-active) !important;
--color-border: var(--sp-colors-fg-inactive) !important;
--color-text: rgb(35, 39, 47) !important;
}
html.dark .sp-devtools > div {
--color-text: var(--sp-colors-fg-default) !important;
--color-modal-background: #16181de0 !important;
} }
.sp-devtools table td { .sandpack--codeblock .sp-code-editor .sp-pre-placeholder {
border: 1px solid var(--sp-colors-fg-inactive); margin-left: var(--sp-space-3) !important; /* override inline style */
} }
/* Make focus rings work */ .sandpack--playground .sp-code-editor .sp-pre-placeholder {
.sp-tab-button { margin-left: var(--sp-space-10) !important; /* override inline style */
transition: none !important;
}
.sp-tab-button:focus {
outline: revert !important;
}
.sp-tab-button:focus-visible {
box-shadow: none !important;
}
.sp-cm:focus-visible {
box-shadow: inset 0 0 0 4px rgba(20, 158, 202, 0.4) !important;
}
.cm-line {
padding: 0 var(--sp-space-3) !important;
}
.cm-lineNumbers {
padding-left: var(--sp-space-1) !important;
padding-right: var(--sp-space-1) !important;
} }
/* For iOS: prevent browser zoom when clicking on sandbox. */ .text-xl .sp-pre-placeholder {
@media screen and (max-width: 768px) { font-size: 16px !important;
@supports (-webkit-overflow-scrolling: touch) { line-height: 24px !important;
.cm-content {
font-size: initial;
}
.DocSearch-Input {
font-size: initial;
}
}
} }
.sp-cm { /**
padding-left: 8px !important; * Expand button
} */
.sp-layout { .sp-layout {
min-height: 216px; min-height: 216px;
} }
.sp-layout > .sp-stack:nth-child(1) { .sp-layout > .sp-stack:nth-child(1) {
/* Force vertical if there isn't enough space. */ /* Force vertical if there isn't enough space. */
min-width: 431px; min-width: 431px;
@ -285,6 +261,7 @@ html.dark .sp-devtools > div {
/* Max height is needed to avoid too long files. */ /* Max height is needed to avoid too long files. */
max-height: 40vh; max-height: 40vh;
} }
.sp-layout > .sp-stack:nth-child(2) { .sp-layout > .sp-stack:nth-child(2) {
/* Force vertical if there isn't enough space. */ /* Force vertical if there isn't enough space. */
min-width: 431px; min-width: 431px;
@ -298,11 +275,13 @@ html.dark .sp-devtools > div {
max-height: unset; max-height: unset;
height: auto; height: auto;
} }
.sp-layout.sp-layout-expanded > .sp-stack:nth-child(2) { .sp-layout.sp-layout-expanded > .sp-stack:nth-child(2) {
/* Clicking "show more" lets mobile preview go full height. */ /* Clicking "show more" lets mobile preview go full height. */
max-height: unset; max-height: unset;
height: auto; height: auto;
} }
@media (min-width: 1280px) { @media (min-width: 1280px) {
.sp-layout > .sp-stack:nth-child(1) { .sp-layout > .sp-stack:nth-child(1) {
/* On desktop, clamp height by pixels instead. */ /* On desktop, clamp height by pixels instead. */
@ -324,8 +303,106 @@ html.dark .sp-devtools > div {
} }
} }
.sandpack--playground .sp-layout .sandpack-expand {
border-left: none;
margin-left: 0;
}
.expandable-callout .sp-stack:nth-child(2) { .expandable-callout .sp-stack:nth-child(2) {
min-width: 431px; min-width: 431px;
min-height: 40vh; min-height: 40vh;
max-height: 40vh; max-height: 40vh;
} }
/**
* Integrations: console
*/
.console .sp-cm,
.console .sp-cm .cm-scroller,
.console .sp-cm .cm-line {
padding: 0px !important;
}
/**
* Integrations: eslint
*/
.sp-code-editor .cm-diagnostic {
@apply text-secondary;
}
/**
* Integrations: React devtools inline
*/
.sp-devtools {
border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
overflow: hidden;
}
.sp-wrapper .sp-layout-devtools {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
/**
* Overwrite inline sty
*/
.sp-devtools > div {
--color-background: var(--sp-colors-surface1) !important;
--color-background-inactive: var(--sp-colors-surface2) !important;
--color-background-selected: var(--sp-colors-accent) !important;
--color-background-hover: transparent !important;
--color-modal-background: #ffffffd2 !important;
--color-tab-selected-border: #087ea4 !important;
--color-component-name: var(--sp-syntax-color-definition) !important;
--color-attribute-name: var(--sp-syntax-color-property) !important;
--color-attribute-value: var(--sp-syntax-color-string) !important;
--color-attribute-editable-value: var(--sp-syntax-color-property) !important;
--color-attribute-name-not-editable: var(--sp-colors-clickable) !important;
--color-button-background-focus: var(--sp-colors-surface2) !important;
--color-button-active: var(--sp-colors-accent) !important;
--color-button-background: transparent !important;
--color-button: var(--sp-colors-clickable) !important;
--color-button-hover: var(--sp-colors-disabled) !important;
--color-border: var(--sp-colors-surface2) !important;
--color-text: rgb(35, 39, 47) !important;
}
html.dark .sp-devtools > div {
--color-text: var(--sp-colors-clickable) !important;
--color-modal-background: #16181de0 !important;
}
.sp-devtools table td {
border: 1px solid var(--sp-colors-surface2);
}
/**
* Hard fixes
*/
/**
* The text-size-adjust CSS property controls the text inflation
* algorithm used on some smartphones and tablets
*/
.sandpack .sp-cm {
-webkit-text-size-adjust: none;
}
/**
* For iOS: prevent browser zoom when clicking on sandbox
*/
@media screen and (max-width: 768px) {
@supports (-webkit-overflow-scrolling: touch) {
.cm-content {
font-size: initial;
}
.DocSearch-Input {
font-size: initial;
}
}
}

149
beta/yarn.lock

@ -409,6 +409,18 @@
"@codemirror/state" "^0.19.0" "@codemirror/state" "^0.19.0"
"@codemirror/view" "^0.19.23" "@codemirror/view" "^0.19.23"
"@codemirror/highlight@^0.19.0":
version "0.19.8"
resolved "https://registry.yarnpkg.com/@codemirror/highlight/-/highlight-0.19.8.tgz#a95aee8ae4389b01f820aa79c48f7b4388087d92"
integrity sha512-v/lzuHjrYR8MN2mEJcUD6fHSTXXli9C1XGYpr+ElV6fLBIUhMTNKR3qThp611xuWfXfwDxeL7ppcbkM/MzPV3A==
dependencies:
"@codemirror/language" "^0.19.0"
"@codemirror/rangeset" "^0.19.0"
"@codemirror/state" "^0.19.3"
"@codemirror/view" "^0.19.39"
"@lezer/common" "^0.15.0"
style-mod "^4.0.0"
"@codemirror/highlight@^0.19.6", "@codemirror/highlight@^0.19.7": "@codemirror/highlight@^0.19.6", "@codemirror/highlight@^0.19.7":
version "0.19.7" version "0.19.7"
resolved "https://registry.yarnpkg.com/@codemirror/highlight/-/highlight-0.19.7.tgz#91a0c9994c759f5f153861e3aae74ff9e7c7c35b" resolved "https://registry.yarnpkg.com/@codemirror/highlight/-/highlight-0.19.7.tgz#91a0c9994c759f5f153861e3aae74ff9e7c7c35b"
@ -440,7 +452,7 @@
"@codemirror/state" "^0.19.0" "@codemirror/state" "^0.19.0"
"@lezer/css" "^0.15.2" "@lezer/css" "^0.15.2"
"@codemirror/lang-html@^0.19.4": "@codemirror/lang-html@^0.19.0", "@codemirror/lang-html@^0.19.4":
version "0.19.4" version "0.19.4"
resolved "https://registry.yarnpkg.com/@codemirror/lang-html/-/lang-html-0.19.4.tgz#e6eec28462f18842a0e108732a214a7416b5e333" resolved "https://registry.yarnpkg.com/@codemirror/lang-html/-/lang-html-0.19.4.tgz#e6eec28462f18842a0e108732a214a7416b5e333"
integrity sha512-GpiEikNuCBeFnS+/TJSeanwqaOfNm8Kkp9WpVNEPZCLyW1mAMCuFJu/3xlWYeWc778Hc3vJqGn3bn+cLNubgCA== integrity sha512-GpiEikNuCBeFnS+/TJSeanwqaOfNm8Kkp9WpVNEPZCLyW1mAMCuFJu/3xlWYeWc778Hc3vJqGn3bn+cLNubgCA==
@ -467,6 +479,19 @@
"@codemirror/view" "^0.19.0" "@codemirror/view" "^0.19.0"
"@lezer/javascript" "^0.15.1" "@lezer/javascript" "^0.15.1"
"@codemirror/lang-markdown@^0.19.3":
version "0.19.6"
resolved "https://registry.yarnpkg.com/@codemirror/lang-markdown/-/lang-markdown-0.19.6.tgz#761301d276fcfbdf88440f0333785efd71c2a4f5"
integrity sha512-ojoHeLgv1Rfu0GNGsU0bCtXAIp5dy4VKjndHScITQdlCkS/+SAIfuoeowEx+nMAQwTxI+/9fQZ3xdZVznGFYug==
dependencies:
"@codemirror/highlight" "^0.19.0"
"@codemirror/lang-html" "^0.19.0"
"@codemirror/language" "^0.19.0"
"@codemirror/state" "^0.19.3"
"@codemirror/view" "^0.19.0"
"@lezer/common" "^0.15.0"
"@lezer/markdown" "^0.15.0"
"@codemirror/language@^0.19.0", "@codemirror/language@^0.19.7": "@codemirror/language@^0.19.0", "@codemirror/language@^0.19.7":
version "0.19.7" version "0.19.7"
resolved "https://registry.yarnpkg.com/@codemirror/language/-/language-0.19.7.tgz#9eef8e827692d93a701b18db9d46a42be34ecca6" resolved "https://registry.yarnpkg.com/@codemirror/language/-/language-0.19.7.tgz#9eef8e827692d93a701b18db9d46a42be34ecca6"
@ -547,18 +572,29 @@
style-mod "^4.0.0" style-mod "^4.0.0"
w3c-keyname "^2.2.4" w3c-keyname "^2.2.4"
"@codesandbox/sandpack-client@^0.19.8-experimental.2": "@codemirror/view@^0.19.39":
version "0.19.9" version "0.19.48"
resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-client/-/sandpack-client-0.19.9.tgz#29fded94a3087de155035634d596651268e27797" resolved "https://registry.yarnpkg.com/@codemirror/view/-/view-0.19.48.tgz#1c657e2b0f8ed896ac6448d6e2215ab115e2a0fc"
integrity sha512-/PPFqAJ8NSlP1jpWjQtwvmVS5o1xLRVqdbzXF7Num7zVUdYLZAbpzT7KijneZSmdcJHOvCCAYGLKJg+TcgmLjw== integrity sha512-0eg7D2Nz4S8/caetCTz61rK0tkHI17V/d15Jy0kLOT8dTLGGNJUponDnW28h2B6bERmPlVHKh8MJIr5OCp1nGw==
dependencies:
"@codemirror/rangeset" "^0.19.5"
"@codemirror/state" "^0.19.3"
"@codemirror/text" "^0.19.0"
style-mod "^4.0.0"
w3c-keyname "^2.2.4"
"@codesandbox/sandpack-client@^1.3.2":
version "1.3.2"
resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-client/-/sandpack-client-1.3.2.tgz#e9328a2fe1508a034e72686c3d234dfc95238b7d"
integrity sha512-EQj3jxW3ispcScE5Yw6lWZgn94RfIBgb+KTCe49gZt4DIUmcDXVhnRh3ArcfBcTNqr7TeuLgHYwJ9nHP/T1V8w==
dependencies: dependencies:
codesandbox-import-utils "^1.2.3" codesandbox-import-utils "^1.2.3"
lodash.isequal "^4.5.0" lodash.isequal "^4.5.0"
"@codesandbox/sandpack-react@v0.19.8-experimental.7": "@codesandbox/sandpack-react@1.3.3":
version "0.19.8-experimental.7" version "1.3.3"
resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-react/-/sandpack-react-0.19.8-experimental.7.tgz#44724fc0cce5d470eae9d6bc757ae237b699c019" resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-react/-/sandpack-react-1.3.3.tgz#c293c9e6f1f32db77e7d9b1acce3eea50e52bf71"
integrity sha512-+zT07s7LYxWq4bQYEStZszpfQAbbqP7PukF0TlJxYbjDVDXDhikdBkxuD1hXvVA6FOPdgLuF2fdnDR5NViktwA== integrity sha512-jXI0zCCIk6+vKUxgblTj1Z//PpKIzikFeK1tnO5UwI73ZbCWlUtZZgKrQ/F0D5iHwNUp30Y/wcfUcskYBeNUsQ==
dependencies: dependencies:
"@code-hike/classer" "^0.0.0-aa6efee" "@code-hike/classer" "^0.0.0-aa6efee"
"@codemirror/closebrackets" "^0.19.0" "@codemirror/closebrackets" "^0.19.0"
@ -570,16 +606,18 @@
"@codemirror/lang-css" "^0.19.3" "@codemirror/lang-css" "^0.19.3"
"@codemirror/lang-html" "^0.19.4" "@codemirror/lang-html" "^0.19.4"
"@codemirror/lang-javascript" "^0.19.3" "@codemirror/lang-javascript" "^0.19.3"
"@codemirror/lang-markdown" "^0.19.3"
"@codemirror/language" "^0.19.7" "@codemirror/language" "^0.19.7"
"@codemirror/matchbrackets" "^0.19.3" "@codemirror/matchbrackets" "^0.19.3"
"@codemirror/state" "^0.19.6" "@codemirror/state" "^0.19.6"
"@codemirror/view" "^0.19.32" "@codemirror/view" "^0.19.32"
"@codesandbox/sandpack-client" "^0.19.8-experimental.2" "@codesandbox/sandpack-client" "^1.3.2"
"@react-hook/intersection-observer" "^3.1.1" "@react-hook/intersection-observer" "^3.1.1"
"@stitches/core" "^1.2.6"
codesandbox-import-util-types "^2.2.3" codesandbox-import-util-types "^2.2.3"
lodash.isequal "^4.5.0" lodash.isequal "^4.5.0"
lz-string "^1.4.4" lz-string "^1.4.4"
react-devtools-inline "4.22.1" react-devtools-inline "4.4.0"
react-is "^17.0.2" react-is "^17.0.2"
"@csstools/convert-colors@^1.4.0": "@csstools/convert-colors@^1.4.0":
@ -669,6 +707,13 @@
dependencies: dependencies:
"@lezer/common" "^0.15.0" "@lezer/common" "^0.15.0"
"@lezer/markdown@^0.15.0":
version "0.15.6"
resolved "https://registry.yarnpkg.com/@lezer/markdown/-/markdown-0.15.6.tgz#2a826a507399b32176efdc35554397f05227d2aa"
integrity sha512-1XXLa4q0ZthryUEfO47ipvZHxNb+sCKoQIMM9dKs5vXZOBbgF2Vah/GL3g26BFIAEc2uCv4VQnI+lSrv58BT3g==
dependencies:
"@lezer/common" "^0.15.0"
"@mdx-js/loader@^1.6.16": "@mdx-js/loader@^1.6.16":
version "1.6.22" version "1.6.22"
resolved "https://registry.yarnpkg.com/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4" resolved "https://registry.yarnpkg.com/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4"
@ -834,6 +879,11 @@
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.0.tgz#7f698254aadf921e48dda8c0a6b304026b8a9323" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.0.tgz#7f698254aadf921e48dda8c0a6b304026b8a9323"
integrity sha512-JLo+Y592QzIE+q7Dl2pMUtt4q8SKYI5jDrZxrozEQxnGVOyYE+GWK9eLkwTaeN9DDctlaRAQ3TBmzZ1qdLE30A== integrity sha512-JLo+Y592QzIE+q7Dl2pMUtt4q8SKYI5jDrZxrozEQxnGVOyYE+GWK9eLkwTaeN9DDctlaRAQ3TBmzZ1qdLE30A==
"@stitches/core@^1.2.6":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@stitches/core/-/core-1.2.8.tgz#dce3b8fdc764fbc6dbea30c83b73bfb52cf96173"
integrity sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg==
"@types/body-scroll-lock@^2.6.1": "@types/body-scroll-lock@^2.6.1":
version "2.6.2" version "2.6.2"
resolved "https://registry.yarnpkg.com/@types/body-scroll-lock/-/body-scroll-lock-2.6.2.tgz#ce56d17e1bf8383c08a074733c4e9e536a59ae61" resolved "https://registry.yarnpkg.com/@types/body-scroll-lock/-/body-scroll-lock-2.6.2.tgz#ce56d17e1bf8383c08a074733c4e9e536a59ae61"
@ -1678,6 +1728,14 @@ csstype@^3.0.2:
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.10.tgz#2ad3a7bed70f35b965707c092e5f30b327c290e5" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.10.tgz#2ad3a7bed70f35b965707c092e5f30b327c290e5"
integrity sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA== integrity sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA==
d@1, d@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a"
integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==
dependencies:
es5-ext "^0.10.50"
type "^1.0.1"
damerau-levenshtein@^1.0.7: damerau-levenshtein@^1.0.7:
version "1.0.8" version "1.0.8"
resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7"
@ -1862,6 +1920,32 @@ es-to-primitive@^1.2.1:
is-date-object "^1.0.1" is-date-object "^1.0.1"
is-symbol "^1.0.2" is-symbol "^1.0.2"
es5-ext@^0.10.35, es5-ext@^0.10.50:
version "0.10.61"
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.61.tgz#311de37949ef86b6b0dcea894d1ffedb909d3269"
integrity sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==
dependencies:
es6-iterator "^2.0.3"
es6-symbol "^3.1.3"
next-tick "^1.1.0"
es6-iterator@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7"
integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==
dependencies:
d "1"
es5-ext "^0.10.35"
es6-symbol "^3.1.1"
es6-symbol@^3, es6-symbol@^3.1.1, es6-symbol@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18"
integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==
dependencies:
d "^1.0.1"
ext "^1.1.2"
escalade@^3.1.1: escalade@^3.1.1:
version "3.1.1" version "3.1.1"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
@ -2129,6 +2213,13 @@ execa@^5.1.1:
signal-exit "^3.0.3" signal-exit "^3.0.3"
strip-final-newline "^2.0.0" strip-final-newline "^2.0.0"
ext@^1.1.2:
version "1.6.0"
resolved "https://registry.yarnpkg.com/ext/-/ext-1.6.0.tgz#3871d50641e874cc172e2b53f919842d19db4c52"
integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==
dependencies:
type "^2.5.0"
extend-shallow@^2.0.1: extend-shallow@^2.0.1:
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
@ -3249,6 +3340,11 @@ natural-compare@^1.4.0:
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
next-tick@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb"
integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==
next@12.1.7-canary.11: next@12.1.7-canary.11:
version "12.1.7-canary.11" version "12.1.7-canary.11"
resolved "https://registry.yarnpkg.com/next/-/next-12.1.7-canary.11.tgz#5b732cc630801db651a0a81199fe94d215e3da1c" resolved "https://registry.yarnpkg.com/next/-/next-12.1.7-canary.11.tgz#5b732cc630801db651a0a81199fe94d215e3da1c"
@ -4026,13 +4122,12 @@ react-collapsed@3.1.0:
raf "^3.4.1" raf "^3.4.1"
tiny-warning "^1.0.3" tiny-warning "^1.0.3"
react-devtools-inline@4.22.1: react-devtools-inline@4.4.0:
version "4.22.1" version "4.4.0"
resolved "https://registry.yarnpkg.com/react-devtools-inline/-/react-devtools-inline-4.22.1.tgz#339ef44279317de10ebafcf12e3e48b9f0c24481" resolved "https://registry.yarnpkg.com/react-devtools-inline/-/react-devtools-inline-4.4.0.tgz#e032a6eb17a9977b682306f84b46e683adf4bf68"
integrity sha512-nYLfc5ZwXZN8ooQ2PNxS2LdLjQeRYYhJoDs6dMVQ8vsNx1m3qjaKBp4baLr4Cv+uv7LWSv2on7Rd2QpkYMLOeQ== integrity sha512-ES0GolSrKO8wsKbsEkVeiR/ZAaHQTY4zDh1UW8DImVmm8oaGLl3ijJDvSGe+qDRKPZdPRnDtWWnSvvrgxXdThQ==
dependencies: dependencies:
source-map-js "^0.6.2" es6-symbol "^3"
sourcemap-codec "^1.4.8"
react-dom@0.0.0-experimental-82c64e1a4-20220520: react-dom@0.0.0-experimental-82c64e1a4-20220520:
version "0.0.0-experimental-82c64e1a4-20220520" version "0.0.0-experimental-82c64e1a4-20220520"
@ -4475,11 +4570,6 @@ slice-ansi@^5.0.0:
ansi-styles "^6.0.0" ansi-styles "^6.0.0"
is-fullwidth-code-point "^4.0.0" is-fullwidth-code-point "^4.0.0"
source-map-js@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e"
integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==
source-map-js@^1.0.1, source-map-js@^1.0.2: source-map-js@^1.0.1, source-map-js@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
@ -4495,11 +4585,6 @@ source-map@^0.6.1:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
sourcemap-codec@^1.4.8:
version "1.4.8"
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==
space-separated-tokens@^1.0.0: space-separated-tokens@^1.0.0:
version "1.1.5" version "1.1.5"
resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899"
@ -4833,6 +4918,16 @@ type-fest@^0.21.3:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"
integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==
type@^1.0.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0"
integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==
type@^2.5.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/type/-/type-2.6.0.tgz#3ca6099af5981d36ca86b78442973694278a219f"
integrity sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==
typescript@^4.0.2: typescript@^4.0.2:
version "4.5.5" version "4.5.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"

Loading…
Cancel
Save