@bbki.ng/site 5.4.3 → 5.4.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 5.4.5
4
+
5
+ ## 5.4.4
6
+
3
7
  ## 5.4.3
4
8
 
5
9
  ## 5.4.2
package/index.html CHANGED
@@ -55,7 +55,7 @@
55
55
  </style>
56
56
  <script src="https://unpkg.com/open-heart-element" type="module"></script>
57
57
  <script type="module" src="https://cdn.jsdelivr.net/npm/@bbki.ng/bbimg@0.0.3/dist/index.js"></script>
58
- <script type="module" src="https://cdn.jsdelivr.net/npm/@bbki.ng/bb-msg-history@0.7.1/dist/index.js"></script>
58
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@bbki.ng/bb-msg-history@0.7.3/dist/index.js"></script>
59
59
  </head>
60
60
 
61
61
  <body class="h-full m-0 flex flex-col font-mono">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "5.4.3",
3
+ "version": "5.4.5",
4
4
  "description": "code behind bbki.ng",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,7 +1,6 @@
1
- import React, { useEffect, useRef } from "react";
1
+ import React, { useEffect, useRef, useState } from "react";
2
2
  import { useStreaming, StreamingItem } from "@/hooks/use_streaming";
3
3
  import { formatStreamingData } from "@/utils/streaming";
4
- import { Article } from "@bbki.ng/components";
5
4
 
6
5
  // Extend JSX IntrinsicElements for the web component
7
6
  declare global {
@@ -9,7 +8,7 @@ declare global {
9
8
  interface IntrinsicElements {
10
9
  "bb-msg-history": React.DetailedHTMLProps<
11
10
  React.HTMLAttributes<HTMLElement>,
12
- HTMLElement
11
+ BbMsgHistoryElement
13
12
  > & {
14
13
  loading?: boolean;
15
14
  };
@@ -17,10 +16,13 @@ declare global {
17
16
  }
18
17
  }
19
18
 
19
+ interface BbMsgHistoryElement extends HTMLElement {
20
+ setAuthor(name: string, config: { avatar: string; side: string; bubbleColor: string }): void;
21
+ }
22
+
20
23
  const Streaming = () => {
21
24
  const { streaming, isLoading, isError } = useStreaming();
22
- const bbMsgHistoryRef = useRef<HTMLElement>(null);
23
-
25
+ const bbMsgHistoryRef = useRef<BbMsgHistoryElement>(null);
24
26
 
25
27
  if (isError) {
26
28
  return <div className="p-8 text-center text-gray-500">加载失败</div>;
@@ -33,7 +35,6 @@ const Streaming = () => {
33
35
  }
34
36
 
35
37
  return (
36
-
37
38
  <div className="h-full w-full p-4">
38
39
  <bb-msg-history
39
40
  ref={bbMsgHistoryRef}