@titaui/pc 1.10.49 → 1.10.52-beta.1
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/lib/components/button/default-button/index.css +10 -4
- package/lib/components/button/default-button/index.js +13 -2
- package/lib/components/help-card/image/not-try.png +0 -0
- package/lib/components/help-card/image/try.png +0 -0
- package/lib/components/help-card/index.css +30 -1
- package/lib/components/help-card/index.js +53 -16
- package/lib/components/menus/export-modules/demo-menus/menus.js +2 -1
- package/lib/components/menus/export-modules/manage-menus/constant.js +1 -1
- package/lib/components/menus/export-modules/manage-menus/index.css +3 -0
- package/lib/components/menus/images/okr-gongsi.svg +17 -0
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/index.css +2 -1
- package/lib/components/rich-editor/plugins/extension/placeholder/index.js +126 -0
- package/lib/components/rich-editor/plugins/extension/placeholder/styles.js +19 -0
- package/lib/components/rich-editor/plugins/inline/color/consts.js +2 -2
- package/lib/components/rich-editor/plugins/inline/color/selector.js +8 -8
- package/lib/components/rich-editor/plugins/inline/link/ui/index.css +5 -0
- package/lib/components/rich-editor/plugins/util.js +6 -3
- package/lib/components/rich-editor/ui/editor/index.css +41 -7
- package/lib/components/rich-editor/ui/editor/index.js +9 -4
- package/lib/components/rich-editor/utils/document.js +51 -0
- package/lib/pages/aha2021/img/canceled.svg +13 -0
- package/lib/pages/aha2021/img/not-try.png +0 -0
- package/lib/pages/aha2021/index.css +45 -0
- package/lib/pages/aha2021/index.js +71 -14
- package/lib/pages/new-okr-list/index.js +1 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.tita-button-primary {
|
|
20
|
-
background: #
|
|
20
|
+
background: #2879ff;
|
|
21
21
|
color: #ffffff;
|
|
22
22
|
border-radius: 4px;
|
|
23
23
|
box-sizing: border-box;
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.tita-button-primary:hover {
|
|
32
|
-
background: #
|
|
32
|
+
background: #5c8eff;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.tita-button-default {
|
|
36
36
|
background: #ffffff;
|
|
37
37
|
border-radius: 4px;
|
|
38
|
-
border: 1px solid #
|
|
38
|
+
border: 1px solid #2879ff;
|
|
39
39
|
box-sizing: border-box;
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
@@ -45,5 +45,11 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.tita-button-default:hover {
|
|
48
|
-
background: #
|
|
48
|
+
background: #e9f1ff;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.tita-button--disabled {
|
|
52
|
+
opacity: 0.4;
|
|
53
|
+
cursor: not-allowed;
|
|
54
|
+
user-select: none;
|
|
49
55
|
}
|
|
@@ -13,7 +13,7 @@ var _getLocale = require("../../../utils/getLocale");
|
|
|
13
13
|
|
|
14
14
|
require("./index.css");
|
|
15
15
|
|
|
16
|
-
var _excluded = ["type", "children", "size", "className"];
|
|
16
|
+
var _excluded = ["type", "children", "size", "disable", "className"];
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
19
|
|
|
@@ -28,20 +28,31 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
28
28
|
var preCls = "tita-button";
|
|
29
29
|
|
|
30
30
|
var Button = function Button(_ref) {
|
|
31
|
+
var _classNames;
|
|
32
|
+
|
|
31
33
|
var _ref$type = _ref.type,
|
|
32
34
|
type = _ref$type === void 0 ? "default" : _ref$type,
|
|
33
35
|
_ref$children = _ref.children,
|
|
34
36
|
children = _ref$children === void 0 ? (0, _getLocale.getLocale)("OKR_MyO_Butt_Determine") : _ref$children,
|
|
35
37
|
_ref$size = _ref.size,
|
|
36
38
|
size = _ref$size === void 0 ? "middle" : _ref$size,
|
|
39
|
+
_ref$disable = _ref.disable,
|
|
40
|
+
disable = _ref$disable === void 0 ? false : _ref$disable,
|
|
37
41
|
_ref$className = _ref.className,
|
|
38
42
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
39
43
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
40
44
|
|
|
41
45
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
42
|
-
className: (0, _classnames["default"])(
|
|
46
|
+
className: (0, _classnames["default"])((_classNames = {}, _defineProperty(_classNames, "".concat(preCls, "-primary"), type === "primary"), _defineProperty(_classNames, "".concat(preCls, "-default"), type === "default"), _defineProperty(_classNames, "".concat(preCls, "--disabled"), disable), _classNames), "".concat(preCls, "-").concat(size), className)
|
|
43
47
|
}, restProps), children);
|
|
44
48
|
};
|
|
45
49
|
|
|
50
|
+
Button.defaultProps = {
|
|
51
|
+
type: "default",
|
|
52
|
+
children: (0, _getLocale.getLocale)("OKR_MyO_Butt_Determine"),
|
|
53
|
+
size: "middle",
|
|
54
|
+
disable: false,
|
|
55
|
+
className: ""
|
|
56
|
+
};
|
|
46
57
|
var _default = Button;
|
|
47
58
|
exports["default"] = _default;
|
|
Binary file
|
|
Binary file
|
|
@@ -59,6 +59,35 @@
|
|
|
59
59
|
border-radius: 50%;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
.help-card__wechat {
|
|
63
|
+
height: 330px;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.help-card__wechat-title {
|
|
71
|
+
font-size: 20px;
|
|
72
|
+
font-weight: normal;
|
|
73
|
+
color: #141c28;
|
|
74
|
+
line-height: 30px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.help-card__wechat-content {
|
|
78
|
+
margin-top: 4px;
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
font-weight: normal;
|
|
81
|
+
color: #6f7886;
|
|
82
|
+
line-height: 22px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.help-card__wechat-img {
|
|
86
|
+
width: 200px;
|
|
87
|
+
height: 200px;
|
|
88
|
+
margin-top: 24px;
|
|
89
|
+
}
|
|
90
|
+
|
|
62
91
|
.help-card__body {
|
|
63
92
|
box-sizing: border-box;
|
|
64
93
|
padding: 0 20px;
|
|
@@ -96,7 +125,7 @@
|
|
|
96
125
|
}
|
|
97
126
|
|
|
98
127
|
.help-card__body-item-title-left::before {
|
|
99
|
-
content:
|
|
128
|
+
content: '';
|
|
100
129
|
width: 81px;
|
|
101
130
|
height: 7px;
|
|
102
131
|
background: linear-gradient(90deg, #2879ff 0%, #f6f8fc 100%);
|
|
@@ -23,6 +23,8 @@ var _requestApi = require("./request-api");
|
|
|
23
23
|
|
|
24
24
|
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
25
25
|
|
|
26
|
+
var _conditionRender = _interopRequireDefault(require("../condition-render"));
|
|
27
|
+
|
|
26
28
|
var _kefu = _interopRequireDefault(require("./image/kefu1.svg"));
|
|
27
29
|
|
|
28
30
|
var _yuyueyanshi = _interopRequireDefault(require("./image/yuyueyanshi.svg"));
|
|
@@ -39,6 +41,12 @@ var _errorBoundary = _interopRequireDefault(require("../error-boundary"));
|
|
|
39
41
|
|
|
40
42
|
var _errorLevel = _interopRequireDefault(require("../../utils/error-level"));
|
|
41
43
|
|
|
44
|
+
var _platform = require("../../utils/platform");
|
|
45
|
+
|
|
46
|
+
var _try = _interopRequireDefault(require("./image/try.png"));
|
|
47
|
+
|
|
48
|
+
var _notTry = _interopRequireDefault(require("./image/not-try.png"));
|
|
49
|
+
|
|
42
50
|
require("./index.css");
|
|
43
51
|
|
|
44
52
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -62,6 +70,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
62
70
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
63
71
|
|
|
64
72
|
var preCls = "help-card";
|
|
73
|
+
var isTry = (0, _bsGlobal.getVersion)() === 1;
|
|
74
|
+
var isDingding = (0, _platform.isDD)(true) === true;
|
|
75
|
+
var isFeis = (0, _platform.isFeishu)(true) === true;
|
|
65
76
|
|
|
66
77
|
var HelpCard = function HelpCard(_ref) {
|
|
67
78
|
var restProps = _extends({}, _ref);
|
|
@@ -71,25 +82,30 @@ var HelpCard = function HelpCard(_ref) {
|
|
|
71
82
|
visible = _useState2[0],
|
|
72
83
|
setVisible = _useState2[1];
|
|
73
84
|
|
|
74
|
-
var _useState3 = (0, _react.useState)(
|
|
85
|
+
var _useState3 = (0, _react.useState)(false),
|
|
75
86
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
76
|
-
|
|
77
|
-
|
|
87
|
+
weChatCodeVisible = _useState4[0],
|
|
88
|
+
setWeChatCodeVisible = _useState4[1];
|
|
78
89
|
|
|
79
|
-
var _useState5 = (0, _react.useState)(
|
|
90
|
+
var _useState5 = (0, _react.useState)(1),
|
|
80
91
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
pageNum = _useState6[0],
|
|
93
|
+
setPageNum = _useState6[1];
|
|
83
94
|
|
|
84
95
|
var _useState7 = (0, _react.useState)([]),
|
|
85
96
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
86
|
-
|
|
87
|
-
|
|
97
|
+
guessList = _useState8[0],
|
|
98
|
+
setGuessList = _useState8[1];
|
|
88
99
|
|
|
89
|
-
var _useState9 = (0, _react.useState)(
|
|
100
|
+
var _useState9 = (0, _react.useState)([]),
|
|
90
101
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
91
|
-
|
|
92
|
-
|
|
102
|
+
recommendList = _useState10[0],
|
|
103
|
+
setRecommendList = _useState10[1];
|
|
104
|
+
|
|
105
|
+
var _useState11 = (0, _react.useState)(0),
|
|
106
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
107
|
+
guessQuestionNum = _useState12[0],
|
|
108
|
+
setGuessQuestionNum = _useState12[1];
|
|
93
109
|
|
|
94
110
|
var bookDemoRef = (0, _react.useRef)();
|
|
95
111
|
var isTrial = (0, _bsGlobal.getVersion)() === 1;
|
|
@@ -129,6 +145,9 @@ var HelpCard = function HelpCard(_ref) {
|
|
|
129
145
|
|
|
130
146
|
setGuessList(guessQuestion || []);
|
|
131
147
|
});
|
|
148
|
+
setTimeout(function () {
|
|
149
|
+
setWeChatCodeVisible(!visible);
|
|
150
|
+
}, 100);
|
|
132
151
|
}, [pageNum, visible]);
|
|
133
152
|
|
|
134
153
|
var handlePoint = function handlePoint() {
|
|
@@ -178,9 +197,13 @@ var HelpCard = function HelpCard(_ref) {
|
|
|
178
197
|
};
|
|
179
198
|
|
|
180
199
|
var handleCustomerService = function handleCustomerService() {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
200
|
+
if (isDingding === true || isFeis === true) {
|
|
201
|
+
setVisible(false);
|
|
202
|
+
window.open(kefuUrl);
|
|
203
|
+
handleClickTracker("联系客服");
|
|
204
|
+
} else {
|
|
205
|
+
setWeChatCodeVisible(true);
|
|
206
|
+
}
|
|
184
207
|
};
|
|
185
208
|
|
|
186
209
|
var handleUpgrade = function handleUpgrade() {
|
|
@@ -215,7 +238,9 @@ var HelpCard = function HelpCard(_ref) {
|
|
|
215
238
|
className: "".concat(preCls, "__header")
|
|
216
239
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
217
240
|
className: "".concat(preCls, "__header-avatar")
|
|
218
|
-
}), "Tita\u5C0F\u52A9\u624B"), /*#__PURE__*/_react["default"].createElement("
|
|
241
|
+
}), "Tita\u5C0F\u52A9\u624B"), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
242
|
+
condition: weChatCodeVisible === false
|
|
243
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
219
244
|
className: "".concat(preCls, "__body")
|
|
220
245
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
221
246
|
className: "".concat(preCls, "__body-item")
|
|
@@ -254,7 +279,19 @@ var HelpCard = function HelpCard(_ref) {
|
|
|
254
279
|
},
|
|
255
280
|
key: item.questionUrl + item.questionName
|
|
256
281
|
}, item.questionName);
|
|
257
|
-
})))), /*#__PURE__*/_react["default"].createElement("
|
|
282
|
+
}))))), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
283
|
+
condition: weChatCodeVisible === true
|
|
284
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
285
|
+
className: "".concat(preCls, "__wechat")
|
|
286
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
287
|
+
className: "".concat(preCls, "__wechat-title")
|
|
288
|
+
}, "\u5FAE\u4FE1/\u4F01\u4E1A\u5FAE\u4FE1\u626B\u4E00\u626B"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
289
|
+
className: "".concat(preCls, "__wechat-content")
|
|
290
|
+
}, "\u4E13\u5C5E\u5BA2\u670D\u4E3A\u4F60\u63D0\u4F9B\u54A8\u8BE2\u670D\u52A1"), /*#__PURE__*/_react["default"].createElement("img", {
|
|
291
|
+
src: isTry ? _try["default"] : _notTry["default"],
|
|
292
|
+
className: "".concat(preCls, "__wechat-img"),
|
|
293
|
+
alt: "\u5FAE\u4FE1\u626B\u7801"
|
|
294
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
258
295
|
className: "".concat(preCls, "__footer")
|
|
259
296
|
}, isTrial && /*#__PURE__*/_react["default"].createElement("div", {
|
|
260
297
|
className: "".concat(preCls, "__footer-item"),
|
|
@@ -16,10 +16,11 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
16
16
|
var EManagerType;
|
|
17
17
|
|
|
18
18
|
(function (EManagerType) {
|
|
19
|
+
EManagerType[EManagerType["Sales"] = 0] = "Sales";
|
|
19
20
|
EManagerType[EManagerType["Manager"] = 1] = "Manager";
|
|
20
21
|
EManagerType[EManagerType["Supervisor"] = 2] = "Supervisor";
|
|
21
|
-
EManagerType[EManagerType["Sales"] = 0] = "Sales";
|
|
22
22
|
EManagerType[EManagerType["ReCharge"] = 3] = "ReCharge";
|
|
23
|
+
EManagerType[EManagerType["DemoFreeReadOnly"] = 4] = "DemoFreeReadOnly";
|
|
23
24
|
})(EManagerType || (EManagerType = {}));
|
|
24
25
|
|
|
25
26
|
var defaultRefObject = {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>OKR-gongsi</title>
|
|
4
|
+
<g id="新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g id="OKR-gongsi">
|
|
6
|
+
<rect id="矩形" fill-opacity="0" fill="#FFFFFF" x="0" y="0" width="18" height="18"></rect>
|
|
7
|
+
<g id="编组" transform="translate(3.000000, 1.875000)" fill="#141C28">
|
|
8
|
+
<path d="M4.10139571,0.207109154 C5.30548811,-0.332079068 6.71387503,0.21781894 7.24711594,1.43534073 C7.38177811,1.74280798 7.45134383,2.07535848 7.45134383,2.41162737 L7.45134383,2.41162737 L7.45134383,4.57179909 L8.31469627,5.11190194 C8.50972555,5.210975 8.64355884,5.41510258 8.64355884,5.65083722 C8.64355884,5.98373015 8.37667242,6.25359319 8.04745134,6.25359319 C7.93433435,6.25359319 7.82857621,6.22173481 7.73847398,6.16640762 L7.737,6.169 L6.54112363,5.41956638 C6.39501401,5.32796807 6.29659069,5.17813983 6.26784152,5.01002569 L6.25912882,4.90728246 L6.25912882,2.41162737 C6.25912882,2.24349293 6.22434596,2.07721768 6.15701487,1.92348405 L6.15701487,1.92348405 L6.14681255,1.9008124 C5.87280554,1.30793451 5.17867538,1.04314408 4.58415476,1.30936826 L4.58415476,1.30936826 L1.90167098,2.5105748 C1.47035103,2.70371832 1.19221501,3.13584938 1.19221501,3.61283391 L1.19221501,3.61283391 L1.19221501,11.8389761 C1.19221501,12.504762 1.72598786,13.0445078 2.38443003,13.0445078 L2.38443003,13.0445078 L7.995,13.044 L8.04745134,14.2401098 L9.74192999,14.2409586 C9.68587029,14.2458533 9.62924586,14.2488023 9.57212243,14.249738 L9.57212243,14.249738 L9.5377201,14.25 L2.38443003,14.25 C1.06754569,14.25 0,13.1705478 0,11.8389761 L0,11.8389761 L0,3.61283391 C0,2.65886485 0.556272039,1.79460272 1.41891194,1.4083157 L1.41891194,1.4083157 Z" id="形状结合" fill-rule="nonzero"></path>
|
|
9
|
+
<rect id="矩形" x="3.15" y="3.26067444" width="1.2" height="4.8" rx="0.6"></rect>
|
|
10
|
+
</g>
|
|
11
|
+
<g id="编组" transform="translate(7.275000, 8.775000)">
|
|
12
|
+
<path d="M2.65951382,0.134116403 L1.38451382,0.868914715 C0.643634524,1.29589264 0.1875,2.08321551 0.1875,2.93505159 L0.1875,4.41494841 C0.1875,5.26678449 0.643634524,6.05410736 1.38451382,6.48108529 L2.65951382,7.2158836 C3.40359267,7.64470547 4.32140733,7.64470547 5.06548618,7.2158836 L6.34048618,6.48108529 C7.08136548,6.05410736 7.5375,5.26678449 7.5375,4.41494841 L7.5375,2.93505159 C7.5375,2.08321551 7.08136548,1.29589264 6.34048618,0.868914715 L5.06548618,0.134116403 C4.32140733,-0.294705468 3.40359267,-0.294705468 2.65951382,0.134116403 Z M4.46399309,1.16718484 L5.73899309,1.90198315 C6.10943274,2.11547211 6.3375,2.50913355 6.3375,2.93505159 L6.3375,4.41494841 C6.3375,4.84086645 6.10943274,5.23452789 5.73899309,5.44801685 L4.46399309,6.18281516 C4.09195366,6.3972261 3.63304634,6.3972261 3.26100691,6.18281516 L1.98600691,5.44801685 C1.61556726,5.23452789 1.3875,4.84086645 1.3875,4.41494841 L1.3875,2.93505159 C1.3875,2.50913355 1.61556726,2.11547211 1.98600691,1.90198315 L3.26100691,1.16718484 C3.63304634,0.952773904 4.09195366,0.952773904 4.46399309,1.16718484 Z" id="多边形" fill="#141C28" fill-rule="nonzero" transform="translate(3.862500, 3.675000) rotate(-90.000000) translate(-3.862500, -3.675000) "></path>
|
|
13
|
+
<circle id="椭圆形" stroke="#2879FF" stroke-width="1.05" cx="3.8625" cy="3.675" r="1.0875"></circle>
|
|
14
|
+
</g>
|
|
15
|
+
</g>
|
|
16
|
+
</g>
|
|
17
|
+
</svg>
|
|
@@ -140,7 +140,7 @@ function _default(props) {
|
|
|
140
140
|
isPercent: true
|
|
141
141
|
})), isCreate && /*#__PURE__*/_react["default"].createElement("span", {
|
|
142
142
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-title-approvaling"))
|
|
143
|
-
},
|
|
143
|
+
}, (0, _getLocale.getLocale)('Pro_MyS_Establishment'))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
144
144
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-actions"))
|
|
145
145
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
146
146
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-actions-user"))
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.PlaceholderPlugin = exports.PlaceholderController = void 0;
|
|
9
|
+
|
|
10
|
+
var _controller = _interopRequireDefault(require("../../../models/controller"));
|
|
11
|
+
|
|
12
|
+
var _prosemirrorState = require("prosemirror-state");
|
|
13
|
+
|
|
14
|
+
var _prosemirrorView = require("prosemirror-view");
|
|
15
|
+
|
|
16
|
+
var _plugin = _interopRequireDefault(require("../../../models/plugin"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21
|
+
|
|
22
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
23
|
+
|
|
24
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
+
|
|
26
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
+
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
|
|
30
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
+
|
|
32
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
+
|
|
34
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
+
|
|
36
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
+
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
+
|
|
40
|
+
var PLUGIN_NAME = 'placeholder';
|
|
41
|
+
|
|
42
|
+
var createDecoration = function createDecoration(state) {
|
|
43
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '请输入';
|
|
44
|
+
var firstChildType = state.doc.child(0).type;
|
|
45
|
+
|
|
46
|
+
if (state.doc.textContent || firstChildType.name !== 'paragraph' && firstChildType.name !== 'heading' || state.doc.childCount > 1) {
|
|
47
|
+
return _prosemirrorView.DecorationSet.empty;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var placeholderDecoration = document.createElement('span');
|
|
51
|
+
var placeholderText = options;
|
|
52
|
+
placeholderDecoration.className = 'tita-rich-editor-placeholder';
|
|
53
|
+
var placeholderNode = document.createElement('span');
|
|
54
|
+
placeholderNode.textContent = placeholderText;
|
|
55
|
+
placeholderDecoration.appendChild(placeholderNode);
|
|
56
|
+
return _prosemirrorView.DecorationSet.create(state.doc, [_prosemirrorView.Decoration.widget(1, placeholderDecoration, {
|
|
57
|
+
side: 1,
|
|
58
|
+
key: 'placeholder'
|
|
59
|
+
})]);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var placeHolderPlugin = function placeHolderPlugin(dispatch, options) {
|
|
63
|
+
var plugin = new _prosemirrorState.Plugin({
|
|
64
|
+
state: {
|
|
65
|
+
init: function init(conf, state) {
|
|
66
|
+
return createDecoration(state, options);
|
|
67
|
+
},
|
|
68
|
+
apply: function apply(tr, pluginState, oldState, newState) {
|
|
69
|
+
if (!tr.docChanged) return pluginState.map(tr.mapping, tr.doc);
|
|
70
|
+
return createDecoration(newState, options);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
props: {
|
|
74
|
+
decorations: function decorations(state) {
|
|
75
|
+
return plugin.getState(state);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return plugin;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
var PlaceholderController = /*#__PURE__*/function (_BaseController) {
|
|
83
|
+
_inherits(PlaceholderController, _BaseController);
|
|
84
|
+
|
|
85
|
+
var _super = _createSuper(PlaceholderController);
|
|
86
|
+
|
|
87
|
+
function PlaceholderController() {
|
|
88
|
+
var _this;
|
|
89
|
+
|
|
90
|
+
_classCallCheck(this, PlaceholderController);
|
|
91
|
+
|
|
92
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
93
|
+
args[_key] = arguments[_key];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.pmPlugins = [placeHolderPlugin], _assertThisInitialized(_this)));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return _createClass(PlaceholderController);
|
|
100
|
+
}(_controller["default"]);
|
|
101
|
+
|
|
102
|
+
exports.PlaceholderController = PlaceholderController;
|
|
103
|
+
|
|
104
|
+
var PlaceholderPlugin = /*#__PURE__*/function (_BasePlugin) {
|
|
105
|
+
_inherits(PlaceholderPlugin, _BasePlugin);
|
|
106
|
+
|
|
107
|
+
var _super2 = _createSuper(PlaceholderPlugin);
|
|
108
|
+
|
|
109
|
+
function PlaceholderPlugin() {
|
|
110
|
+
var _this2;
|
|
111
|
+
|
|
112
|
+
_classCallCheck(this, PlaceholderPlugin);
|
|
113
|
+
|
|
114
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
115
|
+
args[_key2] = arguments[_key2];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.name = PLUGIN_NAME, _this2.controller = PlaceholderController, _assertThisInitialized(_this2)));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return _createClass(PlaceholderPlugin);
|
|
122
|
+
}(_plugin["default"]);
|
|
123
|
+
|
|
124
|
+
exports.PlaceholderPlugin = PlaceholderPlugin;
|
|
125
|
+
var _default = PlaceholderPlugin;
|
|
126
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.placeholderStyles = exports.placeHolderClassName = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = require("styled-components");
|
|
9
|
+
|
|
10
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
+
|
|
12
|
+
var _templateObject;
|
|
13
|
+
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
|
|
16
|
+
var placeHolderClassName = 'placeholder-decoration';
|
|
17
|
+
exports.placeHolderClassName = placeHolderClassName;
|
|
18
|
+
var placeholderStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror .", " {\n position: relative;\n color: ", ";\n width: 100%;\n\n pointer-events: none;\n display: block;\n user-select: none;\n\n > span {\n position: absolute;\n pointer-events: none;\n }\n\n &.align-end > span {\n right: 0;\n }\n\n &.align-center > span {\n left: 0;\n }\n }\n"])), placeHolderClassName, _colors.N200);
|
|
19
|
+
exports.placeholderStyles = placeholderStyles;
|
|
@@ -8,8 +8,8 @@ var FontColor;
|
|
|
8
8
|
exports.FontColor = FontColor;
|
|
9
9
|
|
|
10
10
|
(function (FontColor) {
|
|
11
|
-
FontColor["default"] = "#
|
|
12
|
-
FontColor["black1"] = "#
|
|
11
|
+
FontColor["default"] = "#141C28";
|
|
12
|
+
FontColor["black1"] = "#3F4755";
|
|
13
13
|
FontColor["black2"] = "#6F7886";
|
|
14
14
|
FontColor["black3"] = "#A4ACB9";
|
|
15
15
|
FontColor["red1"] = "#F02673";
|
|
@@ -220,14 +220,7 @@ function ColorSelectorPop(_ref2) {
|
|
|
220
220
|
(0, _commond.setColor)(editor, editor.state.schema.marks[_index2.BACKGROUND_COLOR_SCHEMA_NAME], activeBackground);
|
|
221
221
|
editor.view.focus();
|
|
222
222
|
}, [activeColor, activeBackground]);
|
|
223
|
-
return /*#__PURE__*/_react["default"].createElement("
|
|
224
|
-
className: preCls + '__icon',
|
|
225
|
-
style: {
|
|
226
|
-
backgroundColor: activeBackground || _consts.BackgroundColor["default"],
|
|
227
|
-
color: activeColor || _consts.FontColor["default"]
|
|
228
|
-
},
|
|
229
|
-
onClick: handleClickMenu
|
|
230
|
-
}, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
223
|
+
return /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
231
224
|
action: ["hover"],
|
|
232
225
|
popupPlacement: "top",
|
|
233
226
|
popup: /*#__PURE__*/_react["default"].createElement(ColorSelector, {
|
|
@@ -237,6 +230,13 @@ function ColorSelectorPop(_ref2) {
|
|
|
237
230
|
background: activeBackground,
|
|
238
231
|
onClickItem: handleClickItem
|
|
239
232
|
})
|
|
233
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
234
|
+
className: preCls + '__icon',
|
|
235
|
+
style: {
|
|
236
|
+
backgroundColor: activeBackground || _consts.BackgroundColor["default"],
|
|
237
|
+
color: activeColor || _consts.FontColor["default"]
|
|
238
|
+
},
|
|
239
|
+
onClick: handleClickMenu
|
|
240
240
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
241
241
|
className: config.icon
|
|
242
242
|
})));
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
justify-content: flex-end;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
.tita-rich-editor-link__input .form-field-input__border {
|
|
30
|
+
padding: 3px 12px;
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
.tita-rich-editor-link__input:first-child {
|
|
30
34
|
margin-bottom: 16px;
|
|
31
35
|
}
|
|
@@ -53,6 +57,7 @@
|
|
|
53
57
|
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
54
58
|
border-radius: 8px;
|
|
55
59
|
border: 1px solid #f0f2f5;
|
|
60
|
+
color: #3f4755;
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
.tita-rich-editor-toolbar__text {
|
|
@@ -36,6 +36,7 @@ function applyPlugins() {
|
|
|
36
36
|
var plugins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
37
37
|
var defaultSchema = arguments.length > 1 ? arguments[1] : undefined;
|
|
38
38
|
var dispatcher = arguments.length > 2 ? arguments[2] : undefined;
|
|
39
|
+
var config = arguments.length > 3 ? arguments[3] : undefined;
|
|
39
40
|
var nodes = defaultSchema.nodes;
|
|
40
41
|
var marks = defaultSchema.marks || {};
|
|
41
42
|
var nativePlugins = [];
|
|
@@ -48,9 +49,9 @@ function applyPlugins() {
|
|
|
48
49
|
}))) : schemas.push(new p.schema());
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
dealPlugin(p, nativePlugins, controllers, dispatcher);
|
|
52
|
+
dealPlugin(p, nativePlugins, controllers, dispatcher, config);
|
|
52
53
|
});
|
|
53
|
-
dealPlugin(new _core.CorePlugin(), nativePlugins, controllers, dispatcher);
|
|
54
|
+
dealPlugin(new _core.CorePlugin(), nativePlugins, controllers, dispatcher, config);
|
|
54
55
|
schemas.sort(function (s1, s2) {
|
|
55
56
|
return s2.priority - s1.priority;
|
|
56
57
|
}).forEach(function (s) {
|
|
@@ -69,13 +70,15 @@ function applyPlugins() {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
function dealPlugin(plugin, nativePlugins, controllers, dispatcher) {
|
|
73
|
+
var config = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
74
|
+
|
|
72
75
|
if (plugin.controller) {
|
|
73
76
|
var pController = new plugin.controller();
|
|
74
77
|
controllers.push(pController);
|
|
75
78
|
|
|
76
79
|
if (pController.pmPlugins) {
|
|
77
80
|
nativePlugins.push.apply(nativePlugins, _toConsumableArray(pController.pmPlugins.map(function (pm) {
|
|
78
|
-
return typeof pm == 'function' ? pm((0, _event.createDispatch)(dispatcher)) : pm;
|
|
81
|
+
return typeof pm == 'function' ? pm((0, _event.createDispatch)(dispatcher), config[plugin.name]) : pm;
|
|
79
82
|
})));
|
|
80
83
|
}
|
|
81
84
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
font-weight: 500;
|
|
20
20
|
color: #141c28;
|
|
21
21
|
line-height: 38px;
|
|
22
|
-
padding:
|
|
22
|
+
padding: 26px 0 10px;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.tita-rich-editor h2 {
|
|
@@ -27,23 +27,31 @@
|
|
|
27
27
|
font-weight: 500;
|
|
28
28
|
color: #141c28;
|
|
29
29
|
line-height: 32px;
|
|
30
|
-
padding:
|
|
30
|
+
padding: 22px 0 8px;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.tita-rich-editor h3 {
|
|
34
34
|
font-size: 20px;
|
|
35
35
|
font-weight: 500;
|
|
36
|
-
color: #
|
|
36
|
+
color: #141c28;
|
|
37
37
|
line-height: 30px;
|
|
38
|
-
padding:
|
|
38
|
+
padding: 20px 0 8px;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.tita-rich-editor p {
|
|
42
42
|
font-size: 16px;
|
|
43
43
|
font-weight: 400;
|
|
44
|
-
color: #
|
|
44
|
+
color: #141c28;
|
|
45
45
|
line-height: 26px;
|
|
46
|
-
padding:
|
|
46
|
+
padding: 3px 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.tita-rich-editor a {
|
|
50
|
+
color: #2879ff;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.tita-rich-editor a:hover {
|
|
54
|
+
color: #5c8eff;
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
.tita-rich-editor ol,
|
|
@@ -128,8 +136,20 @@
|
|
|
128
136
|
|
|
129
137
|
.tita-rich-editor blockquote {
|
|
130
138
|
position: relative;
|
|
139
|
+
margin: 3px 0;
|
|
131
140
|
padding-left: 22px;
|
|
132
|
-
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.tita-rich-editor blockquote p {
|
|
144
|
+
font-size: 16px !important;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.tita-rich-editor blockquote p:first-child {
|
|
148
|
+
padding-top: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.tita-rich-editor blockquote p:last-child {
|
|
152
|
+
padding-bottom: 0;
|
|
133
153
|
}
|
|
134
154
|
|
|
135
155
|
.tita-rich-editor blockquote::before {
|
|
@@ -142,3 +162,17 @@
|
|
|
142
162
|
background-color: #2879ff;
|
|
143
163
|
border-radius: 2px;
|
|
144
164
|
}
|
|
165
|
+
|
|
166
|
+
.tita-rich-editor-placeholder {
|
|
167
|
+
color: #bfc7d5;
|
|
168
|
+
position: relative;
|
|
169
|
+
width: 100%;
|
|
170
|
+
pointer-events: none;
|
|
171
|
+
display: block;
|
|
172
|
+
user-select: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.tita-rich-editor-placeholder > span {
|
|
176
|
+
position: absolute;
|
|
177
|
+
pointer-events: none;
|
|
178
|
+
}
|
|
@@ -31,6 +31,8 @@ require("./index.css");
|
|
|
31
31
|
|
|
32
32
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
33
33
|
|
|
34
|
+
var _placeholder = _interopRequireDefault(require("../../plugins/extension/placeholder"));
|
|
35
|
+
|
|
34
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
37
|
|
|
36
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -40,7 +42,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
40
42
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
43
|
|
|
42
44
|
var preCls = 'tita-rich-editor';
|
|
43
|
-
var defaultPlugins = [new _plugins.HeadingPlugin(), new _plugins.StrongPlugin(), new _plugins.ColorPlugin(), new _plugins.UnderLinePlugin(), new _plugins.DeleteLinePlugin(), new _plugins.ListPlugin(), new _plugins.AlignmentPlugin(), new _plugins.BlockquotePlugin(), new _plugins.LinkPlugin()];
|
|
45
|
+
var defaultPlugins = [new _plugins.HeadingPlugin(), new _plugins.StrongPlugin(), new _plugins.ColorPlugin(), new _plugins.UnderLinePlugin(), new _plugins.DeleteLinePlugin(), new _plugins.ListPlugin(), new _plugins.AlignmentPlugin(), new _plugins.BlockquotePlugin(), new _plugins.LinkPlugin(), new _placeholder["default"]()];
|
|
44
46
|
|
|
45
47
|
function RichEditor(_ref, ref) {
|
|
46
48
|
var _ref$plugins = _ref.plugins,
|
|
@@ -49,14 +51,17 @@ function RichEditor(_ref, ref) {
|
|
|
49
51
|
_ref$editable = _ref.editable,
|
|
50
52
|
_editable = _ref$editable === void 0 ? true : _ref$editable,
|
|
51
53
|
defaultState = _ref.defaultState,
|
|
52
|
-
onChange = _ref.onChange
|
|
54
|
+
onChange = _ref.onChange,
|
|
55
|
+
placeholder = _ref.placeholder;
|
|
53
56
|
|
|
54
57
|
var container = (0, _react.useRef)();
|
|
55
58
|
var dataRef = (0, _react.useRef)({});
|
|
56
59
|
(0, _react.useEffect)(function () {
|
|
57
60
|
var dispatcher = new _event.EventDispatcher();
|
|
58
61
|
|
|
59
|
-
var _applyPlugins = (0, _util.applyPlugins)(plugins, _schema["default"], dispatcher
|
|
62
|
+
var _applyPlugins = (0, _util.applyPlugins)(plugins, _schema["default"], dispatcher, {
|
|
63
|
+
placeholder: placeholder
|
|
64
|
+
}),
|
|
60
65
|
nativePlugins = _applyPlugins.nativePlugins,
|
|
61
66
|
nodes = _applyPlugins.nodes,
|
|
62
67
|
marks = _applyPlugins.marks,
|
|
@@ -139,7 +144,7 @@ function RichEditor(_ref, ref) {
|
|
|
139
144
|
backgroundColor: "#FFF"
|
|
140
145
|
},
|
|
141
146
|
spellCheck: false,
|
|
142
|
-
|
|
147
|
+
onMouseUp: handleClick
|
|
143
148
|
});
|
|
144
149
|
}
|
|
145
150
|
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.bracketTyped = bracketTyped;
|
|
6
7
|
exports.findFarthestParentNode = void 0;
|
|
7
8
|
exports.getNodesCount = getNodesCount;
|
|
8
9
|
exports.getStepRange = void 0;
|
|
10
|
+
exports.hasDocAsParent = hasDocAsParent;
|
|
9
11
|
exports.hasVisibleContent = hasVisibleContent;
|
|
10
12
|
exports.isEmptyDocument = isEmptyDocument;
|
|
11
13
|
exports.isEmptyParagraph = isEmptyParagraph;
|
|
14
|
+
exports.isInEmptyLine = isInEmptyLine;
|
|
12
15
|
exports.isNodeEmpty = isNodeEmpty;
|
|
13
16
|
exports.isSelectionEndOfParagraph = void 0;
|
|
14
17
|
exports.nodesBetweenChanged = nodesBetweenChanged;
|
|
@@ -157,4 +160,52 @@ function getNodesCount(node) {
|
|
|
157
160
|
count[node.type.name] = (count[node.type.name] || 0) + 1;
|
|
158
161
|
});
|
|
159
162
|
return count;
|
|
163
|
+
} // Checks to see if the parent node is the document, ie not contained within another entity
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
function hasDocAsParent($anchor) {
|
|
167
|
+
return $anchor.depth === 1;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function isInEmptyLine(state) {
|
|
171
|
+
var selection = state.selection;
|
|
172
|
+
var _ref = selection,
|
|
173
|
+
$cursor = _ref.$cursor,
|
|
174
|
+
$anchor = _ref.$anchor;
|
|
175
|
+
|
|
176
|
+
if (!$cursor) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
var node = $cursor.node();
|
|
181
|
+
|
|
182
|
+
if (!node) {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return isEmptyParagraph(node) && hasDocAsParent($anchor);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function bracketTyped(state) {
|
|
190
|
+
var selection = state.selection;
|
|
191
|
+
var _ref2 = selection,
|
|
192
|
+
$cursor = _ref2.$cursor,
|
|
193
|
+
$anchor = _ref2.$anchor;
|
|
194
|
+
|
|
195
|
+
if (!$cursor) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
var node = $cursor.nodeBefore;
|
|
200
|
+
|
|
201
|
+
if (!node) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (node.type.name === 'text' && node.text === '{') {
|
|
206
|
+
var paragraphNode = $anchor.node();
|
|
207
|
+
return paragraphNode.marks.length === 0 && hasDocAsParent($anchor);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return false;
|
|
160
211
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>切片</title>
|
|
4
|
+
<g id="整体框架" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g id="二级菜单-交互说明" transform="translate(-1895.000000, -977.000000)" fill="#141C28">
|
|
6
|
+
<g id="弹层1" transform="translate(1881.000000, 467.000000)">
|
|
7
|
+
<g id="canceled" transform="translate(14.000000, 510.000000)">
|
|
8
|
+
<path d="M18.5178716,4.33431458 C18.8693434,3.98284271 19.4391919,3.98284271 19.7906638,4.33431458 C20.1421356,4.68578644 20.1421356,5.25563492 19.7906638,5.60710678 L19.7906638,5.60710678 L13.2847107,12.1117107 L19.7906638,18.6178716 C20.1421356,18.9693434 20.1421356,19.5391919 19.7906638,19.8906638 C19.4391919,20.2421356 18.8693434,20.2421356 18.5178716,19.8906638 L12.0117107,13.3847107 L5.50710678,19.8906638 C5.18492424,20.2128463 4.67924468,20.2396948 4.3264793,19.9712094 L4.23431458,19.8906638 C3.88284271,19.5391919 3.88284271,18.9693434 4.23431458,18.6178716 L4.23431458,18.6178716 L10.7397107,12.1117107 L4.23431458,5.60710678 C3.88284271,5.25563492 3.88284271,4.68578644 4.23431458,4.33431458 C4.58578644,3.98284271 5.15563492,3.98284271 5.50710678,4.33431458 L12.0117107,10.8397107 Z" id="形状结合"></path>
|
|
9
|
+
</g>
|
|
10
|
+
</g>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
Binary file
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
width: 42px;
|
|
30
30
|
height: 42px;
|
|
31
31
|
background: url("./img/kefu.svg") no-repeat;
|
|
32
|
+
background-color: #fff;
|
|
32
33
|
background-size: 42px;
|
|
33
34
|
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
34
35
|
cursor: pointer;
|
|
@@ -84,6 +85,50 @@
|
|
|
84
85
|
animation: contentOpacity 0.7s 1 forwards;
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
.titaui-aha-2021__hidden {
|
|
89
|
+
background-image: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.titaui-aha-2021__cancel {
|
|
93
|
+
height: 100%;
|
|
94
|
+
background: url("./img/canceled.svg") 50% 50% no-repeat;
|
|
95
|
+
animation-duration: 0.3s;
|
|
96
|
+
animation-name: kefuActive;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.titaui-aha-2021__popup {
|
|
100
|
+
width: 332px;
|
|
101
|
+
height: 376px;
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
align-items: center;
|
|
106
|
+
background: #ffffff;
|
|
107
|
+
box-shadow: 0px 0px 16px 0px rgba(127, 145, 180, 0.1);
|
|
108
|
+
border-radius: 24px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.titaui-aha-2021__popup-title {
|
|
112
|
+
font-size: 20px;
|
|
113
|
+
font-weight: 600;
|
|
114
|
+
color: #141c28;
|
|
115
|
+
line-height: 30px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.titaui-aha-2021__popup-content {
|
|
119
|
+
margin-top: 4px;
|
|
120
|
+
font-size: 14px;
|
|
121
|
+
font-weight: normal;
|
|
122
|
+
color: #6f7886;
|
|
123
|
+
line-height: 22px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.titaui-aha-2021__popup-img {
|
|
127
|
+
width: 200px;
|
|
128
|
+
height: 200px;
|
|
129
|
+
margin-top: 24px;
|
|
130
|
+
}
|
|
131
|
+
|
|
87
132
|
@keyframes contentOpacity {
|
|
88
133
|
from {
|
|
89
134
|
opacity: 0;
|
|
@@ -13,6 +13,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
|
|
14
14
|
var _tooltip = _interopRequireDefault(require("../../components/tooltip"));
|
|
15
15
|
|
|
16
|
+
var _popup = _interopRequireDefault(require("../../components/popup"));
|
|
17
|
+
|
|
16
18
|
var _navTop = _interopRequireDefault(require("../../components/nav-top"));
|
|
17
19
|
|
|
18
20
|
var _followerVisitor = _interopRequireDefault(require("../../components/follower-visitor"));
|
|
@@ -25,8 +27,6 @@ var _bookDemo = _interopRequireDefault(require("../../components/book-demo"));
|
|
|
25
27
|
|
|
26
28
|
var _platform = require("../../utils/platform");
|
|
27
29
|
|
|
28
|
-
require("./index.css");
|
|
29
|
-
|
|
30
30
|
var _helpers = require("../../utils/helpers");
|
|
31
31
|
|
|
32
32
|
var _hrHeader = _interopRequireDefault(require("../../components/hr-header"));
|
|
@@ -39,12 +39,30 @@ var _errorBoundary = _interopRequireDefault(require("../../components/error-boun
|
|
|
39
39
|
|
|
40
40
|
var _errorLevel = _interopRequireDefault(require("../../utils/error-level"));
|
|
41
41
|
|
|
42
|
+
var _notTry = _interopRequireDefault(require("./img/not-try.png"));
|
|
43
|
+
|
|
44
|
+
require("./index.css");
|
|
45
|
+
|
|
42
46
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
43
47
|
|
|
44
48
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
45
49
|
|
|
46
50
|
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; }
|
|
47
51
|
|
|
52
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
53
|
+
|
|
54
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
55
|
+
|
|
56
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
57
|
+
|
|
58
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
59
|
+
|
|
60
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
61
|
+
|
|
62
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
63
|
+
|
|
64
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
65
|
+
|
|
48
66
|
var preCls = "titaui-aha-2021";
|
|
49
67
|
|
|
50
68
|
function ContentTemplate(props) {
|
|
@@ -70,19 +88,29 @@ function ContentTemplate(props) {
|
|
|
70
88
|
|
|
71
89
|
function PageLayout(props) {
|
|
72
90
|
var children = props.children;
|
|
73
|
-
var isTrial = window.BSGlobal.tenantAuthentication.Version === 1 && (0, _platform.isOfficialSite)();
|
|
74
|
-
var isTencentHr = window.BSGlobal.tenantInfo.Source === 964;
|
|
75
91
|
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
92
|
+
var _useState = (0, _react.useState)(false),
|
|
93
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
94
|
+
visible = _useState2[0],
|
|
95
|
+
setVisible = _useState2[1];
|
|
96
|
+
|
|
97
|
+
var handleShowCode = function handleShowCode() {
|
|
98
|
+
setVisible(true);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
var isTrial = window.BSGlobal.tenantAuthentication.Version === 1 && (0, _platform.isOfficialSite)();
|
|
102
|
+
var isTencentHr = window.BSGlobal.tenantInfo.Source === 964; // const onClickKefu = () => {
|
|
103
|
+
// const kefuUrl = isTrial
|
|
104
|
+
// ? 'https://wpa1.qq.com/vZYKN3kT?_type=wpa&qidian=true'
|
|
105
|
+
// : 'https://wpa1.qq.com/o6X4XD1n?_type=wpa&qidian=true'
|
|
106
|
+
// window.open(kefuUrl)
|
|
107
|
+
// }
|
|
108
|
+
// const onClickNotice = () => {
|
|
80
109
|
// let domain = `//${location.host}/u/${window.BSGlobal.loginUserInfo.Id}/Home`;
|
|
81
110
|
// let hash = `#more/messages?messageType=1&isRead=2&messageSubNav=1`
|
|
82
111
|
// window.open(domain + hash);
|
|
83
112
|
// };
|
|
84
113
|
|
|
85
|
-
|
|
86
114
|
var getBookDemoVersion = function getBookDemoVersion() {
|
|
87
115
|
var menuVersion = window.BSGlobal.tenantAuthentication.MenuVersion;
|
|
88
116
|
|
|
@@ -97,6 +125,18 @@ function PageLayout(props) {
|
|
|
97
125
|
return _bookDemo["default"].DemoType.UniversalBookDemo;
|
|
98
126
|
};
|
|
99
127
|
|
|
128
|
+
var popup = /*#__PURE__*/_react["default"].createElement("div", {
|
|
129
|
+
className: "".concat(preCls, "__popup")
|
|
130
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
131
|
+
className: "".concat(preCls, "__popup-title")
|
|
132
|
+
}, "\u5FAE\u4FE1/\u4F01\u4E1A\u5FAE\u4FE1\u626B\u4E00\u626B"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
133
|
+
className: "".concat(preCls, "__popup-content")
|
|
134
|
+
}, "\u4E13\u5C5E\u5BA2\u670D\u4E3A\u4F60\u63D0\u4F9B\u54A8\u8BE2\u670D\u52A1"), /*#__PURE__*/_react["default"].createElement("img", {
|
|
135
|
+
src: _notTry["default"],
|
|
136
|
+
className: "".concat(preCls, "__popup-img"),
|
|
137
|
+
alt: "\u5FAE\u4FE1\u626B\u7801"
|
|
138
|
+
}));
|
|
139
|
+
|
|
100
140
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
101
141
|
className: (0, _classnames["default"])(preCls)
|
|
102
142
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -110,16 +150,33 @@ function PageLayout(props) {
|
|
|
110
150
|
}
|
|
111
151
|
}, children), !isTencentHr && /*#__PURE__*/_react["default"].createElement("div", {
|
|
112
152
|
className: (0, _classnames["default"])("".concat(preCls, "__help"))
|
|
113
|
-
}, /*#__PURE__*/_react["default"].createElement(_helpCard["default"], null)), !isTrial && !isTencentHr && !(0, _helpers.isDingDing)() && /*#__PURE__*/_react["default"].createElement(
|
|
153
|
+
}, /*#__PURE__*/_react["default"].createElement(_helpCard["default"], null)), !isTrial && !isTencentHr && !(0, _helpers.isDingDing)() && /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
154
|
+
popup: popup,
|
|
155
|
+
popupTransitionName: "tita-popup-zoom-left-bottom",
|
|
156
|
+
placement: "topLeft",
|
|
157
|
+
popupAlign: {
|
|
158
|
+
offset: [-32, -10],
|
|
159
|
+
overflow: {
|
|
160
|
+
adjustX: 1,
|
|
161
|
+
adjustY: 1
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
popupVisible: visible,
|
|
165
|
+
onPopupVisibleChange: function onPopupVisibleChange(bol) {
|
|
166
|
+
return setVisible(bol);
|
|
167
|
+
}
|
|
168
|
+
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
114
169
|
overlay: "\u8054\u7CFB\u5BA2\u670D",
|
|
115
|
-
placement: "
|
|
170
|
+
placement: "right",
|
|
116
171
|
align: {
|
|
117
172
|
offset: [0, 0]
|
|
118
173
|
}
|
|
119
174
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
120
|
-
className: "".concat(preCls, "__kefu"),
|
|
121
|
-
onClick:
|
|
122
|
-
}
|
|
175
|
+
className: (0, _classnames["default"])("".concat(preCls, "__kefu"), _defineProperty({}, "".concat(preCls, "__hidden"), visible)),
|
|
176
|
+
onClick: handleShowCode
|
|
177
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
178
|
+
className: (0, _classnames["default"])(_defineProperty({}, "".concat(preCls, "__cancel"), visible))
|
|
179
|
+
})))), isTrial && !isTencentHr && /*#__PURE__*/_react["default"].createElement("div", {
|
|
123
180
|
className: "".concat(preCls, "__invite")
|
|
124
181
|
}, /*#__PURE__*/_react["default"].createElement(_invitePeople["default"], null)), isTencentHr && /*#__PURE__*/_react["default"].createElement(_hrMessage["default"], null), /*#__PURE__*/_react["default"].createElement(_errorBoundary["default"], {
|
|
125
182
|
errorLevel: _errorLevel["default"].P0,
|