clickgo 3.0.0-dev

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.
Files changed (145) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +75 -0
  3. package/dist/app/demo/config.json +106 -0
  4. package/dist/app/demo/form/control/block/block.css +1 -0
  5. package/dist/app/demo/form/control/block/block.scss +17 -0
  6. package/dist/app/demo/form/control/block/block.xml +7 -0
  7. package/dist/app/demo/form/control/button/button.css +1 -0
  8. package/dist/app/demo/form/control/button/button.js +27 -0
  9. package/dist/app/demo/form/control/button/button.scss +18 -0
  10. package/dist/app/demo/form/control/button/button.xml +126 -0
  11. package/dist/app/demo/form/control/check/check.js +12 -0
  12. package/dist/app/demo/form/control/check/check.xml +13 -0
  13. package/dist/app/demo/form/control/dialog/dialog.js +8 -0
  14. package/dist/app/demo/form/control/dialog/dialog.xml +26 -0
  15. package/dist/app/demo/form/control/file/file.js +23 -0
  16. package/dist/app/demo/form/control/file/file.xml +25 -0
  17. package/dist/app/demo/form/control/form/form.css +1 -0
  18. package/dist/app/demo/form/control/form/form.js +38 -0
  19. package/dist/app/demo/form/control/form/form.scss +9 -0
  20. package/dist/app/demo/form/control/form/form.xml +28 -0
  21. package/dist/app/demo/form/control/greatview/greatview.css +1 -0
  22. package/dist/app/demo/form/control/greatview/greatview.js +92 -0
  23. package/dist/app/demo/form/control/greatview/greatview.scss +22 -0
  24. package/dist/app/demo/form/control/greatview/greatview.xml +89 -0
  25. package/dist/app/demo/form/control/img/img.xml +16 -0
  26. package/dist/app/demo/form/control/label/label.xml +11 -0
  27. package/dist/app/demo/form/control/list/list.css +1 -0
  28. package/dist/app/demo/form/control/list/list.js +194 -0
  29. package/dist/app/demo/form/control/list/list.scss +7 -0
  30. package/dist/app/demo/form/control/list/list.xml +91 -0
  31. package/dist/app/demo/form/control/loading/loading.xml +8 -0
  32. package/dist/app/demo/form/control/marquee/marquee.js +30 -0
  33. package/dist/app/demo/form/control/marquee/marquee.xml +36 -0
  34. package/dist/app/demo/form/control/menu/menu.js +8 -0
  35. package/dist/app/demo/form/control/menu/menu.xml +122 -0
  36. package/dist/app/demo/form/control/monaco/monaco.js +113 -0
  37. package/dist/app/demo/form/control/monaco/monaco.xml +27 -0
  38. package/dist/app/demo/form/control/overflow/overflow.css +1 -0
  39. package/dist/app/demo/form/control/overflow/overflow.js +70 -0
  40. package/dist/app/demo/form/control/overflow/overflow.scss +18 -0
  41. package/dist/app/demo/form/control/overflow/overflow.xml +98 -0
  42. package/dist/app/demo/form/control/property/property.js +129 -0
  43. package/dist/app/demo/form/control/property/property.xml +6 -0
  44. package/dist/app/demo/form/control/radio/radio.js +7 -0
  45. package/dist/app/demo/form/control/radio/radio.xml +12 -0
  46. package/dist/app/demo/form/control/scroll/scroll.js +14 -0
  47. package/dist/app/demo/form/control/scroll/scroll.xml +35 -0
  48. package/dist/app/demo/form/control/select/select.js +91 -0
  49. package/dist/app/demo/form/control/select/select.xml +74 -0
  50. package/dist/app/demo/form/control/tab/tab.js +75 -0
  51. package/dist/app/demo/form/control/tab/tab.xml +22 -0
  52. package/dist/app/demo/form/control/text/text.js +53 -0
  53. package/dist/app/demo/form/control/text/text.xml +37 -0
  54. package/dist/app/demo/form/control/view/view.css +1 -0
  55. package/dist/app/demo/form/control/view/view.js +73 -0
  56. package/dist/app/demo/form/control/view/view.scss +18 -0
  57. package/dist/app/demo/form/control/view/view.xml +94 -0
  58. package/dist/app/demo/form/event/form/form.css +1 -0
  59. package/dist/app/demo/form/event/form/form.js +129 -0
  60. package/dist/app/demo/form/event/form/form.scss +24 -0
  61. package/dist/app/demo/form/event/form/form.xml +16 -0
  62. package/dist/app/demo/form/event/screen/screen.js +51 -0
  63. package/dist/app/demo/form/event/screen/screen.xml +9 -0
  64. package/dist/app/demo/form/event/task/task.js +78 -0
  65. package/dist/app/demo/form/event/task/task.xml +20 -0
  66. package/dist/app/demo/form/main.css +1 -0
  67. package/dist/app/demo/form/main.js +25 -0
  68. package/dist/app/demo/form/main.scss +9 -0
  69. package/dist/app/demo/form/main.xml +49 -0
  70. package/dist/app/demo/form/method/core/core.js +25 -0
  71. package/dist/app/demo/form/method/core/core.xml +7 -0
  72. package/dist/app/demo/form/method/dom/dom.css +1 -0
  73. package/dist/app/demo/form/method/dom/dom.js +163 -0
  74. package/dist/app/demo/form/method/dom/dom.scss +10 -0
  75. package/dist/app/demo/form/method/dom/dom.xml +55 -0
  76. package/dist/app/demo/form/method/form/form.css +1 -0
  77. package/dist/app/demo/form/method/form/form.js +217 -0
  78. package/dist/app/demo/form/method/form/form.scss +3 -0
  79. package/dist/app/demo/form/method/form/form.xml +56 -0
  80. package/dist/app/demo/form/method/form/test.xml +5 -0
  81. package/dist/app/demo/form/method/fs/fs.js +88 -0
  82. package/dist/app/demo/form/method/fs/fs.xml +8 -0
  83. package/dist/app/demo/form/method/fs/text.js +15 -0
  84. package/dist/app/demo/form/method/fs/text.xml +3 -0
  85. package/dist/app/demo/form/method/task/locale1.json +3 -0
  86. package/dist/app/demo/form/method/task/locale2.json +3 -0
  87. package/dist/app/demo/form/method/task/task.js +153 -0
  88. package/dist/app/demo/form/method/task/task.xml +57 -0
  89. package/dist/app/demo/form/method/theme/theme.js +74 -0
  90. package/dist/app/demo/form/method/theme/theme.xml +9 -0
  91. package/dist/app/demo/form/method/tool/tool.js +64 -0
  92. package/dist/app/demo/form/method/tool/tool.xml +26 -0
  93. package/dist/app/demo/form/method/zip/zip.js +99 -0
  94. package/dist/app/demo/form/method/zip/zip.xml +12 -0
  95. package/dist/app/demo/global.css +3 -0
  96. package/dist/app/demo/res/icon.svg +1 -0
  97. package/dist/app/demo/res/img.jpg +0 -0
  98. package/dist/app/demo/res/r-1.svg +1 -0
  99. package/dist/app/demo/res/r-2.svg +1 -0
  100. package/dist/app/demo/res/sql.svg +1 -0
  101. package/dist/app/demo/res/txt.svg +1 -0
  102. package/dist/app/demo/res/zip.svg +1 -0
  103. package/dist/app/task/config.json +29 -0
  104. package/dist/app/task/form/bar/bar.js +299 -0
  105. package/dist/app/task/form/bar/bar.xml +47 -0
  106. package/dist/app/task/form/desktop/desktop.xml +1 -0
  107. package/dist/app/task/locale/en.json +11 -0
  108. package/dist/app/task/locale/ja.json +11 -0
  109. package/dist/app/task/locale/sc.json +11 -0
  110. package/dist/app/task/locale/tc.json +11 -0
  111. package/dist/clickgo.js +41 -0
  112. package/dist/clickgo.ts +51 -0
  113. package/dist/control/common.cgc +0 -0
  114. package/dist/control/form.cgc +0 -0
  115. package/dist/control/monaco.cgc +0 -0
  116. package/dist/control/property.cgc +0 -0
  117. package/dist/control/task.cgc +0 -0
  118. package/dist/global.css +1 -0
  119. package/dist/icon.png +0 -0
  120. package/dist/index.js +88 -0
  121. package/dist/index.ts +92 -0
  122. package/dist/lib/control.js +365 -0
  123. package/dist/lib/control.ts +428 -0
  124. package/dist/lib/core.js +668 -0
  125. package/dist/lib/core.ts +732 -0
  126. package/dist/lib/dom.js +1471 -0
  127. package/dist/lib/dom.ts +1785 -0
  128. package/dist/lib/form.js +2101 -0
  129. package/dist/lib/form.ts +2496 -0
  130. package/dist/lib/fs.js +849 -0
  131. package/dist/lib/fs.ts +995 -0
  132. package/dist/lib/native.js +138 -0
  133. package/dist/lib/native.ts +219 -0
  134. package/dist/lib/task.js +686 -0
  135. package/dist/lib/task.ts +842 -0
  136. package/dist/lib/theme.js +159 -0
  137. package/dist/lib/theme.ts +196 -0
  138. package/dist/lib/tool.js +501 -0
  139. package/dist/lib/tool.ts +620 -0
  140. package/dist/lib/zip.js +352 -0
  141. package/dist/lib/zip.ts +434 -0
  142. package/dist/theme/familiar.cgt +0 -0
  143. package/package.json +27 -0
  144. package/types/dev.d.ts +30 -0
  145. package/types/index.d.ts +673 -0
