@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
@@ -1,63 +1,50 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { useState } from 'react';
3
- import VerticalIconTab from "../../../../components/VerticalIconTab";
4
- import LinkPanel from "./views/LinkPanel";
5
- import ComponentPanel from "./views/ComponentPanel";
6
- import ImagePanel from "./views/ImagePanel";
7
- import BackgroundPanel from "./views/BackgroundPanel";
8
- import CanvasPanel from "./views/CanvasPanel";
9
- import styles from "./Sidebar.module.scss";
2
+ import React, { useEffect, useState } from 'react';
10
3
  import classNames from 'classnames';
4
+ import Tab from "../../../../components/VerticalIconTab";
5
+ import panes from "./panes";
6
+ import styles from "./Sidebar.module.scss";
11
7
 
12
8
  function Sidebar(props) {
13
9
  var _classNames;
14
10
 
15
11
  var topo = props.topo;
16
12
 
17
- var _useState = useState(null),
18
- activeKey = _useState[0],
19
- setActivekey = _useState[1];
13
+ var _topo$store$useModel = topo.store.useModel('topoEdit'),
14
+ topoEditState = _topo$store$useModel[0],
15
+ topoEditDispatchers = _topo$store$useModel[1];
16
+
17
+ var activeKey = topoEditState.resourceTabActiveKey; // 拓扑图是否加载
18
+
19
+ var _topo$store$useModelS = topo.store.useModelState('topoMod'),
20
+ graphLoaded = _topo$store$useModelS.graphLoaded;
21
+
22
+ useEffect(function () {
23
+ return function () {
24
+ // 退出编辑模式,关闭资源面板状态
25
+ topoEditDispatchers.update({
26
+ resourceTabActiveKey: null
27
+ });
28
+ };
29
+ }, []); // 通过url参数打开对应面板
30
+
31
+ useEffect(function () {
32
+ var _topo$viewProps$urlPa;
33
+
34
+ if (graphLoaded && (_topo$viewProps$urlPa = topo.viewProps.urlParams) !== null && _topo$viewProps$urlPa !== void 0 && _topo$viewProps$urlPa.resourceTabActiveKey) {
35
+ setTimeout(function () {
36
+ var _topo$viewProps$urlPa2;
20
37
 
21
- var panes = [{
22
- title: '链路',
23
- key: '1',
24
- icon: '/img/topo/editor/sidebar/icon/链路.svg',
25
- content: LinkPanel
26
- }, {
27
- title: '组件',
28
- key: '2',
29
- icon: '/img/topo/editor/sidebar/icon/组件.svg',
30
- content: ComponentPanel
31
- }, {
32
- title: '图片',
33
- key: '3',
34
- icon: '/img/topo/editor/sidebar/icon/图片.svg',
35
- content: ImagePanel
36
- }, {
37
- title: '背景',
38
- key: '4',
39
- icon: '/img/topo/editor/sidebar/icon/背景.svg',
40
- content: BackgroundPanel
41
- }, {
42
- title: '画布',
43
- key: '5',
44
- icon: '/img/topo/editor/sidebar/icon/画布.svg',
45
- content: CanvasPanel
46
- }].map(function (item) {
47
- var View = item.content;
48
- return _extends({}, item, {
49
- content: function content() {
50
- return /*#__PURE__*/React.createElement(View, _extends({}, props, {
51
- topo: topo,
52
- active: activeKey === item.key
53
- }));
54
- }
55
- });
56
- });
38
+ topoEditDispatchers.update({
39
+ resourceTabActiveKey: ((_topo$viewProps$urlPa2 = topo.viewProps.urlParams) === null || _topo$viewProps$urlPa2 === void 0 ? void 0 : _topo$viewProps$urlPa2.resourceTabActiveKey) || null
40
+ });
41
+ }, 2000);
42
+ }
43
+ }, [graphLoaded]);
57
44
 
58
45
  var renderTabItem = function renderTabItem(pane) {
59
46
  var View = pane.content;
60
- return /*#__PURE__*/React.createElement(VerticalIconTab.Item, _extends({
47
+ return /*#__PURE__*/React.createElement(Tab.Item, _extends({
61
48
  key: pane.key
62
49
  }, pane), /*#__PURE__*/React.createElement(View, {
63
50
  topo: topo,
@@ -69,9 +56,13 @@ function Sidebar(props) {
69
56
  className: styles.sidebar
70
57
  }, /*#__PURE__*/React.createElement("div", {
71
58
  className: classNames(styles.tabsContainer, (_classNames = {}, _classNames[styles.expanded] = !!activeKey, _classNames))
72
- }, /*#__PURE__*/React.createElement(VerticalIconTab, {
59
+ }, /*#__PURE__*/React.createElement(Tab, {
73
60
  activeKey: activeKey,
74
- onChange: setActivekey
61
+ onChange: function onChange(key) {
62
+ return topoEditDispatchers.update({
63
+ resourceTabActiveKey: key
64
+ });
65
+ }
75
66
  }, panes.map(renderTabItem))));
76
67
  }
77
68
 
@@ -0,0 +1,32 @@
1
+ import BackgroundPanel from "./views/BackgroundPanel";
2
+ import CanvasPanel from "./views/CanvasPanel";
3
+ import ComponentPanel from "./views/ComponentPanel";
4
+ import ImagePanel from "./views/ImagePanel";
5
+ import LinkPanel from "./views/LinkPanel";
6
+ var panes = [{
7
+ title: '链路',
8
+ key: '1',
9
+ icon: '/img/topo/editor/sidebar/icon/链路.svg',
10
+ content: LinkPanel
11
+ }, {
12
+ title: '组件',
13
+ key: '2',
14
+ icon: '/img/topo/editor/sidebar/icon/组件.svg',
15
+ content: ComponentPanel
16
+ }, {
17
+ title: '图片',
18
+ key: '3',
19
+ icon: '/img/topo/editor/sidebar/icon/图片.svg',
20
+ content: ImagePanel
21
+ }, {
22
+ title: '背景',
23
+ key: '4',
24
+ icon: '/img/topo/editor/sidebar/icon/背景.svg',
25
+ content: BackgroundPanel
26
+ }, {
27
+ title: '画布',
28
+ key: '5',
29
+ icon: '/img/topo/editor/sidebar/icon/画布.svg',
30
+ content: CanvasPanel
31
+ }];
32
+ export default panes;
@@ -0,0 +1,38 @@
1
+ import _Tag from "@alifd/next/es/tag";
2
+ import React, { useState } from 'react';
3
+ import styles from "./CanvasPanel.module.scss";
4
+ import useCanvasThemeConfig from "./useCanvasThemeConfig";
5
+ export default function CanvasPanel(props) {
6
+ var topo = props.topo;
7
+
8
+ var _useCanvasThemeConfig = useCanvasThemeConfig({
9
+ topo: topo
10
+ }),
11
+ themes = _useCanvasThemeConfig.themes,
12
+ canvasThemeName = _useCanvasThemeConfig.canvasThemeName,
13
+ setCanvasTheme = _useCanvasThemeConfig.setCanvasTheme;
14
+
15
+ return /*#__PURE__*/React.createElement("div", {
16
+ className: styles.canvasToggle
17
+ }, themes.map(function (item, index) {
18
+ return /*#__PURE__*/React.createElement("div", {
19
+ className: styles.canvas,
20
+ key: index
21
+ }, /*#__PURE__*/React.createElement(_Tag.Selectable, {
22
+ className: styles.tag,
23
+ style: {
24
+ background: item.color
25
+ },
26
+ checked: item.name === canvasThemeName,
27
+ onChange: function onChange(checked) {
28
+ setCanvasTheme(item.name);
29
+ }
30
+ }, /*#__PURE__*/React.createElement("div", {
31
+ className: styles.box
32
+ }, /*#__PURE__*/React.createElement("div", {
33
+ className: styles.bgColor
34
+ }))), /*#__PURE__*/React.createElement("div", {
35
+ className: styles.canvasText
36
+ }, item.label));
37
+ }));
38
+ }
@@ -0,0 +1,74 @@
1
+ @import "~@alifd/next/variables.scss";
2
+
3
+ .canvasToggle {
4
+ display: flex;
5
+ flex-wrap: wrap;
6
+ .canvas {
7
+ .tag {
8
+ border: 1px solid #E4E9EE;
9
+ width: 110px;
10
+ height: 62px;
11
+ border-radius: 2px;
12
+ margin: 16px 0 0 16px;
13
+ :global {
14
+ .#{$css-prefix}tag-body {
15
+ width: 100%;
16
+ padding: 0;
17
+ cursor: pointer;
18
+ }
19
+ }
20
+ .box {
21
+ position: relative;
22
+ height: 100%;
23
+ user-select: none;
24
+ .bgColor {
25
+ max-width: 100%;
26
+ max-height: 100%;
27
+ display: block;
28
+ margin: auto;
29
+ position: absolute;
30
+ left: 0;
31
+ top: 0;
32
+ bottom: 0;
33
+ right: 0;
34
+ }
35
+ }
36
+ &::before,
37
+ &::after {
38
+ z-index: 1;
39
+ }
40
+ &:hover {
41
+ .operation {
42
+ display: block;
43
+ }
44
+ }
45
+ .operation {
46
+ display: none;
47
+ // z-index: -1;
48
+ position: absolute;
49
+ right: 0;
50
+ bottom: 0;
51
+ left: 0;
52
+ height: 22px;
53
+ text-align: center;
54
+ background: rgba(0, 0, 0, 0.4);
55
+ button {
56
+ height: 100%;
57
+ color: #fff;
58
+ vertical-align: text-bottom;
59
+ }
60
+ }
61
+ }
62
+ .canvasText{
63
+ width: 49px;
64
+ height: 12px;
65
+ margin: 8px 0 0 46px;
66
+ text-align: center;
67
+ }
68
+ }
69
+ .canvas:nth-child(2n){
70
+ margin-left: -7px;
71
+ }
72
+ }
73
+
74
+
@@ -1,2 +1,2 @@
1
- import Panel from "./ImagePanel";
1
+ import Panel from "./CanvasPanel";
2
2
  export default Panel;
@@ -0,0 +1,63 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ var baseLightTheme = {
3
+ color: '#FFFFFF',
4
+ globalNodeLabelColor: '#4d6277',
5
+ globalEdgeTagColor: '#4d6277',
6
+ text: {
7
+ color: '#4d6277'
8
+ },
9
+ group: {
10
+ style: {
11
+ 'group.title.background': '#E4E9EE',
12
+ // 标题背景颜色
13
+ 'group.title.color': '#4D6277',
14
+ // 标题文字颜色
15
+ 'group.background': 'rgba(76, 137, 255, 0.1)',
16
+ 'group.border.color': '#E4E9EE' // 边框颜色
17
+
18
+ }
19
+ }
20
+ };
21
+ var THEMES = [_extends({}, baseLightTheme, {
22
+ name: 'white',
23
+ label: '白色',
24
+ color: '#FFFFFF',
25
+ toolsTheme: 'lightgrayblue'
26
+ }), _extends({}, baseLightTheme, {
27
+ name: 'lightblue',
28
+ label: '蓝色',
29
+ color: '#F9FBFF',
30
+ toolsTheme: 'white'
31
+ }), // {
32
+ // name: 'yellow',
33
+ // label: '黄色',
34
+ // color: '#FFFDE6',
35
+ // },
36
+ // {
37
+ // name: 'green',
38
+ // label: '绿色',
39
+ // color: '#EAFFE8',
40
+ // },
41
+ {
42
+ name: 'dark',
43
+ label: '深色',
44
+ color: '#031425',
45
+ toolsTheme: 'black',
46
+ globalNodeLabelColor: '#ffffff',
47
+ globalEdgeTagColor: '#ffffff',
48
+ text: {
49
+ color: '#ffffff'
50
+ },
51
+ group: {
52
+ style: {
53
+ 'group.title.background': '#08A5F4',
54
+ // 标题背景颜色
55
+ 'group.title.color': '#FFFFFF',
56
+ // 标题文字颜色
57
+ 'group.background': 'rgba(29,55,113,0.6)',
58
+ 'group.border.color': 'rgba(8,165,244,0.8)' // 边框颜色
59
+
60
+ }
61
+ }
62
+ }];
63
+ export default THEMES;
@@ -0,0 +1,115 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
+ import { isClusterHtElement } from "../../../../../../utils/clusterUtil";
5
+ import { getElements, isEdge, isGroup, isLayer, isNode, isText } from "../../../../../../utils/htElementUtils";
6
+ import THEMES from "./themes";
7
+
8
+ function useCanvasThemeConfig(props) {
9
+ var topo = props.topo;
10
+
11
+ var _topo$store$useModel = topo.store.useModel('displayConfig'),
12
+ displayConfig = _topo$store$useModel[0],
13
+ displayConfigDispatchers = _topo$store$useModel[1];
14
+
15
+ var canvasThemeName = displayConfig.canvasTheme || 'white';
16
+
17
+ var setCanvasTheme = /*#__PURE__*/function () {
18
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(themeName) {
19
+ var themeConfig;
20
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
21
+ while (1) {
22
+ switch (_context.prev = _context.next) {
23
+ case 0:
24
+ themeConfig = THEMES.find(function (item) {
25
+ return item.name === themeName;
26
+ });
27
+ topo.historyManager.beginTransaction();
28
+ _context.next = 4;
29
+ return displayConfigDispatchers.update({
30
+ canvasTheme: themeName
31
+ });
32
+
33
+ case 4:
34
+ _context.next = 6;
35
+ return setGlobalTagTheme(themeConfig);
36
+
37
+ case 6:
38
+ setElementsTheme(themeConfig);
39
+ topo.historyManager.endTransaction();
40
+
41
+ case 8:
42
+ case "end":
43
+ return _context.stop();
44
+ }
45
+ }
46
+ }, _callee);
47
+ }));
48
+
49
+ return function setCanvasTheme(_x) {
50
+ return _ref.apply(this, arguments);
51
+ };
52
+ }();
53
+
54
+ function setGlobalTagTheme(_x2) {
55
+ return _setGlobalTagTheme.apply(this, arguments);
56
+ }
57
+
58
+ function _setGlobalTagTheme() {
59
+ _setGlobalTagTheme = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(themeConfig) {
60
+ var _topo$store$getModelS, nodeLabelStyle, defaultEdgeLabelStyle, globalNodeLabelStyle, globalEdgeTagStyle;
61
+
62
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
63
+ while (1) {
64
+ switch (_context2.prev = _context2.next) {
65
+ case 0:
66
+ // 设置资源/链路标注样式
67
+ _topo$store$getModelS = topo.store.getModelState('displayConfig'), nodeLabelStyle = _topo$store$getModelS.nodeLabelStyle, defaultEdgeLabelStyle = _topo$store$getModelS.defaultEdgeLabelStyle;
68
+ globalNodeLabelStyle = _extends({}, nodeLabelStyle, {
69
+ color: themeConfig.globalNodeLabelColor
70
+ });
71
+ topo.getHtTopo().setGlobalNodeLabelStyle(globalNodeLabelStyle);
72
+ globalEdgeTagStyle = _extends({}, defaultEdgeLabelStyle, {
73
+ color: themeConfig.globalEdgeTagColor
74
+ });
75
+ topo.getHtTopo().setGlobalEdgeTagStyle(globalEdgeTagStyle);
76
+ _context2.next = 7;
77
+ return displayConfigDispatchers.update({
78
+ nodeLabelStyle: globalNodeLabelStyle,
79
+ defaultEdgeLabelStyle: globalEdgeTagStyle
80
+ });
81
+
82
+ case 7:
83
+ case "end":
84
+ return _context2.stop();
85
+ }
86
+ }
87
+ }, _callee2);
88
+ }));
89
+ return _setGlobalTagTheme.apply(this, arguments);
90
+ }
91
+
92
+ function setElementsTheme(themeConfig) {
93
+ var dm = topo.getHtTopo().getGraphView().dm();
94
+ var elements = getElements(dm);
95
+ elements.forEach(function (element) {
96
+ if (isText(element)) {
97
+ element.s('text.color', themeConfig.text.color);
98
+ } else if (isGroup(element)) {
99
+ if (isClusterHtElement(element)) {// 集群
100
+ } else {
101
+ // 区域(非集群)
102
+ element.s(themeConfig.group.style);
103
+ }
104
+ } else if (isEdge(element)) {}
105
+ });
106
+ }
107
+
108
+ return {
109
+ themes: THEMES,
110
+ canvasThemeName: canvasThemeName,
111
+ setCanvasTheme: setCanvasTheme
112
+ };
113
+ }
114
+
115
+ export default useCanvasThemeConfig;
@@ -1,7 +1,7 @@
1
- import React, { useEffect, useMemo, useRef } from 'react';
1
+ import React, { useMemo } from 'react';
2
2
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
3
  import ImagePalette from "./HtImagePalette";
