react-simple-keyboard 3.5.0 → 3.5.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.
@@ -1,52 +1,52 @@
1
- import { KeyboardReactInterface } from "../interfaces";
2
- export declare const parseProps: (props: KeyboardReactInterface["options"]) => {
3
- theme: string;
4
- layout?: import("../interfaces").KeyboardLayoutObject | undefined;
5
- layoutName?: string | undefined;
6
- display?: {
7
- [button: string]: string;
8
- } | undefined;
9
- mergeDisplay?: boolean | undefined;
10
- buttonTheme?: import("../interfaces").KeyboardButtonTheme[] | undefined;
11
- buttonAttributes?: import("../interfaces").KeyboardButtonAttributes[] | undefined;
12
- debug?: boolean | undefined;
13
- newLineOnEnter?: boolean | undefined;
14
- tabCharOnTab?: boolean | undefined;
15
- inputName?: string | undefined;
16
- maxLength?: any;
17
- syncInstanceInputs?: boolean | undefined;
18
- physicalKeyboardHighlight?: boolean | undefined;
19
- physicalKeyboardHighlightPress?: boolean | undefined;
20
- physicalKeyboardHighlightPressUseClick?: boolean | undefined;
21
- physicalKeyboardHighlightPressUsePointerEvents?: boolean | undefined;
22
- physicalKeyboardHighlightTextColor?: string | undefined;
23
- physicalKeyboardHighlightBgColor?: string | undefined;
24
- preventMouseDownDefault?: boolean | undefined;
25
- preventMouseUpDefault?: boolean | undefined;
26
- stopMouseDownPropagation?: boolean | undefined;
27
- stopMouseUpPropagation?: boolean | undefined;
28
- useButtonTag?: boolean | undefined;
29
- disableCaretPositioning?: boolean | undefined;
30
- inputPattern?: any;
31
- useTouchEvents?: boolean | undefined;
32
- autoUseTouchEvents?: boolean | undefined;
33
- useMouseEvents?: boolean | undefined;
34
- disableButtonHold?: boolean | undefined;
35
- rtl?: boolean | undefined;
36
- enableLayoutCandidates?: boolean | undefined;
37
- layoutCandidates?: {
38
- [key: string]: string;
39
- } | undefined;
40
- excludeFromLayout?: {
41
- [key: string]: string[];
42
- } | undefined;
43
- layoutCandidatesPageSize?: number | undefined;
44
- layoutCandidatesCaseSensitiveMatch?: boolean | undefined;
45
- disableCandidateNormalization?: boolean | undefined;
46
- onRender?: ((instance?: import("../interfaces").SimpleKeyboard | undefined) => void) | undefined;
47
- onInit?: ((instance?: import("../interfaces").SimpleKeyboard | undefined) => void) | undefined;
48
- onChange?: ((input: string, e?: MouseEvent | undefined) => any) | undefined;
49
- onChangeAll?: ((inputObj: import("../interfaces").KeyboardInput, e?: MouseEvent | undefined) => any) | undefined;
50
- keyboardRef?: ((r: any) => void) | undefined;
51
- };
52
- export declare const changedProps: (prevProps: KeyboardReactInterface["options"], props: KeyboardReactInterface["options"]) => string[];
1
+ import { KeyboardReactInterface } from "../interfaces";
2
+ export declare const parseProps: (props: KeyboardReactInterface["options"]) => {
3
+ theme: string;
4
+ layout?: import("../interfaces").KeyboardLayoutObject | undefined;
5
+ layoutName?: string | undefined;
6
+ display?: {
7
+ [button: string]: string;
8
+ } | undefined;
9
+ mergeDisplay?: boolean | undefined;
10
+ buttonTheme?: import("../interfaces").KeyboardButtonTheme[] | undefined;
11
+ buttonAttributes?: import("../interfaces").KeyboardButtonAttributes[] | undefined;
12
+ debug?: boolean | undefined;
13
+ newLineOnEnter?: boolean | undefined;
14
+ tabCharOnTab?: boolean | undefined;
15
+ inputName?: string | undefined;
16
+ maxLength?: any;
17
+ syncInstanceInputs?: boolean | undefined;
18
+ physicalKeyboardHighlight?: boolean | undefined;
19
+ physicalKeyboardHighlightPress?: boolean | undefined;
20
+ physicalKeyboardHighlightPressUseClick?: boolean | undefined;
21
+ physicalKeyboardHighlightPressUsePointerEvents?: boolean | undefined;
22
+ physicalKeyboardHighlightTextColor?: string | undefined;
23
+ physicalKeyboardHighlightBgColor?: string | undefined;
24
+ preventMouseDownDefault?: boolean | undefined;
25
+ preventMouseUpDefault?: boolean | undefined;
26
+ stopMouseDownPropagation?: boolean | undefined;
27
+ stopMouseUpPropagation?: boolean | undefined;
28
+ useButtonTag?: boolean | undefined;
29
+ disableCaretPositioning?: boolean | undefined;
30
+ inputPattern?: any;
31
+ useTouchEvents?: boolean | undefined;
32
+ autoUseTouchEvents?: boolean | undefined;
33
+ useMouseEvents?: boolean | undefined;
34
+ disableButtonHold?: boolean | undefined;
35
+ rtl?: boolean | undefined;
36
+ enableLayoutCandidates?: boolean | undefined;
37
+ layoutCandidates?: {
38
+ [key: string]: string;
39
+ } | undefined;
40
+ excludeFromLayout?: {
41
+ [key: string]: string[];
42
+ } | undefined;
43
+ layoutCandidatesPageSize?: number | undefined;
44
+ layoutCandidatesCaseSensitiveMatch?: boolean | undefined;
45
+ disableCandidateNormalization?: boolean | undefined;
46
+ onRender?: ((instance?: import("../interfaces").SimpleKeyboard | undefined) => void) | undefined;
47
+ onInit?: ((instance?: import("../interfaces").SimpleKeyboard | undefined) => void) | undefined;
48
+ onChange?: ((input: string, e?: MouseEvent | undefined) => any) | undefined;
49
+ onChangeAll?: ((inputObj: import("../interfaces").KeyboardInput, e?: MouseEvent | undefined) => any) | undefined;
50
+ keyboardRef?: ((r: any) => void) | undefined;
51
+ };
52
+ export declare const changedProps: (prevProps: KeyboardReactInterface["options"], props: KeyboardReactInterface["options"]) => string[];
package/package.json CHANGED
@@ -1,130 +1,130 @@
1
- {
2
- "name": "react-simple-keyboard",
3
- "version": "3.5.0",
4
- "description": "React.js Virtual Keyboard",
5
- "main": "build/index.js",
6
- "scripts": {
7
- "start": "webpack serve --config webpack.config.demo.js",
8
- "build": "npm run generate-types && webpack && npm run build-modern && tsc",
9
- "build-modern": "webpack --config webpack.config.modern.js",
10
- "test": "jest --silent",
11
- "coverage": "npm run test -- --coverage",
12
- "prepare": "npm run build",
13
- "trypublish": "npm publish || true",
14
- "generate-types": "node scripts/generateKeyboardTypes.js"
15
- },
16
- "repository": {
17
- "type": "git",
18
- "url": "https://github.com/hodgef/react-simple-keyboard"
19
- },
20
- "author": "Francisco Hodge <hello@franciscohodge.com> (https://github.com/hodgef)",
21
- "bugs": {
22
- "url": "https://github.com/hodgef/react-simple-keyboard/issues"
23
- },
24
- "homepage": "https://virtual-keyboard.js.org/",
25
- "keywords": [
26
- "react",
27
- "reactjs",
28
- "digital",
29
- "keyboard",
30
- "onscreen",
31
- "virtual",
32
- "component",
33
- "screen-keyboard",
34
- "component",
35
- "virtual-keyboard",
36
- "touchscreen",
37
- "touch-screen",
38
- "kiosk",
39
- "osk",
40
- "js"
41
- ],
42
- "license": "MIT",
43
- "devDependencies": {
44
- "@babel/cli": "^7.18.10",
45
- "@babel/core": "^7.20.7",
46
- "@babel/plugin-proposal-class-properties": "^7.16.7",
47
- "@babel/plugin-transform-typescript": "^7.20.7",
48
- "@babel/preset-env": "^7.19.4",
49
- "@babel/preset-react": "^7.18.6",
50
- "@babel/preset-typescript": "^7.17.12",
51
- "@types/enzyme": "^3.10.12",
52
- "@types/jest": "^27.5.0",
53
- "@types/react": "^18.0.9",
54
- "@types/react-dom": "^18.0.3",
55
- "@typescript-eslint/eslint-plugin": "^4.33.0",
56
- "@typescript-eslint/parser": "^4.32.0",
57
- "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
58
- "autoprefixer": "^10.4.13",
59
- "babel-eslint": "^10.1.0",
60
- "babel-loader": "^9.1.0",
61
- "babel-preset-minify": "^0.5.2",
62
- "copy-webpack-plugin": "^11.0.0",
63
- "core-js": "^3.27.1",
64
- "css-loader": "^6.7.3",
65
- "css-minimizer-webpack-plugin": "^4.2.2",
66
- "dts-bundle": "^0.7.3",
67
- "enzyme": "^3.11.0",
68
- "eslint": "^7.32.0",
69
- "file-loader": "^6.2.0",
70
- "html-webpack-plugin": "^5.5.0",
71
- "jest": "^26.6.3",
72
- "mini-css-extract-plugin": "^2.7.2",
73
- "postcss": "^8.4.20",
74
- "postcss-loader": "^7.0.2",
75
- "react": "^16.0.0 || ^17.0.0 || ^18.0.0",
76
- "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0",
77
- "simple-keyboard": "3.5.0",
78
- "style-loader": "^3.2.1",
79
- "terser-webpack-plugin": "^5.3.6",
80
- "typescript": "^4.9.4",
81
- "url-loader": "^4.1.1",
82
- "webpack": "^5.40.0",
83
- "webpack-cli": "^5.0.1",
84
- "webpack-dev-server": "4.11.1"
85
- },
86
- "peerDependencies": {
87
- "react": "^16.0.0 || ^17.0.0 || ^18.0.0",
88
- "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
89
- },
90
- "jest": {
91
- "roots": [
92
- "<rootDir>/src"
93
- ],
94
- "collectCoverageFrom": [
95
- "src/**/*.{js,jsx,ts,tsx}",
96
- "!src/**/*.d.ts",
97
- "!src/lib/index.js",
98
- "!src/lib/polyfills.js",
99
- "!src/demo/**",
100
- "!src/utils/**",
101
- "!src/**/*.d.ts",
102
- "!**/tests/**"
103
- ],
104
- "testMatch": [
105
- "<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
106
- "<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
107
- ],
108
- "transformIgnorePatterns": [
109
- "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$",
110
- "^.+\\.module\\.(css|sass|scss)$"
111
- ],
112
- "modulePaths": [],
113
- "moduleNameMapper": {
114
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/scripts/testMock.js",
115
- "\\.(css|less)$": "<rootDir>/scripts/testMock.js"
116
- },
117
- "moduleFileExtensions": [
118
- "web.js",
119
- "js",
120
- "web.ts",
121
- "ts",
122
- "web.tsx",
123
- "tsx",
124
- "json",
125
- "web.jsx",
126
- "jsx",
127
- "node"
128
- ]
129
- }
130
- }
1
+ {
2
+ "name": "react-simple-keyboard",
3
+ "version": "3.5.1",
4
+ "description": "React.js Virtual Keyboard",
5
+ "main": "build/index.js",
6
+ "scripts": {
7
+ "start": "webpack serve --config webpack.config.demo.js",
8
+ "build": "npm run generate-types && webpack && npm run build-modern && tsc",
9
+ "build-modern": "webpack --config webpack.config.modern.js",
10
+ "test": "jest --silent",
11
+ "coverage": "npm run test -- --coverage",
12
+ "prepare": "npm run build",
13
+ "trypublish": "npm publish || true",
14
+ "generate-types": "node scripts/generateKeyboardTypes.js"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/hodgef/react-simple-keyboard"
19
+ },
20
+ "author": "Francisco Hodge <hello@franciscohodge.com> (https://github.com/hodgef)",
21
+ "bugs": {
22
+ "url": "https://github.com/hodgef/react-simple-keyboard/issues"
23
+ },
24
+ "homepage": "https://virtual-keyboard.js.org/",
25
+ "keywords": [
26
+ "react",
27
+ "reactjs",
28
+ "digital",
29
+ "keyboard",
30
+ "onscreen",
31
+ "virtual",
32
+ "component",
33
+ "screen-keyboard",
34
+ "component",
35
+ "virtual-keyboard",
36
+ "touchscreen",
37
+ "touch-screen",
38
+ "kiosk",
39
+ "osk",
40
+ "js"
41
+ ],
42
+ "license": "MIT",
43
+ "devDependencies": {
44
+ "@babel/cli": "^7.18.10",
45
+ "@babel/core": "^7.20.7",
46
+ "@babel/plugin-proposal-class-properties": "^7.16.7",
47
+ "@babel/plugin-transform-typescript": "^7.20.7",
48
+ "@babel/preset-env": "^7.19.4",
49
+ "@babel/preset-react": "^7.18.6",
50
+ "@babel/preset-typescript": "^7.17.12",
51
+ "@types/enzyme": "^3.10.12",
52
+ "@types/jest": "^27.5.0",
53
+ "@types/react": "^18.0.9",
54
+ "@types/react-dom": "^18.0.3",
55
+ "@typescript-eslint/eslint-plugin": "^4.33.0",
56
+ "@typescript-eslint/parser": "^4.32.0",
57
+ "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
58
+ "autoprefixer": "^10.4.13",
59
+ "babel-eslint": "^10.1.0",
60
+ "babel-loader": "^9.1.0",
61
+ "babel-preset-minify": "^0.5.2",
62
+ "copy-webpack-plugin": "^11.0.0",
63
+ "core-js": "^3.27.1",
64
+ "css-loader": "^6.7.3",
65
+ "css-minimizer-webpack-plugin": "^4.2.2",
66
+ "dts-bundle": "^0.7.3",
67
+ "enzyme": "^3.11.0",
68
+ "eslint": "^7.32.0",
69
+ "file-loader": "^6.2.0",
70
+ "html-webpack-plugin": "^5.5.0",
71
+ "jest": "^26.6.3",
72
+ "mini-css-extract-plugin": "^2.7.2",
73
+ "postcss": "^8.4.20",
74
+ "postcss-loader": "^7.0.2",
75
+ "react": "^16.0.0 || ^17.0.0 || ^18.0.0",
76
+ "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0",
77
+ "simple-keyboard": "3.5.0",
78
+ "style-loader": "^3.2.1",
79
+ "terser-webpack-plugin": "^5.3.6",
80
+ "typescript": "^4.9.4",
81
+ "url-loader": "^4.1.1",
82
+ "webpack": "^5.40.0",
83
+ "webpack-cli": "^5.0.1",
84
+ "webpack-dev-server": "4.11.1"
85
+ },
86
+ "peerDependencies": {
87
+ "react": "^16.0.0 || ^17.0.0 || ^18.0.0",
88
+ "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
89
+ },
90
+ "jest": {
91
+ "roots": [
92
+ "<rootDir>/src"
93
+ ],
94
+ "collectCoverageFrom": [
95
+ "src/**/*.{js,jsx,ts,tsx}",
96
+ "!src/**/*.d.ts",
97
+ "!src/lib/index.js",
98
+ "!src/lib/polyfills.js",
99
+ "!src/demo/**",
100
+ "!src/utils/**",
101
+ "!src/**/*.d.ts",
102
+ "!**/tests/**"
103
+ ],
104
+ "testMatch": [
105
+ "<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
106
+ "<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
107
+ ],
108
+ "transformIgnorePatterns": [
109
+ "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$",
110
+ "^.+\\.module\\.(css|sass|scss)$"
111
+ ],
112
+ "modulePaths": [],
113
+ "moduleNameMapper": {
114
+ "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/scripts/testMock.js",
115
+ "\\.(css|less)$": "<rootDir>/scripts/testMock.js"
116
+ },
117
+ "moduleFileExtensions": [
118
+ "web.js",
119
+ "js",
120
+ "web.ts",
121
+ "ts",
122
+ "web.tsx",
123
+ "tsx",
124
+ "json",
125
+ "web.jsx",
126
+ "jsx",
127
+ "node"
128
+ ]
129
+ }
130
+ }
@@ -1,95 +1,95 @@
1
- /**
2
- * Config to support modern browsers only (build/index.modern.js)
3
- */
4
- const path = require('path');
5
- const webpack = require('webpack');
6
- const TerserPlugin = require('terser-webpack-plugin');
7
- const getPackageJson = require('./scripts/getPackageJson');
8
-
9
- const {
10
- version,
11
- name,
12
- license,
13
- repository,
14
- author
15
- } = getPackageJson('version', 'name', 'license', 'repository', 'author');
16
-
17
- const banner = `
18
- ${name} v${version} (index.modern.js - Modern Browsers bundle)
19
- ${repository.url}
20
-
21
- NOTE: This modern browsers bundle (index.modern.js) removes all polyfills
22
- included in the standard version. Use this if you are supporting
23
- modern browsers only. Otherwise, use the standard version (index.js).
24
-
25
- Copyright (c) ${author.replace(/ *<[^)]*> */g, " ")} and project contributors.
26
-
27
- This source code is licensed under the ${license} license found in the
28
- LICENSE file in the root directory of this source tree.
29
- `;
30
-
31
- module.exports = {
32
- mode: "production",
33
- entry: './src/lib/index.modern.ts',
34
- target: 'es5',
35
- devtool: 'source-map',
36
- output: {
37
- filename: 'index.modern.js',
38
- path: path.resolve(__dirname, 'build'),
39
- library: "ReactSimpleKeyboard",
40
- libraryTarget: 'umd',
41
- globalObject: 'this'
42
- },
43
- optimization: {
44
- minimize: true,
45
- minimizer: [
46
- new TerserPlugin({ extractComments: false }),
47
- ],
48
- },
49
- externals: {
50
- react: {
51
- root: 'React',
52
- commonjs2: 'react',
53
- commonjs: 'react',
54
- amd: 'react'
55
- },
56
- 'react-dom': {
57
- root: 'ReactDOM',
58
- commonjs2: 'react-dom',
59
- commonjs: 'react-dom',
60
- amd: 'react-dom'
61
- }
62
- },
63
- module: {
64
- rules: [
65
- {
66
- test: /\.(js|json|ts|tsx)$/,
67
- exclude: /(node_modules|bower_components)/,
68
- use: {
69
- loader: 'babel-loader',
70
- options: {
71
- presets: [
72
- "@babel/preset-react",
73
- "@babel/env",
74
- "@babel/preset-typescript"
75
- ],
76
- plugins: [
77
- ["@babel/plugin-proposal-class-properties"],
78
- ["@babel/plugin-transform-typescript"]
79
- ]
80
- }
81
- }
82
- },
83
- {
84
- test: /\.(sa|sc|c)ss$/,
85
- use: path.resolve('scripts/loaderMock.js')
86
- }
87
- ]
88
- },
89
- plugins: [
90
- new webpack.BannerPlugin(banner)
91
- ],
92
- resolve: {
93
- extensions: ['.ts', '.tsx', '.js', '.json']
94
- }
95
- };
1
+ /**
2
+ * Config to support modern browsers only (build/index.modern.js)
3
+ */
4
+ const path = require('path');
5
+ const webpack = require('webpack');
6
+ const TerserPlugin = require('terser-webpack-plugin');
7
+ const getPackageJson = require('./scripts/getPackageJson');
8
+
9
+ const {
10
+ version,
11
+ name,
12
+ license,
13
+ repository,
14
+ author
15
+ } = getPackageJson('version', 'name', 'license', 'repository', 'author');
16
+
17
+ const banner = `
18
+ ${name} v${version} (index.modern.js - Modern Browsers bundle)
19
+ ${repository.url}
20
+
21
+ NOTE: This modern browsers bundle (index.modern.js) removes all polyfills
22
+ included in the standard version. Use this if you are supporting
23
+ modern browsers only. Otherwise, use the standard version (index.js).
24
+
25
+ Copyright (c) ${author.replace(/ *<[^)]*> */g, " ")} and project contributors.
26
+
27
+ This source code is licensed under the ${license} license found in the
28
+ LICENSE file in the root directory of this source tree.
29
+ `;
30
+
31
+ module.exports = {
32
+ mode: "production",
33
+ entry: './src/lib/index.modern.ts',
34
+ target: 'es5',
35
+ devtool: 'source-map',
36
+ output: {
37
+ filename: 'index.modern.js',
38
+ path: path.resolve(__dirname, 'build'),
39
+ library: "ReactSimpleKeyboard",
40
+ libraryTarget: 'umd',
41
+ globalObject: 'this'
42
+ },
43
+ optimization: {
44
+ minimize: true,
45
+ minimizer: [
46
+ new TerserPlugin({ extractComments: false }),
47
+ ],
48
+ },
49
+ externals: {
50
+ react: {
51
+ root: 'React',
52
+ commonjs2: 'react',
53
+ commonjs: 'react',
54
+ amd: 'react'
55
+ },
56
+ 'react-dom': {
57
+ root: 'ReactDOM',
58
+ commonjs2: 'react-dom',
59
+ commonjs: 'react-dom',
60
+ amd: 'react-dom'
61
+ }
62
+ },
63
+ module: {
64
+ rules: [
65
+ {
66
+ test: /\.(js|json|ts|tsx)$/,
67
+ exclude: /(node_modules|bower_components)/,
68
+ use: {
69
+ loader: 'babel-loader',
70
+ options: {
71
+ presets: [
72
+ "@babel/preset-react",
73
+ "@babel/env",
74
+ "@babel/preset-typescript"
75
+ ],
76
+ plugins: [
77
+ ["@babel/plugin-proposal-class-properties"],
78
+ ["@babel/plugin-transform-typescript"]
79
+ ]
80
+ }
81
+ }
82
+ },
83
+ {
84
+ test: /\.(sa|sc|c)ss$/,
85
+ use: path.resolve('scripts/loaderMock.js')
86
+ }
87
+ ]
88
+ },
89
+ plugins: [
90
+ new webpack.BannerPlugin(banner)
91
+ ],
92
+ resolve: {
93
+ extensions: ['.ts', '.tsx', '.js', '.json']
94
+ }
95
+ };
@@ -1,13 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "type": "pwa-msedge",
6
- "request": "launch",
7
- "name": "Edge",
8
- "url": "http://127.0.0.1:9000",
9
- "webRoot": "${workspaceFolder}",
10
- "sourceMaps": true
11
- }
12
- ]
13
- }