@fonixtree/magic-design 1.0.99 → 1.0.104
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.
|
Binary file
|
|
@@ -44,7 +44,8 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
44
44
|
var setDesignConfig = function setDesignConfig(props) {
|
|
45
45
|
var config = props.config,
|
|
46
46
|
device = props.device,
|
|
47
|
-
isPreview = props.isPreview
|
|
47
|
+
isPreview = props.isPreview,
|
|
48
|
+
projectCode = props.projectCode;
|
|
48
49
|
window.magicDesign = __assign(__assign({
|
|
49
50
|
pageBackground: '#f2f2f2',
|
|
50
51
|
mode: 'renderer',
|
|
@@ -52,6 +53,7 @@ var setDesignConfig = function setDesignConfig(props) {
|
|
|
52
53
|
designMode: isPreview,
|
|
53
54
|
navigatePreUrl: ''
|
|
54
55
|
}, config), {
|
|
56
|
+
projectCode: projectCode,
|
|
55
57
|
compSpacing: Number(config.compSpacing),
|
|
56
58
|
compWidth: Number(config.compWidth)
|
|
57
59
|
});
|
|
@@ -155,7 +157,7 @@ var Renderer = function Renderer(props) {
|
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
return {
|
|
158
|
-
overflow: '
|
|
160
|
+
overflow: 'hidden'
|
|
159
161
|
};
|
|
160
162
|
};
|
|
161
163
|
|
|
@@ -163,7 +165,6 @@ var Renderer = function Renderer(props) {
|
|
|
163
165
|
className: "render_wrap",
|
|
164
166
|
magic_design: "",
|
|
165
167
|
style: __assign({
|
|
166
|
-
height: '100%',
|
|
167
168
|
background: pageBackground
|
|
168
169
|
}, getRestStyle())
|
|
169
170
|
}, floors.length > 0 && floors.map(function (nodeData, moduleIndex) {
|
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, state) {
|
|
290
306
|
var _a;
|
|
291
307
|
|
|
@@ -356,9 +372,11 @@ var clickUrl = function clickUrl(url, state) {
|
|
|
356
372
|
// 跳转外链 需要把token带上
|
|
357
373
|
if (link.includes('?')) {
|
|
358
374
|
var a = link + "&token=" + (localStorage.getItem('h5Token') || '');
|
|
375
|
+
console.log('wai lian: ', a);
|
|
359
376
|
window.location.href = a;
|
|
360
377
|
} else {
|
|
361
378
|
var a = link + "?token=" + (localStorage.getItem('h5Token') || '');
|
|
379
|
+
console.log('wai lian: ', a);
|
|
362
380
|
window.location.href = a;
|
|
363
381
|
}
|
|
364
382
|
} else {
|
|
Binary file
|
|
@@ -44,7 +44,8 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
44
44
|
var setDesignConfig = function setDesignConfig(props) {
|
|
45
45
|
var config = props.config,
|
|
46
46
|
device = props.device,
|
|
47
|
-
isPreview = props.isPreview
|
|
47
|
+
isPreview = props.isPreview,
|
|
48
|
+
projectCode = props.projectCode;
|
|
48
49
|
window.magicDesign = __assign(__assign({
|
|
49
50
|
pageBackground: '#f2f2f2',
|
|
50
51
|
mode: 'renderer',
|
|
@@ -52,6 +53,7 @@ var setDesignConfig = function setDesignConfig(props) {
|
|
|
52
53
|
designMode: isPreview,
|
|
53
54
|
navigatePreUrl: ''
|
|
54
55
|
}, config), {
|
|
56
|
+
projectCode: projectCode,
|
|
55
57
|
compSpacing: Number(config.compSpacing),
|
|
56
58
|
compWidth: Number(config.compWidth)
|
|
57
59
|
});
|
|
@@ -155,7 +157,7 @@ var Renderer = function Renderer(props) {
|
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
return {
|
|
158
|
-
overflow: '
|
|
160
|
+
overflow: 'hidden'
|
|
159
161
|
};
|
|
160
162
|
};
|
|
161
163
|
|
|
@@ -163,7 +165,6 @@ var Renderer = function Renderer(props) {
|
|
|
163
165
|
className: "render_wrap",
|
|
164
166
|
magic_design: "",
|
|
165
167
|
style: __assign({
|
|
166
|
-
height: '100%',
|
|
167
168
|
background: pageBackground
|
|
168
169
|
}, getRestStyle())
|
|
169
170
|
}, floors.length > 0 && floors.map(function (nodeData, moduleIndex) {
|
package/lib/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, state) {
|
|
290
306
|
var _a;
|
|
291
307
|
|
|
@@ -356,9 +372,11 @@ var clickUrl = function clickUrl(url, state) {
|
|
|
356
372
|
// 跳转外链 需要把token带上
|
|
357
373
|
if (link.includes('?')) {
|
|
358
374
|
var a = link + "&token=" + (localStorage.getItem('h5Token') || '');
|
|
375
|
+
console.log('wai lian: ', a);
|
|
359
376
|
window.location.href = a;
|
|
360
377
|
} else {
|
|
361
378
|
var a = link + "?token=" + (localStorage.getItem('h5Token') || '');
|
|
379
|
+
console.log('wai lian: ', a);
|
|
362
380
|
window.location.href = a;
|
|
363
381
|
}
|
|
364
382
|
} else {
|