@classcad/react-cad 0.0.0-stage → 3.0.0-beta.20261119090857
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/CHANGELOG.md +55 -0
- package/README.md +98 -2
- package/build/components/UI/CAD/Constraints.d.ts +30 -0
- package/build/components/UI/CAD/Drawing.d.ts +83 -0
- package/build/components/UI/CAD/ListPlaceholder.d.ts +3 -0
- package/build/components/UI/CAD/Messages/Message.d.ts +8 -0
- package/build/components/UI/CAD/Messages/Messages.d.ts +43 -0
- package/build/components/UI/CAD/Messages/index.d.ts +1 -0
- package/build/components/UI/CAD/Messages/msgStore.d.ts +18 -0
- package/build/components/UI/CAD/ModelTree/AssemblyNode.d.ts +5 -0
- package/build/components/UI/CAD/ModelTree/FeatureList/Feature.d.ts +8 -0
- package/build/components/UI/CAD/ModelTree/FeatureList/FeatureList.d.ts +6 -0
- package/build/components/UI/CAD/ModelTree/FeatureList/index.d.ts +1 -0
- package/build/components/UI/CAD/ModelTree/FeatureList/utils.d.ts +26 -0
- package/build/components/UI/CAD/ModelTree/ModelTree.d.ts +56 -0
- package/build/components/UI/CAD/ModelTree/ModelTreeHeader.d.ts +15 -0
- package/build/components/UI/CAD/ModelTree/index.d.ts +1 -0
- package/build/components/UI/CAD/ModelTree/primitives.d.ts +6 -0
- package/build/components/UI/CAD/ModelTree/useContextMenuItems.d.ts +4 -0
- package/build/components/UI/CAD/PluginBounds.d.ts +8 -0
- package/build/components/UI/CAD/PluginTooltip.d.ts +5 -0
- package/build/components/UI/CAD/PluginsWindows.d.ts +99 -0
- package/build/components/UI/CAD/ReadOnlyContext.d.ts +10 -0
- package/build/components/UI/CAD/SideBar.d.ts +40 -0
- package/build/components/UI/CAD/Solids/Solids.d.ts +23 -0
- package/build/components/UI/CAD/Solids/index.d.ts +1 -0
- package/build/components/UI/CAD/Solids/useContextMenuItems.d.ts +4 -0
- package/build/components/UI/CAD/Solids/useVisibleSolids.d.ts +30 -0
- package/build/components/UI/CAD/StageHud.d.ts +9 -0
- package/build/components/UI/CAD/StatusBar.d.ts +11 -0
- package/build/components/UI/CAD/ThemeToggle.d.ts +25 -0
- package/build/components/UI/CAD/ToolBar/AssemblyModeCmds.d.ts +3 -0
- package/build/components/UI/CAD/ToolBar/PartModeCmds.d.ts +3 -0
- package/build/components/UI/CAD/ToolBar/ToolBar.d.ts +24 -0
- package/build/components/UI/CAD/ToolBar/index.d.ts +1 -0
- package/build/components/UI/CAD/ToolBar/useCommands.d.ts +12 -0
- package/build/components/UI/CAD/ViewOptionsBar/ViewOptionButtons.d.ts +30 -0
- package/build/components/UI/CAD/ViewOptionsBar/useOptionCommands.d.ts +65 -0
- package/build/components/UI/CAD/ViewPlugButtons.d.ts +43 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModal.d.ts +18 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalContext.d.ts +9 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalInner.d.ts +27 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalProvider.d.ts +4 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/OverlayScrollbar.d.ts +6 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/ResizeHandle.d.ts +2 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/clamp.d.ts +1 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/draggableModalReducer.d.ts +123 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/getWindowSize.d.ts +4 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/index.d.ts +3 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/useDrag.d.ts +5 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/usePrevious.d.ts +1 -0
- package/build/components/UI/CAD/ant-design-draggable-modal/useResize.d.ts +7 -0
- package/build/components/UI/CAD/common/BlankDiv.d.ts +3 -0
- package/build/components/UI/CAD/common/Collapse.d.ts +13 -0
- package/build/components/UI/CAD/common/ContextMenu.d.ts +115 -0
- package/build/components/UI/CAD/common/Divider.d.ts +4 -0
- package/build/components/UI/CAD/common/EntityName.d.ts +14 -0
- package/build/components/UI/CAD/common/Img.d.ts +6 -0
- package/build/components/UI/CAD/common/LoadingScreen/LoadingScreen.d.ts +8 -0
- package/build/components/UI/CAD/common/LoadingScreen/Spinner.d.ts +3 -0
- package/build/components/UI/CAD/common/LoadingScreen/index.d.ts +1 -0
- package/build/components/UI/CAD/common/Menu.d.ts +81 -0
- package/build/components/UI/CAD/common/MultiSelect.d.ts +12 -0
- package/build/components/UI/CAD/common/NameEdit.d.ts +7 -0
- package/build/components/UI/CAD/common/SectionHeader.d.ts +9 -0
- package/build/components/UI/CAD/common/primitives.d.ts +36 -0
- package/build/components/UI/CAD/common/reveal.d.ts +12 -0
- package/build/components/UI/CAD/hooks/index.d.ts +13 -0
- package/build/components/UI/CAD/hooks/useContextMenuInteraction.d.ts +7 -0
- package/build/components/UI/CAD/hooks/useContextMenuItems.d.ts +4 -0
- package/build/components/UI/CAD/hooks/useCurrentInstance.d.ts +2 -0
- package/build/components/UI/CAD/hooks/useCurrentProduct.d.ts +2 -0
- package/build/components/UI/CAD/hooks/useEditMode.d.ts +40 -0
- package/build/components/UI/CAD/hooks/useFeatureCount.d.ts +6 -0
- package/build/components/UI/CAD/hooks/useGlobalMateInfo.d.ts +6 -0
- package/build/components/UI/CAD/hooks/useHasPending.d.ts +27 -0
- package/build/components/UI/CAD/hooks/useIsDisabled.d.ts +2 -0
- package/build/components/UI/CAD/hooks/useIsLoading.d.ts +25 -0
- package/build/components/UI/CAD/hooks/useIsSketchActive.d.ts +26 -0
- package/build/components/UI/CAD/hooks/useObjectDetails.d.ts +12 -0
- package/build/components/UI/CAD/hooks/useOperationSequence.d.ts +29 -0
- package/build/components/UI/CAD/hooks/useRollbackBar.d.ts +8 -0
- package/build/components/UI/CAD/hooks/useRoot.d.ts +2 -0
- package/build/components/UI/CAD/index.d.ts +27 -0
- package/build/components/UI/CAD/plugins/ProductManagement/ProdTable.d.ts +10 -0
- package/build/components/UI/CAD/plugins/ProductManagement/Root.d.ts +11 -0
- package/build/components/UI/CAD/plugins/ProductManagement/View.d.ts +11 -0
- package/build/components/UI/CAD/plugins/ProductManagement/index.d.ts +34 -0
- package/build/components/UI/CAD/plugins/ProductManagement/types.d.ts +4 -0
- package/build/components/UI/CAD/plugins/ProductManagement/useContextMenuItems.d.ts +4 -0
- package/build/components/UI/CAD/plugins/SessionManagement/Root.d.ts +11 -0
- package/build/components/UI/CAD/plugins/SessionManagement/index.d.ts +36 -0
- package/build/components/UI/CAD/plugins/SessionManagement/types.d.ts +3 -0
- package/build/components/UI/CAD/store/CADActions.d.ts +29 -0
- package/build/components/UI/CAD/store/CADStore.d.ts +68 -0
- package/build/components/UI/CAD/store/instances.d.ts +7 -0
- package/build/components/UI/Readfile.d.ts +39 -0
- package/build/components/UI/ThemeVars.d.ts +6 -0
- package/build/components/UI/editors/BooleanEditor/BooleanEditor.d.ts +8 -0
- package/build/components/UI/editors/BooleanEditor/index.d.ts +2 -0
- package/build/components/UI/editors/BooleanEditor/useBoolParam.d.ts +3 -0
- package/build/components/UI/editors/CSysEditor/CSysEditor.d.ts +11 -0
- package/build/components/UI/editors/CSysEditor/index.d.ts +2 -0
- package/build/components/UI/editors/CSysEditor/useCSysParam.d.ts +9 -0
- package/build/components/UI/editors/ColorEditor/ColorEditor.d.ts +12 -0
- package/build/components/UI/editors/ColorEditor/index.d.ts +2 -0
- package/build/components/UI/editors/ColorEditor/useColorParam.d.ts +9 -0
- package/build/components/UI/editors/ExpressionEditor/ExpressionEditor.d.ts +20 -0
- package/build/components/UI/editors/ExpressionEditor/index.d.ts +2 -0
- package/build/components/UI/editors/ExpressionEditor/useExpressionsParam.d.ts +5 -0
- package/build/components/UI/editors/NumberEditor/Inputs.d.ts +18 -0
- package/build/components/UI/editors/NumberEditor/Mentions.d.ts +10 -0
- package/build/components/UI/editors/NumberEditor/NumOrExpr.d.ts +12 -0
- package/build/components/UI/editors/NumberEditor/NumberEditor.d.ts +12 -0
- package/build/components/UI/editors/NumberEditor/index.d.ts +2 -0
- package/build/components/UI/editors/NumberEditor/useNumParam.d.ts +5 -0
- package/build/components/UI/editors/PointEditor/PointEditor.d.ts +10 -0
- package/build/components/UI/editors/PointEditor/index.d.ts +2 -0
- package/build/components/UI/editors/PointEditor/usePointParam.d.ts +5 -0
- package/build/components/UI/editors/RefsEditors/ChainFinder.d.ts +12 -0
- package/build/components/UI/editors/RefsEditors/MateEditor.d.ts +13 -0
- package/build/components/UI/editors/RefsEditors/MateOrientationEditor.d.ts +9 -0
- package/build/components/UI/editors/RefsEditors/RefEditor.d.ts +24 -0
- package/build/components/UI/editors/RefsEditors/RefsEditor.d.ts +16 -0
- package/build/components/UI/editors/RefsEditors/index.d.ts +8 -0
- package/build/components/UI/editors/RefsEditors/pickers.d.ts +4 -0
- package/build/components/UI/editors/RefsEditors/useIdParam.d.ts +3 -0
- package/build/components/UI/editors/RefsEditors/useMateParam.d.ts +19 -0
- package/build/components/UI/editors/RefsEditors/useModes.d.ts +11 -0
- package/build/components/UI/editors/RefsEditors/useRefsParam.d.ts +3 -0
- package/build/components/UI/editors/RefsEditors/useSelectedItems.d.ts +18 -0
- package/build/components/UI/editors/ToleranceEditor/ToleranceEditor.d.ts +7 -0
- package/build/components/UI/editors/ToleranceEditor/index.d.ts +2 -0
- package/build/components/UI/editors/ToleranceEditor/useToleranceParam.d.ts +3 -0
- package/build/components/UI/editors/TypeEditor/TypeEditor.d.ts +10 -0
- package/build/components/UI/editors/TypeEditor/index.d.ts +2 -0
- package/build/components/UI/editors/TypeEditor/useTypeParam.d.ts +3 -0
- package/build/components/UI/editors/TypeWrapper.d.ts +6 -0
- package/build/components/UI/editors/Wrapper.d.ts +16 -0
- package/build/components/UI/editors/useParam.d.ts +20 -0
- package/build/components/UI/editors/useValidation.d.ts +4 -0
- package/build/components/graphics/Badge.d.ts +70 -0
- package/build/components/graphics/CSysDisplay.d.ts +108 -0
- package/build/components/graphics/CompositeCurveObj.d.ts +33 -0
- package/build/components/graphics/GeometryOverrides/GeometryOverridesManager.d.ts +41 -0
- package/build/components/graphics/GeometryOverrides/GeometryOverridesStore.d.ts +28 -0
- package/build/components/graphics/GeometryOverrides/index.d.ts +2 -0
- package/build/components/graphics/GeometryOverrides/useOverrideGeometryColor.d.ts +36 -0
- package/build/components/graphics/HUD.d.ts +44 -0
- package/build/components/graphics/HoveredConstraintDisplay.d.ts +24 -0
- package/build/components/graphics/InfinityPlane.d.ts +4 -0
- package/build/components/graphics/Outlines/AAPass.d.ts +8 -0
- package/build/components/graphics/Outlines/IDPass.d.ts +12 -0
- package/build/components/graphics/Outlines/Outline.d.ts +62 -0
- package/build/components/graphics/Outlines/OutlineEffect.d.ts +48 -0
- package/build/components/graphics/Outlines/OutlineMaterial.d.ts +9 -0
- package/build/components/graphics/Outlines/WidenPass.d.ts +17 -0
- package/build/components/graphics/PluginGeometryBounds.d.ts +40 -0
- package/build/components/graphics/SelectableMate.d.ts +3 -0
- package/build/components/graphics/SelectedMateObj.d.ts +54 -0
- package/build/components/graphics/StageLook.d.ts +51 -0
- package/build/components/graphics/WorkAxisObj.d.ts +33 -0
- package/build/components/graphics/WorkCSysObj.d.ts +33 -0
- package/build/components/graphics/WorkCoordSystemObj.d.ts +32 -0
- package/build/components/graphics/WorkPlaneObj.d.ts +33 -0
- package/build/components/graphics/WorkPointObj.d.ts +57 -0
- package/build/components/graphics/graphics.d.ts +61 -0
- package/build/components/graphics/utils/MatePathTransform.d.ts +10 -0
- package/build/components/graphics/utils/useCsysMatrix.d.ts +4 -0
- package/build/components/utils/CompValidation/ErrorBoundary.d.ts +28 -0
- package/build/components/utils/CompValidation/validators/CSysDisplayValidator.d.ts +12 -0
- package/build/components/utils/CompValidation/validators/DrawingValidator.d.ts +12 -0
- package/build/components/utils/CompValidation/validators/ExpressionsValidator.d.ts +12 -0
- package/build/components/utils/CompValidation/validators/FPluginValidator.d.ts +16 -0
- package/build/components/utils/CompValidation/validators/FeatureListValidator.d.ts +12 -0
- package/build/components/utils/CompValidation/validators/ProductManagementValidator.d.ts +14 -0
- package/build/components/utils/CompValidation/verifiers.d.ts +32 -0
- package/build/components/utils/FtVisibilityController.d.ts +26 -0
- package/build/elements/index.d.ts +162 -0
- package/build/icons/axes.d.ts +73 -0
- package/build/icons/draw.d.ts +75 -0
- package/build/icons/features.d.ts +71 -0
- package/build/icons/glyphs.d.ts +10 -0
- package/build/icons/index.d.ts +152 -0
- package/build/icons/legacy.d.ts +159 -0
- package/build/icons/mates.d.ts +26 -0
- package/build/icons/params.d.ts +77 -0
- package/build/icons/refs.d.ts +61 -0
- package/build/icons/sheets.d.ts +302 -0
- package/build/icons/sketch.d.ts +102 -0
- package/build/icons/types.d.ts +74 -0
- package/build/icons/ui.d.ts +114 -0
- package/build/icons.cjs.js +1751 -0
- package/build/icons.js +1742 -0
- package/build/index.cjs.js +44948 -0
- package/build/index.d.ts +115 -0
- package/build/index.js +44800 -0
- package/build/plugins/AppearanceEditor/Root.d.ts +12 -0
- package/build/plugins/AppearanceEditor/index.d.ts +42 -0
- package/build/plugins/Boolean/Root.d.ts +11 -0
- package/build/plugins/Boolean/index.d.ts +39 -0
- package/build/plugins/BoundingBoxInfo/Root.d.ts +12 -0
- package/build/plugins/BoundingBoxInfo/View.d.ts +11 -0
- package/build/plugins/BoundingBoxInfo/index.d.ts +35 -0
- package/build/plugins/Box/Root.d.ts +11 -0
- package/build/plugins/Box/index.d.ts +34 -0
- package/build/plugins/Chamfer/Root.d.ts +11 -0
- package/build/plugins/Chamfer/index.d.ts +35 -0
- package/build/plugins/CircularPattern/Root.d.ts +11 -0
- package/build/plugins/CircularPattern/index.d.ts +35 -0
- package/build/plugins/CompositeCurve/Root.d.ts +11 -0
- package/build/plugins/CompositeCurve/View.d.ts +11 -0
- package/build/plugins/CompositeCurve/index.d.ts +36 -0
- package/build/plugins/Cone/Root.d.ts +11 -0
- package/build/plugins/Cone/index.d.ts +36 -0
- package/build/plugins/Cylinder/Root.d.ts +11 -0
- package/build/plugins/Cylinder/index.d.ts +35 -0
- package/build/plugins/Dimensions/DimContext.d.ts +10 -0
- package/build/plugins/Dimensions/Root.d.ts +11 -0
- package/build/plugins/Dimensions/View.d.ts +11 -0
- package/build/plugins/Dimensions/graphics/DimGraphics.d.ts +7 -0
- package/build/plugins/Dimensions/graphics/DimensionSet.d.ts +8 -0
- package/build/plugins/Dimensions/graphics/primitives.d.ts +34 -0
- package/build/plugins/Dimensions/index.d.ts +34 -0
- package/build/plugins/Dimensions/utils.d.ts +5 -0
- package/build/plugins/EntityDeletion/Root.d.ts +11 -0
- package/build/plugins/EntityDeletion/index.d.ts +34 -0
- package/build/plugins/Expressions/Root.d.ts +11 -0
- package/build/plugins/Expressions/index.d.ts +34 -0
- package/build/plugins/Expressions/useContextMenuItems.d.ts +4 -0
- package/build/plugins/Extrusion/Root.d.ts +11 -0
- package/build/plugins/Extrusion/View.d.ts +11 -0
- package/build/plugins/Extrusion/index.d.ts +50 -0
- package/build/plugins/Fillet/Root.d.ts +11 -0
- package/build/plugins/Fillet/index.d.ts +35 -0
- package/build/plugins/HLConstraints/CircularPattern/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/CircularPattern/View.d.ts +11 -0
- package/build/plugins/HLConstraints/CircularPattern/index.d.ts +38 -0
- package/build/plugins/HLConstraints/Cylindrical/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Cylindrical/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Cylindrical/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Fastened/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Fastened/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Fastened/index.d.ts +37 -0
- package/build/plugins/HLConstraints/FastenedOrigin/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/FastenedOrigin/View.d.ts +11 -0
- package/build/plugins/HLConstraints/FastenedOrigin/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Gear/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Gear/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Gear/index.d.ts +36 -0
- package/build/plugins/HLConstraints/Group/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Group/index.d.ts +34 -0
- package/build/plugins/HLConstraints/LinearPattern/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/LinearPattern/View.d.ts +11 -0
- package/build/plugins/HLConstraints/LinearPattern/index.d.ts +38 -0
- package/build/plugins/HLConstraints/Parallel/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Parallel/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Parallel/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Planar/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Planar/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Planar/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Revolute/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Revolute/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Revolute/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Slider/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Slider/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Slider/index.d.ts +37 -0
- package/build/plugins/HLConstraints/Spherical/Root.d.ts +11 -0
- package/build/plugins/HLConstraints/Spherical/View.d.ts +11 -0
- package/build/plugins/HLConstraints/Spherical/index.d.ts +36 -0
- package/build/plugins/HLConstraints/components/CSysDisplayWrapper.d.ts +7 -0
- package/build/plugins/HLConstraints/components/HLConstrIcon.d.ts +7 -0
- package/build/plugins/HLConstraints/components/LimitedValue.d.ts +12 -0
- package/build/plugins/HLConstraints/components/Limits.d.ts +25 -0
- package/build/plugins/HLConstraints/components/LimitsCollapse.d.ts +12 -0
- package/build/plugins/HLConstraints/validators.d.ts +2 -0
- package/build/plugins/Import/Root.d.ts +11 -0
- package/build/plugins/Import/index.d.ts +35 -0
- package/build/plugins/LinearPattern/Root.d.ts +11 -0
- package/build/plugins/LinearPattern/index.d.ts +36 -0
- package/build/plugins/Measure/Digits.d.ts +7 -0
- package/build/plugins/Measure/Root.d.ts +11 -0
- package/build/plugins/Measure/View.d.ts +15 -0
- package/build/plugins/Measure/config.d.ts +1 -0
- package/build/plugins/Measure/graphics/MeasureGraphics.d.ts +24 -0
- package/build/plugins/Measure/index.d.ts +39 -0
- package/build/plugins/Measure/utils.d.ts +2 -0
- package/build/plugins/Mirror/Root.d.ts +11 -0
- package/build/plugins/Mirror/index.d.ts +34 -0
- package/build/plugins/Revolve/Root.d.ts +11 -0
- package/build/plugins/Revolve/index.d.ts +37 -0
- package/build/plugins/Rotate/Root.d.ts +11 -0
- package/build/plugins/Rotate/index.d.ts +35 -0
- package/build/plugins/Sketch/Root/Constraints/Constraints.d.ts +2 -0
- package/build/plugins/Sketch/Root/Constraints/constraintsHelpers.d.ts +22 -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/CopyPatterns.d.ts +2 -0
- package/build/plugins/Sketch/Root/Details.d.ts +2 -0
- package/build/plugins/Sketch/Root/Handlers.d.ts +2 -0
- package/build/plugins/Sketch/Root/PlaneSelection.d.ts +7 -0
- package/build/plugins/Sketch/Root/Position.d.ts +2 -0
- package/build/plugins/Sketch/Root/Regions.d.ts +2 -0
- package/build/plugins/Sketch/Root/Root.d.ts +11 -0
- package/build/plugins/Sketch/Root/RootContext.d.ts +7 -0
- package/build/plugins/Sketch/Root/SketchGroup.d.ts +15 -0
- package/build/plugins/Sketch/Root/index.d.ts +1 -0
- package/build/plugins/Sketch/Root/useContextMenuItems.d.ts +4 -0
- package/build/plugins/Sketch/Root/useLayoutSize.d.ts +11 -0
- package/build/plugins/Sketch/View/View.d.ts +11 -0
- package/build/plugins/Sketch/View/ViewContext.d.ts +8 -0
- package/build/plugins/Sketch/View/graphics/Constraints.d.ts +5 -0
- package/build/plugins/Sketch/View/graphics/IconGroups.d.ts +7 -0
- package/build/plugins/Sketch/View/graphics/Merged/Arc.d.ts +20 -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/Bezier.d.ts +19 -0
- package/build/plugins/Sketch/View/graphics/Merged/BezierGeometry.d.ts +12 -0
- package/build/plugins/Sketch/View/graphics/Merged/BezierMaterial.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/Circle.d.ts +9 -0
- package/build/plugins/Sketch/View/graphics/Merged/Line.d.ts +15 -0
- package/build/plugins/Sketch/View/graphics/Merged/LineGeometry.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/LineMaterial.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/MergedWrapper.d.ts +16 -0
- package/build/plugins/Sketch/View/graphics/Merged/Point.d.ts +8 -0
- package/build/plugins/Sketch/View/graphics/Merged/Spline.d.ts +17 -0
- package/build/plugins/Sketch/View/graphics/Merged/SplineGeometry.d.ts +11 -0
- package/build/plugins/Sketch/View/graphics/Merged/SplineMaterial.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/MousePosition.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Regions.d.ts +5 -0
- package/build/plugins/Sketch/View/graphics/TmpAngularDimension.d.ts +8 -0
- package/build/plugins/Sketch/View/graphics/graphics.d.ts +5 -0
- package/build/plugins/Sketch/View/graphics/hooks.d.ts +49 -0
- package/build/plugins/Sketch/View/graphics/primitives.d.ts +34 -0
- package/build/plugins/Sketch/View/graphics/scale.d.ts +6 -0
- package/build/plugins/Sketch/View/graphics/tmpGraphics.d.ts +3 -0
- package/build/plugins/Sketch/View/graphics/transform.d.ts +4 -0
- package/build/plugins/Sketch/View/handlers/CreateAngle.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/CreateConstraint.d.ts +10 -0
- package/build/plugins/Sketch/View/handlers/Drag.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawArc.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawCircle.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawLine.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawNurbs.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawPoint.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/DrawRectangle.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/Fillet.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/HandlersConstructors.d.ts +33 -0
- package/build/plugins/Sketch/View/handlers/Hover.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/SSelect.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/Split.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/Trim.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/Use.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/constraintCreation.d.ts +10 -0
- package/build/plugins/Sketch/View/handlers/filletHelpers.d.ts +24 -0
- package/build/plugins/Sketch/View/handlers/hoverHelpers.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/snapper.d.ts +11 -0
- package/build/plugins/Sketch/View/handlers/splitHelpers.d.ts +20 -0
- package/build/plugins/Sketch/View/index.d.ts +1 -0
- package/build/plugins/Sketch/constants.d.ts +5 -0
- package/build/plugins/Sketch/description.d.ts +7 -0
- package/build/plugins/Sketch/index.d.ts +35 -0
- package/build/plugins/Sketch/resources.d.ts +5 -0
- package/build/plugins/Sketch/types.d.ts +148 -0
- package/build/plugins/Sketch/utils/Interaction.d.ts +7 -0
- package/build/plugins/Sketch/utils/OverdefinedStateManager.d.ts +6 -0
- package/build/plugins/Sketch/utils/getSketchState.d.ts +3 -0
- package/build/plugins/Sketch/utils/useSketchRegions.d.ts +2 -0
- package/build/plugins/Sketch/utils/useSketchState.d.ts +3 -0
- package/build/plugins/Slice/Root.d.ts +11 -0
- package/build/plugins/Slice/index.d.ts +34 -0
- package/build/plugins/SliceBySheet/Root.d.ts +11 -0
- package/build/plugins/SliceBySheet/index.d.ts +35 -0
- package/build/plugins/Sphere/Root.d.ts +11 -0
- package/build/plugins/Sphere/index.d.ts +35 -0
- package/build/plugins/TransformByCsys/Root.d.ts +11 -0
- package/build/plugins/TransformByCsys/index.d.ts +35 -0
- package/build/plugins/Translate/Root.d.ts +11 -0
- package/build/plugins/Translate/index.d.ts +35 -0
- package/build/plugins/Twist/Root.d.ts +11 -0
- package/build/plugins/Twist/View.d.ts +11 -0
- package/build/plugins/Twist/index.d.ts +48 -0
- package/build/plugins/WorkAxis/Root.d.ts +11 -0
- package/build/plugins/WorkAxis/View.d.ts +11 -0
- package/build/plugins/WorkAxis/index.d.ts +37 -0
- package/build/plugins/WorkCSys/Root.d.ts +11 -0
- package/build/plugins/WorkCSys/View.d.ts +11 -0
- package/build/plugins/WorkCSys/index.d.ts +53 -0
- package/build/plugins/WorkCoordSystem/Root.d.ts +11 -0
- package/build/plugins/WorkCoordSystem/View.d.ts +11 -0
- package/build/plugins/WorkCoordSystem/index.d.ts +55 -0
- package/build/plugins/WorkPlane/Root.d.ts +11 -0
- package/build/plugins/WorkPlane/View.d.ts +11 -0
- package/build/plugins/WorkPlane/index.d.ts +38 -0
- package/build/plugins/WorkPlane/validators.d.ts +1 -0
- package/build/plugins/WorkPoint/Root.d.ts +11 -0
- package/build/plugins/WorkPoint/View.d.ts +11 -0
- package/build/plugins/WorkPoint/index.d.ts +38 -0
- package/build/plugins/components/PluginForm.d.ts +24 -0
- package/build/plugins/utils/useRefsReset.d.ts +2 -0
- package/build/session/identity.d.ts +46 -0
- package/build/session/sessionClient.d.ts +140 -0
- package/build/session/types.d.ts +52 -0
- package/build/session/viewpoints.d.ts +90 -0
- package/build/theme/AppStyle.d.ts +33 -0
- package/build/theme/fonts/mono.d.ts +29 -0
- package/build/theme/stage.d.ts +148 -0
- package/build/theme/styles/antdChoices.d.ts +1 -0
- package/build/theme/styles/antdControls.d.ts +1 -0
- package/build/theme/styles/antdSurfaces.d.ts +1 -0
- package/build/theme/styles/editors.d.ts +1 -0
- package/build/theme/styles/fields.d.ts +1 -0
- package/build/theme/styles/frame.d.ts +1 -0
- package/build/theme/styles/panes.d.ts +1 -0
- package/build/theme/styles/parts.d.ts +2 -0
- package/build/theme/styles/rest.d.ts +1 -0
- package/build/theme/styles/sketch.d.ts +1 -0
- package/build/theme/styles/toolbar.d.ts +1 -0
- package/build/theme/styles/tools.d.ts +1 -0
- package/build/theme/styles/windows.d.ts +1 -0
- package/build/theme/themeStore.d.ts +305 -0
- package/build/types/jsx-compat.d.ts +8 -0
- package/build/types.d.ts +16 -0
- package/build/utils/FileUtils.d.ts +20 -0
- package/build/utils/bezierMatrices.d.ts +3 -0
- package/build/utils/conversionUtils.d.ts +78 -0
- package/build/utils/cubicSplineInterpolation.d.ts +5 -0
- package/build/utils/defaultValues.d.ts +3 -0
- package/build/utils/drawing/index.d.ts +3 -0
- package/build/utils/drawing/useDrawingArr.d.ts +10 -0
- package/build/utils/drawing/useDrawingCCId.d.ts +10 -0
- package/build/utils/drawing/useDrawingStr.d.ts +10 -0
- package/build/utils/getHighlightedColor.d.ts +6 -0
- package/build/utils/getMatePath.d.ts +2 -0
- package/build/utils/getMateRefIds.d.ts +30 -0
- package/build/utils/helpers.d.ts +19 -0
- package/build/utils/mateUtils.d.ts +35 -0
- package/build/utils/nurbsUtils.d.ts +35 -0
- package/build/utils/selection/filters.d.ts +12 -0
- package/build/utils/selection/scopes/mateSelection.d.ts +49 -0
- package/build/utils/selection/scopes/treeObjInteraction.d.ts +74 -0
- package/build/utils/selection/useSelectorsOrder.d.ts +12 -0
- package/build/utils/sketchIntersectionUtils.d.ts +139 -0
- package/build/utils/sketchUtils.d.ts +235 -0
- package/build/utils/useAllObjects.d.ts +31 -0
- package/build/utils/useIsUncommited.d.ts +2 -0
- package/build/utils/useRetainVisibility.d.ts +2 -0
- package/build/utils/useScale.d.ts +5 -0
- package/build/utils/validation.d.ts +11 -0
- package/doc/api/advanced/session.md +646 -0
- package/doc/api/advanced/utilities.md +1306 -0
- package/doc/api/assembly-constraints.md +340 -0
- package/doc/api/feature-plugins.md +613 -0
- package/doc/api/graphics.md +848 -0
- package/doc/api/hooks.md +300 -0
- package/doc/api/icons.md +812 -0
- package/doc/api/index.md +87 -0
- package/doc/api/other.md +369 -0
- package/doc/api/panels.md +754 -0
- package/doc/api/theme.md +551 -0
- package/doc/api/tool-plugins.md +191 -0
- package/doc/api/ui-elements.md +310 -0
- package/doc/api/work-geometry.md +154 -0
- package/icons/package.json +8 -0
- package/package.json +108 -4
- package/tools/fonts/brotli.py +29 -0
- package/tools/fonts/build.py +76 -0
- package/tools/icons/preview.mjs +74 -0
- package/tsconfig.build.json +16 -0
- package/typedoc.json +18 -0
- package/vitest.config.mts +25 -0
package/doc/api/theme.md
ADDED
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
# Theme
|
|
2
|
+
|
|
3
|
+
The app's stylesheet, its colours in light and in dark, the stage's colours, and the switch between the two.
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
### AppStyle {#appstyle}
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
const AppStyle: React.FC;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Mounts the app's tokens and styles, as global stylesheets that live as long as it is mounted.
|
|
14
|
+
|
|
15
|
+
The tokens are the colours of the current theme ([ThemeColors](#themecolors)), each a custom property on `:root`,
|
|
16
|
+
`--rcad-<kebab-case>` (`--rcad-ink`, `--rcad-accent-fill`), with the app's metrics (`--rcad-row-h`, …) and its face,
|
|
17
|
+
JetBrains Mono, which the library carries. The styles name only those properties, so they follow the theme.
|
|
18
|
+
|
|
19
|
+
[Drawing](panels.md#drawing) renders it. A host that composes the pieces itself (a [ModelTree](panels.md#modeltree) here, a [ToolBar](panels.md#toolbar)
|
|
20
|
+
there) renders one `<AppStyle />` beside them, and puts them inside an element with the class `rcad`, which sets
|
|
21
|
+
the app's type.
|
|
22
|
+
|
|
23
|
+
#### Example
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import type { DrawingID } from '@classcad/sdkjs'
|
|
27
|
+
import { AppStyle, ModelTree, ToolBar } from '@classcad/react-cad'
|
|
28
|
+
|
|
29
|
+
// two pieces in a page of the app's own: one stylesheet, and the class that sets the app's type
|
|
30
|
+
const Pieces = ({ drawingId }: { drawingId: DrawingID }) => (
|
|
31
|
+
<div className="rcad">
|
|
32
|
+
<AppStyle />
|
|
33
|
+
<ToolBar drawingId={drawingId} />
|
|
34
|
+
<div style={{ height: 400 }}>
|
|
35
|
+
<ModelTree drawingId={drawingId} />
|
|
36
|
+
</div>
|
|
37
|
+
<p style={{ color: 'var(--rcad-mute)' }}>The tokens are custom properties too.</p>
|
|
38
|
+
</div>
|
|
39
|
+
)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
***
|
|
43
|
+
|
|
44
|
+
### ThemeToggle {#themetoggle}
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
const ThemeToggle: React.FC;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The theme switch: a button with a disc, half inked, that switches between the light and the dark theme.
|
|
51
|
+
|
|
52
|
+
It sets the mode with [setRCadThemeMode](#setrcadthememode), which remembers the reader's pick for the next visit. The disc turns
|
|
53
|
+
to the other side in the dark. [Drawing](panels.md#drawing) shows it at the end of its bar (unless `themeSwitch` is `false`).
|
|
54
|
+
|
|
55
|
+
#### Example
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import type { DrawingID } from '@classcad/sdkjs'
|
|
59
|
+
import { AppStyle, ThemeToggle, ToolBar } from '@classcad/react-cad'
|
|
60
|
+
|
|
61
|
+
// a bar of the app's own: its tools, and the theme switch at its end
|
|
62
|
+
const Bar = ({ drawingId }: { drawingId: DrawingID }) => (
|
|
63
|
+
<header className="rcad" style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
64
|
+
<AppStyle />
|
|
65
|
+
<ToolBar drawingId={drawingId} />
|
|
66
|
+
<ThemeToggle />
|
|
67
|
+
</header>
|
|
68
|
+
)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Functions
|
|
72
|
+
|
|
73
|
+
### setRCadThemeMode() {#setrcadthememode}
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
function setRCadThemeMode(mode, options?): void;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Sets the app's theme to light or dark.
|
|
80
|
+
|
|
81
|
+
The pick is remembered for the next visit (in `localStorage`); picking what the system has forgets it, so that the
|
|
82
|
+
app follows the system again. A page that has a theme of its own passes `{ remember: false }` and calls this
|
|
83
|
+
whenever its theme changes: the app then follows the page (and [Drawing](panels.md#drawing) is given `themeSwitch={false}`).
|
|
84
|
+
|
|
85
|
+
#### Parameters
|
|
86
|
+
|
|
87
|
+
| Parameter | Type | Description |
|
|
88
|
+
| :------ | :------ | :------ |
|
|
89
|
+
| `mode` | [`ThemeMode`](#thememode) | The theme to show. |
|
|
90
|
+
| `options?` | \{ `remember?`: `boolean`; \} | `remember: false` leaves the reader's remembered pick alone. |
|
|
91
|
+
| `options.remember?` | `boolean` | - |
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
`void`
|
|
96
|
+
|
|
97
|
+
#### Example
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import { useEffect } from 'react'
|
|
101
|
+
import type { DrawingID } from '@classcad/sdkjs'
|
|
102
|
+
import { Drawing, setRCadThemeMode } from '@classcad/react-cad'
|
|
103
|
+
|
|
104
|
+
// a page with a theme switch of its own: the app follows it, and shows no switch of its own
|
|
105
|
+
function EditorPage({ dark, drawingId }: { dark: boolean; drawingId: DrawingID }) {
|
|
106
|
+
useEffect(() => setRCadThemeMode(dark ? 'dark' : 'light', { remember: false }), [dark])
|
|
107
|
+
return <Drawing drawingId={drawingId} themeSwitch={false} />
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
***
|
|
112
|
+
|
|
113
|
+
### getStage() {#getstage}
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
function getStage(): StageColors;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The stage's colours in the current theme, outside of a component (as [useStage](#usestage), without rendering again).
|
|
120
|
+
|
|
121
|
+
#### Returns
|
|
122
|
+
|
|
123
|
+
[`StageColors`](#stagecolors-3)
|
|
124
|
+
|
|
125
|
+
#### Example
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { init, WASMClient } from '@classcad/client'
|
|
129
|
+
import { elements, getStage } from '@classcad/react-cad'
|
|
130
|
+
|
|
131
|
+
// buerli's highlight colours from the stage's, as Buerligons sets them
|
|
132
|
+
const stage = getStage()
|
|
133
|
+
init((drawingId) => new WASMClient(drawingId, { token: 'ccpk_…' }), {
|
|
134
|
+
elements,
|
|
135
|
+
theme: { primary: stage.pick, secondary: stage.hover, dark: stage.datum, highlightedGeom: stage.select, hoveredGeom: stage.hover },
|
|
136
|
+
})
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Hooks
|
|
140
|
+
|
|
141
|
+
### useRCadTheme() {#usercadtheme}
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
function useRCadTheme(): ThemeColors;
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Returns the colours of the current theme, and renders again when the theme changes.
|
|
148
|
+
|
|
149
|
+
#### Returns
|
|
150
|
+
|
|
151
|
+
[`ThemeColors`](#themecolors)
|
|
152
|
+
|
|
153
|
+
[lightTheme](#lighttheme) or [darkTheme](#darktheme).
|
|
154
|
+
|
|
155
|
+
#### Example
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
import { useRCadTheme, useRCadThemeMode } from '@classcad/react-cad'
|
|
159
|
+
|
|
160
|
+
// a panel of the app's own in the app's colours, in either theme
|
|
161
|
+
function Note({ children }: { children: React.ReactNode }) {
|
|
162
|
+
const colors = useRCadTheme()
|
|
163
|
+
const mode = useRCadThemeMode()
|
|
164
|
+
return (
|
|
165
|
+
<div style={{ background: colors.panel, color: colors.ink, border: `1px solid ${colors.line}`, boxShadow: colors.shadow }}>
|
|
166
|
+
{children} <small style={{ color: colors.dim }}>({mode})</small>
|
|
167
|
+
</div>
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
***
|
|
173
|
+
|
|
174
|
+
### useStage() {#usestage}
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
function useStage(): StageColors;
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Returns the stage's colours in the current theme, and renders again when the theme changes.
|
|
181
|
+
|
|
182
|
+
#### Returns
|
|
183
|
+
|
|
184
|
+
[`StageColors`](#stagecolors-3)
|
|
185
|
+
|
|
186
|
+
#### Example
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
import { Line } from '@react-three/drei'
|
|
190
|
+
import { useStage } from '@classcad/react-cad'
|
|
191
|
+
|
|
192
|
+
// a guide of the app's own on the stage, in the stage's colours: it follows the theme
|
|
193
|
+
function Guide({ from, to }: { from: [number, number, number]; to: [number, number, number] }) {
|
|
194
|
+
const stage = useStage()
|
|
195
|
+
return <Line points={[from, to]} color={stage.datum} lineWidth={1.5} dashed dashSize={2} gapSize={2} />
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
***
|
|
200
|
+
|
|
201
|
+
### useRCadThemeMode() {#usercadthememode}
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
function useRCadThemeMode(): ThemeMode;
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Returns the current theme's mode, `'light'` or `'dark'`, and renders again when it changes.
|
|
208
|
+
|
|
209
|
+
The example of [useRCadTheme](#usercadtheme) uses it beside the colours.
|
|
210
|
+
|
|
211
|
+
#### Returns
|
|
212
|
+
|
|
213
|
+
[`ThemeMode`](#thememode)
|
|
214
|
+
|
|
215
|
+
## Types
|
|
216
|
+
|
|
217
|
+
### StageColors {#stagecolors-3}
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
type StageColors = {
|
|
221
|
+
alt: string;
|
|
222
|
+
axisX: string;
|
|
223
|
+
axisY: string;
|
|
224
|
+
axisZ: string;
|
|
225
|
+
badgeDisc: string;
|
|
226
|
+
badgeInk: string;
|
|
227
|
+
badgeRing: string;
|
|
228
|
+
body: string;
|
|
229
|
+
datum: string;
|
|
230
|
+
dimExpr: string;
|
|
231
|
+
dimHalo: string;
|
|
232
|
+
dimLine: string;
|
|
233
|
+
dimText: string;
|
|
234
|
+
edge: string;
|
|
235
|
+
gridMajor: string;
|
|
236
|
+
gridMinor: string;
|
|
237
|
+
hover: string;
|
|
238
|
+
pick: string;
|
|
239
|
+
plane: string;
|
|
240
|
+
select: string;
|
|
241
|
+
sketchConstruction: string;
|
|
242
|
+
sketchDimmed: string;
|
|
243
|
+
sketchFree: string;
|
|
244
|
+
sketchHover: string;
|
|
245
|
+
sketchHoverSoft: string;
|
|
246
|
+
sketchIdle: string;
|
|
247
|
+
sketchIdlePoint: string;
|
|
248
|
+
sketchMark: string;
|
|
249
|
+
sketchOver: string;
|
|
250
|
+
sketchRedundant: string;
|
|
251
|
+
sketchSelect: string;
|
|
252
|
+
sketchSolved: string;
|
|
253
|
+
};
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
The colours of what is drawn on the stage: the model, what lies over it, a sketch on its sheet.
|
|
257
|
+
|
|
258
|
+
They are written down in BRANDING.md, "The stage". The model is a solid grey body with ink edges. What a sketch's
|
|
259
|
+
colours say is the editor's own code (how far a curve is defined), in the family's tones. [useStage](#usestage) gives
|
|
260
|
+
them for the current theme; they are CSS colour strings (`#rrggbb`), which three.js takes as they are.
|
|
261
|
+
|
|
262
|
+
#### Properties
|
|
263
|
+
|
|
264
|
+
| Property | Type | Description |
|
|
265
|
+
| :------ | :------ | :------ |
|
|
266
|
+
| <a id="property-alt"></a> `alt` | `string` | Stands in for the highlight on a body of nearly its colour. |
|
|
267
|
+
| <a id="property-axisx"></a> `axisX` | `string` | The X axis: red. |
|
|
268
|
+
| <a id="property-axisy"></a> `axisY` | `string` | The Y axis: green. |
|
|
269
|
+
| <a id="property-axisz"></a> `axisZ` | `string` | The Z axis: blue. |
|
|
270
|
+
| <a id="property-badgedisc"></a> `badgeDisc` | `string` | A constraint's badge at rest: its disc. |
|
|
271
|
+
| <a id="property-badgeink"></a> `badgeInk` | `string` | A constraint's badge: its glyph, in whatever state the badge is. |
|
|
272
|
+
| <a id="property-badgering"></a> `badgeRing` | `string` | A constraint's badge at rest: the faint shadow around its disc. |
|
|
273
|
+
| <a id="property-body"></a> `body` | `string` | A body the model gives no colour of its own: a neutral grey, clearly off the ground. |
|
|
274
|
+
| <a id="property-datum"></a> `datum` | `string` | A point or an axis of the part's own, and the origin. |
|
|
275
|
+
| <a id="property-dimexpr"></a> `dimExpr` | `string` | A value that is an expression. |
|
|
276
|
+
| <a id="property-dimhalo"></a> `dimHalo` | `string` | What its text stands on. |
|
|
277
|
+
| <a id="property-dimline"></a> `dimLine` | `string` | A dimension's lines and arrows. |
|
|
278
|
+
| <a id="property-dimtext"></a> `dimText` | `string` | A dimension's value, a readout's text. |
|
|
279
|
+
| <a id="property-edge"></a> `edge` | `string` | Its edges: ink, in either theme. |
|
|
280
|
+
| <a id="property-gridmajor"></a> `gridMajor` | `string` | Its rule around every fifth. |
|
|
281
|
+
| <a id="property-gridminor"></a> `gridMinor` | `string` | The squared sheet's rule around every cell. |
|
|
282
|
+
| <a id="property-hover"></a> `hover` | `string` | Under the pointer: the highlight, held back. |
|
|
283
|
+
| <a id="property-pick"></a> `pick` | `string` | Taken by the feature being made: red. |
|
|
284
|
+
| <a id="property-plane"></a> `plane` | `string` | A plane: the outline, and the same colour, thinned, as its fill. |
|
|
285
|
+
| <a id="property-select"></a> `select` | `string` | In hand: the highlight. |
|
|
286
|
+
| <a id="property-sketchconstruction"></a> `sketchConstruction` | `string` | A construction curve that is not fully defined: grey. |
|
|
287
|
+
| <a id="property-sketchdimmed"></a> `sketchDimmed` | `string` | Geometry that cannot be picked for the constraint being made: faded towards the ground. |
|
|
288
|
+
| <a id="property-sketchfree"></a> `sketchFree` | `string` | A curve the solver can still move (under-defined): blue. |
|
|
289
|
+
| <a id="property-sketchhover"></a> `sketchHover` | `string` | Under the pointer: green. |
|
|
290
|
+
| <a id="property-sketchhoversoft"></a> `sketchHoverSoft` | `string` | Pointed at from a list: the same green, paler. |
|
|
291
|
+
| <a id="property-sketchidle"></a> `sketchIdle` | `string` | A sketch that is not being edited: teal. |
|
|
292
|
+
| <a id="property-sketchidlepoint"></a> `sketchIdlePoint` | `string` | The points of a sketch that is not being edited: a shade deeper. |
|
|
293
|
+
| <a id="property-sketchmark"></a> `sketchMark` | `string` | A constraint or a region in hand: yellow. |
|
|
294
|
+
| <a id="property-sketchover"></a> `sketchOver` | `string` | A curve, or a constraint, that is defined more than once: red. |
|
|
295
|
+
| <a id="property-sketchredundant"></a> `sketchRedundant` | `string` | A constraint that says what is already so: orange. |
|
|
296
|
+
| <a id="property-sketchselect"></a> `sketchSelect` | `string` | A curve or a point in hand: amber. |
|
|
297
|
+
| <a id="property-sketchsolved"></a> `sketchSolved` | `string` | A curve that is fully defined: ink. |
|
|
298
|
+
|
|
299
|
+
***
|
|
300
|
+
|
|
301
|
+
### ThemeColors {#themecolors}
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
type ThemeColors = {
|
|
305
|
+
accent: string;
|
|
306
|
+
accentFill: string;
|
|
307
|
+
accentHover: string;
|
|
308
|
+
accentLine: string;
|
|
309
|
+
accentTint: string;
|
|
310
|
+
accentWash: string;
|
|
311
|
+
active: string;
|
|
312
|
+
axisX: string;
|
|
313
|
+
axisY: string;
|
|
314
|
+
axisZ: string;
|
|
315
|
+
blue: string;
|
|
316
|
+
canvasDimLine: number;
|
|
317
|
+
canvasLabelBg: number;
|
|
318
|
+
canvasText: number;
|
|
319
|
+
chrome: string;
|
|
320
|
+
chromeLine: string;
|
|
321
|
+
dim: string;
|
|
322
|
+
geoAlt: string;
|
|
323
|
+
geoBody: string;
|
|
324
|
+
geoEdge: string;
|
|
325
|
+
geoHover: string;
|
|
326
|
+
geoPick: string;
|
|
327
|
+
geoSelect: string;
|
|
328
|
+
green: string;
|
|
329
|
+
hover: string;
|
|
330
|
+
ink: string;
|
|
331
|
+
ink2: string;
|
|
332
|
+
line: string;
|
|
333
|
+
line2: string;
|
|
334
|
+
mute: string;
|
|
335
|
+
onAccent: string;
|
|
336
|
+
onGreen: string;
|
|
337
|
+
orange: string;
|
|
338
|
+
panel: string;
|
|
339
|
+
panel2: string;
|
|
340
|
+
paper: string;
|
|
341
|
+
ring: string;
|
|
342
|
+
shadow: string;
|
|
343
|
+
shadowLg: string;
|
|
344
|
+
toastBg: string;
|
|
345
|
+
toastStrong: string;
|
|
346
|
+
toastText: string;
|
|
347
|
+
viewport: string;
|
|
348
|
+
};
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
The colours of the app, in light and in dark: [lightTheme](#lighttheme) and [darkTheme](#darktheme).
|
|
352
|
+
|
|
353
|
+
They are the family's own (paper and ink, one red; graphite and chalk in the dark), written down for a technical
|
|
354
|
+
application in BRANDING.md, "The app". Every one of them that is a string is also a custom property on `:root`,
|
|
355
|
+
`--rcad-<kebab-case>` (`accentFill` is `--rcad-accent-fill`), which is what the stylesheet draws from (see
|
|
356
|
+
[AppStyle](#appstyle)). The colours of what is drawn on the stage are [StageColors](#stagecolors-3).
|
|
357
|
+
|
|
358
|
+
#### Properties
|
|
359
|
+
|
|
360
|
+
| Property | Type | Description |
|
|
361
|
+
| :------ | :------ | :------ |
|
|
362
|
+
| <a id="property-accent"></a> `accent` | `string` | Red as type and lines. |
|
|
363
|
+
| <a id="property-accentfill"></a> `accentFill` | `string` | Red as a fill: the one primary action. |
|
|
364
|
+
| <a id="property-accenthover"></a> `accentHover` | `string` | Hover on a red fill. |
|
|
365
|
+
| <a id="property-accentline"></a> `accentLine` | `string` | A hairline of red: focus, a field under the hand. |
|
|
366
|
+
| <a id="property-accenttint"></a> `accentTint` | `string` | A stronger wash, for small marks (icons). |
|
|
367
|
+
| <a id="property-accentwash"></a> `accentWash` | `string` | A wash of red: over what a feature made, behind a changed value. |
|
|
368
|
+
| <a id="property-active"></a> `active` | `string` | A row or a button that is on, or held. |
|
|
369
|
+
| <a id="property-axisx-1"></a> `axisX` | `string` | The X axis: red. On the stage's triad, and in a sign about it. |
|
|
370
|
+
| <a id="property-axisy-1"></a> `axisY` | `string` | The Y axis: green. |
|
|
371
|
+
| <a id="property-axisz-1"></a> `axisZ` | `string` | The Z axis: blue. |
|
|
372
|
+
| <a id="property-blue"></a> `blue` | `string` | A note; what the engine reports. |
|
|
373
|
+
| <a id="property-canvasdimline"></a> `canvasDimLine` | `number` | A dimension's lines and arrows on the stage, as a number for three.js. |
|
|
374
|
+
| <a id="property-canvaslabelbg"></a> `canvasLabelBg` | `number` | The ground of a label on the stage (a measure, a dimension), as a number for three.js. |
|
|
375
|
+
| <a id="property-canvastext"></a> `canvasText` | `number` | Text on the stage (a dimension's value, a readout), as a number for three.js (`0x1a1a3a`). |
|
|
376
|
+
| <a id="property-chrome"></a> `chrome` | `string` | Bars, the sidebar, menus: the app's own paper. |
|
|
377
|
+
| <a id="property-chromeline"></a> `chromeLine` | `string` | The rule between two pieces of chrome. |
|
|
378
|
+
| <a id="property-dim"></a> `dim` | `string` | Labels, captions, metadata, what is switched off. |
|
|
379
|
+
| <a id="property-geoalt"></a> `geoAlt` | `string` | Stands in for the highlight on a body of nearly its colour. |
|
|
380
|
+
| <a id="property-geobody"></a> `geoBody` | `string` | A body the model gives no colour of its own: a neutral grey, clearly off the ground. |
|
|
381
|
+
| <a id="property-geoedge"></a> `geoEdge` | `string` | An edge of the model: ink, in either theme. |
|
|
382
|
+
| <a id="property-geohover"></a> `geoHover` | `string` | Under the pointer: the highlight, held back. |
|
|
383
|
+
| <a id="property-geopick"></a> `geoPick` | `string` | Taken by the feature being made: red, as everything a feature makes. |
|
|
384
|
+
| <a id="property-geoselect"></a> `geoSelect` | `string` | In hand: the highlight, "a face lit". |
|
|
385
|
+
| <a id="property-green"></a> `green` | `string` | Done, proven, live. |
|
|
386
|
+
| <a id="property-hover-1"></a> `hover` | `string` | A row or a button under the pointer. |
|
|
387
|
+
| <a id="property-ink"></a> `ink` | `string` | Headings, primary text, icons. |
|
|
388
|
+
| <a id="property-ink2"></a> `ink2` | `string` | Rows, values, secondary content. |
|
|
389
|
+
| <a id="property-line"></a> `line` | `string` | A hairline over any ground. |
|
|
390
|
+
| <a id="property-line2"></a> `line2` | `string` | A stronger hairline: a field's edge under the pointer, a key cap. |
|
|
391
|
+
| <a id="property-mute"></a> `mute` | `string` | Body copy, notes. |
|
|
392
|
+
| <a id="property-onaccent"></a> `onAccent` | `string` | Type on a red fill. |
|
|
393
|
+
| <a id="property-ongreen"></a> `onGreen` | `string` | Type on a green fill. |
|
|
394
|
+
| <a id="property-orange"></a> `orange` | `string` | Working, and a warning. |
|
|
395
|
+
| <a id="property-panel"></a> `panel` | `string` | Windows and cards that float over the viewport. |
|
|
396
|
+
| <a id="property-panel2"></a> `panel2` | `string` | Inset fills: fields, chips, a pressed button. |
|
|
397
|
+
| <a id="property-paper"></a> `paper` | `string` | The sheet a sketch is drawn on. |
|
|
398
|
+
| <a id="property-ring"></a> `ring` | `string` | The hairline ring a floating thing carries with its shadow. |
|
|
399
|
+
| <a id="property-shadow"></a> `shadow` | `string` | Menus, small cards. |
|
|
400
|
+
| <a id="property-shadowlg"></a> `shadowLg` | `string` | Windows. |
|
|
401
|
+
| <a id="property-toastbg"></a> `toastBg` | `string` | The ground of a toast or a tooltip. |
|
|
402
|
+
| <a id="property-toaststrong"></a> `toastStrong` | `string` | What stands out in it: a title, a value. |
|
|
403
|
+
| <a id="property-toasttext"></a> `toastText` | `string` | Its text. |
|
|
404
|
+
| <a id="property-viewport"></a> `viewport` | `string` | The ground the model is shown on. |
|
|
405
|
+
|
|
406
|
+
***
|
|
407
|
+
|
|
408
|
+
### ThemeMode {#thememode}
|
|
409
|
+
|
|
410
|
+
```ts
|
|
411
|
+
type ThemeMode = "light" | "dark";
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
The theme's mode: light, or dark.
|
|
415
|
+
|
|
416
|
+
## Advanced
|
|
417
|
+
|
|
418
|
+
Most apps do not need these directly: types they meet through the exports above, and what is there for special cases or for building on buerli itself.
|
|
419
|
+
|
|
420
|
+
### darkStage {#darkstage}
|
|
421
|
+
|
|
422
|
+
```ts
|
|
423
|
+
const darkStage: StageColors;
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
The stage's colours in the dark theme. [useStage](#usestage) gives the current theme's; see also [stageColors](#stagecolors).
|
|
427
|
+
|
|
428
|
+
***
|
|
429
|
+
|
|
430
|
+
### darkTheme {#darktheme}
|
|
431
|
+
|
|
432
|
+
```ts
|
|
433
|
+
const darkTheme: ThemeColors;
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
The app's colours in the dark theme: graphite and chalk, one red. See the example of [lightTheme](#lighttheme).
|
|
437
|
+
|
|
438
|
+
***
|
|
439
|
+
|
|
440
|
+
### lightStage {#lightstage}
|
|
441
|
+
|
|
442
|
+
```ts
|
|
443
|
+
const lightStage: StageColors;
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
The stage's colours in the light theme. [useStage](#usestage) gives the current theme's; see also [stageColors](#stagecolors).
|
|
447
|
+
|
|
448
|
+
***
|
|
449
|
+
|
|
450
|
+
### lightTheme {#lighttheme}
|
|
451
|
+
|
|
452
|
+
```ts
|
|
453
|
+
const lightTheme: ThemeColors;
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
The app's colours in the light theme: paper and ink, one red.
|
|
457
|
+
|
|
458
|
+
#### Example
|
|
459
|
+
|
|
460
|
+
```tsx
|
|
461
|
+
import { darkTheme, lightTheme } from '@classcad/react-cad'
|
|
462
|
+
|
|
463
|
+
// a page around the app in the app's colours, whatever its theme is now
|
|
464
|
+
const pageColors = (dark: boolean) => {
|
|
465
|
+
const colors = dark ? darkTheme : lightTheme
|
|
466
|
+
return { background: colors.viewport, color: colors.ink, accentColor: colors.accent }
|
|
467
|
+
}
|
|
468
|
+
document.body.style.background = pageColors(true).background
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
***
|
|
472
|
+
|
|
473
|
+
### stageColors() {#stagecolors}
|
|
474
|
+
|
|
475
|
+
```ts
|
|
476
|
+
function stageColors(mode): StageColors;
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
The stage's colours in a theme: [lightStage](#lightstage) or [darkStage](#darkstage).
|
|
480
|
+
|
|
481
|
+
#### Parameters
|
|
482
|
+
|
|
483
|
+
| Parameter | Type | Description |
|
|
484
|
+
| :------ | :------ | :------ |
|
|
485
|
+
| `mode` | [`ThemeMode`](#thememode) | The theme. |
|
|
486
|
+
|
|
487
|
+
#### Returns
|
|
488
|
+
|
|
489
|
+
[`StageColors`](#stagecolors-3)
|
|
490
|
+
|
|
491
|
+
#### Example
|
|
492
|
+
|
|
493
|
+
```tsx
|
|
494
|
+
import { stageColors } from '@classcad/react-cad'
|
|
495
|
+
|
|
496
|
+
// the stage's colours of both themes, side by side: a legend of what a sketch's colours say
|
|
497
|
+
const legend = (['light', 'dark'] as const).map((mode) => {
|
|
498
|
+
const s = stageColors(mode)
|
|
499
|
+
return { mode, free: s.sketchFree, solved: s.sketchSolved, over: s.sketchOver }
|
|
500
|
+
})
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
***
|
|
504
|
+
|
|
505
|
+
### stageFont {#stagefont}
|
|
506
|
+
|
|
507
|
+
```ts
|
|
508
|
+
const stageFont: string;
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
The face of what is written on the stage (a dimension, a readout), as a `data:` url: JetBrains Mono, latin, weight
|
|
512
|
+
500, without ligatures (woff).
|
|
513
|
+
|
|
514
|
+
It is what drei's `<Text font={stageFont}>` takes, so that a label of the app's own on the stage is set in the
|
|
515
|
+
app's face. (JetBrains Mono is under the SIL Open Font License.)
|
|
516
|
+
|
|
517
|
+
#### Example
|
|
518
|
+
|
|
519
|
+
```tsx
|
|
520
|
+
import { Text } from '@react-three/drei'
|
|
521
|
+
import { stageFont, useStage } from '@classcad/react-cad'
|
|
522
|
+
|
|
523
|
+
// a label of the app's own on the stage, set as a dimension is
|
|
524
|
+
function Label({ text, position }: { text: string; position: [number, number, number] }) {
|
|
525
|
+
const stage = useStage()
|
|
526
|
+
return (
|
|
527
|
+
<Text font={stageFont} fontSize={4} color={stage.dimText} position={position}>
|
|
528
|
+
{text}
|
|
529
|
+
</Text>
|
|
530
|
+
)
|
|
531
|
+
}
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
***
|
|
535
|
+
|
|
536
|
+
### useRCadThemeStore {#usercadthemestore}
|
|
537
|
+
|
|
538
|
+
```ts
|
|
539
|
+
const useRCadThemeStore: UseBoundStore<StoreApi<{
|
|
540
|
+
colors: ThemeColors;
|
|
541
|
+
mode: ThemeMode;
|
|
542
|
+
setMode: (mode, options?) => void;
|
|
543
|
+
}>>;
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
The theme's store (zustand): its `mode`, its `colors`, and `setMode`.
|
|
547
|
+
|
|
548
|
+
In a component, [useRCadTheme](#usercadtheme) and [useRCadThemeMode](#usercadthememode) read it; outside of one,
|
|
549
|
+
`useRCadThemeStore.getState()` does, and `useRCadThemeStore.subscribe` hears it change. The mode starts as the
|
|
550
|
+
reader picked it last time, or as the system has it (`prefers-color-scheme`), and follows the system while the
|
|
551
|
+
reader has picked nothing.
|