@hpcc-js/react 3.1.0 → 3.1.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.js +2 -2
- package/dist/index.js.map +4 -4
- package/package.json +3 -8
- package/src/ImageChar.tsx +2 -2
- package/src/__package__.ts +2 -2
- package/src/edge.tsx +1 -1
- package/src/icon.tsx +1 -1
- package/src/image.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/render.ts +12 -33
- package/src/shape.tsx +1 -1
- package/src/span.tsx +1 -1
- package/src/subgraph.tsx +1 -1
- package/src/text.tsx +5 -5
- package/src/vertex.tsx +1 -1
- package/src/vertex2.tsx +1 -1
- package/src/vertex3.tsx +1 -1
- package/src/vertex4.tsx +1 -1
- package/types/ImageChar.d.ts +1 -1
- package/types/__package__.d.ts +2 -2
- package/types/edge.d.ts +1 -1
- package/types/icon.d.ts +1 -1
- package/types/image.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/render.d.ts +5 -10
- package/types/shape.d.ts +1 -1
- package/types/span.d.ts +1 -1
- package/types/subgraph.d.ts +1 -1
- package/types/text.d.ts +1 -1
- package/types/vertex.d.ts +1 -1
- package/types/vertex2.d.ts +1 -1
- package/types/vertex3.d.ts +1 -1
- package/types/vertex4.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/react",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "hpcc-js - Viz React",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -39,12 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@hpcc-js/esbuild-plugins": "^1.3.0",
|
|
42
|
-
"
|
|
43
|
-
"react-dom": "18.3.1"
|
|
44
|
-
},
|
|
45
|
-
"peerDependencies": {
|
|
46
|
-
"react": "^17.0.0 || ^18.0.0",
|
|
47
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
42
|
+
"@hpcc-js/preact-shim": "^3.0.0"
|
|
48
43
|
},
|
|
49
44
|
"repository": {
|
|
50
45
|
"type": "git",
|
|
@@ -57,5 +52,5 @@
|
|
|
57
52
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
58
53
|
},
|
|
59
54
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
60
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "b4f63e027feea45ebdfc578ef9c85d107bd97322"
|
|
61
56
|
}
|
package/src/ImageChar.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useMemo } from "react";
|
|
2
1
|
import { Utility } from "@hpcc-js/common";
|
|
2
|
+
import * as React from "@hpcc-js/preact-shim";
|
|
3
3
|
|
|
4
4
|
export interface ImageCharProps {
|
|
5
5
|
x?: number;
|
|
@@ -24,7 +24,7 @@ export const ImageChar: React.FunctionComponent<ImageCharProps> = ({
|
|
|
24
24
|
fontWeight
|
|
25
25
|
}) => {
|
|
26
26
|
|
|
27
|
-
const renderChar = useMemo(() => {
|
|
27
|
+
const renderChar = React.useMemo(() => {
|
|
28
28
|
return fontFamily === "FontAwesome" ? Utility.faChar(char) : char;
|
|
29
29
|
}, [char, fontFamily]);
|
|
30
30
|
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const PKG_NAME = "@hpcc-js/react";
|
|
2
|
-
export const PKG_VERSION = "3.1.
|
|
3
|
-
export const BUILD_VERSION = "3.2.
|
|
2
|
+
export const PKG_VERSION = "3.1.1";
|
|
3
|
+
export const BUILD_VERSION = "3.2.1";
|
package/src/edge.tsx
CHANGED
package/src/icon.tsx
CHANGED
package/src/image.tsx
CHANGED
package/src/index.ts
CHANGED
package/src/render.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render as reactRender } from "react-dom";
|
|
3
|
-
import { createRoot, Root } from "react-dom/client";
|
|
4
1
|
import { HTMLWidget, SVGWidget } from "@hpcc-js/common";
|
|
2
|
+
import * as React from "@hpcc-js/preact-shim";
|
|
5
3
|
|
|
6
|
-
export function render<P>(C: React.FunctionComponent<P>, props: Readonly<P>, parent: Element | Document | ShadowRoot | DocumentFragment) {
|
|
7
|
-
|
|
8
|
-
reactRender(re, parent);
|
|
4
|
+
export function render<P>(C: React.FunctionComponent<P>, props: Readonly<P>, parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text) {
|
|
5
|
+
React.render(React.h(C, props), parent, replaceNode);
|
|
9
6
|
}
|
|
10
7
|
|
|
11
|
-
export
|
|
8
|
+
export interface FunctionComponent<T> extends React.FunctionComponent<T> {
|
|
9
|
+
}
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
export function svgRender<P>(C: React.FunctionComponent<P>, props: Readonly<P>, parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text) {
|
|
12
|
+
React.render(React.h("svg", null, React.h(C, props)), parent, replaceNode);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class HTMLAdapter<P> extends HTMLWidget {
|
|
14
16
|
|
|
15
17
|
props(): P;
|
|
16
18
|
props(_: Partial<P>): this;
|
|
@@ -32,19 +34,9 @@ export class HTMLAdapter<P> extends HTMLWidget {
|
|
|
32
34
|
super();
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
enter(domNode, element) {
|
|
36
|
-
super.enter(domNode, element);
|
|
37
|
-
this._root = createRoot(domNode);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
37
|
update(domNode, element) {
|
|
41
38
|
super.update(domNode, element);
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
exit(domNode, element) {
|
|
46
|
-
this._root.unmount();
|
|
47
|
-
super.exit(domNode, element);
|
|
39
|
+
render(this._component, this._props, domNode);
|
|
48
40
|
}
|
|
49
41
|
}
|
|
50
42
|
HTMLAdapter.prototype._class += " react_HTMLAdapter";
|
|
@@ -56,8 +48,6 @@ HTMLAdapter.prototype.publish("props", {}, "object", "Properties");
|
|
|
56
48
|
|
|
57
49
|
export class SVGAdapter<P> extends SVGWidget {
|
|
58
50
|
|
|
59
|
-
protected _root: Root;
|
|
60
|
-
|
|
61
51
|
props(): P;
|
|
62
52
|
props(_: Partial<P>): this;
|
|
63
53
|
props(_?: Partial<P>): P | this {
|
|
@@ -78,20 +68,9 @@ export class SVGAdapter<P> extends SVGWidget {
|
|
|
78
68
|
super();
|
|
79
69
|
}
|
|
80
70
|
|
|
81
|
-
_c2: React.ReactElement;
|
|
82
|
-
enter(domNode, element) {
|
|
83
|
-
super.enter(domNode, element);
|
|
84
|
-
this._root = createRoot(domNode);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
71
|
update(domNode, element) {
|
|
88
72
|
super.update(domNode, element);
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
exit(domNode, element) {
|
|
93
|
-
this._root.unmount();
|
|
94
|
-
super.exit(domNode, element);
|
|
73
|
+
render(this._component, this._props, domNode);
|
|
95
74
|
}
|
|
96
75
|
}
|
|
97
76
|
SVGAdapter.prototype._class += " react_SVGAdapter";
|
package/src/shape.tsx
CHANGED
package/src/span.tsx
CHANGED
package/src/subgraph.tsx
CHANGED
package/src/text.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Utility } from "@hpcc-js/common";
|
|
2
|
+
import * as React from "@hpcc-js/preact-shim";
|
|
3
3
|
import { Icon } from "./icon.tsx";
|
|
4
4
|
import { Rectangle } from "./shape.tsx";
|
|
5
5
|
|
|
@@ -21,10 +21,10 @@ export const TextLine: React.FunctionComponent<TextLineProps> = ({
|
|
|
21
21
|
fill = "black"
|
|
22
22
|
}) => {
|
|
23
23
|
return <text
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
font-family={fontFamily}
|
|
25
|
+
font-size={`${height}px`}
|
|
26
|
+
text-anchor={anchor}
|
|
27
|
+
dominant-baseline={baseline}
|
|
28
28
|
fill={fill}
|
|
29
29
|
>{text}</text>;
|
|
30
30
|
};
|
package/src/vertex.tsx
CHANGED
package/src/vertex2.tsx
CHANGED
package/src/vertex3.tsx
CHANGED
package/src/vertex4.tsx
CHANGED
package/types/ImageChar.d.ts
CHANGED
package/types/__package__.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const PKG_NAME = "@hpcc-js/react";
|
|
2
|
-
export declare const PKG_VERSION = "3.1.
|
|
3
|
-
export declare const BUILD_VERSION = "3.2.
|
|
2
|
+
export declare const PKG_VERSION = "3.1.1";
|
|
3
|
+
export declare const BUILD_VERSION = "3.2.1";
|
package/types/edge.d.ts
CHANGED
package/types/icon.d.ts
CHANGED
package/types/image.d.ts
CHANGED
package/types/index.d.ts
CHANGED
package/types/render.d.ts
CHANGED
|
@@ -1,34 +1,29 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Root } from "react-dom/client";
|
|
3
1
|
import { HTMLWidget, SVGWidget } from "@hpcc-js/common";
|
|
4
|
-
|
|
2
|
+
import * as React from "@hpcc-js/preact-shim";
|
|
3
|
+
export declare function render<P>(C: React.FunctionComponent<P>, props: Readonly<P>, parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text): void;
|
|
4
|
+
export interface FunctionComponent<T> extends React.FunctionComponent<T> {
|
|
5
|
+
}
|
|
6
|
+
export declare function svgRender<P>(C: React.FunctionComponent<P>, props: Readonly<P>, parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text): void;
|
|
5
7
|
export declare class HTMLAdapter<P> extends HTMLWidget {
|
|
6
8
|
protected readonly _component: React.FunctionComponent<P>;
|
|
7
|
-
protected _root: Root;
|
|
8
9
|
props(): P;
|
|
9
10
|
props(_: Partial<P>): this;
|
|
10
11
|
prop<K extends keyof P>(_: K): P[K];
|
|
11
12
|
prop<K extends keyof P>(_: K, value: P[K]): this;
|
|
12
13
|
constructor(_component: React.FunctionComponent<P>);
|
|
13
|
-
enter(domNode: any, element: any): void;
|
|
14
14
|
update(domNode: any, element: any): void;
|
|
15
|
-
exit(domNode: any, element: any): void;
|
|
16
15
|
}
|
|
17
16
|
export interface HTMLAdapter<P> {
|
|
18
17
|
_props: P;
|
|
19
18
|
}
|
|
20
19
|
export declare class SVGAdapter<P> extends SVGWidget {
|
|
21
20
|
protected readonly _component: React.FunctionComponent<P>;
|
|
22
|
-
protected _root: Root;
|
|
23
21
|
props(): P;
|
|
24
22
|
props(_: Partial<P>): this;
|
|
25
23
|
prop<K extends keyof P>(_: K): P[K];
|
|
26
24
|
prop<K extends keyof P>(_: K, value: P[K]): this;
|
|
27
25
|
constructor(_component: React.FunctionComponent<P>);
|
|
28
|
-
_c2: React.ReactElement;
|
|
29
|
-
enter(domNode: any, element: any): void;
|
|
30
26
|
update(domNode: any, element: any): void;
|
|
31
|
-
exit(domNode: any, element: any): void;
|
|
32
27
|
}
|
|
33
28
|
export interface SVGAdapter<P> {
|
|
34
29
|
_props: P;
|
package/types/shape.d.ts
CHANGED
package/types/span.d.ts
CHANGED
package/types/subgraph.d.ts
CHANGED
package/types/text.d.ts
CHANGED
package/types/vertex.d.ts
CHANGED
package/types/vertex2.d.ts
CHANGED
package/types/vertex3.d.ts
CHANGED
package/types/vertex4.d.ts
CHANGED