aot-ui 0.2.2 → 0.2.4
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/dist-lib/aot-ui.css +1 -1
- package/dist-lib/aot-ui.js +5645 -26857
- package/dist-lib/index.d.ts +0 -1
- package/dist-lib/modules/button/components/Button.d.ts +24 -2
- package/dist-lib/modules/download/components/Download.d.ts +2 -2
- package/dist-lib/modules/download/index.d.ts +3 -1
- package/dist-lib/modules/download/resumeStorage.d.ts +3 -0
- package/dist-lib/modules/download/types.d.ts +56 -2
- package/package.json +1 -1
- package/dist-lib/modules/splash-intro/components/AppSplash.d.ts +0 -25
- package/dist-lib/modules/splash-intro/components/SplashIntro.d.ts +0 -38
- package/dist-lib/modules/splash-intro/components/SplashLogo.d.ts +0 -2
- package/dist-lib/modules/splash-intro/components/SplashStagger.d.ts +0 -14
- package/dist-lib/modules/splash-intro/constants.d.ts +0 -8
- package/dist-lib/modules/splash-intro/context.d.ts +0 -13
- package/dist-lib/modules/splash-intro/index.d.ts +0 -10
- package/dist-lib/modules/splash-intro/types.d.ts +0 -4
package/dist-lib/index.d.ts
CHANGED
|
@@ -135,7 +135,6 @@ export * from './modules/slide-confirm';
|
|
|
135
135
|
export * from './modules/slider';
|
|
136
136
|
export * from './modules/space';
|
|
137
137
|
export * from './modules/spin';
|
|
138
|
-
export * from './modules/splash-intro';
|
|
139
138
|
export * from './modules/splitter';
|
|
140
139
|
export * from './modules/spotlight-tour';
|
|
141
140
|
export * from './modules/star-rating';
|
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare const Button: import('react').ForwardRefExoticComponent<{
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
tone?: import('..').ButtonTone;
|
|
5
|
+
size?: import('..').ButtonSize;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
loadingIcon?: ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
block?: boolean;
|
|
10
|
+
plain?: boolean;
|
|
11
|
+
text?: boolean;
|
|
12
|
+
bg?: boolean;
|
|
13
|
+
link?: boolean;
|
|
14
|
+
round?: boolean;
|
|
15
|
+
circle?: boolean;
|
|
16
|
+
dashed?: boolean;
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
iconPosition?: import('..').ButtonIconPosition;
|
|
19
|
+
color?: string;
|
|
20
|
+
autoInsertSpace?: boolean;
|
|
21
|
+
tag?: import('react').ElementType;
|
|
22
|
+
href?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
} & Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DownloadProps } from '../types';
|
|
2
|
-
export declare
|
|
1
|
+
import { DownloadHandle, DownloadProps } from '../types';
|
|
2
|
+
export declare const Download: import('react').ForwardRefExoticComponent<DownloadProps & import('react').RefAttributes<DownloadHandle>>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { Download } from './components/Download';
|
|
2
2
|
export { DL_CHUNK_SIZE, DL_DEFAULT_CONCURRENCY, DL_DEMO_TASKS, DL_HARD_CONCURRENCY, DL_LARGE_THRESHOLD, DL_MIN_CONCURRENCY, } from './constants';
|
|
3
|
-
export
|
|
3
|
+
export { clearDownloadCheckpoint, listDownloadCheckpoints, readDownloadCheckpoint, writeDownloadCheckpoint, } from './resumeStorage';
|
|
4
|
+
export type { DownloadCheckpoint } from './resumeStorage';
|
|
5
|
+
export type { DownloadHandle, DownloadItem, DownloadProps, DownloadRunSignal, DownloadStatus, DownloadTaskInput, DownloadTransport, DownloadTransportContext, DownloadTransportResult, } from './types';
|
|
@@ -5,6 +5,9 @@ export type DownloadCheckpoint = {
|
|
|
5
5
|
/** Next byte offset to fetch. */
|
|
6
6
|
offset: number;
|
|
7
7
|
updatedAt: number;
|
|
8
|
+
/** Remote URL for resume after app restart. */
|
|
9
|
+
url?: string;
|
|
10
|
+
extra?: Record<string, unknown>;
|
|
8
11
|
};
|
|
9
12
|
export declare function readDownloadCheckpoint(storageKey: string, id: string): DownloadCheckpoint | null;
|
|
10
13
|
export declare function writeDownloadCheckpoint(storageKey: string, checkpoint: DownloadCheckpoint): void;
|
|
@@ -6,8 +6,14 @@ export type DownloadItem = {
|
|
|
6
6
|
size: number;
|
|
7
7
|
status: DownloadStatus;
|
|
8
8
|
percent: number;
|
|
9
|
-
/** Object URL when finished (demo). */
|
|
9
|
+
/** Object URL when finished (demo) or remote URL for transport. */
|
|
10
10
|
url?: string;
|
|
11
|
+
/** Remote download URL (kept separate when `url` becomes a blob URL). */
|
|
12
|
+
remoteUrl?: string;
|
|
13
|
+
/** Local filesystem path after native download completes. */
|
|
14
|
+
localPath?: string;
|
|
15
|
+
/** App-specific payload restored from checkpoints. */
|
|
16
|
+
extra?: Record<string, unknown>;
|
|
11
17
|
/** Resumed from a previous session checkpoint. */
|
|
12
18
|
resumed?: boolean;
|
|
13
19
|
error?: string;
|
|
@@ -16,9 +22,45 @@ export type DownloadTaskInput = {
|
|
|
16
22
|
name: string;
|
|
17
23
|
/** Simulated / declared file size in bytes. */
|
|
18
24
|
size?: number;
|
|
19
|
-
/** Optional remote URL;
|
|
25
|
+
/** Optional remote URL; used by HTTP/native transport. */
|
|
20
26
|
url?: string;
|
|
21
27
|
id?: string;
|
|
28
|
+
extra?: Record<string, unknown>;
|
|
29
|
+
};
|
|
30
|
+
export type DownloadRunSignal = {
|
|
31
|
+
aborted: boolean;
|
|
32
|
+
paused: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type DownloadTransportContext = {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
/** Remote URL when provided. */
|
|
38
|
+
url?: string;
|
|
39
|
+
size: number;
|
|
40
|
+
/** Byte offset already downloaded (from checkpoint / .part). */
|
|
41
|
+
offset: number;
|
|
42
|
+
signal: DownloadRunSignal;
|
|
43
|
+
extra?: Record<string, unknown>;
|
|
44
|
+
onProgress: (received: number, total: number | null) => void;
|
|
45
|
+
persistOffset: (offset: number) => void;
|
|
46
|
+
};
|
|
47
|
+
export type DownloadTransportResult = {
|
|
48
|
+
/** Blob / object URL for browser save. */
|
|
49
|
+
url?: string;
|
|
50
|
+
/** Native filesystem path. */
|
|
51
|
+
localPath?: string;
|
|
52
|
+
size?: number;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Custom download engine (e.g. Tauri Range download).
|
|
56
|
+
* Throw `Error("paused")` / `Error("aborted")` to align with built-in controls.
|
|
57
|
+
*/
|
|
58
|
+
export type DownloadTransport = (ctx: DownloadTransportContext) => Promise<DownloadTransportResult>;
|
|
59
|
+
export type DownloadHandle = {
|
|
60
|
+
enqueue: (tasks: DownloadTaskInput[]) => void;
|
|
61
|
+
pause: (id: string) => void;
|
|
62
|
+
resume: (id: string) => void;
|
|
63
|
+
cancel: (id: string) => void;
|
|
22
64
|
};
|
|
23
65
|
export type DownloadProps = {
|
|
24
66
|
className?: string;
|
|
@@ -54,6 +96,18 @@ export type DownloadProps = {
|
|
|
54
96
|
hardConcurrency?: number;
|
|
55
97
|
/** 隐藏并发步进器 */
|
|
56
98
|
hideConcurrencyControl?: boolean;
|
|
99
|
+
/** 隐藏内置演示「添加任务」按钮 */
|
|
100
|
+
hideDemoActions?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* 隐藏整条工具栏(说明文案 / 并发 / 演示按钮)
|
|
103
|
+
* 适合业务侧只用水牛引擎、自绘任务列表的场景
|
|
104
|
+
* @default false
|
|
105
|
+
*/
|
|
106
|
+
hideToolbar?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* 自定义下载传输;未传时:有 url 则 HTTP Range,否则模拟分片
|
|
109
|
+
*/
|
|
110
|
+
transport?: DownloadTransport;
|
|
57
111
|
onConcurrencyChange?: (n: number) => void;
|
|
58
112
|
onChange?: (items: DownloadItem[]) => void;
|
|
59
113
|
onComplete?: (item: DownloadItem) => void;
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { SplashIntroProps } from './SplashIntro';
|
|
3
|
-
export type AppSplashProps = Omit<SplashIntroProps, "children"> & {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
/**
|
|
6
|
-
* 为 true 时用 SplashStagger 包裹子树(主内容错落入场)。
|
|
7
|
-
* 若子组件自行使用 useSplashReady + SplashStagger,保持 false。
|
|
8
|
-
* @default false
|
|
9
|
-
*/
|
|
10
|
-
staggerChildren?: boolean;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* 主程序启动动画入口。
|
|
14
|
-
* 默认 fullscreen;演示页可传 fullscreen={false} + minHeight 嵌入预览。
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <AppSplash brand="启动中" brandSub="AOT">
|
|
19
|
-
* <AppShell>
|
|
20
|
-
* <HomePage />
|
|
21
|
-
* </AppShell>
|
|
22
|
-
* </AppSplash>
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export declare function AppSplash({ children, staggerChildren, brand, brandSub, fullscreen, minHeight, ...rest }: AppSplashProps): import('react').JSX.Element;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
export type SplashPhase = "breath" | "reveal" | "enter" | "done";
|
|
3
|
-
export type SplashIntroProps = {
|
|
4
|
-
children: ReactNode | ((ctx: {
|
|
5
|
-
contentReady: boolean;
|
|
6
|
-
phase: SplashPhase;
|
|
7
|
-
}) => ReactNode);
|
|
8
|
-
/** 跳过动画,直接展示内容 */
|
|
9
|
-
skip?: boolean;
|
|
10
|
-
/** 点击遮罩可跳过(进入 reveal→done 快进) */
|
|
11
|
-
clickToSkip?: boolean;
|
|
12
|
-
/** 显示右上角「跳过」按钮 */
|
|
13
|
-
showSkipButton?: boolean;
|
|
14
|
-
skipLabel?: string;
|
|
15
|
-
/** Brand caption under logo on the veil. Pass empty string to hide. */
|
|
16
|
-
brand?: string;
|
|
17
|
-
brandSub?: string;
|
|
18
|
-
/** 自定义 Logo;默认内置 SplashLogo */
|
|
19
|
-
logo?: ReactNode;
|
|
20
|
-
/** 呼吸阶段时长 ms */
|
|
21
|
-
breathMs?: number;
|
|
22
|
-
/** 揭示阶段时长 ms */
|
|
23
|
-
revealMs?: number;
|
|
24
|
-
/** 遮罩淡出时长 ms */
|
|
25
|
-
veilFadeMs?: number;
|
|
26
|
-
/** 遮罩背景色 */
|
|
27
|
-
background?: string;
|
|
28
|
-
/** 最小高度(修复仅 min-height 父级时高度塌缩) */
|
|
29
|
-
minHeight?: number | string;
|
|
30
|
-
/** 铺满父级(常用 100% / 100vh) */
|
|
31
|
-
fullscreen?: boolean;
|
|
32
|
-
className?: string;
|
|
33
|
-
style?: CSSProperties;
|
|
34
|
-
onPhaseChange?: (phase: SplashPhase) => void;
|
|
35
|
-
onDone?: () => void;
|
|
36
|
-
onSkip?: () => void;
|
|
37
|
-
};
|
|
38
|
-
export declare function SplashIntro({ children, skip, clickToSkip, showSkipButton, skipLabel, brand, brandSub, logo, breathMs, revealMs, veilFadeMs, background, minHeight, fullscreen, className, style, onPhaseChange, onDone, onSkip, }: SplashIntroProps): import('react').JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
export type SplashStaggerProps = {
|
|
3
|
-
/** 为 true 时子项错落入场;false 时保持隐藏待播 */
|
|
4
|
-
ready?: boolean;
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
style?: CSSProperties;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* 启动揭示后的内容错落入场容器。
|
|
11
|
-
* 通常配合 SplashIntro 的 contentReady:
|
|
12
|
-
* `<SplashStagger ready={contentReady}>{…}</SplashStagger>`
|
|
13
|
-
*/
|
|
14
|
-
export declare function SplashStagger({ ready, children, className, style, }: SplashStaggerProps): import('react').JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const SPLASH_BREATH_MS = 600;
|
|
2
|
-
export declare const SPLASH_REVEAL_MS = 700;
|
|
3
|
-
export declare const SPLASH_STAGGER_MS = 60;
|
|
4
|
-
/** Extra hold after reveal before removing veil (ms). */
|
|
5
|
-
export declare const SPLASH_VEIL_FADE_MS = 180;
|
|
6
|
-
/** Veil brand caption (unicode escapes keep encoding stable). */
|
|
7
|
-
export declare const SPLASH_BRAND = "\u542F\u52A8\u4E2D";
|
|
8
|
-
export declare const SPLASH_BRAND_SUB = "AOT";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { SplashPhase } from './components/SplashIntro';
|
|
3
|
-
export type SplashContextValue = {
|
|
4
|
-
contentReady: boolean;
|
|
5
|
-
phase: SplashPhase;
|
|
6
|
-
};
|
|
7
|
-
export declare function SplashProvider({ value, children, }: {
|
|
8
|
-
value: SplashContextValue;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}): import('react').JSX.Element;
|
|
11
|
-
/** 读取主程序 / AppSplash 的入场状态;未包裹时默认已就绪 */
|
|
12
|
-
export declare function useSplash(): SplashContextValue;
|
|
13
|
-
export declare function useSplashReady(): boolean;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { SplashIntro } from './components/SplashIntro';
|
|
2
|
-
export type { SplashIntroProps, SplashPhase } from './components/SplashIntro';
|
|
3
|
-
export { SplashLogo } from './components/SplashLogo';
|
|
4
|
-
export { SplashStagger } from './components/SplashStagger';
|
|
5
|
-
export type { SplashStaggerProps } from './components/SplashStagger';
|
|
6
|
-
export { AppSplash } from './components/AppSplash';
|
|
7
|
-
export type { AppSplashProps } from './components/AppSplash';
|
|
8
|
-
export { useSplash, useSplashReady } from './context';
|
|
9
|
-
export type { SplashContextValue } from './context';
|
|
10
|
-
export { SPLASH_BREATH_MS, SPLASH_REVEAL_MS, SPLASH_STAGGER_MS, SPLASH_VEIL_FADE_MS, SPLASH_BRAND, SPLASH_BRAND_SUB, } from './constants';
|