ts-glitter 13.8.0 → 13.8.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
@@ -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.8.0";
62
+ glitter.share.editerVersion = "V_13.8.3";
63
63
  glitter.share.start = (new Date());
64
64
  const vm = {
65
65
  appConfig: [],
package/lowcode/Entry.ts CHANGED
@@ -59,7 +59,7 @@ export class Entry {
59
59
  }
60
60
  (window as any).renderClock = (window as any).renderClock ?? clockF();
61
61
  console.log(`Entry-time:`, (window as any).renderClock.stop());
62
- glitter.share.editerVersion = "V_13.8.0";
62
+ glitter.share.editerVersion = "V_13.8.3";
63
63
  glitter.share.start = (new Date());
64
64
  const vm: {
65
65
  appConfig: any;
@@ -24,7 +24,30 @@ export class AiMessage {
24
24
  id: gvc.glitter.getUUID(),
25
25
  };
26
26
  return gvc.bindView(() => {
27
- AiMessage.toggle = (vis) => {
27
+ AiMessage.toggle = (vis, option) => {
28
+ if (!option) {
29
+ AiMessage.ai_support = [
30
+ {
31
+ key: 'writer',
32
+ label: '文案寫手',
33
+ },
34
+ {
35
+ key: 'order_analysis',
36
+ label: '訂單分析',
37
+ },
38
+ {
39
+ key: 'design',
40
+ label: '圖片生成',
41
+ },
42
+ {
43
+ key: 'operation_guide',
44
+ label: '操作引導',
45
+ }
46
+ ];
47
+ }
48
+ else {
49
+ AiMessage.ai_support = option;
50
+ }
28
51
  vm.visible = vis;
29
52
  $(document.querySelector('.ai-left')).addClass(`scroll-out`);
30
53
  setTimeout(() => {
@@ -38,39 +61,42 @@ export class AiMessage {
38
61
  return ``;
39
62
  }
40
63
  return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
41
- resolve(html `<div
42
- class="position-fixed start-0 top-0 vw-100 vh-100"
43
- style="background: rgba(0,0,0,0.5);z-index:999;"
44
- onclick="${gvc.event(() => {
64
+ resolve(html `
65
+ <div
66
+ class="position-fixed start-0 top-0 vw-100 vh-100"
67
+ style="background: rgba(0,0,0,0.5);z-index:999;"
68
+ onclick="${gvc.event(() => {
45
69
  AiMessage.toggle(false);
46
70
  })}"
47
- >
48
- <div
49
- class="position-fixed vh-100 top-0 scroll-in bg-white ai-left"
50
- style="top:0px;width: 500px;height: 100vh;max-width: 100vw;"
51
- onclick="${gvc.event((e, event) => {
71
+ >
72
+ <div
73
+ class="position-fixed vh-100 top-0 scroll-in bg-white ai-left"
74
+ style="top:0px;width: 500px;height: 100vh;max-width: 100vw;"
75
+ onclick="${gvc.event((e, event) => {
52
76
  event.stopPropagation();
53
77
  })}"
54
- >
55
- ${AiMessage.detail({
78
+ >
79
+ ${AiMessage.detail({
56
80
  gvc: gvc,
57
81
  user_id: cf.userID,
58
82
  containerHeight: $('body').height() + 10 + 'px',
59
83
  document: document,
60
- goBack: () => { },
84
+ goBack: () => {
85
+ },
61
86
  close: () => {
62
87
  AiMessage.toggle(false);
63
88
  },
64
89
  })}
65
- </div>
66
- </div>`);
90
+ </div>
91
+ </div>`);
67
92
  }));
68
93
  },
69
94
  divCreate: {
70
95
  elem: 'div',
71
96
  style: `z-index:99999;bottom:0px;left:0px;`,
72
97
  },
73
- onCreate: () => __awaiter(this, void 0, void 0, function* () { }),
98
+ onCreate: () => __awaiter(this, void 0, void 0, function* () {
99
+ }),
74
100
  };
