@buerli.io/react-cad 0.0.24-beta.0 → 0.0.24-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 (63) hide show
  1. package/build/components/UI/CAD/{SideBar/Constraints.d.ts → Constraints.d.ts} +6 -0
  2. package/build/components/UI/CAD/Drawing.d.ts +8 -1
  3. package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/AssemblyNode.d.ts +0 -0
  4. package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/Feature.d.ts +0 -0
  5. package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/FeatureList.d.ts +0 -0
  6. package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/index.d.ts +0 -0
  7. package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/utils.d.ts +0 -0
  8. package/build/components/UI/CAD/ModelTree/ModelTree.d.ts +13 -0
  9. package/build/components/UI/CAD/{SideBar/AssemblyTree/AssemblyTreeHeader.d.ts → ModelTree/ModelTreeHeader.d.ts} +2 -2
  10. package/build/components/UI/CAD/ModelTree/index.d.ts +1 -0
  11. package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/primitives.d.ts +0 -0
  12. package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/useMenuItems.d.ts +1 -1
  13. package/build/components/UI/CAD/{SideBar/SideBar.d.ts → SideBar.d.ts} +0 -0
  14. package/build/components/UI/CAD/{SideBar/Solids → Solids}/ColorPicker.d.ts +0 -0
  15. package/build/components/UI/CAD/Solids/Solids.d.ts +11 -0
  16. package/build/components/UI/CAD/{SideBar/Solids → Solids}/index.d.ts +0 -0
  17. package/build/components/UI/CAD/{SideBar/Solids → Solids}/useMenuItems.d.ts +1 -1
  18. package/build/components/UI/CAD/ViewOptionsBar/ViewOptionButtons.d.ts +1 -4
  19. package/build/components/UI/CAD/ViewOptionsBar/useOptionCommands.d.ts +1 -8
  20. package/build/components/UI/CAD/common/Menu.d.ts +11 -0
  21. package/build/components/UI/CAD/{SideBar → common}/SectionHeader.d.ts +0 -0
  22. package/build/components/UI/CAD/hooks/index.d.ts +1 -0
  23. package/build/components/UI/CAD/{SideBar/FeatureList → hooks}/useMenuItems.d.ts +1 -1
  24. package/build/components/UI/CAD/index.d.ts +8 -3
  25. package/build/components/UI/CAD/plugins/ProductManagement/index.d.ts +3 -0
  26. package/build/components/UI/CAD/store/CADStore.d.ts +3 -0
  27. package/build/components/UI/Readfile.d.ts +5 -4
  28. package/build/components/UI/editors/useParam.d.ts +14 -1
  29. package/build/components/utils/CompValidation/validators/{AssemblyTreeValidator.d.ts → ModelTreeValidator.d.ts} +2 -2
  30. package/build/index.cjs.js +3086 -2025
  31. package/build/index.d.ts +2 -1
  32. package/build/index.js +3080 -2026
  33. package/build/plugins/Sketch/Root/{Constraints.d.ts → Constraints/Constraints.d.ts} +0 -0
  34. package/build/plugins/Sketch/Root/{constraintsHelpers.d.ts → Constraints/constraintsHelpers.d.ts} +0 -0
  35. package/build/plugins/Sketch/Root/Constraints/index.d.ts +2 -0
  36. package/build/plugins/Sketch/Root/Constraints/utils.d.ts +6 -0
  37. package/build/plugins/Sketch/View/graphics/Merged/Arc.d.ts +2 -0
  38. package/build/plugins/Sketch/View/graphics/Merged/ArcGeometry.d.ts +2 -0
  39. package/build/plugins/Sketch/View/graphics/Merged/ArcMaterial.d.ts +2 -0
  40. package/build/plugins/Sketch/View/graphics/Merged/Circle.d.ts +7 -0
  41. package/build/plugins/Sketch/View/graphics/Merged/MergedWrapper.d.ts +11 -3
  42. package/build/plugins/Sketch/View/graphics/hooks.d.ts +7 -6
  43. package/build/plugins/Sketch/View/graphics/primitives.d.ts +3 -3
  44. package/build/plugins/Sketch/View/graphics/scale.d.ts +4 -3
  45. package/build/plugins/Sketch/View/handlers/{Handlers.d.ts → HandlersConstructors.d.ts} +1 -1
  46. package/build/plugins/Sketch/View/handlers/filletHelpers.d.ts +7 -8
  47. package/build/plugins/Sketch/description.d.ts +2 -0
  48. package/build/plugins/Sketch/types.d.ts +22 -13
  49. package/build/plugins/components/PluginForm.d.ts +11 -0
  50. package/build/types.d.ts +0 -12
  51. package/build/utils/drawing/useDrawingArr.d.ts +8 -0
  52. package/build/utils/drawing/useDrawingCCId.d.ts +8 -0
  53. package/build/utils/drawing/useDrawingStr.d.ts +8 -0
  54. package/build/utils/helpers.d.ts +2 -2
  55. package/build/utils/selection/useSelectorsOrder.d.ts +5 -0
  56. package/build/utils/useScale.d.ts +1 -1
  57. package/package.json +8 -8
  58. package/build/components/UI/CAD/CAD.d.ts +0 -7
  59. package/build/components/UI/CAD/SideBar/AssemblyTree/AssemblyTree.d.ts +0 -5
  60. package/build/components/UI/CAD/SideBar/AssemblyTree/index.d.ts +0 -1
  61. package/build/components/UI/CAD/SideBar/Solids/Solids.d.ts +0 -5
  62. package/build/components/UI/CAD/SideBar/index.d.ts +0 -1
  63. 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,16 @@
