@weasel-js/editing 0.0.0-stage → 2.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 (368) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +60 -2
  3. package/dist/actionGroups.js +27 -0
  4. package/dist/actionGroups.js.map +1 -0
  5. package/dist/actions/align/action.js +105 -0
  6. package/dist/actions/align/action.js.map +1 -0
  7. package/dist/actions/align/align.js +115 -0
  8. package/dist/actions/align/align.js.map +1 -0
  9. package/dist/actions/clipboard/action.js +133 -0
  10. package/dist/actions/clipboard/action.js.map +1 -0
  11. package/dist/actions/clone/action.js +217 -0
  12. package/dist/actions/clone/action.js.map +1 -0
  13. package/dist/actions/clone/behaviors.js +65 -0
  14. package/dist/actions/clone/behaviors.js.map +1 -0
  15. package/dist/actions/delete/delete.js +123 -0
  16. package/dist/actions/delete/delete.js.map +1 -0
  17. package/dist/actions/derivedBox.js +16 -0
  18. package/dist/actions/derivedBox.js.map +1 -0
  19. package/dist/actions/distribute/action.js +96 -0
  20. package/dist/actions/distribute/action.js.map +1 -0
  21. package/dist/actions/distribute/distribute.js +61 -0
  22. package/dist/actions/distribute/distribute.js.map +1 -0
  23. package/dist/actions/distribute/plan.js +55 -0
  24. package/dist/actions/distribute/plan.js.map +1 -0
  25. package/dist/actions/edit/createPaintAction.js +138 -0
  26. package/dist/actions/edit/createPaintAction.js.map +1 -0
  27. package/dist/actions/edit/deselect.js +34 -0
  28. package/dist/actions/edit/deselect.js.map +1 -0
  29. package/dist/actions/edit/duplicate.js +93 -0
  30. package/dist/actions/edit/duplicate.js.map +1 -0
  31. package/dist/actions/edit/group.js +281 -0
  32. package/dist/actions/edit/group.js.map +1 -0
  33. package/dist/actions/edit/ingest.js +114 -0
  34. package/dist/actions/edit/ingest.js.map +1 -0
  35. package/dist/actions/edit/nudge.js +97 -0
  36. package/dist/actions/edit/nudge.js.map +1 -0
  37. package/dist/actions/edit/selectAll.js +48 -0
  38. package/dist/actions/edit/selectAll.js.map +1 -0
  39. package/dist/actions/edit/setFill.js +52 -0
  40. package/dist/actions/edit/setFill.js.map +1 -0
  41. package/dist/actions/edit/setFillOpacity.js +26 -0
  42. package/dist/actions/edit/setFillOpacity.js.map +1 -0
  43. package/dist/actions/edit/setStroke.js +57 -0
  44. package/dist/actions/edit/setStroke.js.map +1 -0
  45. package/dist/actions/edit/setStrokeOpacity.js +28 -0
  46. package/dist/actions/edit/setStrokeOpacity.js.map +1 -0
  47. package/dist/actions/edit/setStrokeWidth.js +53 -0
  48. package/dist/actions/edit/setStrokeWidth.js.map +1 -0
  49. package/dist/actions/edit/setVertexColor.js +45 -0
  50. package/dist/actions/edit/setVertexColor.js.map +1 -0
  51. package/dist/actions/flip/action.js +209 -0
  52. package/dist/actions/flip/action.js.map +1 -0
  53. package/dist/actions/flip/helpers.js +80 -0
  54. package/dist/actions/flip/helpers.js.map +1 -0
  55. package/dist/actions/group/enterGroup.js +81 -0
  56. package/dist/actions/group/enterGroup.js.map +1 -0
  57. package/dist/actions/insert/action.js +152 -0
  58. package/dist/actions/insert/action.js.map +1 -0
  59. package/dist/actions/insert/commit.js +52 -0
  60. package/dist/actions/insert/commit.js.map +1 -0
  61. package/dist/actions/insert/extras.js +88 -0
  62. package/dist/actions/insert/extras.js.map +1 -0
  63. package/dist/actions/insert/frame.js +96 -0
  64. package/dist/actions/insert/frame.js.map +1 -0
  65. package/dist/actions/insert/geometry.js +35 -0
  66. package/dist/actions/insert/geometry.js.map +1 -0
  67. package/dist/actions/insert/lands.js +41 -0
  68. package/dist/actions/insert/lands.js.map +1 -0
  69. package/dist/actions/insert/params.js +42 -0
  70. package/dist/actions/insert/params.js.map +1 -0
  71. package/dist/actions/insert/placeAction.js +137 -0
  72. package/dist/actions/insert/placeAction.js.map +1 -0
  73. package/dist/actions/insert/repositionAction.js +47 -0
  74. package/dist/actions/insert/repositionAction.js.map +1 -0
  75. package/dist/actions/insert/rotateAction.js +34 -0
  76. package/dist/actions/insert/rotateAction.js.map +1 -0
  77. package/dist/actions/insert/session.js +99 -0
  78. package/dist/actions/insert/session.js.map +1 -0
  79. package/dist/actions/insert/shape.js +117 -0
  80. package/dist/actions/insert/shape.js.map +1 -0
  81. package/dist/actions/insert/style.js +23 -0
  82. package/dist/actions/insert/style.js.map +1 -0
  83. package/dist/actions/lassoSelect/action.js +201 -0
  84. package/dist/actions/lassoSelect/action.js.map +1 -0
  85. package/dist/actions/lassoSelect/behaviors/selectFromLasso.js +61 -0
  86. package/dist/actions/lassoSelect/behaviors/selectFromLasso.js.map +1 -0
  87. package/dist/actions/lockedWrites.js +20 -0
  88. package/dist/actions/lockedWrites.js.map +1 -0
  89. package/dist/actions/move/action.js +138 -0
  90. package/dist/actions/move/action.js.map +1 -0
  91. package/dist/actions/move/behaviors/clampMove.js +42 -0
  92. package/dist/actions/move/behaviors/clampMove.js.map +1 -0
  93. package/dist/actions/move/behaviors/layoutDrop.js +84 -0
  94. package/dist/actions/move/behaviors/layoutDrop.js.map +1 -0
  95. package/dist/actions/move/behaviors/pageDrop.js +30 -0
  96. package/dist/actions/move/behaviors/pageDrop.js.map +1 -0
  97. package/dist/actions/move/behaviors/reparentOnDrop.js +44 -0
  98. package/dist/actions/move/behaviors/reparentOnDrop.js.map +1 -0
  99. package/dist/actions/move/behaviors/snapBackOrDelete.js +52 -0
  100. package/dist/actions/move/behaviors/snapBackOrDelete.js.map +1 -0
  101. package/dist/actions/move/behaviors/snapToContainer.js +214 -0
  102. package/dist/actions/move/behaviors/snapToContainer.js.map +1 -0
  103. package/dist/actions/move/behaviors/swapOnDrop.js +180 -0
  104. package/dist/actions/move/behaviors/swapOnDrop.js.map +1 -0
  105. package/dist/actions/move/capture.js +116 -0
  106. package/dist/actions/move/capture.js.map +1 -0
  107. package/dist/actions/move/commit/index.js +47 -0
  108. package/dist/actions/move/commit/index.js.map +1 -0
  109. package/dist/actions/move/commit/layoutDrop.js +68 -0
  110. package/dist/actions/move/commit/layoutDrop.js.map +1 -0
  111. package/dist/actions/move/commit/layoutRelease.js +146 -0
  112. package/dist/actions/move/commit/layoutRelease.js.map +1 -0
  113. package/dist/actions/move/commit/pageDrop.js +162 -0
  114. package/dist/actions/move/commit/pageDrop.js.map +1 -0
  115. package/dist/actions/move/commit/rebase.js +24 -0
  116. package/dist/actions/move/commit/rebase.js.map +1 -0
  117. package/dist/actions/move/commit/reparent.js +157 -0
  118. package/dist/actions/move/commit/reparent.js.map +1 -0
  119. package/dist/actions/move/delta.js +127 -0
  120. package/dist/actions/move/delta.js.map +1 -0
  121. package/dist/actions/move/dragSnap.js +55 -0
  122. package/dist/actions/move/dragSnap.js.map +1 -0
  123. package/dist/actions/move/frame.js +67 -0
  124. package/dist/actions/move/frame.js.map +1 -0
  125. package/dist/actions/move/gestureAdapter.js +36 -0
  126. package/dist/actions/move/gestureAdapter.js.map +1 -0
  127. package/dist/actions/move/landedDescendants.js +50 -0
  128. package/dist/actions/move/landedDescendants.js.map +1 -0
  129. package/dist/actions/move/layout/container.js +119 -0
  130. package/dist/actions/move/layout/container.js.map +1 -0
  131. package/dist/actions/move/layout/dragged.js +75 -0
  132. package/dist/actions/move/layout/dragged.js.map +1 -0
  133. package/dist/actions/move/layout/dropPass.js +205 -0
  134. package/dist/actions/move/layout/dropPass.js.map +1 -0
  135. package/dist/actions/move/layout/exits.js +62 -0
  136. package/dist/actions/move/layout/exits.js.map +1 -0
  137. package/dist/actions/move/layout/glide.js +70 -0
  138. package/dist/actions/move/layout/glide.js.map +1 -0
  139. package/dist/actions/move/layout/view.js +60 -0
  140. package/dist/actions/move/layout/view.js.map +1 -0
  141. package/dist/actions/move/refusal.js +49 -0
  142. package/dist/actions/move/refusal.js.map +1 -0
  143. package/dist/actions/move/session.js +105 -0
  144. package/dist/actions/move/session.js.map +1 -0
  145. package/dist/actions/move/sessionOf.js +27 -0
  146. package/dist/actions/move/sessionOf.js.map +1 -0
  147. package/dist/actions/move/translate.js +49 -0
  148. package/dist/actions/move/translate.js.map +1 -0
  149. package/dist/actions/pathfinder/action.js +109 -0
  150. package/dist/actions/pathfinder/action.js.map +1 -0
  151. package/dist/actions/pathfinder/booleanGroupAction.js +117 -0
  152. package/dist/actions/pathfinder/booleanGroupAction.js.map +1 -0
  153. package/dist/actions/pathfinder/keymap.js +51 -0
  154. package/dist/actions/pathfinder/keymap.js.map +1 -0
  155. package/dist/actions/reorder/reorder.js +245 -0
  156. package/dist/actions/reorder/reorder.js.map +1 -0
  157. package/dist/actions/resize/action.js +105 -0
  158. package/dist/actions/resize/action.js.map +1 -0
  159. package/dist/actions/resize/aspect.js +42 -0
  160. package/dist/actions/resize/aspect.js.map +1 -0
  161. package/dist/actions/resize/behaviors/clampMinSize.js +100 -0
  162. package/dist/actions/resize/behaviors/clampMinSize.js.map +1 -0
  163. package/dist/actions/resize/boxFrame.js +19 -0
  164. package/dist/actions/resize/boxFrame.js.map +1 -0
  165. package/dist/actions/resize/capture.js +121 -0
  166. package/dist/actions/resize/capture.js.map +1 -0
  167. package/dist/actions/resize/commit.js +104 -0
  168. package/dist/actions/resize/commit.js.map +1 -0
  169. package/dist/actions/resize/frame.js +171 -0
  170. package/dist/actions/resize/frame.js.map +1 -0
  171. package/dist/actions/resize/held.js +44 -0
  172. package/dist/actions/resize/held.js.map +1 -0
  173. package/dist/actions/resize/minimum.js +34 -0
  174. package/dist/actions/resize/minimum.js.map +1 -0
  175. package/dist/actions/resize/replay.js +58 -0
  176. package/dist/actions/resize/replay.js.map +1 -0
  177. package/dist/actions/resize/ruleBounds.js +11 -0
  178. package/dist/actions/resize/ruleBounds.js.map +1 -0
  179. package/dist/actions/resize/session.js +118 -0
  180. package/dist/actions/resize/session.js.map +1 -0
  181. package/dist/actions/rotate/action.js +99 -0
  182. package/dist/actions/rotate/action.js.map +1 -0
  183. package/dist/actions/rotate/commit.js +48 -0
  184. package/dist/actions/rotate/commit.js.map +1 -0
  185. package/dist/actions/rotate/frame.js +96 -0
  186. package/dist/actions/rotate/frame.js.map +1 -0
  187. package/dist/actions/rotate/replay.js +25 -0
  188. package/dist/actions/rotate/replay.js.map +1 -0
  189. package/dist/actions/rotate/session.js +135 -0
  190. package/dist/actions/rotate/session.js.map +1 -0
  191. package/dist/actions/select/areaSelect.js +83 -0
  192. package/dist/actions/select/areaSelect.js.map +1 -0
  193. package/dist/actions/select/clearSelection.js +33 -0
  194. package/dist/actions/select/clearSelection.js.map +1 -0
  195. package/dist/actions/swap/action.js +63 -0
  196. package/dist/actions/swap/action.js.map +1 -0
  197. package/dist/actions/swap/swapOps.js +160 -0
  198. package/dist/actions/swap/swapOps.js.map +1 -0
  199. package/dist/actions/transformAgain/action.js +90 -0
  200. package/dist/actions/transformAgain/action.js.map +1 -0
  201. package/dist/actions/transformAgain/transformSelection.js +49 -0
  202. package/dist/actions/transformAgain/transformSelection.js.map +1 -0
  203. package/dist/booleans/booleans.js +130 -0
  204. package/dist/booleans/booleans.js.map +1 -0
  205. package/dist/booleans/commit.js +45 -0
  206. package/dist/booleans/commit.js.map +1 -0
  207. package/dist/booleans/custom.js +48 -0
  208. package/dist/booleans/custom.js.map +1 -0
  209. package/dist/booleans/operands.js +50 -0
  210. package/dist/booleans/operands.js.map +1 -0
  211. package/dist/booleans/pieces.js +43 -0
  212. package/dist/booleans/pieces.js.map +1 -0
  213. package/dist/booleans/placement.js +37 -0
  214. package/dist/booleans/placement.js.map +1 -0
  215. package/dist/booleans/useBooleans.js +34 -0
  216. package/dist/booleans/useBooleans.js.map +1 -0
  217. package/dist/booleans/useBooleansAdapter.js +11 -0
  218. package/dist/booleans/useBooleansAdapter.js.map +1 -0
  219. package/dist/chrome/affordances/cornerResize.js +123 -0
  220. package/dist/chrome/affordances/cornerResize.js.map +1 -0
  221. package/dist/chrome/affordances/rotateCursor.js +17 -0
  222. package/dist/chrome/affordances/rotateCursor.js.map +1 -0
  223. package/dist/chrome/affordances/rotationHandle.js +117 -0
  224. package/dist/chrome/affordances/rotationHandle.js.map +1 -0
  225. package/dist/chrome/handleCommands.js +110 -0
  226. package/dist/chrome/handleCommands.js.map +1 -0
  227. package/dist/chrome/overlay.js +271 -0
  228. package/dist/chrome/overlay.js.map +1 -0
  229. package/dist/chrome/rotationBadge.js +132 -0
  230. package/dist/chrome/rotationBadge.js.map +1 -0
  231. package/dist/chrome/rotationHandleGeometry.js +49 -0
  232. package/dist/chrome/rotationHandleGeometry.js.map +1 -0
  233. package/dist/chrome/selectionChrome.js +25 -0
  234. package/dist/chrome/selectionChrome.js.map +1 -0
  235. package/dist/chrome/selectionPose.js +112 -0
  236. package/dist/chrome/selectionPose.js.map +1 -0
  237. package/dist/chrome/shapeOutline.js +137 -0
  238. package/dist/chrome/shapeOutline.js.map +1 -0
  239. package/dist/clipboard/clipboardOps.js +48 -0
  240. package/dist/clipboard/clipboardOps.js.map +1 -0
  241. package/dist/clipboard/materializePaste.js +34 -0
  242. package/dist/clipboard/materializePaste.js.map +1 -0
  243. package/dist/clipboard/osClipboard.js +67 -0
  244. package/dist/clipboard/osClipboard.js.map +1 -0
  245. package/dist/clipboard/useClipboard.js +64 -0
  246. package/dist/clipboard/useClipboard.js.map +1 -0
  247. package/dist/clipboard/wireFormat.js +108 -0
  248. package/dist/clipboard/wireFormat.js.map +1 -0
  249. package/dist/deps/areaSelect.js +42 -0
  250. package/dist/deps/areaSelect.js.map +1 -0
  251. package/dist/deps/booleans.js +99 -0
  252. package/dist/deps/booleans.js.map +1 -0
  253. package/dist/deps/insert.js +260 -0
  254. package/dist/deps/insert.js.map +1 -0
  255. package/dist/deps/lassoSelect.js +37 -0
  256. package/dist/deps/lassoSelect.js.map +1 -0
  257. package/dist/deps/presetDeps.js +40 -0
  258. package/dist/deps/presetDeps.js.map +1 -0
  259. package/dist/deps/resizePolicy.js +41 -0
  260. package/dist/deps/resizePolicy.js.map +1 -0
  261. package/dist/engine-BV9RDHOL.d.ts +339 -0
  262. package/dist/engine.d.ts +6 -0
  263. package/dist/engine.js +10 -0
  264. package/dist/engineStandardActions.js +54 -0
  265. package/dist/engineStandardActions.js.map +1 -0
  266. package/dist/groups.d.ts +27 -0
  267. package/dist/groups.js +4 -0
  268. package/dist/icons.gen.js +8 -0
  269. package/dist/icons.gen.js.map +1 -0
  270. package/dist/icons.table.d.ts +6 -0
  271. package/dist/icons.table.js +8 -0
  272. package/dist/icons.table.js.map +1 -0
  273. package/dist/icons.table.json +156 -0
  274. package/dist/icons2.table.js +163 -0
  275. package/dist/icons2.table.js.map +1 -0
  276. package/dist/index.d.ts +1867 -0
  277. package/dist/index.js +86 -0
  278. package/dist/ingest/ghost.js +58 -0
  279. package/dist/ingest/ghost.js.map +1 -0
  280. package/dist/ingest/imageHandler.js +80 -0
  281. package/dist/ingest/imageHandler.js.map +1 -0
  282. package/dist/ingest/kitHandlers.js +15 -0
  283. package/dist/ingest/kitHandlers.js.map +1 -0
  284. package/dist/ingest/svgHandler.js +97 -0
  285. package/dist/ingest/svgHandler.js.map +1 -0
  286. package/dist/ingest/weaselJsonHandler.js +68 -0
  287. package/dist/ingest/weaselJsonHandler.js.map +1 -0
  288. package/dist/namedPresets.js +83 -0
  289. package/dist/namedPresets.js.map +1 -0
  290. package/dist/presets/arrange.js +65 -0
  291. package/dist/presets/arrange.js.map +1 -0
  292. package/dist/presets/booleans.js +13 -0
  293. package/dist/presets/booleans.js.map +1 -0
  294. package/dist/presets/composites.js +46 -0
  295. package/dist/presets/composites.js.map +1 -0
  296. package/dist/presets/edit.js +125 -0
  297. package/dist/presets/edit.js.map +1 -0
  298. package/dist/presets/ingest.js +17 -0
  299. package/dist/presets/ingest.js.map +1 -0
  300. package/dist/presets/insert.js +28 -0
  301. package/dist/presets/insert.js.map +1 -0
  302. package/dist/presets/pathfinder.js +26 -0
  303. package/dist/presets/pathfinder.js.map +1 -0
  304. package/dist/presets/select.js +31 -0
  305. package/dist/presets/select.js.map +1 -0
  306. package/dist/presets/selection.js +13 -0
  307. package/dist/presets/selection.js.map +1 -0
  308. package/dist/presets/selectionChrome.js +15 -0
  309. package/dist/presets/selectionChrome.js.map +1 -0
  310. package/dist/presets/tools.js +84 -0
  311. package/dist/presets/tools.js.map +1 -0
  312. package/dist/presets/transform.js +52 -0
  313. package/dist/presets/transform.js.map +1 -0
  314. package/dist/presets.d.ts +104 -0
  315. package/dist/presets.js +15 -0
  316. package/dist/selection/useSelection.js +127 -0
  317. package/dist/selection/useSelection.js.map +1 -0
  318. package/dist/test-seams.d.ts +50 -0
  319. package/dist/test-seams.js +4 -0
  320. package/dist/tools/ellipse/useEllipseTool.js +72 -0
  321. package/dist/tools/ellipse/useEllipseTool.js.map +1 -0
  322. package/dist/tools/eyedropper/useEyedropperTool.js +100 -0
  323. package/dist/tools/eyedropper/useEyedropperTool.js.map +1 -0
  324. package/dist/tools/image/useImageTool.js +57 -0
  325. package/dist/tools/image/useImageTool.js.map +1 -0
  326. package/dist/tools/lasso/useLassoTool.js +96 -0
  327. package/dist/tools/lasso/useLassoTool.js.map +1 -0
  328. package/dist/tools/line/useLineTool.js +67 -0
  329. package/dist/tools/line/useLineTool.js.map +1 -0
  330. package/dist/tools/polygon/usePolygonTool.js +149 -0
  331. package/dist/tools/polygon/usePolygonTool.js.map +1 -0
  332. package/dist/tools/rect/useRectTool.js +74 -0
  333. package/dist/tools/rect/useRectTool.js.map +1 -0
  334. package/dist/tools/select/adapterPointQuery.js +56 -0
  335. package/dist/tools/select/adapterPointQuery.js.map +1 -0
  336. package/dist/tools/select/collapseDeferred.js +35 -0
  337. package/dist/tools/select/collapseDeferred.js.map +1 -0
  338. package/dist/tools/select/extendPressLocked.js +17 -0
  339. package/dist/tools/select/extendPressLocked.js.map +1 -0
  340. package/dist/tools/select/groupEntry.js +73 -0
  341. package/dist/tools/select/groupEntry.js.map +1 -0
  342. package/dist/tools/select/pressDecision.js +39 -0
  343. package/dist/tools/select/pressDecision.js.map +1 -0
  344. package/dist/tools/select/selectDeep.js +39 -0
  345. package/dist/tools/select/selectDeep.js.map +1 -0
  346. package/dist/tools/select/selectPick.js +60 -0
  347. package/dist/tools/select/selectPick.js.map +1 -0
  348. package/dist/tools/select/selectionContributions.js +191 -0
  349. package/dist/tools/select/selectionContributions.js.map +1 -0
  350. package/dist/tools/select/usePickerSelectTool.js +145 -0
  351. package/dist/tools/select/usePickerSelectTool.js.map +1 -0
  352. package/dist/tools/select/useSelectTool.js +54 -0
  353. package/dist/tools/select/useSelectTool.js.map +1 -0
  354. package/dist/tools/shared/countOption.js +24 -0
  355. package/dist/tools/shared/countOption.js.map +1 -0
  356. package/dist/tools/shared/insertToolOptions.js +8 -0
  357. package/dist/tools/shared/insertToolOptions.js.map +1 -0
  358. package/dist/tools/shared/pointerFollower.js +23 -0
  359. package/dist/tools/shared/pointerFollower.js.map +1 -0
  360. package/dist/tools/shared/styleOptions.js +76 -0
  361. package/dist/tools/shared/styleOptions.js.map +1 -0
  362. package/dist/tools/star/useStarTool.js +149 -0
  363. package/dist/tools/star/useStarTool.js.map +1 -0
  364. package/dist/tools/toolSets.js +26 -0
  365. package/dist/tools/toolSets.js.map +1 -0
  366. package/dist/useStandardActions.js +26 -0
  367. package/dist/useStandardActions.js.map +1 -0
  368. package/package.json +87 -4
