@blocklet/discuss-kit-ux 2.5.81 → 2.5.82

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,23 +1,10 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Suspense } from "react";
3
- import CheckboxPlugin from "@blocklet/editor/lib/ext/CheckboxPlugin";
4
- import { styled } from "@mui/material/styles";
5
3
  import Box from "@mui/material/Box";
6
4
  import { Skeleton } from "@mui/material";
5
+ import { BlockletEditorViewer } from "@blocklet/editor/lib/blocklet-editor-viewer";
7
6
  import { ViewMore } from "../view-more.mjs";
8
7
  import PostEdit from "../input/post-edit.mjs";
9
- import { BlockletEditor } from "../editor/blocklet-editor.mjs";
10
- const StyledBlockletEditor = styled(BlockletEditor)`
11
- .editor-scroller {
12
- min-height: initial;
13
- }
14
- .ContentEditable__root {
15
- padding: 0;
16
- }
17
- .be-editable > p:last-child {
18
- margin-bottom: 0;
19
- }
20
- `;
21
8
  const innerHeight = parseInt(String(window.innerHeight / 3), 10);
22
9
  export default function PostContent({
23
10
  content,
@@ -50,33 +37,27 @@ export default function PostContent({
50
37
  /* @__PURE__ */ jsx(Skeleton, { width: "40%" })
51
38
  ] });
52
39
  if (!autoCollapse) {
53
- return /* @__PURE__ */ jsx(Suspense, { fallback, children: /* @__PURE__ */ jsxs(
54
- StyledBlockletEditor,
40
+ return /* @__PURE__ */ jsx(Suspense, { fallback, children: /* @__PURE__ */ jsx(
41
+ BlockletEditorViewer,
55
42
  {
56
- editable: false,
57
43
  editorState: content,
58
44
  enableHeadingsIdPlugin,
59
45
  onReady,
60
46
  prepend: editorPrepend,
61
- children: [
62
- /* @__PURE__ */ jsx(CheckboxPlugin, { send: onSubmit }),
63
- children
64
- ]
47
+ onCheckboxChange: onSubmit,
48
+ children
65
49
  }
66
50
  ) });
67
51
  }
68
- return /* @__PURE__ */ jsx(Suspense, { fallback, children: /* @__PURE__ */ jsx(ViewMore, { ...rest, children: /* @__PURE__ */ jsxs(
69
- StyledBlockletEditor,
52
+ return /* @__PURE__ */ jsx(Suspense, { fallback, children: /* @__PURE__ */ jsx(ViewMore, { ...rest, children: /* @__PURE__ */ jsx(
53
+ BlockletEditorViewer,
70
54
  {
71
- editable: false,
72
55
  editorState: content,
73
56
  enableHeadingsIdPlugin,
74
57
  onReady,
75
58
  prepend: editorPrepend,
76
- children: [
77
- /* @__PURE__ */ jsx(CheckboxPlugin, { send: onSubmit }),
78
- children
79
- ]
59
+ onCheckboxChange: onSubmit,
60
+ children
80
61
  }
81
62
  ) }) });
82
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.5.81",
3
+ "version": "2.5.82",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -47,8 +47,8 @@
47
47
  "unstated-next": "^1.1.0",
48
48
  "url-join": "^4.0.1",
49
49
  "zustand": "^4.5.5",
50
- "@blocklet/editor": "2.5.81",
51
- "@blocklet/labels": "2.5.81"
50
+ "@blocklet/editor": "2.5.82",
51
+ "@blocklet/labels": "2.5.82"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@arcblock/did-connect-react": "^3.1.5",