@xiongtao.xt/tau-plugins 0.59.0 → 0.61.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 +19 -0
- package/client/chunk-UGYIAPAN.js +869 -0
- package/docs/README.md +1 -0
- package/docs/backend.md +4 -10
- package/docs/blog-templates.md +7 -6
- package/docs/document-body.md +2 -0
- package/docs/editor-interactions.md +55 -0
- package/docs/getting-started.md +2 -14
- package/docs/plugin-basics.md +1 -1
- package/docs/portability.md +26 -2
- package/docs/skills.md +10 -12
- package/docs/task-data.md +338 -0
- package/docs/user-data.md +12 -17
- package/docs/whiteboard.md +1 -1
- package/package.js +1 -1
- package/package.json +5 -1
- package/portable.js +3 -2
- package/publish-artifacts.js +51 -27
- package/types/packages/collaboration/src/node-tree.d.ts +7 -0
- package/types/packages/collaboration/src/whiteboard-model.d.ts +33 -2
- package/types/packages/plugins/src/contract.d.ts +2 -0
- package/types/packages/plugins/src/data-changes.d.ts +51 -0
- package/types/packages/plugins/src/data.d.ts +112 -7
- package/types/packages/plugins/src/errors.d.ts +7 -0
- package/types/packages/plugins/src/index.d.ts +2 -1
- package/types/packages/plugins/src/package.d.ts +7 -2
- package/types/packages/plugins/src/portable.d.ts +5 -2
- package/types/packages/plugins/src/skills.d.ts +16 -0
- package/types/packages/plugins/src/template.d.ts +101 -0
- package/types/packages/plugins/src/text-decorations.d.ts +68 -0
- package/types/packages/plugins/src/unified.d.ts +60 -0
- package/types/packages/plugins/src/version.d.ts +5 -0
- package/types/packages/shared/src/task-assistant/contracts.d.ts +15 -0
- package/types/packages/shared/src/task-assistant/occurrence-state.d.ts +7 -0
- package/types/packages/shared/src/task-assistant/schema.d.ts +3 -0
- package/types/packages/shared/task-assistant.d.ts +1 -0
- package/types/packages/ui/src/hooks/useEdgeFade.d.ts +1 -1
- package/types/packages/ui/src/primitives/AnchoredPanel.d.ts +3 -1
- package/types/packages/ui/src/primitives/anchoredPosition.d.ts +8 -0
- package/types/packages/whiteboard/src/Board.d.ts +20 -6
- package/types/packages/whiteboard/src/chrome/index.d.ts +3 -1
- package/types/packages/whiteboard/src/constants/tools.d.ts +3 -0
- package/types/packages/whiteboard/src/context.d.ts +1 -2
- package/types/packages/whiteboard/src/extensions/api.d.ts +6 -1
- package/types/packages/whiteboard/src/hooks/useZoom.d.ts +6 -0
- package/types/packages/whiteboard/src/index.d.ts +1 -0
- package/types/packages/whiteboard/src/interactions/InteractionManager.d.ts +1 -0
- package/types/packages/whiteboard/src/plugins/MindPlugin.d.ts +1 -0
- package/types/packages/whiteboard/src/types/board.d.ts +2 -0
- package/types/packages/whiteboard/src/utils/GeometryUtil.d.ts +1 -1
- package/unified.js +21 -0
- package/client/chunk-6XAEU7BJ.js +0 -330
- package/client/chunk-PRE35AOA.js +0 -185
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type PluginManifest } from "./package";
|
|
1
|
+
import { type PluginManifest, type LegacyPluginManifest } from "./package";
|
|
2
|
+
import { type UnifiedWebPluginManifest } from "./unified";
|
|
2
3
|
import type { PluginEnvironment } from "./environment";
|
|
3
4
|
import { type PackagePlatform, type PackageTarget } from "./package-targets";
|
|
4
5
|
export declare const MOBILE_DATA_MIN_VERSION = "0.2.13";
|
|
@@ -8,17 +9,19 @@ export declare const MOBILE_DATA_PERMISSIONS: readonly ["cards:read", "cards:wri
|
|
|
8
9
|
/** 语音输入与首页面板随同一客户端版本开放 */
|
|
9
10
|
export declare const MOBILE_SPEECH_MIN_VERSION = "0.2.16";
|
|
10
11
|
export declare const MOBILE_SPEECH_PERMISSIONS: readonly ["speech:input"];
|
|
12
|
+
export declare function assertMobilePermissions(manifest: Pick<PortablePluginManifest, "permissions" | "targets">): void;
|
|
11
13
|
export declare const PORTABLE_PLATFORMS: readonly ["desktop", "android", "ios"];
|
|
12
14
|
export type PortablePlatform = PackagePlatform;
|
|
13
15
|
export declare const PORTABLE_SHARED_MODULES: readonly ["@tau/plugins", "@tau/plugins/whiteboard", "@tau/ui", "react", "react-dom", "react-dom/client", "react/jsx-runtime", "react/jsx-dev-runtime"];
|
|
14
16
|
export type PortablePluginTarget = PackageTarget;
|
|
15
|
-
export interface
|
|
17
|
+
export interface LegacyPortablePluginManifest extends Omit<LegacyPluginManifest, "formatVersion" | "platform" | "backend" | "minAppVersion" | "editor" | "whiteboard"> {
|
|
16
18
|
readonly formatVersion: 3;
|
|
17
19
|
readonly platform: "portable";
|
|
18
20
|
readonly profile: "web-v1";
|
|
19
21
|
readonly description?: string;
|
|
20
22
|
readonly targets: Readonly<Partial<Record<PortablePlatform, PortablePluginTarget>>>;
|
|
21
23
|
}
|
|
24
|
+
export type PortablePluginManifest = LegacyPortablePluginManifest | UnifiedWebPluginManifest;
|
|
22
25
|
export interface PluginAuthorManifest extends Pick<PluginManifest, "id" | "name" | "version" | "categories" | "keywords" | "permissions"> {
|
|
23
26
|
readonly description?: string;
|
|
24
27
|
readonly targets: Readonly<Partial<Record<PortablePlatform, PortablePluginTarget>>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 包内 Skill:`skills/<id>/` 是一份标准 Agent Skills 目录(SKILL.md + 附件 + scripts/),
|
|
3
|
+
* manifest 的 `skills` 列出目录 ID,目录内全部文件进入 integrity。名称、描述与调用方式
|
|
4
|
+
* 取自 SKILL.md 的 front matter,manifest 不重复声明。
|
|
5
|
+
*/
|
|
6
|
+
export declare const SKILL_ROOT = "skills";
|
|
7
|
+
export declare const SKILL_README = "SKILL.md";
|
|
8
|
+
/** 读取 manifest.skills;缺省返回 undefined,空数组视为未声明。 */
|
|
9
|
+
export declare function readSkillsField(value: unknown): readonly string[] | undefined;
|
|
10
|
+
/** 校验 integrity 中的 Skill 文件:都落在已声明目录内,且每个目录都有 SKILL.md。 */
|
|
11
|
+
export declare function readSkillFiles(skills: readonly string[] | undefined, integrity: Record<string, unknown>): Record<string, string>;
|
|
12
|
+
/** 包内 Skill 是否带可执行脚本;带脚本的版本与本机后台一样需要人工审核。 */
|
|
13
|
+
export declare function hasSkillScripts(manifest: {
|
|
14
|
+
skills?: readonly string[];
|
|
15
|
+
integrity: Record<string, string>;
|
|
16
|
+
}): boolean;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type PluginManifest } from "./package";
|
|
2
|
+
import { type PluginCatalogFields } from "./categories";
|
|
3
|
+
import type { JsonValue } from "./json";
|
|
4
|
+
import { type PackagePlatform, type PackageTargets, type PackageTarget } from "./package-targets";
|
|
5
|
+
import { type PortablePluginManifest } from "./portable";
|
|
6
|
+
import { type UnifiedTemplateManifest, type UnifiedSkillPackageManifest } from "./unified";
|
|
7
|
+
export { hasSkillScripts, SKILL_README, SKILL_ROOT } from "./skills";
|
|
8
|
+
interface SiteFieldBase {
|
|
9
|
+
/** 模板从 `site.fields[key]` 读取 */
|
|
10
|
+
key: string;
|
|
11
|
+
label: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
}
|
|
14
|
+
/** 模板声明的站点字段,宿主据此渲染「博客模板」设置并在发布时按声明解析取值。 */
|
|
15
|
+
export type TemplateSiteField = (SiteFieldBase & {
|
|
16
|
+
type: "text" | "textarea" | "url";
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
default?: string;
|
|
19
|
+
}) | (SiteFieldBase & {
|
|
20
|
+
type: "select";
|
|
21
|
+
options: {
|
|
22
|
+
value: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}[];
|
|
25
|
+
default?: string;
|
|
26
|
+
}) | (SiteFieldBase & {
|
|
27
|
+
type: "switch";
|
|
28
|
+
default?: boolean;
|
|
29
|
+
});
|
|
30
|
+
export type SiteFieldValue = string | boolean;
|
|
31
|
+
export interface LegacyTemplateManifest extends PluginCatalogFields {
|
|
32
|
+
formatVersion: 1;
|
|
33
|
+
apiVersion: 1;
|
|
34
|
+
platform: "desktop";
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
version: string;
|
|
38
|
+
minAppVersion?: string;
|
|
39
|
+
template: {
|
|
40
|
+
protocolVersion: 1;
|
|
41
|
+
root: string;
|
|
42
|
+
entries: string[];
|
|
43
|
+
siteFields?: TemplateSiteField[];
|
|
44
|
+
};
|
|
45
|
+
integrity: Record<string, string>;
|
|
46
|
+
}
|
|
47
|
+
export type TemplateManifest = LegacyTemplateManifest | UnifiedTemplateManifest;
|
|
48
|
+
/** 独立 Skill 包:没有代码入口,只分发 `skills/<id>/` 目录,安装后即可在 Skill 页使用。 */
|
|
49
|
+
interface SkillPackageBase extends PluginCatalogFields {
|
|
50
|
+
formatVersion: 1;
|
|
51
|
+
apiVersion: 1;
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
version: string;
|
|
55
|
+
skills: readonly string[];
|
|
56
|
+
integrity: Record<string, string>;
|
|
57
|
+
}
|
|
58
|
+
export interface DesktopSkillPackageManifest extends SkillPackageBase {
|
|
59
|
+
platform: "desktop";
|
|
60
|
+
minAppVersion?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface LegacyPortableSkillPackageManifest extends SkillPackageBase {
|
|
63
|
+
platform: "portable";
|
|
64
|
+
targets: PackageTargets;
|
|
65
|
+
minAppVersion?: never;
|
|
66
|
+
}
|
|
67
|
+
export type PortableSkillPackageManifest = LegacyPortableSkillPackageManifest | UnifiedSkillPackageManifest;
|
|
68
|
+
export type SkillPackageManifest = DesktopSkillPackageManifest | PortableSkillPackageManifest;
|
|
69
|
+
export type DistributionManifest = PluginManifest | PortablePluginManifest | TemplateManifest | SkillPackageManifest;
|
|
70
|
+
export declare const DISTRIBUTION_LIMITS: {
|
|
71
|
+
readonly zipBytes: number;
|
|
72
|
+
readonly expandedBytes: number;
|
|
73
|
+
readonly entries: 512;
|
|
74
|
+
};
|
|
75
|
+
/** 包文件路径只约束文件系统边界,不约束模板的公开 URL。 */
|
|
76
|
+
export declare function assertPackagePath(value: unknown): asserts value is string;
|
|
77
|
+
export declare function assertPublishPath(value: unknown): asserts value is string;
|
|
78
|
+
/** 按模板声明解析站点字段:只输出声明过的 key,类型不符或越界的存量值回落到默认值。 */
|
|
79
|
+
export declare function resolveSiteFields(fields: readonly TemplateSiteField[] | undefined, values: Record<string, JsonValue> | undefined): Record<string, SiteFieldValue>;
|
|
80
|
+
export declare function isTemplateManifest(value: unknown): value is TemplateManifest;
|
|
81
|
+
export declare function isSkillPackageManifest(value: unknown): value is SkillPackageManifest;
|
|
82
|
+
export declare function validateSkillPackageManifest(value: unknown): SkillPackageManifest;
|
|
83
|
+
export declare function validatePortableSkillPackageManifest(value: unknown): PortableSkillPackageManifest;
|
|
84
|
+
export type DistributionPackageKind = "plugin" | "skills" | "template";
|
|
85
|
+
export declare function distributionPackageKind(manifest: DistributionManifest | PortablePluginManifest): DistributionPackageKind;
|
|
86
|
+
export declare function assertSkillPackageCompatibility(manifest: SkillPackageManifest, host: {
|
|
87
|
+
platform: PackagePlatform;
|
|
88
|
+
appVersion: string;
|
|
89
|
+
}): PackageTarget;
|
|
90
|
+
export declare function validateMobilePackageManifest(value: unknown, host?: {
|
|
91
|
+
platform: "android" | "ios";
|
|
92
|
+
appVersion: string;
|
|
93
|
+
}): PortablePluginManifest | PortableSkillPackageManifest;
|
|
94
|
+
export declare function validateDistributionManifest(value: unknown): DistributionManifest;
|
|
95
|
+
/** 能在用户本机执行代码的版本(本机后台、带脚本的 Skill)必须经人工系统审核才能发布与安装。 */
|
|
96
|
+
export declare function requiresSystemReview(manifest: {
|
|
97
|
+
backend?: unknown;
|
|
98
|
+
skills?: readonly string[];
|
|
99
|
+
integrity?: Record<string, string>;
|
|
100
|
+
}): boolean;
|
|
101
|
+
export declare function distributionFiles(manifest: DistributionManifest): string[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { PluginContentLocation } from "./app";
|
|
2
|
+
import type { Disposable } from "./contract";
|
|
3
|
+
export interface PluginDecorationSource {
|
|
4
|
+
readonly kind: "card" | "article" | "document";
|
|
5
|
+
readonly id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PluginDecorationBlock {
|
|
8
|
+
readonly source: PluginDecorationSource;
|
|
9
|
+
readonly blockType: string;
|
|
10
|
+
readonly text: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 外观按打扰程度从低到高:
|
|
14
|
+
* - `dot`:文字不变,末尾一个小圆点
|
|
15
|
+
* - `ghost`:静止时点线极淡,悬停或按住 ⌘/Ctrl 才显出
|
|
16
|
+
* - `reference`:正文色文字 + 点线,悬停变实线
|
|
17
|
+
* - `tint`:只改字色
|
|
18
|
+
* - `marker`:下沿荧光笔底色
|
|
19
|
+
* - `wavy`:波浪下划线,适合提醒或待确认
|
|
20
|
+
*
|
|
21
|
+
* `dot`、`ghost`、`reference` 表示可以点击,必须提供 `key` 和 `onActivate`。
|
|
22
|
+
*/
|
|
23
|
+
export type PluginTextDecorationAppearance = "reference" | "ghost" | "marker" | "tint" | "wavy" | "dot";
|
|
24
|
+
/** 主题里的语义色,深浅主题由宿主适配。 */
|
|
25
|
+
export type PluginTextDecorationTone = "accent" | "info" | "warn" | "muted";
|
|
26
|
+
export interface PluginTextDecoration {
|
|
27
|
+
/** 当前连续文本内的 UTF-16 偏移,左闭右开。 */
|
|
28
|
+
start: number;
|
|
29
|
+
end: number;
|
|
30
|
+
appearance: PluginTextDecorationAppearance;
|
|
31
|
+
/** 默认 `accent`。 */
|
|
32
|
+
tone?: PluginTextDecorationTone;
|
|
33
|
+
/** 有 key 的结果可以触发 onActivate。 */
|
|
34
|
+
key?: string;
|
|
35
|
+
/** 悬停提示,例如「打开文章《遗忘曲线》」。 */
|
|
36
|
+
label?: string;
|
|
37
|
+
}
|
|
38
|
+
/** onActivate 返回候选时,宿主在文字旁弹出菜单让用户选择。 */
|
|
39
|
+
export interface PluginTextDecorationCandidate {
|
|
40
|
+
key: string;
|
|
41
|
+
title: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface PluginTextDecorationActivation {
|
|
45
|
+
key: string;
|
|
46
|
+
source: PluginDecorationSource;
|
|
47
|
+
/** 用户在候选菜单里选中的 `candidate.key`;首次点击时为空。 */
|
|
48
|
+
choice?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface PluginDecorationPreviewTarget {
|
|
51
|
+
ref: PluginDecorationSource;
|
|
52
|
+
at?: PluginContentLocation;
|
|
53
|
+
}
|
|
54
|
+
export interface PluginTextDecorationProvider {
|
|
55
|
+
sources: readonly PluginDecorationSource["kind"][];
|
|
56
|
+
getDecorations(block: PluginDecorationBlock, signal: AbortSignal): readonly PluginTextDecoration[] | Promise<readonly PluginTextDecoration[]>;
|
|
57
|
+
/** 停留在命中或候选上时解析目标;宿主负责授权检查和只读预览。 */
|
|
58
|
+
getPreview?(hit: PluginTextDecorationActivation, signal: AbortSignal): PluginDecorationPreviewTarget | undefined | Promise<PluginDecorationPreviewTarget | undefined>;
|
|
59
|
+
onActivate?(action: PluginTextDecorationActivation): void | readonly PluginTextDecorationCandidate[] | Promise<void | readonly PluginTextDecorationCandidate[]>;
|
|
60
|
+
}
|
|
61
|
+
export interface PluginTextDecorationHandle extends Disposable {
|
|
62
|
+
invalidate(scope?: {
|
|
63
|
+
source: PluginDecorationSource;
|
|
64
|
+
}): void;
|
|
65
|
+
}
|
|
66
|
+
export interface PluginTextDecorations {
|
|
67
|
+
register(provider: PluginTextDecorationProvider): Promise<PluginTextDecorationHandle>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type LegacyPluginManifest, type PluginManifest } from "./package";
|
|
2
|
+
import { type PortablePluginManifest } from "./portable";
|
|
3
|
+
import { type PackageTargets } from "./package-targets";
|
|
4
|
+
import { type LegacyTemplateManifest, type LegacyPortableSkillPackageManifest } from "./template";
|
|
5
|
+
export declare const PACKAGE_FORMAT_MIN_VERSIONS: {
|
|
6
|
+
readonly desktop: "0.66.3";
|
|
7
|
+
readonly android: "0.5.1";
|
|
8
|
+
readonly ios: "0.5.1";
|
|
9
|
+
};
|
|
10
|
+
interface UnifiedPackageHeader {
|
|
11
|
+
readonly formatVersion: 4;
|
|
12
|
+
readonly platform: "portable";
|
|
13
|
+
readonly targets: PackageTargets;
|
|
14
|
+
readonly minAppVersion?: never;
|
|
15
|
+
readonly description?: string;
|
|
16
|
+
}
|
|
17
|
+
interface UnifiedPluginBase extends Omit<LegacyPluginManifest, "formatVersion" | "platform" | "minAppVersion" | "backend" | "editor" | "whiteboard">, UnifiedPackageHeader {
|
|
18
|
+
readonly kind: "plugin";
|
|
19
|
+
readonly editor?: never;
|
|
20
|
+
readonly whiteboard?: never;
|
|
21
|
+
}
|
|
22
|
+
export interface UnifiedWebPluginManifest extends UnifiedPluginBase {
|
|
23
|
+
readonly profile: "web-v1";
|
|
24
|
+
readonly backend?: never;
|
|
25
|
+
}
|
|
26
|
+
export interface UnifiedDesktopPluginManifest extends UnifiedPluginBase {
|
|
27
|
+
readonly profile: "desktop-v1";
|
|
28
|
+
readonly backend: NonNullable<LegacyPluginManifest["backend"]>;
|
|
29
|
+
}
|
|
30
|
+
export type UnifiedPluginManifest = UnifiedWebPluginManifest | UnifiedDesktopPluginManifest;
|
|
31
|
+
export interface UnifiedSkillPackageManifest extends Omit<LegacyPortableSkillPackageManifest, "formatVersion" | "platform" | "targets" | "minAppVersion">, UnifiedPackageHeader {
|
|
32
|
+
readonly kind: "skills";
|
|
33
|
+
}
|
|
34
|
+
export interface UnifiedTemplateManifest extends Omit<LegacyTemplateManifest, "formatVersion" | "platform" | "minAppVersion">, UnifiedPackageHeader {
|
|
35
|
+
readonly kind: "template";
|
|
36
|
+
}
|
|
37
|
+
export type UnifiedPackageManifest = UnifiedPluginManifest | UnifiedSkillPackageManifest | UnifiedTemplateManifest;
|
|
38
|
+
export declare function validateUnifiedPluginManifest(value: unknown): UnifiedPluginManifest;
|
|
39
|
+
/** 已发布格式的字节与摘要保持原样,只在读取边界共用字段校验。 */
|
|
40
|
+
export declare function validateUnifiedPackageManifest(value: unknown): UnifiedPackageManifest;
|
|
41
|
+
export declare function buildUnifiedPluginManifest(value: unknown, output: {
|
|
42
|
+
main: string;
|
|
43
|
+
styles?: string;
|
|
44
|
+
integrity: Readonly<Record<string, string>>;
|
|
45
|
+
skills?: readonly string[];
|
|
46
|
+
}): UnifiedPluginManifest;
|
|
47
|
+
export declare function buildUnifiedPackageManifest(value: unknown, output: {
|
|
48
|
+
main?: string;
|
|
49
|
+
styles?: string;
|
|
50
|
+
integrity: Readonly<Record<string, string>>;
|
|
51
|
+
skills?: readonly string[];
|
|
52
|
+
}): UnifiedPackageManifest;
|
|
53
|
+
export declare function packageTargets(manifest: {
|
|
54
|
+
platform: "desktop" | "portable";
|
|
55
|
+
targets?: PackageTargets;
|
|
56
|
+
minAppVersion?: string;
|
|
57
|
+
}): PackageTargets;
|
|
58
|
+
export declare function isWebPluginManifest(manifest: PluginManifest | PortablePluginManifest): manifest is PortablePluginManifest;
|
|
59
|
+
export declare function readApplicationPluginManifest(value: unknown): PluginManifest | PortablePluginManifest;
|
|
60
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export declare function comparePluginVersions(left: string, right: string): number;
|
|
2
2
|
export declare function assertPluginCompatibility(manifest: {
|
|
3
3
|
minAppVersion?: string;
|
|
4
|
+
targets?: {
|
|
5
|
+
desktop?: {
|
|
6
|
+
minAppVersion: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
4
9
|
}, clientVersion: string): void;
|
|
@@ -29,6 +29,7 @@ export interface TaskRecurrenceSegment {
|
|
|
29
29
|
effectiveDate: string;
|
|
30
30
|
rule: TaskRecurrenceRule | null;
|
|
31
31
|
}
|
|
32
|
+
export declare function normalizeTaskRecurrenceRule(rule: TaskRecurrenceRule): TaskRecurrenceRule;
|
|
32
33
|
export interface TaskOccurrenceState {
|
|
33
34
|
completedAt?: number | null;
|
|
34
35
|
skipped?: boolean;
|
|
@@ -48,6 +49,7 @@ export interface DocumentTaskAttributes {
|
|
|
48
49
|
taskCompletedAt?: number | null;
|
|
49
50
|
}
|
|
50
51
|
export interface AssistantTask {
|
|
52
|
+
isSeries?: boolean;
|
|
51
53
|
taskRef: TaskRef;
|
|
52
54
|
revision: string;
|
|
53
55
|
title: string;
|
|
@@ -63,6 +65,8 @@ export interface AssistantTask {
|
|
|
63
65
|
documentRevision?: string;
|
|
64
66
|
occurrence?: TaskOccurrenceRef;
|
|
65
67
|
reminderAt?: string | null;
|
|
68
|
+
reminderOffsets?: number[];
|
|
69
|
+
occurrenceState?: TaskOccurrenceState;
|
|
66
70
|
recurrence?: TaskRecurrenceSegment[];
|
|
67
71
|
writable: boolean;
|
|
68
72
|
readonlyReason?: string;
|
|
@@ -73,6 +77,11 @@ export interface AssistantCalendarEvent {
|
|
|
73
77
|
revision: string;
|
|
74
78
|
title: string;
|
|
75
79
|
calendarId: number;
|
|
80
|
+
reminderOffsets?: number[];
|
|
81
|
+
notes?: {
|
|
82
|
+
contentId: number;
|
|
83
|
+
createdAt: number;
|
|
84
|
+
};
|
|
76
85
|
start: string;
|
|
77
86
|
end: string;
|
|
78
87
|
allDay: boolean;
|
|
@@ -116,4 +125,10 @@ export declare class TaskAssistantError extends Error {
|
|
|
116
125
|
constructor(code: string, message: string);
|
|
117
126
|
}
|
|
118
127
|
export declare function taskKey(ref: TaskRef): string;
|
|
128
|
+
export declare function encodeTaskIdComponent(value: string): string;
|
|
129
|
+
export declare function decodeTaskIdComponent(value: string): string;
|
|
130
|
+
export declare function parseTaskKey(value: string): {
|
|
131
|
+
taskRef: TaskRef;
|
|
132
|
+
occurrenceDate?: string;
|
|
133
|
+
} | null;
|
|
119
134
|
export declare function occurrenceKey(ref: TaskOccurrenceRef): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type TaskOccurrenceState } from "./contracts";
|
|
2
|
+
export interface TaskOccurrencePatch {
|
|
3
|
+
completed?: boolean;
|
|
4
|
+
skipped?: boolean;
|
|
5
|
+
scheduledAt?: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function patchOccurrenceState(state: TaskOccurrenceState, patch: TaskOccurrencePatch, now: number): TaskOccurrenceState;
|
|
@@ -29,8 +29,11 @@ export declare const TASK_WRITE_SCHEMAS: {
|
|
|
29
29
|
};
|
|
30
30
|
export type TaskWriteName = keyof typeof TASK_WRITE_SCHEMAS;
|
|
31
31
|
export declare const TASK_READ_SCHEMAS: {
|
|
32
|
+
query_todo_occurrence_states: TaskSchema;
|
|
32
33
|
query_todos: TaskSchema;
|
|
33
34
|
query_calendar_events: TaskSchema;
|
|
35
|
+
query_task_directories: TaskSchema;
|
|
36
|
+
get_task_object: TaskSchema;
|
|
34
37
|
query_task_operations: TaskSchema;
|
|
35
38
|
};
|
|
36
39
|
export type TaskReadName = keyof typeof TASK_READ_SCHEMAS;
|
|
@@ -11,7 +11,7 @@ export type EdgeFadeOptions = {
|
|
|
11
11
|
bottom?: boolean;
|
|
12
12
|
};
|
|
13
13
|
/** 滚动边缘状态:scroll 事件 + ResizeObserver(容器尺寸随窗口缩放/侧栏拖宽变化)+
|
|
14
|
-
MutationObserver
|
|
14
|
+
MutationObserver(节点增删与文字变化)三路监听,布尔翻转才 setState。
|
|
15
15
|
useLayoutEffect 内完成首次测量,避免能滚页面首帧渐隐缺失的闪烁。
|
|
16
16
|
参数是元素而非 RefObject:视图常有 loading 早退分支(容器晚于首帧挂载),
|
|
17
17
|
配合 callback ref 的 setState 才能在挂载时重新接线 */
|
|
@@ -20,6 +20,8 @@ export interface AnchoredPanelProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
20
20
|
anchor: HTMLElement | null;
|
|
21
21
|
/** 12 向全表(引擎 flip/shift 兜底),默认 bottom-start */
|
|
22
22
|
placement?: AnchoredPlacement;
|
|
23
|
+
/** 让可滚动预览适应锚点一侧的可用高度。 */
|
|
24
|
+
fitVerticalSpace?: boolean;
|
|
23
25
|
/** 显隐由宿主驱动;缺省锚点存在即显示(宿主托管用法) */
|
|
24
26
|
open?: boolean;
|
|
25
27
|
/** 8px 菱形箭头(随 flip 换边),默认关 */
|
|
@@ -30,7 +32,7 @@ export interface AnchoredPanelProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
30
32
|
/** 卡片 DOM 引用(AnchoredPanel 内部已占用一位做定位,此处合并外部引用) */
|
|
31
33
|
ref?: Ref<HTMLDivElement>;
|
|
32
34
|
}
|
|
33
|
-
export declare function AnchoredPanel({ anchor, placement, open, arrow, className, children, ref: externalRef, ...cardProps }: AnchoredPanelProps): import("react").ReactPortal | null;
|
|
35
|
+
export declare function AnchoredPanel({ anchor, placement, fitVerticalSpace, open, arrow, className, children, ref: externalRef, ...cardProps }: AnchoredPanelProps): import("react").ReactPortal | null;
|
|
34
36
|
export declare namespace AnchoredPanel {
|
|
35
37
|
var Body: typeof AnchoredPanelBody;
|
|
36
38
|
var Footer: typeof AnchoredPanelFooter;
|
|
@@ -15,6 +15,14 @@ export type AnchoredPlacement = AnchoredSide | `${AnchoredSide}-${AnchoredAlign}
|
|
|
15
15
|
export interface AnchoredPositionOptions {
|
|
16
16
|
gap?: number;
|
|
17
17
|
}
|
|
18
|
+
/** 可滚动的正文预览固定在可用空间较大的一侧,内容异步长高也不盖住触发文字。 */
|
|
19
|
+
export declare function fitVerticalPreview(anchor: {
|
|
20
|
+
top: number;
|
|
21
|
+
bottom: number;
|
|
22
|
+
}, placement: AnchoredPlacement, viewportHeight: number, gap?: number): {
|
|
23
|
+
placement: AnchoredPlacement;
|
|
24
|
+
maxHeight: number;
|
|
25
|
+
} | undefined;
|
|
18
26
|
export interface AnchoredPosition {
|
|
19
27
|
x: number;
|
|
20
28
|
y: number;
|
|
@@ -19,7 +19,10 @@ declare class Board {
|
|
|
19
19
|
private disconnectDocument?;
|
|
20
20
|
private projectingDocument;
|
|
21
21
|
attachDocument(document: WhiteboardDocumentBinding): void;
|
|
22
|
-
publishDocument(children: BoardElement[], sketch?: PageSketch, sequences?: PresentationSequence[]
|
|
22
|
+
publishDocument(children: BoardElement[], sketch?: PageSketch, sequences?: PresentationSequence[], body?: {
|
|
23
|
+
previous: BoardElement;
|
|
24
|
+
next: BoardElement;
|
|
25
|
+
}): void;
|
|
23
26
|
private plugins;
|
|
24
27
|
/** 指针在画布上的最近位置(画布坐标);指针离开画布为 null。`/` 放入等需要光标处的入口读取 */
|
|
25
28
|
pointer: Point | null;
|
|
@@ -66,8 +69,6 @@ declare class Board {
|
|
|
66
69
|
y: number;
|
|
67
70
|
} | null;
|
|
68
71
|
invalidateContainerRect(): void;
|
|
69
|
-
/** 剔除滞回的上一轮保留集合(见 filterElementsInViewport 的宽退出盒说明) */
|
|
70
|
-
private cullRetainedIds;
|
|
71
72
|
private snapshot;
|
|
72
73
|
/** 当前工具("tau.select" 表示非创建模式) */
|
|
73
74
|
private _activeTool;
|
|
@@ -130,6 +131,7 @@ declare class Board {
|
|
|
130
131
|
*/
|
|
131
132
|
private exitCreateToolOnEscape;
|
|
132
133
|
onKeyUp(event: KeyboardEvent): void;
|
|
134
|
+
canClaimPointer(button: number): boolean;
|
|
133
135
|
onPointerDown(event: PointerEvent): void;
|
|
134
136
|
onPointerUp(event: PointerEvent): void;
|
|
135
137
|
onPointerMove(event: PointerEvent): void;
|
|
@@ -157,6 +159,15 @@ declare class Board {
|
|
|
157
159
|
undo(): void;
|
|
158
160
|
redo(): void;
|
|
159
161
|
subscribe(callback: () => void): () => void;
|
|
162
|
+
private bodyLayout?;
|
|
163
|
+
getCanvasSnapshot(): {
|
|
164
|
+
children: BoardElement[];
|
|
165
|
+
viewPort: ViewPort;
|
|
166
|
+
selection: Selection;
|
|
167
|
+
presentationSequences: PresentationSequence[];
|
|
168
|
+
sketch: PageSketch;
|
|
169
|
+
version: number;
|
|
170
|
+
};
|
|
160
171
|
getSnapshot(): {
|
|
161
172
|
children: BoardElement[];
|
|
162
173
|
viewPort: ViewPort;
|
|
@@ -168,7 +179,7 @@ declare class Board {
|
|
|
168
179
|
getElementVersion(): number;
|
|
169
180
|
get activeTool(): string;
|
|
170
181
|
get activeToolOptions(): Readonly<Record<string, unknown>> | null;
|
|
171
|
-
/**
|
|
182
|
+
/** 当前工具是否用于创建元素。 */
|
|
172
183
|
isCreating(): boolean;
|
|
173
184
|
/**
|
|
174
185
|
* 设置当前工具;id 必须是已注册工具 id 或 "tau.select",否则抛错。
|
|
@@ -178,7 +189,10 @@ declare class Board {
|
|
|
178
189
|
/** 写齐字段后统一发事件 */
|
|
179
190
|
private applyToolChange;
|
|
180
191
|
getPlugin<T extends IBoardPlugin>(name: string): T | undefined;
|
|
181
|
-
filterElementsInViewport(elements: BoardElement[], expandPixels?: number
|
|
182
|
-
|
|
192
|
+
filterElementsInViewport(elements: BoardElement[], expandPixels?: number, vp?: ViewPort, retention?: {
|
|
193
|
+
previous: ReadonlySet<string>;
|
|
194
|
+
current: Set<string>;
|
|
195
|
+
}): VisibleElementTree[];
|
|
196
|
+
renderVisibleElements(elements?: VisibleElementTree[], liveText?: boolean): Array<React.ReactElement | null | undefined>;
|
|
183
197
|
}
|
|
184
198
|
export default Board;
|
|
@@ -45,12 +45,14 @@ export interface ChromeButtonProps extends ComponentProps<"button"> {
|
|
|
45
45
|
sub?: boolean;
|
|
46
46
|
kbd?: string;
|
|
47
47
|
tooltipPlacement?: TooltipPlacement;
|
|
48
|
+
/** 不显示悬停提示(按钮下方紧贴着自己的浮动件时,提示会把它挡住) */
|
|
49
|
+
hideTooltip?: boolean;
|
|
48
50
|
}
|
|
49
51
|
/**
|
|
50
52
|
* 浮动件图标按钮:30px,Tooltip 包在 button 外、ref 与注入的 props 透传到 button——
|
|
51
53
|
* 所以可以直接作为 Menu / Popover 的 trigger。展开时(aria-expanded)按下态、并暂停提示。
|
|
52
54
|
*/
|
|
53
|
-
export declare function ChromeButton({ label, active, sub, kbd, tooltipPlacement, className, children, ref, ...rest }: ChromeButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export declare function ChromeButton({ label, active, sub, kbd, tooltipPlacement, hideTooltip, className, children, ref, ...rest }: ChromeButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
54
56
|
/** 属性条的弹层方向:条在元素上方 → 向上展开;翻到元素下方 → 向下展开 */
|
|
55
57
|
export declare const AttrBarContext: import("react").Context<{
|
|
56
58
|
side: "top" | "bottom";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** 内置"选择"工具 id(非创建模式的哨兵值) */
|
|
2
2
|
export declare const SELECT_TOOL_ID = "tau.select";
|
|
3
|
+
export declare const HAND_TOOL_ID = "tau.hand";
|
|
3
4
|
/** 内置创建工具 id(工具按钮、右键菜单与扩展装配共用同一常量) */
|
|
4
5
|
export declare const GEOMETRY_TOOL_ID = "tau.geometry.create";
|
|
5
6
|
export declare const ARROW_TOOL_ID = "tau.arrow.create";
|
|
@@ -8,4 +9,6 @@ export declare const RICHTEXT_TOOL_ID = "tau.richtext.create";
|
|
|
8
9
|
export declare const MIND_TOOL_ID = "tau.mind.create";
|
|
9
10
|
export declare const FRAME_TOOL_ID = "tau.frame.create";
|
|
10
11
|
export declare const COLUMN_TOOL_ID = "tau.column.create";
|
|
12
|
+
/** 指针和文本模式都把已有对象的操作交还给元素。 */
|
|
13
|
+
export declare const allowsElementInteraction: (toolId: string) => toolId is "tau.select" | "tau.richtext.create";
|
|
11
14
|
export declare const builtinCreateToolIds: Set<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RefObject } from "react";
|
|
2
|
-
import { Board, Point, Selection
|
|
2
|
+
import { Board, Point, Selection } from "./types/index";
|
|
3
3
|
import { MovingElementsStore } from "./hooks/useElementsMoving";
|
|
4
4
|
import type { ConnectPointOwnerStore } from "./utils/ConnectPointOwner";
|
|
5
5
|
export interface PointerViewportStore {
|
|
@@ -11,7 +11,6 @@ export declare const BoardContext: import("react").Context<Board | null>;
|
|
|
11
11
|
export declare const SelectionContext: import("react").Context<Selection | null>;
|
|
12
12
|
/** 静态元素层(选中的箭头/内部连接元素已提升到交互层时)强制无选区;元素级选中订阅据此短路 */
|
|
13
13
|
export declare const StaticSelectionContext: import("react").Context<boolean>;
|
|
14
|
-
export declare const ViewPortContext: import("react").Context<ViewPort>;
|
|
15
14
|
export declare const BoardStateContext: import("react").Context<{
|
|
16
15
|
isMoving: boolean;
|
|
17
16
|
movingStore: MovingElementsStore;
|
|
@@ -31,7 +31,7 @@ export interface WhiteboardAPI {
|
|
|
31
31
|
/** 只读原因:文档版本高于当前应用时为 "document-too-new",普通只读为 null */
|
|
32
32
|
readonly readonlyReason: "document-too-new" | null;
|
|
33
33
|
readonly isDestroyed: boolean;
|
|
34
|
-
/** 当前激活工具 id
|
|
34
|
+
/** 当前激活工具 id(默认指针为 "tau.select",抓手为 "tau.hand") */
|
|
35
35
|
readonly activeTool: string;
|
|
36
36
|
/** 当前工具参数(如 geometry 的形状参数);无参数为 null */
|
|
37
37
|
readonly activeToolOptions: Readonly<Record<string, unknown>> | null;
|
|
@@ -333,6 +333,11 @@ export interface WhiteboardExtensionError {
|
|
|
333
333
|
}
|
|
334
334
|
export declare function defineWhiteboardExtension(definition: Omit<WhiteboardExtension, "apiVersion">): WhiteboardExtension;
|
|
335
335
|
export interface WhiteboardOutline {
|
|
336
|
+
/** 省略时显示内置元素树。 */
|
|
337
|
+
panel?: {
|
|
338
|
+
label: string;
|
|
339
|
+
content: ReactNode;
|
|
340
|
+
};
|
|
336
341
|
open: boolean;
|
|
337
342
|
width: number;
|
|
338
343
|
onWidthChange(width: number): void;
|
|
@@ -30,6 +30,7 @@ export { default as MindThemeUtil } from "./utils/MindThemeUtil";
|
|
|
30
30
|
export type { MindMode, MindNodeVisual } from "./utils/MindThemeUtil";
|
|
31
31
|
export { useWhiteboardAPI as useBoard } from "./extensions/context";
|
|
32
32
|
export { useSelection, useViewPort } from "./extensions/publicHooks";
|
|
33
|
+
export { useZoom } from "./hooks/useZoom";
|
|
33
34
|
export { useReadonly } from "./hooks/useReadonly";
|
|
34
35
|
export { useBoardState } from "./hooks/useBoardState";
|
|
35
36
|
export { useDropArrow } from "./hooks/useDropArrow";
|
|
@@ -49,6 +49,7 @@ export declare class InteractionManager {
|
|
|
49
49
|
* 拖拽仍可独立开启;右键按下进入平移手势兜底。
|
|
50
50
|
*/
|
|
51
51
|
tryStartPointerGesture(event: PointerEvent): void;
|
|
52
|
+
tryStartPanning(event: PointerEvent): boolean;
|
|
52
53
|
routePointerMove(event: PointerEvent): boolean;
|
|
53
54
|
routePointerUp(event: PointerEvent): boolean;
|
|
54
55
|
routeGlobalPointerMove(event: PointerEvent): boolean;
|
|
@@ -5,6 +5,7 @@ import type { InteractionState } from "../interactions/InteractionState";
|
|
|
5
5
|
export declare class MindPlugin implements IBoardPlugin {
|
|
6
6
|
private readonly text;
|
|
7
7
|
name: string;
|
|
8
|
+
readonly claimPointerButton = 0;
|
|
8
9
|
constructor(text?: TextExtensionOptions);
|
|
9
10
|
getCapabilities(): IElementCapabilities;
|
|
10
11
|
private dragState;
|
|
@@ -27,6 +27,8 @@ export type Events = "onMouseDown" | "onMouseMove" | "onMouseUp" | "onMouseEnter
|
|
|
27
27
|
export interface IBoardPlugin {
|
|
28
28
|
dispose?(): void;
|
|
29
29
|
name: string;
|
|
30
|
+
/** 限定命中查询的按键;未声明时保留全部按键。 */
|
|
31
|
+
claimPointerButton?: number;
|
|
30
32
|
/**
|
|
31
33
|
* 元素类型自定义指针手势声明:pointerdown 命中该类型元素时由交互内核
|
|
32
34
|
* 在广播前调用,返回手势状态则由内核接管路由(取代通用选择/拖拽并消费
|
|
@@ -10,7 +10,7 @@ export declare class GeometryUtil {
|
|
|
10
10
|
readonly strokeWidth: number;
|
|
11
11
|
readonly strokeOpacity: number;
|
|
12
12
|
readonly color: string | undefined;
|
|
13
|
-
readonly theme: "
|
|
13
|
+
readonly theme: "light" | "dark" | undefined;
|
|
14
14
|
readonly cornerRadius: number;
|
|
15
15
|
readonly textAlign: "center" | "left" | "right";
|
|
16
16
|
readonly fillStyle: SketchFillStyle | undefined;
|
package/unified.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PACKAGE_FORMAT_MIN_VERSIONS,
|
|
3
|
+
buildUnifiedPackageManifest,
|
|
4
|
+
buildUnifiedPluginManifest,
|
|
5
|
+
isWebPluginManifest,
|
|
6
|
+
packageTargets,
|
|
7
|
+
readApplicationPluginManifest,
|
|
8
|
+
validateUnifiedPackageManifest,
|
|
9
|
+
validateUnifiedPluginManifest
|
|
10
|
+
} from "./client/chunk-UGYIAPAN.js";
|
|
11
|
+
import "./client/chunk-UTVEXGFI.js";
|
|
12
|
+
export {
|
|
13
|
+
PACKAGE_FORMAT_MIN_VERSIONS,
|
|
14
|
+
buildUnifiedPackageManifest,
|
|
15
|
+
buildUnifiedPluginManifest,
|
|
16
|
+
isWebPluginManifest,
|
|
17
|
+
packageTargets,
|
|
18
|
+
readApplicationPluginManifest,
|
|
19
|
+
validateUnifiedPackageManifest,
|
|
20
|
+
validateUnifiedPluginManifest
|
|
21
|
+
};
|