@reekon-tools/boldr-cad 0.1.0 → 1.1.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 (555) hide show
  1. package/README.md +99 -16
  2. package/dist/app/edit.d.ts +12 -1
  3. package/dist/app/edit.js +96 -11
  4. package/dist/app/edit.js.map +1 -1
  5. package/dist/app/state.d.ts +31 -4
  6. package/dist/app/state.js +31 -2
  7. package/dist/app/state.js.map +1 -1
  8. package/dist/data/memory.d.ts +9 -1
  9. package/dist/data/memory.js +13 -8
  10. package/dist/data/memory.js.map +1 -1
  11. package/dist/data/provider.d.ts +30 -10
  12. package/dist/data/sync.d.ts +14 -3
  13. package/dist/data/sync.js +133 -66
  14. package/dist/data/sync.js.map +1 -1
  15. package/dist/editor/actions.d.ts +1 -2
  16. package/dist/editor/actions.js +391 -113
  17. package/dist/editor/actions.js.map +1 -1
  18. package/dist/editor/confirm.d.ts +23 -0
  19. package/dist/editor/confirm.js +35 -0
  20. package/dist/editor/confirm.js.map +1 -0
  21. package/dist/editor/elevation.d.ts +191 -90
  22. package/dist/editor/elevation.js +812 -616
  23. package/dist/editor/elevation.js.map +1 -1
  24. package/dist/editor/face.d.ts +73 -0
  25. package/dist/editor/face.js +269 -0
  26. package/dist/editor/face.js.map +1 -0
  27. package/dist/editor/files.d.ts +6 -0
  28. package/dist/editor/files.js +50 -4
  29. package/dist/editor/files.js.map +1 -1
  30. package/dist/editor/gestures.d.ts +18 -3
  31. package/dist/editor/gestures.js +145 -30
  32. package/dist/editor/gestures.js.map +1 -1
  33. package/dist/editor/keypad.d.ts +20 -5
  34. package/dist/editor/keypad.js +62 -15
  35. package/dist/editor/keypad.js.map +1 -1
  36. package/dist/editor/keys.js +36 -4
  37. package/dist/editor/keys.js.map +1 -1
  38. package/dist/editor/laser.d.ts +20 -4
  39. package/dist/editor/laser.js +104 -21
  40. package/dist/editor/laser.js.map +1 -1
  41. package/dist/editor/linkActions.d.ts +49 -0
  42. package/dist/editor/linkActions.js +210 -0
  43. package/dist/editor/linkActions.js.map +1 -0
  44. package/dist/editor/linkFollow.d.ts +2 -0
  45. package/dist/editor/linkFollow.js +53 -0
  46. package/dist/editor/linkFollow.js.map +1 -0
  47. package/dist/editor/linkWrite.d.ts +13 -0
  48. package/dist/editor/linkWrite.js +84 -0
  49. package/dist/editor/linkWrite.js.map +1 -0
  50. package/dist/editor/links.d.ts +84 -0
  51. package/dist/editor/links.js +130 -0
  52. package/dist/editor/links.js.map +1 -0
  53. package/dist/editor/markup.d.ts +29 -3
  54. package/dist/editor/markup.js +95 -10
  55. package/dist/editor/markup.js.map +1 -1
  56. package/dist/editor/mode.d.ts +40 -2
  57. package/dist/editor/mode.js +71 -4
  58. package/dist/editor/mode.js.map +1 -1
  59. package/dist/editor/ports.d.ts +38 -6
  60. package/dist/editor/ports.js +10 -1
  61. package/dist/editor/ports.js.map +1 -1
  62. package/dist/editor/project.d.ts +38 -6
  63. package/dist/editor/project.js +170 -27
  64. package/dist/editor/project.js.map +1 -1
  65. package/dist/editor/selection.d.ts +10 -0
  66. package/dist/editor/selection.js +62 -8
  67. package/dist/editor/selection.js.map +1 -1
  68. package/dist/editor/status.js +3 -0
  69. package/dist/editor/status.js.map +1 -1
  70. package/dist/editor/tooltips.d.ts +5 -0
  71. package/dist/editor/tooltips.js +48 -0
  72. package/dist/editor/tooltips.js.map +1 -0
  73. package/dist/editor/view3d.d.ts +17 -0
  74. package/dist/editor/view3d.js +135 -0
  75. package/dist/editor/view3d.js.map +1 -0
  76. package/dist/editor/view3dState.d.ts +39 -0
  77. package/dist/editor/view3dState.js +44 -0
  78. package/dist/editor/view3dState.js.map +1 -0
  79. package/dist/export/dxf.js +1 -1
  80. package/dist/export/dxf.js.map +1 -1
  81. package/dist/export/pdf.js +17 -12
  82. package/dist/export/pdf.js.map +1 -1
  83. package/dist/export/plan.d.ts +23 -6
  84. package/dist/export/plan.js +127 -44
  85. package/dist/export/plan.js.map +1 -1
  86. package/dist/index.d.ts +7 -1
  87. package/dist/index.js +2 -0
  88. package/dist/index.js.map +1 -1
  89. package/dist/model/constraints.js +15 -4
  90. package/dist/model/constraints.js.map +1 -1
  91. package/dist/model/demo.js +3 -3
  92. package/dist/model/demo.js.map +1 -1
  93. package/dist/model/elevation.d.ts +6 -9
  94. package/dist/model/elevation.js +5 -13
  95. package/dist/model/elevation.js.map +1 -1
  96. package/dist/model/faces.d.ts +58 -0
  97. package/dist/model/faces.js +197 -0
  98. package/dist/model/faces.js.map +1 -0
  99. package/dist/model/facesolve.d.ts +72 -0
  100. package/dist/model/facesolve.js +369 -0
  101. package/dist/model/facesolve.js.map +1 -0
  102. package/dist/model/history.d.ts +3 -2
  103. package/dist/model/history.js +17 -11
  104. package/dist/model/history.js.map +1 -1
  105. package/dist/model/images.d.ts +18 -0
  106. package/dist/model/images.js +26 -0
  107. package/dist/model/images.js.map +1 -0
  108. package/dist/model/links.d.ts +46 -0
  109. package/dist/model/links.js +73 -0
  110. package/dist/model/links.js.map +1 -0
  111. package/dist/model/markup.d.ts +46 -0
  112. package/dist/model/markup.js +71 -0
  113. package/dist/model/markup.js.map +1 -0
  114. package/dist/model/measurement.d.ts +11 -0
  115. package/dist/model/measurement.js +24 -0
  116. package/dist/model/measurement.js.map +1 -0
  117. package/dist/model/openings.d.ts +4 -0
  118. package/dist/model/openings.js +4 -0
  119. package/dist/model/openings.js.map +1 -1
  120. package/dist/model/planGeom.d.ts +72 -2
  121. package/dist/model/planGeom.js +184 -10
  122. package/dist/model/planGeom.js.map +1 -1
  123. package/dist/model/project.js +3 -2
  124. package/dist/model/project.js.map +1 -1
  125. package/dist/model/projectfile.js +2 -1
  126. package/dist/model/projectfile.js.map +1 -1
  127. package/dist/model/rooms.js +2 -2
  128. package/dist/model/rooms.js.map +1 -1
  129. package/dist/model/settings.d.ts +6 -0
  130. package/dist/model/settings.js +2 -2
  131. package/dist/model/settings.js.map +1 -1
  132. package/dist/model/sketch.d.ts +14 -0
  133. package/dist/model/sketch.js +143 -24
  134. package/dist/model/sketch.js.map +1 -1
  135. package/dist/model/smooth.d.ts +6 -0
  136. package/dist/model/smooth.js +52 -0
  137. package/dist/model/smooth.js.map +1 -0
  138. package/dist/model/store.d.ts +12 -0
  139. package/dist/model/store.js +35 -3
  140. package/dist/model/store.js.map +1 -1
  141. package/dist/model/types.d.ts +173 -8
  142. package/dist/model/wallfaces.d.ts +32 -0
  143. package/dist/model/wallfaces.js +133 -20
  144. package/dist/model/wallfaces.js.map +1 -1
  145. package/dist/model/wallshape.d.ts +15 -0
  146. package/dist/model/wallshape.js +89 -0
  147. package/dist/model/wallshape.js.map +1 -0
  148. package/dist/react/BottomBar.d.ts +9 -5
  149. package/dist/react/BottomBar.js +213 -24
  150. package/dist/react/BottomBar.js.map +1 -1
  151. package/dist/react/Buttons.d.ts +13 -2
  152. package/dist/react/Buttons.js +37 -5
  153. package/dist/react/Buttons.js.map +1 -1
  154. package/dist/react/CadEditor.d.ts +54 -4
  155. package/dist/react/CadEditor.js +79 -21
  156. package/dist/react/CadEditor.js.map +1 -1
  157. package/dist/react/ConfirmSheet.d.ts +4 -0
  158. package/dist/react/ConfirmSheet.js +31 -0
  159. package/dist/react/ConfirmSheet.js.map +1 -0
  160. package/dist/react/ConflictSheet.d.ts +2 -1
  161. package/dist/react/ConflictSheet.js +16 -8
  162. package/dist/react/ConflictSheet.js.map +1 -1
  163. package/dist/react/Drawer.d.ts +8 -2
  164. package/dist/react/Drawer.js +167 -38
  165. package/dist/react/Drawer.js.map +1 -1
  166. package/dist/react/Duck.d.ts +13 -0
  167. package/dist/react/Duck.js +45 -0
  168. package/dist/react/Duck.js.map +1 -0
  169. package/dist/react/Empty3D.d.ts +2 -0
  170. package/dist/react/Empty3D.js +39 -0
  171. package/dist/react/Empty3D.js.map +1 -0
  172. package/dist/react/FitScroll.d.ts +6 -0
  173. package/dist/react/FitScroll.js +14 -0
  174. package/dist/react/FitScroll.js.map +1 -0
  175. package/dist/react/Icon.native.d.ts +6 -0
  176. package/dist/react/Icon.native.js +4 -0
  177. package/dist/react/Icon.native.js.map +1 -1
  178. package/dist/react/Icon.web.d.ts +6 -0
  179. package/dist/react/Icon.web.js +4 -0
  180. package/dist/react/Icon.web.js.map +1 -1
  181. package/dist/react/KeypadSheet.d.ts +9 -2
  182. package/dist/react/KeypadSheet.js +174 -42
  183. package/dist/react/KeypadSheet.js.map +1 -1
  184. package/dist/react/LaserTray.js +8 -5
  185. package/dist/react/LaserTray.js.map +1 -1
  186. package/dist/react/MarkupPanel.d.ts +8 -0
  187. package/dist/react/MarkupPanel.js +67 -0
  188. package/dist/react/MarkupPanel.js.map +1 -0
  189. package/dist/react/PageThumb.native.d.ts +7 -2
  190. package/dist/react/PageThumb.native.js +19 -7
  191. package/dist/react/PageThumb.native.js.map +1 -1
  192. package/dist/react/PageThumb.web.d.ts +3 -2
  193. package/dist/react/PageThumb.web.js +4 -4
  194. package/dist/react/PageThumb.web.js.map +1 -1
  195. package/dist/react/PlanCanvas.native.d.ts +1 -1
  196. package/dist/react/PlanCanvas.native.js +134 -36
  197. package/dist/react/PlanCanvas.native.js.map +1 -1
  198. package/dist/react/PlanCanvas.web.js +16 -5
  199. package/dist/react/PlanCanvas.web.js.map +1 -1
  200. package/dist/react/Popovers.d.ts +12 -6
  201. package/dist/react/Popovers.js +53 -26
  202. package/dist/react/Popovers.js.map +1 -1
  203. package/dist/react/Rail.d.ts +24 -0
  204. package/dist/react/Rail.js +324 -34
  205. package/dist/react/Rail.js.map +1 -1
  206. package/dist/react/ShapeMenu.d.ts +7 -0
  207. package/dist/react/ShapeMenu.js +58 -0
  208. package/dist/react/ShapeMenu.js.map +1 -0
  209. package/dist/react/Sheet.d.ts +14 -4
  210. package/dist/react/Sheet.js +54 -9
  211. package/dist/react/Sheet.js.map +1 -1
  212. package/dist/react/Slider.d.ts +18 -0
  213. package/dist/react/Slider.js +27 -0
  214. package/dist/react/Slider.js.map +1 -0
  215. package/dist/react/Toast.js +14 -6
  216. package/dist/react/Toast.js.map +1 -1
  217. package/dist/react/ToolTip.d.ts +7 -0
  218. package/dist/react/ToolTip.js +43 -0
  219. package/dist/react/ToolTip.js.map +1 -0
  220. package/dist/react/TopBar.d.ts +6 -3
  221. package/dist/react/TopBar.js +48 -17
  222. package/dist/react/TopBar.js.map +1 -1
  223. package/dist/react/Tween.d.ts +7 -0
  224. package/dist/react/Tween.js +26 -0
  225. package/dist/react/Tween.js.map +1 -0
  226. package/dist/react/Tween.native.d.ts +6 -0
  227. package/dist/react/Tween.native.js +43 -0
  228. package/dist/react/Tween.native.js.map +1 -0
  229. package/dist/react/View3D.native.d.ts +4 -0
  230. package/dist/react/View3D.native.js +103 -0
  231. package/dist/react/View3D.native.js.map +1 -0
  232. package/dist/react/View3D.web.d.ts +4 -0
  233. package/dist/react/View3D.web.js +151 -0
  234. package/dist/react/View3D.web.js.map +1 -0
  235. package/dist/react/View3DHost.d.ts +143 -0
  236. package/dist/react/View3DHost.js +377 -0
  237. package/dist/react/View3DHost.js.map +1 -0
  238. package/dist/react/corners.d.ts +7 -0
  239. package/dist/react/corners.js +51 -0
  240. package/dist/react/corners.js.map +1 -0
  241. package/dist/react/easing.d.ts +15 -0
  242. package/dist/react/easing.js +10 -0
  243. package/dist/react/easing.js.map +1 -0
  244. package/dist/react/host.d.ts +7 -2
  245. package/dist/react/host.js +8 -3
  246. package/dist/react/host.js.map +1 -1
  247. package/dist/react/hostKeypad.d.ts +56 -0
  248. package/dist/react/hostKeypad.js +5 -0
  249. package/dist/react/hostKeypad.js.map +1 -0
  250. package/dist/react/motion.d.ts +77 -0
  251. package/dist/react/motion.js +173 -0
  252. package/dist/react/motion.js.map +1 -0
  253. package/dist/react/ports.js +90 -8
  254. package/dist/react/ports.js.map +1 -1
  255. package/dist/react/saving.d.ts +15 -0
  256. package/dist/react/saving.js +76 -0
  257. package/dist/react/saving.js.map +1 -0
  258. package/dist/react/store.d.ts +38 -1
  259. package/dist/react/store.js +31 -1
  260. package/dist/react/store.js.map +1 -1
  261. package/dist/react/theme.d.ts +10 -0
  262. package/dist/react/theme.js +8 -0
  263. package/dist/react/theme.js.map +1 -1
  264. package/dist/react/topRow.d.ts +22 -0
  265. package/dist/react/topRow.js +61 -0
  266. package/dist/react/topRow.js.map +1 -0
  267. package/dist/react/touch.d.ts +6 -0
  268. package/dist/react/touch.js +9 -0
  269. package/dist/react/touch.js.map +1 -0
  270. package/dist/render/ctx.d.ts +8 -0
  271. package/dist/render/draw.d.ts +33 -1
  272. package/dist/render/draw.js +593 -215
  273. package/dist/render/draw.js.map +1 -1
  274. package/dist/render/elevation.d.ts +65 -43
  275. package/dist/render/elevation.js +414 -140
  276. package/dist/render/elevation.js.map +1 -1
  277. package/dist/render/figmaIcons.d.ts +12 -0
  278. package/dist/render/figmaIcons.js +21 -0
  279. package/dist/render/figmaIcons.js.map +1 -0
  280. package/dist/render/hit.d.ts +22 -2
  281. package/dist/render/hit.js +168 -25
  282. package/dist/render/hit.js.map +1 -1
  283. package/dist/render/icons.js +69 -10
  284. package/dist/render/icons.js.map +1 -1
  285. package/dist/render/linkTile.d.ts +15 -0
  286. package/dist/render/linkTile.js +369 -0
  287. package/dist/render/linkTile.js.map +1 -0
  288. package/dist/render/markup.d.ts +11 -0
  289. package/dist/render/markup.js +112 -0
  290. package/dist/render/markup.js.map +1 -0
  291. package/dist/render/navigate.d.ts +88 -0
  292. package/dist/render/navigate.js +100 -0
  293. package/dist/render/navigate.js.map +1 -0
  294. package/dist/render/snap.d.ts +20 -1
  295. package/dist/render/snap.js +118 -25
  296. package/dist/render/snap.js.map +1 -1
  297. package/dist/render/squircle.d.ts +8 -0
  298. package/dist/render/squircle.js +71 -0
  299. package/dist/render/squircle.js.map +1 -0
  300. package/dist/render/view.d.ts +115 -2
  301. package/dist/render/view.js +244 -19
  302. package/dist/render/view.js.map +1 -1
  303. package/dist/skia/SkiaDrawCtx.d.ts +30 -2
  304. package/dist/skia/SkiaDrawCtx.js +198 -43
  305. package/dist/skia/SkiaDrawCtx.js.map +1 -1
  306. package/dist/skia/host.d.ts +18 -2
  307. package/dist/skia/host.js +46 -1
  308. package/dist/skia/host.js.map +1 -1
  309. package/dist/solver/equations.js +37 -2
  310. package/dist/solver/equations.js.map +1 -1
  311. package/dist/solver/gauss-newton.d.ts +17 -0
  312. package/dist/solver/gauss-newton.js +144 -36
  313. package/dist/solver/gauss-newton.js.map +1 -1
  314. package/dist/solver/linalg.d.ts +45 -2
  315. package/dist/solver/linalg.js +164 -10
  316. package/dist/solver/linalg.js.map +1 -1
  317. package/dist/solver/types.d.ts +5 -0
  318. package/dist/tools/annotate.d.ts +57 -1
  319. package/dist/tools/annotate.js +64 -43
  320. package/dist/tools/annotate.js.map +1 -1
  321. package/dist/tools/chamfer.d.ts +12 -0
  322. package/dist/tools/chamfer.js +114 -0
  323. package/dist/tools/chamfer.js.map +1 -0
  324. package/dist/tools/corner.d.ts +38 -0
  325. package/dist/tools/corner.js +99 -0
  326. package/dist/tools/corner.js.map +1 -0
  327. package/dist/tools/dim.d.ts +86 -9
  328. package/dist/tools/dim.js +582 -97
  329. package/dist/tools/dim.js.map +1 -1
  330. package/dist/tools/elevation.js +5 -5
  331. package/dist/tools/elevation.js.map +1 -1
  332. package/dist/tools/fillet.d.ts +9 -0
  333. package/dist/tools/fillet.js +86 -0
  334. package/dist/tools/fillet.js.map +1 -0
  335. package/dist/tools/freehand.d.ts +3 -2
  336. package/dist/tools/freehand.js +19 -12
  337. package/dist/tools/freehand.js.map +1 -1
  338. package/dist/tools/index.js +14 -4
  339. package/dist/tools/index.js.map +1 -1
  340. package/dist/tools/line.d.ts +8 -3
  341. package/dist/tools/line.js +66 -30
  342. package/dist/tools/line.js.map +1 -1
  343. package/dist/tools/modify.d.ts +13 -0
  344. package/dist/tools/modify.js +105 -25
  345. package/dist/tools/modify.js.map +1 -1
  346. package/dist/tools/openings.js +25 -18
  347. package/dist/tools/openings.js.map +1 -1
  348. package/dist/tools/registry.d.ts +8 -0
  349. package/dist/tools/registry.js +42 -2
  350. package/dist/tools/registry.js.map +1 -1
  351. package/dist/tools/select.d.ts +77 -3
  352. package/dist/tools/select.js +560 -74
  353. package/dist/tools/select.js.map +1 -1
  354. package/dist/tools/shapes.d.ts +14 -0
  355. package/dist/tools/shapes.js +154 -75
  356. package/dist/tools/shapes.js.map +1 -1
  357. package/dist/units/format.d.ts +11 -3
  358. package/dist/units/format.js +27 -6
  359. package/dist/units/format.js.map +1 -1
  360. package/dist/units/parse.d.ts +2 -1
  361. package/dist/units/parse.js +5 -4
  362. package/dist/units/parse.js.map +1 -1
  363. package/dist/units/prefs.d.ts +9 -1
  364. package/dist/units/prefs.js +6 -0
  365. package/dist/units/prefs.js.map +1 -1
  366. package/dist/view3d/build.d.ts +35 -0
  367. package/dist/view3d/build.js +630 -0
  368. package/dist/view3d/build.js.map +1 -0
  369. package/dist/view3d/camera.d.ts +60 -0
  370. package/dist/view3d/camera.js +84 -0
  371. package/dist/view3d/camera.js.map +1 -0
  372. package/dist/view3d/fatLines.d.ts +11 -0
  373. package/dist/view3d/fatLines.js +83 -0
  374. package/dist/view3d/fatLines.js.map +1 -0
  375. package/dist/view3d/lines.d.ts +17 -0
  376. package/dist/view3d/lines.js +271 -0
  377. package/dist/view3d/lines.js.map +1 -0
  378. package/dist/view3d/mesh.d.ts +51 -0
  379. package/dist/view3d/mesh.js +101 -0
  380. package/dist/view3d/mesh.js.map +1 -0
  381. package/dist/view3d/poly.d.ts +16 -0
  382. package/dist/view3d/poly.js +109 -0
  383. package/dist/view3d/poly.js.map +1 -0
  384. package/dist/view3d/viewer.d.ts +86 -0
  385. package/dist/view3d/viewer.js +350 -0
  386. package/dist/view3d/viewer.js.map +1 -0
  387. package/package.json +15 -2
  388. package/src/app/edit.ts +83 -12
  389. package/src/app/main.ts +11 -5
  390. package/src/app/state.ts +38 -5
  391. package/src/data/memory.ts +15 -10
  392. package/src/data/provider.ts +25 -10
  393. package/src/data/sync.ts +107 -53
  394. package/src/editor/actions.ts +292 -83
  395. package/src/editor/confirm.ts +58 -0
  396. package/src/editor/elevation.ts +698 -478
  397. package/src/editor/face.ts +227 -0
  398. package/src/editor/files.ts +40 -4
  399. package/src/editor/gestures.ts +147 -31
  400. package/src/editor/keypad.ts +67 -18
  401. package/src/editor/keys.ts +25 -5
  402. package/src/editor/laser.ts +98 -20
  403. package/src/editor/linkActions.ts +194 -0
  404. package/src/editor/linkFollow.ts +43 -0
  405. package/src/editor/linkWrite.ts +77 -0
  406. package/src/editor/links.ts +181 -0
  407. package/src/editor/markup.ts +92 -8
  408. package/src/editor/mode.ts +83 -7
  409. package/src/editor/ports.ts +39 -6
  410. package/src/editor/project.ts +157 -26
  411. package/src/editor/selection.ts +54 -8
  412. package/src/editor/status.ts +2 -0
  413. package/src/editor/tooltips.ts +47 -0
  414. package/src/editor/view3d.ts +119 -0
  415. package/src/editor/view3dState.ts +61 -0
  416. package/src/export/dxf.ts +1 -1
  417. package/src/export/pdf.ts +15 -7
  418. package/src/export/plan.ts +119 -35
  419. package/src/index.ts +7 -1
  420. package/src/input/keyboard.ts +2 -4
  421. package/src/model/constraints.ts +13 -4
  422. package/src/model/demo.ts +3 -3
  423. package/src/model/elevation.ts +6 -16
  424. package/src/model/faces.ts +153 -0
  425. package/src/model/facesolve.ts +322 -0
  426. package/src/model/history.ts +19 -11
  427. package/src/model/images.ts +35 -0
  428. package/src/model/links.ts +77 -0
  429. package/src/model/markup.ts +80 -0
  430. package/src/model/measurement.ts +26 -0
  431. package/src/model/openings.ts +6 -0
  432. package/src/model/planGeom.ts +174 -8
  433. package/src/model/project.ts +3 -2
  434. package/src/model/projectfile.ts +2 -1
  435. package/src/model/rooms.ts +1 -1
  436. package/src/model/settings.ts +8 -2
  437. package/src/model/sketch.ts +101 -14
  438. package/src/model/smooth.ts +51 -0
  439. package/src/model/store.ts +35 -4
  440. package/src/model/types.ts +170 -8
  441. package/src/model/wallfaces.ts +126 -17
  442. package/src/model/wallshape.ts +97 -0
  443. package/src/react/BottomBar.tsx +263 -46
  444. package/src/react/Buttons.tsx +50 -9
  445. package/src/react/CadEditor.tsx +142 -34
  446. package/src/react/ConfirmSheet.tsx +38 -0
  447. package/src/react/ConflictSheet.tsx +19 -12
  448. package/src/react/Drawer.tsx +213 -110
  449. package/src/react/Duck.tsx +50 -0
  450. package/src/react/Empty3D.tsx +32 -0
  451. package/src/react/FitScroll.tsx +19 -0
  452. package/src/react/Icon.native.tsx +5 -0
  453. package/src/react/Icon.web.tsx +5 -0
  454. package/src/react/KeypadSheet.tsx +253 -60
  455. package/src/react/LaserTray.tsx +12 -8
  456. package/src/react/MarkupPanel.tsx +150 -0
  457. package/src/react/PageThumb.native.tsx +18 -7
  458. package/src/react/PageThumb.web.tsx +4 -4
  459. package/src/react/PlanCanvas.native.tsx +151 -34
  460. package/src/react/PlanCanvas.web.tsx +15 -5
  461. package/src/react/Popovers.tsx +116 -51
  462. package/src/react/Rail.tsx +360 -27
  463. package/src/react/ShapeMenu.tsx +66 -0
  464. package/src/react/Sheet.tsx +56 -11
  465. package/src/react/Slider.tsx +48 -0
  466. package/src/react/Toast.tsx +16 -9
  467. package/src/react/ToolTip.tsx +49 -0
  468. package/src/react/TopBar.tsx +97 -39
  469. package/src/react/Tween.native.tsx +36 -0
  470. package/src/react/Tween.tsx +24 -0
  471. package/src/react/View3D.native.tsx +131 -0
  472. package/src/react/View3D.web.tsx +131 -0
  473. package/src/react/View3DHost.ts +367 -0
  474. package/src/react/corners.ts +52 -0
  475. package/src/react/easing.ts +14 -0
  476. package/src/react/host.ts +8 -3
  477. package/src/react/hostKeypad.ts +66 -0
  478. package/src/react/motion.tsx +239 -0
  479. package/src/react/ports.ts +78 -9
  480. package/src/react/saving.ts +80 -0
  481. package/src/react/store.ts +35 -3
  482. package/src/react/theme.ts +8 -0
  483. package/src/react/topRow.ts +71 -0
  484. package/src/react/touch.ts +10 -0
  485. package/src/render/ctx.ts +8 -0
  486. package/src/render/draw.ts +437 -175
  487. package/src/render/elevation.ts +349 -143
  488. package/src/render/figmaIcons.ts +22 -0
  489. package/src/render/hit.ts +140 -21
  490. package/src/render/icons.ts +69 -10
  491. package/src/render/linkTile.ts +297 -0
  492. package/src/render/markup.ts +91 -0
  493. package/src/render/navigate.ts +114 -0
  494. package/src/render/snap.ts +105 -22
  495. package/src/render/squircle.ts +73 -0
  496. package/src/render/view.ts +255 -19
  497. package/src/skia/SkiaDrawCtx.ts +163 -41
  498. package/src/skia/host.ts +46 -1
  499. package/src/solver/equations.ts +37 -2
  500. package/src/solver/gauss-newton.ts +125 -28
  501. package/src/solver/linalg.ts +141 -5
  502. package/src/solver/types.ts +5 -0
  503. package/src/styles.css +91 -42
  504. package/src/tools/annotate.ts +58 -29
  505. package/src/tools/chamfer.ts +103 -0
  506. package/src/tools/corner.ts +99 -0
  507. package/src/tools/dim.ts +525 -93
  508. package/src/tools/elevation.ts +5 -5
  509. package/src/tools/fillet.ts +82 -0
  510. package/src/tools/freehand.ts +20 -16
  511. package/src/tools/index.ts +17 -4
  512. package/src/tools/line.ts +59 -23
  513. package/src/tools/modify.ts +86 -24
  514. package/src/tools/openings.ts +11 -16
  515. package/src/tools/registry.ts +27 -2
  516. package/src/tools/select.ts +424 -75
  517. package/src/tools/shapes.ts +119 -58
  518. package/src/ui/ctx.ts +2 -1
  519. package/src/ui/domPorts.ts +23 -4
  520. package/src/ui/drawer.ts +6 -26
  521. package/src/ui/elevation.ts +10 -101
  522. package/src/ui/keypad.ts +8 -14
  523. package/src/ui/laser.ts +2 -2
  524. package/src/ui/menu.ts +63 -17
  525. package/src/ui/noteinput.ts +3 -3
  526. package/src/ui/opacity.ts +108 -0
  527. package/src/ui/palette.ts +67 -12
  528. package/src/ui/rail.ts +21 -7
  529. package/src/ui/topbar.ts +4 -14
  530. package/src/units/format.ts +24 -6
  531. package/src/units/parse.ts +4 -3
  532. package/src/units/prefs.ts +13 -1
  533. package/src/view3d/build.ts +607 -0
  534. package/src/view3d/camera.ts +113 -0
  535. package/src/view3d/fatLines.ts +83 -0
  536. package/src/view3d/lines.ts +258 -0
  537. package/src/view3d/mesh.ts +111 -0
  538. package/src/view3d/poly.ts +104 -0
  539. package/src/view3d/viewer.ts +348 -0
  540. package/dist/react/ElevCanvas.native.d.ts +0 -3
  541. package/dist/react/ElevCanvas.native.js +0 -58
  542. package/dist/react/ElevCanvas.native.js.map +0 -1
  543. package/dist/react/ElevCanvas.web.d.ts +0 -4
  544. package/dist/react/ElevCanvas.web.js +0 -44
  545. package/dist/react/ElevCanvas.web.js.map +0 -1
  546. package/dist/react/ElevationSheet.d.ts +0 -2
  547. package/dist/react/ElevationSheet.js +0 -38
  548. package/dist/react/ElevationSheet.js.map +0 -1
  549. package/dist/render/elevationView.d.ts +0 -3
  550. package/dist/render/elevationView.js +0 -100
  551. package/dist/render/elevationView.js.map +0 -1
  552. package/src/react/ElevCanvas.native.tsx +0 -68
  553. package/src/react/ElevCanvas.web.tsx +0 -42
  554. package/src/react/ElevationSheet.tsx +0 -88
  555. package/src/render/elevationView.ts +0 -73
