@blocklet/discuss-kit-post 2.1.194 → 2.1.196

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.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { BoxProps } from '@mui/material';
2
2
  interface PostProps extends BoxProps {
3
3
  postId: string;
4
+ readonly?: boolean;
4
5
  }
5
6
  export declare function Post(props: PostProps): import("react/jsx-runtime").JSX.Element | null;
6
7
  export {};
package/dist/index.es.js CHANGED
@@ -199,7 +199,7 @@ function InternalPostEdit({ post, onSave, onUpdate, onCancel, ...rest }) {
199
199
  function PostEdit(props) {
200
200
  return /* @__PURE__ */ jsx(DirtyPromptContainer.Provider, { children: /* @__PURE__ */ jsx(InternalPostEdit, { ...props }) });
201
201
  }
202
- function InternalPost({ postId, sx, ...rest }) {
202
+ function InternalPost({ postId, sx, readonly, ...rest }) {
203
203
  var _a2, _b2;
204
204
  const { locale } = useLocaleContext();
205
205
  const sessionCtx = useContext(SessionContext);
@@ -237,7 +237,7 @@ function InternalPost({ postId, sx, ...rest }) {
237
237
  ...Array.isArray(sx) ? sx : [sx]
238
238
  ];
239
239
  return /* @__PURE__ */ jsx(InternalThemeProvider, { children: /* @__PURE__ */ jsx(UploaderProvider, { children: /* @__PURE__ */ jsx(DefaultEditorConfigProvider, { request: api, children: /* @__PURE__ */ jsxs(Box, { sx: mergedSx, ...rest, children: [
240
- isAdmin && !editable && /* @__PURE__ */ jsx(
240
+ !readonly && isAdmin && !editable && /* @__PURE__ */ jsx(
241
241
  IconButton,
242
242
  {
243
243
  className: "post-component-edit-button",
package/dist/index.umd.js CHANGED
@@ -193,7 +193,7 @@
193
193
  function PostEdit(props) {
194
194
  return /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.DirtyPromptContainer.Provider, { children: /* @__PURE__ */ jsxRuntime.jsx(InternalPostEdit, { ...props }) });
195
195
  }
196
- function InternalPost({ postId, sx, ...rest }) {
196
+ function InternalPost({ postId, sx, readonly, ...rest }) {
197
197
  var _a2, _b2;
198
198
  const { locale } = context.useLocaleContext();
199
199
  const sessionCtx = react.useContext(Session.SessionContext);
@@ -231,7 +231,7 @@
231
231
  ...Array.isArray(sx) ? sx : [sx]
232
232
  ];
233
233
  return /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.InternalThemeProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.UploaderProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(discussKitUx.DefaultEditorConfigProvider, { request: api, children: /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: mergedSx, ...rest, children: [
234
- isAdmin && !editable && /* @__PURE__ */ jsxRuntime.jsx(
234
+ !readonly && isAdmin && !editable && /* @__PURE__ */ jsxRuntime.jsx(
235
235
  material.IconButton,
236
236
  {
237
237
  className: "post-component-edit-button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-post",
3
- "version": "2.1.194",
3
+ "version": "2.1.196",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -22,7 +22,7 @@
22
22
  "@mui/icons-material": "^5.16.7",
23
23
  "ahooks": "^3.8.1",
24
24
  "ufo": "1.3.1",
25
- "@blocklet/discuss-kit-ux": "^2.1.194"
25
+ "@blocklet/discuss-kit-ux": "^2.1.196"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@arcblock/did-connect": "^2.10.36",