@buerli.io/react-cad 0.0.24-beta.0 → 0.2.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/{SideBar/Constraints.d.ts → Constraints.d.ts} +6 -0
- package/build/components/UI/CAD/Drawing.d.ts +30 -2
- package/build/components/UI/CAD/ListPlaceholder.d.ts +2 -0
- package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/AssemblyNode.d.ts +0 -1
- package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/Feature.d.ts +2 -2
- package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/FeatureList.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/index.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/utils.d.ts +0 -0
- package/build/components/UI/CAD/ModelTree/ModelTree.d.ts +13 -0
- package/build/components/UI/CAD/{SideBar/AssemblyTree/AssemblyTreeHeader.d.ts → ModelTree/ModelTreeHeader.d.ts} +2 -2
- package/build/components/UI/CAD/ModelTree/index.d.ts +1 -0
- package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/primitives.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/useMenuItems.d.ts +1 -1
- package/build/components/UI/CAD/{SideBar/SideBar.d.ts → SideBar.d.ts} +1 -1
- package/build/components/UI/CAD/{SideBar/Solids → Solids}/ColorPicker.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar/Solids → Solids}/Solids.d.ts +6 -0
- package/build/components/UI/CAD/{SideBar/Solids → Solids}/index.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar/Solids → Solids}/useMenuItems.d.ts +1 -1
- package/build/components/UI/CAD/Solids/useVisibleSolids.d.ts +2 -0
- package/build/components/UI/CAD/ToolBar/useCommands.d.ts +1 -1
- package/build/components/UI/CAD/ViewOptionsBar/ViewOptionButtons.d.ts +1 -4
- package/build/components/UI/CAD/ViewOptionsBar/useOptionCommands.d.ts +1 -8
- package/build/components/UI/CAD/common/EntityName.d.ts +2 -3
- package/build/components/UI/CAD/common/Menu.d.ts +11 -0
- package/build/components/UI/CAD/{SideBar → common}/SectionHeader.d.ts +0 -0
- package/build/components/UI/CAD/common/primitives.d.ts +3 -1
- package/build/components/UI/CAD/hooks/index.d.ts +6 -4
- package/build/components/UI/CAD/hooks/useHasPending.d.ts +8 -0
- package/build/components/UI/CAD/hooks/useIsLoading.d.ts +8 -0
- package/build/components/UI/CAD/{SideBar/FeatureList → hooks}/useMenuItems.d.ts +1 -1
- package/build/components/UI/CAD/index.d.ts +9 -3
- package/build/components/UI/CAD/plugins/ProductManagement/index.d.ts +3 -0
- package/build/components/UI/CAD/store/CADStore.d.ts +3 -0
- package/build/components/UI/Readfile.d.ts +5 -4
- package/build/components/UI/editors/BooleanEditor/BooleanEditor.d.ts +1 -0
- package/build/components/UI/editors/Wrapper.d.ts +1 -0
- package/build/components/UI/editors/useParam.d.ts +14 -1
- package/build/components/graphics/HoveredConstraintDisplay.d.ts +2 -1
- package/build/components/utils/CompValidation/validators/DrawingValidator.d.ts +1 -1
- package/build/index.cjs.js +4706 -2904
- package/build/index.d.ts +5 -1
- package/build/index.js +4453 -2662
- package/build/plugins/Measure/Root.d.ts +1 -1
- package/build/plugins/Mirror/Root.d.ts +6 -0
- package/build/plugins/Mirror/index.d.ts +4 -0
- package/build/plugins/Sketch/Root/{Constraints.d.ts → Constraints/Constraints.d.ts} +0 -0
- package/build/plugins/Sketch/Root/{constraintsHelpers.d.ts → Constraints/constraintsHelpers.d.ts} +0 -0
- package/build/plugins/Sketch/Root/Constraints/index.d.ts +2 -0
- package/build/plugins/Sketch/Root/Constraints/utils.d.ts +6 -0
- package/build/plugins/Sketch/Root/PlaneSelection.d.ts +7 -0
- package/build/plugins/Sketch/View/graphics/Merged/Arc.d.ts +3 -0
- package/build/plugins/Sketch/View/graphics/Merged/ArcGeometry.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/ArcMaterial.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/Circle.d.ts +8 -0
- package/build/plugins/Sketch/View/graphics/Merged/MergedWrapper.d.ts +11 -3
- package/build/plugins/Sketch/View/graphics/hooks.d.ts +7 -6
- package/build/plugins/Sketch/View/graphics/primitives.d.ts +3 -3
- package/build/plugins/Sketch/View/graphics/scale.d.ts +4 -3
- package/build/plugins/Sketch/View/handlers/{Handlers.d.ts → HandlersConstructors.d.ts} +1 -1
- package/build/plugins/Sketch/View/handlers/filletHelpers.d.ts +7 -8
- package/build/plugins/Sketch/description.d.ts +2 -0
- package/build/plugins/Sketch/types.d.ts +22 -13
- package/build/plugins/SliceBySheet/Root.d.ts +6 -0
- package/build/plugins/SliceBySheet/index.d.ts +4 -0
- package/build/plugins/components/PluginForm.d.ts +11 -0
- package/build/types.d.ts +0 -12
- package/build/utils/drawing/useDrawingArr.d.ts +8 -0
- package/build/utils/drawing/useDrawingCCId.d.ts +8 -0
- package/build/utils/drawing/useDrawingStr.d.ts +8 -0
- package/build/utils/helpers.d.ts +2 -2
- package/build/utils/selection/filters.d.ts +2 -0
- package/build/utils/selection/useSelectorsOrder.d.ts +5 -0
- package/build/utils/useScale.d.ts +1 -1
- package/package.json +8 -8
- package/build/components/UI/CAD/CAD.d.ts +0 -7
- package/build/components/UI/CAD/SideBar/AssemblyTree/AssemblyTree.d.ts +0 -5
- package/build/components/UI/CAD/SideBar/AssemblyTree/index.d.ts +0 -1
- package/build/components/UI/CAD/SideBar/index.d.ts +0 -1
- package/build/components/UI/CAD/hooks/useComponentInteraction.d.ts +0 -14
- package/build/components/utils/CompValidation/validators/AssemblyTreeValidator.d.ts +0 -11
- package/build/components/utils/CompValidation/validators/SideBarValidator.d.ts +0 -11
- package/build/utils/zoomToFit.d.ts +0 -2
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'antd/dist/antd.css';
|
|
3
3
|
import { DrawingID } from '@buerli.io/core';
|
|
4
|
+
/**
|
|
5
|
+
* Shows list of 3d constraints which are contained by currentProduct.
|
|
6
|
+
*
|
|
7
|
+
* @param drawingId - id of a drawing in which currentProduct will be found.
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
4
10
|
export declare const Constraints: React.FC<{
|
|
5
11
|
drawingId: DrawingID;
|
|
6
12
|
}>;
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
import { DrawingID } from '@buerli.io/core';
|
|
1
|
+
import { DrawingID, ObjectID } from '@buerli.io/core';
|
|
2
2
|
import 'antd/dist/antd.css';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
declare type ObjType = 'Feature' | 'AssemblyNode' | 'Solid' | 'Constraint';
|
|
5
|
+
export declare type InteractionInfo = {
|
|
6
|
+
objectId: ObjectID;
|
|
7
|
+
highlightedIds?: ObjectID[];
|
|
8
|
+
type: ObjType;
|
|
9
|
+
} | null;
|
|
10
|
+
export declare const InteractionContext: React.Context<{
|
|
11
|
+
hoveredId?: number | undefined;
|
|
12
|
+
selectedId?: number | undefined;
|
|
13
|
+
onHover?: ((objData: InteractionInfo) => void) | undefined;
|
|
14
|
+
onClick?: ((objData: InteractionInfo) => void) | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Component which provides convenient UI for working with models which is loaded to existing drawing.
|
|
18
|
+
* It includes ModelTree, Constraints and Solids components and toolbar for creating new features/3dconstraints
|
|
19
|
+
* Drawing doesn't contain canvas component, so all graphics should be provided as children.
|
|
20
|
+
*
|
|
21
|
+
* @param drawingId - id of an existing drawing.
|
|
22
|
+
* @param Menu - you can pass custom file menu which will be shown at the left top corner.
|
|
23
|
+
* @param hoveredId - id of a currently hovered object.
|
|
24
|
+
* @param selectedId - id of a currently selected object.
|
|
25
|
+
* @param onHover - callback for hovering features / assembly nodes / solids / constraints.
|
|
26
|
+
* @param onClick - callback for clicking on assembly nodes / solids.
|
|
27
|
+
*/
|
|
4
28
|
export declare const Drawing: React.FC<{
|
|
5
29
|
drawingId: DrawingID;
|
|
6
30
|
Menu?: JSX.Element;
|
|
7
|
-
onFirstRender?: () => void;
|
|
8
31
|
children?: React.ReactNode;
|
|
32
|
+
hoveredId?: ObjectID;
|
|
33
|
+
selectedId?: ObjectID;
|
|
34
|
+
onHover?: (objData: InteractionInfo) => void;
|
|
35
|
+
onClick?: (objData: InteractionInfo) => void;
|
|
9
36
|
}>;
|
|
37
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DrawingID, ObjectID } from '@buerli.io/core';
|
|
2
|
-
import 'antd/dist/antd.css';
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import 'antd/dist/antd.css';
|
|
3
|
+
import { DrawingID, ObjectID } from '@buerli.io/core';
|
|
4
4
|
export declare const Feature: React.FC<{
|
|
5
5
|
drawingId: DrawingID;
|
|
6
6
|
featureRefId: ObjectID;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DrawingID } from '@buerli.io/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Component which shows structure of model.
|
|
5
|
+
* In part mode a list of part features is shown. In assembly mode a tree of assembly nodes is shown.
|
|
6
|
+
* It checks root and currentProduct to understand which mode is currently enabled. Check useEditMode hook for more details.
|
|
7
|
+
*
|
|
8
|
+
* @param drawingId
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare const ModelTree: React.FC<{
|
|
12
|
+
drawingId: DrawingID;
|
|
13
|
+
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DrawingID } from '@buerli.io/core';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The model tree header.
|
|
5
5
|
*
|
|
6
6
|
* Responsibility:
|
|
7
7
|
* - Show name of current node
|
|
@@ -10,6 +10,6 @@ import React from 'react';
|
|
|
10
10
|
* - Provide convert to template functionality
|
|
11
11
|
* - Provide import/add functionality
|
|
12
12
|
*/
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const ModelTreeHeader: React.FC<{
|
|
14
14
|
drawingId: DrawingID;
|
|
15
15
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModelTree } from './ModelTree';
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'antd/dist/antd.css';
|
|
3
3
|
import { DrawingID, ObjectID } from '@buerli.io/core';
|
|
4
|
-
import { MenuItems } from '
|
|
4
|
+
import { MenuItems } from '../common/Menu';
|
|
5
5
|
export declare function useMenuItems(drawingId: DrawingID, objectId: ObjectID, setRename: React.Dispatch<React.SetStateAction<boolean>>): MenuItems;
|
|
File without changes
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DrawingID } from '@buerli.io/core';
|
|
3
|
+
/**
|
|
4
|
+
* Shows list of solids available in the current application context.
|
|
5
|
+
*
|
|
6
|
+
* @param drawingId - id of a drawing.
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
3
9
|
export declare const Solids: React.FC<{
|
|
4
10
|
drawingId: DrawingID;
|
|
5
11
|
}>;
|
|
File without changes
|
|
@@ -4,4 +4,4 @@ export declare type Command = {
|
|
|
4
4
|
icon: any;
|
|
5
5
|
callback: () => Promise<any>;
|
|
6
6
|
};
|
|
7
|
-
export declare function useCommands(drawingId: DrawingID, curProductClass: string): Record<string, Command | Command[]>;
|
|
7
|
+
export declare function useCommands(drawingId: DrawingID, curProductClass: string | undefined): Record<string, Command | Command[]>;
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const useOptionCommands: (drawingId: DrawingID) => ({
|
|
3
|
-
label: string;
|
|
4
|
-
icon: JSX.Element;
|
|
5
|
-
command: () => void;
|
|
6
|
-
isChecked?: undefined;
|
|
7
|
-
isDisabled?: undefined;
|
|
8
|
-
} | {
|
|
1
|
+
export declare const useOptionCommands: () => ({
|
|
9
2
|
label: string;
|
|
10
3
|
icon: JSX.Element;
|
|
11
4
|
isChecked: boolean;
|
|
@@ -2,9 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import 'antd/dist/antd.css';
|
|
3
3
|
export declare const EntityName: React.FC<{
|
|
4
4
|
name: string;
|
|
5
|
+
underlined?: boolean;
|
|
5
6
|
strong?: boolean;
|
|
6
7
|
disabled?: boolean;
|
|
7
|
-
onClick
|
|
8
|
-
onMouseEnter?: () => void;
|
|
9
|
-
onMouseLeave?: () => void;
|
|
8
|
+
onClick?: () => void;
|
|
10
9
|
}>;
|
|
@@ -13,6 +13,17 @@ export declare type SubMenuItem = {
|
|
|
13
13
|
children: Record<string, MenuItem>;
|
|
14
14
|
};
|
|
15
15
|
export declare type MenuItems = Record<string, MenuItem | SubMenuItem>;
|
|
16
|
+
/**
|
|
17
|
+
* Context menu. By default it's rendered as thee dots "...", when user hovers it the menuitems is shown.
|
|
18
|
+
* It's possible to show an icon instead of "..." - just render an icon you whant to show as a Menu child.
|
|
19
|
+
*
|
|
20
|
+
* If you want to have nested level of menu items you need to fill children prop of a menu item with SubMenuItems (check src/components/UI/CAD/plugin/ProductManagement/useMenuItems.tsx:"export")
|
|
21
|
+
*
|
|
22
|
+
* @param items - Object contains items you whant to show in the menu. An item should contain caption and callback, it also migh has optional props: icon and children.
|
|
23
|
+
* @param children - Any component which will be shown as a button which opens menu, if no children passed three dots "..." are shown.
|
|
24
|
+
* @param DropDownProps - Since Menu is implemented using DropDown from "antd" you can pass any of DropDown props (except 'overltay') to customize the menu.
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
16
27
|
export declare const Menu: React.FC<Omit<{
|
|
17
28
|
items: MenuItems;
|
|
18
29
|
} & DropDownProps, 'overlay'>>;
|
|
File without changes
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const FlexRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export declare const FlexReverseRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export declare const Link: import("styled-components").StyledComponent<"a", any, {
|
|
3
|
+
export declare const Link: import("styled-components").StyledComponent<"a", any, {
|
|
4
|
+
underlined?: boolean | undefined;
|
|
5
|
+
}, never>;
|
|
4
6
|
export declare const HoveredDiv: import("styled-components").StyledComponent<"div", any, {
|
|
5
7
|
hovered?: boolean | undefined;
|
|
6
8
|
bordered?: boolean | undefined;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export { useComponentInteraction } from './useComponentInteraction';
|
|
2
|
-
export { useRoot } from './useRoot';
|
|
3
|
-
export { useCurrentProduct } from './useCurrentProduct';
|
|
4
1
|
export { useCurrentNode } from './useCurrentNode';
|
|
5
|
-
export {
|
|
2
|
+
export { useCurrentProduct } from './useCurrentProduct';
|
|
3
|
+
export { EditMode, useEditMode } from './useEditMode';
|
|
4
|
+
export { useHasPending } from './useHasPending';
|
|
5
|
+
export { useIsLoading } from './useIsLoading';
|
|
6
|
+
export { useMenuItems } from './useMenuItems';
|
|
6
7
|
export { useObjectDetails } from './useObjectDetails';
|
|
7
8
|
export { useOperationSequence } from './useOperationSequence';
|
|
8
9
|
export { useRollbackBar } from './useRollbackBar';
|
|
10
|
+
export { useRoot } from './useRoot';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DrawingID } from '@buerli.io/core';
|
|
2
|
+
/**
|
|
3
|
+
* Check if ClassCAD is busy with one or multiple pending requests.
|
|
4
|
+
*
|
|
5
|
+
* @param drawingId The drawing id
|
|
6
|
+
* @returns true, if some requests are pending
|
|
7
|
+
*/
|
|
8
|
+
export declare const useHasPending: (drawingId: DrawingID) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DrawingID, ObjectID } from '@buerli.io/core';
|
|
3
3
|
import 'antd/dist/antd.css';
|
|
4
|
-
import { MenuItems } from '
|
|
4
|
+
import { MenuItems } from '../common/Menu';
|
|
5
5
|
export declare function useMenuItems(drawingId: DrawingID, featureId: ObjectID, isActive: boolean, setEditName: React.Dispatch<React.SetStateAction<boolean>>): MenuItems;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Constraints } from './Constraints';
|
|
2
2
|
export { Drawing } from './Drawing';
|
|
3
|
+
export { Messages } from './Messages';
|
|
4
|
+
export { ModelTree } from './ModelTree';
|
|
5
|
+
export { FeaturePlugin, GlobalPlugins } from './PluginsWindows';
|
|
3
6
|
export { SideBar } from './SideBar';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
7
|
+
export { Solids } from './Solids';
|
|
8
|
+
export { ToolBar } from './ToolBar';
|
|
9
|
+
export { ViewOptionButtons } from './ViewOptionsBar/ViewOptionButtons';
|
|
10
|
+
export { ViewPlugButtons } from './ViewPlugButtons';
|
|
6
11
|
export { Menu } from './common/Menu';
|
|
7
12
|
export type { MenuItem, MenuItems } from './common/Menu';
|
|
13
|
+
export type { InteractionInfo } from './Drawing';
|
|
8
14
|
export * from './store/CADStore';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { PluginDescription } from '@buerli.io/core';
|
|
2
2
|
import { Root } from './Root';
|
|
3
3
|
import { View } from './View';
|
|
4
|
+
/**
|
|
5
|
+
* ProductManagement plugin is responsible for showing/creation/deletion parts and assemblies
|
|
6
|
+
*/
|
|
4
7
|
declare const description: PluginDescription;
|
|
5
8
|
export { Root, View, description };
|
|
@@ -12,6 +12,9 @@ export declare type CADStateT = {
|
|
|
12
12
|
api: ReturnType<typeof appApi>;
|
|
13
13
|
};
|
|
14
14
|
declare const CADApi: import("zustand").StoreApi<CADStateT>;
|
|
15
|
+
/**
|
|
16
|
+
* We need separate store for CAD components. It might contain auxiliary information like stack of current products or camera api.
|
|
17
|
+
*/
|
|
15
18
|
declare const useCADStore: import("zustand").UseStore<CADStateT>;
|
|
16
19
|
declare const getCADState: GetState<CADStateT>;
|
|
17
20
|
export { useCADStore, CADApi, getCADState };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Props = {
|
|
3
3
|
singleDrawingApp?: boolean;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
};
|
|
5
|
+
declare const Readfile: React.ForwardRefExoticComponent<Props & React.RefAttributes<any>>;
|
|
6
|
+
export default Readfile;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import { MemberParam } from '
|
|
1
|
+
import { MemberParam } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Wrapper for a parameter which will be used in an editor.
|
|
4
|
+
* @param param - an object which should contain next props:
|
|
5
|
+
* {
|
|
6
|
+
* userValue - value shown for the user
|
|
7
|
+
* setUserValue - userValue setter
|
|
8
|
+
defaults - default value
|
|
9
|
+
isChanged - function shows whether value is changed or not
|
|
10
|
+
* }
|
|
11
|
+
* @param getServValue - if value should be converted (e.g. deg -> rad) pass this function, it will be called right before classCAD API call.
|
|
12
|
+
* @param validation - Custom validation (used in useMateParam, useRefsParam. - these params has an array in userValue, so we need to apply validateF for each element from array).
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
2
15
|
export declare function useParam<T>(param: Omit<MemberParam<T>, 'serverValue' | 'validator' | 'setValidator'>, getServValue?: (x: T) => T, validation?: {
|
|
3
16
|
validator: () => string[];
|
|
4
17
|
setValidator: (...args: any[]) => void;
|