@blocklet/discuss-kit-ux 1.5.197 → 1.5.198

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,3 +10,4 @@ export declare const getPreference: (key: string) => any;
10
10
  export declare const getBlockletMountPointInfo: (name: string) => any;
11
11
  export declare const blockletExists: (name: string) => boolean;
12
12
  export declare const inferDiscussKitApiPrefix: () => any;
13
+ export declare const getDraftSessionKeyPrefix: () => 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 { 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-fe7740b3.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-bd354394.mjs";
8
8
  import "@blocklet/labels";
9
9
  import "@mui/material/styles";
10
10
  import "@mui/material/Box";
@@ -181,11 +181,15 @@ const inferDiscussKitApiPrefix = () => {
181
181
  const service = getBlockletMountPointInfo("did-comments");
182
182
  return service ? joinUrl(service.mountPoint, "/") : "/";
183
183
  };
184
+ const getDraftSessionKeyPrefix = () => {
185
+ return "comment-draft-";
186
+ };
184
187
  const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
185
188
  __proto__: null,
186
189
  blockletExists,
187
190
  copy,
188
191
  getBlockletMountPointInfo,
192
+ getDraftSessionKeyPrefix,
189
193
  getLastItem,
190
194
  getPreference,
191
195
  getResizedAvatar,
@@ -413,7 +417,7 @@ const Input = ({
413
417
  ...rest
414
418
  }) => {
415
419
  var _a2;
416
- const sessionKey = draftKey ? `comment-draft-${draftKey}` : "";
420
+ const sessionKey = draftKey ? `${getDraftSessionKeyPrefix()}${draftKey}` : "";
417
421
  const [content, setContent] = useState(null);
418
422
  const [error, setError] = useState("");
419
423
  const [loading, setLoading] = useState(false);
@@ -431,6 +435,7 @@ const Input = ({
431
435
  }
432
436
  } else {
433
437
  sessionStorage.removeItem(sessionKey);
438
+ sessionStorage.removeItem(`${sessionKey}:title`);
434
439
  }
435
440
  };
436
441
  const handleChange = async (state, editor) => {
@@ -4340,7 +4345,7 @@ function Pagination({ page, size = 20, total, onChange, routerMode = true, ...re
4340
4345
  }
4341
4346
  );
4342
4347
  }
4343
- const Editor = lazy(() => import("./editor-42c7855a.mjs"));
4348
+ const Editor = lazy(() => import("./editor-81317fe7.mjs"));
4344
4349
  function LazyEditor(props) {
4345
4350
  const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
4346
4351
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { K, j, N, A, h, a6, B, z, y, E, Q, O, T, W, o, C, q, v, x, _, $, aa, a1, H, J, D, a9, a8, G, c, b, a7, M, P, ah, n, m, a5, R, S, a2, k, X, Z, ab, ae, ad, af, ai, F, aj, l, p, r, t, d, a3, L, e, U, w, a0, a4, u, ag, ak, Y, ac, f } from "./index-fe7740b3.mjs";
2
+ import { K, j, N, A, h, a6, B, z, y, E, Q, O, T, W, o, C, q, v, x, _, $, aa, a1, H, J, D, a9, a8, G, c, b, a7, M, P, ah, n, m, a5, R, S, a2, k, X, Z, ab, ae, ad, af, ai, F, aj, l, p, r, t, d, a3, L, e, U, w, a0, a4, u, ag, ak, Y, ac, f } from "./index-bd354394.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -125,11 +125,15 @@ var __publicField = (obj, key, value) => {
125
125
  const service = getBlockletMountPointInfo("did-comments");
126
126
  return service ? joinUrl(service.mountPoint, "/") : "/";
127
127
  };
128
+ const getDraftSessionKeyPrefix = () => {
129
+ return "comment-draft-";
130
+ };
128
131
  const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
129
132
  __proto__: null,
130
133
  blockletExists,
131
134
  copy,
132
135
  getBlockletMountPointInfo,
136
+ getDraftSessionKeyPrefix,
133
137
  getLastItem,
134
138
  getPreference,
135
139
  getResizedAvatar,
@@ -357,7 +361,7 @@ var __publicField = (obj, key, value) => {
357
361
  ...rest
358
362
  }) => {
359
363
  var _a2;
360
- const sessionKey = draftKey ? `comment-draft-${draftKey}` : "";
364
+ const sessionKey = draftKey ? `${getDraftSessionKeyPrefix()}${draftKey}` : "";
361
365
  const [content, setContent] = react.useState(null);
362
366
  const [error, setError] = react.useState("");
363
367
  const [loading, setLoading] = react.useState(false);
@@ -375,6 +379,7 @@ var __publicField = (obj, key, value) => {
375
379
  }
376
380
  } else {
377
381
  sessionStorage.removeItem(sessionKey);
382
+ sessionStorage.removeItem(`${sessionKey}:title`);
378
383
  }
379
384
  };
380
385
  const handleChange = async (state, editor2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.5.197",
3
+ "version": "1.5.198",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@arcblock/ws": "^1.18.102",
32
- "@blocklet/editor": "1.5.197",
33
- "@blocklet/labels": "1.5.197",
32
+ "@blocklet/editor": "1.5.198",
33
+ "@blocklet/labels": "1.5.198",
34
34
  "@blocklet/uploader": "^0.0.50",
35
35
  "@emotion/css": "^11.10.5",
36
36
  "@emotion/react": "^11.10.5",
@@ -92,5 +92,5 @@
92
92
  "resolutions": {
93
93
  "react": "^18.2.0"
94
94
  },
95
- "gitHead": "4045ed3ea5d79bb9f77673ee938404bd94d62d4b"
95
+ "gitHead": "fd96c8a8e6ca9b77686120125779a440573b56ff"
96
96
  }