pixelize-design-library 2.2.39 → 2.2.41

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.
@@ -33,6 +33,23 @@ function ButtonGroupIcon(_a) {
33
33
  rightIconDropdown = _a.rightIconDropdown, menulistStyle = _a.menulistStyle, menuItemStyle = _a.menuItemStyle, isLoading = _a.isLoading, _d = _a.divider, divider = _d === void 0 ? true : _d;
34
34
  var theme = (0, useCustomTheme_1.useCustomTheme)();
35
35
  var _e = (0, react_1.useState)(false), isDropdownOpen = _e[0], setIsDropdownOpen = _e[1];
36
+ var textRef = (0, react_1.useRef)(null);
37
+ var _f = (0, react_1.useState)(false), isTextTruncated = _f[0], setIsTextTruncated = _f[1];
38
+ (0, react_1.useEffect)(function () {
39
+ var checkTruncation = function () {
40
+ if (textRef.current) {
41
+ var isTruncated = textRef.current.scrollWidth > textRef.current.clientWidth;
42
+ setIsTextTruncated(isTruncated);
43
+ }
44
+ };
45
+ // Use setTimeout to ensure DOM is fully rendered
46
+ var timeoutId = setTimeout(checkTruncation, 0);
47
+ window.addEventListener("resize", checkTruncation);
48
+ return function () {
49
+ clearTimeout(timeoutId);
50
+ window.removeEventListener("resize", checkTruncation);
51
+ };
52
+ }, [buttonText]);
36
53
  var handleRightIconClick = function () {
37
54
  setIsDropdownOpen(!isDropdownOpen);
38
55
  if (onRightIconClick) {
@@ -53,12 +70,14 @@ function ButtonGroupIcon(_a) {
53
70
  backgroundColor: theme.colors.primary[400],
54
71
  },
55
72
  } })),
56
- react_1.default.createElement(react_2.Button, { onClick: onButtonClick, style: buttonStyle, isLoading: isLoading, sx: {
57
- backgroundColor: theme.colors.primary[500],
58
- "&:hover": {
59
- backgroundColor: theme.colors.primary[400],
60
- },
61
- }, borderLeft: "1px solid ".concat((_b = theme.colors) === null || _b === void 0 ? void 0 : _b.gray[300]), borderRight: "1px solid ".concat((_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray[300]) }, buttonText),
73
+ react_1.default.createElement(react_2.Tooltip, { label: buttonText, isDisabled: !buttonText || !isTextTruncated },
74
+ react_1.default.createElement(react_2.Button, { onClick: onButtonClick, style: buttonStyle, isLoading: isLoading, sx: {
75
+ backgroundColor: theme.colors.primary[500],
76
+ "&:hover": {
77
+ backgroundColor: theme.colors.primary[400],
78
+ },
79
+ }, borderLeft: "1px solid ".concat((_b = theme.colors) === null || _b === void 0 ? void 0 : _b.gray[300]), borderRight: "1px solid ".concat((_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray[300]), maxW: "200px" },
80
+ react_1.default.createElement(react_2.Box, { ref: textRef, as: "span", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", display: "block", width: "100%" }, buttonText))),
62
81
  rightIcon && rightIconDropdown ? (react_1.default.createElement(react_2.Menu, { isOpen: isDropdownOpen, onClose: function () { return setIsDropdownOpen(false); } },
63
82
  react_1.default.createElement(react_2.MenuButton, { as: react_2.IconButton, "aria-label": "Right icon button", icon: rightIcon, onClick: handleRightIconClick, onBlur: onBlurRightIcon, style: buttonGroupRightIconStyle, sx: {
64
83
  backgroundColor: theme.colors.primary[500],
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import { EditorProps } from "./EditorProps";
3
- export default function Editor({ value, config, editorRef, className, onChange, onBlur, }: EditorProps): React.JSX.Element;
3
+ export default function Editor({ value, key, config, editorRef, className, onChange, onBlur, }: EditorProps): React.JSX.Element;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var react_1 = __importDefault(require("react"));
7
7
  var jodit_react_1 = __importDefault(require("jodit-react"));
8
8
  function Editor(_a) {
9
- var value = _a.value, config = _a.config, editorRef = _a.editorRef, className = _a.className, onChange = _a.onChange, onBlur = _a.onBlur;
10
- return (react_1.default.createElement(jodit_react_1.default, { config: config, value: value, ref: editorRef, className: className, onChange: onChange, onBlur: onBlur }));
9
+ var value = _a.value, key = _a.key, config = _a.config, editorRef = _a.editorRef, className = _a.className, onChange = _a.onChange, onBlur = _a.onBlur;
10
+ return (react_1.default.createElement(jodit_react_1.default, { key: key, config: config, value: value, ref: editorRef, className: className, onChange: onChange, onBlur: onBlur }));
11
11
  }
12
12
  exports.default = Editor;
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
2
- import { IJoditEditorProps } from "jodit-react";
3
- export type EditorProps = Pick<IJoditEditorProps, "value" | "config" | "className" | "onChange" | "onBlur"> & {
1
+ import JoditEditor from "jodit-react";
2
+ import type { ComponentProps } from "react";
3
+ export type EditorProps = Pick<ComponentProps<typeof JoditEditor>, "value" | "config" | "className" | "onChange" | "onBlur"> & {
4
4
  editorRef?: React.RefObject<any>;
5
+ key?: string | number;
5
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "2.2.39",
3
+ "version": "2.2.41",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -9,15 +9,15 @@
9
9
  "@chakra-ui/react": "^2.8.2",
10
10
  "@hello-pangea/dnd": "^18.0.1",
11
11
  "framer-motion": "^11.2.2",
12
- "jodit-react": "^4.1.2",
12
+ "jodit-react": "^5.2.38",
13
13
  "lucide-react": "^0.487.0",
14
14
  "react": "^18.3.1",
15
15
  "react-apexcharts": "^1.4.1",
16
16
  "react-datepicker": "^7.3.0",
17
17
  "react-dom": "^18.3.1",
18
+ "react-dropzone": "^14.3.8",
18
19
  "react-scripts": "^5.0.1",
19
- "react-window": "^1.8.11",
20
- "react-dropzone": "^14.3.8"
20
+ "react-window": "^1.8.11"
21
21
  },
22
22
  "scripts": {
23
23
  "start": "react-scripts start",