@blocklet/discuss-kit-ux 1.6.236 → 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-jd2U4xWv.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,
@@ -213,7 +213,8 @@ const themeOverrides = {
213
213
  };
214
214
  function InternalThemeProvider({ children }) {
215
215
  const theme = useTheme();
216
- const merged = create$1(theme, {
216
+ const merged = create$1({
217
+ ...theme,
217
218
  typography,
218
219
  ...themeOverrides
219
220
  });
@@ -4587,28 +4588,15 @@ function Participants({ users, sx, ...rest }) {
4587
4588
  }
4588
4589
  ) }) });
4589
4590
  }
4590
- const KEY_PREVIOUS_LOCATION = "__previous_location__";
4591
- const getPreviousLocation = () => {
4592
- return sessionStorage.getItem(KEY_PREVIOUS_LOCATION);
4593
- };
4594
- const PreviousLocationRecorder = () => {
4595
- const location = useLocation();
4596
- const locationRef = useRef();
4597
- useEffect(() => {
4598
- if (locationRef.current) {
4599
- sessionStorage.setItem(KEY_PREVIOUS_LOCATION, locationRef.current);
4600
- }
4601
- locationRef.current = window.location.href;
4602
- }, [location]);
4603
- return null;
4604
- };
4605
4591
  function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
4606
4592
  const navigate = useNavigate();
4593
+ const location = useLocation();
4607
4594
  const mergedSx = [{}, ...Array.isArray(sx) ? sx : [sx]];
4608
4595
  const handleClick = () => {
4596
+ var _a2;
4609
4597
  if (url) {
4610
4598
  navigate(url, { replace: true });
4611
- } else if (getPreviousLocation()) {
4599
+ } else if ((_a2 = location.state) == null ? void 0 : _a2.from) {
4612
4600
  navigate(-1);
4613
4601
  } else {
4614
4602
  navigate(fallbackUrl || "/");
@@ -5549,7 +5537,7 @@ function Pagination({
5549
5537
  }
5550
5538
  );
5551
5539
  }
5552
- const Editor = lazy(() => import("./editor-uebxw0_k.mjs"));
5540
+ const Editor = lazy(() => import("./editor-DKVcG8pE.mjs"));
5553
5541
  function LazyEditor(props) {
5554
5542
  const fallback = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
5555
5543
  /* @__PURE__ */ jsx(Skeleton, {}),
@@ -11770,24 +11758,23 @@ export {
11770
11758
  useApiErrorHandler as a9,
11771
11759
  useDefaultApiErrorHandler as aa,
11772
11760
  DefaultApiErrorHandler as ab,
11773
- PreviousLocationRecorder as ac,
11774
- Back as ad,
11775
- LazyEditor as ae,
11776
- EditorPreview as af,
11777
- DirtyPromptContainer as ag,
11778
- ConfirmNavigation as ah,
11779
- UploaderContext as ai,
11780
- useUploader as aj,
11781
- UploaderTrigger as ak,
11782
- UploaderProvider as al,
11783
- composeImageUrl as am,
11784
- usePointUpContext as an,
11785
- PointUpProvider as ao,
11786
- ButtonGroup as ap,
11787
- SegmentedControl as aq,
11788
- create as ar,
11789
- getWsClient as as,
11790
- 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,
11791
11778
  Input as b,
11792
11779
  useChanged as c,
11793
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-jd2U4xWv.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
@@ -145,7 +145,8 @@ var __publicField = (obj, key, value) => {
145
145
  };
146
146
  function InternalThemeProvider({ children }) {
147
147
  const theme = styles.useTheme();
148
- const merged = Theme.create(theme, {
148
+ const merged = Theme.create({
149
+ ...theme,
149
150
  typography,
150
151
  ...themeOverrides
151
152
  });
@@ -4519,28 +4520,15 @@ var __publicField = (obj, key, value) => {
4519
4520
  }
4520
4521
  ) }) });
4521
4522
  }
4522
- const KEY_PREVIOUS_LOCATION = "__previous_location__";
4523
- const getPreviousLocation = () => {
4524
- return sessionStorage.getItem(KEY_PREVIOUS_LOCATION);
4525
- };
4526
- const PreviousLocationRecorder = () => {
4527
- const location = reactRouterDom.useLocation();
4528
- const locationRef = react.useRef();
4529
- react.useEffect(() => {
4530
- if (locationRef.current) {
4531
- sessionStorage.setItem(KEY_PREVIOUS_LOCATION, locationRef.current);
4532
- }
4533
- locationRef.current = window.location.href;
4534
- }, [location]);
4535
- return null;
4536
- };
4537
4523
  function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
4538
4524
  const navigate = reactRouterDom.useNavigate();
4525
+ const location = reactRouterDom.useLocation();
4539
4526
  const mergedSx = [{}, ...Array.isArray(sx) ? sx : [sx]];
4540
4527
  const handleClick = () => {
4528
+ var _a2;
4541
4529
  if (url) {
4542
4530
  navigate(url, { replace: true });
4543
- } else if (getPreviousLocation()) {
4531
+ } else if ((_a2 = location.state) == null ? void 0 : _a2.from) {
4544
4532
  navigate(-1);
4545
4533
  } else {
4546
4534
  navigate(fallbackUrl || "/");
@@ -11734,7 +11722,6 @@ var __publicField = (obj, key, value) => {
11734
11722
  exports2.PointUpProvider = PointUpProvider;
11735
11723
  exports2.Post = PostComponent;
11736
11724
  exports2.PostContent = PostContent;
11737
- exports2.PreviousLocationRecorder = PreviousLocationRecorder;
11738
11725
  exports2.RelativeTime = RelativeTime;
11739
11726
  exports2.ScrollableEditorWrapper = ScrollableEditorWrapper;
11740
11727
  exports2.SecureLabelPicker = SecureLabelPicker;
@@ -33,7 +33,7 @@ declare const preferences: {
33
33
  blogTemplate: "standard" | "corp";
34
34
  primaryColor: string;
35
35
  secondaryColor: string;
36
- subscriptionPublicType: "slice" | "blur";
36
+ subscriptionPublicType: "blur" | "slice";
37
37
  enableAssignmentDiscussion: boolean;
38
38
  enableAssignmentBlog: boolean;
39
39
  enableAssignmentDoc: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.6.236",
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.236",
34
- "@blocklet/labels": "1.6.236",
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": "f3efd9c52ddb748b932ce475cc17e444c03a8a57"
98
+ "gitHead": "c88462b241f45a2d94470c0314b11a265f9ad369"
99
99
  }