@blocklet/discuss-kit-ux 2.3.2 → 2.3.4

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.
@@ -0,0 +1,5 @@
1
+ import { BoxProps, IconButtonProps } from '@mui/material';
2
+ export declare function CommentIconButton<C extends React.ElementType>({ sx, ...rest }: IconButtonProps<C, {
3
+ component?: C;
4
+ }>): import("react/jsx-runtime").JSX.Element;
5
+ export declare function CommentIconButtonGroup({ children, sx, ...rest }: BoxProps): import("react/jsx-runtime").JSX.Element;
@@ -4,3 +4,4 @@ export { default as Comment } from './comment';
4
4
  export { default as CommentList } from './comment-list/comment-list';
5
5
  export { default as Menu } from './menu';
6
6
  export * from './comment-list/context';
7
+ export * from './comment-icon-button';
@@ -4,7 +4,7 @@ import { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangeP
4
4
  import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
5
5
  import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
6
6
  import { lazyRetry } from "@arcblock/ux/lib/Util";
7
- import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-DN2G52jl.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-iI300n3e.mjs";
8
8
  const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -7,7 +7,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
7
7
  import { useTheme, ThemeProvider, styled as styled$2 } from "@mui/material/styles";
8
8
  import { create as create$1, styled } from "@arcblock/ux/lib/Theme";
9
9
  import { useEffect, useRef, useState, createElement, useContext, useMemo, useLayoutEffect, useCallback, isValidElement, Suspense, createContext, Fragment as Fragment$1, forwardRef, useImperativeHandle } from "react";
10
- import { Box, useTheme as useTheme$1, useMediaQuery, styled as styled$1, Button as Button$1, Stack as Stack$1, Dialog, DialogTitle, DialogContent, DialogActions, DialogContentText, Tooltip as Tooltip$1, Chip as Chip$1, alpha, ClickAwayListener, 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, ToggleButtonGroup, ToggleButton } from "@mui/material";
10
+ import { Box, useTheme as useTheme$1, useMediaQuery, styled as styled$1, Button as Button$1, Stack as Stack$1, Dialog, DialogTitle, DialogContent, DialogActions, DialogContentText, Tooltip as Tooltip$1, Chip as Chip$1, alpha, ClickAwayListener, Divider, IconButton as IconButton$2, Skeleton, InputBase, tooltipClasses as tooltipClasses$1, CircularProgress, Backdrop, Autocomplete, Typography as Typography$1, TextField, InputAdornment, SwipeableDrawer, Badge as Badge$1, ToggleButtonGroup, ToggleButton } from "@mui/material";
11
11
  import isNil from "lodash/isNil";
12
12
  import { useEditorConfig, EditorConfigProvider } from "@blocklet/editor/lib/config";
13
13
  import { lazyWithPreload } from "react-lazy-with-preload";
@@ -3060,6 +3060,40 @@ function CommentList(props) {
3060
3060
  ) })
3061
3061
  ] });
3062
3062
  }
3063
+ function CommentIconButton({ sx, ...rest }) {
3064
+ const mergedSx = [
3065
+ {
3066
+ svg: {
3067
+ width: "1em",
3068
+ height: "1em",
3069
+ fontSize: 20
3070
+ },
3071
+ "&:hover": {
3072
+ color: "secondary.main"
3073
+ }
3074
+ },
3075
+ ...Array.isArray(sx) ? sx : [sx]
3076
+ ];
3077
+ return /* @__PURE__ */ jsx(IconButton$2, { size: "small", sx: mergedSx, ...rest, disableFocusRipple: true });
3078
+ }
3079
+ function CommentIconButtonGroup({ children, sx, ...rest }) {
3080
+ const mergedSx = [
3081
+ {
3082
+ display: "flex",
3083
+ alignItems: "center",
3084
+ gap: 2,
3085
+ "& > .MuiIconButton-root:first-child": {
3086
+ ml: "-5px"
3087
+ },
3088
+ // 避免局部 theme 覆盖问题 (如 comment donation 中的 CommentIconButton 会以 donation 局部的 theme palette 为准)
3089
+ ".MuiIconButton-root:hover": {
3090
+ color: "secondary.main"
3091
+ }
3092
+ },
3093
+ ...Array.isArray(sx) ? sx : [sx]
3094
+ ];
3095
+ return /* @__PURE__ */ jsx(Box, { ...rest, sx: mergedSx, children });
3096
+ }
3063
3097
  const materialSymbolsUpload = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M11 16V7.85l-2.6 2.6L7 9l5-5l5 5l-1.4 1.45l-2.6-2.6V16zm-5 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z" }) });
