@blocklet/discuss-kit-ux 2.0.126 → 2.0.128

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,3 +1,4 @@
1
+ import { SxProps } from '@mui/material';
1
2
  import { User } from '../../types';
2
3
 
3
4
  interface Props {
@@ -12,8 +13,11 @@ interface Props {
12
13
  showDID?: boolean;
13
14
  children?: React.ReactNode;
14
15
  linkToProfile?: boolean;
16
+ onAvatarClick?: () => void;
15
17
  avatarSize?: number;
16
18
  fontSize?: number;
19
+ copyable?: boolean;
20
+ sx?: SxProps;
17
21
  }
18
- export default function AuthorInfo({ user, createdAt, append, size, responsive, showProfileCard, showBadge, showDID, newTitle, children, linkToProfile, avatarSize, fontSize, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
22
+ export default function AuthorInfo({ user, createdAt, append, size, responsive, showProfileCard, showBadge, showDID, newTitle, children, linkToProfile, onAvatarClick, avatarSize, fontSize, copyable, sx, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
19
23
  export {};
@@ -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-mevW5K3n.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-DTVjWBDu.mjs";
8
8
  const BlockletEditor = lazy(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -1296,8 +1296,11 @@ function AuthorInfo({
1296
1296
  newTitle = void 0,
1297
1297
  children,
1298
1298
  linkToProfile = true,
1299
+ onAvatarClick,
1299
1300
  avatarSize,
1300
1301
  fontSize,
1302
+ copyable,
1303
+ sx,
1301
1304
  ...rest
1302
1305
  }) {
1303
1306
  const theme = useTheme();
@@ -1326,6 +1329,7 @@ function AuthorInfo({
1326
1329
  const canClick = linkToProfile && (user == null ? void 0 : user.did) && (user == null ? void 0 : user.did) !== window.blocklet.appId;
1327
1330
  const click = (e) => {
1328
1331
  var _a2, _b2;
1332
+ if (onAvatarClick) onAvatarClick();
1329
1333
  if (!canClick) {
1330
1334
  return;
1331
1335
  }
@@ -1359,7 +1363,7 @@ function AuthorInfo({
1359
1363
  {
1360
1364
  sx: {
1361
1365
  display: "flex",
1362
- cursor: canClick ? "pointer" : "auto",
1366
+ cursor: canClick ? "pointer" : "inherit",
1363
1367
  width: mergedAvatarSize,
1364
1368
  height: mergedAvatarSize
1365
1369
  },
@@ -1386,7 +1390,12 @@ function AuthorInfo({
1386
1390
  return /* @__PURE__ */ jsx(
1387
1391
  Box$1,
1388
1392
  {
1389
- sx: { display: "flex", cursor: "pointer", width: mergedAvatarSize, height: mergedAvatarSize },
1393
+ sx: {
1394
+ display: "flex",
1395
+ cursor: canClick ? "pointer" : "inherit",
1396
+ width: mergedAvatarSize,
1397
+ height: mergedAvatarSize
1398
+ },
1390
1399
  onClick: click,
1391
1400
  children: /* @__PURE__ */ jsx(
1392
1401
  Avatar,
@@ -1414,7 +1423,7 @@ function AuthorInfo({
1414
1423
  did: user == null ? void 0 : user.did
1415
1424
  }
1416
1425
  );
1417
- return /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", alignItems: "center", gap: 1, fontSize: mergedFontSize }, ...rest, children: [
1426
+ return /* @__PURE__ */ jsxs(Box$1, { sx: mergeSx({ display: "flex", alignItems: "center", gap: 1, fontSize: mergedFontSize }, sx), ...rest, children: [
1418
1427
  renderAvatar(),
1419
1428
  /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", flexDirection: "column", flex: 1, overflow: "hidden" }, children: [
1420
1429
  /* @__PURE__ */ jsxs(
@@ -1435,7 +1444,15 @@ function AuthorInfo({
1435
1444
  }
1436
1445
  ),
1437
1446
  showBadge && downMd && /* @__PURE__ */ jsx(Box$1, { mt: 0.5, children: BadgeRender }),
1438
- showDID && !(responsive && downMd) && /* @__PURE__ */ jsx(DID, { style: { lineHeight: 1.5, minHeight: 20, maxWidth: 250 }, size: 14, did: user == null ? void 0 : user.did }),
1447
+ showDID && !(responsive && downMd) && /* @__PURE__ */ jsx(
1448
+ DID,
1449
+ {
1450
+ style: { lineHeight: 1.5, minHeight: 20, maxWidth: 250 },
1451
+ size: mergedFontSize,
1452
+ did: user == null ? void 0 : user.did,
1453
+ copyable
1454
+ }
1455
+ ),
1439
1456
  children && /* @__PURE__ */ jsx(Box$1, { children })
1440
1457
  ] })
1441
1458
  ] });
@@ -4783,7 +4800,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
4783
4800
  }
4784
4801
  const tablerSend = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", "data-iconify": "tabler", 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" }) });
4785
4802
  const tablerLetterCase = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", "data-iconify": "tabler", 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" }) });
4786
- const Editor = lazy(() => import("./editor-BFM9XLmp.mjs"));
4803
+ const Editor = lazy(() => import("./editor-CDMSG98q.mjs"));
4787
4804
  function LazyEditor(props) {
4788
4805
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
4789
4806
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { T, n, W, A, m, ad, B, F, K, J, L, ap, Y, X, $, Z, _, a1, w, C, x, y, E, a5, a6, ah, a8, O, Q, ac, D, ag, af, H, G, b, k, ae, M, P, ao, v, q, R, S, a9, aq, o, a2, a4, ai, al, ak, am, ar, N, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-mevW5K3n.mjs";
2
+ import { T, n, W, A, m, ad, B, F, K, J, L, ap, Y, X, $, Z, _, a1, w, C, x, y, E, a5, a6, ah, a8, O, Q, ac, D, ag, af, H, G, b, k, ae, M, P, ao, v, q, R, S, a9, aq, o, a2, a4, ai, al, ak, am, ar, N, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-DTVjWBDu.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -1221,8 +1221,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1221
1221
  newTitle = void 0,
1222
1222
  children,
1223
1223
  linkToProfile = true,
1224
+ onAvatarClick,
1224
1225
  avatarSize,
1225
1226
  fontSize,
1227
+ copyable,
1228
+ sx,
1226
1229
  ...rest
1227
1230
  }) {
1228
1231
  const theme = styles.useTheme();
@@ -1251,6 +1254,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1251
1254
  const canClick = linkToProfile && (user == null ? void 0 : user.did) && (user == null ? void 0 : user.did) !== window.blocklet.appId;
1252
1255
  const click = (e) => {
1253
1256
  var _a2, _b2;
1257
+ if (onAvatarClick) onAvatarClick();
1254
1258
  if (!canClick) {
1255
1259
  return;
1256
1260
  }
@@ -1284,7 +1288,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1284
1288
  {
1285
1289
  sx: {
1286
1290
  display: "flex",
1287
- cursor: canClick ? "pointer" : "auto",
1291
+ cursor: canClick ? "pointer" : "inherit",
1288
1292
  width: mergedAvatarSize,
1289
1293
  height: mergedAvatarSize
1290
1294
  },
@@ -1311,7 +1315,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1311
1315
  return /* @__PURE__ */ jsxRuntime.jsx(
1312
1316
  Box,
1313
1317
  {
1314
- sx: { display: "flex", cursor: "pointer", width: mergedAvatarSize, height: mergedAvatarSize },
1318
+ sx: {
1319
+ display: "flex",
1320
+ cursor: canClick ? "pointer" : "inherit",
1321
+ width: mergedAvatarSize,
1322
+ height: mergedAvatarSize
1323
+ },
1315
1324
  onClick: click,
1316
1325
  children: /* @__PURE__ */ jsxRuntime.jsx(
1317
1326
  Avatar,
@@ -1339,7 +1348,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1339
1348
  did: user == null ? void 0 : user.did
1340
1349
  }
1341
1350
  );
1342
- return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1, fontSize: mergedFontSize }, ...rest, children: [
1351
+ return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: mergeSx({ display: "flex", alignItems: "center", gap: 1, fontSize: mergedFontSize }, sx), ...rest, children: [
1343
1352
  renderAvatar(),
1344
1353
  /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "column", flex: 1, overflow: "hidden" }, children: [
1345
1354
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1360,7 +1369,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1360
1369
  }
1361
1370
  ),
1362
1371
  showBadge && downMd && /* @__PURE__ */ jsxRuntime.jsx(Box, { mt: 0.5, children: BadgeRender }),
1363
- showDID && !(responsive && downMd) && /* @__PURE__ */ jsxRuntime.jsx(DID, { style: { lineHeight: 1.5, minHeight: 20, maxWidth: 250 }, size: 14, did: user == null ? void 0 : user.did }),
1372
+ showDID && !(responsive && downMd) && /* @__PURE__ */ jsxRuntime.jsx(
1373
+ DID,
1374
+ {
1375
+ style: { lineHeight: 1.5, minHeight: 20, maxWidth: 250 },
1376
+ size: mergedFontSize,
1377
+ did: user == null ? void 0 : user.did,
1378
+ copyable
1379
+ }
1380
+ ),
1364
1381
  children && /* @__PURE__ */ jsxRuntime.jsx(Box, { children })
1365
1382
  ] })
1366
1383
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.0.126",
3
+ "version": "2.0.128",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -31,8 +31,8 @@
31
31
  "@arcblock/bridge": "^2.10.20",
32
32
  "@arcblock/react-hooks": "^2.10.20",
33
33
  "@arcblock/ws": "^1.18.128",
34
- "@blocklet/editor": "2.0.126",
35
- "@blocklet/labels": "2.0.126",
34
+ "@blocklet/editor": "2.0.128",
35
+ "@blocklet/labels": "2.0.128",
36
36
  "@blocklet/uploader": "^0.1.21",
37
37
  "@emotion/css": "^11.10.5",
38
38
  "@emotion/react": "^11.10.5",
@@ -100,5 +100,5 @@
100
100
  "resolutions": {
101
101
  "react": "^18.2.0"
102
102
  },
103
- "gitHead": "2ee48f989d352da10b654a5d1090fd81d5f7743c"
103
+ "gitHead": "a6aadf3d0dd491109586baf526a2437b9f5d9b2c"
104
104
  }