@fonixtree/magic-design 2.0.31 → 2.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/es/assets/less/modal.less +1 -1
  2. package/es/common/LinkModal/FilteredProductModal/index.js +7 -3
  3. package/es/common/LinkModal/FilteredProductModal/index.less +1 -1
  4. package/es/common/LinkModal/index.js +1 -1
  5. package/es/common/ProductModal/index.js +23 -30
  6. package/es/composite-comp/bol/components/Banner/mobile/index.js +6 -0
  7. package/es/composite-comp/bol/components/Video/defaultJSON.js +24 -0
  8. package/es/composite-comp/bol/config-panels/TagCompConfig/imgs/layout1.png +0 -0
  9. package/es/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +0 -1
  10. package/es/composite-comp/common/components/ProductItem/index.js +8 -4
  11. package/es/composite-comp/common/components/ProductItem/index.less +30 -15
  12. package/es/composite-comp/dito/components/Recommend/defaultJSON.js +1 -1
  13. package/es/composite-comp/dito/components/Recommend/mobile/index.js +14 -2
  14. package/es/composite-comp/dito/components/SignBoard/defaultJSON.js +41 -37
  15. package/es/composite-comp/dito/components/SignBoard/mobile/index.js +33 -28
  16. package/es/composite-comp/dito/components/SignBoard/mobile/index.less +0 -14
  17. package/es/composite-comp/dito/components/SignBoard/pc/index.js +8 -11
  18. package/es/composite-comp/dito/config-panels/SignBoardConfig/SignBoardConfigContent/index.js +9 -47
  19. package/es/composite-comp/dito/config-panels/SignBoardConfig/index.js +9 -2
  20. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +3 -3
  21. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +14 -2
  22. package/es/core/Designer/LeftTitle/index.js +1 -1
  23. package/es/core/Designer/ToolBarModal/index.js +16 -4
  24. package/es/core/Designer/index.js +3 -0
  25. package/es/core/Renderer/index.js +4 -12
  26. package/es/decorator/index.js +24 -1
  27. package/es/locale/en/en.json +1 -1
  28. package/es/locale/es/es.json +1 -1
  29. package/es/locale/id/id.json +1 -1
  30. package/es/meta-comp/components/Button/index.js +7 -0
  31. package/es/meta-comp/components/Text/formats/fontStyle.js +58 -0
  32. package/es/meta-comp/components/Text/index.js +9 -0
  33. package/es/meta-comp/config-panels/ButtonConfig/index.js +30 -28
  34. package/es/utils/commonUtil.js +17 -3
  35. package/es/utils/currencyUtil.js +29 -10
  36. package/lib/assets/less/modal.less +1 -1
  37. package/lib/common/LinkModal/FilteredProductModal/index.js +7 -3
  38. package/lib/common/LinkModal/FilteredProductModal/index.less +1 -1
  39. package/lib/common/LinkModal/index.js +1 -1
  40. package/lib/common/ProductModal/index.js +23 -30
  41. package/lib/composite-comp/bol/components/Banner/mobile/index.js +6 -0
  42. package/lib/composite-comp/bol/components/Video/defaultJSON.js +24 -0
  43. package/lib/composite-comp/bol/config-panels/TagCompConfig/imgs/layout1.png +0 -0
  44. package/lib/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +0 -1
  45. package/lib/composite-comp/common/components/ProductItem/index.js +8 -4
  46. package/lib/composite-comp/common/components/ProductItem/index.less +30 -15
  47. package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +1 -1
  48. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +14 -2
  49. package/lib/composite-comp/dito/components/SignBoard/defaultJSON.js +41 -37
  50. package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +33 -28
  51. package/lib/composite-comp/dito/components/SignBoard/mobile/index.less +0 -14
  52. package/lib/composite-comp/dito/components/SignBoard/pc/index.js +8 -11
  53. package/lib/composite-comp/dito/config-panels/SignBoardConfig/SignBoardConfigContent/index.js +9 -47
  54. package/lib/composite-comp/dito/config-panels/SignBoardConfig/index.js +9 -2
  55. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +3 -3
  56. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +14 -2
  57. package/lib/core/Designer/LeftTitle/index.js +1 -1
  58. package/lib/core/Designer/ToolBarModal/index.js +16 -4
  59. package/lib/core/Designer/index.js +3 -0
  60. package/lib/core/Renderer/index.js +4 -12
  61. package/lib/decorator/index.js +24 -1
  62. package/lib/locale/en/en.json +1 -1
  63. package/lib/locale/es/es.json +1 -1
  64. package/lib/locale/id/id.json +1 -1
  65. package/lib/meta-comp/components/Button/index.js +7 -0
  66. package/lib/meta-comp/components/Text/formats/fontStyle.js +58 -0
  67. package/lib/meta-comp/components/Text/index.js +9 -0
  68. package/lib/meta-comp/config-panels/ButtonConfig/index.js +30 -28
  69. package/lib/utils/commonUtil.js +17 -3
  70. package/lib/utils/currencyUtil.js +29 -10
  71. package/package.json +1 -1
  72. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.js +0 -99
  73. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.less +0 -54
  74. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignCenterSVG.js +0 -27
  75. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignLeftSVG.js +0 -27
  76. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignRightSVG.js +0 -27
  77. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.js +0 -96
  78. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.less +0 -26
  79. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.js +0 -101
  80. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.less +0 -26
  81. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +0 -99
  82. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.less +0 -39
  83. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.js +0 -93
  84. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.less +0 -26
  85. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/BackgroundSVG.js +0 -27
  86. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/BoldSVG.js +0 -29
  87. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/FontColorSVG.js +0 -49
  88. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/ItalicSVG.js +0 -29
  89. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/LinkSVG.js +0 -26
  90. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/OrderSVG.js +0 -27
  91. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/StrikeSVG.js +0 -31
  92. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnderlineSVG.js +0 -34
  93. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnorderSVG.js +0 -41
  94. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/index.js +0 -136
  95. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/index.less +0 -25
  96. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/type.js +0 -1
  97. package/es/core/Designer/TextEditModal/ToolBar/index.js +0 -219
  98. package/es/core/Designer/TextEditModal/ToolBar/index.less +0 -19
  99. package/es/core/Designer/TextEditModal/index.js +0 -100
  100. package/es/core/Designer/TextEditModal/index.less +0 -4
  101. package/es/core/Designer/TextEditModal_old/index.js +0 -142
  102. package/es/core/Designer/TextEditModal_old/index.less +0 -25
  103. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.js +0 -99
  104. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.less +0 -54
  105. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignCenterSVG.js +0 -27
  106. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignLeftSVG.js +0 -27
  107. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignRightSVG.js +0 -27
  108. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.js +0 -96
  109. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.less +0 -26
  110. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.js +0 -101
  111. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.less +0 -26
  112. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +0 -99
  113. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.less +0 -39
  114. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.js +0 -93
  115. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.less +0 -26
  116. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/BackgroundSVG.js +0 -27
  117. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/BoldSVG.js +0 -29
  118. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/FontColorSVG.js +0 -49
  119. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/ItalicSVG.js +0 -29
  120. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/LinkSVG.js +0 -26
  121. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/OrderSVG.js +0 -27
  122. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/StrikeSVG.js +0 -31
  123. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnderlineSVG.js +0 -34
  124. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnorderSVG.js +0 -41
  125. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/index.js +0 -136
  126. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/index.less +0 -25
  127. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/type.js +0 -1
  128. package/lib/core/Designer/TextEditModal/ToolBar/index.js +0 -219
  129. package/lib/core/Designer/TextEditModal/ToolBar/index.less +0 -19
  130. package/lib/core/Designer/TextEditModal/index.js +0 -100
  131. package/lib/core/Designer/TextEditModal/index.less +0 -4
  132. package/lib/core/Designer/TextEditModal_old/index.js +0 -142
  133. package/lib/core/Designer/TextEditModal_old/index.less +0 -25
