@blocklet/discuss-kit-ux 2.3.10 → 2.3.11
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/blog/cover-image.d.ts +2 -1
- package/dist/components/input/comment-input.d.ts +2 -1
- package/dist/components/input/input.d.ts +2 -1
- package/dist/{editor-DOQzNHRz.mjs → editor-94xkCNNh.mjs} +1 -1
- package/dist/{index-BvbPx1Nn.mjs → index-JEUQhbmY.mjs} +7 -3
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +6 -2
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@ interface CoverImageUploadProps extends Omit<BoxProps, 'onChange'> {
|
|
|
4
4
|
onChange: (url: string | null) => void;
|
|
5
5
|
width?: number;
|
|
6
6
|
}
|
|
7
|
-
export declare function CoverImage({ url, aspectRatio, width, sx, fetchpriority, loading, shadow, fallback, ...rest }: {
|
|
7
|
+
export declare function CoverImage({ url, aspectRatio, width, sx, fetchpriority, loading, shadow, fallback, onClick, ...rest }: {
|
|
8
8
|
url?: string;
|
|
9
9
|
aspectRatio?: number;
|
|
10
10
|
width?: number;
|
|
@@ -12,6 +12,7 @@ export declare function CoverImage({ url, aspectRatio, width, sx, fetchpriority,
|
|
|
12
12
|
fetchpriority?: 'auto' | 'low' | 'high';
|
|
13
13
|
shadow?: boolean;
|
|
14
14
|
fallback?: React.ReactNode;
|
|
15
|
+
onClick?: () => void;
|
|
15
16
|
} & BoxProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export declare function CoverImageUpload({ url, onChange, width, ...rest }: CoverImageUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -4,6 +4,7 @@ interface Props extends Omit<InputProps, 'render'> {
|
|
|
4
4
|
sendIcon?: React.ReactNode;
|
|
5
5
|
disabledSend?: boolean;
|
|
6
6
|
renderInnerFooter?: (args: RenderProps) => React.ReactElement;
|
|
7
|
+
disableCmdEnter?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export default function CommentInput({ disabledSend, send, onSuccess, placeholder, sendText, sendIcon, draftKey, renderInnerFooter, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function CommentInput({ disabledSend, send, onSuccess, placeholder, sendText, sendIcon, draftKey, renderInnerFooter, disableCmdEnter, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -23,7 +23,8 @@ export interface InputProps extends Omit<BoxProps, 'onChange'> {
|
|
|
23
23
|
renderInnerFooter?: (args: RenderProps) => React.ReactElement;
|
|
24
24
|
renderEditorFooter?: (args: RenderProps) => React.ReactElement;
|
|
25
25
|
editorRef?: MutableRefObject<LexicalEditor | null>;
|
|
26
|
+
disableCmdEnter?: boolean;
|
|
26
27
|
}
|
|
27
28
|
export type Ref = HTMLDivElement;
|
|
28
|
-
declare const Input: ({ initialContent, send, placeholder, onSuccess, onChange, autoFocus, draftKey, shortcut, children, renderInnerFooter, renderEditorFooter, editorRef, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare const Input: ({ initialContent, send, placeholder, onSuccess, onChange, autoFocus, draftKey, shortcut, children, renderInnerFooter, renderEditorFooter, editorRef, disableCmdEnter, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
30
|
export default Input;
|
|
@@ -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-JEUQhbmY.mjs";
|
|
8
8
|
const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
|
|
9
9
|
const Root = styled(Box)`
|
|
10
10
|
.be-editable,
|
|
@@ -586,6 +586,7 @@ const Input = ({
|
|
|
586
586
|
renderInnerFooter,
|
|
587
587
|
renderEditorFooter,
|
|
588
588
|
editorRef,
|
|
589
|
+
disableCmdEnter = false,
|
|
589
590
|
...rest
|
|
590
591
|
}) => {
|
|
591
592
|
var _a2;
|
|
@@ -688,7 +689,7 @@ const Input = ({
|
|
|
688
689
|
onChange: handleChange,
|
|
689
690
|
autoFocus,
|
|
690
691
|
children: [
|
|
691
|
-
/* @__PURE__ */ jsx(CmdEnterShortcutPlugin, { shortcut, callback: handleCmdEnterPressed }),
|
|
692
|
+
!disableCmdEnter && /* @__PURE__ */ jsx(CmdEnterShortcutPlugin, { shortcut, callback: handleCmdEnterPressed }),
|
|
692
693
|
/* @__PURE__ */ jsx(ImagePathFixerPlugin, {}),
|
|
693
694
|
/* @__PURE__ */ jsx(VideoPathFixerPlugin, {}),
|
|
694
695
|
/* @__PURE__ */ jsx(AutoClearPlugin$1, { value: content, isChanged: isChanged.current }),
|
|
@@ -708,6 +709,7 @@ function CommentInput({
|
|
|
708
709
|
sendIcon,
|
|
709
710
|
draftKey = "",
|
|
710
711
|
renderInnerFooter,
|
|
712
|
+
disableCmdEnter = false,
|
|
711
713
|
...rest
|
|
712
714
|
}) {
|
|
713
715
|
const { t } = useContext(LocaleContext);
|
|
@@ -767,6 +769,7 @@ function CommentInput({
|
|
|
767
769
|
send,
|
|
768
770
|
onSuccess,
|
|
769
771
|
draftKey,
|
|
772
|
+
disableCmdEnter,
|
|
770
773
|
...rest,
|
|
771
774
|
renderInnerFooter: renderInnerFooter ?? renderFooter,
|
|
772
775
|
renderEditorFooter: ({ error }) => error && /* @__PURE__ */ jsx(Alert, { severity: "error", children: error })
|
|
@@ -3184,6 +3187,7 @@ function CoverImage({
|
|
|
3184
3187
|
loading = "eager",
|
|
3185
3188
|
shadow = false,
|
|
3186
3189
|
fallback: fallback2,
|
|
3190
|
+
onClick,
|
|
3187
3191
|
...rest
|
|
3188
3192
|
}) {
|
|
3189
3193
|
const [loaded, setLoaded] = useState(false);
|
|
@@ -3221,7 +3225,7 @@ function CoverImage({
|
|
|
3221
3225
|
}
|
|
3222
3226
|
),
|
|
3223
3227
|
!!url && // add box because img can't add :after
|
|
3224
|
-
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
3228
|
+
/* @__PURE__ */ jsx(Box, { onClick: () => onClick == null ? void 0 : onClick(), sx: { cursor: onClick ? "pointer" : "inherit" }, children: /* @__PURE__ */ jsx(
|
|
3225
3229
|
"img",
|
|
3226
3230
|
{
|
|
3227
3231
|
src: url ? getUploadedImageUrl(url, width) : "",
|
|
@@ -4934,7 +4938,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
|
|
|
4934
4938
|
}
|
|
4935
4939
|
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" }) });
|
|
4936
4940
|
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" }) });
|
|
4937
|
-
const Editor = lazyRetry(() => import("./editor-
|
|
4941
|
+
const Editor = lazyRetry(() => import("./editor-94xkCNNh.mjs"));
|
|
4938
4942
|
function LazyEditor(props) {
|
|
4939
4943
|
const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
|
|
4940
4944
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "@blocklet/labels";
|
|
2
|
-
import { X, o, Z, A, n, ag, B, J, O, N, Q, as, $, _, a2, a0, a1, a4, x, G, H, C, y, z, F, a8, a9, ak, ab, U, W, af, D, aj, ai, L, K, b, m, ah, M, P, aD, ar, w, v, aF, aG, R, S, ac, at, aE, q, a5, a7, al, ao, an, aB, au, T, ap, av, ay, az, l, aA, h, p, r, k, ax, t, j, ad, aC, Y, c, a3, E, aa, ae, e, u, aq, d, aw, a6, am, f } from "./index-
|
|
2
|
+
import { X, o, Z, A, n, ag, B, J, O, N, Q, as, $, _, a2, a0, a1, a4, x, G, H, C, y, z, F, a8, a9, ak, ab, U, W, af, D, aj, ai, L, K, b, m, ah, M, P, aD, ar, w, v, aF, aG, R, S, ac, at, aE, q, a5, a7, al, ao, an, aB, au, T, ap, av, ay, az, l, aA, h, p, r, k, ax, t, j, ad, aC, Y, c, a3, E, aa, ae, e, u, aq, d, aw, a6, am, f } from "./index-JEUQhbmY.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
package/dist/index.umd.js
CHANGED
|
@@ -508,6 +508,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
508
508
|
renderInnerFooter,
|
|
509
509
|
renderEditorFooter,
|
|
510
510
|
editorRef,
|
|
511
|
+
disableCmdEnter = false,
|
|
511
512
|
...rest
|
|
512
513
|
}) => {
|
|
513
514
|
var _a2;
|
|
@@ -610,7 +611,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
610
611
|
onChange: handleChange,
|
|
611
612
|
autoFocus,
|
|
612
613
|
children: [
|
|
613
|
-
/* @__PURE__ */ jsxRuntime.jsx(CmdEnterShortcutPlugin, { shortcut, callback: handleCmdEnterPressed }),
|
|
614
|
+
!disableCmdEnter && /* @__PURE__ */ jsxRuntime.jsx(CmdEnterShortcutPlugin, { shortcut, callback: handleCmdEnterPressed }),
|
|
614
615
|
/* @__PURE__ */ jsxRuntime.jsx(ImagePathFixerPlugin, {}),
|
|
615
616
|
/* @__PURE__ */ jsxRuntime.jsx(VideoPathFixerPlugin, {}),
|
|
616
617
|
/* @__PURE__ */ jsxRuntime.jsx(AutoClearPlugin$1, { value: content, isChanged: isChanged.current }),
|
|
@@ -630,6 +631,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
630
631
|
sendIcon,
|
|
631
632
|
draftKey = "",
|
|
632
633
|
renderInnerFooter,
|
|
634
|
+
disableCmdEnter = false,
|
|
633
635
|
...rest
|
|
634
636
|
}) {
|
|
635
637
|
const { t } = react.useContext(context.LocaleContext);
|
|
@@ -689,6 +691,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
689
691
|
send,
|
|
690
692
|
onSuccess,
|
|
691
693
|
draftKey,
|
|
694
|
+
disableCmdEnter,
|
|
692
695
|
...rest,
|
|
693
696
|
renderInnerFooter: renderInnerFooter ?? renderFooter,
|
|
694
697
|
renderEditorFooter: ({ error }) => error && /* @__PURE__ */ jsxRuntime.jsx(Alert, { severity: "error", children: error })
|
|
@@ -3106,6 +3109,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3106
3109
|
loading = "eager",
|
|
3107
3110
|
shadow = false,
|
|
3108
3111
|
fallback: fallback2,
|
|
3112
|
+
onClick,
|
|
3109
3113
|
...rest
|
|
3110
3114
|
}) {
|
|
3111
3115
|
const [loaded, setLoaded] = react.useState(false);
|
|
@@ -3143,7 +3147,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3143
3147
|
}
|
|
3144
3148
|
),
|
|
3145
3149
|
!!url && // add box because img can't add :after
|
|
3146
|
-
/* @__PURE__ */ jsxRuntime.jsx(material.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3150
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.Box, { onClick: () => onClick == null ? void 0 : onClick(), sx: { cursor: onClick ? "pointer" : "inherit" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3147
3151
|
"img",
|
|
3148
3152
|
{
|
|
3149
3153
|
src: url ? getUploadedImageUrl(url, width) : "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.11",
|
|
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/
|
|
49
|
-
"@blocklet/
|
|
48
|
+
"@blocklet/editor": "^2.3.11",
|
|
49
|
+
"@blocklet/labels": "^2.3.11"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@arcblock/did-connect": "^2.10.36",
|