ts-glitter 13.8.732 → 13.8.734

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 (32) hide show
  1. package/lowcode/Entry.js +10 -16
  2. package/lowcode/Entry.ts +65 -77
  3. package/lowcode/public-components/checkout/index.js +6 -0
  4. package/lowcode/public-components/checkout/index.ts +12 -0
  5. package/lowcode/public-components/user-manager/um-class.js +192 -41
  6. package/lowcode/public-components/user-manager/um-class.ts +214 -57
  7. package/lowcode/public-components/user-manager/um-info.js +68 -60
  8. package/lowcode/public-components/user-manager/um-info.ts +69 -59
  9. package/lowcode/public-components/user-manager/um-orderlist.js +2 -2
  10. package/lowcode/public-components/user-manager/um-orderlist.ts +2 -2
  11. package/lowcode/public-components/user-manager/um-rebate.js +2 -2
  12. package/lowcode/public-components/user-manager/um-rebate.ts +2 -2
  13. package/lowcode/public-components/user-manager/um-voucher.js +295 -0
  14. package/lowcode/public-components/user-manager/um-voucher.ts +345 -0
  15. package/lowcode/public-components/user-manager/um-wishlist.js +2 -2
  16. package/lowcode/public-components/user-manager/um-wishlist.ts +2 -2
  17. package/package.json +1 -1
  18. package/src/api-public/controllers/shop.js +133 -97
  19. package/src/api-public/controllers/shop.js.map +1 -1
  20. package/src/api-public/controllers/shop.ts +245 -182
  21. package/src/api-public/services/shopping.d.ts +1 -1
  22. package/src/api-public/services/shopping.js +6 -4
  23. package/src/api-public/services/shopping.js.map +1 -5
  24. package/src/api-public/services/shopping.ts +16 -12
  25. package/src/controllers/global-event.js.map +1 -1
  26. package/src/controllers/private_config.js.map +1 -1
  27. package/src/controllers/template.js.map +1 -1
  28. package/src/services/seo.js.map +1 -1
  29. package/src/services/template.d.ts +1 -1
  30. package/src/services/template.js +47 -43
  31. package/src/services/template.js.map +1 -1
  32. package/src/services/template.ts +203 -140
package/lowcode/Entry.js CHANGED
@@ -68,7 +68,7 @@ export class Entry {
68
68
  }
69
69
  window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
70
70
  console.log(`Entry-time:`, window.renderClock.stop());
71
- glitter.share.editerVersion = 'V_13.8.732';
71
+ glitter.share.editerVersion = 'V_13.8.734';
72
72
  glitter.share.start = new Date();
73
73
  const vm = {
74
74
  appConfig: [],
@@ -167,8 +167,7 @@ export class Entry {
167
167
  if (glitter.getUrlParameter('type') === 'editor') {
168
168
  const dialog = new ShareDialog(glitter);
169
169
  dialog.dataLoading({ visible: true, text: '後台載入中' });
170
- Entry.toBackendEditor(glitter, () => {
171
- });
170
+ Entry.toBackendEditor(glitter, () => { });
172
171
  }
173
172
  else if (glitter.getUrlParameter('type') === 'htmlEditor') {
174
173
  Entry.toHtmlEditor(glitter, vm, () => {
@@ -193,7 +192,7 @@ export class Entry {
193
192
  bind: id,
194
193
  view: () => {
195
194
  return SaasViewModel.createShop(gvc, true);
196
- }
195
+ },
197
196
  };
198
197
  });
199
198
  }, 'change_app');
@@ -251,7 +250,7 @@ export class Entry {
251
250
  }
252
251
  }
