@gengage/assistant-fe 0.4.20 → 0.4.21

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 (156) hide show
  1. package/dist/{api-paths-CReMDZWg.js → api-paths-Bg6iwO5w.js} +1 -1
  2. package/dist/chat-runtime.js +1 -1
  3. package/dist/chat.iife.js +2 -2
  4. package/dist/chat.js +1 -1
  5. package/dist/{common-BM2ZsSLI.js → common-DDJSeQhg.js} +2 -2
  6. package/dist/common.js +5 -5
  7. package/dist/{connection-warning-C_4e7ahZ.js → connection-warning-BeD-B0Ec.js} +1 -1
  8. package/dist/{fastIntent-DMNzXOSI.js → fastIntent-BeeDIwd2.js} +1 -1
  9. package/dist/index.js +10 -10
  10. package/dist/native.iife.js +2 -2
  11. package/dist/qna-runtime.js +1 -1
  12. package/dist/qna.iife.js +1 -1
  13. package/dist/qna.js +1 -1
  14. package/dist/{runtime-C51WykbJ.js → runtime-C8ZBidd2.js} +3 -3
  15. package/dist/{runtime-bbMljGVG.js → runtime-CRSFPLku.js} +3 -3
  16. package/dist/{runtime-DBh8899B.js → runtime-Ct1qOl8V.js} +5 -5
  17. package/dist/{simbut-CO1rLVM9.js → simbut-BrAeZ6SH.js} +1 -1
  18. package/dist/simbut.iife.js +1 -1
  19. package/dist/simbut.js +1 -1
  20. package/dist/{simrel-zCDlCrqG.js → simrel-Cha5de6P.js} +1 -1
  21. package/dist/simrel-runtime.js +1 -1
  22. package/dist/simrel.iife.js +1 -1
  23. package/dist/simrel.js +2 -2
  24. package/dist/{widget-base-Cf9ofZhh.js → widget-base-BtBl_PCR.js} +1 -1
  25. package/package.json +8 -5
  26. package/dist/chat/api.d.ts +0 -88
  27. package/dist/chat/assistant-mode.d.ts +0 -19
  28. package/dist/chat/attachment-utils.d.ts +0 -9
  29. package/dist/chat/catalog.d.ts +0 -826
  30. package/dist/chat/chat-presentation-state.d.ts +0 -53
  31. package/dist/chat/components/AIGroupingCards.d.ts +0 -3
  32. package/dist/chat/components/AISuggestedSearchCards.d.ts +0 -3
  33. package/dist/chat/components/AITopPicks.d.ts +0 -3
  34. package/dist/chat/components/BeautyPhotoStep.d.ts +0 -16
  35. package/dist/chat/components/CategoriesContainer.d.ts +0 -3
  36. package/dist/chat/components/ChatDrawer.d.ts +0 -360
  37. package/dist/chat/components/ChoicePrompter.d.ts +0 -21
  38. package/dist/chat/components/ComparisonTable.d.ts +0 -57
  39. package/dist/chat/components/ConsultingStylePicker.d.ts +0 -34
  40. package/dist/chat/components/FloatingComparisonButton.d.ts +0 -2
  41. package/dist/chat/components/FloatingLauncher.d.ts +0 -79
  42. package/dist/chat/components/GroundingReviewCard.d.ts +0 -3
  43. package/dist/chat/components/HandoffNotice.d.ts +0 -4
  44. package/dist/chat/components/KvkkBanner.d.ts +0 -6
  45. package/dist/chat/components/Launcher.d.ts +0 -28
  46. package/dist/chat/components/PanelRestoreCard.d.ts +0 -4
  47. package/dist/chat/components/PanelTopBar.d.ts +0 -32
  48. package/dist/chat/components/PhotoAnalysisCard.d.ts +0 -20
  49. package/dist/chat/components/ProductSummaryCard.d.ts +0 -3
  50. package/dist/chat/components/ProsAndCons.d.ts +0 -8
  51. package/dist/chat/components/ReviewHighlights.d.ts +0 -9
  52. package/dist/chat/components/actionClassifier.d.ts +0 -12
  53. package/dist/chat/components/product-price-layout.d.ts +0 -18
  54. package/dist/chat/components/productMentionLinker.d.ts +0 -25
  55. package/dist/chat/components/renderUISpec.d.ts +0 -11
  56. package/dist/chat/components/typewriter.d.ts +0 -24
  57. package/dist/chat/extendedModeManager.d.ts +0 -32
  58. package/dist/chat/features/beauty-consulting/consulting-grid.d.ts +0 -31
  59. package/dist/chat/features/beauty-consulting/drawer-extensions.d.ts +0 -20
  60. package/dist/chat/features/beauty-consulting/mode-controller.d.ts +0 -53
  61. package/dist/chat/features/beauty-consulting/registry.d.ts +0 -3
  62. package/dist/chat/features/beauty-consulting/stream-handler.d.ts +0 -38
  63. package/dist/chat/history-storage.d.ts +0 -85
  64. package/dist/chat/index.d.ts +0 -5
  65. package/dist/chat/kvkk.d.ts +0 -20
  66. package/dist/chat/locales/en.d.ts +0 -2
  67. package/dist/chat/locales/index.d.ts +0 -5
  68. package/dist/chat/locales/tr.d.ts +0 -2
  69. package/dist/chat/panel-manager.d.ts +0 -126
  70. package/dist/chat/runtime.d.ts +0 -400
  71. package/dist/chat/session-persistence.d.ts +0 -65
  72. package/dist/chat/stream-error-display.d.ts +0 -6
  73. package/dist/chat/types.d.ts +0 -543
  74. package/dist/chat/utils/chat-presentation-debug.d.ts +0 -19
  75. package/dist/chat/utils/get-chat-scroll-element.d.ts +0 -10
  76. package/dist/chat/utils/ui.d.ts +0 -10
  77. package/dist/common/action-router.d.ts +0 -26
  78. package/dist/common/activity-tracker.d.ts +0 -37
  79. package/dist/common/analytics-events.d.ts +0 -91
  80. package/dist/common/analytics.d.ts +0 -61
  81. package/dist/common/api-paths.d.ts +0 -15
  82. package/dist/common/client.d.ts +0 -27
  83. package/dist/common/communication-bridge.d.ts +0 -51
  84. package/dist/common/config-constants.d.ts +0 -1
  85. package/dist/common/config-schema.d.ts +0 -81
  86. package/dist/common/connection-warning.d.ts +0 -8
  87. package/dist/common/consulting-sources.d.ts +0 -9
  88. package/dist/common/context.d.ts +0 -27
  89. package/dist/common/css-escape.d.ts +0 -1
  90. package/dist/common/customization-factories.d.ts +0 -62
  91. package/dist/common/debug.d.ts +0 -13
  92. package/dist/common/events.d.ts +0 -46
  93. package/dist/common/fastIntent.d.ts +0 -1
  94. package/dist/common/find-similar-payload.d.ts +0 -3
  95. package/dist/common/ga-datalayer.d.ts +0 -89
  96. package/dist/common/global-error-toast.d.ts +0 -6
  97. package/dist/common/index.d.ts +0 -50
  98. package/dist/common/indexed-db.d.ts +0 -79
  99. package/dist/common/locale.d.ts +0 -1
  100. package/dist/common/native-webview.d.ts +0 -60
  101. package/dist/common/navigation.d.ts +0 -5
  102. package/dist/common/overlay.d.ts +0 -168
  103. package/dist/common/page-detect.d.ts +0 -30
  104. package/dist/common/pill-launcher.d.ts +0 -51
  105. package/dist/common/preflight.d.ts +0 -13
  106. package/dist/common/price-formatter.d.ts +0 -35
  107. package/dist/common/product-utils.d.ts +0 -35
  108. package/dist/common/protocol-adapter.d.ts +0 -105
  109. package/dist/common/renderer/dom.d.ts +0 -3
  110. package/dist/common/renderer/index.d.ts +0 -4
  111. package/dist/common/renderer/overrides.d.ts +0 -23
  112. package/dist/common/renderer/registry.d.ts +0 -2
  113. package/dist/common/renderer/types.d.ts +0 -19
  114. package/dist/common/safe-html.d.ts +0 -22
  115. package/dist/common/sdk-version.d.ts +0 -3
  116. package/dist/common/skeleton.d.ts +0 -8
  117. package/dist/common/streaming.d.ts +0 -37
  118. package/dist/common/suggested-search-keywords.d.ts +0 -18
  119. package/dist/common/theme-utils.d.ts +0 -15
  120. package/dist/common/tts-player.d.ts +0 -13
  121. package/dist/common/types.d.ts +0 -381
  122. package/dist/common/ui-theme.d.ts +0 -9
  123. package/dist/common/uuidv7.d.ts +0 -7
  124. package/dist/common/voice-input.d.ts +0 -74
  125. package/dist/common/widget-base.d.ts +0 -97
  126. package/dist/index.d.ts +0 -25
  127. package/dist/native/index.d.ts +0 -2
  128. package/dist/overlay.d.ts +0 -4
  129. package/dist/qna/api.d.ts +0 -23
  130. package/dist/qna/catalog.d.ts +0 -73
  131. package/dist/qna/components/ButtonRow.d.ts +0 -15
  132. package/dist/qna/components/TextInput.d.ts +0 -11
  133. package/dist/qna/components/renderUISpec.d.ts +0 -7
  134. package/dist/qna/index.d.ts +0 -3
  135. package/dist/qna/locales/en.d.ts +0 -2
  136. package/dist/qna/locales/index.d.ts +0 -5
  137. package/dist/qna/locales/tr.d.ts +0 -2
  138. package/dist/qna/normalize-ui-specs.d.ts +0 -15
  139. package/dist/qna/runtime.d.ts +0 -62
  140. package/dist/qna/types.d.ts +0 -98
  141. package/dist/simbut/index.d.ts +0 -22
  142. package/dist/simbut/locales.d.ts +0 -3
  143. package/dist/simbut/types.d.ts +0 -43
  144. package/dist/simrel/api.d.ts +0 -25
  145. package/dist/simrel/catalog.d.ts +0 -110
  146. package/dist/simrel/components/GroupTabs.d.ts +0 -24
  147. package/dist/simrel/components/ProductCard.d.ts +0 -19
  148. package/dist/simrel/components/ProductGrid.d.ts +0 -17
  149. package/dist/simrel/components/renderUISpec.d.ts +0 -7
  150. package/dist/simrel/index.d.ts +0 -5
  151. package/dist/simrel/locales/en.d.ts +0 -2
  152. package/dist/simrel/locales/index.d.ts +0 -5
  153. package/dist/simrel/locales/tr.d.ts +0 -2
  154. package/dist/simrel/renderers/default.d.ts +0 -40
  155. package/dist/simrel/runtime.d.ts +0 -59
  156. package/dist/simrel/types.d.ts +0 -141
