@fonixtree/magic-design 0.0.55 → 0.0.58

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 (138) hide show
  1. package/es/assets/fonts/magic-box-iconfont.css +7 -7
  2. package/es/assets/fonts/magic-box-iconfont.css.bak +7 -7
  3. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  4. package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
  5. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  6. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  7. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  8. package/es/assets/images/layout-icon/layout-navigation-normal.png +0 -0
  9. package/es/common/GroupList/index.js +2 -3
  10. package/es/common/ImgArea/components/MultiCrops.js +210 -0
  11. package/es/common/LinkModal/index.less +1 -1
  12. package/es/composite-comp/bol/components/Button/defaultJSON.js +38 -68
  13. package/es/composite-comp/bol/components/Button/index.js +7 -9
  14. package/es/composite-comp/bol/components/Button/index.less +1 -0
  15. package/es/composite-comp/bol/components/Carousel/mobile/index.js +3 -7
  16. package/es/composite-comp/bol/components/Carousel/pc/index.js +2 -2
  17. package/es/composite-comp/bol/components/Tag/defaultJSON.js +36 -46
  18. package/es/composite-comp/bol/components/Tag/index.js +7 -9
  19. package/es/composite-comp/bol/components/Tag/index.less +1 -0
  20. package/es/composite-comp/bol/components/Text/defaultJSON.js +1 -1
  21. package/es/composite-comp/bol/components/Text/index.js +3 -3
  22. package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -1
  23. package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +141 -0
  24. package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.less +16 -0
  25. package/es/composite-comp/bol/config-panels/ButtonCompConfig/index.js +3 -3
  26. package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +1 -1
  27. package/es/composite-comp/bol/config-panels/CarouselConfig/index.js +1 -0
  28. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +6 -16
  29. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +141 -0
  30. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.less +16 -0
  31. package/es/composite-comp/bol/config-panels/TagCompConfig/index.js +1 -0
  32. package/es/composite-comp/bol/second-config-panels/BannerSecondConfig/index.js +2 -6
  33. package/es/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.js +103 -0
  34. package/es/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.less +3 -0
  35. package/es/composite-comp/bol/{config-panels/ButtonCompConfig/ButtonConfigContent → second-config-panels/TagSecondConfig}/index.js +40 -38
  36. package/es/composite-comp/bol/second-config-panels/TagSecondConfig/index.less +3 -0
  37. package/es/composite-comp/common/config-panels/SpacingConfig/index.js +8 -8
  38. package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +16 -0
  39. package/es/composite-comp/dito/components/PcNavigation/defaultJSON.js +131 -0
  40. package/es/composite-comp/dito/components/PcNavigation/images/menu-icon.svg +6 -0
  41. package/es/composite-comp/dito/components/PcNavigation/index.js +85 -0
  42. package/es/composite-comp/dito/components/PcNavigation/pc/index.js +452 -0
  43. package/es/composite-comp/dito/components/PcNavigation/pc/index.less +95 -0
  44. package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +11 -1
  45. package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +117 -0
  46. package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +126 -0
  47. package/es/composite-comp/dito/config-panels/PcNavigationConfig/TextOnlyFontConfig/index.js +222 -0
  48. package/es/composite-comp/dito/config-panels/PcNavigationConfig/index.js +195 -0
  49. package/es/composite-comp/dito/second-config-panels/PcNavigationSecondConfig/index.js +102 -0
  50. package/es/constants/component-types.js +13 -3
  51. package/es/constants/index.js +20 -2
  52. package/es/constants/layout.js +10 -2
  53. package/es/core/Designer/ConfigPanel/index.js +48 -22
  54. package/es/core/Designer/History/index.js +36 -28
  55. package/es/core/Designer/index.js +17 -8
  56. package/es/decorator/compositeDecorator.js +1 -0
  57. package/es/decorator/index.js +8 -0
  58. package/es/decorator/updateConfigDecorator.js +76 -0
  59. package/es/locale/en/en.json +8 -1
  60. package/es/locale/es/es.json +8 -1
  61. package/es/locale/id/id.json +8 -1
  62. package/es/meta-comp/components/Button/index.js +7 -7
  63. package/es/meta-comp/components/Image/index.js +1 -1
  64. package/es/meta-comp/components/Text/index.js +18 -7
  65. package/es/meta-comp/config-panels/BaseConfig.js +8 -10
  66. package/es/meta-comp/config-panels/TextConfig/index.js +10 -3
  67. package/es/mobx/Store.js +1 -9
  68. package/es/utils/coreUtil.js +6 -1
  69. package/lib/assets/fonts/magic-box-iconfont.css +7 -7
  70. package/lib/assets/fonts/magic-box-iconfont.css.bak +7 -7
  71. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  72. package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
  73. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  74. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  75. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  76. package/lib/assets/images/layout-icon/layout-navigation-normal.png +0 -0
  77. package/lib/common/GroupList/index.js +2 -3
  78. package/lib/common/ImgArea/components/MultiCrops.js +210 -0
  79. package/lib/common/LinkModal/index.less +1 -1
  80. package/lib/composite-comp/bol/components/Button/defaultJSON.js +38 -68
  81. package/lib/composite-comp/bol/components/Button/index.js +7 -9
  82. package/lib/composite-comp/bol/components/Button/index.less +1 -0
  83. package/lib/composite-comp/bol/components/Carousel/mobile/index.js +3 -7
  84. package/lib/composite-comp/bol/components/Carousel/pc/index.js +2 -2
  85. package/lib/composite-comp/bol/components/Tag/defaultJSON.js +36 -46
  86. package/lib/composite-comp/bol/components/Tag/index.js +7 -9
  87. package/lib/composite-comp/bol/components/Tag/index.less +1 -0
  88. package/lib/composite-comp/bol/components/Text/defaultJSON.js +1 -1
  89. package/lib/composite-comp/bol/components/Text/index.js +3 -3
  90. package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -1
  91. package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +141 -0
  92. package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.less +16 -0
  93. package/lib/composite-comp/bol/config-panels/ButtonCompConfig/index.js +3 -3
  94. package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +1 -1
  95. package/lib/composite-comp/bol/config-panels/CarouselConfig/index.js +1 -0
  96. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +6 -16
  97. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +141 -0
  98. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.less +16 -0
  99. package/lib/composite-comp/bol/config-panels/TagCompConfig/index.js +1 -0
  100. package/lib/composite-comp/bol/second-config-panels/BannerSecondConfig/index.js +2 -6
  101. package/lib/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.js +103 -0
  102. package/lib/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.less +3 -0
  103. package/lib/composite-comp/bol/{config-panels/ButtonCompConfig/ButtonConfigContent → second-config-panels/TagSecondConfig}/index.js +40 -38
  104. package/lib/composite-comp/bol/second-config-panels/TagSecondConfig/index.less +3 -0
  105. package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +8 -8
  106. package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +16 -0
  107. package/lib/composite-comp/dito/components/PcNavigation/defaultJSON.js +131 -0
  108. package/lib/composite-comp/dito/components/PcNavigation/images/menu-icon.svg +6 -0
  109. package/lib/composite-comp/dito/components/PcNavigation/index.js +85 -0
  110. package/lib/composite-comp/dito/components/PcNavigation/pc/index.js +452 -0
  111. package/lib/composite-comp/dito/components/PcNavigation/pc/index.less +95 -0
  112. package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +11 -1
  113. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +117 -0
  114. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +126 -0
  115. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/TextOnlyFontConfig/index.js +222 -0
  116. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/index.js +195 -0
  117. package/lib/composite-comp/dito/second-config-panels/PcNavigationSecondConfig/index.js +102 -0
  118. package/lib/constants/component-types.js +13 -3
  119. package/lib/constants/index.js +20 -2
  120. package/lib/constants/layout.js +10 -2
  121. package/lib/core/Designer/ConfigPanel/index.js +48 -22
  122. package/lib/core/Designer/History/index.js +36 -28
  123. package/lib/core/Designer/index.js +17 -8
  124. package/lib/decorator/compositeDecorator.js +1 -0
  125. package/lib/decorator/index.js +8 -0
  126. package/lib/decorator/updateConfigDecorator.js +76 -0
  127. package/lib/locale/en/en.json +8 -1
  128. package/lib/locale/es/es.json +8 -1
  129. package/lib/locale/id/id.json +8 -1
  130. package/lib/meta-comp/components/Button/index.js +7 -7
  131. package/lib/meta-comp/components/Image/index.js +1 -1
  132. package/lib/meta-comp/components/Text/index.js +18 -7
  133. package/lib/meta-comp/config-panels/BaseConfig.js +8 -10
  134. package/lib/meta-comp/config-panels/TextConfig/index.js +10 -3
  135. package/lib/mobx/Store.js +1 -9
  136. package/lib/utils/coreUtil.js +6 -1
  137. package/package.json +1 -86
  138. package/README.md +0 -320
