@blocklet/discuss-kit-ux 2.1.66 → 2.1.67

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.
@@ -1,8 +1,9 @@
1
- import { InputProps } from './input';
1
+ import { InputProps, RenderProps } from './input';
2
2
  interface Props extends Omit<InputProps, 'render'> {
3
3
  sendText?: string;
4
4
  sendIcon?: React.ReactNode;
5
5
  disabledSend?: boolean;
6
+ renderInnerFooter?: (args: RenderProps) => React.ReactElement;
6
7
  }
7
- export default function CommentInput({ disabledSend, send, onSuccess, placeholder, sendText, sendIcon, draftKey, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export default function CommentInput({ disabledSend, send, onSuccess, placeholder, sendText, sendIcon, draftKey, renderInnerFooter, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -2,7 +2,7 @@ import { BoxProps } from '@mui/material';
2
2
  import { EditorState } from 'lexical';
3
3
  export declare const preloadInput: () => Promise<typeof import('@blocklet/editor').default>;
4
4
  export type Send = (content: string) => Promise<any>;
5
- interface RenderProps {
5
+ export interface RenderProps {
6
6
  content: EditorState | null;
7
7
  submit: () => void;
8
8
  loading: boolean;
@@ -12,7 +12,6 @@ interface RenderProps {
12
12
  export interface InputProps extends Omit<BoxProps, 'onChange'> {
13
13
  initialContent?: string;
14
14
  send?: Send;
15
- render?: (args: RenderProps) => React.ReactElement;
16
15
  placeholder?: string;
17
16
  onSuccess?: (result: any) => void;
18
17
  onChange?: (editorState: EditorState | null) => void;
@@ -20,7 +19,9 @@ export interface InputProps extends Omit<BoxProps, 'onChange'> {
20
19
  draftKey?: string;
21
20
  shortcut?: 'CMD_ENTER' | 'ENTER';
22
21
  children?: React.ReactNode;
22
+ renderInnerFooter?: (args: RenderProps) => React.ReactElement;
23
+ renderEditorFooter?: (args: RenderProps) => React.ReactElement;
23
24
  }
24
25
  export type Ref = HTMLDivElement;
25
- declare const Input: ({ initialContent, send, render, placeholder, onSuccess, onChange, autoFocus, draftKey, shortcut, children, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
26
+ declare const Input: ({ initialContent, send, placeholder, onSuccess, onChange, autoFocus, draftKey, shortcut, children, renderInnerFooter, renderEditorFooter, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
26
27
  export default Input;
@@ -22,6 +22,7 @@ interface CommentsProviderProps {
22
22
  renderDonation?: (post: Post) => React.ReactNode;
23
23
  renderActions?: (post: Post) => React.ReactNode;
24
24
  renderEditorPlugins?: (post: Post) => React.ReactNode;
25
+ renderInnerFooter?: (post: Post) => React.ReactElement;
25
26
  }
26
27
  interface State {
27
28
  comments: Post[];
@@ -62,8 +63,9 @@ interface CommentsContextValue {
62
63
  renderDonation?: (post: Post) => React.ReactNode;
63
64
  renderActions?: (post: Post) => React.ReactNode;
64
65
  renderEditorPlugins?: (post: Post) => React.ReactNode;
66
+ renderInnerFooter?: (post: Post) => React.ReactElement;
65
67
  }
66
68
  export declare const CommentsContext: React.Context<CommentsContextValue>;
67
69
  export declare const useCommentsContext: () => CommentsContextValue;
68
- export declare function CommentsProvider({ target, api, flatView, children, order, autoLoadComments, autoCollapse, allowCopyLink, showProfileCard, interactive, containerRef, renderComments, renderDonation, renderActions, renderEditorPlugins, }: CommentsProviderProps): import("react/jsx-runtime").JSX.Element;
70
+ export declare function CommentsProvider({ target, api, flatView, children, order, autoLoadComments, autoCollapse, allowCopyLink, showProfileCard, interactive, containerRef, renderComments, renderDonation, renderActions, renderEditorPlugins, renderInnerFooter, }: CommentsProviderProps): import("react/jsx-runtime").JSX.Element;
69
71
  export {};
@@ -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-DYbkj4x-.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-CLShnSLV.mjs";
8
8
  const BlockletEditor = lazy(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -4,8 +4,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4
4
  var _a, _b, _c, _d;
5
5
  import { Labels2, LabelPicker } from "@blocklet/labels";
6
6
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
7
- import { useTheme, ThemeProvider, styled } from "@mui/material/styles";
8
- import { create as create$1, styled as styled$1 } from "@arcblock/ux/lib/Theme";
7
+ import { useTheme, ThemeProvider, styled as styled$1 } from "@mui/material/styles";
8
+ import { create as create$1, styled } from "@arcblock/ux/lib/Theme";
9
9
  import { useEffect, useRef, useState, createElement, useContext, useMemo, useCallback, isValidElement, lazy, Suspense, createContext, Fragment as Fragment$1, forwardRef, useImperativeHandle } from "react";
10
10
  import { Box, useTheme as useTheme$1, useMediaQuery, styled as styled$2, 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, CircularProgress, Backdrop, Autocomplete, Typography as Typography$1, TextField, InputAdornment, SwipeableDrawer, Badge as Badge$1, Paper, ToggleButtonGroup, ToggleButton } from "@mui/material";
11
11
  import isNil from "lodash/isNil";
@@ -18,11 +18,11 @@ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext
18
18
  import { ImageNode } from "@blocklet/editor/lib/main/nodes/ImageNode";
19
19
  import { VideoNode } from "@blocklet/editor/lib/ext/VideoPlugin/VideoNode";
20
20
  import { useSize, useInViewport, useSetState, useLocalStorageState, useRequest, useGetState, useReactive } from "ahooks";
21
- import Box$1 from "@mui/material/Box";
22
- import LoadingButton from "@mui/lab/LoadingButton";
23
- import { Send, Save, ChatBubbleOutlineOutlined, MoreVert, NavigateNext, DeleteOutlineOutlined, ContentCopy, ArrowUpward, ArrowDownward, ArrowBackIos, Add, BorderColorOutlined } from "@mui/icons-material";
24
21
  import { LocaleContext, useLocaleContext } from "@arcblock/ux/lib/Locale/context";
22
+ import { Send, Save, ChatBubbleOutlineOutlined, MoreVert, NavigateNext, DeleteOutlineOutlined, ContentCopy, ArrowUpward, ArrowDownward, ArrowBackIos, Add, BorderColorOutlined } from "@mui/icons-material";
23
+ import LoadingButton from "@mui/lab/LoadingButton";
25
24
  import Alert from "@mui/material/Alert";
25
+ import Box$1 from "@mui/material/Box";
26
26
  import isBoolean from "lodash/isBoolean";
27
27
  import Button from "@mui/material/Button";
28
28
  import DidAvatar from "@arcblock/did-connect/lib/Avatar";
@@ -558,7 +558,6 @@ const preloadInput = () => BlockletEditor$2.preload();
558
558
  const Input = ({
559
559
  initialContent = "",
560
560
  send,
561
- render,
562
561
  placeholder,
563
562
  onSuccess,
564
563
  onChange,
@@ -566,6 +565,8 @@ const Input = ({
566
565
  draftKey = "",
567
566
  shortcut,
568
567
  children,
568
+ renderInnerFooter,
569
+ renderEditorFooter,
569
570
  ...rest
570
571
  }) => {
571
572
  var _a2;
@@ -671,23 +672,13 @@ const Input = ({
671
672
  /* @__PURE__ */ jsx(ImagePathFixerPlugin, {}),
672
673
  /* @__PURE__ */ jsx(VideoPathFixerPlugin, {}),
673
674
  /* @__PURE__ */ jsx(AutoClearPlugin$1, { value: content, isChanged: isChanged.current }),
674
- children
675
+ children,
676
+ renderInnerFooter == null ? void 0 : renderInnerFooter({ submit, content, loading, error, inSmallView })
675
677
  ]
676
678
  }
677
- ) }), render == null ? void 0 : render({ submit, content, loading, error, inSmallView }));
679
+ ) }), renderEditorFooter == null ? void 0 : renderEditorFooter({ submit, content, loading, error, inSmallView }));
678
680
  };
679
681
  const mdiLanguageMarkdown = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M20.56 18H3.44C2.65 18 2 17.37 2 16.59V7.41C2 6.63 2.65 6 3.44 6h17.12c.79 0 1.44.63 1.44 1.41v9.18c0 .78-.65 1.41-1.44 1.41M6.81 15.19v-3.66l1.92 2.35l1.92-2.35v3.66h1.93V8.81h-1.93l-1.92 2.35l-1.92-2.35H4.89v6.38zM19.69 12h-1.92V8.81h-1.92V12h-1.93l2.89 3.28z" }) });
680
- const StyledInput = styled(Input)`
681
- .be-shell {
682
- padding-bottom: 44px;
683
- }
684
- > .MuiAlert-root {
685
- position: absolute;
686
- left: 0;
687
- right: 0;
688
- margin-top: 4px;
689
- }
690
- `;
691
682
  function CommentInput({
692
683
  disabledSend,
693
684
  send,
@@ -696,11 +687,60 @@ function CommentInput({
696
687
  sendText,
697
688
  sendIcon,
698
689
  draftKey = "",
690
+ renderInnerFooter,
699
691
  ...rest
700
692
  }) {
701
693
  const { t } = useContext(LocaleContext);
694
+ const renderFooter = ({ submit, content, loading, inSmallView }) => {
695
+ return /* @__PURE__ */ jsxs(Box$1, { p: 1, display: "flex", justifyContent: inSmallView ? "end" : "space-between", alignItems: "end", children: [
696
+ /* @__PURE__ */ jsx(
697
+ Box$1,
698
+ {
699
+ component: "a",
700
+ href: "https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax",
701
+ target: "_blank",
702
+ sx: {
703
+ display: inSmallView ? "none" : "flex",
704
+ alignItems: "center",
705
+ m: 0,
706
+ fontSize: 12,
707
+ color: "text.disabled",
708
+ textDecoration: "none",
709
+ "&:hover": { color: "text.secondary" }
710
+ },
711
+ children: /* @__PURE__ */ jsx(
712
+ Box$1,
713
+ {
714
+ component: "span",
715
+ sx: { display: "inline-flex", alignItems: "center", mr: 0.5, lineHeight: 1 },
716
+ title: "Styling with Markdown is supported",
717
+ children: /* @__PURE__ */ jsx(mdiLanguageMarkdown, { style: { fontSize: 16 } })
718
+ }
719
+ )
720
+ }
721
+ ),
722
+ /* @__PURE__ */ jsx(Box$1, { display: "flex", gap: 1, alignItems: "center", children: /* @__PURE__ */ jsx(
723
+ LoadingButton,
724
+ {
725
+ disabled: isBoolean(disabledSend) ? disabledSend : !content,
726
+ loading,
727
+ loadingPosition: "start",
728
+ startIcon: sendIcon || /* @__PURE__ */ jsx(Send, { sx: { transform: "rotate(-45deg) translateX(3px)" } }),
729
+ variant: "contained",
730
+ color: "primary",
731
+ title: "⌘ Enter",
732
+ onClick: submit,
733
+ className: "editor-submit-button",
734
+ children: /* @__PURE__ */ jsxs(Box$1, { component: "span", sx: { display: "inline-flex", gap: 0.5, fontSize: 12 }, children: [
735
+ /* @__PURE__ */ jsx("span", { children: sendText || t("sendComment") }),
736
+ /* @__PURE__ */ jsx(Box$1, { component: "span", sx: { display: inSmallView ? "none" : "inline" }, children: "(⌘ Enter)" })
737
+ ] })
738
+ }
739
+ ) })
740
+ ] });
741
+ };
702
742
  return /* @__PURE__ */ jsx(
703
- StyledInput,
743
+ Input,
704
744
  {
705
745
  className: "editor-input-container",
706
746
  placeholder: placeholder || t("commentInputPlaceholder"),
@@ -708,70 +748,8 @@ function CommentInput({
708
748
  onSuccess,
709
749
  draftKey,
710
750
  ...rest,
711
- render: ({ submit, content, loading, error, inSmallView }) => {
712
- return /* @__PURE__ */ jsxs(Fragment, { children: [
713
- /* @__PURE__ */ jsxs(
714
- Box$1,
715
- {
716
- position: "absolute",
717
- bottom: 0,
718
- left: 0,
719
- right: 0,
720
- p: 1,
721
- display: "flex",
722
- justifyContent: inSmallView ? "end" : "space-between",
723
- alignItems: "end",
724
- children: [
725
- /* @__PURE__ */ jsx(
726
- Box$1,
727
- {
728
- component: "a",
729
- href: "https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax",
730
- target: "_blank",
731
- sx: {
732
- display: inSmallView ? "none" : "flex",
733
- alignItems: "center",
734
- m: 0,
735
- fontSize: 12,
736
- color: "text.disabled",
737
- textDecoration: "none",
738
- "&:hover": { color: "text.secondary" }
739
- },
740
- children: /* @__PURE__ */ jsx(
741
- Box$1,
742
- {
743
- component: "span",
744
- sx: { display: "inline-flex", alignItems: "center", mr: 0.5, lineHeight: 1 },
745
- title: "Styling with Markdown is supported",
746
- children: /* @__PURE__ */ jsx(mdiLanguageMarkdown, { style: { fontSize: 16 } })
747
- }
748
- )
749
- }
750
- ),
751
- /* @__PURE__ */ jsx(Box$1, { display: "flex", gap: 1, alignItems: "center", children: /* @__PURE__ */ jsx(
752
- LoadingButton,
753
- {
754
- disabled: isBoolean(disabledSend) ? disabledSend : !content,
755
- loading,
756
- loadingPosition: "start",
757
- startIcon: sendIcon || /* @__PURE__ */ jsx(Send, { sx: { transform: "rotate(-45deg) translateX(3px)" } }),
758
- variant: "contained",
759
- color: "primary",
760
- title: "⌘ Enter",
761
- onClick: submit,
762
- className: "editor-submit-button",
763
- children: /* @__PURE__ */ jsxs(Box$1, { component: "span", sx: { display: "inline-flex", gap: 0.5, fontSize: 12 }, children: [
764
- /* @__PURE__ */ jsx("span", { children: sendText || t("sendComment") }),
765
- /* @__PURE__ */ jsx(Box$1, { component: "span", sx: { display: inSmallView ? "none" : "inline" }, children: "(⌘ Enter)" })
766
- ] })
767
- }
768
- ) })
769
- ]
770
- }
771
- ),
772
- error && /* @__PURE__ */ jsx(Alert, { severity: "error", children: error })
773
- ] });
774
- }
751
+ renderInnerFooter: renderInnerFooter ?? renderFooter,
752
+ renderEditorFooter: ({ error }) => error && /* @__PURE__ */ jsx(Alert, { severity: "error", children: error })
775
753
  }
776
754
  );
777
755
  }
@@ -784,7 +762,7 @@ function PostEdit({ content, send, onCancel, onSuccess, ...rest }) {
784
762
  send,
785
763
  onSuccess,
786
764
  ...rest,
787
- render: ({ submit, content: content2, loading }) => /* @__PURE__ */ jsxs(Box$1, { display: "flex", justifyContent: "end", alignItems: "end", gap: 1, mt: 1, children: [
765
+ renderEditorFooter: ({ submit, content: content2, loading }) => /* @__PURE__ */ jsxs(Box$1, { display: "flex", justifyContent: "end", alignItems: "end", gap: 1, mt: 1, children: [
788
766
  /* @__PURE__ */ jsx(Button, { variant: "text", color: "primary", onClick: onCancel, children: t("cancel") }),
789
767
  /* @__PURE__ */ jsx(
790
768
  LoadingButton,
@@ -804,7 +782,7 @@ function PostEdit({ content, send, onCancel, onSuccess, ...rest }) {
804
782
  }
805
783
  );
806
784
  }
807
- const Root$4 = styled$1(Box$1)`
785
+ const Root$4 = styled(Box$1)`
808
786
  height: 100%;
809
787
  .be-editable {
810
788
  overflow-y: auto;
@@ -824,7 +802,7 @@ function Avatar({ src, ...rest }) {
824
802
  }
825
803
  return /* @__PURE__ */ jsx(DidAvatar, { src: src ? getResizedAvatar(src) : src, ...rest });
826
804
  }
827
- const Root$3 = styled$1(AvatarGroup)`
805
+ const Root$3 = styled(AvatarGroup)`
828
806
  display: flex;
829
807
  align-items: center;
830
808
  position: relative;
@@ -1268,7 +1246,7 @@ const useChatInWallet = () => {
1268
1246
  chatInWallet
1269
1247
  };
1270
1248
  };
1271
- const HtmlTooltip$1 = styled(({ className, ...props }) => /* @__PURE__ */ jsx(
1249
+ const HtmlTooltip$1 = styled$1(({ className, ...props }) => /* @__PURE__ */ jsx(
1272
1250
  Tooltip,
1273
1251
  {
1274
1252
  PopperProps: {
@@ -1505,7 +1483,7 @@ function SystemUser({
1505
1483
  ] });
1506
1484
  }
1507
1485
  const MAX_HEIGHT = 200;
1508
- const Root$2 = styled$1("div")`
1486
+ const Root$2 = styled("div")`
1509
1487
  &.markdown-viewer-collapsed .markdown-viewer-md-wrapper {
1510
1488
  position: relative;
1511
1489
  max-height: ${MAX_HEIGHT}px;
@@ -1549,7 +1527,7 @@ function ViewMore({ children, ...rest }) {
1549
1527
  ] });
1550
1528
  }
1551
1529
  const BlockletEditor$1 = lazy(() => import("@blocklet/editor"));
1552
- const StyledBlockletEditor = styled(BlockletEditor$1)`
1530
+ const StyledBlockletEditor = styled$1(BlockletEditor$1)`
1553
1531
  .editor-scroller {
1554
1532
  min-height: initial;
1555
1533
  }
@@ -1612,7 +1590,7 @@ function PostContent({
1612
1590
  }
1613
1591
  ) }) });
1614
1592
  }
1615
- const StyledMuiMenu = styled$1(MuiMenu)`
1593
+ const StyledMuiMenu = styled(MuiMenu)`
1616
1594
  .MuiMenuItem-root {
1617
1595
  min-height: 32px;
1618
1596
  min-width: 120px;
@@ -1674,7 +1652,7 @@ function Menu({ items = [], ...rest }) {
1674
1652
  ] });
1675
1653
  }
1676
1654
  Menu.Item = MuiMenuItem;
1677
- const Root$1 = styled(Box$1)`
1655
+ const Root$1 = styled$1(Box$1)`
1678
1656
  .post-highlighted {
1679
1657
  animation: highlighted-post-fade 3s;
1680
1658
  animation-timing-function: ease-out;
@@ -1976,7 +1954,7 @@ function BinaryThumb({ data = [], variant = "default", size = "sm", ...rest }) {
1976
1954
  }
1977
1955
  );
1978
1956
  }
1979
- const Root = styled$1(Box$1)`
1957
+ const Root = styled(Box$1)`
1980
1958
  display: flex;
1981
1959
  .reaction-item {
1982
1960
  display: flex;
@@ -1993,7 +1971,7 @@ function IconButton({ icon, text, onClick, selected, variant, size, onTextClick,
1993
1971
  !!text && /* @__PURE__ */ jsx("span", { className: "reaction-btn-text", onClick: (e) => onTextClick == null ? void 0 : onTextClick(e), children: text })
1994
1972
  ] });
1995
1973
  }
1996
- const IconButtonRoot = styled$1("div")`
1974
+ const IconButtonRoot = styled("div")`
1997
1975
  display: flex;
1998
1976
  align-items: center;
1999
1977
  &.reaction-btn-selected {
@@ -2596,7 +2574,8 @@ function CommentsProvider({
2596
2574
  renderComments,
2597
2575
  renderDonation,
2598
2576
  renderActions,
2599
- renderEditorPlugins
2577
+ renderEditorPlugins,
2578
+ renderInnerFooter
2600
2579
  }) {
2601
2580
  var _a2;
2602
2581
  const [state, setState] = useSetState(getInitialState(order ? { order } : {}));
@@ -2800,14 +2779,15 @@ function CommentsProvider({
2800
2779
  renderComments,
2801
2780
  renderDonation,
2802
2781
  renderActions,
2803
- renderEditorPlugins
2782
+ renderEditorPlugins,
2783
+ renderInnerFooter
2804
2784
  }),
2805
2785
  // eslint-disable-next-line react-hooks/exhaustive-deps
2806
2786
  [target, state]
2807
2787
  );
2808
2788
  return /* @__PURE__ */ jsx(CommentsContext.Provider, { value, children });
2809
2789
  }
2810
- const LoadMoreButtonWrapper = styled(Box$1)`
2790
+ const LoadMoreButtonWrapper = styled$1(Box$1)`
2811
2791
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 11L8 5L16 11' stroke='%23e1e4e8' stroke-linecap='square' stroke-width='1.5' /%3E%3C/svg%3E");
2812
2792
  background-repeat: repeat-x;
2813
2793
  background-position: center;
@@ -4646,7 +4626,7 @@ const MessageList = forwardRef(({ chat, ...rest }, ref) => {
4646
4626
  !isAtBottom && /* @__PURE__ */ jsx(Box$1, { sx: { position: "absolute", bottom: 16, right: 24 }, onClick: scrollToBottom, children: /* @__PURE__ */ jsx(Fab, { color: "inherit", sx: { width: { xs: 36, sm: 44 }, height: { xs: 36, sm: 44 } }, children: /* @__PURE__ */ jsx(ArrowDownward, {}) }) })
4647
4627
  ] });
4648
4628
  });
4649
- const HtmlTooltip = styled(({ className, ...props }) => /* @__PURE__ */ jsx(Tooltip$1, { ...props, classes: { popper: className } }))(() => ({
4629
+ const HtmlTooltip = styled$1(({ className, ...props }) => /* @__PURE__ */ jsx(Tooltip$1, { ...props, classes: { popper: className } }))(() => ({
4650
4630
  [`& .${tooltipClasses$1.tooltip}`]: {
4651
4631
  color: "inherit",
4652
4632
  backgroundColor: "#fff",
@@ -4734,7 +4714,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
4734
4714
  }
4735
4715
  const tablerSend = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", "data-iconify": "tabler", 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" }) });
4736
4716
  const tablerLetterCase = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", "data-iconify": "tabler", 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" }) });
4737
- const Editor = lazy(() => import("./editor-BgcgdiRw.mjs"));
4717
+ const Editor = lazy(() => import("./editor-DFmGhxrk.mjs"));
4738
4718
  function LazyEditor(props) {
4739
4719
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
4740
4720
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { T, n, W, A, m, ad, B, F, K, J, L, ap, Y, X, $, Z, _, a1, w, C, x, y, E, a5, a6, ah, a8, O, Q, ac, D, ag, af, H, G, b, k, ae, M, P, ao, v, q, R, S, a9, aq, o, a2, a4, ai, al, ak, ar, N, am, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-DYbkj4x-.mjs";
2
+ import { T, n, W, A, m, ad, B, F, K, J, L, ap, Y, X, $, Z, _, a1, w, C, x, y, E, a5, a6, ah, a8, O, Q, ac, D, ag, af, H, G, b, k, ae, M, P, ao, v, q, R, S, a9, aq, o, a2, a4, ai, al, ak, ar, N, am, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-CLShnSLV.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
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/react-hooks"), 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("semver-compare"), require("@arcblock/bridge"), 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("@blocklet/editor/lib/ext/EditorHolderPlugin"), require("@arcblock/ux/lib/Dialog"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("react-dom"), require("ufo"), require("dayjs"), require("dayjs/plugin/relativeTime"), require("url-join"), require("mitt"), require("@mui/material/CircularProgress"), require("react-helmet"), require("react-flip-toolkit"), require("@mui/material/colors/grey"), require("@blocklet/editor"), require("@mui/material/Fab"), require("lodash/debounce"), require("@blocklet/editor/lib/main/hooks/useIsFocused"), require("@blocklet/editor/lib/ext/BusyPlugin"), require("@mui/icons-material/ArrowBackIos"), 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/react-hooks", "@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", "semver-compare", "@arcblock/bridge", "@mui/icons-material/NotificationsActiveOutlined", "@blocklet/editor/lib/ext/CheckboxPlugin", "@arcblock/did-connect/lib/Address", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@blocklet/editor/lib/ext/EditorHolderPlugin", "@arcblock/ux/lib/Dialog", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "react-dom", "ufo", "dayjs", "dayjs/plugin/relativeTime", "url-join", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/colors/grey", "@blocklet/editor", "@mui/material/Fab", "lodash/debounce", "@blocklet/editor/lib/main/hooks/useIsFocused", "@blocklet/editor/lib/ext/BusyPlugin", "@mui/icons-material/ArrowBackIos", "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.reactHooks, 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.cmp, global.bridge, global.NotificationsActiveOutlinedIcon, global.CheckboxPlugin, global.DIDAddress, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.EditorHolderPlugin, global.Dialog, global.orderBy, global.Typography, global.Skeleton, global.ReactDOM, global.ufo, global.dayjs, global.relativeTime, global.joinUrl, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.grey, global.editor$1, global.Fab, global.debounce, global.useIsFocused, global.BusyPlugin, global.ArrowBackIosIcon, 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, reactHooks, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$3, Session, cmp, bridge, NotificationsActiveOutlinedIcon, CheckboxPlugin, DIDAddress, MuiMenuItem, clsx, IconButton$1, MuiMenu, EditorHolderPlugin, Dialog, orderBy, Typography, Skeleton, ReactDOM, ufo, dayjs, relativeTime, joinUrl, mitt, CircularProgress, reactHelmet, reactFlipToolkit, grey, editor$1, Fab, debounce, useIsFocused, BusyPlugin, ArrowBackIosIcon, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, css, OnContentChangePlugin, ShortcutPlugin$1, 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("@arcblock/ux/lib/Locale/context"), require("@mui/icons-material"), require("@mui/lab/LoadingButton"), require("@mui/material/Alert"), require("@mui/material/Box"), 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/react-hooks"), 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("semver-compare"), require("@arcblock/bridge"), 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("@blocklet/editor/lib/ext/EditorHolderPlugin"), require("@arcblock/ux/lib/Dialog"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("react-dom"), require("ufo"), require("dayjs"), require("dayjs/plugin/relativeTime"), require("url-join"), require("mitt"), require("@mui/material/CircularProgress"), require("react-helmet"), require("react-flip-toolkit"), require("@mui/material/colors/grey"), require("@blocklet/editor"), require("@mui/material/Fab"), require("lodash/debounce"), require("@blocklet/editor/lib/main/hooks/useIsFocused"), require("@blocklet/editor/lib/ext/BusyPlugin"), require("@mui/icons-material/ArrowBackIos"), 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", "@arcblock/ux/lib/Locale/context", "@mui/icons-material", "@mui/lab/LoadingButton", "@mui/material/Alert", "@mui/material/Box", "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/react-hooks", "@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", "semver-compare", "@arcblock/bridge", "@mui/icons-material/NotificationsActiveOutlined", "@blocklet/editor/lib/ext/CheckboxPlugin", "@arcblock/did-connect/lib/Address", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@blocklet/editor/lib/ext/EditorHolderPlugin", "@arcblock/ux/lib/Dialog", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "react-dom", "ufo", "dayjs", "dayjs/plugin/relativeTime", "url-join", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/colors/grey", "@blocklet/editor", "@mui/material/Fab", "lodash/debounce", "@blocklet/editor/lib/main/hooks/useIsFocused", "@blocklet/editor/lib/ext/BusyPlugin", "@mui/icons-material/ArrowBackIos", "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.context, global.iconsMaterial, global.LoadingButton, global.Alert, global.Box, global.isBoolean, global.Button, global.DidAvatar, global.AvatarGroup, global.colors, global.useMediaQuery, global.DID, global.Tooltip, global.reactRouterDom, global.reactHooks, 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.cmp, global.bridge, global.NotificationsActiveOutlinedIcon, global.CheckboxPlugin, global.DIDAddress, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.EditorHolderPlugin, global.Dialog, global.orderBy, global.Typography, global.Skeleton, global.ReactDOM, global.ufo, global.dayjs, global.relativeTime, global.joinUrl, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.grey, global.editor$1, global.Fab, global.debounce, global.useIsFocused, global.BusyPlugin, global.ArrowBackIosIcon, 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, context, iconsMaterial, LoadingButton, Alert, Box, isBoolean, Button, DidAvatar, AvatarGroup, colors, useMediaQuery, DID, Tooltip, reactRouterDom, reactHooks, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$3, Session, cmp, bridge, NotificationsActiveOutlinedIcon, CheckboxPlugin, DIDAddress, MuiMenuItem, clsx, IconButton$1, MuiMenu, EditorHolderPlugin, Dialog, orderBy, Typography, Skeleton, ReactDOM, ufo, dayjs, relativeTime, joinUrl, mitt, CircularProgress, reactHelmet, reactFlipToolkit, grey, editor$1, Fab, debounce, useIsFocused, BusyPlugin, ArrowBackIosIcon, 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) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -483,7 +483,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
483
483
  const Input = ({
484
484
  initialContent = "",
485
485
  send,
486
- render,
487
486
  placeholder,
488
487
  onSuccess,
489
488
  onChange,
@@ -491,6 +490,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
491
490
  draftKey = "",
492
491
  shortcut,
493
492
  children,
493
+ renderInnerFooter,
494
+ renderEditorFooter,
494
495
  ...rest
495
496
  }) => {
496
497
  var _a2;
@@ -596,23 +597,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
596
597
  /* @__PURE__ */ jsxRuntime.jsx(ImagePathFixerPlugin, {}),
597
598
  /* @__PURE__ */ jsxRuntime.jsx(VideoPathFixerPlugin, {}),
598
599
  /* @__PURE__ */ jsxRuntime.jsx(AutoClearPlugin$1, { value: content, isChanged: isChanged.current }),
599
- children
600
+ children,
601
+ renderInnerFooter == null ? void 0 : renderInnerFooter({ submit, content, loading, error, inSmallView })
600
602
  ]
601
603
  }
602
- ) }), render == null ? void 0 : render({ submit, content, loading, error, inSmallView }));
604
+ ) }), renderEditorFooter == null ? void 0 : renderEditorFooter({ submit, content, loading, error, inSmallView }));
603
605
  };
