@fonixtree/magic-design 0.1.35 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/composite-comp/dito/components/SignBoard/mobile/index.js +1 -1
- package/es/composite-comp/dito/components/SignBoard/pc/index.js +1 -1
- package/es/core/Renderer/index.js +3 -7
- package/es/meta-comp/components/Image/index.js +3 -4
- package/es/utils/commonUtil.js +5 -8
- package/es/utils/coreUtil.js +3 -7
- package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +1 -1
- package/lib/composite-comp/dito/components/SignBoard/pc/index.js +1 -1
- package/lib/core/Renderer/index.js +3 -7
- package/lib/meta-comp/components/Image/index.js +3 -4
- package/lib/utils/commonUtil.js +5 -8
- package/lib/utils/coreUtil.js +3 -7
- package/package.json +1 -1
|
@@ -34,19 +34,15 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
34
34
|
|
|
35
35
|
return __assign.apply(this, arguments);
|
|
36
36
|
};
|
|
37
|
-
/* eslint-disable consistent-return */
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
// import { deviceTypeMap } from '../../constants';
|
|
41
38
|
var setDesignConfig = function setDesignConfig(props) {
|
|
42
39
|
var config = props.config,
|
|
43
|
-
device = props.device
|
|
44
|
-
isShop = props.isShop;
|
|
40
|
+
device = props.device;
|
|
45
41
|
window.magicDesign = __assign(__assign({
|
|
46
42
|
pageBackground: '#f2f2f2',
|
|
47
43
|
mode: 'renderer',
|
|
48
44
|
device: device,
|
|
49
|
-
|
|
45
|
+
navigatePreUrl: ''
|
|
50
46
|
}, config), {
|
|
51
47
|
compSpacing: Number(config.compSpacing),
|
|
52
48
|
compWidth: Number(config.compWidth)
|
|
@@ -60,7 +56,7 @@ var setDesignConfig = function setDesignConfig(props) {
|
|
|
60
56
|
var Renderer = function Renderer(props) {
|
|
61
57
|
var pageData = props.pageData,
|
|
62
58
|
outputType = props.outputType,
|
|
63
|
-
noSetWindow = props.noSetWindow;
|
|
59
|
+
noSetWindow = props.noSetWindow;
|
|
64
60
|
|
|
65
61
|
if (!noSetWindow) {
|
|
66
62
|
setDesignConfig(props);
|
|
@@ -173,11 +173,10 @@ function (_super) {
|
|
|
173
173
|
|
|
174
174
|
if (data.hover.open && data.hover.backgroundType === 'new' && (hoverState || hoverImgSrc)) {
|
|
175
175
|
srcImg = (0, _coreUtil.isPc)() ? data.hover.pcImgHoverUrl : data.hover.h5ImgHoverUrl;
|
|
176
|
-
}
|
|
176
|
+
} // if (window.magicDesign.isShop && srcImg?.includes('ecommerce/static')) {
|
|
177
|
+
// srcImg = srcImg.replace('ecommerce/static', 'static');
|
|
178
|
+
// }
|
|
177
179
|
|
|
178
|
-
if (window.magicDesign.isShop && (srcImg === null || srcImg === void 0 ? void 0 : srcImg.includes('ecommerce/static'))) {
|
|
179
|
-
srcImg = srcImg.replace('ecommerce/static', 'static');
|
|
180
|
-
}
|
|
181
180
|
|
|
182
181
|
if (!srcImg) {
|
|
183
182
|
srcImg = (0, _coreUtil.isPc)() ? _pcDefImg["default"] : _h5DefImg["default"];
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -270,15 +270,12 @@ var navigateTo = function navigateTo(url) {
|
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
if (!window.magicDesign || !window.magicDesign.history) {
|
|
274
|
-
window.location.href = url;
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
273
|
if (url.startsWith('/')) {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
274
|
+
if (window.magicDesign.history && !window.magicDesign.navigatePreUrl) {
|
|
275
|
+
window.magicDesign.history.push(url);
|
|
276
|
+
} else {
|
|
277
|
+
window.location.href = "" + window.magicDesign.navigatePreUrl + url;
|
|
278
|
+
}
|
|
282
279
|
} else {
|
|
283
280
|
window.location.href = url;
|
|
284
281
|
}
|
package/es/utils/coreUtil.js
CHANGED
|
@@ -291,9 +291,9 @@ var clickUrl = function clickUrl(url) {
|
|
|
291
291
|
url = '';
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
console.log('clickUrl...', url);
|
|
294
|
+
console.log('clickUrl...', url); // 只读模式,设计模式,url为空,邮箱模版
|
|
295
295
|
|
|
296
|
-
if (window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
|
|
296
|
+
if (window.magicDesign.readOnly || window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
299
|
|
|
@@ -302,11 +302,7 @@ var clickUrl = function clickUrl(url) {
|
|
|
302
302
|
data = _a.data;
|
|
303
303
|
|
|
304
304
|
var _b = data.params,
|
|
305
|
-
params = _b === void 0 ? {} : _b;
|
|
306
|
-
|
|
307
|
-
if (params.type !== 'VIDEO' && window.magicDesign.readOnly) {
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
305
|
+
params = _b === void 0 ? {} : _b;
|
|
310
306
|
|
|
311
307
|
if ((0, _androidUtil.browserVersion)().isApp) {
|
|
312
308
|
(0, _androidUtil.sendToApp)(data);
|
|
@@ -34,19 +34,15 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
34
34
|
|
|
35
35
|
return __assign.apply(this, arguments);
|
|
36
36
|
};
|
|
37
|
-
/* eslint-disable consistent-return */
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
// import { deviceTypeMap } from '../../constants';
|
|
41
38
|
var setDesignConfig = function setDesignConfig(props) {
|
|
42
39
|
var config = props.config,
|
|
43
|
-
device = props.device
|
|
44
|
-
isShop = props.isShop;
|
|
40
|
+
device = props.device;
|
|
45
41
|
window.magicDesign = __assign(__assign({
|
|
46
42
|
pageBackground: '#f2f2f2',
|
|
47
43
|
mode: 'renderer',
|
|
48
44
|
device: device,
|
|
49
|
-
|
|
45
|
+
navigatePreUrl: ''
|
|
50
46
|
}, config), {
|
|
51
47
|
compSpacing: Number(config.compSpacing),
|
|
52
48
|
compWidth: Number(config.compWidth)
|
|
@@ -60,7 +56,7 @@ var setDesignConfig = function setDesignConfig(props) {
|
|
|
60
56
|
var Renderer = function Renderer(props) {
|
|
61
57
|
var pageData = props.pageData,
|
|
62
58
|
outputType = props.outputType,
|
|
63
|
-
noSetWindow = props.noSetWindow;
|
|
59
|
+
noSetWindow = props.noSetWindow;
|
|
64
60
|
|
|
65
61
|
if (!noSetWindow) {
|
|
66
62
|
setDesignConfig(props);
|
|
@@ -173,11 +173,10 @@ function (_super) {
|
|
|
173
173
|
|
|
174
174
|
if (data.hover.open && data.hover.backgroundType === 'new' && (hoverState || hoverImgSrc)) {
|
|
175
175
|
srcImg = (0, _coreUtil.isPc)() ? data.hover.pcImgHoverUrl : data.hover.h5ImgHoverUrl;
|
|
176
|
-
}
|
|
176
|
+
} // if (window.magicDesign.isShop && srcImg?.includes('ecommerce/static')) {
|
|
177
|
+
// srcImg = srcImg.replace('ecommerce/static', 'static');
|
|
178
|
+
// }
|
|
177
179
|
|
|
178
|
-
if (window.magicDesign.isShop && (srcImg === null || srcImg === void 0 ? void 0 : srcImg.includes('ecommerce/static'))) {
|
|
179
|
-
srcImg = srcImg.replace('ecommerce/static', 'static');
|
|
180
|
-
}
|
|
181
180
|
|
|
182
181
|
if (!srcImg) {
|
|
183
182
|
srcImg = (0, _coreUtil.isPc)() ? _pcDefImg["default"] : _h5DefImg["default"];
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -270,15 +270,12 @@ var navigateTo = function navigateTo(url) {
|
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
if (!window.magicDesign || !window.magicDesign.history) {
|
|
274
|
-
window.location.href = url;
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
273
|
if (url.startsWith('/')) {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
274
|
+
if (window.magicDesign.history && !window.magicDesign.navigatePreUrl) {
|
|
275
|
+
window.magicDesign.history.push(url);
|
|
276
|
+
} else {
|
|
277
|
+
window.location.href = "" + window.magicDesign.navigatePreUrl + url;
|
|
278
|
+
}
|
|
282
279
|
} else {
|
|
283
280
|
window.location.href = url;
|
|
284
281
|
}
|
package/lib/utils/coreUtil.js
CHANGED
|
@@ -291,9 +291,9 @@ var clickUrl = function clickUrl(url) {
|
|
|
291
291
|
url = '';
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
console.log('clickUrl...', url);
|
|
294
|
+
console.log('clickUrl...', url); // 只读模式,设计模式,url为空,邮箱模版
|
|
295
295
|
|
|
296
|
-
if (window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
|
|
296
|
+
if (window.magicDesign.readOnly || window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
299
|
|
|
@@ -302,11 +302,7 @@ var clickUrl = function clickUrl(url) {
|
|
|
302
302
|
data = _a.data;
|
|
303
303
|
|
|
304
304
|
var _b = data.params,
|
|
305
|
-
params = _b === void 0 ? {} : _b;
|
|
306
|
-
|
|
307
|
-
if (params.type !== 'VIDEO' && window.magicDesign.readOnly) {
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
305
|
+
params = _b === void 0 ? {} : _b;
|
|
310
306
|
|
|
311
307
|
if ((0, _androidUtil.browserVersion)().isApp) {
|
|
312
308
|
(0, _androidUtil.sendToApp)(data);
|