@fonixtree/magic-design 0.0.56 → 0.0.60

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 (176) hide show
  1. package/README.md +320 -0
  2. package/es/assets/fonts/magic-box-iconfont.css +24 -12
  3. package/es/assets/fonts/magic-box-iconfont.css.bak +24 -12
  4. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  5. package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
  6. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  7. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  8. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  9. package/es/assets/images/layout-icon/layout-navigation-normal.png +0 -0
  10. package/es/common/Button/index.js +2 -1
  11. package/es/common/Button/index.less +5 -0
  12. package/es/common/GroupList/index.js +2 -3
  13. package/es/common/LinkModal/index.less +1 -1
  14. package/es/composite-comp/bol/components/Banner/defaultJSON.js +2 -2
  15. package/es/composite-comp/bol/components/Button/defaultJSON.js +38 -68
  16. package/es/composite-comp/bol/components/Button/index.js +7 -9
  17. package/es/composite-comp/bol/components/Button/index.less +1 -0
  18. package/es/composite-comp/bol/components/Carousel/mobile/index.js +3 -7
  19. package/es/composite-comp/bol/components/Carousel/pc/index.js +2 -2
  20. package/es/composite-comp/bol/components/Tag/defaultJSON.js +36 -46
  21. package/es/composite-comp/bol/components/Tag/index.js +7 -9
  22. package/es/composite-comp/bol/components/Tag/index.less +1 -0
  23. package/es/composite-comp/bol/components/Text/defaultJSON.js +1 -1
  24. package/es/composite-comp/bol/components/Text/index.js +3 -3
  25. package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -1
  26. package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +141 -0
  27. package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.less +16 -0
  28. package/es/composite-comp/bol/config-panels/ButtonCompConfig/index.js +3 -3
  29. package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +1 -1
  30. package/es/composite-comp/bol/config-panels/CarouselConfig/index.js +1 -0
  31. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +6 -16
  32. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +141 -0
  33. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.less +16 -0
  34. package/es/composite-comp/bol/config-panels/TagCompConfig/index.js +1 -0
  35. package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
  36. package/es/composite-comp/bol/second-config-panels/BannerSecondConfig/index.js +2 -6
  37. package/es/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.js +103 -0
  38. package/es/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.less +3 -0
  39. package/es/composite-comp/bol/{config-panels/ButtonCompConfig/ButtonConfigContent → second-config-panels/TagSecondConfig}/index.js +40 -38
  40. package/es/composite-comp/bol/second-config-panels/TagSecondConfig/index.less +3 -0
  41. package/es/composite-comp/common/components/ProductItem/index.less +3 -3
  42. package/es/composite-comp/common/config-panels/SpacingConfig/index.js +8 -8
  43. package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +16 -0
  44. package/es/composite-comp/dito/components/PcNavigation/defaultJSON.js +135 -0
  45. package/es/composite-comp/dito/components/PcNavigation/images/menu-icon.svg +6 -0
  46. package/es/composite-comp/dito/components/PcNavigation/index.js +85 -0
  47. package/es/composite-comp/dito/components/PcNavigation/pc/index.js +484 -0
  48. package/es/composite-comp/dito/components/PcNavigation/pc/index.less +98 -0
  49. package/es/composite-comp/dito/components/Recommend/mobile/index.less +1 -1
  50. package/es/composite-comp/dito/components/Recommend/pc/index.less +1 -1
  51. package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +2 -2
  52. package/es/composite-comp/dito/components/SearchBar/index.js +5 -1
  53. package/es/composite-comp/dito/components/SearchBar/mobile/index.js +23 -24
  54. package/es/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
  55. package/es/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
  56. package/es/composite-comp/dito/components/SearchBar/pc/index.less +57 -0
  57. package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +11 -1
  58. package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +130 -0
  59. package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +126 -0
  60. package/es/composite-comp/dito/config-panels/PcNavigationConfig/TextOnlyFontConfig/index.js +222 -0
  61. package/es/composite-comp/dito/config-panels/PcNavigationConfig/index.js +195 -0
  62. package/es/composite-comp/dito/second-config-panels/PcNavigationSecondConfig/index.js +102 -0
  63. package/es/constants/component-types.js +13 -3
  64. package/es/constants/index.js +20 -2
  65. package/es/constants/layout.js +10 -2
  66. package/es/core/Designer/CompListPanel/index.js +8 -33
  67. package/es/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
  68. package/es/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
  69. package/es/core/Designer/ConfigPanel/index.js +70 -23
  70. package/es/core/Designer/ConfigPanel/index.less +4 -0
  71. package/es/core/Designer/History/index.js +34 -28
  72. package/es/core/Designer/PageCompList/index.js +9 -1
  73. package/es/core/Designer/ViewArea/index.js +20 -6
  74. package/es/core/Designer/index.js +36 -31
  75. package/es/core/Renderer/index.js +17 -2
  76. package/es/decorator/index.js +8 -0
  77. package/es/decorator/updateConfigDecorator.js +76 -0
  78. package/es/locale/en/en.json +10 -1
  79. package/es/locale/es/es.json +10 -1
  80. package/es/locale/id/id.json +10 -1
  81. package/es/meta-comp/components/Button/index.js +8 -8
  82. package/es/meta-comp/components/Button/index.less +5 -0
  83. package/es/meta-comp/components/Image/index.js +1 -1
  84. package/es/meta-comp/components/Text/index.js +18 -7
  85. package/es/meta-comp/config-panels/BaseConfig.js +8 -10
  86. package/es/meta-comp/config-panels/TextConfig/index.js +10 -3
  87. package/es/mobx/Store.js +5 -9
  88. package/es/utils/coreUtil.js +14 -2
  89. package/lib/assets/fonts/magic-box-iconfont.css +24 -12
  90. package/lib/assets/fonts/magic-box-iconfont.css.bak +24 -12
  91. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  92. package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
  93. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  94. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  95. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  96. package/lib/assets/images/layout-icon/layout-navigation-normal.png +0 -0
  97. package/lib/common/Button/index.js +2 -1
  98. package/lib/common/Button/index.less +5 -0
  99. package/lib/common/GroupList/index.js +2 -3
  100. package/lib/common/LinkModal/index.less +1 -1
  101. package/lib/composite-comp/bol/components/Banner/defaultJSON.js +2 -2
  102. package/lib/composite-comp/bol/components/Button/defaultJSON.js +38 -68
  103. package/lib/composite-comp/bol/components/Button/index.js +7 -9
  104. package/lib/composite-comp/bol/components/Button/index.less +1 -0
  105. package/lib/composite-comp/bol/components/Carousel/mobile/index.js +3 -7
  106. package/lib/composite-comp/bol/components/Carousel/pc/index.js +2 -2
  107. package/lib/composite-comp/bol/components/Tag/defaultJSON.js +36 -46
  108. package/lib/composite-comp/bol/components/Tag/index.js +7 -9
  109. package/lib/composite-comp/bol/components/Tag/index.less +1 -0
  110. package/lib/composite-comp/bol/components/Text/defaultJSON.js +1 -1
  111. package/lib/composite-comp/bol/components/Text/index.js +3 -3
  112. package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -1
  113. package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +141 -0
  114. package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.less +16 -0
  115. package/lib/composite-comp/bol/config-panels/ButtonCompConfig/index.js +3 -3
  116. package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +1 -1
  117. package/lib/composite-comp/bol/config-panels/CarouselConfig/index.js +1 -0
  118. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +6 -16
  119. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +141 -0
  120. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.less +16 -0
  121. package/lib/composite-comp/bol/config-panels/TagCompConfig/index.js +1 -0
  122. package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
  123. package/lib/composite-comp/bol/second-config-panels/BannerSecondConfig/index.js +2 -6
  124. package/lib/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.js +103 -0
  125. package/lib/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.less +3 -0
  126. package/lib/composite-comp/bol/{config-panels/ButtonCompConfig/ButtonConfigContent → second-config-panels/TagSecondConfig}/index.js +40 -38
  127. package/lib/composite-comp/bol/second-config-panels/TagSecondConfig/index.less +3 -0
  128. package/lib/composite-comp/common/components/ProductItem/index.less +3 -3
  129. package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +8 -8
  130. package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +16 -0
  131. package/lib/composite-comp/dito/components/PcNavigation/defaultJSON.js +135 -0
  132. package/lib/composite-comp/dito/components/PcNavigation/images/menu-icon.svg +6 -0
  133. package/lib/composite-comp/dito/components/PcNavigation/index.js +85 -0
  134. package/lib/composite-comp/dito/components/PcNavigation/pc/index.js +484 -0
  135. package/lib/composite-comp/dito/components/PcNavigation/pc/index.less +98 -0
  136. package/lib/composite-comp/dito/components/Recommend/mobile/index.less +1 -1
  137. package/lib/composite-comp/dito/components/Recommend/pc/index.less +1 -1
  138. package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +2 -2
  139. package/lib/composite-comp/dito/components/SearchBar/index.js +5 -1
  140. package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +23 -24
  141. package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
  142. package/lib/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
  143. package/lib/composite-comp/dito/components/SearchBar/pc/index.less +57 -0
  144. package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +11 -1
  145. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +130 -0
  146. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +126 -0
  147. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/TextOnlyFontConfig/index.js +222 -0
  148. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/index.js +195 -0
  149. package/lib/composite-comp/dito/second-config-panels/PcNavigationSecondConfig/index.js +102 -0
  150. package/lib/constants/component-types.js +13 -3
  151. package/lib/constants/index.js +20 -2
  152. package/lib/constants/layout.js +10 -2
  153. package/lib/core/Designer/CompListPanel/index.js +8 -33
  154. package/lib/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
  155. package/lib/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
  156. package/lib/core/Designer/ConfigPanel/index.js +70 -23
  157. package/lib/core/Designer/ConfigPanel/index.less +4 -0
  158. package/lib/core/Designer/History/index.js +34 -28
  159. package/lib/core/Designer/PageCompList/index.js +9 -1
  160. package/lib/core/Designer/ViewArea/index.js +20 -6
  161. package/lib/core/Designer/index.js +36 -31
  162. package/lib/core/Renderer/index.js +17 -2
  163. package/lib/decorator/index.js +8 -0
  164. package/lib/decorator/updateConfigDecorator.js +76 -0
  165. package/lib/locale/en/en.json +10 -1
  166. package/lib/locale/es/es.json +10 -1
  167. package/lib/locale/id/id.json +10 -1
  168. package/lib/meta-comp/components/Button/index.js +8 -8
  169. package/lib/meta-comp/components/Button/index.less +5 -0
  170. package/lib/meta-comp/components/Image/index.js +1 -1
  171. package/lib/meta-comp/components/Text/index.js +18 -7
  172. package/lib/meta-comp/config-panels/BaseConfig.js +8 -10
  173. package/lib/meta-comp/config-panels/TextConfig/index.js +10 -3
  174. package/lib/mobx/Store.js +5 -9
  175. package/lib/utils/coreUtil.js +14 -2
  176. package/package.json +86 -1
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _componentTypes = require("../../constants/component-types");
11
11
 
