@blocklet/discuss-kit-ux 1.6.178 → 1.6.180
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.
|
@@ -4,11 +4,10 @@ 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-
|
|
7
|
+
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-QDqykalr.mjs";
|
|
8
8
|
import "@blocklet/labels";
|
|
9
9
|
import "@mui/material/styles";
|
|
10
10
|
import "@mui/material/Box";
|
|
11
|
-
import "@arcblock/ux/lib/Theme";
|
|
12
11
|
import "lodash/isNil";
|
|
13
12
|
import "@blocklet/editor/lib/config";
|
|
14
13
|
import "lexical";
|
|
@@ -24,6 +23,7 @@ import "@arcblock/ux/lib/Locale/context";
|
|
|
24
23
|
import "@mui/material/Alert";
|
|
25
24
|
import "lodash/isBoolean";
|
|
26
25
|
import "@mui/material/Button";
|
|
26
|
+
import "@arcblock/ux/lib/Theme";
|
|
27
27
|
import "@arcblock/did-connect/lib/Avatar";
|
|
28
28
|
import "@mui/material/AvatarGroup";
|
|
29
29
|
import "@mui/material/colors";
|
|
@@ -7,10 +7,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7
7
|
var _a, _b;
|
|
8
8
|
import { Labels2, LabelPicker } from "@blocklet/labels";
|
|
9
9
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
10
|
-
import { useTheme, ThemeProvider, styled
|
|
10
|
+
import { useTheme, ThemeProvider, styled } from "@mui/material/styles";
|
|
11
11
|
import { useEffect, useRef, lazy, useState, createElement, useContext, isValidElement, Suspense, useMemo, createContext, Fragment as Fragment$1, forwardRef, useCallback } from "react";
|
|
12
12
|
import Box from "@mui/material/Box";
|
|
13
|
-
import { styled } from "@arcblock/ux/lib/Theme";
|
|
14
13
|
import isNil from "lodash/isNil";
|
|
15
14
|
import { useEditorConfig, EditorConfigProvider } from "@blocklet/editor/lib/config";
|
|
16
15
|
import { $getRoot, $createParagraphNode, $createTextNode, KEY_ENTER_COMMAND, COMMAND_PRIORITY_LOW, $getSelection } from "lexical";
|
|
@@ -26,6 +25,7 @@ import { LocaleContext, useLocaleContext } from "@arcblock/ux/lib/Locale/context
|
|
|
26
25
|
import Alert from "@mui/material/Alert";
|
|
27
26
|
import isBoolean from "lodash/isBoolean";
|
|
28
27
|
import Button from "@mui/material/Button";
|
|
28
|
+
import { styled as styled$1 } from "@arcblock/ux/lib/Theme";
|
|
29
29
|
import DidAvatar from "@arcblock/did-connect/lib/Avatar";
|
|
30
30
|
import AvatarGroup from "@mui/material/AvatarGroup";
|
|
31
31
|
import { grey, green, amber } from "@mui/material/colors";
|
|
@@ -434,16 +434,6 @@ const useMeasure = () => {
|
|
|
434
434
|
return [ref, size || { width: 0, height: 0 }];
|
|
435
435
|
};
|
|
436
436
|
const BlockletEditor$2 = lazy(() => import("@blocklet/editor"));
|
|
437
|
-
const Root$5 = styled(Box)`
|
|
438
|
-
position: relative;
|
|
439
|
-
.be-shell {
|
|
440
|
-
border: 1px solid #ddd;
|
|
441
|
-
}
|
|
442
|
-
.be-editable,
|
|
443
|
-
.be-content {
|
|
444
|
-
min-height: 150px;
|
|
445
|
-
}
|
|
446
|
-
`;
|
|
447
437
|
const Input = ({
|
|
448
438
|
initialContent = "",
|
|
449
439
|
send,
|
|
@@ -465,7 +455,7 @@ const Input = ({
|
|
|
465
455
|
const [ref, { width }] = useMeasure();
|
|
466
456
|
const isChanged = useRef(false);
|
|
467
457
|
const editorConfig = useEditorConfig();
|
|
468
|
-
const inSmallView = width <
|
|
458
|
+
const inSmallView = width < 700;
|
|
469
459
|
const draftContent = sessionStorage.getItem(sessionKey);
|
|
470
460
|
const setDraftContent = (data) => {
|
|
471
461
|
if (data) {
|
|
@@ -528,12 +518,27 @@ const Input = ({
|
|
|
528
518
|
...editorConfig,
|
|
529
519
|
...inSmallView && {
|
|
530
520
|
toolbar: {
|
|
531
|
-
items: ["block", "
|
|
521
|
+
items: ["block", "italic", "bold", "underline", "media", ...((_a2 = editorConfig == null ? void 0 : editorConfig.toolbar) == null ? void 0 : _a2.items) || []]
|
|
532
522
|
}
|
|
533
523
|
}
|
|
534
524
|
};
|
|
535
525
|
const editorState = draftKey && draftContent && !initialContent ? draftContent : inferInitialEditorState(initialContent);
|
|
536
|
-
|
|
526
|
+
const mergedSx = mergeSx(
|
|
527
|
+
{
|
|
528
|
+
position: "relative",
|
|
529
|
+
".be-shell": {
|
|
530
|
+
border: 1,
|
|
531
|
+
borderColor: "divider",
|
|
532
|
+
borderRadius: 1,
|
|
533
|
+
overflow: "hidden"
|
|
534
|
+
},
|
|
535
|
+
".be-editable, .be-content": {
|
|
536
|
+
minHeight: 150
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
rest.sx
|
|
540
|
+
);
|
|
541
|
+
return /* @__PURE__ */ createElement(Box, { ref, ...rest, key: draftKey, sx: mergedSx }, /* @__PURE__ */ jsx(EditorConfigProvider, { value: mergedEditorConfig, children: /* @__PURE__ */ jsxs(
|
|
537
542
|
BlockletEditor$2,
|
|
538
543
|
{
|
|
539
544
|
placeholder,
|
|
@@ -551,7 +556,7 @@ const Input = ({
|
|
|
551
556
|
) }), render == null ? void 0 : render({ submit, content, loading, error, inSmallView }));
|
|
552
557
|
};
|
|
553
558
|
const mdiLanguageMarkdown = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M20.56 18H3.44C2.65 18 2 17.37 2 16.59V7.41C2 6.63 2.65 6 3.44 6h17.12c.79 0 1.44.63 1.44 1.41v9.18c0 .78-.65 1.41-1.44 1.41M6.81 15.19v-3.66l1.92 2.35l1.92-2.35v3.66h1.93V8.81h-1.93l-1.92 2.35l-1.92-2.35H4.89v6.38h1.92M19.69 12h-1.92V8.81h-1.92V12h-1.93l2.89 3.28L19.69 12Z" }) });
|
|
554
|
-
const StyledInput = styled
|
|
559
|
+
const StyledInput = styled(Input)`
|
|
555
560
|
.be-shell {
|
|
556
561
|
padding-bottom: 44px;
|
|
557
562
|
}
|
|
@@ -606,10 +611,10 @@ function CommentInput({
|
|
|
606
611
|
display: inSmallView ? "none" : "flex",
|
|
607
612
|
alignItems: "center",
|
|
608
613
|
m: 0,
|
|
609
|
-
fontSize:
|
|
610
|
-
color: "
|
|
614
|
+
fontSize: 12,
|
|
615
|
+
color: "text.disabled",
|
|
611
616
|
textDecoration: "none",
|
|
612
|
-
"&:hover": { color: "
|
|
617
|
+
"&:hover": { color: "text.secondary" }
|
|
613
618
|
},
|
|
614
619
|
children: [
|
|
615
620
|
/* @__PURE__ */ jsx(Box, { component: "span", sx: { display: "inline-flex", alignItems: "center", mr: 0.5, lineHeight: 1 }, children: /* @__PURE__ */ jsx(mdiLanguageMarkdown, { style: { fontSize: 16 } }) }),
|
|
@@ -673,7 +678,7 @@ function PostEdit({ content, send, onCancel, onSuccess, ...rest }) {
|
|
|
673
678
|
}
|
|
674
679
|
);
|
|
675
680
|
}
|
|
676
|
-
const Root$4 = styled(Box)`
|
|
681
|
+
const Root$4 = styled$1(Box)`
|
|
677
682
|
height: 100%;
|
|
678
683
|
.be-editable {
|
|
679
684
|
overflow-y: auto;
|
|
@@ -693,7 +698,7 @@ function Avatar({ src, ...rest }) {
|
|
|
693
698
|
}
|
|
694
699
|
return /* @__PURE__ */ jsx(DidAvatar, { src: src ? getResizedAvatar(src) : src, ...rest });
|
|
695
700
|
}
|
|
696
|
-
const Root$3 = styled(AvatarGroup)`
|
|
701
|
+
const Root$3 = styled$1(AvatarGroup)`
|
|
697
702
|
display: flex;
|
|
698
703
|
align-items: center;
|
|
699
704
|
position: relative;
|
|
@@ -1060,7 +1065,7 @@ function ProfileCard({ user, click, ...rest }) {
|
|
|
1060
1065
|
}
|
|
1061
1066
|
);
|
|
1062
1067
|
}
|
|
1063
|
-
const HtmlTooltip$1 = styled
|
|
1068
|
+
const HtmlTooltip$1 = styled(({ className, ...props }) => /* @__PURE__ */ jsx(Tooltip, { ...props, classes: { popper: className } }))(() => ({
|
|
1064
1069
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
1065
1070
|
backgroundColor: "transparent",
|
|
1066
1071
|
maxWidth: "initial"
|
|
@@ -1255,7 +1260,7 @@ function ChannelGroup({ size = "normal", chat, ...rest }) {
|
|
|
1255
1260
|
] });
|
|
1256
1261
|
}
|
|
1257
1262
|
const MAX_HEIGHT = 200;
|
|
1258
|
-
const Root$2 = styled("div")`
|
|
1263
|
+
const Root$2 = styled$1("div")`
|
|
1259
1264
|
&.markdown-viewer-collapsed .markdown-viewer-md-wrapper {
|
|
1260
1265
|
position: relative;
|
|
1261
1266
|
max-height: ${MAX_HEIGHT}px;
|
|
@@ -1299,7 +1304,7 @@ function ViewMore({ children, ...rest }) {
|
|
|
1299
1304
|
] });
|
|
1300
1305
|
}
|
|
1301
1306
|
const BlockletEditor$1 = lazy(() => import("@blocklet/editor"));
|
|
1302
|
-
const StyledBlockletEditor = styled
|
|
1307
|
+
const StyledBlockletEditor = styled(BlockletEditor$1)`
|
|
1303
1308
|
.editor-scroller {
|
|
1304
1309
|
min-height: initial;
|
|
1305
1310
|
}
|
|
@@ -1360,7 +1365,7 @@ function PostContent({
|
|
|
1360
1365
|
}
|
|
1361
1366
|
) }) });
|
|
1362
1367
|
}
|
|
1363
|
-
const StyledMuiMenu = styled(MuiMenu)`
|
|
1368
|
+
const StyledMuiMenu = styled$1(MuiMenu)`
|
|
1364
1369
|
.MuiMenuItem-root {
|
|
1365
1370
|
min-height: 32px;
|
|
1366
1371
|
min-width: 120px;
|
|
@@ -1413,7 +1418,7 @@ function Menu({ items = [], ...rest }) {
|
|
|
1413
1418
|
] });
|
|
1414
1419
|
}
|
|
1415
1420
|
Menu.Item = MuiMenuItem;
|
|
1416
|
-
const Root$1 = styled
|
|
1421
|
+
const Root$1 = styled(Box)`
|
|
1417
1422
|
.post-highlighted {
|
|
1418
1423
|
animation: highlighted-post-fade 3s;
|
|
1419
1424
|
animation-timing-function: ease-out;
|
|
@@ -1555,7 +1560,7 @@ const iconoirThumbsUp = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24
|
|
|
1555
1560
|
/* @__PURE__ */ jsx("path", { d: "M16.472 20H4.1a.6.6 0 0 1-.6-.6V9.6a.6.6 0 0 1 .6-.6h2.768a2 2 0 0 0 1.715-.971l2.71-4.517a1.631 1.631 0 0 1 2.961 1.308l-1.022 3.408a.6.6 0 0 0 .574.772h4.575a2 2 0 0 1 1.93 2.526l-1.91 7A2 2 0 0 1 16.473 20Z" }),
|
|
1556
1561
|
/* @__PURE__ */ jsx("path", { strokeLinejoin: "round", d: "M7 20V9" })
|
|
1557
1562
|
] }) });
|
|
1558
|
-
const StyledDialog = styled
|
|
1563
|
+
const StyledDialog = styled(Dialog)`
|
|
1559
1564
|
.ux-dialog_header {
|
|
1560
1565
|
padding: 0 16px;
|
|
1561
1566
|
}
|
|
@@ -1702,7 +1707,7 @@ function BinaryThumb({ data = [], variant = "default", size = "sm", ...rest }) {
|
|
|
1702
1707
|
}
|
|
1703
1708
|
);
|
|
1704
1709
|
}
|
|
1705
|
-
const Root = styled(Box)`
|
|
1710
|
+
const Root = styled$1(Box)`
|
|
1706
1711
|
display: flex;
|
|
1707
1712
|
.reaction-item {
|
|
1708
1713
|
display: flex;
|
|
@@ -1719,7 +1724,7 @@ function IconButton({ icon, text, onClick, selected, variant, size, onTextClick,
|
|
|
1719
1724
|
!!text && /* @__PURE__ */ jsx("span", { className: "reaction-btn-text", onClick: (e) => onTextClick == null ? void 0 : onTextClick(e), children: text })
|
|
1720
1725
|
] });
|
|
1721
1726
|
}
|
|
1722
|
-
const IconButtonRoot = styled("div")`
|
|
1727
|
+
const IconButtonRoot = styled$1("div")`
|
|
1723
1728
|
display: flex;
|
|
1724
1729
|
align-items: center;
|
|
1725
1730
|
&.reaction-btn-selected {
|
|
@@ -2466,7 +2471,7 @@ function CommentsProvider({
|
|
|
2466
2471
|
);
|
|
2467
2472
|
return /* @__PURE__ */ jsx(CommentsContext.Provider, { value, children });
|
|
2468
2473
|
}
|
|
2469
|
-
const LoadMoreButtonWrapper = styled
|
|
2474
|
+
const LoadMoreButtonWrapper = styled(Box)`
|
|
2470
2475
|
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 11L8 5L16 11' stroke='%23e1e4e8' stroke-linecap='square' stroke-width='1.5' /%3E%3C/svg%3E");
|
|
2471
2476
|
background-repeat: repeat-x;
|
|
2472
2477
|
background-position: center;
|
|
@@ -4085,7 +4090,7 @@ function MessageList({ chat, ...rest }) {
|
|
|
4085
4090
|
!isAtBottom && /* @__PURE__ */ jsx(Box, { sx: { position: "absolute", bottom: 16, right: 24 }, onClick: scrollToBottom, children: /* @__PURE__ */ jsx(Fab, { color: "inherit", sx: { width: { xs: 36, sm: 44 }, height: { xs: 36, sm: 44 } }, children: /* @__PURE__ */ jsx(ArrowDownward, {}) }) })
|
|
4086
4091
|
] });
|
|
4087
4092
|
}
|
|
4088
|
-
const HtmlTooltip = styled
|
|
4093
|
+
const HtmlTooltip = styled(({ className, ...props }) => /* @__PURE__ */ jsx(Tooltip$1, { ...props, classes: { popper: className } }))(() => ({
|
|
4089
4094
|
[`& .${tooltipClasses$1.tooltip}`]: {
|
|
4090
4095
|
color: "inherit",
|
|
4091
4096
|
backgroundColor: "#fff",
|
|
@@ -4304,27 +4309,10 @@ function NewChannelDialog({ open, onSubmit, onClose, ...rest }) {
|
|
|
4304
4309
|
showCloseButton: true,
|
|
4305
4310
|
maxWidth: "lg",
|
|
4306
4311
|
title: t("chat.newChannel"),
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
}
|
|
4312
|
-
},
|
|
4313
|
-
actions: /* @__PURE__ */ jsxs(
|
|
4314
|
-
Button,
|
|
4315
|
-
{
|
|
4316
|
-
color: "primary",
|
|
4317
|
-
sx: { mt: 1 },
|
|
4318
|
-
variant: "contained",
|
|
4319
|
-
size: "small",
|
|
4320
|
-
onClick: handleSubmit,
|
|
4321
|
-
disabled: !canSubmit,
|
|
4322
|
-
children: [
|
|
4323
|
-
/* @__PURE__ */ jsx(AddIcon, { sx: { mr: 0.375 } }),
|
|
4324
|
-
t("chat.create")
|
|
4325
|
-
]
|
|
4326
|
-
}
|
|
4327
|
-
),
|
|
4312
|
+
actions: /* @__PURE__ */ jsxs(Button, { color: "primary", variant: "contained", size: "small", onClick: handleSubmit, disabled: !canSubmit, children: [
|
|
4313
|
+
/* @__PURE__ */ jsx(AddIcon, { sx: { mr: 0.375 } }),
|
|
4314
|
+
t("chat.create")
|
|
4315
|
+
] }),
|
|
4328
4316
|
onClose,
|
|
4329
4317
|
...rest,
|
|
4330
4318
|
children: /* @__PURE__ */ jsxs(Box, { width: { xs: "100%", md: 560 }, minHeight: 140, children: [
|
|
@@ -4822,7 +4810,7 @@ function Pagination({
|
|
|
4822
4810
|
}
|
|
4823
4811
|
);
|
|
4824
4812
|
}
|
|
4825
|
-
const Editor = lazy(() => import("./editor-
|
|
4813
|
+
const Editor = lazy(() => import("./editor-fQ1zjzhm.mjs"));
|
|
4826
4814
|
function LazyEditor(props) {
|
|
4827
4815
|
const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4828
4816
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "@blocklet/labels";
|
|
2
|
-
import { O, j, T, A, h, a9, B, z, H, F, J, al, m, W, U, X, Z, q, C, v, w, y, a1, a2, ad, a4, L, N, D, ac, ab, E, G, b, f, aa, M, P, ak, o, n, a8, R, S, a5, am, k, _, a0, ae, ah, ag, ai, an, K, ao, l, p, r, e, t, a6, Q, c, Y, x, a3, a7, u, aj, ap, $, af, d } from "./index-
|
|
2
|
+
import { O, j, T, A, h, a9, B, z, H, F, J, al, m, W, U, X, Z, q, C, v, w, y, a1, a2, ad, a4, L, N, D, ac, ab, E, G, b, f, aa, M, P, ak, o, n, a8, R, S, a5, am, k, _, a0, ae, ah, ag, ai, an, K, ao, l, p, r, e, t, a6, Q, c, Y, x, a3, a7, u, aj, ap, $, af, d } from "./index-QDqykalr.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
|
@@ -10,7 +10,6 @@ import "@arcblock/ux/lib/Locale/context";
|
|
|
10
10
|
import "@arcblock/did-connect/lib/Session";
|
|
11
11
|
import "@mui/material";
|
|
12
12
|
import "@mui/material/styles";
|
|
13
|
-
import "@arcblock/ux/lib/Theme";
|
|
14
13
|
import "lodash/isNil";
|
|
15
14
|
import "@blocklet/editor/lib/config";
|
|
16
15
|
import "lexical";
|
|
@@ -22,6 +21,7 @@ import "@blocklet/editor/lib/ext/VideoPlugin/VideoNode";
|
|
|
22
21
|
import "ahooks";
|
|
23
22
|
import "@mui/material/Alert";
|
|
24
23
|
import "lodash/isBoolean";
|
|
24
|
+
import "@arcblock/ux/lib/Theme";
|
|
25
25
|
import "@arcblock/did-connect/lib/Avatar";
|
|
26
26
|
import "@mui/material/AvatarGroup";
|
|
27
27
|
import "@mui/material/colors";
|
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("react"), require("@mui/material/Box"), require("
|
|
3
|
-
})(this, function(exports2, labels, jsxRuntime, styles, react, Box,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("react"), require("@mui/material/Box"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), require("@mui/lab/LoadingButton"), require("@mui/icons-material"), require("@arcblock/ux/lib/Locale/context"), require("@mui/material/Alert"), require("lodash/isBoolean"), require("@mui/material/Button"), require("@arcblock/ux/lib/Theme"), require("@arcblock/did-connect/lib/Avatar"), require("@mui/material/AvatarGroup"), require("@mui/material/colors"), require("@mui/material/useMediaQuery"), require("@arcblock/ux/lib/DID"), require("@mui/material/Tooltip"), require("react-router-dom"), require("@arcblock/ux/lib/RelativeTime"), require("@mui/material/Chip"), require("@mui/material/Stack"), require("lodash/groupBy"), require("lodash/flatMap"), require("lodash/uniqBy"), require("lodash/trim"), require("@mui/material/Avatar"), require("@mui/icons-material/BrokenImage"), require("@iconify/react"), require("@arcblock/ux/lib/Empty"), require("@arcblock/did-connect/lib/Session"), require("@mui/material"), require("@arcblock/did-connect/lib/Address"), require("@mui/icons-material/NotificationsActiveOutlined"), require("@mui/icons-material/Groups2Rounded"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), require("@mui/material/MenuItem"), require("clsx"), require("@mui/material/IconButton"), require("@mui/material/Menu"), require("@arcblock/ux/lib/Dialog"), require("url-join"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("react-dom"), require("dayjs"), require("dayjs/plugin/relativeTime"), require("mitt"), require("@mui/material/CircularProgress"), require("react-helmet"), require("react-flip-toolkit"), require("@mui/material/Fab"), require("lodash/debounce"), require("@mui/material/TextField"), require("@mui/icons-material/Add"), require("axios"), require("@arcblock/ux/lib/Toast"), require("@mui/material/Pagination"), require("unstated-next"), require("js-cookie"), require("@arcblock/ws"), require("@emotion/css"), require("@blocklet/editor/lib/ext/OnContentChangePlugin"), require("@blocklet/editor/lib/ext/ShortcutPlugin"), require("@blocklet/editor/lib/ext/SafeAreaPlugin"), require("@lexical/text"), require("@blocklet/editor/lib/main/nodes/ImageNode"), require("@blocklet/editor/lib/ext/VideoPlugin/VideoNode")) : typeof define === "function" && define.amd ? define(["exports", "@blocklet/labels", "react/jsx-runtime", "@mui/material/styles", "react", "@mui/material/Box", "lodash/isNil", "@blocklet/editor/lib/config", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@mui/lab/LoadingButton", "@mui/icons-material", "@arcblock/ux/lib/Locale/context", "@mui/material/Alert", "lodash/isBoolean", "@mui/material/Button", "@arcblock/ux/lib/Theme", "@arcblock/did-connect/lib/Avatar", "@mui/material/AvatarGroup", "@mui/material/colors", "@mui/material/useMediaQuery", "@arcblock/ux/lib/DID", "@mui/material/Tooltip", "react-router-dom", "@arcblock/ux/lib/RelativeTime", "@mui/material/Chip", "@mui/material/Stack", "lodash/groupBy", "lodash/flatMap", "lodash/uniqBy", "lodash/trim", "@mui/material/Avatar", "@mui/icons-material/BrokenImage", "@iconify/react", "@arcblock/ux/lib/Empty", "@arcblock/did-connect/lib/Session", "@mui/material", "@arcblock/did-connect/lib/Address", "@mui/icons-material/NotificationsActiveOutlined", "@mui/icons-material/Groups2Rounded", "@blocklet/editor/lib/ext/CheckboxPlugin", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@arcblock/ux/lib/Dialog", "url-join", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "react-dom", "dayjs", "dayjs/plugin/relativeTime", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/Fab", "lodash/debounce", "@mui/material/TextField", "@mui/icons-material/Add", "axios", "@arcblock/ux/lib/Toast", "@mui/material/Pagination", "unstated-next", "js-cookie", "@arcblock/ws", "@emotion/css", "@blocklet/editor/lib/ext/OnContentChangePlugin", "@blocklet/editor/lib/ext/ShortcutPlugin", "@blocklet/editor/lib/ext/SafeAreaPlugin", "@lexical/text", "@blocklet/editor/lib/main/nodes/ImageNode", "@blocklet/editor/lib/ext/VideoPlugin/VideoNode"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.DiscussKitComponents = {}, global.labels, global.jsxRuntime, global.styles, global.react, global.Box, global.isNil, global.config, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, global.Theme, global.DidAvatar, global.AvatarGroup, global.colors, global.useMediaQuery, global.DID, global.Tooltip, global.reactRouterDom, global.UxRelativeTime, global.Chip, global.Stack, global.groupBy, global.flatMap, global.uniqBy, global.trim, global.Avatar$1, global.BrokenImageIcon, global.react$1, global.Empty$1, global.Session, global.material, global.DIDAddress, global.NotificationsActiveOutlinedIcon, global.Groups2RoundedIcon, global.CheckboxPlugin, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.Dialog, global.joinUrl, global.orderBy, global.Typography, global.Skeleton, global.reactDom, global.dayjs, global.relativeTime, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.Fab, global.debounce, global.TextField, global.AddIcon, global.axios, global.Toast, global.MuiPagination, global.unstatedNext, global.Cookie, global.ws, global.css, global.OnContentChangePlugin, global.ShortcutPlugin, global.SafeAreaPlugin, global.text, global.ImageNode, global.VideoNode));
|
|
3
|
+
})(this, function(exports2, labels, jsxRuntime, styles, react, Box, isNil, config, LexicalComposerContext, lexical$1, ahooks, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, Theme, DidAvatar, AvatarGroup, colors, useMediaQuery, DID, Tooltip, reactRouterDom, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$1, Session, material, DIDAddress, NotificationsActiveOutlinedIcon, Groups2RoundedIcon, CheckboxPlugin, MuiMenuItem, clsx, IconButton$1, MuiMenu, Dialog, joinUrl, orderBy, Typography, Skeleton, reactDom, dayjs, relativeTime, mitt, CircularProgress, reactHelmet, reactFlipToolkit, Fab, debounce, TextField, AddIcon, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, css, OnContentChangePlugin, ShortcutPlugin, SafeAreaPlugin, text, ImageNode, VideoNode) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => {
|
|
@@ -367,16 +367,6 @@ var __publicField = (obj, key, value) => {
|
|
|
367
367
|
return [ref, size || { width: 0, height: 0 }];
|
|
368
368
|
};
|
|
369
369
|
const BlockletEditor$3 = react.lazy(() => import("@blocklet/editor"));
|
|
370
|
-
const Root$6 = Theme.styled(Box)`
|
|
371
|
-
position: relative;
|
|
372
|
-
.be-shell {
|
|
373
|
-
border: 1px solid #ddd;
|
|
374
|
-
}
|
|
375
|
-
.be-editable,
|
|
376
|
-
.be-content {
|
|
377
|
-
min-height: 150px;
|
|
378
|
-
}
|
|
379
|
-
`;
|
|
380
370
|
const Input = ({
|
|
381
371
|
initialContent = "",
|
|
382
372
|
send,
|
|
@@ -398,7 +388,7 @@ var __publicField = (obj, key, value) => {
|
|
|
398
388
|
const [ref, { width }] = useMeasure();
|
|
399
389
|
const isChanged = react.useRef(false);
|
|
400
390
|
const editorConfig = config.useEditorConfig();
|
|
401
|
-
const inSmallView = width <
|
|
391
|
+
const inSmallView = width < 700;
|
|
402
392
|
const draftContent = sessionStorage.getItem(sessionKey);
|
|
403
393
|
const setDraftContent = (data) => {
|
|
404
394
|
if (data) {
|
|
@@ -461,12 +451,27 @@ var __publicField = (obj, key, value) => {
|
|
|
461
451
|
...editorConfig,
|
|
462
452
|
...inSmallView && {
|
|
463
453
|
toolbar: {
|
|
464
|
-
items: ["block", "
|
|
454
|
+
items: ["block", "italic", "bold", "underline", "media", ...((_a2 = editorConfig == null ? void 0 : editorConfig.toolbar) == null ? void 0 : _a2.items) || []]
|
|
465
455
|
}
|
|
466
456
|
}
|
|
467
457
|
};
|
|
468
458
|
const editorState = draftKey && draftContent && !initialContent ? draftContent : inferInitialEditorState(initialContent);
|
|
469
|
-
|
|
459
|
+
const mergedSx = mergeSx(
|
|
460
|
+
{
|
|
461
|
+
position: "relative",
|
|
462
|
+
".be-shell": {
|
|
463
|
+
border: 1,
|
|
464
|
+
borderColor: "divider",
|
|
465
|
+
borderRadius: 1,
|
|
466
|
+
overflow: "hidden"
|
|
467
|
+
},
|
|
468
|
+
".be-editable, .be-content": {
|
|
469
|
+
minHeight: 150
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
rest.sx
|
|
473
|
+
);
|
|
474
|
+
return /* @__PURE__ */ react.createElement(Box, { ref, ...rest, key: draftKey, sx: mergedSx }, /* @__PURE__ */ jsxRuntime.jsx(config.EditorConfigProvider, { value: mergedEditorConfig, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
470
475
|
BlockletEditor$3,
|
|
471
476
|
{
|
|
472
477
|
placeholder,
|
|
@@ -539,10 +544,10 @@ var __publicField = (obj, key, value) => {
|
|
|
539
544
|
display: inSmallView ? "none" : "flex",
|
|
540
545
|
alignItems: "center",
|
|
541
546
|
m: 0,
|
|
542
|
-
fontSize:
|
|
543
|
-
color: "
|
|
547
|
+
fontSize: 12,
|
|
548
|
+
color: "text.disabled",
|
|
544
549
|
textDecoration: "none",
|
|
545
|
-
"&:hover": { color: "
|
|
550
|
+
"&:hover": { color: "text.secondary" }
|
|
546
551
|
},
|
|
547
552
|
children: [
|
|
548
553
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { display: "inline-flex", alignItems: "center", mr: 0.5, lineHeight: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(mdiLanguageMarkdown, { style: { fontSize: 16 } }) }),
|
|
@@ -4237,27 +4242,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4237
4242
|
showCloseButton: true,
|
|
4238
4243
|
maxWidth: "lg",
|
|
4239
4244
|
title: t("chat.newChannel"),
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
}
|
|
4245
|
-
},
|
|
4246
|
-
actions: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4247
|
-
Button,
|
|
4248
|
-
{
|
|
4249
|
-
color: "primary",
|
|
4250
|
-
sx: { mt: 1 },
|
|
4251
|
-
variant: "contained",
|
|
4252
|
-
size: "small",
|
|
4253
|
-
onClick: handleSubmit,
|
|
4254
|
-
disabled: !canSubmit,
|
|
4255
|
-
children: [
|
|
4256
|
-
/* @__PURE__ */ jsxRuntime.jsx(AddIcon, { sx: { mr: 0.375 } }),
|
|
4257
|
-
t("chat.create")
|
|
4258
|
-
]
|
|
4259
|
-
}
|
|
4260
|
-
),
|
|
4245
|
+
actions: /* @__PURE__ */ jsxRuntime.jsxs(Button, { color: "primary", variant: "contained", size: "small", onClick: handleSubmit, disabled: !canSubmit, children: [
|
|
4246
|
+
/* @__PURE__ */ jsxRuntime.jsx(AddIcon, { sx: { mr: 0.375 } }),
|
|
4247
|
+
t("chat.create")
|
|
4248
|
+
] }),
|
|
4261
4249
|
onClose,
|
|
4262
4250
|
...rest,
|
|
4263
4251
|
children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { width: { xs: "100%", md: 560 }, minHeight: 140, children: [
|
package/dist/preferences.d.ts
CHANGED
|
@@ -37,5 +37,17 @@ declare const preferences: {
|
|
|
37
37
|
enableAssignmentDiscussion: boolean;
|
|
38
38
|
enableAssignmentBlog: boolean;
|
|
39
39
|
enableAssignmentDoc: boolean;
|
|
40
|
+
bannerTitleDiscussionEn: string;
|
|
41
|
+
bannerTitleDiscussionZh: string;
|
|
42
|
+
bannerDescDiscussionEn: string;
|
|
43
|
+
bannerDescDiscussionZh: string;
|
|
44
|
+
bannerTitleBlogEn: string;
|
|
45
|
+
bannerTitleBlogZh: string;
|
|
46
|
+
bannerDescBlogEn: string;
|
|
47
|
+
bannerDescBlogZh: string;
|
|
48
|
+
bannerTitleBookmarkEn: string;
|
|
49
|
+
bannerTitleBookmarkZh: string;
|
|
50
|
+
bannerDescBookmarkEn: string;
|
|
51
|
+
bannerDescBookmarkZh: string;
|
|
40
52
|
};
|
|
41
53
|
export default preferences;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.180",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@arcblock/ws": "^1.18.113",
|
|
32
|
-
"@blocklet/editor": "1.6.
|
|
33
|
-
"@blocklet/labels": "1.6.
|
|
32
|
+
"@blocklet/editor": "1.6.180",
|
|
33
|
+
"@blocklet/labels": "1.6.180",
|
|
34
34
|
"@blocklet/uploader": "^0.0.75",
|
|
35
35
|
"@emotion/css": "^11.10.5",
|
|
36
36
|
"@emotion/react": "^11.10.5",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"resolutions": {
|
|
95
95
|
"react": "^18.2.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "87889daed2a12027c6d43c52ca59c1bdbacc764c"
|
|
98
98
|
}
|