3064
3098
  const getUploadedImageUrl = (imageUrl, width = 320) => {
3065
3099
  var _a2;
@@ -4899,7 +4933,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
4899
4933
  }
4900
4934
  const tablerSend = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 14L21 3m0 0l-6.5 18a.55.55 0 0 1-1 0L10 14l-7-3.5a.55.55 0 0 1 0-1z" }) });
4901
4935
  const tablerLetterCase = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M14 15.5a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0-7 0M3 19V8.5a3.5 3.5 0 0 1 7 0V19m-7-6h7m11-1v7" }) });
4902
- const Editor = lazyRetry(() => import("./editor-B1h9f4M5.mjs"));
4936
+ const Editor = lazyRetry(() => import("./editor-qLBSztw2.mjs"));
4903
4937
  function LazyEditor(props) {
4904
4938
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
4905
4939
  /* @__PURE__ */ jsx(Skeleton, {}),
@@ -12512,76 +12546,78 @@ function SubscriptionPaywall({ type, fetchPaymentLink, ...rest }) {
12512
12546
  );
12513
12547
  }
12514
12548
  export {
12515
- ChatListInWallet as $,
12549
+ Chat as $,
12516
12550
  Avatar as A,
12517
12551
  Badge as B,
12518
12552
  CommentInput as C,
12519
12553
  DefaultEditorConfigProvider as D,
12520
12554
  useCommentsContext as E,
12521
12555
  CommentsProvider as F,
12522
- BinaryThumb as G,
12523
- GithubReaction as H,
12556
+ CommentIconButton as G,
12557
+ CommentIconButtonGroup as H,
12524
12558
  ImagePathFixerPlugin as I,
12525
- EmptyStatus as J,
12526
- BlogListWrapper as K,
12527
- BlogCard as L,
12559
+ BinaryThumb as J,
12560
+ GithubReaction as K,
12561
+ EmptyStatus as L,
12528
12562
  Menu as M,
12529
- BlogPermaLink as N,
12530
- getBlogLink as O,
12563
+ BlogListWrapper as N,
12564
+ BlogCard as O,
12531
12565
  Pagination as P,
12532
- CoverImage as Q,
12566
+ BlogPermaLink as Q,
12533
12567
  RelativeTime as R,
12534
12568
  ScrollableEditorWrapper as S,
12535
- CoverImageUpload as T,
12536
- AccessControl as U,
12569
+ getBlogLink as T,
12570
+ CoverImage as U,
12537
12571
  VideoPathFixerPlugin as V,
12538
- useAuthzContext as W,
12539
- AuthzProvider as X,
12540
- ChatClient as Y,
12541
- Chat as Z,
12542
- ChatInWallet as _,
12572
+ CoverImageUpload as W,
12573
+ AccessControl as X,
12574
+ useAuthzContext as Y,
12575
+ AuthzProvider as Z,
12576
+ ChatClient as _,
12543
12577
  isEmptyContent as a,
12544
- ChatHeaderAddon as a0,
12545
- useChatContext as a1,
12546
- ChatProvider as a2,
12547
- UnreadNotificationContext as a3,
12548
- useUnreadNotification as a4,
12549
- UnreadNotificationProvider as a5,
12550
- Confirm as a6,
12551
- ConfirmContext as a7,
12552
- useConfirm as a8,
12553
- ConfirmProvider as a9,
12554
- useArcSphereDialog as aA,
12555
- Paywall as aB,
12556
- SubscriptionPaywall as aC,
12557
- ProfileCard as aD,
12558
- ProfileCardTooltip as aE,
12559
- SecureLabelPicker as aa,
12560
- useApiErrorHandler as ab,
12561
- useDefaultApiErrorHandler as ac,
12562
- DefaultApiErrorHandler as ad,
12563
- Back as ae,
12564
- LazyEditor as af,
12565
- EditorPreview as ag,
12566
- DirtyPromptContainer as ah,
12567
- ConfirmNavigation as ai,
12568
- UploaderContext as aj,
12569
- useUploader as ak,
12570
- UploaderTrigger as al,
12571
- UploaderProvider as am,
12572
- getUploadedImageUrl as an,
12573
- usePointUpContext as ao,
12574
- PointUpProvider as ap,
12575
- ButtonGroup as aq,
12576
- SegmentedControl as ar,
12577
- create as as,
12578
- getWsClient as at,
12579
- useSubscription as au,
12580
- toast as av,
12581
- isInArcSphere$1 as aw,
12582
- isInArcSphereDialog as ax,
12583
- openArcSphereDialog as ay,
12584
- closeArcSphereDialog as az,
12578
+ ChatInWallet as a0,
12579
+ ChatListInWallet as a1,
12580
+ ChatHeaderAddon as a2,
12581
+ useChatContext as a3,
12582
+ ChatProvider as a4,
12583
+ UnreadNotificationContext as a5,
12584
+ useUnreadNotification as a6,
12585
+ UnreadNotificationProvider as a7,
12586
+ Confirm as a8,
12587
+ ConfirmContext as a9,
12588
+ openArcSphereDialog as aA,
12589
+ closeArcSphereDialog as aB,
12590
+ useArcSphereDialog as aC,
12591
+ Paywall as aD,
12592
+ SubscriptionPaywall as aE,
12593
+ ProfileCard as aF,
12594
+ ProfileCardTooltip as aG,
12595
+ useConfirm as aa,
12596
+ ConfirmProvider as ab,
12597
+ SecureLabelPicker as ac,
12598
+ useApiErrorHandler as ad,
12599
+ useDefaultApiErrorHandler as ae,
12600
+ DefaultApiErrorHandler as af,
12601
+ Back as ag,
12602
+ LazyEditor as ah,
12603
+ EditorPreview as ai,
12604
+ DirtyPromptContainer as aj,
12605
+ ConfirmNavigation as ak,
12606
+ UploaderContext as al,
12607
+ useUploader as am,
12608
+ UploaderTrigger as an,
12609
+ UploaderProvider as ao,
12610
+ getUploadedImageUrl as ap,
12611
+ usePointUpContext as aq,
12612
+ PointUpProvider as ar,
12613
+ ButtonGroup as as,
12614
+ SegmentedControl as at,
12615
+ create as au,
12616
+ getWsClient as av,
12617
+ useSubscription as aw,
12618
+ toast as ax,
12619
+ isInArcSphere$1 as ay,
12620
+ isInArcSphereDialog as az,
12585
12621
  Input as b,
12586
12622
  useChanged as c,
12587
12623
  useSessionContext as d,
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { U, o, X, A, n, ae, B, G, L, K, N, aq, Z, Y, a0, _, $, a2, x, C, y, z, F, a6, a7, ai, a9, Q, T, ad, D, ah, ag, J, H, b, m, af, M, P, aB, ap, w, v, aD, aE, R, S, aa, ar, aC, q, a3, a5, aj, am, al, az, as, O, an, at, aw, ax, l, ay, h, p, r, k, av, t, j, ab, aA, W, c, a1, E, a8, ac, e, u, ao, d, au, a4, ak, f } from "./index-DN2G52jl.mjs";
2
+ import { X, o, Z, A, n, ag, B, J, O, N, Q, as, $, _, a2, a0, a1, a4, x, G, H, C, y, z, F, a8, a9, ak, ab, U, W, af, D, aj, ai, L, K, b, m, ah, M, P, aD, ar, w, v, aF, aG, R, S, ac, at, aE, q, a5, a7, al, ao, an, aB, au, T, ap, av, ay, az, l, aA, h, p, r, k, ax, t, j, ad, aC, Y, c, a3, E, aa, ae, e, u, aq, d, aw, a6, am, f } from "./index-iI300n3e.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
@@ -9,93 +9,95 @@ import "@mui/icons-material";
9
9
  import "@arcblock/ux/lib/Locale/context";
10
10
  import "@mui/material";
11
11
  export {
12
- U as AccessControl,
12
+ X as AccessControl,
13
13
  o as AuthorInfo,
14
- X as AuthzProvider,
14
+ Z as AuthzProvider,
15
15
  A as Avatar,
16
16
  n as Avatars,
17
- ae as Back,
17
+ ag as Back,
18
18
  B as Badge,
19
- G as BinaryThumb,
20
- L as BlogCard,
21
- K as BlogList,
22
- N as BlogPermaLink,
23
- aq as ButtonGroup,
24
- Z as Chat,
25
- Y as ChatClient,
26
- a0 as ChatHeaderAddon,
27
- _ as ChatInWallet,
28
- $ as ChatListInWallet,
29
- a2 as ChatProvider,
19
+ J as BinaryThumb,
20
+ O as BlogCard,
21
+ N as BlogList,
22
+ Q as BlogPermaLink,
23
+ as as ButtonGroup,
24
+ $ as Chat,
25
+ _ as ChatClient,
26
+ a2 as ChatHeaderAddon,
27
+ a0 as ChatInWallet,
28
+ a1 as ChatListInWallet,
29
+ a4 as ChatProvider,
30
30
  x as Comment,
31
+ G as CommentIconButton,
32
+ H as CommentIconButtonGroup,
31
33
  C as CommentInput,
32
34
  y as CommentList,
33
35
  z as CommentsContext,
34
36
  F as CommentsProvider,
35
- a6 as Confirm,
36
- a7 as ConfirmContext,
37
- ai as ConfirmNavigation,
38
- a9 as ConfirmProvider,
39
- Q as CoverImage,
40
- T as CoverImageUpload,
41
- ad as DefaultApiErrorHandler,
37
+ a8 as Confirm,
38
+ a9 as ConfirmContext,
39
+ ak as ConfirmNavigation,
40
+ ab as ConfirmProvider,
41
+ U as CoverImage,
42
+ W as CoverImageUpload,
43
+ af as DefaultApiErrorHandler,
42
44
  D as DefaultEditorConfigProvider,
43
- ah as DirtyPromptContainer,
44
- ag as EditorPreview,
45
- J as EmptyStatus,
46
- H as GithubReaction,
45
+ aj as DirtyPromptContainer,
46
+ ai as EditorPreview,
47
+ L as EmptyStatus,
48
+ K as GithubReaction,
47
49
  b as Input,
48
50
  m as InternalThemeProvider,
49
- af as LazyEditor,
51
+ ah as LazyEditor,
50
52
  M as Menu,
51
53
  P as Pagination,
52
- aB as Paywall,
53
- ap as PointUpProvider,
54
+ aD as Paywall,
55
+ ar as PointUpProvider,
54
56
  w as Post,
55
57
  v as PostContent,
56
- aD as ProfileCard,
57
- aE as ProfileCardTooltip,
58
+ aF as ProfileCard,
59
+ aG as ProfileCardTooltip,
58
60
  R as RelativeTime,
59
61
  S as ScrollableEditorWrapper,
60
- aa as SecureLabelPicker,
61
- ar as SegmentedControl,
62
- aC as SubscriptionPaywall,
62
+ ac as SecureLabelPicker,
63
+ at as SegmentedControl,
64
+ aE as SubscriptionPaywall,
63
65
  q as SystemUser,
64
- a3 as UnreadNotificationContext,
65
- a5 as UnreadNotificationProvider,
66
- aj as UploaderContext,
67
- am as UploaderProvider,
68
- al as UploaderTrigger,
69
- az as closeArcSphereDialog,
70
- as as create,
71
- O as getBlogLink,
72
- an as getUploadedImageUrl,
73
- at as getWsClient,
74
- aw as isInArcSphere,
75
- ax as isInArcSphereDialog,
66
+ a5 as UnreadNotificationContext,
67
+ a7 as UnreadNotificationProvider,
68
+ al as UploaderContext,
69
+ ao as UploaderProvider,
70
+ an as UploaderTrigger,
71
+ aB as closeArcSphereDialog,
72
+ au as create,
73
+ T as getBlogLink,
74
+ ap as getUploadedImageUrl,
75
+ av as getWsClient,
76
+ ay as isInArcSphere,
77
+ az as isInArcSphereDialog,
76
78
  l as lexicalUtils,
77
- ay as openArcSphereDialog,
79
+ aA as openArcSphereDialog,
78
80
  h as preferences,
79
81
  p as preloadInput,
80
82
  r as routes,
81
83
  k as themeOverrides,
82
- av as toast,
84
+ ax as toast,
83
85
  t as translations,
84
86
  j as typography,
85
- ab as useApiErrorHandler,
86
- aA as useArcSphereDialog,
87
- W as useAuthzContext,
87
+ ad as useApiErrorHandler,
88
+ aC as useArcSphereDialog,
89
+ Y as useAuthzContext,
88
90
  c as useChanged,
89
- a1 as useChatContext,
91
+ a3 as useChatContext,
90
92
  E as useCommentsContext,
91
- a8 as useConfirm,
92
- ac as useDefaultApiErrorHandler,
93
+ aa as useConfirm,
94
+ ae as useDefaultApiErrorHandler,
93
95
  e as useEventCallback,
94
96
  u as useNow,
95
- ao as usePointUpContext,
97
+ aq as usePointUpContext,
96
98
  d as useSessionContext,
97
- au as useSubscription,
98
- a4 as useUnreadNotification,
99
- ak as useUploader,
99
+ aw as useSubscription,
100
+ a6 as useUnreadNotification,
101
+ am as useUploader,
100
102
  f as utils
101
103
  };
package/dist/index.umd.js CHANGED
@@ -2982,6 +2982,40 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2982
2982
  ) })
