@capacitor/barcode-scanner 3.0.3-dev-20260626T161157.0 → 3.0.3-dev-20260703T174419.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.
@@ -13,6 +13,6 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '15.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'OSBarcodeLib', '2.0.1'
16
+ s.dependency 'OSBarcodeLib', '2.2.0'
17
17
  s.swift_version = '5.1'
18
18
  end
package/Package.swift CHANGED
@@ -11,7 +11,7 @@ let package = Package(
11
11
  ],
12
12
  dependencies: [
13
13
  .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0"),
14
- .package(url: "https://github.com/OutSystems/OSBarcodeLib-iOS.git", from: "2.1.1")
14
+ .package(url: "https://github.com/OutSystems/OSBarcodeLib-iOS.git", from: "2.2.0")
15
15
  ],
16
16
  targets: [
17
17
  .target(
package/README.md CHANGED
@@ -90,7 +90,7 @@ to represent the hint for the type of barcode to be scanned.
90
90
 
91
91
  Defines the options for configuring a barcode scan.
92
92
 
93
- <code>{ hint: <a href="#capacitorbarcodescannertypehint">CapacitorBarcodeScannerTypeHint</a>; scanInstructions?: string; scanButton?: boolean; scanText?: string; cameraDirection?: <a href="#capacitorbarcodescannercameradirection">CapacitorBarcodeScannerCameraDirection</a>; scanOrientation?: <a href="#capacitorbarcodescannerscanorientation">CapacitorBarcodeScannerScanOrientation</a>; android?: { scanningLibrary?: <a href="#capacitorbarcodescannerandroidscanninglibrary">CapacitorBarcodeScannerAndroidScanningLibrary</a>; }; web?: { showCameraSelection?: boolean; scannerFPS?: number; }; }</code>
93
+ <code>{ hint: <a href="#capacitorbarcodescannertypehint">CapacitorBarcodeScannerTypeHint</a>; scanInstructions?: string; scanButton?: boolean; scanText?: string; cameraDirection?: <a href="#capacitorbarcodescannercameradirection">CapacitorBarcodeScannerCameraDirection</a>; scanOrientation?: <a href="#capacitorbarcodescannerscanorientation">CapacitorBarcodeScannerScanOrientation</a>; /** * Accessibility label (alternative text) read by screen readers for the cancel button. * When omitted, no accessibility label is set. Has no effect on web. */ cancelButtonAccessibilityLabel?: string; /** * Accessibility label (alternative text) read by screen readers for the torch button when the torch is on. * When omitted, no accessibility label is set. Has no effect on web. */ torchButtonOnAccessibilityLabel?: string; /** * Accessibility label (alternative text) read by screen readers for the torch button when the torch is off. * When omitted, no accessibility label is set. Has no effect on web. */ torchButtonOffAccessibilityLabel?: string; android?: { scanningLibrary?: <a href="#capacitorbarcodescannerandroidscanninglibrary">CapacitorBarcodeScannerAndroidScanningLibrary</a>; }; web?: { showCameraSelection?: boolean; scannerFPS?: number; }; }</code>
94
94
 
95
95
 
96
96
  ### Enums
@@ -59,7 +59,7 @@ repositories {
59
59
  }
60
60
 
61
61
  dependencies {
62
- implementation "io.ionic.libs:ionbarcode-android:2.0.2@aar"
62
+ implementation "io.ionic.libs:ionbarcode-android:2.1.0@aar"
63
63
  implementation project(':capacitor-android')
64
64
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
65
65
  implementation 'androidx.activity:activity-ktx:1.11.0'
@@ -39,6 +39,9 @@ class CapacitorBarcodeScannerPlugin : Plugin() {
39
39
  val cameraDirection = call.getInt("cameraDirection")
40
40
  val scanOrientation = call.getInt("scanOrientation")
41
41
  val androidScanningLibrary = call.getObject("android")?.getString("scanningLibrary")
42
+ val cancelButtonAccessibilityLabel = call.getString("cancelButtonAccessibilityLabel")
43
+ val torchButtonOnAccessibilityLabel = call.getString("torchButtonOnAccessibilityLabel")
44
+ val torchButtonOffAccessibilityLabel = call.getString("torchButtonOffAccessibilityLabel")
42
45
 
43
46
  val parameters = OSBARCScanParameters(
44
47
  scanInstructions = scanInstructions,
@@ -47,7 +50,10 @@ class CapacitorBarcodeScannerPlugin : Plugin() {
47
50
  scanButton = scanButton,
48
51
  scanText = scanText,
49
52
  hint = hint,
50
- androidScanningLibrary = androidScanningLibrary
53
+ androidScanningLibrary = androidScanningLibrary,
54
+ cancelButtonAccessibilityLabel = cancelButtonAccessibilityLabel,
55
+ torchButtonOnAccessibilityLabel = torchButtonOnAccessibilityLabel,
56
+ torchButtonOffAccessibilityLabel = torchButtonOffAccessibilityLabel
51
57
  )
52
58
 
53
59
  val scanIntent = Intent(activity, OSBARCScannerActivity::class.java)
package/dist/docs.json CHANGED
@@ -249,7 +249,7 @@
249
249
  "docs": "Defines the options for configuring a barcode scan.",
250
250
  "types": [
251
251
  {
252
- "text": "{\n hint: CapacitorBarcodeScannerTypeHint;\n scanInstructions?: string;\n scanButton?: boolean;\n scanText?: string;\n cameraDirection?: CapacitorBarcodeScannerCameraDirection;\n scanOrientation?: CapacitorBarcodeScannerScanOrientation;\n android?: {\n scanningLibrary?: CapacitorBarcodeScannerAndroidScanningLibrary;\n };\n web?: {\n showCameraSelection?: boolean;\n scannerFPS?: number;\n };\n}",
252
+ "text": "{\n hint: CapacitorBarcodeScannerTypeHint;\n scanInstructions?: string;\n scanButton?: boolean;\n scanText?: string;\n cameraDirection?: CapacitorBarcodeScannerCameraDirection;\n scanOrientation?: CapacitorBarcodeScannerScanOrientation;\n /**\n * Accessibility label (alternative text) read by screen readers for the cancel button.\n * When omitted, no accessibility label is set. Has no effect on web.\n */\n cancelButtonAccessibilityLabel?: string;\n /**\n * Accessibility label (alternative text) read by screen readers for the torch button when the torch is on.\n * When omitted, no accessibility label is set. Has no effect on web.\n */\n torchButtonOnAccessibilityLabel?: string;\n /**\n * Accessibility label (alternative text) read by screen readers for the torch button when the torch is off.\n * When omitted, no accessibility label is set. Has no effect on web.\n */\n torchButtonOffAccessibilityLabel?: string;\n android?: {\n scanningLibrary?: CapacitorBarcodeScannerAndroidScanningLibrary;\n };\n web?: {\n showCameraSelection?: boolean;\n scannerFPS?: number;\n };\n}",
253
253
  "complexTypes": [
254
254
  "CapacitorBarcodeScannerTypeHint",
255
255
  "CapacitorBarcodeScannerCameraDirection",
@@ -74,6 +74,21 @@ export type CapacitorBarcodeScannerOptions = {
74
74
  scanText?: string;
75
75
  cameraDirection?: CapacitorBarcodeScannerCameraDirection;
76
76
  scanOrientation?: CapacitorBarcodeScannerScanOrientation;
77
+ /**
78
+ * Accessibility label (alternative text) read by screen readers for the cancel button.
79
+ * When omitted, no accessibility label is set. Has no effect on web.
80
+ */
81
+ cancelButtonAccessibilityLabel?: string;
82
+ /**
83
+ * Accessibility label (alternative text) read by screen readers for the torch button when the torch is on.
84
+ * When omitted, no accessibility label is set. Has no effect on web.
85
+ */
86
+ torchButtonOnAccessibilityLabel?: string;
87
+ /**
88
+ * Accessibility label (alternative text) read by screen readers for the torch button when the torch is off.
89
+ * When omitted, no accessibility label is set. Has no effect on web.
90
+ */
91
+ torchButtonOffAccessibilityLabel?: string;
77
92
  android?: {
78
93
  scanningLibrary?: CapacitorBarcodeScannerAndroidScanningLibrary;
79
94
  };
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAN,IAAY,sCAGX;AAHD,WAAY,sCAAsC;IAChD,mGAAQ,CAAA;IACR,qGAAS,CAAA;AACX,CAAC,EAHW,sCAAsC,KAAtC,sCAAsC,QAGjD;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,sCAIX;AAJD,WAAY,sCAAsC;IAChD,2GAAY,CAAA;IACZ,6GAAa,CAAA;IACb,2GAAY,CAAA;AACd,CAAC,EAJW,sCAAsC,KAAtC,sCAAsC,QAIjD;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,wCAEX;AAFD,WAAY,wCAAwC;IAClD,sGAAQ,CAAA;AACV,CAAC,EAFW,wCAAwC,KAAxC,wCAAwC,QAEnD;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,mCACvC,2BAA2B,GAC3B,wCAAwC,CAC5C,CAAC;AAWF;;GAEG;AACH,MAAM,CAAN,IAAY,6CAGX;AAHD,WAAY,6CAA6C;IACvD,gEAAe,CAAA;IACf,gEAAe,CAAA;AACjB,CAAC,EAHW,6CAA6C,KAA7C,6CAA6C,QAGxD","sourcesContent":["import { Html5QrcodeSupportedFormats } from \"html5-qrcode\";\n\n/**\n * Enum representing the direction of the camera to be used for barcode scanning.\n */\nexport enum CapacitorBarcodeScannerCameraDirection {\n BACK = 1,\n FRONT = 2,\n}\n\n/**\n * Enum representing the orientation of the scanner during barcode scanning.\n */\nexport enum CapacitorBarcodeScannerScanOrientation {\n PORTRAIT = 1,\n LANDSCAPE = 2,\n ADAPTIVE = 3,\n}\n\n/**\n * Enum representing a special option to indicate that all barcode types are supported.\n */\nexport enum CapacitorBarcodeScannerTypeHintALLOption {\n ALL = 17,\n}\n\n/**\n * Extends supported formats from Html5Qrcode with a special 'ALL' option,\n * indicating support for all barcode types.\n */\nexport const CapacitorBarcodeScannerTypeHint = {\n ...Html5QrcodeSupportedFormats,\n ...CapacitorBarcodeScannerTypeHintALLOption,\n};\n\n/**\n * Type definition combining Html5QrcodeSupportedFormats and OSBarcodeTypeHintALLOption\n * to represent the hint for the type of barcode to be scanned.\n */\n\nexport type CapacitorBarcodeScannerTypeHint =\n | Html5QrcodeSupportedFormats\n | CapacitorBarcodeScannerTypeHintALLOption;\n\n/**\n * Enum representing the library to be used for barcode scanning on Android devices.\n */\nexport enum CapacitorBarcodeScannerAndroidScanningLibrary {\n ZXING = \"zxing\",\n MLKIT = \"mlkit\",\n}\n\n/**\n * Defines the structure of the result returned from a barcode scan.\n */\nexport type CapacitorBarcodeScannerScanResult = {\n ScanResult: string;\n format: CapacitorBarcodeScannerTypeHint;\n};\n\n/**\n * Defines the options for configuring a barcode scan.\n */\nexport type CapacitorBarcodeScannerOptions = {\n hint: CapacitorBarcodeScannerTypeHint;\n scanInstructions?: string;\n scanButton?: boolean;\n scanText?: string;\n cameraDirection?: CapacitorBarcodeScannerCameraDirection;\n scanOrientation?: CapacitorBarcodeScannerScanOrientation;\n android?: {\n scanningLibrary?: CapacitorBarcodeScannerAndroidScanningLibrary;\n };\n web?: {\n showCameraSelection?: boolean;\n scannerFPS?: number;\n };\n};\n\n/**\n * Interface defining the contract for a plugin capable of scanning barcodes.\n * Requires implementation of the scanBarcode method, which initiates a barcode scan with given options.\n *\n * Starting in Android targetSdk 36, the scanOrientation parameter has no effect for large screens (e.g. tablets) on Android 16 and higher.\n * You may opt-out of this behavior in your app by adding `<property android:name=\"android.window.PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY\" android:value=\"true\" />` to your `AndroidManifest.xml` inside `<application>` or `<activity>`.\n * Keep in mind though that this opt-out is temporary and will no longer work for Android 17. Android discourages setting specific orientations for large screens.\n * Regular Android phones are unaffected by this change.\n * For more information check the Android docs at https://developer.android.com/about/versions/16/behavior-changes-16#adaptive-layouts\n *\n */\nexport interface CapacitorBarcodeScannerPlugin {\n scanBarcode(\n options: CapacitorBarcodeScannerOptions,\n ): Promise<CapacitorBarcodeScannerScanResult>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAN,IAAY,sCAGX;AAHD,WAAY,sCAAsC;IAChD,mGAAQ,CAAA;IACR,qGAAS,CAAA;AACX,CAAC,EAHW,sCAAsC,KAAtC,sCAAsC,QAGjD;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,sCAIX;AAJD,WAAY,sCAAsC;IAChD,2GAAY,CAAA;IACZ,6GAAa,CAAA;IACb,2GAAY,CAAA;AACd,CAAC,EAJW,sCAAsC,KAAtC,sCAAsC,QAIjD;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,wCAEX;AAFD,WAAY,wCAAwC;IAClD,sGAAQ,CAAA;AACV,CAAC,EAFW,wCAAwC,KAAxC,wCAAwC,QAEnD;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,mCACvC,2BAA2B,GAC3B,wCAAwC,CAC5C,CAAC;AAWF;;GAEG;AACH,MAAM,CAAN,IAAY,6CAGX;AAHD,WAAY,6CAA6C;IACvD,gEAAe,CAAA;IACf,gEAAe,CAAA;AACjB,CAAC,EAHW,6CAA6C,KAA7C,6CAA6C,QAGxD","sourcesContent":["import { Html5QrcodeSupportedFormats } from \"html5-qrcode\";\n\n/**\n * Enum representing the direction of the camera to be used for barcode scanning.\n */\nexport enum CapacitorBarcodeScannerCameraDirection {\n BACK = 1,\n FRONT = 2,\n}\n\n/**\n * Enum representing the orientation of the scanner during barcode scanning.\n */\nexport enum CapacitorBarcodeScannerScanOrientation {\n PORTRAIT = 1,\n LANDSCAPE = 2,\n ADAPTIVE = 3,\n}\n\n/**\n * Enum representing a special option to indicate that all barcode types are supported.\n */\nexport enum CapacitorBarcodeScannerTypeHintALLOption {\n ALL = 17,\n}\n\n/**\n * Extends supported formats from Html5Qrcode with a special 'ALL' option,\n * indicating support for all barcode types.\n */\nexport const CapacitorBarcodeScannerTypeHint = {\n ...Html5QrcodeSupportedFormats,\n ...CapacitorBarcodeScannerTypeHintALLOption,\n};\n\n/**\n * Type definition combining Html5QrcodeSupportedFormats and OSBarcodeTypeHintALLOption\n * to represent the hint for the type of barcode to be scanned.\n */\n\nexport type CapacitorBarcodeScannerTypeHint =\n | Html5QrcodeSupportedFormats\n | CapacitorBarcodeScannerTypeHintALLOption;\n\n/**\n * Enum representing the library to be used for barcode scanning on Android devices.\n */\nexport enum CapacitorBarcodeScannerAndroidScanningLibrary {\n ZXING = \"zxing\",\n MLKIT = \"mlkit\",\n}\n\n/**\n * Defines the structure of the result returned from a barcode scan.\n */\nexport type CapacitorBarcodeScannerScanResult = {\n ScanResult: string;\n format: CapacitorBarcodeScannerTypeHint;\n};\n\n/**\n * Defines the options for configuring a barcode scan.\n */\nexport type CapacitorBarcodeScannerOptions = {\n hint: CapacitorBarcodeScannerTypeHint;\n scanInstructions?: string;\n scanButton?: boolean;\n scanText?: string;\n cameraDirection?: CapacitorBarcodeScannerCameraDirection;\n scanOrientation?: CapacitorBarcodeScannerScanOrientation;\n /**\n * Accessibility label (alternative text) read by screen readers for the cancel button.\n * When omitted, no accessibility label is set. Has no effect on web.\n */\n cancelButtonAccessibilityLabel?: string;\n /**\n * Accessibility label (alternative text) read by screen readers for the torch button when the torch is on.\n * When omitted, no accessibility label is set. Has no effect on web.\n */\n torchButtonOnAccessibilityLabel?: string;\n /**\n * Accessibility label (alternative text) read by screen readers for the torch button when the torch is off.\n * When omitted, no accessibility label is set. Has no effect on web.\n */\n torchButtonOffAccessibilityLabel?: string;\n android?: {\n scanningLibrary?: CapacitorBarcodeScannerAndroidScanningLibrary;\n };\n web?: {\n showCameraSelection?: boolean;\n scannerFPS?: number;\n };\n};\n\n/**\n * Interface defining the contract for a plugin capable of scanning barcodes.\n * Requires implementation of the scanBarcode method, which initiates a barcode scan with given options.\n *\n * Starting in Android targetSdk 36, the scanOrientation parameter has no effect for large screens (e.g. tablets) on Android 16 and higher.\n * You may opt-out of this behavior in your app by adding `<property android:name=\"android.window.PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY\" android:value=\"true\" />` to your `AndroidManifest.xml` inside `<application>` or `<activity>`.\n * Keep in mind though that this opt-out is temporary and will no longer work for Android 17. Android discourages setting specific orientations for large screens.\n * Regular Android phones are unaffected by this change.\n * For more information check the Android docs at https://developer.android.com/about/versions/16/behavior-changes-16#adaptive-layouts\n *\n */\nexport interface CapacitorBarcodeScannerPlugin {\n scanBarcode(\n options: CapacitorBarcodeScannerOptions,\n ): Promise<CapacitorBarcodeScannerScanResult>;\n}\n"]}
@@ -10,6 +10,9 @@ extension OSBARCScanParameters: Decodable {
10
10
  case cameraDirection
11
11
  case scanOrientation
12
12
  case hint
13
+ case cancelButtonAccessibilityLabel
14
+ case torchButtonOnAccessibilityLabel
15
+ case torchButtonOffAccessibilityLabel
13
16
  }
14
17
 
15
18
  public init(from decoder: Decoder) throws {
@@ -32,12 +35,19 @@ extension OSBARCScanParameters: Decodable {
32
35
  let hintInt = try container.decode(Int.self, forKey: .hint)
33
36
  let hint = OSBARCScannerHint(rawValue: hintInt)
34
37
 
38
+ let cancelButtonAccessibilityLabel = try container.decodeIfPresent(String.self, forKey: .cancelButtonAccessibilityLabel)
39
+ let torchButtonOnAccessibilityLabel = try container.decodeIfPresent(String.self, forKey: .torchButtonOnAccessibilityLabel)
40
+ let torchButtonOffAccessibilityLabel = try container.decodeIfPresent(String.self, forKey: .torchButtonOffAccessibilityLabel)
41
+
35
42
  self.init(
36
43
  scanInstructions: scanInstructions,
37
44
  scanButtonText: scanButtonText,
38
45
  cameraDirection: cameraDirection,
39
46
  scanOrientation: scanOrientation,
40
- hint: hint
47
+ hint: hint,
48
+ cancelButtonAccessibilityLabel: cancelButtonAccessibilityLabel,
49
+ torchButtonOnAccessibilityLabel: torchButtonOnAccessibilityLabel,
50
+ torchButtonOffAccessibilityLabel: torchButtonOffAccessibilityLabel
41
51
  )
42
52
  }
43
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/barcode-scanner",
3
- "version": "3.0.3-dev-20260626T161157.0",
3
+ "version": "3.0.3-dev-20260703T174419.0",
4
4
  "description": "Capacitor plugin using Outsystems Barcode libs",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -82,5 +82,5 @@
82
82
  "src": "android"
83
83
  }
84
84
  },
85
- "gitHead": "9219cdd8e6f0d95d4af50b1acbe62c621a3726b2"
85
+ "gitHead": "4f9394f305423152b31bceeae69f49e89b6b2c31"
86
86
  }