ts-glitter 21.8.6 → 21.8.8

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 (35) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/editor/basic-component.js +10 -0
  4. package/lowcode/editor/basic-component.ts +11 -1
  5. package/lowcode/glitter-base/route/post.js +9 -0
  6. package/lowcode/glitter-base/route/post.ts +9 -0
  7. package/lowcode/glitter-base/route/user.js +50 -19
  8. package/lowcode/glitter-base/route/user.ts +49 -18
  9. package/lowcode/glitterBundle/plugins/html-render.js +0 -2
  10. package/lowcode/glitterBundle/plugins/html-render.ts +0 -1
  11. package/lowcode/jspage/function-page/tool-setting.js +1 -5
  12. package/lowcode/jspage/function-page/tool-setting.ts +5 -4
  13. package/lowcode/jspage/main.js +1 -6
  14. package/lowcode/jspage/main.ts +1 -6
  15. package/lowcode/modules/image-library.js +0 -1
  16. package/lowcode/modules/image-library.ts +1 -1
  17. package/lowcode/official_view_component/official/component.js +1 -1
  18. package/lowcode/official_view_component/official/component.ts +1 -1
  19. package/lowcode/public-components/banner/first-banner.js +50 -85
  20. package/lowcode/public-components/banner/first-banner.ts +59 -96
  21. package/lowcode/public-components/public/ad.ts +1 -6
  22. package/package.json +1 -1
  23. package/src/api-public/controllers/user.js +1 -0
  24. package/src/api-public/controllers/user.js.map +1 -1
  25. package/src/api-public/controllers/user.ts +2 -1
  26. package/src/api-public/services/checkout-event.js +0 -2
  27. package/src/api-public/services/checkout-event.js.map +1 -1
  28. package/src/api-public/services/data-analyze.d.ts +1 -1
  29. package/src/api-public/services/shopping.d.ts +1 -0
  30. package/src/api-public/services/shopping.js +60 -49
  31. package/src/api-public/services/shopping.js.map +1 -1
  32. package/src/api-public/services/shopping.ts +87 -62
  33. package/src/api-public/services/user.js +1 -0
  34. package/src/api-public/services/user.js.map +1 -1
  35. package/src/api-public/services/user.ts +1 -0
package/lowcode/Entry.js CHANGED
@@ -146,7 +146,7 @@ export class Entry {
146
146
  }
147
147
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
148
148
  console.log(`Entry-time:`, window.renderClock.stop());
149
- glitter.share.editerVersion = 'V_21.8.6';
149
+ glitter.share.editerVersion = 'V_21.8.8';
150
150
  glitter.share.start = new Date();
151
151
  const vm = { appConfig: [] };
152
152
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -150,7 +150,7 @@ export class Entry {
150
150
  }
151
151
  (window as any).renderClock = (window as any).renderClock ?? createClock();
152
152
  console.log(`Entry-time:`, (window as any).renderClock.stop());
153
- glitter.share.editerVersion = 'V_21.8.6';
153
+ glitter.share.editerVersion = 'V_21.8.8';
154
154
  glitter.share.start = new Date();
155
155
  const vm = { appConfig: [] };
