@blocklet/discuss-kit-ux 1.6.237 → 1.6.238

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.
@@ -6,6 +6,5 @@ interface BackProps {
6
6
  iconOnly?: boolean;
7
7
  sx?: SxProps;
8
8
  }
9
- export declare const PreviousLocationRecorder: () => null;
10
9
  export declare function Back({ url, fallbackUrl, iconOnly, sx, ...rest }: BackProps & ButtonProps): import("react/jsx-runtime").JSX.Element;
11
10
  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-CrcR6k_q.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-BriEoNhQ.mjs";
8
8
  const BlockletEditor = lazy(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -4588,28 +4588,15 @@ function Participants({ users, sx, ...rest }) {
4588
4588
  }
4589
4589
  ) }) });
4590
4590
  }
4591
- const KEY_PREVIOUS_LOCATION = "__previous_location__";
4592
- const getPreviousLocation = () => {
4593
- return sessionStorage.getItem(KEY_PREVIOUS_LOCATION);
4594
- };
4595
- const PreviousLocationRecorder = () => {
4596
- const location = useLocation();
4597
- const locationRef = useRef();
4598
- useEffect(() => {
4599
- if (locationRef.current) {
4600
- sessionStorage.setItem(KEY_PREVIOUS_LOCATION, locationRef.current);
4601
- }
4602
- locationRef.current = window.location.href;
4603
- }, [location]);
4604
- return null;
4605
- };
4606
4591
  function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
4607
4592
  const navigate = useNavigate();
4593
+ const location = useLocation();
4608
4594
  const mergedSx = [{}, ...Array.isArray(sx) ? sx : [sx]];
4609
4595
  const handleClick = () => {
4596
+ var _a2;
4610
4597
  if (url) {
4611
4598
  navigate(url, { replace: true });
4612
- } else if (getPreviousLocation()) {
4599
+ } else if ((_a2 = location.state) == null ? void 0 : _a2.from) {
4613
4600
  navigate(-1);
4614
4601
  } else {
4615
4602
  navigate(fallbackUrl || "/");
@@ -5550,7 +5537,7 @@ function Pagination({
5550
5537
  }
5551
5538
  );
5552
5539
  }
5553
- const Editor = lazy(() => import("./editor-BBrjb_5e.mjs"));
5540
+ const Editor = lazy(() => import("./editor-DKVcG8pE.mjs"));
5554
5541
  function LazyEditor(props) {
5555
5542
  const fallback = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
5556
5543
  /* @__PURE__ */ jsx(Skeleton, {}),
@@ -11771,24 +11758,23 @@ export {
11771
11758
  useApiErrorHandler as a9,
11772
11759
  useDefaultApiErrorHandler as aa,
11773
11760
  DefaultApiErrorHandler as ab,
11774
- PreviousLocationRecorder as ac,
11775
- Back as ad,
11776
- LazyEditor as ae,
11777
- EditorPreview as af,
11778
- DirtyPromptContainer as ag,
11779
- ConfirmNavigation as ah,
11780
- UploaderContext as ai,
11781
- useUploader as aj,
11782
- UploaderTrigger as ak,
11783
- UploaderProvider as al,
11784
- composeImageUrl as am,
11785
- usePointUpContext as an,
11786
- PointUpProvider as ao,
11787
- ButtonGroup as ap,
11788
- SegmentedControl as aq,
11789
- create as ar,
11790
- getWsClient as as,
11791
- useSubscription as at,
11761
+ Back as ac,
11762
+ LazyEditor as ad,
11763
+ EditorPreview as ae,
11764
+ DirtyPromptContainer as af,
11765
+ ConfirmNavigation as ag,
11766
+ UploaderContext as ah,
11767
+ useUploader as ai,
11768
+ UploaderTrigger as aj,
11769
+ UploaderProvider as ak,
11770
+ composeImageUrl as al,
11771
+ usePointUpContext as am,
11772
+ PointUpProvider as an,
11773
+ ButtonGroup as ao,
11774
+ SegmentedControl as ap,
11775
+ create as aq,
11776
+ getWsClient as ar,
11777
+ useSubscription as as,
11792
11778
  Input as b,
11793
11779
  useChanged as c,
11794
11780
  useSessionContext as d,
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { Q, m, U, A, k, ad, B, E, J, H, K, ap, X, W, _, Y, Z, a0, v, C, w, x, z, a4, a5, ah, a7, N, O, ab, D, ag, af, F, G, b, j, ae, M, P, ao, q, o, ac, R, S, a8, aq, n, a1, a3, ai, al, ak, am, ar, L, as, l, p, r, h, t, f, a9, T, c, $, y, a6, aa, u, an, d, at, a2, aj, e } from "./index-CrcR6k_q.mjs";
2
+ import { Q, m, U, A, k, ac, B, E, J, H, K, ao, X, W, _, Y, Z, a0, v, C, w, x, z, a4, a5, ag, a7, N, O, ab, D, af, ae, F, G, b, j, ad, M, P, an, q, o, R, S, a8, ap, n, a1, a3, ah, ak, aj, al, aq, L, ar, l, p, r, h, t, f, a9, T, c, $, y, a6, aa, u, am, d, as, a2, ai, e } from "./index-BriEoNhQ.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
@@ -14,13 +14,13 @@ export {
14
14
  U as AuthzProvider,
15
15
  A as Avatar,
16
16
  k as Avatars,
17
- ad as Back,
17
+ ac as Back,
18
18
  B as Badge,
19
19
  E as BinaryThumb,
20
20
  J as BlogCard,
21
21
  H as BlogList,
22
22
  K as BlogPermaLink,
23
- ap as ButtonGroup,
23
+ ao as ButtonGroup,
24
24
  X as Chat,
25
25
  W as ChatClient,
26
26
  _ as ChatHeaderAddon,
@@ -34,39 +34,38 @@ export {
34
34
  z as CommentsProvider,
35
35
  a4 as Confirm,
36
36
  a5 as ConfirmContext,
37
- ah as ConfirmNavigation,
37
+ ag as ConfirmNavigation,
38
38
  a7 as ConfirmProvider,
39
39
  N as CoverImage,
40
40
  O as CoverImageUpload,
41
41
  ab as DefaultApiErrorHandler,
42
42
  D as DefaultEditorConfigProvider,
43
- ag as DirtyPromptContainer,
44
- af as EditorPreview,
43
+ af as DirtyPromptContainer,
44
+ ae as EditorPreview,
45
45
  F as EmptyStatus,
46
46
  G as GithubReaction,
47
47
  b as Input,
48
48
  j as InternalThemeProvider,
49
- ae as LazyEditor,
49
+ ad as LazyEditor,
50
50
  M as Menu,
51
51
  P as Pagination,
52
- ao as PointUpProvider,
52
+ an as PointUpProvider,
53
53
  q as Post,
54
54
  o as PostContent,
55
- ac as PreviousLocationRecorder,
56
55
  R as RelativeTime,
57
56
  S as ScrollableEditorWrapper,
58
57
  a8 as SecureLabelPicker,
59
- aq as SegmentedControl,
58
+ ap as SegmentedControl,
60
59
  n as SystemUser,
61
60
  a1 as UnreadNotificationContext,
62
61
  a3 as UnreadNotificationProvider,
63
- ai as UploaderContext,
64
- al as UploaderProvider,
65
- ak as UploaderTrigger,
66
- am as composeImageUrl,
67
- ar as create,
62
+ ah as UploaderContext,
63
+ ak as UploaderProvider,
64
+ aj as UploaderTrigger,
65
+ al as composeImageUrl,
66
+ aq as create,
68
67
  L as getBlogLink,
69
- as as getWsClient,
68
+ ar as getWsClient,
70
69
  l as lexicalUtils,
71
70
  p as preferences,
72
71
  r as routes,
@@ -81,10 +80,10 @@ export {
81
80
  a6 as useConfirm,
82
81
  aa as useDefaultApiErrorHandler,
83
82
  u as useNow,
84
- an as usePointUpContext,
83
+ am as usePointUpContext,
85
84
  d as useSessionContext,
86
- at as useSubscription,
85
+ as as useSubscription,
87
86
  a2 as useUnreadNotification,
88
- aj as useUploader,
87
+ ai as useUploader,
89
88
  e as utils
90
89
  };
package/dist/index.umd.js CHANGED
@@ -4520,28 +4520,15 @@ var __publicField = (obj, key, value) => {
4520
4520
  }
4521
4521
  ) }) });
