@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.d.mts CHANGED
@@ -81,7 +81,8 @@ interface ContenifyChatBotProps {
81
81
  apiUrl?: string;
82
82
  apiKey?: string;
83
83
  domain?: string;
84
+ onPost?: (content: string, keywords: string[]) => void;
84
85
  }
85
- declare function ContenifyChatBot({ apiUrl, apiKey, domain }: ContenifyChatBotProps): react_jsx_runtime.JSX.Element;
86
+ declare function ContenifyChatBot({ apiUrl, apiKey, domain, onPost }: ContenifyChatBotProps): react_jsx_runtime.JSX.Element;
86
87
 
87
88
  export { type AnalyzeInputResponse, type AppearancePreferences, type ChatbotPreferences, ContenifyChatBot, type ContenifyChatBotProps, type ContentOption, type ContentPreferences, type CreateContentPayload, type LocalizationPreferences, type Preferences, type RecreateSettings, ContenifyChatBot as default, setConfig };
package/dist/index.d.ts CHANGED
@@ -81,7 +81,8 @@ interface ContenifyChatBotProps {
81
81
  apiUrl?: string;
82
82
  apiKey?: string;
83
83
  domain?: string;
84
+ onPost?: (content: string, keywords: string[]) => void;
84
85
  }
85
- declare function ContenifyChatBot({ apiUrl, apiKey, domain }: ContenifyChatBotProps): react_jsx_runtime.JSX.Element;
86
+ declare function ContenifyChatBot({ apiUrl, apiKey, domain, onPost }: ContenifyChatBotProps): react_jsx_runtime.JSX.Element;
86
87
 
87
88
  export { type AnalyzeInputResponse, type AppearancePreferences, type ChatbotPreferences, ContenifyChatBot, type ContenifyChatBotProps, type ContentOption, type ContentPreferences, type CreateContentPayload, type LocalizationPreferences, type Preferences, type RecreateSettings, ContenifyChatBot as default, setConfig };
package/dist/index.js CHANGED
@@ -875,7 +875,8 @@ function ChatWindow({
875
875
  onSelectNews,
876
876
  isStreaming = false,
877
877
  analyzedData,
878
- onSelectAction
878
+ onSelectAction,
879
+ onPost: onPostCallback
879
880
  }) {
880
881
  var _a, _b;
881
882
  const { loading, showNewsPanel } = useTheme();
@@ -924,7 +925,7 @@ function ChatWindow({
924
925
  handleCloseModal();
925
926
  };
926
927
  const handlePost = (content, keywords) => {
927
- console.log("Posting:", { content, keywords });
928
+ onPostCallback == null ? void 0 : onPostCallback(content, keywords);
928
929
  handleCloseModal();
929
930
  };
930
931
  (0, import_react6.useLayoutEffect)(() => {
@@ -2150,7 +2151,7 @@ var rewriteNewsApi = async ({
2150
2151
  var import_react_hot_toast2 = __toESM(require("react-hot-toast"));
2151
2152
  var import_lucide_react7 = require("lucide-react");
2152
2153
  var import_jsx_runtime11 = require("react/jsx-runtime");
2153
- function ChatBot() {
2154
+ function ChatBot({ onPost }) {
2154
2155
  const { loading } = useTheme();
2155
2156
  const { preferences } = usePreferences();
2156
2157
  const [preferencesOpen, setPreferencesOpen] = (0, import_react10.useState)(false);
@@ -2434,7 +2435,8 @@ ${optionsList}`
2434
2435
  onSelectNews: handleRecreate,
2435
2436
  isStreaming,
2436
2437
  analyzedData,
2437
- onSelectAction: handleSelectAction
2438
+ onSelectAction: handleSelectAction,
2439
+ onPost
2438
2440
  }
2439
2441
  ) }),
2440
2442
  !messages.length && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "cnfy-empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
@@ -2456,11 +2458,11 @@ ${optionsList}`
2456
2458
 
2457
2459
  // src/index.tsx
2458
2460
  var import_jsx_runtime12 = require("react/jsx-runtime");
2459
- function ContenifyChatBot({ apiUrl, apiKey, domain }) {
2461
+ function ContenifyChatBot({ apiUrl, apiKey, domain, onPost }) {
2460
2462
  (0, import_react11.useEffect)(() => {
2461
2463
  setConfig({ apiUrl, apiKey, domain });
2462
2464
  }, [apiUrl, apiKey, domain]);
2463
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PreferencesProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChatBot, {}) });
2465
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PreferencesProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChatBot, { onPost }) });
2464
2466
  }
2465
2467
  var index_default = ContenifyChatBot;
2466
2468
  // Annotate the CommonJS export names for ESM import in node: