@fonixtree/magic-design 0.0.141 → 0.0.144
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/composite-comp/bol/components/Text/index.js +1 -1
- package/es/composite-comp/bol/components/Text/index.less +4 -3
- package/es/core/Designer/ConfigPanel/index.js +1 -1
- package/es/decorator/compositeDecorator.js +2 -2
- package/es/meta-comp/components/Text/index.js +6 -2
- package/lib/composite-comp/bol/components/Text/index.js +1 -1
- package/lib/composite-comp/bol/components/Text/index.less +4 -3
- package/lib/core/Designer/ConfigPanel/index.js +1 -1
- package/lib/decorator/compositeDecorator.js +2 -2
- package/lib/meta-comp/components/Text/index.js +6 -2
- package/package.json +1 -1
|
@@ -62,7 +62,7 @@ var __decorate = void 0 && (void 0).__decorate || function (decorators, target,
|
|
|
62
62
|
// import './index.less';
|
|
63
63
|
// less to css 在线地址 https://tool.oschina.net/less
|
|
64
64
|
// css 压缩地址 https://www.runoob.com/csspack
|
|
65
|
-
var style = '.m-text .title-wrap{font-weight:500;font-size:20px;}.m-text .sub-title{font-size:15px;color:#b7b7b7;margin-top:10px;}.m-text .group-content-wrap{width:100%;}.m-text .group-content-wrap .group-wrap-container{padding:20px;}.m-text .group-content-wrap .group-wrap{display:flex;flex-direction:column;
|
|
65
|
+
var style = '.m-text{display: flex;flex-direction: column;}.m-text .title-wrap{font-weight:500;font-size:20px;}.m-text .sub-title{font-size:15px;color:#b7b7b7;margin-top:10px;}.m-text .group-content-wrap{width:100%;}.m-text .group-content-wrap .group-wrap-container{padding:10px 20px;}.m-text .group-content-wrap .group-wrap{display:flex;flex-direction:column;width:100%;}.m-text .group-content-wrap .group-wrap .group-title{font-size:14px;}.m-text .group-content-wrap.col-1 .group-wrap{width:100%;}.m-text .group-content-wrap.col-2{display:grid;grid-template-columns:50% 50%;}.m-text .group-content-wrap.col-3{display:grid;grid-template-columns:33.3% 33.3% 33.3%;}.m-text .group-content-wrap.mobile{display:block;}';
|
|
66
66
|
|
|
67
67
|
var Text =
|
|
68
68
|
/** @class */
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
.m-text {
|
|
2
|
-
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
|
|
3
5
|
.title-wrap {
|
|
4
6
|
font-weight: 500;
|
|
5
7
|
font-size: 20px;
|
|
@@ -15,13 +17,12 @@
|
|
|
15
17
|
width: 100%;
|
|
16
18
|
|
|
17
19
|
.group-wrap-container {
|
|
18
|
-
padding: 20px;
|
|
20
|
+
padding: 10px 20px;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
.group-wrap {
|
|
22
24
|
display: flex;
|
|
23
25
|
flex-direction: column;
|
|
24
|
-
margin-top: 20px;
|
|
25
26
|
width: 100%;
|
|
26
27
|
|
|
27
28
|
.group-title {
|
|
@@ -130,8 +130,8 @@ function compositeDecorator(WrappedComponent) {
|
|
|
130
130
|
wrapStyle.opacity = background.opacity ? background.opacity : 1;
|
|
131
131
|
} else {
|
|
132
132
|
wrapStyle.backgroundImage = "url(" + background.image + ")";
|
|
133
|
-
wrapStyle.backgroundPosition = '
|
|
134
|
-
wrapStyle.backgroundSize = '
|
|
133
|
+
wrapStyle.backgroundPosition = 'center center';
|
|
134
|
+
wrapStyle.backgroundSize = 'cover';
|
|
135
135
|
wrapStyle.backgroundRepeat = 'no-repeat';
|
|
136
136
|
}
|
|
137
137
|
} // 复合组件宽度
|
|
@@ -473,7 +473,8 @@ function (_super) {
|
|
|
473
473
|
data = _a.data,
|
|
474
474
|
className = _a.className,
|
|
475
475
|
readonly = _a.readonly,
|
|
476
|
-
onTextInput = _a.onTextInput
|
|
476
|
+
onTextInput = _a.onTextInput,
|
|
477
|
+
mode = _a.mode;
|
|
477
478
|
var style = contentStyle(data.content);
|
|
478
479
|
|
|
479
480
|
if (data.underline) {
|
|
@@ -496,12 +497,14 @@ function (_super) {
|
|
|
496
497
|
// textDecorationColor: data?.underline.textDecorationColor,
|
|
497
498
|
// textDecorationStyle: data?.underline.textDecorationStyle,
|
|
498
499
|
// };
|
|
500
|
+
// mode == 'designer' && !readonly
|
|
499
501
|
|
|
500
502
|
|
|
503
|
+
console.log('!readonly: ', mode, readonly);
|
|
501
504
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
502
505
|
ref: this.textRef,
|
|
503
506
|
className: (0, _classnames["default"])('m-meta-text', className),
|
|
504
|
-
contentEditable:
|
|
507
|
+
contentEditable: mode == 'designer' && !readonly,
|
|
505
508
|
onClick: function onClick() {
|
|
506
509
|
(0, _coreUtil.clickUrl)(data.content.clickUrl);
|
|
507
510
|
},
|
|
@@ -530,6 +533,7 @@ function (_super) {
|
|
|
530
533
|
|
|
531
534
|
Text.defaultProps = {
|
|
532
535
|
readonly: false,
|
|
536
|
+
mode: 'designer',
|
|
533
537
|
onTextInput: function onTextInput() {}
|
|
534
538
|
};
|
|
535
539
|
Text = __decorate([_decorator.metaDecorator], Text);
|
|
@@ -62,7 +62,7 @@ var __decorate = void 0 && (void 0).__decorate || function (decorators, target,
|
|
|
62
62
|
// import './index.less';
|
|
63
63
|
// less to css 在线地址 https://tool.oschina.net/less
|
|
64
64
|
// css 压缩地址 https://www.runoob.com/csspack
|
|
65
|
-
var style = '.m-text .title-wrap{font-weight:500;font-size:20px;}.m-text .sub-title{font-size:15px;color:#b7b7b7;margin-top:10px;}.m-text .group-content-wrap{width:100%;}.m-text .group-content-wrap .group-wrap-container{padding:20px;}.m-text .group-content-wrap .group-wrap{display:flex;flex-direction:column;
|
|
65
|
+
var style = '.m-text{display: flex;flex-direction: column;}.m-text .title-wrap{font-weight:500;font-size:20px;}.m-text .sub-title{font-size:15px;color:#b7b7b7;margin-top:10px;}.m-text .group-content-wrap{width:100%;}.m-text .group-content-wrap .group-wrap-container{padding:10px 20px;}.m-text .group-content-wrap .group-wrap{display:flex;flex-direction:column;width:100%;}.m-text .group-content-wrap .group-wrap .group-title{font-size:14px;}.m-text .group-content-wrap.col-1 .group-wrap{width:100%;}.m-text .group-content-wrap.col-2{display:grid;grid-template-columns:50% 50%;}.m-text .group-content-wrap.col-3{display:grid;grid-template-columns:33.3% 33.3% 33.3%;}.m-text .group-content-wrap.mobile{display:block;}';
|
|
66
66
|
|
|
67
67
|
var Text =
|
|
68
68
|
/** @class */
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
.m-text {
|
|
2
|
-
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
|
|
3
5
|
.title-wrap {
|
|
4
6
|
font-weight: 500;
|
|
5
7
|
font-size: 20px;
|
|
@@ -15,13 +17,12 @@
|
|
|
15
17
|
width: 100%;
|
|
16
18
|
|
|
17
19
|
.group-wrap-container {
|
|
18
|
-
padding: 20px;
|
|
20
|
+
padding: 10px 20px;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
.group-wrap {
|
|
22
24
|
display: flex;
|
|
23
25
|
flex-direction: column;
|
|
24
|
-
margin-top: 20px;
|
|
25
26
|
width: 100%;
|
|
26
27
|
|
|
27
28
|
.group-title {
|
|
@@ -130,8 +130,8 @@ function compositeDecorator(WrappedComponent) {
|
|
|
130
130
|
wrapStyle.opacity = background.opacity ? background.opacity : 1;
|
|
131
131
|
} else {
|
|
132
132
|
wrapStyle.backgroundImage = "url(" + background.image + ")";
|
|
133
|
-
wrapStyle.backgroundPosition = '
|
|
134
|
-
wrapStyle.backgroundSize = '
|
|
133
|
+
wrapStyle.backgroundPosition = 'center center';
|
|
134
|
+
wrapStyle.backgroundSize = 'cover';
|
|
135
135
|
wrapStyle.backgroundRepeat = 'no-repeat';
|
|
136
136
|
}
|
|
137
137
|
} // 复合组件宽度
|
|
@@ -473,7 +473,8 @@ function (_super) {
|
|
|
473
473
|
data = _a.data,
|
|
474
474
|
className = _a.className,
|
|
475
475
|
readonly = _a.readonly,
|
|
476
|
-
onTextInput = _a.onTextInput
|
|
476
|
+
onTextInput = _a.onTextInput,
|
|
477
|
+
mode = _a.mode;
|
|
477
478
|
var style = contentStyle(data.content);
|
|
478
479
|
|
|
479
480
|
if (data.underline) {
|
|
@@ -496,12 +497,14 @@ function (_super) {
|
|
|
496
497
|
// textDecorationColor: data?.underline.textDecorationColor,
|
|
497
498
|
// textDecorationStyle: data?.underline.textDecorationStyle,
|
|
498
499
|
// };
|
|
500
|
+
// mode == 'designer' && !readonly
|
|
499
501
|
|
|
500
502
|
|
|
503
|
+
console.log('!readonly: ', mode, readonly);
|
|
501
504
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
502
505
|
ref: this.textRef,
|
|
503
506
|
className: (0, _classnames["default"])('m-meta-text', className),
|
|
504
|
-
contentEditable:
|
|
507
|
+
contentEditable: mode == 'designer' && !readonly,
|
|
505
508
|
onClick: function onClick() {
|
|
506
509
|
(0, _coreUtil.clickUrl)(data.content.clickUrl);
|
|
507
510
|
},
|
|
@@ -530,6 +533,7 @@ function (_super) {
|
|
|
530
533
|
|
|
531
534
|
Text.defaultProps = {
|
|
532
535
|
readonly: false,
|
|
536
|
+
mode: 'designer',
|
|
533
537
|
onTextInput: function onTextInput() {}
|
|
534
538
|
};
|
|
535
539
|
Text = __decorate([_decorator.metaDecorator], Text);
|