@fileverse-dev/fortune-react 1.2.90-bold-1 → 1.2.90-toast-1

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.
@@ -8,7 +8,7 @@ var __assign = this && this.__assign || function () {
8
8
  };
9
9
  return __assign.apply(this, arguments);
10
10
  };
11
- import { cancelNormalSelected, getCellValue, getInlineStringHTML, getStyleByCell, isInlineStringCell, moveToEnd, getFlowdata, handleFormulaInput, moveHighlightCell, escapeScriptTag, valueShowEs, createRangeHightlight, isShowHidenCR, israngeseleciton, escapeHTMLTag, isAllowEdit, getrangeseleciton, indexToColumnChar, handleItalic, handleUnderline, handleStrikeThrough } from "@fileverse-dev/fortune-core";
11
+ import { cancelNormalSelected, getCellValue, getInlineStringHTML, getStyleByCell, isInlineStringCell, moveToEnd, getFlowdata, handleFormulaInput, moveHighlightCell, escapeScriptTag, valueShowEs, createRangeHightlight, isShowHidenCR, israngeseleciton, escapeHTMLTag, isAllowEdit, getrangeseleciton, indexToColumnChar, handleBold, handleItalic, handleUnderline, handleStrikeThrough } from "@fileverse-dev/fortune-core";
12
12
  import React, { useContext, useEffect, useMemo, useRef, useCallback, useLayoutEffect, useState } from "react";
13
13
  import _ from "lodash";
14
14
  import { Tooltip } from "@fileverse/ui";
@@ -275,8 +275,12 @@ var InputBox = function InputBox() {
275
275
  lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
276
276
  preText.current = inputRef.current.innerText;
277
277
  if (e.metaKey) {
278
- if (e.code === "KeyB") {} else if (e.code === "KeyI") {
278
+ if (e.code === "KeyB") {
279
+ handleBold(context, inputRef.current);
280
+ stopPropagation(e);
281
+ } else if (e.code === "KeyI") {
279
282
  handleItalic(context, inputRef.current);
283
+ stopPropagation(e);
280
284
  } else if (e.code === "KeyU") {
281
285
  handleUnderline(context, inputRef.current);
282
286
  stopPropagation(e);
@@ -503,7 +503,6 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
503
503
  var resetDeleteRowTimer;
504
504
  var onKeyDown = useCallback(function (e) {
505
505
  var _a, _b;
506
- console.log("onKeyDown", e);
507
506
  var _c = ref.current,
508
507
  getSelection = _c.getSelection,
509
508
  getSheet = _c.getSheet,
@@ -645,7 +644,6 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
645
644
  return;
646
645
  }
647
646
  setContextWithProduce(function (draftCtx) {
648
- console.log("handleGlobalKeyDown");
649
647
  handleGlobalKeyDown(draftCtx, cellInput.current, fxInput.current, nativeEvent, globalCache.current, handleUndo, handleRedo, canvas.current.getContext("2d"));
650
648
  });
651
649
  }, [handleRedo, handleUndo, setContextWithProduce]);
@@ -284,8 +284,12 @@ var InputBox = function InputBox() {
284
284
  lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
285
285
  preText.current = inputRef.current.innerText;
286
286
  if (e.metaKey) {
287
- if (e.code === "KeyB") {} else if (e.code === "KeyI") {
287
+ if (e.code === "KeyB") {
288
+ (0, _fortuneCore.handleBold)(context, inputRef.current);
289
+ stopPropagation(e);
290
+ } else if (e.code === "KeyI") {
288
291
  (0, _fortuneCore.handleItalic)(context, inputRef.current);
292
+ stopPropagation(e);
289
293
  } else if (e.code === "KeyU") {
290
294
  (0, _fortuneCore.handleUnderline)(context, inputRef.current);
291
295
  stopPropagation(e);
@@ -512,7 +512,6 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
512
512
  var resetDeleteRowTimer;
513
513
  var onKeyDown = (0, _react.useCallback)(function (e) {
514
514
  var _a, _b;
515
- console.log("onKeyDown", e);
516
515
  var _c = ref.current,
517
516
  getSelection = _c.getSelection,
518
517
  getSheet = _c.getSheet,
@@ -654,7 +653,6 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
654
653
  return;
655
654
  }
656
655
  setContextWithProduce(function (draftCtx) {
657
- console.log("handleGlobalKeyDown");
658
656
  (0, _fortuneCore.handleGlobalKeyDown)(draftCtx, cellInput.current, fxInput.current, nativeEvent, globalCache.current, handleUndo, handleRedo, canvas.current.getContext("2d"));
659
657
  });
660
658
  }, [handleRedo, handleUndo, setContextWithProduce]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.90-bold-1",
3
+ "version": "1.2.90-toast-1",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "es/index.js",
@@ -16,8 +16,8 @@
16
16
  "tsc": "tsc"
17
17
  },
18
18
  "dependencies": {
19
- "@fileverse-dev/fortune-core": "1.2.90-bold-1",
20
- "@fileverse/ui": "^4.1.7-patch-40",
19
+ "@fileverse-dev/fortune-core": "1.2.90-toast-1",
20
+ "@fileverse/ui": "4.2.1-toast-3",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",
23
23
  "immer": "^9.0.12",