604
606
  const mdiLanguageMarkdown = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", d: "M20.56 18H3.44C2.65 18 2 17.37 2 16.59V7.41C2 6.63 2.65 6 3.44 6h17.12c.79 0 1.44.63 1.44 1.41v9.18c0 .78-.65 1.41-1.44 1.41M6.81 15.19v-3.66l1.92 2.35l1.92-2.35v3.66h1.93V8.81h-1.93l-1.92 2.35l-1.92-2.35H4.89v6.38zM19.69 12h-1.92V8.81h-1.92V12h-1.93l2.89 3.28z" }) });
605
- const StyledInput = styles.styled(Input)`
606
- .be-shell {
607
- padding-bottom: 44px;
608
- }
609
- > .MuiAlert-root {
610
- position: absolute;
611
- left: 0;
612
- right: 0;
613
- margin-top: 4px;
614
- }
615
- `;
616
607
  function CommentInput({
617
608
  disabledSend,
618
609
  send,
@@ -621,11 +612,60 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
621
612
  sendText,
622
613
  sendIcon,
623
614
  draftKey = "",
615
+ renderInnerFooter,
624
616
  ...rest
625
617
  }) {
626
618
  const { t } = react.useContext(context.LocaleContext);
619
+ const renderFooter = ({ submit, content, loading, inSmallView }) => {
620
+ return /* @__PURE__ */ jsxRuntime.jsxs(Box, { p: 1, display: "flex", justifyContent: inSmallView ? "end" : "space-between", alignItems: "end", children: [
621
+ /* @__PURE__ */ jsxRuntime.jsx(
622
+ Box,
623
+ {
624
+ component: "a",
625
+ href: "https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax",
626
+ target: "_blank",
627
+ sx: {
628
+ display: inSmallView ? "none" : "flex",
629
+ alignItems: "center",
630
+ m: 0,
631
+ fontSize: 12,
632
+ color: "text.disabled",
633
+ textDecoration: "none",
634
+ "&:hover": { color: "text.secondary" }
635
+ },
636
+ children: /* @__PURE__ */ jsxRuntime.jsx(
637
+ Box,
638
+ {
639
+ component: "span",
640
+ sx: { display: "inline-flex", alignItems: "center", mr: 0.5, lineHeight: 1 },
641
+ title: "Styling with Markdown is supported",
642
+ children: /* @__PURE__ */ jsxRuntime.jsx(mdiLanguageMarkdown, { style: { fontSize: 16 } })
643
+ }
644
+ )
645
+ }
646
+ ),
647
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { display: "flex", gap: 1, alignItems: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
648
+ LoadingButton,
649
+ {
650
+ disabled: isBoolean(disabledSend) ? disabledSend : !content,
651
+ loading,
652
+ loadingPosition: "start",
653
+ startIcon: sendIcon || /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.Send, { sx: { transform: "rotate(-45deg) translateX(3px)" } }),
654
+ variant: "contained",
655
+ color: "primary",
656
+ title: "⌘ Enter",
657
+ onClick: submit,
658
+ className: "editor-submit-button",
659
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { component: "span", sx: { display: "inline-flex", gap: 0.5, fontSize: 12 }, children: [
660
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: sendText || t("sendComment") }),
661
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { display: inSmallView ? "none" : "inline" }, children: "(⌘ Enter)" })
662
+ ] })
663
+ }
664
+ ) })
665
+ ] });
666
+ };
627
667
  return /* @__PURE__ */ jsxRuntime.jsx(
628
- StyledInput,
668
+ Input,
629
669
  {
630
670
  className: "editor-input-container",
631
671
  placeholder: placeholder || t("commentInputPlaceholder"),
@@ -633,70 +673,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
633
673
  onSuccess,
634
674
  draftKey,
635
675
  ...rest,
636
- render: ({ submit, content, loading, error, inSmallView }) => {
637
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
638
- /* @__PURE__ */ jsxRuntime.jsxs(
639
- Box,
640
- {
641
- position: "absolute",
642
- bottom: 0,
643
- left: 0,
644
- right: 0,
645
- p: 1,
646
- display: "flex",
647
- justifyContent: inSmallView ? "end" : "space-between",
648
- alignItems: "end",
649
- children: [
650
- /* @__PURE__ */ jsxRuntime.jsx(
651
- Box,
652
- {
653
- component: "a",
654
- href: "https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax",
655
- target: "_blank",
656
- sx: {
657
- display: inSmallView ? "none" : "flex",
658
- alignItems: "center",
659
- m: 0,
660
- fontSize: 12,
661
- color: "text.disabled",
662
- textDecoration: "none",
663
- "&:hover": { color: "text.secondary" }
664
- },
665
- children: /* @__PURE__ */ jsxRuntime.jsx(
666
- Box,
667
- {
668
- component: "span",
669
- sx: { display: "inline-flex", alignItems: "center", mr: 0.5, lineHeight: 1 },
670
- title: "Styling with Markdown is supported",
671
- children: /* @__PURE__ */ jsxRuntime.jsx(mdiLanguageMarkdown, { style: { fontSize: 16 } })
672
- }
673
- )
674
- }
675
- ),
676
- /* @__PURE__ */ jsxRuntime.jsx(Box, { display: "flex", gap: 1, alignItems: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
677
- LoadingButton,
678
- {
679
- disabled: isBoolean(disabledSend) ? disabledSend : !content,
680
- loading,
681
- loadingPosition: "start",
682
- startIcon: sendIcon || /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.Send, { sx: { transform: "rotate(-45deg) translateX(3px)" } }),
683
- variant: "contained",
684
- color: "primary",
685
- title: "⌘ Enter",
686
- onClick: submit,
687
- className: "editor-submit-button",
688
- children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { component: "span", sx: { display: "inline-flex", gap: 0.5, fontSize: 12 }, children: [
689
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: sendText || t("sendComment") }),
690
- /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { display: inSmallView ? "none" : "inline" }, children: "(⌘ Enter)" })
691
- ] })
692
- }
693
- ) })
694
- ]
695
- }
696
- ),
697
- error && /* @__PURE__ */ jsxRuntime.jsx(Alert, { severity: "error", children: error })
698
- ] });
699
- }
676
+ renderInnerFooter: renderInnerFooter ?? renderFooter,
677
+ renderEditorFooter: ({ error }) => error && /* @__PURE__ */ jsxRuntime.jsx(Alert, { severity: "error", children: error })
700
678
  }
