naystack 1.2.23 → 1.2.25

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.
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ "use client";
3
+ var __create = Object.create;
2
4
  var __defProp = Object.defineProperty;
3
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
5
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
9
  var __export = (target, all) => {
7
10
  for (var name in all)
@@ -15,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
15
18
  }
16
19
  return to;
17
20
  };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
18
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
30
 
20
31
  // src/auth/email/client.tsx
@@ -27,7 +38,7 @@ __export(client_exports, {
27
38
  useToken: () => useToken
28
39
  });
29
40
  module.exports = __toCommonJS(client_exports);
30
- var import_react = require("react");
41
+ var import_react = __toESM(require("react"));
31
42
  var TokenContext = (0, import_react.createContext)({
32
43
  token: null,
33
44
  setToken: () => null
@@ -39,7 +50,7 @@ var getAuthWrapper = (endpoint) => ({ children }) => {
39
50
  credentials: "include"
40
51
  }).then((res) => res.json()).then((data) => setToken(data.accessToken));
41
52
  }, []);
42
- return /* @__PURE__ */ React.createElement(TokenContext.Provider, { value: { token, setToken } }, children);
53
+ return /* @__PURE__ */ import_react.default.createElement(TokenContext.Provider, { value: { token, setToken } }, children);
43
54
  };
44
55
  function useToken() {
45
56
  const { token } = (0, import_react.useContext)(TokenContext);
@@ -1,15 +1,14 @@
1
- import * as react from 'react';
2
- import { Dispatch, SetStateAction } from 'react';
1
+ import React__default, { Dispatch, SetStateAction } from 'react';
3
2
 
4
- declare const TokenContext: react.Context<{
3
+ declare const TokenContext: React__default.Context<{
5
4
  token: string | null;
6
5
  setToken: Dispatch<SetStateAction<string | null>>;
7
6
  }>;
8
7
  declare const getAuthWrapper: (endpoint: string) => ({ children }: {
9
- children: React.ReactNode;
10
- }) => react.JSX.Element;
8
+ children: React__default.ReactNode;
9
+ }) => React__default.JSX.Element;
11
10
  declare function useToken(): string | null;
12
- declare function useSetToken(): Dispatch<SetStateAction<string | null>>;
11
+ declare function useSetToken(): React__default.Dispatch<React__default.SetStateAction<string | null>>;
13
12
  declare function getEmailAuthUtils(endpoint: string): {
14
13
  useSignUp: () => (data: object) => Promise<string | null>;
15
14
  useLogin: () => (data: object) => Promise<string | null>;
@@ -1,15 +1,14 @@
1
- import * as react from 'react';
2
- import { Dispatch, SetStateAction } from 'react';
1
+ import React__default, { Dispatch, SetStateAction } from 'react';
3
2
 
4
- declare const TokenContext: react.Context<{
3
+ declare const TokenContext: React__default.Context<{
5
4
  token: string | null;
6
5
  setToken: Dispatch<SetStateAction<string | null>>;
7
6
  }>;
8
7
  declare const getAuthWrapper: (endpoint: string) => ({ children }: {
9
- children: React.ReactNode;
10
- }) => react.JSX.Element;
8
+ children: React__default.ReactNode;
9
+ }) => React__default.JSX.Element;
11
10
  declare function useToken(): string | null;
