@bbki.ng/site 5.4.5 → 5.4.7

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.7
4
+
5
+ ## 5.4.6
6
+
3
7
  ## 5.4.5
4
8
 
5
9
  ## 5.4.4
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.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>
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.5",
3
+ "version": "5.4.7",
4
4
  "description": "code behind bbki.ng",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  import useSWR from "swr";
2
2
  import { baseFetcher, withBBApi } from "@/utils";
3
3
  import { API_CF_ENDPOINT } from "@/constants/routes";
4
- import { useContext, useEffect } from "react";
4
+ import { useContext, useEffect, useState } from "react";
5
5
  import { GlobalLoadingContext } from "@/context/global_loading_state_provider";
6
6
 
7
7
  // In dev, use /api prefix to leverage Vite proxy to localhost:8787
@@ -26,6 +26,15 @@ export const useStreaming = () => {
26
26
 
27
27
  const isLoading = !data && !error;
28
28
 
29
+ const [_, forceUpdate] = useState(0);
30
+
31
+ // make rerender when customElement defined
32
+ useEffect(() => {
33
+ customElements.whenDefined("bb-msg-history").then(() => {
34
+ forceUpdate((prev) => prev + 1);
35
+ });
36
+ }, [])
37
+
29
38
  const { setIsLoading } = useContext(GlobalLoadingContext);
30
39
 
31
40
  useEffect(() => {
@@ -37,6 +37,7 @@ const Streaming = () => {
37
37
  return (
38
38
  <div className="h-full w-full p-4">
39
39
  <bb-msg-history
40
+ hide-scroll-bar
40
41
  ref={bbMsgHistoryRef}
41
42
  style={{ "height": "100%" }}
42
43
  >