clickgo 3.1.5-dev14 → 3.1.6-dev15

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 (92) hide show
  1. package/README.md +7 -7
  2. package/dist/app/demo/app.js +28 -2
  3. package/dist/app/demo/config.json +17 -1
  4. package/dist/app/demo/form/control/box/box.js +66 -0
  5. package/dist/app/demo/form/control/box/box.xml +18 -0
  6. package/dist/app/demo/form/control/button/button.js +24 -1
  7. package/dist/app/demo/form/control/check/check.js +24 -1
  8. package/dist/app/demo/form/control/dialog/dialog.js +24 -1
  9. package/dist/app/demo/form/control/file/file.js +24 -1
  10. package/dist/app/demo/form/control/flow/flow.js +24 -1
  11. package/dist/app/demo/form/control/form/form.js +24 -1
  12. package/dist/app/demo/form/control/layout/layout.js +57 -0
  13. package/dist/app/demo/form/control/layout/layout.xml +16 -0
  14. package/dist/app/demo/form/control/list/list.js +24 -1
  15. package/dist/app/demo/form/control/list/list.xml +8 -2
  16. package/dist/app/demo/form/control/marquee/marquee.js +24 -2
  17. package/dist/app/demo/form/control/marquee/marquee.xml +2 -5
  18. package/dist/app/demo/form/control/menu/menu.js +24 -1
  19. package/dist/app/demo/form/control/monaco/monaco.js +24 -1
  20. package/dist/app/demo/form/control/nav/nav.js +52 -0
  21. package/dist/app/demo/form/control/nav/nav.xml +43 -0
  22. package/dist/app/demo/form/control/panel/panel.js +67 -0
  23. package/dist/app/demo/form/control/panel/panel.xml +11 -0
  24. package/dist/app/demo/form/control/panel/test1.js +58 -0
  25. package/dist/app/demo/form/control/panel/test1.xml +16 -0
  26. package/dist/app/demo/form/control/panel/test2.xml +3 -0
  27. package/dist/app/demo/form/control/property/property.js +24 -1
  28. package/dist/app/demo/form/control/radio/radio.js +24 -1
  29. package/dist/app/demo/form/control/scroll/scroll.js +25 -1
  30. package/dist/app/demo/form/control/scroll/scroll.xml +5 -2
  31. package/dist/app/demo/form/control/select/select.js +24 -1
  32. package/dist/app/demo/form/control/tab/tab.js +24 -1
  33. package/dist/app/demo/form/control/table/table.js +164 -0
  34. package/dist/app/demo/form/control/table/table.xml +35 -0
  35. package/dist/app/demo/form/control/text/text.js +24 -1
  36. package/dist/app/demo/form/control/vflow/vflow.js +24 -1
  37. package/dist/app/demo/form/event/form/form.js +24 -1
  38. package/dist/app/demo/form/event/other/other.js +24 -1
  39. package/dist/app/demo/form/event/screen/screen.js +24 -1
  40. package/dist/app/demo/form/event/task/task.js +24 -1
  41. package/dist/app/demo/form/main.js +84 -33
  42. package/dist/app/demo/form/main.xml +5 -0
  43. package/dist/app/demo/form/method/aform/aform.js +28 -2
  44. package/dist/app/demo/form/method/aform/sd.js +24 -1
  45. package/dist/app/demo/form/method/core/core.js +24 -1
  46. package/dist/app/demo/form/method/dom/dom.js +48 -2
  47. package/dist/app/demo/form/method/dom/dom.xml +11 -0
  48. package/dist/app/demo/form/method/form/form.js +35 -1
  49. package/dist/app/demo/form/method/form/form.xml +2 -0
  50. package/dist/app/demo/form/method/fs/fs.js +138 -4
  51. package/dist/app/demo/form/method/fs/fs.xml +11 -1
  52. package/dist/app/demo/form/method/fs/text.js +24 -1
  53. package/dist/app/demo/form/method/native/native.js +24 -1
  54. package/dist/app/demo/form/method/system/system.js +24 -1
  55. package/dist/app/demo/form/method/task/task.js +31 -4
  56. package/dist/app/demo/form/method/task/task.xml +6 -1
  57. package/dist/app/demo/form/method/theme/theme.js +24 -1
  58. package/dist/app/demo/form/method/tool/tool.js +35 -1
  59. package/dist/app/demo/form/method/zip/zip.js +29 -3
  60. package/dist/app/task/app.js +28 -2
  61. package/dist/app/task/form/bar/bar.js +24 -1
  62. package/dist/clickgo.js +33 -10
  63. package/dist/control/box.cgc +0 -0
  64. package/dist/control/common.cgc +0 -0
  65. package/dist/control/form.cgc +0 -0
  66. package/dist/control/monaco.cgc +0 -0
  67. package/dist/control/nav.cgc +0 -0
  68. package/dist/control/property.cgc +0 -0
  69. package/dist/control/table.cgc +0 -0
  70. package/dist/control/task.cgc +0 -0
  71. package/dist/global.css +1 -1
  72. package/dist/lib/control.js +53 -12
  73. package/dist/lib/control.ts +25 -5
  74. package/dist/lib/core.js +44 -45
  75. package/dist/lib/core.ts +17 -41
  76. package/dist/lib/dom.js +322 -108
  77. package/dist/lib/dom.ts +394 -127
  78. package/dist/lib/form.js +441 -58
  79. package/dist/lib/form.ts +525 -74
  80. package/dist/lib/fs.js +485 -224
  81. package/dist/lib/fs.ts +493 -287
  82. package/dist/lib/native.js +24 -1
  83. package/dist/lib/task.js +143 -136
  84. package/dist/lib/task.ts +124 -127
  85. package/dist/lib/theme.js +27 -4
  86. package/dist/lib/tool.js +19 -2
  87. package/dist/lib/tool.ts +23 -1
  88. package/dist/lib/zip.js +29 -3
  89. package/dist/lib/zip.ts +1 -1
  90. package/dist/theme/familiar.cgt +0 -0
  91. package/package.json +4 -6
  92. package/types/index.d.ts +42 -34
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -10,7 +33,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
33
  };
