clickgo 3.0.4-dev5 → 3.0.5-dev6

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 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.4-dev5'}"></script>
22
+ <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.3.0/dist/loader.min.js?path=index&npm={'clickgo':'3.0.5-dev6'}"></script>
23
23
  ```
24
24
 
25
25
  **index.js**
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-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}
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-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{left:0;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/lib/core.js CHANGED
@@ -555,6 +555,7 @@ function fetchApp(url, opt = {}) {
555
555
  fs.getContent(url + file.slice(1), {
556
556
  'current': current
557
557
  }).then(function (blob) {
558
+ var _a;
558
559
  return __awaiter(this, void 0, void 0, function* () {
559
560
  if (blob === null || typeof blob === 'string') {
560
561
  clickgo.form.notify({
@@ -572,6 +573,7 @@ function fetchApp(url, opt = {}) {
572
573
  files[file] = blob;
573
574
  }
574
575
  ++loaded;
576
+ (_a = opt.progress) === null || _a === void 0 ? void 0 : _a.call(opt, loaded, total);
575
577
  if (opt.notifyId) {
576
578
  form.notifyProgress(opt.notifyId, loaded / total);
577
579
  }
@@ -581,7 +583,9 @@ function fetchApp(url, opt = {}) {
581
583
  resolve();
582
584
  });
583
585
  }).catch(function () {
586
+ var _a;
584
587
  ++loaded;
588
+ (_a = opt.progress) === null || _a === void 0 ? void 0 : _a.call(opt, loaded, total);
585
589
  if (opt.notifyId) {
586
590
  form.notifyProgress(opt.notifyId, loaded / total);
587
591
  }
@@ -614,8 +618,8 @@ function getAvailArea() {
614
618
  return {
615
619
  'left': 0,
616
620
  'top': 0,
617
- 'width': document.body.clientWidth,
618
- 'height': document.body.clientHeight - 46
621
+ 'width': window.innerWidth,
622
+ 'height': window.innerHeight - 46
619
623
  };
620
624
  }
621
625
  else {
@@ -627,29 +631,29 @@ function getAvailArea() {
627
631
  case 'left': {
628
632
  left = task.systemTaskInfo.length;
629
633
  top = 0;
630
- width = document.body.clientWidth - task.systemTaskInfo.length;
631
- height = document.body.clientHeight;
634
+ width = window.innerWidth - task.systemTaskInfo.length;
635
+ height = window.innerHeight;
632
636
  break;
633
637
  }
634
638
  case 'right': {
635
639
  left = 0;
636
640
  top = 0;
637
- width = document.body.clientWidth - task.systemTaskInfo.length;
638
- height = document.body.clientHeight;
641
+ width = window.innerWidth - task.systemTaskInfo.length;
642
+ height = window.innerHeight;
639
643
  break;
640
644
  }
641
645
  case 'top': {
642
646
  left = 0;
643
647
  top = task.systemTaskInfo.length;
644
- width = document.body.clientWidth;
645
- height = document.body.clientHeight - task.systemTaskInfo.length;
648
+ width = window.innerWidth;
649
+ height = window.innerHeight - task.systemTaskInfo.length;
646
650
  break;
647
651
  }
648
652
  case 'bottom': {
649
653
  left = 0;
650
654
  top = 0;
651
- width = document.body.clientWidth;
652
- height = document.body.clientHeight - task.systemTaskInfo.length;
655
+ width = window.innerWidth;
656
+ height = window.innerHeight - task.systemTaskInfo.length;
653
657
  }
654
658
  }
655
659
  return {
package/dist/lib/core.ts CHANGED
@@ -637,6 +637,7 @@ export async function fetchApp(url: string, opt: types.ICoreFetchAppOptions = {}
637
637
  files[file] = blob;
638
638
  }
639
639
  ++loaded;
640
+ opt.progress?.(loaded, total) as unknown;
640
641
  if (opt.notifyId) {
641
642
  form.notifyProgress(opt.notifyId, loaded / total);
642
643
  }
@@ -646,6 +647,7 @@ export async function fetchApp(url: string, opt: types.ICoreFetchAppOptions = {}
646
647
  resolve();
647
648
  }).catch(function() {
648
649
  ++loaded;
650
+ opt.progress?.(loaded, total) as unknown;
649
651
  if (opt.notifyId) {
650
652
  form.notifyProgress(opt.notifyId, loaded / total);
651
653
  }
@@ -680,8 +682,8 @@ export function getAvailArea(): types.IAvailArea {
680
682
  return {
681
683
  'left': 0,
682
684
  'top': 0,
683
- 'width': document.body.clientWidth,
684
- 'height': document.body.clientHeight - 46
685
+ 'width': window.innerWidth,
686
+ 'height': window.innerHeight - 46
685
687
  };
686
688
  }
687
689
  else {
@@ -693,29 +695,29 @@ export function getAvailArea(): types.IAvailArea {
693
695
  case 'left': {
694
696
  left = task.systemTaskInfo.length;
695
697
  top = 0;
696
- width = document.body.clientWidth - task.systemTaskInfo.length;
697
- height = document.body.clientHeight;
698
+ width = window.innerWidth - task.systemTaskInfo.length;
699
+ height = window.innerHeight;
698
700
  break;
699
701
  }
700
702
  case 'right': {
701
703
  left = 0;
702
704
  top = 0;
703
- width = document.body.clientWidth - task.systemTaskInfo.length;
704
- height = document.body.clientHeight;
705
+ width = window.innerWidth - task.systemTaskInfo.length;
706
+ height = window.innerHeight;
705
707
  break;
706
708
  }
707
709
  case 'top': {
708
710
  left = 0;
709
711
  top = task.systemTaskInfo.length;
710
- width = document.body.clientWidth;
711
- height = document.body.clientHeight - task.systemTaskInfo.length;
712
+ width = window.innerWidth;
713
+ height = window.innerHeight - task.systemTaskInfo.length;
712
714
  break;
713
715
  }
714
716
  case 'bottom': {
715
717
  left = 0;
716
718
  top = 0;
717
- width = document.body.clientWidth;
718
- height = document.body.clientHeight - task.systemTaskInfo.length;
719
+ width = window.innerWidth;
720
+ height = window.innerHeight - task.systemTaskInfo.length;
719
721
  }
720
722
  }
721
723
  return {
package/dist/lib/form.js CHANGED
@@ -781,7 +781,7 @@ function showPop(el, pop, direction, opt = {}) {
781
781
  left = bcr.left + bcr.width - 2;
782
782
  top = bcr.top - 2;
783
783
  }
784
- if (width + left > document.body.clientWidth) {
784
+ if (width + left > window.innerWidth) {
785
785
  if (direction === 'v') {
786
786
  left = bcr.left + bcr.width - width;
787
787
  }
@@ -789,7 +789,7 @@ function showPop(el, pop, direction, opt = {}) {
789
789
  left = bcr.left - width + 2;
790
790
  }
791
791
  }
792
- if (height + top > document.body.clientHeight) {
792
+ if (height + top > window.innerHeight) {
793
793
  if (direction === 'v') {
794
794
  top = bcr.top - height;
795
795
  }
@@ -815,10 +815,10 @@ function showPop(el, pop, direction, opt = {}) {
815
815
  }
816
816
  left = x + 5;
817
817
  top = y + 7;
818
- if (width + left > document.body.clientWidth) {
818
+ if (width + left > window.innerWidth) {
819
819
  left = x - width - 5;
820
820
  }
821
- if (height + top > document.body.clientHeight) {
821
+ if (height + top > window.innerHeight) {
822
822
  top = y - height - 5;
823
823
  }
824
824
  }
package/dist/lib/form.ts CHANGED
@@ -1000,7 +1000,7 @@ export function showPop(el: HTMLElement, pop: HTMLElement | undefined, direction
1000
1000
  top = bcr.top - 2;
1001
1001
  }
1002
1002
  // --- 检查水平是否出框 ---
1003
- if (width + left > document.body.clientWidth) {
1003
+ if (width + left > window.innerWidth) {
1004
1004
  if (direction === 'v') {
1005
1005
  // --- 垂直弹出 ---
1006
1006
  left = bcr.left + bcr.width - width;
@@ -1011,7 +1011,7 @@ export function showPop(el: HTMLElement, pop: HTMLElement | undefined, direction
1011
1011
  }
1012
1012
  }
1013
1013
  // --- 检测垂直是否出框 ---
1014
- if (height + top > document.body.clientHeight) {
1014
+ if (height + top > window.innerHeight) {
1015
1015
  if (direction === 'v') {
1016
1016
  top = bcr.top - height;
1017
1017
  }
@@ -1038,11 +1038,11 @@ export function showPop(el: HTMLElement, pop: HTMLElement | undefined, direction
1038
1038
  left = x + 5;
1039
1039
  top = y + 7;
1040
1040
  // --- 水平 ---
1041
- if (width + left > document.body.clientWidth) {
1041
+ if (width + left > window.innerWidth) {
1042
1042
  left = x - width - 5;
1043
1043
  }
1044
1044
  // --- 垂直 ---
1045
- if (height + top > document.body.clientHeight) {
1045
+ if (height + top > window.innerHeight) {
1046
1046
  top = y - height - 5;
1047
1047
  }
1048
1048
  }
package/dist/lib/task.js CHANGED
@@ -170,7 +170,8 @@ function run(url, opt = {}) {
170
170
  }) : undefined;
171
171
  const app = yield core.fetchApp(url, {
172
172
  'notifyId': notifyId,
173
- 'current': ntask ? ntask.path : undefined
173
+ 'current': ntask ? ntask.path : undefined,
174
+ 'progress': opt.progress
174
175
  });
175
176
  if (notifyId) {
176
177
  setTimeout(function () {
@@ -276,13 +277,6 @@ function run(url, opt = {}) {
276
277
  core.trigger('taskEnded', task.id);
277
278
  return f - 100;
278
279
  }
279
- if (clickgo.getNative() && opt.sync) {
280
- f.vroot.$refs.form.isNativeSync = true;
281
- window.addEventListener('resize', function () {
282
- f.vroot.$refs.form.setPropData('width', window.innerWidth);
283
- f.vroot.$refs.form.setPropData('height', window.innerHeight);
284
- });
285
- }
286
280
  if (app.config.style && app.files[app.config.style + '.css']) {
287
281
  const style = app.files[app.config.style + '.css'];
288
282
  const r = tool.stylePrepend(style, 'cg-task' + task.id.toString() + '_');
@@ -313,6 +307,18 @@ function run(url, opt = {}) {
313
307
  if (task.id === 1) {
314
308
  clickgo.native.send('cg-init', clickgo.native.getToken());
315
309
  }
310
+ if (clickgo.getNative() && opt.sync) {
311
+ f.vroot.$refs.form.isNativeSync = true;
312
+ clickgo.native.send('cg-set-size', JSON.stringify({
313
+ 'token': clickgo.native.getToken(),
314
+ 'width': f.vroot.$refs.form.widthData,
315
+ 'height': f.vroot.$refs.form.heightData
316
+ }));
317
+ window.addEventListener('resize', function () {
318
+ f.vroot.$refs.form.setPropData('width', window.innerWidth);
319
+ f.vroot.$refs.form.setPropData('height', window.innerHeight);
320
+ });
321
+ }
316
322
  return task.id;
317
323
  });
318
324
  }
@@ -656,12 +662,12 @@ function refreshSystemPosition() {
656
662
  case 'left':
657
663
  case 'right': {
658
664
  form.vroot.$refs.form.setPropData('width', 'auto');
659
- form.vroot.$refs.form.setPropData('height', document.body.clientHeight);
665
+ form.vroot.$refs.form.setPropData('height', window.innerHeight);
660
666
  break;
661
667
  }
662
668
  case 'top':
663
669
  case 'bottom': {
664
- form.vroot.$refs.form.setPropData('width', document.body.clientWidth);
670
+ form.vroot.$refs.form.setPropData('width', window.innerWidth);
665
671
  form.vroot.$refs.form.setPropData('height', 'auto');
666
672
  break;
667
673
  }
@@ -676,7 +682,7 @@ function refreshSystemPosition() {
676
682
  }
677
683
  case 'right': {
678
684
  exports.systemTaskInfo.length = form.vroot.$el.offsetWidth;
679
- form.vroot.$refs.form.setPropData('left', document.body.clientWidth - exports.systemTaskInfo.length);
685
+ form.vroot.$refs.form.setPropData('left', window.innerWidth - exports.systemTaskInfo.length);
680
686
  form.vroot.$refs.form.setPropData('top', 0);
681
687
  break;
682
688
  }
@@ -689,7 +695,7 @@ function refreshSystemPosition() {
689
695
  case 'bottom': {
690
696
  exports.systemTaskInfo.length = form.vroot.$el.offsetHeight;
691
697
  form.vroot.$refs.form.setPropData('left', 0);
692
- form.vroot.$refs.form.setPropData('top', document.body.clientHeight - exports.systemTaskInfo.length);
698
+ form.vroot.$refs.form.setPropData('top', window.innerHeight - exports.systemTaskInfo.length);
693
699
  break;
694
700
  }
695
701
  }
package/dist/lib/task.ts CHANGED
@@ -222,7 +222,8 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}): Promise
222
222
  }) : undefined;
223
223
  const app: types.IApp | null = await core.fetchApp(url, {
224
224
  'notifyId': notifyId,
225
- 'current': ntask ? ntask.path : undefined
225
+ 'current': ntask ? ntask.path : undefined,
226
+ 'progress': opt.progress
226
227
  });
227
228
  if (notifyId) {
228
229
  setTimeout(function(): void {
@@ -339,13 +340,6 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}): Promise
339
340
  core.trigger('taskEnded', task.id);
340
341
  return f - 100;
341
342
  }
342
- if (clickgo.getNative() && opt.sync) {
343
- f.vroot.$refs.form.isNativeSync = true;
344
- window.addEventListener('resize', function(): void {
345
- f.vroot.$refs.form.setPropData('width', window.innerWidth);
346
- f.vroot.$refs.form.setPropData('height', window.innerHeight);
347
- });
348
- }
349
343
  // --- 设置 global style(如果 form 创建失败,就不设置 global style 了) ---
350
344
  if (app.config.style && app.files[app.config.style + '.css']) {
351
345
  const style = app.files[app.config.style + '.css'] as string;
@@ -380,6 +374,19 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}): Promise
380
374
  if (task.id === 1) {
381
375
  clickgo.native.send('cg-init', clickgo.native.getToken());
382
376
  }
377
+ // --- 提交 sync ---
378
+ if (clickgo.getNative() && opt.sync) {
379
+ f.vroot.$refs.form.isNativeSync = true;
380
+ clickgo.native.send('cg-set-size', JSON.stringify({
381
+ 'token': clickgo.native.getToken(),
382
+ 'width': f.vroot.$refs.form.widthData,
383
+ 'height': f.vroot.$refs.form.heightData
384
+ }));
385
+ window.addEventListener('resize', function(): void {
386
+ f.vroot.$refs.form.setPropData('width', window.innerWidth);
387
+ f.vroot.$refs.form.setPropData('height', window.innerHeight);
388
+ });
389
+ }
383
390
  return task.id;
384
391
  }
385
392
 
@@ -815,12 +822,12 @@ export function refreshSystemPosition(): void {
815
822
  case 'left':
816
823
  case 'right': {
817
824
  form.vroot.$refs.form.setPropData('width', 'auto');
818
- form.vroot.$refs.form.setPropData('height', document.body.clientHeight);
825
+ form.vroot.$refs.form.setPropData('height', window.innerHeight);
819
826
  break;
820
827
  }
821
828
  case 'top':
822
829
  case 'bottom': {
823
- form.vroot.$refs.form.setPropData('width', document.body.clientWidth);
830
+ form.vroot.$refs.form.setPropData('width', window.innerWidth);
824
831
  form.vroot.$refs.form.setPropData('height', 'auto');
825
832
  break;
826
833
  }
@@ -835,7 +842,7 @@ export function refreshSystemPosition(): void {
835
842
  }
836
843
  case 'right': {
837
844
  systemTaskInfo.length = form.vroot.$el.offsetWidth;
838
- form.vroot.$refs.form.setPropData('left', document.body.clientWidth - systemTaskInfo.length);
845
+ form.vroot.$refs.form.setPropData('left', window.innerWidth - systemTaskInfo.length);
839
846
  form.vroot.$refs.form.setPropData('top', 0);
840
847
  break;
841
848
  }
@@ -848,7 +855,7 @@ export function refreshSystemPosition(): void {
848
855
  case 'bottom': {
849
856
  systemTaskInfo.length = form.vroot.$el.offsetHeight;
850
857
  form.vroot.$refs.form.setPropData('left', 0);
851
- form.vroot.$refs.form.setPropData('top', document.body.clientHeight - systemTaskInfo.length);
858
+ form.vroot.$refs.form.setPropData('top', window.innerHeight - systemTaskInfo.length);
852
859
  break;
853
860
  }
854
861
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo",
3
- "version": "3.0.4-dev5",
3
+ "version": "3.0.5-dev6",
4
4
  "description": "Background interface, software interface, mobile phone APP interface operation library.",
5
5
  "keywords": [
6
6
  "deskrt",