clickgo 6.8.2 → 6.10.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/AGENTS.md +16 -0
- package/README.md +4 -0
- package/dist/app/demo.cga +0 -0
- package/dist/app/task.cga +0 -0
- package/dist/clickgo.d.ts +8 -1
- package/dist/control/common.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/novnc.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/global.css +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/command/native.d.ts +18 -0
- package/dist/lib/command/palette.d.ts +10 -0
- package/dist/lib/command/schema.d.ts +31 -0
- package/dist/lib/command.d.ts +218 -0
- package/dist/lib/core.d.ts +7 -1
- package/dist/lib/form.d.ts +15 -2
- package/dist/lib/native.d.ts +12 -0
- package/dist/lib/task.d.ts +2 -0
- package/dist/theme/admin.cgt +0 -0
- package/dist/theme/classic.cgt +0 -0
- package/dist/theme/cyber.cgt +0 -0
- package/dist/theme/dark.cgt +0 -0
- package/dist/theme/light.cgt +0 -0
- 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 +2735 -711
- package/package.json +11 -4
- package/test/core-module-loading.mjs +0 -169
- package/test/desktop.mjs +0 -715
- package/test/dock-lifecycle.mjs +0 -280
- package/test/dom-style.mjs +0 -261
- package/test/form-launcher.mjs +0 -102
- package/test/form-modal-layer.mjs +0 -75
- package/test/form-native-regions.mjs +0 -115
- package/test/form-native-style.mjs +0 -80
- package/test/form-native.mjs +0 -68
- package/test/form-notify.mjs +0 -90
- package/test/form-viewport.mjs +0 -127
- package/test/iconview.mjs +0 -70
- package/test/jodit-lifecycle.mjs +0 -212
- package/test/locale-integrity.mjs +0 -189
- package/test/pop-max-size.mjs +0 -66
- package/test/rtl-archive.mjs +0 -428
- package/test/rtl-direction.mjs +0 -193
- package/test/scroll.mjs +0 -145
- package/test/select.mjs +0 -885
- package/test/sidebar-toggle.mjs +0 -75
- package/test/task-package-loading.mjs +0 -94
- package/test/task-tray.mjs +0 -331
- package/test/tool-assets.mjs +0 -64
- package/test/tool-clone.mjs +0 -42
- package/test/toolbox.mjs +0 -88
- package/test/tuieditor-locale.mjs +0 -175
- package/test/vflow.mjs +0 -122
- package/test/web-drag-mask.mjs +0 -96
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clickgo",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.10.0",
|
|
4
4
|
"description": "Background interface, software interface, mobile phone APP interface operation library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -14,14 +14,16 @@
|
|
|
14
14
|
"types": "./dist/clickgo.d.ts",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"sass": "sass --watch dist/:dist/ --style compressed --no-source-map",
|
|
17
|
-
"check": "tsc --noEmit --pretty false && eslint \"dist/**/*.ts\" --format stylish && npm run test:locale && npm run test:style && npm run test:desktop && npm run test:form && npm run test:task && npm run test:module && npm run test:vflow && npm run test:scroll && npm run test:jodit && npm run test:select",
|
|
17
|
+
"check": "tsc --noEmit --pretty false && eslint \"dist/**/*.ts\" --format stylish && npm run test:command && npm run test:locale && npm run test:style && npm run test:desktop && npm run test:form && npm run test:task && npm run test:module && npm run test:vflow && npm run test:scroll && npm run test:jodit && npm run test:select",
|
|
18
|
+
"test:command": "node test/command.mjs",
|
|
18
19
|
"test:select": "node test/select.mjs",
|
|
19
20
|
"test:module": "node test/tool-assets.mjs && node test/core-module-loading.mjs && node test/tuieditor-locale.mjs",
|
|
20
21
|
"test:jodit": "node test/jodit-lifecycle.mjs",
|
|
21
22
|
"test:scroll": "node test/scroll.mjs",
|
|
22
23
|
"test:vflow": "node test/vflow.mjs",
|
|
23
|
-
"test:task": "node test/task-tray.mjs && node test/task-package-loading.mjs",
|
|
24
|
+
"test:task": "node test/task-tray.mjs && node test/task-start.mjs && node test/task-package-loading.mjs",
|
|
24
25
|
"test:form": "node test/form-viewport.mjs && node --experimental-vm-modules test/form-native.mjs && node test/form-launcher.mjs && node test/form-notify.mjs",
|
|
26
|
+
"test:notify-animation": "node test/form-notify-animation.mjs",
|
|
25
27
|
"test:native-regions": "node test/form-native-regions.mjs",
|
|
26
28
|
"test:desktop": "node --experimental-vm-modules test/desktop.mjs && node --experimental-vm-modules test/iconview.mjs",
|
|
27
29
|
"test:style": "node --experimental-vm-modules test/dom-style.mjs",
|
|
@@ -30,11 +32,16 @@
|
|
|
30
32
|
"native": "electron ./dist/test/native",
|
|
31
33
|
"native2": "electron ./dist/test/native/index2",
|
|
32
34
|
"native3": "electron ./dist/test/native/index3",
|
|
33
|
-
"build-doc": "bash ./utils/build-doc.sh"
|
|
35
|
+
"build-doc": "bash ./utils/build-doc.sh",
|
|
36
|
+
"test:native": "node test/native-version.mjs && node --experimental-vm-modules test/native-window.mjs && node test/native-mcp.mjs && node test/native-cli.mjs",
|
|
37
|
+
"native:cli": "node ./dist/test/native/cli.js"
|
|
34
38
|
},
|
|
35
39
|
"devDependencies": {
|
|
36
40
|
"@litert/eslint-plugin-rules": "^0.3.1",
|
|
37
41
|
"@litert/pointer": "^1.8.0",
|
|
42
|
+
"@modelcontextprotocol/client": "^2.3.1",
|
|
43
|
+
"@modelcontextprotocol/node": "^2.1.1",
|
|
44
|
+
"@modelcontextprotocol/server": "^2.3.1",
|
|
38
45
|
"@types/clean-css": "^4.2.11",
|
|
39
46
|
"@types/google.maps": "^3.58.1",
|
|
40
47
|
"@types/node": "^25.5.2",
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import { readFile } from 'node:fs/promises';
|
|
3
|
-
import vm from 'node:vm';
|
|
4
|
-
import ts from 'typescript';
|
|
5
|
-
|
|
6
|
-
const source = await readFile(new URL('../dist/lib/core.ts', import.meta.url), 'utf8');
|
|
7
|
-
const tree = ts.createSourceFile('core.ts', source, ts.ScriptTarget.ES2022, true);
|
|
8
|
-
const names = new Set(['regModule', 'loadModule', 'getModule']);
|
|
9
|
-
const selected = tree.statements.filter(node =>
|
|
10
|
-
(ts.isVariableStatement(node) && node.declarationList.declarations.some(item => item.name.getText(tree) === 'modules')) ||
|
|
11
|
-
(ts.isFunctionDeclaration(node) && node.body && names.has(node.name?.text)));
|
|
12
|
-
const requests = [];
|
|
13
|
-
const globals = {};
|
|
14
|
-
const clickgo = { modules: {}, getCdn: () => 'https://cdn.example', getDirname: () => 'https://app.example/clickgo' };
|
|
15
|
-
const api = {};
|
|
16
|
-
function pending(urls) {
|
|
17
|
-
let resolve;
|
|
18
|
-
let reject;
|
|
19
|
-
const promise = new Promise((yes, no) => { resolve = yes; reject = no; });
|
|
20
|
-
requests.push({ urls: Array.from(urls), resolve, reject });
|
|
21
|
-
return promise;
|
|
22
|
-
}
|
|
23
|
-
vm.runInNewContext(ts.transpileModule(selected.map(node => node.getText(tree)).join('\n'), {
|
|
24
|
-
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022, esModuleInterop: false },
|
|
25
|
-
}).outputText, {
|
|
26
|
-
exports: api, window: globals, clickgo,
|
|
27
|
-
lTask: { checkPermission: async () => [true] },
|
|
28
|
-
lTool: { loadAssets: pending, loadScript: url => pending([url]), loadStyle() {}, urlResolve: (base, path) => new URL(path, base).href },
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const xterm = api.getModule('xterm');
|
|
32
|
-
const duplicate = api.getModule('xterm');
|
|
33
|
-
assert.equal(requests.length, 1, 'concurrent callers share one unified resource batch');
|
|
34
|
-
assert.equal(requests[0].urls.length, 4);
|
|
35
|
-
assert.ok(requests[0].urls[0].endsWith('/xterm.js'));
|
|
36
|
-
assert.ok(requests[0].urls[3].endsWith('/xterm.min.css'));
|
|
37
|
-
assert.equal(clickgo.modules.xterm, undefined, 'modules are not published until their resources complete');
|
|
38
|
-
globals.Terminal = class {};
|
|
39
|
-
globals.FitAddon = { FitAddon: class {} };
|
|
40
|
-
globals.WebglAddon = { WebglAddon: class {} };
|
|
41
|
-
requests[0].resolve(true);
|
|
42
|
-
const first = await xterm;
|
|
43
|
-
assert.equal(await duplicate, first);
|
|
44
|
-
assert.equal(await api.getModule('xterm'), first);
|
|
45
|
-
assert.equal(requests.length, 1, 'ready modules do not reload resources');
|
|
46
|
-
|
|
47
|
-
requests.length = 0;
|
|
48
|
-
const toast = api.getModule('@toast-ui/editor');
|
|
49
|
-
const toastWaiter = api.getModule('@toast-ui/editor');
|
|
50
|
-
assert.equal(requests.length, 1, 'concurrent Toast UI callers share one batch of the local complete library and CDN styles');
|
|
51
|
-
assert.equal(requests[0].urls.length, 3);
|
|
52
|
-
assert.equal(requests[0].urls[0], 'https://app.example/clickgo/ext/toastui-editor-all.min.js', 'the complete library resolves relative to the framework, independently of its CDN');
|
|
53
|
-
assert.ok(requests[0].urls.slice(1).every(url => url.startsWith(clickgo.getCdn() + '/npm/@toast-ui/editor@3.2.2/')), 'Toast UI styles keep the configured CDN');
|
|
54
|
-
assert.equal(requests[0].urls.filter(url => url.includes('/i18n/')).length, 0, 'the shared module and pure viewer need no locale scripts');
|
|
55
|
-
assert.equal(requests[0].urls.filter(url => url.endsWith('.css')).length, 2);
|
|
56
|
-
const Editor = class {};
|
|
57
|
-
globals.toastui = { Editor };
|
|
58
|
-
assert.equal(clickgo.modules['@toast-ui/editor'], undefined, 'a script constructor is not published before the resource batch completes');
|
|
59
|
-
requests[0].resolve(true);
|
|
60
|
-
const toastModule = await toast;
|
|
61
|
-
assert.equal(await toastWaiter, toastModule);
|
|
62
|
-
assert.equal(toastModule.Editor, Editor, 'the wrapper exposes the local library constructor used by language scripts');
|
|
63
|
-
assert.equal(globals.toastui.loadLanguage, undefined, 'the shared helper is separate from the native namespace');
|
|
64
|
-
assert.equal(await api.getModule('@toast-ui/editor'), toastModule, 'all callers receive the same wrapper');
|
|
65
|
-
requests.length = 0;
|
|
66
|
-
assert.equal(await toastModule.loadLanguage('en'), true);
|
|
67
|
-
assert.equal(await toastModule.loadLanguage('en-US'), true);
|
|
68
|
-
assert.equal(await toastModule.loadLanguage('../unknown'), false);
|
|
69
|
-
assert.equal(requests.length, 0, 'built-in English and unsupported names issue no requests');
|
|
70
|
-
const locale = toastModule.loadLanguage('zh-CN');
|
|
71
|
-
const localeWaiter = toastModule.loadLanguage('ZH-cn');
|
|
72
|
-
assert.equal(requests.length, 1, 'normalized language names share a pending script globally');
|
|
73
|
-
assert.ok(requests[0].urls[0].endsWith('/i18n/zh-cn.min.js'));
|
|
74
|
-
requests[0].resolve(true);
|
|
75
|
-
assert.equal(await locale, true);
|
|
76
|
-
assert.equal(await localeWaiter, true);
|
|
77
|
-
assert.equal(await toastModule.loadLanguage('zh-cn'), true);
|
|
78
|
-
assert.equal(requests.length, 1, 'ready languages are reused');
|
|
79
|
-
const badLocale = toastModule.loadLanguage('fr-FR');
|
|
80
|
-
const badLocaleWaiter = toastModule.loadLanguage('fr-fr');
|
|
81
|
-
requests.at(-1).resolve(false);
|
|
82
|
-
assert.equal(await badLocale, false);
|
|
83
|
-
assert.equal(await badLocaleWaiter, false);
|
|
84
|
-
const localeRetry = toastModule.loadLanguage('fr-FR');
|
|
85
|
-
assert.equal(requests.length, 3, 'failed languages can be retried');
|
|
86
|
-
requests.at(-1).resolve(true);
|
|
87
|
-
assert.equal(await localeRetry, true);
|
|
88
|
-
|
|
89
|
-
// Resource rejection releases all waiters even when a library global already exists.
|
|
90
|
-
delete clickgo.modules['@toast-ui/editor'];
|
|
91
|
-
requests.length = 0;
|
|
92
|
-
const resourceFailure = api.getModule('@toast-ui/editor');
|
|
93
|
-
const resourceFailureWaiter = api.getModule('@toast-ui/editor');
|
|
94
|
-
requests[0].reject(new Error('local library unavailable'));
|
|
95
|
-
assert.equal(await resourceFailure, null);
|
|
96
|
-
assert.equal(await resourceFailureWaiter, null);
|
|
97
|
-
assert.equal(clickgo.modules['@toast-ui/editor'], undefined);
|
|
98
|
-
requests.length = 0;
|
|
99
|
-
const resourceRetry = api.getModule('@toast-ui/editor');
|
|
100
|
-
requests[0].resolve(true);
|
|
101
|
-
assert.equal((await resourceRetry).Editor, Editor, 'failed initialization leaves the shared module available for retry');
|
|
102
|
-
|
|
103
|
-
delete clickgo.modules['@toast-ui/editor'];
|
|
104
|
-
requests.length = 0;
|
|
105
|
-
const missingConstructor = api.getModule('@toast-ui/editor');
|
|
106
|
-
delete globals.toastui.Editor;
|
|
107
|
-
requests[0].resolve(true);
|
|
108
|
-
assert.equal(await missingConstructor, null, 'a missing local constructor is not published');
|
|
109
|
-
requests.length = 0;
|
|
110
|
-
const failedCss = api.getModule('@toast-ui/editor');
|
|
111
|
-
globals.toastui.Editor = Editor;
|
|
112
|
-
requests[0].resolve(false);
|
|
113
|
-
assert.equal(await failedCss, null, 'a library constructor does not hide resource failure');
|
|
114
|
-
|
|
115
|
-
requests.length = 0;
|
|
116
|
-
const failed = api.getModule('jodit');
|
|
117
|
-
const alsoFailed = api.getModule('jodit');
|
|
118
|
-
assert.equal(requests.length, 1);
|
|
119
|
-
requests[0].resolve(true);
|
|
120
|
-
assert.equal(await failed, null, 'a missing script global is a module failure');
|
|
121
|
-
assert.equal(await alsoFailed, null, 'waiting callers also receive failure instead of hanging');
|
|
122
|
-
requests.length = 0;
|
|
123
|
-
const retried = api.getModule('jodit');
|
|
124
|
-
assert.equal(requests.length, 1, 'failure clears the in-flight state and allows retry');
|
|
125
|
-
globals.Jodit = { make() {} };
|
|
126
|
-
requests[0].resolve(true);
|
|
127
|
-
assert.equal(await retried, globals.Jodit);
|
|
128
|
-
|
|
129
|
-
requests.length = 0;
|
|
130
|
-
delete clickgo.modules.jodit;
|
|
131
|
-
const badAssets = api.getModule('jodit');
|
|
132
|
-
const badAssetsWaiter = api.getModule('jodit');
|
|
133
|
-
requests[0].resolve(false);
|
|
134
|
-
assert.equal(await badAssets, null, 'any failed resource prevents publishing the module');
|
|
135
|
-
assert.equal(await badAssetsWaiter, null);
|
|
136
|
-
assert.equal(clickgo.modules.jodit, undefined);
|
|
137
|
-
requests.length = 0;
|
|
138
|
-
const assetsRetry = api.getModule('jodit');
|
|
139
|
-
requests[0].resolve(true);
|
|
140
|
-
assert.equal(await assetsRetry, globals.Jodit);
|
|
141
|
-
|
|
142
|
-
let attempts = 0;
|
|
143
|
-
let finish;
|
|
144
|
-
assert.equal(await api.regModule('owner', 'retry-test', {
|
|
145
|
-
func: () => { ++attempts; return new Promise(resolve => { finish = resolve; }); },
|
|
146
|
-
}), true);
|
|
147
|
-
const empty = api.loadModule('retry-test');
|
|
148
|
-
const emptyWaiter = api.loadModule('retry-test');
|
|
149
|
-
finish(null);
|
|
150
|
-
assert.equal(await empty, false);
|
|
151
|
-
assert.equal(await emptyWaiter, false);
|
|
152
|
-
const retry = api.loadModule('retry-test');
|
|
153
|
-
finish({ ready: true });
|
|
154
|
-
assert.equal(await retry, true);
|
|
155
|
-
assert.equal(attempts, 2);
|
|
156
|
-
|
|
157
|
-
let reject;
|
|
158
|
-
assert.equal(await api.regModule('owner', 'reject-test', {
|
|
159
|
-
func: () => new Promise((resolve, no) => { reject = no; }),
|
|
160
|
-
}), true);
|
|
161
|
-
const rejected = api.loadModule('reject-test');
|
|
162
|
-
const rejectedWaiter = api.loadModule('reject-test');
|
|
163
|
-
reject(new Error('external loader failed'));
|
|
164
|
-
assert.equal(await rejected, false);
|
|
165
|
-
assert.equal(await rejectedWaiter, false, 'external rejections release every waiting caller');
|
|
166
|
-
const secondTry = api.loadModule('reject-test');
|
|
167
|
-
reject(new Error('external loader failed again'));
|
|
168
|
-
assert.equal(await secondTry, false);
|
|
169
|
-
console.log('Local complete Toast UI library/CDN styles, locale-free loading, shared requests, failures and retries passed.');
|