@riil-frontend/component-topology 6.0.0-alpha.35 → 6.0.0-alpha.37

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 (35) hide show
  1. package/build/index.css +1 -1
  2. package/build/index.js +1 -1
  3. package/es/components/ColorPanel/components/ColorBlock/index.module.scss +1 -0
  4. package/es/components/ColorPanel/components/FontColorRange/index.module.scss +3 -4
  5. package/es/components/ColorPanel/index.module.scss +4 -3
  6. package/es/core/components/TopoView/GraphViewPanel.js +1 -0
  7. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +10 -67
  8. package/es/core/editor/components/Sidebar/views/CanvasPanel/themes.js +42 -0
  9. package/es/core/editor/components/Sidebar/views/CanvasPanel/useCanvasThemeConfig.js +116 -0
  10. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +12 -3
  11. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +2 -2
  12. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +11 -31
  13. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +11 -6
  14. package/es/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +3 -2
  15. package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +34 -30
  16. package/es/core/editor/components/settings/common/AlignSetting/index.js +3 -3
  17. package/es/core/hooks/useCanvasTheme.js +26 -12
  18. package/es/core/models/TopoApp.js +1 -1
  19. package/lib/components/ColorPanel/components/ColorBlock/index.module.scss +1 -0
  20. package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +3 -4
  21. package/lib/components/ColorPanel/index.module.scss +4 -3
  22. package/lib/core/components/TopoView/GraphViewPanel.js +1 -0
  23. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +11 -66
  24. package/lib/core/editor/components/Sidebar/views/CanvasPanel/themes.js +47 -0
  25. package/lib/core/editor/components/Sidebar/views/CanvasPanel/useCanvasThemeConfig.js +128 -0
  26. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +12 -3
  27. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +2 -2
  28. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +11 -31
  29. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +11 -6
  30. package/lib/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +3 -2
  31. package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +33 -29
  32. package/lib/core/editor/components/settings/common/AlignSetting/index.js +3 -3
  33. package/lib/core/hooks/useCanvasTheme.js +26 -12
  34. package/lib/core/models/TopoApp.js +1 -1
  35. package/package.json +2 -2
@@ -20,45 +20,46 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
20
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
21
 
22
22
  var TREE_LAYOUT_OPTIONS = [{
23
- value: "left",
24
- label: "左对齐",
25
- icon: "tuopu_zuoceduiqi"
23
+ value: 'left',
24
+ label: '左对齐',
25
+ icon: 'tuopu_zuoceduiqi'
26
26
  }, {
27
- value: "center",
28
- label: "水平居中",
29
- icon: "tuopu_shuipingjuzhongduiqi"
27
+ value: 'center',
28
+ label: '水平居中',
29
+ icon: 'tuopu_shuipingjuzhongduiqi'
30
30
  }, {
31
- value: "right",
32
- label: "右对齐",
33
- icon: "tuopu_youceduiqi"
31
+ value: 'right',
32
+ label: '右对齐',
33
+ icon: 'tuopu_youceduiqi'
34
34
  }, {
35
- value: "top",
36
- label: "靠上对齐",
37
- icon: "tuopu_dingbuduiqi"
35
+ value: 'top',
36
+ label: '靠上对齐',
37
+ icon: 'tuopu_dingbuduiqi'
38
38
  }, {
39
- value: "middle",
40
- label: "垂直居中",
41
- icon: "tuopu_chuizhijuzhongduiqi"
39
+ value: 'middle',
40
+ label: '垂直居中',
41
+ icon: 'tuopu_chuizhijuzhongduiqi'
42
42
  }, {
43
- value: "bottom",
44
- label: "靠下对齐",
45
- icon: "tuopu_dibuduiqi"
43
+ value: 'bottom',
44
+ label: '靠下对齐',
45
+ icon: 'tuopu_dibuduiqi'
46
46
  }, {
47
- value: "divide"
47
+ value: 'divide'
48
48
  }, {
49
- value: "distributeHorizontal",
50
- label: "横向分布",
51
- icon: "tuopu_shuipingdengjianjuduiqi"
49
+ value: 'distributeHorizontal',
50
+ label: '横向分布',
51
+ icon: 'tuopu_shuipingdengjianjuduiqi'
52
52
  }, {
53
- value: "distributeVertical",
54
- label: "纵向分布",
55
- icon: "tuopu_chuizhidengjianjuduiqi"
53
+ value: 'distributeVertical',
54
+ label: '纵向分布',
55
+ icon: 'tuopu_chuizhidengjianjuduiqi'
56
56
  }];
57
57
 
