@bbki.ng/site 5.4.7 → 5.4.9

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.9
4
+
5
+ ## 5.4.8
6
+
3
7
  ## 5.4.7
4
8
 
5
9
  ## 5.4.6
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.9.0/dist/index.js"></script>
58
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@bbki.ng/bb-msg-history@0.11.0/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.7",
3
+ "version": "5.4.9",
4
4
  "description": "code behind bbki.ng",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "sonner": "1.4.0",
21
21
  "swr": "^2.2.5",
22
22
  "vaul": "1.1.2",
23
- "@bbki.ng/components": "5.2.2",
23
+ "@bbki.ng/components": "5.2.3",
24
24
  "@bbki.ng/stylebase": "3.1.1"
25
25
  },
26
26
  "devDependencies": {
@@ -1,6 +1,7 @@
1
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, Panel } from "@bbki.ng/components";
4
5
 
5
6
  // Extend JSX IntrinsicElements for the web component
6
7
  declare global {
@@ -11,6 +12,7 @@ declare global {
11
12
  BbMsgHistoryElement
12
13
  > & {
13
14
  loading?: boolean;
15
+ infinite?: boolean;
14
16
  };
15
17
  }
16
18
  }
@@ -24,6 +26,18 @@ const Streaming = () => {
24
26
  const { streaming, isLoading, isError } = useStreaming();
25
27
  const bbMsgHistoryRef = useRef<BbMsgHistoryElement>(null);
26
28
 
29
+ useEffect(() => {
30
+ const $blog = document.querySelector("#blog") as HTMLDivElement | null;
31
+ if (!$blog) return;
32
+
33
+ // disable scroll
34
+ // $blog.style.overflow = "hidden";
35
+
36
+ // return () => {
37
+ // $blog.style.overflow = "auto";
38
+ // }
39
+ }, [])
40
+
27
41
  if (isError) {
28
42
  return <div className="p-8 text-center text-gray-500">加载失败</div>;
29
43
  }
@@ -35,15 +49,18 @@ const Streaming = () => {
35
49
  }
36
50
 
37
51
  return (
38
- <div className="h-full w-full p-4">
39
- <bb-msg-history
40
- hide-scroll-bar
41
- ref={bbMsgHistoryRef}
42
- style={{ "height": "100%" }}
43
- >
44
- {formattedData}
45
- </bb-msg-history>
46
- </div>
52
+ <Article title="直播">
53
+ <Panel className="!p-[10px]">
54
+ <bb-msg-history
55
+ // infinite
56
+ hide-scroll-bar
57
+ ref={bbMsgHistoryRef}
58
+ style={{ height: "100%", "--bb-max-height": "200px" } as React.CSSProperties}
59
+ >
60
+ {formattedData}
61
+ </bb-msg-history>
62
+ </Panel>
63
+ </Article>
47
64
  );
48
65
  };
49
66