@xiongtao.xt/tau-plugins 0.36.0 → 0.38.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/client/{chunk-D4PV3N7Q.js → chunk-BKZ7HC6P.js} +127 -18
  3. package/docs/README.md +2 -2
  4. package/docs/api-support.md +38 -34
  5. package/docs/editor.md +2 -2
  6. package/docs/getting-started.md +5 -5
  7. package/docs/plugin-basics.md +8 -9
  8. package/docs/portability.md +86 -38
  9. package/docs/providers/README.md +2 -1
  10. package/docs/providers/upload.md +1 -1
  11. package/docs/release.md +2 -2
  12. package/docs/storage-and-network.md +1 -1
  13. package/docs/ui.md +1 -1
  14. package/package.json +1 -1
  15. package/portable.js +7 -1
  16. package/publish-artifacts.js +63 -3
  17. package/types/packages/editor/src/core/api/index.d.ts +4 -1
  18. package/types/packages/editor/src/core/components/EditorContextMenu/types.d.ts +35 -0
  19. package/types/packages/editor/src/core/components/ExtensionLayers/index.d.ts +17 -0
  20. package/types/packages/editor/src/core/hooks/useDragHandlerMenu.d.ts +39 -0
  21. package/types/packages/editor/src/core/kit/EditorKit.d.ts +39 -0
  22. package/types/packages/editor/src/core/kit/ExtensionAssembly.d.ts +81 -0
  23. package/types/packages/editor/src/core/kit/context.d.ts +21 -0
  24. package/types/packages/editor/src/core/menu/resolveMenu.d.ts +19 -0
  25. package/types/packages/editor/src/core/services/interaction.d.ts +12 -0
  26. package/types/packages/editor/src/core/utils/nodeOperations.d.ts +2 -2
  27. package/types/packages/markdown/src/index.d.ts +1 -1
  28. package/types/packages/markdown/src/markdown-helper.d.ts +5 -1
  29. package/types/packages/markdown/src/markdownSerializerRegistry.d.ts +1 -0
  30. package/types/packages/markdown/src/processor.d.ts +8 -1
  31. package/types/packages/plugins/src/capabilities.d.ts +3 -3
  32. package/types/packages/plugins/src/environment.d.ts +7 -10
  33. package/types/packages/plugins/src/index.d.ts +0 -2
  34. package/types/packages/plugins/src/portable.d.ts +33 -1
  35. package/types/packages/plugins/src/publish-artifacts.d.ts +8 -3
  36. package/types/packages/plugins/src/render-artifact.d.ts +2 -1
  37. package/types/packages/plugins/src/rendering.d.ts +78 -0
  38. package/types/packages/themes/src/themes/paper.theme.d.ts +1 -1
  39. package/types/packages/ui/src/index.d.ts +1 -0
  40. package/types/packages/ui/src/patterns/ConfigurationPanel.d.ts +21 -0
  41. package/types/packages/ui/src/primitives/Tabs.d.ts +3 -1
@@ -0,0 +1,19 @@
1
+ import type { EditorMenuContext, EditorMenuContribution } from "../api/menu";
2
+ import type { ContextMenuItem } from "../components/EditorContextMenu/types";
3
+ /**
4
+ * 把各扩展贡献的菜单声明求值成渲染件条目(01 §5.4)。
5
+ * when 决定条目是否出现;disabled 决定灰显;执行统一走 `editor.commands.execute`
6
+ * (与热键共享命令的 enablement 与熔断)。求值错误只丢出错的条目,不波及其他扩展。
7
+ * 顶层条目按 id 去重,后声明的覆盖先声明的——扩展可以覆盖内核默认条目。
8
+ */
9
+ /** 一个扩展贡献的菜单来源;owner 用于日志,并写入条目的 owner 字段供宿主区分来源 */
10
+ export interface MenuContributionSource {
11
+ readonly owner: string;
12
+ readonly menu: EditorMenuContribution;
13
+ /**
14
+ * 贡献者注册的元素类型:条目默认只出现在这些类型上(特有菜单不进别的块的菜单)。
15
+ * 不注册元素的扩展(内核默认菜单、preview 菜单)为全局条目,靠自身 when 限定范围。
16
+ */
17
+ readonly types?: readonly string[];
18
+ }
19
+ export declare function resolveBlockMenuItems(sources: readonly MenuContributionSource[], ctx: EditorMenuContext, extras?: readonly ContextMenuItem[]): ContextMenuItem[];
@@ -0,0 +1,12 @@
1
+ import type { Editor } from "slate";
2
+ /** 宿主声明的输入方式:决定带悬停 / 拖拽手柄的块是否改用触屏交互 */
3
+ export interface EditorInteraction {
4
+ /** 触屏宿主:块不渲染悬停属性条与缩放手柄,选中改由 Slate 选区表达,操作交给宿主工具栏 */
5
+ touch: boolean;
6
+ }
7
+ /** 未注册时按桌面(鼠标)交互 */
8
+ export declare const IEditorInteraction: import("../../../../shared/service-contract").ServiceIdentifier<EditorInteraction>;
9
+ /** 当前编辑器是否处于触屏交互模式 */
10
+ export declare function useTouchInteraction(): boolean;
11
+ /** 非 React 场景(命令、菜单)读取触屏交互模式 */
12
+ export declare function isTouchInteraction(editor: Editor): boolean;
@@ -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>;
@@ -1,4 +1,4 @@
1
- export { createMarkdownProcessor, type MarkdownProcessor, type MarkdownProcessorOptions, } from "./processor";
1
+ export { createMarkdownProcessor, type MarkdownProcessor, type MarkdownProcessorOptions, type MarkdownCachePolicy, } from "./processor";
2
2
  export type { MarkdownTextCodec, MarkdownTextRule, LeafSerializationResult } from "./textCodec";
