@formily-design/react 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (778) hide show
  1. package/LICENSE.md +20 -0
  2. package/README.md +1 -0
  3. package/copy.ts +6 -0
  4. package/dist/designable.react.umd.production.css +1 -0
  5. package/dist/designable.react.umd.production.js +6 -0
  6. package/dist/designable.react.umd.production.min.css +1 -0
  7. package/dist/designable.react.umd.production.min.js +3769 -0
  8. package/esm/containers/Designer.d.ts +3 -0
  9. package/esm/containers/Designer.js +38 -0
  10. package/esm/containers/Layout.d.ts +3 -0
  11. package/esm/containers/Layout.js +32 -0
  12. package/esm/containers/Simulator.d.ts +3 -0
  13. package/esm/containers/Simulator.js +18 -0
  14. package/esm/containers/Viewport.d.ts +6 -0
  15. package/esm/containers/Viewport.js +49 -0
  16. package/esm/containers/Workbench.d.ts +4 -0
  17. package/esm/containers/Workbench.js +9 -0
  18. package/esm/containers/Workspace.d.ts +8 -0
  19. package/esm/containers/Workspace.js +26 -0
  20. package/esm/containers/index.d.ts +7 -0
  21. package/esm/containers/index.js +7 -0
  22. package/esm/containers/styles.less +19 -0
  23. package/esm/context.d.ts +7 -0
  24. package/esm/context.js +6 -0
  25. package/esm/hooks/index.d.ts +25 -0
  26. package/esm/hooks/index.js +25 -0
  27. package/esm/hooks/useComponents.d.ts +1 -0
  28. package/esm/hooks/useComponents.js +3 -0
  29. package/esm/hooks/useCursor.d.ts +1 -0
  30. package/esm/hooks/useCursor.js +5 -0
  31. package/esm/hooks/useDesigner.d.ts +5 -0
  32. package/esm/hooks/useDesigner.js +13 -0
  33. package/esm/hooks/useHistory.d.ts +1 -0
  34. package/esm/hooks/useHistory.js +5 -0
  35. package/esm/hooks/useHover.d.ts +1 -0
  36. package/esm/hooks/useHover.js +5 -0
  37. package/esm/hooks/useLayout.d.ts +2 -0
  38. package/esm/hooks/useLayout.js +7 -0
  39. package/esm/hooks/useMoveHelper.d.ts +1 -0
  40. package/esm/hooks/useMoveHelper.js +5 -0
  41. package/esm/hooks/useNodeIdProps.d.ts +4 -0
  42. package/esm/hooks/useNodeIdProps.js +9 -0
  43. package/esm/hooks/useOperation.d.ts +1 -0
  44. package/esm/hooks/useOperation.js +5 -0
  45. package/esm/hooks/useOutline.d.ts +1 -0
  46. package/esm/hooks/useOutline.js +5 -0
  47. package/esm/hooks/usePosition.d.ts +1 -0
  48. package/esm/hooks/usePosition.js +5 -0
  49. package/esm/hooks/usePrefix.d.ts +1 -0
  50. package/esm/hooks/usePrefix.js +5 -0
  51. package/esm/hooks/useRegistry.d.ts +2 -0
  52. package/esm/hooks/useRegistry.js +5 -0
  53. package/esm/hooks/useScreen.d.ts +1 -0
  54. package/esm/hooks/useScreen.js +4 -0
  55. package/esm/hooks/useSelected.d.ts +1 -0
  56. package/esm/hooks/useSelected.js +5 -0
  57. package/esm/hooks/useSelectedNode.d.ts +6 -0
  58. package/esm/hooks/useSelectedNode.js +13 -0
  59. package/esm/hooks/useSelection.d.ts +1 -0
  60. package/esm/hooks/useSelection.js +5 -0
  61. package/esm/hooks/useTheme.d.ts +1 -0
  62. package/esm/hooks/useTheme.js +5 -0
  63. package/esm/hooks/useTransformHelper.d.ts +1 -0
  64. package/esm/hooks/useTransformHelper.js +5 -0
  65. package/esm/hooks/useTree.d.ts +1 -0
  66. package/esm/hooks/useTree.js +5 -0
  67. package/esm/hooks/useTreeNode.d.ts +1 -0
  68. package/esm/hooks/useTreeNode.js +5 -0
  69. package/esm/hooks/useValidNodeOffsetRect.d.ts +2 -0
  70. package/esm/hooks/useValidNodeOffsetRect.js +37 -0
  71. package/esm/hooks/useViewport.d.ts +1 -0
  72. package/esm/hooks/useViewport.js +5 -0
  73. package/esm/hooks/useWorkbench.d.ts +1 -0
  74. package/esm/hooks/useWorkbench.js +5 -0
  75. package/esm/hooks/useWorkspace.d.ts +2 -0
  76. package/esm/hooks/useWorkspace.js +15 -0
  77. package/esm/icons/actions.d.ts +7 -0
  78. package/esm/icons/actions.js +28 -0
  79. package/esm/icons/add.d.ts +2 -0
  80. package/esm/icons/add.js +4 -0
  81. package/esm/icons/animations.d.ts +24 -0
  82. package/esm/icons/animations.js +323 -0
  83. package/esm/icons/boolean.d.ts +2 -0
  84. package/esm/icons/boolean.js +3 -0
  85. package/esm/icons/clone.d.ts +3 -0
  86. package/esm/icons/clone.js +3 -0
  87. package/esm/icons/close.d.ts +2 -0
  88. package/esm/icons/close.js +3 -0
  89. package/esm/icons/code.d.ts +2 -0
  90. package/esm/icons/code.js +2 -0
  91. package/esm/icons/command.d.ts +2 -0
  92. package/esm/icons/command.js +4 -0
  93. package/esm/icons/component.d.ts +2 -0
  94. package/esm/icons/component.js +2 -0
  95. package/esm/icons/container.d.ts +2 -0
  96. package/esm/icons/container.js +4 -0
  97. package/esm/icons/corner.d.ts +5 -0
  98. package/esm/icons/corner.js +5 -0
  99. package/esm/icons/delete.d.ts +2 -0
  100. package/esm/icons/delete.js +5 -0
  101. package/esm/icons/design.d.ts +2 -0
  102. package/esm/icons/design.js +3 -0
  103. package/esm/icons/display.d.ts +5 -0
  104. package/esm/icons/display.js +5 -0
  105. package/esm/icons/dragmove.d.ts +2 -0
  106. package/esm/icons/dragmove.js +3 -0
  107. package/esm/icons/expand.d.ts +2 -0
  108. package/esm/icons/expand.js +2 -0
  109. package/esm/icons/expression.d.ts +2 -0
  110. package/esm/icons/expression.js +2 -0
  111. package/esm/icons/eyes.d.ts +3 -0
  112. package/esm/icons/eyes.js +7 -0
  113. package/esm/icons/flex.d.ts +22 -0
  114. package/esm/icons/flex.js +22 -0
  115. package/esm/icons/flip.d.ts +2 -0
  116. package/esm/icons/flip.js +2 -0
  117. package/esm/icons/focus.d.ts +2 -0
  118. package/esm/icons/focus.js +2 -0
  119. package/esm/icons/font.d.ts +16 -0
  120. package/esm/icons/font.js +16 -0
  121. package/esm/icons/formula.d.ts +2 -0
  122. package/esm/icons/formula.js +2 -0
  123. package/esm/icons/freemove.d.ts +2 -0
  124. package/esm/icons/freemove.js +3 -0
  125. package/esm/icons/help.d.ts +2 -0
  126. package/esm/icons/help.js +4 -0
  127. package/esm/icons/hidden.d.ts +2 -0
  128. package/esm/icons/hidden.js +2 -0
  129. package/esm/icons/history.d.ts +2 -0
  130. package/esm/icons/history.js +3 -0
  131. package/esm/icons/image.d.ts +3 -0
  132. package/esm/icons/image.js +3 -0
  133. package/esm/icons/index.d.ts +53 -0
  134. package/esm/icons/index.js +53 -0
  135. package/esm/icons/json.d.ts +2 -0
  136. package/esm/icons/json.js +2 -0
  137. package/esm/icons/logo.d.ts +4 -0
  138. package/esm/icons/logo.js +4 -0
  139. package/esm/icons/menu.d.ts +2 -0
  140. package/esm/icons/menu.js +3 -0
  141. package/esm/icons/mobile.d.ts +2 -0
  142. package/esm/icons/mobile.js +4 -0
  143. package/esm/icons/move.d.ts +2 -0
  144. package/esm/icons/move.js +2 -0
  145. package/esm/icons/number.d.ts +2 -0
  146. package/esm/icons/number.js +3 -0
  147. package/esm/icons/outline.d.ts +2 -0
  148. package/esm/icons/outline.js +2 -0
  149. package/esm/icons/page.d.ts +2 -0
  150. package/esm/icons/page.js +5 -0
  151. package/esm/icons/pc.d.ts +2 -0
  152. package/esm/icons/pc.js +3 -0
  153. package/esm/icons/play.d.ts +2 -0
  154. package/esm/icons/play.js +2 -0
  155. package/esm/icons/position.d.ts +6 -0
  156. package/esm/icons/position.js +6 -0
  157. package/esm/icons/pushpin.d.ts +3 -0
  158. package/esm/icons/pushpin.js +5 -0
  159. package/esm/icons/recover.d.ts +2 -0
  160. package/esm/icons/recover.js +2 -0
  161. package/esm/icons/redo.d.ts +2 -0
  162. package/esm/icons/redo.js +2 -0
  163. package/esm/icons/remove.d.ts +2 -0
  164. package/esm/icons/remove.js +2 -0
  165. package/esm/icons/responsive.d.ts +2 -0
  166. package/esm/icons/responsive.js +5 -0
  167. package/esm/icons/return.d.ts +2 -0
  168. package/esm/icons/return.js +2 -0
  169. package/esm/icons/selection.d.ts +2 -0
  170. package/esm/icons/selection.js +2 -0
  171. package/esm/icons/setting.d.ts +2 -0
  172. package/esm/icons/setting.js +2 -0
  173. package/esm/icons/shadow.d.ts +5 -0
  174. package/esm/icons/shadow.js +5 -0
  175. package/esm/icons/shift.d.ts +2 -0
  176. package/esm/icons/shift.js +2 -0
  177. package/esm/icons/sources.d.ts +75 -0
  178. package/esm/icons/sources.js +544 -0
  179. package/esm/icons/text.d.ts +3 -0
  180. package/esm/icons/text.js +5 -0
  181. package/esm/icons/undo.d.ts +2 -0
  182. package/esm/icons/undo.js +3 -0
  183. package/esm/icons/upload.d.ts +2 -0
  184. package/esm/icons/upload.js +4 -0
  185. package/esm/index.d.ts +9 -0
  186. package/esm/index.js +9 -0
  187. package/esm/locales/global.d.ts +17 -0
  188. package/esm/locales/global.js +16 -0
  189. package/esm/locales/icons.d.ts +133 -0
  190. package/esm/locales/icons.js +132 -0
  191. package/esm/locales/index.d.ts +1 -0
  192. package/esm/locales/index.js +6 -0
  193. package/esm/locales/operations.d.ts +51 -0
  194. package/esm/locales/operations.js +50 -0
  195. package/esm/locales/panels.d.ts +27 -0
  196. package/esm/locales/panels.js +26 -0
  197. package/esm/panels/CompositePanel.d.ts +24 -0
  198. package/esm/panels/CompositePanel.js +112 -0
  199. package/esm/panels/SettingsPanel.d.ts +7 -0
  200. package/esm/panels/SettingsPanel.js +53 -0
  201. package/esm/panels/StudioPanel.d.ts +13 -0
  202. package/esm/panels/StudioPanel.js +21 -0
  203. package/esm/panels/ToolbarPanel.d.ts +3 -0
  204. package/esm/panels/ToolbarPanel.js +11 -0
  205. package/esm/panels/ViewPanel.d.ts +9 -0
  206. package/esm/panels/ViewPanel.js +41 -0
  207. package/esm/panels/ViewportPanel.d.ts +3 -0
  208. package/esm/panels/ViewportPanel.js +7 -0
  209. package/esm/panels/WorkspacePanel.d.ts +11 -0
  210. package/esm/panels/WorkspacePanel.js +14 -0
  211. package/esm/panels/index.d.ts +8 -0
  212. package/esm/panels/index.js +8 -0
  213. package/esm/panels/styles.less +331 -0
  214. package/esm/simulators/MobileSimulator/body.d.ts +4 -0
  215. package/esm/simulators/MobileSimulator/body.js +57 -0
  216. package/esm/simulators/MobileSimulator/index.d.ts +7 -0
  217. package/esm/simulators/MobileSimulator/index.js +11 -0
  218. package/esm/simulators/MobileSimulator/styles.less +29 -0
  219. package/esm/simulators/PCSimulator/index.d.ts +7 -0
  220. package/esm/simulators/PCSimulator/index.js +8 -0
  221. package/esm/simulators/PCSimulator/styles.less +11 -0
  222. package/esm/simulators/ResponsiveSimulator/handle.d.ts +11 -0
  223. package/esm/simulators/ResponsiveSimulator/handle.js +16 -0
  224. package/esm/simulators/ResponsiveSimulator/index.d.ts +7 -0
  225. package/esm/simulators/ResponsiveSimulator/index.js +152 -0
  226. package/esm/simulators/ResponsiveSimulator/styles.less +56 -0
  227. package/esm/simulators/index.d.ts +3 -0
  228. package/esm/simulators/index.js +3 -0
  229. package/esm/theme.less +224 -0
  230. package/esm/types.d.ts +35 -0
  231. package/esm/types.js +1 -0
  232. package/esm/variables.less +1 -0
  233. package/esm/widgets/AuxToolWidget/Copy.d.ts +7 -0
  234. package/esm/widgets/AuxToolWidget/Copy.js +15 -0
  235. package/esm/widgets/AuxToolWidget/Cover.d.ts +2 -0
  236. package/esm/widgets/AuxToolWidget/Cover.js +52 -0
  237. package/esm/widgets/AuxToolWidget/DashedBox.d.ts +2 -0
  238. package/esm/widgets/AuxToolWidget/DashedBox.js +43 -0
  239. package/esm/widgets/AuxToolWidget/Delete.d.ts +7 -0
  240. package/esm/widgets/AuxToolWidget/Delete.js +15 -0
  241. package/esm/widgets/AuxToolWidget/DragHandler.d.ts +7 -0
  242. package/esm/widgets/AuxToolWidget/DragHandler.js +17 -0
  243. package/esm/widgets/AuxToolWidget/FreeSelection.d.ts +2 -0
  244. package/esm/widgets/AuxToolWidget/FreeSelection.js +43 -0
  245. package/esm/widgets/AuxToolWidget/Helpers.d.ts +15 -0
  246. package/esm/widgets/AuxToolWidget/Helpers.js +82 -0
  247. package/esm/widgets/AuxToolWidget/Insertion.d.ts +2 -0
  248. package/esm/widgets/AuxToolWidget/Insertion.js +70 -0
  249. package/esm/widgets/AuxToolWidget/ResizeHandler.d.ts +6 -0
  250. package/esm/widgets/AuxToolWidget/ResizeHandler.js +27 -0
  251. package/esm/widgets/AuxToolWidget/Selection.d.ts +8 -0
  252. package/esm/widgets/AuxToolWidget/Selection.js +57 -0
  253. package/esm/widgets/AuxToolWidget/Selector.d.ts +7 -0
  254. package/esm/widgets/AuxToolWidget/Selector.js +84 -0
  255. package/esm/widgets/AuxToolWidget/SnapLine.d.ts +2 -0
  256. package/esm/widgets/AuxToolWidget/SnapLine.js +30 -0
  257. package/esm/widgets/AuxToolWidget/SpaceBlock.d.ts +2 -0
  258. package/esm/widgets/AuxToolWidget/SpaceBlock.js +66 -0
  259. package/esm/widgets/AuxToolWidget/TranslateHandler.d.ts +6 -0
  260. package/esm/widgets/AuxToolWidget/TranslateHandler.js +20 -0
  261. package/esm/widgets/AuxToolWidget/index.d.ts +6 -0
  262. package/esm/widgets/AuxToolWidget/index.js +34 -0
  263. package/esm/widgets/AuxToolWidget/styles.less +383 -0
  264. package/esm/widgets/ComponentTreeWidget/index.d.ts +15 -0
  265. package/esm/widgets/ComponentTreeWidget/index.js +73 -0
  266. package/esm/widgets/ComponentTreeWidget/styles.less +6 -0
  267. package/esm/widgets/DesignerToolsWidget/index.d.ts +10 -0
  268. package/esm/widgets/DesignerToolsWidget/index.js +109 -0
  269. package/esm/widgets/DesignerToolsWidget/styles.less +29 -0
  270. package/esm/widgets/DroppableWidget/index.d.ts +15 -0
  271. package/esm/widgets/DroppableWidget/index.js +20 -0
  272. package/esm/widgets/DroppableWidget/styles.less +11 -0
  273. package/esm/widgets/EmptyWidget/index.d.ts +7 -0
  274. package/esm/widgets/EmptyWidget/index.js +46 -0
  275. package/esm/widgets/EmptyWidget/styles.less +27 -0
  276. package/esm/widgets/GhostWidget/index.d.ts +3 -0
  277. package/esm/widgets/GhostWidget/index.js +33 -0
  278. package/esm/widgets/GhostWidget/styles.less +20 -0
  279. package/esm/widgets/HistoryWidget/index.d.ts +3 -0
  280. package/esm/widgets/HistoryWidget/index.js +28 -0
  281. package/esm/widgets/HistoryWidget/styles.less +23 -0
  282. package/esm/widgets/IconWidget/index.d.ts +23 -0
  283. package/esm/widgets/IconWidget/index.js +102 -0
  284. package/esm/widgets/IconWidget/styles.less +17 -0
  285. package/esm/widgets/NodeActionsWidget/index.d.ts +18 -0
  286. package/esm/widgets/NodeActionsWidget/index.js +25 -0
  287. package/esm/widgets/NodeActionsWidget/styles.less +51 -0
  288. package/esm/widgets/NodePathWidget/index.d.ts +7 -0
  289. package/esm/widgets/NodePathWidget/index.js +36 -0
  290. package/esm/widgets/NodePathWidget/styles.less +16 -0
  291. package/esm/widgets/NodeTitleWidget/index.d.ts +6 -0
  292. package/esm/widgets/NodeTitleWidget/index.js +13 -0
  293. package/esm/widgets/OutlineWidget/Insertion.d.ts +5 -0
  294. package/esm/widgets/OutlineWidget/Insertion.js +51 -0
  295. package/esm/widgets/OutlineWidget/OutlineNode.d.ts +10 -0
  296. package/esm/widgets/OutlineWidget/OutlineNode.js +139 -0
  297. package/esm/widgets/OutlineWidget/context.d.ts +8 -0
  298. package/esm/widgets/OutlineWidget/context.js +2 -0
  299. package/esm/widgets/OutlineWidget/index.d.ts +10 -0
  300. package/esm/widgets/OutlineWidget/index.js +42 -0
  301. package/esm/widgets/OutlineWidget/styles.less +195 -0
  302. package/esm/widgets/ResourceWidget/index.d.ts +12 -0
  303. package/esm/widgets/ResourceWidget/index.js +53 -0
  304. package/esm/widgets/ResourceWidget/styles.less +87 -0
  305. package/esm/widgets/TextWidget/index.d.ts +10 -0
  306. package/esm/widgets/TextWidget/index.js +32 -0
  307. package/esm/widgets/ViewToolsWidget/index.d.ts +8 -0
  308. package/esm/widgets/ViewToolsWidget/index.js +30 -0
  309. package/esm/widgets/index.d.ts +15 -0
  310. package/esm/widgets/index.js +15 -0
  311. package/lib/containers/Designer.d.ts +3 -0
  312. package/lib/containers/Designer.js +75 -0
  313. package/lib/containers/Layout.d.ts +3 -0
  314. package/lib/containers/Layout.js +72 -0
  315. package/lib/containers/Simulator.d.ts +3 -0
  316. package/lib/containers/Simulator.js +24 -0
  317. package/lib/containers/Viewport.d.ts +6 -0
  318. package/lib/containers/Viewport.js +89 -0
  319. package/lib/containers/Workbench.d.ts +4 -0
  320. package/lib/containers/Workbench.js +15 -0
  321. package/lib/containers/Workspace.d.ts +8 -0
  322. package/lib/containers/Workspace.js +63 -0
  323. package/lib/containers/index.d.ts +7 -0
  324. package/lib/containers/index.js +23 -0
  325. package/lib/containers/styles.less +19 -0
  326. package/lib/context.d.ts +7 -0
  327. package/lib/context.js +9 -0
  328. package/lib/hooks/index.d.ts +25 -0
  329. package/lib/hooks/index.js +41 -0
  330. package/lib/hooks/useComponents.d.ts +1 -0
  331. package/lib/hooks/useComponents.js +7 -0
  332. package/lib/hooks/useCursor.d.ts +1 -0
  333. package/lib/hooks/useCursor.js +9 -0
  334. package/lib/hooks/useDesigner.d.ts +5 -0
  335. package/lib/hooks/useDesigner.js +17 -0
  336. package/lib/hooks/useHistory.d.ts +1 -0
  337. package/lib/hooks/useHistory.js +9 -0
  338. package/lib/hooks/useHover.d.ts +1 -0
  339. package/lib/hooks/useHover.js +9 -0
  340. package/lib/hooks/useLayout.d.ts +2 -0
  341. package/lib/hooks/useLayout.js +11 -0
  342. package/lib/hooks/useMoveHelper.d.ts +1 -0
  343. package/lib/hooks/useMoveHelper.js +9 -0
  344. package/lib/hooks/useNodeIdProps.d.ts +4 -0
  345. package/lib/hooks/useNodeIdProps.js +13 -0
  346. package/lib/hooks/useOperation.d.ts +1 -0
  347. package/lib/hooks/useOperation.js +9 -0
  348. package/lib/hooks/useOutline.d.ts +1 -0
  349. package/lib/hooks/useOutline.js +9 -0
  350. package/lib/hooks/usePosition.d.ts +1 -0
  351. package/lib/hooks/usePosition.js +9 -0
  352. package/lib/hooks/usePrefix.d.ts +1 -0
  353. package/lib/hooks/usePrefix.js +9 -0
  354. package/lib/hooks/useRegistry.d.ts +2 -0
  355. package/lib/hooks/useRegistry.js +9 -0
  356. package/lib/hooks/useScreen.d.ts +1 -0
  357. package/lib/hooks/useScreen.js +8 -0
  358. package/lib/hooks/useSelected.d.ts +1 -0
  359. package/lib/hooks/useSelected.js +9 -0
  360. package/lib/hooks/useSelectedNode.d.ts +6 -0
  361. package/lib/hooks/useSelectedNode.js +17 -0
  362. package/lib/hooks/useSelection.d.ts +1 -0
  363. package/lib/hooks/useSelection.js +9 -0
  364. package/lib/hooks/useTheme.d.ts +1 -0
  365. package/lib/hooks/useTheme.js +9 -0
  366. package/lib/hooks/useTransformHelper.d.ts +1 -0
  367. package/lib/hooks/useTransformHelper.js +9 -0
  368. package/lib/hooks/useTree.d.ts +1 -0
  369. package/lib/hooks/useTree.js +9 -0
  370. package/lib/hooks/useTreeNode.d.ts +1 -0
  371. package/lib/hooks/useTreeNode.js +9 -0
  372. package/lib/hooks/useValidNodeOffsetRect.d.ts +2 -0
  373. package/lib/hooks/useValidNodeOffsetRect.js +41 -0
  374. package/lib/hooks/useViewport.d.ts +1 -0
  375. package/lib/hooks/useViewport.js +9 -0
  376. package/lib/hooks/useWorkbench.d.ts +1 -0
  377. package/lib/hooks/useWorkbench.js +9 -0
  378. package/lib/hooks/useWorkspace.d.ts +2 -0
  379. package/lib/hooks/useWorkspace.js +19 -0
  380. package/lib/icons/actions.d.ts +7 -0
  381. package/lib/icons/actions.js +34 -0
  382. package/lib/icons/add.d.ts +2 -0
  383. package/lib/icons/add.js +10 -0
  384. package/lib/icons/animations.d.ts +24 -0
  385. package/lib/icons/animations.js +326 -0
  386. package/lib/icons/boolean.d.ts +2 -0
  387. package/lib/icons/boolean.js +9 -0
  388. package/lib/icons/clone.d.ts +3 -0
  389. package/lib/icons/clone.js +9 -0
  390. package/lib/icons/close.d.ts +2 -0
  391. package/lib/icons/close.js +9 -0
  392. package/lib/icons/code.d.ts +2 -0
  393. package/lib/icons/code.js +8 -0
  394. package/lib/icons/command.d.ts +2 -0
  395. package/lib/icons/command.js +10 -0
  396. package/lib/icons/component.d.ts +2 -0
  397. package/lib/icons/component.js +8 -0
  398. package/lib/icons/container.d.ts +2 -0
  399. package/lib/icons/container.js +10 -0
  400. package/lib/icons/corner.d.ts +5 -0
  401. package/lib/icons/corner.js +11 -0
  402. package/lib/icons/delete.d.ts +2 -0
  403. package/lib/icons/delete.js +11 -0
  404. package/lib/icons/design.d.ts +2 -0
  405. package/lib/icons/design.js +9 -0
  406. package/lib/icons/display.d.ts +5 -0
  407. package/lib/icons/display.js +11 -0
  408. package/lib/icons/dragmove.d.ts +2 -0
  409. package/lib/icons/dragmove.js +9 -0
  410. package/lib/icons/expand.d.ts +2 -0
  411. package/lib/icons/expand.js +8 -0
  412. package/lib/icons/expression.d.ts +2 -0
  413. package/lib/icons/expression.js +8 -0
  414. package/lib/icons/eyes.d.ts +3 -0
  415. package/lib/icons/eyes.js +13 -0
  416. package/lib/icons/flex.d.ts +22 -0
  417. package/lib/icons/flex.js +28 -0
  418. package/lib/icons/flip.d.ts +2 -0
  419. package/lib/icons/flip.js +8 -0
  420. package/lib/icons/focus.d.ts +2 -0
  421. package/lib/icons/focus.js +8 -0
  422. package/lib/icons/font.d.ts +16 -0
  423. package/lib/icons/font.js +22 -0
  424. package/lib/icons/formula.d.ts +2 -0
  425. package/lib/icons/formula.js +8 -0
  426. package/lib/icons/freemove.d.ts +2 -0
  427. package/lib/icons/freemove.js +9 -0
  428. package/lib/icons/help.d.ts +2 -0
  429. package/lib/icons/help.js +10 -0
  430. package/lib/icons/hidden.d.ts +2 -0
  431. package/lib/icons/hidden.js +8 -0
  432. package/lib/icons/history.d.ts +2 -0
  433. package/lib/icons/history.js +9 -0
  434. package/lib/icons/image.d.ts +3 -0
  435. package/lib/icons/image.js +9 -0
  436. package/lib/icons/index.d.ts +53 -0
  437. package/lib/icons/index.js +69 -0
  438. package/lib/icons/json.d.ts +2 -0
  439. package/lib/icons/json.js +8 -0
  440. package/lib/icons/logo.d.ts +4 -0
  441. package/lib/icons/logo.js +7 -0
  442. package/lib/icons/menu.d.ts +2 -0
  443. package/lib/icons/menu.js +9 -0
  444. package/lib/icons/mobile.d.ts +2 -0
  445. package/lib/icons/mobile.js +10 -0
  446. package/lib/icons/move.d.ts +2 -0
  447. package/lib/icons/move.js +8 -0
  448. package/lib/icons/number.d.ts +2 -0
  449. package/lib/icons/number.js +9 -0
  450. package/lib/icons/outline.d.ts +2 -0
  451. package/lib/icons/outline.js +8 -0
  452. package/lib/icons/page.d.ts +2 -0
  453. package/lib/icons/page.js +11 -0
  454. package/lib/icons/pc.d.ts +2 -0
  455. package/lib/icons/pc.js +9 -0
  456. package/lib/icons/play.d.ts +2 -0
  457. package/lib/icons/play.js +8 -0
  458. package/lib/icons/position.d.ts +6 -0
  459. package/lib/icons/position.js +12 -0
  460. package/lib/icons/pushpin.d.ts +3 -0
  461. package/lib/icons/pushpin.js +11 -0
  462. package/lib/icons/recover.d.ts +2 -0
  463. package/lib/icons/recover.js +8 -0
  464. package/lib/icons/redo.d.ts +2 -0
  465. package/lib/icons/redo.js +8 -0
  466. package/lib/icons/remove.d.ts +2 -0
  467. package/lib/icons/remove.js +8 -0
  468. package/lib/icons/responsive.d.ts +2 -0
  469. package/lib/icons/responsive.js +11 -0
  470. package/lib/icons/return.d.ts +2 -0
  471. package/lib/icons/return.js +8 -0
  472. package/lib/icons/selection.d.ts +2 -0
  473. package/lib/icons/selection.js +8 -0
  474. package/lib/icons/setting.d.ts +2 -0
  475. package/lib/icons/setting.js +8 -0
  476. package/lib/icons/shadow.d.ts +5 -0
  477. package/lib/icons/shadow.js +11 -0
  478. package/lib/icons/shift.d.ts +2 -0
  479. package/lib/icons/shift.js +8 -0
  480. package/lib/icons/sources.d.ts +75 -0
  481. package/lib/icons/sources.js +551 -0
  482. package/lib/icons/text.d.ts +3 -0
  483. package/lib/icons/text.js +11 -0
  484. package/lib/icons/undo.d.ts +2 -0
  485. package/lib/icons/undo.js +9 -0
  486. package/lib/icons/upload.d.ts +2 -0
  487. package/lib/icons/upload.js +10 -0
  488. package/lib/index.d.ts +9 -0
  489. package/lib/index.js +25 -0
  490. package/lib/locales/global.d.ts +17 -0
  491. package/lib/locales/global.js +18 -0
  492. package/lib/locales/icons.d.ts +133 -0
  493. package/lib/locales/icons.js +134 -0
  494. package/lib/locales/index.d.ts +1 -0
  495. package/lib/locales/index.js +11 -0
  496. package/lib/locales/operations.d.ts +51 -0
  497. package/lib/locales/operations.js +52 -0
  498. package/lib/locales/panels.d.ts +27 -0
  499. package/lib/locales/panels.js +28 -0
  500. package/lib/panels/CompositePanel.d.ts +24 -0
  501. package/lib/panels/CompositePanel.js +152 -0
  502. package/lib/panels/SettingsPanel.d.ts +7 -0
  503. package/lib/panels/SettingsPanel.js +92 -0
  504. package/lib/panels/StudioPanel.d.ts +13 -0
  505. package/lib/panels/StudioPanel.js +28 -0
  506. package/lib/panels/ToolbarPanel.d.ts +3 -0
  507. package/lib/panels/ToolbarPanel.js +18 -0
  508. package/lib/panels/ViewPanel.d.ts +9 -0
  509. package/lib/panels/ViewPanel.js +77 -0
  510. package/lib/panels/ViewportPanel.d.ts +3 -0
  511. package/lib/panels/ViewportPanel.js +14 -0
  512. package/lib/panels/WorkspacePanel.d.ts +11 -0
  513. package/lib/panels/WorkspacePanel.js +21 -0
  514. package/lib/panels/index.d.ts +8 -0
  515. package/lib/panels/index.js +24 -0
  516. package/lib/panels/styles.less +331 -0
  517. package/lib/simulators/MobileSimulator/body.d.ts +4 -0
  518. package/lib/simulators/MobileSimulator/body.js +63 -0
  519. package/lib/simulators/MobileSimulator/index.d.ts +7 -0
  520. package/lib/simulators/MobileSimulator/index.js +18 -0
  521. package/lib/simulators/MobileSimulator/styles.less +29 -0
  522. package/lib/simulators/PCSimulator/index.d.ts +7 -0
  523. package/lib/simulators/PCSimulator/index.js +15 -0
  524. package/lib/simulators/PCSimulator/styles.less +11 -0
  525. package/lib/simulators/ResponsiveSimulator/handle.d.ts +11 -0
  526. package/lib/simulators/ResponsiveSimulator/handle.js +23 -0
  527. package/lib/simulators/ResponsiveSimulator/index.d.ts +7 -0
  528. package/lib/simulators/ResponsiveSimulator/index.js +191 -0
  529. package/lib/simulators/ResponsiveSimulator/styles.less +56 -0
  530. package/lib/simulators/index.d.ts +3 -0
  531. package/lib/simulators/index.js +19 -0
  532. package/lib/theme.less +224 -0
  533. package/lib/types.d.ts +35 -0
  534. package/lib/types.js +2 -0
  535. package/lib/variables.less +1 -0
  536. package/lib/widgets/AuxToolWidget/Copy.d.ts +7 -0
  537. package/lib/widgets/AuxToolWidget/Copy.js +22 -0
  538. package/lib/widgets/AuxToolWidget/Cover.d.ts +2 -0
  539. package/lib/widgets/AuxToolWidget/Cover.js +91 -0
  540. package/lib/widgets/AuxToolWidget/DashedBox.d.ts +2 -0
  541. package/lib/widgets/AuxToolWidget/DashedBox.js +49 -0
  542. package/lib/widgets/AuxToolWidget/Delete.d.ts +7 -0
  543. package/lib/widgets/AuxToolWidget/Delete.js +22 -0
  544. package/lib/widgets/AuxToolWidget/DragHandler.d.ts +7 -0
  545. package/lib/widgets/AuxToolWidget/DragHandler.js +23 -0
  546. package/lib/widgets/AuxToolWidget/FreeSelection.d.ts +2 -0
  547. package/lib/widgets/AuxToolWidget/FreeSelection.js +49 -0
  548. package/lib/widgets/AuxToolWidget/Helpers.d.ts +15 -0
  549. package/lib/widgets/AuxToolWidget/Helpers.js +122 -0
  550. package/lib/widgets/AuxToolWidget/Insertion.d.ts +2 -0
  551. package/lib/widgets/AuxToolWidget/Insertion.js +76 -0
  552. package/lib/widgets/AuxToolWidget/ResizeHandler.d.ts +6 -0
  553. package/lib/widgets/AuxToolWidget/ResizeHandler.js +34 -0
  554. package/lib/widgets/AuxToolWidget/Selection.d.ts +8 -0
  555. package/lib/widgets/AuxToolWidget/Selection.js +94 -0
  556. package/lib/widgets/AuxToolWidget/Selector.d.ts +7 -0
  557. package/lib/widgets/AuxToolWidget/Selector.js +120 -0
  558. package/lib/widgets/AuxToolWidget/SnapLine.d.ts +2 -0
  559. package/lib/widgets/AuxToolWidget/SnapLine.js +36 -0
  560. package/lib/widgets/AuxToolWidget/SpaceBlock.d.ts +2 -0
  561. package/lib/widgets/AuxToolWidget/SpaceBlock.js +102 -0
  562. package/lib/widgets/AuxToolWidget/TranslateHandler.d.ts +6 -0
  563. package/lib/widgets/AuxToolWidget/TranslateHandler.js +27 -0
  564. package/lib/widgets/AuxToolWidget/index.d.ts +6 -0
  565. package/lib/widgets/AuxToolWidget/index.js +71 -0
  566. package/lib/widgets/AuxToolWidget/styles.less +383 -0
  567. package/lib/widgets/ComponentTreeWidget/index.d.ts +15 -0
  568. package/lib/widgets/ComponentTreeWidget/index.js +112 -0
  569. package/lib/widgets/ComponentTreeWidget/styles.less +6 -0
  570. package/lib/widgets/DesignerToolsWidget/index.d.ts +10 -0
  571. package/lib/widgets/DesignerToolsWidget/index.js +148 -0
  572. package/lib/widgets/DesignerToolsWidget/styles.less +29 -0
  573. package/lib/widgets/DroppableWidget/index.d.ts +15 -0
  574. package/lib/widgets/DroppableWidget/index.js +26 -0
  575. package/lib/widgets/DroppableWidget/styles.less +11 -0
  576. package/lib/widgets/EmptyWidget/index.d.ts +7 -0
  577. package/lib/widgets/EmptyWidget/index.js +52 -0
  578. package/lib/widgets/EmptyWidget/styles.less +27 -0
  579. package/lib/widgets/GhostWidget/index.d.ts +3 -0
  580. package/lib/widgets/GhostWidget/index.js +69 -0
  581. package/lib/widgets/GhostWidget/styles.less +20 -0
  582. package/lib/widgets/HistoryWidget/index.d.ts +3 -0
  583. package/lib/widgets/HistoryWidget/index.js +34 -0
  584. package/lib/widgets/HistoryWidget/styles.less +23 -0
  585. package/lib/widgets/IconWidget/index.d.ts +23 -0
  586. package/lib/widgets/IconWidget/index.js +141 -0
  587. package/lib/widgets/IconWidget/styles.less +17 -0
  588. package/lib/widgets/NodeActionsWidget/index.d.ts +18 -0
  589. package/lib/widgets/NodeActionsWidget/index.js +31 -0
  590. package/lib/widgets/NodeActionsWidget/styles.less +51 -0
  591. package/lib/widgets/NodePathWidget/index.d.ts +7 -0
  592. package/lib/widgets/NodePathWidget/index.js +42 -0
  593. package/lib/widgets/NodePathWidget/styles.less +16 -0
  594. package/lib/widgets/NodeTitleWidget/index.d.ts +6 -0
  595. package/lib/widgets/NodeTitleWidget/index.js +49 -0
  596. package/lib/widgets/OutlineWidget/Insertion.d.ts +5 -0
  597. package/lib/widgets/OutlineWidget/Insertion.js +57 -0
  598. package/lib/widgets/OutlineWidget/OutlineNode.d.ts +10 -0
  599. package/lib/widgets/OutlineWidget/OutlineNode.js +178 -0
  600. package/lib/widgets/OutlineWidget/context.d.ts +8 -0
  601. package/lib/widgets/OutlineWidget/context.js +5 -0
  602. package/lib/widgets/OutlineWidget/index.d.ts +10 -0
  603. package/lib/widgets/OutlineWidget/index.js +81 -0
  604. package/lib/widgets/OutlineWidget/styles.less +195 -0
  605. package/lib/widgets/ResourceWidget/index.d.ts +12 -0
  606. package/lib/widgets/ResourceWidget/index.js +92 -0
  607. package/lib/widgets/ResourceWidget/styles.less +87 -0
  608. package/lib/widgets/TextWidget/index.d.ts +10 -0
  609. package/lib/widgets/TextWidget/index.js +68 -0
  610. package/lib/widgets/ViewToolsWidget/index.d.ts +8 -0
  611. package/lib/widgets/ViewToolsWidget/index.js +36 -0
  612. package/lib/widgets/index.d.ts +15 -0
  613. package/lib/widgets/index.js +31 -0
  614. package/package.json +45 -0
  615. package/rollup.config.js +3 -0
  616. package/src/containers/Designer.tsx +50 -0
  617. package/src/containers/Layout.tsx +50 -0
  618. package/src/containers/Simulator.tsx +30 -0
  619. package/src/containers/Viewport.tsx +69 -0
  620. package/src/containers/Workbench.tsx +15 -0
  621. package/src/containers/Workspace.tsx +41 -0
  622. package/src/containers/index.ts +7 -0
  623. package/src/containers/styles.less +19 -0
  624. package/src/context.ts +17 -0
  625. package/src/hooks/index.ts +25 -0
  626. package/src/hooks/useComponents.ts +3 -0
  627. package/src/hooks/useCursor.ts +6 -0
  628. package/src/hooks/useDesigner.ts +19 -0
  629. package/src/hooks/useHistory.ts +6 -0
  630. package/src/hooks/useHover.ts +6 -0
  631. package/src/hooks/useLayout.ts +11 -0
  632. package/src/hooks/useMoveHelper.ts +6 -0
  633. package/src/hooks/useNodeIdProps.ts +11 -0
  634. package/src/hooks/useOperation.ts +6 -0
  635. package/src/hooks/useOutline.ts +6 -0
  636. package/src/hooks/usePosition.ts +5 -0
  637. package/src/hooks/usePrefix.ts +5 -0
  638. package/src/hooks/useRegistry.ts +6 -0
  639. package/src/hooks/useScreen.ts +5 -0
  640. package/src/hooks/useSelected.ts +6 -0
  641. package/src/hooks/useSelectedNode.ts +14 -0
  642. package/src/hooks/useSelection.ts +6 -0
  643. package/src/hooks/useTheme.ts +5 -0
  644. package/src/hooks/useTransformHelper.ts +6 -0
  645. package/src/hooks/useTree.ts +6 -0
  646. package/src/hooks/useTreeNode.ts +6 -0
  647. package/src/hooks/useValidNodeOffsetRect.ts +48 -0
  648. package/src/hooks/useViewport.ts +6 -0
  649. package/src/hooks/useWorkbench.ts +6 -0
  650. package/src/hooks/useWorkspace.ts +16 -0
  651. package/src/icons/actions.tsx +138 -0
  652. package/src/icons/add.tsx +8 -0
  653. package/src/icons/animations.tsx +325 -0
  654. package/src/icons/boolean.tsx +7 -0
  655. package/src/icons/clone.tsx +9 -0
  656. package/src/icons/close.tsx +7 -0
  657. package/src/icons/code.tsx +5 -0
  658. package/src/icons/command.tsx +8 -0
  659. package/src/icons/component.tsx +5 -0
  660. package/src/icons/container.tsx +8 -0
  661. package/src/icons/corner.tsx +26 -0
  662. package/src/icons/delete.tsx +9 -0
  663. package/src/icons/design.tsx +7 -0
  664. package/src/icons/display.tsx +17 -0
  665. package/src/icons/dragmove.tsx +10 -0
  666. package/src/icons/expand.tsx +5 -0
  667. package/src/icons/expression.tsx +5 -0
  668. package/src/icons/eyes.tsx +15 -0
  669. package/src/icons/flex.tsx +85 -0
  670. package/src/icons/flip.tsx +5 -0
  671. package/src/icons/focus.tsx +5 -0
  672. package/src/icons/font.tsx +61 -0
  673. package/src/icons/formula.tsx +5 -0
  674. package/src/icons/freemove.tsx +10 -0
  675. package/src/icons/help.tsx +8 -0
  676. package/src/icons/hidden.tsx +5 -0
  677. package/src/icons/history.tsx +7 -0
  678. package/src/icons/image.tsx +9 -0
  679. package/src/icons/index.ts +53 -0
  680. package/src/icons/json.tsx +5 -0
  681. package/src/icons/logo.tsx +5 -0
  682. package/src/icons/menu.tsx +7 -0
  683. package/src/icons/mobile.tsx +8 -0
  684. package/src/icons/move.tsx +5 -0
  685. package/src/icons/number.tsx +7 -0
  686. package/src/icons/outline.tsx +5 -0
  687. package/src/icons/page.tsx +9 -0
  688. package/src/icons/pc.tsx +7 -0
  689. package/src/icons/play.tsx +8 -0
  690. package/src/icons/position.tsx +30 -0
  691. package/src/icons/pushpin.tsx +29 -0
  692. package/src/icons/recover.tsx +5 -0
  693. package/src/icons/redo.tsx +5 -0
  694. package/src/icons/remove.tsx +5 -0
  695. package/src/icons/responsive.tsx +9 -0
  696. package/src/icons/return.tsx +5 -0
  697. package/src/icons/selection.tsx +5 -0
  698. package/src/icons/setting.tsx +5 -0
  699. package/src/icons/shadow.tsx +20 -0
  700. package/src/icons/shift.tsx +5 -0
  701. package/src/icons/sources.tsx +3377 -0
  702. package/src/icons/text.tsx +13 -0
  703. package/src/icons/undo.tsx +7 -0
  704. package/src/icons/upload.tsx +8 -0
  705. package/src/index.ts +9 -0
  706. package/src/locales/global.ts +16 -0
  707. package/src/locales/icons.ts +132 -0
  708. package/src/locales/index.ts +7 -0
  709. package/src/locales/operations.ts +50 -0
  710. package/src/locales/panels.ts +26 -0
  711. package/src/panels/CompositePanel.tsx +195 -0
  712. package/src/panels/SettingsPanel.tsx +85 -0
  713. package/src/panels/StudioPanel.tsx +54 -0
  714. package/src/panels/ToolbarPanel.tsx +19 -0
  715. package/src/panels/ViewPanel.tsx +62 -0
  716. package/src/panels/ViewportPanel.tsx +10 -0
  717. package/src/panels/WorkspacePanel.tsx +31 -0
  718. package/src/panels/index.ts +8 -0
  719. package/src/panels/styles.less +331 -0
  720. package/src/simulators/MobileSimulator/body.tsx +78 -0
  721. package/src/simulators/MobileSimulator/index.tsx +21 -0
  722. package/src/simulators/MobileSimulator/styles.less +29 -0
  723. package/src/simulators/PCSimulator/index.tsx +17 -0
  724. package/src/simulators/PCSimulator/styles.less +11 -0
  725. package/src/simulators/ResponsiveSimulator/handle.tsx +29 -0
  726. package/src/simulators/ResponsiveSimulator/index.tsx +193 -0
  727. package/src/simulators/ResponsiveSimulator/styles.less +56 -0
  728. package/src/simulators/index.tsx +3 -0
  729. package/src/theme.less +224 -0
  730. package/src/types.ts +41 -0
  731. package/src/variables.less +1 -0
  732. package/src/widgets/AuxToolWidget/Copy.tsx +28 -0
  733. package/src/widgets/AuxToolWidget/Cover.tsx +76 -0
  734. package/src/widgets/AuxToolWidget/DashedBox.tsx +55 -0
  735. package/src/widgets/AuxToolWidget/Delete.tsx +29 -0
  736. package/src/widgets/AuxToolWidget/DragHandler.tsx +29 -0
  737. package/src/widgets/AuxToolWidget/FreeSelection.tsx +53 -0
  738. package/src/widgets/AuxToolWidget/Helpers.tsx +116 -0
  739. package/src/widgets/AuxToolWidget/Insertion.tsx +80 -0
  740. package/src/widgets/AuxToolWidget/ResizeHandler.tsx +35 -0
  741. package/src/widgets/AuxToolWidget/Selection.tsx +85 -0
  742. package/src/widgets/AuxToolWidget/Selector.tsx +125 -0
  743. package/src/widgets/AuxToolWidget/SnapLine.tsx +40 -0
  744. package/src/widgets/AuxToolWidget/SpaceBlock.tsx +112 -0
  745. package/src/widgets/AuxToolWidget/TranslateHandler.tsx +29 -0
  746. package/src/widgets/AuxToolWidget/index.tsx +40 -0
  747. package/src/widgets/AuxToolWidget/styles.less +383 -0
  748. package/src/widgets/ComponentTreeWidget/index.tsx +99 -0
  749. package/src/widgets/ComponentTreeWidget/styles.less +6 -0
  750. package/src/widgets/DesignerToolsWidget/index.tsx +206 -0
  751. package/src/widgets/DesignerToolsWidget/styles.less +29 -0
  752. package/src/widgets/DroppableWidget/index.tsx +63 -0
  753. package/src/widgets/DroppableWidget/styles.less +11 -0
  754. package/src/widgets/EmptyWidget/index.tsx +58 -0
  755. package/src/widgets/EmptyWidget/styles.less +27 -0
  756. package/src/widgets/GhostWidget/index.tsx +47 -0
  757. package/src/widgets/GhostWidget/styles.less +20 -0
  758. package/src/widgets/HistoryWidget/index.tsx +42 -0
  759. package/src/widgets/HistoryWidget/styles.less +23 -0
  760. package/src/widgets/IconWidget/index.tsx +152 -0
  761. package/src/widgets/IconWidget/styles.less +17 -0
  762. package/src/widgets/NodeActionsWidget/index.tsx +56 -0
  763. package/src/widgets/NodeActionsWidget/styles.less +51 -0
  764. package/src/widgets/NodePathWidget/index.tsx +57 -0
  765. package/src/widgets/NodePathWidget/styles.less +16 -0
  766. package/src/widgets/NodeTitleWidget/index.tsx +20 -0
  767. package/src/widgets/OutlineWidget/Insertion.tsx +63 -0
  768. package/src/widgets/OutlineWidget/OutlineNode.tsx +198 -0
  769. package/src/widgets/OutlineWidget/context.ts +9 -0
  770. package/src/widgets/OutlineWidget/index.tsx +66 -0
  771. package/src/widgets/OutlineWidget/styles.less +195 -0
  772. package/src/widgets/ResourceWidget/index.tsx +110 -0
  773. package/src/widgets/ResourceWidget/styles.less +87 -0
  774. package/src/widgets/TextWidget/index.tsx +43 -0
  775. package/src/widgets/ViewToolsWidget/index.tsx +72 -0
  776. package/src/widgets/index.ts +15 -0
  777. package/tsconfig.build.json +10 -0
  778. package/tsconfig.json +5 -0
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import { useTree, usePrefix } from '../../hooks';
3
+ import { observer } from '@formily/reactive-react';
4
+ import { IconWidget } from '../IconWidget';
5
+ import './styles.less';
6
+ export const EmptyWidget = observer((props) => {
7
+ var _a;
8
+ const tree = useTree();
9
+ const prefix = usePrefix('empty');
10
+ const renderEmpty = () => {
11
+ return (React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
12
+ React.createElement("div", { className: "animations" },
13
+ React.createElement(IconWidget, { infer: props.dragTipsDirection === 'left'
14
+ ? 'DragLeftSourceAnimation'
15
+ : 'DragRightSourceAnimation', size: 240 }),
16
+ React.createElement(IconWidget, { infer: "BatchDragAnimation", size: 240 })),
17
+ React.createElement("div", { className: "hotkeys-list" },
18
+ React.createElement("div", null,
19
+ "Selection ",
20
+ React.createElement(IconWidget, { infer: "Command" }),
21
+ " + Click /",
22
+ ' ',
23
+ React.createElement(IconWidget, { infer: "Shift" }),
24
+ " + Click /",
25
+ ' ',
26
+ React.createElement(IconWidget, { infer: "Command" }),
27
+ " + A"),
28
+ React.createElement("div", null,
29
+ "Copy ",
30
+ React.createElement(IconWidget, { infer: "Command" }),
31
+ " + C / Paste",
32
+ ' ',
33
+ React.createElement(IconWidget, { infer: "Command" }),
34
+ " + V"),
35
+ React.createElement("div", null,
36
+ "Delete ",
37
+ React.createElement(IconWidget, { infer: "Delete" })))));
38
+ };
39
+ if (!((_a = tree === null || tree === void 0 ? void 0 : tree.children) === null || _a === void 0 ? void 0 : _a.length)) {
40
+ return (React.createElement("div", { className: prefix }, props.children ? props.children : renderEmpty()));
41
+ }
42
+ return null;
43
+ });
44
+ EmptyWidget.defaultProps = {
45
+ dragTipsDirection: 'left',
46
+ };
@@ -0,0 +1,27 @@
1
+ @import '../../variables.less';
2
+
3
+ .@{prefix-cls}-empty {
4
+ transform: perspective(1px) translate3d(0, 0, 0);
5
+ position: absolute;
6
+ top: 0;
7
+ left: 0;
8
+ right: 0;
9
+ bottom: 0;
10
+ height: 100%;
11
+ width: 100%;
12
+ pointer-events: none;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ background: var(--dn-empty-bg-color);
17
+ .animations {
18
+ display: flex;
19
+ flex-wrap: wrap;
20
+ justify-content: center;
21
+ }
22
+ .hotkeys-list {
23
+ text-align: center;
24
+ line-height: 30px;
25
+ color: #888;
26
+ }
27
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export declare const GhostWidget: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<unknown>>;
@@ -0,0 +1,33 @@
1
+ import React, { useRef, useEffect } from 'react';
2
+ import { useCursor, usePrefix, useDesigner } from '../../hooks';
3
+ import { CursorStatus } from '@formily-design/core';
4
+ import { autorun } from '@formily/reactive';
5
+ import { observer } from '@formily/reactive-react';
6
+ import { NodeTitleWidget } from '../NodeTitleWidget';
7
+ import './styles.less';
8
+ export const GhostWidget = observer(() => {
9
+ const designer = useDesigner();
10
+ const cursor = useCursor();
11
+ const ref = useRef();
12
+ const prefix = usePrefix('ghost');
13
+ const movingNodes = designer.findMovingNodes();
14
+ const firstNode = movingNodes[0];
15
+ useEffect(() => autorun(() => {
16
+ var _a, _b;
17
+ const transform = `perspective(1px) translate3d(${((_a = cursor.position) === null || _a === void 0 ? void 0 : _a.topClientX) - 18}px,${((_b = cursor.position) === null || _b === void 0 ? void 0 : _b.topClientY) - 12}px,0) scale(0.8)`;
18
+ if (!ref.current)
19
+ return;
20
+ ref.current.style.transform = transform;
21
+ }), [designer, cursor]);
22
+ const renderNodes = () => {
23
+ return (React.createElement("span", { style: {
24
+ whiteSpace: 'nowrap',
25
+ } },
26
+ React.createElement(NodeTitleWidget, { node: firstNode }),
27
+ movingNodes.length > 1 ? '...' : ''));
28
+ };
29
+ if (!firstNode)
30
+ return null;
31
+ return cursor.status === CursorStatus.Dragging ? (React.createElement("div", { ref: ref, className: prefix }, renderNodes())) : null;
32
+ });
33
+ GhostWidget.displayName = 'GhostWidget';
@@ -0,0 +1,20 @@
1
+ @import '../../variables.less';
2
+
3
+ .@{prefix-cls}-ghost {
4
+ padding-left: 25px;
5
+ padding-right: 15px;
6
+ height: 30px;
7
+ display: flex;
8
+ justify-content: center;
9
+ align-items: center;
10
+ position: fixed;
11
+ color: var(--dn-ghost-color);
12
+ font-size: 12px;
13
+ z-index: 9999;
14
+ border-radius: 50px;
15
+ background-color: var(--dn-ghost-bg-color);
16
+ pointer-events: none;
17
+ left: 0;
18
+ top: 0;
19
+ transform: translate3d(0, 0, 0);
20
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export declare const HistoryWidget: React.FC;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import format from 'dateformat';
3
+ import { observer } from '@formily/reactive-react';
4
+ import { usePrefix, useWorkbench } from '../../hooks';
5
+ import { TextWidget } from '../TextWidget';
6
+ import cls from 'classnames';
7
+ import './styles.less';
8
+ export const HistoryWidget = observer(() => {
9
+ const workbench = useWorkbench();
10
+ const currentWorkspace = (workbench === null || workbench === void 0 ? void 0 : workbench.activeWorkspace) || (workbench === null || workbench === void 0 ? void 0 : workbench.currentWorkspace);
11
+ const prefix = usePrefix('history');
12
+ if (!currentWorkspace)
13
+ return null;
14
+ return (React.createElement("div", { className: prefix }, currentWorkspace.history.list().map((item, index) => {
15
+ const type = item.type || 'default_state';
16
+ const token = type.replace(/\:/g, '_');
17
+ return (React.createElement("div", { className: cls(prefix + '-item', {
18
+ active: currentWorkspace.history.current === index,
19
+ }), key: item.timestamp, onClick: () => {
20
+ currentWorkspace.history.goTo(index);
21
+ } },
22
+ React.createElement("span", { className: prefix + '-item-title' },
23
+ React.createElement(TextWidget, { token: `operations.${token}` })),
24
+ React.createElement("span", { className: prefix + '-item-timestamp' },
25
+ ' ',
26
+ format(item.timestamp, 'yy/mm/dd HH:MM:ss'))));
27
+ })));
28
+ });
@@ -0,0 +1,23 @@
1
+ @import '../../variables.less';
2
+
3
+ .@{prefix-cls}-history {
4
+ &-item {
5
+ display: flex;
6
+ justify-content: space-between;
7
+ min-height: 32px;
8
+ padding: 0 10px;
9
+ align-items: center;
10
+ cursor: pointer;
11
+ color: var(--dn-outline-tree-node-header-color);
12
+ &-timestamp {
13
+ font-size: 10px;
14
+ }
15
+ &:hover {
16
+ background-color: var(--dn-panel-active-bg-color);
17
+ }
18
+
19
+ &.active {
20
+ background-color: var(--dn-panel-active-bg-color);
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { TooltipProps } from 'antd';
3
+ import './styles.less';
4
+ export interface IconProviderProps {
5
+ children?: React.ReactNode;
6
+ tooltip?: boolean;
7
+ }
8
+ export interface IShadowSVGProps {
9
+ content?: string;
10
+ width?: number | string;
11
+ height?: number | string;
12
+ }
13
+ export interface IIconWidgetProps extends React.HTMLAttributes<HTMLElement> {
14
+ tooltip?: React.ReactNode | TooltipProps;
15
+ infer: React.ReactNode | {
16
+ shadow: string;
17
+ };
18
+ size?: number | string;
19
+ }
20
+ export declare const IconWidget: React.FC<IIconWidgetProps> & {
21
+ Provider?: React.FC<IconProviderProps>;
22
+ ShadowSVG?: React.FC<IShadowSVGProps>;
23
+ };
@@ -0,0 +1,102 @@
1
+ import React, { createContext, useContext, useEffect, useRef } from 'react';
2
+ import { isStr, isFn, isObj, isPlainObj } from '@formily-design/shared';
3
+ import { observer } from '@formily/reactive-react';
4
+ import { Tooltip } from 'antd';
5
+ import { usePrefix, useRegistry, useTheme } from '../../hooks';
6
+ import cls from 'classnames';
7
+ import './styles.less';
8
+ const IconContext = createContext(null);
9
+ const isNumSize = (val) => /^[\d.]+$/.test(val);
10
+ export const IconWidget = observer((props) => {
11
+ var _a, _b, _c;
12
+ const theme = useTheme();
13
+ const context = useContext(IconContext);
14
+ const registry = useRegistry();
15
+ const prefix = usePrefix('icon');
16
+ const size = props.size || '1em';
17
+ const height = ((_a = props.style) === null || _a === void 0 ? void 0 : _a.height) || size;
18
+ const width = ((_b = props.style) === null || _b === void 0 ? void 0 : _b.width) || size;
19
+ const takeIcon = (infer) => {
20
+ if (isStr(infer)) {
21
+ const finded = registry.getDesignerIcon(infer);
22
+ if (finded) {
23
+ return takeIcon(finded);
24
+ }
25
+ return React.createElement("img", { src: infer, height: height, width: width });
26
+ }
27
+ else if (isFn(infer)) {
28
+ return React.createElement(infer, {
29
+ height,
30
+ width,
31
+ fill: 'currentColor',
32
+ });
33
+ }
34
+ else if (React.isValidElement(infer)) {
35
+ if (infer.type === 'svg') {
36
+ const svgProps = {
37
+ height,
38
+ width,
39
+ fill: 'currentColor',
40
+ viewBox: infer.props.viewBox || '0 0 1024 1024',
41
+ focusable: 'false',
42
+ 'aria-hidden': 'true',
43
+ };
44
+ return React.cloneElement(infer, svgProps);
45
+ }
46
+ else if (infer.type === 'path' || infer.type === 'g') {
47
+ return (React.createElement("svg", { viewBox: "0 0 1024 1024", height: height, width: width, fill: "currentColor", focusable: "false", "aria-hidden": "true" }, infer));
48
+ }
49
+ return infer;
50
+ }
51
+ else if (isPlainObj(infer)) {
52
+ if (infer[theme]) {
53
+ return takeIcon(infer[theme]);
54
+ }
55
+ else if (infer['shadow']) {
56
+ return (React.createElement(IconWidget.ShadowSVG, { width: width, height: height, content: infer['shadow'] }));
57
+ }
58
+ return null;
59
+ }
60
+ };
61
+ const renderTooltips = (children) => {
62
+ if (!isStr(props.infer) && (context === null || context === void 0 ? void 0 : context.tooltip))
63
+ return children;
64
+ const tooltip = props.tooltip || registry.getDesignerMessage(`icons.${props.infer}`);
65
+ if (tooltip) {
66
+ const title = React.isValidElement(tooltip) || isStr(tooltip)
67
+ ? tooltip
68
+ : tooltip.title;
69
+ const props = React.isValidElement(tooltip) || isStr(tooltip)
70
+ ? {}
71
+ : isObj(tooltip)
72
+ ? tooltip
73
+ : {};
74
+ return (React.createElement(Tooltip, { ...props, title: title }, children));
75
+ }
76
+ return children;
77
+ };
78
+ if (!props.infer)
79
+ return null;
80
+ return renderTooltips(React.createElement("span", { ...props, className: cls(prefix, props.className), style: {
81
+ ...props.style,
82
+ cursor: props.onClick ? 'pointer' : (_c = props.style) === null || _c === void 0 ? void 0 : _c.cursor,
83
+ } }, takeIcon(props.infer)));
84
+ });
85
+ IconWidget.ShadowSVG = (props) => {
86
+ const ref = useRef();
87
+ const width = isNumSize(props.width) ? `${props.width}px` : props.width;
88
+ const height = isNumSize(props.height) ? `${props.height}px` : props.height;
89
+ useEffect(() => {
90
+ if (ref.current) {
91
+ const root = ref.current.shadowRoot ||
92
+ ref.current.attachShadow({
93
+ mode: 'open',
94
+ });
95
+ root.innerHTML = `<svg viewBox="0 0 1024 1024" style="width:${width};height:${height}">${props.content}</svg>`;
96
+ }
97
+ }, []);
98
+ return React.createElement("div", { ref: ref });
99
+ };
100
+ IconWidget.Provider = (props) => {
101
+ return (React.createElement(IconContext.Provider, { value: props }, props.children));
102
+ };
@@ -0,0 +1,17 @@
1
+ @import '../../variables.less';
2
+
3
+ .@{prefix-cls}-icon {
4
+ display: inline-block;
5
+ color: inherit;
6
+ font-style: normal;
7
+ line-height: 0;
8
+ text-align: center;
9
+ text-transform: none;
10
+ vertical-align: -0.125em;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ svg {
15
+ pointer-events: none;
16
+ }
17
+ }
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { TypographyProps } from 'antd';
3
+ import './styles.less';
4
+ export interface INodeActionsWidgetProps {
5
+ children?: React.ReactNode;
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ activeShown?: boolean;
9
+ }
10
+ export interface INodeActionsWidgetActionProps extends Omit<React.ComponentProps<'a'>, 'title' | 'type' | 'ref'>, Partial<TypographyProps['Link']> {
11
+ className?: string;
12
+ style?: React.CSSProperties;
13
+ title: React.ReactNode;
14
+ icon?: React.ReactNode;
15
+ }
16
+ export declare const NodeActionsWidget: React.FC<INodeActionsWidgetProps> & {
17
+ Action?: React.FC<INodeActionsWidgetActionProps>;
18
+ };
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { Space, Typography, Divider } from 'antd';
3
+ import { observer } from '@formily/reactive-react';
4
+ import { usePrefix, useTreeNode, useSelected } from '../../hooks';
5
+ import { IconWidget } from '../IconWidget';
6
+ import { TextWidget } from '../TextWidget';
7
+ import cls from 'classnames';
8
+ import './styles.less';
9
+ export const NodeActionsWidget = observer((props) => {
10
+ const node = useTreeNode();
11
+ const prefix = usePrefix('node-actions');
12
+ const selected = useSelected();
13
+ if (selected.indexOf(node.id) === -1 && props.activeShown)
14
+ return null;
15
+ return (React.createElement("div", { className: cls(prefix, props.className), style: props.style },
16
+ React.createElement("div", { className: prefix + '-content' },
17
+ React.createElement(Space, { split: React.createElement(Divider, { type: "vertical" }) }, props.children))));
18
+ });
19
+ NodeActionsWidget.Action = ({ icon, title, ...props }) => {
20
+ const prefix = usePrefix('node-actions-item');
21
+ return (React.createElement(Typography.Link, { ...props, className: cls(props.className, prefix), "data-click-stop-propagation": "true" },
22
+ React.createElement("span", { className: prefix + '-text' },
23
+ React.createElement(IconWidget, { infer: icon }),
24
+ React.createElement(TextWidget, null, title))));
25
+ };
@@ -0,0 +1,51 @@
1
+ .dn-node-actions {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ width: 100%;
6
+ overflow: hidden;
7
+ padding-top: 8px;
8
+ padding-bottom: 8px;
9
+ &-content {
10
+ position: relative;
11
+ padding: 0 20px;
12
+ display: flex;
13
+ align-items: center;
14
+ line-height: 1;
15
+ &::before {
16
+ position: absolute;
17
+ content: '';
18
+ display: block;
19
+ height: 0;
20
+ width: 300%;
21
+ top: 50%;
22
+ border-bottom: 1px dashed #d9d9d9;
23
+ right: 100%;
24
+ }
25
+ &::after {
26
+ position: absolute;
27
+ content: '';
28
+ display: block;
29
+ height: 0;
30
+ width: 300%;
31
+ top: 50%;
32
+ border-bottom: 1px dashed #d9d9d9;
33
+ left: 100%;
34
+ }
35
+ a {
36
+ &:hover {
37
+ }
38
+ }
39
+ }
40
+ &-item {
41
+ &-text {
42
+ font-size: 10px;
43
+ display: flex;
44
+ align-items: center;
45
+ line-height: 1;
46
+ .dn-icon {
47
+ margin-right: 6px;
48
+ }
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export interface INodePathWidgetProps {
4
+ workspaceId?: string;
5
+ maxItems?: number;
6
+ }
7
+ export declare const NodePathWidget: React.FC<INodePathWidgetProps>;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { Breadcrumb } from 'antd';
3
+ import { useSelectedNode, useSelection, usePrefix, useHover } from '../../hooks';
4
+ import { IconWidget } from '../IconWidget';
5
+ import { NodeTitleWidget } from '../NodeTitleWidget';
6
+ import { observer } from '@formily/reactive-react';
7
+ import './styles.less';
8
+ export const NodePathWidget = observer((props) => {
9
+ var _a;
10
+ const selected = useSelectedNode(props.workspaceId);
11
+ const selection = useSelection(props.workspaceId);
12
+ const hover = useHover(props.workspaceId);
13
+ const prefix = usePrefix('node-path');
14
+ if (!selected)
15
+ return React.createElement(React.Fragment, null);
16
+ const maxItems = (_a = props.maxItems) !== null && _a !== void 0 ? _a : 3;
17
+ const nodes = selected
18
+ .getParents()
19
+ .slice(0, maxItems - 1)
20
+ .reverse()
21
+ .concat(selected);
22
+ return (React.createElement(Breadcrumb, { className: prefix, items: nodes.map((node, key) => {
23
+ return {
24
+ title: (React.createElement(React.Fragment, null,
25
+ key === 0 && (React.createElement(IconWidget, { infer: "Position", style: { marginRight: 3 } })),
26
+ React.createElement("a", { href: "", onMouseEnter: () => {
27
+ hover.setHover(node);
28
+ }, onClick: (e) => {
29
+ e.stopPropagation();
30
+ e.preventDefault();
31
+ selection.select(node);
32
+ } },
33
+ React.createElement(NodeTitleWidget, { node: node })))),
34
+ };
35
+ }) }));
36
+ });
@@ -0,0 +1,16 @@
1
+ .dn-node-path {
2
+ padding: 4px 10px !important;
3
+ border-bottom: 1px solid var(--dn-panel-border-color);
4
+
5
+ .dn-icon {
6
+ font-size: 11px;
7
+ }
8
+
9
+ .ant-breadcrumb-separator {
10
+ margin: 0 4px !important;
11
+ }
12
+
13
+ a {
14
+ font-size: 12px;
15
+ }
16
+ }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { TreeNode } from '@formily-design/core';
3
+ export interface INodeTitleWidgetProps {
4
+ node: TreeNode;
5
+ }
6
+ export declare const NodeTitleWidget: React.FC<INodeTitleWidgetProps>;
@@ -0,0 +1,13 @@
1
+ import React, { Fragment } from 'react';
2
+ import { observer } from '@formily/reactive-react';
3
+ export const NodeTitleWidget = observer((props) => {
4
+ const takeNode = () => {
5
+ const node = props.node;
6
+ if (node.componentName === '$$ResourceNode$$') {
7
+ return node.children[0];
8
+ }
9
+ return node;
10
+ };
11
+ const node = takeNode();
12
+ return React.createElement(Fragment, null, node.getMessage('title') || node.componentName);
13
+ });
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export interface IInsertionProps {
3
+ workspaceId?: string;
4
+ }
5
+ export declare const Insertion: React.FC<IInsertionProps>;
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import { useMoveHelper, usePrefix } from '../../hooks';
3
+ import { ClosestPosition } from '@formily-design/core';
4
+ import { observer } from '@formily/reactive-react';
5
+ export const Insertion = observer(({ workspaceId }) => {
6
+ const moveHelper = useMoveHelper(workspaceId);
7
+ const prefix = usePrefix('outline-tree-insertion');
8
+ const createInsertionStyle = () => {
9
+ const closestDirection = moveHelper.outlineClosestDirection;
10
+ const closestRect = moveHelper.outlineClosestOffsetRect;
11
+ const baseStyle = {
12
+ position: 'absolute',
13
+ transform: 'perspective(1px) translate3d(0,0,0)',
14
+ top: 0,
15
+ left: 0,
16
+ };
17
+ if (!closestRect)
18
+ return baseStyle;
19
+ if (closestDirection === ClosestPosition.After ||
20
+ closestDirection === ClosestPosition.InnerAfter ||
21
+ closestDirection === ClosestPosition.Under ||
22
+ closestDirection === ClosestPosition.ForbidAfter ||
23
+ closestDirection === ClosestPosition.ForbidInnerAfter ||
24
+ closestDirection === ClosestPosition.ForbidUnder) {
25
+ baseStyle.width = closestRect.width;
26
+ baseStyle.height = 2;
27
+ baseStyle.transform = `perspective(1px) translate3d(${closestRect.x}px,${closestRect.y + closestRect.height - 2}px,0)`;
28
+ }
29
+ else if (closestDirection === ClosestPosition.Before ||
30
+ closestDirection === ClosestPosition.InnerBefore ||
31
+ closestDirection === ClosestPosition.Upper ||
32
+ closestDirection === ClosestPosition.ForbidBefore ||
33
+ closestDirection === ClosestPosition.ForbidInnerBefore ||
34
+ closestDirection === ClosestPosition.ForbidUpper) {
35
+ baseStyle.width = closestRect.width;
36
+ baseStyle.height = 2;
37
+ baseStyle.transform = `perspective(1px) translate3d(${closestRect.x}px,${closestRect.y}px,0)`;
38
+ }
39
+ if (closestDirection.includes('FORBID')) {
40
+ baseStyle.backgroundColor = 'red';
41
+ }
42
+ else {
43
+ baseStyle.backgroundColor = '';
44
+ }
45
+ return baseStyle;
46
+ };
47
+ if (!(moveHelper === null || moveHelper === void 0 ? void 0 : moveHelper.closestNode))
48
+ return null;
49
+ return React.createElement("div", { className: prefix, style: createInsertionStyle() });
50
+ });
51
+ Insertion.displayName = 'Insertion';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { TreeNode } from '@formily-design/core';
3
+ import './styles.less';
4
+ export interface IOutlineTreeNodeProps {
5
+ node: TreeNode;
6
+ style?: React.CSSProperties;
7
+ className?: string;
8
+ workspaceId?: string;
9
+ }
10
+ export declare const OutlineTreeNode: React.FC<IOutlineTreeNodeProps>;