@blocklet/discuss-kit-ux 2.1.240 → 2.1.242

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.
@@ -1,5 +1,6 @@
1
+ import { MutableRefObject } from 'react';
1
2
  import { BoxProps } from '@mui/material';
2
- import { EditorState } from 'lexical';
3
+ import { EditorState, LexicalEditor } from 'lexical';
3
4
  export declare const preloadInput: () => Promise<typeof import('@blocklet/editor').default>;
4
5
  export type Send = (content: string) => Promise<any>;
5
6
  export interface RenderProps {
@@ -21,7 +22,8 @@ export interface InputProps extends Omit<BoxProps, 'onChange'> {
21
22
  children?: React.ReactNode;
22
23
  renderInnerFooter?: (args: RenderProps) => React.ReactElement;
23
24
  renderEditorFooter?: (args: RenderProps) => React.ReactElement;
25
+ editorRef?: MutableRefObject<LexicalEditor | null>;
24
26
  }
25
27
  export type Ref = HTMLDivElement;
26
- declare const Input: ({ initialContent, send, placeholder, onSuccess, onChange, autoFocus, draftKey, shortcut, children, renderInnerFooter, renderEditorFooter, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
28
+ declare const Input: ({ initialContent, send, placeholder, onSuccess, onChange, autoFocus, draftKey, shortcut, children, renderInnerFooter, renderEditorFooter, editorRef, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
27
29
  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-BF_9jmZU.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-BExMeFyt.mjs";
8
8
  const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -583,6 +583,7 @@ const Input = ({
583
583
  children,
584
584
  renderInnerFooter,
585
585
  renderEditorFooter,
586
+ editorRef,
586
587
  ...rest
587
588
  }) => {
588
589
  var _a2;
@@ -679,6 +680,7 @@ const Input = ({
679
680
  return /* @__PURE__ */ createElement(Box, { ref, ...rest, key: draftKey, sx: mergedSx }, /* @__PURE__ */ jsx(EditorConfigProvider, { value: mergedEditorConfig, children: /* @__PURE__ */ jsxs(
680
681
  BlockletEditor$2,
681
682
  {
683
+ editorRef,
682
684
  placeholder,
683
685
  editorState,
684
686
  onChange: handleChange,
@@ -4927,7 +4929,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
4927
4929
  }
4928
4930
  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" }) });
4929
4931
  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" }) });
4930
- const Editor = lazyRetry(() => import("./editor-B6_jlrIh.mjs"));
4932
+ const Editor = lazyRetry(() => import("./editor-BLug89FC.mjs"));
4931
4933
  function LazyEditor(props) {
4932
4934
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
4933
4935
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
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, aB, ap, w, v, R, S, aa, ar, aC, 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-BF_9jmZU.mjs";
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, aB, ap, w, v, R, S, aa, ar, aC, 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-BExMeFyt.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -507,6 +507,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
507
507
  children,
508
508
  renderInnerFooter,
509
509
  renderEditorFooter,
510
+ editorRef,
510
511
  ...rest
511
512
  }) => {
512
513
  var _a2;
@@ -603,6 +604,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
603
604
  return /* @__PURE__ */ react.createElement(material.Box, { ref, ...rest, key: draftKey, sx: mergedSx }, /* @__PURE__ */ jsxRuntime.jsx(config.EditorConfigProvider, { value: mergedEditorConfig, children: /* @__PURE__ */ jsxRuntime.jsxs(
604
605
  BlockletEditor$3,
605
606
  {
607
+ editorRef,
606
608
  placeholder,
607
609
  editorState,
608
610
  onChange: handleChange,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.1.240",
3
+ "version": "2.1.242",
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.240",
49
- "@blocklet/labels": "^2.1.240"
48
+ "@blocklet/editor": "^2.1.242",
49
+ "@blocklet/labels": "^2.1.242"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@arcblock/did-connect": "^2.10.36",