@blocklet/discuss-kit-ux 1.6.167 → 1.6.169

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,9 +1,11 @@
1
+ import { type SxProps } from '@mui/material/styles';
1
2
  interface PaginationProps {
2
3
  page?: number;
3
4
  size?: number;
4
5
  total: number;
5
6
  onChange?: (page: number) => void;
6
7
  routerMode?: boolean;
8
+ sx?: SxProps;
7
9
  }
8
- export default function Pagination({ page, size, total, onChange, routerMode, ...rest }: PaginationProps): import("react/jsx-runtime").JSX.Element | null;
10
+ export default function Pagination({ page, size, total, onChange, routerMode, sx, ...rest }: PaginationProps): import("react/jsx-runtime").JSX.Element | null;
9
11
  export {};
@@ -3,10 +3,11 @@ interface Props {
3
3
  content: string;
4
4
  editing?: boolean;
5
5
  onExitEditing?: () => void;
6
+ onCancel?: () => void;
6
7
  onSubmit?: Send;
7
8
  autoCollapse?: boolean;
8
9
  enableHeadingsIdPlugin?: boolean;
9
10
  onReady?: () => void;
10
11
  }
11
- export default function PostContent({ content, editing, onExitEditing, onSubmit, autoCollapse, enableHeadingsIdPlugin, onReady, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
12
+ export default function PostContent({ content, editing, onExitEditing, onCancel, onSubmit, autoCollapse, enableHeadingsIdPlugin, onReady, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -1,34 +1,5 @@
1
- export declare const themeOverrides: {
2
- components: {
3
- MuiButton: {
4
- defaultProps: {
5
- size: string;
6
- };
7
- styleOverrides: {
8
- root: {
9
- textTransform: string;
10
- };
11
- };
12
- };
13
- MuiIconButton: {
14
- defaultProps: {
15
- size: string;
16
- };
17
- };
18
- MuiToggleButtonGroup: {
19
- defaultProps: {
20
- size: string;
21
- };
22
- };
23
- MuiToggleButton: {
24
- styleOverrides: {
25
- root: {
26
- textTransform: string;
27
- };
28
- };
29
- };
30
- };
31
- };
1
+ import { type ThemeOptions } from '@mui/material/styles';
2
+ export declare const themeOverrides: Partial<ThemeOptions>;
32
3
  export declare function InternalThemeProvider({ children }: {
33
4
  children: any;
34
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -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-AqROiqZF.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-l7-38Nc9.mjs";
8
8
  import "@blocklet/labels";
9
9
  import "@mui/material/styles";
10
10
  import "@mui/material/Box";
@@ -106,11 +106,11 @@ const themeOverrides = {
106
106
  function InternalThemeProvider({ children }) {
107
107
  const theme = useTheme();
108
108
  const merged = {
109
- ...theme,
110
- components: {
111
- ...theme.components,
112
- ...themeOverrides.components
113
- }
109
+ ...theme
110
+ // components: {
111
+ // ...theme.components,
112
+ // ...themeOverrides.components,
113
+ // },
114
114
  };
115
115
  return /* @__PURE__ */ jsx(ThemeProvider, { theme: merged, children });
116
116
  }
@@ -1201,6 +1201,7 @@ function PostContent({
1201
1201
  content,
1202
1202
  editing = false,
1203
1203
  onExitEditing,
1204
+ onCancel,
1204
1205
  onSubmit,
1205
1206
  autoCollapse,
1206
1207
  enableHeadingsIdPlugin,
@@ -1214,7 +1215,7 @@ function PostContent({
1214
1215
  sx: {
1215
1216
  ".be-editable": { maxHeight: 768, overflow: "auto", minHeight: `${Math.max(innerHeight, 200)}px !important` }
1216
1217
  },
1217
- children: /* @__PURE__ */ jsx(PostEdit, { content, onCancel: onExitEditing, send: onSubmit, onSuccess: onExitEditing })
1218
+ children: /* @__PURE__ */ jsx(PostEdit, { content, onCancel, send: onSubmit, onSuccess: onExitEditing })
1218
1219
  }
1219
1220
  );
1220
1221
  }
@@ -3614,7 +3615,7 @@ function ChatList(props) {
3614
3615
  position: "relative",
3615
3616
  p: 2,
3616
3617
  fontWeight: "bold",
3617
- color: isActiveChat ? "#fff" : "grey.700",
3618
+ color: isActiveChat ? "primary.contrastText" : "grey.700",
3618
3619
  bgcolor: isActiveChat ? "primary.light" : "",
3619
3620
  borderRadius: 2,
3620
3621
  cursor: "pointer",
@@ -3945,7 +3946,7 @@ const PreviousLocationRecorder = () => {
3945
3946
  };
3946
3947
  function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
3947
3948
  const navigate = useNavigate();
3948
- const mergedSx = [{ ml: "-5px", color: "grey.600" }, ...Array.isArray(sx) ? sx : [sx]];
3949
+ const mergedSx = [{ color: "grey.600" }, ...Array.isArray(sx) ? sx : [sx]];
3949
3950
  const handleClick = () => {
3950
3951
  if (url) {
3951
3952
  navigate(url, { replace: true });
@@ -3957,15 +3958,15 @@ function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
3957
3958
  };
3958
3959
  if (iconOnly) {
3959
3960
  mergedSx.push({ minWidth: "initial", py: 1 });
3960
- return /* @__PURE__ */ jsx(Button$1, { className: "back-button", onClick: handleClick, variant: "text", color: "inherit", sx: mergedSx, ...rest, children: /* @__PURE__ */ jsx(ArrowBackIos, { style: { fontSize: 13 } }) });
3961
+ return /* @__PURE__ */ jsx(Button$1, { onClick: handleClick, variant: "text", color: "inherit", sx: mergedSx, ...rest, children: /* @__PURE__ */ jsx(ArrowBackIos, { style: { fontSize: 13 } }) });
3961
3962
  }
3962
3963
  return /* @__PURE__ */ jsx(
3963
3964
  Button$1,
3964
3965
  {
3965
- className: "back-button",
3966
3966
  onClick: handleClick,
3967
- variant: "text",
3967
+ variant: "outlined",
3968
3968
  color: "inherit",
3969
+ size: "small",
3969
3970
  startIcon: /* @__PURE__ */ jsx(ArrowBackIos, { style: { fontSize: 13 } }),
3970
3971
  sx: mergedSx,
3971
3972
  ...rest,
@@ -4532,11 +4533,26 @@ function DefaultEditorConfigProvider({
4532
4533
  }, [isAdmin, request, (_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.did, downMd]);
4533
4534
  return /* @__PURE__ */ jsx(EditorConfigProvider, { value: config, children });
4534
4535
  }
4535
- function Pagination({ page, size = 20, total, onChange, routerMode = true, ...rest }) {
4536
+ function Pagination({
4537
+ page,
4538
+ size = 20,
4539
+ total,
4540
+ onChange,
4541
+ routerMode = true,
4542
+ sx,
4543
+ ...rest
4544
+ }) {
4536
4545
  const theme = useTheme();
4537
4546
  const downMd = useMediaQuery$1(theme.breakpoints.down("md"));
4538
4547
  const [searchParams, setSearchParams] = useSearchParams();
4539
4548
  const pageCount = Math.ceil(total / size);
4549
+ const mergedSx = [
4550
+ {
4551
+ ".MuiPaginationItem-root": { border: 0 },
4552
+ ".MuiPaginationItem-root.Mui-selected": { bgcolor: "transparent", border: 1, borderColor: "divider" }
4553
+ },
4554
+ ...Array.isArray(sx) ? sx : [sx]
4555
+ ];
4540
4556
  const handleOnChange = (e, page2) => {
4541
4557
  if (routerMode) {
4542
4558
  searchParams.set("page", `${page2}`);
@@ -4557,13 +4573,12 @@ function Pagination({ page, size = 20, total, onChange, routerMode = true, ...re
4557
4573
  variant: "outlined",
4558
4574
  shape: "rounded",
4559
4575
  size: downMd ? "small" : "medium",
4560
- showFirstButton: true,
4561
- showLastButton: true,
4576
+ sx: mergedSx,
4562
4577
  ...rest
4563
4578
  }
4564
4579
  );
4565
4580
  }
4566
- const Editor = lazy(() => import("./editor-FzAO_L68.mjs"));
4581
+ const Editor = lazy(() => import("./editor-JXsHI10g.mjs"));
4567
4582
  function LazyEditor(props) {
4568
4583
  const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
4569
4584
  /* @__PURE__ */ jsx(Skeleton, {}),
@@ -10658,11 +10673,11 @@ export {
10658
10673
  create as al,
10659
10674
  getWsClient as am,
10660
10675
  useSubscription as an,
10661
- InternalThemeProvider as b,
10662
- Input as c,
10663
- translations as d,
10664
- useChanged as e,
10665
- utils as f,
10676
+ Input as b,
10677
+ useChanged as c,
10678
+ utils as d,
10679
+ themeOverrides as e,
10680
+ InternalThemeProvider as f,
10666
10681
  getExcerptSync as g,
10667
10682
  Avatars as h,
10668
10683
  inferInitialEditorState as i,
@@ -10676,7 +10691,7 @@ export {
10676
10691
  CommentList as q,
10677
10692
  routes as r,
10678
10693
  stringify as s,
10679
- themeOverrides as t,
10694
+ translations as t,
10680
10695
  useNow as u,
10681
10696
  CommentsContext as v,
10682
10697
  useCommentsContext as w,
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from '@blocklet/labels';
2
- export { themeOverrides, InternalThemeProvider } from './components/shared/theme';
2
+ export * from './components/shared/theme';
3
3
  export { Input, CommentInput, ScrollableEditorWrapper } from './components/input';
4
4
  export * from './components/avatars';
5
5
  export * from './components/posts';
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { N, j, Q, A, h, a8, B, y, F, z, H, ak, 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, al, J, am, l, p, r, t, d, a5, O, e, X, w, a2, a6, u, ai, an, _, ae, f } from "./index-AqROiqZF.mjs";
2
+ import { N, j, Q, A, h, a8, B, y, F, z, H, ak, U, T, W, Y, o, C, q, v, x, a0, a1, ac, a3, K, L, D, ab, aa, E, G, b, f, a9, M, P, aj, n, m, a7, R, S, a4, k, Z, $, ad, ag, af, ah, al, J, am, l, p, r, e, t, a5, O, c, X, w, a2, a6, u, ai, an, _, ae, d } from "./index-l7-38Nc9.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
@@ -99,8 +99,8 @@ export {
99
99
  aa as EditorPreview,
100
100
  E as EmptyStatus,
101
101
  G as GithubReaction,
102
- c as Input,
103
- b as InternalThemeProvider,
102
+ b as Input,
103
+ f as InternalThemeProvider,
104
104
  a9 as LazyEditor,
105
105
  M as Menu,
106
106
  P as Pagination,
@@ -124,11 +124,11 @@ export {
124
124
  l as lexicalUtils,
125
125
  p as preferences,
126
126
  r as routes,
127
- t as themeOverrides,
128
- d as translations,
127
+ e as themeOverrides,
128
+ t as translations,
129
129
  a5 as useApiErrorHandler,
130
130
  O as useAuthzContext,
131
- e as useChanged,
131
+ c as useChanged,
132
132
  X as useChatContext,
133
133
  w as useCommentsContext,
134
134
  a2 as useConfirm,
@@ -138,5 +138,5 @@ export {
138
138
  an as useSubscription,
139
139
  _ as useUnreadNotification,
140
140
  ae as useUploader,
141
- f as utils
141
+ d as utils
142
142
  };
package/dist/index.umd.js CHANGED
@@ -43,11 +43,11 @@ var __publicField = (obj, key, value) => {
43
43
  function InternalThemeProvider({ children }) {
44
44
  const theme = styles.useTheme();
45
45
  const merged = {
46
- ...theme,
47
- components: {
48
- ...theme.components,
49
- ...themeOverrides.components
50
- }
46
+ ...theme
47
+ // components: {
48
+ // ...theme.components,
49
+ // ...themeOverrides.components,
50
+ // },
51
51
  };
52
52
  return /* @__PURE__ */ jsxRuntime.jsx(styles.ThemeProvider, { theme: merged, children });
53
53
  }
@@ -1138,6 +1138,7 @@ var __publicField = (obj, key, value) => {
1138
1138
  content,
1139
1139
  editing = false,
1140
1140
  onExitEditing,
1141
+ onCancel,
1141
1142
  onSubmit,
1142
1143
  autoCollapse,
1143
1144
  enableHeadingsIdPlugin,
@@ -1151,7 +1152,7 @@ var __publicField = (obj, key, value) => {
1151
1152
  sx: {
1152
1153
  ".be-editable": { maxHeight: 768, overflow: "auto", minHeight: `${Math.max(innerHeight, 200)}px !important` }
1153
1154
  },
1154
- children: /* @__PURE__ */ jsxRuntime.jsx(PostEdit, { content, onCancel: onExitEditing, send: onSubmit, onSuccess: onExitEditing })
1155
+ children: /* @__PURE__ */ jsxRuntime.jsx(PostEdit, { content, onCancel, send: onSubmit, onSuccess: onExitEditing })
1155
1156
  }
1156
1157
  );
1157
1158
  }
@@ -3551,7 +3552,7 @@ var __publicField = (obj, key, value) => {
3551
3552
  position: "relative",
3552
3553
  p: 2,
3553
3554
  fontWeight: "bold",
3554
- color: isActiveChat ? "#fff" : "grey.700",
3555
+ color: isActiveChat ? "primary.contrastText" : "grey.700",
3555
3556
  bgcolor: isActiveChat ? "primary.light" : "",
3556
3557
  borderRadius: 2,
3557
3558
  cursor: "pointer",
@@ -3882,7 +3883,7 @@ var __publicField = (obj, key, value) => {
3882
3883
  };
3883
3884
  function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
3884
3885
  const navigate = reactRouterDom.useNavigate();
3885
- const mergedSx = [{ ml: "-5px", color: "grey.600" }, ...Array.isArray(sx) ? sx : [sx]];
3886
+ const mergedSx = [{ color: "grey.600" }, ...Array.isArray(sx) ? sx : [sx]];
3886
3887
  const handleClick = () => {
3887
3888
  if (url) {
3888
3889
  navigate(url, { replace: true });
@@ -3894,15 +3895,15 @@ var __publicField = (obj, key, value) => {
3894
3895
  };
3895
3896
  if (iconOnly) {
3896
3897
  mergedSx.push({ minWidth: "initial", py: 1 });
3897
- return /* @__PURE__ */ jsxRuntime.jsx(material.Button, { className: "back-button", onClick: handleClick, variant: "text", color: "inherit", sx: mergedSx, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ArrowBackIos, { style: { fontSize: 13 } }) });
3898
+ return /* @__PURE__ */ jsxRuntime.jsx(material.Button, { onClick: handleClick, variant: "text", color: "inherit", sx: mergedSx, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ArrowBackIos, { style: { fontSize: 13 } }) });
3898
3899
  }
3899
3900
  return /* @__PURE__ */ jsxRuntime.jsx(
3900
3901
  material.Button,
3901
3902
  {
3902
- className: "back-button",
3903
3903
  onClick: handleClick,
3904
- variant: "text",
3904
+ variant: "outlined",
3905
3905
  color: "inherit",
3906
+ size: "small",
3906
3907
  startIcon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ArrowBackIos, { style: { fontSize: 13 } }),
3907
3908
  sx: mergedSx,
3908
3909
  ...rest,
@@ -4469,11 +4470,26 @@ var __publicField = (obj, key, value) => {
4469
4470
  }, [isAdmin, request, (_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.did, downMd]);
4470
4471
  return /* @__PURE__ */ jsxRuntime.jsx(config.EditorConfigProvider, { value: config$1, children });
4471
4472
  }
4472
- function Pagination({ page, size = 20, total, onChange, routerMode = true, ...rest }) {
4473
+ function Pagination({
4474
+ page,
4475
+ size = 20,
4476
+ total,
4477
+ onChange,
4478
+ routerMode = true,
4479
+ sx,
4480
+ ...rest
4481
+ }) {
4473
4482
  const theme = styles.useTheme();
4474
4483
  const downMd = useMediaQuery(theme.breakpoints.down("md"));
4475
4484
  const [searchParams, setSearchParams] = reactRouterDom.useSearchParams();
4476
4485
  const pageCount = Math.ceil(total / size);
4486
+ const mergedSx = [
4487
+ {
4488
+ ".MuiPaginationItem-root": { border: 0 },
4489
+ ".MuiPaginationItem-root.Mui-selected": { bgcolor: "transparent", border: 1, borderColor: "divider" }
4490
+ },
4491
+ ...Array.isArray(sx) ? sx : [sx]
4492
+ ];
4477
4493
  const handleOnChange = (e, page2) => {
4478
4494
  if (routerMode) {
4479
4495
  searchParams.set("page", `${page2}`);
@@ -4494,8 +4510,7 @@ var __publicField = (obj, key, value) => {
4494
4510
  variant: "outlined",
4495
4511
  shape: "rounded",
4496
4512
  size: downMd ? "small" : "medium",
4497
- showFirstButton: true,
4498
- showLastButton: true,
4513
+ sx: mergedSx,
4499
4514
  ...rest
4500
4515
  }
4501
4516
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.6.167",
3
+ "version": "1.6.169",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@arcblock/ws": "^1.18.112",
32
- "@blocklet/editor": "1.6.167",
33
- "@blocklet/labels": "1.6.167",
32
+ "@blocklet/editor": "1.6.169",
33
+ "@blocklet/labels": "1.6.169",
34
34
  "@blocklet/uploader": "^0.0.74",
35
35
  "@emotion/css": "^11.10.5",
36
36
  "@emotion/react": "^11.10.5",
@@ -94,5 +94,5 @@
94
94
  "resolutions": {
95
95
  "react": "^18.2.0"
96
96
  },
97
- "gitHead": "d693e00f42a067f737029d207f6e8e8a8eefa897"
97
+ "gitHead": "7caa727540c6b01581cf21807affab650dbb0b60"
98
98
  }
@@ -1,7 +0,0 @@
1
- import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import PostContent from './post-content';
3
- declare const _default: ComponentMeta<typeof PostContent>;
4
- export default _default;
5
- export declare const Basic: ComponentStory<typeof PostContent>;
6
- export declare const LongContent: ComponentStory<typeof PostContent>;
7
- export declare const Editable: ComponentStory<typeof PostContent>;