@xylabs/sdk-react 2.9.31 → 2.9.34
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/cjs5/components/LinkEx/LinkToEx.d.ts +4 -2
- package/dist/cjs5/components/LinkEx/index.d.ts +1 -2
- package/dist/cjs5/hooks/index.d.ts +2 -0
- package/dist/cjs5/hooks/useInterval.d.ts +2 -0
- package/dist/cjs5/hooks/useTimeout.d.ts +2 -0
- package/dist/cjs5/index.js +40 -2
- package/dist/cjs5/index.js.map +1 -1
- package/dist/components/LinkEx/LinkToEx.d.ts +4 -2
- package/dist/components/LinkEx/LinkToEx.js +10 -3
- package/dist/components/LinkEx/LinkToEx.js.map +1 -1
- package/dist/components/LinkEx/index.d.ts +1 -2
- package/dist/components/LinkEx/index.js +1 -2
- package/dist/components/LinkEx/index.js.map +1 -1
- package/dist/esm2015/components/LinkEx/LinkToEx.d.ts +4 -2
- package/dist/esm2015/components/LinkEx/index.d.ts +1 -2
- package/dist/esm2015/hooks/index.d.ts +2 -0
- package/dist/esm2015/hooks/useInterval.d.ts +2 -0
- package/dist/esm2015/hooks/useTimeout.d.ts +2 -0
- package/dist/esm2015/index.js +38 -3
- package/dist/esm2015/index.js.map +1 -1
- package/dist/esm2017/components/LinkEx/LinkToEx.d.ts +4 -2
- package/dist/esm2017/components/LinkEx/index.d.ts +1 -2
- package/dist/esm2017/hooks/index.d.ts +2 -0
- package/dist/esm2017/hooks/useInterval.d.ts +2 -0
- package/dist/esm2017/hooks/useTimeout.d.ts +2 -0
- package/dist/esm2017/index.js +38 -3
- package/dist/esm2017/index.js.map +1 -1
- package/dist/esm5/components/LinkEx/LinkToEx.d.ts +4 -2
- package/dist/esm5/components/LinkEx/index.d.ts +1 -2
- package/dist/esm5/hooks/index.d.ts +2 -0
- package/dist/esm5/hooks/useInterval.d.ts +2 -0
- package/dist/esm5/hooks/useTimeout.d.ts +2 -0
- package/dist/esm5/index.js +38 -3
- package/dist/esm5/index.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useInterval.d.ts +2 -0
- package/dist/hooks/useInterval.js +15 -0
- package/dist/hooks/useInterval.js.map +1 -0
- package/dist/hooks/useTimeout.d.ts +2 -0
- package/dist/hooks/useTimeout.js +15 -0
- package/dist/hooks/useTimeout.js.map +1 -0
- package/dist/node/components/LinkEx/LinkToEx.d.ts +4 -2
- package/dist/node/components/LinkEx/index.d.ts +1 -2
- package/dist/node/hooks/index.d.ts +2 -0
- package/dist/node/hooks/useInterval.d.ts +2 -0
- package/dist/node/hooks/useTimeout.d.ts +2 -0
- package/dist/node/index.js +40 -2
- package/dist/node/index.js.map +1 -1
- package/dist/node-esm/components/LinkEx/LinkToEx.d.ts +4 -2
- package/dist/node-esm/components/LinkEx/index.d.ts +1 -2
- package/dist/node-esm/hooks/index.d.ts +2 -0
- package/dist/node-esm/hooks/useInterval.d.ts +2 -0
- package/dist/node-esm/hooks/useTimeout.d.ts +2 -0
- package/dist/node-esm/index.js +38 -3
- package/dist/node-esm/index.js.map +1 -1
- package/package.json +11 -11
- package/src/components/LinkEx/LinkToEx.tsx +11 -4
- package/src/components/LinkEx/index.ts +1 -3
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useInterval.ts +19 -0
- package/src/hooks/useTimeout.ts +19 -0
|
@@ -2,7 +2,9 @@ import { LinkProps } from '@mui/material';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { To } from 'react-router-dom';
|
|
4
4
|
interface Props extends LinkProps {
|
|
5
|
-
to
|
|
5
|
+
to?: To;
|
|
6
6
|
}
|
|
7
|
+
declare const LinkEx: React.FC<Props>;
|
|
8
|
+
/** @deprecated use LinkEx instead */
|
|
7
9
|
declare const LinkToEx: React.FC<Props>;
|
|
8
|
-
export { LinkToEx };
|
|
10
|
+
export { LinkEx, LinkToEx };
|
|
@@ -2,9 +2,16 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Link } from '@mui/material';
|
|
4
4
|
import { Link as RouterLink } from 'react-router-dom';
|
|
5
|
-
const
|
|
5
|
+
const LinkEx = (_a) => {
|
|
6
6
|
var { to } = _a, props = __rest(_a, ["to"]);
|
|
7
|
-
|
|
7
|
+
if (to) {
|
|
8
|
+
return _jsx(Link, Object.assign({ component: RouterLink, to: to }, props), void 0);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return _jsx(Link, Object.assign({}, props), void 0);
|
|
12
|
+
}
|
|
8
13
|
};
|
|
9
|
-
|
|
14
|
+
/** @deprecated use LinkEx instead */
|
|
15
|
+
const LinkToEx = LinkEx;
|
|
16
|
+
export { LinkEx, LinkToEx };
|
|
10
17
|
//# sourceMappingURL=LinkToEx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkToEx.js","sourceRoot":"","sources":["../../../src/components/LinkEx/LinkToEx.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAa,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,IAAI,IAAI,UAAU,EAAM,MAAM,kBAAkB,CAAA;AAMzD,MAAM,
|
|
1
|
+
{"version":3,"file":"LinkToEx.js","sourceRoot":"","sources":["../../../src/components/LinkEx/LinkToEx.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAa,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,IAAI,IAAI,UAAU,EAAM,MAAM,kBAAkB,CAAA;AAMzD,MAAM,MAAM,GAAoB,CAAC,EAAgB,EAAE,EAAE;QAApB,EAAE,EAAE,OAAY,EAAP,KAAK,cAAd,MAAgB,CAAF;IAC7C,IAAI,EAAE,EAAE;QACN,OAAO,KAAC,IAAI,kBAAC,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,IAAM,KAAK,UAAI,CAAA;KAC1D;SAAM;QACL,OAAO,KAAC,IAAI,oBAAK,KAAK,UAAI,CAAA;KAC3B;AACH,CAAC,CAAA;AAED,qCAAqC;AACrC,MAAM,QAAQ,GAAG,MAAM,CAAA;AAEvB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { LinkToEx };
|
|
1
|
+
export * from './LinkToEx';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LinkEx/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LinkEx/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
|
@@ -2,7 +2,9 @@ import { LinkProps } from '@mui/material';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { To } from 'react-router-dom';
|
|
4
4
|
interface Props extends LinkProps {
|
|
5
|
-
to
|
|
5
|
+
to?: To;
|
|
6
6
|
}
|
|
7
|
+
declare const LinkEx: React.FC<Props>;
|
|
8
|
+
/** @deprecated use LinkEx instead */
|
|
7
9
|
declare const LinkToEx: React.FC<Props>;
|
|
8
|
-
export { LinkToEx };
|
|
10
|
+
export { LinkEx, LinkToEx };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { LinkToEx };
|
|
1
|
+
export * from './LinkToEx';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export * from './useBreakpoint';
|
|
2
|
+
export * from './useInterval';
|
|
2
3
|
export * from './useLocalStorage';
|
|
3
4
|
export * from './useMediaQuery';
|
|
4
5
|
export * from './useMounted';
|
|
5
6
|
export * from './useNavigateToEthAddress';
|
|
6
7
|
export * from './useSpacing';
|
|
8
|
+
export * from './useTimeout';
|
|
7
9
|
export * from './useUserEvents';
|
|
8
10
|
export * from './useWebP';
|
|
9
11
|
export * from './useWindowSize';
|
package/dist/esm2015/index.js
CHANGED
|
@@ -1795,6 +1795,20 @@ const useBreakpoint = () => {
|
|
|
1795
1795
|
}
|
|
1796
1796
|
};
|
|
1797
1797
|
|
|
1798
|
+
const useInterval = (callback, delay) => {
|
|
1799
|
+
const intervalRef = useRef(-1);
|
|
1800
|
+
const savedCallback = useRef(callback);
|
|
1801
|
+
useEffect(() => {
|
|
1802
|
+
savedCallback.current = callback;
|
|
1803
|
+
}, [callback]);
|
|
1804
|
+
useEffect(() => {
|
|
1805
|
+
const tick = () => savedCallback.current();
|
|
1806
|
+
intervalRef.current = window.setInterval(tick, delay);
|
|
1807
|
+
return () => window.clearInterval(intervalRef.current);
|
|
1808
|
+
}, [delay]);
|
|
1809
|
+
return intervalRef;
|
|
1810
|
+
};
|
|
1811
|
+
|
|
1798
1812
|
const useLocalStorage = (key, defaultValue) => {
|
|
1799
1813
|
const [storedValue, setStoredValue] = useState(() => {
|
|
1800
1814
|
try {
|
|
@@ -1869,6 +1883,20 @@ const useSpacing = (value) => {
|
|
|
1869
1883
|
return theme.spacing(typeof value === 'string' ? parseInt(value) : value);
|
|
1870
1884
|
};
|
|
1871
1885
|
|
|
1886
|
+
const useTimeout = (callback, delay) => {
|
|
1887
|
+
const timeoutRef = useRef(-1);
|
|
1888
|
+
const savedCallback = useRef(callback);
|
|
1889
|
+
useEffect(() => {
|
|
1890
|
+
savedCallback.current = callback;
|
|
1891
|
+
}, [callback]);
|
|
1892
|
+
useEffect(() => {
|
|
1893
|
+
const tick = () => savedCallback.current();
|
|
1894
|
+
timeoutRef.current = window.setTimeout(tick, delay);
|
|
1895
|
+
return () => window.clearTimeout(timeoutRef.current);
|
|
1896
|
+
}, [delay]);
|
|
1897
|
+
return timeoutRef;
|
|
1898
|
+
};
|
|
1899
|
+
|
|
1872
1900
|
const useUserEvents = () => {
|
|
1873
1901
|
const { userEvents } = useContext(UserEventsContext);
|
|
1874
1902
|
if (!userEvents) {
|
|
@@ -2066,10 +2094,17 @@ const ExperimentsDebugger = (_a) => {
|
|
|
2066
2094
|
}) }), void 0));
|
|
2067
2095
|
};
|
|
2068
2096
|
|
|
2069
|
-
const
|
|
2097
|
+
const LinkEx = (_a) => {
|
|
2070
2098
|
var { to } = _a, props = __rest(_a, ["to"]);
|
|
2071
|
-
|
|
2099
|
+
if (to) {
|
|
2100
|
+
return jsx(Link, Object.assign({ component: Link$1, to: to }, props), void 0);
|
|
2101
|
+
}
|
|
2102
|
+
else {
|
|
2103
|
+
return jsx(Link, Object.assign({}, props), void 0);
|
|
2104
|
+
}
|
|
2072
2105
|
};
|
|
2106
|
+
/** @deprecated use LinkEx instead */
|
|
2107
|
+
const LinkToEx = LinkEx;
|
|
2073
2108
|
|
|
2074
2109
|
const MenuEx = (_a) => {
|
|
2075
2110
|
var { MenuListProps = {}, mode = 'light', colorize } = _a, props = __rest(_a, ["MenuListProps", "mode", "colorize"]);
|
|
@@ -2249,5 +2284,5 @@ const TokenAmount = (_a) => {
|
|
|
2249
2284
|
return (jsx(ButtonEx, Object.assign({ style: Object.assign({ backgroundColor: statusColor }, style), variant: "outlined", onClick: onButtonClick }, props, { children: jsxs(FlexRow, Object.assign({ justifyContent: "space-between", width: "100%", busy: amount === undefined, busySize: 16 }, { children: [jsxs(FlexRow, { children: [logo ? jsx("img", { src: img, height: 24 }, void 0) : null, label ? (jsx(Typography, Object.assign({ marginRight: 1, marginLeft: logo ? 1 : 0, noWrap: true, fontFamily: textFontFamily, variant: "caption" }, { children: label }), void 0)) : null] }, void 0), jsx(Typography, Object.assign({ color: textColor, noWrap: true, fontFamily: textFontFamily, variant: "body1", style: { textTransform: 'none' } }, { children: amountString }), void 0)] }), void 0) }), void 0));
|
|
2250
2285
|
};
|
|
2251
2286
|
|
|
2252
|
-
export { ActionStatusType, AppBarEx, Background, BasePage, BreadcrumbsEx, BusyBox, ButtonEx, ContactPointOption, CookieConsent, CookieConsentBody, CookieConsentContext, CookieConsentLoader, CoverProgress, DebugUserEventsContext, DripCustomEvent, DripStandardEvents, ErrorDialog, EthAccount, EthersContext, EthersLoader, Experiment, Experiments, ExperimentsDebugger, FacebookCustomEvent, FacebookStandardEvents, Fbq, FlexCol, FlexGrowCol, FlexGrowRow, FlexRow, GoogleBaseEvent, GoogleCustomEvent, GoogleStandardEvents, GoogleUserEventHandler, Gtag, Gtm, HoverScale, Identicon, InvertableThemeProvider, ItemAvailability, LinkToEx, MapCategoryType, MenuEx, MessageDialog, NetworkSettingsContext, NetworkSettingsLoader, NumberStatus, PixelDebugger, PixelDebuggerProvider, PixelDebuggerToggle, Portal, QuickTipButton, Rdt, RedditCustomEvent, RedditStandardEvents, RedirectWithQuery, Referrer, RichResult, ScrollToTop, ScrollToTopButton, SelectEx, SnapTr, SnapchatStandardEvents, TiktokCustomEvent, TiktokStandardEvents, TokenAmount, Ttq, UserEventsContext, UserEventsLoader, XyBaseEvent, XyCustomEvent, XyUserEventHandler, XyoUserEventHandler, enableProfileLogging, getApiStage, getLocalStorageObject, getSessionStorageObject, isLocalhost, profileBlock, profileResults, resolveThemeColors, setLocalStorageObject, setSessionStorageObject, useAsyncEffect, useBreakpoint, useCookieConsent, useLocalStorage, useMounted, useNavigateToEthAddress, useSpacing, useUserEvents, useWebP, useWindowSize };
|
|
2287
|
+
export { ActionStatusType, AppBarEx, Background, BasePage, BreadcrumbsEx, BusyBox, ButtonEx, ContactPointOption, CookieConsent, CookieConsentBody, CookieConsentContext, CookieConsentLoader, CoverProgress, DebugUserEventsContext, DripCustomEvent, DripStandardEvents, ErrorDialog, EthAccount, EthersContext, EthersLoader, Experiment, Experiments, ExperimentsDebugger, FacebookCustomEvent, FacebookStandardEvents, Fbq, FlexCol, FlexGrowCol, FlexGrowRow, FlexRow, GoogleBaseEvent, GoogleCustomEvent, GoogleStandardEvents, GoogleUserEventHandler, Gtag, Gtm, HoverScale, Identicon, InvertableThemeProvider, ItemAvailability, LinkEx, LinkToEx, MapCategoryType, MenuEx, MessageDialog, NetworkSettingsContext, NetworkSettingsLoader, NumberStatus, PixelDebugger, PixelDebuggerProvider, PixelDebuggerToggle, Portal, QuickTipButton, Rdt, RedditCustomEvent, RedditStandardEvents, RedirectWithQuery, Referrer, RichResult, ScrollToTop, ScrollToTopButton, SelectEx, SnapTr, SnapchatStandardEvents, TiktokCustomEvent, TiktokStandardEvents, TokenAmount, Ttq, UserEventsContext, UserEventsLoader, XyBaseEvent, XyCustomEvent, XyUserEventHandler, XyoUserEventHandler, enableProfileLogging, getApiStage, getLocalStorageObject, getSessionStorageObject, isLocalhost, profileBlock, profileResults, resolveThemeColors, setLocalStorageObject, setSessionStorageObject, useAsyncEffect, useBreakpoint, useCookieConsent, useInterval, useLocalStorage, useMounted, useNavigateToEthAddress, useSpacing, useTimeout, useUserEvents, useWebP, useWindowSize };
|
|
2253
2288
|
//# sourceMappingURL=index.js.map
|