@buerli.io/react-cad 0.0.22 → 0.0.23-beta.0
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/build/components/UI/CAD/Messages/BlankDiv.d.ts +6 -0
- package/build/components/UI/CAD/Messages/Message.d.ts +5 -0
- package/build/components/UI/CAD/Messages/Messages.d.ts +9 -0
- package/build/components/UI/CAD/Messages/index.d.ts +1 -0
- package/build/components/UI/CAD/Messages/msgStore.d.ts +17 -0
- package/build/components/UI/CAD/SideBar/FeatureList/Feature.d.ts +1 -1
- package/build/components/UI/CAD/SideBar/FeatureList/utils.d.ts +1 -0
- package/build/components/UI/CAD/common/primitives.d.ts +4 -1
- package/build/index.cjs.js +1584 -793
- package/build/index.js +1582 -791
- package/build/plugins/Dimensions/index.d.ts +1 -1
- package/build/plugins/Sketch/Root/Details.d.ts +2 -0
- package/build/plugins/Sketch/Root/useMenuItems.d.ts +5 -0
- package/build/plugins/Sketch/View/graphics/Merged/Arc.d.ts +9 -0
- package/build/plugins/Sketch/View/graphics/Merged/Line.d.ts +10 -0
- package/build/plugins/Sketch/View/graphics/Merged/MergedWrapper.d.ts +11 -0
- package/build/plugins/Sketch/View/graphics/Merged/Point.d.ts +8 -0
- package/build/plugins/Sketch/View/graphics/graphics.d.ts +1 -2
- package/build/plugins/Sketch/View/graphics/hooks.d.ts +3 -1
- package/build/plugins/Sketch/View/graphics/primitives.d.ts +3 -3
- package/build/plugins/Sketch/View/graphics/scale.d.ts +4 -0
- package/build/plugins/Sketch/View/handlers/Handlers.d.ts +2 -0
- package/build/plugins/Sketch/View/handlers/UseRef.d.ts +3 -0
- package/build/plugins/Sketch/types.d.ts +1 -0
- package/build/plugins/Sketch/utils/Interaction.d.ts +4 -0
- package/build/utils/FileUtils.d.ts +1 -1
- package/build/utils/helpers.d.ts +2 -0
- package/package.json +9 -8
- package/build/plugins/Sketch/Root/UseRef.d.ts +0 -2
|
@@ -13,6 +13,6 @@ declare const Plugin: {
|
|
|
13
13
|
drawingId: string | number;
|
|
14
14
|
pluginId: string | number;
|
|
15
15
|
}>;
|
|
16
|
-
description: import("@buerli.io/core/build/store/states/plugin").PluginDescription<any>;
|
|
16
|
+
description: import("@buerli.io/core/build/types/store/states/plugin").PluginDescription<any>;
|
|
17
17
|
};
|
|
18
18
|
export { Plugin };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'antd/dist/antd.css';
|
|
3
|
+
import { DrawingID, ObjectID, PluginID } from '@buerli.io/core';
|
|
4
|
+
import { MenuItems } from '../../../components/UI/CAD/common/Menu';
|
|
5
|
+
export declare function useMenuItems(drawingId: DrawingID, pluginId: PluginID, objectId: ObjectID, setRename: React.Dispatch<React.SetStateAction<boolean>>): MenuItems;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { commonProps } from '../primitives';
|
|
4
|
+
export declare const Line: React.FC<{
|
|
5
|
+
start: THREE.Vector3;
|
|
6
|
+
end: THREE.Vector3;
|
|
7
|
+
width?: number;
|
|
8
|
+
notInteractive?: boolean;
|
|
9
|
+
scalePlus?: boolean;
|
|
10
|
+
} & commonProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const MeshContext: React.Context<{
|
|
3
|
+
Cylinder: any;
|
|
4
|
+
Sphere: any;
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* Component which implements InstancedMesh from three.js.
|
|
8
|
+
* Merged component from drei takes globaly created meshes and then passes corresponding "mocked" components via function props (Box and Sphere) to children.
|
|
9
|
+
* "mocked" components are used for saying drei where to draw instances.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MergedWrapper: React.FC;
|
|
@@ -2,6 +2,8 @@ import { IStructureObject, DrawingID, ObjectID } from '@buerli.io/core';
|
|
|
2
2
|
export declare const useGeomParams: (objId: ObjectID) => {
|
|
3
3
|
renderOrder: number;
|
|
4
4
|
polygonOffsetUnits: number;
|
|
5
|
+
isHovered: boolean;
|
|
6
|
+
isSelected: boolean;
|
|
5
7
|
};
|
|
6
8
|
declare type ObjState = {
|
|
7
9
|
isSketchActive: boolean;
|
|
@@ -22,7 +24,7 @@ export declare const useUserData: (objId: ObjectID) => {
|
|
|
22
24
|
export declare const useHandlersAndColor: (drawingId: DrawingID, objId: ObjectID) => {
|
|
23
25
|
handlers: {
|
|
24
26
|
[key: string]: (e: PointerEvent & import("@react-three/fiber/dist/declarations/src/core/events").IntesectionEvent<PointerEvent> & import("../../types").PointerEventsT) => void;
|
|
25
|
-
}
|
|
27
|
+
};
|
|
26
28
|
color: number;
|
|
27
29
|
};
|
|
28
30
|
export {};
|
|
@@ -5,8 +5,7 @@ export declare const pointSize = 0.5;
|
|
|
5
5
|
export declare const arcWidth = 0.2;
|
|
6
6
|
export declare const radSegments = 32;
|
|
7
7
|
export declare const tubeSegments = 6;
|
|
8
|
-
declare type commonProps = {
|
|
9
|
-
scale?: number;
|
|
8
|
+
export declare type commonProps = {
|
|
10
9
|
materialProps?: JSX.IntrinsicElements['meshBasicMaterial'];
|
|
11
10
|
meshProps?: JSX.IntrinsicElements['mesh'];
|
|
12
11
|
};
|
|
@@ -39,10 +38,11 @@ export declare const Arc: React.FC<{
|
|
|
39
38
|
center: THREE.Vector3;
|
|
40
39
|
clockwise: boolean;
|
|
41
40
|
width?: number;
|
|
41
|
+
scale?: number;
|
|
42
42
|
} & commonProps>;
|
|
43
43
|
export declare const Circle: React.FC<{
|
|
44
44
|
center: THREE.Vector3;
|
|
45
45
|
radius: number;
|
|
46
46
|
width?: number;
|
|
47
|
+
scale?: number;
|
|
47
48
|
} & commonProps>;
|
|
48
|
-
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function setScale(newScale: number): void;
|
|
3
|
+
export declare function getScale(): number;
|
|
4
|
+
export declare function useScale(getVector?: (sf: number) => [number, number, number]): React.MutableRefObject<import("three").Object3D | undefined>;
|
|
@@ -8,6 +8,7 @@ import { DrawRectangle } from './DrawRectangle';
|
|
|
8
8
|
import { DrawCircle } from './DrawCircle';
|
|
9
9
|
import { Fillet } from './Fillet';
|
|
10
10
|
import { Trim } from './Trim';
|
|
11
|
+
import { UseRef } from './UseRef';
|
|
11
12
|
export declare const Handlers: {
|
|
12
13
|
createAngle: typeof CreateAngle;
|
|
13
14
|
drag: typeof Drag;
|
|
@@ -17,6 +18,7 @@ export declare const Handlers: {
|
|
|
17
18
|
drawRectangle: typeof DrawRectangle;
|
|
18
19
|
fillet: typeof Fillet;
|
|
19
20
|
trim: typeof Trim;
|
|
21
|
+
useReference: typeof UseRef;
|
|
20
22
|
drawArcCenter: (drawingId: DrawingID, pluginId: PluginID) => import("../../types").Handler;
|
|
21
23
|
drawArcMidlde: (drawingId: DrawingID, pluginId: PluginID) => import("../../types").Handler;
|
|
22
24
|
drawArcTangent: (drawingId: DrawingID, pluginId: PluginID) => import("../../types").Handler;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DrawingID, PluginID, ObjectID } from '@buerli.io/core';
|
|
2
|
+
export declare const hover: (drawingId: DrawingID, pluginId: PluginID, hoveredId: ObjectID) => void;
|
|
3
|
+
export declare const unhover: (drawingId: DrawingID, pluginId: PluginID, hoveredId: ObjectID) => void;
|
|
4
|
+
export declare const select: (drawingId: DrawingID, pluginId: PluginID, selectedId: ObjectID) => void;
|
|
@@ -13,6 +13,6 @@ export declare const FileUtils: {
|
|
|
13
13
|
loadFile: (onLoad: (files: {
|
|
14
14
|
file: File;
|
|
15
15
|
content: any;
|
|
16
|
-
}[]) => void, type?: "
|
|
16
|
+
}[]) => void, type?: "Text" | "DataURL" | "ArrayBuffer" | "BinaryString" | undefined, multiple?: boolean | undefined) => void;
|
|
17
17
|
exportNode: (drawingId: DrawingID, objectId: ObjectID, type?: 'of1' | 'stp' | 'stl') => Promise<void>;
|
|
18
18
|
};
|
package/build/utils/helpers.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare const angleVecVec: (a: THREE.Vector3, b: THREE.Vector3) => number
|
|
|
18
18
|
export declare const calculateTangent: (tree: IStructureTree, object: IStructureObject & WithMembers & WithChildren, point: THREE.Vector3) => THREE.Vector3 | undefined;
|
|
19
19
|
export declare function getDescendants(tree: IStructureTree, objectId: ObjectID): number[];
|
|
20
20
|
export declare function getAncestorIdByClass(drawingId: DrawingID, objectId: ObjectID, parentClass: CCClasses): number | null;
|
|
21
|
+
export declare const isSketchGeometry: (arg: IStructureObject | CCClasses) => boolean;
|
|
21
22
|
export declare const is2DConstraint: (arg: IStructureObject | CCClasses) => boolean;
|
|
22
23
|
export declare const degreesToRadians: (degrees: number) => number;
|
|
23
24
|
export declare const radiansToDegrees: (radians: number) => number;
|
|
@@ -32,3 +33,4 @@ export declare function rgbToHex(color: {
|
|
|
32
33
|
b: number;
|
|
33
34
|
}): string;
|
|
34
35
|
export declare function fmod(num: number, denom: number): number;
|
|
36
|
+
export declare function numberToHexColor(color: number): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buerli.io/react-cad",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23-beta.0",
|
|
4
4
|
"description": "buerli CAD components",
|
|
5
5
|
"author": "AWV Informatik AG <info@awv-informatik.ch>",
|
|
6
6
|
"repository": {},
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "rimraf ./build && rollup -c",
|
|
16
16
|
"postbuild": "tsc --emitDeclarationOnly",
|
|
17
|
-
"test": "jest",
|
|
17
|
+
"test": "jest --silent",
|
|
18
|
+
"testVerbose": "jest",
|
|
18
19
|
"lint": "eslint \"./src/**/*.ts?(x)\"",
|
|
19
20
|
"prettier": "prettier --write \"./{src,tests}/**/*.{js,jsx,ts,tsx,json}\""
|
|
20
21
|
},
|
|
@@ -82,18 +83,19 @@
|
|
|
82
83
|
"rollup-plugin-postcss": "^4.0.1",
|
|
83
84
|
"rollup-plugin-size-snapshot": "^0.12.0",
|
|
84
85
|
"rollup-plugin-terser": "^7.0.2",
|
|
86
|
+
"three": "^0.131.3",
|
|
85
87
|
"typescript": "4.1.2"
|
|
86
88
|
},
|
|
87
89
|
"peerDependencies": {
|
|
88
|
-
"@react-three/fiber": ">= 7.0.
|
|
90
|
+
"@react-three/fiber": ">= 7.0.17",
|
|
89
91
|
"three": ">=0.129"
|
|
90
92
|
},
|
|
91
93
|
"dependencies": {
|
|
92
94
|
"@ant-design/compatible": "^1.0.8",
|
|
93
|
-
"@buerli.io/classcad": "0.0.
|
|
94
|
-
"@buerli.io/react": "0.0.
|
|
95
|
-
"@react-three/drei": "^7.
|
|
96
|
-
"@react-three/fiber": "^7.0.
|
|
95
|
+
"@buerli.io/classcad": "0.0.35-beta.0",
|
|
96
|
+
"@buerli.io/react": "0.0.35-beta.0",
|
|
97
|
+
"@react-three/drei": "^7.12.6",
|
|
98
|
+
"@react-three/fiber": "^7.0.17",
|
|
97
99
|
"antd": "4.11.2",
|
|
98
100
|
"react": "^17.0.2",
|
|
99
101
|
"react-colorful": "^5.3.0",
|
|
@@ -101,7 +103,6 @@
|
|
|
101
103
|
"react-sortable-hoc": "^2.0.0",
|
|
102
104
|
"react-uid": "^2.3.1",
|
|
103
105
|
"styled-components": "^4.3.2",
|
|
104
|
-
"three": "^0.131.3",
|
|
105
106
|
"three-rounded-box": "^0.1.1",
|
|
106
107
|
"three-stdlib": "^2.4.0",
|
|
107
108
|
"uuid": "^3.3.2",
|