@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.mjs
CHANGED
|
@@ -27,7 +27,7 @@ import axios from "axios";
|
|
|
27
27
|
|
|
28
28
|
// lib/config.ts
|
|
29
29
|
function getApiBaseUrl() {
|
|
30
|
-
return process.env.NEXT_PUBLIC_CONTENIFY_API_URL ||
|
|
30
|
+
return process.env.NEXT_PUBLIC_CONTENIFY_API_URL || "http://localhost:8080/api";
|
|
31
31
|
}
|
|
32
32
|
function getServerBaseUrl() {
|
|
33
33
|
const apiUrl = getApiBaseUrl();
|
|
@@ -178,31 +178,31 @@ function ArticleModal({
|
|
|
178
178
|
onClose,
|
|
179
179
|
onRecreate
|
|
180
180
|
}) {
|
|
181
|
-
return /* @__PURE__ */ jsx2("div", { className: "
|
|
182
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
181
|
+
return /* @__PURE__ */ jsx2("div", { className: "cnfy-article-modal-overlay", children: /* @__PURE__ */ jsxs("div", { className: "cnfy-article-modal", children: [
|
|
182
|
+
/* @__PURE__ */ jsxs("div", { className: "cnfy-article-modal-header", children: [
|
|
183
183
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
184
|
-
/* @__PURE__ */ jsx2("p", { className: "
|
|
185
|
-
/* @__PURE__ */ jsx2("h2", { className: "
|
|
184
|
+
/* @__PURE__ */ jsx2("p", { className: "cnfy-article-modal-source", children: "Source Article" }),
|
|
185
|
+
/* @__PURE__ */ jsx2("h2", { className: "cnfy-article-modal-title", children: article.title })
|
|
186
186
|
] }),
|
|
187
187
|
/* @__PURE__ */ jsx2(
|
|
188
188
|
"button",
|
|
189
189
|
{
|
|
190
190
|
onClick: onClose,
|
|
191
|
-
className: "
|
|
191
|
+
className: "cnfy-article-modal-close-btn",
|
|
192
192
|
"aria-label": "Close modal",
|
|
193
193
|
children: "\u2715"
|
|
194
194
|
}
|
|
195
195
|
)
|
|
196
196
|
] }),
|
|
197
|
-
/* @__PURE__ */ jsx2("div", { className: "
|
|
198
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
199
|
-
/* @__PURE__ */ jsx2("span", { className: "
|
|
200
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
197
|
+
/* @__PURE__ */ jsx2("div", { className: "cnfy-article-modal-body", children: /* @__PURE__ */ jsx2("div", { className: "cnfy-article-modal-content", children: article.content }) }),
|
|
198
|
+
/* @__PURE__ */ jsxs("div", { className: "cnfy-article-modal-footer", children: [
|
|
199
|
+
/* @__PURE__ */ jsx2("span", { className: "cnfy-article-modal-footer-text", children: "This content will be recreated using AI" }),
|
|
200
|
+
/* @__PURE__ */ jsxs("div", { className: "cnfy-article-modal-footer-actions", children: [
|
|
201
201
|
/* @__PURE__ */ jsx2(
|
|
202
202
|
"button",
|
|
203
203
|
{
|
|
204
204
|
onClick: onClose,
|
|
205
|
-
className: "
|
|
205
|
+
className: "cnfy-btn-cancel",
|
|
206
206
|
children: "Cancel"
|
|
207
207
|
}
|
|
208
208
|
),
|
|
@@ -213,9 +213,8 @@ function ArticleModal({
|
|
|
213
213
|
title: article.title,
|
|
214
214
|
content: article.content,
|
|
215
215
|
id: article._id
|
|
216
|
-
// Include article ID when available
|
|
217
216
|
}),
|
|
218
|
-
className: "
|
|
217
|
+
className: "cnfy-btn-recreate",
|
|
219
218
|
children: "Recreate Article"
|
|
220
219
|
}
|
|
221
220
|
)
|
|
@@ -297,7 +296,7 @@ function RichTextEditor({
|
|
|
297
296
|
content,
|
|
298
297
|
editorProps: {
|
|
299
298
|
attributes: {
|
|
300
|
-
class: "
|
|
299
|
+
class: "ProseMirror"
|
|
301
300
|
}
|
|
302
301
|
},
|
|
303
302
|
onUpdate: ({ editor: editor2 }) => {
|
|
@@ -310,10 +309,10 @@ function RichTextEditor({
|
|
|
310
309
|
}
|
|
311
310
|
}, [content, editor]);
|
|
312
311
|
if (!editor) {
|
|
313
|
-
return /* @__PURE__ */ jsx3("div", { className: "
|
|
312
|
+
return /* @__PURE__ */ jsx3("div", { className: "cnfy-editor-loading", children: "Loading editor..." });
|
|
314
313
|
}
|
|
315
|
-
return /* @__PURE__ */ jsxs2("div", { className: "
|
|
316
|
-
/* @__PURE__ */ jsxs2("div", { className: "
|
|
314
|
+
return /* @__PURE__ */ jsxs2("div", { className: "cnfy-editor", children: [
|
|
315
|
+
/* @__PURE__ */ jsxs2("div", { className: "cnfy-toolbar", children: [
|
|
317
316
|
/* @__PURE__ */ jsx3(
|
|
318
317
|
ToolbarButton,
|
|
319
318
|
{
|
|
@@ -341,7 +340,7 @@ function RichTextEditor({
|
|
|
341
340
|
children: /* @__PURE__ */ jsx3(Pilcrow, { size: 18 })
|
|
342
341
|
}
|
|
343
342
|
),
|
|
344
|
-
/* @__PURE__ */ jsx3("div", { className: "
|
|
343
|
+
/* @__PURE__ */ jsx3("div", { className: "cnfy-toolbar-divider" }),
|
|
345
344
|
/* @__PURE__ */ jsx3(
|
|
346
345
|
ToolbarButton,
|
|
347
346
|
{
|
|
@@ -360,7 +359,7 @@ function RichTextEditor({
|
|
|
360
359
|
children: /* @__PURE__ */ jsx3(Italic, { size: 18 })
|
|
361
360
|
}
|
|
362
361
|
),
|
|
363
|
-
/* @__PURE__ */ jsx3("div", { className: "
|
|
362
|
+
/* @__PURE__ */ jsx3("div", { className: "cnfy-toolbar-divider" }),
|
|
364
363
|
/* @__PURE__ */ jsx3(
|
|
365
364
|
ToolbarButton,
|
|
366
365
|
{
|
|
@@ -379,7 +378,7 @@ function RichTextEditor({
|
|
|
379
378
|
children: /* @__PURE__ */ jsx3(ListOrdered, { size: 18 })
|
|
380
379
|
}
|
|
381
380
|
),
|
|
382
|
-
/* @__PURE__ */ jsx3("div", { className: "
|
|
381
|
+
/* @__PURE__ */ jsx3("div", { className: "cnfy-toolbar-divider" }),
|
|
383
382
|
/* @__PURE__ */ jsx3(
|
|
384
383
|
ToolbarButton,
|
|
385
384
|
{
|
|
@@ -399,7 +398,7 @@ function RichTextEditor({
|
|
|
399
398
|
}
|
|
400
399
|
)
|
|
401
400
|
] }),
|
|
402
|
-
/* @__PURE__ */ jsx3(EditorContent, { editor, className: "
|
|
401
|
+
/* @__PURE__ */ jsx3(EditorContent, { editor, className: "cnfy-editor-content" })
|
|
403
402
|
] });
|
|
404
403
|
}
|
|
405
404
|
function ToolbarButton({
|
|
@@ -415,7 +414,7 @@ function ToolbarButton({
|
|
|
415
414
|
onClick,
|
|
416
415
|
disabled,
|
|
417
416
|
title,
|
|
418
|
-
className: `
|
|
417
|
+
className: `cnfy-toolbar-btn ${isActive ? "cnfy-toolbar-btn--active" : ""} ${disabled ? "cnfy-toolbar-btn--disabled" : ""}`,
|
|
419
418
|
children
|
|
420
419
|
}
|
|
421
420
|
);
|
|
@@ -499,29 +498,29 @@ function EditModal({
|
|
|
499
498
|
}
|
|
500
499
|
};
|
|
501
500
|
if (!isOpen) return null;
|
|
502
|
-
return /* @__PURE__ */ jsxs3("div", { className: "
|
|
501
|
+
return /* @__PURE__ */ jsxs3("div", { className: "cnfy-edit-modal-overlay", children: [
|
|
503
502
|
/* @__PURE__ */ jsx4(
|
|
504
503
|
"div",
|
|
505
504
|
{
|
|
506
|
-
className: "
|
|
505
|
+
className: "cnfy-edit-modal-backdrop",
|
|
507
506
|
onClick: onClose
|
|
508
507
|
}
|
|
509
508
|
),
|
|
510
|
-
/* @__PURE__ */ jsxs3("div", { className: "
|
|
511
|
-
/* @__PURE__ */ jsxs3("div", { className: "
|
|
512
|
-
/* @__PURE__ */ jsx4("h2", { className: "
|
|
509
|
+
/* @__PURE__ */ jsxs3("div", { className: "cnfy-edit-modal", children: [
|
|
510
|
+
/* @__PURE__ */ jsxs3("div", { className: "cnfy-edit-modal-header", children: [
|
|
511
|
+
/* @__PURE__ */ jsx4("h2", { className: "cnfy-edit-modal-title", children: "Edit Article" }),
|
|
513
512
|
/* @__PURE__ */ jsx4(
|
|
514
513
|
"button",
|
|
515
514
|
{
|
|
516
515
|
onClick: onClose,
|
|
517
|
-
className: "
|
|
518
|
-
children: /* @__PURE__ */ jsx4(X, { size: 20, className: "
|
|
516
|
+
className: "cnfy-edit-modal-close-btn",
|
|
517
|
+
children: /* @__PURE__ */ jsx4(X, { size: 20, className: "cnfy-edit-modal-close-icon" })
|
|
519
518
|
}
|
|
520
519
|
)
|
|
521
520
|
] }),
|
|
522
|
-
/* @__PURE__ */ jsxs3("div", { className: "
|
|
521
|
+
/* @__PURE__ */ jsxs3("div", { className: "cnfy-edit-modal-body", children: [
|
|
523
522
|
/* @__PURE__ */ jsxs3("div", { children: [
|
|
524
|
-
/* @__PURE__ */ jsx4("label", { className: "
|
|
523
|
+
/* @__PURE__ */ jsx4("label", { className: "cnfy-edit-label", children: "Article Content" }),
|
|
525
524
|
/* @__PURE__ */ jsx4(
|
|
526
525
|
RichTextEditor,
|
|
527
526
|
{
|
|
@@ -532,11 +531,11 @@ function EditModal({
|
|
|
532
531
|
)
|
|
533
532
|
] }),
|
|
534
533
|
/* @__PURE__ */ jsxs3("div", { children: [
|
|
535
|
-
/* @__PURE__ */ jsx4("label", { className: "
|
|
536
|
-
/* @__PURE__ */ jsx4("div", { className: "
|
|
534
|
+
/* @__PURE__ */ jsx4("label", { className: "cnfy-edit-label", children: "Meta Keywords" }),
|
|
535
|
+
/* @__PURE__ */ jsx4("div", { className: "cnfy-keyword-list", children: keywords.map((keyword, index) => /* @__PURE__ */ jsxs3(
|
|
537
536
|
"span",
|
|
538
537
|
{
|
|
539
|
-
className: "
|
|
538
|
+
className: "cnfy-keyword-tag",
|
|
540
539
|
children: [
|
|
541
540
|
"#",
|
|
542
541
|
keyword,
|
|
@@ -544,7 +543,7 @@ function EditModal({
|
|
|
544
543
|
"button",
|
|
545
544
|
{
|
|
546
545
|
onClick: () => handleRemoveKeyword(index),
|
|
547
|
-
className: "
|
|
546
|
+
className: "cnfy-keyword-remove-btn",
|
|
548
547
|
children: /* @__PURE__ */ jsx4(X, { size: 14 })
|
|
549
548
|
}
|
|
550
549
|
)
|
|
@@ -552,7 +551,7 @@ function EditModal({
|
|
|
552
551
|
},
|
|
553
552
|
index
|
|
554
553
|
)) }),
|
|
555
|
-
/* @__PURE__ */ jsxs3("div", { className: "
|
|
554
|
+
/* @__PURE__ */ jsxs3("div", { className: "cnfy-keyword-input-row", children: [
|
|
556
555
|
/* @__PURE__ */ jsx4(
|
|
557
556
|
"input",
|
|
558
557
|
{
|
|
@@ -561,26 +560,26 @@ function EditModal({
|
|
|
561
560
|
onChange: (e) => setNewKeyword(e.target.value),
|
|
562
561
|
onKeyDown: handleKeyDown,
|
|
563
562
|
placeholder: "Add a keyword...",
|
|
564
|
-
className: "
|
|
563
|
+
className: "cnfy-keyword-input"
|
|
565
564
|
}
|
|
566
565
|
),
|
|
567
566
|
/* @__PURE__ */ jsx4(
|
|
568
567
|
"button",
|
|
569
568
|
{
|
|
570
569
|
onClick: handleAddKeyword,
|
|
571
|
-
className: "
|
|
570
|
+
className: "cnfy-btn-add-keyword",
|
|
572
571
|
children: "Add"
|
|
573
572
|
}
|
|
574
573
|
)
|
|
575
574
|
] })
|
|
576
575
|
] })
|
|
577
576
|
] }),
|
|
578
|
-
/* @__PURE__ */ jsxs3("div", { className: "
|
|
577
|
+
/* @__PURE__ */ jsxs3("div", { className: "cnfy-edit-modal-footer", children: [
|
|
579
578
|
/* @__PURE__ */ jsx4(
|
|
580
579
|
"button",
|
|
581
580
|
{
|
|
582
581
|
onClick: onClose,
|
|
583
|
-
className: "
|
|
582
|
+
className: "cnfy-btn-footer-cancel",
|
|
584
583
|
children: "Cancel"
|
|
585
584
|
}
|
|
586
585
|
),
|
|
@@ -588,7 +587,7 @@ function EditModal({
|
|
|
588
587
|
"button",
|
|
589
588
|
{
|
|
590
589
|
onClick: () => onSaveDraft(content, keywords),
|
|
591
|
-
className: "
|
|
590
|
+
className: "cnfy-btn-save-draft",
|
|
592
591
|
children: "Save Draft"
|
|
593
592
|
}
|
|
594
593
|
),
|
|
@@ -596,7 +595,7 @@ function EditModal({
|
|
|
596
595
|
"button",
|
|
597
596
|
{
|
|
598
597
|
onClick: () => onPost(content, keywords),
|
|
599
|
-
className: "
|
|
598
|
+
className: "cnfy-btn-post-article",
|
|
600
599
|
style: { backgroundColor: primaryColor, color: "#fff" },
|
|
601
600
|
children: "Post"
|
|
602
601
|
}
|
|
@@ -651,22 +650,22 @@ function NewsList({
|
|
|
651
650
|
b = Math.round(b + (255 - b) * (percent / 100));
|
|
652
651
|
return `rgb(${r}, ${g}, ${b})`;
|
|
653
652
|
};
|
|
654
|
-
return /* @__PURE__ */ jsx5("div", { className: "
|
|
653
|
+
return /* @__PURE__ */ jsx5("div", { className: "cnfy-news-list", children: news.flatMap((item) => {
|
|
655
654
|
const publishedDate = new Date(item.publishedAt);
|
|
656
655
|
const links = extractLinksFromContent(item.content);
|
|
657
656
|
if (links.length > 0) {
|
|
658
657
|
return links.map((link, idx) => /* @__PURE__ */ jsxs4(
|
|
659
658
|
"div",
|
|
660
659
|
{
|
|
661
|
-
className: "
|
|
660
|
+
className: "cnfy-news-card",
|
|
662
661
|
children: [
|
|
663
|
-
/* @__PURE__ */ jsxs4("div", { className: "
|
|
664
|
-
/* @__PURE__ */ jsx5("p", { className: "
|
|
665
|
-
/* @__PURE__ */ jsxs4("div", { className: "
|
|
662
|
+
/* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-content", children: [
|
|
663
|
+
/* @__PURE__ */ jsx5("p", { className: "cnfy-news-card-title", children: link.title }),
|
|
664
|
+
/* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-meta", children: [
|
|
666
665
|
/* @__PURE__ */ jsx5(
|
|
667
666
|
"span",
|
|
668
667
|
{
|
|
669
|
-
className: "
|
|
668
|
+
className: "cnfy-news-badge",
|
|
670
669
|
style: {
|
|
671
670
|
backgroundColor: lightenColor(primaryColorState, 95),
|
|
672
671
|
color: primaryColor,
|
|
@@ -676,7 +675,7 @@ function NewsList({
|
|
|
676
675
|
}
|
|
677
676
|
),
|
|
678
677
|
/* @__PURE__ */ jsx5("span", { children: "\u2022" }),
|
|
679
|
-
/* @__PURE__ */ jsx5("span", { className: "
|
|
678
|
+
/* @__PURE__ */ jsx5("span", { className: "cnfy-news-card-category", children: item.category }),
|
|
680
679
|
/* @__PURE__ */ jsx5("span", { children: "\u2022" }),
|
|
681
680
|
/* @__PURE__ */ jsxs4("span", { children: [
|
|
682
681
|
dateFormatter.format(publishedDate),
|
|
@@ -685,12 +684,12 @@ function NewsList({
|
|
|
685
684
|
] })
|
|
686
685
|
] })
|
|
687
686
|
] }),
|
|
688
|
-
/* @__PURE__ */ jsxs4("div", { className: "
|
|
687
|
+
/* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-actions", children: [
|
|
689
688
|
/* @__PURE__ */ jsx5(
|
|
690
689
|
"button",
|
|
691
690
|
{
|
|
692
691
|
onClick: () => window.open(link.url, "_blank"),
|
|
693
|
-
className: "
|
|
692
|
+
className: "cnfy-news-action-btn",
|
|
694
693
|
title: "View",
|
|
695
694
|
children: /* @__PURE__ */ jsx5(Eye, { size: 16 })
|
|
696
695
|
}
|
|
@@ -702,9 +701,8 @@ function NewsList({
|
|
|
702
701
|
title: link.title,
|
|
703
702
|
content: link.title,
|
|
704
703
|
id: item._id
|
|
705
|
-
// Include article ID
|
|
706
704
|
}),
|
|
707
|
-
className: "
|
|
705
|
+
className: "cnfy-news-action-btn",
|
|
708
706
|
title: "Recreate",
|
|
709
707
|
children: /* @__PURE__ */ jsx5(RefreshCcw, { size: 16 })
|
|
710
708
|
}
|
|
@@ -718,15 +716,15 @@ function NewsList({
|
|
|
718
716
|
return /* @__PURE__ */ jsxs4(
|
|
719
717
|
"div",
|
|
720
718
|
{
|
|
721
|
-
className: "
|
|
719
|
+
className: "cnfy-news-card",
|
|
722
720
|
children: [
|
|
723
|
-
/* @__PURE__ */ jsxs4("div", { className: "
|
|
724
|
-
/* @__PURE__ */ jsx5("p", { className: "
|
|
725
|
-
/* @__PURE__ */ jsxs4("div", { className: "
|
|
721
|
+
/* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-content", children: [
|
|
722
|
+
/* @__PURE__ */ jsx5("p", { className: "cnfy-news-card-title", children: item.title }),
|
|
723
|
+
/* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-meta", children: [
|
|
726
724
|
/* @__PURE__ */ jsx5(
|
|
727
725
|
"span",
|
|
728
726
|
{
|
|
729
|
-
className: "
|
|
727
|
+
className: "cnfy-news-badge",
|
|
730
728
|
style: {
|
|
731
729
|
backgroundColor: lightenColor(primaryColorState, 95),
|
|
732
730
|
color: primaryColor,
|
|
@@ -736,7 +734,7 @@ function NewsList({
|
|
|
736
734
|
}
|
|
737
735
|
),
|
|
738
736
|
/* @__PURE__ */ jsx5("span", { children: "\u2022" }),
|
|
739
|
-
/* @__PURE__ */ jsx5("span", { className: "
|
|
737
|
+
/* @__PURE__ */ jsx5("span", { className: "cnfy-news-card-category", children: item.category }),
|
|
740
738
|
/* @__PURE__ */ jsx5("span", { children: "\u2022" }),
|
|
741
739
|
/* @__PURE__ */ jsxs4("span", { children: [
|
|
742
740
|
dateFormatter.format(publishedDate),
|
|
@@ -745,12 +743,12 @@ function NewsList({
|
|
|
745
743
|
] })
|
|
746
744
|
] })
|
|
747
745
|
] }),
|
|
748
|
-
/* @__PURE__ */ jsxs4("div", { className: "
|
|
746
|
+
/* @__PURE__ */ jsxs4("div", { className: "cnfy-news-card-actions", children: [
|
|
749
747
|
/* @__PURE__ */ jsx5(
|
|
750
748
|
"button",
|
|
751
749
|
{
|
|
752
750
|
onClick: () => onView(item),
|
|
753
|
-
className: "
|
|
751
|
+
className: "cnfy-news-action-btn",
|
|
754
752
|
title: "View",
|
|
755
753
|
children: /* @__PURE__ */ jsx5(Eye, { size: 16 })
|
|
756
754
|
}
|
|
@@ -762,9 +760,8 @@ function NewsList({
|
|
|
762
760
|
title: item.title,
|
|
763
761
|
content: item.content || item.title,
|
|
764
762
|
id: item._id
|
|
765
|
-
// Include article ID
|
|
766
763
|
}),
|
|
767
|
-
className: "
|
|
764
|
+
className: "cnfy-news-action-btn",
|
|
768
765
|
title: "Recreate",
|
|
769
766
|
children: /* @__PURE__ */ jsx5(RefreshCcw, { size: 16 })
|
|
770
767
|
}
|
|
@@ -973,30 +970,30 @@ function ChatWindow({
|
|
|
973
970
|
});
|
|
974
971
|
return { blocks, metaKeywords };
|
|
975
972
|
}
|
|
976
|
-
return /* @__PURE__ */ jsxs5("div", { className: "
|
|
977
|
-
/* @__PURE__ */ jsx6("div", { className: "
|
|
973
|
+
return /* @__PURE__ */ jsxs5("div", { className: "cnfy-chat", children: [
|
|
974
|
+
/* @__PURE__ */ jsx6("div", { className: "cnfy-chat-area", children: /* @__PURE__ */ jsxs5("div", { className: "cnfy-chat-scroll", children: [
|
|
978
975
|
messages.map((msg) => {
|
|
979
976
|
var _a2;
|
|
980
977
|
const parsed = formatAIContent(msg.content);
|
|
981
|
-
return /* @__PURE__ */ jsxs5("div", { className: "
|
|
982
|
-
/* @__PURE__ */ jsx6("div", { className: "
|
|
978
|
+
return /* @__PURE__ */ jsxs5("div", { className: "cnfy-msg", children: [
|
|
979
|
+
/* @__PURE__ */ jsx6("div", { className: "cnfy-msg-avatar-wrap", children: /* @__PURE__ */ jsx6(
|
|
983
980
|
"div",
|
|
984
981
|
{
|
|
985
|
-
className: "
|
|
982
|
+
className: "cnfy-msg-avatar",
|
|
986
983
|
style: {
|
|
987
984
|
backgroundColor: msg.role === "assistant" ? primaryColor : "#1f2937"
|
|
988
985
|
},
|
|
989
986
|
children: msg.role === "assistant" ? "AI" : "You"
|
|
990
987
|
}
|
|
991
988
|
) }),
|
|
992
|
-
/* @__PURE__ */ jsxs5("div", { className: "
|
|
993
|
-
msg.role === "assistant" && parsed.blocks.length > 0 && /* @__PURE__ */ jsx6("div", { className: "
|
|
989
|
+
/* @__PURE__ */ jsxs5("div", { className: "cnfy-msg-body", children: [
|
|
990
|
+
msg.role === "assistant" && parsed.blocks.length > 0 && /* @__PURE__ */ jsx6("div", { className: "cnfy-msg-copy-row", children: /* @__PURE__ */ jsx6(
|
|
994
991
|
"button",
|
|
995
992
|
{
|
|
996
993
|
onClick: () => handleCopy(parsed.blocks, msg.id),
|
|
997
|
-
className: "
|
|
994
|
+
className: "cnfy-copy-btn",
|
|
998
995
|
title: "Copy to clipboard",
|
|
999
|
-
children: copiedId === msg.id ? /* @__PURE__ */ jsx6(Check, { size: 16, className: "
|
|
996
|
+
children: copiedId === msg.id ? /* @__PURE__ */ jsx6(Check, { size: 16, className: "cnfy-copy-icon--copied" }) : /* @__PURE__ */ jsx6(Copy, { size: 16 })
|
|
1000
997
|
}
|
|
1001
998
|
) }),
|
|
1002
999
|
parsed.blocks.map((block, idx) => {
|
|
@@ -1004,7 +1001,7 @@ function ChatWindow({
|
|
|
1004
1001
|
return /* @__PURE__ */ jsx6(
|
|
1005
1002
|
"h1",
|
|
1006
1003
|
{
|
|
1007
|
-
className: "
|
|
1004
|
+
className: "cnfy-block-h1",
|
|
1008
1005
|
children: block.text
|
|
1009
1006
|
},
|
|
1010
1007
|
idx
|
|
@@ -1014,18 +1011,18 @@ function ChatWindow({
|
|
|
1014
1011
|
return /* @__PURE__ */ jsx6(
|
|
1015
1012
|
"h2",
|
|
1016
1013
|
{
|
|
1017
|
-
className: "
|
|
1014
|
+
className: "cnfy-block-h2",
|
|
1018
1015
|
children: block.text
|
|
1019
1016
|
},
|
|
1020
1017
|
idx
|
|
1021
1018
|
);
|
|
1022
1019
|
}
|
|
1023
|
-
return /* @__PURE__ */ jsx6("p", { className: "
|
|
1020
|
+
return /* @__PURE__ */ jsx6("p", { className: "cnfy-block-p", children: block.text }, idx);
|
|
1024
1021
|
}),
|
|
1025
|
-
parsed.metaKeywords.length > 0 && /* @__PURE__ */ jsx6("div", { className: "
|
|
1022
|
+
parsed.metaKeywords.length > 0 && /* @__PURE__ */ jsx6("div", { className: "cnfy-msg-keywords", children: /* @__PURE__ */ jsx6("div", { className: "cnfy-msg-keywords-list", children: parsed.metaKeywords.map((tag, i) => /* @__PURE__ */ jsxs5(
|
|
1026
1023
|
"span",
|
|
1027
1024
|
{
|
|
1028
|
-
className: "
|
|
1025
|
+
className: "cnfy-msg-keyword-tag",
|
|
1029
1026
|
children: [
|
|
1030
1027
|
"#",
|
|
1031
1028
|
tag
|
|
@@ -1033,13 +1030,13 @@ function ChatWindow({
|
|
|
1033
1030
|
},
|
|
1034
1031
|
i
|
|
1035
1032
|
)) }) }),
|
|
1036
|
-
msg.role === "assistant" && (analyzedData == null ? void 0 : analyzedData.messageId) === msg.id && analyzedData.options.length > 0 && /* @__PURE__ */ jsx6("div", { className: "
|
|
1033
|
+
msg.role === "assistant" && (analyzedData == null ? void 0 : analyzedData.messageId) === msg.id && analyzedData.options.length > 0 && /* @__PURE__ */ jsx6("div", { className: "cnfy-action-options", children: analyzedData.options.map((option) => {
|
|
1037
1034
|
const IconComponent = ACTION_ICONS[option.id] || FileText;
|
|
1038
1035
|
return /* @__PURE__ */ jsxs5(
|
|
1039
1036
|
"button",
|
|
1040
1037
|
{
|
|
1041
1038
|
onClick: () => onSelectAction == null ? void 0 : onSelectAction(option.id, analyzedData.url, analyzedData.content),
|
|
1042
|
-
className: "
|
|
1039
|
+
className: "cnfy-action-btn",
|
|
1043
1040
|
children: [
|
|
1044
1041
|
/* @__PURE__ */ jsx6(IconComponent, { size: 16 }),
|
|
1045
1042
|
option.name
|
|
@@ -1048,12 +1045,12 @@ function ChatWindow({
|
|
|
1048
1045
|
option.id
|
|
1049
1046
|
);
|
|
1050
1047
|
}) }),
|
|
1051
|
-
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__ */ jsxs5("div", { className: "
|
|
1048
|
+
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__ */ jsxs5("div", { className: "cnfy-msg-actions", children: [
|
|
1052
1049
|
/* @__PURE__ */ jsxs5(
|
|
1053
1050
|
"button",
|
|
1054
1051
|
{
|
|
1055
1052
|
onClick: () => handleEdit(parsed.blocks, parsed.metaKeywords, msg.id),
|
|
1056
|
-
className: "
|
|
1053
|
+
className: "cnfy-btn-edit",
|
|
1057
1054
|
children: [
|
|
1058
1055
|
/* @__PURE__ */ jsx6(Edit3, { size: 16 }),
|
|
1059
1056
|
"Edit"
|
|
@@ -1064,7 +1061,7 @@ function ChatWindow({
|
|
|
1064
1061
|
"button",
|
|
1065
1062
|
{
|
|
1066
1063
|
onClick: () => handlePost(msg.content, parsed.metaKeywords),
|
|
1067
|
-
className: "
|
|
1064
|
+
className: "cnfy-btn-post",
|
|
1068
1065
|
style: { backgroundColor: primaryColor, color: "#fff" },
|
|
1069
1066
|
children: [
|
|
1070
1067
|
/* @__PURE__ */ jsx6(Send, { size: 16 }),
|
|
@@ -1078,32 +1075,32 @@ function ChatWindow({
|
|
|
1078
1075
|
}),
|
|
1079
1076
|
/* @__PURE__ */ jsx6("div", { ref: bottomRef })
|
|
1080
1077
|
] }) }),
|
|
1081
|
-
/* @__PURE__ */ jsx6("div", { className: "
|
|
1082
|
-
!showNewsPanel && /* @__PURE__ */ jsxs5("div", { ref: dropdownRef, className: "
|
|
1078
|
+
/* @__PURE__ */ jsx6("div", { className: "cnfy-input-area", children: /* @__PURE__ */ jsxs5("div", { className: "cnfy-input-inner", children: [
|
|
1079
|
+
!showNewsPanel && /* @__PURE__ */ jsxs5("div", { ref: dropdownRef, className: "cnfy-news-pulse-wrap", children: [
|
|
1083
1080
|
/* @__PURE__ */ jsx6(
|
|
1084
1081
|
"button",
|
|
1085
1082
|
{
|
|
1086
1083
|
onClick: handleOpenNewsDropdown,
|
|
1087
|
-
className: "
|
|
1084
|
+
className: "cnfy-news-pulse-btn cnfy-animate-pulse",
|
|
1088
1085
|
title: "Select from trending news",
|
|
1089
1086
|
children: /* @__PURE__ */ jsx6(Zap, { size: 16 })
|
|
1090
1087
|
}
|
|
1091
1088
|
),
|
|
1092
|
-
showNewsDropdown && /* @__PURE__ */ jsxs5("div", { className: "
|
|
1093
|
-
/* @__PURE__ */ jsxs5("div", { className: "
|
|
1094
|
-
/* @__PURE__ */ jsx6("span", { className: "
|
|
1089
|
+
showNewsDropdown && /* @__PURE__ */ jsxs5("div", { className: "cnfy-news-dropdown", children: [
|
|
1090
|
+
/* @__PURE__ */ jsxs5("div", { className: "cnfy-news-dropdown-header", style: { backgroundColor: primaryColor, color: "#fff" }, children: [
|
|
1091
|
+
/* @__PURE__ */ jsx6("span", { className: "cnfy-news-dropdown-title", children: "Select News" }),
|
|
1095
1092
|
/* @__PURE__ */ jsx6(
|
|
1096
1093
|
"button",
|
|
1097
1094
|
{
|
|
1098
1095
|
onClick: () => setShowNewsDropdown(false),
|
|
1099
|
-
className: "
|
|
1096
|
+
className: "cnfy-news-dropdown-close",
|
|
1100
1097
|
style: { backgroundColor: primaryColor, color: "#fff" },
|
|
1101
|
-
children: /* @__PURE__ */ jsx6(X2, { size: 14
|
|
1098
|
+
children: /* @__PURE__ */ jsx6(X2, { size: 14 })
|
|
1102
1099
|
}
|
|
1103
1100
|
)
|
|
1104
1101
|
] }),
|
|
1105
|
-
/* @__PURE__ */ jsxs5("div", { className: "
|
|
1106
|
-
/* @__PURE__ */ jsx6("div", { className: "
|
|
1102
|
+
/* @__PURE__ */ jsxs5("div", { className: "cnfy-news-dropdown-source", children: [
|
|
1103
|
+
/* @__PURE__ */ jsx6("div", { className: "cnfy-news-dropdown-select-wrap", children: /* @__PURE__ */ jsx6(
|
|
1107
1104
|
Select,
|
|
1108
1105
|
{
|
|
1109
1106
|
options: [
|
|
@@ -1154,10 +1151,10 @@ function ChatWindow({
|
|
|
1154
1151
|
{
|
|
1155
1152
|
onClick: handleScrape,
|
|
1156
1153
|
disabled: scraping,
|
|
1157
|
-
className: "
|
|
1154
|
+
className: "cnfy-scrape-btn",
|
|
1158
1155
|
title: "Fetch latest news",
|
|
1159
1156
|
children: [
|
|
1160
|
-
/* @__PURE__ */ jsx6(RefreshCcw2, { size: 14, className: scraping ? "animate-spin" : "" }),
|
|
1157
|
+
/* @__PURE__ */ jsx6(RefreshCcw2, { size: 14, className: scraping ? "cnfy-animate-spin" : "" }),
|
|
1161
1158
|
scraping ? "Scraping..." : "Scrape"
|
|
1162
1159
|
]
|
|
1163
1160
|
}
|
|
@@ -1167,17 +1164,17 @@ function ChatWindow({
|
|
|
1167
1164
|
{
|
|
1168
1165
|
onClick: () => fetchNews(null),
|
|
1169
1166
|
disabled: loadingNews,
|
|
1170
|
-
className: "
|
|
1167
|
+
className: "cnfy-refresh-btn",
|
|
1171
1168
|
children: [
|
|
1172
|
-
/* @__PURE__ */ jsx6(RefreshCcw2, { size: 14, className: loadingNews ? "animate-spin" : "" }),
|
|
1169
|
+
/* @__PURE__ */ jsx6(RefreshCcw2, { size: 14, className: loadingNews ? "cnfy-animate-spin" : "" }),
|
|
1173
1170
|
"Refresh"
|
|
1174
1171
|
]
|
|
1175
1172
|
}
|
|
1176
1173
|
)
|
|
1177
1174
|
] }),
|
|
1178
|
-
/* @__PURE__ */ jsx6("div", { className: "
|
|
1175
|
+
/* @__PURE__ */ jsx6("div", { className: "cnfy-news-dropdown-list", children: loadingNews ? /* @__PURE__ */ jsx6("div", { className: "cnfy-news-dropdown-msg", children: "Loading news..." }) : trendingNews.length === 0 ? /* @__PURE__ */ jsxs5("div", { className: "cnfy-news-dropdown-msg", children: [
|
|
1179
1176
|
/* @__PURE__ */ jsx6("p", { children: "No news found." }),
|
|
1180
|
-
selectedSource && /* @__PURE__ */ jsx6("p", { className: "
|
|
1177
|
+
selectedSource && /* @__PURE__ */ jsx6("p", { className: "cnfy-news-dropdown-hint", children: 'Click "Scrape" to fetch latest news.' })
|
|
1181
1178
|
] }) : /* @__PURE__ */ jsx6(
|
|
1182
1179
|
NewsList,
|
|
1183
1180
|
{
|
|
@@ -1205,7 +1202,7 @@ function ChatWindow({
|
|
|
1205
1202
|
},
|
|
1206
1203
|
rows: 1,
|
|
1207
1204
|
placeholder: "Ask AI something\u2026",
|
|
1208
|
-
className: `
|
|
1205
|
+
className: `cnfy-chat-textarea ${!showNewsPanel ? "cnfy-chat-textarea--with-pulse" : ""}`,
|
|
1209
1206
|
style: { maxHeight: "200px", overflowY: input.split("\n").length > 6 ? "auto" : "hidden" }
|
|
1210
1207
|
}
|
|
1211
1208
|
),
|
|
@@ -1213,7 +1210,7 @@ function ChatWindow({
|
|
|
1213
1210
|
"button",
|
|
1214
1211
|
{
|
|
1215
1212
|
onClick: handleSend,
|
|
1216
|
-
className: "
|
|
1213
|
+
className: "cnfy-send-btn",
|
|
1217
1214
|
style: { backgroundColor: primaryColor, color: "#fff" },
|
|
1218
1215
|
children: /* @__PURE__ */ jsx6(SendHorizontal, { size: 18 })
|
|
1219
1216
|
}
|
|
@@ -1285,23 +1282,23 @@ function UserMenu({
|
|
|
1285
1282
|
toast.error(err || "Logout failed");
|
|
1286
1283
|
}
|
|
1287
1284
|
}
|
|
1288
|
-
return /* @__PURE__ */ jsxs6("div", { ref, className: "
|
|
1285
|
+
return /* @__PURE__ */ jsxs6("div", { ref, className: "cnfy-user-menu", children: [
|
|
1289
1286
|
/* @__PURE__ */ jsx7(
|
|
1290
1287
|
"button",
|
|
1291
1288
|
{
|
|
1292
1289
|
onClick: () => setOpen((v) => !v),
|
|
1293
|
-
className: "
|
|
1290
|
+
className: "cnfy-user-menu-trigger",
|
|
1294
1291
|
"aria-label": "Settings",
|
|
1295
|
-
children: /* @__PURE__ */ jsx7(Settings, { size: 20, className: "
|
|
1292
|
+
children: /* @__PURE__ */ jsx7(Settings, { size: 20, className: "cnfy-user-menu-trigger-icon" })
|
|
1296
1293
|
}
|
|
1297
1294
|
),
|
|
1298
|
-
open && /* @__PURE__ */ jsxs6("div", { className: "
|
|
1295
|
+
open && /* @__PURE__ */ jsxs6("div", { className: "cnfy-dropdown", children: [
|
|
1299
1296
|
/* @__PURE__ */ jsx7(MenuItem, { icon: User, label: "Account", onClick: () => go("/dashboard/account") }),
|
|
1300
1297
|
/* @__PURE__ */ jsx7(MenuItem, { icon: Settings, label: "Preferences", onClick: () => go("/dashboard/preferences") }),
|
|
1301
1298
|
/* @__PURE__ */ jsx7(MenuItem, { icon: Palette, label: "Appearance", onClick: () => go("/dashboard/appearance") }),
|
|
1302
1299
|
/* @__PURE__ */ jsx7(MenuItem, { icon: HelpCircle, label: "Settings", onClick: () => go("/dashboard/settings") }),
|
|
1303
1300
|
/* @__PURE__ */ jsx7(MenuItem, { icon: HelpCircle, label: "Help & Support", onClick: () => go("/dashboard/help") }),
|
|
1304
|
-
/* @__PURE__ */ jsx7("div", { className: "
|
|
1301
|
+
/* @__PURE__ */ jsx7("div", { className: "cnfy-dropdown-divider" }),
|
|
1305
1302
|
/* @__PURE__ */ jsx7(
|
|
1306
1303
|
MenuItem,
|
|
1307
1304
|
{
|
|
@@ -1324,7 +1321,7 @@ function MenuItem({
|
|
|
1324
1321
|
"button",
|
|
1325
1322
|
{
|
|
1326
1323
|
onClick,
|
|
1327
|
-
className: `
|
|
1324
|
+
className: `cnfy-menu-item ${danger ? "cnfy-menu-item--danger" : ""}`,
|
|
1328
1325
|
children: [
|
|
1329
1326
|
/* @__PURE__ */ jsx7(Icon, { size: 16 }),
|
|
1330
1327
|
label
|
|
@@ -1340,19 +1337,19 @@ function HeaderBar({
|
|
|
1340
1337
|
onLogout
|
|
1341
1338
|
}) {
|
|
1342
1339
|
const { primaryColor, botName, logoUrl } = useTheme();
|
|
1343
|
-
return /* @__PURE__ */ jsx8("header", { className: "
|
|
1344
|
-
/* @__PURE__ */ jsxs7("div", { className: "
|
|
1345
|
-
logoUrl ? /* @__PURE__ */ jsx8("img", { src: logoUrl, alt: "Logo", className: "
|
|
1340
|
+
return /* @__PURE__ */ jsx8("header", { className: "cnfy-header", children: /* @__PURE__ */ jsxs7("div", { className: "cnfy-header-inner", children: [
|
|
1341
|
+
/* @__PURE__ */ jsxs7("div", { className: "cnfy-header-left", onClick: () => onNavigate == null ? void 0 : onNavigate("/"), children: [
|
|
1342
|
+
logoUrl ? /* @__PURE__ */ jsx8("img", { src: logoUrl, alt: "Logo", className: "cnfy-header-logo-img" }) : /* @__PURE__ */ jsx8(
|
|
1346
1343
|
"div",
|
|
1347
1344
|
{
|
|
1348
|
-
className: "
|
|
1345
|
+
className: "cnfy-header-logo-fallback",
|
|
1349
1346
|
style: { backgroundColor: primaryColor },
|
|
1350
1347
|
children: botName.charAt(0).toUpperCase()
|
|
1351
1348
|
}
|
|
1352
1349
|
),
|
|
1353
|
-
/* @__PURE__ */ jsx8("span", { className: "
|
|
1350
|
+
/* @__PURE__ */ jsx8("span", { className: "cnfy-header-brand", children: botName.toUpperCase() })
|
|
1354
1351
|
] }),
|
|
1355
|
-
/* @__PURE__ */ jsx8("div", { className: "
|
|
1352
|
+
/* @__PURE__ */ jsx8("div", { className: "cnfy-header-right", children: /* @__PURE__ */ jsx8(UserMenu, { onNavigate, onLogout }) })
|
|
1356
1353
|
] }) });
|
|
1357
1354
|
}
|
|
1358
1355
|
|
|
@@ -1397,12 +1394,12 @@ function TrendingNews({
|
|
|
1397
1394
|
window.open(item.sourceUrl || item.link, "_blank");
|
|
1398
1395
|
}
|
|
1399
1396
|
if (isLoading) {
|
|
1400
|
-
return /* @__PURE__ */ jsx9("div", { className: "
|
|
1397
|
+
return /* @__PURE__ */ jsx9("div", { className: "cnfy-trending-msg", children: "Loading news..." });
|
|
1401
1398
|
}
|
|
1402
1399
|
if (!displayNews || displayNews.length === 0) {
|
|
1403
|
-
return /* @__PURE__ */ jsxs8("div", { className: "
|
|
1400
|
+
return /* @__PURE__ */ jsxs8("div", { className: "cnfy-trending-msg cnfy-trending-msg--center", children: [
|
|
1404
1401
|
/* @__PURE__ */ jsx9("p", { children: "No news found for this source." }),
|
|
1405
|
-
/* @__PURE__ */ jsx9("p", { className: "
|
|
1402
|
+
/* @__PURE__ */ jsx9("p", { className: "cnfy-trending-hint", children: 'Click "Scrape" to fetch latest news.' })
|
|
1406
1403
|
] });
|
|
1407
1404
|
}
|
|
1408
1405
|
return /* @__PURE__ */ jsx9(
|
|
@@ -1502,8 +1499,8 @@ function SourceSelector({
|
|
|
1502
1499
|
const selectedOption = options.find(
|
|
1503
1500
|
(opt) => selectedSource === null ? opt.value === ALL_SOURCES_VALUE : opt.value === selectedSource
|
|
1504
1501
|
) || options[0];
|
|
1505
|
-
return /* @__PURE__ */ jsxs9("div", { className: "
|
|
1506
|
-
/* @__PURE__ */ jsx10("div", { className: "
|
|
1502
|
+
return /* @__PURE__ */ jsxs9("div", { className: "cnfy-source-selector", children: [
|
|
1503
|
+
/* @__PURE__ */ jsx10("div", { className: "cnfy-source-selector-select-wrap", children: /* @__PURE__ */ jsx10(
|
|
1507
1504
|
Select2,
|
|
1508
1505
|
{
|
|
1509
1506
|
options,
|
|
@@ -1548,10 +1545,10 @@ function SourceSelector({
|
|
|
1548
1545
|
{
|
|
1549
1546
|
onClick: handleScrape,
|
|
1550
1547
|
disabled: scraping,
|
|
1551
|
-
className: "
|
|
1548
|
+
className: "cnfy-scrape-btn",
|
|
1552
1549
|
title: "Fetch latest news",
|
|
1553
1550
|
children: [
|
|
1554
|
-
/* @__PURE__ */ jsx10(RefreshCcw3, { size: 14, className: scraping ? "animate-spin" : "" }),
|
|
1551
|
+
/* @__PURE__ */ jsx10(RefreshCcw3, { size: 14, className: scraping ? "cnfy-animate-spin" : "" }),
|
|
1555
1552
|
scraping ? "Scraping..." : "Scrape"
|
|
1556
1553
|
]
|
|
1557
1554
|
}
|
|
@@ -1561,9 +1558,9 @@ function SourceSelector({
|
|
|
1561
1558
|
{
|
|
1562
1559
|
onClick: () => fetchNews(null),
|
|
1563
1560
|
disabled: fetchingNews,
|
|
1564
|
-
className: "
|
|
1561
|
+
className: "cnfy-refresh-btn",
|
|
1565
1562
|
children: [
|
|
1566
|
-
/* @__PURE__ */ jsx10(RefreshCcw3, { size: 14, className: fetchingNews ? "animate-spin" : "" }),
|
|
1563
|
+
/* @__PURE__ */ jsx10(RefreshCcw3, { size: 14, className: fetchingNews ? "cnfy-animate-spin" : "" }),
|
|
1567
1564
|
"Refresh"
|
|
1568
1565
|
]
|
|
1569
1566
|
}
|
|
@@ -1861,7 +1858,7 @@ ${title}`
|
|
|
1861
1858
|
const lang = ((_a = preferences == null ? void 0 : preferences.localization) == null ? void 0 : _a.language) === "hi" ? "Hindi" : "English";
|
|
1862
1859
|
try {
|
|
1863
1860
|
await rewriteNewsStreamApi({
|
|
1864
|
-
article: content,
|
|
1861
|
+
article: content || "",
|
|
1865
1862
|
language: lang,
|
|
1866
1863
|
articleId: id,
|
|
1867
1864
|
tone: contentPrefs == null ? void 0 : contentPrefs.tone,
|
|
@@ -1906,7 +1903,7 @@ ${title}`
|
|
|
1906
1903
|
)
|
|
1907
1904
|
);
|
|
1908
1905
|
const result = await rewriteNewsApi({
|
|
1909
|
-
article: content,
|
|
1906
|
+
article: content || "",
|
|
1910
1907
|
language: lang,
|
|
1911
1908
|
articleId: id,
|
|
1912
1909
|
tone: contentPrefs == null ? void 0 : contentPrefs.tone,
|
|
@@ -2098,83 +2095,77 @@ ${optionsList}`
|
|
|
2098
2095
|
}
|
|
2099
2096
|
};
|
|
2100
2097
|
if (loading) {
|
|
2101
|
-
return /* @__PURE__ */ jsx11("div", { className: "
|
|
2102
|
-
/* @__PURE__ */ jsx11(Loader2, { className: "
|
|
2103
|
-
/* @__PURE__ */ jsx11("p", { className: "
|
|
2098
|
+
return /* @__PURE__ */ jsx11("div", { className: "cnfy-loading", children: /* @__PURE__ */ jsxs10("div", { className: "cnfy-loading-inner", children: [
|
|
2099
|
+
/* @__PURE__ */ jsx11(Loader2, { className: "cnfy-loading-spinner cnfy-animate-spin" }),
|
|
2100
|
+
/* @__PURE__ */ jsx11("p", { className: "cnfy-loading-text", children: "Loading..." })
|
|
2104
2101
|
] }) });
|
|
2105
2102
|
}
|
|
2106
|
-
return (
|
|
2107
|
-
|
|
2108
|
-
/* @__PURE__ */ jsxs10("div", { className:
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
/* @__PURE__ */ jsx11("div", { className: "", children: /* @__PURE__ */ jsx11(
|
|
2113
|
-
SourceSelector,
|
|
2114
|
-
{
|
|
2115
|
-
selectedSource,
|
|
2116
|
-
onSourceChange: (value) => {
|
|
2117
|
-
console.log("Selected source:", value);
|
|
2118
|
-
setSelectedSource(value);
|
|
2119
|
-
},
|
|
2120
|
-
onNewsLoaded: handleNewsLoaded,
|
|
2121
|
-
onLoadingChange: handleLoadingChange
|
|
2122
|
-
}
|
|
2123
|
-
) }),
|
|
2124
|
-
/* @__PURE__ */ jsx11(
|
|
2125
|
-
TrendingNews,
|
|
2126
|
-
{
|
|
2127
|
-
onRecreate: handleRecreate,
|
|
2128
|
-
news,
|
|
2129
|
-
isLoading: newsLoading
|
|
2130
|
-
}
|
|
2131
|
-
)
|
|
2132
|
-
] }),
|
|
2133
|
-
/* @__PURE__ */ jsxs10(
|
|
2134
|
-
"section",
|
|
2103
|
+
return /* @__PURE__ */ jsxs10("div", { className: "cnfy-root", children: [
|
|
2104
|
+
/* @__PURE__ */ jsx11(HeaderBar, { onNavigate, onLogout }),
|
|
2105
|
+
/* @__PURE__ */ jsxs10("div", { className: `cnfy-main ${showNewsPanel ? "cnfy-main--with-news" : ""}`, children: [
|
|
2106
|
+
showNewsPanel && /* @__PURE__ */ jsxs10("aside", { className: "cnfy-sidebar", children: [
|
|
2107
|
+
/* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsx11(
|
|
2108
|
+
SourceSelector,
|
|
2135
2109
|
{
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
{
|
|
2152
|
-
messages,
|
|
2153
|
-
onSend: handleSendMessage,
|
|
2154
|
-
onSelectNews: handleRecreate,
|
|
2155
|
-
isStreaming,
|
|
2156
|
-
analyzedData,
|
|
2157
|
-
onSelectAction: handleSelectAction
|
|
2158
|
-
}
|
|
2159
|
-
) }),
|
|
2160
|
-
!messages.length && /* @__PURE__ */ jsx11("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-center text-gray-400 text-sm px-4", children: /* @__PURE__ */ jsxs10("div", { children: [
|
|
2161
|
-
/* @__PURE__ */ jsx11("p", { className: "font-medium", children: "AI News Assistant" }),
|
|
2162
|
-
/* @__PURE__ */ jsx11("p", { className: "mt-1", children: "Select a news article or type a message to begin" })
|
|
2163
|
-
] }) })
|
|
2164
|
-
]
|
|
2110
|
+
selectedSource,
|
|
2111
|
+
onSourceChange: (value) => {
|
|
2112
|
+
console.log("Selected source:", value);
|
|
2113
|
+
setSelectedSource(value);
|
|
2114
|
+
},
|
|
2115
|
+
onNewsLoaded: handleNewsLoaded,
|
|
2116
|
+
onLoadingChange: handleLoadingChange
|
|
2117
|
+
}
|
|
2118
|
+
) }),
|
|
2119
|
+
/* @__PURE__ */ jsx11(
|
|
2120
|
+
TrendingNews,
|
|
2121
|
+
{
|
|
2122
|
+
onRecreate: handleRecreate,
|
|
2123
|
+
news,
|
|
2124
|
+
isLoading: newsLoading
|
|
2165
2125
|
}
|
|
2166
2126
|
)
|
|
2167
2127
|
] }),
|
|
2168
|
-
|
|
2169
|
-
|
|
2128
|
+
/* @__PURE__ */ jsxs10(
|
|
2129
|
+
"section",
|
|
2170
2130
|
{
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2131
|
+
className: `cnfy-chat-section ${showNewsPanel ? "cnfy-chat-section--with-news" : "cnfy-chat-section--full"} ${showChatMobile ? "cnfy-chat-section--visible" : "cnfy-chat-section--hidden-mobile"}`,
|
|
2132
|
+
children: [
|
|
2133
|
+
/* @__PURE__ */ jsx11("div", { className: "cnfy-mobile-back", children: /* @__PURE__ */ jsx11(
|
|
2134
|
+
"button",
|
|
2135
|
+
{
|
|
2136
|
+
onClick: () => setShowChatMobile(false),
|
|
2137
|
+
className: "cnfy-mobile-back-btn",
|
|
2138
|
+
children: "\u2190 Back to news"
|
|
2139
|
+
}
|
|
2140
|
+
) }),
|
|
2141
|
+
/* @__PURE__ */ jsx11("div", { className: "cnfy-chat-inner", children: /* @__PURE__ */ jsx11(
|
|
2142
|
+
ChatWindow,
|
|
2143
|
+
{
|
|
2144
|
+
messages,
|
|
2145
|
+
onSend: handleSendMessage,
|
|
2146
|
+
onSelectNews: handleRecreate,
|
|
2147
|
+
isStreaming,
|
|
2148
|
+
analyzedData,
|
|
2149
|
+
onSelectAction: handleSelectAction
|
|
2150
|
+
}
|
|
2151
|
+
) }),
|
|
2152
|
+
!messages.length && /* @__PURE__ */ jsx11("div", { className: "cnfy-empty-state", children: /* @__PURE__ */ jsxs10("div", { children: [
|
|
2153
|
+
/* @__PURE__ */ jsx11("p", { className: "cnfy-empty-state-title", children: "AI News Assistant" }),
|
|
2154
|
+
/* @__PURE__ */ jsx11("p", { className: "cnfy-empty-state-subtitle", children: "Select a news article or type a message to begin" })
|
|
2155
|
+
] }) })
|
|
2156
|
+
]
|
|
2174
2157
|
}
|
|
2175
2158
|
)
|
|
2176
|
-
] })
|
|
2177
|
-
|
|
2159
|
+
] }),
|
|
2160
|
+
selectedArticle && /* @__PURE__ */ jsx11(
|
|
2161
|
+
ArticleModal,
|
|
2162
|
+
{
|
|
2163
|
+
article: selectedArticle,
|
|
2164
|
+
onClose: () => setSelectedArticle(null),
|
|
2165
|
+
onRecreate: handleRecreate
|
|
2166
|
+
}
|
|
2167
|
+
)
|
|
2168
|
+
] });
|
|
2178
2169
|
}
|
|
2179
2170
|
|
|
2180
2171
|
// src/index.tsx
|