@blocklet/discuss-kit-ux 2.1.114 → 2.1.116

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.
@@ -8,6 +8,7 @@ interface Props {
8
8
  enableHeadingsIdPlugin?: boolean;
9
9
  onReady?: () => void;
10
10
  children?: React.ReactNode;
11
+ editorPrepend?: React.ReactNode;
11
12
  }
12
- export default function PostContent({ content, editing, onExitEditing, onSubmit, autoCollapse, enableHeadingsIdPlugin, onReady, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export default function PostContent({ content, editing, onExitEditing, onSubmit, autoCollapse, enableHeadingsIdPlugin, onReady, children, editorPrepend, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
13
14
  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 { 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-BoZpHEX0.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-DgUFdS6K.mjs";
8
8
  const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -1408,7 +1408,7 @@ function AuthorInfo({
1408
1408
  );
1409
1409
  return /* @__PURE__ */ jsxs(Box$1, { sx: mergeSx({ display: "flex", alignItems: "center", gap: 1, fontSize: mergedFontSize }, sx), ...rest, children: [
1410
1410
  renderAvatar(),
1411
- /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", flexDirection: "column", flex: 1, overflow: "hidden" }, children: [
1411
+ /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", flexDirection: "column", flex: 1, overflowX: "hidden" }, children: [
1412
1412
  /* @__PURE__ */ jsxs(
1413
1413
  Box$1,
1414
1414
  {
@@ -1547,6 +1547,7 @@ function PostContent({
1547
1547
  enableHeadingsIdPlugin,
1548
1548
  onReady,
1549
1549
  children,
1550
+ editorPrepend,
1550
1551
  ...rest
1551
1552
  }) {
1552
1553
  if (editing && onSubmit) {
@@ -1568,6 +1569,7 @@ function PostContent({
1568
1569
  editorState: inferInitialEditorState(content),
1569
1570
  enableHeadingsIdPlugin,
1570
1571
  onReady,
1572
+ prepend: editorPrepend,
1571
1573
  children: [
1572
1574
  /* @__PURE__ */ jsx(ImagePathFixerPlugin, {}),
1573
1575
  /* @__PURE__ */ jsx(VideoPathFixerPlugin, {}),
@@ -1584,6 +1586,7 @@ function PostContent({
1584
1586
  editorState: inferInitialEditorState(content),
1585
1587
  enableHeadingsIdPlugin,
1586
1588
  onReady,
1589
+ prepend: editorPrepend,
1587
1590
  children: [
1588
1591
  /* @__PURE__ */ jsx(ImagePathFixerPlugin, {}),
1589
1592
  /* @__PURE__ */ jsx(CheckboxPlugin, { send: onSubmit }),
@@ -1794,7 +1797,7 @@ function PostComponent({
1794
1797
  onExitEditing: () => setEditing(false),
1795
1798
  onSubmit: (content) => onContentUpdate(post, content),
1796
1799
  autoCollapse,
1797
- children: editorPlugins
1800
+ editorPrepend: editorPlugins
1798
1801
  },
1799
1802
  editing ? "comment-content" : post.synced || 0
1800
1803
  ) }),
@@ -2612,7 +2615,13 @@ function CommentsProvider({
2612
2615
  }) {
2613
2616
  var _a2;
2614
2617
  const [state, setState] = useSetState(getInitialState(order ? { order } : {}));
2615
- const comments = useMemo(() => state.comments.filter((item) => !item.pinnedAt), [state.comments]);
2618
+ const comments = useMemo(
2619
+ () => uniqAndSort$1(
2620
+ state.comments.filter((item) => !item.pinnedAt),
2621
+ state.order
2622
+ ),
2623
+ [state.comments, state.order]
2624
+ );
2616
2625
  const pinned = useMemo(() => state.comments.filter((item) => item.pinnedAt), [state.comments]);
2617
2626
  const containerHeight = (_a2 = useSize(containerRef)) == null ? void 0 : _a2.height;
2618
2627
  const commentsKeyById = useMemo(() => {
@@ -4784,7 +4793,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
4784
4793
  }
4785
4794
  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" }) });
4786
4795
  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" }) });
4787
- const Editor = lazyRetry(() => import("./editor-Dug_xpu_.mjs"));
4796
+ const Editor = lazyRetry(() => import("./editor-BFpgyAD_.mjs"));
4788
4797
  function LazyEditor(props) {
4789
4798
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
4790
4799
  /* @__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, ar, N, am, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-BoZpHEX0.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, ar, N, am, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-DgUFdS6K.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -1331,7 +1331,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1331
1331
  );
1332
1332
  return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: mergeSx({ display: "flex", alignItems: "center", gap: 1, fontSize: mergedFontSize }, sx), ...rest, children: [
1333
1333
  renderAvatar(),
1334
- /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "column", flex: 1, overflow: "hidden" }, children: [
1334
+ /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", flexDirection: "column", flex: 1, overflowX: "hidden" }, children: [
1335
1335
  /* @__PURE__ */ jsxRuntime.jsxs(
1336
1336
  Box,
1337
1337
  {
@@ -1470,6 +1470,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1470
1470
  enableHeadingsIdPlugin,
1471
1471
  onReady,
1472
1472
  children,
1473
+ editorPrepend,
1473
1474
  ...rest
1474
1475
  }) {
1475
1476
  if (editing && onSubmit) {
@@ -1491,6 +1492,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1491
1492
  editorState: inferInitialEditorState(content),
1492
1493
  enableHeadingsIdPlugin,
1493
1494
  onReady,
1495
+ prepend: editorPrepend,
1494
1496
  children: [
1495
1497
  /* @__PURE__ */ jsxRuntime.jsx(ImagePathFixerPlugin, {}),
1496
1498
  /* @__PURE__ */ jsxRuntime.jsx(VideoPathFixerPlugin, {}),
@@ -1507,6 +1509,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1507
1509
  editorState: inferInitialEditorState(content),
1508
1510
  enableHeadingsIdPlugin,
1509
1511
  onReady,
1512
+ prepend: editorPrepend,
1510
1513
  children: [
1511
1514
  /* @__PURE__ */ jsxRuntime.jsx(ImagePathFixerPlugin, {}),
1512
1515
  /* @__PURE__ */ jsxRuntime.jsx(CheckboxPlugin, { send: onSubmit }),
@@ -1717,7 +1720,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1717
1720
  onExitEditing: () => setEditing(false),
1718
1721
  onSubmit: (content) => onContentUpdate(post, content),
1719
1722
  autoCollapse,
1720
- children: editorPlugins
1723
+ editorPrepend: editorPlugins
1721
1724
  },
1722
1725
  editing ? "comment-content" : post.synced || 0
1723
1726
  ) }),
@@ -2535,7 +2538,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2535
2538
  }) {
2536
2539
  var _a2;
2537
2540
  const [state, setState] = ahooks.useSetState(getInitialState(order ? { order } : {}));
2538
- const comments = react.useMemo(() => state.comments.filter((item) => !item.pinnedAt), [state.comments]);
2541
+ const comments = react.useMemo(
2542
+ () => uniqAndSort$1(
2543
+ state.comments.filter((item) => !item.pinnedAt),
2544
+ state.order
2545
+ ),
2546
+ [state.comments, state.order]
2547
+ );
2539
2548
  const pinned = react.useMemo(() => state.comments.filter((item) => item.pinnedAt), [state.comments]);
2540
2549
  const containerHeight = (_a2 = ahooks.useSize(containerRef)) == null ? void 0 : _a2.height;
2541
2550
  const commentsKeyById = react.useMemo(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.1.114",
3
+ "version": "2.1.116",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -44,8 +44,8 @@
44
44
  "ufo": "^1.5.4",
45
45
  "unstated-next": "^1.1.0",
46
46
  "url-join": "^4.0.1",
47
- "@blocklet/editor": "^2.1.114",
48
- "@blocklet/labels": "^2.1.114"
47
+ "@blocklet/editor": "^2.1.116",
48
+ "@blocklet/labels": "^2.1.116"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@arcblock/did-connect": "^2.10.36",