Skip to content

Commit

Permalink
Merge branch 'master' into #1826-dont-select-tools-on-hover
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinEpam committed Dec 1, 2022
2 parents bd24f58 + 348f23d commit ead65ef
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .husky/pre-commit
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn precommit
yarn run precommit
6 changes: 3 additions & 3 deletions .husky/pre-push
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn prepush
yarn run prepush
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"scripts": {
"postinstall": "husky install",
"precommit": "lint-staged --allow-empty",
"precommit": "lint-staged --allow-empty && yarn workspaces foreach -pv run prettier:write",
"prepush": "yarn workspaces foreach -pv run test:eslint",
"build": "yarn workspaces foreach -ptvR --from ketcher-react-app run build",
"build:demo": "yarn workspaces foreach -ptvR --from demo run build",
Expand All @@ -27,17 +27,17 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.2.0",
"eslint-plugin-workspaces": "^0.7.0",
"husky": "^7.0.4",
"husky": "^8.0.2",
"lint-staged": "^12.1.2",
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"prettier": "2.8.0",
"prettier-config-standard": "^4.0.0",
"stylelint": "13.13.1",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "22.0.0"
},
"packageManager": "yarn@3.1.0",
"resolutions": {
"react-error-overlay": "6.0.9"
},
"packageManager": "yarn@3.1.0"
}
}
1 change: 1 addition & 0 deletions packages/ketcher-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"miew-react": "^1.0.0",
"react-colorful": "^5.4.0",
"react-contextmenu": "^2.14.0",
"react-device-detect": "^2.2.2",
"react-dropzone": "^11.7.1",
"react-intersection-observer": "^8.32.1",
"react-redux": "^7.2.1",
Expand Down
16 changes: 5 additions & 11 deletions packages/ketcher-react/src/script/ui/state/hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ import { load, onAction } from './shared'
import actions from '../action'
import keyNorm from '../data/convert/keynorm'
import { openDialog } from './modal'

declare global {
interface Window {
clipboardData: any
}
}
import { isIE } from 'react-device-detect'

export function initKeydownListener(element) {
return function (dispatch, getState) {
Expand Down Expand Up @@ -98,8 +93,7 @@ function keyHandle(dispatch, state, hotKeys, event) {
}

event.preventDefault()
} else if (window.clipboardData) {
// IE support
} else if (isIE) {
clipArea.exec(event)
}
}
Expand Down Expand Up @@ -203,7 +197,7 @@ function clipData(editor) {
const simpleObjectOrText = Boolean(
struct.simpleObjects.size || struct.texts.size
)
if (simpleObjectOrText && window.clipboardData) {
if (simpleObjectOrText && isIE) {
errorHandler(
'The structure you are trying to copy contains Simple object or/and Text object.' +
'To copy Simple object or Text object in Internet Explorer try "Copy as KET" button'
Expand All @@ -223,8 +217,8 @@ function clipData(editor) {

// res['chemical/x-daylight-smiles'] = smiles.stringify(struct);
return res
} catch (ex: any) {
errorHandler(ex.message)
} catch (e: any) {
errorHandler(e.message)
}

return null
Expand Down
41 changes: 35 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9108,12 +9108,12 @@ __metadata:
languageName: node
linkType: hard

"husky@npm:^7.0.4":
version: 7.0.4
resolution: "husky@npm:7.0.4"
"husky@npm:^8.0.2":
version: 8.0.2
resolution: "husky@npm:8.0.2"
bin:
husky: lib/bin.js
checksum: c6ec4af63da2c9522da8674a20ad9b48362cc92704896cc8a58c6a2a39d797feb2b806f93fbd83a6d653fbdceb2c3b6e0b602c6b2e8565206ffc2882ef7db9e9
checksum: e101656fcb56163d610488f186448c78b132626aa427094489d886ce9374955a90274912b0f3a34af3326eaa74977883b032e5f701d7aaf4554daa5a7931be43
languageName: node
linkType: hard

Expand Down Expand Up @@ -11395,6 +11395,7 @@ __metadata:
prettier: ^2.5.1
react-colorful: ^5.4.0
react-contextmenu: ^2.14.0
react-device-detect: ^2.2.2
react-dropzone: ^11.7.1
react-intersection-observer: ^8.32.1
react-redux: ^7.2.1
Expand Down Expand Up @@ -14469,6 +14470,15 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:2.8.0":
version: 2.8.0
resolution: "prettier@npm:2.8.0"
bin:
prettier: bin-prettier.js
checksum: 72004ce0cc9bb097daf3e3833f62495768724392c1d5b178dd47372337616e9e50ecbb0804f236596223f7b5eb1bbe69cefc8957dca21112c5777e77ef73a564
languageName: node
linkType: hard

"prettier@npm:^2.5.1":
version: 2.6.0
resolution: "prettier@npm:2.6.0"
Expand Down Expand Up @@ -14868,6 +14878,18 @@ __metadata:
languageName: node
linkType: hard

"react-device-detect@npm:^2.2.2":
version: 2.2.2
resolution: "react-device-detect@npm:2.2.2"
dependencies:
ua-parser-js: ^1.0.2
peerDependencies:
react: ">= 0.14.0"
react-dom: ">= 0.14.0"
checksum: d9245cf5a1c1e565e88523ed6be580497d1f6a972fb100a81092943bb7e44afdcdbae0d67bebe7424c4ba5b27a5d13df7894d122307f070fc26062704f7ec788
languageName: node
linkType: hard

"react-dom@npm:^17.0.2":
version: 17.0.2
resolution: "react-dom@npm:17.0.2"
Expand Down Expand Up @@ -15792,10 +15814,10 @@ __metadata:
eslint-plugin-node: ^11.1.0
eslint-plugin-promise: ^5.2.0
eslint-plugin-workspaces: ^0.7.0
husky: ^7.0.4
husky: ^8.0.2
lint-staged: ^12.1.2
npm-run-all: ^4.1.5
prettier: ^2.5.1
prettier: 2.8.0
prettier-config-standard: ^4.0.0
stylelint: 13.13.1
stylelint-config-prettier: ^9.0.3
Expand Down Expand Up @@ -17748,6 +17770,13 @@ __metadata:
languageName: node
linkType: hard

"ua-parser-js@npm:^1.0.2":
version: 1.0.32
resolution: "ua-parser-js@npm:1.0.32"
checksum: 79a80efd9c21511fdafc042ab748e0e93c8cdb0e8925bf6d48ad7dbb08e808c60fcecd49e679670def44ef428c005aa1810810f6773e7d8135a7817338080813
languageName: node
linkType: hard

"uglify-js@npm:^3.1.4":
version: 3.16.1
resolution: "uglify-js@npm:3.16.1"
Expand Down

0 comments on commit ead65ef

Please sign in to comment.