Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@capacitor/keyboard

Package Overview
Dependencies
Maintainers
8
Versions
915
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor/keyboard - npm Package Compare versions

Comparing version
0.2.0
to
0.3.0
+17
-0
CHANGELOG.md

@@ -6,2 +6,19 @@ # Change Log

# [0.3.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/keyboard@0.2.0...@capacitor/keyboard@0.3.0) (2020-12-20)
### Bug Fixes
* support deprecated types from Capacitor 2 ([#139](https://github.com/ionic-team/capacitor-plugins/issues/139)) ([2d7127a](https://github.com/ionic-team/capacitor-plugins/commit/2d7127a488e26f0287951921a6db47c49d817336))
* **keyboard:** remove deprecated warnings ([#122](https://github.com/ionic-team/capacitor-plugins/issues/122)) ([a6e207c](https://github.com/ionic-team/capacitor-plugins/commit/a6e207c47dfac14d6cbcaa2a942b7b04cae3dae8))
### Features
* **keyboard:** add types for config files ([#115](https://github.com/ionic-team/capacitor-plugins/issues/115)) ([09bba16](https://github.com/ionic-team/capacitor-plugins/commit/09bba168242c26b3816ab5ff5b15f22531935fec))
# [0.2.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/keyboard@0.1.0...@capacitor/keyboard@0.2.0) (2020-12-02)

@@ -8,0 +25,0 @@

+10
-9

@@ -133,3 +133,3 @@ {

"docs": "",
"type": "\"keyboardWillShow\""
"type": "'keyboardWillShow'"
},

@@ -154,3 +154,3 @@ {

],
"slug": "addlistener"
"slug": "addlistenerkeyboardwillshow-"
},

@@ -164,3 +164,3 @@ {

"docs": "",
"type": "\"keyboardDidShow\""
"type": "'keyboardDidShow'"
},

@@ -185,3 +185,3 @@ {

],
"slug": "addlistener"
"slug": "addlistenerkeyboarddidshow-"
},

@@ -195,3 +195,3 @@ {

"docs": "",
"type": "\"keyboardWillHide\""
"type": "'keyboardWillHide'"
},

@@ -215,3 +215,3 @@ {

],
"slug": "addlistener"
"slug": "addlistenerkeyboardwillhide-"
},

@@ -225,3 +225,3 @@ {

"docs": "",
"type": "\"keyboardDidHide\""
"type": "'keyboardDidHide'"
},

@@ -245,3 +245,3 @@ {

],
"slug": "addlistener"
"slug": "addlistenerkeyboarddidhide-"
},

@@ -430,3 +430,4 @@ {

}
]
],
"typeAliases": []
}
import type { PluginListenerHandle } from '@capacitor/core';
declare module '@capacitor/cli' {
interface PluginsConfig {
Keyboard?: {
/**
* Configure the way the app is resized when the Keyboard appears.
*
* Only available on iOS.
*
* @since 1.0.0
* @default native
*/
resize?: 'none' | 'native' | 'body' | 'ionic';
/**
* Use the dark style keyboard instead of the regular one.
*
* Only available on iOS.
*
* @since 1.0.0
*/
style?: 'dark';
};
}
}
export interface KeyboardInfo {

@@ -3,0 +26,0 @@ /**

@@ -0,1 +1,2 @@

/// <reference types="@capacitor/cli" />
export var KeyboardStyle;

@@ -2,0 +3,0 @@ (function (KeyboardStyle) {

@@ -1,1 +0,1 @@

{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAN,IAAY,aAcX;AAdD,WAAY,aAAa;IACvB;;;;OAIG;IACH,8BAAa,CAAA;IAEb;;;;OAIG;IACH,gCAAe,CAAA;AACjB,CAAC,EAdW,aAAa,KAAb,aAAa,QAcxB;AAWD,MAAM,CAAN,IAAY,cA4BX;AA5BD,WAAY,cAAc;IACxB;;;;OAIG;IACH,+BAAa,CAAA;IAEb;;;;OAIG;IACH,iCAAe,CAAA;IAEf;;;;OAIG;IACH,mCAAiB,CAAA;IAEjB;;;;OAIG;IACH,+BAAa,CAAA;AACf,CAAC,EA5BW,cAAc,KAAd,cAAc,QA4BzB"}
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC;AA+CxC,MAAM,CAAN,IAAY,aAcX;AAdD,WAAY,aAAa;IACvB;;;;OAIG;IACH,8BAAa,CAAA;IAEb;;;;OAIG;IACH,gCAAe,CAAA;AACjB,CAAC,EAdW,aAAa,KAAb,aAAa,QAcxB;AAWD,MAAM,CAAN,IAAY,cA4BX;AA5BD,WAAY,cAAc;IACxB;;;;OAIG;IACH,+BAAa,CAAA;IAEb;;;;OAIG;IACH,iCAAe,CAAA;IAEf;;;;OAIG;IACH,mCAAiB,CAAA;IAEjB;;;;OAIG;IACH,+BAAa,CAAA;AACf,CAAC,EA5BW,cAAc,KAAd,cAAc,QA4BzB"}
import type { KeyboardPlugin } from './definitions';
import { KeyboardResize, KeyboardStyle } from './definitions';
declare const Keyboard: KeyboardPlugin;
export { Keyboard, KeyboardResize, KeyboardStyle };
export * from './definitions';
export { Keyboard };
import { registerPlugin } from '@capacitor/core';
import { KeyboardResize, KeyboardStyle } from './definitions';
const Keyboard = registerPlugin('Keyboard');
export { Keyboard, KeyboardResize, KeyboardStyle };
export * from './definitions';
export { Keyboard };
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,QAAQ,GAAG,cAAc,CAAiB,UAAU,CAAC,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,QAAQ,GAAG,cAAc,CAAiB,UAAU,CAAC,CAAC;AAE5D,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
var capacitorKeyboard = (function (exports, core) {
'use strict';
/// <reference types="@capacitor/cli" />
(function (KeyboardStyle) {

@@ -5,0 +6,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js"],"sourcesContent":["export var KeyboardStyle;\n(function (KeyboardStyle) {\n /**\n * Dark keyboard.\n *\n * @since 1.0.0\n */\n KeyboardStyle[\"Dark\"] = \"DARK\";\n /**\n * Light keyboard.\n *\n * @since 1.0.0\n */\n KeyboardStyle[\"Light\"] = \"LIGHT\";\n})(KeyboardStyle || (KeyboardStyle = {}));\nexport var KeyboardResize;\n(function (KeyboardResize) {\n /**\n * Resizes the html body.\n *\n * @since 1.0.0\n */\n KeyboardResize[\"Body\"] = \"body\";\n /**\n * Resizes Ionic app\n *\n * @since 1.0.0\n */\n KeyboardResize[\"Ionic\"] = \"ionic\";\n /**\n * Resizes the WebView.\n *\n * @since 1.0.0\n */\n KeyboardResize[\"Native\"] = \"native\";\n /**\n * Don't resize anything.\n *\n * @since 1.0.0\n */\n KeyboardResize[\"None\"] = \"none\";\n})(KeyboardResize || (KeyboardResize = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nimport { KeyboardResize, KeyboardStyle } from './definitions';\nconst Keyboard = registerPlugin('Keyboard');\nexport { Keyboard, KeyboardResize, KeyboardStyle };\n//# sourceMappingURL=index.js.map"],"names":["KeyboardStyle","KeyboardResize","registerPlugin"],"mappings":";;;IACA,CAAC,UAAU,aAAa,EAAE;IAC1B;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACnC;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACrC,CAAC,EAAEA,qBAAa,KAAKA,qBAAa,GAAG,EAAE,CAAC,CAAC,CAAC;IAE1C,CAAC,UAAU,cAAc,EAAE;IAC3B;IACA;IACA;IACA;IACA;IACA,IAAI,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACpC;IACA;IACA;IACA;IACA;IACA,IAAI,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACtC;IACA;IACA;IACA;IACA;IACA,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IACxC;IACA;IACA;IACA;IACA;IACA,IAAI,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACpC,CAAC,EAAEC,sBAAc,KAAKA,sBAAc,GAAG,EAAE,CAAC,CAAC;;ACvCtC,UAAC,QAAQ,GAAGC,mBAAc,CAAC,UAAU;;;;;;;;;;;;"}
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js"],"sourcesContent":["/// <reference types=\"@capacitor/cli\" />\nexport var KeyboardStyle;\n(function (KeyboardStyle) {\n /**\n * Dark keyboard.\n *\n * @since 1.0.0\n */\n KeyboardStyle[\"Dark\"] = \"DARK\";\n /**\n * Light keyboard.\n *\n * @since 1.0.0\n */\n KeyboardStyle[\"Light\"] = \"LIGHT\";\n})(KeyboardStyle || (KeyboardStyle = {}));\nexport var KeyboardResize;\n(function (KeyboardResize) {\n /**\n * Resizes the html body.\n *\n * @since 1.0.0\n */\n KeyboardResize[\"Body\"] = \"body\";\n /**\n * Resizes Ionic app\n *\n * @since 1.0.0\n */\n KeyboardResize[\"Ionic\"] = \"ionic\";\n /**\n * Resizes the WebView.\n *\n * @since 1.0.0\n */\n KeyboardResize[\"Native\"] = \"native\";\n /**\n * Don't resize anything.\n *\n * @since 1.0.0\n */\n KeyboardResize[\"None\"] = \"none\";\n})(KeyboardResize || (KeyboardResize = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst Keyboard = registerPlugin('Keyboard');\nexport * from './definitions';\nexport { Keyboard };\n//# sourceMappingURL=index.js.map"],"names":["KeyboardStyle","KeyboardResize","registerPlugin"],"mappings":";;;IAAA;IAEA,CAAC,UAAU,aAAa,EAAE;IAC1B;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACnC;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACrC,CAAC,EAAEA,qBAAa,KAAKA,qBAAa,GAAG,EAAE,CAAC,CAAC,CAAC;IAE1C,CAAC,UAAU,cAAc,EAAE;IAC3B;IACA;IACA;IACA;IACA;IACA,IAAI,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACpC;IACA;IACA;IACA;IACA;IACA,IAAI,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACtC;IACA;IACA;IACA;IACA;IACA,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IACxC;IACA;IACA;IACA;IACA;IACA,IAAI,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACpC,CAAC,EAAEC,sBAAc,KAAKA,sBAAc,GAAG,EAAE,CAAC,CAAC;;ACzCtC,UAAC,QAAQ,GAAGC,mBAAc,CAAC,UAAU;;;;;;;;;;;;"}