@@ -0,0 +1,210 @@
1
+ import { afterEdit } from '../app/edit';
2
+ import { ed } from '../app/state';
3
+ import { clamp } from '../model/geom';
4
+ import { pushHistory } from '../model/history';
5
+ import { uid } from '../model/ids';
6
+ import { isLink, LINK_COLOR, LINK_MAX_IN, LINK_MIN_IN, LINK_TILE_PX, linkInfoOf, linkName, linkSide, linkSnapshot } from '../model/links';
7
+ import { dimMeasurement } from '../model/measurement';
8
+ import { linkAt } from '../render/hit';
9
+ import { askConfirm } from './confirm';
10
+ import { SK, store } from '../model/store';
11
+ import { cvs, linkBox, mainT, requestDraw, s2w } from '../render/view';
12
+ import { setTool } from '../tools/registry';
13
+ import { elevOpen } from './elevation';
14
+ import { is3d } from './view3dState';
15
+ import { canLink, linksHost, openLink, pickLinks } from './links';
16
+ import { toast } from './ports';
17
+ /*
18
+ Linking. In Annotate the + puts the job's files the person picks on the plan as tiles (selected, to move them where
19
+ they belong), and a selected tile is opened, or given a leader, from the bar. Measurements come into a drawing only
20
+ as the lengths of lines, from a line's length keypad in Draft (tools/dim.ts): a linked dimension is opened or let go
21
+ of from the bar, and one of the drawing's own driving dimensions is saved to the drawing's group as a measurement of
22
+ the job (Save to group), linked to it from then on.
23
+ */
24
+ /** Whether the + shows: Annotate's plan (not the wall view or 3D), for someone who can edit, with a host that links. */
25
+ export const linkPlusVisible = () => !ed.readOnly && ed.mode === 'annotate' && !elevOpen() && !is3d() && canLink();
26
+ export const LINK_PLUS_LABEL = 'Add a file';
27
+ /** The one selected tile, if a tile is all that's selected. */
28
+ export function selectedLink() {
29
+ if (ed.sel.length !== 1 || ed.sel[0].type !== 'note')
30
+ return null;
31
+ const n = SK().notes.find(x => x.id === ed.sel[0].id);
32
+ return n && isLink(n) ? n : null;
33
+ }
34
+ /** Whether a tile's target can be opened: it's there (as far as the host has said), and the host can open it. */
35
+ export function canOpenLink(t) {
36
+ const info = linkInfoOf(t);
37
+ return info?.exists !== false && info?.canOpen !== false;
38
+ }
39
+ /**
40
+ * The +: the person picks from the job, and what they picked goes on the plan (one undo step) in the middle of the
41
+ * screen, side by side and in rows if there are many — moved down and across, all together, from tiles already there
42
+ * — all selected, with Select markup on.
43
+ */
44
+ export async function addLinks() {
45
+ if (!linkPlusVisible())
46
+ return;
47
+ const pageId = store.curPageId;
48
+ const picked = await pickLinks();
49
+ if (!picked.length)
50
+ return;
51
+ // (the person may have moved on meanwhile: another page, the other tab)
52
+ if (store.curPageId !== pageId || !linkPlusVisible()) {
53
+ toast('Nothing was added: the drawing changed while you were picking. Try again.', { warn: true });
54
+ return;
55
+ }
56
+ // (the page's tiles are all one size: the first is placed at a comfortable size on the screen, the rest follow it)
57
+ const T = mainT(), sk = SK(), ts = pageLinkSize(sk) ?? Math.round(clamp(LINK_TILE_PX / T.s, LINK_MIN_IN, LINK_MAX_IN) * 4) / 4;
58
+ // each a tile and a gap from the next, as many to a row as fit the screen
59
+ const cell = ts + LINK_GAP_PX / T.s, step = 30 / T.s;
60
+ const cols = Math.max(1, Math.min(picked.length, Math.floor((cvs.W - 160) / (cell * T.s))));
61
+ const rows = Math.ceil(picked.length / cols), [cx, cy] = s2w(cvs.W / 2, cvs.H / 2);
62
+ const spots = picked.map((_, i) => [cx + ((i % cols) - (cols - 1) / 2) * cell, cy - (Math.floor(i / cols) - (rows - 1) / 2) * cell]);
63
+ const taken = (px, py) => sk.notes.some(n => n.type === 'link' && Math.abs((n.x ?? 0) - px) < step / 2 && Math.abs((n.y ?? 0) - py) < step / 2);
64
+ let k = 0;
65
+ while (k < 40 && spots.some(([x, y]) => taken(x + k * step, y - k * step)))
66
+ k++;
67
+ pushHistory();
68
+ const ids = picked.map((t, i) => {
69
+ const n = { id: uid('lk'), type: 'link', x: spots[i][0] + k * step, y: spots[i][1] - k * step, ts, color: LINK_COLOR, link: linkSnapshot(t) };
70
+ sk.notes.push(n);
71
+ return n.id;
72
+ });
73
+ setTool('aselect');
74
+ ed.sel = ids.map(id => ({ type: 'note', id }));
75
+ afterEdit();
76
+ }
77
+ /** The space between tiles added together, on the screen (points). */
78
+ const LINK_GAP_PX = 16;
79
+ /*
80
+ Every tile on a page is one size, on the drawing (so it zooms with the plan and prints at that size): the Tile size
81
+ slider above the bar, shown while a tile is selected, sizes them all together.
82
+ */
83
+ /** The size of the page's tiles, inches on the drawing (null: it has none). */
84
+ export function pageLinkSize(sk = SK()) {
85
+ const n = sk.notes.find(isLink);
86
+ return n ? linkSide(n) : null;
87
+ }
88
+ /** Whether the Tile size slider shows: Annotate's plan, for someone who can edit, with a tile among what's selected. */
89
+ export function linkSizeVisible() {
90
+ if (ed.readOnly || ed.mode !== 'annotate' || elevOpen() || is3d() || !ed.sel.length)
91
+ return false;
92
+ const sk = SK();
93
+ return ed.sel.some(x => x.type === 'note' && sk.notes.find(n => n.id === x.id)?.type === 'link');
94
+ }
95
+ /**
96
+ * Size every tile on the page (inches, to the quarter, from LINK_MIN_IN to LINK_MAX_IN), drawn at once — for the slider
97
+ * as it moves. The caller makes the undo step before, and finishes the edit after.
98
+ */
99
+ export function setLinkSize(inches) {
100
+ const v = Math.round(clamp(inches, LINK_MIN_IN, LINK_MAX_IN) * 4) / 4;
101
+ for (const n of SK().notes)
102
+ if (isLink(n))
103
+ n.ts = v;
104
+ requestDraw();
105
+ }
106
+ /** The slider runs along a log scale (a few inches to many feet, each step as noticeable as the last): 0 to SIZE_STEPS. */
107
+ export const SIZE_STEPS = 1000;
108
+ const LOG_MIN = Math.log(LINK_MIN_IN), LOG_SPAN = Math.log(LINK_MAX_IN) - LOG_MIN;
109
+ export const sizeToStep = (inches) => Math.round(((Math.log(clamp(inches, LINK_MIN_IN, LINK_MAX_IN)) - LOG_MIN) / LOG_SPAN) * SIZE_STEPS);
110
+ export const stepToSize = (step) => Math.exp(LOG_MIN + (clamp(step, 0, SIZE_STEPS) / SIZE_STEPS) * LOG_SPAN);
111
+ /** A tile's leader on or off. On, it points out beside the tile (to the right, or the left near the screen's edge). */
112
+ export function toggleLeader(id) {
113
+ const n = SK().notes.find(x => x.id === id);
114
+ if (!n || !isLink(n))
115
+ return;
116
+ pushHistory();
117
+ if (n.leader)
118
+ delete n.leader;
119
+ else {
120
+ const b = linkBox(mainT(), n), right = b.x + b.s + 80 < cvs.W - 24;
121
+ const [x, y] = s2w(right ? b.x + b.s + 70 : b.x - 70, b.cy + 50);
122
+ n.leader = [x, y];
123
+ }
124
+ afterEdit();
125
+ }
126
+ /** Open what the selected tile is for. */
127
+ export function openSelectedLink() {
128
+ const n = selectedLink();
129
+ if (!n)
130
+ return;
131
+ if (!canOpenLink(n.link)) {
132
+ toast(linkInfoOf(n.link)?.exists === false ? 'That’s been removed from the job, so it can’t be opened.' : 'That can’t be opened from here.', { warn: true });
133
+ return;
134
+ }
135
+ openLink(n.link);
136
+ }
137
+ /** A view-only tap on the plan: on a link's tile, the person is asked, then what it's for opens. */
138
+ export function readOnlyTap(sx, sy, touch) {
139
+ if (!ed.readOnly || !canLink())
140
+ return;
141
+ const n = linkAt(sx, sy, touch);
142
+ if (!n || !canOpenLink(n.link))
143
+ return;
144
+ const t = n.link, where = linkInfoOf(t)?.groupName ?? t.groupName;
145
+ askConfirm({
146
+ title: 'Open ' + linkName(t) + '?',
147
+ msg: where ? 'It’s in ' + where + '.' : undefined,
148
+ choices: [{ label: 'Open', run: () => openLink(t) }, { label: 'Cancel', run: () => { } }],
149
+ });
150
+ }
151
+ /** Let go of a dimension's link: its value stays, the drawing's alone now. */
152
+ export function unlinkDim(id) {
153
+ const c = SK().cons[id];
154
+ if (!c?.measurementRef)
155
+ return;
156
+ pushHistory();
157
+ delete c.measurementRef;
158
+ afterEdit();
159
+ }
160
+ /** Open the measurement a dimension is linked to. */
161
+ export function openDimLink(id) {
162
+ const t = SK().cons[id]?.measurementRef;
163
+ if (!t)
164
+ return;
165
+ if (!canOpenLink(t)) {
166
+ toast(linkInfoOf(t)?.exists === false ? 'That measurement has been removed from the job, so it can’t be opened.' : 'That can’t be opened from here.', { warn: true });
167
+ return;
168
+ }
169
+ openLink(t);
170
+ }
171
+ /**
172
+ * Whether a dimension can be saved to the drawing's group: one of the drawing's own driving dimensions with a value,
173
+ * on the plan, with a host that can save one there.
174
+ */
175
+ export function canSaveDim(id) {
176
+ const c = SK().cons[id], h = linksHost();
177
+ return !!c && !ed.readOnly && !elevOpen() && !!h?.saveMeasurement && h.canSave !== false && !c.measurementRef && !c.measurementId && !!dimMeasurement(c);
178
+ }
179
+ /**
180
+ * Save to group: the dimension becomes a measurement of the drawing's group (in its list, like any other — with the
181
+ * laser reading it's from, if one set it), and the dimension is linked to it from then on.
182
+ */
183
+ export async function saveDimToGroup(id) {
184
+ const h = linksHost(), c = SK().cons[id];
185
+ if (!h || !c || !canSaveDim(id))
186
+ return;
187
+ const m = dimMeasurement(c), pageId = store.curPageId, was = JSON.stringify(c);
188
+ let t = null;
189
+ try {
190
+ t = await h.saveMeasurement({ kind: m.kind, value: m.value, ...(c.capture !== undefined ? { capture: c.capture } : {}) });
191
+ }
192
+ catch {
193
+ t = null;
194
+ }
195
+ if (!t) {
196
+ toast('It couldn’t be saved to the group. Check the connection and try again.', { warn: true });
197
+ return;
198
+ }
199
+ // (the drawing may have moved on meanwhile: the dimension's linked as it was saved, or not at all)
200
+ const cur = store.curPageId === pageId ? SK().cons[id] : undefined;
201
+ if (!cur || JSON.stringify(cur) !== was) {
202
+ toast('Saved to the group, but the dimension changed meanwhile, so it isn’t linked. To link it, select its line, tap +, and pick it under the keys.', { warn: true });
203
+ return;
204
+ }
205
+ pushHistory();
206
+ cur.measurementRef = linkSnapshot(t);
207
+ delete cur.capture;
208
+ afterEdit();
209
+ }
210
+ //# sourceMappingURL=linkActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkActions.js","sourceRoot":"","sources":["../../src/editor/linkActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1I,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,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AAC,GAAsB,IAAI,CAAC;IAChC,IAAI,CAAC;QAAC,CAAC,GAAG,MAAM,CAAC,CAAC,eAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,CAAC,GAAG,IAAI,CAAC;IAAC,CAAC;IACvJ,IAAI,CAAC,CAAC,EAAE,CAAC;QAAC,KAAK,CAAC,wEAAwE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAAC,OAAO;IAAC,CAAC;IACpH,mGAAmG;IACnG,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;QAAC,KAAK,CAAC,8IAA8I,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAAC,OAAO;IAAC,CAAC;IAC3N,WAAW,EAAE,CAAC;IACd,GAAG,CAAC,cAAc,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC;IACnB,SAAS,EAAE,CAAC;AACd,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Bring every linked dimension in the project to what the job says it is now. */
2
+ export declare function followLinked(): void;
@@ -0,0 +1,53 @@
1
+ import { allCons } from '../model/faces';
2
+ import { linkInfoOf } from '../model/links';
3
+ import { dimMeasurement, dimValueOf } from '../model/measurement';
4
+ import { onSessionReset } from '../model/session';
5
+ import { SK, store } from '../model/store';
6
+ import { setDimValue } from '../tools/dim';
7
+ import { linksHost, onLinkInfo } from './links';
8
+ import { staleEcho } from './linkWrite';
9
+ /*
10
+ Dimensions linked to measurements of the job follow them: when the job says a measurement is something else now
11
+ (changed elsewhere, on another device, by someone else), or the drawing has a different value for it (an undo past
12
+ a change both made), the dimension takes the job's value. On the page being edited the drawing solves to it, as a
13
+ step of no undo of its own; on other pages the value is set, and the drawing solves when that page is next edited.
14
+ One the drawing can't hold is left as it is (and not tried again until the job's value changes).
15
+ */
16
+ /** Values tried on dimensions and refused, by "page|constraint": not tried again until the job's value changes. */
17
+ const refused = new Map();
18
+ let following = false;
19
+ onSessionReset(() => { refused.clear(); following = false; });
20
+ /** Bring every linked dimension in the project to what the job says it is now. */
21
+ export function followLinked() {
22
+ const p = store.project;
23
+ if (following || !p || !linksHost())
24
+ return;
25
+ following = true;
26
+ try {
27
+ for (const pg of p.pages)
28
+ for (const [cid, c] of allCons(pg.sk)) {
29
+ const t = c.measurementRef, info = t && linkInfoOf(t);
30
+ if (!t || !info || info.exists === false || info.value == null || staleEcho(t, info.value))
31
+ continue;
32
+ const m = dimMeasurement(c), key = pg.id + '|' + cid;
33
+ if (!m || m.value === info.value) {
34
+ refused.delete(key);
35
+ continue;
36
+ }
37
+ if (refused.get(key) === info.value)
38
+ continue;
39
+ const v = dimValueOf(c, { value: info.value });
40
+ if (pg.id === store.curPageId && SK().cons[cid] === c) {
41
+ if (!setDimValue(cid, v, undefined, { quiet: true }))
42
+ refused.set(key, info.value);
43
+ }
44
+ else
45
+ c.value = v;
46
+ }
47
+ }
48
+ finally {
49
+ following = false;
50
+ }
51
+ }
52
+ onLinkInfo(() => followLinked());
53
+ //# sourceMappingURL=linkFollow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkFollow.js","sourceRoot":"","sources":["../../src/editor/linkFollow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,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,EAAE,IAAI,CAAC,KAAK,CAAC;oBAAE,SAAS;gBACrG,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;gBACrD,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;oBAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;oBAAC,SAAS;gBAAC,CAAC;gBACpE,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,KAAK;oBAAE,SAAS;gBAC9C,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBAC/C,IAAI,EAAE,CAAC,EAAE,KAAK,KAAK,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;oBACtD,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;wBAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;gBACrF,CAAC;;oBAAM,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;YACrB,CAAC;IACH,CAAC;YAAS,CAAC;QAAC,SAAS,GAAG,KAAK,CAAC;IAAC,CAAC;AAClC,CAAC;AAED,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Constraint, LinkTarget } from '../model/types';
2
+ /**
3
+ * Whether what the job says of `t` (its value `value`) is older than what was just written to it — to be ignored.
4
+ * Hearing the written value back, it's settled.
5
+ */
6
+ export declare function staleEcho(t: LinkTarget, value: number): boolean;
7
+ /** Whether a new value for `c` would change it (a linked one is asked about only then). */
8
+ export declare const changesValue: (c: Constraint, v: number) => boolean;
9
+ /**
10
+ * Ask before giving linked dimension `c` value `v` (inches, or degrees). `apply(unlink)` sets it — letting go of the
11
+ * link with `unlink` — and says whether it took; `capture` (a laser reading's) goes to the job with it.
12
+ */
13
+ export declare function askLinkedChange(c: Constraint, v: number, apply: (unlink: boolean) => boolean, capture?: unknown): void;
@@ -0,0 +1,84 @@
1
+ import { linkInfoOf, linkKey, linkName } from '../model/links';
2
+ import { onSessionReset } from '../model/session';
3
+ import { dimMeasurement } from '../model/measurement';
4
+ import { store } from '../model/store';
5
+ import { fmtAng, fmtLen } from '../units';
6
+ import { askConfirm } from './confirm';
7
+ import { linksHost } from './links';
8
+ /*
9
+ A dimension linked to a measurement of the job is that measurement: giving it a new value — typed, from a laser
10
+ reading, dropped from the tray — changes the job's too, so the person is asked first. Change both writes it to the
11
+ job (through the host); Only this drawing keeps the new value here and lets go of the link; Cancel leaves both.
12
+
13
+ What the editor writes comes back from the job a moment later, and an answer from before it may arrive first: for a
14
+ few seconds after a write, the job saying anything else about that measurement is taken to be the old news it is.
15
+ */
16
+ /** Writes to the job's measurements not yet heard back: by linkKey, the value written and when. */
17
+ const wrote = new Map();
18
+ const ECHO_MS = 8000;
19
+ onSessionReset(() => wrote.clear());
20
+ /**
21
+ * Whether what the job says of `t` (its value `value`) is older than what was just written to it — to be ignored.
22
+ * Hearing the written value back, it's settled.
23
+ */
24
+ export function staleEcho(t, value) {
25
+ const k = linkKey(t), w = wrote.get(k);
26
+ if (!w)
27
+ return false;
28
+ if (w.value === value || Date.now() - w.at > ECHO_MS) {
29
+ wrote.delete(k);
30
+ return false;
31
+ }
32
+ return true;
33
+ }
34
+ /** Whether a new value for `c` would change it (a linked one is asked about only then). */
35
+ export const changesValue = (c, v) => c.value == null || Math.abs(c.value - v) > 1e-9;
36
+ /**
37
+ * Ask before giving linked dimension `c` value `v` (inches, or degrees). `apply(unlink)` sets it — letting go of the
38
+ * link with `unlink` — and says whether it took; `capture` (a laser reading's) goes to the job with it.
39
+ */
40
+ export function askLinkedChange(c, v, apply, capture) {
41
+ const t = c.measurementRef;
42
+ if (!t)
43
+ return;
44
+ const info = linkInfoOf(t), host = linksHost(), m = dimMeasurement(c, v);
45
+ const name = linkName(t), group = info?.groupName ?? t.groupName, gone = info?.exists === false;
46
+ const canWrite = !!host?.update && !!m && !gone && info?.canEdit !== false;
47
+ const pageId = store.curPageId, still = () => store.curPageId === pageId && linksHost() === host;
48
+ const what = c.type === 'angle' ? fmtAng(v) : fmtLen(c.rad ? v / 2 : v);
49
+ if (canWrite) {
50
+ askConfirm({
51
+ title: 'Change ' + name + (group ? ' in ' + group : '') + ' to ' + what + '?',
52
+ msg: 'This dimension is linked to it. Only this drawing keeps ' + what + ' here and unlinks them.',
53
+ choices: [
54
+ { label: 'Change both', run: () => {
55
+ if (!still())
56
+ return;
57
+ // (before it's set: the drawing hearing the job's old value meanwhile mustn't put it back)
58
+ const k = linkKey(t), was = wrote.get(k);
59
+ wrote.set(k, { value: m.value, at: Date.now() });
60
+ if (apply(false))
61
+ host.update(t, m.value, capture);
62
+ else if (was)
63
+ wrote.set(k, was);
64
+ else
65
+ wrote.delete(k);
66
+ } },
67
+ { label: 'Only this drawing', run: () => { if (still())
68
+ apply(true); } },
69
+ { label: 'Cancel', run: () => { } },
70
+ ],
71
+ });
72
+ return;
73
+ }
74
+ askConfirm({
75
+ title: gone ? name + ' was removed from the job' : name + ' can’t be changed from here',
76
+ msg: 'Keep ' + what + ' in this drawing (it unlinks from ' + name + '), or cancel.',
77
+ choices: [
78
+ { label: 'Keep in this drawing', run: () => { if (still())
79
+ apply(true); } },
80
+ { label: 'Cancel', run: () => { } },
81
+ ],
82
+ });
83
+ }
84
+ //# sourceMappingURL=linkWrite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkWrite.js","sourceRoot":"","sources":["../../src/editor/linkWrite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAA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,CAAC,CAAC,CAAC,CAAC,EAAE;YAC3E,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;SACnC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,84 @@
1
+ import type { LinkInfo, LinkTarget } from '../model/types';
2
+ /** What a keypad takes from the job's measurements: a line's length, or a dimension's angle. */
3
+ export type MeasurementKind = 'length' | 'angle';
4
+ /** What the editor asks the host to pick from (Annotate's +). */
5
+ export interface CadLinkPick {
6
+ /**
7
+ * 'files': the job's files and objects to pick. Never its measurements: those come into a drawing only through a
8
+ * line's length keypad in Draft (CadLinks.lengths), as the dimensions they drive. A host may still show them, greyed
9
+ * out, saying so when one's tapped (BOLDR's do); one it hands back anyway is dropped.
10
+ */
11
+ want: 'files';
12
+ /** what the drawing links to already */
13
+ linked: LinkTarget[];
14
+ }
15
+ /** A dimension of the drawing, saved to the drawing's group as a measurement of the job. */
16
+ export interface CadSaveMeasurement {
17
+ kind: 'length' | 'angle';
18
+ /** micrometres for a length, degrees for an angle */
19
+ value: number;
20
+ /** the dimension's label, if it has one */
21
+ label?: string;
22
+ /** the host's record of the laser reading that set it (as laserReading was given it), if one did */
23
+ capture?: unknown;
24
+ }
25
+ /** The host's side of links (CadEditorProps.links). Pass one object for as long as the editor's open (memoized). */
26
+ export interface CadLinks {
27
+ /** Let the person pick from the job's files; resolves with what they picked ([] for nothing). */
28
+ pick(req: CadLinkPick): Promise<LinkTarget[]>;
29
+ /**
30
+ * The job's measurements, lengths and angles, for a keypad's own list (a page swiped to on a touch screen): call
31
+ * `cb` with them, in the order to show them, as targets with what they are now (name, group, `mkind`, value, text)
32
+ * — and again as they change, but not until the whole job's been heard from (never none while it's loading). The
33
+ * keypad greys out those that aren't its kind. Returns how to stop.
34
+ */
35
+ measurements?(cb: (list: LinkTarget[]) => void): () => void;
36
+ /**
37
+ * Let the person pick one of the job's measurements for a keypad from the host's own list (Select From List, on a
38
+ * desktop: its side drawer), those of `kind` pickable and the rest greyed out. Resolves with the one picked (null:
39
+ * none). Absent: the keypad's own list (`measurements`) is shown instead.
40
+ */
41
+ pickMeasurement?(req: {
42
+ kind: MeasurementKind;
43
+ }): Promise<LinkTarget | null>;
44
+ /**
45
+ * Say what each of `targets` is now, by linkKey, and again whenever that changes — one that's gone with
46
+ * `exists: false`, but never while it's still loading. Returns how to stop.
47
+ */
48
+ subscribe(targets: LinkTarget[], cb: (info: Record<string, LinkInfo>) => void): () => void;
49
+ /** Open what `target` is for (another screen, or a sheet over the drawing). */
50
+ open(target: LinkTarget): void;
51
+ /** Change a linked measurement (micrometres, or degrees), the person having said to; `capture` as saveMeasurement's. */
52
+ update?(target: LinkTarget, value: number, capture?: unknown): void;
53
+ /** Save a dimension as a new measurement in the drawing's own group; resolves with it (null: not saved). */
54
+ saveMeasurement?(m: CadSaveMeasurement): Promise<LinkTarget | null>;
55
+ /** whether saveMeasurement can be used here (not in a group whose measurements need a column, for one) */
56
+ canSave?: boolean;
57
+ }
58
+ export declare const linksHost: () => CadLinks | null;
59
+ export declare const linksEpoch: () => number;
60
+ /** Whether the host can link things (Annotate's + shows). */
61
+ export declare const canLink: () => boolean;
62
+ /** The host's links from now on (CadEditor), or null for none. */
63
+ export declare function setLinksHost(h: CadLinks | null): void;
64
+ /** Call `fn` with each answer about what's linked (after it's been taken in). */
65
+ export declare function onLinkInfo(fn: (info: Record<string, LinkInfo>) => void): void;
66
+ /** Ask the host about what the drawing links to now — if that's changed since it was last asked. */
67
+ export declare function refreshLinks(): void;
68
+ /** Have the person pick from the job's files: what they picked, or [] if nothing (or the editor moved on meanwhile). */
69
+ export declare function pickLinks(): Promise<LinkTarget[]>;
70
+ /** Whether the host offers the job's measurements to a keypad: listing them, or picking one itself. */
71
+ export declare const offersJobMeasurements: () => boolean;
72
+ /** Whether the host picks a measurement itself (Select From List opens its own list). */
73
+ export declare const hostPicksMeasurements: () => boolean;
74
+ /** Whether a measurement of the job's can go in a keypad of `kind`: one of that kind, more than nothing. */
75
+ export declare const measurementFits: (t: LinkTarget, kind: MeasurementKind) => boolean;
76
+ /** Hear the job's measurements from the host, and again as they change, until the returned stop — or the host changes. */
77
+ export declare function watchJobMeasurements(cb: (list: LinkTarget[]) => void): () => void;
78
+ /**
79
+ * Have the host's own list pick a measurement of `kind` (Select From List): the one picked, or null — none picked, one
80
+ * that isn't of `kind`, or the editor moved on meanwhile. Asks once at a time, as the picker's +.
81
+ */
82
+ export declare function pickJobMeasurement(kind: MeasurementKind): Promise<LinkTarget | null>;
83
+ /** Open what a link is for. */
84
+ export declare function openLink(t: LinkTarget): void;
@@ -0,0 +1,130 @@
1
+ import { linkInfo, linkKey, linkTargets } from '../model/links';
2
+ import { onSessionReset } from '../model/session';
3
+ import { store } from '../model/store';
4
+ import { requestDraw } from '../render/view';
5
+ import { updateCtx } from './ports';
6
+ let host = null;
7
+ /** The host's answers for what's linked now, as asked (keys: what was asked about). */
8
+ let sub = null;
9
+ /** Bumped when the host or the session changes: an answer to an older question is dropped. */
10
+ let epoch = 0;
11
+ /** The picker's open: a second + meanwhile (a double press) asks nothing more of the host. */
12
+ let picking = false;
13
+ /** Told of each answer (editor/linkFollow.ts: linked dimensions follow their measurements). */
14
+ const heard = [];
15
+ export const linksHost = () => host;
16
+ export const linksEpoch = () => epoch;
17
+ /** Whether the host can link things (Annotate's + shows). */
18
+ export const canLink = () => !!host;
19
+ /** The host's links from now on (CadEditor), or null for none. */
20
+ export function setLinksHost(h) {
21
+ if (h === host)
22
+ return;
23
+ stop();
24
+ host = h;
25
+ epoch++;
26
+ picking = false;
27
+ refreshLinks();
28
+ }
29
+ function stop() {
30
+ const s = sub;
31
+ sub = null;
32
+ s?.stop();
33
+ }
34
+ onSessionReset(() => { stop(); host = null; epoch++; picking = false; });
35
+ /** Call `fn` with each answer about what's linked (after it's been taken in). */
36
+ export function onLinkInfo(fn) { heard.push(fn); }
37
+ /** Ask the host about what the drawing links to now — if that's changed since it was last asked. */
38
+ export function refreshLinks() {
39
+ const p = store.project;
40
+ if (!host || !p) {
41
+ stop();
42
+ return;
43
+ }
44
+ const targets = linkTargets(p), keys = targets.map(linkKey).sort().join('\n');
45
+ if (sub && sub.keys === keys)
46
+ return;
47
+ stop();
48
+ if (!targets.length)
49
+ return;
50
+ const s = { keys, stop: () => { } };
51
+ // (before asking: the host may answer at once)
52
+ sub = s;
53
+ const unsub = host.subscribe(targets, info => {
54
+ if (sub !== s)
55
+ return;
56
+ // (what's been heard of stays: another question about it, as the links change, needn't wait for the answer)
57
+ Object.assign(linkInfo.byKey, info);
58
+ for (const fn of heard)
59
+ fn(info);
60
+ requestDraw();
61
+ updateCtx();
62
+ });
63
+ if (sub === s)
64
+ s.stop = unsub;
65
+ else
66
+ unsub();
67
+ }
68
+ /** Have the person pick from the job's files: what they picked, or [] if nothing (or the editor moved on meanwhile). */
69
+ export async function pickLinks() {
70
+ const h = host, p = store.project;
71
+ if (!h || !p || picking)
72
+ return [];
73
+ const mine = epoch;
74
+ picking = true;
75
+ let out;
76
+ try {
77
+ out = await h.pick({ want: 'files', linked: linkTargets(p) });
78
+ }
79
+ catch {
80
+ return [];
81
+ }
82
+ finally {
83
+ if (mine === epoch)
84
+ picking = false;
85
+ }
86
+ // (its files: a measurement isn't put on the plan as a tile)
87
+ return mine === epoch && h === host ? (out ?? []).filter(t => t.kind === 'file') : [];
88
+ }
89
+ /** Whether the host offers the job's measurements to a keypad: listing them, or picking one itself. */
90
+ export const offersJobMeasurements = () => !!host?.measurements || !!host?.pickMeasurement;
91
+ /** Whether the host picks a measurement itself (Select From List opens its own list). */
92
+ export const hostPicksMeasurements = () => !!host?.pickMeasurement;
93
+ /** Whether a measurement of the job's can go in a keypad of `kind`: one of that kind, more than nothing. */
94
+ export const measurementFits = (t, kind) => t.kind === 'measurement' && (t.mkind ?? 'length') === kind && (t.value ?? 0) > 0;
95
+ /** Hear the job's measurements from the host, and again as they change, until the returned stop — or the host changes. */
96
+ export function watchJobMeasurements(cb) {
97
+ const h = host;
98
+ if (!h?.measurements)
99
+ return () => { };
100
+ let live = true;
101
+ const stop = h.measurements(list => { if (live && h === host)
102
+ cb(list.filter(t => t.kind === 'measurement' && typeof t.value === 'number')); });
103
+ return () => { live = false; stop(); };
104
+ }
105
+ /**
106
+ * Have the host's own list pick a measurement of `kind` (Select From List): the one picked, or null — none picked, one
107
+ * that isn't of `kind`, or the editor moved on meanwhile. Asks once at a time, as the picker's +.
108
+ */
109
+ export async function pickJobMeasurement(kind) {
110
+ const h = host;
111
+ if (!h?.pickMeasurement || picking)
112
+ return null;
113
+ const mine = epoch;
114
+ picking = true;
115
+ let t;
116
+ try {
117
+ t = await h.pickMeasurement({ kind });
118
+ }
119
+ catch {
120
+ return null;
121
+ }
122
+ finally {
123
+ if (mine === epoch)
124
+ picking = false;
125
+ }
126
+ return mine === epoch && h === host && t && measurementFits(t, kind) ? t : null;
127
+ }
128
+ /** Open what a link is for. */
129
+ export function openLink(t) { host?.open(t); }
130
+ //# sourceMappingURL=links.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/editor/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAwEpC,IAAI,IAAI,GAAoB,IAAI,CAAC;AACjC,uFAAuF;AACvF,IAAI,GAAG,GAA8C,IAAI,CAAC;AAC1D,8FAA8F;AAC9F,IAAI,KAAK,GAAG,CAAC,CAAC;AACd,8FAA8F;AAC9F,IAAI,OAAO,GAAG,KAAK,CAAC;AACpB,+FAA+F;AAC/F,MAAM,KAAK,GAAiD,EAAE,CAAC;A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