@blocklet/discuss-kit-ux 2.0.0 → 2.0.2

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/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("@arcblock/ux/lib/Theme"), require("react"), require("@mui/material"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("react-lazy-with-preload"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), require("@mui/material/Box"), require("@mui/lab/LoadingButton"), require("@mui/icons-material"), require("@arcblock/ux/lib/Locale/context"), require("@mui/material/Alert"), require("lodash/isBoolean"), require("@mui/material/Button"), require("@arcblock/did-connect/lib/Avatar"), require("@mui/material/AvatarGroup"), require("@mui/material/colors"), require("@mui/material/useMediaQuery"), require("@arcblock/ux/lib/DID"), require("@mui/material/Tooltip"), require("react-router-dom"), require("@arcblock/ux/lib/RelativeTime"), require("@mui/material/Chip"), require("@mui/material/Stack"), require("lodash/groupBy"), require("lodash/flatMap"), require("lodash/uniqBy"), require("lodash/trim"), require("@mui/material/Avatar"), require("@mui/icons-material/BrokenImage"), require("@iconify/react"), require("@arcblock/ux/lib/Empty"), require("@arcblock/did-connect/lib/Session"), require("@mui/icons-material/NotificationsActiveOutlined"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), require("@arcblock/did-connect/lib/Address"), require("@mui/material/MenuItem"), require("clsx"), require("@mui/material/IconButton"), require("@mui/material/Menu"), require("@arcblock/ux/lib/Dialog"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("url-join"), require("react-dom"), require("dayjs"), require("dayjs/plugin/relativeTime"), require("mitt"), require("@mui/material/CircularProgress"), require("react-helmet"), require("react-flip-toolkit"), require("@mui/material/colors/grey"), require("semver-compare"), require("@arcblock/bridge"), require("@arcblock/react-hooks"), require("@mui/material/Fab"), require("lodash/debounce"), require("@mui/material/TextField"), require("@mui/icons-material/Add"), require("axios"), require("@arcblock/ux/lib/Toast"), require("@mui/material/Pagination"), require("unstated-next"), require("js-cookie"), require("@arcblock/ws"), require("@emotion/css"), require("@blocklet/editor/lib/ext/OnContentChangePlugin"), require("@blocklet/editor/lib/ext/ShortcutPlugin"), require("@blocklet/editor/lib/ext/SafeAreaPlugin"), require("@lexical/text"), require("@blocklet/editor/lib/main/nodes/ImageNode"), require("@blocklet/editor/lib/ext/VideoPlugin/VideoNode")) : typeof define === "function" && define.amd ? define(["exports", "@blocklet/labels", "react/jsx-runtime", "@mui/material/styles", "@arcblock/ux/lib/Theme", "react", "@mui/material", "lodash/isNil", "@blocklet/editor/lib/config", "react-lazy-with-preload", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@mui/material/Box", "@mui/lab/LoadingButton", "@mui/icons-material", "@arcblock/ux/lib/Locale/context", "@mui/material/Alert", "lodash/isBoolean", "@mui/material/Button", "@arcblock/did-connect/lib/Avatar", "@mui/material/AvatarGroup", "@mui/material/colors", "@mui/material/useMediaQuery", "@arcblock/ux/lib/DID", "@mui/material/Tooltip", "react-router-dom", "@arcblock/ux/lib/RelativeTime", "@mui/material/Chip", "@mui/material/Stack", "lodash/groupBy", "lodash/flatMap", "lodash/uniqBy", "lodash/trim", "@mui/material/Avatar", "@mui/icons-material/BrokenImage", "@iconify/react", "@arcblock/ux/lib/Empty", "@arcblock/did-connect/lib/Session", "@mui/icons-material/NotificationsActiveOutlined", "@blocklet/editor/lib/ext/CheckboxPlugin", "@arcblock/did-connect/lib/Address", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@arcblock/ux/lib/Dialog", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "url-join", "react-dom", "dayjs", "dayjs/plugin/relativeTime", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/colors/grey", "semver-compare", "@arcblock/bridge", "@arcblock/react-hooks", "@mui/material/Fab", "lodash/debounce", "@mui/material/TextField", "@mui/icons-material/Add", "axios", "@arcblock/ux/lib/Toast", "@mui/material/Pagination", "unstated-next", "js-cookie", "@arcblock/ws", "@emotion/css", "@blocklet/editor/lib/ext/OnContentChangePlugin", "@blocklet/editor/lib/ext/ShortcutPlugin", "@blocklet/editor/lib/ext/SafeAreaPlugin", "@lexical/text", "@blocklet/editor/lib/main/nodes/ImageNode", "@blocklet/editor/lib/ext/VideoPlugin/VideoNode"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.DiscussKitComponents = {}, global.labels, global.jsxRuntime, global.styles, global.Theme, global.react, global.material, global.isNil, global.config, global.reactLazyWithPreload, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.Box, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, global.DidAvatar, global.AvatarGroup, global.colors, global.useMediaQuery, global.DID, global.Tooltip, global.reactRouterDom, global.UxRelativeTime, global.Chip, global.Stack, global.groupBy, global.flatMap, global.uniqBy, global.trim, global.Avatar$1, global.BrokenImageIcon, global.react$1, global.Empty$3, global.Session, global.NotificationsActiveOutlinedIcon, global.CheckboxPlugin, global.DIDAddress, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.Dialog, global.orderBy, global.Typography, global.Skeleton, global.joinUrl, global.ReactDOM, global.dayjs, global.relativeTime, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.grey, global.cmp, global.bridge, global.reactHooks, global.Fab, global.debounce, global.TextField, global.AddIcon, global.axios, global.Toast, global.MuiPagination, global.unstatedNext, global.Cookie, global.ws, global.css, global.OnContentChangePlugin, global.ShortcutPlugin, global.SafeAreaPlugin, global.text, global.ImageNode, global.VideoNode));
3
- })(this, function(exports2, labels, jsxRuntime, styles, Theme, react, material, isNil, config, reactLazyWithPreload, LexicalComposerContext, lexical$1, ahooks, Box, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, DidAvatar, AvatarGroup, colors, useMediaQuery, DID, Tooltip, reactRouterDom, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$3, Session, NotificationsActiveOutlinedIcon, CheckboxPlugin, DIDAddress, MuiMenuItem, clsx, IconButton$1, MuiMenu, Dialog, orderBy, Typography, Skeleton, joinUrl, ReactDOM, dayjs, relativeTime, mitt, CircularProgress, reactHelmet, reactFlipToolkit, grey, cmp, bridge, reactHooks, Fab, debounce, TextField, AddIcon, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, css, OnContentChangePlugin, ShortcutPlugin, SafeAreaPlugin, text, ImageNode, VideoNode) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("@arcblock/ux/lib/Theme"), require("react"), require("@mui/material"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("react-lazy-with-preload"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), require("@mui/material/Box"), require("@mui/lab/LoadingButton"), require("@mui/icons-material"), require("@arcblock/ux/lib/Locale/context"), require("@mui/material/Alert"), require("lodash/isBoolean"), require("@mui/material/Button"), require("@arcblock/did-connect/lib/Avatar"), require("@mui/material/AvatarGroup"), require("@mui/material/colors"), require("@mui/material/useMediaQuery"), require("@arcblock/ux/lib/DID"), require("@mui/material/Tooltip"), require("react-router-dom"), require("@arcblock/ux/lib/RelativeTime"), require("@mui/material/Chip"), require("@mui/material/Stack"), require("lodash/groupBy"), require("lodash/flatMap"), require("lodash/uniqBy"), require("lodash/trim"), require("@mui/material/Avatar"), require("@mui/icons-material/BrokenImage"), require("@iconify/react"), require("@arcblock/ux/lib/Empty"), require("@arcblock/did-connect/lib/Session"), require("@mui/icons-material/NotificationsActiveOutlined"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), require("@arcblock/did-connect/lib/Address"), require("@mui/material/MenuItem"), require("clsx"), require("@mui/material/IconButton"), require("@mui/material/Menu"), require("@arcblock/ux/lib/Dialog"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("url-join"), require("react-dom"), require("dayjs"), require("dayjs/plugin/relativeTime"), require("mitt"), require("@mui/material/CircularProgress"), require("react-helmet"), require("react-flip-toolkit"), require("@mui/material/colors/grey"), require("semver-compare"), require("@arcblock/bridge"), require("@arcblock/react-hooks"), require("@mui/material/Fab"), require("lodash/debounce"), require("@blocklet/editor/lib/main/hooks/useIsFocused"), require("@mui/material/TextField"), require("@mui/icons-material/Add"), require("@arcblock/did-connect/lib/SessionManager"), require("axios"), require("@arcblock/ux/lib/Toast"), require("@mui/material/Pagination"), require("unstated-next"), require("js-cookie"), require("@arcblock/ws"), require("@emotion/css"), require("@blocklet/editor/lib/ext/OnContentChangePlugin"), require("@blocklet/editor/lib/ext/ShortcutPlugin"), require("@blocklet/editor/lib/ext/SafeAreaPlugin"), require("@lexical/text"), require("@blocklet/editor/lib/main/nodes/ImageNode"), require("@blocklet/editor/lib/ext/VideoPlugin/VideoNode")) : typeof define === "function" && define.amd ? define(["exports", "@blocklet/labels", "react/jsx-runtime", "@mui/material/styles", "@arcblock/ux/lib/Theme", "react", "@mui/material", "lodash/isNil", "@blocklet/editor/lib/config", "react-lazy-with-preload", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@mui/material/Box", "@mui/lab/LoadingButton", "@mui/icons-material", "@arcblock/ux/lib/Locale/context", "@mui/material/Alert", "lodash/isBoolean", "@mui/material/Button", "@arcblock/did-connect/lib/Avatar", "@mui/material/AvatarGroup", "@mui/material/colors", "@mui/material/useMediaQuery", "@arcblock/ux/lib/DID", "@mui/material/Tooltip", "react-router-dom", "@arcblock/ux/lib/RelativeTime", "@mui/material/Chip", "@mui/material/Stack", "lodash/groupBy", "lodash/flatMap", "lodash/uniqBy", "lodash/trim", "@mui/material/Avatar", "@mui/icons-material/BrokenImage", "@iconify/react", "@arcblock/ux/lib/Empty", "@arcblock/did-connect/lib/Session", "@mui/icons-material/NotificationsActiveOutlined", "@blocklet/editor/lib/ext/CheckboxPlugin", "@arcblock/did-connect/lib/Address", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@arcblock/ux/lib/Dialog", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "url-join", "react-dom", "dayjs", "dayjs/plugin/relativeTime", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/colors/grey", "semver-compare", "@arcblock/bridge", "@arcblock/react-hooks", "@mui/material/Fab", "lodash/debounce", "@blocklet/editor/lib/main/hooks/useIsFocused", "@mui/material/TextField", "@mui/icons-material/Add", "@arcblock/did-connect/lib/SessionManager", "axios", "@arcblock/ux/lib/Toast", "@mui/material/Pagination", "unstated-next", "js-cookie", "@arcblock/ws", "@emotion/css", "@blocklet/editor/lib/ext/OnContentChangePlugin", "@blocklet/editor/lib/ext/ShortcutPlugin", "@blocklet/editor/lib/ext/SafeAreaPlugin", "@lexical/text", "@blocklet/editor/lib/main/nodes/ImageNode", "@blocklet/editor/lib/ext/VideoPlugin/VideoNode"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.DiscussKitComponents = {}, global.labels, global.jsxRuntime, global.styles, global.Theme, global.react, global.material, global.isNil, global.config, global.reactLazyWithPreload, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.Box, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, global.DidAvatar, global.AvatarGroup, global.colors, global.useMediaQuery, global.DID, global.Tooltip, global.reactRouterDom, global.UxRelativeTime, global.Chip, global.Stack, global.groupBy, global.flatMap, global.uniqBy, global.trim, global.Avatar$1, global.BrokenImageIcon, global.react$1, global.Empty$3, global.Session, global.NotificationsActiveOutlinedIcon, global.CheckboxPlugin, global.DIDAddress, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.Dialog, global.orderBy, global.Typography, global.Skeleton, global.joinUrl, global.ReactDOM, global.dayjs, global.relativeTime, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.grey, global.cmp, global.bridge, global.reactHooks, global.Fab, global.debounce, global.useIsFocused, global.TextField, global.AddIcon, global.SessionManager, global.axios, global.Toast, global.MuiPagination, global.unstatedNext, global.Cookie, global.ws, global.css, global.OnContentChangePlugin, global.ShortcutPlugin$1, global.SafeAreaPlugin, global.text, global.ImageNode, global.VideoNode));
3
+ })(this, function(exports2, labels, jsxRuntime, styles, Theme, react, material, isNil, config, reactLazyWithPreload, LexicalComposerContext, lexical$1, ahooks, Box, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, DidAvatar, AvatarGroup, colors, useMediaQuery, DID, Tooltip, reactRouterDom, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$3, Session, NotificationsActiveOutlinedIcon, CheckboxPlugin, DIDAddress, MuiMenuItem, clsx, IconButton$1, MuiMenu, Dialog, orderBy, Typography, Skeleton, joinUrl, ReactDOM, dayjs, relativeTime, mitt, CircularProgress, reactHelmet, reactFlipToolkit, grey, cmp, bridge, reactHooks, Fab, debounce, useIsFocused, TextField, AddIcon, SessionManager, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, css, OnContentChangePlugin, ShortcutPlugin$1, SafeAreaPlugin, text, ImageNode, VideoNode) {
4
4
  "use strict";var __defProp = Object.defineProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
6
  var __publicField = (obj, key, value) => {
@@ -436,7 +436,7 @@ var __publicField = (obj, key, value) => {
436
436
  }, [editor2]);
437
437
  return null;
438
438
  }
439
- function AutoClearPlugin({ value, isChanged }) {
439
+ function AutoClearPlugin$1({ value, isChanged }) {
440
440
  const [editor2] = LexicalComposerContext.useLexicalComposerContext();
441
441
  react.useEffect(() => {
442
442
  try {
@@ -584,7 +584,7 @@ var __publicField = (obj, key, value) => {
584
584
  /* @__PURE__ */ jsxRuntime.jsx(CmdEnterShortcutPlugin, { shortcut, callback: handleCmdEnterPressed }),
585
585
  /* @__PURE__ */ jsxRuntime.jsx(ImagePathFixerPlugin, {}),
586
586
  /* @__PURE__ */ jsxRuntime.jsx(VideoPathFixerPlugin, {}),
587
- /* @__PURE__ */ jsxRuntime.jsx(AutoClearPlugin, { value: content, isChanged: isChanged.current }),
587
+ /* @__PURE__ */ jsxRuntime.jsx(AutoClearPlugin$1, { value: content, isChanged: isChanged.current }),
588
588
  children
589
589
  ]
590
590
  }
@@ -3920,6 +3920,7 @@ var __publicField = (obj, key, value) => {
3920
3920
  sx: {
3921
3921
  position: "relative",
3922
3922
  m: 1,
3923
+ mx: { xs: 0, sm: 1 },
3923
3924
  py: 1.5,
3924
3925
  px: 2,
3925
3926
  fontWeight: "bold",
@@ -3991,7 +3992,6 @@ var __publicField = (obj, key, value) => {
3991
3992
  };
3992
3993
  const baseItemSx = {
3993
3994
  px: 1.25,
3994
- py: 1,
3995
3995
  transition: "all 120ms linear"
3996
3996
  };
3997
3997
  function Message({ message, prevMessage, showTime = true, ...rest }) {
@@ -4044,7 +4044,9 @@ var __publicField = (obj, key, value) => {
4044
4044
  },
4045
4045
  ".author-info-title": {
4046
4046
  fontSize: 14,
4047
- fontWeight: 500
4047
+ fontWeight: 500,
4048
+ // username 下方首条消息的 margin-top
4049
+ "+ div": { mt: 1 }
4048
4050
  },
4049
4051
  ".author-chat-item": {
4050
4052
  ml: compactMessage ? 6 : 0,
@@ -4139,7 +4141,7 @@ var __publicField = (obj, key, value) => {
4139
4141
  const baseCardSx = {
4140
4142
  py: 1.5,
4141
4143
  px: 2,
4142
- background: "#fff",
4144
+ bgcolor: "grey.50",
4143
4145
  width: "fit-content",
4144
4146
  maxWidth: "calc(100% - 16px)",
4145
4147
  wordWrap: "break-word",
@@ -4369,7 +4371,7 @@ var __publicField = (obj, key, value) => {
4369
4371
  }
4370
4372
  return /* @__PURE__ */ jsxRuntime.jsx(Message, { message, showTime: false });
4371
4373
  };
4372
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { ...baseItemSx, fontSize: 14 }, children: render() });
4374
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { ...baseItemSx, py: 0.5, fontSize: 14 }, children: render() });
4373
4375
  }
4374
4376
  const checkIsAtBottom = (element) => {
4375
4377
  return element && (element.scrollHeight === 0 || element.scrollHeight - element.scrollTop < element.clientHeight + 60);
@@ -4384,7 +4386,7 @@ var __publicField = (obj, key, value) => {
4384
4386
  const [isLoadingMore, setIsLoadingMore] = react.useState(false);
4385
4387
  const scrollToBottom = () => {
4386
4388
  var _a3, _b3;
4387
- (_b3 = containerRef.current) == null ? void 0 : _b3.scrollTo({ top: ((_a3 = containerRef.current) == null ? void 0 : _a3.scrollHeight) || 0, behavior: "smooth" });
4389
+ (_b3 = containerRef.current) == null ? void 0 : _b3.scrollTo({ top: ((_a3 = containerRef.current) == null ? void 0 : _a3.scrollHeight) || 0 });
4388
4390
  setIsAtBottom(true);
4389
4391
  };
4390
4392
  react.useEffect(() => {
@@ -4419,7 +4421,6 @@ var __publicField = (obj, key, value) => {
4419
4421
  py: 2.5,
4420
4422
  px: 1.25,
4421
4423
  gap: 1,
4422
- background: "rgba(249, 250, 251, 1)",
4423
4424
  // 闪烁
4424
4425
  "@keyframes blinking": {
4425
4426
  "0%": { opacity: 0 },
@@ -4594,6 +4595,270 @@ var __publicField = (obj, key, value) => {
4594
4595
  }
4595
4596
  );
4596
4597
  }
4598
+ const tablerSend = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", "data-iconify": "tabler", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.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" }) });
4599
+ const tablerLetterCase = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", "data-iconify": "tabler", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.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" }) });
4600
+ const Editor$1 = react.lazy(() => Promise.resolve().then(() => editor));
4601
+ function LazyEditor(props) {
4602
+ const fallback2 = /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { px: 3 }, children: [
4603
+ /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, {}),
4604
+ /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "80%" }),
4605
+ /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "60%" }),
4606
+ /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "40%" })
4607
+ ] });
4608
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: fallback2, children: /* @__PURE__ */ jsxRuntime.jsx(Editor$1, { ...props }) });
4609
+ }
4610
+ const BlockletEditor$1 = react.lazy(() => import("@blocklet/editor"));
4611
+ const fallback = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4612
+ /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, {}),
4613
+ /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "80%" }),
4614
+ /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "60%" }),
4615
+ /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "40%" })
4616
+ ] });
4617
+ function EditorPreview({ content, children, ...rest }) {
4618
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback, children: /* @__PURE__ */ jsxRuntime.jsxs(
4619
+ BlockletEditor$1,
4620
+ {
4621
+ editorState: inferInitialEditorState(content),
4622
+ editable: false,
4623
+ enableHeadingsIdPlugin: true,
4624
+ ...rest,
4625
+ children: [
4626
+ /* @__PURE__ */ jsxRuntime.jsx(ImagePathFixerPlugin, {}),
4627
+ /* @__PURE__ */ jsxRuntime.jsx(VideoPathFixerPlugin, {}),
4628
+ children
4629
+ ]
4630
+ }
4631
+ ) });
4632
+ }
4633
+ EditorPreview.fallback = fallback;
4634
+ function AutoClearPlugin({ clearKey }) {
4635
+ const [editor2] = LexicalComposerContext.useLexicalComposerContext();
4636
+ react.useEffect(() => {
4637
+ if (editor2 && clearKey) {
4638
+ editor2.update(() => {
4639
+ const root = lexical$1.$getRoot();
4640
+ root.clear();
4641
+ });
4642
+ }
4643
+ }, [editor2, clearKey]);
4644
+ return null;
4645
+ }
4646
+ function FocusPlugin({ callback }) {
4647
+ const hasFocus = useIsFocused.useIsFocused();
4648
+ react.useEffect(() => {
4649
+ callback(hasFocus);
4650
+ }, [callback, hasFocus]);
4651
+ return null;
4652
+ }
4653
+ function DraggerPlugin() {
4654
+ const [editor2] = LexicalComposerContext.useLexicalComposerContext();
4655
+ const { mobile } = reactHooks.useBrowser();
4656
+ const hasFocus = useIsFocused.useIsFocused();
4657
+ const selection = editor2.getEditorState().read(lexical$1.$getSelection);
4658
+ const enabled = mobile.any && hasFocus && selection;
4659
+ if (enabled) {
4660
+ return /* @__PURE__ */ jsxRuntime.jsx(
4661
+ material.Box,
4662
+ {
4663
+ sx: {
4664
+ position: "absolute",
4665
+ left: "50%",
4666
+ top: 4,
4667
+ width: 64,
4668
+ marginLeft: "-32px",
4669
+ height: 4,
4670
+ bgcolor: "grey.300",
4671
+ borderRadius: 0.1
4672
+ }
4673
+ }
4674
+ );
4675
+ }
4676
+ return null;
4677
+ }
4678
+ function ShortcutPlugin({ callback }) {
4679
+ const [editor2] = LexicalComposerContext.useLexicalComposerContext();
4680
+ const { mobile } = reactHooks.useBrowser();
4681
+ react.useEffect(() => {
4682
+ let dispatching = false;
4683
+ return editor2.registerCommand(
4684
+ lexical$1.KEY_ENTER_COMMAND,
4685
+ (e) => {
4686
+ if (dispatching || mobile.any) {
4687
+ dispatching = false;
4688
+ return false;
4689
+ }
4690
+ if (e.shiftKey) {
4691
+ dispatching = true;
4692
+ const keyboardEvent = new KeyboardEvent("keydown", {
4693
+ code: "Enter",
4694
+ key: "Enter",
4695
+ charCode: 13,
4696
+ keyCode: 13,
4697
+ view: window,
4698
+ bubbles: true
4699
+ });
4700
+ e.preventDefault();
4701
+ editor2.dispatchCommand(lexical$1.KEY_ENTER_COMMAND, keyboardEvent);
4702
+ return true;
4703
+ }
4704
+ callback();
4705
+ return true;
4706
+ },
4707
+ lexical$1.COMMAND_PRIORITY_CRITICAL
4708
+ );
4709
+ }, [editor2, callback, mobile.any]);
4710
+ return null;
4711
+ }
4712
+ function ChatInput({ initialContent, send, onContentChange }) {
4713
+ const { t } = context.useLocaleContext();
4714
+ const [content, setContent] = react.useState("");
4715
+ const [lastSent, setLastSent] = react.useState(0);
4716
+ const [toolbarVisible, setToolbarVisible] = ahooks.useLocalStorageState("chat-input-toolbar-visible", {
4717
+ defaultValue: false
4718
+ });
4719
+ const { mobile } = reactHooks.useBrowser();
4720
+ const [focused, setFocused] = react.useState(false);
4721
+ const compactView = mobile.any && !focused;
4722
+ const handleSend = () => {
4723
+ send(content);
4724
+ setContent("");
4725
+ setLastSent(Date.now());
4726
+ };
4727
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4728
+ material.Box,
4729
+ {
4730
+ sx: {
4731
+ position: "relative",
4732
+ pb: 5,
4733
+ border: 1,
4734
+ borderColor: "divider",
4735
+ borderRadius: 1,
4736
+ overflow: "hidden",
4737
+ ".be-shell": { borderTop: "0 !important" },
4738
+ ".be-shell .toolbar": { bgcolor: "grey.50", ...!toolbarVisible && { display: "none" } },
4739
+ ".be-shell .be-editable": { px: "16px !important" },
4740
+ ".be-shell .be-placeholder": { left: 16 },
4741
+ ".be-shell .be-editable, .be-shell .be-content": { minHeight: "20px !important" },
4742
+ ".be-shell .be-editable p": { my: 0 },
4743
+ ".draggable-block-menu": { display: "none" },
4744
+ ...compactView && {
4745
+ pb: 0,
4746
+ borderRadius: 2,
4747
+ borderBottomLeftRadius: 0,
4748
+ borderBottomRightRadius: 0
4749
+ }
4750
+ },
4751
+ children: [
4752
+ /* @__PURE__ */ jsxRuntime.jsxs(
4753
+ material.Box,
4754
+ {
4755
+ sx: {
4756
+ maxHeight: 400,
4757
+ overflowY: "auto",
4758
+ ...compactView && {
4759
+ height: 44 + (toolbarVisible ? 44 : 0),
4760
+ pt: toolbarVisible ? 0 : 0.5,
4761
+ pb: 0.5,
4762
+ overflow: "hidden",
4763
+ ".be-shell .be-editable": { pr: "44px !important" }
4764
+ }
4765
+ },
4766
+ children: [
4767
+ compactView && !toolbarVisible && /* @__PURE__ */ jsxRuntime.jsx(
4768
+ material.Box,
4769
+ {
4770
+ sx: {
4771
+ position: "absolute",
4772
+ right: 12,
4773
+ top: 12,
4774
+ display: "flex",
4775
+ justifyContent: "center",
4776
+ alignItems: "center",
4777
+ width: 28,
4778
+ height: 28,
4779
+ bgcolor: "grey.300",
4780
+ borderRadius: "100%"
4781
+ },
4782
+ children: /* @__PURE__ */ jsxRuntime.jsx(material.Box, { component: tablerSend, sx: { fontSize: 13, color: "text.secondary" } })
4783
+ }
4784
+ ),
4785
+ /* @__PURE__ */ jsxRuntime.jsxs(
4786
+ LazyEditor,
4787
+ {
4788
+ enableSaveAreaPlugin: false,
4789
+ initialContent: initialContent || "",
4790
+ onChange: ({ content: contentStr, isEmpty }) => {
4791
+ const value = isEmpty ? "" : contentStr;
4792
+ setContent(value);
4793
+ onContentChange == null ? void 0 : onContentChange(value);
4794
+ },
4795
+ autoFocus: false,
4796
+ ignoreInitialChange: false,
4797
+ placeholder: "Jot something down",
4798
+ children: [
4799
+ /* @__PURE__ */ jsxRuntime.jsx(AutoClearPlugin, { clearKey: lastSent }),
4800
+ /* @__PURE__ */ jsxRuntime.jsx(ShortcutPlugin, { callback: handleSend }),
4801
+ /* @__PURE__ */ jsxRuntime.jsx(DraggerPlugin, {}),
4802
+ /* @__PURE__ */ jsxRuntime.jsx(FocusPlugin, { callback: (v2) => setFocused(v2) })
4803
+ ]
4804
+ }
4805
+ )
4806
+ ]
4807
+ }
4808
+ ),
4809
+ /* @__PURE__ */ jsxRuntime.jsxs(
4810
+ material.Box,
4811
+ {
4812
+ sx: {
4813
+ display: "flex",
4814
+ justifyContent: "space-between",
4815
+ alignItems: "center",
4816
+ position: "absolute",
4817
+ left: 0,
4818
+ right: 0,
4819
+ bottom: 0,
4820
+ height: 40,
4821
+ p: 1,
4822
+ ...compactView && { display: "none" }
4823
+ },
4824
+ children: [
4825
+ /* @__PURE__ */ jsxRuntime.jsx(
4826
+ material.Button,
4827
+ {
4828
+ size: "small",
4829
+ color: "primary",
4830
+ variant: "text",
4831
+ onClick: () => setToolbarVisible((x) => !x),
4832
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(material.Box, { component: tablerLetterCase, sx: { fontSize: "14px !important" } }),
4833
+ sx: {
4834
+ width: 32,
4835
+ height: 28,
4836
+ minWidth: 0,
4837
+ ".MuiButton-startIcon": { m: 0, color: "text.secondary" },
4838
+ ...toolbarVisible && { bgcolor: "grey.200" }
4839
+ }
4840
+ }
4841
+ ),
4842
+ /* @__PURE__ */ jsxRuntime.jsx(
4843
+ material.Button,
4844
+ {
4845
+ size: "small",
4846
+ color: "primary",
4847
+ variant: "contained",
4848
+ disabled: !content,
4849
+ onClick: handleSend,
4850
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(material.Box, { component: tablerSend, sx: { fontSize: "14px !important" } }),
4851
+ sx: { height: 28 },
4852
+ children: t("chat.send")
4853
+ }
4854
+ )
4855
+ ]
4856
+ }
4857
+ )
4858
+ ]
4859
+ }
4860
+ );
4861
+ }
4597
4862
  function getLineClamp(count) {
4598
4863
  return {
4599
4864
  display: "-webkit-box",
@@ -4617,7 +4882,7 @@ var __publicField = (obj, key, value) => {
4617
4882
  const isActive = isActiveChat(chat.id);
4618
4883
  const { session, isAdmin } = useSessionContext();
4619
4884
  const isCreator = chat.creator.did === ((_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.did);
4620
- const [input, setInput] = react.useState("");
4885
+ const [input, setInput] = ahooks.useLocalStorageState(`chat-input-${chat.id}`, { defaultValue: "" });
4621
4886
  react.useEffect(() => {
4622
4887
  if (chat.isActivated) {
4623
4888
  initChatRoom(chat.id);
@@ -4639,7 +4904,10 @@ var __publicField = (obj, key, value) => {
4639
4904
  }
4640
4905
  if (chat.type === "dm") {
4641
4906
  const oppositeUser = getOppositeUser(chat);
4642
- return /* @__PURE__ */ jsxRuntime.jsx(RoomTitle, { title: oppositeUser.fullName });
4907
+ return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
4908
+ /* @__PURE__ */ jsxRuntime.jsx(Avatar, { did: oppositeUser == null ? void 0 : oppositeUser.did, src: oppositeUser == null ? void 0 : oppositeUser.avatar, size: 24, shape: "circle", variant: "rounded" }),
4909
+ /* @__PURE__ */ jsxRuntime.jsx(RoomTitle, { title: oppositeUser.fullName })
4910
+ ] });
4643
4911
  }
4644
4912
  if (chat.type === "channel") {
4645
4913
  const menuItems = [];
@@ -4724,66 +4992,41 @@ var __publicField = (obj, key, value) => {
4724
4992
  ]
4725
4993
  }
4726
4994
  ),
4727
- /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { flex: 1, overflow: "hidden", background: theme.palette.grey[50] }, children: /* @__PURE__ */ jsxRuntime.jsx(MessageList, { chat }) }),
4728
- /* @__PURE__ */ jsxRuntime.jsx(
4729
- Box,
4730
- {
4731
- sx: {
4732
- flex: "0 0 auto",
4733
- ".be-editable": { maxHeight: 200, overflow: "auto" },
4734
- ".be-editable, .be-content": { minHeight: "64px !important" },
4735
- ".be-shell": {
4736
- border: "none !important",
4737
- borderTop: "1px solid #e5e5e5 !important",
4738
- borderRadius: "0px !important"
4739
- }
4740
- },
4741
- children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { position: "relative" }, children: [
4742
- isActive && /* @__PURE__ */ jsxRuntime.jsx(
4743
- CommentInput,
4744
- {
4745
- initialContent: input,
4746
- onChange: (editorState) => setInput(editorState ? JSON.stringify(editorState) : ""),
4747
- send: (content) => sendMessage(chat.id, content),
4748
- placeholder: t("chat.typeSomething"),
4749
- sendText: t("chat.reply"),
4750
- disabledSend: !(chat.type !== "channel" || chat.hasJoined)
4751
- }
4752
- ),
4753
- chat.type === "channel" && !chat.hasJoined && /* @__PURE__ */ jsxRuntime.jsxs(
4754
- Box,
4755
- {
4756
- sx: {
4757
- position: "absolute",
4758
- zIndex: 9999999,
4759
- top: 0,
4760
- left: 0,
4761
- right: 0,
4762
- bottom: 0,
4763
- bgcolor: "rgba(255, 255, 255, 0.7)",
4764
- display: "flex",
4765
- flexDirection: "column",
4766
- alignItems: "center",
4767
- justifyContent: "center",
4768
- color: "#fff"
4769
- },
4770
- children: [
4771
- /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { mb: 0.5, fontSize: 18 }, children: "🚪" }),
4772
- /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { color: "primary.main", mb: 0.5, fontSize: 13, fontWeight: 500 }, children: t("chat.notYetJoinedTheChannel") }),
4773
- /* @__PURE__ */ jsxRuntime.jsx(
4774
- Box,
4775
- {
4776
- sx: { color: "secondary.main", cursor: "pointer", fontSize: 13 },
4777
- onClick: () => joinChannel(chat.id),
4778
- children: t("chat.joinChannel")
4779
- }
4780
- )
4781
- ]
4782
- }
4783
- )
4784
- ] })
4785
- }
4786
- )
4995
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(MessageList, { chat }) }),
4996
+ /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { position: "relative" }, children: [
4997
+ chat.isActivated && chat.type !== "notification" && /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { px: { xs: 0, sm: 2.5 }, pb: { xs: 0, sm: 2.5 } }, children: /* @__PURE__ */ jsxRuntime.jsx(
4998
+ ChatInput,
4999
+ {
5000
+ initialContent: input,
5001
+ onContentChange: (v2) => setInput(v2),
5002
+ send: (content) => sendMessage(chat.id, content)
5003
+ }
5004
+ ) }),
5005
+ chat.type === "channel" && !chat.hasJoined && /* @__PURE__ */ jsxRuntime.jsxs(
5006
+ Box,
5007
+ {
5008
+ sx: {
5009
+ position: "absolute",
5010
+ zIndex: 9999999,
5011
+ top: 0,
5012
+ left: 0,
5013
+ right: 0,
5014
+ bottom: 0,
5015
+ bgcolor: "rgba(255, 255, 255, 0.7)",
5016
+ display: "flex",
5017
+ flexDirection: "column",
5018
+ alignItems: "center",
5019
+ justifyContent: "center",
5020
+ color: "#fff"
5021
+ },
5022
+ children: [
5023
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { mb: 0.5, fontSize: 18 }, children: "🚪" }),
5024
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { color: "primary.main", mb: 0.5, fontSize: 13, fontWeight: 500 }, children: t("chat.notYetJoinedTheChannel") }),
5025
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { color: "secondary.main", cursor: "pointer", fontSize: 13 }, onClick: () => joinChannel(chat.id), children: t("chat.joinChannel") })
5026
+ ]
5027
+ }
5028
+ )
5029
+ ] })
4787
5030
  ] });