@@ -0,0 +1,299 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.mounted = exports.methods = exports.computed = exports.data = void 0;
13
+ const clickgo = require("clickgo");
14
+ exports.data = {
15
+ 'left': 0,
16
+ 'top': 0,
17
+ 'width': undefined,
18
+ 'height': undefined,
19
+ 'apps': []
20
+ };
21
+ exports.computed = {
22
+ 'position': function () {
23
+ return clickgo.core.config['task.position'];
24
+ }
25
+ };
26
+ exports.methods = {
27
+ itemClick: function (appIndex) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ if (this.apps[appIndex].formCount === 0) {
30
+ try {
31
+ yield clickgo.task.run(this.apps[appIndex].path);
32
+ }
33
+ catch (_a) {
34
+ return;
35
+ }
36
+ }
37
+ else if (this.apps[appIndex].formCount === 1) {
38
+ const formIds = Object.keys(this.apps[appIndex].forms);
39
+ const formId = parseInt(formIds[0]);
40
+ const form = clickgo.form.get(formId);
41
+ if (!form) {
42
+ return;
43
+ }
44
+ if (form.focus) {
45
+ clickgo.form.min(formId);
46
+ }
47
+ else {
48
+ clickgo.form.changeFocus(formId);
49
+ }
50
+ }
51
+ else {
52
+ }
53
+ });
54
+ },
55
+ run: function (path) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ try {
58
+ yield clickgo.task.run(path);
59
+ }
60
+ catch (_a) {
61
+ return;
62
+ }
63
+ });
64
+ },
65
+ pin: function (index) {
66
+ const app = this.apps[index];
67
+ if (!app) {
68
+ return;
69
+ }
70
+ const paths = Object.keys(clickgo.core.config['task.pin']);
71
+ if (paths.includes(app.path)) {
72
+ delete clickgo.core.config['task.pin'][app.path];
73
+ }
74
+ else {
75
+ clickgo.core.config['task.pin'][app.path] = {
76
+ 'name': app.name,
77
+ 'icon': app.icon
78
+ };
79
+ }
80
+ },
81
+ close: function (index) {
82
+ const app = this.apps[index];
83
+ if (!app) {
84
+ return;
85
+ }
86
+ for (const formId in app.forms) {
87
+ clickgo.form.remove(parseInt(formId));
88
+ }
89
+ },
90
+ changeFocus: function (formId) {
91
+ clickgo.form.changeFocus(parseInt(formId));
92
+ },
93
+ updatePosition: function (position) {
94
+ clickgo.core.config['task.position'] = position;
95
+ },
96
+ getAppIndexByPath: function (path) {
97
+ for (let i = 0; i < this.apps.length; ++i) {
98
+ const app = this.apps[i];
99
+ if (app.path !== path) {
100
+ continue;
101
+ }
102
+ return i;
103
+ }
104
+ return -1;
105
+ }
106
+ };
107
+ const mounted = function () {
108
+ clickgo.form.setTopMost(true);
109
+ clickgo.task.setSystem();
110
+ for (const path in clickgo.core.config['task.pin']) {
111
+ this.apps.push({
112
+ 'name': clickgo.core.config['task.pin'][path].name,
113
+ 'path': path,
114
+ 'icon': clickgo.core.config['task.pin'][path].icon,
115
+ 'selected': false,
116
+ 'opened': false,
117
+ 'forms': {},
118
+ 'formCount': 0,
119
+ 'pin': true
120
+ });
121
+ }
122
+ const tasks = clickgo.task.getList();
123
+ for (const taskId in tasks) {
124
+ if (parseInt(taskId) === this.taskId) {
125
+ continue;
126
+ }
127
+ const task = tasks[taskId];
128
+ let appIndex = this.getAppIndexByPath(task.path);
129
+ if (appIndex >= 0) {
130
+ this.apps[appIndex].opened = true;
131
+ }
132
+ else {
133
+ this.apps.push({
134
+ 'name': task.name,
135
+ 'path': task.path,
136
+ 'icon': task.icon,
137
+ 'selected': false,
138
+ 'opened': true,
139
+ 'forms': {},
140
+ 'formCount': 0,
141
+ 'pin': false
142
+ });
143
+ appIndex = this.apps.length - 1;
144
+ }
145
+ const forms = clickgo.form.getList(parseInt(taskId));
146
+ for (const formId in forms) {
147
+ const form = forms[formId];
148
+ this.apps[appIndex].forms[formId] = {
149
+ 'title': form.title,
150
+ 'icon': form.icon || this.apps[appIndex].icon
151
+ };
152
+ }
153
+ this.apps[appIndex].formCount = Object.keys(this.apps[appIndex].forms).length;
154
+ }
155
+ clickgo.core.setSystemEventListener('formCreated', (taskId, formId, title, icon) => {
156
+ if (taskId === this.taskId) {
157
+ return;
158
+ }
159
+ const task = clickgo.task.get(taskId);
160
+ if (!task) {
161
+ return;
162
+ }
163
+ let appIndex = this.getAppIndexByPath(task.path);
164
+ if (appIndex >= 0) {
165
+ this.apps[appIndex].opened = true;
166
+ }
167
+ else {
168
+ this.apps.push({
169
+ 'name': task.name,
170
+ 'path': task.path,
171
+ 'icon': task.icon,
172
+ 'selected': false,
173
+ 'opened': true,
174
+ 'forms': {},
175
+ 'formCount': 0,
176
+ 'pin': false
177
+ });
178
+ appIndex = this.apps.length - 1;
179
+ }
180
+ this.apps[appIndex].forms[formId] = {
181
+ 'title': title,
182
+ 'icon': icon || this.apps[appIndex].icon
183
+ };
184
+ ++this.apps[appIndex].formCount;
185
+ });
186
+ clickgo.core.setSystemEventListener('formRemoved', (taskId, formId) => {
187
+ const task = clickgo.task.get(taskId);
188
+ if (!task) {
189
+ return;
190
+ }
191
+ const appIndex = this.getAppIndexByPath(task.path);
192
+ if (appIndex < 0) {
193
+ return;
194
+ }
195
+ delete this.apps[appIndex].forms[formId];
196
+ --this.apps[appIndex].formCount;
197
+ if (this.apps[appIndex].formCount > 0) {
198
+ return;
199
+ }
200
+ const pinPaths = Object.keys(clickgo.core.config['task.pin']);
201
+ if (pinPaths.includes(this.apps[appIndex].path)) {
202
+ this.apps[appIndex].opened = false;
203
+ }
204
+ else {
205
+ this.apps.splice(appIndex, 1);
206
+ }
207
+ });
208
+ clickgo.core.setSystemEventListener('formFocused', (taskId) => {
209
+ const task = clickgo.task.get(taskId);
210
+ if (!task) {
211
+ return;
212
+ }
213
+ const appIndex = this.getAppIndexByPath(task.path);
214
+ if (appIndex < 0) {
215
+ return;
216
+ }
217
+ this.apps[appIndex].selected = true;
218
+ });
219
+ clickgo.core.setSystemEventListener('formBlurred', (taskId) => {
220
+ const task = clickgo.task.get(taskId);
221
+ if (!task) {
222
+ return;
223
+ }
224
+ const appIndex = this.getAppIndexByPath(task.path);
225
+ if (appIndex < 0) {
226
+ return;
227
+ }
228
+ this.apps[appIndex].selected = false;
229
+ });
230
+ clickgo.core.setSystemEventListener('formTitleChanged', (taskId, formId, title) => {
231
+ const task = clickgo.task.get(taskId);
232
+ if (!task) {
233
+ return;
234
+ }
235
+ const appIndex = this.getAppIndexByPath(task.path);
236
+ if (appIndex < 0) {
237
+ return;
238
+ }
239
+ if (!this.apps[appIndex].forms[formId]) {
240
+ return;
241
+ }
242
+ this.apps[appIndex].forms[formId].title = title;
243
+ });
244
+ clickgo.core.setSystemEventListener('formIconChanged', (taskId, formId, icon) => {
245
+ const task = clickgo.task.get(taskId);
246
+ if (!task) {
247
+ return;
248
+ }
249
+ const appIndex = this.getAppIndexByPath(task.path);
250
+ if (appIndex < 0) {
251
+ return;
252
+ }
253
+ if (!this.apps[appIndex].forms[formId]) {
254
+ return;
255
+ }
256
+ this.apps[appIndex].forms[formId].icon = icon || this.apps[appIndex].icon;
257
+ });
258
+ clickgo.core.setSystemEventListener('configChanged', (n, v) => {
259
+ if (n !== 'task.pin') {
260
+ return;
261
+ }
262
+ for (const path in v) {
263
+ const appIndex = this.getAppIndexByPath(path);
264
+ if (appIndex < 0) {
265
+ this.apps.unshift({
266
+ 'name': v[path].name,
267
+ 'path': path,
268
+ 'icon': v[path].icon,
269
+ 'selected': false,
270
+ 'opened': false,
271
+ 'forms': {},
272
+ 'formCount': 0,
273
+ 'pin': true
274
+ });
275
+ }
276
+ else {
277
+ if (!this.apps[appIndex].pin) {
278
+ this.apps[appIndex].pin = true;
279
+ }
280
+ }
281
+ }
282
+ for (let appIndex = 0; appIndex < this.apps.length; ++appIndex) {
283
+ const app = this.apps[appIndex];
284
+ if (!app.pin) {
285
+ continue;
286
+ }
287
+ if (v[app.path]) {
288
+ continue;
289
+ }
290
+ if (app.formCount === 0) {
291
+ this.apps.splice(appIndex, 1);
292
+ }
293
+ else {
294
+ app.pin = false;
295
+ }
296
+ }
297
+ });
298
+ };
299
+ exports.mounted = mounted;
@@ -0,0 +1,47 @@
1
+
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
+ <task :position="position">
4
+ <task-item>
5
+ <img src="/clickgo/icon.png" style="width: 16px; height: 16px;" />
6
+ </task-item>
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()">
8
+ <img :src="app.icon" style="width: 16px; height: 16px;" />
9
+ <template v-if="app.formCount > 1" v-slot:pop>
10
+ <menulist>
11
+ <menulist-item v-for="(form, formId) of app.forms" @click="changeFocus(formId)">
12
+ <img :src="form.icon" style="width: 16px; height: 16px;" /><label style="margin-left: 10px;">{{form.title}}</label>
13
+ </menulist-item>
14
+ </menulist>
15
+ </template>
16
+ <template v-slot:contextmenu>
17
+ <menulist>
18
+ <menulist-item @click="run(app.path)">
19
+ <img :src="app.icon" style="width: 16px; height: 16px;" /><label style="margin-left: 10px;">{{app.name}}</label>
20
+ </menulist-item>
21
+ <menulist-split v-if="app.formCount > 0"></menulist-split>
22
+ <menulist-item @click="pin(appIndex)">
23
+ <block style="width: 16px; height: 16px;"></block><label style="margin-left: 10px;">{{app.pin ? l('unpin from taskbar') : l('pin to taskbar')}}</label>
24
+ </menulist-item>
25
+ <menulist-item v-if="app.formCount > 0" @click="close(appIndex)">
26
+ <block style="width: 16px; height: 16px;"></block><label style="margin-left: 10px;">{{app.formCount > 1 ? l('close all windows') : l('close window')}}</label>
27
+ </menulist-item>
28
+ </menulist>
29
+ </template>
30
+ </task-item>
31
+ <template v-slot:pop>
32
+ <menulist>
33
+ <menulist-item alt="P">
34
+ {{l('position')}}
35
+ <template v-slot:pop>
36
+ <menulist>
37
+ <menulist-item alt="T" type="radio" :modelValue="position" @update:modelValue="updatePosition('top')" label="top">{{l('top')}}</menulist-item>
38
+ <menulist-item alt="R" type="radio" :modelValue="position" @update:modelValue="updatePosition('right')" label="right">{{l('right')}}</menulist-item>
39
+ <menulist-item alt="B" type="radio" :modelValue="position" @update:modelValue="updatePosition('bottom')" label="bottom">{{l('bottom')}}</menulist-item>
40
+ <menulist-item alt="L" type="radio" :modelValue="position" @update:modelValue="updatePosition('left')" label="left">{{l('left')}}</menulist-item>
41
+ </menulist>
42
+ </template>
43
+ </menulist-item>
44
+ </menulist>
45
+ </template>
46
+ </task>
47
+ </form>
@@ -0,0 +1 @@
1
+ <form></form>
@@ -0,0 +1,11 @@
1
+ {
2
+ "position": "Position",
3
+ "left": "Left",
4
+ "right": "Right",
5
+ "top": "Top",
6
+ "bottom": "Bottom",
7
+ "close all windows": "Close all windows",
8
+ "close window": "Close window",
9
+ "pin to taskbar": "Pin to taskbar",
10
+ "unpin from taskbar": "Unpin from taskbar"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "position": "位置",
3
+ "left": "左側",
4
+ "right": "右側",
5
+ "top": "頂端",
6
+ "bottom": "底端",
7
+ "close all windows": "すべてのウィンドウを閉じる",
8
+ "close window": "ウィンドウを閉じる",
9
+ "pin to taskbar": "タスク バーにピン留めする",
10
+ "unpin from taskbar": "タスク バーからピン留めを外す"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "position": "位置",
3
+ "left": "左侧",
4
+ "right": "右侧",
5
+ "top": "顶部",
6
+ "bottom": "底部",
7
+ "close all windows": "关闭所有窗口",
8
+ "close window": "关闭窗口",
9
+ "pin to taskbar": "钉在任务栏",
10
+ "unpin from taskbar": "取消钉在任务栏"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "position": "位置",
3
+ "left": "左側",
4
+ "right": "右側",
5
+ "top": "頂部",
6
+ "bottom": "底部",
7
+ "close all windows": "關閉所有視窗",
8
+ "close window": "關閉視窗",
9
+ "pin to taskbar": "釘在任務列",
10
+ "unpin from taskbar": "取消釘在任務列"
11
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.zip = exports.tool = exports.theme = exports.task = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.getCdn = exports.setCdn = exports.getSafe = exports.setSafe = exports.getNative = exports.getVersion = void 0;
4
+ const version = '3.0.0';
5
+ function getVersion() {
6
+ return version;
7
+ }
8
+ exports.getVersion = getVersion;
9
+ const native = navigator.userAgent.toLowerCase().includes('electron') ? true : false;
10
+ function getNative() {
11
+ return native;
12
+ }
13
+ exports.getNative = getNative;
14
+ let safe = true;
15
+ function setSafe(val) {
16
+ safe = val;
17
+ }
18
+ exports.setSafe = setSafe;
19
+ function getSafe() {
20
+ return safe;
21
+ }
22
+ exports.getSafe = getSafe;
23
+ let cdn = '';
24
+ function setCdn(val) {
25
+ cdn = val;
26
+ }
27
+ exports.setCdn = setCdn;
28
+ function getCdn() {
29
+ return cdn;
30
+ }
31
+ exports.getCdn = getCdn;
32
+ exports.control = require("./lib/control");
33
+ exports.core = require("./lib/core");
34
+ exports.dom = require("./lib/dom");
35
+ exports.form = require("./lib/form");
36
+ exports.fs = require("./lib/fs");
37
+ exports.native = require("./lib/native");
38
+ exports.task = require("./lib/task");
39
+ exports.theme = require("./lib/theme");
40
+ exports.tool = require("./lib/tool");
41
+ exports.zip = require("./lib/zip");
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright 2022 Han Guoshuai <zohegs@gmail.com>
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ const version = '3.0.0';
17
+ export function getVersion(): string {
18
+ return version;
19
+ }
20
+
21
+ const native = navigator.userAgent.toLowerCase().includes('electron') ? true : false;
22
+ export function getNative(): boolean {
23
+ return native;
24
+ }
25
+
26
+ let safe = true;
27
+ export function setSafe(val: boolean): void {
28
+ safe = val;
29
+ }
30
+ export function getSafe(): boolean {
31
+ return safe;
32
+ }
33
+
34
+ let cdn = '';
35
+ export function setCdn(val: string): void {
36
+ cdn = val;
37
+ }
38
+ export function getCdn(): string {
39
+ return cdn;
40
+ }
41
+
42
+ export * as control from './lib/control';
43
+ export * as core from './lib/core';
44
+ export * as dom from './lib/dom';
45
+ export * as form from './lib/form';
46
+ export * as fs from './lib/fs';
47
+ export * as native from './lib/native';
48
+ export * as task from './lib/task';
49
+ export * as theme from './lib/theme';
50
+ export * as tool from './lib/tool';
51
+ export * as zip from './lib/zip';
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ #cg-wrap{--cg:hsl(20, 100%, 70%);--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-system{z-index:20020003}#cg-rectangle{z-index:20020004;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:20020004;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:20020004;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{box-sizing:border-box;position:fixed;border-radius:3px;z-index:20020004;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}[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-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:#f6f6f6;box-shadow:0 5px 20px rgba(0,0,0,.25);-webkit-backdrop-filter:blur(30px) brightness(1.1);backdrop-filter:blur(30px) brightness(1.1)}.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{bottom:-46px;width:100%;height:46px;top:initial;background:var(--system-background);-webkit-backdrop-filter:blur(30px) brightness(1.1);backdrop-filter:blur(30px) brightness(1.1);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/icon.png ADDED
Binary file
package/dist/index.js ADDED
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.init = exports.getCdn = exports.setCdn = exports.getSafe = exports.setSafe = exports.getNative = exports.getVersion = exports.zip = exports.tool = exports.theme = exports.task = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.clickgo = void 0;
13
+ function getVersion() {
14
+ return exports.clickgo.getVersion();
15
+ }
16
+ exports.getVersion = getVersion;
17
+ function getNative() {
18
+ return exports.clickgo.getNative();
19
+ }
20
+ exports.getNative = getNative;
21
+ function setSafe(val) {
22
+ exports.clickgo.setSafe(val);
23
+ }
24
+ exports.setSafe = setSafe;
25
+ function getSafe() {
26
+ return exports.clickgo.getSafe();
27
+ }
28
+ exports.getSafe = getSafe;
29
+ function setCdn(val) {
30
+ exports.clickgo.setCdn(val);
31
+ }
32
+ exports.setCdn = setCdn;
33
+ function getCdn() {
34
+ return exports.clickgo.getCdn();
35
+ }
36
+ exports.getCdn = getCdn;
37
+ function init(cdn = 'https://cdn.jsdelivr.net') {
38
+ var _a;
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const paths = [
41
+ cdn + '/npm/vue@3.2.31/dist/vue.global.min.js'
42
+ ];
43
+ let ro = true;
44
+ if (!(window.ResizeObserver)) {
45
+ ro = false;
46
+ paths.push(cdn + '/npm/@juggle/resize-observer@3.3.1/lib/exports/resize-observer.umd.min.js');
47
+ }
48
+ yield loader.loadScripts(paths);
49
+ if (!ro) {
50
+ window.ResizeObserverEntry = window.ResizeObserver.ResizeObserverEntry;
51
+ window.ResizeObserver = window.ResizeObserver.ResizeObserver;
52
+ }
53
+ const map = {
54
+ 'jszip': cdn + '/npm/jszip@3.10.0/dist/jszip.min'
55
+ };
56
+ const after = '?' + Math.random().toString();
57
+ const files = yield loader.sniffFiles('clickgo.js', {
58
+ 'dir': __dirname + '/',
59
+ 'after': after,
60
+ 'afterIgnore': new RegExp('^' + cdn.replace(/\./g, '\\.')),
61
+ 'map': map
62
+ });
63
+ const cg = loader.require('clickgo', files, {
64
+ 'dir': __dirname + '/',
65
+ 'map': map
66
+ })[0];
67
+ cg.setCdn(cdn);
68
+ try {
69
+ const style = yield (yield fetch(__dirname + '/global.css' + (!__dirname.startsWith(cdn) ? after : ''))).text();
70
+ (_a = document.getElementById('cg-global')) === null || _a === void 0 ? void 0 : _a.insertAdjacentHTML('afterbegin', style);
71
+ }
72
+ catch (_b) {
73
+ alert(`ClickGo: "${__dirname}/global.css'" failed.`);
74
+ }
75
+ exports.clickgo = cg;
76
+ exports.control = cg.control;
77
+ exports.core = cg.core;
78
+ exports.dom = cg.dom;
79
+ exports.form = cg.form;
80
+ exports.fs = cg.fs;
81
+ exports.native = cg.native;
82
+ exports.task = cg.task;
83
+ exports.theme = cg.theme;
84
+ exports.tool = cg.tool;
85
+ exports.zip = cg.zip;
86
+ });
87
+ }
88
+ exports.init = init;