@quiltt/react 3.7.1 → 3.7.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @quiltt/react
2
2
 
3
+ ## 3.7.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#293](https://github.com/quiltt/quiltt-js/pull/293) [`f4b48e6`](https://github.com/quiltt/quiltt-js/commit/f4b48e6db199cae4e880202c28974b481890b7c6) Thanks [@rubendinho](https://github.com/rubendinho)! - Improve documentation
8
+
9
+ - Updated dependencies [[`f4b48e6`](https://github.com/quiltt/quiltt-js/commit/f4b48e6db199cae4e880202c28974b481890b7c6)]:
10
+ - @quiltt/core@3.7.3
11
+
12
+ ## 3.7.2
13
+
14
+ ### Patch Changes
15
+
16
+ - [#284](https://github.com/quiltt/quiltt-js/pull/284) [`ccfc6a3`](https://github.com/quiltt/quiltt-js/commit/ccfc6a36ad465e73723d2286b37a377256c31b11) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Update Dependencies
17
+
18
+ - Updated dependencies [[`ccfc6a3`](https://github.com/quiltt/quiltt-js/commit/ccfc6a36ad465e73723d2286b37a377256c31b11)]:
19
+ - @quiltt/core@3.7.2
20
+
3
21
  ## 3.7.1
4
22
 
5
23
  ### Patch Changes
@@ -5,7 +5,7 @@ import { JsonWebTokenParse, QuilttClient, InMemoryCache as InMemoryCache$1 } fro
5
5
  import './useQuilttSettings-client-DU_Qfc8X.js';
6
6
  import './useSession-client-CG5lGS9F.js';
7
7
  import { jsx } from 'react/jsx-runtime';
8
- import { u as useQuilttSession } from './useQuilttSession-client-D2WZ1XHW.js';
8
+ import { u as useQuilttSession } from './useQuilttSession-client-TRaUyBXB.js';
9
9
 
10
10
  function _mergeNamespaces(n, m) {
11
11
  m.forEach(function (e) {
@@ -355,7 +355,7 @@ function setVerbosity(level) {
355
355
  return old;
356
356
  }
357
357
 
358
- var version = "3.9.9";
358
+ var version = "3.9.11";
359
359
 
360
360
  function maybe$1(thunk) {
361
361
  try {
@@ -3843,7 +3843,7 @@ var DeepMerger = /** @class */ function() {
3843
3843
  function _createForOfIteratorHelperLoose(o, allowArrayLike) {
3844
3844
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
3845
3845
  if (it) return (it = it.call(o)).next.bind(it);
3846
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike ) {
3846
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) {
3847
3847
  if (it) o = it;
3848
3848
  var i = 0;
3849
3849
  return function() {
@@ -7306,12 +7306,14 @@ var StoreReader = /** @class */ function() {
7306
7306
  missing = missingMerger.merge(missing, (_a = {}, _a[resultName] = "Can't find field '".concat(selection.name.value, "' on ").concat(isReference(objectOrReference) ? objectOrReference.__ref + " object" : "object " + JSON.stringify(objectOrReference, null, 2)), _a));
7307
7307
  }
7308
7308
  } else if (isArray(fieldValue)) {
7309
- fieldValue = handleMissing(_this.executeSubSelectedArray({
7310
- field: selection,
7311
- array: fieldValue,
7312
- enclosingRef: enclosingRef,
7313
- context: context
7314
- }), resultName);
7309
+ if (fieldValue.length > 0) {
7310
+ fieldValue = handleMissing(_this.executeSubSelectedArray({
7311
+ field: selection,
7312
+ array: fieldValue,
7313
+ enclosingRef: enclosingRef,
7314
+ context: context
7315
+ }), resultName);
7316
+ }
7315
7317
  } else if (!selection.selectionSet) {
7316
7318
  // If the field does not have a selection set, then we handle it
7317
7319
  // as a scalar value. To keep this.canon from canonicalizing
@@ -12732,19 +12734,20 @@ var OBSERVED_CHANGED_OPTIONS = [
12732
12734
  InternalQueryReference.prototype.reinitialize = function() {
12733
12735
  var observable = this.observable;
12734
12736
  var originalFetchPolicy = this.watchQueryOptions.fetchPolicy;
12737
+ var avoidNetworkRequests = originalFetchPolicy === "no-cache" || originalFetchPolicy === "standby";
12735
12738
  try {
12736
- if (originalFetchPolicy !== "no-cache") {
12737
- observable.resetLastResults();
12739
+ if (avoidNetworkRequests) {
12738
12740
  observable.silentSetOptions({
12739
- fetchPolicy: "cache-first"
12741
+ fetchPolicy: "standby"
12740
12742
  });
12741
12743
  } else {
12744
+ observable.resetLastResults();
12742
12745
  observable.silentSetOptions({
12743
- fetchPolicy: "standby"
12746
+ fetchPolicy: "cache-first"
12744
12747
  });
12745
12748
  }
12746
12749
  this.subscribeToQuery();
12747
- if (originalFetchPolicy === "no-cache") {
12750
+ if (avoidNetworkRequests) {
12748
12751
  return;
12749
12752
  }
12750
12753
  observable.resetDiff();
@@ -12766,12 +12769,9 @@ var OBSERVED_CHANGED_OPTIONS = [
12766
12769
  }
12767
12770
  disposed = true;
12768
12771
  _this.references--;
12769
- // Wait before fully disposing in case the app is running in strict mode.
12770
- setTimeout(function() {
12771
- if (!_this.references) {
12772
- _this.dispose();
12773
- }
12774
- });
12772
+ if (!_this.references) {
12773
+ _this.dispose();
12774
+ }
12775
12775
  };
12776
12776
  };
12777
12777
  InternalQueryReference.prototype.softRetain = function() {
@@ -12986,4 +12986,4 @@ const GraphQLClient = new QuilttClient({
12986
12986
  });
12987
12987
  };
12988
12988
 
12989
- export { QuilttAuthProvider as Q, useImportSession as a, useIdentifySession as b, useAuthenticateSession as c, useRevokeSession as d, useApolloClient as u };
12989
+ export { GraphQLClient as G, QuilttAuthProvider as Q, useImportSession as a, useIdentifySession as b, useAuthenticateSession as c, useRevokeSession as d, useApolloClient as u };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { Maybe, QuilttJWT, UsernamePayload, UnprocessableData, AuthAPI, PasscodePayload, ConnectorSDKConnectorOptions, ConnectorSDKCallbacks } from '@quiltt/core';
1
+ import { Maybe, QuilttJWT, UsernamePayload, UnprocessableData, AuthAPI, PasscodePayload, ConnectorSDKConnectorOptions, QuilttClient, ConnectorSDKCallbacks } from '@quiltt/core';
2
2
  export * from '@quiltt/core';
3
3
  import * as react from 'react';
4
4
  import { RefObject, useLayoutEffect, Dispatch, SetStateAction, FC, PropsWithChildren, Component, ComponentType } from 'react';
5
5
  import { useApolloClient } from '@apollo/client/index.js';
6
+ import * as _apollo_client from '@apollo/client';
6
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
8
 
8
9
  declare function useEventListener<K extends keyof MediaQueryListEventMap>(eventName: K, handler: (event: MediaQueryListEventMap[K]) => void, element: RefObject<MediaQueryList>, options?: boolean | AddEventListenerOptions): void;
@@ -107,8 +108,10 @@ declare const useQuilttSettings: () => {
107
108
  declare const useStorage: <T>(key: string, initialState?: Maybe<T>) => [Maybe<T> | undefined, Dispatch<SetStateAction<Maybe<T> | undefined>>];
108
109
 
109
110
  type QuilttAuthProviderProps = PropsWithChildren & {
111
+ /** The Session token obtained from the server */
110
112
  token?: string;
111
113
  };
114
+ declare const GraphQLClient: QuilttClient<_apollo_client.NormalizedCacheObject>;
112
115
  /**
113
116
  * If a token is provided, will validate the token against the api and then import
114
117
  * it into trusted storage. While this process is happening, the component is put
@@ -119,12 +122,15 @@ type QuilttAuthProviderProps = PropsWithChildren & {
119
122
  declare const QuilttAuthProvider: FC<QuilttAuthProviderProps>;
120
123
 
121
124
  type QuilttProviderProps = PropsWithChildren & {
125
+ /** The client ID for the client-side Auth API */
122
126
  clientId?: string;
127
+ /** The Session token obtained from the server */
123
128
  token?: string;
124
129
  };
125
130
  declare const QuilttProvider: FC<QuilttProviderProps>;
126
131
 
127
132
  type QuilttSettingsProviderProps = PropsWithChildren & {
133
+ /** The Client ID to use for the client-side Auth API */
128
134
  clientId?: string;
129
135
  };
130
136
  declare const QuilttSettingsProvider: FC<QuilttSettingsProviderProps>;
@@ -151,4 +157,4 @@ type QuilttContainerProps<T extends AnyTag> = PropsWithChildren<{
151
157
  */
152
158
  declare const QuilttContainer: <T extends AnyTag = "div">({ as, connectorId, connectionId, onEvent, onLoad, onExit, onExitSuccess, onExitAbort, onExitError, children, ...props }: QuilttContainerProps<T> & PropsOf<T>) => react_jsx_runtime.JSX.Element;
153
159
 
154
- export { type AuthenticateSession, type IdentifySession, type ImportSession, QuilttAuthProvider, QuilttButton, QuilttContainer, QuilttProvider, QuilttSettings, QuilttSettingsProvider, type RevokeSession, type SetSession, type UseQuilttSession, useAuthenticateSession, useEventListener, useIdentifySession, useImportSession, useIsomorphicLayoutEffect, useQuilttClient, useQuilttConnector, useQuilttSession, useQuilttSettings, useRevokeSession, useSession, useStorage };
160
+ export { type AuthenticateSession, GraphQLClient, type IdentifySession, type ImportSession, QuilttAuthProvider, QuilttButton, QuilttContainer, QuilttProvider, QuilttSettings, QuilttSettingsProvider, type RevokeSession, type SetSession, type UseQuilttSession, useAuthenticateSession, useEventListener, useIdentifySession, useImportSession, useIsomorphicLayoutEffect, useQuilttClient, useQuilttConnector, useQuilttSession, useQuilttSettings, useRevokeSession, useSession, useStorage };
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  export * from '@quiltt/core';
2
2
  export { u as useEventListener } from './useEventListener-client-DVM5xwKY.js';
3
3
  export { u as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect-client-DeTHOKz1.js';
4
- import { Q as QuilttAuthProvider } from './QuilttAuthProvider-client-uO21FlYI.js';
5
- export { c as useAuthenticateSession, b as useIdentifySession, a as useImportSession, d as useRevokeSession } from './QuilttAuthProvider-client-uO21FlYI.js';
6
- export { u as useQuilttClient } from './useQuilttClient-client-4no_TYct.js';
7
- import { u as useQuilttConnector } from './useQuilttConnector-client-Cdd4BzUJ.js';
8
- export { u as useQuilttSession } from './useQuilttSession-client-D2WZ1XHW.js';
4
+ import { Q as QuilttAuthProvider } from './QuilttAuthProvider-client-D-lSeXpV.js';
5
+ export { G as GraphQLClient, c as useAuthenticateSession, b as useIdentifySession, a as useImportSession, d as useRevokeSession } from './QuilttAuthProvider-client-D-lSeXpV.js';
6
+ export { u as useQuilttClient } from './useQuilttClient-client-CGMZPnRI.js';
7
+ import { u as useQuilttConnector } from './useQuilttConnector-client-BPksnYdt.js';
8
+ export { u as useQuilttSession } from './useQuilttSession-client-TRaUyBXB.js';
9
9
  export { Q as QuilttSettings, u as useQuilttSettings } from './useQuilttSettings-client-DU_Qfc8X.js';
10
10
  export { u as useSession } from './useSession-client-CG5lGS9F.js';
11
11
  export { u as useStorage } from './useStorage-client-B3keU-oI.js';
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { u as useApolloClient } from './QuilttAuthProvider-client-uO21FlYI.js';
2
+ import { u as useApolloClient } from './QuilttAuthProvider-client-D-lSeXpV.js';
3
3
 
4
4
  const useQuilttClient = useApolloClient;
5
5
 
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
  import { useState, useEffect, useCallback } from 'react';
3
3
  import { cdnBase } from '@quiltt/core';
4
- import { u as useQuilttSession } from './useQuilttSession-client-D2WZ1XHW.js';
4
+ import { u as useQuilttSession } from './useQuilttSession-client-TRaUyBXB.js';
5
5
  import { u as useScript } from './useScript-client-Cx5nb9RW.js';
6
6
 
7
7
  // Generated by genversion.
8
- const version = '3.7.1';
8
+ const version = '3.7.3';
9
9
 
10
10
  const useQuilttConnector = (connectorId, options)=>{
11
11
  const status = useScript(`${cdnBase}/v1/connector.js?agent=react-${version}`);
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { useCallback } from 'react';
3
3
  import { AuthAPI } from '@quiltt/core';
4
- import { a as useImportSession, b as useIdentifySession, c as useAuthenticateSession, d as useRevokeSession } from './QuilttAuthProvider-client-uO21FlYI.js';
4
+ import { a as useImportSession, b as useIdentifySession, c as useAuthenticateSession, d as useRevokeSession } from './QuilttAuthProvider-client-D-lSeXpV.js';
5
5
  import { u as useQuilttSettings } from './useQuilttSettings-client-DU_Qfc8X.js';
6
6
  import { u as useSession } from './useSession-client-CG5lGS9F.js';
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quiltt/react",
3
- "version": "3.7.1",
3
+ "version": "3.7.3",
4
4
  "description": "React components and hooks for Quiltt Connector",
5
5
  "keywords": [
6
6
  "quiltt",
@@ -37,19 +37,19 @@
37
37
  "CHANGELOG.md"
38
38
  ],
39
39
  "dependencies": {
40
- "@quiltt/core": "3.7.1"
40
+ "@quiltt/core": "3.7.3"
41
41
  },
42
42
  "devDependencies": {
43
- "@apollo/client": "3.9.9",
43
+ "@apollo/client": "3.9.11",
44
44
  "@biomejs/biome": "1.8.3",
45
- "@types/node": "20.14.10",
45
+ "@types/node": "22.4.1",
46
46
  "@types/react": "18.3.3",
47
- "@types/react-dom": "18.2.6",
48
- "bunchee": "5.2.2",
49
- "react": "18.2.0",
50
- "react-dom": "18.2.0",
51
- "rimraf": "6.0.0",
52
- "typescript": "5.5.3"
47
+ "@types/react-dom": "18.3.0",
48
+ "bunchee": "5.3.2",
49
+ "react": "18.3.1",
50
+ "react-dom": "18.3.1",
51
+ "rimraf": "6.0.1",
52
+ "typescript": "5.5.4"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
@@ -60,7 +60,6 @@ export const useQuilttConnector = (
60
60
  return () => connector.offOpen(options.onOpen as any)
61
61
  }, [connector, options?.onOpen])
62
62
 
63
-
64
63
  // onLoad
65
64
  useEffect(() => {
66
65
  if (!connector || !options?.onLoad) return
@@ -8,10 +8,11 @@ import { InMemoryCache, QuilttClient } from '@quiltt/core'
8
8
  import { useQuilttSession } from '../hooks'
9
9
 
10
10
  type QuilttAuthProviderProps = PropsWithChildren & {
11
+ /** The Session token obtained from the server */
11
12
  token?: string
12
13
  }
13
14
 
14
- const GraphQLClient = new QuilttClient({
15
+ export const GraphQLClient = new QuilttClient({
15
16
  cache: new InMemoryCache(),
16
17
  })
17
18
 
@@ -4,7 +4,9 @@ import { QuilttAuthProvider } from './QuilttAuthProvider'
4
4
  import { QuilttSettingsProvider } from './QuilttSettingsProvider'
5
5
 
6
6
  type QuilttProviderProps = PropsWithChildren & {
7
+ /** The client ID for the client-side Auth API */
7
8
  clientId?: string
9
+ /** The Session token obtained from the server */
8
10
  token?: string
9
11
  }
10
12
 
@@ -6,6 +6,7 @@ import { useState } from 'react'
6
6
  import { QuilttSettings } from '../hooks'
7
7
 
8
8
  type QuilttSettingsProviderProps = PropsWithChildren & {
9
+ /** The Client ID to use for the client-side Auth API */
9
10
  clientId?: string
10
11
  }
11
12
 
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '3.7.1'
2
+ export const version = '3.7.3'