4
- import { getNodeDefaultIcons } from "../../../../../common/icons/icon";
4
+ import { getResourceIcons } from "../../../../../common/icons/icon";
5
5
  /**
6
6
  * 组件面板
7
7
  * @param {*} props
@@ -11,7 +11,7 @@ import { getNodeDefaultIcons } from "../../../../../common/icons/icon";
11
11
  export default function CiTypeImagePanel(props) {
12
12
  var topo = props.topo;
13
13
  var icons = useMemo(function () {
14
- return getNodeDefaultIcons(topo);
14
+ return getResourceIcons(topo);
15
15
  }, []);
16
16
  return /*#__PURE__*/React.createElement(ImagePalette, {
17
17
  icons: icons,
@@ -1,6 +1,7 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
+ import ResizeObserver from 'resize-observer-polyfill';
2
3
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
- import { getUserCustomIconsForHt } from "../../../../../common/icons/icon";
4
+ import styles from "./HtImagePalette.module.scss";
4
5
  /**
5
6
  * 组件面板
6
7
  * @param {*} props
@@ -25,10 +26,20 @@ export default function HtCustomImagePanel(props) {
25
26
  });
26
27
  } catch (error) {
27
28
  rlog.error('初始化资源面板失败', error);
28
- } // 注销组件
29
+ }
30
+
31
+ var hanleResize = function hanleResize() {
32
+ if (viewRef.current) {
33
+ topo.getHtTopo().invalideComponents();
34
+ }
35
+ };
29
36
 
37
+ var resizeObserver = new ResizeObserver(hanleResize);
38
+ resizeObserver.observe(container); // 注销组件
30
39
 
31
40
  return function () {
41
+ resizeObserver.disconnect();
42
+
32
43
  if (viewRef.current) {
33
44
  viewRef.current.destroy();
34
45
  viewRef.current = null;
@@ -37,9 +48,6 @@ export default function HtCustomImagePanel(props) {
37
48
  }, []);
38
49
  return /*#__PURE__*/React.createElement("div", {
39
50
  ref: divRef,
40
- style: {
41
- width: '100%' // height: '100%',
42
-
43
- }
51
+ className: styles.container
44
52
  });
45
53
  }
@@ -1,5 +1,7 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
2
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
+ import ResizeObserver from 'resize-observer-polyfill';
4
+ import styles from "./HtImagePalette.module.scss";
3
5
  /**
4
6
  * 组件面板
5
7
  * @param {*} props
@@ -24,10 +26,20 @@ export default function HtImagePalette(props) {
24
26
  });
25
27
  } catch (error) {
26
28
  rlog.error('初始化资源面板失败', error);
27
- } // 注销组件
29
+ }
30
+
31
+ var hanleResize = function hanleResize() {
32
+ if (viewRef.current) {
33
+ topo.getHtTopo().invalideComponents();
34
+ }
35
+ };
28
36
 
37
+ var resizeObserver = new ResizeObserver(hanleResize);
38
+ resizeObserver.observe(container); // 注销组件
29
39
 
30
40
  return function () {
41
+ resizeObserver.disconnect();
42
+
31
43
  if (viewRef.current) {
32
44
  viewRef.current.destroy();
33
45
  viewRef.current = null;
@@ -36,9 +48,6 @@ export default function HtImagePalette(props) {
36
48
  }, []);
37
49
  return /*#__PURE__*/React.createElement("div", {
38
50
  ref: divRef,
39
- style: {
40
- width: '100%' // height: '100%',
41
-
42
- }
51
+ className: styles.container
43
52
  });
44
53
  }
