ts-glitter 21.8.2 → 21.8.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 (42) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/backend-manager/bg-dialog.js +342 -100
  4. package/lowcode/backend-manager/bg-dialog.ts +432 -145
  5. package/lowcode/backend-manager/bg-widget.js +4 -4
  6. package/lowcode/backend-manager/bg-widget.ts +5 -5
  7. package/lowcode/cms-plugin/shopping-discount-setting.js +148 -92
  8. package/lowcode/cms-plugin/shopping-discount-setting.ts +162 -111
  9. package/lowcode/cms-plugin/shopping-product-stock.js +58 -45
  10. package/lowcode/cms-plugin/shopping-product-stock.ts +66 -49
  11. package/lowcode/css/editor.css +8 -9
  12. package/lowcode/editor/basic-component.js +0 -5
  13. package/lowcode/editor/basic-component.ts +1 -6
  14. package/lowcode/glitter-base/route/article.js +50 -51
  15. package/lowcode/glitter-base/route/article.ts +102 -103
  16. package/lowcode/glitter-base/route/recommend.js +1 -0
  17. package/lowcode/glitter-base/route/recommend.ts +141 -123
  18. package/lowcode/modules/image-library-clone.ts +2 -0
  19. package/lowcode/modules/image-library.js +118 -155
  20. package/lowcode/modules/image-library.ts +134 -197
  21. package/lowcode/public-components/layout-plugin/social-links-01.js +23 -44
  22. package/lowcode/public-components/layout-plugin/social-links-01.ts +23 -48
  23. package/package.json +1 -1
  24. package/src/api-public/controllers/article.js +11 -0
  25. package/src/api-public/controllers/article.js.map +1 -1
  26. package/src/api-public/controllers/article.ts +13 -0
  27. package/src/api-public/controllers/recommend.js +1 -0
  28. package/src/api-public/controllers/recommend.js.map +1 -1
  29. package/src/api-public/controllers/recommend.ts +99 -89
  30. package/src/api-public/services/checkout-event.js +4 -3
  31. package/src/api-public/services/checkout-event.js.map +1 -1
  32. package/src/api-public/services/checkout-event.ts +11 -7
  33. package/src/api-public/services/post.js +7 -17
  34. package/src/api-public/services/post.js.map +1 -1
  35. package/src/api-public/services/recommend.d.ts +1 -0
  36. package/src/api-public/services/recommend.js +12 -2
  37. package/src/api-public/services/recommend.js.map +1 -1
  38. package/src/api-public/services/recommend.ts +375 -354
  39. package/src/api-public/services/shopping.d.ts +1 -0
  40. package/src/api-public/services/shopping.js +4 -2
  41. package/src/api-public/services/shopping.js.map +1 -1
  42. package/src/api-public/services/shopping.ts +7 -2
@@ -77,7 +77,6 @@ export class imageLibrary {
77
77
  selectBarID: gvc.glitter.getUUID(),
78
78
  };
79
79
 
