@xiongtao.xt/tau-plugins 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/client/chunk-PZ6FG7OR.js +289 -0
- package/docs/README.md +4 -2
- package/docs/api-support.md +71 -0
- package/docs/editor.md +3 -3
- package/docs/getting-started.md +25 -117
- package/docs/plugin-basics.md +11 -9
- package/docs/portability.md +107 -0
- package/docs/release.md +2 -0
- package/docs/storage-and-network.md +2 -0
- package/docs/ui.md +5 -1
- package/docs/user-data.md +2 -0
- package/package.json +5 -1
- package/portable.js +27 -0
- package/publish-artifacts.js +68 -4
- package/types/packages/editor/src/core/api/index.d.ts +4 -1
- package/types/packages/editor/src/core/components/EditorContextMenu/types.d.ts +35 -0
- package/types/packages/editor/src/core/components/ExtensionLayers/index.d.ts +17 -0
- package/types/packages/editor/src/core/hooks/useDragHandlerMenu.d.ts +39 -0
- package/types/packages/editor/src/core/kit/EditorKit.d.ts +39 -0
- package/types/packages/editor/src/core/kit/ExtensionAssembly.d.ts +81 -0
- package/types/packages/editor/src/core/kit/context.d.ts +21 -0
- package/types/packages/editor/src/core/menu/resolveMenu.d.ts +19 -0
- package/types/packages/editor/src/core/services/elementEditingPolicy.d.ts +6 -0
- package/types/packages/editor/src/core/utils/nodeOperations.d.ts +2 -2
- package/types/packages/plugins/src/capabilities.d.ts +7 -0
- package/types/packages/plugins/src/contract.d.ts +4 -0
- package/types/packages/plugins/src/environment.d.ts +37 -0
- package/types/packages/plugins/src/index.d.ts +3 -0
- package/types/packages/plugins/src/navigation.d.ts +14 -0
- package/types/packages/plugins/src/pages.d.ts +2 -0
- package/types/packages/plugins/src/portable.d.ts +67 -0
- package/types/packages/plugins/src/publish-artifacts.d.ts +8 -3
- package/types/packages/plugins/src/render-artifact.d.ts +2 -1
- package/types/packages/plugins/src/rendering.d.ts +78 -0
- package/types/packages/themes/src/themes/paper.theme.d.ts +1 -1
- package/types/packages/ui/src/UiHostProvider.d.ts +13 -0
- package/types/packages/ui/src/index.d.ts +1 -0
- package/types/packages/ui/src/primitives/Tabs.d.ts +3 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** 宿主按场景限制节点编辑,未注册时沿用编辑器自身只读状态。 */
|
|
2
|
+
export interface ElementEditingPolicy {
|
|
3
|
+
canEdit(type: string): boolean;
|
|
4
|
+
sourcePresentation?: "pointer" | "touch";
|
|
5
|
+
}
|
|
6
|
+
export declare const IElementEditingPolicy: import("../../../../shared/service-contract").ServiceIdentifier<ElementEditingPolicy>;
|
|
@@ -2,9 +2,9 @@ import { Editor, Node, Path } from "slate";
|
|
|
2
2
|
import type { EditorFeedback } from "../services/notifier";
|
|
3
3
|
/**
|
|
4
4
|
* 复制节点到剪贴板
|
|
5
|
-
* 支持两种格式:JSON
|
|
5
|
+
* 支持两种格式:JSON 和纯文本;传入数组时按数组顺序作为一个 fragment,纯文本以换行连接
|
|
6
6
|
*/
|
|
7
|
-
export declare function copyNodeToClipboard(_editor: Editor, element: Node, message?: EditorFeedback, options?: {
|
|
7
|
+
export declare function copyNodeToClipboard(_editor: Editor, element: Node | Node[], message?: EditorFeedback, options?: {
|
|
8
8
|
allowPlainTextFallback?: boolean;
|
|
9
9
|
signal?: AbortSignal;
|
|
10
10
|
}): Promise<boolean>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** 功能名只表示是否可用;接口升级由 SDK 和最低客户端版本管理。 */
|
|
2
|
+
export declare const PLUGIN_CAPABILITIES: readonly ["commands", "storage", "pages", "navigation", "settings", "dialogs", "editor", "editorCodecs", "sourceEditor", "runtimeStyles", "media"];
|
|
3
|
+
export type PluginCapability = (typeof PLUGIN_CAPABILITIES)[number];
|
|
4
|
+
/** 保留分发清单原值,未知可选功能可读取但不能当作已实现功能。 */
|
|
5
|
+
export declare function readPluginCapabilityNames(value: unknown): readonly string[];
|
|
6
|
+
export declare function isPluginCapability(value: unknown): value is PluginCapability;
|
|
7
|
+
export declare function readPluginCapabilities(value: unknown): readonly PluginCapability[];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { PluginPages } from "./pages";
|
|
2
|
+
import type { PluginEnvironment } from "./environment";
|
|
3
|
+
import type { PluginNavigation } from "./navigation";
|
|
2
4
|
import type { PluginAI, PluginAIFeature } from "./ai";
|
|
3
5
|
import type { WhiteboardExtension } from "./whiteboard";
|
|
4
6
|
import type { PluginServices } from "./services";
|
|
@@ -47,6 +49,8 @@ export interface PluginCommand {
|
|
|
47
49
|
run(input: JsonValue): JsonValue | Promise<JsonValue>;
|
|
48
50
|
}
|
|
49
51
|
export interface PluginContext {
|
|
52
|
+
readonly environment: PluginEnvironment;
|
|
53
|
+
readonly navigation: PluginNavigation;
|
|
50
54
|
readonly backend: PluginBackendClient;
|
|
51
55
|
readonly pluginId: string;
|
|
52
56
|
readonly workspaceId: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface PluginEnvironment {
|
|
3
|
+
readonly platform: "desktop" | "android" | "ios" | "web";
|
|
4
|
+
/** WebView 报告的可用指针精度,不代表当前输入设备或悬停能力。 */
|
|
5
|
+
readonly input: Readonly<{
|
|
6
|
+
coarsePointer: boolean;
|
|
7
|
+
finePointer: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export interface PluginEnvironmentSource {
|
|
11
|
+
getSnapshot(): PluginEnvironment;
|
|
12
|
+
subscribe(listener: () => void): () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function createPluginEnvironmentStore(initial: PluginEnvironment): Readonly<{
|
|
15
|
+
getSnapshot: () => PluginEnvironment;
|
|
16
|
+
subscribe: (listener: () => void) => () => void;
|
|
17
|
+
update(patch: Partial<Pick<PluginEnvironment, "input">>): void;
|
|
18
|
+
}>;
|
|
19
|
+
/** 平台由宿主提供,输入信息来自媒体查询。 */
|
|
20
|
+
export declare function createBrowserPluginEnvironment(platform: PluginEnvironment["platform"], viewport: Window): {
|
|
21
|
+
connect(): () => void;
|
|
22
|
+
getSnapshot: () => PluginEnvironment;
|
|
23
|
+
subscribe: (listener: () => void) => () => void;
|
|
24
|
+
update: (patch: Partial<Pick<PluginEnvironment, "input">>) => void;
|
|
25
|
+
};
|
|
26
|
+
export declare function PluginEnvironmentProvider(props: {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
} & ({
|
|
29
|
+
source: PluginEnvironmentSource;
|
|
30
|
+
value?: never;
|
|
31
|
+
} | {
|
|
32
|
+
value: PluginEnvironment;
|
|
33
|
+
source?: never;
|
|
34
|
+
})): import("react").FunctionComponentElement<import("react").ProviderProps<PluginEnvironmentSource | undefined>>;
|
|
35
|
+
/** 静态内容组件也由宿主注入环境,不依赖插件 activate。 */
|
|
36
|
+
export declare function usePluginEnvironment(): PluginEnvironment;
|
|
37
|
+
export declare function snapshotPluginEnvironment(value: PluginEnvironment): PluginEnvironment;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { PluginDefinition } from "./contract";
|
|
2
|
+
export { usePluginEnvironment } from "./environment";
|
|
3
|
+
export type { PluginEnvironment } from "./environment";
|
|
4
|
+
export type { PluginNavigation, PluginNavigationEntry } from "./navigation";
|
|
2
5
|
export type { PluginBackendClient, BackendStatus, BackendState } from "./backend";
|
|
3
6
|
export type * from "./upload";
|
|
4
7
|
export type * from "./tts";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Disposable } from "./contract";
|
|
2
|
+
import type { PluginIcon } from "./icons";
|
|
3
|
+
import type { PluginPageHandle, PluginPageParams } from "./pages";
|
|
4
|
+
export interface PluginNavigationEntry {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
icon?: PluginIcon;
|
|
8
|
+
page: PluginPageHandle;
|
|
9
|
+
params?: PluginPageParams;
|
|
10
|
+
}
|
|
11
|
+
export interface PluginNavigation {
|
|
12
|
+
/** 功能入口的具体位置由宿主决定,与页面注册分离。 */
|
|
13
|
+
registerEntry(entry: PluginNavigationEntry): Disposable;
|
|
14
|
+
}
|
|
@@ -11,6 +11,8 @@ export interface PluginPageContext {
|
|
|
11
11
|
* 这里供命令等 effect 之外的回调判断。
|
|
12
12
|
*/
|
|
13
13
|
isActive(): boolean;
|
|
14
|
+
/** 离开前返回 false 阻止导航;组件卸载或插件失活时自动失效。 */
|
|
15
|
+
registerLeaveGuard(guard: () => boolean | Promise<boolean>): Disposable;
|
|
14
16
|
/**
|
|
15
17
|
* 登记一个浮层(抽屉、弹出面板)的关闭函数:用户按 Esc 时 Tau 先关最后登记的浮层,
|
|
16
18
|
* 不会后退页面。只在本页显示时生效。@tau/ui 的模态 Dialog / Drawer 已自带,不必登记;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type PluginManifest } from "./package";
|
|
2
|
+
import { type PluginCapability } from "./capabilities";
|
|
3
|
+
import type { PluginEnvironment } from "./environment";
|
|
4
|
+
export { isPluginCapability } from "./capabilities";
|
|
5
|
+
export type { PluginCapability } from "./capabilities";
|
|
6
|
+
export declare const PORTABLE_PLATFORMS: readonly ["desktop", "android", "ios"];
|
|
7
|
+
export type PortablePlatform = (typeof PORTABLE_PLATFORMS)[number];
|
|
8
|
+
export type PluginElementSupport = "none" | "render" | "edit";
|
|
9
|
+
export declare const PORTABLE_SHARED_MODULES: readonly ["@tau/plugins", "@tau/ui", "react", "react-dom", "react-dom/client", "react/jsx-runtime", "react/jsx-dev-runtime"];
|
|
10
|
+
export interface PortablePluginTarget<Capability extends string = PluginCapability> {
|
|
11
|
+
readonly minAppVersion: string;
|
|
12
|
+
readonly required: readonly Capability[];
|
|
13
|
+
readonly optional: readonly Capability[];
|
|
14
|
+
readonly elements?: Readonly<Record<string, PluginElementSupport>>;
|
|
15
|
+
}
|
|
16
|
+
export interface PortablePluginManifest<Capability extends string = PluginCapability> extends Omit<PluginManifest, "formatVersion" | "platform" | "backend" | "whiteboard" | "minAppVersion"> {
|
|
17
|
+
readonly formatVersion: 3;
|
|
18
|
+
readonly platform: "portable";
|
|
19
|
+
readonly profile: "web-v1";
|
|
20
|
+
readonly description?: string;
|
|
21
|
+
readonly targets: Readonly<Partial<Record<PortablePlatform, PortablePluginTarget<Capability>>>>;
|
|
22
|
+
}
|
|
23
|
+
export type ReadablePortablePluginManifest = PortablePluginManifest<string>;
|
|
24
|
+
export declare const PLUGIN_BASE_REQUIREMENTS: readonly ["commands", "storage", "pages", "navigation", "settings", "dialogs"];
|
|
25
|
+
export type PluginRequirement = "sourceEditor" | "runtimeStyles" | "media";
|
|
26
|
+
export type OptionalPluginRequirement = "runtimeStyles";
|
|
27
|
+
export interface PluginAuthorTarget {
|
|
28
|
+
readonly minAppVersion: string;
|
|
29
|
+
readonly requires?: readonly PluginRequirement[];
|
|
30
|
+
readonly optional?: readonly OptionalPluginRequirement[];
|
|
31
|
+
readonly editor?: {
|
|
32
|
+
readonly elements: Readonly<Record<string, PluginElementSupport>>;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface PluginAuthorManifest extends Pick<PluginManifest, "id" | "name" | "version" | "categories" | "keywords" | "permissions"> {
|
|
36
|
+
readonly description?: string;
|
|
37
|
+
readonly requires?: readonly PluginRequirement[];
|
|
38
|
+
readonly optional?: readonly OptionalPluginRequirement[];
|
|
39
|
+
readonly editor?: {
|
|
40
|
+
readonly elements: Readonly<Record<string, PluginElementSupport>>;
|
|
41
|
+
};
|
|
42
|
+
readonly targets: Readonly<Partial<Record<PortablePlatform, PluginAuthorTarget>>>;
|
|
43
|
+
}
|
|
44
|
+
export interface PluginBuildOutput {
|
|
45
|
+
readonly main: string;
|
|
46
|
+
readonly styles?: string;
|
|
47
|
+
readonly integrity: Readonly<Record<string, string>>;
|
|
48
|
+
readonly skills?: readonly string[];
|
|
49
|
+
}
|
|
50
|
+
/** 作者只声明额外需求;发行字段由构建工具提供,平台覆盖按整组替换。 */
|
|
51
|
+
export declare function buildPortablePluginManifest(value: unknown, output: PluginBuildOutput): PortablePluginManifest;
|
|
52
|
+
export interface PortablePluginHost {
|
|
53
|
+
readonly environment: PluginEnvironment;
|
|
54
|
+
readonly capabilities: readonly PluginCapability[];
|
|
55
|
+
readonly appVersion: string;
|
|
56
|
+
readonly profiles: readonly string[];
|
|
57
|
+
}
|
|
58
|
+
/** 作者与上传入口严格校验能力词表,避免拼写错误被当作可选降级。 */
|
|
59
|
+
export declare function validatePortablePluginManifest(value: unknown): PortablePluginManifest;
|
|
60
|
+
/** 客户端只放宽能力名称的前向读取,结构、格式、权限与摘要声明仍严格校验。 */
|
|
61
|
+
export declare function readPortablePluginManifest(value: unknown): ReadablePortablePluginManifest;
|
|
62
|
+
/** 构建器与中心共用发行范围;不代表中心已开放批准发布。 */
|
|
63
|
+
export declare function validatePortableDistributionManifest(value: unknown): PortablePluginManifest;
|
|
64
|
+
export declare function assertPortablePluginCompatibility(manifest: ReadablePortablePluginManifest, host: PortablePluginHost): PortablePluginTarget<string>;
|
|
65
|
+
export declare function getPortableElementSupport(manifest: ReadablePortablePluginManifest, platform: PortablePlatform, type: string): PluginElementSupport;
|
|
66
|
+
/** 定义求值后对账节点归属;调用方仍须按支持等级装配渲染与提交保护。 */
|
|
67
|
+
export declare function assertPortableElementDeclarations(manifest: ReadablePortablePluginManifest, nodeTypes: readonly string[]): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { PLUGIN_SHARED_MODULES } from "./package";
|
|
2
|
+
export { readPublishedPluginManifest as validatePluginManifest } from "./rendering";
|
|
3
|
+
import type { PublishedPluginRender } from "./render-artifact";
|
|
3
4
|
export declare const PLUGIN_RENDER_VERSION: 1;
|
|
4
5
|
export type { PublishedPluginRender } from "./render-artifact";
|
|
5
6
|
/** 协议层只检查贡献归属,具体扩展类型由模板选用的渲染器解释。 */
|
|
@@ -10,5 +11,9 @@ export interface EvaluatedPluginDefinition {
|
|
|
10
11
|
apiVersion: 1;
|
|
11
12
|
editorExtensions?: readonly unknown[];
|
|
12
13
|
}
|
|
13
|
-
export declare function evaluatePluginPackage(artifact:
|
|
14
|
+
export declare function evaluatePluginPackage(artifact: {
|
|
15
|
+
manifest: PublishedPluginRender["manifest"];
|
|
16
|
+
code: string;
|
|
17
|
+
css?: string;
|
|
18
|
+
}, modules: Readonly<Record<string, unknown>>): EvaluatedPluginDefinition;
|
|
14
19
|
export declare function assertRenderTypes(definition: EvaluatedPluginDefinition, types: string[]): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { PluginManifest } from "./package";
|
|
2
|
+
import type { ReadablePortablePluginManifest } from "./portable";
|
|
2
3
|
/** 发布内容只携带插件产物元数据,不依赖编辑器或 UI 类型。 */
|
|
3
4
|
export interface PublishedPluginRender {
|
|
4
5
|
runtimeVersion: 1;
|
|
5
|
-
manifest: PluginManifest;
|
|
6
|
+
manifest: PluginManifest | ReadablePortablePluginManifest;
|
|
6
7
|
entry: string;
|
|
7
8
|
styles?: string;
|
|
8
9
|
nodeTypes: string[];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { PluginDefinition } from "./contract";
|
|
2
|
+
import type { PluginEditorExtension } from "./editor";
|
|
3
|
+
import type { MarkdownCodec } from "../../markdown/src/index";
|
|
4
|
+
import { type PortablePlatform, type ReadablePortablePluginManifest, type PortablePluginHost } from "./portable";
|
|
5
|
+
import { type DevelopmentPluginPackage, type PluginManifest } from "./package";
|
|
6
|
+
export type { PublishedPluginRender } from "./render-artifact";
|
|
7
|
+
export declare function assertUniqueEditorCodecs(codecs: readonly MarkdownCodec[]): void;
|
|
8
|
+
export declare const PLUGIN_RENDER_VERSION = 1;
|
|
9
|
+
/** 发布站只读取静态贡献;清单保持原格式,不启动应用插件生命周期。 */
|
|
10
|
+
export declare function readPublishedPluginManifest(value: unknown): PluginManifest | ReadablePortablePluginManifest;
|
|
11
|
+
export declare function evaluatePublishedPluginPackage(artifact: {
|
|
12
|
+
manifest: PluginManifest | ReadablePortablePluginManifest;
|
|
13
|
+
code: string;
|
|
14
|
+
css?: string;
|
|
15
|
+
}, modules: Readonly<Record<string, unknown>>): PluginDefinition;
|
|
16
|
+
export interface PluginRenderSelection {
|
|
17
|
+
id: string;
|
|
18
|
+
version: string;
|
|
19
|
+
mainHash: string;
|
|
20
|
+
stylesHash?: string;
|
|
21
|
+
nodeTypes: string[];
|
|
22
|
+
styleSources?: PluginEditorExtension["styleSources"];
|
|
23
|
+
}
|
|
24
|
+
export interface PluginRenderContext {
|
|
25
|
+
builtinTypes: string[];
|
|
26
|
+
plugins: PluginRenderSelection[];
|
|
27
|
+
}
|
|
28
|
+
/** 只求值定义,不调用 create/activate;两端使用相同的 CJS 与共享模块约定。 */
|
|
29
|
+
export declare function evaluatePluginPackage(artifact: DevelopmentPluginPackage, modules: Readonly<Record<string, unknown>>): PluginDefinition;
|
|
30
|
+
/** 只供显式接入跨端协议的宿主;执行前必须先由包读取器验证文件完整性。 */
|
|
31
|
+
export declare function evaluatePortablePluginPackage(artifact: {
|
|
32
|
+
manifest: ReadablePortablePluginManifest;
|
|
33
|
+
code: string;
|
|
34
|
+
css?: string;
|
|
35
|
+
}, modules: Readonly<Record<string, unknown>>, host: PortablePluginHost): PluginDefinition;
|
|
36
|
+
/** 各宿主共用支持等级投影;原始数据与节点身份不改写。 */
|
|
37
|
+
export declare function adaptPortablePluginDefinition(definition: PluginDefinition, manifest: ReadablePortablePluginManifest, platform: PortablePlatform): {
|
|
38
|
+
support: Readonly<{
|
|
39
|
+
[k: string]: import("./portable").PluginElementSupport;
|
|
40
|
+
}>;
|
|
41
|
+
definition: {
|
|
42
|
+
editorExtensions: {
|
|
43
|
+
blockPanel?: readonly import("../../editor/api").IBlockPanelListItem[] | ((editor: import("slate").Editor) => readonly import("../../editor/api").IBlockPanelListItem[]);
|
|
44
|
+
commands?: readonly import("../../editor/api").EditorCommand[];
|
|
45
|
+
hotkeys?: readonly import("../../editor/api").EditorHotkey[];
|
|
46
|
+
menu?: import("../../editor/api").EditorMenuContribution;
|
|
47
|
+
behaviorsFor?: Readonly<Record<string, import("../../editor/api").ElementBehaviors>>;
|
|
48
|
+
elements: import("../../editor/api").ElementSpec<import("../../editor/api").ParagraphElement>[];
|
|
49
|
+
styleSources: {
|
|
50
|
+
type: string;
|
|
51
|
+
field: string;
|
|
52
|
+
language: "html" | "tsx";
|
|
53
|
+
}[] | undefined;
|
|
54
|
+
htmlSerializers: {
|
|
55
|
+
type: string;
|
|
56
|
+
toHtml(element: Record<string, unknown>): string;
|
|
57
|
+
}[] | undefined;
|
|
58
|
+
id: string;
|
|
59
|
+
apiVersion: typeof import("../../editor/api").EXTENSION_API_VERSION;
|
|
60
|
+
plugins?: never;
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
editorCodecs: MarkdownCodec[] | undefined;
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
version: string;
|
|
66
|
+
apiVersion: 1;
|
|
67
|
+
whiteboardExtensions?: readonly import("../../whiteboard/src/author").WhiteboardExtension[];
|
|
68
|
+
ai?: {
|
|
69
|
+
readonly features: readonly import("./ai").PluginAIFeature[];
|
|
70
|
+
};
|
|
71
|
+
create(): import("./contract").PluginInstance;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
type DefinitionManifest = Pick<PluginManifest, "id" | "name" | "version" | "apiVersion" | "editor" | "whiteboard">;
|
|
75
|
+
export declare function validatePluginDefinition(manifest: DefinitionManifest, definition: PluginDefinition | undefined): PluginDefinition;
|
|
76
|
+
export declare function getPluginNodeTypes(definition: PluginDefinition): string[];
|
|
77
|
+
export declare function getPluginWhiteboardTypes(definition: PluginDefinition): string[];
|
|
78
|
+
export declare function assertRenderTypes(definition: PluginDefinition, expected: readonly string[]): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 主题「暖纸」—— 首个主题族,一张暖纸的晨与夜。
|
|
3
3
|
*
|
|
4
4
|
* 浅色(晨):取值来自样板间 direction-a-soft.html 的实测调优结果;奶油纸底 + 可可墨 +
|
|
5
|
-
* 陶土橙 accent
|
|
5
|
+
* 陶土橙 accent。融合骨架要求:不提供侧栏专用底色,
|
|
6
6
|
* 侧栏透明融于 bg-page(见 03 指南 · 壳层铁律)。
|
|
7
7
|
*
|
|
8
8
|
* 深色(夜):同一张暖纸在烛光下——深可可纸底 + 奶油墨 + 陶土橙提亮。层级与浅色对称翻转:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type UiRegisterDismiss = (dismiss: () => void) => () => void;
|
|
3
|
+
/** 宿主负责返回仲裁,UI 不依赖任何页面框架。 */
|
|
4
|
+
export declare function UiHostProvider({ registerDismiss, children, }: {
|
|
5
|
+
registerDismiss: UiRegisterDismiss;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/** 子模态先消费返回,避免同批挂载时子 effect 先执行而颠倒退场顺序。 */
|
|
9
|
+
export declare function UiDismissBoundary({ open, dismiss, children, }: {
|
|
10
|
+
open: boolean;
|
|
11
|
+
dismiss: () => void;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,6 +9,7 @@ export { EDIT_TEXT_PLACEHOLDER } from "./primitives/editTextClasses";
|
|
|
9
9
|
export * from "./hooks/index";
|
|
10
10
|
export { isEditableTarget } from "./hooks/isEditableTarget";
|
|
11
11
|
export * from "./UiProvider";
|
|
12
|
+
export { UiHostProvider, type UiRegisterDismiss } from "./UiHostProvider";
|
|
12
13
|
export * from "./primitives/Button";
|
|
13
14
|
export * from "./primitives/IconButton";
|
|
14
15
|
export * from "./primitives/Loading";
|
|
@@ -12,6 +12,8 @@ export interface TabsProps<K extends string = string> {
|
|
|
12
12
|
/** 标签居中(默认左对齐) */
|
|
13
13
|
centered?: boolean;
|
|
14
14
|
className?: string;
|
|
15
|
+
/** 面板容器类名:标签栏固定、面板独立滚动时由调用方给出高度约束 */
|
|
16
|
+
panelClassName?: string;
|
|
15
17
|
}
|
|
16
18
|
/** 下划线式标签页(与 desktop 设置页同一视觉语言);方向键在标签间移动 */
|
|
17
|
-
export declare function Tabs<K extends string = string>({ items, activeKey: activeKeyProp, defaultActiveKey, onChange, centered, className, }: TabsProps<K>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function Tabs<K extends string = string>({ items, activeKey: activeKeyProp, defaultActiveKey, onChange, centered, className, panelClassName, }: TabsProps<K>): import("react/jsx-runtime").JSX.Element;
|