@taxbit/react-sdk 0.0.2 → 0.0.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/dist/App.d.ts CHANGED
@@ -1,5 +1,2 @@
1
1
  import React from "react";
2
- export declare const DataContext: React.Context<{
3
- hey: number;
4
- }>;
5
2
  export declare const App: () => React.JSX.Element;
@@ -9285,14 +9285,14 @@ const Wi = (e, n) => `https://api.multi1.enterprise${n === "STAGING" ? "-staging
9285
9285
  }
9286
9286
  ),
9287
9287
  taxDocumentationStatus: "UNDOCUMENTED"
9288
- }), Yi = new Hi(), Qi = ({
9288
+ }), Yi = new Hi(), _i = ({
9289
9289
  initialData: e,
9290
9290
  environment: n,
9291
9291
  bearerToken: t,
9292
9292
  language: a,
9293
9293
  forms: o
9294
9294
  }) => /* @__PURE__ */ i.jsx(Li, { client: Yi, children: /* @__PURE__ */ i.jsx(
9295
- _i,
9295
+ Ji,
9296
9296
  {
9297
9297
  initialData: e,
9298
9298
  language: a,
@@ -9300,7 +9300,7 @@ const Wi = (e, n) => `https://api.multi1.enterprise${n === "STAGING" ? "-staging
9300
9300
  environment: n,
9301
9301
  bearerToken: t
9302
9302
  }
9303
- ) }), _i = ({
9303
+ ) }), Ji = ({
9304
9304
  environment: e,
9305
9305
  initialData: n,
9306
9306
  bearerToken: t,
@@ -9320,13 +9320,13 @@ const Wi = (e, n) => `https://api.multi1.enterprise${n === "STAGING" ? "-staging
9320
9320
  forms: o
9321
9321
  }
9322
9322
  ) : /* @__PURE__ */ i.jsx("div", { children: "Documentation was already submitted" }) : /* @__PURE__ */ i.jsx("div", { children: "Loading..." });
9323
- }, Ji = ({
9323
+ }, Qi = ({
9324
9324
  initialData: e,
9325
9325
  environment: n,
9326
9326
  bearerToken: t,
9327
9327
  language: a
9328
9328
  }) => /* @__PURE__ */ i.jsx(
9329
- Ji,
9329
+ _i,
9330
9330
  {
9331
9331
  initialData: e,
9332
9332
  language: a,
@@ -9336,7 +9336,7 @@ const Wi = (e, n) => `https://api.multi1.enterprise${n === "STAGING" ? "-staging
9336
9336
  }
9337
9337
  );
9338
9338
  export {
9339
- Ji as TaxDocumentationDAC7Widget,
9339
+ Qi as TaxDocumentationDAC7Widget,
9340
9340
  li as TaxDocumentationPath,
9341
- Qi as TaxDocumentationWidget
9341
+ _i as TaxDocumentationWidget
9342
9342
  };
