@xiping/react-components 1.0.55 → 1.0.57

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.
Files changed (147) hide show
  1. package/dist/cjs/components/blur-text/BlurText.d.ts +16 -0
  2. package/dist/cjs/components/blur-text/BlurText.js +1 -0
  3. package/dist/cjs/components/blur-text/index.d.ts +2 -0
  4. package/dist/cjs/components/button/Button.css +1 -0
  5. package/dist/cjs/components/button/Button.js +1 -1
  6. package/dist/cjs/components/comic-text/ComicText.css +1 -0
  7. package/dist/cjs/components/comic-text/ComicText.js +2 -2
  8. package/dist/cjs/components/dock/Duck.css +1 -0
  9. package/dist/cjs/components/dock/Duck.d.ts +2 -4
  10. package/dist/cjs/components/dock/Duck.js +1 -1
  11. package/dist/cjs/components/flip-text/FlipText.css +1 -0
  12. package/dist/cjs/components/flip-text/FlipText.js +1 -1
  13. package/dist/cjs/components/gradient-text/index.css +1 -0
  14. package/dist/cjs/components/gradient-text/index.js +1 -1
  15. package/dist/cjs/components/hyper-text/HyperText.css +1 -0
  16. package/dist/cjs/components/hyper-text/index.js +1 -1
  17. package/dist/cjs/components/image-compare/ImageCompare.css +1 -0
  18. package/dist/cjs/components/image-compare/ImageCompare.d.ts +4 -2
  19. package/dist/cjs/components/image-compare/ImageCompare.js +1 -1
  20. package/dist/cjs/components/image-viewer/ImageThumbnails.css +1 -0
  21. package/dist/cjs/components/image-viewer/ImageThumbnails.js +1 -1
  22. package/dist/cjs/components/image-viewer/ImageViewer.css +1 -0
  23. package/dist/cjs/components/image-viewer/ImageViewer.js +1 -1
  24. package/dist/cjs/components/message/Message.css +1 -0
  25. package/dist/cjs/components/message/Message.js +1 -1
  26. package/dist/cjs/components/pointer/Pointer.css +1 -0
  27. package/dist/cjs/components/pointer/Pointer.js +1 -1
  28. package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.css +1 -0
  29. package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.js +1 -1
  30. package/dist/cjs/components/shimmer-button/ShimmerButton.css +1 -0
  31. package/dist/cjs/components/shimmer-button/ShimmerButton.js +1 -1
  32. package/dist/cjs/components/shiny-button/ShinyButton.css +1 -0
  33. package/dist/cjs/components/shiny-button/ShinyButton.js +1 -1
  34. package/dist/cjs/components/shiny-text/ShinyText.css +1 -0
  35. package/dist/cjs/components/shiny-text/ShinyText.d.ts +16 -0
  36. package/dist/cjs/components/shiny-text/ShinyText.js +1 -0
  37. package/dist/cjs/components/shiny-text/index.d.ts +2 -0
  38. package/dist/cjs/components/sparkles-text/SparklesText.css +1 -0
  39. package/dist/cjs/components/sparkles-text/SparklesText.js +1 -1
  40. package/dist/cjs/components/split-text/SplitText.css +1 -0
  41. package/dist/cjs/components/split-text/SplitText.js +1 -1
  42. package/dist/cjs/components/subtitle-player/CurrentMode.css +1 -0
  43. package/dist/cjs/components/subtitle-player/CurrentMode.d.ts +2 -0
  44. package/dist/cjs/components/subtitle-player/CurrentMode.js +2 -2
  45. package/dist/cjs/components/subtitle-player/LyricsMode.css +1 -0
  46. package/dist/cjs/components/subtitle-player/LyricsMode.d.ts +2 -0
  47. package/dist/cjs/components/subtitle-player/LyricsMode.js +2 -2
  48. package/dist/cjs/components/subtitle-player/SubtitlePlayer.css +1 -0
  49. package/dist/cjs/components/subtitle-player/SubtitlePlayer.d.ts +2 -0
  50. package/dist/cjs/components/subtitle-player/SubtitlePlayer.js +1 -1
  51. package/dist/cjs/components/text-animate/TextAnimate.css +1 -0
  52. package/dist/cjs/components/text-animate/TextAnimate.js +2 -2
  53. package/dist/cjs/components/text-type/TextType.css +1 -0
  54. package/dist/cjs/components/text-type/TextType.js +1 -1
  55. package/dist/cjs/components/txt-reader/index.module.css +1 -0
  56. package/dist/cjs/components/txt-reader/index.module.css.js +1 -1
  57. package/dist/cjs/components/typing-animation/index.css +1 -0
  58. package/dist/cjs/components/typing-animation/index.js +1 -1
  59. package/dist/cjs/components/variable-proximity/index.css +1 -0
  60. package/dist/cjs/components/variable-proximity/index.js +1 -1
  61. package/dist/cjs/components/video-dialog/VideoDialog.css +1 -0
  62. package/dist/cjs/components/video-dialog/VideoDialog.js +1 -1
  63. package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.css +1 -0
  64. package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.js +1 -1
  65. package/dist/cjs/index.d.ts +2 -1
  66. package/dist/cjs/index.js +1 -1
  67. package/dist/cjs/llms.txt +2 -13
  68. package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css +1 -0
  69. package/dist/es/components/blur-text/BlurText.d.ts +16 -0
  70. package/dist/es/components/blur-text/BlurText.js +77 -0
  71. package/dist/es/components/blur-text/index.d.ts +2 -0
  72. package/dist/es/components/button/Button.css +1 -0
  73. package/dist/es/components/button/Button.js +35 -46
  74. package/dist/es/components/comic-text/ComicText.css +1 -0
  75. package/dist/es/components/comic-text/ComicText.js +13 -12
  76. package/dist/es/components/dock/Duck.css +1 -0
  77. package/dist/es/components/dock/Duck.d.ts +2 -4
  78. package/dist/es/components/dock/Duck.js +60 -64
  79. package/dist/es/components/flip-text/FlipText.css +1 -0
  80. package/dist/es/components/flip-text/FlipText.js +8 -8
  81. package/dist/es/components/gradient-text/index.css +1 -0
  82. package/dist/es/components/gradient-text/index.js +9 -8
  83. package/dist/es/components/hyper-text/HyperText.css +1 -0
  84. package/dist/es/components/hyper-text/index.js +16 -13
  85. package/dist/es/components/image-compare/ImageCompare.css +1 -0
  86. package/dist/es/components/image-compare/ImageCompare.d.ts +4 -2
  87. package/dist/es/components/image-compare/ImageCompare.js +55 -48
  88. package/dist/es/components/image-viewer/ImageThumbnails.css +1 -0
  89. package/dist/es/components/image-viewer/ImageThumbnails.js +41 -42
  90. package/dist/es/components/image-viewer/ImageViewer.css +1 -0
  91. package/dist/es/components/image-viewer/ImageViewer.js +34 -35
  92. package/dist/es/components/message/Message.css +1 -0
  93. package/dist/es/components/message/Message.js +65 -54
  94. package/dist/es/components/pointer/Pointer.css +1 -0
  95. package/dist/es/components/pointer/Pointer.js +23 -25
  96. package/dist/es/components/scratch-to-reveal/ScratchToReveal.css +1 -0
  97. package/dist/es/components/scratch-to-reveal/ScratchToReveal.js +17 -16
  98. package/dist/es/components/shimmer-button/ShimmerButton.css +1 -0
  99. package/dist/es/components/shimmer-button/ShimmerButton.js +8 -8
  100. package/dist/es/components/shiny-button/ShinyButton.css +1 -0
  101. package/dist/es/components/shiny-button/ShinyButton.js +13 -13
  102. package/dist/es/components/shiny-text/ShinyText.css +1 -0
  103. package/dist/es/components/shiny-text/ShinyText.d.ts +16 -0
  104. package/dist/es/components/shiny-text/ShinyText.js +76 -0
  105. package/dist/es/components/shiny-text/index.d.ts +2 -0
  106. package/dist/es/components/sparkles-text/SparklesText.css +1 -0
  107. package/dist/es/components/sparkles-text/SparklesText.js +14 -14
  108. package/dist/es/components/split-text/SplitText.css +1 -0
  109. package/dist/es/components/split-text/SplitText.js +1 -1
  110. package/dist/es/components/subtitle-player/CurrentMode.css +1 -0
  111. package/dist/es/components/subtitle-player/CurrentMode.d.ts +2 -0
  112. package/dist/es/components/subtitle-player/CurrentMode.js +75 -40
  113. package/dist/es/components/subtitle-player/LyricsMode.css +1 -0
  114. package/dist/es/components/subtitle-player/LyricsMode.d.ts +2 -0
  115. package/dist/es/components/subtitle-player/LyricsMode.js +139 -68
  116. package/dist/es/components/subtitle-player/SubtitlePlayer.css +1 -0
  117. package/dist/es/components/subtitle-player/SubtitlePlayer.d.ts +2 -0
  118. package/dist/es/components/subtitle-player/SubtitlePlayer.js +63 -60
  119. package/dist/es/components/text-animate/TextAnimate.css +1 -0
  120. package/dist/es/components/text-animate/TextAnimate.js +57 -55
  121. package/dist/es/components/text-type/TextType.css +1 -0
  122. package/dist/es/components/text-type/TextType.js +24 -19
  123. package/dist/es/components/txt-reader/index.module.css +1 -0
  124. package/dist/es/components/txt-reader/index.module.css.js +1 -1
  125. package/dist/es/components/typing-animation/index.css +1 -0
  126. package/dist/es/components/typing-animation/index.js +12 -12
  127. package/dist/es/components/variable-proximity/index.css +1 -0
  128. package/dist/es/components/variable-proximity/index.js +19 -18
  129. package/dist/es/components/video-dialog/VideoDialog.css +1 -0
  130. package/dist/es/components/video-dialog/VideoDialog.js +1 -1
  131. package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.css +1 -0
  132. package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.js +100 -93
  133. package/dist/es/index.d.ts +2 -1
  134. package/dist/es/index.js +59 -60
  135. package/dist/es/llms.txt +2 -13
  136. package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css +1 -0
  137. package/package.json +14 -12
  138. package/dist/cjs/components/animated-list/AnimatedList.d.ts +0 -9
  139. package/dist/cjs/components/animated-list/AnimatedList.js +0 -1
  140. package/dist/cjs/components/animated-list/index.d.ts +0 -1
  141. package/dist/cjs/react-components.css +0 -1
  142. package/dist/cjs/utils/utils.js +0 -1
  143. package/dist/es/components/animated-list/AnimatedList.d.ts +0 -9
  144. package/dist/es/components/animated-list/AnimatedList.js +0 -44
  145. package/dist/es/components/animated-list/index.d.ts +0 -1
  146. package/dist/es/react-components.css +0 -1
  147. package/dist/es/utils/utils.js +0 -8
