@fileverse-dev/fortune-react 1.2.62-patch-1 → 1.2.62-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.
@@ -245,21 +245,27 @@ var InputBox = function InputBox() {
245
245
  e.stopPropagation();
246
246
  }
247
247
  }, [getActiveFormula, insertSelectedFormula]);
248
+ var stopPropagation = function stopPropagation(event) {
249
+ event.stopPropagation();
250
+ event.preventDefault();
251
+ };
248
252
  var onKeyDown = useCallback(function (e) {
249
253
  var _a, _b;
250
254
  lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
251
255
  preText.current = inputRef.current.innerText;
252
256
  if (e.metaKey) {
253
- e.preventDefault();
254
- e.stopPropagation();
255
257
  if (e.code === "KeyB") {
256
258
  handleBold(context, inputRef.current);
259
+ stopPropagation(e);
257
260
  } else if (e.code === "KeyI") {
258
261
  handleItalic(context, inputRef.current);
262
+ stopPropagation(e);
259
263
  } else if (e.code === "KeyU") {
260
264
  handleUnderline(context, inputRef.current);
265
+ stopPropagation(e);
261
266
  } else if (e.code === "KeyS") {
262
267
  handleStrikeThrough(context, inputRef.current);
268
+ stopPropagation(e);
263
269
  }
264
270
  }
265
271
  var currentCommaCount = countCommasBeforeCursor(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current);
@@ -254,21 +254,27 @@ var InputBox = function InputBox() {
254
254
  e.stopPropagation();
255
255
  }
256
256
  }, [getActiveFormula, insertSelectedFormula]);
257
+ var stopPropagation = function stopPropagation(event) {
258
+ event.stopPropagation();
259
+ event.preventDefault();
260
+ };
257
261
  var onKeyDown = (0, _react.useCallback)(function (e) {
258
262
  var _a, _b;
259
263
  lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
260
264
  preText.current = inputRef.current.innerText;
261
265
  if (e.metaKey) {
262
- e.preventDefault();
263
- e.stopPropagation();
264
266
  if (e.code === "KeyB") {
265
267
  (0, _fortuneCore.handleBold)(context, inputRef.current);
268
+ stopPropagation(e);
266
269
  } else if (e.code === "KeyI") {
267
270
  (0, _fortuneCore.handleItalic)(context, inputRef.current);
271
+ stopPropagation(e);
268
272
  } else if (e.code === "KeyU") {
269
273
  (0, _fortuneCore.handleUnderline)(context, inputRef.current);
274
+ stopPropagation(e);
270
275
  } else if (e.code === "KeyS") {
271
276
  (0, _fortuneCore.handleStrikeThrough)(context, inputRef.current);
277
+ stopPropagation(e);
272
278
  }
273
279
  }
274
280
  var currentCommaCount = (0, _helper.countCommasBeforeCursor)(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.62-patch-1",
3
+ "version": "1.2.62-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.62-patch-1",
19
+ "@fileverse-dev/fortune-core": "1.2.62-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",