75
101
  });
76
102
  }
@@ -149,21 +175,23 @@ export class AiMessage {
149
175
  if (chatRoom.who === 'manager') {
150
176
  chatRoom.user_data = AiMessage.config;
151
177
  }
152
- resolve(html `<div
153
- class="navbar d-flex align-items-center justify-content-between w-100 p-3 ${AiMessage.config.hideBar ? `d-none` : ``}"
154
- style="background: ${AiMessage.config.color};"
155
- >
156
- <div class="d-flex align-items-center pe-3 w-100" style="gap:10px;display: flex;align-items: center;">
157
- <img
158
- src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sas0s9s0s1sesas0_1697354801736-Glitterlogo.png"
159
- class="rounded-circle border"
160
- style="background: white;border-radius: 50%;width: 40px;height: 40px;"
161
- width="40"
162
- alt="Albert Flores"
163
- />
164
- <div class="d-flex flex-column px-1 text-white">
165
- <h6 class="mb-0 text-white d-flex">AI 智能助手</h6>
166
- ${gvc.bindView(() => {
178
+ resolve(html `
179
+ <div
180
+ class="navbar d-flex align-items-center justify-content-between w-100 p-3 ${AiMessage.config.hideBar ? `d-none` : ``}"
181
+ style="background: ${AiMessage.config.color};"
182
+ >
183
+ <div class="d-flex align-items-center pe-3 w-100"
184
+ style="gap:10px;display: flex;align-items: center;">
185
+ <img
186
+ src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sas0s9s0s1sesas0_1697354801736-Glitterlogo.png"
187
+ class="rounded-circle border"
188
+ style="background: white;border-radius: 50%;width: 40px;height: 40px;"
189
+ width="40"
190
+ alt="Albert Flores"
191
+ />
192
+ <div class="d-flex flex-column px-1 text-white">
193
+ <h6 class="mb-0 text-white d-flex">AI 智能助手</h6>
194
+ ${gvc.bindView(() => {
167
195
  return {
168
196
  bind: 'ai_points_count',
169
197
  view: () => {
@@ -172,53 +200,44 @@ export class AiMessage {
172
200
  }));
173
201
  },
174
202
  divCreate: {
175
- class: `fw-500 d-flex`, style: `font-size:13px;`
203
+ class: `fw-500 d-flex`,
204
+ style: `font-size:13px;`
176
205
  }
177
206
  };
178
207
  })}
179
- </div>
180
- <div class="flex-fill" style="flex: 1;"></div>
181
- <i
182
- class="fa-regular fa-circle-xmark text-white fs-3 ${cf.close ? `` : `d-none`}"
183
- onclick="${gvc.event(() => {
208
+ </div>
209
+ <div class="flex-fill" style="flex: 1;"></div>
210
+ <i
211
+ class="fa-regular fa-circle-xmark text-white fs-3 ${cf.close ? `` : `d-none`}"
212
+ onclick="${gvc.event(() => {
184
213
  cf.close && cf.close();
185
214
  })}"
186
- ></i>
187
- </div>
188
- </div>` +
189
- html `<div class="d-flex align-items-center p-2 shadow border-bottom" style="gap:10px;">
215
+ ></i>
216
+ </div>
217
+ </div>` +
218
+ html `
219
+ <div class="d-flex align-items-center p-2 shadow border-bottom"
220
+ style="gap:10px;">
190
221
  ${(() => {
191
- const list = [
192
- {
193
- key: 'writer',
194
- label: '文案寫手',
195
- },
196
- {
197
- key: 'order_analysis',
198
- label: '訂單分析',
199
- },
200
- {
201
- key: 'operation_guide',
202
- label: '操作引導',
203
- },
204
- ];
222
+ const list = AiMessage.ai_support;
205
223
  return list
206
224
  .map((dd) => {
207
225
  if (AiMessage.vm.select_bt === dd.key) {
208
- return html `<div class="d-flex align-items-center justify-content-center fw-bold px-3 py-2 fw-500 select-label-ai-message">
209
- ${dd.label}
210
- </div>`;
226
+ return html `
227
+ <div class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-label-ai-message fs-6">
228
+ ${dd.label}
229
+ </div>`;
211
230
  }
212
231
  else {
213
- return html `<div
214
- class="d-flex align-items-center justify-content-center fw-bold px-3 py-2 fw-500 select-btn-ai-message"
215
- onclick="${gvc.event(() => {
232
+ return html `
233
+ <div class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-btn-ai-message fs-6"
234
+ onclick="${gvc.event(() => {
216
235
  AiMessage.vm.select_bt = dd.key;
217
236
  refresh();
218
237
  })}"
219
- >
220
- ${dd.label}
221
- </div>`;
238
+ >
239
+ ${dd.label}
240
+ </div>`;
222
241
  }
223
242
  })