1
1
  import { DrawingID } from '@buerli.io/core';
2
2
  import 'antd/dist/antd.css';
3
3
  import React from 'react';
4
+ /**
5
+ * Component which provides convenient UI for working with models which is loaded to existing drawing.
6
+ * It includes ModelTree, Constraints and Solids components and toolbar for creating new features/3dconstraints
7
+ * Drawing doesn't contain canvas component, so all graphics should be provided as children.
8
+ *
9
+ * @param drawingId - id of an existing drawing.
10
+ * @param Menu - you can pass custom file menu which will be shown at the left top corner.
11
+ */
4
12
  export declare const Drawing: React.FC<{
5
13
  drawingId: DrawingID;
6
14
  Menu?: JSX.Element;
7
- onFirstRender?: () => void;
8
15
  children?: React.ReactNode;
9
16
  }>;
@@ -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 assembly tree header.
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 AssemblyTreeHeader: React.FC<{
13
+ export declare const ModelTreeHeader: React.FC<{
14
14
  drawingId: DrawingID;
15
15
  }>;
@@ -0,0 +1 @@
1
+ export { ModelTree } from './ModelTree';
@@ -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 '../../common/Menu';
4
+ import { MenuItems } from '../common/Menu';
5
5
  export declare function useMenuItems(drawingId: DrawingID, objectId: ObjectID, setRename: React.Dispatch<React.SetStateAction<boolean>>): MenuItems;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { DrawingID } from '@buerli.io/core';
3
+ /**
4
+ * Shows list of solids which are contained by currentProduct.
5
+ *
6
+ * @param drawingId - id of a drawing in which currentProduct will be found.
7
+ * @returns
8
+ */
9
+ export declare const Solids: React.FC<{
10
+ drawingId: DrawingID;
11
+ }>;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import 'antd/dist/antd.css';
3
- import { MenuItems } from '../../common/Menu';
3
+ import { MenuItems } from '../common/Menu';
4
4
  export declare function useMenuItems(setEditName: React.Dispatch<React.SetStateAction<boolean>>): MenuItems;
@@ -1,6 +1,3 @@
1
1
  import React from 'react';
2
2
  import 'antd/dist/antd.css';
3
- import { DrawingID } from '@buerli.io/core';
4
- export declare const ViewOptionButtons: React.FC<{
5
- drawingId: DrawingID;
6
- }>;
3
+ export declare const ViewOptionButtons: React.FC;
@@ -1,11 +1,4 @@
1
- import { DrawingID } from '@buerli.io/core';
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;
@@ -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'>>;
@@ -3,6 +3,7 @@ export { useRoot } from './useRoot';
3
3
  export { useCurrentProduct } from './useCurrentProduct';
4
4
  export { useCurrentNode } from './useCurrentNode';
5
5
  export { useEditMode, EditMode } from './useEditMode';
6
+ export { useMenuItems } from './useMenuItems';
6
7
  export { useObjectDetails } from './useObjectDetails';
7
8
  export { useOperationSequence } from './useOperationSequence';
8
9
  export { useRollbackBar } from './useRollbackBar';
@@ -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 '../../common/Menu';
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,13 @@
1
- export { CAD } from './CAD';
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 { FeatureList } from './SideBar/FeatureList';
5
- export { AssemblyTree } from './SideBar/AssemblyTree';
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';
8
13
  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
- export default function Readfile({ el: El, singleDrawingApp, children, ...props }: {
2
- el: any;
1
+ import React from 'react';
2
+ declare type Props = {
3
3
  singleDrawingApp?: boolean;
4
- children: any;
5
- }): JSX.Element;
4
+ };
5
+ declare const Readfile: React.ForwardRefExoticComponent<Props & React.RefAttributes<any>>;
6
+ export default Readfile;
@@ -1,4 +1,17 @@
1
- import { MemberParam } from 'src/types';
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;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { DrawingID } from '@buerli.io/core';
3
3
  /**
4
- * Validator for AssemblyTree component. Checks drawing existance.
4
+ * Validator for ModelTree component. Checks drawing existance.
5
5
  *
6
6
  * @param drawingId
7
7
  * @returns
8
8
  */
9
- export declare const AssemblyTreeValidator: React.FC<{
9
+ export declare const ModelTreeValidator: React.FC<{
10
10
  drawingId: DrawingID;
11
11
  }>;