@@ -57,5 +57,4 @@ /*

{
if ([self.bridge.config getValue:@"ios.scrollEnabled"] != nil) {
self.disableScroll = ![[self.bridge.config getValue:@"ios.scrollEnabled"] boolValue];
}
self.disableScroll = !self.bridge.config.enableScrolling;
UIClassString = [@[@"UI", @"Web", @"Browser", @"View"] componentsJoinedByString:@""];

@@ -62,0 +61,0 @@ WKClassString = [@[@"WK", @"Content", @"View"] componentsJoinedByString:@""];

{
"name": "@capacitor/keyboard",
"version": "0.2.0",
"version": "0.3.0",
"description": "The Keyboard API provides keyboard display and visibility control, along with event tracking when the keyboard shows and hides.",

@@ -46,6 +46,7 @@ "main": "dist/esm/index.js",

"devDependencies": {
"@capacitor/android": "^3.0.0-alpha.7",
"@capacitor/core": "^3.0.0-alpha.7",
"@capacitor/docgen": "^0.0.10",
"@capacitor/ios": "^3.0.0-alpha.7",
"@capacitor/android": "^3.0.0-alpha.10",
"@capacitor/cli": "^3.0.0-alpha.9",
"@capacitor/core": "^3.0.0-alpha.9",
"@capacitor/docgen": "0.0.14",
"@capacitor/ios": "^3.0.0-alpha.9",
"@ionic/eslint-config": "^0.3.0",

@@ -63,3 +64,3 @@ "@ionic/prettier-config": "~1.0.1",

"peerDependencies": {
"@capacitor/core": "^3.0.0-alpha.6"
"@capacitor/core": "^3.0.0-alpha.9"
},

@@ -82,3 +83,3 @@ "prettier": "@ionic/prettier-config",

},
"gitHead": "78c1981920988ec84c17bbc61b1da1df9743571c"
"gitHead": "481260d148b920b85755dd5f9b65df0bb0db4244"
}
+67
-12

@@ -12,2 +12,57 @@ # @capacitor/keyboard

## Example
```typescript
import { Keyboard } from '@capacitor/keyboard';
Keyboard.addListener('keyboardWillShow', info => {
console.log('keyboard will show with height:', info.keyboardHeight);
});
Keyboard.addListener('keyboardDidShow', info => {
console.log('keyboard did show with height:', info.keyboardHeight);
});
Keyboard.addListener('keyboardWillHide', () => {
console.log('keyboard will hide');
});
Keyboard.addListener('keyboardDidHide', () => {
console.log('keyboard did hide');
});
```
## Configuration
On iOS, the keyboard can be configured with the following options:
- `resize`: Configures the way the app is resized when the keyboard appears. Allowed values are:
- `none`: Neither the app nor the Web View are resized
- `native`: (default) The whole native Web View will be resized when the keyboard shows/hides. This affects the `vh` relative unit.
- `body`: Only the `<body>` HTML element will be resized. Relative units are not affected, because the viewport does not change.
- `ionic`: Only the `<ion-app>` HTML element will be resized. Use it only for Ionic Framework apps.
- `style`: If set to `dark` it will use dark style keyboard instead of the regular one.
```json
{
"pluginsConfig": {
"Keyboard": {
"resize": "body",
"style": "dark"
}
}
}
```
## Compatibility with `cordova-plugin-ionic-keyboard`
To maintain compatibility with
[`cordova-plugin-ionic-keyboard`](https://github.com/ionic-team/cordova-plugin-ionic-keyboard),
the following events also work with `window.addEventListener`:
- `keyboardWillShow`
- `keyboardDidShow`
- `keyboardWillHide`
- `keyboardDidHide`
## API

@@ -23,6 +78,6 @@

* [`setResizeMode(...)`](#setresizemode)
* [`addListener(...)`](#addlistener)
* [`addListener(...)`](#addlistener)
* [`addListener(...)`](#addlistener)
* [`addListener(...)`](#addlistener)
* [`addListener('keyboardWillShow', ...)`](#addlistenerkeyboardwillshow-)
* [`addListener('keyboardDidShow', ...)`](#addlistenerkeyboarddidshow-)
* [`addListener('keyboardWillHide', ...)`](#addlistenerkeyboardwillhide-)
* [`addListener('keyboardDidHide', ...)`](#addlistenerkeyboarddidhide-)
* [`removeAllListeners()`](#removealllisteners)

@@ -142,3 +197,3 @@ * [Interfaces](#interfaces)

### addListener(...)
### addListener('keyboardWillShow', ...)

@@ -153,3 +208,3 @@ ```typescript

| ------------------ | ------------------------------------------------------------------------ |
| **`eventName`** | <code>"keyboardWillShow"</code> |
| **`eventName`** | <code>'keyboardWillShow'</code> |
| **`listenerFunc`** | <code>(info: <a href="#keyboardinfo">KeyboardInfo</a>) =&gt; void</code> |

@@ -164,3 +219,3 @@

### addListener(...)
### addListener('keyboardDidShow', ...)

@@ -175,3 +230,3 @@ ```typescript

| ------------------ | ------------------------------------------------------------------------ |
| **`eventName`** | <code>"keyboardDidShow"</code> |
| **`eventName`** | <code>'keyboardDidShow'</code> |
| **`listenerFunc`** | <code>(info: <a href="#keyboardinfo">KeyboardInfo</a>) =&gt; void</code> |

@@ -186,3 +241,3 @@

### addListener(...)
### addListener('keyboardWillHide', ...)

@@ -197,3 +252,3 @@ ```typescript

| ------------------ | ------------------------------- |
| **`eventName`** | <code>"keyboardWillHide"</code> |
| **`eventName`** | <code>'keyboardWillHide'</code> |
| **`listenerFunc`** | <code>() =&gt; void</code> |

@@ -208,3 +263,3 @@

### addListener(...)
### addListener('keyboardDidHide', ...)

@@ -219,3 +274,3 @@ ```typescript

| ------------------ | ------------------------------ |
| **`eventName`** | <code>"keyboardDidHide"</code> |
| **`eventName`** | <code>'keyboardDidHide'</code> |
| **`listenerFunc`** | <code>() =&gt; void</code> |

@@ -222,0 +277,0 @@