12
+ var _coreUtil = require("../../utils/coreUtil");
13
+
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
15
 
14
16
  var __assign = void 0 && (void 0).__assign || function () {
@@ -48,14 +50,27 @@ var setDesignConfig = function setDesignConfig(props) {
48
50
 
49
51
  var Renderer = function Renderer(props) {
50
52
  var pageData = props.pageData;
51
- setDesignConfig(props);
53
+ setDesignConfig(props); // 根据楼层展示设备进行过滤
54
+
55
+ var filterCompFloor = function filterCompFloor() {
56
+ var source = [];
57
+
58
+ if (pageData && pageData.childNodes && pageData.childNodes.length) {
59
+ source = pageData.childNodes.filter(function (node) {
60
+ return (0, _coreUtil.isActiveFloor)(node.activeTerminal);
61
+ });
62
+ }
63
+
64
+ return source;
65
+ };
66
+
52
67
  return /*#__PURE__*/_react["default"].createElement("div", {
53
68
  className: "render_wrap",
54
69
  magic_design: "",
55
70
  style: {
56
71
  background: window.magicDesign.pageBackground
57
72
  }
58
- }, pageData && pageData.childNodes && pageData.childNodes.map(function (nodeData) {
73
+ }, filterCompFloor().map(function (nodeData) {
59
74
  var Clazz = _componentTypes.componentMap[nodeData.type];
60
75
 
61
76
  if (!Clazz) {
@@ -15,9 +15,17 @@ Object.defineProperty(exports, "metaDecorator", {
15
15
  return _metaDecorator["default"];
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "updateConfigDecorator", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _updateConfigDecorator["default"];
22
+ }
23
+ });
18
24
 
19
25
  var _compositeDecorator = _interopRequireDefault(require("./compositeDecorator"));
20
26
 
21
27
  var _metaDecorator = _interopRequireDefault(require("./metaDecorator"));
22
28
 
29
+ var _updateConfigDecorator = _interopRequireDefault(require("./updateConfigDecorator"));
30
+
23
31
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = updateConfigDecorator;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _constants = require("../constants");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+
14
+ var __extends = void 0 && (void 0).__extends || function () {
15
+ var _extendStatics = function extendStatics(d, b) {
16
+ _extendStatics = Object.setPrototypeOf || {
17
+ __proto__: []
18
+ } instanceof Array && function (d, b) {
19
+ d.__proto__ = b;
20
+ } || function (d, b) {
21
+ for (var p in b) {
22
+ if (b.hasOwnProperty(p)) d[p] = b[p];
23
+ }
24
+ };
25
+
26
+ return _extendStatics(d, b);
27
+ };
28
+
29
+ return function (d, b) {
30
+ _extendStatics(d, b);
31
+
32
+ function __() {
33
+ this.constructor = d;
34
+ }
35
+
36
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
37
+ };
38
+ }();
39
+ /**
40
+ * 更新组件一级配置面板的装修器
41
+ */
42
+
43
+
44
+ function updateConfigDecorator(WrappedComponent) {
45
+ var Wrapper =
46
+ /** @class */
47
+ function (_super) {
48
+ __extends(Wrapper, _super);
49
+
50
+ function Wrapper() {
51
+ var _this = _super !== null && _super.apply(this, arguments) || this;
52
+
53
+ _this.update = function () {
54
+ _this.setState({});
55
+ };
56
+
57
+ return _this;
58
+ }
59
+
60
+ Wrapper.prototype.componentDidMount = function () {
61
+ window.document.addEventListener(_constants.eventType.UPDATE_FIRST_CONFIG, this.update);
62
+ };
63
+
64
+ Wrapper.prototype.componentWillUnmount = function () {
65
+ window.document.removeEventListener(_constants.eventType.UPDATE_FIRST_CONFIG, this.update);
66
+ };
67
+
68
+ Wrapper.prototype.render = function () {
69
+ return /*#__PURE__*/_react["default"].createElement(WrappedComponent, this.props);
70
+ };
71
+
72
+ return Wrapper;
73
+ }(_react["default"].Component);
74
+
75
+ return Wrapper;
76
+ }
@@ -1,4 +1,14 @@
1
1
  {
2
+ "PLEASE_INPUT_KEYWORDS": "Please input keywords",
3
+ "SHOPPING_CART": "Shopping Cart",
4
+ "ADD_BUTTON": "Add Button",
5
+ "BUTTON_TAG": "Button Tag",
6
+ "ADD_TAG": "Add Tag",
7
+ "LAST_CATEGORY": "Last Category",
8
+ "SECONDARY_CATEGORY": "Secondary Category",
9
+ "FIRST_CATEGORY": "First Category",
10
+ "ALL_CATEGORY": "All Category",
11
+ "HOME": "Home",
2
12
  "ADD_CLICKABLE_AREA": "Add Clickable Area",
3
13
  "ADD_AREA": "Add Area",
4
14
  "CLICKABLE_AREA": "Clickable Area",
@@ -87,7 +97,6 @@
87
97
  "INPUT_FIELD": "Input Field",
88
98
  "CONFIRMATION": "Confirmation",
89
99
  "IMAGE_TAG": "Image Tag",
90
- "BUTTON_TAG": "Button Tag",
91
100
  "SECONDARY_BUTTON_TAG": "Secondary Button Tag",
92
101
  "TITLE": "Title",
93
102
  "HOVER": "Hover",
@@ -1,4 +1,14 @@
1
1
  {
2
+ "PLEASE_INPUT_KEYWORDS": "Please input keywords",
3
+ "SHOPPING_CART": "Shopping Cart",
4
+ "ADD_BUTTON": "Add Button",
5
+ "BUTTON_TAG": "Etiqueta de botón",
6
+ "ADD_TAG": "Add Tag",
7
+ "LAST_CATEGORY": "Last Category",
8
+ "SECONDARY_CATEGORY": "Secondary Category",
9
+ "FIRST_CATEGORY": "First Category",
10
+ "ALL_CATEGORY": "All Category",
11
+ "HOME": "Home",
2
12
  "ADD_CLICKABLE_AREA": "Add Clickable Area",
3
13
  "ADD_AREA": "Add Area",
4
14
  "CLICKABLE_AREA": "Clickable Area",
@@ -87,7 +97,6 @@
87
97
  "INPUT_FIELD": "Campo de entrada",
88
98
  "CONFIRMATION": "Confirmación",
89
99
  "IMAGE_TAG": "Etiqueta de imagen",
90
- "BUTTON_TAG": "Etiqueta de botón",
91
100
  "SECONDARY_BUTTON_TAG": "Etiqueta de botón secundario",
92
101
  "TITLE": "Título",
93
102
  "HOVER": "Hover",
@@ -1,4 +1,14 @@
1
1
  {
2
+ "PLEASE_INPUT_KEYWORDS": "Please input keywords",
3
+ "SHOPPING_CART": "Shopping Cart",
4
+ "ADD_BUTTON": "Add Button",
5
+ "BUTTON_TAG": "Button Tag",
6
+ "ADD_TAG": "Add Tag",
7
+ "LAST_CATEGORY": "Last Category",
8
+ "SECONDARY_CATEGORY": "Secondary Category",
9
+ "FIRST_CATEGORY": "First Category",
10
+ "ALL_CATEGORY": "All Category",
11
+ "HOME": "Home",
2
12
  "ADD_CLICKABLE_AREA": "Add Clickable Area",
3
13
  "ADD_AREA": "Add Area",
4
14
  "CLICKABLE_AREA": "Clickable Area",
@@ -87,7 +97,6 @@
87
97
  "INPUT_FIELD": "Input Field",
88
98
  "CONFIRMATION": "Confirmation",
89
99
  "IMAGE_TAG": "Image Tag",
90
- "BUTTON_TAG": "Button Tag",
91
100
  "SECONDARY_BUTTON_TAG": "Secondary Button Tag",
92
101
  "TITLE": "Title",
93
102
  "HOVER": "Hover",
@@ -90,14 +90,14 @@ function (_super) {
90
90
 
91
91
  _this.preData = '';
92
92
  return _this;
93
- }
93
+ } // 会影响到 button 的 hover style 失效
94
+ // shouldComponentUpdate(nextProps) {
95
+ // const should1 = JSON.stringify(nextProps.data) != this.preData;
96
+ // const should2 = window.magicDesign.device != this.preDevice;
97
+ // const result = should1 || should2;
98
+ // return result;
99
+ // }
94
100
 
95
- Button.prototype.shouldComponentUpdate = function (nextProps) {
96
- var should1 = JSON.stringify(nextProps.data) != this.preData;
97
- var should2 = window.magicDesign.device != this.preDevice;
98
- var result = should1 || should2;
99
- return result;
100
- };
101
101
 
102
102
  Button.prototype.render = function () {
103
103
  var _this = this;
@@ -172,7 +172,7 @@ function (_super) {
172
172
  })
173
173
  }, (iconLayout === 'right' || iconLayout === 'bottom') && btnText, iconUrl && /*#__PURE__*/_react["default"].createElement("img", {
174
174
  alt: "",
175
- className: "item",
175
+ className: "icon",
176
176
  src: iconUrl
177
177
  }), (iconLayout === 'left' || iconLayout === 'top') && btnText));
178
178
  };
@@ -2,6 +2,7 @@
2
2
  transition: all 0.25s;
3
3
 
4
4
  .btnContent {
5
+ width: 100%;
5
6
  cursor: pointer;
6
7
  display: inline-flex;
7
8
  align-items: center;
@@ -12,6 +13,10 @@
12
13
  flex-direction: row;
13
14
  }
14
15
 
16
+ .item {
17
+ width: 100%;
18
+ }
19
+
15
20
  img {
16
21
  height: 20px;
17
22
  margin: 0 5px;
@@ -86,7 +86,7 @@ function (_super) {
86
86
 
87
87
  if (data.hover.open && data.hover.backgroundType === 'enlarge' && (hoverState || hoverImgSrc)) {
88
88
  // return { transform: `scale(${data.hover.magnification})` };
89
- obj.transform = "scale(" + data.hover.magnification / 2 + ")";
89
+ obj.transform = "scale(" + data.hover.magnification + ")";
90
90
  }
91
91
 
92
92
  if (maxHeight) {
@@ -102,7 +102,8 @@ var contentStyle = function contentStyle(content) {
102
102
  color: content.color,
103
103
  backgroundColor: content.backgroundColor,
104
104
  textAlign: content.textAlign,
105
- width: window.magicDesign.device == 'mobile' ? '100%' : content.width || 'fit-content'
105
+ // width: (window.magicDesign.device == 'pc' ? content.pcWidth : content.width) || 'fit-content',
106
+ width: (window.magicDesign.device == 'pc' ? content.pcWidth : content.width) || '100%'
106
107
  };
107
108
  };
108
109
  /** 从父级数组中 分离出 片段数组 */
@@ -256,7 +257,8 @@ var initSelectionEvent = function initSelectionEvent() {
256
257
  }
257
258
 
258
259
  findSelectionTarget.refresh();
259
- }
260
+ } // todo 不知道干什么用的
261
+
260
262
 
261
263
  triggerTextConfigRender();
262
264
  }, 500);
@@ -429,12 +431,21 @@ function (_super) {
429
431
  className = _a.className,
430
432
  readonly = _a.readonly,
431
433
  onTextInput = _a.onTextInput;
434
+ var style = contentStyle(data.content);
435
+
436
+ if (data.underline) {
437
+ style = __assign(__assign({}, style), {
438
+ textDecorationLine: data.underline.open ? 'underline' : 'none',
439
+ textDecorationColor: data.underline.textDecorationColor,
440
+ textDecorationStyle: data.underline.textDecorationStyle
441
+ });
442
+ } // const style: React.CSSProperties = {
443
+ // ...contentStyle(data.content),
444
+ // textDecorationLine: data?.underline.open ? 'underline' : 'none',
445
+ // textDecorationColor: data?.underline.textDecorationColor,
446
+ // textDecorationStyle: data?.underline.textDecorationStyle,
447
+ // };
432
448
 
433
- var style = __assign(__assign({}, contentStyle(data.content)), {
434
- textDecorationLine: data.underline.open ? 'underline' : 'none',
435
- textDecorationColor: data.underline.textDecorationColor,
436
- textDecorationStyle: data.underline.textDecorationStyle
437
- });
438
449
 
439
450
  return /*#__PURE__*/_react["default"].createElement("div", {
440
451
  ref: this.textRef,
@@ -48,14 +48,6 @@ function (_super) {
48
48
 
49
49
  function BaseConfig() {
50
50
  var _this = _super !== null && _super.apply(this, arguments) || this;
51
- /**
52
- *重新渲染展示区域
53
- */
54
-
55
-
56
- _this.reRenderViewArea = function () {
57
- (0, _coreUtil.renderPreview)();
58
- };
59
51
  /**
60
52
  * 重新渲染一级配置面板
61
53
  */
@@ -67,10 +59,16 @@ function (_super) {
67
59
  */
68
60
 
69
61
 
70
- _this.selfRender = function () {
62
+ _this.selfRender = function (data) {
63
+ var changeHistory = true;
64
+
65
+ if (data && data.type === 'text-render') {
66
+ changeHistory = false;
67
+ }
68
+
71
69
  _this.setState({});
72
70
 
73
- _this.reRenderViewArea();
71
+ (0, _coreUtil.renderPreview)(changeHistory);
74
72
  };
75
73
 
76
74
  return _this;
@@ -15,6 +15,8 @@ require("./index.less");
15
15
 
16
16
  var _locale = require("../../../locale");
17
17
 
18
+ var _constants = require("../../../constants");
19
+
18
20
  var _common = require("../../../common");
19
21
 
20
22
  var _SpacingConfig = _interopRequireDefault(require("../../../composite-comp/common/config-panels/SpacingConfig"));
@@ -273,17 +275,22 @@ function (_super) {
273
275
  })), /*#__PURE__*/_react["default"].createElement(_common.Field, {
274
276
  title: (0, _locale.i18n)('CONTENT_WIDTH')
275
277
  }, /*#__PURE__*/_react["default"].createElement(_common.Slider, {
276
- maxVal: 1760,
278
+ maxVal: _constants.deviceTypeWidthMap[window.magicDesign.device],
277
279
  minVal: 0,
278
280
  onChange: function onChange(_a) {
279
281
  var count = _a.count;
280
- textData.width = count;
282
+
283
+ if (window.magicDesign.device == 'pc') {
284
+ textData.pcWidth = count;
285
+ } else {
286
+ textData.width = count;
287
+ }
281
288
 
282
289
  _this.selfRender();
283
290
  },
284
291
  unit: "px",
285
292
  value: {
286
- count: textData.width
293
+ count: window.magicDesign.device == 'pc' ? textData.pcWidth : textData.width
287
294
  }
288
295
  })))
289
296
  }, {
package/lib/mobx/Store.js CHANGED
@@ -13,6 +13,9 @@ var _storeUtil = require("../utils/storeUtil");
13
13
 
14
14
  var debug = require('debug')('worker:mobx');
15
15
 
16
+ var CACHE_KEY = 'STORE';
17
+ var whiteList = ['hoveredMeta', 'clickedMeta', 'clickedGroup', 'clickedFloor', 'textSelection', 'MPageData'];
18
+
16
19
  var Store =
17
20
  /** @class */
18
21
  function () {
@@ -34,6 +37,7 @@ function () {
34
37
  this.CarouselStore = {}; // 轮播组件暂存数据
35
38
 
36
39
  (0, _mobx.makeObservable)(this, {
40
+ MPageData: _mobx.observable,
37
41
  locale: _mobx.observable,
38
42
  hoveredMeta: _mobx.observable,
39
43
  clickedMeta: _mobx.observable,
@@ -54,6 +58,7 @@ function () {
54
58
  propertyList.forEach(function (field) {
55
59
  _this[field] = data[field];
56
60
  });
61
+ (0, _storeUtil.persistence)(CACHE_KEY, this, whiteList);
57
62
  };
58
63
  /**
59
64
  *根据groupId 获取楼层Id
@@ -87,15 +92,6 @@ function () {
87
92
  return componentFloor.id;
88
93
  };
89
94
 
90
- Store.prototype.getFloorInfo = function () {
91
- var _this = this;
92
-
93
- var componentFloor = this.MPageData.find(function (floor) {
94
- return floor.id === _this.clickedFloor;
95
- });
96
- return componentFloor;
97
- };
98
-
99
95
  return Store;
100
96
  }();
101
97
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setMagicDesign = exports.renderPreview = exports.isPc = exports.isDesignMode = exports.copyNode = exports.clickUrl = void 0;
6
+ exports.setMagicDesign = exports.renderPreview = exports.isPc = exports.isDesignMode = exports.isActiveFloor = exports.copyNode = exports.clickUrl = void 0;
7
7
 
8
8
  var _uuid = require("uuid");
9
9
 
@@ -33,6 +33,13 @@ var __assign = void 0 && (void 0).__assign || function () {
33
33
 
34
34
  var _this = void 0;
35
35
 
36
+ /** 根据楼层设置的终端类型,判断是否展示该楼层 */
37
+ var isActiveFloor = function isActiveFloor(activeTerminal) {
38
+ return activeTerminal === 'ALL' || activeTerminal === window.magicDesign.device.toUpperCase();
39
+ };
40
+
41
+ exports.isActiveFloor = isActiveFloor;
42
+
36
43
  var isDesignMode = function isDesignMode() {
37
44
  return window.magicDesign.mode === 'designer';
38
45
  };
@@ -53,10 +60,15 @@ var setMagicDesign = function setMagicDesign(magicDesignObj) {
53
60
 
54
61
  exports.setMagicDesign = setMagicDesign;
55
62
 
56
- var renderPreview = function renderPreview() {
63
+ var renderPreview = function renderPreview(changeHistory) {
64
+ if (changeHistory === void 0) {
65
+ changeHistory = true;
66
+ }
67
+
57
68
  var evt = new Event('render-view', {
58
69
  bubbles: false
59
70
  });
71
+ evt.changeHistory = changeHistory;
60
72
  window.document.dispatchEvent(evt);
61
73
  };
62
74
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "0.0.56",
4
+ "version": "0.0.60",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",
@@ -36,6 +36,91 @@
36
36
  "shortid": "^2.2.16",
37
37
  "slick-carousel": "^1.8.1"
38
38
  },
39
+ "devDependencies": {
40
+ "@babel/core": "^7.16.0",
41
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
42
+ "@rollup/plugin-babel": "^5.3.1",
43
+ "@rollup/plugin-commonjs": "^22.0.0",
44
+ "@rollup/plugin-image": "^2.1.1",
45
+ "@rollup/plugin-json": "^4.1.0",
46
+ "@rollup/plugin-node-resolve": "^13.3.0",
47
+ "@svgr/webpack": "^5.5.0",
48
+ "@types/axios": "^0.14.0",
49
+ "@types/lodash": "^4.14.182",
50
+ "@types/node": "^17.0.36",
51
+ "@types/react": "^18.0.9",
52
+ "@types/react-color": "^3.0.6",
53
+ "@types/react-dom": "^18.0.5",
54
+ "@types/uuid": "^8.3.4",
55
+ "@typescript-eslint/eslint-plugin": "^5.27.1",
56
+ "add": "^2.0.6",
57
+ "babel-loader": "^8.2.3",
58
+ "babel-plugin-named-asset-import": "^0.3.8",
59
+ "babel-preset-react-app": "^10.0.1",
60
+ "bfj": "^7.0.2",
61
+ "browserslist": "^4.18.1",
62
+ "camelcase": "^6.2.1",
63
+ "case-sensitive-paths-webpack-plugin": "^2.4.0",
64
+ "child_process": "^1.0.2",
65
+ "classnames": "^2.3.1",
66
+ "css-loader": "^6.5.1",
67
+ "css-minimizer-webpack-plugin": "^3.2.0",
68
+ "dotenv": "^10.0.0",
69
+ "dotenv-expand": "^5.1.0",
70
+ "eslint": "7",
71
+ "eslint-config-next": "^12.1.6",
72
+ "eslint-config-react-app": "^7.0.1",
73
+ "eslint-webpack-plugin": "^3.1.1",
74
+ "extract-zip": "^2.0.1",
75
+ "file-loader": "^6.2.0",
76
+ "fs-extra": "^10.0.0",
77
+ "gulp": "4.0.2",
78
+ "gulp-less": "5.0.0",
79
+ "gulp-postcss": "9.0.1",
80
+ "gulp-rename": "2.0.0",
81
+ "html-webpack-plugin": "^5.5.0",
82
+ "http-proxy-middleware": "^2.0.6",
83
+ "identity-obj-proxy": "^3.0.0",
84
+ "less": "3.13.1",
85
+ "less-loader": "^11.0.0",
86
+ "mini-css-extract-plugin": "^2.4.5",
87
+ "mv": "^2.1.1",
88
+ "ora": "^4.1.1",
89
+ "postcss": "^8.4.4",
90
+ "postcss-flexbugs-fixes": "^5.0.2",
91
+ "postcss-less": "6.0.0",
92
+ "postcss-loader": "^6.2.1",
93
+ "postcss-normalize": "^10.0.1",
94
+ "postcss-preset-env": "^7.0.1",
95
+ "postcss-px-to-viewport": "^1.1.1",
96
+ "postcss-selector-namespace": "^3.0.1",
97
+ "prompts": "^2.4.2",
98
+ "rc-tools": "^9.6.1-alpha.1",
99
+ "react": "^16.11.0",
100
+ "react-app-polyfill": "^3.0.0",
101
+ "react-dev-utils": "^12.0.1",
102
+ "react-dom": "^16.11.0",
103
+ "react-refresh": "^0.11.0",
104
+ "resolve": "^1.20.0",
105
+ "resolve-url-loader": "^4.0.0",
106
+ "rollup-plugin-dts": "^4.2.2",
107
+ "rollup-plugin-peer-deps-external": "^2.2.4",
108
+ "rollup-plugin-postcss": "^4.0.2",
109
+ "rollup-plugin-styles": "^4.0.0",
110
+ "rollup-plugin-typescript2": "^0.32.1",
111
+ "sass-loader": "^12.3.0",
112
+ "semver": "^7.3.5",
113
+ "source-map-loader": "^3.0.0",
114
+ "style-loader": "^3.3.1",
115
+ "tailwindcss": "^3.0.2",
116
+ "terser-webpack-plugin": "^5.2.5",
117
+ "typescript": "^4.7.2",
118
+ "web-vitals": "^2.1.4",
119
+ "webpack": "^5.64.4",
120
+ "webpack-dev-server": "^4.6.0",
121
+ "webpack-manifest-plugin": "^4.0.2",
122
+ "workbox-webpack-plugin": "^6.4.1"
123
+ },
39
124
  "peerDependencies": {
40
125
  "react": ">=16.11.0",
41
126
  "react-dom": ">=16.11.0"