clickgo 3.11.12 → 3.11.13
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/README.md +1 -1
- package/dist/app/demo/form/control/drawer/drawer.xml +1 -0
- package/dist/app/demo/form/solution/backpanel/backpanel.xml +1 -1
- package/dist/clickgo.js +1 -1
- package/dist/clickgo.ts +1 -1
- package/dist/control/common.cgc +0 -0
- package/dist/control/tuieditor.cgc +0 -0
- package/dist/lib/control.js +4 -2
- package/dist/lib/control.ts +5 -2
- package/dist/lib/core.js +8 -3
- package/dist/lib/core.ts +8 -3
- package/dist/lib/fs.js +6 -6
- package/dist/lib/fs.ts +7 -3
- package/dist/lib/task.js +3 -2
- package/dist/lib/task.ts +3 -2
- package/package.json +1 -1
- package/types/index.d.ts +4 -0
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Load the module loader first, and then load it using the module loader.
|
|
|
28
28
|
**index.html**
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
|
-
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.13'}"></script>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**index.js**
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<drawer title="Drawer" gutter="10" v-model="drawer" direction="v" width="50%">
|
|
7
7
|
<label>123</label>
|
|
8
8
|
<button @click="drawer2 = true">456</button>
|
|
9
|
+
<tuieditor style="height: 200px;"></tuieditor>
|
|
9
10
|
</drawer>
|
|
10
11
|
<drawer title="Drawer2" gutter="10" v-model="drawer2" direction="v">
|
|
11
12
|
<label>789</label>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<button @click="formHash = fh">Change</button>
|
|
7
7
|
<button @click="formHashBack">Back</button>
|
|
8
8
|
</layout>
|
|
9
|
-
<nav v-model="name" default="list" hash style="flex: 1;">
|
|
9
|
+
<nav v-model="name" default="list" hash style="flex: 1; height: 0;">
|
|
10
10
|
<nav-item label="User">
|
|
11
11
|
<nav-item label="All list" name="list"></nav-item>
|
|
12
12
|
<nav-item label="Available" name="list?avail=1"></nav-item>
|
package/dist/clickgo.js
CHANGED
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.zip = exports.tool = exports.theme = exports.task = exports.storage = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.vue = exports.hasFrame = exports.isImmersion = exports.getPlatform = exports.isNative = exports.getVersion = void 0;
|
|
27
|
-
const version = '3.11.
|
|
27
|
+
const version = '3.11.13';
|
|
28
28
|
function getVersion() {
|
|
29
29
|
return version;
|
|
30
30
|
}
|
package/dist/clickgo.ts
CHANGED
package/dist/control/common.cgc
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/lib/control.js
CHANGED
|
@@ -288,7 +288,7 @@ function read(blob) {
|
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
exports.read = read;
|
|
291
|
-
function init(taskId, invoke) {
|
|
291
|
+
function init(taskId, invoke, cache) {
|
|
292
292
|
return __awaiter(this, void 0, void 0, function* () {
|
|
293
293
|
const t = task.list[taskId];
|
|
294
294
|
if (!t) {
|
|
@@ -299,7 +299,9 @@ function init(taskId, invoke) {
|
|
|
299
299
|
path += '.cgc';
|
|
300
300
|
}
|
|
301
301
|
path = tool.urlResolve('/', path);
|
|
302
|
-
const file = yield fs.getContent(path,
|
|
302
|
+
const file = yield fs.getContent(path, {
|
|
303
|
+
'cache': cache
|
|
304
|
+
}, taskId);
|
|
303
305
|
if (file && typeof file !== 'string') {
|
|
304
306
|
const c = yield read(file);
|
|
305
307
|
if (c) {
|
package/dist/lib/control.ts
CHANGED
|
@@ -415,7 +415,8 @@ export async function read(blob: Blob): Promise<false | types.TControlPackage> {
|
|
|
415
415
|
*/
|
|
416
416
|
export async function init(
|
|
417
417
|
taskId: number,
|
|
418
|
-
invoke: Record<string, any
|
|
418
|
+
invoke: Record<string, any>,
|
|
419
|
+
cache?: string
|
|
419
420
|
): Promise<number> {
|
|
420
421
|
const t = task.list[taskId];
|
|
421
422
|
if (!t) {
|
|
@@ -426,7 +427,9 @@ export async function init(
|
|
|
426
427
|
path += '.cgc';
|
|
427
428
|
}
|
|
428
429
|
path = tool.urlResolve('/', path);
|
|
429
|
-
const file = await fs.getContent(path,
|
|
430
|
+
const file = await fs.getContent(path, {
|
|
431
|
+
'cache': cache
|
|
432
|
+
}, taskId);
|
|
430
433
|
if (file && typeof file !== 'string') {
|
|
431
434
|
const c = await read(file);
|
|
432
435
|
if (c) {
|
package/dist/lib/core.js
CHANGED
|
@@ -633,7 +633,8 @@ function fetchApp(url, opt = {}, taskId) {
|
|
|
633
633
|
if (opt.progress) {
|
|
634
634
|
opt.progress(loaded, total);
|
|
635
635
|
}
|
|
636
|
-
}
|
|
636
|
+
},
|
|
637
|
+
'cache': opt.cache
|
|
637
638
|
}, taskId);
|
|
638
639
|
if ((blob === null) || typeof blob === 'string') {
|
|
639
640
|
return null;
|
|
@@ -650,7 +651,9 @@ function fetchApp(url, opt = {}, taskId) {
|
|
|
650
651
|
let config;
|
|
651
652
|
const files = {};
|
|
652
653
|
try {
|
|
653
|
-
const blob = yield fs.getContent(url + 'config.json',
|
|
654
|
+
const blob = yield fs.getContent(url + 'config.json', {
|
|
655
|
+
'cache': opt.cache
|
|
656
|
+
}, taskId);
|
|
654
657
|
if (blob === null || typeof blob === 'string') {
|
|
655
658
|
return null;
|
|
656
659
|
}
|
|
@@ -665,7 +668,9 @@ function fetchApp(url, opt = {}, taskId) {
|
|
|
665
668
|
opt.progress(loaded + 1, total + 1);
|
|
666
669
|
}
|
|
667
670
|
for (const file of config.files) {
|
|
668
|
-
fs.getContent(url + file.slice(1),
|
|
671
|
+
fs.getContent(url + file.slice(1), {
|
|
672
|
+
'cache': opt.cache
|
|
673
|
+
}, taskId).then(function (blob) {
|
|
669
674
|
return __awaiter(this, void 0, void 0, function* () {
|
|
670
675
|
if (blob === null || typeof blob === 'string') {
|
|
671
676
|
clickgo.form.notify({
|
package/dist/lib/core.ts
CHANGED
|
@@ -735,7 +735,8 @@ export async function fetchApp(
|
|
|
735
735
|
if (opt.progress) {
|
|
736
736
|
opt.progress(loaded, total) as unknown;
|
|
737
737
|
}
|
|
738
|
-
}
|
|
738
|
+
},
|
|
739
|
+
'cache': opt.cache
|
|
739
740
|
}, taskId);
|
|
740
741
|
if ((blob === null) || typeof blob === 'string') {
|
|
741
742
|
return null;
|
|
@@ -754,7 +755,9 @@ export async function fetchApp(
|
|
|
754
755
|
/** --- 已加载的 files --- */
|
|
755
756
|
const files: Record<string, Blob | string> = {};
|
|
756
757
|
try {
|
|
757
|
-
const blob = await fs.getContent(url + 'config.json',
|
|
758
|
+
const blob = await fs.getContent(url + 'config.json', {
|
|
759
|
+
'cache': opt.cache
|
|
760
|
+
}, taskId);
|
|
758
761
|
if (blob === null || typeof blob === 'string') {
|
|
759
762
|
return null;
|
|
760
763
|
}
|
|
@@ -769,7 +772,9 @@ export async function fetchApp(
|
|
|
769
772
|
opt.progress(loaded + 1, total + 1) as unknown;
|
|
770
773
|
}
|
|
771
774
|
for (const file of config.files) {
|
|
772
|
-
fs.getContent(url + file.slice(1),
|
|
775
|
+
fs.getContent(url + file.slice(1), {
|
|
776
|
+
'cache': opt.cache
|
|
777
|
+
}, taskId).then(async function(blob) {
|
|
773
778
|
if (blob === null || typeof blob === 'string') {
|
|
774
779
|
clickgo.form.notify({
|
|
775
780
|
'title': 'File not found',
|
package/dist/lib/fs.js
CHANGED
|
@@ -119,7 +119,7 @@ function unmount(name) {
|
|
|
119
119
|
}
|
|
120
120
|
exports.unmount = unmount;
|
|
121
121
|
function getContent(path, options, taskId) {
|
|
122
|
-
var _a, _b;
|
|
122
|
+
var _a, _b, _c;
|
|
123
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
124
|
path = tool.urlResolve('/', path);
|
|
125
125
|
const fpath = path.slice(8);
|
|
@@ -146,21 +146,21 @@ function getContent(path, options, taskId) {
|
|
|
146
146
|
ourl = path;
|
|
147
147
|
}
|
|
148
148
|
try {
|
|
149
|
-
const rand = Math.random().toString();
|
|
149
|
+
const rand = '?' + ((_a = options.cache) !== null && _a !== void 0 ? _a : Math.random().toString());
|
|
150
150
|
let blob = null;
|
|
151
151
|
const headers = {};
|
|
152
152
|
if (start || end) {
|
|
153
153
|
headers['range'] = `bytes=${start === undefined ? '0' : start}-${end === undefined ? '' : end}`;
|
|
154
154
|
}
|
|
155
155
|
if (options.progress) {
|
|
156
|
-
blob = yield tool.request(ourl + (!ourl.startsWith(loader.cdn) ?
|
|
156
|
+
blob = yield tool.request(ourl + (!ourl.startsWith(loader.cdn) ? rand : ''), {
|
|
157
157
|
'headers': headers,
|
|
158
158
|
'progress': options.progress,
|
|
159
159
|
'responseType': 'blob'
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
else {
|
|
163
|
-
blob = yield (yield fetch(ourl + (!ourl.startsWith(loader.cdn) ?
|
|
163
|
+
blob = yield (yield fetch(ourl + (!ourl.startsWith(loader.cdn) ? rand : ''), {
|
|
164
164
|
'headers': headers
|
|
165
165
|
})).blob();
|
|
166
166
|
}
|
|
@@ -178,7 +178,7 @@ function getContent(path, options, taskId) {
|
|
|
178
178
|
fr.readAsText(blob, encoding);
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
catch (
|
|
181
|
+
catch (_d) {
|
|
182
182
|
return null;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -193,7 +193,7 @@ function getContent(path, options, taskId) {
|
|
|
193
193
|
if (!hanlder) {
|
|
194
194
|
return null;
|
|
195
195
|
}
|
|
196
|
-
return (
|
|
196
|
+
return (_c = (_b = hanlder.getContent) === null || _b === void 0 ? void 0 : _b.call(hanlder, path.slice(9 + name.length), options)) !== null && _c !== void 0 ? _c : null;
|
|
197
197
|
}
|
|
198
198
|
if (options.progress) {
|
|
199
199
|
delete options.progress;
|
package/dist/lib/fs.ts
CHANGED
|
@@ -113,12 +113,14 @@ export async function getContent(path: string, options?: {
|
|
|
113
113
|
'start'?: number;
|
|
114
114
|
'end'?: number;
|
|
115
115
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
116
|
+
'cache'?: string;
|
|
116
117
|
}, taskId?: number): Promise<string | Blob | null>;
|
|
117
118
|
export async function getContent(path: string, options: BufferEncoding | {
|
|
118
119
|
'encoding': BufferEncoding;
|
|
119
120
|
'start'?: number;
|
|
120
121
|
'end'?: number;
|
|
121
122
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
123
|
+
'cache'?: string;
|
|
122
124
|
}, taskId?: number): Promise<string | null>;
|
|
123
125
|
/**
|
|
124
126
|
* --- 读取完整文件或一段 ---
|
|
@@ -131,6 +133,7 @@ export async function getContent(path: string, options?: BufferEncoding | {
|
|
|
131
133
|
'start'?: number;
|
|
132
134
|
'end'?: number;
|
|
133
135
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
136
|
+
'cache'?: string;
|
|
134
137
|
}, taskId?: number): Promise<Blob | string | null> {
|
|
135
138
|
path = tool.urlResolve('/', path);
|
|
136
139
|
const fpath = path.slice(8);
|
|
@@ -157,21 +160,22 @@ export async function getContent(path: string, options?: BufferEncoding | {
|
|
|
157
160
|
ourl = path;
|
|
158
161
|
}
|
|
159
162
|
try {
|
|
160
|
-
|
|
163
|
+
/** --- 后缀 --- */
|
|
164
|
+
const rand = '?' + (options.cache ?? Math.random().toString());
|
|
161
165
|
let blob: Blob | null = null;
|
|
162
166
|
const headers: Record<string, string> = {};
|
|
163
167
|
if (start || end) {
|
|
164
168
|
headers['range'] = `bytes=${start === undefined ? '0' : start}-${end === undefined ? '' : end}`;
|
|
165
169
|
}
|
|
166
170
|
if (options.progress) {
|
|
167
|
-
blob = await tool.request(ourl + (!ourl.startsWith(loader.cdn) ?
|
|
171
|
+
blob = await tool.request(ourl + (!ourl.startsWith(loader.cdn) ? rand : ''), {
|
|
168
172
|
'headers': headers,
|
|
169
173
|
'progress': options.progress,
|
|
170
174
|
'responseType': 'blob'
|
|
171
175
|
});
|
|
172
176
|
}
|
|
173
177
|
else {
|
|
174
|
-
blob = await (await fetch(ourl + (!ourl.startsWith(loader.cdn) ?
|
|
178
|
+
blob = await (await fetch(ourl + (!ourl.startsWith(loader.cdn) ? rand : ''), {
|
|
175
179
|
'headers': headers
|
|
176
180
|
})).blob();
|
|
177
181
|
}
|
package/dist/lib/task.js
CHANGED
|
@@ -248,7 +248,8 @@ function run(url, opt = {}, ntid) {
|
|
|
248
248
|
}
|
|
249
249
|
app = yield core.fetchApp(url, {
|
|
250
250
|
'notifyId': notifyId,
|
|
251
|
-
'progress': opt.progress
|
|
251
|
+
'progress': opt.progress,
|
|
252
|
+
'cache': opt.cache
|
|
252
253
|
}, ntid);
|
|
253
254
|
if (notifyId) {
|
|
254
255
|
setTimeout(function () {
|
|
@@ -1159,7 +1160,7 @@ function run(url, opt = {}, ntid) {
|
|
|
1159
1160
|
}
|
|
1160
1161
|
dom.createToStyleList(taskId);
|
|
1161
1162
|
yield ((_f = opt.initProgress) === null || _f === void 0 ? void 0 : _f.call(opt, 'Control initialization ...'));
|
|
1162
|
-
const r = yield control.init(taskId, invoke);
|
|
1163
|
+
const r = yield control.init(taskId, invoke, opt.cache);
|
|
1163
1164
|
if (r < 0) {
|
|
1164
1165
|
dom.removeFromStyleList(taskId);
|
|
1165
1166
|
delete exports.list[taskId];
|
package/dist/lib/task.ts
CHANGED
|
@@ -290,7 +290,8 @@ export async function run(url: string | types.IApp, opt: types.ITaskRunOptions =
|
|
|
290
290
|
// --- 获取并加载 app 对象 ---
|
|
291
291
|
app = await core.fetchApp(url, {
|
|
292
292
|
'notifyId': notifyId,
|
|
293
|
-
'progress': opt.progress
|
|
293
|
+
'progress': opt.progress,
|
|
294
|
+
'cache': opt.cache
|
|
294
295
|
}, ntid);
|
|
295
296
|
// --- 无论是否成功,都可以先隐藏 notify 了 ---
|
|
296
297
|
if (notifyId) {
|
|
@@ -1305,7 +1306,7 @@ export async function run(url: string | types.IApp, opt: types.ITaskRunOptions =
|
|
|
1305
1306
|
dom.createToStyleList(taskId);
|
|
1306
1307
|
// --- 加载 control ---
|
|
1307
1308
|
await opt.initProgress?.('Control initialization ...');
|
|
1308
|
-
const r = await control.init(taskId, invoke);
|
|
1309
|
+
const r = await control.init(taskId, invoke, opt.cache);
|
|
1309
1310
|
if (r < 0) {
|
|
1310
1311
|
dom.removeFromStyleList(taskId);
|
|
1311
1312
|
delete list[taskId];
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export type TGlobalEvent = 'error' | 'screenResize' | 'configChanged' | 'formCre
|
|
|
92
92
|
export interface ICoreFetchAppOptions {
|
|
93
93
|
'notifyId'?: number;
|
|
94
94
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
95
|
+
'cache'?: string;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
/** --- 应用包解包后对象 --- */
|
|
@@ -329,6 +330,7 @@ export interface IMountHandler {
|
|
|
329
330
|
'start'?: number;
|
|
330
331
|
'end'?: number;
|
|
331
332
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
333
|
+
'cache'?: string;
|
|
332
334
|
}) => Blob | string | null | Promise<Blob | string | null>;
|
|
333
335
|
putContent?: (path: string, data: string | Blob, options?: {
|
|
334
336
|
'encoding'?: BufferEncoding | null;
|
|
@@ -439,6 +441,8 @@ export interface ITaskRunOptions {
|
|
|
439
441
|
'data'?: Record<string, any>;
|
|
440
442
|
/** --- 执行文件的基路径,一般在传入 APP 包时使用,以 .cga 结尾或以 / 结尾的路径 --- */
|
|
441
443
|
'path'?: string;
|
|
444
|
+
/** --- 是否禁用缓存加载,默认禁用 --- */
|
|
445
|
+
'cache'?: string;
|
|
442
446
|
}
|
|
443
447
|
|
|
444
448
|
export interface ICreateTimerOptions {
|