@riil-frontend/component-topology 6.0.0-alpha.65 → 6.0.0-alpha.67
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.
- package/build/index.js +1 -1
- package/es/components/ColorPanel/index.js +20 -18
- package/es/core/components/TopoView/topoView.js +2 -2
- package/es/core/editor/components/Sidebar/Sidebar.js +7 -3
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +84 -26
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +0 -4
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +43 -4
- package/es/core/models/TopoApp.js +1 -1
- package/lib/components/ColorPanel/index.js +20 -18
- package/lib/core/components/TopoView/topoView.js +2 -2
- package/lib/core/editor/components/Sidebar/Sidebar.js +6 -2
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +89 -30
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +0 -4
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +43 -3
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +2 -2
@@ -11,9 +11,12 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
11
11
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
13
|
|
14
|
+
var _fontStyleUtil = _interopRequireDefault(require("../../../../../settings/common/text/fontStyleUtil"));
|
15
|
+
|
14
16
|
var _colorUtil = require("../ElementTextStyleSetting/colorUtil");
|
15
17
|
|
16
|
-
var _excluded = ["color", "background", "opacity"]
|
18
|
+
var _excluded = ["color", "background", "opacity"],
|
19
|
+
_excluded2 = ["color", "background", "opacity", "bold", "italic"];
|
17
20
|
var defaultStyle = {
|
18
21
|
color: '#AFB9C2',
|
19
22
|
fontFamily: '微软雅黑'
|
@@ -40,12 +43,13 @@ var setGlobalTagStyle = function setGlobalTagStyle(topo, styleData) {
|
|
40
43
|
var style = buildStyle(styleData, nodeLabelStyle);
|
41
44
|
var globalNodeLabelStyle = (0, _extends2["default"])({}, nodeLabelStyle, style);
|
42
45
|
var globalEdgeTagStyle = (0, _extends2["default"])({}, nodeLabelStyle, defaultEdgeLabelStyle, style);
|
43
|
-
topo.getHtTopo().setGlobalNodeLabelStyle(globalNodeLabelStyle);
|
44
|
-
topo.getHtTopo().setGlobalEdgeTagStyle(globalEdgeTagStyle);
|
45
46
|
displayConfigDispatchers.update({
|
46
47
|
nodeLabelStyle: globalNodeLabelStyle,
|
47
48
|
defaultEdgeLabelStyle: globalEdgeTagStyle
|
48
49
|
});
|
50
|
+
var styles = setTextStyle(styleData, nodeLabelStyle);
|
51
|
+
topo.getHtTopo().setGlobalNodeLabelStyle(styles);
|
52
|
+
topo.getHtTopo().setGlobalEdgeTagStyle(styles);
|
49
53
|
};
|
50
54
|
|
51
55
|
exports.setGlobalTagStyle = setGlobalTagStyle;
|
@@ -69,4 +73,40 @@ function buildStyle(styleData, prevTagStyle) {
|
|
69
73
|
return style;
|
70
74
|
}
|
71
75
|
|
76
|
+
function setTextStyle(styleData, nodeLabelStyle) {
|
77
|
+
var _fontStyleUtil$remove = _fontStyleUtil["default"].removeBoldItalic(styleData),
|
78
|
+
color = _fontStyleUtil$remove.color,
|
79
|
+
background = _fontStyleUtil$remove.background,
|
80
|
+
opacity = _fontStyleUtil$remove.opacity,
|
81
|
+
bold = _fontStyleUtil$remove.bold,
|
82
|
+
italic = _fontStyleUtil$remove.italic,
|
83
|
+
otherStyle = (0, _objectWithoutPropertiesLoose2["default"])(_fontStyleUtil$remove, _excluded2);
|
84
|
+
|
85
|
+
var tagStyle = (0, _extends2["default"])({}, otherStyle);
|
86
|
+
|
87
|
+
if ('color' in styleData) {
|
88
|
+
tagStyle.color = color.hex;
|
89
|
+
}
|
90
|
+
|
91
|
+
if ('bold' in styleData) {
|
92
|
+
tagStyle.fontBold = bold;
|
93
|
+
}
|
94
|
+
|
95
|
+
if ('italic' in styleData) {
|
96
|
+
tagStyle.fontItalic = italic;
|
97
|
+
}
|
98
|
+
|
99
|
+
if ('background' in styleData) {
|
100
|
+
// 背景颜色
|
101
|
+
var prevBackgroundStyle = (0, _colorUtil.parseBackground)(nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.background);
|
102
|
+
tagStyle.background = (0, _colorUtil.formatBackgroundRgbaColor)(prevBackgroundStyle, styleData);
|
103
|
+
}
|
104
|
+
|
105
|
+
if ('opacity' in styleData) {
|
106
|
+
tagStyle.opacity = opacity;
|
107
|
+
}
|
108
|
+
|
109
|
+
return tagStyle;
|
110
|
+
}
|
111
|
+
|
72
112
|
function setStyle() {}
|
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
54
54
|
var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "6.0.0-alpha.
|
57
|
+
var version = typeof "6.0.0-alpha.67" === 'string' ? "6.0.0-alpha.67" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "6.0.0-alpha.
|
3
|
+
"version": "6.0.0-alpha.67",
|
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.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.0-alpha.67/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|