@blocklet/discuss-kit-ux 1.6.226 → 1.6.228

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.
@@ -3,16 +3,10 @@ import { Chat, Message, Channel } from './types';
3
3
  import { Emitter } from 'mitt';
4
4
 
5
5
  type Events = {
6
- init: {
7
- chats: Chat[];
8
- };
9
6
  message: {
10
7
  chatId: string;
11
8
  message: Message;
12
9
  };
13
- newChat: {
14
- chat: Chat;
15
- };
16
10
  joinChannel: {
17
11
  chatId: string;
18
12
  participant: User;
@@ -45,9 +39,6 @@ export default abstract class ChatClient {
45
39
  chatId: string;
46
40
  message: Message;
47
41
  }) => void): () => void;
48
- onCreateChat(callback: (payload: {
49
- chat: Chat;
50
- }) => void): () => void;
51
42
  onJoinChannel(callback: (payload: {
52
43
  chatId: string;
53
44
  participant: User;
@@ -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 { lazy } from "react";
7
- import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-7-SJaHOi.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-C_fjNX2P.mjs";
8
8
  const BlockletEditor = lazy(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -10,7 +10,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
10
10
  import { useTheme, ThemeProvider, styled } from "@mui/material/styles";
11
11
  import { create as create$1, styled as styled$1 } from "@arcblock/ux/lib/Theme";
12
12
  import { useEffect, useRef, lazy, useState, createElement, useContext, useMemo, isValidElement, Suspense, createContext, Fragment as Fragment$1, forwardRef, useCallback } from "react";
13
- import { Box, useTheme as useTheme$1, useMediaQuery, Tooltip as Tooltip$1, Chip as Chip$1, alpha, ClickAwayListener, Dialog as Dialog$1, DialogTitle, DialogContent, DialogActions, DialogContentText, Button as Button$1, Divider, Skeleton, IconButton as IconButton$2, InputBase, tooltipClasses as tooltipClasses$1, Autocomplete, Typography as Typography$1, TextField as TextField$1, InputAdornment, Backdrop, Badge as Badge$1, Paper, ToggleButtonGroup, ToggleButton } from "@mui/material";
13
+ import { Box, useTheme as useTheme$1, useMediaQuery, Tooltip as Tooltip$1, Chip as Chip$1, alpha, ClickAwayListener, Dialog as Dialog$1, DialogTitle, DialogContent, DialogActions, DialogContentText, Button as Button$1, Divider, Skeleton, IconButton as IconButton$2, InputBase, tooltipClasses as tooltipClasses$1, Backdrop, Autocomplete, Typography as Typography$1, TextField as TextField$1, InputAdornment, Badge as Badge$1, Paper, ToggleButtonGroup, ToggleButton } from "@mui/material";
14
14
  import isNil from "lodash/isNil";
15
15
  import { useEditorConfig, EditorConfigProvider } from "@blocklet/editor/lib/config";
16
16
  import { $getRoot, $createParagraphNode, $createTextNode, KEY_ENTER_COMMAND, COMMAND_PRIORITY_LOW, $getSelection } from "lexical";
@@ -3541,7 +3541,6 @@ class ChatClient {
3541
3541
  // init: () => ChatInitialState;
3542
3542
  async init() {
3543
3543
  const chats = await this.fetchChats();
3544
- this.emitter.emit("init", { chats });
3545
3544
  return { chats };
3546
3545
  }
3547
3546
  destroy() {
@@ -3551,10 +3550,6 @@ class ChatClient {
3551
3550
  this.emitter.on("message", callback);
3552
3551
  return () => this.emitter.off("message", callback);
3553
3552
  }
3554
- onCreateChat(callback) {
3555
- this.emitter.on("newChat", callback);
3556
- return () => this.emitter.off("newChat", callback);
3557
- }
3558
3553
  onJoinChannel(callback) {
3559
3554
  this.emitter.on("joinChannel", callback);
3560
3555
  return () => this.emitter.off("joinChannel", callback);
@@ -3835,7 +3830,6 @@ function ChatProvider({ client: client2, activeChatId, children, isInWallet }) {
3835
3830
  updateLastAckTime(chatId);
3836
3831
  }
3837
3832
  }),
3838
- client2.onCreateChat(({ chat }) => addChat(chat)),
3839
3833
  client2.onJoinChannel(({ chatId, participant }) => addParticipant(chatId, participant)),
3840
3834
  client2.onLeaveChannel(({ chatId, participant }) => removeParticipant(chatId, participant)),
3841
3835
  client2.onDeleteChannel(({ chatId }) => deleteChat(chatId)),
@@ -4728,7 +4722,17 @@ function ChatRoom({ chat, inWallet, ...rest }) {
4728
4722
  return null;
4729
4723
  };
4730
4724
  if (chat.isActivated && !chat.ready) {
4731
- return /* @__PURE__ */ jsx(Box$1, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: 1 }, children: /* @__PURE__ */ jsx(CircularProgress, {}) });
4725
+ return /* @__PURE__ */ jsx(
4726
+ Backdrop,
4727
+ {
4728
+ open: true,
4729
+ sx: {
4730
+ zIndex: theme.zIndex.drawer + 1,
4731
+ bgcolor: "transparent"
4732
+ },
4733
+ children: /* @__PURE__ */ jsx(CircularProgress, {})
4734
+ }
4735
+ );
4732
4736
  }
4733
4737
  return /* @__PURE__ */ jsxs(Box$1, { ...rest, sx: { display: isActive ? "flex" : "none", flexDirection: "column", height: "100%" }, children: [
4734
4738
  !inWallet && /* @__PURE__ */ jsxs(
@@ -5083,7 +5087,17 @@ function Chat({ sx, ...rest }) {
5083
5087
  };
5084
5088
  }, [downMd, activeChatId]);
5085
5089
  if (!initialized) {
5086
- return /* @__PURE__ */ jsx(CircularProgress, {});
5090
+ return /* @__PURE__ */ jsx(
5091
+ Backdrop,
5092
+ {
5093
+ open: true,
5094
+ sx: {
5095
+ zIndex: (theme) => theme.zIndex.drawer + 1,
5096
+ bgcolor: "transparent"
5097
+ },
5098
+ children: /* @__PURE__ */ jsx(CircularProgress, {})
5099
+ }
5100
+ );
5087
5101
  }
5088
5102
  const mergedSx = [{ display: "flex", height: "100%", bgcolor: "#fff" }, ...Array.isArray(sx) ? sx : [sx]];
5089
5103
  const handleNewChannel = async ({ name, description }) => {
@@ -5581,7 +5595,7 @@ function Pagination({
5581
5595
  }
5582
5596
  );
5583
5597
  }
5584
- const Editor = lazy(() => import("./editor-s7PBL7A3.mjs"));
5598
+ const Editor = lazy(() => import("./editor-C9i-Y0CH.mjs"));
5585
5599
  function LazyEditor(props) {
5586
5600
  const fallback = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
5587
5601
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { Q, m, U, A, k, ad, B, E, J, H, K, ap, X, W, _, Y, Z, a0, v, C, w, x, z, a4, a5, ah, a7, N, O, ab, D, ag, af, F, G, b, j, ae, M, P, ao, q, o, ac, R, S, a8, aq, n, a1, a3, ai, al, ak, am, ar, L, as, l, p, r, h, t, f, a9, T, c, $, y, a6, aa, u, an, d, at, a2, aj, e } from "./index-7-SJaHOi.mjs";
2
+ import { Q, m, U, A, k, ad, B, E, J, H, K, ap, X, W, _, Y, Z, a0, v, C, w, x, z, a4, a5, ah, a7, N, O, ab, D, ag, af, F, G, b, j, ae, M, P, ao, q, o, ac, R, S, a8, aq, n, a1, a3, ai, al, ak, am, ar, L, as, l, p, r, h, t, f, a9, T, c, $, y, a6, aa, u, an, d, at, a2, aj, e } from "./index-C_fjNX2P.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -3473,7 +3473,6 @@ var __publicField = (obj, key, value) => {
3473
3473
  // init: () => ChatInitialState;
3474
3474
  async init() {
3475
3475
  const chats = await this.fetchChats();
3476
- this.emitter.emit("init", { chats });
3477
3476
  return { chats };
3478
3477
  }
3479
3478
  destroy() {
@@ -3483,10 +3482,6 @@ var __publicField = (obj, key, value) => {
3483
3482
  this.emitter.on("message", callback);
3484
3483
  return () => this.emitter.off("message", callback);
3485
3484
  }
3486
- onCreateChat(callback) {
3487
- this.emitter.on("newChat", callback);
3488
- return () => this.emitter.off("newChat", callback);
3489
- }
3490
3485
  onJoinChannel(callback) {
3491
3486
  this.emitter.on("joinChannel", callback);
3492
3487
  return () => this.emitter.off("joinChannel", callback);
@@ -3767,7 +3762,6 @@ var __publicField = (obj, key, value) => {
3767
3762
  updateLastAckTime(chatId);
3768
3763
  }
3769
3764
  }),
3770
- client2.onCreateChat(({ chat }) => addChat(chat)),
3771
3765
  client2.onJoinChannel(({ chatId, participant }) => addParticipant(chatId, participant)),
3772
3766
  client2.onLeaveChannel(({ chatId, participant }) => removeParticipant(chatId, participant)),
3773
3767
  client2.onDeleteChannel(({ chatId }) => deleteChat(chatId)),
@@ -4660,7 +4654,17 @@ var __publicField = (obj, key, value) => {
4660
4654
  return null;
4661
4655
  };
4662
4656
  if (chat.isActivated && !chat.ready) {
4663
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, {}) });
4657
+ return /* @__PURE__ */ jsxRuntime.jsx(
4658
+ material.Backdrop,
4659
+ {
4660
+ open: true,
4661
+ sx: {
4662
+ zIndex: theme.zIndex.drawer + 1,
4663
+ bgcolor: "transparent"
4664
+ },
4665
+ children: /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, {})
4666
+ }
4667
+ );
4664
4668
  }
4665
4669
  return /* @__PURE__ */ jsxRuntime.jsxs(Box, { ...rest, sx: { display: isActive ? "flex" : "none", flexDirection: "column", height: "100%" }, children: [
4666
4670
  !inWallet && /* @__PURE__ */ jsxRuntime.jsxs(
@@ -5015,7 +5019,17 @@ var __publicField = (obj, key, value) => {
5015
5019
  };
5016
5020
  }, [downMd, activeChatId]);
5017
5021
  if (!initialized) {
5018
- return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, {});
5022
+ return /* @__PURE__ */ jsxRuntime.jsx(
5023
+ material.Backdrop,
5024
+ {
5025
+ open: true,
5026
+ sx: {
5027
+ zIndex: (theme) => theme.zIndex.drawer + 1,
5028
+ bgcolor: "transparent"
5029
+ },
5030
+ children: /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, {})
5031
+ }
5032
+ );
5019
5033
  }
5020
5034
  const mergedSx = [{ display: "flex", height: "100%", bgcolor: "#fff" }, ...Array.isArray(sx) ? sx : [sx]];
5021
5035
  const handleNewChannel = async ({ name, description }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.6.226",
3
+ "version": "1.6.228",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -28,10 +28,10 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@arcblock/bridge": "^2.9.65",
31
+ "@arcblock/bridge": "^2.9.75",
32
32
  "@arcblock/ws": "^1.18.115",
33
- "@blocklet/editor": "1.6.226",
34
- "@blocklet/labels": "1.6.226",
33
+ "@blocklet/editor": "1.6.228",
34
+ "@blocklet/labels": "1.6.228",
35
35
  "@blocklet/uploader": "^0.0.78",
36
36
  "@emotion/css": "^11.10.5",
37
37
  "@emotion/react": "^11.10.5",
@@ -95,5 +95,5 @@
95
95
  "resolutions": {
96
96
  "react": "^18.2.0"
97
97
  },
98
- "gitHead": "6438baadf89714dc2fe1e4ee851bc8ac7c8b35c3"
98
+ "gitHead": "06637438fe38e74912996e17e7c78fedee89cfdd"
99
99
  }