253
252
  static toBackendEditor(glitter, callback) {
254
- if ((localStorage.getItem('on-pos') === 'true') && glitter.getUrlParameter('page') !== 'pos') {
253
+ if (localStorage.getItem('on-pos') === 'true' && glitter.getUrlParameter('page') !== 'pos') {
255
254
  localStorage.removeItem('on-pos');
256
255
  location.href = glitter.root_path + 'pos?app-id=t_1725992531001';
257
256
  }
@@ -346,9 +345,7 @@ export class Entry {
346
345
  {
347
346
  src: 'https://kit.fontawesome.com/cccedec0f8.js',
348
347
  },
349
- ], () => {
350
- }, () => {
351
- });
348
+ ], () => { }, () => { });
352
349
  glitter.addStyle(`
353
350
  @media (prefers-reduced-motion: no-preference) {
354
351
  :root {
@@ -382,9 +379,7 @@ export class Entry {
382
379
  src: `${glitter.htmlGenerate.configureCDN(glitter.htmlGenerate.resourceHook(dd.js))}`,
383
380
  type: 'module',
384
381
  };
385
- }), () => {
386
- }, () => {
387
- }, [{ key: 'async', value: 'true' }]);
382
+ }), () => { }, () => { }, [{ key: 'async', value: 'true' }]);
388
383
  glitter.htmlGenerate.loadScript(glitter, window.parent.editerData.setting
389
384
  .filter((dd) => {
390
385
  return ['widget', 'container', 'code'].indexOf(dd.type) === -1;
@@ -448,8 +443,7 @@ export class Entry {
448
443
  .map((dd) => {
449
444
  return {
450
445
  src: `${glitter.htmlGenerate.configureCDN(glitter.htmlGenerate.resourceHook(dd.js))}`,
451
- callback: () => {
452
- },
446
+ callback: () => { },
453
447
  };
454
448
  }));
455
449
  function authPass() {
@@ -481,14 +475,14 @@ export class Entry {
481
475
  }
482
476
  static resourceInitial(glitter, vm, callback) {
483
477
  glitter.runJsInterFace('getTopInset', {}, (response) => {
484
- glitter.share.top_inset = (response.data);
478
+ glitter.share.top_inset = response.data;
485
479
  }, {
486
480
  webFunction: () => {
487
481
  return { data: 0 };
488
482
  },
489
483
  });
490
484
  glitter.runJsInterFace('getBottomInset', {}, (response) => {
491
- glitter.share.bottom_inset = (response.data);
485
+ glitter.share.bottom_inset = response.data;
492
486
  }, {
493
487
  webFunction: () => {
494
488
  return { data: 0 };
@@ -588,7 +582,7 @@ export class Entry {
588
582
  loopVersion();
589
583
  }, 1000 * 300);
590
584
  }
591
- }
585
+ },
592
586
  });
593
587
  }
594
588
  else {
package/lowcode/Entry.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  'use strict';
2
- import {Glitter} from './glitterBundle/Glitter.js';
3
- import {config} from './config.js';
4
- import {ApiPageConfig} from './api/pageConfig.js';
5
- import {BaseApi} from './glitterBundle/api/base.js';
6
- import {GlobalUser} from './glitter-base/global/global-user.js';
7
- import {EditorConfig} from './editor-config.js';
8
- import {ShareDialog} from './glitterBundle/dialog/ShareDialog.js';
9
-
2
+ import { Glitter } from './glitterBundle/Glitter.js';
3
+ import { config } from './config.js';
4
+ import { ApiPageConfig } from './api/pageConfig.js';
5
+ import { BaseApi } from './glitterBundle/api/base.js';
6
+ import { GlobalUser } from './glitter-base/global/global-user.js';
7
+ import { EditorConfig } from './editor-config.js';
8
+ import { ShareDialog } from './glitterBundle/dialog/ShareDialog.js';
10
9
 
11
10
  export class Entry {
12
11
  public static onCreate(glitter: Glitter) {
@@ -14,7 +13,7 @@ export class Entry {
14
13
  (window as any).appName = app_name || (window as any).appName;
15
14
  (window as any).glitter_page = page;
16
15
  location.reload();
17
- }
16
+ };
18
17
  glitter.share.top_inset = 0;
19
18
  glitter.share.bottom_inset = 0;
20
19
  glitter.share.reload_code_hash = function () {
@@ -69,7 +68,7 @@ export class Entry {
69
68
  }
70
69
  (window as any).renderClock = (window as any).renderClock ?? clockF();
71
70
  console.log(`Entry-time:`, (window as any).renderClock.stop());
72
- glitter.share.editerVersion = 'V_13.8.732';
71
+ glitter.share.editerVersion = 'V_13.8.734';
73
72
  glitter.share.start = new Date();
74
73
  const vm: {
75
74
  appConfig: any;
@@ -88,14 +87,14 @@ export class Entry {
88
87
  Entry.resourceInitial(glitter, vm, async (dd) => {
89
88
  glitter.addStyle(`
90
89
  ${
91
- parseInt((window.parent as any).glitter.share.bottom_inset, 10)
92
- ? `
90
+ parseInt((window.parent as any).glitter.share.bottom_inset, 10)
91
+ ? `
93
92
  .update-bar-container {
94
93
  padding-bottom: ${(window.parent as any).glitter.share.bottom_inset}px !important;
95
94
  }
96
95
  `
97
- : ``
98
- }
96
+ : ``
97
+ }
99
98
 
100
99
  .editorParent .editorChild {
101
100
  display: none;
@@ -176,10 +175,9 @@ export class Entry {
176
175
  await Entry.globalStyle(glitter, dd);
177
176
  if (glitter.getUrlParameter('type') === 'editor') {
178
177
  const dialog = new ShareDialog(glitter);
179
- dialog.dataLoading({visible: true, text: '後台載入中'});
178
+ dialog.dataLoading({ visible: true, text: '後台載入中' });
180
179
  // 頁面編輯器
181
- Entry.toBackendEditor(glitter, () => {
182
- });
180
+ Entry.toBackendEditor(glitter, () => {});
183
181
  } else if (glitter.getUrlParameter('type') === 'htmlEditor') {
184
182
  // Iframe預覽區塊
185
183
  Entry.toHtmlEditor(glitter, vm, () => {
@@ -188,14 +186,11 @@ export class Entry {
188
186
  } else if (glitter.getUrlParameter('page') === 'backend_manager') {
189
187
  if (!GlobalUser.token) {
190
188
  glitter.setUrlParameter('page', 'login');
191
- location.reload()
189
+ location.reload();
192
190
  } else {
193
191
  try {
194
- const appList = (await ApiPageConfig.getAppList(
195
- undefined,
196
- GlobalUser.token
197
- )).response.result;
198
- localStorage.setItem('select_item', '0')
192
+ const appList = (await ApiPageConfig.getAppList(undefined, GlobalUser.token)).response.result;
193
+ localStorage.setItem('select_item', '0');
199
194
  if (appList.length === 0) {
200
195
  glitter.getModule(new URL('./view-model/saas-view-model.js', location.href).href, (SaasViewModel) => {
201
196
  glitter.innerDialog((gvc) => {
@@ -204,29 +199,30 @@ export class Entry {
204
199
  return {
205
200
  bind: id,
206
201
  view: () => {
207
- return SaasViewModel.createShop(gvc, true)
208
- }
209
- }
210
- })
211
-
212
- }, 'change_app')
213
- })
202
+ return SaasViewModel.createShop(gvc, true);
203
+ },
204
+ };
205
+ });
206
+ }, 'change_app');
207
+ });
214
208
  } else {
215
209
  let appName = appList[0].appName;
216
- if (appList.find((dd: any) => {
217
- return dd.appName === localStorage.getItem('select_app_name')
218
- })) {
219
- appName = localStorage.getItem('select_app_name')
210
+ if (
211
+ appList.find((dd: any) => {
212
+ return dd.appName === localStorage.getItem('select_app_name');
213
+ })
214
+ ) {
215
+ appName = localStorage.getItem('select_app_name');
220
216
  }
221
- glitter.setUrlParameter('page', 'index')
222
- glitter.setUrlParameter('type', 'editor')
223
- glitter.setUrlParameter('appName', appName)
224
- glitter.setUrlParameter('function', 'backend-manger')
225
- location.reload()
217
+ glitter.setUrlParameter('page', 'index');
218
+ glitter.setUrlParameter('type', 'editor');
219
+ glitter.setUrlParameter('appName', appName);
220
+ glitter.setUrlParameter('function', 'backend-manger');
221
+ location.reload();
226
222
  }
227
223
  } catch (e) {
228
224
  glitter.setUrlParameter('page', 'login');
229
- location.reload()
225
+ location.reload();
230
226
  }
231
227
  }
232
228
  } else {
@@ -265,8 +261,8 @@ export class Entry {
265
261
 
266
262
  // 跳轉至頁面編輯器
267
263
  public static toBackendEditor(glitter: Glitter, callback: () => void) {
268
- if ((localStorage.getItem('on-pos') === 'true') && glitter.getUrlParameter('page') !== 'pos') {
269
- localStorage.removeItem('on-pos')
264
+ if (localStorage.getItem('on-pos') === 'true' && glitter.getUrlParameter('page') !== 'pos') {
265
+ localStorage.removeItem('on-pos');
270
266
  location.href = glitter.root_path + 'pos?app-id=t_1725992531001';
271
267
  }
272
268
  glitter.addStyle(`
@@ -375,10 +371,8 @@ export class Entry {
375
371
  src: 'https://kit.fontawesome.com/cccedec0f8.js',
376
372
  },
377
373
  ],
378
- () => {
379
- },
380
- () => {
381
- }
374
+ () => {},
375
+ () => {}
382
376
  );
