@riil-frontend/component-topology 6.0.0-alpha.4 → 6.0.0-alpha.41

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 (335) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +35 -35
  5. package/es/components/ColorPanel/components/ColorBlock/index.js +37 -0
  6. package/es/components/ColorPanel/components/ColorBlock/index.module.scss +9 -0
  7. package/es/components/ColorPanel/components/FontColorRange/index.js +35 -0
  8. package/es/components/ColorPanel/components/FontColorRange/index.module.scss +25 -0
  9. package/es/components/ColorPanel/index.js +237 -0
  10. package/es/components/ColorPanel/index.module.scss +35 -0
  11. package/es/components/VerticalIconTab/VerticalIconTab.module.scss +5 -1
  12. package/es/components/collapse/Collapse.js +22 -3
  13. package/es/components/collapse/Collapse.module.scss +24 -0
  14. package/es/components/collapse/index.js +2 -0
  15. package/es/core/common/hooks/useHtElements.js +21 -0
  16. package/es/core/common/icons/icon.js +41 -0
  17. package/es/core/common/icons/useIcons.js +8 -16
  18. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
  19. package/es/core/components/AlarmListPanel/components/index.module.scss +5 -5
  20. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  21. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +9 -3
  22. package/es/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +122 -0
  23. package/es/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
  24. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +76 -19
  25. package/es/core/components/TopoView/GraphViewPanel.js +21 -0
  26. package/es/core/components/TopoView/editor.module.scss +1 -0
  27. package/es/core/components/TopoView/topoView.js +29 -49
  28. package/es/core/components/titlebar/TitleBar.module.scss +1 -1
  29. package/es/core/editor/components/EditorPlugin.js +2 -1
  30. package/es/core/editor/components/Sidebar/Sidebar.js +41 -50
  31. package/es/core/editor/components/Sidebar/panes.js +32 -0
  32. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +38 -0
  33. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
  34. package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +1 -1
  35. package/es/core/editor/components/Sidebar/views/CanvasPanel/themes.js +63 -0
  36. package/es/core/editor/components/Sidebar/views/CanvasPanel/useCanvasThemeConfig.js +115 -0
  37. package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +3 -3
  38. package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +14 -6
  39. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +14 -5
  40. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
  41. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +20 -7
  42. package/es/core/editor/components/Toolbar/EditorToolbar.js +23 -13
  43. package/es/core/editor/components/Toolbar/Toolbar.js +1 -1
  44. package/es/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
  45. package/es/core/editor/components/Toolbar/buttons.js +20 -18
  46. package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +8 -7
  47. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +2 -2
  48. package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
  49. package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
  50. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +46 -2
  51. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +98 -6
  52. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +184 -3
  53. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
  54. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +53 -0
  55. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
  56. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +77 -0
  57. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +74 -6
  58. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +70 -16
  59. package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +43 -0
  60. package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +25 -11
  61. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +29 -13
  62. package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +100 -39
  63. package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +3 -2
  64. package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -4
  65. package/es/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +109 -0
  66. package/es/core/editor/components/Toolbar/widgets/IconSelect/constant.js +64 -0
  67. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.js +101 -0
  68. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
  69. package/es/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +49 -0
  70. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +99 -0
  71. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  72. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +42 -0
  73. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  74. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +75 -0
  75. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  76. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +23 -0
  77. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +10 -0
  78. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  79. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  80. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  81. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  82. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +31 -0
  83. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  84. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +128 -15
  85. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +95 -23
  86. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +33 -0
  87. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +15 -5
  88. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +41 -7
  89. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +98 -13
  90. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  91. package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +15 -22
  92. package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
  93. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +5 -3
  94. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +3 -0
  95. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +21 -3
  96. package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +16 -6
  97. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +49 -0
  98. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +59 -0
  99. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +30 -0
  100. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +25 -0
  101. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +41 -0
  102. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +14 -0
  103. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +49 -0
  104. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +36 -0
  105. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +32 -0
  106. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +71 -0
  107. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +25 -0
  108. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +52 -0
  109. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +20 -0
  110. package/es/core/editor/components/settings/CloseablePanel.js +33 -0
  111. package/es/core/editor/components/settings/CloseablePanel.module.scss +9 -0
  112. package/es/core/editor/components/settings/OpenPropertyPanelListener.js +33 -0
  113. package/es/core/editor/components/settings/PropertyView.js +29 -8
  114. package/es/core/editor/components/settings/Settings.js +4 -44
  115. package/es/core/editor/components/settings/Settings.module.scss +8 -4
  116. package/es/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +2 -2
  117. package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +80 -0
  118. package/es/core/editor/components/settings/common/AlignSetting/index.js +20 -72
  119. package/es/core/editor/components/settings/common/LineType/index.js +12 -119
  120. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +3 -3
  121. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +31 -21
  122. package/es/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +7 -6
  123. package/es/core/editor/components/settings/common/text/fontStyleUtil.js +11 -19
  124. package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -1
  125. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
  126. package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +8 -9
  127. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
  128. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  129. package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +1 -1
  130. package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +9 -6
  131. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +8 -4
  132. package/es/core/editor/hooks/useKeyboardShortcut.js +42 -0
  133. package/es/core/{store/models → editor/store}/background.js +0 -0
  134. package/es/core/{store/models → editor/store}/historyManager.js +0 -0
  135. package/es/core/editor/store/topoEdit.js +49 -0
  136. package/es/core/editor/utils/edgeTypeStyleUtil.js +96 -0
  137. package/es/core/editor/utils/textStyleUtil.js +0 -0
  138. package/es/core/hooks/useCanvasTheme.js +61 -0
  139. package/es/core/hooks/usePolling.js +2 -5
  140. package/es/core/hooks/useTopoEdit.js +38 -58
  141. package/es/core/models/Alarm.js +2 -2
  142. package/es/core/models/AttributeMetricDisplay.js +4 -0
  143. package/es/core/models/HistoryManager.js +11 -3
  144. package/es/core/models/SelectionManager.js +28 -9
  145. package/es/core/models/TopoApp.js +1 -1
  146. package/es/core/models/TopoGraphView.js +8 -2
  147. package/es/core/models/selection/ignoreList.js +1 -0
  148. package/es/core/models/utils/linkUtils.js +5 -6
  149. package/es/core/store/coreModels.js +6 -7
  150. package/es/core/store/models/selection.js +2 -1
  151. package/es/core/store/models/topoBizMod.js +0 -3
  152. package/es/core/store/models/topoConfig.js +10 -12
  153. package/es/core/store/models/topoMod.js +26 -28
  154. package/es/core/utils/edgeUtil.js +6 -0
  155. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +3 -4
  156. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +19 -5
  157. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
  158. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
  159. package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  160. package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  161. package/es/networkTopo/createTopo.js +2 -0
  162. package/es/networkTopo/services/link.js +2 -2
  163. package/es/networkTopo/store/topoTreeMod.js +6 -7
  164. package/es/style.js +1 -0
  165. package/es/utils/htElementUtils.js +3 -0
  166. package/es/utils/topoData.js +1 -0
  167. package/lib/components/ColorPanel/components/ColorBlock/index.js +47 -0
  168. package/lib/components/ColorPanel/components/ColorBlock/index.module.scss +9 -0
  169. package/lib/components/ColorPanel/components/FontColorRange/index.js +49 -0
  170. package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +25 -0
  171. package/lib/components/ColorPanel/index.js +255 -0
  172. package/lib/components/ColorPanel/index.module.scss +35 -0
  173. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +5 -1
  174. package/lib/components/collapse/Collapse.js +28 -3
  175. package/lib/components/collapse/Collapse.module.scss +24 -0
  176. package/lib/components/collapse/index.js +11 -0
  177. package/lib/core/common/hooks/useHtElements.js +27 -0
  178. package/lib/core/common/icons/icon.js +48 -0
  179. package/lib/core/common/icons/useIcons.js +10 -15
  180. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
  181. package/lib/core/components/AlarmListPanel/components/index.module.scss +5 -5
  182. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  183. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +10 -3
  184. package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +147 -0
  185. package/lib/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
  186. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +76 -19
  187. package/lib/core/components/TopoView/GraphViewPanel.js +31 -0
  188. package/lib/core/components/TopoView/editor.module.scss +1 -0
  189. package/lib/core/components/TopoView/topoView.js +32 -50
  190. package/lib/core/components/titlebar/TitleBar.module.scss +1 -1
  191. package/lib/core/editor/components/EditorPlugin.js +3 -1
  192. package/lib/core/editor/components/Sidebar/Sidebar.js +40 -53
  193. package/lib/core/editor/components/Sidebar/panes.js +45 -0
  194. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +53 -0
  195. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
  196. package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -2
  197. package/lib/core/editor/components/Sidebar/views/CanvasPanel/themes.js +72 -0
  198. package/lib/core/editor/components/Sidebar/views/CanvasPanel/useCanvasThemeConfig.js +128 -0
  199. package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
  200. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +15 -6
  201. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +16 -5
  202. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
  203. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +29 -11
  204. package/lib/core/editor/components/Toolbar/EditorToolbar.js +22 -11
  205. package/lib/core/editor/components/Toolbar/Toolbar.js +1 -1
  206. package/lib/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
  207. package/lib/core/editor/components/Toolbar/buttons.js +21 -20
  208. package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +8 -7
  209. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +2 -2
  210. package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
  211. package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
  212. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +48 -2
  213. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +100 -6
  214. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +194 -3
  215. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
  216. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +71 -0
  217. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
  218. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +83 -0
  219. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +76 -5
  220. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +75 -16
  221. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +43 -0
  222. package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +26 -10
  223. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +30 -12
  224. package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +105 -39
  225. package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +4 -2
  226. package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -3
  227. package/lib/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +126 -0
  228. package/lib/core/editor/components/Toolbar/widgets/IconSelect/constant.js +69 -0
  229. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.js +117 -0
  230. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
  231. package/lib/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +61 -0
  232. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +116 -0
  233. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  234. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +55 -0
  235. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  236. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +93 -0
  237. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  238. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +32 -0
  239. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +22 -0
  240. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  241. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  242. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  243. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  244. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +44 -0
  245. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  246. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +133 -16
  247. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +98 -23
  248. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +33 -0
  249. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +21 -5
  250. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +41 -6
  251. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +99 -12
  252. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  253. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +16 -22
  254. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
  255. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +5 -3
  256. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +3 -0
  257. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +21 -3
  258. package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +17 -6
  259. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +63 -0
  260. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +72 -0
  261. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +45 -0
  262. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +40 -0
  263. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +57 -0
  264. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +28 -0
  265. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +64 -0
  266. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +52 -0
  267. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +47 -0
  268. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +83 -0
  269. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +39 -0
  270. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +65 -0
  271. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +31 -0
  272. package/lib/core/editor/components/settings/CloseablePanel.js +46 -0
  273. package/lib/core/editor/components/settings/CloseablePanel.module.scss +9 -0
  274. package/lib/core/editor/components/settings/OpenPropertyPanelListener.js +43 -0
  275. package/lib/core/editor/components/settings/PropertyView.js +32 -8
  276. package/lib/core/editor/components/settings/Settings.js +4 -44
  277. package/lib/core/editor/components/settings/Settings.module.scss +8 -4
  278. package/lib/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +2 -2
  279. package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +97 -0
  280. package/lib/core/editor/components/settings/common/AlignSetting/index.js +21 -80
  281. package/lib/core/editor/components/settings/common/LineType/index.js +13 -126
  282. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +2 -2
  283. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +32 -23
  284. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +6 -6
  285. package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +12 -20
  286. package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -1
  287. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
  288. package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +6 -8
  289. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
  290. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  291. package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +1 -1
  292. package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +7 -5
  293. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -1
  294. package/lib/core/editor/hooks/useKeyboardShortcut.js +52 -0
  295. package/lib/core/{store/models → editor/store}/background.js +0 -0
  296. package/lib/core/{store/models → editor/store}/historyManager.js +0 -0
  297. package/lib/core/editor/store/topoEdit.js +59 -0
  298. package/lib/core/editor/utils/edgeTypeStyleUtil.js +109 -0
  299. package/lib/core/editor/utils/textStyleUtil.js +1 -0
  300. package/lib/core/hooks/useCanvasTheme.js +75 -0
  301. package/lib/core/hooks/usePolling.js +2 -5
  302. package/lib/core/hooks/useTopoEdit.js +39 -60
  303. package/lib/core/models/Alarm.js +2 -2
  304. package/lib/core/models/AttributeMetricDisplay.js +4 -0
  305. package/lib/core/models/HistoryManager.js +11 -3
  306. package/lib/core/models/SelectionManager.js +30 -9
  307. package/lib/core/models/TopoApp.js +1 -1
  308. package/lib/core/models/TopoGraphView.js +8 -2
  309. package/lib/core/models/selection/ignoreList.js +6 -0
  310. package/lib/core/models/utils/linkUtils.js +5 -6
  311. package/lib/core/store/coreModels.js +5 -7
  312. package/lib/core/store/models/selection.js +2 -1
  313. package/lib/core/store/models/topoBizMod.js +0 -3
  314. package/lib/core/store/models/topoConfig.js +9 -18
  315. package/lib/core/store/models/topoMod.js +27 -29
  316. package/lib/core/utils/edgeUtil.js +6 -0
  317. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +3 -4
  318. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +19 -5
  319. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
  320. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
  321. package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  322. package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  323. package/lib/networkTopo/createTopo.js +3 -0
  324. package/lib/networkTopo/services/link.js +2 -2
  325. package/lib/networkTopo/store/topoTreeMod.js +6 -8
  326. package/lib/style.js +1 -0
  327. package/lib/utils/htElementUtils.js +5 -0
  328. package/lib/utils/topoData.js +1 -0
  329. package/package.json +5 -4
  330. package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -4
  331. package/es/core/store/models/topoEdit.js +0 -39
  332. package/es/core/store/models/topoView.js +0 -36
  333. package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -12
  334. package/lib/core/store/models/topoEdit.js +0 -51
  335. package/lib/core/store/models/topoView.js +0 -47
