@buerli.io/react-cad 0.5.0 → 0.7.1-beta.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.
Files changed (28) hide show
  1. package/build/components/UI/CAD/PluginBounds.d.ts +8 -0
  2. package/build/components/UI/CAD/PluginTooltip.d.ts +5 -0
  3. package/build/components/UI/CAD/Solids/ColorPicker.d.ts +1 -1
  4. package/build/components/UI/CAD/hooks/useMenuItems.d.ts +1 -1
  5. package/build/components/UI/CAD/plugins/ProductManagement/ProdTable.d.ts +5 -9
  6. package/build/components/UI/CAD/plugins/ProductManagement/types.d.ts +5 -0
  7. package/build/components/UI/CAD/plugins/ProductManagement/useMenuItems.d.ts +1 -1
  8. package/build/components/UI/editors/ExpressionEditor/ExpressionEditor.d.ts +1 -1
  9. package/build/components/UI/editors/NumberEditor/NumOrExpr.d.ts +1 -0
  10. package/build/components/UI/editors/useParam.d.ts +3 -1
  11. package/build/components/graphics/Outlines/OutlineEffect.d.ts +3 -0
  12. package/build/index.cjs.js +2072 -1319
  13. package/build/index.d.ts +3 -1
  14. package/build/index.js +2102 -1350
  15. package/build/plugins/Dimensions/graphics/DimGraphics.d.ts +1 -0
  16. package/build/plugins/Dimensions/graphics/primitives.d.ts +2 -1
  17. package/build/plugins/HLConstraints/components/LimitedValue.d.ts +1 -8
  18. package/build/plugins/HLConstraints/components/Limits.d.ts +1 -1
  19. package/build/plugins/Sketch/View/graphics/hooks.d.ts +1 -1
  20. package/build/plugins/Sketch/View/handlers/Fillet.d.ts +1 -1
  21. package/build/plugins/Sketch/constants.d.ts +5 -0
  22. package/build/plugins/Sketch/description.d.ts +0 -1
  23. package/build/plugins/Sketch/index.d.ts +2 -2
  24. package/build/types.d.ts +3 -0
  25. package/build/utils/getHighlightedColor.d.ts +1 -0
  26. package/build/utils/selection/scopes/treeObjInteraction.d.ts +37 -0
  27. package/package.json +3 -3
  28. package/build/utils/selection/scopes/treeObjSelection.d.ts +0 -27
@@ -2,5 +2,6 @@ import React from 'react';
2
2
  import { ObjectID } from '@buerli.io/core';
3
3
  declare const DimGraphics: React.FC<{
4
4
  dimId: ObjectID;
5
+ disableEvents?: boolean;
5
6
  }>;
6
7
  export default DimGraphics;
@@ -5,13 +5,13 @@ export declare const mainColor = 4342338;
5
5
  export declare const TextValue: React.FC<{
6
6
  position: THREE.Vector3;
7
7
  value: string;
8
- onClick?: () => void;
9
8
  backgroundColor?: number;
10
9
  }>;
11
10
  export declare const DimValue: React.FC<{
12
11
  position: THREE.Vector3;
13
12
  dimId: ObjectID;
14
13
  backgroundColor?: number;
14
+ disableEvents?: boolean;
15
15
  }>;
