Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.2.7 (see comment for list of changes) #575

Merged
merged 9 commits into from
Nov 4, 2022
Merged

Version 2.2.7 (see comment for list of changes) #575

merged 9 commits into from
Nov 4, 2022

Conversation

mebjas
Copy link
Owner

@mebjas mebjas commented Nov 4, 2022

Version 2.2.7

Add support for custom CSS

Developer / User Story: As a developer I can write custom CSS for Html5QrcodeScanner.

Feature request: Issue#389

List of CSS class and IDs added.

  1. All key elements will have a common CSS class html5-qrcode-element. This way developers can customise element by element. For example:
button.html5-qrcode-element {
    color: 'red' !important,
    border: '1px solid red' !important
}

Key elements are:

  • Request camera permission button.
  • "Scan and image file" vs "Scan using camera directly" link.
  • "File selection" input ('file')
  • Start or Stop camera button.
  • Camera selection Select element
  • Torch button
  1. key elements will have specific IDs defined in src/ui/scanner/base.ts. This can be used to customise per elements.
TODOs
  • Document in a blog post
  • Add pointer in qrcode.minhazav.dev
  • Add pointer in Readme
  • Update the screenshots everywhere.

Change file selection UI from input to button

Modified the UI a little to hide the file selection as input and replace with
custom button and javascript based solution.

One motivation here is this will allow more uniform style for the widget.

Graduate useBarCodeDetectorIfSupported to Html5QrcodeConfigs.

useBarCodeDetectorIfSupported was tested as an experimental configuration for
a long time and has proven to be very efficient and well supported. It has been
tested in ScanApp for quiet some time.

Considering this experimental API is not well documented, it makes it hard for
folks to discover it. By graduating this configuration to Html5QrcodeConfigs I
hope to make it more discoverable.

In this version the ExperimentalFeaturesConfig#useBarCodeDetectorIfSupported
has been marked deprecated but not removed due to backwards compatibility
reasons. Users can set either of them but Html5QrcodeConfigs one will take
precedence if set.

Once further support is added to browsers, this can be set as true by default.

TODOS
  • Update documentation on readme.
  • Update documentation on qrcode.minhazav.dev.
  • Publish article around this.

Unit tests added and others fixed

Added unit tests that can run DOM based tests thanks to jsdom package.

…DetectorIfSupported from experimental

#### Add support for custom CSS
Developer / User Story: As a developer I can write custom CSS for `Html5QrcodeScanner`.

Feature request: [Issue#389](#389)

List of CSS class and IDs added.

1. All key elements will have a common CSS class `html5-qrcode-element`. This way developers can customise element by element. For example:

```css
button.html5-qrcode-element {
    color: 'red' !important,
    border: '1px solid red' !important
}
```

Key elements are:
-    Request camera permission button.
-    "Scan and image file" vs "Scan using camera directly" link.
-    "File selection" input ('file')
-    Start or Stop camera button.
-    Camera selection Select element
-    Torch button

2. key elements will have specific IDs defined in `src/ui/scanner/base.ts`. This can be used to customise per elements.

##### TODOs
-   [ ] Document in a blog post
-   [ ] Add pointer in qrcode.minhazav.dev
-   [ ] Add pointer in Readme

#### Graduate `useBarCodeDetectorIfSupported` to `Html5QrcodeConfigs`.
`useBarCodeDetectorIfSupported` was tested as an experimental configuration for
a long time and has proven to be very efficient and well supported. It has been
tested in [ScanApp](https://scanapp.org) for quiet some time.

Considering this experimental API is not well documented, it makes it hard for
folks to discover it. By graduating this configuration to `Html5QrcodeConfigs` I
hope to make it more discoverable.

In this version the `ExperimentalFeaturesConfig#useBarCodeDetectorIfSupported`
has been marked deprecated but not removed due to backwards compatibility
reasons. Users can set either of them but `Html5QrcodeConfigs` one will take
precedence if set.

Once further support is added to browsers, this can be set as true by default.

##### TODOS
-    [ ] Update documentation on readme.
-    [ ] Update documentation on [qrcode.minhazav.dev](https://qrcode.minhazav.dev).
-    [ ] Publish article around this.
Created FileSelectionUi class to handle file selection logics.
Resolving codacy concerns.
@mebjas mebjas merged commit ca5510c into master Nov 4, 2022
@mebjas mebjas deleted the v2.2.7 branch November 4, 2022 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant