ts-glitter 13.7.9 → 13.8.1
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 +1 -1
- package/lowcode/Entry.ts +2 -1
- package/lowcode/backend-manager/bg-customer-message.js +15 -12
- package/lowcode/backend-manager/bg-customer-message.ts +16 -13
- package/lowcode/backend-manager/bg-guide.js +4 -4
- package/lowcode/backend-manager/bg-guide.ts +4 -4
- package/lowcode/backend-manager/bg-shopping.js +4 -4
- package/lowcode/backend-manager/bg-shopping.ts +4 -4
- package/lowcode/backend-manager/bg-sns.js +18 -3
- package/lowcode/backend-manager/bg-sns.ts +19 -3
- package/lowcode/backend-manager/bg-widget.js +88 -10
- package/lowcode/backend-manager/bg-widget.ts +88 -16
- package/lowcode/cms-plugin/customer-message-user.js +1 -1
- package/lowcode/cms-plugin/customer-message-user.ts +1 -1
- package/lowcode/cms-plugin/line-auto-reply.js +2 -2
- package/lowcode/cms-plugin/line-auto-reply.ts +2 -2
- package/lowcode/cms-plugin/module/form-module.js +71 -60
- package/lowcode/cms-plugin/module/form-module.ts +315 -301
- package/lowcode/cms-plugin/shopping-finance-setting.js +16 -3
- package/lowcode/cms-plugin/shopping-finance-setting.ts +16 -3
- package/lowcode/cms-plugin/shopping-product-setting.js +150 -24
- package/lowcode/cms-plugin/shopping-product-setting.ts +181 -22
- package/lowcode/cms-plugin/shopping-product-text.js +254 -37
- package/lowcode/cms-plugin/shopping-product-text.ts +275 -30
- package/lowcode/cms-plugin/sns-auto-reply.js +19 -1
- package/lowcode/cms-plugin/sns-auto-reply.ts +19 -1
- package/lowcode/css/editor.css +9 -4
- package/lowcode/editor/add-component.js +290 -98
- package/lowcode/editor/add-component.ts +992 -787
- package/lowcode/editor/basic-component.js +1 -1
- package/lowcode/editor/basic-component.ts +1 -1
- package/lowcode/glitter-base/route/ai-chat.js +12 -0
- package/lowcode/glitter-base/route/ai-chat.ts +14 -1
- package/lowcode/glitterBundle/html-component/custom-style.js +4 -4
- package/lowcode/glitterBundle/html-component/custom-style.ts +4 -4
- package/lowcode/glitterBundle/module/html-generate.js +14 -0
- package/lowcode/glitterBundle/module/html-generate.ts +54 -29
- package/lowcode/glitterBundle/plugins/editor-elem.js +637 -757
- package/lowcode/glitterBundle/plugins/editor-elem.ts +1314 -1554
- package/lowcode/jspage/editor.js +2 -1
- package/lowcode/jspage/editor.ts +2 -1
- package/lowcode/jspage/function-page/main_editor.js +19 -6
- package/lowcode/jspage/function-page/main_editor.ts +34 -20
- package/lowcode/jspage/function-page/setting_editor.ts +2 -1
- package/lowcode/jspage/main.js +134 -9
- package/lowcode/jspage/main.ts +142 -9
- package/lowcode/modules/tool.js +13 -0
- package/lowcode/modules/tool.ts +17 -0
- package/lowcode/official_event/page/change-page.ts +1 -0
- package/lowcode/public-components/headers/sy-02.js +13 -10
- package/lowcode/public-components/headers/sy-02.ts +12 -9
- package/package.json +2 -2
- package/src/api-public/controllers/ai-chat.js +12 -0
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/ai-chat.ts +13 -0
- package/src/api-public/controllers/app-release.js.map +1 -1
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/fb-message.js.map +1 -1
- package/src/api-public/controllers/line-message.js.map +1 -1
- package/src/api-public/controllers/post.js.map +1 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/services/ai-robot.d.ts +7 -0
- package/src/api-public/services/ai-robot.js +83 -0
- package/src/api-public/services/ai-robot.js.map +1 -1
- package/src/api-public/services/ai-robot.ts +80 -0
- package/src/api-public/services/line-message.js.map +1 -1
- package/src/api-public/services/notify.js.map +1 -1
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/shopping.d.ts +1 -1
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/controllers/ai.js +0 -1
- package/src/controllers/ai.js.map +1 -1
- package/src/controllers/ai.ts +0 -1
- package/src/index.js +3 -3
- package/src/index.js.map +1 -1
- package/src/services/ai.js +2 -2
- package/src/services/ai.js.map +1 -1
- package/src/services/ai.ts +2 -2
package/lowcode/Entry.js
CHANGED
|
@@ -59,7 +59,7 @@ export class Entry {
|
|
|
59
59
|
}
|
|
60
60
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
61
61
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
62
|
-
glitter.share.editerVersion = "V_13.
|
|
62
|
+
glitter.share.editerVersion = "V_13.8.1";
|
|
63
63
|
glitter.share.start = (new Date());
|
|
64
64
|
const vm = {
|
|
65
65
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {ShareDialog} from "./glitterBundle/dialog/ShareDialog.js";
|
|
|
9
9
|
|
|
10
10
|
export class Entry {
|
|
11
11
|
public static onCreate(glitter: Glitter) {
|
|
12
|
+
|
|
12
13
|
glitter.share.top_inset = 0
|
|
13
14
|
glitter.share.bottom_inset = 0
|
|
14
15
|
glitter.share.reload_code_hash = function () {
|
|
@@ -59,7 +60,7 @@ export class Entry {
|
|
|
59
60
|
}
|
|
60
61
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
61
62
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
62
|
-
glitter.share.editerVersion = "V_13.
|
|
63
|
+
glitter.share.editerVersion = "V_13.8.1";
|
|
63
64
|
glitter.share.start = (new Date());
|
|
64
65
|
const vm: {
|
|
65
66
|
appConfig: any;
|
|
@@ -115,18 +115,21 @@ export class BgCustomerMessage {
|
|
|
115
115
|
alt="Albert Flores">
|
|
116
116
|
<div class="d-flex px-1 text-white align-items-center" style="gap:8px;">
|
|
117
117
|
<h6 class="mb-0 text-white " style="">一站式客服整合系統</h6>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
118
|
+
${BgWidget.iconButton({
|
|
119
|
+
icon: 'question',
|
|
120
|
+
event: gvc.event(() => {
|
|
121
|
+
BgWidget.dialog({
|
|
122
|
+
gvc,
|
|
123
|
+
title: '提示',
|
|
124
|
+
innerHTML: () => {
|
|
125
|
+
return `<div class="w-100" style="white-space:normal;word-break: break-all;">${BgWidget.grayNote([`*單一後台即可管理各渠道訊息`, `*前往第三方整合設定,設定Line與Facebook官方訊息串接`, `*為確保訊息同步,請統一透過SHOPNEX後台發送訊息`].map((dd) => {
|
|
126
|
+
return `<div style="letter-spacing: 1.2px;white-space:normal;word-break: break-all;">${dd}</div>`;
|
|
127
|
+
}).join('<div class="my-1"></div>'))}</div>`;
|
|
128
|
+
},
|
|
129
|
+
width: 250
|
|
130
|
+
});
|
|
131
|
+
})
|
|
132
|
+
})}
|
|
130
133
|
</div>
|
|
131
134
|
<div class="flex-fill" style="flex: 1;"></div>
|
|
132
135
|
<i class="fa-regular fa-circle-xmark text-white fs-3 " aria-hidden="true"
|
|
@@ -131,19 +131,22 @@ export class BgCustomerMessage {
|
|
|
131
131
|
alt="Albert Flores">
|
|
132
132
|
<div class="d-flex px-1 text-white align-items-center" style="gap:8px;">
|
|
133
133
|
<h6 class="mb-0 text-white " style="">一站式客服整合系統</h6>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
${BgWidget.iconButton(
|
|
135
|
+
{
|
|
136
|
+
icon: 'question',
|
|
137
|
+
event: gvc.event(() => {
|
|
138
|
+
BgWidget.dialog({
|
|
139
|
+
gvc,
|
|
140
|
+
title: '提示',
|
|
141
|
+
innerHTML: () => {
|
|
142
|
+
return `<div class="w-100" style="white-space:normal;word-break: break-all;">${BgWidget.grayNote([`*單一後台即可管理各渠道訊息`, `*前往第三方整合設定,設定Line與Facebook官方訊息串接`, `*為確保訊息同步,請統一透過SHOPNEX後台發送訊息`].map((dd) => {
|
|
143
|
+
return `<div style="letter-spacing: 1.2px;white-space:normal;word-break: break-all;">${dd}</div>`
|
|
144
|
+
}).join('<div class="my-1"></div>'))}</div>`
|
|
145
|
+
},
|
|
146
|
+
width: 250
|
|
147
|
+
});
|
|
148
|
+
})
|
|
149
|
+
}
|
|
147
150
|
)}
|
|
148
151
|
</div>
|
|
149
152
|
<div class="flex-fill" style="flex: 1;"></div>
|
|
@@ -1624,8 +1624,8 @@ export class BgGuide {
|
|
|
1624
1624
|
return this.drawBGwithBelowWindow(BG, vm, '.guide5-5', 'productInit', 5, 8, {
|
|
1625
1625
|
width: 332,
|
|
1626
1626
|
height: 209,
|
|
1627
|
-
title: '
|
|
1628
|
-
content: '
|
|
1627
|
+
title: '售價',
|
|
1628
|
+
content: '輸入商品的售價',
|
|
1629
1629
|
previewEvent: () => {
|
|
1630
1630
|
this.findIframeDom('.guide5-4').parentElement.parentElement.scrollIntoView();
|
|
1631
1631
|
},
|
|
@@ -1637,8 +1637,8 @@ export class BgGuide {
|
|
|
1637
1637
|
return this.drawBGwithBelowWindow(BG, vm, '.guide5-5', 'productInit', 5, 8, {
|
|
1638
1638
|
width: 332,
|
|
1639
1639
|
height: 209,
|
|
1640
|
-
title: '
|
|
1641
|
-
content: '
|
|
1640
|
+
title: '售價',
|
|
1641
|
+
content: '輸入商品的售價',
|
|
1642
1642
|
disable: true,
|
|
1643
1643
|
previewEvent: () => {
|
|
1644
1644
|
this.findIframeDom('.guide5-4').parentElement.parentElement.scrollIntoView();
|
|
@@ -1862,8 +1862,8 @@ export class BgGuide {
|
|
|
1862
1862
|
return this.drawBGwithBelowWindow(BG, vm, '.guide5-5', 'productInit', 5, 8, {
|
|
1863
1863
|
width: 332,
|
|
1864
1864
|
height: 209,
|
|
1865
|
-
title: '
|
|
1866
|
-
content: '
|
|
1865
|
+
title: '售價',
|
|
1866
|
+
content: '輸入商品的售價',
|
|
1867
1867
|
previewEvent: () => {
|
|
1868
1868
|
this.findIframeDom('.guide5-4').parentElement.parentElement.scrollIntoView();
|
|
1869
1869
|
},
|
|
@@ -1877,8 +1877,8 @@ export class BgGuide {
|
|
|
1877
1877
|
return this.drawBGwithBelowWindow(BG, vm, '.guide5-5', 'productInit', 5, 8, {
|
|
1878
1878
|
width: 332,
|
|
1879
1879
|
height: 209,
|
|
1880
|
-
title: '
|
|
1881
|
-
content: '
|
|
1880
|
+
title: '售價',
|
|
1881
|
+
content: '輸入商品的售價',
|
|
1882
1882
|
disable: true,
|
|
1883
1883
|
previewEvent: () => {
|
|
1884
1884
|
this.findIframeDom('.guide5-4').parentElement.parentElement.scrollIntoView();
|
|
@@ -2295,8 +2295,8 @@ ${EditorElem.editeInput({
|
|
|
2295
2295
|
html `<div class="w-100 bgf6 d-flex">
|
|
2296
2296
|
<div style=" width:calc(100% / 7 - 90px);"></div>
|
|
2297
2297
|
<div style=" width:${wi};padding-left:10px; ">子類</div>
|
|
2298
|
-
<div style=" width:${wi}; "
|
|
2299
|
-
<div style=" width:${wi}; "
|
|
2298
|
+
<div style=" width:${wi}; ">售價</div>
|
|
2299
|
+
<div style=" width:${wi}; ">原價</div>
|
|
2300
2300
|
<div style=" width:${wi}; ">存貨數量</div>
|
|
2301
2301
|
<div style=" width:${wi};">存貨單位(SKU)</div>
|
|
2302
2302
|
<div style=" width:${wi};margin-left: 20px;">運費權重</div>
|
|
@@ -2417,7 +2417,7 @@ ${EditorElem.editeInput({
|
|
|
2417
2417
|
}),
|
|
2418
2418
|
EditorElem.editeInput({
|
|
2419
2419
|
gvc: obj.gvc,
|
|
2420
|
-
title: '
|
|
2420
|
+
title: '售價',
|
|
2421
2421
|
default: `${(_b = dd.sale_price) !== null && _b !== void 0 ? _b : 0}`,
|
|
2422
2422
|
placeHolder: '',
|
|
2423
2423
|
type: 'number',
|
|
@@ -2427,7 +2427,7 @@ ${EditorElem.editeInput({
|
|
|
2427
2427
|
}),
|
|
2428
2428
|
EditorElem.editeInput({
|
|
2429
2429
|
gvc: obj.gvc,
|
|
2430
|
-
title: '
|
|
2430
|
+
title: '原價',
|
|
2431
2431
|
default: `${(_c = dd.compare_price) !== null && _c !== void 0 ? _c : 0}`,
|
|
2432
2432
|
placeHolder: '',
|
|
2433
2433
|
type: 'number',
|
|
@@ -2502,8 +2502,8 @@ ${EditorElem.editeInput({
|
|
|
2502
2502
|
html`<div class="w-100 bgf6 d-flex">
|
|
2503
2503
|
<div style=" width:calc(100% / 7 - 90px);"></div>
|
|
2504
2504
|
<div style=" width:${wi};padding-left:10px; ">子類</div>
|
|
2505
|
-
<div style=" width:${wi}; "
|
|
2506
|
-
<div style=" width:${wi}; "
|
|
2505
|
+
<div style=" width:${wi}; ">售價</div>
|
|
2506
|
+
<div style=" width:${wi}; ">原價</div>
|
|
2507
2507
|
<div style=" width:${wi}; ">存貨數量</div>
|
|
2508
2508
|
<div style=" width:${wi};">存貨單位(SKU)</div>
|
|
2509
2509
|
<div style=" width:${wi};margin-left: 20px;">運費權重</div>
|
|
@@ -2622,7 +2622,7 @@ ${EditorElem.editeInput({
|
|
|
2622
2622
|
}),
|
|
2623
2623
|
EditorElem.editeInput({
|
|
2624
2624
|
gvc: obj.gvc,
|
|
2625
|
-
title: '
|
|
2625
|
+
title: '售價',
|
|
2626
2626
|
default: `${dd.sale_price ?? 0}`,
|
|
2627
2627
|
placeHolder: '',
|
|
2628
2628
|
type: 'number',
|
|
@@ -2632,7 +2632,7 @@ ${EditorElem.editeInput({
|
|
|
2632
2632
|
}),
|
|
2633
2633
|
EditorElem.editeInput({
|
|
2634
2634
|
gvc: obj.gvc,
|
|
2635
|
-
title: '
|
|
2635
|
+
title: '原價',
|
|
2636
2636
|
default: `${dd.compare_price ?? 0}`,
|
|
2637
2637
|
placeHolder: '',
|
|
2638
2638
|
type: 'number',
|
|
@@ -1343,7 +1343,22 @@ export class BgSNS {
|
|
|
1343
1343
|
${gvc.bindView(() => {
|
|
1344
1344
|
return {
|
|
1345
1345
|
bind: 'total_count',
|
|
1346
|
-
view: () =>
|
|
1346
|
+
view: () => document.body.clientWidth > 768
|
|
1347
|
+
? BgWidget.grayNote(`預計每則簡訊花費${pointCount * this.ticket}點`, 'margin-top: 0.25em;')
|
|
1348
|
+
: html ` <div style="margin-top: 0.25em;">
|
|
1349
|
+
${BgWidget.iconButton({
|
|
1350
|
+
icon: 'info',
|
|
1351
|
+
event: gvc.event(() => {
|
|
1352
|
+
BgWidget.jumpAlert({
|
|
1353
|
+
gvc,
|
|
1354
|
+
text: `預計每則簡訊花費${pointCount * this.ticket}點`,
|
|
1355
|
+
justify: 'top',
|
|
1356
|
+
align: 'center',
|
|
1357
|
+
width: 200,
|
|
1358
|
+
});
|
|
1359
|
+
}),
|
|
1360
|
+
})}
|
|
1361
|
+
</div>`,
|
|
1347
1362
|
};
|
|
1348
1363
|
})}
|
|
1349
1364
|
</div>
|
|
@@ -2208,7 +2223,7 @@ export class BgSNS {
|
|
|
2208
2223
|
`);
|
|
2209
2224
|
}
|
|
2210
2225
|
return BgWidget.container(html `
|
|
2211
|
-
<div class="
|
|
2226
|
+
<div class="d-flex w-100 align-items-center mb-3 ${type === 'select' ? `d-none` : ``}">
|
|
2212
2227
|
${BgWidget.title('回饋信件')}
|
|
2213
2228
|
<div class="flex-fill"></div>
|
|
2214
2229
|
</div>
|
|
@@ -2527,7 +2542,7 @@ export class BgSNS {
|
|
|
2527
2542
|
`);
|
|
2528
2543
|
}
|
|
2529
2544
|
return BgWidget.container(html `
|
|
2530
|
-
<div class="
|
|
2545
|
+
<div class="d-flex w-100 align-items-center mb-3 ${type === 'select' ? `d-none` : ``}">
|
|
2531
2546
|
${BgWidget.title('客服訊息')}
|
|
2532
2547
|
<div class="flex-fill"></div>
|
|
2533
2548
|
<button
|
|
@@ -1506,7 +1506,23 @@ export class BgSNS {
|
|
|
1506
1506
|
${gvc.bindView(() => {
|
|
1507
1507
|
return {
|
|
1508
1508
|
bind: 'total_count',
|
|
1509
|
-
view: () =>
|
|
1509
|
+
view: () =>
|
|
1510
|
+
document.body.clientWidth > 768
|
|
1511
|
+
? BgWidget.grayNote(`預計每則簡訊花費${pointCount * this.ticket}點`, 'margin-top: 0.25em;')
|
|
1512
|
+
: html` <div style="margin-top: 0.25em;">
|
|
1513
|
+
${BgWidget.iconButton({
|
|
1514
|
+
icon: 'info',
|
|
1515
|
+
event: gvc.event(() => {
|
|
1516
|
+
BgWidget.jumpAlert({
|
|
1517
|
+
gvc,
|
|
1518
|
+
text: `預計每則簡訊花費${pointCount * this.ticket}點`,
|
|
1519
|
+
justify: 'top',
|
|
1520
|
+
align: 'center',
|
|
1521
|
+
width: 200,
|
|
1522
|
+
});
|
|
1523
|
+
}),
|
|
1524
|
+
})}
|
|
1525
|
+
</div>`,
|
|
1510
1526
|
};
|
|
1511
1527
|
})}
|
|
1512
1528
|
</div>
|
|
@@ -2460,7 +2476,7 @@ export class BgSNS {
|
|
|
2460
2476
|
);
|
|
2461
2477
|
}
|
|
2462
2478
|
return BgWidget.container(html`
|
|
2463
|
-
<div class="
|
|
2479
|
+
<div class="d-flex w-100 align-items-center mb-3 ${type === 'select' ? `d-none` : ``}">
|
|
2464
2480
|
${BgWidget.title('回饋信件')}
|
|
2465
2481
|
<div class="flex-fill"></div>
|
|
2466
2482
|
</div>
|
|
@@ -2811,7 +2827,7 @@ export class BgSNS {
|
|
|
2811
2827
|
);
|
|
2812
2828
|
}
|
|
2813
2829
|
return BgWidget.container(html`
|
|
2814
|
-
<div class="
|
|
2830
|
+
<div class="d-flex w-100 align-items-center mb-3 ${type === 'select' ? `d-none` : ``}">
|
|
2815
2831
|
${BgWidget.title('客服訊息')}
|
|
2816
2832
|
<div class="flex-fill"></div>
|
|
2817
2833
|
<button
|
|
@@ -126,6 +126,12 @@ export class BgWidget {
|
|
|
126
126
|
</button>`;
|
|
127
127
|
}
|
|
128
128
|
static plusButton(obj) {
|
|
129
|
+
return html ` <div class="w-100 d-flex justify-content-center align-items-center gap-2 cursor_pointer" style="color: #3366BB" onclick="${obj.event}">
|
|
130
|
+
<div style="font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">${obj.title}</div>
|
|
131
|
+
<i class="fa-solid fa-plus"></i>
|
|
132
|
+
</div>`;
|
|
133
|
+
}
|
|
134
|
+
static dropPlusButton(obj) {
|
|
129
135
|
return html `
|
|
130
136
|
<div class="w-100 d-flex align-items-center justify-content-center">
|
|
131
137
|
<div class="btn-group dropdown">
|
|
@@ -157,9 +163,17 @@ export class BgWidget {
|
|
|
157
163
|
</div>
|
|
158
164
|
`;
|
|
159
165
|
}
|
|
160
|
-
static
|
|
166
|
+
static iconButton(obj) {
|
|
161
167
|
var _a;
|
|
162
|
-
|
|
168
|
+
const iconClass = (() => {
|
|
169
|
+
switch (obj.icon) {
|
|
170
|
+
case 'info':
|
|
171
|
+
return 'fa-regular fa-circle-info';
|
|
172
|
+
case 'question':
|
|
173
|
+
return 'fa-regular fa-circle-question';
|
|
174
|
+
}
|
|
175
|
+
})();
|
|
176
|
+
return html `<i class="${iconClass} cursor_pointer" style="font-size: ${(_a = obj === null || obj === void 0 ? void 0 : obj.size) !== null && _a !== void 0 ? _a : 18}px" onclick="${obj.event}"></i>`;
|
|
163
177
|
}
|
|
164
178
|
static switchButton(gvc, def, callback) {
|
|
165
179
|
return html ` <div class="form-check form-switch m-0 cursor_pointer" style="margin-top: 10px;">
|
|
@@ -207,6 +221,7 @@ export class BgWidget {
|
|
|
207
221
|
return '使用AI操作導引';
|
|
208
222
|
}
|
|
209
223
|
})();
|
|
224
|
+
const size = document.body.clientWidth > 768 ? 24 : 18;
|
|
210
225
|
return html `<div
|
|
211
226
|
class="bt_orange_lin"
|
|
212
227
|
onclick="${obj.gvc.event(() => {
|
|
@@ -214,7 +229,11 @@ export class BgWidget {
|
|
|
214
229
|
window.parent.glitter.share.ai_message.toggle(true);
|
|
215
230
|
})}"
|
|
216
231
|
>
|
|
217
|
-
<img
|
|
232
|
+
<img
|
|
233
|
+
src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sas0s9s0s1sesas0_1697354801736-Glitterlogo.png"
|
|
234
|
+
class="me-1"
|
|
235
|
+
style="width: ${size}px; height: ${size}px;"
|
|
236
|
+
/>${text}
|
|
218
237
|
</div>`;
|
|
219
238
|
}
|
|
220
239
|
static primaryInsignia(text) {
|
|
@@ -1632,7 +1651,7 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
|
|
|
1632
1651
|
}
|
|
1633
1652
|
return html `<div class="w-100 alert alert-secondary p-3 mb-0 ${css.class}" style="white-space: normal; word-break: break-all; ${css.style} ">
|
|
1634
1653
|
<div class="fs-5 mb-0"><strong>${title}</strong></div>
|
|
1635
|
-
${messageList && messageList.length > 0 ?
|
|
1654
|
+
${messageList && messageList.length > 0 ? `<div class="mt-2" style="white-space: normal; word-break: break-all;">${h}</div>` : ``}
|
|
1636
1655
|
</div>`;
|
|
1637
1656
|
}
|
|
1638
1657
|
static selNavbar(data) {
|
|
@@ -1832,13 +1851,14 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
|
|
|
1832
1851
|
divCreate: {},
|
|
1833
1852
|
onCreate: () => {
|
|
1834
1853
|
if (obj.openOnInit) {
|
|
1835
|
-
|
|
1836
|
-
const
|
|
1837
|
-
if (
|
|
1838
|
-
const
|
|
1839
|
-
|
|
1854
|
+
const si = setInterval(() => {
|
|
1855
|
+
const inside = window.document.querySelector(`.box-inside-${text}`);
|
|
1856
|
+
if (inside) {
|
|
1857
|
+
const navs = window.document.getElementsByClassName(`box-navbar-${text}`);
|
|
1858
|
+
navs.length > 0 && navs[0].click();
|
|
1859
|
+
clearInterval(si);
|
|
1840
1860
|
}
|
|
1841
|
-
},
|
|
1861
|
+
}, 300);
|
|
1842
1862
|
}
|
|
1843
1863
|
},
|
|
1844
1864
|
});
|
|
@@ -2429,6 +2449,64 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
|
|
|
2429
2449
|
</div>`;
|
|
2430
2450
|
}, Tool.randomString(7));
|
|
2431
2451
|
}
|
|
2452
|
+
static jumpAlert(obj) {
|
|
2453
|
+
var _a, _b;
|
|
2454
|
+
const className = Tool.randomString(5);
|
|
2455
|
+
const fixedStyle = (() => {
|
|
2456
|
+
let style = '';
|
|
2457
|
+
if (obj.justify === 'top') {
|
|
2458
|
+
style += `top: 12px;`;
|
|
2459
|
+
}
|
|
2460
|
+
else if (obj.justify === 'bottom') {
|
|
2461
|
+
style += `bottom: 12px;`;
|
|
2462
|
+
}
|
|
2463
|
+
if (obj.align === 'left') {
|
|
2464
|
+
style += `left: 12px;`;
|
|
2465
|
+
}
|
|
2466
|
+
else if (obj.align === 'center') {
|
|
2467
|
+
style += `left: 50%; right: 50%;`;
|
|
2468
|
+
}
|
|
2469
|
+
else if (obj.align === 'right') {
|
|
2470
|
+
style += `right: 12px;`;
|
|
2471
|
+
}
|
|
2472
|
+
return style;
|
|
2473
|
+
})();
|
|
2474
|
+
const transX = obj.align === 'center' ? '-50%' : '0';
|
|
2475
|
+
obj.gvc.addStyle(`
|
|
2476
|
+
.bounce-effect-${className} {
|
|
2477
|
+
animation: bounce 0.5s alternate;
|
|
2478
|
+
animation-iteration-count: 2;
|
|
2479
|
+
position: fixed;
|
|
2480
|
+
${fixedStyle}
|
|
2481
|
+
background-color: #393939;
|
|
2482
|
+
opacity: 0.85;
|
|
2483
|
+
color: white;
|
|
2484
|
+
padding: 10px;
|
|
2485
|
+
border-radius: 8px;
|
|
2486
|
+
width: ${(_a = obj.width) !== null && _a !== void 0 ? _a : 120}px;
|
|
2487
|
+
text-align: center;
|
|
2488
|
+
z-index: 11;
|
|
2489
|
+
transform: translateX(${transX});
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
@keyframes bounce {
|
|
2493
|
+
0% {
|
|
2494
|
+
transform: translate(${transX}, 0);
|
|
2495
|
+
}
|
|
2496
|
+
100% {
|
|
2497
|
+
transform: translate(${transX}, -6px);
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
`);
|
|
2501
|
+
const htmlString = html `<div class="bounce-effect-${className}">${obj.text}</div>`;
|
|
2502
|
+
obj.gvc.glitter.document.body.insertAdjacentHTML('beforeend', htmlString);
|
|
2503
|
+
setTimeout(() => {
|
|
2504
|
+
const element = document.querySelector(`.bounce-effect-${className}`);
|
|
2505
|
+
if (element) {
|
|
2506
|
+
element.remove();
|
|
2507
|
+
}
|
|
2508
|
+
}, (_b = obj.timeout) !== null && _b !== void 0 ? _b : 2000);
|
|
2509
|
+
}
|
|
2432
2510
|
static arrowDownDataImage(color) {
|
|
2433
2511
|
color = color.replace('#', '%23');
|
|
2434
2512
|
return `"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='${color}'%3e%3cpath d='M225.813 48.907L128 146.72 30.187 48.907 0 79.093l128 128 128-128z'/%3e%3c/svg%3e"`;
|
|
@@ -193,7 +193,14 @@ export class BgWidget {
|
|
|
193
193
|
</button>`;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
static plusButton(obj: {
|
|
196
|
+
static plusButton(obj: { title: string; event: string }) {
|
|
197
|
+
return html` <div class="w-100 d-flex justify-content-center align-items-center gap-2 cursor_pointer" style="color: #3366BB" onclick="${obj.event}">
|
|
198
|
+
<div style="font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">${obj.title}</div>
|
|
199
|
+
<i class="fa-solid fa-plus"></i>
|
|
200
|
+
</div>`;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
static dropPlusButton(obj: {
|
|
197
204
|
gvc: GVC;
|
|
198
205
|
title: string;
|
|
199
206
|
options: {
|
|
@@ -234,13 +241,16 @@ export class BgWidget {
|
|
|
234
241
|
`;
|
|
235
242
|
}
|
|
236
243
|
|
|
237
|
-
static
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
static iconButton(obj: { icon: 'info' | 'question'; event: string; size?: number }) {
|
|
245
|
+
const iconClass = (() => {
|
|
246
|
+
switch (obj.icon) {
|
|
247
|
+
case 'info':
|
|
248
|
+
return 'fa-regular fa-circle-info';
|
|
249
|
+
case 'question':
|
|
250
|
+
return 'fa-regular fa-circle-question';
|
|
251
|
+
}
|
|
252
|
+
})();
|
|
253
|
+
return html`<i class="${iconClass} cursor_pointer" style="font-size: ${obj?.size ?? 18}px" onclick="${obj.event}"></i>`;
|
|
244
254
|
}
|
|
245
255
|
|
|
246
256
|
static switchButton(gvc: GVC, def: boolean, callback: (value: boolean) => void) {
|
|
@@ -300,6 +310,7 @@ export class BgWidget {
|
|
|
300
310
|
return '使用AI操作導引';
|
|
301
311
|
}
|
|
302
312
|
})();
|
|
313
|
+
const size = document.body.clientWidth > 768 ? 24 : 18;
|
|
303
314
|
return html`<div
|
|
304
315
|
class="bt_orange_lin"
|
|
305
316
|
onclick="${obj.gvc.event(() => {
|
|
@@ -307,7 +318,11 @@ export class BgWidget {
|
|
|
307
318
|
(window.parent as any).glitter.share.ai_message.toggle(true);
|
|
308
319
|
})}"
|
|
309
320
|
>
|
|
310
|
-
<img
|
|
321
|
+
<img
|
|
322
|
+
src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sas0s9s0s1sesas0_1697354801736-Glitterlogo.png"
|
|
323
|
+
class="me-1"
|
|
324
|
+
style="width: ${size}px; height: ${size}px;"
|
|
325
|
+
/>${text}
|
|
311
326
|
</div>`;
|
|
312
327
|
}
|
|
313
328
|
|
|
@@ -1984,7 +1999,7 @@ ${obj.default ?? ''}</textarea
|
|
|
1984
1999
|
}
|
|
1985
2000
|
return html`<div class="w-100 alert alert-secondary p-3 mb-0 ${css.class}" style="white-space: normal; word-break: break-all; ${css.style} ">
|
|
1986
2001
|
<div class="fs-5 mb-0"><strong>${title}</strong></div>
|
|
1987
|
-
${messageList && messageList.length > 0 ?
|
|
2002
|
+
${messageList && messageList.length > 0 ? `<div class="mt-2" style="white-space: normal; word-break: break-all;">${h}</div>` : ``}
|
|
1988
2003
|
</div>`;
|
|
1989
2004
|
}
|
|
1990
2005
|
|
|
@@ -2191,13 +2206,14 @@ ${obj.default ?? ''}</textarea
|
|
|
2191
2206
|
divCreate: {},
|
|
2192
2207
|
onCreate: () => {
|
|
2193
2208
|
if (obj.openOnInit) {
|
|
2194
|
-
|
|
2195
|
-
const
|
|
2196
|
-
if (
|
|
2197
|
-
const
|
|
2198
|
-
|
|
2209
|
+
const si = setInterval(() => {
|
|
2210
|
+
const inside = window.document.querySelector(`.box-inside-${text}`) as any;
|
|
2211
|
+
if (inside) {
|
|
2212
|
+
const navs = window.document.getElementsByClassName(`box-navbar-${text}`) as any;
|
|
2213
|
+
navs.length > 0 && navs[0].click();
|
|
2214
|
+
clearInterval(si);
|
|
2199
2215
|
}
|
|
2200
|
-
},
|
|
2216
|
+
}, 300);
|
|
2201
2217
|
}
|
|
2202
2218
|
},
|
|
2203
2219
|
});
|
|
@@ -2872,6 +2888,62 @@ ${obj.default ?? ''}</textarea
|
|
|
2872
2888
|
}, Tool.randomString(7));
|
|
2873
2889
|
}
|
|
2874
2890
|
|
|
2891
|
+
static jumpAlert(obj: { gvc: GVC; text: string; justify: 'top' | 'bottom'; align: 'left' | 'center' | 'right'; timeout?: number; width?: number }) {
|
|
2892
|
+
const className = Tool.randomString(5);
|
|
2893
|
+
const fixedStyle = (() => {
|
|
2894
|
+
let style = '';
|
|
2895
|
+
if (obj.justify === 'top') {
|
|
2896
|
+
style += `top: 12px;`;
|
|
2897
|
+
} else if (obj.justify === 'bottom') {
|
|
2898
|
+
style += `bottom: 12px;`;
|
|
2899
|
+
}
|
|
2900
|
+
if (obj.align === 'left') {
|
|
2901
|
+
style += `left: 12px;`;
|
|
2902
|
+
} else if (obj.align === 'center') {
|
|
2903
|
+
style += `left: 50%; right: 50%;`;
|
|
2904
|
+
} else if (obj.align === 'right') {
|
|
2905
|
+
style += `right: 12px;`;
|
|
2906
|
+
}
|
|
2907
|
+
return style;
|
|
2908
|
+
})();
|
|
2909
|
+
const transX = obj.align === 'center' ? '-50%' : '0';
|
|
2910
|
+
|
|
2911
|
+
obj.gvc.addStyle(`
|
|
2912
|
+
.bounce-effect-${className} {
|
|
2913
|
+
animation: bounce 0.5s alternate;
|
|
2914
|
+
animation-iteration-count: 2;
|
|
2915
|
+
position: fixed;
|
|
2916
|
+
${fixedStyle}
|
|
2917
|
+
background-color: #393939;
|
|
2918
|
+
opacity: 0.85;
|
|
2919
|
+
color: white;
|
|
2920
|
+
padding: 10px;
|
|
2921
|
+
border-radius: 8px;
|
|
2922
|
+
width: ${obj.width ?? 120}px;
|
|
2923
|
+
text-align: center;
|
|
2924
|
+
z-index: 11;
|
|
2925
|
+
transform: translateX(${transX});
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
@keyframes bounce {
|
|
2929
|
+
0% {
|
|
2930
|
+
transform: translate(${transX}, 0);
|
|
2931
|
+
}
|
|
2932
|
+
100% {
|
|
2933
|
+
transform: translate(${transX}, -6px);
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
`);
|
|
2937
|
+
const htmlString = html`<div class="bounce-effect-${className}">${obj.text}</div>`;
|
|
2938
|
+
obj.gvc.glitter.document.body.insertAdjacentHTML('beforeend', htmlString);
|
|
2939
|
+
setTimeout(() => {
|
|
2940
|
+
const element = document.querySelector(`.bounce-effect-${className}`) as HTMLElement;
|
|
2941
|
+
if (element) {
|
|
2942
|
+
element.remove();
|
|
2943
|
+
}
|
|
2944
|
+
}, obj.timeout ?? 2000);
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2875
2947
|
// 圖片
|
|
2876
2948
|
static noImageURL = 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg';
|
|
2877
2949
|
|
|
@@ -78,7 +78,7 @@ export class CustomerMessageUser {
|
|
|
78
78
|
user_id: cf.userID,
|
|
79
79
|
containerHeight: gvc.glitter.ut.frSize({
|
|
80
80
|
sm: (cf.type !== 'preview') ? `826px` : `${($('body').height() + 25)}px`,
|
|
81
|
-
},
|
|
81
|
+
}, $('body').height() + 60 + 'px'),
|
|
82
82
|
document: document,
|
|
83
83
|
goBack: () => {
|
|
84
84
|
vm.viewType = 'robot';
|
|
@@ -102,7 +102,7 @@ export class CustomerMessageUser {
|
|
|
102
102
|
{
|
|
103
103
|
sm: (cf.type !== 'preview') ? `826px` : `${($('body').height() as any + 25)}px`,
|
|
104
104
|
},
|
|
105
|
-
|
|
105
|
+
($('body').height() as any) + 60 + 'px',
|
|
106
106
|
),
|
|
107
107
|
document: document,
|
|
108
108
|
goBack: () => {
|
|
@@ -205,8 +205,8 @@ export class AutoReply {
|
|
|
205
205
|
placeHolder: '請輸入寄件者名稱',
|
|
206
206
|
}),
|
|
207
207
|
html `
|
|
208
|
-
<div class="d-flex
|
|
209
|
-
<div class="d-flex align-items-center gap-2">${EditorElem.h3('
|
|
208
|
+
<div class="d-flex align-items-center justify-content-between p-0 my-2">
|
|
209
|
+
<div class="d-flex align-items-center gap-2">${EditorElem.h3('訊息內容')}</div>
|
|
210
210
|
<div>${BgWidget.aiChatButton({ gvc, select: 'writer' })}</div>
|
|
211
211
|
</div>
|
|
212
212
|
`,
|