@gengage/assistant-fe 0.4.5 → 0.4.7

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 (63) hide show
  1. package/README.md +22 -2
  2. package/dist/api-paths-DR5bPNhi.js +1213 -0
  3. package/dist/assistant-fe.css +1 -1
  4. package/dist/chat/index.d.ts +1 -374
  5. package/dist/chat/runtime.d.ts +374 -0
  6. package/dist/chat-BRKK63lt.js +303 -0
  7. package/dist/chat-runtime.js +13 -0
  8. package/dist/chat.iife.js +8 -8
  9. package/dist/chat.js +11 -10
  10. package/dist/common/config-constants.d.ts +1 -0
  11. package/dist/common/config-schema.d.ts +0 -1
  12. package/dist/common/overlay.d.ts +8 -4
  13. package/dist/common/protocol-adapter.d.ts +1 -1
  14. package/dist/common/safe-html.d.ts +1 -1
  15. package/dist/common-c-awF96O.js +491 -0
  16. package/dist/common.js +78 -76
  17. package/dist/{connection-warning-n88bjkqL.js → connection-warning-ecZqpczd.js} +1 -1
  18. package/dist/context-DGz5F81j.js +532 -0
  19. package/dist/index.d.ts +4 -4
  20. package/dist/index.js +73 -68
  21. package/dist/locale-CfqNifrU.js +7 -0
  22. package/dist/native-webview-C_PmKnzm.js +273 -0
  23. package/dist/native.iife.js +28 -91
  24. package/dist/native.js +1 -1
  25. package/dist/overlay-DJ1ZRMfI.js +212 -0
  26. package/dist/overlay.d.ts +4 -0
  27. package/dist/overlay.js +10 -0
  28. package/dist/pill-launcher-DSEeJT9h.js +364 -0
  29. package/dist/qna/index.d.ts +1 -61
  30. package/dist/qna/runtime.d.ts +62 -0
  31. package/dist/qna/types.d.ts +14 -0
  32. package/dist/qna-BNvttR6s.js +40 -0
  33. package/dist/qna-runtime.js +8 -0
  34. package/dist/qna.css +1 -1
  35. package/dist/qna.iife.js +21 -21
  36. package/dist/qna.js +6 -5
  37. package/dist/{simrel-K2TGFi1r.js → runtime-BsZZ8zTg.js} +245 -293
  38. package/dist/{chat-B1lLKIxj.js → runtime-DNbjpTCh.js} +1643 -2297
  39. package/dist/runtime-SKDvc0Xc.js +660 -0
  40. package/dist/schemas-CLo8wCjs.js +3207 -0
  41. package/dist/simbut/index.d.ts +3 -1
  42. package/dist/simbut/types.d.ts +11 -0
  43. package/dist/simbut-Bw3vBFtW.js +109 -0
  44. package/dist/simbut.css +1 -1
  45. package/dist/simbut.iife.js +10 -10
  46. package/dist/simbut.js +1 -1
  47. package/dist/simrel/index.d.ts +3 -59
  48. package/dist/simrel/renderers/default.d.ts +40 -0
  49. package/dist/simrel/runtime.d.ts +59 -0
  50. package/dist/simrel-DJZ983BF.js +513 -0
  51. package/dist/simrel-runtime.js +8 -0
  52. package/dist/simrel.css +3 -0
  53. package/dist/simrel.iife.js +38 -38
  54. package/dist/simrel.js +8 -6
  55. package/dist/widget-base-2-B1Ch5I.js +578 -0
  56. package/package.json +22 -1
  57. package/dist/common-C5e2gLuG.js +0 -387
  58. package/dist/locale-MM0U5eeR.js +0 -1109
  59. package/dist/native-webview-niMtkiHX.js +0 -586
  60. package/dist/qna-C5Ok3wd0.js +0 -663
  61. package/dist/schemas-JpRGzRQT.js +0 -4419
  62. package/dist/simbut-Cb5RfaAp.js +0 -79
  63. /package/dist/{price-formatter-CR6VT5z4.js → price-formatter-xI3g9Cd4.js} +0 -0
@@ -1,79 +0,0 @@
1
- import { A as u, U as d, k as f, n as b, t as g, z as m } from "./locale-MM0U5eeR.js";
2
- var l = { findSimilarLabel: "Benzerlerini Bul" }, S = { findSimilarLabel: "Find Similar" };
3
- function p(t, i) {
4
- return i?.findSimilarLabel ? i.findSimilarLabel : (t ?? "tr").toLowerCase().startsWith("en") ? S.findSimilarLabel : l.findSimilarLabel;
5
- }
6
- function s(t) {
7
- const i = typeof t.sku == "string" && t.sku.length > 0 ? t.sku : void 0, o = typeof t.pageContext?.sku == "string" && t.pageContext.sku.length > 0 ? t.pageContext.sku : void 0;
8
- return i ?? o;
9
- }
10
- var _ = class extends b {
11
- constructor(...t) {
12
- super(...t), this._button = null, this._label = l.findSimilarLabel;
13
- }
14
- async onInit(t) {
15
- this._label = p(t.locale, t.i18n), this.root.classList.add("gengage-simbut-root"), window.getComputedStyle(this.root).position === "static" && (this.root.style.position = "relative");
16
- const i = document.createElement("button");
17
- i.type = "button", i.className = "gengage-chat-find-similar-pill", i.lang = g(t.locale), i.textContent = this._label, this._button = i;
18
- const o = () => {
19
- i.disabled = !(s(this.config) && (this.config.onFindSimilar || this.config.chat));
20
- };
21
- i.addEventListener("click", (h) => {
22
- h.stopPropagation();
23
- const n = s(this.config);
24
- if (!n) return;
25
- const a = this.config.imageUrl, e = typeof a == "string" && d(a) ? a : void 0;
26
- if (m(this._label, "findSimilar"), f(n), this.config.onFindSimilar) {
27
- this.config.onFindSimilar(e ? {
28
- sku: n,
29
- imageUrl: e
30
- } : { sku: n });
31
- return;
32
- }
33
- const r = this.config.chat;
34
- if (!r) return;
35
- const c = {
36
- title: this._label,
37
- type: "findSimilar",
38
- payload: e ? {
39
- sku: n,
40
- image_url: e
41
- } : { sku: n }
42
- };
43
- r.openWithAction(c, { sku: n });
44
- }), this.root.appendChild(i), o(), u("simbut");
45
- }
46
- onUpdate(t) {
47
- if (!this._button) return;
48
- const i = !!s(this.config) && (!!this.config.onFindSimilar || !!this.config.chat);
49
- this._button.disabled = !i;
50
- }
51
- hide() {
52
- this.isVisible && (this.isVisible = !1, this._button && (this._button.style.display = "none"), this.onHide(), this.emit("hide"));
53
- }
54
- show() {
55
- this.isVisible || (this.isVisible = !0, this._button && (this._button.style.display = ""), this.onShow(), this.emit("show"));
56
- }
57
- _cleanupRoot() {
58
- }
59
- onShow() {
60
- }
61
- onHide() {
62
- }
63
- onDestroy() {
64
- this._button?.remove(), this._button = null;
65
- }
66
- setChat(t) {
67
- if (this.config.chat = t, this._button) {
68
- const i = !!s(this.config) && (!!this.config.onFindSimilar || !!this.config.chat);
69
- this._button.disabled = !i;
70
- }
71
- }
72
- };
73
- function k() {
74
- return new _();
75
- }
76
- export {
77
- k as n,
78
- _ as t
79
- };