clickgo 3.0.6-dev7 → 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 +33 -4
- package/dist/lib/core.ts +32 -3
- package/dist/lib/dom.js +6 -3
- package/dist/lib/dom.ts +6 -3
- package/dist/lib/form.js +215 -30
- package/dist/lib/form.ts +232 -42
- package/dist/lib/native.js +8 -148
- package/dist/lib/native.ts +6 -211
- package/dist/lib/task.js +3 -10
- package/dist/lib/task.ts +3 -10
- 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;
|
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
|
|
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>`);
|
package/dist/lib/form.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.hide = exports.show = exports.flash = exports.setTopMost = exports.confirm = exports.dialog = exports.create = exports.remove = exports.doFocusAndPopEvent = exports.hidePop = exports.showPop = exports.removeFromPop = exports.appendToPop = exports.hideNotify = exports.notifyProgress = exports.notify = exports.hideDrag = exports.moveDrag = exports.showDrag = exports.hideRectangle = exports.showRectangle = exports.moveRectangle = exports.showCircular = exports.getRectByBorder = exports.getMaxZIndexID = exports.changeFocus = exports.getList = exports.send = exports.get = exports.getTaskId = exports.refreshMaxPosition = exports.bindDrag = exports.bindResize = exports.close = exports.max = exports.min = exports.simpleSystemTaskRoot = void 0;
|
|
12
|
+
exports.hideLauncher = exports.showLauncher = exports.hide = exports.show = exports.flash = exports.setTopMost = exports.confirm = exports.dialog = exports.create = exports.remove = exports.doFocusAndPopEvent = exports.hidePop = exports.showPop = exports.removeFromPop = exports.appendToPop = exports.hideNotify = exports.notifyProgress = exports.notify = exports.hideDrag = exports.moveDrag = exports.showDrag = exports.hideRectangle = exports.showRectangle = exports.moveRectangle = exports.showCircular = exports.getRectByBorder = exports.getMaxZIndexID = exports.changeFocus = exports.getList = exports.send = exports.get = exports.getTaskId = exports.refreshMaxPosition = exports.bindDrag = exports.bindResize = exports.close = exports.max = exports.min = exports.launcherRoot = exports.simpleSystemTaskRoot = void 0;
|
|
13
13
|
const clickgo = require("../clickgo");
|
|
14
14
|
const core = require("./core");
|
|
15
15
|
const task = require("./task");
|
|
@@ -26,25 +26,29 @@ const info = {
|
|
|
26
26
|
'ok': '好',
|
|
27
27
|
'yes': '是',
|
|
28
28
|
'no': '否',
|
|
29
|
-
'cancel': '取消'
|
|
29
|
+
'cancel': '取消',
|
|
30
|
+
'search': '搜索'
|
|
30
31
|
},
|
|
31
32
|
'tc': {
|
|
32
33
|
'ok': '好',
|
|
33
34
|
'yes': '是',
|
|
34
35
|
'no': '否',
|
|
35
|
-
'cancel': '取消'
|
|
36
|
+
'cancel': '取消',
|
|
37
|
+
'search': '檢索'
|
|
36
38
|
},
|
|
37
39
|
'en': {
|
|
38
40
|
'ok': 'OK',
|
|
39
41
|
'yes': 'Yes',
|
|
40
42
|
'no': 'No',
|
|
41
|
-
'cancel': 'Cancel'
|
|
43
|
+
'cancel': 'Cancel',
|
|
44
|
+
'search': 'Search'
|
|
42
45
|
},
|
|
43
46
|
'ja': {
|
|
44
47
|
'ok': '好',
|
|
45
48
|
'yes': 'はい',
|
|
46
49
|
'no': 'いいえ',
|
|
47
|
-
'cancel': 'キャンセル'
|
|
50
|
+
'cancel': 'キャンセル',
|
|
51
|
+
'search': '検索'
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
};
|
|
@@ -64,21 +68,16 @@ const elements = {
|
|
|
64
68
|
'dragIcon': undefined,
|
|
65
69
|
'system': document.createElement('div'),
|
|
66
70
|
'simpleSystemtask': document.createElement('div'),
|
|
71
|
+
'launcher': document.createElement('div'),
|
|
67
72
|
'init': function () {
|
|
68
73
|
this.wrap.id = 'cg-wrap';
|
|
69
74
|
document.getElementsByTagName('body')[0].appendChild(this.wrap);
|
|
70
75
|
if (clickgo.getNative() && (clickgo.getPlatform() === 'win32')) {
|
|
71
76
|
this.wrap.addEventListener('mouseenter', function () {
|
|
72
|
-
native.
|
|
73
|
-
'token': native.getToken(),
|
|
74
|
-
'param': false
|
|
75
|
-
}));
|
|
77
|
+
native.invoke('cg-mouse-ignore', native.getToken(), false);
|
|
76
78
|
});
|
|
77
79
|
this.wrap.addEventListener('mouseleave', function () {
|
|
78
|
-
native.
|
|
79
|
-
'token': native.getToken(),
|
|
80
|
-
'param': true
|
|
81
|
-
}));
|
|
80
|
+
native.invoke('cg-mouse-ignore', native.getToken(), true);
|
|
82
81
|
});
|
|
83
82
|
}
|
|
84
83
|
this.list.id = 'cg-form-list';
|
|
@@ -176,6 +175,183 @@ const elements = {
|
|
|
176
175
|
}
|
|
177
176
|
});
|
|
178
177
|
simpletaskApp.mount('#cg-simpletask');
|
|
178
|
+
this.launcher.id = 'cg-launcher';
|
|
179
|
+
this.launcher.addEventListener('contextmenu', function (e) {
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
});
|
|
182
|
+
this.wrap.appendChild(this.launcher);
|
|
183
|
+
this.launcher.addEventListener('touchmove', function (e) {
|
|
184
|
+
e.preventDefault();
|
|
185
|
+
}, {
|
|
186
|
+
'passive': false
|
|
187
|
+
});
|
|
188
|
+
const waiting = function () {
|
|
189
|
+
if (!core.config) {
|
|
190
|
+
setTimeout(function () {
|
|
191
|
+
waiting();
|
|
192
|
+
}, 2000);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const launcherApp = clickgo.vue.createApp({
|
|
196
|
+
'template': `<div class="cg-launcher-search">` +
|
|
197
|
+
`<input v-if="folderName === ''" class="cg-launcher-sinput" :placeholder="search" v-model="name">` +
|
|
198
|
+
`<input v-else class="cg-launcher-foldername" :value="folderName" @change="folderNameChange">` +
|
|
199
|
+
`</div>` +
|
|
200
|
+
`<div class="cg-launcher-list" @mousedown="mousedown" @click="listClick" :class="[folderName === '' ? '' : 'cg-folder-open']">` +
|
|
201
|
+
`<div v-for="item of list" class="cg-launcher-item">` +
|
|
202
|
+
`<div class="cg-launcher-inner">` +
|
|
203
|
+
`<div v-if="!item.list || item.list.length === 0" class="cg-launcher-icon" :style="{'background-image': 'url(' + item.icon + ')'}" @click="iconClick($event, item)"></div>` +
|
|
204
|
+
`<div v-else class="cg-launcher-folder" @click="openFolder($event, item)">` +
|
|
205
|
+
`<div>` +
|
|
206
|
+
`<div v-for="sub of item.list" class="cg-launcher-item">` +
|
|
207
|
+
`<div class="cg-launcher-inner">` +
|
|
208
|
+
`<div class="cg-launcher-icon" :style="{'background-image': 'url(' + sub.icon + ')'}" @click="subIconClick($event, sub)"></div>` +
|
|
209
|
+
`<div class="cg-launcher-name">{{sub.name}}</div>` +
|
|
210
|
+
`</div>` +
|
|
211
|
+
`<div class="cg-launcher-space"></div>` +
|
|
212
|
+
`</div>` +
|
|
213
|
+
`</div>` +
|
|
214
|
+
`</div>` +
|
|
215
|
+
`<div class="cg-launcher-name">{{item.name}}</div>` +
|
|
216
|
+
`</div>` +
|
|
217
|
+
`<div class="cg-launcher-space"></div>` +
|
|
218
|
+
`</div>` +
|
|
219
|
+
`</div>`,
|
|
220
|
+
'data': function () {
|
|
221
|
+
return {
|
|
222
|
+
'name': '',
|
|
223
|
+
'folderName': ''
|
|
224
|
+
};
|
|
225
|
+
},
|
|
226
|
+
'computed': {
|
|
227
|
+
'search': function () {
|
|
228
|
+
var _a, _b;
|
|
229
|
+
return (_b = (_a = info.locale[core.config.locale]) === null || _a === void 0 ? void 0 : _a.search) !== null && _b !== void 0 ? _b : info.locale['en'].search;
|
|
230
|
+
},
|
|
231
|
+
'list': function () {
|
|
232
|
+
if (this.name === '') {
|
|
233
|
+
return core.config['launcher.list'];
|
|
234
|
+
}
|
|
235
|
+
const list = [];
|
|
236
|
+
for (const item of core.config['launcher.list']) {
|
|
237
|
+
if (item.list && item.list.length > 0) {
|
|
238
|
+
for (const sub of item.list) {
|
|
239
|
+
if (sub.name.toLowerCase().includes(this.name.toLowerCase())) {
|
|
240
|
+
list.push(sub);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
if (item.name.toLowerCase().includes(this.name.toLowerCase())) {
|
|
246
|
+
list.push(item);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return list;
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
'methods': {
|
|
254
|
+
mousedown: function (e) {
|
|
255
|
+
this.md = e.pageX + e.pageY;
|
|
256
|
+
},
|
|
257
|
+
listClick: function (e) {
|
|
258
|
+
if (this.md !== e.pageX + e.pageY) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (e.currentTarget !== e.target) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (this.folderName === '') {
|
|
265
|
+
hideLauncher();
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
this.closeFolder();
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
iconClick: function (e, item) {
|
|
272
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
273
|
+
if (this.md !== e.pageX + e.pageY) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
hideLauncher();
|
|
277
|
+
yield clickgo.task.run(item.path, {
|
|
278
|
+
'icon': item.icon
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
},
|
|
282
|
+
subIconClick: function (e, item) {
|
|
283
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
284
|
+
if (this.md !== e.pageX + e.pageY) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
hideLauncher();
|
|
288
|
+
yield clickgo.task.run(item.path, {
|
|
289
|
+
'icon': item.icon
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
},
|
|
293
|
+
closeFolder: function () {
|
|
294
|
+
this.folderName = '';
|
|
295
|
+
const el = this.folderEl;
|
|
296
|
+
const rect = el.parentNode.getBoundingClientRect();
|
|
297
|
+
el.classList.remove('cg-show');
|
|
298
|
+
el.style.left = (rect.left + 30).toString() + 'px';
|
|
299
|
+
el.style.top = rect.top.toString() + 'px';
|
|
300
|
+
el.style.width = '';
|
|
301
|
+
el.style.height = '';
|
|
302
|
+
setTimeout(() => {
|
|
303
|
+
el.style.position = '';
|
|
304
|
+
el.style.left = '';
|
|
305
|
+
el.style.top = '';
|
|
306
|
+
}, 150);
|
|
307
|
+
},
|
|
308
|
+
openFolder: function (e, item) {
|
|
309
|
+
if (this.md !== e.pageX + e.pageY) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
if (e.currentTarget.childNodes[0] !== e.target) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
if (this.folderName !== '') {
|
|
316
|
+
this.closeFolder();
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
this.folderName = item.name;
|
|
320
|
+
this.folderItem = item;
|
|
321
|
+
const el = e.currentTarget.childNodes.item(0);
|
|
322
|
+
this.folderEl = el;
|
|
323
|
+
const searchEl = document.getElementsByClassName('cg-launcher-search')[0];
|
|
324
|
+
const rect = el.getBoundingClientRect();
|
|
325
|
+
el.style.left = rect.left.toString() + 'px';
|
|
326
|
+
el.style.top = rect.top.toString() + 'px';
|
|
327
|
+
el.style.position = 'fixed';
|
|
328
|
+
requestAnimationFrame(() => {
|
|
329
|
+
el.classList.add('cg-show');
|
|
330
|
+
el.style.left = '50px';
|
|
331
|
+
el.style.top = searchEl.offsetHeight.toString() + 'px';
|
|
332
|
+
el.style.width = 'calc(100% - 100px)';
|
|
333
|
+
el.style.height = 'calc(100% - 50px - ' + searchEl.offsetHeight.toString() + 'px)';
|
|
334
|
+
});
|
|
335
|
+
},
|
|
336
|
+
folderNameChange: function (e) {
|
|
337
|
+
var _a;
|
|
338
|
+
const input = e.target;
|
|
339
|
+
const val = input.value.trim();
|
|
340
|
+
if (val === '') {
|
|
341
|
+
input.value = this.folderName;
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
this.folderName = val;
|
|
345
|
+
core.trigger('launcherFolderNameChanged', (_a = this.folderItem.id) !== null && _a !== void 0 ? _a : '', val);
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
'mounted': function () {
|
|
349
|
+
exports.launcherRoot = this;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
launcherApp.mount('#cg-launcher');
|
|
353
|
+
};
|
|
354
|
+
waiting();
|
|
179
355
|
}
|
|
180
356
|
};
|
|
181
357
|
elements.init();
|
|
@@ -1322,6 +1498,12 @@ function create(opt) {
|
|
|
1322
1498
|
},
|
|
1323
1499
|
hide: function (fid) {
|
|
1324
1500
|
clickgo.form.hide(fid !== null && fid !== void 0 ? fid : formId, taskId);
|
|
1501
|
+
},
|
|
1502
|
+
showLauncher: function () {
|
|
1503
|
+
clickgo.form.showLauncher();
|
|
1504
|
+
},
|
|
1505
|
+
hideLauncher: function () {
|
|
1506
|
+
clickgo.form.hideLauncher();
|
|
1325
1507
|
}
|
|
1326
1508
|
},
|
|
1327
1509
|
'fs': {
|
|
@@ -1438,23 +1620,8 @@ function create(opt) {
|
|
|
1438
1620
|
}
|
|
1439
1621
|
},
|
|
1440
1622
|
'native': {
|
|
1441
|
-
|
|
1442
|
-
return clickgo.native.
|
|
1443
|
-
},
|
|
1444
|
-
send: function (name, param, handler) {
|
|
1445
|
-
return clickgo.native.send(name, param, handler, taskId);
|
|
1446
|
-
},
|
|
1447
|
-
on: function (name, handler, id, once = false) {
|
|
1448
|
-
clickgo.native.on(name, handler, id, once, taskId);
|
|
1449
|
-
},
|
|
1450
|
-
once: function (name, handler, id) {
|
|
1451
|
-
clickgo.native.once(name, handler, id, taskId);
|
|
1452
|
-
},
|
|
1453
|
-
off: function (name, handler) {
|
|
1454
|
-
clickgo.native.off(name, handler, taskId);
|
|
1455
|
-
},
|
|
1456
|
-
clearListener: function () {
|
|
1457
|
-
clickgo.native.clearListener(taskId);
|
|
1623
|
+
invoke: function (name, ...param) {
|
|
1624
|
+
return clickgo.native.invoke(name, ...param);
|
|
1458
1625
|
},
|
|
1459
1626
|
max: function () {
|
|
1460
1627
|
clickgo.native.max();
|
|
@@ -2116,6 +2283,24 @@ function hide(formId, taskId) {
|
|
|
2116
2283
|
form.vroot.$refs.form.$data.showData = false;
|
|
2117
2284
|
}
|
|
2118
2285
|
exports.hide = hide;
|
|
2286
|
+
function showLauncher() {
|
|
2287
|
+
elements.launcher.style.display = 'flex';
|
|
2288
|
+
requestAnimationFrame(function () {
|
|
2289
|
+
elements.launcher.classList.add('cg-show');
|
|
2290
|
+
});
|
|
2291
|
+
}
|
|
2292
|
+
exports.showLauncher = showLauncher;
|
|
2293
|
+
function hideLauncher() {
|
|
2294
|
+
elements.launcher.classList.remove('cg-show');
|
|
2295
|
+
setTimeout(function () {
|
|
2296
|
+
if (exports.launcherRoot.folderName !== '') {
|
|
2297
|
+
exports.launcherRoot.closeFolder();
|
|
2298
|
+
}
|
|
2299
|
+
exports.launcherRoot.name = '';
|
|
2300
|
+
elements.launcher.style.display = 'none';
|
|
2301
|
+
}, 300);
|
|
2302
|
+
}
|
|
2303
|
+
exports.hideLauncher = hideLauncher;
|
|
2119
2304
|
window.addEventListener('resize', function () {
|
|
2120
2305
|
task.refreshSystemPosition();
|
|
2121
2306
|
});
|