@@ -1,21 +1,20 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as h } from "react/jsx-runtime";
2
+ import { jsx as n, jsxs as f } from "react/jsx-runtime";
3
3
  import { Modal as z, ModalContent as O, Spinner as S } from "@heroui/react";
4
4
  import P from "../pinch-content/PinchContent.js";
5
5
  import V from "./ImageThumbnails.js";
6
6
  import { useState as v, useCallback as b, useEffect as x } from "react";
7
- import X from "clsx";
8
- import { Download as B, X as K } from "lucide-react";
9
- import { AnimatePresence as W, motion as _ } from "motion/react";
10
- import { cn as f } from "../../utils/utils.js";
11
- /* empty css */
12
- const C = (c) => {
13
- c.target.closest(".xiping-main-content") && c.preventDefault();
14
- }, ne = (c) => {
7
+ import d from "clsx";
8
+ import { Download as X, X as B } from "lucide-react";
9
+ import { AnimatePresence as K, motion as W } from "motion/react";
10
+ import './ImageViewer.css';/* empty css */
11
+ const C = (l) => {
12
+ l.target.closest(".xiping-main-content") && l.preventDefault();
13
+ }, $ = (l) => {
15
14
  const {
16
15
  isOpen: a,
17
16
  onClose: w,
18
- imgSrc: d,
17
+ imgSrc: g,
19
18
  thumbnailImages: N,
20
19
  canDownload: y = !1,
21
20
  wrapperClassName: I,
@@ -23,13 +22,13 @@ const C = (c) => {
23
22
  downloadClassName: L,
24
23
  toolWrapperClassName: k,
25
24
  initialIndex: D = 0
26
- } = c, o = Array.isArray(d) ? d : [d], A = N || o, R = Math.max(
25
+ } = l, o = Array.isArray(g) ? g : [g], A = N || o, R = Math.max(
27
26
  0,
28
27
  Math.min(D, o.length - 1)
29
- ), [l, g] = v(R), [M, p] = v(!0), m = b(() => {
30
- p(!0), w();
28
+ ), [c, p] = v(R), [M, u] = v(!0), m = b(() => {
29
+ u(!0), w();
31
30
  }, [w]), T = async () => {
32
- const i = o[l];
31
+ const i = o[c];
33
32
  try {
34
33
  const r = await (await fetch(i)).blob(), e = window.URL.createObjectURL(r), s = document.createElement("a");
35
34
  s.href = e, s.download = i.split("/").pop() || "image", document.body.appendChild(s), s.click(), window.URL.revokeObjectURL(e), document.body.removeChild(s);
@@ -37,9 +36,9 @@ const C = (c) => {
37
36
  console.error("Error downloading image:", t);
38
37
  }
39
38
  }, U = () => {
40
- p(!1);
39
+ u(!1);
41
40
  }, j = () => {
42
- p(!1);
41
+ u(!1);
43
42
  };
44
43
  x(() => {
45
44
  if (a)
@@ -49,7 +48,7 @@ const C = (c) => {
49
48
  document.removeEventListener("touchmove", C);
50
49
  };
51
50
  }, [a]);
52
- const u = b(() => {
51
+ const h = b(() => {
53
52
  "vibrate" in navigator && navigator.vibrate([50, 50, 50]);
54
53
  }, []);
55
54
  return x(() => {
@@ -59,10 +58,10 @@ const C = (c) => {
59
58
  if (!(r.tagName === "INPUT" || r.tagName === "TEXTAREA" || r.isContentEditable))
60
59
  switch (t.key) {
61
60
  case "ArrowLeft":
62
- t.preventDefault(), g((e) => e > 0 ? e - 1 : (u(), e));
61
+ t.preventDefault(), p((e) => e > 0 ? e - 1 : (h(), e));
63
62
  break;
64
63
  case "ArrowRight":
65
- t.preventDefault(), g((e) => e < o.length - 1 ? e + 1 : (u(), e));
64
+ t.preventDefault(), p((e) => e < o.length - 1 ? e + 1 : (h(), e));
66
65
  break;
67
66
  case "Escape":
68
67
  t.preventDefault(), m();
@@ -72,43 +71,43 @@ const C = (c) => {
72
71
  return document.addEventListener("keydown", i), () => {
73
72
  document.removeEventListener("keydown", i);
74
73
  };
75
- }, [a, o.length, m, u]), /* @__PURE__ */ n(
74
+ }, [a, o.length, m, h]), /* @__PURE__ */ n(
76
75
  z,
77
76
  {
78
77
  isOpen: a,
79
78
  size: "full",
80
79
  onClose: m,
81
80
  classNames: {
82
- wrapper: X(I)
81
+ wrapper: d(I)
83
82
  },
84
83
  className: "xiping-modal-overlay",
85
84
  hideCloseButton: !0,
86
85
  portalContainer: document.body,
87
- children: /* @__PURE__ */ n(O, { className: "xiping-modal-content", children: /* @__PURE__ */ h("div", { className: "xiping-wrapper", children: [
88
- /* @__PURE__ */ h("div", { className: f("xiping-tool-wrapper", k), children: [
86
+ children: /* @__PURE__ */ n(O, { className: "xiping-modal-content", children: /* @__PURE__ */ f("div", { className: "xiping-wrapper", children: [
87
+ /* @__PURE__ */ f("div", { className: d("xiping-tool-wrapper", k), children: [
89
88
  y && /* @__PURE__ */ n(
90
- B,
89
+ X,
91
90
  {
92
91
  size: 24,
93
- className: f("xiping-download-icon", L),
92
+ className: d("xiping-download-icon", L),
94
93
  onClick: T
95
94
  }
96
95
  ),
97
96
  /* @__PURE__ */ n(
98
- K,
97
+ B,
99
98
  {
100
99
  size: 24,
101
- className: f("xiping-close-icon", E),
100
+ className: d("xiping-close-icon", E),
102
101
  onClick: m
103
102
  }
104
103
  )
105
104
  ] }),
106
- /* @__PURE__ */ h("div", { className: "xiping-main-content", children: [
107
- /* @__PURE__ */ n(P, { canRotate: !1, className: "xiping-pinch-content", children: /* @__PURE__ */ n(W, { mode: "wait", children: /* @__PURE__ */ n(
108
- _.img,
105
+ /* @__PURE__ */ f("div", { className: "xiping-main-content", children: [
106
+ /* @__PURE__ */ n(P, { canRotate: !1, className: "xiping-pinch-content", children: /* @__PURE__ */ n(K, { mode: "wait", children: /* @__PURE__ */ n(
107
+ W.img,
109
108
  {
110
109
  draggable: "false",
111
- src: o[l],
110
+ src: o[c],
112
111
  alt: "",
113
112
  className: "xiping-image",
114
113
  onLoad: U,
@@ -121,7 +120,7 @@ const C = (c) => {
121
120
  ease: "easeInOut"
122
121
  }
123
122
  },
124
- l
123
+ c
125
124
  ) }) }),
126
125
  M && /* @__PURE__ */ n("div", { className: "xiping-loading", children: /* @__PURE__ */ n(S, { color: "white", size: "lg" }) })
127
126
  ] }),
@@ -129,8 +128,8 @@ const C = (c) => {
129
128
  V,
130
129
  {
131
130
  images: A,
132
- currentIndex: l,
133
- onImageSelect: g
131
+ currentIndex: c,
132
+ onImageSelect: p
134
133
  }
135
134
  )
136
135
  ] }) })
@@ -138,5 +137,5 @@ const C = (c) => {
138
137
  );
139
138
  };
140
139
  export {
141
- ne as default
140
+ $ as default
142
141
  };
@@ -0,0 +1 @@
1
+ .xiping-message{display:flex;align-items:flex-start;max-width:80%;margin-bottom:16px}.xiping-message.user{align-self:flex-end;flex-direction:row-reverse;margin-left:auto}.xiping-message.assistant{align-self:flex-start;margin-right:auto}.xiping-message__avatar{width:36px;height:36px;border-radius:50%;overflow:hidden;margin:0 8px;background-color:#e0e0e0;display:flex;align-items:center;justify-content:center;flex-shrink:0}.xiping-message__content{background-color:#fff;padding:12px 16px;border-radius:12px;box-shadow:0 1px 2px #0000001a;position:relative;max-width:100%}.xiping-message:not(:has(.xiping-message__avatar)) .xiping-message__content{margin:0}.xiping-message.user .xiping-message__content{background-color:#007bff;color:#fff}.xiping-message__text{word-break:break-word;line-height:1.5}.xiping-message__timestamp{font-size:.75rem;color:#888;margin-top:4px;text-align:right}.xiping-message.user .xiping-message__timestamp{color:#fffc}.xiping-message__thinking{display:flex;align-items:center;margin-top:8px}.xiping-message__thinking-dots{display:flex;align-items:center;margin-right:8px}.xiping-message__thinking-dots span{width:8px;height:8px;margin:0 2px;background-color:#888;border-radius:50%;display:inline-block;animation:xiping-thinking 1.4s infinite ease-in-out both}.xiping-message__thinking-dots span:nth-child(1){animation-delay:-.32s}.xiping-message__thinking-dots span:nth-child(2){animation-delay:-.16s}.xiping-message__thinking-text{font-size:.9rem;color:#888}.xiping-message.user .xiping-message__thinking-text{color:#fffc}@keyframes xiping-thinking{0%,80%,to{transform:scale(.6)}40%{transform:scale(1)}}.xiping-message__loading{display:flex;align-items:center;justify-content:center;padding:8px}.xiping-message__loading-spinner{width:24px;height:24px;border:3px solid rgba(0,123,255,.3);border-radius:50%;border-top-color:#007bff;animation:xiping-spin 1s ease-in-out infinite}@keyframes xiping-spin{to{transform:rotate(360deg)}}.xiping-message__think{margin-top:12px;padding:8px 12px;background-color:#0000000d;border-radius:8px;font-size:.9rem}.xiping-message.user .xiping-message__think{background-color:#ffffff1a}.xiping-message__think-header{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-weight:500}.xiping-message__think-toggle{background:none;border:none;padding:4px;cursor:pointer;color:#666;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:background-color .2s ease}.xiping-message__think-toggle:hover{background-color:#0000000d}.xiping-message__think-content{max-height:1000px;opacity:1;overflow:hidden;transition:all .3s ease-in-out}.xiping-message__think-content.hidden{max-height:0;opacity:0;margin:0;padding:0}.xiping-message__knowledge-sources{margin-top:8px;padding:8px;background-color:#00000008;border-radius:4px;font-size:.9em}.xiping-message__knowledge-sources-header{font-weight:500;margin-bottom:4px;color:#666}.xiping-message__knowledge-sources-list{list-style:none;padding:0;margin:0}.xiping-message__knowledge-source-item{margin-bottom:4px}.xiping-message__knowledge-source-item:last-child{margin-bottom:0}.xiping-message__knowledge-source-item a{color:#06c;text-decoration:none}.xiping-message__knowledge-source-item a:hover{text-decoration:underline}.xiping-message__knowledge-source-description{font-size:.9em;color:#666;margin-top:2px;margin-left:8px}.xiping-message__text-container{position:relative;display:flex;flex-direction:column;gap:4px}.xiping-message__copy-button{align-self:flex-end;padding:4px;background:none;border:none;cursor:pointer;color:#666;opacity:0;transition:all .2s ease;border-radius:4px;display:flex;align-items:center;justify-content:center}.xiping-message__text-container:hover .xiping-message__copy-button{opacity:1}.xiping-message__copy-button:hover{color:#333;background-color:#0000000d}.xiping-message__copy-tooltip{position:absolute;top:-24px;right:0;background-color:#333;color:#fff;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;animation:xiping-fadeInOut 2s ease-in-out}@keyframes xiping-fadeInOut{0%{opacity:0;transform:translateY(4px)}10%{opacity:1;transform:translateY(0)}90%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}
@@ -1,54 +1,55 @@
1
- import { jsxs as i, jsx as e, Fragment as L } from "react/jsx-runtime";
2
- import { useState as b } from "react";
1
+ import { jsxs as i, jsx as e, Fragment as b } from "react/jsx-runtime";
2
+ import { useState as y } from "react";
3
3
  import a from "react-markdown";
4
- /* empty css */
5
- const q = ({
6
- id: y,
7
- content: o,
4
+ import o from "clsx";
5
+ import './Message.css';/* empty css */
6
+ const E = ({
7
+ id: j,
8
+ content: d,
8
9
  sender: n,
9
- timestamp: d,
10
- isThinking: c = !1,
11
- isLoading: j = !1,
12
- className: V = "",
13
- style: B = {},
14
- showTimestamp: g = !0,
10
+ timestamp: c,
11
+ isThinking: g = !1,
12
+ isLoading: V = !1,
13
+ className: B = "",
14
+ style: H = {},
15
+ showTimestamp: m = !0,
15
16
  avatarUser: h,
16
- avatarAssistant: m,
17
- thinkingText: H = "思考中...",
18
- customThinkingComponent: p,
19
- customUserMessageComponent: _,
20
- customAssistantMessageComponent: u,
21
- parseContent: M = !1,
22
- parsedContent: x,
17
+ avatarAssistant: p,
18
+ thinkingText: M = "思考中...",
19
+ customThinkingComponent: _,
20
+ customUserMessageComponent: u,
21
+ customAssistantMessageComponent: x,
22
+ parseContent: W = !1,
23
+ parsedContent: k,
23
24
  thinkContent: r,
24
25
  knowledgeSources: l
25
26
  }) => {
26
- const [t, k] = b(!0), [W, v] = b("idle");
27
- console.log(y, "id");
28
- const N = (s) => s.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }), $ = async () => {
27
+ const [t, v] = y(!0), [I, N] = y("idle");
28
+ console.log(j, "id");
29
+ const w = (s) => s.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }), S = async () => {
29
30
  try {
30
- await navigator.clipboard.writeText(o), v("copied"), setTimeout(() => v("idle"), 2e3);
31
+ await navigator.clipboard.writeText(d), N("copied"), setTimeout(() => N("idle"), 2e3);
31
32
  } catch (s) {
32
33
  console.error("复制失败:", s);
33
34
  }
34
- }, w = () => p || /* @__PURE__ */ i("div", { className: "xiping-message__thinking", children: [
35
+ }, f = () => _ || /* @__PURE__ */ i("div", { className: "xiping-message__thinking", children: [
35
36
  /* @__PURE__ */ i("div", { className: "xiping-message__thinking-dots", children: [
36
37
  /* @__PURE__ */ e("span", {}),
37
38
  /* @__PURE__ */ e("span", {}),
38
39
  /* @__PURE__ */ e("span", {})
39
40
  ] }),
40
- /* @__PURE__ */ e("span", { className: "xiping-message__thinking-text", children: H })
41
- ] }), I = () => /* @__PURE__ */ e("div", { className: "xiping-message__loading", children: /* @__PURE__ */ e("div", { className: "xiping-message__loading-spinner" }) }), f = () => !l || l.length === 0 ? null : /* @__PURE__ */ i("div", { className: "xiping-message__knowledge-sources", children: [
41
+ /* @__PURE__ */ e("span", { className: "xiping-message__thinking-text", children: M })
42
+ ] }), F = () => /* @__PURE__ */ e("div", { className: "xiping-message__loading", children: /* @__PURE__ */ e("div", { className: "xiping-message__loading-spinner" }) }), C = () => !l || l.length === 0 ? null : /* @__PURE__ */ i("div", { className: "xiping-message__knowledge-sources", children: [
42
43
  /* @__PURE__ */ e("div", { className: "xiping-message__knowledge-sources-header", children: "知识来源:" }),
43
- /* @__PURE__ */ e("ul", { className: "xiping-message__knowledge-sources-list", children: l.map((s, S) => /* @__PURE__ */ i("li", { className: "xiping-message__knowledge-source-item", children: [
44
+ /* @__PURE__ */ e("ul", { className: "xiping-message__knowledge-sources-list", children: l.map((s, K) => /* @__PURE__ */ i("li", { className: "xiping-message__knowledge-source-item", children: [
44
45
  s.url ? /* @__PURE__ */ e("a", { href: s.url, target: "_blank", rel: "noopener noreferrer", children: s.title }) : /* @__PURE__ */ e("span", { children: s.title }),
45
46
  s.description && /* @__PURE__ */ e("div", { className: "xiping-message__knowledge-source-description", children: s.description })
46
- ] }, S)) })
47
- ] }), C = () => n === "user" ? null : /* @__PURE__ */ i(
47
+ ] }, K)) })
48
+ ] }), L = () => n === "user" ? null : /* @__PURE__ */ i(
48
49
  "button",
49
50
  {
50
51
  className: "xiping-message__copy-button",
51
- onClick: $,
52
+ onClick: S,
52
53
  "aria-label": "Copy message",
53
54
  title: "Copy message",
54
55
  children: [
@@ -84,18 +85,22 @@ const q = ({
84
85
  ]
85
86
  }
86
87
  ),
87
- W === "copied" && /* @__PURE__ */ e("span", { className: "xiping-message__copy-tooltip", children: "Copied" })
88
+ I === "copied" && /* @__PURE__ */ e("span", { className: "xiping-message__copy-tooltip", children: "Copied" })
88
89
  ]
89
90
  }
90
91
  );
91
- return n === "user" && _ ? _ : n === "assistant" && u ? u : /* @__PURE__ */ i(
92
+ return n === "user" && u ? u : n === "assistant" && x ? x : /* @__PURE__ */ i(
92
93
  "div",
93
94
  {
94
- className: `xiping-message ${n === "user" ? "user" : "assistant"} ${V}`,
95
- style: B,
95
+ className: o(
96
+ "xiping-message",
97
+ n === "user" ? "user" : "assistant",
98
+ B
99
+ ),
100
+ style: H,
96
101
  children: [
97
- n === "user" && h || n === "assistant" && m ? /* @__PURE__ */ e("div", { className: "xiping-message__avatar", children: n === "user" ? h : m }) : null,
98
- /* @__PURE__ */ e("div", { className: "xiping-message__content", children: j ? I() : M && n === "assistant" ? /* @__PURE__ */ i(L, { children: [
102
+ n === "user" && h || n === "assistant" && p ? /* @__PURE__ */ e("div", { className: "xiping-message__avatar", children: n === "user" ? h : p }) : null,
103
+ /* @__PURE__ */ e("div", { className: "xiping-message__content", children: V ? F() : W && n === "assistant" ? /* @__PURE__ */ i(b, { children: [
99
104
  r && /* @__PURE__ */ i("div", { className: "xiping-message__think", children: [
100
105
  /* @__PURE__ */ i("div", { className: "xiping-message__think-header", children: [
101
106
  "思考过程:",
@@ -103,7 +108,7 @@ const q = ({
103
108
  "button",
104
109
  {
105
110
  className: "xiping-message__think-toggle",
106
- onClick: () => k(!t),
111
+ onClick: () => v(!t),
107
112
  "aria-label": t ? "隐藏思考过程" : "显示思考过程",
108
113
  children: /* @__PURE__ */ e(
109
114
  "svg",
@@ -135,19 +140,22 @@ const q = ({
135
140
  /* @__PURE__ */ e(
136
141
  "div",
137
142
  {
138
- className: `xiping-message__think-content ${t ? "visible" : "hidden"}`,
143
+ className: o(
144
+ "xiping-message__think-content",
145
+ t ? "visible" : "hidden"
146
+ ),
139
147
  children: /* @__PURE__ */ e(a, { children: r })
140
148
  }
141
149
  )
142
150
  ] }),
143
- c && w(),
144
- x && /* @__PURE__ */ i("div", { className: "xiping-message__text-container", children: [
145
- /* @__PURE__ */ e("div", { className: "xiping-message__text", children: /* @__PURE__ */ e(a, { children: x }) }),
146
- C()
151
+ g && f(),
152
+ k && /* @__PURE__ */ i("div", { className: "xiping-message__text-container", children: [
153
+ /* @__PURE__ */ e("div", { className: "xiping-message__text", children: /* @__PURE__ */ e(a, { children: k }) }),
154
+ L()
147
155
  ] }),
148
- f(),
149
- g && /* @__PURE__ */ e("div", { className: "xiping-message__timestamp", children: N(d) })
150
- ] }) : /* @__PURE__ */ i(L, { children: [
156
+ C(),
157
+ m && /* @__PURE__ */ e("div", { className: "xiping-message__timestamp", children: w(c) })
158
+ ] }) : /* @__PURE__ */ i(b, { children: [
151
159
  r && /* @__PURE__ */ i("div", { className: "xiping-message__think", children: [
152
160
  /* @__PURE__ */ i("div", { className: "xiping-message__think-header", children: [
153
161
  "思考过程:",
@@ -155,7 +163,7 @@ const q = ({
155
163
  "button",
156
164
  {
157
165
  className: "xiping-message__think-toggle",
158
- onClick: () => k(!t),
166
+ onClick: () => v(!t),
159
167
  "aria-label": t ? "隐藏思考过程" : "显示思考过程",
160
168
  children: /* @__PURE__ */ e(
161
169
  "svg",
@@ -187,24 +195,27 @@ const q = ({
187
195
  /* @__PURE__ */ e(
188
196
  "div",
189
197
  {
190
- className: `xiping-message__think-content ${t ? "visible" : "hidden"}`,
198
+ className: o(
199
+ "xiping-message__think-content",
200
+ t ? "visible" : "hidden"
201
+ ),
191
202
  children: /* @__PURE__ */ e(a, { children: r })
192
203
  }
193
204
  )
194
205
  ] }),
195
206
  /* @__PURE__ */ i("div", { className: "xiping-message__text-container", children: [
196
- /* @__PURE__ */ e("div", { className: "xiping-message__text", children: /* @__PURE__ */ e(a, { children: o }) }),
197
- C()
207
+ /* @__PURE__ */ e("div", { className: "xiping-message__text", children: /* @__PURE__ */ e(a, { children: d }) }),
208
+ L()
198
209
  ] }),
199
- c && w(),
200
- f(),
201
- g && /* @__PURE__ */ e("div", { className: "xiping-message__timestamp", children: N(d) })
210
+ g && f(),
211
+ C(),
212
+ m && /* @__PURE__ */ e("div", { className: "xiping-message__timestamp", children: w(c) })
202
213
  ] }) })
203
214
  ]
204
215
  }
205
216
  );
206
217
  };
207
218
  export {
208
- q as Message,
209
- q as default
219
+ E as Message,
220
+ E as default
210
221
  };
@@ -0,0 +1 @@
1
+ .xiping-pointer{position:fixed;z-index:50;pointer-events:none;transform:translate(-50%,-50%)}.xiping-pointer-icon{transform:rotate(-70deg);stroke:#fff;color:#000}
@@ -1,42 +1,43 @@
1
1
  "use client";
2
- import { jsxs as h, Fragment as E, jsx as t } from "react/jsx-runtime";
3
- import { cn as w } from "../../utils/utils.js";
4
- import { useMotionValue as m, AnimatePresence as x, motion as L } from "motion/react";
5
- import { useState as y, useRef as g, useEffect as M } from "react";
6
- function C({
2
+ import { jsxs as h, Fragment as x, jsx as t } from "react/jsx-runtime";
3
+ import { useMotionValue as m, AnimatePresence as E, motion as L } from "motion/react";
4
+ import { useState as w, useRef as y, useEffect as g } from "react";
5
+ import M from "clsx";
6
+ import './Pointer.css';/* empty css */
7
+ function P({
7
8
  className: u,
8
- style: d,
9
- children: v,
10
- ...f
9
+ style: v,
10
+ children: d,
11
+ ...p
11
12
  }) {
12
- const n = m(0), o = m(0), [p, s] = y(!1), r = g(null);
13
- return M(() => {
13
+ const n = m(0), o = m(0), [f, s] = w(!1), r = y(null);
14
+ return g(() => {
14
15
  if (typeof window < "u" && r.current) {
15
16
  const e = r.current.parentElement;
16
17
  if (e) {
17
18
  e.style.cursor = "none";
18
19
  const i = (l) => {
19
20
  n.set(l.clientX), o.set(l.clientY);
20
- }, a = () => {
21
- s(!0);
22
21
  }, c = () => {
22
+ s(!0);
23
+ }, a = () => {
23
24
  s(!1);
24
25
  };
25
- return e.addEventListener("mousemove", i), e.addEventListener("mouseenter", a), e.addEventListener("mouseleave", c), () => {
26
- e.style.cursor = "", e.removeEventListener("mousemove", i), e.removeEventListener("mouseenter", a), e.removeEventListener("mouseleave", c);
26
+ return e.addEventListener("mousemove", i), e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", a), () => {
27
+ e.style.cursor = "", e.removeEventListener("mousemove", i), e.removeEventListener("mouseenter", c), e.removeEventListener("mouseleave", a);
27
28
  };
28
29
  }
29
30
  }
30
- }, [n, o]), /* @__PURE__ */ h(E, { children: [
31
+ }, [n, o]), /* @__PURE__ */ h(x, { children: [
31
32
  /* @__PURE__ */ t("div", { ref: r }),
32
- /* @__PURE__ */ t(x, { children: p && /* @__PURE__ */ t(
33
+ /* @__PURE__ */ t(E, { children: f && /* @__PURE__ */ t(
33
34
  L.div,
34
35
  {
35
- className: "transform-[translate(-50%,-50%)] pointer-events-none fixed z-50",
36
+ className: M("xiping-pointer", u),
36
37
  style: {
37
38
  top: o,
38
39
  left: n,
39
- ...d
40
+ ...v
40
41
  },
41
42
  initial: {
42
43
  scale: 0,
@@ -50,8 +51,8 @@ function C({
50
51
  scale: 0,
51
52
  opacity: 0
52
53
  },
53
- ...f,
54
- children: v || /* @__PURE__ */ t(
54
+ ...p,
55
+ children: d || /* @__PURE__ */ t(
55
56
  "svg",
56
57
  {
57
58
  stroke: "currentColor",
@@ -61,10 +62,7 @@ function C({
61
62
  height: "24",
62
63
  width: "24",
63
64
  xmlns: "http://www.w3.org/2000/svg",
64
- className: w(
65
- "rotate-[-70deg] stroke-white text-black",
66
- u
67
- ),
65
+ className: "xiping-pointer-icon",
68
66
  children: /* @__PURE__ */ t("path", { d: "M14.082 2.182a.5.5 0 0 1 .103.557L8.528 15.467a.5.5 0 0 1-.917-.007L5.57 10.694.803 8.652a.5.5 0 0 1-.006-.916l12.728-5.657a.5.5 0 0 1 .556.103z" })
69
67
  }
70
68
  )
@@ -73,5 +71,5 @@ function C({
73
71
  ] });
74
72
  }
75
73
  export {
76
- C as Pointer
74
+ P as Pointer
77
75
  };
@@ -0,0 +1 @@
1
+ .xiping-scratch-to-reveal{position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.xiping-scratch-canvas{position:absolute;left:0;top:0}
@@ -1,18 +1,19 @@
1
1
  "use client";
2
2
  import { jsxs as P, jsx as R } from "react/jsx-runtime";
3
- import { cn as z } from "../../utils/utils.js";
4
- import { useAnimation as b, motion as A } from "motion/react";
5
- import { useRef as j, useState as p, useEffect as x } from "react";
6
- const B = ({
7
- width: l,
8
- height: m,
3
+ import { useAnimation as z, motion as A } from "motion/react";
4
+ import { useRef as b, useState as I, useEffect as x } from "react";
5
+ import j from "clsx";
6
+ import './ScratchToReveal.css';/* empty css */
7
+ const T = ({
8
+ width: m,
9
+ height: l,
9
10
  minScratchPercentage: E = 50,
10
11
  onComplete: h,
11
12
  children: L,
12
13
  className: M,
13
14
  gradientColors: a = ["#A97CF8", "#F38CB8", "#FDCC92"]
14
15
  }) => {
15
- const i = j(null), [d, r] = p(!1), [S, C] = p(!1), v = b();
16
+ const i = b(null), [d, r] = I(!1), [S, C] = I(!1), v = z();
16
17
  x(() => {
17
18
  const t = i.current, e = t?.getContext("2d");
18
19
  if (t && e) {
@@ -44,8 +45,8 @@ const B = ({
44
45
  const D = () => r(!0), w = () => r(!0), f = (t, e) => {
45
46
  const o = i.current, n = o?.getContext("2d");
46
47
  if (o && n) {
47
- const c = o.getBoundingClientRect(), s = t - c.left + 16, I = e - c.top + 16;
48
- n.globalCompositeOperation = "destination-out", n.beginPath(), n.arc(s, I, 30, 0, Math.PI * 2), n.fill();
48
+ const c = o.getBoundingClientRect(), s = t - c.left + 16, p = e - c.top + 16;
49
+ n.globalCompositeOperation = "destination-out", n.beginPath(), n.arc(s, p, 30, 0, Math.PI * 2), n.fill();
49
50
  }
50
51
  }, y = async () => {
51
52
  await v.start({
@@ -67,10 +68,10 @@ const B = ({
67
68
  return /* @__PURE__ */ P(
68
69
  A.div,
69
70
  {
70
- className: z("relative select-none", M),
71
+ className: j("xiping-scratch-to-reveal", M),
71
72
  style: {
72
- width: l,
73
- height: m,
73
+ width: m,
74
+ height: l,
74
75
  cursor: "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIj4KICA8Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNSIgc3R5bGU9ImZpbGw6I2ZmZjtzdHJva2U6IzAwMDtzdHJva2Utd2lkdGg6MXB4OyIgLz4KPC9zdmc+'), auto"
75
76
  },
76
77
  animate: v,
@@ -79,9 +80,9 @@ const B = ({
79
80
  "canvas",
80
81
  {
81
82
  ref: i,
82
- width: l,
83
- height: m,
84
- className: "absolute left-0 top-0",
83
+ width: m,
84
+ height: l,
85
+ className: "xiping-scratch-canvas",
85
86
  onMouseDown: D,
86
87
  onTouchStart: w
87
88
  }
@@ -92,5 +93,5 @@ const B = ({
92
93
  );
93
94
  };
94
95
  export {
95
- B as ScratchToReveal
96
+ T as ScratchToReveal
96
97
  };
@@ -0,0 +1 @@
1
+ .xiping-shimmer-button{position:relative;z-index:0;display:flex;cursor:pointer;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border:1px solid rgba(255,255,255,.1);padding:.75rem 1.5rem;color:#fff;background:var(--bg);border-radius:var(--radius);transform:translateZ(0);transition:transform .3s ease-in-out}.xiping-shimmer-button:active{transform:translateY(1px) translateZ(0)}@media(prefers-color-scheme:dark){.xiping-shimmer-button{color:#000}}.xiping-shimmer-button-spark-container{position:absolute;z-index:-30;inset:0;overflow:visible;filter:blur(2px);container-type:size}.xiping-shimmer-button-spark{position:absolute;inset:0;height:100cqh;aspect-ratio:1;border-radius:0;-webkit-mask:none;mask:none;animation:xiping-shimmer-slide var(--speed) ease-in-out infinite alternate}.xiping-shimmer-button-spark-before{position:absolute;inset:-100%;width:auto;transform:rotate(0);background:conic-gradient(from calc(270deg - (var(--spread) * .5)),transparent 0,var(--shimmer-color) var(--spread),transparent var(--spread));animation:xiping-spin-around calc(var(--speed) * 2) infinite linear}.xiping-shimmer-button-highlight{position:absolute;inset:0;width:100%;height:100%;border-radius:1rem;box-shadow:inset 0 -8px 10px #ffffff1f;transform:translateZ(0);transition:all .3s ease-in-out}.xiping-shimmer-button:hover .xiping-shimmer-button-highlight{box-shadow:inset 0 -6px 10px #ffffff40}.xiping-shimmer-button:active .xiping-shimmer-button-highlight{box-shadow:inset 0 -10px 10px #ffffff40}.xiping-shimmer-button-backdrop{position:absolute;z-index:-20;background:var(--bg);border-radius:var(--radius);inset:var(--cut)}@keyframes xiping-shimmer-slide{to{transform:translate(calc(100cqw - 100%))}}@keyframes xiping-spin-around{0%{transform:translateZ(0) rotate(0)}15%,35%{transform:translateZ(0) rotate(90deg)}65%,85%{transform:translateZ(0) rotate(270deg)}to{transform:translateZ(0) rotate(360deg)}}
@@ -1,13 +1,13 @@
1
1
  import { jsxs as c, jsx as i } from "react/jsx-runtime";
2
2
  import d from "react";
3
- import { cn as h } from "../../utils/utils.js";
4
- /* empty css */
3
+ import h from "clsx";
4
+ import './ShimmerButton.css';/* empty css */
5
5
  const l = d.forwardRef(
6
6
  ({
7
7
  shimmerColor: r = "#ffffff",
8
- shimmerSize: e = "0.05em",
9
- shimmerDuration: m = "3s",
10
- borderRadius: s = "100px",
8
+ shimmerSize: s = "0.05em",
9
+ shimmerDuration: e = "3s",
10
+ borderRadius: m = "100px",
11
11
  background: t = "rgba(0, 0, 0, 1)",
12
12
  className: a,
13
13
  children: o,
@@ -18,9 +18,9 @@ const l = d.forwardRef(
18
18
  style: {
19
19
  "--spread": "90deg",
20
20
  "--shimmer-color": r,
21
- "--radius": s,
22
- "--speed": m,
23
- "--cut": e,
21
+ "--radius": m,
22
+ "--speed": e,
23
+ "--cut": s,
24
24
  "--bg": t
25
25
  },
26
26
  className: h("xiping-shimmer-button", a),
@@ -0,0 +1 @@
1
+ .xiping-shiny-button{position:relative;cursor:pointer;border-radius:.5rem;padding:.5rem 1.5rem;font-weight:500;-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px);border:1px solid;transition:box-shadow .3s ease-in-out}.xiping-shiny-button:hover{box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a}@media(prefers-color-scheme:dark){.xiping-shiny-button{background:radial-gradient(circle at 50% 0%,var(--primary) 10%,transparent 60%)}.xiping-shiny-button:hover{box-shadow:0 0 20px var(--primary) / 10%}}.xiping-shiny-button-text{position:relative;display:block;width:100%;height:100%;font-size:.875rem;text-transform:uppercase;letter-spacing:.05em;color:#000000a6}@media(prefers-color-scheme:dark){.xiping-shiny-button-text{font-weight:300;color:#ffffffe5}}.xiping-shiny-button-border{position:absolute;inset:0;z-index:10;display:block;border-radius:inherit;padding:1px}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { jsxs as t, jsx as a } from "react/jsx-runtime";
3
- import { cn as s } from "../../utils/utils.js";
4
- import { motion as o } from "motion/react";
5
- import p from "react";
6
- /* empty css */
7
- const c = {
3
+ import { motion as s } from "motion/react";
4
+ import o from "react";
5
+ import l from "clsx";
6
+ import './ShinyButton.css';/* empty css */
7
+ const p = {
8
8
  initial: { "--x": "100%", scale: 0.8 },
9
9
  animate: { "--x": "-100%", scale: 1 },
10
10
  whileTap: { scale: 0.95 },
@@ -23,13 +23,13 @@ const c = {
23
23
  mass: 0.5
24
24
  }
25
25
  }
26
- }, l = p.forwardRef(({ children: r, className: e, ...n }, i) => /* @__PURE__ */ t(
27
- o.button,
26
+ }, c = o.forwardRef(({ children: r, className: e, ...i }, n) => /* @__PURE__ */ t(
27
+ s.button,
28
28
  {
29
- ref: i,
30
- className: s("xiping-shiny-button", e),
31
- ...c,
32
- ...n,
29
+ ref: n,
30
+ className: l("xiping-shiny-button", e),
31
+ ...p,
32
+ ...i,
33
33
  children: [
34
34
  /* @__PURE__ */ a(
35
35
  "span",
@@ -55,7 +55,7 @@ const c = {
55
55
  ]
56
56
  }
57
57
  ));
58
- l.displayName = "ShinyButton";
58
+ c.displayName = "ShinyButton";
59
59
  export {
60
- l as ShinyButton
60
+ c as ShinyButton
61
61
  };
@@ -0,0 +1 @@
1
+ .shiny-text{display:inline-block}