4788
5031
  }
4789
5032
  function NewChannelDialog({ open, onSubmit, onClose, ...rest }) {
@@ -5184,6 +5427,7 @@ var __publicField = (obj, key, value) => {
5184
5427
  !activeChatId && /* @__PURE__ */ jsxRuntime.jsx(Empty$1, { sx: { height: 1 } })
5185
5428
  ] }) });
5186
5429
  }
5430
+ const tablerSwitchHorizontal = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", "data-iconify": "tabler", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m16 3l4 4l-4 4m-6-4h10M8 13l-4 4l4 4m-4-4h9" }) });
5187
5431
  function Empty({ sx }) {
5188
5432
  const { t } = context.useLocaleContext();
5189
5433
  const mergedSx = [
@@ -5203,6 +5447,7 @@ var __publicField = (obj, key, value) => {
5203
5447
  ] });
5204
5448
  }
5205
5449
  function ChatListInWallet({ sx, ...rest }) {
5450
+ const { session } = useSessionContext();
5206
5451
  const { initialized, chats, activeChatId } = useChatContext();
5207
5452
  const { unread } = useUnreadNotification();
5208
5453
  const { navigateToChatList, updateUnreadState } = useChatInWallet();
@@ -5223,7 +5468,26 @@ var __publicField = (obj, key, value) => {
5223
5468
  borderRight: { sm: "1px solid #e5e5e5" }
5224
5469
  },
5225
5470
  children: [
5226
- /* @__PURE__ */ jsxRuntime.jsx(UserSearch, { sx: { flex: "0 0 auto", py: 1, px: 3 } }),
5471
+ /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { flex: "0 0 auto", py: 1, px: 2 }, children: [
5472
+ /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", justifyContent: "space-between", mr: -1 }, children: [
5473
+ /* @__PURE__ */ jsxRuntime.jsxs(
5474
+ Box,
5475
+ {
5476
+ onClick: () => {
5477
+ bridge.call("switchApp");
5478
+ },
5479
+ sx: { display: "flex", alignItems: "center", gap: 1 },
5480
+ children: [
5481
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "img", src: window.blocklet.appLogo, alt: "", sx: { width: 20, height: 20 } }),
5482
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { typography: "h5", fontWeight: "medium" }, children: window.blocklet.appName }),
5483
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { component: tablerSwitchHorizontal, sx: { fontSize: 15, color: "grey.600" } })
5484
+ ]
5485
+ }
5486
+ ),
5487
+ /* @__PURE__ */ jsxRuntime.jsx(SessionManager, { style: { padding: 0 }, showText: true, showRole: true, session })
5488
+ ] }),
5489
+ /* @__PURE__ */ jsxRuntime.jsx(UserSearch, { sx: { mt: 1 } })
5490
+ ] }),
5227
5491
  /* @__PURE__ */ jsxRuntime.jsx(material.Divider, {}),
