@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.
@@ -263,7 +263,7 @@ function (_super) {
263
263
  /*yield*/
264
264
  , (0, _commonUtil.commonFetch)('/h5/collection/store', {
265
265
  storeId: storeId,
266
- operationType: !isFollow ? 'D' : 'A'
266
+ operationType: isFollow ? 'D' : 'A'
267
267
  }, 'post')];
268
268
 
269
269
  case 2:
@@ -262,7 +262,7 @@ function (_super) {
262
262
  /*yield*/
263
263
  , (0, _commonUtil.commonFetch)('/h5/collection/store', {
264
264
  storeId: storeId,
265
- operationType: !isFollow ? 'D' : 'A'
265
+ operationType: isFollow ? 'D' : 'A'
266
266
  }, 'post')];
267
267
 
268
268
  case 2:
@@ -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
- isShop: isShop
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; // console.log('pageData: ', pageData);
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"];
@@ -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
- /** 相同路由跳转不生效 例如:/poster/71 跳转 /poster/72 */
280
- // window.magicDesign.history.push(url);
281
- window.location.href = url;
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
  }
@@ -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; // 如果是video 放开return
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);
@@ -263,7 +263,7 @@ function (_super) {
263
263
  /*yield*/
264
264
  , (0, _commonUtil.commonFetch)('/h5/collection/store', {
265
265
  storeId: storeId,
266
- operationType: !isFollow ? 'D' : 'A'
266
+ operationType: isFollow ? 'D' : 'A'
267
267
  }, 'post')];
268
268
 
269
269
  case 2:
@@ -262,7 +262,7 @@ function (_super) {
262
262
  /*yield*/
263
263
  , (0, _commonUtil.commonFetch)('/h5/collection/store', {
264
264
  storeId: storeId,
265
- operationType: !isFollow ? 'D' : 'A'
265
+ operationType: isFollow ? 'D' : 'A'
266
266
  }, 'post')];
267
267
 
268
268
  case 2:
@@ -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
- isShop: isShop
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; // console.log('pageData: ', pageData);
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"];
@@ -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
- /** 相同路由跳转不生效 例如:/poster/71 跳转 /poster/72 */
280
- // window.magicDesign.history.push(url);
281
- window.location.href = url;
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
  }
@@ -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; // 如果是video 放开return
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);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "0.1.35",
4
+ "version": "0.1.36",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",