383
377
  glitter.addStyle(`
384
378
  @media (prefers-reduced-motion: no-preference) {
@@ -419,11 +413,9 @@ export class Entry {
419
413
  type: 'module',
420
414
  };
421
415
  }),
422
- () => {
423
- },
424
- () => {
425
- },
426
- [{key: 'async', value: 'true'}]
416
+ () => {},
417
+ () => {},
418
+ [{ key: 'async', value: 'true' }]
427
419
  );
428
420
 
429
421
  // Preload page script
@@ -444,7 +436,7 @@ export class Entry {
444
436
  return eval(evals);
445
437
  };
446
438
  setTimeout(() => {
447
- (window.parent as any).glitter.share.loading_dialog.dataLoading({text: '', visible: false});
439
+ (window.parent as any).glitter.share.loading_dialog.dataLoading({ text: '', visible: false });
448
440
  }, 2000);
449
441
  glitter.htmlGenerate.setHome({
450
442
  app_config: vm.appConfig,
@@ -499,8 +491,7 @@ export class Entry {
499
491
  .map((dd: any) => {
500
492
  return {
501
493
  src: `${glitter.htmlGenerate.configureCDN(glitter.htmlGenerate.resourceHook(dd.js))}`,
502
- callback: () => {
503
- },
494
+ callback: () => {},
504
495
  };
505
496
  })
506
497
  );
@@ -545,11 +536,11 @@ export class Entry {
545
536
  'getTopInset',
546
537
  {},
547
538
  (response: any) => {
548
- glitter.share.top_inset = (response.data);
539
+ glitter.share.top_inset = response.data;
549
540
  },
550
541
  {
551
542
  webFunction: () => {
552
- return {data: 0};
543
+ return { data: 0 };
553
544
  },
554
545
  }
555
546
  );
@@ -558,11 +549,11 @@ export class Entry {
558
549
  'getBottomInset',
559
550
  {},
560
551
  (response: any) => {
561
- glitter.share.bottom_inset = (response.data);
552
+ glitter.share.bottom_inset = response.data;
562
553
  },
563
554
  {
564
555
  webFunction: () => {
565
- return {data: 0};
556
+ return { data: 0 };
566
557
  },
567
558
  }
568
559
  );
@@ -593,11 +584,11 @@ export class Entry {
593
584
  glitter.addStyle(`
594
585
  @charset "UTF-8";
595
586
  ${glitter.share.font_theme
596
- .map((dd: any) => {
597
- glitter.share.initial_fonts.push(dd.value);
598
- return `@import url('https://fonts.googleapis.com/css2?family=${dd.value}&display=swap');`;
599
- })
600
- .join('\n')}
587
+ .map((dd: any) => {
588
+ glitter.share.initial_fonts.push(dd.value);
589
+ return `@import url('https://fonts.googleapis.com/css2?family=${dd.value}&display=swap');`;
590
+ })
591
+ .join('\n')}
601
592
  body {
602
593
  font-family: '${glitter.share.font_theme[0].value}' !important;
603
594
  font-optical-sizing: auto;
@@ -650,32 +641,31 @@ export class Entry {
650
641
  ApiPageConfig.getGlitterVersion().then((res) => {
651
642
  console.log('glitterVersion:', res.response.result);
652
643
  if (!glitter.share.editerVersion.includes(res.response.result)) {
653
- const dialog = new ShareDialog(glitter)
644
+ const dialog = new ShareDialog(glitter);
654
645
  dialog.checkYesOrNot({
655
646
  text: '新版本已發佈,是否進行更新?',
656
647
  callback: (response) => {
657
648
  if (response) {
658
- location.reload()
649
+ location.reload();
659
650
  } else {
660
651
  setTimeout(() => {
661
- loopVersion()
662
- }, 1000 * 300)
652
+ loopVersion();
653
+ }, 1000 * 300);
663
654
  }
664
- }
665
- })
655
+ },
656
+ });
666
657
  } else {
667
658
  setTimeout(() => {
668
- loopVersion()
669
- }, 1000 * 300)
659
+ loopVersion();
660
+ }, 1000 * 300);
670
661
  }
