ts-glitter 15.9.8 → 15.9.9
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 +22 -7
- package/lowcode/Entry.ts +48 -32
- package/lowcode/jspage/editor.js +2 -2
- package/lowcode/jspage/editor.ts +2 -2
- package/package.json +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -79,7 +79,7 @@ export class Entry {
|
|
|
79
79
|
}
|
|
80
80
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
81
81
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
82
|
-
glitter.share.editerVersion = 'V_15.9.
|
|
82
|
+
glitter.share.editerVersion = 'V_15.9.9';
|
|
83
83
|
glitter.share.start = new Date();
|
|
84
84
|
const vm = {
|
|
85
85
|
appConfig: [],
|
|
@@ -178,7 +178,8 @@ export class Entry {
|
|
|
178
178
|
if (glitter.getUrlParameter('type') === 'editor') {
|
|
179
179
|
const dialog = new ShareDialog(glitter);
|
|
180
180
|
dialog.dataLoading({ visible: true, text: '後台載入中' });
|
|
181
|
-
Entry.toBackendEditor(glitter, () => {
|
|
181
|
+
Entry.toBackendEditor(glitter, () => {
|
|
182
|
+
});
|
|
182
183
|
}
|
|
183
184
|
else if (glitter.getUrlParameter('type') === 'htmlEditor') {
|
|
184
185
|
Entry.toHtmlEditor(glitter, vm, () => {
|
|
@@ -262,17 +263,19 @@ export class Entry {
|
|
|
262
263
|
}
|
|
263
264
|
}
|
|
264
265
|
static toBackendEditor(glitter, callback) {
|
|
266
|
+
const css = String.raw;
|
|
265
267
|
if (localStorage.getItem('on-pos') === 'true' && glitter.getUrlParameter('page') !== 'pos') {
|
|
266
268
|
localStorage.removeItem('on-pos');
|
|
267
269
|
location.href = glitter.root_path + 'pos?app-id=t_1725992531001';
|
|
268
270
|
}
|
|
269
|
-
glitter.addStyle(`
|
|
271
|
+
glitter.addStyle(css `
|
|
270
272
|
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');
|
|
271
273
|
@media (prefers-reduced-motion: no-preference) {
|
|
272
274
|
:root {
|
|
273
275
|
scroll-behavior: auto !important;
|
|
274
276
|
}
|
|
275
277
|
}
|
|
278
|
+
|
|
276
279
|
::-webkit-scrollbar {
|
|
277
280
|
width: 0px !important; /* 滚动条宽度 */
|
|
278
281
|
height: 0px !important;
|
|
@@ -322,6 +325,11 @@ export class Entry {
|
|
|
322
325
|
if (data.response.result.length === 0 && glitter.getUrlParameter('page') !== 'cms') {
|
|
323
326
|
glitter.setUrlParameter('page', data.response.redirect);
|
|
324
327
|
}
|
|
328
|
+
glitter.addStyle(css `
|
|
329
|
+
.page-box {
|
|
330
|
+
min-height: ${window.innerHeight}px !important;
|
|
331
|
+
}
|
|
332
|
+
`);
|
|
325
333
|
glitter.setHome('jspage/main.js', glitter.getUrlParameter('page'), {
|
|
326
334
|
appName: config.appName,
|
|
327
335
|
}, {
|
|
@@ -356,7 +364,9 @@ export class Entry {
|
|
|
356
364
|
{
|
|
357
365
|
src: 'https://kit.fontawesome.com/cccedec0f8.js',
|
|
358
366
|
},
|
|
359
|
-
], () => {
|
|
367
|
+
], () => {
|
|
368
|
+
}, () => {
|
|
369
|
+
});
|
|
360
370
|
glitter.addStyle(`
|
|
361
371
|
@media (prefers-reduced-motion: no-preference) {
|
|
362
372
|
:root {
|
|
@@ -390,7 +400,9 @@ export class Entry {
|
|
|
390
400
|
src: `${glitter.htmlGenerate.configureCDN(glitter.htmlGenerate.resourceHook(dd.js))}`,
|
|
391
401
|
type: 'module',
|
|
392
402
|
};
|
|
393
|
-
}), () => {
|
|
403
|
+
}), () => {
|
|
404
|
+
}, () => {
|
|
405
|
+
}, [{ key: 'async', value: 'true' }]);
|
|
394
406
|
glitter.htmlGenerate.loadScript(glitter, window.parent.editerData.setting
|
|
395
407
|
.filter((dd) => {
|
|
396
408
|
return ['widget', 'container', 'code'].indexOf(dd.type) === -1;
|
|
@@ -426,7 +438,9 @@ export class Entry {
|
|
|
426
438
|
{
|
|
427
439
|
src: `https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js`,
|
|
428
440
|
},
|
|
429
|
-
], () => {
|
|
441
|
+
], () => {
|
|
442
|
+
}, () => {
|
|
443
|
+
});
|
|
430
444
|
if (glitter.getUrlParameter('token') && glitter.getUrlParameter('return_type') === 'resetPassword') {
|
|
431
445
|
GlobalUser.token = glitter.getUrlParameter('token');
|
|
432
446
|
glitter.setUrlParameter('token');
|
|
@@ -459,7 +473,8 @@ export class Entry {
|
|
|
459
473
|
.map((dd) => {
|
|
460
474
|
return {
|
|
461
475
|
src: `${glitter.htmlGenerate.configureCDN(glitter.htmlGenerate.resourceHook(dd.js))}`,
|
|
462
|
-
callback: () => {
|
|
476
|
+
callback: () => {
|
|
477
|
+
},
|
|
463
478
|
};
|
|
464
479
|
}));
|
|
465
480
|
function authPass() {
|
package/lowcode/Entry.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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
|
+
import {Language} from './glitter-base/global/language.js';
|
|
10
10
|
|
|
11
11
|
export class Entry {
|
|
12
12
|
public static onCreate(glitter: Glitter) {
|
|
@@ -81,7 +81,7 @@ export class Entry {
|
|
|
81
81
|
|
|
82
82
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
83
83
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
84
|
-
glitter.share.editerVersion = 'V_15.9.
|
|
84
|
+
glitter.share.editerVersion = 'V_15.9.9';
|
|
85
85
|
glitter.share.start = new Date();
|
|
86
86
|
const vm: {
|
|
87
87
|
appConfig: any;
|
|
@@ -99,14 +99,14 @@ export class Entry {
|
|
|
99
99
|
Entry.resourceInitial(glitter, vm, async (dd) => {
|
|
100
100
|
glitter.addStyle(`
|
|
101
101
|
${
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
parseInt((window.parent as any).glitter.share.bottom_inset, 10)
|
|
103
|
+
? `
|
|
104
104
|
.update-bar-container {
|
|
105
105
|
padding-bottom: ${(window.parent as any).glitter.share.bottom_inset}px !important;
|
|
106
106
|
}
|
|
107
107
|
`
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
: ``
|
|
109
|
+
}
|
|
110
110
|
|
|
111
111
|
.editorParent .editorChild {
|
|
112
112
|
display: none;
|
|
@@ -186,9 +186,10 @@ export class Entry {
|
|
|
186
186
|
await Entry.globalStyle(glitter, dd);
|
|
187
187
|
if (glitter.getUrlParameter('type') === 'editor') {
|
|
188
188
|
const dialog = new ShareDialog(glitter);
|
|
189
|
-
dialog.dataLoading({
|
|
189
|
+
dialog.dataLoading({visible: true, text: '後台載入中'});
|
|
190
190
|
// 頁面編輯器
|
|
191
|
-
Entry.toBackendEditor(glitter, () => {
|
|
191
|
+
Entry.toBackendEditor(glitter, () => {
|
|
192
|
+
});
|
|
192
193
|
} else if (glitter.getUrlParameter('type') === 'htmlEditor') {
|
|
193
194
|
// Iframe預覽區塊
|
|
194
195
|
Entry.toHtmlEditor(glitter, vm, () => {
|
|
@@ -273,17 +274,19 @@ export class Entry {
|
|
|
273
274
|
|
|
274
275
|
// 跳轉至頁面編輯器
|
|
275
276
|
public static toBackendEditor(glitter: Glitter, callback: () => void) {
|
|
277
|
+
const css = String.raw
|
|
276
278
|
if (localStorage.getItem('on-pos') === 'true' && glitter.getUrlParameter('page') !== 'pos') {
|
|
277
279
|
localStorage.removeItem('on-pos');
|
|
278
280
|
location.href = glitter.root_path + 'pos?app-id=t_1725992531001';
|
|
279
281
|
}
|
|
280
|
-
glitter.addStyle(`
|
|
282
|
+
glitter.addStyle(css`
|
|
281
283
|
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');
|
|
282
284
|
@media (prefers-reduced-motion: no-preference) {
|
|
283
285
|
:root {
|
|
284
286
|
scroll-behavior: auto !important;
|
|
285
287
|
}
|
|
286
288
|
}
|
|
289
|
+
|
|
287
290
|
::-webkit-scrollbar {
|
|
288
291
|
width: 0px !important; /* 滚动条宽度 */
|
|
289
292
|
height: 0px !important;
|
|
@@ -340,6 +343,11 @@ export class Entry {
|
|
|
340
343
|
glitter.setUrlParameter('page', data.response.redirect);
|
|
341
344
|
}
|
|
342
345
|
|
|
346
|
+
glitter.addStyle(css`
|
|
347
|
+
.page-box {
|
|
348
|
+
min-height: ${window.innerHeight}px !important;
|
|
349
|
+
}
|
|
350
|
+
`)
|
|
343
351
|
glitter.setHome(
|
|
344
352
|
'jspage/main.js',
|
|
345
353
|
glitter.getUrlParameter('page'),
|
|
@@ -382,8 +390,10 @@ export class Entry {
|
|
|
382
390
|
src: 'https://kit.fontawesome.com/cccedec0f8.js',
|
|
383
391
|
},
|
|
384
392
|
],
|
|
385
|
-
() => {
|
|
386
|
-
|
|
393
|
+
() => {
|
|
394
|
+
},
|
|
395
|
+
() => {
|
|
396
|
+
}
|
|
387
397
|
);
|
|
388
398
|
glitter.addStyle(`
|
|
389
399
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -424,9 +434,11 @@ export class Entry {
|
|
|
424
434
|
type: 'module',
|
|
425
435
|
};
|
|
426
436
|
}),
|
|
427
|
-
() => {
|
|
428
|
-
|
|
429
|
-
|
|
437
|
+
() => {
|
|
438
|
+
},
|
|
439
|
+
() => {
|
|
440
|
+
},
|
|
441
|
+
[{key: 'async', value: 'true'}]
|
|
430
442
|
);
|
|
431
443
|
|
|
432
444
|
// Preload page script
|
|
@@ -447,7 +459,7 @@ export class Entry {
|
|
|
447
459
|
return eval(evals);
|
|
448
460
|
};
|
|
449
461
|
setTimeout(() => {
|
|
450
|
-
(window.parent as any).glitter.share.loading_dialog.dataLoading({
|
|
462
|
+
(window.parent as any).glitter.share.loading_dialog.dataLoading({text: '', visible: false});
|
|
451
463
|
}, 2000);
|
|
452
464
|
glitter.htmlGenerate.setHome({
|
|
453
465
|
app_config: vm.appConfig,
|
|
@@ -472,8 +484,10 @@ export class Entry {
|
|
|
472
484
|
src: `https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js`,
|
|
473
485
|
},
|
|
474
486
|
],
|
|
475
|
-
() => {
|
|
476
|
-
|
|
487
|
+
() => {
|
|
488
|
+
},
|
|
489
|
+
() => {
|
|
490
|
+
}
|
|
477
491
|
);
|
|
478
492
|
if (glitter.getUrlParameter('token') && glitter.getUrlParameter('return_type') === 'resetPassword') {
|
|
479
493
|
GlobalUser.token = glitter.getUrlParameter('token');
|
|
@@ -511,7 +525,8 @@ export class Entry {
|
|
|
511
525
|
.map((dd: any) => {
|
|
512
526
|
return {
|
|
513
527
|
src: `${glitter.htmlGenerate.configureCDN(glitter.htmlGenerate.resourceHook(dd.js))}`,
|
|
514
|
-
callback: () => {
|
|
528
|
+
callback: () => {
|
|
529
|
+
},
|
|
515
530
|
};
|
|
516
531
|
})
|
|
517
532
|
);
|
|
@@ -527,6 +542,7 @@ export class Entry {
|
|
|
527
542
|
});
|
|
528
543
|
callback();
|
|
529
544
|
}
|
|
545
|
+
|
|
530
546
|
const login_config = (window as any).login_config;
|
|
531
547
|
if (login_config.password_to_see && localStorage.getItem('password_to_see') !== login_config.shop_pwd) {
|
|
532
548
|
const pwd = window.prompt('請輸入網站密碼', '');
|
|
@@ -581,7 +597,7 @@ export class Entry {
|
|
|
581
597
|
},
|
|
582
598
|
{
|
|
583
599
|
webFunction: () => {
|
|
584
|
-
return {
|
|
600
|
+
return {data: 0};
|
|
585
601
|
},
|
|
586
602
|
}
|
|
587
603
|
);
|
|
@@ -594,7 +610,7 @@ export class Entry {
|
|
|
594
610
|
},
|
|
595
611
|
{
|
|
596
612
|
webFunction: () => {
|
|
597
|
-
return {
|
|
613
|
+
return {data: 0};
|
|
598
614
|
},
|
|
599
615
|
}
|
|
600
616
|
);
|
|
@@ -625,11 +641,11 @@ export class Entry {
|
|
|
625
641
|
glitter.addStyle(`
|
|
626
642
|
@charset "UTF-8";
|
|
627
643
|
${glitter.share.font_theme
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
644
|
+
.map((dd: any) => {
|
|
645
|
+
glitter.share.initial_fonts.push(dd.value);
|
|
646
|
+
return `@import url('https://fonts.googleapis.com/css2?family=${dd.value}&display=swap');`;
|
|
647
|
+
})
|
|
648
|
+
.join('\n')}
|
|
633
649
|
body {
|
|
634
650
|
font-family: '${glitter.share.font_theme[0].value}' !important;
|
|
635
651
|
font-optical-sizing: auto;
|
package/lowcode/jspage/editor.js
CHANGED
|
@@ -243,8 +243,8 @@ export class Editor {
|
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
return html `
|
|
246
|
-
<div class="position-relative
|
|
247
|
-
style="word-break: break-word;white-space: nowrap;background:whitesmoke;">
|
|
246
|
+
<div class="position-relative vw-100 overflow-auto"
|
|
247
|
+
style="word-break: break-word;white-space: nowrap;background:whitesmoke;height:${window.innerHeight}px;">
|
|
248
248
|
<header class="header navbar navbar-expand navbar-light bg-light border-bottom fixed-top "
|
|
249
249
|
data-scroll-header
|
|
250
250
|
style="${(parseInt(glitter.share.top_inset, 10)) ? `padding-top:${glitter.share.top_inset || 0}px;min-height: 56px;` : `height:56px;`}">
|
package/lowcode/jspage/editor.ts
CHANGED
|
@@ -244,8 +244,8 @@ export class Editor {
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
return html`
|
|
247
|
-
<div class="position-relative
|
|
248
|
-
style="word-break: break-word;white-space: nowrap;background:whitesmoke;">
|
|
247
|
+
<div class="position-relative vw-100 overflow-auto"
|
|
248
|
+
style="word-break: break-word;white-space: nowrap;background:whitesmoke;height:${window.innerHeight}px;">
|
|
249
249
|
<header class="header navbar navbar-expand navbar-light bg-light border-bottom fixed-top "
|
|
250
250
|
data-scroll-header
|
|
251
251
|
style="${(parseInt(glitter.share.top_inset, 10)) ? `padding-top:${glitter.share.top_inset || 0}px;min-height: 56px;` : `height:56px;`}">
|