@contenify/chatbot 0.1.5 → 1.0.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/index.mjs CHANGED
@@ -852,7 +852,8 @@ function ChatWindow({
852
852
  onSelectNews,
853
853
  isStreaming = false,
854
854
  analyzedData,
855
- onSelectAction
855
+ onSelectAction,
856
+ onPost: onPostCallback
856
857
  }) {
857
858
  var _a, _b;
858
859
  const { loading, showNewsPanel } = useTheme();
@@ -901,7 +902,7 @@ function ChatWindow({
901
902
  handleCloseModal();
902
903
  };
903
904
  const handlePost = (content, keywords) => {
904
- console.log("Posting:", { content, keywords });
905
+ onPostCallback == null ? void 0 : onPostCallback(content, keywords);
905
906
  handleCloseModal();
906
907
  };
907
908
  useLayoutEffect(() => {
@@ -2127,7 +2128,7 @@ var rewriteNewsApi = async ({
2127
2128
  import toast2 from "react-hot-toast";
2128
2129
  import { Loader2 } from "lucide-react";
2129
2130
  import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
2130
- function ChatBot() {
2131
+ function ChatBot({ onPost }) {
2131
2132
  const { loading } = useTheme();
2132
2133
  const { preferences } = usePreferences();
2133
2134
  const [preferencesOpen, setPreferencesOpen] = useState7(false);
@@ -2411,7 +2412,8 @@ ${optionsList}`
2411
2412
  onSelectNews: handleRecreate,
2412
2413
  isStreaming,
2413
2414
  analyzedData,
2414
- onSelectAction: handleSelectAction
2415
+ onSelectAction: handleSelectAction,
2416
+ onPost
2415
2417
  }
2416
2418
  ) }),
2417
2419
  !messages.length && /* @__PURE__ */ jsx11("div", { className: "cnfy-empty-state", children: /* @__PURE__ */ jsxs8("div", { children: [
@@ -2433,11 +2435,11 @@ ${optionsList}`
2433
2435
 
2434
2436
  // src/index.tsx
2435
2437
  import { jsx as jsx12 } from "react/jsx-runtime";
2436
- function ContenifyChatBot({ apiUrl, apiKey, domain }) {
2438
+ function ContenifyChatBot({ apiUrl, apiKey, domain, onPost }) {
2437
2439
  useEffect8(() => {
2438
2440
  setConfig({ apiUrl, apiKey, domain });
2439
2441
  }, [apiUrl, apiKey, domain]);
2440
- return /* @__PURE__ */ jsx12(PreferencesProvider, { children: /* @__PURE__ */ jsx12(ChatBot, {}) });
2442
+ return /* @__PURE__ */ jsx12(PreferencesProvider, { children: /* @__PURE__ */ jsx12(ChatBot, { onPost }) });
2441
2443
  }
2442
2444
  var index_default = ContenifyChatBot;
2443
2445
  export {