@blocklet/discuss-kit-ux 2.3.74 → 2.3.76

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.
@@ -0,0 +1,8 @@
1
+ export declare const blockletMountPointsByDid: {
2
+ [k: string]: ComponentMountPoint;
3
+ };
4
+ export declare const isBlockletApp: (did: string) => boolean;
5
+ export declare const getUsername: (user: {
6
+ did: string;
7
+ fullName?: string;
8
+ } | null | undefined, fallback?: string) => string;
@@ -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-SsfvOU5P.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-Yx5s4qYH.mjs";
8
8
  const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -1389,6 +1389,16 @@ function ProfileCardTooltip({ user, children }) {
1389
1389
  }
1390
1390
  );
1391
1391
  }
1392
+ const blockletMountPoints = window.blocklet.componentMountPoints;
1393
+ const blockletMountPointsByDid = Object.fromEntries(blockletMountPoints.map((x) => [x.did, x]));
1394
+ const isBlockletApp = (did) => !!blockletMountPointsByDid[did];
1395
+ const getUsername = (user, fallback2) => {
1396
+ const username = (user == null ? void 0 : user.fullName) || fallback2;
1397
+ if (username) {
1398
+ return username;
1399
+ }
1400
+ return isBlockletApp((user == null ? void 0 : user.did) || "") ? "System" : "Unknown";
1401
+ };
1392
1402
  function AuthorInfo({
1393
1403
  user,
1394
1404
  createdAt,
@@ -1501,7 +1511,7 @@ function AuthorInfo({
1501
1511
  sx: { display: "flex", alignItems: "center", minHeight: 20, flexWrap: "wrap", lineHeight: 1.5 },
1502
1512
  lineHeight: 1,
1503
1513
  children: [
1504
- /* @__PURE__ */ jsx(Box$1, { component: "span", children: newTitle || (user == null ? void 0 : user.fullName) }),
1514
+ /* @__PURE__ */ jsx(Box$1, { component: "span", children: newTitle || getUsername(user) }),
1505
1515
  createdAt && /* @__PURE__ */ jsxs(Fragment, { children: [
1506
1516
  /* @__PURE__ */ jsx(Box$1, { component: "span", display: "inline-block", mx: 0.5, children: "·" }),
1507
1517
  renderTime()
@@ -4979,7 +4989,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
4979
4989
  }
4980
4990
  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" }) });
4981
4991
  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" }) });
4982
- const Editor = lazyRetry(() => import("./editor-dgp-b-aZ.mjs"));
4992
+ const Editor = lazyRetry(() => import("./editor-DhIp7DID.mjs"));
4983
4993
  function LazyEditor(props) {
4984
4994
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
4985
4995
  /* @__PURE__ */ jsx(Skeleton, {}),
@@ -12640,6 +12650,9 @@ export {
12640
12650
  ProfileCardTooltip as aF,
12641
12651
  IconButton as aG,
12642
12652
  IconButtonGroup as aH,
12653
+ blockletMountPointsByDid as aI,
12654
+ isBlockletApp as aJ,
12655
+ getUsername as aK,
12643
12656
  ConfirmProvider as aa,
12644
12657
  SecureLabelPicker as ab,
12645
12658
  useApiErrorHandler as ac,
package/dist/index.d.ts CHANGED
@@ -33,3 +33,4 @@ export { default as RelativeTime } from './components/shared/relative-time';
33
33
  export * from './components/paywall';
34
34
  export * from './components/profile-card';
35
35
  export * from './components/icon-button';
36
+ export * from './blocklets';
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { W, o, Y, A, n, af, B, G, N, L, O, ar, _, Z, a1, $, a0, a3, x, C, y, z, F, a7, a8, aj, aa, T, U, ae, D, ai, ah, K, H, J, aG, aH, b, m, ag, M, P, aC, aq, w, v, aE, aF, R, S, ab, as, aD, q, a4, a6, ak, an, am, aA, at, Q, ao, au, ax, ay, l, az, h, p, r, k, aw, t, j, ac, aB, X, c, a2, E, a9, ad, e, u, ap, d, av, a5, al, f } from "./index-SsfvOU5P.mjs";
2
+ import { W, o, Y, A, n, af, B, G, N, L, O, ar, _, Z, a1, $, a0, a3, x, C, y, z, F, a7, a8, aj, aa, T, U, ae, D, ai, ah, K, H, J, aG, aH, b, m, ag, M, P, aC, aq, w, v, aE, aF, R, S, ab, as, aD, q, a4, a6, ak, an, am, aI, aA, at, Q, ao, aK, au, aJ, ax, ay, l, az, h, p, r, k, aw, t, j, ac, aB, X, c, a2, E, a9, ad, e, u, ap, d, av, a5, al, f } from "./index-Yx5s4qYH.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
@@ -69,11 +69,14 @@ export {
69
69
  ak as UploaderContext,
70
70
  an as UploaderProvider,
71
71
  am as UploaderTrigger,
72
+ aI as blockletMountPointsByDid,
72
73
  aA as closeArcSphereDialog,
73
74
  at as create,
74
75
  Q as getBlogLink,
75
76
  ao as getUploadedImageUrl,
77
+ aK as getUsername,
76
78
  au as getWsClient,
79
+ aJ as isBlockletApp,
77
80
  ax as isInArcSphere,
78
81
  ay as isInArcSphereDialog,
79
82
  l as lexicalUtils,
package/dist/index.umd.js CHANGED
@@ -1311,6 +1311,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1311
1311
  }
1312
1312
  );
1313
1313
  }
1314
+ const blockletMountPoints = window.blocklet.componentMountPoints;
1315
+ const blockletMountPointsByDid = Object.fromEntries(blockletMountPoints.map((x) => [x.did, x]));
1316
+ const isBlockletApp = (did) => !!blockletMountPointsByDid[did];
1317
+ const getUsername = (user, fallback2) => {
1318
+ const username = (user == null ? void 0 : user.fullName) || fallback2;
1319
+ if (username) {
1320
+ return username;
1321
+ }
1322
+ return isBlockletApp((user == null ? void 0 : user.did) || "") ? "System" : "Unknown";
1323
+ };
1314
1324
  function AuthorInfo({
1315
1325
  user,
1316
1326
  createdAt,
@@ -1423,7 +1433,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1423
1433
  sx: { display: "flex", alignItems: "center", minHeight: 20, flexWrap: "wrap", lineHeight: 1.5 },
1424
1434
  lineHeight: 1,
1425
1435
  children: [
1426
- /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", children: newTitle || (user == null ? void 0 : user.fullName) }),
1436
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", children: newTitle || getUsername(user) }),
1427
1437
  createdAt && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1428
1438
  /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", display: "inline-block", mx: 0.5, children: "·" }),
1429
1439
  renderTime()
@@ -12613,11 +12623,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
12613
12623
  exports2.UploaderContext = UploaderContext;
12614
12624
  exports2.UploaderProvider = UploaderProvider;
12615
12625
  exports2.UploaderTrigger = UploaderTrigger;
12626
+ exports2.blockletMountPointsByDid = blockletMountPointsByDid;
12616
12627
  exports2.closeArcSphereDialog = closeArcSphereDialog;
12617
12628
  exports2.create = create;
12618
12629
  exports2.getBlogLink = getBlogLink;
12619
12630
  exports2.getUploadedImageUrl = getUploadedImageUrl;
12631
+ exports2.getUsername = getUsername;
12620
12632
  exports2.getWsClient = getWsClient;
12633
+ exports2.isBlockletApp = isBlockletApp;
12621
12634
  exports2.isInArcSphere = isInArcSphere$1;
12622
12635
  exports2.isInArcSphereDialog = isInArcSphereDialog;
12623
12636
  exports2.lexicalUtils = lexical;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.3.74",
3
+ "version": "2.3.76",
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.3.74",
49
- "@blocklet/labels": "^2.3.74"
48
+ "@blocklet/editor": "^2.3.76",
49
+ "@blocklet/labels": "^2.3.76"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@arcblock/did-connect": "^2.10.36",