@fileverse-dev/fortune-react 1.2.50-patch-1 → 1.2.50-patch-2

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.
@@ -1134,34 +1134,7 @@ var Toolbar = function Toolbar(_a) {
1134
1134
  if (context.allowEdit === false) return;
1135
1135
  showImgChooser();
1136
1136
  }
1137
- }, /*#__PURE__*/React.createElement("input", {
1138
- id: "fortune-img-upload",
1139
- type: "file",
1140
- accept: "image/*",
1141
- style: {
1142
- display: "none"
1143
- },
1144
- onChange: function onChange(e) {
1145
- var _a;
1146
- var file = (_a = e.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
1147
- if (!file) return;
1148
- var render = new FileReader();
1149
- render.readAsDataURL(file);
1150
- render.onload = function (event) {
1151
- var _a;
1152
- if (event.target == null) return;
1153
- var src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
1154
- var image = new Image();
1155
- image.onload = function () {
1156
- setContext(function (draftCtx) {
1157
- insertImage(draftCtx, image);
1158
- });
1159
- };
1160
- image.src = src;
1161
- };
1162
- e.currentTarget.value = "";
1163
- }
1164
- }));
1137
+ });
1165
1138
  }
1166
1139
  if (name === "comment") {
1167
1140
  var last = (_d = context.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d[context.luckysheet_select_save.length - 1];
@@ -1692,6 +1665,33 @@ var Toolbar = function Toolbar(_a) {
1692
1665
  "aria-label": toolbar.toolbar
1693
1666
  }, /*#__PURE__*/React.createElement(DataVerificationPortal, {
1694
1667
  visible: showDataValidation
1668
+ }), /*#__PURE__*/React.createElement("input", {
1669
+ id: "fortune-img-upload",
1670
+ type: "file",
1671
+ accept: "image/*",
1672
+ style: {
1673
+ display: "none"
1674
+ },
1675
+ onChange: function onChange(e) {
1676
+ var _a;
1677
+ var file = (_a = e.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
1678
+ if (!file) return;
1679
+ var render = new FileReader();
1680
+ render.readAsDataURL(file);
1681
+ render.onload = function (event) {
1682
+ var _a;
1683
+ if (event.target == null) return;
1684
+ var src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
1685
+ var image = new Image();
1686
+ image.onload = function () {
1687
+ setContext(function (draftCtx) {
1688
+ insertImage(draftCtx, image);
1689
+ });
1690
+ };
1691
+ image.src = src;
1692
+ };
1693
+ e.currentTarget.value = "";
1694
+ }
1695
1695
  }), /*#__PURE__*/React.createElement("div", {
1696
1696
  className: "fortune-toolbar-left"
1697
1697
  }, settings.customToolbarItems.filter(function (n) {
@@ -1143,34 +1143,7 @@ var Toolbar = function Toolbar(_a) {
1143
1143
  if (context.allowEdit === false) return;
1144
1144
  (0, _fortuneCore.showImgChooser)();
1145
1145
  }
1146
- }, /*#__PURE__*/_react.default.createElement("input", {
1147
- id: "fortune-img-upload",
1148
- type: "file",
1149
- accept: "image/*",
1150
- style: {
1151
- display: "none"
1152
- },
1153
- onChange: function onChange(e) {
1154
- var _a;
1155
- var file = (_a = e.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
1156
- if (!file) return;
1157
- var render = new FileReader();
1158
- render.readAsDataURL(file);
1159
- render.onload = function (event) {
1160
- var _a;
1161
- if (event.target == null) return;
1162
- var src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
1163
- var image = new Image();
1164
- image.onload = function () {
1165
- setContext(function (draftCtx) {
1166
- (0, _fortuneCore.insertImage)(draftCtx, image);
1167
- });
1168
- };
1169
- image.src = src;
1170
- };
1171
- e.currentTarget.value = "";
1172
- }
1173
- }));
1146
+ });
1174
1147
  }
1175
1148
  if (name === "comment") {
1176
1149
  var last = (_d = context.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d[context.luckysheet_select_save.length - 1];
@@ -1701,6 +1674,33 @@ var Toolbar = function Toolbar(_a) {
1701
1674
  "aria-label": toolbar.toolbar
1702
1675
  }, /*#__PURE__*/_react.default.createElement(_dataVerificationPortal.default, {
1703
1676
  visible: showDataValidation
1677
+ }), /*#__PURE__*/_react.default.createElement("input", {
1678
+ id: "fortune-img-upload",
1679
+ type: "file",
1680
+ accept: "image/*",
1681
+ style: {
1682
+ display: "none"
1683
+ },
1684
+ onChange: function onChange(e) {
1685
+ var _a;
1686
+ var file = (_a = e.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
1687
+ if (!file) return;
1688
+ var render = new FileReader();
1689
+ render.readAsDataURL(file);
1690
+ render.onload = function (event) {
1691
+ var _a;
1692
+ if (event.target == null) return;
1693
+ var src = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
1694
+ var image = new Image();
1695
+ image.onload = function () {
1696
+ setContext(function (draftCtx) {
1697
+ (0, _fortuneCore.insertImage)(draftCtx, image);
1698
+ });
1699
+ };
1700
+ image.src = src;
1701
+ };
1702
+ e.currentTarget.value = "";
1703
+ }
1704
1704
  }), /*#__PURE__*/_react.default.createElement("div", {
1705
1705
  className: "fortune-toolbar-left"
1706
1706
  }, settings.customToolbarItems.filter(function (n) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.50-patch-1",
3
+ "version": "1.2.50-patch-2",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "es/index.js",
@@ -16,7 +16,7 @@
16
16
  "tsc": "tsc"
17
17
  },
18
18
  "dependencies": {
19
- "@fileverse-dev/fortune-core": "1.2.50-patch-1",
19
+ "@fileverse-dev/fortune-core": "1.2.50-patch-2",
20
20
  "@fileverse/ui": "^4.1.7-patch-40",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",