deploy: v0.12 存档迁移+考古日志滚动条

This commit is contained in:
2026-06-24 03:04:38 +00:00
parent 4831505ef9
commit b4c6111516
58986 changed files with 7569452 additions and 31667 deletions
@@ -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 {};