@@ -1,53 +0,0 @@
1
- /**
2
- * Centralized chat presentation state (focus thread, scroll requests, read hints).
3
- * Purpose-aligned with the legacy Redux presentation slice, without Redux.
4
- */
5
- export type GroupReadState = 'seen' | 'unseen' | 'active_unread' | 'overflow_unread';
6
- export type PresentationGroupMeta = {
7
- id: string;
8
- threadId: string;
9
- readState: GroupReadState;
10
- status: 'streaming' | 'complete';
11
- updatedAt: number;
12
- };
13
- export type ScrollRequest = {
14
- id: number;
15
- type: 'thread' | 'bottom';
16
- behavior: ScrollBehavior;
17
- threadId?: string;
18
- };
19
- export declare class ChatPresentationState {
20
- /** Per-assistant-thread read / streaming metadata */
21
- groups: Record<string, PresentationGroupMeta>;
22
- pinnedToBottom: boolean;
23
- userInteracting: boolean;
24
- /** When set, transcript UI may collapse other threads until released */
25
- focusedThreadId: string | null;
26
- /** Drawer / widget considered visible */
27
- shown: boolean;
28
- lastAutoAnchoredGroupId: string | null;
29
- scrollRequest: ScrollRequest | null;
30
- private _nextScrollId;
31
- setShown(shown: boolean): void;
32
- reset(): void;
33
- registerAssistantActivity(threadId: string): void;
34
- finalizeAssistantGroup(threadId: string): void;
35
- setGroupReadStates(updates: Array<{
36
- groupId: string;
37
- readState: GroupReadState;
38
- }>): void;
39
- requestThreadFocus(threadId: string, behavior?: ScrollBehavior): void;
40
- requestScrollToBottom(behavior?: ScrollBehavior): void;
41
- consumeScrollRequest(id: number): void;
42
- releaseFocusedThread(): void;
43
- /** Align focus with rollback / thread without queuing scroll */
44
- setFocusedThreadId(threadId: string | null): void;
45
- markGroupAutoAnchored(groupId: string): void;
46
- /** Block soft stream scroll when user pulled away from bottom */
47
- shouldBlockStreamAutoScroll(): boolean;
48
- getAssistantReadState(threadId: string): GroupReadState | undefined;
49
- }
50
- /**
51
- * Latest assistant “group” with unread semantics (for auto-anchor).
52
- */
53
- export declare function getLatestUnreadAssistantThreadId(orderedThreadIds: string[], state: ChatPresentationState): string | null;
@@ -1,3 +0,0 @@
1
- import { UIElement } from '../../common/types.js';
2
- import { ChatUISpecRenderContext } from '../types.js';
3
- export declare function renderAIGroupingCards(element: UIElement, ctx: ChatUISpecRenderContext): HTMLElement;
@@ -1,3 +0,0 @@
1
- import { UIElement } from '../../common/types.js';
2
- import { ChatUISpecRenderContext } from '../types.js';
3
- export declare function renderAISuggestedSearchCards(element: UIElement, ctx: ChatUISpecRenderContext): HTMLElement;
@@ -1,3 +0,0 @@
1
- import { UIElement } from '../../common/types.js';
2
- import { ChatUISpecRenderContext } from '../types.js';
3
- export declare function renderAITopPicks(element: UIElement, ctx: ChatUISpecRenderContext): HTMLElement;
@@ -1,16 +0,0 @@
1
- import { UIElement } from '../../common/types.js';
2
- import { ChatUISpecRenderContext } from '../types.js';
3
- export interface BeautyPhotoStepProps {
4
- processing: boolean;
5
- title?: string | undefined;
6
- description?: string | undefined;
7
- uploadLabel?: string | undefined;
8
- skipLabel?: string | undefined;
9
- }
10
- /** Extract typed props from a raw UISpec element props bag. */
11
- export declare function parseBeautyPhotoStepProps(props: Record<string, unknown>): BeautyPhotoStepProps;
12
- export interface BeautyPhotoStepCallbacks {
13
- onUpload?: (() => void) | undefined;
14
- onSkip?: (() => void) | undefined;
15
- }
16
- export declare function renderBeautyPhotoStep(element: UIElement, ctx: ChatUISpecRenderContext, callbacks?: BeautyPhotoStepCallbacks): HTMLElement;
@@ -1,3 +0,0 @@
1
- import { UIElement } from '../../common/types.js';
2
- import { ChatUISpecRenderContext } from '../types.js';
3
- export declare function renderCategoriesContainer(element: UIElement, context: ChatUISpecRenderContext): HTMLElement;
@@ -1,360 +0,0 @@
1
- import { ChatI18n, ChatMessage } from '../types.js';
2
- /** Generic fallback icon (right-arrow) used when a pill specifies an icon name not in the map. */
3
- declare const DEFAULT_ACTION_ICON = "<svg viewBox=\"0 0 16 16\" class=\"gengage-chat-icon\"><path d=\"M3 8h10M9 4l4 4-4 4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>";
4
- /** SVG icon map for suggested action chips/pills. Keys match backend icon names. */
5
- declare const SUGGESTED_ACTION_ICONS: Record<string, string>;
6
- export { SUGGESTED_ACTION_ICONS, DEFAULT_ACTION_ICON };
7
- export interface ChatDrawerOptions {
8
- i18n: ChatI18n;
9
- onSend: (text: string, attachment?: File) => void;
10
- /** Callback fired when the cart icon button in the header is clicked. */
11
- onCartClick?: (() => void) | undefined;
12
- onClose: () => void;
13
- onAttachment?: (file: File) => void;
14
- onPanelToggle?: () => void;
15
- /**
16
- * Fired when side panel visibility/content changes so the parent can refresh host scroll lock
17
- * and backdrop classes. Not related to the Google Chrome browser — “host shell” means the
18
- * surrounding page/document integration.
19
- */
20
- onHostShellSync?: () => void;
21
- onRollback?: (messageId: string) => void;
22
- headerTitle?: string | undefined;
23
- headerAvatarUrl?: string | undefined;
24
- /** Launcher image URL — used as avatar fallback when headerAvatarUrl is not set. */
25
- launcherImageUrl?: string | undefined;
26
- headerBadge?: string | undefined;
27
- /** URL for the cart icon link in the header (e.g. "/sepetim"). */
28
- /** @deprecated Use onCartClick instead. If set, the cart button will navigate to this URL. */
29
- headerCartUrl?: string | undefined;
30
- /** When true, render the header favorites (heart) button. */
31
- showHeaderFavorites?: boolean | undefined;
32
- onFavoritesClick?: (() => void) | undefined;
33
- /** Callback fired when the history button in the header is clicked. */
34
- onHistoryClick?: (() => void) | undefined;
35
- /** Callback fired when the panel back button is clicked. */
36
- onPanelBack?: (() => void) | undefined;
37
- /** Callback fired when the panel forward button is clicked. */
38
- onPanelForward?: (() => void) | undefined;
39
- /** Callback fired when the mobile panel close (✕) button is tapped.
40
- * Should clear panel history and comparison state in the caller. */
41
- onPanelClose?: (() => void) | undefined;
42
- /**
43
- * Fired when the user drags the mobile handle and releases.
44
- * 'half' | 'full' → switch to that snap position.
45
- * 'close' → close the drawer.
46
- */
47
- onMobileSnap?: ((state: 'half' | 'full' | 'close') => void) | undefined;
48
- /** Returns the current mobile sheet state so the drag handler knows which snap to target. */
49
- getMobileState?: (() => 'half' | 'full') | undefined;
50
- /** Returns true when the chat is displayed as a mobile bottom-sheet. Used to keep the side-panel back button always enabled. */
51
- getMobileViewport?: (() => boolean) | undefined;
52
- /** Callback fired when a link in bot HTML is clicked. */
53
- onLinkClick?: ((url: string) => void) | undefined;
54
- /** Render a frontend-owned message UI payload inside the bubble, when present. */
55
- renderMessageUISpec?: ((message: ChatMessage) => HTMLElement | null) | undefined;
56
- /** Enable voice input (Web Speech API STT). Default: false. */
57
- voiceEnabled?: boolean | undefined;
58
- /** BCP 47 language for speech recognition. Default: 'tr-TR'. */
59
- voiceLang?: string | undefined;
60
- /** Callback fired when the "New Chat" button is clicked. */
61
- onNewChat?: (() => void) | undefined;
62
- /**
63
- * Transcript presentation hooks (focus thread, pin-to-bottom heuristics).
64
- * Optional — when omitted, legacy scroll behaviour is unchanged.
65
- */
66
- presentation?: {
67
- onPinnedToBottomChange?: (pinned: boolean) => void;
68
- onUserInteractingChange?: (interacting: boolean) => void;
69
- /** User scrolled up while a thread focus is active — parent may show "former messages" */
70
- onFormerMessagesHint?: () => void;
71
- /** When true, stream-driven soft scroll-to-bottom is suppressed */
72
- shouldBlockSoftAutoScroll?: () => boolean;
73
- /** User tapped "show former messages" */
74
- onReleasePresentationFocus?: () => void;
75
- };
76
- }
77
- type SetPanelContentOptions = {
78
- preserveAiZone?: boolean;
79
- };
80
- export declare class ChatDrawer {
81
- private root;
82
- private messagesEl;
83
- private inputEl;
84
- private sendBtn;
85
- private _sendStopHandler;
86
- private i18n;
87
- private onSend;
88
- private _panelEl;
89
- private _panelVisible;
90
- private _panelCollapsed;
91
- private _dividerEl;
92
- private _onPanelToggle;
93
- private _onHostShellSync;
94
- private _pendingAttachment;
95
- private _fileInput;
96
- private _previewStrip;
97
- private _previewName;
98
- private _onAttachment;
99
- private _onRollback;
100
- private _onLinkClick;
101
- private _pillsEl;
102
- private _kvkkSlot;
103
- private _panelTopBar;
104
- private _userScrolledUp;
105
- private _scrollLockedUntil;
106
- private _inputChipsEl;
107
- private _panelFloatingEl;
108
- /** Mobile: overlay host for comparison dock (above panel scroll; avoids transformed panel containing block). */
109
- private _comparisonDockSlotEl;
110
- /** Slot between panel top bar and main scroll content (desktop AI picks / analyzing strip). */
111
- private _panelAiZoneEl;
112
- private _favBadgeEl;
113
- private _thinkingSteps;
114
- private _firstBotMessageIds;
115
- private _voiceInput;
116
- private _micBtn;
117
- private _voiceEnabled;
118
- private _voiceLang;
119
- private _ignoreNextDividerClick;
120
- private readonly _cleanups;
121
- private _focusTrapHandler;
122
- private _previouslyFocusedElement;
123
- private _conversationEl;
124
- private readonly _options;
125
- private _reopenPanelBtn;
126
- private _presentationFocusThreadId;
127
- private _formerMessagesBtn;
128
- private _programmaticScrollUntil;
129
- private _userInteractionUntil;
130
- private _touchStartY;
131
- private _presentationPinned;
132
- private _presentationUserInteracting;
133
- private _resizeRafId;
134
- private _cartBtn;
135
- private _attachWrapEl;
136
- private _attachMenuEl;
137
- private _attachBtn;
138
- private _attachMenuCleanup;
139
- private _attachMenuClickTimerId;
140
- private _typingLoadingBinding;
141
- private _panelLoadingBinding;
142
- private _panelAiZoneLoadingBinding;
143
- private _beautyPhotoStepEl;
144
- private _renderPhotoAnalysisCard;
145
- constructor(container: HTMLElement, options: ChatDrawerOptions);
146
- addMessage(message: ChatMessage): void;
147
- /** Remove one transcript bubble (e.g. superseded empty assistant placeholder). */
148
- removeMessageBubble(messageId: string): void;
149
- showTypingIndicator(searchText?: string): void;
150
- /** Accumulate a new thinking step (shown as a checklist in the typing indicator). */
151
- addThinkingStep(text: string): void;
152
- setThinkingSteps(steps: string[]): void;
153
- removeTypingIndicator(): void;
154
- /** Show a "Stop generating" button below the typing indicator. */
155
- showStopButton(onStop: () => void): void;
156
- /** Remove the stop-generating button if present. */
157
- hideStopButton(): void;
158
- showError(message?: string, onRetry?: () => void): void;
159
- /** Show error with recovery action pills ("Try again" + "Ask something else"). */
160
- showErrorWithRecovery(message: string, actions: {
161
- onRetry: () => void;
162
- onNewQuestion: () => void;
163
- }): void;
164
- /** Recovery pills only — error copy is shown as a normal assistant message. */
165
- showRecoveryPillsOnly(actions: {
166
- onRetry: () => void;
167
- onNewQuestion: () => void;
168
- }): void;
169
- private setRecoveryPills;
170
- clearMessages(): void;
171
- /** Replace suggestion pills. Pass empty array to hide. */
172
- setPills(pills: Array<{
173
- label: string;
174
- onAction: () => void;
175
- icon?: string;
176
- image?: string;
177
- description?: string;
178
- }>): void;
179
- focusInput(): void;
180
- showKvkkBanner(html: string, onDismiss: () => void): void;
181
- hideKvkkBanner(): void;
182
- /** True when the KVKK banner is mounted (user has not dismissed it yet). */
183
- isKvkkBannerVisible(): boolean;
184
- getElement(): HTMLElement;
185
- /** Opens the hidden file picker used by the attachment flow. */
186
- openAttachmentPicker(): void;
187
- /** Show/hide camera attach controls in the input shell. */
188
- setAttachmentControlsVisible(visible: boolean): void;
189
- /** Beauty mode selfie helper card shown above the input area. */
190
- setBeautyPhotoStepCard(options: {
191
- visible: boolean;
192
- processing?: boolean;
193
- onSkip?: (() => void) | undefined;
194
- title?: string | undefined;
195
- description?: string | undefined;
196
- uploadLabel?: string | undefined;
197
- skipLabel?: string | undefined;
198
- }): void;
199
- /** Stage a file attachment for sending. Shows preview. */
200
- stageAttachment(file: File): void;
201
- /** Remove the staged attachment and hide preview. */
202
- clearAttachment(): void;
203
- private _routeAttachmentFile;
204
- private _closeAttachMenu;
205
- private _openAttachMenu;
206
- private _toggleAttachMenu;
207
- private _pasteImageFromClipboardMenu;
208
- /** Get the currently staged attachment file, or null. */
209
- getPendingAttachment(): File | null;
210
- /**
211
- * Area above the main panel body for “analyzing” + AITopPicks / AIGroupingCards
212
- * so they stay in the main pane instead of the chat column.
213
- */
214
- setPanelAiZoneState(state: 'hidden' | 'analyzing' | 'results', options?: {
215
- resultEl?: HTMLElement;
216
- analyzingLabel?: string;
217
- }): void;
218
- private _clearPanelAiZoneState;
219
- private _resetPanelAiZoneElement;
220
- private _emitHostShellSync;
221
- private _syncPanelTopBarFromContent;
222
- private _syncPanelTopBarTitleFromContent;
223
- /** Replace panel content and show the panel. */
224
- setPanelContent(el: HTMLElement, options?: SetPanelContentOptions): void;
225
- /**
226
- * Targeted content swap for an already-visible panel. Replaces the skeleton
227
- * or the current content element with `el`, leaving topbar / AI zone /
228
- * floating element attached. Also resets topbar actions
229
- * because the incoming content provides its own toolbar.
230
- */
231
- private _swapPanelContent;
232
- /** Append content to the panel without replacing existing content. */
233
- appendPanelContent(el: HTMLElement): void;
234
- /** Return the panel element's content child (after topbar), or null. */
235
- getPanelContentElement(): HTMLElement | null;
236
- /**
237
- * After in-place mutations to panel content (e.g. consulting grid streaming patch),
238
- * refresh top bar title derivation without replacing the content node.
239
- */
240
- resyncPanelTopBarFromCurrentContent(): void;
241
- /** Whether the panel is currently visible (may be empty). */
242
- isPanelVisible(): boolean;
243
- /** Whether the panel is currently visible and has rendered content beyond chrome elements. */
244
- hasPanelContent(): boolean;
245
- /** Whether panel currently shows loading skeleton blocks. */
246
- isPanelLoading(): boolean;
247
- /** Show loading skeleton in the panel. Variant depends on contentType hint. */
248
- showPanelLoading(contentType?: string): void;
249
- /** Update the panel top bar navigation state. */
250
- updatePanelTopBar(canBack: boolean, canForward: boolean, title: string): void;
251
- getPanelTopBarTitle(): string;
252
- /** Update the favorites badge count. Pass 0 to hide the badge. */
253
- updateFavoritesBadge(count: number): void;
254
- /**
255
- * Hide the panel and clear its content. Always hides — even in force-expanded mode.
256
- * Callers: _hideDrawer (stale panel cleanup), stream onDone (loading skeleton cleanup),
257
- * thread navigation (no snapshot to restore). All require full hide.
258
- * Keeps `_panelCollapsed` untouched so user collapse preference survives future panel renders.
259
- */
260
- clearPanel(): void;
261
- private _syncComparisonDockVisibility;
262
- /**
263
- * Mobile-only slot (see CSS): pins the comparison dock above panel scroll.
264
- * Pass null to clear.
265
- */
266
- setComparisonDockContent(el: HTMLElement | null): void;
267
- /**
268
- * On mobile: hide the side panel overlay without clearing its content.
269
- * Shows the reopen button in the header so the user can slide the panel back in.
270
- */
271
- hideMobilePanel(): void;
272
- private _showMobilePanelFromBtn;
273
- showMobilePanel(): void;
274
- /** Expand panel without locking — user can still toggle via divider. */
275
- expandPanel(): void;
276
- /**
277
- * Ensure the panel starts expanded (panelMode: 'expanded').
278
- * Users can still collapse/expand via the divider chevron.
279
- */
280
- setForceExpanded(): void;
281
- /**
282
- * Reset the left panel scroll to the top after new list/grid content is mounted.
283
- * innerHTML assignment already resets scrollTop to 0; this is a defensive pin in
284
- * case subsequent DOM mutations (appended children, layout) shift it.
285
- */
286
- private _smoothScrollPanelListToTop;
287
- private _getChoicePrompterRevealScrollThreshold;
288
- /** Update scroll affordance (bottom fade gradient) on the panel. */
289
- private _updateScrollAffordance;
290
- /** Horizontal swipe on conversation/panel areas to toggle the panel (mobile only). */
291
- private _setupHorizontalSwipe;
292
- /** Toggle panel between collapsed and expanded. */
293
- togglePanel(): void;
294
- /** Whether the panel is currently collapsed by the user. */
295
- isPanelCollapsed(): boolean;
296
- /** Programmatically set panel collapsed state. */
297
- setPanelCollapsed(collapsed: boolean): void;
298
- /** Save panel collapsed state to sessionStorage. */
299
- persistPanelState(accountId: string): void;
300
- /** Restore panel collapsed state from sessionStorage. Returns true when restored as collapsed. */
301
- restorePanelState(accountId: string): boolean;
302
- private _createLoadingSequence;
303
- private _applyLoadingSteps;
304
- private _clearLoadingBindingInterval;
305
- private _destroyLoadingBinding;
306
- private _updateSendEnabled;
307
- private _renderSendButtonIcon;
308
- private _submit;
309
- private _toggleVoice;
310
- /** Lock auto-scroll for 500ms after session history restore to prevent visual jump. */
311
- lockScrollForRestore(): void;
312
- /** Scroll to bottom only if user hasn't scrolled up. Force=true always scrolls. */
313
- private _scrollToBottom;
314
- /** Public method for typewriter ticks — scrolls only if user is near bottom. */
315
- scrollToBottomIfNeeded(): void;
316
- /** Update a bot message's text content in the DOM (e.g. for fallback messages). */
317
- updateBotMessage(messageId: string, html: string, renderHint?: string, photoAnalysis?: {
318
- summary: string;
319
- strengths?: string[];
320
- focusPoints?: string[];
321
- celebStyle?: string;
322
- celebStyleReason?: string;
323
- nextQuestion?: string;
324
- }): void;
325
- /** Mark a message as the first bot message in its thread (for special styling). */
326
- markFirstBotMessage(messageId: string): void;
327
- /** Scroll to the first message of the last thread (for restore targeting). */
328
- scrollToLastThread(): void;
329
- /** Scroll transcript so the thread’s first visible element sits near the top; skips
330
- * empty/zero-height bubbles (silent or not-yet-streamed) so real content anchors instead. */
331
- scrollThreadIntoView(threadId: string, behavior?: ScrollBehavior): boolean;
332
- /** Programmatic scroll to bottom (e.g. host bridge) — bypasses “user scrolled up” until next frame. */
333
- scrollToBottomPresentation(behavior?: ScrollBehavior): void;
334
- private _scrollMessagesTo;
335
- /** Collapse transcript to a single thread (null = show full history). */
336
- setPresentationFocus(threadId: string | null): void;
337
- setFormerMessagesButtonVisible(visible: boolean): void;
338
- setInputPlaceholder(placeholder: string): void;
339
- private _applyPresentationCollapsed;
340
- /** Call after inline chat DOM (e.g. ProductSummaryCard) is appended — reapplies thread collapse. */
341
- refreshPresentationCollapsed(): void;
342
- /** Set compact input-area chips (search/info/review shortcuts above input). */
343
- setInputAreaChips(chips: Array<{
344
- label: string;
345
- onAction: () => void;
346
- icon?: string;
347
- }>): void;
348
- /** Clear input-area chips. */
349
- clearInputAreaChips(): void;
350
- /** Activate focus trap — Tab/Shift+Tab cycles within the drawer. */
351
- trapFocus(): void;
352
- /** Release the focus trap and restore previously focused element. */
353
- releaseFocus(): void;
354
- /** Briefly animate the cart icon button to signal a successful add-to-cart. */
355
- flashCartBadge(): void;
356
- /** Show a temporary success toast inside the shadow root. */
357
- showCartToast(message: string): void;
358
- /** Clean up event listeners and child resources (VoiceInput, timers). */
359
- destroy(): void;
360
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Floating card that suggests the user try comparison mode.
3
- *
4
- * Shows in the panel bottom-right when a ProductGrid is displayed and
5
- * comparison mode is not active.
6
- */
7
- export interface ChoicePrompterOptions {
8
- heading: string;
9
- suggestion: string;
10
- ctaLabel: string;
11
- threadId: string;
12
- onCtaClick: () => void;
13
- onDismiss?: () => void;
14
- dismissAriaLabel?: string;
15
- }
16
- export declare function createChoicePrompter(options: ChoicePrompterOptions): HTMLElement;
17
- /** Called when a new user search starts so the card can be shown again. */
18
- export declare function clearChoicePrompterDismissState(): void;
19
- export declare function isChoicePrompterDismissed(threadId: string): boolean;
20
- /** Records the same dismiss state as the CTA for external toolbar actions. */
21
- export declare function recordChoicePrompterDismissedForThread(threadId: string): void;
@@ -1,57 +0,0 @@
1
- import { PriceFormatConfig } from '../../common/price-formatter.js';
2
- /**
3
- * Map a raw criteria field name to a human-readable label.
4
- * Checks locale-specific `criteriaLabels` first (from i18n), then the
5
- * built-in fallback map, then applies a formatting heuristic.
6
- */
7
- export declare function formatCriteriaName(rawName: string, criteriaLabels?: Record<string, string>, locale?: string): string;
8
- export interface ComparisonProduct {
9
- sku: string;
10
- name: string;
11
- price: string;
12
- imageUrl?: string | undefined;
13
- rating?: number | undefined;
14
- reviewCount?: number | undefined;
15
- }
16
- export interface ComparisonAttribute {
17
- label: string;
18
- values: string[];
19
- }
20
- export interface ComparisonTableI18n {
21
- comparisonHeading?: string;
22
- recommendedChoiceLabel?: string;
23
- highlightsLabel?: string;
24
- keyDifferencesLabel?: string;
25
- specialCasesLabel?: string;
26
- viewMoreLabel?: string;
27
- addToCartButton?: string;
28
- /** Locale-specific attribute display names (e.g., { screen_size: 'Screen Size' }). */
29
- criteriaLabels?: Record<string, string>;
30
- }
31
- export interface ComparisonTableOptions {
32
- recommended: ComparisonProduct;
33
- products: ComparisonProduct[];
34
- attributes: ComparisonAttribute[];
35
- highlights: string[];
36
- specialCases?: string[] | undefined;
37
- onProductClick: (params: {
38
- sku: string;
39
- name: string;
40
- }) => void;
41
- onAddToCart?: ((sku: string) => void) | undefined;
42
- recommendedText?: string | undefined;
43
- winnerHits?: Record<string, {
44
- positive?: string[];
45
- negative?: string[];
46
- }> | undefined;
47
- productActions?: Record<string, {
48
- title: string;
49
- type: string;
50
- payload?: unknown;
51
- }> | undefined;
52
- keyDifferencesHtml?: string | undefined;
53
- locale?: string | undefined;
54
- i18n?: ComparisonTableI18n | undefined;
55
- pricing?: PriceFormatConfig | undefined;
56
- }
57
- export declare function renderComparisonTable(options: ComparisonTableOptions): HTMLElement;
@@ -1,34 +0,0 @@
1
- import { ChatUISpecRenderContext } from '../types.js';
2
- export type StyleVariationProduct = Record<string, unknown>;
3
- export type StyleVariation = {
4
- style_label?: string;
5
- style_mood?: string;
6
- image_url?: string;
7
- status?: string;
8
- product_list?: StyleVariationProduct[];
9
- recommendation_groups?: Array<{
10
- label?: string;
11
- reason?: string;
12
- skus?: string[];
13
- }>;
14
- };
15
- export declare function getVariationStatus(variation: StyleVariation): string;
16
- /** First tab that is not actively loading — fast-first paint for streaming grids. */
17
- export declare function firstRenderableVariationIndex(styleVariations: StyleVariation[]): number;
18
- /** Normalise a consulting image URL from the backend (absolute or relative). */
19
- export declare function toConsultingImageUrl(input: unknown): string | undefined;
20
- /**
21
- * Renders the consulting style picker UI (variation buttons + grouped product grid).
22
- *
23
- * @param wrapper Container to append into.
24
- * @param grid The product grid element (cleared and repopulated per variation).
25
- * @param source Backend source tag (`beauty_consulting` | `watch_expert`).
26
- * @param styleVariations Non-empty filtered variation list.
27
- * @param ctx Render context (i18n, callbacks).
28
- */
29
- export declare function renderConsultingStylePicker(wrapper: HTMLElement, grid: HTMLElement, source: string, styleVariations: StyleVariation[], ctx?: ChatUISpecRenderContext): void;
30
- /**
31
- * Apply streaming updates to an existing consulting picker without replacing the
32
- * whole panel DOM. Returns false if `wrapper` is not a consulting grid shell.
33
- */
34
- export declare function patchConsultingStylePickerDom(wrapper: HTMLElement, source: string, styleVariations: StyleVariation[], ctx?: ChatUISpecRenderContext): boolean;
@@ -1,2 +0,0 @@
1
- import { ChatUISpecRenderContext } from '../types.js';
2
- export declare function renderFloatingComparisonButton(selectedSkus: string[], ctx: ChatUISpecRenderContext): HTMLElement;
@@ -1,79 +0,0 @@
1
- /**
2
- * FloatingLauncher — Customizable search-bar style launcher that mounts inside
3
- * the chat widget's shadow DOM.
4
- *
5
- * Follows the same pattern as `makePillLauncher`: the chat widget runtime
6
- * calls `createFloatingLauncher()` internally when `config.floatingLauncher`
7
- * is set — no host-side `apply()` step is needed.
8
- *
9
- * In the injector, just pass the option through chat config:
10
- *
11
- * chat: {
12
- * floatingLauncher: {
13
- * primaryColor: '#ec6e00',
14
- * placeholders: ['Ürün ara', 'Karşılaştır', 'Soru sor'],
15
- * },
16
- * }
17
- */
18
- export interface FloatingLauncherOptions {
19
- /** Brand accent color — focus ring, wave bars, border animation. Default: '#6366f1' */
20
- primaryColor?: string;
21
- /** Input bar background. Default: '#ffffff' */
22
- backgroundColor?: string;
23
- /** Input text color. Default: '#111827' */
24
- textColor?: string;
25
- /** Placeholder text color. Default: '#9ca3af' */
26
- placeholderColor?: string;
27
- /** Icon / button color. Default: '#6b7280' */
28
- iconColor?: string;
29
- /** Normal-state border color. Default: '#e5e7eb' */
30
- borderColor?: string;
31
- /** Input bar corner radius. Default: '999px' */
32
- borderRadius?: string;
33
- /** Input bar height. Default: '56px' */
34
- height?: string;
35
- /**
36
- * Maximum width of the input bar.
37
- * Can also be set via CSS: `--gengage-floating-launcher-max-width`.
38
- * Default: '680px'
39
- */
40
- maxWidth?: string;
41
- /** CSS font-family string. Default: 'inherit' */
42
- fontFamily?: string;
43
- /**
44
- * Placeholder texts that cycle in sequence.
45
- * Default: ['Ürün ara', 'Karşılaştır', 'Soru sor']
46
- */
47
- placeholders?: string[];
48
- /** Milliseconds between placeholder rotations. Default: 2000 */
49
- placeholderInterval?: number;
50
- /**
51
- * Web Speech API language code.
52
- * Default: 'tr-TR'
53
- */
54
- voiceLang?: string;
55
- /**
56
- * Animate a rainbow border ring while voice recording is active.
57
- * Default: true
58
- */
59
- showBorderAnimation?: boolean;
60
- sendAriaLabel?: string;
61
- micAriaLabel?: string;
62
- cancelAriaLabel?: string;
63
- openChatAriaLabel?: string;
64
- }
65
- export interface FloatingLauncherKit {
66
- /** Root container element — the runtime appends this to the shadow DOM. */
67
- readonly container: HTMLElement;
68
- /**
69
- * Show the "open chat" icon button. The runtime calls this after the user's
70
- * first message has been successfully sent.
71
- */
72
- showOpenChatButton(): void;
73
- /** Release all resources. Called by the widget's `destroy()`. */
74
- destroy(): void;
75
- }
76
- export declare function createFloatingLauncher(options: FloatingLauncherOptions, callbacks: {
77
- onSend: (text: string) => void;
78
- onOpenChat: () => void;
79
- }, shadowRoot: ShadowRoot): FloatingLauncherKit;
@@ -1,3 +0,0 @@
1
- import { UIElement } from '../../common/types.js';
2
- import { ChatUISpecRenderContext } from '../types.js';
3
- export declare function renderGroundingReviewCard(element: UIElement, ctx: ChatUISpecRenderContext): HTMLElement;
@@ -1,4 +0,0 @@
1
- import { ChatUISpecRenderContext } from '../types.js';
2
- export declare function renderHandoffNotice(element: {
3
- props?: Record<string, unknown>;
4
- }, context: ChatUISpecRenderContext): HTMLElement;
@@ -1,6 +0,0 @@
1
- export interface KvkkBannerOptions {
2
- htmlContent: string;
3
- onDismiss: () => void;
4
- closeAriaLabel?: string;
5
- }
6
- export declare function createKvkkBanner(options: KvkkBannerOptions): HTMLElement;