@oliasoft-open-source/react-ui-library 3.9.5 → 3.9.6

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/index.js CHANGED
@@ -6,7 +6,7 @@ var __publicField = (obj, key2, value) => {
6
6
  };
7
7
  import { jsx, Fragment as Fragment$1, jsxs } from "react/jsx-runtime";
8
8
  import * as React$4 from "react";
9
- import React__default, { useState, useRef, useEffect, useCallback as useCallback$1, createElement, forwardRef, useContext, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, createContext, isValidElement, useReducer, useDebugValue, Fragment as Fragment$2, Component as Component$1, PureComponent, memo, cloneElement as cloneElement$1, useImperativeHandle } from "react";
9
+ import React__default, { useState, useRef, useEffect, useCallback as useCallback$1, createElement, forwardRef, useContext, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, createContext, isValidElement, useReducer, useDebugValue, Fragment as Fragment$2, Component as Component$1, PureComponent, useImperativeHandle, memo, cloneElement as cloneElement$1 } from "react";
10
10
  import * as PropTypes from "prop-types";
11
11
  import PropTypes__default from "prop-types";
12
12
  import ReactDOM, { createPortal, unstable_batchedUpdates, render } from "react-dom";
@@ -54768,49 +54768,48 @@ const styles$e = {
54768
54768
  hideScrollbars: hideScrollbars$4,
54769
54769
  richTextInput
54770
54770
  };
54771
- const RichTextInput = ({
54772
- placeholder: placeholder3,
54773
- onChange,
54774
- value,
54775
- disabled: disabledProp
54776
- }) => {
54777
- const disabledContext = useContext(DisabledContext);
54778
- const disabled2 = disabledProp || disabledContext;
54779
- const { manager, state } = useRemirror({
54780
- extensions: () => [
54781
- new BoldExtension(),
54782
- new BulletListExtension(),
54783
- new CodeExtension(),
54784
- new ItalicExtension(),
54785
- new MarkdownExtension(),
54786
- new OrderedListExtension(),
54787
- new PlaceholderExtension({ placeholder: placeholder3 })
54788
- ],
54789
- content: value,
54790
- selection: "start",
54791
- stringHandler: "markdown"
54792
- });
54793
- const handleChange = ({ helpers }) => {
54794
- const markdown = helpers.getMarkdown();
54795
- onChange(markdown);
54796
- };
54797
- return /* @__PURE__ */ jsx("div", {
54798
- className: styles$e.richTextInput,
54799
- children: /* @__PURE__ */ jsxs(Remirror, {
54800
- manager,
54801
- initialContent: state,
54802
- placeholder: placeholder3,
54803
- onChange: handleChange,
54804
- editable: !disabled2,
54805
- children: [
54806
- /* @__PURE__ */ jsx(RichTextToolbar, {
54807
- disabled: disabled2
54808
- }),
54809
- /* @__PURE__ */ jsx(EditorComponent, {})
54810
- ]
54811
- })
54812
- });
54813
- };
54771
+ const RichTextInput = forwardRef(
54772
+ ({ placeholder: placeholder3, onChange, value, disabled: disabledProp }, ref2) => {
54773
+ const disabledContext = useContext(DisabledContext);
54774
+ const disabled2 = disabledProp || disabledContext;
54775
+ const { manager, state, setState, getContext: getContext2 } = useRemirror({
54776
+ extensions: () => [
54777
+ new BoldExtension(),
54778
+ new BulletListExtension(),
54779
+ new CodeExtension(),
54780
+ new ItalicExtension(),
54781
+ new MarkdownExtension(),
54782
+ new OrderedListExtension(),
54783
+ new PlaceholderExtension({ placeholder: placeholder3 })
54784
+ ],
54785
+ content: value,
54786
+ selection: "start",
54787
+ stringHandler: "markdown"
54788
+ });
54789
+ useImperativeHandle(ref2, () => getContext2(), [getContext2]);
54790
+ const handleChange = ({ helpers, state: state2 }) => {
54791
+ const markdown = helpers.getMarkdown();
54792
+ setState(state2);
54793
+ onChange(markdown);
54794
+ };
54795
+ return /* @__PURE__ */ jsx("div", {
54796
+ className: styles$e.richTextInput,
54797
+ children: /* @__PURE__ */ jsxs(Remirror, {
54798
+ manager,
54799
+ state,
54800
+ placeholder: placeholder3,
54801
+ onChange: handleChange,
54802
+ editable: !disabled2,
54803
+ children: [
54804
+ /* @__PURE__ */ jsx(RichTextToolbar, {
54805
+ disabled: disabled2
54806
+ }),
54807
+ /* @__PURE__ */ jsx(EditorComponent, {})
54808
+ ]
54809
+ })
54810
+ });
54811
+ }
54812
+ );
54814
54813
  RichTextInput.defaultProps = {
54815
54814
  disabled: false,
54816
54815
  onChange: null,