156
156
  (window as any).saasConfig = {
@@ -9452,6 +9452,16 @@ BasicComponent.componentList = [
9452
9452
  "formData": {}
9453
9453
  },
9454
9454
  image: `https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_scs0sfs1sasbs1sf_Screenshot2024-11-14at2.03.47 AM.jpg`
9455
+ },
9456
+ {
9457
+ title: '社群按鈕',
9458
+ config: { "id": "s6s7sbs4s5s5sasd", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "tag": "social_popup", "_gap": "", "attr": [], "elem": "div", "list": [], "inner": "", "_other": {}, "_border": {}, "_margin": {}, "_radius": "", "_padding": {}, "_reverse": "false", "carryData": {}, "refer_app": "shop_template_black_style", "_max_width": "", "_background": "", "_style_refer": "global", "_hor_position": "center", "refer_form_data": { "social_list": [{ "icon": "https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg", "social_type": "fb" }, { "social_type": "ig" }, { "social_type": "line" }] }, "_background_setting": { "type": "none" } }, "list": [], "type": "component", "class": "w-100", "index": 2, "label": "社群彈窗", "style": "", "global": [], "mobile": { "id": "s6s7sbs4s5s5sasd", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "refer_app": "shop_template_black_style" }, "list": [], "type": "component", "class": "w-100", "index": 2, "label": "社群彈窗", "style": "", "global": [], "toggle": true, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "refer": "custom" }, "toggle": true, "desktop": { "data": { "refer_app": "shop_template_black_style", "refer_form_data": {} }, "refer": "custom" }, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "formData": {} },
9459
+ image: `https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/Screenshot 2025-05-21 at 6.22.03 PM.jpg`
9460
+ },
9461
+ {
9462
+ title: '首頁廣告',
9463
+ config: { "id": "s4s1sfs7s9s8sds5", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "tag": "banner-first", "_gap": "", "attr": [], "elem": "div", "list": [], "inner": "", "_other": {}, "_border": {}, "_margin": {}, "_radius": "", "_padding": {}, "_reverse": "false", "carryData": {}, "refer_app": "shop_template_black_style", "_max_width": "", "_background": "", "_style_refer": "custom", "_hor_position": "center", "refer_form_data": { "map": "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3625.9857346364677!2d121.56387331536634!3d25.033964283970027!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3442abbff9f1f2cd%3A0xa5e9e25b96d47b6!2z5p2x5Y2A5rC45bq36Zmi!5e0!3m2!1szh-TW!2stw!4v1697247462832!5m2!1szh-TW!2stw", "list": [{ "img": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/s*px$_s7s4s2sas9s7s1s8_1747824490757.png", "link": "/all-product", "title": "所有商品頁面" }], "width": { "unit": "px", "value": "450px", "number": "450" }, "height": { "unit": "px", "value": "450px", "number": "450" } }, "_background_setting": { "type": "none" }, "_style_refer_global": { "index": "0" } }, "list": [], "type": "component", "class": "w-100", "index": 21, "label": "首圖廣告", "style": "", "global": [], "mobile": { "id": "s4s1sfs7s9s8sds5", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "refer_app": "shop_template_black_style" }, "list": [], "type": "component", "class": "w-100", "index": 21, "label": "首圖廣告", "style": "", "global": [], "toggle": true, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "refer": "custom" }, "toggle": true, "desktop": { "data": { "refer_app": "shop_template_black_style", "refer_form_data": {} }, "refer": "custom" }, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "formData": {} },
9464
+ image: `https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/Screenshot 2025-05-21 at 6.50.46 PM.jpg`
9455
9465
  }
9456
9466
  ];
9457
9467
  BasicComponent.productList = [
@@ -9067,7 +9067,17 @@ export class BasicComponent {
9067
9067
  "formData": {}
9068
9068
  },
9069
9069
  image: `https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_scs0sfs1sasbs1sf_Screenshot2024-11-14at2.03.47 AM.jpg`
9070
- }
9070
+ },
9071
+ {
9072
+ title: '社群按鈕',
9073
+ config: {"id":"s6s7sbs4s5s5sasd","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"tag":"social_popup","_gap":"","attr":[],"elem":"div","list":[],"inner":"","_other":{},"_border":{},"_margin":{},"_radius":"","_padding":{},"_reverse":"false","carryData":{},"refer_app":"shop_template_black_style","_max_width":"","_background":"","_style_refer":"global","_hor_position":"center","refer_form_data":{"social_list":[{"icon":"https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg","social_type":"fb"},{"social_type":"ig"},{"social_type":"line"}]},"_background_setting":{"type":"none"}},"list":[],"type":"component","class":"w-100","index":2,"label":"社群彈窗","style":"","global":[],"mobile":{"id":"s6s7sbs4s5s5sasd","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"refer_app":"shop_template_black_style"},"list":[],"type":"component","class":"w-100","index":2,"label":"社群彈窗","style":"","global":[],"toggle":true,"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"refer":"custom"},"toggle":true,"desktop":{"data":{"refer_app":"shop_template_black_style","refer_form_data":{}},"refer":"custom"},"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"formData":{}},
9074
+ image: `https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/Screenshot 2025-05-21 at 6.22.03 PM.jpg`
9075
+ },
9076
+ {
9077
+ title: '首頁廣告',
9078
+ config: {"id":"s4s1sfs7s9s8sds5","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"tag":"banner-first","_gap":"","attr":[],"elem":"div","list":[],"inner":"","_other":{},"_border":{},"_margin":{},"_radius":"","_padding":{},"_reverse":"false","carryData":{},"refer_app":"shop_template_black_style","_max_width":"","_background":"","_style_refer":"custom","_hor_position":"center","refer_form_data":{"map":"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3625.9857346364677!2d121.56387331536634!3d25.033964283970027!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3442abbff9f1f2cd%3A0xa5e9e25b96d47b6!2z5p2x5Y2A5rC45bq36Zmi!5e0!3m2!1szh-TW!2stw!4v1697247462832!5m2!1szh-TW!2stw","list":[{"img":"https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/s*px$_s7s4s2sas9s7s1s8_1747824490757.png","link":"/all-product","title":"所有商品頁面"}],"width":{"unit":"px","value":"450px","number":"450"},"height":{"unit":"px","value":"450px","number":"450"}},"_background_setting":{"type":"none"},"_style_refer_global":{"index":"0"}},"list":[],"type":"component","class":"w-100","index":21,"label":"首圖廣告","style":"","global":[],"mobile":{"id":"s4s1sfs7s9s8sds5","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"refer_app":"shop_template_black_style"},"list":[],"type":"component","class":"w-100","index":21,"label":"首圖廣告","style":"","global":[],"toggle":true,"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"refer":"custom"},"toggle":true,"desktop":{"data":{"refer_app":"shop_template_black_style","refer_form_data":{}},"refer":"custom"},"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"formData":{}},
9079
+ image: `https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/Screenshot 2025-05-21 at 6.50.46 PM.jpg`
9080
+ }
9071
9081
  ]
