@blocklet/discuss-kit-ux 1.6.224 → 1.6.225
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/dirty-prompt.d.ts +1 -1
- package/dist/components/input/input.d.ts +2 -2
- package/dist/{editor-xw6iQCuH.mjs → editor-s7PBL7A3.mjs} +1 -1
- package/dist/{index-BYwPg7XF.mjs → index-7-SJaHOi.mjs} +250 -233
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +22 -5
- package/package.json +4 -4
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-
|
|
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-7-SJaHOi.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
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("@arcblock/ux/lib/Theme"), require("react"), require("@mui/material
|
|
3
|
-
})(this, function(exports2, labels, jsxRuntime, styles, Theme, react,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("@arcblock/ux/lib/Theme"), require("react"), require("@mui/material"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), require("@mui/material/Box"), 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/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/icons-material/NotificationsActiveOutlined"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), require("@arcblock/did-connect/lib/Address"), require("@mui/material/MenuItem"), require("clsx"), require("@mui/material/IconButton"), require("@mui/material/Menu"), require("@arcblock/ux/lib/Dialog"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("url-join"), 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/colors/grey"), require("@arcblock/bridge"), 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", "@arcblock/ux/lib/Theme", "react", "@mui/material", "lodash/isNil", "@blocklet/editor/lib/config", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@mui/material/Box", "@mui/lab/LoadingButton", "@mui/icons-material", "@arcblock/ux/lib/Locale/context", "@mui/material/Alert", "lodash/isBoolean", "@mui/material/Button", "@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/icons-material/NotificationsActiveOutlined", "@blocklet/editor/lib/ext/CheckboxPlugin", "@arcblock/did-connect/lib/Address", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@arcblock/ux/lib/Dialog", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "url-join", "react-dom", "dayjs", "dayjs/plugin/relativeTime", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/colors/grey", "@arcblock/bridge", "@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.Theme, global.react, global.material, global.isNil, global.config, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.Box, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, 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$3, global.Session, global.NotificationsActiveOutlinedIcon, global.CheckboxPlugin, global.DIDAddress, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.Dialog, global.orderBy, global.Typography, global.Skeleton, global.joinUrl, global.ReactDOM, global.dayjs, global.relativeTime, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.grey, global.bridge, 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, Theme, react, material, isNil, config, LexicalComposerContext, lexical$1, ahooks, Box, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, DidAvatar, AvatarGroup, colors, useMediaQuery, DID, Tooltip, reactRouterDom, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$3, Session, NotificationsActiveOutlinedIcon, CheckboxPlugin, DIDAddress, MuiMenuItem, clsx, IconButton$1, MuiMenu, Dialog, orderBy, Typography, Skeleton, joinUrl, ReactDOM, dayjs, relativeTime, mitt, CircularProgress, reactHelmet, reactFlipToolkit, grey, bridge, 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) => {
|
|
@@ -571,7 +571,7 @@ var __publicField = (obj, key, value) => {
|
|
|
571
571
|
},
|
|
572
572
|
rest.sx
|
|
573
573
|
);
|
|
574
|
-
return /* @__PURE__ */ react.createElement(Box, { ref, ...rest, key: draftKey, sx: mergedSx }, /* @__PURE__ */ jsxRuntime.jsx(config.EditorConfigProvider, { value: mergedEditorConfig, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
574
|
+
return /* @__PURE__ */ react.createElement(material.Box, { ref, ...rest, key: draftKey, sx: mergedSx }, /* @__PURE__ */ jsxRuntime.jsx(config.EditorConfigProvider, { value: mergedEditorConfig, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
575
575
|
BlockletEditor$3,
|
|
576
576
|
{
|
|
577
577
|
placeholder,
|
|
@@ -4600,6 +4600,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4600
4600
|
const isActive = isActiveChat(chat.id);
|
|
4601
4601
|
const { session, isAdmin } = useSessionContext();
|
|
4602
4602
|
const isCreator = chat.creator.did === ((_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.did);
|
|
4603
|
+
const [input, setInput] = react.useState("");
|
|
4603
4604
|
react.useEffect(() => {
|
|
4604
4605
|
if (chat.isActivated) {
|
|
4605
4606
|
initChatRoom(chat.id);
|
|
@@ -4694,9 +4695,11 @@ var __publicField = (obj, key, value) => {
|
|
|
4694
4695
|
}
|
|
4695
4696
|
},
|
|
4696
4697
|
children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { position: "relative" }, children: [
|
|
4697
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4698
|
+
isActive && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4698
4699
|
CommentInput,
|
|
4699
4700
|
{
|
|
4701
|
+
initialContent: input,
|
|
4702
|
+
onChange: (editorState) => setInput(editorState ? JSON.stringify(editorState) : ""),
|
|
4700
4703
|
send: (content) => sendMessage(chat.id, content),
|
|
4701
4704
|
placeholder: t("chat.typeSomething"),
|
|
4702
4705
|
sendText: t("chat.reply"),
|
|
@@ -5561,8 +5564,22 @@ var __publicField = (obj, key, value) => {
|
|
|
5561
5564
|
const { t } = context.useLocaleContext();
|
|
5562
5565
|
const [dirty, setDirty, getDirty] = ahooks.useGetState(false);
|
|
5563
5566
|
const { confirm } = useConfirm();
|
|
5567
|
+
const resetCallbackRef = react.useRef(null);
|
|
5564
5568
|
useBeforeUnloadPrompt(dirty);
|
|
5565
|
-
const reset = react.useCallback(
|
|
5569
|
+
const reset = react.useCallback(
|
|
5570
|
+
(callback) => {
|
|
5571
|
+
resetCallbackRef.current = callback;
|
|
5572
|
+
setDirty(false);
|
|
5573
|
+
},
|
|
5574
|
+
[setDirty]
|
|
5575
|
+
);
|
|
5576
|
+
react.useEffect(() => {
|
|
5577
|
+
var _a2;
|
|
5578
|
+
if (!dirty) {
|
|
5579
|
+
(_a2 = resetCallbackRef.current) == null ? void 0 : _a2.call(resetCallbackRef);
|
|
5580
|
+
resetCallbackRef.current = null;
|
|
5581
|
+
}
|
|
5582
|
+
}, [dirty]);
|
|
5566
5583
|
const markDirty = react.useCallback(() => setDirty(true), [setDirty]);
|
|
5567
5584
|
const check = react.useCallback(async () => {
|
|
5568
5585
|
if (getDirty()) {
|
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.225",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@arcblock/bridge": "^2.9.65",
|
|
32
32
|
"@arcblock/ws": "^1.18.115",
|
|
33
|
-
"@blocklet/editor": "1.6.
|
|
34
|
-
"@blocklet/labels": "1.6.
|
|
33
|
+
"@blocklet/editor": "1.6.225",
|
|
34
|
+
"@blocklet/labels": "1.6.225",
|
|
35
35
|
"@blocklet/uploader": "^0.0.78",
|
|
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": "
|
|
98
|
+
"gitHead": "e69e0b23326eec241383b91dedc9e5f16284dec7"
|
|
99
99
|
}
|