5228
5492
  !!(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsxRuntime.jsx(ChatList, { sx: { flex: 1, overflowY: "auto" }, inWallet: true }),
5229
5493
  !(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsxRuntime.jsx(Empty, { sx: { flex: 1 } }),
@@ -5536,40 +5800,6 @@ var __publicField = (obj, key, value) => {
5536
5800
  }
5537
5801
  );
5538
5802
  }
5539
- const Editor$1 = react.lazy(() => Promise.resolve().then(() => editor));
5540
- function LazyEditor(props) {
5541
- const fallback2 = /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { px: 3 }, children: [
5542
- /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, {}),
5543
- /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "80%" }),
5544
- /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "60%" }),
5545
- /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "40%" })
5546
- ] });
5547
- return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: fallback2, children: /* @__PURE__ */ jsxRuntime.jsx(Editor$1, { ...props }) });
5548
- }
5549
- const BlockletEditor$1 = react.lazy(() => import("@blocklet/editor"));
5550
- const fallback = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5551
- /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, {}),
5552
- /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "80%" }),
5553
- /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "60%" }),
5554
- /* @__PURE__ */ jsxRuntime.jsx(material.Skeleton, { width: "40%" })
5555
- ] });
5556
- function EditorPreview({ content, children, ...rest }) {
5557
- return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback, children: /* @__PURE__ */ jsxRuntime.jsxs(
5558
- BlockletEditor$1,
5559
- {
5560
- editorState: inferInitialEditorState(content),
5561
- editable: false,
5562
- enableHeadingsIdPlugin: true,
5563
- ...rest,
5564
- children: [
5565
- /* @__PURE__ */ jsxRuntime.jsx(ImagePathFixerPlugin, {}),
5566
- /* @__PURE__ */ jsxRuntime.jsx(VideoPathFixerPlugin, {}),
5567
- children
5568
- ]
5569
- }
5570
- ) });
5571
- }
5572
- EditorPreview.fallback = fallback;
5573
5803
  const useBeforeUnloadPrompt = (dirty) => {
5574
5804
  react.useEffect(() => {
5575
5805
  const showPrompt = (e) => {
@@ -5735,7 +5965,8 @@ var __publicField = (obj, key, value) => {
5735
5965
  pointUp: "🎉 You got {points} {unit} {event}",
5736
5966
  loadMore: "Load older messages",
5737
5967
  notYetJoinedTheChannel: "Not yet joined the channel",
5738
- typeSomething: "Type here. Use Markdown, Drag or paste images"
5968
+ typeSomething: "Type here. Use Markdown, Drag or paste images",
5969
+ send: "Send"
5739
5970
  }
5740
5971
  };
5741
5972
  const zh = {
@@ -5815,7 +6046,8 @@ var __publicField = (obj, key, value) => {
5815
6046
  pointUp: "🎉 您获得了 {points} {unit} {event}",
5816
6047
  loadMore: "加载更多消息",
5817
6048
  notYetJoinedTheChannel: "暂未加入这个频道",
5818
- typeSomething: "在这里输入,适用 MarkDown,拽入或者黏贴图片"
6049
+ typeSomething: "在这里输入,适用 MarkDown,拽入或者黏贴图片",
6050
+ send: "发送"
5819
6051
  }
5820
6052
  };
5821
6053
  const translations = { zh, en };
@@ -11723,7 +11955,15 @@ var __publicField = (obj, key, value) => {
11723
11955
  min-height: 150px;
11724
11956
  }
11725
11957
  `;
11726
- function Editor({ initialContent, onChange, children, onSave, ...rest }) {
11958
+ function Editor({
11959
+ initialContent,
11960
+ onChange,
11961
+ children,
11962
+ onSave,
11963
+ enableSaveAreaPlugin = true,
11964
+ ignoreInitialChange = true,
11965
+ ...rest
11966
+ }) {
11727
11967
  const handleChange = async (editorState, editor2) => {
11728
11968
  const isEmpty = await isEmptyContent(editorState, editor2);
11729
11969
  onChange == null ? void 0 : onChange({
@@ -11737,9 +11977,9 @@ var __publicField = (obj, key, value) => {
11737
11977
  return /* @__PURE__ */ jsxRuntime.jsx(Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(BlockletEditor, { editorState: inferInitialEditorState(initialContent), ...rest, children: [
11738
11978
  /* @__PURE__ */ jsxRuntime.jsx(ImagePathFixerPlugin, {}),
11739
11979
  /* @__PURE__ */ jsxRuntime.jsx(VideoPathFixerPlugin, {}),
11740
- /* @__PURE__ */ jsxRuntime.jsx(OnContentChangePlugin.OnContentChangePlugin, { onChange: handleChange }),
11741
- onSave && /* @__PURE__ */ jsxRuntime.jsx(ShortcutPlugin.CtrlsShortcutPlugin, { callback: onSave }),
11742
- /* @__PURE__ */ jsxRuntime.jsx(SafeAreaPlugin.SafeAreaPlugin, {}),
11980
+ /* @__PURE__ */ jsxRuntime.jsx(OnContentChangePlugin.OnContentChangePlugin, { onChange: handleChange, ignoreInitialChange }),
11981
+ onSave && /* @__PURE__ */ jsxRuntime.jsx(ShortcutPlugin$1.CtrlsShortcutPlugin, { callback: onSave }),
11982
+ enableSaveAreaPlugin && /* @__PURE__ */ jsxRuntime.jsx(SafeAreaPlugin.SafeAreaPlugin, {}),
11743
11983
  children
11744
11984
  ] }) });
11745
11985
  }