9072
9082
 
9073
9083
  public static productList = [
@@ -1,9 +1,18 @@
1
1
  import { GlobalUser } from "../global/global-user.js";
2
2
  import { BaseApi } from "../../glitterBundle/api/base.js";
3
+ import { Ad } from '../../public-components/public/ad.js';
3
4
  export class ApiPost {
4
5
  constructor() {
5
6
  }
6
7
  static post(json) {
8
+ if (json.postData && json.postData.type === 'post-form-config') {
9
+ Ad.gtagEvent('generate_lead', {
10
+ event_category: 'form',
11
+ event_label: json.postData.form_title || 'contact_form',
12
+ value: 1
13
+ });
14
+ Ad.fbqEvent('Lead', {});
15
+ }
7
16
  return BaseApi.create({
8
17
  "url": getBaseUrl() + `/api-public/v1/post`,
9
18
  "type": "POST",
@@ -1,6 +1,7 @@
1
1
 
2
2
  import {GlobalUser} from "../global/global-user.js";
3
3
  import {BaseApi} from "../../glitterBundle/api/base.js";
4
+ import { Ad } from '../../public-components/public/ad.js';
4
5
 
5
6
 
6
7
  export class ApiPost {
@@ -12,6 +13,14 @@ export class ApiPost {
12
13
  token?:string,
13
14
  type:'normal' | 'manager'
14
15
  }) {
16
+ if(json.postData && json.postData.type==='post-form-config'){
17
+ Ad.gtagEvent('generate_lead',{
18
+ event_category: 'form',
19
+ event_label: json.postData.form_title || 'contact_form', // 可替換為你的表單名稱
20
+ value: 1
21
+ })
22
+ Ad.fbqEvent('Lead',{})
23
+ }
15
24
  return BaseApi.create({
16
25
  "url": getBaseUrl() + `/api-public/v1/post`,
17
26
  "type": "POST",
@@ -10,17 +10,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { BaseApi } from '../../glitterBundle/api/base.js';
11
11
  import { GlobalUser } from '../global/global-user.js';
12
12
  import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
13
+ import { Ad } from '../../public-components/public/ad.js';
13
14
  export class ApiUser {
14
15
  static register(json) {
15
- return BaseApi.create({
16
- url: getBaseUrl() + `/api-public/v1/user/register`,
17
- type: 'POST',
18
- headers: {
19
- 'Content-Type': 'application/json',
20
- 'g-app': getConfig().config.appName,
21
- },
22
- data: JSON.stringify(json),
23
- });
16
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
17
+ const res_ = yield BaseApi.create({
18
+ url: getBaseUrl() + `/api-public/v1/user/register`,
19
+ type: 'POST',
20
+ headers: {
21
+ 'Content-Type': 'application/json',
22
+ 'g-app': getConfig().config.appName,
23
+ },
24
+ data: JSON.stringify(json),
25
+ });
26
+ if (res_.result) {
27
+ Ad.gtagEvent('sign_up', {
28
+ method: 'normal'
29
+ });
30
+ Ad.fbqEvent('CompleteRegistration', {
31
+ method: 'normal'
32
+ });
33
+ }
34
+ resolve(res_);
35
+ }));
24
36
  }
25
37
  static quickRegister(json) {
26
38
  return BaseApi.create({
@@ -547,16 +559,35 @@ export class ApiUser {
547
559
  });
548
560
  }
549
561
  static login(json) {
550
- return BaseApi.create({
551
- url: getBaseUrl() + `/api-public/v1/user/login`,
552
- type: 'POST',
553
- headers: {
554
- 'Content-Type': 'application/json',
555
- 'g-app': json.app_name || getConfig().config.appName,
556
- Authorization: json.token,
557
- },
558
- data: JSON.stringify(json),
559
- });
562
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
563
+ const res_ = yield BaseApi.create({
564
+ url: getBaseUrl() + `/api-public/v1/user/login`,
565
+ type: 'POST',
566
+ headers: {
567
+ 'Content-Type': 'application/json',
568
+ 'g-app': json.app_name || getConfig().config.appName,
569
+ Authorization: json.token,
570
+ },
571
+ data: JSON.stringify(json),
572
+ });
573
+ if (res_.response.create_user_success) {
574
+ Ad.gtagEvent('sign_up', {
575
+ method: json.login_type || 'normal'
576
+ });
577
+ Ad.fbqEvent('CompleteRegistration', {
578
+ method: json.login_type || 'normal'
579
+ });
580
+ }
581
+ else {
582
+ Ad.gtagEvent('login', {
583
+ method: json.login_type || 'normal'
584
+ });
585
+ Ad.fbqEvent('Login', {
586
+ method: json.login_type || 'normal'
587
+ });
588
+ }
589
+ resolve(res_);
590
+ }));
560
591
  }
561
592
  static checkAdminAuth(cg) {
562
593
  return BaseApi.create({
@@ -2,17 +2,29 @@ import { BaseApi } from '../../glitterBundle/api/base.js';
2
2
  import { GlobalUser } from '../global/global-user.js';
3
3
  import { ApiShop } from './shopping.js';
4
4
  import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
5
+ import { Ad } from '../../public-components/public/ad.js';
5
6
 
6
7
  export class ApiUser {
7
8
  public static register(json: { account: string; pwd: string; userData: any }) {
8
- return BaseApi.create({
9
- url: getBaseUrl() + `/api-public/v1/user/register`,
10
- type: 'POST',
11
- headers: {
12
- 'Content-Type': 'application/json',
13
- 'g-app': getConfig().config.appName,
14
- },
15
- data: JSON.stringify(json),
9
+ return new Promise<{ result: boolean; response: any }>(async (resolve, reject) => {
10
+ const res_=await BaseApi.create({
11
+ url: getBaseUrl() + `/api-public/v1/user/register`,
12
+ type: 'POST',
13
+ headers: {
14
+ 'Content-Type': 'application/json',
15
+ 'g-app': getConfig().config.appName,
16
+ },
17
+ data: JSON.stringify(json),
18
+ });
19
+ if(res_.result){
20
+ Ad.gtagEvent( 'sign_up', {
21
+ method: 'normal' // 自訂參數,可略
22
+ })
23
+ Ad.fbqEvent('CompleteRegistration', {
24
+ method: 'normal' // 自訂參數,可略
25
+ });
26
+ }
27
+ resolve(res_)
16
28
  });
17
29
  }
18
30
 
@@ -627,16 +639,35 @@ export class ApiUser {
627
639
  pin?: string;
628
640
  redirect?: string;
629
641
  }) {
630
- return BaseApi.create({
631
- url: getBaseUrl() + `/api-public/v1/user/login`,
632
- type: 'POST',
633
- headers: {
634
- 'Content-Type': 'application/json',
635
- 'g-app': json.app_name || getConfig().config.appName,
636
- Authorization: json.token,
637
- },
638
- data: JSON.stringify(json),
639
- });
642
+
643
+ return new Promise<{ result: boolean; response: any }>(async (resolve, reject) => {
644
+ const res_=await BaseApi.create({
645
+ url: getBaseUrl() + `/api-public/v1/user/login`,
646
+ type: 'POST',
647
+ headers: {
648
+ 'Content-Type': 'application/json',
649
+ 'g-app': json.app_name || getConfig().config.appName,
650
+ Authorization: json.token,
651
+ },
652
+ data: JSON.stringify(json),
653
+ });
654
+ if(res_.response.create_user_success){
655
+ Ad.gtagEvent( 'sign_up', {
656
+ method: json.login_type || 'normal' // 自訂參數,可略
657
+ })
658
+ Ad.fbqEvent('CompleteRegistration', {
659
+ method: json.login_type || 'normal' // 自訂參數,可略
660
+ });
661
+ }else{
662
+ Ad.gtagEvent( 'login', {
663
+ method: json.login_type || 'normal' // 自訂參數,可略
664
+ })
665
+ Ad.fbqEvent('Login', {
666
+ method: json.login_type || 'normal' // 自訂參數,可略
667
+ });
668
+ }
669
+ resolve(res_)
670
+ })
640
671
  }
641
672
 
642
673
  public static checkAdminAuth(cg: { app: string; token: string }) {
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { init } from '../GVController.js';
11
11
  import { TriggerEvent } from './trigger-event.js';
12
12
  import { GlobalUser } from '../../glitter-base/global/global-user.js';
13
- import { FirstBanner } from '../../public-components/banner/first-banner.js';
14
13
  import { Language } from '../../glitter-base/global/language.js';
15
14
  import { ApplicationConfig } from '../../application-config.js';
16
15
  const html = String.raw;
@@ -91,7 +90,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
91
90
  return {
92
91
  onCreateView: () => {
93
92
  var _a, _b, _c, _d, _e, _f, _g, _h;
94
- FirstBanner.main({ gvc: gvc });
95
93
  if (gBundle.page_config.seo && gBundle.page_config.seo.type === 'custom' && gBundle.page_config.seo.title) {
96
94
  glitter.setUrlParameter('', undefined, [
97
95
  (_a = gBundle.page_config.seo.title_prefix) !== null && _a !== void 0 ? _a : '',
@@ -76,7 +76,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
76
76
 
77
77
  return {
78
78
  onCreateView: () => {
79
- FirstBanner.main({ gvc: gvc });
80
79
  //定義SEO TITLE
81
80
  if (gBundle.page_config.seo && gBundle.page_config.seo.type === 'custom' && gBundle.page_config.seo.title) {
82
81
  glitter.setUrlParameter(
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { BgWidget } from '../../backend-manager/bg-widget.js';
11
11
  import { ApiPageConfig } from '../../api/pageConfig.js';
12
- import { FirstBanner } from '../../public-components/banner/first-banner.js';
13
12
  import { GlobalWidget } from '../../editor-components/global-widget/global-widget.js';
14
13
  export class ToolSetting {
15
14
  static main(gvc) {
@@ -173,10 +172,7 @@ export class ToolSetting {
173
172
  const htmlGenerate = new gvc.glitter.htmlGenerate(widget_container, [], {
174
173
  editor_updated_callback: (oWidget) => {
175
174
  if (dd.tag === '廣告輪播') {
176
- FirstBanner.main({
177
- gvc: document.querySelector('.iframe_view').contentWindow.glitter.pageConfig[0].gvc,
178
- ed_widget: oWidget,
179
- });
175
+ console.log(`oWidget==>`, oWidget);
180
176
  }
181
177
  },
182
178
  }, true);
@@ -213,10 +213,11 @@ export class ToolSetting {
213
213
  {
214
214
  editor_updated_callback: (oWidget: any) => {
215
215
  if (dd.tag === '廣告輪播') {
216
- FirstBanner.main({
217
- gvc: (document.querySelector('.iframe_view') as any).contentWindow.glitter.pageConfig[0].gvc,
218
- ed_widget: oWidget,
219
- });
216
+ console.log(`oWidget==>`,oWidget)
217
+ // FirstBanner.main({
218
+ // gvc: (document.querySelector('.iframe_view') as any).contentWindow.glitter.pageConfig[0].gvc,
219
+ // // ed_widget: oWidget,
220
+ // });
220
221
  }
221
222
  },
222
223
  },
@@ -743,12 +743,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
743
743
  src: `fa-sharp fa-regular fa-globe guide-user-editor-11-icon`,
744
744
  index: 'color',
745
745
  hint: '全站樣式',
746
- },
747
- {
748
- src: `fa-regular fa-grid-2 design-guide-1-icon`,
749
- index: 'widget',
750
- hint: '設計元件',
751
- },
746
+ }
752
747
  ]
753
748
  .filter(dd => {
754
749
  if (gvc.glitter.getUrlParameter('device') === 'mobile') {
@@ -804,12 +804,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
804
804
  src: `fa-sharp fa-regular fa-globe guide-user-editor-11-icon`,
805
805
  index: 'color',
806
806
  hint: '全站樣式',
807
- },
808
- {
809
- src: `fa-regular fa-grid-2 design-guide-1-icon`,
810
- index: 'widget',
811
- hint: '設計元件',
812
- },
807
+ }
813
808
  ]
814
809
  .filter(dd => {
815
810
  if (gvc.glitter.getUrlParameter('device') === 'mobile') {
@@ -1099,7 +1099,6 @@ export class imageLibrary {
1099
1099
  if (cf.key === 'album') {
1100
1100
  dialog.successMessage({ text: '相簿建立成功' });
1101
1101
  cf.getSelect(selected);
1102
- gvc.closeDialog();
1103
1102
  return;
1104
1103
  }
1105
1104
  if (['image-manager', 'folderEdit'].includes(cf.key)) {
@@ -1225,7 +1225,7 @@ export class imageLibrary {
1225
1225
  if (cf.key === 'album') {
1226
1226
  dialog.successMessage({ text: '相簿建立成功' });
1227
1227
  cf.getSelect(selected);
1228
- gvc.closeDialog();
1228
+ // gvc.closeDialog();
1229
1229
  return;
1230
1230
  }
1231
1231
 
@@ -1178,7 +1178,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
1178
1178
  </div>`,
1179
1179
  ` <div class="mx-n3" style="background: #DDD;height: 1px;"></div>`,
1180
1180
  ].join(`<div style="height:18px;"></div>`);
1181
- if (app_editor || glitter.share.editorViewModel.selectItem.is_customer_header) {
1181
+ if (app_editor || ((glitter.share.editorViewModel.selectItem) && glitter.share.editorViewModel.selectItem.is_customer_header)) {
1182
1182
  global_setting_view = ``;
1183
1183
  }
1184
1184
  if (vm.page === 'editor') {
@@ -1355,7 +1355,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
1355
1355
  </div>`,
1356
1356
  ` <div class="mx-n3" style="background: #DDD;height: 1px;"></div>`,
1357
1357
  ].join(`<div style="height:18px;"></div>`);
1358
- if (app_editor || glitter.share.editorViewModel.selectItem.is_customer_header) {
1358
+ if (app_editor || ((glitter.share.editorViewModel.selectItem) && glitter.share.editorViewModel.selectItem.is_customer_header)) {
1359
1359
  global_setting_view = ``;
1360
1360
  }
1361
1361
  if (vm.page === 'editor') {
@@ -7,8 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { ApiPageConfig } from "../../api/pageConfig.js";
11
- import { GlobalWidget } from "../../glitterBundle/html-component/global-widget.js";
12
10
  const html = String.raw;
13
11
  const css = String.raw;
14
12
  export class FirstBanner {
@@ -39,50 +37,18 @@ export class FirstBanner {
39
37
  background: #393939!important;
40
38
  }
41
39
  `);
42
- const widget = obj.ed_widget || ((yield ApiPageConfig.getPage({
43
- appName: gvc.glitter.window.appName,
44
- type: 'template',
45
- tag: 'advertise',
46
- })).response.result[0]).config[0];
47
- (gvc.glitter.window.glitterInitialHelper).getPageData({
48
- tag: widget.data.tag,
49
- appName: widget.data.refer_app
50
- }, (d2) => {
51
- const data = d2.response.result[0];
52
- function getFormData(ref) {
53
- var _a, _b;
54
- ref = window.parent.glitter.share.updated_form_data[`${widget.refer_app}_${widget.tag}`] || ref;
55
- let formData = JSON.parse(JSON.stringify(ref || {}));
56
- if ((widget.data.refer_app)) {
57
- GlobalWidget.initialShowCaseData({
58
- widget: widget,
59
- gvc: gvc
60
- });
61
- if (gvc.glitter.document.body.clientWidth < 800 && widget.mobile.refer === 'custom') {
62
- ((_a = widget[`mobile_editable`]) !== null && _a !== void 0 ? _a : []).map((dd) => {
63
- formData[dd] = JSON.parse(JSON.stringify((widget.mobile.data.refer_form_data || data.page_config.formData)[dd] || {}));
64
- });
65
- }
66
- else if (gvc.glitter.document.body.clientWidth >= 800 && widget.desktop.refer === 'custom') {
67
- ((_b = widget[`desktop_editable`]) !== null && _b !== void 0 ? _b : []).map((dd) => {
68
- formData[dd] = JSON.parse(JSON.stringify((widget.desktop.data.refer_form_data || data.page_config.formData)[dd] || {}));
69
- });
70
- }
71
- }
72
- return formData;
73
- }
74
- const formData = getFormData((widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData);
75
- if (formData.list && formData.list.length) {
76
- obj.gvc.glitter.innerDialog((gvc) => {
77
- return gvc.bindView(() => {
78
- return {
79
- bind: id,
80
- view: () => {
81
- return html `
40
+ const formData = obj.widget.formData;
41
+ if (formData.list && formData.list.length) {
42
+ obj.gvc.glitter.innerDialog((gvc) => {
43
+ return gvc.bindView(() => {
44
+ return {
45
+ bind: id,
46
+ view: () => {
47
+ return html `
82
48
  <div class="swiper mySwiper_${id}" style="width:520px;max-width:100vw;height:auto !important;">
83
49
  <div class="swiper-wrapper">
84
50
  ${formData.list.map((dd) => {
85
- return html `
51
+ return html `
86
52
  <div class="swiper-slide pb-4 d-flex align-items-center justify-content-center position-relative"
87
53
  style="background: none;
88
54
  overflow: hidden;;
@@ -90,61 +56,60 @@ overflow: hidden;;
90
56
  <img src="${dd.img || 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}" style="width:520px;max-width:calc(100vw - 40px);max-height: 100vh;cursor: pointer;
91
57
  border-radius: 25px;
92
58
  " onclick="${gvc.event(() => {
93
- gvc.glitter.href = dd.link;
94
- gvc.closeDialog();
95
- })}" >
59
+ gvc.glitter.href = dd.link;
60
+ gvc.closeDialog();
61
+ })}" >
96
62
  <div class="position-absolute d-flex align-items-center justify-content-center"
97
63
  style="top:0px;right: 0px;width:50px;height: 50px;
98
64
  background: rgba(0,0,0,0.5);border-top-right-radius: 25px;border-bottom-left-radius: 10px;cursor: pointer;" onclick="${(() => {
99
- if (gvc.glitter.htmlGenerate.isEditMode()) {
100
- return gvc.editorEvent(() => {
101
- gvc.closeDialog();
102
- });
103
- }
104
- else {
105
- return gvc.event(() => {
106
- gvc.closeDialog();
107
- });
108
- }
109
- })()}">
65
+ if (gvc.glitter.htmlGenerate.isEditMode()) {
66
+ return gvc.editorEvent(() => {
67
+ gvc.closeDialog();
68
+ });
69
+ }
70
+ else {
71
+ return gvc.event(() => {
72
+ gvc.closeDialog();
73
+ });
74
+ }
75
+ })()}">
110
76
  <i class="fa-regular fa-circle-xmark text-white fs-5"
111
77
  ></i>
112
78
  </div>
113
79
  </div>
114
80
  `;
115
- }).join('')}
81
+ }).join('')}
116
82
  </div>
117
83
  <div class="swiper-pagination swiper-pagination-${id}"></div>
118
84
  </div>`;
119
- },
120
- divCreate: {
121
- class: `vw-100 vh-100 position-fixed ${id} d-flex align-items-center justify-content-center`,
122
- style: css `z-index: 999999;
85
+ },
86
+ divCreate: {
87
+ class: `vw-100 vh-100 position-fixed ${id} d-flex align-items-center justify-content-center`,
88
+ style: css `z-index: 999999;
123
89
  background: rgba(0, 0, 0, 0.5);`
124
- },
125
- onCreate: () => {
126
- const interval = setInterval(() => {
127
- if (gvc.glitter.window.Swiper) {
128
- const swiper = new gvc.glitter.window.Swiper(`.mySwiper_${id}`, {
129
- loop: true,
130
- pagination: {
131
- el: `.swiper-pagination-${id}`,
132
- clickable: true,
90
+ },
91
+ onCreate: () => {
92
+ const interval = setInterval(() => {
93
+ if (gvc.glitter.window.Swiper) {
94
+ const swiper = new gvc.glitter.window.Swiper(`.mySwiper_${id}`, {
95
+ loop: true,
96
+ pagination: {
97
+ el: `.swiper-pagination-${id}`,
98
+ clickable: true,
99
+ },
100
+ on: {
101
+ slideChange: function () {
133
102
  },
134
- on: {
135
- slideChange: function () {
136
- },
137
- },
138
- });
139
- clearTimeout(interval);
140
- }
141
- }, 100);
142
- }
143
- };
144
- });
145
- }, 'first-banner', {});
146
- }
147
- });
103
+ },
104
+ });
105
+ clearTimeout(interval);
106
+ }
107
+ }, 100);
108
+ }
109
+ };
110
+ });
111
+ }, 'first-banner', {});
112
+ }
148
113
  return ``;
149
114
  });
150
115
  }