58
58
  var AlignTypeList = function AlignTypeList(props) {
59
59
  var _props$selected = props.selected,
60
- selected = _props$selected === void 0 ? "left" : _props$selected,
61
- onChange = props.onChange;
60
+ selected = _props$selected === void 0 ? 'left' : _props$selected,
61
+ onChange = props.onChange,
62
+ distributionDisabled = props.distributionDisabled;
62
63
 
63
64
  var _useState = (0, _react.useState)(selected),
64
65
  value = _useState[0],
@@ -73,16 +74,19 @@ var AlignTypeList = function AlignTypeList(props) {
73
74
  return /*#__PURE__*/_react["default"].createElement("div", {
74
75
  className: _AlignSettingModule["default"].AlignSetting
75
76
  }, TREE_LAYOUT_OPTIONS.map(function (item, index, array) {
76
- return item.value === "divide" ? /*#__PURE__*/_react["default"].createElement(_divider["default"], {
77
+ return item.value === 'divide' ? /*#__PURE__*/_react["default"].createElement(_divider["default"], {
77
78
  key: index,
78
79
  direction: "ver"
79
80
  }) : /*#__PURE__*/_react["default"].createElement(_button["default"], {
80
81
  key: index,
81
82
  className: "" + _AlignSettingModule["default"].redioBtn,
83
+ text: true,
82
84
  onClick: function onClick() {
83
85
  handleChange(item);
84
86
  },
85
- title: item.label
87
+ title: item.label // eslint-disable-next-line no-unneeded-ternary
88
+ ,
89
+ disabled: (item.value === 'distributeHorizontal' || item.value === 'distributeVertical') && distributionDisabled
86
90
  }, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
87
91
  type: item.icon
88
92
  }));
@@ -13,10 +13,9 @@ var _AlignTypeList = _interopRequireDefault(require("./AlignTypeList"));
13
13
 
14
14
  function AlignSetting(props) {
15
15
  var topo = props.topo,
16
- getClickType = props.getClickType;
16
+ distributionDisabled = props.distributionDisabled;
17
17
 
18
18
  var alignOnChange = function alignOnChange(type) {
19
- getClickType(type);
20
19
  topo.historyManager.beginTransaction();
21
20
  var selection = topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
22
21
  var nodes = selection.filter(function (ele) {
@@ -29,6 +28,7 @@ function AlignSetting(props) {
29
28
 
30
29
  return /*#__PURE__*/_react["default"].createElement(_AlignTypeList["default"], {
31
30
  onChange: alignOnChange,
32
- selected: "left"
31
+ selected: "left",
32
+ distributionDisabled: distributionDisabled
33
33
  });
34
34
  }
@@ -14,35 +14,49 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
14
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
15
 
16
16
  var themeMap = [{
17
- value: 'white',
17
+ name: 'white',
18
18
  label: '白色',
19
- color: '#FFFFFF'
19
+ color: null,
20
+ toolsTheme: 'lightgrayblue'
20
21
  }, {
21
- value: 'lightblue',
22
+ name: 'lightblue',
22
23
  label: '蓝色',
23
- color: '#F9FBFF'
24
+ color: '#F9FBFF',
25
+ toolsTheme: 'white'
24
26
  }, {
25
- value: 'yellow',
27
+ name: 'yellow',
26
28
  label: '黄色',
27
29
  color: '#FFFDE6'
28
30
  }, {
29
- value: 'green',
31
+ name: 'green',
30
32
  label: '绿色',
31
33
  color: '#EAFFE8'
32
34
  }, {
33
- value: 'dark',
35
+ name: 'dark',
34
36
  label: '深色',
35
- color: '#031425'
37
+ color: '#031425',
38
+ toolsTheme: 'black'
36
39
  }].reduce(function (map, item) {
37
40
  var _extends2;
38
41
 
39
- return (0, _extends3["default"])({}, map, (_extends2 = {}, _extends2[item.value] = item, _extends2));
42
+ return (0, _extends3["default"])({}, map, (_extends2 = {}, _extends2[item.name] = item, _extends2));
40
43
  }, {});
41
44
 
42
45
  function useCanvasTheme(props) {
43
- var canvasTheme = props.canvasTheme;
44
- (0, _react.useEffect)(function () {// 设置
45
- }, [canvasTheme]);
46
+ var topo = props.topo,
47
+ canvasTheme = props.canvasTheme; // 拓扑图是否加载
48
+
49
+ var _topo$store$useModelS = topo.store.useModelState('topoMod'),
50
+ graphLoaded = _topo$store$useModelS.graphLoaded;
51
+
52
+ (0, _react.useEffect)(function () {
53
+ // 设置
54
+ var themeConfig = themeMap[canvasTheme];
55
+
56
+ if (graphLoaded && themeConfig) {
57
+ topo.getHtTopo().setToolsTheme(themeConfig.toolsTheme);
58
+ }
59
+ }, [canvasTheme, graphLoaded]);
46
60
  return {
47
61
  canvasColor: themeMap[canvasTheme].color
48
62
  };
@@ -52,7 +52,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
52
52
  var _SelectionManager = _interopRequireDefault(require("./SelectionManager"));
53
53
 
54
54
  // eslint-disable-next-line no-undef
55
- var version = typeof "6.0.0-alpha.35" === 'string' ? "6.0.0-alpha.35" : null;
55
+ var version = typeof "6.0.0-alpha.37" === 'string' ? "6.0.0-alpha.37" : null;
56
56
  console.info("\u62D3\u6251\u7248\u672C: " + version);
57
57
  /**
58
58
  * 拓扑显示和编辑
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "6.0.0-alpha.35",
3
+ "version": "6.0.0-alpha.37",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.0-alpha.35/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.0-alpha.37/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }