@fonixtree/magic-design 0.1.31 → 0.1.33

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.
@@ -209,7 +209,9 @@ function StoreTable(props) {
209
209
  setLoading(true);
210
210
  return [4
211
211
  /*yield*/
212
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/page", params, 'GET')];
212
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/page", __assign(__assign({}, params), {
213
+ state: 'A'
214
+ }), 'GET')];
213
215
 
214
216
  case 1:
215
217
  res = _a.sent();
@@ -235,8 +237,8 @@ function StoreTable(props) {
235
237
  alt: "",
236
238
  src: val,
237
239
  style: {
238
- width: '50px',
239
- height: '50px'
240
+ maxWidth: '50px',
241
+ maxHeight: '50px'
240
242
  }
241
243
  });
242
244
  }
@@ -253,6 +255,14 @@ function StoreTable(props) {
253
255
  },
254
256
  type: 'radio'
255
257
  };
258
+
259
+ var reset = function reset() {
260
+ setStoreName('');
261
+ queryStore(__assign({
262
+ storeName: ''
263
+ }, paginationParams));
264
+ };
265
+
256
266
  return /*#__PURE__*/_react["default"].createElement("div", {
257
267
  style: {
258
268
  height: 550
@@ -207,75 +207,26 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
207
207
  /** 检查youtube依赖包 */
208
208
  var checkYoutuVIdeo = function checkYoutuVIdeo() {
209
209
  return __awaiter(void 0, void 0, void 0, function () {
210
- var scriptUrl, ttPolicy, YT, YTConfig;
211
210
  return __generator(this, function (_a) {
212
- if (!window.YT) {
213
- scriptUrl = 'https:\/\/www.youtube.com\/s\/player\/36754c51\/www-widgetapi.vflset\/www-widgetapi.js';
214
-
215
- try {
216
- ttPolicy = window.trustedTypes.createPolicy('youtube-widget-api', {
217
- createScriptURL: function createScriptURL(x) {
218
- return x;
219
- }
220
- });
221
- scriptUrl = ttPolicy.createScriptURL(scriptUrl);
222
- } catch (e) {}
223
-
224
- if (!window['YT']) YT = {
225
- loading: 0,
226
- loaded: 0
227
- };
228
- if (!window['YTConfig']) YTConfig = {
229
- host: 'https://www.youtube.com'
230
- };
231
-
232
- if (!YT.loading) {
233
- YT.loading = 1;
234
-
235
- (function () {
236
- var l = [];
237
-
238
- YT.ready = function (f) {
239
- if (YT.loaded) f();else l.push(f);
240
- };
241
-
242
- window.onYTReady = function () {
243
- YT.loaded = 1;
244
-
245
- for (var i = 0; i < l.length; i++) {
246
- try {
247
- l[i]();
248
- } catch (e$0) {}
249
- }
250
- };
251
-
252
- YT.setConfig = function (c) {
253
- for (var k in c) {
254
- if (c.hasOwnProperty(k)) YTConfig[k] = c[k];
255
- }
256
- };
211
+ switch (_a.label) {
212
+ case 0:
213
+ if (!!window.YT) return [3
214
+ /*break*/
215
+ , 2];
216
+ return [4
217
+ /*yield*/
218
+ , Promise.all([(0, _commonUtil.importAsync)('https://www.youtube.com/iframe_api', 'js')])];
257
219
 
258
- var a = document.createElement('script');
259
- a.type = 'text/javascript';
260
- a.id = 'www-widgetapi-script';
261
- a.src = scriptUrl;
262
- a.async = true;
263
- var c = document.currentScript;
220
+ case 1:
221
+ _a.sent();
264
222
 
265
- if (c) {
266
- var n = c.nonce || c.getAttribute('nonce');
267
- if (n) a.setAttribute('nonce', n);
268
- }
223
+ _a.label = 2;
269
224
 
270
- var b = document.getElementsByTagName('script')[0];
271
- b.parentNode.insertBefore(a, b);
272
- })();
273
- }
225
+ case 2:
226
+ return [2
227
+ /*return*/
228
+ ];
274
229
  }
275
-
276
- return [2
277
- /*return*/
278
- ];
279
230
  });
280
231
  });
281
232
  };
@@ -101,7 +101,10 @@ function (_super) {
101
101
  var style = ".m-text{display: flex;flex-direction: column;word-break: break-word;}.m-text .title-wrap{font-weight:500;font-size:20px;}.m-text .sub-title-text{font-size:15px;color:#b7b7b7;margin-top:10px;}.m-text .group-content-wrap{width:100%;}.m-text .group-content-wrap .group-wrap-container{" + groupWrapContainerStyle + "}.m-text .group-content-wrap .group-wrap{display:flex;flex-direction:column;width:100%;}.m-text .group-content-wrap .group-wrap .group-title{font-size:14px;}.m-text .group-content-wrap.col-1 .group-wrap{width:100%;}.m-text .group-content-wrap.col-2{display:grid;grid-template-columns:50% 50%;}.m-text .group-content-wrap.col-3{display:grid;grid-template-columns:33.3% 33.3% 33.3%;}.m-text .group-content-wrap.mobile{display:block;}";
102
102
  return /*#__PURE__*/_react["default"].createElement("div", {
103
103
  className: "m-text",
104
- onClick: this.onComponentClick
104
+ onClick: this.onComponentClick,
105
+ style: {
106
+ flexDirection: 'column'
107
+ }
105
108
  }, /*#__PURE__*/_react["default"].createElement("style", null, style), nodeData.title.headline.open && /*#__PURE__*/_react["default"].createElement("div", {
106
109
  className: "title-wrap"
107
110
  }, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
@@ -206,35 +206,30 @@ function (_super) {
206
206
 
207
207
  _this.getStoreInfo = function () {
208
208
  return __awaiter(_this, void 0, void 0, function () {
209
- var storeId, res, isFollow;
210
- return __generator(this, function (_a) {
211
- switch (_a.label) {
209
+ var storeId, _a, res, isFollow;
210
+
211
+ return __generator(this, function (_b) {
212
+ switch (_b.label) {
212
213
  case 0:
213
214
  storeId = window.magicDesign.storeId;
214
215
  if (!storeId) return [3
215
216
  /*break*/
216
- , 3];
217
- return [4
218
- /*yield*/
219
- , (0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET')];
220
-
221
- case 1:
222
- res = _a.sent();
217
+ , 2];
223
218
  return [4
224
219
  /*yield*/
225
- , (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
220
+ , Promise.all([(0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET'), (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
226
221
  storeId: storeId
227
- })];
222
+ })])];
228
223
 
229
- case 2:
230
- isFollow = _a.sent();
224
+ case 1:
225
+ _a = _b.sent(), res = _a[0], isFollow = _a[1];
231
226
  this.setState({
232
227
  storeInfo: res,
233
228
  isFollow: isFollow
234
229
  });
235
- _a.label = 3;
230
+ _b.label = 2;
236
231
 
237
- case 3:
232
+ case 2:
238
233
  return [2
239
234
  /*return*/
240
235
  ];
@@ -317,7 +312,9 @@ function (_super) {
317
312
  } else {
318
313
  window.magicDesign.history.push({
319
314
  pathname: '/sign-in',
320
- state: "/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount)
315
+ state: {
316
+ redirectUrl: "/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount)
317
+ }
321
318
  });
322
319
  }
323
320
  };
@@ -210,36 +210,30 @@ function (_super) {
210
210
 
211
211
  _this.getStoreInfo = function () {
212
212
  return __awaiter(_this, void 0, void 0, function () {
213
- var storeId, res, isFollow;
214
- return __generator(this, function (_a) {
215
- switch (_a.label) {
213
+ var storeId, _a, res, isFollow;
214
+
215
+ return __generator(this, function (_b) {
216
+ switch (_b.label) {
216
217
  case 0:
217
218
  storeId = window.magicDesign.storeId;
218
219
  if (!storeId) return [3
219
220
  /*break*/
220
- , 3];
221
+ , 2];
221
222
  return [4
222
223
  /*yield*/
223
- , (0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET')];
224
-
225
- case 1:
226
- res = _a.sent();
227
- return [4
228
- /*yield*/
229
- , (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
224
+ , Promise.all([(0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET'), (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
230
225
  storeId: storeId
231
- })];
226
+ })])];
232
227
 
233
- case 2:
234
- isFollow = _a.sent();
235
- console.log('---d', res);
228
+ case 1:
229
+ _a = _b.sent(), res = _a[0], isFollow = _a[1];
236
230
  this.setState({
237
231
  storeInfo: res,
238
232
  isFollow: isFollow
239
233
  });
240
- _a.label = 3;
234
+ _b.label = 2;
241
235
 
242
- case 3:
236
+ case 2:
243
237
  return [2
244
238
  /*return*/
245
239
  ];
@@ -59,8 +59,16 @@ function (_super) {
59
59
  renderProps: renderProps
60
60
  }, function () {
61
61
  document.querySelector('#render-html-wrap > div').style = 'max-width:600px;margin:auto;';
62
+ /** 去除设计器模式下元素 */
63
+
64
+ document.querySelectorAll('#render-html-wrap > div .composite_mask').forEach(function (el) {
65
+ el.remove();
66
+ });
62
67
  var html = document.querySelector('#render-html-wrap').innerHTML;
63
- resolve(html.replace(/url\(&quot;((\S|\s)*)&quot;\)/g, 'url($1)'));
68
+ /** 处理背景图资源引号问题 */
69
+
70
+ html = html.replace(/url\(&quot;((\S|\s)*)&quot;\)/g, 'url($1)');
71
+ resolve(html);
64
72
 
65
73
  _this.setState({
66
74
  renderProps: null
@@ -209,7 +209,9 @@ function StoreTable(props) {
209
209
  setLoading(true);
210
210
  return [4
211
211
  /*yield*/
212
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/page", params, 'GET')];
212
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/page", __assign(__assign({}, params), {
213
+ state: 'A'
214
+ }), 'GET')];
213
215
 
214
216
  case 1:
215
217
  res = _a.sent();
@@ -235,8 +237,8 @@ function StoreTable(props) {
235
237
  alt: "",
236
238
  src: val,
237
239
  style: {
238
- width: '50px',
239
- height: '50px'
240
+ maxWidth: '50px',
241
+ maxHeight: '50px'
240
242
  }
241
243
  });
242
244
  }
@@ -253,6 +255,14 @@ function StoreTable(props) {
253
255
  },
254
256
  type: 'radio'
255
257
  };
258
+
259
+ var reset = function reset() {
260
+ setStoreName('');
261
+ queryStore(__assign({
262
+ storeName: ''
263
+ }, paginationParams));
264
+ };
265
+
256
266
  return /*#__PURE__*/_react["default"].createElement("div", {
257
267
  style: {
258
268
  height: 550
@@ -207,75 +207,26 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
207
207
  /** 检查youtube依赖包 */
208
208
  var checkYoutuVIdeo = function checkYoutuVIdeo() {
209
209
  return __awaiter(void 0, void 0, void 0, function () {
210
- var scriptUrl, ttPolicy, YT, YTConfig;
211
210
  return __generator(this, function (_a) {
212
- if (!window.YT) {
213
- scriptUrl = 'https:\/\/www.youtube.com\/s\/player\/36754c51\/www-widgetapi.vflset\/www-widgetapi.js';
214
-
215
- try {
216
- ttPolicy = window.trustedTypes.createPolicy('youtube-widget-api', {
217
- createScriptURL: function createScriptURL(x) {
218
- return x;
219
- }
220
- });
221
- scriptUrl = ttPolicy.createScriptURL(scriptUrl);
222
- } catch (e) {}
223
-
224
- if (!window['YT']) YT = {
225
- loading: 0,
226
- loaded: 0
227
- };
228
- if (!window['YTConfig']) YTConfig = {
229
- host: 'https://www.youtube.com'
230
- };
231
-
232
- if (!YT.loading) {
233
- YT.loading = 1;
234
-
235
- (function () {
236
- var l = [];
237
-
238
- YT.ready = function (f) {
239
- if (YT.loaded) f();else l.push(f);
240
- };
241
-
242
- window.onYTReady = function () {
243
- YT.loaded = 1;
244
-
245
- for (var i = 0; i < l.length; i++) {
246
- try {
247
- l[i]();
248
- } catch (e$0) {}
249
- }
250
- };
251
-
252
- YT.setConfig = function (c) {
253
- for (var k in c) {
254
- if (c.hasOwnProperty(k)) YTConfig[k] = c[k];
255
- }
256
- };
211
+ switch (_a.label) {
212
+ case 0:
213
+ if (!!window.YT) return [3
214
+ /*break*/
215
+ , 2];
216
+ return [4
217
+ /*yield*/
218
+ , Promise.all([(0, _commonUtil.importAsync)('https://www.youtube.com/iframe_api', 'js')])];
257
219
 
258
- var a = document.createElement('script');
259
- a.type = 'text/javascript';
260
- a.id = 'www-widgetapi-script';
261
- a.src = scriptUrl;
262
- a.async = true;
263
- var c = document.currentScript;
220
+ case 1:
221
+ _a.sent();
264
222
 
265
- if (c) {
266
- var n = c.nonce || c.getAttribute('nonce');
267
- if (n) a.setAttribute('nonce', n);
268
- }
223
+ _a.label = 2;
269
224
 
270
- var b = document.getElementsByTagName('script')[0];
271
- b.parentNode.insertBefore(a, b);
272
- })();
273
- }
225
+ case 2:
226
+ return [2
227
+ /*return*/
228
+ ];
274
229
  }
275
-
276
- return [2
277
- /*return*/
278
- ];
279
230
  });
280
231
  });
281
232
  };
@@ -101,7 +101,10 @@ function (_super) {
101
101
  var style = ".m-text{display: flex;flex-direction: column;word-break: break-word;}.m-text .title-wrap{font-weight:500;font-size:20px;}.m-text .sub-title-text{font-size:15px;color:#b7b7b7;margin-top:10px;}.m-text .group-content-wrap{width:100%;}.m-text .group-content-wrap .group-wrap-container{" + groupWrapContainerStyle + "}.m-text .group-content-wrap .group-wrap{display:flex;flex-direction:column;width:100%;}.m-text .group-content-wrap .group-wrap .group-title{font-size:14px;}.m-text .group-content-wrap.col-1 .group-wrap{width:100%;}.m-text .group-content-wrap.col-2{display:grid;grid-template-columns:50% 50%;}.m-text .group-content-wrap.col-3{display:grid;grid-template-columns:33.3% 33.3% 33.3%;}.m-text .group-content-wrap.mobile{display:block;}";
102
102
  return /*#__PURE__*/_react["default"].createElement("div", {
103
103
  className: "m-text",
104
- onClick: this.onComponentClick
104
+ onClick: this.onComponentClick,
105
+ style: {
106
+ flexDirection: 'column'
107
+ }
105
108
  }, /*#__PURE__*/_react["default"].createElement("style", null, style), nodeData.title.headline.open && /*#__PURE__*/_react["default"].createElement("div", {
106
109
  className: "title-wrap"
107
110
  }, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
@@ -206,35 +206,30 @@ function (_super) {
206
206
 
207
207
  _this.getStoreInfo = function () {
208
208
  return __awaiter(_this, void 0, void 0, function () {
209
- var storeId, res, isFollow;
210
- return __generator(this, function (_a) {
211
- switch (_a.label) {
209
+ var storeId, _a, res, isFollow;
210
+
211
+ return __generator(this, function (_b) {
212
+ switch (_b.label) {
212
213
  case 0:
213
214
  storeId = window.magicDesign.storeId;
214
215
  if (!storeId) return [3
215
216
  /*break*/
216
- , 3];
217
- return [4
218
- /*yield*/
219
- , (0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET')];
220
-
221
- case 1:
222
- res = _a.sent();
217
+ , 2];
223
218
  return [4
224
219
  /*yield*/
225
- , (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
220
+ , Promise.all([(0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET'), (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
226
221
  storeId: storeId
227
- })];
222
+ })])];
228
223
 
229
- case 2:
230
- isFollow = _a.sent();
224
+ case 1:
225
+ _a = _b.sent(), res = _a[0], isFollow = _a[1];
231
226
  this.setState({
232
227
  storeInfo: res,
233
228
  isFollow: isFollow
234
229
  });
235
- _a.label = 3;
230
+ _b.label = 2;
236
231
 
237
- case 3:
232
+ case 2:
238
233
  return [2
239
234
  /*return*/
240
235
  ];
@@ -317,7 +312,9 @@ function (_super) {
317
312
  } else {
318
313
  window.magicDesign.history.push({
319
314
  pathname: '/sign-in',
320
- state: "/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount)
315
+ state: {
316
+ redirectUrl: "/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount)
317
+ }
321
318
  });
322
319
  }
323
320
  };
@@ -210,36 +210,30 @@ function (_super) {
210
210
 
211
211
  _this.getStoreInfo = function () {
212
212
  return __awaiter(_this, void 0, void 0, function () {
213
- var storeId, res, isFollow;
214
- return __generator(this, function (_a) {
215
- switch (_a.label) {
213
+ var storeId, _a, res, isFollow;
214
+
215
+ return __generator(this, function (_b) {
216
+ switch (_b.label) {
216
217
  case 0:
217
218
  storeId = window.magicDesign.storeId;
218
219
  if (!storeId) return [3
219
220
  /*break*/
220
- , 3];
221
+ , 2];
221
222
  return [4
222
223
  /*yield*/
223
- , (0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET')];
224
-
225
- case 1:
226
- res = _a.sent();
227
- return [4
228
- /*yield*/
229
- , (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
224
+ , Promise.all([(0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET'), (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
230
225
  storeId: storeId
231
- })];
226
+ })])];
232
227
 
233
- case 2:
234
- isFollow = _a.sent();
235
- console.log('---d', res);
228
+ case 1:
229
+ _a = _b.sent(), res = _a[0], isFollow = _a[1];
236
230
  this.setState({
237
231
  storeInfo: res,
238
232
  isFollow: isFollow
239
233
  });
240
- _a.label = 3;
234
+ _b.label = 2;
241
235
 
242
- case 3:
236
+ case 2:
243
237
  return [2
244
238
  /*return*/
245
239
  ];
@@ -59,8 +59,16 @@ function (_super) {
59
59
  renderProps: renderProps
60
60
  }, function () {
61
61
  document.querySelector('#render-html-wrap > div').style = 'max-width:600px;margin:auto;';
62
+ /** 去除设计器模式下元素 */
63
+
64
+ document.querySelectorAll('#render-html-wrap > div .composite_mask').forEach(function (el) {
65
+ el.remove();
66
+ });
62
67
  var html = document.querySelector('#render-html-wrap').innerHTML;
63
- resolve(html.replace(/url\(&quot;((\S|\s)*)&quot;\)/g, 'url($1)'));
68
+ /** 处理背景图资源引号问题 */
69
+
70
+ html = html.replace(/url\(&quot;((\S|\s)*)&quot;\)/g, 'url($1)');
71
+ resolve(html);
64
72
 
65
73
  _this.setState({
66
74
  renderProps: null
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.31",
4
+ "version": "0.1.33",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",
Binary file
Binary file