@blocklet/discuss-kit-ux 2.1.200 → 2.1.201
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.
- package/dist/components/hooks/index.d.ts +1 -0
- package/dist/components/hooks/use-event-callback.d.ts +1 -0
- package/dist/{editor-MevHKU1_.mjs → editor-D5FK3BKr.mjs} +1 -1
- package/dist/{index-D051_TWT.mjs → index-B7y6yLro.mjs} +84 -70
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +70 -69
- package/dist/index.umd.js +14 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useEventCallback<I extends unknown[], O>(fn: (...args: I) => O): (...args: I) => O;
|
|
@@ -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-
|
|
7
|
+
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-B7y6yLro.mjs";
|
|
8
8
|
const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
|
|
9
9
|
const Root = styled(Box)`
|
|
10
10
|
.be-editable,
|
|
@@ -6,7 +6,7 @@ import { Labels2, LabelPicker } from "@blocklet/labels";
|
|
|
6
6
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
7
7
|
import { useTheme, ThemeProvider, styled as styled$2 } from "@mui/material/styles";
|
|
8
8
|
import { create as create$1, styled } from "@arcblock/ux/lib/Theme";
|
|
9
|
-
import { useEffect, useRef, useState, createElement, useContext, useMemo, useCallback, isValidElement, Suspense, createContext, Fragment as Fragment$1, forwardRef, useImperativeHandle } from "react";
|
|
9
|
+
import { useEffect, useRef, useState, createElement, useContext, useMemo, useLayoutEffect, useCallback, isValidElement, Suspense, createContext, Fragment as Fragment$1, forwardRef, useImperativeHandle } from "react";
|
|
10
10
|
import { Box, useTheme as useTheme$1, useMediaQuery, styled as styled$1, Button as Button$1, Stack as Stack$1, Tooltip as Tooltip$1, Chip as Chip$1, alpha, ClickAwayListener, Dialog as Dialog$1, DialogTitle, DialogContent, DialogActions, DialogContentText, Divider, Skeleton, IconButton as IconButton$2, InputBase, tooltipClasses as tooltipClasses$1, CircularProgress, Backdrop, Autocomplete, Typography as Typography$1, TextField, InputAdornment, SwipeableDrawer, Badge as Badge$1, Paper, ToggleButtonGroup, ToggleButton } from "@mui/material";
|
|
11
11
|
import isNil from "lodash/isNil";
|
|
12
12
|
import { useEditorConfig, EditorConfigProvider } from "@blocklet/editor/lib/config";
|
|
@@ -1125,6 +1125,19 @@ const useResponsiveValue = (values2) => {
|
|
|
1125
1125
|
const r = useResponsive();
|
|
1126
1126
|
return r(values2);
|
|
1127
1127
|
};
|
|
1128
|
+
function useEventCallback(fn) {
|
|
1129
|
+
const ref = useRef();
|
|
1130
|
+
useLayoutEffect(() => {
|
|
1131
|
+
ref.current = fn;
|
|
1132
|
+
});
|
|
1133
|
+
return useCallback((...args) => {
|
|
1134
|
+
const { current } = ref;
|
|
1135
|
+
if (current == null) {
|
|
1136
|
+
throw new Error("callback created in useEventCallback can only be called from event handlers");
|
|
1137
|
+
}
|
|
1138
|
+
return current(...args);
|
|
1139
|
+
}, []);
|
|
1140
|
+
}
|
|
1128
1141
|
const useChatInWallet = () => {
|
|
1129
1142
|
var _a2;
|
|
1130
1143
|
const navigate = useNavigate();
|
|
@@ -4906,7 +4919,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
|
|
|
4906
4919
|
}
|
|
4907
4920
|
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" }) });
|
|
4908
4921
|
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" }) });
|
|
4909
|
-
const Editor = lazyRetry(() => import("./editor-
|
|
4922
|
+
const Editor = lazyRetry(() => import("./editor-D5FK3BKr.mjs"));
|
|
4910
4923
|
function LazyEditor(props) {
|
|
4911
4924
|
const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
|
|
4912
4925
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
|
@@ -12421,94 +12434,95 @@ function SegmentedControl({ value, options, onChange, sx, ...rest }) {
|
|
|
12421
12434
|
) });
|
|
12422
12435
|
}
|
|
12423
12436
|
export {
|
|
12424
|
-
|
|
12437
|
+
ChatListInWallet as $,
|
|
12425
12438
|
Avatar as A,
|
|
12426
12439
|
Badge as B,
|
|
12427
12440
|
CommentInput as C,
|
|
12428
12441
|
DefaultEditorConfigProvider as D,
|
|
12429
|
-
|
|
12430
|
-
|
|
12431
|
-
|
|
12432
|
-
|
|
12442
|
+
useCommentsContext as E,
|
|
12443
|
+
CommentsProvider as F,
|
|
12444
|
+
BinaryThumb as G,
|
|
12445
|
+
GithubReaction as H,
|
|
12433
12446
|
ImagePathFixerPlugin as I,
|
|
12434
|
-
|
|
12435
|
-
|
|
12436
|
-
|
|
12447
|
+
EmptyStatus as J,
|
|
12448
|
+
BlogListWrapper as K,
|
|
12449
|
+
BlogCard as L,
|
|
12437
12450
|
Menu as M,
|
|
12438
|
-
|
|
12439
|
-
|
|
12451
|
+
BlogPermaLink as N,
|
|
12452
|
+
getBlogLink as O,
|
|
12440
12453
|
Pagination as P,
|
|
12441
|
-
|
|
12454
|
+
CoverImage as Q,
|
|
12442
12455
|
RelativeTime as R,
|
|
12443
12456
|
ScrollableEditorWrapper as S,
|
|
12444
|
-
|
|
12445
|
-
|
|
12457
|
+
CoverImageUpload as T,
|
|
12458
|
+
AccessControl as U,
|
|
12446
12459
|
VideoPathFixerPlugin as V,
|
|
12447
|
-
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
|
|
12460
|
+
useAuthzContext as W,
|
|
12461
|
+
AuthzProvider as X,
|
|
12462
|
+
ChatClient as Y,
|
|
12463
|
+
Chat as Z,
|
|
12464
|
+
ChatInWallet as _,
|
|
12452
12465
|
isEmptyContent as a,
|
|
12453
|
-
|
|
12454
|
-
|
|
12455
|
-
|
|
12456
|
-
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
|
-
|
|
12460
|
-
|
|
12461
|
-
|
|
12462
|
-
|
|
12463
|
-
|
|
12464
|
-
|
|
12465
|
-
|
|
12466
|
-
|
|
12467
|
-
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12482
|
-
|
|
12483
|
-
|
|
12484
|
-
|
|
12485
|
-
|
|
12486
|
-
|
|
12487
|
-
|
|
12488
|
-
|
|
12466
|
+
ChatHeaderAddon as a0,
|
|
12467
|
+
useChatContext as a1,
|
|
12468
|
+
ChatProvider as a2,
|
|
12469
|
+
UnreadNotificationContext as a3,
|
|
12470
|
+
useUnreadNotification as a4,
|
|
12471
|
+
UnreadNotificationProvider as a5,
|
|
12472
|
+
Confirm as a6,
|
|
12473
|
+
ConfirmContext as a7,
|
|
12474
|
+
useConfirm as a8,
|
|
12475
|
+
ConfirmProvider as a9,
|
|
12476
|
+
useArcSphereDialog as aA,
|
|
12477
|
+
SecureLabelPicker as aa,
|
|
12478
|
+
useApiErrorHandler as ab,
|
|
12479
|
+
useDefaultApiErrorHandler as ac,
|
|
12480
|
+
DefaultApiErrorHandler as ad,
|
|
12481
|
+
Back as ae,
|
|
12482
|
+
LazyEditor as af,
|
|
12483
|
+
EditorPreview as ag,
|
|
12484
|
+
DirtyPromptContainer as ah,
|
|
12485
|
+
ConfirmNavigation as ai,
|
|
12486
|
+
UploaderContext as aj,
|
|
12487
|
+
useUploader as ak,
|
|
12488
|
+
UploaderTrigger as al,
|
|
12489
|
+
UploaderProvider as am,
|
|
12490
|
+
getUploadedImageUrl as an,
|
|
12491
|
+
usePointUpContext as ao,
|
|
12492
|
+
PointUpProvider as ap,
|
|
12493
|
+
ButtonGroup as aq,
|
|
12494
|
+
SegmentedControl as ar,
|
|
12495
|
+
create as as,
|
|
12496
|
+
getWsClient as at,
|
|
12497
|
+
useSubscription as au,
|
|
12498
|
+
toast as av,
|
|
12499
|
+
isInArcSphere$1 as aw,
|
|
12500
|
+
isInArcSphereDialog as ax,
|
|
12501
|
+
openArcSphereDialog as ay,
|
|
12502
|
+
closeArcSphereDialog as az,
|
|
12489
12503
|
Input as b,
|
|
12490
12504
|
useChanged as c,
|
|
12491
12505
|
useSessionContext as d,
|
|
12492
|
-
|
|
12493
|
-
|
|
12506
|
+
useEventCallback as e,
|
|
12507
|
+
utils as f,
|
|
12494
12508
|
getExcerptSync as g,
|
|
12495
|
-
|
|
12509
|
+
preferences as h,
|
|
12496
12510
|
inferInitialEditorState as i,
|
|
12497
|
-
|
|
12498
|
-
|
|
12511
|
+
typography as j,
|
|
12512
|
+
themeOverrides as k,
|
|
12499
12513
|
lexical as l,
|
|
12500
|
-
|
|
12501
|
-
|
|
12502
|
-
|
|
12514
|
+
InternalThemeProvider as m,
|
|
12515
|
+
Avatars as n,
|
|
12516
|
+
AuthorInfo as o,
|
|
12503
12517
|
preloadInput as p,
|
|
12504
|
-
|
|
12518
|
+
SystemUser as q,
|
|
12505
12519
|
routes as r,
|
|
12506
12520
|
stringify as s,
|
|
12507
12521
|
translations as t,
|
|
12508
12522
|
useNow as u,
|
|
12509
|
-
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
12513
|
-
|
|
12523
|
+
PostContent as v,
|
|
12524
|
+
PostComponent as w,
|
|
12525
|
+
Comment as x,
|
|
12526
|
+
CommentList as y,
|
|
12527
|
+
CommentsContext as z
|
|
12514
12528
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export * from './components/editor';
|
|
|
18
18
|
export * as lexicalUtils from './components/lexical';
|
|
19
19
|
export * from './components/dirty-prompt';
|
|
20
20
|
export { translations } from './components/locale';
|
|
21
|
-
export { useNow, useChanged, useSessionContext } from './components/hooks';
|
|
21
|
+
export { useNow, useChanged, useSessionContext, useEventCallback } from './components/hooks';
|
|
22
22
|
export * as utils from './components/utils';
|
|
23
23
|
export * as routes from './components/routes';
|
|
24
24
|
export { default as preferences } from './preferences';
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "@blocklet/labels";
|
|
2
|
-
import {
|
|
2
|
+
import { U, o, X, A, n, ae, B, G, L, K, N, aq, Z, Y, a0, _, $, a2, x, C, y, z, F, a6, a7, ai, a9, Q, T, ad, D, ah, ag, J, H, b, m, af, M, P, ap, w, v, R, S, aa, ar, q, a3, a5, aj, am, al, az, as, O, an, at, aw, ax, l, ay, h, p, r, k, av, t, j, ab, aA, W, c, a1, E, a8, ac, e, u, ao, d, au, a4, ak, f } from "./index-B7y6yLro.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
|
@@ -9,88 +9,89 @@ import "@mui/icons-material";
|
|
|
9
9
|
import "@arcblock/ux/lib/Locale/context";
|
|
10
10
|
import "@mui/material";
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
U as AccessControl,
|
|
13
|
+
o as AuthorInfo,
|
|
14
|
+
X as AuthzProvider,
|
|
15
15
|
A as Avatar,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
n as Avatars,
|
|
17
|
+
ae as Back,
|
|
18
18
|
B as Badge,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
G as BinaryThumb,
|
|
20
|
+
L as BlogCard,
|
|
21
|
+
K as BlogList,
|
|
22
|
+
N as BlogPermaLink,
|
|
23
|
+
aq as ButtonGroup,
|
|
24
|
+
Z as Chat,
|
|
25
|
+
Y as ChatClient,
|
|
26
|
+
a0 as ChatHeaderAddon,
|
|
27
|
+
_ as ChatInWallet,
|
|
28
|
+
$ as ChatListInWallet,
|
|
29
|
+
a2 as ChatProvider,
|
|
30
|
+
x as Comment,
|
|
31
31
|
C as CommentInput,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
y as CommentList,
|
|
33
|
+
z as CommentsContext,
|
|
34
|
+
F as CommentsProvider,
|
|
35
|
+
a6 as Confirm,
|
|
36
|
+
a7 as ConfirmContext,
|
|
37
|
+
ai as ConfirmNavigation,
|
|
38
|
+
a9 as ConfirmProvider,
|
|
39
|
+
Q as CoverImage,
|
|
40
|
+
T as CoverImageUpload,
|
|
41
|
+
ad as DefaultApiErrorHandler,
|
|
42
42
|
D as DefaultEditorConfigProvider,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
ah as DirtyPromptContainer,
|
|
44
|
+
ag as EditorPreview,
|
|
45
|
+
J as EmptyStatus,
|
|
46
|
+
H as GithubReaction,
|
|
47
47
|
b as Input,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
m as InternalThemeProvider,
|
|
49
|
+
af as LazyEditor,
|
|
50
50
|
M as Menu,
|
|
51
51
|
P as Pagination,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
ap as PointUpProvider,
|
|
53
|
+
w as Post,
|
|
54
|
+
v as PostContent,
|
|
55
55
|
R as RelativeTime,
|
|
56
56
|
S as ScrollableEditorWrapper,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
aa as SecureLabelPicker,
|
|
58
|
+
ar as SegmentedControl,
|
|
59
|
+
q as SystemUser,
|
|
60
|
+
a3 as UnreadNotificationContext,
|
|
61
|
+
a5 as UnreadNotificationProvider,
|
|
62
|
+
aj as UploaderContext,
|
|
63
|
+
am as UploaderProvider,
|
|
64
|
+
al as UploaderTrigger,
|
|
65
|
+
az as closeArcSphereDialog,
|
|
66
|
+
as as create,
|
|
67
|
+
O as getBlogLink,
|
|
68
|
+
an as getUploadedImageUrl,
|
|
69
|
+
at as getWsClient,
|
|
70
|
+
aw as isInArcSphere,
|
|
71
|
+
ax as isInArcSphereDialog,
|
|
72
72
|
l as lexicalUtils,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
ay as openArcSphereDialog,
|
|
74
|
+
h as preferences,
|
|
75
75
|
p as preloadInput,
|
|
76
76
|
r as routes,
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
k as themeOverrides,
|
|
78
|
+
av as toast,
|
|
79
79
|
t as translations,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
j as typography,
|
|
81
|
+
ab as useApiErrorHandler,
|
|
82
|
+
aA as useArcSphereDialog,
|
|
83
|
+
W as useAuthzContext,
|
|
84
84
|
c as useChanged,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
a1 as useChatContext,
|
|
86
|
+
E as useCommentsContext,
|
|
87
|
+
a8 as useConfirm,
|
|
88
|
+
ac as useDefaultApiErrorHandler,
|
|
89
|
+
e as useEventCallback,
|
|
89
90
|
u as useNow,
|
|
90
|
-
|
|
91
|
+
ao as usePointUpContext,
|
|
91
92
|
d as useSessionContext,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
au as useSubscription,
|
|
94
|
+
a4 as useUnreadNotification,
|
|
95
|
+
ak as useUploader,
|
|
96
|
+
f as utils
|
|
96
97
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1049,6 +1049,19 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1049
1049
|
const r = useResponsive();
|
|
1050
1050
|
return r(values2);
|
|
1051
1051
|
};
|
|
1052
|
+
function useEventCallback(fn) {
|
|
1053
|
+
const ref = react.useRef();
|
|
1054
|
+
react.useLayoutEffect(() => {
|
|
1055
|
+
ref.current = fn;
|
|
1056
|
+
});
|
|
1057
|
+
return react.useCallback((...args) => {
|
|
1058
|
+
const { current } = ref;
|
|
1059
|
+
if (current == null) {
|
|
1060
|
+
throw new Error("callback created in useEventCallback can only be called from event handlers");
|
|
1061
|
+
}
|
|
1062
|
+
return current(...args);
|
|
1063
|
+
}, []);
|
|
1064
|
+
}
|
|
1052
1065
|
const useChatInWallet = () => {
|
|
1053
1066
|
var _a2;
|
|
1054
1067
|
const navigate = reactRouterDom.useNavigate();
|
|
@@ -12459,6 +12472,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
12459
12472
|
exports2.useCommentsContext = useCommentsContext;
|
|
12460
12473
|
exports2.useConfirm = useConfirm;
|
|
12461
12474
|
exports2.useDefaultApiErrorHandler = useDefaultApiErrorHandler;
|
|
12475
|
+
exports2.useEventCallback = useEventCallback;
|
|
12462
12476
|
exports2.useNow = useNow;
|
|
12463
12477
|
exports2.usePointUpContext = usePointUpContext;
|
|
12464
12478
|
exports2.useSessionContext = useSessionContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.201",
|
|
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.1.
|
|
49
|
-
"@blocklet/labels": "^2.1.
|
|
48
|
+
"@blocklet/editor": "^2.1.201",
|
|
49
|
+
"@blocklet/labels": "^2.1.201"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@arcblock/did-connect": "^2.10.36",
|