Skip to content

Commit

Permalink
Bump to simple-keyboard@3.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgef committed Jan 4, 2023
1 parent dbf1706 commit 8f20d41
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 22 deletions.
4 changes: 2 additions & 2 deletions build/css/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions build/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/index.modern.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/index.modern.js.map

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion build/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ export interface KeyboardInput {
}
export type CandidateBoxParams = {
utilities: Utilities;
options: KeyboardOptions;
};
export type CandidateBoxShowParams = {
candidateValue: string;
Expand Down Expand Up @@ -514,6 +515,10 @@ export interface KeyboardOptions {
* Determines whether layout candidate match should be case sensitive.
*/
layoutCandidatesCaseSensitiveMatch?: boolean;
/**
* Disables the automatic normalization for selected layout candidates
*/
disableCandidateNormalization?: boolean;
/**
* Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).
*/
Expand All @@ -537,10 +542,11 @@ export interface KeyboardOptions {
}
export interface CandidateBox {
utilities: Utilities;
options: KeyboardOptions;
candidateBoxElement: HTMLDivElement;
pageIndex: number;
pageSize: number;
constructor: ({ utilities }: CandidateBoxParams) => any
constructor: ({ utilities, options }: CandidateBoxParams) => any
destroy(): void;
show({ candidateValue, targetElement, onSelect, }: CandidateBoxShowParams): void;
renderPage({ candidateListPages, targetElement, pageIndex, nbPages, onItemSelected, }: CandidateBoxRenderParams): void;
Expand Down Expand Up @@ -733,6 +739,10 @@ export interface Utilities {
* Escape regex input
*/
escapeRegex(str: string): string;
/**
* Calculate caret position offset when using rtl option
*/
getRtlOffset(index: number, input: string): number;
/**
* Reusable empty function
*/
Expand Down
1 change: 1 addition & 0 deletions build/services/Utilities.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export declare const parseProps: (props: KeyboardReactInterface["options"]) => {
} | undefined;
layoutCandidatesPageSize?: number | undefined;
layoutCandidatesCaseSensitiveMatch?: boolean | undefined;
disableCandidateNormalization?: boolean | undefined;
onRender?: ((instance?: import("../interfaces").SimpleKeyboard | undefined) => void) | undefined;
onInit?: ((instance?: import("../interfaces").SimpleKeyboard | undefined) => void) | undefined;
onChange?: ((input: string, e?: MouseEvent | undefined) => any) | undefined;
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-simple-keyboard",
"version": "3.4.252",
"version": "3.5.0",
"description": "React.js Virtual Keyboard",
"main": "build/index.js",
"scripts": {
Expand Down Expand Up @@ -74,7 +74,7 @@
"postcss-loader": "^7.0.2",
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0",
"simple-keyboard": "3.4.164",
"simple-keyboard": "3.5.0",
"style-loader": "^3.2.1",
"terser-webpack-plugin": "^5.3.6",
"typescript": "^4.9.4",
Expand Down
1 change: 1 addition & 0 deletions scripts/generateKeyboardTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dts.bundle({

let keyboardInterface = fs.readFileSync('src/lib/interfaces.d.ts', 'utf8');
keyboardInterface = keyboardInterface.replace(/export default (.*);/g, "");
keyboardInterface = keyboardInterface.replace(/export {(.*)};/g, "");
keyboardInterface = keyboardInterface.replace(/import (.*);/g, "");
keyboardInterface = keyboardInterface.replace(/class (.*) {/g, "export interface $1 {");
keyboardInterface = keyboardInterface.replace(/static (.*);/g, "");
Expand Down
12 changes: 11 additions & 1 deletion src/lib/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ export interface KeyboardInput {
}
export type CandidateBoxParams = {
utilities: Utilities;
options: KeyboardOptions;
};
export type CandidateBoxShowParams = {
candidateValue: string;
Expand Down Expand Up @@ -514,6 +515,10 @@ export interface KeyboardOptions {
* Determines whether layout candidate match should be case sensitive.
*/
layoutCandidatesCaseSensitiveMatch?: boolean;
/**
* Disables the automatic normalization for selected layout candidates
*/
disableCandidateNormalization?: boolean;
/**
* Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).
*/
Expand All @@ -537,10 +542,11 @@ export interface KeyboardOptions {
}
export interface CandidateBox {
utilities: Utilities;
options: KeyboardOptions;
candidateBoxElement: HTMLDivElement;
pageIndex: number;
pageSize: number;
constructor: ({ utilities }: CandidateBoxParams) => any
constructor: ({ utilities, options }: CandidateBoxParams) => any
destroy(): void;
show({ candidateValue, targetElement, onSelect, }: CandidateBoxShowParams): void;
renderPage({ candidateListPages, targetElement, pageIndex, nbPages, onItemSelected, }: CandidateBoxRenderParams): void;
Expand Down Expand Up @@ -733,6 +739,10 @@ export interface Utilities {
* Escape regex input
*/
escapeRegex(str: string): string;
/**
* Calculate caret position offset when using rtl option
*/
getRtlOffset(index: number, input: string): number;
/**
* Reusable empty function
*/
Expand Down

0 comments on commit 8f20d41

Please sign in to comment.