ts-glitter 20.2.0 → 20.2.3

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/lowcode/Entry.js CHANGED
@@ -22,7 +22,6 @@ import { ApplicationConfig } from './application-config.js';
22
22
  export class Entry {
23
23
  static onCreate(glitter) {
24
24
  const originalReplaceState = history.replaceState;
25
- let count = 0;
26
25
  let last_replace = '';
27
26
  window.history.replaceState = function (data, unused, url) {
28
27
  if (last_replace !== url) {
@@ -144,7 +143,7 @@ export class Entry {
144
143
  }
145
144
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
146
145
  console.log(`Entry-time:`, window.renderClock.stop());
147
- glitter.share.editerVersion = 'V_20.2.0';
146
+ glitter.share.editerVersion = 'V_20.2.3';
148
147
  glitter.share.start = new Date();
149
148
  const vm = { appConfig: [] };
150
149
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -16,7 +16,6 @@ export class Entry {
16
16
  // 建立初始函式
17
17
  public static onCreate(glitter: Glitter) {
18
18
  const originalReplaceState = history.replaceState
19
- let count=0
20
19
  let last_replace=''
21
20
  window.history.replaceState = function(data: any, unused: string, url?: string | URL | null) {
22
21
  if(last_replace!==url){
@@ -146,7 +145,7 @@ export class Entry {
146
145
  }
147
146
  (window as any).renderClock = (window as any).renderClock ?? createClock();
148
147
  console.log(`Entry-time:`, (window as any).renderClock.stop());
149
- glitter.share.editerVersion = 'V_20.2.0';
148
+ glitter.share.editerVersion = 'V_20.2.3';
150
149
 
151
150
  glitter.share.start = new Date();
152
151
  const vm = { appConfig: [] };
@@ -52,6 +52,7 @@ export class Glitter {
52
52
  this.elementCallback = {};
53
53
  this.html = String.raw;
54
54
  this.promiseValueMap = {};
55
+ this.waiting_push_state = () => { };
55
56
  this.hidePageView = PageManager.hidePageView;
56
57
  this.showPageView = PageManager.showPageView;
57
58
  this.setHome = PageManager.setHome;
@@ -565,6 +566,9 @@ export class Glitter {
565
566
  if (this.getUrlParameter('appName')) {
566
567
  link.searchParams.set('appName', this.getUrlParameter('appName'));
567
568
  }
569
+ this.waiting_push_state = () => {
570
+ window.history.pushState({}, document.title, link.href);
571
+ };
568
572
  this.getModule(new URL('../official_event/page/change-page.js', import.meta.url).href, (cl) => {
569
573
  cl.changePage(link.searchParams.get('page') || link.pathname.substring(1), 'page', {});
570
574
  });
@@ -66,7 +66,7 @@ export class Glitter {
66
66
  } = {}
67
67
  public html = String.raw
68
68
  public promiseValueMap: any = {}
69
-
69
+ public waiting_push_state?:(()=>void) = ()=>{}
70
70
  get href() {
71
71
  return location.href
72
72
  }
@@ -82,7 +82,9 @@ export class Glitter {
82
82
  if(this.getUrlParameter('appName')){
83
83
  link.searchParams.set('appName',this.getUrlParameter('appName'))
84
84
  }
85
- // window.history.pushState({}, document.title, link.href);
85
+ this.waiting_push_state=()=>{
86
+ window.history.pushState({}, document.title, link.href);
87
+ }
86
88
  this.getModule(new URL('../official_event/page/change-page.js', import.meta.url).href, (cl) => {
87
89
  cl.changePage(link.searchParams.get('page') || link.pathname.substring(1), 'page', {})
88
90
  })
@@ -236,13 +236,18 @@ export class PageManager {
236
236
  }
237
237
  static setHistory(tag, type) {
238
238
  const glitter = Glitter.glitter;
239
- const search = glitter.root_path + Language.getLanguageLinkPrefix() + tag + glitter.window.location.search;
240
239
  try {
241
240
  if (['home', 'page'].find((dd) => {
242
241
  return dd === type;
243
242
  })) {
244
- window.history.pushState({}, glitter.document.title, search);
245
- glitter.pageConfig[glitter.pageConfig.length - 1].search = search;
243
+ if (glitter.waiting_push_state) {
244
+ glitter.waiting_push_state();
245
+ glitter.waiting_push_state = undefined;
246
+ }
247
+ else {
248
+ window.history.pushState({}, glitter.document.title, (glitter.root_path + Language.getLanguageLinkPrefix() + tag + glitter.window.location.search));
249
+ }
250
+ glitter.pageConfig[glitter.pageConfig.length - 1].search = glitter.root_path + Language.getLanguageLinkPrefix() + tag + glitter.window.location.search;
246
251
  }
247
252
  }
248
253
  catch (e) {
@@ -316,16 +316,19 @@ export class PageManager {
316
316
 
317
317
  public static setHistory(tag: string, type: string) {
318
318
  const glitter = Glitter.glitter;
319
- const search = glitter.root_path + Language.getLanguageLinkPrefix()+tag + glitter.window.location.search;
320
319
  try {
321
-
322
320
  if (['home', 'page'].find((dd) => {
323
321
  return dd === type
324
322
  })) {
325
- window.history.pushState({}, glitter.document.title, search);
326
- glitter.pageConfig[glitter.pageConfig.length - 1].search = search;
327
-
323
+ if(glitter.waiting_push_state){
324
+ glitter.waiting_push_state()
325
+ glitter.waiting_push_state=undefined
326
+ }else {
327
+ window.history.pushState({}, glitter.document.title, (glitter.root_path + Language.getLanguageLinkPrefix()+tag + glitter.window.location.search));
328
+ }
329
+ glitter.pageConfig[glitter.pageConfig.length - 1].search = glitter.root_path + Language.getLanguageLinkPrefix()+tag + glitter.window.location.search;
328
330
  }
331
+
329
332
  } catch (e) {
330
333
  }
331
334
  }
@@ -2972,7 +2972,7 @@ export class CheckoutIndex {
2972
2972
  const urlObject = new URL(originalUrl);
2973
2973
  urlObject.searchParams.set('EndCheckout', '1');
2974
2974
  const newUrl = urlObject.toString();
2975
- if (ApplicationConfig.device_type === 'ios') {
2975
+ if ((ApplicationConfig.device_type === 'ios') && ['jkopay', 'line_pay'].includes(vm.cartData.customer_info.payment_select)) {
2976
2976
  return `${ApplicationConfig.bundle_id}://?path=${encodeURIComponent(newUrl)}`;
2977
2977
  }
2978
2978
  else {
@@ -92,7 +92,6 @@ export class CheckoutIndex {
92
92
  width: obj?.circle?.width ?? 20,
93
93
  borderSize: obj?.circle?.borderSize ?? 16,
94
94
  };
95
-
96
95
  const textAttr = {
97
96
  value: obj?.text?.value ?? Language.text('loading'),
98
97
  visible: obj?.text?.visible === false ? false : true,
@@ -3220,7 +3219,7 @@ export class CheckoutIndex {
3220
3219
  const urlObject = new URL(originalUrl);
3221
3220
  urlObject.searchParams.set('EndCheckout', '1');
3222
3221
  const newUrl = urlObject.toString();
3223
- if (ApplicationConfig.device_type === 'ios') {
3222
+ if ((ApplicationConfig.device_type === 'ios') && ['jkopay','line_pay'].includes(vm.cartData.customer_info.payment_select)) {
3224
3223
  return `${ApplicationConfig.bundle_id}://?path=${encodeURIComponent(newUrl)}`;
3225
3224
  } else {
3226
3225
  return newUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "20.2.0",
3
+ "version": "20.2.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {