@oliasoft-open-source/react-ui-library 5.13.0-beta-1 → 5.13.1-beta-1

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.d.ts CHANGED
@@ -8,10 +8,12 @@ import { ElementType as ElementType_2 } from 'react';
8
8
  import { FC } from 'react';
9
9
  import { FocusEvent as FocusEvent_2 } from 'react';
10
10
  import { FocusEventHandler } from 'react';
11
+ import { ForwardRefExoticComponent } from 'react';
11
12
  import { Id } from 'react-toastify';
12
13
  import { JSX as JSX_2 } from 'react/jsx-runtime';
13
14
  import { KeyboardEvent as KeyboardEvent_2 } from 'react';
14
15
  import { KeyboardEventHandler } from 'react';
16
+ import { MemoExoticComponent } from 'react';
15
17
  import { MouseEvent as MouseEvent_2 } from 'react';
16
18
  import { MouseEventHandler } from 'react';
17
19
  import { MutableRefObject } from 'react';
@@ -21,6 +23,7 @@ import { Property } from 'csstype';
21
23
  import { ReactElement } from 'react';
22
24
  import { ReactNode } from 'react';
23
25
  import { ReactPortal } from 'react';
26
+ import { RefAttributes } from 'react';
24
27
  import { RefObject } from 'react';
25
28
  import { ToastContainer as Toaster } from 'react-toastify';
26
29
 
