@reekon-tools/boldr-cad 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (649) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +299 -2
  3. package/dist/app/edit.d.ts +31 -0
  4. package/dist/app/edit.js +196 -0
  5. package/dist/app/edit.js.map +1 -0
  6. package/dist/app/state.d.ts +118 -0
  7. package/dist/app/state.js +64 -0
  8. package/dist/app/state.js.map +1 -0
  9. package/dist/core.d.ts +7 -0
  10. package/dist/core.js +8 -0
  11. package/dist/core.js.map +1 -0
  12. package/dist/data/memory.d.ts +22 -0
  13. package/dist/data/memory.js +35 -0
  14. package/dist/data/memory.js.map +1 -0
  15. package/dist/data/provider.d.ts +78 -0
  16. package/dist/data/provider.js +2 -0
  17. package/dist/data/provider.js.map +1 -0
  18. package/dist/data/sync.d.ts +39 -0
  19. package/dist/data/sync.js +353 -0
  20. package/dist/data/sync.js.map +1 -0
  21. package/dist/editor/actions.d.ts +20 -0
  22. package/dist/editor/actions.js +930 -0
  23. package/dist/editor/actions.js.map +1 -0
  24. package/dist/editor/confirm.d.ts +23 -0
  25. package/dist/editor/confirm.js +35 -0
  26. package/dist/editor/confirm.js.map +1 -0
  27. package/dist/editor/conflict.d.ts +13 -0
  28. package/dist/editor/conflict.js +70 -0
  29. package/dist/editor/conflict.js.map +1 -0
  30. package/dist/editor/elevation.d.ts +219 -0
  31. package/dist/editor/elevation.js +945 -0
  32. package/dist/editor/elevation.js.map +1 -0
  33. package/dist/editor/face.d.ts +73 -0
  34. package/dist/editor/face.js +269 -0
  35. package/dist/editor/face.js.map +1 -0
  36. package/dist/editor/files.d.ts +20 -0
  37. package/dist/editor/files.js +123 -0
  38. package/dist/editor/files.js.map +1 -0
  39. package/dist/editor/gestures.d.ts +46 -0
  40. package/dist/editor/gestures.js +311 -0
  41. package/dist/editor/gestures.js.map +1 -0
  42. package/dist/editor/keypad.d.ts +65 -0
  43. package/dist/editor/keypad.js +171 -0
  44. package/dist/editor/keypad.js.map +1 -0
  45. package/dist/editor/keys.d.ts +11 -0
  46. package/dist/editor/keys.js +165 -0
  47. package/dist/editor/keys.js.map +1 -0
  48. package/dist/editor/laser.d.ts +42 -0
  49. package/dist/editor/laser.js +177 -0
  50. package/dist/editor/laser.js.map +1 -0
  51. package/dist/editor/linkActions.d.ts +49 -0
  52. package/dist/editor/linkActions.js +210 -0
  53. package/dist/editor/linkActions.js.map +1 -0
  54. package/dist/editor/linkFollow.d.ts +2 -0
  55. package/dist/editor/linkFollow.js +53 -0
  56. package/dist/editor/linkFollow.js.map +1 -0
  57. package/dist/editor/linkWrite.d.ts +13 -0
  58. package/dist/editor/linkWrite.js +84 -0
  59. package/dist/editor/linkWrite.js.map +1 -0
  60. package/dist/editor/links.d.ts +84 -0
  61. package/dist/editor/links.js +130 -0
  62. package/dist/editor/links.js.map +1 -0
  63. package/dist/editor/markup.d.ts +30 -0
  64. package/dist/editor/markup.js +106 -0
  65. package/dist/editor/markup.js.map +1 -0
  66. package/dist/editor/mode.d.ts +47 -0
  67. package/dist/editor/mode.js +105 -0
  68. package/dist/editor/mode.js.map +1 -0
  69. package/dist/editor/ports.d.ts +136 -0
  70. package/dist/editor/ports.js +60 -0
  71. package/dist/editor/ports.js.map +1 -0
  72. package/dist/editor/project.d.ts +73 -0
  73. package/dist/editor/project.js +310 -0
  74. package/dist/editor/project.js.map +1 -0
  75. package/dist/editor/selection.d.ts +29 -0
  76. package/dist/editor/selection.js +116 -0
  77. package/dist/editor/selection.js.map +1 -0
  78. package/dist/editor/status.d.ts +7 -0
  79. package/dist/editor/status.js +27 -0
  80. package/dist/editor/status.js.map +1 -0
  81. package/dist/editor/tooltips.d.ts +5 -0
  82. package/dist/editor/tooltips.js +48 -0
  83. package/dist/editor/tooltips.js.map +1 -0
  84. package/dist/editor/view3d.d.ts +17 -0
  85. package/dist/editor/view3d.js +135 -0
  86. package/dist/editor/view3d.js.map +1 -0
  87. package/dist/editor/view3dState.d.ts +39 -0
  88. package/dist/editor/view3dState.js +44 -0
  89. package/dist/editor/view3dState.js.map +1 -0
  90. package/dist/export/dxf.d.ts +7 -0
  91. package/dist/export/dxf.js +119 -0
  92. package/dist/export/dxf.js.map +1 -0
  93. package/dist/export/pdf.d.ts +19 -0
  94. package/dist/export/pdf.js +275 -0
  95. package/dist/export/pdf.js.map +1 -0
  96. package/dist/export/plan.d.ts +59 -0
  97. package/dist/export/plan.js +319 -0
  98. package/dist/export/plan.js.map +1 -0
  99. package/dist/index.d.ts +12 -0
  100. package/dist/index.js +13 -0
  101. package/dist/index.js.map +1 -0
  102. package/dist/model/constraints.d.ts +13 -0
  103. package/dist/model/constraints.js +139 -0
  104. package/dist/model/constraints.js.map +1 -0
  105. package/dist/model/demo.d.ts +5 -0
  106. package/dist/model/demo.js +42 -0
  107. package/dist/model/demo.js.map +1 -0
  108. package/dist/model/elevation.d.ts +60 -0
  109. package/dist/model/elevation.js +83 -0
  110. package/dist/model/elevation.js.map +1 -0
  111. package/dist/model/faces.d.ts +58 -0
  112. package/dist/model/faces.js +197 -0
  113. package/dist/model/faces.js.map +1 -0
  114. package/dist/model/facesolve.d.ts +72 -0
  115. package/dist/model/facesolve.js +369 -0
  116. package/dist/model/facesolve.js.map +1 -0
  117. package/dist/model/geom.d.ts +23 -0
  118. package/dist/model/geom.js +92 -0
  119. package/dist/model/geom.js.map +1 -0
  120. package/dist/model/history.d.ts +22 -0
  121. package/dist/model/history.js +68 -0
  122. package/dist/model/history.js.map +1 -0
  123. package/dist/model/ids.d.ts +3 -0
  124. package/dist/model/ids.js +5 -0
  125. package/dist/model/ids.js.map +1 -0
  126. package/dist/model/images.d.ts +18 -0
  127. package/dist/model/images.js +26 -0
  128. package/dist/model/images.js.map +1 -0
  129. package/dist/model/index.d.ts +8 -0
  130. package/dist/model/index.js +9 -0
  131. package/dist/model/index.js.map +1 -0
  132. package/dist/model/links.d.ts +46 -0
  133. package/dist/model/links.js +73 -0
  134. package/dist/model/links.js.map +1 -0
  135. package/dist/model/markup.d.ts +46 -0
  136. package/dist/model/markup.js +71 -0
  137. package/dist/model/markup.js.map +1 -0
  138. package/dist/model/measurement.d.ts +11 -0
  139. package/dist/model/measurement.js +24 -0
  140. package/dist/model/measurement.js.map +1 -0
  141. package/dist/model/openings.d.ts +111 -0
  142. package/dist/model/openings.js +316 -0
  143. package/dist/model/openings.js.map +1 -0
  144. package/dist/model/planGeom.d.ts +101 -0
  145. package/dist/model/planGeom.js +218 -0
  146. package/dist/model/planGeom.js.map +1 -0
  147. package/dist/model/project.d.ts +13 -0
  148. package/dist/model/project.js +17 -0
  149. package/dist/model/project.js.map +1 -0
  150. package/dist/model/projectfile.d.ts +10 -0
  151. package/dist/model/projectfile.js +50 -0
  152. package/dist/model/projectfile.js.map +1 -0
  153. package/dist/model/rooms.d.ts +30 -0
  154. package/dist/model/rooms.js +214 -0
  155. package/dist/model/rooms.js.map +1 -0
  156. package/dist/model/session.d.ts +8 -0
  157. package/dist/model/session.js +26 -0
  158. package/dist/model/session.js.map +1 -0
  159. package/dist/model/settings.d.ts +27 -0
  160. package/dist/model/settings.js +9 -0
  161. package/dist/model/settings.js.map +1 -0
  162. package/dist/model/sketch.d.ts +57 -0
  163. package/dist/model/sketch.js +424 -0
  164. package/dist/model/sketch.js.map +1 -0
  165. package/dist/model/smooth.d.ts +6 -0
  166. package/dist/model/smooth.js +52 -0
  167. package/dist/model/smooth.js.map +1 -0
  168. package/dist/model/store.d.ts +39 -0
  169. package/dist/model/store.js +108 -0
  170. package/dist/model/store.js.map +1 -0
  171. package/dist/model/stroke.d.ts +18 -0
  172. package/dist/model/stroke.js +103 -0
  173. package/dist/model/stroke.js.map +1 -0
  174. package/dist/model/types.d.ts +367 -0
  175. package/dist/model/types.js +4 -0
  176. package/dist/model/types.js.map +1 -0
  177. package/dist/model/wallfaces.d.ts +44 -0
  178. package/dist/model/wallfaces.js +182 -0
  179. package/dist/model/wallfaces.js.map +1 -0
  180. package/dist/model/wallshape.d.ts +15 -0
  181. package/dist/model/wallshape.js +89 -0
  182. package/dist/model/wallshape.js.map +1 -0
  183. package/dist/react/BottomBar.d.ts +12 -0
  184. package/dist/react/BottomBar.js +233 -0
  185. package/dist/react/BottomBar.js.map +1 -0
  186. package/dist/react/Buttons.d.ts +40 -0
  187. package/dist/react/Buttons.js +56 -0
  188. package/dist/react/Buttons.js.map +1 -0
  189. package/dist/react/CadEditor.d.ts +81 -0
  190. package/dist/react/CadEditor.js +146 -0
  191. package/dist/react/CadEditor.js.map +1 -0
  192. package/dist/react/ConfirmSheet.d.ts +4 -0
  193. package/dist/react/ConfirmSheet.js +31 -0
  194. package/dist/react/ConfirmSheet.js.map +1 -0
  195. package/dist/react/ConflictSheet.d.ts +5 -0
  196. package/dist/react/ConflictSheet.js +32 -0
  197. package/dist/react/ConflictSheet.js.map +1 -0
  198. package/dist/react/Drawer.d.ts +8 -0
  199. package/dist/react/Drawer.js +209 -0
  200. package/dist/react/Drawer.js.map +1 -0
  201. package/dist/react/Duck.d.ts +13 -0
  202. package/dist/react/Duck.js +45 -0
  203. package/dist/react/Duck.js.map +1 -0
  204. package/dist/react/Empty3D.d.ts +2 -0
  205. package/dist/react/Empty3D.js +39 -0
  206. package/dist/react/Empty3D.js.map +1 -0
  207. package/dist/react/FitScroll.d.ts +6 -0
  208. package/dist/react/FitScroll.js +14 -0
  209. package/dist/react/FitScroll.js.map +1 -0
  210. package/dist/react/Icon.native.d.ts +12 -0
  211. package/dist/react/Icon.native.js +12 -0
  212. package/dist/react/Icon.native.js.map +1 -0
  213. package/dist/react/Icon.web.d.ts +12 -0
  214. package/dist/react/Icon.web.js +11 -0
  215. package/dist/react/Icon.web.js.map +1 -0
  216. package/dist/react/KeypadSheet.d.ts +11 -0
  217. package/dist/react/KeypadSheet.js +183 -0
  218. package/dist/react/KeypadSheet.js.map +1 -0
  219. package/dist/react/LaserTray.d.ts +4 -0
  220. package/dist/react/LaserTray.js +26 -0
  221. package/dist/react/LaserTray.js.map +1 -0
  222. package/dist/react/MarkupPanel.d.ts +8 -0
  223. package/dist/react/MarkupPanel.js +67 -0
  224. package/dist/react/MarkupPanel.js.map +1 -0
  225. package/dist/react/PageThumb.native.d.ts +11 -0
  226. package/dist/react/PageThumb.native.js +26 -0
  227. package/dist/react/PageThumb.native.js.map +1 -0
  228. package/dist/react/PageThumb.web.d.ts +7 -0
  229. package/dist/react/PageThumb.web.js +14 -0
  230. package/dist/react/PageThumb.web.js.map +1 -0
  231. package/dist/react/PlanCanvas.native.d.ts +1 -0
  232. package/dist/react/PlanCanvas.native.js +175 -0
  233. package/dist/react/PlanCanvas.native.js.map +1 -0
  234. package/dist/react/PlanCanvas.web.d.ts +1 -0
  235. package/dist/react/PlanCanvas.web.js +82 -0
  236. package/dist/react/PlanCanvas.web.js.map +1 -0
  237. package/dist/react/Popovers.d.ts +16 -0
  238. package/dist/react/Popovers.js +98 -0
  239. package/dist/react/Popovers.js.map +1 -0
  240. package/dist/react/Rail.d.ts +29 -0
  241. package/dist/react/Rail.js +337 -0
  242. package/dist/react/Rail.js.map +1 -0
  243. package/dist/react/RichText.d.ts +6 -0
  244. package/dist/react/RichText.js +8 -0
  245. package/dist/react/RichText.js.map +1 -0
  246. package/dist/react/ShapeMenu.d.ts +7 -0
  247. package/dist/react/ShapeMenu.js +58 -0
  248. package/dist/react/ShapeMenu.js.map +1 -0
  249. package/dist/react/Sheet.d.ts +23 -0
  250. package/dist/react/Sheet.js +68 -0
  251. package/dist/react/Sheet.js.map +1 -0
  252. package/dist/react/Slider.d.ts +18 -0
  253. package/dist/react/Slider.js +27 -0
  254. package/dist/react/Slider.js.map +1 -0
  255. package/dist/react/Toast.d.ts +4 -0
  256. package/dist/react/Toast.js +27 -0
  257. package/dist/react/Toast.js.map +1 -0
  258. package/dist/react/ToolTip.d.ts +7 -0
  259. package/dist/react/ToolTip.js +43 -0
  260. package/dist/react/ToolTip.js.map +1 -0
  261. package/dist/react/TopBar.d.ts +15 -0
  262. package/dist/react/TopBar.js +70 -0
  263. package/dist/react/TopBar.js.map +1 -0
  264. package/dist/react/Tween.d.ts +7 -0
  265. package/dist/react/Tween.js +26 -0
  266. package/dist/react/Tween.js.map +1 -0
  267. package/dist/react/Tween.native.d.ts +6 -0
  268. package/dist/react/Tween.native.js +43 -0
  269. package/dist/react/Tween.native.js.map +1 -0
  270. package/dist/react/View3D.native.d.ts +4 -0
  271. package/dist/react/View3D.native.js +103 -0
  272. package/dist/react/View3D.native.js.map +1 -0
  273. package/dist/react/View3D.web.d.ts +4 -0
  274. package/dist/react/View3D.web.js +151 -0
  275. package/dist/react/View3D.web.js.map +1 -0
  276. package/dist/react/View3DHost.d.ts +143 -0
  277. package/dist/react/View3DHost.js +377 -0
  278. package/dist/react/View3DHost.js.map +1 -0
  279. package/dist/react/corners.d.ts +7 -0
  280. package/dist/react/corners.js +51 -0
  281. package/dist/react/corners.js.map +1 -0
  282. package/dist/react/easing.d.ts +15 -0
  283. package/dist/react/easing.js +10 -0
  284. package/dist/react/easing.js.map +1 -0
  285. package/dist/react/files.native.d.ts +6 -0
  286. package/dist/react/files.native.js +11 -0
  287. package/dist/react/files.native.js.map +1 -0
  288. package/dist/react/files.web.d.ts +8 -0
  289. package/dist/react/files.web.js +46 -0
  290. package/dist/react/files.web.js.map +1 -0
  291. package/dist/react/host.d.ts +13 -0
  292. package/dist/react/host.js +31 -0
  293. package/dist/react/host.js.map +1 -0
  294. package/dist/react/hostKeypad.d.ts +56 -0
  295. package/dist/react/hostKeypad.js +5 -0
  296. package/dist/react/hostKeypad.js.map +1 -0
  297. package/dist/react/motion.d.ts +77 -0
  298. package/dist/react/motion.js +173 -0
  299. package/dist/react/motion.js.map +1 -0
  300. package/dist/react/pageLock.native.d.ts +3 -0
  301. package/dist/react/pageLock.native.js +4 -0
  302. package/dist/react/pageLock.native.js.map +1 -0
  303. package/dist/react/pageLock.web.d.ts +2 -0
  304. package/dist/react/pageLock.web.js +55 -0
  305. package/dist/react/pageLock.web.js.map +1 -0
  306. package/dist/react/ports.d.ts +7 -0
  307. package/dist/react/ports.js +189 -0
  308. package/dist/react/ports.js.map +1 -0
  309. package/dist/react/saving.d.ts +15 -0
  310. package/dist/react/saving.js +76 -0
  311. package/dist/react/saving.js.map +1 -0
  312. package/dist/react/store.d.ts +75 -0
  313. package/dist/react/store.js +65 -0
  314. package/dist/react/store.js.map +1 -0
  315. package/dist/react/theme.d.ts +37 -0
  316. package/dist/react/theme.js +22 -0
  317. package/dist/react/theme.js.map +1 -0
  318. package/dist/react/thumbnail.native.d.ts +3 -0
  319. package/dist/react/thumbnail.native.js +12 -0
  320. package/dist/react/thumbnail.native.js.map +1 -0
  321. package/dist/react/thumbnail.web.d.ts +3 -0
  322. package/dist/react/thumbnail.web.js +24 -0
  323. package/dist/react/thumbnail.web.js.map +1 -0
  324. package/dist/react/topRow.d.ts +22 -0
  325. package/dist/react/topRow.js +61 -0
  326. package/dist/react/topRow.js.map +1 -0
  327. package/dist/react/touch.d.ts +6 -0
  328. package/dist/react/touch.js +9 -0
  329. package/dist/react/touch.js.map +1 -0
  330. package/dist/render/ctx.d.ts +48 -0
  331. package/dist/render/ctx.js +7 -0
  332. package/dist/render/ctx.js.map +1 -0
  333. package/dist/render/draw.d.ts +85 -0
  334. package/dist/render/draw.js +1755 -0
  335. package/dist/render/draw.js.map +1 -0
  336. package/dist/render/elevation.d.ts +104 -0
  337. package/dist/render/elevation.js +617 -0
  338. package/dist/render/elevation.js.map +1 -0
  339. package/dist/render/figmaIcons.d.ts +12 -0
  340. package/dist/render/figmaIcons.js +21 -0
  341. package/dist/render/figmaIcons.js.map +1 -0
  342. package/dist/render/hit.d.ts +26 -0
  343. package/dist/render/hit.js +311 -0
  344. package/dist/render/hit.js.map +1 -0
  345. package/dist/render/icons.d.ts +2 -0
  346. package/dist/render/icons.js +131 -0
  347. package/dist/render/icons.js.map +1 -0
  348. package/dist/render/linkTile.d.ts +15 -0
  349. package/dist/render/linkTile.js +369 -0
  350. package/dist/render/linkTile.js.map +1 -0
  351. package/dist/render/markup.d.ts +11 -0
  352. package/dist/render/markup.js +112 -0
  353. package/dist/render/markup.js.map +1 -0
  354. package/dist/render/navigate.d.ts +88 -0
  355. package/dist/render/navigate.js +100 -0
  356. package/dist/render/navigate.js.map +1 -0
  357. package/dist/render/snap.d.ts +31 -0
  358. package/dist/render/snap.js +225 -0
  359. package/dist/render/snap.js.map +1 -0
  360. package/dist/render/squircle.d.ts +8 -0
  361. package/dist/render/squircle.js +71 -0
  362. package/dist/render/squircle.js.map +1 -0
  363. package/dist/render/theme.d.ts +70 -0
  364. package/dist/render/theme.js +27 -0
  365. package/dist/render/theme.js.map +1 -0
  366. package/dist/render/view.d.ts +192 -0
  367. package/dist/render/view.js +435 -0
  368. package/dist/render/view.js.map +1 -0
  369. package/dist/skia/SkiaDrawCtx.d.ts +115 -0
  370. package/dist/skia/SkiaDrawCtx.js +405 -0
  371. package/dist/skia/SkiaDrawCtx.js.map +1 -0
  372. package/dist/skia/fonts.d.ts +6 -0
  373. package/dist/skia/fonts.js +4 -0
  374. package/dist/skia/fonts.js.map +1 -0
  375. package/dist/skia/host.d.ts +30 -0
  376. package/dist/skia/host.js +100 -0
  377. package/dist/skia/host.js.map +1 -0
  378. package/dist/solver/equations.d.ts +29 -0
  379. package/dist/solver/equations.js +253 -0
  380. package/dist/solver/equations.js.map +1 -0
  381. package/dist/solver/gauss-newton.d.ts +44 -0
  382. package/dist/solver/gauss-newton.js +341 -0
  383. package/dist/solver/gauss-newton.js.map +1 -0
  384. package/dist/solver/index.d.ts +5 -0
  385. package/dist/solver/index.js +6 -0
  386. package/dist/solver/index.js.map +1 -0
  387. package/dist/solver/linalg.d.ts +57 -0
  388. package/dist/solver/linalg.js +289 -0
  389. package/dist/solver/linalg.js.map +1 -0
  390. package/dist/solver/types.d.ts +50 -0
  391. package/dist/solver/types.js +2 -0
  392. package/dist/solver/types.js.map +1 -0
  393. package/dist/tools/annotate.d.ts +128 -0
  394. package/dist/tools/annotate.js +282 -0
  395. package/dist/tools/annotate.js.map +1 -0
  396. package/dist/tools/chamfer.d.ts +12 -0
  397. package/dist/tools/chamfer.js +114 -0
  398. package/dist/tools/chamfer.js.map +1 -0
  399. package/dist/tools/corner.d.ts +38 -0
  400. package/dist/tools/corner.js +99 -0
  401. package/dist/tools/corner.js.map +1 -0
  402. package/dist/tools/dim.d.ts +114 -0
  403. package/dist/tools/dim.js +912 -0
  404. package/dist/tools/dim.js.map +1 -0
  405. package/dist/tools/elevation.d.ts +13 -0
  406. package/dist/tools/elevation.js +125 -0
  407. package/dist/tools/elevation.js.map +1 -0
  408. package/dist/tools/fillet.d.ts +9 -0
  409. package/dist/tools/fillet.js +86 -0
  410. package/dist/tools/fillet.js.map +1 -0
  411. package/dist/tools/freehand.d.ts +27 -0
  412. package/dist/tools/freehand.js +132 -0
  413. package/dist/tools/freehand.js.map +1 -0
  414. package/dist/tools/index.d.ts +6 -0
  415. package/dist/tools/index.js +48 -0
  416. package/dist/tools/index.js.map +1 -0
  417. package/dist/tools/line.d.ts +26 -0
  418. package/dist/tools/line.js +236 -0
  419. package/dist/tools/line.js.map +1 -0
  420. package/dist/tools/modify.d.ts +55 -0
  421. package/dist/tools/modify.js +375 -0
  422. package/dist/tools/modify.js.map +1 -0
  423. package/dist/tools/openings.d.ts +19 -0
  424. package/dist/tools/openings.js +220 -0
  425. package/dist/tools/openings.js.map +1 -0
  426. package/dist/tools/registry.d.ts +47 -0
  427. package/dist/tools/registry.js +115 -0
  428. package/dist/tools/registry.js.map +1 -0
  429. package/dist/tools/select.d.ts +180 -0
  430. package/dist/tools/select.js +937 -0
  431. package/dist/tools/select.js.map +1 -0
  432. package/dist/tools/shapes.d.ts +63 -0
  433. package/dist/tools/shapes.js +314 -0
  434. package/dist/tools/shapes.js.map +1 -0
  435. package/dist/units/format.d.ts +16 -0
  436. package/dist/units/format.js +60 -0
  437. package/dist/units/format.js.map +1 -0
  438. package/dist/units/index.d.ts +3 -0
  439. package/dist/units/index.js +4 -0
  440. package/dist/units/index.js.map +1 -0
  441. package/dist/units/parse.d.ts +11 -0
  442. package/dist/units/parse.js +102 -0
  443. package/dist/units/parse.js.map +1 -0
  444. package/dist/units/prefs.d.ts +10 -0
  445. package/dist/units/prefs.js +9 -0
  446. package/dist/units/prefs.js.map +1 -0
  447. package/dist/view3d/build.d.ts +35 -0
  448. package/dist/view3d/build.js +630 -0
  449. package/dist/view3d/build.js.map +1 -0
  450. package/dist/view3d/camera.d.ts +60 -0
  451. package/dist/view3d/camera.js +84 -0
  452. package/dist/view3d/camera.js.map +1 -0
  453. package/dist/view3d/fatLines.d.ts +11 -0
  454. package/dist/view3d/fatLines.js +83 -0
  455. package/dist/view3d/fatLines.js.map +1 -0
  456. package/dist/view3d/lines.d.ts +17 -0
  457. package/dist/view3d/lines.js +271 -0
  458. package/dist/view3d/lines.js.map +1 -0
  459. package/dist/view3d/mesh.d.ts +51 -0
  460. package/dist/view3d/mesh.js +101 -0
  461. package/dist/view3d/mesh.js.map +1 -0
  462. package/dist/view3d/poly.d.ts +16 -0
  463. package/dist/view3d/poly.js +109 -0
  464. package/dist/view3d/poly.js.map +1 -0
  465. package/dist/view3d/viewer.d.ts +86 -0
  466. package/dist/view3d/viewer.js +350 -0
  467. package/dist/view3d/viewer.js.map +1 -0
  468. package/package.json +97 -4
  469. package/src/app/edit.ts +178 -0
  470. package/src/app/main.ts +84 -0
  471. package/src/app/state.ts +120 -0
  472. package/src/core.ts +9 -0
  473. package/src/data/memory.ts +37 -0
  474. package/src/data/provider.ts +75 -0
  475. package/src/data/sync.ts +285 -0
  476. package/src/editor/actions.ts +627 -0
  477. package/src/editor/confirm.ts +58 -0
  478. package/src/editor/conflict.ts +66 -0
  479. package/src/editor/elevation.ts +811 -0
  480. package/src/editor/face.ts +227 -0
  481. package/src/editor/files.ts +108 -0
  482. package/src/editor/gestures.ts +273 -0
  483. package/src/editor/keypad.ts +170 -0
  484. package/src/editor/keys.ts +110 -0
  485. package/src/editor/laser.ts +168 -0
  486. package/src/editor/linkActions.ts +194 -0
  487. package/src/editor/linkFollow.ts +43 -0
  488. package/src/editor/linkWrite.ts +77 -0
  489. package/src/editor/links.ts +181 -0
  490. package/src/editor/markup.ts +100 -0
  491. package/src/editor/mode.ts +115 -0
  492. package/src/editor/ports.ts +173 -0
  493. package/src/editor/project.ts +297 -0
  494. package/src/editor/selection.ts +105 -0
  495. package/src/editor/status.ts +23 -0
  496. package/src/editor/tooltips.ts +47 -0
  497. package/src/editor/view3d.ts +119 -0
  498. package/src/editor/view3dState.ts +61 -0
  499. package/src/export/dxf.ts +85 -0
  500. package/src/export/pdf.ts +275 -0
  501. package/src/export/plan.ts +315 -0
  502. package/src/index.ts +18 -0
  503. package/src/input/keyboard.ts +15 -0
  504. package/src/input/pointer.ts +28 -0
  505. package/src/model/constraints.ts +108 -0
  506. package/src/model/demo.ts +36 -0
  507. package/src/model/elevation.ts +114 -0
  508. package/src/model/faces.ts +153 -0
  509. package/src/model/facesolve.ts +322 -0
  510. package/src/model/geom.ts +92 -0
  511. package/src/model/history.ts +79 -0
  512. package/src/model/ids.ts +7 -0
  513. package/src/model/images.ts +35 -0
  514. package/src/model/index.ts +8 -0
  515. package/src/model/links.ts +77 -0
  516. package/src/model/markup.ts +80 -0
  517. package/src/model/measurement.ts +26 -0
  518. package/src/model/openings.ts +315 -0
  519. package/src/model/planGeom.ts +218 -0
  520. package/src/model/project.ts +15 -0
  521. package/src/model/projectfile.ts +46 -0
  522. package/src/model/rooms.ts +183 -0
  523. package/src/model/session.ts +28 -0
  524. package/src/model/settings.ts +37 -0
  525. package/src/model/sketch.ts +300 -0
  526. package/src/model/smooth.ts +51 -0
  527. package/src/model/store.ts +118 -0
  528. package/src/model/stroke.ts +87 -0
  529. package/src/model/types.ts +320 -0
  530. package/src/model/wallfaces.ts +187 -0
  531. package/src/model/wallshape.ts +97 -0
  532. package/src/react/BottomBar.tsx +301 -0
  533. package/src/react/Buttons.tsx +84 -0
  534. package/src/react/CadEditor.tsx +230 -0
  535. package/src/react/ConfirmSheet.tsx +38 -0
  536. package/src/react/ConflictSheet.tsx +47 -0
  537. package/src/react/Drawer.tsx +293 -0
  538. package/src/react/Duck.tsx +50 -0
  539. package/src/react/Empty3D.tsx +32 -0
  540. package/src/react/FitScroll.tsx +19 -0
  541. package/src/react/Icon.native.tsx +12 -0
  542. package/src/react/Icon.web.tsx +11 -0
  543. package/src/react/KeypadSheet.tsx +291 -0
  544. package/src/react/LaserTray.tsx +42 -0
  545. package/src/react/MarkupPanel.tsx +150 -0
  546. package/src/react/PageThumb.native.tsx +30 -0
  547. package/src/react/PageThumb.web.tsx +13 -0
  548. package/src/react/PlanCanvas.native.tsx +200 -0
  549. package/src/react/PlanCanvas.web.tsx +82 -0
  550. package/src/react/Popovers.tsx +191 -0
  551. package/src/react/Rail.tsx +378 -0
  552. package/src/react/RichText.tsx +11 -0
  553. package/src/react/ShapeMenu.tsx +66 -0
  554. package/src/react/Sheet.tsx +78 -0
  555. package/src/react/Slider.tsx +48 -0
  556. package/src/react/Toast.tsx +36 -0
  557. package/src/react/ToolTip.tsx +49 -0
  558. package/src/react/TopBar.tsx +133 -0
  559. package/src/react/Tween.native.tsx +36 -0
  560. package/src/react/Tween.tsx +24 -0
  561. package/src/react/View3D.native.tsx +131 -0
  562. package/src/react/View3D.web.tsx +131 -0
  563. package/src/react/View3DHost.ts +367 -0
  564. package/src/react/corners.ts +52 -0
  565. package/src/react/easing.ts +14 -0
  566. package/src/react/files.native.ts +12 -0
  567. package/src/react/files.web.ts +40 -0
  568. package/src/react/host.ts +32 -0
  569. package/src/react/hostKeypad.ts +66 -0
  570. package/src/react/motion.tsx +239 -0
  571. package/src/react/pageLock.native.ts +3 -0
  572. package/src/react/pageLock.web.ts +49 -0
  573. package/src/react/ports.ts +165 -0
  574. package/src/react/saving.ts +80 -0
  575. package/src/react/store.ts +75 -0
  576. package/src/react/theme.ts +26 -0
  577. package/src/react/thumbnail.native.ts +12 -0
  578. package/src/react/thumbnail.web.ts +22 -0
  579. package/src/react/topRow.ts +71 -0
  580. package/src/react/touch.ts +10 -0
  581. package/src/render/ctx.ts +55 -0
  582. package/src/render/draw.ts +1258 -0
  583. package/src/render/elevation.ts +507 -0
  584. package/src/render/figmaIcons.ts +22 -0
  585. package/src/render/hit.ts +257 -0
  586. package/src/render/icons.ts +132 -0
  587. package/src/render/linkTile.ts +297 -0
  588. package/src/render/markup.ts +91 -0
  589. package/src/render/navigate.ts +114 -0
  590. package/src/render/snap.ts +201 -0
  591. package/src/render/squircle.ts +73 -0
  592. package/src/render/theme.ts +30 -0
  593. package/src/render/view.ts +444 -0
  594. package/src/skia/SkiaDrawCtx.ts +387 -0
  595. package/src/skia/fonts.ts +5 -0
  596. package/src/skia/host.ts +109 -0
  597. package/src/solver/equations.ts +233 -0
  598. package/src/solver/gauss-newton.ts +274 -0
  599. package/src/solver/index.ts +8 -0
  600. package/src/solver/linalg.ts +232 -0
  601. package/src/solver/types.ts +51 -0
  602. package/src/styles.css +320 -0
  603. package/src/tools/annotate.ts +226 -0
  604. package/src/tools/chamfer.ts +103 -0
  605. package/src/tools/corner.ts +99 -0
  606. package/src/tools/dim.ts +767 -0
  607. package/src/tools/elevation.ts +110 -0
  608. package/src/tools/fillet.ts +82 -0
  609. package/src/tools/freehand.ts +108 -0
  610. package/src/tools/index.ts +54 -0
  611. package/src/tools/line.ts +194 -0
  612. package/src/tools/modify.ts +290 -0
  613. package/src/tools/openings.ts +182 -0
  614. package/src/tools/registry.ts +114 -0
  615. package/src/tools/select.ts +712 -0
  616. package/src/tools/shapes.ts +237 -0
  617. package/src/types/skia-web.d.ts +6 -0
  618. package/src/ui/conflict.ts +51 -0
  619. package/src/ui/ctx.ts +50 -0
  620. package/src/ui/dom.ts +4 -0
  621. package/src/ui/domPorts.ts +86 -0
  622. package/src/ui/drawer.ts +86 -0
  623. package/src/ui/elevation.ts +33 -0
  624. package/src/ui/icons.ts +8 -0
  625. package/src/ui/keypad.ts +154 -0
  626. package/src/ui/laser.ts +104 -0
  627. package/src/ui/menu.ts +146 -0
  628. package/src/ui/noteinput.ts +31 -0
  629. package/src/ui/opacity.ts +108 -0
  630. package/src/ui/palette.ts +88 -0
  631. package/src/ui/rail.ts +72 -0
  632. package/src/ui/sheets.ts +22 -0
  633. package/src/ui/status.ts +14 -0
  634. package/src/ui/theme.ts +17 -0
  635. package/src/ui/tip.ts +26 -0
  636. package/src/ui/toast.ts +24 -0
  637. package/src/ui/topbar.ts +14 -0
  638. package/src/ui/underlay.ts +26 -0
  639. package/src/units/format.ts +50 -0
  640. package/src/units/index.ts +3 -0
  641. package/src/units/parse.ts +75 -0
  642. package/src/units/prefs.ts +19 -0
  643. package/src/view3d/build.ts +607 -0
  644. package/src/view3d/camera.ts +113 -0
  645. package/src/view3d/fatLines.ts +83 -0
  646. package/src/view3d/lines.ts +258 -0
  647. package/src/view3d/mesh.ts +111 -0
  648. package/src/view3d/poly.ts +104 -0
  649. package/src/view3d/viewer.ts +348 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 REEKON Tools
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,300 @@
1
- # Temporary Holding Version
1
+ # @reekon-tools/boldr-cad
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ BOLDR's 2D layout editor (BOLDR CAD) as a React Native component, plus the
4
+ model, solver and exporters behind it. Walls, doors and windows, spaces,
5
+ dimensions and constraints, wall elevations and markup, drawn with Skia on
6
+ iOS and Android and with react-native-web in a browser. Drawings are kept in
7
+ BOLDR through a small provider interface, so the package has no Firebase
8
+ dependency of its own.
9
+
10
+ ## Install
11
+
12
+ ```sh
13
+ npm install @reekon-tools/boldr-cad
14
+ ```
15
+
16
+ Peer dependencies:
17
+
18
+ | Package | Range | Needed for |
19
+ | ----------------------------- | --------- | ------------------------------------------- |
20
+ | `react` | `>=19` | always |
21
+ | `react-native` | `>=0.74` | always (react-native-web in a browser) |
22
+ | `@shopify/react-native-skia` | `>=2.5` | the editor on iOS and Android |
23
+ | `react-native-gesture-handler`| `>=2.31` | the editor on iOS and Android |
24
+ | `react-native-reanimated` | `>=4` | the editor on iOS and Android (pan and zoom run on the UI thread; its Babel plugin must be in the app's config) |
25
+ | `react-native-svg` | `>=15` | the editor's icons on iOS and Android |
26
+
27
+ Only `./core` (see below) runs without the four native packages.
28
+
29
+ ## How it resolves
30
+
31
+ The package has two entry points:
32
+
33
+ - `@reekon-tools/boldr-cad` is the editor: `CadEditor`, the data layer and
34
+ the device hooks.
35
+ - `@reekon-tools/boldr-cad/core` is the drawing model without React:
36
+ types, `migrateProject`, project files, unit formatting and the PDF/DXF
37
+ exporters. For servers and tools.
38
+
39
+ **React Native hosts read the TypeScript source.** The package exports a
40
+ `react-native` condition that points at `src/`, so Metro compiles it like app
41
+ code and picks the `.native` platform files itself. Nothing is prebuilt for
42
+ native, which also means a local checkout linked into an app is live with no
43
+ build step.
44
+
45
+ For TypeScript in a React Native app, two compiler options are needed. Expo's
46
+ base tsconfig already sets the first:
47
+
48
+ ```json
49
+ {
50
+ "compilerOptions": {
51
+ "customConditions": ["react-native"],
52
+ "moduleSuffixes": [".ios", ".android", ".native", ""]
53
+ }
54
+ }
55
+ ```
56
+
57
+ **Web and Node take the built `dist/`** through the `default` and `types`
58
+ conditions. In a Vite app, alias `react-native` to `react-native-web` and let
59
+ `.web.js` win, because the platform files in `dist/` have no bare `X.js`:
60
+
61
+ ```ts
62
+ // vite.config.ts
63
+ resolve: {
64
+ alias: [{ find: /^react-native$/, replacement: 'react-native-web' }],
65
+ extensions: ['.web.js', '.web.tsx', '.web.ts', '.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json'],
66
+ },
67
+ ```
68
+
69
+ `dist/` is emitted with extensionless relative imports, so plain Node cannot
70
+ `import('@reekon-tools/boldr-cad/core')` directly. Run it through a bundler
71
+ (esbuild, tsx, vite-node) as BOLDR's own services do.
72
+
73
+ ## Using the editor
74
+
75
+ ```tsx
76
+ import { CadEditor, openCadDrawing, NotACadDrawing, type CadSync } from '@reekon-tools/boldr-cad';
77
+
78
+ function DrawingScreen({ provider }: { provider: CadDataProvider }) {
79
+ const [sync, setSync] = useState<CadSync | null>(null);
80
+
81
+ useEffect(() => {
82
+ let cancelled = false;
83
+ openCadDrawing(provider, { onError: e => console.error(e) }).then(
84
+ s => (cancelled ? s.stop() : setSync(s)),
85
+ e => { if (e instanceof NotACadDrawing) console.log(e.reason); }, // 'missing' | 'legacy'
86
+ );
87
+ return () => { cancelled = true; };
88
+ }, [provider]);
89
+
90
+ if (!sync) return null;
91
+ return <CadEditor sync={sync} onBack={goBack} theme="dark" devTools={false} />;
92
+ }
93
+ ```
94
+
95
+ Mount one `CadEditor` per screen. Mounting starts an editing session,
96
+ unmounting saves and stops the sync it was given. Without `sync` the drawing
97
+ lives in the browser's own storage, which is what the dev harness uses.
98
+
99
+ `CadEditor` props:
100
+
101
+ | Prop | Type | Purpose |
102
+ | ------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
103
+ | `sync` | `CadSync` | The drawing, from `openCadDrawing`. Saved there as it changes. |
104
+ | `onBack` | `() => void` | The top bar's back button. Without it, Back opens the project's pages. |
105
+ | `headerRight` | `ReactNode \| (buttonSize: number) => ReactNode` | The host's own buttons in the top bar, such as a Bluetooth status icon. As a function it gets the bar's round-button size (42 pt on a phone, 46 otherwise). |
106
+ | `theme` | `'light' \| 'dark'` | Canvas colors. The chrome is dark either way. Without it, the person's Theme setting decides. |
107
+ | `units` | `{ format: (inches: number) => string; metric: boolean; denom?: number }` | Lengths the host's way. Hides Units in Settings. |
108
+ | `fonts` | `SkiaFonts` | Typefaces for text on the plan by CSS weight, with a fallback. Device only. |
109
+ | `pickImage` | `() => Promise<{ dataUrl: string; w: number; h: number } \| null>` | A photo or plan to trace. In a browser a file picker is the default. |
110
+ | `saveFile` | `(name: string, mime: string, data: string) => void` | How exports (PDF, DXF, project file) reach the person, e.g. a share sheet. In a browser they download. |
111
+ | `readOnly` | `boolean` | Pan and zoom only, nothing saved. A tap on a link's tile asks, then opens it. |
112
+ | `devTools` | `boolean` | Reset to the demo, open and save project files, in Settings. Default `true`; turn off in production. |
113
+ | `links` | `CadLinks` | The job's files to link on the drawing, and its lengths for lines (see below). Without it there's nothing to link. |
114
+
115
+ Fonts on a device, with react-native-skia:
116
+
117
+ ```ts
118
+ const regular = useTypeface(require('./assets/Inter-Regular.ttf'));
119
+ const bold = useTypeface(require('./assets/Inter-Bold.ttf'));
120
+ const fonts: SkiaFonts | null = regular && bold ? { weights: { 400: regular, 700: bold }, fallback: regular } : null;
121
+ ```
122
+
123
+ Wait for the typefaces before mounting the editor.
124
+
125
+ ### Keeping a drawing in BOLDR
126
+
127
+ `openCadDrawing(provider, options)` loads a drawing through a
128
+ `CadDataProvider` and keeps it in step while the editor is open: only the
129
+ pages that changed are written, each stamped with the session's id; traced
130
+ images are uploaded and stored by reference; pages another device changed are
131
+ taken in when they aren't being edited locally.
132
+
133
+ ```ts
134
+ interface CadDataProvider {
135
+ subscribeFile(cb: (file: { name: string; meta: CadFileMeta | null } | null) => void): () => void;
136
+ subscribePages(cb: (pages: Record<string, CadPageDoc>) => void): () => void;
137
+ writeMeta(meta: CadFileMeta): Promise<void>;
138
+ writePage(id: string, page: CadPageDoc): Promise<void>;
139
+ deletePage(id: string): Promise<void>;
140
+ uploadImage(pageId: string, dataUrl: string): Promise<string>; // returns a URL or a `stored:<path>` reference
141
+ imageUrl?(ref: string): Promise<string>; // turns a stored reference into a URL
142
+ uploadThumbnail?(dataUrl: string): Promise<void>;
143
+ measurements?: CadMeasurements;
144
+ }
145
+ ```
146
+
147
+ A drawing is one file document with `fileData: CadFileMeta`
148
+ (`format: 'boldr-cad'`, `version: 1`, `pageOrder`, shared settings) and one
149
+ page document per page (`name`, the sketch, the underlay, and the `rev` of
150
+ the session that wrote it last). Storage paths are relative to the drawing's
151
+ own folder, so copying or moving a drawing with its folder keeps it working.
152
+
153
+ Options: `initialize: true` starts a new drawing when the file has no drawing
154
+ record yet; `onError` hears about failed writes and uploads. The promise
155
+ rejects with `NotACadDrawing` whose `reason` is `'missing'` (no such file) or
156
+ `'legacy'` (a file from the retired layout tool).
157
+
158
+ The returned `CadSync` has `stop()`, `idle()` (resolves once every write so
159
+ far has finished), `saveThumbnail(pngDataUrl)` and `imageUrl(ref)`.
160
+
161
+ **Measurements.** A dimension drawn in the editor is the drawing's alone: no
162
+ measurement is made for it. The person saves one to the drawing's group from
163
+ its bar (Save to group, through `links.saveMeasurement`), and it's linked to
164
+ that measurement from then on. Drawings made by earlier versions kept every
165
+ driving dimension as a measurement of the drawing's file; when the provider
166
+ supplies `measurements`, those still follow their dimensions both ways
167
+ (`create` is no longer called). `setPlaced(ids, linked)` hears every
168
+ measurement the drawing shows: its own, and the job's it's linked to, each with
169
+ its group (and a form's column). `measurementOf(constraint)` gives a
170
+ constraint's value as BOLDR keeps it — lengths in micrometres, angles in
171
+ degrees — or `null` for reference and print dimensions and linked ones.
172
+
173
+ ### Linking the job's files and measurements
174
+
175
+ With `links`, Annotate gets a yellow + (under the rail; a phone's in the
176
+ trash's corner while nothing's selected) that puts the job's files on the plan
177
+ as tiles, with leaders, opened from the bar. A measurement comes into a drawing
178
+ only as the dimension it drives: in Draft, a line's length keypad (select the
179
+ line, tap +) offers the job's lengths (a page it swipes to on a touch screen,
180
+ Select from list on a desktop), and the one picked sets the line, linked to
181
+ it. A dimension is saved to the group from its bar (Save to group). A new length for a linked dimension asks first: Change both, Only this
182
+ drawing (unlinks), or Cancel.
183
+
184
+ ```ts
185
+ interface CadLinks {
186
+ pick(req: { want: 'files'; linked: LinkTarget[] }): Promise<LinkTarget[]>; // [] for nothing
187
+ measurements?(cb: (list: LinkTarget[]) => void): () => void; // the job's lengths and angles, in the order to show them
188
+ pickMeasurement?(req: { kind: 'length' | 'angle' }): Promise<LinkTarget | null>; // the host's own list (a side drawer)
189
+ subscribe(targets: LinkTarget[], cb: (info: Record<string, LinkInfo>) => void): () => void;
190
+ open(target: LinkTarget): void;
191
+ update?(target: LinkTarget, value: number, capture?: unknown): void; // µm or degrees, the person having said so
192
+ saveMeasurement?(m: { kind: 'length' | 'angle'; value: number; capture?: unknown }): Promise<LinkTarget | null>;
193
+ canSave?: boolean; // false where a measurement can't be saved (a form's group)
194
+ }
195
+ ```
196
+
197
+ - A `LinkTarget` is `{ kind: 'file' | 'measurement', id, groupId, columnId? }`
198
+ plus what it was when it was linked (`name`, `groupName`, `fileType`,
199
+ `mkind`, `value`, `text`). Resolve it by `groupId` and `id` in the job open
200
+ now, never by a stored path, so copied and moved jobs keep working.
201
+ - `pick` offers the job's files to pick. BOLDR's pickers show the measurements
202
+ too, greyed out, and a tap on one says they're added in Draft; anything but
203
+ a file handed back is dropped.
204
+ - A line's length keypad and a dimension's angle keypad take the job's
205
+ measurements. On a touch screen the keypad swipes to a page of them; on a
206
+ desktop it has Select from list, which calls `pickMeasurement` (the host's
207
+ own list, those of `kind` pickable and the rest greyed out), or shows that
208
+ page when the host has none. `measurements` calls back with the job's
209
+ lengths and angles as measurement targets (with `mkind`, `value` in
210
+ micrometres or degrees, and `text`), again as they change, and not until
211
+ the whole job's been heard from; the keypad greys out those that aren't its
212
+ kind. A host keypad (`keypad`) gets `measurementKind` and `pickMeasurement`
213
+ on such a request: show the job's measurements a swipe away, greying out
214
+ the other kind, and hand back the one tapped.
215
+ - To draw that page itself, so the list looks as it does everywhere else in
216
+ the host, pass `measurementList` to `CadEditor`: a function of
217
+ `{ kind, pick, width, height }` that returns the list's element (for
218
+ example `page => <JobList {...page} />`). It's rendered as a component of its
219
+ own from when the page is first shown, and again when what it's given
220
+ changes. List the job's measurements at that size, grey out the other kind,
221
+ and call `pick` with the one tapped. BOLDR does on a tablet, with its phone
222
+ keypad's list. Without it the page is the editor's own grid, made from
223
+ `measurements`. Either way the page is there only when `links` has
224
+ `measurements` or `pickMeasurement`, and a desktop shows it only without
225
+ `pickMeasurement`.
226
+ - `subscribe` answers by `linkKey(target)`, and again whenever that changes.
227
+ Say `exists: false` only once it's known to be gone, never while loading.
228
+ `text` is the value written the host's way; `thumbUrl` a picture to show.
229
+ - Pass one `links` object for as long as the drawing is open (memoize it).
230
+
231
+ **Laser readings.** `laserReading(inches, capture)` takes the host's own record
232
+ of a reading (anything JSON: its device, its number). It's kept on the
233
+ dimension the reading sets and handed back with `saveMeasurement`, or with
234
+ `update` for a linked one, so a measurement saved from a reading records its
235
+ device. A value typed over it isn't the reading's.
236
+
237
+ For tests and prototypes, `memoryProvider()` is an in-memory provider with
238
+ `remote()` and `remoteMeasurement()` to change things as another device would.
239
+
240
+ ### Measuring devices
241
+
242
+ ```ts
243
+ import { setLaserConnected, laserReading } from '@reekon-tools/boldr-cad';
244
+
245
+ setLaserConnected(true); // shows the reading tray, enables the keypad's Laser key
246
+ laserReading(inches, capture); // into an open keypad, onto the selected wall, or into the tray
247
+ ```
248
+
249
+ `laserReading` returns `false` when no drawing is open to take the value, so
250
+ the host can handle it instead.
251
+
252
+ ## `./core`
253
+
254
+ ```ts
255
+ import { sketchToPdf, pdfFileName, sketchToDxf, dxfFileName, fmtLen, parseLen, projectFromFile, migrateProject } from '@reekon-tools/boldr-cad/core';
256
+ ```
257
+
258
+ The model types (`Project`, `Page`, `Sketch`, `Line`, `Constraint`, ...),
259
+ `migrateProject` for older saves, `projectToFile` / `projectFromFile` for
260
+ project files, the unit helpers (`fmtLen`, `parseLen`, `fmtArea`) and the
261
+ PDF and DXF exporters, which return the file's contents as a string.
262
+
263
+ Geometry is stored in inches. Units are display only, and switching them
264
+ never changes a drawing.
265
+
266
+ ## Development
267
+
268
+ ```sh
269
+ npm ci
270
+ npm run dev # the editor in a browser at http://localhost:5173 (react-native-web, saves locally)
271
+ npm test # vitest: units, solver, rooms, trim, sync
272
+ npm run e2e # playwright flows against the dev server (npx playwright install first)
273
+ npm run typecheck # the browser build
274
+ npm run typecheck:native # the device build (.native files)
275
+ npm run build:lib # dist/ for web and Node consumers
276
+ npm run build:single # one self-contained HTML file for testers, in dist-single/
277
+ ```
278
+
279
+ `npm run build` is the browser harness and writes to `dist/` too, replacing
280
+ the library output. `npm run build:lib` always starts from an empty `dist/`.
281
+
282
+ To work on the package inside an app without publishing, depend on the
283
+ checkout with `link:` (yarn) or `file:` (npm). Metro then needs the checkout
284
+ as a watch folder, the package name mapped to it, and the checkout's own
285
+ `node_modules` blocked so React and React Native aren't bundled twice. The
286
+ BOLDR Pro app derives all three from its `link:` dependencies in
287
+ `metro.config.js`.
288
+
289
+ ## Publishing
290
+
291
+ ```sh
292
+ npm publish --access public
293
+ ```
294
+
295
+ `prepublishOnly` runs the native typecheck, the tests and `build:lib` first,
296
+ so the tarball always carries a fresh `dist/` next to `src/`.
297
+
298
+ ## License
299
+
300
+ MIT
@@ -0,0 +1,31 @@
1
+ import type { Constraint, SelItem, Sketch } from '../model/types';
2
+ import { type AddResult, type SolveResult } from '../solver';
3
+ export declare function analyze(): void;
4
+ export declare const solveSketch: (heavy?: string[]) => SolveResult;
5
+ export declare function solveOrRevert(): SolveResult;
6
+ /**
7
+ * Walls made thicker or thinner, or lines turned into walls: what's measured on walls' faces holds, their centrelines
8
+ * moving to keep it (a face's length depends on the walls at its corners as well as its own). False — and nothing
9
+ * moved — when it can't hold.
10
+ */
11
+ export declare function holdFaces(): boolean;
12
+ /** Re-place locked doors/windows from their dimensions (after any geometry change). */
13
+ export declare function resolveOpeningsNow(): void;
14
+ export declare function existsSel(s: SelItem): boolean;
15
+ /** Run after every model change: clean up, re-analyze, refresh UI, autosave. */
16
+ export declare function afterEdit(): void;
17
+ export declare function undo(): void;
18
+ export declare function redo(): void;
19
+ /**
20
+ * The things a constraint ties together, each as the points to hold for it: a cabinet (its corners, when it's one of
21
+ * its edges or corners), a line (its ends), a point.
22
+ */
23
+ export declare function holdGroups(sk: Sketch, c: Constraint): string[][];
24
+ /**
25
+ * Add a constraint through the solver and explain the outcome:
26
+ * reference dimension → toast, conflict → conflict sheet (unless silent).
27
+ */
28
+ export declare function tryAddConstraint(c: Constraint, { silent, onResolved }?: {
29
+ onResolved?: (() => void) | null | undefined;
30
+ silent?: boolean | undefined;
31
+ }): AddResult;
@@ -0,0 +1,196 @@
1
+ import { drivingDim } from '../model/openings';
2
+ import { edgeOf, wallOf } from '../model/planGeom';
3
+ import { CONS_LABEL } from '../model/constraints';
4
+ import { HS, stepRedo, stepUndo } from '../model/history';
5
+ import { pushedOut, syncFaces } from '../model/facesolve';
6
+ import { elevSyncFrame, fitState, overflow, pastWallMsg, restoreFit } from '../editor/elevation';
7
+ import { resolveOpenings } from '../model/openings';
8
+ import { gc, restorePos, snapshotPos } from '../model/sketch';
9
+ import { page, planSK, saveSoon, SK } from '../model/store';
10
+ import { cabOfPoint, cabPoints } from '../model/faces';
11
+ import { requestDraw } from '../render/view';
12
+ import { solver } from '../solver';
13
+ import { cancelTool } from '../tools/registry';
14
+ import { fmtLen } from '../units';
15
+ import { ed } from './state';
16
+ import { refreshDrawerSoon, renderElevation, showConflict, toast, updateCtx, updateStatus } from '../editor/ports';
17
+ import { refreshLinks } from '../editor/links';
18
+ import { followLinked } from '../editor/linkFollow';
19
+ export function analyze() {
20
+ ed.ana = solver.analyzeDOF(SK());
21
+ }
22
+ export const solveSketch = (heavy) => solver.solve(SK(), heavy);
23
+ export function solveOrRevert() {
24
+ const sk = SK(), snap = snapshotPos(sk);
25
+ const s = solver.solve(sk);
26
+ if (!s.ok)
27
+ restorePos(sk, snap);
28
+ return s;
29
+ }
30
+ /**
31
+ * Walls made thicker or thinner, or lines turned into walls: what's measured on walls' faces holds, their centrelines
32
+ * moving to keep it (a face's length depends on the walls at its corners as well as its own). False — and nothing
33
+ * moved — when it can't hold.
34
+ */
35
+ export function holdFaces() {
36
+ if (!Object.values(SK().cons).some(c => c.face || c.faces))
37
+ return true;
38
+ return solveOrRevert().ok;
39
+ }
40
+ /** Re-place locked doors/windows from their dimensions (after any geometry change). */
41
+ export function resolveOpeningsNow() {
42
+ ed.badOpeningDims = resolveOpenings(planSK());
43
+ }
44
+ export function existsSel(s) {
45
+ const sk = SK();
46
+ switch (s.type) {
47
+ case 'point': return !!sk.points[s.id];
48
+ case 'line': return !!sk.lines[s.id];
49
+ case 'circle': return !!sk.circles[s.id];
50
+ case 'arc': return !!sk.arcs[s.id];
51
+ case 'cons':
52
+ case 'dim': return !!sk.cons[s.id];
53
+ case 'room': return !!sk.rooms[s.id];
54
+ case 'opening': return !!planSK().openings[s.id];
55
+ case 'cab': return !!sk.cabs?.[s.id];
56
+ case 'elev': return true;
57
+ case 'oanchor': return !!planSK().openings[s.id.split('|')[0]];
58
+ case 'wface': return !!wallOf(sk, edgeOf(s.id)[0]);
59
+ case 'odim': {
60
+ const [op, part] = s.id.split('|'), o = planSK().openings[op];
61
+ return !!o && (part === 'w' || (part.startsWith('d:') ? (o.dims || []).some(d => d.id === part.slice(2)) : !drivingDim(o)));
62
+ }
63
+ case 'note': return sk.notes.some(n => n.id === s.id);
64
+ case 'underlay': return page().underlays.some(u => u.id === s.id);
65
+ }
66
+ return false;
67
+ }
68
+ /** Run after every model change: clean up, re-analyze, refresh UI, autosave. */
69
+ export function afterEdit() {
70
+ ed.editSeq++;
71
+ gc(planSK()); // the plan, and each wall face
72
+ resolveOpeningsNow();
73
+ // what's drawn on wall faces follows the plan's corners, doors and windows
74
+ ed.badFaceCons = syncFaces(planSK());
75
+ elevSyncFrame(); // the open wall's frame (its length, its corners) as the plan has it now
76
+ ed.sel = ed.sel.filter(s => existsSel(s));
77
+ analyze();
78
+ updateCtx();
79
+ updateStatus();
80
+ refreshDrawerSoon();
81
+ requestDraw();
82
+ renderElevation();
83
+ refreshLinks(); // (what's linked may have changed: the host is asked about it)
84
+ followLinked(); // (and an undo may have put a linked dimension at something else than the job says)
85
+ saveSoon();
86
+ }
87
+ export function undo() {
88
+ if (!HS().u.length) {
89
+ toast('Nothing to undo', { warn: true });
90
+ return;
91
+ }
92
+ cancelTool();
93
+ stepUndo();
94
+ ed.sel = [];
95
+ afterEdit();
96
+ toast('Undone');
97
+ }
98
+ export function redo() {
99
+ const h = HS();
100
+ if (!h.u.length && !h.r.length)
101
+ return;
102
+ if (!h.r.length) {
103
+ toast('Nothing to redo', { warn: true });
104
+ return;
105
+ }
106
+ cancelTool();
107
+ stepRedo();
108
+ ed.sel = [];
109
+ afterEdit();
110
+ toast('Redone');
111
+ }
112
+ /** Solve with these points held exactly where they are (fixed for the solve, then as they were). */
113
+ function solveHolding(sk, hold) {
114
+ const pts = hold.map(id => sk.points[id]).filter(Boolean), had = pts.map(p => p.fixed);
115
+ pts.forEach(p => { p.fixed = true; });
116
+ const s = solver.solve(sk);
117
+ pts.forEach((p, i) => { if (had[i])
118
+ p.fixed = true;
119
+ else
120
+ delete p.fixed; });
121
+ return s;
122
+ }
123
+ /**
124
+ * The things a constraint ties together, each as the points to hold for it: a cabinet (its corners, when it's one of
125
+ * its edges or corners), a line (its ends), a point.
126
+ */
127
+ export function holdGroups(sk, c) {
128
+ const face = sk, groups = [], seen = new Set();
129
+ const add = (key, pts) => { if (!seen.has(key) && pts.length) {
130
+ seen.add(key);
131
+ groups.push(pts);
132
+ } };
133
+ const point = (pid) => {
134
+ if (!pid || !sk.points[pid])
135
+ return;
136
+ const cab = cabOfPoint(sk, pid);
137
+ if (cab)
138
+ add('cab:' + cab, cabPoints(face.cabs[cab]));
139
+ else
140
+ add('pt:' + pid, [pid]);
141
+ };
142
+ for (const lid of [c.l, c.l1, c.l2, c.line]) {
143
+ const l = lid ? sk.lines[lid] : undefined;
144
+ if (!l)
145
+ continue;
146
+ if (l.cab && face.cabs?.[l.cab])
147
+ add('cab:' + l.cab, cabPoints(face.cabs[l.cab]));
148
+ else
149
+ add('line:' + lid, [l.a, l.b]);
150
+ }
151
+ for (const pid of [c.a, c.b, c.p])
152
+ point(pid);
153
+ return groups;
154
+ }
155
+ /**
156
+ * Add a constraint through the solver and explain the outcome:
157
+ * reference dimension → toast, conflict → conflict sheet (unless silent).
158
+ */
159
+ export function tryAddConstraint(c, { silent = false, onResolved = null } = {}) {
160
+ // nothing may be pushed past its wall (in the wall view, past the wall; in the plan, a wall made shorter than
161
+ // what's on it): a constraint that would is taken back
162
+ const sk = SK(), was = overflow(sk), held = fitState(sk);
163
+ const r = solver.addConstraint(sk, c, { explain: !silent });
164
+ // met by moving everything a little, it ran past the wall: try keeping each thing it ties still in turn, so the
165
+ // other one moves to meet it (a short cabinet lifted to line up with a tall one, not the tall one sunk into the floor)
166
+ if (r.ok && r.id && !r.ref && pushedOut(was, overflow(sk))) {
167
+ for (const hold of holdGroups(sk, c)) {
168
+ restoreFit(sk, held);
169
+ if (solveHolding(sk, hold).ok && !pushedOut(was, overflow(sk)))
170
+ return r;
171
+ }
172
+ delete sk.cons[r.id];
173
+ restoreFit(sk, held);
174
+ if (!silent)
175
+ toast(pastWallMsg(), { warn: true });
176
+ return { ok: false };
177
+ }
178
+ if (silent)
179
+ return r;
180
+ if (r.ref) {
181
+ toast(r.refSame
182
+ ? 'Added as a reference dimension. Other constraints already set this value.'
183
+ : 'Kept as a reference dimension (' + fmtLen(c.value) + '). Other constraints already set this value — remove one to drive it.', { warn: !r.refSame });
184
+ }
185
+ else if (r.redundant) {
186
+ toast(CONS_LABEL[c.type] + ' is already true — other constraints set it.', { warn: true });
187
+ }
188
+ else if (r.conflict === 'dependent') {
189
+ showConflict({ title: 'Can’t add ' + (CONS_LABEL[c.type] || 'constraint').toLowerCase(), msg: 'It fights with constraints already on the drawing. Remove one of these to apply it.', ids: r.culprits || [], pending: c, onResolved });
190
+ }
191
+ else if (r.conflict === 'unsatisfiable') {
192
+ showConflict({ title: 'That doesn’t fit', msg: 'The drawing can’t satisfy this together with the constraints below. Remove one, or change a dimension.', ids: r.culprits || [], pending: c, onResolved });
193
+ }
194
+ return r;
195
+ }
196
+ //# sourceMappingURL=edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.js","sourceRoot":"","sources":["../../src/app/edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE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