11
34
  Object.defineProperty(exports, "__esModule", { value: true });
12
35
  exports.isMax = exports.ping = exports.maximizable = exports.size = exports.restore = exports.min = exports.max = exports.invoke = exports.getListenerList = exports.clear = exports.off = exports.once = exports.on = exports.getToken = void 0;
13
- const clickgo = require("../clickgo");
36
+ const clickgo = __importStar(require("../clickgo"));
14
37
  const token = (Math.random() * 100000000000000 * (100 + Math.round(Math.random() * (999 - 100)))).toString(32);
15
38
  function getToken() {
16
39
  return token;
package/dist/lib/task.js CHANGED
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,16 +32,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
32
  });
10
33
  };
11
34
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.refreshSystemPosition = exports.clearSystem = exports.setSystem = exports.systemTaskInfo = exports.sleep = exports.removeTimer = exports.createTimer = exports.clearLocaleLang = exports.setLocaleLang = exports.setLocale = exports.clearLocale = exports.loadLocale = exports.loadLocaleData = exports.end = exports.checkPermission = exports.run = exports.getList = exports.get = exports.offFrame = exports.onFrame = exports.getFocus = exports.setFocus = exports.lastId = exports.list = void 0;
13
- const clickgo = require("../clickgo");
14
- const core = require("./core");
15
- const dom = require("./dom");
16
- const tool = require("./tool");
17
- const form = require("./form");
18
- const control = require("./control");
19
- const fs = require("./fs");
20
- const theme = require("./theme");
21
- const native = require("./native");
35
+ exports.refreshSystemPosition = exports.clearSystem = exports.setSystem = exports.systemTaskInfo = exports.sleep = exports.removeTimer = exports.createTimer = exports.clearLocaleLang = exports.setLocaleLang = exports.setLocale = exports.clearLocale = exports.loadLocale = exports.loadLocaleData = exports.end = exports.checkPermission = exports.run = exports.getList = exports.getPermissions = exports.get = exports.offFrame = exports.onFrame = exports.getFocus = exports.setFocus = exports.lastId = exports.list = void 0;
36
+ const clickgo = __importStar(require("../clickgo"));
37
+ const core = __importStar(require("./core"));
38
+ const dom = __importStar(require("./dom"));
39
+ const tool = __importStar(require("./tool"));
40
+ const form = __importStar(require("./form"));
41
+ const control = __importStar(require("./control"));
42
+ const fs = __importStar(require("./fs"));
43
+ const theme = __importStar(require("./theme"));
44
+ const native = __importStar(require("./native"));
22
45
  exports.list = {};
