@wavv/ui 2.3.7 → 2.3.9

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.
@@ -24,6 +24,8 @@ type Props = {
24
24
  supportedFormats?: string[];
25
25
  /** Maximum file size string to display (e.g., '25MB') */
26
26
  maxFileSize?: string;
27
+ /** Controlled array of files */
28
+ files?: DropZoneFile[];
27
29
  /** Callback when files are added. */
28
30
  onFilesAdded?: (files: DropZoneFile[]) => void;
29
31
  /** Callback when files are removed. */
@@ -44,5 +46,5 @@ type Props = {
44
46
  defaultCamera?: FileTriggerProps['defaultCamera'];
45
47
  acceptDirectory?: FileTriggerProps['acceptDirectory'];
46
48
  } & MarginPadding & WidthHeight & Omit<DropZoneProps, 'isDisabled' | 'children'> & Omit<FileTriggerProps, 'children' | 'onSelect'>;
47
- declare const DropZone: ({ label, showFileList, disabled, invalid, errorMessage, supportedFormats, maxFileSize, acceptedFileTypes, allowsMultiple, defaultCamera, acceptDirectory, onDrop, onFilesAdded, onFilesRemoved, width, margin, marginTop, marginRight, marginBottom, marginLeft, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
49
+ declare const DropZone: ({ label, showFileList, disabled, invalid, errorMessage, supportedFormats, maxFileSize, files: controlledFiles, acceptedFileTypes, allowsMultiple, defaultCamera, acceptDirectory, onDrop, onFilesAdded, onFilesRemoved, width, margin, marginTop, marginRight, marginBottom, marginLeft, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
48
50
  export default DropZone;
@@ -6,8 +6,10 @@ import matchesFileTypes from "../utils/matchesFileTypes.js";
6
6
  import Button from "./Button/index.js";
7
7
  import FileTrigger from "./FileTrigger.js";
8
8
  import { marginProps, paddingProps, widthHeightProps } from "./helpers/styledProps.js";
9
- const DropZone_DropZone = ({ label = 'Drop here', showFileList = true, disabled, invalid, errorMessage, supportedFormats, maxFileSize, acceptedFileTypes, allowsMultiple, defaultCamera, acceptDirectory, onDrop, onFilesAdded, onFilesRemoved, width, margin, marginTop, marginRight, marginBottom, marginLeft, ...rest })=>{
10
- const [files, setFiles] = useState([]);
9
+ const DropZone_DropZone = ({ label = 'Drop here', showFileList = true, disabled, invalid, errorMessage, supportedFormats, maxFileSize, files: controlledFiles, acceptedFileTypes, allowsMultiple, defaultCamera, acceptDirectory, onDrop, onFilesAdded, onFilesRemoved, width, margin, marginTop, marginRight, marginBottom, marginLeft, ...rest })=>{
10
+ const [internalFiles, setInternalFiles] = useState([]);
11
+ const isControlled = void 0 !== controlledFiles;
12
+ const files = isControlled ? controlledFiles : internalFiles;
11
13
  const [sizeValidationError, setSizeValidationError] = useState(null);
12
14
  const [typeValidationError, setTypeValidationError] = useState(null);
13
15
  const instanceId = useId();
@@ -64,7 +66,7 @@ const DropZone_DropZone = ({ label = 'Drop here', showFileList = true, disabled,
64
66
  ...files,
65
67
  ...newEntries
66
68
  ] : newEntries;
67
- setFiles(updatedFiles);
69
+ if (!isControlled) setInternalFiles(updatedFiles);
68
70
  onFilesAdded?.(newEntries);
69
71
  };
70
72
  const handleFileDrop = async (event)=>{
@@ -99,7 +101,7 @@ const DropZone_DropZone = ({ label = 'Drop here', showFileList = true, disabled,
99
101
  const handleRemoveFile = (id)=>{
100
102
  const removedFile = files.find((file)=>file.id === id);
101
103
  const updatedFiles = files.filter((file)=>file.id !== id);
102
- setFiles(updatedFiles);
104
+ if (!isControlled) setInternalFiles(updatedFiles);
103
105
  if (removedFile) onFilesRemoved?.([
104
106
  removedFile
105
107
  ]);
@@ -18,7 +18,12 @@ import RichTextToolbar from "./RichTextToolbar.js";
18
18
  const createEditorContent = (value, fields, displayValue = false)=>{
19
19
  if (!value) return {
20
20
  type: 'doc',
21
- content: []
21
+ content: [
22
+ {
23
+ type: 'paragraph',
24
+ content: []
25
+ }
26
+ ]
22
27
  };
23
28
  if ('object' == typeof value && value.type) {
24
29
  if (fields && fields.length > 0) return parseJSONToDocument(value, fields, displayValue);
@@ -43,7 +48,12 @@ const createEditorContent = (value, fields, displayValue = false)=>{
43
48
  }
44
49
  return {
45
50
  type: 'doc',
46
- content: []
51
+ content: [
52
+ {
53
+ type: 'paragraph',
54
+ content: []
55
+ }
56
+ ]
47
57
  };
48
58
  };
49
59
  const Editor = ({ value, textValue, onChange, onTextChange, onDirtyChange, onEnterKey, onFocus, onBlur, mergeFields = [], placeholder = 'Text...', description, invalid, width, height, maxHeight, noPadding = false, readOnly = false, interactiveTaskItems = false, displayMergedValues = false, color, overflow, clampLines, label, disabled, borderRadius, backgroundColor, fontSize, textOnly, showToolbarOptions = false, maxLength, margin, marginLeft, marginRight, marginTop, marginBottom, padding, paddingLeft, paddingRight, paddingTop, paddingBottom, ref, className, ...rest })=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavv/ui",
3
- "version": "2.3.7",
3
+ "version": "2.3.9",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -31,22 +31,22 @@
31
31
  "@emotion/styled": "^11.14.1",
32
32
  "@internationalized/date": "3.10.0",
33
33
  "@react-hook/resize-observer": "^2.0.2",
34
- "@tiptap/core": "^3.11.1",
35
- "@tiptap/extension-character-count": "^3.11.1",
36
- "@tiptap/extension-highlight": "^3.11.1",
37
- "@tiptap/extension-placeholder": "^3.11.1",
38
- "@tiptap/extension-task-item": "^3.11.1",
39
- "@tiptap/extension-task-list": "^3.11.1",
40
- "@tiptap/markdown": "^3.11.1",
41
- "@tiptap/pm": "^3.11.1",
42
- "@tiptap/react": "^3.11.1",
43
- "@tiptap/starter-kit": "^3.11.1",
34
+ "@tiptap/core": "^3.13.0",
35
+ "@tiptap/extension-character-count": "^3.13.0",
36
+ "@tiptap/extension-highlight": "^3.13.0",
37
+ "@tiptap/extension-placeholder": "^3.13.0",
38
+ "@tiptap/extension-task-item": "^3.13.0",
39
+ "@tiptap/extension-task-list": "^3.13.0",
40
+ "@tiptap/markdown": "^3.13.0",
41
+ "@tiptap/pm": "^3.13.0",
42
+ "@tiptap/react": "^3.13.0",
43
+ "@tiptap/starter-kit": "^3.13.0",
44
44
  "cmdk": "^1.1.1",
45
45
  "date-fns": "^4.1.0",
46
46
  "draft-js": "^0.11.7",
47
47
  "es-toolkit": "^1.42.0",
48
- "libphonenumber-js": "^1.12.30",
49
- "lucide-react": "^0.555.0",
48
+ "libphonenumber-js": "^1.12.31",
49
+ "lucide-react": "^0.556.0",
50
50
  "polished": "^4.1.4",
51
51
  "prism-react-renderer": "^2.4.1",
52
52
  "react-aria": "3.44.0",
@@ -65,13 +65,13 @@
65
65
  "@chromatic-com/storybook": "^4.1.3",
66
66
  "@emotion/babel-plugin": "^11.13.5",
67
67
  "@emotion/react": "^11.14.0",
68
- "@rsbuild/core": "1.6.11",
68
+ "@rsbuild/core": "1.6.12",
69
69
  "@rsbuild/plugin-react": "^1.4.2",
70
70
  "@rsbuild/plugin-svgr": "^1.2.2",
71
- "@rslib/core": "^0.18.2",
72
- "@storybook/addon-docs": "^10.1.2",
73
- "@storybook/addon-links": "^10.1.2",
74
- "@storybook/addon-themes": "^10.1.2",
71
+ "@rslib/core": "^0.18.3",
72
+ "@storybook/addon-docs": "^10.1.4",
73
+ "@storybook/addon-links": "^10.1.4",
74
+ "@storybook/addon-themes": "^10.1.4",
75
75
  "@storybook/test-runner": "^0.24.2",
76
76
  "@svgr/core": "^8.1.0",
77
77
  "@svgr/plugin-jsx": "^8.1.0",
@@ -91,21 +91,21 @@
91
91
  "change-case": "^5.4.4",
92
92
  "chromatic": "^13.3.4",
93
93
  "jest": "^30.2.0",
94
- "lefthook": "^2.0.4",
94
+ "lefthook": "^2.0.8",
95
95
  "ncp": "^2.0.0",
96
96
  "path": "^0.12.7",
97
97
  "phone": "^3.1.67",
98
98
  "playwright": "^1.57.0",
99
99
  "postcss": "^8.5.6",
100
- "prettier": "^3.7.3",
100
+ "prettier": "^3.7.4",
101
101
  "prompts": "^2.4.2",
102
102
  "randomcolor": "^0.6.2",
103
- "react": "^19.2.0",
104
- "react-dom": "^19.2.0",
103
+ "react": "^19.2.1",
104
+ "react-dom": "^19.2.1",
105
105
  "replace": "^1.2.2",
106
106
  "signale": "^1.4.0",
107
- "storybook": "^10.1.2",
108
- "storybook-react-rsbuild": "^3.0.0",
107
+ "storybook": "^10.1.4",
108
+ "storybook-react-rsbuild": "^3.1.0",
109
109
  "tsc-files": "^1.1.4",
110
110
  "tslib": "^2.8.1",
111
111
  "tsx": "^4.21.0",