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

Get compatibility with @line/[email protected] #232

Merged
merged 3 commits into from
Apr 18, 2021
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
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
- 2.6
- 2.7
- 2.8
- 2.9
- latest
steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Bug Fixes
## BREAKING CHANGES
## Others
* [#232](https://github.com/epaew/react-liff/pull/232) Started supporting `@line/[email protected]`.

# 0.7.3
## Others
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
"eslint:fix": "eslint --fix .",
"prepack": "npm-run-all eslint clean build",
"test": "jest",
"test:coverage": "jest --coverage"
"test:coverage": "jest --coverage",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@epaew/eslint-config": "git://github.com/epaew/eslint-config.git#master",
"@line/liff": ">=2.3.0 <2.9.0",
"@line/liff": ">=2.3.0 <2.10.0",
"@testing-library/react": "^11.0.2",
"@types/jest": "^26.0.13",
"@types/prop-types": "^15.7.3",
Expand All @@ -50,6 +51,6 @@
"react": ">=16.14.0 <17.1.0"
},
"optionalDependencies": {
"@line/liff": ">=2.3.0 <2.9.0"
"@line/liff": ">=2.3.0 <2.10.0"
}
}
13 changes: 13 additions & 0 deletions src/liff-stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export const liffStub: LiffStub = {
permission: false,
minVer: '10.8.0',
},
subwindowOpen: {
permission: false,
minVer: '10.8.0',
},
},
}),
openWindow: ({ url, external }) => {
Expand Down Expand Up @@ -79,6 +83,15 @@ export const liffStub: LiffStub = {
sendMessages: async () => {},
userPicker: async () => null,
shareTargetPicker: async () => {},
subWindow: {
on: (): void => {},
off: (): void => {},
open: async (): Promise<void> => {},
cancel: async () => ({ status: '200', result: 'OK' }),
submit: async () => ({ status: '200', result: 'OK' }),
close: async (): Promise<void> => {},
getAppData: async () => ({}),
},
permanentLink,
ready: new Promise(() => {}),
id: 'liffId',
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,10 @@
file-type "^15.0.0"
form-data "^3.0.0"

"@line/liff@>=2.3.0 <2.9.0":
version "2.8.1"
resolved "https://registry.yarnpkg.com/@line/liff/-/liff-2.8.1.tgz#303e28476f3e1a32de710e7d464edcf131d1099b"
integrity sha512-04dw+5UwV3CDvumAzwysX89ufCYzOL/JUJ36thRlS0wWuwSQsX292mv10w1f5bqOsw6SvAVeiZ4x/lwvZmmNAQ==
"@line/liff@>=2.3.0 <2.10.0":
version "2.9.0"
resolved "https://registry.yarnpkg.com/@line/liff/-/liff-2.9.0.tgz#fb13097a776a9972931ef58eb74deb4acbeda9c5"
integrity sha512-Sl3mFc++cz9/NT8rziSScbskxwWGNGWReTkjEl15YJRxvIKoSOrqM1la6CxvzGqhl+23u1EDis/z0Oz/6ueCsA==
dependencies:
"@line/bot-sdk" "^7.0.0"
js-crypto-ec "^0.5.11"
Expand Down