671
-
672
- })
662
+ });
673
663
  }
674
664
 
675
665
  if (glitter.getUrlParameter('type') === 'editor' || glitter.getUrlParameter('page') === 'pos') {
676
666
  setTimeout(() => {
677
- loopVersion()
678
- }, 1000 * 300)
667
+ loopVersion();
668
+ }, 1000 * 300);
679
669
  }
680
670
 
681
671
  let countI = dd.response.data.initialList.length;
@@ -736,8 +726,6 @@ export class Entry {
736
726
  glitter.setUrlParameter('page', 'login');
737
727
  }
738
728
  }
739
-
740
-
741
729
  }
742
730
 
743
731
  let clockF = () => {
@@ -0,0 +1,6 @@
1
+ const html = String.raw;
2
+ export class UMInfo {
3
+ static main(gvc, widget, subData) {
4
+ return 'checkout 1234';
5
+ }
6
+ }
@@ -0,0 +1,12 @@
1
+ import { GVC } from '../../glitterBundle/GVController.js';
2
+ import { ApiShop } from '../../glitter-base/route/shopping.js';
3
+ import { GlobalUser } from '../../glitter-base/global/global-user.js';
4
+ import { CheckInput } from '../../modules/checkInput.js';
5
+
6
+ const html = String.raw;
7
+
8
+ export class UMInfo {
9
+ static main(gvc: GVC, widget: any, subData: any) {
10
+ return 'checkout 1234';
11
+ }
12
+ }