@contenify/chatbot 0.1.2 → 0.1.4
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.js +182 -191
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +182 -191
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1355 -36
- package/package.json +1 -3
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ var import_axios = __toESM(require("axios"));
|
|
|
61
61
|
|
|
62
62
|
// lib/config.ts
|
|
63
63
|
function getApiBaseUrl() {
|
|
64
|
-
return process.env.NEXT_PUBLIC_CONTENIFY_API_URL ||
|
|
64
|
+
return process.env.NEXT_PUBLIC_CONTENIFY_API_URL || "http://localhost:8080/api";
|
|
65
65
|
}
|
|
66
66
|
function getServerBaseUrl() {
|
|
67
67
|
const apiUrl = getApiBaseUrl();
|
|
@@ -212,31 +212,31 @@ function ArticleModal({
|
|
|
212
212
|
onClose,
|
|
213
213
|
onRecreate
|
|
214
214
|
}) {
|
|
215
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "
|
|
216
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "
|
|
215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "cnfy-article-modal-overlay", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "cnfy-article-modal", children: [
|
|
216
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "cnfy-article-modal-header", children: [
|
|
217
217
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
|
|
218
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "
|
|
219
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { className: "
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "cnfy-article-modal-source", children: "Source Article" }),
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { className: "cnfy-article-modal-title", children: article.title })
|
|
220
220
|
] }),
|
|
221
221
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
222
222
|
"button",
|
|
223
223
|
{
|
|
224
224
|
onClick: onClose,
|
|
225
|
-
className: "
|
|
225
|
+
className: "cnfy-article-modal-close-btn",
|
|
226
226
|
"aria-label": "Close modal",
|
|
227
227
|
children: "\u2715"
|
|
228
228
|
}
|
|
229
229
|
)
|
|
230
230
|
] }),
|
|
231
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "
|
|
232
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "
|
|
233
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "
|
|
234
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "cnfy-article-modal-body", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "cnfy-article-modal-content", children: article.content }) }),
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "cnfy-article-modal-footer", children: [
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "cnfy-article-modal-footer-text", children: "This content will be recreated using AI" }),
|
|
234
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "cnfy-article-modal-footer-actions", children: [
|
|
235
235
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
236
236
|
"button",
|
|
237
237
|
{
|
|
238
238
|
onClick: onClose,
|
|
239
|
-
className: "
|
|
239
|
+
className: "cnfy-btn-cancel",
|
|
240
240
|
children: "Cancel"
|
|
241
241
|
}
|
|
242
242
|
),
|
|
@@ -247,9 +247,8 @@ function ArticleModal({
|
|
|
247
247
|
title: article.title,
|
|
248
248
|
content: article.content,
|
|
249
249
|
id: article._id
|
|
250
|
-
// Include article ID when available
|
|
251
250
|
}),
|
|
252
|
-
className: "
|
|
251
|
+
className: "cnfy-btn-recreate",
|
|
253
252
|
children: "Recreate Article"
|
|
254
253
|
}
|
|
255
254
|
)
|
|
@@ -321,7 +320,7 @@ function RichTextEditor({
|
|
|
321
320
|
content,
|
|
322
321
|
editorProps: {
|
|
323
322
|
attributes: {
|
|
324
|
-
class: "
|
|
323
|
+
class: "ProseMirror"
|
|
325
324
|
}
|
|
326
325
|
},
|
|
327
326
|
onUpdate: ({ editor: editor2 }) => {
|
|
@@ -334,10 +333,10 @@ function RichTextEditor({
|
|
|
334
333
|
}
|
|
335
334
|
}, [content, editor]);
|
|
336
335
|
if (!editor) {
|
|
337
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "
|
|
336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "cnfy-editor-loading", children: "Loading editor..." });
|
|
338
337
|
}
|
|
339
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "
|
|
340
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "
|
|
338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "cnfy-editor", children: [
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "cnfy-toolbar", children: [
|
|
341
340
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
342
341
|
ToolbarButton,
|
|
343
342
|
{
|
|
@@ -365,7 +364,7 @@ function RichTextEditor({
|
|
|
365
364
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Pilcrow, { size: 18 })
|
|
366
365
|
}
|
|
367
366
|
),
|
|
368
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "
|
|
367
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "cnfy-toolbar-divider" }),
|
|
369
368
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
370
369
|
ToolbarButton,
|
|
371
370
|
{
|
|
@@ -384,7 +383,7 @@ function RichTextEditor({
|
|
|
384
383
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Italic, { size: 18 })
|
|
385
384
|
}
|
|
386
385
|
),
|
|
387
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "
|
|
386
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "cnfy-toolbar-divider" }),
|
|
388
387
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
389
388
|
ToolbarButton,
|
|
390
389
|
{
|
|
@@ -403,7 +402,7 @@ function RichTextEditor({
|
|
|
403
402
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.ListOrdered, { size: 18 })
|
|
404
403
|
}
|
|
405
404
|
),
|
|
406
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "
|
|
405
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "cnfy-toolbar-divider" }),
|
|
407
406
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
408
407
|
ToolbarButton,
|
|
409
408
|
{
|
|
@@ -423,7 +422,7 @@ function RichTextEditor({
|
|
|
423
422
|
}
|
|
424
423
|
)
|
|
425
424
|
] }),
|
|
426
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react2.EditorContent, { editor, className: "
|
|
425
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react2.EditorContent, { editor, className: "cnfy-editor-content" })
|
|
427
426
|
] });
|
|
428
427
|
}
|
|
429
428
|
function ToolbarButton({
|
|
@@ -439,7 +438,7 @@ function ToolbarButton({
|
|
|
439
438
|
onClick,
|
|
440
439
|
disabled,
|
|
441
440
|
title,
|
|
442
|
-
className: `
|
|
441
|
+
className: `cnfy-toolbar-btn ${isActive ? "cnfy-toolbar-btn--active" : ""} ${disabled ? "cnfy-toolbar-btn--disabled" : ""}`,
|
|
443
442
|
children
|
|
444
443
|
}
|
|
445
444
|
);
|
|
@@ -523,29 +522,29 @@ function EditModal({
|
|
|
523
522
|
}
|
|
524
523
|
};
|
|
525
524
|
if (!isOpen) return null;
|
|
526
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "cnfy-edit-modal-overlay", children: [
|
|
527
526
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
528
527
|
"div",
|
|
529
528
|
{
|
|
530
|
-
className: "
|
|
529
|
+
className: "cnfy-edit-modal-backdrop",
|
|
531
530
|
onClick: onClose
|
|
532
531
|
}
|
|
533
532
|
),
|
|
534
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
535
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
536
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { className: "
|
|
533
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "cnfy-edit-modal", children: [
|
|
534
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "cnfy-edit-modal-header", children: [
|
|
535
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { className: "cnfy-edit-modal-title", children: "Edit Article" }),
|
|
537
536
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
538
537
|
"button",
|
|
539
538
|
{
|
|
540
539
|
onClick: onClose,
|
|
541
|
-
className: "
|
|
542
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.X, { size: 20, className: "
|
|
540
|
+
className: "cnfy-edit-modal-close-btn",
|
|
541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.X, { size: 20, className: "cnfy-edit-modal-close-icon" })
|
|
543
542
|
}
|
|
544
543
|
)
|
|
545
544
|
] }),
|
|
546
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
545
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "cnfy-edit-modal-body", children: [
|
|
547
546
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
548
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { className: "
|
|
547
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { className: "cnfy-edit-label", children: "Article Content" }),
|
|
549
548
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
550
549
|
RichTextEditor,
|
|
551
550
|
{
|
|
@@ -556,11 +555,11 @@ function EditModal({
|
|
|
556
555
|
)
|
|
557
556
|
] }),
|
|
558
557
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
559
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { className: "
|
|
560
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "
|
|
558
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { className: "cnfy-edit-label", children: "Meta Keywords" }),
|
|
559
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "cnfy-keyword-list", children: keywords.map((keyword, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
561
560
|
"span",
|
|
562
561
|
{
|
|
563
|
-
className: "
|
|
562
|
+
className: "cnfy-keyword-tag",
|
|
564
563
|
children: [
|
|
565
564
|
"#",
|
|
566
565
|
keyword,
|
|
@@ -568,7 +567,7 @@ function EditModal({
|
|
|
568
567
|
"button",
|
|
569
568
|
{
|
|
570
569
|
onClick: () => handleRemoveKeyword(index),
|
|
571
|
-
className: "
|
|
570
|
+
className: "cnfy-keyword-remove-btn",
|
|
572
571
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.X, { size: 14 })
|
|
573
572
|
}
|
|
574
573
|
)
|
|
@@ -576,7 +575,7 @@ function EditModal({
|
|
|
576
575
|
},
|
|
577
576
|
index
|
|
578
577
|
)) }),
|
|
579
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
578
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "cnfy-keyword-input-row", children: [
|
|
580
579
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
581
580
|
"input",
|
|
582
581
|
{
|
|
@@ -585,26 +584,26 @@ function EditModal({
|
|
|
585
584
|
onChange: (e) => setNewKeyword(e.target.value),
|
|
586
585
|
onKeyDown: handleKeyDown,
|
|
587
586
|
placeholder: "Add a keyword...",
|
|
588
|
-
className: "
|
|
587
|
+
className: "cnfy-keyword-input"
|
|
589
588
|
}
|
|
590
589
|
),
|
|
591
590
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
592
591
|
"button",
|
|
593
592
|
{
|
|
594
593
|
onClick: handleAddKeyword,
|
|
595
|
-
className: "
|
|
594
|
+
className: "cnfy-btn-add-keyword",
|
|
596
595
|
children: "Add"
|
|
597
596
|
}
|
|
598
597
|
)
|
|
599
598
|
] })
|
|
600
599
|
] })
|
|
601
600
|
] }),
|
|
602
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
601
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "cnfy-edit-modal-footer", children: [
|
|
603
602
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
604
603
|
"button",
|
|
605
604
|
{
|
|
606
605
|
onClick: onClose,
|
|
607
|
-
className: "
|
|
606
|
+
className: "cnfy-btn-footer-cancel",
|
|
608
607
|
children: "Cancel"
|
|
609
608
|
}
|
|
610
609
|
),
|
|
@@ -612,7 +611,7 @@ function EditModal({
|
|
|
612
611
|
"button",
|
|
613
612
|
{
|
|
614
613
|
onClick: () => onSaveDraft(content, keywords),
|
|
615
|
-
className: "
|
|
614
|
+
className: "cnfy-btn-save-draft",
|
|
616
615
|
children: "Save Draft"
|
|
617
616
|
}
|
|
618
617
|
),
|
|
@@ -620,7 +619,7 @@ function EditModal({
|
|
|
620
619
|
"button",
|
|
621
620
|
{
|
|
622
621
|
onClick: () => onPost(content, keywords),
|
|
623
|
-
className: "
|
|
622
|
+
className: "cnfy-btn-post-article",
|
|
624
623
|
style: { backgroundColor: primaryColor, color: "#fff" },
|
|
625
624
|
children: "Post"
|
|
626
625
|
}
|
|
@@ -675,22 +674,22 @@ function NewsList({
|
|
|
675
674
|
b = Math.round(b + (255 - b) * (percent / 100));
|
|
676
675
|
return `rgb(${r}, ${g}, ${b})`;
|
|
677
676
|
};
|
|
678
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "
|
|
677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "cnfy-news-list", children: news.flatMap((item) => {
|
|
679
678
|
const publishedDate = new Date(item.publishedAt);
|
|
680
679
|
const links = extractLinksFromContent(item.content);
|
|
681
680
|
if (links.length > 0) {
|
|
682
681
|
return links.map((link, idx) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
683
682
|
"div",
|
|
684
683
|
{
|
|
685
|
-
className: "
|
|
684
|
+
className: "cnfy-news-card",
|
|
686
685
|
children: [
|
|
687
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "
|
|
688
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "
|
|
689
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "
|
|
686
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cnfy-news-card-content", children: [
|
|
687
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "cnfy-news-card-title", children: link.title }),
|
|
688
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cnfy-news-card-meta", children: [
|
|
690
689
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
691
690
|
"span",
|
|
692
691
|
{
|
|
693
|
-
className: "
|
|
692
|
+
className: "cnfy-news-badge",
|
|
694
693
|
style: {
|
|
695
694
|
backgroundColor: lightenColor(primaryColorState, 95),
|
|
696
695
|
color: primaryColor,
|
|
@@ -700,7 +699,7 @@ function NewsList({
|
|
|
700
699
|
}
|
|
701
700
|
),
|
|
702
701
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u2022" }),
|
|
703
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "
|
|
702
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "cnfy-news-card-category", children: item.category }),
|
|
704
703
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u2022" }),
|
|
705
704
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
706
705
|
dateFormatter.format(publishedDate),
|
|
@@ -709,12 +708,12 @@ function NewsList({
|
|
|
709
708
|
] })
|
|
710
709
|
] })
|
|
711
710
|
] }),
|
|
712
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "
|
|
711
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cnfy-news-card-actions", children: [
|
|
713
712
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
714
713
|
"button",
|
|
715
714
|
{
|
|
716
715
|
onClick: () => window.open(link.url, "_blank"),
|
|
717
|
-
className: "
|
|
716
|
+
className: "cnfy-news-action-btn",
|
|
718
717
|
title: "View",
|
|
719
718
|
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.Eye, { size: 16 })
|
|
720
719
|
}
|
|
@@ -726,9 +725,8 @@ function NewsList({
|
|
|
726
725
|
title: link.title,
|
|
727
726
|
content: link.title,
|
|
728
727
|
id: item._id
|
|
729
|
-
// Include article ID
|
|
730
728
|
}),
|
|
731
|
-
className: "
|
|
729
|
+
className: "cnfy-news-action-btn",
|
|
732
730
|
title: "Recreate",
|
|
733
731
|
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.RefreshCcw, { size: 16 })
|
|
734
732
|
}
|
|
@@ -742,15 +740,15 @@ function NewsList({
|
|
|
742
740
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
743
741
|
"div",
|
|
744
742
|
{
|
|
745
|
-
className: "
|
|
743
|
+
className: "cnfy-news-card",
|
|
746
744
|
children: [
|
|
747
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "
|
|
748
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "
|
|
749
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "
|
|
745
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cnfy-news-card-content", children: [
|
|
746
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "cnfy-news-card-title", children: item.title }),
|
|
747
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cnfy-news-card-meta", children: [
|
|
750
748
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
751
749
|
"span",
|
|
752
750
|
{
|
|
753
|
-
className: "
|
|
751
|
+
className: "cnfy-news-badge",
|
|
754
752
|
style: {
|
|
755
753
|
backgroundColor: lightenColor(primaryColorState, 95),
|
|
756
754
|
color: primaryColor,
|
|
@@ -760,7 +758,7 @@ function NewsList({
|
|
|
760
758
|
}
|
|
761
759
|
),
|
|
762
760
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u2022" }),
|
|
763
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "
|
|
761
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "cnfy-news-card-category", children: item.category }),
|
|
764
762
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u2022" }),
|
|
765
763
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
766
764
|
dateFormatter.format(publishedDate),
|
|
@@ -769,12 +767,12 @@ function NewsList({
|
|
|
769
767
|
] })
|
|
770
768
|
] })
|
|
771
769
|
] }),
|
|
772
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "
|
|
770
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cnfy-news-card-actions", children: [
|
|
773
771
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
774
772
|
"button",
|
|
775
773
|
{
|
|
776
774
|
onClick: () => onView(item),
|
|
777
|
-
className: "
|
|
775
|
+
className: "cnfy-news-action-btn",
|
|
778
776
|
title: "View",
|
|
779
777
|
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.Eye, { size: 16 })
|
|
780
778
|
}
|
|
@@ -786,9 +784,8 @@ function NewsList({
|
|
|
786
784
|
title: item.title,
|
|
787
785
|
content: item.content || item.title,
|
|
788
786
|
id: item._id
|
|
789
|
-
// Include article ID
|
|
790
787
|
}),
|
|
791
|
-
className: "
|
|
788
|
+
className: "cnfy-news-action-btn",
|
|
792
789
|
title: "Recreate",
|
|
793
790
|
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.RefreshCcw, { size: 16 })
|
|
794
791
|
}
|
|
@@ -997,30 +994,30 @@ function ChatWindow({
|
|
|
997
994
|
});
|
|
998
995
|
return { blocks, metaKeywords };
|
|
999
996
|
}
|
|
1000
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "
|
|
1001
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "
|
|
997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cnfy-chat", children: [
|
|
998
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cnfy-chat-area", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cnfy-chat-scroll", children: [
|
|
1002
999
|
messages.map((msg) => {
|
|
1003
1000
|
var _a2;
|
|
1004
1001
|
const parsed = formatAIContent(msg.content);
|
|
1005
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "
|
|
1006
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "
|
|
1002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cnfy-msg", children: [
|
|
1003
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cnfy-msg-avatar-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1007
1004
|
"div",
|
|
1008
1005
|
{
|
|
1009
|
-
className: "
|
|
1006
|
+
className: "cnfy-msg-avatar",
|
|
1010
1007
|
style: {
|
|
1011
1008
|
backgroundColor: msg.role === "assistant" ? primaryColor : "#1f2937"
|
|
1012
1009
|
},
|
|
1013
1010
|
children: msg.role === "assistant" ? "AI" : "You"
|
|
1014
1011
|
}
|
|
1015
1012
|
) }),
|
|
1016
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "
|
|
1017
|
-
msg.role === "assistant" && parsed.blocks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "
|
|
1013
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cnfy-msg-body", children: [
|
|
1014
|
+
msg.role === "assistant" && parsed.blocks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cnfy-msg-copy-row", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1018
1015
|
"button",
|
|
1019
1016
|
{
|
|
1020
1017
|
onClick: () => handleCopy(parsed.blocks, msg.id),
|
|
1021
|
-
className: "
|
|
1018
|
+
className: "cnfy-copy-btn",
|
|
1022
1019
|
title: "Copy to clipboard",
|
|
1023
|
-
children: copiedId === msg.id ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Check, { size: 16, className: "
|
|
1020
|
+
children: copiedId === msg.id ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Check, { size: 16, className: "cnfy-copy-icon--copied" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Copy, { size: 16 })
|
|
1024
1021
|
}
|
|
1025
1022
|
) }),
|
|
1026
1023
|
parsed.blocks.map((block, idx) => {
|
|
@@ -1028,7 +1025,7 @@ function ChatWindow({
|
|
|
1028
1025
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1029
1026
|
"h1",
|
|
1030
1027
|
{
|
|
1031
|
-
className: "
|
|
1028
|
+
className: "cnfy-block-h1",
|
|
1032
1029
|
children: block.text
|
|
1033
1030
|
},
|
|
1034
1031
|
idx
|
|
@@ -1038,18 +1035,18 @@ function ChatWindow({
|
|
|
1038
1035
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1039
1036
|
"h2",
|
|
1040
1037
|
{
|
|
1041
|
-
className: "
|
|
1038
|
+
className: "cnfy-block-h2",
|
|
1042
1039
|
children: block.text
|
|
1043
1040
|
},
|
|
1044
1041
|
idx
|
|
1045
1042
|
);
|
|
1046
1043
|
}
|
|
1047
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "
|
|
1044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "cnfy-block-p", children: block.text }, idx);
|
|
1048
1045
|
}),
|
|
1049
|
-
parsed.metaKeywords.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "
|
|
1046
|
+
parsed.metaKeywords.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cnfy-msg-keywords", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cnfy-msg-keywords-list", children: parsed.metaKeywords.map((tag, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1050
1047
|
"span",
|
|
1051
1048
|
{
|
|
1052
|
-
className: "
|
|
1049
|
+
className: "cnfy-msg-keyword-tag",
|
|
1053
1050
|
children: [
|
|
1054
1051
|
"#",
|
|
1055
1052
|
tag
|
|
@@ -1057,13 +1054,13 @@ function ChatWindow({
|
|
|
1057
1054
|
},
|
|
1058
1055
|
i
|
|
1059
1056
|
)) }) }),
|
|
1060
|
-
msg.role === "assistant" && (analyzedData == null ? void 0 : analyzedData.messageId) === msg.id && analyzedData.options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "
|
|
1057
|
+
msg.role === "assistant" && (analyzedData == null ? void 0 : analyzedData.messageId) === msg.id && analyzedData.options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cnfy-action-options", children: analyzedData.options.map((option) => {
|
|
1061
1058
|
const IconComponent = ACTION_ICONS[option.id] || import_lucide_react4.FileText;
|
|
1062
1059
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1063
1060
|
"button",
|
|
1064
1061
|
{
|
|
1065
1062
|
onClick: () => onSelectAction == null ? void 0 : onSelectAction(option.id, analyzedData.url, analyzedData.content),
|
|
1066
|
-
className: "
|
|
1063
|
+
className: "cnfy-action-btn",
|
|
1067
1064
|
children: [
|
|
1068
1065
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconComponent, { size: 16 }),
|
|
1069
1066
|
option.name
|
|
@@ -1072,12 +1069,12 @@ function ChatWindow({
|
|
|
1072
1069
|
option.id
|
|
1073
1070
|
);
|
|
1074
1071
|
}) }),
|
|
1075
|
-
msg.role === "assistant" && parsed.blocks.length > 0 && !(analyzedData == null ? void 0 : analyzedData.messageId) && (!isStreaming || msg.id !== ((_a2 = messages[messages.length - 1]) == null ? void 0 : _a2.id)) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "
|
|
1072
|
+
msg.role === "assistant" && parsed.blocks.length > 0 && !(analyzedData == null ? void 0 : analyzedData.messageId) && (!isStreaming || msg.id !== ((_a2 = messages[messages.length - 1]) == null ? void 0 : _a2.id)) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cnfy-msg-actions", children: [
|
|
1076
1073
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1077
1074
|
"button",
|
|
1078
1075
|
{
|
|
1079
1076
|
onClick: () => handleEdit(parsed.blocks, parsed.metaKeywords, msg.id),
|
|
1080
|
-
className: "
|
|
1077
|
+
className: "cnfy-btn-edit",
|
|
1081
1078
|
children: [
|
|
1082
1079
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Edit3, { size: 16 }),
|
|
1083
1080
|
"Edit"
|
|
@@ -1088,7 +1085,7 @@ function ChatWindow({
|
|
|
1088
1085
|
"button",
|
|
1089
1086
|
{
|
|
1090
1087
|
onClick: () => handlePost(msg.content, parsed.metaKeywords),
|
|
1091
|
-
className: "
|
|
1088
|
+
className: "cnfy-btn-post",
|
|
1092
1089
|
style: { backgroundColor: primaryColor, color: "#fff" },
|
|
1093
1090
|
children: [
|
|
1094
1091
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Send, { size: 16 }),
|
|
@@ -1102,32 +1099,32 @@ function ChatWindow({
|
|
|
1102
1099
|
}),
|
|
1103
1100
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref: bottomRef })
|
|
1104
1101
|
] }) }),
|
|
1105
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "
|
|
1106
|
-
!showNewsPanel && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: dropdownRef, className: "
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cnfy-input-area", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cnfy-input-inner", children: [
|
|
1103
|
+
!showNewsPanel && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: dropdownRef, className: "cnfy-news-pulse-wrap", children: [
|
|
1107
1104
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1108
1105
|
"button",
|
|
1109
1106
|
{
|
|
1110
1107
|
onClick: handleOpenNewsDropdown,
|
|
1111
|
-
className: "
|
|
1108
|
+
className: "cnfy-news-pulse-btn cnfy-animate-pulse",
|
|
1112
1109
|
title: "Select from trending news",
|
|
1113
1110
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Zap, { size: 16 })
|
|
1114
1111
|
}
|
|
1115
1112
|
),
|
|
1116
|
-
showNewsDropdown && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "
|
|
1117
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "
|
|
1118
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "
|
|
1113
|
+
showNewsDropdown && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cnfy-news-dropdown", children: [
|
|
1114
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cnfy-news-dropdown-header", style: { backgroundColor: primaryColor, color: "#fff" }, children: [
|
|
1115
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "cnfy-news-dropdown-title", children: "Select News" }),
|
|
1119
1116
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1120
1117
|
"button",
|
|
1121
1118
|
{
|
|
1122
1119
|
onClick: () => setShowNewsDropdown(false),
|
|
1123
|
-
className: "
|
|
1120
|
+
className: "cnfy-news-dropdown-close",
|
|
1124
1121
|
style: { backgroundColor: primaryColor, color: "#fff" },
|
|
1125
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.X, { size: 14
|
|
1122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.X, { size: 14 })
|
|
1126
1123
|
}
|
|
1127
1124
|
)
|
|
1128
1125
|
] }),
|
|
1129
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "
|
|
1130
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "
|
|
1126
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cnfy-news-dropdown-source", children: [
|
|
1127
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cnfy-news-dropdown-select-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1131
1128
|
import_react_select.default,
|
|
1132
1129
|
{
|
|
1133
1130
|
options: [
|
|
@@ -1178,10 +1175,10 @@ function ChatWindow({
|
|
|
1178
1175
|
{
|
|
1179
1176
|
onClick: handleScrape,
|
|
1180
1177
|
disabled: scraping,
|
|
1181
|
-
className: "
|
|
1178
|
+
className: "cnfy-scrape-btn",
|
|
1182
1179
|
title: "Fetch latest news",
|
|
1183
1180
|
children: [
|
|
1184
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.RefreshCcw, { size: 14, className: scraping ? "animate-spin" : "" }),
|
|
1181
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.RefreshCcw, { size: 14, className: scraping ? "cnfy-animate-spin" : "" }),
|
|
1185
1182
|
scraping ? "Scraping..." : "Scrape"
|
|
1186
1183
|
]
|
|
1187
1184
|
}
|
|
@@ -1191,17 +1188,17 @@ function ChatWindow({
|
|
|
1191
1188
|
{
|
|
1192
1189
|
onClick: () => fetchNews(null),
|
|
1193
1190
|
disabled: loadingNews,
|
|
1194
|
-
className: "
|
|
1191
|
+
className: "cnfy-refresh-btn",
|
|
1195
1192
|
children: [
|
|
1196
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.RefreshCcw, { size: 14, className: loadingNews ? "animate-spin" : "" }),
|
|
1193
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.RefreshCcw, { size: 14, className: loadingNews ? "cnfy-animate-spin" : "" }),
|
|
1197
1194
|
"Refresh"
|
|
1198
1195
|
]
|
|
1199
1196
|
}
|
|
1200
1197
|
)
|
|
1201
1198
|
] }),
|
|
1202
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "
|
|
1199
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cnfy-news-dropdown-list", children: loadingNews ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cnfy-news-dropdown-msg", children: "Loading news..." }) : trendingNews.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cnfy-news-dropdown-msg", children: [
|
|
1203
1200
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: "No news found." }),
|
|
1204
|
-
selectedSource && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "
|
|
1201
|
+
selectedSource && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "cnfy-news-dropdown-hint", children: 'Click "Scrape" to fetch latest news.' })
|
|
1205
1202
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1206
1203
|
NewsList,
|
|
1207
1204
|
{
|
|
@@ -1229,7 +1226,7 @@ function ChatWindow({
|
|
|
1229
1226
|
},
|
|
1230
1227
|
rows: 1,
|
|
1231
1228
|
placeholder: "Ask AI something\u2026",
|
|
1232
|
-
className: `
|
|
1229
|
+
className: `cnfy-chat-textarea ${!showNewsPanel ? "cnfy-chat-textarea--with-pulse" : ""}`,
|
|
1233
1230
|
style: { maxHeight: "200px", overflowY: input.split("\n").length > 6 ? "auto" : "hidden" }
|
|
1234
1231
|
}
|
|
1235
1232
|
),
|
|
@@ -1237,7 +1234,7 @@ function ChatWindow({
|
|
|
1237
1234
|
"button",
|
|
1238
1235
|
{
|
|
1239
1236
|
onClick: handleSend,
|
|
1240
|
-
className: "
|
|
1237
|
+
className: "cnfy-send-btn",
|
|
1241
1238
|
style: { backgroundColor: primaryColor, color: "#fff" },
|
|
1242
1239
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.SendHorizontal, { size: 18 })
|
|
1243
1240
|
}
|
|
@@ -1303,23 +1300,23 @@ function UserMenu({
|
|
|
1303
1300
|
import_react_hot_toast.default.error(err || "Logout failed");
|
|
1304
1301
|
}
|
|
1305
1302
|
}
|
|
1306
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ref, className: "
|
|
1303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ref, className: "cnfy-user-menu", children: [
|
|
1307
1304
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1308
1305
|
"button",
|
|
1309
1306
|
{
|
|
1310
1307
|
onClick: () => setOpen((v) => !v),
|
|
1311
|
-
className: "
|
|
1308
|
+
className: "cnfy-user-menu-trigger",
|
|
1312
1309
|
"aria-label": "Settings",
|
|
1313
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Settings, { size: 20, className: "
|
|
1310
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Settings, { size: 20, className: "cnfy-user-menu-trigger-icon" })
|
|
1314
1311
|
}
|
|
1315
1312
|
),
|
|
1316
|
-
open && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "
|
|
1313
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "cnfy-dropdown", children: [
|
|
1317
1314
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuItem, { icon: import_lucide_react5.User, label: "Account", onClick: () => go("/dashboard/account") }),
|
|
1318
1315
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuItem, { icon: import_lucide_react5.Settings, label: "Preferences", onClick: () => go("/dashboard/preferences") }),
|
|
1319
1316
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuItem, { icon: import_lucide_react5.Palette, label: "Appearance", onClick: () => go("/dashboard/appearance") }),
|
|
1320
1317
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuItem, { icon: import_lucide_react5.HelpCircle, label: "Settings", onClick: () => go("/dashboard/settings") }),
|
|
1321
1318
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuItem, { icon: import_lucide_react5.HelpCircle, label: "Help & Support", onClick: () => go("/dashboard/help") }),
|
|
1322
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "
|
|
1319
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "cnfy-dropdown-divider" }),
|
|
1323
1320
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1324
1321
|
MenuItem,
|
|
1325
1322
|
{
|
|
@@ -1342,7 +1339,7 @@ function MenuItem({
|
|
|
1342
1339
|
"button",
|
|
1343
1340
|
{
|
|
1344
1341
|
onClick,
|
|
1345
|
-
className: `
|
|
1342
|
+
className: `cnfy-menu-item ${danger ? "cnfy-menu-item--danger" : ""}`,
|
|
1346
1343
|
children: [
|
|
1347
1344
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: 16 }),
|
|
1348
1345
|
label
|
|
@@ -1358,19 +1355,19 @@ function HeaderBar({
|
|
|
1358
1355
|
onLogout
|
|
1359
1356
|
}) {
|
|
1360
1357
|
const { primaryColor, botName, logoUrl } = useTheme();
|
|
1361
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("header", { className: "
|
|
1362
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "
|
|
1363
|
-
logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: logoUrl, alt: "Logo", className: "
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("header", { className: "cnfy-header", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "cnfy-header-inner", children: [
|
|
1359
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "cnfy-header-left", onClick: () => onNavigate == null ? void 0 : onNavigate("/"), children: [
|
|
1360
|
+
logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: logoUrl, alt: "Logo", className: "cnfy-header-logo-img" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1364
1361
|
"div",
|
|
1365
1362
|
{
|
|
1366
|
-
className: "
|
|
1363
|
+
className: "cnfy-header-logo-fallback",
|
|
1367
1364
|
style: { backgroundColor: primaryColor },
|
|
1368
1365
|
children: botName.charAt(0).toUpperCase()
|
|
1369
1366
|
}
|
|
1370
1367
|
),
|
|
1371
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cnfy-header-brand", children: botName.toUpperCase() })
|
|
1372
1369
|
] }),
|
|
1373
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "cnfy-header-right", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(UserMenu, { onNavigate, onLogout }) })
|
|
1374
1371
|
] }) });
|
|
1375
1372
|
}
|
|
1376
1373
|
|
|
@@ -1415,12 +1412,12 @@ function TrendingNews({
|
|
|
1415
1412
|
window.open(item.sourceUrl || item.link, "_blank");
|
|
1416
1413
|
}
|
|
1417
1414
|
if (isLoading) {
|
|
1418
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "
|
|
1415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "cnfy-trending-msg", children: "Loading news..." });
|
|
1419
1416
|
}
|
|
1420
1417
|
if (!displayNews || displayNews.length === 0) {
|
|
1421
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "
|
|
1418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "cnfy-trending-msg cnfy-trending-msg--center", children: [
|
|
1422
1419
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "No news found for this source." }),
|
|
1423
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "
|
|
1420
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "cnfy-trending-hint", children: 'Click "Scrape" to fetch latest news.' })
|
|
1424
1421
|
] });
|
|
1425
1422
|
}
|
|
1426
1423
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -1520,8 +1517,8 @@ function SourceSelector({
|
|
|
1520
1517
|
const selectedOption = options.find(
|
|
1521
1518
|
(opt) => selectedSource === null ? opt.value === ALL_SOURCES_VALUE : opt.value === selectedSource
|
|
1522
1519
|
) || options[0];
|
|
1523
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "
|
|
1524
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "
|
|
1520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "cnfy-source-selector", children: [
|
|
1521
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "cnfy-source-selector-select-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1525
1522
|
import_react_select2.default,
|
|
1526
1523
|
{
|
|
1527
1524
|
options,
|
|
@@ -1566,10 +1563,10 @@ function SourceSelector({
|
|
|
1566
1563
|
{
|
|
1567
1564
|
onClick: handleScrape,
|
|
1568
1565
|
disabled: scraping,
|
|
1569
|
-
className: "
|
|
1566
|
+
className: "cnfy-scrape-btn",
|
|
1570
1567
|
title: "Fetch latest news",
|
|
1571
1568
|
children: [
|
|
1572
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react6.RefreshCcw, { size: 14, className: scraping ? "animate-spin" : "" }),
|
|
1569
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react6.RefreshCcw, { size: 14, className: scraping ? "cnfy-animate-spin" : "" }),
|
|
1573
1570
|
scraping ? "Scraping..." : "Scrape"
|
|
1574
1571
|
]
|
|
1575
1572
|
}
|
|
@@ -1579,9 +1576,9 @@ function SourceSelector({
|
|
|
1579
1576
|
{
|
|
1580
1577
|
onClick: () => fetchNews(null),
|
|
1581
1578
|
disabled: fetchingNews,
|
|
1582
|
-
className: "
|
|
1579
|
+
className: "cnfy-refresh-btn",
|
|
1583
1580
|
children: [
|
|
1584
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react6.RefreshCcw, { size: 14, className: fetchingNews ? "animate-spin" : "" }),
|
|
1581
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react6.RefreshCcw, { size: 14, className: fetchingNews ? "cnfy-animate-spin" : "" }),
|
|
1585
1582
|
"Refresh"
|
|
1586
1583
|
]
|
|
1587
1584
|
}
|
|
@@ -1879,7 +1876,7 @@ ${title}`
|
|
|
1879
1876
|
const lang = ((_a = preferences == null ? void 0 : preferences.localization) == null ? void 0 : _a.language) === "hi" ? "Hindi" : "English";
|
|
1880
1877
|
try {
|
|
1881
1878
|
await rewriteNewsStreamApi({
|
|
1882
|
-
article: content,
|
|
1879
|
+
article: content || "",
|
|
1883
1880
|
language: lang,
|
|
1884
1881
|
articleId: id,
|
|
1885
1882
|
tone: contentPrefs == null ? void 0 : contentPrefs.tone,
|
|
@@ -1924,7 +1921,7 @@ ${title}`
|
|
|
1924
1921
|
)
|
|
1925
1922
|
);
|
|
1926
1923
|
const result = await rewriteNewsApi({
|
|
1927
|
-
article: content,
|
|
1924
|
+
article: content || "",
|
|
1928
1925
|
language: lang,
|
|
1929
1926
|
articleId: id,
|
|
1930
1927
|
tone: contentPrefs == null ? void 0 : contentPrefs.tone,
|
|
@@ -2116,83 +2113,77 @@ ${optionsList}`
|
|
|
2116
2113
|
}
|
|
2117
2114
|
};
|
|
2118
2115
|
if (loading) {
|
|
2119
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "
|
|
2120
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Loader2, { className: "
|
|
2121
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "
|
|
2116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "cnfy-loading", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "cnfy-loading-inner", children: [
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.Loader2, { className: "cnfy-loading-spinner cnfy-animate-spin" }),
|
|
2118
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "cnfy-loading-text", children: "Loading..." })
|
|
2122
2119
|
] }) });
|
|
2123
2120
|
}
|
|
2124
|
-
return (
|
|
2125
|
-
|
|
2126
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className:
|
|
2127
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2131
|
-
SourceSelector,
|
|
2132
|
-
{
|
|
2133
|
-
selectedSource,
|
|
2134
|
-
onSourceChange: (value) => {
|
|
2135
|
-
console.log("Selected source:", value);
|
|
2136
|
-
setSelectedSource(value);
|
|
2137
|
-
},
|
|
2138
|
-
onNewsLoaded: handleNewsLoaded,
|
|
2139
|
-
onLoadingChange: handleLoadingChange
|
|
2140
|
-
}
|
|
2141
|
-
) }),
|
|
2142
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2143
|
-
TrendingNews,
|
|
2144
|
-
{
|
|
2145
|
-
onRecreate: handleRecreate,
|
|
2146
|
-
news,
|
|
2147
|
-
isLoading: newsLoading
|
|
2148
|
-
}
|
|
2149
|
-
)
|
|
2150
|
-
] }),
|
|
2151
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2152
|
-
"section",
|
|
2121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "cnfy-root", children: [
|
|
2122
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(HeaderBar, { onNavigate, onLogout }),
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: `cnfy-main ${showNewsPanel ? "cnfy-main--with-news" : ""}`, children: [
|
|
2124
|
+
showNewsPanel && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("aside", { className: "cnfy-sidebar", children: [
|
|
2125
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2126
|
+
SourceSelector,
|
|
2153
2127
|
{
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
{
|
|
2170
|
-
messages,
|
|
2171
|
-
onSend: handleSendMessage,
|
|
2172
|
-
onSelectNews: handleRecreate,
|
|
2173
|
-
isStreaming,
|
|
2174
|
-
analyzedData,
|
|
2175
|
-
onSelectAction: handleSelectAction
|
|
2176
|
-
}
|
|
2177
|
-
) }),
|
|
2178
|
-
!messages.length && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-center text-gray-400 text-sm px-4", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
2179
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "font-medium", children: "AI News Assistant" }),
|
|
2180
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "mt-1", children: "Select a news article or type a message to begin" })
|
|
2181
|
-
] }) })
|
|
2182
|
-
]
|
|
2128
|
+
selectedSource,
|
|
2129
|
+
onSourceChange: (value) => {
|
|
2130
|
+
console.log("Selected source:", value);
|
|
2131
|
+
setSelectedSource(value);
|
|
2132
|
+
},
|
|
2133
|
+
onNewsLoaded: handleNewsLoaded,
|
|
2134
|
+
onLoadingChange: handleLoadingChange
|
|
2135
|
+
}
|
|
2136
|
+
) }),
|
|
2137
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2138
|
+
TrendingNews,
|
|
2139
|
+
{
|
|
2140
|
+
onRecreate: handleRecreate,
|
|
2141
|
+
news,
|
|
2142
|
+
isLoading: newsLoading
|
|
2183
2143
|
}
|
|
2184
2144
|
)
|
|
2185
2145
|
] }),
|
|
2186
|
-
|
|
2187
|
-
|
|
2146
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2147
|
+
"section",
|
|
2188
2148
|
{
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2149
|
+
className: `cnfy-chat-section ${showNewsPanel ? "cnfy-chat-section--with-news" : "cnfy-chat-section--full"} ${showChatMobile ? "cnfy-chat-section--visible" : "cnfy-chat-section--hidden-mobile"}`,
|
|
2150
|
+
children: [
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "cnfy-mobile-back", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2152
|
+
"button",
|
|
2153
|
+
{
|
|
2154
|
+
onClick: () => setShowChatMobile(false),
|
|
2155
|
+
className: "cnfy-mobile-back-btn",
|
|
2156
|
+
children: "\u2190 Back to news"
|
|
2157
|
+
}
|
|
2158
|
+
) }),
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "cnfy-chat-inner", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2160
|
+
ChatWindow,
|
|
2161
|
+
{
|
|
2162
|
+
messages,
|
|
2163
|
+
onSend: handleSendMessage,
|
|
2164
|
+
onSelectNews: handleRecreate,
|
|
2165
|
+
isStreaming,
|
|
2166
|
+
analyzedData,
|
|
2167
|
+
onSelectAction: handleSelectAction
|
|
2168
|
+
}
|
|
2169
|
+
) }),
|
|
2170
|
+
!messages.length && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "cnfy-empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
2171
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "cnfy-empty-state-title", children: "AI News Assistant" }),
|
|
2172
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "cnfy-empty-state-subtitle", children: "Select a news article or type a message to begin" })
|
|
2173
|
+
] }) })
|
|
2174
|
+
]
|
|
2192
2175
|
}
|
|
2193
2176
|
)
|
|
2194
|
-
] })
|
|
2195
|
-
|
|
2177
|
+
] }),
|
|
2178
|
+
selectedArticle && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2179
|
+
ArticleModal,
|
|
2180
|
+
{
|
|
2181
|
+
article: selectedArticle,
|
|
2182
|
+
onClose: () => setSelectedArticle(null),
|
|
2183
|
+
onRecreate: handleRecreate
|
|
2184
|
+
}
|
|
2185
|
+
)
|
|
2186
|
+
] });
|
|
2196
2187
|
}
|
|
2197
2188
|
|
|
2198
2189
|
// src/index.tsx
|