@@ -15,6 +15,8 @@ var _ImageConfig = _interopRequireDefault(require("../../../../../meta-comp/conf
15
15
 
16
16
  var _coreUtil = require("../../../../../utils/coreUtil");
17
17
 
18
+ var _TextConfig = _interopRequireDefault(require("../../../../../meta-comp/config-panels/TextConfig"));
19
+
18
20
  var _locale = require("../../../../../locale");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -67,11 +69,9 @@ function (_super) {
67
69
  }
68
70
 
69
71
  SignBoardConfigContent.prototype.render = function () {
70
- var _this = this;
71
-
72
72
  var panelProps = this.props.panelProps;
73
73
  var source = [{
74
- key: 'search1',
74
+ key: 'logo',
75
75
  name: (0, _locale.i18n)('LOGO'),
76
76
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
77
77
  data: panelProps.logo
@@ -79,50 +79,12 @@ function (_super) {
79
79
  metaOption: panelProps.logo,
80
80
  toggleType: 'switch'
81
81
  }, {
82
- key: 'search2',
83
- name: (0, _locale.i18n)('SEARCH_BOX'),
84
- value: /*#__PURE__*/_react["default"].createElement(_common.Field, {
85
- style: {
86
- marginTop: 20
87
- },
88
- title: (0, _locale.i18n)('COLOR')
89
- }, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
90
- colorType: "rgba",
91
- onChange: function onChange(v) {
92
- if ((0, _coreUtil.isPc)()) {
93
- panelProps.box.color.pc = v;
94
- } else {
95
- panelProps.box.color.mobile = v;
96
- }
97
-
98
- _this.selfRender();
99
- },
100
- value: (0, _coreUtil.isPc)() ? panelProps.box.color.pc : panelProps.box.color.mobile
101
- })),
102
- metaOption: panelProps.box,
103
- toggleType: 'switch'
104
- }, {
105
- key: 'search3',
106
- name: (0, _locale.i18n)('ICON'),
107
- value: /*#__PURE__*/_react["default"].createElement(_common.Field, {
108
- style: {
109
- marginTop: 20
110
- },
111
- title: (0, _locale.i18n)('COLOR')
112
- }, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
113
- colorType: "rgba",
114
- onChange: function onChange(v) {
115
- if ((0, _coreUtil.isPc)()) {
116
- panelProps.icon.color.pc = v;
117
- } else {
118
- panelProps.icon.color.mobile = v;
119
- }
120
-
121
- _this.selfRender();
122
- },
123
- value: (0, _coreUtil.isPc)() ? panelProps.icon.color.pc : panelProps.icon.color.mobile
124
- })),
125
- metaOption: panelProps.icon,
82
+ key: 'title',
83
+ name: (0, _locale.i18n)('TITLE'),
84
+ value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
85
+ data: panelProps.title
86
+ }),
87
+ metaOption: panelProps.title,
126
88
  toggleType: 'switch'
