@blocklet/discuss-kit-ux 2.1.237 → 2.1.239

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.
@@ -11,7 +11,6 @@ export declare function tryParseJSONObject(str: string): boolean;
11
11
  export declare const getPreference: (key: string) => any;
12
12
  export declare const getBlockletMountPointInfo: (name: string) => ComponentMountPoint | undefined;
13
13
  export declare const blockletExists: (name: string) => boolean;
14
- export declare const getDraftSessionKeyPrefix: () => string;
15
14
  export declare const getExcerptFromLexicalContent: (content: any, size?: number) => string;
16
15
  export declare const mergeSx: (initial: SystemStyleObject<Theme>, sx?: SxProps<Theme>) => any[];
17
16
  export declare const discussKitMountPoint: string | undefined;
@@ -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 { lazyRetry } from "@arcblock/ux/lib/Util";
7
- import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-DtjGjX1D.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-BF_9jmZU.mjs";
8
8
  const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -308,9 +308,6 @@ const blockletExists = (name) => {
308
308
  const info = getBlockletMountPointInfo(name);
309
309
  return (info == null ? void 0 : info.status) === "running";
310
310
  };
311
- const getDraftSessionKeyPrefix = () => {
312
- return "comment-draft-";
313
- };
314
311
  function lexicalRootToText(data) {
315
312
  let parsedRoot = data;
316
313
  if (typeof data === "string") {
@@ -382,7 +379,6 @@ const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
382
379
  discussKitUploadsUrl,
383
380
  getBlockletMountPointInfo,
384
381
  getDiscussKitClientId,
385
- getDraftSessionKeyPrefix,
386
382
  getExcerptFromLexicalContent,
387
383
  getLastItem,
388
384
  getPaymentKitMountPoint,
@@ -590,7 +586,7 @@ const Input = ({
590
586
  ...rest
591
587
  }) => {
592
588
  var _a2;
593
- const sessionKey = draftKey ? `${getDraftSessionKeyPrefix()}${draftKey}` : "";
589
+ const sessionKey = draftKey || "";
594
590
  const [content, setContent] = useState(null);
595
591
  const [error, setError] = useState("");
596
592
  const [loading, setLoading] = useState(false);
@@ -1373,7 +1369,13 @@ function AuthorInfo({
1373
1369
  const { mobile } = useBrowser();
1374
1370
  const { chatInWallet } = useChatInWallet();
1375
1371
  const sm = size === "sm";
1376
- let mergedFontSize = fontSize ?? (sm ? 12 : 14);
1372
+ const getMergedFontSize = () => {
1373
+ if (fontSize) return fontSize;
1374
+ if (sm) return 12;
1375
+ if (showDID) return 14;
1376
+ return 16;
1377
+ };
1378
+ let mergedFontSize = getMergedFontSize();
1377
1379
  let mergedAvatarSize = avatarSize ?? (sm ? 40 : 48);
1378
1380
  if (responsive && downMd) {
1379
1381
  mergedFontSize = fontSize ?? 12;
@@ -1500,7 +1502,7 @@ function AuthorInfo({
1500
1502
  sx: { display: "flex", alignItems: "center", minHeight: 20, flexWrap: "wrap", lineHeight: 1.5 },
1501
1503
  lineHeight: 1,
1502
1504
  children: [
1503
- /* @__PURE__ */ jsx(Box$1, { component: "span", sx: { fontSize: showDID ? 12 : 16 }, children: newTitle || (user == null ? void 0 : user.fullName) }),
1505
+ /* @__PURE__ */ jsx(Box$1, { component: "span", children: newTitle || (user == null ? void 0 : user.fullName) }),
1504
1506
  createdAt && /* @__PURE__ */ jsxs(Fragment, { children: [
1505
1507
  /* @__PURE__ */ jsx(Box$1, { component: "span", display: "inline-block", mx: 0.5, children: "·" }),
1506
1508
  renderTime()
@@ -4925,7 +4927,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
4925
4927
  }
4926
4928
  const tablerSend = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", 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" }) });
4927
4929
  const tablerLetterCase = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", 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" }) });
4928
- const Editor = lazyRetry(() => import("./editor-ChmIyObO.mjs"));
4930
+ const Editor = lazyRetry(() => import("./editor-B6_jlrIh.mjs"));
4929
4931
  function LazyEditor(props) {
4930
4932
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
4931
4933
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { U, o, X, A, n, ae, B, G, L, K, N, aq, Z, Y, a0, _, $, a2, x, C, y, z, F, a6, a7, ai, a9, Q, T, ad, D, ah, ag, J, H, b, m, af, M, P, aB, ap, w, v, R, S, aa, ar, aC, q, a3, a5, aj, am, al, az, as, O, an, at, aw, ax, l, ay, h, p, r, k, av, t, j, ab, aA, W, c, a1, E, a8, ac, e, u, ao, d, au, a4, ak, f } from "./index-DtjGjX1D.mjs";
2
+ import { U, o, X, A, n, ae, B, G, L, K, N, aq, Z, Y, a0, _, $, a2, x, C, y, z, F, a6, a7, ai, a9, Q, T, ad, D, ah, ag, J, H, b, m, af, M, P, aB, ap, w, v, R, S, aa, ar, aC, q, a3, a5, aj, am, al, az, as, O, an, at, aw, ax, l, ay, h, p, r, k, av, t, j, ab, aA, W, c, a1, E, a8, ac, e, u, ao, d, au, a4, ak, f } from "./index-BF_9jmZU.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -232,9 +232,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
232
232
  const info = getBlockletMountPointInfo(name);
233
233
  return (info == null ? void 0 : info.status) === "running";
234
234
  };
235
- const getDraftSessionKeyPrefix = () => {
236
- return "comment-draft-";
237
- };
238
235
  function lexicalRootToText(data) {
239
236
  let parsedRoot = data;
240
237
  if (typeof data === "string") {
@@ -306,7 +303,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
306
303
  discussKitUploadsUrl,
307
304
  getBlockletMountPointInfo,
308
305
  getDiscussKitClientId,
309
- getDraftSessionKeyPrefix,
310
306
  getExcerptFromLexicalContent,
311
307
  getLastItem,
312
308
  getPaymentKitMountPoint,
@@ -514,7 +510,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
514
510
  ...rest
515
511
  }) => {
516
512
  var _a2;
517
- const sessionKey = draftKey ? `${getDraftSessionKeyPrefix()}${draftKey}` : "";
513
+ const sessionKey = draftKey || "";
518
514
  const [content, setContent] = react.useState(null);
519
515
  const [error, setError] = react.useState("");
520
516
  const [loading, setLoading] = react.useState(false);
@@ -1297,7 +1293,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1297
1293
  const { mobile } = reactHooks.useBrowser();
1298
1294
  const { chatInWallet } = useChatInWallet();
1299
1295
  const sm = size === "sm";
1300
- let mergedFontSize = fontSize ?? (sm ? 12 : 14);
1296
+ const getMergedFontSize = () => {
1297
+ if (fontSize) return fontSize;
1298
+ if (sm) return 12;
1299
+ if (showDID) return 14;
1300
+ return 16;
1301
+ };
1302
+ let mergedFontSize = getMergedFontSize();
1301
1303
  let mergedAvatarSize = avatarSize ?? (sm ? 40 : 48);
1302
1304
  if (responsive && downMd) {
1303
1305
  mergedFontSize = fontSize ?? 12;
@@ -1424,7 +1426,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1424
1426
  sx: { display: "flex", alignItems: "center", minHeight: 20, flexWrap: "wrap", lineHeight: 1.5 },
1425
1427
  lineHeight: 1,
1426
1428
  children: [
1427
- /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontSize: showDID ? 12 : 16 }, children: newTitle || (user == null ? void 0 : user.fullName) }),
1429
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", children: newTitle || (user == null ? void 0 : user.fullName) }),
1428
1430
  createdAt && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1429
1431
  /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", display: "inline-block", mx: 0.5, children: "·" }),
1430
1432
  renderTime()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.1.237",
3
+ "version": "2.1.239",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -45,8 +45,8 @@
45
45
  "ufo": "^1.5.4",
46
46
  "unstated-next": "^1.1.0",
47
47
  "url-join": "^4.0.1",
48
- "@blocklet/editor": "^2.1.237",
49
- "@blocklet/labels": "^2.1.237"
48
+ "@blocklet/editor": "^2.1.239",
49
+ "@blocklet/labels": "^2.1.239"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@arcblock/did-connect": "^2.10.36",