@gengage/assistant-fe 0.4.6 → 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.
- package/README.md +21 -1
- package/dist/{api-paths-C4GDpeTf.js → api-paths-DR5bPNhi.js} +2 -3
- package/dist/assistant-fe.css +1 -1
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +2 -2
- package/dist/chat.js +1 -1
- package/dist/common/overlay.d.ts +4 -0
- package/dist/common/protocol-adapter.d.ts +1 -1
- package/dist/common/safe-html.d.ts +1 -1
- package/dist/{common-CEN5OW7E.js → common-c-awF96O.js} +3 -3
- package/dist/common.js +8 -8
- package/dist/{connection-warning-B6oIU-9s.js → connection-warning-ecZqpczd.js} +1 -1
- package/dist/{context-VIG4SVcS.js → context-DGz5F81j.js} +82 -79
- package/dist/index.d.ts +4 -4
- package/dist/index.js +44 -42
- package/dist/{native-webview-DudQ7nHe.js → native-webview-C_PmKnzm.js} +1 -1
- package/dist/native.iife.js +7 -7
- package/dist/native.js +1 -1
- package/dist/{overlay-1EO41ZC7.js → overlay-DJ1ZRMfI.js} +75 -75
- package/dist/overlay.js +2 -2
- package/dist/{pill-launcher-57nrdLRr.js → pill-launcher-DSEeJT9h.js} +2 -2
- package/dist/qna/runtime.d.ts +2 -1
- package/dist/qna/types.d.ts +14 -0
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.css +1 -1
- package/dist/qna.iife.js +21 -21
- package/dist/qna.js +1 -1
- package/dist/{runtime-BdwZZIrO.js → runtime-BsZZ8zTg.js} +5 -4
- package/dist/{runtime-C0qZk0y7.js → runtime-DNbjpTCh.js} +4 -4
- package/dist/runtime-SKDvc0Xc.js +660 -0
- package/dist/simbut/index.d.ts +3 -1
- package/dist/simbut/types.d.ts +11 -0
- package/dist/simbut-Bw3vBFtW.js +109 -0
- package/dist/simbut.css +1 -1
- package/dist/simbut.iife.js +10 -10
- package/dist/simbut.js +1 -1
- package/dist/simrel/index.d.ts +2 -0
- package/dist/simrel/renderers/default.d.ts +40 -0
- package/dist/simrel-DJZ983BF.js +513 -0
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.css +3 -0
- package/dist/simrel.iife.js +38 -38
- package/dist/simrel.js +4 -3
- package/dist/{widget-base-TgwiA8cD.js → widget-base-2-B1Ch5I.js} +1 -1
- package/package.json +6 -1
- package/dist/runtime-DDu8Wk0z.js +0 -629
- package/dist/simbut-BMWC6x_t.js +0 -81
- package/dist/simrel-ohfkluhp.js +0 -55
package/dist/simbut-BMWC6x_t.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { t as u } from "./widget-base-TgwiA8cD.js";
|
|
2
|
-
import { D as d, _ as f, j as m, v as b } from "./context-VIG4SVcS.js";
|
|
3
|
-
import { t as g } from "./locale-CfqNifrU.js";
|
|
4
|
-
var l = { findSimilarLabel: "Benzerlerini Bul" }, p = { findSimilarLabel: "Find Similar" };
|
|
5
|
-
function S(t, i) {
|
|
6
|
-
return i?.findSimilarLabel ? i.findSimilarLabel : (t ?? "tr").toLowerCase().startsWith("en") ? p.findSimilarLabel : l.findSimilarLabel;
|
|
7
|
-
}
|
|
8
|
-
function s(t) {
|
|
9
|
-
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;
|
|
10
|
-
return i ?? o;
|
|
11
|
-
}
|
|
12
|
-
var _ = class extends u {
|
|
13
|
-
constructor(...t) {
|
|
14
|
-
super(...t), this._button = null, this._label = l.findSimilarLabel;
|
|
15
|
-
}
|
|
16
|
-
async onInit(t) {
|
|
17
|
-
this._label = S(t.locale, t.i18n), this.root.classList.add("gengage-simbut-root"), window.getComputedStyle(this.root).position === "static" && (this.root.style.position = "relative");
|
|
18
|
-
const i = document.createElement("button");
|
|
19
|
-
i.type = "button", i.className = "gengage-chat-find-similar-pill", i.lang = g(t.locale), i.textContent = this._label, this._button = i;
|
|
20
|
-
const o = () => {
|
|
21
|
-
i.disabled = !(s(this.config) && (this.config.onFindSimilar || this.config.chat));
|
|
22
|
-
};
|
|
23
|
-
i.addEventListener("click", (h) => {
|
|
24
|
-
h.stopPropagation();
|
|
25
|
-
const e = s(this.config);
|
|
26
|
-
if (!e) return;
|
|
27
|
-
const a = this.config.imageUrl, n = typeof a == "string" && m(a) ? a : void 0;
|
|
28
|
-
if (d(this._label, "findSimilar"), f(e), this.config.onFindSimilar) {
|
|
29
|
-
this.config.onFindSimilar(n ? {
|
|
30
|
-
sku: e,
|
|
31
|
-
imageUrl: n
|
|
32
|
-
} : { sku: e });
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const r = this.config.chat;
|
|
36
|
-
if (!r) return;
|
|
37
|
-
const c = {
|
|
38
|
-
title: this._label,
|
|
39
|
-
type: "findSimilar",
|
|
40
|
-
payload: n ? {
|
|
41
|
-
sku: e,
|
|
42
|
-
image_url: n
|
|
43
|
-
} : { sku: e }
|
|
44
|
-
};
|
|
45
|
-
r.openWithAction(c, { sku: e });
|
|
46
|
-
}), this.root.appendChild(i), o(), b("simbut");
|
|
47
|
-
}
|
|
48
|
-
onUpdate(t) {
|
|
49
|
-
if (!this._button) return;
|
|
50
|
-
const i = !!s(this.config) && (!!this.config.onFindSimilar || !!this.config.chat);
|
|
51
|
-
this._button.disabled = !i;
|
|
52
|
-
}
|
|
53
|
-
hide() {
|
|
54
|
-
this.isVisible && (this.isVisible = !1, this._button && (this._button.style.display = "none"), this.onHide(), this.emit("hide"));
|
|
55
|
-
}
|
|
56
|
-
show() {
|
|
57
|
-
this.isVisible || (this.isVisible = !0, this._button && (this._button.style.display = ""), this.onShow(), this.emit("show"));
|
|
58
|
-
}
|
|
59
|
-
_cleanupRoot() {
|
|
60
|
-
}
|
|
61
|
-
onShow() {
|
|
62
|
-
}
|
|
63
|
-
onHide() {
|
|
64
|
-
}
|
|
65
|
-
onDestroy() {
|
|
66
|
-
this._button?.remove(), this._button = null;
|
|
67
|
-
}
|
|
68
|
-
setChat(t) {
|
|
69
|
-
if (this.config.chat = t, this._button) {
|
|
70
|
-
const i = !!s(this.config) && (!!this.config.onFindSimilar || !!this.config.chat);
|
|
71
|
-
this._button.disabled = !i;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
function L() {
|
|
76
|
-
return new _();
|
|
77
|
-
}
|
|
78
|
-
export {
|
|
79
|
-
L as n,
|
|
80
|
-
_ as t
|
|
81
|
-
};
|
package/dist/simrel-ohfkluhp.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { a as t, c as o, n as r, o as a, t as i, u as e } from "./schemas-CLo8wCjs.js";
|
|
2
|
-
var n = a({
|
|
3
|
-
sku: o(),
|
|
4
|
-
name: o(),
|
|
5
|
-
imageUrl: o().url().optional(),
|
|
6
|
-
price: o().optional(),
|
|
7
|
-
originalPrice: o().optional(),
|
|
8
|
-
discountPercent: t().optional(),
|
|
9
|
-
url: o().url(),
|
|
10
|
-
brand: o().optional(),
|
|
11
|
-
rating: t().min(0).max(5).optional(),
|
|
12
|
-
reviewCount: t().int().nonnegative().optional()
|
|
13
|
-
}), c = a({
|
|
14
|
-
layout: i(["grid", "carousel"]).optional(),
|
|
15
|
-
columns: t().int().positive().optional()
|
|
16
|
-
}), s = a({
|
|
17
|
-
product: n,
|
|
18
|
-
index: t().int().nonnegative(),
|
|
19
|
-
discountType: i(["strike-through", "badge"]).optional()
|
|
20
|
-
}), d = a({
|
|
21
|
-
sku: o(),
|
|
22
|
-
label: o().optional(),
|
|
23
|
-
cartCode: o()
|
|
24
|
-
}), l = a({ actions: r(a({
|
|
25
|
-
label: o(),
|
|
26
|
-
action: a({
|
|
27
|
-
title: o(),
|
|
28
|
-
type: o(),
|
|
29
|
-
payload: e().optional()
|
|
30
|
-
})
|
|
31
|
-
})) }), p = a({ message: o().optional() }), m = { components: {
|
|
32
|
-
ProductGrid: {
|
|
33
|
-
schema: c,
|
|
34
|
-
description: "Outer grid or carousel container for similar products."
|
|
35
|
-
},
|
|
36
|
-
ProductCard: {
|
|
37
|
-
schema: s,
|
|
38
|
-
description: "A single product card with image, title, price, and actions."
|
|
39
|
-
},
|
|
40
|
-
AddToCartButton: {
|
|
41
|
-
schema: d,
|
|
42
|
-
description: "Add-to-cart CTA rendered inside or below a product card."
|
|
43
|
-
},
|
|
44
|
-
QuickActions: {
|
|
45
|
-
schema: l,
|
|
46
|
-
description: "A row of quick-action buttons below product info."
|
|
47
|
-
},
|
|
48
|
-
EmptyState: {
|
|
49
|
-
schema: p,
|
|
50
|
-
description: "Empty state shown when no similar products are available."
|
|
51
|
-
}
|
|
52
|
-
} };
|
|
53
|
-
export {
|
|
54
|
-
m as t
|
|
55
|
-
};
|