@fonixtree/magic-design 0.0.131 → 0.0.132

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.
@@ -115,7 +115,8 @@ function (_super) {
115
115
  redoDisable = _a.redoDisable,
116
116
  language = _a.language,
117
117
  outputType = _a.outputType,
118
- onHtmlSave = _a.onHtmlSave;
118
+ onHtmlSave = _a.onHtmlSave,
119
+ onHtmlBack = _a.onHtmlBack;
119
120
  var languageTemp = langBook[language] || {};
120
121
  return /*#__PURE__*/_react["default"].createElement("div", {
121
122
  className: "quick_menu_wrap"
@@ -174,9 +175,7 @@ function (_super) {
174
175
  }))), outputType == 'html' ? /*#__PURE__*/_react["default"].createElement("div", {
175
176
  className: "menu_right"
176
177
  }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
177
- onClick: function onClick() {
178
- window.close();
179
- }
178
+ onClick: onHtmlBack
180
179
  }, (0, _locale.i18n)('BACK')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
181
180
  onClick: onHtmlSave,
182
181
  type: "light"
@@ -540,7 +540,11 @@ function (_super) {
540
540
  html = _b.sent();
541
541
  (0, _storeUtil.setStore)(_constants.STORAGE_KEY.MAGIC_RENDER_HTML, html);
542
542
  (0, _storeUtil.setStore)(_constants.STORAGE_KEY.MAGIC_RENDER_PAGEDATA, renderProps.pageData);
543
- window.close();
543
+
544
+ if (this.props.onHtmlSave) {
545
+ this.props.onHtmlSave(html);
546
+ }
547
+
544
548
  return [2
545
549
  /*return*/
546
550
  ];
@@ -549,11 +553,26 @@ function (_super) {
549
553
  });
550
554
  };
551
555
 
556
+ _this.onHtmlBack = function () {
557
+ return __awaiter(_this, void 0, void 0, function () {
558
+ return __generator(this, function (_a) {
559
+ if (this.props.onHtmlBack) {
560
+ this.props.onHtmlBack();
561
+ }
562
+
563
+ return [2
564
+ /*return*/
565
+ ];
566
+ });
567
+ });
568
+ };
569
+
552
570
  _this.renderHeader = function () {
553
571
  return /*#__PURE__*/_react["default"].createElement(_QuickMenuBar["default"], {
554
572
  device: _this.state.device,
555
573
  language: _this.props.language,
556
574
  onBtnClick: _this.onQuickMenuClick,
575
+ onHtmlBack: _this.onHtmlBack,
557
576
  onHtmlSave: _this.onHtmlSave,
558
577
  outputType: _this.props.outputType,
559
578
  redoDisable: !_this.history.redoAble(),
@@ -115,7 +115,8 @@ function (_super) {
115
115
  redoDisable = _a.redoDisable,
116
116
  language = _a.language,
117
117
  outputType = _a.outputType,
118
- onHtmlSave = _a.onHtmlSave;
118
+ onHtmlSave = _a.onHtmlSave,
119
+ onHtmlBack = _a.onHtmlBack;
119
120
  var languageTemp = langBook[language] || {};
120
121
  return /*#__PURE__*/_react["default"].createElement("div", {
121
122
  className: "quick_menu_wrap"
@@ -174,9 +175,7 @@ function (_super) {
174
175
  }))), outputType == 'html' ? /*#__PURE__*/_react["default"].createElement("div", {
175
176
  className: "menu_right"
176
177
  }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
177
- onClick: function onClick() {
178
- window.close();
179
- }
178
+ onClick: onHtmlBack
180
179
  }, (0, _locale.i18n)('BACK')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
181
180
  onClick: onHtmlSave,
182
181
  type: "light"
@@ -540,7 +540,11 @@ function (_super) {
540
540
  html = _b.sent();
541
541
  (0, _storeUtil.setStore)(_constants.STORAGE_KEY.MAGIC_RENDER_HTML, html);
542
542
  (0, _storeUtil.setStore)(_constants.STORAGE_KEY.MAGIC_RENDER_PAGEDATA, renderProps.pageData);
543
- window.close();
543
+
544
+ if (this.props.onHtmlSave) {
545
+ this.props.onHtmlSave(html);
546
+ }
547
+
544
548
  return [2
545
549
  /*return*/
546
550
  ];
@@ -549,11 +553,26 @@ function (_super) {
549
553
  });
550
554
  };
551
555
 
556
+ _this.onHtmlBack = function () {
557
+ return __awaiter(_this, void 0, void 0, function () {
558
+ return __generator(this, function (_a) {
559
+ if (this.props.onHtmlBack) {
560
+ this.props.onHtmlBack();
561
+ }
562
+
563
+ return [2
564
+ /*return*/
565
+ ];
566
+ });
567
+ });
568
+ };
569
+
552
570
  _this.renderHeader = function () {
553
571
  return /*#__PURE__*/_react["default"].createElement(_QuickMenuBar["default"], {
554
572
  device: _this.state.device,
555
573
  language: _this.props.language,
556
574
  onBtnClick: _this.onQuickMenuClick,
575
+ onHtmlBack: _this.onHtmlBack,
557
576
  onHtmlSave: _this.onHtmlSave,
558
577
  outputType: _this.props.outputType,
559
578
  redoDisable: !_this.history.redoAble(),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "0.0.131",
4
+ "version": "0.0.132",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",