@fonixtree/magic-design 0.1.80 → 0.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/assets/fonts/magic-box-iconfont.css +8 -4
- package/es/assets/fonts/magic-box-iconfont.css.bak +8 -4
- package/es/assets/fonts/magic-box-iconfont.js +1 -1
- package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/es/assets/less/button.less +5 -0
- package/es/common/AffiliateProductModal/index.js +1 -1
- package/es/common/AffiliateProductModal/index.less +1 -1
- package/es/common/Button/index.less +0 -1
- package/es/common/LinkModal/BundleCampaign/index.js +2 -2
- package/es/common/LinkModal/CouponTable/index.js +1 -1
- package/es/common/LinkModal/FilteredProductModal/index.js +82 -106
- package/es/common/LinkModal/FilteredProductModal/index.less +1 -0
- package/es/common/LinkModal/ProductDetailPage/index.js +115 -60
- package/es/common/LinkModal/ProductDetailPage/index.less +6 -1
- package/es/common/MagicLink/index.js +2 -2
- package/es/common/ProductModal/index.js +144 -100
- package/es/common/ProductModal/index.less +7 -1
- package/es/common/ProductSource/index.js +81 -21
- package/es/common/UrlPicker/AnchorModal/index.js +170 -0
- package/es/common/UrlPicker/AnchorModal/index.less +21 -0
- package/es/common/UrlPicker/index.js +61 -11
- package/es/composite-comp/dito/components/HeadNavigation/defaultJSON.js +22 -17
- package/es/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +27 -24
- package/es/composite-comp/dito/components/Recommend/pc/index.js +1 -1
- package/es/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +25 -27
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +4 -2
- package/es/constants/index.js +14 -4
- package/es/core/Designer/PageCompList/index.js +1 -1
- package/es/core/Designer/QuickMenuBar/index.js +6 -2
- package/es/core/Designer/index.js +11 -1
- package/es/decorator/metaDecorator.js +1 -1
- package/es/locale/en/en.json +5 -1
- package/es/locale/es/es.json +5 -1
- package/es/locale/id/id.json +5 -1
- package/es/utils/businessUtil.js +13 -2
- package/es/utils/commonUtil.js +14 -6
- package/es/utils/coreUtil.js +43 -2
- package/lib/assets/fonts/magic-box-iconfont.css +8 -4
- package/lib/assets/fonts/magic-box-iconfont.css.bak +8 -4
- package/lib/assets/fonts/magic-box-iconfont.js +1 -1
- package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/lib/assets/less/button.less +5 -0
- package/lib/common/AffiliateProductModal/index.js +1 -1
- package/lib/common/AffiliateProductModal/index.less +1 -1
- package/lib/common/Button/index.less +0 -1
- package/lib/common/LinkModal/BundleCampaign/index.js +2 -2
- package/lib/common/LinkModal/CouponTable/index.js +1 -1
- package/lib/common/LinkModal/FilteredProductModal/index.js +82 -106
- package/lib/common/LinkModal/FilteredProductModal/index.less +1 -0
- package/lib/common/LinkModal/ProductDetailPage/index.js +115 -60
- package/lib/common/LinkModal/ProductDetailPage/index.less +6 -1
- package/lib/common/MagicLink/index.js +2 -2
- package/lib/common/ProductModal/index.js +144 -100
- package/lib/common/ProductModal/index.less +7 -1
- package/lib/common/ProductSource/index.js +81 -21
- package/lib/common/UrlPicker/AnchorModal/index.js +170 -0
- package/lib/common/UrlPicker/AnchorModal/index.less +21 -0
- package/lib/common/UrlPicker/index.js +61 -11
- package/lib/composite-comp/dito/components/HeadNavigation/defaultJSON.js +22 -17
- package/lib/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +27 -24
- package/lib/composite-comp/dito/components/Recommend/pc/index.js +1 -1
- package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +25 -27
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +4 -2
- package/lib/constants/index.js +14 -4
- package/lib/core/Designer/PageCompList/index.js +1 -1
- package/lib/core/Designer/QuickMenuBar/index.js +6 -2
- package/lib/core/Designer/index.js +11 -1
- package/lib/decorator/metaDecorator.js +1 -1
- package/lib/locale/en/en.json +5 -1
- package/lib/locale/es/es.json +5 -1
- package/lib/locale/id/id.json +5 -1
- package/lib/utils/businessUtil.js +13 -2
- package/lib/utils/commonUtil.js +14 -6
- package/lib/utils/coreUtil.js +43 -2
- package/package.json +1 -1
|
@@ -183,7 +183,11 @@ function (_super) {
|
|
|
183
183
|
type: "light"
|
|
184
184
|
}, (0, _locale.i18n)('SAVE'))) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
185
185
|
className: "menu_right"
|
|
186
|
-
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
186
|
+
}, window.magicDesign.templateType === _constants.tempTypeMap.PAGE && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
187
|
+
"data-code": _constants.quickMenuCode.SET_AS_TEMPLATE,
|
|
188
|
+
onClick: this.onBtnClick,
|
|
189
|
+
type: "text"
|
|
190
|
+
}, (0, _locale.i18n)('SET_AS_TEMPLATE')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
187
191
|
"data-code": _constants.quickMenuCode.PREVIEW,
|
|
188
192
|
onClick: this.onBtnClick
|
|
189
193
|
}, (0, _locale.i18n)('PREVIEW')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
@@ -200,7 +204,7 @@ function (_super) {
|
|
|
200
204
|
onClick: this.onBtnClick,
|
|
201
205
|
tip: "The page is in use. Please copy or create a new page",
|
|
202
206
|
type: "primary"
|
|
203
|
-
}, (0, _locale.i18n)('PUBLISH_NOW'), /*#__PURE__*/_react["default"].createElement(_antd.Dropdown, {
|
|
207
|
+
}, (0, _locale.i18n)('PUBLISH_NOW'), window.magicDesign.templateType === 'Page' && /*#__PURE__*/_react["default"].createElement(_antd.Dropdown, {
|
|
204
208
|
getPopupContainer: function getPopupContainer() {
|
|
205
209
|
return document.querySelector('.publish_wrap');
|
|
206
210
|
},
|
|
@@ -467,7 +467,9 @@ function (_super) {
|
|
|
467
467
|
var _a = _this.props,
|
|
468
468
|
onPublish = _a.onPublish,
|
|
469
469
|
onSave = _a.onSave,
|
|
470
|
-
onPreviews = _a.onPreviews
|
|
470
|
+
onPreviews = _a.onPreviews,
|
|
471
|
+
onPush = _a.onPush,
|
|
472
|
+
onSetAsTemp = _a.onSetAsTemp;
|
|
471
473
|
var _b = _this.state,
|
|
472
474
|
device = _b.device,
|
|
473
475
|
MPageData = _b.MPageData;
|
|
@@ -502,6 +504,14 @@ function (_super) {
|
|
|
502
504
|
|
|
503
505
|
break;
|
|
504
506
|
|
|
507
|
+
case _constants.quickMenuCode.PUSH:
|
|
508
|
+
onPush(handleParams);
|
|
509
|
+
break;
|
|
510
|
+
|
|
511
|
+
case _constants.quickMenuCode.SET_AS_TEMPLATE:
|
|
512
|
+
onSetAsTemp(handleParams);
|
|
513
|
+
break;
|
|
514
|
+
|
|
505
515
|
case _constants.quickMenuCode.PUBLISH:
|
|
506
516
|
onPublish(handleParams);
|
|
507
517
|
break;
|
|
@@ -95,7 +95,7 @@ function metaDecorator(WrappedComponent) {
|
|
|
95
95
|
GAData = _c.GAData;
|
|
96
96
|
(0, _commonUtil.pushGA)(__assign(__assign({}, GAData), {
|
|
97
97
|
elementId: data.id,
|
|
98
|
-
elementName: data.text || GAData.groupName
|
|
98
|
+
elementName: data.text || (GAData === null || GAData === void 0 ? void 0 : GAData.groupName)
|
|
99
99
|
}));
|
|
100
100
|
return;
|
|
101
101
|
} // 组织冒泡
|
package/es/locale/en/en.json
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
+
"ANCHOR": "Anchor",
|
|
3
|
+
"PUSH": "Push",
|
|
4
|
+
"SET_AS_TEMPLATE": "Set as Template",
|
|
2
5
|
"DISPLAY_PAGE": "Display page",
|
|
3
6
|
"NAME": "Name",
|
|
4
7
|
"ADD_MENU": "Add Menu",
|
|
@@ -95,7 +98,8 @@
|
|
|
95
98
|
"BANNER_HEIGHT": "Banner Height",
|
|
96
99
|
"IMAGE": "Image",
|
|
97
100
|
"PRODUCT_NAME": "Product Name",
|
|
98
|
-
"
|
|
101
|
+
"SKU_CODE": "SKU Code",
|
|
102
|
+
"SPU_CODE": "SPU Code",
|
|
99
103
|
"SKU": "SKU",
|
|
100
104
|
"PRICE": "Price",
|
|
101
105
|
"BRAND": "Brand",
|
package/es/locale/es/es.json
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
+
"ANCHOR": "Anchor",
|
|
3
|
+
"PUSH": "Push",
|
|
4
|
+
"SET_AS_TEMPLATE": "Set as Template",
|
|
2
5
|
"DISPLAY_PAGE": "Display page",
|
|
3
6
|
"NAME": "Name",
|
|
4
7
|
"ADD_MENU": "Add Menu",
|
|
@@ -95,7 +98,8 @@
|
|
|
95
98
|
"BANNER_HEIGHT": "Altura del banner",
|
|
96
99
|
"IMAGE": "Imagen",
|
|
97
100
|
"PRODUCT_NAME": "Nombre del producto",
|
|
98
|
-
"
|
|
101
|
+
"SKU_CODE": "Código SKU",
|
|
102
|
+
"SPU_CODE": "Código spu",
|
|
99
103
|
"SKU": "SKU",
|
|
100
104
|
"PRICE": "Precio",
|
|
101
105
|
"BRAND": "Marca",
|
package/es/locale/id/id.json
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
+
"ANCHOR": "Anchor",
|
|
3
|
+
"PUSH": "Push",
|
|
4
|
+
"SET_AS_TEMPLATE": "Set as Template",
|
|
2
5
|
"DISPLAY_PAGE": "Display page",
|
|
3
6
|
"NAME": "Name",
|
|
4
7
|
"ADD_MENU": "Add Menu",
|
|
@@ -95,7 +98,8 @@
|
|
|
95
98
|
"BANNER_HEIGHT": "Banner Height",
|
|
96
99
|
"IMAGE": "Image",
|
|
97
100
|
"PRODUCT_NAME": "Product Name",
|
|
98
|
-
"
|
|
101
|
+
"SKU_CODE": "SKU Code",
|
|
102
|
+
"SPU_CODE": "SPU Code",
|
|
99
103
|
"SKU": "SKU",
|
|
100
104
|
"PRICE": "Price",
|
|
101
105
|
"BRAND": "Brand",
|
package/es/utils/businessUtil.js
CHANGED
|
@@ -31,7 +31,18 @@ var newParseUrl = function newParseUrl(urlObj) {
|
|
|
31
31
|
productId = urlObj.productId;
|
|
32
32
|
|
|
33
33
|
switch (type) {
|
|
34
|
+
// 锚点跳转
|
|
35
|
+
case _constants.urlTypeMap.ANCHOR:
|
|
36
|
+
params = {
|
|
37
|
+
action: 'operation',
|
|
38
|
+
params: {
|
|
39
|
+
type: 'ANCHOR',
|
|
40
|
+
data: value
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
break;
|
|
34
44
|
// 商品详情
|
|
45
|
+
|
|
35
46
|
case _constants.urlTypeMap.PRODUCT_DETAIL_PAGE:
|
|
36
47
|
if (offerId) {
|
|
37
48
|
link = "/product/detail/" + offerId + "?productId=" + (productId !== null && productId !== void 0 ? productId : '');
|
|
@@ -87,7 +98,7 @@ var newParseUrl = function newParseUrl(urlObj) {
|
|
|
87
98
|
// 商品列表
|
|
88
99
|
|
|
89
100
|
case _constants.urlTypeMap.FILTERED_PRODUCT:
|
|
90
|
-
link = "/product/list
|
|
101
|
+
link = "/product/list/?" + value;
|
|
91
102
|
params = {
|
|
92
103
|
action: 'jump',
|
|
93
104
|
params: {
|
|
@@ -261,7 +272,7 @@ var parseUrl = function parseUrl(url) {
|
|
|
261
272
|
// 商品列表
|
|
262
273
|
|
|
263
274
|
case _constants.urlType.PROD_FILTER:
|
|
264
|
-
link = "/product/list
|
|
275
|
+
link = "/product/list/?" + arg1;
|
|
265
276
|
params = {
|
|
266
277
|
action: 'jump',
|
|
267
278
|
params: {
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -291,14 +291,22 @@ var navigateTo = function navigateTo(url) {
|
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
294
|
+
var _a = url.split(';'),
|
|
295
|
+
h5Url = _a[0],
|
|
296
|
+
appUrl = _a[1]; // 未配置App路径并且h5绝对路径时直接跳转,其他情况让业务层处理
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
if (!appUrl && !h5Url.startsWith('/')) {
|
|
300
|
+
window.location.href = h5Url;
|
|
301
|
+
} else if (window.magicDesign.history) {
|
|
302
|
+
window.magicDesign.history.push(url);
|
|
303
|
+
} else if (window.magicDesign.navigatePreUrl) {
|
|
304
|
+
// 预览模式跳转
|
|
305
|
+
if (h5Url.startsWith('/')) {
|
|
298
306
|
window.location.href = "" + window.magicDesign.navigatePreUrl + url;
|
|
307
|
+
} else {
|
|
308
|
+
window.location.href = h5Url;
|
|
299
309
|
}
|
|
300
|
-
} else {
|
|
301
|
-
window.location.href = url;
|
|
302
310
|
}
|
|
303
311
|
};
|
|
304
312
|
|
package/es/utils/coreUtil.js
CHANGED
|
@@ -286,6 +286,22 @@ var getCoupon = function getCoupon(couponId) {
|
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
+
function isUrl(string) {
|
|
290
|
+
// var pattern = new RegExp('^(https?:\\/\\/)?' + // 协议
|
|
291
|
+
// '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // 域名
|
|
292
|
+
// '((\\d{1,3}\\.){3}\\d{1,3}))' + // 或者 IP (v4) 地址
|
|
293
|
+
// '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // 端口和路径
|
|
294
|
+
// '(\\?[;&a-z\\d%_.~+=-]*)?' + // 查询字符串
|
|
295
|
+
// '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
|
|
296
|
+
// return !!pattern.test(string);
|
|
297
|
+
try {
|
|
298
|
+
new URL(string);
|
|
299
|
+
return true;
|
|
300
|
+
} catch (_) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
289
305
|
var clickUrl = function clickUrl(url) {
|
|
290
306
|
if (url === void 0) {
|
|
291
307
|
url = '';
|
|
@@ -310,6 +326,17 @@ var clickUrl = function clickUrl(url) {
|
|
|
310
326
|
url: params.link
|
|
311
327
|
}
|
|
312
328
|
});
|
|
329
|
+
/** 锚点跳转 */
|
|
330
|
+
|
|
331
|
+
if (params.type === 'ANCHOR') {
|
|
332
|
+
(0, _commonUtil.ensure)(function () {
|
|
333
|
+
var nodeId = isPc() ? params.data.pcNodeId : params.data.mobileNodeId;
|
|
334
|
+
document.querySelector("#node-" + nodeId).scrollIntoView({
|
|
335
|
+
behavior: 'smooth'
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
313
340
|
|
|
314
341
|
if ((0, _androidUtil.browserVersion)().isAshitaApp) {
|
|
315
342
|
(0, _androidUtil.sendToApp)(data);
|
|
@@ -342,9 +369,23 @@ var clickUrl = function clickUrl(url) {
|
|
|
342
369
|
}
|
|
343
370
|
|
|
344
371
|
return;
|
|
372
|
+
} // 输入的是完整的跳转地址
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
if (isUrl(link)) {
|
|
376
|
+
if (!link.includes(window.location.host)) {
|
|
377
|
+
// 跳转外链 需要把userToken带上
|
|
378
|
+
if (link.includes('?')) {
|
|
379
|
+
var a = link + "&userToken=" + (localStorage.getItem('h5Token') || '');
|
|
380
|
+
window.open(a);
|
|
381
|
+
} else {
|
|
382
|
+
var a = link + "?userToken=" + (localStorage.getItem('h5Token') || '');
|
|
383
|
+
window.open(a);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
} else {
|
|
387
|
+
(0, _commonUtil.navigateTo)(link);
|
|
345
388
|
}
|
|
346
|
-
|
|
347
|
-
(0, _commonUtil.navigateTo)(link);
|
|
348
389
|
}
|
|
349
390
|
};
|
|
350
391
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "magic-box-iconfont"; /* Project id 3317752 */
|
|
3
|
-
src: url('magic-box-iconfont.woff2?t=
|
|
4
|
-
url('magic-box-iconfont.woff?t=
|
|
5
|
-
url('magic-box-iconfont.ttf?t=
|
|
3
|
+
src: url('magic-box-iconfont.woff2?t=1704245006151') format('woff2'),
|
|
4
|
+
url('magic-box-iconfont.woff?t=1704245006151') format('woff'),
|
|
5
|
+
url('magic-box-iconfont.ttf?t=1704245006151') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.magic-box-iconfont {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.magic-box-icon-anchor:before {
|
|
17
|
+
content: "\e642";
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.magic-box-icon-circle-down:before {
|
|
17
21
|
content: "\e686";
|
|
18
22
|
}
|
|
@@ -21,7 +25,7 @@
|
|
|
21
25
|
content: "\e687";
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
.magic-box-icon-
|
|
28
|
+
.magic-box-icon-template:before {
|
|
25
29
|
content: "\e685";
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "magic-box-iconfont"; /* Project id 3317752 */
|
|
3
|
-
src: url('magic-box-iconfont.woff2?t=
|
|
4
|
-
url('magic-box-iconfont.woff?t=
|
|
5
|
-
url('magic-box-iconfont.ttf?t=
|
|
3
|
+
src: url('magic-box-iconfont.woff2?t=1704245006151') format('woff2'),
|
|
4
|
+
url('magic-box-iconfont.woff?t=1704245006151') format('woff'),
|
|
5
|
+
url('magic-box-iconfont.ttf?t=1704245006151') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.magic-box-iconfont {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.icon-anchor:before {
|
|
17
|
+
content: "\e642";
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.icon-circle-down:before {
|
|
17
21
|
content: "\e686";
|
|
18
22
|
}
|
|
@@ -21,7 +25,7 @@
|
|
|
21
25
|
content: "\e687";
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
.icon-
|
|
28
|
+
.icon-template:before {
|
|
25
29
|
content: "\e685";
|
|
26
30
|
}
|
|
27
31
|
|