@blocklet/discuss-kit-ux 2.3.82 → 2.3.84

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.
@@ -4,7 +4,7 @@ import { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangeP
4
4
  import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
5
5
  import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
6
6
  import { lazyRetry } from "@arcblock/ux/lib/Util";
7
- import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-DRSFs9oe.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-h097ecr7.mjs";
8
8
  const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -4189,7 +4189,19 @@ function ChatProvider({
4189
4189
  const init = async () => {
4190
4190
  try {
4191
4191
  const { chats } = await client2.init();
4192
- setState({ initialized: true, chats });
4192
+ let activeChat = null;
4193
+ if (activeChatId && !chats.find((chat) => chat.id === activeChatId)) {
4194
+ try {
4195
+ const {
4196
+ chat,
4197
+ messages: { messages, nextCursor }
4198
+ } = await client2.fetchChat(activeChatId);
4199
+ activeChat = { ...chat, messages, nextCursor, ready: true };
4200
+ } catch (e) {
4201
+ console.error(e);
4202
+ }
4203
+ }
4204
+ setState({ initialized: true, chats: activeChat ? [activeChat, ...chats] : chats });
4193
4205
  } catch (e) {
4194
4206
  console.error(e);
4195
4207
  setState({ error: e.message });
@@ -4992,7 +5004,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
4992
5004
  }
4993
5005
  const tablerSend = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 14L21 3m0 0l-6.5 18a.55.55 0 0 1-1 0L10 14l-7-3.5a.55.55 0 0 1 0-1z" }) });
4994
5006
  const tablerLetterCase = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M14 15.5a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0-7 0M3 19V8.5a3.5 3.5 0 0 1 7 0V19m-7-6h7m11-1v7" }) });
4995
- const Editor = lazyRetry(() => import("./editor-DC2vk1XQ.mjs"));
5007
+ const Editor = lazyRetry(() => import("./editor-gidK4SQd.mjs"));
4996
5008
  function LazyEditor(props) {
4997
5009
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
4998
5010
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { W, o, Y, A, n, af, B, G, N, L, O, ar, _, Z, a1, $, a0, a3, x, C, y, z, F, a7, a8, aj, aa, T, U, ae, D, ai, ah, K, H, J, aG, aH, b, m, ag, M, P, aC, aq, w, v, aE, aF, R, S, ab, as, aD, q, a4, a6, ak, an, am, aI, aA, at, Q, ao, aK, au, aJ, ax, ay, aL, l, az, h, p, r, k, aw, t, j, ac, aB, X, c, a2, E, a9, ad, e, u, ap, d, av, a5, al, f } from "./index-DRSFs9oe.mjs";
2
+ import { W, o, Y, A, n, af, B, G, N, L, O, ar, _, Z, a1, $, a0, a3, x, C, y, z, F, a7, a8, aj, aa, T, U, ae, D, ai, ah, K, H, J, aG, aH, b, m, ag, M, P, aC, aq, w, v, aE, aF, R, S, ab, as, aD, q, a4, a6, ak, an, am, aI, aA, at, Q, ao, aK, au, aJ, ax, ay, aL, l, az, h, p, r, k, aw, t, j, ac, aB, X, c, a2, E, a9, ad, e, u, ap, d, av, a5, al, f } from "./index-h097ecr7.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -4111,7 +4111,19 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4111
4111
  const init = async () => {
4112
4112
  try {
4113
4113
  const { chats } = await client2.init();
4114
- setState({ initialized: true, chats });
4114
+ let activeChat = null;
4115
+ if (activeChatId && !chats.find((chat) => chat.id === activeChatId)) {
4116
+ try {
4117
+ const {
4118
+ chat,
4119
+ messages: { messages, nextCursor }
4120
+ } = await client2.fetchChat(activeChatId);
4121
+ activeChat = { ...chat, messages, nextCursor, ready: true };
4122
+ } catch (e) {
4123
+ console.error(e);
4124
+ }
4125
+ }
4126
+ setState({ initialized: true, chats: activeChat ? [activeChat, ...chats] : chats });
4115
4127
  } catch (e) {
4116
4128
  console.error(e);
4117
4129
  setState({ error: e.message });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.3.82",
3
+ "version": "2.3.84",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -18,9 +18,9 @@
18
18
  "access": "public"
19
19
  },
20
20
  "dependencies": {
21
- "@arcblock/bridge": "^2.13.62",
22
- "@arcblock/react-hooks": "^2.13.62",
23
- "@arcblock/ws": "^1.20.13",
21
+ "@arcblock/bridge": "^2.13.63",
22
+ "@arcblock/react-hooks": "^2.13.63",
23
+ "@arcblock/ws": "^1.20.14",
24
24
  "@blocklet/uploader": "^0.1.95",
25
25
  "@emotion/css": "^11.13.0",
26
26
  "@emotion/react": "^11.13.3",
@@ -45,8 +45,8 @@
45
45
  "ufo": "^1.5.4",
46
46
  "unstated-next": "^1.1.0",
47
47
  "url-join": "^4.0.1",
48
- "@blocklet/editor": "^2.3.82",
49
- "@blocklet/labels": "^2.3.82"
48
+ "@blocklet/editor": "^2.3.84",
49
+ "@blocklet/labels": "^2.3.84"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@arcblock/did-connect": "^2.10.36",