chatbotlite 0.6.1 → 0.6.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.
@@ -89,6 +89,13 @@ interface ChatWidgetCommonProps {
89
89
  * - URL → rendered as image
90
90
  */
91
91
  launcherIcon?: string;
92
+ /**
93
+ * Open the chat panel on mount instead of showing only the launcher.
94
+ * Good for demo / landing pages where the visitor should see the bot
95
+ * immediately. Default false — production sites usually want the
96
+ * launcher-first behaviour so the chrome stays unobtrusive.
97
+ */
98
+ defaultOpen?: boolean;
92
99
  }
93
100
  interface ChatWidgetDirectProps extends ChatWidgetCommonProps {
94
101
  /** Markdown knowledge for the bot. Client-side mode — API keys WILL be exposed. */
@@ -89,6 +89,13 @@ interface ChatWidgetCommonProps {
89
89
  * - URL → rendered as image
90
90
  */
91
91
  launcherIcon?: string;
92
+ /**
93
+ * Open the chat panel on mount instead of showing only the launcher.
94
+ * Good for demo / landing pages where the visitor should see the bot
95
+ * immediately. Default false — production sites usually want the
96
+ * launcher-first behaviour so the chrome stays unobtrusive.
97
+ */
98
+ defaultOpen?: boolean;
92
99
  }
93
100
  interface ChatWidgetDirectProps extends ChatWidgetCommonProps {
94
101
  /** Markdown knowledge for the bot. Client-side mode — API keys WILL be exposed. */
@@ -1174,7 +1174,7 @@ function ChatWidget(props) {
1174
1174
  const voiceEnabled = voiceCfg?.enabled === true;
1175
1175
  const voiceLang = voiceCfg?.lang ?? "en-US";
1176
1176
  const speechSupported = typeof window !== "undefined" && (Boolean(window.SpeechRecognition) || Boolean(window.webkitSpeechRecognition));
1177
- const [open, setOpen] = useState(false);
1177
+ const [open, setOpen] = useState(Boolean(props.defaultOpen));
1178
1178
  const [expanded, setExpanded] = useState(() => {
1179
1179
  if (typeof window === "undefined") return false;
1180
1180
  try {