@@ -40,4 +40,4 @@ Check the top-level render call using <`+f+">.")}return h}}function ft(r,h){{if(
40
40
  *
41
41
  * This source code is licensed under the MIT license found in the
42
42
  * LICENSE file in the root directory of this source tree.
43
- */var Xn;function Za(){return Xn||(Xn=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(x){{for(var T=arguments.length,G=new Array(T>1?T-1:0),S=1;S<T;S++)G[S-1]=arguments[S];a("error",x,G)}}function a(x,T,G){{var S=n.ReactDebugCurrentFrame,N=S.getStackAddendum();N!==""&&(T+="%s",G=G.concat([N]));var P=G.map(function(k){return String(k)});P.unshift("Warning: "+T),Function.prototype.apply.call(console[x],console,P)}}function o(x,T){return x===T&&(x!==0||1/x===1/T)||x!==x&&T!==T}var s=typeof Object.is=="function"?Object.is:o,c=e.useState,u=e.useEffect,d=e.useLayoutEffect,l=e.useDebugValue,m=!1,g=!1;function p(x,T,G){m||e.startTransition!==void 0&&(m=!0,t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var S=T();if(!g){var N=T();s(S,N)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}var P=c({inst:{value:S,getSnapshot:T}}),k=P[0].inst,Q=P[1];return d(function(){k.value=S,k.getSnapshot=T,C(k)&&Q({inst:k})},[x,S,T]),u(function(){C(k)&&Q({inst:k});var $=function(){C(k)&&Q({inst:k})};return x($)},[x]),l(S),S}function C(x){var T=x.getSnapshot,G=x.value;try{var S=T();return!s(G,S)}catch{return!0}}function E(x,T,G){return T()}var A=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",v=!A,w=v?E:p,H=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;pn.useSyncExternalStore=H,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),pn}process.env.NODE_ENV==="production"?fn.exports=Ja():fn.exports=Za();var Qa=fn.exports;const $a=Qa.useSyncExternalStore,et=ae.createContext(void 0),nt=ae.createContext(!1);function tt(e,n){return e||(n&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=et),window.ReactQueryClientContext):et)}const Xa=({context:e}={})=>{const n=ae.useContext(tt(e,ae.useContext(nt)));if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},ei=({client:e,children:n,context:t,contextSharing:a=!1})=>{ae.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),process.env.NODE_ENV!=="production"&&a&&e.getLogger().error("The contextSharing option has been deprecated and will be removed in the next major version");const o=tt(t,a);return ae.createElement(nt.Provider,{value:!t&&a},ae.createElement(o.Provider,{value:e},n))};function ni(e,n){return typeof e=="function"?e(...n):!!e}function ti(e,n,t){const a=Ha(e,n,t),o=Xa({context:a.context}),[s]=ae.useState(()=>new _a(o,a));ae.useEffect(()=>{s.setOptions(a)},[s,a]);const c=$a(ae.useCallback(d=>s.subscribe(q.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),u=ae.useCallback((d,l)=>{s.mutate(d,l).catch(ai)},[s]);if(c.error&&ni(s.options.useErrorBoundary,[c.error]))throw c.error;return{...c,mutate:u,mutateAsync:c.mutate}}function ai(){}const ii=(e,n)=>`https://api.multi1.enterprise${n==="STAGING"?"-staging":""}.taxbit.com/v1/${e}`,ri={taxDocumentation:{post:e=>ii("tax-documentation",e)}},oi=({bearerToken:e})=>new Headers({Authorization:`Bearer ${e}`}),si=(e,n)=>({submitTaxDocumentation:ti(o=>{const s=ri.taxDocumentation.post(e);return fetch(s,{method:"POST",headers:oi({bearerToken:n}),body:JSON.stringify(o)})},{onSuccess:()=>alert("Tax documentation submitted"),onError:()=>alert("Error submitting tax documentation")}),taxDocumentationStatus:"UNDOCUMENTED"}),ci=new Ya,ui=({initialData:e,environment:n,bearerToken:t,language:a,forms:o})=>i.jsx(ei,{client:ci,children:i.jsx(di,{initialData:e,language:a,forms:o,environment:n,bearerToken:t})}),di=({environment:e,initialData:n,bearerToken:t,language:a,forms:o})=>{const{taxDocumentationStatus:s,submitTaxDocumentation:c}=si(e,t);return s?s==="UNDOCUMENTED"?i.jsx(Dn,{initialData:n,initialLanguage:a,onSubmit:u=>c.mutate(u),forms:o}):i.jsx("div",{children:"Documentation was already submitted"}):i.jsx("div",{children:"Loading..."})},at=({initialData:e,environment:n,bearerToken:t,language:a})=>i.jsx(at,{initialData:e,language:a,forms:["DAC7"],environment:n,bearerToken:t});de.TaxDocumentationDAC7Widget=at,de.TaxDocumentationPath=Dn,de.TaxDocumentationWidget=ui,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
43
+ */var Xn;function Za(){return Xn||(Xn=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(x){{for(var T=arguments.length,G=new Array(T>1?T-1:0),S=1;S<T;S++)G[S-1]=arguments[S];a("error",x,G)}}function a(x,T,G){{var S=n.ReactDebugCurrentFrame,N=S.getStackAddendum();N!==""&&(T+="%s",G=G.concat([N]));var P=G.map(function(k){return String(k)});P.unshift("Warning: "+T),Function.prototype.apply.call(console[x],console,P)}}function o(x,T){return x===T&&(x!==0||1/x===1/T)||x!==x&&T!==T}var s=typeof Object.is=="function"?Object.is:o,c=e.useState,u=e.useEffect,d=e.useLayoutEffect,l=e.useDebugValue,m=!1,g=!1;function p(x,T,G){m||e.startTransition!==void 0&&(m=!0,t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var S=T();if(!g){var N=T();s(S,N)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}var P=c({inst:{value:S,getSnapshot:T}}),k=P[0].inst,Q=P[1];return d(function(){k.value=S,k.getSnapshot=T,C(k)&&Q({inst:k})},[x,S,T]),u(function(){C(k)&&Q({inst:k});var $=function(){C(k)&&Q({inst:k})};return x($)},[x]),l(S),S}function C(x){var T=x.getSnapshot,G=x.value;try{var S=T();return!s(G,S)}catch{return!0}}function E(x,T,G){return T()}var A=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",v=!A,w=v?E:p,H=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;pn.useSyncExternalStore=H,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),pn}process.env.NODE_ENV==="production"?fn.exports=Ja():fn.exports=Za();var Qa=fn.exports;const $a=Qa.useSyncExternalStore,et=ae.createContext(void 0),nt=ae.createContext(!1);function tt(e,n){return e||(n&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=et),window.ReactQueryClientContext):et)}const Xa=({context:e}={})=>{const n=ae.useContext(tt(e,ae.useContext(nt)));if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},ei=({client:e,children:n,context:t,contextSharing:a=!1})=>{ae.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),process.env.NODE_ENV!=="production"&&a&&e.getLogger().error("The contextSharing option has been deprecated and will be removed in the next major version");const o=tt(t,a);return ae.createElement(nt.Provider,{value:!t&&a},ae.createElement(o.Provider,{value:e},n))};function ni(e,n){return typeof e=="function"?e(...n):!!e}function ti(e,n,t){const a=Ha(e,n,t),o=Xa({context:a.context}),[s]=ae.useState(()=>new _a(o,a));ae.useEffect(()=>{s.setOptions(a)},[s,a]);const c=$a(ae.useCallback(d=>s.subscribe(q.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),u=ae.useCallback((d,l)=>{s.mutate(d,l).catch(ai)},[s]);if(c.error&&ni(s.options.useErrorBoundary,[c.error]))throw c.error;return{...c,mutate:u,mutateAsync:c.mutate}}function ai(){}const ii=(e,n)=>`https://api.multi1.enterprise${n==="STAGING"?"-staging":""}.taxbit.com/v1/${e}`,ri={taxDocumentation:{post:e=>ii("tax-documentation",e)}},oi=({bearerToken:e})=>new Headers({Authorization:`Bearer ${e}`}),si=(e,n)=>({submitTaxDocumentation:ti(o=>{const s=ri.taxDocumentation.post(e);return fetch(s,{method:"POST",headers:oi({bearerToken:n}),body:JSON.stringify(o)})},{onSuccess:()=>alert("Tax documentation submitted"),onError:()=>alert("Error submitting tax documentation")}),taxDocumentationStatus:"UNDOCUMENTED"}),ci=new Ya,at=({initialData:e,environment:n,bearerToken:t,language:a,forms:o})=>i.jsx(ei,{client:ci,children:i.jsx(ui,{initialData:e,language:a,forms:o,environment:n,bearerToken:t})}),ui=({environment:e,initialData:n,bearerToken:t,language:a,forms:o})=>{const{taxDocumentationStatus:s,submitTaxDocumentation:c}=si(e,t);return s?s==="UNDOCUMENTED"?i.jsx(Dn,{initialData:n,initialLanguage:a,onSubmit:u=>c.mutate(u),forms:o}):i.jsx("div",{children:"Documentation was already submitted"}):i.jsx("div",{children:"Loading..."})},di=({initialData:e,environment:n,bearerToken:t,language:a})=>i.jsx(at,{initialData:e,language:a,forms:["DAC7"],environment:n,bearerToken:t});de.TaxDocumentationDAC7Widget=di,de.TaxDocumentationPath=Dn,de.TaxDocumentationWidget=at,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
@@ -1,12 +1,11 @@
1
1
  import React from "react";
2
2
  import type { Locale } from "i18n";
3
- import { Form, TaxDocumentation } from "types";
3
+ import { TaxDocumentation } from "types";
4
4
  type TaxDocumentationDAC7WidgetProps = {
5
5
  initialData?: TaxDocumentation;
6
6
  environment: "PRODUCTION" | "STAGING";
7
7
  bearerToken: string;
8
8
  language?: Locale;
9
- forms?: Form[];
10
9
  };
11
10
  export declare const TaxDocumentationDAC7Widget: ({ initialData, environment, bearerToken, language, }: TaxDocumentationDAC7WidgetProps) => React.JSX.Element;
12
11
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taxbit/react-sdk",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "TaxBit Tax Documentation",
5
5
  "author": "TaxBit",
6
6
  "type": "module",
@@ -11,9 +11,8 @@
11
11
  "main": "./dist/taxbit-collect-components.es.js",
12
12
  "module": "./dist/taxbit-collect-components.es.js",
13
13
  "exports": {
14
- "./stacked.css": "./dist/taxbit-basic.css",
15
- "./horizontal.css": "./dist/taxbit-basic-horizontal.css",
16
- "./minimal.css": "./dist/minimal.css",
14
+ "./dist/taxbit-basic.css": "./dist/taxbit-basic.css",
15
+ "./dist/taxbit-basic-horizontal.css": "./dist/taxbit-basic-horizontal.css",
17
16
  ".": {
18
17
  "import": "./dist/taxbit-collect-components.es.js",
19
18
  "require": "./dist/taxbit-collect-components.umd.js"
@@ -1,2 +0,0 @@
1
- import React from "react";
2
- export declare const Component: () => React.JSX.Element;