12
- declare function useSetToken(): Dispatch<SetStateAction<string | null>>;
11
+ declare function useSetToken(): React__default.Dispatch<React__default.SetStateAction<string | null>>;
13
12
  declare function getEmailAuthUtils(endpoint: string): {
14
13
  useSignUp: () => (data: object) => Promise<string | null>;
15
14
  useLogin: () => (data: object) => Promise<string | null>;
@@ -1,5 +1,7 @@
1
+ "use client";
2
+
1
3
  // src/auth/email/client.tsx
2
- import {
4
+ import React, {
3
5
  createContext,
4
6
  useCallback,
5
7
  useContext,
@@ -1,6 +1,6 @@
1
- import * as react from 'react';
1
+ import * as React from 'react';
2
2
 
3
- declare function useVisibility(onVisible?: () => void): react.RefObject<null>;
3
+ declare function useVisibility(onVisible?: () => void): React.RefObject<null>;
4
4
  declare function useBreakpoint(query: string): boolean | null;
5
5
 
6
6
  export { useBreakpoint, useVisibility };
@@ -1,6 +1,6 @@
1
- import * as react from 'react';
1
+ import * as React from 'react';
2
2
 
3
- declare function useVisibility(onVisible?: () => void): react.RefObject<null>;
3
+ declare function useVisibility(onVisible?: () => void): React.RefObject<null>;
4
4
  declare function useBreakpoint(query: string): boolean | null;
5
5
 
6
6
  export { useBreakpoint, useVisibility };
@@ -1,11 +1,11 @@
1
1
  import * as _apollo_client from '@apollo/client';
2
2
  import { InMemoryCacheConfig, OperationVariables, MutationHookOptions } from '@apollo/client';
3
3
  import { TypedDocumentNode } from '@graphql-typed-document-node/core';
4
- import react__default, { PropsWithChildren } from 'react';
4
+ import React__default, { PropsWithChildren } from 'react';
5
5
 
6
6
  declare const getApolloWrapper: (endpoint: string, options?: {
7
7
  cacheConfig?: InMemoryCacheConfig;
8
- }) => ({ children }: PropsWithChildren) => react__default.JSX.Element;
8
+ }) => ({ children }: PropsWithChildren) => React__default.JSX.Element;
9
9
  declare const tokenContext: (token?: string | null) => {
10
10
  headers: {
11
11
  authorization: string;
@@ -1,11 +1,11 @@
1
1
  import * as _apollo_client from '@apollo/client';
2
2
  import { InMemoryCacheConfig, OperationVariables, MutationHookOptions } from '@apollo/client';
3
3
  import { TypedDocumentNode } from '@graphql-typed-document-node/core';
4
- import react__default, { PropsWithChildren } from 'react';
4
+ import React__default, { PropsWithChildren } from 'react';
5
5
 
6
6
  declare const getApolloWrapper: (endpoint: string, options?: {
7
7
  cacheConfig?: InMemoryCacheConfig;
8
- }) => ({ children }: PropsWithChildren) => react__default.JSX.Element;
8
+ }) => ({ children }: PropsWithChildren) => React__default.JSX.Element;
9
9
  declare const tokenContext: (token?: string | null) => {
10
10
  headers: {
11
11
  authorization: string;
@@ -1,4 +1,4 @@
1
- import * as react from 'react';
1
+ import * as React from 'react';
2
2
  import { FC } from 'react';
3
3
  import { OperationVariables } from '@apollo/client';
4
4
  import { TypedDocumentNode } from '@graphql-typed-document-node/core';
@@ -15,7 +15,7 @@ declare function Injector<T, Y>({ fetch, Component, props, }: {
15
15
  data?: T;
16
16
  loading: boolean;
17
17
  } & Y>;
18
- } & ComponentProps<Y>): react.JSX.Element;
18
+ } & ComponentProps<Y>): React.JSX.Element;
19
19
  declare const getGraphQLQuery: ({ uri }: {
20
20
  uri: string;
21
21
  }) => <T, V extends OperationVariables>(_query: TypedDocumentNode<T, V>, options?: {
@@ -1,4 +1,4 @@
1
- import * as react from 'react';
1
+ import * as React from 'react';
2
2
  import { FC } from 'react';
3
3
  import { OperationVariables } from '@apollo/client';
4
4
  import { TypedDocumentNode } from '@graphql-typed-document-node/core';
@@ -15,7 +15,7 @@ declare function Injector<T, Y>({ fetch, Component, props, }: {
15
15
  data?: T;
16
16
  loading: boolean;
17
17
  } & Y>;
18
- } & ComponentProps<Y>): react.JSX.Element;
18
+ } & ComponentProps<Y>): React.JSX.Element;
19
19
  declare const getGraphQLQuery: ({ uri }: {
20
20
  uri: string;
21
21
  }) => <T, V extends OperationVariables>(_query: TypedDocumentNode<T, V>, options?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.2.23",
3
+ "version": "1.2.25",
4
4
  "description": "A stack built with Next + GraphQL + S3 + Auth",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",