@youversion/platform-react-hooks 1.2.0 → 1.2.1
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +11 -0
- package/dist/useLanguages.d.ts +1 -1
- package/dist/useLanguages.d.ts.map +1 -1
- package/dist/useLanguages.js +1 -1
- package/dist/useLanguages.js.map +1 -1
- package/package.json +2 -2
- package/src/useLanguages.test.tsx +19 -1
- package/src/useLanguages.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @youversion/platform-react-hooks@1.2.
|
|
2
|
+
> @youversion/platform-react-hooks@1.2.1 build /home/runner/work/platform-sdk-react/platform-sdk-react/packages/hooks
|
|
3
3
|
> tsc -p tsconfig.build.json
|
|
4
4
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @youversion/platform-react-hooks
|
|
2
2
|
|
|
3
|
+
## 1.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e845974: fix: make country parameter optional for getLanguages
|
|
8
|
+
|
|
9
|
+
The country parameter is now optional when fetching languages, allowing developers to retrieve all available languages without filtering by country. This improves developer experience by providing a more flexible API while maintaining backward compatibility for existing code that provides a country filter.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [e845974]
|
|
12
|
+
- @youversion/platform-core@1.2.1
|
|
13
|
+
|
|
3
14
|
## 1.2.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/dist/useLanguages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type UseApiDataOptions } from './useApiData';
|
|
2
2
|
import { type GetLanguagesOptions, type Collection, type Language } from '@youversion/platform-core';
|
|
3
|
-
export declare function useLanguages(options
|
|
3
|
+
export declare function useLanguages(options?: GetLanguagesOptions, apiOptions?: UseApiDataOptions): {
|
|
4
4
|
languages: Collection<Language> | null;
|
|
5
5
|
loading: boolean;
|
|
6
6
|
error: Error | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguages.d.ts","sourceRoot":"","sources":["../src/useLanguages.ts"],"names":[],"mappings":"AAMA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,QAAQ,EACd,MAAM,2BAA2B,CAAC;AAEnC,wBAAgB,YAAY,CAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"useLanguages.d.ts","sourceRoot":"","sources":["../src/useLanguages.ts"],"names":[],"mappings":"AAMA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,QAAQ,EACd,MAAM,2BAA2B,CAAC;AAEnC,wBAAgB,YAAY,CAC1B,OAAO,GAAE,mBAAwB,EACjC,UAAU,CAAC,EAAE,iBAAiB,GAC7B;IACD,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAgCA"}
|
package/dist/useLanguages.js
CHANGED
|
@@ -5,7 +5,7 @@ import { YouVersionContext } from './context';
|
|
|
5
5
|
import { LanguagesClient, ApiClient } from '@youversion/platform-core';
|
|
6
6
|
import { useApiData } from './useApiData';
|
|
7
7
|
import {} from '@youversion/platform-core';
|
|
8
|
-
export function useLanguages(options, apiOptions) {
|
|
8
|
+
export function useLanguages(options = {}, apiOptions) {
|
|
9
9
|
const context = useContext(YouVersionContext);
|
|
10
10
|
const languagesClient = useMemo(() => {
|
|
11
11
|
if (!context?.appKey) {
|
package/dist/useLanguages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguages.js","sourceRoot":"","sources":["../src/useLanguages.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,UAAU,EAA0B,MAAM,cAAc,CAAC;AAClE,OAAO,EAIN,MAAM,2BAA2B,CAAC;AAEnC,MAAM,UAAU,YAAY,CAC1B,
|
|
1
|
+
{"version":3,"file":"useLanguages.js","sourceRoot":"","sources":["../src/useLanguages.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,UAAU,EAA0B,MAAM,cAAc,CAAC;AAClE,OAAO,EAIN,MAAM,2BAA2B,CAAC;AAEnC,MAAM,UAAU,YAAY,CAC1B,UAA+B,EAAE,EACjC,UAA8B;IAO9B,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAE9C,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE;QACnC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,uHAAuH,CACxH,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,eAAe,CACxB,IAAI,SAAS,CAAC;YACZ,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,cAAc,EAAE,OAAO,CAAC,cAAc;SACvC,CAAC,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;IAEjE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,CAClD,GAAG,EAAE,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,EAC3C,CAAC,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,EAC5E;QACE,OAAO,EAAE,UAAU,EAAE,OAAO,KAAK,KAAK;KACvC,CACF,CAAC;IAEF,OAAO;QACL,SAAS,EAAE,IAAI;QACf,OAAO;QACP,KAAK;QACL,OAAO;KACR,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youversion/platform-react-hooks",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@youversion/platform-core": "1.2.
|
|
25
|
+
"@youversion/platform-core": "1.2.1"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=19.1.0 <20.0.0"
|
|
@@ -167,7 +167,25 @@ describe('useLanguages', () => {
|
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
describe('fetching languages', () => {
|
|
170
|
-
it('should fetch languages
|
|
170
|
+
it('should fetch languages without country filter', async () => {
|
|
171
|
+
const wrapper = createWrapper({
|
|
172
|
+
appKey: mockAppKey,
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
const { result } = renderHook(() => useLanguages(), { wrapper });
|
|
176
|
+
|
|
177
|
+
expect(result.current.loading).toBe(true);
|
|
178
|
+
expect(result.current.languages).toBe(null);
|
|
179
|
+
|
|
180
|
+
await waitFor(() => {
|
|
181
|
+
expect(result.current.loading).toBe(false);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
expect(mockGetLanguages).toHaveBeenCalledWith({});
|
|
185
|
+
expect(result.current.languages).toEqual(mockLanguages);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('should fetch languages with provided country', async () => {
|
|
171
189
|
const wrapper = createWrapper({
|
|
172
190
|
appKey: mockAppKey,
|
|
173
191
|
});
|
package/src/useLanguages.ts
CHANGED