3
3
  export type { MarkdownCodec, CustomDirectiveHandler, MarkdownImportNode, MarkdownImportContext, } from "./codec";
4
4
  export { isMarkdownLikeText, type ImportFromMarkdownOptions, type SlateWithPositions, } from "./markdown";
@@ -13,7 +13,11 @@ export interface ExportConfig {
13
13
  }
14
14
  /** codec 的序列化器登记脚注(如 annotation 的 [^n]),由导出入口统一追加到文末 */
15
15
  export declare const addExportFootnote: (content: string) => number;
16
- export declare const getMarkdownUsing: (config: ExportConfig, value: Descendant[]) => string;
16
+ export interface MarkdownOutputCache {
17
+ output: WeakMap<Descendant, string>;
18
+ reusable(node: Descendant): boolean;
19
+ }
20
+ export declare const getMarkdownUsing: (config: ExportConfig, value: readonly Descendant[], cache?: MarkdownOutputCache) => string;
17
21
  export declare const elementToMarkdownUsing: (config: ExportConfig, element: CustomElement, parentElement: CustomElement | null) => string;
18
22
  /**
19
23
  * 带位置信息的 Markdown 输出
@@ -38,6 +38,7 @@ export declare class MarkdownSerializerRegistry {
38
38
  private footnoteDefinitions;
39
39
  constructor(serializers?: MarkdownSerializer[]);
40
40
  resetFootnotes(): void;
41
+ getFootnoteCount(): number;
41
42
  addFootnote(content: string): number;
42
43
  getFootnoteDefinitions(): string;
43
44
  register(serializer: MarkdownSerializer): void;
@@ -2,18 +2,25 @@ import type { Descendant } from "slate";
2
2
  import type { MarkdownCodec } from "./codec";
3
3
  import { type ImportFromMarkdownOptions, type SlateWithPositions } from "./markdown";
4
4
  import { type MarkdownWithPositions } from "./markdown-helper";
5
- import type { CustomElement } from "./types";
5
+ import { type CustomElement } from "./types";
6
6
  import type { FormattedText } from "./model";
7
7
  import { type MarkdownTextCodec, type LeafSerializationResult } from "./textCodec";
8
8
  export interface MarkdownProcessor {
9
9
  importFromMarkdown(markdown: string, ignoreTypes?: string[], options?: ImportFromMarkdownOptions): Descendant[];
10
10
  importFromMarkdownWithPositions(markdown: string, ignoreTypes?: string[], options?: ImportFromMarkdownOptions): SlateWithPositions;
11
11
  getMarkdown(value: Descendant[]): string;
12
+ /** 只缓存不可变节点及显式声明的纯 codec,其他节点以独立副本完整转换。 */
13
+ createIncrementalSerializer(policy: MarkdownCachePolicy): (value: readonly Descendant[]) => string;
12
14
  getMarkdownWithPositions(value: Descendant[]): MarkdownWithPositions;
13
15
  elementToMarkdown(element: CustomElement, parentElement: CustomElement | null): string;
14
16
  leafToMarkdown(leaf: FormattedText): string;
15
17
  leafToMarkdownStructured(leaf: FormattedText): LeafSerializationResult;