@@ -0,0 +1,65 @@
1
+ import { alignBottomAction, alignCenterXAction, alignCenterYAction, alignLeftAction, alignRightAction, alignTopAction } from "../actions/align/action.js";
2
+ import { reorderBackwardAction, reorderForwardAction } from "../actions/reorder/reorder.js";
3
+ import { distributeHorizontalAction, distributeVerticalAction } from "../actions/distribute/action.js";
4
+ import { flipAction } from "../actions/flip/action.js";
5
+ import { swapAction } from "../actions/swap/action.js";
6
+ import { selectionPreset } from "./selection.js";
7
+
8
+ // src/presets/arrange.ts
9
+ /** Flipping the selection. */
10
+ var flipPreset = {
11
+ id: "flip",
12
+ label: "Flip",
13
+ actions: [flipAction],
14
+ includes: [selectionPreset]
15
+ };
16
+ /** Bringing forward and sending backward. */
17
+ var reorderPreset = {
18
+ id: "reorder",
19
+ label: "Reorder",
20
+ actions: [reorderForwardAction, reorderBackwardAction],
21
+ includes: [selectionPreset]
22
+ };
23
+ /** Trading two selected nodes' places. */
24
+ var swapPreset = {
25
+ id: "swap",
26
+ label: "Swap",
27
+ actions: [swapAction],
28
+ includes: [selectionPreset]
29
+ };
30
+ /** Aligning edges and centers. */
31
+ var alignPreset = {
32
+ id: "align",
33
+ label: "Align",
34
+ actions: [
35
+ alignLeftAction,
36
+ alignCenterXAction,
37
+ alignRightAction,
38
+ alignTopAction,
39
+ alignCenterYAction,
40
+ alignBottomAction
41
+ ],
42
+ includes: [selectionPreset]
43
+ };
44
+ /** Distributing across or down. */
45
+ var distributePreset = {
46
+ id: "distribute",
47
+ label: "Distribute",
48
+ actions: [distributeHorizontalAction, distributeVerticalAction],
49
+ includes: [selectionPreset]
50
+ };
51
+ /** Align, distribute, reorder, flip, and swap. */
52
+ var arrangePreset = {
53
+ id: "arrange",
54
+ label: "Arrange",
55
+ includes: [
56
+ flipPreset,
57
+ reorderPreset,
58
+ alignPreset,
59
+ distributePreset,
60
+ swapPreset
61
+ ]
62
+ };
63
+
64
+ export { alignPreset, arrangePreset, distributePreset, flipPreset, reorderPreset, swapPreset };
65
+ //# sourceMappingURL=arrange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrange.js","names":[],"sources":["../../src/presets/arrange.ts"],"sourcesContent":["import {\n alignBottomAction, alignCenterXAction, alignCenterYAction, alignLeftAction, alignRightAction, alignTopAction,\n} from '../actions/align/action';\nimport { reorderBackwardAction, reorderForwardAction } from '../actions/reorder/reorder';\nimport { distributeHorizontalAction, distributeVerticalAction } from '../actions/distribute/action';\nimport { flipAction } from '../actions/flip/action';\nimport { swapAction } from '../actions/swap/action';\nimport type { FeaturePreset } from '@weasel-js/core';\nimport { selectionPreset } from './selection';\n\n/** Flipping the selection. */\nexport const flipPreset: FeaturePreset = { id: 'flip', label: 'Flip', actions: [flipAction], includes: [selectionPreset] };\n/** Bringing forward and sending backward. */\nexport const reorderPreset: FeaturePreset = {\n id: 'reorder', label: 'Reorder', actions: [reorderForwardAction, reorderBackwardAction],\n includes: [selectionPreset],\n};\n/** Trading two selected nodes' places. */\nexport const swapPreset: FeaturePreset = { id: 'swap', label: 'Swap', actions: [swapAction], includes: [selectionPreset] };\n/** Aligning edges and centers. */\nexport const alignPreset: FeaturePreset = {\n id: 'align',\n label: 'Align',\n actions: [alignLeftAction, alignCenterXAction, alignRightAction, alignTopAction, alignCenterYAction, alignBottomAction],\n includes: [selectionPreset],\n};\n/** Distributing across or down. */\nexport const distributePreset: FeaturePreset = {\n id: 'distribute', label: 'Distribute', actions: [distributeHorizontalAction, distributeVerticalAction],\n includes: [selectionPreset],\n};\n\n/** Align, distribute, reorder, flip, and swap. */\nexport const arrangePreset: FeaturePreset = {\n id: 'arrange',\n label: 'Arrange',\n includes: [flipPreset, reorderPreset, alignPreset, distributePreset, swapPreset],\n};\n"],"mappings":";;;;;;;;;AAWA,IAAa,aAA4B;CAAE,IAAI;CAAQ,OAAO;CAAQ,SAAS,CAAC,UAAU;CAAG,UAAU,CAAC,eAAe;AAAE;;AAEzH,IAAa,gBAA+B;CAC1C,IAAI;CAAW,OAAO;CAAW,SAAS,CAAC,sBAAsB,qBAAqB;CACtF,UAAU,CAAC,eAAe;AAC5B;;AAEA,IAAa,aAA4B;CAAE,IAAI;CAAQ,OAAO;CAAQ,SAAS,CAAC,UAAU;CAAG,UAAU,CAAC,eAAe;AAAE;;AAEzH,IAAa,cAA6B;CACxC,IAAI;CACJ,OAAO;CACP,SAAS;EAAC;EAAiB;EAAoB;EAAkB;EAAgB;EAAoB;CAAiB;CACtH,UAAU,CAAC,eAAe;AAC5B;;AAEA,IAAa,mBAAkC;CAC7C,IAAI;CAAc,OAAO;CAAc,SAAS,CAAC,4BAA4B,wBAAwB;CACrG,UAAU,CAAC,eAAe;AAC5B;;AAGA,IAAa,gBAA+B;CAC1C,IAAI;CACJ,OAAO;CACP,UAAU;EAAC;EAAY;EAAe;EAAa;EAAkB;CAAU;AACjF"}
@@ -0,0 +1,13 @@
1
+ import { BooleansDeps } from "../deps/presetDeps.js";
2
+
3
+ // src/presets/booleans.ts
4
+ /** The `booleansAdapter` dep over the canvas's path leaves, which the Pathfinder actions and `@weasel-js/path-tools`'
5
+ * shape builder work through. `pathfinderPreset` includes it. */
6
+ var booleansPreset = {
7
+ id: "booleans",
8
+ label: "Booleans",
9
+ components: [BooleansDeps]
10
+ };
11
+
12
+ export { booleansPreset };
13
+ //# sourceMappingURL=booleans.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"booleans.js","names":[],"sources":["../../src/presets/booleans.ts"],"sourcesContent":["import type { FeaturePreset } from '@weasel-js/core';\nimport { BooleansDeps } from '../deps/presetDeps';\n\n/** The `booleansAdapter` dep over the canvas's path leaves, which the Pathfinder actions and `@weasel-js/path-tools`'\n * shape builder work through. `pathfinderPreset` includes it. */\nexport const booleansPreset: FeaturePreset = {\n id: 'booleans',\n label: 'Booleans',\n components: [BooleansDeps],\n};\n"],"mappings":";;;;;AAKA,IAAa,iBAAgC;CAC3C,IAAI;CACJ,OAAO;CACP,YAAY,CAAC,YAAY;AAC3B"}
@@ -0,0 +1,46 @@
1
+ import { arrangePreset } from "./arrange.js";
2
+ import { editPreset } from "./edit.js";
3
+ import { ingestPreset } from "./ingest.js";
4
+ import { pathfinderPreset } from "./pathfinder.js";
5
+ import { selectPreset } from "./select.js";
6
+ import { selectToolsOfferedPreset, shapeToolsOfferedPreset } from "./tools.js";
7
+ import { movePreset, outlinePreset, resizePreset, rotatePreset } from "./transform.js";
8
+ import * as corePresets from "@weasel-js/core/presets";
9
+
10
+ // src/presets/composites.ts
11
+ /** Select, and the selection's outline. */
12
+ var pickPreset = {
13
+ id: "pick",
14
+ label: "Pick",
15
+ includes: [selectPreset, outlinePreset]
16
+ };
17
+ /** Resize and rotate handles. */
18
+ var transformPreset = {
19
+ id: "transform",
20
+ label: "Transform",
21
+ includes: [resizePreset, rotatePreset]
22
+ };
23
+ /** Every kit behavior: view, pick, transform, move, edit, arrange, the pathfinder, and ingest. Tools that make
24
+ * things are offered and left to the canvas to mount, through `shapeToolsPreset` or `defaultTools`; path editing
25
+ * is `@weasel-js/path-tools`'. */
26
+ var drawPreset = {
27
+ id: "draw",
28
+ label: "Draw",
29
+ includes: [
30
+ corePresets.view,
31
+ selectPreset,
32
+ outlinePreset,
33
+ resizePreset,
34
+ rotatePreset,
35
+ movePreset,
36
+ editPreset,
37
+ arrangePreset,
38
+ pathfinderPreset,
39
+ ingestPreset,
40
+ selectToolsOfferedPreset,
41
+ shapeToolsOfferedPreset
42
+ ]
43
+ };
44
+
45
+ export { drawPreset, pickPreset, transformPreset };
46
+ //# sourceMappingURL=composites.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composites.js","names":[],"sources":["../../src/presets/composites.ts"],"sourcesContent":["import type { FeaturePreset } from '@weasel-js/core';\nimport { arrangePreset } from './arrange';\nimport { editPreset } from './edit';\nimport { ingestPreset } from './ingest';\nimport { pathfinderPreset } from './pathfinder';\nimport { selectPreset } from './select';\nimport { selectToolsOfferedPreset, shapeToolsOfferedPreset } from './tools';\nimport { movePreset, outlinePreset, resizePreset, rotatePreset } from './transform';\nimport * as corePresets from '@weasel-js/core/presets';\n\n/** Select, and the selection's outline. */\nexport const pickPreset: FeaturePreset = { id: 'pick', label: 'Pick', includes: [selectPreset, outlinePreset] };\n\n/** Resize and rotate handles. */\nexport const transformPreset: FeaturePreset = { id: 'transform', label: 'Transform', includes: [resizePreset, rotatePreset] };\n\n/** Every kit behavior: view, pick, transform, move, edit, arrange, the pathfinder, and ingest. Tools that make\n * things are offered and left to the canvas to mount, through `shapeToolsPreset` or `defaultTools`; path editing\n * is `@weasel-js/path-tools`'. */\nexport const drawPreset: FeaturePreset = {\n id: 'draw',\n label: 'Draw',\n includes: [\n corePresets.view, selectPreset, outlinePreset, resizePreset, rotatePreset, movePreset, editPreset, arrangePreset,\n pathfinderPreset, ingestPreset, selectToolsOfferedPreset, shapeToolsOfferedPreset,\n ],\n};\n"],"mappings":";;;;;;;;;;;AAWA,IAAa,aAA4B;CAAE,IAAI;CAAQ,OAAO;CAAQ,UAAU,CAAC,cAAc,aAAa;AAAE;;AAG9G,IAAa,kBAAiC;CAAE,IAAI;CAAa,OAAO;CAAa,UAAU,CAAC,cAAc,YAAY;AAAE;;;;AAK5H,IAAa,aAA4B;CACvC,IAAI;CACJ,OAAO;CACP,UAAU;EACR,YAAY;EAAM;EAAc;EAAe;EAAc;EAAc;EAAY;EAAY;EACnG;EAAkB;EAAc;EAA0B;CAC5D;AACF"}
@@ -0,0 +1,125 @@
1
+ import { duplicateAction } from "../actions/edit/duplicate.js";
2
+ import { deselectAction } from "../actions/edit/deselect.js";
3
+ import { groupAction, ungroupAction } from "../actions/edit/group.js";
4
+ import { selectAllAction } from "../actions/edit/selectAll.js";
5
+ import { setFillAction } from "../actions/edit/setFill.js";
6
+ import { setFillOpacityAction } from "../actions/edit/setFillOpacity.js";
7
+ import { setStrokeAction } from "../actions/edit/setStroke.js";
8
+ import { setStrokeOpacityAction } from "../actions/edit/setStrokeOpacity.js";
9
+ import { setStrokeWidthAction } from "../actions/edit/setStrokeWidth.js";
10
+ import { setVertexColorAction } from "../actions/edit/setVertexColor.js";
11
+ import { transformAgainAction } from "../actions/transformAgain/action.js";
12
+ import { nudgeDownAction, nudgeLeftAction, nudgeRightAction, nudgeUpAction } from "../actions/edit/nudge.js";
13
+ import { insertPreset } from "./insert.js";
14
+ import { clipboardCopyAction, clipboardCutAction, clipboardPasteAction, clipboardPasteCopiedAction } from "../actions/clipboard/action.js";
15
+ import { selectionPreset } from "./selection.js";
16
+ import { deleteAction } from "../actions/delete/delete.js";
17
+ import { cancelAllAction, contextMenuAction } from "@weasel-js/core";
18
+
19
+ // src/presets/edit.ts
20
+ /** Escape, and canceling the gesture in flight. */
21
+ var escapePreset = {
22
+ id: "escape",
23
+ label: "Escape",
24
+ actions: [deselectAction, cancelAllAction],
25
+ includes: [selectionPreset]
26
+ };
27
+ /** The context menu. */
28
+ var contextMenuPreset = {
29
+ id: "contextMenu",
30
+ label: "Context menu",
31
+ actions: [contextMenuAction],
32
+ includes: [selectionPreset]
33
+ };
34
+ /** Cmd/Ctrl+A. */
35
+ var selectAllPreset = {
36
+ id: "selectAll",
37
+ label: "Select all",
38
+ actions: [selectAllAction],
39
+ includes: [selectionPreset]
40
+ };
41
+ /** Duplicate, and repeating the last transform. */
42
+ var duplicatePreset = {
43
+ id: "duplicate",
44
+ label: "Duplicate",
45
+ actions: [duplicateAction, transformAgainAction],
46
+ includes: [selectionPreset]
47
+ };
48
+ /** Deleting the selection. */
49
+ var deletePreset = {
50
+ id: "delete",
51
+ label: "Delete",
52
+ actions: [deleteAction],
53
+ includes: [selectionPreset]
54
+ };
55
+ /** Group and ungroup. */
56
+ var groupPreset = {
57
+ id: "group",
58
+ label: "Group",
59
+ actions: [groupAction, ungroupAction],
60
+ includes: [selectionPreset]
61
+ };
62
+ /** The arrow keys. */
63
+ var nudgePreset = {
64
+ id: "nudge",
65
+ label: "Nudge",
66
+ actions: [
67
+ nudgeUpAction,
68
+ nudgeDownAction,
69
+ nudgeLeftAction,
70
+ nudgeRightAction
71
+ ],
72
+ includes: [selectionPreset]
73
+ };
74
+ /** Fill and stroke, their opacities, the stroke's width, and a path's vertex colors. */
75
+ var stylePreset = {
76
+ id: "style",
77
+ label: "Style",
78
+ actions: [
79
+ setFillAction,
80
+ setStrokeAction,
81
+ setFillOpacityAction,
82
+ setStrokeOpacityAction,
83
+ setStrokeWidthAction,
84
+ setVertexColorAction
85
+ ],
86
+ includes: [selectionPreset]
87
+ };
88
+ /**
89
+ * Cut, copy, and paste.
90
+ *
91
+ * Cmd/Ctrl+V arrives as a DOM `paste` event, and two presets answer it. This
92
+ * one brings `clipboard.pasteEvent`, which pastes nodes a kit canvas copied
93
+ * and nothing else; `ingest` takes those plus images, SVG, files, and every
94
+ * OS drop. With both on, `ingest` answers alone.
95
+ */
96
+ var clipboardPreset = {
97
+ id: "clipboard",
98
+ label: "Clipboard",
99
+ actions: [
100
+ clipboardCutAction,
101
+ clipboardCopyAction,
102
+ clipboardPasteAction,
103
+ clipboardPasteCopiedAction
104
+ ],
105
+ includes: [insertPreset]
106
+ };
107
+ /** Every edit preset above, and their keys. */
108
+ var editPreset = {
109
+ id: "edit",
110
+ label: "Edit",
111
+ includes: [
112
+ escapePreset,
113
+ contextMenuPreset,
114
+ selectAllPreset,
115
+ duplicatePreset,
116
+ deletePreset,
117
+ groupPreset,
118
+ nudgePreset,
119
+ stylePreset,
120
+ clipboardPreset
121
+ ]
122
+ };
123
+
124
+ export { clipboardPreset, contextMenuPreset, deletePreset, duplicatePreset, editPreset, escapePreset, groupPreset, nudgePreset, selectAllPreset, stylePreset };
125
+ //# sourceMappingURL=edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.js","names":[],"sources":["../../src/presets/edit.ts"],"sourcesContent":["import { cancelAllAction, contextMenuAction } from '@weasel-js/core';\nimport type { FeaturePreset } from '@weasel-js/core';\nimport { duplicateAction } from '../actions/edit/duplicate';\nimport { deselectAction } from '../actions/edit/deselect';\nimport { groupAction, ungroupAction } from '../actions/edit/group';\nimport { selectAllAction } from '../actions/edit/selectAll';\nimport { setFillAction } from '../actions/edit/setFill';\nimport { setFillOpacityAction } from '../actions/edit/setFillOpacity';\nimport { setStrokeAction } from '../actions/edit/setStroke';\nimport { setStrokeOpacityAction } from '../actions/edit/setStrokeOpacity';\nimport { setStrokeWidthAction } from '../actions/edit/setStrokeWidth';\nimport { setVertexColorAction } from '../actions/edit/setVertexColor';\nimport { transformAgainAction } from '../actions/transformAgain/action';\nimport { nudgeDownAction, nudgeLeftAction, nudgeRightAction, nudgeUpAction } from '../actions/edit/nudge';\nimport { insertPreset } from './insert';\nimport { clipboardCopyAction, clipboardCutAction, clipboardPasteAction, clipboardPasteCopiedAction } from '../actions/clipboard/action';\nimport { selectionPreset } from './selection';\nimport { deleteAction } from '../actions/delete/delete';\n\n/** Escape, and canceling the gesture in flight. */\nexport const escapePreset: FeaturePreset = { id: 'escape', label: 'Escape', actions: [deselectAction, cancelAllAction], includes: [selectionPreset] };\n/** The context menu. */\nexport const contextMenuPreset: FeaturePreset = { id: 'contextMenu', label: 'Context menu', actions: [contextMenuAction], includes: [selectionPreset] };\n/** Cmd/Ctrl+A. */\nexport const selectAllPreset: FeaturePreset = { id: 'selectAll', label: 'Select all', actions: [selectAllAction], includes: [selectionPreset] };\n/** Duplicate, and repeating the last transform. */\nexport const duplicatePreset: FeaturePreset = { id: 'duplicate', label: 'Duplicate', actions: [duplicateAction, transformAgainAction], includes: [selectionPreset] };\n/** Deleting the selection. */\nexport const deletePreset: FeaturePreset = { id: 'delete', label: 'Delete', actions: [deleteAction], includes: [selectionPreset] };\n/** Group and ungroup. */\nexport const groupPreset: FeaturePreset = { id: 'group', label: 'Group', actions: [groupAction, ungroupAction], includes: [selectionPreset] };\n/** The arrow keys. */\nexport const nudgePreset: FeaturePreset = {\n id: 'nudge', label: 'Nudge', actions: [nudgeUpAction, nudgeDownAction, nudgeLeftAction, nudgeRightAction],\n includes: [selectionPreset],\n};\n/** Fill and stroke, their opacities, the stroke's width, and a path's vertex colors. */\nexport const stylePreset: FeaturePreset = {\n id: 'style',\n label: 'Style',\n actions: [\n setFillAction, setStrokeAction, setFillOpacityAction, setStrokeOpacityAction, setStrokeWidthAction, setVertexColorAction,\n ],\n includes: [selectionPreset],\n};\n\n/**\n * Cut, copy, and paste.\n *\n * Cmd/Ctrl+V arrives as a DOM `paste` event, and two presets answer it. This\n * one brings `clipboard.pasteEvent`, which pastes nodes a kit canvas copied\n * and nothing else; `ingest` takes those plus images, SVG, files, and every\n * OS drop. With both on, `ingest` answers alone.\n */\nexport const clipboardPreset: FeaturePreset = {\n id: 'clipboard',\n label: 'Clipboard',\n actions: [clipboardCutAction, clipboardCopyAction, clipboardPasteAction, clipboardPasteCopiedAction],\n includes: [insertPreset],\n};\n\n/** Every edit preset above, and their keys. */\nexport const editPreset: FeaturePreset = {\n id: 'edit',\n label: 'Edit',\n includes: [\n escapePreset, contextMenuPreset, selectAllPreset, duplicatePreset, deletePreset, groupPreset, nudgePreset,\n stylePreset, clipboardPreset,\n ],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,eAA8B;CAAE,IAAI;CAAU,OAAO;CAAU,SAAS,CAAC,gBAAgB,eAAe;CAAG,UAAU,CAAC,eAAe;AAAE;;AAEpJ,IAAa,oBAAmC;CAAE,IAAI;CAAe,OAAO;CAAgB,SAAS,CAAC,iBAAiB;CAAG,UAAU,CAAC,eAAe;AAAE;;AAEtJ,IAAa,kBAAiC;CAAE,IAAI;CAAa,OAAO;CAAc,SAAS,CAAC,eAAe;CAAG,UAAU,CAAC,eAAe;AAAE;;AAE9I,IAAa,kBAAiC;CAAE,IAAI;CAAa,OAAO;CAAa,SAAS,CAAC,iBAAiB,oBAAoB;CAAG,UAAU,CAAC,eAAe;AAAE;;AAEnK,IAAa,eAA8B;CAAE,IAAI;CAAU,OAAO;CAAU,SAAS,CAAC,YAAY;CAAG,UAAU,CAAC,eAAe;AAAE;;AAEjI,IAAa,cAA6B;CAAE,IAAI;CAAS,OAAO;CAAS,SAAS,CAAC,aAAa,aAAa;CAAG,UAAU,CAAC,eAAe;AAAE;;AAE5I,IAAa,cAA6B;CACxC,IAAI;CAAS,OAAO;CAAS,SAAS;EAAC;EAAe;EAAiB;EAAiB;CAAgB;CACxG,UAAU,CAAC,eAAe;AAC5B;;AAEA,IAAa,cAA6B;CACxC,IAAI;CACJ,OAAO;CACP,SAAS;EACP;EAAe;EAAiB;EAAsB;EAAwB;EAAsB;CACtG;CACA,UAAU,CAAC,eAAe;AAC5B;;;;;;;;;AAUA,IAAa,kBAAiC;CAC5C,IAAI;CACJ,OAAO;CACP,SAAS;EAAC;EAAoB;EAAqB;EAAsB;CAA0B;CACnG,UAAU,CAAC,YAAY;AACzB;;AAGA,IAAa,aAA4B;CACvC,IAAI;CACJ,OAAO;CACP,UAAU;EACR;EAAc;EAAmB;EAAiB;EAAiB;EAAc;EAAa;EAC9F;EAAa;CACf;AACF"}
@@ -0,0 +1,17 @@
1
+ import { ingestAction } from "../actions/edit/ingest.js";
2
+ import { KIT_CONTENT_HANDLERS } from "../ingest/kitHandlers.js";
3
+ import { insertPreset } from "./insert.js";
4
+
5
+ // src/presets/ingest.ts
6
+ /** Dropped and pasted content: images, SVG, copied nodes and whatever `ingestion.handlers` accept, on Cmd/Ctrl+V
7
+ * or an OS drop, inserted through `insertPreset`'s dep. It brings the kit's content handlers. */
8
+ var ingestPreset = {
9
+ id: "ingest",
10
+ label: "Ingest",
11
+ actions: [ingestAction],
12
+ contentHandlers: KIT_CONTENT_HANDLERS,
13
+ includes: [insertPreset]
14
+ };
15
+
16
+ export { ingestPreset };
17
+ //# sourceMappingURL=ingest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ingest.js","names":[],"sources":["../../src/presets/ingest.ts"],"sourcesContent":["import type { FeaturePreset } from '@weasel-js/core';\nimport { ingestAction } from '../actions/edit/ingest';\nimport { KIT_CONTENT_HANDLERS } from '../ingest/kitHandlers';\nimport { insertPreset } from './insert';\n\n/** Dropped and pasted content: images, SVG, copied nodes and whatever `ingestion.handlers` accept, on Cmd/Ctrl+V\n * or an OS drop, inserted through `insertPreset`'s dep. It brings the kit's content handlers. */\nexport const ingestPreset: FeaturePreset = {\n id: 'ingest',\n label: 'Ingest',\n actions: [ingestAction],\n contentHandlers: KIT_CONTENT_HANDLERS,\n includes: [insertPreset],\n};\n"],"mappings":";;;;;;;AAOA,IAAa,eAA8B;CACzC,IAAI;CACJ,OAAO;CACP,SAAS,CAAC,YAAY;CACtB,iBAAiB;CACjB,UAAU,CAAC,YAAY;AACzB"}
@@ -0,0 +1,28 @@
1
+ import { insertAction } from "../actions/insert/action.js";
2
+ import { placeAction } from "../actions/insert/placeAction.js";
3
+ import { insertRepositionAction } from "../actions/insert/repositionAction.js";
4
+ import { insertRotateAction } from "../actions/insert/rotateAction.js";
5
+ import { KIT_INSERT_KINDS } from "../deps/insert.js";
6
+ import { InsertDeps } from "../deps/presetDeps.js";
7
+ import { selectionPreset } from "./selection.js";
8
+
9
+ // src/presets/insert.ts
10
+ /** Drag-to-insert and click-to-place: the `insert` dep, and the actions a tool inserting a node binds, each
11
+ * registered once a tool on the canvas binds it. Every tool that makes a node needs it on: the kit's shape tools,
12
+ * `@weasel-js/text-tools`' and `@weasel-js/path-tools`' drawing tools. */
13
+ var insertPreset = {
14
+ id: "insert",
15
+ label: "Insert",
16
+ toolActions: [
17
+ insertAction,
18
+ placeAction,
19
+ insertRotateAction,
20
+ insertRepositionAction
21
+ ],
22
+ insertKinds: KIT_INSERT_KINDS,
23
+ components: [InsertDeps],
24
+ includes: [selectionPreset]
25
+ };
26
+
27
+ export { insertPreset };
28
+ //# sourceMappingURL=insert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert.js","names":[],"sources":["../../src/presets/insert.ts"],"sourcesContent":["import type { FeaturePreset } from '@weasel-js/core';\nimport { insertAction } from '../actions/insert/action';\nimport { placeAction } from '../actions/insert/placeAction';\nimport { insertRepositionAction } from '../actions/insert/repositionAction';\nimport { insertRotateAction } from '../actions/insert/rotateAction';\nimport { KIT_INSERT_KINDS } from '../deps/insert';\nimport { InsertDeps } from '../deps/presetDeps';\nimport { selectionPreset } from './selection';\n\n/** Drag-to-insert and click-to-place: the `insert` dep, and the actions a tool inserting a node binds, each\n * registered once a tool on the canvas binds it. Every tool that makes a node needs it on: the kit's shape tools,\n * `@weasel-js/text-tools`' and `@weasel-js/path-tools`' drawing tools. */\nexport const insertPreset: FeaturePreset = {\n id: 'insert',\n label: 'Insert',\n toolActions: [insertAction, placeAction, insertRotateAction, insertRepositionAction],\n insertKinds: KIT_INSERT_KINDS,\n components: [InsertDeps],\n includes: [selectionPreset],\n};\n"],"mappings":";;;;;;;;;;;;AAYA,IAAa,eAA8B;CACzC,IAAI;CACJ,OAAO;CACP,aAAa;EAAC;EAAc;EAAa;EAAoB;CAAsB;CACnF,aAAa;CACb,YAAY,CAAC,UAAU;CACvB,UAAU,CAAC,eAAe;AAC5B"}
@@ -0,0 +1,26 @@
1
+ import { pathfinderCropAction, pathfinderDivideAction, pathfinderExcludeAction, pathfinderIntersectAction, pathfinderMergeAction, pathfinderSubtractAction, pathfinderTrimAction, pathfinderUnionAction } from "../actions/pathfinder/action.js";
2
+ import { makeBooleanGroupAction } from "../actions/pathfinder/booleanGroupAction.js";
3
+ import { booleansPreset } from "./booleans.js";
4
+ import { selectionPreset } from "./selection.js";
5
+
6
+ // src/presets/pathfinder.ts
7
+ /** The pathfinder booleans, the live boolean group, and the `booleansAdapter` they work through. */
8
+ var pathfinderPreset = {
9
+ id: "pathfinder",
10
+ label: "Pathfinder",
11
+ actions: [
12
+ pathfinderUnionAction,
13
+ pathfinderSubtractAction,
14
+ pathfinderIntersectAction,
15
+ pathfinderExcludeAction,
16
+ pathfinderDivideAction,
17
+ pathfinderCropAction,
18
+ pathfinderTrimAction,
19
+ pathfinderMergeAction,
20
+ makeBooleanGroupAction
21
+ ],
22
+ includes: [selectionPreset, booleansPreset]
23
+ };
24
+
25
+ export { pathfinderPreset };
26
+ //# sourceMappingURL=pathfinder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pathfinder.js","names":[],"sources":["../../src/presets/pathfinder.ts"],"sourcesContent":["import type { FeaturePreset } from '@weasel-js/core';\nimport { pathfinderCropAction, pathfinderDivideAction, pathfinderExcludeAction, pathfinderIntersectAction, pathfinderMergeAction, pathfinderSubtractAction, pathfinderTrimAction, pathfinderUnionAction } from '../actions/pathfinder/action';\nimport { makeBooleanGroupAction } from '../actions/pathfinder/booleanGroupAction';\nimport { booleansPreset } from './booleans';\nimport { selectionPreset } from './selection';\n\n/** The pathfinder booleans, the live boolean group, and the `booleansAdapter` they work through. */\nexport const pathfinderPreset: FeaturePreset = {\n id: 'pathfinder',\n label: 'Pathfinder',\n actions: [\n pathfinderUnionAction, pathfinderSubtractAction, pathfinderIntersectAction, pathfinderExcludeAction,\n pathfinderDivideAction, pathfinderCropAction, pathfinderTrimAction, pathfinderMergeAction,\n makeBooleanGroupAction,\n ],\n includes: [selectionPreset, booleansPreset],\n};\n"],"mappings":";;;;;;;AAOA,IAAa,mBAAkC;CAC7C,IAAI;CACJ,OAAO;CACP,SAAS;EACP;EAAuB;EAA0B;EAA2B;EAC5E;EAAwB;EAAsB;EAAsB;EACpE;CACF;CACA,UAAU,CAAC,iBAAiB,cAAc;AAC5C"}
@@ -0,0 +1,31 @@
1
+ import { createGroupEntryContribution } from "../tools/select/groupEntry.js";
2
+ import { selectToolsPreset } from "./tools.js";
3
+ import { selectionPreset } from "./selection.js";
4
+ import { areaSelectAction } from "../actions/select/areaSelect.js";
5
+ import { clearSelectionAction } from "../actions/select/clearSelection.js";
6
+ import { lassoSelectAction } from "../actions/lassoSelect/action.js";
7
+
8
+ // src/presets/select.ts
9
+ /** The select and lasso tools: click, marquee, lasso, and clearing on an empty click; and entering a group on a
10
+ * double-click and leaving it on Escape. */
11
+ var selectPreset = {
12
+ id: "select",
13
+ label: "Select",
14
+ actions: [
15
+ areaSelectAction,
16
+ lassoSelectAction,
17
+ clearSelectionAction
18
+ ],
19
+ includes: [selectionPreset, selectToolsPreset],
20
+ build: (ctx) => ({ contributions: [createGroupEntryContribution({
21
+ pickHit: (world, viewId) => viewId == null ? ctx.pick.bestIn(world) : ctx.pick.bestIn(world, viewId),
22
+ tree: {
23
+ getParent: (id) => ctx.adapter().getParent(id),
24
+ getNode: (id) => ctx.adapter().getNode(id)
25
+ },
26
+ boxOf: (id) => ctx.pick.boundsOf(id)
27
+ })] })
28
+ };
29
+
30
+ export { selectPreset };
31
+ //# sourceMappingURL=select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.js","names":[],"sources":["../../src/presets/select.ts"],"sourcesContent":["import type { FeaturePreset } from '@weasel-js/core';\nimport { createGroupEntryContribution } from '../tools/select/groupEntry';\nimport { selectToolsPreset } from './tools';\nimport { selectionPreset } from './selection';\nimport { areaSelectAction } from '../actions/select/areaSelect';\nimport { clearSelectionAction } from '../actions/select/clearSelection';\nimport { lassoSelectAction } from '../actions/lassoSelect/action';\n\n/** The select and lasso tools: click, marquee, lasso, and clearing on an empty click; and entering a group on a\n * double-click and leaving it on Escape. */\nexport const selectPreset: FeaturePreset = {\n id: 'select',\n label: 'Select',\n actions: [areaSelectAction, lassoSelectAction, clearSelectionAction],\n includes: [selectionPreset, selectToolsPreset],\n build: (ctx) => ({\n contributions: [createGroupEntryContribution({\n pickHit: (world, viewId) => (viewId == null ? ctx.pick.bestIn(world) : ctx.pick.bestIn(world, viewId)),\n tree: { getParent: (id) => ctx.adapter().getParent(id), getNode: (id) => ctx.adapter().getNode(id) },\n boxOf: (id) => ctx.pick.boundsOf(id),\n })],\n }),\n};\n"],"mappings":";;;;;;;;;;AAUA,IAAa,eAA8B;CACzC,IAAI;CACJ,OAAO;CACP,SAAS;EAAC;EAAkB;EAAmB;CAAoB;CACnE,UAAU,CAAC,iBAAiB,iBAAiB;CAC7C,QAAQ,SAAS,EACf,eAAe,CAAC,6BAA6B;EAC3C,UAAU,OAAO,WAAY,UAAU,OAAO,IAAI,KAAK,OAAO,KAAK,IAAI,IAAI,KAAK,OAAO,OAAO,MAAM;EACpG,MAAM;GAAE,YAAY,OAAO,IAAI,QAAQ,CAAC,CAAC,UAAU,EAAE;GAAG,UAAU,OAAO,IAAI,QAAQ,CAAC,CAAC,QAAQ,EAAE;EAAE;EACnG,QAAQ,OAAO,IAAI,KAAK,SAAS,EAAE;CACrC,CAAC,CAAC,EACJ;AACF"}
@@ -0,0 +1,13 @@
1
+ import { createSelection } from "../selection/useSelection.js";
2
+
3
+ // src/presets/selection.ts
4
+ /** The canvas's selection, answering clicks by `selectionOptions`: what every editing preset that writes the
5
+ * selection includes, so a canvas without it keeps a selection nothing it runs writes. */
6
+ var selectionPreset = {
7
+ id: "selection",
8
+ label: "Selection",
9
+ selection: createSelection
10
+ };
11
+
12
+ export { selectionPreset };
13
+ //# sourceMappingURL=selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.js","names":[],"sources":["../../src/presets/selection.ts"],"sourcesContent":["import type { FeaturePreset } from '@weasel-js/core';\nimport { createSelection } from '../selection/useSelection';\n\n/** The canvas's selection, answering clicks by `selectionOptions`: what every editing preset that writes the\n * selection includes, so a canvas without it keeps a selection nothing it runs writes. */\nexport const selectionPreset: FeaturePreset = { id: 'selection', label: 'Selection', selection: createSelection };\n"],"mappings":";;;;;AAKA,IAAa,kBAAiC;CAAE,IAAI;CAAa,OAAO;CAAa,WAAW;AAAgB"}
@@ -0,0 +1,15 @@
1
+ import { SELECTION_CHROME } from "../chrome/selectionChrome.js";
2
+ import { selectionPreset } from "./selection.js";
3
+
4
+ // src/presets/selectionChrome.ts
5
+ /** The selection chrome, drawn in the `selectionOverlay` slot and grabbed where drawn: what `outlinePreset`,
6
+ * `resizePreset` and `rotatePreset` include, each turning on its own part of it. */
7
+ var selectionChromePreset = {
8
+ id: "selectionChrome",
9
+ label: "Selection chrome",
10
+ selectionChrome: SELECTION_CHROME,
11
+ includes: [selectionPreset]
12
+ };
13
+
14
+ export { selectionChromePreset };
15
+ //# sourceMappingURL=selectionChrome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectionChrome.js","names":[],"sources":["../../src/presets/selectionChrome.ts"],"sourcesContent":["import type { FeaturePreset } from '@weasel-js/core';\nimport { SELECTION_CHROME } from '../chrome/selectionChrome';\nimport { selectionPreset } from './selection';\n\n/** The selection chrome, drawn in the `selectionOverlay` slot and grabbed where drawn: what `outlinePreset`,\n * `resizePreset` and `rotatePreset` include, each turning on its own part of it. */\nexport const selectionChromePreset: FeaturePreset = {\n id: 'selectionChrome',\n label: 'Selection chrome',\n selectionChrome: SELECTION_CHROME,\n includes: [selectionPreset],\n};\n"],"mappings":";;;;;;AAMA,IAAa,wBAAuC;CAClD,IAAI;CACJ,OAAO;CACP,iBAAiB;CACjB,UAAU,CAAC,eAAe;AAC5B"}
@@ -0,0 +1,84 @@
1
+ import { createEllipseTool } from "../tools/ellipse/useEllipseTool.js";
2
+ import { createLassoTool } from "../tools/lasso/useLassoTool.js";
3
+ import { createPickerSelectTool } from "../tools/select/usePickerSelectTool.js";
4
+ import { createLineTool } from "../tools/line/useLineTool.js";
5
+ import { createPolygonTool } from "../tools/polygon/usePolygonTool.js";
6
+ import { createRectTool } from "../tools/rect/useRectTool.js";
7
+ import { createStarTool } from "../tools/star/useStarTool.js";
8
+ import { SELECT_TOOLS, SHAPE_TOOLS } from "../tools/toolSets.js";
9
+ import { areaSelectAction } from "../actions/select/areaSelect.js";
10
+ import { clearSelectionAction } from "../actions/select/clearSelection.js";
11
+ import { lassoSelectAction } from "../actions/lassoSelect/action.js";
12
+ import { RegionSelectDeps } from "../deps/presetDeps.js";
13
+ import { insertPreset } from "./insert.js";
14
+ import { selectionPreset } from "./selection.js";
15
+
16
+ // src/presets/tools.ts
17
+ /** Offers the select tool and the lasso by id, mounted where something names them: `selectToolsPreset`,
18
+ * `defaultTools={['lasso']}`. The select tool picks with the canvas's pickers and its `selectTool` options. */
19
+ var selectToolsOfferedPreset = {
20
+ id: "toolkit:select",
21
+ label: "Selection tools, offered",
22
+ toolActions: [
23
+ areaSelectAction,
24
+ lassoSelectAction,
25
+ clearSelectionAction
26
+ ],
27
+ components: [RegionSelectDeps],
28
+ build: (ctx) => ({ tools: {
29
+ select: createPickerSelectTool(() => ctx.adapter(), () => {
30
+ const { pickBest, extendClickLocked } = ctx.selectTool();
31
+ return {
32
+ pickEvery: ctx.pick.everyIn,
33
+ between: ctx.pick.between,
34
+ ...pickBest ? { pickBest } : {},
35
+ ...extendClickLocked ? { extendClickLocked } : {}
36
+ };
37
+ }),
38
+ lasso: createLassoTool(ctx.toolOptions.lasso ?? {})
39
+ } }),
40
+ includes: [selectionPreset]
41
+ };
42
+ /** Offers the shape tools by id, mounted where something names them: `shapeToolsPreset`, `defaultTools={['rect']}`.
43
+ * `toolOptions.insert` reaches every one. */
44
+ var shapeToolsOfferedPreset = {
45
+ id: "toolkit:shape",
46
+ label: "Shape tools, offered",
47
+ build: (ctx) => {
48
+ const insert = ctx.toolOptions.insert ?? {};
49
+ const onCountChange = () => {
50
+ ctx.requestRedraw();
51
+ };
52
+ return { tools: {
53
+ rect: createRectTool(insert),
54
+ ellipse: createEllipseTool(insert),
55
+ line: createLineTool(insert),
56
+ polygon: createPolygonTool({
57
+ ...insert,
58
+ onCountChange
59
+ }),
60
+ star: createStarTool({
61
+ ...insert,
62
+ onCountChange
63
+ })
64
+ } };
65
+ },
66
+ includes: [insertPreset]
67
+ };
68
+ /** The select tool and the lasso. */
69
+ var selectToolsPreset = {
70
+ id: "tools:select",
71
+ label: "Selection tools",
72
+ tools: [SELECT_TOOLS],
73
+ includes: [selectToolsOfferedPreset]
74
+ };
75
+ /** The tools that drag out a primitive: rect, ellipse, line, polygon, star. */
76
+ var shapeToolsPreset = {
77
+ id: "tools:shape",
78
+ label: "Shape tools",
79
+ tools: [SHAPE_TOOLS],
80
+ includes: [shapeToolsOfferedPreset]
81
+ };
82
+
83
+ export { selectToolsOfferedPreset, selectToolsPreset, shapeToolsOfferedPreset, shapeToolsPreset };
84
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","names":[],"sources":["../../src/presets/tools.ts"],"sourcesContent":["import type { FeaturePreset } from '@weasel-js/core';\nimport { createEllipseTool } from '../tools/ellipse/useEllipseTool';\nimport { createLassoTool } from '../tools/lasso/useLassoTool';\nimport { createPickerSelectTool, type SelectAdapter } from '../tools/select/usePickerSelectTool';\nimport { createLineTool } from '../tools/line/useLineTool';\nimport { createPolygonTool } from '../tools/polygon/usePolygonTool';\nimport { createRectTool } from '../tools/rect/useRectTool';\nimport { createStarTool } from '../tools/star/useStarTool';\nimport { SELECT_TOOLS, SHAPE_TOOLS } from '../tools/toolSets';\nimport type {} from '../tools/toolOptions';\nimport { areaSelectAction } from '../actions/select/areaSelect';\nimport { clearSelectionAction } from '../actions/select/clearSelection';\nimport { lassoSelectAction } from '../actions/lassoSelect/action';\nimport { RegionSelectDeps } from '../deps/presetDeps';\nimport { insertPreset } from './insert';\nimport { selectionPreset } from './selection';\n\n/** Offers the select tool and the lasso by id, mounted where something names them: `selectToolsPreset`,\n * `defaultTools={['lasso']}`. The select tool picks with the canvas's pickers and its `selectTool` options. */\nexport const selectToolsOfferedPreset: FeaturePreset = {\n id: 'toolkit:select',\n label: 'Selection tools, offered',\n toolActions: [areaSelectAction, lassoSelectAction, clearSelectionAction],\n components: [RegionSelectDeps],\n build: (ctx) => ({\n tools: {\n select: createPickerSelectTool(() => ctx.adapter() as unknown as SelectAdapter<{ id: string }, unknown>, () => {\n const { pickBest, extendClickLocked } = ctx.selectTool();\n return {\n pickEvery: ctx.pick.everyIn, between: ctx.pick.between,\n ...(pickBest ? { pickBest } : {}), ...(extendClickLocked ? { extendClickLocked } : {}),\n };\n }),\n lasso: createLassoTool(ctx.toolOptions.lasso ?? {}),\n },\n }),\n includes: [selectionPreset],\n};\n\n/** Offers the shape tools by id, mounted where something names them: `shapeToolsPreset`, `defaultTools={['rect']}`.\n * `toolOptions.insert` reaches every one. */\nexport const shapeToolsOfferedPreset: FeaturePreset = {\n id: 'toolkit:shape',\n label: 'Shape tools, offered',\n build: (ctx) => {\n const insert = ctx.toolOptions.insert ?? {};\n const onCountChange = () => { ctx.requestRedraw(); };\n return {\n tools: {\n rect: createRectTool(insert),\n ellipse: createEllipseTool(insert),\n line: createLineTool(insert),\n polygon: createPolygonTool({ ...insert, onCountChange }),\n star: createStarTool({ ...insert, onCountChange }),\n },\n };\n },\n includes: [insertPreset],\n};\n\n/** The select tool and the lasso. */\nexport const selectToolsPreset: FeaturePreset = {\n id: 'tools:select', label: 'Selection tools', tools: [SELECT_TOOLS], includes: [selectToolsOfferedPreset],\n};\n/** The tools that drag out a primitive: rect, ellipse, line, polygon, star. */\nexport const shapeToolsPreset: FeaturePreset = {\n id: 'tools:shape', label: 'Shape tools', tools: [SHAPE_TOOLS], includes: [shapeToolsOfferedPreset],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,IAAa,2BAA0C;CACrD,IAAI;CACJ,OAAO;CACP,aAAa;EAAC;EAAkB;EAAmB;CAAoB;CACvE,YAAY,CAAC,gBAAgB;CAC7B,QAAQ,SAAS,EACf,OAAO;EACL,QAAQ,6BAA6B,IAAI,QAAQ,SAA8D;GAC7G,MAAM,EAAE,UAAU,sBAAsB,IAAI,WAAW;GACvD,OAAO;IACL,WAAW,IAAI,KAAK;IAAS,SAAS,IAAI,KAAK;IAC/C,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;IAAI,GAAI,oBAAoB,EAAE,kBAAkB,IAAI,CAAC;GACtF;EACF,CAAC;EACD,OAAO,gBAAgB,IAAI,YAAY,SAAS,CAAC,CAAC;CACpD,EACF;CACA,UAAU,CAAC,eAAe;AAC5B;;;AAIA,IAAa,0BAAyC;CACpD,IAAI;CACJ,OAAO;CACP,QAAQ,QAAQ;EACd,MAAM,SAAS,IAAI,YAAY,UAAU,CAAC;EAC1C,MAAM,sBAAsB;GAAE,IAAI,cAAc;EAAG;EACnD,OAAO,EACL,OAAO;GACL,MAAM,eAAe,MAAM;GAC3B,SAAS,kBAAkB,MAAM;GACjC,MAAM,eAAe,MAAM;GAC3B,SAAS,kBAAkB;IAAE,GAAG;IAAQ;GAAc,CAAC;GACvD,MAAM,eAAe;IAAE,GAAG;IAAQ;GAAc,CAAC;EACnD,EACF;CACF;CACA,UAAU,CAAC,YAAY;AACzB;;AAGA,IAAa,oBAAmC;CAC9C,IAAI;CAAgB,OAAO;CAAmB,OAAO,CAAC,YAAY;CAAG,UAAU,CAAC,wBAAwB;AAC1G;;AAEA,IAAa,mBAAkC;CAC7C,IAAI;CAAe,OAAO;CAAe,OAAO,CAAC,WAAW;CAAG,UAAU,CAAC,uBAAuB;AACnG"}
@@ -0,0 +1,52 @@
1
+ import { createSelectionMoveContribution, createSelectionResizeContribution, createSelectionRotateContribution } from "../tools/select/selectionContributions.js";
2
+ import { selectionPreset } from "./selection.js";
3
+ import { selectionChromePreset } from "./selectionChrome.js";
4
+ import { cloneAction } from "../actions/clone/action.js";
5
+ import { moveAction } from "../actions/move/action.js";
6
+ import { resizeAction } from "../actions/resize/action.js";
7
+ import { rotateAction } from "../actions/rotate/action.js";
8
+ import { ResizePolicyDeps } from "../deps/presetDeps.js";
9
+ import { PRESET_CHROME } from "@weasel-js/core";
10
+
11
+ // src/presets/transform.ts
12
+ /** The selection outline, drawn only while this is on. */
13
+ var outlinePreset = {
14
+ id: "outline",
15
+ label: "Outline",
16
+ chrome: PRESET_CHROME.outline,
17
+ includes: [selectionChromePreset]
18
+ };
19
+ /** Resize handles, drawn and bound. A handle sits over the selected body, so
20
+ * it refines `move`, whose binding matches a handle drag too. */
21
+ var resizePreset = {
22
+ id: "resize",
23
+ label: "Resize",
24
+ refines: ["move"],
25
+ actions: [resizeAction],
26
+ components: [ResizePolicyDeps],
27
+ ambient: () => createSelectionResizeContribution(),
28
+ chrome: PRESET_CHROME.resize,
29
+ includes: [selectionChromePreset]
30
+ };
31
+ /** The rotation handle, drawn and bound. It refines `move` as `resize` does. */
32
+ var rotatePreset = {
33
+ id: "rotate",
34
+ label: "Rotate",
35
+ refines: ["move"],
36
+ actions: [rotateAction],
37
+ ambient: ({ rotate }) => createSelectionRotateContribution({ rotate }),
38
+ chrome: PRESET_CHROME.rotate,
39
+ includes: [selectionChromePreset]
40
+ };
41
+ /** Drag a body to move it, Alt-drag to clone it, under any tool that does not
42
+ * claim the drag. */
43
+ var movePreset = {
44
+ id: "move",
45
+ label: "Move",
46
+ actions: [moveAction, cloneAction],
47
+ ambient: ({ move }) => createSelectionMoveContribution({ move }),
48
+ includes: [selectionPreset]
49
+ };
50
+
51
+ export { movePreset, outlinePreset, resizePreset, rotatePreset };
52
+ //# sourceMappingURL=transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.js","names":[],"sources":["../../src/presets/transform.ts"],"sourcesContent":["import { PRESET_CHROME } from '@weasel-js/core';\nimport type { FeaturePreset } from '@weasel-js/core';\nimport { createSelectionMoveContribution, createSelectionResizeContribution, createSelectionRotateContribution } from '../tools/select/selectionContributions';\nimport { selectionPreset } from './selection';\nimport { selectionChromePreset } from './selectionChrome';\nimport { cloneAction } from '../actions/clone/action';\nimport { moveAction } from '../actions/move/action';\nimport { resizeAction } from '../actions/resize/action';\nimport { rotateAction } from '../actions/rotate/action';\nimport { ResizePolicyDeps } from '../deps/presetDeps';\n\n/** The selection outline, drawn only while this is on. */\nexport const outlinePreset: FeaturePreset = {\n id: 'outline',\n label: 'Outline',\n chrome: PRESET_CHROME.outline,\n includes: [selectionChromePreset],\n};\n\n/** Resize handles, drawn and bound. A handle sits over the selected body, so\n * it refines `move`, whose binding matches a handle drag too. */\nexport const resizePreset: FeaturePreset = {\n id: 'resize',\n label: 'Resize',\n refines: ['move'],\n actions: [resizeAction],\n components: [ResizePolicyDeps],\n ambient: () => createSelectionResizeContribution(),\n chrome: PRESET_CHROME.resize,\n includes: [selectionChromePreset],\n};\n\n/** The rotation handle, drawn and bound. It refines `move` as `resize` does. */\nexport const rotatePreset: FeaturePreset = {\n id: 'rotate',\n label: 'Rotate',\n refines: ['move'],\n actions: [rotateAction],\n ambient: ({ rotate }) => createSelectionRotateContribution({ rotate }),\n chrome: PRESET_CHROME.rotate,\n includes: [selectionChromePreset],\n};\n\n/** Drag a body to move it, Alt-drag to clone it, under any tool that does not\n * claim the drag. */\nexport const movePreset: FeaturePreset = {\n id: 'move',\n label: 'Move',\n actions: [moveAction, cloneAction],\n ambient: ({ move }) => createSelectionMoveContribution({ move }),\n includes: [selectionPreset],\n};\n"],"mappings":";;;;;;;;;;;;AAYA,IAAa,gBAA+B;CAC1C,IAAI;CACJ,OAAO;CACP,QAAQ,cAAc;CACtB,UAAU,CAAC,qBAAqB;AAClC;;;AAIA,IAAa,eAA8B;CACzC,IAAI;CACJ,OAAO;CACP,SAAS,CAAC,MAAM;CAChB,SAAS,CAAC,YAAY;CACtB,YAAY,CAAC,gBAAgB;CAC7B,eAAe,kCAAkC;CACjD,QAAQ,cAAc;CACtB,UAAU,CAAC,qBAAqB;AAClC;;AAGA,IAAa,eAA8B;CACzC,IAAI;CACJ,OAAO;CACP,SAAS,CAAC,MAAM;CAChB,SAAS,CAAC,YAAY;CACtB,UAAU,EAAE,aAAa,kCAAkC,EAAE,OAAO,CAAC;CACrE,QAAQ,cAAc;CACtB,UAAU,CAAC,qBAAqB;AAClC;;;AAIA,IAAa,aAA4B;CACvC,IAAI;CACJ,OAAO;CACP,SAAS,CAAC,YAAY,WAAW;CACjC,UAAU,EAAE,WAAW,gCAAgC,EAAE,KAAK,CAAC;CAC/D,UAAU,CAAC,eAAe;AAC5B"}