@fonixtree/magic-design 2.0.13 → 2.0.15
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/es/assets/fonts/.DS_Store +0 -0
- package/es/assets/fonts/magic-box-iconfont.css +23 -3
- package/es/assets/fonts/magic-box-iconfont.css.bak +23 -3
- package/es/assets/fonts/magic-box-iconfont.js +1 -1
- package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/es/assets/images/layout-icon/locationLayout.png +0 -0
- package/es/common/ColorPicker/index.js +4 -1
- package/es/common/ImagePicker/index.js +3 -1
- package/es/composite-comp/bol/components/Location/defaultJSON.js +54 -0
- package/es/composite-comp/bol/components/Location/index.js +138 -0
- package/es/composite-comp/bol/config-panels/LocationConfig/MyEditor/index.js +42 -0
- package/es/composite-comp/bol/config-panels/LocationConfig/index.js +122 -0
- package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +8 -0
- package/es/composite-comp/dito/components/SearchBar/mobile/index.js +66 -7
- package/es/composite-comp/dito/components/SearchBar/pc/index.js +2 -2
- package/es/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +39 -9
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.js +99 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.less +54 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignCenterSVG.js +27 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignLeftSVG.js +27 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignRightSVG.js +27 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.js +96 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.less +26 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.js +95 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.less +26 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +99 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.less +39 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.js +93 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.less +26 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/BoldSVG.js +29 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/FontColorSVG.js +49 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/ItalicSVG.js +29 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/LinkSVG.js +26 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/OrderSVG.js +27 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/StrikeSVG.js +31 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnderlineSVG.js +34 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnorderSVG.js +41 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/index.js +129 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/index.less +25 -0
- package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/type.js +1 -0
- package/es/core/Designer/TextEditModal/ToolBar/index.js +209 -0
- package/es/core/Designer/TextEditModal/ToolBar/index.less +19 -0
- package/es/core/Designer/TextEditModal/index.js +100 -0
- package/es/core/Designer/TextEditModal/index.less +4 -0
- package/es/core/Designer/TextEditModal_old/index.js +142 -0
- package/es/core/Designer/TextEditModal_old/index.less +25 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/AlignSelectPicker/index.js +99 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/AlignSelectPicker/index.less +54 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/images/AlignCenterSVG.js +27 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/images/AlignLeftSVG.js +27 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/images/AlignRightSVG.js +27 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/index.js +96 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/index.less +26 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/ColorPickerBtn/index.js +95 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/ColorPickerBtn/index.less +26 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +99 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/LinkBtn/LinkInputPicker/index.less +39 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/LinkBtn/index.js +93 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/components/LinkBtn/index.less +26 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/images/BoldSVG.js +29 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/images/FontColorSVG.js +49 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/images/ItalicSVG.js +29 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/images/LinkSVG.js +26 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/images/OrderSVG.js +27 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/images/StrikeSVG.js +31 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/images/UnderlineSVG.js +34 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/images/UnorderSVG.js +41 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/index.js +129 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/index.less +25 -0
- package/es/core/Designer/ToolBarModal/ToolBtn/type.js +1 -0
- package/es/core/Designer/ToolBarModal/index.js +281 -0
- package/es/core/Designer/ToolBarModal/index.less +32 -0
- package/es/core/Designer/index.js +28 -6
- package/es/locale/en/en.json +2 -0
- package/es/locale/es/es.json +2 -0
- package/es/locale/id/id.json +2 -0
- package/es/meta-comp/components/Text/index.js +101 -386
- package/es/meta-comp/components/Text/index.less +57 -0
- package/es/meta-comp/config-panels/TextConfig/TextEditModal/index.js +100 -0
- package/es/meta-comp/config-panels/TextConfig/TextEditModal/index.less +25 -0
- package/es/meta-comp/config-panels/TextConfig/index.less +19 -0
- package/es/mobx/Frame.js +7 -1
- package/es/utils/commonUtil.js +18 -4
- package/lib/assets/fonts/.DS_Store +0 -0
- package/lib/assets/fonts/magic-box-iconfont.css +23 -3
- package/lib/assets/fonts/magic-box-iconfont.css.bak +23 -3
- package/lib/assets/fonts/magic-box-iconfont.js +1 -1
- package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/lib/assets/images/layout-icon/locationLayout.png +0 -0
- package/lib/common/ColorPicker/index.js +4 -1
- package/lib/common/ImagePicker/index.js +3 -1
- package/lib/composite-comp/bol/components/Location/defaultJSON.js +54 -0
- package/lib/composite-comp/bol/components/Location/index.js +138 -0
- package/lib/composite-comp/bol/config-panels/LocationConfig/MyEditor/index.js +42 -0
- package/lib/composite-comp/bol/config-panels/LocationConfig/index.js +122 -0
- package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +8 -0
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +66 -7
- package/lib/composite-comp/dito/components/SearchBar/pc/index.js +2 -2
- package/lib/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +39 -9
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.js +99 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.less +54 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignCenterSVG.js +27 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignLeftSVG.js +27 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignRightSVG.js +27 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.js +96 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.less +26 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.js +95 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.less +26 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +99 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.less +39 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.js +93 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.less +26 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/BoldSVG.js +29 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/FontColorSVG.js +49 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/ItalicSVG.js +29 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/LinkSVG.js +26 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/OrderSVG.js +27 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/StrikeSVG.js +31 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnderlineSVG.js +34 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnorderSVG.js +41 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/index.js +129 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/index.less +25 -0
- package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/type.js +1 -0
- package/lib/core/Designer/TextEditModal/ToolBar/index.js +209 -0
- package/lib/core/Designer/TextEditModal/ToolBar/index.less +19 -0
- package/lib/core/Designer/TextEditModal/index.js +100 -0
- package/lib/core/Designer/TextEditModal/index.less +4 -0
- package/lib/core/Designer/TextEditModal_old/index.js +142 -0
- package/lib/core/Designer/TextEditModal_old/index.less +25 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/AlignSelectPicker/index.js +99 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/AlignSelectPicker/index.less +54 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/images/AlignCenterSVG.js +27 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/images/AlignLeftSVG.js +27 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/images/AlignRightSVG.js +27 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/index.js +96 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/AlignPicker/index.less +26 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/ColorPickerBtn/index.js +95 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/ColorPickerBtn/index.less +26 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +99 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/LinkBtn/LinkInputPicker/index.less +39 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/LinkBtn/index.js +93 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/components/LinkBtn/index.less +26 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/images/BoldSVG.js +29 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/images/FontColorSVG.js +49 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/images/ItalicSVG.js +29 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/images/LinkSVG.js +26 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/images/OrderSVG.js +27 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/images/StrikeSVG.js +31 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/images/UnderlineSVG.js +34 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/images/UnorderSVG.js +41 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/index.js +129 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/index.less +25 -0
- package/lib/core/Designer/ToolBarModal/ToolBtn/type.js +1 -0
- package/lib/core/Designer/ToolBarModal/index.js +281 -0
- package/lib/core/Designer/ToolBarModal/index.less +32 -0
- package/lib/core/Designer/index.js +28 -6
- package/lib/locale/en/en.json +2 -0
- package/lib/locale/es/es.json +2 -0
- package/lib/locale/id/id.json +2 -0
- package/lib/meta-comp/components/Text/index.js +101 -386
- package/lib/meta-comp/components/Text/index.less +57 -0
- package/lib/meta-comp/config-panels/TextConfig/TextEditModal/index.js +100 -0
- package/lib/meta-comp/config-panels/TextConfig/TextEditModal/index.less +25 -0
- package/lib/meta-comp/config-panels/TextConfig/index.less +19 -0
- package/lib/mobx/Frame.js +7 -1
- package/lib/utils/commonUtil.js +18 -4
- package/package.json +3 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _BoldSVG = _interopRequireDefault(require("./images/BoldSVG"));
|
|
13
|
+
|
|
14
|
+
var _ItalicSVG = _interopRequireDefault(require("./images/ItalicSVG"));
|
|
15
|
+
|
|
16
|
+
var _StrikeSVG = _interopRequireDefault(require("./images/StrikeSVG"));
|
|
17
|
+
|
|
18
|
+
var _UnderlineSVG = _interopRequireDefault(require("./images/UnderlineSVG"));
|
|
19
|
+
|
|
20
|
+
var _ColorPickerBtn = _interopRequireDefault(require("./components/ColorPickerBtn"));
|
|
21
|
+
|
|
22
|
+
var _LinkBtn = _interopRequireDefault(require("./components/LinkBtn"));
|
|
23
|
+
|
|
24
|
+
var _AlignPicker = _interopRequireDefault(require("./components/AlignPicker"));
|
|
25
|
+
|
|
26
|
+
var _OrderSVG = _interopRequireDefault(require("./images/OrderSVG"));
|
|
27
|
+
|
|
28
|
+
var _UnorderSVG = _interopRequireDefault(require("./images/UnorderSVG"));
|
|
29
|
+
|
|
30
|
+
require("./index.less");
|
|
31
|
+
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
|
+
|
|
34
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
35
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
36
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
37
|
+
__proto__: []
|
|
38
|
+
} instanceof Array && function (d, b) {
|
|
39
|
+
d.__proto__ = b;
|
|
40
|
+
} || function (d, b) {
|
|
41
|
+
for (var p in b) {
|
|
42
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return _extendStatics(d, b);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return function (d, b) {
|
|
50
|
+
_extendStatics(d, b);
|
|
51
|
+
|
|
52
|
+
function __() {
|
|
53
|
+
this.constructor = d;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
57
|
+
};
|
|
58
|
+
}();
|
|
59
|
+
|
|
60
|
+
var iconTypeMap = {
|
|
61
|
+
bold: _BoldSVG["default"],
|
|
62
|
+
italic: _ItalicSVG["default"],
|
|
63
|
+
strike: _StrikeSVG["default"],
|
|
64
|
+
underline: _UnderlineSVG["default"],
|
|
65
|
+
listOrder: _OrderSVG["default"],
|
|
66
|
+
listUnOrder: _UnorderSVG["default"],
|
|
67
|
+
link: function link(props) {
|
|
68
|
+
return /*#__PURE__*/_react["default"].createElement(_LinkBtn["default"], props);
|
|
69
|
+
},
|
|
70
|
+
color: function color(props) {
|
|
71
|
+
return /*#__PURE__*/_react["default"].createElement(_ColorPickerBtn["default"], props);
|
|
72
|
+
},
|
|
73
|
+
align: function align(props) {
|
|
74
|
+
return /*#__PURE__*/_react["default"].createElement(_AlignPicker["default"], props);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var ToolBtn =
|
|
79
|
+
/** @class */
|
|
80
|
+
function (_super) {
|
|
81
|
+
__extends(ToolBtn, _super);
|
|
82
|
+
|
|
83
|
+
function ToolBtn() {
|
|
84
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
85
|
+
|
|
86
|
+
_this.state = {};
|
|
87
|
+
_this.compareData = null;
|
|
88
|
+
return _this;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
ToolBtn.prototype.shouldComponentUpdate = function (nextProps) {
|
|
92
|
+
var active = nextProps.active,
|
|
93
|
+
value = nextProps.value;
|
|
94
|
+
var compareTarget = JSON.stringify({
|
|
95
|
+
active: active,
|
|
96
|
+
value: value
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
if (this.compareData != compareTarget) {
|
|
100
|
+
this.compareData = compareTarget;
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return false;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
ToolBtn.prototype.render = function () {
|
|
108
|
+
var _a = this.props,
|
|
109
|
+
active = _a.active,
|
|
110
|
+
_b = _a.type,
|
|
111
|
+
type = _b === void 0 ? 'bold' : _b,
|
|
112
|
+
onChange = _a.onChange,
|
|
113
|
+
value = _a.value;
|
|
114
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
115
|
+
className: (0, _classnames["default"])('tool-btn-wrap', {
|
|
116
|
+
active: active
|
|
117
|
+
})
|
|
118
|
+
}, iconTypeMap[type]({
|
|
119
|
+
value: value,
|
|
120
|
+
onChange: onChange
|
|
121
|
+
}));
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
ToolBtn.defaultProps = {};
|
|
125
|
+
return ToolBtn;
|
|
126
|
+
}(_react["default"].Component);
|
|
127
|
+
|
|
128
|
+
var _default = ToolBtn;
|
|
129
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.tool-btn-wrap {
|
|
2
|
+
width: 26px;
|
|
3
|
+
height: 26px;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
border-radius: 6px;
|
|
9
|
+
padding: 0;
|
|
10
|
+
border: none;
|
|
11
|
+
transition: .2s all linear;
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
background: #f8f8f8;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&.active {
|
|
18
|
+
background: #E7E9E8;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
svg {
|
|
22
|
+
height: 18px;
|
|
23
|
+
height: 18px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.fontSizeList = exports.fontFamilyList = exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
|
|
12
|
+
var _ToolBtn = _interopRequireDefault(require("./ToolBtn"));
|
|
13
|
+
|
|
14
|
+
var _coreUtil = require("../../../utils/coreUtil");
|
|
15
|
+
|
|
16
|
+
require("./index.less");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
21
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
22
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
23
|
+
__proto__: []
|
|
24
|
+
} instanceof Array && function (d, b) {
|
|
25
|
+
d.__proto__ = b;
|
|
26
|
+
} || function (d, b) {
|
|
27
|
+
for (var p in b) {
|
|
28
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return _extendStatics(d, b);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return function (d, b) {
|
|
36
|
+
_extendStatics(d, b);
|
|
37
|
+
|
|
38
|
+
function __() {
|
|
39
|
+
this.constructor = d;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
43
|
+
};
|
|
44
|
+
}();
|
|
45
|
+
|
|
46
|
+
var fontSizeList = [12, 13, 14, 15, 16, 19, 22, 24, 29, 32, 40, 48];
|
|
47
|
+
exports.fontSizeList = fontSizeList;
|
|
48
|
+
var fontFamilyList = [{
|
|
49
|
+
name: 'Montserrat',
|
|
50
|
+
value: 'Montserrat'
|
|
51
|
+
}, {
|
|
52
|
+
name: 'Montserrat Bold',
|
|
53
|
+
value: 'MontserratBold'
|
|
54
|
+
}, {
|
|
55
|
+
name: 'Open Sans',
|
|
56
|
+
value: 'OpenSans'
|
|
57
|
+
}, {
|
|
58
|
+
name: 'Open Sans Bold',
|
|
59
|
+
value: 'OpenSansBold'
|
|
60
|
+
}];
|
|
61
|
+
exports.fontFamilyList = fontFamilyList;
|
|
62
|
+
|
|
63
|
+
var ToolBarModal =
|
|
64
|
+
/** @class */
|
|
65
|
+
function (_super) {
|
|
66
|
+
__extends(ToolBarModal, _super);
|
|
67
|
+
|
|
68
|
+
function ToolBarModal() {
|
|
69
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
70
|
+
|
|
71
|
+
_this.state = {
|
|
72
|
+
quillFormat: {}
|
|
73
|
+
};
|
|
74
|
+
_this.toolBarRef = /*#__PURE__*/_react["default"].createRef();
|
|
75
|
+
|
|
76
|
+
_this.setToolBarPosition = function () {
|
|
77
|
+
var _a = _this.props.quillRef.container.getBoundingClientRect(),
|
|
78
|
+
top = _a.top,
|
|
79
|
+
left = _a.left;
|
|
80
|
+
|
|
81
|
+
var minTop = document.querySelector('.device_border').getBoundingClientRect().top;
|
|
82
|
+
_this.toolBarRef.current.style.top = (top > minTop ? top : minTop) + window.scrollY + 'px';
|
|
83
|
+
_this.toolBarRef.current.style.left = left + window.scrollX + 'px';
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
_this.onContainerScroll = function () {
|
|
87
|
+
_this.setToolBarPosition();
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
_this.onSelectionChange = function () {
|
|
91
|
+
var range = _this.props.quillRef.getSelection();
|
|
92
|
+
|
|
93
|
+
if (range) {
|
|
94
|
+
var quillFormat = _this.props.quillRef.getFormat();
|
|
95
|
+
|
|
96
|
+
console.log('quillFormat: ', quillFormat);
|
|
97
|
+
|
|
98
|
+
_this.setState({
|
|
99
|
+
quillFormat: quillFormat
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
_this.onToolBtnClick = function (type, value) {
|
|
105
|
+
window._maginc_clickUrl = _coreUtil.clickUrl;
|
|
106
|
+
var quillFormat = _this.state.quillFormat;
|
|
107
|
+
|
|
108
|
+
if (type == 'bold') {
|
|
109
|
+
_this.props.quillRef.format('bold', !quillFormat['bold']);
|
|
110
|
+
} else if (type == 'italic') {
|
|
111
|
+
_this.props.quillRef.format('italic', !quillFormat['italic']);
|
|
112
|
+
} else if (type == 'strike') {
|
|
113
|
+
_this.props.quillRef.format('strike', !quillFormat['strike']);
|
|
114
|
+
} else if (type == 'underline') {
|
|
115
|
+
_this.props.quillRef.format('underline', !quillFormat['underline']);
|
|
116
|
+
} else if (type == 'color') {
|
|
117
|
+
_this.props.quillRef.format('color', value);
|
|
118
|
+
} else if (type == 'align') {
|
|
119
|
+
_this.props.quillRef.format('align', value);
|
|
120
|
+
} else if (type == 'listOrder') {
|
|
121
|
+
var currentListType = quillFormat['list'];
|
|
122
|
+
|
|
123
|
+
_this.props.quillRef.format('list', currentListType == 'ordered' ? '' : 'ordered');
|
|
124
|
+
} else if (type == 'listUnOrder') {
|
|
125
|
+
var currentListType = quillFormat['list'];
|
|
126
|
+
|
|
127
|
+
_this.props.quillRef.format('list', currentListType == 'bullet' ? '' : 'bullet');
|
|
128
|
+
} else if (type == 'link') {
|
|
129
|
+
console.log('link value: ', value);
|
|
130
|
+
|
|
131
|
+
_this.props.quillRef.format('link', JSON.stringify(value));
|
|
132
|
+
} else if (type == 'size') {
|
|
133
|
+
_this.props.quillRef.format('size', value + 'px');
|
|
134
|
+
} else if (type == 'font') {
|
|
135
|
+
_this.props.quillRef.format('font', value);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
_this.onSelectionChange();
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
return _this;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
ToolBarModal.prototype.componentDidMount = function () {
|
|
145
|
+
var _a;
|
|
146
|
+
|
|
147
|
+
this.props.quillRef.on('selection-change', this.onSelectionChange);
|
|
148
|
+
(_a = document.querySelector('.device_border')) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', this.onContainerScroll);
|
|
149
|
+
this.setToolBarPosition();
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
ToolBarModal.prototype.componentWillUnmount = function () {
|
|
153
|
+
var _a;
|
|
154
|
+
|
|
155
|
+
this.props.quillRef.off('selection-change', this.onSelectionChange);
|
|
156
|
+
(_a = document.querySelector('.device_border')) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', this.onContainerScroll);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
ToolBarModal.prototype.render = function () {
|
|
160
|
+
var _this = this;
|
|
161
|
+
|
|
162
|
+
var quillFormat = this.state.quillFormat;
|
|
163
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
164
|
+
ref: this.toolBarRef,
|
|
165
|
+
className: "toolbar-wrap"
|
|
166
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
167
|
+
className: "toolbar-row"
|
|
168
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
169
|
+
className: "tool-item"
|
|
170
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
|
|
171
|
+
onChange: function onChange(v) {
|
|
172
|
+
_this.onToolBtnClick('font', v);
|
|
173
|
+
},
|
|
174
|
+
placeholder: "Font Family",
|
|
175
|
+
size: "small",
|
|
176
|
+
style: {
|
|
177
|
+
width: '150px'
|
|
178
|
+
},
|
|
179
|
+
value: quillFormat['font']
|
|
180
|
+
}, fontFamilyList.map(function (v) {
|
|
181
|
+
return /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
182
|
+
label: v.name,
|
|
183
|
+
value: v.value
|
|
184
|
+
}, v.name);
|
|
185
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
186
|
+
className: "tool-item"
|
|
187
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
|
|
188
|
+
onChange: function onChange(v) {
|
|
189
|
+
_this.onToolBtnClick('size', v);
|
|
190
|
+
},
|
|
191
|
+
placeholder: "Font Size",
|
|
192
|
+
size: "small",
|
|
193
|
+
style: {
|
|
194
|
+
width: '120px'
|
|
195
|
+
},
|
|
196
|
+
value: quillFormat['size']
|
|
197
|
+
}, fontSizeList.map(function (v) {
|
|
198
|
+
return /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
199
|
+
label: v.name,
|
|
200
|
+
value: v
|
|
201
|
+
}, v, "px");
|
|
202
|
+
})))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
203
|
+
className: "toolbar-row"
|
|
204
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
205
|
+
className: "tool-item"
|
|
206
|
+
}, /*#__PURE__*/_react["default"].createElement(_ToolBtn["default"], {
|
|
207
|
+
active: quillFormat['bold'],
|
|
208
|
+
onChange: function onChange() {
|
|
209
|
+
_this.onToolBtnClick('bold');
|
|
210
|
+
},
|
|
211
|
+
type: "bold"
|
|
212
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
213
|
+
className: "tool-item"
|
|
214
|
+
}, /*#__PURE__*/_react["default"].createElement(_ToolBtn["default"], {
|
|
215
|
+
active: quillFormat['italic'],
|
|
216
|
+
onChange: function onChange() {
|
|
217
|
+
_this.onToolBtnClick('italic');
|
|
218
|
+
},
|
|
219
|
+
type: "italic"
|
|
220
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
221
|
+
className: "tool-item"
|
|
222
|
+
}, /*#__PURE__*/_react["default"].createElement(_ToolBtn["default"], {
|
|
223
|
+
active: quillFormat['strike'],
|
|
224
|
+
onChange: function onChange() {
|
|
225
|
+
_this.onToolBtnClick('strike');
|
|
226
|
+
},
|
|
227
|
+
type: "strike"
|
|
228
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
229
|
+
className: "tool-item"
|
|
230
|
+
}, /*#__PURE__*/_react["default"].createElement(_ToolBtn["default"], {
|
|
231
|
+
active: quillFormat['underline'],
|
|
232
|
+
onChange: function onChange() {
|
|
233
|
+
_this.onToolBtnClick('underline');
|
|
234
|
+
},
|
|
235
|
+
type: "underline"
|
|
236
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
237
|
+
className: "tooll-line"
|
|
238
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
239
|
+
className: "tool-item"
|
|
240
|
+
}, /*#__PURE__*/_react["default"].createElement(_ToolBtn["default"], {
|
|
241
|
+
onChange: function onChange(value) {
|
|
242
|
+
_this.onToolBtnClick('color', value);
|
|
243
|
+
},
|
|
244
|
+
type: "color",
|
|
245
|
+
value: {
|
|
246
|
+
color: quillFormat['color']
|
|
247
|
+
}
|
|
248
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
249
|
+
className: "tool-item"
|
|
250
|
+
}, /*#__PURE__*/_react["default"].createElement(_ToolBtn["default"], {
|
|
251
|
+
active: quillFormat['list'] == 'bullet',
|
|
252
|
+
onChange: function onChange() {
|
|
253
|
+
_this.onToolBtnClick('listUnOrder');
|
|
254
|
+
},
|
|
255
|
+
type: "listUnOrder"
|
|
256
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
257
|
+
className: "tool-item"
|
|
258
|
+
}, /*#__PURE__*/_react["default"].createElement(_ToolBtn["default"], {
|
|
259
|
+
active: quillFormat['list'] == 'ordered',
|
|
260
|
+
onChange: function onChange() {
|
|
261
|
+
_this.onToolBtnClick('listOrder');
|
|
262
|
+
},
|
|
263
|
+
type: "listOrder"
|
|
264
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
265
|
+
className: "tooll-line"
|
|
266
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
267
|
+
className: "tool-item"
|
|
268
|
+
}, /*#__PURE__*/_react["default"].createElement(_ToolBtn["default"], {
|
|
269
|
+
onChange: function onChange(value) {
|
|
270
|
+
_this.onToolBtnClick('link', value);
|
|
271
|
+
},
|
|
272
|
+
type: "link"
|
|
273
|
+
}))));
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
ToolBarModal.defaultProps = {};
|
|
277
|
+
return ToolBarModal;
|
|
278
|
+
}(_react["default"].Component);
|
|
279
|
+
|
|
280
|
+
var _default = ToolBarModal;
|
|
281
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.toolbar-wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
border-bottom: 1px solid rgba(0, 0, 0, .04);
|
|
4
|
+
border-top: 1px solid rgba(0, 0, 0, .04);
|
|
5
|
+
position: absolute;
|
|
6
|
+
border-radius: 6px;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
z-index: 999;
|
|
10
|
+
background: #fff;
|
|
11
|
+
transform: translateY(calc(-100% - 1px));
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
padding: 3px 0;
|
|
14
|
+
|
|
15
|
+
.tool-item {
|
|
16
|
+
margin: 0 5px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.tooll-line {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
width: 1px;
|
|
22
|
+
height: 24px;
|
|
23
|
+
background-color: rgba(0, 0, 0, .04);
|
|
24
|
+
margin: 0 5px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.toolbar-row {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
height: 35px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -35,20 +35,22 @@ var _LeftTitle = _interopRequireDefault(require("./LeftTitle"));
|
|
|
35
35
|
|
|
36
36
|
var _RenderHtml = _interopRequireDefault(require("./RenderHtml"));
|
|
37
37
|
|
|
38
|
+
var _ToolBarModal = _interopRequireDefault(require("./ToolBarModal"));
|
|
39
|
+
|
|
38
40
|
var _componentTypes = require("../../constants/component-types");
|
|
39
41
|
|
|
40
42
|
var _mobx = require("../../mobx");
|
|
41
43
|
|
|
42
44
|
var _constants = require("../../constants");
|
|
43
45
|
|
|
44
|
-
require("./index.less");
|
|
45
|
-
|
|
46
46
|
var _common = require("../../common");
|
|
47
47
|
|
|
48
48
|
var _storeUtil = require("../../utils/storeUtil");
|
|
49
49
|
|
|
50
50
|
var _commonUtil = require("../../utils/commonUtil");
|
|
51
51
|
|
|
52
|
+
require("./index.less");
|
|
53
|
+
|
|
52
54
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
53
55
|
|
|
54
56
|
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); }
|
|
@@ -606,6 +608,18 @@ function (_super) {
|
|
|
606
608
|
});
|
|
607
609
|
};
|
|
608
610
|
|
|
611
|
+
_this.onEditModalOk = function (html) {
|
|
612
|
+
var _a;
|
|
613
|
+
|
|
614
|
+
(_a = _mobx.frameStore.textModalState) === null || _a === void 0 ? void 0 : _a.onOk(html);
|
|
615
|
+
|
|
616
|
+
_mobx.frameStore.setState({
|
|
617
|
+
textModalState: {
|
|
618
|
+
visible: false
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
};
|
|
622
|
+
|
|
609
623
|
(0, _commonUtil.ensure)(function () {
|
|
610
624
|
return window._MAGIC_VERSION = '0.1.49';
|
|
611
625
|
});
|
|
@@ -628,7 +642,11 @@ function (_super) {
|
|
|
628
642
|
_this.state = {
|
|
629
643
|
MPageData: MPageData,
|
|
630
644
|
device: _constants.deviceTypeMap.PHONE,
|
|
631
|
-
appointmentVisible: false
|
|
645
|
+
appointmentVisible: false,
|
|
646
|
+
showEditModal: false,
|
|
647
|
+
textModalState: {
|
|
648
|
+
quillRef: null
|
|
649
|
+
}
|
|
632
650
|
};
|
|
633
651
|
setDesignConfig(__assign(__assign({}, config), {
|
|
634
652
|
outputType: outputType
|
|
@@ -656,7 +674,8 @@ function (_super) {
|
|
|
656
674
|
|
|
657
675
|
this.destory = (0, _mobx.autorun)(function () {
|
|
658
676
|
var stateObj = {
|
|
659
|
-
imgGenVisible: _mobx.store.imgGenVisible
|
|
677
|
+
imgGenVisible: _mobx.store.imgGenVisible,
|
|
678
|
+
textModalState: _mobx.frameStore.textModalState
|
|
660
679
|
};
|
|
661
680
|
|
|
662
681
|
if (_this.state.locale != _mobx.store.locale) {
|
|
@@ -714,7 +733,8 @@ function (_super) {
|
|
|
714
733
|
var _a = this.state,
|
|
715
734
|
MPageData = _a.MPageData,
|
|
716
735
|
device = _a.device,
|
|
717
|
-
appointmentVisible = _a.appointmentVisible
|
|
736
|
+
appointmentVisible = _a.appointmentVisible,
|
|
737
|
+
textModalState = _a.textModalState;
|
|
718
738
|
var _b = this.props,
|
|
719
739
|
pagesManager = _b.pagesManager,
|
|
720
740
|
compSource = _b.compSource,
|
|
@@ -775,7 +795,9 @@ function (_super) {
|
|
|
775
795
|
},
|
|
776
796
|
onConfirm: this.onAppointmentConfirm,
|
|
777
797
|
visible: appointmentVisible
|
|
778
|
-
})), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_common.SystemNotification, null))
|
|
798
|
+
})), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_common.SystemNotification, null)), textModalState.quillRef && /*#__PURE__*/_react["default"].createElement(_ToolBarModal["default"], {
|
|
799
|
+
quillRef: textModalState.quillRef
|
|
800
|
+
})), /*#__PURE__*/_react["default"].createElement(_RenderHtml["default"], {
|
|
779
801
|
ref: this.renderHtmlRef
|
|
780
802
|
}));
|
|
781
803
|
};
|
package/es/locale/en/en.json
CHANGED
package/es/locale/es/es.json
CHANGED