@gengage/assistant-fe 0.4.8 → 0.4.10

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.
@@ -0,0 +1,79 @@
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 +1,5 @@
1
1
  export * from './runtime.js';
2
2
  export { chatCatalog } from './catalog.js';
3
3
  export type { ChatCatalog, ChatComponentName } from './catalog.js';
4
+ export { createFloatingLauncher } from './components/FloatingLauncher.js';
5
+ export type { FloatingLauncherOptions } from './components/FloatingLauncher.js';
@@ -26,6 +26,7 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
26
26
  /** Full-viewport scrim when drawer is open (floating/overlay); not used for inline. */
27
27
  private _backdropEl;
28
28
  private _launcher;
29
+ private _floatingLauncher;
29
30
  private _drawer;
30
31
  private _bridge;
31
32
  private _drawerVisible;
@@ -1,7 +1,9 @@
1
1
  import { BaseWidgetConfig, ActionPayload } from '../common/types.js';
2
2
  import { UnknownActionPolicy } from '../common/config-schema.js';
3
3
  import { PillLauncherOptions } from '../common/pill-launcher.js';
4
+ import { FloatingLauncherOptions } from './components/FloatingLauncher.js';
4
5
  import { UISpecDomRegistry, UISpecRendererOverrides } from '../common/renderer/index.js';
6
+ export type { FloatingLauncherOptions };
5
7
  export interface ChatWidgetConfig extends BaseWidgetConfig {
6
8
  /**
7
9
  * Widget display variant:
@@ -30,6 +32,13 @@ export interface ChatWidgetConfig extends BaseWidgetConfig {
30
32
  * Floating variant only; omit manual `launcherImageUrl` when using this.
31
33
  */
32
34
  pillLauncher?: PillLauncherOptions;
35
+ /**
36
+ * Search-bar style floating launcher with voice input. Replaces the standard
37
+ * FAB button with a full-width pill input bar. The widget mounts it inside the
38
+ * shadow DOM — no host-side `apply()` needed.
39
+ * Floating variant only; mutually exclusive with `pillLauncher` and `launcherImageUrl`.
40
+ */
41
+ floatingLauncher?: FloatingLauncherOptions;
33
42
  /** Tooltip text shown on launcher hover. */
34
43
  launcherTooltip?: string;
35
44
  /** Header display title (overrides i18n.headerTitle). */
@@ -1,13 +1,13 @@
1
- import { a as e, c as t, i as r, l as s, n, o as i, r as l, s as C, t as c, u as h } from "./runtime-BlYMjp2f.js";
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-CIfT45il.js";
2
2
  export {
3
- t as CHAT_SCROLL_ELEMENT_ID,
3
+ s as CHAT_SCROLL_ELEMENT_ID,
4
4
  r as ChatPresentationState,
5
5
  c as GengageChat,
6
6
  n as createChatWidget,
7
- e as createDefaultChatUISpecRegistry,
8
- i as defaultChatUnknownUISpecRenderer,
9
- s as getChatScrollElement,
10
- h as invalidateChatScrollCache,
7
+ i as createDefaultChatUISpecRegistry,
8
+ C as defaultChatUnknownUISpecRenderer,
9
+ d as getChatScrollElement,
10
+ t as invalidateChatScrollCache,
11
11
  l as isSimilarsAppendGrid,
12
- C as renderUISpec
12
+ e as renderUISpec
13
13
  };