deploy: v0.12 fix 存档key名

This commit is contained in:
2026-06-24 03:09:02 +00:00
parent 7a08d49fe3
commit e0a5281119
58743 changed files with 7297269 additions and 39505 deletions
+189
View File
@@ -0,0 +1,189 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the
copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other
entities that control, are controlled by, or are under common control with
that entity. For the purposes of this definition, "control" means (i) the
power, direct or indirect, to cause the direction or management of such
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
(50%) or more of the outstanding shares, or (iii) beneficial ownership of
such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation source, and
configuration files.
"Object" form shall mean any form resulting from mechanical transformation
or translation of a Source form, including but not limited to compiled
object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form,
made available under the License, as indicated by a copyright notice that is
included in or attached to the work (an example is provided in the Appendix
below).
"Derivative Works" shall mean any work, whether in Source or Object form,
that is based on (or derived from) the Work and for which the editorial
revisions, annotations, elaborations, or other modifications represent, as a
whole, an original work of authorship. For the purposes of this License,
Derivative Works shall not include works that remain separable from, or
merely link (or bind by name) to the interfaces of, the Work and Derivative
Works thereof.
"Contribution" shall mean any work of authorship, including the original
version of the Work and any modifications or additions to that Work or
Derivative Works thereof, that is intentionally submitted to Licensor for
inclusion in the Work by the copyright owner or by an individual or Legal
Entity authorized to submit on behalf of the copyright owner. For the
purposes of this definition, "submitted" means any form of electronic,
verbal, or written communication sent to the Licensor or its
representatives, including but not limited to communication on electronic
mailing lists, source code control systems, and issue tracking systems that
are managed by, or on behalf of, the Licensor for the purpose of discussing
and improving the Work, but excluding communication that is conspicuously
marked or otherwise designated in writing by the copyright owner as "Not a
Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on
behalf of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this
License, each Contributor hereby grants to You a perpetual, worldwide,
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
reproduce, prepare Derivative Works of, publicly display, publicly perform,
sublicense, and distribute the Work and such Derivative Works in Source or
Object form.
3. Grant of Patent License. Subject to the terms and conditions of this
License, each Contributor hereby grants to You a perpetual, worldwide,
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
this section) patent license to make, have made, use, offer to sell, sell,
import, and otherwise transfer the Work, where such license applies only to
those patent claims licensable by such Contributor that are necessarily
infringed by their Contribution(s) alone or by combination of their
Contribution(s) with the Work to which such Contribution(s) was submitted.
If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this
License for that Work shall terminate as of the date such litigation is
filed.
4. Redistribution. You may reproduce and distribute copies of the Work or
Derivative Works thereof in any medium, with or without modifications, and
in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a
copy of this License; and
(b) You must cause any modified files to carry prominent notices stating
that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You
distribute, all copyright, patent, trademark, and attribution notices from
the Source form of the Work, excluding those notices that do not pertain to
any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution,
then any Derivative Works that You distribute must include a readable copy
of the attribution notices contained within such NOTICE file, excluding
those notices that do not pertain to any part of the Derivative Works, in at
least one of the following places: within a NOTICE text file distributed as
part of the Derivative Works; within the Source form or documentation, if
provided along with the Derivative Works; or, within a display generated by
the Derivative Works, if and wherever such third-party notices normally
appear. The contents of the NOTICE file are for informational purposes only
and do not modify the License. You may add Your own attribution notices
within Derivative Works that You distribute, alongside or as an addendum to
the NOTICE text from the Work, provided that such additional attribution
notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may
provide additional or different license terms and conditions for use,
reproduction, or distribution of Your modifications, or for any such
Derivative Works as a whole, provided Your use, reproduction, and
distribution of the Work otherwise complies with the conditions stated in
this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any
Contribution intentionally submitted for inclusion in the Work by You to the
Licensor shall be under the terms and conditions of this License, without
any additional terms or conditions. Notwithstanding the above, nothing
herein shall supersede or modify the terms of any separate license agreement
you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names,
trademarks, service marks, or product names of the Licensor, except as
required for reasonable and customary use in describing the origin of the
Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
writing, Licensor provides the Work (and each Contributor provides its
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied, including, without limitation, any
warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining
the appropriateness of using or redistributing the Work and assume any risks
associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in
tort (including negligence), contract, or otherwise, unless required by
applicable law (such as deliberate and grossly negligent acts) or agreed to
in writing, shall any Contributor be liable to You for damages, including
any direct, indirect, special, incidental, or consequential damages of any
character arising as a result of this License or out of the use or inability
to use the Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all other
commercial damages or losses), even if such Contributor has been advised of
the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or
Derivative Works thereof, You may choose to offer, and charge a fee for,
acceptance of support, warranty, indemnity, or other liability obligations
and/or rights consistent with this License. However, in accepting such
obligations, You may act only on Your own behalf and on Your sole
responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any
liability incurred by, or claims asserted against, such Contributor by
reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2022 CodeSandbox BV
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
+17
View File
@@ -0,0 +1,17 @@
<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" />
# Sandpack React
React components that give you the power of editable sandboxes that run in the browser.
```jsx
import { Sandpack } from "@codesandbox/sandpack-react";
<Sandpack template="react" />;
```
[Read more](https://sandpack.codesandbox.io/)
## Documentation
For full documentation, visit [https://sandpack.codesandbox.io/docs/](https://sandpack.codesandbox.io/docs/)
@@ -0,0 +1,49 @@
import type { Extension } from "@codemirror/state";
import { EditorView } from "@codemirror/view";
import type { KeyBinding } from "@codemirror/view";
import * as React from "react";
import type { CustomLanguage, EditorState as SandpackEditorState, SandpackInitMode } from "../../types";
export type Decorators = Array<{
className?: string;
line: number;
startColumn?: number;
endColumn?: number;
elementAttributes?: Record<string, string>;
}>;
interface CodeMirrorProps {
code: string;
filePath?: string;
fileType?: string;
onCodeUpdate?: (newCode: string) => void;
showLineNumbers?: boolean;
showInlineErrors?: boolean;
wrapContent?: boolean;
editorState?: SandpackEditorState;
/**
* This disables editing of content by the user in all files.
*/
readOnly?: boolean;
/**
* Controls the visibility of Read-only label, which will only
* appears when `readOnly` is `true`
*/
showReadOnly?: boolean;
/**
* Provides a way to draw or style a piece of the content.
*/
decorators?: Decorators;
initMode: SandpackInitMode;
extensions?: Extension[];
extensionsKeymap?: KeyBinding[];
/**
* Provides a way to add custom language modes by supplying a language
* type, applicable file extensions, and a LanguageSupport instance
* for that syntax mode
*/
additionalLanguages?: CustomLanguage[];
}
export interface CodeMirrorRef {
getCodemirror: () => EditorView | undefined;
}
export declare const CodeMirror: React.ForwardRefExoticComponent<CodeMirrorProps & React.RefAttributes<CodeMirrorRef>>;
export {};
@@ -0,0 +1,3 @@
import type { Extension } from "@codemirror/state";
import type { Decorators } from "../CodeEditor/CodeMirror";
export declare function highlightDecorators(positions: Decorators): Extension;
@@ -0,0 +1,2 @@
import type { Extension } from "@codemirror/state";
export declare function highlightInlineError(): Extension;
@@ -0,0 +1,50 @@
/// <reference types="react" />
import type { Extension } from "@codemirror/state";
import type { KeyBinding } from "@codemirror/view";
import type { CustomLanguage, SandpackInitMode } from "../../types";
import { CodeMirror } from "./CodeMirror";
import type { CodeMirrorRef } from "./CodeMirror";
export type CodeEditorRef = CodeMirrorRef;
export interface CodeEditorProps {
style?: React.CSSProperties;
className?: string;
showTabs?: boolean;
showLineNumbers?: boolean;
showInlineErrors?: boolean;
showRunButton?: boolean;
wrapContent?: boolean;
closableTabs?: boolean;
/**
* This provides a way to control how some components are going to
* be initialized on the page. The CodeEditor and the Preview components
* are quite expensive and might overload the memory usage, so this gives
* a certain control of when to initialize them.
*/
initMode?: SandpackInitMode;
/**
* CodeMirror extensions for the editor state, which can
* provide extra features and functionalities to the editor component.
*/
extensions?: Extension[];
/**
* Property to register CodeMirror extension keymap.
*/
extensionsKeymap?: KeyBinding[];
/**
* This disables editing of the editor content by the user.
*/
readOnly?: boolean;
/**
* Controls the visibility of Read-only label, which will only
* appears when `readOnly` is `true`
*/
showReadOnly?: boolean;
/**
* Provides a way to add custom language modes by supplying a language
* type, applicable file extensions, and a LanguageSupport instance
* for that syntax mode
*/
additionalLanguages?: CustomLanguage[];
}
export { CodeMirror as CodeEditor };
export declare const SandpackCodeEditor: import("react").ForwardRefExoticComponent<CodeEditorProps & import("react").RefAttributes<CodeMirrorRef>>;
@@ -0,0 +1,8 @@
export declare const html = "\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <title>HTML 5 Boilerplate</title>\n <link rel=\"stylesheet\" href=\"style.css\">\n </head>\n <body>\n <script src=\"index.js\"></script>\n </body>\n</html>\n";
export declare const js = "function foo(params) {\n return params\n}\n\nconst baz = (foo) => {\n return foo\n}\n\nconst array = [];\nconst object = {};\nconst regex = new Regex(//);\n\nconst expr = 'Papayas';\nswitch (expr) {\n case 'Oranges':\n console.log('Oranges are $0.59 a pound.');\n break;\n case 'Mangoes':\n case 'Papayas':\n console.log('Mangoes and papayas are $2.79 a pound.');\n // expected output: \"Mangoes and papayas are $2.79 a pound.\"\n break;\n default:\n console.log(`Sorry, we are out of ${expr}.`);\n}";
export declare const jsx = "function Greeting({ name }) {\n return <h1>Hello, {name}!</h1>;\n}\n\nexport default function App() {\n return (\n <div>\n <Greeting name=\"Divyesh\" />\n <Greeting name=\"Sarah\" />\n <Greeting name=\"Taylor\" />\n </div>\n );\n}";
export declare const css = "body {\n background-color: lightblue;\n}\n\nh1 {\n color: white;\n text-align: center;\n}\n\np {\n font-family: verdana;\n font-size: 20px;\n}";
export declare const less = "@width: 10px;\n@height: @width + 10px;\n\n#header {\n width: @width;\n height: @height;\n}";
export declare const vue = "<template>\n<div class=\"column is-12\">\n <label class=\"label\" for=\"email\">Email</label>\n <p :class=\"{ 'control': true }\">\n <input v-validate=\"'required|email'\" :class=\"{'input': true, 'is-danger': errors.has('email') }\" name=\"email\" type=\"text\" placeholder=\"Email\">\n <span v-show=\"errors.has('email')\" class=\"help is-danger\">{{ errors.first('email') }}</span>\n </p>\n</div>\n</template>\n\n<script>\n export default {\n name: 'basic-example'\n};\n</script>";
export declare const shell = "#!/bin/sh\n\nEXAMPLE=\"drawn joyed\"\n\n# Prints the EXAMPLE variable\nfunction show-example() {\n echo $EXAMPLE\n}";
export declare const python = "import os\n\napi_token = os.environ['API_TOKEN']\n\n# Prints the api_token variable\nprint(\"API token:\", api_token)";
@@ -0,0 +1,60 @@
export declare const placeholderClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
margin: string;
display: string;
fontFamily: string;
fontSize: string;
color: string;
lineHeight: string;
}>;
export declare const tokensClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, Record<string, string>>;
export declare const editorClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
[x: string]: string | number | {
padding: string;
"@supports (-webkit-overflow-scrolling: touch)"?: undefined;
} | {
"@supports (-webkit-overflow-scrolling: touch)": {
".cm-content": {
fontSize: string;
};
};
padding?: undefined;
};
flex: number;
position: string;
overflow: string;
background: string;
".cm-scroller": {
padding: string;
};
/**
* For iOS: prevent browser zoom when clicking on sandbox.
* Does NOT apply to code blocks.
*/
"@media screen and (max-width: 768px)": {
"@supports (-webkit-overflow-scrolling: touch)": {
".cm-content": {
fontSize: string;
};
};
};
}>;
export declare const cmClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
margin: string;
outline: string;
height: string;
}>;
export declare const readOnlyClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
[x: string]: string | {
right: string;
};
fontFamily: string;
fontSize: string;
position: string;
right: string;
bottom: string;
zIndex: string;
color: string;
backgroundColor: string;
borderRadius: string;
padding: string;
}>;
@@ -0,0 +1,6 @@
import type { HighlightStyle, LanguageSupport } from "@codemirror/language";
export declare const useSyntaxHighlight: ({ langSupport, highlightTheme, code, }: {
langSupport: LanguageSupport;
highlightTheme: HighlightStyle;
code?: string | undefined;
}) => React.ReactNode[];
@@ -0,0 +1,15 @@
import type { LanguageSupport } from "@codemirror/language";
import { HighlightStyle } from "@codemirror/language";
import type { Extension, Text } from "@codemirror/state";
import * as React from "react";
import type { CustomLanguage, SandpackTheme } from "../../types";
export declare const getCodeMirrorPosition: (doc: Text, { line, column }: {
line: number;
column?: number | undefined;
}) => number;
export declare const getEditorTheme: () => Extension;
export declare const styleTokens: () => Record<string, string>;
export declare const getSyntaxHighlight: (theme: SandpackTheme) => HighlightStyle;
export declare const getLanguageFromFile: (filePath: string | undefined, fileType: string | undefined, additionalLanguages: CustomLanguage[]) => string;
export declare const getCodeMirrorLanguage: (extension: string, additionalLanguages: CustomLanguage[]) => LanguageSupport;
export declare const useCombinedRefs: <T>(...refs: React.Ref<T>[]) => React.Ref<T>;
@@ -0,0 +1,27 @@
import * as React from "react";
import type { CustomLanguage, SandpackInitMode } from "../..";
import type { Decorators } from "../CodeEditor/CodeMirror";
export interface CodeViewerProps {
showTabs?: boolean;
showLineNumbers?: boolean;
/**
* Provides a way to draw or style a piece of the content.
*/
decorators?: Decorators;
code?: string;
wrapContent?: boolean;
/**
* This provides a way to control how some components are going to
* be initialized on the page. The CodeEditor and the Preview components
* are quite expensive and might overload the memory usage, so this gives
* a certain control of when to initialize them.
*/
initMode?: SandpackInitMode;
/**
* Provides a way to add custom language modes by supplying a language
* type, applicable file extensions, and a LanguageSupport instance
* for that syntax mode
*/
additionalLanguages?: CustomLanguage[];
}
export declare const SandpackCodeViewer: React.ForwardRefExoticComponent<CodeViewerProps & React.RefAttributes<import("../CodeEditor/CodeMirror").CodeMirrorRef>>;
@@ -0,0 +1,5 @@
import * as React from "react";
import type { SandpackConsoleData } from "./utils/getType";
export declare const ConsoleList: React.FC<{
data: SandpackConsoleData;
}>;
@@ -0,0 +1,6 @@
import React from "react";
export declare const Header: React.FC<{
currentTab: "server" | "client";
setCurrentTab: (value: "server" | "client") => void;
node: boolean;
}>;
@@ -0,0 +1,26 @@
import * as React from "react";
import type { SandpackConsoleData } from "./utils/getType";
interface SandpackConsoleProps {
clientId?: string;
showHeader?: boolean;
showSyntaxError?: boolean;
showSetupProgress?: boolean;
showRestartButton?: boolean;
showResetConsoleButton?: boolean;
maxMessageCount?: number;
onLogsChange?: (logs: SandpackConsoleData) => void;
resetOnPreviewRestart?: boolean;
standalone?: boolean;
actionsChildren?: JSX.Element;
}
export interface SandpackConsoleRef {
reset: () => void;
}
/**
* `SandpackConsole` is a Sandpack devtool that allows printing
* the console logs from a Sandpack client. It is designed to be
* a light version of a browser console, which means that it's
* limited to a set of common use cases you may encounter when coding.
*/
export declare const SandpackConsole: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & SandpackConsoleProps & React.RefAttributes<SandpackConsoleRef>>;
export {};
@@ -0,0 +1,7 @@
import * as React from "react";
export declare const StdoutList: React.FC<{
data: Array<{
data: string;
id: string;
}>;
}>;
@@ -0,0 +1,2 @@
export { SandpackConsole } from "./SandpackConsole";
export { useSandpackConsole } from "./useSandpackConsole";
@@ -0,0 +1,15 @@
import type { SandpackConsoleData } from "./utils/getType";
/**
* It provides an interface to consume the logs from a sandpack client.
*
* @category Hooks
*/
export declare const useSandpackConsole: ({ clientId, maxMessageCount, showSyntaxError, resetOnPreviewRestart, }: {
clientId?: string | undefined;
maxMessageCount?: number | undefined;
showSyntaxError?: boolean | undefined;
resetOnPreviewRestart: boolean;
}) => {
logs: SandpackConsoleData;
reset: () => void;
};
@@ -0,0 +1,13 @@
export declare const SYNTAX_ERROR_PATTERN: string[];
export declare const CLEAR_LOG: {
id: string;
method: "clear";
data: string[];
};
export declare const TRANSFORMED_TYPE_KEY = "@t";
export declare const TRANSFORMED_TYPE_KEY_ALTERNATE = "#@t";
export declare const CIRCULAR_REF_KEY = "@r";
export declare const MAX_LENGTH_STRING = 10000;
export declare const MAX_NEST_LEVEL = 2;
export declare const MAX_KEYS = 400;
export declare const MAX_MESSAGE_COUNT: number;
@@ -0,0 +1,12 @@
import type { TransformsTypes } from "./transformers";
export type Message = null | string | number | undefined | Array<any> | Record<any, any> | Boolean | Symbol | {
"@r": number;
} | {
"@t": TransformsTypes;
data: {
name: string;
body: string;
proto: TransformsTypes;
};
};
export declare const fromConsoleToString: (message: Message, references: Array<Message>, level?: number) => string;
@@ -0,0 +1,7 @@
import type { SandpackMessageConsoleMethods } from "@codesandbox/sandpack-client";
export declare const getType: (message: SandpackMessageConsoleMethods) => "info" | "warning" | "error" | "clear";
export type SandpackConsoleData = Array<{
data: Array<string | Record<string, string>> | undefined;
id: string;
method: SandpackMessageConsoleMethods;
}>;
@@ -0,0 +1,4 @@
export type TransformsTypes = "Function" | "HTMLElement" | "[[NaN]]" | "[[undefined]]" | "[[Date]]" | "[[RegExp]]" | "[[Error]]" | "[[RegExp]]" | "[[Error]]" | "[[ArrayBuffer]]" | "[[TypedArray]]" | "[[Map]]" | "[[Set]]" | "Arithmetic";
type Transforms = Record<TransformsTypes, (...params: any) => any>;
export declare const transformers: Transforms;
export {};
@@ -0,0 +1,13 @@
import type { SandpackBundlerFiles } from "@codesandbox/sandpack-client";
import * as React from "react";
import type { SandpackOptions } from "../../types";
import type { SandpackFileExplorerProp } from ".";
export interface Props extends SandpackFileExplorerProp {
prefixedPath: string;
files: SandpackBundlerFiles;
selectFile: (path: string) => void;
activeFile: NonNullable<SandpackOptions["activeFile"]>;
depth: number;
visibleFiles: NonNullable<SandpackOptions["visibleFiles"]>;
}
export declare const Directory: React.FC<Props>;
@@ -0,0 +1,10 @@
import * as React from "react";
export interface Props {
path: string;
selectFile?: (path: string) => void;
active?: boolean;
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
depth: number;
isDirOpen?: boolean;
}
export declare const File: React.FC<Props>;
@@ -0,0 +1,13 @@
import type { SandpackBundlerFiles } from "@codesandbox/sandpack-client";
import * as React from "react";
import type { SandpackOptions } from "../../types";
import type { SandpackFileExplorerProp } from ".";
export interface ModuleListProps extends SandpackFileExplorerProp {
prefixedPath: string;
files: SandpackBundlerFiles;
selectFile: (path: string) => void;
activeFile: NonNullable<SandpackOptions["activeFile"]>;
depth?: number;
visibleFiles: NonNullable<SandpackOptions["visibleFiles"]>;
}
export declare const ModuleList: React.FC<ModuleListProps>;
@@ -0,0 +1,12 @@
import * as React from "react";
export interface SandpackFileExplorerProp {
/**
* enable auto hidden file in file explorer
*
* @description set with hidden property in files property
* @default false
*/
autoHiddenFiles?: boolean;
initialCollapsedFolder?: string[];
}
export declare const SandpackFileExplorer: ({ className, autoHiddenFiles, initialCollapsedFolder, ...props }: SandpackFileExplorerProp & React.HTMLAttributes<HTMLDivElement>) => JSX.Element | null;
@@ -0,0 +1,10 @@
import type { SandpackBundlerFiles } from "@codesandbox/sandpack-client";
export declare const fromPropsToModules: ({ autoHiddenFiles, visibleFiles, files, prefixedPath, }: {
prefixedPath: string;
files: SandpackBundlerFiles;
autoHiddenFiles?: boolean | undefined;
visibleFiles: string[];
}) => {
directories: string[];
modules: string[];
};
@@ -0,0 +1,31 @@
import * as React from "react";
export declare const tabButton: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
[x: string]: string | {
outline: string;
visibility?: undefined;
} | {
visibility: string;
outline?: undefined;
};
padding: string;
height: string;
whiteSpace: string;
"&:focus": {
outline: string;
};
}>;
export interface FileTabsProps {
/**
* This adds a close button next to each file with a unique trigger to close it.
*/
closableTabs?: boolean;
/**
* unique id appended with active files. This is
* used in aria-controls value along the combination of activeFile
*/
activeFileUniqueId?: string;
}
/**
* FileTabs is a list of all open files, the active file, and its state.
*/
export declare const FileTabs: ({ closableTabs, className, activeFileUniqueId, ...props }: FileTabsProps & React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
@@ -0,0 +1,7 @@
import * as React from "react";
export interface NavigatorProps {
clientId: string;
onURLChange?: (newURL: string) => void;
startRoute?: string;
}
export declare const Navigator: ({ clientId, onURLChange, className, startRoute, ...props }: NavigatorProps & React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
@@ -0,0 +1 @@
export declare const splitUrl: (url: string) => string[];
@@ -0,0 +1,30 @@
import type { SandpackClient } from "@codesandbox/sandpack-client";
import * as React from "react";
export interface PreviewProps {
style?: React.CSSProperties;
showNavigator?: boolean;
showOpenInCodeSandbox?: boolean;
showRefreshButton?: boolean;
showRestartButton?: boolean;
/**
* Whether to show the `<ErrorOverlay>` component on top of
* the preview, if a runtime error happens.
*/
showSandpackErrorOverlay?: boolean;
showOpenNewtab?: boolean;
actionsChildren?: JSX.Element;
children?: JSX.Element;
startRoute?: string;
}
export interface SandpackPreviewRef {
/**
* Retrieve the current Sandpack client instance from preview
*/
getClient: () => InstanceType<typeof SandpackClient> | null;
/**
* Returns the client id, which will be used to
* initialize a client in the main Sandpack context
*/
clientId: string;
}
export declare const SandpackPreview: React.ForwardRefExoticComponent<PreviewProps & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<SandpackPreviewRef>>;
@@ -0,0 +1,7 @@
import * as React from "react";
type DevToolsTheme = "dark" | "light" | "auto";
export declare const SandpackReactDevTools: ({ clientId, theme, className, ...props }: {
clientId?: string | undefined;
theme?: DevToolsTheme | undefined;
} & React.HTMLAttributes<HTMLDivElement>) => JSX.Element | null;
export {};
@@ -0,0 +1,10 @@
import * as React from "react";
import type { Test } from "./Tests";
export interface Describe {
name: string;
tests: Record<string, Test>;
describes: Record<string, Describe>;
}
export declare const Describes: React.FC<{
describes: Describe[];
}>;
@@ -0,0 +1,8 @@
import type { TestError } from "@codesandbox/sandpack-client";
import * as React from "react";
interface Props {
error: TestError;
path: string;
}
export declare const FormattedError: React.FC<Props>;
export {};
@@ -0,0 +1,17 @@
import * as React from "react";
import type { Status } from "./SandpackTests";
interface Props {
setVerbose: () => void;
setSuiteOnly: () => void;
verbose: boolean;
suiteOnly: boolean;
status: Status;
watchMode: boolean;
setWatchMode: () => void;
showSuitesOnly: boolean;
showVerboseButton: boolean;
showWatchButton: boolean;
hideTestsAndSupressLogs: boolean;
}
export declare const Header: React.FC<Props>;
export {};
@@ -0,0 +1,4 @@
import * as React from "react";
export declare const RunButton: React.FC<{
onClick: () => void;
}>;
@@ -0,0 +1,17 @@
import * as React from "react";
import type { Spec } from "./Specs";
export type Status = "initialising" | "idle" | "running" | "complete";
export declare const SandpackTests: React.FC<{
verbose?: boolean;
watchMode?: boolean;
onComplete?: (specs: Record<string, Spec>) => void;
actionsChildren?: JSX.Element;
showVerboseButton?: boolean;
showWatchButton?: boolean;
/**
* Hide the tests and supress logs
* If `true` the tests will be hidden and the logs will be supressed. This is useful when you want to run tests in the background and don't want to show the tests to the user.
* @default false
*/
hideTestsAndSupressLogs?: boolean;
} & React.HtmlHTMLAttributes<HTMLDivElement>>;
@@ -0,0 +1,16 @@
import type { TestError } from "@codesandbox/sandpack-client";
import * as React from "react";
import type { Describe } from "./Describes";
import type { Status } from "./SandpackTests";
export type Spec = {
error?: TestError;
} & Describe;
interface Props {
specs: Spec[];
verbose: boolean;
status: Status;
openSpec: (name: string) => void;
hideTestsAndSupressLogs?: boolean;
}
export declare const Specs: React.FC<Props>;
export {};
@@ -0,0 +1,19 @@
import * as React from "react";
export interface TestResults {
pass: number;
fail: number;
skip: number;
total: number;
}
export interface SuiteResults {
pass: number;
fail: number;
total: number;
}
interface Props {
suites: SuiteResults;
tests: TestResults;
duration: number;
}
export declare const Summary: React.FC<Props>;
export {};
@@ -0,0 +1,16 @@
import type { TestError } from "@codesandbox/sandpack-client";
import React from "react";
type TestStatus = "idle" | "running" | "pass" | "fail";
export interface Test {
name: string;
blocks: string[];
status: TestStatus;
path: string;
errors: TestError[];
duration?: number | undefined;
}
interface SandpackTests extends React.HtmlHTMLAttributes<HTMLDivElement> {
tests: Test[];
}
export declare const Tests: React.FC<SandpackTests>;
export {};
@@ -0,0 +1 @@
export { SandpackTests } from "./SandpackTests";
@@ -0,0 +1,36 @@
export declare const setTestTheme: (isDark: boolean) => Record<string, string>;
export declare const passTextClassName: string & {
className: string;
selector: string;
props: {};
};
export declare const failTextClassName: string & {
className: string;
selector: string;
props: {};
};
export declare const skipTextClassName: string & {
className: string;
selector: string;
props: {};
};
export declare const titleTextClassName: string & {
className: string;
selector: string;
props: {};
};
export declare const runBackgroundClassName: string & {
className: string;
selector: string;
props: {};
};
export declare const passBackgroundClassName: string & {
className: string;
selector: string;
props: {};
};
export declare const failBackgroundClassName: string & {
className: string;
selector: string;
props: {};
};
@@ -0,0 +1,13 @@
import type { Describe } from "./Describes";
import type { Spec } from "./Specs";
import type { SuiteResults, TestResults } from "./Summary";
import type { Test } from "./Tests";
export declare const getFailingTests: (block: Describe | Spec) => Test[];
export declare const getAllTestResults: (specs: Spec[]) => TestResults;
export declare const getSpecTestResults: (spec: Spec) => TestResults;
export declare const getAllSuiteResults: (specs: Spec[]) => SuiteResults;
export declare const getDuration: (specs: Spec[]) => number;
export declare const isEmpty: (block: Spec | Describe) => boolean;
export declare const splitTail: <A>(as: A[]) => [A[], A | undefined];
export declare const flatMap: <A, B>(as: A[], f: (a: A) => B[]) => B[];
export declare const set: (path: string[], value: unknown) => <A extends Record<string, any>>(object: A) => A;
@@ -0,0 +1,3 @@
import * as React from "react";
import type { CodeViewerProps } from "../CodeViewer";
export declare const SandpackTranspiledCode: ({ className, ...props }: CodeViewerProps & React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
@@ -0,0 +1,4 @@
/// <reference types="react" />
export declare const DependenciesProgress: React.FC<{
clientId?: string;
}>;
@@ -0,0 +1,5 @@
import * as React from "react";
export type ErrorOverlayProps = React.HTMLAttributes<HTMLDivElement> & {
children?: React.ReactNode;
};
export declare const ErrorOverlay: React.FC<ErrorOverlayProps>;
@@ -0,0 +1,57 @@
import * as React from "react";
export interface SandpackLayoutProps extends React.HtmlHTMLAttributes<unknown> {
children?: React.ReactNode;
}
export declare const layoutClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
[x: string]: string | number | {
flexGrow: number;
flexShrink: number;
flexBasis: string;
height: string;
overflow: string;
"@media print": {
height: string;
display: string;
};
"@media screen and (max-width: 768px)": {
"&:not(.sp-preview, .sp-editor, .sp-preset-column)": {
height: string;
};
minWidth: string;
flex?: undefined;
};
flex?: undefined;
minWidth?: undefined;
} | {
flex: number;
minWidth: number;
"@media screen and (max-width: 768px)": {
flex: number;
"&:not(.sp-preview, .sp-editor, .sp-preset-column)"?: undefined;
minWidth?: undefined;
};
flexGrow?: undefined;
flexShrink?: undefined;
flexBasis?: undefined;
height?: undefined;
overflow?: undefined;
"@media print"?: undefined;
};
border: string;
display: string;
flexWrap: string;
alignItems: string;
borderRadius: string;
overflow: string;
position: string;
backgroundColor: string;
gap: number;
"> .sp-file-explorer": {
flex: number;
minWidth: number;
"@media screen and (max-width: 768px)": {
flex: number;
};
};
}>;
export declare const SandpackLayout: React.ForwardRefExoticComponent<SandpackLayoutProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,4 @@
import * as React from "react";
export declare const Loading: ({ className, showOpenInCodeSandbox, ...props }: React.HTMLAttributes<HTMLDivElement> & {
showOpenInCodeSandbox: boolean;
}) => JSX.Element;
@@ -0,0 +1,11 @@
import * as React from "react";
export interface LoadingOverlayProps {
clientId?: string;
/**
* It enforces keeping the loading state visible,
* which is helpful for external loading states.
*/
loading?: boolean;
showOpenInCodeSandbox: boolean;
}
export declare const LoadingOverlay: React.FC<LoadingOverlayProps & React.HTMLAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
/// <reference types="react" />
export declare const OpenInCodeSandboxButton: () => JSX.Element | null;
@@ -0,0 +1,6 @@
import * as React from "react";
import type { SandpackState } from "../../../types";
export declare const UnstyledOpenInCodeSandboxButton: React.FC<React.HtmlHTMLAttributes<unknown>>;
export declare const ExportToWorkspaceButton: React.FC<React.HtmlHTMLAttributes<unknown> & {
state: SandpackState;
}>;
@@ -0,0 +1,2 @@
export { OpenInCodeSandboxButton } from "./OpenInCodeSandboxButton";
export { UnstyledOpenInCodeSandboxButton } from "./UnstyledOpenInCodeSandboxButton";
@@ -0,0 +1,2 @@
import React from "react";
export declare const RoundedButton: React.FC<React.PropsWithChildren & React.ButtonHTMLAttributes<unknown>>;
@@ -0,0 +1,2 @@
import * as React from "react";
export declare const RunButton: React.FC<React.PropsWithChildren & React.ButtonHTMLAttributes<unknown>>;
@@ -0,0 +1,15 @@
import * as React from "react";
export declare const stackClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
display: string;
flexDirection: string;
width: string;
position: string;
backgroundColor: string;
gap: number;
"&:has(.sp-stack)": {
backgroundColor: string;
};
}>;
export declare const SandpackStack: React.FC<React.HTMLAttributes<HTMLDivElement> & {
children?: React.ReactNode;
}>;
@@ -0,0 +1,8 @@
export * from "./Layout";
export * from "./Stack";
export * from "./ErrorOverlay";
export * from "./LoadingOverlay";
export * from "./OpenInCodeSandboxButton";
export * from "./RunButton";
export * from "./RoundedButton";
export * from "./DependenciesProgress";
@@ -0,0 +1,15 @@
import * as React from "react";
export declare const SignInIcon: () => React.ReactElement;
export declare const SignOutIcon: () => React.ReactElement;
export declare const RestartIcon: () => React.ReactElement;
export declare const RunIcon: () => React.ReactElement;
export declare const BackwardIcon: () => React.ReactElement;
export declare const ForwardIcon: () => React.ReactElement;
export declare const RefreshIcon: () => React.ReactElement;
export declare const CleanIcon: () => React.ReactElement;
export declare const ExportIcon: () => React.ReactElement;
export declare const DirectoryIconOpen: () => React.ReactElement;
export declare const DirectoryIconClosed: () => React.ReactElement;
export declare const FileIcon: () => React.ReactElement;
export declare const CloseIcon: () => React.ReactElement;
export declare const ConsoleIcon: () => React.ReactElement;
+9
View File
@@ -0,0 +1,9 @@
export * from "./CodeEditor";
export * from "./CodeViewer";
export * from "./FileExplorer";
export * from "./FileTabs";
export * from "./Navigator";
export * from "./Preview";
export * from "./TranspiledCode";
export * from "./Tests";
export * from "./Console";
@@ -0,0 +1,9 @@
import * as React from "react";
import type { SandpackContext, SandpackProviderProps } from "../types";
declare const Sandpack: React.Context<SandpackContext | null>;
export declare const SandpackProvider: React.FC<SandpackProviderProps>;
/**
* @category Provider
*/
declare const SandpackConsumer: React.Consumer<SandpackContext | null>;
export { SandpackConsumer, Sandpack as SandpackReactContext };
@@ -0,0 +1,8 @@
import type { SandpackBundlerFiles } from "@codesandbox/sandpack-client";
import type { SandpackProviderProps } from "../..";
interface SandpackAppState {
editorState: "pristine" | "dirty";
}
type UseAppState = (props: SandpackProviderProps, files: SandpackBundlerFiles) => SandpackAppState;
export declare const useAppState: UseAppState;
export {};
@@ -0,0 +1,32 @@
/// <reference types="react" />
import type { BundlerState, ListenerFunction, ReactDevToolsMode, SandpackError, SandpackMessage, UnsubscribeFunction, SandpackClient } from "@codesandbox/sandpack-client";
import type { SandpackInitMode, SandpackProviderProps, SandpackStatus } from "../..";
import type { FilesState } from "./useFiles";
type SandpackClientType = InstanceType<typeof SandpackClient>;
interface SandpackConfigState {
reactDevTools?: ReactDevToolsMode;
startRoute?: string;
initMode: SandpackInitMode;
bundlerState: BundlerState | undefined;
error: SandpackError | null;
status: SandpackStatus;
}
export interface ClientPropsOverride {
startRoute?: string;
}
export interface UseClientOperations {
clients: Record<string, SandpackClientType>;
initializeSandpackIframe: () => void;
runSandpack: () => Promise<void>;
unregisterBundler: (clientId: string) => void;
registerBundler: (iframe: HTMLIFrameElement, clientId: string, clientPropsOverride?: ClientPropsOverride) => Promise<void>;
registerReactDevTools: (value: ReactDevToolsMode) => void;
addListener: (listener: ListenerFunction, clientId?: string) => UnsubscribeFunction;
dispatchMessage: (message: SandpackMessage, clientId?: string) => void;
lazyAnchorRef: React.RefObject<HTMLDivElement>;
unsubscribeClientListenersRef: React.MutableRefObject<Record<string, Record<string, UnsubscribeFunction>>>;
queuedListenersRef: React.MutableRefObject<Record<string, Record<string, ListenerFunction>>>;
}
type UseClient = (props: SandpackProviderProps, filesState: FilesState) => [SandpackConfigState, UseClientOperations];
export declare const useClient: UseClient;
export {};
@@ -0,0 +1,28 @@
import type { SandpackBundlerFiles } from "@codesandbox/sandpack-client";
import type { SandboxEnvironment, SandpackFiles, SandpackPredefinedTemplate, SandpackProviderProps, TemplateFiles } from "../..";
export interface FilesState {
files: SandpackBundlerFiles;
environment?: SandboxEnvironment;
visibleFiles: Array<TemplateFiles<SandpackPredefinedTemplate> | string>;
activeFile: TemplateFiles<SandpackPredefinedTemplate> | string;
shouldUpdatePreview: boolean;
}
interface FilesOperations {
openFile: (path: string) => void;
resetFile: (path: string) => void;
resetAllFiles: () => void;
setActiveFile: (path: string) => void;
updateCurrentFile: (code: string, shouldUpdatePreview?: boolean) => void;
updateFile: (pathOrFiles: string | SandpackFiles, code?: string, shouldUpdatePreview?: boolean) => void;
addFile: (pathOrFiles: string | SandpackFiles, code?: string, shouldUpdatePreview?: boolean) => void;
closeFile: (path: string) => void;
deleteFile: (path: string, shouldUpdatePreview?: boolean) => void;
}
export type UseFiles = (props: SandpackProviderProps) => [
FilesState & {
visibleFilesFromProps: Array<TemplateFiles<SandpackPredefinedTemplate> | string>;
},
FilesOperations
];
export declare const useFiles: UseFiles;
export {};
+11
View File
@@ -0,0 +1,11 @@
export * from "./useActiveCode";
export * from "./useErrorMessage";
export * from "./useLoadingOverlayState";
export * from "./useSandpack";
export * from "./useSandpackNavigation";
export * from "./useSandpackTheme";
export * from "./useTranspiledCode";
export * from "./useSandpackClient";
export * from "./useSandpackShell";
export * from "./useSandpackPreviewProgress";
export * from "./useSandpackShellStdout";
+11
View File
@@ -0,0 +1,11 @@
/**
* This returns the current state of the active file
* and a method to update its content.
*
* @category Hooks
*/
export declare const useActiveCode: () => {
code: string;
readOnly: boolean;
updateCode: (newCode: string, shouldUpdatePreview?: boolean) => void;
};
@@ -0,0 +1,4 @@
/**
* @category Hooks
*/
export declare const useErrorMessage: () => string | null;
@@ -0,0 +1,6 @@
export type LoadingOverlayState = "LOADING" | "PRE_FADING" | "FADING" | "HIDDEN" | "TIMEOUT";
export declare const FADE_ANIMATION_DURATION = 200;
/**
* @category Hooks
*/
export declare const useLoadingOverlayState: (clientId?: string, externalLoading?: boolean) => LoadingOverlayState;
+13
View File
@@ -0,0 +1,13 @@
import type { SandpackClientDispatch, SandpackClientListen, SandpackState } from "../types";
/**
* @category Hooks
*/
export interface UseSandpack {
sandpack: SandpackState;
dispatch: SandpackClientDispatch;
listen: SandpackClientListen;
}
/**
* @category Hooks
*/
export declare function useSandpack(): UseSandpack;
@@ -0,0 +1,22 @@
import type { ListenerFunction, SandpackClient, SandpackMessage, UnsubscribeFunction } from "@codesandbox/sandpack-client";
import * as React from "react";
import type { ClientPropsOverride } from "../contexts/utils/useClient";
import type { SandpackState } from "../types";
interface UseSandpackClient {
sandpack: SandpackState;
getClient: () => InstanceType<typeof SandpackClient> | null;
iframe: React.MutableRefObject<HTMLIFrameElement | null>;
listen: (listener: ListenerFunction) => UnsubscribeFunction;
dispatch: (message: SandpackMessage) => void;
clientId: string;
}
/**
* It registers a new sandpack client and returns its instance,
* listeners, and dispatch function. Using it when creating a custom
* component to interact directly with the client is recommended.
* For other cases, use `useSandpack` instead.
*
* @category Hooks
*/
export declare const useSandpackClient: (clientPropsOverride?: ClientPropsOverride) => UseSandpackClient;
export {};
@@ -0,0 +1,8 @@
/**
* @category Hooks
*/
export declare const useSandpackNavigation: (clientId?: string) => {
refresh: () => void;
back: () => void;
forward: () => void;
};
@@ -0,0 +1,4 @@
export declare const useSandpackPreviewProgress: (props: {
timeout?: number | undefined;
clientId?: string | undefined;
} | undefined) => string | null;
@@ -0,0 +1,7 @@
/**
* @category Hooks
*/
export declare const useSandpackShell: (clientId?: string) => {
restart: () => void;
openPreview: () => void;
};
@@ -0,0 +1,11 @@
export declare const useSandpackShellStdout: ({ clientId, maxMessageCount, resetOnPreviewRestart, }: {
clientId?: string | undefined;
maxMessageCount?: number | undefined;
resetOnPreviewRestart?: boolean | undefined;
}) => {
logs: Array<{
id: string;
data: string;
}>;
reset: () => void;
};
@@ -0,0 +1,9 @@
import type { SandpackTheme } from "../types";
/**
* @category Hooks
*/
export declare const useSandpackTheme: () => {
theme: SandpackTheme;
themeId: string;
themeMode: "dark" | "light" | "auto";
};
@@ -0,0 +1,4 @@
/**
* @category Hooks
*/
export declare const useTranspiledCode: () => string | null;
+12
View File
@@ -0,0 +1,12 @@
export * from "./components/icons";
export * from "./components";
export * from "./components/common";
export * from "./hooks";
export { useClassNames } from "./utils/classNames";
export { getCssText as getSandpackCssText } from "./styles";
export * from "./styles/themeContext";
export * from "./contexts/sandpackContext";
export * from "./presets/";
export * from "./themes";
export * from "./types";
export * from "./templates";
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2
View File
@@ -0,0 +1,2 @@
import type { SandpackInternal } from "../types";
export declare const Sandpack: SandpackInternal;
+1
View File
@@ -0,0 +1 @@
export * from "./Sandpack";
+1
View File
@@ -0,0 +1 @@
export {};
+93
View File
@@ -0,0 +1,93 @@
import type { SandpackTheme, SandpackThemeProp } from "../types";
/**
* @category Theme
*/
export declare const THEME_PREFIX = "sp";
/**
* @category Theme
*/
export declare const createTheme: (<Argument0 extends string | ({} & {
[x: string]: {
[x: string]: string | number | boolean;
[x: number]: string | number | boolean;
};
}), Argument1 extends string | ({} & {
[x: string]: {
[x: string]: string | number | boolean;
[x: number]: string | number | boolean;
};
})>(nameOrScalesArg0: Argument0, nameOrScalesArg1?: Argument1 | undefined) => string & {
className: string;
selector: string;
} & (Argument0 extends string ? import("@stitches/core/types/stitches").ThemeTokens<Argument1, ""> : import("@stitches/core/types/stitches").ThemeTokens<Argument0, "">)) | (<Argument0_1 extends string | ({} & {
[x: string]: {
[x: string]: string | number | boolean;
[x: number]: string | number | boolean;
};
}), Argument1_1 extends string | ({} & {
[x: string]: {
[x: string]: string | number | boolean;
[x: number]: string | number | boolean;
};
})>(nameOrScalesArg0: Argument0_1, nameOrScalesArg1?: Argument1_1 | undefined) => string & {
className: string;
selector: string;
} & (Argument0_1 extends string ? import("@stitches/core/types/stitches").ThemeTokens<Argument1_1, "sp"> : import("@stitches/core/types/stitches").ThemeTokens<Argument0_1, "sp">)), css: (<Composers extends (string | import("@stitches/core/types/util").Function | {
[name: string]: unknown;
})[], CSS = import("@stitches/core/types/css-util").CSS<{}, {}, {}, {}>>(...composers: { [K in keyof Composers]: string extends Composers[K] ? Composers[K] : Composers[K] extends string | import("@stitches/core/types/util").Function ? Composers[K] : import("@stitches/core/types/stitches").RemoveIndex<CSS> & {
variants?: {
[x: string]: {
[x: string]: CSS;
[x: number]: CSS;
};
} | undefined;
compoundVariants?: (("variants" extends keyof Composers[K] ? { [Name in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/core/types/util").String | import("@stitches/core/types/util").Widen<keyof Composers[K][keyof Composers[K] & "variants"][Name]> | undefined; } : import("@stitches/core/types/util").WideObject) & {
css: CSS;
})[] | undefined;
defaultVariants?: ("variants" extends keyof Composers[K] ? { [Name_1 in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/core/types/util").String | import("@stitches/core/types/util").Widen<keyof Composers[K][keyof Composers[K] & "variants"][Name_1]> | undefined; } : import("@stitches/core/types/util").WideObject) | undefined;
} & CSS & { [K2 in keyof Composers[K]]: K2 extends "compoundVariants" | "defaultVariants" | "variants" ? unknown : K2 extends keyof CSS ? CSS[K2] : unknown; }; }) => import("@stitches/core/types/styled-component").CssComponent<import("@stitches/core/types/styled-component").StyledComponentType<Composers>, import("@stitches/core/types/styled-component").StyledComponentProps<Composers>, {}, CSS>) | (<Composers_1 extends (string | import("@stitches/core/types/util").Function | {
[name: string]: unknown;
})[], CSS_1 = import("@stitches/core/types/css-util").CSS<{}, {}, import("@stitches/core/types/config").DefaultThemeMap, {}>>(...composers: { [K_1 in keyof Composers_1]: string extends Composers_1[K_1] ? Composers_1[K_1] : Composers_1[K_1] extends string | import("@stitches/core/types/util").Function ? Composers_1[K_1] : import("@stitches/core/types/stitches").RemoveIndex<CSS_1> & {
variants?: {
[x: string]: {
[x: string]: CSS_1;
[x: number]: CSS_1;
};
} | undefined;
compoundVariants?: (("variants" extends keyof Composers_1[K_1] ? { [Name_2 in keyof Composers_1[K_1][keyof Composers_1[K_1] & "variants"]]?: import("@stitches/core/types/util").String | import("@stitches/core/types/util").Widen<keyof Composers_1[K_1][keyof Composers_1[K_1] & "variants"][Name_2]> | undefined; } : import("@stitches/core/types/util").WideObject) & {
css: CSS_1;
})[] | undefined;
defaultVariants?: ("variants" extends keyof Composers_1[K_1] ? { [Name_3 in keyof Composers_1[K_1][keyof Composers_1[K_1] & "variants"]]?: import("@stitches/core/types/util").String | import("@stitches/core/types/util").Widen<keyof Composers_1[K_1][keyof Composers_1[K_1] & "variants"][Name_3]> | undefined; } : import("@stitches/core/types/util").WideObject) | undefined;
} & CSS_1 & { [K2_1 in keyof Composers_1[K_1]]: K2_1 extends "compoundVariants" | "defaultVariants" | "variants" ? unknown : K2_1 extends keyof CSS_1 ? CSS_1[K2_1] : unknown; }; }) => import("@stitches/core/types/styled-component").CssComponent<import("@stitches/core/types/styled-component").StyledComponentType<Composers_1>, import("@stitches/core/types/styled-component").StyledComponentProps<Composers_1>, {}, CSS_1>), getCssText: () => string, keyframes: ((style: {
[offset: string]: import("@stitches/core/types/css-util").CSS<{}, {}, {}, {}>;
}) => {
(): string;
name: string;
}) | ((style: {
[offset: string]: import("@stitches/core/types/css-util").CSS<{}, {}, import("@stitches/core/types/config").DefaultThemeMap, {}>;
}) => {
(): string;
name: string;
});
/**
* @category Theme
*/
export declare const standardizeStitchesTheme: (theme: SandpackTheme) => Record<string, Record<string, string>>;
/**
* @category Theme
*/
export declare const standardizeTheme: (inputTheme?: SandpackThemeProp) => {
id: string;
theme: SandpackTheme;
mode: "dark" | "light";
};
/**
* The fake `css` function used to match the real `css` function usage
* We use this for the unstyled bundle which do not need real class names
* `css` is a factory which return a className generator, but also it be used in scenarios which `toString` will be invoked
* so we also need to add the `toString` method to it.
*/
export declare const fakeCss: {
(): string;
toString: any;
};
+130
View File
@@ -0,0 +1,130 @@
export declare const iconStandaloneClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
svg: {
margin: string;
};
}>;
export declare const buttonClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
[x: string]: string | number | {
color: string;
minWidth?: undefined;
width?: undefined;
height?: undefined;
padding?: undefined;
display?: undefined;
paddingRight?: undefined;
paddingLeft?: undefined;
gap?: undefined;
} | {
minWidth: string;
width: string;
height: string;
color?: undefined;
padding?: undefined;
display?: undefined;
paddingRight?: undefined;
paddingLeft?: undefined;
gap?: undefined;
} | {
padding: string;
height: string;
display: string;
color?: undefined;
minWidth?: undefined;
width?: undefined;
paddingRight?: undefined;
paddingLeft?: undefined;
gap?: undefined;
} | {
width: string;
color?: undefined;
minWidth?: undefined;
height?: undefined;
padding?: undefined;
display?: undefined;
paddingRight?: undefined;
paddingLeft?: undefined;
gap?: undefined;
} | {
paddingRight: string;
paddingLeft: string;
gap: string;
color?: undefined;
minWidth?: undefined;
width?: undefined;
height?: undefined;
padding?: undefined;
display?: undefined;
};
appearance: string;
outline: string;
display: string;
alignItems: string;
fontSize: string;
fontFamily: string;
backgroundColor: string;
transition: string;
cursor: string;
color: string;
border: number;
textDecoration: string;
"&:disabled": {
color: string;
};
"&:hover:not(:disabled,[data-active='true'])": {
color: string;
};
'&[data-active="true"]': {
color: string;
};
svg: {
minWidth: string;
width: string;
height: string;
};
}>;
export declare const roundedButtonClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
backgroundColor: string;
borderRadius: string;
border: string;
'&[data-active="true"]': {
color: string;
background: string;
};
"&:hover:not(:disabled,[data-active='true'])": {
backgroundColor: string;
};
}>;
export declare const iconClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
padding: number;
}>;
export declare const fadeIn: {
(): string;
name: string;
};
export declare const absoluteClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
position: string;
bottom: string;
left: string;
right: string;
top: string;
margin: string;
overflow: string;
height: string;
zIndex: string;
}>;
export declare const errorClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
backgroundColor: string;
}>;
export declare const errorBundlerClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
[x: string]: string | {
marginTop: string;
width: string;
gap: string;
padding: string;
};
padding: string;
backgroundColor: string;
}>;
export declare const errorMessageClassName: import("@stitches/core/types/styled-component").CssComponent<never, {}, {}, {
fontFamily: string;
}>;
@@ -0,0 +1,2 @@
import type Stitches from "@stitches/core/types/stitches";
export declare const createStitchesMock: Stitches<"", {}, {}, {}, {}>;
+20
View File
@@ -0,0 +1,20 @@
import * as React from "react";
import type { SandpackTheme, SandpackThemeProp } from "../types";
declare const SandpackThemeContext: React.Context<{
theme: SandpackTheme;
id: string;
mode: "dark" | "light" | "auto";
}>;
/**
* @category Theme
*/
declare const SandpackThemeProvider: React.FC<React.HTMLAttributes<HTMLDivElement> & {
theme?: SandpackThemeProp;
children?: React.ReactNode;
}>;
declare const SandpackThemeConsumer: React.Consumer<{
theme: SandpackTheme;
id: string;
mode: "dark" | "light" | "auto";
}>;
export { SandpackThemeProvider, SandpackThemeConsumer, SandpackThemeContext };
+5
View File
@@ -0,0 +1,5 @@
export declare const commonFiles: {
"/styles.css": {
code: string;
};
};
+548
View File
@@ -0,0 +1,548 @@
export { ASTRO_TEMPLATE } from "./node/astro";
export { ANGULAR_TEMPLATE } from "./runtime/angular";
export { REACT_TEMPLATE } from "./runtime/react";
export { REACT_TYPESCRIPT_TEMPLATE } from "./runtime/react-typescript";
export { SOLID_TEMPLATE } from "./runtime/solid";
export { SVELTE_TEMPLATE } from "./runtime/svelte";
export { TEST_TYPESCRIPT_TEMPLATE } from "./runtime/tests-ts";
export { VANILLA_TEMPLATE } from "./runtime/vanilla";
export { VANILLA_TYPESCRIPT_TEMPLATE } from "./runtime/vanilla-typescript";
export { VUE_TEMPLATE } from "./runtime/vue";
export declare const SANDBOX_TEMPLATES: {
static: {
files: {
"/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
angular: {
files: {
"/src/app/app.component.css": {
code: string;
};
"/src/app/app.component.html": {
code: string;
};
"/src/app/app.component.ts": {
code: string;
};
"/src/app/app.module.ts": {
code: string;
};
"/src/index.html": {
code: string;
};
"/src/main.ts": {
code: string;
};
"/src/polyfills.ts": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
react: {
files: {
"/App.js": {
code: string;
};
"/index.js": {
code: string;
};
"/public/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
"react-ts": {
files: {
"tsconfig.json": {
code: string;
};
"/App.tsx": {
code: string;
};
"/index.tsx": {
code: string;
};
"/public/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
solid: {
files: {
"/App.tsx": {
code: string;
};
"/index.tsx": {
code: string;
};
"/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
svelte: {
files: {
"/App.svelte": {
code: string;
};
"/index.js": {
code: string;
};
"/public/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
"test-ts": {
files: {
"tsconfig.json": {
code: string;
};
"/add.ts": {
code: string;
};
"/add.test.ts": {
code: string;
};
"package.json": {
code: string;
};
};
main: string;
environment: string;
mode: string;
};
"vanilla-ts": {
files: {
"tsconfig.json": {
code: string;
};
"/index.ts": {
code: string;
};
"/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
vanilla: {
files: {
"/index.js": {
code: string;
};
"/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
vue: {
files: {
"/src/styles.css": {
code: string;
};
"/src/App.vue": {
code: string;
};
"/src/main.js": {
code: string;
};
"/public/index.html": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
"vue-ts": {
files: {
"/src/styles.css": {
code: string;
};
"/src/App.vue": {
code: string;
};
"/src/main.ts": {
code: string;
};
"/src/shims-vue.d.ts": string;
"/public/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/tsconfig.json": {
code: string;
};
};
main: string;
environment: string;
};
node: {
files: {
"/index.js": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
nextjs: {
files: {
"/pages/_app.js": {
code: string;
};
"/pages/index.js": {
code: string;
};
"/next.config.js": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
vite: {
files: {
"/index.js": {
code: string;
};
"/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
"vite-react": {
files: {
"/App.jsx": {
code: string;
};
"/index.jsx": {
code: string;
};
"/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/vite.config.js": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
"vite-react-ts": {
files: {
"/App.tsx": {
code: string;
};
"/index.tsx": {
code: string;
};
"/index.html": {
code: string;
};
"/tsconfig.json": {
code: string;
};
"/tsconfig.node.json": {
code: string;
};
"/package.json": {
code: string;
};
"/vite-env.d.ts": {
code: string;
};
"/vite.config.ts": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
"vite-preact": {
files: {
"/App.jsx": {
code: string;
};
"/index.jsx": {
code: string;
};
"/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/vite.config.js": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
"vite-preact-ts": {
files: {
"/App.tsx": {
code: string;
};
"/index.tsx": {
code: string;
};
"/index.html": {
code: string;
};
"/tsconfig.json": {
code: string;
};
"/tsconfig.node.json": {
code: string;
};
"/package.json": {
code: string;
};
"/vite-env.d.ts": {
code: string;
};
"/vite.config.ts": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
"vite-vue": {
files: {
"/src/styles.css": {
code: string;
};
"/src/App.vue": {
code: string;
};
"/src/main.js": {
code: string;
};
"/index.html": {
code: string;
};
"/vite.config.js": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
"vite-vue-ts": {
files: {
"/src/styles.css": {
code: string;
};
"/src/App.vue": {
code: string;
};
"/src/main.ts": {
code: string;
};
"/index.html": {
code: string;
};
"/vite-env.d.ts": {
code: string;
};
"/vite.config.ts": {
code: string;
};
"tsconfig.json": {
code: string;
};
"tsconfig.node.json": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
"vite-svelte": {
files: {
"/src/styles.css": {
code: string;
};
"/src/App.svelte": {
code: string;
};
"/src/main.js": {
code: string;
};
"/index.html": {
code: string;
};
"/vite.config.js": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
"vite-svelte-ts": {
files: {
"/src/styles.css": {
code: string;
};
"/src/App.svelte": {
code: string;
};
"/src/main.ts": {
code: string;
};
"/index.html": {
code: string;
};
"/vite-env.d.ts": {
code: string;
};
"svelte.config.js": {
code: string;
};
"/vite.config.ts": {
code: string;
};
"tsconfig.json": {
code: string;
};
"tsconfig.node.json": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
astro: {
files: {
"/src/styles.css": {
code: string;
};
"/src/pages/index.astro": {
code: string;
};
".env": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
};
@@ -0,0 +1,21 @@
/**
* @hidden
*/
export declare const ASTRO_TEMPLATE: {
files: {
"/src/styles.css": {
code: string;
};
"/src/pages/index.astro": {
code: string;
};
".env": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,21 @@
export declare const NEXTJS_TEMPLATE: {
files: {
"/pages/_app.js": {
code: string;
};
"/pages/index.js": {
code: string;
};
"/next.config.js": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
+12
View File
@@ -0,0 +1,12 @@
export declare const NODE_TEMPLATE: {
files: {
"/index.js": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,33 @@
export declare const VITE_PREACT_TS_TEMPLATE: {
files: {
"/App.tsx": {
code: string;
};
"/index.tsx": {
code: string;
};
"/index.html": {
code: string;
};
"/tsconfig.json": {
code: string;
};
"/tsconfig.node.json": {
code: string;
};
"/package.json": {
code: string;
};
"/vite-env.d.ts": {
code: string;
};
"/vite.config.ts": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,24 @@
export declare const VITE_PREACT_TEMPLATE: {
files: {
"/App.jsx": {
code: string;
};
"/index.jsx": {
code: string;
};
"/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/vite.config.js": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,33 @@
export declare const VITE_REACT_TS_TEMPLATE: {
files: {
"/App.tsx": {
code: string;
};
"/index.tsx": {
code: string;
};
"/index.html": {
code: string;
};
"/tsconfig.json": {
code: string;
};
"/tsconfig.node.json": {
code: string;
};
"/package.json": {
code: string;
};
"/vite-env.d.ts": {
code: string;
};
"/vite.config.ts": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,24 @@
export declare const VITE_REACT_TEMPLATE: {
files: {
"/App.jsx": {
code: string;
};
"/index.jsx": {
code: string;
};
"/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/vite.config.js": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,36 @@
export declare const VITE_SVELTE_TS_TEMPLATE: {
files: {
"/src/styles.css": {
code: string;
};
"/src/App.svelte": {
code: string;
};
"/src/main.ts": {
code: string;
};
"/index.html": {
code: string;
};
"/vite-env.d.ts": {
code: string;
};
"svelte.config.js": {
code: string;
};
"/vite.config.ts": {
code: string;
};
"tsconfig.json": {
code: string;
};
"tsconfig.node.json": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,24 @@
export declare const VITE_SVELTE_TEMPLATE: {
files: {
"/src/styles.css": {
code: string;
};
"/src/App.svelte": {
code: string;
};
"/src/main.js": {
code: string;
};
"/index.html": {
code: string;
};
"/vite.config.js": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,33 @@
export declare const VITE_VUE_TS_TEMPLATE: {
files: {
"/src/styles.css": {
code: string;
};
"/src/App.vue": {
code: string;
};
"/src/main.ts": {
code: string;
};
"/index.html": {
code: string;
};
"/vite-env.d.ts": {
code: string;
};
"/vite.config.ts": {
code: string;
};
"tsconfig.json": {
code: string;
};
"tsconfig.node.json": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,24 @@
export declare const VITE_VUE_TEMPLATE: {
files: {
"/src/styles.css": {
code: string;
};
"/src/App.vue": {
code: string;
};
"/src/main.js": {
code: string;
};
"/index.html": {
code: string;
};
"/vite.config.js": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
+18
View File
@@ -0,0 +1,18 @@
export declare const VITE_TEMPLATE: {
files: {
"/index.js": {
code: string;
};
"/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,30 @@
export declare const ANGULAR_TEMPLATE: {
files: {
"/src/app/app.component.css": {
code: string;
};
"/src/app/app.component.html": {
code: string;
};
"/src/app/app.component.ts": {
code: string;
};
"/src/app/app.module.ts": {
code: string;
};
"/src/index.html": {
code: string;
};
"/src/main.ts": {
code: string;
};
"/src/polyfills.ts": {
code: string;
};
"/package.json": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,24 @@
export declare const REACT_TYPESCRIPT_TEMPLATE: {
files: {
"tsconfig.json": {
code: string;
};
"/App.tsx": {
code: string;
};
"/index.tsx": {
code: string;
};
"/public/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};
@@ -0,0 +1,21 @@
export declare const REACT_TEMPLATE: {
files: {
"/App.js": {
code: string;
};
"/index.js": {
code: string;
};
"/public/index.html": {
code: string;
};
"/package.json": {
code: string;
};
"/styles.css": {
code: string;
};
};
main: string;
environment: string;
};

Some files were not shown because too many files have changed in this diff Show More