@ttt-productions/query-core 0.4.5 → 0.4.6
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/dist/defaults.d.ts +3 -3
- package/dist/defaults.d.ts.map +1 -1
- package/dist/defaults.js +4 -4
- package/dist/defaults.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/query-client.d.ts +2 -2
- package/dist/query-client.d.ts.map +1 -1
- package/dist/query-client.js +6 -6
- package/dist/query-client.js.map +1 -1
- package/dist/react/firestore/context.d.ts +3 -3
- package/dist/react/firestore/context.js +3 -3
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/provider.d.ts +4 -4
- package/dist/react/provider.d.ts.map +1 -1
- package/dist/react/provider.js +3 -3
- package/dist/react/provider.js.map +1 -1
- package/dist/react/search/use-firestore-search.d.ts +2 -3
- package/dist/react/search/use-firestore-search.d.ts.map +1 -1
- package/dist/react/search/use-firestore-search.js +2 -3
- package/dist/react/search/use-firestore-search.js.map +1 -1
- package/package.json +1 -1
- package/dist/search/search-configs.d.ts +0 -15
- package/dist/search/search-configs.d.ts.map +0 -1
- package/dist/search/search-configs.js +0 -42
- package/dist/search/search-configs.js.map +0 -1
package/dist/defaults.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DefaultOptions, QueryClientConfig } from '@tanstack/react-query';
|
|
2
2
|
/**
|
|
3
3
|
* Small, conservative defaults intended to work well across apps.
|
|
4
|
-
* Apps can override via `
|
|
4
|
+
* Apps can override via `createQueryClient({ defaultOptions: ... })`.
|
|
5
5
|
*/
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
6
|
+
export declare const defaultQueryOptions: DefaultOptions;
|
|
7
|
+
export declare const defaultQueryClientConfig: QueryClientConfig;
|
|
8
8
|
//# sourceMappingURL=defaults.d.ts.map
|
package/dist/defaults.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,cAcjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAEtC,CAAC"}
|
package/dist/defaults.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Small, conservative defaults intended to work well across apps.
|
|
3
|
-
* Apps can override via `
|
|
3
|
+
* Apps can override via `createQueryClient({ defaultOptions: ... })`.
|
|
4
4
|
*/
|
|
5
|
-
export const
|
|
5
|
+
export const defaultQueryOptions = {
|
|
6
6
|
queries: {
|
|
7
7
|
refetchOnWindowFocus: false,
|
|
8
8
|
refetchOnReconnect: true,
|
|
@@ -15,7 +15,7 @@ export const tttDefaultOptions = {
|
|
|
15
15
|
retry: 0,
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
|
-
export const
|
|
19
|
-
defaultOptions:
|
|
18
|
+
export const defaultQueryClientConfig = {
|
|
19
|
+
defaultOptions: defaultQueryOptions,
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=defaults.js.map
|
package/dist/defaults.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAmB;IACjD,OAAO,EAAE;QACP,oBAAoB,EAAE,KAAK;QAC3B,kBAAkB,EAAE,IAAI;QACxB,cAAc,EAAE,KAAK;QAErB,SAAS,EAAE,MAAM,EAAE,MAAM;QACzB,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,KAAK;QAEzB,KAAK,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,GAAG,CAAC;KAC1C;IACD,SAAS,EAAE;QACT,KAAK,EAAE,CAAC;KACT;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAsB;IACzD,cAAc,EAAE,mBAAmB;CACpC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { createQueryClient } from './query-client.js';
|
|
2
|
+
export type { CreateQueryClientOptions } from './query-client.js';
|
|
3
3
|
export { keys, createKeyScope } from './keys.js';
|
|
4
4
|
export type { QueryKey } from './keys.js';
|
|
5
5
|
export { invalidateByPrefix, removeByPrefix, updateQueryData } from './cache-helpers.js';
|
|
@@ -7,5 +7,4 @@ export type { WithId, FirestoreBaseOptions, FirestoreDocOptions, FirestoreCollec
|
|
|
7
7
|
export { docWithId } from './firestore/types.js';
|
|
8
8
|
export { flattenInfiniteData, getInfiniteDataCount, } from './firestore/infinite-helpers.js';
|
|
9
9
|
export type { FirestoreSearchConfig, FirestoreSearchOptions, } from './search/types.js';
|
|
10
|
-
export { SEARCH_CONFIGS } from './search/search-configs.js';
|
|
11
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAGlE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjD,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGzF,YAAY,EACV,MAAM,EACN,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EACV,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// Query Client
|
|
2
|
-
export {
|
|
2
|
+
export { createQueryClient } from './query-client.js';
|
|
3
3
|
// Query Keys
|
|
4
4
|
export { keys, createKeyScope } from './keys.js';
|
|
5
5
|
// Cache Helpers
|
|
6
6
|
export { invalidateByPrefix, removeByPrefix, updateQueryData } from './cache-helpers.js';
|
|
7
7
|
export { docWithId } from './firestore/types.js';
|
|
8
8
|
export { flattenInfiniteData, getInfiniteDataCount, } from './firestore/infinite-helpers.js';
|
|
9
|
-
export { SEARCH_CONFIGS } from './search/search-configs.js';
|
|
10
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGjD,gBAAgB;AAChB,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAgBzF,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iCAAiC,CAAC"}
|
package/dist/query-client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { QueryClient, type QueryClientConfig } from '@tanstack/react-query';
|
|
2
|
-
export type
|
|
2
|
+
export type CreateQueryClientOptions = QueryClientConfig;
|
|
3
3
|
/**
|
|
4
4
|
* Factory so every app uses the same baseline behavior.
|
|
5
5
|
* Pass overrides to adjust defaults without forking.
|
|
6
6
|
*/
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function createQueryClient(overrides?: CreateQueryClientOptions): QueryClient;
|
|
8
8
|
//# sourceMappingURL=query-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-client.d.ts","sourceRoot":"","sources":["../src/query-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"query-client.d.ts","sourceRoot":"","sources":["../src/query-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,wBAA6B,eAiBzE"}
|
package/dist/query-client.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultQueryClientConfig } from './defaults.js';
|
|
3
3
|
/**
|
|
4
4
|
* Factory so every app uses the same baseline behavior.
|
|
5
5
|
* Pass overrides to adjust defaults without forking.
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function createQueryClient(overrides = {}) {
|
|
8
8
|
return new QueryClient({
|
|
9
|
-
...
|
|
9
|
+
...defaultQueryClientConfig,
|
|
10
10
|
...overrides,
|
|
11
11
|
defaultOptions: {
|
|
12
|
-
...
|
|
12
|
+
...defaultQueryClientConfig.defaultOptions,
|
|
13
13
|
...overrides.defaultOptions,
|
|
14
14
|
queries: {
|
|
15
|
-
...
|
|
15
|
+
...defaultQueryClientConfig.defaultOptions?.queries,
|
|
16
16
|
...overrides.defaultOptions?.queries,
|
|
17
17
|
},
|
|
18
18
|
mutations: {
|
|
19
|
-
...
|
|
19
|
+
...defaultQueryClientConfig.defaultOptions?.mutations,
|
|
20
20
|
...overrides.defaultOptions?.mutations,
|
|
21
21
|
},
|
|
22
22
|
},
|
package/dist/query-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-client.js","sourceRoot":"","sources":["../src/query-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA0B,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"query-client.js","sourceRoot":"","sources":["../src/query-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA0B,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAIzD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,YAAsC,EAAE;IACxE,OAAO,IAAI,WAAW,CAAC;QACrB,GAAG,wBAAwB;QAC3B,GAAG,SAAS;QACZ,cAAc,EAAE;YACd,GAAG,wBAAwB,CAAC,cAAc;YAC1C,GAAG,SAAS,CAAC,cAAc;YAC3B,OAAO,EAAE;gBACP,GAAG,wBAAwB,CAAC,cAAc,EAAE,OAAO;gBACnD,GAAG,SAAS,CAAC,cAAc,EAAE,OAAO;aACrC;YACD,SAAS,EAAE;gBACT,GAAG,wBAAwB,CAAC,cAAc,EAAE,SAAS;gBACrD,GAAG,SAAS,CAAC,cAAc,EAAE,SAAS;aACvC;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -6,17 +6,17 @@ export interface FirestoreProviderProps {
|
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Provides Firestore instance to all useFirestore* hooks.
|
|
9
|
-
* Wrap your app with this provider alongside
|
|
9
|
+
* Wrap your app with this provider alongside QueryProvider.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```tsx
|
|
13
13
|
* import { db } from '@/lib/firebase';
|
|
14
14
|
*
|
|
15
|
-
* <
|
|
15
|
+
* <QueryProvider>
|
|
16
16
|
* <FirestoreProvider db={db}>
|
|
17
17
|
* {children}
|
|
18
18
|
* </FirestoreProvider>
|
|
19
|
-
* </
|
|
19
|
+
* </QueryProvider>
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export declare function FirestoreProvider({ db, children }: FirestoreProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,17 +4,17 @@ import { createContext, useContext } from 'react';
|
|
|
4
4
|
const FirestoreContext = createContext(null);
|
|
5
5
|
/**
|
|
6
6
|
* Provides Firestore instance to all useFirestore* hooks.
|
|
7
|
-
* Wrap your app with this provider alongside
|
|
7
|
+
* Wrap your app with this provider alongside QueryProvider.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```tsx
|
|
11
11
|
* import { db } from '@/lib/firebase';
|
|
12
12
|
*
|
|
13
|
-
* <
|
|
13
|
+
* <QueryProvider>
|
|
14
14
|
* <FirestoreProvider db={db}>
|
|
15
15
|
* {children}
|
|
16
16
|
* </FirestoreProvider>
|
|
17
|
-
* </
|
|
17
|
+
* </QueryProvider>
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export function FirestoreProvider({ db, children }) {
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { QueryProvider } from './provider.js';
|
|
2
|
+
export type { QueryProviderProps } from './provider.js';
|
|
3
3
|
export { FirestoreProvider, useFirestoreDb } from './firestore/context.js';
|
|
4
4
|
export type { FirestoreProviderProps } from './firestore/context.js';
|
|
5
5
|
export { useFirestoreDoc } from './firestore/use-firestore-doc.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC3E,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGrE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,YAAY,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAG1F,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EACL,qBAAqB,GACtB,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EACV,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/react/index.js
CHANGED
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,WAAW;AACX,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,WAAW;AACX,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,qBAAqB;AACrB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG3E,wBAAwB;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAG/E,2BAA2B;AAC3B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,wCAAwC,CAAC;AAEhD,uBAAuB;AACvB,OAAO,EACL,qBAAqB,GACtB,MAAM,sCAAsC,CAAC;AAM9C,cAAc;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/react/provider.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
export type
|
|
2
|
+
import { type CreateQueryClientOptions } from '../query-client.js';
|
|
3
|
+
export type QueryProviderProps = React.PropsWithChildren<{
|
|
4
4
|
/** Optional overrides applied when the client is first created. */
|
|
5
|
-
clientOptions?:
|
|
5
|
+
clientOptions?: CreateQueryClientOptions;
|
|
6
6
|
}>;
|
|
7
7
|
/**
|
|
8
8
|
* Client component wrapper for Next.js / React apps.
|
|
9
9
|
* Creates a single QueryClient per browser session.
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function QueryProvider({ children, clientOptions }: QueryProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/react/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/react/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAqB,KAAK,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACvD,mEAAmE;IACnE,aAAa,CAAC,EAAE,wBAAwB,CAAC;CAC1C,CAAC,CAAC;AAEH;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,kBAAkB,2CAG5E"}
|
package/dist/react/provider.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { QueryClientProvider } from '@tanstack/react-query';
|
|
5
|
-
import {
|
|
5
|
+
import { createQueryClient } from '../query-client.js';
|
|
6
6
|
/**
|
|
7
7
|
* Client component wrapper for Next.js / React apps.
|
|
8
8
|
* Creates a single QueryClient per browser session.
|
|
9
9
|
*/
|
|
10
|
-
export function
|
|
11
|
-
const [client] = React.useState(() =>
|
|
10
|
+
export function QueryProvider({ children, clientOptions }) {
|
|
11
|
+
const [client] = React.useState(() => createQueryClient(clientOptions));
|
|
12
12
|
return _jsx(QueryClientProvider, { client: client, children: children });
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/react/provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/react/provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAiC,MAAM,oBAAoB,CAAC;AAOtF;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAsB;IAC3E,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC;IACxE,OAAO,KAAC,mBAAmB,IAAC,MAAM,EAAE,MAAM,YAAG,QAAQ,GAAuB,CAAC;AAC/E,CAAC"}
|
|
@@ -15,13 +15,12 @@ import type { WithId } from '../../firestore/types.js';
|
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```typescript
|
|
18
|
-
* // Using preset config
|
|
19
18
|
* const { data, isLoading } = useFirestoreSearch<UserProfile>({
|
|
20
|
-
*
|
|
19
|
+
* collectionPath: 'userProfiles',
|
|
20
|
+
* searchField: 'username',
|
|
21
21
|
* queryText: searchValue,
|
|
22
22
|
* });
|
|
23
23
|
*
|
|
24
|
-
* // Custom search
|
|
25
24
|
* const { data } = useFirestoreSearch<Team>({
|
|
26
25
|
* collectionPath: 'teams',
|
|
27
26
|
* searchField: 'name_lowercase',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-firestore-search.d.ts","sourceRoot":"","sources":["../../../src/react/search/use-firestore-search.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAOL,KAAK,YAAY,EAElB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAMvD
|
|
1
|
+
{"version":3,"file":"use-firestore-search.d.ts","sourceRoot":"","sources":["../../../src/react/search/use-firestore-search.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAOL,KAAK,YAAY,EAElB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAMvD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,EACxE,cAAc,EACd,WAAW,EACX,SAAS,EACT,KAAqB,EACrB,OAAc,EACd,MAAM,EACN,UAAgC,EAChC,SAA8B,GAC/B,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAgDhE"}
|
|
@@ -20,13 +20,12 @@ const DEFAULT_STALE_TIME = 60 * 1000; // 1 minute
|
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```typescript
|
|
23
|
-
* // Using preset config
|
|
24
23
|
* const { data, isLoading } = useFirestoreSearch<UserProfile>({
|
|
25
|
-
*
|
|
24
|
+
* collectionPath: 'userProfiles',
|
|
25
|
+
* searchField: 'username',
|
|
26
26
|
* queryText: searchValue,
|
|
27
27
|
* });
|
|
28
28
|
*
|
|
29
|
-
* // Custom search
|
|
30
29
|
* const { data } = useFirestoreSearch<Team>({
|
|
31
30
|
* collectionPath: 'teams',
|
|
32
31
|
* searchField: 'name_lowercase',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-firestore-search.js","sourceRoot":"","sources":["../../../src/react/search/use-firestore-search.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAuB,MAAM,uBAAuB,CAAC;AACtE,OAAO,EACL,UAAU,EACV,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,KAAK,IAAI,cAAc,GAGxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAIrC,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW;AAEjD
|
|
1
|
+
{"version":3,"file":"use-firestore-search.js","sourceRoot":"","sources":["../../../src/react/search/use-firestore-search.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QA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version": "0.4.6",
|
|
4
4
|
"description": "Shared TanStack Query (React Query) client defaults, query key helpers, and Firestore integration hooks for TTT Productions apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { FirestoreSearchConfig } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Preset search configurations for common use cases.
|
|
4
|
-
* These provide standard settings that can be used across applications.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* const { data } = useFirestoreSearch<User>({
|
|
9
|
-
* ...SEARCH_CONFIGS.Q_USER,
|
|
10
|
-
* queryText: searchValue,
|
|
11
|
-
* });
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare const SEARCH_CONFIGS: Record<string, FirestoreSearchConfig>;
|
|
15
|
-
//# sourceMappingURL=search-configs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search-configs.d.ts","sourceRoot":"","sources":["../../src/search/search-configs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CA8BvD,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preset search configurations for common use cases.
|
|
3
|
-
* These provide standard settings that can be used across applications.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* const { data } = useFirestoreSearch<User>({
|
|
8
|
-
* ...SEARCH_CONFIGS.Q_USER,
|
|
9
|
-
* queryText: searchValue,
|
|
10
|
-
* });
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export const SEARCH_CONFIGS = {
|
|
14
|
-
/**
|
|
15
|
-
* Q-Sports user search configuration
|
|
16
|
-
* Searches the 'users' collection by displayName_lowercase field
|
|
17
|
-
*/
|
|
18
|
-
Q_USER: {
|
|
19
|
-
collectionPath: 'users',
|
|
20
|
-
searchField: 'displayName_lowercase',
|
|
21
|
-
limit: 5,
|
|
22
|
-
},
|
|
23
|
-
/**
|
|
24
|
-
* TTT Productions user search configuration
|
|
25
|
-
* Searches the 'userProfiles' collection by username field (already lowercase)
|
|
26
|
-
*/
|
|
27
|
-
TTT_USER: {
|
|
28
|
-
collectionPath: 'userProfiles',
|
|
29
|
-
searchField: 'username',
|
|
30
|
-
limit: 6,
|
|
31
|
-
},
|
|
32
|
-
/**
|
|
33
|
-
* TTT Productions project search configuration
|
|
34
|
-
* Searches the 'allProjects' collection by workingTitle field (already lowercase)
|
|
35
|
-
*/
|
|
36
|
-
TTT_PROJECT: {
|
|
37
|
-
collectionPath: 'allProjects',
|
|
38
|
-
searchField: 'workingTitle',
|
|
39
|
-
limit: 6,
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=search-configs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search-configs.js","sourceRoot":"","sources":["../../src/search/search-configs.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,cAAc,GAA0C;IACnE;;;OAGG;IACH,MAAM,EAAE;QACN,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,uBAAuB;QACpC,KAAK,EAAE,CAAC;KACT;IAED;;;OAGG;IACH,QAAQ,EAAE;QACR,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,UAAU;QACvB,KAAK,EAAE,CAAC;KACT;IAED;;;OAGG;IACH,WAAW,EAAE;QACX,cAAc,EAAE,aAAa;QAC7B,WAAW,EAAE,cAAc;QAC3B,KAAK,EAAE,CAAC;KACT;CACO,CAAC"}
|