@gengage/assistant-fe 0.5.7 → 0.6.0
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/dist/agentic/adaptor/create-adaptor.d.ts +19 -0
- package/dist/agentic/adaptor/fetch-bridge.d.ts +11 -0
- package/dist/agentic/adaptor/mount.d.ts +38 -0
- package/dist/agentic/context/chat-context.d.ts +15 -0
- package/dist/agentic/context/context-store.d.ts +20 -0
- package/dist/agentic/context/persistence.d.ts +12 -0
- package/dist/agentic/events/builders.d.ts +10 -0
- package/dist/agentic/events/error-taxonomy.d.ts +27 -0
- package/dist/agentic/events/product-normalize.d.ts +47 -0
- package/dist/agentic/events/ui-specs.d.ts +37 -0
- package/dist/agentic/flow/beauty-consulting-turn.d.ts +1 -0
- package/dist/agentic/flow/create-flow.d.ts +2 -0
- package/dist/agentic/flow/dispatch.d.ts +3 -0
- package/dist/agentic/index.d.ts +18 -0
- package/dist/agentic/index.js +620 -0
- package/dist/agentic/types.d.ts +212 -0
- package/dist/agentic/util/assistant-host.d.ts +11 -0
- package/dist/agentic/util/be-url.d.ts +4 -0
- package/dist/agentic/util/browser-memory.d.ts +13 -0
- package/dist/agentic/util/browser-tools.d.ts +31 -0
- package/dist/agentic/util/lazy-runtime-loader.d.ts +9 -0
- package/dist/agentic/util/request-text.d.ts +3 -0
- package/dist/agentic/util/time.d.ts +2 -0
- package/dist/agentic/worker/be-client.d.ts +15 -0
- package/dist/agentic/worker/entry.d.ts +2 -0
- package/dist/agentic/worker/flow-runner.d.ts +24 -0
- package/dist/agentic/worker/jwt-mint.d.ts +21 -0
- package/dist/agentic/worker/rpc.d.ts +24 -0
- package/dist/agentic/worker/tool-bridge.d.ts +2 -0
- package/dist/agentic/worker.d.ts +16 -0
- package/dist/agentic/worker.js +119 -0
- package/dist/agentic.iife.js +5 -0
- package/dist/{api-paths-CwzwbgQZ.js → api-paths-DJFF9RuZ.js} +1 -1
- package/dist/beauty-consulting-turn-BmPXbkQg.js +1019 -0
- package/dist/chat/api.d.ts +17 -0
- package/dist/chat/assistant-mode.d.ts +20 -0
- package/dist/chat/attachment-utils.d.ts +9 -0
- package/dist/chat/catalog.d.ts +455 -0
- package/dist/chat/chat-presentation-state.d.ts +53 -0
- package/dist/chat/components/AIGroupingCards.d.ts +15 -0
- package/dist/chat/components/AISuggestedSearchCards.d.ts +13 -0
- package/dist/chat/components/AITopPicks.d.ts +9 -0
- package/dist/chat/components/BeautyPhotoStep.d.ts +31 -0
- package/dist/chat/components/CategoriesContainer.d.ts +11 -0
- package/dist/chat/components/ChatDrawer.d.ts +362 -0
- package/dist/chat/components/ChoicePrompter.d.ts +21 -0
- package/dist/chat/components/ComparisonTable.d.ts +66 -0
- package/dist/chat/components/ConsultingStylePicker.d.ts +40 -0
- package/dist/chat/components/FloatingComparisonButton.d.ts +7 -0
- package/dist/chat/components/FloatingLauncher.d.ts +79 -0
- package/dist/chat/components/GroundingReviewCard.d.ts +11 -0
- package/dist/chat/components/HandoffNotice.d.ts +9 -0
- package/dist/chat/components/KvkkBanner.d.ts +6 -0
- package/dist/chat/components/Launcher.d.ts +28 -0
- package/dist/chat/components/PanelRestoreCard.d.ts +4 -0
- package/dist/chat/components/PanelTopBar.d.ts +32 -0
- package/dist/chat/components/PhotoAnalysisCard.d.ts +27 -0
- package/dist/chat/components/ProductSummaryCard.d.ts +12 -0
- package/dist/chat/components/ProsAndCons.d.ts +8 -0
- package/dist/chat/components/ReviewHighlights.d.ts +16 -0
- package/dist/chat/components/actionClassifier.d.ts +12 -0
- package/dist/chat/components/product-price-layout.d.ts +17 -0
- package/dist/chat/components/productMentionLinker.d.ts +26 -0
- package/dist/chat/components/renderUISpec.d.ts +15 -0
- package/dist/chat/components/typewriter.d.ts +24 -0
- package/dist/chat/extendedModeManager.d.ts +32 -0
- package/dist/chat/features/beauty-consulting/consulting-grid.d.ts +38 -0
- package/dist/chat/features/beauty-consulting/drawer-extensions.d.ts +22 -0
- package/dist/chat/features/beauty-consulting/mode-controller.d.ts +59 -0
- package/dist/chat/features/beauty-consulting/registry.d.ts +9 -0
- package/dist/chat/features/beauty-consulting/stream-handler.d.ts +45 -0
- package/dist/chat/history-storage.d.ts +85 -0
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/kvkk.d.ts +20 -0
- package/dist/chat/locales/en.d.ts +2 -0
- package/dist/chat/locales/index.d.ts +5 -0
- package/dist/chat/locales/tr.d.ts +2 -0
- package/dist/chat/panel-manager.d.ts +142 -0
- package/dist/chat/runtime.d.ts +416 -0
- package/dist/chat/session-persistence.d.ts +73 -0
- package/dist/chat/stream-error-display.d.ts +6 -0
- package/dist/chat/types.d.ts +547 -0
- package/dist/chat/utils/chat-presentation-debug.d.ts +18 -0
- package/dist/chat/utils/get-chat-scroll-element.d.ts +10 -0
- package/dist/chat/utils/ui.d.ts +10 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +12 -12
- package/dist/chat.js +1 -1
- package/dist/common/action-router.d.ts +26 -0
- package/dist/common/api-paths.d.ts +23 -0
- package/dist/common/client.d.ts +27 -0
- package/dist/common/communication-bridge.d.ts +51 -0
- package/dist/common/config-constants.d.ts +1 -0
- package/dist/common/config-schema.d.ts +54 -0
- package/dist/common/connection-warning.d.ts +8 -0
- package/dist/common/consulting-sources.d.ts +8 -0
- package/dist/common/context.d.ts +64 -0
- package/dist/common/css-escape.d.ts +1 -0
- package/dist/common/customization-factories.d.ts +59 -0
- package/dist/common/debug.d.ts +13 -0
- package/dist/common/events.d.ts +55 -0
- package/dist/common/fastIntent.d.ts +1 -0
- package/dist/common/find-similar-payload.d.ts +3 -0
- package/dist/common/ga-datalayer.d.ts +80 -0
- package/dist/common/global-error-toast.d.ts +6 -0
- package/dist/common/index.d.ts +47 -0
- package/dist/common/indexed-db.d.ts +89 -0
- package/dist/common/locale.d.ts +1 -0
- package/dist/common/native-webview.d.ts +60 -0
- package/dist/common/navigation.d.ts +1 -0
- package/dist/common/overlay.d.ts +172 -0
- package/dist/common/page-detect.d.ts +36 -0
- package/dist/common/pill-launcher.d.ts +51 -0
- package/dist/common/preflight.d.ts +13 -0
- package/dist/common/price-formatter.d.ts +35 -0
- package/dist/common/product-utils.d.ts +35 -0
- package/dist/common/protocol-adapter.d.ts +108 -0
- package/dist/common/renderer/dom.d.ts +3 -0
- package/dist/common/renderer/index.d.ts +4 -0
- package/dist/common/renderer/overrides.d.ts +23 -0
- package/dist/common/renderer/registry.d.ts +2 -0
- package/dist/common/renderer/types.d.ts +19 -0
- package/dist/common/safe-html.d.ts +22 -0
- package/dist/common/sdk-version.d.ts +3 -0
- package/dist/common/streaming.d.ts +52 -0
- package/dist/common/suggested-search-keywords.d.ts +18 -0
- package/dist/common/theme-utils.d.ts +15 -0
- package/dist/common/transport.d.ts +75 -0
- package/dist/common/tts-player.d.ts +13 -0
- package/dist/common/types.d.ts +379 -0
- package/dist/common/ui-theme.d.ts +9 -0
- package/dist/common/uuidv7.d.ts +7 -0
- package/dist/common/voice-input.d.ts +74 -0
- package/dist/common/widget-base.d.ts +82 -0
- package/dist/{common-KpJP1YwP.js → common-BydCGBNn.js} +90 -139
- package/dist/common.js +41 -41
- package/dist/{connection-warning-B5T_1oBn.js → connection-warning-Pbvk3J8k.js} +1 -1
- package/dist/{fastIntent--Ukm2nOh.js → fastIntent-CkYN2UOl.js} +199 -137
- package/dist/index.d.ts +25 -0
- package/dist/index.js +50 -50
- package/dist/native/index.d.ts +2 -0
- package/dist/{native-webview-qfjm4SHx.js → native-webview-JDC1vtde.js} +1 -1
- package/dist/native.iife.js +14 -14
- package/dist/native.js +1 -1
- package/dist/{overlay-CP5A0Hhf.js → overlay-BetAvpVZ.js} +19 -19
- package/dist/overlay.d.ts +4 -0
- package/dist/overlay.js +1 -1
- package/dist/qna/api.d.ts +23 -0
- package/dist/qna/catalog.d.ts +60 -0
- package/dist/qna/components/ButtonRow.d.ts +15 -0
- package/dist/qna/components/TextInput.d.ts +11 -0
- package/dist/qna/components/renderUISpec.d.ts +7 -0
- package/dist/qna/index.d.ts +3 -0
- package/dist/qna/locales/en.d.ts +2 -0
- package/dist/qna/locales/index.d.ts +4 -0
- package/dist/qna/locales/tr.d.ts +2 -0
- package/dist/qna/normalize-ui-specs.d.ts +15 -0
- package/dist/qna/runtime.d.ts +73 -0
- package/dist/qna/types.d.ts +98 -0
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +1 -1
- package/dist/qna.js +1 -1
- package/dist/{runtime-BPyXOyyp.js → runtime-DbZO1qG5.js} +3 -3
- package/dist/{runtime-G3idwfkM.js → runtime-OpNoB3cu.js} +894 -853
- package/dist/{runtime-C3yOvNFK.js → runtime-iCLkUjI3.js} +3 -3
- package/dist/simbut/index.d.ts +31 -0
- package/dist/simbut/locales.d.ts +3 -0
- package/dist/simbut/types.d.ts +43 -0
- package/dist/{simbut-CiknJI6-.js → simbut-FyXolmZY.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/simrel/api.d.ts +25 -0
- package/dist/simrel/catalog.d.ts +77 -0
- package/dist/simrel/components/GroupTabs.d.ts +24 -0
- package/dist/simrel/components/ProductCard.d.ts +19 -0
- package/dist/simrel/components/ProductGrid.d.ts +17 -0
- package/dist/simrel/components/renderUISpec.d.ts +7 -0
- package/dist/simrel/index.d.ts +5 -0
- package/dist/simrel/locales/en.d.ts +2 -0
- package/dist/simrel/locales/index.d.ts +4 -0
- package/dist/simrel/locales/tr.d.ts +2 -0
- package/dist/simrel/renderers/default.d.ts +41 -0
- package/dist/simrel/runtime.d.ts +68 -0
- package/dist/simrel/types.d.ts +145 -0
- package/dist/{simrel-C1YN71aW.js → simrel-CbLe5OAr.js} +1 -1
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +1 -1
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-UmvgIqDk.js → widget-base-COP8QwU3.js} +1 -1
- package/package.json +20 -6
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
import type { AddToCartHandlerResult, AddToCartParams, BaseWidgetConfig, ActionPayload } from '../common/types.js';
|
|
2
|
+
import type { UnknownActionPolicy } from '../common/config-schema.js';
|
|
3
|
+
import type { PillLauncherOptions } from '../common/pill-launcher.js';
|
|
4
|
+
import type { FloatingLauncherOptions } from './components/FloatingLauncher.js';
|
|
5
|
+
import type { UISpecDomRegistry, UISpecRendererOverrides } from '../common/renderer/index.js';
|
|
6
|
+
export interface ChatWidgetConfig extends BaseWidgetConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Widget display variant:
|
|
9
|
+
* - 'floating' : Launcher button + slide-in drawer (default)
|
|
10
|
+
* - 'inline' : Renders directly into mountTarget, no launcher
|
|
11
|
+
* - 'overlay' : Full-screen modal, triggered programmatically
|
|
12
|
+
*/
|
|
13
|
+
variant?: 'floating' | 'inline' | 'overlay';
|
|
14
|
+
/**
|
|
15
|
+
* Initial open state for mobile.
|
|
16
|
+
* 'half' shows a half-height sheet; 'full' is full-screen.
|
|
17
|
+
*/
|
|
18
|
+
mobileInitialState?: 'half' | 'full';
|
|
19
|
+
/** Custom launcher button SVG markup. */
|
|
20
|
+
launcherSvg?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Launcher image URL — renders the launcher as a full-size image button
|
|
23
|
+
* (no circular background, no padding). The image fills the entire button.
|
|
24
|
+
* Takes precedence over launcherSvg when set.
|
|
25
|
+
* Ignored when `pillLauncher` is set (pill derives `launcherImageUrl` from `pillLauncher.avatarUrl`).
|
|
26
|
+
*/
|
|
27
|
+
launcherImageUrl?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Mobile-specific launcher image URL. When set alongside `launcherImageUrl`,
|
|
30
|
+
* this image is shown on mobile viewports and `launcherImageUrl` on desktop.
|
|
31
|
+
*/
|
|
32
|
+
mobileLauncherImageUrl?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Declarative pill-shaped floating launcher (label + avatar). The widget calls
|
|
35
|
+
* `makePillLauncher` and `apply()` internally after mount — no host `apply()` needed.
|
|
36
|
+
* Floating variant only; omit manual `launcherImageUrl` when using this.
|
|
37
|
+
*/
|
|
38
|
+
pillLauncher?: PillLauncherOptions;
|
|
39
|
+
/**
|
|
40
|
+
* Search-bar style floating launcher with voice input. Replaces the standard
|
|
41
|
+
* FAB button with a full-width pill input bar. The widget mounts it inside the
|
|
42
|
+
* shadow DOM — no host-side `apply()` needed.
|
|
43
|
+
* Floating variant only; mutually exclusive with `pillLauncher` and `launcherImageUrl`.
|
|
44
|
+
*/
|
|
45
|
+
floatingLauncher?: FloatingLauncherOptions;
|
|
46
|
+
/** Tooltip text shown on launcher hover. */
|
|
47
|
+
launcherTooltip?: string;
|
|
48
|
+
/** Header display title (overrides i18n.headerTitle). */
|
|
49
|
+
headerTitle?: string;
|
|
50
|
+
/** Header avatar image URL. */
|
|
51
|
+
headerAvatarUrl?: string;
|
|
52
|
+
/** Header badge text (e.g. "BETA"). */
|
|
53
|
+
headerBadge?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Header background color (CSS color value, e.g. "#1d2939" or "hsl(220 26% 14%)").
|
|
56
|
+
* Sets the `--gengage-chat-header-bg` CSS custom property.
|
|
57
|
+
* Can also be set via `theme['--gengage-chat-header-bg']`.
|
|
58
|
+
*/
|
|
59
|
+
headerBg?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Header foreground (text/icon) color.
|
|
62
|
+
* Sets the `--gengage-chat-header-foreground` CSS custom property.
|
|
63
|
+
* Can also be set via `theme['--gengage-chat-header-foreground']`.
|
|
64
|
+
*/
|
|
65
|
+
headerForeground?: string;
|
|
66
|
+
/** Header cart link URL (e.g. "/sepetim"). Shows a cart icon in the header. */
|
|
67
|
+
headerCartUrl?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Legacy: show the header favorites (heart) button without `onFavoritesClick`.
|
|
70
|
+
* Opens the built-in favorites list in the side panel (IDB-backed).
|
|
71
|
+
*/
|
|
72
|
+
headerFavoritesToggle?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* When set, shows the header favorites button. On click, only this callback runs — use it to
|
|
75
|
+
* open the merchant's favorites page (same pattern as `onCartClick`). The built-in favorites panel is not opened.
|
|
76
|
+
*/
|
|
77
|
+
onFavoritesClick?: () => void;
|
|
78
|
+
/** Callback fired when the cart icon button in the header is clicked (when headerCartUrl is not set). */
|
|
79
|
+
onCartClick?: () => void;
|
|
80
|
+
/** Hide the launcher on mobile viewports. */
|
|
81
|
+
hideMobileLauncher?: boolean;
|
|
82
|
+
/** Mobile breakpoint in px (default: 768). */
|
|
83
|
+
mobileBreakpoint?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Dynamically positions the launcher relative to a page element per viewport.
|
|
86
|
+
* ResizeObserver tracks the element and updates the launcher CSS variables on
|
|
87
|
+
* every resize — no static overrides needed. Call `syncLauncherAnchor()` from
|
|
88
|
+
* SPA navigation handlers to re-query anchors after page transitions.
|
|
89
|
+
*
|
|
90
|
+
* Offset semantics:
|
|
91
|
+
* - `0` → launcher edge aligns with the element's same edge (overlap, no gap)
|
|
92
|
+
* - `N>0` → launcher is N px outside the element's far edge
|
|
93
|
+
*
|
|
94
|
+
* `bottomOffset`: 0 = align with el.bottom, N = N px above el.top
|
|
95
|
+
* `rightOffset`: 0 = align with el.right, N = N px left of el.left
|
|
96
|
+
*/
|
|
97
|
+
launcherAnchor?: {
|
|
98
|
+
mobile?: {
|
|
99
|
+
/**
|
|
100
|
+
* Anchor source element selector. If omitted, `bottom` / `right` offsets are
|
|
101
|
+
* applied directly from viewport edges (without element tracking).
|
|
102
|
+
*/
|
|
103
|
+
selector?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Vertical anchor. `offset` is the distance in px; `type` controls the reference:
|
|
106
|
+
* - `'gap'` (default): offset=0 → launcher bottom = element bottom;
|
|
107
|
+
* offset>0 → launcher sits N px above the element's top edge.
|
|
108
|
+
* - `'root'`: offset always measured from the element's bottom edge;
|
|
109
|
+
* offset=0 → launcher bottom = element bottom; N > 0 → N px above element's bottom.
|
|
110
|
+
*/
|
|
111
|
+
bottom?: {
|
|
112
|
+
offset: number;
|
|
113
|
+
type?: 'gap' | 'root';
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Horizontal anchor. `offset` is the distance in px; `type` controls the reference:
|
|
117
|
+
* - `'gap'` (default): offset=0 → launcher right = element right;
|
|
118
|
+
* offset>0 → launcher sits N px to the left of the element's left edge.
|
|
119
|
+
* - `'root'`: offset always measured from the element's right edge;
|
|
120
|
+
* offset=0 → launcher right = element right; N > 0 → N px inward from element's right.
|
|
121
|
+
*/
|
|
122
|
+
right?: {
|
|
123
|
+
offset: number;
|
|
124
|
+
type?: 'gap' | 'root';
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* When true, launcher animates to the anchored position when the element
|
|
128
|
+
* scrolls into view, and returns to default when it scrolls out.
|
|
129
|
+
*/
|
|
130
|
+
dynamicRelocate?: boolean;
|
|
131
|
+
};
|
|
132
|
+
desktop?: {
|
|
133
|
+
/**
|
|
134
|
+
* Anchor source element selector. If omitted, `bottom` / `right` offsets are
|
|
135
|
+
* applied directly from viewport edges (without element tracking).
|
|
136
|
+
*/
|
|
137
|
+
selector?: string;
|
|
138
|
+
bottom?: {
|
|
139
|
+
offset: number;
|
|
140
|
+
type?: 'gap' | 'root';
|
|
141
|
+
};
|
|
142
|
+
right?: {
|
|
143
|
+
offset: number;
|
|
144
|
+
type?: 'gap' | 'root';
|
|
145
|
+
};
|
|
146
|
+
dynamicRelocate?: boolean;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Panel display mode:
|
|
151
|
+
* - 'auto' : Panel appears/hides with content; user can toggle (default)
|
|
152
|
+
* - 'collapsed' : Panel starts collapsed; fresh panel content reopens it
|
|
153
|
+
* - 'expanded' : Panel starts expanded (users can still collapse/expand)
|
|
154
|
+
*/
|
|
155
|
+
panelMode?: 'auto' | 'collapsed' | 'expanded';
|
|
156
|
+
/**
|
|
157
|
+
* Locale for built-in i18n strings.
|
|
158
|
+
* Provide a custom `i18n` object to override any string.
|
|
159
|
+
*/
|
|
160
|
+
locale?: string;
|
|
161
|
+
i18n?: Partial<ChatI18n>;
|
|
162
|
+
renderer?: ChatRendererConfig;
|
|
163
|
+
/** Controls how streamed actions are routed (policy for unknowns, script_call gating). */
|
|
164
|
+
actionHandling?: {
|
|
165
|
+
unknownActionPolicy?: UnknownActionPolicy;
|
|
166
|
+
allowScriptCall?: boolean;
|
|
167
|
+
};
|
|
168
|
+
/** Welcome message shown on first drawer open with empty history. */
|
|
169
|
+
welcomeMessage?: string;
|
|
170
|
+
/** Starter action pills shown with welcome message. */
|
|
171
|
+
welcomeActions?: string[];
|
|
172
|
+
/** Context-specific starter action pills for blank/home/listing/PDP entry states. */
|
|
173
|
+
welcomeActionsByContext?: ChatWelcomeActionsByContext;
|
|
174
|
+
/** Context-specific opening copy that is forwarded to the backend entry-opening flow. */
|
|
175
|
+
openingMessagesByContext?: ChatContextualCopyByContext;
|
|
176
|
+
/** Context-specific steering notes forwarded to the backend entry-opening flow. */
|
|
177
|
+
openingGuidanceByContext?: ChatContextualCopyByContext;
|
|
178
|
+
/**
|
|
179
|
+
* Whether this is a demo website. When combined with `productDetailsExtended: true`,
|
|
180
|
+
* `productDetails` content triggers the extended panel (host PDP maximize).
|
|
181
|
+
* Regular accounts render product details inline in the chat pane.
|
|
182
|
+
*/
|
|
183
|
+
isDemoWebsite?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* When `true`, full `ProductDetailsPanel` and PDP similar products (`similarsAppend` grid) use
|
|
186
|
+
* the assistant side panel; demo extended mode includes `productDetails`. Default `false`/omitted:
|
|
187
|
+
* product details and similar products render only in the chat stream; the side panel is cleared.
|
|
188
|
+
* `ProductSummaryCard` always renders inline (except for silent messages).
|
|
189
|
+
*/
|
|
190
|
+
productDetailsExtended?: boolean;
|
|
191
|
+
/** Product price presentation (cards, summary, details, AI Top Picks). */
|
|
192
|
+
productPriceUi?: ProductPriceUiConfig;
|
|
193
|
+
/**
|
|
194
|
+
* When true, hides the circular percent discount badge on product card images and the
|
|
195
|
+
* inline percent badge in the product details price row. List/sale price and campaign badges are unchanged.
|
|
196
|
+
*/
|
|
197
|
+
hideProductDiscountBadge?: boolean;
|
|
198
|
+
/** When true, hides the ReviewHighlights component in chat responses. */
|
|
199
|
+
hideUserReviews?: boolean;
|
|
200
|
+
/** When true, hides in-stock / out-of-stock labels on product cards. */
|
|
201
|
+
hideStockStatus?: boolean;
|
|
202
|
+
/** Enable browser-native voice input. Default: false. */
|
|
203
|
+
voiceEnabled?: boolean;
|
|
204
|
+
onOpen?: () => void;
|
|
205
|
+
onClose?: () => void;
|
|
206
|
+
onReady?: () => void;
|
|
207
|
+
onScriptCall?: (params: {
|
|
208
|
+
name: string;
|
|
209
|
+
payload?: Record<string, unknown>;
|
|
210
|
+
}) => void;
|
|
211
|
+
onAddToCart?: (params: AddToCartParams) => AddToCartHandlerResult;
|
|
212
|
+
onProductNavigate?: (url: string, sku: string, sessionId: string | null) => void;
|
|
213
|
+
/**
|
|
214
|
+
* Allowed origins for the postMessage communication bridge.
|
|
215
|
+
* Defaults to `[location.origin]` (same-origin only).
|
|
216
|
+
* Pass `['*']` to allow any origin (not recommended for production).
|
|
217
|
+
*/
|
|
218
|
+
allowedOrigins?: string[];
|
|
219
|
+
}
|
|
220
|
+
export interface ChatI18n {
|
|
221
|
+
headerTitle: string;
|
|
222
|
+
inputPlaceholder: string;
|
|
223
|
+
sendButton: string;
|
|
224
|
+
closeButton: string;
|
|
225
|
+
openButton: string;
|
|
226
|
+
newChatButton: string;
|
|
227
|
+
poweredBy: string;
|
|
228
|
+
errorMessage: string;
|
|
229
|
+
retryButton: string;
|
|
230
|
+
loadingMessage: string;
|
|
231
|
+
loadingSequenceGeneric: string[];
|
|
232
|
+
loadingSequencePanel: string[];
|
|
233
|
+
loadingSequenceComparison: string[];
|
|
234
|
+
productCtaLabel: string;
|
|
235
|
+
/** CTA label in the product details panel when navigating to the product URL (distinct from the card "İncele" CTA). */
|
|
236
|
+
viewOnSiteLabel: string;
|
|
237
|
+
attachImageButton: string;
|
|
238
|
+
/** Image attach popup: pick from device. */
|
|
239
|
+
attachMenuSelectPhoto: string;
|
|
240
|
+
/** Image attach popup: paste from clipboard. */
|
|
241
|
+
attachMenuPaste: string;
|
|
242
|
+
/** When clipboard has no image (paste menu or unsupported API). */
|
|
243
|
+
clipboardNoImageMessage: string;
|
|
244
|
+
removeAttachmentButton: string;
|
|
245
|
+
invalidFileType: string;
|
|
246
|
+
fileTooLarge: string;
|
|
247
|
+
aiTopPicksTitle: string;
|
|
248
|
+
roleWinner: string;
|
|
249
|
+
roleBestValue: string;
|
|
250
|
+
roleBestAlternative: string;
|
|
251
|
+
viewDetails: string;
|
|
252
|
+
groundingReviewCta: string;
|
|
253
|
+
groundingReviewSubtitle: string;
|
|
254
|
+
variantsLabel: string;
|
|
255
|
+
sortRelated: string;
|
|
256
|
+
sortPriceAsc: string;
|
|
257
|
+
sortPriceDesc: string;
|
|
258
|
+
sortToolbarAriaLabel: string;
|
|
259
|
+
compareSelected: string;
|
|
260
|
+
compareMinHint: string;
|
|
261
|
+
compareMaxHint: string;
|
|
262
|
+
comparisonSelectLabel: string;
|
|
263
|
+
comparisonSelectedLabel: string;
|
|
264
|
+
/** Shown on product cards while comparison mode is on — whole card toggles selection. */
|
|
265
|
+
comparisonSelectCardHint: string;
|
|
266
|
+
/** Shown on the main panel while the comparison table is being generated. */
|
|
267
|
+
comparisonPreparingLabel: string;
|
|
268
|
+
panelTitleProductDetails: string;
|
|
269
|
+
panelTitleSimilarProducts: string;
|
|
270
|
+
panelTitleComparisonResults: string;
|
|
271
|
+
panelTitleCategories: string;
|
|
272
|
+
panelTitleSearchResults: string;
|
|
273
|
+
inStockLabel: string;
|
|
274
|
+
outOfStockLabel: string;
|
|
275
|
+
findSimilarLabel: string;
|
|
276
|
+
/** Product details gallery: previous / next image controls */
|
|
277
|
+
galleryPrevAriaLabel: string;
|
|
278
|
+
galleryNextAriaLabel: string;
|
|
279
|
+
/** Title shown above consultant style cards. Supports {count} placeholder. */
|
|
280
|
+
beautyStylesPreparedTitle: string;
|
|
281
|
+
/**
|
|
282
|
+
* Deprecated alias retained for merchant forks that still override the old
|
|
283
|
+
* watch-specific title key. Prefer `beautyStylesPreparedTitle`.
|
|
284
|
+
*/
|
|
285
|
+
watchStylesPreparedTitle?: string | undefined;
|
|
286
|
+
/** Label for products that were not included in a backend recommendation group. */
|
|
287
|
+
consultingOtherCompatibleProductsLabel: string;
|
|
288
|
+
/** Fallback label for an unnamed consulting recommendation group. */
|
|
289
|
+
consultingFallbackGroupLabel: string;
|
|
290
|
+
/** Fallback label for a consulting style card. Supports {index} placeholder. */
|
|
291
|
+
consultingFallbackStyleLabel: string;
|
|
292
|
+
consultingStyleLoadingDescription: string;
|
|
293
|
+
consultingStyleUnavailableDescription: string;
|
|
294
|
+
consultingStyleLoadingBadge: string;
|
|
295
|
+
consultingStyleUnavailableBadge: string;
|
|
296
|
+
choicePrompterHeading: string;
|
|
297
|
+
choicePrompterSuggestion: string;
|
|
298
|
+
choicePrompterCta: string;
|
|
299
|
+
viewMoreLabel: string;
|
|
300
|
+
similarProductsLabel: string;
|
|
301
|
+
addToCartButton: string;
|
|
302
|
+
addedToCartToast: string;
|
|
303
|
+
shareButton: string;
|
|
304
|
+
productInfoTab: string;
|
|
305
|
+
specificationsTab: string;
|
|
306
|
+
recommendedChoiceLabel: string;
|
|
307
|
+
highlightsLabel: string;
|
|
308
|
+
keyDifferencesLabel: string;
|
|
309
|
+
specialCasesLabel: string;
|
|
310
|
+
emptyReviewsMessage: string;
|
|
311
|
+
closeAriaLabel: string;
|
|
312
|
+
startChatLabel: string;
|
|
313
|
+
voiceButton: string;
|
|
314
|
+
voiceListening: string;
|
|
315
|
+
voiceNotSupported: string;
|
|
316
|
+
voicePermissionDenied: string;
|
|
317
|
+
voiceError: string;
|
|
318
|
+
handoffHeading: string;
|
|
319
|
+
productNotFoundMessage: string;
|
|
320
|
+
stopGenerating: string;
|
|
321
|
+
offlineMessage: string;
|
|
322
|
+
cartAriaLabel: string;
|
|
323
|
+
favoritesAriaLabel: string;
|
|
324
|
+
historyAriaLabel: string;
|
|
325
|
+
historyPageTitle: string;
|
|
326
|
+
emptyHistoryMessage: string;
|
|
327
|
+
historyDeleteLabel: string;
|
|
328
|
+
historyDeleteConfirmMessage: string;
|
|
329
|
+
showPanelAriaLabel: string;
|
|
330
|
+
addToFavoritesLabel: string;
|
|
331
|
+
customerReviewsTitle: string;
|
|
332
|
+
togglePanelAriaLabel: string;
|
|
333
|
+
chatMessagesAriaLabel: string;
|
|
334
|
+
suggestionsAriaLabel: string;
|
|
335
|
+
moreSuggestionsAriaLabel: string;
|
|
336
|
+
rollbackAriaLabel: string;
|
|
337
|
+
backAriaLabel: string;
|
|
338
|
+
forwardAriaLabel: string;
|
|
339
|
+
/** Aria label for the panel close (✕) button shown on mobile. */
|
|
340
|
+
closePanelAriaLabel: string;
|
|
341
|
+
dismissAriaLabel: string;
|
|
342
|
+
cartAddErrorMessage: string;
|
|
343
|
+
/** Shown when a host `gengage-product-favorite` callback fails (returns false or throws). */
|
|
344
|
+
favoriteToggleErrorMessage: string;
|
|
345
|
+
/** Used as lowercase suffix for positive mention counts, e.g. "3 positive". */
|
|
346
|
+
reviewFilterPositive: string;
|
|
347
|
+
/** Used as lowercase suffix for negative mention counts, e.g. "2 negative". */
|
|
348
|
+
reviewFilterNegative: string;
|
|
349
|
+
decreaseLabel: string;
|
|
350
|
+
increaseLabel: string;
|
|
351
|
+
reviewCustomersMentionSingular: string;
|
|
352
|
+
reviewCustomersMentionPlural: string;
|
|
353
|
+
reviewSubjectsHeading: string;
|
|
354
|
+
tryAgainButton: string;
|
|
355
|
+
askSomethingElseButton: string;
|
|
356
|
+
accountInactiveMessage: string;
|
|
357
|
+
favoritesPageTitle: string;
|
|
358
|
+
emptyFavoritesMessage: string;
|
|
359
|
+
/** Sticky control when transcript is focused on the latest thread — restores full history */
|
|
360
|
+
showFormerMessagesButton: string;
|
|
361
|
+
/** Shown above the product grid on desktop while AI picks/groupings are still streaming. */
|
|
362
|
+
aiAnalysisAnalyzingLabel: string;
|
|
363
|
+
/** Section heading above AI grouping cards (panel browse categories). */
|
|
364
|
+
aiBrowseCategoriesTitle: string;
|
|
365
|
+
/** Badge text on photo analysis message cards. */
|
|
366
|
+
photoAnalysisBadge: string;
|
|
367
|
+
/** Photo analysis section label: strengths. */
|
|
368
|
+
photoAnalysisStrengthsLabel: string;
|
|
369
|
+
/** Photo analysis section label: focus points. */
|
|
370
|
+
photoAnalysisFocusLabel: string;
|
|
371
|
+
/** Photo analysis section label: celeb style match. */
|
|
372
|
+
photoAnalysisCelebStyleLabel: string;
|
|
373
|
+
/** Beauty photo step card: title. */
|
|
374
|
+
beautyPhotoStepTitle: string;
|
|
375
|
+
/** Beauty photo step card: description. */
|
|
376
|
+
beautyPhotoStepDescription: string;
|
|
377
|
+
/** Beauty photo step card: upload button label. */
|
|
378
|
+
beautyPhotoStepUpload: string;
|
|
379
|
+
/** Beauty photo step card: processing state label. */
|
|
380
|
+
beautyPhotoStepProcessing: string;
|
|
381
|
+
/** Beauty photo step card: skip button label. */
|
|
382
|
+
beautyPhotoStepSkip: string;
|
|
383
|
+
/** Message sent to backend when user clicks skip on beauty photo step. */
|
|
384
|
+
beautyPhotoStepSkipMessage: string;
|
|
385
|
+
}
|
|
386
|
+
export type OpeningContextKey = 'home' | 'listing' | 'product' | 'default';
|
|
387
|
+
export interface ChatActionChip {
|
|
388
|
+
title: string;
|
|
389
|
+
icon?: string;
|
|
390
|
+
}
|
|
391
|
+
interface ChatWelcomeActionsByContext {
|
|
392
|
+
home?: ChatActionChip[];
|
|
393
|
+
listing?: ChatActionChip[];
|
|
394
|
+
product?: ChatActionChip[];
|
|
395
|
+
default?: ChatActionChip[];
|
|
396
|
+
}
|
|
397
|
+
interface ChatContextualCopyByContext {
|
|
398
|
+
home?: string;
|
|
399
|
+
listing?: string;
|
|
400
|
+
product?: string;
|
|
401
|
+
default?: string;
|
|
402
|
+
}
|
|
403
|
+
/** List vs sale price row: strike-through or inline with separator. */
|
|
404
|
+
export type ProductPriceOriginalStyle = 'strikethrough' | 'inline';
|
|
405
|
+
/** Sale price text color: body default or brand (`--client-primary`). */
|
|
406
|
+
type DiscountedPriceColor = 'default' | 'client';
|
|
407
|
+
interface ProductPriceUiConfig {
|
|
408
|
+
/**
|
|
409
|
+
* How the list price is shown. Override per product via `originalPriceStyle` / `price_original_style`.
|
|
410
|
+
* `strikethrough`: crossed-out list price. `inline`: current, separator, muted list price (no line).
|
|
411
|
+
*/
|
|
412
|
+
originalPriceStyle?: ProductPriceOriginalStyle;
|
|
413
|
+
/**
|
|
414
|
+
* When true, show a campaign / discount reason line when the payload includes `discount_reason` (or aliases).
|
|
415
|
+
*/
|
|
416
|
+
showCampaignReason?: boolean;
|
|
417
|
+
/**
|
|
418
|
+
* Sale price color. Sets `--gengage-discounted-price-color` on the widget host when `client`.
|
|
419
|
+
*/
|
|
420
|
+
discountedPriceColor?: DiscountedPriceColor;
|
|
421
|
+
/**
|
|
422
|
+
* Optional default image URL for the left column of the campaign price badge (logo).
|
|
423
|
+
* Override per product via `campaignReasonLogoUrl` / `campaign_reason_logo_url` (or `discountBadgeLogoUrl`).
|
|
424
|
+
*/
|
|
425
|
+
campaignBadgeLogoUrl?: string;
|
|
426
|
+
}
|
|
427
|
+
export interface ChatUISpecRenderContext {
|
|
428
|
+
locale?: string | undefined;
|
|
429
|
+
onAction: (action: ActionPayload) => void;
|
|
430
|
+
onProductClick?: (params: {
|
|
431
|
+
sku: string;
|
|
432
|
+
url: string;
|
|
433
|
+
name?: string;
|
|
434
|
+
}) => void;
|
|
435
|
+
onAddToCart?: (params: AddToCartParams) => AddToCartHandlerResult;
|
|
436
|
+
onProductSelect?: (product: Record<string, unknown>) => void;
|
|
437
|
+
pricing?: import('../common/price-formatter.js').PriceFormatConfig | undefined;
|
|
438
|
+
productPriceUi?: ProductPriceUiConfig | undefined;
|
|
439
|
+
hideProductDiscountBadge?: boolean | undefined;
|
|
440
|
+
hideUserReviews?: boolean | undefined;
|
|
441
|
+
hideStockStatus?: boolean | undefined;
|
|
442
|
+
i18n?: Pick<ChatI18n, 'productCtaLabel' | 'viewOnSiteLabel' | 'aiTopPicksTitle' | 'roleWinner' | 'roleBestValue' | 'roleBestAlternative' | 'viewDetails' | 'groundingReviewCta' | 'groundingReviewSubtitle' | 'variantsLabel' | 'sortRelated' | 'sortPriceAsc' | 'sortPriceDesc' | 'sortToolbarAriaLabel' | 'compareSelected' | 'compareMinHint' | 'comparisonSelectLabel' | 'comparisonSelectedLabel' | 'comparisonSelectCardHint' | 'panelTitleProductDetails' | 'panelTitleSimilarProducts' | 'panelTitleComparisonResults' | 'panelTitleCategories' | 'panelTitleSearchResults' | 'inStockLabel' | 'outOfStockLabel' | 'findSimilarLabel' | 'galleryPrevAriaLabel' | 'galleryNextAriaLabel' | 'beautyStylesPreparedTitle' | 'watchStylesPreparedTitle' | 'consultingOtherCompatibleProductsLabel' | 'consultingFallbackGroupLabel' | 'consultingFallbackStyleLabel' | 'consultingStyleLoadingDescription' | 'consultingStyleUnavailableDescription' | 'consultingStyleLoadingBadge' | 'consultingStyleUnavailableBadge' | 'viewMoreLabel' | 'similarProductsLabel' | 'addToCartButton' | 'shareButton' | 'productInfoTab' | 'specificationsTab' | 'recommendedChoiceLabel' | 'highlightsLabel' | 'keyDifferencesLabel' | 'specialCasesLabel' | 'emptyReviewsMessage' | 'closeAriaLabel' | 'dismissAriaLabel' | 'startChatLabel' | 'handoffHeading' | 'customerReviewsTitle' | 'addToFavoritesLabel' | 'showPanelAriaLabel' | 'reviewFilterPositive' | 'reviewFilterNegative' | 'decreaseLabel' | 'increaseLabel' | 'reviewCustomersMentionSingular' | 'reviewCustomersMentionPlural' | 'reviewSubjectsHeading' | 'aiBrowseCategoriesTitle' | 'photoAnalysisBadge' | 'photoAnalysisStrengthsLabel' | 'photoAnalysisFocusLabel' | 'photoAnalysisCelebStyleLabel' | 'beautyPhotoStepTitle' | 'beautyPhotoStepDescription' | 'beautyPhotoStepUpload' | 'beautyPhotoStepProcessing' | 'beautyPhotoStepSkip'>;
|
|
443
|
+
productSort?: ProductSortState | undefined;
|
|
444
|
+
onSortChange?: ((sort: ProductSortState) => void) | undefined;
|
|
445
|
+
comparisonSelectMode?: boolean | undefined;
|
|
446
|
+
comparisonSelectedSkus?: string[] | undefined;
|
|
447
|
+
comparisonMaxSelection?: number | undefined;
|
|
448
|
+
comparisonSelectionWarning?: string | null | undefined;
|
|
449
|
+
onToggleComparisonSku?: ((sku: string) => void) | undefined;
|
|
450
|
+
favoritedSkus?: Set<string> | undefined;
|
|
451
|
+
onFavoriteToggle?: ((sku: string, product: Record<string, unknown>) => void) | undefined;
|
|
452
|
+
topPicksLoadingSku?: string | null | undefined;
|
|
453
|
+
/** When true the stream is still in progress — defer compare CTA until stream ends. */
|
|
454
|
+
isStreaming?: boolean | undefined;
|
|
455
|
+
/** True when the widget is displayed in mobile viewport. Replaces hardcoded 768px check. */
|
|
456
|
+
isMobile?: boolean | undefined;
|
|
457
|
+
/** ProductGrid: heading on the same row as sort/compare (panel list / Benzer Ürünler). */
|
|
458
|
+
panelProductListHeading?: string | undefined;
|
|
459
|
+
}
|
|
460
|
+
export interface ProductSortState {
|
|
461
|
+
type: 'related' | 'price';
|
|
462
|
+
direction?: 'asc' | 'desc' | undefined;
|
|
463
|
+
}
|
|
464
|
+
export type ChatUISpecRegistry = UISpecDomRegistry<ChatUISpecRenderContext>;
|
|
465
|
+
export type ChatRendererConfig = UISpecRendererOverrides<ChatUISpecRenderContext>;
|
|
466
|
+
export interface ChatMessage {
|
|
467
|
+
id: string;
|
|
468
|
+
threadId?: string;
|
|
469
|
+
role: 'user' | 'assistant';
|
|
470
|
+
/** Plain text content. */
|
|
471
|
+
content?: string;
|
|
472
|
+
/** json-render UI spec attached to this message (e.g. product cards). */
|
|
473
|
+
uiSpec?: import('../common/types.js').UISpec;
|
|
474
|
+
/** Frontend-synthesized visible message; exclude from backend chat history. */
|
|
475
|
+
frontendOnly?: boolean;
|
|
476
|
+
/** Image attachment (user-uploaded). Stored in-memory until send. */
|
|
477
|
+
attachment?: File;
|
|
478
|
+
/** Snapshot of panel DOM at time this message's stream completed. */
|
|
479
|
+
panelSnapshot?: HTMLElement;
|
|
480
|
+
/** Silent messages are hidden from the conversation but kept for context. */
|
|
481
|
+
silent?: boolean;
|
|
482
|
+
/** Backend render hint for special rendering (e.g. "photo_analysis"). */
|
|
483
|
+
renderHint?: string;
|
|
484
|
+
/** Structured photo analysis data from PhotoAnalysisCard UISpec. */
|
|
485
|
+
photoAnalysis?: {
|
|
486
|
+
summary: string;
|
|
487
|
+
strengths?: string[];
|
|
488
|
+
focusPoints?: string[];
|
|
489
|
+
celebStyle?: string;
|
|
490
|
+
celebStyleReason?: string;
|
|
491
|
+
nextQuestion?: string;
|
|
492
|
+
};
|
|
493
|
+
timestamp: number;
|
|
494
|
+
status: 'streaming' | 'done' | 'error';
|
|
495
|
+
}
|
|
496
|
+
export interface ChatSession {
|
|
497
|
+
sessionId: string;
|
|
498
|
+
messages: ChatMessage[];
|
|
499
|
+
/** SKU associated with this session (for cross-page restore). */
|
|
500
|
+
sku?: string;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Serializable subset of ChatMessage for IndexedDB persistence.
|
|
504
|
+
* Omits `attachment` (File) and `panelSnapshot` (HTMLElement) which are not
|
|
505
|
+
* structurally cloneable.
|
|
506
|
+
*/
|
|
507
|
+
export interface SerializableChatMessage {
|
|
508
|
+
id: string;
|
|
509
|
+
threadId?: string | undefined;
|
|
510
|
+
role: 'user' | 'assistant';
|
|
511
|
+
content?: string | undefined;
|
|
512
|
+
frontendOnly?: boolean | undefined;
|
|
513
|
+
silent?: boolean | undefined;
|
|
514
|
+
timestamp: number;
|
|
515
|
+
status: 'streaming' | 'done' | 'error';
|
|
516
|
+
}
|
|
517
|
+
export interface ChatUIComponents {
|
|
518
|
+
/** A single text message bubble. */
|
|
519
|
+
MessageBubble: {
|
|
520
|
+
role: 'user' | 'assistant';
|
|
521
|
+
content: string;
|
|
522
|
+
timestamp?: number;
|
|
523
|
+
};
|
|
524
|
+
/** A product card shown inline in the chat stream. */
|
|
525
|
+
ProductCard: {
|
|
526
|
+
sku: string;
|
|
527
|
+
name: string;
|
|
528
|
+
imageUrl?: string;
|
|
529
|
+
price?: string;
|
|
530
|
+
originalPrice?: string;
|
|
531
|
+
url: string;
|
|
532
|
+
};
|
|
533
|
+
/** A row of quick-reply action buttons. */
|
|
534
|
+
ActionButtons: {
|
|
535
|
+
buttons: Array<{
|
|
536
|
+
label: string;
|
|
537
|
+
action: ActionPayload;
|
|
538
|
+
}>;
|
|
539
|
+
};
|
|
540
|
+
/** A "typing..." indicator. */
|
|
541
|
+
TypingIndicator: Record<string, never>;
|
|
542
|
+
/** A divider with an optional label (e.g. "New conversation"). */
|
|
543
|
+
Divider: {
|
|
544
|
+
label?: string;
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in debug logging for chat presentation (query ?chat_debug=1 or localStorage gengage_chat_debug=1).
|
|
3
|
+
*/
|
|
4
|
+
type Entry = {
|
|
5
|
+
seq: number;
|
|
6
|
+
time: string;
|
|
7
|
+
scope: string;
|
|
8
|
+
message: string;
|
|
9
|
+
payload?: unknown;
|
|
10
|
+
};
|
|
11
|
+
declare global {
|
|
12
|
+
interface Window {
|
|
13
|
+
__gengageChatPresentationDebugLog?: Entry[];
|
|
14
|
+
__gengageChatPresentationDebugSeq?: number;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export declare function logChatPresentation(scope: string, message: string, payload?: unknown): void;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the chat transcript scroll container (messages pane).
|
|
3
|
+
* Prefers a widget-registered element (Shadow DOM–safe); falls back to #gengage-chat-scroll in light DOM.
|
|
4
|
+
*/
|
|
5
|
+
/** DOM id on the transcript scroller — stable for host tooling */
|
|
6
|
+
export declare const CHAT_SCROLL_ELEMENT_ID = "gengage-chat-scroll";
|
|
7
|
+
/** Called when the chat drawer mounts / updates its messages scroller */
|
|
8
|
+
export declare function registerChatScrollElement(el: HTMLElement | null): void;
|
|
9
|
+
export declare function getChatScrollElement(): HTMLElement | null;
|
|
10
|
+
export declare function invalidateChatScrollCache(): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI Utilities for the Gengage Chat components.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Creates a Lucide-style SVG icon from paths.
|
|
6
|
+
* @param paths SVG path strings (the 'd' attribute).
|
|
7
|
+
* @param size Icon width/height in pixels.
|
|
8
|
+
* @returns An SVGElement.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createLucideIcon(paths: string[], size?: number): SVGElement;
|
package/dist/chat-runtime.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, d as t, i as r, l as s, n, o as i, r as l, s as C, t as c, u as d } from "./runtime-
|
|
1
|
+
import { c as e, d as t, i as r, l as s, n, o as i, r as l, s as C, t as c, u as d } from "./runtime-OpNoB3cu.js";
|
|
2
2
|
export {
|
|
3
3
|
s as CHAT_SCROLL_ELEMENT_ID,
|
|
4
4
|
r as ChatPresentationState,
|