16
16
  export declare const Line: React.FC<{
17
17
  start: THREE.Vector3;
@@ -31,4 +31,5 @@ export declare const PositionHandler: React.FC<{
31
31
  dimId: ObjectID;
32
32
  setPosition: React.Dispatch<React.SetStateAction<THREE.Vector3>>;
33
33
  position: THREE.Vector3;
34
+ disableEvents?: boolean;
34
35
  }>;
@@ -1,18 +1,11 @@
1
1
  import React from 'react';
2
2
  import { DrawingID, ObjectID } from '@buerli.io/core';
3
- import { MemberParam } from '../../../types';
4
- export declare type LimitedValueParam = {
5
- value: number;
6
- min: number;
7
- max: number;
8
- };
9
- export declare function useLimValueParam(drawingId: DrawingID, objId: ObjectID, memberName: string, minMemberName: string, maxMemberName: string): MemberParam<LimitedValueParam>;
10
3
  export declare const LimitedValue: React.FC<{
11
4
  drawingId: DrawingID;
12
5
  objId: ObjectID;
13
6
  memberName: string;
14
7
  limitsName: string;
15
- onUpdate: (value: number) => Promise<void>;
8
+ onUpdate: (value: number | string) => Promise<void>;
16
9
  caption?: string;
17
10
  angle?: boolean;
18
11
  disabled?: boolean;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DrawingID, ObjectID } from '@buerli.io/core';
3
- import { MemberParam } from '../../../types';
4
3
  import { LimitsParam } from '@buerli.io/classcad';
4
+ import { MemberParam } from '../../../types';
5
5
  export declare function useLimitsParam(drawingId: DrawingID, objId: ObjectID, memberName: string, options?: {
6
6
  angle?: boolean;
7
7
  forceNoLimits?: boolean;
@@ -29,7 +29,7 @@ export declare const useUserData: (objId: ObjectID) => {
29
29
  onHUD?: undefined;
30
30
  };
31
31
  export declare const useHandlersAndColor: (drawingId: DrawingID, objId: ObjectID) => {
32
- handlers: {};
32
+ handlers: Record<string, (e: import("@react-three/fiber").ThreeEvent<PointerEvent> & import("../../types").PointerEventsT) => void>;
33
33
  color: number;
34
34
  };
35
35
  export {};
@@ -1,3 +1,3 @@
1
1
  import { DrawingID, PluginID } from '@buerli.io/core';
2
2
  import { Handler } from '../../types';
3
- export declare function Fillet(drawingId: DrawingID, pluginId: PluginID, camControls: any): Handler;
3
+ export declare function Fillet(drawingId: DrawingID, pluginId: PluginID): Handler;
@@ -0,0 +1,5 @@
1
+ export declare const tolerance = 0.000001;
2
+ /**
3
+ * Allowed pixel offset for onClick handler events in case the pointer was slightly moved
4
+ */
5
+ export declare const deltaTolerance = 4;
@@ -2,4 +2,3 @@ import { PluginDescription } from '@buerli.io/core';
2
2
  import { SketchPState } from './types';
3
3
  export declare const getInitialState: () => SketchPState;
4
4
  export declare const description: PluginDescription;
5
- export declare const tolerance = 0.000001;
@@ -1,4 +1,4 @@
1
1
  import { View } from './View';
2
2
  import { Root } from './Root';
3
- import { description, tolerance } from './description';
4
- export { Root, View, description, tolerance };
3
+ import { description } from './description';
4
+ export { Root, View, description };
package/build/types.d.ts CHANGED
@@ -7,6 +7,9 @@ export declare type MemberParam<T> = {
7
7
  isChanged: (idx?: number) => boolean;
8
8
  validator: () => string[];
9
9
  setValidator: (...args: any[]) => void;
10
+ options: {
11
+ [key: string]: any;
12
+ };
10
13
  };
11
14
  export declare type APIParam<T> = {
12
15
  value: T | string;
@@ -0,0 +1 @@
1
+ export declare const getHighlightedColor: (isGHovered: boolean, isGSelected: boolean, isSHovered: boolean, isSSelected: boolean) => "green" | "red" | "#3280ff" | "#8040c0" | undefined;
@@ -0,0 +1,37 @@
1
+ import { DrawingID, IStructureObject, ObjectID, SelectedItem } from '@buerli.io/core';
2
+ import { ThreeEvent } from '@react-three/fiber';
3
+ /**
4
+ * Implies the following data structure:
5
+ * data: {
6
+ * object: IStructureObject
7
+ * }
8
+ */
9
+ export declare const TreeObjScope = "TreeObjScope";
10
+ export declare const createTreeObjSelItem: (productId: ObjectID, object: IStructureObject) => SelectedItem;
11
+ export declare function useIsGHovered(drawingId: DrawingID, objId: ObjectID): boolean;
12
+ export declare function useIsGSelected(drawingId: DrawingID, objId: ObjectID): boolean;
13
+ export declare function useIsSHovered(drawingId: DrawingID, objId: ObjectID): boolean;
14
+ /**
15
+ * Returns true if object in tree is currently selected in active selection.
16
+ *
17
+ * This hook leads to re-rendering of each element uses it.
18
+ * It happens because it uses items of the active selection,
19
+ * and it's not possible to check if objId is selected inside of useDrawing selector
20
+ * because of performance reasone (it requires traversing through all of selectedItems).
21
+ *
22
+ * @param drawingId
23
+ * @param objId
24
+ * @returns
25
+ */
26
+ export declare function useIsSSelected(drawingId: DrawingID, objId: ObjectID): boolean;
27
+ export declare function useTreeObjInteraction(drawingId: DrawingID, objId: ObjectID): {
28
+ isGHovered: boolean;
29
+ isGSelected: boolean;
30
+ isSHovered: boolean;
31
+ isSSelected: boolean;
32
+ handlers: {
33
+ onClick: (e: MouseEvent | ThreeEvent<MouseEvent>) => void;
34
+ onPointerOut: (e: PointerEvent | ThreeEvent<PointerEvent>) => void;
35
+ onPointerOver: (e: PointerEvent | ThreeEvent<PointerEvent>) => void;
36
+ };
37
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerli.io/react-cad",
3
- "version": "0.5.0",
3
+ "version": "0.7.1-beta.1",
4
4
  "description": "buerli CAD components",
5
5
  "author": "AWV Informatik AG <info@awv-informatik.ch>",
6
6
  "repository": {},
@@ -91,8 +91,8 @@
91
91
  },
92
92
  "dependencies": {
93
93
  "@ant-design/compatible": "^1.0.8",
94
- "@buerli.io/classcad": "0.5.0",
95
- "@buerli.io/react": "0.5.0",
94
+ "@buerli.io/classcad": "0.7.1-beta.2",
95
+ "@buerli.io/react": "0.7.1-beta.2",
96
96
  "@react-three/postprocessing": "2.6.2",
97
97
  "antd": "^4.23.4",
98
98
  "path-browserify": "^1.0.1",
@@ -1,27 +0,0 @@
1
- import { DrawingID, IStructureObject, ObjectID, SelectedItem } from '@buerli.io/core';
2
- /**
3
- * Implies the following data structure:
4
- * data: {
5
- * object: IStructureObject
6
- * }
7
- */
8
- export declare const TreeObjScope = "TreeObjScope";
9
- export declare const createTreeObjSelItem: (productId: ObjectID, object: IStructureObject) => SelectedItem;
10
- /**
11
- * Returns true if object in tree is currently selected in active selection.
12
- *
13
- * This hook leads to re-rendering of each element uses it.
14
- * It happens because it uses items of the active selection,
15
- * and it's not possible to check if objId is selected inside of useDrawing selector
16
- * because of performance reasone (it requires traversing through all of selectedItems).
17
- *
18
- * @param drawingId
19
- * @param objId
20
- * @returns
21
- */
22
- export declare function useIsSelected(drawingId: DrawingID, objId: ObjectID): boolean;
23
- export declare function useTreeObjSelection(drawingId: DrawingID, objId: ObjectID): {
24
- isHovered: boolean;
25
- isSelected: boolean;
26
- handlers: {};
27
- };