@swisper.ai/web-chat-ui 0.5.0 → 0.5.1
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/components/html-viewer/html-viewer.stories.d.ts +6 -0
- package/dist/components/html-viewer/html-viewer.stories.d.ts.map +1 -1
- package/dist/components/html-viewer/utils.d.ts.map +1 -1
- package/dist/index.es.js +469 -468
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/html-viewer/__stories__/transactional-email.html +154 -0
- package/src/components/html-viewer/html-viewer.json +1 -0
- package/src/components/html-viewer/html-viewer.stories.tsx +27 -0
- package/src/components/html-viewer/utils.ts +8 -1
package/dist/index.es.js
CHANGED
|
@@ -2632,8 +2632,9 @@ var So = /* @__PURE__ */ new Set([
|
|
|
2632
2632
|
"width",
|
|
2633
2633
|
"height",
|
|
2634
2634
|
"noWrap"
|
|
2635
|
-
]), Co = Object.fromEntries(Object.entries(sn.attributes ?? {}).map(([e, t]) => [e, t.filter((e) => !So.has(Array.isArray(e) ? e[0] : e))])), wo = {
|
|
2635
|
+
]), Co = Object.fromEntries(Object.entries(sn.attributes ?? {}).map(([e, t]) => [e, t.filter((e) => !So.has(Array.isArray(e) ? e[0] : e))])), wo = ["style", "title"], To = {
|
|
2636
2636
|
...sn,
|
|
2637
|
+
strip: [...sn.strip ?? [], ...wo],
|
|
2637
2638
|
attributes: {
|
|
2638
2639
|
...Co,
|
|
2639
2640
|
img: [
|
|
@@ -2643,35 +2644,35 @@ var So = /* @__PURE__ */ new Set([
|
|
|
2643
2644
|
]
|
|
2644
2645
|
}
|
|
2645
2646
|
};
|
|
2646
|
-
function
|
|
2647
|
-
if (!e) return
|
|
2648
|
-
let t = { ...
|
|
2647
|
+
function Eo(e) {
|
|
2648
|
+
if (!e) return To;
|
|
2649
|
+
let t = { ...To.attributes };
|
|
2649
2650
|
for (let [n, r] of Object.entries(e.attributes ?? {})) t[n] = [...t[n] ?? [], ...r];
|
|
2650
|
-
let n = { ...
|
|
2651
|
+
let n = { ...To.protocols };
|
|
2651
2652
|
for (let [t, r] of Object.entries(e.protocols ?? {})) n[t] = [...n[t] ?? [], ...r ?? []];
|
|
2652
2653
|
return {
|
|
2653
|
-
...
|
|
2654
|
+
...To,
|
|
2654
2655
|
...e,
|
|
2655
|
-
tagNames: [...
|
|
2656
|
+
tagNames: [...To.tagNames ?? [], ...e.tagNames ?? []],
|
|
2656
2657
|
attributes: t,
|
|
2657
2658
|
protocols: n,
|
|
2658
2659
|
required: {
|
|
2659
|
-
...
|
|
2660
|
+
...To.required,
|
|
2660
2661
|
...e.required
|
|
2661
2662
|
}
|
|
2662
2663
|
};
|
|
2663
2664
|
}
|
|
2664
2665
|
//#endregion
|
|
2665
2666
|
//#region src/components/html-viewer/html-viewer.tsx
|
|
2666
|
-
function
|
|
2667
|
-
let i = B(() =>
|
|
2667
|
+
function Do({ html: e, className: t, components: n, sanitizeSchema: r }) {
|
|
2668
|
+
let i = B(() => Eo(r), [r]), a = B(() => un().use(ln, { fragment: !0 }).use(on, i), [i]), o = B(() => {
|
|
2668
2669
|
let t = a.runSync(a.parse(e));
|
|
2669
2670
|
return cn(t, {
|
|
2670
2671
|
Fragment: we,
|
|
2671
2672
|
jsx: U,
|
|
2672
2673
|
jsxs: W,
|
|
2673
2674
|
components: {
|
|
2674
|
-
...
|
|
2675
|
+
...zo,
|
|
2675
2676
|
...n
|
|
2676
2677
|
}
|
|
2677
2678
|
});
|
|
@@ -2687,108 +2688,108 @@ function Eo({ html: e, className: t, components: n, sanitizeSchema: r }) {
|
|
|
2687
2688
|
children: o
|
|
2688
2689
|
});
|
|
2689
2690
|
}
|
|
2690
|
-
function
|
|
2691
|
+
function Oo(e) {
|
|
2691
2692
|
e.stopPropagation();
|
|
2692
2693
|
}
|
|
2693
|
-
function
|
|
2694
|
+
function ko({ href: e, title: t, className: n, children: r }) {
|
|
2694
2695
|
return /* @__PURE__ */ U(v, {
|
|
2695
2696
|
href: e,
|
|
2696
2697
|
title: t,
|
|
2697
2698
|
className: N("inline-block!", n),
|
|
2698
2699
|
isExternal: !0,
|
|
2699
|
-
onMouseDown:
|
|
2700
|
-
onClick:
|
|
2700
|
+
onMouseDown: Oo,
|
|
2701
|
+
onClick: Oo,
|
|
2701
2702
|
children: r
|
|
2702
2703
|
});
|
|
2703
2704
|
}
|
|
2704
|
-
function
|
|
2705
|
+
function Ao({ node: e, className: t, ...n }) {
|
|
2705
2706
|
return /* @__PURE__ */ U("p", {
|
|
2706
2707
|
className: N("my-0 not-first:mt-8", t),
|
|
2707
2708
|
...n
|
|
2708
2709
|
});
|
|
2709
2710
|
}
|
|
2710
|
-
function
|
|
2711
|
+
function jo({ node: e, className: t, ...n }) {
|
|
2711
2712
|
return /* @__PURE__ */ U("ul", {
|
|
2712
2713
|
className: N("my-0 not-first:mt-8 pl-20 list-disc", t),
|
|
2713
2714
|
...n
|
|
2714
2715
|
});
|
|
2715
2716
|
}
|
|
2716
|
-
function
|
|
2717
|
+
function Mo({ node: e, className: t, ...n }) {
|
|
2717
2718
|
return /* @__PURE__ */ U("ol", {
|
|
2718
2719
|
className: N("my-0 not-first:mt-8 pl-20 list-decimal", t),
|
|
2719
2720
|
...n
|
|
2720
2721
|
});
|
|
2721
2722
|
}
|
|
2722
|
-
function
|
|
2723
|
+
function No({ node: e, className: t, ...n }) {
|
|
2723
2724
|
return /* @__PURE__ */ U("li", {
|
|
2724
2725
|
className: N("my-0", t),
|
|
2725
2726
|
...n
|
|
2726
2727
|
});
|
|
2727
2728
|
}
|
|
2728
|
-
function
|
|
2729
|
+
function Po({ node: e, className: t, ...n }) {
|
|
2729
2730
|
return /* @__PURE__ */ U("strong", {
|
|
2730
2731
|
className: N("font-semibold", t),
|
|
2731
2732
|
...n
|
|
2732
2733
|
});
|
|
2733
2734
|
}
|
|
2734
|
-
function
|
|
2735
|
+
function Fo({ node: e, className: t, ...n }) {
|
|
2735
2736
|
return /* @__PURE__ */ U("b", {
|
|
2736
2737
|
className: N("font-semibold", t),
|
|
2737
2738
|
...n
|
|
2738
2739
|
});
|
|
2739
2740
|
}
|
|
2740
|
-
function
|
|
2741
|
+
function Io({ node: e, className: t, ...n }) {
|
|
2741
2742
|
return /* @__PURE__ */ U("em", {
|
|
2742
2743
|
className: N("italic", t),
|
|
2743
2744
|
...n
|
|
2744
2745
|
});
|
|
2745
2746
|
}
|
|
2746
|
-
function
|
|
2747
|
+
function Lo({ node: e, className: t, ...n }) {
|
|
2747
2748
|
return /* @__PURE__ */ U("i", {
|
|
2748
2749
|
className: N("italic", t),
|
|
2749
2750
|
...n
|
|
2750
2751
|
});
|
|
2751
2752
|
}
|
|
2752
|
-
function
|
|
2753
|
+
function Ro({ node: e, className: t, ...n }) {
|
|
2753
2754
|
return /* @__PURE__ */ U("code", {
|
|
2754
2755
|
className: N("font-mono text-[0.9em]", t),
|
|
2755
2756
|
...n
|
|
2756
2757
|
});
|
|
2757
2758
|
}
|
|
2758
|
-
var
|
|
2759
|
-
a:
|
|
2760
|
-
p:
|
|
2761
|
-
ul:
|
|
2762
|
-
ol:
|
|
2763
|
-
li:
|
|
2764
|
-
strong:
|
|
2765
|
-
b:
|
|
2766
|
-
em:
|
|
2767
|
-
i:
|
|
2768
|
-
code:
|
|
2759
|
+
var zo = {
|
|
2760
|
+
a: ko,
|
|
2761
|
+
p: Ao,
|
|
2762
|
+
ul: jo,
|
|
2763
|
+
ol: Mo,
|
|
2764
|
+
li: No,
|
|
2765
|
+
strong: Po,
|
|
2766
|
+
b: Fo,
|
|
2767
|
+
em: Io,
|
|
2768
|
+
i: Lo,
|
|
2769
|
+
code: Ro
|
|
2769
2770
|
};
|
|
2770
2771
|
//#endregion
|
|
2771
2772
|
//#region src/components/chat-notification-card/utils.ts
|
|
2772
|
-
function
|
|
2773
|
+
function Bo(e) {
|
|
2773
2774
|
return new Date(Date.now() + e * 60 * 1e3);
|
|
2774
2775
|
}
|
|
2775
|
-
var
|
|
2776
|
-
function
|
|
2776
|
+
var Vo = 60, Ho = 1440, Uo = 6e4;
|
|
2777
|
+
function Wo(e, t) {
|
|
2777
2778
|
return `${e} ${t}${e === 1 ? "" : "s"}`;
|
|
2778
2779
|
}
|
|
2779
|
-
function
|
|
2780
|
-
let r = Math.max(0, Math.ceil((e.getTime() - n.getTime()) /
|
|
2781
|
-
return i > 0 && s.push(
|
|
2780
|
+
function Go(e, t = "in", n = /* @__PURE__ */ new Date()) {
|
|
2781
|
+
let r = Math.max(0, Math.ceil((e.getTime() - n.getTime()) / Uo)), i = Math.floor(r / Ho), a = Math.floor(r % Ho / Vo), o = r % Vo, s = [];
|
|
2782
|
+
return i > 0 && s.push(Wo(i, "day")), a > 0 && s.push(Wo(a, "hour")), s.push(Wo(o, "minute")), [t, ...s].filter(Boolean).join(" ");
|
|
2782
2783
|
}
|
|
2783
2784
|
//#endregion
|
|
2784
2785
|
//#region src/components/chat-notification-card/chat-notification-card.tsx
|
|
2785
|
-
var
|
|
2786
|
-
function
|
|
2787
|
-
let e = L(
|
|
2786
|
+
var Ko = P(null);
|
|
2787
|
+
function qo() {
|
|
2788
|
+
let e = L(Ko);
|
|
2788
2789
|
if (!e) throw Error("\"useChatNotificationCardContext\" must be used within a ChatNotificationCard");
|
|
2789
2790
|
return e;
|
|
2790
2791
|
}
|
|
2791
|
-
function
|
|
2792
|
+
function Jo({ children: e, variant: t = "default", className: n, overlayClassName: r, defaultExpanded: i = !1, expanded: a, onExpandedChange: o, onClick: s }) {
|
|
2792
2793
|
let [c, l] = H(i), u = a ?? c, d = I((e) => {
|
|
2793
2794
|
a === void 0 && l(e), o?.(e);
|
|
2794
2795
|
}, [a, o]), f = I(() => {
|
|
@@ -2802,7 +2803,7 @@ function qo({ children: e, variant: t = "default", className: n, overlayClassNam
|
|
|
2802
2803
|
d,
|
|
2803
2804
|
f
|
|
2804
2805
|
]);
|
|
2805
|
-
return /* @__PURE__ */ U(
|
|
2806
|
+
return /* @__PURE__ */ U(Ko.Provider, {
|
|
2806
2807
|
value: p,
|
|
2807
2808
|
children: /* @__PURE__ */ W("div", {
|
|
2808
2809
|
role: "alert",
|
|
@@ -2820,7 +2821,7 @@ function qo({ children: e, variant: t = "default", className: n, overlayClassNam
|
|
|
2820
2821
|
})
|
|
2821
2822
|
});
|
|
2822
2823
|
}
|
|
2823
|
-
function
|
|
2824
|
+
function Yo({ children: e, className: t }) {
|
|
2824
2825
|
return /* @__PURE__ */ U("header", {
|
|
2825
2826
|
"data-slot": "chat-notification-card-head",
|
|
2826
2827
|
"data-testid": "chat-notification-card-head",
|
|
@@ -2828,7 +2829,7 @@ function Jo({ children: e, className: t }) {
|
|
|
2828
2829
|
children: e
|
|
2829
2830
|
});
|
|
2830
2831
|
}
|
|
2831
|
-
function
|
|
2832
|
+
function Xo({ children: e, className: t }) {
|
|
2832
2833
|
return /* @__PURE__ */ U("div", {
|
|
2833
2834
|
"data-slot": "chat-notification-card-header",
|
|
2834
2835
|
"data-testid": "chat-notification-card-header",
|
|
@@ -2836,7 +2837,7 @@ function Yo({ children: e, className: t }) {
|
|
|
2836
2837
|
children: e
|
|
2837
2838
|
});
|
|
2838
2839
|
}
|
|
2839
|
-
function
|
|
2840
|
+
function Zo({ children: e, className: t }) {
|
|
2840
2841
|
return /* @__PURE__ */ U("div", {
|
|
2841
2842
|
"data-slot": "chat-notification-card-header-icon",
|
|
2842
2843
|
"data-testid": "chat-notification-card-header-icon",
|
|
@@ -2844,7 +2845,7 @@ function Xo({ children: e, className: t }) {
|
|
|
2844
2845
|
children: e
|
|
2845
2846
|
});
|
|
2846
2847
|
}
|
|
2847
|
-
function
|
|
2848
|
+
function Qo({ children: e, className: t }) {
|
|
2848
2849
|
return /* @__PURE__ */ U("div", {
|
|
2849
2850
|
"data-slot": "chat-notification-card-header-title",
|
|
2850
2851
|
"data-testid": "chat-notification-card-header-title",
|
|
@@ -2852,7 +2853,7 @@ function Zo({ children: e, className: t }) {
|
|
|
2852
2853
|
children: e
|
|
2853
2854
|
});
|
|
2854
2855
|
}
|
|
2855
|
-
function
|
|
2856
|
+
function $o({ children: e, className: t }) {
|
|
2856
2857
|
return /* @__PURE__ */ U(M, {
|
|
2857
2858
|
variant: "body-sm",
|
|
2858
2859
|
fontWeight: "semibold",
|
|
@@ -2863,13 +2864,13 @@ function Qo({ children: e, className: t }) {
|
|
|
2863
2864
|
children: /* @__PURE__ */ U("span", { children: e })
|
|
2864
2865
|
});
|
|
2865
2866
|
}
|
|
2866
|
-
var
|
|
2867
|
+
var es = {
|
|
2867
2868
|
low: "info",
|
|
2868
2869
|
medium: "warning",
|
|
2869
2870
|
high: "error"
|
|
2870
2871
|
};
|
|
2871
|
-
function
|
|
2872
|
-
let i =
|
|
2872
|
+
function ts({ children: e, priority: t = "medium", className: n, ...r }) {
|
|
2873
|
+
let i = es[t];
|
|
2873
2874
|
return t === "low" ? null : /* @__PURE__ */ U(o, {
|
|
2874
2875
|
"data-slot": "chat-notification-card-header-status",
|
|
2875
2876
|
"data-testid": "chat-notification-card-header-status",
|
|
@@ -2882,7 +2883,7 @@ function es({ children: e, priority: t = "medium", className: n, ...r }) {
|
|
|
2882
2883
|
children: e
|
|
2883
2884
|
});
|
|
2884
2885
|
}
|
|
2885
|
-
function
|
|
2886
|
+
function ns({ children: e, className: t }) {
|
|
2886
2887
|
return /* @__PURE__ */ U("div", {
|
|
2887
2888
|
"data-slot": "chat-notification-card-actions",
|
|
2888
2889
|
"data-testid": "chat-notification-card-actions",
|
|
@@ -2891,7 +2892,7 @@ function ts({ children: e, className: t }) {
|
|
|
2891
2892
|
children: e
|
|
2892
2893
|
});
|
|
2893
2894
|
}
|
|
2894
|
-
function
|
|
2895
|
+
function rs({ children: e, className: t }) {
|
|
2895
2896
|
return /* @__PURE__ */ U(M, {
|
|
2896
2897
|
variant: "caption",
|
|
2897
2898
|
"data-slot": "chat-notification-card-timestamp",
|
|
@@ -2901,7 +2902,7 @@ function ns({ children: e, className: t }) {
|
|
|
2901
2902
|
children: /* @__PURE__ */ U("span", { children: e })
|
|
2902
2903
|
});
|
|
2903
2904
|
}
|
|
2904
|
-
function
|
|
2905
|
+
function is({ children: e, className: t }) {
|
|
2905
2906
|
function n(e) {
|
|
2906
2907
|
e.stopPropagation();
|
|
2907
2908
|
}
|
|
@@ -2918,7 +2919,7 @@ function rs({ children: e, className: t }) {
|
|
|
2918
2919
|
children: e
|
|
2919
2920
|
});
|
|
2920
2921
|
}
|
|
2921
|
-
var
|
|
2922
|
+
var as = F(function({ className: e, isRead: t = !1, onRead: n, ...r }, i) {
|
|
2922
2923
|
function a() {
|
|
2923
2924
|
n?.(!t);
|
|
2924
2925
|
}
|
|
@@ -2935,8 +2936,8 @@ var is = F(function({ className: e, isRead: t = !1, onRead: n, ...r }, i) {
|
|
|
2935
2936
|
children: U(t ? Jt : qt, {})
|
|
2936
2937
|
});
|
|
2937
2938
|
});
|
|
2938
|
-
|
|
2939
|
-
var
|
|
2939
|
+
as.displayName = "ChatNotificationCardReadActionButton";
|
|
2940
|
+
var os = F(function({ className: t, labelClassName: n, cancelLabelClassName: r, snoozeUntilDate: i, cancelLabel: a = "Cancel", formatDate: o = Go, onCancel: s, onClick: c, onMouseEnter: l, onMouseLeave: u, ...d }, f) {
|
|
2940
2941
|
let [p, m] = H(!1), h = i && i > /* @__PURE__ */ new Date();
|
|
2941
2942
|
R(() => {
|
|
2942
2943
|
h || m(!1);
|
|
@@ -2985,8 +2986,8 @@ var as = F(function({ className: t, labelClassName: n, cancelLabelClassName: r,
|
|
|
2985
2986
|
children: /* @__PURE__ */ U(Yt, {})
|
|
2986
2987
|
});
|
|
2987
2988
|
});
|
|
2988
|
-
|
|
2989
|
-
var
|
|
2989
|
+
os.displayName = "ChatNotificationCardSnoozeButton";
|
|
2990
|
+
var ss = F(function({ className: e, ...t }, n) {
|
|
2990
2991
|
return /* @__PURE__ */ U(_, {
|
|
2991
2992
|
ref: n,
|
|
2992
2993
|
"data-slot": "chat-notification-card-delete-button",
|
|
@@ -2998,8 +2999,8 @@ var os = F(function({ className: e, ...t }, n) {
|
|
|
2998
2999
|
children: /* @__PURE__ */ U(Et, {})
|
|
2999
3000
|
});
|
|
3000
3001
|
});
|
|
3001
|
-
|
|
3002
|
-
var
|
|
3002
|
+
ss.displayName = "ChatNotificationCardDeleteButton";
|
|
3003
|
+
var cs = F(function({ className: e, ...t }, n) {
|
|
3003
3004
|
return /* @__PURE__ */ U(_, {
|
|
3004
3005
|
ref: n,
|
|
3005
3006
|
"data-slot": "chat-notification-card-close-button",
|
|
@@ -3011,16 +3012,16 @@ var ss = F(function({ className: e, ...t }, n) {
|
|
|
3011
3012
|
children: /* @__PURE__ */ U(wt, {})
|
|
3012
3013
|
});
|
|
3013
3014
|
});
|
|
3014
|
-
|
|
3015
|
-
function
|
|
3015
|
+
cs.displayName = "ChatNotificationCardCloseButton";
|
|
3016
|
+
function ls({ children: e, className: t }) {
|
|
3016
3017
|
return /* @__PURE__ */ W("div", {
|
|
3017
3018
|
"data-slot": "chat-notification-card-content",
|
|
3018
3019
|
"data-testid": "chat-notification-card-content",
|
|
3019
3020
|
className: N("flex flex-col items-start text-left gap-4", "relative pr-[40px]", t),
|
|
3020
|
-
children: [e, /* @__PURE__ */ U(
|
|
3021
|
+
children: [e, /* @__PURE__ */ U(ps, {})]
|
|
3021
3022
|
});
|
|
3022
3023
|
}
|
|
3023
|
-
function
|
|
3024
|
+
function us({ children: e, className: t }) {
|
|
3024
3025
|
return /* @__PURE__ */ U(M, {
|
|
3025
3026
|
variant: "body-sm",
|
|
3026
3027
|
fontWeight: "semibold",
|
|
@@ -3031,20 +3032,20 @@ function ls({ children: e, className: t }) {
|
|
|
3031
3032
|
children: /* @__PURE__ */ U("span", { children: e })
|
|
3032
3033
|
});
|
|
3033
3034
|
}
|
|
3034
|
-
function
|
|
3035
|
+
function ds({ html: e, htmlComponents: t, className: n }) {
|
|
3035
3036
|
return /* @__PURE__ */ U(M, {
|
|
3036
3037
|
variant: "body-sm",
|
|
3037
3038
|
"data-slot": "chat-notification-card-content-description",
|
|
3038
3039
|
"data-testid": "chat-notification-card-content-description",
|
|
3039
3040
|
className: N("text-text-primary", "mt-8", "group-data-[expanded=false]/chat-notification-card:line-clamp-2", "[&_:is(p,ul,ol)]:my-0!", "[&_:is(a)]:inline-block!", "group-data-[expanded=false]/chat-notification-card:[&_:is(table,thead,tbody,tfoot,tr,td,th)]:contents!", "w-full", n),
|
|
3040
3041
|
asChild: !0,
|
|
3041
|
-
children: /* @__PURE__ */ U("div", { children: /* @__PURE__ */ U(
|
|
3042
|
+
children: /* @__PURE__ */ U("div", { children: /* @__PURE__ */ U(Do, {
|
|
3042
3043
|
html: e,
|
|
3043
3044
|
components: t
|
|
3044
3045
|
}) })
|
|
3045
3046
|
});
|
|
3046
3047
|
}
|
|
3047
|
-
function
|
|
3048
|
+
function fs({ children: e, className: t }) {
|
|
3048
3049
|
return /* @__PURE__ */ U("div", {
|
|
3049
3050
|
"data-slot": "chat-notification-card-content-actions",
|
|
3050
3051
|
"data-testid": "chat-notification-card-content-actions",
|
|
@@ -3053,8 +3054,8 @@ function ds({ children: e, className: t }) {
|
|
|
3053
3054
|
children: e
|
|
3054
3055
|
});
|
|
3055
3056
|
}
|
|
3056
|
-
var
|
|
3057
|
-
let { isExpanded: a, toggleExpanded: o } =
|
|
3057
|
+
var ps = F(function({ className: e, onMouseDown: t, onClick: n, ...r }, i) {
|
|
3058
|
+
let { isExpanded: a, toggleExpanded: o } = qo();
|
|
3058
3059
|
function s(e) {
|
|
3059
3060
|
e.stopPropagation(), t?.(e);
|
|
3060
3061
|
}
|
|
@@ -3075,17 +3076,17 @@ var fs = F(function({ className: e, onMouseDown: t, onClick: n, ...r }, i) {
|
|
|
3075
3076
|
children: U(a ? Ct : St, {})
|
|
3076
3077
|
});
|
|
3077
3078
|
});
|
|
3078
|
-
|
|
3079
|
-
var
|
|
3079
|
+
ps.displayName = "ChatNotificationCardExpandButton";
|
|
3080
|
+
var ms = Zo, hs = ds, gs = rs;
|
|
3080
3081
|
//#endregion
|
|
3081
3082
|
//#region src/components/chat-notification-popup/chat-notification-popup.tsx
|
|
3082
|
-
function
|
|
3083
|
+
function _s({ children: e, ...t }) {
|
|
3083
3084
|
return /* @__PURE__ */ U(se, {
|
|
3084
3085
|
...t,
|
|
3085
3086
|
children: e
|
|
3086
3087
|
});
|
|
3087
3088
|
}
|
|
3088
|
-
var
|
|
3089
|
+
var vs = F(function({ children: e, ...t }, n) {
|
|
3089
3090
|
return /* @__PURE__ */ U(le, {
|
|
3090
3091
|
ref: n,
|
|
3091
3092
|
"data-slot": "chat-notification-popup-trigger",
|
|
@@ -3093,8 +3094,8 @@ var _s = F(function({ children: e, ...t }, n) {
|
|
|
3093
3094
|
children: e
|
|
3094
3095
|
});
|
|
3095
3096
|
});
|
|
3096
|
-
|
|
3097
|
-
var
|
|
3097
|
+
vs.displayName = "ChatNotificationPopupTrigger";
|
|
3098
|
+
var ys = F(function({ children: e, className: t, ...n }, r) {
|
|
3098
3099
|
return /* @__PURE__ */ U(ce, {
|
|
3099
3100
|
ref: r,
|
|
3100
3101
|
"data-slot": "chat-notification-popup-content",
|
|
@@ -3103,10 +3104,10 @@ var vs = F(function({ children: e, className: t, ...n }, r) {
|
|
|
3103
3104
|
children: e
|
|
3104
3105
|
});
|
|
3105
3106
|
});
|
|
3106
|
-
|
|
3107
|
+
ys.displayName = "ChatNotificationPopupContent";
|
|
3107
3108
|
//#endregion
|
|
3108
3109
|
//#region src/components/chat-reply/chat-reply.tsx
|
|
3109
|
-
function
|
|
3110
|
+
function bs({ className: e, children: t, hasPadding: n = !0 }) {
|
|
3110
3111
|
return /* @__PURE__ */ U("ul", {
|
|
3111
3112
|
"data-testid": "chat-replies",
|
|
3112
3113
|
"data-slot": "chat-replies",
|
|
@@ -3115,7 +3116,7 @@ function ys({ className: e, children: t, hasPadding: n = !0 }) {
|
|
|
3115
3116
|
children: t
|
|
3116
3117
|
});
|
|
3117
3118
|
}
|
|
3118
|
-
function
|
|
3119
|
+
function xs({ className: e, children: t, isMultiline: n = !1, ...r }) {
|
|
3119
3120
|
return /* @__PURE__ */ U("li", {
|
|
3120
3121
|
"data-testid": "chat-reply",
|
|
3121
3122
|
"data-slot": "chat-reply",
|
|
@@ -3125,7 +3126,7 @@ function bs({ className: e, children: t, isMultiline: n = !1, ...r }) {
|
|
|
3125
3126
|
children: t
|
|
3126
3127
|
});
|
|
3127
3128
|
}
|
|
3128
|
-
function
|
|
3129
|
+
function Ss({ className: e, children: t, ...n }) {
|
|
3129
3130
|
return /* @__PURE__ */ U(o, {
|
|
3130
3131
|
variant: "outlined",
|
|
3131
3132
|
size: "sm",
|
|
@@ -3137,7 +3138,7 @@ function xs({ className: e, children: t, ...n }) {
|
|
|
3137
3138
|
children: t
|
|
3138
3139
|
});
|
|
3139
3140
|
}
|
|
3140
|
-
function
|
|
3141
|
+
function Cs({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
3141
3142
|
return /* @__PURE__ */ U(M, {
|
|
3142
3143
|
"data-testid": "chat-reply-value",
|
|
3143
3144
|
"data-slot": "chat-reply-value",
|
|
@@ -3150,13 +3151,13 @@ function Ss({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
|
3150
3151
|
}
|
|
3151
3152
|
//#endregion
|
|
3152
3153
|
//#region src/components/chat-suggestion/chat-suggestion.tsx
|
|
3153
|
-
var
|
|
3154
|
-
function
|
|
3155
|
-
let e = L(
|
|
3154
|
+
var ws = P(null);
|
|
3155
|
+
function Ts() {
|
|
3156
|
+
let e = L(ws);
|
|
3156
3157
|
if (!e) throw Error("\"useChatSuggestionContext\" must be used within a ChatSuggestion");
|
|
3157
3158
|
return e;
|
|
3158
3159
|
}
|
|
3159
|
-
var
|
|
3160
|
+
var Es = F(function({ children: e, className: t, hasLoop: n = !0, ...r }, i) {
|
|
3160
3161
|
return /* @__PURE__ */ U(y, {
|
|
3161
3162
|
asChild: !0,
|
|
3162
3163
|
hasLoop: n,
|
|
@@ -3170,13 +3171,13 @@ var Ts = F(function({ children: e, className: t, hasLoop: n = !0, ...r }, i) {
|
|
|
3170
3171
|
})
|
|
3171
3172
|
});
|
|
3172
3173
|
});
|
|
3173
|
-
|
|
3174
|
-
var
|
|
3174
|
+
Es.displayName = "ChatSuggestions";
|
|
3175
|
+
var Ds = F(function({ index: e, children: t, className: n, triggerClassName: r, onHover: i, onMouseEnter: a, ...o }, s) {
|
|
3175
3176
|
let c = B(() => ({ index: e }), [e]);
|
|
3176
3177
|
function l(e) {
|
|
3177
3178
|
a?.(e), i?.();
|
|
3178
3179
|
}
|
|
3179
|
-
return /* @__PURE__ */ U(
|
|
3180
|
+
return /* @__PURE__ */ U(ws.Provider, {
|
|
3180
3181
|
value: c,
|
|
3181
3182
|
children: /* @__PURE__ */ W(b, {
|
|
3182
3183
|
ref: s,
|
|
@@ -3188,9 +3189,9 @@ var Es = F(function({ index: e, children: t, className: n, triggerClassName: r,
|
|
|
3188
3189
|
})
|
|
3189
3190
|
});
|
|
3190
3191
|
});
|
|
3191
|
-
|
|
3192
|
-
function
|
|
3193
|
-
let { index: r = 0 } =
|
|
3192
|
+
Ds.displayName = "ChatSuggestion";
|
|
3193
|
+
function Os({ children: e, className: t, innerClassName: n }) {
|
|
3194
|
+
let { index: r = 0 } = Ts();
|
|
3194
3195
|
return /* @__PURE__ */ U("span", {
|
|
3195
3196
|
"aria-hidden": "true",
|
|
3196
3197
|
"data-slot": "chat-suggestion-label-icon",
|
|
@@ -3209,7 +3210,7 @@ function Ds({ children: e, className: t, innerClassName: n }) {
|
|
|
3209
3210
|
})
|
|
3210
3211
|
});
|
|
3211
3212
|
}
|
|
3212
|
-
function
|
|
3213
|
+
function ks({ children: e, className: t, isMultiline: n = !0 }) {
|
|
3213
3214
|
return /* @__PURE__ */ U(M, {
|
|
3214
3215
|
variant: "body-small-low",
|
|
3215
3216
|
"data-slot": "chat-suggestion-label",
|
|
@@ -3219,7 +3220,7 @@ function Os({ children: e, className: t, isMultiline: n = !0 }) {
|
|
|
3219
3220
|
children: /* @__PURE__ */ U(S, { children: e })
|
|
3220
3221
|
});
|
|
3221
3222
|
}
|
|
3222
|
-
function
|
|
3223
|
+
function As({ children: e, className: t }) {
|
|
3223
3224
|
return /* @__PURE__ */ U("div", {
|
|
3224
3225
|
role: "group",
|
|
3225
3226
|
"data-slot": "chat-suggestion-actions",
|
|
@@ -3227,7 +3228,7 @@ function ks({ children: e, className: t }) {
|
|
|
3227
3228
|
children: e
|
|
3228
3229
|
});
|
|
3229
3230
|
}
|
|
3230
|
-
var
|
|
3231
|
+
var js = F(function({ className: e, children: t, ...n }, r) {
|
|
3231
3232
|
return /* @__PURE__ */ U(x, {
|
|
3232
3233
|
ref: r,
|
|
3233
3234
|
className: N("pointer-events-auto", e),
|
|
@@ -3235,29 +3236,29 @@ var As = F(function({ className: e, children: t, ...n }, r) {
|
|
|
3235
3236
|
children: t
|
|
3236
3237
|
});
|
|
3237
3238
|
});
|
|
3238
|
-
|
|
3239
|
+
js.displayName = "ChatSuggestionAction";
|
|
3239
3240
|
//#endregion
|
|
3240
3241
|
//#region src/components/chat-thread/chat-thread.tsx
|
|
3241
|
-
function
|
|
3242
|
+
function Ms(e, t) {
|
|
3242
3243
|
let n = F((t, n) => e({
|
|
3243
3244
|
...t,
|
|
3244
3245
|
ref: n
|
|
3245
3246
|
}));
|
|
3246
3247
|
return n.displayName = t, n;
|
|
3247
3248
|
}
|
|
3248
|
-
var
|
|
3249
|
-
function
|
|
3249
|
+
var Ns = Ms(dn.Viewport, "ChatThreadViewportPrimitive"), Ps = Ms(dn.Content, "ChatThreadContentPrimitive"), Fs = Ms(dn.Item, "ChatThreadItemPrimitive");
|
|
3250
|
+
function Is(e, t) {
|
|
3250
3251
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
3251
3252
|
}
|
|
3252
|
-
var
|
|
3253
|
+
var Ls = 12, Rs = "--chat-thread-group-min-height", zs = {
|
|
3253
3254
|
scrollToEnd: () => !1,
|
|
3254
3255
|
scrollToMessage: () => !1,
|
|
3255
3256
|
scrollToStart: () => !1
|
|
3256
|
-
},
|
|
3257
|
-
function
|
|
3258
|
-
return L(
|
|
3257
|
+
}, Bs = P(null);
|
|
3258
|
+
function Vs() {
|
|
3259
|
+
return L(Bs) ?? zs;
|
|
3259
3260
|
}
|
|
3260
|
-
function
|
|
3261
|
+
function Hs({ children: e }) {
|
|
3261
3262
|
let { scrollToEnd: t, scrollToMessage: n, scrollToStart: r } = fn(), i = B(() => ({
|
|
3262
3263
|
scrollToEnd: t,
|
|
3263
3264
|
scrollToMessage: n,
|
|
@@ -3267,27 +3268,27 @@ function Vs({ children: e }) {
|
|
|
3267
3268
|
n,
|
|
3268
3269
|
r
|
|
3269
3270
|
]);
|
|
3270
|
-
return /* @__PURE__ */ U(
|
|
3271
|
+
return /* @__PURE__ */ U(Bs.Provider, {
|
|
3271
3272
|
value: i,
|
|
3272
3273
|
children: e
|
|
3273
3274
|
});
|
|
3274
3275
|
}
|
|
3275
|
-
var
|
|
3276
|
-
function
|
|
3277
|
-
let t = L(
|
|
3276
|
+
var Us = P(null);
|
|
3277
|
+
function Ws(e) {
|
|
3278
|
+
let t = L(Us);
|
|
3278
3279
|
if (!t) throw Error(`[web-chat-ui] <${e}> must be rendered inside <ChatThreadProvider>`);
|
|
3279
3280
|
return t;
|
|
3280
3281
|
}
|
|
3281
|
-
function
|
|
3282
|
+
function Gs(e, t, n) {
|
|
3282
3283
|
return {
|
|
3283
3284
|
id: e,
|
|
3284
3285
|
conversationId: t ?? null,
|
|
3285
3286
|
knownGroupIds: n.length === 0 ? null : new Set(n)
|
|
3286
3287
|
};
|
|
3287
3288
|
}
|
|
3288
|
-
function
|
|
3289
|
-
let [u, d] = H(() =>
|
|
3290
|
-
(u.conversationId !== (t ?? null) || u.knownGroupIds === null != (n.length === 0)) && d(
|
|
3289
|
+
function Ks({ children: e, conversationId: t, groupIds: n, isStreaming: r = !1, scrollMode: i = "anchor", autoScroll: a = i === "follow" || !r, defaultScrollPosition: o = "end", scrollPreviousItemPeek: s = 0, scrollMargin: c = Ls, ...l }) {
|
|
3290
|
+
let [u, d] = H(() => Gs(0, t, n));
|
|
3291
|
+
(u.conversationId !== (t ?? null) || u.knownGroupIds === null != (n.length === 0)) && d(Gs(u.id + 1, t, n));
|
|
3291
3292
|
let { knownGroupIds: f } = u, p = B(() => ({
|
|
3292
3293
|
isStreaming: r,
|
|
3293
3294
|
scrollMargin: c,
|
|
@@ -3305,16 +3306,16 @@ function Gs({ children: e, conversationId: t, groupIds: n, isStreaming: r = !1,
|
|
|
3305
3306
|
scrollMargin: c,
|
|
3306
3307
|
defaultScrollPosition: o,
|
|
3307
3308
|
...l,
|
|
3308
|
-
children: /* @__PURE__ */ W(
|
|
3309
|
+
children: /* @__PURE__ */ W(Us.Provider, {
|
|
3309
3310
|
value: p,
|
|
3310
|
-
children: [i === "follow" && /* @__PURE__ */ U(
|
|
3311
|
+
children: [i === "follow" && /* @__PURE__ */ U(qs, {
|
|
3311
3312
|
groupIds: n,
|
|
3312
3313
|
knownGroupIds: f
|
|
3313
|
-
}), /* @__PURE__ */ U(
|
|
3314
|
+
}), /* @__PURE__ */ U(Hs, { children: e })]
|
|
3314
3315
|
})
|
|
3315
3316
|
}, u.id);
|
|
3316
3317
|
}
|
|
3317
|
-
function
|
|
3318
|
+
function qs({ groupIds: e, knownGroupIds: t }) {
|
|
3318
3319
|
let { scrollToEnd: n } = fn(), r = e.at(-1);
|
|
3319
3320
|
return z(() => {
|
|
3320
3321
|
r === void 0 || t === null || t.has(r) || n({ behavior: "auto" });
|
|
@@ -3324,13 +3325,13 @@ function Ks({ groupIds: e, knownGroupIds: t }) {
|
|
|
3324
3325
|
n
|
|
3325
3326
|
]), null;
|
|
3326
3327
|
}
|
|
3327
|
-
var
|
|
3328
|
-
let { isStreaming: h, scrollMargin: g, scrollMode: _ } =
|
|
3329
|
-
y.current = e,
|
|
3328
|
+
var Js = F(function({ children: e, className: t, viewportClassName: n, contentClassName: r, viewportRef: i, contentRef: a, scrollButton: o = !0, scrollButtonClassName: s, scrollButtonTooltip: c, isLoading: l = !1, hasError: u = !1, error: d, renderError: f, ...p }, m) {
|
|
3329
|
+
let { isStreaming: h, scrollMargin: g, scrollMode: _ } = Ws("ChatThread"), v = _ === "anchor", y = V(null), b = V(null), x = I((e) => {
|
|
3330
|
+
y.current = e, Is(i, e), Is(m, e?.parentElement ?? null);
|
|
3330
3331
|
}, [i, m]), S = I((e) => {
|
|
3331
|
-
b.current = e,
|
|
3332
|
+
b.current = e, Is(a, e);
|
|
3332
3333
|
}, [a]);
|
|
3333
|
-
return
|
|
3334
|
+
return Ys(y, b, g, v), /* @__PURE__ */ W(dn.Root, {
|
|
3334
3335
|
"data-slot": "chat-thread",
|
|
3335
3336
|
"data-testid": "chat-thread",
|
|
3336
3337
|
"data-scroll-mode": _,
|
|
@@ -3340,7 +3341,7 @@ var qs = F(function({ children: e, className: t, viewportClassName: n, contentCl
|
|
|
3340
3341
|
className: N("relative flex flex-col flex-1 min-h-0 overflow-hidden", t),
|
|
3341
3342
|
...p,
|
|
3342
3343
|
children: [
|
|
3343
|
-
/* @__PURE__ */ U(
|
|
3344
|
+
/* @__PURE__ */ U(Ns, {
|
|
3344
3345
|
ref: x,
|
|
3345
3346
|
"data-slot": "chat-thread-viewport",
|
|
3346
3347
|
"aria-label": "Chat message history",
|
|
@@ -3350,7 +3351,7 @@ var qs = F(function({ children: e, className: t, viewportClassName: n, contentCl
|
|
|
3350
3351
|
scrollbarWidth: "thin",
|
|
3351
3352
|
scrollbarColor: "var(--color-scrollbar-thumb) transparent"
|
|
3352
3353
|
},
|
|
3353
|
-
children: /* @__PURE__ */ U(
|
|
3354
|
+
children: /* @__PURE__ */ U(Ps, {
|
|
3354
3355
|
ref: S,
|
|
3355
3356
|
"data-slot": "chat-thread-content",
|
|
3356
3357
|
"aria-busy": h,
|
|
@@ -3359,29 +3360,29 @@ var qs = F(function({ children: e, className: t, viewportClassName: n, contentCl
|
|
|
3359
3360
|
children: e
|
|
3360
3361
|
})
|
|
3361
3362
|
}),
|
|
3362
|
-
u && !l && /* @__PURE__ */ U(
|
|
3363
|
+
u && !l && /* @__PURE__ */ U(ec, {
|
|
3363
3364
|
error: d,
|
|
3364
3365
|
children: f?.(d)
|
|
3365
3366
|
}),
|
|
3366
|
-
o && /* @__PURE__ */ U(
|
|
3367
|
+
o && /* @__PURE__ */ U($s, {
|
|
3367
3368
|
className: s,
|
|
3368
3369
|
tooltip: c
|
|
3369
3370
|
})
|
|
3370
3371
|
]
|
|
3371
3372
|
});
|
|
3372
3373
|
});
|
|
3373
|
-
|
|
3374
|
-
function
|
|
3374
|
+
Js.displayName = "ChatThread";
|
|
3375
|
+
function Ys(e, t, n, r) {
|
|
3375
3376
|
z(() => {
|
|
3376
3377
|
let i = e.current, a = t.current;
|
|
3377
3378
|
if (!i || !a) return;
|
|
3378
3379
|
if (!r) {
|
|
3379
|
-
a.style.removeProperty(
|
|
3380
|
+
a.style.removeProperty(Rs);
|
|
3380
3381
|
return;
|
|
3381
3382
|
}
|
|
3382
3383
|
let o = () => {
|
|
3383
3384
|
let { paddingTop: e, paddingBottom: t } = window.getComputedStyle(a), r = i.clientHeight - (Number.parseFloat(e) || 0) - (Number.parseFloat(t) || 0) - n;
|
|
3384
|
-
a.style.setProperty(
|
|
3385
|
+
a.style.setProperty(Rs, `${Math.max(0, r)}px`);
|
|
3385
3386
|
};
|
|
3386
3387
|
if (o(), typeof ResizeObserver > "u") return;
|
|
3387
3388
|
let s = new ResizeObserver(o);
|
|
@@ -3393,9 +3394,9 @@ function Js(e, t, n, r) {
|
|
|
3393
3394
|
r
|
|
3394
3395
|
]);
|
|
3395
3396
|
}
|
|
3396
|
-
var
|
|
3397
|
-
let { knownGroupIds: a, scrollMode: o } =
|
|
3398
|
-
return /* @__PURE__ */ U(
|
|
3397
|
+
var Xs = F(function({ groupId: e, className: t, children: n, ...r }, i) {
|
|
3398
|
+
let { knownGroupIds: a, scrollMode: o } = Ws("ChatThreadGroup"), s = o === "anchor" && a !== null && !a.has(e);
|
|
3399
|
+
return /* @__PURE__ */ U(Fs, {
|
|
3399
3400
|
ref: i,
|
|
3400
3401
|
messageId: `chat-thread-group-${e}`,
|
|
3401
3402
|
scrollAnchor: s,
|
|
@@ -3406,8 +3407,8 @@ var Ys = F(function({ groupId: e, className: t, children: n, ...r }, i) {
|
|
|
3406
3407
|
children: n
|
|
3407
3408
|
});
|
|
3408
3409
|
});
|
|
3409
|
-
|
|
3410
|
-
var
|
|
3410
|
+
Xs.displayName = "ChatThreadGroup";
|
|
3411
|
+
var Zs = F(function({ messageId: e, children: t, ...n }, r) {
|
|
3411
3412
|
return /* @__PURE__ */ U("div", {
|
|
3412
3413
|
ref: r,
|
|
3413
3414
|
"data-slot": "chat-thread-question",
|
|
@@ -3417,8 +3418,8 @@ var Xs = F(function({ messageId: e, children: t, ...n }, r) {
|
|
|
3417
3418
|
children: t
|
|
3418
3419
|
});
|
|
3419
3420
|
});
|
|
3420
|
-
|
|
3421
|
-
var
|
|
3421
|
+
Zs.displayName = "ChatThreadQuestion";
|
|
3422
|
+
var Qs = F(function({ messageId: e, children: t, ...n }, r) {
|
|
3422
3423
|
return /* @__PURE__ */ U("div", {
|
|
3423
3424
|
ref: r,
|
|
3424
3425
|
"data-slot": "chat-thread-answer",
|
|
@@ -3428,8 +3429,8 @@ var Zs = F(function({ messageId: e, children: t, ...n }, r) {
|
|
|
3428
3429
|
children: t
|
|
3429
3430
|
});
|
|
3430
3431
|
});
|
|
3431
|
-
|
|
3432
|
-
function
|
|
3432
|
+
Qs.displayName = "ChatThreadAnswer";
|
|
3433
|
+
function $s({ className: e, tooltip: t }) {
|
|
3433
3434
|
let { end: n } = pn();
|
|
3434
3435
|
return /* @__PURE__ */ U("div", {
|
|
3435
3436
|
"data-slot": "chat-thread-scroll-button",
|
|
@@ -3456,7 +3457,7 @@ function Qs({ className: e, tooltip: t }) {
|
|
|
3456
3457
|
})
|
|
3457
3458
|
});
|
|
3458
3459
|
}
|
|
3459
|
-
function
|
|
3460
|
+
function ec({ children: e, error: t, className: n }) {
|
|
3460
3461
|
return /* @__PURE__ */ U("div", {
|
|
3461
3462
|
"data-slot": "chat-thread-error-state",
|
|
3462
3463
|
"data-testid": "chat-message-history-error-state",
|
|
@@ -3472,7 +3473,7 @@ function $s({ children: e, error: t, className: n }) {
|
|
|
3472
3473
|
}
|
|
3473
3474
|
//#endregion
|
|
3474
3475
|
//#region src/components/chat-artifact/chat-artifact.tsx
|
|
3475
|
-
function
|
|
3476
|
+
function tc({ asChild: e = !1, className: n, children: r, ...i }) {
|
|
3476
3477
|
return /* @__PURE__ */ U(t, {
|
|
3477
3478
|
asChild: !0,
|
|
3478
3479
|
children: /* @__PURE__ */ U(e ? G : "button", {
|
|
@@ -3485,7 +3486,7 @@ function ec({ asChild: e = !1, className: n, children: r, ...i }) {
|
|
|
3485
3486
|
})
|
|
3486
3487
|
});
|
|
3487
3488
|
}
|
|
3488
|
-
function
|
|
3489
|
+
function nc({ className: e, children: t }) {
|
|
3489
3490
|
return /* @__PURE__ */ U(i, {
|
|
3490
3491
|
"data-slot": "chat-artifact-icon",
|
|
3491
3492
|
"data-testid": "chat-artifact-icon",
|
|
@@ -3493,7 +3494,7 @@ function tc({ className: e, children: t }) {
|
|
|
3493
3494
|
children: t
|
|
3494
3495
|
});
|
|
3495
3496
|
}
|
|
3496
|
-
function
|
|
3497
|
+
function rc({ className: e, children: t }) {
|
|
3497
3498
|
return /* @__PURE__ */ U("div", {
|
|
3498
3499
|
"data-slot": "chat-artifact-content",
|
|
3499
3500
|
"data-testid": "chat-artifact-content",
|
|
@@ -3501,7 +3502,7 @@ function nc({ className: e, children: t }) {
|
|
|
3501
3502
|
children: t
|
|
3502
3503
|
});
|
|
3503
3504
|
}
|
|
3504
|
-
function
|
|
3505
|
+
function ic({ className: e, children: t }) {
|
|
3505
3506
|
return /* @__PURE__ */ U(a, {
|
|
3506
3507
|
"data-slot": "chat-artifact-title",
|
|
3507
3508
|
"data-testid": "chat-artifact-title",
|
|
@@ -3509,7 +3510,7 @@ function rc({ className: e, children: t }) {
|
|
|
3509
3510
|
children: t
|
|
3510
3511
|
});
|
|
3511
3512
|
}
|
|
3512
|
-
function
|
|
3513
|
+
function ac({ className: e, children: t }) {
|
|
3513
3514
|
return /* @__PURE__ */ U(r, {
|
|
3514
3515
|
"data-slot": "chat-artifact-caption",
|
|
3515
3516
|
"data-testid": "chat-artifact-caption",
|
|
@@ -3517,7 +3518,7 @@ function ic({ className: e, children: t }) {
|
|
|
3517
3518
|
children: t
|
|
3518
3519
|
});
|
|
3519
3520
|
}
|
|
3520
|
-
function
|
|
3521
|
+
function oc({ className: e, children: t }) {
|
|
3521
3522
|
return /* @__PURE__ */ U(n, {
|
|
3522
3523
|
role: "group",
|
|
3523
3524
|
"data-slot": "chat-artifact-actions",
|
|
@@ -3529,7 +3530,7 @@ function ac({ className: e, children: t }) {
|
|
|
3529
3530
|
}
|
|
3530
3531
|
//#endregion
|
|
3531
3532
|
//#region src/components/canvas-shell/canvas-shell.tsx
|
|
3532
|
-
function
|
|
3533
|
+
function sc({ className: e, children: t, ...n }) {
|
|
3533
3534
|
return /* @__PURE__ */ U(k, {
|
|
3534
3535
|
isCollapsible: !1,
|
|
3535
3536
|
children: /* @__PURE__ */ U(E, {
|
|
@@ -3540,7 +3541,7 @@ function oc({ className: e, children: t, ...n }) {
|
|
|
3540
3541
|
})
|
|
3541
3542
|
});
|
|
3542
3543
|
}
|
|
3543
|
-
function
|
|
3544
|
+
function cc({ className: e, children: t, hasBorder: n = !0, ...r }) {
|
|
3544
3545
|
return /* @__PURE__ */ U(ae, {
|
|
3545
3546
|
"data-slot": "canvas-shell-header",
|
|
3546
3547
|
hasBorder: n,
|
|
@@ -3549,7 +3550,7 @@ function sc({ className: e, children: t, hasBorder: n = !0, ...r }) {
|
|
|
3549
3550
|
children: t
|
|
3550
3551
|
});
|
|
3551
3552
|
}
|
|
3552
|
-
function
|
|
3553
|
+
function lc({ className: e, children: t, ...n }) {
|
|
3553
3554
|
return /* @__PURE__ */ U(oe, {
|
|
3554
3555
|
"data-slot": "canvas-shell-title",
|
|
3555
3556
|
className: e,
|
|
@@ -3557,7 +3558,7 @@ function cc({ className: e, children: t, ...n }) {
|
|
|
3557
3558
|
children: t
|
|
3558
3559
|
});
|
|
3559
3560
|
}
|
|
3560
|
-
function
|
|
3561
|
+
function uc({ className: e, children: t, ...n }) {
|
|
3561
3562
|
return /* @__PURE__ */ U(re, {
|
|
3562
3563
|
"data-slot": "canvas-shell-close-trigger",
|
|
3563
3564
|
className: e,
|
|
@@ -3565,7 +3566,7 @@ function lc({ className: e, children: t, ...n }) {
|
|
|
3565
3566
|
children: t
|
|
3566
3567
|
});
|
|
3567
3568
|
}
|
|
3568
|
-
function
|
|
3569
|
+
function dc({ className: e, children: t, isFullScreen: n, labels: r, ...i }) {
|
|
3569
3570
|
return /* @__PURE__ */ U(ne, {
|
|
3570
3571
|
"data-slot": "canvas-shell-full-screen-trigger",
|
|
3571
3572
|
"aria-pressed": n,
|
|
@@ -3575,7 +3576,7 @@ function uc({ className: e, children: t, isFullScreen: n, labels: r, ...i }) {
|
|
|
3575
3576
|
children: t || /* @__PURE__ */ U(Wt, {})
|
|
3576
3577
|
});
|
|
3577
3578
|
}
|
|
3578
|
-
function
|
|
3579
|
+
function fc({ className: e, children: t, menuClassName: n, onOpenChange: r, ...i }) {
|
|
3579
3580
|
let [a, o] = H(!1);
|
|
3580
3581
|
function s(e) {
|
|
3581
3582
|
o(e), r?.(e);
|
|
@@ -3599,8 +3600,8 @@ function dc({ className: e, children: t, menuClassName: n, onOpenChange: r, ...i
|
|
|
3599
3600
|
})]
|
|
3600
3601
|
});
|
|
3601
3602
|
}
|
|
3602
|
-
var
|
|
3603
|
-
function
|
|
3603
|
+
var pc = pe;
|
|
3604
|
+
function mc({ className: e, children: t, bodyClassName: n, hasPadding: r = !0, hasScroll: i = !0, ...a }) {
|
|
3604
3605
|
return /* @__PURE__ */ U(ie, {
|
|
3605
3606
|
"data-slot": "canvas-shell-content",
|
|
3606
3607
|
"data-has-scroll": i,
|
|
@@ -3615,7 +3616,7 @@ function pc({ className: e, children: t, bodyClassName: n, hasPadding: r = !0, h
|
|
|
3615
3616
|
})
|
|
3616
3617
|
});
|
|
3617
3618
|
}
|
|
3618
|
-
function
|
|
3619
|
+
function hc({ className: e, children: t, ...n }) {
|
|
3619
3620
|
return /* @__PURE__ */ U(O, {
|
|
3620
3621
|
"data-slot": "canvas-shell-footer",
|
|
3621
3622
|
className: e,
|
|
@@ -3625,7 +3626,7 @@ function mc({ className: e, children: t, ...n }) {
|
|
|
3625
3626
|
}
|
|
3626
3627
|
//#endregion
|
|
3627
3628
|
//#region src/components/new-chat-trigger/new-chat-trigger.tsx
|
|
3628
|
-
var
|
|
3629
|
+
var gc = F(({ asChild: e = !1, children: t, onClick: n, ...r }, i) => {
|
|
3629
3630
|
let { goToNewChat: a } = Va(), o = e ? G : "button";
|
|
3630
3631
|
function s(e) {
|
|
3631
3632
|
n?.(e), a();
|
|
@@ -3638,10 +3639,10 @@ var hc = F(({ asChild: e = !1, children: t, onClick: n, ...r }, i) => {
|
|
|
3638
3639
|
children: t
|
|
3639
3640
|
});
|
|
3640
3641
|
});
|
|
3641
|
-
|
|
3642
|
+
gc.displayName = "NewChatTrigger";
|
|
3642
3643
|
//#endregion
|
|
3643
3644
|
//#region src/components/chat-reasoning/chat-reasoning.tsx
|
|
3644
|
-
var
|
|
3645
|
+
var _c = P({ status: "done" }), vc = 1e3, yc = {
|
|
3645
3646
|
duration: .28,
|
|
3646
3647
|
ease: [
|
|
3647
3648
|
.4,
|
|
@@ -3649,7 +3650,7 @@ var gc = P({ status: "done" }), _c = 1e3, vc = {
|
|
|
3649
3650
|
.2,
|
|
3650
3651
|
1
|
|
3651
3652
|
]
|
|
3652
|
-
},
|
|
3653
|
+
}, bc = {
|
|
3653
3654
|
duration: .24,
|
|
3654
3655
|
ease: [
|
|
3655
3656
|
.2,
|
|
@@ -3657,14 +3658,14 @@ var gc = P({ status: "done" }), _c = 1e3, vc = {
|
|
|
3657
3658
|
0,
|
|
3658
3659
|
1
|
|
3659
3660
|
]
|
|
3660
|
-
},
|
|
3661
|
-
function
|
|
3661
|
+
}, xc = { duration: .35 }, Sc = "\n@keyframes chat-reasoning-shimmer {\n from { background-position: 100% 0; }\n to { background-position: 0% 0; }\n}\n@keyframes chat-reasoning-symbol-turn {\n 0% { transform: rotate(0deg); }\n 55%, 100% { transform: rotate(90deg); }\n}\n@keyframes chat-reasoning-symbol-fade {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.55; }\n}\n@keyframes chat-reasoning-pulse-dot {\n from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ct-reasoning-mark-colour-dot-live) 45%, transparent); }\n to { box-shadow: 0 0 0 6px transparent; }\n}\n@keyframes chat-reasoning-pulse-tile {\n from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st-colour-layout-foreground-light) 35%, transparent); }\n to { box-shadow: 0 0 0 5px transparent; }\n}\n@keyframes chat-reasoning-open {\n from { height: 0; }\n to { height: var(--radix-collapsible-content-height); }\n}\n@keyframes chat-reasoning-close {\n from { height: var(--radix-collapsible-content-height); }\n to { height: 0; }\n}\n[data-slot='chat-reasoning'][data-status='running'][data-state='closed'] [data-slot='chat-reasoning-trigger-label-line'],\n[data-slot='chat-reasoning-step'][data-live='true'] [data-slot='chat-reasoning-step-text-content'] {\n background-image: linear-gradient(90deg, var(--ct-reasoning-row-colour-shimmer-base) 0%, var(--ct-reasoning-row-colour-shimmer-base) 40%, var(--ct-reasoning-row-colour-shimmer-highlight) 50%, var(--ct-reasoning-row-colour-shimmer-base) 60%, var(--ct-reasoning-row-colour-shimmer-base) 100%);\n background-size: 300% 100%;\n background-clip: text;\n -webkit-background-clip: text;\n color: transparent;\n animation: chat-reasoning-shimmer 2.2s linear infinite;\n}\n[data-slot='chat-reasoning-step'][data-live='true'] [data-slot='chat-reasoning-step-icon-dot'] {\n animation: chat-reasoning-pulse-dot 1.4s ease-out infinite;\n}\n[data-slot='chat-reasoning-step'][data-live='true'] [data-slot='chat-reasoning-step-icon-logo'],\n[data-slot='chat-reasoning-step'][data-live='true'] [data-slot='chat-reasoning-step-icon-web'] {\n animation: chat-reasoning-pulse-tile 1.6s ease-out infinite;\n}\n@media (prefers-reduced-motion: reduce) {\n [data-slot='chat-reasoning'] [data-slot='chat-reasoning-trigger-label-line'],\n [data-slot='chat-reasoning'] [data-slot='chat-reasoning-step-text-content'] {\n background: none;\n color: inherit;\n animation: none;\n }\n [data-slot='chat-reasoning'] [data-slot^='chat-reasoning-step-icon-'] {\n animation: none;\n }\n}\n";
|
|
3662
|
+
function Cc(e, t) {
|
|
3662
3663
|
if (t !== void 0) return t;
|
|
3663
3664
|
if (typeof e == "string" || typeof e == "number") return String(e);
|
|
3664
3665
|
}
|
|
3665
|
-
var
|
|
3666
|
+
var wc = F(function({ children: e, className: t, defaultOpen: n = !1, status: r = "done", ...i }, a) {
|
|
3666
3667
|
let o = B(() => ({ status: r }), [r]);
|
|
3667
|
-
return /* @__PURE__ */ U(
|
|
3668
|
+
return /* @__PURE__ */ U(_c.Provider, {
|
|
3668
3669
|
value: o,
|
|
3669
3670
|
children: /* @__PURE__ */ U(s, {
|
|
3670
3671
|
defaultOpen: n,
|
|
@@ -3676,13 +3677,13 @@ var Cc = F(function({ children: e, className: t, defaultOpen: n = !1, status: r
|
|
|
3676
3677
|
"data-testid": "chat-reasoning",
|
|
3677
3678
|
"data-status": r,
|
|
3678
3679
|
className: N("group/reasoning @container flex w-full min-w-0 flex-col", "rounded-reasoning-window-base border border-transparent", "data-[state=open]:border-reasoning-window-border", t),
|
|
3679
|
-
children: [e, /* @__PURE__ */ U("style", { children:
|
|
3680
|
+
children: [e, /* @__PURE__ */ U("style", { children: Sc })]
|
|
3680
3681
|
})
|
|
3681
3682
|
})
|
|
3682
3683
|
});
|
|
3683
3684
|
});
|
|
3684
|
-
|
|
3685
|
-
var
|
|
3685
|
+
wc.displayName = "ChatReasoning";
|
|
3686
|
+
var Tc = F(function({ children: e, className: t, ...n }, r) {
|
|
3686
3687
|
return /* @__PURE__ */ U(u, {
|
|
3687
3688
|
ref: r,
|
|
3688
3689
|
"data-slot": "chat-reasoning-trigger",
|
|
@@ -3692,8 +3693,8 @@ var wc = F(function({ children: e, className: t, ...n }, r) {
|
|
|
3692
3693
|
children: e
|
|
3693
3694
|
});
|
|
3694
3695
|
});
|
|
3695
|
-
|
|
3696
|
-
function
|
|
3696
|
+
Tc.displayName = "ChatReasoningTrigger";
|
|
3697
|
+
function Ec({ children: e, className: t, ...n }) {
|
|
3697
3698
|
return /* @__PURE__ */ U("span", {
|
|
3698
3699
|
"aria-hidden": !0,
|
|
3699
3700
|
"data-slot": "chat-reasoning-trigger-symbol-wrapper",
|
|
@@ -3707,8 +3708,8 @@ function Tc({ children: e, className: t, ...n }) {
|
|
|
3707
3708
|
})
|
|
3708
3709
|
});
|
|
3709
3710
|
}
|
|
3710
|
-
var
|
|
3711
|
-
function
|
|
3711
|
+
var Dc = "M0 8.65206C0 9.06414 0.0550629 9.47298 0.16195 9.87046C0.500425 11.1181 1.39277 12.1742 2.61225 12.768L6.3954 14.6126L10.185 12.7648C11.3203 12.2115 12.1851 11.2397 12.5592 10.1008C12.7131 9.63197 12.7908 9.14526 12.7908 8.65206V0H0V8.65206Z", Oc = "M1.15237 8.97959L2.73841 7.38436C3.25351 7.69767 3.84598 7.86764 4.46289 7.86764C5.07979 7.86764 5.67227 7.69767 6.18737 7.38436L7.77137 8.97754L8.92374 7.81849L7.33771 6.22326C7.9709 5.1584 7.9709 3.81914 7.33771 2.75634L8.92374 1.1611L7.77137 0.00204784L6.18737 1.59523C5.67227 1.28192 5.07979 1.11195 4.46289 1.11195C3.84598 1.11195 3.25351 1.28192 2.73841 1.59523L1.15237 0L0 1.15905L1.584 2.75224C1.27249 3.27033 1.10351 3.86624 1.10351 4.48672C1.10351 5.10721 1.27249 5.70312 1.584 6.22121L0 7.81439L1.15237 8.97345V8.97959ZM3.2413 3.26419C3.56705 2.93654 4.00072 2.75634 4.46289 2.75634C4.92506 2.75634 5.35873 2.93654 5.68448 3.26419C6.3584 3.94201 6.3584 5.04373 5.68448 5.72155C5.35873 6.04919 4.92506 6.23145 4.46289 6.23145C4.00072 6.23145 3.56705 6.05124 3.2413 5.72155C2.91554 5.39185 2.73433 4.95772 2.73433 4.49287C2.73433 4.02802 2.9135 3.59184 3.2413 3.26419Z";
|
|
3712
|
+
function kc({ className: e, ...t }) {
|
|
3712
3713
|
let n = `chat-reasoning-symbol-${Se().replace(/:/g, "")}`;
|
|
3713
3714
|
return /* @__PURE__ */ W("svg", {
|
|
3714
3715
|
"aria-hidden": !0,
|
|
@@ -3734,7 +3735,7 @@ function Oc({ className: e, ...t }) {
|
|
|
3734
3735
|
}), /* @__PURE__ */ U("g", {
|
|
3735
3736
|
transform: "translate(3.5384 3.5783)",
|
|
3736
3737
|
children: /* @__PURE__ */ U("path", {
|
|
3737
|
-
d:
|
|
3738
|
+
d: Oc,
|
|
3738
3739
|
fill: "black",
|
|
3739
3740
|
className: N("[transform-box:fill-box] [transform-origin:center]", "motion-safe:group-data-[status=running]/reasoning:animate-[chat-reasoning-symbol-turn_1.1s_cubic-bezier(0.65,0,0.35,1)_infinite]")
|
|
3740
3741
|
})
|
|
@@ -3742,14 +3743,14 @@ function Oc({ className: e, ...t }) {
|
|
|
3742
3743
|
}), /* @__PURE__ */ U("g", {
|
|
3743
3744
|
mask: `url(#${n})`,
|
|
3744
3745
|
children: /* @__PURE__ */ U("path", {
|
|
3745
|
-
d:
|
|
3746
|
+
d: Dc,
|
|
3746
3747
|
transform: "translate(1.6044 1.3328)",
|
|
3747
3748
|
fill: "currentColor"
|
|
3748
3749
|
})
|
|
3749
3750
|
})]
|
|
3750
3751
|
});
|
|
3751
3752
|
}
|
|
3752
|
-
function
|
|
3753
|
+
function Ac(e, t, n) {
|
|
3753
3754
|
let [r, i] = H({
|
|
3754
3755
|
key: e,
|
|
3755
3756
|
content: t
|
|
@@ -3762,7 +3763,7 @@ function kc(e, t, n) {
|
|
|
3762
3763
|
});
|
|
3763
3764
|
return;
|
|
3764
3765
|
}
|
|
3765
|
-
let o = n ? Math.max(0,
|
|
3766
|
+
let o = n ? Math.max(0, vc - (Date.now() - a.current)) : 0, s = setTimeout(() => {
|
|
3766
3767
|
a.current = Date.now(), i({
|
|
3767
3768
|
key: e,
|
|
3768
3769
|
content: t
|
|
@@ -3777,7 +3778,7 @@ function kc(e, t, n) {
|
|
|
3777
3778
|
r.content
|
|
3778
3779
|
]), r;
|
|
3779
3780
|
}
|
|
3780
|
-
function
|
|
3781
|
+
function jc({ children: e }) {
|
|
3781
3782
|
let t = gn(), n = _n();
|
|
3782
3783
|
return /* @__PURE__ */ U(hn.span, {
|
|
3783
3784
|
"aria-hidden": !t,
|
|
@@ -3798,12 +3799,12 @@ function Ac({ children: e }) {
|
|
|
3798
3799
|
y: -10,
|
|
3799
3800
|
opacity: 0
|
|
3800
3801
|
},
|
|
3801
|
-
transition:
|
|
3802
|
+
transition: yc,
|
|
3802
3803
|
children: e
|
|
3803
3804
|
});
|
|
3804
3805
|
}
|
|
3805
|
-
function
|
|
3806
|
-
let { status: i } = L(
|
|
3806
|
+
function Mc({ children: e, className: t, contentKey: n, ...r }) {
|
|
3807
|
+
let { status: i } = L(_c), a = Ac(Cc(e, n), e, i === "running");
|
|
3807
3808
|
return /* @__PURE__ */ U(M, {
|
|
3808
3809
|
asChild: !0,
|
|
3809
3810
|
variant: "body-small-low",
|
|
@@ -3815,12 +3816,12 @@ function jc({ children: e, className: t, contentKey: n, ...r }) {
|
|
|
3815
3816
|
...r,
|
|
3816
3817
|
children: /* @__PURE__ */ U(mn, {
|
|
3817
3818
|
initial: !1,
|
|
3818
|
-
children: /* @__PURE__ */ U(
|
|
3819
|
+
children: /* @__PURE__ */ U(jc, { children: a.content }, a.key ?? "line")
|
|
3819
3820
|
})
|
|
3820
3821
|
})
|
|
3821
3822
|
});
|
|
3822
3823
|
}
|
|
3823
|
-
function
|
|
3824
|
+
function Nc({ className: e, ...t }) {
|
|
3824
3825
|
return /* @__PURE__ */ U(c, {
|
|
3825
3826
|
"data-slot": "chat-reasoning-trigger-arrow",
|
|
3826
3827
|
"data-testid": "chat-reasoning-trigger-arrow",
|
|
@@ -3828,7 +3829,7 @@ function Mc({ className: e, ...t }) {
|
|
|
3828
3829
|
...t
|
|
3829
3830
|
});
|
|
3830
3831
|
}
|
|
3831
|
-
function
|
|
3832
|
+
function Pc({ children: e, className: t, ...n }) {
|
|
3832
3833
|
return /* @__PURE__ */ U(l, {
|
|
3833
3834
|
"data-slot": "chat-reasoning-steps",
|
|
3834
3835
|
"data-testid": "chat-reasoning-steps",
|
|
@@ -3840,8 +3841,8 @@ function Nc({ children: e, className: t, ...n }) {
|
|
|
3840
3841
|
})
|
|
3841
3842
|
});
|
|
3842
3843
|
}
|
|
3843
|
-
function
|
|
3844
|
-
let { status: n } = L(
|
|
3844
|
+
function Fc({ children: e, className: t }) {
|
|
3845
|
+
let { status: n } = L(_c), r = _n(), i = n === "running" && !r;
|
|
3845
3846
|
return /* @__PURE__ */ U(hn.div, {
|
|
3846
3847
|
className: t,
|
|
3847
3848
|
initial: i ? {
|
|
@@ -3854,12 +3855,12 @@ function Pc({ children: e, className: t }) {
|
|
|
3854
3855
|
opacity: 1,
|
|
3855
3856
|
transitionEnd: { overflow: "visible" }
|
|
3856
3857
|
},
|
|
3857
|
-
transition:
|
|
3858
|
+
transition: bc,
|
|
3858
3859
|
children: e
|
|
3859
3860
|
});
|
|
3860
3861
|
}
|
|
3861
|
-
function
|
|
3862
|
-
return /* @__PURE__ */ U(
|
|
3862
|
+
function Ic({ children: e, className: t, isLive: n = !1, ...r }) {
|
|
3863
|
+
return /* @__PURE__ */ U(Fc, { children: /* @__PURE__ */ U("div", {
|
|
3863
3864
|
"data-slot": "chat-reasoning-step",
|
|
3864
3865
|
"data-testid": "chat-reasoning-step",
|
|
3865
3866
|
"data-live": n,
|
|
@@ -3868,7 +3869,7 @@ function Fc({ children: e, className: t, isLive: n = !1, ...r }) {
|
|
|
3868
3869
|
children: e
|
|
3869
3870
|
}) });
|
|
3870
3871
|
}
|
|
3871
|
-
function
|
|
3872
|
+
function Lc({ children: e, className: t, ...n }) {
|
|
3872
3873
|
return /* @__PURE__ */ U("div", {
|
|
3873
3874
|
"data-slot": "chat-reasoning-step-head",
|
|
3874
3875
|
"data-testid": "chat-reasoning-step-head",
|
|
@@ -3877,7 +3878,7 @@ function Ic({ children: e, className: t, ...n }) {
|
|
|
3877
3878
|
children: e
|
|
3878
3879
|
});
|
|
3879
3880
|
}
|
|
3880
|
-
function
|
|
3881
|
+
function Rc({ children: e, className: t, ...n }) {
|
|
3881
3882
|
return /* @__PURE__ */ U("span", {
|
|
3882
3883
|
"data-slot": "chat-reasoning-step-icon-wrapper",
|
|
3883
3884
|
className: "relative flex min-h-reasoning-step-text-height-base w-reasoning-step-mark-column-base shrink-0 items-center justify-center",
|
|
@@ -3890,7 +3891,7 @@ function Lc({ children: e, className: t, ...n }) {
|
|
|
3890
3891
|
})
|
|
3891
3892
|
});
|
|
3892
3893
|
}
|
|
3893
|
-
function
|
|
3894
|
+
function zc({ className: e, ...t }) {
|
|
3894
3895
|
return /* @__PURE__ */ U("span", {
|
|
3895
3896
|
"aria-hidden": !0,
|
|
3896
3897
|
"data-slot": "chat-reasoning-step-icon-dot",
|
|
@@ -3899,7 +3900,7 @@ function Rc({ className: e, ...t }) {
|
|
|
3899
3900
|
...t
|
|
3900
3901
|
});
|
|
3901
3902
|
}
|
|
3902
|
-
function
|
|
3903
|
+
function Bc({ children: e, className: t, ...n }) {
|
|
3903
3904
|
return /* @__PURE__ */ U("span", {
|
|
3904
3905
|
"data-slot": "chat-reasoning-step-icon-logo",
|
|
3905
3906
|
"data-testid": "chat-reasoning-step-icon-logo",
|
|
@@ -3908,7 +3909,7 @@ function zc({ children: e, className: t, ...n }) {
|
|
|
3908
3909
|
children: e
|
|
3909
3910
|
});
|
|
3910
3911
|
}
|
|
3911
|
-
function
|
|
3912
|
+
function Vc({ children: e, className: t, ...n }) {
|
|
3912
3913
|
return /* @__PURE__ */ U("span", {
|
|
3913
3914
|
"data-slot": "chat-reasoning-step-icon-web",
|
|
3914
3915
|
"data-testid": "chat-reasoning-step-icon-web",
|
|
@@ -3917,7 +3918,7 @@ function Bc({ children: e, className: t, ...n }) {
|
|
|
3917
3918
|
children: e
|
|
3918
3919
|
});
|
|
3919
3920
|
}
|
|
3920
|
-
function
|
|
3921
|
+
function Hc({ children: e, className: t, contentKey: n, ...r }) {
|
|
3921
3922
|
let i = _n();
|
|
3922
3923
|
return /* @__PURE__ */ U(M, {
|
|
3923
3924
|
asChild: !0,
|
|
@@ -3933,14 +3934,14 @@ function Vc({ children: e, className: t, contentKey: n, ...r }) {
|
|
|
3933
3934
|
"data-slot": "chat-reasoning-step-text-content",
|
|
3934
3935
|
initial: !i && { opacity: 0 },
|
|
3935
3936
|
animate: { opacity: 1 },
|
|
3936
|
-
transition:
|
|
3937
|
+
transition: xc,
|
|
3937
3938
|
children: e
|
|
3938
|
-
},
|
|
3939
|
+
}, Cc(e, n) ?? "text")
|
|
3939
3940
|
})
|
|
3940
3941
|
})
|
|
3941
3942
|
});
|
|
3942
3943
|
}
|
|
3943
|
-
function
|
|
3944
|
+
function Uc({ children: e, className: t, ...n }) {
|
|
3944
3945
|
return /* @__PURE__ */ U("div", {
|
|
3945
3946
|
"data-slot": "chat-reasoning-step-notes",
|
|
3946
3947
|
"data-testid": "chat-reasoning-step-notes",
|
|
@@ -3949,38 +3950,38 @@ function Hc({ children: e, className: t, ...n }) {
|
|
|
3949
3950
|
children: e
|
|
3950
3951
|
});
|
|
3951
3952
|
}
|
|
3952
|
-
var
|
|
3953
|
-
function
|
|
3953
|
+
var Wc = "absolute left-[17.5px] bg-reasoning-tree-line";
|
|
3954
|
+
function Gc() {
|
|
3954
3955
|
return /* @__PURE__ */ W("span", {
|
|
3955
3956
|
"aria-hidden": !0,
|
|
3956
3957
|
className: "relative w-reasoning-step-mark-column-base shrink-0",
|
|
3957
3958
|
children: [
|
|
3958
|
-
/* @__PURE__ */ U("span", { className: N(
|
|
3959
|
-
/* @__PURE__ */ U("span", { className: N(
|
|
3959
|
+
/* @__PURE__ */ U("span", { className: N(Wc, "top-0 bottom-0 w-reasoning-tree-line-base", "group-last/reasoning-note:bottom-auto group-last/reasoning-note:h-[5px]") }),
|
|
3960
|
+
/* @__PURE__ */ U("span", { className: N(Wc, "top-[10.5px] h-reasoning-tree-line-base w-reasoning-tree-branch-base", "group-last/reasoning-note:hidden") }),
|
|
3960
3961
|
/* @__PURE__ */ U("span", { className: N("absolute top-[4.5px] left-[17.5px] hidden h-[7px] w-reasoning-tree-branch-base", "rounded-bl-reasoning-tree-base border-b border-l border-reasoning-tree-line", "group-last/reasoning-note:block") })
|
|
3961
3962
|
]
|
|
3962
3963
|
});
|
|
3963
3964
|
}
|
|
3964
|
-
function
|
|
3965
|
+
function Kc() {
|
|
3965
3966
|
return /* @__PURE__ */ W("span", {
|
|
3966
3967
|
"aria-hidden": !0,
|
|
3967
3968
|
className: "relative w-reasoning-step-mark-column-base shrink-0",
|
|
3968
3969
|
children: [
|
|
3969
|
-
/* @__PURE__ */ U("span", { className: N(
|
|
3970
|
-
/* @__PURE__ */ U("span", { className: N(
|
|
3970
|
+
/* @__PURE__ */ U("span", { className: N(Wc, "top-0 bottom-0 w-reasoning-tree-line-base", "group-last/reasoning-note:bottom-auto group-last/reasoning-note:h-[11px]") }),
|
|
3971
|
+
/* @__PURE__ */ U("span", { className: N(Wc, "top-[16.5px] h-reasoning-tree-line-base w-reasoning-tree-branch-base", "group-last/reasoning-note:hidden") }),
|
|
3971
3972
|
/* @__PURE__ */ U("span", { className: N("absolute top-[10.5px] left-[17.5px] hidden h-[7px] w-reasoning-tree-branch-base", "rounded-bl-reasoning-tree-base border-b border-l border-reasoning-tree-line", "group-last/reasoning-note:block") })
|
|
3972
3973
|
]
|
|
3973
3974
|
});
|
|
3974
3975
|
}
|
|
3975
|
-
function
|
|
3976
|
-
return /* @__PURE__ */ U(
|
|
3976
|
+
function qc({ children: e, className: t, ...n }) {
|
|
3977
|
+
return /* @__PURE__ */ U(Fc, {
|
|
3977
3978
|
className: "group/reasoning-note",
|
|
3978
3979
|
children: /* @__PURE__ */ W("div", {
|
|
3979
3980
|
"data-slot": "chat-reasoning-step-note",
|
|
3980
3981
|
"data-testid": "chat-reasoning-step-note",
|
|
3981
3982
|
className: N("flex items-stretch", t),
|
|
3982
3983
|
...n,
|
|
3983
|
-
children: [/* @__PURE__ */ U(
|
|
3984
|
+
children: [/* @__PURE__ */ U(Gc, {}), /* @__PURE__ */ U(M, {
|
|
3984
3985
|
asChild: !0,
|
|
3985
3986
|
variant: "caption-md",
|
|
3986
3987
|
fontWeight: "normal",
|
|
@@ -3990,15 +3991,15 @@ function Kc({ children: e, className: t, ...n }) {
|
|
|
3990
3991
|
})
|
|
3991
3992
|
});
|
|
3992
3993
|
}
|
|
3993
|
-
function
|
|
3994
|
-
return /* @__PURE__ */ U(
|
|
3994
|
+
function Jc({ children: e, className: t, ...n }) {
|
|
3995
|
+
return /* @__PURE__ */ U(Fc, {
|
|
3995
3996
|
className: "group/reasoning-note",
|
|
3996
3997
|
children: /* @__PURE__ */ W("div", {
|
|
3997
3998
|
"data-slot": "chat-reasoning-step-note-pages",
|
|
3998
3999
|
"data-testid": "chat-reasoning-step-note-pages",
|
|
3999
4000
|
className: N("flex items-stretch", t),
|
|
4000
4001
|
...n,
|
|
4001
|
-
children: [/* @__PURE__ */ U(
|
|
4002
|
+
children: [/* @__PURE__ */ U(Kc, {}), /* @__PURE__ */ U("div", {
|
|
4002
4003
|
className: "min-w-0 flex-1 py-reasoning-note-pages-spacing-padding-vertical-base",
|
|
4003
4004
|
children: /* @__PURE__ */ U("div", {
|
|
4004
4005
|
className: "flex flex-col py-reasoning-note-pages-spacing-padding-list-base",
|
|
@@ -4008,7 +4009,7 @@ function qc({ children: e, className: t, ...n }) {
|
|
|
4008
4009
|
})
|
|
4009
4010
|
});
|
|
4010
4011
|
}
|
|
4011
|
-
var
|
|
4012
|
+
var Yc = F(function({ children: e, className: t, asChild: n = !1, ...r }, i) {
|
|
4012
4013
|
return /* @__PURE__ */ U(n ? G : "div", {
|
|
4013
4014
|
ref: i,
|
|
4014
4015
|
"data-slot": "chat-reasoning-step-note-page-row",
|
|
@@ -4018,8 +4019,8 @@ var Jc = F(function({ children: e, className: t, asChild: n = !1, ...r }, i) {
|
|
|
4018
4019
|
children: e
|
|
4019
4020
|
});
|
|
4020
4021
|
});
|
|
4021
|
-
|
|
4022
|
-
function
|
|
4022
|
+
Yc.displayName = "ChatReasoningStepNotePageRow";
|
|
4023
|
+
function Xc({ children: e, className: t, ...n }) {
|
|
4023
4024
|
return /* @__PURE__ */ U("span", {
|
|
4024
4025
|
"data-slot": "chat-reasoning-step-note-page-icon",
|
|
4025
4026
|
"data-testid": "chat-reasoning-step-note-page-icon",
|
|
@@ -4036,7 +4037,7 @@ function Yc({ children: e, className: t, ...n }) {
|
|
|
4036
4037
|
})
|
|
4037
4038
|
});
|
|
4038
4039
|
}
|
|
4039
|
-
function
|
|
4040
|
+
function Zc({ children: e, className: t, ...n }) {
|
|
4040
4041
|
return /* @__PURE__ */ U(M, {
|
|
4041
4042
|
asChild: !0,
|
|
4042
4043
|
variant: "caption-md",
|
|
@@ -4050,7 +4051,7 @@ function Xc({ children: e, className: t, ...n }) {
|
|
|
4050
4051
|
})
|
|
4051
4052
|
});
|
|
4052
4053
|
}
|
|
4053
|
-
function
|
|
4054
|
+
function Qc({ children: e, className: t, ...n }) {
|
|
4054
4055
|
return /* @__PURE__ */ U(M, {
|
|
4055
4056
|
asChild: !0,
|
|
4056
4057
|
variant: "caption-md",
|
|
@@ -4064,8 +4065,8 @@ function Zc({ children: e, className: t, ...n }) {
|
|
|
4064
4065
|
})
|
|
4065
4066
|
});
|
|
4066
4067
|
}
|
|
4067
|
-
function
|
|
4068
|
-
return /* @__PURE__ */ U(
|
|
4068
|
+
function $c({ children: e, className: t, ...n }) {
|
|
4069
|
+
return /* @__PURE__ */ U(Fc, { children: /* @__PURE__ */ U("div", {
|
|
4069
4070
|
"data-slot": "chat-reasoning-end",
|
|
4070
4071
|
"data-testid": "chat-reasoning-end",
|
|
4071
4072
|
className: N("flex items-start", "pr-reasoning-end-row-spacing-padding-right-base py-reasoning-end-row-spacing-padding-vertical-base", t),
|
|
@@ -4073,7 +4074,7 @@ function Qc({ children: e, className: t, ...n }) {
|
|
|
4073
4074
|
children: e
|
|
4074
4075
|
}) });
|
|
4075
4076
|
}
|
|
4076
|
-
function
|
|
4077
|
+
function el({ children: e, className: t, ...n }) {
|
|
4077
4078
|
return /* @__PURE__ */ U("span", {
|
|
4078
4079
|
"aria-hidden": !0,
|
|
4079
4080
|
"data-slot": "chat-reasoning-end-icon",
|
|
@@ -4083,7 +4084,7 @@ function $c({ children: e, className: t, ...n }) {
|
|
|
4083
4084
|
children: e
|
|
4084
4085
|
});
|
|
4085
4086
|
}
|
|
4086
|
-
function
|
|
4087
|
+
function tl({ children: e, className: t, ...n }) {
|
|
4087
4088
|
return /* @__PURE__ */ U(M, {
|
|
4088
4089
|
asChild: !0,
|
|
4089
4090
|
variant: "body-small-low",
|
|
@@ -4098,7 +4099,7 @@ function el({ children: e, className: t, ...n }) {
|
|
|
4098
4099
|
}
|
|
4099
4100
|
//#endregion
|
|
4100
4101
|
//#region src/components/chat-thinking-process/chat-thinking-process.tsx
|
|
4101
|
-
var
|
|
4102
|
+
var nl = F(function({ children: e, className: t, defaultOpen: n = !1, isStreaming: r = !1, ...i }, a) {
|
|
4102
4103
|
return /* @__PURE__ */ U(s, {
|
|
4103
4104
|
defaultOpen: n,
|
|
4104
4105
|
asChild: !0,
|
|
@@ -4113,8 +4114,8 @@ var tl = F(function({ children: e, className: t, defaultOpen: n = !1, isStreamin
|
|
|
4113
4114
|
})
|
|
4114
4115
|
});
|
|
4115
4116
|
});
|
|
4116
|
-
|
|
4117
|
-
function
|
|
4117
|
+
nl.displayName = "ChatThinkingProcess";
|
|
4118
|
+
function rl({ children: e, className: t, ...n }) {
|
|
4118
4119
|
return /* @__PURE__ */ W(u, {
|
|
4119
4120
|
"data-slot": "chat-thinking-process-trigger",
|
|
4120
4121
|
"data-testid": "chat-thinking-process-trigger",
|
|
@@ -4123,7 +4124,7 @@ function nl({ children: e, className: t, ...n }) {
|
|
|
4123
4124
|
children: [e, /* @__PURE__ */ U("style", { children: "\n @keyframes shimmer {\n 100% {\n mask-position: left;\n }\n }\n " })]
|
|
4124
4125
|
});
|
|
4125
4126
|
}
|
|
4126
|
-
function
|
|
4127
|
+
function il({ children: e, className: t, ...n }) {
|
|
4127
4128
|
return /* @__PURE__ */ U("span", {
|
|
4128
4129
|
"data-slot": "chat-thinking-process-trigger-icon",
|
|
4129
4130
|
"data-testid": "chat-thinking-process-trigger-icon",
|
|
@@ -4132,7 +4133,7 @@ function rl({ children: e, className: t, ...n }) {
|
|
|
4132
4133
|
children: e
|
|
4133
4134
|
});
|
|
4134
4135
|
}
|
|
4135
|
-
function
|
|
4136
|
+
function al({ children: e, className: t, ...n }) {
|
|
4136
4137
|
return /* @__PURE__ */ U(M, {
|
|
4137
4138
|
asChild: !0,
|
|
4138
4139
|
variant: "body-small-low",
|
|
@@ -4145,7 +4146,7 @@ function il({ children: e, className: t, ...n }) {
|
|
|
4145
4146
|
})
|
|
4146
4147
|
});
|
|
4147
4148
|
}
|
|
4148
|
-
function
|
|
4149
|
+
function ol({ className: e, ...t }) {
|
|
4149
4150
|
return /* @__PURE__ */ U(c, {
|
|
4150
4151
|
"data-slot": "chat-thinking-process-trigger-arrow",
|
|
4151
4152
|
"data-testid": "chat-thinking-process-trigger-arrow",
|
|
@@ -4153,7 +4154,7 @@ function al({ className: e, ...t }) {
|
|
|
4153
4154
|
...t
|
|
4154
4155
|
});
|
|
4155
4156
|
}
|
|
4156
|
-
function
|
|
4157
|
+
function sl({ children: e, className: t, itemsClassName: n, previewClassName: r, hasLastMessagePreview: i = !0, ...a }) {
|
|
4157
4158
|
let { lastItemContent: o, lastItemIndex: s } = B(() => {
|
|
4158
4159
|
let t = _e.Children.toArray(e);
|
|
4159
4160
|
return {
|
|
@@ -4168,7 +4169,7 @@ function ol({ children: e, className: t, itemsClassName: n, previewClassName: r,
|
|
|
4168
4169
|
className: N("pl-[28px]", t),
|
|
4169
4170
|
children: [i && o && /* @__PURE__ */ U(mn, {
|
|
4170
4171
|
mode: "wait",
|
|
4171
|
-
children: /* @__PURE__ */ U(
|
|
4172
|
+
children: /* @__PURE__ */ U(cl, {
|
|
4172
4173
|
contentId: s,
|
|
4173
4174
|
className: r,
|
|
4174
4175
|
children: o
|
|
@@ -4182,7 +4183,7 @@ function ol({ children: e, className: t, itemsClassName: n, previewClassName: r,
|
|
|
4182
4183
|
})]
|
|
4183
4184
|
});
|
|
4184
4185
|
}
|
|
4185
|
-
function
|
|
4186
|
+
function cl({ children: e, className: t, contentId: n }) {
|
|
4186
4187
|
return /* @__PURE__ */ U(hn.div, {
|
|
4187
4188
|
"data-slot": "chat-thinking-process-content-preview",
|
|
4188
4189
|
"data-testid": "chat-thinking-process-content-preview",
|
|
@@ -4197,7 +4198,7 @@ function sl({ children: e, className: t, contentId: n }) {
|
|
|
4197
4198
|
children: e
|
|
4198
4199
|
}, n);
|
|
4199
4200
|
}
|
|
4200
|
-
function
|
|
4201
|
+
function ll({ children: e, className: t, ...n }) {
|
|
4201
4202
|
return /* @__PURE__ */ U(M, {
|
|
4202
4203
|
asChild: !0,
|
|
4203
4204
|
variant: "body-small-low",
|
|
@@ -4210,7 +4211,7 @@ function cl({ children: e, className: t, ...n }) {
|
|
|
4210
4211
|
})
|
|
4211
4212
|
});
|
|
4212
4213
|
}
|
|
4213
|
-
function
|
|
4214
|
+
function ul({ children: e, className: t, ...n }) {
|
|
4214
4215
|
return /* @__PURE__ */ U("span", {
|
|
4215
4216
|
"data-slot": "chat-thinking-process-content-item-icon",
|
|
4216
4217
|
"data-testid": "chat-thinking-process-content-item-icon",
|
|
@@ -4221,14 +4222,14 @@ function ll({ children: e, className: t, ...n }) {
|
|
|
4221
4222
|
}
|
|
4222
4223
|
//#endregion
|
|
4223
4224
|
//#region src/components/deprecated-empty-state.ts
|
|
4224
|
-
var
|
|
4225
|
+
var dl = f, fl = h, pl = g, ml = m, hl = p, gl = {
|
|
4225
4226
|
paragraph: "editor-paragraph",
|
|
4226
4227
|
text: {
|
|
4227
4228
|
bold: "editor-text-bold",
|
|
4228
4229
|
italic: "editor-text-italic",
|
|
4229
4230
|
underline: "editor-text-underline"
|
|
4230
4231
|
}
|
|
4231
|
-
},
|
|
4232
|
+
}, _l = class e extends ot {
|
|
4232
4233
|
__src;
|
|
4233
4234
|
__altText;
|
|
4234
4235
|
static getType() {
|
|
@@ -4266,7 +4267,7 @@ var ul = f, dl = h, fl = g, pl = m, ml = p, hl = {
|
|
|
4266
4267
|
return { img: () => ({
|
|
4267
4268
|
conversion: (e) => {
|
|
4268
4269
|
let t = e.getAttribute("src") || "", n = e.getAttribute("alt") || "";
|
|
4269
|
-
return t ? { node:
|
|
4270
|
+
return t ? { node: vl(t, n) } : null;
|
|
4270
4271
|
},
|
|
4271
4272
|
priority: 0
|
|
4272
4273
|
}) };
|
|
@@ -4281,21 +4282,21 @@ var ul = f, dl = h, fl = g, pl = m, ml = p, hl = {
|
|
|
4281
4282
|
};
|
|
4282
4283
|
}
|
|
4283
4284
|
static importJSON(e) {
|
|
4284
|
-
return
|
|
4285
|
+
return vl(e.src, e.altText);
|
|
4285
4286
|
}
|
|
4286
4287
|
isInline() {
|
|
4287
4288
|
return !1;
|
|
4288
4289
|
}
|
|
4289
4290
|
};
|
|
4290
|
-
function
|
|
4291
|
-
return new
|
|
4291
|
+
function vl(e, t) {
|
|
4292
|
+
return new _l(e, t);
|
|
4292
4293
|
}
|
|
4293
|
-
function
|
|
4294
|
-
return e instanceof
|
|
4294
|
+
function yl(e) {
|
|
4295
|
+
return e instanceof _l;
|
|
4295
4296
|
}
|
|
4296
4297
|
//#endregion
|
|
4297
4298
|
//#region src/components/rich-text-area/transformers.ts
|
|
4298
|
-
function
|
|
4299
|
+
function bl(e) {
|
|
4299
4300
|
let t = /font-size\s*:\s*([^;]+)/i, n = /font-family\s*:\s*([^;]+)/i, r = /(?<![\w-])color\s*:\s*([^;]+)/i, i = t.exec(e), a = n.exec(e), o = r.exec(e);
|
|
4300
4301
|
return {
|
|
4301
4302
|
fontSize: i ? i[1].trim() : null,
|
|
@@ -4303,7 +4304,7 @@ function yl(e) {
|
|
|
4303
4304
|
color: o ? o[1].trim() : null
|
|
4304
4305
|
};
|
|
4305
4306
|
}
|
|
4306
|
-
var
|
|
4307
|
+
var xl = {
|
|
4307
4308
|
type: "text-match",
|
|
4308
4309
|
trigger: "",
|
|
4309
4310
|
regExp: /./,
|
|
@@ -4311,14 +4312,14 @@ var bl = {
|
|
|
4311
4312
|
dependencies: [],
|
|
4312
4313
|
export: (e) => {
|
|
4313
4314
|
if (!Y(e)) return null;
|
|
4314
|
-
let t = e.getStyle() ?? "", n = e.getTextContent(), r =
|
|
4315
|
+
let t = e.getStyle() ?? "", n = e.getTextContent(), r = bl(t);
|
|
4315
4316
|
if (r.fontSize || r.fontFamily || r.color) {
|
|
4316
4317
|
let e = "";
|
|
4317
4318
|
return r.fontSize && (e += `font-size: ${r.fontSize};`), r.fontFamily && (e += `font-family: ${r.fontFamily};`), r.color && (e += `color: ${r.color};`), `<span style="${e}">${n}</span>`;
|
|
4318
4319
|
}
|
|
4319
4320
|
return null;
|
|
4320
4321
|
}
|
|
4321
|
-
},
|
|
4322
|
+
}, Sl = {
|
|
4322
4323
|
type: "text-match",
|
|
4323
4324
|
trigger: "",
|
|
4324
4325
|
regExp: /<span\s+style="([^"]+)">(.+?)<\/span>/,
|
|
@@ -4328,7 +4329,7 @@ var bl = {
|
|
|
4328
4329
|
let [, n, r] = t, i = Ye(r);
|
|
4329
4330
|
return i.setFormat(e.getFormat()), i.setStyle(n), e.replace(i), i;
|
|
4330
4331
|
}
|
|
4331
|
-
},
|
|
4332
|
+
}, Cl = {
|
|
4332
4333
|
type: "text-match",
|
|
4333
4334
|
trigger: "",
|
|
4334
4335
|
regExp: /<ins>(.*?)<\/ins>/,
|
|
@@ -4339,15 +4340,15 @@ var bl = {
|
|
|
4339
4340
|
return n.setFormat(e.getFormat()), n.hasFormat("underline") || n.toggleFormat("underline"), e.replace(n), n;
|
|
4340
4341
|
},
|
|
4341
4342
|
export: (e) => !Y(e) || !e.hasFormat("underline") ? null : `<ins>${e.getTextContent()}</ins>`
|
|
4342
|
-
},
|
|
4343
|
+
}, wl = (e) => {
|
|
4343
4344
|
let t = /text-align:\s*(\w+)/i.exec(e);
|
|
4344
4345
|
return t ? t[1].trim() : null;
|
|
4345
|
-
},
|
|
4346
|
+
}, Tl = {
|
|
4346
4347
|
type: "element",
|
|
4347
4348
|
dependencies: [],
|
|
4348
4349
|
regExp: /<div\s+style="([^"]+)">(.*?)<\/div>/,
|
|
4349
4350
|
replace: (e, t, n) => {
|
|
4350
|
-
let r =
|
|
4351
|
+
let r = wl(n[1]);
|
|
4351
4352
|
if (!r) return !1;
|
|
4352
4353
|
if (!n[2]) return;
|
|
4353
4354
|
let i = t[0];
|
|
@@ -4358,39 +4359,39 @@ var bl = {
|
|
|
4358
4359
|
let n = e.getFormatType();
|
|
4359
4360
|
return !n || n === "left" ? null : `<div style="text-align: ${n}">${t(e)}</div>`;
|
|
4360
4361
|
}
|
|
4361
|
-
},
|
|
4362
|
+
}, El = {
|
|
4362
4363
|
type: "text-match",
|
|
4363
4364
|
trigger: "",
|
|
4364
4365
|
regExp: /./,
|
|
4365
4366
|
importRegExp: /./,
|
|
4366
|
-
dependencies: [
|
|
4367
|
-
export: (e) =>
|
|
4368
|
-
},
|
|
4367
|
+
dependencies: [_l],
|
|
4368
|
+
export: (e) => yl(e) ? `<img src="${e.__src}" alt="${e.__altText}" />` : null
|
|
4369
|
+
}, Dl = {
|
|
4369
4370
|
type: "text-match",
|
|
4370
4371
|
trigger: "",
|
|
4371
4372
|
regExp: /<img\s+src="([^"]+)"\s+alt="([^"]*)"[^>]*\/?>/,
|
|
4372
4373
|
importRegExp: /<img\s+src="([^"]+)"\s+alt="([^"]*)"[^>]*\/?>/,
|
|
4373
|
-
dependencies: [
|
|
4374
|
+
dependencies: [_l],
|
|
4374
4375
|
replace: (e, t) => {
|
|
4375
|
-
let [, n, r] = t, i =
|
|
4376
|
+
let [, n, r] = t, i = vl(n, r);
|
|
4376
4377
|
e.replace(i);
|
|
4377
4378
|
}
|
|
4378
|
-
},
|
|
4379
|
-
...Ge,
|
|
4380
|
-
bl,
|
|
4381
|
-
Sl,
|
|
4382
|
-
wl,
|
|
4383
|
-
Tl
|
|
4384
|
-
], Ol = [
|
|
4379
|
+
}, Ol = [
|
|
4385
4380
|
...Ge,
|
|
4386
4381
|
xl,
|
|
4387
|
-
|
|
4388
|
-
|
|
4382
|
+
Cl,
|
|
4383
|
+
Tl,
|
|
4389
4384
|
El
|
|
4385
|
+
], kl = [
|
|
4386
|
+
...Ge,
|
|
4387
|
+
Sl,
|
|
4388
|
+
Cl,
|
|
4389
|
+
Tl,
|
|
4390
|
+
Dl
|
|
4390
4391
|
];
|
|
4391
4392
|
//#endregion
|
|
4392
4393
|
//#region src/components/rich-text-area/html-config.ts
|
|
4393
|
-
function
|
|
4394
|
+
function Al(e) {
|
|
4394
4395
|
let t = e.nodeName.toLowerCase();
|
|
4395
4396
|
if (t !== "h1" && t !== "h2" && t !== "h3" && t !== "h4" && t !== "h5" && t !== "h6") return null;
|
|
4396
4397
|
let n = Re(t), r = e.getAttribute("style") ?? "";
|
|
@@ -4400,22 +4401,22 @@ function kl(e) {
|
|
|
4400
4401
|
}
|
|
4401
4402
|
return { node: n };
|
|
4402
4403
|
}
|
|
4403
|
-
function
|
|
4404
|
+
function jl(e) {
|
|
4404
4405
|
if (e.getAttribute("__lexicallisttype") === "check" || e.classList.contains("contains-task-list")) return !0;
|
|
4405
4406
|
for (let t of e.childNodes) if (gt(t) && t.hasAttribute("aria-checked")) return !0;
|
|
4406
4407
|
return !1;
|
|
4407
4408
|
}
|
|
4408
|
-
function
|
|
4409
|
+
function Ml(e) {
|
|
4409
4410
|
let t = e.nodeName.toLowerCase(), n = null;
|
|
4410
4411
|
if (t === "ol") {
|
|
4411
4412
|
let t = e.start;
|
|
4412
4413
|
n = Ae("number", t);
|
|
4413
|
-
} else t === "ul" && (n =
|
|
4414
|
+
} else t === "ul" && (n = jl(e) ? Ae("check") : Ae("bullet"));
|
|
4414
4415
|
if (!n) return null;
|
|
4415
4416
|
let r = e.getAttribute("style") ?? "";
|
|
4416
4417
|
return n.setStyle(r), { node: n };
|
|
4417
4418
|
}
|
|
4418
|
-
function
|
|
4419
|
+
function Nl(e) {
|
|
4419
4420
|
if (e.classList.contains("task-list-item")) {
|
|
4420
4421
|
for (let t of e.children) if (t.tagName === "INPUT") {
|
|
4421
4422
|
let n = t;
|
|
@@ -4429,8 +4430,8 @@ function Ml(e) {
|
|
|
4429
4430
|
return n.setStyle(r), { node: n };
|
|
4430
4431
|
}
|
|
4431
4432
|
var Z = 4;
|
|
4432
|
-
function
|
|
4433
|
-
let { color: t, fontSize: n, fontFamily: r } =
|
|
4433
|
+
function Pl(e) {
|
|
4434
|
+
let { color: t, fontSize: n, fontFamily: r } = bl(e.getAttribute("style") ?? "");
|
|
4434
4435
|
if (!t && !n && !r) return null;
|
|
4435
4436
|
let i = e.style;
|
|
4436
4437
|
return {
|
|
@@ -4444,59 +4445,59 @@ function Nl(e) {
|
|
|
4444
4445
|
node: null
|
|
4445
4446
|
};
|
|
4446
4447
|
}
|
|
4447
|
-
var
|
|
4448
|
+
var Fl = {
|
|
4448
4449
|
h1: () => ({
|
|
4449
|
-
conversion:
|
|
4450
|
+
conversion: Al,
|
|
4450
4451
|
priority: Z
|
|
4451
4452
|
}),
|
|
4452
4453
|
h2: () => ({
|
|
4453
|
-
conversion:
|
|
4454
|
+
conversion: Al,
|
|
4454
4455
|
priority: Z
|
|
4455
4456
|
}),
|
|
4456
4457
|
h3: () => ({
|
|
4457
|
-
conversion:
|
|
4458
|
+
conversion: Al,
|
|
4458
4459
|
priority: Z
|
|
4459
4460
|
}),
|
|
4460
4461
|
h4: () => ({
|
|
4461
|
-
conversion:
|
|
4462
|
+
conversion: Al,
|
|
4462
4463
|
priority: Z
|
|
4463
4464
|
}),
|
|
4464
4465
|
h5: () => ({
|
|
4465
|
-
conversion:
|
|
4466
|
+
conversion: Al,
|
|
4466
4467
|
priority: Z
|
|
4467
4468
|
}),
|
|
4468
4469
|
h6: () => ({
|
|
4469
|
-
conversion:
|
|
4470
|
+
conversion: Al,
|
|
4470
4471
|
priority: Z
|
|
4471
4472
|
}),
|
|
4472
4473
|
ul: () => ({
|
|
4473
|
-
conversion:
|
|
4474
|
+
conversion: Ml,
|
|
4474
4475
|
priority: Z
|
|
4475
4476
|
}),
|
|
4476
4477
|
ol: () => ({
|
|
4477
|
-
conversion:
|
|
4478
|
+
conversion: Ml,
|
|
4478
4479
|
priority: Z
|
|
4479
4480
|
}),
|
|
4480
4481
|
li: () => ({
|
|
4481
|
-
conversion:
|
|
4482
|
+
conversion: Nl,
|
|
4482
4483
|
priority: Z
|
|
4483
4484
|
}),
|
|
4484
4485
|
span: () => ({
|
|
4485
|
-
conversion:
|
|
4486
|
+
conversion: Pl,
|
|
4486
4487
|
priority: Z
|
|
4487
4488
|
})
|
|
4488
4489
|
};
|
|
4489
|
-
function
|
|
4490
|
+
function Il(e) {
|
|
4490
4491
|
return (t, n) => {
|
|
4491
4492
|
let r = e.prototype.exportDOM.call(n, t), i = n.getStyle();
|
|
4492
4493
|
return r.element && i && r.element.setAttribute("style", i), r;
|
|
4493
4494
|
};
|
|
4494
4495
|
}
|
|
4495
|
-
var
|
|
4496
|
-
[ze,
|
|
4497
|
-
[Me,
|
|
4498
|
-
[je,
|
|
4499
|
-
]),
|
|
4496
|
+
var Ll = /* @__PURE__ */ new Map([
|
|
4497
|
+
[ze, Il(ze)],
|
|
4498
|
+
[Me, Il(Me)],
|
|
4499
|
+
[je, Il(je)]
|
|
4500
|
+
]), Rl = class e extends st {
|
|
4500
4501
|
static getType() {
|
|
4501
4502
|
return "div-block";
|
|
4502
4503
|
}
|
|
@@ -4513,7 +4514,7 @@ var Il = /* @__PURE__ */ new Map([
|
|
|
4513
4514
|
}
|
|
4514
4515
|
static importDOM() {
|
|
4515
4516
|
return { div: () => ({
|
|
4516
|
-
conversion:
|
|
4517
|
+
conversion: zl,
|
|
4517
4518
|
priority: 4
|
|
4518
4519
|
}) };
|
|
4519
4520
|
}
|
|
@@ -4525,7 +4526,7 @@ var Il = /* @__PURE__ */ new Map([
|
|
|
4525
4526
|
} : e;
|
|
4526
4527
|
}
|
|
4527
4528
|
static importJSON(e) {
|
|
4528
|
-
let t =
|
|
4529
|
+
let t = Bl().updateFromJSON(e);
|
|
4529
4530
|
return e.style !== void 0 && t.setStyle(e.style), t;
|
|
4530
4531
|
}
|
|
4531
4532
|
updateFromJSON(e) {
|
|
@@ -4544,26 +4545,26 @@ var Il = /* @__PURE__ */ new Map([
|
|
|
4544
4545
|
return !1;
|
|
4545
4546
|
}
|
|
4546
4547
|
};
|
|
4547
|
-
function
|
|
4548
|
-
let t =
|
|
4548
|
+
function zl(e) {
|
|
4549
|
+
let t = Bl(), n = e.getAttribute("style") ?? "";
|
|
4549
4550
|
if (t.setStyle(n), e.style) {
|
|
4550
4551
|
let n = e.style.textAlign;
|
|
4551
4552
|
(n === "left" || n === "right" || n === "center" || n === "justify" || n === "start" || n === "end") && t.setFormat(n), _t(e, t);
|
|
4552
4553
|
}
|
|
4553
4554
|
return { node: t };
|
|
4554
4555
|
}
|
|
4555
|
-
function
|
|
4556
|
-
return new
|
|
4556
|
+
function Bl() {
|
|
4557
|
+
return new Rl();
|
|
4557
4558
|
}
|
|
4558
4559
|
//#endregion
|
|
4559
4560
|
//#region src/components/rich-text-area/plugins/value-plugin.tsx
|
|
4560
|
-
var
|
|
4561
|
-
function
|
|
4561
|
+
var Vl = 50;
|
|
4562
|
+
function Hl({ onChange: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
4562
4563
|
let r = I((r, i, a) => {
|
|
4563
4564
|
if (!a.has("focus") && e) try {
|
|
4564
4565
|
r.read(() => {
|
|
4565
|
-
let r = t === "html" ? Sn(i) : Ue(
|
|
4566
|
-
n && (n.current.push(r), n.current.splice(0, n.current.length -
|
|
4566
|
+
let r = t === "html" ? Sn(i) : Ue(Ol);
|
|
4567
|
+
n && (n.current.push(r), n.current.splice(0, n.current.length - Vl)), e(r);
|
|
4567
4568
|
});
|
|
4568
4569
|
} catch {}
|
|
4569
4570
|
}, [
|
|
@@ -4579,7 +4580,7 @@ function Q() {
|
|
|
4579
4580
|
let [e] = Ve();
|
|
4580
4581
|
return e;
|
|
4581
4582
|
}
|
|
4582
|
-
function
|
|
4583
|
+
function Ul() {
|
|
4583
4584
|
let [e] = Ve();
|
|
4584
4585
|
return I(() => {
|
|
4585
4586
|
let t = "";
|
|
@@ -4590,7 +4591,7 @@ function Hl() {
|
|
|
4590
4591
|
}
|
|
4591
4592
|
//#endregion
|
|
4592
4593
|
//#region src/components/rich-text-area/plugins/disabled-plugin.tsx
|
|
4593
|
-
function
|
|
4594
|
+
function Wl({ isDisabled: e }) {
|
|
4594
4595
|
let t = Q();
|
|
4595
4596
|
return R(() => {
|
|
4596
4597
|
t.setEditable(!e);
|
|
@@ -4598,7 +4599,7 @@ function Ul({ isDisabled: e }) {
|
|
|
4598
4599
|
}
|
|
4599
4600
|
//#endregion
|
|
4600
4601
|
//#region src/components/rich-text-area/plugins/controlled-plugin.tsx
|
|
4601
|
-
function
|
|
4602
|
+
function Gl({ controlledRef: e }) {
|
|
4602
4603
|
let t = V(null);
|
|
4603
4604
|
return Ce(e, () => ({ focus: () => {
|
|
4604
4605
|
Promise.resolve().then(() => {
|
|
@@ -4608,11 +4609,11 @@ function Wl({ controlledRef: e }) {
|
|
|
4608
4609
|
}
|
|
4609
4610
|
//#endregion
|
|
4610
4611
|
//#region src/components/rich-text-area/utils/index.ts
|
|
4611
|
-
function
|
|
4612
|
+
function Kl(e) {
|
|
4612
4613
|
let t = e.getRootElement();
|
|
4613
4614
|
t && (t.scrollTop = t.scrollHeight);
|
|
4614
4615
|
}
|
|
4615
|
-
function
|
|
4616
|
+
function ql() {
|
|
4616
4617
|
let e = K().getLastDescendant();
|
|
4617
4618
|
if (e && Y(e)) {
|
|
4618
4619
|
let t = Je(), n = e.getTextContentSize();
|
|
@@ -4626,7 +4627,7 @@ function Kl() {
|
|
|
4626
4627
|
}
|
|
4627
4628
|
}
|
|
4628
4629
|
}
|
|
4629
|
-
function
|
|
4630
|
+
function Jl(e, t) {
|
|
4630
4631
|
let n = new DOMParser().parseFromString(t, "text/html");
|
|
4631
4632
|
return Cn(e, n).map((e) => {
|
|
4632
4633
|
if (Y(e)) {
|
|
@@ -4636,12 +4637,12 @@ function ql(e, t) {
|
|
|
4636
4637
|
return e;
|
|
4637
4638
|
});
|
|
4638
4639
|
}
|
|
4639
|
-
function
|
|
4640
|
+
function Yl(e, t) {
|
|
4640
4641
|
let n = K();
|
|
4641
|
-
n.clear(),
|
|
4642
|
+
n.clear(), Jl(e, t).forEach((e) => n.append(e));
|
|
4642
4643
|
}
|
|
4643
|
-
function
|
|
4644
|
-
let n = q(), r =
|
|
4644
|
+
function Xl(e, t) {
|
|
4645
|
+
let n = q(), r = Jl(e, t);
|
|
4645
4646
|
if (J(n)) n.insertNodes(r);
|
|
4646
4647
|
else {
|
|
4647
4648
|
let e = K();
|
|
@@ -4650,7 +4651,7 @@ function Yl(e, t) {
|
|
|
4650
4651
|
}
|
|
4651
4652
|
//#endregion
|
|
4652
4653
|
//#region src/components/rich-text-area/plugins/controlled-value-plugin.tsx
|
|
4653
|
-
function
|
|
4654
|
+
function Zl({ value: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
4654
4655
|
let r = Q(), i = V(), a = V(!!e?.trim()), o = me("desktop");
|
|
4655
4656
|
return R(() => {
|
|
4656
4657
|
if (!r || e === i.current) return;
|
|
@@ -4660,20 +4661,20 @@ function Xl({ value: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
|
4660
4661
|
}
|
|
4661
4662
|
let s = "";
|
|
4662
4663
|
if (r.getEditorState().read(() => {
|
|
4663
|
-
s = t === "html" ? Sn(r) : Ue(
|
|
4664
|
+
s = t === "html" ? Sn(r) : Ue(Ol);
|
|
4664
4665
|
}), e !== void 0 && e !== s) {
|
|
4665
4666
|
if (e === "") {
|
|
4666
4667
|
r.update(() => {
|
|
4667
|
-
Ke(ft), t === "html" ? K().clear() : He("",
|
|
4668
|
+
Ke(ft), t === "html" ? K().clear() : He("", kl), ql();
|
|
4668
4669
|
}, { discrete: !0 }), Promise.resolve().then(() => {
|
|
4669
4670
|
o ? r.focus() : r.blur();
|
|
4670
4671
|
});
|
|
4671
4672
|
return;
|
|
4672
4673
|
}
|
|
4673
4674
|
r.update(() => {
|
|
4674
|
-
Ke(ft), t === "html" ?
|
|
4675
|
+
Ke(ft), t === "html" ? Yl(r, e) : He(e, kl), ql();
|
|
4675
4676
|
}), a.current && (a.current = !1, Promise.resolve().then(() => {
|
|
4676
|
-
requestAnimationFrame(() =>
|
|
4677
|
+
requestAnimationFrame(() => Kl(r));
|
|
4677
4678
|
})), o && Promise.resolve().then(() => {
|
|
4678
4679
|
r.focus();
|
|
4679
4680
|
});
|
|
@@ -4688,7 +4689,7 @@ function Xl({ value: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
|
4688
4689
|
}
|
|
4689
4690
|
//#endregion
|
|
4690
4691
|
//#region src/components/rich-text-area/plugins/blur-plugin.tsx
|
|
4691
|
-
function
|
|
4692
|
+
function Ql({ onBlur: e }) {
|
|
4692
4693
|
let t = Q();
|
|
4693
4694
|
return R(() => {
|
|
4694
4695
|
if (!e) return;
|
|
@@ -4704,7 +4705,7 @@ function Zl({ onBlur: e }) {
|
|
|
4704
4705
|
}
|
|
4705
4706
|
//#endregion
|
|
4706
4707
|
//#region src/components/rich-text-area/plugins/focus-plugin.tsx
|
|
4707
|
-
function
|
|
4708
|
+
function $l({ onFocusChange: e }) {
|
|
4708
4709
|
let t = Q();
|
|
4709
4710
|
return R(() => {
|
|
4710
4711
|
if (!e) return;
|
|
@@ -4723,66 +4724,66 @@ function Ql({ onFocusChange: e }) {
|
|
|
4723
4724
|
}
|
|
4724
4725
|
//#endregion
|
|
4725
4726
|
//#region src/components/rich-text-area/plugins/image-drop-plugin.tsx
|
|
4726
|
-
var
|
|
4727
|
+
var eu = mt("INSERT_IMAGE_COMMAND"), tu = "helvetiq:insert-image", nu = class extends CustomEvent {
|
|
4727
4728
|
constructor(e) {
|
|
4728
|
-
super(
|
|
4729
|
+
super(tu, { detail: e });
|
|
4729
4730
|
}
|
|
4730
4731
|
};
|
|
4731
|
-
function
|
|
4732
|
+
function ru() {
|
|
4732
4733
|
let e = Q();
|
|
4733
|
-
return R(() => e.registerCommand(
|
|
4734
|
-
let e =
|
|
4734
|
+
return R(() => e.registerCommand(eu, (t) => (e.update(() => {
|
|
4735
|
+
let e = vl(t.src, t.altText);
|
|
4735
4736
|
Ze([e]);
|
|
4736
4737
|
}), !0), it), [e]), R(() => {
|
|
4737
4738
|
if (!e.getRootElement()) return;
|
|
4738
4739
|
function t(t) {
|
|
4739
4740
|
let n = t;
|
|
4740
|
-
e.dispatchCommand(
|
|
4741
|
+
e.dispatchCommand(eu, n.detail);
|
|
4741
4742
|
}
|
|
4742
|
-
return document.addEventListener(
|
|
4743
|
-
document.removeEventListener(
|
|
4743
|
+
return document.addEventListener(tu, t), () => {
|
|
4744
|
+
document.removeEventListener(tu, t);
|
|
4744
4745
|
};
|
|
4745
4746
|
}, [e]), null;
|
|
4746
4747
|
}
|
|
4747
4748
|
//#endregion
|
|
4748
4749
|
//#region src/components/rich-text-area/plugins/html-paste-plugin.tsx
|
|
4749
|
-
var
|
|
4750
|
+
var iu = mt("PASTE_HTML_COMMAND"), au = mt("INSERT_HTML_COMMAND"), ou = "helvetiq:paste-html", su = "helvetiq:insert-html", cu = class extends CustomEvent {
|
|
4750
4751
|
constructor(e) {
|
|
4751
|
-
super(
|
|
4752
|
+
super(ou, { detail: e });
|
|
4752
4753
|
}
|
|
4753
|
-
},
|
|
4754
|
+
}, lu = class extends CustomEvent {
|
|
4754
4755
|
constructor(e) {
|
|
4755
|
-
super(
|
|
4756
|
+
super(su, { detail: e });
|
|
4756
4757
|
}
|
|
4757
4758
|
};
|
|
4758
|
-
function
|
|
4759
|
+
function uu() {
|
|
4759
4760
|
let e = Q();
|
|
4760
|
-
return R(() => e.registerCommand(
|
|
4761
|
+
return R(() => e.registerCommand(iu, (t) => (e.update(() => {
|
|
4761
4762
|
let n = K();
|
|
4762
4763
|
n.clear();
|
|
4763
4764
|
let r = new DOMParser().parseFromString(t.html, "text/html"), i = Cn(e, r);
|
|
4764
4765
|
n.append(...i);
|
|
4765
|
-
}), !0), it), [e]), R(() => e.registerCommand(
|
|
4766
|
+
}), !0), it), [e]), R(() => e.registerCommand(au, (t) => (e.update(() => {
|
|
4766
4767
|
let n = new DOMParser().parseFromString(t.html, "text/html"), r = Cn(e, n);
|
|
4767
4768
|
Ze(r);
|
|
4768
4769
|
}), !0), it), [e]), R(() => {
|
|
4769
4770
|
if (!e.getRootElement()) return;
|
|
4770
4771
|
function t(t) {
|
|
4771
4772
|
let n = t;
|
|
4772
|
-
e.dispatchCommand(
|
|
4773
|
+
e.dispatchCommand(iu, n.detail);
|
|
4773
4774
|
}
|
|
4774
4775
|
function n(t) {
|
|
4775
4776
|
let n = t;
|
|
4776
|
-
e.dispatchCommand(
|
|
4777
|
+
e.dispatchCommand(au, n.detail);
|
|
4777
4778
|
}
|
|
4778
|
-
return document.addEventListener(
|
|
4779
|
-
document.removeEventListener(
|
|
4779
|
+
return document.addEventListener(ou, t), document.addEventListener(su, n), () => {
|
|
4780
|
+
document.removeEventListener(ou, t), document.removeEventListener(su, n);
|
|
4780
4781
|
};
|
|
4781
4782
|
}, [e]), null;
|
|
4782
4783
|
}
|
|
4783
4784
|
//#endregion
|
|
4784
4785
|
//#region src/components/rich-text-area/plugins/markdown-plain-paste-plugin.tsx
|
|
4785
|
-
function
|
|
4786
|
+
function du() {
|
|
4786
4787
|
let e = Q();
|
|
4787
4788
|
return R(() => e.registerCommand(ut, (t) => {
|
|
4788
4789
|
let { clipboardData: n } = t;
|
|
@@ -4804,10 +4805,10 @@ function uu() {
|
|
|
4804
4805
|
}
|
|
4805
4806
|
//#endregion
|
|
4806
4807
|
//#region src/components/rich-text-area/plugins/file-attachment-plugin.tsx
|
|
4807
|
-
var
|
|
4808
|
-
function
|
|
4808
|
+
var fu = mt("ATTACH_FILE_COMMAND");
|
|
4809
|
+
function pu({ acceptedFiles: e = [], isMultiple: t = !1, onFileAttach: n }) {
|
|
4809
4810
|
let r = Q(), i = V(null);
|
|
4810
|
-
R(() => r.registerCommand(
|
|
4811
|
+
R(() => r.registerCommand(fu, () => (i.current?.click(), !0), it), [r]);
|
|
4811
4812
|
function a(e) {
|
|
4812
4813
|
let r = Array.from(e.target.files ?? []);
|
|
4813
4814
|
if (t) n?.(r);
|
|
@@ -4829,18 +4830,18 @@ function fu({ acceptedFiles: e = [], isMultiple: t = !1, onFileAttach: n }) {
|
|
|
4829
4830
|
}
|
|
4830
4831
|
//#endregion
|
|
4831
4832
|
//#region src/components/rich-text-area/styled.tsx
|
|
4832
|
-
var
|
|
4833
|
+
var mu = F(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ U("div", {
|
|
4833
4834
|
ref: r,
|
|
4834
4835
|
className: N("w-full resize-none border-none outline-none bg-transparent font-[inherit] text-[inherit] flex items-center [&_.editor-paragraph]:m-0 [&_.editor-paragraph]:min-h-[26px] [&_.editor-text-bold]:font-bold [&_.editor-text-italic]:italic [&_.editor-text-underline]:underline", e),
|
|
4835
4836
|
...n,
|
|
4836
4837
|
children: t
|
|
4837
4838
|
}));
|
|
4838
|
-
|
|
4839
|
+
mu.displayName = "Wrapper";
|
|
4839
4840
|
//#endregion
|
|
4840
4841
|
//#region src/components/rich-text-area/rich-text-area.tsx
|
|
4841
|
-
var
|
|
4842
|
+
var hu = {
|
|
4842
4843
|
namespace: "helvetiq",
|
|
4843
|
-
theme:
|
|
4844
|
+
theme: gl,
|
|
4844
4845
|
editable: !0,
|
|
4845
4846
|
nodes: [
|
|
4846
4847
|
Me,
|
|
@@ -4849,25 +4850,25 @@ var mu = {
|
|
|
4849
4850
|
Be,
|
|
4850
4851
|
Te,
|
|
4851
4852
|
De,
|
|
4852
|
-
|
|
4853
|
-
|
|
4853
|
+
_l,
|
|
4854
|
+
Rl,
|
|
4854
4855
|
bn,
|
|
4855
4856
|
yn,
|
|
4856
4857
|
xn
|
|
4857
4858
|
],
|
|
4858
4859
|
html: {
|
|
4859
|
-
import:
|
|
4860
|
-
export:
|
|
4860
|
+
import: Fl,
|
|
4861
|
+
export: Ll
|
|
4861
4862
|
},
|
|
4862
4863
|
onError: (e) => {
|
|
4863
4864
|
console.error("Lexical error:", e);
|
|
4864
4865
|
}
|
|
4865
4866
|
};
|
|
4866
|
-
function
|
|
4867
|
+
function gu({ children: e, name: t, value: n, source: r = "markdown", className: i, containerClassName: a, placeholderClassName: o, placeholder: s = "", isDisabled: c = !1, onChange: l, onBlur: u, onKeyDown: d, onFocusChange: f, forwardedRef: p, ...m }) {
|
|
4867
4868
|
let h = V([]);
|
|
4868
4869
|
return /* @__PURE__ */ U(Ne, {
|
|
4869
|
-
initialConfig:
|
|
4870
|
-
children: /* @__PURE__ */ W(
|
|
4870
|
+
initialConfig: hu,
|
|
4871
|
+
children: /* @__PURE__ */ W(mu, {
|
|
4871
4872
|
"data-slot": "rich-text-area",
|
|
4872
4873
|
"data-testid": "rich-text-area",
|
|
4873
4874
|
"aria-disabled": c,
|
|
@@ -4898,36 +4899,36 @@ function hu({ children: e, name: t, value: n, source: r = "markdown", className:
|
|
|
4898
4899
|
}),
|
|
4899
4900
|
ErrorBoundary: Fe
|
|
4900
4901
|
}),
|
|
4901
|
-
/* @__PURE__ */ U(
|
|
4902
|
-
/* @__PURE__ */ U(
|
|
4902
|
+
/* @__PURE__ */ U(Wl, { isDisabled: c }),
|
|
4903
|
+
/* @__PURE__ */ U(Zl, {
|
|
4903
4904
|
value: n,
|
|
4904
4905
|
source: r,
|
|
4905
4906
|
emittedValuesRef: h
|
|
4906
4907
|
}),
|
|
4907
|
-
/* @__PURE__ */ U(
|
|
4908
|
+
/* @__PURE__ */ U(Hl, {
|
|
4908
4909
|
onChange: l,
|
|
4909
4910
|
source: r,
|
|
4910
4911
|
emittedValuesRef: h
|
|
4911
4912
|
}),
|
|
4912
|
-
/* @__PURE__ */ U(
|
|
4913
|
+
/* @__PURE__ */ U(Ql, { onBlur: u }),
|
|
4913
4914
|
/* @__PURE__ */ U(Ie, {}),
|
|
4914
|
-
/* @__PURE__ */ U(
|
|
4915
|
-
/* @__PURE__ */ U(
|
|
4915
|
+
/* @__PURE__ */ U(Gl, { controlledRef: p ?? null }),
|
|
4916
|
+
/* @__PURE__ */ U($l, { onFocusChange: f }),
|
|
4916
4917
|
/* @__PURE__ */ U(vn, {}),
|
|
4917
|
-
r === "markdown" && /* @__PURE__ */ U(
|
|
4918
|
+
r === "markdown" && /* @__PURE__ */ U(du, {}),
|
|
4918
4919
|
e
|
|
4919
4920
|
]
|
|
4920
4921
|
})
|
|
4921
4922
|
});
|
|
4922
4923
|
}
|
|
4923
|
-
var
|
|
4924
|
+
var _u = F((e, t) => /* @__PURE__ */ U(gu, {
|
|
4924
4925
|
...e,
|
|
4925
4926
|
forwardedRef: t
|
|
4926
4927
|
}));
|
|
4927
|
-
|
|
4928
|
+
_u.displayName = "RichTextArea";
|
|
4928
4929
|
//#endregion
|
|
4929
4930
|
//#region src/components/rich-text-field/constants.ts
|
|
4930
|
-
var
|
|
4931
|
+
var vu = "Arial, sans-serif", yu = [
|
|
4931
4932
|
{
|
|
4932
4933
|
value: "Arial, sans-serif",
|
|
4933
4934
|
label: "Arial"
|
|
@@ -4964,7 +4965,7 @@ var _u = "Arial, sans-serif", vu = [
|
|
|
4964
4965
|
value: "\"Brush Script MT\", cursive",
|
|
4965
4966
|
label: "Brush Script MT"
|
|
4966
4967
|
}
|
|
4967
|
-
],
|
|
4968
|
+
], bu = vu, xu = [
|
|
4968
4969
|
{
|
|
4969
4970
|
label: "10",
|
|
4970
4971
|
value: "10"
|
|
@@ -4993,10 +4994,10 @@ var _u = "Arial, sans-serif", vu = [
|
|
|
4993
4994
|
label: "48",
|
|
4994
4995
|
value: "48"
|
|
4995
4996
|
}
|
|
4996
|
-
],
|
|
4997
|
+
], Su = "left", Cu = "#000000";
|
|
4997
4998
|
//#endregion
|
|
4998
4999
|
//#region src/components/rich-text-field/components/toolbar-select.tsx
|
|
4999
|
-
function
|
|
5000
|
+
function wu({ className: e, selectItemClassName: t, ...n }) {
|
|
5000
5001
|
return /* @__PURE__ */ U(ue, {
|
|
5001
5002
|
fullWidth: !1,
|
|
5002
5003
|
size: "small",
|
|
@@ -5007,10 +5008,10 @@ function Cu({ className: e, selectItemClassName: t, ...n }) {
|
|
|
5007
5008
|
}
|
|
5008
5009
|
//#endregion
|
|
5009
5010
|
//#region src/components/rich-text-field/components/alignment-select.tsx
|
|
5010
|
-
function
|
|
5011
|
+
function Tu(e) {
|
|
5011
5012
|
return e === "center" || e === "right" ? e : e === "end" ? "right" : "left";
|
|
5012
5013
|
}
|
|
5013
|
-
var
|
|
5014
|
+
var Eu = {
|
|
5014
5015
|
left: {
|
|
5015
5016
|
label: "Left",
|
|
5016
5017
|
icon: /* @__PURE__ */ U(jt, { fontSize: "inherit" })
|
|
@@ -5024,8 +5025,8 @@ var Tu = {
|
|
|
5024
5025
|
icon: /* @__PURE__ */ U(Mt, { fontSize: "inherit" })
|
|
5025
5026
|
}
|
|
5026
5027
|
};
|
|
5027
|
-
function
|
|
5028
|
-
let t = Q(), [n, r] = H(
|
|
5028
|
+
function Du({ className: e }) {
|
|
5029
|
+
let t = Q(), [n, r] = H(Su), i = B(() => Object.entries(Eu).map(([e, { label: t, icon: n }]) => ({
|
|
5029
5030
|
value: e,
|
|
5030
5031
|
label: t,
|
|
5031
5032
|
icon: n
|
|
@@ -5033,7 +5034,7 @@ function Eu({ className: e }) {
|
|
|
5033
5034
|
let e = q();
|
|
5034
5035
|
if (J(e)) {
|
|
5035
5036
|
let t = e.anchor.getNode(), n = t.getParent(), i = Qe(t) ? t : n;
|
|
5036
|
-
Qe(i) && r(
|
|
5037
|
+
Qe(i) && r(Tu(i.getFormatType() || "left"));
|
|
5037
5038
|
}
|
|
5038
5039
|
}, []);
|
|
5039
5040
|
R(() => En(t.registerUpdateListener(({ editorState: e }) => {
|
|
@@ -5044,7 +5045,7 @@ function Eu({ className: e }) {
|
|
|
5044
5045
|
function o(e) {
|
|
5045
5046
|
t.dispatchCommand(ct, e);
|
|
5046
5047
|
}
|
|
5047
|
-
return /* @__PURE__ */ U(
|
|
5048
|
+
return /* @__PURE__ */ U(wu, {
|
|
5048
5049
|
shouldShowOnlyIcon: !0,
|
|
5049
5050
|
options: i,
|
|
5050
5051
|
value: n,
|
|
@@ -5067,10 +5068,10 @@ function $({ className: e, children: t, isActive: n, isDisabled: r = !1, ...i })
|
|
|
5067
5068
|
}
|
|
5068
5069
|
//#endregion
|
|
5069
5070
|
//#region src/components/rich-text-field/components/attachment-button.tsx
|
|
5070
|
-
function
|
|
5071
|
+
function Ou(e) {
|
|
5071
5072
|
let t = Q();
|
|
5072
5073
|
function n() {
|
|
5073
|
-
t.dispatchCommand(
|
|
5074
|
+
t.dispatchCommand(fu, void 0);
|
|
5074
5075
|
}
|
|
5075
5076
|
return /* @__PURE__ */ U($, {
|
|
5076
5077
|
"data-testid": "attachment-button",
|
|
@@ -5082,76 +5083,76 @@ function Du(e) {
|
|
|
5082
5083
|
}
|
|
5083
5084
|
//#endregion
|
|
5084
5085
|
//#region src/components/rich-text-field/utils.ts
|
|
5085
|
-
function
|
|
5086
|
+
function ku(e) {
|
|
5086
5087
|
let t;
|
|
5087
5088
|
for (let n of jn(e, { silent: !0 })) n.type === "declaration" && n.value && (t ||= {}, t[n.property] = n.value);
|
|
5088
|
-
return t ||
|
|
5089
|
-
}
|
|
5090
|
-
var ku = Object.freeze({});
|
|
5091
|
-
function Au(e) {
|
|
5092
|
-
return typeof e == "string" ? Ou(e) : ku;
|
|
5089
|
+
return t || Au;
|
|
5093
5090
|
}
|
|
5091
|
+
var Au = Object.freeze({});
|
|
5094
5092
|
function ju(e) {
|
|
5093
|
+
return typeof e == "string" ? ku(e) : Au;
|
|
5094
|
+
}
|
|
5095
|
+
function Mu(e) {
|
|
5095
5096
|
let t = [];
|
|
5096
5097
|
for (let [n, r] of Object.entries(e)) n && r && t.push(`${n}: ${r};`);
|
|
5097
5098
|
return t.sort().join(" ");
|
|
5098
5099
|
}
|
|
5099
|
-
function
|
|
5100
|
+
function Nu(e, t) {
|
|
5100
5101
|
return e === t || !e && !t;
|
|
5101
5102
|
}
|
|
5102
|
-
function
|
|
5103
|
+
function Pu(e, t) {
|
|
5103
5104
|
if (e === t) return !0;
|
|
5104
|
-
for (let n in e) if (!(n in t &&
|
|
5105
|
+
for (let n in e) if (!(n in t && Nu(e[n], t[n]))) return !1;
|
|
5105
5106
|
for (let n in t) if (!(n in e)) return !1;
|
|
5106
5107
|
return !0;
|
|
5107
5108
|
}
|
|
5108
|
-
var
|
|
5109
|
-
isEqual:
|
|
5110
|
-
parse:
|
|
5111
|
-
unparse:
|
|
5109
|
+
var Fu = ht("style", {
|
|
5110
|
+
isEqual: Pu,
|
|
5111
|
+
parse: ju,
|
|
5112
|
+
unparse: Mu
|
|
5112
5113
|
});
|
|
5113
|
-
function Fu(e, t) {
|
|
5114
|
-
return nt(e, Pu, t);
|
|
5115
|
-
}
|
|
5116
5114
|
function Iu(e, t) {
|
|
5117
|
-
return e
|
|
5115
|
+
return nt(e, Fu, t);
|
|
5116
|
+
}
|
|
5117
|
+
function Lu(e, t) {
|
|
5118
|
+
return e === Au || e === t ? t : {
|
|
5118
5119
|
...e,
|
|
5119
5120
|
...t
|
|
5120
5121
|
};
|
|
5121
5122
|
}
|
|
5122
5123
|
mt("PATCH_TEXT_STYLE_COMMAND");
|
|
5123
|
-
function
|
|
5124
|
+
function Ru(e) {
|
|
5124
5125
|
let t = q();
|
|
5125
5126
|
if (!t) {
|
|
5126
5127
|
let e = Xe();
|
|
5127
5128
|
if (!e) return !1;
|
|
5128
5129
|
t = e.clone(), tt(t);
|
|
5129
5130
|
}
|
|
5130
|
-
let n = typeof e == "function" ? e : (t) =>
|
|
5131
|
+
let n = typeof e == "function" ? e : (t) => Lu(t, e);
|
|
5131
5132
|
if (J(t) && t.isCollapsed()) {
|
|
5132
5133
|
let e = t.focus.getNode();
|
|
5133
|
-
Y(e) &&
|
|
5134
|
-
} else Dn((e) =>
|
|
5134
|
+
Y(e) && Iu(e, n);
|
|
5135
|
+
} else Dn((e) => Iu(e, n));
|
|
5135
5136
|
return !0;
|
|
5136
5137
|
}
|
|
5137
|
-
function
|
|
5138
|
+
function zu(e) {
|
|
5138
5139
|
let t = e.anchor, n = e.focus, r = e.anchor.getNode(), i = e.focus.getNode();
|
|
5139
5140
|
return r === i ? r : e.isBackward() ? kn(n) ? r : i : kn(t) ? r : i;
|
|
5140
5141
|
}
|
|
5141
|
-
var
|
|
5142
|
+
var Bu = (e, t, n, r) => {
|
|
5142
5143
|
e.update(() => {
|
|
5143
5144
|
if (r && Ke(ft), e.isEditable()) {
|
|
5144
5145
|
let e = q();
|
|
5145
5146
|
e !== null && An(e, { "font-size": t + "px" });
|
|
5146
5147
|
}
|
|
5147
5148
|
});
|
|
5148
|
-
},
|
|
5149
|
-
function
|
|
5150
|
-
let e = L(
|
|
5149
|
+
}, Vu = (e) => e.startsWith("http") ? e : `https://${e}`, Hu = P(null);
|
|
5150
|
+
function Uu() {
|
|
5151
|
+
let e = L(Hu);
|
|
5151
5152
|
if (!e) throw Error("\"useRichTextFieldContext\" must be used within a RichTextFieldContextProvider");
|
|
5152
5153
|
return e;
|
|
5153
5154
|
}
|
|
5154
|
-
function
|
|
5155
|
+
function Wu(e) {
|
|
5155
5156
|
let t = e.trim(), n = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);
|
|
5156
5157
|
if (n) {
|
|
5157
5158
|
let e = n[1];
|
|
@@ -5166,18 +5167,18 @@ function Uu(e) {
|
|
|
5166
5167
|
let e = (e) => Math.max(0, Math.min(255, e)), [t, n, i] = r.slice(1, 4).map((t) => e(Number.parseInt(t, 10))), a = (e) => e.toString(16).padStart(2, "0");
|
|
5167
5168
|
return `#${a(t)}${a(n)}${a(i)}`;
|
|
5168
5169
|
}
|
|
5169
|
-
return
|
|
5170
|
+
return Cu;
|
|
5170
5171
|
}
|
|
5171
|
-
function
|
|
5172
|
-
let t = Q(), [n, r] = H(
|
|
5172
|
+
function Gu({ children: e }) {
|
|
5173
|
+
let t = Q(), [n, r] = H(bu), [i, a] = H("16"), [o, s] = H(!1), [c, l] = H(!1), [u, d] = H(!1), [f, p] = H(Cu), [m, h] = H(!1), g = I(() => {
|
|
5173
5174
|
let e = q();
|
|
5174
5175
|
if (J(e)) {
|
|
5175
|
-
r(On(e, "font-family",
|
|
5176
|
+
r(On(e, "font-family", bu));
|
|
5176
5177
|
let t = On(e, "font-size", "16px");
|
|
5177
5178
|
a(t ? t.replace("px", "") : "16"), s(e.hasFormat("bold")), l(e.hasFormat("italic")), d(e.hasFormat("underline"));
|
|
5178
5179
|
let n = On(e, "color", "#000000") || "#000000";
|
|
5179
|
-
p(
|
|
5180
|
-
let i =
|
|
5180
|
+
p(Wu(n));
|
|
5181
|
+
let i = zu(e), o = i.getParent(), c = Ee(o) || Ee(i);
|
|
5181
5182
|
h(c);
|
|
5182
5183
|
}
|
|
5183
5184
|
}, []);
|
|
@@ -5193,7 +5194,7 @@ function Wu({ children: e }) {
|
|
|
5193
5194
|
t !== null && An(t, { "font-family": e });
|
|
5194
5195
|
});
|
|
5195
5196
|
}, [t]), v = I((e) => {
|
|
5196
|
-
|
|
5197
|
+
Bu(t, e, null, !1);
|
|
5197
5198
|
}, [t]), y = I(() => {
|
|
5198
5199
|
t.dispatchCommand(lt, "bold");
|
|
5199
5200
|
}, [t]), b = I(() => {
|
|
@@ -5207,7 +5208,7 @@ function Wu({ children: e }) {
|
|
|
5207
5208
|
t !== null && An(t, { color: e });
|
|
5208
5209
|
});
|
|
5209
5210
|
}, [t]), C = I(() => {
|
|
5210
|
-
m ? (h(!1), t.dispatchCommand(Oe, null)) : (h(!0), t.dispatchCommand(Oe,
|
|
5211
|
+
m ? (h(!1), t.dispatchCommand(Oe, null)) : (h(!0), t.dispatchCommand(Oe, Vu("https://")));
|
|
5211
5212
|
}, [m, h]), ee = B(() => ({
|
|
5212
5213
|
fontFamily: n,
|
|
5213
5214
|
fontSize: i,
|
|
@@ -5239,15 +5240,15 @@ function Wu({ children: e }) {
|
|
|
5239
5240
|
x,
|
|
5240
5241
|
C
|
|
5241
5242
|
]);
|
|
5242
|
-
return /* @__PURE__ */ U(
|
|
5243
|
+
return /* @__PURE__ */ U(Hu.Provider, {
|
|
5243
5244
|
value: ee,
|
|
5244
5245
|
children: e
|
|
5245
5246
|
});
|
|
5246
5247
|
}
|
|
5247
5248
|
//#endregion
|
|
5248
5249
|
//#region src/components/rich-text-field/components/bold-button.tsx
|
|
5249
|
-
function
|
|
5250
|
-
let { isBold: t, onBold: n } =
|
|
5250
|
+
function Ku({ ...e }) {
|
|
5251
|
+
let { isBold: t, onBold: n } = Uu();
|
|
5251
5252
|
return /* @__PURE__ */ U($, {
|
|
5252
5253
|
"data-testid": "bold-button",
|
|
5253
5254
|
"aria-label": "Format Bold",
|
|
@@ -5259,12 +5260,12 @@ function Gu({ ...e }) {
|
|
|
5259
5260
|
}
|
|
5260
5261
|
//#endregion
|
|
5261
5262
|
//#region src/components/rich-text-field/components/clean-format-button.tsx
|
|
5262
|
-
function
|
|
5263
|
+
function qu({ ...e }) {
|
|
5263
5264
|
let t = Q(), n = I(() => {
|
|
5264
5265
|
t.update(() => {
|
|
5265
5266
|
let e = q();
|
|
5266
5267
|
if (J(e)) {
|
|
5267
|
-
|
|
5268
|
+
Ru(() => Au);
|
|
5268
5269
|
for (let t of e.extract()) Y(t) && (t.setFormat(0), t.setStyle(""), Tn(t).setFormat(""));
|
|
5269
5270
|
}
|
|
5270
5271
|
});
|
|
@@ -5279,7 +5280,7 @@ function Ku({ ...e }) {
|
|
|
5279
5280
|
}
|
|
5280
5281
|
//#endregion
|
|
5281
5282
|
//#region src/components/rich-text-field/components/image-button.tsx
|
|
5282
|
-
function
|
|
5283
|
+
function Ju({ ...e }) {
|
|
5283
5284
|
return /* @__PURE__ */ U($, {
|
|
5284
5285
|
"data-testid": "image-button",
|
|
5285
5286
|
"aria-label": "Add Image",
|
|
@@ -5289,8 +5290,8 @@ function qu({ ...e }) {
|
|
|
5289
5290
|
}
|
|
5290
5291
|
//#endregion
|
|
5291
5292
|
//#region src/components/rich-text-field/components/italic-button.tsx
|
|
5292
|
-
function
|
|
5293
|
-
let { isItalic: t, onItalic: n } =
|
|
5293
|
+
function Yu({ ...e }) {
|
|
5294
|
+
let { isItalic: t, onItalic: n } = Uu();
|
|
5294
5295
|
return /* @__PURE__ */ U($, {
|
|
5295
5296
|
"data-testid": "italic-button",
|
|
5296
5297
|
"aria-label": "Format Italics",
|
|
@@ -5302,7 +5303,7 @@ function Ju({ ...e }) {
|
|
|
5302
5303
|
}
|
|
5303
5304
|
//#endregion
|
|
5304
5305
|
//#region src/components/rich-text-field/components/link-button.tsx
|
|
5305
|
-
function
|
|
5306
|
+
function Xu({ isActive: e, ...t }) {
|
|
5306
5307
|
return /* @__PURE__ */ U($, {
|
|
5307
5308
|
"data-testid": "link-button",
|
|
5308
5309
|
"aria-label": "Add Link",
|
|
@@ -5312,9 +5313,9 @@ function Yu({ isActive: e, ...t }) {
|
|
|
5312
5313
|
}
|
|
5313
5314
|
//#endregion
|
|
5314
5315
|
//#region src/components/rich-text-field/components/size-select.tsx
|
|
5315
|
-
function
|
|
5316
|
-
let { fontSize: t, onFontSize: n } =
|
|
5317
|
-
return /* @__PURE__ */ U(
|
|
5316
|
+
function Zu({ className: e }) {
|
|
5317
|
+
let { fontSize: t, onFontSize: n } = Uu(), r = B(() => [...xu], []);
|
|
5318
|
+
return /* @__PURE__ */ U(wu, {
|
|
5318
5319
|
"data-testid": "size-select",
|
|
5319
5320
|
options: r,
|
|
5320
5321
|
value: t,
|
|
@@ -5324,8 +5325,8 @@ function Xu({ className: e }) {
|
|
|
5324
5325
|
}
|
|
5325
5326
|
//#endregion
|
|
5326
5327
|
//#region src/components/rich-text-field/components/text-color-button.tsx
|
|
5327
|
-
function
|
|
5328
|
-
let { textColor: n, onTextColor: r } =
|
|
5328
|
+
function Qu({ wrapperClassName: e, ...t }) {
|
|
5329
|
+
let { textColor: n, onTextColor: r } = Uu(), i = n === Cu;
|
|
5329
5330
|
function a(e) {
|
|
5330
5331
|
r(e.target.value);
|
|
5331
5332
|
}
|
|
@@ -5359,9 +5360,9 @@ function Zu({ wrapperClassName: e, ...t }) {
|
|
|
5359
5360
|
}
|
|
5360
5361
|
//#endregion
|
|
5361
5362
|
//#region src/components/rich-text-field/components/typography-select.tsx
|
|
5362
|
-
function
|
|
5363
|
-
let { fontFamily: t, onFontFamily: n } =
|
|
5364
|
-
return /* @__PURE__ */ U(
|
|
5363
|
+
function $u({ className: e }) {
|
|
5364
|
+
let { fontFamily: t, onFontFamily: n } = Uu(), r = B(() => [...yu], []);
|
|
5365
|
+
return /* @__PURE__ */ U(wu, {
|
|
5365
5366
|
"data-testid": "typography-select",
|
|
5366
5367
|
options: r,
|
|
5367
5368
|
value: t,
|
|
@@ -5371,8 +5372,8 @@ function Qu({ className: e }) {
|
|
|
5371
5372
|
}
|
|
5372
5373
|
//#endregion
|
|
5373
5374
|
//#region src/components/rich-text-field/components/underline-button.tsx
|
|
5374
|
-
function
|
|
5375
|
-
let { isUnderline: t, onUnderline: n } =
|
|
5375
|
+
function ed({ ...e }) {
|
|
5376
|
+
let { isUnderline: t, onUnderline: n } = Uu();
|
|
5376
5377
|
return /* @__PURE__ */ U($, {
|
|
5377
5378
|
"data-testid": "underline-button",
|
|
5378
5379
|
"aria-label": "Format Underline",
|
|
@@ -5384,24 +5385,24 @@ function $u({ ...e }) {
|
|
|
5384
5385
|
}
|
|
5385
5386
|
//#endregion
|
|
5386
5387
|
//#region src/components/rich-text-field/components/formatting-toolbar-plugin.tsx
|
|
5387
|
-
var
|
|
5388
|
-
/* @__PURE__ */ U(Qu, {}),
|
|
5389
|
-
/* @__PURE__ */ U(Xu, {}),
|
|
5390
|
-
/* @__PURE__ */ U(d, { orientation: "vertical" }),
|
|
5391
|
-
/* @__PURE__ */ U(Gu, {}),
|
|
5392
|
-
/* @__PURE__ */ U(Ju, {}),
|
|
5388
|
+
var td = ({ hasAttachments: e }) => /* @__PURE__ */ W(we, { children: [
|
|
5393
5389
|
/* @__PURE__ */ U($u, {}),
|
|
5394
5390
|
/* @__PURE__ */ U(Zu, {}),
|
|
5395
5391
|
/* @__PURE__ */ U(d, { orientation: "vertical" }),
|
|
5396
|
-
/* @__PURE__ */ U(
|
|
5397
|
-
/* @__PURE__ */ U(
|
|
5398
|
-
/* @__PURE__ */ U(
|
|
5392
|
+
/* @__PURE__ */ U(Ku, {}),
|
|
5393
|
+
/* @__PURE__ */ U(Yu, {}),
|
|
5394
|
+
/* @__PURE__ */ U(ed, {}),
|
|
5395
|
+
/* @__PURE__ */ U(Qu, {}),
|
|
5396
|
+
/* @__PURE__ */ U(d, { orientation: "vertical" }),
|
|
5397
|
+
/* @__PURE__ */ U(Xu, { isDisabled: !0 }),
|
|
5398
|
+
/* @__PURE__ */ U(Ou, { isDisabled: !e }),
|
|
5399
|
+
/* @__PURE__ */ U(Ju, { isDisabled: !0 }),
|
|
5399
5400
|
/* @__PURE__ */ U(d, { orientation: "vertical" }),
|
|
5400
|
-
/* @__PURE__ */ U(
|
|
5401
|
+
/* @__PURE__ */ U(Du, {}),
|
|
5401
5402
|
/* @__PURE__ */ U(d, { orientation: "vertical" }),
|
|
5402
|
-
/* @__PURE__ */ U(
|
|
5403
|
+
/* @__PURE__ */ U(qu, {})
|
|
5403
5404
|
] });
|
|
5404
|
-
function
|
|
5405
|
+
function nd({ className: e, children: t = td, hasAttachments: n = !1 }) {
|
|
5405
5406
|
return /* @__PURE__ */ U("div", {
|
|
5406
5407
|
"data-testid": "formatting-toolbar",
|
|
5407
5408
|
"data-slot": "rich-text-field-toolbar",
|
|
@@ -5411,9 +5412,9 @@ function td({ className: e, children: t = ed, hasAttachments: n = !1 }) {
|
|
|
5411
5412
|
}
|
|
5412
5413
|
//#endregion
|
|
5413
5414
|
//#region src/components/rich-text-field/rich-text-field.tsx
|
|
5414
|
-
var
|
|
5415
|
+
var rd = F(({ children: e, className: t, placeholderClassName: n, containerClassName: r, toolbarPlacement: i = "top", toolbarChildren: a, toolbarClassName: o, isMultipleAttachments: s, enableAttachments: c, acceptedFiles: l, onFileAttach: u, ...d }, f) => {
|
|
5415
5416
|
let p = i === "top";
|
|
5416
|
-
return /* @__PURE__ */ W(
|
|
5417
|
+
return /* @__PURE__ */ W(_u, {
|
|
5417
5418
|
ref: f,
|
|
5418
5419
|
"data-testid": "rich-text-field",
|
|
5419
5420
|
"data-slot": "rich-text-field",
|
|
@@ -5422,21 +5423,21 @@ var nd = F(({ children: e, className: t, placeholderClassName: n, containerClass
|
|
|
5422
5423
|
containerClassName: N("h-rich-text-field-height", "rounded-rich-text-field-toolbar", p ? "pt-rich-text-field-toolbar-height" : "pb-rich-text-field-toolbar-height", r),
|
|
5423
5424
|
className: N("p-rich-text-field-editor-padding", "bg-rich-text-field-background", "size-full", t),
|
|
5424
5425
|
...d,
|
|
5425
|
-
children: [/* @__PURE__ */ U(
|
|
5426
|
+
children: [/* @__PURE__ */ U(Gu, { children: /* @__PURE__ */ U(nd, {
|
|
5426
5427
|
hasAttachments: c,
|
|
5427
5428
|
className: N("absolute right-0 w-full", p ? "top-0" : "bottom-0", o),
|
|
5428
5429
|
children: a
|
|
5429
|
-
}) }), /* @__PURE__ */ U(
|
|
5430
|
+
}) }), /* @__PURE__ */ U(pu, {
|
|
5430
5431
|
acceptedFiles: l,
|
|
5431
5432
|
onFileAttach: u,
|
|
5432
5433
|
isMultiple: s
|
|
5433
5434
|
})]
|
|
5434
5435
|
});
|
|
5435
5436
|
});
|
|
5436
|
-
|
|
5437
|
+
rd.displayName = "RichTextField";
|
|
5437
5438
|
//#endregion
|
|
5438
5439
|
//#region src/components/topmenu/topmenu.tsx
|
|
5439
|
-
var
|
|
5440
|
+
var id = Mn("flex shrink-0 items-center justify-end", {
|
|
5440
5441
|
variants: {
|
|
5441
5442
|
size: {
|
|
5442
5443
|
md: ["px-[4px]", "rounded-overlay-tools-wrapper bg-overlay-tools-background-base"],
|
|
@@ -5461,7 +5462,7 @@ var rd = Mn("flex shrink-0 items-center justify-end", {
|
|
|
5461
5462
|
hasBorder: !0
|
|
5462
5463
|
}
|
|
5463
5464
|
});
|
|
5464
|
-
function
|
|
5465
|
+
function ad({ className: e, children: t, ...n }) {
|
|
5465
5466
|
return /* @__PURE__ */ U("div", {
|
|
5466
5467
|
"data-slot": "topmenu",
|
|
5467
5468
|
role: "group",
|
|
@@ -5470,11 +5471,11 @@ function id({ className: e, children: t, ...n }) {
|
|
|
5470
5471
|
children: t
|
|
5471
5472
|
});
|
|
5472
5473
|
}
|
|
5473
|
-
function
|
|
5474
|
+
function od({ className: e, size: t, hasBorder: n, children: r, ...i }) {
|
|
5474
5475
|
return /* @__PURE__ */ U("div", {
|
|
5475
5476
|
"data-slot": "topmenu-actions",
|
|
5476
5477
|
"data-size": t ?? "lg",
|
|
5477
|
-
className: N(
|
|
5478
|
+
className: N(id({
|
|
5478
5479
|
size: t,
|
|
5479
5480
|
hasBorder: n
|
|
5480
5481
|
}), e),
|
|
@@ -5484,42 +5485,42 @@ function ad({ className: e, size: t, hasBorder: n, children: r, ...i }) {
|
|
|
5484
5485
|
}
|
|
5485
5486
|
//#endregion
|
|
5486
5487
|
//#region src/domain/actions/constants.ts
|
|
5487
|
-
var
|
|
5488
|
+
var sd = "swisper";
|
|
5488
5489
|
//#endregion
|
|
5489
5490
|
//#region src/domain/actions/utils/index.ts
|
|
5490
|
-
function
|
|
5491
|
-
let n = `${
|
|
5491
|
+
function cd(e, t) {
|
|
5492
|
+
let n = `${sd}://action/${e}`;
|
|
5492
5493
|
return t ? `${n}?${new URLSearchParams(t).toString()}` : n;
|
|
5493
5494
|
}
|
|
5494
|
-
function
|
|
5495
|
-
return `[${t}](${
|
|
5495
|
+
function ld({ action: e, label: t, params: n }) {
|
|
5496
|
+
return `[${t}](${cd(e, n)})`;
|
|
5496
5497
|
}
|
|
5497
|
-
function
|
|
5498
|
+
function ud(e) {
|
|
5498
5499
|
if (!e?.startsWith("swisper://")) return !1;
|
|
5499
5500
|
let t = new URL(e);
|
|
5500
5501
|
return t.protocol === "swisper:" && t.hostname === "action" && t.pathname.startsWith("/") && t.pathname.split("/").length === 2;
|
|
5501
5502
|
}
|
|
5502
|
-
function
|
|
5503
|
+
function dd(e) {
|
|
5503
5504
|
let t;
|
|
5504
5505
|
try {
|
|
5505
5506
|
t = new URL(e);
|
|
5506
5507
|
} catch {
|
|
5507
5508
|
return null;
|
|
5508
5509
|
}
|
|
5509
|
-
return
|
|
5510
|
+
return ud(e) ? {
|
|
5510
5511
|
option: t.pathname.replace("/", ""),
|
|
5511
5512
|
payload: Object.fromEntries(t.searchParams.entries())
|
|
5512
5513
|
} : null;
|
|
5513
5514
|
}
|
|
5514
|
-
function
|
|
5515
|
+
function fd(e) {
|
|
5515
5516
|
for (let t of e) if (t.type === "text" && typeof t.value == "string") return t.value;
|
|
5516
5517
|
return null;
|
|
5517
5518
|
}
|
|
5518
|
-
function
|
|
5519
|
+
function pd(e) {
|
|
5519
5520
|
let t = un().use(Pn).use(Nn).parse(e), n = null;
|
|
5520
5521
|
return Fn(t, (e) => {
|
|
5521
5522
|
if (e.type !== "link") return;
|
|
5522
|
-
let t =
|
|
5523
|
+
let t = dd(e.url), r = fd(e.children);
|
|
5523
5524
|
if (t && r) {
|
|
5524
5525
|
n = {
|
|
5525
5526
|
label: r,
|
|
@@ -5533,23 +5534,23 @@ function fd(e) {
|
|
|
5533
5534
|
}
|
|
5534
5535
|
//#endregion
|
|
5535
5536
|
//#region src/domain/actions/hooks/index.ts
|
|
5536
|
-
function
|
|
5537
|
-
return B(() => e.map((e) =>
|
|
5537
|
+
function md(e) {
|
|
5538
|
+
return B(() => e.map((e) => pd(e) || { label: e }).filter((e) => e !== null), [e]);
|
|
5538
5539
|
}
|
|
5539
5540
|
//#endregion
|
|
5540
5541
|
//#region src/hooks/use-chat-stream-message.ts
|
|
5541
|
-
function
|
|
5542
|
+
function hd(e) {
|
|
5542
5543
|
return JSON.parse(e);
|
|
5543
5544
|
}
|
|
5544
|
-
function
|
|
5545
|
+
function gd(e) {
|
|
5545
5546
|
return e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
5546
5547
|
}
|
|
5547
|
-
function
|
|
5548
|
+
function _d(e, t) {
|
|
5548
5549
|
return e instanceof Error ? e : Error(t);
|
|
5549
5550
|
}
|
|
5550
|
-
function
|
|
5551
|
+
function vd() {
|
|
5551
5552
|
return { streamMessage: I(async ({ stream: e, abortController: t, timeout: n = 2e4, tokenParser: r, onChunkReceived: i, onAbort: a, onFinish: o, onError: s }) => {
|
|
5552
|
-
let c = r ??
|
|
5553
|
+
let c = r ?? hd, l, u = !1, d = () => {
|
|
5553
5554
|
l !== void 0 && (clearTimeout(l), l = void 0);
|
|
5554
5555
|
}, f = (e) => {
|
|
5555
5556
|
u || (u = !0, d(), a?.(e));
|
|
@@ -5576,7 +5577,7 @@ function _d() {
|
|
|
5576
5577
|
}
|
|
5577
5578
|
});
|
|
5578
5579
|
for (t?.signal.addEventListener("abort", () => {
|
|
5579
|
-
let e =
|
|
5580
|
+
let e = _d(t.signal.reason, "Stream aborted");
|
|
5580
5581
|
f(e);
|
|
5581
5582
|
}, { once: !0 }), p(); !u;) {
|
|
5582
5583
|
let { value: t, done: n } = await e.read(), i = r.decode(t, { stream: !0 });
|
|
@@ -5585,8 +5586,8 @@ function _d() {
|
|
|
5585
5586
|
d(), !u && !t?.signal.aborted && o?.(n);
|
|
5586
5587
|
} catch (e) {
|
|
5587
5588
|
let n = e;
|
|
5588
|
-
if (u || t?.signal.aborted ||
|
|
5589
|
-
u || f(
|
|
5589
|
+
if (u || t?.signal.aborted || gd(n)) {
|
|
5590
|
+
u || f(_d(n, "Stream aborted"));
|
|
5590
5591
|
return;
|
|
5591
5592
|
}
|
|
5592
5593
|
t?.abort(n), console.error("Error while reading stream:", n), s?.(n);
|
|
@@ -5595,7 +5596,7 @@ function _d() {
|
|
|
5595
5596
|
}
|
|
5596
5597
|
//#endregion
|
|
5597
5598
|
//#region src/hooks/use-on-chat-changed.ts
|
|
5598
|
-
function
|
|
5599
|
+
function yd(e) {
|
|
5599
5600
|
let { chatId: t, isNewChat: n } = Va(), r = V(n), i = V(t), a = V(e);
|
|
5600
5601
|
a.current = e, r.current = n, R(() => {
|
|
5601
5602
|
i.current !== t && (a.current({
|
|
@@ -5607,19 +5608,19 @@ function vd(e) {
|
|
|
5607
5608
|
}
|
|
5608
5609
|
//#endregion
|
|
5609
5610
|
//#region src/hooks/use-current-chat-id.ts
|
|
5610
|
-
function
|
|
5611
|
+
function bd() {
|
|
5611
5612
|
let { chatId: e } = Va();
|
|
5612
5613
|
return e;
|
|
5613
5614
|
}
|
|
5614
5615
|
//#endregion
|
|
5615
5616
|
//#region src/hooks/use-is-current-chat-new.ts
|
|
5616
|
-
function
|
|
5617
|
+
function xd() {
|
|
5617
5618
|
let { isNewChat: e } = Va();
|
|
5618
5619
|
return e;
|
|
5619
5620
|
}
|
|
5620
5621
|
//#endregion
|
|
5621
5622
|
//#region src/hooks/use-loaded-chat-ids.ts
|
|
5622
|
-
function
|
|
5623
|
+
function Sd() {
|
|
5623
5624
|
let { loadedChatIdsRef: e } = Va();
|
|
5624
5625
|
return {
|
|
5625
5626
|
getIsChatLoaded: I((t) => e.current?.has(t) ?? !1, []),
|
|
@@ -5633,7 +5634,7 @@ function xd() {
|
|
|
5633
5634
|
}
|
|
5634
5635
|
//#endregion
|
|
5635
5636
|
//#region src/hooks/use-chat-prompt-placeholder.ts
|
|
5636
|
-
function
|
|
5637
|
+
function Cd() {
|
|
5637
5638
|
let { promptPlaceholder: e, setPromptPlaceholder: t, clearPromptPlaceholder: n } = Va();
|
|
5638
5639
|
return {
|
|
5639
5640
|
promptPlaceholder: e,
|
|
@@ -5642,6 +5643,6 @@ function Sd() {
|
|
|
5642
5643
|
};
|
|
5643
5644
|
}
|
|
5644
5645
|
//#endregion
|
|
5645
|
-
export {
|
|
5646
|
+
export { Yl as $replaceEditorHTMLContent, Xl as $replaceEditorSelectionHTMLContent, ql as $setSelectionToEnd, Du as AlignmentSelect, Ou as AttachmentButton, Ku as BoldButton, sd as CHAT_ACTION_PROTOCOL, sc as CanvasShell, uc as CanvasShellCloseTrigger, mc as CanvasShellContent, hc as CanvasShellFooter, dc as CanvasShellFullScreenTrigger, cc as CanvasShellHeader, fc as CanvasShellOptionsButton, lc as CanvasShellTitle, tc as ChatArtifact, oc as ChatArtifactActions, ac as ChatArtifactCaption, rc as ChatArtifactContent, nc as ChatArtifactIcon, ic as ChatArtifactTitle, or as ChatCard, Gn as ChatCardActionButton, Wn as ChatCardActions, rr as ChatCardAttribute, ir as ChatCardAttributeLabel, ar as ChatCardAttributeValue, nr as ChatCardAttributes, Jn as ChatCardBody, Kn as ChatCardCollapsibleButton, dr as ChatCardContainer, Yn as ChatCardContent, Zn as ChatCardFooter, er as ChatCardFooterActions, Qn as ChatCardFooterNotes, $n as ChatCardFooterPrice, tr as ChatCardForm, zn as ChatCardHeader, Vn as ChatCardHeaderContent, Bn as ChatCardIcon, qn as ChatCardMedia, Xn as ChatCardPreview, Un as ChatCardSubTitle, Hn as ChatCardTitle, _r as ChatContainer, yr as ChatContainerPrompt, br as ChatContainerWelcome, qa as ChatConversationProvider, zr as ChatInput, Vr as ChatInputTextarea, Wr as ChatList, Jr as ChatListEmptyState, Yr as ChatListError, $r as ChatListItem, Qr as ChatListItems, Xr as ChatListLoadMore, qr as ChatListSkeleton, Ia as ChatMessage, Ra as ChatMessageActions, ro as ChatMessageAttachmentCard, so as ChatMessageAttachmentCardActions, io as ChatMessageAttachmentCardContent, lo as ChatMessageAttachmentCardIcon, oo as ChatMessageAttachmentCardPreview, ao as ChatMessageAttachmentCardTitle, La as ChatMessageContent, eo as ChatMessageListGroup, _o as ChatMessageResponse, vo as ChatMessageToolbar, bo as ChatMessageToolbarActionButton, yo as ChatMessageToolbarActions, xo as ChatMessageToolbarTimestamp, Za as ChatMessages, Qa as ChatMessagesList, no as ChatMessagesScrollButton, Jo as ChatNotificationCard, ns as ChatNotificationCardActions, is as ChatNotificationCardButtons, cs as ChatNotificationCardCloseButton, ls as ChatNotificationCardContent, fs as ChatNotificationCardContentActions, ds as ChatNotificationCardContentDescription, us as ChatNotificationCardContentTitle, ss as ChatNotificationCardDeleteButton, hs as ChatNotificationCardDescription, ps as ChatNotificationCardExpandButton, Yo as ChatNotificationCardHead, Xo as ChatNotificationCardHeader, Zo as ChatNotificationCardHeaderIcon, ts as ChatNotificationCardHeaderStatus, Qo as ChatNotificationCardHeaderTitle, $o as ChatNotificationCardHeaderTitleLabel, ms as ChatNotificationCardIcon, as as ChatNotificationCardReadActionButton, os as ChatNotificationCardSnoozeButton, gs as ChatNotificationCardTimeStamp, rs as ChatNotificationCardTimestamp, _s as ChatNotificationPopup, ys as ChatNotificationPopupContent, vs as ChatNotificationPopupTrigger, xa as ChatPromptBox, Da as ChatPromptBoxActionsLeft, Oa as ChatPromptBoxActionsRight, Ta as ChatPromptBoxContent, Ea as ChatPromptBoxInput, wa as ChatPromptBoxToolbar, Aa as ChatPromptBoxVoiceBarIcon, Ma as ChatPromptBoxVoiceButton, da as ChatPromptBoxVoiceLight, Na as ChatPromptBoxVoiceMicButton, Pa as ChatPromptBoxVoicePanel, Fa as ChatPromptBoxVoiceSoundButton, _a as ChatPromptBoxVoiceStateWord, Ha as ChatProvider, wc as ChatReasoning, $c as ChatReasoningEnd, el as ChatReasoningEndIcon, tl as ChatReasoningEndText, Ic as ChatReasoningStep, Lc as ChatReasoningStepHead, Rc as ChatReasoningStepIcon, zc as ChatReasoningStepIconDot, Bc as ChatReasoningStepIconLogo, Vc as ChatReasoningStepIconWeb, qc as ChatReasoningStepNote, Qc as ChatReasoningStepNotePageDomain, Xc as ChatReasoningStepNotePageIcon, Yc as ChatReasoningStepNotePageRow, Zc as ChatReasoningStepNotePageTitle, Jc as ChatReasoningStepNotePages, Uc as ChatReasoningStepNotes, Hc as ChatReasoningStepText, Pc as ChatReasoningSteps, Tc as ChatReasoningTrigger, Nc as ChatReasoningTriggerArrow, Mc as ChatReasoningTriggerLabel, Ec as ChatReasoningTriggerSymbol, kc as ChatReasoningTriggerSymbolSwisper, bs as ChatReplies, xs as ChatReply, Ss as ChatReplyLabel, Cs as ChatReplyValue, Ds as ChatSuggestion, js as ChatSuggestionAction, As as ChatSuggestionActions, ks as ChatSuggestionLabel, Os as ChatSuggestionLabelIcon, Es as ChatSuggestions, nl as ChatThinkingProcess, sl as ChatThinkingProcessContent, ll as ChatThinkingProcessContentItem, ul as ChatThinkingProcessContentItemIcon, rl as ChatThinkingProcessTrigger, ol as ChatThinkingProcessTriggerArrow, il as ChatThinkingProcessTriggerIcon, al as ChatThinkingProcessTriggerLabel, Js as ChatThread, Qs as ChatThreadAnswer, ec as ChatThreadErrorState, Xs as ChatThreadGroup, Ks as ChatThreadProvider, Zs as ChatThreadQuestion, qu as CleanFormatButton, ur as EditableChatCardContextProvider, dl as EmptyState, hl as EmptyStateActionRow, ml as EmptyStateDescription, fl as EmptyStateIcon, pl as EmptyStateTitle, nd as FormattingToolbarPlugin, uu as HtmlPastePlugin, Do as HtmlViewer, au as INSERT_HTML_COMMAND, su as INSERT_HTML_EVENT, eu as INSERT_IMAGE_COMMAND, tu as INSERT_IMAGE_EVENT_NAME, nu as ImageAddedEvent, Ju as ImageButton, ru as ImageDropPlugin, lu as InsertHtmlEvent, Yu as ItalicButton, Xu as LinkButton, ho as MarkdownViewer, gc as NewChatTrigger, iu as PASTE_HTML_COMMAND, ou as PASTE_HTML_EVENT, cu as PasteHtmlEvent, _u as RichTextArea, rd as RichTextField, Zu as SizeSelect, Qu as TextColorButton, $ as ToolbarButton, ad as TopMenu, od as TopMenuActions, $u as TypographySelect, ed as UnderlineButton, pc as canvasShellContentPadding, ld as createChatActionLink, pd as extractChatActionFromLink, Go as formatSnoozeDate, fo as getAttachmentIcon, Bo as getSnoozeUntilDate, ud as isChatActionURL, Kl as scrollRichTextAreaToBottom, md as useChatActions, Va as useChatContext, Ka as useChatConversationContext, Lr as useChatInputContext, Ur as useChatListContext, Sd as useChatLoadedIds, qo as useChatNotificationCardContext, Cd as useChatPromptPlaceholder, vd as useChatStreamMessage, Ts as useChatSuggestionContext, Vs as useChatThread, pn as useChatThreadScrollable, bd as useCurrentChatId, sr as useEditChatCard, lr as useEditableChatCardContext, xd as useIsCurrentChatNew, yd as useOnChatChanged, Q as useRichTextAreaEditor, Ul as useRichTextAreaSelectedText };
|
|
5646
5647
|
|
|
5647
5648
|
//# sourceMappingURL=index.es.js.map
|