@@ -1,4 +1,12 @@
1
1
  {
2
+ "ADD_BUTTON": "Add Button",
3
+ "BUTTON_TAG": "Button Tag",
4
+ "ADD_TAG": "Add Tag",
5
+ "LAST_CATEGORY": "Last Category",
6
+ "SECONDARY_CATEGORY": "Secondary Category",
7
+ "FIRST_CATEGORY": "First Category",
8
+ "ALL_CATEGORY": "All Category",
9
+ "HOME": "Home",
2
10
  "ADD_CLICKABLE_AREA": "Add Clickable Area",
3
11
  "ADD_AREA": "Add Area",
4
12
  "CLICKABLE_AREA": "Clickable Area",
@@ -87,7 +95,6 @@
87
95
  "INPUT_FIELD": "Input Field",
88
96
  "CONFIRMATION": "Confirmation",
89
97
  "IMAGE_TAG": "Image Tag",
90
- "BUTTON_TAG": "Button Tag",
91
98
  "SECONDARY_BUTTON_TAG": "Secondary Button Tag",
92
99
  "TITLE": "Title",
93
100
  "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;
@@ -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
@@ -34,6 +34,7 @@ function () {
34
34
  this.CarouselStore = {}; // 轮播组件暂存数据
35
35
 
36
36
  (0, _mobx.makeObservable)(this, {
37
+ MPageData: _mobx.observable,
37
38
  locale: _mobx.observable,
38
39
  hoveredMeta: _mobx.observable,
39
40
  clickedMeta: _mobx.observable,
@@ -87,15 +88,6 @@ function () {
87
88
  return componentFloor.id;
88
89
  };
89
90
 
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
91
  return Store;
100
92
  }();
101
93
 
@@ -53,10 +53,15 @@ var setMagicDesign = function setMagicDesign(magicDesignObj) {
53
53
 
54
54
  exports.setMagicDesign = setMagicDesign;
55
55
 
56
- var renderPreview = function renderPreview() {
56
+ var renderPreview = function renderPreview(changeHistory) {
57
+ if (changeHistory === void 0) {
58
+ changeHistory = true;
59
+ }
60
+
57
61
  var evt = new Event('render-view', {
58
62
  bubbles: false
59
63
  });
64
+ evt.changeHistory = changeHistory;
60
65
  window.document.dispatchEvent(evt);
61
66
  };
62
67
 
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.55",
4
+ "version": "0.0.58",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",
@@ -36,91 +36,6 @@
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
- },
124
39
  "peerDependencies": {
125
40
  "react": ">=16.11.0",
126
41
  "react-dom": ">=16.11.0"
package/README.md DELETED
@@ -1,320 +0,0 @@
1
- # 快捷指令使用
2
-
3
- ## 1、发布 -- npm run pub
4
-
5
- ## 2、新增国际化 -- npm run cl "Hello world"
6
-
7
- ## 3、更新iconfont -- npm run iconfont
8
-
9
-
10
- # 设计器二期
11
-
12
- ## 1、基本概念
13
-
14
- ### 1.1、元组件:构成复合组件的最小单位
15
-
16
- Text、Image、Button、Divider、Video 等
17
-
18
- ### 1.2、复合组件:由若干个元组件构成的一个大组件
19
-
20
- Text、Banner、Image Gallery、Image and Text、Carousel、Reward、Newsletter 等
21
-
22
- ### 1.3、业务公共组件:项目中复用的公共组件
23
-
24
- 所有的公共组件需要开放 value 和 onChange Api(除 Button、Iconfont)
25
-
26
- Button、Iconfont、AlignSelecter、Collapse、ColorPicker、ImagePicker、LayoutSelecter、Slider、UrlPicker
27
-
28
- ## 2、元组件
29
-
30
- ### 2.1
31
-
32
- 元组件类型:
33
-
34
- TEXT、IMAGE、BUTTON、DIVIDER、VIDEO
35
-
36
- 元组件报文格式:
37
-
38
- ```json
39
- {
40
- id:'xxxx' //元组件key
41
- type: 'TYPE', //元组件类型
42
- style:{
43
- fontFamily:'xxx', //字体
44
- ...css //属性名称尽量使用标准css名称
45
- },
46
- hoverStyle:{
47
-
48
- }
49
- }
50
- ```
51
-
52
- 动态设置 hover 效果
53
-
54
- onMouseEnter={e => { e.target.style.color = 'red'; }}
55
-
56
- onMouseLeave={e => { e.target.style.color = 'white'; }}
57
-
58
- 文本可编辑
59
-
60
- contenteditable="true"
61
-
62
- ### 2.2 、元组件报文
63
-
64
- #### Text
65
-
66
- ```json
67
- {
68
- id:'xxxx' //元组件key
69
- type: 'TYPE', //元组件类型
70
- content:'this is text',
71
- style:{
72
- fontFamily:'xxx', //字体
73
- fontSize: '14px',
74
- width: '200px',
75
- ...css
76
- }
77
- }
78
- ```
79
-
80
- #### Image
81
-
82
- ```json
83
- {
84
- id:'xxxx' //元组件key
85
- type: 'IMAGE', //元组件类型
86
- name:'123.png',
87
- src:'../image.png', //图片地址
88
- url:'www.baidu.com', //图片跳转地址
89
- style:{
90
- width: '200px',
91
- ...css
92
- },
93
- hoverStyle:{ //hover 类型为new时保存src,类型为enlarge时保存scale
94
- scale: '2',
95
- src:'../image1.png',
96
- }
97
- }
98
- ```
99
-
100
- #### Button
101
-
102
- ```json
103
- {
104
- id:'xxxx' //元组件key
105
- type: 'BUTTON', //元组件类型
106
- name:'Submit',
107
- url: 'www.baidu.com',
108
- style:{
109
- buttonIconSrc:'../img.png',
110
- buttonIconPlace: 'left',
111
- color:'#FEFEFE',
112
- border: '1px solid red',
113
- borderRadius:'10px',
114
- fontFamily:'xxx', //字体
115
- fontSize: '14px',
116
- ...css
117
- },
118
- hoverStyle {
119
- color:'#FEFEFE',
120
- border: '1px solid red',
121
- fontFamily:'xxx', //字体
122
- fontSize: '14px',
123
- ...css
124
- }
125
- }
126
- ```
127
-
128
- ## 2、复合组件
129
-
130
- ### 2.1
131
-
132
- 元组件类型:
133
-
134
- TEXT、BANNER、IMAGE_GALLERT、IMAGE_TEXT、CAROUSEL、REWARD、NEWSLETTER
135
-
136
- 复合组件报文格式:
137
-
138
- ```json
139
- {
140
- id:'xxxx' //复合组件key
141
- type: 'TYPE', //复合组件类型
142
- setting:{ //开关类型的配置及属性配置放在这里
143
- autoplays: 3, //3秒轮播
144
- },
145
- groupSource:[], //元组件集合组数据放在这里
146
- metas:{
147
- title:{
148
- open:false,
149
- type:'IMAGE'
150
- ...metaCompJson
151
- },
152
- subTitle:{
153
- open:false,
154
- type:'IMAGE'
155
- ...metaCompJson
156
- }
157
- },
158
- customize:{
159
- layout:'',
160
- background:{
161
-
162
- }
163
- }
164
- }
165
- ```
166
-
167
- #### Text
168
-
169
- ```js
170
- {
171
- id: 'xxxx', //复合组件key
172
- type: 'TEXT', //复合组件类型
173
- setting:{
174
- layout:'left', // 模块布局 left/center/right ,每一个layout可能都是一个不同的组件
175
- title:{
176
- type:'TEXT'
177
- ...metaCompJson
178
- },
179
- subtitle:{
180
- type:'TEXT'
181
- ...metaCompJson
182
- },
183
- },
184
- source:[
185
- { //此处可以抽出业务组件
186
- title:{
187
- type:'TEXT'
188
- ...metaCompJson
189
- },
190
- content:{
191
- type:'TEXT'
192
- ...metaCompJson
193
- }
194
- }
195
- ],
196
- style:{
197
- align:'left', //文本布局 left/center/right
198
- backgroundColor: 'red',
199
- backgroundImage:'../image.png'
200
- }
201
- }
202
- ```
203
-
204
- #### Banner
205
-
206
- modifySetting
207
-
208
- ```json
209
- {
210
- "comositeId": "1111",
211
-
212
- "value": {
213
- "autoplays": 4
214
- }
215
- }
216
- ```
217
-
218
- ```json
219
- {
220
- id: 'xxxx',
221
- type: 'BANNER',
222
- setting:{
223
- open:false
224
- autoplays: 3, //3秒轮播
225
- arrows:{ // 滚动箭头
226
- open:false,
227
- color:'red',
228
- size:'',
229
- hoverSize:'',
230
- hoverColor:'green',
231
- },
232
- dots:{ //面板指示点
233
- open:false,
234
- color: 'red',
235
- size:'',
236
- hoverSize:''
237
- hoverColor:'green',
238
- },
239
- },
240
- groupSource:[
241
- { //此处可以作为一个业务组件
242
- id:'xxxxx',
243
- image:{
244
- open:false,
245
- type:'IMAGE'
246
- ...metaCompJson
247
- },
248
- title:{
249
- open:false,
250
- type:'TEXT',
251
- ...metaCompJson
252
- },
253
- content:{
254
- open:false,
255
- type:'TEXT',
256
- ...metaCompJson
257
- },
258
- button:{
259
- type:'BUTTON',
260
- ...metaCompJson
261
- },
262
- secondaryButton:{
263
- type:'BUTTON',
264
- ...metaCompJson
265
- },
266
- layout:'center',
267
- align:'left',
268
- //文本布局 left/center/right
269
- }
270
- ]
271
- }
272
- ```
273
-
274
- #### Image Gallery
275
-
276
- ```json
277
-
278
- ```
279
-
280
- #### Image and Text
281
-
282
- ```json
283
- {
284
- id:'xxxx'
285
- type: 'IMAGE_TEXT',
286
- setting:{
287
- layout:'left',
288
- title:{},
289
- subtitle:{},
290
- button:{},
291
- secondaryButton:{}
292
- },
293
- source:[
294
-
295
- ],
296
- style:{
297
- align:'left',
298
- backgroundColor:'red',
299
- backgroundImage:'./img.png'
300
- }
301
- }
302
- ```
303
-
304
- 疑问:
305
-
306
- Text 元组件
307
-
308
- 文字链接配置好之后,怎么删除
309
-
310
- 链接配置的规则,按单词还是字符
311
-
312
- image 元组件
313
-
314
- 属性控制进度条和输入框是否要限制最大最小值
315
-
316
- button 元组件
317
-
318
- 是否需要 icon 的 hover 效果
319
-
320
- banner 中的 text Align 放在元组件里?