ts-glitter 21.7.2 → 21.7.4

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 (68) hide show
  1. package/lowcode/Entry.js +2 -2
  2. package/lowcode/Entry.ts +2 -2
  3. package/lowcode/api/pageConfig.js +15 -1
  4. package/lowcode/api/pageConfig.ts +15 -13
  5. package/lowcode/cms-plugin/line-auto-reply.js +1 -0
  6. package/lowcode/cms-plugin/line-auto-reply.ts +1 -0
  7. package/lowcode/cms-plugin/menus-setting.js +4 -4
  8. package/lowcode/cms-plugin/menus-setting.ts +4 -4
  9. package/lowcode/cms-plugin/shopping-market-shopee.js +2 -20
  10. package/lowcode/cms-plugin/shopping-market-shopee.ts +3 -19
  11. package/lowcode/cms-plugin/shopping-order-manager.ts +1 -0
  12. package/lowcode/editor-components/global-widget/bridge.js +95 -3
  13. package/lowcode/editor-components/global-widget/bridge.ts +124 -115
  14. package/lowcode/glitter-base/route/shopee.js +0 -2
  15. package/lowcode/glitter-base/route/shopee.ts +0 -2
  16. package/lowcode/glitterBundle/html-component/global-widget.js +37 -11
  17. package/lowcode/glitterBundle/html-component/global-widget.ts +75 -14
  18. package/lowcode/jspage/main.js +152 -68
  19. package/lowcode/jspage/main.ts +155 -80
  20. package/lowcode/modules/image-library.js +70 -86
  21. package/lowcode/modules/image-library.ts +98 -119
  22. package/lowcode/official_view_component/official/component.js +17 -15
  23. package/lowcode/official_view_component/official/component.ts +20 -15
  24. package/lowcode/official_view_component/official/form.js +186 -159
  25. package/lowcode/official_view_component/official/form.ts +1150 -1068
  26. package/lowcode/public-components/blogs/blogs-01.js +20 -4
  27. package/lowcode/public-components/blogs/blogs-01.ts +25 -4
  28. package/lowcode/public-components/footer/footer-01.js +1 -1
  29. package/lowcode/public-components/footer/footer-01.ts +2 -1
  30. package/lowcode/public-components/footer/footer-02.js +1 -1
  31. package/lowcode/public-components/footer/footer-02.ts +1 -1
  32. package/lowcode/public-components/footer/footer-03.js +1 -1
  33. package/lowcode/public-components/footer/footer-03.ts +1 -1
  34. package/package.json +1 -1
  35. package/src/api-public/controllers/shopee.js +10 -0
  36. package/src/api-public/controllers/shopee.js.map +1 -1
  37. package/src/api-public/controllers/shopee.ts +12 -12
  38. package/src/api-public/services/auto-send-email.js +16 -0
  39. package/src/api-public/services/auto-send-email.js.map +1 -1
  40. package/src/api-public/services/auto-send-email.ts +16 -0
  41. package/src/api-public/services/checkout-event.js +13 -17
  42. package/src/api-public/services/checkout-event.js.map +1 -1
  43. package/src/api-public/services/checkout-event.ts +9 -1
  44. package/src/api-public/services/data-analyze.d.ts +1 -1
  45. package/src/api-public/services/line-message.js +1 -0
  46. package/src/api-public/services/line-message.js.map +1 -1
  47. package/src/api-public/services/line-message.ts +2 -0
  48. package/src/api-public/services/shopee.d.ts +4 -3
  49. package/src/api-public/services/shopee.js +28 -24
  50. package/src/api-public/services/shopee.js.map +1 -1
  51. package/src/api-public/services/shopee.ts +30 -24
  52. package/src/api-public/services/shopping.js +2 -7
  53. package/src/api-public/services/shopping.js.map +1 -1
  54. package/src/api-public/services/shopping.ts +5 -14
  55. package/src/api-public/services/user.js +1 -1
  56. package/src/api-public/services/user.js.map +1 -1
  57. package/src/api-public/services/user.ts +1 -1
  58. package/src/index.js +3 -3
  59. package/src/modules/database.d.ts +1 -1
  60. package/src/public-config-initial/auto-fcm.js +4 -0
  61. package/src/public-config-initial/auto-fcm.js.map +1 -1
  62. package/src/public-config-initial/auto-fcm.ts +7 -1
  63. package/src/seo-config.js +0 -1
  64. package/src/seo-config.js.map +1 -1
  65. package/src/seo-config.ts +0 -1
  66. package/src/services/template.js +10 -0
  67. package/src/services/template.js.map +1 -1
  68. package/src/services/template.ts +9 -0
@@ -39,11 +39,8 @@ export class imageLibrary {
39
39
  };
