ts-glitter 14.6.46 → 14.7.2
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 +1 -1
- package/lowcode/cms-plugin/ai-message.js +39 -34
- package/lowcode/cms-plugin/ai-message.ts +49 -39
- package/lowcode/cms-plugin/shopping-finance-setting.js +220 -257
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1132 -1183
- package/lowcode/cms-plugin/shopping-order-manager.js +1 -1
- package/lowcode/cms-plugin/shopping-order-manager.ts +1 -1
- package/lowcode/glitter-base/global/language.js +77 -7
- package/lowcode/glitter-base/global/language.ts +88 -23
- package/lowcode/glitter-base/route/ai-chat.ts +2 -2
- package/lowcode/glitter-base/route/shopping.ts +3 -3
- package/lowcode/public-components/checkout/index.js +2 -2
- package/lowcode/public-components/checkout/index.ts +4 -4
- package/lowcode/public-components/user-manager/um-order.js +849 -75
- package/lowcode/public-components/user-manager/um-order.ts +941 -105
- package/package.json +1 -1
- package/src/api-public/controllers/ai-chat.js +0 -1
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/ai-chat.ts +0 -1
- package/src/api-public/controllers/ai-points.js.map +1 -1
- package/src/api-public/controllers/sms-points.js.map +1 -1
- package/src/api-public/controllers/wallet.js.map +1 -1
- package/src/api-public/services/EcInvoice.js.map +1 -1
- package/src/api-public/services/ai-pointes.js.map +1 -1
- package/src/api-public/services/delivery.d.ts +21 -9
- package/src/api-public/services/delivery.js +15 -9
- package/src/api-public/services/delivery.js.map +1 -1
- package/src/api-public/services/delivery.ts +37 -13
- package/src/api-public/services/financial-service.d.ts +1 -0
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/invoice.js.map +1 -1
- package/src/api-public/services/monitor.d.ts +1 -0
- package/src/api-public/services/monitor.js.map +1 -1
- package/src/api-public/services/recommend.js +21 -11
- package/src/api-public/services/recommend.js.map +1 -1
- package/src/api-public/services/recommend.ts +25 -15
- package/src/api-public/services/shopping.d.ts +1 -0
- package/src/api-public/services/shopping.js +96 -32
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +109 -41
- package/src/api-public/services/sms-pointes.js.map +1 -1
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/wallet.js.map +1 -1
- package/src/index.js +84 -160
- package/src/index.js.map +1 -1
- package/src/index.ts +220 -289
- package/src/services/template.js +9 -3
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +40 -32
package/lowcode/Entry.js
CHANGED
|
@@ -80,7 +80,7 @@ export class Entry {
|
|
|
80
80
|
}
|
|
81
81
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
82
82
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
83
|
-
glitter.share.editerVersion = 'V_14.
|
|
83
|
+
glitter.share.editerVersion = 'V_14.7.2';
|
|
84
84
|
glitter.share.start = new Date();
|
|
85
85
|
const vm = {
|
|
86
86
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -82,7 +82,7 @@ export class Entry {
|
|
|
82
82
|
|
|
83
83
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
84
84
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
85
|
-
glitter.share.editerVersion = 'V_14.
|
|
85
|
+
glitter.share.editerVersion = 'V_14.7.2';
|
|
86
86
|
glitter.share.start = new Date();
|
|
87
87
|
const vm: {
|
|
88
88
|
appConfig: any;
|
|
@@ -16,28 +16,35 @@ import { AiPointsApi } from "../glitter-base/route/ai-points-api.js";
|
|
|
16
16
|
import { EditorElem } from "../glitterBundle/plugins/editor-elem.js";
|
|
17
17
|
export class AiMessage {
|
|
18
18
|
static setDrawer(gvc, option) {
|
|
19
|
+
const ai_list = [
|
|
20
|
+
{
|
|
21
|
+
key: 'order_analysis',
|
|
22
|
+
label: '分析',
|
|
23
|
+
icon: `fa-regular fa-database`
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: 'operation_guide',
|
|
27
|
+
label: '引導',
|
|
28
|
+
icon: `fa-solid fa-bullseye`
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'design',
|
|
32
|
+
label: '圖片',
|
|
33
|
+
icon: `fa-regular fa-image`
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: 'writer',
|
|
37
|
+
label: '文案',
|
|
38
|
+
icon: `fa-solid fa-pen-to-square`
|
|
39
|
+
}
|
|
40
|
+
];
|
|
19
41
|
if (!option) {
|
|
20
|
-
AiMessage.ai_support =
|
|
21
|
-
{
|
|
22
|
-
key: 'order_analysis',
|
|
23
|
-
label: '訂單分析',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
key: 'operation_guide',
|
|
27
|
-
label: '操作引導',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
key: 'design',
|
|
31
|
-
label: '圖片生成',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
key: 'writer',
|
|
35
|
-
label: '文案寫手',
|
|
36
|
-
}
|
|
37
|
-
];
|
|
42
|
+
AiMessage.ai_support = ai_list;
|
|
38
43
|
}
|
|
39
44
|
else {
|
|
40
|
-
AiMessage.ai_support =
|
|
45
|
+
AiMessage.ai_support = ai_list.filter((dd) => {
|
|
46
|
+
return option.find((d1) => { return dd.key === d1.key; });
|
|
47
|
+
});
|
|
41
48
|
}
|
|
42
49
|
if (!AiMessage.ai_support.find((dd) => {
|
|
43
50
|
return dd.key === AiMessage.vm.select_bt;
|
|
@@ -108,22 +115,18 @@ export class AiMessage {
|
|
|
108
115
|
color: white !important;
|
|
109
116
|
}
|
|
110
117
|
|
|
111
|
-
.select-label-ai-
|
|
118
|
+
.select-label-ai-message_ {
|
|
112
119
|
gap: 10px;
|
|
113
|
-
border-radius: 7px;
|
|
114
120
|
cursor: pointer;
|
|
115
121
|
color: white;
|
|
116
122
|
font-size: 16px;
|
|
117
123
|
flex: 1;
|
|
118
|
-
border: 1px solid #ffb400;
|
|
119
124
|
background: linear-gradient(143deg, #ffb400 -22.7%, #ff6c02 114.57%);
|
|
120
125
|
}
|
|
121
126
|
|
|
122
|
-
.select-btn-ai-
|
|
123
|
-
border-radius: 7px;
|
|
127
|
+
.select-btn-ai-message_ {
|
|
124
128
|
flex: 1;
|
|
125
129
|
font-size: 16px;
|
|
126
|
-
border: 1px solid #ffb400;
|
|
127
130
|
cursor: pointer;
|
|
128
131
|
background: linear-gradient(143deg, #ffb400 -22.7%, #ff6c02 114.57%);
|
|
129
132
|
background-clip: text;
|
|
@@ -195,31 +198,32 @@ export class AiMessage {
|
|
|
195
198
|
</div>
|
|
196
199
|
</div>` +
|
|
197
200
|
html `
|
|
198
|
-
<div class="d-flex align-items-center
|
|
199
|
-
style="
|
|
201
|
+
<div class="d-flex align-items-center shadow border-bottom border-top"
|
|
202
|
+
style="">
|
|
200
203
|
${(() => {
|
|
201
204
|
const list = AiMessage.ai_support;
|
|
202
205
|
return list
|
|
203
206
|
.map((dd) => {
|
|
204
207
|
if (AiMessage.vm.select_bt === dd.key) {
|
|
205
208
|
return html `
|
|
206
|
-
<div class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-label-ai-
|
|
207
|
-
${dd.label}
|
|
209
|
+
<div class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-label-ai-message_ fs-6" style="gap:5px;">
|
|
210
|
+
<i class="${dd.icon} "></i>${dd.label}
|
|
208
211
|
</div>`;
|
|
209
212
|
}
|
|
210
213
|
else {
|
|
211
214
|
return html `
|
|
212
|
-
<div class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-btn-ai-
|
|
215
|
+
<div class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-btn-ai-message_ fs-6"
|
|
216
|
+
style="gap:5px;"
|
|
213
217
|
onclick="${gvc.event(() => {
|
|
214
218
|
AiMessage.vm.select_bt = dd.key;
|
|
215
219
|
refresh();
|
|
216
220
|
})}"
|
|
217
221
|
>
|
|
218
|
-
${dd.label}
|
|
222
|
+
<i class="${dd.icon}"></i>${dd.label}
|
|
219
223
|
</div>`;
|
|
220
224
|
}
|
|
221
225
|
})
|
|
222
|
-
.join(
|
|
226
|
+
.join(`<div class="border-end" style="width:1px;height:39px;"></div>`);
|
|
223
227
|
})()}
|
|
224
228
|
</div>`);
|
|
225
229
|
}));
|
|
@@ -232,7 +236,8 @@ export class AiMessage {
|
|
|
232
236
|
return ` <div class="p-5">
|
|
233
237
|
${[
|
|
234
238
|
html `
|
|
235
|
-
<lottie-player src="${gvc.glitter.root_path}lottie/ai.json"
|
|
239
|
+
<lottie-player src="${gvc.glitter.root_path}lottie/ai.json"
|
|
240
|
+
class="mx-auto my-n4" speed="1"
|
|
236
241
|
style="max-width: 100%;width: 250px;height:250px;" loop
|
|
237
242
|
autoplay></lottie-player>`,
|
|
238
243
|
`<div class="w-100 d-flex align-items-center justify-content-center my-3">${BgWidget.grayNote('點擊想要調整的元件之後,在輸入 AI 語句進行調整', `font-weight: 500;`)}</div>`,
|
|
@@ -514,7 +519,7 @@ ${BgWidget.save(gvc.event(() => {
|
|
|
514
519
|
},
|
|
515
520
|
divCreate: {
|
|
516
521
|
class: `chatContainer p-3 d-flex flex-column position-relative`,
|
|
517
|
-
style: `overflow-y: auto;height: calc(${cf.containerHeight} - ${
|
|
522
|
+
style: `overflow-y: auto;height: calc(${cf.containerHeight} - ${220 + (parseInt(gvc.glitter.share.top_inset, 10) + parseInt(gvc.glitter.share.bottom_inset, 10))}px);background: white;padding-top:60px;`,
|
|
518
523
|
},
|
|
519
524
|
onCreate: () => {
|
|
520
525
|
vm.close = false;
|
|
@@ -21,7 +21,7 @@ export class AiMessage {
|
|
|
21
21
|
public static vm: {
|
|
22
22
|
type: 'list' | 'detail';
|
|
23
23
|
chat_user: any;
|
|
24
|
-
select_bt: 'writer' | 'order_analysis' | 'operation_guide' | "page_editor";
|
|
24
|
+
select_bt: 'writer' | 'order_analysis' | 'operation_guide' | "page_editor" | 'ai_generator';
|
|
25
25
|
} = {
|
|
26
26
|
type: 'list',
|
|
27
27
|
chat_user: '',
|
|
@@ -32,27 +32,39 @@ export class AiMessage {
|
|
|
32
32
|
public static id = `dsmdklweew3`;
|
|
33
33
|
|
|
34
34
|
public static setDrawer(gvc: GVC, option?: { key: string, label: string }[]) {
|
|
35
|
+
const ai_list=[
|
|
36
|
+
// {
|
|
37
|
+
// key: 'ai_generator',
|
|
38
|
+
// label: `生成`,
|
|
39
|
+
// icon: `fa-regular fa-wand-magic-sparkles`
|
|
40
|
+
// },
|
|
41
|
+
{
|
|
42
|
+
key: 'order_analysis',
|
|
43
|
+
label: '分析',
|
|
44
|
+
icon: `fa-regular fa-database`
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: 'operation_guide',
|
|
48
|
+
label: '引導',
|
|
49
|
+
icon: `fa-solid fa-bullseye`
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: 'design',
|
|
53
|
+
label: '圖片',
|
|
54
|
+
icon: `fa-regular fa-image`
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: 'writer',
|
|
58
|
+
label: '文案',
|
|
59
|
+
icon: `fa-solid fa-pen-to-square`
|
|
60
|
+
}
|
|
61
|
+
]
|
|
35
62
|
if (!option) {
|
|
36
|
-
AiMessage.ai_support =
|
|
37
|
-
{
|
|
38
|
-
key: 'order_analysis',
|
|
39
|
-
label: '訂單分析',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
key: 'operation_guide',
|
|
43
|
-
label: '操作引導',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
key: 'design',
|
|
47
|
-
label: '圖片生成',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
key: 'writer',
|
|
51
|
-
label: '文案寫手',
|
|
52
|
-
}
|
|
53
|
-
]
|
|
63
|
+
AiMessage.ai_support = ai_list
|
|
54
64
|
} else {
|
|
55
|
-
AiMessage.ai_support =
|
|
65
|
+
AiMessage.ai_support = ai_list.filter((dd)=>{
|
|
66
|
+
return option.find((d1)=>{return dd.key===d1.key})
|
|
67
|
+
})
|
|
56
68
|
}
|
|
57
69
|
if (!AiMessage.ai_support.find((dd) => {
|
|
58
70
|
return dd.key === AiMessage.vm.select_bt
|
|
@@ -93,11 +105,11 @@ export class AiMessage {
|
|
|
93
105
|
})
|
|
94
106
|
}
|
|
95
107
|
|
|
96
|
-
public static ai_support: { key: string, label: string }[] = []
|
|
108
|
+
public static ai_support: { key: string, label: string, icon: string }[] = []
|
|
97
109
|
|
|
98
110
|
|
|
99
111
|
public static toggle() {
|
|
100
|
-
AiMessage.setDrawer((window.parent as any).glitter.pageConfig[(window.parent as any).glitter.pageConfig.length-1].gvc);
|
|
112
|
+
AiMessage.setDrawer((window.parent as any).glitter.pageConfig[(window.parent as any).glitter.pageConfig.length - 1].gvc);
|
|
101
113
|
}
|
|
102
114
|
|
|
103
115
|
public static detail(cf: {
|
|
@@ -140,22 +152,18 @@ export class AiMessage {
|
|
|
140
152
|
color: white !important;
|
|
141
153
|
}
|
|
142
154
|
|
|
143
|
-
.select-label-ai-
|
|
155
|
+
.select-label-ai-message_ {
|
|
144
156
|
gap: 10px;
|
|
145
|
-
border-radius: 7px;
|
|
146
157
|
cursor: pointer;
|
|
147
158
|
color: white;
|
|
148
159
|
font-size: 16px;
|
|
149
160
|
flex: 1;
|
|
150
|
-
border: 1px solid #ffb400;
|
|
151
161
|
background: linear-gradient(143deg, #ffb400 -22.7%, #ff6c02 114.57%);
|
|
152
162
|
}
|
|
153
163
|
|
|
154
|
-
.select-btn-ai-
|
|
155
|
-
border-radius: 7px;
|
|
164
|
+
.select-btn-ai-message_ {
|
|
156
165
|
flex: 1;
|
|
157
166
|
font-size: 16px;
|
|
158
|
-
border: 1px solid #ffb400;
|
|
159
167
|
cursor: pointer;
|
|
160
168
|
background: linear-gradient(143deg, #ffb400 -22.7%, #ff6c02 114.57%);
|
|
161
169
|
background-clip: text;
|
|
@@ -233,30 +241,31 @@ export class AiMessage {
|
|
|
233
241
|
</div>
|
|
234
242
|
</div>` +
|
|
235
243
|
html`
|
|
236
|
-
<div class="d-flex align-items-center
|
|
237
|
-
style="
|
|
244
|
+
<div class="d-flex align-items-center shadow border-bottom border-top"
|
|
245
|
+
style="">
|
|
238
246
|
${(() => {
|
|
239
247
|
const list = AiMessage.ai_support;
|
|
240
248
|
return list
|
|
241
249
|
.map((dd) => {
|
|
242
250
|
if (AiMessage.vm.select_bt === dd.key) {
|
|
243
251
|
return html`
|
|
244
|
-
<div class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-label-ai-
|
|
245
|
-
${dd.label}
|
|
252
|
+
<div class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-label-ai-message_ fs-6" style="gap:5px;">
|
|
253
|
+
<i class="${dd.icon} "></i>${dd.label}
|
|
246
254
|
</div>`;
|
|
247
255
|
} else {
|
|
248
256
|
return html`
|
|
249
|
-
<div class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-btn-ai-
|
|
257
|
+
<div class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-btn-ai-message_ fs-6"
|
|
258
|
+
style="gap:5px;"
|
|
250
259
|
onclick="${gvc.event(() => {
|
|
251
260
|
AiMessage.vm.select_bt = dd.key as any;
|
|
252
261
|
refresh();
|
|
253
262
|
})}"
|
|
254
263
|
>
|
|
255
|
-
${dd.label}
|
|
264
|
+
<i class="${dd.icon}"></i>${dd.label}
|
|
256
265
|
</div>`;
|
|
257
266
|
}
|
|
258
267
|
})
|
|
259
|
-
.join(
|
|
268
|
+
.join(`<div class="border-end" style="width:1px;height:39px;"></div>`);
|
|
260
269
|
})()}
|
|
261
270
|
</div>`
|
|
262
271
|
);
|
|
@@ -270,7 +279,8 @@ export class AiMessage {
|
|
|
270
279
|
return ` <div class="p-5">
|
|
271
280
|
${[
|
|
272
281
|
html`
|
|
273
|
-
<lottie-player src="${gvc.glitter.root_path}lottie/ai.json"
|
|
282
|
+
<lottie-player src="${gvc.glitter.root_path}lottie/ai.json"
|
|
283
|
+
class="mx-auto my-n4" speed="1"
|
|
274
284
|
style="max-width: 100%;width: 250px;height:250px;" loop
|
|
275
285
|
autoplay></lottie-player>`,
|
|
276
286
|
`<div class="w-100 d-flex align-items-center justify-content-center my-3">${BgWidget.grayNote('點擊想要調整的元件之後,在輸入 AI 語句進行調整', `font-weight: 500;`)}</div>`,
|
|
@@ -302,7 +312,7 @@ ${BgWidget.save(gvc.event(() => {
|
|
|
302
312
|
|
|
303
313
|
dialog.dataLoading({visible: true})
|
|
304
314
|
gvc.glitter.getModule(new URL('./editor/ai-editor.js', gvc.glitter.root_path).href, (AiEditor) => {
|
|
305
|
-
AiEditor.editView(message, gvc.glitter.share.editorViewModel.selectItem, (result:any) => {
|
|
315
|
+
AiEditor.editView(message, gvc.glitter.share.editorViewModel.selectItem, (result: any) => {
|
|
306
316
|
dialog.dataLoading({visible: false})
|
|
307
317
|
if (result) {
|
|
308
318
|
dialog.successMessage({text: `已為你調整元件『${result}』`})
|
|
@@ -314,7 +324,7 @@ ${BgWidget.save(gvc.event(() => {
|
|
|
314
324
|
|
|
315
325
|
})
|
|
316
326
|
});
|
|
317
|
-
|
|
327
|
+
|
|
318
328
|
// const dialog = new ShareDialog(gvc.glitter)
|
|
319
329
|
// dialog.dataLoading({visible: true})
|
|
320
330
|
// AiChat.generateHtml({
|
|
@@ -615,7 +625,7 @@ ${BgWidget.save(gvc.event(() => {
|
|
|
615
625
|
},
|
|
616
626
|
divCreate: {
|
|
617
627
|
class: `chatContainer p-3 d-flex flex-column position-relative`,
|
|
618
|
-
style: `overflow-y: auto;height: calc(${cf.containerHeight} - ${
|
|
628
|
+
style: `overflow-y: auto;height: calc(${cf.containerHeight} - ${220 + (parseInt(gvc.glitter.share.top_inset, 10) + parseInt(gvc.glitter.share.bottom_inset, 10))}px);background: white;padding-top:60px;`,
|
|
619
629
|
},
|
|
620
630
|
onCreate: () => {
|
|
621
631
|
vm.close = false;
|