clickgo 6.7.2 → 6.8.1
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/AGENTS.md +14 -0
- package/dist/app/demo.cga +0 -0
- package/dist/app/task.cga +0 -0
- package/dist/clickgo.d.ts +21 -0
- package/dist/control/common.cgc +0 -0
- package/dist/control/desktop.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/iconview.cgc +0 -0
- package/dist/control/jodit.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/control/tuieditor.cgc +0 -0
- package/dist/global.css +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/control.d.ts +69 -0
- package/dist/lib/core.d.ts +37 -1
- package/dist/lib/dom.d.ts +15 -1
- package/dist/lib/form.d.ts +43 -1
- package/dist/lib/task.d.ts +59 -2
- package/dist/lib/tool.d.ts +14 -1
- package/dist/theme/modern-light.cgt +0 -0
- package/dist/theme/modern.cgt +0 -0
- package/dist/theme/software-dark.cgt +0 -0
- package/dist/theme/software-light.cgt +0 -0
- package/doc/clickgo-rag.md +2399 -934
- package/package.json +12 -3
- package/test/core-module-loading.mjs +169 -0
- package/test/desktop.mjs +715 -0
- package/test/dom-style.mjs +261 -0
- package/test/form-launcher.mjs +102 -0
- package/test/form-native-regions.mjs +115 -0
- package/test/form-notify.mjs +90 -0
- package/test/form-viewport.mjs +79 -2
- package/test/iconview.mjs +70 -0
- package/test/jodit-lifecycle.mjs +212 -0
- package/test/rtl-archive.mjs +1 -1
- package/test/scroll.mjs +145 -0
- package/test/task-package-loading.mjs +94 -0
- package/test/task-tray.mjs +331 -0
- package/test/tool-assets.mjs +64 -0
- package/test/tuieditor-locale.mjs +175 -0
- package/test/vflow.mjs +122 -0
- package/dist/theme/compact-dark.cgt +0 -0
- package/dist/theme/compact-light.cgt +0 -0
package/dist/lib/control.d.ts
CHANGED
|
@@ -438,6 +438,8 @@ export interface IIconviewOpenEvent {
|
|
|
438
438
|
}
|
|
439
439
|
export interface IIconviewDropEvent {
|
|
440
440
|
'detail': {
|
|
441
|
+
/** --- 原始松手指针事件,可读取 Ctrl/Shift/Alt;Pointer.js 1.8.0 起提供 --- */
|
|
442
|
+
'event'?: PointerEvent;
|
|
441
443
|
'self': boolean;
|
|
442
444
|
'from': Array<{
|
|
443
445
|
'index': number;
|
|
@@ -466,6 +468,73 @@ export interface IIconviewSelectEvent {
|
|
|
466
468
|
};
|
|
467
469
|
};
|
|
468
470
|
}
|
|
471
|
+
/** --- 桌面图标;位置和选择使用稳定 ID,不依赖数据顺序 --- */
|
|
472
|
+
export interface IDesktopItem {
|
|
473
|
+
'id': string;
|
|
474
|
+
'name': string;
|
|
475
|
+
'icon'?: string;
|
|
476
|
+
/** --- 通用文件拖拽路径,由应用解释和执行操作 --- */
|
|
477
|
+
'path'?: string;
|
|
478
|
+
/** --- 0: 文件夹,1: 文件 --- */
|
|
479
|
+
'type'?: 0 | 1;
|
|
480
|
+
/** --- 禁止用户拖动;区域变化时仍可自动调整位置 --- */
|
|
481
|
+
'locked'?: boolean;
|
|
482
|
+
}
|
|
483
|
+
/** --- 相对控件内边缘的物理像素坐标,RTL 下也不镜像 --- */
|
|
484
|
+
export interface IDesktopPosition {
|
|
485
|
+
'x': number;
|
|
486
|
+
'y': number;
|
|
487
|
+
}
|
|
488
|
+
/** --- 图标 ID 到位置的映射,可独立保存和恢复 --- */
|
|
489
|
+
export type TDesktopPositions = Record<string, IDesktopPosition>;
|
|
490
|
+
/** --- 布局变化的来源 --- */
|
|
491
|
+
export type TDesktopLayoutReason = 'data' | 'positions' | 'resize' | 'options' | 'arrange' | 'drag';
|
|
492
|
+
/** --- 用户选择完成后的通知,属性同步不触发 --- */
|
|
493
|
+
export interface IDesktopSelectEvent {
|
|
494
|
+
'detail': {
|
|
495
|
+
'value': string[];
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
/** --- 双击、Enter 或溢出菜单请求打开图标 --- */
|
|
499
|
+
export interface IDesktopOpenEvent {
|
|
500
|
+
'detail': {
|
|
501
|
+
'value': string[];
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
/** --- 自动重排或用户拖动完成后的布局快照 --- */
|
|
505
|
+
export interface IDesktopLayoutEvent {
|
|
506
|
+
'detail': {
|
|
507
|
+
'positions': TDesktopPositions;
|
|
508
|
+
/** --- 持久化位置,窗口临时缩小时不被覆盖 --- */
|
|
509
|
+
'preferredPositions': TDesktopPositions;
|
|
510
|
+
'overflow': string[];
|
|
511
|
+
'reason': TDesktopLayoutReason;
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
/** --- 未放入区域的图标 ID 发生变化;数据和已有位置仍保留 --- */
|
|
515
|
+
export interface IDesktopOverflowEvent {
|
|
516
|
+
'detail': {
|
|
517
|
+
'value': string[];
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
/** --- 文件拖入桌面或目录,文件操作由应用决定 --- */
|
|
521
|
+
export interface IDesktopDropEvent {
|
|
522
|
+
'detail': {
|
|
523
|
+
/** --- 原始松手指针事件,可读取 Ctrl/Shift/Alt;Pointer.js 1.8.0 起提供 --- */
|
|
524
|
+
'event'?: PointerEvent;
|
|
525
|
+
'self': boolean;
|
|
526
|
+
'from': Array<{
|
|
527
|
+
'id'?: string;
|
|
528
|
+
'index': number;
|
|
529
|
+
'type': -1 | 0 | 1;
|
|
530
|
+
'path': string;
|
|
531
|
+
'name'?: string;
|
|
532
|
+
'icon'?: string;
|
|
533
|
+
}>;
|
|
534
|
+
'to': IDesktopItem | null;
|
|
535
|
+
'position': IDesktopPosition;
|
|
536
|
+
};
|
|
537
|
+
}
|
|
469
538
|
export interface ILevelselectLevelEvent {
|
|
470
539
|
'detail': {
|
|
471
540
|
'list': Array<{
|
package/dist/lib/core.d.ts
CHANGED
|
@@ -69,6 +69,40 @@ export declare abstract class AbstractApp {
|
|
|
69
69
|
onFormShowInSystemTaskChange(taskId: string, formId: string, value: boolean): void | Promise<void>;
|
|
70
70
|
/** --- 窗体的 formHash 改变事件 --- */
|
|
71
71
|
onFormHashChange(taskId: string, formId: string, value: string, data: Record<string, any>): void | Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* --- 托盘注册通知;通过 task.getTrayList(this) 读取快照 ---
|
|
74
|
+
* @param taskId 所属任务
|
|
75
|
+
* @param trayId 托盘 ID
|
|
76
|
+
* @returns 无返回值
|
|
77
|
+
*/
|
|
78
|
+
onTrayCreated(taskId: string, trayId: string): void | Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* --- 托盘数据变更通知 ---
|
|
81
|
+
* @param taskId 所属任务
|
|
82
|
+
* @param trayId 托盘 ID
|
|
83
|
+
* @returns 无返回值
|
|
84
|
+
*/
|
|
85
|
+
onTrayChanged(taskId: string, trayId: string): void | Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* --- 托盘删除通知 ---
|
|
88
|
+
* @param taskId 所属任务
|
|
89
|
+
* @param trayId 托盘 ID
|
|
90
|
+
* @returns 无返回值
|
|
91
|
+
*/
|
|
92
|
+
onTrayRemoved(taskId: string, trayId: string): void | Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* --- 自己的托盘左键点击,只投递到所属任务 ---
|
|
95
|
+
* @param trayId 托盘 ID
|
|
96
|
+
* @returns 无返回值
|
|
97
|
+
*/
|
|
98
|
+
onTrayClick(trayId: string): void | Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* --- 自己的托盘菜单命令,只投递到所属任务 ---
|
|
101
|
+
* @param trayId 托盘 ID
|
|
102
|
+
* @param menuId 菜单命令
|
|
103
|
+
* @returns 无返回值
|
|
104
|
+
*/
|
|
105
|
+
onTrayMenuClick(trayId: string, menuId: string): void | Promise<void>;
|
|
72
106
|
/** --- 任务开始事件 --- */
|
|
73
107
|
onTaskStarted(taskId: string): void | Promise<void>;
|
|
74
108
|
/** --- 任务结束事件 --- */
|
|
@@ -169,6 +203,8 @@ export declare function init(): void;
|
|
|
169
203
|
export interface IConfig {
|
|
170
204
|
'locale': string;
|
|
171
205
|
['task.position']: 'left' | 'right' | 'top' | 'bottom';
|
|
206
|
+
['task.mode']: 'bar' | 'dock';
|
|
207
|
+
['task.margin']: number;
|
|
172
208
|
['task.pin']: Record<string, {
|
|
173
209
|
'name': string;
|
|
174
210
|
'icon': string;
|
|
@@ -202,7 +238,7 @@ export interface IAvailArea {
|
|
|
202
238
|
'oheight': number;
|
|
203
239
|
}
|
|
204
240
|
/** --- 全局事件类型 --- */
|
|
205
|
-
export type TGlobalEvent = 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'formShowInSystemTaskChange' | 'formHashChange' | 'taskStarted' | 'taskEnded' | 'launcherFolderNameChanged' | 'hashChanged' | 'keydown' | 'keyup';
|
|
241
|
+
export type TGlobalEvent = 'trayCreated' | 'trayChanged' | 'trayRemoved' | 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'formShowInSystemTaskChange' | 'formHashChange' | 'taskStarted' | 'taskEnded' | 'launcherFolderNameChanged' | 'hashChanged' | 'keydown' | 'keyup';
|
|
206
242
|
/** --- 现场下载 app 的参数 --- */
|
|
207
243
|
export interface ICoreFetchAppOptions {
|
|
208
244
|
'notify'?: number | {
|
package/dist/lib/dom.d.ts
CHANGED
|
@@ -199,23 +199,36 @@ export declare function isWatch(el: HTMLElement): boolean;
|
|
|
199
199
|
* @param taskId 任务 id
|
|
200
200
|
*/
|
|
201
201
|
export declare function clearWatch(taskId: lCore.TCurrent): void;
|
|
202
|
+
/** --- 样式变化通知回调 --- */
|
|
203
|
+
type TWatchStyleCallback = (name: string, value: string, old: string) => void | Promise<void>;
|
|
202
204
|
/**
|
|
203
205
|
* --- 监听一个标签的计算后样式的变化 ---
|
|
204
206
|
* @param el 对象
|
|
205
207
|
* @param name 样式名
|
|
206
208
|
* @param cb 变更回调
|
|
207
209
|
* @param immediate 是否立刻执行一次
|
|
210
|
+
* @returns 无返回值
|
|
208
211
|
*/
|
|
209
|
-
export declare function watchStyle(el: HTMLElement, name: string | string[], cb:
|
|
212
|
+
export declare function watchStyle(el: HTMLElement, name: string | string[], cb: TWatchStyleCallback, immediate?: boolean): void;
|
|
213
|
+
/**
|
|
214
|
+
* --- 取消元素的样式监听,可只移除指定属性或指定回调 ---
|
|
215
|
+
* @param el 要取消监听的元素,移出页面后仍可取消
|
|
216
|
+
* @param name 样式名,留空则匹配全部属性
|
|
217
|
+
* @param cb 只移除此回调,留空则移除匹配属性的全部回调
|
|
218
|
+
* @returns 无返回值
|
|
219
|
+
*/
|
|
220
|
+
export declare function unwatchStyle(el: HTMLElement, name?: string | string[], cb?: TWatchStyleCallback): void;
|
|
210
221
|
/**
|
|
211
222
|
* --- 检测一个标签是否正在被 watchStyle ---
|
|
212
223
|
* @param el 要检测的标签
|
|
224
|
+
* @returns 是否有属于该元素的样式监听
|
|
213
225
|
*/
|
|
214
226
|
export declare function isWatchStyle(el: HTMLElement): boolean;
|
|
215
227
|
/**
|
|
216
228
|
* --- 清除某个窗体的所有 watch style 监视 ---
|
|
217
229
|
* @param formId 窗体 id
|
|
218
230
|
* @param panelId 若指定则只清除当前窗体的某个 panel 的 watch
|
|
231
|
+
* @returns 无返回值
|
|
219
232
|
*/
|
|
220
233
|
export declare function clearWatchStyle(formId: string, panelId?: string): void;
|
|
221
234
|
/**
|
|
@@ -434,3 +447,4 @@ export interface IGetWatchInfoResult {
|
|
|
434
447
|
};
|
|
435
448
|
}>>;
|
|
436
449
|
}
|
|
450
|
+
export {};
|
package/dist/lib/form.d.ts
CHANGED
|
@@ -286,6 +286,40 @@ export declare abstract class AbstractForm extends AbstractCommon {
|
|
|
286
286
|
onFormShowInSystemTaskChange(taskId: string, formId: string, value: boolean): void | Promise<void>;
|
|
287
287
|
/** --- 窗体的 formHash 改变事件 --- */
|
|
288
288
|
onFormHashChange(taskId: string, formId: string, value: string, data: Record<string, any>): void | Promise<void>;
|
|
289
|
+
/**
|
|
290
|
+
* --- 托盘注册通知;通过 task.getTrayList(this) 读取快照 ---
|
|
291
|
+
* @param taskId 所属任务
|
|
292
|
+
* @param trayId 托盘 ID
|
|
293
|
+
* @returns 无返回值
|
|
294
|
+
*/
|
|
295
|
+
onTrayCreated(taskId: string, trayId: string): void | Promise<void>;
|
|
296
|
+
/**
|
|
297
|
+
* --- 托盘数据变更通知 ---
|
|
298
|
+
* @param taskId 所属任务
|
|
299
|
+
* @param trayId 托盘 ID
|
|
300
|
+
* @returns 无返回值
|
|
301
|
+
*/
|
|
302
|
+
onTrayChanged(taskId: string, trayId: string): void | Promise<void>;
|
|
303
|
+
/**
|
|
304
|
+
* --- 托盘删除通知 ---
|
|
305
|
+
* @param taskId 所属任务
|
|
306
|
+
* @param trayId 托盘 ID
|
|
307
|
+
* @returns 无返回值
|
|
308
|
+
*/
|
|
309
|
+
onTrayRemoved(taskId: string, trayId: string): void | Promise<void>;
|
|
310
|
+
/**
|
|
311
|
+
* --- 自己的托盘左键点击,只投递到所属任务 ---
|
|
312
|
+
* @param trayId 托盘 ID
|
|
313
|
+
* @returns 无返回值
|
|
314
|
+
*/
|
|
315
|
+
onTrayClick(trayId: string): void | Promise<void>;
|
|
316
|
+
/**
|
|
317
|
+
* --- 自己的托盘菜单命令,只投递到所属任务 ---
|
|
318
|
+
* @param trayId 托盘 ID
|
|
319
|
+
* @param menuId 菜单命令
|
|
320
|
+
* @returns 无返回值
|
|
321
|
+
*/
|
|
322
|
+
onTrayMenuClick(trayId: string, menuId: string): void | Promise<void>;
|
|
289
323
|
/** --- 任务开始事件 --- */
|
|
290
324
|
onTaskStarted(taskId: string): void | Promise<void>;
|
|
291
325
|
/** --- 任务结束事件 --- */
|
|
@@ -439,8 +473,10 @@ export declare function changeFocusMaxZIndex(): Promise<void>;
|
|
|
439
473
|
/**
|
|
440
474
|
* --- 根据 border 方向 获取理论窗体大小 ---
|
|
441
475
|
* @param border 显示的位置代号
|
|
476
|
+
* @param area 布局区域,默认避开任务栏
|
|
477
|
+
* @returns 对应区域内的窗体矩形
|
|
442
478
|
*/
|
|
443
|
-
export declare function getRectByBorder(border: lDom.TDomBorderCustom): {
|
|
479
|
+
export declare function getRectByBorder(border: lDom.TDomBorderCustom, area?: lCore.IAvailArea): {
|
|
444
480
|
'width': number;
|
|
445
481
|
'height': number;
|
|
446
482
|
'left': number;
|
|
@@ -455,6 +491,7 @@ export declare function showCircular(x: number, y: number): void;
|
|
|
455
491
|
/**
|
|
456
492
|
* --- 移动矩形到新位置 ---
|
|
457
493
|
* @param border 显示的位置代号
|
|
494
|
+
* @returns 无返回值
|
|
458
495
|
*/
|
|
459
496
|
export declare function moveRectangle(border: lDom.TDomBorderCustom): void;
|
|
460
497
|
/**
|
|
@@ -474,6 +511,11 @@ export declare function hideRectangle(): void;
|
|
|
474
511
|
* @param type 样式,可留空
|
|
475
512
|
*/
|
|
476
513
|
export declare function alert(content: string, type?: 'default' | 'primary' | 'info' | 'warning' | 'danger' | 'cg'): number;
|
|
514
|
+
/**
|
|
515
|
+
* --- 按当前可用区域和实际高度重新排列通知 ---
|
|
516
|
+
* @returns 无返回值
|
|
517
|
+
*/
|
|
518
|
+
export declare function refreshNotifyPosition(): void;
|
|
477
519
|
/**
|
|
478
520
|
* --- 弹出右下角信息框 ---
|
|
479
521
|
* @param opt timeout 默认 5 秒,最大 10 分钟
|
package/dist/lib/task.d.ts
CHANGED
|
@@ -6,6 +6,65 @@ import * as lControl from './control';
|
|
|
6
6
|
* @param id 系统级 ID
|
|
7
7
|
*/
|
|
8
8
|
export declare function initSysId(id: string): void;
|
|
9
|
+
/** --- 当前注册的系统任务栏 --- */
|
|
10
|
+
export declare let systemTaskInfo: ISystemTaskInfo;
|
|
11
|
+
/** --- 托盘菜单命令;separator 项只显示分隔线 --- */
|
|
12
|
+
export interface ITrayMenuItem {
|
|
13
|
+
'id': string;
|
|
14
|
+
'label': string;
|
|
15
|
+
'disabled'?: boolean;
|
|
16
|
+
'separator'?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** --- 托盘注册数据;包内图标请用 /package/ 开头的路径 --- */
|
|
19
|
+
export interface ITrayOptions {
|
|
20
|
+
'icon': string;
|
|
21
|
+
'tip'?: string;
|
|
22
|
+
'menu'?: ITrayMenuItem[];
|
|
23
|
+
}
|
|
24
|
+
/** --- 提供给任务栏的托盘快照,icon 已解析为跨任务可用的 URL --- */
|
|
25
|
+
export interface ITrayInfo {
|
|
26
|
+
'id': string;
|
|
27
|
+
'taskId': string;
|
|
28
|
+
'icon': string;
|
|
29
|
+
'tip': string;
|
|
30
|
+
'menu': ITrayMenuItem[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* --- 注册托盘;不依赖当前是否存在任务栏 ---
|
|
34
|
+
* @param current 所属任务
|
|
35
|
+
* @param options 图标、提示和菜单
|
|
36
|
+
* @returns 托盘 ID,任务已结束时返回 false
|
|
37
|
+
*/
|
|
38
|
+
export declare function createTray(current: lCore.TCurrent, options: ITrayOptions): Promise<string | false>;
|
|
39
|
+
/**
|
|
40
|
+
* --- 更新自己的托盘;并发图标更新以最后发起的一次为准 ---
|
|
41
|
+
* @param current 所属任务
|
|
42
|
+
* @param id 托盘 ID
|
|
43
|
+
* @param options 要修改的字段
|
|
44
|
+
* @returns 是否仍拥有该托盘
|
|
45
|
+
*/
|
|
46
|
+
export declare function updateTray(current: lCore.TCurrent, id: string, options: Partial<ITrayOptions>): Promise<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* --- 删除自己的托盘 ---
|
|
49
|
+
* @param current 所属任务
|
|
50
|
+
* @param id 托盘 ID
|
|
51
|
+
* @returns 是否删除
|
|
52
|
+
*/
|
|
53
|
+
export declare function removeTray(current: lCore.TCurrent, id: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* --- 获取托盘快照;系统任务栏/root 可读全部,普通任务只能读自己的 ---
|
|
56
|
+
* @param current 调用任务
|
|
57
|
+
* @returns 托盘快照
|
|
58
|
+
*/
|
|
59
|
+
export declare function getTrayList(current: lCore.TCurrent): Record<string, ITrayInfo>;
|
|
60
|
+
/**
|
|
61
|
+
* --- 当前系统任务栏投递点击/菜单命令到托盘所属 App 和 Form ---
|
|
62
|
+
* @param current 当前系统任务栏
|
|
63
|
+
* @param id 托盘 ID
|
|
64
|
+
* @param menuId 菜单 ID;省略表示左键点击
|
|
65
|
+
* @returns 是否投递;过期、禁用或非系统任务栏的命令返回 false
|
|
66
|
+
*/
|
|
67
|
+
export declare function activateTray(current: lCore.TCurrent, id: string, menuId?: string): Promise<boolean>;
|
|
9
68
|
/**
|
|
10
69
|
* --- 获取任务的 runtime 数据,仅系统可以获取 ---
|
|
11
70
|
* @param current 当前任务 ID
|
|
@@ -147,8 +206,6 @@ export declare function removeTimer(current: lCore.TCurrent, timer: number): voi
|
|
|
147
206
|
* @param delay 暂停时间
|
|
148
207
|
*/
|
|
149
208
|
export declare function sleep(current: lCore.TCurrent, fun: () => void | Promise<void>, delay: number): number;
|
|
150
|
-
/** --- task 的信息 --- */
|
|
151
|
-
export declare let systemTaskInfo: ISystemTaskInfo;
|
|
152
209
|
/**
|
|
153
210
|
* --- 将任务注册为系统 task ---
|
|
154
211
|
* @param taskId task id
|
package/dist/lib/tool.d.ts
CHANGED
|
@@ -455,8 +455,10 @@ export declare function stateMachine(code: string, start: number, process: (even
|
|
|
455
455
|
/**
|
|
456
456
|
* --- 加载脚本 ---
|
|
457
457
|
* @param url 脚本网址
|
|
458
|
+
* @param ordered 是否按插入顺序执行,下载仍并行,默认 false
|
|
459
|
+
* @returns 加载是否成功
|
|
458
460
|
*/
|
|
459
|
-
export declare function loadScript(url: string): Promise<boolean>;
|
|
461
|
+
export declare function loadScript(url: string, ordered?: boolean): Promise<boolean>;
|
|
460
462
|
/**
|
|
461
463
|
* --- 批量加载 js 文件 ---
|
|
462
464
|
* @param urls js 文件列表
|
|
@@ -464,6 +466,8 @@ export declare function loadScript(url: string): Promise<boolean>;
|
|
|
464
466
|
*/
|
|
465
467
|
export declare function loadScripts(urls: string[], opt?: {
|
|
466
468
|
loaded?: (url: string, state: number) => void;
|
|
469
|
+
/** --- 并行下载并按列表顺序执行,默认 false --- */
|
|
470
|
+
'ordered'?: boolean;
|
|
467
471
|
}): Promise<void>;
|
|
468
472
|
/**
|
|
469
473
|
* --- 加载 css 文件 ---
|
|
@@ -479,6 +483,15 @@ export declare function loadLink(url: string, pos?: 'before' | 'after'): Promise
|
|
|
479
483
|
export declare function loadLinks(urls: string[], opt?: {
|
|
480
484
|
loaded?: (url: string, state: number) => void;
|
|
481
485
|
}): Promise<void>;
|
|
486
|
+
/**
|
|
487
|
+
* --- 批量并行加载 JS 和 CSS;JS 按列表顺序执行,CSS 按列表顺序插入 ---
|
|
488
|
+
* @param urls 资源网址,忽略查询参数和哈希后以 .css 结尾的按 CSS 加载,其余按 JS 加载
|
|
489
|
+
* @param opt loaded 为单个资源加载完成回调,state 为 1-成功、0-失败
|
|
490
|
+
* @returns 全部资源成功返回 true,任一资源失败返回 false;空列表返回 true
|
|
491
|
+
*/
|
|
492
|
+
export declare function loadAssets(urls: string[], opt?: {
|
|
493
|
+
loaded?: (url: string, state: number) => void;
|
|
494
|
+
}): Promise<boolean>;
|
|
482
495
|
/**
|
|
483
496
|
* --- 加载 css 字符串 ---
|
|
484
497
|
* @param style css 字符串
|
|
Binary file
|
package/dist/theme/modern.cgt
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|