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

Release v3.1.4 #79

Merged
merged 7 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ jobs:
key: yarn-${{ hashFiles('**/yarn.lock') }}

- name: Installs Nix
uses: cachix/install-nix-action@v18
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-23.05
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}

- name: Imports Nix store cache
Expand All @@ -61,7 +63,7 @@ jobs:

- name: Publishes the lib
working-directory: lib
run: nix develop -c yarn publish --access public
run: nix develop -k NODE_AUTH_TOKEN -c yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ jobs:
path: '**/node_modules'
key: yarn-${{ hashFiles('**/yarn.lock') }}

- name: Installs Nix
uses: cachix/install-nix-action@v18
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-23.05
extra_nix_config: |
experimental-features = nix-command flakes

- name: Imports Nix store cache
if: ${{ steps.nix-cache.outputs.cache-hit == 'true' }}
Expand Down
93 changes: 44 additions & 49 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,164 +8,159 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.1.4] - 2023-09-09

### Fixed

- Fixed pasting code on Firefox Android [#63].

## [3.1.3] - 2023-02-09

### Changed

* Upgraded all packages and license year.
- Upgraded all packages and license year.

## [3.1.2] - 2022-12-13

### Fixed

* Fixed CI publish script.
- Fixed CI publish script.

## [3.1.1] - 2022-12-13

### Fixed

* Fixed local `dir` prop override [#71].
- Fixed local `dir` prop override [#71].

## [3.1.0] - 2022-12-13

### Changed

* Upgraded all packages to the latest versions (react 18.2, node
18.12, cypress 10.10).
- Upgraded all packages to the latest versions (react 18.2, node 18.12, cypress 10.10).

## [3.0.16] - 2022-07-05

### Fixed

* Fixed swipe style keyboard entry [#62]
* Fixed pasting code from messages on iOS [#63]
- Fixed swipe style keyboard entry [#62].
- ~~Fixed pasting code from messages on iOS [#63].~~

## [3.0.15] - 2022-06-12

### Changed

* Upgraded `react-use-bireducer` to the latest version.
- Upgraded `react-use-bireducer` to the latest version.

### Fixed

* Fixed README tests section.
* Fixed CHANGELOG links.
- Fixed README tests section.
- Fixed CHANGELOG links.

## [3.0.14] - 2022-05-27

### Changed

* Model-view-updater (as known as `mvu` in the code) is now handled by
the lib
[react-use-bireducer](https://github.com/soywod/react-use-bireducer).
* Upgraded all packages to the latest version.
- Model-view-updater (as known as `mvu` in the code) is now handled by the lib [react-use-bireducer](https://github.com/soywod/react-use-bireducer).
- Upgraded all packages to the latest version.

## [3.0.13] - 2022-05-24

### Added

* Added tests in CI.
- Added tests in CI.

### Changed

* Updated readme badges.
- Updated readme badges.

### Fixed

* Fixed broken links in the readme.
- Fixed broken links in the readme.

## [3.0.12] - 2022-05-23

### Deprecated

* Deprecated the `debug` mode (no longer exists).
- Deprecated the `debug` mode (no longer exists).

## [3.0.11] - 2022-05-22

Revert the lib state from `v1.0.6`. The native web component used in
the `v2.0.0` was too hard to maintain. It led to many issues.
Revert the lib state from `v1.0.6`. The native web component used in the `v2.0.0` was too hard to maintain. It led to many issues.

## [2.0.0-beta.0] - 2021-04-15

React PIN Field is now a React wrapper for [PIN
Field](https://github.com/soywod/pin-field), a native web component
for entering PIN codes.
React PIN Field is now a React wrapper for [PIN Field](https://github.com/soywod/pin-field), a native web component for entering PIN codes.

### Changed

* `@soywod/pin-field` needs to be installed, since it became a peer
dependency of React PIN Field.
* The ref contains now an instance of the class
[`PinField`](https://github.com/soywod/pin-field/blob/master/lib/pin-field.ts).
Inputs are accessible via the `inputs` prop.
- `@soywod/pin-field` needs to be installed, since it became a peer dependency of React PIN Field.
- The ref contains now an instance of the class [`PinField`](https://github.com/soywod/pin-field/blob/master/lib/pin-field.ts). Inputs are accessible via the `inputs` prop.

## [1.1.0] - 2021-03-14

### Fixed

* Added support for all browsers [#19] and mobile [#26].
- Added support for all browsers [#19] and mobile [#26].

### Deprecated

* Deprecated classes `-{index}`, `-focus`, `-success` and `-error`
(replaced by standard pseudo-classes `:nth-of-type`, `:focus`,
`:valid` and `:invalid`).
- Deprecated classes `-{index}`, `-focus`, `-success` and `-error` (replaced by standard pseudo-classes `:nth-of-type`, `:focus`, `:valid` and `:invalid`).

## [1.0.6] - 2021-02-10

### Changed

* Upgraded React version to `^17` [#23].
- Upgraded React version to `^17` [#23].

## [1.0.5] - 2020-10-02

### Removed

* Removed lodash.
- Removed lodash.

## [1.0.4] - 2020-08-20

### Fixed

* Fixed tsconfig module type [#20].
- Fixed tsconfig module type [#20].

## [1.0.3] - 2020-03-28

### Fixed

* Kept previous val on reject key [#16].
- Kept previous val on reject key [#16].

## [1.0.2] - 2020-03-27

### Fixed

* Fixed missing delete key [#15].
- Fixed missing delete key [#15].

## [1.0.1] - 2020-03-19

### Changed

* Added npm version badge and missing icons in docs.
* Remove test files from npm pack.
- Added npm version badge and missing icons in docs.
- Remove test files from npm pack.

## [1.0.0] - 2020-03-15

### Added

* Added docs (readme, license, changelog).
* Adedd new event onReceiveKey.
* Added end-to-end tests with Cypress [#3].
* Added unit tests with Jest + Enzyme [#2].
* Handled clipboard paste event [#11].
* Added Right-to-left support [#9].
* Added ref support [#14].
- Added docs (readme, license, changelog).
- Adedd new event onReceiveKey.
- Added end-to-end tests with Cypress [#3].
- Added unit tests with Jest + Enzyme [#2].
- Handled clipboard paste event [#11].
- Added Right-to-left support [#9].
- Added ref support [#14].

### Fixed

* Fixed base system on evt.key instead of evt.keyCode, to avoid
- Fixed base system on evt.key instead of evt.keyCode, to avoid
conflicts (uppercase/lowercase, numeric keypad) [#1].
* Fixed unnecessary re-renders (useMVU).
* Fixed paste on MacOS [#13].
- Fixed unnecessary re-renders (useMVU).
- Fixed paste on MacOS [#13].

[unreleased]: https://github.com/soywod/react-pin-field/compare/v3.1.3...HEAD
[3.1.3]: https://github.com/soywod/react-pin-field/compare/v3.1.2...v3.1.3
Expand Down
4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Demo for react-pin-field.",
"author": "soywod <clement.douin@posteo.net>",
"license": "MIT",
"version": "3.1.3",
"version": "3.1.4",
"private": false,
"browserslist": {
"production": [
Expand All @@ -28,7 +28,7 @@
"classnames": "^2.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-pin-field": "^3.1.2",
"react-pin-field": "^3.1.4",
"react-scripts": "^5.0.1",
"sass": "^1.58.0",
"typescript": "^4.9.5",
Expand Down
38 changes: 28 additions & 10 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "React component for entering PIN codes.";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
Expand Down
4 changes: 2 additions & 2 deletions lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "React component for entering PIN codes.",
"author": "soywod <clement.douin@posteo.net>",
"license": "MIT",
"version": "3.1.3",
"version": "3.1.4",
"private": false,
"keywords": [
"react",
Expand Down Expand Up @@ -44,7 +44,7 @@
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"classnames": "^2.3.2",
"cypress": "^12.5.1",
"cypress": "=10.10.0",
"husky": "^8.0.3",
"jest": "^29.4.2",
"jest-environment-jsdom": "^29.4.2",
Expand Down
11 changes: 8 additions & 3 deletions lib/src/pin-field/pin-field.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,12 @@ describe("state reducer", () => {
);

expect(state).toMatchObject({fallback: null});
expect(eff).toEqual([]);
expect(eff).toEqual([
{type: "set-input-val", idx: 0, val: "a"},
{type: "resolve-key", idx: 0, key: "a"},
{type: "focus-input", idx: 1},
{type: "handle-code-change"},
]);
});
});

Expand Down Expand Up @@ -568,9 +573,9 @@ describe("effect reducer", () => {
current: [inputA.ref, inputB.ref, inputC.ref],
};
const propsWithDir = {...propsMock, dir: "ltr"};
const notify = useEffectReducer({ ...propsWithDir, refs });
const notify = useEffectReducer({...propsWithDir, refs});

notify({ type: "handle-code-change" }, noop);
notify({type: "handle-code-change"}, noop);

expect(propsMock.onChange).toHaveBeenCalledTimes(1);
expect(propsMock.onChange).toHaveBeenCalledWith("abc");
Expand Down
Loading
Loading