@blocklet/discuss-kit-ux 2.0.102 → 2.0.104

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.
@@ -10,9 +10,10 @@ interface Props {
10
10
  showProfileCard?: boolean;
11
11
  showBadge?: boolean;
12
12
  showDID?: boolean;
13
- profileUse?: boolean;
14
13
  children?: React.ReactNode;
15
14
  linkToProfile?: boolean;
15
+ avatarSize?: number;
16
+ fontSize?: number;
16
17
  }
17
- export default function AuthorInfo({ user, createdAt, append, size, responsive, showProfileCard, showBadge, showDID, newTitle, profileUse, children, linkToProfile, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
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;
18
19
  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-yxNgFjvj.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-CVNI0jpe.mjs";
8
8
  const BlockletEditor = lazy(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -1299,9 +1299,10 @@ function AuthorInfo({
1299
1299
  showBadge = true,
1300
1300
  showDID = true,
1301
1301
  newTitle = void 0,
1302
- profileUse = false,
1303
1302
  children,
1304
1303
  linkToProfile = true,
1304
+ avatarSize,
1305
+ fontSize,
1305
1306
  ...rest
1306
1307
  }) {
1307
1308
  const theme = useTheme();
@@ -1311,11 +1312,11 @@ function AuthorInfo({
1311
1312
  const { mobile } = useBrowser();
1312
1313
  const { chatInWallet } = useChatInWallet();
1313
1314
  const sm = size === "sm";
1314
- let fontSize = sm ? 12 : 14;
1315
- let avatarSize = profileUse ? 24 : sm ? 40 : 48;
1315
+ let mergedFontSize = fontSize ?? (sm ? 12 : 14);
1316
+ let mergedAvatarSize = avatarSize ?? (sm ? 40 : 48);
1316
1317
  if (responsive && downMd) {
1317
- fontSize = 12;
1318
- avatarSize = 24;
1318
+ mergedFontSize = fontSize ?? 12;
1319
+ mergedAvatarSize = avatarSize ?? 24;
1319
1320
  }
1320
1321
  const renderTime = () => {
1321
1322
  if (!createdAt) {
@@ -1361,14 +1362,19 @@ function AuthorInfo({
1361
1362
  children: /* @__PURE__ */ jsx(
1362
1363
  Box$1,
1363
1364
  {
1364
- sx: { display: "flex", cursor: canClick ? "pointer" : "auto", width: avatarSize, height: avatarSize },
1365
+ sx: {
1366
+ display: "flex",
1367
+ cursor: canClick ? "pointer" : "auto",
1368
+ width: mergedAvatarSize,
1369
+ height: mergedAvatarSize
1370
+ },
1365
1371
  onClick: click,
1366
1372
  children: /* @__PURE__ */ jsx(
1367
1373
  Avatar,
1368
1374
  {
1369
1375
  did: user == null ? void 0 : user.did,
1370
1376
  src: user == null ? void 0 : user.avatar,
1371
- size: avatarSize,
1377
+ size: mergedAvatarSize,
1372
1378
  shape: "circle",
1373
1379
  variant: "circle",
1374
1380
  sx: {
@@ -1382,20 +1388,27 @@ function AuthorInfo({
1382
1388
  }
1383
1389
  );
1384
1390
  }
1385
- return /* @__PURE__ */ jsx(Box$1, { sx: { display: "flex", cursor: "pointer", width: avatarSize, height: avatarSize }, onClick: click, children: /* @__PURE__ */ jsx(
1386
- Avatar,
1391
+ return /* @__PURE__ */ jsx(
1392
+ Box$1,
1387
1393
  {
1388
- did: user == null ? void 0 : user.did,
1389
- src: user == null ? void 0 : user.avatar,
1390
- size: avatarSize,
1391
- shape: "circle",
1392
- variant: "circle",
1393
- sx: {
1394
- width: "100%",
1395
- height: "100%"
1396
- }
1394
+ sx: { display: "flex", cursor: "pointer", width: mergedAvatarSize, height: mergedAvatarSize },
1395
+ onClick: click,
1396
+ children: /* @__PURE__ */ jsx(
1397
+ Avatar,
1398
+ {
1399
+ did: user == null ? void 0 : user.did,
1400
+ src: user == null ? void 0 : user.avatar,
1401
+ size: mergedAvatarSize,
1402
+ shape: "circle",
1403
+ variant: "circle",
1404
+ sx: {
1405
+ width: "100%",
1406
+ height: "100%"
1407
+ }
1408
+ }
1409
+ )
1397
1410
  }
1398
- ) });
1411
+ );
1399
1412
  };
1400
1413
  const BadgeRender = /* @__PURE__ */ jsx(
1401
1414
  Badge,
@@ -1406,7 +1419,7 @@ function AuthorInfo({
1406
1419
  did: user == null ? void 0 : user.did
1407
1420
  }
1408
1421
  );
1409
- return /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", alignItems: "center", gap: 1, fontSize }, ...rest, children: [
1422
+ return /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", alignItems: "center", gap: 1, fontSize: mergedFontSize }, ...rest, children: [
1410
1423
  renderAvatar(),
1411
1424
  /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", flexDirection: "column", flex: 1, overflow: "hidden" }, children: [
1412
1425
  /* @__PURE__ */ jsxs(
@@ -4775,7 +4788,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
4775
4788
  }
4776
4789
  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" }) });
4777
4790
  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" }) });
4778
- const Editor = lazy(() => import("./editor-PHk-L9y2.mjs"));
4791
+ const Editor = lazy(() => import("./editor-CVKcoFe9.mjs"));
4779
4792
  function LazyEditor(props) {
4780
4793
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
4781
4794
  /* @__PURE__ */ jsx(Skeleton, {}),
@@ -4901,6 +4914,9 @@ function ShortcutPlugin({ callback }) {
4901
4914
  if (mobile.any || e.shiftKey) {
4902
4915
  return false;
4903
4916
  }
4917
+ if (document.getElementById("typeahead-menu")) {
4918
+ return false;
4919
+ }
4904
4920
  callback();
4905
4921
  e.preventDefault();
4906
4922
  return true;
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-yxNgFjvj.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-CVNI0jpe.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -1225,9 +1225,10 @@ var __publicField = (obj, key, value) => {
1225
1225
  showBadge = true,
1226
1226
  showDID = true,
1227
1227
  newTitle = void 0,
1228
- profileUse = false,
1229
1228
  children,
1230
1229
  linkToProfile = true,
1230
+ avatarSize,
1231
+ fontSize,
1231
1232
  ...rest
1232
1233
  }) {
1233
1234
  const theme = styles.useTheme();
@@ -1237,11 +1238,11 @@ var __publicField = (obj, key, value) => {
1237
1238
  const { mobile } = reactHooks.useBrowser();
1238
1239
  const { chatInWallet } = useChatInWallet();
1239
1240
  const sm = size === "sm";
1240
- let fontSize = sm ? 12 : 14;
1241
- let avatarSize = profileUse ? 24 : sm ? 40 : 48;
1241
+ let mergedFontSize = fontSize ?? (sm ? 12 : 14);
1242
+ let mergedAvatarSize = avatarSize ?? (sm ? 40 : 48);
1242
1243
  if (responsive && downMd) {
1243
- fontSize = 12;
1244
- avatarSize = 24;
1244
+ mergedFontSize = fontSize ?? 12;
1245
+ mergedAvatarSize = avatarSize ?? 24;
1245
1246
  }
1246
1247
  const renderTime = () => {
1247
1248
  if (!createdAt) {
@@ -1287,14 +1288,19 @@ var __publicField = (obj, key, value) => {
1287
1288
  children: /* @__PURE__ */ jsxRuntime.jsx(
1288
1289
  Box,
1289
1290
  {
1290
- sx: { display: "flex", cursor: canClick ? "pointer" : "auto", width: avatarSize, height: avatarSize },
1291
+ sx: {
1292
+ display: "flex",
1293
+ cursor: canClick ? "pointer" : "auto",
1294
+ width: mergedAvatarSize,
1295
+ height: mergedAvatarSize
1296
+ },
1291
1297
  onClick: click,
1292
1298
  children: /* @__PURE__ */ jsxRuntime.jsx(
1293
1299
  Avatar,
1294
1300
  {
1295
1301
  did: user == null ? void 0 : user.did,
1296
1302
  src: user == null ? void 0 : user.avatar,
1297
- size: avatarSize,
1303
+ size: mergedAvatarSize,
1298
1304
  shape: "circle",
1299
1305
  variant: "circle",
1300
1306
  sx: {
@@ -1308,20 +1314,27 @@ var __publicField = (obj, key, value) => {
1308
1314
  }
1309
1315
  );
1310
1316
  }
1311
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "flex", cursor: "pointer", width: avatarSize, height: avatarSize }, onClick: click, children: /* @__PURE__ */ jsxRuntime.jsx(
1312
- Avatar,
1317
+ return /* @__PURE__ */ jsxRuntime.jsx(
1318
+ Box,
1313
1319
  {
1314
- did: user == null ? void 0 : user.did,
1315
- src: user == null ? void 0 : user.avatar,
1316
- size: avatarSize,
1317
- shape: "circle",
1318
- variant: "circle",
1319
- sx: {
1320
- width: "100%",
1321
- height: "100%"
1322
- }
1320
+ sx: { display: "flex", cursor: "pointer", width: mergedAvatarSize, height: mergedAvatarSize },
1321
+ onClick: click,
1322
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1323
+ Avatar,
1324
+ {
1325
+ did: user == null ? void 0 : user.did,
1326
+ src: user == null ? void 0 : user.avatar,
1327
+ size: mergedAvatarSize,
1328
+ shape: "circle",
1329
+ variant: "circle",
1330
+ sx: {
1331
+ width: "100%",
1332
+ height: "100%"
1333
+ }
1334
+ }
1335
+ )
1323
1336
  }
1324
- ) });
1337
+ );
1325
1338
  };
1326
1339
  const BadgeRender = /* @__PURE__ */ jsxRuntime.jsx(
1327
1340
  Badge,
@@ -1332,7 +1345,7 @@ var __publicField = (obj, key, value) => {
1332
1345
  did: user == null ? void 0 : user.did
1333
1346
  }
1334
1347
  );
1335
- return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1, fontSize }, ...rest, children: [
1348
+ return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1, fontSize: mergedFontSize }, ...rest, children: [
1336
1349
  renderAvatar(),
1337
1350
  /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "column", flex: 1, overflow: "hidden" }, children: [
1338
1351
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4827,6 +4840,9 @@ var __publicField = (obj, key, value) => {
4827
4840
  if (mobile.any || e.shiftKey) {
4828
4841
  return false;
4829
4842
  }
4843
+ if (document.getElementById("typeahead-menu")) {
4844
+ return false;
4845
+ }
4830
4846
  callback();
4831
4847
  e.preventDefault();
4832
4848
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.0.102",
3
+ "version": "2.0.104",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -31,8 +31,8 @@
31
31
  "@arcblock/bridge": "^2.10.12",
32
32
  "@arcblock/react-hooks": "^2.10.12",
33
33
  "@arcblock/ws": "^1.18.128",
34
- "@blocklet/editor": "2.0.102",
35
- "@blocklet/labels": "2.0.102",
34
+ "@blocklet/editor": "2.0.104",
35
+ "@blocklet/labels": "2.0.104",
36
36
  "@blocklet/uploader": "^0.1.20",
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": "7917e72bfc0bfc2ff0163c7ec2dafae1124df9c2"
103
+ "gitHead": "106db21cf7e889946a1835da05e6ec17fe477d84"
104
104
  }