@riil-frontend/component-topology 5.0.18 → 6.0.0-alpha.2

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 (202) 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 +29 -29
  5. package/es/components/VerticalIconTab/VerticalIconTab.js +58 -0
  6. package/es/components/VerticalIconTab/VerticalIconTab.module.scss +63 -0
  7. package/es/components/VerticalIconTab/index.js +2 -0
  8. package/es/components/collapse/Collapse.js +7 -0
  9. package/es/components/collapse/Collapse.module.scss +33 -0
  10. package/es/components/collapse/CollapseFullheight.module.scss +20 -0
  11. package/es/components/collapse/Panel.js +3 -0
  12. package/es/core/common/icons/icon.js +18 -5
  13. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +41 -10
  14. package/es/core/components/AlarmListPanel/components/index.module.scss +26 -0
  15. package/es/core/components/AlarmListPanel/index.js +9 -5
  16. package/es/core/components/ResourceViewAttributeSetting/Setting.js +5 -19
  17. package/es/core/components/TopoView/TopoView.module.scss +0 -4
  18. package/es/core/components/TopoView/editor.module.scss +3 -0
  19. package/es/core/components/TopoView/topoView.js +67 -33
  20. package/es/core/editor/components/Sidebar/Sidebar.js +75 -0
  21. package/es/core/editor/components/Sidebar/Sidebar.module.scss +15 -0
  22. package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +10 -0
  23. package/es/core/editor/components/Sidebar/views/BackgroundPanel/index.js +2 -0
  24. package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +4 -0
  25. package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -0
  26. package/es/core/editor/components/Sidebar/views/ComponentPanel.js +41 -0
  27. package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +20 -0
  28. package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +45 -0
  29. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +44 -0
  30. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +28 -0
  31. package/es/core/editor/components/Sidebar/views/ImagePanel/index.js +2 -0
  32. package/es/core/editor/components/Sidebar/views/LinkPanel.js +43 -0
  33. package/es/core/editor/components/Toolbar/EditorToolbar.js +40 -0
  34. package/es/core/editor/components/Toolbar/Toolbar.js +10 -0
  35. package/es/core/editor/components/Toolbar/Toolbar.module.scss +21 -0
  36. package/es/core/editor/components/Toolbar/buttons.js +36 -0
  37. package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +23 -0
  38. package/es/core/editor/components/Toolbar/widgets/AddResourceWidget.js +17 -0
  39. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +46 -0
  40. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +8 -0
  41. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +2 -0
  42. package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +17 -0
  43. package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +19 -0
  44. package/es/core/editor/components/Toolbar/widgets/Divider.js +10 -0
  45. package/es/core/editor/components/Toolbar/widgets/Divider.module.scss +6 -0
  46. package/es/core/editor/components/Toolbar/widgets/Dropdown.js +14 -0
  47. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +8 -0
  48. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +46 -0
  49. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +2 -0
  50. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +8 -0
  51. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +44 -0
  52. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +44 -0
  53. package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +40 -0
  54. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +35 -0
  55. package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +62 -0
  56. package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +22 -0
  57. package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +29 -0
  58. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +28 -0
  59. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +47 -0
  60. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +8 -0
  61. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +46 -0
  62. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +2 -0
  63. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +8 -0
  64. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +42 -0
  65. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +2 -0
  66. package/es/core/editor/components/Toolbar/widgets/SearchWidget.js +40 -0
  67. package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +49 -0
  68. package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +64 -0
  69. package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.js +19 -0
  70. package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.module.scss +8 -0
  71. package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +27 -0
  72. package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.module.scss +10 -0
  73. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +34 -0
  74. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +30 -0
  75. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +47 -0
  76. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.module.scss +10 -0
  77. package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +30 -0
  78. package/es/core/editor/components/Toolbar/widgets/components/MenuSelect.js +20 -0
  79. package/es/core/editor/components/Toolbar/widgets.js +0 -0
  80. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +24 -8
  81. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.module.scss +4 -3
  82. package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +4 -2
  83. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -15
  84. package/es/core/models/HistoryManager.js +32 -6
  85. package/es/core/models/SelectionManager.js +7 -0
  86. package/es/core/models/TopoApp.js +4 -2
  87. package/es/core/store/coreModels.js +5 -5
  88. package/es/core/store/models/displayConfig.js +2 -2
  89. package/es/core/store/models/historyManager.js +31 -0
  90. package/es/core/viewer/components/titlebar/widgets/SearchWidget.js +3 -1
  91. package/es/networkTopo/components/TopoView.js +2 -98
  92. package/es/networkTopo/components/Topology.js +3 -33
  93. package/es/networkTopo/components/editor/useEditorProps.js +34 -0
  94. package/es/networkTopo/hooks/useLinkDynamicStyle.js +1 -1
  95. package/es/style.js +1 -1
  96. package/lib/components/VerticalIconTab/VerticalIconTab.js +74 -0
  97. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +63 -0
  98. package/lib/components/VerticalIconTab/index.js +11 -0
  99. package/lib/components/collapse/Collapse.js +15 -0
  100. package/lib/components/collapse/Collapse.module.scss +33 -0
  101. package/lib/components/collapse/CollapseFullheight.module.scss +20 -0
  102. package/lib/components/collapse/Panel.js +3 -0
  103. package/lib/core/common/icons/icon.js +20 -5
  104. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +40 -9
  105. package/lib/core/components/AlarmListPanel/components/index.module.scss +26 -0
  106. package/lib/core/components/AlarmListPanel/index.js +10 -6
  107. package/lib/core/components/ResourceViewAttributeSetting/Setting.js +5 -19
  108. package/lib/core/components/TopoView/TopoView.module.scss +0 -4
  109. package/lib/core/components/TopoView/editor.module.scss +3 -0
  110. package/lib/core/components/TopoView/topoView.js +69 -32
  111. package/lib/core/editor/components/Sidebar/Sidebar.js +95 -0
  112. package/lib/core/editor/components/Sidebar/Sidebar.module.scss +15 -0
  113. package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +19 -0
  114. package/lib/core/editor/components/Sidebar/views/BackgroundPanel/index.js +11 -0
  115. package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +12 -0
  116. package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +11 -0
  117. package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +53 -0
  118. package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +34 -0
  119. package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +58 -0
  120. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +56 -0
  121. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +43 -0
  122. package/lib/core/editor/components/Sidebar/views/ImagePanel/index.js +11 -0
  123. package/lib/core/editor/components/Sidebar/views/LinkPanel.js +56 -0
  124. package/lib/{networkTopo/components/viewer/titlebar/MoreButtonMenu.js → core/editor/components/Toolbar/EditorToolbar.js} +36 -29
  125. package/lib/core/editor/components/Toolbar/Toolbar.js +19 -0
  126. package/lib/core/editor/components/Toolbar/Toolbar.module.scss +21 -0
  127. package/lib/core/editor/components/Toolbar/buttons.js +62 -0
  128. package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +33 -0
  129. package/lib/core/editor/components/Toolbar/widgets/AddResourceWidget.js +27 -0
  130. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +63 -0
  131. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -0
  132. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +11 -0
  133. package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +27 -0
  134. package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +29 -0
  135. package/lib/core/editor/components/Toolbar/widgets/Divider.js +19 -0
  136. package/lib/core/editor/components/Toolbar/widgets/Divider.module.scss +6 -0
  137. package/lib/core/editor/components/Toolbar/widgets/Dropdown.js +26 -0
  138. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +16 -0
  139. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +63 -0
  140. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +11 -0
  141. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +16 -0
  142. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +61 -0
  143. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +58 -0
  144. package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +54 -0
  145. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +49 -0
  146. package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +76 -0
  147. package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +31 -0
  148. package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +38 -0
  149. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +40 -0
  150. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +64 -0
  151. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +16 -0
  152. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +63 -0
  153. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +11 -0
  154. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +16 -0
  155. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +59 -0
  156. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +11 -0
  157. package/lib/core/editor/components/Toolbar/widgets/SearchWidget.js +53 -0
  158. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +63 -0
  159. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +64 -0
  160. package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.js +31 -0
  161. package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.module.scss +8 -0
  162. package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +40 -0
  163. package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.module.scss +10 -0
  164. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +48 -0
  165. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +30 -0
  166. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +64 -0
  167. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.module.scss +10 -0
  168. package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +41 -0
  169. package/lib/core/editor/components/Toolbar/widgets/components/MenuSelect.js +30 -0
  170. package/lib/core/editor/components/Toolbar/widgets.js +1 -0
  171. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +25 -8
  172. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.module.scss +4 -3
  173. package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +5 -2
  174. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +5 -11
  175. package/lib/core/models/HistoryManager.js +32 -5
  176. package/lib/core/models/SelectionManager.js +7 -0
  177. package/lib/core/models/TopoApp.js +4 -1
  178. package/lib/core/store/coreModels.js +6 -6
  179. package/lib/core/store/models/displayConfig.js +2 -3
  180. package/lib/core/store/models/historyManager.js +41 -0
  181. package/lib/core/viewer/components/titlebar/widgets/SearchWidget.js +3 -1
  182. package/lib/networkTopo/components/TopoView.js +2 -104
  183. package/lib/networkTopo/components/Topology.js +3 -41
  184. package/lib/networkTopo/components/editor/useEditorProps.js +49 -0
  185. package/lib/networkTopo/hooks/useLinkDynamicStyle.js +2 -2
  186. package/lib/style.js +1 -1
  187. package/package.json +3 -3
  188. package/es/core/components/DisplaySettingDrawer/LinkTip.js +0 -41
  189. package/es/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +0 -59
  190. package/es/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +0 -24
  191. package/es/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +0 -23
  192. package/es/networkTopo/components/viewer/displaySetting/LinkTagV2.js +0 -93
  193. package/es/networkTopo/components/viewer/titlebar/MoreButtonMenu.js +0 -32
  194. package/es/networkTopo/components/viewer/titlebar/ViewerTools.js +0 -9
  195. package/es/networkTopo/components/viewer/titlebar/useSetDefaultTopo.js +0 -30
  196. package/lib/core/components/DisplaySettingDrawer/LinkTip.js +0 -55
  197. package/lib/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +0 -76
  198. package/lib/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +0 -35
  199. package/lib/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +0 -23
  200. package/lib/networkTopo/components/viewer/displaySetting/LinkTagV2.js +0 -108
  201. package/lib/networkTopo/components/viewer/titlebar/ViewerTools.js +0 -19
  202. package/lib/networkTopo/components/viewer/titlebar/useSetDefaultTopo.js +0 -40
