@fileverse-dev/fortune-react 1.1.77 → 1.1.78

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.
@@ -148,6 +148,31 @@ var ContextMenu = function ContextMenu() {
148
148
  info = _b.info,
149
149
  toolbar = _b.toolbar,
150
150
  splitText = _b.splitText;
151
+ var addRowColRightAvobe = function addRowColRightAvobe(type, direction) {
152
+ var _a, _b, _c;
153
+ var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c[0];
154
+ if (position == null) return;
155
+ var count = 1;
156
+ if (count < 1) return;
157
+ var insertRowColOp = {
158
+ type: type,
159
+ index: position,
160
+ count: count,
161
+ direction: direction,
162
+ id: context.currentSheetId
163
+ };
164
+ setContext(function (draftCtx) {
165
+ try {
166
+ insertRowCol(draftCtx, insertRowColOp);
167
+ draftCtx.contextMenu = {};
168
+ } catch (err) {
169
+ if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
170
+ draftCtx.contextMenu = {};
171
+ }
172
+ }, {
173
+ insertRowColOp: insertRowColOp
174
+ });
175
+ };
151
176
  var getMenuElement = useCallback(function (name, i) {
152
177
  var _a, _b, _c, _d;
153
178
  var selection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
@@ -404,30 +429,7 @@ var ContextMenu = function ContextMenu() {
404
429
  return /*#__PURE__*/React.createElement(Menu, {
405
430
  key: "add-col-".concat(dir),
406
431
  onClick: function onClick() {
407
- var _a, _b, _c;
408
- var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c[0];
409
- if (position == null) return;
410
- var count = 1;
411
- if (count < 1) return;
412
- var direction = "rightbottom";
413
- var insertRowColOp = {
414
- type: "column",
415
- index: position,
416
- count: count,
417
- direction: direction,
418
- id: context.currentSheetId
419
- };
420
- setContext(function (draftCtx) {
421
- try {
422
- insertRowCol(draftCtx, insertRowColOp);
423
- draftCtx.contextMenu = {};
424
- } catch (err) {
425
- if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
426
- draftCtx.contextMenu = {};
427
- }
428
- }, {
429
- insertRowColOp: insertRowColOp
430
- });
432
+ addRowColRightAvobe("column", "rightbottom");
431
433
  }
432
434
  }, /*#__PURE__*/React.createElement("div", {
433
435
  className: "context-item"
@@ -441,30 +443,7 @@ var ContextMenu = function ContextMenu() {
441
443
  return /*#__PURE__*/React.createElement(Menu, {
442
444
  key: "add-row-".concat(dir),
443
445
  onClick: function onClick() {
444
- var _a, _b, _c;
445
- var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.row) === null || _c === void 0 ? void 0 : _c[0];
446
- if (position == null) return;
447
- var count = 1;
448
- if (count < 1) return;
449
- var direction = dir === "top" ? "lefttop" : "rightbottom";
450
- var insertRowColOp = {
451
- type: "row",
452
- index: position,
453
- count: count,
454
- direction: direction,
455
- id: context.currentSheetId
456
- };
457
- setContext(function (draftCtx) {
458
- try {
459
- insertRowCol(draftCtx, insertRowColOp);
460
- draftCtx.contextMenu = {};
461
- } catch (err) {
462
- if (err.message === "maxExceeded") showAlert(rightclick.rowOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnRowReadOnly, "ok");
463
- draftCtx.contextMenu = {};
464
- }
465
- }, {
466
- insertRowColOp: insertRowColOp
467
- });
446
+ addRowColRightAvobe("row", "rightbottom");
468
447
  }
469
448
  }, /*#__PURE__*/React.createElement("div", {
470
449
  className: "context-item"
@@ -1,7 +1,6 @@
1
1
  .luckysheet-sheet-area {
2
2
  width: 100%;
3
3
  box-sizing: border-box;
4
- /* background-color: #fafafc; */
5
4
  color: #444;
6
5
  height: 36px;
7
6
  padding: 0 30px 0 44px;
@@ -195,7 +194,7 @@
195
194
  justify-content: center;
196
195
  height: 29px;
197
196
  width: 29px;
198
- background-color: var(--color-bg-secondary);
197
+ background-color: hsl(var(--color-bg-secondary)) !important;
199
198
  }
200
199
 
201
200
  .fortune-sheettab-button:hover {
@@ -157,6 +157,31 @@ var ContextMenu = function ContextMenu() {
157
157
  info = _b.info,
158
158
  toolbar = _b.toolbar,
159
159
  splitText = _b.splitText;
160
+ var addRowColRightAvobe = function addRowColRightAvobe(type, direction) {
161
+ var _a, _b, _c;
162
+ var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c[0];
163
+ if (position == null) return;
164
+ var count = 1;
165
+ if (count < 1) return;
166
+ var insertRowColOp = {
167
+ type: type,
168
+ index: position,
169
+ count: count,
170
+ direction: direction,
171
+ id: context.currentSheetId
172
+ };
173
+ setContext(function (draftCtx) {
174
+ try {
175
+ (0, _fortuneCore.insertRowCol)(draftCtx, insertRowColOp);
176
+ draftCtx.contextMenu = {};
177
+ } catch (err) {
178
+ if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
179
+ draftCtx.contextMenu = {};
180
+ }
181
+ }, {
182
+ insertRowColOp: insertRowColOp
183
+ });
184
+ };
160
185
  var getMenuElement = (0, _react.useCallback)(function (name, i) {
161
186
  var _a, _b, _c, _d;
162
187
  var selection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
@@ -413,30 +438,7 @@ var ContextMenu = function ContextMenu() {
413
438
  return /*#__PURE__*/_react.default.createElement(_Menu.default, {
414
439
  key: "add-col-".concat(dir),
415
440
  onClick: function onClick() {
416
- var _a, _b, _c;
417
- var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c[0];
418
- if (position == null) return;
419
- var count = 1;
420
- if (count < 1) return;
421
- var direction = "rightbottom";
422
- var insertRowColOp = {
423
- type: "column",
424
- index: position,
425
- count: count,
426
- direction: direction,
427
- id: context.currentSheetId
428
- };
429
- setContext(function (draftCtx) {
430
- try {
431
- (0, _fortuneCore.insertRowCol)(draftCtx, insertRowColOp);
432
- draftCtx.contextMenu = {};
433
- } catch (err) {
434
- if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
435
- draftCtx.contextMenu = {};
436
- }
437
- }, {
438
- insertRowColOp: insertRowColOp
439
- });
441
+ addRowColRightAvobe("column", "rightbottom");
440
442
  }
441
443
  }, /*#__PURE__*/_react.default.createElement("div", {
442
444
  className: "context-item"
@@ -450,30 +452,7 @@ var ContextMenu = function ContextMenu() {
450
452
  return /*#__PURE__*/_react.default.createElement(_Menu.default, {
451
453
  key: "add-row-".concat(dir),
452
454
  onClick: function onClick() {
453
- var _a, _b, _c;
454
- var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.row) === null || _c === void 0 ? void 0 : _c[0];
455
- if (position == null) return;
456
- var count = 1;
457
- if (count < 1) return;
458
- var direction = dir === "top" ? "lefttop" : "rightbottom";
459
- var insertRowColOp = {
460
- type: "row",
461
- index: position,
462
- count: count,
463
- direction: direction,
464
- id: context.currentSheetId
465
- };
466
- setContext(function (draftCtx) {
467
- try {
468
- (0, _fortuneCore.insertRowCol)(draftCtx, insertRowColOp);
469
- draftCtx.contextMenu = {};
470
- } catch (err) {
471
- if (err.message === "maxExceeded") showAlert(rightclick.rowOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnRowReadOnly, "ok");
472
- draftCtx.contextMenu = {};
473
- }
474
- }, {
475
- insertRowColOp: insertRowColOp
476
- });
455
+ addRowColRightAvobe("row", "rightbottom");
477
456
  }
478
457
  }, /*#__PURE__*/_react.default.createElement("div", {
479
458
  className: "context-item"
@@ -1,7 +1,6 @@
1
1
  .luckysheet-sheet-area {
2
2
  width: 100%;
3
3
  box-sizing: border-box;
4
- /* background-color: #fafafc; */
5
4
  color: #444;
6
5
  height: 36px;
7
6
  padding: 0 30px 0 44px;
@@ -195,7 +194,7 @@
195
194
  justify-content: center;
196
195
  height: 29px;
197
196
  width: 29px;
198
- background-color: var(--color-bg-secondary);
197
+ background-color: hsl(var(--color-bg-secondary)) !important;
199
198
  }
200
199
 
201
200
  .fortune-sheettab-button:hover {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.1.77",
3
+ "version": "1.1.78",
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.1.77",
19
+ "@fileverse-dev/fortune-core": "1.1.78",
20
20
  "@fileverse/ui": "^4.1.7-patch-21",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",