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
+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;