23
46
  exports.lastId = 0;
24
47
  let focusId = null;
@@ -84,7 +107,7 @@ function onFrame(fun, opt = {}) {
84
107
  else {
85
108
  timer = requestAnimationFrame(function () {
86
109
  timerHandler().catch(function (e) {
87
- console.log(e);
110
+ console.log('task.onFrame: -3', e);
88
111
  });
89
112
  });
90
113
  frameMaps[ft] = timer;
@@ -97,7 +120,7 @@ function onFrame(fun, opt = {}) {
97
120
  else {
98
121
  timer = requestAnimationFrame(function () {
99
122
  timerHandler().catch(function (e) {
100
- console.log(e);
123
+ console.log('task.onFrame: -2', e);
101
124
  });
102
125
  });
103
126
  frameMaps[ft] = timer;
@@ -105,7 +128,7 @@ function onFrame(fun, opt = {}) {
105
128
  });
106
129
  timer = requestAnimationFrame(function () {
107
130
  timerHandler().catch(function (e) {
108
- console.log(e);
131
+ console.log('task.onFrame: -1', e);
109
132
  });
110
133
  });
111
134
  frameMaps[ft] = timer;
@@ -145,6 +168,13 @@ function get(tid) {
145
168
  };
146
169
  }
147
170
  exports.get = get;
171
+ function getPermissions(tid) {
172
+ if (exports.list[tid] === undefined) {
173
+ return [];
174
+ }
175
+ return tool.clone(exports.list[tid].runtime.permissions);
176
+ }
177
+ exports.getPermissions = getPermissions;
148
178
  function getList() {
149
179
  const rtn = {};
150
180
  for (const tid in exports.list) {
@@ -162,13 +192,9 @@ function getList() {
162
192
  return rtn;
163
193
  }
164
194
  exports.getList = getList;
165
- function run(url, opt = {}) {
195
+ function run(url, opt = {}, ntid) {
166
196
  var _a, _b, _c, _d;
167
197
  return __awaiter(this, void 0, void 0, function* () {
168
- let ntask = null;
169
- if (opt.taskId) {
170
- ntask = exports.list[opt.taskId];
171
- }
172
198
  if (!url.endsWith('/') && !url.endsWith('.cga')) {
173
199
  return 0;
174
200
  }
@@ -186,11 +212,18 @@ function run(url, opt = {}) {
186
212
  'timeout': 0,
187
213
  'progress': true
188
214
  }) : undefined;
215
+ if (!ntid &&
216
+ !url.startsWith('/clickgo/') &&
217
+ !url.startsWith('/storage/') &&
218
+ !url.startsWith('/mounted/') &&
219
+ !url.startsWith('/package/') &&
220
+ !url.startsWith('/current/')) {
221
+ url = tool.urlResolve(location.href, url);
222
+ }
189
223
  const app = yield core.fetchApp(url, {
190
224
  'notifyId': notifyId,
191
- 'current': ntask ? ntask.current : undefined,
192
225
  'progress': opt.progress
193
- });
226
+ }, ntid);
194
227
  if (notifyId) {
195
228
  setTimeout(function () {
196
229
  form.hideNotify(notifyId);
@@ -203,7 +236,7 @@ function run(url, opt = {}) {
203
236
  const unblock = opt.unblock ? tool.clone(opt.unblock) : [];
204
237
  const unblockSys = [
205
238
  'require',
206
- '__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number'
239
+ '__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'Object'
207
240
  ];
208
241
  for (const name of unblockSys) {
209
242
  if (unblock.includes(name)) {
@@ -382,6 +415,9 @@ function run(url, opt = {}) {
382
415
  }
383
416
  },
384
417
  'dom': {
418
+ inPage: function (el) {
419
+ return dom.inPage(el);
420
+ },
385
421
  setGlobalCursor: function (type) {
386
422
  dom.setGlobalCursor(type);
387
423
  },
@@ -391,15 +427,21 @@ function run(url, opt = {}) {
391
427
  getStyleCount: function (taskId, type) {
392
428
  return dom.getStyleCount(taskId, type);
393
429
  },
430
+ getWatchSizeCount: function (taskId) {
431
+ return dom.getWatchSizeCount(taskId);
432
+ },
394
433
  watchSize: function (el, cb, immediate = false) {
395
434
  return dom.watchSize(el, cb, immediate, taskId);
396
435
  },
397
436
  unwatchSize: function (el) {
398
437
  dom.unwatchSize(el, taskId);
399
438
  },
400
- isWatchSize(el) {
439
+ isWatchSize: function (el) {
401
440
  return dom.isWatchSize(el);
402
441
  },
442
+ getWatchCount: function (taskId) {
443
+ return dom.getWatchCount(taskId);
444
+ },
403
445
  watch: function (el, cb, mode = 'default', immediate = false) {
404
446
  dom.watch(el, cb, mode, immediate, taskId);
405
447
  },
@@ -415,13 +457,16 @@ function run(url, opt = {}) {
415
457
  isWatchStyle: function (el) {
416
458
  return dom.isWatchStyle(el);
417
459
  },
418
- watchProperty(el, name, cb, immediate = false) {
460
+ watchProperty: function (el, name, cb, immediate = false) {
419
461
  dom.watchProperty(el, name, cb, immediate);
420
462
  },
421
463
  isWatchProperty(el) {
422
464
  return dom.isWatchProperty(el);
423
465
  },
424
- bindClick(e, handler) {
466
+ getWatchInfo: function () {
467
+ return dom.getWatchInfo();
468
+ },
469
+ bindClick: function (e, handler) {
425
470
  dom.bindClick(e, handler);
426
471
  },
427
472
  bindDown: function (oe, opt) {
@@ -443,8 +488,8 @@ function run(url, opt = {}) {
443
488
  bindResize: function (e, opt) {
444
489
  dom.bindResize(e, opt);
445
490
  },
446
- findParentByData: function (el, name) {
447
- return dom.findParentByData(el, name);
491
+ findParentByData: function (el, name, value) {
492
+ return dom.findParentByData(el, name, value);
448
493
  },
449
494
  findParentByClass: function (el, name) {
450
495
  return dom.findParentByClass(el, name);
@@ -460,6 +505,11 @@ function run(url, opt = {}) {
460
505
  }
461
506
  },
462
507
  'form': {
508
+ 'AbstractPanel': class extends form.AbstractPanel {
509
+ get taskId() {
510
+ return taskId;
511
+ }
512
+ },
463
513
  'AbstractForm': class extends form.AbstractForm {
464
514
  get taskId() {
465
515
  return taskId;
@@ -492,6 +542,15 @@ function run(url, opt = {}) {
492
542
  getFocus: function () {
493
543
  return form.getFocus();
494
544
  },
545
+ getActivePanel: function (formId) {
546
+ return form.getActivePanel(formId);
547
+ },
548
+ removeActivePanel: function (panelId, formId) {
549
+ return form.removeActivePanel(panelId, formId, taskId);
550
+ },
551
+ setActivePanel: function (panelId, formId) {
552
+ return form.setActivePanel(panelId, formId, taskId);
553
+ },
495
554
  changeFocus: function (fid = 0) {
496
555
  form.changeFocus(fid);
497
556
  },
@@ -537,6 +596,12 @@ function run(url, opt = {}) {
537
596
  hidePop: function (pop) {
538
597
  form.hidePop(pop);
539
598
  },
599
+ removePanel(id, vapp, el) {
600
+ return form.removePanel(id, vapp, el);
601
+ },
602
+ createPanel(cls, el, formId) {
603
+ return form.createPanel(cls, el, formId, taskId);
604
+ },
540
605
  create: function (cls, data, opt) {
541
606
  return form.create(cls, data, opt, taskId);
542
607
  },
@@ -569,116 +634,59 @@ function run(url, opt = {}) {
569
634
  }
570
635
  },
571
636
  'fs': {
637
+ mount: function (name, handler) {
638
+ return clickgo.fs.mount(name, handler, taskId);
639
+ },
640
+ unmount: function (name) {
641
+ return clickgo.fs.unmount(name);
642
+ },
572
643
  getContent: function (path, options = {}) {
573
- if (!options.files) {
574
- options.files = exports.list[taskId].app.files;
575
- }
576
- if (!options.current) {
577
- options.current = exports.list[taskId].current;
578
- }
579
- return fs.getContent(path, options);
644
+ return fs.getContent(path, options, taskId);
580
645
  },
581
646
  putContent: function (path, data, options = {}) {
582
- if (!options.current) {
583
- options.current = exports.list[taskId].current;
584
- }
585
- return fs.putContent(path, data, options);
647
+ return fs.putContent(path, data, options, taskId);
586
648
  },
587
649
  readLink: function (path, options = {}) {
588
- if (!options.current) {
589
- options.current = exports.list[taskId].current;
590
- }
591
- return fs.readLink(path, options);
650
+ return fs.readLink(path, options, taskId);
592
651
  },
593
652
  symlink: function (fPath, linkPath, options = {}) {
594
- if (!options.current) {
595
- options.current = exports.list[taskId].current;
596
- }
597
- return fs.symlink(fPath, linkPath, options);
653
+ return fs.symlink(fPath, linkPath, options, taskId);
598
654
  },
599
- unlink: function (path, options = {}) {
600
- if (!options.current) {
601
- options.current = exports.list[taskId].current;
602
- }
603
- return fs.unlink(path, options);
655
+ unlink: function (path) {
656
+ return fs.unlink(path, taskId);
604
657
  },
605
- stats: function (path, options = {}) {
606
- if (!options.files) {
607
- options.files = exports.list[taskId].app.files;
608
- }
609
- if (!options.current) {
610
- options.current = exports.list[taskId].current;
611
- }
612
- return fs.stats(path, options);
658
+ stats: function (path) {
659
+ return fs.stats(path, taskId);
613
660
  },
614
- isDir: function (path, options = {}) {
615
- if (!options.files) {
616
- options.files = exports.list[taskId].app.files;
617
- }
618
- if (!options.current) {
619
- options.current = exports.list[taskId].current;
620
- }
621
- return fs.isDir(path, options);
661
+ isDir: function (path) {
662
+ return fs.isDir(path, taskId);
622
663
  },
623
- isFile: function (path, options = {}) {
624
- if (!options.files) {
625
- options.files = exports.list[taskId].app.files;
626
- }
627
- if (!options.current) {
628
- options.current = exports.list[taskId].current;
629
- }
630
- return fs.isFile(path, options);
664
+ isFile: function (path) {
665
+ return fs.isFile(path, taskId);
631
666
  },
632
- mkdir: function (path, mode, options = {}) {
633
- if (!options.current) {
634
- options.current = exports.list[taskId].current;
635
- }
636
- return fs.mkdir(path, mode, options);
667
+ mkdir: function (path, mode) {
668
+ return fs.mkdir(path, mode, taskId);
637
669
  },
638
- rmdir: function (path, options = {}) {
639
- if (!options.current) {
640
- options.current = exports.list[taskId].current;
641
- }
642
- return fs.rmdir(path, options);
670
+ rmdir: function (path) {
671
+ return fs.rmdir(path, taskId);
643
672
  },
644
- rmdirDeep: function (path, options = {}) {
645
- if (!options.current) {
646
- options.current = exports.list[taskId].current;
647
- }
648
- return fs.rmdirDeep(path, options);
673
+ rmdirDeep: function (path) {
674
+ return fs.rmdirDeep(path, taskId);
649
675
  },
650
- chmod: function (path, mod, options = {}) {
651
- if (!options.current) {
652
- options.current = exports.list[taskId].current;
653
- }
654
- return fs.chmod(path, mod, options);
676
+ chmod: function (path, mod) {
677
+ return fs.chmod(path, mod, taskId);
655
678
  },
656
- rename(oldPath, newPath, options = {}) {
657
- if (!options.current) {
658
- options.current = exports.list[taskId].current;
659
- }
660
- return fs.rename(oldPath, newPath, options);
679
+ rename(oldPath, newPath) {
680
+ return fs.rename(oldPath, newPath, taskId);
661
681
  },
662
- readDir(path, options = {}) {
663
- if (!options.files) {
664
- options.files = exports.list[taskId].app.files;
665
- }
666
- if (!options.current) {
667
- options.current = exports.list[taskId].current;
668
- }
669
- return fs.readDir(path, options);
682
+ readDir(path, encoding) {
683
+ return fs.readDir(path, encoding, taskId);
670
684
  },
671
685
  copyFolder(from, to, options = {}) {
672
- if (!options.current) {
673
- options.current = exports.list[taskId].current;
674
- }
675
- return fs.copyFolder(from, to, options);
686
+ return fs.copyFolder(from, to, options, taskId);
676
687
  },
677
- copyFile(src, dest, options = {}) {
678
- if (!options.current) {
679
- options.current = exports.list[taskId].current;
680
- }
681
- return fs.copyFile(src, dest, options);
688
+ copyFile(src, dest) {
689
+ return fs.copyFile(src, dest, taskId);
682
690
  }
683
691
  },
684
692
  'native': {
@@ -767,11 +775,14 @@ function run(url, opt = {}) {
767
775
  get: function (tid) {
768
776
  return get(tid);
769
777
  },
778
+ getPermissions: function (tid) {
779
+ return getPermissions(tid);
780
+ },
770
781
  getList: function () {
771
782
  return getList();
772
783
  },
773
784
  run: function (url, opt = {}) {
774
- opt.taskId = taskId;
785
+ var _a;
775
786
  if (opt.unblock) {
776
787
  const inUnblock = [];
777
788
  for (const item of opt.unblock) {
@@ -783,11 +794,11 @@ function run(url, opt = {}) {
783
794
  opt.unblock = inUnblock;
784
795
  }
785
796
  if (opt.permissions) {
786
- if (ntask && !ntask.runtime.permissions.includes('root')) {
797
+ if (!((_a = exports.list[taskId]) === null || _a === void 0 ? void 0 : _a.runtime.permissions.includes('root'))) {
787
798
  opt.permissions = undefined;
788
799
  }
789
800
  }
790
- return run(url, opt);
801
+ return run(url, opt, taskId);
791
802
  },
792
803
  checkPermission: function (vals, apply = false, applyHandler) {
793
804
  return checkPermission(vals, apply, applyHandler, taskId);
@@ -943,7 +954,7 @@ function run(url, opt = {}) {
943
954
  });
944
955
  return '';
945
956
  }
946
- code = code.replace(/extends[\s\S]+?\.\s*(AbstractApp|AbstractForm)\s*{/, (t) => {
957
+ code = code.replace(/extends[\s\S]+?\.\s*(AbstractApp|AbstractForm|AbstractPanel)\s*{/, (t) => {
947
958
  return t + 'get filename() {return __filename;}';
948
959
  });
949
960
  return code;
@@ -978,10 +989,8 @@ function run(url, opt = {}) {
978
989
  path += '.json';
979
990
  }
980
991
  const lcontent = yield fs.getContent(path, {
981
- 'encoding': 'utf8',
982
- 'files': app.files,
983
- 'current': current
984
- });
992
+ 'encoding': 'utf8'
993
+ }, taskId);
985
994
  if (!lcontent) {
986
995
  continue;
987
996
  }
@@ -1028,10 +1037,7 @@ function run(url, opt = {}) {
1028
1037
  for (let path of app.config.themes) {
1029
1038
  path += '.cgt';
1030
1039
  path = tool.urlResolve('/', path);
1031
- const file = yield fs.getContent(path, {
1032
- 'files': app.files,
1033
- 'current': current
1034
- });
1040
+ const file = yield fs.getContent(path, undefined, taskId);
1035
1041
  if (file && typeof file !== 'string') {
1036
1042
  const th = yield theme.read(file);
1037
1043
  if (th) {
@@ -1047,10 +1053,8 @@ function run(url, opt = {}) {
1047
1053
  }
1048
1054
  if (app.config.style) {
1049
1055
  const style = yield fs.getContent(app.config.style + '.css', {
1050
- 'encoding': 'utf8',
1051
- 'files': app.files,
1052
- 'current': current
1053
- });
1056
+ 'encoding': 'utf8'
1057
+ }, taskId);
1054
1058
  if (style) {
1055
1059
  const r = tool.stylePrepend(style, 'cg-task' + taskId.toString() + '_');
1056
1060
  dom.pushStyle(taskId, yield tool.styleUrl2DataUrl(app.config.style, r.style, app.files));
@@ -1070,6 +1074,7 @@ exports.run = run;
1070
1074
  const locale = {
1071
1075
  'sc': {
1072
1076
  'unknown': '未知权限',
1077
+ 'root': '<b>危险!</b>最高权限!请一定确认是否允许!',
1073
1078
  'apply-permission': '正在申请权限,请您仔细确认',
1074
1079
  'native.form': '实体窗体控制',
1075
1080
  'hash': '可修改地址栏 hash',
@@ -1079,6 +1084,7 @@ const locale = {
1079
1084
  },
1080
1085
  'tc': {
1081
1086
  'unknown': '未知許可權',
1087
+ 'root': '<b>危險!</b>最高許可權!請一定確認是否允許!',
1082
1088
  'apply-permission': '正在申請許可權,請您仔細確認',
1083
1089
  'native.form': '實體視窗控制',
1084
1090
  'hash': '可修改位址列 hash',
@@ -1088,6 +1094,7 @@ const locale = {
1088
1094
  },
1089
1095
  'en': {
1090
1096
  'unknown': 'Unknown',
1097
+ 'root': '<b>Danger!</b> Highest authorization! Please confirm whether to authorize?',
1091
1098
  'apply-permission': 'is applying for permissions, please check carefully',
1092
1099
  'native.form': 'Native window control',
1093
1100
  'hash': 'Can modify the location hash',
@@ -1097,6 +1104,7 @@ const locale = {
1097
1104
  },
1098
1105
  'ja': {
1099
1106
  'unknown': '不明な許可',
1107
+ 'root': '<b>危険!</b>最高の許可!承認するかどうかを確認してください!',
1100
1108
  'apply-permission': '許可申請中、よくご確認ください',
1101
1109
  'native.form': 'ローカルウィンドウを操作する',
1102
1110
  'hash': '網址の hash 変更可能',
@@ -1237,6 +1245,7 @@ function end(taskId) {
1237
1245
  (_a = form.elements.popList.querySelector('[data-form-id="' + f.id.toString() + '"]')) === null || _a === void 0 ? void 0 : _a.remove();
1238
1246
  dom.clearWatchStyle(fid);
1239
1247
  dom.clearWatchProperty(fid);
1248
+ delete form.activePanels[fid];
1240
1249
  }
1241
1250
  const flist = form.elements.list.querySelectorAll('.cg-form-wrap[data-task-id="' + taskId.toString() + '"]');
1242
1251
  for (const f of flist) {
@@ -1291,10 +1300,8 @@ function loadLocale(lang, path, taskId) {
1291
1300
  }
1292
1301
  path = tool.urlResolve(task.current + '/', path) + '.json';
1293
1302
  const fcontent = yield fs.getContent(path, {
1294
- 'encoding': 'utf8',
1295
- 'files': task.app.files,
1296
- 'current': task.current
1297
- });
1303
+ 'encoding': 'utf8'
1304
+ }, taskId);
1298
1305
  if (!fcontent) {
1299
1306
  return false;
1300
1307
  }