701
679
  );
702
680
  }
@@ -709,7 +687,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
709
687
  send,
710
688
  onSuccess,
711
689
  ...rest,
712
- render: ({ submit, content: content2, loading }) => /* @__PURE__ */ jsxRuntime.jsxs(Box, { display: "flex", justifyContent: "end", alignItems: "end", gap: 1, mt: 1, children: [
690
+ renderEditorFooter: ({ submit, content: content2, loading }) => /* @__PURE__ */ jsxRuntime.jsxs(Box, { display: "flex", justifyContent: "end", alignItems: "end", gap: 1, mt: 1, children: [
713
691
  /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "text", color: "primary", onClick: onCancel, children: t("cancel") }),
714
692
  /* @__PURE__ */ jsxRuntime.jsx(
715
693
  LoadingButton,
@@ -2521,7 +2499,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2521
2499
  renderComments,
2522
2500
  renderDonation,
2523
2501
  renderActions,
2524
- renderEditorPlugins
2502
+ renderEditorPlugins,
2503
+ renderInnerFooter
2525
2504
  }) {
2526
2505
  var _a2;
2527
2506
  const [state, setState] = ahooks.useSetState(getInitialState(order ? { order } : {}));
@@ -2725,7 +2704,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2725
2704
  renderComments,
2726
2705
  renderDonation,
2727
2706
  renderActions,
2728
- renderEditorPlugins
2707
+ renderEditorPlugins,
2708
+ renderInnerFooter
2729
2709
  }),
2730
2710
  // eslint-disable-next-line react-hooks/exhaustive-deps
2731
2711
  [target, state]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.1.66",
3
+ "version": "2.1.67",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -44,8 +44,8 @@
44
44
  "ufo": "^1.5.4",
45
45
  "unstated-next": "^1.1.0",
46
46
  "url-join": "^4.0.1",
47
- "@blocklet/editor": "^2.1.66",
48
- "@blocklet/labels": "^2.1.66"
47
+ "@blocklet/editor": "^2.1.67",
48
+ "@blocklet/labels": "^2.1.67"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@arcblock/did-connect": "^2.10.36",