127
89
  }];
128
90
  return /*#__PURE__*/_react["default"].createElement(_common.Collapse, {
@@ -7,6 +7,8 @@ exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
+ var _SignBoardConfigContent = _interopRequireDefault(require("./SignBoardConfigContent"));
11
+
10
12
  var _locale = require("../../../../locale");
11
13
 
12
14
  var _common = require("../../../../common");
@@ -57,8 +59,13 @@ function (_super) {
57
59
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_common.Collapse, {
58
60
  divider: "bold",
59
61
  headerSize: "large",
60
- source: [// { key: 'signBoard1', name: i18n('CONTENT'), value: <SignBoardConfigContent panelProps={data.content} /> },
61
- {
62
+ source: [{
63
+ key: 'signBoard1',
64
+ name: (0, _locale.i18n)('CONTENT'),
65
+ value: /*#__PURE__*/_react["default"].createElement(_SignBoardConfigContent["default"], {
66
+ panelProps: data.content
67
+ })
68
+ }, {
62
69
  key: 'signBoard4',
63
70
  name: (0, _locale.i18n)('SPACING'),
64
71
  value: /*#__PURE__*/_react["default"].createElement(_SpacingConfig["default"], {
@@ -228,8 +228,8 @@ function (_super) {
228
228
  this.setState({
229
229
  intelligentType: type,
230
230
  intelligentValue: []
231
- });
232
- this.getTypeData(type);
231
+ }); // this.getTypeData(type);
232
+
233
233
  this.props.onChange({
234
234
  intelligentType: type,
235
235
  intelligentValue: []
@@ -255,7 +255,7 @@ function (_super) {
255
255
  ];
256
256
  return [4
257
257
  /*yield*/
258
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offercatgs/list")];
258
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/designer/resource/offercatgs/list")];
259
259
 
260
260
  case 1:
261
261
  res = _a.sent();
@@ -81,6 +81,18 @@ function (_super) {
81
81
 
82
82
  _this.state = {};
83
83
 
84
+ _this.hasSource = function (type) {
85
+ if (!window.systemParams || !window.systemParams.recommendSource) {
86
+ return true;
87
+ }
88
+
89
+ if (window.systemParams.recommendSource && window.systemParams.recommendSource.includes(type)) {
90
+ return true;
91
+ }
92
+
93
+ return false;
94
+ };
95
+
84
96
  _this.getContentPanel = function () {
85
97
  var panelProps = _this.props.panelProps;
86
98
 
@@ -95,9 +107,9 @@ function (_super) {
95
107
  _this.selfRender();
96
108
  },
97
109
  value: panelProps.sourceType
98
- }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
110
+ }, _this.hasSource('P') && /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
99
111
  value: "select"
100
- }, (0, _locale.i18n)('SELECT_PRODUCT')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
112
+ }, (0, _locale.i18n)('SELECT_PRODUCT')), _this.hasSource('A') && /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
101
113
  value: "recommend"
102
114
  }, (0, _locale.i18n)('AI_RECOMMENDATION')))), /*#__PURE__*/_react["default"].createElement("div", {
103
115
  className: "greyBg"
@@ -57,7 +57,7 @@ function (_super) {
57
57
  };
58
58
 
59
59
  LeftTitle.defaultProps = {
60
- title: '邮件模板'
60
+ title: 'Email Template'
61
61
  };
62
62
  return LeftTitle;
63
63
  }(_react["default"].Component);
@@ -146,18 +146,30 @@ function (_super) {
146
146
  _this.props.quillRef.format('font', value);
147
147
  } else if (type == 'font-weight') {
148
148
  _this.props.quillRef.format('font-weight', value);
149
+ } else if (type == 'font-style') {
150
+ _this.props.quillRef.format('font-style', 'italic' === quillFormat['font-style'] ? '' : 'italic');
149
151
  } else if (type == 'font-family') {
150
152
  _this.props.quillRef.format('font-family', value);
151
153
  } else if (type == 'text-decoration-style') {
154
+ _this.props.quillRef.format('underline', true);
155
+
152
156
  _this.props.quillRef.format('text-decoration-style', value);
153
157
  } else if (type == 'bullet') {
154
158
  _this.props.quillRef.format('list-style-type', value);
155
159
 
156
- _this.props.quillRef.format('list', 'bullet');
160
+ if (value === quillFormat['list-style-type']) {
161
+ _this.props.quillRef.format('list', '');
162
+ } else {
163
+ _this.props.quillRef.format('list', 'bullet');
164
+ }
157
165
  } else if (type == 'ordered') {
158
166
  _this.props.quillRef.format('list-style-type', value);
159
167
 
160
- _this.props.quillRef.format('list', 'ordered');
168
+ if (value === quillFormat['list-style-type']) {
169
+ _this.props.quillRef.format('list', '');
170
+ } else {
171
+ _this.props.quillRef.format('list', 'ordered');
172
+ }
161
173
  } else if (type == 'text-decoration-color') {
162
174
  if (value) {
163
175
  _this.props.quillRef.format('underline', true);
@@ -269,9 +281,9 @@ function (_super) {
269
281
  }, /*#__PURE__*/_react["default"].createElement("div", {
270
282
  className: "tool-item"
271
283
  }, /*#__PURE__*/_react["default"].createElement(_ToolBtn["default"], {
272
- active: quillFormat['italic'],
284
+ active: quillFormat['font-style'] === 'italic',
273
285
  onChange: function onChange() {
274
- _this.onToolBtnClick('italic');
286
+ _this.onToolBtnClick('font-style');
275
287
  },
276
288
  type: "italic"
277
289
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -510,6 +510,9 @@ function (_super) {
510
510
  break;
511
511
 
512
512
  case _constants.quickMenuCode.SAVE:
513
+ /** 如果保存则重置为mobile,同一移动端截图 #10504010 */
514
+ _this.onSwitchDevice(_constants.deviceTypeMap.PHONE);
515
+
513
516
  onSave(handleParams);
514
517
  break;
515
518
 
@@ -78,18 +78,9 @@ var Renderer = function Renderer(props) {
78
78
  };
79
79
 
80
80
  (0, _react.useEffect)(function () {
81
- // const data = await fishFetch('/h5/ga/mediaid', {}, 'GET');
82
- (0, _commonUtil.importAsync)('https://www.googletagmanager.com/gtag/js?id=G-7B9GSSLVX3', 'js').then(function () {
83
- window.dataLayer = window.dataLayer || [];
84
-
85
- function gtag() {
86
- dataLayer.push(arguments);
87
- }
88
-
89
- gtag('js', new Date());
90
- gtag('config', 'G-7B9GSSLVX3');
91
- window.gtag = gtag;
92
- });
81
+ console.log('----pageData change', pageData);
82
+ }, [pageData]);
83
+ (0, _react.useEffect)(function () {
93
84
  setTimeout(function () {
94
85
  var _a;
95
86
 
@@ -103,6 +94,7 @@ var Renderer = function Renderer(props) {
103
94
  className: "render_wrap",
104
95
  magic_design: "",
105
96
  style: {
97
+ height: '100%',
106
98
  background: pageBackground,
107
99
  overflow: 'auto'
108
100
  }
@@ -27,6 +27,7 @@ Object.defineProperty(exports, "metaDecorator", {
27
27
  return _metaDecorator["default"];
28
28
  }
29
29
  });
30
+ exports.shouldUpdate = shouldUpdate;
30
31
  Object.defineProperty(exports, "updateConfigDecorator", {
31
32
  enumerable: true,
32
33
  get: function get() {
@@ -42,4 +43,26 @@ var _updateConfigDecorator = _interopRequireDefault(require("./updateConfigDecor
42
43
 
43
44
  var _lazyLoadDecorator = require("./lazyLoadDecorator");
44
45
 
45
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
46
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
47
+
48
+ /* eslint-disable @typescript-eslint/no-unused-expressions */
49
+
50
+ /** props 和 state 改变时才会render */
51
+ function shouldUpdate() {
52
+ return function (target, name, descriptor) {
53
+ var fn = descriptor.value;
54
+
55
+ descriptor.value = function (nextProps, nextState) {
56
+ var nowPropsJson = JSON.stringify(nextProps);
57
+ var nowStateJson = JSON.stringify(nextState);
58
+ var should1 = nowPropsJson != this.preProps;
59
+ var should2 = nowStateJson != this.preState;
60
+ this.preProps = nowPropsJson;
61
+ this.preState = nowStateJson;
62
+ var result = should1 || should2;
63
+ return result && fn.apply(this, {
64
+ nextProps: nextProps
65
+ });
66
+ };
67
+ };
68
+ }
@@ -54,7 +54,7 @@
54
54
  "ADD_CLICKABLE_AREA": "Add Clickable Area",
55
55
  "ADD_AREA": "Add Area",
56
56
  "CLICKABLE_AREA": "Clickable Area",
57
- "VOUCHER_SUCCESS": "Voucher received successfully!",
57
+ "VOUCHER_SUCCESS": "Coupon received successfully!",
58
58
  "NAVIGATION_NAME": "Navigation Name",
59
59
  "ADD_NAVIGATION": "Add Navigation",
60
60
  "SAVE": "Save",
@@ -54,7 +54,7 @@
54
54
  "ADD_CLICKABLE_AREA": "Add Clickable Area",
55
55
  "ADD_AREA": "Add Area",
56
56
  "CLICKABLE_AREA": "Clickable Area",
57
- "VOUCHER_SUCCESS": "Voucher received successfully!",
57
+ "VOUCHER_SUCCESS": "Coupon received successfully!",
58
58
  "NAVIGATION_NAME": "Navigation Name",
59
59
  "ADD_NAVIGATION": "Add Navigation",
60
60
  "SAVE": "Guardar",
@@ -54,7 +54,7 @@
54
54
  "ADD_CLICKABLE_AREA": "Add Clickable Area",
55
55
  "ADD_AREA": "Add Area",
56
56
  "CLICKABLE_AREA": "Clickable Area",
57
- "VOUCHER_SUCCESS": "Voucher received successfully!",
57
+ "VOUCHER_SUCCESS": "Coupon received successfully!",
58
58
  "NAVIGATION_NAME": "Navigation Name",
59
59
  "ADD_NAVIGATION": "Add Navigation",
60
60
  "SAVE": "Save",
@@ -93,6 +93,10 @@ function (_super) {
93
93
  return _this;
94
94
  }
95
95
 
96
+ Button.prototype.shouldComponentUpdate = function () {
97
+ return true;
98
+ };
99
+
96
100
  Button.prototype.render = function () {
97
101
  var _this = this;
98
102
 
@@ -168,6 +172,9 @@ function (_super) {
168
172
  className: '',
169
173
  readonly: false
170
174
  };
175
+
176
+ __decorate([(0, _decorator.shouldUpdate)()], Button.prototype, "shouldComponentUpdate", null);
177
+
171
178
  Button = __decorate([_decorator.metaDecorator], Button);
172
179
  return Button;
173
180
  }(_react.Component);
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FontStyleAttributor = exports.FontStyle = void 0;
7
+
8
+ var _quill = _interopRequireDefault(require("quill"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+
12
+ var __extends = void 0 && (void 0).__extends || function () {
13
+ var _extendStatics = function extendStatics(d, b) {
14
+ _extendStatics = Object.setPrototypeOf || {
15
+ __proto__: []
16
+ } instanceof Array && function (d, b) {
17
+ d.__proto__ = b;
18
+ } || function (d, b) {
19
+ for (var p in b) {
20
+ if (b.hasOwnProperty(p)) d[p] = b[p];
21
+ }
22
+ };
23
+
24
+ return _extendStatics(d, b);
25
+ };
26
+
27
+ return function (d, b) {
28
+ _extendStatics(d, b);
29
+
30
+ function __() {
31
+ this.constructor = d;
32
+ }
33
+
34
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
35
+ };
36
+ }();
37
+
38
+ var Parchment = _quill["default"]["import"]('parchment');
39
+
40
+ var FontStyleAttributor =
41
+ /** @class */
42
+ function (_super) {
43
+ __extends(FontStyleAttributor, _super);
44
+
45
+ function FontStyleAttributor() {
46
+ return _super !== null && _super.apply(this, arguments) || this;
47
+ }
48
+
49
+ return FontStyleAttributor;
50
+ }(Parchment.Attributor.Style);
51
+
52
+ exports.FontStyleAttributor = FontStyleAttributor;
53
+ var FontStyle = new FontStyleAttributor('font-style', 'font-style', {
54
+ scope: Parchment.Scope.INLINE
55
+ });
56
+ exports.FontStyle = FontStyle;
57
+
58
+ _quill["default"].register('formats/font-style', FontStyle, true);
@@ -17,6 +17,8 @@ require("./formats/fontFamily");
17
17
 
18
18
  require("./formats/textDecorationColor");
19
19
 
20
+ require("./formats/fontStyle");
21
+
20
22
  require("./formats/listStyleTypeStyle");
21
23
 
22
24
  require("./formats/textDecorationStyle");
@@ -203,6 +205,10 @@ function (_super) {
203
205
  });
204
206
  };
205
207
 
208
+ Text.prototype.shouldComponentUpdate = function () {
209
+ return true;
210
+ };
211
+
206
212
  Text.prototype.render = function () {
207
213
  var _a = this.props,
208
214
  data = _a.data,
@@ -272,6 +278,9 @@ function (_super) {
272
278
  readonly: false,
273
279
  onTextInput: function onTextInput() {}
274
280
  };
281
+
282
+ __decorate([(0, _decorator.shouldUpdate)()], Text.prototype, "shouldComponentUpdate", null);
283
+
275
284
  Text = __decorate([_decorator.metaDecorator], Text);
276
285
  return Text;
277
286
  }(_react["default"].Component);
@@ -11,6 +11,8 @@ var _antd = require("antd");
11
11
 
12
12
  require("./index.less");
13
13
 
14
+ var _lodash = require("lodash");
15
+
14
16
  var _locale = require("../../../locale");
15
17
 
16
18
  var _SpacingConfig = _interopRequireDefault(require("../../../composite-comp/common/config-panels/SpacingConfig"));
@@ -104,11 +106,11 @@ function (_super) {
104
106
 
105
107
  _this.updateAttr(data, 'hover', {
106
108
  open: true,
107
- buttonBorder: data.buttonBorder,
108
- buttonIcon: data.buttonIcon,
109
- buttonText: data.buttonText,
109
+ buttonBorder: (0, _lodash.cloneDeep)(data.buttonBorder),
110
+ buttonIcon: (0, _lodash.cloneDeep)(data.buttonIcon),
111
+ buttonText: (0, _lodash.cloneDeep)(data.buttonText),
110
112
  content: {
111
- backgroundColor: data.content.backgroundColor
113
+ backgroundColor: (0, _lodash.cloneDeep)(data.content.backgroundColor)
112
114
  }
113
115
  }); // console.log('--ffd, button hover first click', data);
114
116
 
@@ -162,7 +164,7 @@ function (_super) {
162
164
 
163
165
  var fontSizeKey = window.magicDesign.device == 'pc' ? 'pcFontSize' : 'fontSize';
164
166
 
165
- var ButtonTextSetting = function ButtonTextSetting(data) {
167
+ var ButtonTextSetting = function ButtonTextSetting(_data) {
166
168
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
167
169
  title: (0, _locale.i18n)('FONT_STYLE')
168
170
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
@@ -171,24 +173,24 @@ function (_super) {
171
173
  return t.key == v;
172
174
  });
173
175
 
174
- _extends(data, __assign(__assign({}, findOne), {
176
+ _extends(_data, __assign(__assign({}, findOne), {
175
177
  sizeType: findOne === null || findOne === void 0 ? void 0 : findOne.key
176
178
  }));
177
179
 
178
180
  _this.selfRender();
179
181
  },
180
- value: data.sizeType
182
+ value: _data.sizeType
181
183
  }, _TextConfig.sizeTypeList.map(function (sizeType) {
182
184
  return /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
183
185
  value: sizeType.key
184
186
  }, sizeType.key);
185
- }))), data.sizeType == 'Customize font styles' && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
187
+ }))), _data.sizeType == 'Customize font styles' && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
186
188
  title: (0, _locale.i18n)('FONT_FAMILY')
187
189
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
188
190
  onChange: function onChange(v) {
189
- _this.updateAttr(data, 'fontFamily', v);
191
+ _this.updateAttr(_data, 'fontFamily', v);
190
192
  },
191
- value: data.fontFamily
193
+ value: _data.fontFamily
192
194
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
193
195
  value: "Montserrat"
194
196
  }, "Montserrat"), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
@@ -197,9 +199,9 @@ function (_super) {
197
199
  title: (0, _locale.i18n)('FONT_WEIGHT')
198
200
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
199
201
  onChange: function onChange(v) {
200
- _this.updateAttr(data, 'fontWeight', v);
202
+ _this.updateAttr(_data, 'fontWeight', v);
201
203
  },
202
- value: data.fontWeight
204
+ value: _data.fontWeight
203
205
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
204
206
  value: 400
205
207
  }, (0, _locale.i18n)('REGULAR')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
@@ -210,34 +212,34 @@ function (_super) {
210
212
  onChange: function onChange(_a) {
211
213
  var count = _a.count;
212
214
 
213
- _this.updateAttr(data, fontSizeKey, count);
215
+ _this.updateAttr(_data, fontSizeKey, count);
214
216
  },
215
217
  unit: "px",
216
218
  value: {
217
- count: data[fontSizeKey]
219
+ count: _data[fontSizeKey]
218
220
  }
219
221
  }))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
220
222
  title: ""
221
223
  }, /*#__PURE__*/_react["default"].createElement(_common.FontStyles, {
222
224
  onChange: function onChange(value) {
223
- _extends(data, value);
225
+ _extends(_data, value);
224
226
 
225
227
  _this.selfRender();
226
228
  },
227
- value: data
229
+ value: _data
228
230
  })));
229
231
  };
230
232
 
231
- var ButtonBorderSetting = function ButtonBorderSetting(data) {
233
+ var ButtonBorderSetting = function ButtonBorderSetting(_data) {
232
234
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
233
235
  split: true,
234
236
  title: (0, _locale.i18n)('BORDER_COLOR')
235
237
  }, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
236
238
  colorType: "rgba",
237
239
  onChange: function onChange(value) {
238
- _this.updateAttr(data, 'borderColor', value);
240
+ _this.updateAttr(_data, 'borderColor', value);
239
241
  },
240
- value: data.borderColor
242
+ value: _data.borderColor
241
243
  })), /*#__PURE__*/_react["default"].createElement(_common.Field, {
242
244
  title: (0, _locale.i18n)('BORDER_RADIUS')
243
245
  }, /*#__PURE__*/_react["default"].createElement(_common.Slider, {
@@ -245,15 +247,15 @@ function (_super) {
245
247
  onChange: function onChange(_a) {
246
248
  var count = _a.count;
247
249
 
248
- _this.updateAttr(data, 'borderRadius', count);
250
+ _this.updateAttr(_data, 'borderRadius', count);
249
251
  },
250
252
  value: {
251
- count: data.borderRadius
253
+ count: _data.borderRadius
252
254
  }
253
255
  })));
254
256
  };
255
257
 
256
- var ButtonIconSetting = function ButtonIconSetting(data) {
258
+ var ButtonIconSetting = function ButtonIconSetting(_data) {
257
259
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
258
260
  title: (0, _locale.i18n)('ICON')
259
261
  }, /*#__PURE__*/_react["default"].createElement(_common.IconPicker, {
@@ -262,18 +264,18 @@ function (_super) {
262
264
  },
263
265
  onClick: function onClick() {
264
266
  _this.setState({
265
- isHover: data == _this.props.data.hover.buttonIcon
267
+ isHover: _data == _this.props._data.hover.buttonIcon
266
268
  });
267
269
  },
268
- value: data.iconUrl
269
- })), data.iconUrl && /*#__PURE__*/_react["default"].createElement(_common.Field, {
270
+ value: _data.iconUrl
271
+ })), _data.iconUrl && /*#__PURE__*/_react["default"].createElement(_common.Field, {
270
272
  title: (0, _locale.i18n)('ICON_PLACEMENT')
271
273
  }, /*#__PURE__*/_react["default"].createElement(_common.ButtonIconLayout, {
272
- icon: data.iconUrl,
274
+ icon: _data.iconUrl,
273
275
  onChange: function onChange(value) {
274
- return _this.updateAttr(data, 'layout', value);
276
+ return _this.updateAttr(_data, 'layout', value);
275
277
  },
276
- value: data.layout
278
+ value: _data.layout
277
279
  })));
278
280
  };
279
281
 
@@ -7,7 +7,7 @@ exports.addZero = exports.addUrlQuery = void 0;
7
7
  exports.asyncDataURLtoImage = asyncDataURLtoImage;
8
8
  exports.checkFileName = exports.calcLastTime = exports.asyncNextTick = void 0;
9
9
  exports.commonFetch = commonFetch;
10
- exports.compatibleNewPageData = void 0;
10
+ exports.convertCount = exports.compatibleNewPageData = void 0;
11
11
  exports.convertImageUrl = convertImageUrl;
12
12
  exports.convertToRem = void 0;
13
13
  exports.copy2ClipBoard = copy2ClipBoard;
@@ -776,7 +776,7 @@ var pxToRem = function pxToRem(styleObj) {
776
776
  if (typeof value === 'string' && value.endsWith('px')) {
777
777
  remObj[key] = convertToRem(value.split('px')[0]);
778
778
  } else if (typeof value === 'number') {
779
- remObj[key] = ['opacity', 'lineHeight', 'zIndex'].includes(key) ? value : convertToRem(value);
779
+ remObj[key] = ['opacity', 'lineHeight', 'zIndex', 'fontWeight'].includes(key) ? value : convertToRem(value);
780
780
  } else if ((key === 'padding' || key === 'margin') && typeof value === 'string') {
781
781
  var paddingValues = value.split(' ');
782
782
  var remPaddingValues = paddingValues.map(function (paddingValue) {
@@ -884,4 +884,18 @@ var downloadBase64Image = function downloadBase64Image(base64String, filename) {
884
884
  link.click();
885
885
  };
886
886
 
887
- exports.downloadBase64Image = downloadBase64Image;
887
+ exports.downloadBase64Image = downloadBase64Image;
888
+
889
+ var convertCount = function convertCount(value) {
890
+ var newValue = value;
891
+
892
+ if (value >= 1000000) {
893
+ newValue = Number(value / 1000000).toFixed(1) + "M";
894
+ } else if (value >= 1000) {
895
+ newValue = Number(value / 1000).toFixed(1) + "K";
896
+ }
897
+
898
+ return newValue;
899
+ };
900
+
901
+ exports.convertCount = convertCount;