@convai/web-sdk 1.8.0-beta.0 → 1.8.0-beta.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/vanilla/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyIrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,MAmHlC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AA+DhD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAQ,WAAsB,KAAG,IAanE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,SAAQ,WAAsB,KAAG,IAahE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,MAO1D,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/vanilla/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyIrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,MAmHlC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAuFhD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAQ,WAAsB,KAAG,IAanE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,SAAQ,WAAsB,KAAG,IAahE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,MAO1D,CAAC"}
@@ -304,6 +304,26 @@ const WIDGET_KEYFRAMES = `
304
304
  50% { opacity: 1; }
305
305
  }
306
306
 
307
+ /* Voice mode's avatar: two counter-rotating liquid-gradient layers behind
308
+ * the character image. Matches the React overlay's framer-motion values
309
+ * (VoiceModeOverlay.tsx) — 20s clockwise for the conic layer, 15s
310
+ * anticlockwise for the radial one, both linear and infinite — and the
311
+ * gentle scale breathing it applies while the character is speaking. */
312
+ @keyframes convaiVoiceSpin {
313
+ from { transform: rotate(0deg); }
314
+ to { transform: rotate(360deg); }
315
+ }
316
+
317
+ @keyframes convaiVoiceSpinReverse {
318
+ from { transform: rotate(360deg); }
319
+ to { transform: rotate(0deg); }
320
+ }
321
+
322
+ @keyframes convaiVoiceBreathe {
323
+ 0%, 100% { transform: scale(1); }
324
+ 50% { transform: scale(1.05); }
325
+ }
326
+
307
327
  @media (prefers-reduced-motion: reduce) {
308
328
  .convai-connecting-spin {
309
329
  animation: none !important;
@@ -311,6 +331,10 @@ const WIDGET_KEYFRAMES = `
311
331
  .convai-connecting-pulse {
312
332
  animation: none !important;
313
333
  }
334
+ .convai-voice-gradient,
335
+ .convai-voice-avatar {
336
+ animation: none !important;
337
+ }
314
338
  }