80
-
81
80
  if (cf.key == 'folderEdit') {
82
81
  vm.tag = cf.tag;
83
82
  vm.type = 'folderEdit';
@@ -118,8 +117,23 @@ export class imageLibrary {
118
117
  function getPublicConfig(callback: () => void) {
119
118
  ApiUser.getPublicConfig('image-manager', 'manager').then((data: any) => {
120
119
  if (data.response.value) {
121
- vm.link = data.response.value;
120
+ const tagDiv = window.parent.document.querySelector('.tag-title');
122
121
 
122
+ vm.link = data.response.value;
123
+ if (tagDiv) {
124
+ const tag = tagDiv.getAttribute('data-tag');
125
+ if (tag) {
126
+ console.log(
127
+ 'vm.link.filter(item => item.tag.includes(tag)) -- ',
128
+ vm.link.filter(item => item.tag.includes(tag))
129
+ );
130
+ vm.link
131
+ .filter(item => item.tag.includes(tag))
132
+ .forEach(item => {
133
+ item.selected = true;
134
+ });
135
+ }
136
+ }
123
137
  function loop(array: FileItem[]) {
124
138
  array.map(dd => {
125
139
  if (dd.type === 'folder') {
@@ -315,7 +329,7 @@ export class imageLibrary {
315
329
  });
316
330
  }
317
331
  (fileItem as any).selected = !defaultSelect;
318
- gvc.notifyDataChange(vm.id);
332
+ gvc.notifyDataChange([viewID, ids.selectBarID]);
319
333
  event.stopPropagation();
320
334
  })}"
321
335
  ${!gvc.glitter.isTouchDevice()
@@ -491,6 +505,7 @@ export class imageLibrary {
491
505
  }
492
506
 
493
507
  getPublicConfig(() => {
508
+ const tagDiv = document.querySelector('.tag-title');
494
509
  gvc.notifyDataChange(vm.id);
495
510
  });
496
511
 
@@ -510,6 +525,7 @@ export class imageLibrary {
510
525
  onclick="${gvc.event(() => {
511
526
  closeFolderView();
512
527
  vm.type = 'file';
528
+ cf.key = 'file';
513
529
  gvc.notifyDataChange(vm.id);
514
530
  })}"
515
531
  >
@@ -572,83 +588,44 @@ export class imageLibrary {
572
588
  })
573
589
  .join('');
574
590
  }
575
-
576
- function drawSelectBar(selectCount: number) {
577
- return gvc.bindView({
578
- bind: ids.selectBarID,
579
- view: () => {
580
- return html`
581
- <div
582
- class="${selectCount ? `` : `d-none`} ${gClass('select-bar-text')}"
583
- >
584
- 已選取${selectCount}項
585
- </div>
586
- <div class="ms-auto ${gClass('search-raw')}">上傳時間舊>新</div>
587
- `;
588
- },
589
- divCreate: {
590
- class: `w-100 ${gClass('select-bar')} `,
591
- },
591
+ function pushFolder(folder: FileItem, imageArray: FileItem[]) {
592
+ imageArray.forEach(image => {
593
+ image.selected = false;
592
594
  });
595
+ folder.data.push(
596
+ ...imageArray.filter(
597
+ image => !folder.data.some((existingImage: any) => existingImage.id === image.id)
598
+ )
599
+ );
600
+ return folder.data;
593
601
  }
602
+ function pushDataToFolder(selectData: FileItem[]) {
603
+ selectData.map(data => {
604
+ let matchingElement = vm.link.find(item2 => item2.id === data.id);
605
+ if (matchingElement) {
606
+ if (!matchingElement.tag) {
607
+ matchingElement.tag = [];
608
+ }
594
609
 
595
- // if (vm.type == 'folderViewToEdit') {
596
- // vm.type = 'folderView';
597
- // await that.selectImageLibrary(
598
- // gvc,
599
- // selectData => {
600
- // vm.link = selectData;
601
- // gvc.notifyDataChange(vm.id);
602
- // },
603
- // `<div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">${vm.tag}</div>`,
604
- // {
605
- // key: 'folderEdit',
606
- // mul: true,
607
- // tag: vm.tag,
608
- // }
609
- // );
610
- // }
611
- // 空白資料夾新增的頁面
612
- if (vm.type == 'folderADD') {
613
- function pushFolder(folder: FileItem, imageArray: FileItem[]) {
614
- imageArray.forEach(image => {
615
- image.selected = false;
616
- });
617
- return folder.data.push(...imageArray);
618
- }
619
-
620
- vm.newFolder = {
621
- selected: false,
622
- title: '',
623
- data: [],
624
- items: [],
625
- type: 'folder',
626
- tag: [],
627
- id: gvc.glitter.getUUID(),
628
- };
610
+ if (!matchingElement.tag.includes(vm.tag as string)) {
611
+ matchingElement!.tag.push(vm.tag as string);
612
+ }
613
+ }
614
+ (data as any).selected = false;
615
+ });
616
+ }
617
+ function drawAlbumInsertImage(callback: (selectData: FileItem[]) => void) {
629
618
  return html`
630
- <div class="d-flex flex-column ${gClass('new-album-title-bar')}">
631
- 相簿名稱
632
- <input
633
- class="w-100"
634
- value="${vm.tag ?? ''}"
635
- placeholder="請輸入相簿名稱"
636
- onchange="${gvc.event(e => {
637
- vm.tag = e.value;
638
- })}"
639
- />
640
- </div>
641
619
  <div class="w-100 ${gClass('new-album-add-block')}">
642
620
  <div
643
621
  class="btn1"
644
622
  onclick="${gvc.event(() => {
645
- this.selectImageLibrary(
623
+ that.selectImageLibrary(
646
624
  gvc,
647
625
  selectData => {
648
- pushFolder(vm.newFolder, selectData);
649
- gvc.notifyDataChange('folderItemGroup');
626
+ callback(selectData);
650
627
  },
651
- `<div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">${vm.tag}</div>`,
628
+ `<div class="d-flex flex-column tag-title" data-tag="${vm.tag}" style="border-radius: 10px 10px 0 0;background: #F2F2F2;">${vm.tag}</div>`,
652
629
  {
653
630
  key: 'album',
654
631
  mul: true,
@@ -664,9 +641,10 @@ export class imageLibrary {
664
641
  cf.plus(
665
642
  gvc,
666
643
  fileArray => {
667
- pushFolder(vm.newFolder, fileArray);
644
+ vm.link.push(...fileArray);
645
+ callback(fileArray);
668
646
  save(() => {
669
- gvc.notifyDataChange('folderItemGroup');
647
+ gvc.notifyDataChange(vm.id);
670
648
  });
671
649
  },
672
650
  'file'
@@ -676,6 +654,48 @@ export class imageLibrary {
676
654
  上傳新圖片
677
655
  </div>
678
656
  </div>
657
+ `;
658
+ }
659
+
660
+ function drawSelectBar(data: FileItem[]) {
661
+ return gvc.bindView({
662
+ bind: ids.selectBarID,
663
+ view: () => {
664
+ const selectCount = getSelectCount(data);
665
+ return html`
666
+ <div class="${selectCount ? `` : `d-none`} ${gClass('select-bar-text')}">
667
+ 已選取${selectCount}項
668
+ </div>
669
+ <div class="ms-auto ${gClass('search-raw')}">上傳時間舊>新</div>
670
+ `;
671
+ },
672
+ divCreate: {
673
+ class: `w-100 ${gClass('select-bar')} `,
674
+ },
675
+ });
676
+ }
677
+ // 空白資料夾新增的頁面
678
+ if (vm.type == 'folderADD') {
679
+ const copyLink = structuredClone(vm.link);
680
+ return html`
681
+ <div class="d-flex flex-column ${gClass('new-album-title-bar')}">
682
+ 相簿名稱
683
+ <input
684
+ class="w-100"
685
+ value="${vm.tag ?? ''}"
686
+ placeholder="請輸入相簿名稱"
687
+ onchange="${gvc.event(e => {
688
+ vm.tag = e.value;
689
+ })}"
690
+ />
691
+ </div>
692
+ ${drawAlbumInsertImage((selectData: FileItem[]) => {
693
+ pushFolder(vm.newFolder, selectData);
694
+ // vm.newFolder.data = [];
695
+ vm.link.push(vm.newFolder);
696
+
697
+ gvc.notifyDataChange('folderItemGroup');
698
+ })}
679
699
  ${gvc.bindView({
680
700
  bind: `folderItemGroup`,
681
701
  view: () => {
@@ -713,7 +733,7 @@ export class imageLibrary {
713
733
  options: FilterOptions.imageLibraryOrderBy,
714
734
  })}
715
735
  </div>
716
- ${drawSelectBar(getSelectCount(group))}
736
+ ${drawSelectBar(group)}
717
737
  ${gvc.bindView({
718
738
  bind: `folderItemGroup`,
719
739
  view: () => {
@@ -741,119 +761,14 @@ export class imageLibrary {
741
761
  })}"
742
762
  />
743
763
  </div>
744
- <div class="d-flex w-100" style="gap:14px;margin-top: 12px;">
745
- ${BgWidget.searchFilter(
746
- gvc.event(e => {
747
- vm.query = e.value;
748
- gvc.notifyDataChange(vm.id);
749
- }),
750
- vm.query || '',
751
- '搜尋圖片'
752
- )}
753
- ${BgWidget.updownFilter({
754
- gvc,
755
- callback: (value: any) => {
756
- vm.orderString = value;
757
- gvc.notifyDataChange(vm.id);
758
- },
759
- default: vm.orderString || 'default',
760
- options: FilterOptions.imageLibraryOrderBy,
761
- })}
762
- </div>
764
+ ${drawAlbumInsertImage((selectData: FileItem[]) => {
765
+ pushDataToFolder(selectData);
766
+ save(() => {
767
+ gvc.notifyDataChange('folderItemGroup');
768
+ });
769
+ })}
763
770
  <div class="d-flex w-100 justify-content-end" style="gap:12px;margin-top: 18px;">
764
- ${drawSelectBar(getSelectCount(vm.link))}
765
-
766
- ${BgWidget.grayButton(
767
- '新增圖片',
768
- gvc.event(() => {
769
- const thatGVC = gvc;
770
- gvc.glitter.innerDialog((gvc: GVC) => {
771
- return html`
772
- <div style="width: 445px;height: 255px;border-radius: 10px;background: #FFF;">
773
- <div
774
- class="d-flex"
775
- style="color:#393939;display: flex;padding: 12px 20px;align-items: center;gap: 10px;"
776
- >
777
- 新增圖片
778
- <span
779
- class="d-flex align-items-center justify-content-center"
780
- style="margin-left: auto;cursor: pointer;"
781
- onclick="${gvc.event(() => {
782
- gvc.glitter.closeDiaLog('add');
783
- })}"
784
- >
785
- <svg
786
- xmlns="http://www.w3.org/2000/svg"
787
- width="14"
788
- height="14"
789
- viewBox="0 0 14 14"
790
- fill="none"
791
- >
792
- <path d="M1 1L13 13" stroke="#393939" stroke-linecap="round" />
793
- <path d="M13 1L1 13" stroke="#393939" stroke-linecap="round" />
794
- </svg>
795
- </span>
796
- </div>
797
- <div class="d-flex justify-content-center" style="padding-top:61px;gap:14px;">
798
- <div
799
- style="padding: 10px 18px;border-radius: 10px;border: 1px solid #DDD;background: #FFF;box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.10);cursor: pointer;"
800
- onclick="${gvc.event(() => {
801
- this.selectImageLibrary(
802
- gvc,
803
- selectData => {
804
- selectData.map(data => {
805
- let matchingElement = vm.link.find(item2 => item2.id === data.id);
806
- if (matchingElement) {
807
- if (!matchingElement.tag) {
808
- matchingElement.tag = [];
809
- }
810
-
811
- if (!matchingElement.tag.includes(vm.tag as string)) {
812
- matchingElement!.tag.push(vm.tag as string);
813
- }
814
- }
815
- (data as any).selected = false;
816
- });
817
-
818
- gvc.glitter.closeDiaLog('add');
819
- thatGVC.notifyDataChange(vm.id);
820
- },
821
- `<div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">${vm.tag}</div>`,
822
- {
823
- key: 'album',
824
- mul: true,
825
- }
826
- );
827
- })}"
828
- >
829
- 從圖庫中選擇
830
- </div>
831
- <div
832
- style="padding: 10px 18px;border-radius: 10px;border: 1px solid #DDD;background: #FFF;box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.10);cursor: pointer;"
833
- onclick="${gvc.event(() => {
834
- cf.plus(
835
- gvc,
836
- fileArray => {
837
- fileArray.forEach(item => {
838
- item.tag = [];
839
- item.tag.push(vm.tag as string);
840
- vm.link.push(item);
841
- });
842
- gvc.glitter.closeDiaLog('add');
843
- thatGVC.notifyDataChange(vm.id);
844
- },
845
- 'file'
846
- );
847
- })}"
848
- >
849
- 上傳新圖片
850
- </div>
851
- </div>
852
- </div>
853
- `;
854
- }, 'add');
855
- })
856
- )}
771
+ ${drawSelectBar(vm.link)}
857
772
  </div>
858
773
  <div>
859
774
  ${gvc.bindView({
@@ -914,19 +829,19 @@ export class imageLibrary {
914
829
  margin-top: 18px;
915
830
  margin-bottom: 8px;
916
831
  }
917
- .${ids.classPrefix}-select-bar-text{
832
+ .${ids.classPrefix}-select-bar-text {
918
833
  flex: 1 1 0;
919
834
  color: #393939;
920
835
  font-size: 14px;
921
836
  font-weight: 700;
922
- word-wrap: break-word
837
+ word-wrap: break-word;
923
838
  }
924
839
 
925
840
  .${ids.classPrefix}-new-album-title-bar {
926
841
  font-size: 16px;
927
842
  font-style: normal;
928
843
  font-weight: 400;
929
- gap: 8px;
844
+ gap: 12px;
930
845
  }
931
846
 
932
847
  .${ids.classPrefix}-new-album-title-bar input {
@@ -937,7 +852,7 @@ export class imageLibrary {
937
852
  }
938
853
 
939
854
  .${ids.classPrefix}-new-album-add-block {
940
- margin-top: 18px;
855
+ margin-top: 12px;
941
856
  padding: 39px 0;
942
857
  display: flex;
943
858
  justify-content: center;
@@ -945,7 +860,7 @@ export class imageLibrary {
945
860
  border-radius: 10px;
946
861
  border: 1px solid #ddd;
947
862
  background: #fff;
948
- gap: 14px;
863
+ gap: 12px;
949
864
  }
950
865
 
951
866
  .${ids.classPrefix}-new-album-add-block .btn1 {
@@ -983,7 +898,7 @@ export class imageLibrary {
983
898
  class="w-100 d-inline-flex flex-column justify-content-start align-items-start ${gClass('content')}"
984
899
  >
985
900
  <div class="fixed-top-section">
986
- <div class=" ${cf.key == 'album' ? `d-none` : `d-flex`}" style="gap:14px;">${pageBTN()}</div>
901
+ <div class=" ${cf.key != 'album' ? `d-flex` : `d-none`}" style="gap:14px;">${pageBTN()}</div>
987
902
  <div class="d-flex w-100" style="gap:14px;">
988
903
  ${BgWidget.searchFilter(
989
904
  gvc.event(e => {
@@ -1003,9 +918,9 @@ export class imageLibrary {
1003
918
  options: FilterOptions.imageLibraryOrderBy,
1004
919
  })}
1005
920
  </div>
921
+ ${drawSelectBar(vm.link)}
1006
922
  </div>
1007
923
  <div class="scrollable-bottom-section d-flex flex-column">
1008
- ${drawSelectBar(getSelectCount(vm.link))}
1009
924
  <div
1010
925
  style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex"
1011
926
  >
@@ -1066,6 +981,15 @@ export class imageLibrary {
1066
981
  } else {
1067
982
  vm.tag = '';
1068
983
  vm.type = 'folderADD';
984
+ vm.newFolder = {
985
+ selected: false,
986
+ title: '',
987
+ data: [],
988
+ items: [],
989
+ type: 'folder',
990
+ tag: [],
991
+ id: gvc.glitter.getUUID(),
992
+ };
1069
993
  gvc.notifyDataChange(vm.id);
1070
994
  }
1071
995
  })}"
@@ -1077,9 +1001,9 @@ export class imageLibrary {
1077
1001
  }
1078
1002
  return html`
1079
1003
  <div
1080
- class="w-100 ${cf.key == 'album'
1081
- ? `d-none`
1082
- : `d-flex`} align-items-center justify-content-center"
1004
+ class="w-100 ${vm.type == 'file' || vm.type == 'folder'
1005
+ ? `d-flex`
1006
+ : `d-none`} align-items-center justify-content-center"
1083
1007
  style="padding: 39px 0;border-radius: 10px;border: 1px solid #DDD;background: #FFF;"
1084
1008
  >
1085
1009
  <div
@@ -1099,6 +1023,15 @@ export class imageLibrary {
1099
1023
  } else {
1100
1024
  vm.tag = '';
1101
1025
  vm.type = 'folderADD';
1026
+ vm.newFolder = {
1027
+ selected: false,
1028
+ title: '',
1029
+ data: [],
1030
+ items: [],
1031
+ type: 'folder',
1032
+ tag: [],
1033
+ id: gvc.glitter.getUUID(),
1034
+ };
1102
1035
  gvc.notifyDataChange(vm.id);
1103
1036
  }
1104
1037
  })}"
@@ -1233,6 +1166,7 @@ export class imageLibrary {
1233
1166
  type: 'cancel',
1234
1167
  label: cancelLabel,
1235
1168
  onClick: () => {
1169
+ cf.key = 'file';
1236
1170
  if (cf.cancelEvent) cf.cancelEvent();
1237
1171
  if (vm.type === 'folderView' || vm.type === 'folderADD') {
1238
1172
  closeFolderView();
@@ -1242,7 +1176,7 @@ export class imageLibrary {
1242
1176
  closeFolderView();
1243
1177
  vm.type = 'folderView';
1244
1178
  gvc.notifyDataChange(vm.id);
1245
- }else {
1179
+ } else {
1246
1180
  gvc.closeDialog();
1247
1181
  }
1248
1182
  },
@@ -1252,7 +1186,7 @@ export class imageLibrary {
1252
1186
  label: '編輯',
1253
1187
  onClick: () => {
1254
1188
  vm.type = 'folderEdit';
1255
- cf.key = "album";
1189
+ cf.key = 'album';
1256
1190
  gvc.notifyDataChange(vm.id);
1257
1191
  },
1258
1192
  },
@@ -1670,7 +1604,10 @@ export class imageLibrary {
1670
1604
  const dialog = new ShareDialog(gvc.glitter);
1671
1605
 
1672
1606
  function deleteImage() {
1673
- const text = (item.type == 'folder')?`此操作不可復原。確定要刪除相簿${item.title}嗎?`:'刪除此圖片後,所有使用它的頁面與商品將無法顯示。<br>是否確定?' ;
1607
+ const text =
1608
+ item.type == 'folder'
1609
+ ? `此操作不可復原。確定要刪除相簿${item.title}嗎?`
1610
+ : '刪除此圖片後,所有使用它的頁面與商品將無法顯示。<br>是否確定?';
1674
1611
  dialog.checkYesOrNotWithCustomWidth({
1675
1612
  width: '432',
1676
1613
  text: text,
@@ -23,32 +23,16 @@ export class SocialLinks01 {
23
23
  };
24
24
  const gotoTopImg = 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/arrow-up-to-line-light.svg';
25
25
  gvc.addStyle(css `
26
- @media (max-width: 768px) {
27
- .floating-action-panel {
28
- position: fixed;
29
- bottom: 20px;
30
- right: 10px;
31
- display: flex;
32
- flex-direction: column; /* 垂直排列 */
33
- align-items: center;
34
- gap: 10px; /* 按鈕間距 */
35
- z-index: 1000;
36
- }
37
- }
38
-
39
- @media (min-width: 769px) {
40
- .floating-action-panel {
41
- position: fixed;
42
- bottom: 30px;
43
- right: 30px;
44
- display: flex;
45
- flex-direction: column; /* 垂直排列 */
46
- align-items: center;
47
- gap: 10px; /* 按鈕間距 */
48
- z-index: 1000;
49
- }
26
+ .floating-action-panel {
27
+ position: fixed;
28
+ bottom: 30px;
29
+ right: 30px;
30
+ display: flex;
31
+ flex-direction: column; /* 垂直排列 */
32
+ align-items: center;
33
+ gap: 10px; /* 按鈕間距 */
34
+ z-index: 1000;
50
35
  }
51
-
52
36
 
53
37
  .social-links {
54
38
  display: flex;
@@ -75,20 +59,22 @@ export class SocialLinks01 {
75
59
  border: none;
76
60
  padding: 2px;
77
61
  cursor: pointer;
78
- width: 40px;
79
- height: 40px;
80
62
  border-radius: 50%;
81
63
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
82
64
  }
83
65
 
84
-
66
+ .component-img {
67
+ width: 40px;
68
+ height: 40px;
69
+ object-fit: contain;
70
+ }
85
71
 
86
- .component-circle:hover {
72
+ .component-circle:hover .component-img {
87
73
  opacity: 0.8;
88
74
  }
89
75
 
90
76
  .up-to-top.hidden {
91
- display: none !important;
77
+ display: none;
92
78
  }
93
79
  `);
94
80
  return gvc.bindView({
@@ -100,37 +86,30 @@ export class SocialLinks01 {
100
86
  ${socialList
101
87
  .map(socialLink => {
102
88
  var _a;
103
- if (socialLink.icon === 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg') {
104
- socialLink.icon = undefined;
105
- }
106
89
  const imgSrc = supportSocial.includes(socialLink.social_type)
107
90
  ? socialIMG[socialLink.social_type]
108
91
  : socialIMG.other;
109
92
  return html `
110
- <div onclick="${gvc.event(() => {
111
- gvc.glitter.href = socialLink.link;
112
- })}" class="component-circle" style="overflow: hidden;
113
- background-image: url('${(_a = socialLink.icon) !== null && _a !== void 0 ? _a : imgSrc}');background-size: cover;background-position: center;"
114
- >
115
- </div>
93
+ <a href="${socialLink.link}" class="component-circle">
94
+ <img src="${(_a = socialLink.icon) !== null && _a !== void 0 ? _a : imgSrc}" alt="Go to top" class="component-img" />
95
+ </a>
116
96
  `;
117
97
  })
118
98
  .join('')}
119
99
  </div>
120
100
  <button
121
- class="component-circle up-to-top hidden rounded-circle align-items-center justify-content-center"
122
- style="overflow: hidden; background-color: white;display: flex; "
101
+ class="component-circle up-to-top hidden"
123
102
  onclick="${gvc.event(() => {
124
103
  scrollToTop();
125
104
  })}"
126
105
  >
127
- <i class="fa-solid fa-angle-up fs-3"></i>
106
+ <img src="${gotoTopImg}" alt="Go to top" class="component-img" />
128
107
  </button>
129
108
  </div>
130
109
  `;
131
110
  }, divCreate: {},
132
111
  onInitial: () => {
133
- window.addEventListener('scroll', function () {
112
+ window.onscroll = function () {
134
113
  const scrollPosition = window.scrollY;
135
114
  const threshold = window.innerHeight / 2;
136
115
  const panel = document.querySelector('.up-to-top');
@@ -140,7 +119,7 @@ background-image: url('${(_a = socialLink.icon) !== null && _a !== void 0 ? _a :
140
119
  else {
141
120
  panel.classList.add('hidden');
142
121
  }
143
- });
122
+ };
144
123
  }
145
124
  });
146
125
  }