4522
4522
  }
4523
- const KEY_PREVIOUS_LOCATION = "__previous_location__";
4524
- const getPreviousLocation = () => {
4525
- return sessionStorage.getItem(KEY_PREVIOUS_LOCATION);
4526
- };
4527
- const PreviousLocationRecorder = () => {
4528
- const location = reactRouterDom.useLocation();
4529
- const locationRef = react.useRef();
4530
- react.useEffect(() => {
4531
- if (locationRef.current) {
4532
- sessionStorage.setItem(KEY_PREVIOUS_LOCATION, locationRef.current);
4533
- }
4534
- locationRef.current = window.location.href;
4535
- }, [location]);
4536
- return null;
4537
- };
4538
4523
  function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
4539
4524
  const navigate = reactRouterDom.useNavigate();
4525
+ const location = reactRouterDom.useLocation();
4540
4526
  const mergedSx = [{}, ...Array.isArray(sx) ? sx : [sx]];
4541
4527
  const handleClick = () => {
4528
+ var _a2;
4542
4529
  if (url) {
4543
4530
  navigate(url, { replace: true });
4544
- } else if (getPreviousLocation()) {
4531
+ } else if ((_a2 = location.state) == null ? void 0 : _a2.from) {
4545
4532
  navigate(-1);
4546
4533
  } else {
4547
4534
  navigate(fallbackUrl || "/");
@@ -11735,7 +11722,6 @@ var __publicField = (obj, key, value) => {
11735
11722
  exports2.PointUpProvider = PointUpProvider;
11736
11723
  exports2.Post = PostComponent;
11737
11724
  exports2.PostContent = PostContent;
11738
- exports2.PreviousLocationRecorder = PreviousLocationRecorder;
11739
11725
  exports2.RelativeTime = RelativeTime;
11740
11726
  exports2.ScrollableEditorWrapper = ScrollableEditorWrapper;
11741
11727
  exports2.SecureLabelPicker = SecureLabelPicker;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.6.237",
3
+ "version": "1.6.238",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -30,8 +30,8 @@
30
30
  "dependencies": {
31
31
  "@arcblock/bridge": "^2.9.77",
32
32
  "@arcblock/ws": "^1.18.116",
33
- "@blocklet/editor": "1.6.237",
34
- "@blocklet/labels": "1.6.237",
33
+ "@blocklet/editor": "1.6.238",
34
+ "@blocklet/labels": "1.6.238",
35
35
  "@blocklet/uploader": "^0.1.2",
36
36
  "@emotion/css": "^11.10.5",
37
37
  "@emotion/react": "^11.10.5",
@@ -95,5 +95,5 @@
95
95
  "resolutions": {
96
96
  "react": "^18.2.0"
97
97
  },
98
- "gitHead": "252ca705b171a1406071a46b016a0583799b63ee"
98
+ "gitHead": "c88462b241f45a2d94470c0314b11a265f9ad369"
99
99
  }