315
339
  `;
316
340
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/vanilla/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE;QACN,OAAO,EAAE;YACP,EAAE,EAA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EAAE;IAClE,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SAC1B,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5D,OAAO,GAAG,MAAM,KAAK,KAAK,EAAE,CAAC;IAC/B,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC,CAAC","sourcesContent":["/**\n * Vanilla Styles - Port of React theme system for vanilla implementations\n */\n\n// Theme configuration (matching React version)\nexport const aeroTheme = {\n colors: {\n primary: {\n 50: \"#f0f9ff\",\n 100: \"#e0f2fe\",\n 200: \"#bae6fd\",\n 300: \"#7dd3fc\",\n 400: \"#38bdf8\",\n 500: \"#0ea5e9\",\n 600: \"#0284c7\",\n 700: \"#0369a1\",\n 800: \"#075985\",\n 900: \"#0c4a6e\",\n },\n convai: {\n light: \"#1EB453\",\n medium: \"#0b6049\",\n dark: \"#084c3a\",\n },\n neutral: {\n 50: \"#fafafa\",\n 100: \"#f5f5f5\",\n 200: \"#e5e5e5\",\n 300: \"#d4d4d4\",\n 400: \"#a3a3a3\",\n 500: \"#737373\",\n 600: \"#525252\",\n 700: \"#404040\",\n 800: \"#262626\",\n 900: \"#171717\",\n },\n glass: {\n light: \"rgba(255, 255, 255, 0.1)\",\n medium: \"rgba(255, 255, 255, 0.15)\",\n dark: \"rgba(0, 0, 0, 0.1)\",\n backdrop: \"rgba(255, 255, 255, 0.8)\",\n card: \"rgba(255, 255, 255, 0.9)\",\n backdropLight: \"blur(20px)\",\n borderLight: \"1px solid rgba(255, 255, 255, 0.2)\",\n },\n accent: {\n purple: \"#8b5cf6\",\n green: \"#10b981\",\n blue: \"#3b82f6\",\n orange: \"#f59e0b\",\n red: \"#ef4444\",\n },\n error: {\n 50: \"#fef2f2\",\n 100: \"#fee2e2\",\n 200: \"#fecaca\",\n 300: \"#fca5a5\",\n 400: \"#f87171\",\n 500: \"#ef4444\",\n 600: \"#dc2626\",\n 700: \"#b91c1c\",\n 800: \"#991b1b\",\n 900: \"#7f1d1d\",\n },\n text: {\n primary: \"#1f2937\",\n secondary: \"#6b7280\",\n tertiary: \"#9ca3af\",\n inverse: \"#ffffff\",\n },\n },\n typography: {\n fontFamily: {\n primary: '\"Noto Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n body: '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n mono: 'SF Mono, Monaco, \"Cascadia Code\", \"Roboto Mono\", Consolas, \"Courier New\", monospace',\n },\n fontSize: {\n xs: \"12px\",\n sm: \"14px\",\n base: \"16px\",\n lg: \"18px\",\n xl: \"20px\",\n \"2xl\": \"24px\",\n \"3xl\": \"30px\",\n \"4xl\": \"36px\",\n },\n fontWeight: {\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n },\n },\n spacing: {\n xs: \"4px\",\n sm: \"8px\",\n md: \"16px\",\n lg: \"24px\",\n xl: \"32px\",\n \"2xl\": \"48px\",\n \"3xl\": \"64px\",\n },\n borderRadius: {\n none: \"0\",\n sm: \"4px\",\n md: \"8px\",\n lg: \"12px\",\n xl: \"16px\",\n \"2xl\": \"24px\",\n full: \"9999px\",\n },\n shadows: {\n sm: \"0 1px 2px 0 rgba(0, 0, 0, 0.05)\",\n md: \"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)\",\n lg: \"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)\",\n xl: \"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)\",\n glass: \"0 8px 32px rgba(0, 0, 0, 0.1)\",\n },\n glass: {\n backdrop: \"blur(20px)\",\n backdropLight: \"blur(10px)\",\n backdropHeavy: \"blur(40px)\",\n border: \"1px solid rgba(255, 255, 255, 0.2)\",\n borderLight: \"1px solid rgba(255, 255, 255, 0.1)\",\n },\n transitions: {\n fast: \"0.15s ease-in-out\",\n normal: \"0.2s ease-in-out\",\n slow: \"0.3s ease-in-out\",\n spring: \"0.4s cubic-bezier(0.4, 0, 0.2, 1)\",\n snappy: \"all 0.1s ease-out\",\n },\n zIndex: {\n base: 1,\n dropdown: 1000,\n sticky: 1020,\n fixed: 1030,\n modal: 1040,\n popover: 1050,\n tooltip: 1060,\n },\n};\n\n/**\n * Global CSS styles for the Convai widget\n * This should be injected once into the document head\n */\nexport const getGlobalStyles = (): string => `\n @keyframes convai-pulse {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n }\n\n @keyframes convai-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n\n @keyframes convai-bounce {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n }\n\n @keyframes convai-slide-up {\n from {\n transform: translateY(20px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n }\n\n @keyframes convai-slide-down {\n from {\n transform: translateY(-20px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n }\n\n @keyframes convai-fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes convai-scale-in {\n from {\n transform: scale(0.8);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n }\n\n .convai-widget * {\n box-sizing: border-box;\n }\n\n .convai-widget {\n font-family: var(--convai-font, ${aeroTheme.typography.fontFamily.primary});\n color: var(--convai-panel-fg, ${aeroTheme.colors.text.primary});\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n .convai-widget button {\n font-family: inherit;\n cursor: pointer;\n border: none;\n outline: none;\n background: none;\n padding: 0;\n margin: 0;\n }\n\n .convai-widget input {\n font-family: inherit;\n border: none;\n outline: none;\n background: none;\n }\n\n .convai-widget::-webkit-scrollbar {\n width: 6px;\n }\n\n .convai-widget::-webkit-scrollbar-track {\n background: rgba(0, 0, 0, 0.05);\n border-radius: 3px;\n }\n\n .convai-widget::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 3px;\n }\n\n .convai-widget::-webkit-scrollbar-thumb:hover {\n background: rgba(0, 0, 0, 0.3);\n }\n`;\n\n/**\n * A document (the default) or a shadow root the widget is mounted inside.\n * `@keyframes` and global styles must be injected per-target because\n * shadow trees do not resolve rules defined in the document head.\n */\nexport type StyleTarget = Document | ShadowRoot;\n\n/** Ids of the injected <style> nodes. Public in effect: hosts and a second\n * copy of the SDK on the same page both key off them. */\nconst WIDGET_STYLES_ID = 'convai-widget-styles';\nconst WIDGET_KEYFRAMES_ID = 'convai-widget-keyframes';\n\n/** Targets that already hold the widget stylesheet. Per-target, so multiple\n * widget instances and shadow roots each get their own copy. */\nconst styledTargets = new WeakSet<StyleTarget>();\n\n/** Targets that already hold the widget's `@keyframes`. */\nconst keyframedTargets = new WeakSet<StyleTarget>();\n\n/** Where a <style> node should be appended for a given target. */\nconst styleHost = (target: StyleTarget): ShadowRoot | HTMLHeadElement =>\n target instanceof ShadowRoot ? target : target.head;\n\n/**\n * True when `target` already holds a <style> with this id.\n *\n * The WeakSets above dedup within one module instance. This is the\n * cross-bundle guard: two copies of the SDK on one page (an app bundling it\n * and an embed script loading its own) each get their own WeakSet, so without\n * an existence check they would both append a <style> carrying the same id.\n * Inert, but the pre-refactor inline code checked for this and it should not\n * regress.\n */\nconst hasStyleNode = (target: StyleTarget, id: string): boolean =>\n styleHost(target).querySelector(`#${id}`) !== null;\n\nconst WIDGET_KEYFRAMES = `\n @keyframes popIn {\n from { opacity: 0; transform: scale(0.95) translateY(-10px); }\n to { opacity: 1; transform: scale(1) translateY(0); }\n }\n\n /* Connecting overlay: logo spin + label pulse. Values match the React\n * widget's framer-motion transitions (ConvaiWidget.tsx:681-737) exactly --\n * a full turn every 2s linear, and opacity 0.5 -> 1 -> 0.5 every 2s\n * ease-in-out. React does not honour prefers-reduced-motion; vanilla does,\n * via the media query below, since a full-turn infinite spin plus a\n * pulsing label is exactly what that setting exists for. */\n @keyframes convaiConnectingSpin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n @keyframes convaiConnectingPulse {\n 0%, 100% { opacity: 0.5; }\n 50% { opacity: 1; }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .convai-connecting-spin {\n animation: none !important;\n }\n .convai-connecting-pulse {\n animation: none !important;\n }\n }\n`;\n\n/**\n * Inject the widget's global styles into a document or a shadow root.\n * Defaults to the document, so existing callers are unaffected.\n */\nexport const injectGlobalStyles = (target: StyleTarget = document): void => {\n if (styledTargets.has(target)) return;\n if (hasStyleNode(target, WIDGET_STYLES_ID)) {\n styledTargets.add(target);\n return;\n }\n\n const styleElement = document.createElement('style');\n styleElement.id = WIDGET_STYLES_ID;\n styleElement.textContent = getGlobalStyles();\n styleHost(target).appendChild(styleElement);\n\n styledTargets.add(target);\n};\n\n/**\n * Inject the widget's `@keyframes` (e.g. the settings tray's `popIn`)\n * into a document or a shadow root. `@keyframes` defined in the document\n * do not resolve for shadow content, so they must be injected into each\n * shadow root that uses them.\n */\nexport const injectKeyframes = (target: StyleTarget = document): void => {\n if (keyframedTargets.has(target)) return;\n if (hasStyleNode(target, WIDGET_KEYFRAMES_ID)) {\n keyframedTargets.add(target);\n return;\n }\n\n const style = document.createElement('style');\n style.id = WIDGET_KEYFRAMES_ID;\n style.textContent = WIDGET_KEYFRAMES;\n styleHost(target).appendChild(style);\n\n keyframedTargets.add(target);\n};\n\n/**\n * Helper to create inline styles object from theme\n */\nexport const createStyles = (styles: Record<string, any>): string => {\n return Object.entries(styles)\n .map(([key, value]) => {\n const cssKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n return `${cssKey}: ${value}`;\n })\n .join('; ');\n};\n\n"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/vanilla/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE;QACN,OAAO,EAAE;YACP,EAAE,EAAE,SAAS;YACb,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;SACf;QACD,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,SAAS;YACjB,IAAI,EAAE,SAAS;SAChB;QACD,OAAO,EAAE;YACP,EAAE,EAAE,SAAS;YACb,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;SACf;QACD,KAAK,EAAE;YACL,KAAK,EAAE,0BAA0B;YACjC,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,oBAAoB;YAC1B,QAAQ,EAAE,0BAA0B;YACpC,IAAI,EAAE,0BAA0B;YAChC,aAAa,EAAE,YAAY;YAC3B,WAAW,EAAE,oCAAoC;SAClD;QACD,MAAM,EAAE;YACN,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,SAAS;YACjB,GAAG,EAAE,SAAS;SACf;QACD,KAAK,EAAE;YACL,EAAE,EAAE,SAAS;YACb,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;YAC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BAAgB,CAAC;IACrC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAErC,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAA2B,EAAU,EAAE;IAClE,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SAC1B,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5D,OAAO,GAAG,MAAM,KAAK,KAAK,EAAE,CAAC;IAC/B,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC,CAAC","sourcesContent":["/**\n * Vanilla Styles - Port of React theme system for vanilla implementations\n */\n\n// Theme configuration (matching React version)\nexport const aeroTheme = {\n colors: {\n primary: {\n 50: \"#f0f9ff\",\n 100: \"#e0f2fe\",\n 200: \"#bae6fd\",\n 300: \"#7dd3fc\",\n 400: \"#38bdf8\",\n 500: \"#0ea5e9\",\n 600: \"#0284c7\",\n 700: \"#0369a1\",\n 800: \"#075985\",\n 900: \"#0c4a6e\",\n },\n convai: {\n light: \"#1EB453\",\n medium: \"#0b6049\",\n dark: \"#084c3a\",\n },\n neutral: {\n 50: \"#fafafa\",\n 100: \"#f5f5f5\",\n 200: \"#e5e5e5\",\n 300: \"#d4d4d4\",\n 400: \"#a3a3a3\",\n 500: \"#737373\",\n 600: \"#525252\",\n 700: \"#404040\",\n 800: \"#262626\",\n 900: \"#171717\",\n },\n glass: {\n light: \"rgba(255, 255, 255, 0.1)\",\n medium: \"rgba(255, 255, 255, 0.15)\",\n dark: \"rgba(0, 0, 0, 0.1)\",\n backdrop: \"rgba(255, 255, 255, 0.8)\",\n card: \"rgba(255, 255, 255, 0.9)\",\n backdropLight: \"blur(20px)\",\n borderLight: \"1px solid rgba(255, 255, 255, 0.2)\",\n },\n accent: {\n purple: \"#8b5cf6\",\n green: \"#10b981\",\n blue: \"#3b82f6\",\n orange: \"#f59e0b\",\n red: \"#ef4444\",\n },\n error: {\n 50: \"#fef2f2\",\n 100: \"#fee2e2\",\n 200: \"#fecaca\",\n 300: \"#fca5a5\",\n 400: \"#f87171\",\n 500: \"#ef4444\",\n 600: \"#dc2626\",\n 700: \"#b91c1c\",\n 800: \"#991b1b\",\n 900: \"#7f1d1d\",\n },\n text: {\n primary: \"#1f2937\",\n secondary: \"#6b7280\",\n tertiary: \"#9ca3af\",\n inverse: \"#ffffff\",\n },\n },\n typography: {\n fontFamily: {\n primary: '\"Noto Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n body: '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n mono: 'SF Mono, Monaco, \"Cascadia Code\", \"Roboto Mono\", Consolas, \"Courier New\", monospace',\n },\n fontSize: {\n xs: \"12px\",\n sm: \"14px\",\n base: \"16px\",\n lg: \"18px\",\n xl: \"20px\",\n \"2xl\": \"24px\",\n \"3xl\": \"30px\",\n \"4xl\": \"36px\",\n },\n fontWeight: {\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n },\n },\n spacing: {\n xs: \"4px\",\n sm: \"8px\",\n md: \"16px\",\n lg: \"24px\",\n xl: \"32px\",\n \"2xl\": \"48px\",\n \"3xl\": \"64px\",\n },\n borderRadius: {\n none: \"0\",\n sm: \"4px\",\n md: \"8px\",\n lg: \"12px\",\n xl: \"16px\",\n \"2xl\": \"24px\",\n full: \"9999px\",\n },\n shadows: {\n sm: \"0 1px 2px 0 rgba(0, 0, 0, 0.05)\",\n md: \"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)\",\n lg: \"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)\",\n xl: \"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)\",\n glass: \"0 8px 32px rgba(0, 0, 0, 0.1)\",\n },\n glass: {\n backdrop: \"blur(20px)\",\n backdropLight: \"blur(10px)\",\n backdropHeavy: \"blur(40px)\",\n border: \"1px solid rgba(255, 255, 255, 0.2)\",\n borderLight: \"1px solid rgba(255, 255, 255, 0.1)\",\n },\n transitions: {\n fast: \"0.15s ease-in-out\",\n normal: \"0.2s ease-in-out\",\n slow: \"0.3s ease-in-out\",\n spring: \"0.4s cubic-bezier(0.4, 0, 0.2, 1)\",\n snappy: \"all 0.1s ease-out\",\n },\n zIndex: {\n base: 1,\n dropdown: 1000,\n sticky: 1020,\n fixed: 1030,\n modal: 1040,\n popover: 1050,\n tooltip: 1060,\n },\n};\n\n/**\n * Global CSS styles for the Convai widget\n * This should be injected once into the document head\n */\nexport const getGlobalStyles = (): string => `\n @keyframes convai-pulse {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n }\n\n @keyframes convai-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n\n @keyframes convai-bounce {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n }\n\n @keyframes convai-slide-up {\n from {\n transform: translateY(20px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n }\n\n @keyframes convai-slide-down {\n from {\n transform: translateY(-20px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n }\n\n @keyframes convai-fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes convai-scale-in {\n from {\n transform: scale(0.8);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n }\n\n .convai-widget * {\n box-sizing: border-box;\n }\n\n .convai-widget {\n font-family: var(--convai-font, ${aeroTheme.typography.fontFamily.primary});\n color: var(--convai-panel-fg, ${aeroTheme.colors.text.primary});\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n .convai-widget button {\n font-family: inherit;\n cursor: pointer;\n border: none;\n outline: none;\n background: none;\n padding: 0;\n margin: 0;\n }\n\n .convai-widget input {\n font-family: inherit;\n border: none;\n outline: none;\n background: none;\n }\n\n .convai-widget::-webkit-scrollbar {\n width: 6px;\n }\n\n .convai-widget::-webkit-scrollbar-track {\n background: rgba(0, 0, 0, 0.05);\n border-radius: 3px;\n }\n\n .convai-widget::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 3px;\n }\n\n .convai-widget::-webkit-scrollbar-thumb:hover {\n background: rgba(0, 0, 0, 0.3);\n }\n`;\n\n/**\n * A document (the default) or a shadow root the widget is mounted inside.\n * `@keyframes` and global styles must be injected per-target because\n * shadow trees do not resolve rules defined in the document head.\n */\nexport type StyleTarget = Document | ShadowRoot;\n\n/** Ids of the injected <style> nodes. Public in effect: hosts and a second\n * copy of the SDK on the same page both key off them. */\nconst WIDGET_STYLES_ID = 'convai-widget-styles';\nconst WIDGET_KEYFRAMES_ID = 'convai-widget-keyframes';\n\n/** Targets that already hold the widget stylesheet. Per-target, so multiple\n * widget instances and shadow roots each get their own copy. */\nconst styledTargets = new WeakSet<StyleTarget>();\n\n/** Targets that already hold the widget's `@keyframes`. */\nconst keyframedTargets = new WeakSet<StyleTarget>();\n\n/** Where a <style> node should be appended for a given target. */\nconst styleHost = (target: StyleTarget): ShadowRoot | HTMLHeadElement =>\n target instanceof ShadowRoot ? target : target.head;\n\n/**\n * True when `target` already holds a <style> with this id.\n *\n * The WeakSets above dedup within one module instance. This is the\n * cross-bundle guard: two copies of the SDK on one page (an app bundling it\n * and an embed script loading its own) each get their own WeakSet, so without\n * an existence check they would both append a <style> carrying the same id.\n * Inert, but the pre-refactor inline code checked for this and it should not\n * regress.\n */\nconst hasStyleNode = (target: StyleTarget, id: string): boolean =>\n styleHost(target).querySelector(`#${id}`) !== null;\n\nconst WIDGET_KEYFRAMES = `\n @keyframes popIn {\n from { opacity: 0; transform: scale(0.95) translateY(-10px); }\n to { opacity: 1; transform: scale(1) translateY(0); }\n }\n\n /* Connecting overlay: logo spin + label pulse. Values match the React\n * widget's framer-motion transitions (ConvaiWidget.tsx:681-737) exactly --\n * a full turn every 2s linear, and opacity 0.5 -> 1 -> 0.5 every 2s\n * ease-in-out. React does not honour prefers-reduced-motion; vanilla does,\n * via the media query below, since a full-turn infinite spin plus a\n * pulsing label is exactly what that setting exists for. */\n @keyframes convaiConnectingSpin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n @keyframes convaiConnectingPulse {\n 0%, 100% { opacity: 0.5; }\n 50% { opacity: 1; }\n }\n\n /* Voice mode's avatar: two counter-rotating liquid-gradient layers behind\n * the character image. Matches the React overlay's framer-motion values\n * (VoiceModeOverlay.tsx) — 20s clockwise for the conic layer, 15s\n * anticlockwise for the radial one, both linear and infinite — and the\n * gentle scale breathing it applies while the character is speaking. */\n @keyframes convaiVoiceSpin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n @keyframes convaiVoiceSpinReverse {\n from { transform: rotate(360deg); }\n to { transform: rotate(0deg); }\n }\n\n @keyframes convaiVoiceBreathe {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.05); }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .convai-connecting-spin {\n animation: none !important;\n }\n .convai-connecting-pulse {\n animation: none !important;\n }\n .convai-voice-gradient,\n .convai-voice-avatar {\n animation: none !important;\n }\n }\n`;\n\n/**\n * Inject the widget's global styles into a document or a shadow root.\n * Defaults to the document, so existing callers are unaffected.\n */\nexport const injectGlobalStyles = (target: StyleTarget = document): void => {\n if (styledTargets.has(target)) return;\n if (hasStyleNode(target, WIDGET_STYLES_ID)) {\n styledTargets.add(target);\n return;\n }\n\n const styleElement = document.createElement('style');\n styleElement.id = WIDGET_STYLES_ID;\n styleElement.textContent = getGlobalStyles();\n styleHost(target).appendChild(styleElement);\n\n styledTargets.add(target);\n};\n\n/**\n * Inject the widget's `@keyframes` (e.g. the settings tray's `popIn`)\n * into a document or a shadow root. `@keyframes` defined in the document\n * do not resolve for shadow content, so they must be injected into each\n * shadow root that uses them.\n */\nexport const injectKeyframes = (target: StyleTarget = document): void => {\n if (keyframedTargets.has(target)) return;\n if (hasStyleNode(target, WIDGET_KEYFRAMES_ID)) {\n keyframedTargets.add(target);\n return;\n }\n\n const style = document.createElement('style');\n style.id = WIDGET_KEYFRAMES_ID;\n style.textContent = WIDGET_KEYFRAMES;\n styleHost(target).appendChild(style);\n\n keyframedTargets.add(target);\n};\n\n/**\n * Helper to create inline styles object from theme\n */\nexport const createStyles = (styles: Record<string, any>): string => {\n return Object.entries(styles)\n .map(([key, value]) => {\n const cssKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n return `${cssKey}: ${value}`;\n })\n .join('; ');\n};\n\n"]}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "1.8.0-beta.0";
1
+ export declare const SDK_VERSION = "1.8.0-beta.2";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // GENERATED by scripts/sync-version.mjs — do not edit by hand.
2
2
  // Regenerated from package.json on every build.
3
- export const SDK_VERSION = "1.8.0-beta.0";
3
+ export const SDK_VERSION = "1.8.0-beta.2";
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,gDAAgD;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC","sourcesContent":["// GENERATED by scripts/sync-version.mjs — do not edit by hand.\n// Regenerated from package.json on every build.\nexport const SDK_VERSION = \"1.8.0-beta.0\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,gDAAgD;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC","sourcesContent":["// GENERATED by scripts/sync-version.mjs — do not edit by hand.\n// Regenerated from package.json on every build.\nexport const SDK_VERSION = \"1.8.0-beta.2\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convai/web-sdk",
3
- "version": "1.8.0-beta.0",
3
+ "version": "1.8.0-beta.2",
4
4
  "description": "Build web apps with lifelike AI characters. The Convai Web SDK gives you real-time voice, lipsync, emotions, and dynamic context — with first-class support for React and vanilla TypeScript.",
5
5
  "private": false,
6
6
  "type": "module",