@capgo/capacitor-textinteraction 7.0.9 → 7.1.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.
- package/README.md +4 -0
- package/android/src/main/java/app/capgo/plugin/textinteraction/TextInteractionPlugin.java +13 -0
- package/dist/docs.json +21 -1
- package/dist/esm/definitions.d.ts +9 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +3 -0
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/TextInteractionPlugin/TextInteractionPlugin.swift +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,6 +69,10 @@ iOS only.
|
|
|
69
69
|
| ------------- | -------------------- | ------------------------------------------------------------------------------------------------ |
|
|
70
70
|
| **`success`** | <code>boolean</code> | `true` when the platform supports toggling text interaction (iOS >= 14.5), otherwise `false`. |
|
|
71
71
|
|
|
72
|
+
| Method | Signature | Description |
|
|
73
|
+
| -------------------- | -------------------------------------------- | --------------------------------------- |
|
|
74
|
+
| **getPluginVersion** | () => Promise<{ version: string; }> | Get the native Capacitor plugin version |
|
|
75
|
+
|
|
72
76
|
|
|
73
77
|
#### TextInteractionOptions
|
|
74
78
|
|
|
@@ -9,6 +9,8 @@ import com.getcapacitor.annotation.CapacitorPlugin;
|
|
|
9
9
|
@CapacitorPlugin(name = "TextInteraction")
|
|
10
10
|
public class TextInteractionPlugin extends Plugin {
|
|
11
11
|
|
|
12
|
+
private final String PLUGIN_VERSION = "7.1.1";
|
|
13
|
+
|
|
12
14
|
private TextInteraction implementation = new TextInteraction();
|
|
13
15
|
|
|
14
16
|
@PluginMethod
|
|
@@ -19,4 +21,15 @@ public class TextInteractionPlugin extends Plugin {
|
|
|
19
21
|
ret.put("success", implementation.toggle(enabled));
|
|
20
22
|
call.resolve(ret);
|
|
21
23
|
}
|
|
24
|
+
|
|
25
|
+
@PluginMethod
|
|
26
|
+
public void getPluginVersion(final PluginCall call) {
|
|
27
|
+
try {
|
|
28
|
+
final JSObject ret = new JSObject();
|
|
29
|
+
ret.put("version", this.PLUGIN_VERSION);
|
|
30
|
+
call.resolve(ret);
|
|
31
|
+
} catch (final Exception e) {
|
|
32
|
+
call.reject("Could not get plugin version", e);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
22
35
|
}
|
package/dist/docs.json
CHANGED
|
@@ -33,7 +33,27 @@
|
|
|
33
33
|
"slug": "textinteractionresult",
|
|
34
34
|
"docs": "",
|
|
35
35
|
"tags": [],
|
|
36
|
-
"methods": [
|
|
36
|
+
"methods": [
|
|
37
|
+
{
|
|
38
|
+
"name": "getPluginVersion",
|
|
39
|
+
"signature": "() => Promise<{ version: string; }>",
|
|
40
|
+
"parameters": [],
|
|
41
|
+
"returns": "Promise<{ version: string; }>",
|
|
42
|
+
"tags": [
|
|
43
|
+
{
|
|
44
|
+
"name": "returns",
|
|
45
|
+
"text": "an Promise with version for this device"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "throws",
|
|
49
|
+
"text": "An error if the something went wrong"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"docs": "Get the native Capacitor plugin version",
|
|
53
|
+
"complexTypes": [],
|
|
54
|
+
"slug": "getpluginversion"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
37
57
|
"properties": [
|
|
38
58
|
{
|
|
39
59
|
"name": "success",
|
|
@@ -21,4 +21,13 @@ export interface TextInteractionResult {
|
|
|
21
21
|
* `true` when the platform supports toggling text interaction (iOS >= 14.5), otherwise `false`.
|
|
22
22
|
*/
|
|
23
23
|
success: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Get the native Capacitor plugin version
|
|
26
|
+
*
|
|
27
|
+
* @returns {Promise<{ id: string }>} an Promise with version for this device
|
|
28
|
+
* @throws An error if the something went wrong
|
|
29
|
+
*/
|
|
30
|
+
getPluginVersion(): Promise<{
|
|
31
|
+
version: string;
|
|
32
|
+
}>;
|
|
24
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface TextInteractionPlugin {\n /**\n * Toggle text interaction (selection) on the Capacitor WebView.\n *\n * ⚠️ Disabling text interaction prevents all text input controls from working while disabled.\n * Use it sparingly and re-enable when text entry is required.\n *\n * iOS only.\n */\n toggle(options: TextInteractionOptions): Promise<TextInteractionResult>;\n}\n\nexport interface TextInteractionOptions {\n /**\n * Whether text interaction should be enabled or disabled. Disabling hides the\n * magnifier lens reintroduced with iOS 15.\n */\n enabled: boolean;\n}\n\nexport interface TextInteractionResult {\n /**\n * `true` when the platform supports toggling text interaction (iOS >= 14.5), otherwise `false`.\n */\n success: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface TextInteractionPlugin {\n /**\n * Toggle text interaction (selection) on the Capacitor WebView.\n *\n * ⚠️ Disabling text interaction prevents all text input controls from working while disabled.\n * Use it sparingly and re-enable when text entry is required.\n *\n * iOS only.\n */\n toggle(options: TextInteractionOptions): Promise<TextInteractionResult>;\n}\n\nexport interface TextInteractionOptions {\n /**\n * Whether text interaction should be enabled or disabled. Disabling hides the\n * magnifier lens reintroduced with iOS 15.\n */\n enabled: boolean;\n}\n\nexport interface TextInteractionResult {\n /**\n * `true` when the platform supports toggling text interaction (iOS >= 14.5), otherwise `false`.\n */\n success: boolean;\n\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -2,4 +2,7 @@ import { WebPlugin } from '@capacitor/core';
|
|
|
2
2
|
import type { TextInteractionPlugin, TextInteractionOptions, TextInteractionResult } from './definitions';
|
|
3
3
|
export declare class TextInteractionWeb extends WebPlugin implements TextInteractionPlugin {
|
|
4
4
|
toggle(_options: TextInteractionOptions): Promise<TextInteractionResult>;
|
|
5
|
+
getPluginVersion(): Promise<{
|
|
6
|
+
version: string;
|
|
7
|
+
}>;
|
|
5
8
|
}
|
package/dist/esm/web.js
CHANGED
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C,KAAK,CAAC,MAAM,CAAC,QAAgC;QAC3C,MAAM,IAAI,CAAC,aAAa,CAAC,gDAAgD,CAAC,CAAC;IAC7E,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { TextInteractionPlugin, TextInteractionOptions, TextInteractionResult } from './definitions';\n\nexport class TextInteractionWeb extends WebPlugin implements TextInteractionPlugin {\n async toggle(_options: TextInteractionOptions): Promise<TextInteractionResult> {\n throw this.unimplemented('TextInteraction.toggle is not available on web');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C,KAAK,CAAC,MAAM,CAAC,QAAgC;QAC3C,MAAM,IAAI,CAAC,aAAa,CAAC,gDAAgD,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { TextInteractionPlugin, TextInteractionOptions, TextInteractionResult } from './definitions';\n\nexport class TextInteractionWeb extends WebPlugin implements TextInteractionPlugin {\n async toggle(_options: TextInteractionOptions): Promise<TextInteractionResult> {\n throw this.unimplemented('TextInteraction.toggle is not available on web');\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -10,6 +10,9 @@ class TextInteractionWeb extends core.WebPlugin {
|
|
|
10
10
|
async toggle(_options) {
|
|
11
11
|
throw this.unimplemented('TextInteraction.toggle is not available on web');
|
|
12
12
|
}
|
|
13
|
+
async getPluginVersion() {
|
|
14
|
+
return { version: 'web' };
|
|
15
|
+
}
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst TextInteraction = registerPlugin('TextInteraction', {\n web: () => import('./web').then((m) => new m.TextInteractionWeb()),\n});\nexport * from './definitions';\nexport { TextInteraction };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class TextInteractionWeb extends WebPlugin {\n async toggle(_options) {\n throw this.unimplemented('TextInteraction.toggle is not available on web');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,eAAe,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;AAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;AACtE,CAAC;;ACFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;AAClD,IAAI,MAAM,MAAM,CAAC,QAAQ,EAAE;AAC3B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gDAAgD,CAAC;AAClF,IAAI;AACJ;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst TextInteraction = registerPlugin('TextInteraction', {\n web: () => import('./web').then((m) => new m.TextInteractionWeb()),\n});\nexport * from './definitions';\nexport { TextInteraction };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class TextInteractionWeb extends WebPlugin {\n async toggle(_options) {\n throw this.unimplemented('TextInteraction.toggle is not available on web');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,eAAe,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;AAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;AACtE,CAAC;;ACFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;AAClD,IAAI,MAAM,MAAM,CAAC,QAAQ,EAAE;AAC3B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gDAAgD,CAAC;AAClF,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -9,6 +9,9 @@ var capacitorTextInteraction = (function (exports, core) {
|
|
|
9
9
|
async toggle(_options) {
|
|
10
10
|
throw this.unimplemented('TextInteraction.toggle is not available on web');
|
|
11
11
|
}
|
|
12
|
+
async getPluginVersion() {
|
|
13
|
+
return { version: 'web' };
|
|
14
|
+
}
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst TextInteraction = registerPlugin('TextInteraction', {\n web: () => import('./web').then((m) => new m.TextInteractionWeb()),\n});\nexport * from './definitions';\nexport { TextInteraction };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class TextInteractionWeb extends WebPlugin {\n async toggle(_options) {\n throw this.unimplemented('TextInteraction.toggle is not available on web');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,eAAe,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;IAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACtE,CAAC;;ICFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;IAClD,IAAI,MAAM,MAAM,CAAC,QAAQ,EAAE;IAC3B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gDAAgD,CAAC;IAClF,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst TextInteraction = registerPlugin('TextInteraction', {\n web: () => import('./web').then((m) => new m.TextInteractionWeb()),\n});\nexport * from './definitions';\nexport { TextInteraction };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class TextInteractionWeb extends WebPlugin {\n async toggle(_options) {\n throw this.unimplemented('TextInteraction.toggle is not available on web');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,eAAe,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;IAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACtE,CAAC;;ICFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;IAClD,IAAI,MAAM,MAAM,CAAC,QAAQ,EAAE;IAC3B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gDAAgD,CAAC;IAClF,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -7,10 +7,12 @@ import Capacitor
|
|
|
7
7
|
*/
|
|
8
8
|
@objc(TextInteractionPlugin)
|
|
9
9
|
public class TextInteractionPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
10
|
+
private let PLUGIN_VERSION: String = "7.1.1"
|
|
10
11
|
public let identifier = "TextInteractionPlugin"
|
|
11
12
|
public let jsName = "TextInteraction"
|
|
12
13
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
13
|
-
CAPPluginMethod(name: "toggle", returnType: CAPPluginReturnPromise)
|
|
14
|
+
CAPPluginMethod(name: "toggle", returnType: CAPPluginReturnPromise),
|
|
15
|
+
CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
|
|
14
16
|
]
|
|
15
17
|
private let implementation = TextInteraction()
|
|
16
18
|
|
|
@@ -24,4 +26,9 @@ public class TextInteractionPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
24
26
|
])
|
|
25
27
|
}
|
|
26
28
|
}
|
|
29
|
+
|
|
30
|
+
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
31
|
+
call.resolve(["version": self.PLUGIN_VERSION])
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
}
|