224
243
  .join('');
@@ -273,57 +292,76 @@ export class AiMessage {
273
292
  return markdownString.replace(/\n/g, '<br>');
274
293
  }
275
294
  function add_line(dd, index) {
295
+ dd.message.text = dd.message.text || '';
276
296
  if (dd.user_id == 'manager') {
277
297
  dd.user_data = AiMessage.config;
278
298
  }
279
299
  const replacedString = markdownToHTML(dd.message.text);
300
+ const width = (document.body.clientWidth < 768) ? document.body.clientWidth - 120 : 348;
280
301
  if (cf.user_id !== dd.user_id) {
281
- return html ` <div class="mt-auto d-flex align-items-start ${vm.data[index + 1] && vm.data[index + 1].user_id === dd.user_id ? `mb-1` : `mb-3`}">
282
- <img
283
- src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sas0s9s0s1sesas0_1697354801736-Glitterlogo.png"
284
- class="rounded-circle border"
285
- width="40"
286
- style="background: white;border-radius: 50%;width: 40px;height: 40px;"
287
- />
288
- <div class="ps-2 ms-1" style="max-width: 348px;">
289
- <div
290
- class="p-3 mb-1"
291
- style="background:#eeeef1;border-top-right-radius: .5rem; border-bottom-right-radius: .5rem; border-bottom-left-radius: .5rem;white-space: normal;"
292
- >
293
- ${replacedString}
294
- <div class="w-100 d-flex align-items-center justify-content-end text-muted fs-sm mt-2 ${!(dd.message.usage) ? `d-none` : ``}" style="letter-spacing: 1.2px;">${dd.message.usage ? `消耗『${dd.message.usage.toLocaleString()}』點 AI Points` : ``}</div>
295
- </div>
296
- <div class="fs-sm d-flex text-muted time-tt ${vm.data[index + 1] && vm.data[index + 1].user_id === dd.user_id ? `d-none` : ``}">
297
- ${gvc.glitter.ut.dateFormat(new Date(dd.created_time), 'MM-dd hh:mm')}
302
+ return html `
303
+ <div class="mt-auto d-flex align-items-start ${vm.data[index + 1] && vm.data[index + 1].user_id === dd.user_id ? `mb-1` : `mb-3`}">
304
+ <img
305
+ src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sas0s9s0s1sesas0_1697354801736-Glitterlogo.png"
306
+ class="rounded-circle border"
307
+ width="40"
308
+ style="background: white;border-radius: 50%;width: 40px;height: 40px;"
309
+ />
310
+ <div class="ps-2 ms-1" style="max-width: ${width}px;">
311
+ <div
312
+ class="p-3 mb-1"
313
+ style="background:#eeeef1;border-top-right-radius: .5rem; border-bottom-right-radius: .5rem; border-bottom-left-radius: .5rem;white-space: normal;"
314
+ >
315
+ ${replacedString}
316
+ ${dd.message.image ? `<img style="cursor: pointer;width:${width - 40}px;height: ${width - 40}px;"
317
+ src="${dd.message.image}"
318
+ alt="image"
319
+ onclick="${gvc.event(() => {
320
+ gvc.glitter.openDiaLog(new URL('./dialog/image-preview.js', gvc.glitter.root_path).href, 'preview', dd.message.image);
321
+ })}">` : ``}
322
+ <div class="w-100 d-flex align-items-center justify-content-end text-muted fs-sm mt-2 ${!(dd.message.usage) ? `d-none` : ``}"
323
+ style="letter-spacing: 1.2px;">
324
+ ${dd.message.usage ? `消耗『${dd.message.usage.toLocaleString()}』點 AI Points` : ``}
325
+ </div>
326
+ </div>
327
+ <div class="fs-sm d-flex text-muted time-tt ${vm.data[index + 1] && vm.data[index + 1].user_id === dd.user_id ? `d-none` : ``}">
328
+ ${gvc.glitter.ut.dateFormat(new Date(dd.created_time), 'MM-dd hh:mm')}
329
+ </div>
298
330
  </div>
299
- </div>
300
- </div>`;
331
+ </div>`;
301
332
  }
302
333
  else {
303
- return html ` <div class="d-flex align-items-start justify-content-end ${vm.data[index + 1] && vm.data[index + 1].user_id === dd.user_id ? `mb-1` : `mb-3`}">
304
- <div class="pe-2 me-1" style="max-width: 348px;">
305
- <div
306
- class=" text-light p-3 mb-1"
307
- style="background:#575757;border-top-left-radius: .5rem; border-bottom-right-radius: .5rem; border-bottom-left-radius: .5rem;white-space: normal;"
308
- >
309
- ${replacedString}
310
- </div>
311
- <div
312
- class="fw-500 d-flex justify-content-end align-items-center time-tt fs-sm text-muted ${vm.data[index + 1] &&
334
+ return html `
335
+ <div class="d-flex align-items-start justify-content-end ${vm.data[index + 1] && vm.data[index + 1].user_id === dd.user_id ? `mb-1` : `mb-3`}">
336
+ <div class="pe-2 me-1" style="max-width: ${width}px;">
337
+ <div
338
+ class=" text-light p-3 mb-1"
339
+ style="background:#575757;border-top-left-radius: .5rem; border-bottom-right-radius: .5rem; border-bottom-left-radius: .5rem;white-space: normal;"
340
+ >
341
+ ${replacedString}
342
+ ${dd.message.image ? `<img style="cursor: pointer;width:${width - 40}px;height: ${width - 40}px;"
343
+ src="${dd.message.image}"
344
+ alt="image"
345
+ onclick="${gvc.event(() => {
346
+ gvc.glitter.openDiaLog(new URL('./dialog/image-preview.js', gvc.glitter.root_path).href, 'preview', dd.message.image);
347
+ })}">` : ``}
348
+ </div>
349
+ <div
350
+ class="fw-500 d-flex justify-content-end align-items-center time-tt fs-sm text-muted ${vm.data[index + 1] &&
313
351
  vm.data[index + 1].user_id === dd.user_id
314
352
  ? `d-none`
315
353
  : ``}"
316
- style="gap:5px;"
317
- >
318
- <span> ${gvc.glitter.ut.dateFormat(new Date(dd.created_time), 'MM/dd hh:mm')}</span>
319
- ${vm.last_read.find((d2) => {
354
+ style="gap:5px;"
355
+ >
356
+ <span> ${gvc.glitter.ut.dateFormat(new Date(dd.created_time), 'MM/dd hh:mm')}</span>
357
+ ${vm.last_read.find((d2) => {
320
358
  return d2.user_id !== cf.user_id && new Date(d2.last_read).getTime() >= new Date(dd.created_time).getTime();
321
359
  })
322
360
  ? `已讀`
323
361
  : ``}
362
+ </div>
324
363
  </div>
325
- </div>
326
- </div>`;
364
+ </div>`;
327
365
  }
328
366
  }
329
367
  function connect() {
@@ -393,12 +431,13 @@ export class AiMessage {
393
431
  bind: viewId,
394
432
  view: () => {
395
433
  if (vm.loading) {
396
- return html `<div class="d-flex align-items-center justify-content-center w-100 flex-column pt-3">
397
- <div class="spinner-border" role="status">
398
- <span class="sr-only"></span>
399
- </div>
400
- <span class="mt-2">AI 就位中...</span>
401
- </div>`;
434
+ return html `
435
+ <div class="d-flex align-items-center justify-content-center w-100 flex-column pt-3">
436
+ <div class="spinner-border" role="status">
437
+ <span class="sr-only"></span>
438
+ </div>
439
+ <span class="mt-2">AI 就位中...</span>
440
+ </div>`;
402
441
  }
403
442
  return html `
404
443
  ${gvc.bindView(() => {
@@ -424,6 +463,10 @@ export class AiMessage {
424
463
  key: 'operation_guide',
425
464
  text: '您好!我是AI後台引導員,能協助你使用平台,如果有任何不了解的地方請直接詢問我。',
426
465
  },
466
+ {
467
+ key: 'design',
468
+ text: '您好!我是AI設計師,能協助你生成任何行銷或商品圖面。',
469
+ }
427
470
  ].find((dd) => {
428
471
  return dd.key === AiMessage.vm.select_bt;
429
472
  })) === null || _a === void 0 ? void 0 : _a.text,
@@ -486,16 +529,20 @@ export class AiMessage {
486
529
  view: () => {
487
530
  var _a;
488
531
  if (vm.ai_loading) {
489
- return html ` <div class="d-flex align-items-center justify-content-center ai-waiting flex-fill mx-2">
490
- <div class="w-100 py-2 bt_ffb40_stroke d-flex align-items-center justify-content-center" style="gap: 8px;">
491
- <div class="spinner-border" style="width:20px;height: 20px;"></div>
492
- AI 解答中
493
- </div>
494
- </div>`;
532
+ return html `
533
+ <div class="d-flex align-items-center justify-content-center ai-waiting flex-fill mx-2">
534
+ <div class="w-100 py-2 bt_ffb40_stroke d-flex align-items-center justify-content-center"
535
+ style="gap: 8px;">
536
+ <div class="spinner-border"
537
+ style="width:20px;height: 20px;"></div>
538
+ AI 解答中
539
+ </div>
540
+ </div>`;
495
541
  }
496
542
  else {
497
543
  return html `
498
- <div class="d-flex px-2" style="overflow-x: auto;gap:5px;">
544
+ <div class="d-flex px-2"
545
+ style="overflow-x: auto;gap:5px;">
499
546
  ${(_a = [
500
547
  {
501
548
  key: 'writer',
@@ -528,14 +575,20 @@ export class AiMessage {
528
575
  '如何設定網站佈景主題?',
529
576
  ],
530
577
  },
578
+ {
579
+ key: 'design',
580
+ data: ['家具電商平台宣傳圖,現代極簡主義,背景保持乾淨整潔',
581
+ '服飾店宣傳圖,模特背著名牌包,腳穿高跟鞋']
582
+ }
531
583
  ]
532
584
  .find((dd) => {
533
585
  return dd.key === AiMessage.vm.select_bt;
534
586
  })) === null || _a === void 0 ? void 0 : _a.data.map((dd) => {
535
- return html `<div
536
- class="insignia insignia-secondary bgf6"
537
- style="white-space: nowrap;cursor: pointer;"
538
- onclick="${gvc.event(() => {
587
+ return html `
588
+ <div
589
+ class="insignia insignia-secondary bgf6"
590
+ style="white-space: nowrap;cursor: pointer;"
591
+ onclick="${gvc.event(() => {
539
592
  vm.ai_loading = true;
540
593
  gvc.notifyDataChange('footer-ai');
541
594
  Chat.postMessage({
@@ -549,14 +602,19 @@ export class AiMessage {
549
602
  vm.message = '';
550
603
  });
551
604
  })}"
552
- >
553
- ${dd}
554
- </div>`;
605
+ >
606
+ ${dd}
607
+ </div>`;
555
608
  }).join('')}
556
609
  </div>
557
- <div class="px-2 d-flex align-items-center w-100 border-0 px-2" style="background: white;border-radius: 0px;">
610
+ <div class="px-2 d-flex align-items-center w-100 border-0 px-2"
611
+ style="background: white;border-radius: 0px;">
558
612
  ${BgWidget.customButton({
559
- button: { color: 'snow', size: 'sm', style: 'min-height: 40px;' },
613
+ button: {
614
+ color: 'snow',
615
+ size: 'sm',
616
+ style: 'min-height: 40px;'
617
+ },
560
618
  icon: { name: 'fa-regular fa-broom-wide text-dark' },
561
619
  text: { name: '重置' },
562
620
  event: gvc.event(() => {
@@ -578,8 +636,9 @@ export class AiMessage {
578
636
  }),
579
637
  })}
580
638
  ${[
581
- html `<div class="position-relative w-100 mx-2">
582
- ${gvc.bindView(() => {
639
+ html `
640
+ <div class="position-relative w-100 mx-2">
641
+ ${gvc.bindView(() => {
583
642
  return {
584
643
  bind: textAreaId,
585
644
  view: () => {
@@ -612,12 +671,13 @@ export class AiMessage {
612
671
  },
613
672
  };
614
673
  })}
615
- </div>`,
616
- html ` <button
617
- type="button"
618
- class="btn btn-icon btn-lg d-sm-inline-flex ms-1 send-action"
619
- style="height: 36px;background: ${AiMessage.config.color};"
620
- onclick="${gvc.event(() => {
674
+ </div>`,
675
+ html `
676
+ <button
677
+ type="button"
678
+ class="btn btn-icon btn-lg d-sm-inline-flex ms-1 send-action"
679
+ style="height: 36px;background: ${AiMessage.config.color};"
680
+ onclick="${gvc.event(() => {
621
681
  if (vm.message) {
622
682
  vm.ai_loading = true;
623
683
  gvc.notifyDataChange('footer-ai');
@@ -638,9 +698,9 @@ export class AiMessage {
638
698
  else {
639
699
  }
640
700
  })}"
641
- >
642
- <i class="fa-regular fa-paper-plane-top"></i>
643
- </button>`,
701
+ >
702
+ <i class="fa-regular fa-paper-plane-top"></i>
703
+ </button>`,
644
704
  ].join('')}
645
705
  </div>
646
706
  `;
@@ -651,13 +711,15 @@ export class AiMessage {
651
711
  class: `d-flex flex-column w-100 position-fixed bottom-0 position-lg-absolute py-2 border-top bg-white`,
652
712
  style: `gap:8px;${(parseInt(gvc.glitter.share.bottom_inset, 10)) ? `padding-bottom:${parseInt(gvc.glitter.share.bottom_inset, 10) + 10}px !important;` : ``}`,
653
713
  },
654
- onCreate: () => { },
714
+ onCreate: () => {
715
+ },
655
716
  };
656
717
  })}
657
718
  `;
658
719
  },
659
720
  divCreate: {},
660
- onCreate: () => { },
721
+ onCreate: () => {
722
+ },
661
723
  onDestroy: () => {
662
724
  vm.close = true;
663
725
  socket.close();
@@ -680,13 +742,18 @@ export class AiMessage {
680
742
  var _a, _b;
681
743
  return html `
682
744
  <div class=" card rounded-3">
683
- <div class="p-3 rounded-top" style="width: 100%;white-space: normal;background: ${AiMessage.config.color};">
684
- <div class="text-white fw-bold" style=" font-size: 20px;">${(_a = AiMessage.config.title) !== null && _a !== void 0 ? _a : ''}</div>
685
- <p class=" text-white mt-2 mb-4" style=" font-size: 16px;line-height: 22px;font-weight: 300;">${((_b = AiMessage.config.content) !== null && _b !== void 0 ? _b : '').replace(/\n/g, `<br>`)}</p>
745
+ <div class="p-3 rounded-top"
746
+ style="width: 100%;white-space: normal;background: ${AiMessage.config.color};">
747
+ <div class="text-white fw-bold" style=" font-size: 20px;">
748
+ ${(_a = AiMessage.config.title) !== null && _a !== void 0 ? _a : ''}
749
+ </div>
750
+ <p class=" text-white mt-2 mb-4"
751
+ style=" font-size: 16px;line-height: 22px;font-weight: 300;">
752
+ ${((_b = AiMessage.config.content) !== null && _b !== void 0 ? _b : '').replace(/\n/g, `<br>`)}</p>
686
753
  <button
687
- class="btn w-100 rounded"
688
- style=" background-color: rgba(0, 0, 0, 0.2);"
689
- onclick="${gvc.event(() => {
754
+ class="btn w-100 rounded"
755
+ style=" background-color: rgba(0, 0, 0, 0.2);"
756
+ onclick="${gvc.event(() => {
690
757
  goToChat('');
691
758
  })}"
692
759
  >
@@ -704,26 +771,32 @@ export class AiMessage {
704
771
  const returnHtml = [];
705
772
  const robot = (yield ApiUser.getPublicConfig('robot_auto_reply', 'manager')).response.value.question;
706
773
  if (robot.length > 0) {
707
- returnHtml.push(html ` <div class=" fw-bold" style=" height: 60px;display: flex;align-items: center;justify-content: center;font-size: 16px;">
708
- <div class="" style="color: black;">即時解答</div>
709
- </div>`);
774
+ returnHtml.push(html `
775
+ <div class=" fw-bold"
776
+ style=" height: 60px;display: flex;align-items: center;justify-content: center;font-size: 16px;">
777
+ <div class="" style="color: black;">即時解答</div>
778
+ </div>`);
710
779
  }
711
780
  robot.map((dd) => {
712
- returnHtml.push(html `<div
713
- class="rounded-3 w-100 d-flex px-3 btn-white-primary py-2 fw-500"
714
- style=" "
715
- onclick="${gvc.event(() => {
781
+ returnHtml.push(html `
782
+ <div
783
+ class="rounded-3 w-100 d-flex px-3 btn-white-primary py-2 fw-500"
784
+ style=" "
785
+ onclick="${gvc.event(() => {
716
786
  goToChat(dd.ask);
717
787
  })}"
718
- >
719
- <div style="white-space: normal;" class="flex-fill">${dd.ask}</div>
720
- <i class="fa-solid fa-paper-plane-top" style="font-size:18px;" aria-hidden="true"></i>
721
- </div>`);
788
+ >
789
+ <div style="white-space: normal;" class="flex-fill">${dd.ask}</div>
790
+ <i class="fa-solid fa-paper-plane-top" style="font-size:18px;"
791
+ aria-hidden="true"></i>
792
+ </div>`);
722
793
  });
723
794
  resolve(returnHtml.join('') &&
724
- html ` <div class="px-3 pb-3" style=" display: flex;flex-direction: column;align-items: center;justify-content: center;gap:10px;font-size: 16px;">
725
- ${returnHtml.join('')}
726
- </div>`);
795
+ html `
796
+ <div class="px-3 pb-3"
797
+ style=" display: flex;flex-direction: column;align-items: center;justify-content: center;gap:10px;font-size: 16px;">
798
+ ${returnHtml.join('')}
799
+ </div>`);
727
800
  }));
728
801
  },
729
802
  divCreate: {
@@ -754,5 +827,7 @@ AiMessage.vm = {
754
827
  select_bt: 'writer',
755
828
  };
756
829
  AiMessage.id = `dsmdklweew3`;
757
- AiMessage.toggle = (visible) => { };
830
+ AiMessage.toggle = (visible) => {
831
+ };
832
+ AiMessage.ai_support = [];
758
833
  window.glitter.setModule(import.meta.url, AiMessage);