@buerli.io/react-cad 0.12.0 → 0.13.1-beta.2

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 (34) hide show
  1. package/build/components/UI/CAD/ModelTree/AssemblyNode.d.ts +3 -0
  2. package/build/components/UI/CAD/common/Collapse.d.ts +8 -0
  3. package/build/components/UI/CAD/common/ContextMenu.d.ts +4 -2
  4. package/build/components/UI/CAD/common/primitives.d.ts +1 -0
  5. package/build/components/UI/CAD/hooks/index.d.ts +1 -0
  6. package/build/components/UI/CAD/hooks/useGlobalMateInfo.d.ts +6 -0
  7. package/build/components/UI/CAD/store/CADActions.d.ts +1 -0
  8. package/build/components/UI/CAD/store/CADStore.d.ts +8 -1
  9. package/build/components/graphics/CSysDisplay.d.ts +19 -2
  10. package/build/index.cjs.js +9259 -7959
  11. package/build/index.d.ts +8 -3
  12. package/build/index.js +9220 -7928
  13. package/build/plugins/HLConstraints/CircularPattern/Root.d.ts +6 -0
  14. package/build/plugins/HLConstraints/CircularPattern/View.d.ts +6 -0
  15. package/build/plugins/HLConstraints/CircularPattern/index.d.ts +5 -0
  16. package/build/plugins/HLConstraints/Gear/Root.d.ts +6 -0
  17. package/build/plugins/HLConstraints/Gear/View.d.ts +6 -0
  18. package/build/plugins/HLConstraints/Gear/index.d.ts +5 -0
  19. package/build/plugins/HLConstraints/Group/Root.d.ts +6 -0
  20. package/build/plugins/HLConstraints/Group/index.d.ts +4 -0
  21. package/build/plugins/HLConstraints/LinearPattern/Root.d.ts +6 -0
  22. package/build/plugins/HLConstraints/LinearPattern/View.d.ts +6 -0
  23. package/build/plugins/HLConstraints/LinearPattern/index.d.ts +5 -0
  24. package/build/plugins/HLConstraints/Spherical/Root.d.ts +6 -0
  25. package/build/plugins/HLConstraints/Spherical/View.d.ts +6 -0
  26. package/build/plugins/HLConstraints/Spherical/index.d.ts +5 -0
  27. package/build/plugins/HLConstraints/components/CSysDisplayWrapper.d.ts +7 -0
  28. package/build/plugins/HLConstraints/components/HLConstrIcon.d.ts +7 -0
  29. package/build/plugins/HLConstraints/components/LimitedValue.d.ts +1 -1
  30. package/build/plugins/HLConstraints/components/Limits.d.ts +6 -0
  31. package/build/plugins/Sketch/utils/Interaction.d.ts +2 -1
  32. package/build/utils/mateUtils.d.ts +4 -0
  33. package/build/utils/selection/filters.d.ts +1 -0
  34. package/package.json +5 -4
@@ -5,3 +5,6 @@ export declare const AssemblyNode: React.FC<{
5
5
  nodeId: ObjectID;
6
6
  level: number;
7
7
  }>;
8
+ export declare const AssemblyNodeList: React.FC<{
9
+ drawingId: DrawingID;
10
+ }>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const Collapse: React.FC<{
3
+ isCollapsed: boolean;
4
+ setIsCollapsed: any;
5
+ caption: string;
6
+ invertChecked?: boolean;
7
+ children?: React.ReactNode;
8
+ }>;
@@ -11,9 +11,11 @@ export declare type MenuInfo<T = void> = T extends void ? MenuInfoBase : MenuInf
11
11
  };
12
12
  declare type MenuItemElement = Omit<MenuItemType, 'onClick'> & {
13
13
  onClick?: (menuInfo: MenuInfo<any>) => void;
14
+ onMouseEnter?: (menuInfo: MenuInfo<any>) => void;
15
+ onMouseLeave?: (menuInfo: MenuInfo<any>) => void;
14
16
  };
15
17
  declare type SubMenuElement = Omit<SubMenuType, 'onClick' | 'children'> & {
16
- children: MenuElement[];
18
+ children: MenuElement[] | ((menuInfo: MenuInfo<any>) => MenuElement[]);
17
19
  onClick?: (menuInfo: MenuInfo<any>) => void;
18
20
  };
