clickgo 3.0.4-dev5 → 3.0.7-dev8
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/task/form/bar/bar.js +3 -0
- package/dist/app/task/form/bar/bar.xml +1 -1
- package/dist/global.css +1 -1
- package/dist/lib/core.js +47 -14
- package/dist/lib/core.ts +44 -13
- package/dist/lib/dom.js +6 -3
- package/dist/lib/dom.ts +6 -3
- package/dist/lib/form.js +219 -34
- package/dist/lib/form.ts +236 -46
- package/dist/lib/fs.js +1 -1
- package/dist/lib/fs.ts +1 -1
- package/dist/lib/native.js +8 -148
- package/dist/lib/native.ts +6 -211
- package/dist/lib/task.js +16 -17
- package/dist/lib/task.ts +17 -17
- package/package.json +1 -1
- package/types/index.d.ts +15 -2
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Load the module loader first, and then load it using the module loader.
|
|
|
19
19
|
**index.html**
|
|
20
20
|
|
|
21
21
|
```html
|
|
22
|
-
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.3.0/dist/loader.min.js?path=index&npm={'clickgo':'3.0.
|
|
22
|
+
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.3.0/dist/loader.min.js?path=index&npm={'clickgo':'3.0.7-dev8'}"></script>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
**index.js**
|
|
@@ -24,6 +24,9 @@ exports.computed = {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
exports.methods = {
|
|
27
|
+
showLauncher: function () {
|
|
28
|
+
clickgo.form.showLauncher();
|
|
29
|
+
},
|
|
27
30
|
itemClick: function (appIndex) {
|
|
28
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
32
|
if (this.apps[appIndex].formCount === 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
<form v-model:width="width" v-model:height="height" v-model:left="left" v-model:top="top" title="Bar" border="none" :resize="false" background="transparent">
|
|
3
3
|
<task :position="position">
|
|
4
|
-
<task-item>
|
|
4
|
+
<task-item @click="showLauncher">
|
|
5
5
|
<img src="/clickgo/icon.png" style="width: 16px; height: 16px;" />
|
|
6
6
|
</task-item>
|
|
7
7
|
<task-item v-for="(app, appIndex) of apps" :selected="app.selected" :opened="app.opened" :multi="app.formCount > 1" @click="itemClick(appIndex)" @mousedown="$event.stopPropagation()" @touchstart="$event.stopPropagation()">
|
package/dist/global.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
#cg-wrap{--cg:hsl(20, 100%, 65%);--success:hsl(150, 100%, 40%);--success-hover:hsl(150, 100%, 45%);--success-active:hsl(150, 100%, 30%);--success-focus:hsl(150, 100%, 35%);--success-disabled:hsl(150, 0%, 40%);--info:hsl(210, 100%, 50%);--info-hover:hsl(210, 100%, 60%);--info-active:hsl(210, 100%, 40%);--info-focus:hsl(210, 100%, 45%);--info-disabled:hsl(210, 0%, 50%);--warning:hsl(20, 100%, 70%);--warning-hover:hsl(20, 100%, 80%);--warning-active:hsl(20, 100%, 60%);--warning-focus:hsl(20, 100%, 65%);--warning-disabled:hsl(20, 0%, 70%);--danger:hsl(350, 100%, 50%);--danger-hover:hsl(350, 100%, 70%);--danger-active:hsl(350, 100%, 40%);--danger-focus:hsl(350, 100%, 45%);--danger-disabled:hsl(350, 0%, 50%);--system-color:hsl(0, 0%, 95%);--system-background:hsla(0, 0%, 0%, .5);--face:hsl(0, 0%, 95%);--g-color:hsl(0, 0%, 20%);--g-color-hover:hsl(0, 0%, 30%);--g-color-active:hsl(0, 0%, 10%);--g-color-focus:hsl(0, 0%, 15%);--g-color-disabled:hsl(0, 0%, 60%);--g-background:hsl(0, 0%, 95%);--g-background-hover:hsl(0, 0%, 100%);--g-background-active:hsl(0, 0%, 85%);--g-background-kp:hsl(0, 0%, 80%);--g-background-opacity:hsl(0, 0%, 50%, .2);--g-background-focus:hsl(0, 0%, 97.5%);--g-background-disabled:hsl(0, 0%, 75%);--g-border-color:hsl(0, 0%, 40%);--g-border-color-hover:hsl(0, 0%, 50%);--g-border-color-active:hsl(0, 0%, 30%);--g-border-color-focus:hsl(0, 0%, 35%);--g-border-color-disabled:hsl(0, 0%, 60%);--g-plain-color:var(--g-color);--g-plain-color-hover:var(--g-color-hover);--g-plain-color-active:var(--g-color-active);--g-plain-color-focus:var(--g-color-focus);--g-plain-color-disabled:var(--g-color-disabled);--g-plain-background:hsl(0, 0%, 100%);--g-plain-background-hover:hsl(0, 0%, 98%);--g-plain-background-active:hsl(0, 0%, 95%);--g-plain-background-focus:var(--g-plain-background);--g-plain-background-disabled:hsl(0, 0%, 95%);--g-plain-border-color:hsl(0, 0%, 70%);--g-plain-border-color-hover:hsl(0, 0%, 80%);--g-plain-border-color-active:hsl(0, 0%, 60%);--g-plain-border-color-focus:hsl(0, 0%, 65%);--g-plain-border-color-disabled:hsl(0, 0%, 60%)}#cg-form-list{z-index:20020000}#cg-pop-list{z-index:20020001}#cg-simpletask{z-index:20020002}#cg-
|
|
1
|
+
#cg-wrap{--cg:hsl(20, 100%, 65%);--success:hsl(150, 100%, 40%);--success-hover:hsl(150, 100%, 45%);--success-active:hsl(150, 100%, 30%);--success-focus:hsl(150, 100%, 35%);--success-disabled:hsl(150, 0%, 40%);--info:hsl(210, 100%, 50%);--info-hover:hsl(210, 100%, 60%);--info-active:hsl(210, 100%, 40%);--info-focus:hsl(210, 100%, 45%);--info-disabled:hsl(210, 0%, 50%);--warning:hsl(20, 100%, 70%);--warning-hover:hsl(20, 100%, 80%);--warning-active:hsl(20, 100%, 60%);--warning-focus:hsl(20, 100%, 65%);--warning-disabled:hsl(20, 0%, 70%);--danger:hsl(350, 100%, 50%);--danger-hover:hsl(350, 100%, 70%);--danger-active:hsl(350, 100%, 40%);--danger-focus:hsl(350, 100%, 45%);--danger-disabled:hsl(350, 0%, 50%);--system-color:hsl(0, 0%, 95%);--system-background:hsla(0, 0%, 0%, .5);--system-border-color:hsla(0, 0%, 100%, .2);--face:hsl(0, 0%, 95%);--g-color:hsl(0, 0%, 20%);--g-color-hover:hsl(0, 0%, 30%);--g-color-active:hsl(0, 0%, 10%);--g-color-focus:hsl(0, 0%, 15%);--g-color-disabled:hsl(0, 0%, 60%);--g-background:hsl(0, 0%, 95%);--g-background-hover:hsl(0, 0%, 100%);--g-background-active:hsl(0, 0%, 85%);--g-background-kp:hsl(0, 0%, 80%);--g-background-opacity:hsl(0, 0%, 50%, .2);--g-background-focus:hsl(0, 0%, 97.5%);--g-background-disabled:hsl(0, 0%, 75%);--g-border-color:hsl(0, 0%, 40%);--g-border-color-hover:hsl(0, 0%, 50%);--g-border-color-active:hsl(0, 0%, 30%);--g-border-color-focus:hsl(0, 0%, 35%);--g-border-color-disabled:hsl(0, 0%, 60%);--g-plain-color:var(--g-color);--g-plain-color-hover:var(--g-color-hover);--g-plain-color-active:var(--g-color-active);--g-plain-color-focus:var(--g-color-focus);--g-plain-color-disabled:var(--g-color-disabled);--g-plain-background:hsl(0, 0%, 100%);--g-plain-background-hover:hsl(0, 0%, 98%);--g-plain-background-active:hsl(0, 0%, 95%);--g-plain-background-focus:var(--g-plain-background);--g-plain-background-disabled:hsl(0, 0%, 95%);--g-plain-border-color:hsl(0, 0%, 70%);--g-plain-border-color-hover:hsl(0, 0%, 80%);--g-plain-border-color-active:hsl(0, 0%, 60%);--g-plain-border-color-focus:hsl(0, 0%, 65%);--g-plain-border-color-disabled:hsl(0, 0%, 60%)}#cg-form-list{z-index:20020000}#cg-pop-list{z-index:20020001}#cg-simpletask{z-index:20020002}#cg-rectangle{z-index:20020003;box-sizing:border-box;position:fixed;border-radius:3px;box-shadow:0 0 10px rgba(0,0,0,.25);background:rgba(255,255,255,.05);pointer-events:none;opacity:0}#cg-circular{z-index:20020003;box-sizing:border-box;position:fixed;border:solid 3px var(--cg);border-radius:50%;filter:drop-shadow(0 0 3px var(--cg));pointer-events:none;opacity:0}#cg-gesture{z-index:20020003;box-sizing:border-box;position:fixed;border-radius:50%;pointer-events:none;opacity:0;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);transform:scale(0);width:20px;height:20px}#cg-gesture.done{background:rgba(255,255,255,.3);border:solid 3px rgba(0,0,0,.3)}#cg-drag{z-index:20020003;box-sizing:border-box;position:fixed;border-radius:3px;pointer-events:none;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);opacity:0;display:flex;justify-content:center;align-items:center}#cg-launcher{z-index:20020004;box-sizing:border-box;position:fixed;background:var(--system-background);-webkit-backdrop-filter:blur(30px) brightness(1.2);backdrop-filter:blur(30px) brightness(1.2);width:100%;height:100%;left:0;top:0;color:var(--system-color);display:none;flex-direction:column;transition:all .1s linear;transform:scale(1.2);opacity:0}#cg-launcher:not(.cg-show){pointer-events:none}#cg-launcher.cg-show{transform:scale(1);opacity:1}.cg-launcher-search{text-align:center;padding:50px}.cg-launcher-sinput{-webkit-appearance:none;padding:10px;height:38px;border:solid 1px var(--system-border-color);background:transparent;width:50%;border-radius:3px;color:var(--system-color)}.cg-launcher-sinput::placeholder{color:var(--system-border-color)}.cg-launcher-sinput::selection{background-color:var(--system-color);color:var(--g-color)}.cg-launcher-sinput:focus{outline:none;border-color:var(--system-color)}.cg-launcher-foldername{-webkit-appearance:none;height:38px;font-size:28px !important;border:none;background:transparent;width:50%;color:var(--system-color);text-align:center}.cg-launcher-foldername::selection{background-color:var(--system-color);color:var(--g-color)}.cg-launcher-foldername:focus{outline:none}.cg-launcher-item{width:190px;display:inline-flex;vertical-align:middle;margin-bottom:50px}.cg-launcher-inner{flex:1;width:0}.cg-launcher-icon{background-position:center;background-size:80px;height:80px;background-repeat:no-repeat}.cg-launcher-icon:active{filter:brightness(0.6)}.cg-launcher-name{font-size:13px;font-weight:bold;text-shadow:0 0 3px rgba(0,0,0,.6);text-align:center;margin-top:20px}.cg-launcher-icon,.cg-launcher-name{transition:all .1s linear;transition-property:opacity}.cg-launcher-space{width:50px}.cg-launcher-folder{display:flex;justify-content:center;height:80px}.cg-launcher-folder>div{height:80px;width:80px;background:rgba(255,255,255,.3);border-radius:20px;padding:10px 4px 4px 10px;transition:all .1s linear;transition-property:left,top,width,height,opacity;overflow-y:auto}.cg-launcher-folder>div::-webkit-scrollbar{display:none}.cg-launcher-folder>div .cg-launcher-item,.cg-launcher-folder>div .cg-launcher-space{transition:all .1s linear}.cg-launcher-folder>div.cg-show{padding:50px 0 0 50px}.cg-launcher-folder>div:not(.cg-show):active{filter:brightness(0.6)}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-item{width:22px;margin-bottom:6px}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-icon{background-size:16px;height:16px;pointer-events:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-name{display:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-space{width:6px}.cg-launcher-list{flex:1;height:0;overflow-y:auto;padding:0 0 0 50px}.cg-launcher-list::-webkit-scrollbar{display:none}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-icon,.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-name{opacity:0}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-folder>div:not(.cg-show){opacity:0}[data-cg-pop]{position:fixed;box-shadow:0px 5px 20px rgba(0,0,0,.25);transition:.1s ease-out;transition-property:transform,opacity;transform:translateY(-10px);opacity:0}[data-cg-pop]:not([data-cg-open]){pointer-events:none}[data-cg-pop][data-cg-open]{transform:translateY(0px);opacity:1}#cg-system{z-index:20020005}.cg-system-notify{background:var(--system-background);position:fixed;padding:15px;border-radius:3px;right:0;top:0;width:280px;font-size:14px;display:flex;transition:.1s ease-out;transition-property:transform,opacity;overflow:hidden;color:var(--system-color);box-shadow:0 5px 20px rgba(0,0,0,.25);-webkit-backdrop-filter:blur(30px) brightness(1.2);backdrop-filter:blur(30px) brightness(1.2)}.cg-system-icon{margin-right:10px;width:16px;height:16px;border-radius:50%}.cg-system-icon.cg-primary{background:var(--success)}.cg-system-icon.cg-info{background:var(--info)}.cg-system-icon.cg-warning{background:var(--warning)}.cg-system-icon.cg-danger{background:var(--danger)}.cg-system-icon.cg-progress{background:var(--cg)}.cg-system-notify-title{font-size:16px;font-weight:bold;padding-bottom:10px}.cg-system-notify-content{line-height:1.5;word-break:break-word}.cg-system-notify-progress{position:absolute;bottom:0;left:0;border-radius:1px;background:var(--cg);transition:width 1s ease-out;width:0%;height:2px}#cg-simpletask{left:0;bottom:-46px;width:100%;height:46px;top:initial;background:var(--system-background);-webkit-backdrop-filter:blur(30px) brightness(1.2);backdrop-filter:blur(30px) brightness(1.2);padding:5px 0 5px 5px;display:flex;color:var(--system-color);transition:bottom .1s ease-out;overflow-x:auto}#cg-simpletask::-webkit-scrollbar{display:none}.cg-simpletask-item{background:rgba(0,0,0,.05);border-radius:3px;padding:10px;display:flex;align-items:center;margin-right:5px}.cg-simpletask-item:hover{background:rgba(0,0,0,.1)}.cg-simpletask-item:active{background:rgba(0,0,0,.2)}.cg-simpletask-icon{margin-right:5px;background-size:cover;width:16px;height:16px}
|
package/dist/lib/core.js
CHANGED
|
@@ -23,7 +23,8 @@ const configOrigin = {
|
|
|
23
23
|
'desktop.icon.storage': true,
|
|
24
24
|
'desktop.icon.recycler': true,
|
|
25
25
|
'desktop.wallpaper': null,
|
|
26
|
-
'desktop.path': null
|
|
26
|
+
'desktop.path': null,
|
|
27
|
+
'launcher.list': []
|
|
27
28
|
};
|
|
28
29
|
exports.config = clickgo.vue.reactive({
|
|
29
30
|
'locale': 'en',
|
|
@@ -32,7 +33,8 @@ exports.config = clickgo.vue.reactive({
|
|
|
32
33
|
'desktop.icon.storage': true,
|
|
33
34
|
'desktop.icon.recycler': true,
|
|
34
35
|
'desktop.wallpaper': null,
|
|
35
|
-
'desktop.path': null
|
|
36
|
+
'desktop.path': null,
|
|
37
|
+
'launcher.list': []
|
|
36
38
|
});
|
|
37
39
|
exports.cdn = '';
|
|
38
40
|
clickgo.vue.watch(exports.config, function () {
|
|
@@ -245,7 +247,8 @@ exports.globalEvents = {
|
|
|
245
247
|
formBlurredHandler: null,
|
|
246
248
|
formFlashHandler: null,
|
|
247
249
|
taskStartedHandler: null,
|
|
248
|
-
taskEndedHandler: null
|
|
250
|
+
taskEndedHandler: null,
|
|
251
|
+
launcherFolderNameChangedHandler: null
|
|
249
252
|
};
|
|
250
253
|
function setSystemEventListener(name, func, formId, taskId) {
|
|
251
254
|
if (!taskId) {
|
|
@@ -284,7 +287,7 @@ function removeSystemEventListener(name, formId, taskId) {
|
|
|
284
287
|
}
|
|
285
288
|
exports.removeSystemEventListener = removeSystemEventListener;
|
|
286
289
|
function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '') {
|
|
287
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
|
290
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
288
291
|
switch (name) {
|
|
289
292
|
case 'error': {
|
|
290
293
|
if (typeof taskId !== 'number' || typeof formId !== 'number') {
|
|
@@ -434,6 +437,32 @@ function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '') {
|
|
|
434
437
|
}
|
|
435
438
|
break;
|
|
436
439
|
}
|
|
440
|
+
case 'launcherFolderNameChanged': {
|
|
441
|
+
if (typeof formId !== 'string') {
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
if (typeof taskId === 'number') {
|
|
445
|
+
taskId = taskId.toString();
|
|
446
|
+
}
|
|
447
|
+
const r = (_5 = exports.globalEvents.launcherFolderNameChangedHandler) === null || _5 === void 0 ? void 0 : _5.call(exports.globalEvents, taskId, formId);
|
|
448
|
+
if (r && (r instanceof Promise)) {
|
|
449
|
+
r.catch(function (e) {
|
|
450
|
+
console.log(e);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
for (const tid in task.list) {
|
|
454
|
+
const t = task.list[tid];
|
|
455
|
+
for (const fid in t.forms) {
|
|
456
|
+
const r = (_7 = (_6 = t.forms[fid].events)[name]) === null || _7 === void 0 ? void 0 : _7.call(_6, taskId, formId);
|
|
457
|
+
if (r instanceof Promise) {
|
|
458
|
+
r.catch(function (e) {
|
|
459
|
+
console.log(e);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
437
466
|
}
|
|
438
467
|
}
|
|
439
468
|
exports.trigger = trigger;
|
|
@@ -555,6 +584,7 @@ function fetchApp(url, opt = {}) {
|
|
|
555
584
|
fs.getContent(url + file.slice(1), {
|
|
556
585
|
'current': current
|
|
557
586
|
}).then(function (blob) {
|
|
587
|
+
var _a;
|
|
558
588
|
return __awaiter(this, void 0, void 0, function* () {
|
|
559
589
|
if (blob === null || typeof blob === 'string') {
|
|
560
590
|
clickgo.form.notify({
|
|
@@ -572,6 +602,7 @@ function fetchApp(url, opt = {}) {
|
|
|
572
602
|
files[file] = blob;
|
|
573
603
|
}
|
|
574
604
|
++loaded;
|
|
605
|
+
(_a = opt.progress) === null || _a === void 0 ? void 0 : _a.call(opt, loaded, total);
|
|
575
606
|
if (opt.notifyId) {
|
|
576
607
|
form.notifyProgress(opt.notifyId, loaded / total);
|
|
577
608
|
}
|
|
@@ -581,7 +612,9 @@ function fetchApp(url, opt = {}) {
|
|
|
581
612
|
resolve();
|
|
582
613
|
});
|
|
583
614
|
}).catch(function () {
|
|
615
|
+
var _a;
|
|
584
616
|
++loaded;
|
|
617
|
+
(_a = opt.progress) === null || _a === void 0 ? void 0 : _a.call(opt, loaded, total);
|
|
585
618
|
if (opt.notifyId) {
|
|
586
619
|
form.notifyProgress(opt.notifyId, loaded / total);
|
|
587
620
|
}
|
|
@@ -614,8 +647,8 @@ function getAvailArea() {
|
|
|
614
647
|
return {
|
|
615
648
|
'left': 0,
|
|
616
649
|
'top': 0,
|
|
617
|
-
'width':
|
|
618
|
-
'height':
|
|
650
|
+
'width': window.innerWidth,
|
|
651
|
+
'height': window.innerHeight - 46
|
|
619
652
|
};
|
|
620
653
|
}
|
|
621
654
|
else {
|
|
@@ -627,29 +660,29 @@ function getAvailArea() {
|
|
|
627
660
|
case 'left': {
|
|
628
661
|
left = task.systemTaskInfo.length;
|
|
629
662
|
top = 0;
|
|
630
|
-
width =
|
|
631
|
-
height =
|
|
663
|
+
width = window.innerWidth - task.systemTaskInfo.length;
|
|
664
|
+
height = window.innerHeight;
|
|
632
665
|
break;
|
|
633
666
|
}
|
|
634
667
|
case 'right': {
|
|
635
668
|
left = 0;
|
|
636
669
|
top = 0;
|
|
637
|
-
width =
|
|
638
|
-
height =
|
|
670
|
+
width = window.innerWidth - task.systemTaskInfo.length;
|
|
671
|
+
height = window.innerHeight;
|
|
639
672
|
break;
|
|
640
673
|
}
|
|
641
674
|
case 'top': {
|
|
642
675
|
left = 0;
|
|
643
676
|
top = task.systemTaskInfo.length;
|
|
644
|
-
width =
|
|
645
|
-
height =
|
|
677
|
+
width = window.innerWidth;
|
|
678
|
+
height = window.innerHeight - task.systemTaskInfo.length;
|
|
646
679
|
break;
|
|
647
680
|
}
|
|
648
681
|
case 'bottom': {
|
|
649
682
|
left = 0;
|
|
650
683
|
top = 0;
|
|
651
|
-
width =
|
|
652
|
-
height =
|
|
684
|
+
width = window.innerWidth;
|
|
685
|
+
height = window.innerHeight - task.systemTaskInfo.length;
|
|
653
686
|
}
|
|
654
687
|
}
|
|
655
688
|
return {
|
package/dist/lib/core.ts
CHANGED
|
@@ -28,7 +28,8 @@ const configOrigin: types.IConfig = {
|
|
|
28
28
|
'desktop.icon.storage': true,
|
|
29
29
|
'desktop.icon.recycler': true,
|
|
30
30
|
'desktop.wallpaper': null,
|
|
31
|
-
'desktop.path': null
|
|
31
|
+
'desktop.path': null,
|
|
32
|
+
'launcher.list': []
|
|
32
33
|
};
|
|
33
34
|
export const config: types.IConfig = clickgo.vue.reactive({
|
|
34
35
|
'locale': 'en',
|
|
@@ -37,7 +38,8 @@ export const config: types.IConfig = clickgo.vue.reactive({
|
|
|
37
38
|
'desktop.icon.storage': true,
|
|
38
39
|
'desktop.icon.recycler': true,
|
|
39
40
|
'desktop.wallpaper': null,
|
|
40
|
-
'desktop.path': null
|
|
41
|
+
'desktop.path': null,
|
|
42
|
+
'launcher.list': []
|
|
41
43
|
});
|
|
42
44
|
|
|
43
45
|
export const cdn = '';
|
|
@@ -271,7 +273,8 @@ export const globalEvents: types.IGlobalEvents = {
|
|
|
271
273
|
formBlurredHandler: null,
|
|
272
274
|
formFlashHandler: null,
|
|
273
275
|
taskStartedHandler: null,
|
|
274
|
-
taskEndedHandler: null
|
|
276
|
+
taskEndedHandler: null,
|
|
277
|
+
launcherFolderNameChangedHandler: null
|
|
275
278
|
};
|
|
276
279
|
|
|
277
280
|
/**
|
|
@@ -485,6 +488,32 @@ export function trigger(name: types.TGlobalEvent, taskId: number | string = 0, f
|
|
|
485
488
|
}
|
|
486
489
|
break;
|
|
487
490
|
}
|
|
491
|
+
case 'launcherFolderNameChanged': {
|
|
492
|
+
if (typeof formId !== 'string') {
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
if (typeof taskId === 'number') {
|
|
496
|
+
taskId = taskId.toString();
|
|
497
|
+
}
|
|
498
|
+
const r = globalEvents.launcherFolderNameChangedHandler?.(taskId, formId);
|
|
499
|
+
if (r && (r instanceof Promise)) {
|
|
500
|
+
r.catch(function(e) {
|
|
501
|
+
console.log(e);
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
for (const tid in task.list) {
|
|
505
|
+
const t = task.list[tid];
|
|
506
|
+
for (const fid in t.forms) {
|
|
507
|
+
const r = t.forms[fid].events[name]?.(taskId, formId);
|
|
508
|
+
if (r instanceof Promise) {
|
|
509
|
+
r.catch(function(e) {
|
|
510
|
+
console.log(e);
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
488
517
|
}
|
|
489
518
|
}
|
|
490
519
|
|
|
@@ -637,6 +666,7 @@ export async function fetchApp(url: string, opt: types.ICoreFetchAppOptions = {}
|
|
|
637
666
|
files[file] = blob;
|
|
638
667
|
}
|
|
639
668
|
++loaded;
|
|
669
|
+
opt.progress?.(loaded, total) as unknown;
|
|
640
670
|
if (opt.notifyId) {
|
|
641
671
|
form.notifyProgress(opt.notifyId, loaded / total);
|
|
642
672
|
}
|
|
@@ -646,6 +676,7 @@ export async function fetchApp(url: string, opt: types.ICoreFetchAppOptions = {}
|
|
|
646
676
|
resolve();
|
|
647
677
|
}).catch(function() {
|
|
648
678
|
++loaded;
|
|
679
|
+
opt.progress?.(loaded, total) as unknown;
|
|
649
680
|
if (opt.notifyId) {
|
|
650
681
|
form.notifyProgress(opt.notifyId, loaded / total);
|
|
651
682
|
}
|
|
@@ -680,8 +711,8 @@ export function getAvailArea(): types.IAvailArea {
|
|
|
680
711
|
return {
|
|
681
712
|
'left': 0,
|
|
682
713
|
'top': 0,
|
|
683
|
-
'width':
|
|
684
|
-
'height':
|
|
714
|
+
'width': window.innerWidth,
|
|
715
|
+
'height': window.innerHeight - 46
|
|
685
716
|
};
|
|
686
717
|
}
|
|
687
718
|
else {
|
|
@@ -693,29 +724,29 @@ export function getAvailArea(): types.IAvailArea {
|
|
|
693
724
|
case 'left': {
|
|
694
725
|
left = task.systemTaskInfo.length;
|
|
695
726
|
top = 0;
|
|
696
|
-
width =
|
|
697
|
-
height =
|
|
727
|
+
width = window.innerWidth - task.systemTaskInfo.length;
|
|
728
|
+
height = window.innerHeight;
|
|
698
729
|
break;
|
|
699
730
|
}
|
|
700
731
|
case 'right': {
|
|
701
732
|
left = 0;
|
|
702
733
|
top = 0;
|
|
703
|
-
width =
|
|
704
|
-
height =
|
|
734
|
+
width = window.innerWidth - task.systemTaskInfo.length;
|
|
735
|
+
height = window.innerHeight;
|
|
705
736
|
break;
|
|
706
737
|
}
|
|
707
738
|
case 'top': {
|
|
708
739
|
left = 0;
|
|
709
740
|
top = task.systemTaskInfo.length;
|
|
710
|
-
width =
|
|
711
|
-
height =
|
|
741
|
+
width = window.innerWidth;
|
|
742
|
+
height = window.innerHeight - task.systemTaskInfo.length;
|
|
712
743
|
break;
|
|
713
744
|
}
|
|
714
745
|
case 'bottom': {
|
|
715
746
|
left = 0;
|
|
716
747
|
top = 0;
|
|
717
|
-
width =
|
|
718
|
-
height =
|
|
748
|
+
width = window.innerWidth;
|
|
749
|
+
height = window.innerHeight - task.systemTaskInfo.length;
|
|
719
750
|
}
|
|
720
751
|
}
|
|
721
752
|
return {
|
package/dist/lib/dom.js
CHANGED
|
@@ -4,10 +4,13 @@ exports.fullscreen = exports.siblingsData = exports.siblings = exports.findParen
|
|
|
4
4
|
const clickgo = require("../clickgo");
|
|
5
5
|
const form = require("./form");
|
|
6
6
|
const core = require("./core");
|
|
7
|
-
const topClass = ['#cg-form-list', '#cg-pop-list', '#cg-system', '#cg-simpletask'];
|
|
8
|
-
function classUnfold(after) {
|
|
7
|
+
const topClass = ['#cg-form-list', '#cg-pop-list', '#cg-system', '#cg-simpletask', '#cg-launcher'];
|
|
8
|
+
function classUnfold(after, out = []) {
|
|
9
9
|
const arr = [];
|
|
10
10
|
for (const name of topClass) {
|
|
11
|
+
if (out.includes(name)) {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
11
14
|
arr.push(name + (after ? (' ' + after) : ''));
|
|
12
15
|
}
|
|
13
16
|
return arr.join(', ');
|
|
@@ -20,7 +23,7 @@ styleList.insertAdjacentHTML('beforeend', `<style id='cg-global'>
|
|
|
20
23
|
${classUnfold()} {-webkit-user-select: none; user-select: none; position: fixed; cursor: default; box-sizing: border-box;}
|
|
21
24
|
${topClass.slice(0, 3).join(', ')} {left: 0; top: 0; width: 0; height: 0;}
|
|
22
25
|
${classUnfold('img')} {vertical-align: bottom;}
|
|
23
|
-
${classUnfold('::selection')} {background-color: rgba(0, 0, 0, .1);}
|
|
26
|
+
${classUnfold('::selection', ['#cg-launcher'])} {background-color: rgba(0, 0, 0, .1);}
|
|
24
27
|
${classUnfold('*')}, ${classUnfold('*::after')}, ${classUnfold('*::before')} {box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); flex-shrink: 0;}
|
|
25
28
|
${classUnfold()}, ${classUnfold('input')}, ${classUnfold('textarea')} {font-family: "Lucida Sans Unicode", "Helvetica Neue","Helvetica","PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Noto Sans CJK","Source Han Sans","WenQuanYi Micro Hei","Microsoft YaHei",sans-serif; font-size: 12px; line-height: 1; -webkit-font-smoothing: antialiased;}
|
|
26
29
|
</style>`);
|
package/dist/lib/dom.ts
CHANGED
|
@@ -19,10 +19,13 @@ import * as form from './form';
|
|
|
19
19
|
import * as core from './core';
|
|
20
20
|
|
|
21
21
|
/** --- style list 的 div --- */
|
|
22
|
-
const topClass: string[] = ['#cg-form-list', '#cg-pop-list', '#cg-system', '#cg-simpletask'];
|
|
23
|
-
function classUnfold(after?: string): string {
|
|
22
|
+
const topClass: string[] = ['#cg-form-list', '#cg-pop-list', '#cg-system', '#cg-simpletask', '#cg-launcher'];
|
|
23
|
+
function classUnfold(after?: string, out: string[] = []): string {
|
|
24
24
|
const arr: string[] = [];
|
|
25
25
|
for (const name of topClass) {
|
|
26
|
+
if (out.includes(name)) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
26
29
|
arr.push(name + (after ? (' ' + after) : ''));
|
|
27
30
|
}
|
|
28
31
|
return arr.join(', ');
|
|
@@ -40,7 +43,7 @@ styleList.insertAdjacentHTML('beforeend', `<style id='cg-global'>
|
|
|
40
43
|
${classUnfold()} {-webkit-user-select: none; user-select: none; position: fixed; cursor: default; box-sizing: border-box;}
|
|
41
44
|
${topClass.slice(0, 3).join(', ')} {left: 0; top: 0; width: 0; height: 0;}
|
|
42
45
|
${classUnfold('img')} {vertical-align: bottom;}
|
|
43
|
-
${classUnfold('::selection')} {background-color: rgba(0, 0, 0, .1);}
|
|
46
|
+
${classUnfold('::selection', ['#cg-launcher'])} {background-color: rgba(0, 0, 0, .1);}
|
|
44
47
|
${classUnfold('*')}, ${classUnfold('*::after')}, ${classUnfold('*::before')} {box-sizing: border-box; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); flex-shrink: 0;}
|
|
45
48
|
${classUnfold()}, ${classUnfold('input')}, ${classUnfold('textarea')} {font-family: "Lucida Sans Unicode", "Helvetica Neue","Helvetica","PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Noto Sans CJK","Source Han Sans","WenQuanYi Micro Hei","Microsoft YaHei",sans-serif; font-size: 12px; line-height: 1; -webkit-font-smoothing: antialiased;}
|
|
46
49
|
</style>`);
|