40
40
  const ids = {
41
41
  classPrefix: 'image-library-dialog',
42
+ selectBarID: gvc.glitter.getUUID(),
42
43
  };
43
- gvc.addStyle(css `
44
- .${ids.classPrefix} {
45
- }
46
- `);
47
44
  if (cf.key == 'folderEdit') {
48
45
  vm.tag = cf.tag;
49
46
  vm.type = 'folderEdit';
@@ -70,7 +67,7 @@ export class imageLibrary {
70
67
  if (dd.selected) {
71
68
  count++;
72
69
  }
73
- return dd.items.filter((d) => {
70
+ return dd.filter((d) => {
74
71
  return d.selected;
75
72
  }).length;
76
73
  }
@@ -190,18 +187,7 @@ export class imageLibrary {
190
187
  const imageUrl = originImageURL !== null && originImageURL !== void 0 ? originImageURL : noImageURL;
191
188
  function itemClick() {
192
189
  var _a;
193
- if (vm.type == 'folder') {
194
- vm.type = 'folder';
195
- that.selectImageLibrary(gvc, selectData => {
196
- vm.link = selectData;
197
- gvc.notifyDataChange(vm.id);
198
- }, `<div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">${vm.tag}</div>`, {
199
- key: 'folderEdit',
200
- mul: true,
201
- tag: fileItem.title,
202
- });
203
- }
204
- else if (vm.type == 'folderView') {
190
+ if (vm.type == 'folderView') {
205
191
  function updateLinkList(replaceId, newItem) {
206
192
  const replaceItemIndex = vm.link.findIndex(i => i.id === replaceId);
207
193
  console.log(replaceItemIndex);
@@ -440,7 +426,7 @@ export class imageLibrary {
440
426
  gvc.notifyDataChange(vm.footer_id);
441
427
  function drawBreadcrumb() {
442
428
  return html `
443
- <div class="d-flex" style="margin: 20px 0">
429
+ <div class="d-flex" style="margin-bottom:12px;">
444
430
  <div class="breadcrumb-item">
445
431
  <div
446
432
  class="cursor_pointer"
@@ -495,6 +481,10 @@ export class imageLibrary {
495
481
  ? '700'
496
482
  : '500'};cursor: pointer;"
497
483
  onclick="${gvc.event(e => {
484
+ if (vm.type == data.key)
485
+ return;
486
+ else
487
+ vm.link.forEach(item => (item.selected = false));
498
488
  vm.type = data.key;
499
489
  vm.query = '';
500
490
  gvc.notifyDataChange(vm.id);
@@ -506,21 +496,26 @@ export class imageLibrary {
506
496
  })
507
497
  .join('');
508
498
  }
509
- if (vm.type == 'folderViewToEdit') {
510
- vm.type = 'folderView';
511
- yield that.selectImageLibrary(gvc, selectData => {
512
- vm.link = selectData;
513
- gvc.notifyDataChange(vm.id);
514
- }, `<div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">${vm.tag}</div>`, {
515
- key: 'folderEdit',
516
- mul: true,
517
- tag: vm.tag,
499
+ function drawSelectBar(selectCount) {
500
+ return gvc.bindView({
501
+ bind: ids.selectBarID,
502
+ view: () => {
503
+ return html `
504
+ <div
505
+ class="${selectCount ? `` : `d-none`} ${gClass('select-bar-text')}"
506
+ >
507
+ 已選取${selectCount}項
508
+ </div>
509
+ <div class="ms-auto ${gClass('search-raw')}">上傳時間舊>新</div>
510
+ `;
511
+ },
512
+ divCreate: {
513
+ class: `w-100 ${gClass('select-bar')} `,
514
+ },
518
515
  });
519
516
  }
520
517
  if (vm.type == 'folderADD') {
521
518
  function pushFolder(folder, imageArray) {
522
- console.log('folder -- ', folder);
523
- console.log('imageArray -- ', imageArray);
524
519
  imageArray.forEach(image => {
525
520
  image.selected = false;
526
521
  });
@@ -588,6 +583,10 @@ export class imageLibrary {
588
583
  if (vm.type == 'folderView') {
589
584
  changeWindowsName((_b = vm.tag) !== null && _b !== void 0 ? _b : 'folder');
590
585
  changeCancelBTNName('返回');
586
+ const group = vm.link.filter(item2 => {
587
+ var _a;
588
+ return item2.tag && item2.tag.includes((_a = vm.tag) !== null && _a !== void 0 ? _a : '');
589
+ });
591
590
  return html `
592
591
  ${drawBreadcrumb()}
593
592
  <div class="d-flex w-100" style="gap:14px;margin-top: 12px;">
@@ -605,14 +604,11 @@ export class imageLibrary {
605
604
  options: FilterOptions.imageLibraryOrderBy,
606
605
  })}
607
606
  </div>
607
+ ${drawSelectBar(getSelectCount(group))}
608
608
  ${gvc.bindView({
609
609
  bind: `folderItemGroup`,
610
610
  view: () => {
611
611
  if (vm.tag) {
612
- let group = vm.link.filter(item2 => {
613
- var _a;
614
- return item2.tag && item2.tag.includes((_a = vm.tag) !== null && _a !== void 0 ? _a : '');
615
- });
616
612
  return renderItems(group);
617
613
  }
618
614
  return ``;
@@ -623,7 +619,7 @@ export class imageLibrary {
623
619
  }
624
620
  if (vm.type == 'folderEdit') {
625
621
  return html `
626
- <div class="d-flex flex-column ${gClass('album-title')}" >
622
+ <div class="d-flex flex-column ${gClass('album-title')}">
627
623
  相簿名稱
628
624
  <input
629
625
  class="w-100"
@@ -651,26 +647,8 @@ export class imageLibrary {
651
647
  })}
652
648
  </div>
653
649
  <div class="d-flex w-100 justify-content-end" style="gap:12px;margin-top: 18px;">
654
- <div
655
- style="margin-right: auto; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word"
656
- >
657
- 已選取${getSelectCount({
658
- items: vm.link,
659
- })}項
660
- </div>
661
- ${BgWidget.grayButton('刪除', gvc.event(() => {
662
- let selectedData = vm.link.filter(item => item.selected);
663
- selectedData.forEach(item => {
664
- item.selected = false;
665
- item.tag = item.tag.filter(tag => {
666
- return tag !== vm.tag;
667
- });
668
- });
669
- let folder = vm.link.find(dd => {
670
- return dd.title == vm.tag && dd.type == 'folder';
671
- });
672
- gvc.notifyDataChange(vm.id);
673
- }))}
650
+ ${drawSelectBar(getSelectCount(vm.link))}
651
+
674
652
  ${BgWidget.grayButton('新增圖片', gvc.event(() => {
675
653
  const thatGVC = gvc;
676
654
  gvc.glitter.innerDialog((gvc) => {
@@ -749,7 +727,7 @@ export class imageLibrary {
749
727
  }, 'add');
750
728
  }))}
751
729
  </div>
752
- <div >
730
+ <div>
753
731
  ${gvc.bindView({
754
732
  bind: `folderItemGroup`,
755
733
  view: () => {
@@ -774,10 +752,9 @@ export class imageLibrary {
774
752
  flex-direction: column;
775
753
  height: auto; /* 設定一個固定的高度 (或用 auto 讓內容決定) */
776
754
  flex-shrink: 0;
777
- padding: 15px;
778
755
  box-sizing: border-box; /* padding 不影響宣告的高度 */
779
756
  width: 100%;
780
- gap: 20px;
757
+ gap: 12px;
781
758
  position: sticky;
782
759
  background: #fff;
783
760
  left: 0;
@@ -789,9 +766,7 @@ export class imageLibrary {
789
766
  flex-grow: 1; /* 重要:讓此區塊佔滿所有剩餘的垂直空間 */
790
767
  overflow-y: auto; /* 關鍵:當內容垂直溢出時,只在此區塊顯示垂直滾動條 */
791
768
  width: 100%;
792
- padding: 15px;
793
769
  box-sizing: border-box;
794
- gap: 20px;
795
770
  }
796
771
 
797
772
  .${ids.classPrefix}-content {
@@ -801,14 +776,20 @@ export class imageLibrary {
801
776
  }
802
777
 
803
778
  .${ids.classPrefix}-select-bar {
804
- height: 40px;
805
- padding: 12px 18px;
806
- background: #f7f7f7;
807
779
  border-radius: 10px;
808
780
  justify-content: flex-end;
809
781
  align-items: center;
810
782
  gap: 8px;
811
783
  display: ${cf.mul ? `inline-flex` : `none`};
784
+ margin-top: 18px;
785
+ margin-bottom: 8px;
786
+ }
787
+ .${ids.classPrefix}-select-bar-text{
788
+ flex: 1 1 0;
789
+ color: #393939;
790
+ font-size: 14px;
791
+ font-weight: 700;
792
+ word-wrap: break-word
812
793
  }
813
794
 
814
795
  .${ids.classPrefix}-new-album-title-bar {
@@ -816,7 +797,6 @@ export class imageLibrary {
816
797
  font-style: normal;
817
798
  font-weight: 400;
818
799
  gap: 8px;
819
- padding-top: 12px;
820
800
  }
821
801
 
822
802
  .${ids.classPrefix}-new-album-title-bar input {
@@ -852,7 +832,6 @@ export class imageLibrary {
852
832
  font-style: normal;
853
833
  font-weight: 400;
854
834
  gap: 8px;
855
- padding-top: 12px;
856
835
  }
857
836
 
858
837
  .${ids.classPrefix}-album-title input {
@@ -861,6 +840,13 @@ export class imageLibrary {
861
840
  border-radius: 10px;
862
841
  border: 1px solid #ddd;
863
842
  }
843
+
844
+ .${ids.classPrefix}-search-raw {
845
+ color: #393939;
846
+ text-align: right;
847
+ font-size: 14px;
848
+ font-weight: 400;
849
+ }
864
850
  `);
865
851
  return html `
866
852
  <div
@@ -885,21 +871,7 @@ export class imageLibrary {
885
871
  </div>
886
872
  </div>
887
873
  <div class="scrollable-bottom-section d-flex flex-column">
888
- <div
889
- class="w-100 ${gClass('select-bar')} ${getSelectCount({
890
- items: vm.link,
891
- }) > 0 && vm.type == 'file'
892
- ? ``
893
- : `d-none`}"
894
- >
895
- <div
896
- style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word"
897
- >
898
- 已選取${getSelectCount({
899
- items: vm.link,
900
- })}項
901
- </div>
902
- </div>
874
+ ${drawSelectBar(getSelectCount(vm.link))}
903
875
  <div
904
876
  style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex"
905
877
  >
@@ -1015,7 +987,7 @@ export class imageLibrary {
1015
987
  }),
1016
988
  divCreate: {
1017
989
  class: `w-100 h-100`,
1018
- style: ``,
990
+ style: `padding: 8px;`,
1019
991
  },
1020
992
  };
1021
993
  });
@@ -1110,6 +1082,11 @@ export class imageLibrary {
1110
1082
  vm.type = 'folder';
1111
1083
  gvc.notifyDataChange(vm.id);
1112
1084
  }
1085
+ else if (vm.type === 'folderEdit') {
1086
+ closeFolderView();
1087
+ vm.type = 'folderView';
1088
+ gvc.notifyDataChange(vm.id);
1089
+ }
1113
1090
  else {
1114
1091
  gvc.closeDialog();
1115
1092
  }
@@ -1119,7 +1096,8 @@ export class imageLibrary {
1119
1096
  type: 'edit',
1120
1097
  label: '編輯',
1121
1098
  onClick: () => {
1122
- vm.type = 'folderViewToEdit';
1099
+ vm.type = 'folderEdit';
1100
+ cf.key = "album";
1123
1101
  gvc.notifyDataChange(vm.id);
1124
1102
  },
1125
1103
  },
@@ -1188,7 +1166,11 @@ export class imageLibrary {
1188
1166
  view: () => {
1189
1167
  return defs
1190
1168
  .map(d => {
1191
- const widget = (d.type === 'cancel' || d.type === 'edit') ? BgWidget.cancel : d.type === 'danger' ? BgWidget.danger : BgWidget.save;
1169
+ const widget = d.type === 'cancel' || d.type === 'edit'
1170
+ ? BgWidget.cancel
1171
+ : d.type === 'danger'
1172
+ ? BgWidget.danger
1173
+ : BgWidget.save;
1192
1174
  if (d.type == 'edit') {
1193
1175
  if (vm.type == 'folderView') {
1194
1176
  return widget(gvc.event(d.onClick), d.label);
@@ -1200,10 +1182,11 @@ export class imageLibrary {
1200
1182
  }
1201
1183
  })
1202
1184
  .join('');
1203
- }, divCreate: {
1185
+ },
1186
+ divCreate: {
1204
1187
  class: 'w-100 d-flex align-items-center justify-content-end',
1205
- style: 'gap:14px'
1206
- }
1188
+ style: 'gap:14px',
1189
+ },
1207
1190
  });
1208
1191
  },
1209
1192
  closeCallback: () => {
@@ -1496,9 +1479,10 @@ export class imageLibrary {
1496
1479
  BgWidget.danger(gvc.event(() => {
1497
1480
  const dialog = new ShareDialog(gvc.glitter);
1498
1481
  function deleteImage() {
1482
+ const text = (item.type == 'folder') ? `此操作不可復原。確定要刪除相簿${item.title}嗎?` : '刪除此圖片後,所有使用它的頁面與商品將無法顯示。<br>是否確定?';
1499
1483
  dialog.checkYesOrNotWithCustomWidth({
1500
1484
  width: '432',
1501
- text: '刪除此圖片後,所有使用它的頁面與商品將無法顯示。<br>是否確定?',
1485
+ text: text,
1502
1486
  icon: '<i class="fa-solid fa-info"></i>',
1503
1487
  callback: response => {
1504
1488
  if (response) {