@stigg/react-sdk 8.0.0 → 8.1.0
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/{CreditUsageChart-ULIOSUUZ.cjs.js → CreditUsageChart-S55GF7BO.cjs.js} +19 -19
- package/dist/{CreditUsageChart-KRL3HX2Z.esm.js → CreditUsageChart-WJZI2Q44.esm.js} +1 -1
- package/dist/{chunk-TVE6DQ7G.cjs.js → chunk-3NBXYYSD.cjs.js} +1 -1
- package/dist/{chunk-A4LH66R4.esm.js → chunk-UL6DNWT4.esm.js} +1 -1
- package/dist/stigg-sdk.cjs.js +170 -170
- package/dist/stigg-sdk.esm.js +3 -3
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
@media (max-width: 1040px) {
|
|
9
9
|
${({$smallScreenAlign:t})=>t&&`align-self: ${t};`}
|
|
10
10
|
}
|
|
11
|
-
`;function l2({source:t,showWatermark:e,align:o,smallScreenAlign:n="center",style:s={}}){if(!e)return null;let a=()=>{let l=window.location.hostname.replace("www.","");window.open(`https://www.stigg.io/?utm_source=${l}&utm_medium=referral&utm_campaign=${t}`,"_blank");};return jsxRuntime.jsx(vt,{$alignSelf:o,$smallScreenAlign:n,className:yt,style:r({cursor:"pointer"},s),onClick:a,children:jsxRuntime.jsx(kt,{})})}var O=class{error(e,o,...n){console.error(e,o||{},n);}log(e,o){console.log(e,o||{});}debug(e,o){console.debug(e,o||{});}},m1=new O;var u1="8.
|
|
11
|
+
`;function l2({source:t,showWatermark:e,align:o,smallScreenAlign:n="center",style:s={}}){if(!e)return null;let a=()=>{let l=window.location.hostname.replace("www.","");window.open(`https://www.stigg.io/?utm_source=${l}&utm_medium=referral&utm_campaign=${t}`,"_blank");};return jsxRuntime.jsx(vt,{$alignSelf:o,$smallScreenAlign:n,className:yt,style:r({cursor:"pointer"},s),onClick:a,children:jsxRuntime.jsx(kt,{})})}var O=class{error(e,o,...n){console.error(e,o||{},n);}log(e,o){console.log(e,o||{});}debug(e,o){console.debug(e,o||{});}},m1=new O;var u1="8.1.0";var h1="@stigg/react-sdk";var _=Lt__default.default.createContext(null);_.displayName="StiggContext";var Tt="en-US",v2=({apiKey:t,baseUri:e,baseEdgeUri:o,enableEdge:n,customerId:s,customerToken:a,resourceId:l,theme:d,locale:g,cacheTtlMs:c,useEntitlementPolling:S,entitlementPollingInterval:E,entitlementsFallback:P,stiggClient:U,children:R,offline:W,clientName:Z=h1,clientVersion:ct=u1})=>{let o1=Lt.useRef(t),r1={apiKey:t,customerId:s,customerToken:a,resourceId:l,baseUri:e,baseEdgeUri:o,enableEdge:n,entitlementsFallback:P,cacheTtlMs:c,useEntitlementPolling:S,entitlementPollingInterval:E,clientName:Z,clientVersion:ct,offline:W},[M,G]=Lt.useState(()=>({stigg:U!=null?U:x1__default.default.initialize(i(r({},r1),{lazyLoad:true})),locale:g||Tt,isInitialized:false,theme:d,refreshData:()=>y(null,null,function*(){G(u=>i(r({},u),{customerPortalUpdatedAt:new Date})),yield M.stigg.refresh();})}));return Lt.useEffect(()=>{let u=true,N=f=>{u&&G(f);},$=()=>N(f=>i(r({},f),{updatedAt:new Date})),Ct=f=>N(b=>(b.stigg&&b.stigg.removeListener("entitlementsUpdated",$),f.addListener("entitlementsUpdated",$),i(r({},b),{stigg:f,isInitialized:true,updatedAt:new Date})));return y(null,null,function*(){let f=M.stigg;t!==o1.current&&(m1.log("Updating stigg client",{apiKey:t}),o1.current=t,f=x1__default.default.initialize(r({},r1)),N(b=>i(r({},b),{isInitialized:false,updatedAt:new Date}))),yield f.waitForInitialization(),Ct(f);}),()=>{u=false,M.stigg.removeListener("entitlementsUpdated",$),M.stigg.clearCustomer();}},[t]),Lt.useEffect(()=>{let u=M.stigg;s?u.setCustomerId(s,a,l):u.clearCustomer();},[s,a,l]),Lt.useEffect(()=>{G(u=>i(r({},u),{theme:d}));},[d]),jsxRuntime.jsx(_.Provider,{value:M,children:jsxRuntime.jsx(Je.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea",children:R})})};function p(t){let{optional:e}=t||{},o=Lt.useContext(_);if(!o&&!e)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return o}var y1=({externalFontUrl:t})=>jsxRuntime.jsx(react.Global,{styles:react.css`
|
|
12
12
|
${t&&`
|
|
13
13
|
@font-face {
|
|
14
14
|
font-family: 'custom-font';
|
|
@@ -8,7 +8,7 @@ import d1 from'@emotion/styled';import Lt,{forwardRef,useRef,useState,useEffect,
|
|
|
8
8
|
@media (max-width: 1040px) {
|
|
9
9
|
${({$smallScreenAlign:t})=>t&&`align-self: ${t};`}
|
|
10
10
|
}
|
|
11
|
-
`;function l2({source:t,showWatermark:e,align:o,smallScreenAlign:n="center",style:s={}}){if(!e)return null;let a=()=>{let l=window.location.hostname.replace("www.","");window.open(`https://www.stigg.io/?utm_source=${l}&utm_medium=referral&utm_campaign=${t}`,"_blank");};return jsx(vt,{$alignSelf:o,$smallScreenAlign:n,className:yt,style:r({cursor:"pointer"},s),onClick:a,children:jsx(kt,{})})}var O=class{error(e,o,...n){console.error(e,o||{},n);}log(e,o){console.log(e,o||{});}debug(e,o){console.debug(e,o||{});}},m1=new O;var u1="8.
|
|
11
|
+
`;function l2({source:t,showWatermark:e,align:o,smallScreenAlign:n="center",style:s={}}){if(!e)return null;let a=()=>{let l=window.location.hostname.replace("www.","");window.open(`https://www.stigg.io/?utm_source=${l}&utm_medium=referral&utm_campaign=${t}`,"_blank");};return jsx(vt,{$alignSelf:o,$smallScreenAlign:n,className:yt,style:r({cursor:"pointer"},s),onClick:a,children:jsx(kt,{})})}var O=class{error(e,o,...n){console.error(e,o||{},n);}log(e,o){console.log(e,o||{});}debug(e,o){console.debug(e,o||{});}},m1=new O;var u1="8.1.0";var h1="@stigg/react-sdk";var _=Lt.createContext(null);_.displayName="StiggContext";var Tt="en-US",v2=({apiKey:t,baseUri:e,baseEdgeUri:o,enableEdge:n,customerId:s,customerToken:a,resourceId:l,theme:d,locale:g,cacheTtlMs:c,useEntitlementPolling:S,entitlementPollingInterval:E,entitlementsFallback:P,stiggClient:U,children:R,offline:W,clientName:Z=h1,clientVersion:ct=u1})=>{let o1=useRef(t),r1={apiKey:t,customerId:s,customerToken:a,resourceId:l,baseUri:e,baseEdgeUri:o,enableEdge:n,entitlementsFallback:P,cacheTtlMs:c,useEntitlementPolling:S,entitlementPollingInterval:E,clientName:Z,clientVersion:ct,offline:W},[M,G]=useState(()=>({stigg:U!=null?U:x1.initialize(i(r({},r1),{lazyLoad:true})),locale:g||Tt,isInitialized:false,theme:d,refreshData:()=>y(null,null,function*(){G(u=>i(r({},u),{customerPortalUpdatedAt:new Date})),yield M.stigg.refresh();})}));return useEffect(()=>{let u=true,N=f=>{u&&G(f);},$=()=>N(f=>i(r({},f),{updatedAt:new Date})),Ct=f=>N(b=>(b.stigg&&b.stigg.removeListener("entitlementsUpdated",$),f.addListener("entitlementsUpdated",$),i(r({},b),{stigg:f,isInitialized:true,updatedAt:new Date})));return y(null,null,function*(){let f=M.stigg;t!==o1.current&&(m1.log("Updating stigg client",{apiKey:t}),o1.current=t,f=x1.initialize(r({},r1)),N(b=>i(r({},b),{isInitialized:false,updatedAt:new Date}))),yield f.waitForInitialization(),Ct(f);}),()=>{u=false,M.stigg.removeListener("entitlementsUpdated",$),M.stigg.clearCustomer();}},[t]),useEffect(()=>{let u=M.stigg;s?u.setCustomerId(s,a,l):u.clearCustomer();},[s,a,l]),useEffect(()=>{G(u=>i(r({},u),{theme:d}));},[d]),jsx(_.Provider,{value:M,children:jsx(SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea",children:R})})};function p(t){let{optional:e}=t||{},o=useContext(_);if(!o&&!e)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return o}var y1=({externalFontUrl:t})=>jsx(Global,{styles:css`
|
|
12
12
|
${t&&`
|
|
13
13
|
@font-face {
|
|
14
14
|
font-family: 'custom-font';
|