react-d3-cloud-modern 1.0.2 → 1.0.4

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/jest.config.js CHANGED
@@ -2,6 +2,9 @@ module.exports = {
2
2
  testEnvironment: 'jsdom',
3
3
  setupFilesAfterEnv: ['./test/jest-setup.ts'],
4
4
  testPathIgnorePatterns: ['/node_modules/', '/examples/', '/lib/'],
5
+ transformIgnorePatterns: [
6
+ '/node_modules/(?!(d3-|react-faux-dom)/)',
7
+ ],
5
8
  timers: 'fake',
6
9
  resetModules: true,
7
10
  resetMocks: true,
@@ -26,6 +26,6 @@ type WordCloudProps = {
26
26
  onWordMouseOver?: (this: BaseType, event: any, d: Word) => void;
27
27
  onWordMouseOut?: (this: BaseType, event: any, d: Word) => void;
28
28
  };
29
- declare function WordCloud({ data, width, height, font, fontStyle, fontWeight, fontSize, rotate, spiral, padding, random, fill, onWordClick, onWordMouseOver, onWordMouseOut, }: WordCloudProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
29
+ declare function WordCloud({ data, width, height, font, fontStyle, fontWeight, fontSize, rotate, spiral, padding, random, fill, onWordClick, onWordMouseOver, onWordMouseOut, }: WordCloudProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
30
30
  declare const _default: React.MemoExoticComponent<typeof WordCloud>;
31
31
  export default _default;
package/lib/WordCloud.js CHANGED
@@ -54,7 +54,7 @@ function WordCloud(_ref) {
54
54
  onWordClick = _ref.onWordClick,
55
55
  onWordMouseOver = _ref.onWordMouseOver,
56
56
  onWordMouseOut = _ref.onWordMouseOut;
57
- var elementRef = (0, _react.useRef)();
57
+ var elementRef = (0, _react.useRef)(null);
58
58
  if (!elementRef.current) {
59
59
  elementRef.current = _reactFauxDom["default"].createElement('div');
60
60
  }
@@ -26,6 +26,6 @@ type WordCloudProps = {
26
26
  onWordMouseOver?: (this: BaseType, event: any, d: Word) => void;
27
27
  onWordMouseOut?: (this: BaseType, event: any, d: Word) => void;
28
28
  };
29
- declare function WordCloud({ data, width, height, font, fontStyle, fontWeight, fontSize, rotate, spiral, padding, random, fill, onWordClick, onWordMouseOver, onWordMouseOut, }: WordCloudProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
29
+ declare function WordCloud({ data, width, height, font, fontStyle, fontWeight, fontSize, rotate, spiral, padding, random, fill, onWordClick, onWordMouseOver, onWordMouseOut, }: WordCloudProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
30
30
  declare const _default: React.MemoExoticComponent<typeof WordCloud>;
31
31
  export default _default;
@@ -54,7 +54,7 @@ function WordCloud(_ref) {
54
54
  onWordClick = _ref.onWordClick,
55
55
  onWordMouseOver = _ref.onWordMouseOver,
56
56
  onWordMouseOut = _ref.onWordMouseOut;
57
- var elementRef = (0, _react.useRef)();
57
+ var elementRef = (0, _react.useRef)(null);
58
58
  if (!elementRef.current) {
59
59
  elementRef.current = _reactFauxDom["default"].createElement('div');
60
60
  }
package/package.json CHANGED
@@ -1,14 +1,20 @@
1
1
  {
2
2
  "name": "react-d3-cloud-modern",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "A word cloud component using d3-cloud",
5
5
  "license": "MIT",
6
6
  "author": "cph",
7
7
  "homepage": "https://github.com/carlosalvidrez/react-d3-cloud-modern",
8
- "repository": "carlosalvidrez/react-d3-cloud-modern",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/carlosalvidrez/react-d3-cloud-modern.git"
11
+ },
9
12
  "bugs": {
10
13
  "url": "https://github.com/carlosalvidrez/react-d3-cloud-modern/issues"
11
14
  },
15
+ "overrides": {
16
+ "form-data": "^3.0.4"
17
+ },
12
18
  "exports": {
13
19
  "import": "./lib/esm/index.js",
14
20
  "require": "./lib/index.js"
@@ -43,8 +49,8 @@
43
49
  "react-faux-dom": "^4.5.0"
44
50
  },
45
51
  "peerDependencies": {
46
- "react": "^16.8.0 || ^17.0.0-0 || ^18.0.0-0",
47
- "react-dom": "^16.8.0 || ^17.0.0-0 || ^18.0.0-0"
52
+ "react": "^16.8.0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0",
53
+ "react-dom": "^16.8.0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0"
48
54
  },
49
55
  "devDependencies": {
50
56
  "@babel/cli": "^7.14.8",
@@ -56,13 +62,13 @@
56
62
  "@babel/preset-react": "^7.14.5",
57
63
  "@babel/preset-typescript": "^7.24.7",
58
64
  "@testing-library/jest-dom": "^5.14.1",
59
- "@testing-library/react": "^12.1.1",
65
+ "@testing-library/react": "^16.3.0",
60
66
  "@types/d3-cloud": "^1.2.5",
61
67
  "@types/d3-scale": "^4.0.1",
62
68
  "@types/d3-scale-chromatic": "^3.0.0",
63
69
  "@types/d3-selection": "^3.0.1",
64
70
  "@types/jest": "^27.0.1",
65
- "@types/react": "^17.0.80",
71
+ "@types/react": "^19.1.8",
66
72
  "@types/react-dom": "^18.3.0",
67
73
  "@types/react-faux-dom": "^4.1.5",
68
74
  "@typescript-eslint/eslint-plugin": "^4.29.3",
@@ -84,8 +90,8 @@
84
90
  "lint-staged": "^11.1.2",
85
91
  "prettier": "^2.3.2",
86
92
  "prettier-package-json": "^2.6.0",
87
- "react": "^16.14.0",
88
- "react-dom": "^16.14.0",
93
+ "react": "^19.1.0",
94
+ "react-dom": "^19.1.0",
89
95
  "regenerator-runtime": "^0.13.9",
90
96
  "rimraf": "^3.0.2",
91
97
  "typescript": "^4.4.2"
package/src/WordCloud.tsx CHANGED
@@ -62,7 +62,7 @@ function WordCloud({
62
62
  onWordMouseOver,
63
63
  onWordMouseOut,
64
64
  }: WordCloudProps) {
65
- const elementRef = useRef<ReactFauxDom.Element>();
65
+ const elementRef = useRef<ReactFauxDom.Element | null>(null);
66
66
 
67
67
  if (!elementRef.current) {
68
68
  elementRef.current = ReactFauxDom.createElement('div');