2983
2983
  ] });
2984
2984
  }
2985
+ function CommentIconButton({ sx, ...rest }) {
2986
+ const mergedSx = [
2987
+ {
2988
+ svg: {
2989
+ width: "1em",
2990
+ height: "1em",
2991
+ fontSize: 20
2992
+ },
2993
+ "&:hover": {
2994
+ color: "secondary.main"
2995
+ }
2996
+ },
2997
+ ...Array.isArray(sx) ? sx : [sx]
2998
+ ];
2999
+ return /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { size: "small", sx: mergedSx, ...rest, disableFocusRipple: true });
3000
+ }
3001
+ function CommentIconButtonGroup({ children, sx, ...rest }) {
3002
+ const mergedSx = [
3003
+ {
3004
+ display: "flex",
3005
+ alignItems: "center",
3006
+ gap: 2,
3007
+ "& > .MuiIconButton-root:first-child": {
3008
+ ml: "-5px"
3009
+ },
3010
+ // 避免局部 theme 覆盖问题 (如 comment donation 中的 CommentIconButton 会以 donation 局部的 theme palette 为准)
3011
+ ".MuiIconButton-root:hover": {
3012
+ color: "secondary.main"
3013
+ }
3014
+ },
3015
+ ...Array.isArray(sx) ? sx : [sx]
3016
+ ];
3017
+ return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { ...rest, sx: mergedSx, children });
3018
+ }
2985
3019
  const materialSymbolsUpload = (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: "M11 16V7.85l-2.6 2.6L7 9l5-5l5 5l-1.4 1.45l-2.6-2.6V16zm-5 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z" }) });
2986
3020
  const getUploadedImageUrl = (imageUrl, width = 320) => {
2987
3021
  var _a2;
@@ -12491,6 +12525,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
12491
12525
  exports2.ChatListInWallet = ChatListInWallet;
12492
12526
  exports2.ChatProvider = ChatProvider;
12493
12527
  exports2.Comment = Comment;
12528
+ exports2.CommentIconButton = CommentIconButton;
12529
+ exports2.CommentIconButtonGroup = CommentIconButtonGroup;
12494
12530
  exports2.CommentInput = CommentInput;
12495
12531
  exports2.CommentList = CommentList;
12496
12532
  exports2.CommentsContext = CommentsContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -45,8 +45,8 @@
45
45
  "ufo": "^1.5.4",
46
46
  "unstated-next": "^1.1.0",
47
47
  "url-join": "^4.0.1",
48
- "@blocklet/editor": "^2.3.2",
49
- "@blocklet/labels": "^2.3.2"
48
+ "@blocklet/editor": "^2.3.4",
49
+ "@blocklet/labels": "^2.3.4"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@arcblock/did-connect": "^2.10.36",