@@ -7,10 +7,12 @@ import rlog from '@riil-frontend/component-topology-utils/lib/rlog';
7
7
  import Drawer from "../../../components/Drawer";
8
8
  import DisplaySetting from "./DisplaySetting";
9
9
  import useDisplaySetting from "./hooks/useDisplaySetting";
10
+ import EditorDisplaySetting from "./EditorDisplaySetting";
10
11
  export default function DisplaySettingDrawer(props) {
11
12
  var visible = props.visible,
12
13
  topo = props.topo,
13
14
  displaySettingProps = props.displaySettingProps,
15
+ isEditor = props.isEditor,
14
16
  onClose = props.onClose;
15
17
  var settingRef = useRef();
16
18
 
@@ -19,7 +21,8 @@ export default function DisplaySettingDrawer(props) {
19
21
  setLoading = _useState[1];
20
22
 
21
23
  var displaySetting = useDisplaySetting(_extends({}, props, {
22
- settingRef: settingRef
24
+ settingRef: settingRef,
25
+ isEditor: isEditor
23
26
  }));
24
27
 
25
28
  var handleOk = /*#__PURE__*/function () {
@@ -37,7 +40,9 @@ export default function DisplaySettingDrawer(props) {
37
40
  setLoading(false);
38
41
  onClose();
39
42
 
40
- _Message.success('保存成功');
43
+ if (!isEditor) {
44
+ _Message.success('保存成功');
45
+ }
41
46
 
42
47
  _context.next = 14;
43
48
  break;
@@ -63,6 +68,7 @@ export default function DisplaySettingDrawer(props) {
63
68
  };
64
69
  }();
65
70
 
71
+ var DisplaySettingWidget = isEditor ? EditorDisplaySetting : DisplaySetting;
66
72
  return /*#__PURE__*/React.createElement(Drawer, {
67
73
  title: "\u663E\u793A\u8BBE\u7F6E",
68
74
  visible: visible,
@@ -74,7 +80,7 @@ export default function DisplaySettingDrawer(props) {
74
80
 
75
81
  },
76
82
  buttons: ['保存', '取消']
77
- }, visible && /*#__PURE__*/React.createElement(DisplaySetting, {
83
+ }, visible && /*#__PURE__*/React.createElement(DisplaySettingWidget, {
78
84
  ref: settingRef,
79
85
  topo: topo,
80
86
  displaySettingProps: displaySettingProps
@@ -0,0 +1,122 @@
1
+ import _Box from "@alifd/next/es/box";
2
+ import _Form from "@alifd/next/es/form";
3
+ import _extends from "@babel/runtime/helpers/extends";
4
+ import _Field from "@alifd/next/es/field";
5
+ import React, { useEffect, useImperativeHandle, useState } from 'react';
6
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
7
+ import NodeTag from "./NodeTag";
8
+ import EdgeFlow from "./EdgeFlow";
9
+ import NodeTip from "./NodeTip";
10
+ import LineExpandAllRadioGroup from "./LineExpandAllRadioGroup";
11
+ import EdgeFlowDirection from "./EdgeFlowDirection";
12
+ import BooleanRadio from "../../../components/BooleanRadio";
13
+ /**
14
+ * 显示设置
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+
20
+ function EditorDisplaySetting(props, ref) {
21
+ var topo = props.topo,
22
+ displaySettingProps = props.displaySettingProps;
23
+ var displayConfig = topo.store.getModelState('displayConfig');
24
+
25
+ var _ref = displaySettingProps || {},
26
+ linkTagConfig = _ref.linkTagConfig,
27
+ linkTipConfig = _ref.linkTipConfig,
28
+ showEdgeExpandConfig = _ref.showEdgeExpandConfig,
29
+ extraConfig = _ref.extraConfig,
30
+ showLinkConfig = _ref.showLinkConfig,
31
+ nodeTagProps = _ref.nodeTagProps,
32
+ nodeTipProps = _ref.nodeTipProps,
33
+ isNetworkTopo = _ref.isNetworkTopo;
34
+
35
+ var field = _Field.useField({
36
+ autoUnmount: false,
37
+ values: {
38
+ alarmSwitch: displayConfig.alarmSwitch,
39
+ alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
40
+ nodeTag: displayConfig.nodeTag,
41
+ nodeTip: displayConfig.nodeTip,
42
+ linkTag: displayConfig.linkTag,
43
+ linkTip: displayConfig.linkTip,
44
+ expandAllEdges: displayConfig.expandAllEdges,
45
+ edgeFlow: displayConfig.edgeFlow,
46
+ edgeFlowDirection: displayConfig.edgeFlowDirection
47
+ },
48
+ onChange: function onChange(name, value) {
49
+ rlog.debug('DisplaySetting-onChange', name, value); // 告警静默设置
50
+
51
+ if (name === 'alarmSwitch') {
52
+ field.setValue('alarmListDefaultOpen', !!value);
53
+ }
54
+ }
55
+ });
56
+
57
+ useImperativeHandle(ref, function () {
58
+ return field;
59
+ });
60
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Form, {
61
+ field: field,
62
+ labelAlign: "top"
63
+ }, /*#__PURE__*/React.createElement(_Form.Item, {
64
+ label: /*#__PURE__*/React.createElement(Label, {
65
+ label: "\u8D44\u6E90\u6807\u6CE8",
66
+ helpText: "\u6700\u591A\u652F\u6301\u52FE\u90093\u9879"
67
+ })
68
+ }, /*#__PURE__*/React.createElement(NodeTag, _extends({}, nodeTagProps, {
69
+ name: "nodeTag",
70
+ topo: topo
71
+ }))), linkTagConfig && /*#__PURE__*/React.createElement(_Form.Item, {
72
+ label: /*#__PURE__*/React.createElement(Label, {
73
+ label: "\u94FE\u8DEF\u6807\u6CE8",
74
+ helpText: "\u6700\u591A\u652F\u6301\u52FE\u90092\u9879"
75
+ }),
76
+ patternTrigger: "onChange"
77
+ }, linkTagConfig({
78
+ name: "linkTag",
79
+ topo: topo
80
+ })), /*#__PURE__*/React.createElement(_Form.Item, {
81
+ label: /*#__PURE__*/React.createElement(Label, {
82
+ label: "\u8D44\u6E90\u60AC\u6D6E\u6846",
83
+ helpText: "\u6700\u591A\u652F\u6301\u52FE\u90094\u9879"
84
+ }),
85
+ patternTrigger: "onChange"
86
+ }, /*#__PURE__*/React.createElement(NodeTip, _extends({}, nodeTipProps, {
87
+ name: "nodeTip",
88
+ topo: topo
89
+ }))), linkTipConfig && /*#__PURE__*/React.createElement(_Form.Item, {
90
+ label: /*#__PURE__*/React.createElement(Label, {
91
+ label: "\u94FE\u8DEF\u60AC\u6D6E\u6846",
92
+ helpText: "\u6700\u591A\u652F\u6301\u52FE\u90094\u9879"
93
+ }),
94
+ patternTrigger: "onChange"
95
+ }, linkTipConfig({
96
+ name: "linkTip",
97
+ topo: topo
98
+ })), showEdgeExpandConfig && /*#__PURE__*/React.createElement(_Form.Item, {
99
+ label: /*#__PURE__*/React.createElement(LineExpandAllRadioGroup.Label, null),
100
+ patternTrigger: "onChange"
101
+ }, /*#__PURE__*/React.createElement(LineExpandAllRadioGroup, {
102
+ name: "expandAllEdges",
103
+ isNetworkTopo: isNetworkTopo
104
+ }))));
105
+ }
106
+
107
+ ;
108
+
109
+ function Label(props) {
110
+ var label = props.label,
111
+ helpText = props.helpText;
112
+ return /*#__PURE__*/React.createElement(_Box, {
113
+ direction: "row",
114
+ spacing: 12
115
+ }, /*#__PURE__*/React.createElement("div", null, label), /*#__PURE__*/React.createElement("div", {
116
+ style: {
117
+ color: '#638DB7'
118
+ }
119
+ }, helpText));
120
+ }
121
+
122
+ export default /*#__PURE__*/React.forwardRef(EditorDisplaySetting);
@@ -22,8 +22,6 @@ var LineExpandAllRadioGroup = /*#__PURE__*/React.forwardRef(function LineExpandA
22
22
  pluralType = _useState2[0],
23
23
  setPluralType = _useState2[1];
24
24
 
25
- console.log("LineExpandAllRadioGroup-value", value, pluralType);
26
-
27
25
  var handleTypeChange = function handleTypeChange(newValue) {
28
26
  setShowType(newValue); // console.log("handleTypeChange---newValue", newValue, pluralType);
29
27
 
@@ -64,7 +62,6 @@ var LineExpandAllRadioGroup = /*#__PURE__*/React.forwardRef(function LineExpandA
64
62
  }
65
63
  }
66
64
 
67
- console.log("creatTypeValue", v);
68
65
  return v;
69
66
  }; // useEffect(() => {
70
67
  // setPluralType(plurals[compatibleWith(value)] ?? []);
@@ -5,18 +5,44 @@ import topoService from '@riil-frontend/component-topology-common/es/services/to
5
5
  export default (function (props) {
6
6
  var topo = props.topo,
7
7
  displaySettingProps = props.displaySettingProps,
8
- settingRef = props.settingRef;
8
+ settingRef = props.settingRef,
9
+ isEditor = props.isEditor;
9
10
 
10
- var executeByConfig = /*#__PURE__*/function () {
11
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(config) {
11
+ var handleViewerSave = /*#__PURE__*/function () {
12
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
13
+ var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
12
14
  return _regeneratorRuntime.wrap(function _callee$(_context) {
13
15
  while (1) {
14
16
  switch (_context.prev = _context.next) {
15
17
  case 0:
18
+ values = settingRef.current.getValues(); // console.info('保存显示配置', values)
19
+ // 保存配置
20
+
21
+ prevDisplayConfig = topo.store.getModelState('displayConfig');
22
+ displayConfig = _extends({}, prevDisplayConfig, values);
23
+ _context.next = 5;
24
+ return topoService.saveTopoSettings(topo.id, {
25
+ alarmSwitch: displayConfig.alarmSwitch,
26
+ alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
27
+ extraConfig: JSON.stringify(_extends({}, displayConfig))
28
+ });
29
+
30
+ case 5:
31
+ // 刷新指标配置
32
+ displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
33
+ _context.next = 8;
34
+ return displayConfigDispatchers.update(displayConfig);
35
+
36
+ case 8:
16
37
  // 更新节点名称显示隐藏
17
38
  topo.attributeMetricDisplay.updateNodesNameVisible();
39
+ extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
18
40
 
19
- case 1:
41
+ if (extraOnOk) {
42
+ extraOnOk(displayConfig);
43
+ }
44
+
45
+ case 11:
20
46
  case "end":
21
47
  return _context.stop();
22
48
  }
@@ -24,42 +50,38 @@ export default (function (props) {
24
50
  }, _callee);
25
51
  }));
26
52
 
27
- return function executeByConfig(_x) {
53
+ return function handleViewerSave() {
28
54
  return _ref.apply(this, arguments);
29
55
  };
30
56
  }();
31
57
 
32
- var save = /*#__PURE__*/function () {
58
+ var handleEditorSave = /*#__PURE__*/function () {
33
59
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
34
60
  var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
35
61
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
36
62
  while (1) {
37
63
  switch (_context2.prev = _context2.next) {
38
64
  case 0:
65
+ topo.historyManager.beginTransaction();
39
66
  values = settingRef.current.getValues(); // console.info('保存显示配置', values)
40
67
  // 保存配置
41
68
 
42
69
  prevDisplayConfig = topo.store.getModelState('displayConfig');
43
- displayConfig = _extends({}, prevDisplayConfig, values);
44
- _context2.next = 5;
45
- return topoService.saveTopoSettings(topo.id, {
46
- alarmSwitch: displayConfig.alarmSwitch,
47
- alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
48
- extraConfig: JSON.stringify(_extends({}, displayConfig))
49
- });
70
+ displayConfig = _extends({}, prevDisplayConfig, values); // 刷新指标配置
50
71
 
51
- case 5:
52
- // 刷新指标配置
53
72
  displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
54
- displayConfigDispatchers.update(displayConfig); // 按配置执行
73
+ _context2.next = 7;
74
+ return displayConfigDispatchers.update(displayConfig);
55
75
 
56
- executeByConfig(displayConfig);
57
- extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
76
+ case 7:
77
+ extraOnOk = displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk;
58
78
 
59
79
  if (extraOnOk) {
60
80
  extraOnOk(displayConfig);
61
81
  }
62
82
 
83
+ topo.historyManager.endTransaction();
84
+
63
85
  case 10:
64
86
  case "end":
65
87
  return _context2.stop();
@@ -68,11 +90,46 @@ export default (function (props) {
68
90
  }, _callee2);
69
91
  }));
70
92
 
71
- return function save() {
93
+ return function handleEditorSave() {
72
94
  return _ref2.apply(this, arguments);
73
95
  };
74
96
  }();
75
97
 
98
+ var save = /*#__PURE__*/function () {
99
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
100
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
101
+ while (1) {
102
+ switch (_context3.prev = _context3.next) {
103
+ case 0:
104
+ if (isEditor) {
105
+ _context3.next = 5;
106
+ break;
107
+ }
108
+
109
+ _context3.next = 3;
110
+ return handleViewerSave();
111
+
112
+ case 3:
113
+ _context3.next = 7;
114
+ break;
115
+
116
+ case 5:
117
+ _context3.next = 7;
118
+ return handleEditorSave();
119
+
120
+ case 7:
121
+ case "end":
122
+ return _context3.stop();
123
+ }
124
+ }
125
+ }, _callee3);
126
+ }));
127
+
128
+ return function save() {
129
+ return _ref3.apply(this, arguments);
130
+ };
131
+ }();
132
+
76
133
  return {
77
134
  save: save
78
135
  };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import useCanvasTheme from "../../hooks/useCanvasTheme";
3
+ import styles from "./TopoView.module.scss";
4
+ export default function GraphViewPanel(props) {
5
+ var topo = props.topo;
6
+ var displayConfig = topo.store.useModelState('displayConfig');
7
+ var canvasTheme = displayConfig.canvasTheme || 'white';
8
+
9
+ var _useCanvasTheme = useCanvasTheme({
10
+ topo: topo,
11
+ canvasTheme: canvasTheme
12
+ }),
13
+ canvasColor = _useCanvasTheme.canvasColor;
14
+
15
+ return /*#__PURE__*/React.createElement("div", {
16
+ className: styles.viewPanel,
17
+ style: {
18
+ background: canvasColor
19
+ }
20
+ }, props.children);
21
+ }
@@ -1,3 +1,4 @@
1
1
  .borderLine {
2
+ position: relative;
2
3
  border-top: 1px solid #E6E7EB;
3
4
  }
@@ -12,7 +12,6 @@ import ViewerPlugin from "../../viewer/components/plugins/ViewerPlugin";
12
12
  import TitleBar from "../titlebar/TitleBar";
13
13
  import { TPL_TREE } from "../../../utils/template";
14
14
  import PropertyView from "../../editor/components/settings/PropertyView";
15
- import BackgroundView from "../../editor/components/BackgroundView";
16
15
  import { updateEdgeExpanded } from "../../utils/edgeUtil";
17
16
  import useManageStatus from "../../hooks/useManageStatus";
18
17
  import useAlarm from "../../hooks/useAlarm";
@@ -22,8 +21,10 @@ import { handleClusterNoPermission, upgradeV103GraphClusterNode } from "../../..
22
21
  import EditorToolbar from "../../editor/components/Toolbar/EditorToolbar";
23
22
  import Sidebar from "../../editor/components/Sidebar/Sidebar";
24
23
  import HistoryManager from "../../models/HistoryManager";
24
+ import GraphViewPanel from "./GraphViewPanel";
25
25
  import styles from "./TopoView.module.scss";
26
26
  import editorStyles from "./editor.module.scss";
27
+ import useKeyboardShortcut from "../../editor/hooks/useKeyboardShortcut";
27
28
 
28
29
  var Topology = function Topology(props) {
29
30
  var _classnames;
@@ -56,7 +57,6 @@ var Topology = function Topology(props) {
56
57
  topoState = _store$useModel[0],
57
58
  topoDispatchers = _store$useModel[1];
58
59
 
59
- var bizDispatchers = store.useModelDispatchers('topoBizMod');
60
60
  var topoId = topoState.topoId,
61
61
  viewState = topoState.viewState,
62
62
  topoData = topoState.topoData,
@@ -67,11 +67,16 @@ var Topology = function Topology(props) {
67
67
 
68
68
  var _useState = useState(buildLoadOptions ? buildLoadOptions(topoData) : topoData),
69
69
  tData = _useState[0],
70
- setTData = _useState[1]; // TODO 临时放这里,当前监听内容较多
70
+ setTData = _useState[1];
71
71
 
72
-
73
- var selectionManager = topo.selectionManager;
74
72
  useRouterAdapter(props);
73
+ useAlarm({
74
+ topo: topo
75
+ });
76
+ useManageStatus({
77
+ topo: topo
78
+ }); // 编辑模式----
79
+
75
80
  var topoEdit = useTopoEdit({
76
81
  topo: topo,
77
82
  topoId: topoId,
@@ -84,25 +89,16 @@ var Topology = function Topology(props) {
84
89
  isLayerTopo: isLayerTopo
85
90
  });
86
91
  topo.topoEdit = topoEdit;
87
- var onExitEdit = topoEdit.onExitEdit,
88
- onBindData = topoEdit.onBindData,
89
- onDeleteElement = topoEdit.onDeleteElement,
90
- onSaveTopo = topoEdit.onSaveTopo;
91
- var titleBarRef = useRef();
92
- useAlarm({
93
- topo: topo
94
- });
95
- useManageStatus({
96
- topo: topo
92
+ useKeyboardShortcut({
93
+ topo: topo,
94
+ topoEdit: topoEdit,
95
+ isEditMode: isEditMode
97
96
  });
98
97
  useEffect(function () {
99
98
  if (viewState === 'view' && topoId) {
100
99
  // TODO 移到模型中
101
100
  // rlog.debug('useEffect-viewState', topoId, viewState);
102
101
  setTData(null);
103
- bizDispatchers.update({
104
- setConfig: null
105
- });
106
102
  }
107
103
  }, [topoId, viewState]);
108
104
  useEffect(function () {
@@ -112,7 +108,8 @@ var Topology = function Topology(props) {
112
108
  useEffect(function () {
113
109
  // 拓扑退出注销
114
110
  return function () {
115
- selectionManager.destroy();
111
+ rlog.info('TopoView 退出');
112
+ topo.selectionManager.destroy();
116
113
  topoDispatchers.reset();
117
114
  };
118
115
  }, []);
@@ -140,7 +137,7 @@ var Topology = function Topology(props) {
140
137
  topo.historyManager = new HistoryManager(topo, htHistoryManager);
141
138
  }
142
139
 
143
- selectionManager.init();
140
+ topo.selectionManager.init();
144
141
  topoDispatchers.update({
145
142
  graphLoaded2: true
146
143
  });
@@ -159,7 +156,7 @@ var Topology = function Topology(props) {
159
156
  fixLink(topo);
160
157
  handleClusterNoPermission(topo);
161
158
  updateEdgeExpanded(topo);
162
- selectionManager.init();
159
+ topo.selectionManager.init();
163
160
  topoDispatchers.update({
164
161
  graphLoaded: true
165
162
  });
@@ -171,7 +168,7 @@ var Topology = function Topology(props) {
171
168
  if (onLoad) {
172
169
  onLoad();
173
170
  }
174
- }, [topoData]); // TODO 之后把事件方法都转移出去
171
+ }, [topoData]);
175
172
 
176
173
  var rightEventHandle = function rightEventHandle(event) {
177
174
  rlog.debug('右键事件', event);
@@ -207,16 +204,16 @@ var Topology = function Topology(props) {
207
204
  break;
208
205
 
209
206
  case TopoEvent.EVENT_DATA_PICK:
210
- onBindData(event.data);
207
+ topoEdit.onBindData(event.data);
211
208
  break;
212
209
 
213
210
  case TopoEvent.EVENT_DATA_DELETE:
214
- onDeleteElement(event.data);
211
+ topoEdit.onDeleteElement(event.data);
215
212
  break;
216
213
  // FIXME 保存逻辑优化
217
214
 
218
215
  case TopoEvent.EVENT_SAVE_TOPO:
219
- onSaveTopo(event.data);
216
+ topoEdit.onSaveTopo(event.data);
220
217
  break;
221
218
 
222
219
  case TopoEvent.EVENT_REFRESH:
@@ -224,7 +221,7 @@ var Topology = function Topology(props) {
224
221
  break;
225
222
 
226
223
  case TopoEvent.EVENT_EDIT_EXIT:
227
- onExitEdit(event.data);
224
+ topoEdit.onExitEdit(event.data);
228
225
  break;
229
226
 
230
227
  case TopoEvent.EVENT_CONTEXT_TOOL:
@@ -236,36 +233,17 @@ var Topology = function Topology(props) {
236
233
  }
237
234
  };
238
235
 
239
- var renderPropertyView = function renderPropertyView() {
240
- return isEditMode && /*#__PURE__*/React.createElement(PropertyView, {
241
- topo: topo,
242
- editorProps: editorProps
243
- });
244
- };
245
-
246
- var renderBackgroundView = function renderBackgroundView() {
247
- return isEditMode && /*#__PURE__*/React.createElement(BackgroundView, {
248
- topo: topo,
249
- editorProps: editorProps
250
- });
251
- };
252
-
253
236
  var renderCanvas = function renderCanvas() {
254
237
  var _graphViewProps$creat;
255
238
 
256
- return /*#__PURE__*/React.createElement("div", {
257
- className: styles.viewPanel,
258
- onKeyDown: function onKeyDown(e) {
259
- topo.historyManager && topo.historyManager.handleKeyDown(e);
260
- }
239
+ return /*#__PURE__*/React.createElement(GraphViewPanel, {
240
+ topo: topo
261
241
  }, /*#__PURE__*/React.createElement(TopoGraph, _extends({}, graphViewProps, {
262
242
  createHtTopoProps: _extends({}, graphViewProps.createHtTopoProps, {
263
243
  editor: _extends({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {})
264
244
  }),
265
245
  data: tData,
266
246
  defaultEnterEditMode: defaultEnterEditMode,
267
- renderPropertyView: renderPropertyView,
268
- renderBackgroundView: renderBackgroundView,
269
247
  onCreate: onGraphCreated,
270
248
  onLoaded: handleGraphLoaded,
271
249
  onDataLoaded: handleGraphDataLoaded,
@@ -307,14 +285,16 @@ var Topology = function Topology(props) {
307
285
  urlParams: urlParams
308
286
  },
309
287
  editorProps: editorProps
310
- }), renderCanvas()), !isEditMode && /*#__PURE__*/React.createElement(ViewerPlugin, {
288
+ }), renderCanvas(), isEditMode && /*#__PURE__*/React.createElement(PropertyView, {
289
+ topo: topo,
290
+ editorProps: editorProps
291
+ })), !isEditMode && /*#__PURE__*/React.createElement(ViewerPlugin, {
311
292
  topo: topo,
312
293
  viewerProps: viewerProps,
313
294
  topoContext: topoContext
314
295
  }), isEditMode && /*#__PURE__*/React.createElement(EditorPlugin, {
315
296
  topo: topo,
316
297
  topoEdit: topoEdit,
317
- titleBarRef: titleBarRef,
318
298
  topoContext: {
319
299
  urlParams: urlParams
320
300
  },
@@ -12,7 +12,7 @@
12
12
  }
13
13
 
14
14
  &.titlebarViewMode {
15
- padding: 16px 16px 0 16px;
15
+ padding: 16px;
16
16
  }
17
17
 
18
18
  &.titlebarEditMode {
@@ -4,13 +4,14 @@ import CustomIconPlugin from "./CustomIconPlugin";
4
4
  import SaveLoading from "./plugins/SaveLoading";
5
5
  import MultipleResourceSelectPlugin from "./plugins/MultipleResourceSelectPlugin";
6
6
  import GroupAddResourceDrawerPlugin from "./GroupAddResourceDrawerPlugin";
7
+ import MetricPollingPlugin from "../../viewer/components/plugins/MetricPollingPlugin";
7
8
  export default function TopoEditorPlugin(props) {
8
9
  var topo = props.topo,
9
10
  topoContext = props.topoContext,
10
11
  topoEdit = props.topoEdit,
11
12
  editorProps = props.editorProps;
12
13
  var store = topo.store;
13
- var plugins = [SaveLoading, GroupAddResourceDrawerPlugin, MultipleResourceSelectPlugin, CustomIconPlugin].concat((editorProps === null || editorProps === void 0 ? void 0 : editorProps.plugins) || []);
14
+ var plugins = [SaveLoading, GroupAddResourceDrawerPlugin, MultipleResourceSelectPlugin, CustomIconPlugin, MetricPollingPlugin].concat((editorProps === null || editorProps === void 0 ? void 0 : editorProps.plugins) || []);
14
15
  return /*#__PURE__*/React.createElement(React.Fragment, null, plugins.map(function (Plugin, index) {
15
16
  return /*#__PURE__*/React.createElement(Plugin, _extends({
16
17
  key: index,