@mdesignable/react 1.0.0-beta.64

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 (625) hide show
  1. package/LICENSE.md +20 -0
  2. package/README.md +1 -0
  3. package/dist/designable.react.umd.production.css +1 -0
  4. package/dist/designable.react.umd.production.js +6 -0
  5. package/dist/designable.react.umd.production.min.css +1 -0
  6. package/dist/designable.react.umd.production.min.js +3580 -0
  7. package/esm/containers/Designer.d.ts +3 -0
  8. package/esm/containers/Designer.js +49 -0
  9. package/esm/containers/Layout.d.ts +3 -0
  10. package/esm/containers/Layout.js +33 -0
  11. package/esm/containers/Simulator.d.ts +3 -0
  12. package/esm/containers/Simulator.js +29 -0
  13. package/esm/containers/Viewport.d.ts +6 -0
  14. package/esm/containers/Viewport.js +84 -0
  15. package/esm/containers/Workbench.d.ts +2 -0
  16. package/esm/containers/Workbench.js +9 -0
  17. package/esm/containers/Workspace.d.ts +7 -0
  18. package/esm/containers/Workspace.js +38 -0
  19. package/esm/containers/index.d.ts +7 -0
  20. package/esm/containers/index.js +7 -0
  21. package/esm/containers/styles.less +19 -0
  22. package/esm/context.d.ts +7 -0
  23. package/esm/context.js +6 -0
  24. package/esm/hooks/index.d.ts +25 -0
  25. package/esm/hooks/index.js +25 -0
  26. package/esm/hooks/useComponents.d.ts +1 -0
  27. package/esm/hooks/useComponents.js +3 -0
  28. package/esm/hooks/useCursor.d.ts +1 -0
  29. package/esm/hooks/useCursor.js +5 -0
  30. package/esm/hooks/useDesigner.d.ts +5 -0
  31. package/esm/hooks/useDesigner.js +13 -0
  32. package/esm/hooks/useHistory.d.ts +1 -0
  33. package/esm/hooks/useHistory.js +5 -0
  34. package/esm/hooks/useHover.d.ts +1 -0
  35. package/esm/hooks/useHover.js +5 -0
  36. package/esm/hooks/useLayout.d.ts +2 -0
  37. package/esm/hooks/useLayout.js +7 -0
  38. package/esm/hooks/useMoveHelper.d.ts +1 -0
  39. package/esm/hooks/useMoveHelper.js +5 -0
  40. package/esm/hooks/useNodeIdProps.d.ts +4 -0
  41. package/esm/hooks/useNodeIdProps.js +10 -0
  42. package/esm/hooks/useOperation.d.ts +1 -0
  43. package/esm/hooks/useOperation.js +5 -0
  44. package/esm/hooks/useOutline.d.ts +1 -0
  45. package/esm/hooks/useOutline.js +5 -0
  46. package/esm/hooks/usePosition.d.ts +1 -0
  47. package/esm/hooks/usePosition.js +5 -0
  48. package/esm/hooks/usePrefix.d.ts +1 -0
  49. package/esm/hooks/usePrefix.js +6 -0
  50. package/esm/hooks/useRegistry.d.ts +2 -0
  51. package/esm/hooks/useRegistry.js +5 -0
  52. package/esm/hooks/useScreen.d.ts +1 -0
  53. package/esm/hooks/useScreen.js +4 -0
  54. package/esm/hooks/useSelected.d.ts +1 -0
  55. package/esm/hooks/useSelected.js +5 -0
  56. package/esm/hooks/useSelectedNode.d.ts +6 -0
  57. package/esm/hooks/useSelectedNode.js +13 -0
  58. package/esm/hooks/useSelection.d.ts +1 -0
  59. package/esm/hooks/useSelection.js +5 -0
  60. package/esm/hooks/useTheme.d.ts +1 -0
  61. package/esm/hooks/useTheme.js +5 -0
  62. package/esm/hooks/useTransformHelper.d.ts +1 -0
  63. package/esm/hooks/useTransformHelper.js +5 -0
  64. package/esm/hooks/useTree.d.ts +1 -0
  65. package/esm/hooks/useTree.js +5 -0
  66. package/esm/hooks/useTreeNode.d.ts +1 -0
  67. package/esm/hooks/useTreeNode.js +5 -0
  68. package/esm/hooks/useValidNodeOffsetRect.d.ts +2 -0
  69. package/esm/hooks/useValidNodeOffsetRect.js +54 -0
  70. package/esm/hooks/useViewport.d.ts +1 -0
  71. package/esm/hooks/useViewport.js +5 -0
  72. package/esm/hooks/useWorkbench.d.ts +1 -0
  73. package/esm/hooks/useWorkbench.js +5 -0
  74. package/esm/hooks/useWorkspace.d.ts +2 -0
  75. package/esm/hooks/useWorkspace.js +15 -0
  76. package/esm/icons/actions.d.ts +7 -0
  77. package/esm/icons/actions.js +28 -0
  78. package/esm/icons/add.d.ts +2 -0
  79. package/esm/icons/add.js +4 -0
  80. package/esm/icons/animations.d.ts +24 -0
  81. package/esm/icons/animations.js +24 -0
  82. package/esm/icons/boolean.d.ts +2 -0
  83. package/esm/icons/boolean.js +3 -0
  84. package/esm/icons/clone.d.ts +3 -0
  85. package/esm/icons/clone.js +3 -0
  86. package/esm/icons/close.d.ts +2 -0
  87. package/esm/icons/close.js +3 -0
  88. package/esm/icons/code.d.ts +2 -0
  89. package/esm/icons/code.js +2 -0
  90. package/esm/icons/command.d.ts +2 -0
  91. package/esm/icons/command.js +4 -0
  92. package/esm/icons/component.d.ts +2 -0
  93. package/esm/icons/component.js +2 -0
  94. package/esm/icons/container.d.ts +2 -0
  95. package/esm/icons/container.js +4 -0
  96. package/esm/icons/corner.d.ts +5 -0
  97. package/esm/icons/corner.js +5 -0
  98. package/esm/icons/delete.d.ts +2 -0
  99. package/esm/icons/delete.js +5 -0
  100. package/esm/icons/design.d.ts +2 -0
  101. package/esm/icons/design.js +3 -0
  102. package/esm/icons/display.d.ts +5 -0
  103. package/esm/icons/display.js +5 -0
  104. package/esm/icons/dragmove.d.ts +2 -0
  105. package/esm/icons/dragmove.js +3 -0
  106. package/esm/icons/expand.d.ts +2 -0
  107. package/esm/icons/expand.js +2 -0
  108. package/esm/icons/expression.d.ts +2 -0
  109. package/esm/icons/expression.js +2 -0
  110. package/esm/icons/eyes.d.ts +3 -0
  111. package/esm/icons/eyes.js +7 -0
  112. package/esm/icons/flex.d.ts +22 -0
  113. package/esm/icons/flex.js +22 -0
  114. package/esm/icons/flip.d.ts +2 -0
  115. package/esm/icons/flip.js +2 -0
  116. package/esm/icons/focus.d.ts +2 -0
  117. package/esm/icons/focus.js +2 -0
  118. package/esm/icons/font.d.ts +16 -0
  119. package/esm/icons/font.js +16 -0
  120. package/esm/icons/formula.d.ts +2 -0
  121. package/esm/icons/formula.js +2 -0
  122. package/esm/icons/freemove.d.ts +2 -0
  123. package/esm/icons/freemove.js +3 -0
  124. package/esm/icons/help.d.ts +2 -0
  125. package/esm/icons/help.js +4 -0
  126. package/esm/icons/hidden.d.ts +2 -0
  127. package/esm/icons/hidden.js +2 -0
  128. package/esm/icons/history.d.ts +2 -0
  129. package/esm/icons/history.js +3 -0
  130. package/esm/icons/image.d.ts +3 -0
  131. package/esm/icons/image.js +3 -0
  132. package/esm/icons/index.d.ts +53 -0
  133. package/esm/icons/index.js +53 -0
  134. package/esm/icons/json.d.ts +2 -0
  135. package/esm/icons/json.js +2 -0
  136. package/esm/icons/logo.d.ts +4 -0
  137. package/esm/icons/logo.js +4 -0
  138. package/esm/icons/menu.d.ts +2 -0
  139. package/esm/icons/menu.js +3 -0
  140. package/esm/icons/mobile.d.ts +2 -0
  141. package/esm/icons/mobile.js +4 -0
  142. package/esm/icons/move.d.ts +2 -0
  143. package/esm/icons/move.js +2 -0
  144. package/esm/icons/number.d.ts +2 -0
  145. package/esm/icons/number.js +3 -0
  146. package/esm/icons/outline.d.ts +2 -0
  147. package/esm/icons/outline.js +2 -0
  148. package/esm/icons/page.d.ts +2 -0
  149. package/esm/icons/page.js +5 -0
  150. package/esm/icons/pc.d.ts +2 -0
  151. package/esm/icons/pc.js +3 -0
  152. package/esm/icons/play.d.ts +2 -0
  153. package/esm/icons/play.js +2 -0
  154. package/esm/icons/position.d.ts +6 -0
  155. package/esm/icons/position.js +6 -0
  156. package/esm/icons/pushpin.d.ts +3 -0
  157. package/esm/icons/pushpin.js +5 -0
  158. package/esm/icons/recover.d.ts +2 -0
  159. package/esm/icons/recover.js +2 -0
  160. package/esm/icons/redo.d.ts +2 -0
  161. package/esm/icons/redo.js +2 -0
  162. package/esm/icons/remove.d.ts +2 -0
  163. package/esm/icons/remove.js +2 -0
  164. package/esm/icons/responsive.d.ts +2 -0
  165. package/esm/icons/responsive.js +5 -0
  166. package/esm/icons/return.d.ts +2 -0
  167. package/esm/icons/return.js +2 -0
  168. package/esm/icons/selection.d.ts +2 -0
  169. package/esm/icons/selection.js +2 -0
  170. package/esm/icons/setting.d.ts +2 -0
  171. package/esm/icons/setting.js +2 -0
  172. package/esm/icons/shadow.d.ts +5 -0
  173. package/esm/icons/shadow.js +5 -0
  174. package/esm/icons/shift.d.ts +2 -0
  175. package/esm/icons/shift.js +2 -0
  176. package/esm/icons/sources.d.ts +75 -0
  177. package/esm/icons/sources.js +544 -0
  178. package/esm/icons/text.d.ts +3 -0
  179. package/esm/icons/text.js +5 -0
  180. package/esm/icons/undo.d.ts +2 -0
  181. package/esm/icons/undo.js +3 -0
  182. package/esm/icons/upload.d.ts +2 -0
  183. package/esm/icons/upload.js +4 -0
  184. package/esm/index.d.ts +9 -0
  185. package/esm/index.js +9 -0
  186. package/esm/locales/global.d.ts +17 -0
  187. package/esm/locales/global.js +16 -0
  188. package/esm/locales/icons.d.ts +133 -0
  189. package/esm/locales/icons.js +132 -0
  190. package/esm/locales/index.d.ts +1 -0
  191. package/esm/locales/index.js +6 -0
  192. package/esm/locales/operations.d.ts +51 -0
  193. package/esm/locales/operations.js +50 -0
  194. package/esm/locales/panels.d.ts +27 -0
  195. package/esm/locales/panels.js +26 -0
  196. package/esm/panels/CompositePanel.d.ts +22 -0
  197. package/esm/panels/CompositePanel.js +140 -0
  198. package/esm/panels/SettingsPanel.d.ts +6 -0
  199. package/esm/panels/SettingsPanel.js +69 -0
  200. package/esm/panels/SourceBarPanel.d.ts +4 -0
  201. package/esm/panels/SourceBarPanel.js +31 -0
  202. package/esm/panels/StudioPanel.d.ts +12 -0
  203. package/esm/panels/StudioPanel.js +44 -0
  204. package/esm/panels/ToolbarPanel.d.ts +3 -0
  205. package/esm/panels/ToolbarPanel.js +16 -0
  206. package/esm/panels/ViewPanel.d.ts +9 -0
  207. package/esm/panels/ViewPanel.js +57 -0
  208. package/esm/panels/ViewportPanel.d.ts +3 -0
  209. package/esm/panels/ViewportPanel.js +18 -0
  210. package/esm/panels/WorkspacePanel.d.ts +8 -0
  211. package/esm/panels/WorkspacePanel.js +21 -0
  212. package/esm/panels/index.d.ts +9 -0
  213. package/esm/panels/index.js +9 -0
  214. package/esm/panels/sourceBarPanel.less +4 -0
  215. package/esm/panels/styles.less +331 -0
  216. package/esm/simulators/MobileSimulator/body.d.ts +4 -0
  217. package/esm/simulators/MobileSimulator/body.js +57 -0
  218. package/esm/simulators/MobileSimulator/index.d.ts +7 -0
  219. package/esm/simulators/MobileSimulator/index.js +22 -0
  220. package/esm/simulators/MobileSimulator/styles.less +29 -0
  221. package/esm/simulators/PCSimulator/index.d.ts +7 -0
  222. package/esm/simulators/PCSimulator/index.js +19 -0
  223. package/esm/simulators/PCSimulator/styles.less +11 -0
  224. package/esm/simulators/ResponsiveSimulator/handle.d.ts +10 -0
  225. package/esm/simulators/ResponsiveSimulator/handle.js +28 -0
  226. package/esm/simulators/ResponsiveSimulator/index.d.ts +7 -0
  227. package/esm/simulators/ResponsiveSimulator/index.js +157 -0
  228. package/esm/simulators/ResponsiveSimulator/styles.less +56 -0
  229. package/esm/simulators/index.d.ts +3 -0
  230. package/esm/simulators/index.js +3 -0
  231. package/esm/theme.less +224 -0
  232. package/esm/types.d.ts +32 -0
  233. package/esm/types.js +1 -0
  234. package/esm/variables.less +1 -0
  235. package/esm/widgets/AuxToolWidget/Copy.d.ts +7 -0
  236. package/esm/widgets/AuxToolWidget/Copy.js +16 -0
  237. package/esm/widgets/AuxToolWidget/Cover.d.ts +2 -0
  238. package/esm/widgets/AuxToolWidget/Cover.js +52 -0
  239. package/esm/widgets/AuxToolWidget/DashedBox.d.ts +2 -0
  240. package/esm/widgets/AuxToolWidget/DashedBox.js +43 -0
  241. package/esm/widgets/AuxToolWidget/Delete.d.ts +7 -0
  242. package/esm/widgets/AuxToolWidget/Delete.js +16 -0
  243. package/esm/widgets/AuxToolWidget/DragHandler.d.ts +7 -0
  244. package/esm/widgets/AuxToolWidget/DragHandler.js +30 -0
  245. package/esm/widgets/AuxToolWidget/FreeSelection.d.ts +2 -0
  246. package/esm/widgets/AuxToolWidget/FreeSelection.js +43 -0
  247. package/esm/widgets/AuxToolWidget/Helpers.d.ts +15 -0
  248. package/esm/widgets/AuxToolWidget/Helpers.js +100 -0
  249. package/esm/widgets/AuxToolWidget/Insertion.d.ts +2 -0
  250. package/esm/widgets/AuxToolWidget/Insertion.js +70 -0
  251. package/esm/widgets/AuxToolWidget/ResizeHandler.d.ts +6 -0
  252. package/esm/widgets/AuxToolWidget/ResizeHandler.js +39 -0
  253. package/esm/widgets/AuxToolWidget/Selection.d.ts +8 -0
  254. package/esm/widgets/AuxToolWidget/Selection.js +69 -0
  255. package/esm/widgets/AuxToolWidget/Selector.d.ts +7 -0
  256. package/esm/widgets/AuxToolWidget/Selector.js +101 -0
  257. package/esm/widgets/AuxToolWidget/SnapLine.d.ts +2 -0
  258. package/esm/widgets/AuxToolWidget/SnapLine.js +30 -0
  259. package/esm/widgets/AuxToolWidget/SpaceBlock.d.ts +2 -0
  260. package/esm/widgets/AuxToolWidget/SpaceBlock.js +68 -0
  261. package/esm/widgets/AuxToolWidget/TranslateHandler.d.ts +6 -0
  262. package/esm/widgets/AuxToolWidget/TranslateHandler.js +32 -0
  263. package/esm/widgets/AuxToolWidget/index.d.ts +6 -0
  264. package/esm/widgets/AuxToolWidget/index.js +34 -0
  265. package/esm/widgets/AuxToolWidget/styles.less +383 -0
  266. package/esm/widgets/ComponentTreeWidget/index.d.ts +15 -0
  267. package/esm/widgets/ComponentTreeWidget/index.js +106 -0
  268. package/esm/widgets/ComponentTreeWidget/styles.less +6 -0
  269. package/esm/widgets/DesignerToolsWidget/index.d.ts +10 -0
  270. package/esm/widgets/DesignerToolsWidget/index.js +109 -0
  271. package/esm/widgets/DesignerToolsWidget/styles.less +29 -0
  272. package/esm/widgets/DroppableWidget/index.d.ts +15 -0
  273. package/esm/widgets/DroppableWidget/index.js +43 -0
  274. package/esm/widgets/DroppableWidget/styles.less +11 -0
  275. package/esm/widgets/EmptyWidget/index.d.ts +6 -0
  276. package/esm/widgets/EmptyWidget/index.js +46 -0
  277. package/esm/widgets/EmptyWidget/styles.less +27 -0
  278. package/esm/widgets/GhostWidget/index.d.ts +3 -0
  279. package/esm/widgets/GhostWidget/index.js +35 -0
  280. package/esm/widgets/GhostWidget/styles.less +20 -0
  281. package/esm/widgets/HistoryWidget/index.d.ts +3 -0
  282. package/esm/widgets/HistoryWidget/index.js +28 -0
  283. package/esm/widgets/HistoryWidget/styles.less +23 -0
  284. package/esm/widgets/IconWidget/index.d.ts +22 -0
  285. package/esm/widgets/IconWidget/index.js +108 -0
  286. package/esm/widgets/IconWidget/styles.less +17 -0
  287. package/esm/widgets/NodeActionsWidget/index.d.ts +17 -0
  288. package/esm/widgets/NodeActionsWidget/index.js +48 -0
  289. package/esm/widgets/NodeActionsWidget/styles.less +53 -0
  290. package/esm/widgets/NodePathWidget/index.d.ts +7 -0
  291. package/esm/widgets/NodePathWidget/index.js +34 -0
  292. package/esm/widgets/NodePathWidget/styles.less +16 -0
  293. package/esm/widgets/NodeTitleWidget/index.d.ts +6 -0
  294. package/esm/widgets/NodeTitleWidget/index.js +13 -0
  295. package/esm/widgets/OutlineWidget/Insertion.d.ts +5 -0
  296. package/esm/widgets/OutlineWidget/Insertion.js +52 -0
  297. package/esm/widgets/OutlineWidget/OutlineNode.d.ts +10 -0
  298. package/esm/widgets/OutlineWidget/OutlineNode.js +140 -0
  299. package/esm/widgets/OutlineWidget/context.d.ts +8 -0
  300. package/esm/widgets/OutlineWidget/context.js +2 -0
  301. package/esm/widgets/OutlineWidget/index.d.ts +10 -0
  302. package/esm/widgets/OutlineWidget/index.js +65 -0
  303. package/esm/widgets/OutlineWidget/styles.less +195 -0
  304. package/esm/widgets/ResourceWidget/index.d.ts +12 -0
  305. package/esm/widgets/ResourceWidget/index.js +69 -0
  306. package/esm/widgets/ResourceWidget/styles.less +87 -0
  307. package/esm/widgets/SimpleResourceWidget/index.d.ts +10 -0
  308. package/esm/widgets/SimpleResourceWidget/index.js +42 -0
  309. package/esm/widgets/SimpleResourceWidget/styles.less +57 -0
  310. package/esm/widgets/TextWidget/index.d.ts +9 -0
  311. package/esm/widgets/TextWidget/index.js +32 -0
  312. package/esm/widgets/ViewToolsWidget/index.d.ts +8 -0
  313. package/esm/widgets/ViewToolsWidget/index.js +31 -0
  314. package/esm/widgets/index.d.ts +16 -0
  315. package/esm/widgets/index.js +16 -0
  316. package/lib/containers/Designer.d.ts +3 -0
  317. package/lib/containers/Designer.js +76 -0
  318. package/lib/containers/Layout.d.ts +3 -0
  319. package/lib/containers/Layout.js +63 -0
  320. package/lib/containers/Simulator.d.ts +3 -0
  321. package/lib/containers/Simulator.js +35 -0
  322. package/lib/containers/Viewport.d.ts +6 -0
  323. package/lib/containers/Viewport.js +114 -0
  324. package/lib/containers/Workbench.d.ts +2 -0
  325. package/lib/containers/Workbench.js +15 -0
  326. package/lib/containers/Workspace.d.ts +7 -0
  327. package/lib/containers/Workspace.js +65 -0
  328. package/lib/containers/index.d.ts +7 -0
  329. package/lib/containers/index.js +23 -0
  330. package/lib/containers/styles.less +19 -0
  331. package/lib/context.d.ts +7 -0
  332. package/lib/context.js +9 -0
  333. package/lib/hooks/index.d.ts +25 -0
  334. package/lib/hooks/index.js +41 -0
  335. package/lib/hooks/useComponents.d.ts +1 -0
  336. package/lib/hooks/useComponents.js +7 -0
  337. package/lib/hooks/useCursor.d.ts +1 -0
  338. package/lib/hooks/useCursor.js +9 -0
  339. package/lib/hooks/useDesigner.d.ts +5 -0
  340. package/lib/hooks/useDesigner.js +17 -0
  341. package/lib/hooks/useHistory.d.ts +1 -0
  342. package/lib/hooks/useHistory.js +9 -0
  343. package/lib/hooks/useHover.d.ts +1 -0
  344. package/lib/hooks/useHover.js +9 -0
  345. package/lib/hooks/useLayout.d.ts +2 -0
  346. package/lib/hooks/useLayout.js +11 -0
  347. package/lib/hooks/useMoveHelper.d.ts +1 -0
  348. package/lib/hooks/useMoveHelper.js +9 -0
  349. package/lib/hooks/useNodeIdProps.d.ts +4 -0
  350. package/lib/hooks/useNodeIdProps.js +14 -0
  351. package/lib/hooks/useOperation.d.ts +1 -0
  352. package/lib/hooks/useOperation.js +9 -0
  353. package/lib/hooks/useOutline.d.ts +1 -0
  354. package/lib/hooks/useOutline.js +9 -0
  355. package/lib/hooks/usePosition.d.ts +1 -0
  356. package/lib/hooks/usePosition.js +9 -0
  357. package/lib/hooks/usePrefix.d.ts +1 -0
  358. package/lib/hooks/usePrefix.js +10 -0
  359. package/lib/hooks/useRegistry.d.ts +2 -0
  360. package/lib/hooks/useRegistry.js +9 -0
  361. package/lib/hooks/useScreen.d.ts +1 -0
  362. package/lib/hooks/useScreen.js +8 -0
  363. package/lib/hooks/useSelected.d.ts +1 -0
  364. package/lib/hooks/useSelected.js +9 -0
  365. package/lib/hooks/useSelectedNode.d.ts +6 -0
  366. package/lib/hooks/useSelectedNode.js +17 -0
  367. package/lib/hooks/useSelection.d.ts +1 -0
  368. package/lib/hooks/useSelection.js +9 -0
  369. package/lib/hooks/useTheme.d.ts +1 -0
  370. package/lib/hooks/useTheme.js +9 -0
  371. package/lib/hooks/useTransformHelper.d.ts +1 -0
  372. package/lib/hooks/useTransformHelper.js +9 -0
  373. package/lib/hooks/useTree.d.ts +1 -0
  374. package/lib/hooks/useTree.js +9 -0
  375. package/lib/hooks/useTreeNode.d.ts +1 -0
  376. package/lib/hooks/useTreeNode.js +9 -0
  377. package/lib/hooks/useValidNodeOffsetRect.d.ts +2 -0
  378. package/lib/hooks/useValidNodeOffsetRect.js +58 -0
  379. package/lib/hooks/useViewport.d.ts +1 -0
  380. package/lib/hooks/useViewport.js +9 -0
  381. package/lib/hooks/useWorkbench.d.ts +1 -0
  382. package/lib/hooks/useWorkbench.js +9 -0
  383. package/lib/hooks/useWorkspace.d.ts +2 -0
  384. package/lib/hooks/useWorkspace.js +19 -0
  385. package/lib/icons/actions.d.ts +7 -0
  386. package/lib/icons/actions.js +34 -0
  387. package/lib/icons/add.d.ts +2 -0
  388. package/lib/icons/add.js +10 -0
  389. package/lib/icons/animations.d.ts +24 -0
  390. package/lib/icons/animations.js +27 -0
  391. package/lib/icons/boolean.d.ts +2 -0
  392. package/lib/icons/boolean.js +9 -0
  393. package/lib/icons/clone.d.ts +3 -0
  394. package/lib/icons/clone.js +9 -0
  395. package/lib/icons/close.d.ts +2 -0
  396. package/lib/icons/close.js +9 -0
  397. package/lib/icons/code.d.ts +2 -0
  398. package/lib/icons/code.js +8 -0
  399. package/lib/icons/command.d.ts +2 -0
  400. package/lib/icons/command.js +10 -0
  401. package/lib/icons/component.d.ts +2 -0
  402. package/lib/icons/component.js +8 -0
  403. package/lib/icons/container.d.ts +2 -0
  404. package/lib/icons/container.js +10 -0
  405. package/lib/icons/corner.d.ts +5 -0
  406. package/lib/icons/corner.js +11 -0
  407. package/lib/icons/delete.d.ts +2 -0
  408. package/lib/icons/delete.js +11 -0
  409. package/lib/icons/design.d.ts +2 -0
  410. package/lib/icons/design.js +9 -0
  411. package/lib/icons/display.d.ts +5 -0
  412. package/lib/icons/display.js +11 -0
  413. package/lib/icons/dragmove.d.ts +2 -0
  414. package/lib/icons/dragmove.js +9 -0
  415. package/lib/icons/expand.d.ts +2 -0
  416. package/lib/icons/expand.js +8 -0
  417. package/lib/icons/expression.d.ts +2 -0
  418. package/lib/icons/expression.js +8 -0
  419. package/lib/icons/eyes.d.ts +3 -0
  420. package/lib/icons/eyes.js +13 -0
  421. package/lib/icons/flex.d.ts +22 -0
  422. package/lib/icons/flex.js +28 -0
  423. package/lib/icons/flip.d.ts +2 -0
  424. package/lib/icons/flip.js +8 -0
  425. package/lib/icons/focus.d.ts +2 -0
  426. package/lib/icons/focus.js +8 -0
  427. package/lib/icons/font.d.ts +16 -0
  428. package/lib/icons/font.js +22 -0
  429. package/lib/icons/formula.d.ts +2 -0
  430. package/lib/icons/formula.js +8 -0
  431. package/lib/icons/freemove.d.ts +2 -0
  432. package/lib/icons/freemove.js +9 -0
  433. package/lib/icons/help.d.ts +2 -0
  434. package/lib/icons/help.js +10 -0
  435. package/lib/icons/hidden.d.ts +2 -0
  436. package/lib/icons/hidden.js +8 -0
  437. package/lib/icons/history.d.ts +2 -0
  438. package/lib/icons/history.js +9 -0
  439. package/lib/icons/image.d.ts +3 -0
  440. package/lib/icons/image.js +9 -0
  441. package/lib/icons/index.d.ts +53 -0
  442. package/lib/icons/index.js +69 -0
  443. package/lib/icons/json.d.ts +2 -0
  444. package/lib/icons/json.js +8 -0
  445. package/lib/icons/logo.d.ts +4 -0
  446. package/lib/icons/logo.js +7 -0
  447. package/lib/icons/menu.d.ts +2 -0
  448. package/lib/icons/menu.js +9 -0
  449. package/lib/icons/mobile.d.ts +2 -0
  450. package/lib/icons/mobile.js +10 -0
  451. package/lib/icons/move.d.ts +2 -0
  452. package/lib/icons/move.js +8 -0
  453. package/lib/icons/number.d.ts +2 -0
  454. package/lib/icons/number.js +9 -0
  455. package/lib/icons/outline.d.ts +2 -0
  456. package/lib/icons/outline.js +8 -0
  457. package/lib/icons/page.d.ts +2 -0
  458. package/lib/icons/page.js +11 -0
  459. package/lib/icons/pc.d.ts +2 -0
  460. package/lib/icons/pc.js +9 -0
  461. package/lib/icons/play.d.ts +2 -0
  462. package/lib/icons/play.js +8 -0
  463. package/lib/icons/position.d.ts +6 -0
  464. package/lib/icons/position.js +12 -0
  465. package/lib/icons/pushpin.d.ts +3 -0
  466. package/lib/icons/pushpin.js +11 -0
  467. package/lib/icons/recover.d.ts +2 -0
  468. package/lib/icons/recover.js +8 -0
  469. package/lib/icons/redo.d.ts +2 -0
  470. package/lib/icons/redo.js +8 -0
  471. package/lib/icons/remove.d.ts +2 -0
  472. package/lib/icons/remove.js +8 -0
  473. package/lib/icons/responsive.d.ts +2 -0
  474. package/lib/icons/responsive.js +11 -0
  475. package/lib/icons/return.d.ts +2 -0
  476. package/lib/icons/return.js +8 -0
  477. package/lib/icons/selection.d.ts +2 -0
  478. package/lib/icons/selection.js +8 -0
  479. package/lib/icons/setting.d.ts +2 -0
  480. package/lib/icons/setting.js +8 -0
  481. package/lib/icons/shadow.d.ts +5 -0
  482. package/lib/icons/shadow.js +11 -0
  483. package/lib/icons/shift.d.ts +2 -0
  484. package/lib/icons/shift.js +8 -0
  485. package/lib/icons/sources.d.ts +75 -0
  486. package/lib/icons/sources.js +551 -0
  487. package/lib/icons/text.d.ts +3 -0
  488. package/lib/icons/text.js +11 -0
  489. package/lib/icons/undo.d.ts +2 -0
  490. package/lib/icons/undo.js +9 -0
  491. package/lib/icons/upload.d.ts +2 -0
  492. package/lib/icons/upload.js +10 -0
  493. package/lib/index.d.ts +9 -0
  494. package/lib/index.js +25 -0
  495. package/lib/locales/global.d.ts +17 -0
  496. package/lib/locales/global.js +18 -0
  497. package/lib/locales/icons.d.ts +133 -0
  498. package/lib/locales/icons.js +134 -0
  499. package/lib/locales/index.d.ts +1 -0
  500. package/lib/locales/index.js +11 -0
  501. package/lib/locales/operations.d.ts +51 -0
  502. package/lib/locales/operations.js +52 -0
  503. package/lib/locales/panels.d.ts +27 -0
  504. package/lib/locales/panels.js +28 -0
  505. package/lib/panels/CompositePanel.d.ts +22 -0
  506. package/lib/panels/CompositePanel.js +170 -0
  507. package/lib/panels/SettingsPanel.d.ts +6 -0
  508. package/lib/panels/SettingsPanel.js +98 -0
  509. package/lib/panels/SourceBarPanel.d.ts +4 -0
  510. package/lib/panels/SourceBarPanel.js +38 -0
  511. package/lib/panels/StudioPanel.d.ts +12 -0
  512. package/lib/panels/StudioPanel.js +51 -0
  513. package/lib/panels/ToolbarPanel.d.ts +3 -0
  514. package/lib/panels/ToolbarPanel.js +23 -0
  515. package/lib/panels/ViewPanel.d.ts +9 -0
  516. package/lib/panels/ViewPanel.js +83 -0
  517. package/lib/panels/ViewportPanel.d.ts +3 -0
  518. package/lib/panels/ViewportPanel.js +25 -0
  519. package/lib/panels/WorkspacePanel.d.ts +8 -0
  520. package/lib/panels/WorkspacePanel.js +28 -0
  521. package/lib/panels/index.d.ts +9 -0
  522. package/lib/panels/index.js +25 -0
  523. package/lib/panels/sourceBarPanel.less +4 -0
  524. package/lib/panels/styles.less +331 -0
  525. package/lib/simulators/MobileSimulator/body.d.ts +4 -0
  526. package/lib/simulators/MobileSimulator/body.js +63 -0
  527. package/lib/simulators/MobileSimulator/index.d.ts +7 -0
  528. package/lib/simulators/MobileSimulator/index.js +29 -0
  529. package/lib/simulators/MobileSimulator/styles.less +29 -0
  530. package/lib/simulators/PCSimulator/index.d.ts +7 -0
  531. package/lib/simulators/PCSimulator/index.js +26 -0
  532. package/lib/simulators/PCSimulator/styles.less +11 -0
  533. package/lib/simulators/ResponsiveSimulator/handle.d.ts +10 -0
  534. package/lib/simulators/ResponsiveSimulator/handle.js +35 -0
  535. package/lib/simulators/ResponsiveSimulator/index.d.ts +7 -0
  536. package/lib/simulators/ResponsiveSimulator/index.js +186 -0
  537. package/lib/simulators/ResponsiveSimulator/styles.less +56 -0
  538. package/lib/simulators/index.d.ts +3 -0
  539. package/lib/simulators/index.js +19 -0
  540. package/lib/theme.less +224 -0
  541. package/lib/types.d.ts +32 -0
  542. package/lib/types.js +2 -0
  543. package/lib/variables.less +1 -0
  544. package/lib/widgets/AuxToolWidget/Copy.d.ts +7 -0
  545. package/lib/widgets/AuxToolWidget/Copy.js +23 -0
  546. package/lib/widgets/AuxToolWidget/Cover.d.ts +2 -0
  547. package/lib/widgets/AuxToolWidget/Cover.js +81 -0
  548. package/lib/widgets/AuxToolWidget/DashedBox.d.ts +2 -0
  549. package/lib/widgets/AuxToolWidget/DashedBox.js +49 -0
  550. package/lib/widgets/AuxToolWidget/Delete.d.ts +7 -0
  551. package/lib/widgets/AuxToolWidget/Delete.js +23 -0
  552. package/lib/widgets/AuxToolWidget/DragHandler.d.ts +7 -0
  553. package/lib/widgets/AuxToolWidget/DragHandler.js +36 -0
  554. package/lib/widgets/AuxToolWidget/FreeSelection.d.ts +2 -0
  555. package/lib/widgets/AuxToolWidget/FreeSelection.js +49 -0
  556. package/lib/widgets/AuxToolWidget/Helpers.d.ts +15 -0
  557. package/lib/widgets/AuxToolWidget/Helpers.js +130 -0
  558. package/lib/widgets/AuxToolWidget/Insertion.d.ts +2 -0
  559. package/lib/widgets/AuxToolWidget/Insertion.js +76 -0
  560. package/lib/widgets/AuxToolWidget/ResizeHandler.d.ts +6 -0
  561. package/lib/widgets/AuxToolWidget/ResizeHandler.js +46 -0
  562. package/lib/widgets/AuxToolWidget/Selection.d.ts +8 -0
  563. package/lib/widgets/AuxToolWidget/Selection.js +96 -0
  564. package/lib/widgets/AuxToolWidget/Selector.d.ts +7 -0
  565. package/lib/widgets/AuxToolWidget/Selector.js +127 -0
  566. package/lib/widgets/AuxToolWidget/SnapLine.d.ts +2 -0
  567. package/lib/widgets/AuxToolWidget/SnapLine.js +36 -0
  568. package/lib/widgets/AuxToolWidget/SpaceBlock.d.ts +2 -0
  569. package/lib/widgets/AuxToolWidget/SpaceBlock.js +94 -0
  570. package/lib/widgets/AuxToolWidget/TranslateHandler.d.ts +6 -0
  571. package/lib/widgets/AuxToolWidget/TranslateHandler.js +39 -0
  572. package/lib/widgets/AuxToolWidget/index.d.ts +6 -0
  573. package/lib/widgets/AuxToolWidget/index.js +61 -0
  574. package/lib/widgets/AuxToolWidget/styles.less +383 -0
  575. package/lib/widgets/ComponentTreeWidget/index.d.ts +15 -0
  576. package/lib/widgets/ComponentTreeWidget/index.js +135 -0
  577. package/lib/widgets/ComponentTreeWidget/styles.less +6 -0
  578. package/lib/widgets/DesignerToolsWidget/index.d.ts +10 -0
  579. package/lib/widgets/DesignerToolsWidget/index.js +138 -0
  580. package/lib/widgets/DesignerToolsWidget/styles.less +29 -0
  581. package/lib/widgets/DroppableWidget/index.d.ts +15 -0
  582. package/lib/widgets/DroppableWidget/index.js +49 -0
  583. package/lib/widgets/DroppableWidget/styles.less +11 -0
  584. package/lib/widgets/EmptyWidget/index.d.ts +6 -0
  585. package/lib/widgets/EmptyWidget/index.js +52 -0
  586. package/lib/widgets/EmptyWidget/styles.less +27 -0
  587. package/lib/widgets/GhostWidget/index.d.ts +3 -0
  588. package/lib/widgets/GhostWidget/index.js +61 -0
  589. package/lib/widgets/GhostWidget/styles.less +20 -0
  590. package/lib/widgets/HistoryWidget/index.d.ts +3 -0
  591. package/lib/widgets/HistoryWidget/index.js +34 -0
  592. package/lib/widgets/HistoryWidget/styles.less +23 -0
  593. package/lib/widgets/IconWidget/index.d.ts +22 -0
  594. package/lib/widgets/IconWidget/index.js +137 -0
  595. package/lib/widgets/IconWidget/styles.less +17 -0
  596. package/lib/widgets/NodeActionsWidget/index.d.ts +17 -0
  597. package/lib/widgets/NodeActionsWidget/index.js +54 -0
  598. package/lib/widgets/NodeActionsWidget/styles.less +53 -0
  599. package/lib/widgets/NodePathWidget/index.d.ts +7 -0
  600. package/lib/widgets/NodePathWidget/index.js +40 -0
  601. package/lib/widgets/NodePathWidget/styles.less +16 -0
  602. package/lib/widgets/NodeTitleWidget/index.d.ts +6 -0
  603. package/lib/widgets/NodeTitleWidget/index.js +39 -0
  604. package/lib/widgets/OutlineWidget/Insertion.d.ts +5 -0
  605. package/lib/widgets/OutlineWidget/Insertion.js +58 -0
  606. package/lib/widgets/OutlineWidget/OutlineNode.d.ts +10 -0
  607. package/lib/widgets/OutlineWidget/OutlineNode.js +169 -0
  608. package/lib/widgets/OutlineWidget/context.d.ts +8 -0
  609. package/lib/widgets/OutlineWidget/context.js +5 -0
  610. package/lib/widgets/OutlineWidget/index.d.ts +10 -0
  611. package/lib/widgets/OutlineWidget/index.js +94 -0
  612. package/lib/widgets/OutlineWidget/styles.less +195 -0
  613. package/lib/widgets/ResourceWidget/index.d.ts +12 -0
  614. package/lib/widgets/ResourceWidget/index.js +98 -0
  615. package/lib/widgets/ResourceWidget/styles.less +87 -0
  616. package/lib/widgets/SimpleResourceWidget/index.d.ts +10 -0
  617. package/lib/widgets/SimpleResourceWidget/index.js +48 -0
  618. package/lib/widgets/SimpleResourceWidget/styles.less +57 -0
  619. package/lib/widgets/TextWidget/index.d.ts +9 -0
  620. package/lib/widgets/TextWidget/index.js +58 -0
  621. package/lib/widgets/ViewToolsWidget/index.d.ts +8 -0
  622. package/lib/widgets/ViewToolsWidget/index.js +37 -0
  623. package/lib/widgets/index.d.ts +16 -0
  624. package/lib/widgets/index.js +32 -0
  625. package/package.json +50 -0
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __read = (this && this.__read) || function (o, n) {
26
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
27
+ if (!m) return o;
28
+ var i = m.call(o), r, ar = [], e;
29
+ try {
30
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
31
+ }
32
+ catch (error) { e = { error: error }; }
33
+ finally {
34
+ try {
35
+ if (r && !r.done && (m = i["return"])) m.call(i);
36
+ }
37
+ finally { if (e) throw e.error; }
38
+ }
39
+ return ar;
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.Selector = void 0;
43
+ var react_1 = __importStar(require("react"));
44
+ var hooks_1 = require("../../hooks");
45
+ var IconWidget_1 = require("../IconWidget");
46
+ var NodeTitleWidget_1 = require("../NodeTitleWidget");
47
+ var antd_1 = require("antd");
48
+ var reactive_react_1 = require("@formily/reactive-react");
49
+ var useMouseHover = function (ref, enter, leave) {
50
+ (0, react_1.useEffect)(function () {
51
+ var timer = null;
52
+ var unmounted = false;
53
+ var onMouseOver = function (e) {
54
+ var target = e.target;
55
+ clearTimeout(timer);
56
+ timer = setTimeout(function () {
57
+ var _a;
58
+ if (unmounted)
59
+ return;
60
+ if ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.contains(target)) {
61
+ enter && enter();
62
+ }
63
+ else {
64
+ leave && leave();
65
+ }
66
+ }, 100);
67
+ };
68
+ document.addEventListener('mouseover', onMouseOver);
69
+ return function () {
70
+ unmounted = true;
71
+ document.removeEventListener('mouseover', onMouseOver);
72
+ };
73
+ }, []);
74
+ };
75
+ exports.Selector = (0, reactive_react_1.observer)(function (_a) {
76
+ var node = _a.node;
77
+ var hover = (0, hooks_1.useHover)();
78
+ var _b = __read((0, react_1.useState)(false), 2), expand = _b[0], setExpand = _b[1];
79
+ var ref = (0, react_1.useRef)(null);
80
+ var selection = (0, hooks_1.useSelection)();
81
+ var prefix = (0, hooks_1.usePrefix)('aux-selector');
82
+ var renderIcon = function (node) {
83
+ var _a;
84
+ var icon = node.designerProps.icon;
85
+ if (icon) {
86
+ return react_1.default.createElement(IconWidget_1.IconWidget, { infer: icon });
87
+ }
88
+ if (node === node.root) {
89
+ return react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Page" });
90
+ }
91
+ else if ((_a = node.designerProps) === null || _a === void 0 ? void 0 : _a.droppable) {
92
+ return react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Container" });
93
+ }
94
+ return react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Component" });
95
+ };
96
+ var renderMenu = function () {
97
+ var parents = node.getParents();
98
+ return (react_1.default.createElement("div", { className: prefix + '-menu', style: {
99
+ position: 'absolute',
100
+ top: '100%',
101
+ left: 0,
102
+ } }, parents.slice(0, 4).map(function (parent) {
103
+ return (react_1.default.createElement(antd_1.Button, { key: parent.id, type: "primary", onClick: function () {
104
+ selection.select(parent.id);
105
+ }, onMouseEnter: function () {
106
+ hover.setHover(parent);
107
+ } },
108
+ renderIcon(parent),
109
+ react_1.default.createElement("span", { style: { transform: 'scale(0.85)', marginLeft: 2 } },
110
+ react_1.default.createElement(NodeTitleWidget_1.NodeTitleWidget, { node: parent }))));
111
+ })));
112
+ };
113
+ useMouseHover(ref, function () {
114
+ setExpand(true);
115
+ }, function () {
116
+ setExpand(false);
117
+ });
118
+ return (react_1.default.createElement("div", { ref: ref, className: prefix },
119
+ react_1.default.createElement(antd_1.Button, { className: prefix + '-title', type: "primary", onMouseEnter: function () {
120
+ hover.setHover(node);
121
+ } },
122
+ renderIcon(node),
123
+ react_1.default.createElement("span", null,
124
+ react_1.default.createElement(NodeTitleWidget_1.NodeTitleWidget, { node: node }))),
125
+ expand && renderMenu()));
126
+ });
127
+ exports.Selector.displayName = 'Selector';
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SnapLine: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<unknown>>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SnapLine = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var hooks_1 = require("../../hooks");
9
+ var reactive_react_1 = require("@formily/reactive-react");
10
+ var core_1 = require("@mdesignable/core");
11
+ exports.SnapLine = (0, reactive_react_1.observer)(function () {
12
+ var cursor = (0, hooks_1.useCursor)();
13
+ var transformHelper = (0, hooks_1.useTransformHelper)();
14
+ var prefix = (0, hooks_1.usePrefix)('aux-snap-line');
15
+ var createLineStyle = function (rect) {
16
+ var baseStyle = {
17
+ top: 0,
18
+ left: 0,
19
+ height: rect.height || 1,
20
+ width: rect.width || 1,
21
+ transform: "perspective(1px) translate3d(".concat(rect.x, "px,").concat(rect.y, "px,0)"),
22
+ background: "#b0b1f3",
23
+ position: 'absolute',
24
+ zIndex: 2,
25
+ };
26
+ return baseStyle;
27
+ };
28
+ if (cursor.status !== core_1.CursorStatus.Dragging)
29
+ return null;
30
+ return (react_1.default.createElement(react_1.default.Fragment, null, transformHelper.closestSnapLines.map(function (line, key) {
31
+ if (line.type !== 'normal')
32
+ return null;
33
+ return (react_1.default.createElement("div", { key: key, className: prefix, style: createLineStyle(line.rect) }));
34
+ })));
35
+ });
36
+ exports.SnapLine.displayName = 'SnapLine';
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SpaceBlock: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<unknown>>;
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.SpaceBlock = void 0;
27
+ var react_1 = __importStar(require("react"));
28
+ var hooks_1 = require("../../hooks");
29
+ var reactive_react_1 = require("@formily/reactive-react");
30
+ var core_1 = require("@mdesignable/core");
31
+ var shared_1 = require("@mdesignable/shared");
32
+ exports.SpaceBlock = (0, reactive_react_1.observer)(function () {
33
+ var cursor = (0, hooks_1.useCursor)();
34
+ var transformHelper = (0, hooks_1.useTransformHelper)();
35
+ var prefix = (0, hooks_1.usePrefix)('aux-space-block');
36
+ if (cursor.status !== core_1.CursorStatus.Dragging)
37
+ return null;
38
+ var renderRulerBox = function (distance, type) {
39
+ if (type === 'top' || type === 'bottom') {
40
+ return (react_1.default.createElement("div", { className: prefix + '-ruler-v' },
41
+ react_1.default.createElement("div", { className: prefix + '-ruler-indicator' },
42
+ react_1.default.createElement("span", null, distance === null || distance === void 0 ? void 0 : distance.toFixed(0)))));
43
+ }
44
+ else if (type === 'left' || type === 'right') {
45
+ return (react_1.default.createElement("div", { className: prefix + '-ruler-h' },
46
+ react_1.default.createElement("div", { className: prefix + '-ruler-indicator' },
47
+ react_1.default.createElement("span", null, distance === null || distance === void 0 ? void 0 : distance.toFixed(0)))));
48
+ }
49
+ };
50
+ var renderDashedLine = function (line) {
51
+ var rect = (0, shared_1.calcRectOfAxisLineSegment)(line);
52
+ if (!rect)
53
+ return null;
54
+ var width = rect.width || 2;
55
+ var height = rect.height || 2;
56
+ return (react_1.default.createElement("svg", { width: width + 'px', height: height + 'px', viewBox: "0 0 ".concat(width, " ").concat(height), style: {
57
+ top: 0,
58
+ left: 0,
59
+ transform: "perspective(1px) translate3d(".concat(line.start.x, "px,").concat(line.start.y, "px,0)"),
60
+ position: 'absolute',
61
+ zIndex: 3,
62
+ } },
63
+ react_1.default.createElement("line", { x1: line.start.x - rect.x, y1: line.start.y - rect.y, x2: line.end.x - rect.x, y2: line.end.y - rect.y, strokeDasharray: 4, stroke: "#745BFF", strokeWidth: 2 })));
64
+ };
65
+ return (react_1.default.createElement(react_1.default.Fragment, null,
66
+ transformHelper.measurerSpaceBlocks.map(function (_a, key) {
67
+ var type = _a.type, crossDragNodesRect = _a.crossDragNodesRect, distance = _a.distance, extendsLine = _a.extendsLine;
68
+ return (react_1.default.createElement(react_1.Fragment, null,
69
+ renderDashedLine(extendsLine),
70
+ react_1.default.createElement("div", { key: key, style: {
71
+ top: 0,
72
+ left: 0,
73
+ height: crossDragNodesRect.height,
74
+ width: crossDragNodesRect.width,
75
+ transform: "perspective(1px) translate3d(".concat(crossDragNodesRect.x, "px,").concat(crossDragNodesRect.y, "px,0)"),
76
+ position: 'absolute',
77
+ zIndex: 3,
78
+ } }, renderRulerBox(distance, type))));
79
+ }),
80
+ transformHelper.thresholdSpaceBlocks.map(function (_a, key) {
81
+ var rect = _a.rect;
82
+ return (react_1.default.createElement("div", { key: key, className: prefix, style: {
83
+ top: 0,
84
+ left: 0,
85
+ height: rect.height,
86
+ width: rect.width,
87
+ transform: "perspective(1px) translate3d(".concat(rect.x, "px,").concat(rect.y, "px,0)"),
88
+ position: 'absolute',
89
+ background: 'rgba(255, 0, 0, 0.2)',
90
+ zIndex: 1,
91
+ } }));
92
+ })));
93
+ });
94
+ exports.SpaceBlock.displayName = 'SpaceBlock';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { TreeNode } from '@mdesignable/core';
3
+ export interface ITranslateHandlerProps {
4
+ node: TreeNode;
5
+ }
6
+ export declare const TranslateHandler: React.FC<ITranslateHandlerProps>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.TranslateHandler = void 0;
18
+ var react_1 = __importDefault(require("react"));
19
+ var classnames_1 = __importDefault(require("classnames"));
20
+ var hooks_1 = require("../../hooks");
21
+ var IconWidget_1 = require("../IconWidget");
22
+ var TranslateHandler = function (props) {
23
+ var designer = (0, hooks_1.useDesigner)();
24
+ var prefix = (0, hooks_1.usePrefix)('aux-node-translate-handler');
25
+ var createHandler = function (value) {
26
+ var _a;
27
+ return _a = {},
28
+ _a[designer.props.nodeTranslateAttrName] = value,
29
+ _a.className = (0, classnames_1.default)(prefix, value),
30
+ _a;
31
+ };
32
+ var allowTranslate = props.node.allowTranslate();
33
+ if (!allowTranslate)
34
+ return null;
35
+ return (react_1.default.createElement(react_1.default.Fragment, null,
36
+ react_1.default.createElement("div", __assign({}, createHandler('translate')),
37
+ react_1.default.createElement(IconWidget_1.IconWidget, { infer: "FreeMove" }))));
38
+ };
39
+ exports.TranslateHandler = TranslateHandler;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export declare const AuxToolWidget: {
4
+ (): React.JSX.Element;
5
+ displayName: string;
6
+ };
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.AuxToolWidget = void 0;
27
+ var react_1 = __importStar(require("react"));
28
+ var hooks_1 = require("../../hooks");
29
+ var Insertion_1 = require("./Insertion");
30
+ var Selection_1 = require("./Selection");
31
+ var FreeSelection_1 = require("./FreeSelection");
32
+ var Cover_1 = require("./Cover");
33
+ var DashedBox_1 = require("./DashedBox");
34
+ var SpaceBlock_1 = require("./SpaceBlock");
35
+ var SnapLine_1 = require("./SnapLine");
36
+ require("./styles.less");
37
+ var AuxToolWidget = function () {
38
+ var engine = (0, hooks_1.useDesigner)();
39
+ var viewport = (0, hooks_1.useViewport)();
40
+ var prefix = (0, hooks_1.usePrefix)('auxtool');
41
+ var ref = (0, react_1.useRef)();
42
+ (0, react_1.useEffect)(function () {
43
+ return engine.subscribeWith('viewport:scroll', function () {
44
+ if (viewport.isIframe && ref.current) {
45
+ ref.current.style.transform = "perspective(1px) translate3d(".concat(-viewport.scrollX, "px,").concat(-viewport.scrollY, "px,0)");
46
+ }
47
+ });
48
+ }, [engine, viewport]);
49
+ if (!viewport)
50
+ return null;
51
+ return (react_1.default.createElement("div", { ref: ref, className: prefix },
52
+ react_1.default.createElement(Insertion_1.Insertion, null),
53
+ react_1.default.createElement(SpaceBlock_1.SpaceBlock, null),
54
+ react_1.default.createElement(SnapLine_1.SnapLine, null),
55
+ react_1.default.createElement(DashedBox_1.DashedBox, null),
56
+ react_1.default.createElement(Selection_1.Selection, null),
57
+ react_1.default.createElement(Cover_1.Cover, null),
58
+ react_1.default.createElement(FreeSelection_1.FreeSelection, null)));
59
+ };
60
+ exports.AuxToolWidget = AuxToolWidget;
61
+ exports.AuxToolWidget.displayName = 'AuxToolWidget';