@@ -1956,7 +1959,7 @@ export declare const RadioButton: ({ name, label: rawLabel, options: rawOptions,
1956
1959
 
1957
1960
  export declare const readFile: (file?: Blob, method?: TFileReaderMethod) => Promise<string | ArrayBuffer | null>;
1958
1961
 
1959
- export declare const RichTextInput: default_2.ForwardRefExoticComponent<IRichTextInputProps & default_2.RefAttributes<any>>;
1962
+ export declare const RichTextInput: MemoExoticComponent<ForwardRefExoticComponent<IRichTextInputProps & RefAttributes<any>>>;
1960
1963
 
1961
1964
  export declare const Row: ({ alignItems, justifyContent, children, flex, height, marginBottom, marginTop, spacing: spacingProp, wrap, testId, }: IRowProps) => JSX_2.Element;
1962
1965
 
package/dist/index.js CHANGED
@@ -6061,9 +6061,9 @@ var rich_text_input_module_default = {
6061
6061
  hideScrollbars: "_hideScrollbars_1fb4l_67",
6062
6062
  richTextInput: "_richTextInput_1fb4l_77"
6063
6063
  };
6064
- const RichTextInput = forwardRef(({ placeholder: e, onChange: t, value: n, disabled: r, toolbarComponent: i }, a) => {
6065
- let o = useContext(DisabledContext), c = r || o, { manager: u, state: d, setState: f, getContext: p } = useRemirror({
6066
- extensions: () => [
6064
+ const RichTextInput = memo(forwardRef(({ placeholder: e, onChange: t, value: n, disabled: r, toolbarComponent: i }, a) => {
6065
+ let c = useContext(DisabledContext), u = r || c, { manager: d, state: f, setState: p, getContext: m } = useRemirror({
6066
+ extensions: useCallback(() => [
6067
6067
  new BoldExtension({}),
6068
6068
  new BulletListExtension({}),
6069
6069
  new CodeExtension(),
@@ -6071,29 +6071,29 @@ const RichTextInput = forwardRef(({ placeholder: e, onChange: t, value: n, disab
6071
6071
  new MarkdownExtension({}),
6072
6072
  new OrderedListExtension(),
6073
6073
  new PlaceholderExtension({ placeholder: e })
6074
- ],
6074
+ ], [e]),
6075
6075
  content: n,
6076
6076
  selection: "start",
6077
6077
  stringHandler: "markdown"
6078
6078
  });
6079
- return useImperativeHandle(a, () => p(), [p]), /* @__PURE__ */ jsx("div", {
6079
+ return useImperativeHandle(a, () => m(), [m]), /* @__PURE__ */ jsx("div", {
6080
6080
  className: rich_text_input_module_default.richTextInput,
6081
6081
  children: /* @__PURE__ */ jsxs(Remirror, {
6082
- manager: u,
6083
- state: d,
6082
+ manager: d,
6083
+ state: f,
6084
6084
  placeholder: e,
6085
6085
  onChange: ({ helpers: e, state: n }) => {
6086
6086
  let r = e.getMarkdown(n);
6087
- t && t(r), f(n);
6087
+ t && t(r), p(n);
6088
6088
  },
6089
- editable: !c,
6089
+ editable: !u,
6090
6090
  children: [/* @__PURE__ */ jsx(RichTextToolbar, {
6091
- disabled: c,
6091
+ disabled: u,
6092
6092
  toolbarComponent: i
6093
6093
  }), /* @__PURE__ */ jsx(EditorComponent, {})]
6094
6094
  })
6095
6095
  });
6096
- });
6096
+ }));
6097
6097
  var row_module_default = { row: "_row_n16je_1" };
6098
6098
  const Row = ({ alignItems: t = "initial", justifyContent: n = "initial", children: r = null, flex: a = !1, height: o = "auto", marginBottom: s = "0", marginTop: c = "0", spacing: l = "var(--padding)", wrap: u = !1, testId: d = null }) => {
6099
6099
  let f = typeof l == "number" ? `${l}px` : l, p = (r === null || r === !1 ? [] : Array.isArray(r) ? r.filter((e) => isValidElement(e)) : [r]).map((t, n) => /* @__PURE__ */ jsx(React.Fragment, { children: React.cloneElement(t, { spacing: f }) }, n));
@@ -8703,7 +8703,10 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
8703
8703
  if (r) return r;
8704
8704
  }
8705
8705
  return "";
8706
- }, toText = (e) => Array.isArray(e) ? e.length === 0 ? "" : e.some((e) => e && typeof e == "object") ? "Multiple changes..." : String(e) : e && typeof e == "object" ? Object.keys(e).length === 0 ? "" : "Multiple changes..." : String(e), defaultMessage = (e) => {
8706
+ }, toText = (e) => {
8707
+ let t = (e) => isValueWithUnit(e) ? withPrettyUnitLabel(e) : String(e);
8708
+ return Array.isArray(e) ? e.length === 0 ? "" : e.some((e) => e && typeof e == "object") ? "Multiple changes..." : e.map(t).join(", ") : e && typeof e == "object" ? Object.keys(e).length === 0 ? "" : "Multiple changes..." : t(e);
8709
+ }, defaultMessage = (e) => {
8707
8710
  switch (e.length) {
8708
8711
  case 1: {
8709
8712
  let [t] = e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "5.13.0-beta-1",
3
+ "version": "5.13.1-beta-1",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {
@@ -162,8 +162,8 @@
162
162
  "lint:fix": "eslint --fix \"**/*.{js,jsx,ts,tsx}\"",
163
163
  "prettier:check": "prettier --check \"**/*.{js,jsx,json,css,less,ts,tsx}\"",
164
164
  "prettier:fix": "prettier --write \"**/*.{js,jsx,json,css,less,ts,tsx}\"",
165
- "preview:docs": "pnpm build:docs && pnpm run http-server ./public -o -p 9002 -c-1",
166
- "preview:storybook": "pnpm run http-server ./public/storybook -o -p 9003 -c-1",
165
+ "preview:docs": "pnpm build:docs && pnpm exec http-server ./public -o -p 9002 -c-1",
166
+ "preview:storybook": "pnpm exec http-server ./public/storybook -o -p 9003 -c-1",
167
167
  "test": "pnpm run prettier:check && pnpm run lint:check && pnpm run test:unit",
168
168
  "test:unit": "vitest run",
169
169
  "test:unit:coverage": "vitest run --coverage",