16
18
  }
19
+ export interface MarkdownCachePolicy {
20
+ /** 由调用方保证只依赖节点及父节点参数;未列出的 codec 不缓存。 */
21
+ codecs: readonly MarkdownCodec[];
22
+ textCodecs: readonly MarkdownTextCodec[];
23
+ }
17
24
  export interface MarkdownProcessorOptions {
18
25
  /** 元素类型的编解码(各扩展的 markdown.ts 提供);处理器只认这里的类型,其余走 ER-006 兜底 */
19
26
  codecs?: MarkdownCodec[];
@@ -1,7 +1,7 @@
1
- /** 能力版本表示接口可用性,不代表业务数据授权。 */
2
- export declare const PLUGIN_CAPABILITIES: readonly ["commands.v1", "storage.v1", "pages.v1", "navigation.v1", "settings.v1", "ui.dialog.v1", "editor.elements.v1", "editor.codecs.v1", "editor.source.v1"];
1
+ /** 功能名只表示是否可用;接口升级由 SDK 和最低客户端版本管理。 */
2
+ export declare const PLUGIN_CAPABILITIES: readonly ["commands", "storage", "pages", "navigation", "settings", "dialogs", "editor", "editorCodecs", "sourceEditor", "runtimeStyles", "fetch", "sync", "upload", "media"];
3
3
  export type PluginCapability = (typeof PLUGIN_CAPABILITIES)[number];
4
- /** 消费者保留未来版本的能力名,但不把它们声明为本宿主已实现。 */
4
+ /** 保留分发清单原值,未知可选功能可读取但不能当作已实现功能。 */
5
5
  export declare function readPluginCapabilityNames(value: unknown): readonly string[];
6
6
  export declare function isPluginCapability(value: unknown): value is PluginCapability;
7
7
  export declare function readPluginCapabilities(value: unknown): readonly PluginCapability[];
@@ -1,14 +1,11 @@
1
1
  import { type ReactNode } from "react";
2
- import { type PluginCapability } from "./capabilities";
3
2
  export interface PluginEnvironment {
4
- readonly platform: "desktop" | "android" | "ios" | "web" | "unknown";
5
- readonly layout: "compact" | "wide" | "unknown";
3
+ readonly platform: "desktop" | "android" | "ios" | "web";
4
+ /** WebView 报告的可用指针精度,不代表当前输入设备或悬停能力。 */
6
5
  readonly input: Readonly<{
7
- touch: boolean;
6
+ coarsePointer: boolean;
8
7
  finePointer: boolean;
9
8
  }>;
10
- /** 可用能力,不代表数据授权或代码隔离。 */
11
- readonly capabilities: readonly PluginCapability[];
12
9
  }
13
10
  export interface PluginEnvironmentSource {
14
11
  getSnapshot(): PluginEnvironment;
@@ -17,14 +14,14 @@ export interface PluginEnvironmentSource {
17
14
  export declare function createPluginEnvironmentStore(initial: PluginEnvironment): Readonly<{
18
15
  getSnapshot: () => PluginEnvironment;
19
16
  subscribe: (listener: () => void) => () => void;
20
- update(patch: Partial<Pick<PluginEnvironment, "layout" | "input">>): void;
17
+ update(patch: Partial<Pick<PluginEnvironment, "input">>): void;
21
18
  }>;
22
- /** 由宿主显式选择平台;媒体查询只描述布局和输入,不用于猜测操作系统。 */
23
- export declare function createBrowserPluginEnvironment(platform: PluginEnvironment["platform"], capabilities: readonly PluginCapability[], viewport: Window): {
19
+ /** 平台由宿主提供,输入信息来自媒体查询。 */
20
+ export declare function createBrowserPluginEnvironment(platform: PluginEnvironment["platform"], viewport: Window): {
24
21
  connect(): () => void;
25
22
  getSnapshot: () => PluginEnvironment;
26
23
  subscribe: (listener: () => void) => () => void;
27
- update: (patch: Partial<Pick<PluginEnvironment, "layout" | "input">>) => void;
24
+ update: (patch: Partial<Pick<PluginEnvironment, "input">>) => void;
28
25
  };
29
26
  export declare function PluginEnvironmentProvider(props: {
30
27
  children: ReactNode;
@@ -1,8 +1,6 @@
1
1
  import type { PluginDefinition } from "./contract";
2
2
  export { usePluginEnvironment } from "./environment";
3
3
  export type { PluginEnvironment } from "./environment";
4
- export { PLUGIN_CAPABILITIES, isPluginCapability } from "./capabilities";
5
- export type { PluginCapability } from "./capabilities";
6
4
  export type { PluginNavigation, PluginNavigationEntry } from "./navigation";
7
5
  export type { PluginBackendClient, BackendStatus, BackendState } from "./backend";
8
6
  export type * from "./upload";
@@ -1,6 +1,8 @@
1
1
  import { type PluginManifest } from "./package";
2
2
  import { type PluginCapability } from "./capabilities";
3
3
  import type { PluginEnvironment } from "./environment";
4
+ export { isPluginCapability } from "./capabilities";
5
+ export type { PluginCapability } from "./capabilities";
4
6
  export declare const PORTABLE_PLATFORMS: readonly ["desktop", "android", "ios"];
5
7
  export type PortablePlatform = (typeof PORTABLE_PLATFORMS)[number];
6
8
  export type PluginElementSupport = "none" | "render" | "edit";
@@ -11,15 +13,45 @@ export interface PortablePluginTarget<Capability extends string = PluginCapabili
11
13
  readonly optional: readonly Capability[];
12
14
  readonly elements?: Readonly<Record<string, PluginElementSupport>>;
13
15
  }
14
- export interface PortablePluginManifest<Capability extends string = PluginCapability> extends Omit<PluginManifest, "formatVersion" | "platform" | "backend" | "whiteboard" | "skills" | "minAppVersion"> {
16
+ export interface PortablePluginManifest<Capability extends string = PluginCapability> extends Omit<PluginManifest, "formatVersion" | "platform" | "backend" | "whiteboard" | "minAppVersion"> {
15
17
  readonly formatVersion: 3;
16
18
  readonly platform: "portable";
17
19
  readonly profile: "web-v1";
20
+ readonly description?: string;
18
21
  readonly targets: Readonly<Partial<Record<PortablePlatform, PortablePluginTarget<Capability>>>>;
19
22
  }
20
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" | "fetch" | "sync" | "upload";
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;
21
52
  export interface PortablePluginHost {
22
53
  readonly environment: PluginEnvironment;
54
+ readonly capabilities: readonly PluginCapability[];
23
55
  readonly appVersion: string;
24
56
  readonly profiles: readonly string[];
25
57
  }
@@ -1,5 +1,6 @@
1
- export { validatePluginManifest, PLUGIN_SHARED_MODULES } from "./package";
2
- import type { DevelopmentPluginPackage } from "./package";
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: DevelopmentPluginPackage, modules: Readonly<Record<string, unknown>>): EvaluatedPluginDefinition;
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(与移动端「杏子 Bento」同基因)。融合骨架要求:不提供侧栏专用底色,
5
+ * 陶土橙 accent。融合骨架要求:不提供侧栏专用底色,
6
6
  * 侧栏透明融于 bg-page(见 03 指南 · 壳层铁律)。
7
7
  *
8
8
  * 深色(夜):同一张暖纸在烛光下——深可可纸底 + 奶油墨 + 陶土橙提亮。层级与浅色对称翻转:
@@ -49,3 +49,4 @@ export * from "./primitives/Sortable";
49
49
  export * from "./primitives/LoadingOverlay";
50
50
  export { lockBodyScroll } from "./hooks/lockBodyScroll";
51
51
  export { mergeRefs } from "./primitives/mergeRefs";
52
+ export * from "./patterns/ConfigurationPanel";
@@ -0,0 +1,21 @@
1
+ export interface ConfigurationField {
2
+ key: string;
3
+ label: string;
4
+ placeholder?: string;
5
+ hint?: string;
6
+ type?: "text" | "password";
7
+ reset?: readonly string[];
8
+ options?: readonly {
9
+ value: string;
10
+ label: string;
11
+ }[];
12
+ loadOptions?: (value: Readonly<Record<string, string>>) => Promise<readonly string[]>;
13
+ }
14
+ /** 账号卡与位置字段复用现有触摸表单结构,保存策略由调用者提供。 */
15
+ export declare function ConfigurationPanel({ initialValue, accountFields, fields, onSave, prepareAccount, }: {
16
+ initialValue: Readonly<Record<string, string>>;
17
+ accountFields: readonly ConfigurationField[];
18
+ fields: readonly ConfigurationField[];
19
+ onSave(value: Record<string, string>): Promise<void>;
20
+ prepareAccount?: (value: Record<string, string>) => Promise<Record<string, string>>;
21
+ }): import("react/jsx-runtime").JSX.Element;
@@ -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;