@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.
Files changed (471) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +98 -2
  3. package/build/components/UI/CAD/Constraints.d.ts +30 -0
  4. package/build/components/UI/CAD/Drawing.d.ts +83 -0
  5. package/build/components/UI/CAD/ListPlaceholder.d.ts +3 -0
  6. package/build/components/UI/CAD/Messages/Message.d.ts +8 -0
  7. package/build/components/UI/CAD/Messages/Messages.d.ts +43 -0
  8. package/build/components/UI/CAD/Messages/index.d.ts +1 -0
  9. package/build/components/UI/CAD/Messages/msgStore.d.ts +18 -0
  10. package/build/components/UI/CAD/ModelTree/AssemblyNode.d.ts +5 -0
  11. package/build/components/UI/CAD/ModelTree/FeatureList/Feature.d.ts +8 -0
  12. package/build/components/UI/CAD/ModelTree/FeatureList/FeatureList.d.ts +6 -0
  13. package/build/components/UI/CAD/ModelTree/FeatureList/index.d.ts +1 -0
  14. package/build/components/UI/CAD/ModelTree/FeatureList/utils.d.ts +26 -0
  15. package/build/components/UI/CAD/ModelTree/ModelTree.d.ts +56 -0
  16. package/build/components/UI/CAD/ModelTree/ModelTreeHeader.d.ts +15 -0
  17. package/build/components/UI/CAD/ModelTree/index.d.ts +1 -0
  18. package/build/components/UI/CAD/ModelTree/primitives.d.ts +6 -0
  19. package/build/components/UI/CAD/ModelTree/useContextMenuItems.d.ts +4 -0
  20. package/build/components/UI/CAD/PluginBounds.d.ts +8 -0
  21. package/build/components/UI/CAD/PluginTooltip.d.ts +5 -0
  22. package/build/components/UI/CAD/PluginsWindows.d.ts +99 -0
  23. package/build/components/UI/CAD/ReadOnlyContext.d.ts +10 -0
  24. package/build/components/UI/CAD/SideBar.d.ts +40 -0
  25. package/build/components/UI/CAD/Solids/Solids.d.ts +23 -0
  26. package/build/components/UI/CAD/Solids/index.d.ts +1 -0
  27. package/build/components/UI/CAD/Solids/useContextMenuItems.d.ts +4 -0
  28. package/build/components/UI/CAD/Solids/useVisibleSolids.d.ts +30 -0
  29. package/build/components/UI/CAD/StageHud.d.ts +9 -0
  30. package/build/components/UI/CAD/StatusBar.d.ts +11 -0
  31. package/build/components/UI/CAD/ThemeToggle.d.ts +25 -0
  32. package/build/components/UI/CAD/ToolBar/AssemblyModeCmds.d.ts +3 -0
  33. package/build/components/UI/CAD/ToolBar/PartModeCmds.d.ts +3 -0
  34. package/build/components/UI/CAD/ToolBar/ToolBar.d.ts +24 -0
  35. package/build/components/UI/CAD/ToolBar/index.d.ts +1 -0
  36. package/build/components/UI/CAD/ToolBar/useCommands.d.ts +12 -0
  37. package/build/components/UI/CAD/ViewOptionsBar/ViewOptionButtons.d.ts +30 -0
  38. package/build/components/UI/CAD/ViewOptionsBar/useOptionCommands.d.ts +65 -0
  39. package/build/components/UI/CAD/ViewPlugButtons.d.ts +43 -0
  40. package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModal.d.ts +18 -0
  41. package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalContext.d.ts +9 -0
  42. package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalInner.d.ts +27 -0
  43. package/build/components/UI/CAD/ant-design-draggable-modal/DraggableModalProvider.d.ts +4 -0
  44. package/build/components/UI/CAD/ant-design-draggable-modal/OverlayScrollbar.d.ts +6 -0
  45. package/build/components/UI/CAD/ant-design-draggable-modal/ResizeHandle.d.ts +2 -0
  46. package/build/components/UI/CAD/ant-design-draggable-modal/clamp.d.ts +1 -0
  47. package/build/components/UI/CAD/ant-design-draggable-modal/draggableModalReducer.d.ts +123 -0
  48. package/build/components/UI/CAD/ant-design-draggable-modal/getWindowSize.d.ts +4 -0
  49. package/build/components/UI/CAD/ant-design-draggable-modal/index.d.ts +3 -0
  50. package/build/components/UI/CAD/ant-design-draggable-modal/useDrag.d.ts +5 -0
  51. package/build/components/UI/CAD/ant-design-draggable-modal/usePrevious.d.ts +1 -0
  52. package/build/components/UI/CAD/ant-design-draggable-modal/useResize.d.ts +7 -0
  53. package/build/components/UI/CAD/common/BlankDiv.d.ts +3 -0
  54. package/build/components/UI/CAD/common/Collapse.d.ts +13 -0
  55. package/build/components/UI/CAD/common/ContextMenu.d.ts +115 -0
  56. package/build/components/UI/CAD/common/Divider.d.ts +4 -0
  57. package/build/components/UI/CAD/common/EntityName.d.ts +14 -0
  58. package/build/components/UI/CAD/common/Img.d.ts +6 -0
  59. package/build/components/UI/CAD/common/LoadingScreen/LoadingScreen.d.ts +8 -0
  60. package/build/components/UI/CAD/common/LoadingScreen/Spinner.d.ts +3 -0
  61. package/build/components/UI/CAD/common/LoadingScreen/index.d.ts +1 -0
  62. package/build/components/UI/CAD/common/Menu.d.ts +81 -0
  63. package/build/components/UI/CAD/common/MultiSelect.d.ts +12 -0
  64. package/build/components/UI/CAD/common/NameEdit.d.ts +7 -0
  65. package/build/components/UI/CAD/common/SectionHeader.d.ts +9 -0
  66. package/build/components/UI/CAD/common/primitives.d.ts +36 -0
  67. package/build/components/UI/CAD/common/reveal.d.ts +12 -0
  68. package/build/components/UI/CAD/hooks/index.d.ts +13 -0
  69. package/build/components/UI/CAD/hooks/useContextMenuInteraction.d.ts +7 -0
  70. package/build/components/UI/CAD/hooks/useContextMenuItems.d.ts +4 -0
  71. package/build/components/UI/CAD/hooks/useCurrentInstance.d.ts +2 -0
  72. package/build/components/UI/CAD/hooks/useCurrentProduct.d.ts +2 -0
  73. package/build/components/UI/CAD/hooks/useEditMode.d.ts +40 -0
  74. package/build/components/UI/CAD/hooks/useFeatureCount.d.ts +6 -0
  75. package/build/components/UI/CAD/hooks/useGlobalMateInfo.d.ts +6 -0
  76. package/build/components/UI/CAD/hooks/useHasPending.d.ts +27 -0
  77. package/build/components/UI/CAD/hooks/useIsDisabled.d.ts +2 -0
  78. package/build/components/UI/CAD/hooks/useIsLoading.d.ts +25 -0
  79. package/build/components/UI/CAD/hooks/useIsSketchActive.d.ts +26 -0
  80. package/build/components/UI/CAD/hooks/useObjectDetails.d.ts +12 -0
  81. package/build/components/UI/CAD/hooks/useOperationSequence.d.ts +29 -0
  82. package/build/components/UI/CAD/hooks/useRollbackBar.d.ts +8 -0
  83. package/build/components/UI/CAD/hooks/useRoot.d.ts +2 -0
  84. package/build/components/UI/CAD/index.d.ts +27 -0
  85. package/build/components/UI/CAD/plugins/ProductManagement/ProdTable.d.ts +10 -0
  86. package/build/components/UI/CAD/plugins/ProductManagement/Root.d.ts +11 -0
  87. package/build/components/UI/CAD/plugins/ProductManagement/View.d.ts +11 -0
  88. package/build/components/UI/CAD/plugins/ProductManagement/index.d.ts +34 -0
  89. package/build/components/UI/CAD/plugins/ProductManagement/types.d.ts +4 -0
  90. package/build/components/UI/CAD/plugins/ProductManagement/useContextMenuItems.d.ts +4 -0
  91. package/build/components/UI/CAD/plugins/SessionManagement/Root.d.ts +11 -0
  92. package/build/components/UI/CAD/plugins/SessionManagement/index.d.ts +36 -0
  93. package/build/components/UI/CAD/plugins/SessionManagement/types.d.ts +3 -0
  94. package/build/components/UI/CAD/store/CADActions.d.ts +29 -0
  95. package/build/components/UI/CAD/store/CADStore.d.ts +68 -0
  96. package/build/components/UI/CAD/store/instances.d.ts +7 -0
  97. package/build/components/UI/Readfile.d.ts +39 -0
  98. package/build/components/UI/ThemeVars.d.ts +6 -0
  99. package/build/components/UI/editors/BooleanEditor/BooleanEditor.d.ts +8 -0
  100. package/build/components/UI/editors/BooleanEditor/index.d.ts +2 -0
  101. package/build/components/UI/editors/BooleanEditor/useBoolParam.d.ts +3 -0
  102. package/build/components/UI/editors/CSysEditor/CSysEditor.d.ts +11 -0
  103. package/build/components/UI/editors/CSysEditor/index.d.ts +2 -0
  104. package/build/components/UI/editors/CSysEditor/useCSysParam.d.ts +9 -0
  105. package/build/components/UI/editors/ColorEditor/ColorEditor.d.ts +12 -0
  106. package/build/components/UI/editors/ColorEditor/index.d.ts +2 -0
  107. package/build/components/UI/editors/ColorEditor/useColorParam.d.ts +9 -0
  108. package/build/components/UI/editors/ExpressionEditor/ExpressionEditor.d.ts +20 -0
  109. package/build/components/UI/editors/ExpressionEditor/index.d.ts +2 -0
  110. package/build/components/UI/editors/ExpressionEditor/useExpressionsParam.d.ts +5 -0
  111. package/build/components/UI/editors/NumberEditor/Inputs.d.ts +18 -0
  112. package/build/components/UI/editors/NumberEditor/Mentions.d.ts +10 -0
  113. package/build/components/UI/editors/NumberEditor/NumOrExpr.d.ts +12 -0
  114. package/build/components/UI/editors/NumberEditor/NumberEditor.d.ts +12 -0
  115. package/build/components/UI/editors/NumberEditor/index.d.ts +2 -0
  116. package/build/components/UI/editors/NumberEditor/useNumParam.d.ts +5 -0
  117. package/build/components/UI/editors/PointEditor/PointEditor.d.ts +10 -0
  118. package/build/components/UI/editors/PointEditor/index.d.ts +2 -0
  119. package/build/components/UI/editors/PointEditor/usePointParam.d.ts +5 -0
  120. package/build/components/UI/editors/RefsEditors/ChainFinder.d.ts +12 -0
  121. package/build/components/UI/editors/RefsEditors/MateEditor.d.ts +13 -0
  122. package/build/components/UI/editors/RefsEditors/MateOrientationEditor.d.ts +9 -0
  123. package/build/components/UI/editors/RefsEditors/RefEditor.d.ts +24 -0
  124. package/build/components/UI/editors/RefsEditors/RefsEditor.d.ts +16 -0
  125. package/build/components/UI/editors/RefsEditors/index.d.ts +8 -0
  126. package/build/components/UI/editors/RefsEditors/pickers.d.ts +4 -0
  127. package/build/components/UI/editors/RefsEditors/useIdParam.d.ts +3 -0
  128. package/build/components/UI/editors/RefsEditors/useMateParam.d.ts +19 -0
  129. package/build/components/UI/editors/RefsEditors/useModes.d.ts +11 -0
  130. package/build/components/UI/editors/RefsEditors/useRefsParam.d.ts +3 -0
  131. package/build/components/UI/editors/RefsEditors/useSelectedItems.d.ts +18 -0
  132. package/build/components/UI/editors/ToleranceEditor/ToleranceEditor.d.ts +7 -0
  133. package/build/components/UI/editors/ToleranceEditor/index.d.ts +2 -0
  134. package/build/components/UI/editors/ToleranceEditor/useToleranceParam.d.ts +3 -0
  135. package/build/components/UI/editors/TypeEditor/TypeEditor.d.ts +10 -0
  136. package/build/components/UI/editors/TypeEditor/index.d.ts +2 -0
  137. package/build/components/UI/editors/TypeEditor/useTypeParam.d.ts +3 -0
  138. package/build/components/UI/editors/TypeWrapper.d.ts +6 -0
  139. package/build/components/UI/editors/Wrapper.d.ts +16 -0
  140. package/build/components/UI/editors/useParam.d.ts +20 -0
  141. package/build/components/UI/editors/useValidation.d.ts +4 -0
  142. package/build/components/graphics/Badge.d.ts +70 -0
  143. package/build/components/graphics/CSysDisplay.d.ts +108 -0
  144. package/build/components/graphics/CompositeCurveObj.d.ts +33 -0
  145. package/build/components/graphics/GeometryOverrides/GeometryOverridesManager.d.ts +41 -0
  146. package/build/components/graphics/GeometryOverrides/GeometryOverridesStore.d.ts +28 -0
  147. package/build/components/graphics/GeometryOverrides/index.d.ts +2 -0
  148. package/build/components/graphics/GeometryOverrides/useOverrideGeometryColor.d.ts +36 -0
  149. package/build/components/graphics/HUD.d.ts +44 -0
  150. package/build/components/graphics/HoveredConstraintDisplay.d.ts +24 -0
  151. package/build/components/graphics/InfinityPlane.d.ts +4 -0
  152. package/build/components/graphics/Outlines/AAPass.d.ts +8 -0
  153. package/build/components/graphics/Outlines/IDPass.d.ts +12 -0
  154. package/build/components/graphics/Outlines/Outline.d.ts +62 -0
  155. package/build/components/graphics/Outlines/OutlineEffect.d.ts +48 -0
  156. package/build/components/graphics/Outlines/OutlineMaterial.d.ts +9 -0
  157. package/build/components/graphics/Outlines/WidenPass.d.ts +17 -0
  158. package/build/components/graphics/PluginGeometryBounds.d.ts +40 -0
  159. package/build/components/graphics/SelectableMate.d.ts +3 -0
  160. package/build/components/graphics/SelectedMateObj.d.ts +54 -0
  161. package/build/components/graphics/StageLook.d.ts +51 -0
  162. package/build/components/graphics/WorkAxisObj.d.ts +33 -0
  163. package/build/components/graphics/WorkCSysObj.d.ts +33 -0
  164. package/build/components/graphics/WorkCoordSystemObj.d.ts +32 -0
  165. package/build/components/graphics/WorkPlaneObj.d.ts +33 -0
  166. package/build/components/graphics/WorkPointObj.d.ts +57 -0
  167. package/build/components/graphics/graphics.d.ts +61 -0
  168. package/build/components/graphics/utils/MatePathTransform.d.ts +10 -0
  169. package/build/components/graphics/utils/useCsysMatrix.d.ts +4 -0
  170. package/build/components/utils/CompValidation/ErrorBoundary.d.ts +28 -0
  171. package/build/components/utils/CompValidation/validators/CSysDisplayValidator.d.ts +12 -0
  172. package/build/components/utils/CompValidation/validators/DrawingValidator.d.ts +12 -0
  173. package/build/components/utils/CompValidation/validators/ExpressionsValidator.d.ts +12 -0
  174. package/build/components/utils/CompValidation/validators/FPluginValidator.d.ts +16 -0
  175. package/build/components/utils/CompValidation/validators/FeatureListValidator.d.ts +12 -0
  176. package/build/components/utils/CompValidation/validators/ProductManagementValidator.d.ts +14 -0
  177. package/build/components/utils/CompValidation/verifiers.d.ts +32 -0
  178. package/build/components/utils/FtVisibilityController.d.ts +26 -0
  179. package/build/elements/index.d.ts +162 -0
  180. package/build/icons/axes.d.ts +73 -0
  181. package/build/icons/draw.d.ts +75 -0
  182. package/build/icons/features.d.ts +71 -0
  183. package/build/icons/glyphs.d.ts +10 -0
  184. package/build/icons/index.d.ts +152 -0
  185. package/build/icons/legacy.d.ts +159 -0
  186. package/build/icons/mates.d.ts +26 -0
  187. package/build/icons/params.d.ts +77 -0
  188. package/build/icons/refs.d.ts +61 -0
  189. package/build/icons/sheets.d.ts +302 -0
  190. package/build/icons/sketch.d.ts +102 -0
  191. package/build/icons/types.d.ts +74 -0
  192. package/build/icons/ui.d.ts +114 -0
  193. package/build/icons.cjs.js +1751 -0
  194. package/build/icons.js +1742 -0
  195. package/build/index.cjs.js +44948 -0
  196. package/build/index.d.ts +115 -0
  197. package/build/index.js +44800 -0
  198. package/build/plugins/AppearanceEditor/Root.d.ts +12 -0
  199. package/build/plugins/AppearanceEditor/index.d.ts +42 -0
  200. package/build/plugins/Boolean/Root.d.ts +11 -0
  201. package/build/plugins/Boolean/index.d.ts +39 -0
  202. package/build/plugins/BoundingBoxInfo/Root.d.ts +12 -0
  203. package/build/plugins/BoundingBoxInfo/View.d.ts +11 -0
  204. package/build/plugins/BoundingBoxInfo/index.d.ts +35 -0
  205. package/build/plugins/Box/Root.d.ts +11 -0
  206. package/build/plugins/Box/index.d.ts +34 -0
  207. package/build/plugins/Chamfer/Root.d.ts +11 -0
  208. package/build/plugins/Chamfer/index.d.ts +35 -0
  209. package/build/plugins/CircularPattern/Root.d.ts +11 -0
  210. package/build/plugins/CircularPattern/index.d.ts +35 -0
  211. package/build/plugins/CompositeCurve/Root.d.ts +11 -0
  212. package/build/plugins/CompositeCurve/View.d.ts +11 -0
  213. package/build/plugins/CompositeCurve/index.d.ts +36 -0
  214. package/build/plugins/Cone/Root.d.ts +11 -0
  215. package/build/plugins/Cone/index.d.ts +36 -0
  216. package/build/plugins/Cylinder/Root.d.ts +11 -0
  217. package/build/plugins/Cylinder/index.d.ts +35 -0
  218. package/build/plugins/Dimensions/DimContext.d.ts +10 -0
  219. package/build/plugins/Dimensions/Root.d.ts +11 -0
  220. package/build/plugins/Dimensions/View.d.ts +11 -0
  221. package/build/plugins/Dimensions/graphics/DimGraphics.d.ts +7 -0
  222. package/build/plugins/Dimensions/graphics/DimensionSet.d.ts +8 -0
  223. package/build/plugins/Dimensions/graphics/primitives.d.ts +34 -0
  224. package/build/plugins/Dimensions/index.d.ts +34 -0
  225. package/build/plugins/Dimensions/utils.d.ts +5 -0
  226. package/build/plugins/EntityDeletion/Root.d.ts +11 -0
  227. package/build/plugins/EntityDeletion/index.d.ts +34 -0
  228. package/build/plugins/Expressions/Root.d.ts +11 -0
  229. package/build/plugins/Expressions/index.d.ts +34 -0
  230. package/build/plugins/Expressions/useContextMenuItems.d.ts +4 -0
  231. package/build/plugins/Extrusion/Root.d.ts +11 -0
  232. package/build/plugins/Extrusion/View.d.ts +11 -0
  233. package/build/plugins/Extrusion/index.d.ts +50 -0
  234. package/build/plugins/Fillet/Root.d.ts +11 -0
  235. package/build/plugins/Fillet/index.d.ts +35 -0
  236. package/build/plugins/HLConstraints/CircularPattern/Root.d.ts +11 -0
  237. package/build/plugins/HLConstraints/CircularPattern/View.d.ts +11 -0
  238. package/build/plugins/HLConstraints/CircularPattern/index.d.ts +38 -0
  239. package/build/plugins/HLConstraints/Cylindrical/Root.d.ts +11 -0
  240. package/build/plugins/HLConstraints/Cylindrical/View.d.ts +11 -0
  241. package/build/plugins/HLConstraints/Cylindrical/index.d.ts +37 -0
  242. package/build/plugins/HLConstraints/Fastened/Root.d.ts +11 -0
  243. package/build/plugins/HLConstraints/Fastened/View.d.ts +11 -0
  244. package/build/plugins/HLConstraints/Fastened/index.d.ts +37 -0
  245. package/build/plugins/HLConstraints/FastenedOrigin/Root.d.ts +11 -0
  246. package/build/plugins/HLConstraints/FastenedOrigin/View.d.ts +11 -0
  247. package/build/plugins/HLConstraints/FastenedOrigin/index.d.ts +37 -0
  248. package/build/plugins/HLConstraints/Gear/Root.d.ts +11 -0
  249. package/build/plugins/HLConstraints/Gear/View.d.ts +11 -0
  250. package/build/plugins/HLConstraints/Gear/index.d.ts +36 -0
  251. package/build/plugins/HLConstraints/Group/Root.d.ts +11 -0
  252. package/build/plugins/HLConstraints/Group/index.d.ts +34 -0
  253. package/build/plugins/HLConstraints/LinearPattern/Root.d.ts +11 -0
  254. package/build/plugins/HLConstraints/LinearPattern/View.d.ts +11 -0
  255. package/build/plugins/HLConstraints/LinearPattern/index.d.ts +38 -0
  256. package/build/plugins/HLConstraints/Parallel/Root.d.ts +11 -0
  257. package/build/plugins/HLConstraints/Parallel/View.d.ts +11 -0
  258. package/build/plugins/HLConstraints/Parallel/index.d.ts +37 -0
  259. package/build/plugins/HLConstraints/Planar/Root.d.ts +11 -0
  260. package/build/plugins/HLConstraints/Planar/View.d.ts +11 -0
  261. package/build/plugins/HLConstraints/Planar/index.d.ts +37 -0
  262. package/build/plugins/HLConstraints/Revolute/Root.d.ts +11 -0
  263. package/build/plugins/HLConstraints/Revolute/View.d.ts +11 -0
  264. package/build/plugins/HLConstraints/Revolute/index.d.ts +37 -0
  265. package/build/plugins/HLConstraints/Slider/Root.d.ts +11 -0
  266. package/build/plugins/HLConstraints/Slider/View.d.ts +11 -0
  267. package/build/plugins/HLConstraints/Slider/index.d.ts +37 -0
  268. package/build/plugins/HLConstraints/Spherical/Root.d.ts +11 -0
  269. package/build/plugins/HLConstraints/Spherical/View.d.ts +11 -0
  270. package/build/plugins/HLConstraints/Spherical/index.d.ts +36 -0
  271. package/build/plugins/HLConstraints/components/CSysDisplayWrapper.d.ts +7 -0
  272. package/build/plugins/HLConstraints/components/HLConstrIcon.d.ts +7 -0
  273. package/build/plugins/HLConstraints/components/LimitedValue.d.ts +12 -0
  274. package/build/plugins/HLConstraints/components/Limits.d.ts +25 -0
  275. package/build/plugins/HLConstraints/components/LimitsCollapse.d.ts +12 -0
  276. package/build/plugins/HLConstraints/validators.d.ts +2 -0
  277. package/build/plugins/Import/Root.d.ts +11 -0
  278. package/build/plugins/Import/index.d.ts +35 -0
  279. package/build/plugins/LinearPattern/Root.d.ts +11 -0
  280. package/build/plugins/LinearPattern/index.d.ts +36 -0
  281. package/build/plugins/Measure/Digits.d.ts +7 -0
  282. package/build/plugins/Measure/Root.d.ts +11 -0
  283. package/build/plugins/Measure/View.d.ts +15 -0
  284. package/build/plugins/Measure/config.d.ts +1 -0
  285. package/build/plugins/Measure/graphics/MeasureGraphics.d.ts +24 -0
  286. package/build/plugins/Measure/index.d.ts +39 -0
  287. package/build/plugins/Measure/utils.d.ts +2 -0
  288. package/build/plugins/Mirror/Root.d.ts +11 -0
  289. package/build/plugins/Mirror/index.d.ts +34 -0
  290. package/build/plugins/Revolve/Root.d.ts +11 -0
  291. package/build/plugins/Revolve/index.d.ts +37 -0
  292. package/build/plugins/Rotate/Root.d.ts +11 -0
  293. package/build/plugins/Rotate/index.d.ts +35 -0
  294. package/build/plugins/Sketch/Root/Constraints/Constraints.d.ts +2 -0
  295. package/build/plugins/Sketch/Root/Constraints/constraintsHelpers.d.ts +22 -0
  296. package/build/plugins/Sketch/Root/Constraints/index.d.ts +2 -0
  297. package/build/plugins/Sketch/Root/Constraints/utils.d.ts +6 -0
  298. package/build/plugins/Sketch/Root/CopyPatterns.d.ts +2 -0
  299. package/build/plugins/Sketch/Root/Details.d.ts +2 -0
  300. package/build/plugins/Sketch/Root/Handlers.d.ts +2 -0
  301. package/build/plugins/Sketch/Root/PlaneSelection.d.ts +7 -0
  302. package/build/plugins/Sketch/Root/Position.d.ts +2 -0
  303. package/build/plugins/Sketch/Root/Regions.d.ts +2 -0
  304. package/build/plugins/Sketch/Root/Root.d.ts +11 -0
  305. package/build/plugins/Sketch/Root/RootContext.d.ts +7 -0
  306. package/build/plugins/Sketch/Root/SketchGroup.d.ts +15 -0
  307. package/build/plugins/Sketch/Root/index.d.ts +1 -0
  308. package/build/plugins/Sketch/Root/useContextMenuItems.d.ts +4 -0
  309. package/build/plugins/Sketch/Root/useLayoutSize.d.ts +11 -0
  310. package/build/plugins/Sketch/View/View.d.ts +11 -0
  311. package/build/plugins/Sketch/View/ViewContext.d.ts +8 -0
  312. package/build/plugins/Sketch/View/graphics/Constraints.d.ts +5 -0
  313. package/build/plugins/Sketch/View/graphics/IconGroups.d.ts +7 -0
  314. package/build/plugins/Sketch/View/graphics/Merged/Arc.d.ts +20 -0
  315. package/build/plugins/Sketch/View/graphics/Merged/ArcGeometry.d.ts +2 -0
  316. package/build/plugins/Sketch/View/graphics/Merged/ArcMaterial.d.ts +2 -0
  317. package/build/plugins/Sketch/View/graphics/Merged/Bezier.d.ts +19 -0
  318. package/build/plugins/Sketch/View/graphics/Merged/BezierGeometry.d.ts +12 -0
  319. package/build/plugins/Sketch/View/graphics/Merged/BezierMaterial.d.ts +2 -0
  320. package/build/plugins/Sketch/View/graphics/Merged/Circle.d.ts +9 -0
  321. package/build/plugins/Sketch/View/graphics/Merged/Line.d.ts +15 -0
  322. package/build/plugins/Sketch/View/graphics/Merged/LineGeometry.d.ts +2 -0
  323. package/build/plugins/Sketch/View/graphics/Merged/LineMaterial.d.ts +2 -0
  324. package/build/plugins/Sketch/View/graphics/Merged/MergedWrapper.d.ts +16 -0
  325. package/build/plugins/Sketch/View/graphics/Merged/Point.d.ts +8 -0
  326. package/build/plugins/Sketch/View/graphics/Merged/Spline.d.ts +17 -0
  327. package/build/plugins/Sketch/View/graphics/Merged/SplineGeometry.d.ts +11 -0
  328. package/build/plugins/Sketch/View/graphics/Merged/SplineMaterial.d.ts +2 -0
  329. package/build/plugins/Sketch/View/graphics/MousePosition.d.ts +2 -0
  330. package/build/plugins/Sketch/View/graphics/Regions.d.ts +5 -0
  331. package/build/plugins/Sketch/View/graphics/TmpAngularDimension.d.ts +8 -0
  332. package/build/plugins/Sketch/View/graphics/graphics.d.ts +5 -0
  333. package/build/plugins/Sketch/View/graphics/hooks.d.ts +49 -0
  334. package/build/plugins/Sketch/View/graphics/primitives.d.ts +34 -0
  335. package/build/plugins/Sketch/View/graphics/scale.d.ts +6 -0
  336. package/build/plugins/Sketch/View/graphics/tmpGraphics.d.ts +3 -0
  337. package/build/plugins/Sketch/View/graphics/transform.d.ts +4 -0
  338. package/build/plugins/Sketch/View/handlers/CreateAngle.d.ts +3 -0
  339. package/build/plugins/Sketch/View/handlers/CreateConstraint.d.ts +10 -0
  340. package/build/plugins/Sketch/View/handlers/Drag.d.ts +3 -0
  341. package/build/plugins/Sketch/View/handlers/DrawArc.d.ts +3 -0
  342. package/build/plugins/Sketch/View/handlers/DrawCircle.d.ts +3 -0
  343. package/build/plugins/Sketch/View/handlers/DrawLine.d.ts +3 -0
  344. package/build/plugins/Sketch/View/handlers/DrawNurbs.d.ts +3 -0
  345. package/build/plugins/Sketch/View/handlers/DrawPoint.d.ts +3 -0
  346. package/build/plugins/Sketch/View/handlers/DrawRectangle.d.ts +3 -0
  347. package/build/plugins/Sketch/View/handlers/Fillet.d.ts +3 -0
  348. package/build/plugins/Sketch/View/handlers/HandlersConstructors.d.ts +33 -0
  349. package/build/plugins/Sketch/View/handlers/Hover.d.ts +3 -0
  350. package/build/plugins/Sketch/View/handlers/SSelect.d.ts +3 -0
  351. package/build/plugins/Sketch/View/handlers/Split.d.ts +3 -0
  352. package/build/plugins/Sketch/View/handlers/Trim.d.ts +3 -0
  353. package/build/plugins/Sketch/View/handlers/Use.d.ts +3 -0
  354. package/build/plugins/Sketch/View/handlers/constraintCreation.d.ts +10 -0
  355. package/build/plugins/Sketch/View/handlers/filletHelpers.d.ts +24 -0
  356. package/build/plugins/Sketch/View/handlers/hoverHelpers.d.ts +3 -0
  357. package/build/plugins/Sketch/View/handlers/snapper.d.ts +11 -0
  358. package/build/plugins/Sketch/View/handlers/splitHelpers.d.ts +20 -0
  359. package/build/plugins/Sketch/View/index.d.ts +1 -0
  360. package/build/plugins/Sketch/constants.d.ts +5 -0
  361. package/build/plugins/Sketch/description.d.ts +7 -0
  362. package/build/plugins/Sketch/index.d.ts +35 -0
  363. package/build/plugins/Sketch/resources.d.ts +5 -0
  364. package/build/plugins/Sketch/types.d.ts +148 -0
  365. package/build/plugins/Sketch/utils/Interaction.d.ts +7 -0
  366. package/build/plugins/Sketch/utils/OverdefinedStateManager.d.ts +6 -0
  367. package/build/plugins/Sketch/utils/getSketchState.d.ts +3 -0
  368. package/build/plugins/Sketch/utils/useSketchRegions.d.ts +2 -0
  369. package/build/plugins/Sketch/utils/useSketchState.d.ts +3 -0
  370. package/build/plugins/Slice/Root.d.ts +11 -0
  371. package/build/plugins/Slice/index.d.ts +34 -0
  372. package/build/plugins/SliceBySheet/Root.d.ts +11 -0
  373. package/build/plugins/SliceBySheet/index.d.ts +35 -0
  374. package/build/plugins/Sphere/Root.d.ts +11 -0
  375. package/build/plugins/Sphere/index.d.ts +35 -0
  376. package/build/plugins/TransformByCsys/Root.d.ts +11 -0
  377. package/build/plugins/TransformByCsys/index.d.ts +35 -0
  378. package/build/plugins/Translate/Root.d.ts +11 -0
  379. package/build/plugins/Translate/index.d.ts +35 -0
  380. package/build/plugins/Twist/Root.d.ts +11 -0
  381. package/build/plugins/Twist/View.d.ts +11 -0
  382. package/build/plugins/Twist/index.d.ts +48 -0
  383. package/build/plugins/WorkAxis/Root.d.ts +11 -0
  384. package/build/plugins/WorkAxis/View.d.ts +11 -0
  385. package/build/plugins/WorkAxis/index.d.ts +37 -0
  386. package/build/plugins/WorkCSys/Root.d.ts +11 -0
  387. package/build/plugins/WorkCSys/View.d.ts +11 -0
  388. package/build/plugins/WorkCSys/index.d.ts +53 -0
  389. package/build/plugins/WorkCoordSystem/Root.d.ts +11 -0
  390. package/build/plugins/WorkCoordSystem/View.d.ts +11 -0
  391. package/build/plugins/WorkCoordSystem/index.d.ts +55 -0
  392. package/build/plugins/WorkPlane/Root.d.ts +11 -0
  393. package/build/plugins/WorkPlane/View.d.ts +11 -0
  394. package/build/plugins/WorkPlane/index.d.ts +38 -0
  395. package/build/plugins/WorkPlane/validators.d.ts +1 -0
  396. package/build/plugins/WorkPoint/Root.d.ts +11 -0
  397. package/build/plugins/WorkPoint/View.d.ts +11 -0
  398. package/build/plugins/WorkPoint/index.d.ts +38 -0
  399. package/build/plugins/components/PluginForm.d.ts +24 -0
  400. package/build/plugins/utils/useRefsReset.d.ts +2 -0
  401. package/build/session/identity.d.ts +46 -0
  402. package/build/session/sessionClient.d.ts +140 -0
  403. package/build/session/types.d.ts +52 -0
  404. package/build/session/viewpoints.d.ts +90 -0
  405. package/build/theme/AppStyle.d.ts +33 -0
  406. package/build/theme/fonts/mono.d.ts +29 -0
  407. package/build/theme/stage.d.ts +148 -0
  408. package/build/theme/styles/antdChoices.d.ts +1 -0
  409. package/build/theme/styles/antdControls.d.ts +1 -0
  410. package/build/theme/styles/antdSurfaces.d.ts +1 -0
  411. package/build/theme/styles/editors.d.ts +1 -0
  412. package/build/theme/styles/fields.d.ts +1 -0
  413. package/build/theme/styles/frame.d.ts +1 -0
  414. package/build/theme/styles/panes.d.ts +1 -0
  415. package/build/theme/styles/parts.d.ts +2 -0
  416. package/build/theme/styles/rest.d.ts +1 -0
  417. package/build/theme/styles/sketch.d.ts +1 -0
  418. package/build/theme/styles/toolbar.d.ts +1 -0
  419. package/build/theme/styles/tools.d.ts +1 -0
  420. package/build/theme/styles/windows.d.ts +1 -0
  421. package/build/theme/themeStore.d.ts +305 -0
  422. package/build/types/jsx-compat.d.ts +8 -0
  423. package/build/types.d.ts +16 -0
  424. package/build/utils/FileUtils.d.ts +20 -0
  425. package/build/utils/bezierMatrices.d.ts +3 -0
  426. package/build/utils/conversionUtils.d.ts +78 -0
  427. package/build/utils/cubicSplineInterpolation.d.ts +5 -0
  428. package/build/utils/defaultValues.d.ts +3 -0
  429. package/build/utils/drawing/index.d.ts +3 -0
  430. package/build/utils/drawing/useDrawingArr.d.ts +10 -0
  431. package/build/utils/drawing/useDrawingCCId.d.ts +10 -0
  432. package/build/utils/drawing/useDrawingStr.d.ts +10 -0
  433. package/build/utils/getHighlightedColor.d.ts +6 -0
  434. package/build/utils/getMatePath.d.ts +2 -0
  435. package/build/utils/getMateRefIds.d.ts +30 -0
  436. package/build/utils/helpers.d.ts +19 -0
  437. package/build/utils/mateUtils.d.ts +35 -0
  438. package/build/utils/nurbsUtils.d.ts +35 -0
  439. package/build/utils/selection/filters.d.ts +12 -0
  440. package/build/utils/selection/scopes/mateSelection.d.ts +49 -0
  441. package/build/utils/selection/scopes/treeObjInteraction.d.ts +74 -0
  442. package/build/utils/selection/useSelectorsOrder.d.ts +12 -0
  443. package/build/utils/sketchIntersectionUtils.d.ts +139 -0
  444. package/build/utils/sketchUtils.d.ts +235 -0
  445. package/build/utils/useAllObjects.d.ts +31 -0
  446. package/build/utils/useIsUncommited.d.ts +2 -0
  447. package/build/utils/useRetainVisibility.d.ts +2 -0
  448. package/build/utils/useScale.d.ts +5 -0
  449. package/build/utils/validation.d.ts +11 -0
  450. package/doc/api/advanced/session.md +646 -0
  451. package/doc/api/advanced/utilities.md +1306 -0
  452. package/doc/api/assembly-constraints.md +340 -0
  453. package/doc/api/feature-plugins.md +613 -0
  454. package/doc/api/graphics.md +848 -0
  455. package/doc/api/hooks.md +300 -0
  456. package/doc/api/icons.md +812 -0
  457. package/doc/api/index.md +87 -0
  458. package/doc/api/other.md +369 -0
  459. package/doc/api/panels.md +754 -0
  460. package/doc/api/theme.md +551 -0
  461. package/doc/api/tool-plugins.md +191 -0
  462. package/doc/api/ui-elements.md +310 -0
  463. package/doc/api/work-geometry.md +154 -0
  464. package/icons/package.json +8 -0
  465. package/package.json +108 -4
  466. package/tools/fonts/brotli.py +29 -0
  467. package/tools/fonts/build.py +76 -0
  468. package/tools/icons/preview.mjs +74 -0
  469. package/tsconfig.build.json +16 -0
  470. package/typedoc.json +18 -0
  471. package/vitest.config.mts +25 -0