19
21
  declare type MenuItemGroupElement = Omit<MenuItemGroupType, 'children'> & {
@@ -22,7 +24,7 @@ declare type MenuItemGroupElement = Omit<MenuItemGroupType, 'children'> & {
22
24
  export declare type MenuElement = MenuItemElement | SubMenuElement | MenuItemGroupElement | MenuDividerType | null;
23
25
  declare type ContextMenuProps = {
24
26
  items: MenuElement[];
25
- menuInfo: MenuInfo<any> | null;
27
+ menuInfo: MenuInfo<any>;
26
28
  caption: string;
27
29
  icon?: JSX.Element;
28
30
  onHide?: () => void;
@@ -6,4 +6,5 @@ export declare const Link: import("styled-components").StyledComponent<"a", any,
6
6
  export declare const HoveredDiv: import("styled-components").StyledComponent<"div", any, {
7
7
  hovered?: boolean | undefined;
8
8
  bordered?: boolean | undefined;
9
+ blocked?: boolean | undefined;
9
10
  }, never>;
@@ -3,6 +3,7 @@ export { useContextMenuItems } from './useContextMenuItems';
3
3
  export { useCurrentInstance } from './useCurrentInstance';
4
4
  export { useCurrentProduct } from './useCurrentProduct';
5
5
  export { EditMode, useEditMode } from './useEditMode';
6
+ export { useGlobalMateInfo } from './useGlobalMateInfo';
6
7
  export { useHasPending } from './useHasPending';
7
8
  export { useIsLoading } from './useIsLoading';
8
9
  export { useIsSketchActive } from './useIsSketchActive';
@@ -0,0 +1,6 @@
1
+ import { DrawingID, ObjectID, SelectedItem } from '@buerli.io/core';
2
+ export declare const useGlobalMateInfo: (drawingId: DrawingID, instances?: ObjectID[], includeSelected?: boolean) => {
3
+ selItems: SelectedItem<any>[];
4
+ activeSelItems: SelectedItem<any>[];
5
+ activeRigidsets: number[];
6
+ };
@@ -6,6 +6,7 @@ export declare const appApi: (set: SetState<CADStateT>, get: GetState<CADStateT>
6
6
  startProdEditing: (drawingId: DrawingID, objId: ObjectID) => void;
7
7
  goBack: (drawingId: DrawingID) => void;
8
8
  clearProdStack: () => void;
9
+ setVisible: (instanceIds: ObjectID[], objIdsArr: ObjectID[][], value: boolean) => void;
9
10
  };
10
11
  blankDiv: {
11
12
  show: (callback: () => void) => void;
@@ -3,6 +3,9 @@ import { appApi } from './CADActions';
3
3
  export declare type CADStateT = {
4
4
  assemblyTree: {
5
5
  prodStack: ObjectID[];
6
+ visibleMap: {
7
+ [key: ObjectID]: ObjectID[];
8
+ };
6
9
  };
7
10
  blankDiv: {
8
11
  isActive: boolean;
@@ -15,5 +18,9 @@ declare const CADApi: import("zustand").StoreApi<CADStateT>;
15
18
  * We need separate store for CAD components. It might contain auxiliary information like stack of current products or camera api.
16
19
  */
17
20
  declare const useCADStore: import("zustand").UseBoundStore<import("zustand").StoreApi<CADStateT>>;
21
+ declare const useVisibleMap: () => {
22
+ [key: number]: number[];
23
+ };
24
+ declare const useIsVisible: (instanceId: ObjectID, objectId: ObjectID) => boolean;
18
25
  declare const getCADState: () => CADStateT;
19
- export { useCADStore, CADApi, getCADState };
26
+ export { useCADStore, useVisibleMap, useIsVisible, CADApi, getCADState };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import * as THREE from 'three';
3
- import { DrawingID, ObjectID } from '@buerli.io/core';
3
+ import { DrawingID, ObjectID, SelectedItem } from '@buerli.io/core';
4
4
  import { FlipType, ReorientedType } from '@buerli.io/classcad';
5
5
  export declare type CustomCSys = {
6
6
  drawingId: DrawingID;
@@ -19,6 +19,21 @@ export declare type CSysUserData = {
19
19
  isActive?: boolean;
20
20
  onHUD?: boolean;
21
21
  };
22
+ export declare enum CSysDisplayMode {
23
+ DisplayAll = 0,
24
+ DisplayHovered = 1,
25
+ DisplayVisible = 2
26
+ }
27
+ export declare type CSysDisplayContextProps = {
28
+ drawingId: DrawingID;
29
+ displayMode: CSysDisplayMode;
30
+ includeSelected: boolean;
31
+ selItems: SelectedItem<any>[];
32
+ activeSelItems: SelectedItem<any>[];
33
+ activeRigidsets: ObjectID[];
34
+ csysComponent: React.FC<CustomCSys> | undefined;
35
+ };
36
+ export declare const CSysDisplayContext: React.Context<CSysDisplayContextProps>;
22
37
  export declare const CSysWrapper: React.FC<{
23
38
  drawingId: DrawingID;
24
39
  csys?: React.FC<CustomCSys>;
@@ -29,5 +44,7 @@ export declare const CSysWrapper: React.FC<{
29
44
  export declare const CSysDisplay: React.FC<{
30
45
  drawingId: DrawingID;
31
46
  csys?: React.FC<CustomCSys>;
32
- hoveredOnly?: boolean;
47
+ displayMode?: CSysDisplayMode;
48
+ instances?: ObjectID[];
49
+ includeSelected?: boolean;
33
50
  }>;