@stigg/react-sdk 7.27.0 → 7.28.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-P3BWIUOZ.cjs.js → CreditUsageChart-767SG75X.cjs.js} +19 -19
- package/dist/{CreditUsageChart-TQR4YFYZ.esm.js → CreditUsageChart-URN6IPYD.esm.js} +1 -1
- package/dist/{chunk-4YPINBLC.esm.js → chunk-B5FDE2OH.esm.js} +1 -1
- package/dist/{chunk-5K62MKBQ.cjs.js → chunk-LW3LLUI6.cjs.js} +1 -1
- package/dist/stigg-sdk.cjs.js +170 -170
- package/dist/stigg-sdk.esm.js +2 -2
- package/package.json +2 -2
|
@@ -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 se({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 h1="7.
|
|
11
|
+
`;function se({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 h1="7.28.0";var u1="@stigg/react-sdk";var I=Lt.createContext(null);I.displayName="StiggContext";var Ft="en-US",ye=({apiKey:t,baseUri:e,baseEdgeUri:o,enableEdge:n,customerId:s,customerToken:a,resourceId:l,theme:d,locale:p,cacheTtlMs:c,useEntitlementPolling:S,entitlementPollingInterval:E,entitlementsFallback:P,stiggClient:T,children:R,offline:W,clientName:Z=u1,clientVersion:ct=h1})=>{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:T!=null?T:x1.initialize(i(r({},r1),{lazyLoad:true})),locale:p||Ft,isInitialized:false,theme:d,refreshData:()=>y(null,null,function*(){G(h=>i(r({},h),{customerPortalUpdatedAt:new Date})),yield M.stigg.refresh();})}));return useEffect(()=>{let h=true,$=f=>{h&&G(f);},N=()=>$(f=>i(r({},f),{updatedAt:new Date})),Ct=f=>$(b=>(b.stigg&&b.stigg.removeListener("entitlementsUpdated",N),f.addListener("entitlementsUpdated",N),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)),$(b=>i(r({},b),{isInitialized:false,updatedAt:new Date}))),yield f.waitForInitialization(),Ct(f);}),()=>{h=false,M.stigg.removeListener("entitlementsUpdated",N),M.stigg.clearCustomer();}},[t]),useEffect(()=>{let h=M.stigg;s?h.setCustomerId(s,a,l):h.clearCustomer();},[s,a,l]),useEffect(()=>{G(h=>i(r({},h),{theme:d}));},[d]),jsx(I.Provider,{value:M,children:jsx(SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea",children:R})})};function g(t){let{optional:e}=t||{},o=useContext(I);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';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
@media (max-width: 1040px) {
|
|
9
9
|
${({$smallScreenAlign:t})=>t&&`align-self: ${t};`}
|
|
10
10
|
}
|
|
11
|
-
`;function se({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 h1="7.
|
|
11
|
+
`;function se({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 h1="7.28.0";var u1="@stigg/react-sdk";var I=Lt__default.default.createContext(null);I.displayName="StiggContext";var Ft="en-US",ye=({apiKey:t,baseUri:e,baseEdgeUri:o,enableEdge:n,customerId:s,customerToken:a,resourceId:l,theme:d,locale:p,cacheTtlMs:c,useEntitlementPolling:S,entitlementPollingInterval:E,entitlementsFallback:P,stiggClient:T,children:R,offline:W,clientName:Z=u1,clientVersion:ct=h1})=>{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:T!=null?T:x1__default.default.initialize(i(r({},r1),{lazyLoad:true})),locale:p||Ft,isInitialized:false,theme:d,refreshData:()=>y(null,null,function*(){G(h=>i(r({},h),{customerPortalUpdatedAt:new Date})),yield M.stigg.refresh();})}));return Lt.useEffect(()=>{let h=true,$=f=>{h&&G(f);},N=()=>$(f=>i(r({},f),{updatedAt:new Date})),Ct=f=>$(b=>(b.stigg&&b.stigg.removeListener("entitlementsUpdated",N),f.addListener("entitlementsUpdated",N),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)),$(b=>i(r({},b),{isInitialized:false,updatedAt:new Date}))),yield f.waitForInitialization(),Ct(f);}),()=>{h=false,M.stigg.removeListener("entitlementsUpdated",N),M.stigg.clearCustomer();}},[t]),Lt.useEffect(()=>{let h=M.stigg;s?h.setCustomerId(s,a,l):h.clearCustomer();},[s,a,l]),Lt.useEffect(()=>{G(h=>i(r({},h),{theme:d}));},[d]),jsxRuntime.jsx(I.Provider,{value:M,children:jsxRuntime.jsx(Y2.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea",children:R})})};function g(t){let{optional:e}=t||{},o=Lt.useContext(I);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';
|