@@ -0,0 +1,5 @@
1
+ .container {
2
+ width: 100%;
3
+ height: 100%;
4
+ overflow: hidden;
5
+ }
@@ -1,23 +1,36 @@
1
- import _Collapse from "@alifd/next/es/collapse";
2
1
  import _Button from "@alifd/next/es/button";
3
2
  import _Icon from "@alifd/next/es/icon";
4
- import React from 'react';
3
+ import React, { useMemo } from 'react';
5
4
  import classNames from 'classnames';
6
- import CollapsePanel from "../../../../../../components/collapse/Panel";
7
- import CollapseStyles from "../../../../../../components/collapse/Collapse.module.scss";
5
+ import Collapse from "../../../../../../components/collapse/Collapse";
8
6
  import CiTypeImagePanel from "./CiTypeImagePanel";
9
7
  import CustomImagePanel from "./CustomImagePanel";
8
+ import { getBasicIcons } from "../../../../../common/icons/icon";
9
+ import ImagePalette from "./HtImagePalette";
10
+ var CollapsePanel = Collapse.Panel;
10
11
  export default function ImagePanel(props) {
11
- return /*#__PURE__*/React.createElement(_Collapse, {
12
- defaultExpandedKeys: ['资源图片', '自定义图片'],
12
+ var topo = props.topo;
13
+ var basicIcons = useMemo(function () {
14
+ return getBasicIcons(topo, false);
15
+ }, []);
16
+ return /*#__PURE__*/React.createElement(Collapse, {
17
+ accordion: true,
18
+ defaultExpandedKeys: ['资源图片'],
13
19
  style: {
14
20
  border: 'none'
15
21
  },
16
- className: classNames(CollapseStyles.collapse, CollapseStyles.contentNoPadding)
22
+ fullheight: true,
23
+ noContentPadding: true
17
24
  }, /*#__PURE__*/React.createElement(CollapsePanel, {
18
25
  key: "\u8D44\u6E90\u56FE\u7247",
19
26
  title: "\u8D44\u6E90\u56FE\u7247"
20
27
  }, /*#__PURE__*/React.createElement(CiTypeImagePanel, props)), /*#__PURE__*/React.createElement(CollapsePanel, {
28
+ key: "\u57FA\u7840\u56FE\u7247",
29
+ title: "\u57FA\u7840\u56FE\u7247"
30
+ }, /*#__PURE__*/React.createElement(ImagePalette, {
31
+ icons: basicIcons,
32
+ topo: topo
33
+ })), /*#__PURE__*/React.createElement(CollapsePanel, {
21
34
  key: "\u81EA\u5B9A\u4E49\u56FE\u7247",
22
35
  title: "\u81EA\u5B9A\u4E49\u56FE\u7247",
23
36
  extra: /*#__PURE__*/React.createElement(_Button, {
@@ -1,35 +1,45 @@
1
1
  import _Button from "@alifd/next/es/button";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
- import React, { useState } from 'react';
4
- import buttons from "./buttons";
3
+ import classNames from 'classnames';
4
+ import React, { useMemo, useState } from 'react';
5
+ import getButtons from "./buttons";
5
6
  import Toolbar from "./Toolbar";
6
7
  import styles from "./Toolbar.module.scss";
7
8
 
8
9
  function EditorToolbar(props) {
10
+ var _topo$viewProps, _topo$viewProps$topoC, _classNames;
11
+
12
+ var topo = props.topo;
13
+
9
14
  var _useState = useState(true),
10
- showLabel = _useState[0],
11
- setShowLabel = _useState[1];
15
+ expanded = _useState[0],
16
+ setExpanded = _useState[1];
12
17
 
13
- return /*#__PURE__*/React.createElement("div", {
14
- className: styles.toolbarContainer
15
- }, /*#__PURE__*/React.createElement("div", {
16
- className: styles.content
17
- }, /*#__PURE__*/React.createElement(Toolbar, null, buttons.map(function (ToolbarButton, index) {
18
+ var isNetworkTopo = (_topo$viewProps = topo.viewProps) === null || _topo$viewProps === void 0 ? void 0 : (_topo$viewProps$topoC = _topo$viewProps.topoContext) === null || _topo$viewProps$topoC === void 0 ? void 0 : _topo$viewProps$topoC.isNetworkTopo;
19
+ var buttons = useMemo(function () {
20
+ return getButtons(isNetworkTopo);
21
+ }, [isNetworkTopo]);
22
+ var buttonInstances = buttons.map(function (ToolbarButton, index) {
18
23
  return /*#__PURE__*/React.createElement(ToolbarButton, _extends({
19
24
  key: index
20
25
  }, props, {
21
- showLabel: showLabel
26
+ showLabel: expanded
22
27
  }));
23
- }))), /*#__PURE__*/React.createElement("div", {
28
+ });
29
+ return /*#__PURE__*/React.createElement("div", {
30
+ className: classNames(styles.toolbarWrap, (_classNames = {}, _classNames[styles.normal] = expanded, _classNames[styles.expanded] = !expanded, _classNames))
31
+ }, /*#__PURE__*/React.createElement("div", {
32
+ className: styles.content
33
+ }, /*#__PURE__*/React.createElement(Toolbar, null, buttonInstances)), /*#__PURE__*/React.createElement("div", {
24
34
  className: styles.right
25
35
  }, /*#__PURE__*/React.createElement(_Button, {
26
36
  type: "normal",
27
37
  text: true,
28
38
  onClick: function onClick() {
29
- setShowLabel(!showLabel);
39
+ setExpanded(!expanded);
30
40
  }
31
41
  }, /*#__PURE__*/React.createElement("img", {
32
- src: showLabel ? '/img/topo/editor/toolbar/ToolbarNarrowed/Normal.svg' : '/img/topo/editor/toolbar/ToolbbbarExpand/Normal.svg',
42
+ src: expanded ? '/img/topo/editor/toolbar/ToolbarNarrowed/Normal.svg' : '/img/topo/editor/toolbar/ToolbbbarExpand/Normal.svg',
33
43
  alt: "",
34
44
  style: {
35
45
  verticalAlign: 'middle'
@@ -3,7 +3,7 @@ import styles from "./Toolbar.module.scss";
3
3
 
4
4
  function Toolbar(props) {
5
5
  return /*#__PURE__*/React.createElement("div", {
6
- className: styles.widgets
6
+ className: styles.toolbarContainer
7
7
  }, props.children);
8
8
  }
9
9