@blocklet/discuss-kit-ux 1.6.140 → 1.6.142

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.
@@ -5,6 +5,7 @@ interface Props {
5
5
  spacing?: number;
6
6
  startComponent?: any;
7
7
  [key: string]: any;
8
+ inProfile?: boolean;
8
9
  }
9
- export default function Badge({ startComponent, passports, pointInfo, did, spacing, ...restProps }: Props): import("react/jsx-runtime").JSX.Element | null;
10
+ export default function Badge({ startComponent, passports, pointInfo, did, spacing, inProfile, ...restProps }: Props): import("react/jsx-runtime").JSX.Element | null;
10
11
  export {};
@@ -0,0 +1 @@
1
+ export default function EmptyStatus(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default as EmptyStatus } from './empty-status';
@@ -20,6 +20,9 @@ declare const _default: {
20
20
  title: string;
21
21
  desc: string;
22
22
  };
23
+ profile: {
24
+ empty: string;
25
+ };
23
26
  unsaved: {
24
27
  title: string;
25
28
  desc: string;
@@ -22,6 +22,9 @@ export declare const translations: {
22
22
  title: string;
23
23
  desc: string;
24
24
  };
25
+ profile: {
26
+ empty: string;
27
+ };
25
28
  unsaved: {
26
29
  title: string;
27
30
  desc: string;
@@ -60,6 +63,9 @@ export declare const translations: {
60
63
  title: string;
61
64
  desc: string;
62
65
  };
66
+ profile: {
67
+ empty: string;
68
+ };
63
69
  unsaved: {
64
70
  title: string;
65
71
  desc: string;
@@ -21,6 +21,9 @@ declare const _default: {
21
21
  title: string;
22
22
  desc: string;
23
23
  };
24
+ profile: {
25
+ empty: string;
26
+ };
24
27
  unsaved: {
25
28
  title: string;
26
29
  desc: string;
@@ -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-YiHl-Bzx.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-eQ5sSf6_.mjs";
8
8
  import "@blocklet/labels";
9
9
  import "@mui/material/styles";
10
10
  import "@mui/material/Box";
@@ -39,6 +39,7 @@ import "lodash/trim";
39
39
  import "@mui/material/Avatar";
40
40
  import "@mui/icons-material/BrokenImage";
41
41
  import "@iconify/react";
42
+ import "@arcblock/ux/lib/Empty";
42
43
  import "@mui/material/colors";
43
44
  import "@arcblock/did-connect/lib/Session";
44
45
  import "@arcblock/did-connect/lib/Address";
@@ -41,6 +41,7 @@ import trim from "lodash/trim";
41
41
  import Avatar$1 from "@mui/material/Avatar";
42
42
  import BrokenImageIcon from "@mui/icons-material/BrokenImage";
43
43
  import { Icon } from "@iconify/react";
44
+ import Empty$1 from "@arcblock/ux/lib/Empty";
44
45
  import { green } from "@mui/material/colors";
45
46
  import { SessionContext } from "@arcblock/did-connect/lib/Session";
46
47
  import { useTheme as useTheme$1, useMediaQuery, Box as Box$1, Tooltip as Tooltip$1, Chip as Chip$1, alpha, ClickAwayListener, Dialog as Dialog$1, DialogTitle, DialogContent, DialogActions, DialogContentText, Button as Button$1, Skeleton, IconButton as IconButton$2, InputBase, tooltipClasses as tooltipClasses$1, Badge as Badge$1 } from "@mui/material";
@@ -672,6 +673,20 @@ function RelativeTime({ value, ...rest }) {
672
673
  const v2 = value instanceof Date ? value.getTime() : value;
673
674
  return /* @__PURE__ */ jsx(UxRelativeTime, { value: v2, ...rest });
674
675
  }
676
+ function EmptyStatus() {
677
+ const { t } = useLocaleContext();
678
+ return /* @__PURE__ */ jsx(
679
+ Box,
680
+ {
681
+ sx: { height: "50vh", width: "100%" },
682
+ display: "flex",
683
+ flexDirection: "column",
684
+ alignItems: "cetner",
685
+ justifyContent: "center",
686
+ children: /* @__PURE__ */ jsx(Empty$1, { children: t("profile.empty") })
687
+ }
688
+ );
689
+ }
675
690
  const iconStyle = {
676
691
  width: 20,
677
692
  height: 20
@@ -704,7 +719,15 @@ const badgeList = flatMap(
704
719
  }
705
720
  );
706
721
  const badgeMap = groupBy(badgeList, "key");
707
- function Badge({ startComponent, passports, pointInfo, did, spacing = 0.5, ...restProps }) {
722
+ function Badge({
723
+ startComponent,
724
+ passports,
725
+ pointInfo,
726
+ did,
727
+ spacing = 0.5,
728
+ inProfile = false,
729
+ ...restProps
730
+ }) {
708
731
  var _a2;
709
732
  const allBadges = [];
710
733
  if (pointInfo == null ? void 0 : pointInfo.grade) {
@@ -731,6 +754,9 @@ function Badge({ startComponent, passports, pointInfo, did, spacing = 0.5, ...re
731
754
  delete item.key;
732
755
  return JSON.stringify(item);
733
756
  });
757
+ if (inProfile && (uniqBadges == null ? void 0 : uniqBadges.length) <= 0) {
758
+ return /* @__PURE__ */ jsx(EmptyStatus, {});
759
+ }
734
760
  return uniqBadges.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
735
761
  startComponent,
736
762
  /* @__PURE__ */ jsx(
@@ -738,7 +764,8 @@ function Badge({ startComponent, passports, pointInfo, did, spacing = 0.5, ...re
738
764
  {
739
765
  direction: "row",
740
766
  sx: {
741
- flexWrap: "wrap"
767
+ flexWrap: "wrap",
768
+ marginTop: inProfile ? "24px" : ""
742
769
  },
743
770
  children: uniqBadges.map((item) => {
744
771
  const { badgeName, badgeIcon, badgeColor, badgeBackground } = item;
@@ -3662,6 +3689,7 @@ const getUrlHost = (url) => {
3662
3689
  }
3663
3690
  };
3664
3691
  function NotificationMessage({ chat, message, prevMessage, ...rest }) {
3692
+ const { session } = useSessionContext();
3665
3693
  const renderQuote = ({ title, excerpt, cover }) => {
3666
3694
  if ("post" in message) {
3667
3695
  return /* @__PURE__ */ jsxs(Box, { sx: { mt: 1.5, pl: 1, borderLeft: "4px solid #ddd", color: 14 }, children: [
@@ -3702,11 +3730,12 @@ function NotificationMessage({ chat, message, prevMessage, ...rest }) {
3702
3730
  return null;
3703
3731
  };
3704
3732
  const render = () => {
3733
+ var _a2, _b2, _c, _d;
3705
3734
  if (message.type === "comment") {
3706
3735
  return /* @__PURE__ */ jsxs(Box, { children: [
3707
3736
  /* @__PURE__ */ jsxs(Box, { children: [
3708
3737
  /* @__PURE__ */ jsx(Box, { component: "span", sx: { fontWeight: "bold" }, children: message.sourceUser.fullName }),
3709
- /* @__PURE__ */ jsx("span", { children: " commented your post:" })
3738
+ /* @__PURE__ */ jsx("span", { children: ((_a2 = message == null ? void 0 : message.sourceUser) == null ? void 0 : _a2.did) === ((_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.did) ? " commented your post:" : " commented post:" })
3710
3739
  ] }),
3711
3740
  /* @__PURE__ */ jsx(Typography, { variant: "body1", children: message.comment.excerpt }),
3712
3741
  renderQuote(message.post)
@@ -3716,7 +3745,7 @@ function NotificationMessage({ chat, message, prevMessage, ...rest }) {
3716
3745
  return /* @__PURE__ */ jsxs(Box, { children: [
3717
3746
  /* @__PURE__ */ jsxs(Box, { children: [
3718
3747
  /* @__PURE__ */ jsx(Box, { component: "span", sx: { color: "grey.600", fontWeight: "bold" }, children: message.sourceUser.fullName }),
3719
- /* @__PURE__ */ jsx("span", { children: " replied your comment:" })
3748
+ /* @__PURE__ */ jsx("span", { children: ((_c = message == null ? void 0 : message.sourceUser) == null ? void 0 : _c.did) === ((_d = session == null ? void 0 : session.user) == null ? void 0 : _d.did) ? " replied your comment:" : " replied comment:" })
3720
3749
  ] }),
3721
3750
  /* @__PURE__ */ jsx(Typography, { variant: "body1", children: message.reply.excerpt }),
3722
3751
  renderQuote({ title: message.post.title, excerpt: message.comment.excerpt })
@@ -4512,7 +4541,7 @@ function Pagination({ page, size = 20, total, onChange, routerMode = true, ...re
4512
4541
  }
4513
4542
  );
4514
4543
  }
4515
- const Editor = lazy(() => import("./editor-2KKKHQzw.mjs"));
4544
+ const Editor = lazy(() => import("./editor-JfAxKfzq.mjs"));
4516
4545
  function LazyEditor(props) {
4517
4546
  const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
4518
4547
  /* @__PURE__ */ jsx(Skeleton, {}),
@@ -4642,6 +4671,9 @@ const en = {
4642
4671
  title: "Delete comment",
4643
4672
  desc: "Do you want to delete this comment?"
4644
4673
  },
4674
+ profile: {
4675
+ empty: "Nothing here for now"
4676
+ },
4645
4677
  unsaved: {
4646
4678
  title: "Leave without saving",
4647
4679
  desc: "Your changes have not been saved. If you leave now, you will lose your changes.",
@@ -4681,6 +4713,9 @@ const zh = {
4681
4713
  title: "删除评论",
4682
4714
  desc: "是否要删除此评论?"
4683
4715
  },
4716
+ profile: {
4717
+ empty: "暂无数据"
4718
+ },
4684
4719
  unsaved: {
4685
4720
  title: "不保存离开",
4686
4721
  desc: "您的更改尚未保存。如果您现在离开,将会丢失您的更改。",
@@ -10366,57 +10401,58 @@ function PointUpProvider({ children }) {
10366
10401
  ] });
10367
10402
  }
10368
10403
  export {
10369
- Confirm as $,
10404
+ UnreadNotificationProvider as $,
10370
10405
  Avatar as A,
10371
10406
  Badge as B,
10372
10407
  CommentInput as C,
10373
10408
  DefaultEditorConfigProvider as D,
10374
- BlogCard as E,
10375
- BlogPermaLink as F,
10409
+ EmptyStatus as E,
10410
+ BlogCard as F,
10376
10411
  GithubReaction as G,
10377
- getBlogLink as H,
10412
+ BlogPermaLink as H,
10378
10413
  ImagePathFixerPlugin as I,
10379
- CoverImage as J,
10380
- CoverImageUpload as K,
10381
- AccessControl as L,
10414
+ getBlogLink as J,
10415
+ CoverImage as K,
10416
+ CoverImageUpload as L,
10382
10417
  Menu as M,
10383
- useAuthzContext as N,
10384
- AuthzProvider as O,
10418
+ AccessControl as N,
10419
+ useAuthzContext as O,
10385
10420
  Pagination as P,
10386
- ChatClient as Q,
10421
+ AuthzProvider as Q,
10387
10422
  RelativeTime as R,
10388
10423
  ScrollableEditorWrapper as S,
10389
- Chat as T,
10390
- ChatHeaderAddon as U,
10424
+ ChatClient as T,
10425
+ Chat as U,
10391
10426
  VideoPathFixerPlugin as V,
10392
- useChatContext as W,
10393
- ChatProvider as X,
10394
- UnreadNotificationContext as Y,
10395
- useUnreadNotification as Z,
10396
- UnreadNotificationProvider as _,
10427
+ ChatHeaderAddon as W,
10428
+ useChatContext as X,
10429
+ ChatProvider as Y,
10430
+ UnreadNotificationContext as Z,
10431
+ useUnreadNotification as _,
10397
10432
  isEmptyContent as a,
10398
- ConfirmContext as a0,
10399
- useConfirm as a1,
10400
- ConfirmProvider as a2,
10401
- SecureLabelPicker as a3,
10402
- useApiErrorHandler as a4,
10403
- useDefaultApiErrorHandler as a5,
10404
- PreviousLocationRecorder as a6,
10405
- Back as a7,
10406
- LazyEditor as a8,
10407
- EditorPreview as a9,
10408
- DirtyPromptContainer as aa,
10409
- ConfirmNavigation as ab,
10410
- UploaderContext as ac,
10411
- useUploader as ad,
10412
- UploaderTrigger as ae,
10413
- UploaderProvider as af,
10414
- composeImageUrl as ag,
10415
- usePointUpContext as ah,
10416
- PointUpProvider as ai,
10417
- create as aj,
10418
- getWsClient as ak,
10419
- useSubscription as al,
10433
+ Confirm as a0,
10434
+ ConfirmContext as a1,
10435
+ useConfirm as a2,
10436
+ ConfirmProvider as a3,
10437
+ SecureLabelPicker as a4,
10438
+ useApiErrorHandler as a5,
10439
+ useDefaultApiErrorHandler as a6,
10440
+ PreviousLocationRecorder as a7,
10441
+ Back as a8,
10442
+ LazyEditor as a9,
10443
+ EditorPreview as aa,
10444
+ DirtyPromptContainer as ab,
10445
+ ConfirmNavigation as ac,
10446
+ UploaderContext as ad,
10447
+ useUploader as ae,
10448
+ UploaderTrigger as af,
10449
+ UploaderProvider as ag,
10450
+ composeImageUrl as ah,
10451
+ usePointUpContext as ai,
10452
+ PointUpProvider as aj,
10453
+ create as ak,
10454
+ getWsClient as al,
10455
+ useSubscription as am,
10420
10456
  InternalThemeProvider as b,
10421
10457
  Input as c,
10422
10458
  translations as d,
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { Input, CommentInput, ScrollableEditorWrapper } from './components/input
4
4
  export * from './components/avatars';
5
5
  export * from './components/posts';
6
6
  export * from './components/rating';
7
+ export * from './components/emptyStatus';
7
8
  export * from './components/blog';
8
9
  export * from './components/authz';
9
10
  export * from './components/chat';
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { L, j, O, A, h, a7, B, y, E, z, F, T, Q, U, X, o, C, q, v, x, $, a0, ab, a2, J, K, D, aa, a9, G, c, b, a8, M, P, ai, n, m, a6, R, S, a3, k, Y, _, ac, af, ae, ag, aj, H, ak, l, p, r, t, d, a4, N, e, W, w, a1, a5, u, ah, al, Z, ad, f } from "./index-YiHl-Bzx.mjs";
2
+ import { N, j, Q, A, h, a8, B, y, F, z, H, U, T, W, Y, o, C, q, v, x, a0, a1, ac, a3, K, L, D, ab, aa, E, G, c, b, a9, M, P, aj, n, m, a7, R, S, a4, k, Z, $, ad, ag, af, ah, ak, J, al, l, p, r, t, d, a5, O, e, X, w, a2, a6, u, ai, am, _, ae, f } from "./index-eQ5sSf6_.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
@@ -37,6 +37,7 @@ import "lodash/trim";
37
37
  import "@mui/material/Avatar";
38
38
  import "@mui/icons-material/BrokenImage";
39
39
  import "@iconify/react";
40
+ import "@arcblock/ux/lib/Empty";
40
41
  import "@mui/material/colors";
41
42
  import "@arcblock/did-connect/lib/Address";
42
43
  import "@blocklet/editor/lib/ext/CheckboxPlugin";
@@ -64,74 +65,75 @@ import "unstated-next";
64
65
  import "js-cookie";
65
66
  import "@arcblock/ws";
66
67
  export {
67
- L as AccessControl,
68
+ N as AccessControl,
68
69
  j as AuthorInfo,
69
- O as AuthzProvider,
70
+ Q as AuthzProvider,
70
71
  A as Avatar,
71
72
  h as Avatars,
72
- a7 as Back,
73
+ a8 as Back,
73
74
  B as Badge,
74
75
  y as BinaryThumb,
75
- E as BlogCard,
76
+ F as BlogCard,
76
77
  z as BlogList,
77
- F as BlogPermaLink,
78
- T as Chat,
79
- Q as ChatClient,
80
- U as ChatHeaderAddon,
81
- X as ChatProvider,
78
+ H as BlogPermaLink,
79
+ U as Chat,
80
+ T as ChatClient,
81
+ W as ChatHeaderAddon,
82
+ Y as ChatProvider,
82
83
  o as Comment,
83
84
  C as CommentInput,
84
85
  q as CommentList,
85
86
  v as CommentsContext,
86
87
  x as CommentsProvider,
87
- $ as Confirm,
88
- a0 as ConfirmContext,
89
- ab as ConfirmNavigation,
90
- a2 as ConfirmProvider,
91
- J as CoverImage,
92
- K as CoverImageUpload,
88
+ a0 as Confirm,
89
+ a1 as ConfirmContext,
90
+ ac as ConfirmNavigation,
91
+ a3 as ConfirmProvider,
92
+ K as CoverImage,
93
+ L as CoverImageUpload,
93
94
  D as DefaultEditorConfigProvider,
94
- aa as DirtyPromptContainer,
95
- a9 as EditorPreview,
95
+ ab as DirtyPromptContainer,
96
+ aa as EditorPreview,
97
+ E as EmptyStatus,
96
98
  G as GithubReaction,
97
99
  c as Input,
98
100
  b as InternalThemeProvider,
99
- a8 as LazyEditor,
101
+ a9 as LazyEditor,
100
102
  M as Menu,
101
103
  P as Pagination,
102
- ai as PointUpProvider,
104
+ aj as PointUpProvider,
103
105
  n as Post,
104
106
  m as PostContent,
105
- a6 as PreviousLocationRecorder,
107
+ a7 as PreviousLocationRecorder,
106
108
  R as RelativeTime,
107
109
  S as ScrollableEditorWrapper,
108
- a3 as SecureLabelPicker,
110
+ a4 as SecureLabelPicker,
109
111
  k as SystemUser,
110
- Y as UnreadNotificationContext,
111
- _ as UnreadNotificationProvider,
112
- ac as UploaderContext,
113
- af as UploaderProvider,
114
- ae as UploaderTrigger,
115
- ag as composeImageUrl,
116
- aj as create,
117
- H as getBlogLink,
118
- ak as getWsClient,
112
+ Z as UnreadNotificationContext,
113
+ $ as UnreadNotificationProvider,
114
+ ad as UploaderContext,
115
+ ag as UploaderProvider,
116
+ af as UploaderTrigger,
117
+ ah as composeImageUrl,
118
+ ak as create,
119
+ J as getBlogLink,
120
+ al as getWsClient,
119
121
  l as lexicalUtils,
120
122
  p as preferences,
121
123
  r as routes,
122
124
  t as themeOverrides,
123
125
  d as translations,
124
- a4 as useApiErrorHandler,
125
- N as useAuthzContext,
126
+ a5 as useApiErrorHandler,
127
+ O as useAuthzContext,
126
128
  e as useChanged,
127
- W as useChatContext,
129
+ X as useChatContext,
128
130
  w as useCommentsContext,
129
- a1 as useConfirm,
130
- a5 as useDefaultApiErrorHandler,
131
+ a2 as useConfirm,
132
+ a6 as useDefaultApiErrorHandler,
131
133
  u as useNow,
132
- ah as usePointUpContext,
133
- al as useSubscription,
134
- Z as useUnreadNotification,
135
- ad as useUploader,
134
+ ai as usePointUpContext,
135
+ am as useSubscription,
136
+ _ as useUnreadNotification,
137
+ ae as useUploader,
136
138
  f as utils
137
139
  };
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("react"), require("@mui/material/Box"), require("@arcblock/ux/lib/Theme"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), 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/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("@mui/material/colors"), require("@arcblock/did-connect/lib/Session"), require("@mui/material"), require("@arcblock/did-connect/lib/Address"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), 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("@mui/material/Fab"), require("lodash/debounce"), require("@mui/material/TextField"), require("axios"), require("@arcblock/ux/lib/Toast"), require("@mui/material/Pagination"), require("unstated-next"), require("js-cookie"), require("@arcblock/ws"), 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", "react", "@mui/material/Box", "@arcblock/ux/lib/Theme", "lodash/isNil", "@blocklet/editor/lib/config", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@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/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", "@mui/material/colors", "@arcblock/did-connect/lib/Session", "@mui/material", "@arcblock/did-connect/lib/Address", "@blocklet/editor/lib/ext/CheckboxPlugin", "@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", "@mui/material/Fab", "lodash/debounce", "@mui/material/TextField", "axios", "@arcblock/ux/lib/Toast", "@mui/material/Pagination", "unstated-next", "js-cookie", "@arcblock/ws", "@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.react, global.Box, global.Theme, global.isNil, global.config, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, global.DidAvatar, 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.colors, global.Session, global.material, global.DIDAddress, global.CheckboxPlugin, 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.Fab, global.debounce, global.TextField, global.axios, global.Toast, global.MuiPagination, global.unstatedNext, global.Cookie, global.ws, global.OnContentChangePlugin, global.ShortcutPlugin, global.SafeAreaPlugin, global.text, global.ImageNode, global.VideoNode));
3
- })(this, function(exports2, labels, jsxRuntime, styles, react, Box, Theme, isNil, config, LexicalComposerContext, lexical$1, ahooks, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, DidAvatar, useMediaQuery, DID, Tooltip, reactRouterDom, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, colors, Session, material, DIDAddress, CheckboxPlugin, MuiMenuItem, clsx, IconButton$1, MuiMenu, Dialog, orderBy, Typography, Skeleton, joinUrl, reactDom, dayjs, relativeTime, mitt, CircularProgress, reactHelmet, Fab, debounce, TextField, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, 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("react"), require("@mui/material/Box"), require("@arcblock/ux/lib/Theme"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), 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/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("@mui/material/colors"), require("@arcblock/did-connect/lib/Session"), require("@mui/material"), require("@arcblock/did-connect/lib/Address"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), 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("@mui/material/Fab"), require("lodash/debounce"), require("@mui/material/TextField"), require("axios"), require("@arcblock/ux/lib/Toast"), require("@mui/material/Pagination"), require("unstated-next"), require("js-cookie"), require("@arcblock/ws"), 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", "react", "@mui/material/Box", "@arcblock/ux/lib/Theme", "lodash/isNil", "@blocklet/editor/lib/config", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@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/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", "@mui/material/colors", "@arcblock/did-connect/lib/Session", "@mui/material", "@arcblock/did-connect/lib/Address", "@blocklet/editor/lib/ext/CheckboxPlugin", "@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", "@mui/material/Fab", "lodash/debounce", "@mui/material/TextField", "axios", "@arcblock/ux/lib/Toast", "@mui/material/Pagination", "unstated-next", "js-cookie", "@arcblock/ws", "@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.react, global.Box, global.Theme, global.isNil, global.config, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, global.DidAvatar, 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$1, global.colors, global.Session, global.material, global.DIDAddress, global.CheckboxPlugin, 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.Fab, global.debounce, global.TextField, global.axios, global.Toast, global.MuiPagination, global.unstatedNext, global.Cookie, global.ws, global.OnContentChangePlugin, global.ShortcutPlugin, global.SafeAreaPlugin, global.text, global.ImageNode, global.VideoNode));
3
+ })(this, function(exports2, labels, jsxRuntime, styles, react, Box, Theme, isNil, config, LexicalComposerContext, lexical$1, ahooks, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, DidAvatar, useMediaQuery, DID, Tooltip, reactRouterDom, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$1, colors, Session, material, DIDAddress, CheckboxPlugin, MuiMenuItem, clsx, IconButton$1, MuiMenu, Dialog, orderBy, Typography, Skeleton, joinUrl, reactDom, dayjs, relativeTime, mitt, CircularProgress, reactHelmet, Fab, debounce, TextField, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, OnContentChangePlugin, ShortcutPlugin, 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) => {
@@ -612,6 +612,20 @@ var __publicField = (obj, key, value) => {
612
612
  const v2 = value instanceof Date ? value.getTime() : value;
613
613
  return /* @__PURE__ */ jsxRuntime.jsx(UxRelativeTime, { value: v2, ...rest });
614
614
  }
615
+ function EmptyStatus() {
616
+ const { t } = context.useLocaleContext();
617
+ return /* @__PURE__ */ jsxRuntime.jsx(
618
+ Box,
619
+ {
620
+ sx: { height: "50vh", width: "100%" },
621
+ display: "flex",
622
+ flexDirection: "column",
623
+ alignItems: "cetner",
624
+ justifyContent: "center",
625
+ children: /* @__PURE__ */ jsxRuntime.jsx(Empty$1, { children: t("profile.empty") })
626
+ }
627
+ );
628
+ }
615
629
  const iconStyle = {
616
630
  width: 20,
617
631
  height: 20
@@ -644,7 +658,15 @@ var __publicField = (obj, key, value) => {
644
658
  }
645
659
  );
646
660
  const badgeMap = groupBy(badgeList, "key");
647
- function Badge({ startComponent, passports, pointInfo, did, spacing = 0.5, ...restProps }) {
661
+ function Badge({
662
+ startComponent,
663
+ passports,
664
+ pointInfo,
665
+ did,
666
+ spacing = 0.5,
667
+ inProfile = false,
668
+ ...restProps
669
+ }) {
648
670
  var _a2;
649
671
  const allBadges = [];
650
672
  if (pointInfo == null ? void 0 : pointInfo.grade) {
@@ -671,6 +693,9 @@ var __publicField = (obj, key, value) => {
671
693
  delete item.key;
672
694
  return JSON.stringify(item);
673
695
  });
696
+ if (inProfile && (uniqBadges == null ? void 0 : uniqBadges.length) <= 0) {
697
+ return /* @__PURE__ */ jsxRuntime.jsx(EmptyStatus, {});
698
+ }
674
699
  return uniqBadges.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
675
700
  startComponent,
676
701
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -678,7 +703,8 @@ var __publicField = (obj, key, value) => {
678
703
  {
679
704
  direction: "row",
680
705
  sx: {
681
- flexWrap: "wrap"
706
+ flexWrap: "wrap",
707
+ marginTop: inProfile ? "24px" : ""
682
708
  },
683
709
  children: uniqBadges.map((item) => {
684
710
  const { badgeName, badgeIcon, badgeColor, badgeBackground } = item;
@@ -3602,6 +3628,7 @@ var __publicField = (obj, key, value) => {
3602
3628
  }
3603
3629
  };
3604
3630
  function NotificationMessage({ chat, message, prevMessage, ...rest }) {
3631
+ const { session } = useSessionContext();
3605
3632
  const renderQuote = ({ title, excerpt, cover }) => {
3606
3633
  if ("post" in message) {
3607
3634
  return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { mt: 1.5, pl: 1, borderLeft: "4px solid #ddd", color: 14 }, children: [
@@ -3642,11 +3669,12 @@ var __publicField = (obj, key, value) => {
3642
3669
  return null;
3643
3670
  };
3644
3671
  const render = () => {
3672
+ var _a2, _b2, _c, _d;
3645
3673
  if (message.type === "comment") {
3646
3674
  return /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
3647
3675
  /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
3648
3676
  /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontWeight: "bold" }, children: message.sourceUser.fullName }),
3649
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: " commented your post:" })
3677
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: ((_a2 = message == null ? void 0 : message.sourceUser) == null ? void 0 : _a2.did) === ((_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.did) ? " commented your post:" : " commented post:" })
3650
3678
  ] }),
3651
3679
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body1", children: message.comment.excerpt }),
3652
3680
  renderQuote(message.post)
@@ -3656,7 +3684,7 @@ var __publicField = (obj, key, value) => {
3656
3684
  return /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
3657
3685
  /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
3658
3686
  /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { color: "grey.600", fontWeight: "bold" }, children: message.sourceUser.fullName }),
3659
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: " replied your comment:" })
3687
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: ((_c = message == null ? void 0 : message.sourceUser) == null ? void 0 : _c.did) === ((_d = session == null ? void 0 : session.user) == null ? void 0 : _d.did) ? " replied your comment:" : " replied comment:" })
3660
3688
  ] }),
3661
3689
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body1", children: message.reply.excerpt }),
3662
3690
  renderQuote({ title: message.post.title, excerpt: message.comment.excerpt })
@@ -4582,6 +4610,9 @@ var __publicField = (obj, key, value) => {
4582
4610
  title: "Delete comment",
4583
4611
  desc: "Do you want to delete this comment?"
4584
4612
  },
4613
+ profile: {
4614
+ empty: "Nothing here for now"
4615
+ },
4585
4616
  unsaved: {
4586
4617
  title: "Leave without saving",
4587
4618
  desc: "Your changes have not been saved. If you leave now, you will lose your changes.",
@@ -4621,6 +4652,9 @@ var __publicField = (obj, key, value) => {
4621
4652
  title: "删除评论",
4622
4653
  desc: "是否要删除此评论?"
4623
4654
  },
4655
+ profile: {
4656
+ empty: "暂无数据"
4657
+ },
4624
4658
  unsaved: {
4625
4659
  title: "不保存离开",
4626
4660
  desc: "您的更改尚未保存。如果您现在离开,将会丢失您的更改。",
@@ -10365,6 +10399,7 @@ var __publicField = (obj, key, value) => {
10365
10399
  exports2.DefaultEditorConfigProvider = DefaultEditorConfigProvider;
10366
10400
  exports2.DirtyPromptContainer = DirtyPromptContainer;
10367
10401
  exports2.EditorPreview = EditorPreview;
10402
+ exports2.EmptyStatus = EmptyStatus;
10368
10403
  exports2.GithubReaction = GithubReaction;
10369
10404
  exports2.Input = Input;
10370
10405
  exports2.InternalThemeProvider = InternalThemeProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.6.140",
3
+ "version": "1.6.142",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@arcblock/ws": "^1.18.110",
32
- "@blocklet/editor": "1.6.140",
33
- "@blocklet/labels": "1.6.140",
32
+ "@blocklet/editor": "1.6.142",
33
+ "@blocklet/labels": "1.6.142",
34
34
  "@blocklet/uploader": "^0.0.73",
35
35
  "@emotion/css": "^11.10.5",
36
36
  "@emotion/react": "^11.10.5",
@@ -93,5 +93,5 @@
93
93
  "resolutions": {
94
94
  "react": "^18.2.0"
95
95
  },
96
- "gitHead": "010dcde9d12c700a207489bdc3b817ce2e4572f6"
96
+ "gitHead": "63b18e56de4f6e0deeb90ada0ceca5b1da4d87c1"
97
97
  }