@xiongtao.xt/tau-plugins 0.51.0 → 0.53.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 +11 -0
- package/client/{chunk-TCJBY6GL.js → chunk-7ZRTRNIF.js} +1 -1
- package/client/{chunk-5GHRRBYH.js → chunk-M4KRTX2I.js} +1 -12
- package/docs/ai.md +14 -25
- package/docs/editor.md +0 -2
- package/docs/flashcards.md +3 -3
- package/docs/mcp.md +1 -1
- package/docs/portability.md +40 -34
- package/docs/providers/README.md +12 -11
- package/docs/providers/images.md +2 -0
- package/docs/providers/video.md +22 -6
- package/docs/services.md +16 -21
- package/docs/skills.md +6 -7
- package/docs/storage-and-network.md +1 -1
- package/docs/ui.md +65 -25
- package/docs/user-data.md +30 -43
- package/package.js +1 -1
- package/package.json +1 -1
- package/portable.js +2 -2
- package/publish-artifacts.js +2 -2
- package/types/packages/collaboration/src/node-document.d.ts +8 -4
- package/types/packages/editor/src/builtin-types.d.ts +1 -0
- package/types/packages/editor/src/core/api/ingest.d.ts +2 -2
- package/types/packages/editor/src/extensions/bookmark/src/augmentations.d.ts +6 -0
- package/types/packages/editor/src/extensions/bookmark/src/types.d.ts +31 -0
- package/types/packages/plugins/src/ai.d.ts +0 -33
- package/types/packages/plugins/src/index.d.ts +2 -0
- package/types/packages/plugins/src/permissions.d.ts +1 -1
- package/types/packages/plugins/src/portable.d.ts +1 -1
- package/types/packages/plugins/src/services.d.ts +5 -1
- package/types/packages/plugins/src/settings-draft.d.ts +79 -0
- package/types/packages/plugins/src/video.d.ts +12 -0
- package/types/packages/ui/src/primitives/Toast.d.ts +1 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface SettingsDraftChange {
|
|
3
|
+
label: string;
|
|
4
|
+
/** 已保存的值,用于离开确认里的「旧值 → 新值」 */
|
|
5
|
+
from?: string;
|
|
6
|
+
to?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SettingsDraftOptions {
|
|
9
|
+
/** 草稿与已保存的值不同 */
|
|
10
|
+
dirty: boolean;
|
|
11
|
+
/** 填写有误的项数;大于 0 时不能保存 */
|
|
12
|
+
errors?: number;
|
|
13
|
+
/** 修改清单:保存条显示项数,离开确认里逐项列出 */
|
|
14
|
+
changes?: readonly SettingsDraftChange[];
|
|
15
|
+
/** 写入草稿;返回的文字显示在「已保存」旁,抛错时保存条显示错误信息 */
|
|
16
|
+
save(): Promise<string | void> | string | void;
|
|
17
|
+
/** 放弃草稿,回到已保存的值 */
|
|
18
|
+
reset(): void;
|
|
19
|
+
/** 有错误时用户仍点了保存,用来把错误标到字段上 */
|
|
20
|
+
onInvalid?(): void;
|
|
21
|
+
/** 保存按钮文字,默认「保存」 */
|
|
22
|
+
saveLabel?: string;
|
|
23
|
+
/** 保存中的进度文字,默认「正在保存…」 */
|
|
24
|
+
savingText?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface SettingsDraft {
|
|
27
|
+
readonly saving: boolean;
|
|
28
|
+
/** 与保存条相同的保存,成功返回 true */
|
|
29
|
+
save(): Promise<boolean>;
|
|
30
|
+
}
|
|
31
|
+
export type SettingsDraftPhase = "idle" | "saving" | "saved" | "failed";
|
|
32
|
+
export type SettingsDraftLeaveChoice = "save" | "discard" | "stay";
|
|
33
|
+
export interface SettingsDraftSnapshot {
|
|
34
|
+
readonly attached: boolean;
|
|
35
|
+
readonly dirty: boolean;
|
|
36
|
+
readonly errors: number;
|
|
37
|
+
readonly changes: readonly SettingsDraftChange[];
|
|
38
|
+
readonly saveLabel: string;
|
|
39
|
+
readonly savingText: string;
|
|
40
|
+
readonly phase: SettingsDraftPhase;
|
|
41
|
+
/** saved 时为成功说明,failed 时为错误信息 */
|
|
42
|
+
readonly message: string;
|
|
43
|
+
/** 正在询问是否离开 */
|
|
44
|
+
readonly leaving: boolean;
|
|
45
|
+
/** 有错误仍点保存时递增,宿主据此定位到错误字段 */
|
|
46
|
+
readonly invalidAttempts: number;
|
|
47
|
+
}
|
|
48
|
+
export interface SettingsDraftController {
|
|
49
|
+
getSnapshot(): SettingsDraftSnapshot;
|
|
50
|
+
subscribe(listener: () => void): () => void;
|
|
51
|
+
/** 每个设置分区同一时间只能有一个草稿 */
|
|
52
|
+
attach(options: {
|
|
53
|
+
readonly current: SettingsDraftOptions;
|
|
54
|
+
}): {
|
|
55
|
+
update(): void;
|
|
56
|
+
dispose(): void;
|
|
57
|
+
};
|
|
58
|
+
save(): Promise<boolean>;
|
|
59
|
+
reset(): void;
|
|
60
|
+
/** 有未保存修改时进入询问,按用户选择解析:true 放行离开 */
|
|
61
|
+
confirmLeave(): Promise<boolean>;
|
|
62
|
+
answerLeave(choice: SettingsDraftLeaveChoice): void;
|
|
63
|
+
dispose(): void;
|
|
64
|
+
}
|
|
65
|
+
/** 宿主为每个设置分区创建一个控制器:保存条、离开确认与快捷键都读它。 */
|
|
66
|
+
export declare function createSettingsDraftController({ savedDuration, }?: {
|
|
67
|
+
savedDuration?: number;
|
|
68
|
+
}): SettingsDraftController;
|
|
69
|
+
export declare function SettingsDraftProvider({ controller, children, }: {
|
|
70
|
+
controller: SettingsDraftController;
|
|
71
|
+
children: ReactNode;
|
|
72
|
+
}): import("react").FunctionComponentElement<import("react").ProviderProps<SettingsDraftController | null>>;
|
|
73
|
+
/** 宿主组件读取所在分区的控制器(如切换账号前询问离开);不在设置分区内时为 null。 */
|
|
74
|
+
export declare function useSettingsDraftController(): SettingsDraftController | null;
|
|
75
|
+
/**
|
|
76
|
+
* 插件设置的草稿:组件报告有没有改动、怎么保存、怎么还原,宿主负责保存条、⌘S 与离开确认。
|
|
77
|
+
* 不在宿主的设置分区内(如插件页面)时返回 null,组件需要自己提供保存入口。
|
|
78
|
+
*/
|
|
79
|
+
export declare function useSettingsDraft(options: SettingsDraftOptions): SettingsDraft | null;
|
|
@@ -39,6 +39,16 @@ export interface ResolvedVideo {
|
|
|
39
39
|
variants: readonly VideoVariant[];
|
|
40
40
|
defaultVariant?: number;
|
|
41
41
|
}
|
|
42
|
+
export interface VideoCaptionSegment {
|
|
43
|
+
text: string;
|
|
44
|
+
/** 相对于视频起点的毫秒时间戳。 */
|
|
45
|
+
start: number;
|
|
46
|
+
end: number;
|
|
47
|
+
}
|
|
48
|
+
export interface VideoCaptions {
|
|
49
|
+
language?: string;
|
|
50
|
+
segments: readonly VideoCaptionSegment[];
|
|
51
|
+
}
|
|
42
52
|
export interface VideoInstance {
|
|
43
53
|
/** 同步识别链接是否属于本提供方,不发网络请求。 */
|
|
44
54
|
matches(url: string): boolean;
|
|
@@ -46,6 +56,8 @@ export interface VideoInstance {
|
|
|
46
56
|
/** 稳定的缓存身份(应包含清晰度);已缓存时宿主不再调用 getPlayback。 */
|
|
47
57
|
cacheKey(ref: VideoRef): string;
|
|
48
58
|
getPlayback(ref: VideoRef, signal: AbortSignal): Promise<VideoPlaybackSource>;
|
|
59
|
+
/** 读取平台字幕;无字幕返回 null。不提供此能力时可省略,用户仍可手动转录。 */
|
|
60
|
+
getCaptions?(ref: VideoRef, signal: AbortSignal): Promise<VideoCaptions | null>;
|
|
49
61
|
}
|
|
50
62
|
export interface VideoProviderDefinition {
|
|
51
63
|
id: string;
|
|
@@ -79,7 +79,7 @@ export declare function ToastHost({ variant, zoneClassName, }?: {
|
|
|
79
79
|
/** 覆盖停靠区的位置与层级(如移动端顶栏下方、低于系统层) */
|
|
80
80
|
zoneClassName?: string;
|
|
81
81
|
}): import("react/jsx-runtime").JSX.Element;
|
|
82
|
-
export declare function ToastPill({ item, variant }: {
|
|
82
|
+
export declare function ToastPill({ item, variant, }: {
|
|
83
83
|
item: ToastItem;
|
|
84
84
|
variant?: ToastVariant;
|
|
85
85
|
}): import("react/jsx-runtime").JSX.Element;
|