@capacitor/screen-reader 1.0.6 → 4.0.0-beta.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,53 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 4.0.0-beta.0 (2022-06-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * add es2017 lib to tsconfig ([#180](https://github.com/ionic-team/capacitor-plugins/issues/180)) ([2c3776c](https://github.com/ionic-team/capacitor-plugins/commit/2c3776c38ca025c5ee965dec10ccf1cdb6c02e2f))
12
+ * better ignore rules for npm distribution ([#32](https://github.com/ionic-team/capacitor-plugins/issues/32)) ([b8d55b9](https://github.com/ionic-team/capacitor-plugins/commit/b8d55b9233e4ad7b8a1cd41110b4e580fc2a059f))
13
+ * correct addListeners links ([#655](https://github.com/ionic-team/capacitor-plugins/issues/655)) ([f9871e7](https://github.com/ionic-team/capacitor-plugins/commit/f9871e7bd53478addb21155e148829f550c0e457))
14
+ * inline source code in esm map files ([#760](https://github.com/ionic-team/capacitor-plugins/issues/760)) ([a960489](https://github.com/ionic-team/capacitor-plugins/commit/a960489a19db0182b90d187a50deff9dfbe51038))
15
+ * Make removeAllListeners return a promise ([#895](https://github.com/ionic-team/capacitor-plugins/issues/895)) ([e5c49d6](https://github.com/ionic-team/capacitor-plugins/commit/e5c49d64445dca70286334e6a0441d8021197b13))
16
+ * remove postpublish scripts ([#656](https://github.com/ionic-team/capacitor-plugins/issues/656)) ([ed6ac49](https://github.com/ionic-team/capacitor-plugins/commit/ed6ac499ebf4a47525071ccbfc36c27503e11f60))
17
+ * 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))
18
+ * use correct package in manifest files ([#22](https://github.com/ionic-team/capacitor-plugins/issues/22)) ([ab62987](https://github.com/ionic-team/capacitor-plugins/commit/ab629877e1951f944594f1b23e1bffefcbc783dd))
19
+
20
+
21
+ ### Features
22
+
23
+ * add commonjs output format ([#179](https://github.com/ionic-team/capacitor-plugins/issues/179)) ([8e9e098](https://github.com/ionic-team/capacitor-plugins/commit/8e9e09862064b3f6771d7facbc4008e995d9b463))
24
+ * Screen Reader plugin ([#1](https://github.com/ionic-team/capacitor-plugins/issues/1)) ([d0ab633](https://github.com/ionic-team/capacitor-plugins/commit/d0ab63335a3ba1d303dc11e0fc72767200e6390b))
25
+ * set targetSDK default value to 31 ([#824](https://github.com/ionic-team/capacitor-plugins/issues/824)) ([3ee10de](https://github.com/ionic-team/capacitor-plugins/commit/3ee10de98067984c1a4e75295d001c5a895c47f4))
26
+ * set targetSDK default value to 32 ([#970](https://github.com/ionic-team/capacitor-plugins/issues/970)) ([fa70d96](https://github.com/ionic-team/capacitor-plugins/commit/fa70d96f141af751aae53ceb5642c46b204f5958))
27
+ * Upgrade gradle to 7.4 ([#826](https://github.com/ionic-team/capacitor-plugins/issues/826)) ([5db0906](https://github.com/ionic-team/capacitor-plugins/commit/5db0906f6264287c4f8e69dbaecf19d4d387824b))
28
+ * Use java 11 ([#910](https://github.com/ionic-team/capacitor-plugins/issues/910)) ([5acb2a2](https://github.com/ionic-team/capacitor-plugins/commit/5acb2a288a413492b163e4e97da46a085d9e4be0))
29
+
30
+
31
+
32
+
33
+
34
+ ## [1.0.8](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-reader@1.0.7...@capacitor/screen-reader@1.0.8) (2022-03-03)
35
+
36
+ **Note:** Version bump only for package @capacitor/screen-reader
37
+
38
+
39
+
40
+
41
+
42
+ ## [1.0.7](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-reader@1.0.6...@capacitor/screen-reader@1.0.7) (2022-01-19)
43
+
44
+
45
+ ### Bug Fixes
46
+
47
+ * inline source code in esm map files ([#760](https://github.com/ionic-team/capacitor-plugins/issues/760)) ([a960489](https://github.com/ionic-team/capacitor-plugins/commit/a960489a19db0182b90d187a50deff9dfbe51038))
48
+
49
+
50
+
51
+
52
+
6
53
  ## [1.0.6](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-reader@1.0.5...@capacitor/screen-reader@1.0.6) (2021-11-03)
7
54
 
8
55
  **Note:** Version bump only for package @capacitor/screen-reader
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
11
11
  s.author = package['author']
12
12
  s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] }
13
13
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}', 'screen-reader/ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
- s.ios.deployment_target = '12.0'
14
+ s.ios.deployment_target = '13.0'
15
15
  s.dependency 'Capacitor'
16
16
  s.swift_version = '5.1'
17
17
  end
package/README.md CHANGED
@@ -21,7 +21,7 @@ ScreenReader.addListener('screenReaderStateChange', ({ value }) => {
21
21
  const checkScreenReaderEnabled = async () => {
22
22
  const { value } = await ScreenReader.isEnabled();
23
23
 
24
- alert('Voice over enabled? ' + value);
24
+ console.log('Voice over enabled? ' + value);
25
25
  };
26
26
 
27
27
  const sayHello = async () => {
@@ -1,8 +1,8 @@
1
1
  ext {
2
- junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.1'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.2'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.3.0'
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
6
6
  }
7
7
 
8
8
  buildscript {
@@ -11,17 +11,17 @@ buildscript {
11
11
  mavenCentral()
12
12
  }
13
13
  dependencies {
14
- classpath 'com.android.tools.build:gradle:4.2.1'
14
+ classpath 'com.android.tools.build:gradle:7.2.1'
15
15
  }
16
16
  }
17
17
 
18
18
  apply plugin: 'com.android.library'
19
19
 
20
20
  android {
21
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
21
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
22
22
  defaultConfig {
23
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
24
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
23
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
24
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
25
25
  versionCode 1
26
26
  versionName "1.0"
27
27
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -36,14 +36,13 @@ android {
36
36
  abortOnError false
37
37
  }
38
38
  compileOptions {
39
- sourceCompatibility JavaVersion.VERSION_1_8
40
- targetCompatibility JavaVersion.VERSION_1_8
39
+ sourceCompatibility JavaVersion.VERSION_11
40
+ targetCompatibility JavaVersion.VERSION_11
41
41
  }
42
42
  }
43
43
 
44
44
  repositories {
45
45
  google()
46
- jcenter()
47
46
  mavenCentral()
48
47
  }
49
48
 
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface SpeakOptions {\n /**\n * The text to speak.\n *\n * @since 1.0.0\n */\n value: string;\n\n /**\n * The language to speak the text in, as its [ISO 639-1\n * Code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g.: \"en\").\n *\n * This option is only supported on Android.\n *\n * @since 1.0.0\n */\n language?: string;\n}\n\nexport interface ScreenReaderState {\n /**\n * Whether a Screen Reader is currently active.\n *\n * @since 1.0.0\n */\n value: boolean;\n}\n\nexport type StateChangeListener = (state: ScreenReaderState) => void;\n\nexport interface ScreenReaderPlugin {\n /**\n * Whether a Screen Reader is currently active.\n *\n * This method is not supported on web (it is not possible to detect Screen\n * Readers).\n *\n * @since 1.0.0\n */\n isEnabled(): Promise<{ value: boolean }>;\n\n /**\n * Text-to-Speech functionality.\n *\n * This function will only work if a Screen Reader is currently active.\n *\n * On web, browsers must support the [SpeechSynthesis\n * API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis), or\n * this method will throw an error.\n *\n * For more text-to-speech capabilities, please see the [Capacitor Community\n * Text-to-Speech\n * plugin](https://github.com/capacitor-community/text-to-speech).\n *\n * @since 1.0.0\n */\n speak(options: SpeakOptions): Promise<void>;\n\n /**\n * Add a listener for when the screen reader is turned on or off.\n *\n * This event used to be named `'accessibilityScreenReaderStateChange'`.\n *\n * This method is not supported on web (it is not possible to detect Screen\n * Readers).\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'stateChange',\n listener: StateChangeListener,\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Remove all the listeners that are attached to this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * @deprecated Use `SpeakOptions`.\n * @since 1.0.0\n */\nexport type AccessibilitySpeakOptions = SpeakOptions;\n\n/**\n * @deprecated Use `StateChangeListener`.\n * @since 1.0.0\n */\nexport type ScreenReaderStateChangeCallback = StateChangeListener;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,YAAY,GAAG,cAAc,CAAqB,cAAc,EAAE;IACtE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;CAC9D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,YAAY,GAAG,cAAc,CAAqB,cAAc,EAAE;IACtE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;CAC9D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { ScreenReaderPlugin } from './definitions';\n\nconst ScreenReader = registerPlugin<ScreenReaderPlugin>('ScreenReader', {\n web: () => import('./web').then(m => new m.ScreenReaderWeb()),\n});\n\nexport * from './definitions';\nexport { ScreenReader };\n"]}
@@ -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,eAAgB,SAAQ,SAAS;IAC5C,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAAqB;QAC/B,IAAI,CAAC,CAAC,iBAAiB,IAAI,MAAM,CAAC,EAAE;YAClC,MAAM,IAAI,CAAC,WAAW,CACpB,kDAAkD,CACnD,CAAC;SACH;QAED,MAAM,SAAS,GAAG,IAAI,wBAAwB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAE9D,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,SAAS,CAAC,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC;SACnC;QAED,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;CACF"}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAAqB;QAC/B,IAAI,CAAC,CAAC,iBAAiB,IAAI,MAAM,CAAC,EAAE;YAClC,MAAM,IAAI,CAAC,WAAW,CACpB,kDAAkD,CACnD,CAAC;SACH;QAED,MAAM,SAAS,GAAG,IAAI,wBAAwB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAE9D,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,SAAS,CAAC,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC;SACnC;QAED,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { ScreenReaderPlugin, SpeakOptions } from './definitions';\n\nexport class ScreenReaderWeb extends WebPlugin implements ScreenReaderPlugin {\n async isEnabled(): Promise<never> {\n throw this.unavailable('This feature is not available in the browser.');\n }\n\n async speak(options: SpeakOptions): Promise<void> {\n if (!('speechSynthesis' in window)) {\n throw this.unavailable(\n 'Browser does not support the SpeechSynthesis API',\n );\n }\n\n const utterance = new SpeechSynthesisUtterance(options.value);\n\n if (options.language) {\n utterance.lang = options.language;\n }\n\n speechSynthesis.speak(utterance);\n }\n}\n"]}
@@ -6,5 +6,5 @@
6
6
  CAP_PLUGIN(ScreenReaderPlugin, "ScreenReader",
7
7
  CAP_PLUGIN_METHOD(speak, CAPPluginReturnPromise);
8
8
  CAP_PLUGIN_METHOD(isEnabled, CAPPluginReturnPromise);
9
- CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnNone);
9
+ CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnPromise);
10
10
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/screen-reader",
3
- "version": "1.0.6",
3
+ "version": "4.0.0-beta.0",
4
4
  "description": "The Screen Reader API provides access to TalkBack/VoiceOver/etc. and provides simple text-to-speech capabilities for visual accessibility.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "scripts": {
31
31
  "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
32
- "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..",
32
+ "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
33
33
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
34
34
  "verify:web": "npm run build",
35
35
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
@@ -45,10 +45,10 @@
45
45
  "publish:cocoapod": "pod trunk push ./CapacitorScreenReader.podspec --allow-warnings"
46
46
  },
47
47
  "devDependencies": {
48
- "@capacitor/android": "^3.0.0",
49
- "@capacitor/core": "^3.0.0",
48
+ "@capacitor/android": "next",
49
+ "@capacitor/core": "next",
50
50
  "@capacitor/docgen": "0.0.18",
51
- "@capacitor/ios": "^3.0.0",
51
+ "@capacitor/ios": "next",
52
52
  "@ionic/eslint-config": "^0.3.0",
53
53
  "@ionic/prettier-config": "~1.0.1",
54
54
  "@ionic/swiftlint-config": "^1.1.2",
@@ -61,7 +61,7 @@
61
61
  "typescript": "~4.1.5"
62
62
  },
63
63
  "peerDependencies": {
64
- "@capacitor/core": "^3.0.0"
64
+ "@capacitor/core": "next"
65
65
  },
66
66
  "prettier": "@ionic/prettier-config",
67
67
  "swiftlint": "@ionic/swiftlint-config",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "64df93225736e9dfad336562f5e53e5a2243052b"
82
+ "gitHead": "fd7db8285f72990522da0adc889514c9804b6dae"
83
83
  }