@@ -0,0 +1,305 @@
1
+ /**
2
+ * The theme's mode: light, or dark.
3
+ *
4
+ * @category Theme
5
+ */
6
+ export type ThemeMode = 'light' | 'dark';
7
+ /**
8
+ * The colours of the app, in light and in dark: {@link lightTheme} and {@link darkTheme}.
9
+ *
10
+ * They are the family's own (paper and ink, one red; graphite and chalk in the dark), written down for a technical
11
+ * application in BRANDING.md, "The app". Every one of them that is a string is also a custom property on `:root`,
12
+ * `--rcad-<kebab-case>` (`accentFill` is `--rcad-accent-fill`), which is what the stylesheet draws from (see
13
+ * {@link AppStyle}). The colours of what is drawn on the stage are {@link StageColors}.
14
+ *
15
+ * @category Theme
16
+ */
17
+ export type ThemeColors = {
18
+ /** Headings, primary text, icons. */
19
+ ink: string;
20
+ /** Rows, values, secondary content. */
21
+ ink2: string;
22
+ /** Body copy, notes. */
23
+ mute: string;
24
+ /** Labels, captions, metadata, what is switched off. */
25
+ dim: string;
26
+ /** A hairline over any ground. */
27
+ line: string;
28
+ /** A stronger hairline: a field's edge under the pointer, a key cap. */
29
+ line2: string;
30
+ /** Bars, the sidebar, menus: the app's own paper. */
31
+ chrome: string;
32
+ /** The rule between two pieces of chrome. */
33
+ chromeLine: string;
34
+ /** Windows and cards that float over the viewport. */
35
+ panel: string;
36
+ /** Inset fills: fields, chips, a pressed button. */
37
+ panel2: string;
38
+ /** The ground the model is shown on. */
39
+ viewport: string;
40
+ /** A row or a button under the pointer. */
41
+ hover: string;
42
+ /** A row or a button that is on, or held. */
43
+ active: string;
44
+ /** Red as type and lines. */
45
+ accent: string;
46
+ /** Red as a fill: the one primary action. */
47
+ accentFill: string;
48
+ /** Hover on a red fill. */
49
+ accentHover: string;
50
+ /** A hairline of red: focus, a field under the hand. */
51
+ accentLine: string;
52
+ /** A wash of red: over what a feature made, behind a changed value. */
53
+ accentWash: string;
54
+ /** A stronger wash, for small marks (icons). */
55
+ accentTint: string;
56
+ /** Type on a red fill. */
57
+ onAccent: string;
58
+ /** Done, proven, live. */
59
+ green: string;
60
+ /** Type on a green fill. */
61
+ onGreen: string;
62
+ /** Working, and a warning. */
63
+ orange: string;
64
+ /** A note; what the engine reports. */
65
+ blue: string;
66
+ /** The X axis: red. On the stage's triad, and in a sign about it. */
67
+ axisX: string;
68
+ /** The Y axis: green. */
69
+ axisY: string;
70
+ /** The Z axis: blue. */
71
+ axisZ: string;
72
+ /** A body the model gives no colour of its own: a neutral grey, clearly off the ground. */
73
+ geoBody: string;
74
+ /** An edge of the model: ink, in either theme. */
75
+ geoEdge: string;
76
+ /** Under the pointer: the highlight, held back. */
77
+ geoHover: string;
78
+ /** In hand: the highlight, "a face lit". */
79
+ geoSelect: string;
80
+ /** Taken by the feature being made: red, as everything a feature makes. */
81
+ geoPick: string;
82
+ /** Stands in for the highlight on a body of nearly its colour. */
83
+ geoAlt: string;
84
+ /** The sheet a sketch is drawn on. */
85
+ paper: string;
86
+ /** The ground of a toast or a tooltip. */
87
+ toastBg: string;
88
+ /** Its text. */
89
+ toastText: string;
90
+ /** What stands out in it: a title, a value. */
91
+ toastStrong: string;
92
+ /** Menus, small cards. */
93
+ shadow: string;
94
+ /** Windows. */
95
+ shadowLg: string;
96
+ /** The hairline ring a floating thing carries with its shadow. */
97
+ ring: string;
98
+ /** @deprecated Use `chrome`. @hidden */
99
+ background: string;
100
+ /** @deprecated Use `ink`. @hidden */
101
+ text: string;
102
+ /** @deprecated Use `mute`. @hidden */
103
+ textSecondary: string;
104
+ /** @deprecated Use `chromeLine`. @hidden */
105
+ border: string;
106
+ /** @deprecated Use `chrome`. @hidden */
107
+ headerBackground: string;
108
+ /** @deprecated Not drawn any more (transparent). @hidden */
109
+ headerDotLight: string;
110
+ /** @deprecated Not drawn any more (transparent). @hidden */
111
+ headerDotDark: string;
112
+ /** @deprecated Use `chrome`. @hidden */
113
+ sectionHeaderBg: string;
114
+ /** @deprecated Use `ink`. @hidden */
115
+ sectionHeaderText: string;
116
+ /** @deprecated Use `chromeLine`. @hidden */
117
+ sectionHeaderBorder: string;
118
+ /** @deprecated Use `hover`. @hidden */
119
+ hoverBg: string;
120
+ /** @deprecated Use `chromeLine`. @hidden */
121
+ hoverBorder: string;
122
+ /** @deprecated Use `mute`. @hidden */
123
+ linkColor: string;
124
+ /** @deprecated Use `chromeLine`. @hidden */
125
+ contextMenuBorder: string;
126
+ /** @deprecated Use `chrome`. @hidden */
127
+ contextMenuHeaderBg: string;
128
+ /** @deprecated The ink, at 18 %. @hidden */
129
+ scrollbarThumb: string;
130
+ /** @deprecated Use `shadowLg` and `ring`. @hidden */
131
+ boxShadow: string;
132
+ /** @deprecated Use `green`. @hidden */
133
+ msgSuccessBorder: string;
134
+ /** @deprecated Use `toastBg`. @hidden */
135
+ msgSuccessBg: string;
136
+ /** @deprecated Use `accent`. @hidden */
137
+ msgErrorBorder: string;
138
+ /** @deprecated Use `toastBg`. @hidden */
139
+ msgErrorBg: string;
140
+ /** @deprecated Use `toastBg`. @hidden */
141
+ msgErrorBgAccent: string;
142
+ /** @deprecated Use `accent`. @hidden */
143
+ msgErrorBorderAccent: string;
144
+ /** @deprecated Use `orange`. @hidden */
145
+ msgWarningBorder: string;
146
+ /** @deprecated Use `toastBg`. @hidden */
147
+ msgWarningBg: string;
148
+ /** @deprecated Use `blue`. @hidden */
149
+ msgInfoBorder: string;
150
+ /** @deprecated Use `toastBg`. @hidden */
151
+ msgInfoBg: string;
152
+ /** @deprecated Use `chromeLine`. @hidden */
153
+ msgShownBorder: string;
154
+ /** @deprecated Use `toastBg`. @hidden */
155
+ msgShownBg: string;
156
+ /** @deprecated Use `panel2`. @hidden */
157
+ inputBg: string;
158
+ /** @deprecated Use `panel2`. @hidden */
159
+ inputBgDisabled: string;
160
+ /** @deprecated Use `line`. @hidden */
161
+ inputBorder: string;
162
+ /** @deprecated Use `line`. @hidden */
163
+ inputBorderDisabled: string;
164
+ /** @deprecated Use `ink`. @hidden */
165
+ inputText: string;
166
+ /** @deprecated Use `dim`. @hidden */
167
+ closeIcon: string;
168
+ /** @deprecated The icons are drawn in the theme's own ink now; nothing is filtered (`none`). @hidden */
169
+ iconFilter: string;
170
+ /** @deprecated Use `toastBg`. @hidden */
171
+ tooltipBg: string;
172
+ /** @deprecated Use `toastStrong`. @hidden */
173
+ tooltipText: string;
174
+ /** @deprecated The ink, thinned. @hidden */
175
+ expressionSpanBg: string;
176
+ /** @deprecated The ink, thinned. @hidden */
177
+ expressionSpanSelectedBg: string;
178
+ /** Text on the stage (a dimension's value, a readout), as a number for three.js (`0x1a1a3a`). */
179
+ canvasText: number;
180
+ /** A dimension's lines and arrows on the stage, as a number for three.js. */
181
+ canvasDimLine: number;
182
+ /** The ground of a label on the stage (a measure, a dimension), as a number for three.js. */
183
+ canvasLabelBg: number;
184
+ /** @deprecated Use `viewport`. @hidden */
185
+ loadingOverlayBg: string;
186
+ };
187
+ /**
188
+ * The app's colours in the light theme: paper and ink, one red.
189
+ *
190
+ * @example
191
+ * ```tsx
192
+ * import { darkTheme, lightTheme } from '@classcad/react-cad'
193
+ *
194
+ * // a page around the app in the app's colours, whatever its theme is now
195
+ * const pageColors = (dark: boolean) => {
196
+ * const colors = dark ? darkTheme : lightTheme
197
+ * return { background: colors.viewport, color: colors.ink, accentColor: colors.accent }
198
+ * }
199
+ * document.body.style.background = pageColors(true).background
200
+ * ```
201
+ *
202
+ * @advanced
203
+ * @category Theme
204
+ */
205
+ export declare const lightTheme: ThemeColors;
206
+ /**
207
+ * The app's colours in the dark theme: graphite and chalk, one red. See the example of {@link lightTheme}.
208
+ *
209
+ * @advanced
210
+ * @category Theme
211
+ */
212
+ export declare const darkTheme: ThemeColors;
213
+ /**
214
+ * The theme's state: its mode, its colours, and how the mode is set.
215
+ *
216
+ * @inline
217
+ */
218
+ type ThemeState = {
219
+ /** The theme's mode. */
220
+ mode: ThemeMode;
221
+ /** Its colours: {@link lightTheme} or {@link darkTheme}. */
222
+ colors: ThemeColors;
223
+ /** Sets the mode; see {@link setRCadThemeMode}. */
224
+ setMode: (mode: ThemeMode, options?: {
225
+ remember?: boolean;
226
+ }) => void;
227
+ };
228
+ /**
229
+ * The theme's store (zustand): its `mode`, its `colors`, and `setMode`.
230
+ *
231
+ * In a component, {@link useRCadTheme} and {@link useRCadThemeMode} read it; outside of one,
232
+ * `useRCadThemeStore.getState()` does, and `useRCadThemeStore.subscribe` hears it change. The mode starts as the
233
+ * reader picked it last time, or as the system has it (`prefers-color-scheme`), and follows the system while the
234
+ * reader has picked nothing.
235
+ *
236
+ * @advanced
237
+ * @category Theme
238
+ */
239
+ export declare const useThemeStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ThemeState>>;
240
+ /**
241
+ * Returns the colours of the current theme, and renders again when the theme changes.
242
+ *
243
+ * @returns {@link lightTheme} or {@link darkTheme}.
244
+ * @example
245
+ * ```tsx
246
+ * import { useRCadTheme, useRCadThemeMode } from '@classcad/react-cad'
247
+ *
248
+ * // a panel of the app's own in the app's colours, in either theme
249
+ * function Note({ children }: { children: React.ReactNode }) {
250
+ * const colors = useRCadTheme()
251
+ * const mode = useRCadThemeMode()
252
+ * return (
253
+ * <div style={{ background: colors.panel, color: colors.ink, border: `1px solid ${colors.line}`, boxShadow: colors.shadow }}>
254
+ * {children} <small style={{ color: colors.dim }}>({mode})</small>
255
+ * </div>
256
+ * )
257
+ * }
258
+ * ```
259
+ *
260
+ * @category Theme
261
+ */
262
+ export declare const useRCadTheme: () => ThemeColors;
263
+ /**
264
+ * Returns the current theme's mode, `'light'` or `'dark'`, and renders again when it changes.
265
+ *
266
+ * The example of {@link useRCadTheme} uses it beside the colours.
267
+ *
268
+ * @category Theme
269
+ */
270
+ export declare const useRCadThemeMode: () => ThemeMode;
271
+ /**
272
+ * Sets the app's theme to light or dark.
273
+ *
274
+ * The pick is remembered for the next visit (in `localStorage`); picking what the system has forgets it, so that the
275
+ * app follows the system again. A page that has a theme of its own passes `{ remember: false }` and calls this
276
+ * whenever its theme changes: the app then follows the page (and {@link Drawing} is given `themeSwitch={false}`).
277
+ *
278
+ * @param mode - The theme to show.
279
+ * @param options - `remember: false` leaves the reader's remembered pick alone.
280
+ *
281
+ * @example
282
+ * ```tsx
283
+ * import { useEffect } from 'react'
284
+ * import type { DrawingID } from '@classcad/sdkjs'
285
+ * import { Drawing, setRCadThemeMode } from '@classcad/react-cad'
286
+ *
287
+ * // a page with a theme switch of its own: the app follows it, and shows no switch of its own
288
+ * function EditorPage({ dark, drawingId }: { dark: boolean; drawingId: DrawingID }) {
289
+ * useEffect(() => setRCadThemeMode(dark ? 'dark' : 'light', { remember: false }), [dark])
290
+ * return <Drawing drawingId={drawingId} themeSwitch={false} />
291
+ * }
292
+ * ```
293
+ *
294
+ * @category Theme
295
+ */
296
+ export declare const setRCadThemeMode: (mode: ThemeMode, options?: {
297
+ remember?: boolean;
298
+ }) => void;
299
+ /** Hook returning the canvas text/overlay color (numeric, for three.js materials). */
300
+ export declare const useCanvasTextColor: () => number;
301
+ /** Hook returning the dimension line/arrow color (numeric, for three.js materials). */
302
+ export declare const useCanvasDimLineColor: () => number;
303
+ /** Hook returning the canvas label background color (numeric, for measure/dimension labels). */
304
+ export declare const useCanvasLabelBg: () => number;
305
+ export {};
@@ -0,0 +1,8 @@
1
+ import type React from 'react';
2
+ declare global {
3
+ namespace JSX {
4
+ type Element = React.JSX.Element;
5
+ type IntrinsicElements = React.JSX.IntrinsicElements;
6
+ }
7
+ }
8
+ export {};
@@ -0,0 +1,16 @@
1
+ export type MemberParam<T> = {
2
+ userValue: T;
3
+ serverValue: T;
4
+ setUserValue: React.Dispatch<React.SetStateAction<T>>;
5
+ defaults: T;
6
+ isChanged: (idx?: number) => boolean;
7
+ validator: () => string[];
8
+ setValidator: (...args: any[]) => void;
9
+ options: {
10
+ [key: string]: any;
11
+ };
12
+ };
13
+ export type APIParam<T> = {
14
+ value: T | string;
15
+ isExpr: boolean;
16
+ };
@@ -0,0 +1,20 @@
1
+ import { DrawingID, ObjectID } from '@classcad/sdkjs';
2
+ /**
3
+ * Simple helper functions for file interaction.
4
+ */
5
+ export declare const FileUtils: {
6
+ /**
7
+ * Loads a file from the file system.
8
+ * It uses @see document and is therefore directly dependent on the DOM.
9
+ *
10
+ * @param onLoad The callback.
11
+ * @param type The content type.
12
+ * @param multiple The flag for allowing / not allowing to select multiple files to be loaded.
13
+ * @param accept Default electable formats (if not specified, accept all).
14
+ */
15
+ loadFile: (onLoad: (files: {
16
+ file: File;
17
+ content: any;
18
+ }[]) => void, type?: "DataURL" | "ArrayBuffer" | "BinaryString" | "Text", multiple?: boolean, accept?: string) => void;
19
+ exportNode: (drawingId: DrawingID, objectId: ObjectID, type?: string) => Promise<void>;
20
+ };
@@ -0,0 +1,3 @@
1
+ export declare const bezierMatrices: {
2
+ [key: number]: number[][];
3
+ };
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Converts what react-cad's fields hold into the arguments of ClassCAD's `api.v1` calls: a mate, a body.
3
+ *
4
+ * @advanced
5
+ * @category Utilities
6
+ * @module
7
+ */
8
+ import { DrawingID, ObjectID } from "@classcad/sdkjs";
9
+ import { MateParam } from '../components/UI/editors/RefsEditors';
10
+ /**
11
+ * A mate as `api.v1.assembly`'s constraint calls take it: its flip as `'X'` … `'-Z'`, its turn as `'0'` … `'270'`.
12
+ *
13
+ * @param mateV0 - The mate as a constraint's field holds it: its path, its coordinate system, and its flip and turn
14
+ * as ClassCAD's numbers (`FlipType`, `ReorientedType`).
15
+ * @returns The same mate, with `flip` and `reorient` as the v1 API names them.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * import { createApi, FlipType, ReorientedType } from '@classcad/client'
20
+ * import type { DrawingID, ObjectID } from '@classcad/sdkjs'
21
+ * import { conversionUtils } from '@classcad/react-cad'
22
+ *
23
+ * // a constraint's two mates as its dialog's fields hold them, written back to the constraint
24
+ * const mate1 = { path: [nut], csys: nutCsys, flip: FlipType.FLIP_Z, reorient: ReorientedType.REORIENTED_0 }
25
+ * const mate2 = { path: [bolt], csys: boltCsys, flip: FlipType.FLIP_Z_INV, reorient: ReorientedType.REORIENTED_90 }
26
+ * await createApi(drawingId).v1.assembly.updateFastened({
27
+ * id: constraintId,
28
+ * mate1: conversionUtils.mateV1(mate1), // flip 'Z', reorient '0'
29
+ * mate2: conversionUtils.mateV1(mate2), // flip '-Z', reorient '90'
30
+ * })
31
+ * ```
32
+ */
33
+ export declare const mateV1: (mateV0: MateParam) => {
34
+ /** Which of the coordinate system's axes is the mate's main one, and which way. */
35
+ flip: "Z" | "X" | "-X" | "Y" | "-Y" | "-Z";
36
+ /** How far the mate is turned about its main axis, in degrees. */
37
+ reorient: "0" | "90" | "180" | "270";
38
+ path: ObjectID[] | undefined;
39
+ csys: ObjectID | undefined;
40
+ };
41
+ /**
42
+ * A body as the v1 API references it: the feature that made it, and its place among the feature's bodies.
43
+ *
44
+ * @param drawingId - The drawing.
45
+ * @param id - The body's object in the structure tree.
46
+ * @returns `{ id }` with the feature's id, and `indices` where the feature made more than one body.
47
+ */
48
+ export declare const solidV1: (drawingId: DrawingID, id: ObjectID) => {
49
+ /** The feature that made the body. */
50
+ id: string | number;
51
+ /** The body's place among the feature's bodies, where it made more than one. */
52
+ indices?: number[];
53
+ };
54
+ /**
55
+ * Bodies as the v1 API references them ({@link solidV1}), such as an entity deletion's `targets`.
56
+ *
57
+ * @param drawingId - The drawing.
58
+ * @param ids - The bodies' objects in the structure tree.
59
+ *
60
+ * @example
61
+ * ```tsx
62
+ * import { createApi } from '@classcad/client'
63
+ * import type { DrawingID, ObjectID } from '@classcad/sdkjs'
64
+ * import { conversionUtils } from '@classcad/react-cad'
65
+ *
66
+ * // takes the selected bodies out of the part again: an entity deletion of them
67
+ * async function deleteBodies(drawingId: DrawingID, partId: ObjectID, solidIds: ObjectID[]) {
68
+ * const targets = conversionUtils.solidsV1(drawingId, solidIds)
69
+ * await createApi(drawingId).v1.part.entityDeletion({ id: partId, name: 'Entity Deletion', targets })
70
+ * }
71
+ * ```
72
+ */
73
+ export declare const solidsV1: (drawingId: DrawingID, ids: ObjectID[]) => {
74
+ /** The feature that made the body. */
75
+ id: string | number;
76
+ /** The body's place among the feature's bodies, where it made more than one. */
77
+ indices?: number[];
78
+ }[];
@@ -0,0 +1,5 @@
1
+ import * as THREE from 'three';
2
+ export declare const Interpolate: (fitPoints: THREE.Vector3[]) => {
3
+ controlPoints: THREE.Vector3[];
4
+ knots: number[];
5
+ };
@@ -0,0 +1,3 @@
1
+ export declare const EMPTYARRAY: never[];
2
+ export declare const NOCCID: number;
3
+ export declare const EMPTYSTR = "";
@@ -0,0 +1,3 @@
1
+ export { useDrawingArr } from './useDrawingArr';
2
+ export { useDrawingCCId } from './useDrawingCCId';
3
+ export { useDrawingStr } from './useDrawingStr';
@@ -0,0 +1,10 @@
1
+ import { DrawingID, DrawingState } from '@classcad/sdkjs';
2
+ /**
3
+ * Wrapper around useDrawing which allows to avoid ReferenceErrors.
4
+ * Use useDrawingArr if you want to get an array from store. It returns EMPTYARRAY if requested one is undefined.
5
+ *
6
+ * @param drawingId
7
+ * @param selector
8
+ * @returns requested by selector array or EMPTYARRAY if requested is undefined or null
9
+ */
10
+ export declare function useDrawingArr<T>(drawingId: DrawingID, selector: (state: DrawingState) => Array<T> | undefined): Array<T>;
@@ -0,0 +1,10 @@
1
+ import { DrawingID, DrawingState, ObjectID } from '@classcad/sdkjs';
2
+ /**
3
+ * Wrapper around useDrawing which allows to avoid ReferenceErrors.
4
+ * Use useDrawingCCId if you want to get an object id from store. It returns NOCCID if requested one is undefined or null.
5
+ *
6
+ * @param drawingId
7
+ * @param selector
8
+ * @returns requested by selector object id or NOCCID if requested is undefined or null
9
+ */
10
+ export declare function useDrawingCCId(drawingId: DrawingID, selector: (state: DrawingState) => ObjectID | undefined): ObjectID;
@@ -0,0 +1,10 @@
1
+ import { DrawingID, DrawingState } from '@classcad/sdkjs';
2
+ /**
3
+ * Wrapper around useDrawing which allows to avoid ReferenceErrors.
4
+ * Use useDrawingStr if you want to get a string from store. It returns EMPTYSTR if requested one is undefined.
5
+ *
6
+ * @param drawingId
7
+ * @param selector
8
+ * @returns requested by selector string or EMPTYSTRING if requested one is undefined or null
9
+ */
10
+ export declare function useDrawingStr(drawingId: DrawingID, selector: (state: DrawingState) => string | undefined): string;
@@ -0,0 +1,6 @@
1
+ import { StageColors } from '../theme/stage';
2
+ /**
3
+ * What a thing on the stage is drawn in while it is under the hand: the highlight, held back
4
+ * while it is only pointed at; red once the feature being made has taken it.
5
+ */
6
+ export declare const getHighlightedColor: (isGHovered: boolean, isGSelected: boolean, isSHovered: boolean, isSSelected: boolean, stage?: StageColors) => string | undefined;
@@ -0,0 +1,2 @@
1
+ import { DrawingID, ObjectID } from '@classcad/sdkjs';
2
+ export declare const getMatePath: (drawingId: DrawingID, prRefId: ObjectID) => number[];
@@ -0,0 +1,30 @@
1
+ import { DrawingID, ObjectID } from '@classcad/sdkjs';
2
+ /**
3
+ * Finds the instances of the current assembly that an assembly constraint joins: the ones its two mates are in.
4
+ *
5
+ * A mate's path leads from an instance of the current assembly down to the coordinate system the mate is on; a mate
6
+ * whose path or coordinate system is gone counts for nothing. Buerligons outlines the instances while the constraint
7
+ * is under the pointer.
8
+ *
9
+ * @param drawingId - The drawing.
10
+ * @param constrId - The constraint (one with `firstRefMate` and `secondRefMate`).
11
+ * @returns The ids of the instances (children of the current instance), or `undefined` where neither mate is valid.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * import { createInfo, getDrawing } from '@classcad/sdkjs'
16
+ * import type { DrawingID, ObjectID } from '@classcad/sdkjs'
17
+ * import { getMateRefIds } from '@classcad/react-cad'
18
+ *
19
+ * // selects the two instances a constraint joins, as Buerligons outlines them
20
+ * function selectJoined(drawingId: DrawingID, constraintId: ObjectID) {
21
+ * const drawing = getDrawing(drawingId)
22
+ * const joined = getMateRefIds(drawingId, constraintId) ?? []
23
+ * drawing.api.interaction.setSelected(joined.map((id) => createInfo({ objectId: id, prodRefId: id })))
24
+ * }
25
+ * ```
26
+ *
27
+ * @advanced
28
+ * @category Utilities
29
+ */
30
+ export declare const getMateRefIds: (drawingId: DrawingID, constrId: ObjectID) => number[] | undefined;
@@ -0,0 +1,19 @@
1
+ import { DrawingID, GeometryElement, GraphicID, ScgObject, MemberType, ObjectID, ScgPointMem, ScgPoint, ContainerGeometryT } from '@classcad/sdkjs';
2
+ import * as THREE from 'three';
3
+ export declare function useGlobalToLocalMatrix(drawingId: DrawingID, objId: ObjectID | undefined): THREE.Matrix4;
4
+ export declare function getGlobalToLocalMatrix(drawingId: DrawingID, objId: ObjectID): THREE.Matrix4;
5
+ export declare function convertToVector(point: ScgPointMem | undefined): THREE.Vector3;
6
+ export declare function convertToArray(point: ScgPointMem): number[];
7
+ export declare function linesIntersection(point1: THREE.Vector3, dir1: THREE.Vector3, point2: THREE.Vector3, dir2: THREE.Vector3): THREE.Vector3 | null;
8
+ export declare const angleVecVec: (a: THREE.Vector3, b: THREE.Vector3) => number;
9
+ export declare const degreesToRadians: (degrees: number) => number;
10
+ export declare const radiansToDegrees: (radians: number) => number;
11
+ export declare const getPointOnPlane: (unprojectedPoint: THREE.Vector3, camera: THREE.Camera, globalToLocalM: THREE.Matrix4) => THREE.Vector3;
12
+ export declare const closestAngle: (value: number, to: number) => number;
13
+ export declare const stringifyValue: (value: string | number | ScgPoint, type: MemberType) => string;
14
+ export declare function findObject(drawingId: DrawingID, id: GraphicID | ObjectID, unrollRefs?: boolean): ScgObject | ContainerGeometryT | GeometryElement | undefined;
15
+ export declare function fmod(num: number, denom: number): number;
16
+ export declare const solveQuadratic: (a: number, b: number, c: number) => number[];
17
+ export declare const solveCubic: (a: number, b: number, c: number, d: number) => number[];
18
+ export declare const solveQuartic: (a: number, b: number, c: number, d: number, e: number) => number[];
19
+ export declare function getRegionCoordSys(drawingId: DrawingID, regionObj: ScgObject): THREE.Vector3[];
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Helpers for the mates of an assembly: which of the assembly's instances a nested instance moves with.
3
+ *
4
+ * @advanced
5
+ * @category Utilities
6
+ * @module
7
+ */
8
+ import { DrawingID, ObjectID } from '@classcad/sdkjs';
9
+ /**
10
+ * Finds the rigid set an instance moves with: the instance of the current assembly it is in (or the current product
11
+ * itself, for one of its own), if that is one of `rigidSets`.
12
+ *
13
+ * An assembly's constraints hold its own instances, and what is nested in one of them moves with it. Buerligons asks
14
+ * so when a mate under the pointer is to be dragged: only the instances a selector allows move.
15
+ *
16
+ * @param drawingId - The drawing.
17
+ * @param instanceId - An instance (a product reference) in the current assembly, at any depth.
18
+ * @param rigidSets - The rigid sets to look in: instances of the current assembly, or the current product.
19
+ * @returns The rigid set, or `undefined` where it is not one of `rigidSets` (or there is no drawing).
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * import { getDrawing } from '@classcad/sdkjs'
24
+ * import type { DrawingID, ObjectID } from '@classcad/sdkjs'
25
+ * import { mateUtils } from '@classcad/react-cad'
26
+ *
27
+ * // which of the current assembly's instances moves when a nested instance under the pointer is dragged
28
+ * function instanceToDrag(drawingId: DrawingID, hoveredInstance: ObjectID, movable: ObjectID[]) {
29
+ * const rigidSet = mateUtils.getProductRigidSet(drawingId, hoveredInstance, movable)
30
+ * if (rigidSet === undefined) return null // it moves with nothing that may move
31
+ * return getDrawing(drawingId).structure.tree[rigidSet]
32
+ * }
33
+ * ```
34
+ */
35
+ export declare const getProductRigidSet: (drawingId: DrawingID, instanceId: ObjectID, rigidSets: ObjectID[]) => number | undefined;
@@ -0,0 +1,35 @@
1
+ import * as THREE from 'three';
2
+ type Lerpable<T> = {
3
+ clone(): T;
4
+ lerp(v: T, alpha: number): T;
5
+ };
6
+ export declare const insertKnot: <T extends Lerpable<T>>(points: T[], degree: number, knots: number[], u: number) => [T[], number[]];
7
+ export declare const decomposeToBeziers: <T extends Lerpable<T>>(controlPoints: T[], degree: number, knots: number[]) => T[][];
8
+ export declare const homogenize: (points: THREE.Vector3[], weights: number[]) => THREE.Vector4[];
9
+ export declare const projectHomogeneous: (points: THREE.Vector4[]) => THREE.Vector3[];
10
+ export declare const isUniformWeights: (weights: number[] | undefined, tol?: number) => boolean;
11
+ export declare const getBezierCoefficients: (...x: number[]) => number[];
12
+ export declare const evaluatePolynomial: (coeffs: number[], t: number) => number;
13
+ export declare const derivativeCoefficients: (coeffs: number[]) => number[];
14
+ export declare const addPoly: (a: number[], b: number[]) => number[];
15
+ export declare const scalePoly: (a: number[], s: number) => number[];
16
+ export declare const multiplyPoly: (a: number[], b: number[]) => number[];
17
+ export declare const findRealRootsInInterval: (coeffs: number[], tMin: number, tMax: number, tol?: number) => number[];
18
+ export declare const bezierBBox: (px: number[], py: number[]) => {
19
+ xmin: number;
20
+ xmax: number;
21
+ ymin: number;
22
+ ymax: number;
23
+ };
24
+ export declare const bezierSplitAtHalf: (p: number[]) => [number[], number[]];
25
+ /**
26
+ * Calculates the approximate length of a nurbs span.
27
+ *
28
+ * @param points An array of control points.
29
+ * @param segmentsCount The number of segments to divide the nurbs span into.
30
+ * @param weights Optional Bézier control-point weights (rational curve). Defaults to unit weights.
31
+ * @returns An approximate length of the nurbs span.
32
+ */
33
+ export declare const approximateBezierLength: (points: THREE.Vector3[], segmentsCount?: number, weights?: number[]) => number;
34
+ export declare const closestPointPolyRational: (cx: number[], cy: number[], cw: number[], px: number, py: number) => number[];
35
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare const ccPointFilter: (scope: any, data: any) => boolean;
2
+ export declare const ccLineFilter: (scope: any, data: any) => boolean;
3
+ export declare const ccArcFilter: (scope: any, data: any) => boolean;
4
+ export declare const ccCircleFilter: (scope: any, data: any) => boolean;
5
+ export declare const axisFilter: (scope: any, data: any) => boolean;
6
+ export declare const workPointFilter: (scope: any, data: any) => boolean;
7
+ export declare const workPlaneFilter: (scope: any, data: any) => boolean;
8
+ export declare const workAxisFilter: (scope: any, data: any) => boolean;
9
+ export declare const csysFilter: (scope: any, data: any) => boolean;
10
+ export declare const mateFilter: (scope: any, data: any) => boolean;
11
+ export declare const instanceFilter: (scope: any, data: any) => boolean;
12
+ export declare const curveEntityFilter: (scope: any, data: any) => boolean;