@@ -0,0 +1,15 @@
1
+ .sidebar {
2
+ // border-right: 1px solid #E6E7EB;
3
+ position: relative;
4
+ width: 60px;
5
+
6
+ .tabsContainer {
7
+ position: absolute;
8
+ height: 100%;
9
+ left: 0;
10
+ top: 0;
11
+ z-index: 1;
12
+ width: 320px;
13
+ background: #FFF;
14
+ }
15
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import BackgroundView from "../../../BackgroundView";
3
+ export default function BackgroundPanel(props) {
4
+ var topo = props.topo,
5
+ editorProps = props.editorProps;
6
+ return /*#__PURE__*/React.createElement(BackgroundView, {
7
+ topo: topo,
8
+ editorProps: editorProps
9
+ });
10
+ }
@@ -0,0 +1,2 @@
1
+ import Panel from "./BackgroundPanel";
2
+ export default Panel;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export default function ImagePanel(props) {
3
+ return /*#__PURE__*/React.createElement("div", null, "ImagePanel");
4
+ }
@@ -0,0 +1,2 @@
1
+ import Panel from "./ImagePanel";
2
+ export default Panel;
@@ -0,0 +1,41 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
+ /**
4
+ * 组件面板
5
+ * @param {*} props
6
+ * @returns
7
+ */
8
+
9
+ export default function ComponentPanel(props) {
10
+ var topo = props.topo; // 组件
11
+
12
+ var viewRef = useRef(null); // div容器
13
+
14
+ var divRef = useRef();
15
+ useEffect(function () {
16
+ // 初始化
17
+ var htTopo = topo.getHtTopo();
18
+ var container = divRef.current;
19
+
20
+ try {
21
+ viewRef.current = htTopo.createBasicPalette(container);
22
+ } catch (error) {
23
+ rlog.error('初始化资源面板失败', error);
24
+ } // 注销组件
25
+
26
+
27
+ return function () {
28
+ if (viewRef.current) {
29
+ viewRef.current.destroy();
30
+ viewRef.current = null;
31
+ }
32
+ };
33
+ }, []);
34
+ return /*#__PURE__*/React.createElement("div", {
35
+ ref: divRef,
36
+ style: {
37
+ width: '100%',
38
+ height: '100%'
39
+ }
40
+ });
41
+ }
@@ -0,0 +1,20 @@
1
+ import React, { useEffect, useMemo, useRef } from 'react';
2
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
+ import ImagePalette from "./ImagePalette";
4
+ import { getNodeDefaultIcons } from "../../../../../common/icons/icon";
5
+ /**
6
+ * 组件面板
7
+ * @param {*} props
8
+ * @returns
9
+ */
10
+
11
+ export default function CiTypeImagePanel(props) {
12
+ var topo = props.topo;
13
+ var icons = useMemo(function () {
14
+ return getNodeDefaultIcons(topo);
15
+ }, []);
16
+ return /*#__PURE__*/React.createElement(ImagePalette, {
17
+ icons: icons,
18
+ topo: topo
19
+ });
20
+ }
@@ -0,0 +1,45 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
+ import { getUserCustomIconsForHt } from "../../../../../common/icons/icon";
4
+ /**
5
+ * 组件面板
6
+ * @param {*} props
7
+ * @returns
8
+ */
9
+
10
+ export default function CustomImagePanel(props) {
11
+ var topo = props.topo; // 组件
12
+
13
+ var viewRef = useRef(null); // div容器
14
+
15
+ var divRef = useRef();
16
+ useEffect(function () {
17
+ // 初始化
18
+ var icons = getUserCustomIconsForHt(topo);
19
+ var htTopo = topo.getHtTopo();
20
+ var container = divRef.current;
21
+
22
+ try {
23
+ viewRef.current = htTopo.createUploadImagePalette(container, {
24
+ icons: icons
25
+ });
26
+ } catch (error) {
27
+ rlog.error('初始化资源面板失败', error);
28
+ } // 注销组件
29
+
30
+
31
+ return function () {
32
+ if (viewRef.current) {
33
+ viewRef.current.destroy();
34
+ viewRef.current = null;
35
+ }
36
+ };
37
+ }, []);
38
+ return /*#__PURE__*/React.createElement("div", {
39
+ ref: divRef,
40
+ style: {
41
+ width: '100%',
42
+ height: '100%'
43
+ }
44
+ });
45
+ }
@@ -0,0 +1,44 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
+ /**
4
+ * 组件面板
5
+ * @param {*} props
6
+ * @returns
7
+ */
8
+
9
+ export default function ImagePalette(props) {
10
+ var topo = props.topo,
11
+ icons = props.icons; // 组件
12
+
13
+ var viewRef = useRef(null); // div容器
14
+
15
+ var divRef = useRef();
16
+ useEffect(function () {
17
+ // 初始化
18
+ var htTopo = topo.getHtTopo();
19
+ var container = divRef.current;
20
+
21
+ try {
22
+ viewRef.current = htTopo.createImagePalette(container, {
23
+ icons: icons
24
+ });
25
+ } catch (error) {
26
+ rlog.error('初始化资源面板失败', error);
27
+ } // 注销组件
28
+
29
+
30
+ return function () {
31
+ if (viewRef.current) {
32
+ viewRef.current.destroy();
33
+ viewRef.current = null;
34
+ }
35
+ };
36
+ }, []);
37
+ return /*#__PURE__*/React.createElement("div", {
38
+ ref: divRef,
39
+ style: {
40
+ width: '100%',
41
+ height: '100%'
42
+ }
43
+ });
44
+ }
@@ -0,0 +1,28 @@
1
+ import _Collapse from "@alifd/next/es/collapse";
2
+ import _Button from "@alifd/next/es/button";
3
+ import _Icon from "@alifd/next/es/icon";
4
+ import React from 'react';
5
+ import CollapsePanel from "../../../../../../components/collapse/Panel";
6
+ import CollapseStyles from "../../../../../../components/collapse/Collapse.module.scss";
7
+ import CiTypeImagePanel from "./CiTypeImagePanel";
8
+ import CustomImagePanel from "./CustomImagePanel";
9
+ export default function ImagePanel(props) {
10
+ return /*#__PURE__*/React.createElement(_Collapse, {
11
+ defaultExpandedKeys: ['资源图片', '自定义图片'],
12
+ style: {
13
+ border: 'none'
14
+ },
15
+ className: CollapseStyles.collapse
16
+ }, /*#__PURE__*/React.createElement(CollapsePanel, {
17
+ key: "\u8D44\u6E90\u56FE\u7247",
18
+ title: "\u8D44\u6E90\u56FE\u7247"
19
+ }, /*#__PURE__*/React.createElement(CiTypeImagePanel, props)), /*#__PURE__*/React.createElement(CollapsePanel, {
20
+ key: "\u81EA\u5B9A\u4E49\u56FE\u7247",
21
+ title: "\u81EA\u5B9A\u4E49\u56FE\u7247",
22
+ extra: /*#__PURE__*/React.createElement(_Button, {
23
+ title: "\u5BFC\u51FA"
24
+ }, /*#__PURE__*/React.createElement(_Icon, {
25
+ type: "topo_button_icon_export"
26
+ }))
27
+ }, /*#__PURE__*/React.createElement(CustomImagePanel, props)));
28
+ }
@@ -0,0 +1,2 @@
1
+ import Panel from "./ImagePanel";
2
+ export default Panel;
@@ -0,0 +1,43 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
+ /**
4
+ * 链路面板
5
+ * @param {*} props
6
+ * @returns
7
+ */
8
+
9
+ function LinkPanel(props) {
10
+ var topo = props.topo; // 组件
11
+
12
+ var viewRef = useRef(null); // div容器
13
+
14
+ var divRef = useRef();
15
+ useEffect(function () {
16
+ // 初始化
17
+ var htTopo = topo.getHtTopo();
18
+ var container = divRef.current;
19
+
20
+ try {
21
+ viewRef.current = htTopo.createLinkPalette(container);
22
+ } catch (error) {
23
+ rlog.error('初始化资源面板失败', error);
24
+ } // 注销组件
25
+
26
+
27
+ return function () {
28
+ if (viewRef.current) {
29
+ viewRef.current.destroy();
30
+ viewRef.current = null;
31
+ }
32
+ };
33
+ }, []);
34
+ return /*#__PURE__*/React.createElement("div", {
35
+ ref: divRef,
36
+ style: {
37
+ width: '100%',
38
+ height: '100%'
39
+ }
40
+ });
41
+ }
42
+
43
+ export default LinkPanel;
@@ -0,0 +1,40 @@
1
+ import _Button from "@alifd/next/es/button";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import React, { useState } from 'react';
4
+ import buttons from "./buttons";
5
+ import Toolbar from "./Toolbar";
6
+ import styles from "./Toolbar.module.scss";
7
+
8
+ function EditorToolbar(props) {
9
+ var _useState = useState(true),
10
+ showLabel = _useState[0],
11
+ setShowLabel = _useState[1];
12
+
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
+ return /*#__PURE__*/React.createElement(ToolbarButton, _extends({
19
+ key: index
20
+ }, props, {
21
+ showLabel: showLabel
22
+ }));
23
+ }))), /*#__PURE__*/React.createElement("div", {
24
+ className: styles.right
25
+ }, /*#__PURE__*/React.createElement(_Button, {
26
+ type: "normal",
27
+ text: true,
28
+ onClick: function onClick() {
29
+ setShowLabel(!showLabel);
30
+ }
31
+ }, /*#__PURE__*/React.createElement("img", {
32
+ src: showLabel ? '/img/topo/editor/toolbar/ToolbarNarrowed/Normal.svg' : '/img/topo/editor/toolbar/ToolbbbarExpand/Normal.svg',
33
+ alt: "",
34
+ style: {
35
+ verticalAlign: 'middle'
36
+ }
37
+ }))));
38
+ }
39
+
40
+ export default EditorToolbar;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import styles from "./Toolbar.module.scss";
3
+
4
+ function Toolbar(props) {
5
+ return /*#__PURE__*/React.createElement("div", {
6
+ className: styles.widgets
7
+ }, props.children);
8
+ }
9
+
10
+ export default Toolbar;
@@ -0,0 +1,21 @@
1
+ .toolbarContainer {
2
+ height: 54px;
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ }
7
+
8
+ .content {
9
+ flex: 1;
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ }
14
+
15
+ .widgets {
16
+ display: flex;
17
+ }
18
+
19
+ .right {
20
+ padding-right: 12px;
21
+ }
@@ -0,0 +1,36 @@
1
+ import AddResourceButton from "./widgets/AddResourceButton";
2
+ import CanvasMoveWidget from "./widgets/CanvasMoveWidget";
3
+ import CanvasSelectWidget from "./widgets/CanvasSelectWidget";
4
+ import Divider from "./widgets/Divider";
5
+ import FontFamilyWidget from "./widgets/FontFamilyWidget";
6
+ import FontSizeWidget from "./widgets/FontSizeWidget";
7
+ import FontStyleButton from "./widgets/FontStyleButton";
8
+ import FontColorButton from "./widgets/FontColorButton";
9
+ import Layout from "./widgets/Layout";
10
+ import NodeAlignWidget from "./widgets/NodeAlignWidget";
11
+ import SearchWidget from "./widgets/SearchWidget";
12
+ import HistoryUndoButton from "./widgets/HistoryUndoButton";
13
+ import HistoryRedoButton from "./widgets/HistoryRedoButton";
14
+ import EdgeTypeButton from "./widgets/EdgeTypeButton";
15
+ import BoxBackgroundButton from "./widgets/BoxBackgroundButton";
16
+ import EdgeColorButton from "./widgets/EdgeColorButton";
17
+ import NodeImageButton from "./widgets/NodeImageButton";
18
+ import NodeSizeButton from "./widgets/NodeSizeButton";
19
+ export default [AddResourceButton, // 添加资源
20
+ Divider, CanvasSelectWidget, // 选择
21
+ CanvasMoveWidget, // 移动
22
+ Divider, HistoryUndoButton, // 撤销
23
+ HistoryRedoButton, // 恢复
24
+ Divider, FontFamilyWidget, // 字体
25
+ FontSizeWidget, // 字号
26
+ FontStyleButton, // 文字样式
27
+ FontColorButton, // 文字颜色
28
+ Divider, BoxBackgroundButton, // 框背景
29
+ Divider, EdgeColorButton, // 线条颜色
30
+ EdgeTypeButton, // 线形
31
+ Divider, NodeImageButton, // 替换图片
32
+ NodeSizeButton, // 图片尺寸
33
+ Divider, Layout, // 布局方式
34
+ NodeAlignWidget, // 对齐方式
35
+ SearchWidget // 搜索
36
+ ];
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import ButtonBox from "./components/ButtonBox";
3
+ import WidgetBox from "./WidgetBox";
4
+
5
+ function AddResourceButton(props) {
6
+ var showLabel = props.showLabel,
7
+ topo = props.topo,
8
+ topoEdit = props.topoEdit;
9
+ return /*#__PURE__*/React.createElement(WidgetBox, {
10
+ label: "\u6DFB\u52A0\u8D44\u6E90",
11
+ tooltip: "\u6DFB\u52A0\u8D44\u6E90",
12
+ showLabel: showLabel
13
+ }, /*#__PURE__*/React.createElement(ButtonBox, {
14
+ onClick: function onClick() {
15
+ topoEdit.showGlobalAddResourceDrawer();
16
+ }
17
+ }, /*#__PURE__*/React.createElement("img", {
18
+ src: "/img/topo/editor/toolbar/add/Normal.svg",
19
+ alt: ""
20
+ })));
21
+ }
22
+
23
+ export default AddResourceButton;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import ButtonBox from "./components/ButtonBox";
3
+ import WidgetBox from "./WidgetBox";
4
+
5
+ function AddResourceWidget(props) {
6
+ var showLabel = props.showLabel;
7
+ return /*#__PURE__*/React.createElement(WidgetBox, {
8
+ label: "\u6DFB\u52A0\u8D44\u6E90",
9
+ tooltip: "\u6DFB\u52A0\u8D44\u6E90",
10
+ showLabel: showLabel
11
+ }, /*#__PURE__*/React.createElement(ButtonBox, null, /*#__PURE__*/React.createElement("img", {
12
+ src: "/img/topo/editor/toolbar/add/Normal.svg",
13
+ alt: ""
14
+ })));
15
+ }
16
+
17
+ export default AddResourceWidget;
@@ -0,0 +1,46 @@
1
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
+ var _excluded = ["topo", "showLabel"];
3
+ import React, { useEffect, useState } from 'react';
4
+ import DropdownButton from "../components/DropdownButton";
5
+ import WidgetBox from "../WidgetBox";
6
+ import BoxBackgroundSetting from "./BoxBackgroundSetting";
7
+ /**
8
+ * 框背景设置
9
+ * @param {*} props
10
+ * @returns
11
+ */
12
+
13
+ function BoxBackgroundButton(props) {
14
+ var topo = props.topo,
15
+ showLabel = props.showLabel,
16
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
17
+
18
+ var _useState = useState(true),
19
+ disabled = _useState[0],
20
+ setDisabled = _useState[1]; // 选中的元素
21
+
22
+
23
+ var selection = topo.selectionManager.useSelection();
24
+ useEffect(function () {
25
+ setDisabled(false);
26
+ }, [selection]);
27
+ var icon = disabled ? /*#__PURE__*/React.createElement("img", {
28
+ src: "/img/topo/editor/toolbar/\u80CC\u666F\u586B\u5145\u53CA\u8FB9\u6846/Disable.svg",
29
+ alt: ""
30
+ }) : /*#__PURE__*/React.createElement("img", {
31
+ src: "/img/topo/editor/toolbar/\u80CC\u666F\u586B\u5145\u53CA\u8FB9\u6846/Normal.svg",
32
+ alt: ""
33
+ });
34
+ return /*#__PURE__*/React.createElement(WidgetBox, {
35
+ label: "\u6846\u80CC\u666F",
36
+ tooltip: "\u6846\u80CC\u666F",
37
+ showLabel: showLabel
38
+ }, /*#__PURE__*/React.createElement(DropdownButton, {
39
+ disabled: disabled,
40
+ trigger: icon
41
+ }, /*#__PURE__*/React.createElement(BoxBackgroundSetting, {
42
+ topo: topo
43
+ })));
44
+ }
45
+
46
+ export default BoxBackgroundButton;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+
3
+ function BoxBackgroundSetting(props) {
4
+ // const { } = props
5
+ return /*#__PURE__*/React.createElement("div", null, "xxx");
6
+ }
7
+
8
+ export default BoxBackgroundSetting;
@@ -0,0 +1,2 @@
1
+ import BoxBackgroundButton from "./BoxBackgroundButton";
2
+ export default BoxBackgroundButton;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import WidgetBox from "./WidgetBox";
3
+ import ButtonBox from "./components/ButtonBox";
4
+
5
+ function CanvasMoveWidget(props) {
6
+ var showLabel = props.showLabel;
7
+ return /*#__PURE__*/React.createElement(WidgetBox, {
8
+ label: "\u79FB\u52A8",
9
+ tooltip: "\u79FB\u52A8",
10
+ showLabel: showLabel
11
+ }, /*#__PURE__*/React.createElement(ButtonBox, null, /*#__PURE__*/React.createElement("img", {
12
+ src: "/img/topo/editor/toolbar/drag/Normal.svg",
13
+ alt: ""
14
+ })));
15
+ }
16
+
17
+ export default CanvasMoveWidget;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import WidgetBox from "./WidgetBox";
3
+ import ButtonBox from "./components/ButtonBox";
4
+
5
+ function CanvasSelectWidget(props) {
6
+ var showLabel = props.showLabel;
7
+ return /*#__PURE__*/React.createElement(WidgetBox, {
8
+ label: "\u9009\u62E9",
9
+ tooltip: "\u9009\u62E9",
10
+ showLabel: showLabel
11
+ }, /*#__PURE__*/React.createElement(ButtonBox, {
12
+ active: true
13
+ }, /*#__PURE__*/React.createElement("img", {
14
+ src: "/img/topo/editor/toolbar/select/Normal.svg",
15
+ alt: ""
16
+ })));
17
+ }
18
+
19
+ export default CanvasSelectWidget;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import styles from "./Divider.module.scss";
3
+
4
+ function Divider() {
5
+ return /*#__PURE__*/React.createElement("div", {
6
+ className: styles.divider
7
+ });
8
+ }
9
+
10
+ export default Divider;
@@ -0,0 +1,6 @@
1
+ .divider {
2
+ width: 1px;
3
+ // height: 32px;
4
+ background: #E4E9EE;
5
+ margin: 4px 6px 0 6px;
6
+ }
@@ -0,0 +1,14 @@
1
+ import _Dropdown from "@alifd/next/es/dropdown";
2
+ import _Menu from "@alifd/next/es/menu";
3
+ import React from 'react';
4
+
5
+ function Dropdown(props) {
6
+ var trigger = props.trigger;
7
+ var menu = /*#__PURE__*/React.createElement(_Menu, null, /*#__PURE__*/React.createElement(_Menu.Item, null, "Option 1"), /*#__PURE__*/React.createElement(_Menu.Item, null, "Option 2"), /*#__PURE__*/React.createElement(_Menu.Item, null, "Option 3"), /*#__PURE__*/React.createElement(_Menu.Item, null, "Option 4"));
8
+ return /*#__PURE__*/React.createElement(_Dropdown, {
9
+ trigger: /*#__PURE__*/React.createElement("a", null, "Click me"),
10
+ triggerType: "click"
11
+ }, /*#__PURE__*/React.createElement("div", null, "111"));
12
+ }
13
+
14
+ export default Dropdown;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+
3
+ function Content(props) {
4
+ // const { } = props
5
+ return /*#__PURE__*/React.createElement("div", null, "xxx");
6
+ }
7
+
8
+ export default Content;
@@ -0,0 +1,46 @@
1
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
+ var _excluded = ["topo", "showLabel"];
3
+ import React, { useEffect, useState } from 'react';
4
+ import DropdownButton from "../components/DropdownButton";
5
+ import WidgetBox from "../WidgetBox";
6
+ import Content from "./Content";
7
+ /**
8
+ * 线条颜色
9
+ * @param {*} props
10
+ * @returns
11
+ */
12
+
13
+ function EdgeColorButton(props) {
14
+ var topo = props.topo,
15
+ showLabel = props.showLabel,
16
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
17
+
18
+ var _useState = useState(true),
19
+ disabled = _useState[0],
20
+ setDisabled = _useState[1]; // 选中的元素
21
+
22
+
23
+ var selection = topo.selectionManager.useSelection();
24
+ useEffect(function () {
25
+ setDisabled(false);
26
+ }, [selection]);
27
+ var icon = disabled ? /*#__PURE__*/React.createElement("img", {
28
+ src: "/img/topo/editor/toolbar/\u7EBF\u6761\u586B\u5145/Disable.svg",
29
+ alt: ""
30
+ }) : /*#__PURE__*/React.createElement("img", {
31
+ src: "/img/topo/editor/toolbar/\u7EBF\u6761\u586B\u5145/Normal.svg",
32
+ alt: ""
33
+ });
34
+ return /*#__PURE__*/React.createElement(WidgetBox, {
35
+ label: "\u7EBF\u6761\u989C\u8272",
36
+ tooltip: "\u7EBF\u6761\u989C\u8272",
37
+ showLabel: showLabel
38
+ }, /*#__PURE__*/React.createElement(DropdownButton, {
39
+ disabled: disabled,
40
+ trigger: icon
41
+ }, /*#__PURE__*/React.createElement(Content, {
42
+ topo: topo
43
+ })));
44
+ }
45
+
46
+ export default EdgeColorButton;
@@ -0,0 +1,2 @@
1
+ import EdgeColorButton from "./EdgeColorButton";
2
+ export default EdgeColorButton;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+
3
+ function EdgeType(props) {
4
+ // const { } = props
5
+ return /*#__PURE__*/React.createElement("div", null, "\u7EBF\u5F62\u8BBE\u7F6E");
6
+ }
7
+
8
+ export default EdgeType;